From: Andrea Amorese Date: Tue, 28 Sep 2021 10:26:18 +0000 (+0200) Subject: Built motion from commit 05359493.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=edb1c1c697a13427646340527a32d12a3e9fdcb2;p=motion2.git Built motion from commit 05359493.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 859a526..1e5a74d 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-28T09:51:55.779Z", + "time": "2021-09-28T10:08:24.295Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 88b7896..a38bca8 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-28T09:51:55.779Z", + "time": "2021-09-28T10:08:24.295Z", "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 14f07d8..633a598 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 _0x6666=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x3d1805,_0x3f3c92){var _0x52d01d=function(_0x3c9ef6){while(--_0x3c9ef6){_0x3d1805['push'](_0x3d1805['shift']());}};_0x52d01d(++_0x3f3c92);}(_0x6666,0x1c7));var _0x6666=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x6666[_0x1b745b];return _0x120a9d;};'use strict';var Sequelize=require(_0x6666('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x6beec2){return this[_0x6666('0x1')](_0x6666('0x2'));}},'action':{'type':Sequelize[_0x6666('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6666('0x4'),_0x6666('0x5'),_0x6666('0x6'),_0x6666('0x7'),'urlForward',_0x6666('0x8'),'bot',_0x6666('0x9')]],'msg':_0x6666('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x6666('0x3')](0x1000),'comment':_0x6666('0xb')},'data2':{'type':Sequelize[_0x6666('0x3')](0x1000),'comment':_0x6666('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6666('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x6666('0xe')},'data5':{'type':Sequelize[_0x6666('0x3')](0x1000),'comments':_0x6666('0xf')},'data6':{'type':Sequelize[_0x6666('0x3')],'comments':_0x6666('0x10')},'data7':{'type':Sequelize[_0x6666('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x9f56=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]'];(function(_0x16041c,_0x3e864a){var _0x2ba85d=function(_0x189229){while(--_0x189229){_0x16041c['push'](_0x16041c['shift']());}};_0x2ba85d(++_0x3e864a);}(_0x9f56,0x134));var _0x69f5=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x9f56[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x69f5('0x0'));module[_0x69f5('0x1')]={'name':{'type':Sequelize[_0x69f5('0x2')],'get':function(_0x11c0bb){return this[_0x69f5('0x3')]('action');}},'action':{'type':Sequelize[_0x69f5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x69f5('0x5'),_0x69f5('0x6'),_0x69f5('0x7'),_0x69f5('0x8'),_0x69f5('0x9'),_0x69f5('0xa'),'bot',_0x69f5('0xb')]],'msg':_0x69f5('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x69f5('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x69f5('0xd')},'data3':{'type':Sequelize[_0x69f5('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[_0x69f5('0x4')](0x1000),'comments':_0x69f5('0xe')},'data5':{'type':Sequelize[_0x69f5('0x4')](0x1000),'comments':_0x69f5('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x69f5('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 52c8086..b378df7 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 _0x6507=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','body','Action','catch','find','params','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x4d4001,_0x4303ba){var _0x18cbe6=function(_0x48a0b8){while(--_0x48a0b8){_0x4d4001['push'](_0x4d4001['shift']());}};_0x18cbe6(++_0x4303ba);}(_0x6507,0x121));var _0x7650=function(_0x4d90a7,_0x229105){_0x4d90a7=_0x4d90a7-0x0;var _0x202531=_0x6507[_0x4d90a7];return _0x202531;};'use strict';var emlformat=require(_0x7650('0x0'));var rimraf=require(_0x7650('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7650('0x2'));var rp=require('request-promise');var moment=require(_0x7650('0x3'));var BPromise=require(_0x7650('0x4'));var Mustache=require(_0x7650('0x5'));var util=require(_0x7650('0x6'));var path=require(_0x7650('0x7'));var sox=require(_0x7650('0x8'));var csv=require(_0x7650('0x9'));var ejs=require(_0x7650('0xa'));var fs=require('fs');var fs_extra=require(_0x7650('0xb'));var _=require(_0x7650('0xc'));var squel=require(_0x7650('0xd'));var crypto=require('crypto');var jsforce=require(_0x7650('0xe'));var deskjs=require(_0x7650('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7650('0x10'));var Papa=require(_0x7650('0x11'));var Redis=require(_0x7650('0x12'));var authService=require(_0x7650('0x13'));var qs=require(_0x7650('0x14'));var as=require(_0x7650('0x15'));var hardwareService=require(_0x7650('0x16'));var logger=require(_0x7650('0x17'))('api');var utils=require(_0x7650('0x18'));var config=require(_0x7650('0x19'));var licenseUtil=require(_0x7650('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c7042,_0x73961f){_0x73961f=_0x73961f||0xcc;return function(_0x3a11d0){if(_0x3a11d0){return _0x2c7042[_0x7650('0x1b')](_0x73961f);}return _0x2c7042[_0x7650('0x1c')](_0x73961f)[_0x7650('0x1d')]();};}function respondWithResult(_0x20ef9f,_0x2c2c4e){_0x2c2c4e=_0x2c2c4e||0xc8;return function(_0x1d9720){if(_0x1d9720){return _0x20ef9f[_0x7650('0x1c')](_0x2c2c4e)[_0x7650('0x1e')](_0x1d9720);}};}function respondWithFilteredResult(_0x45dce2,_0x86f1f6){return function(_0x3686f2){if(_0x3686f2){var _0xc1908b=typeof _0x86f1f6[_0x7650('0x1f')]===_0x7650('0x20')&&typeof _0x86f1f6['limit']==='undefined';var _0x490a6f=_0x3686f2[_0x7650('0x21')];var _0x2c5306=_0xc1908b?0x0:_0x86f1f6[_0x7650('0x1f')];var _0x408848=_0xc1908b?_0x3686f2[_0x7650('0x21')]:_0x86f1f6[_0x7650('0x1f')]+_0x86f1f6['limit'];var _0x10d11c;if(_0x408848>=_0x490a6f){_0x408848=_0x490a6f;_0x10d11c=0xc8;}else{_0x10d11c=0xce;}_0x45dce2['status'](_0x10d11c);return _0x45dce2[_0x7650('0x22')](_0x7650('0x23'),_0x2c5306+'-'+_0x408848+'/'+_0x490a6f)[_0x7650('0x1e')](_0x3686f2);}return null;};}function patchUpdates(_0x45774b){return function(_0x1f8785){try{jsonpatch[_0x7650('0x24')](_0x1f8785,_0x45774b,!![]);}catch(_0x50f484){return BPromise['reject'](_0x50f484);}return _0x1f8785[_0x7650('0x25')]();};}function saveUpdates(_0x358dae,_0x334f8b){return function(_0x4f7893){if(_0x4f7893){return _0x4f7893[_0x7650('0x26')](_0x358dae)[_0x7650('0x27')](function(_0x2c18c4){return _0x2c18c4;});}return null;};}function removeEntity(_0x5eef6e,_0x2acca0){return function(_0xfec1ff){if(_0xfec1ff){return _0xfec1ff[_0x7650('0x28')]()['then'](function(){_0x5eef6e[_0x7650('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f5dc,_0x2e9882){return function(_0x335232){if(!_0x335232){_0x57f5dc[_0x7650('0x1b')](0x194);}return _0x335232;};}function handleError(_0x567b30,_0x26ea6b){_0x26ea6b=_0x26ea6b||0x1f4;return function(_0x41e2f0){logger[_0x7650('0x29')](_0x41e2f0[_0x7650('0x2a')]);if(_0x41e2f0['name']){delete _0x41e2f0[_0x7650('0x2b')];}_0x567b30['status'](_0x26ea6b)['send'](_0x41e2f0);};}exports[_0x7650('0x26')]=function(_0x182b39,_0x2b4880){if(_0x182b39[_0x7650('0x2c')]['id']){delete _0x182b39[_0x7650('0x2c')]['id'];}return db[_0x7650('0x2d')]['find']({'where':{'id':_0x182b39['params']['id']}})[_0x7650('0x27')](handleEntityNotFound(_0x2b4880,null))['then'](saveUpdates(_0x182b39['body'],null))[_0x7650('0x27')](respondWithResult(_0x2b4880,null))[_0x7650('0x2e')](handleError(_0x2b4880,null));};exports[_0x7650('0x28')]=function(_0x3fa4d,_0x2879e0){return db[_0x7650('0x2d')][_0x7650('0x2f')]({'where':{'id':_0x3fa4d[_0x7650('0x30')]['id']}})[_0x7650('0x27')](handleEntityNotFound(_0x2879e0,null))[_0x7650('0x27')](removeEntity(_0x2879e0,null))[_0x7650('0x2e')](handleError(_0x2879e0,null));}; \ No newline at end of file +var _0xb1da=['to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','name','send','body','Action','find','params','catch','rimraf','zip-dir','moment','bluebird','sox'];(function(_0x543a8d,_0x188002){var _0x138c79=function(_0x661941){while(--_0x661941){_0x543a8d['push'](_0x543a8d['shift']());}};_0x138c79(++_0x188002);}(_0xb1da,0xeb));var _0xab1d=function(_0x4fea28,_0x4d5298){_0x4fea28=_0x4fea28-0x0;var _0x892cab=_0xb1da[_0x4fea28];return _0x892cab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab1d('0x0'));var zipdir=require(_0xab1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab1d('0x2'));var BPromise=require(_0xab1d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xab1d('0x4'));var csv=require(_0xab1d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab1d('0x6'));var _=require(_0xab1d('0x7'));var squel=require(_0xab1d('0x8'));var crypto=require(_0xab1d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xab1d('0x5'));var querystring=require('querystring');var Papa=require(_0xab1d('0xa'));var Redis=require(_0xab1d('0xb'));var authService=require(_0xab1d('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab1d('0xd'));var logger=require(_0xab1d('0xe'))(_0xab1d('0xf'));var utils=require('../../config/utils');var config=require(_0xab1d('0x10'));var licenseUtil=require(_0xab1d('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f4b5b,_0x6bae3e){_0x6bae3e=_0x6bae3e||0xcc;return function(_0x1086c7){if(_0x1086c7){return _0x4f4b5b['sendStatus'](_0x6bae3e);}return _0x4f4b5b[_0xab1d('0x12')](_0x6bae3e)['end']();};}function respondWithResult(_0x47e267,_0x7b110d){_0x7b110d=_0x7b110d||0xc8;return function(_0x45f3c6){if(_0x45f3c6){return _0x47e267[_0xab1d('0x12')](_0x7b110d)[_0xab1d('0x13')](_0x45f3c6);}};}function respondWithFilteredResult(_0x2f6acd,_0x57cfd6){return function(_0x1951f5){if(_0x1951f5){var _0xff7558=typeof _0x57cfd6[_0xab1d('0x14')]===_0xab1d('0x15')&&typeof _0x57cfd6[_0xab1d('0x16')]===_0xab1d('0x15');var _0x31df7c=_0x1951f5[_0xab1d('0x17')];var _0x24eb7f=_0xff7558?0x0:_0x57cfd6[_0xab1d('0x14')];var _0x3e969f=_0xff7558?_0x1951f5[_0xab1d('0x17')]:_0x57cfd6['offset']+_0x57cfd6[_0xab1d('0x16')];var _0x19924e;if(_0x3e969f>=_0x31df7c){_0x3e969f=_0x31df7c;_0x19924e=0xc8;}else{_0x19924e=0xce;}_0x2f6acd[_0xab1d('0x12')](_0x19924e);return _0x2f6acd[_0xab1d('0x18')](_0xab1d('0x19'),_0x24eb7f+'-'+_0x3e969f+'/'+_0x31df7c)[_0xab1d('0x13')](_0x1951f5);}return null;};}function patchUpdates(_0x3085e0){return function(_0x3beb0b){try{jsonpatch[_0xab1d('0x1a')](_0x3beb0b,_0x3085e0,!![]);}catch(_0x262234){return BPromise['reject'](_0x262234);}return _0x3beb0b[_0xab1d('0x1b')]();};}function saveUpdates(_0x4f5278,_0x4abc24){return function(_0x376fb9){if(_0x376fb9){return _0x376fb9[_0xab1d('0x1c')](_0x4f5278)[_0xab1d('0x1d')](function(_0x314d18){return _0x314d18;});}return null;};}function removeEntity(_0x68ef4a,_0x250a3c){return function(_0x234695){if(_0x234695){return _0x234695[_0xab1d('0x1e')]()[_0xab1d('0x1d')](function(){_0x68ef4a['status'](0xcc)[_0xab1d('0x1f')]();});}};}function handleEntityNotFound(_0x3c96f8,_0x3fb7fd){return function(_0x36c9fb){if(!_0x36c9fb){_0x3c96f8[_0xab1d('0x20')](0x194);}return _0x36c9fb;};}function handleError(_0x1b98e3,_0x3989de){_0x3989de=_0x3989de||0x1f4;return function(_0x336625){logger['error'](_0x336625['stack']);if(_0x336625[_0xab1d('0x21')]){delete _0x336625[_0xab1d('0x21')];}_0x1b98e3['status'](_0x3989de)[_0xab1d('0x22')](_0x336625);};}exports[_0xab1d('0x1c')]=function(_0xc0a3c1,_0xbf3ef){if(_0xc0a3c1[_0xab1d('0x23')]['id']){delete _0xc0a3c1[_0xab1d('0x23')]['id'];}return db[_0xab1d('0x24')][_0xab1d('0x25')]({'where':{'id':_0xc0a3c1[_0xab1d('0x26')]['id']}})[_0xab1d('0x1d')](handleEntityNotFound(_0xbf3ef,null))[_0xab1d('0x1d')](saveUpdates(_0xc0a3c1[_0xab1d('0x23')],null))[_0xab1d('0x1d')](respondWithResult(_0xbf3ef,null))[_0xab1d('0x27')](handleError(_0xbf3ef,null));};exports[_0xab1d('0x1e')]=function(_0x67f318,_0x28b287){return db['Action'][_0xab1d('0x25')]({'where':{'id':_0x67f318[_0xab1d('0x26')]['id']}})[_0xab1d('0x1d')](handleEntityNotFound(_0x28b287,null))[_0xab1d('0x1d')](removeEntity(_0x28b287,null))[_0xab1d('0x27')](handleError(_0x28b287,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index dc6ff6c..193d24c 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 _0xa96b=['exports','define','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./action.attributes'];(function(_0xb30689,_0x59a222){var _0x2bed52=function(_0x3a8e4a){while(--_0x3a8e4a){_0xb30689['push'](_0xb30689['shift']());}};_0x2bed52(++_0x59a222);}(_0xa96b,0x10b));var _0xba96=function(_0xaf0582,_0xe0faa0){_0xaf0582=_0xaf0582-0x0;var _0x23f61d=_0xa96b[_0xaf0582];return _0x23f61d;};'use strict';var _=require(_0xba96('0x0'));var util=require('util');var logger=require(_0xba96('0x1'))(_0xba96('0x2'));var moment=require(_0xba96('0x3'));var BPromise=require(_0xba96('0x4'));var rp=require(_0xba96('0x5'));var fs=require('fs');var path=require(_0xba96('0x6'));var rimraf=require(_0xba96('0x7'));var config=require('../../config/environment');var attributes=require(_0xba96('0x8'));module[_0xba96('0x9')]=function(_0x4b0b61,_0x498053){return _0x4b0b61[_0xba96('0xa')]('Action',attributes,{'tableName':_0xba96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ba3=['request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api','bluebird'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x5ba3,0x140));var _0x35ba=function(_0x731977,_0x45eaf6){_0x731977=_0x731977-0x0;var _0x4eb259=_0x5ba3[_0x731977];return _0x4eb259;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var logger=require(_0x35ba('0x1'))(_0x35ba('0x2'));var moment=require('moment');var BPromise=require(_0x35ba('0x3'));var rp=require(_0x35ba('0x4'));var fs=require('fs');var path=require(_0x35ba('0x5'));var rimraf=require('rimraf');var config=require(_0x35ba('0x6'));var attributes=require(_0x35ba('0x7'));module[_0x35ba('0x8')]=function(_0x596785,_0x54c722){return _0x596785[_0x35ba('0x9')](_0x35ba('0xa'),attributes,{'tableName':_0x35ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 3d46abe..0fcc5bf 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3d74a6,_0x3ae2e4){var _0x4e3790=function(_0x2a360b){while(--_0x2a360b){_0x3d74a6['push'](_0x3d74a6['shift']());}};_0x4e3790(++_0x3ae2e4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'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')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2f1fc5,_0x54daf5){var _0x182770=function(_0x210210){while(--_0x210210){_0x2f1fc5['push'](_0x2f1fc5['shift']());}};_0x182770(++_0x54daf5);}(_0x1261,0x144));var _0x1126=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x1261[_0x5a2299];return _0xedff0f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 8c82b07..57973c0 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 _0x39da=['isAuthenticated','update','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x3e5646,_0x56ebd1){var _0x5ead70=function(_0x55a14a){while(--_0x55a14a){_0x3e5646['push'](_0x3e5646['shift']());}};_0x5ead70(++_0x56ebd1);}(_0x39da,0x1e3));var _0xa39d=function(_0x33e4d3,_0xfce382){_0x33e4d3=_0x33e4d3-0x0;var _0x2a2c89=_0x39da[_0x33e4d3];return _0x2a2c89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa39d('0x0'));var timeout=require(_0xa39d('0x1'));var express=require('express');var router=express[_0xa39d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa39d('0x3'));var interaction=require(_0xa39d('0x4'));var config=require(_0xa39d('0x5'));var controller=require(_0xa39d('0x6'));router[_0xa39d('0x7')](_0xa39d('0x8'),auth[_0xa39d('0x9')](),controller[_0xa39d('0xa')]);router['delete'](_0xa39d('0x8'),auth[_0xa39d('0x9')](),controller[_0xa39d('0xb')]);module['exports']=router; \ No newline at end of file +var _0x82a0=['fs-extra','./action.controller','put','isAuthenticated','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0xaddf7f,_0xa096cb){var _0x1c10f7=function(_0x246763){while(--_0x246763){_0xaddf7f['push'](_0xaddf7f['shift']());}};_0x1c10f7(++_0xa096cb);}(_0x82a0,0x134));var _0x082a=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x82a0[_0x3c4dad];return _0x1a4f49;};'use strict';var multer=require(_0x082a('0x0'));var util=require(_0x082a('0x1'));var path=require(_0x082a('0x2'));var timeout=require(_0x082a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x082a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x082a('0x5'));router[_0x082a('0x6')]('/:id',auth[_0x082a('0x7')](),controller[_0x082a('0x8')]);router[_0x082a('0x9')](_0x082a('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x082a('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 4970743..3100d72 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 _0xae24=['sequelize','STRING'];(function(_0x4c264f,_0x2e4ed3){var _0x5628be=function(_0x394b2c){while(--_0x394b2c){_0x4c264f['push'](_0x4c264f['shift']());}};_0x5628be(++_0x2e4ed3);}(_0xae24,0x182));var _0x4ae2=function(_0x4ab545,_0x4cf469){_0x4ab545=_0x4ab545-0x0;var _0x47ff9f=_0xae24[_0x4ab545];return _0x47ff9f;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x5ed58f,_0xc60fb3){var _0x190b42=function(_0x5baecc){while(--_0x5baecc){_0x5ed58f['push'](_0x5ed58f['shift']());}};_0x190b42(++_0xc60fb3);}(_0xd8fb,0x99));var _0xbd8f=function(_0x46d6a3,_0x17b7c4){_0x46d6a3=_0x46d6a3-0x0;var _0x563653=_0xd8fb[_0x46d6a3];return _0x563653;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f26a392..5821bfc 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 _0x498d=['left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','table','MetricId','metric','replace','function','format','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SEC_TO_TIME(%s)','value','select','orderBy','clone','output','web','fullPath','%s-%s.%s','name','randomstring','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','savename','run','runReport','IS\x20NOT\x20NULL','groupBy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','offset','count','set','apply','reject','save','update','destroy','get','CustomReports','then','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','params','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview'];(function(_0x19aacc,_0x49ad2a){var _0x2daf2a=function(_0x36f1de){while(--_0x36f1de){_0x19aacc['push'](_0x19aacc['shift']());}};_0x2daf2a(++_0x49ad2a);}(_0x498d,0x191));var _0xd498=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x498d[_0x305c31];return _0x17f39f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd498('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd498('0x1'));var rp=require(_0xd498('0x2'));var moment=require(_0xd498('0x3'));var BPromise=require(_0xd498('0x4'));var Mustache=require(_0xd498('0x5'));var util=require('util');var path=require(_0xd498('0x6'));var sox=require(_0xd498('0x7'));var csv=require(_0xd498('0x8'));var ejs=require(_0xd498('0x9'));var fs=require('fs');var fs_extra=require(_0xd498('0xa'));var _=require('lodash');var squel=require(_0xd498('0xb'));var crypto=require(_0xd498('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd498('0x8'));var querystring=require(_0xd498('0xd'));var Papa=require(_0xd498('0xe'));var Redis=require(_0xd498('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd498('0x10'));var hardwareService=require(_0xd498('0x11'));var logger=require(_0xd498('0x12'))(_0xd498('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd498('0x14'));var db=require(_0xd498('0x15'))['db'];var dbH=require('../../mysqldb')[_0xd498('0x16')];function respondWithStatusCode(_0x490224,_0x574247){_0x574247=_0x574247||0xcc;return function(_0x4e37a4){if(_0x4e37a4){return _0x490224[_0xd498('0x17')](_0x574247);}return _0x490224[_0xd498('0x18')](_0x574247)[_0xd498('0x19')]();};}function respondWithResult(_0x4071f7,_0x3ea947){_0x3ea947=_0x3ea947||0xc8;return function(_0x3b25c0){if(_0x3b25c0){return _0x4071f7[_0xd498('0x18')](_0x3ea947)[_0xd498('0x1a')](_0x3b25c0);}};}function respondWithFilteredResult(_0x344e5a,_0x5a7cd4){return function(_0x283b27){if(_0x283b27){var _0x58edf9=typeof _0x5a7cd4['offset']==='undefined'&&typeof _0x5a7cd4['limit']===_0xd498('0x1b');var _0x6adcdb=_0x283b27['count'];var _0x29d8d7=_0x58edf9?0x0:_0x5a7cd4[_0xd498('0x1c')];var _0x5210a3=_0x58edf9?_0x283b27[_0xd498('0x1d')]:_0x5a7cd4[_0xd498('0x1c')]+_0x5a7cd4['limit'];var _0x50da12;if(_0x5210a3>=_0x6adcdb){_0x5210a3=_0x6adcdb;_0x50da12=0xc8;}else{_0x50da12=0xce;}_0x344e5a['status'](_0x50da12);return _0x344e5a[_0xd498('0x1e')]('Content-Range',_0x29d8d7+'-'+_0x5210a3+'/'+_0x6adcdb)['json'](_0x283b27);}return null;};}function patchUpdates(_0x4b799a){return function(_0x3ac16e){try{jsonpatch[_0xd498('0x1f')](_0x3ac16e,_0x4b799a,!![]);}catch(_0x3883cf){return BPromise[_0xd498('0x20')](_0x3883cf);}return _0x3ac16e[_0xd498('0x21')]();};}function saveUpdates(_0x20aa7d,_0x31ef00){return function(_0x181ae7){if(_0x181ae7){return _0x181ae7[_0xd498('0x22')](_0x20aa7d)['then'](function(_0xd0e7dd){return _0xd0e7dd;});}return null;};}function removeEntity(_0x22860a,_0x2b8afa){return function(_0x413d17){if(_0x413d17){return _0x413d17[_0xd498('0x23')]()['then'](function(){var _0x2b5d88=_0x413d17[_0xd498('0x24')]({'plain':!![]});var _0x59a00c=_0xd498('0x25');return db['UserProfileResource'][_0xd498('0x23')]({'where':{'type':_0x59a00c,'resourceId':_0x2b5d88['id']}})[_0xd498('0x26')](function(){return _0x413d17;});})[_0xd498('0x26')](function(){_0x22860a[_0xd498('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x381ece,_0x5ee27d){return function(_0x4d4ff5){if(!_0x4d4ff5){_0x381ece[_0xd498('0x17')](0x194);}return _0x4d4ff5;};}function handleError(_0x47591a,_0x3444cd){_0x3444cd=_0x3444cd||0x1f4;return function(_0x2d49c8){logger[_0xd498('0x27')](_0x2d49c8[_0xd498('0x28')]);if(_0x2d49c8['name']){delete _0x2d49c8['name'];}_0x47591a[_0xd498('0x18')](_0x3444cd)[_0xd498('0x29')](_0x2d49c8);};}exports[_0xd498('0x2a')]=function(_0x524568,_0x308e03){var _0x5d7e17={},_0x4eb2f2={},_0x37e61e={'count':0x0,'rows':[]};var _0x22acf6=_[_0xd498('0x2b')](db[_0xd498('0x2c')][_0xd498('0x2d')],function(_0x27604d){return{'name':_0x27604d[_0xd498('0x2e')],'type':_0x27604d[_0xd498('0x2f')][_0xd498('0x30')]};});_0x4eb2f2['model']=_[_0xd498('0x2b')](_0x22acf6,'name');_0x4eb2f2['query']=_[_0xd498('0x31')](_0x524568[_0xd498('0x32')]);_0x4eb2f2[_0xd498('0x33')]=_[_0xd498('0x34')](_0x4eb2f2[_0xd498('0x35')],_0x4eb2f2[_0xd498('0x32')]);_0x5d7e17[_0xd498('0x36')]=_[_0xd498('0x34')](_0x4eb2f2['model'],qs['fields'](_0x524568[_0xd498('0x32')]['fields']));_0x5d7e17[_0xd498('0x36')]=_0x5d7e17['attributes'][_0xd498('0x37')]?_0x5d7e17[_0xd498('0x36')]:_0x4eb2f2['model'];if(!_0x524568[_0xd498('0x32')][_0xd498('0x38')](_0xd498('0x39'))){_0x5d7e17['limit']=qs[_0xd498('0x3a')](_0x524568[_0xd498('0x32')]['limit']);_0x5d7e17[_0xd498('0x1c')]=qs[_0xd498('0x1c')](_0x524568['query'][_0xd498('0x1c')]);}_0x5d7e17[_0xd498('0x3b')]=qs[_0xd498('0x3c')](_0x524568[_0xd498('0x32')][_0xd498('0x3c')]);_0x5d7e17[_0xd498('0x3d')]=qs['filters'](_['pick'](_0x524568[_0xd498('0x32')],_0x4eb2f2['filters']),_0x22acf6);if(_0x524568['query'][_0xd498('0x3e')]){_0x5d7e17['where']=_[_0xd498('0x3f')](_0x5d7e17[_0xd498('0x3d')],{'$or':_[_0xd498('0x2b')](_0x22acf6,function(_0x4bbd1f){if(_0x4bbd1f['type']!==_0xd498('0x40')){var _0x32863f={};_0x32863f[_0x4bbd1f['name']]={'$like':'%'+_0x524568['query'][_0xd498('0x3e')]+'%'};return _0x32863f;}})});}_0x5d7e17=_[_0xd498('0x3f')]({},_0x5d7e17,_0x524568[_0xd498('0x41')]);var _0x2288e3={'where':_0x5d7e17[_0xd498('0x3d')]};return db[_0xd498('0x2c')][_0xd498('0x1d')](_0x2288e3)[_0xd498('0x26')](function(_0x4d444a){_0x37e61e[_0xd498('0x1d')]=_0x4d444a;if(_0x524568['query'][_0xd498('0x42')]){_0x5d7e17[_0xd498('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x5d7e17);})[_0xd498('0x26')](function(_0x325f22){_0x37e61e[_0xd498('0x44')]=_0x325f22;return _0x37e61e;})[_0xd498('0x26')](respondWithFilteredResult(_0x308e03,_0x5d7e17))['catch'](handleError(_0x308e03,null));};exports['show']=function(_0x4514c6,_0x323e75){var _0x1b8615={'raw':![],'where':{'id':_0x4514c6[_0xd498('0x45')]['id']}},_0x86cc7a={};_0x86cc7a[_0xd498('0x35')]=_['keys'](db[_0xd498('0x2c')][_0xd498('0x2d')]);_0x86cc7a['query']=_[_0xd498('0x31')](_0x4514c6[_0xd498('0x32')]);_0x86cc7a['filters']=_[_0xd498('0x34')](_0x86cc7a[_0xd498('0x35')],_0x86cc7a[_0xd498('0x32')]);_0x1b8615[_0xd498('0x36')]=_[_0xd498('0x34')](_0x86cc7a[_0xd498('0x35')],qs[_0xd498('0x46')](_0x4514c6[_0xd498('0x32')][_0xd498('0x46')]));_0x1b8615[_0xd498('0x36')]=_0x1b8615[_0xd498('0x36')][_0xd498('0x37')]?_0x1b8615['attributes']:_0x86cc7a['model'];if(_0x4514c6[_0xd498('0x32')][_0xd498('0x42')]){_0x1b8615[_0xd498('0x43')]=[{'all':!![]}];}_0x1b8615=_[_0xd498('0x3f')]({},_0x1b8615,_0x4514c6[_0xd498('0x41')]);return db['AnalyticCustomReport']['find'](_0x1b8615)[_0xd498('0x26')](handleEntityNotFound(_0x323e75,null))['then'](respondWithResult(_0x323e75,null))[_0xd498('0x47')](handleError(_0x323e75,null));};exports[_0xd498('0x48')]=function(_0x59b466,_0xd22eb4){return db[_0xd498('0x2c')][_0xd498('0x48')](_0x59b466[_0xd498('0x49')],{})[_0xd498('0x26')](function(_0x2b3e43){var _0x58b442=_0x59b466['user']['get']({'plain':!![]});if(!_0x58b442)throw new Error(_0xd498('0x4a'));if(_0x58b442['role']===_0xd498('0x4b')){var _0x48a928=_0x2b3e43['get']({'plain':!![]});var _0x3cb4af=_0xd498('0x4c');return db['UserProfileSection'][_0xd498('0x4d')]({'where':{'name':_0x3cb4af,'userProfileId':_0x58b442[_0xd498('0x4e')]},'raw':!![]})[_0xd498('0x26')](function(_0x3892e5){if(_0x3892e5&&_0x3892e5[_0xd498('0x4f')]===0x0){return db['UserProfileResource'][_0xd498('0x48')]({'name':_0x48a928['name'],'resourceId':_0x48a928['id'],'type':_0xd498('0x25'),'sectionId':_0x3892e5['id']},{})[_0xd498('0x26')](function(){return _0x2b3e43;});}else{return _0x2b3e43;}})[_0xd498('0x47')](function(_0x345128){logger[_0xd498('0x27')](_0xd498('0x50'),_0x345128);throw _0x345128;});}return _0x2b3e43;})[_0xd498('0x26')](respondWithResult(_0xd22eb4,0xc9))[_0xd498('0x47')](handleError(_0xd22eb4,null));};exports[_0xd498('0x22')]=function(_0x387795,_0x38acbc){if(_0x387795[_0xd498('0x49')]['id']){delete _0x387795['body']['id'];}return db[_0xd498('0x2c')][_0xd498('0x4d')]({'where':{'id':_0x387795['params']['id']}})['then'](handleEntityNotFound(_0x38acbc,null))[_0xd498('0x26')](saveUpdates(_0x387795[_0xd498('0x49')],null))[_0xd498('0x26')](respondWithResult(_0x38acbc,null))[_0xd498('0x47')](handleError(_0x38acbc,null));};exports[_0xd498('0x23')]=function(_0x44766e,_0x773957){return db[_0xd498('0x2c')][_0xd498('0x4d')]({'where':{'id':_0x44766e['params']['id']}})[_0xd498('0x26')](handleEntityNotFound(_0x773957,null))[_0xd498('0x26')](removeEntity(_0x773957,null))[_0xd498('0x47')](handleError(_0x773957,null));};exports[_0xd498('0x51')]=function(_0x314871,_0x3113b0){var _0x4d227e=0xa;var _0x2a5a56=['join',_0xd498('0x52'),_0xd498('0x53'),_0xd498('0x54')];var _0x3f6003={'SUM':_0xd498('0x55'),'COUNT':_0xd498('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd498('0x57'),'MIN':_0xd498('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd498('0x59'),'GROUP_CONCAT ASC':_0xd498('0x5a'),'GROUP_CONCAT DESC':_0xd498('0x5b')};var _0x183634={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd498('0x5c'),'HOUR':_0xd498('0x5d'),'ROUND':_0xd498('0x5e'),'UNIX_TIMESTAMP':_0xd498('0x5f')};var _0x2fc63a=function(_0x4a4a9d){return!_[_0xd498('0x60')]([_0xd498('0x61'),'IS\x20NOT\x20NULL',_0xd498('0x62'),_0xd498('0x63')],_0x4a4a9d);};var _0x1fe9ee=function(_0x308313){if(!_0x308313||!_0x308313['rules'][_0xd498('0x37')]){return'';}for(var _0x130187='(',_0x316c87=0x0;_0x316c87<_0x308313[_0xd498('0x64')][_0xd498('0x37')];_0x316c87+=0x1){_0x316c87>0x0&&(_0x130187+='\x20'+_0x308313[_0xd498('0x65')]+'\x20');_0x130187+=_0x308313[_0xd498('0x64')][_0x316c87][_0xd498('0x66')]?_0x1fe9ee(_0x308313[_0xd498('0x64')][_0x316c87][_0xd498('0x66')]):_0x308313[_0xd498('0x64')][_0x316c87][_0xd498('0x67')]+'\x20'+_0x308313[_0xd498('0x64')][_0x316c87]['condition']+(_0x2fc63a(_0x308313[_0xd498('0x64')][_0x316c87][_0xd498('0x68')])?'\x20'+_0x308313[_0xd498('0x64')][_0x316c87]['value']:'');}return _0x130187+')';};var _0x343a36={'where':{'id':_0x314871['params']['id']}},_0xa2f7f9,_0x42db5a,_0x31fa27,_0x52e24f,_0x321bd3;_0x343a36=_[_0xd498('0x3f')]({},_0x343a36,_0x314871[_0xd498('0x41')]);return db['AnalyticCustomReport']['find'](_0x343a36)[_0xd498('0x26')](function(_0x5a7de5){if(_0x5a7de5){_0xa2f7f9=_0x5a7de5;return _0x5a7de5[_0xd498('0x69')]();}return null;})[_0xd498('0x26')](function(_0x406a5d){if(_0x406a5d){if(!_0x406a5d[_0xd498('0x37')]){throw new db[(_0xd498('0x6a'))][(_0xd498('0x6b'))](_0xd498('0x6c'),0x193);}_0x42db5a=_0x406a5d;return db[_0xd498('0x6d')][_0xd498('0x6e')]({'raw':!![]});}return null;})[_0xd498('0x26')](function(_0x2daead){if(_0x2daead){_0x31fa27=_[_0xd498('0x6f')](_0x2daead,'id');var _0x185535;var _0x1a8096=squel['select']();_0x1a8096[_0xd498('0x70')](_0xa2f7f9[_0xd498('0x71')]);for(var _0x15e224=0x0;_0x15e224<_0x42db5a[_0xd498('0x37')];_0x15e224+=0x1){_0x185535=_0x42db5a[_0x15e224][_0xd498('0x72')]?_0x31fa27[_0x42db5a[_0x15e224][_0xd498('0x72')]][_0xd498('0x73')]:_0x42db5a[_0x15e224][_0xd498('0x67')];_0x185535=_0x42db5a[_0x15e224]['function']?_[_0xd498('0x74')](_0x3f6003[_0x42db5a[_0x15e224][_0xd498('0x75')]],'%s',_0x185535):_0x185535;_0x185535=_0x42db5a[_0x15e224]['format']?_[_0xd498('0x74')](_0x183634[_0x42db5a[_0x15e224][_0xd498('0x76')]],'%s',_0x185535):_0x185535;if(_0x42db5a[_0x15e224]['groupBy']){_0x1a8096[_0xd498('0x66')](_0x185535);}_0x42db5a[_0x15e224]['orderBy']&&_0x1a8096[_0xd498('0x3b')](_0x185535,_0x42db5a[_0x15e224]['orderBy']===_0xd498('0x77')?![]:!![]);_0x1a8096[_0xd498('0x67')](_0x185535,_0x42db5a[_0x15e224][_0xd498('0x78')]||_0x185535);}if(_0xa2f7f9[_0xd498('0x79')]){_0xa2f7f9[_0xd498('0x79')]=JSON[_0xd498('0x7a')](_0xa2f7f9[_0xd498('0x79')]);for(var _0x591417=0x0;_0x591417<_0xa2f7f9[_0xd498('0x79')][_0xd498('0x37')];_0x591417+=0x1){if(_0xa2f7f9['joins'][_0x591417][_0xd498('0x2f')]&&_['includes'](_0x2a5a56,_0xa2f7f9['joins'][_0x591417][_0xd498('0x2f')])&&_0xa2f7f9[_0xd498('0x79')][_0x591417][_0xd498('0x7b')]&&_0xa2f7f9[_0xd498('0x79')][_0x591417][_0xd498('0x7c')]&&_0xa2f7f9[_0xd498('0x79')][_0x591417][_0xd498('0x7d')]){_0x1a8096[_0xa2f7f9[_0xd498('0x79')][_0x591417][_0xd498('0x2f')]](_0xa2f7f9[_0xd498('0x79')][_0x591417][_0xd498('0x7c')],null,util['format'](_0xd498('0x7e'),_0xa2f7f9[_0xd498('0x71')],_0xa2f7f9['joins'][_0x591417][_0xd498('0x7b')],_0xa2f7f9[_0xd498('0x79')][_0x591417][_0xd498('0x7c')],_0xa2f7f9[_0xd498('0x79')][_0x591417]['foreignKey']));}}}if(_0xa2f7f9[_0xd498('0x7f')]){_0xa2f7f9[_0xd498('0x7f')]=JSON[_0xd498('0x7a')](_0xa2f7f9['conditions']);_0x1a8096[_0xd498('0x3d')](_0x1fe9ee(_0xa2f7f9['conditions'][_0xd498('0x66')]));}_0x321bd3=_0x1a8096['clone']();_0x1a8096[_0xd498('0x3a')](_0x4d227e);_0x1a8096[_0xd498('0x1c')](0x0);logger[_0xd498('0x80')](_0xd498('0x81'),_0x1a8096[_0xd498('0x82')]());return dbH[_0xd498('0x83')][_0xd498('0x32')](_0x1a8096[_0xd498('0x82')](),{'type':dbH[_0xd498('0x83')][_0xd498('0x84')][_0xd498('0x85')]});}})['then'](respondWithResult(_0x3113b0,null))[_0xd498('0x47')](handleError(_0x3113b0,null));};function runReport(_0x9dce5e,_0x450e4d,_0x56ede5){var _0x453afe=_0x450e4d['name'];var _0x3377bf=0xa;var _0x58e8fa=[_0xd498('0x86'),_0xd498('0x52'),_0xd498('0x53'),_0xd498('0x54')];var _0x44a785={'SUM':_0xd498('0x55'),'COUNT':_0xd498('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd498('0x57'),'MIN':_0xd498('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd498('0x59'),'GROUP_CONCAT ASC':_0xd498('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5bda58={'SEC_TO_TIME':_0xd498('0x87'),'DATE':_0xd498('0x5c'),'HOUR':_0xd498('0x5d'),'ROUND':_0xd498('0x5e'),'UNIX_TIMESTAMP':_0xd498('0x5f')};var _0x51b674=function(_0x66aff7){return!_[_0xd498('0x60')]([_0xd498('0x61'),'IS\x20NOT\x20NULL',_0xd498('0x62'),'IS\x20NOT\x20EMPTY'],_0x66aff7);};var _0x519c24=function(_0x5e8c67){if(!_0x5e8c67||!_0x5e8c67[_0xd498('0x64')][_0xd498('0x37')]){return'';}for(var _0x4a1c96='(',_0x3a05bb=0x0;_0x3a05bb<_0x5e8c67['rules']['length'];_0x3a05bb+=0x1){_0x3a05bb>0x0&&(_0x4a1c96+='\x20'+_0x5e8c67[_0xd498('0x65')]+'\x20');_0x4a1c96+=_0x5e8c67[_0xd498('0x64')][_0x3a05bb][_0xd498('0x66')]?_0x519c24(_0x5e8c67['rules'][_0x3a05bb][_0xd498('0x66')]):_0x5e8c67['rules'][_0x3a05bb][_0xd498('0x67')]+'\x20'+_0x5e8c67[_0xd498('0x64')][_0x3a05bb][_0xd498('0x68')]+(_0x51b674(_0x5e8c67[_0xd498('0x64')][_0x3a05bb]['condition'])?'\x20'+_0x5e8c67[_0xd498('0x64')][_0x3a05bb][_0xd498('0x88')]:'');}return _0x4a1c96+')';};var _0x13fa30={'where':{'id':_0x9dce5e['id']}},_0xc8b1bd,_0x401e98,_0x257636,_0x6f741f,_0x4b8efc;_0x13fa30=_[_0xd498('0x3f')]({},_0x13fa30,_0x56ede5);return db[_0xd498('0x2c')]['find'](_0x13fa30)['then'](function(_0x23b728){if(_0x23b728){_0xc8b1bd=_0x23b728;return _0x23b728[_0xd498('0x69')]();}return null;})['then'](function(_0x17c667){if(_0x17c667){if(!_0x17c667[_0xd498('0x37')]){throw new db[(_0xd498('0x6a'))][(_0xd498('0x6b'))](_0xd498('0x6c'),0x193);}_0x401e98=_0x17c667;return db[_0xd498('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xd498('0x26')](function(_0x1134f7){if(_0x1134f7){_0x257636=_['keyBy'](_0x1134f7,'id');var _0x180997;var _0x33bd73=squel[_0xd498('0x89')]();_0x33bd73[_0xd498('0x70')](_0xc8b1bd[_0xd498('0x71')]);for(var _0x28f002=0x0;_0x28f002<_0x401e98[_0xd498('0x37')];_0x28f002+=0x1){_0x180997=_0x401e98[_0x28f002]['MetricId']?_0x257636[_0x401e98[_0x28f002][_0xd498('0x72')]][_0xd498('0x73')]:_0x401e98[_0x28f002][_0xd498('0x67')];_0x180997=_0x401e98[_0x28f002][_0xd498('0x75')]?_['replace'](_0x44a785[_0x401e98[_0x28f002][_0xd498('0x75')]],'%s',_0x180997):_0x180997;_0x180997=_0x401e98[_0x28f002][_0xd498('0x76')]?_[_0xd498('0x74')](_0x5bda58[_0x401e98[_0x28f002][_0xd498('0x76')]],'%s',_0x180997):_0x180997;if(_0x401e98[_0x28f002]['groupBy']){_0x33bd73[_0xd498('0x66')](_0x180997);}_0x401e98[_0x28f002][_0xd498('0x8a')]&&_0x33bd73[_0xd498('0x3b')](_0x180997,_0x401e98[_0x28f002][_0xd498('0x8a')]===_0xd498('0x77')?![]:!![]);_0x33bd73[_0xd498('0x67')](_0x180997,_0x401e98[_0x28f002]['alias']||_0x180997);}if(_0xc8b1bd['joins']){_0xc8b1bd[_0xd498('0x79')]=JSON[_0xd498('0x7a')](_0xc8b1bd['joins']);for(var _0x3913ae=0x0;_0x3913ae<_0xc8b1bd[_0xd498('0x79')][_0xd498('0x37')];_0x3913ae+=0x1){if(_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x2f')]&&_['includes'](_0x58e8fa,_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x2f')])&&_0xc8b1bd['joins'][_0x3913ae]['parentKey']&&_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x7c')]&&_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x7d')]){_0x33bd73[_0xc8b1bd['joins'][_0x3913ae][_0xd498('0x2f')]](_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x7c')],null,util[_0xd498('0x76')]('%s.%s\x20=\x20%s.%s',_0xc8b1bd[_0xd498('0x71')],_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x7b')],_0xc8b1bd['joins'][_0x3913ae]['foreignTable'],_0xc8b1bd[_0xd498('0x79')][_0x3913ae][_0xd498('0x7d')]));}}}if(_0xc8b1bd[_0xd498('0x7f')]){_0xc8b1bd[_0xd498('0x7f')]=JSON['parse'](_0xc8b1bd[_0xd498('0x7f')]);_0x33bd73[_0xd498('0x3d')](_0x519c24(_0xc8b1bd[_0xd498('0x7f')]['group']));}_0x4b8efc=_0x33bd73[_0xd498('0x8b')]();_0x33bd73[_0xd498('0x3a')](_0x3377bf);_0x33bd73['offset'](0x0);return;}})[_0xd498('0x26')](function(){if(_0x450e4d[_0xd498('0x8c')]===_0xd498('0x8d')){return null;}var _0x22e01d=_[_0xd498('0x3f')](_0x450e4d,{'name':_0x450e4d[_0xd498('0x8e')]||_0x450e4d['name']||_0xc8b1bd['name'],'basename':_0x453afe,'savename':util[_0xd498('0x76')](_0xd498('0x8f'),_0x450e4d['name']||_0xc8b1bd[_0xd498('0x90')],require(_0xd498('0x91'))['generate'](0x4),_0x450e4d['output']||_0xd498('0x92')),'reportId':_0xc8b1bd['id'],'reportType':_0xd498('0x93')});return db[_0xd498('0x94')][_0xd498('0x48')](_0x22e01d,{'raw':!![]});})[_0xd498('0x26')](function(_0x5e63b9){if(_0xc8b1bd[_0xd498('0x71')]==='cdr'){_0x4b8efc['where'](_0xc8b1bd['table']+_0xd498('0x95'),_0x450e4d['startDate'],_0x450e4d[_0xd498('0x96')]);}else{_0x4b8efc[_0xd498('0x3d')](_0xc8b1bd['table']+_0xd498('0x97'),_0x450e4d['startDate'],_0x450e4d[_0xd498('0x96')]);}if(_0x5e63b9){logger[_0xd498('0x98')](_0xd498('0x99'),_0x4b8efc[_0xd498('0x82')]());require('child_process')[_0xd498('0x9a')](path['join'](__dirname,_0xd498('0x9b'),_0x5e63b9['output']),[_0x5e63b9['id'],_0x4b8efc['toString'](),path['join'](__dirname,'../../files/reports',_0x5e63b9[_0xd498('0x9c')]),_0x453afe]);return _0x5e63b9;}else{var _0x2af9bd=squel[_0xd498('0x89')]();_0x2af9bd[_0xd498('0x70')]('('+_0x4b8efc['toString']()+')','countTable');_0x2af9bd[_0xd498('0x67')]('COUNT(*)',_0xd498('0x1d'));_0x4b8efc[_0xd498('0x3a')](_0x450e4d[_0xd498('0x3a')]||_0x3377bf);_0x4b8efc[_0xd498('0x1c')](_0x450e4d['offset']||0x0);return dbH[_0xd498('0x83')][_0xd498('0x32')](_0x2af9bd[_0xd498('0x82')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})[_0xd498('0x26')](function(_0x15f7f8){if(!_0x15f7f8[_0xd498('0x37')]){_0x6f741f=0x0;}else{_0x6f741f=_0x15f7f8[0x0]['count']||0x0;}return dbH[_0xd498('0x83')][_0xd498('0x32')](_0x4b8efc[_0xd498('0x82')](),{'type':dbH[_0xd498('0x83')][_0xd498('0x84')][_0xd498('0x85')]});})[_0xd498('0x26')](function(_0x36c4e2){return{'rows':_0x36c4e2||[],'count':_0x6f741f};});}});}exports[_0xd498('0x9d')]=function(_0x69feea,_0x486f49){return runReport(_0x69feea[_0xd498('0x45')],_0x69feea[_0xd498('0x32')],_0x69feea[_0xd498('0x41')])[_0xd498('0x26')](respondWithResult(_0x486f49,null))[_0xd498('0x47')](handleError(_0x486f49,null));};exports[_0xd498('0x9e')]=runReport;exports[_0xd498('0x32')]=function(_0x4c78ad,_0x289950){var _0x283561=0xa;var _0x3398ec=[_0xd498('0x86'),_0xd498('0x52'),_0xd498('0x53'),_0xd498('0x54')];var _0x277f77={'SUM':_0xd498('0x55'),'COUNT':_0xd498('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd498('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd498('0x59'),'GROUP_CONCAT ASC':_0xd498('0x5a'),'GROUP_CONCAT DESC':_0xd498('0x5b')};var _0x162c7e={'SEC_TO_TIME':_0xd498('0x87'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd498('0x5e'),'UNIX_TIMESTAMP':_0xd498('0x5f')};var _0x255050=function(_0x37a847){return!_[_0xd498('0x60')]([_0xd498('0x61'),_0xd498('0x9f'),_0xd498('0x62'),_0xd498('0x63')],_0x37a847);};var _0x5998d8=function(_0x52a5af){if(!_0x52a5af||!_0x52a5af['rules'][_0xd498('0x37')]){return'';}for(var _0x1d2886='(',_0x58550c=0x0;_0x58550c<_0x52a5af[_0xd498('0x64')][_0xd498('0x37')];_0x58550c+=0x1){_0x58550c>0x0&&(_0x1d2886+='\x20'+_0x52a5af['operator']+'\x20');_0x1d2886+=_0x52a5af[_0xd498('0x64')][_0x58550c]['group']?_0x5998d8(_0x52a5af[_0xd498('0x64')][_0x58550c][_0xd498('0x66')]):_0x52a5af[_0xd498('0x64')][_0x58550c][_0xd498('0x67')]+'\x20'+_0x52a5af['rules'][_0x58550c][_0xd498('0x68')]+(_0x255050(_0x52a5af[_0xd498('0x64')][_0x58550c][_0xd498('0x68')])?'\x20'+_0x52a5af['rules'][_0x58550c][_0xd498('0x88')]:'');}return _0x1d2886+')';};var _0x1b0343={'where':{'id':_0x4c78ad[_0xd498('0x45')]['id']}},_0x54309b,_0x458576,_0x40b5c3,_0x464a89,_0x159217;_0x1b0343=_[_0xd498('0x3f')]({},_0x1b0343,_0x4c78ad[_0xd498('0x41')]);return db[_0xd498('0x2c')][_0xd498('0x4d')](_0x1b0343)['then'](function(_0x50f580){if(_0x50f580){_0x54309b=_0x50f580;return _0x50f580[_0xd498('0x69')]();}return null;})[_0xd498('0x26')](function(_0x19c3bd){if(_0x19c3bd){if(!_0x19c3bd['length']){throw new db[(_0xd498('0x6a'))][(_0xd498('0x6b'))](_0xd498('0x6c'),0x193);}_0x458576=_0x19c3bd;return db[_0xd498('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xd498('0x26')](function(_0x27986a){if(_0x27986a){_0x40b5c3=_[_0xd498('0x6f')](_0x27986a,'id');var _0x443591;var _0x3ed245=squel[_0xd498('0x89')]();_0x3ed245[_0xd498('0x70')](_0x54309b[_0xd498('0x71')]);for(var _0x7d21ec=0x0;_0x7d21ec<_0x458576['length'];_0x7d21ec+=0x1){_0x443591=_0x458576[_0x7d21ec][_0xd498('0x72')]?_0x40b5c3[_0x458576[_0x7d21ec][_0xd498('0x72')]][_0xd498('0x73')]:_0x458576[_0x7d21ec][_0xd498('0x67')];_0x443591=_0x458576[_0x7d21ec][_0xd498('0x75')]?_[_0xd498('0x74')](_0x277f77[_0x458576[_0x7d21ec][_0xd498('0x75')]],'%s',_0x443591):_0x443591;_0x443591=_0x458576[_0x7d21ec][_0xd498('0x76')]?_['replace'](_0x162c7e[_0x458576[_0x7d21ec][_0xd498('0x76')]],'%s',_0x443591):_0x443591;if(_0x458576[_0x7d21ec][_0xd498('0xa0')]){_0x3ed245['group'](_0x443591);}_0x458576[_0x7d21ec][_0xd498('0x8a')]&&_0x3ed245[_0xd498('0x3b')](_0x443591,_0x458576[_0x7d21ec]['orderBy']===_0xd498('0x77')?![]:!![]);_0x3ed245['field'](_0x443591,_0x458576[_0x7d21ec][_0xd498('0x78')]||_0x443591);}if(_0x54309b[_0xd498('0x79')]){_0x54309b[_0xd498('0x79')]=JSON[_0xd498('0x7a')](_0x54309b[_0xd498('0x79')]);for(var _0x3eb7d0=0x0;_0x3eb7d0<_0x54309b[_0xd498('0x79')][_0xd498('0x37')];_0x3eb7d0+=0x1){if(_0x54309b[_0xd498('0x79')][_0x3eb7d0][_0xd498('0x2f')]&&_[_0xd498('0x60')](_0x3398ec,_0x54309b[_0xd498('0x79')][_0x3eb7d0][_0xd498('0x2f')])&&_0x54309b[_0xd498('0x79')][_0x3eb7d0][_0xd498('0x7b')]&&_0x54309b[_0xd498('0x79')][_0x3eb7d0]['foreignTable']&&_0x54309b['joins'][_0x3eb7d0][_0xd498('0x7d')]){_0x3ed245[_0x54309b[_0xd498('0x79')][_0x3eb7d0][_0xd498('0x2f')]](_0x54309b[_0xd498('0x79')][_0x3eb7d0]['foreignTable'],null,util[_0xd498('0x76')](_0xd498('0x7e'),_0x54309b[_0xd498('0x71')],_0x54309b[_0xd498('0x79')][_0x3eb7d0][_0xd498('0x7b')],_0x54309b[_0xd498('0x79')][_0x3eb7d0][_0xd498('0x7c')],_0x54309b[_0xd498('0x79')][_0x3eb7d0]['foreignKey']));}}}if(_0x54309b[_0xd498('0x7f')]){_0x54309b['conditions']=JSON[_0xd498('0x7a')](_0x54309b[_0xd498('0x7f')]);_0x3ed245[_0xd498('0x3d')](_0x5998d8(_0x54309b['conditions'][_0xd498('0x66')]));}_0x159217=_0x3ed245[_0xd498('0x8b')]();_0x3ed245['limit'](_0x283561);_0x3ed245['offset'](0x0);logger['debug'](_0xd498('0x81'),_0x3ed245[_0xd498('0x82')]());return dbH[_0xd498('0x83')]['query'](_0x3ed245['toString'](),{'type':dbH[_0xd498('0x83')][_0xd498('0x84')][_0xd498('0x85')]});}})['then'](function(){return{'sql':_0x159217[_0xd498('0x82')]()};})[_0xd498('0x26')](respondWithResult(_0x289950,null))['catch'](handleError(_0x289950,null));}; \ No newline at end of file +var _0xfec6=['body','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','Please\x20insert\x20at\x20least\x20one\x20field','web','fullPath','%s-%s.%s','generate','output','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','show','catch','create'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfec6,0x103));var _0x6fec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfec6[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6fec('0x0'));var rimraf=require(_0x6fec('0x1'));var zipdir=require(_0x6fec('0x2'));var jsonpatch=require(_0x6fec('0x3'));var rp=require(_0x6fec('0x4'));var moment=require('moment');var BPromise=require(_0x6fec('0x5'));var Mustache=require(_0x6fec('0x6'));var util=require(_0x6fec('0x7'));var path=require(_0x6fec('0x8'));var sox=require(_0x6fec('0x9'));var csv=require(_0x6fec('0xa'));var ejs=require(_0x6fec('0xb'));var fs=require('fs');var fs_extra=require(_0x6fec('0xc'));var _=require(_0x6fec('0xd'));var squel=require(_0x6fec('0xe'));var crypto=require(_0x6fec('0xf'));var jsforce=require(_0x6fec('0x10'));var deskjs=require(_0x6fec('0x11'));var toCsv=require(_0x6fec('0xa'));var querystring=require('querystring');var Papa=require(_0x6fec('0x12'));var Redis=require(_0x6fec('0x13'));var authService=require(_0x6fec('0x14'));var qs=require(_0x6fec('0x15'));var as=require(_0x6fec('0x16'));var hardwareService=require(_0x6fec('0x17'));var logger=require('../../config/logger')(_0x6fec('0x18'));var utils=require(_0x6fec('0x19'));var config=require(_0x6fec('0x1a'));var licenseUtil=require(_0x6fec('0x1b'));var db=require(_0x6fec('0x1c'))['db'];var dbH=require(_0x6fec('0x1c'))['dbH'];function respondWithStatusCode(_0x19f612,_0x570400){_0x570400=_0x570400||0xcc;return function(_0x16a444){if(_0x16a444){return _0x19f612[_0x6fec('0x1d')](_0x570400);}return _0x19f612[_0x6fec('0x1e')](_0x570400)[_0x6fec('0x1f')]();};}function respondWithResult(_0x5a5056,_0x358a48){_0x358a48=_0x358a48||0xc8;return function(_0x407ea8){if(_0x407ea8){return _0x5a5056[_0x6fec('0x1e')](_0x358a48)['json'](_0x407ea8);}};}function respondWithFilteredResult(_0xb35b81,_0x1f2f8d){return function(_0x1e8844){if(_0x1e8844){var _0x3cacf1=typeof _0x1f2f8d[_0x6fec('0x20')]===_0x6fec('0x21')&&typeof _0x1f2f8d['limit']===_0x6fec('0x21');var _0x413341=_0x1e8844[_0x6fec('0x22')];var _0x548225=_0x3cacf1?0x0:_0x1f2f8d[_0x6fec('0x20')];var _0x465cf6=_0x3cacf1?_0x1e8844['count']:_0x1f2f8d[_0x6fec('0x20')]+_0x1f2f8d[_0x6fec('0x23')];var _0x11e4e1;if(_0x465cf6>=_0x413341){_0x465cf6=_0x413341;_0x11e4e1=0xc8;}else{_0x11e4e1=0xce;}_0xb35b81[_0x6fec('0x1e')](_0x11e4e1);return _0xb35b81['set'](_0x6fec('0x24'),_0x548225+'-'+_0x465cf6+'/'+_0x413341)['json'](_0x1e8844);}return null;};}function patchUpdates(_0x310621){return function(_0x4d60df){try{jsonpatch[_0x6fec('0x25')](_0x4d60df,_0x310621,!![]);}catch(_0x46cffd){return BPromise['reject'](_0x46cffd);}return _0x4d60df[_0x6fec('0x26')]();};}function saveUpdates(_0x277a70,_0x19c797){return function(_0x2e94bc){if(_0x2e94bc){return _0x2e94bc['update'](_0x277a70)['then'](function(_0x5d90cb){return _0x5d90cb;});}return null;};}function removeEntity(_0x278fb3,_0x1766e4){return function(_0x371d65){if(_0x371d65){return _0x371d65[_0x6fec('0x27')]()[_0x6fec('0x28')](function(){var _0x1f7602=_0x371d65[_0x6fec('0x29')]({'plain':!![]});var _0x5ab5c4=_0x6fec('0x2a');return db[_0x6fec('0x2b')]['destroy']({'where':{'type':_0x5ab5c4,'resourceId':_0x1f7602['id']}})[_0x6fec('0x28')](function(){return _0x371d65;});})[_0x6fec('0x28')](function(){_0x278fb3['status'](0xcc)[_0x6fec('0x1f')]();});}};}function handleEntityNotFound(_0x5cc399,_0xac0e57){return function(_0x26af45){if(!_0x26af45){_0x5cc399[_0x6fec('0x1d')](0x194);}return _0x26af45;};}function handleError(_0x28fee1,_0x3a0a01){_0x3a0a01=_0x3a0a01||0x1f4;return function(_0x30af70){logger[_0x6fec('0x2c')](_0x30af70[_0x6fec('0x2d')]);if(_0x30af70[_0x6fec('0x2e')]){delete _0x30af70[_0x6fec('0x2e')];}_0x28fee1[_0x6fec('0x1e')](_0x3a0a01)['send'](_0x30af70);};}exports[_0x6fec('0x2f')]=function(_0x520e22,_0x25ee85){var _0x2032e8={},_0x35d711={},_0x1f73d4={'count':0x0,'rows':[]};var _0x34b03a=_[_0x6fec('0x30')](db['AnalyticCustomReport'][_0x6fec('0x31')],function(_0x4c196f){return{'name':_0x4c196f[_0x6fec('0x32')],'type':_0x4c196f[_0x6fec('0x33')][_0x6fec('0x34')]};});_0x35d711[_0x6fec('0x35')]=_[_0x6fec('0x30')](_0x34b03a,_0x6fec('0x2e'));_0x35d711[_0x6fec('0x36')]=_[_0x6fec('0x37')](_0x520e22[_0x6fec('0x36')]);_0x35d711[_0x6fec('0x38')]=_['intersection'](_0x35d711[_0x6fec('0x35')],_0x35d711[_0x6fec('0x36')]);_0x2032e8[_0x6fec('0x39')]=_[_0x6fec('0x3a')](_0x35d711['model'],qs[_0x6fec('0x3b')](_0x520e22[_0x6fec('0x36')][_0x6fec('0x3b')]));_0x2032e8[_0x6fec('0x39')]=_0x2032e8['attributes'][_0x6fec('0x3c')]?_0x2032e8[_0x6fec('0x39')]:_0x35d711['model'];if(!_0x520e22[_0x6fec('0x36')][_0x6fec('0x3d')](_0x6fec('0x3e'))){_0x2032e8[_0x6fec('0x23')]=qs[_0x6fec('0x23')](_0x520e22[_0x6fec('0x36')][_0x6fec('0x23')]);_0x2032e8[_0x6fec('0x20')]=qs[_0x6fec('0x20')](_0x520e22['query'][_0x6fec('0x20')]);}_0x2032e8[_0x6fec('0x3f')]=qs['sort'](_0x520e22[_0x6fec('0x36')][_0x6fec('0x40')]);_0x2032e8[_0x6fec('0x41')]=qs['filters'](_['pick'](_0x520e22['query'],_0x35d711[_0x6fec('0x38')]),_0x34b03a);if(_0x520e22[_0x6fec('0x36')]['filter']){_0x2032e8['where']=_[_0x6fec('0x42')](_0x2032e8['where'],{'$or':_[_0x6fec('0x30')](_0x34b03a,function(_0x5bedf0){if(_0x5bedf0[_0x6fec('0x33')]!==_0x6fec('0x43')){var _0x5d15ed={};_0x5d15ed[_0x5bedf0[_0x6fec('0x2e')]]={'$like':'%'+_0x520e22[_0x6fec('0x36')][_0x6fec('0x44')]+'%'};return _0x5d15ed;}})});}_0x2032e8=_[_0x6fec('0x42')]({},_0x2032e8,_0x520e22[_0x6fec('0x45')]);var _0x411aa5={'where':_0x2032e8[_0x6fec('0x41')]};return db[_0x6fec('0x46')][_0x6fec('0x22')](_0x411aa5)[_0x6fec('0x28')](function(_0x5a26b5){_0x1f73d4[_0x6fec('0x22')]=_0x5a26b5;if(_0x520e22['query'][_0x6fec('0x47')]){_0x2032e8[_0x6fec('0x48')]=[{'all':!![]}];}return db[_0x6fec('0x46')][_0x6fec('0x49')](_0x2032e8);})[_0x6fec('0x28')](function(_0x4efcc5){_0x1f73d4['rows']=_0x4efcc5;return _0x1f73d4;})[_0x6fec('0x28')](respondWithFilteredResult(_0x25ee85,_0x2032e8))['catch'](handleError(_0x25ee85,null));};exports[_0x6fec('0x4a')]=function(_0x13fcf8,_0x308f8c){var _0x2b1c33={'raw':![],'where':{'id':_0x13fcf8['params']['id']}},_0x3e5ad7={};_0x3e5ad7['model']=_[_0x6fec('0x37')](db[_0x6fec('0x46')]['rawAttributes']);_0x3e5ad7[_0x6fec('0x36')]=_[_0x6fec('0x37')](_0x13fcf8[_0x6fec('0x36')]);_0x3e5ad7[_0x6fec('0x38')]=_[_0x6fec('0x3a')](_0x3e5ad7[_0x6fec('0x35')],_0x3e5ad7['query']);_0x2b1c33[_0x6fec('0x39')]=_[_0x6fec('0x3a')](_0x3e5ad7[_0x6fec('0x35')],qs['fields'](_0x13fcf8[_0x6fec('0x36')][_0x6fec('0x3b')]));_0x2b1c33['attributes']=_0x2b1c33[_0x6fec('0x39')][_0x6fec('0x3c')]?_0x2b1c33[_0x6fec('0x39')]:_0x3e5ad7[_0x6fec('0x35')];if(_0x13fcf8[_0x6fec('0x36')][_0x6fec('0x47')]){_0x2b1c33[_0x6fec('0x48')]=[{'all':!![]}];}_0x2b1c33=_[_0x6fec('0x42')]({},_0x2b1c33,_0x13fcf8[_0x6fec('0x45')]);return db[_0x6fec('0x46')]['find'](_0x2b1c33)[_0x6fec('0x28')](handleEntityNotFound(_0x308f8c,null))[_0x6fec('0x28')](respondWithResult(_0x308f8c,null))[_0x6fec('0x4b')](handleError(_0x308f8c,null));};exports[_0x6fec('0x4c')]=function(_0x529268,_0x1ca9a6){return db[_0x6fec('0x46')]['create'](_0x529268[_0x6fec('0x4d')],{})[_0x6fec('0x28')](function(_0x3abd06){var _0x489120=_0x529268[_0x6fec('0x4e')][_0x6fec('0x29')]({'plain':!![]});if(!_0x489120)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x489120['role']===_0x6fec('0x4e')){var _0x4d03ca=_0x3abd06[_0x6fec('0x29')]({'plain':!![]});var _0x2017e5=_0x6fec('0x4f');return db[_0x6fec('0x50')][_0x6fec('0x51')]({'where':{'name':_0x2017e5,'userProfileId':_0x489120[_0x6fec('0x52')]},'raw':!![]})[_0x6fec('0x28')](function(_0x17e0e5){if(_0x17e0e5&&_0x17e0e5[_0x6fec('0x53')]===0x0){return db[_0x6fec('0x2b')][_0x6fec('0x4c')]({'name':_0x4d03ca[_0x6fec('0x2e')],'resourceId':_0x4d03ca['id'],'type':_0x6fec('0x2a'),'sectionId':_0x17e0e5['id']},{})[_0x6fec('0x28')](function(){return _0x3abd06;});}else{return _0x3abd06;}})['catch'](function(_0x3608d3){logger[_0x6fec('0x2c')](_0x6fec('0x54'),_0x3608d3);throw _0x3608d3;});}return _0x3abd06;})['then'](respondWithResult(_0x1ca9a6,0xc9))[_0x6fec('0x4b')](handleError(_0x1ca9a6,null));};exports[_0x6fec('0x55')]=function(_0x2831c4,_0x5a65c7){if(_0x2831c4[_0x6fec('0x4d')]['id']){delete _0x2831c4[_0x6fec('0x4d')]['id'];}return db[_0x6fec('0x46')][_0x6fec('0x51')]({'where':{'id':_0x2831c4[_0x6fec('0x56')]['id']}})[_0x6fec('0x28')](handleEntityNotFound(_0x5a65c7,null))['then'](saveUpdates(_0x2831c4[_0x6fec('0x4d')],null))['then'](respondWithResult(_0x5a65c7,null))[_0x6fec('0x4b')](handleError(_0x5a65c7,null));};exports[_0x6fec('0x27')]=function(_0x48aecb,_0x449245){return db[_0x6fec('0x46')][_0x6fec('0x51')]({'where':{'id':_0x48aecb[_0x6fec('0x56')]['id']}})[_0x6fec('0x28')](handleEntityNotFound(_0x449245,null))[_0x6fec('0x28')](removeEntity(_0x449245,null))[_0x6fec('0x4b')](handleError(_0x449245,null));};exports[_0x6fec('0x57')]=function(_0x3ffad6,_0x103cd8){var _0x290fd5=0xa;var _0x175a28=[_0x6fec('0x58'),_0x6fec('0x59'),_0x6fec('0x5a'),_0x6fec('0x5b')];var _0x65f337={'SUM':_0x6fec('0x5c'),'COUNT':_0x6fec('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6fec('0x5e'),'MIN':_0x6fec('0x5f'),'AVG':_0x6fec('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6fec('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x9618e5={'SEC_TO_TIME':_0x6fec('0x62'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6fec('0x63'),'UNIX_TIMESTAMP':_0x6fec('0x64')};var _0x346f87=function(_0x4994ad){return!_[_0x6fec('0x65')]([_0x6fec('0x66'),_0x6fec('0x67'),_0x6fec('0x68'),_0x6fec('0x69')],_0x4994ad);};var _0x2cd71e=function(_0x46b2ee){if(!_0x46b2ee||!_0x46b2ee[_0x6fec('0x6a')][_0x6fec('0x3c')]){return'';}for(var _0x14022a='(',_0x5089a6=0x0;_0x5089a6<_0x46b2ee[_0x6fec('0x6a')][_0x6fec('0x3c')];_0x5089a6+=0x1){_0x5089a6>0x0&&(_0x14022a+='\x20'+_0x46b2ee[_0x6fec('0x6b')]+'\x20');_0x14022a+=_0x46b2ee[_0x6fec('0x6a')][_0x5089a6][_0x6fec('0x6c')]?_0x2cd71e(_0x46b2ee[_0x6fec('0x6a')][_0x5089a6][_0x6fec('0x6c')]):_0x46b2ee[_0x6fec('0x6a')][_0x5089a6][_0x6fec('0x6d')]+'\x20'+_0x46b2ee[_0x6fec('0x6a')][_0x5089a6]['condition']+(_0x346f87(_0x46b2ee[_0x6fec('0x6a')][_0x5089a6][_0x6fec('0x6e')])?'\x20'+_0x46b2ee[_0x6fec('0x6a')][_0x5089a6][_0x6fec('0x6f')]:'');}return _0x14022a+')';};var _0x204248={'where':{'id':_0x3ffad6['params']['id']}},_0x14526a,_0x7ee885,_0x40d4a8,_0x13722d,_0x52d194;_0x204248=_[_0x6fec('0x42')]({},_0x204248,_0x3ffad6[_0x6fec('0x45')]);return db[_0x6fec('0x46')]['find'](_0x204248)['then'](function(_0x3cc8a3){if(_0x3cc8a3){_0x14526a=_0x3cc8a3;return _0x3cc8a3[_0x6fec('0x70')]();}return null;})[_0x6fec('0x28')](function(_0x11d72e){if(_0x11d72e){if(!_0x11d72e[_0x6fec('0x3c')]){throw new db[(_0x6fec('0x71'))][(_0x6fec('0x72'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x7ee885=_0x11d72e;return db[_0x6fec('0x73')][_0x6fec('0x49')]({'raw':!![]});}return null;})['then'](function(_0x301507){if(_0x301507){_0x40d4a8=_[_0x6fec('0x74')](_0x301507,'id');var _0x2f5ea2;var _0x10ab7c=squel[_0x6fec('0x75')]();_0x10ab7c[_0x6fec('0x76')](_0x14526a[_0x6fec('0x77')]);for(var _0x429483=0x0;_0x429483<_0x7ee885[_0x6fec('0x3c')];_0x429483+=0x1){_0x2f5ea2=_0x7ee885[_0x429483][_0x6fec('0x78')]?_0x40d4a8[_0x7ee885[_0x429483][_0x6fec('0x78')]][_0x6fec('0x79')]:_0x7ee885[_0x429483][_0x6fec('0x6d')];_0x2f5ea2=_0x7ee885[_0x429483]['function']?_[_0x6fec('0x7a')](_0x65f337[_0x7ee885[_0x429483][_0x6fec('0x7b')]],'%s',_0x2f5ea2):_0x2f5ea2;_0x2f5ea2=_0x7ee885[_0x429483][_0x6fec('0x7c')]?_[_0x6fec('0x7a')](_0x9618e5[_0x7ee885[_0x429483][_0x6fec('0x7c')]],'%s',_0x2f5ea2):_0x2f5ea2;if(_0x7ee885[_0x429483][_0x6fec('0x7d')]){_0x10ab7c[_0x6fec('0x6c')](_0x2f5ea2);}_0x7ee885[_0x429483][_0x6fec('0x7e')]&&_0x10ab7c['order'](_0x2f5ea2,_0x7ee885[_0x429483][_0x6fec('0x7e')]==='DESC'?![]:!![]);_0x10ab7c[_0x6fec('0x6d')](_0x2f5ea2,_0x7ee885[_0x429483][_0x6fec('0x7f')]||_0x2f5ea2);}if(_0x14526a[_0x6fec('0x80')]){_0x14526a[_0x6fec('0x80')]=JSON[_0x6fec('0x81')](_0x14526a[_0x6fec('0x80')]);for(var _0x3b0193=0x0;_0x3b0193<_0x14526a[_0x6fec('0x80')]['length'];_0x3b0193+=0x1){if(_0x14526a[_0x6fec('0x80')][_0x3b0193][_0x6fec('0x33')]&&_[_0x6fec('0x65')](_0x175a28,_0x14526a[_0x6fec('0x80')][_0x3b0193]['type'])&&_0x14526a[_0x6fec('0x80')][_0x3b0193][_0x6fec('0x82')]&&_0x14526a['joins'][_0x3b0193][_0x6fec('0x83')]&&_0x14526a[_0x6fec('0x80')][_0x3b0193][_0x6fec('0x84')]){_0x10ab7c[_0x14526a[_0x6fec('0x80')][_0x3b0193][_0x6fec('0x33')]](_0x14526a[_0x6fec('0x80')][_0x3b0193][_0x6fec('0x83')],null,util[_0x6fec('0x7c')](_0x6fec('0x85'),_0x14526a[_0x6fec('0x77')],_0x14526a['joins'][_0x3b0193][_0x6fec('0x82')],_0x14526a[_0x6fec('0x80')][_0x3b0193][_0x6fec('0x83')],_0x14526a['joins'][_0x3b0193]['foreignKey']));}}}if(_0x14526a[_0x6fec('0x86')]){_0x14526a[_0x6fec('0x86')]=JSON[_0x6fec('0x81')](_0x14526a['conditions']);_0x10ab7c[_0x6fec('0x41')](_0x2cd71e(_0x14526a[_0x6fec('0x86')][_0x6fec('0x6c')]));}_0x52d194=_0x10ab7c[_0x6fec('0x87')]();_0x10ab7c[_0x6fec('0x23')](_0x290fd5);_0x10ab7c['offset'](0x0);logger[_0x6fec('0x88')](_0x6fec('0x89'),_0x10ab7c['toString']());return dbH[_0x6fec('0x8a')][_0x6fec('0x36')](_0x10ab7c[_0x6fec('0x8b')](),{'type':dbH[_0x6fec('0x8a')][_0x6fec('0x8c')][_0x6fec('0x8d')]});}})[_0x6fec('0x28')](respondWithResult(_0x103cd8,null))[_0x6fec('0x4b')](handleError(_0x103cd8,null));};function runReport(_0xc4ab50,_0x515be7,_0x175afa){var _0x4ee348=_0x515be7[_0x6fec('0x2e')];var _0x184864=0xa;var _0x4dc534=[_0x6fec('0x58'),_0x6fec('0x59'),_0x6fec('0x5a'),_0x6fec('0x5b')];var _0x449b26={'SUM':'SUM(%s)','COUNT':_0x6fec('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6fec('0x5e'),'MIN':_0x6fec('0x5f'),'AVG':_0x6fec('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6fec('0x61'),'GROUP_CONCAT DESC':_0x6fec('0x8e')};var _0x2cf326={'SEC_TO_TIME':_0x6fec('0x62'),'DATE':_0x6fec('0x8f'),'HOUR':_0x6fec('0x90'),'ROUND':_0x6fec('0x63'),'UNIX_TIMESTAMP':_0x6fec('0x64')};var _0x59e32b=function(_0x5d9c11){return!_['includes']([_0x6fec('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x6fec('0x69')],_0x5d9c11);};var _0x4547c1=function(_0x58a9a9){if(!_0x58a9a9||!_0x58a9a9[_0x6fec('0x6a')][_0x6fec('0x3c')]){return'';}for(var _0x110e86='(',_0x15ff7b=0x0;_0x15ff7b<_0x58a9a9[_0x6fec('0x6a')]['length'];_0x15ff7b+=0x1){_0x15ff7b>0x0&&(_0x110e86+='\x20'+_0x58a9a9[_0x6fec('0x6b')]+'\x20');_0x110e86+=_0x58a9a9[_0x6fec('0x6a')][_0x15ff7b]['group']?_0x4547c1(_0x58a9a9[_0x6fec('0x6a')][_0x15ff7b][_0x6fec('0x6c')]):_0x58a9a9[_0x6fec('0x6a')][_0x15ff7b][_0x6fec('0x6d')]+'\x20'+_0x58a9a9[_0x6fec('0x6a')][_0x15ff7b][_0x6fec('0x6e')]+(_0x59e32b(_0x58a9a9[_0x6fec('0x6a')][_0x15ff7b][_0x6fec('0x6e')])?'\x20'+_0x58a9a9[_0x6fec('0x6a')][_0x15ff7b][_0x6fec('0x6f')]:'');}return _0x110e86+')';};var _0x245235={'where':{'id':_0xc4ab50['id']}},_0x4274d4,_0xd3d5c9,_0x4c8ce0,_0x1d65ed,_0x5864c4;_0x245235=_['merge']({},_0x245235,_0x175afa);return db[_0x6fec('0x46')][_0x6fec('0x51')](_0x245235)[_0x6fec('0x28')](function(_0x23a509){if(_0x23a509){_0x4274d4=_0x23a509;return _0x23a509[_0x6fec('0x70')]();}return null;})[_0x6fec('0x28')](function(_0x45f4f7){if(_0x45f4f7){if(!_0x45f4f7['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x6fec('0x91'),0x193);}_0xd3d5c9=_0x45f4f7;return db[_0x6fec('0x73')][_0x6fec('0x49')]({'raw':!![]});}return null;})[_0x6fec('0x28')](function(_0x154f92){if(_0x154f92){_0x4c8ce0=_['keyBy'](_0x154f92,'id');var _0x41abfe;var _0x5cc318=squel[_0x6fec('0x75')]();_0x5cc318[_0x6fec('0x76')](_0x4274d4[_0x6fec('0x77')]);for(var _0x4a4cbc=0x0;_0x4a4cbc<_0xd3d5c9[_0x6fec('0x3c')];_0x4a4cbc+=0x1){_0x41abfe=_0xd3d5c9[_0x4a4cbc][_0x6fec('0x78')]?_0x4c8ce0[_0xd3d5c9[_0x4a4cbc][_0x6fec('0x78')]]['metric']:_0xd3d5c9[_0x4a4cbc][_0x6fec('0x6d')];_0x41abfe=_0xd3d5c9[_0x4a4cbc][_0x6fec('0x7b')]?_['replace'](_0x449b26[_0xd3d5c9[_0x4a4cbc][_0x6fec('0x7b')]],'%s',_0x41abfe):_0x41abfe;_0x41abfe=_0xd3d5c9[_0x4a4cbc][_0x6fec('0x7c')]?_[_0x6fec('0x7a')](_0x2cf326[_0xd3d5c9[_0x4a4cbc]['format']],'%s',_0x41abfe):_0x41abfe;if(_0xd3d5c9[_0x4a4cbc]['groupBy']){_0x5cc318[_0x6fec('0x6c')](_0x41abfe);}_0xd3d5c9[_0x4a4cbc][_0x6fec('0x7e')]&&_0x5cc318['order'](_0x41abfe,_0xd3d5c9[_0x4a4cbc]['orderBy']==='DESC'?![]:!![]);_0x5cc318[_0x6fec('0x6d')](_0x41abfe,_0xd3d5c9[_0x4a4cbc]['alias']||_0x41abfe);}if(_0x4274d4[_0x6fec('0x80')]){_0x4274d4[_0x6fec('0x80')]=JSON[_0x6fec('0x81')](_0x4274d4['joins']);for(var _0x50ad5e=0x0;_0x50ad5e<_0x4274d4[_0x6fec('0x80')][_0x6fec('0x3c')];_0x50ad5e+=0x1){if(_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x33')]&&_['includes'](_0x4dc534,_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x33')])&&_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x82')]&&_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x83')]&&_0x4274d4['joins'][_0x50ad5e][_0x6fec('0x84')]){_0x5cc318[_0x4274d4['joins'][_0x50ad5e][_0x6fec('0x33')]](_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x83')],null,util[_0x6fec('0x7c')](_0x6fec('0x85'),_0x4274d4[_0x6fec('0x77')],_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x82')],_0x4274d4['joins'][_0x50ad5e][_0x6fec('0x83')],_0x4274d4[_0x6fec('0x80')][_0x50ad5e][_0x6fec('0x84')]));}}}if(_0x4274d4['conditions']){_0x4274d4['conditions']=JSON[_0x6fec('0x81')](_0x4274d4['conditions']);_0x5cc318['where'](_0x4547c1(_0x4274d4[_0x6fec('0x86')]['group']));}_0x5864c4=_0x5cc318[_0x6fec('0x87')]();_0x5cc318[_0x6fec('0x23')](_0x184864);_0x5cc318[_0x6fec('0x20')](0x0);return;}})['then'](function(){if(_0x515be7['output']===_0x6fec('0x92')){return null;}var _0x174f3c=_[_0x6fec('0x42')](_0x515be7,{'name':_0x515be7[_0x6fec('0x93')]||_0x515be7[_0x6fec('0x2e')]||_0x4274d4[_0x6fec('0x2e')],'basename':_0x4ee348,'savename':util[_0x6fec('0x7c')](_0x6fec('0x94'),_0x515be7[_0x6fec('0x2e')]||_0x4274d4[_0x6fec('0x2e')],require('randomstring')[_0x6fec('0x95')](0x4),_0x515be7[_0x6fec('0x96')]||_0x6fec('0x97')),'reportId':_0x4274d4['id'],'reportType':_0x6fec('0x98')});return db['AnalyticExtractedReport'][_0x6fec('0x4c')](_0x174f3c,{'raw':!![]});})[_0x6fec('0x28')](function(_0x9f72d2){if(_0x4274d4[_0x6fec('0x77')]==='cdr'){_0x5864c4[_0x6fec('0x41')](_0x4274d4[_0x6fec('0x77')]+_0x6fec('0x99'),_0x515be7[_0x6fec('0x9a')],_0x515be7[_0x6fec('0x9b')]);}else{_0x5864c4[_0x6fec('0x41')](_0x4274d4[_0x6fec('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x515be7['startDate'],_0x515be7['endDate']);}if(_0x9f72d2){logger[_0x6fec('0x9c')]('Run\x20Query:',_0x5864c4[_0x6fec('0x8b')]());require(_0x6fec('0x9d'))[_0x6fec('0x9e')](path[_0x6fec('0x58')](__dirname,_0x6fec('0x9f'),_0x9f72d2[_0x6fec('0x96')]),[_0x9f72d2['id'],_0x5864c4['toString'](),path[_0x6fec('0x58')](__dirname,_0x6fec('0xa0'),_0x9f72d2['savename']),_0x4ee348]);return _0x9f72d2;}else{var _0x378c4a=squel['select']();_0x378c4a['from']('('+_0x5864c4[_0x6fec('0x8b')]()+')',_0x6fec('0xa1'));_0x378c4a[_0x6fec('0x6d')](_0x6fec('0xa2'),_0x6fec('0x22'));_0x5864c4[_0x6fec('0x23')](_0x515be7[_0x6fec('0x23')]||_0x184864);_0x5864c4['offset'](_0x515be7[_0x6fec('0x20')]||0x0);return dbH['sequelize']['query'](_0x378c4a['toString'](),{'type':dbH[_0x6fec('0x8a')][_0x6fec('0x8c')][_0x6fec('0x8d')]})['then'](function(_0x2795e9){if(!_0x2795e9[_0x6fec('0x3c')]){_0x1d65ed=0x0;}else{_0x1d65ed=_0x2795e9[0x0]['count']||0x0;}return dbH[_0x6fec('0x8a')]['query'](_0x5864c4[_0x6fec('0x8b')](),{'type':dbH['sequelize'][_0x6fec('0x8c')][_0x6fec('0x8d')]});})[_0x6fec('0x28')](function(_0x4835e1){return{'rows':_0x4835e1||[],'count':_0x1d65ed};});}});}exports[_0x6fec('0xa3')]=function(_0x4c8a84,_0xc5904e){return runReport(_0x4c8a84[_0x6fec('0x56')],_0x4c8a84[_0x6fec('0x36')],_0x4c8a84[_0x6fec('0x45')])[_0x6fec('0x28')](respondWithResult(_0xc5904e,null))[_0x6fec('0x4b')](handleError(_0xc5904e,null));};exports[_0x6fec('0xa4')]=runReport;exports['query']=function(_0x208a2d,_0x59382e){var _0x41fc15=0xa;var _0x524985=['join',_0x6fec('0x59'),_0x6fec('0x5a'),_0x6fec('0x5b')];var _0x51dcb4={'SUM':'SUM(%s)','COUNT':_0x6fec('0x5d'),'COUNT DISTINCT':_0x6fec('0xa5'),'MAX':_0x6fec('0x5e'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x6fec('0xa6'),'GROUP_CONCAT ASC':_0x6fec('0x61'),'GROUP_CONCAT DESC':_0x6fec('0x8e')};var _0x19d078={'SEC_TO_TIME':_0x6fec('0x62'),'DATE':'DATE(%s)','HOUR':_0x6fec('0x90'),'ROUND':_0x6fec('0x63'),'UNIX_TIMESTAMP':_0x6fec('0x64')};var _0x5de5a7=function(_0x4e4ede){return!_[_0x6fec('0x65')]([_0x6fec('0x66'),_0x6fec('0x67'),'IS\x20EMPTY',_0x6fec('0x69')],_0x4e4ede);};var _0x1a1d39=function(_0x5be5db){if(!_0x5be5db||!_0x5be5db['rules'][_0x6fec('0x3c')]){return'';}for(var _0x501ad5='(',_0x438353=0x0;_0x438353<_0x5be5db[_0x6fec('0x6a')][_0x6fec('0x3c')];_0x438353+=0x1){_0x438353>0x0&&(_0x501ad5+='\x20'+_0x5be5db[_0x6fec('0x6b')]+'\x20');_0x501ad5+=_0x5be5db[_0x6fec('0x6a')][_0x438353][_0x6fec('0x6c')]?_0x1a1d39(_0x5be5db[_0x6fec('0x6a')][_0x438353][_0x6fec('0x6c')]):_0x5be5db[_0x6fec('0x6a')][_0x438353][_0x6fec('0x6d')]+'\x20'+_0x5be5db[_0x6fec('0x6a')][_0x438353][_0x6fec('0x6e')]+(_0x5de5a7(_0x5be5db[_0x6fec('0x6a')][_0x438353][_0x6fec('0x6e')])?'\x20'+_0x5be5db['rules'][_0x438353]['value']:'');}return _0x501ad5+')';};var _0x146f2b={'where':{'id':_0x208a2d[_0x6fec('0x56')]['id']}},_0x12df21,_0x42caed,_0x232372,_0x36d938,_0x4e06f3;_0x146f2b=_[_0x6fec('0x42')]({},_0x146f2b,_0x208a2d[_0x6fec('0x45')]);return db[_0x6fec('0x46')]['find'](_0x146f2b)[_0x6fec('0x28')](function(_0xef7146){if(_0xef7146){_0x12df21=_0xef7146;return _0xef7146[_0x6fec('0x70')]();}return null;})[_0x6fec('0x28')](function(_0x2cd527){if(_0x2cd527){if(!_0x2cd527['length']){throw new db['Sequelize'][(_0x6fec('0x72'))](_0x6fec('0x91'),0x193);}_0x42caed=_0x2cd527;return db[_0x6fec('0x73')][_0x6fec('0x49')]({'raw':!![]});}return null;})[_0x6fec('0x28')](function(_0x618d27){if(_0x618d27){_0x232372=_[_0x6fec('0x74')](_0x618d27,'id');var _0x4add91;var _0x29f0a1=squel[_0x6fec('0x75')]();_0x29f0a1[_0x6fec('0x76')](_0x12df21[_0x6fec('0x77')]);for(var _0x34e86d=0x0;_0x34e86d<_0x42caed['length'];_0x34e86d+=0x1){_0x4add91=_0x42caed[_0x34e86d][_0x6fec('0x78')]?_0x232372[_0x42caed[_0x34e86d][_0x6fec('0x78')]][_0x6fec('0x79')]:_0x42caed[_0x34e86d][_0x6fec('0x6d')];_0x4add91=_0x42caed[_0x34e86d][_0x6fec('0x7b')]?_[_0x6fec('0x7a')](_0x51dcb4[_0x42caed[_0x34e86d][_0x6fec('0x7b')]],'%s',_0x4add91):_0x4add91;_0x4add91=_0x42caed[_0x34e86d][_0x6fec('0x7c')]?_['replace'](_0x19d078[_0x42caed[_0x34e86d][_0x6fec('0x7c')]],'%s',_0x4add91):_0x4add91;if(_0x42caed[_0x34e86d][_0x6fec('0x7d')]){_0x29f0a1[_0x6fec('0x6c')](_0x4add91);}_0x42caed[_0x34e86d][_0x6fec('0x7e')]&&_0x29f0a1[_0x6fec('0x3f')](_0x4add91,_0x42caed[_0x34e86d][_0x6fec('0x7e')]===_0x6fec('0xa7')?![]:!![]);_0x29f0a1[_0x6fec('0x6d')](_0x4add91,_0x42caed[_0x34e86d][_0x6fec('0x7f')]||_0x4add91);}if(_0x12df21[_0x6fec('0x80')]){_0x12df21[_0x6fec('0x80')]=JSON[_0x6fec('0x81')](_0x12df21[_0x6fec('0x80')]);for(var _0x1d66ce=0x0;_0x1d66ce<_0x12df21[_0x6fec('0x80')][_0x6fec('0x3c')];_0x1d66ce+=0x1){if(_0x12df21['joins'][_0x1d66ce][_0x6fec('0x33')]&&_['includes'](_0x524985,_0x12df21[_0x6fec('0x80')][_0x1d66ce][_0x6fec('0x33')])&&_0x12df21[_0x6fec('0x80')][_0x1d66ce][_0x6fec('0x82')]&&_0x12df21['joins'][_0x1d66ce]['foreignTable']&&_0x12df21[_0x6fec('0x80')][_0x1d66ce][_0x6fec('0x84')]){_0x29f0a1[_0x12df21[_0x6fec('0x80')][_0x1d66ce]['type']](_0x12df21[_0x6fec('0x80')][_0x1d66ce][_0x6fec('0x83')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x12df21[_0x6fec('0x77')],_0x12df21[_0x6fec('0x80')][_0x1d66ce][_0x6fec('0x82')],_0x12df21['joins'][_0x1d66ce]['foreignTable'],_0x12df21[_0x6fec('0x80')][_0x1d66ce][_0x6fec('0x84')]));}}}if(_0x12df21['conditions']){_0x12df21[_0x6fec('0x86')]=JSON['parse'](_0x12df21[_0x6fec('0x86')]);_0x29f0a1['where'](_0x1a1d39(_0x12df21[_0x6fec('0x86')][_0x6fec('0x6c')]));}_0x4e06f3=_0x29f0a1['clone']();_0x29f0a1[_0x6fec('0x23')](_0x41fc15);_0x29f0a1[_0x6fec('0x20')](0x0);logger[_0x6fec('0x88')](_0x6fec('0x89'),_0x29f0a1['toString']());return dbH[_0x6fec('0x8a')]['query'](_0x29f0a1[_0x6fec('0x8b')](),{'type':dbH['sequelize'][_0x6fec('0x8c')][_0x6fec('0x8d')]});}})[_0x6fec('0x28')](function(){return{'sql':_0x4e06f3['toString']()};})['then'](respondWithResult(_0x59382e,null))['catch'](handleError(_0x59382e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 57a7c3e..f124273 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 _0xc706=['../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x81f1e6,_0x329c74){var _0x19ee8a=function(_0x51c661){while(--_0x51c661){_0x81f1e6['push'](_0x81f1e6['shift']());}};_0x19ee8a(++_0x329c74);}(_0xc706,0x1bb));var _0x6c70=function(_0x1fcd0e,_0x1bbf1a){_0x1fcd0e=_0x1fcd0e-0x0;var _0x5a6465=_0xc706[_0x1fcd0e];return _0x5a6465;};'use strict';var _=require(_0x6c70('0x0'));var util=require(_0x6c70('0x1'));var logger=require(_0x6c70('0x2'))(_0x6c70('0x3'));var moment=require(_0x6c70('0x4'));var BPromise=require(_0x6c70('0x5'));var rp=require(_0x6c70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c70('0x7'));var config=require(_0x6c70('0x8'));var attributes=require(_0x6c70('0x9'));module['exports']=function(_0x36e7b7,_0x497ceb){return _0x36e7b7['define']('AnalyticCustomReport',attributes,{'tableName':_0x6c70('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a9=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','moment','bluebird','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a9,0x144));var _0x9d4a=function(_0x5ccad6,_0x1dc866){_0x5ccad6=_0x5ccad6-0x0;var _0x2627aa=_0xd4a9[_0x5ccad6];return _0x2627aa;};'use strict';var _=require(_0x9d4a('0x0'));var util=require(_0x9d4a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d4a('0x2'));var BPromise=require(_0x9d4a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d4a('0x4'));var rimraf=require('rimraf');var config=require(_0x9d4a('0x5'));var attributes=require(_0x9d4a('0x6'));module[_0x9d4a('0x7')]=function(_0xbb0009,_0x20fd6c){return _0xbb0009[_0x9d4a('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x9d4a('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index a2ad814..99c0053 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 _0xf624=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x1b34f6,_0x25015e){var _0x81ad72=function(_0x47a10f){while(--_0x47a10f){_0x1b34f6['push'](_0x1b34f6['shift']());}};_0x81ad72(++_0x25015e);}(_0xf624,0x1f3));var _0x4f62=function(_0x2da053,_0x350af4){_0x2da053=_0x2da053-0x0;var _0x10bb00=_0xf624[_0x2da053];return _0x10bb00;};'use strict';var _=require(_0x4f62('0x0'));var util=require(_0x4f62('0x1'));var moment=require(_0x4f62('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f62('0x3'));var db=require(_0x4f62('0x4'))['db'];var utils=require(_0x4f62('0x5'));var logger=require(_0x4f62('0x6'))(_0x4f62('0x7'));var config=require(_0x4f62('0x8'));var jayson=require(_0x4f62('0x9'));var client=jayson[_0x4f62('0xa')][_0x4f62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x213ece,_0x5c71a7,_0x23b926){return new BPromise(function(_0x4940ea,_0x18cffd){return client['request'](_0x213ece,_0x23b926)['then'](function(_0x5c8823){logger[_0x4f62('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5c71a7,_0x4f62('0xd'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5c71a7,_0x4f62('0xd'),JSON[_0x4f62('0xe')](_0x5c8823));if(_0x5c8823['error']){if(_0x5c8823[_0x4f62('0xf')][_0x4f62('0x10')]===0x1f4){logger[_0x4f62('0xf')](_0x4f62('0x11'),_0x5c71a7,_0x5c8823['error'][_0x4f62('0x12')]);return _0x18cffd(_0x5c8823[_0x4f62('0xf')][_0x4f62('0x12')]);}logger['error'](_0x4f62('0x11'),_0x5c71a7,_0x5c8823[_0x4f62('0xf')]['message']);return _0x4940ea(_0x5c8823[_0x4f62('0xf')]['message']);}else{logger[_0x4f62('0xc')](_0x4f62('0x11'),_0x5c71a7,_0x4f62('0xd'));_0x4940ea(_0x5c8823[_0x4f62('0x13')]['message']);}})[_0x4f62('0x14')](function(_0x1dac2c){logger[_0x4f62('0xf')](_0x4f62('0x11'),_0x5c71a7,_0x1dac2c);_0x18cffd(_0x1dac2c);});});} \ No newline at end of file +var _0x2aad=['result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1d0a62,_0x2849d6){var _0x2c48de=function(_0x4db875){while(--_0x4db875){_0x1d0a62['push'](_0x1d0a62['shift']());}};_0x2c48de(++_0x2849d6);}(_0x2aad,0x105));var _0xd2aa=function(_0x4ed431,_0x37b579){_0x4ed431=_0x4ed431-0x0;var _0x9c64e5=_0x2aad[_0x4ed431];return _0x9c64e5;};'use strict';var _=require('lodash');var util=require(_0xd2aa('0x0'));var moment=require(_0xd2aa('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2aa('0x2'));var fs=require('fs');var Redis=require(_0xd2aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2aa('0x4'));var logger=require(_0xd2aa('0x5'))('rpc');var config=require(_0xd2aa('0x6'));var jayson=require(_0xd2aa('0x7'));var client=jayson[_0xd2aa('0x8')][_0xd2aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8037,_0x4f9108,_0x3a201d){return new BPromise(function(_0x380d3f,_0x5dbbe4){return client['request'](_0x1d8037,_0x3a201d)[_0xd2aa('0xa')](function(_0x222c52){logger[_0xd2aa('0xb')](_0xd2aa('0xc'),_0x4f9108,_0xd2aa('0xd'));logger['debug'](_0xd2aa('0xe'),_0x4f9108,_0xd2aa('0xd'),JSON[_0xd2aa('0xf')](_0x222c52));if(_0x222c52[_0xd2aa('0x10')]){if(_0x222c52[_0xd2aa('0x10')][_0xd2aa('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4f9108,_0x222c52['error'][_0xd2aa('0x12')]);return _0x5dbbe4(_0x222c52['error'][_0xd2aa('0x12')]);}logger[_0xd2aa('0x10')](_0xd2aa('0xc'),_0x4f9108,_0x222c52['error'][_0xd2aa('0x12')]);return _0x380d3f(_0x222c52[_0xd2aa('0x10')][_0xd2aa('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4f9108,'request\x20sent');_0x380d3f(_0x222c52[_0xd2aa('0x13')][_0xd2aa('0x12')]);}})['catch'](function(_0x118b7c){logger[_0xd2aa('0x10')](_0xd2aa('0xc'),_0x4f9108,_0x118b7c);_0x5dbbe4(_0x118b7c);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 65e88de..cccd403 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 _0xc4c9=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x1b65e7,_0xb0975f){var _0x210c77=function(_0x34693a){while(--_0x34693a){_0x1b65e7['push'](_0x1b65e7['shift']());}};_0x210c77(++_0xb0975f);}(_0xc4c9,0x12b));var _0x9c4c=function(_0x290a52,_0x50e902){_0x290a52=_0x290a52-0x0;var _0x6f98d2=_0xc4c9[_0x290a52];return _0x6f98d2;};'use strict';var multer=require(_0x9c4c('0x0'));var util=require(_0x9c4c('0x1'));var path=require(_0x9c4c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c4c('0x3')]();var fs_extra=require(_0x9c4c('0x4'));var auth=require(_0x9c4c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c4c('0x6'));var controller=require(_0x9c4c('0x7'));router['get']('/',auth[_0x9c4c('0x8')](),controller[_0x9c4c('0x9')]);router[_0x9c4c('0xa')](_0x9c4c('0xb'),auth[_0x9c4c('0x8')](),controller['show']);router[_0x9c4c('0xa')]('/:id/preview',auth[_0x9c4c('0x8')](),controller[_0x9c4c('0xc')]);router[_0x9c4c('0xa')](_0x9c4c('0xd'),auth[_0x9c4c('0x8')](),controller['run']);router[_0x9c4c('0xa')](_0x9c4c('0xe'),auth[_0x9c4c('0x8')](),controller[_0x9c4c('0xf')]);router[_0x9c4c('0x10')]('/',auth[_0x9c4c('0x8')](),controller[_0x9c4c('0x11')]);router[_0x9c4c('0x12')](_0x9c4c('0xb'),auth['isAuthenticated'](),controller[_0x9c4c('0x13')]);router[_0x9c4c('0x14')](_0x9c4c('0xb'),auth[_0x9c4c('0x8')](),controller[_0x9c4c('0x15')]);module[_0x9c4c('0x16')]=router; \ No newline at end of file +var _0x80e0=['query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run'];(function(_0x2bca2c,_0x588c2f){var _0x5423f8=function(_0x3d65d2){while(--_0x3d65d2){_0x2bca2c['push'](_0x2bca2c['shift']());}};_0x5423f8(++_0x588c2f);}(_0x80e0,0x17e));var _0x080e=function(_0x555ed9,_0x2fce76){_0x555ed9=_0x555ed9-0x0;var _0x4dec3b=_0x80e0[_0x555ed9];return _0x4dec3b;};'use strict';var multer=require(_0x080e('0x0'));var util=require(_0x080e('0x1'));var path=require(_0x080e('0x2'));var timeout=require(_0x080e('0x3'));var express=require(_0x080e('0x4'));var router=express[_0x080e('0x5')]();var fs_extra=require(_0x080e('0x6'));var auth=require(_0x080e('0x7'));var interaction=require(_0x080e('0x8'));var config=require(_0x080e('0x9'));var controller=require('./analyticCustomReport.controller');router[_0x080e('0xa')]('/',auth[_0x080e('0xb')](),controller[_0x080e('0xc')]);router[_0x080e('0xa')](_0x080e('0xd'),auth[_0x080e('0xb')](),controller[_0x080e('0xe')]);router[_0x080e('0xa')](_0x080e('0xf'),auth[_0x080e('0xb')](),controller[_0x080e('0x10')]);router[_0x080e('0xa')]('/:id/run',auth[_0x080e('0xb')](),controller[_0x080e('0x11')]);router[_0x080e('0xa')]('/:id/query',auth[_0x080e('0xb')](),controller[_0x080e('0x12')]);router[_0x080e('0x13')]('/',auth['isAuthenticated'](),controller[_0x080e('0x14')]);router[_0x080e('0x15')](_0x080e('0xd'),auth['isAuthenticated'](),controller[_0x080e('0x16')]);router[_0x080e('0x17')]('/:id',auth[_0x080e('0xb')](),controller[_0x080e('0x18')]);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 7b2873b..0126489 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x33c68b,_0x58a7d4){var _0x483517=function(_0x2c35fa){while(--_0x2c35fa){_0x33c68b['push'](_0x33c68b['shift']());}};_0x483517(++_0x58a7d4);}(_0x6f47,0xc7));var _0x76f4=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6f47[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0xaf649a,_0x4620e2){var _0x23f165=function(_0x2a2296){while(--_0x2a2296){_0xaf649a['push'](_0xaf649a['shift']());}};_0x23f165(++_0x4620e2);}(_0x2eb2,0x19f));var _0x22eb=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2eb2[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 1e016c1..28d1fdd 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x4a8465,_0x3d3168){var _0x4567df=function(_0xe710a6){while(--_0xe710a6){_0x4a8465['push'](_0x4a8465['shift']());}};_0x4567df(++_0x3d3168);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x5fc3[_0x2f5a22];return _0x326b70;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3dd8dd,_0x369f8e){var _0x33e300=function(_0xf1a7db){while(--_0xf1a7db){_0x3dd8dd['push'](_0x3dd8dd['shift']());}};_0x33e300(++_0x369f8e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a687dc9..41f8978 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 _0x3ca3=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticDefaultReport.attributes'];(function(_0x557821,_0x3e5cc2){var _0x526c63=function(_0x2dd7a3){while(--_0x2dd7a3){_0x557821['push'](_0x557821['shift']());}};_0x526c63(++_0x3e5cc2);}(_0x3ca3,0x17d));var _0x33ca=function(_0x1642e1,_0x6948fa){_0x1642e1=_0x1642e1-0x0;var _0x44312f=_0x3ca3[_0x1642e1];return _0x44312f;};'use strict';var _=require(_0x33ca('0x0'));var util=require(_0x33ca('0x1'));var logger=require(_0x33ca('0x2'))(_0x33ca('0x3'));var moment=require(_0x33ca('0x4'));var BPromise=require(_0x33ca('0x5'));var rp=require(_0x33ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33ca('0x7'));var config=require('../../config/environment');var attributes=require(_0x33ca('0x8'));module[_0x33ca('0x9')]=function(_0x27d8f3,_0xc8e1aa){return _0x27d8f3[_0x33ca('0xa')](_0x33ca('0xb'),attributes,{'tableName':_0x33ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3170=['analytics_default_reports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport'];(function(_0x5a7282,_0xa6e195){var _0x4928ec=function(_0x55594b){while(--_0x55594b){_0x5a7282['push'](_0x5a7282['shift']());}};_0x4928ec(++_0xa6e195);}(_0x3170,0x14b));var _0x0317=function(_0x14377d,_0x140153){_0x14377d=_0x14377d-0x0;var _0x1b3f8d=_0x3170[_0x14377d];return _0x1b3f8d;};'use strict';var _=require(_0x0317('0x0'));var util=require(_0x0317('0x1'));var logger=require('../../config/logger')(_0x0317('0x2'));var moment=require(_0x0317('0x3'));var BPromise=require('bluebird');var rp=require(_0x0317('0x4'));var fs=require('fs');var path=require(_0x0317('0x5'));var rimraf=require(_0x0317('0x6'));var config=require(_0x0317('0x7'));var attributes=require(_0x0317('0x8'));module['exports']=function(_0x2483f4,_0x1b0696){return _0x2483f4['define'](_0x0317('0x9'),attributes,{'tableName':_0x0317('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 3f31de9..5324b95 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 _0x74e9=['stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x74e9,0x93));var _0x974e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x74e9[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x974e('0x0'));var util=require(_0x974e('0x1'));var moment=require(_0x974e('0x2'));var BPromise=require(_0x974e('0x3'));var rs=require(_0x974e('0x4'));var fs=require('fs');var Redis=require(_0x974e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x974e('0x6'));var jayson=require(_0x974e('0x7'));var client=jayson['client'][_0x974e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cb2b3,_0x65c3d7,_0x1759fb){return new BPromise(function(_0x3509f3,_0x55cdfd){return client[_0x974e('0x9')](_0x2cb2b3,_0x1759fb)[_0x974e('0xa')](function(_0x3c080f){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x65c3d7,_0x974e('0xb'));logger[_0x974e('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x65c3d7,_0x974e('0xb'),JSON[_0x974e('0xd')](_0x3c080f));if(_0x3c080f[_0x974e('0xe')]){if(_0x3c080f['error']['code']===0x1f4){logger[_0x974e('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x65c3d7,_0x3c080f['error']['message']);return _0x55cdfd(_0x3c080f[_0x974e('0xe')][_0x974e('0xf')]);}logger[_0x974e('0xe')](_0x974e('0x10'),_0x65c3d7,_0x3c080f[_0x974e('0xe')]['message']);return _0x3509f3(_0x3c080f[_0x974e('0xe')][_0x974e('0xf')]);}else{logger[_0x974e('0x11')](_0x974e('0x10'),_0x65c3d7,_0x974e('0xb'));_0x3509f3(_0x3c080f[_0x974e('0x12')][_0x974e('0xf')]);}})[_0x974e('0x13')](function(_0x251bb0){logger[_0x974e('0xe')](_0x974e('0x10'),_0x65c3d7,_0x251bb0);_0x55cdfd(_0x251bb0);});});} \ No newline at end of file +var _0xe9d7=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0xe9d7,0x1a3));var _0x7e9d=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xe9d7[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0x7e9d('0x0'));var util=require(_0x7e9d('0x1'));var moment=require(_0x7e9d('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e9d('0x3'));var fs=require('fs');var Redis=require(_0x7e9d('0x4'));var db=require(_0x7e9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e9d('0x6'))(_0x7e9d('0x7'));var config=require(_0x7e9d('0x8'));var jayson=require(_0x7e9d('0x9'));var client=jayson[_0x7e9d('0xa')][_0x7e9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4af63d,_0x4af431,_0x4f731f){return new BPromise(function(_0x54b429,_0x4ff248){return client[_0x7e9d('0xc')](_0x4af63d,_0x4f731f)['then'](function(_0x4e627c){logger[_0x7e9d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4af431,_0x7e9d('0xe'));logger['debug'](_0x7e9d('0xf'),_0x4af431,_0x7e9d('0xe'),JSON[_0x7e9d('0x10')](_0x4e627c));if(_0x4e627c[_0x7e9d('0x11')]){if(_0x4e627c[_0x7e9d('0x11')][_0x7e9d('0x12')]===0x1f4){logger['error'](_0x7e9d('0x13'),_0x4af431,_0x4e627c[_0x7e9d('0x11')]['message']);return _0x4ff248(_0x4e627c['error'][_0x7e9d('0x14')]);}logger['error'](_0x7e9d('0x13'),_0x4af431,_0x4e627c[_0x7e9d('0x11')]['message']);return _0x54b429(_0x4e627c[_0x7e9d('0x11')][_0x7e9d('0x14')]);}else{logger[_0x7e9d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4af431,_0x7e9d('0xe'));_0x54b429(_0x4e627c[_0x7e9d('0x15')][_0x7e9d('0x14')]);}})['catch'](function(_0x1368f7){logger[_0x7e9d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4af431,_0x1368f7);_0x4ff248(_0x1368f7);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f227026..f2f3b09 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 _0x723c=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','get','preview','/:id/query','query','post','update','delete','destroy'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x723c,0x166));var _0xc723=function(_0x4b2e01,_0x4a378d){_0x4b2e01=_0x4b2e01-0x0;var _0x4cf4ab=_0x723c[_0x4b2e01];return _0x4cf4ab;};'use strict';var multer=require(_0xc723('0x0'));var util=require('util');var path=require(_0xc723('0x1'));var timeout=require(_0xc723('0x2'));var express=require(_0xc723('0x3'));var router=express[_0xc723('0x4')]();var fs_extra=require(_0xc723('0x5'));var auth=require(_0xc723('0x6'));var interaction=require(_0xc723('0x7'));var config=require(_0xc723('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc723('0x9')]);router['get'](_0xc723('0xa'),auth[_0xc723('0xb')](),controller['show']);router[_0xc723('0xc')]('/:id/preview',auth[_0xc723('0xb')](),controller[_0xc723('0xd')]);router[_0xc723('0xc')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xc723('0xc')](_0xc723('0xe'),auth[_0xc723('0xb')](),controller[_0xc723('0xf')]);router[_0xc723('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc723('0xa'),auth[_0xc723('0xb')](),controller[_0xc723('0x11')]);router[_0xc723('0x12')](_0xc723('0xa'),auth[_0xc723('0xb')](),controller[_0xc723('0x13')]);module[_0xc723('0x14')]=router; \ No newline at end of file +var _0xff22=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query','post','create','put','delete','destroy','exports'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xff22,0x1a0));var _0x2ff2=function(_0x507888,_0x5090ef){_0x507888=_0x507888-0x0;var _0x35a1a2=_0xff22[_0x507888];return _0x35a1a2;};'use strict';var multer=require(_0x2ff2('0x0'));var util=require(_0x2ff2('0x1'));var path=require('path');var timeout=require(_0x2ff2('0x2'));var express=require(_0x2ff2('0x3'));var router=express[_0x2ff2('0x4')]();var fs_extra=require(_0x2ff2('0x5'));var auth=require(_0x2ff2('0x6'));var interaction=require(_0x2ff2('0x7'));var config=require(_0x2ff2('0x8'));var controller=require(_0x2ff2('0x9'));router[_0x2ff2('0xa')]('/',auth['isAuthenticated'](),controller[_0x2ff2('0xb')]);router[_0x2ff2('0xa')](_0x2ff2('0xc'),auth[_0x2ff2('0xd')](),controller[_0x2ff2('0xe')]);router[_0x2ff2('0xa')](_0x2ff2('0xf'),auth['isAuthenticated'](),controller[_0x2ff2('0x10')]);router[_0x2ff2('0xa')](_0x2ff2('0x11'),auth[_0x2ff2('0xd')](),controller[_0x2ff2('0x12')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x2ff2('0x13')]);router[_0x2ff2('0x14')]('/',auth[_0x2ff2('0xd')](),controller[_0x2ff2('0x15')]);router[_0x2ff2('0x16')](_0x2ff2('0xc'),auth[_0x2ff2('0xd')](),controller['update']);router[_0x2ff2('0x17')](_0x2ff2('0xc'),auth[_0x2ff2('0xd')](),controller[_0x2ff2('0x18')]);module[_0x2ff2('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0ffb635..28b143a 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 _0x4c2d=['scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual'];(function(_0x160425,_0x2983aa){var _0x455b67=function(_0x1e964a){while(--_0x1e964a){_0x160425['push'](_0x160425['shift']());}};_0x455b67(++_0x2983aa);}(_0x4c2d,0x196));var _0xd4c2=function(_0x4c64e0,_0x31c247){_0x4c64e0=_0x4c64e0-0x0;var _0x1ab66e=_0x4c2d[_0x4c64e0];return _0x1ab66e;};'use strict';var Sequelize=require(_0xd4c2('0x0'));var moment=require(_0xd4c2('0x1'));module['exports']={'name':{'type':Sequelize[_0xd4c2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd4c2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd4c2('0x3')]('csv',_0xd4c2('0x4'),_0xd4c2('0x5')),'allowNull':![],'defaultValue':_0xd4c2('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xd4c2('0x7')]},'endDate':{'type':Sequelize[_0xd4c2('0x7')]},'status':{'type':Sequelize[_0xd4c2('0x2')],'defaultValue':_0xd4c2('0x8')},'type':{'type':Sequelize[_0xd4c2('0x3')](_0xd4c2('0x9'),_0xd4c2('0xa')),'allowNull':![],'defaultValue':_0xd4c2('0x9')},'reportId':{'type':Sequelize[_0xd4c2('0xb')](0xb)[_0xd4c2('0xc')]},'reportType':{'type':Sequelize[_0xd4c2('0x2')]}}; \ No newline at end of file +var _0xdfba=['manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xdfba,0x6f));var _0xadfb=function(_0x819e57,_0x5250d3){_0x819e57=_0x819e57-0x0;var _0x1e3386=_0xdfba[_0x819e57];return _0x1e3386;};'use strict';var Sequelize=require(_0xadfb('0x0'));var moment=require(_0xadfb('0x1'));module[_0xadfb('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xadfb('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xadfb('0x4')](_0xadfb('0x5'),'pdf',_0xadfb('0x6')),'allowNull':![],'defaultValue':_0xadfb('0x5')},'savename':{'type':Sequelize[_0xadfb('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xadfb('0x7')]},'status':{'type':Sequelize[_0xadfb('0x3')],'defaultValue':_0xadfb('0x8')},'type':{'type':Sequelize[_0xadfb('0x4')](_0xadfb('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xadfb('0xa')](0xb)[_0xadfb('0xb')]},'reportType':{'type':Sequelize[_0xadfb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 9d9927e..e396b66 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 _0x9a7e=['merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter'];(function(_0x289a20,_0x2d3fed){var _0x4a5893=function(_0x20251f){while(--_0x20251f){_0x289a20['push'](_0x289a20['shift']());}};_0x4a5893(++_0x2d3fed);}(_0x9a7e,0x14a));var _0xe9a7=function(_0x1293f9,_0x2698c0){_0x1293f9=_0x1293f9-0x0;var _0x126681=_0x9a7e[_0x1293f9];return _0x126681;};'use strict';var emlformat=require(_0xe9a7('0x0'));var rimraf=require(_0xe9a7('0x1'));var zipdir=require(_0xe9a7('0x2'));var jsonpatch=require(_0xe9a7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9a7('0x4'));var Mustache=require(_0xe9a7('0x5'));var util=require(_0xe9a7('0x6'));var path=require(_0xe9a7('0x7'));var sox=require(_0xe9a7('0x8'));var csv=require(_0xe9a7('0x9'));var ejs=require(_0xe9a7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9a7('0xb'));var squel=require(_0xe9a7('0xc'));var crypto=require('crypto');var jsforce=require(_0xe9a7('0xd'));var deskjs=require(_0xe9a7('0xe'));var toCsv=require(_0xe9a7('0x9'));var querystring=require(_0xe9a7('0xf'));var Papa=require(_0xe9a7('0x10'));var Redis=require('ioredis');var authService=require(_0xe9a7('0x11'));var qs=require(_0xe9a7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9a7('0x13'));var logger=require(_0xe9a7('0x14'))(_0xe9a7('0x15'));var utils=require(_0xe9a7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe9a7('0x17'));var db=require(_0xe9a7('0x18'))['db'];function respondWithStatusCode(_0x4f8bf8,_0x3d6ebc){_0x3d6ebc=_0x3d6ebc||0xcc;return function(_0x36489e){if(_0x36489e){return _0x4f8bf8[_0xe9a7('0x19')](_0x3d6ebc);}return _0x4f8bf8[_0xe9a7('0x1a')](_0x3d6ebc)[_0xe9a7('0x1b')]();};}function respondWithResult(_0x3a0583,_0x199510){_0x199510=_0x199510||0xc8;return function(_0x5dc440){if(_0x5dc440){return _0x3a0583[_0xe9a7('0x1a')](_0x199510)[_0xe9a7('0x1c')](_0x5dc440);}};}function respondWithFilteredResult(_0x351229,_0x52e36b){return function(_0x5cca47){if(_0x5cca47){var _0x128009=typeof _0x52e36b[_0xe9a7('0x1d')]===_0xe9a7('0x1e')&&typeof _0x52e36b['limit']===_0xe9a7('0x1e');var _0x5e5672=_0x5cca47[_0xe9a7('0x1f')];var _0x418ebd=_0x128009?0x0:_0x52e36b[_0xe9a7('0x1d')];var _0xe76c86=_0x128009?_0x5cca47[_0xe9a7('0x1f')]:_0x52e36b[_0xe9a7('0x1d')]+_0x52e36b['limit'];var _0x3878ae;if(_0xe76c86>=_0x5e5672){_0xe76c86=_0x5e5672;_0x3878ae=0xc8;}else{_0x3878ae=0xce;}_0x351229['status'](_0x3878ae);return _0x351229[_0xe9a7('0x20')]('Content-Range',_0x418ebd+'-'+_0xe76c86+'/'+_0x5e5672)[_0xe9a7('0x1c')](_0x5cca47);}return null;};}function patchUpdates(_0x1d5bdc){return function(_0x5d61e3){try{jsonpatch[_0xe9a7('0x21')](_0x5d61e3,_0x1d5bdc,!![]);}catch(_0x28146e){return BPromise['reject'](_0x28146e);}return _0x5d61e3[_0xe9a7('0x22')]();};}function saveUpdates(_0x40d223,_0x3af9c3){return function(_0x2fdd83){if(_0x2fdd83){return _0x2fdd83[_0xe9a7('0x23')](_0x40d223)[_0xe9a7('0x24')](function(_0x1a5ca2){return _0x1a5ca2;});}return null;};}function removeEntity(_0x22846a,_0x208910){return function(_0xae8db1){if(_0xae8db1){return _0xae8db1[_0xe9a7('0x25')]()[_0xe9a7('0x24')](function(){var _0x566d34=_0xae8db1[_0xe9a7('0x26')]({'plain':!![]});var _0x2d0417=_0xe9a7('0x27');return db['UserProfileResource'][_0xe9a7('0x25')]({'where':{'type':_0x2d0417,'resourceId':_0x566d34['id']}})[_0xe9a7('0x24')](function(){return _0xae8db1;});})['then'](function(){_0x22846a[_0xe9a7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ec1a,_0x3e1b48){return function(_0x5832d3){if(!_0x5832d3){_0x37ec1a[_0xe9a7('0x19')](0x194);}return _0x5832d3;};}function handleError(_0x530c4a,_0xb88856){_0xb88856=_0xb88856||0x1f4;return function(_0x344faf){logger[_0xe9a7('0x28')](_0x344faf[_0xe9a7('0x29')]);if(_0x344faf[_0xe9a7('0x2a')]){delete _0x344faf[_0xe9a7('0x2a')];}_0x530c4a[_0xe9a7('0x1a')](_0xb88856)[_0xe9a7('0x2b')](_0x344faf);};}exports[_0xe9a7('0x2c')]=function(_0x2e57c6,_0x3f149c){var _0x2d9128={},_0x13209b={},_0x51c314={'count':0x0,'rows':[]};var _0x4f6563=_[_0xe9a7('0x2d')](db[_0xe9a7('0x2e')]['rawAttributes'],function(_0x1eae9b){return{'name':_0x1eae9b[_0xe9a7('0x2f')],'type':_0x1eae9b[_0xe9a7('0x30')][_0xe9a7('0x31')]};});_0x13209b[_0xe9a7('0x32')]=_[_0xe9a7('0x2d')](_0x4f6563,'name');_0x13209b['query']=_[_0xe9a7('0x33')](_0x2e57c6['query']);_0x13209b['filters']=_[_0xe9a7('0x34')](_0x13209b[_0xe9a7('0x32')],_0x13209b[_0xe9a7('0x35')]);_0x2d9128[_0xe9a7('0x36')]=_[_0xe9a7('0x34')](_0x13209b[_0xe9a7('0x32')],qs['fields'](_0x2e57c6[_0xe9a7('0x35')][_0xe9a7('0x37')]));_0x2d9128[_0xe9a7('0x36')]=_0x2d9128['attributes'][_0xe9a7('0x38')]?_0x2d9128[_0xe9a7('0x36')]:_0x13209b['model'];if(!_0x2e57c6[_0xe9a7('0x35')][_0xe9a7('0x39')](_0xe9a7('0x3a'))){_0x2d9128['limit']=qs[_0xe9a7('0x3b')](_0x2e57c6[_0xe9a7('0x35')][_0xe9a7('0x3b')]);_0x2d9128[_0xe9a7('0x1d')]=qs[_0xe9a7('0x1d')](_0x2e57c6['query'][_0xe9a7('0x1d')]);}_0x2d9128[_0xe9a7('0x3c')]=qs[_0xe9a7('0x3d')](_0x2e57c6[_0xe9a7('0x35')][_0xe9a7('0x3d')]);_0x2d9128[_0xe9a7('0x3e')]=qs[_0xe9a7('0x3f')](_[_0xe9a7('0x40')](_0x2e57c6[_0xe9a7('0x35')],_0x13209b[_0xe9a7('0x3f')]),_0x4f6563);if(_0x2e57c6[_0xe9a7('0x35')][_0xe9a7('0x41')]){_0x2d9128[_0xe9a7('0x3e')]=_[_0xe9a7('0x42')](_0x2d9128[_0xe9a7('0x3e')],{'$or':_['map'](_0x4f6563,function(_0x21eb85){if(_0x21eb85['type']!==_0xe9a7('0x43')){var _0x37bad0={};_0x37bad0[_0x21eb85[_0xe9a7('0x2a')]]={'$like':'%'+_0x2e57c6[_0xe9a7('0x35')][_0xe9a7('0x41')]+'%'};return _0x37bad0;}})});}_0x2d9128=_['merge']({},_0x2d9128,_0x2e57c6['options']);var _0x96775e={'where':_0x2d9128[_0xe9a7('0x3e')]};return db[_0xe9a7('0x2e')]['count'](_0x96775e)[_0xe9a7('0x24')](function(_0x3f6c70){_0x51c314[_0xe9a7('0x1f')]=_0x3f6c70;if(_0x2e57c6['query'][_0xe9a7('0x44')]){_0x2d9128[_0xe9a7('0x45')]=[{'all':!![]}];}return db[_0xe9a7('0x2e')][_0xe9a7('0x46')](_0x2d9128);})[_0xe9a7('0x24')](function(_0x58d509){_0x51c314['rows']=_0x58d509;return _0x51c314;})['then'](respondWithFilteredResult(_0x3f149c,_0x2d9128))[_0xe9a7('0x47')](handleError(_0x3f149c,null));};exports[_0xe9a7('0x48')]=function(_0x3e38e2,_0x286b6d){var _0x17622c={'raw':!![],'where':{'id':_0x3e38e2[_0xe9a7('0x49')]['id']}},_0x2fccf8={};_0x2fccf8[_0xe9a7('0x32')]=_[_0xe9a7('0x33')](db['AnalyticExtractedReport'][_0xe9a7('0x4a')]);_0x2fccf8[_0xe9a7('0x35')]=_['keys'](_0x3e38e2[_0xe9a7('0x35')]);_0x2fccf8['filters']=_[_0xe9a7('0x34')](_0x2fccf8[_0xe9a7('0x32')],_0x2fccf8[_0xe9a7('0x35')]);_0x17622c['attributes']=_['intersection'](_0x2fccf8['model'],qs['fields'](_0x3e38e2['query']['fields']));_0x17622c[_0xe9a7('0x36')]=_0x17622c[_0xe9a7('0x36')][_0xe9a7('0x38')]?_0x17622c[_0xe9a7('0x36')]:_0x2fccf8[_0xe9a7('0x32')];if(_0x3e38e2[_0xe9a7('0x35')][_0xe9a7('0x44')]){_0x17622c['include']=[{'all':!![]}];}_0x17622c=_[_0xe9a7('0x42')]({},_0x17622c,_0x3e38e2[_0xe9a7('0x4b')]);return db['AnalyticExtractedReport']['find'](_0x17622c)[_0xe9a7('0x24')](handleEntityNotFound(_0x286b6d,null))[_0xe9a7('0x24')](respondWithResult(_0x286b6d,null))[_0xe9a7('0x47')](handleError(_0x286b6d,null));};exports[_0xe9a7('0x4c')]=function(_0x45ce0f,_0x467474){return db[_0xe9a7('0x2e')][_0xe9a7('0x4c')](_0x45ce0f[_0xe9a7('0x4d')],{})[_0xe9a7('0x24')](function(_0x4b3243){var _0x1bdb9b=_0x45ce0f[_0xe9a7('0x4e')]['get']({'plain':!![]});if(!_0x1bdb9b)throw new Error(_0xe9a7('0x4f'));if(_0x1bdb9b[_0xe9a7('0x50')]===_0xe9a7('0x4e')){var _0x36c060=_0x4b3243['get']({'plain':!![]});var _0x5279d9=_0xe9a7('0x27');return db[_0xe9a7('0x51')][_0xe9a7('0x52')]({'where':{'name':_0x5279d9,'userProfileId':_0x1bdb9b[_0xe9a7('0x53')]},'raw':!![]})[_0xe9a7('0x24')](function(_0x1154e9){if(_0x1154e9&&_0x1154e9[_0xe9a7('0x54')]===0x0){return db[_0xe9a7('0x55')][_0xe9a7('0x4c')]({'name':_0x36c060[_0xe9a7('0x2a')],'resourceId':_0x36c060['id'],'type':_0x1154e9['name'],'sectionId':_0x1154e9['id']},{})[_0xe9a7('0x24')](function(){return _0x4b3243;});}else{return _0x4b3243;}})[_0xe9a7('0x47')](function(_0x1b4a45){logger[_0xe9a7('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b4a45);throw _0x1b4a45;});}return _0x4b3243;})[_0xe9a7('0x24')](respondWithResult(_0x467474,0xc9))[_0xe9a7('0x47')](handleError(_0x467474,null));};exports[_0xe9a7('0x23')]=function(_0x550ab1,_0x32fcbd){if(_0x550ab1[_0xe9a7('0x4d')]['id']){delete _0x550ab1[_0xe9a7('0x4d')]['id'];}return db[_0xe9a7('0x2e')][_0xe9a7('0x52')]({'where':{'id':_0x550ab1['params']['id']}})[_0xe9a7('0x24')](handleEntityNotFound(_0x32fcbd,null))['then'](saveUpdates(_0x550ab1[_0xe9a7('0x4d')],null))[_0xe9a7('0x24')](respondWithResult(_0x32fcbd,null))[_0xe9a7('0x47')](handleError(_0x32fcbd,null));};exports['destroy']=function(_0x55f843,_0x1b3c3e){return db[_0xe9a7('0x2e')][_0xe9a7('0x52')]({'where':{'id':_0x55f843['params']['id']}})[_0xe9a7('0x24')](handleEntityNotFound(_0x1b3c3e,null))[_0xe9a7('0x24')](removeEntity(_0x1b3c3e,null))[_0xe9a7('0x47')](handleError(_0x1b3c3e,null));};exports[_0xe9a7('0x56')]=function(_0x140775,_0x4dfbeb,_0x194aa2){return db[_0xe9a7('0x2e')][_0xe9a7('0x52')]({'where':{'id':_0x140775[_0xe9a7('0x49')]['id']},'attributes':[_0xe9a7('0x2a'),_0xe9a7('0x57'),_0xe9a7('0x58'),_0xe9a7('0x59')],'raw':!![]})[_0xe9a7('0x24')](handleEntityNotFound(_0x4dfbeb,null))[_0xe9a7('0x24')](function(_0x388d2d){if(_0x388d2d){if(!fs[_0xe9a7('0x5a')](path[_0xe9a7('0x5b')](config[_0xe9a7('0x5c')],_0xe9a7('0x5d'),_0x388d2d[_0xe9a7('0x58')]))){throw new db['Sequelize'][(_0xe9a7('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x140775[_0xe9a7('0x35')][_0xe9a7('0x5f')]){return _0x4dfbeb[_0xe9a7('0x19')](0xc8);}return _0x4dfbeb['download'](path['join'](config['root'],_0xe9a7('0x5d'),_0x388d2d[_0xe9a7('0x58')]),util[_0xe9a7('0x60')](_0xe9a7('0x61'),_0x388d2d[_0xe9a7('0x57')]||_0x388d2d['name'],_0x388d2d[_0xe9a7('0x59')][_0xe9a7('0x62')]()));}})[_0xe9a7('0x47')](handleError(_0x4dfbeb,null));}; \ No newline at end of file +var _0x3642=['error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','sendStatus'];(function(_0xebbd6c,_0x37bd2d){var _0x10d63c=function(_0x32b0db){while(--_0x32b0db){_0xebbd6c['push'](_0xebbd6c['shift']());}};_0x10d63c(++_0x37bd2d);}(_0x3642,0xfd));var _0x2364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3642[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2364('0x0'));var zipdir=require(_0x2364('0x1'));var jsonpatch=require(_0x2364('0x2'));var rp=require(_0x2364('0x3'));var moment=require(_0x2364('0x4'));var BPromise=require(_0x2364('0x5'));var Mustache=require(_0x2364('0x6'));var util=require('util');var path=require(_0x2364('0x7'));var sox=require(_0x2364('0x8'));var csv=require(_0x2364('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2364('0xa'));var _=require(_0x2364('0xb'));var squel=require(_0x2364('0xc'));var crypto=require(_0x2364('0xd'));var jsforce=require(_0x2364('0xe'));var deskjs=require(_0x2364('0xf'));var toCsv=require(_0x2364('0x9'));var querystring=require(_0x2364('0x10'));var Papa=require(_0x2364('0x11'));var Redis=require('ioredis');var authService=require(_0x2364('0x12'));var qs=require(_0x2364('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2364('0x14'));var logger=require(_0x2364('0x15'))(_0x2364('0x16'));var utils=require(_0x2364('0x17'));var config=require(_0x2364('0x18'));var licenseUtil=require(_0x2364('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe21fe3,_0x365a41){_0x365a41=_0x365a41||0xcc;return function(_0x26fb8e){if(_0x26fb8e){return _0xe21fe3['sendStatus'](_0x365a41);}return _0xe21fe3[_0x2364('0x1a')](_0x365a41)[_0x2364('0x1b')]();};}function respondWithResult(_0x4cdcd2,_0x44c760){_0x44c760=_0x44c760||0xc8;return function(_0x4ef0d9){if(_0x4ef0d9){return _0x4cdcd2[_0x2364('0x1a')](_0x44c760)[_0x2364('0x1c')](_0x4ef0d9);}};}function respondWithFilteredResult(_0x4d111b,_0x18df8b){return function(_0x375d53){if(_0x375d53){var _0x45358b=typeof _0x18df8b['offset']==='undefined'&&typeof _0x18df8b[_0x2364('0x1d')]===_0x2364('0x1e');var _0x5dcdcb=_0x375d53[_0x2364('0x1f')];var _0x628389=_0x45358b?0x0:_0x18df8b[_0x2364('0x20')];var _0x34fee8=_0x45358b?_0x375d53['count']:_0x18df8b[_0x2364('0x20')]+_0x18df8b[_0x2364('0x1d')];var _0x348b52;if(_0x34fee8>=_0x5dcdcb){_0x34fee8=_0x5dcdcb;_0x348b52=0xc8;}else{_0x348b52=0xce;}_0x4d111b['status'](_0x348b52);return _0x4d111b[_0x2364('0x21')]('Content-Range',_0x628389+'-'+_0x34fee8+'/'+_0x5dcdcb)[_0x2364('0x1c')](_0x375d53);}return null;};}function patchUpdates(_0x209e16){return function(_0x594460){try{jsonpatch[_0x2364('0x22')](_0x594460,_0x209e16,!![]);}catch(_0x9ff72a){return BPromise[_0x2364('0x23')](_0x9ff72a);}return _0x594460[_0x2364('0x24')]();};}function saveUpdates(_0x500a10,_0x1c95c7){return function(_0x397169){if(_0x397169){return _0x397169[_0x2364('0x25')](_0x500a10)['then'](function(_0x5911ba){return _0x5911ba;});}return null;};}function removeEntity(_0x66293f,_0x27598f){return function(_0x2a8bc1){if(_0x2a8bc1){return _0x2a8bc1['destroy']()[_0x2364('0x26')](function(){var _0x31cb01=_0x2a8bc1[_0x2364('0x27')]({'plain':!![]});var _0x56cf06=_0x2364('0x28');return db[_0x2364('0x29')][_0x2364('0x2a')]({'where':{'type':_0x56cf06,'resourceId':_0x31cb01['id']}})[_0x2364('0x26')](function(){return _0x2a8bc1;});})[_0x2364('0x26')](function(){_0x66293f[_0x2364('0x1a')](0xcc)[_0x2364('0x1b')]();});}};}function handleEntityNotFound(_0x4fbd74,_0x39e84a){return function(_0x24e8e5){if(!_0x24e8e5){_0x4fbd74[_0x2364('0x2b')](0x194);}return _0x24e8e5;};}function handleError(_0x25ea42,_0x5d6bf8){_0x5d6bf8=_0x5d6bf8||0x1f4;return function(_0x5c51da){logger[_0x2364('0x2c')](_0x5c51da[_0x2364('0x2d')]);if(_0x5c51da[_0x2364('0x2e')]){delete _0x5c51da[_0x2364('0x2e')];}_0x25ea42['status'](_0x5d6bf8)['send'](_0x5c51da);};}exports[_0x2364('0x2f')]=function(_0x3cf507,_0x49b0f6){var _0x290554={},_0x1761c4={},_0x120fa6={'count':0x0,'rows':[]};var _0x128e90=_[_0x2364('0x30')](db[_0x2364('0x31')]['rawAttributes'],function(_0x23511b){return{'name':_0x23511b[_0x2364('0x32')],'type':_0x23511b[_0x2364('0x33')][_0x2364('0x34')]};});_0x1761c4[_0x2364('0x35')]=_['map'](_0x128e90,'name');_0x1761c4[_0x2364('0x36')]=_[_0x2364('0x37')](_0x3cf507['query']);_0x1761c4[_0x2364('0x38')]=_[_0x2364('0x39')](_0x1761c4['model'],_0x1761c4['query']);_0x290554[_0x2364('0x3a')]=_['intersection'](_0x1761c4[_0x2364('0x35')],qs[_0x2364('0x3b')](_0x3cf507[_0x2364('0x36')][_0x2364('0x3b')]));_0x290554[_0x2364('0x3a')]=_0x290554[_0x2364('0x3a')]['length']?_0x290554[_0x2364('0x3a')]:_0x1761c4[_0x2364('0x35')];if(!_0x3cf507[_0x2364('0x36')][_0x2364('0x3c')]('nolimit')){_0x290554['limit']=qs[_0x2364('0x1d')](_0x3cf507[_0x2364('0x36')]['limit']);_0x290554['offset']=qs[_0x2364('0x20')](_0x3cf507[_0x2364('0x36')][_0x2364('0x20')]);}_0x290554[_0x2364('0x3d')]=qs[_0x2364('0x3e')](_0x3cf507[_0x2364('0x36')][_0x2364('0x3e')]);_0x290554['where']=qs[_0x2364('0x38')](_[_0x2364('0x3f')](_0x3cf507[_0x2364('0x36')],_0x1761c4['filters']),_0x128e90);if(_0x3cf507[_0x2364('0x36')][_0x2364('0x40')]){_0x290554['where']=_[_0x2364('0x41')](_0x290554[_0x2364('0x42')],{'$or':_[_0x2364('0x30')](_0x128e90,function(_0x41e91e){if(_0x41e91e[_0x2364('0x33')]!==_0x2364('0x43')){var _0x57fb35={};_0x57fb35[_0x41e91e[_0x2364('0x2e')]]={'$like':'%'+_0x3cf507[_0x2364('0x36')][_0x2364('0x40')]+'%'};return _0x57fb35;}})});}_0x290554=_[_0x2364('0x41')]({},_0x290554,_0x3cf507[_0x2364('0x44')]);var _0x58522f={'where':_0x290554['where']};return db[_0x2364('0x31')][_0x2364('0x1f')](_0x58522f)[_0x2364('0x26')](function(_0x3d19dc){_0x120fa6[_0x2364('0x1f')]=_0x3d19dc;if(_0x3cf507[_0x2364('0x36')][_0x2364('0x45')]){_0x290554[_0x2364('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x2364('0x47')](_0x290554);})[_0x2364('0x26')](function(_0x20d72c){_0x120fa6[_0x2364('0x48')]=_0x20d72c;return _0x120fa6;})[_0x2364('0x26')](respondWithFilteredResult(_0x49b0f6,_0x290554))[_0x2364('0x49')](handleError(_0x49b0f6,null));};exports['show']=function(_0xbf343f,_0x4c803c){var _0x1ddf86={'raw':!![],'where':{'id':_0xbf343f[_0x2364('0x4a')]['id']}},_0x4f2cee={};_0x4f2cee[_0x2364('0x35')]=_[_0x2364('0x37')](db[_0x2364('0x31')][_0x2364('0x4b')]);_0x4f2cee[_0x2364('0x36')]=_[_0x2364('0x37')](_0xbf343f[_0x2364('0x36')]);_0x4f2cee['filters']=_[_0x2364('0x39')](_0x4f2cee[_0x2364('0x35')],_0x4f2cee['query']);_0x1ddf86[_0x2364('0x3a')]=_[_0x2364('0x39')](_0x4f2cee[_0x2364('0x35')],qs[_0x2364('0x3b')](_0xbf343f[_0x2364('0x36')][_0x2364('0x3b')]));_0x1ddf86[_0x2364('0x3a')]=_0x1ddf86['attributes'][_0x2364('0x4c')]?_0x1ddf86['attributes']:_0x4f2cee[_0x2364('0x35')];if(_0xbf343f[_0x2364('0x36')][_0x2364('0x45')]){_0x1ddf86[_0x2364('0x46')]=[{'all':!![]}];}_0x1ddf86=_['merge']({},_0x1ddf86,_0xbf343f['options']);return db['AnalyticExtractedReport'][_0x2364('0x4d')](_0x1ddf86)[_0x2364('0x26')](handleEntityNotFound(_0x4c803c,null))[_0x2364('0x26')](respondWithResult(_0x4c803c,null))[_0x2364('0x49')](handleError(_0x4c803c,null));};exports[_0x2364('0x4e')]=function(_0x34084d,_0x25f01b){return db[_0x2364('0x31')][_0x2364('0x4e')](_0x34084d[_0x2364('0x4f')],{})[_0x2364('0x26')](function(_0x381770){var _0x137890=_0x34084d[_0x2364('0x50')][_0x2364('0x27')]({'plain':!![]});if(!_0x137890)throw new Error(_0x2364('0x51'));if(_0x137890['role']===_0x2364('0x50')){var _0x404a33=_0x381770[_0x2364('0x27')]({'plain':!![]});var _0x36cb8c='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x36cb8c,'userProfileId':_0x137890[_0x2364('0x52')]},'raw':!![]})[_0x2364('0x26')](function(_0x39555f){if(_0x39555f&&_0x39555f[_0x2364('0x53')]===0x0){return db[_0x2364('0x29')][_0x2364('0x4e')]({'name':_0x404a33[_0x2364('0x2e')],'resourceId':_0x404a33['id'],'type':_0x39555f['name'],'sectionId':_0x39555f['id']},{})[_0x2364('0x26')](function(){return _0x381770;});}else{return _0x381770;}})[_0x2364('0x49')](function(_0x575b5a){logger[_0x2364('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x575b5a);throw _0x575b5a;});}return _0x381770;})['then'](respondWithResult(_0x25f01b,0xc9))[_0x2364('0x49')](handleError(_0x25f01b,null));};exports[_0x2364('0x25')]=function(_0x498c2,_0x1b47a6){if(_0x498c2[_0x2364('0x4f')]['id']){delete _0x498c2['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x498c2[_0x2364('0x4a')]['id']}})[_0x2364('0x26')](handleEntityNotFound(_0x1b47a6,null))[_0x2364('0x26')](saveUpdates(_0x498c2[_0x2364('0x4f')],null))['then'](respondWithResult(_0x1b47a6,null))[_0x2364('0x49')](handleError(_0x1b47a6,null));};exports[_0x2364('0x2a')]=function(_0x4d6c3e,_0x56eaf8){return db[_0x2364('0x31')][_0x2364('0x4d')]({'where':{'id':_0x4d6c3e[_0x2364('0x4a')]['id']}})[_0x2364('0x26')](handleEntityNotFound(_0x56eaf8,null))[_0x2364('0x26')](removeEntity(_0x56eaf8,null))['catch'](handleError(_0x56eaf8,null));};exports[_0x2364('0x54')]=function(_0x1c1e15,_0x13ceed,_0x1e651f){return db[_0x2364('0x31')]['find']({'where':{'id':_0x1c1e15[_0x2364('0x4a')]['id']},'attributes':[_0x2364('0x2e'),_0x2364('0x55'),_0x2364('0x56'),_0x2364('0x57')],'raw':!![]})[_0x2364('0x26')](handleEntityNotFound(_0x13ceed,null))[_0x2364('0x26')](function(_0x1cb0cd){if(_0x1cb0cd){if(!fs[_0x2364('0x58')](path[_0x2364('0x59')](config[_0x2364('0x5a')],_0x2364('0x5b'),_0x1cb0cd[_0x2364('0x56')]))){throw new db[(_0x2364('0x5c'))][(_0x2364('0x5d'))](_0x2364('0x5e'));}if(_0x1c1e15[_0x2364('0x36')][_0x2364('0x5f')]){return _0x13ceed['sendStatus'](0xc8);}return _0x13ceed['download'](path[_0x2364('0x59')](config[_0x2364('0x5a')],_0x2364('0x5b'),_0x1cb0cd[_0x2364('0x56')]),util[_0x2364('0x60')](_0x2364('0x61'),_0x1cb0cd['basename']||_0x1cb0cd['name'],_0x1cb0cd['output'][_0x2364('0x62')]()));}})[_0x2364('0x49')](handleError(_0x13ceed,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7695487..a9b78f8 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 _0x34ef=['moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','lodash'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x34ef,0x1b8));var _0xf34e=function(_0x81aad6,_0x26df70){_0x81aad6=_0x81aad6-0x0;var _0x46e1ec=_0x34ef[_0x81aad6];return _0x46e1ec;};'use strict';var _=require(_0xf34e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf34e('0x1'));var BPromise=require(_0xf34e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf34e('0x3'));var rimraf=require(_0xf34e('0x4'));var config=require(_0xf34e('0x5'));var attributes=require(_0xf34e('0x6'));module['exports']=function(_0x2262f5,_0x454beb){return _0x2262f5[_0xf34e('0x7')](_0xf34e('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aa5=['api','moment','request-promise','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0xf136bc,_0x4cb677){var _0x447aa6=function(_0x5c6f9b){while(--_0x5c6f9b){_0xf136bc['push'](_0xf136bc['shift']());}};_0x447aa6(++_0x4cb677);}(_0x7aa5,0x17f));var _0x57aa=function(_0xe2a598,_0x105818){_0xe2a598=_0xe2a598-0x0;var _0x4a4713=_0x7aa5[_0xe2a598];return _0x4a4713;};'use strict';var _=require(_0x57aa('0x0'));var util=require(_0x57aa('0x1'));var logger=require('../../config/logger')(_0x57aa('0x2'));var moment=require(_0x57aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x57aa('0x4'));var fs=require('fs');var path=require(_0x57aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x57aa('0x6'));module[_0x57aa('0x7')]=function(_0x237503,_0x2387e7){return _0x237503[_0x57aa('0x8')](_0x57aa('0x9'),attributes,{'tableName':_0x57aa('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 cd5d5d7..eb93d12 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 _0x9369=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x9369,0x1b9));var _0x9936=function(_0x5b799a,_0x59fecd){_0x5b799a=_0x5b799a-0x0;var _0x314d85=_0x9369[_0x5b799a];return _0x314d85;};'use strict';var _=require(_0x9936('0x0'));var util=require('util');var moment=require(_0x9936('0x1'));var BPromise=require(_0x9936('0x2'));var rs=require(_0x9936('0x3'));var fs=require('fs');var Redis=require(_0x9936('0x4'));var db=require(_0x9936('0x5'))['db'];var utils=require(_0x9936('0x6'));var logger=require(_0x9936('0x7'))(_0x9936('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9936('0x9')][_0x9936('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a1fb7,_0x416968,_0x2e22a0){return new BPromise(function(_0x123127,_0x3738c1){return client[_0x9936('0xb')](_0x4a1fb7,_0x2e22a0)[_0x9936('0xc')](function(_0x5d7328){logger[_0x9936('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x416968,'request\x20sent');logger['debug'](_0x9936('0xe'),_0x416968,_0x9936('0xf'),JSON[_0x9936('0x10')](_0x5d7328));if(_0x5d7328[_0x9936('0x11')]){if(_0x5d7328[_0x9936('0x11')]['code']===0x1f4){logger[_0x9936('0x11')](_0x9936('0x12'),_0x416968,_0x5d7328['error']['message']);return _0x3738c1(_0x5d7328[_0x9936('0x11')][_0x9936('0x13')]);}logger[_0x9936('0x11')](_0x9936('0x12'),_0x416968,_0x5d7328[_0x9936('0x11')][_0x9936('0x13')]);return _0x123127(_0x5d7328[_0x9936('0x11')][_0x9936('0x13')]);}else{logger[_0x9936('0xd')](_0x9936('0x12'),_0x416968,'request\x20sent');_0x123127(_0x5d7328[_0x9936('0x14')][_0x9936('0x13')]);}})['catch'](function(_0x5b1c4c){logger['error'](_0x9936('0x12'),_0x416968,_0x5b1c4c);_0x3738c1(_0x5b1c4c);});});} \ No newline at end of file +var _0xd206=['error','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x29103f,_0x5bae70){var _0x596078=function(_0x5545b0){while(--_0x5545b0){_0x29103f['push'](_0x29103f['shift']());}};_0x596078(++_0x5bae70);}(_0xd206,0x89));var _0x6d20=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xd206[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x6d20('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d20('0x1'));var fs=require('fs');var Redis=require(_0x6d20('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d20('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d20('0x4'));var jayson=require(_0x6d20('0x5'));var client=jayson['client'][_0x6d20('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c50e2,_0x43bf60,_0x1969a1){return new BPromise(function(_0x331f24,_0x9ecd59){return client[_0x6d20('0x7')](_0x1c50e2,_0x1969a1)[_0x6d20('0x8')](function(_0x3c8d42){logger[_0x6d20('0x9')](_0x6d20('0xa'),_0x43bf60,_0x6d20('0xb'));logger[_0x6d20('0xc')](_0x6d20('0xd'),_0x43bf60,'request\x20sent',JSON[_0x6d20('0xe')](_0x3c8d42));if(_0x3c8d42['error']){if(_0x3c8d42[_0x6d20('0xf')]['code']===0x1f4){logger[_0x6d20('0xf')](_0x6d20('0xa'),_0x43bf60,_0x3c8d42[_0x6d20('0xf')][_0x6d20('0x10')]);return _0x9ecd59(_0x3c8d42[_0x6d20('0xf')][_0x6d20('0x10')]);}logger['error'](_0x6d20('0xa'),_0x43bf60,_0x3c8d42[_0x6d20('0xf')][_0x6d20('0x10')]);return _0x331f24(_0x3c8d42['error'][_0x6d20('0x10')]);}else{logger['info'](_0x6d20('0xa'),_0x43bf60,_0x6d20('0xb'));_0x331f24(_0x3c8d42[_0x6d20('0x11')][_0x6d20('0x10')]);}})[_0x6d20('0x12')](function(_0x2acb7b){logger[_0x6d20('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x43bf60,_0x2acb7b);_0x9ecd59(_0x2acb7b);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 30b9b99..be54757 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 _0x5c68=['index','/:id','show','/:id/download','post','create','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x342cd0,_0x4d7c30){var _0x27b5ca=function(_0x22b019){while(--_0x22b019){_0x342cd0['push'](_0x342cd0['shift']());}};_0x27b5ca(++_0x4d7c30);}(_0x5c68,0x105));var _0x85c6=function(_0x12f45f,_0x2f0799){_0x12f45f=_0x12f45f-0x0;var _0x172fdc=_0x5c68[_0x12f45f];return _0x172fdc;};'use strict';var multer=require(_0x85c6('0x0'));var util=require(_0x85c6('0x1'));var path=require(_0x85c6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85c6('0x3')]();var fs_extra=require(_0x85c6('0x4'));var auth=require(_0x85c6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x85c6('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x85c6('0x7')]('/',auth[_0x85c6('0x8')](),controller[_0x85c6('0x9')]);router['get'](_0x85c6('0xa'),auth['isAuthenticated'](),controller[_0x85c6('0xb')]);router[_0x85c6('0x7')](_0x85c6('0xc'),auth[_0x85c6('0x8')](),controller['download']);router[_0x85c6('0xd')]('/',auth[_0x85c6('0x8')](),controller[_0x85c6('0xe')]);router[_0x85c6('0xf')](_0x85c6('0xa'),auth[_0x85c6('0x8')](),controller['update']);router[_0x85c6('0x10')](_0x85c6('0xa'),auth[_0x85c6('0x8')](),controller[_0x85c6('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe445=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','post','create','/:id'];(function(_0x3e3987,_0x37ed5d){var _0x3e3755=function(_0x488682){while(--_0x488682){_0x3e3987['push'](_0x3e3987['shift']());}};_0x3e3755(++_0x37ed5d);}(_0xe445,0x88));var _0x5e44=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xe445[_0x4c3070];return _0x536a44;};'use strict';var multer=require(_0x5e44('0x0'));var util=require(_0x5e44('0x1'));var path=require(_0x5e44('0x2'));var timeout=require(_0x5e44('0x3'));var express=require(_0x5e44('0x4'));var router=express[_0x5e44('0x5')]();var fs_extra=require(_0x5e44('0x6'));var auth=require(_0x5e44('0x7'));var interaction=require(_0x5e44('0x8'));var config=require(_0x5e44('0x9'));var controller=require(_0x5e44('0xa'));router[_0x5e44('0xb')]('/',auth[_0x5e44('0xc')](),controller['index']);router[_0x5e44('0xb')]('/:id',auth[_0x5e44('0xc')](),controller[_0x5e44('0xd')]);router[_0x5e44('0xb')](_0x5e44('0xe'),auth[_0x5e44('0xc')](),controller['download']);router[_0x5e44('0xf')]('/',auth[_0x5e44('0xc')](),controller[_0x5e44('0x10')]);router['put'](_0x5e44('0x11'),auth[_0x5e44('0xc')](),controller[_0x5e44('0x12')]);router[_0x5e44('0x13')](_0x5e44('0x11'),auth[_0x5e44('0xc')](),controller[_0x5e44('0x14')]);module[_0x5e44('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index fed3046..9fbbbc7 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 _0x20e4=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1a81b3,_0x2d6e74){var _0x2dd21a=function(_0x1e66ac){while(--_0x1e66ac){_0x1a81b3['push'](_0x1a81b3['shift']());}};_0x2dd21a(++_0x2d6e74);}(_0x20e4,0x162));var _0x420e=function(_0x16f941,_0x1b2c1d){_0x16f941=_0x16f941-0x0;var _0x1789a7=_0x20e4[_0x16f941];return _0x1789a7;};'use strict';var Sequelize=require(_0x420e('0x0'));module[_0x420e('0x1')]={'field':{'type':Sequelize[_0x420e('0x2')]},'alias':{'type':Sequelize[_0x420e('0x3')]},'function':{'type':Sequelize[_0x420e('0x3')]},'format':{'type':Sequelize[_0x420e('0x3')]},'groupBy':{'type':Sequelize[_0x420e('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x420e('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2167=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2ecbc0,_0x26ee68){var _0x5c25db=function(_0x205101){while(--_0x205101){_0x2ecbc0['push'](_0x2ecbc0['shift']());}};_0x5c25db(++_0x26ee68);}(_0x2167,0x136));var _0x7216=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2167[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x7216('0x0'));module[_0x7216('0x1')]={'field':{'type':Sequelize[_0x7216('0x2')]},'alias':{'type':Sequelize[_0x7216('0x3')]},'function':{'type':Sequelize[_0x7216('0x3')]},'format':{'type':Sequelize[_0x7216('0x3')]},'groupBy':{'type':Sequelize[_0x7216('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7216('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 529f7c3..bf1d5f2 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 _0xde1d=['catch','create','body','bulkCreate','update','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','intersection','find'];(function(_0xdbde4b,_0x20208a){var _0x28fc56=function(_0x3b2fc4){while(--_0x3b2fc4){_0xdbde4b['push'](_0xdbde4b['shift']());}};_0x28fc56(++_0x20208a);}(_0xde1d,0x109));var _0xdde1=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xde1d[_0x1e393b];return _0x3d0bfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdde1('0x0'));var zipdir=require(_0xdde1('0x1'));var jsonpatch=require(_0xdde1('0x2'));var rp=require(_0xdde1('0x3'));var moment=require('moment');var BPromise=require(_0xdde1('0x4'));var Mustache=require('mustache');var util=require(_0xdde1('0x5'));var path=require(_0xdde1('0x6'));var sox=require(_0xdde1('0x7'));var csv=require(_0xdde1('0x8'));var ejs=require(_0xdde1('0x9'));var fs=require('fs');var fs_extra=require(_0xdde1('0xa'));var _=require('lodash');var squel=require(_0xdde1('0xb'));var crypto=require(_0xdde1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdde1('0xd'));var toCsv=require(_0xdde1('0x8'));var querystring=require(_0xdde1('0xe'));var Papa=require(_0xdde1('0xf'));var Redis=require('ioredis');var authService=require(_0xdde1('0x10'));var qs=require(_0xdde1('0x11'));var as=require(_0xdde1('0x12'));var hardwareService=require(_0xdde1('0x13'));var logger=require(_0xdde1('0x14'))(_0xdde1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdde1('0x16'));var db=require(_0xdde1('0x17'))['db'];function respondWithStatusCode(_0x1bbffe,_0x1bcbb8){_0x1bcbb8=_0x1bcbb8||0xcc;return function(_0x5c0768){if(_0x5c0768){return _0x1bbffe['sendStatus'](_0x1bcbb8);}return _0x1bbffe[_0xdde1('0x18')](_0x1bcbb8)[_0xdde1('0x19')]();};}function respondWithResult(_0x1a4fee,_0x4e7728){_0x4e7728=_0x4e7728||0xc8;return function(_0x11e7e7){if(_0x11e7e7){return _0x1a4fee[_0xdde1('0x18')](_0x4e7728)[_0xdde1('0x1a')](_0x11e7e7);}};}function respondWithFilteredResult(_0x505d3a,_0x1937ef){return function(_0x29f2fc){if(_0x29f2fc){var _0x450d09=typeof _0x1937ef[_0xdde1('0x1b')]===_0xdde1('0x1c')&&typeof _0x1937ef['limit']===_0xdde1('0x1c');var _0x20d7c2=_0x29f2fc[_0xdde1('0x1d')];var _0x5db5be=_0x450d09?0x0:_0x1937ef['offset'];var _0x88b9aa=_0x450d09?_0x29f2fc[_0xdde1('0x1d')]:_0x1937ef[_0xdde1('0x1b')]+_0x1937ef['limit'];var _0x318bfc;if(_0x88b9aa>=_0x20d7c2){_0x88b9aa=_0x20d7c2;_0x318bfc=0xc8;}else{_0x318bfc=0xce;}_0x505d3a[_0xdde1('0x18')](_0x318bfc);return _0x505d3a[_0xdde1('0x1e')](_0xdde1('0x1f'),_0x5db5be+'-'+_0x88b9aa+'/'+_0x20d7c2)[_0xdde1('0x1a')](_0x29f2fc);}return null;};}function patchUpdates(_0x26dec9){return function(_0x3417e4){try{jsonpatch[_0xdde1('0x20')](_0x3417e4,_0x26dec9,!![]);}catch(_0x5987b3){return BPromise[_0xdde1('0x21')](_0x5987b3);}return _0x3417e4[_0xdde1('0x22')]();};}function saveUpdates(_0x195180,_0x3f33b7){return function(_0x47ab77){if(_0x47ab77){return _0x47ab77['update'](_0x195180)[_0xdde1('0x23')](function(_0x5e8f4b){return _0x5e8f4b;});}return null;};}function removeEntity(_0x33e406,_0x2db20d){return function(_0x13b10b){if(_0x13b10b){return _0x13b10b['destroy']()[_0xdde1('0x23')](function(){_0x33e406[_0xdde1('0x18')](0xcc)[_0xdde1('0x19')]();});}};}function handleEntityNotFound(_0x372ce7,_0x48b478){return function(_0x304f3d){if(!_0x304f3d){_0x372ce7[_0xdde1('0x24')](0x194);}return _0x304f3d;};}function handleError(_0x260523,_0x58ff95){_0x58ff95=_0x58ff95||0x1f4;return function(_0x29b1a1){logger[_0xdde1('0x25')](_0x29b1a1[_0xdde1('0x26')]);if(_0x29b1a1[_0xdde1('0x27')]){delete _0x29b1a1[_0xdde1('0x27')];}_0x260523[_0xdde1('0x18')](_0x58ff95)[_0xdde1('0x28')](_0x29b1a1);};}exports[_0xdde1('0x29')]=function(_0x37b98b,_0x5357a7){var _0xfb6301={},_0x56340a={},_0x4af29b={'count':0x0,'rows':[]};var _0x5f0f39=_[_0xdde1('0x2a')](db[_0xdde1('0x2b')]['rawAttributes'],function(_0x2bc2e9){return{'name':_0x2bc2e9[_0xdde1('0x2c')],'type':_0x2bc2e9['type'][_0xdde1('0x2d')]};});_0x56340a[_0xdde1('0x2e')]=_[_0xdde1('0x2a')](_0x5f0f39,_0xdde1('0x27'));_0x56340a[_0xdde1('0x2f')]=_['keys'](_0x37b98b['query']);_0x56340a[_0xdde1('0x30')]=_['intersection'](_0x56340a[_0xdde1('0x2e')],_0x56340a[_0xdde1('0x2f')]);_0xfb6301[_0xdde1('0x31')]=_['intersection'](_0x56340a[_0xdde1('0x2e')],qs['fields'](_0x37b98b[_0xdde1('0x2f')][_0xdde1('0x32')]));_0xfb6301[_0xdde1('0x31')]=_0xfb6301[_0xdde1('0x31')][_0xdde1('0x33')]?_0xfb6301[_0xdde1('0x31')]:_0x56340a[_0xdde1('0x2e')];if(!_0x37b98b[_0xdde1('0x2f')][_0xdde1('0x34')](_0xdde1('0x35'))){_0xfb6301['limit']=qs['limit'](_0x37b98b[_0xdde1('0x2f')]['limit']);_0xfb6301[_0xdde1('0x1b')]=qs[_0xdde1('0x1b')](_0x37b98b['query'][_0xdde1('0x1b')]);}_0xfb6301[_0xdde1('0x36')]=qs[_0xdde1('0x37')](_0x37b98b['query'][_0xdde1('0x37')]);_0xfb6301[_0xdde1('0x38')]=qs['filters'](_[_0xdde1('0x39')](_0x37b98b[_0xdde1('0x2f')],_0x56340a[_0xdde1('0x30')]),_0x5f0f39);if(_0x37b98b['query']['filter']){_0xfb6301[_0xdde1('0x38')]=_[_0xdde1('0x3a')](_0xfb6301['where'],{'$or':_[_0xdde1('0x2a')](_0x5f0f39,function(_0x36fdf6){if(_0x36fdf6[_0xdde1('0x3b')]!==_0xdde1('0x3c')){var _0x15f429={};_0x15f429[_0x36fdf6[_0xdde1('0x27')]]={'$like':'%'+_0x37b98b['query'][_0xdde1('0x3d')]+'%'};return _0x15f429;}})});}_0xfb6301=_['merge']({},_0xfb6301,_0x37b98b[_0xdde1('0x3e')]);var _0xf2778a={'where':_0xfb6301[_0xdde1('0x38')]};return db[_0xdde1('0x2b')][_0xdde1('0x1d')](_0xf2778a)[_0xdde1('0x23')](function(_0x191833){_0x4af29b['count']=_0x191833;if(_0x37b98b[_0xdde1('0x2f')][_0xdde1('0x3f')]){_0xfb6301[_0xdde1('0x40')]=[{'all':!![]}];}return db[_0xdde1('0x2b')][_0xdde1('0x41')](_0xfb6301);})[_0xdde1('0x23')](function(_0x5b99c5){_0x4af29b[_0xdde1('0x42')]=_0x5b99c5;return _0x4af29b;})[_0xdde1('0x23')](respondWithFilteredResult(_0x5357a7,_0xfb6301))['catch'](handleError(_0x5357a7,null));};exports['show']=function(_0x4e86c5,_0x1956a1){var _0x357fdf={'raw':![],'where':{'id':_0x4e86c5[_0xdde1('0x43')]['id']}},_0x182890={};_0x182890[_0xdde1('0x2e')]=_[_0xdde1('0x44')](db[_0xdde1('0x2b')]['rawAttributes']);_0x182890[_0xdde1('0x2f')]=_[_0xdde1('0x44')](_0x4e86c5['query']);_0x182890['filters']=_[_0xdde1('0x45')](_0x182890[_0xdde1('0x2e')],_0x182890['query']);_0x357fdf['attributes']=_[_0xdde1('0x45')](_0x182890[_0xdde1('0x2e')],qs[_0xdde1('0x32')](_0x4e86c5['query']['fields']));_0x357fdf[_0xdde1('0x31')]=_0x357fdf[_0xdde1('0x31')][_0xdde1('0x33')]?_0x357fdf[_0xdde1('0x31')]:_0x182890[_0xdde1('0x2e')];if(_0x4e86c5[_0xdde1('0x2f')]['includeAll']){_0x357fdf[_0xdde1('0x40')]=[{'all':!![]}];}_0x357fdf=_[_0xdde1('0x3a')]({},_0x357fdf,_0x4e86c5[_0xdde1('0x3e')]);return db['AnalyticFieldReport'][_0xdde1('0x46')](_0x357fdf)['then'](handleEntityNotFound(_0x1956a1,null))[_0xdde1('0x23')](respondWithResult(_0x1956a1,null))[_0xdde1('0x47')](handleError(_0x1956a1,null));};exports['create']=function(_0x4e71e0,_0xd5d5d2){return db[_0xdde1('0x2b')][_0xdde1('0x48')](_0x4e71e0[_0xdde1('0x49')],{})[_0xdde1('0x23')](respondWithResult(_0xd5d5d2,0xc9))[_0xdde1('0x47')](handleError(_0xd5d5d2,null));};exports['bulkCreate']=function(_0x1d6f62,_0x4b69b9){return db[_0xdde1('0x2b')][_0xdde1('0x4a')](_0x1d6f62[_0xdde1('0x49')],{'raw':![],'individualHooks':!![]})[_0xdde1('0x23')](respondWithResult(_0x4b69b9,0xc9))[_0xdde1('0x47')](handleError(_0x4b69b9,null));};exports[_0xdde1('0x4b')]=function(_0x4882f0,_0x16aac9){if(_0x4882f0[_0xdde1('0x49')]['id']){delete _0x4882f0['body']['id'];}return db[_0xdde1('0x2b')][_0xdde1('0x46')]({'where':{'id':_0x4882f0[_0xdde1('0x43')]['id']}})[_0xdde1('0x23')](handleEntityNotFound(_0x16aac9,null))[_0xdde1('0x23')](saveUpdates(_0x4882f0[_0xdde1('0x49')],null))['then'](respondWithResult(_0x16aac9,null))['catch'](handleError(_0x16aac9,null));};exports['destroy']=function(_0x36d432,_0x14d48b){return db[_0xdde1('0x2b')][_0xdde1('0x46')]({'where':{'id':_0x36d432[_0xdde1('0x43')]['id']}})[_0xdde1('0x23')](handleEntityNotFound(_0x14d48b,null))[_0xdde1('0x23')](removeEntity(_0x14d48b,null))['catch'](handleError(_0x14d48b,null));};exports[_0xdde1('0x4c')]=function(_0x2bb471,_0x13fe04){return db['AnalyticFieldReport'][_0xdde1('0x4d')]({'where':{'id':_0x2bb471['query'][_0xdde1('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xdde1('0x23')](respondWithResult(_0x13fe04,0xcc))[_0xdde1('0x47')](handleError(_0x13fe04,null));};exports[_0xdde1('0x4f')]=function(_0x2e53e6,_0x37e515,_0x53721d){return db[_0xdde1('0x50')][_0xdde1('0x51')]({'where':{'id':_0x2e53e6['params']['id']}})['then'](handleEntityNotFound(_0x37e515,null))[_0xdde1('0x23')](function(_0x324870){if(_0x324870){return db[_0xdde1('0x52')]['transaction'](function(_0x4f95c1){return db[_0xdde1('0x2b')][_0xdde1('0x4d')]({'where':{'CustomReportId':_0x2e53e6[_0xdde1('0x43')]['id']},'transaction':_0x4f95c1})[_0xdde1('0x23')](function(_0x206f06){var _0x42edba=_[_0xdde1('0x2a')](_0x2e53e6[_0xdde1('0x49')],function(_0x505119){delete _0x505119['id'];_0x505119[_0xdde1('0x53')]=_0x2e53e6[_0xdde1('0x43')]['id'];return _0x505119;});return db[_0xdde1('0x2b')][_0xdde1('0x4a')](_0x42edba,{'transaction':_0x4f95c1});});})[_0xdde1('0x23')](function(){return db[_0xdde1('0x2b')][_0xdde1('0x41')]({'where':{'CustomReportId':_0x2e53e6[_0xdde1('0x43')]['id']}});});}})[_0xdde1('0x23')](respondWithResult(_0x37e515,null))[_0xdde1('0x47')](handleError(_0x37e515,null));}; \ No newline at end of file +var _0xa495=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','show','params','merge','catch','create','bulkCreate','update','body','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra'];(function(_0x45d5ed,_0x50fce5){var _0x478190=function(_0x434c2b){while(--_0x434c2b){_0x45d5ed['push'](_0x45d5ed['shift']());}};_0x478190(++_0x50fce5);}(_0xa495,0x9b));var _0x5a49=function(_0x3287f4,_0x131a75){_0x3287f4=_0x3287f4-0x0;var _0x4f6d7e=_0xa495[_0x3287f4];return _0x4f6d7e;};'use strict';var emlformat=require(_0x5a49('0x0'));var rimraf=require(_0x5a49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a49('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5a49('0x3'));var Mustache=require(_0x5a49('0x4'));var util=require(_0x5a49('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5a49('0x6'));var ejs=require(_0x5a49('0x7'));var fs=require('fs');var fs_extra=require(_0x5a49('0x8'));var _=require('lodash');var squel=require(_0x5a49('0x9'));var crypto=require(_0x5a49('0xa'));var jsforce=require(_0x5a49('0xb'));var deskjs=require(_0x5a49('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5a49('0xd'));var Papa=require(_0x5a49('0xe'));var Redis=require(_0x5a49('0xf'));var authService=require(_0x5a49('0x10'));var qs=require(_0x5a49('0x11'));var as=require(_0x5a49('0x12'));var hardwareService=require(_0x5a49('0x13'));var logger=require('../../config/logger')(_0x5a49('0x14'));var utils=require('../../config/utils');var config=require(_0x5a49('0x15'));var licenseUtil=require(_0x5a49('0x16'));var db=require(_0x5a49('0x17'))['db'];function respondWithStatusCode(_0x10c388,_0x10b52f){_0x10b52f=_0x10b52f||0xcc;return function(_0x2d5559){if(_0x2d5559){return _0x10c388['sendStatus'](_0x10b52f);}return _0x10c388[_0x5a49('0x18')](_0x10b52f)[_0x5a49('0x19')]();};}function respondWithResult(_0x342050,_0x25464f){_0x25464f=_0x25464f||0xc8;return function(_0x5901dd){if(_0x5901dd){return _0x342050[_0x5a49('0x18')](_0x25464f)['json'](_0x5901dd);}};}function respondWithFilteredResult(_0x35f04c,_0x15ddc8){return function(_0x521333){if(_0x521333){var _0x49b96d=typeof _0x15ddc8['offset']==='undefined'&&typeof _0x15ddc8['limit']===_0x5a49('0x1a');var _0x5280b5=_0x521333[_0x5a49('0x1b')];var _0x53eae1=_0x49b96d?0x0:_0x15ddc8['offset'];var _0x4e813e=_0x49b96d?_0x521333[_0x5a49('0x1b')]:_0x15ddc8[_0x5a49('0x1c')]+_0x15ddc8['limit'];var _0x3b16fa;if(_0x4e813e>=_0x5280b5){_0x4e813e=_0x5280b5;_0x3b16fa=0xc8;}else{_0x3b16fa=0xce;}_0x35f04c[_0x5a49('0x18')](_0x3b16fa);return _0x35f04c[_0x5a49('0x1d')](_0x5a49('0x1e'),_0x53eae1+'-'+_0x4e813e+'/'+_0x5280b5)[_0x5a49('0x1f')](_0x521333);}return null;};}function patchUpdates(_0x6182d2){return function(_0x52aa50){try{jsonpatch[_0x5a49('0x20')](_0x52aa50,_0x6182d2,!![]);}catch(_0x63d6ae){return BPromise[_0x5a49('0x21')](_0x63d6ae);}return _0x52aa50[_0x5a49('0x22')]();};}function saveUpdates(_0x433119,_0x451aac){return function(_0x288ce8){if(_0x288ce8){return _0x288ce8['update'](_0x433119)['then'](function(_0x543928){return _0x543928;});}return null;};}function removeEntity(_0x34dc53,_0x20e8d5){return function(_0x8d052c){if(_0x8d052c){return _0x8d052c['destroy']()[_0x5a49('0x23')](function(){_0x34dc53[_0x5a49('0x18')](0xcc)[_0x5a49('0x19')]();});}};}function handleEntityNotFound(_0x483951,_0x45acaa){return function(_0x32937b){if(!_0x32937b){_0x483951[_0x5a49('0x24')](0x194);}return _0x32937b;};}function handleError(_0x43d5e6,_0x188f10){_0x188f10=_0x188f10||0x1f4;return function(_0x4aef2f){logger[_0x5a49('0x25')](_0x4aef2f['stack']);if(_0x4aef2f[_0x5a49('0x26')]){delete _0x4aef2f[_0x5a49('0x26')];}_0x43d5e6[_0x5a49('0x18')](_0x188f10)[_0x5a49('0x27')](_0x4aef2f);};}exports[_0x5a49('0x28')]=function(_0xb86482,_0x1593d4){var _0x1b2b9d={},_0x4e64fd={},_0x5d5eba={'count':0x0,'rows':[]};var _0x21c73d=_[_0x5a49('0x29')](db[_0x5a49('0x2a')][_0x5a49('0x2b')],function(_0x39a140){return{'name':_0x39a140['fieldName'],'type':_0x39a140[_0x5a49('0x2c')][_0x5a49('0x2d')]};});_0x4e64fd[_0x5a49('0x2e')]=_[_0x5a49('0x29')](_0x21c73d,_0x5a49('0x26'));_0x4e64fd[_0x5a49('0x2f')]=_[_0x5a49('0x30')](_0xb86482[_0x5a49('0x2f')]);_0x4e64fd['filters']=_[_0x5a49('0x31')](_0x4e64fd[_0x5a49('0x2e')],_0x4e64fd[_0x5a49('0x2f')]);_0x1b2b9d[_0x5a49('0x32')]=_[_0x5a49('0x31')](_0x4e64fd['model'],qs[_0x5a49('0x33')](_0xb86482[_0x5a49('0x2f')][_0x5a49('0x33')]));_0x1b2b9d['attributes']=_0x1b2b9d['attributes']['length']?_0x1b2b9d['attributes']:_0x4e64fd[_0x5a49('0x2e')];if(!_0xb86482[_0x5a49('0x2f')]['hasOwnProperty'](_0x5a49('0x34'))){_0x1b2b9d['limit']=qs['limit'](_0xb86482[_0x5a49('0x2f')][_0x5a49('0x35')]);_0x1b2b9d[_0x5a49('0x1c')]=qs[_0x5a49('0x1c')](_0xb86482[_0x5a49('0x2f')]['offset']);}_0x1b2b9d[_0x5a49('0x36')]=qs[_0x5a49('0x37')](_0xb86482[_0x5a49('0x2f')][_0x5a49('0x37')]);_0x1b2b9d[_0x5a49('0x38')]=qs[_0x5a49('0x39')](_[_0x5a49('0x3a')](_0xb86482[_0x5a49('0x2f')],_0x4e64fd[_0x5a49('0x39')]),_0x21c73d);if(_0xb86482[_0x5a49('0x2f')]['filter']){_0x1b2b9d[_0x5a49('0x38')]=_['merge'](_0x1b2b9d[_0x5a49('0x38')],{'$or':_[_0x5a49('0x29')](_0x21c73d,function(_0x32f4eb){if(_0x32f4eb['type']!==_0x5a49('0x3b')){var _0x47c4f8={};_0x47c4f8[_0x32f4eb[_0x5a49('0x26')]]={'$like':'%'+_0xb86482[_0x5a49('0x2f')][_0x5a49('0x3c')]+'%'};return _0x47c4f8;}})});}_0x1b2b9d=_['merge']({},_0x1b2b9d,_0xb86482[_0x5a49('0x3d')]);var _0x199b30={'where':_0x1b2b9d['where']};return db[_0x5a49('0x2a')][_0x5a49('0x1b')](_0x199b30)[_0x5a49('0x23')](function(_0x3f9d9f){_0x5d5eba[_0x5a49('0x1b')]=_0x3f9d9f;if(_0xb86482[_0x5a49('0x2f')][_0x5a49('0x3e')]){_0x1b2b9d[_0x5a49('0x3f')]=[{'all':!![]}];}return db[_0x5a49('0x2a')]['findAll'](_0x1b2b9d);})[_0x5a49('0x23')](function(_0x360273){_0x5d5eba['rows']=_0x360273;return _0x5d5eba;})[_0x5a49('0x23')](respondWithFilteredResult(_0x1593d4,_0x1b2b9d))['catch'](handleError(_0x1593d4,null));};exports[_0x5a49('0x40')]=function(_0x11336e,_0x4e5706){var _0x4023aa={'raw':![],'where':{'id':_0x11336e[_0x5a49('0x41')]['id']}},_0x26bb5d={};_0x26bb5d[_0x5a49('0x2e')]=_[_0x5a49('0x30')](db[_0x5a49('0x2a')][_0x5a49('0x2b')]);_0x26bb5d['query']=_[_0x5a49('0x30')](_0x11336e[_0x5a49('0x2f')]);_0x26bb5d['filters']=_[_0x5a49('0x31')](_0x26bb5d[_0x5a49('0x2e')],_0x26bb5d['query']);_0x4023aa[_0x5a49('0x32')]=_['intersection'](_0x26bb5d['model'],qs[_0x5a49('0x33')](_0x11336e['query']['fields']));_0x4023aa[_0x5a49('0x32')]=_0x4023aa[_0x5a49('0x32')]['length']?_0x4023aa['attributes']:_0x26bb5d[_0x5a49('0x2e')];if(_0x11336e[_0x5a49('0x2f')]['includeAll']){_0x4023aa['include']=[{'all':!![]}];}_0x4023aa=_[_0x5a49('0x42')]({},_0x4023aa,_0x11336e[_0x5a49('0x3d')]);return db[_0x5a49('0x2a')]['find'](_0x4023aa)[_0x5a49('0x23')](handleEntityNotFound(_0x4e5706,null))[_0x5a49('0x23')](respondWithResult(_0x4e5706,null))[_0x5a49('0x43')](handleError(_0x4e5706,null));};exports[_0x5a49('0x44')]=function(_0x53bad5,_0x379bea){return db[_0x5a49('0x2a')][_0x5a49('0x44')](_0x53bad5['body'],{})[_0x5a49('0x23')](respondWithResult(_0x379bea,0xc9))['catch'](handleError(_0x379bea,null));};exports[_0x5a49('0x45')]=function(_0x2d2841,_0x3e0db2){return db[_0x5a49('0x2a')][_0x5a49('0x45')](_0x2d2841['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3e0db2,0xc9))[_0x5a49('0x43')](handleError(_0x3e0db2,null));};exports[_0x5a49('0x46')]=function(_0x752dcd,_0xbb75ff){if(_0x752dcd[_0x5a49('0x47')]['id']){delete _0x752dcd['body']['id'];}return db[_0x5a49('0x2a')]['find']({'where':{'id':_0x752dcd[_0x5a49('0x41')]['id']}})[_0x5a49('0x23')](handleEntityNotFound(_0xbb75ff,null))[_0x5a49('0x23')](saveUpdates(_0x752dcd['body'],null))['then'](respondWithResult(_0xbb75ff,null))[_0x5a49('0x43')](handleError(_0xbb75ff,null));};exports['destroy']=function(_0x549172,_0x5abb23){return db[_0x5a49('0x2a')][_0x5a49('0x48')]({'where':{'id':_0x549172[_0x5a49('0x41')]['id']}})[_0x5a49('0x23')](handleEntityNotFound(_0x5abb23,null))[_0x5a49('0x23')](removeEntity(_0x5abb23,null))[_0x5a49('0x43')](handleError(_0x5abb23,null));};exports[_0x5a49('0x49')]=function(_0x35b1ea,_0x2008e5){return db['AnalyticFieldReport'][_0x5a49('0x4a')]({'where':{'id':_0x35b1ea['query'][_0x5a49('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2008e5,0xcc))['catch'](handleError(_0x2008e5,null));};exports[_0x5a49('0x4c')]=function(_0x28b755,_0x40bedc,_0x1a48c8){return db[_0x5a49('0x4d')][_0x5a49('0x4e')]({'where':{'id':_0x28b755[_0x5a49('0x41')]['id']}})[_0x5a49('0x23')](handleEntityNotFound(_0x40bedc,null))['then'](function(_0x4c064e){if(_0x4c064e){return db[_0x5a49('0x4f')]['transaction'](function(_0x1518d4){return db[_0x5a49('0x2a')]['destroy']({'where':{'CustomReportId':_0x28b755['params']['id']},'transaction':_0x1518d4})[_0x5a49('0x23')](function(_0x27631f){var _0x293788=_[_0x5a49('0x29')](_0x28b755['body'],function(_0x14fae3){delete _0x14fae3['id'];_0x14fae3[_0x5a49('0x50')]=_0x28b755['params']['id'];return _0x14fae3;});return db[_0x5a49('0x2a')][_0x5a49('0x45')](_0x293788,{'transaction':_0x1518d4});});})['then'](function(){return db[_0x5a49('0x2a')][_0x5a49('0x51')]({'where':{'CustomReportId':_0x28b755['params']['id']}});});}})[_0x5a49('0x23')](respondWithResult(_0x40bedc,null))[_0x5a49('0x43')](handleError(_0x40bedc,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 1a3ae07..48b5406 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 _0xadfe=['analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x26f336,_0x1780a8){var _0x45eaf6=function(_0x286fce){while(--_0x286fce){_0x26f336['push'](_0x26f336['shift']());}};_0x45eaf6(++_0x1780a8);}(_0xadfe,0x15d));var _0xeadf=function(_0x509f0f,_0x58a2c0){_0x509f0f=_0x509f0f-0x0;var _0x415bb5=_0xadfe[_0x509f0f];return _0x415bb5;};'use strict';var _=require(_0xeadf('0x0'));var util=require(_0xeadf('0x1'));var logger=require(_0xeadf('0x2'))(_0xeadf('0x3'));var moment=require(_0xeadf('0x4'));var BPromise=require('bluebird');var rp=require(_0xeadf('0x5'));var fs=require('fs');var path=require(_0xeadf('0x6'));var rimraf=require(_0xeadf('0x7'));var config=require(_0xeadf('0x8'));var attributes=require(_0xeadf('0x9'));module[_0xeadf('0xa')]=function(_0x1f72f2,_0xc11ee9){return _0x1f72f2['define']('AnalyticFieldReport',attributes,{'tableName':_0xeadf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x484a=['exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x541020,_0x51cebc){var _0x4e5139=function(_0x408478){while(--_0x408478){_0x541020['push'](_0x541020['shift']());}};_0x4e5139(++_0x51cebc);}(_0x484a,0xff));var _0xa484=function(_0x17da83,_0xd034f8){_0x17da83=_0x17da83-0x0;var _0x9fee70=_0x484a[_0x17da83];return _0x9fee70;};'use strict';var _=require(_0xa484('0x0'));var util=require(_0xa484('0x1'));var logger=require(_0xa484('0x2'))('api');var moment=require(_0xa484('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa484('0x4'));var rimraf=require(_0xa484('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0xa484('0x6')]=function(_0x5e85e,_0x3e33e9){return _0x5e85e[_0xa484('0x7')](_0xa484('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index f1df227..0c791e4 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 _0x74bb=['stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4fcc27,_0x7eed0b){var _0x26913e=function(_0x15696c){while(--_0x15696c){_0x4fcc27['push'](_0x4fcc27['shift']());}};_0x26913e(++_0x7eed0b);}(_0x74bb,0x69));var _0xb74b=function(_0x48a552,_0x126263){_0x48a552=_0x48a552-0x0;var _0x277289=_0x74bb[_0x48a552];return _0x277289;};'use strict';var _=require(_0xb74b('0x0'));var util=require('util');var moment=require(_0xb74b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb74b('0x2'));var fs=require('fs');var Redis=require(_0xb74b('0x3'));var db=require(_0xb74b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb74b('0x5'))(_0xb74b('0x6'));var config=require(_0xb74b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb74b('0x8')][_0xb74b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x168d4e,_0x51a5d4,_0x4a3482){return new BPromise(function(_0x30a2ba,_0x33aa57){return client[_0xb74b('0xa')](_0x168d4e,_0x4a3482)[_0xb74b('0xb')](function(_0x5580bc){logger[_0xb74b('0xc')](_0xb74b('0xd'),_0x51a5d4,_0xb74b('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x51a5d4,_0xb74b('0xe'),JSON[_0xb74b('0xf')](_0x5580bc));if(_0x5580bc[_0xb74b('0x10')]){if(_0x5580bc[_0xb74b('0x10')][_0xb74b('0x11')]===0x1f4){logger[_0xb74b('0x10')](_0xb74b('0xd'),_0x51a5d4,_0x5580bc['error'][_0xb74b('0x12')]);return _0x33aa57(_0x5580bc[_0xb74b('0x10')][_0xb74b('0x12')]);}logger[_0xb74b('0x10')](_0xb74b('0xd'),_0x51a5d4,_0x5580bc['error']['message']);return _0x30a2ba(_0x5580bc['error'][_0xb74b('0x12')]);}else{logger[_0xb74b('0xc')](_0xb74b('0xd'),_0x51a5d4,_0xb74b('0xe'));_0x30a2ba(_0x5580bc[_0xb74b('0x13')][_0xb74b('0x12')]);}})['catch'](function(_0x46c20){logger[_0xb74b('0x10')](_0xb74b('0xd'),_0x51a5d4,_0x46c20);_0x33aa57(_0x46c20);});});} \ No newline at end of file +var _0xbfe9=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xbfe9,0x9b));var _0x9bfe=function(_0x136900,_0x51698c){_0x136900=_0x136900-0x0;var _0x176a63=_0xbfe9[_0x136900];return _0x176a63;};'use strict';var _=require(_0x9bfe('0x0'));var util=require(_0x9bfe('0x1'));var moment=require(_0x9bfe('0x2'));var BPromise=require(_0x9bfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bfe('0x4'));var db=require(_0x9bfe('0x5'))['db'];var utils=require(_0x9bfe('0x6'));var logger=require(_0x9bfe('0x7'))(_0x9bfe('0x8'));var config=require('../../config/environment');var jayson=require(_0x9bfe('0x9'));var client=jayson[_0x9bfe('0xa')][_0x9bfe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41eef1,_0x37a393,_0x24e221){return new BPromise(function(_0x182a5b,_0x286937){return client['request'](_0x41eef1,_0x24e221)['then'](function(_0x2521f8){logger[_0x9bfe('0xc')](_0x9bfe('0xd'),_0x37a393,_0x9bfe('0xe'));logger[_0x9bfe('0xf')](_0x9bfe('0x10'),_0x37a393,_0x9bfe('0xe'),JSON[_0x9bfe('0x11')](_0x2521f8));if(_0x2521f8[_0x9bfe('0x12')]){if(_0x2521f8[_0x9bfe('0x12')][_0x9bfe('0x13')]===0x1f4){logger['error'](_0x9bfe('0xd'),_0x37a393,_0x2521f8['error'][_0x9bfe('0x14')]);return _0x286937(_0x2521f8[_0x9bfe('0x12')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x37a393,_0x2521f8[_0x9bfe('0x12')][_0x9bfe('0x14')]);return _0x182a5b(_0x2521f8['error'][_0x9bfe('0x14')]);}else{logger['info'](_0x9bfe('0xd'),_0x37a393,_0x9bfe('0xe'));_0x182a5b(_0x2521f8[_0x9bfe('0x15')][_0x9bfe('0x14')]);}})[_0x9bfe('0x16')](function(_0xd2101e){logger[_0x9bfe('0x12')](_0x9bfe('0xd'),_0x37a393,_0xd2101e);_0x286937(_0xd2101e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 2d54438..730f66f 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(_0x58fae3,_0xe6892b){var _0x50089c=function(_0x2f10fe){while(--_0x2f10fe){_0x58fae3['push'](_0x58fae3['shift']());}};_0x50089c(++_0xe6892b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x3ced8f,_0x151605){var _0x353b51=function(_0x3361c0){while(--_0x3361c0){_0x3ced8f['push'](_0x3ced8f['shift']());}};_0x353b51(++_0x151605);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 f547a21..19fa123 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 _0xd8b0=['STRING','sequelize','exports','TEXT'];(function(_0xb2e98d,_0x31daa1){var _0x56a0eb=function(_0x102910){while(--_0x102910){_0xb2e98d['push'](_0xb2e98d['shift']());}};_0x56a0eb(++_0x31daa1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0d8b('0x2')]},'description':{'type':Sequelize[_0x0d8b('0x3')]}}; \ No newline at end of file +var _0xe890=['name','TEXT','STRING'];(function(_0x3d829e,_0x4d8bb5){var _0x38569e=function(_0x552b63){while(--_0x552b63){_0x3d829e['push'](_0x3d829e['shift']());}};_0x38569e(++_0x4d8bb5);}(_0xe890,0x1a6));var _0x0e89=function(_0xe3ec77,_0xa08e14){_0xe3ec77=_0xe3ec77-0x0;var _0x1d09fc=_0xe890[_0xe3ec77];return _0x1d09fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0e89('0x0')],'allowNull':![],'unique':_0x0e89('0x1')},'table':{'type':Sequelize[_0x0e89('0x0')]},'metric':{'type':Sequelize[_0x0e89('0x2')]},'description':{'type':Sequelize[_0x0e89('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b01060e..402a4d2 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 _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(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 +var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','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','params','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'];(function(_0xcaa73f,_0x1e7aa5){var _0x1014af=function(_0x400b60){while(--_0x400b60){_0xcaa73f['push'](_0xcaa73f['shift']());}};_0x1014af(++_0x1e7aa5);}(_0x55ca,0x126));var _0xa55c=function(_0x597834,_0x159bb6){_0x597834=_0x597834-0x0;var _0x12da6c=_0x55ca[_0x597834];return _0x12da6c;};'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(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 40bd54d..2042bde 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 _0x2eb2=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x5685fa,_0x217e28){var _0x5b10ef=function(_0x2ea0e6){while(--_0x2ea0e6){_0x5685fa['push'](_0x5685fa['shift']());}};_0x5b10ef(++_0x217e28);}(_0x2eb2,0x19f));var _0x22eb=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2eb2[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b5a=['exports','define','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x531722,_0x161aa9){_0x531722=_0x531722-0x0;var _0x3f1769=_0x5b5a[_0x531722];return _0x3f1769;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var logger=require(_0xa5b5('0x1'))('api');var moment=require(_0xa5b5('0x2'));var BPromise=require(_0xa5b5('0x3'));var rp=require(_0xa5b5('0x4'));var fs=require('fs');var path=require(_0xa5b5('0x5'));var rimraf=require(_0xa5b5('0x6'));var config=require(_0xa5b5('0x7'));var attributes=require(_0xa5b5('0x8'));module[_0xa5b5('0x9')]=function(_0x509b78,_0x33678e){return _0x509b78[_0xa5b5('0xa')]('AnalyticMetric',attributes,{'tableName':_0xa5b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 10333e1..cf570ae 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 _0xce9e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36630d,_0xa6c486){var _0xd59a11=function(_0x1c15a0){while(--_0x1c15a0){_0x36630d['push'](_0x36630d['shift']());}};_0xd59a11(++_0xa6c486);}(_0xce9e,0xf3));var _0xece9=function(_0xf9bcaf,_0x3c9230){_0xf9bcaf=_0xf9bcaf-0x0;var _0x1dff25=_0xce9e[_0xf9bcaf];return _0x1dff25;};'use strict';var _=require(_0xece9('0x0'));var util=require(_0xece9('0x1'));var moment=require(_0xece9('0x2'));var BPromise=require(_0xece9('0x3'));var rs=require(_0xece9('0x4'));var fs=require('fs');var Redis=require(_0xece9('0x5'));var db=require(_0xece9('0x6'))['db'];var utils=require(_0xece9('0x7'));var logger=require(_0xece9('0x8'))('rpc');var config=require(_0xece9('0x9'));var jayson=require(_0xece9('0xa'));var client=jayson[_0xece9('0xb')][_0xece9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a9ea6,_0xe14828,_0x4ff7b8){return new BPromise(function(_0xe8437e,_0x533606){return client[_0xece9('0xd')](_0x1a9ea6,_0x4ff7b8)[_0xece9('0xe')](function(_0x19eaa3){logger['info'](_0xece9('0xf'),_0xe14828,_0xece9('0x10'));logger[_0xece9('0x11')](_0xece9('0x12'),_0xe14828,_0xece9('0x10'),JSON['stringify'](_0x19eaa3));if(_0x19eaa3[_0xece9('0x13')]){if(_0x19eaa3[_0xece9('0x13')][_0xece9('0x14')]===0x1f4){logger[_0xece9('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xe14828,_0x19eaa3[_0xece9('0x13')]['message']);return _0x533606(_0x19eaa3[_0xece9('0x13')][_0xece9('0x15')]);}logger[_0xece9('0x13')](_0xece9('0xf'),_0xe14828,_0x19eaa3['error']['message']);return _0xe8437e(_0x19eaa3['error'][_0xece9('0x15')]);}else{logger[_0xece9('0x16')](_0xece9('0xf'),_0xe14828,_0xece9('0x10'));_0xe8437e(_0x19eaa3[_0xece9('0x17')][_0xece9('0x15')]);}})[_0xece9('0x18')](function(_0x2f06d3){logger[_0xece9('0x13')](_0xece9('0xf'),_0xe14828,_0x2f06d3);_0x533606(_0x2f06d3);});});} \ No newline at end of file +var _0x060b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','lodash'];(function(_0xe422da,_0x28381e){var _0x16fedd=function(_0x5a9a7d){while(--_0x5a9a7d){_0xe422da['push'](_0xe422da['shift']());}};_0x16fedd(++_0x28381e);}(_0x060b,0x103));var _0xb060=function(_0x38098d,_0x46a0b1){_0x38098d=_0x38098d-0x0;var _0x4b27b4=_0x060b[_0x38098d];return _0x4b27b4;};'use strict';var _=require(_0xb060('0x0'));var util=require(_0xb060('0x1'));var moment=require(_0xb060('0x2'));var BPromise=require('bluebird');var rs=require(_0xb060('0x3'));var fs=require('fs');var Redis=require(_0xb060('0x4'));var db=require(_0xb060('0x5'))['db'];var utils=require(_0xb060('0x6'));var logger=require(_0xb060('0x7'))('rpc');var config=require(_0xb060('0x8'));var jayson=require(_0xb060('0x9'));var client=jayson[_0xb060('0xa')][_0xb060('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4500b6,_0x40b929,_0x5a8af4){return new BPromise(function(_0x2960b4,_0x49547f){return client[_0xb060('0xc')](_0x4500b6,_0x5a8af4)[_0xb060('0xd')](function(_0x2a1191){logger[_0xb060('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x40b929,_0xb060('0xf'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x40b929,_0xb060('0xf'),JSON[_0xb060('0x10')](_0x2a1191));if(_0x2a1191['error']){if(_0x2a1191[_0xb060('0x11')]['code']===0x1f4){logger['error'](_0xb060('0x12'),_0x40b929,_0x2a1191['error'][_0xb060('0x13')]);return _0x49547f(_0x2a1191[_0xb060('0x11')][_0xb060('0x13')]);}logger[_0xb060('0x11')](_0xb060('0x12'),_0x40b929,_0x2a1191[_0xb060('0x11')][_0xb060('0x13')]);return _0x2960b4(_0x2a1191[_0xb060('0x11')][_0xb060('0x13')]);}else{logger[_0xb060('0xe')](_0xb060('0x12'),_0x40b929,_0xb060('0xf'));_0x2960b4(_0x2a1191['result'][_0xb060('0x13')]);}})['catch'](function(_0x40dcb0){logger[_0xb060('0x11')](_0xb060('0x12'),_0x40b929,_0x40dcb0);_0x49547f(_0x40dcb0);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a22fe01..b37846b 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 _0xf95f=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','get','/:id','show'];(function(_0x18febb,_0x5827cd){var _0x34c503=function(_0x30c7cd){while(--_0x30c7cd){_0x18febb['push'](_0x18febb['shift']());}};_0x34c503(++_0x5827cd);}(_0xf95f,0x142));var _0xff95=function(_0x599d7f,_0xc586e8){_0x599d7f=_0x599d7f-0x0;var _0x3346d3=_0xf95f[_0x599d7f];return _0x3346d3;};'use strict';var multer=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var path=require(_0xff95('0x2'));var timeout=require(_0xff95('0x3'));var express=require(_0xff95('0x4'));var router=express[_0xff95('0x5')]();var fs_extra=require(_0xff95('0x6'));var auth=require(_0xff95('0x7'));var interaction=require(_0xff95('0x8'));var config=require('../../config/environment');var controller=require(_0xff95('0x9'));router['get']('/',auth[_0xff95('0xa')](),controller['index']);router[_0xff95('0xb')](_0xff95('0xc'),auth[_0xff95('0xa')](),controller[_0xff95('0xd')]);router[_0xff95('0xe')]('/',auth[_0xff95('0xa')](),controller[_0xff95('0xf')]);router[_0xff95('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xff95('0x11')]);router[_0xff95('0x12')](_0xff95('0xc'),auth[_0xff95('0xa')](),controller[_0xff95('0x13')]);module[_0xff95('0x14')]=router; \ No newline at end of file +var _0x1134=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x454069,_0x5717a0){var _0x3da16b=function(_0x22a6f1){while(--_0x22a6f1){_0x454069['push'](_0x454069['shift']());}};_0x3da16b(++_0x5717a0);}(_0x1134,0x19c));var _0x4113=function(_0x146d66,_0x12af6f){_0x146d66=_0x146d66-0x0;var _0xeeb86=_0x1134[_0x146d66];return _0xeeb86;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var fs_extra=require(_0x4113('0x4'));var auth=require(_0x4113('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4113('0x6'));var controller=require('./analyticMetric.controller');router[_0x4113('0x7')]('/',auth['isAuthenticated'](),controller[_0x4113('0x8')]);router['get'](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0xb')]);router[_0x4113('0xc')]('/',auth[_0x4113('0xa')](),controller[_0x4113('0xd')]);router[_0x4113('0xe')](_0x4113('0x9'),auth['isAuthenticated'](),controller[_0x4113('0xf')]);router[_0x4113('0x10')](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0x11')]);module[_0x4113('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 05d9a11..7dcff8e 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 _0x8400=['exports','TEXT','sequelize'];(function(_0x2fa06e,_0x228d80){var _0x2df3f2=function(_0xee7f60){while(--_0xee7f60){_0x2fa06e['push'](_0x2fa06e['shift']());}};_0x2df3f2(++_0x228d80);}(_0x8400,0x12e));var _0x0840=function(_0x55b70a,_0x54a144){_0x55b70a=_0x55b70a-0x0;var _0x50fbc6=_0x8400[_0x55b70a];return _0x50fbc6;};'use strict';var Sequelize=require(_0x0840('0x0'));module[_0x0840('0x1')]={'tree':{'type':Sequelize[_0x0840('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf5b0=['sequelize','exports','TEXT'];(function(_0x1fd5eb,_0x235203){var _0x102365=function(_0x54de1f){while(--_0x54de1f){_0x1fd5eb['push'](_0x1fd5eb['shift']());}};_0x102365(++_0x235203);}(_0xf5b0,0x10e));var _0x0f5b=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xf5b0[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0x0f5b('0x0'));module[_0x0f5b('0x1')]={'tree':{'type':Sequelize[_0x0f5b('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 5ac1a94..2563b91 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 _0xed19=['eml-format','rimraf','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','length','find','body','destroy'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0xed19,0x84));var _0x9ed1=function(_0x2be6d9,_0xd31df5){_0x2be6d9=_0x2be6d9-0x0;var _0x45e38b=_0xed19[_0x2be6d9];return _0x45e38b;};'use strict';var emlformat=require(_0x9ed1('0x0'));var rimraf=require(_0x9ed1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9ed1('0x2'));var path=require('path');var sox=require(_0x9ed1('0x3'));var csv=require(_0x9ed1('0x4'));var ejs=require(_0x9ed1('0x5'));var fs=require('fs');var fs_extra=require(_0x9ed1('0x6'));var _=require(_0x9ed1('0x7'));var squel=require('squel');var crypto=require(_0x9ed1('0x8'));var jsforce=require(_0x9ed1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x9ed1('0x4'));var querystring=require(_0x9ed1('0xa'));var Papa=require('papaparse');var Redis=require(_0x9ed1('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9ed1('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ed1('0xd'));var logger=require('../../config/logger')(_0x9ed1('0xe'));var utils=require(_0x9ed1('0xf'));var config=require(_0x9ed1('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9744c7,_0x17a849){_0x17a849=_0x17a849||0xcc;return function(_0x224fc5){if(_0x224fc5){return _0x9744c7['sendStatus'](_0x17a849);}return _0x9744c7[_0x9ed1('0x11')](_0x17a849)['end']();};}function respondWithResult(_0x31051b,_0xd48a73){_0xd48a73=_0xd48a73||0xc8;return function(_0x3433b8){if(_0x3433b8){return _0x31051b[_0x9ed1('0x11')](_0xd48a73)[_0x9ed1('0x12')](_0x3433b8);}};}function respondWithFilteredResult(_0x3d92f1,_0x5d5231){return function(_0x4325d0){if(_0x4325d0){var _0x5da3f4=typeof _0x5d5231['offset']===_0x9ed1('0x13')&&typeof _0x5d5231[_0x9ed1('0x14')]===_0x9ed1('0x13');var _0x314557=_0x4325d0[_0x9ed1('0x15')];var _0x5358ca=_0x5da3f4?0x0:_0x5d5231[_0x9ed1('0x16')];var _0x340fb3=_0x5da3f4?_0x4325d0['count']:_0x5d5231['offset']+_0x5d5231['limit'];var _0x8d6a24;if(_0x340fb3>=_0x314557){_0x340fb3=_0x314557;_0x8d6a24=0xc8;}else{_0x8d6a24=0xce;}_0x3d92f1[_0x9ed1('0x11')](_0x8d6a24);return _0x3d92f1[_0x9ed1('0x17')](_0x9ed1('0x18'),_0x5358ca+'-'+_0x340fb3+'/'+_0x314557)['json'](_0x4325d0);}return null;};}function patchUpdates(_0x1b8e45){return function(_0x565382){try{jsonpatch[_0x9ed1('0x19')](_0x565382,_0x1b8e45,!![]);}catch(_0x464557){return BPromise[_0x9ed1('0x1a')](_0x464557);}return _0x565382[_0x9ed1('0x1b')]();};}function saveUpdates(_0x590249,_0xb4ea40){return function(_0x4b1e7c){if(_0x4b1e7c){return _0x4b1e7c[_0x9ed1('0x1c')](_0x590249)[_0x9ed1('0x1d')](function(_0x4455b9){return _0x4455b9;});}return null;};}function removeEntity(_0x3585a5,_0x3e359c){return function(_0x14cd10){if(_0x14cd10){return _0x14cd10['destroy']()[_0x9ed1('0x1d')](function(){_0x3585a5[_0x9ed1('0x11')](0xcc)[_0x9ed1('0x1e')]();});}};}function handleEntityNotFound(_0x5542cb,_0x12b175){return function(_0x1f25c6){if(!_0x1f25c6){_0x5542cb['sendStatus'](0x194);}return _0x1f25c6;};}function handleError(_0x1b588d,_0x19ad56){_0x19ad56=_0x19ad56||0x1f4;return function(_0x41465c){logger[_0x9ed1('0x1f')](_0x41465c[_0x9ed1('0x20')]);if(_0x41465c[_0x9ed1('0x21')]){delete _0x41465c[_0x9ed1('0x21')];}_0x1b588d[_0x9ed1('0x11')](_0x19ad56)['send'](_0x41465c);};}exports[_0x9ed1('0x22')]=function(_0x34f2d0,_0x3ffea5){var _0x52f8f1={},_0x53c94f={},_0x4a1403={'count':0x0,'rows':[]};var _0x59c7ee=_[_0x9ed1('0x23')](db[_0x9ed1('0x24')][_0x9ed1('0x25')],function(_0x33813b){return{'name':_0x33813b[_0x9ed1('0x26')],'type':_0x33813b[_0x9ed1('0x27')][_0x9ed1('0x28')]};});_0x53c94f['model']=_[_0x9ed1('0x23')](_0x59c7ee,_0x9ed1('0x21'));_0x53c94f[_0x9ed1('0x29')]=_[_0x9ed1('0x2a')](_0x34f2d0[_0x9ed1('0x29')]);_0x53c94f[_0x9ed1('0x2b')]=_[_0x9ed1('0x2c')](_0x53c94f['model'],_0x53c94f[_0x9ed1('0x29')]);_0x52f8f1[_0x9ed1('0x2d')]=_['intersection'](_0x53c94f['model'],qs[_0x9ed1('0x2e')](_0x34f2d0[_0x9ed1('0x29')][_0x9ed1('0x2e')]));_0x52f8f1[_0x9ed1('0x2d')]=_0x52f8f1[_0x9ed1('0x2d')]['length']?_0x52f8f1[_0x9ed1('0x2d')]:_0x53c94f[_0x9ed1('0x2f')];if(!_0x34f2d0['query']['hasOwnProperty'](_0x9ed1('0x30'))){_0x52f8f1[_0x9ed1('0x14')]=qs[_0x9ed1('0x14')](_0x34f2d0[_0x9ed1('0x29')]['limit']);_0x52f8f1['offset']=qs[_0x9ed1('0x16')](_0x34f2d0[_0x9ed1('0x29')][_0x9ed1('0x16')]);}_0x52f8f1[_0x9ed1('0x31')]=qs['sort'](_0x34f2d0[_0x9ed1('0x29')][_0x9ed1('0x32')]);_0x52f8f1[_0x9ed1('0x33')]=qs[_0x9ed1('0x2b')](_[_0x9ed1('0x34')](_0x34f2d0['query'],_0x53c94f[_0x9ed1('0x2b')]),_0x59c7ee);if(_0x34f2d0[_0x9ed1('0x29')][_0x9ed1('0x35')]){_0x52f8f1[_0x9ed1('0x33')]=_['merge'](_0x52f8f1['where'],{'$or':_[_0x9ed1('0x23')](_0x59c7ee,function(_0x5afc8f){if(_0x5afc8f['type']!==_0x9ed1('0x36')){var _0x42d56c={};_0x42d56c[_0x5afc8f[_0x9ed1('0x21')]]={'$like':'%'+_0x34f2d0[_0x9ed1('0x29')][_0x9ed1('0x35')]+'%'};return _0x42d56c;}})});}_0x52f8f1=_[_0x9ed1('0x37')]({},_0x52f8f1,_0x34f2d0[_0x9ed1('0x38')]);var _0x3658d5={'where':_0x52f8f1['where']};return db[_0x9ed1('0x24')][_0x9ed1('0x15')](_0x3658d5)['then'](function(_0x388b91){_0x4a1403[_0x9ed1('0x15')]=_0x388b91;if(_0x34f2d0[_0x9ed1('0x29')][_0x9ed1('0x39')]){_0x52f8f1[_0x9ed1('0x3a')]=[{'all':!![]}];}return db[_0x9ed1('0x24')]['findAll'](_0x52f8f1);})[_0x9ed1('0x1d')](function(_0x2d8747){_0x4a1403['rows']=_0x2d8747;return _0x4a1403;})[_0x9ed1('0x1d')](respondWithFilteredResult(_0x3ffea5,_0x52f8f1))[_0x9ed1('0x3b')](handleError(_0x3ffea5,null));};exports[_0x9ed1('0x3c')]=function(_0x3d1a48,_0x2153a3){var _0x495cd7={'raw':!![],'where':{'id':_0x3d1a48[_0x9ed1('0x3d')]['id']}},_0x1cda29={};_0x1cda29[_0x9ed1('0x2f')]=_['keys'](db[_0x9ed1('0x24')]['rawAttributes']);_0x1cda29[_0x9ed1('0x29')]=_[_0x9ed1('0x2a')](_0x3d1a48['query']);_0x1cda29[_0x9ed1('0x2b')]=_[_0x9ed1('0x2c')](_0x1cda29['model'],_0x1cda29[_0x9ed1('0x29')]);_0x495cd7[_0x9ed1('0x2d')]=_[_0x9ed1('0x2c')](_0x1cda29['model'],qs[_0x9ed1('0x2e')](_0x3d1a48[_0x9ed1('0x29')]['fields']));_0x495cd7[_0x9ed1('0x2d')]=_0x495cd7[_0x9ed1('0x2d')][_0x9ed1('0x3e')]?_0x495cd7['attributes']:_0x1cda29[_0x9ed1('0x2f')];if(_0x3d1a48['query'][_0x9ed1('0x39')]){_0x495cd7['include']=[{'all':!![]}];}_0x495cd7=_[_0x9ed1('0x37')]({},_0x495cd7,_0x3d1a48['options']);return db['AnalyticTreeReport'][_0x9ed1('0x3f')](_0x495cd7)['then'](handleEntityNotFound(_0x2153a3,null))['then'](respondWithResult(_0x2153a3,null))[_0x9ed1('0x3b')](handleError(_0x2153a3,null));};exports['create']=function(_0x46bb70,_0x2c95a3){return db['AnalyticTreeReport']['create'](_0x46bb70[_0x9ed1('0x40')],{})[_0x9ed1('0x1d')](respondWithResult(_0x2c95a3,0xc9))[_0x9ed1('0x3b')](handleError(_0x2c95a3,null));};exports[_0x9ed1('0x1c')]=function(_0x122dd0,_0x1917a1){if(_0x122dd0[_0x9ed1('0x40')]['id']){delete _0x122dd0[_0x9ed1('0x40')]['id'];}return db['AnalyticTreeReport'][_0x9ed1('0x3f')]({'where':{'id':_0x122dd0[_0x9ed1('0x3d')]['id']}})[_0x9ed1('0x1d')](handleEntityNotFound(_0x1917a1,null))[_0x9ed1('0x1d')](saveUpdates(_0x122dd0[_0x9ed1('0x40')],null))['then'](respondWithResult(_0x1917a1,null))[_0x9ed1('0x3b')](handleError(_0x1917a1,null));};exports[_0x9ed1('0x41')]=function(_0x2de40d,_0x44be2b){return db[_0x9ed1('0x24')][_0x9ed1('0x3f')]({'where':{'id':_0x2de40d[_0x9ed1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x44be2b,null))[_0x9ed1('0x1d')](removeEntity(_0x44be2b,null))[_0x9ed1('0x3b')](handleError(_0x44be2b,null));}; \ No newline at end of file +var _0xbf70=['undefined','limit','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','name','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','end','status','json','offset'];(function(_0x317ed5,_0x5d6ae7){var _0x115f5f=function(_0x3873ac){while(--_0x3873ac){_0x317ed5['push'](_0x317ed5['shift']());}};_0x115f5f(++_0x5d6ae7);}(_0xbf70,0x1c9));var _0x0bf7=function(_0x233629,_0x9527d1){_0x233629=_0x233629-0x0;var _0x469bcc=_0xbf70[_0x233629];return _0x469bcc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bf7('0x0'));var zipdir=require(_0x0bf7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bf7('0x2'));var moment=require(_0x0bf7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bf7('0x4'));var util=require(_0x0bf7('0x5'));var path=require(_0x0bf7('0x6'));var sox=require(_0x0bf7('0x7'));var csv=require(_0x0bf7('0x8'));var ejs=require(_0x0bf7('0x9'));var fs=require('fs');var fs_extra=require(_0x0bf7('0xa'));var _=require(_0x0bf7('0xb'));var squel=require('squel');var crypto=require(_0x0bf7('0xc'));var jsforce=require(_0x0bf7('0xd'));var deskjs=require(_0x0bf7('0xe'));var toCsv=require(_0x0bf7('0x8'));var querystring=require(_0x0bf7('0xf'));var Papa=require(_0x0bf7('0x10'));var Redis=require(_0x0bf7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0bf7('0x12'));var as=require(_0x0bf7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0bf7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0bf7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x336a43,_0x11926c){_0x11926c=_0x11926c||0xcc;return function(_0x8845d8){if(_0x8845d8){return _0x336a43['sendStatus'](_0x11926c);}return _0x336a43['status'](_0x11926c)[_0x0bf7('0x16')]();};}function respondWithResult(_0x4333cf,_0x42de57){_0x42de57=_0x42de57||0xc8;return function(_0x1fd080){if(_0x1fd080){return _0x4333cf[_0x0bf7('0x17')](_0x42de57)[_0x0bf7('0x18')](_0x1fd080);}};}function respondWithFilteredResult(_0x7df983,_0x458ba3){return function(_0x1c69e4){if(_0x1c69e4){var _0x25c774=typeof _0x458ba3[_0x0bf7('0x19')]===_0x0bf7('0x1a')&&typeof _0x458ba3[_0x0bf7('0x1b')]===_0x0bf7('0x1a');var _0x12f64f=_0x1c69e4[_0x0bf7('0x1c')];var _0x5c938c=_0x25c774?0x0:_0x458ba3[_0x0bf7('0x19')];var _0x4164d3=_0x25c774?_0x1c69e4['count']:_0x458ba3[_0x0bf7('0x19')]+_0x458ba3[_0x0bf7('0x1b')];var _0x2a6fac;if(_0x4164d3>=_0x12f64f){_0x4164d3=_0x12f64f;_0x2a6fac=0xc8;}else{_0x2a6fac=0xce;}_0x7df983['status'](_0x2a6fac);return _0x7df983[_0x0bf7('0x1d')](_0x0bf7('0x1e'),_0x5c938c+'-'+_0x4164d3+'/'+_0x12f64f)[_0x0bf7('0x18')](_0x1c69e4);}return null;};}function patchUpdates(_0x14b943){return function(_0x5364a5){try{jsonpatch[_0x0bf7('0x1f')](_0x5364a5,_0x14b943,!![]);}catch(_0x1a4e96){return BPromise['reject'](_0x1a4e96);}return _0x5364a5['save']();};}function saveUpdates(_0xcd5cd7,_0x7686b9){return function(_0x4564c6){if(_0x4564c6){return _0x4564c6[_0x0bf7('0x20')](_0xcd5cd7)['then'](function(_0x186dbc){return _0x186dbc;});}return null;};}function removeEntity(_0x2ebf5e,_0x3dde76){return function(_0x3fc557){if(_0x3fc557){return _0x3fc557[_0x0bf7('0x21')]()[_0x0bf7('0x22')](function(){_0x2ebf5e[_0x0bf7('0x17')](0xcc)[_0x0bf7('0x16')]();});}};}function handleEntityNotFound(_0x250457,_0x23a00d){return function(_0x211f11){if(!_0x211f11){_0x250457[_0x0bf7('0x23')](0x194);}return _0x211f11;};}function handleError(_0x394d03,_0x532aaa){_0x532aaa=_0x532aaa||0x1f4;return function(_0x25eaef){logger[_0x0bf7('0x24')](_0x25eaef['stack']);if(_0x25eaef['name']){delete _0x25eaef[_0x0bf7('0x25')];}_0x394d03[_0x0bf7('0x17')](_0x532aaa)['send'](_0x25eaef);};}exports['index']=function(_0xa00336,_0x440bbd){var _0xeb340f={},_0x20bd31={},_0x1f19d3={'count':0x0,'rows':[]};var _0x51afc4=_['map'](db[_0x0bf7('0x26')][_0x0bf7('0x27')],function(_0x4f858e){return{'name':_0x4f858e[_0x0bf7('0x28')],'type':_0x4f858e[_0x0bf7('0x29')][_0x0bf7('0x2a')]};});_0x20bd31[_0x0bf7('0x2b')]=_[_0x0bf7('0x2c')](_0x51afc4,_0x0bf7('0x25'));_0x20bd31[_0x0bf7('0x2d')]=_[_0x0bf7('0x2e')](_0xa00336[_0x0bf7('0x2d')]);_0x20bd31[_0x0bf7('0x2f')]=_[_0x0bf7('0x30')](_0x20bd31['model'],_0x20bd31[_0x0bf7('0x2d')]);_0xeb340f['attributes']=_[_0x0bf7('0x30')](_0x20bd31['model'],qs[_0x0bf7('0x31')](_0xa00336['query'][_0x0bf7('0x31')]));_0xeb340f[_0x0bf7('0x32')]=_0xeb340f[_0x0bf7('0x32')][_0x0bf7('0x33')]?_0xeb340f['attributes']:_0x20bd31[_0x0bf7('0x2b')];if(!_0xa00336[_0x0bf7('0x2d')][_0x0bf7('0x34')]('nolimit')){_0xeb340f[_0x0bf7('0x1b')]=qs['limit'](_0xa00336[_0x0bf7('0x2d')][_0x0bf7('0x1b')]);_0xeb340f[_0x0bf7('0x19')]=qs[_0x0bf7('0x19')](_0xa00336[_0x0bf7('0x2d')][_0x0bf7('0x19')]);}_0xeb340f[_0x0bf7('0x35')]=qs[_0x0bf7('0x36')](_0xa00336[_0x0bf7('0x2d')][_0x0bf7('0x36')]);_0xeb340f['where']=qs['filters'](_['pick'](_0xa00336['query'],_0x20bd31[_0x0bf7('0x2f')]),_0x51afc4);if(_0xa00336['query']['filter']){_0xeb340f[_0x0bf7('0x37')]=_['merge'](_0xeb340f[_0x0bf7('0x37')],{'$or':_[_0x0bf7('0x2c')](_0x51afc4,function(_0x1e8de8){if(_0x1e8de8['type']!==_0x0bf7('0x38')){var _0x10ffcd={};_0x10ffcd[_0x1e8de8[_0x0bf7('0x25')]]={'$like':'%'+_0xa00336[_0x0bf7('0x2d')]['filter']+'%'};return _0x10ffcd;}})});}_0xeb340f=_[_0x0bf7('0x39')]({},_0xeb340f,_0xa00336[_0x0bf7('0x3a')]);var _0x188536={'where':_0xeb340f[_0x0bf7('0x37')]};return db[_0x0bf7('0x26')][_0x0bf7('0x1c')](_0x188536)[_0x0bf7('0x22')](function(_0x49c0cc){_0x1f19d3[_0x0bf7('0x1c')]=_0x49c0cc;if(_0xa00336['query'][_0x0bf7('0x3b')]){_0xeb340f[_0x0bf7('0x3c')]=[{'all':!![]}];}return db[_0x0bf7('0x26')][_0x0bf7('0x3d')](_0xeb340f);})[_0x0bf7('0x22')](function(_0x183e85){_0x1f19d3[_0x0bf7('0x3e')]=_0x183e85;return _0x1f19d3;})[_0x0bf7('0x22')](respondWithFilteredResult(_0x440bbd,_0xeb340f))['catch'](handleError(_0x440bbd,null));};exports[_0x0bf7('0x3f')]=function(_0x3039d2,_0x25d46c){var _0x3bbdf5={'raw':!![],'where':{'id':_0x3039d2[_0x0bf7('0x40')]['id']}},_0x2e993b={};_0x2e993b['model']=_[_0x0bf7('0x2e')](db[_0x0bf7('0x26')]['rawAttributes']);_0x2e993b['query']=_[_0x0bf7('0x2e')](_0x3039d2[_0x0bf7('0x2d')]);_0x2e993b[_0x0bf7('0x2f')]=_[_0x0bf7('0x30')](_0x2e993b[_0x0bf7('0x2b')],_0x2e993b[_0x0bf7('0x2d')]);_0x3bbdf5[_0x0bf7('0x32')]=_[_0x0bf7('0x30')](_0x2e993b[_0x0bf7('0x2b')],qs['fields'](_0x3039d2['query'][_0x0bf7('0x31')]));_0x3bbdf5[_0x0bf7('0x32')]=_0x3bbdf5['attributes'][_0x0bf7('0x33')]?_0x3bbdf5[_0x0bf7('0x32')]:_0x2e993b[_0x0bf7('0x2b')];if(_0x3039d2[_0x0bf7('0x2d')][_0x0bf7('0x3b')]){_0x3bbdf5[_0x0bf7('0x3c')]=[{'all':!![]}];}_0x3bbdf5=_[_0x0bf7('0x39')]({},_0x3bbdf5,_0x3039d2[_0x0bf7('0x3a')]);return db[_0x0bf7('0x26')]['find'](_0x3bbdf5)[_0x0bf7('0x22')](handleEntityNotFound(_0x25d46c,null))[_0x0bf7('0x22')](respondWithResult(_0x25d46c,null))[_0x0bf7('0x41')](handleError(_0x25d46c,null));};exports['create']=function(_0x1e5b92,_0x19e59b){return db[_0x0bf7('0x26')][_0x0bf7('0x42')](_0x1e5b92[_0x0bf7('0x43')],{})[_0x0bf7('0x22')](respondWithResult(_0x19e59b,0xc9))['catch'](handleError(_0x19e59b,null));};exports['update']=function(_0x1b6ac0,_0x246ffb){if(_0x1b6ac0[_0x0bf7('0x43')]['id']){delete _0x1b6ac0[_0x0bf7('0x43')]['id'];}return db[_0x0bf7('0x26')][_0x0bf7('0x44')]({'where':{'id':_0x1b6ac0[_0x0bf7('0x40')]['id']}})['then'](handleEntityNotFound(_0x246ffb,null))['then'](saveUpdates(_0x1b6ac0[_0x0bf7('0x43')],null))[_0x0bf7('0x22')](respondWithResult(_0x246ffb,null))[_0x0bf7('0x41')](handleError(_0x246ffb,null));};exports['destroy']=function(_0x29de17,_0x436405){return db[_0x0bf7('0x26')][_0x0bf7('0x44')]({'where':{'id':_0x29de17[_0x0bf7('0x40')]['id']}})[_0x0bf7('0x22')](handleEntityNotFound(_0x436405,null))[_0x0bf7('0x22')](removeEntity(_0x436405,null))['catch'](handleError(_0x436405,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index b3b9f70..afc9227 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 _0x1c70=['analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0xe7bc7,_0x37d550){var _0x2dcaed=function(_0x24770f){while(--_0x24770f){_0xe7bc7['push'](_0xe7bc7['shift']());}};_0x2dcaed(++_0x37d550);}(_0x1c70,0x83));var _0x01c7=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x1c70[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x01c7('0x0'));var util=require(_0x01c7('0x1'));var logger=require(_0x01c7('0x2'))(_0x01c7('0x3'));var moment=require('moment');var BPromise=require(_0x01c7('0x4'));var rp=require(_0x01c7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01c7('0x6'));var config=require(_0x01c7('0x7'));var attributes=require(_0x01c7('0x8'));module[_0x01c7('0x9')]=function(_0x30dbf2,_0x4c9329){return _0x30dbf2[_0x01c7('0xa')](_0x01c7('0xb'),attributes,{'tableName':_0x01c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd964=['../../config/environment','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd964,0x6c));var _0x4d96=function(_0x190763,_0x5e599c){_0x190763=_0x190763-0x0;var _0x1f5976=_0xd964[_0x190763];return _0x1f5976;};'use strict';var _=require(_0x4d96('0x0'));var util=require(_0x4d96('0x1'));var logger=require(_0x4d96('0x2'))(_0x4d96('0x3'));var moment=require(_0x4d96('0x4'));var BPromise=require(_0x4d96('0x5'));var rp=require(_0x4d96('0x6'));var fs=require('fs');var path=require(_0x4d96('0x7'));var rimraf=require(_0x4d96('0x8'));var config=require(_0x4d96('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0x4d96('0xa')]=function(_0x48c8b0,_0x1fb113){return _0x48c8b0[_0x4d96('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x4d96('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index dc73f9e..c813899 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x313eea,_0x4685be){var _0x29b8ca=function(_0xa85b0e){while(--_0xa85b0e){_0x313eea['push'](_0x313eea['shift']());}};_0x29b8ca(++_0x4685be);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5aca01,_0x228cf7){var _0x23a5e8=function(_0x3d7ee5){while(--_0x3d7ee5){_0x5aca01['push'](_0x5aca01['shift']());}};_0x23a5e8(++_0x228cf7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c86dd93..ee42218 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 _0x7771=['index','show','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x750168,_0x28e58b){var _0x781768=function(_0x28fab3){while(--_0x28fab3){_0x750168['push'](_0x750168['shift']());}};_0x781768(++_0x28e58b);}(_0x7771,0x77));var _0x1777=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x7771[_0x5c811c];return _0x5df3af;};'use strict';var multer=require(_0x1777('0x0'));var util=require(_0x1777('0x1'));var path=require(_0x1777('0x2'));var timeout=require(_0x1777('0x3'));var express=require(_0x1777('0x4'));var router=express[_0x1777('0x5')]();var fs_extra=require(_0x1777('0x6'));var auth=require(_0x1777('0x7'));var interaction=require(_0x1777('0x8'));var config=require(_0x1777('0x9'));var controller=require(_0x1777('0xa'));router[_0x1777('0xb')]('/',auth[_0x1777('0xc')](),controller[_0x1777('0xd')]);router['get']('/:id',auth[_0x1777('0xc')](),controller[_0x1777('0xe')]);router[_0x1777('0xf')]('/',auth[_0x1777('0xc')](),controller[_0x1777('0x10')]);router[_0x1777('0x11')]('/:id',auth[_0x1777('0xc')](),controller[_0x1777('0x12')]);router[_0x1777('0x13')](_0x1777('0x14'),auth[_0x1777('0xc')](),controller[_0x1777('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7797=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x496037,_0x71f4df){var _0x126da8=function(_0x30676e){while(--_0x30676e){_0x496037['push'](_0x496037['shift']());}};_0x126da8(++_0x71f4df);}(_0x7797,0xf3));var _0x7779=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x7797[_0x548627];return _0x844a84;};'use strict';var multer=require(_0x7779('0x0'));var util=require(_0x7779('0x1'));var path=require(_0x7779('0x2'));var timeout=require(_0x7779('0x3'));var express=require(_0x7779('0x4'));var router=express[_0x7779('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7779('0x6'));var interaction=require(_0x7779('0x7'));var config=require(_0x7779('0x8'));var controller=require(_0x7779('0x9'));router[_0x7779('0xa')]('/',auth[_0x7779('0xb')](),controller[_0x7779('0xc')]);router[_0x7779('0xa')](_0x7779('0xd'),auth['isAuthenticated'](),controller[_0x7779('0xe')]);router['post']('/',auth[_0x7779('0xb')](),controller[_0x7779('0xf')]);router[_0x7779('0x10')](_0x7779('0xd'),auth[_0x7779('0xb')](),controller['update']);router[_0x7779('0x11')](_0x7779('0xd'),auth[_0x7779('0xb')](),controller[_0x7779('0x12')]);module[_0x7779('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 3f03012..a7f9889 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 _0xc820=['STRING','exports'];(function(_0x2b0875,_0x21ff12){var _0xedb8d7=function(_0x33ebf6){while(--_0x33ebf6){_0x2b0875['push'](_0x2b0875['shift']());}};_0xedb8d7(++_0x21ff12);}(_0xc820,0x13f));var _0x0c82=function(_0x3ce25d,_0x230246){_0x3ce25d=_0x3ce25d-0x0;var _0x47a5e2=_0xc820[_0x3ce25d];return _0x47a5e2;};'use strict';var Sequelize=require('sequelize');module[_0x0c82('0x0')]={'name':{'type':Sequelize[_0x0c82('0x1')]},'basename':{'type':Sequelize[_0x0c82('0x1')]},'type':{'type':Sequelize[_0x0c82('0x1')]}}; \ No newline at end of file +var _0x59ce=['exports','STRING','sequelize'];(function(_0x261d12,_0x1e093c){var _0x441715=function(_0x2b5c1a){while(--_0x2b5c1a){_0x261d12['push'](_0x261d12['shift']());}};_0x441715(++_0x1e093c);}(_0x59ce,0x92));var _0xe59c=function(_0x1b6826,_0x569780){_0x1b6826=_0x1b6826-0x0;var _0x35cfbb=_0x59ce[_0x1b6826];return _0x35cfbb;};'use strict';var Sequelize=require(_0xe59c('0x0'));module[_0xe59c('0x1')]={'name':{'type':Sequelize[_0xe59c('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe59c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 52bab9f..08da617 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 _0xff3a=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','Attachment','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','eml-format','zip-dir','request-promise','util','path'];(function(_0x26dd45,_0x339803){var _0x33ce6f=function(_0x2d39e4){while(--_0x2d39e4){_0x26dd45['push'](_0x26dd45['shift']());}};_0x33ce6f(++_0x339803);}(_0xff3a,0x10c));var _0xaff3=function(_0x38ff22,_0x1b46e7){_0x38ff22=_0x38ff22-0x0;var _0x1cca1e=_0xff3a[_0x38ff22];return _0x1cca1e;};'use strict';var emlformat=require(_0xaff3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaff3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaff3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaff3('0x3'));var path=require(_0xaff3('0x4'));var sox=require(_0xaff3('0x5'));var csv=require(_0xaff3('0x6'));var ejs=require(_0xaff3('0x7'));var fs=require('fs');var fs_extra=require(_0xaff3('0x8'));var _=require('lodash');var squel=require(_0xaff3('0x9'));var crypto=require(_0xaff3('0xa'));var jsforce=require(_0xaff3('0xb'));var deskjs=require(_0xaff3('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaff3('0xd'));var Papa=require(_0xaff3('0xe'));var Redis=require(_0xaff3('0xf'));var authService=require(_0xaff3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaff3('0x11'));var hardwareService=require(_0xaff3('0x12'));var logger=require(_0xaff3('0x13'))(_0xaff3('0x14'));var utils=require(_0xaff3('0x15'));var config=require(_0xaff3('0x16'));var licenseUtil=require(_0xaff3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x350ecb,_0x1ee7d1){_0x1ee7d1=_0x1ee7d1||0xcc;return function(_0x58968a){if(_0x58968a){return _0x350ecb['sendStatus'](_0x1ee7d1);}return _0x350ecb[_0xaff3('0x18')](_0x1ee7d1)[_0xaff3('0x19')]();};}function respondWithResult(_0x463a52,_0x3ba241){_0x3ba241=_0x3ba241||0xc8;return function(_0x3f11d3){if(_0x3f11d3){return _0x463a52[_0xaff3('0x18')](_0x3ba241)['json'](_0x3f11d3);}};}function respondWithFilteredResult(_0x2a481c,_0x41a338){return function(_0x37eec8){if(_0x37eec8){var _0x38f763=typeof _0x41a338[_0xaff3('0x1a')]===_0xaff3('0x1b')&&typeof _0x41a338[_0xaff3('0x1c')]===_0xaff3('0x1b');var _0x2d0401=_0x37eec8['count'];var _0x2c0469=_0x38f763?0x0:_0x41a338[_0xaff3('0x1a')];var _0x51ccb1=_0x38f763?_0x37eec8['count']:_0x41a338['offset']+_0x41a338[_0xaff3('0x1c')];var _0x43cd6b;if(_0x51ccb1>=_0x2d0401){_0x51ccb1=_0x2d0401;_0x43cd6b=0xc8;}else{_0x43cd6b=0xce;}_0x2a481c[_0xaff3('0x18')](_0x43cd6b);return _0x2a481c[_0xaff3('0x1d')](_0xaff3('0x1e'),_0x2c0469+'-'+_0x51ccb1+'/'+_0x2d0401)[_0xaff3('0x1f')](_0x37eec8);}return null;};}function patchUpdates(_0x135936){return function(_0x112b82){try{jsonpatch[_0xaff3('0x20')](_0x112b82,_0x135936,!![]);}catch(_0x253324){return BPromise[_0xaff3('0x21')](_0x253324);}return _0x112b82[_0xaff3('0x22')]();};}function saveUpdates(_0x1160c8,_0x5ddb4c){return function(_0x3f40fa){if(_0x3f40fa){return _0x3f40fa[_0xaff3('0x23')](_0x1160c8)[_0xaff3('0x24')](function(_0x5567ee){return _0x5567ee;});}return null;};}function removeEntity(_0x46eb14,_0x1474de){return function(_0xad5b28){if(_0xad5b28){return _0xad5b28[_0xaff3('0x25')]()[_0xaff3('0x24')](function(){_0x46eb14[_0xaff3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24917e,_0x45b42d){return function(_0x5b52bd){if(!_0x5b52bd){_0x24917e[_0xaff3('0x26')](0x194);}return _0x5b52bd;};}function handleError(_0x164188,_0x4579a9){_0x4579a9=_0x4579a9||0x1f4;return function(_0x213bf7){logger['error'](_0x213bf7[_0xaff3('0x27')]);if(_0x213bf7[_0xaff3('0x28')]){delete _0x213bf7['name'];}_0x164188[_0xaff3('0x18')](_0x4579a9)[_0xaff3('0x29')](_0x213bf7);};}exports['index']=function(_0x17a2f7,_0x40d386){var _0x57f305={},_0x1a3a34={},_0x5602b4={'count':0x0,'rows':[]};var _0x2d4e0d=_[_0xaff3('0x2a')](db[_0xaff3('0x2b')]['rawAttributes'],function(_0x59a8a2){return{'name':_0x59a8a2[_0xaff3('0x2c')],'type':_0x59a8a2[_0xaff3('0x2d')][_0xaff3('0x2e')]};});_0x1a3a34[_0xaff3('0x2f')]=_['map'](_0x2d4e0d,_0xaff3('0x28'));_0x1a3a34[_0xaff3('0x30')]=_['keys'](_0x17a2f7[_0xaff3('0x30')]);_0x1a3a34[_0xaff3('0x31')]=_['intersection'](_0x1a3a34[_0xaff3('0x2f')],_0x1a3a34[_0xaff3('0x30')]);_0x57f305['attributes']=_[_0xaff3('0x32')](_0x1a3a34['model'],qs[_0xaff3('0x33')](_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x33')]));_0x57f305[_0xaff3('0x34')]=_0x57f305[_0xaff3('0x34')][_0xaff3('0x35')]?_0x57f305[_0xaff3('0x34')]:_0x1a3a34[_0xaff3('0x2f')];if(!_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x36')](_0xaff3('0x37'))){_0x57f305[_0xaff3('0x1c')]=qs['limit'](_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x1c')]);_0x57f305['offset']=qs[_0xaff3('0x1a')](_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x1a')]);}_0x57f305[_0xaff3('0x38')]=qs[_0xaff3('0x39')](_0x17a2f7['query'][_0xaff3('0x39')]);_0x57f305[_0xaff3('0x3a')]=qs[_0xaff3('0x31')](_[_0xaff3('0x3b')](_0x17a2f7[_0xaff3('0x30')],_0x1a3a34[_0xaff3('0x31')]),_0x2d4e0d);if(_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x3c')]){_0x57f305['where']=_[_0xaff3('0x3d')](_0x57f305[_0xaff3('0x3a')],{'$or':_['map'](_0x2d4e0d,function(_0x2dd9b1){if(_0x2dd9b1[_0xaff3('0x2d')]!=='VIRTUAL'){var _0x26d1e7={};_0x26d1e7[_0x2dd9b1[_0xaff3('0x28')]]={'$like':'%'+_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x3c')]+'%'};return _0x26d1e7;}})});}_0x57f305=_[_0xaff3('0x3d')]({},_0x57f305,_0x17a2f7[_0xaff3('0x3e')]);var _0x4bb709={'where':_0x57f305[_0xaff3('0x3a')]};return db[_0xaff3('0x2b')][_0xaff3('0x3f')](_0x4bb709)[_0xaff3('0x24')](function(_0x17e330){_0x5602b4[_0xaff3('0x3f')]=_0x17e330;if(_0x17a2f7[_0xaff3('0x30')][_0xaff3('0x40')]){_0x57f305[_0xaff3('0x41')]=[{'all':!![]}];}return db[_0xaff3('0x2b')][_0xaff3('0x42')](_0x57f305);})[_0xaff3('0x24')](function(_0x19f4f4){_0x5602b4[_0xaff3('0x43')]=_0x19f4f4;return _0x5602b4;})[_0xaff3('0x24')](respondWithFilteredResult(_0x40d386,_0x57f305))['catch'](handleError(_0x40d386,null));};exports[_0xaff3('0x44')]=function(_0x40e598,_0x17bbb3){var _0x5564d2={'raw':!![],'where':{'id':_0x40e598['params']['id']}},_0x1c30eb={};_0x1c30eb[_0xaff3('0x2f')]=_[_0xaff3('0x45')](db['Attachment'][_0xaff3('0x46')]);_0x1c30eb[_0xaff3('0x30')]=_[_0xaff3('0x45')](_0x40e598[_0xaff3('0x30')]);_0x1c30eb[_0xaff3('0x31')]=_[_0xaff3('0x32')](_0x1c30eb[_0xaff3('0x2f')],_0x1c30eb[_0xaff3('0x30')]);_0x5564d2[_0xaff3('0x34')]=_[_0xaff3('0x32')](_0x1c30eb[_0xaff3('0x2f')],qs[_0xaff3('0x33')](_0x40e598[_0xaff3('0x30')][_0xaff3('0x33')]));_0x5564d2[_0xaff3('0x34')]=_0x5564d2['attributes'][_0xaff3('0x35')]?_0x5564d2[_0xaff3('0x34')]:_0x1c30eb[_0xaff3('0x2f')];if(_0x40e598[_0xaff3('0x30')][_0xaff3('0x40')]){_0x5564d2[_0xaff3('0x41')]=[{'all':!![]}];}_0x5564d2=_['merge']({},_0x5564d2,_0x40e598['options']);return db[_0xaff3('0x2b')][_0xaff3('0x47')](_0x5564d2)[_0xaff3('0x24')](handleEntityNotFound(_0x17bbb3,null))[_0xaff3('0x24')](respondWithResult(_0x17bbb3,null))[_0xaff3('0x48')](handleError(_0x17bbb3,null));};exports[_0xaff3('0x49')]=function(_0x3b5be6,_0x553296){var _0x501f58={'where':{'id':_0x3b5be6[_0xaff3('0x4a')]['id']}},_0x37314d={};_0x37314d['model']=_['keys'](db[_0xaff3('0x2b')][_0xaff3('0x46')]);_0x501f58[_0xaff3('0x34')]=_['intersection'](_0x37314d[_0xaff3('0x2f')],qs[_0xaff3('0x33')](_0x3b5be6[_0xaff3('0x30')][_0xaff3('0x33')]));_0x501f58[_0xaff3('0x34')]=_0x501f58[_0xaff3('0x34')][_0xaff3('0x35')]?_0x501f58[_0xaff3('0x34')]:_0x37314d[_0xaff3('0x2f')];if(_0x3b5be6[_0xaff3('0x30')][_0xaff3('0x40')]){_0x501f58[_0xaff3('0x41')]=[{'all':!![]}];}_0x501f58=_[_0xaff3('0x3d')]({},_0x501f58,_0x3b5be6[_0xaff3('0x3e')]);return db[_0xaff3('0x2b')][_0xaff3('0x47')](_0x501f58)['then'](handleEntityNotFound(_0x553296,null))[_0xaff3('0x24')](function(_0x3acf46){if(_0x3acf46){var _0xf980dd=_0x3acf46[_0xaff3('0x4b')]({'plain':!![]});_0xf980dd=qs[_0xaff3('0x4c')](_0xf980dd,['id',_0xaff3('0x4d'),_0xaff3('0x4e')]);_0x3b5be6[_0xaff3('0x4f')]=_['omit'](_0x3b5be6[_0xaff3('0x4f')],['id',_0xaff3('0x4d'),_0xaff3('0x4e')]);return db[_0xaff3('0x2b')][_0xaff3('0x50')](_[_0xaff3('0x3d')](_0xf980dd,_0x3b5be6[_0xaff3('0x4f')]),{'include':_0x3b5be6[_0xaff3('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xaff3('0x24')](respondWithResult(_0x553296,0xc9))[_0xaff3('0x48')](handleError(_0x553296,null));};exports[_0xaff3('0x23')]=function(_0x5a190d,_0x40831d){if(_0x5a190d[_0xaff3('0x4f')]['id']){delete _0x5a190d[_0xaff3('0x4f')]['id'];}return db[_0xaff3('0x2b')]['find']({'where':{'id':_0x5a190d[_0xaff3('0x4a')]['id']}})[_0xaff3('0x24')](handleEntityNotFound(_0x40831d,null))[_0xaff3('0x24')](saveUpdates(_0x5a190d['body'],null))['then'](respondWithResult(_0x40831d,null))[_0xaff3('0x48')](handleError(_0x40831d,null));};exports['destroy']=function(_0x590951,_0x4f28d6){return db[_0xaff3('0x2b')][_0xaff3('0x47')]({'where':{'id':_0x590951[_0xaff3('0x4a')]['id']}})[_0xaff3('0x24')](handleEntityNotFound(_0x4f28d6,null))['then'](removeEntity(_0x4f28d6,null))[_0xaff3('0x48')](handleError(_0x4f28d6,null));};exports[_0xaff3('0x50')]=function(_0x280ddb,_0x2d6b4c,_0x3e9fa0){_0x280ddb['body']['name']=_0x280ddb[_0xaff3('0x51')][_0xaff3('0x52')];_0x280ddb[_0xaff3('0x4f')]['basename']=_0x280ddb[_0xaff3('0x51')][_0xaff3('0x53')];_0x280ddb[_0xaff3('0x4f')][_0xaff3('0x2d')]=_0x280ddb['file'][_0xaff3('0x54')];return db[_0xaff3('0x2b')]['create'](_0x280ddb['body'])[_0xaff3('0x24')](respondWithResult(_0x2d6b4c,0xc9))[_0xaff3('0x48')](handleError(_0x2d6b4c,null));};exports[_0xaff3('0x55')]=function(_0xd78f62,_0x20cd9d,_0x38d022){return db[_0xaff3('0x2b')][_0xaff3('0x56')]({'where':{'id':_0xd78f62[_0xaff3('0x4a')]['id']},'raw':!![]})[_0xaff3('0x24')](handleEntityNotFound(_0x20cd9d,null))[_0xaff3('0x24')](function(_0x1a20ff){if(_0x1a20ff){var _0x5e32ee=_0x1a20ff['ChatOfflineMessageId']!==null;var _0x9f459=path[_0xaff3('0x57')](config[_0xaff3('0x58')],_0xaff3('0x59'));if(_0x5e32ee){_0x9f459=path[_0xaff3('0x57')](_0x9f459,'offline-chat/');}var _0x5cc9fd=path[_0xaff3('0x57')](_0x9f459,_0x1a20ff[_0xaff3('0x5a')]);return _0x20cd9d['download'](_0x5cc9fd);}})[_0xaff3('0x48')](handleError(_0x20cd9d,null));}; \ No newline at end of file +var _0x4eb5=['originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','length','merge','find','catch','clone','get','omit','createdAt','body','updatedAt','create','file'];(function(_0x157379,_0x3b606c){var _0x330c55=function(_0x3be1a7){while(--_0x3be1a7){_0x157379['push'](_0x157379['shift']());}};_0x330c55(++_0x3b606c);}(_0x4eb5,0xbc));var _0x54eb=function(_0x22ea5c,_0x4fada2){_0x22ea5c=_0x22ea5c-0x0;var _0x4a3041=_0x4eb5[_0x22ea5c];return _0x4a3041;};'use strict';var emlformat=require(_0x54eb('0x0'));var rimraf=require(_0x54eb('0x1'));var zipdir=require(_0x54eb('0x2'));var jsonpatch=require(_0x54eb('0x3'));var rp=require(_0x54eb('0x4'));var moment=require(_0x54eb('0x5'));var BPromise=require(_0x54eb('0x6'));var Mustache=require('mustache');var util=require(_0x54eb('0x7'));var path=require(_0x54eb('0x8'));var sox=require(_0x54eb('0x9'));var csv=require(_0x54eb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54eb('0xb'));var _=require(_0x54eb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x54eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x54eb('0xa'));var querystring=require(_0x54eb('0xe'));var Papa=require(_0x54eb('0xf'));var Redis=require(_0x54eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x54eb('0x11'));var as=require(_0x54eb('0x12'));var hardwareService=require(_0x54eb('0x13'));var logger=require(_0x54eb('0x14'))(_0x54eb('0x15'));var utils=require('../../config/utils');var config=require(_0x54eb('0x16'));var licenseUtil=require(_0x54eb('0x17'));var db=require(_0x54eb('0x18'))['db'];function respondWithStatusCode(_0x3d4b80,_0x433e9a){_0x433e9a=_0x433e9a||0xcc;return function(_0x3c75eb){if(_0x3c75eb){return _0x3d4b80[_0x54eb('0x19')](_0x433e9a);}return _0x3d4b80[_0x54eb('0x1a')](_0x433e9a)['end']();};}function respondWithResult(_0x406adf,_0x3b46e6){_0x3b46e6=_0x3b46e6||0xc8;return function(_0x2672bd){if(_0x2672bd){return _0x406adf[_0x54eb('0x1a')](_0x3b46e6)[_0x54eb('0x1b')](_0x2672bd);}};}function respondWithFilteredResult(_0x1747bb,_0x19be40){return function(_0x2e6794){if(_0x2e6794){var _0x56c507=typeof _0x19be40[_0x54eb('0x1c')]===_0x54eb('0x1d')&&typeof _0x19be40[_0x54eb('0x1e')]===_0x54eb('0x1d');var _0x5c3c98=_0x2e6794[_0x54eb('0x1f')];var _0x2d0fa6=_0x56c507?0x0:_0x19be40[_0x54eb('0x1c')];var _0x4a7ee3=_0x56c507?_0x2e6794[_0x54eb('0x1f')]:_0x19be40[_0x54eb('0x1c')]+_0x19be40[_0x54eb('0x1e')];var _0x3b99ce;if(_0x4a7ee3>=_0x5c3c98){_0x4a7ee3=_0x5c3c98;_0x3b99ce=0xc8;}else{_0x3b99ce=0xce;}_0x1747bb['status'](_0x3b99ce);return _0x1747bb[_0x54eb('0x20')](_0x54eb('0x21'),_0x2d0fa6+'-'+_0x4a7ee3+'/'+_0x5c3c98)[_0x54eb('0x1b')](_0x2e6794);}return null;};}function patchUpdates(_0xe5c605){return function(_0xc70289){try{jsonpatch[_0x54eb('0x22')](_0xc70289,_0xe5c605,!![]);}catch(_0x1136e3){return BPromise[_0x54eb('0x23')](_0x1136e3);}return _0xc70289['save']();};}function saveUpdates(_0x59bcce,_0x4884fa){return function(_0x2987de){if(_0x2987de){return _0x2987de[_0x54eb('0x24')](_0x59bcce)[_0x54eb('0x25')](function(_0x360033){return _0x360033;});}return null;};}function removeEntity(_0xa164f6,_0x4fdf0f){return function(_0x5621a4){if(_0x5621a4){return _0x5621a4[_0x54eb('0x26')]()[_0x54eb('0x25')](function(){_0xa164f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x224918,_0x128e51){return function(_0x1275c6){if(!_0x1275c6){_0x224918[_0x54eb('0x19')](0x194);}return _0x1275c6;};}function handleError(_0x5e5a75,_0x4c0a3e){_0x4c0a3e=_0x4c0a3e||0x1f4;return function(_0x48e43b){logger[_0x54eb('0x27')](_0x48e43b[_0x54eb('0x28')]);if(_0x48e43b[_0x54eb('0x29')]){delete _0x48e43b[_0x54eb('0x29')];}_0x5e5a75['status'](_0x4c0a3e)[_0x54eb('0x2a')](_0x48e43b);};}exports[_0x54eb('0x2b')]=function(_0x57a8f3,_0x888841){var _0x327e5c={},_0x87d2f6={},_0xe63b3c={'count':0x0,'rows':[]};var _0x20bafe=_[_0x54eb('0x2c')](db[_0x54eb('0x2d')][_0x54eb('0x2e')],function(_0x201e22){return{'name':_0x201e22[_0x54eb('0x2f')],'type':_0x201e22[_0x54eb('0x30')][_0x54eb('0x31')]};});_0x87d2f6[_0x54eb('0x32')]=_['map'](_0x20bafe,'name');_0x87d2f6[_0x54eb('0x33')]=_[_0x54eb('0x34')](_0x57a8f3['query']);_0x87d2f6[_0x54eb('0x35')]=_[_0x54eb('0x36')](_0x87d2f6[_0x54eb('0x32')],_0x87d2f6[_0x54eb('0x33')]);_0x327e5c['attributes']=_['intersection'](_0x87d2f6[_0x54eb('0x32')],qs[_0x54eb('0x37')](_0x57a8f3[_0x54eb('0x33')][_0x54eb('0x37')]));_0x327e5c[_0x54eb('0x38')]=_0x327e5c[_0x54eb('0x38')]['length']?_0x327e5c[_0x54eb('0x38')]:_0x87d2f6[_0x54eb('0x32')];if(!_0x57a8f3[_0x54eb('0x33')]['hasOwnProperty'](_0x54eb('0x39'))){_0x327e5c[_0x54eb('0x1e')]=qs['limit'](_0x57a8f3[_0x54eb('0x33')]['limit']);_0x327e5c[_0x54eb('0x1c')]=qs[_0x54eb('0x1c')](_0x57a8f3[_0x54eb('0x33')][_0x54eb('0x1c')]);}_0x327e5c[_0x54eb('0x3a')]=qs[_0x54eb('0x3b')](_0x57a8f3[_0x54eb('0x33')][_0x54eb('0x3b')]);_0x327e5c[_0x54eb('0x3c')]=qs['filters'](_[_0x54eb('0x3d')](_0x57a8f3[_0x54eb('0x33')],_0x87d2f6[_0x54eb('0x35')]),_0x20bafe);if(_0x57a8f3[_0x54eb('0x33')][_0x54eb('0x3e')]){_0x327e5c['where']=_['merge'](_0x327e5c[_0x54eb('0x3c')],{'$or':_[_0x54eb('0x2c')](_0x20bafe,function(_0x586da1){if(_0x586da1[_0x54eb('0x30')]!=='VIRTUAL'){var _0x5665d0={};_0x5665d0[_0x586da1[_0x54eb('0x29')]]={'$like':'%'+_0x57a8f3[_0x54eb('0x33')][_0x54eb('0x3e')]+'%'};return _0x5665d0;}})});}_0x327e5c=_['merge']({},_0x327e5c,_0x57a8f3[_0x54eb('0x3f')]);var _0x4e2abd={'where':_0x327e5c[_0x54eb('0x3c')]};return db[_0x54eb('0x2d')]['count'](_0x4e2abd)[_0x54eb('0x25')](function(_0x27413d){_0xe63b3c[_0x54eb('0x1f')]=_0x27413d;if(_0x57a8f3[_0x54eb('0x33')][_0x54eb('0x40')]){_0x327e5c[_0x54eb('0x41')]=[{'all':!![]}];}return db[_0x54eb('0x2d')][_0x54eb('0x42')](_0x327e5c);})[_0x54eb('0x25')](function(_0x5804ac){_0xe63b3c[_0x54eb('0x43')]=_0x5804ac;return _0xe63b3c;})['then'](respondWithFilteredResult(_0x888841,_0x327e5c))['catch'](handleError(_0x888841,null));};exports[_0x54eb('0x44')]=function(_0x420dae,_0x2db6d9){var _0x1271cc={'raw':!![],'where':{'id':_0x420dae[_0x54eb('0x45')]['id']}},_0x4fcf31={};_0x4fcf31[_0x54eb('0x32')]=_[_0x54eb('0x34')](db[_0x54eb('0x2d')][_0x54eb('0x2e')]);_0x4fcf31[_0x54eb('0x33')]=_[_0x54eb('0x34')](_0x420dae[_0x54eb('0x33')]);_0x4fcf31[_0x54eb('0x35')]=_[_0x54eb('0x36')](_0x4fcf31[_0x54eb('0x32')],_0x4fcf31['query']);_0x1271cc['attributes']=_[_0x54eb('0x36')](_0x4fcf31['model'],qs[_0x54eb('0x37')](_0x420dae['query']['fields']));_0x1271cc['attributes']=_0x1271cc[_0x54eb('0x38')][_0x54eb('0x46')]?_0x1271cc['attributes']:_0x4fcf31[_0x54eb('0x32')];if(_0x420dae['query']['includeAll']){_0x1271cc[_0x54eb('0x41')]=[{'all':!![]}];}_0x1271cc=_[_0x54eb('0x47')]({},_0x1271cc,_0x420dae[_0x54eb('0x3f')]);return db['Attachment'][_0x54eb('0x48')](_0x1271cc)[_0x54eb('0x25')](handleEntityNotFound(_0x2db6d9,null))[_0x54eb('0x25')](respondWithResult(_0x2db6d9,null))[_0x54eb('0x49')](handleError(_0x2db6d9,null));};exports[_0x54eb('0x4a')]=function(_0x58b686,_0x1c80b1){var _0x22053a={'where':{'id':_0x58b686[_0x54eb('0x45')]['id']}},_0xe78f4={};_0xe78f4['model']=_[_0x54eb('0x34')](db['Attachment'][_0x54eb('0x2e')]);_0x22053a['attributes']=_[_0x54eb('0x36')](_0xe78f4['model'],qs[_0x54eb('0x37')](_0x58b686[_0x54eb('0x33')][_0x54eb('0x37')]));_0x22053a['attributes']=_0x22053a[_0x54eb('0x38')][_0x54eb('0x46')]?_0x22053a['attributes']:_0xe78f4[_0x54eb('0x32')];if(_0x58b686[_0x54eb('0x33')]['includeAll']){_0x22053a[_0x54eb('0x41')]=[{'all':!![]}];}_0x22053a=_[_0x54eb('0x47')]({},_0x22053a,_0x58b686[_0x54eb('0x3f')]);return db['Attachment'][_0x54eb('0x48')](_0x22053a)['then'](handleEntityNotFound(_0x1c80b1,null))[_0x54eb('0x25')](function(_0x17d946){if(_0x17d946){var _0x30e196=_0x17d946[_0x54eb('0x4b')]({'plain':!![]});_0x30e196=qs[_0x54eb('0x4c')](_0x30e196,['id',_0x54eb('0x4d'),'updatedAt']);_0x58b686[_0x54eb('0x4e')]=_[_0x54eb('0x4c')](_0x58b686[_0x54eb('0x4e')],['id','createdAt',_0x54eb('0x4f')]);return db[_0x54eb('0x2d')][_0x54eb('0x50')](_['merge'](_0x30e196,_0x58b686[_0x54eb('0x4e')]),{'include':_0x58b686[_0x54eb('0x33')][_0x54eb('0x40')]?[{'all':!![]}]:undefined});}})[_0x54eb('0x25')](respondWithResult(_0x1c80b1,0xc9))[_0x54eb('0x49')](handleError(_0x1c80b1,null));};exports[_0x54eb('0x24')]=function(_0x3deb12,_0x253b35){if(_0x3deb12[_0x54eb('0x4e')]['id']){delete _0x3deb12[_0x54eb('0x4e')]['id'];}return db[_0x54eb('0x2d')][_0x54eb('0x48')]({'where':{'id':_0x3deb12['params']['id']}})['then'](handleEntityNotFound(_0x253b35,null))[_0x54eb('0x25')](saveUpdates(_0x3deb12[_0x54eb('0x4e')],null))[_0x54eb('0x25')](respondWithResult(_0x253b35,null))['catch'](handleError(_0x253b35,null));};exports[_0x54eb('0x26')]=function(_0x2aaa62,_0x3ddb3e){return db['Attachment'][_0x54eb('0x48')]({'where':{'id':_0x2aaa62[_0x54eb('0x45')]['id']}})[_0x54eb('0x25')](handleEntityNotFound(_0x3ddb3e,null))[_0x54eb('0x25')](removeEntity(_0x3ddb3e,null))[_0x54eb('0x49')](handleError(_0x3ddb3e,null));};exports[_0x54eb('0x50')]=function(_0x523807,_0x417650,_0x278457){_0x523807['body'][_0x54eb('0x29')]=_0x523807[_0x54eb('0x51')][_0x54eb('0x52')];_0x523807['body']['basename']=_0x523807[_0x54eb('0x51')][_0x54eb('0x53')];_0x523807['body']['type']=_0x523807[_0x54eb('0x51')][_0x54eb('0x54')];return db[_0x54eb('0x2d')][_0x54eb('0x50')](_0x523807[_0x54eb('0x4e')])['then'](respondWithResult(_0x417650,0xc9))[_0x54eb('0x49')](handleError(_0x417650,null));};exports[_0x54eb('0x55')]=function(_0x2cee9e,_0x18b7a2,_0x156700){return db[_0x54eb('0x2d')][_0x54eb('0x56')]({'where':{'id':_0x2cee9e['params']['id']},'raw':!![]})[_0x54eb('0x25')](handleEntityNotFound(_0x18b7a2,null))['then'](function(_0x194fc6){if(_0x194fc6){var _0x196da5=_0x194fc6[_0x54eb('0x57')]!==null;var _0x573fe9=path['join'](config['root'],'server/files/attachments/');if(_0x196da5){_0x573fe9=path[_0x54eb('0x58')](_0x573fe9,_0x54eb('0x59'));}var _0x11e7da=path[_0x54eb('0x58')](_0x573fe9,_0x194fc6['basename']);return _0x18b7a2[_0x54eb('0x55')](_0x11e7da);}})['catch'](handleError(_0x18b7a2,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a3a4a77..2a0289a 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 _0x0d1c=['exports','define','Attachment','attachments','lodash','util','moment','bluebird','../../config/environment'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x0d1c,0xd3));var _0xc0d1=function(_0x595451,_0x854b56){_0x595451=_0x595451-0x0;var _0x14abed=_0x0d1c[_0x595451];return _0x14abed;};'use strict';var _=require(_0xc0d1('0x0'));var util=require(_0xc0d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc0d1('0x2'));var BPromise=require(_0xc0d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc0d1('0x4'));var attributes=require('./attachment.attributes');module[_0xc0d1('0x5')]=function(_0x522afb,_0x3f313b){return _0x522afb[_0xc0d1('0x6')](_0xc0d1('0x7'),attributes,{'tableName':_0xc0d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85ba=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x85ba,0x1bc));var _0xa85b=function(_0x5e835d,_0x5f09e5){_0x5e835d=_0x5e835d-0x0;var _0x1544e1=_0x85ba[_0x5e835d];return _0x1544e1;};'use strict';var _=require(_0xa85b('0x0'));var util=require('util');var logger=require(_0xa85b('0x1'))('api');var moment=require(_0xa85b('0x2'));var BPromise=require(_0xa85b('0x3'));var rp=require(_0xa85b('0x4'));var fs=require('fs');var path=require(_0xa85b('0x5'));var rimraf=require(_0xa85b('0x6'));var config=require(_0xa85b('0x7'));var attributes=require('./attachment.attributes');module[_0xa85b('0x8')]=function(_0x66ad1a,_0x3d3532){return _0x66ad1a[_0xa85b('0x9')](_0xa85b('0xa'),attributes,{'tableName':_0xa85b('0xb'),'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 7528498..16be5a9 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 _0x1b73=['jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1b73,0x1d5));var _0x31b7=function(_0x16cc84,_0x1a155c){_0x16cc84=_0x16cc84-0x0;var _0x2d3957=_0x1b73[_0x16cc84];return _0x2d3957;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('Attachment,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('Attachment,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});}exports[_0x31b7('0x17')]=function(_0x5f3245){var _0x223f9f=this;return new Promise(function(_0x437eba,_0x1dc28c){return db[_0x31b7('0x18')][_0x31b7('0x19')](_0x5f3245['body'],{'raw':_0x5f3245[_0x31b7('0x1a')]?_0x5f3245[_0x31b7('0x1a')][_0x31b7('0x1b')]===undefined?!![]:![]:!![]})[_0x31b7('0xb')](function(_0x5b56bc){logger[_0x31b7('0x14')](_0x31b7('0x17'),_0x5f3245);logger[_0x31b7('0xe')](_0x31b7('0x17'),_0x5f3245,JSON['stringify'](_0x5b56bc));_0x437eba(_0x5b56bc);})[_0x31b7('0x16')](function(_0x20cb03){logger[_0x31b7('0x11')](_0x31b7('0x17'),_0x20cb03[_0x31b7('0x13')],_0x5f3245);_0x1dc28c(_0x223f9f[_0x31b7('0x11')](0x1f4,_0x20cb03[_0x31b7('0x13')]));});});}; \ No newline at end of file +var _0x885e=['body','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','CreateAttachment','Attachment','create'];(function(_0x3e6c6b,_0x38a2ee){var _0x55d57d=function(_0x455631){while(--_0x455631){_0x3e6c6b['push'](_0x3e6c6b['shift']());}};_0x55d57d(++_0x38a2ee);}(_0x885e,0xe4));var _0xe885=function(_0x26321b,_0x47c697){_0x26321b=_0x26321b-0x0;var _0x3f9eb4=_0x885e[_0x26321b];return _0x3f9eb4;};'use strict';var _=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var moment=require('moment');var BPromise=require(_0xe885('0x2'));var rs=require(_0xe885('0x3'));var fs=require('fs');var Redis=require(_0xe885('0x4'));var db=require(_0xe885('0x5'))['db'];var utils=require(_0xe885('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe885('0x7'));var jayson=require(_0xe885('0x8'));var client=jayson[_0xe885('0x9')][_0xe885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d2b2,_0x37778a,_0x597bdc){return new BPromise(function(_0x2e8fe0,_0x3c5cc7){return client[_0xe885('0xb')](_0x55d2b2,_0x597bdc)[_0xe885('0xc')](function(_0x231f2f){logger[_0xe885('0xd')]('Attachment,\x20%s,\x20%s',_0x37778a,_0xe885('0xe'));logger[_0xe885('0xf')](_0xe885('0x10'),_0x37778a,_0xe885('0xe'),JSON[_0xe885('0x11')](_0x231f2f));if(_0x231f2f[_0xe885('0x12')]){if(_0x231f2f[_0xe885('0x12')]['code']===0x1f4){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);return _0x3c5cc7(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}logger[_0xe885('0x12')]('Attachment,\x20%s,\x20%s',_0x37778a,_0x231f2f['error']['message']);return _0x2e8fe0(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}else{logger[_0xe885('0xd')](_0xe885('0x13'),_0x37778a,'request\x20sent');_0x2e8fe0(_0x231f2f['result'][_0xe885('0x14')]);}})['catch'](function(_0x36b9e7){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x36b9e7);_0x3c5cc7(_0x36b9e7);});});}exports[_0xe885('0x15')]=function(_0x25a002){var _0x365eab=this;return new Promise(function(_0x4f5045,_0x39f07c){return db[_0xe885('0x16')][_0xe885('0x17')](_0x25a002[_0xe885('0x18')],{'raw':_0x25a002[_0xe885('0x19')]?_0x25a002[_0xe885('0x19')][_0xe885('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x159624){logger[_0xe885('0xd')](_0xe885('0x15'),_0x25a002);logger[_0xe885('0xf')](_0xe885('0x15'),_0x25a002,JSON[_0xe885('0x11')](_0x159624));_0x4f5045(_0x159624);})[_0xe885('0x1b')](function(_0x4375ff){logger[_0xe885('0x12')](_0xe885('0x15'),_0x4375ff[_0xe885('0x14')],_0x25a002);_0x39f07c(_0x365eab[_0xe885('0x12')](0x1f4,_0x4375ff['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index fac8496..1331644 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x272552,_0x33ead2){_0x272552=_0x272552-0x0;var _0xb5ee17=_0xdb28[_0x272552];return _0xb5ee17;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x34a500,_0x5f552d){_0x34a500=_0x34a500-0x0;var _0x35e3cd=_0xdb28[_0x34a500];return _0x35e3cd;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 256b378..ca3c50a 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 _0x94d8=['emails','value','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map'];(function(_0x47aa77,_0x3acabd){var _0x3b61e3=function(_0x4ae902){while(--_0x4ae902){_0x47aa77['push'](_0x47aa77['shift']());}};_0x3b61e3(++_0x3acabd);}(_0x94d8,0x1a1));var _0x894d=function(_0x5f5b8f,_0x5cd86e){_0x5f5b8f=_0x5f5b8f-0x0;var _0x55d65b=_0x94d8[_0x5f5b8f];return _0x55d65b;};'use strict';var _=require('lodash');var passport=require(_0x894d('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x894d('0x1')];var moment=require(_0x894d('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x894d('0x3'));var signToken=require(_0x894d('0x4'))['signToken'];var utils=require(_0x894d('0x5'));exports['login']=passport[_0x894d('0x6')](_0x894d('0x7'),{'failureRedirect':'/login','scope':[_0x894d('0x8'),_0x894d('0x9')],'session':![]});exports[_0x894d('0xa')]=passport[_0x894d('0x6')](_0x894d('0x7'),{'failureRedirect':_0x894d('0xb'),'session':![]});passport[_0x894d('0xc')](new GoogleStrategy({'clientID':config[_0x894d('0x7')]?config[_0x894d('0x7')][_0x894d('0xd')]:'id','clientSecret':config[_0x894d('0x7')]?config['google'][_0x894d('0xe')]:_0x894d('0xf'),'callbackURL':config['google']?config[_0x894d('0x7')][_0x894d('0x10')]:''},function(_0x10179a,_0x1b4f21,_0x37685d,_0x53fb0a){var _0x21771b,_0x344024;return db[_0x894d('0x11')][_0x894d('0x12')]({'where':{'id':0x1},'attributes':[_0x894d('0x13'),_0x894d('0x14')],'raw':!![]})[_0x894d('0x15')](function(_0xc8d3e1){_0x21771b=_0xc8d3e1;return db[_0x894d('0x16')][_0x894d('0x17')]({'where':{'email':_[_0x894d('0x18')](_0x37685d[_0x894d('0x19')],_0x894d('0x1a')),'role':{'$or':['admin','user',_0x894d('0x1b')]}}});})[_0x894d('0x15')](function(_0x5262f8){_0x344024=_0x5262f8;if(_0x344024){if(_0x344024[_0x894d('0x1c')]){return _0x53fb0a(_0x894d('0x1d'));}else if(_0x21771b[_0x894d('0x14')]>0x0){if(_0x344024['blocked']){if(moment(_0x344024['blockedAt'])['add'](_0x21771b[_0x894d('0x14')],_0x894d('0x1e'))>moment()){return _0x53fb0a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x894d('0x1f')](_0x344024,0x0,![],null)[_0x894d('0x15')](function(){return utils[_0x894d('0x20')](_0x344024);})['then'](function(){return _0x53fb0a(null,_0x344024);});}}else{return utils[_0x894d('0x20')](_0x344024)[_0x894d('0x15')](function(){return _0x53fb0a(null,_0x344024);});}}else{return utils[_0x894d('0x20')](_0x344024)[_0x894d('0x15')](function(){return _0x53fb0a(null,_0x344024);});}}return _0x53fb0a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x894d('0x21')](function(_0x49b074){_0x53fb0a(_0x49b074);});})); \ No newline at end of file +var _0x0c51=['clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','find','map','emails','value','admin','user','agent','disabled','blockedAt','add','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','profile','email','callback','authenticate','use','clientID'];(function(_0x5a4174,_0x385b2c){var _0x268e69=function(_0x2bdd84){while(--_0x2bdd84){_0x5a4174['push'](_0x5a4174['shift']());}};_0x268e69(++_0x385b2c);}(_0x0c51,0x1ea));var _0x10c5=function(_0x2765bd,_0x2ecfdb){_0x2765bd=_0x2765bd-0x0;var _0x27baac=_0x0c51[_0x2765bd];return _0x27baac;};'use strict';var _=require(_0x10c5('0x0'));var passport=require(_0x10c5('0x1'));var GoogleStrategy=require(_0x10c5('0x2'))['Strategy'];var moment=require(_0x10c5('0x3'));var db=require(_0x10c5('0x4'))['db'];var config=require(_0x10c5('0x5'));var signToken=require(_0x10c5('0x6'))[_0x10c5('0x7')];var utils=require(_0x10c5('0x8'));exports[_0x10c5('0x9')]=passport['authenticate'](_0x10c5('0xa'),{'failureRedirect':'/login','scope':[_0x10c5('0xb'),_0x10c5('0xc')],'session':![]});exports[_0x10c5('0xd')]=passport[_0x10c5('0xe')](_0x10c5('0xa'),{'failureRedirect':'/login','session':![]});passport[_0x10c5('0xf')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x10c5('0x10')]:'id','clientSecret':config[_0x10c5('0xa')]?config[_0x10c5('0xa')][_0x10c5('0x11')]:_0x10c5('0x12'),'callbackURL':config[_0x10c5('0xa')]?config[_0x10c5('0xa')][_0x10c5('0x13')]:''},function(_0xc54e42,_0x2a2c29,_0x50b25b,_0x2ecc61){var _0x2d8baa,_0xaff662;return db[_0x10c5('0x14')][_0x10c5('0x15')]({'where':{'id':0x1},'attributes':[_0x10c5('0x16'),'blockDuration'],'raw':!![]})[_0x10c5('0x17')](function(_0x350ee6){_0x2d8baa=_0x350ee6;return db['User'][_0x10c5('0x18')]({'where':{'email':_[_0x10c5('0x19')](_0x50b25b[_0x10c5('0x1a')],_0x10c5('0x1b')),'role':{'$or':[_0x10c5('0x1c'),_0x10c5('0x1d'),_0x10c5('0x1e')]}}});})['then'](function(_0x402b6c){_0xaff662=_0x402b6c;if(_0xaff662){if(_0xaff662[_0x10c5('0x1f')]){return _0x2ecc61('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2d8baa['blockDuration']>0x0){if(_0xaff662['blocked']){if(moment(_0xaff662[_0x10c5('0x20')])[_0x10c5('0x21')](_0x2d8baa[_0x10c5('0x22')],_0x10c5('0x23'))>moment()){return _0x2ecc61(_0x10c5('0x24'));}else{return utils[_0x10c5('0x25')](_0xaff662,0x0,![],null)[_0x10c5('0x17')](function(){return utils[_0x10c5('0x26')](_0xaff662);})[_0x10c5('0x17')](function(){return _0x2ecc61(null,_0xaff662);});}}else{return utils[_0x10c5('0x26')](_0xaff662)[_0x10c5('0x17')](function(){return _0x2ecc61(null,_0xaff662);});}}else{return utils['getLicense'](_0xaff662)[_0x10c5('0x17')](function(){return _0x2ecc61(null,_0xaff662);});}}return _0x2ecc61(_0x10c5('0x24'));})['catch'](function(_0x38ca24){_0x2ecc61(_0x38ca24);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 185c997..34b88e7 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 _0x9f61=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie'];(function(_0x4a86f3,_0x39648c){var _0x25c727=function(_0xe70b2c){while(--_0xe70b2c){_0x4a86f3['push'](_0x4a86f3['shift']());}};_0x25c727(++_0x39648c);}(_0x9f61,0x1c3));var _0x19f6=function(_0x282757,_0x1e94de){_0x282757=_0x282757-0x0;var _0x14e027=_0x9f61[_0x282757];return _0x14e027;};'use strict';var express=require(_0x19f6('0x0'));var passport=require(_0x19f6('0x1'));var router=express[_0x19f6('0x2')]();var controller=require(_0x19f6('0x3'));var userController=require(_0x19f6('0x4'));var authService=require(_0x19f6('0x5'));router[_0x19f6('0x6')]('/',controller[_0x19f6('0x7')]);router[_0x19f6('0x6')](_0x19f6('0x8'),controller['callback'],authService[_0x19f6('0x9')],userController[_0x19f6('0x7')],authService[_0x19f6('0xa')]);module['exports']=router; \ No newline at end of file +var _0xf963=['get','login','/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','../user/user.controller.js'];(function(_0x1a06ca,_0xb59800){var _0x362f2a=function(_0xf2b42d){while(--_0xf2b42d){_0x1a06ca['push'](_0x1a06ca['shift']());}};_0x362f2a(++_0xb59800);}(_0xf963,0x133));var _0x3f96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf963[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var passport=require(_0x3f96('0x0'));var router=express[_0x3f96('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x3f96('0x2'));var authService=require('../../components/auth/service');router[_0x3f96('0x3')]('/',controller[_0x3f96('0x4')]);router[_0x3f96('0x3')](_0x3f96('0x5'),controller[_0x3f96('0x6')],authService[_0x3f96('0x7')],userController[_0x3f96('0x4')],authService[_0x3f96('0x8')]);module[_0x3f96('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 02e7cc5..b3502af 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 _0x1575=['service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','allowedLoginAttempts','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp'];(function(_0x4f2350,_0x45bbf1){var _0x27c222=function(_0x404ebe){while(--_0x404ebe){_0x4f2350['push'](_0x4f2350['shift']());}};_0x27c222(++_0x45bbf1);}(_0x1575,0x190));var _0x5157=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x1575[_0x272638];return _0x19d027;};'use strict';var util=require(_0x5157('0x0'));var passport=require(_0x5157('0x1'));var LocalStrategy=require(_0x5157('0x2'))[_0x5157('0x3')];var jayson=require(_0x5157('0x4'));var _=require(_0x5157('0x5'));var rs=require(_0x5157('0x6'));var moment=require('moment');var db=require(_0x5157('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x5157('0x8'));var client=jayson[_0x5157('0x9')]['http']({'port':0x232b});function localAuthenticate(_0xdd370b,_0x321a4b,_0x4670d5,_0x10d01f){var _0x1aa7f4,_0x29ae19;return db[_0x5157('0xa')][_0x5157('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5157('0xc')],'raw':!![]})[_0x5157('0xd')](function(_0x2081c2){_0x1aa7f4=_0x2081c2;return _0xdd370b['findOne']({'attributes':['id',_0x5157('0xe'),_0x5157('0xf'),_0x5157('0x10'),_0x5157('0x11'),_0x5157('0x12'),_0x5157('0x13'),'blockedAt',_0x5157('0x14')],'where':{'name':_0x321a4b,'role':{'$or':[_0x5157('0x15'),_0x5157('0x16'),_0x5157('0x17')]}}});})[_0x5157('0xd')](function(_0x1d4bfc){if(!_0x1d4bfc||_0x1d4bfc&&_0x1d4bfc[_0x5157('0xe')]!==_0x321a4b){throw new Error(_0x5157('0x18'));}else{_0x29ae19=_0x1d4bfc;return _0x29ae19;}})[_0x5157('0xd')](function(){_0x29ae19[_0x5157('0x19')](_0x4670d5,function(_0x40a027,_0x29236a){var _0x18fa03=_0x29ae19[_0x5157('0x14')]+0x1;if(_0x40a027){return _0x10d01f(_0x40a027);}else if(!_0x29236a){if(_0x29ae19[_0x5157('0x12')]){return _0x10d01f(null,![],{'message':_0x5157('0x18')});}else if(_0x1aa7f4['allowedLoginAttempts']>0x0){if(_0x29ae19[_0x5157('0x13')]){if(_0x1aa7f4[_0x5157('0xc')]>0x0){if(moment(_0x29ae19[_0x5157('0x1a')])[_0x5157('0x1b')](_0x1aa7f4[_0x5157('0xc')],_0x5157('0x1c'))>moment()){return _0x10d01f(null,![],{'message':_0x5157('0x18')});}else{return utils[_0x5157('0x1d')](_0x29ae19,_0x18fa03,![],null)[_0x5157('0xd')](function(){return _0x10d01f(null,![],{'message':_0x5157('0x18')});});}}else{return _0x10d01f(null,![],{'message':_0x5157('0x18')});}}else{if(_0x18fa03>=_0x1aa7f4['allowedLoginAttempts']){return utils['clearBlockUser'](_0x29ae19,0x0,!![],moment())[_0x5157('0xd')](function(){return _0x10d01f(null,![],{'message':_0x5157('0x18')});});}else{return utils[_0x5157('0x1d')](_0x29ae19,_0x18fa03,![],null)[_0x5157('0xd')](function(){return _0x10d01f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x10d01f(null,![],{'message':_0x5157('0x18')});}}else{if(_0x29ae19[_0x5157('0x12')]){return _0x10d01f(null,![],{'message':_0x5157('0x18')});}else if(_0x1aa7f4['allowedLoginAttempts']>0x0){if(_0x29ae19[_0x5157('0x13')]){if(_0x1aa7f4[_0x5157('0xc')]>0x0){if(moment(_0x29ae19[_0x5157('0x1a')])['add'](_0x1aa7f4['blockDuration'],'minutes')>moment()){return _0x10d01f(null,![],{'message':_0x5157('0x18')});}else{return utils['clearBlockUser'](_0x29ae19,0x0,![],null)[_0x5157('0xd')](function(){return utils[_0x5157('0x1e')](_0x29ae19);})['then'](function(){return _0x10d01f(null,_0x29ae19);});}}else{return _0x10d01f(null,![],{'message':_0x5157('0x18')});}}else{return utils[_0x5157('0x1d')](_0x29ae19,0x0,![],null)['then'](function(){return utils[_0x5157('0x1e')](_0x29ae19);})['then'](function(){return _0x10d01f(null,_0x29ae19);})['catch'](function(_0x170dfe){return _0x10d01f(null,![],_0x170dfe);});}}else{if(_0x29ae19[_0x5157('0x13')]){return _0x10d01f(null,![],{'message':_0x5157('0x18')});}else{return utils[_0x5157('0x1e')](_0x29ae19)[_0x5157('0xd')](function(){return _0x10d01f(null,_0x29ae19);});}}}});})['catch'](function(_0x15dd4a){return _0x10d01f(null,![],_0x15dd4a);});}function sendServiceMail(_0x45f4f5){return db['MailAccount'][_0x5157('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x5157('0x20')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x5157('0xd')](function(_0x4214fd){if(!_0x4214fd){throw new Error(_0x5157('0x21'));}var _0x9a6a89={'tls':{'rejectUnauthorized':![]}};if(_0x4214fd[_0x5157('0x22')][_0x5157('0x23')]){_0x9a6a89[_0x5157('0x23')]=_0x4214fd['Smtp'][_0x5157('0x23')];}else{_0x9a6a89[_0x5157('0x24')]=_0x4214fd[_0x5157('0x22')][_0x5157('0x24')];_0x9a6a89['port']=_0x4214fd[_0x5157('0x22')][_0x5157('0x25')];_0x9a6a89[_0x5157('0x26')]=_0x4214fd[_0x5157('0x22')]['secure'];}if(_0x4214fd[_0x5157('0x22')][_0x5157('0x27')]){_0x9a6a89[_0x5157('0x28')]={'user':_0x4214fd[_0x5157('0x22')]['user'],'pass':_0x4214fd['Smtp'][_0x5157('0x29')]};}var _0xca7413={'account':_0x9a6a89,'message':_[_0x5157('0x2a')]({'from':util[_0x5157('0x2b')]('\x22%s\x22\x20<%s>',_0x4214fd[_0x5157('0xe')],_0x4214fd[_0x5157('0x20')]||_0x4214fd['Smtp'][_0x5157('0x16')])},_0x45f4f5)};return client[_0x5157('0x2c')](_0x5157('0x2d'),_0xca7413);})['then'](function(_0x4b5ce6){if(_0x4b5ce6[_0x5157('0x2e')]){throw new Error(util['format'](_0x5157('0x2f'),_0x4b5ce6[_0x5157('0x2e')][_0x5157('0x30')]||JSON[_0x5157('0x31')](_0x4b5ce6[_0x5157('0x2e')])));}return!![];});}function handleError(_0x188ef5,_0xc429d3,_0x14a4bd){return _0x188ef5[_0x5157('0x32')](_0xc429d3||0x1f4)[_0x5157('0x33')]({'message':_0x14a4bd?_0x14a4bd[_0x5157('0x30')]||_0x14a4bd:''});}exports['login']=function(_0x3cc69f,_0x1950fc,_0x39fc2a){passport['authenticate'](_0x5157('0x34'),function(_0x33f6c2,_0x1aa506,_0x91339d){var _0x3d53fe=_0x33f6c2||_0x91339d;if(_0x3d53fe){return handleError(_0x1950fc,0x191,_0x3d53fe);}if(!_0x1aa506){return handleError(_0x1950fc,0x194,{'message':_0x5157('0x35')});}else{var _0x17d752={'payload':{'id':_0x1aa506['id'],'role':_0x1aa506['role']},'options':{'expiresIn':0x15180}};return authService[_0x5157('0x36')](_0x17d752)[_0x5157('0xd')](function(_0x35bfb7){_0x1950fc['json']({'id':_0x1aa506['id'],'token':_0x35bfb7,'statusCall':'','isAlreadyLogged':_0x1aa506[_0x5157('0x37')]});});}})(_0x3cc69f,_0x1950fc,_0x39fc2a);};exports[_0x5157('0x38')]=function(_0xc8792a,_0x87e1df,_0x27378a){if(!_0xc8792a[_0x5157('0x39')][_0x5157('0x20')]){return handleError(_0x87e1df,0x1f4,{'message':_0x5157('0x3a')});}var _0x360504=rs[_0x5157('0x3b')]();_0xc8792a[_0x5157('0x39')]['email']=_0xc8792a['body'][_0x5157('0x20')][_0x5157('0x3c')]()['toLowerCase']();var _0x15fe8f;return db[_0x5157('0xa')][_0x5157('0xb')]({'where':{'id':0x1},'attributes':[_0x5157('0x3d'),_0x5157('0xc')],'raw':!![]})[_0x5157('0xd')](function(_0x4d8ffe){_0x15fe8f=_0x4d8ffe;return db['User'][_0x5157('0x1f')]({'where':{'email':_0xc8792a['body'][_0x5157('0x20')]}});})[_0x5157('0xd')](function(_0x210560){if(!_0x210560){throw new Error(_0x5157('0x3e'));}if(_0x210560['disabled']){throw new Error(_0x5157('0x3f'));}if(_0x210560['blocked']){if(moment(_0x210560['blockedAt'])[_0x5157('0x1b')](_0x15fe8f[_0x5157('0xc')],_0x5157('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x210560[_0x5157('0x13')]=![];_0x210560[_0x5157('0x1a')]=null;}}_0x210560[_0x5157('0x40')]=_0x360504;_0x210560[_0x5157('0x41')]=Date[_0x5157('0x42')]()+0x36ee80;return _0x210560[_0x5157('0x43')]();})['then'](function(){return sendServiceMail({'to':_0xc8792a[_0x5157('0x39')][_0x5157('0x20')],'subject':_0x5157('0x44'),'text':_0x5157('0x45')+_0x5157('0x46')+'https://'+_0xc8792a[_0x5157('0x47')][_0x5157('0x24')]+_0x5157('0x48')+_0x360504+'\x0a\x0a'+_0x5157('0x49')});})[_0x5157('0xd')](function(){_0x87e1df[_0x5157('0x32')](0xc8)[_0x5157('0x33')]({'message':_0x5157('0x4a')});})[_0x5157('0x4b')](function(_0x1c2ded){return handleError(_0x87e1df,0x1f4,_0x1c2ded);});};exports['reset']=function(_0x5558e3,_0x1f6535,_0x519db5){return db[_0x5157('0x4c')][_0x5157('0x1f')]({'where':{'resetPasswordToken':_0x5558e3[_0x5157('0x4d')][_0x5157('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x5157('0x42')]()}}})[_0x5157('0xd')](function(_0x50c768){if(!_0x50c768){throw new Error(_0x5157('0x4f'));}return db[_0x5157('0xa')][_0x5157('0xb')]({'attributes':['id',_0x5157('0x50'),'enforcePasswordHistory',_0x5157('0x51')]})[_0x5157('0xd')](function(_0x4ea9de){if(_0x4ea9de[_0x5157('0x50')])authService[_0x5157('0x52')](_0x5558e3[_0x5157('0x39')][_0x5157('0xf')]);if(!_0x4ea9de[_0x5157('0x53')]||!_0x50c768['previousPasswords'])return _0x50c768;authService[_0x5157('0x54')](_0x5558e3[_0x5157('0x39')]['password'],_0x50c768[_0x5157('0x55')],_0x4ea9de[_0x5157('0x51')]);return _0x50c768;})['then'](function(){_0x50c768[_0x5157('0xf')]=_0x5558e3[_0x5157('0x39')][_0x5157('0xf')];_0x50c768[_0x5157('0x40')]=null;_0x50c768[_0x5157('0x41')]=null;return _0x50c768[_0x5157('0x43')]();});})[_0x5157('0xd')](function(){_0x1f6535[_0x5157('0x32')](0xc8)[_0x5157('0x33')]({'message':'Password\x20reset!'});})[_0x5157('0x4b')](function(_0x45193b){return handleError(_0x1f6535,0x1f4,_0x45193b);});};passport[_0x5157('0x56')](new LocalStrategy({'usernameField':'name','passwordField':_0x5157('0xf')},function(_0x18015d,_0x14243d,_0xb60e20){return localAuthenticate(db[_0x5157('0x4c')],_0x18015d,_0x14243d,_0xb60e20);})); \ No newline at end of file +var _0x2948=['auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','headers','/reset/','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','resetPasswordToken','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','http','Setting','findOne','blockDuration','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','Smtp','secure','authentication'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x2948,0xcb));var _0x8294=function(_0x272cdb,_0xbe1256){_0x272cdb=_0x272cdb-0x0;var _0x3f05d1=_0x2948[_0x272cdb];return _0x3f05d1;};'use strict';var util=require(_0x8294('0x0'));var passport=require(_0x8294('0x1'));var LocalStrategy=require(_0x8294('0x2'))[_0x8294('0x3')];var jayson=require(_0x8294('0x4'));var _=require(_0x8294('0x5'));var rs=require(_0x8294('0x6'));var moment=require(_0x8294('0x7'));var db=require(_0x8294('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x8294('0x9'));var client=jayson['client'][_0x8294('0xa')]({'port':0x232b});function localAuthenticate(_0x26128c,_0x39aa65,_0x514609,_0x5a7135){var _0x56f7c8,_0x530786;return db[_0x8294('0xb')][_0x8294('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8294('0xd')],'raw':!![]})[_0x8294('0xe')](function(_0x266d88){_0x56f7c8=_0x266d88;return _0x26128c[_0x8294('0xc')]({'attributes':['id',_0x8294('0xf'),_0x8294('0x10'),'salt',_0x8294('0x11'),_0x8294('0x12'),_0x8294('0x13'),_0x8294('0x14'),_0x8294('0x15')],'where':{'name':_0x39aa65,'role':{'$or':[_0x8294('0x16'),_0x8294('0x17'),_0x8294('0x18')]}}});})['then'](function(_0x3a3352){if(!_0x3a3352||_0x3a3352&&_0x3a3352[_0x8294('0xf')]!==_0x39aa65){throw new Error(_0x8294('0x19'));}else{_0x530786=_0x3a3352;return _0x530786;}})['then'](function(){_0x530786['authenticate'](_0x514609,function(_0x4e3369,_0x19295d){var _0x1bccf6=_0x530786[_0x8294('0x15')]+0x1;if(_0x4e3369){return _0x5a7135(_0x4e3369);}else if(!_0x19295d){if(_0x530786[_0x8294('0x12')]){return _0x5a7135(null,![],{'message':_0x8294('0x19')});}else if(_0x56f7c8[_0x8294('0x1a')]>0x0){if(_0x530786[_0x8294('0x13')]){if(_0x56f7c8[_0x8294('0xd')]>0x0){if(moment(_0x530786[_0x8294('0x14')])[_0x8294('0x1b')](_0x56f7c8[_0x8294('0xd')],'minutes')>moment()){return _0x5a7135(null,![],{'message':_0x8294('0x19')});}else{return utils['clearBlockUser'](_0x530786,_0x1bccf6,![],null)[_0x8294('0xe')](function(){return _0x5a7135(null,![],{'message':_0x8294('0x19')});});}}else{return _0x5a7135(null,![],{'message':_0x8294('0x19')});}}else{if(_0x1bccf6>=_0x56f7c8[_0x8294('0x1a')]){return utils[_0x8294('0x1c')](_0x530786,0x0,!![],moment())[_0x8294('0xe')](function(){return _0x5a7135(null,![],{'message':_0x8294('0x19')});});}else{return utils[_0x8294('0x1c')](_0x530786,_0x1bccf6,![],null)[_0x8294('0xe')](function(){return _0x5a7135(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5a7135(null,![],{'message':_0x8294('0x19')});}}else{if(_0x530786[_0x8294('0x12')]){return _0x5a7135(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56f7c8[_0x8294('0x1a')]>0x0){if(_0x530786[_0x8294('0x13')]){if(_0x56f7c8[_0x8294('0xd')]>0x0){if(moment(_0x530786[_0x8294('0x14')])[_0x8294('0x1b')](_0x56f7c8[_0x8294('0xd')],_0x8294('0x1d'))>moment()){return _0x5a7135(null,![],{'message':_0x8294('0x19')});}else{return utils[_0x8294('0x1c')](_0x530786,0x0,![],null)[_0x8294('0xe')](function(){return utils[_0x8294('0x1e')](_0x530786);})['then'](function(){return _0x5a7135(null,_0x530786);});}}else{return _0x5a7135(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8294('0x1c')](_0x530786,0x0,![],null)['then'](function(){return utils[_0x8294('0x1e')](_0x530786);})['then'](function(){return _0x5a7135(null,_0x530786);})['catch'](function(_0x37601e){return _0x5a7135(null,![],_0x37601e);});}}else{if(_0x530786[_0x8294('0x13')]){return _0x5a7135(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8294('0x1e')](_0x530786)[_0x8294('0xe')](function(){return _0x5a7135(null,_0x530786);});}}}});})[_0x8294('0x1f')](function(_0x1f00b6){return _0x5a7135(null,![],_0x1f00b6);});}function sendServiceMail(_0x58c4d2){return db['MailAccount'][_0x8294('0x20')]({'where':{'service':!![]},'attributes':['id',_0x8294('0xf'),_0x8294('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x8294('0xe')](function(_0x45072c){if(!_0x45072c){throw new Error(_0x8294('0x22'));}var _0x4925e0={'tls':{'rejectUnauthorized':![]}};if(_0x45072c['Smtp'][_0x8294('0x23')]){_0x4925e0[_0x8294('0x23')]=_0x45072c['Smtp'][_0x8294('0x23')];}else{_0x4925e0[_0x8294('0x24')]=_0x45072c['Smtp'][_0x8294('0x24')];_0x4925e0['port']=_0x45072c[_0x8294('0x25')]['port'];_0x4925e0[_0x8294('0x26')]=_0x45072c[_0x8294('0x25')][_0x8294('0x26')];}if(_0x45072c[_0x8294('0x25')][_0x8294('0x27')]){_0x4925e0[_0x8294('0x28')]={'user':_0x45072c[_0x8294('0x25')]['user'],'pass':_0x45072c[_0x8294('0x25')][_0x8294('0x29')]};}var _0x26e29a={'account':_0x4925e0,'message':_['merge']({'from':util[_0x8294('0x2a')](_0x8294('0x2b'),_0x45072c[_0x8294('0xf')],_0x45072c['email']||_0x45072c['Smtp'][_0x8294('0x17')])},_0x58c4d2)};return client[_0x8294('0x2c')](_0x8294('0x2d'),_0x26e29a);})[_0x8294('0xe')](function(_0x9b3ea8){if(_0x9b3ea8[_0x8294('0x2e')]){throw new Error(util[_0x8294('0x2a')](_0x8294('0x2f'),_0x9b3ea8[_0x8294('0x2e')]['message']||JSON[_0x8294('0x30')](_0x9b3ea8[_0x8294('0x2e')])));}return!![];});}function handleError(_0x49c90d,_0xbf910,_0x8ad38c){return _0x49c90d[_0x8294('0x31')](_0xbf910||0x1f4)[_0x8294('0x32')]({'message':_0x8ad38c?_0x8ad38c['message']||_0x8ad38c:''});}exports[_0x8294('0x33')]=function(_0x2991f7,_0x39ee6d,_0x19f86a){passport[_0x8294('0x34')](_0x8294('0x35'),function(_0x497481,_0x5e0ebe,_0x1fe795){var _0x4bac0b=_0x497481||_0x1fe795;if(_0x4bac0b){return handleError(_0x39ee6d,0x191,_0x4bac0b);}if(!_0x5e0ebe){return handleError(_0x39ee6d,0x194,{'message':_0x8294('0x36')});}else{var _0x197c9={'payload':{'id':_0x5e0ebe['id'],'role':_0x5e0ebe['role']},'options':{'expiresIn':0x15180}};return authService[_0x8294('0x37')](_0x197c9)[_0x8294('0xe')](function(_0x1e07f9){_0x39ee6d[_0x8294('0x38')]({'id':_0x5e0ebe['id'],'token':_0x1e07f9,'statusCall':'','isAlreadyLogged':_0x5e0ebe[_0x8294('0x39')]});});}})(_0x2991f7,_0x39ee6d,_0x19f86a);};exports[_0x8294('0x3a')]=function(_0x3cd9d2,_0xdff80,_0x359e23){if(!_0x3cd9d2[_0x8294('0x3b')][_0x8294('0x21')]){return handleError(_0xdff80,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x43f655=rs[_0x8294('0x3c')]();_0x3cd9d2[_0x8294('0x3b')]['email']=_0x3cd9d2[_0x8294('0x3b')]['email'][_0x8294('0x3d')]()['toLowerCase']();var _0x5e0cbd;return db[_0x8294('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x8294('0x1a'),'blockDuration'],'raw':!![]})[_0x8294('0xe')](function(_0x540d3d){_0x5e0cbd=_0x540d3d;return db[_0x8294('0x3e')][_0x8294('0x20')]({'where':{'email':_0x3cd9d2[_0x8294('0x3b')]['email']}});})[_0x8294('0xe')](function(_0xcee39){if(!_0xcee39){throw new Error(_0x8294('0x3f'));}if(_0xcee39['disabled']){throw new Error(_0x8294('0x40'));}if(_0xcee39[_0x8294('0x13')]){if(moment(_0xcee39['blockedAt'])[_0x8294('0x1b')](_0x5e0cbd[_0x8294('0xd')],_0x8294('0x1d'))>moment()){throw new Error(_0x8294('0x41'));}else{_0xcee39[_0x8294('0x13')]=![];_0xcee39[_0x8294('0x14')]=null;}}_0xcee39['resetPasswordToken']=_0x43f655;_0xcee39[_0x8294('0x42')]=Date['now']()+0x36ee80;return _0xcee39[_0x8294('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x3cd9d2[_0x8294('0x3b')][_0x8294('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x3cd9d2[_0x8294('0x44')][_0x8294('0x24')]+_0x8294('0x45')+_0x43f655+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x8294('0xe')](function(){_0xdff80[_0x8294('0x31')](0xc8)[_0x8294('0x32')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x358aa7){return handleError(_0xdff80,0x1f4,_0x358aa7);});};exports[_0x8294('0x46')]=function(_0x35285b,_0x2aa43c,_0x479478){return db[_0x8294('0x3e')][_0x8294('0x20')]({'where':{'resetPasswordToken':_0x35285b[_0x8294('0x47')][_0x8294('0x48')],'resetPasswordExpires':{'$gt':Date[_0x8294('0x49')]()}}})[_0x8294('0xe')](function(_0x498ff7){if(!_0x498ff7){throw new Error(_0x8294('0x4a'));}return db['Setting'][_0x8294('0xc')]({'attributes':['id',_0x8294('0x4b'),_0x8294('0x4c'),_0x8294('0x4d')]})[_0x8294('0xe')](function(_0x57a4a7){if(_0x57a4a7[_0x8294('0x4b')])authService[_0x8294('0x4e')](_0x35285b['body']['password']);if(!_0x57a4a7['enforcePasswordHistory']||!_0x498ff7['previousPasswords'])return _0x498ff7;authService['validatePasswordHistory'](_0x35285b[_0x8294('0x3b')][_0x8294('0x10')],_0x498ff7['previousPasswords'],_0x57a4a7[_0x8294('0x4d')]);return _0x498ff7;})['then'](function(){_0x498ff7[_0x8294('0x10')]=_0x35285b['body']['password'];_0x498ff7[_0x8294('0x4f')]=null;_0x498ff7[_0x8294('0x42')]=null;return _0x498ff7[_0x8294('0x43')]();});})[_0x8294('0xe')](function(){_0x2aa43c['status'](0xc8)['send']({'message':_0x8294('0x50')});})[_0x8294('0x1f')](function(_0xab6cb6){return handleError(_0x2aa43c,0x1f4,_0xab6cb6);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x8294('0x10')},function(_0x208247,_0x1cb7ef,_0x367850){return localAuthenticate(db[_0x8294('0x3e')],_0x208247,_0x1cb7ef,_0x367850);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 318fca8..b69a3a6 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 _0x69fa=['login','forgot','reset','exports','express','Router','post'];(function(_0x333fed,_0x3d2122){var _0x12cac2=function(_0x41d9af){while(--_0x41d9af){_0x333fed['push'](_0x333fed['shift']());}};_0x12cac2(++_0x3d2122);}(_0x69fa,0x1bd));var _0xa69f=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0x69fa[_0x285c85];return _0x2f81cd;};'use strict';var express=require(_0xa69f('0x0'));var router=express[_0xa69f('0x1')]();var controller=require('./authLocal.controller');router[_0xa69f('0x2')]('/',controller[_0xa69f('0x3')]);router['post']('/forgot',controller[_0xa69f('0x4')]);router[_0xa69f('0x2')]('/reset/:token',controller[_0xa69f('0x5')]);module[_0xa69f('0x6')]=router; \ No newline at end of file +var _0x5890=['post','login','/forgot','/reset/:token','reset','exports','express','Router'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x5890,0x17e));var _0x0589=function(_0x28b35c,_0x250437){_0x28b35c=_0x28b35c-0x0;var _0x39a972=_0x5890[_0x28b35c];return _0x39a972;};'use strict';var express=require(_0x0589('0x0'));var router=express[_0x0589('0x1')]();var controller=require('./authLocal.controller');router[_0x0589('0x2')]('/',controller[_0x0589('0x3')]);router[_0x0589('0x2')](_0x0589('0x4'),controller['forgot']);router[_0x0589('0x2')](_0x0589('0x5'),controller[_0x0589('0x6')]);module[_0x0589('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 89170ec..2bc5c18 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 _0x4382=['sequelize','exports','STRING'];(function(_0xc3ed1e,_0x529a84){var _0x2c8167=function(_0x2caaa0){while(--_0x2caaa0){_0xc3ed1e['push'](_0xc3ed1e['shift']());}};_0x2c8167(++_0x529a84);}(_0x4382,0x1e9));var _0x2438=function(_0x3a7fb2,_0x803bc1){_0x3a7fb2=_0x3a7fb2-0x0;var _0x1eea8e=_0x4382[_0x3a7fb2];return _0x1eea8e;};'use strict';var Sequelize=require(_0x2438('0x0'));module[_0x2438('0x1')]={'name':{'type':Sequelize[_0x2438('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2438('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x50c2=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50c2,0x1da));var _0x250c=function(_0x54e430,_0x2d71b9){_0x54e430=_0x54e430-0x0;var _0x12319c=_0x50c2[_0x54e430];return _0x12319c;};'use strict';var Sequelize=require('sequelize');module[_0x250c('0x0')]={'name':{'type':Sequelize[_0x250c('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x250c('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x250c('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 8221a4e..5b7f5a6 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 _0xb689=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','Automation','includeAll','include','rows','catch','show','params','find','create','body','update','addConditions','getConditions','findOne','addActions','Action','ids','omit','getActions','order','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','stack','name','send','rawAttributes','fieldName','type','model','keys','query'];(function(_0x4b2820,_0x3bd667){var _0x5b7712=function(_0x2ac4fe){while(--_0x2ac4fe){_0x4b2820['push'](_0x4b2820['shift']());}};_0x5b7712(++_0x3bd667);}(_0xb689,0xb8));var _0x9b68=function(_0x6a8b2d,_0x5df400){_0x6a8b2d=_0x6a8b2d-0x0;var _0x21ac8b=_0xb689[_0x6a8b2d];return _0x21ac8b;};'use strict';var emlformat=require(_0x9b68('0x0'));var rimraf=require(_0x9b68('0x1'));var zipdir=require(_0x9b68('0x2'));var jsonpatch=require(_0x9b68('0x3'));var rp=require(_0x9b68('0x4'));var moment=require('moment');var BPromise=require(_0x9b68('0x5'));var Mustache=require(_0x9b68('0x6'));var util=require('util');var path=require(_0x9b68('0x7'));var sox=require(_0x9b68('0x8'));var csv=require('to-csv');var ejs=require(_0x9b68('0x9'));var fs=require('fs');var fs_extra=require(_0x9b68('0xa'));var _=require('lodash');var squel=require(_0x9b68('0xb'));var crypto=require(_0x9b68('0xc'));var jsforce=require(_0x9b68('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9b68('0xe'));var Papa=require(_0x9b68('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9b68('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9b68('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x9b68('0x12'));var db=require(_0x9b68('0x13'))['db'];function respondWithStatusCode(_0x242484,_0x2f8a19){_0x2f8a19=_0x2f8a19||0xcc;return function(_0x575e73){if(_0x575e73){return _0x242484['sendStatus'](_0x2f8a19);}return _0x242484[_0x9b68('0x14')](_0x2f8a19)[_0x9b68('0x15')]();};}function respondWithResult(_0x2e2f4a,_0x3ab0ed){_0x3ab0ed=_0x3ab0ed||0xc8;return function(_0x51dd82){if(_0x51dd82){return _0x2e2f4a[_0x9b68('0x14')](_0x3ab0ed)[_0x9b68('0x16')](_0x51dd82);}};}function respondWithFilteredResult(_0x5c8f50,_0x12cde8){return function(_0x580613){if(_0x580613){var _0x4eac58=typeof _0x12cde8[_0x9b68('0x17')]===_0x9b68('0x18')&&typeof _0x12cde8['limit']===_0x9b68('0x18');var _0x1ce4e9=_0x580613[_0x9b68('0x19')];var _0x233848=_0x4eac58?0x0:_0x12cde8[_0x9b68('0x17')];var _0x59a1b3=_0x4eac58?_0x580613['count']:_0x12cde8['offset']+_0x12cde8[_0x9b68('0x1a')];var _0x45da7e;if(_0x59a1b3>=_0x1ce4e9){_0x59a1b3=_0x1ce4e9;_0x45da7e=0xc8;}else{_0x45da7e=0xce;}_0x5c8f50[_0x9b68('0x14')](_0x45da7e);return _0x5c8f50[_0x9b68('0x1b')]('Content-Range',_0x233848+'-'+_0x59a1b3+'/'+_0x1ce4e9)[_0x9b68('0x16')](_0x580613);}return null;};}function patchUpdates(_0x5b3157){return function(_0x11169e){try{jsonpatch[_0x9b68('0x1c')](_0x11169e,_0x5b3157,!![]);}catch(_0x1c738e){return BPromise['reject'](_0x1c738e);}return _0x11169e[_0x9b68('0x1d')]();};}function saveUpdates(_0x4a571b,_0x1cbe78){return function(_0x4f91c2){if(_0x4f91c2){return _0x4f91c2['update'](_0x4a571b)[_0x9b68('0x1e')](function(_0x10173b){return _0x10173b;});}return null;};}function removeEntity(_0xb60587,_0x2d1cff){return function(_0x27ab19){if(_0x27ab19){return _0x27ab19[_0x9b68('0x1f')]()[_0x9b68('0x1e')](function(){_0xb60587[_0x9b68('0x14')](0xcc)[_0x9b68('0x15')]();});}};}function handleEntityNotFound(_0x125082,_0x3d33c7){return function(_0x1ddf9c){if(!_0x1ddf9c){_0x125082['sendStatus'](0x194);}return _0x1ddf9c;};}function handleError(_0x2d7054,_0x586d45){_0x586d45=_0x586d45||0x1f4;return function(_0x381eb){logger['error'](_0x381eb[_0x9b68('0x20')]);if(_0x381eb['name']){delete _0x381eb[_0x9b68('0x21')];}_0x2d7054[_0x9b68('0x14')](_0x586d45)[_0x9b68('0x22')](_0x381eb);};}exports['index']=function(_0x3ef9e4,_0x5e0abd){var _0x106670={},_0x125848={},_0x5d9c8d={'count':0x0,'rows':[]};var _0x1055f4=_['map'](db['Automation'][_0x9b68('0x23')],function(_0x3e971b){return{'name':_0x3e971b[_0x9b68('0x24')],'type':_0x3e971b[_0x9b68('0x25')]['key']};});_0x125848[_0x9b68('0x26')]=_['map'](_0x1055f4,_0x9b68('0x21'));_0x125848['query']=_[_0x9b68('0x27')](_0x3ef9e4[_0x9b68('0x28')]);_0x125848[_0x9b68('0x29')]=_[_0x9b68('0x2a')](_0x125848[_0x9b68('0x26')],_0x125848[_0x9b68('0x28')]);_0x106670[_0x9b68('0x2b')]=_['intersection'](_0x125848[_0x9b68('0x26')],qs[_0x9b68('0x2c')](_0x3ef9e4[_0x9b68('0x28')]['fields']));_0x106670['attributes']=_0x106670[_0x9b68('0x2b')][_0x9b68('0x2d')]?_0x106670['attributes']:_0x125848[_0x9b68('0x26')];if(!_0x3ef9e4[_0x9b68('0x28')][_0x9b68('0x2e')](_0x9b68('0x2f'))){_0x106670[_0x9b68('0x1a')]=qs[_0x9b68('0x1a')](_0x3ef9e4[_0x9b68('0x28')][_0x9b68('0x1a')]);_0x106670[_0x9b68('0x17')]=qs[_0x9b68('0x17')](_0x3ef9e4['query'][_0x9b68('0x17')]);}_0x106670['order']=qs[_0x9b68('0x30')](_0x3ef9e4[_0x9b68('0x28')]['sort']);_0x106670[_0x9b68('0x31')]=qs[_0x9b68('0x29')](_[_0x9b68('0x32')](_0x3ef9e4[_0x9b68('0x28')],_0x125848[_0x9b68('0x29')]),_0x1055f4);if(_0x3ef9e4['query'][_0x9b68('0x33')]){_0x106670[_0x9b68('0x31')]=_[_0x9b68('0x34')](_0x106670['where'],{'$or':_['map'](_0x1055f4,function(_0x20f067){if(_0x20f067['type']!=='VIRTUAL'){var _0x7f7556={};_0x7f7556[_0x20f067[_0x9b68('0x21')]]={'$like':'%'+_0x3ef9e4[_0x9b68('0x28')]['filter']+'%'};return _0x7f7556;}})});}_0x106670=_['merge']({},_0x106670,_0x3ef9e4[_0x9b68('0x35')]);var _0x45bac9={'where':_0x106670[_0x9b68('0x31')]};return db[_0x9b68('0x36')]['count'](_0x45bac9)[_0x9b68('0x1e')](function(_0x948c3d){_0x5d9c8d[_0x9b68('0x19')]=_0x948c3d;if(_0x3ef9e4[_0x9b68('0x28')][_0x9b68('0x37')]){_0x106670[_0x9b68('0x38')]=[{'all':!![]}];}return db[_0x9b68('0x36')]['findAll'](_0x106670);})[_0x9b68('0x1e')](function(_0x163ade){_0x5d9c8d[_0x9b68('0x39')]=_0x163ade;return _0x5d9c8d;})[_0x9b68('0x1e')](respondWithFilteredResult(_0x5e0abd,_0x106670))[_0x9b68('0x3a')](handleError(_0x5e0abd,null));};exports[_0x9b68('0x3b')]=function(_0x18ac22,_0x3a6da6){var _0x2a3ccf={'raw':![],'where':{'id':_0x18ac22[_0x9b68('0x3c')]['id']}},_0x709f8e={};_0x709f8e[_0x9b68('0x26')]=_[_0x9b68('0x27')](db[_0x9b68('0x36')]['rawAttributes']);_0x709f8e[_0x9b68('0x28')]=_[_0x9b68('0x27')](_0x18ac22[_0x9b68('0x28')]);_0x709f8e['filters']=_[_0x9b68('0x2a')](_0x709f8e[_0x9b68('0x26')],_0x709f8e[_0x9b68('0x28')]);_0x2a3ccf[_0x9b68('0x2b')]=_[_0x9b68('0x2a')](_0x709f8e[_0x9b68('0x26')],qs[_0x9b68('0x2c')](_0x18ac22[_0x9b68('0x28')][_0x9b68('0x2c')]));_0x2a3ccf['attributes']=_0x2a3ccf[_0x9b68('0x2b')][_0x9b68('0x2d')]?_0x2a3ccf['attributes']:_0x709f8e[_0x9b68('0x26')];if(_0x18ac22[_0x9b68('0x28')]['includeAll']){_0x2a3ccf[_0x9b68('0x38')]=[{'all':!![]}];}_0x2a3ccf=_[_0x9b68('0x34')]({},_0x2a3ccf,_0x18ac22[_0x9b68('0x35')]);return db[_0x9b68('0x36')][_0x9b68('0x3d')](_0x2a3ccf)['then'](handleEntityNotFound(_0x3a6da6,null))[_0x9b68('0x1e')](respondWithResult(_0x3a6da6,null))[_0x9b68('0x3a')](handleError(_0x3a6da6,null));};exports[_0x9b68('0x3e')]=function(_0x139577,_0x47238d){return db[_0x9b68('0x36')][_0x9b68('0x3e')](_0x139577[_0x9b68('0x3f')],{})[_0x9b68('0x1e')](respondWithResult(_0x47238d,0xc9))[_0x9b68('0x3a')](handleError(_0x47238d,null));};exports[_0x9b68('0x40')]=function(_0x452a50,_0x4b3f29){if(_0x452a50['body']['id']){delete _0x452a50['body']['id'];}return db[_0x9b68('0x36')][_0x9b68('0x3d')]({'where':{'id':_0x452a50['params']['id']}})[_0x9b68('0x1e')](handleEntityNotFound(_0x4b3f29,null))[_0x9b68('0x1e')](saveUpdates(_0x452a50[_0x9b68('0x3f')],null))[_0x9b68('0x1e')](respondWithResult(_0x4b3f29,null))[_0x9b68('0x3a')](handleError(_0x4b3f29,null));};exports[_0x9b68('0x1f')]=function(_0x2076c6,_0x17a3b2){return db['Automation']['find']({'where':{'id':_0x2076c6[_0x9b68('0x3c')]['id']}})[_0x9b68('0x1e')](handleEntityNotFound(_0x17a3b2,null))['then'](removeEntity(_0x17a3b2,null))['catch'](handleError(_0x17a3b2,null));};exports[_0x9b68('0x41')]=function(_0x130a4a,_0x2f1ba3,_0xbf70c7){return db['Condition'][_0x9b68('0x3d')]({'where':{'id':_0x130a4a[_0x9b68('0x3c')]['id']}})[_0x9b68('0x1e')](handleEntityNotFound(_0x2f1ba3,null))['then'](function(_0x36711c){if(_0x36711c){return _0x36711c[_0x9b68('0x41')](_0x130a4a[_0x9b68('0x3f')]['ids'],_['omit'](_0x130a4a[_0x9b68('0x3f')],['ids','id'])||{});}})[_0x9b68('0x1e')](respondWithResult(_0x2f1ba3,null))[_0x9b68('0x3a')](handleError(_0x2f1ba3,null));};exports[_0x9b68('0x42')]=function(_0x3da111,_0x83f273,_0x1e870a){var _0x18d765={};var _0x4b06c3={};var _0x3dbb26;var _0x179771;return db[_0x9b68('0x36')][_0x9b68('0x43')]({'where':{'id':_0x3da111[_0x9b68('0x3c')]['id']}})[_0x9b68('0x1e')](handleEntityNotFound(_0x83f273,null))['then'](function(_0x227132){if(_0x227132){_0x3dbb26=_0x227132;_0x4b06c3['model']=_['keys'](db['Condition'][_0x9b68('0x23')]);_0x4b06c3[_0x9b68('0x28')]=_[_0x9b68('0x27')](_0x3da111[_0x9b68('0x28')]);_0x4b06c3[_0x9b68('0x29')]=_['intersection'](_0x4b06c3['model'],_0x4b06c3[_0x9b68('0x28')]);_0x18d765[_0x9b68('0x2b')]=_[_0x9b68('0x2a')](_0x4b06c3['model'],qs[_0x9b68('0x2c')](_0x3da111[_0x9b68('0x28')][_0x9b68('0x2c')]));_0x18d765[_0x9b68('0x2b')]=_0x18d765['attributes'][_0x9b68('0x2d')]?_0x18d765['attributes']:_0x4b06c3[_0x9b68('0x26')];_0x18d765['order']=qs[_0x9b68('0x30')](_0x3da111['query'][_0x9b68('0x30')]);_0x18d765['where']=qs['filters'](_[_0x9b68('0x32')](_0x3da111[_0x9b68('0x28')],_0x4b06c3[_0x9b68('0x29')]));if(_0x3da111['query'][_0x9b68('0x33')]){_0x18d765[_0x9b68('0x31')]=_['merge'](_0x18d765[_0x9b68('0x31')],{'$or':_['map'](_0x18d765[_0x9b68('0x2b')],function(_0xc48cd6){var _0x4feb9d={};_0x4feb9d[_0xc48cd6]={'$like':'%'+_0x3da111[_0x9b68('0x28')][_0x9b68('0x33')]+'%'};return _0x4feb9d;})});}_0x18d765=_[_0x9b68('0x34')]({},_0x18d765,_0x3da111['options']);return _0x3dbb26['getConditions'](_0x18d765);}})[_0x9b68('0x1e')](function(_0xb3f7a4){if(_0xb3f7a4){_0x179771=_0xb3f7a4[_0x9b68('0x2d')];if(!_0x3da111[_0x9b68('0x28')][_0x9b68('0x2e')]('nolimit')){_0x18d765[_0x9b68('0x1a')]=qs[_0x9b68('0x1a')](_0x3da111[_0x9b68('0x28')][_0x9b68('0x1a')]);_0x18d765[_0x9b68('0x17')]=qs[_0x9b68('0x17')](_0x3da111[_0x9b68('0x28')][_0x9b68('0x17')]);}return _0x3dbb26[_0x9b68('0x42')](_0x18d765);}})['then'](function(_0x2547e2){if(_0x2547e2){return _0x2547e2?{'count':_0x179771,'rows':_0x2547e2}:null;}})[_0x9b68('0x1e')](respondWithResult(_0x83f273,null))[_0x9b68('0x3a')](handleError(_0x83f273,null));};exports[_0x9b68('0x44')]=function(_0x79dd98,_0x6e22ce,_0x5f0415){return db[_0x9b68('0x45')][_0x9b68('0x3d')]({'where':{'id':_0x79dd98[_0x9b68('0x3c')]['id']}})[_0x9b68('0x1e')](handleEntityNotFound(_0x6e22ce,null))[_0x9b68('0x1e')](function(_0x47d564){if(_0x47d564){return _0x47d564[_0x9b68('0x44')](_0x79dd98['body'][_0x9b68('0x46')],_[_0x9b68('0x47')](_0x79dd98['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x6e22ce,null))[_0x9b68('0x3a')](handleError(_0x6e22ce,null));};exports[_0x9b68('0x48')]=function(_0x15327b,_0x495019,_0x4768d3){var _0x5bacd5={};var _0x387b79={};var _0x5e150e;var _0x4ab7e7;return db[_0x9b68('0x36')][_0x9b68('0x43')]({'where':{'id':_0x15327b[_0x9b68('0x3c')]['id']}})[_0x9b68('0x1e')](handleEntityNotFound(_0x495019,null))['then'](function(_0x115df3){if(_0x115df3){_0x5e150e=_0x115df3;_0x387b79[_0x9b68('0x26')]=_[_0x9b68('0x27')](db[_0x9b68('0x45')][_0x9b68('0x23')]);_0x387b79[_0x9b68('0x28')]=_[_0x9b68('0x27')](_0x15327b[_0x9b68('0x28')]);_0x387b79[_0x9b68('0x29')]=_['intersection'](_0x387b79[_0x9b68('0x26')],_0x387b79[_0x9b68('0x28')]);_0x5bacd5[_0x9b68('0x2b')]=_['intersection'](_0x387b79['model'],qs[_0x9b68('0x2c')](_0x15327b[_0x9b68('0x28')][_0x9b68('0x2c')]));_0x5bacd5['attributes']=_0x5bacd5[_0x9b68('0x2b')][_0x9b68('0x2d')]?_0x5bacd5[_0x9b68('0x2b')]:_0x387b79[_0x9b68('0x26')];_0x5bacd5[_0x9b68('0x49')]=qs[_0x9b68('0x30')](_0x15327b['query'][_0x9b68('0x30')]);_0x5bacd5['where']=qs[_0x9b68('0x29')](_[_0x9b68('0x32')](_0x15327b[_0x9b68('0x28')],_0x387b79[_0x9b68('0x29')]));if(_0x15327b[_0x9b68('0x28')][_0x9b68('0x33')]){_0x5bacd5[_0x9b68('0x31')]=_['merge'](_0x5bacd5[_0x9b68('0x31')],{'$or':_[_0x9b68('0x4a')](_0x5bacd5[_0x9b68('0x2b')],function(_0x48f0a4){var _0xa75a9e={};_0xa75a9e[_0x48f0a4]={'$like':'%'+_0x15327b[_0x9b68('0x28')]['filter']+'%'};return _0xa75a9e;})});}_0x5bacd5=_[_0x9b68('0x34')]({},_0x5bacd5,_0x15327b['options']);return _0x5e150e[_0x9b68('0x48')](_0x5bacd5);}})[_0x9b68('0x1e')](function(_0x1aa1a0){if(_0x1aa1a0){_0x4ab7e7=_0x1aa1a0[_0x9b68('0x2d')];if(!_0x15327b[_0x9b68('0x28')][_0x9b68('0x2e')]('nolimit')){_0x5bacd5['limit']=qs[_0x9b68('0x1a')](_0x15327b['query'][_0x9b68('0x1a')]);_0x5bacd5[_0x9b68('0x17')]=qs[_0x9b68('0x17')](_0x15327b[_0x9b68('0x28')][_0x9b68('0x17')]);}return _0x5e150e['getActions'](_0x5bacd5);}})[_0x9b68('0x1e')](function(_0x482f14){if(_0x482f14){return _0x482f14?{'count':_0x4ab7e7,'rows':_0x482f14}:null;}})[_0x9b68('0x1e')](respondWithResult(_0x495019,null))[_0x9b68('0x3a')](handleError(_0x495019,null));}; \ No newline at end of file +var _0x640a=['end','json','undefined','count','offset','limit','set','apply','save','update','then','error','name','send','Automation','fieldName','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','destroy','Condition','addConditions','ids','omit','findOne','getConditions','addActions','Action','getActions','rawAttributes','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status'];(function(_0x40f81d,_0x2bab31){var _0x3c2997=function(_0x4f5a51){while(--_0x4f5a51){_0x40f81d['push'](_0x40f81d['shift']());}};_0x3c2997(++_0x2bab31);}(_0x640a,0xe1));var _0xa640=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x640a[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xa640('0x0'));var rimraf=require(_0xa640('0x1'));var zipdir=require(_0xa640('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa640('0x3'));var moment=require('moment');var BPromise=require(_0xa640('0x4'));var Mustache=require(_0xa640('0x5'));var util=require(_0xa640('0x6'));var path=require(_0xa640('0x7'));var sox=require(_0xa640('0x8'));var csv=require(_0xa640('0x9'));var ejs=require(_0xa640('0xa'));var fs=require('fs');var fs_extra=require(_0xa640('0xb'));var _=require(_0xa640('0xc'));var squel=require('squel');var crypto=require(_0xa640('0xd'));var jsforce=require(_0xa640('0xe'));var deskjs=require(_0xa640('0xf'));var toCsv=require(_0xa640('0x9'));var querystring=require(_0xa640('0x10'));var Papa=require(_0xa640('0x11'));var Redis=require(_0xa640('0x12'));var authService=require(_0xa640('0x13'));var qs=require(_0xa640('0x14'));var as=require(_0xa640('0x15'));var hardwareService=require(_0xa640('0x16'));var logger=require(_0xa640('0x17'))('api');var utils=require(_0xa640('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33a20e,_0x5aada0){_0x5aada0=_0x5aada0||0xcc;return function(_0x19b128){if(_0x19b128){return _0x33a20e[_0xa640('0x19')](_0x5aada0);}return _0x33a20e[_0xa640('0x1a')](_0x5aada0)[_0xa640('0x1b')]();};}function respondWithResult(_0x2f7cb6,_0x518a1c){_0x518a1c=_0x518a1c||0xc8;return function(_0x282738){if(_0x282738){return _0x2f7cb6[_0xa640('0x1a')](_0x518a1c)[_0xa640('0x1c')](_0x282738);}};}function respondWithFilteredResult(_0x23c173,_0x783855){return function(_0x5bd8ad){if(_0x5bd8ad){var _0xf0f6d2=typeof _0x783855['offset']===_0xa640('0x1d')&&typeof _0x783855['limit']===_0xa640('0x1d');var _0x21caba=_0x5bd8ad[_0xa640('0x1e')];var _0x3d9ce7=_0xf0f6d2?0x0:_0x783855[_0xa640('0x1f')];var _0x35e075=_0xf0f6d2?_0x5bd8ad[_0xa640('0x1e')]:_0x783855[_0xa640('0x1f')]+_0x783855[_0xa640('0x20')];var _0x3dbc9a;if(_0x35e075>=_0x21caba){_0x35e075=_0x21caba;_0x3dbc9a=0xc8;}else{_0x3dbc9a=0xce;}_0x23c173[_0xa640('0x1a')](_0x3dbc9a);return _0x23c173[_0xa640('0x21')]('Content-Range',_0x3d9ce7+'-'+_0x35e075+'/'+_0x21caba)['json'](_0x5bd8ad);}return null;};}function patchUpdates(_0x2fbf21){return function(_0x1cd600){try{jsonpatch[_0xa640('0x22')](_0x1cd600,_0x2fbf21,!![]);}catch(_0xe7d261){return BPromise['reject'](_0xe7d261);}return _0x1cd600[_0xa640('0x23')]();};}function saveUpdates(_0x709fb4,_0x2a1a69){return function(_0x50bc5b){if(_0x50bc5b){return _0x50bc5b[_0xa640('0x24')](_0x709fb4)[_0xa640('0x25')](function(_0x5d4e31){return _0x5d4e31;});}return null;};}function removeEntity(_0x3638e9,_0x4748c4){return function(_0x4e0b51){if(_0x4e0b51){return _0x4e0b51['destroy']()['then'](function(){_0x3638e9[_0xa640('0x1a')](0xcc)[_0xa640('0x1b')]();});}};}function handleEntityNotFound(_0x300511,_0x36ee51){return function(_0x15342c){if(!_0x15342c){_0x300511[_0xa640('0x19')](0x194);}return _0x15342c;};}function handleError(_0x478430,_0x2ce154){_0x2ce154=_0x2ce154||0x1f4;return function(_0x25a141){logger[_0xa640('0x26')](_0x25a141['stack']);if(_0x25a141[_0xa640('0x27')]){delete _0x25a141[_0xa640('0x27')];}_0x478430[_0xa640('0x1a')](_0x2ce154)[_0xa640('0x28')](_0x25a141);};}exports['index']=function(_0x247a17,_0x3de155){var _0x2f2e87={},_0x2b5f9e={},_0x587fba={'count':0x0,'rows':[]};var _0x133511=_['map'](db[_0xa640('0x29')]['rawAttributes'],function(_0x39fb6e){return{'name':_0x39fb6e[_0xa640('0x2a')],'type':_0x39fb6e['type']['key']};});_0x2b5f9e['model']=_[_0xa640('0x2b')](_0x133511,_0xa640('0x27'));_0x2b5f9e[_0xa640('0x2c')]=_[_0xa640('0x2d')](_0x247a17[_0xa640('0x2c')]);_0x2b5f9e[_0xa640('0x2e')]=_['intersection'](_0x2b5f9e[_0xa640('0x2f')],_0x2b5f9e[_0xa640('0x2c')]);_0x2f2e87[_0xa640('0x30')]=_[_0xa640('0x31')](_0x2b5f9e[_0xa640('0x2f')],qs[_0xa640('0x32')](_0x247a17[_0xa640('0x2c')][_0xa640('0x32')]));_0x2f2e87[_0xa640('0x30')]=_0x2f2e87[_0xa640('0x30')]['length']?_0x2f2e87[_0xa640('0x30')]:_0x2b5f9e[_0xa640('0x2f')];if(!_0x247a17[_0xa640('0x2c')][_0xa640('0x33')](_0xa640('0x34'))){_0x2f2e87['limit']=qs[_0xa640('0x20')](_0x247a17[_0xa640('0x2c')][_0xa640('0x20')]);_0x2f2e87[_0xa640('0x1f')]=qs['offset'](_0x247a17[_0xa640('0x2c')][_0xa640('0x1f')]);}_0x2f2e87[_0xa640('0x35')]=qs[_0xa640('0x36')](_0x247a17['query'][_0xa640('0x36')]);_0x2f2e87[_0xa640('0x37')]=qs[_0xa640('0x2e')](_[_0xa640('0x38')](_0x247a17[_0xa640('0x2c')],_0x2b5f9e[_0xa640('0x2e')]),_0x133511);if(_0x247a17[_0xa640('0x2c')][_0xa640('0x39')]){_0x2f2e87[_0xa640('0x37')]=_[_0xa640('0x3a')](_0x2f2e87[_0xa640('0x37')],{'$or':_[_0xa640('0x2b')](_0x133511,function(_0x3d5586){if(_0x3d5586[_0xa640('0x3b')]!==_0xa640('0x3c')){var _0x49dd9f={};_0x49dd9f[_0x3d5586[_0xa640('0x27')]]={'$like':'%'+_0x247a17[_0xa640('0x2c')][_0xa640('0x39')]+'%'};return _0x49dd9f;}})});}_0x2f2e87=_[_0xa640('0x3a')]({},_0x2f2e87,_0x247a17[_0xa640('0x3d')]);var _0x134f05={'where':_0x2f2e87[_0xa640('0x37')]};return db['Automation']['count'](_0x134f05)[_0xa640('0x25')](function(_0x17b3cf){_0x587fba[_0xa640('0x1e')]=_0x17b3cf;if(_0x247a17['query'][_0xa640('0x3e')]){_0x2f2e87[_0xa640('0x3f')]=[{'all':!![]}];}return db[_0xa640('0x29')][_0xa640('0x40')](_0x2f2e87);})[_0xa640('0x25')](function(_0x140ea1){_0x587fba[_0xa640('0x41')]=_0x140ea1;return _0x587fba;})[_0xa640('0x25')](respondWithFilteredResult(_0x3de155,_0x2f2e87))['catch'](handleError(_0x3de155,null));};exports[_0xa640('0x42')]=function(_0x32c379,_0x3a85f6){var _0x1ac559={'raw':![],'where':{'id':_0x32c379[_0xa640('0x43')]['id']}},_0x2b037a={};_0x2b037a[_0xa640('0x2f')]=_[_0xa640('0x2d')](db[_0xa640('0x29')]['rawAttributes']);_0x2b037a[_0xa640('0x2c')]=_['keys'](_0x32c379['query']);_0x2b037a[_0xa640('0x2e')]=_['intersection'](_0x2b037a[_0xa640('0x2f')],_0x2b037a[_0xa640('0x2c')]);_0x1ac559[_0xa640('0x30')]=_[_0xa640('0x31')](_0x2b037a['model'],qs[_0xa640('0x32')](_0x32c379[_0xa640('0x2c')][_0xa640('0x32')]));_0x1ac559['attributes']=_0x1ac559['attributes'][_0xa640('0x44')]?_0x1ac559['attributes']:_0x2b037a['model'];if(_0x32c379[_0xa640('0x2c')][_0xa640('0x3e')]){_0x1ac559[_0xa640('0x3f')]=[{'all':!![]}];}_0x1ac559=_[_0xa640('0x3a')]({},_0x1ac559,_0x32c379[_0xa640('0x3d')]);return db[_0xa640('0x29')]['find'](_0x1ac559)[_0xa640('0x25')](handleEntityNotFound(_0x3a85f6,null))[_0xa640('0x25')](respondWithResult(_0x3a85f6,null))[_0xa640('0x45')](handleError(_0x3a85f6,null));};exports[_0xa640('0x46')]=function(_0x3550b3,_0x2d2931){return db[_0xa640('0x29')][_0xa640('0x46')](_0x3550b3['body'],{})['then'](respondWithResult(_0x2d2931,0xc9))[_0xa640('0x45')](handleError(_0x2d2931,null));};exports['update']=function(_0x121918,_0x5f4068){if(_0x121918[_0xa640('0x47')]['id']){delete _0x121918[_0xa640('0x47')]['id'];}return db['Automation'][_0xa640('0x48')]({'where':{'id':_0x121918[_0xa640('0x43')]['id']}})[_0xa640('0x25')](handleEntityNotFound(_0x5f4068,null))['then'](saveUpdates(_0x121918['body'],null))[_0xa640('0x25')](respondWithResult(_0x5f4068,null))[_0xa640('0x45')](handleError(_0x5f4068,null));};exports[_0xa640('0x49')]=function(_0x4182fc,_0x44bdfe){return db['Automation'][_0xa640('0x48')]({'where':{'id':_0x4182fc[_0xa640('0x43')]['id']}})['then'](handleEntityNotFound(_0x44bdfe,null))[_0xa640('0x25')](removeEntity(_0x44bdfe,null))[_0xa640('0x45')](handleError(_0x44bdfe,null));};exports['addConditions']=function(_0x3d3765,_0x3a5a84,_0x4a753c){return db[_0xa640('0x4a')][_0xa640('0x48')]({'where':{'id':_0x3d3765['params']['id']}})[_0xa640('0x25')](handleEntityNotFound(_0x3a5a84,null))[_0xa640('0x25')](function(_0x44f090){if(_0x44f090){return _0x44f090[_0xa640('0x4b')](_0x3d3765[_0xa640('0x47')][_0xa640('0x4c')],_[_0xa640('0x4d')](_0x3d3765[_0xa640('0x47')],['ids','id'])||{});}})[_0xa640('0x25')](respondWithResult(_0x3a5a84,null))[_0xa640('0x45')](handleError(_0x3a5a84,null));};exports['getConditions']=function(_0x190504,_0x1bd5db,_0x1497fa){var _0x46851c={};var _0x19d01c={};var _0x45b16a;var _0x5795b8;return db['Automation'][_0xa640('0x4e')]({'where':{'id':_0x190504[_0xa640('0x43')]['id']}})[_0xa640('0x25')](handleEntityNotFound(_0x1bd5db,null))[_0xa640('0x25')](function(_0x3e89f6){if(_0x3e89f6){_0x45b16a=_0x3e89f6;_0x19d01c[_0xa640('0x2f')]=_['keys'](db[_0xa640('0x4a')]['rawAttributes']);_0x19d01c[_0xa640('0x2c')]=_[_0xa640('0x2d')](_0x190504[_0xa640('0x2c')]);_0x19d01c[_0xa640('0x2e')]=_[_0xa640('0x31')](_0x19d01c[_0xa640('0x2f')],_0x19d01c[_0xa640('0x2c')]);_0x46851c[_0xa640('0x30')]=_[_0xa640('0x31')](_0x19d01c[_0xa640('0x2f')],qs[_0xa640('0x32')](_0x190504[_0xa640('0x2c')][_0xa640('0x32')]));_0x46851c['attributes']=_0x46851c[_0xa640('0x30')]['length']?_0x46851c[_0xa640('0x30')]:_0x19d01c[_0xa640('0x2f')];_0x46851c['order']=qs[_0xa640('0x36')](_0x190504['query'][_0xa640('0x36')]);_0x46851c[_0xa640('0x37')]=qs[_0xa640('0x2e')](_[_0xa640('0x38')](_0x190504['query'],_0x19d01c[_0xa640('0x2e')]));if(_0x190504[_0xa640('0x2c')]['filter']){_0x46851c[_0xa640('0x37')]=_[_0xa640('0x3a')](_0x46851c[_0xa640('0x37')],{'$or':_['map'](_0x46851c[_0xa640('0x30')],function(_0x2d8fba){var _0x5f4e1d={};_0x5f4e1d[_0x2d8fba]={'$like':'%'+_0x190504[_0xa640('0x2c')][_0xa640('0x39')]+'%'};return _0x5f4e1d;})});}_0x46851c=_['merge']({},_0x46851c,_0x190504[_0xa640('0x3d')]);return _0x45b16a[_0xa640('0x4f')](_0x46851c);}})['then'](function(_0x9a0ba0){if(_0x9a0ba0){_0x5795b8=_0x9a0ba0[_0xa640('0x44')];if(!_0x190504[_0xa640('0x2c')]['hasOwnProperty'](_0xa640('0x34'))){_0x46851c[_0xa640('0x20')]=qs[_0xa640('0x20')](_0x190504['query'][_0xa640('0x20')]);_0x46851c[_0xa640('0x1f')]=qs['offset'](_0x190504[_0xa640('0x2c')][_0xa640('0x1f')]);}return _0x45b16a[_0xa640('0x4f')](_0x46851c);}})[_0xa640('0x25')](function(_0x5f067c){if(_0x5f067c){return _0x5f067c?{'count':_0x5795b8,'rows':_0x5f067c}:null;}})[_0xa640('0x25')](respondWithResult(_0x1bd5db,null))[_0xa640('0x45')](handleError(_0x1bd5db,null));};exports[_0xa640('0x50')]=function(_0x59af4b,_0x18ce7e,_0x24897c){return db[_0xa640('0x51')][_0xa640('0x48')]({'where':{'id':_0x59af4b[_0xa640('0x43')]['id']}})[_0xa640('0x25')](handleEntityNotFound(_0x18ce7e,null))[_0xa640('0x25')](function(_0x3950cc){if(_0x3950cc){return _0x3950cc[_0xa640('0x50')](_0x59af4b[_0xa640('0x47')]['ids'],_[_0xa640('0x4d')](_0x59af4b[_0xa640('0x47')],[_0xa640('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x18ce7e,null))['catch'](handleError(_0x18ce7e,null));};exports[_0xa640('0x52')]=function(_0x452164,_0x47cf88,_0x19c887){var _0x3cd040={};var _0xf32b3f={};var _0x243d64;var _0x3f56e0;return db['Automation']['findOne']({'where':{'id':_0x452164[_0xa640('0x43')]['id']}})['then'](handleEntityNotFound(_0x47cf88,null))[_0xa640('0x25')](function(_0x171cf7){if(_0x171cf7){_0x243d64=_0x171cf7;_0xf32b3f[_0xa640('0x2f')]=_[_0xa640('0x2d')](db['Action'][_0xa640('0x53')]);_0xf32b3f['query']=_['keys'](_0x452164['query']);_0xf32b3f[_0xa640('0x2e')]=_[_0xa640('0x31')](_0xf32b3f[_0xa640('0x2f')],_0xf32b3f[_0xa640('0x2c')]);_0x3cd040[_0xa640('0x30')]=_[_0xa640('0x31')](_0xf32b3f[_0xa640('0x2f')],qs['fields'](_0x452164[_0xa640('0x2c')]['fields']));_0x3cd040[_0xa640('0x30')]=_0x3cd040[_0xa640('0x30')][_0xa640('0x44')]?_0x3cd040['attributes']:_0xf32b3f[_0xa640('0x2f')];_0x3cd040[_0xa640('0x35')]=qs[_0xa640('0x36')](_0x452164[_0xa640('0x2c')]['sort']);_0x3cd040[_0xa640('0x37')]=qs['filters'](_[_0xa640('0x38')](_0x452164[_0xa640('0x2c')],_0xf32b3f[_0xa640('0x2e')]));if(_0x452164[_0xa640('0x2c')]['filter']){_0x3cd040['where']=_[_0xa640('0x3a')](_0x3cd040[_0xa640('0x37')],{'$or':_[_0xa640('0x2b')](_0x3cd040[_0xa640('0x30')],function(_0x53c315){var _0x147983={};_0x147983[_0x53c315]={'$like':'%'+_0x452164['query'][_0xa640('0x39')]+'%'};return _0x147983;})});}_0x3cd040=_[_0xa640('0x3a')]({},_0x3cd040,_0x452164[_0xa640('0x3d')]);return _0x243d64[_0xa640('0x52')](_0x3cd040);}})[_0xa640('0x25')](function(_0x542999){if(_0x542999){_0x3f56e0=_0x542999[_0xa640('0x44')];if(!_0x452164[_0xa640('0x2c')][_0xa640('0x33')]('nolimit')){_0x3cd040['limit']=qs['limit'](_0x452164['query'][_0xa640('0x20')]);_0x3cd040['offset']=qs[_0xa640('0x1f')](_0x452164[_0xa640('0x2c')][_0xa640('0x1f')]);}return _0x243d64['getActions'](_0x3cd040);}})['then'](function(_0x2f6c44){if(_0x2f6c44){return _0x2f6c44?{'count':_0x3f56e0,'rows':_0x2f6c44}:null;}})[_0xa640('0x25')](respondWithResult(_0x47cf88,null))[_0xa640('0x45')](handleError(_0x47cf88,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4aff6d4..a2822bb 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 _0xc463=['api','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x4c4d18,_0x441b11){var _0x46e857=function(_0x2922cb){while(--_0x2922cb){_0x4c4d18['push'](_0x4c4d18['shift']());}};_0x46e857(++_0x441b11);}(_0xc463,0x83));var _0x3c46=function(_0x2e15de,_0x3b9a6f){_0x2e15de=_0x2e15de-0x0;var _0xdaa198=_0xc463[_0x2e15de];return _0xdaa198;};'use strict';var _=require(_0x3c46('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3c46('0x1'));var moment=require('moment');var BPromise=require(_0x3c46('0x2'));var rp=require(_0x3c46('0x3'));var fs=require('fs');var path=require(_0x3c46('0x4'));var rimraf=require(_0x3c46('0x5'));var config=require('../../config/environment');var attributes=require(_0x3c46('0x6'));module[_0x3c46('0x7')]=function(_0x54002d,_0x1a4ad7){return _0x54002d[_0x3c46('0x8')](_0x3c46('0x9'),attributes,{'tableName':_0x3c46('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e48=['Automation','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x4fcb9f,_0x4c46c8){var _0x4b35af=function(_0x5d7155){while(--_0x5d7155){_0x4fcb9f['push'](_0x4fcb9f['shift']());}};_0x4b35af(++_0x4c46c8);}(_0x6e48,0x199));var _0x86e4=function(_0x595adf,_0x2cad33){_0x595adf=_0x595adf-0x0;var _0x32e8bc=_0x6e48[_0x595adf];return _0x32e8bc;};'use strict';var _=require(_0x86e4('0x0'));var util=require('util');var logger=require(_0x86e4('0x1'))(_0x86e4('0x2'));var moment=require(_0x86e4('0x3'));var BPromise=require(_0x86e4('0x4'));var rp=require(_0x86e4('0x5'));var fs=require('fs');var path=require(_0x86e4('0x6'));var rimraf=require(_0x86e4('0x7'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0xace5d5,_0x551714){return _0xace5d5[_0x86e4('0x8')](_0x86e4('0x9'),attributes,{'tableName':_0x86e4('0xa'),'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 4917c1f..d61a11c 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 _0xc373=['../../config/environment','jayson/promise','request','then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x35117d,_0x46168b){var _0x45a1e8=function(_0x137574){while(--_0x137574){_0x35117d['push'](_0x35117d['shift']());}};_0x45a1e8(++_0x46168b);}(_0xc373,0x1c7));var _0x3c37=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0xc373[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require('lodash');var util=require(_0x3c37('0x0'));var moment=require(_0x3c37('0x1'));var BPromise=require(_0x3c37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c37('0x3'))['db'];var utils=require(_0x3c37('0x4'));var logger=require(_0x3c37('0x5'))(_0x3c37('0x6'));var config=require(_0x3c37('0x7'));var jayson=require(_0x3c37('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1941,_0x1244e6,_0x14b09d){return new BPromise(function(_0x10617,_0x465de6){return client[_0x3c37('0x9')](_0x2e1941,_0x14b09d)[_0x3c37('0xa')](function(_0x59d4f9){logger[_0x3c37('0xb')]('Automation,\x20%s,\x20%s',_0x1244e6,'request\x20sent');logger[_0x3c37('0xc')](_0x3c37('0xd'),_0x1244e6,_0x3c37('0xe'),JSON[_0x3c37('0xf')](_0x59d4f9));if(_0x59d4f9[_0x3c37('0x10')]){if(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x11')]===0x1f4){logger['error'](_0x3c37('0x12'),_0x1244e6,_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);return _0x465de6(_0x59d4f9['error']['message']);}logger[_0x3c37('0x10')]('Automation,\x20%s,\x20%s',_0x1244e6,_0x59d4f9['error'][_0x3c37('0x13')]);return _0x10617(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);}else{logger[_0x3c37('0xb')](_0x3c37('0x12'),_0x1244e6,_0x3c37('0xe'));_0x10617(_0x59d4f9[_0x3c37('0x14')][_0x3c37('0x13')]);}})[_0x3c37('0x15')](function(_0x4e1560){logger[_0x3c37('0x10')](_0x3c37('0x12'),_0x1244e6,_0x4e1560);_0x465de6(_0x4e1560);});});} \ No newline at end of file +var _0xa76e=['result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa76e,0xfe));var _0xea76=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa76e[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require(_0xea76('0x0'));var moment=require(_0xea76('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea76('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea76('0x3'));var logger=require(_0xea76('0x4'))(_0xea76('0x5'));var config=require('../../config/environment');var jayson=require(_0xea76('0x6'));var client=jayson['client'][_0xea76('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ee974,_0x45ac1b,_0x1735ff){return new BPromise(function(_0x5eb746,_0x55aae7){return client[_0xea76('0x8')](_0x4ee974,_0x1735ff)[_0xea76('0x9')](function(_0x1c6723){logger[_0xea76('0xa')]('Automation,\x20%s,\x20%s',_0x45ac1b,_0xea76('0xb'));logger[_0xea76('0xc')](_0xea76('0xd'),_0x45ac1b,'request\x20sent',JSON[_0xea76('0xe')](_0x1c6723));if(_0x1c6723[_0xea76('0xf')]){if(_0x1c6723[_0xea76('0xf')][_0xea76('0x10')]===0x1f4){logger[_0xea76('0xf')](_0xea76('0x11'),_0x45ac1b,_0x1c6723[_0xea76('0xf')][_0xea76('0x12')]);return _0x55aae7(_0x1c6723[_0xea76('0xf')][_0xea76('0x12')]);}logger[_0xea76('0xf')](_0xea76('0x11'),_0x45ac1b,_0x1c6723[_0xea76('0xf')][_0xea76('0x12')]);return _0x5eb746(_0x1c6723[_0xea76('0xf')]['message']);}else{logger[_0xea76('0xa')](_0xea76('0x11'),_0x45ac1b,_0xea76('0xb'));_0x5eb746(_0x1c6723[_0xea76('0x13')][_0xea76('0x12')]);}})[_0xea76('0x14')](function(_0x3b47fa){logger[_0xea76('0xf')](_0xea76('0x11'),_0x45ac1b,_0x3b47fa);_0x55aae7(_0x3b47fa);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index fedc5f0..912fe6b 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 _0xf883=['isAuthenticated','index','show','/:id/conditions','/:id/actions','post','create','addConditions','addActions','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf883,0x177));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3f88('0x0'));var util=require(_0x3f88('0x1'));var path=require('path');var timeout=require(_0x3f88('0x2'));var express=require('express');var router=express[_0x3f88('0x3')]();var fs_extra=require(_0x3f88('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3f88('0x5'));var config=require(_0x3f88('0x6'));var controller=require(_0x3f88('0x7'));router[_0x3f88('0x8')]('/',auth[_0x3f88('0x9')](),controller[_0x3f88('0xa')]);router[_0x3f88('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3f88('0xb')]);router[_0x3f88('0x8')](_0x3f88('0xc'),auth[_0x3f88('0x9')](),controller['getConditions']);router[_0x3f88('0x8')](_0x3f88('0xd'),auth[_0x3f88('0x9')](),controller['getActions']);router[_0x3f88('0xe')]('/',auth[_0x3f88('0x9')](),controller[_0x3f88('0xf')]);router[_0x3f88('0xe')](_0x3f88('0xc'),auth[_0x3f88('0x9')](),controller[_0x3f88('0x10')]);router[_0x3f88('0xe')](_0x3f88('0xd'),auth[_0x3f88('0x9')](),controller[_0x3f88('0x11')]);router[_0x3f88('0x12')](_0x3f88('0x13'),auth[_0x3f88('0x9')](),controller[_0x3f88('0x14')]);router[_0x3f88('0x15')](_0x3f88('0x13'),auth[_0x3f88('0x9')](),controller[_0x3f88('0x16')]);module[_0x3f88('0x17')]=router; \ No newline at end of file +var _0xb8f7=['get','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x5a89df,_0x59cf29){var _0x15a0c5=function(_0x381664){while(--_0x381664){_0x5a89df['push'](_0x5a89df['shift']());}};_0x15a0c5(++_0x59cf29);}(_0xb8f7,0x1af));var _0x7b8f=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb8f7[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x7b8f('0x0'));var util=require('util');var path=require(_0x7b8f('0x1'));var timeout=require(_0x7b8f('0x2'));var express=require(_0x7b8f('0x3'));var router=express['Router']();var fs_extra=require(_0x7b8f('0x4'));var auth=require(_0x7b8f('0x5'));var interaction=require(_0x7b8f('0x6'));var config=require(_0x7b8f('0x7'));var controller=require(_0x7b8f('0x8'));router[_0x7b8f('0x9')]('/',auth[_0x7b8f('0xa')](),controller['index']);router['get']('/:id',auth[_0x7b8f('0xa')](),controller[_0x7b8f('0xb')]);router[_0x7b8f('0x9')](_0x7b8f('0xc'),auth[_0x7b8f('0xa')](),controller[_0x7b8f('0xd')]);router[_0x7b8f('0x9')]('/:id/actions',auth[_0x7b8f('0xa')](),controller[_0x7b8f('0xe')]);router['post']('/',auth[_0x7b8f('0xa')](),controller['create']);router[_0x7b8f('0xf')]('/:id/conditions',auth[_0x7b8f('0xa')](),controller['addConditions']);router[_0x7b8f('0xf')]('/:id/actions',auth[_0x7b8f('0xa')](),controller['addActions']);router[_0x7b8f('0x10')]('/:id',auth[_0x7b8f('0xa')](),controller[_0x7b8f('0x11')]);router[_0x7b8f('0x12')](_0x7b8f('0x13'),auth[_0x7b8f('0xa')](),controller[_0x7b8f('0x14')]);module[_0x7b8f('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 85309b3..99e8f7c 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 _0xaf30=['#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)','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x55c1ee,_0x352dd9){var _0xc8ca34=function(_0x1aee2f){while(--_0x1aee2f){_0x55c1ee['push'](_0x55c1ee['shift']());}};_0xc8ca34(++_0x352dd9);}(_0xaf30,0xd0));var _0x0af3=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xaf30[_0x2431d6];return _0x4d0f9b;};'use strict';var Sequelize=require('sequelize');module[_0x0af3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0af3('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0af3('0x2')](_0x0af3('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x0af3('0x4')]},'active':{'type':Sequelize[_0x0af3('0x5')],'defaultValue':0x0,'comment':_0x0af3('0x6')},'limitCalls':{'type':Sequelize[_0x0af3('0x7')](0x4)[_0x0af3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0af3('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0af3('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0af3('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)[_0x0af3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0af3('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'comment':_0x0af3('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)[_0x0af3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0af3('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0af3('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x0af3('0x2')](_0x0af3('0x11'),'never',_0x0af3('0x12')),'defaultValue':_0x0af3('0x11')},'dialAMDActive':{'type':Sequelize[_0x0af3('0x5')],'defaultValue':0x0,'comment':_0x0af3('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0af3('0x7')](0x9)[_0x0af3('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0af3('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0af3('0x7')](0x9)[_0x0af3('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0af3('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0af3('0x7')](0x9)[_0x0af3('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0af3('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0af3('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0af3('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x0af3('0x7')](0x9)[_0x0af3('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0af3('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0af3('0x7')](0x9)[_0x0af3('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0af3('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0af3('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0af3('0x7')](0x5)[_0x0af3('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0af3('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0af3('0x7')](0x9)[_0x0af3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0af3('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0af3('0x1c'),_0x0af3('0x1d')),'defaultValue':_0x0af3('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0af3('0x1e')},'dialCutDigit':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0af3('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0af3('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)[_0x0af3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0af3('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)[_0x0af3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0af3('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0af3('0x7')](0x3)[_0x0af3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0af3('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0af3('0x7')](0x5)[_0x0af3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0af3('0x27')}}; \ No newline at end of file +var _0x0eab=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','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','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','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)','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x23c6ce,_0x236a83){var _0x365fef=function(_0x3fe6c4){while(--_0x3fe6c4){_0x23c6ce['push'](_0x23c6ce['shift']());}};_0x365fef(++_0x236a83);}(_0x0eab,0xd9));var _0xb0ea=function(_0x3c564b,_0x13df8d){_0x3c564b=_0x3c564b-0x0;var _0x5f8103=_0x0eab[_0x3c564b];return _0x5f8103;};'use strict';var Sequelize=require(_0xb0ea('0x0'));module[_0xb0ea('0x1')]={'name':{'type':Sequelize[_0xb0ea('0x2')],'unique':_0xb0ea('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb0ea('0x4')](_0xb0ea('0x5')),'allowNull':![],'defaultValue':_0xb0ea('0x5')},'description':{'type':Sequelize[_0xb0ea('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb0ea('0x6')},'limitCalls':{'type':Sequelize[_0xb0ea('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb0ea('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)[_0xb0ea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0ea('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0ea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0ea('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'defaultValue':0x3,'comment':_0xb0ea('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)[_0xb0ea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb0ea('0xf')},'dialTimezone':{'type':Sequelize[_0xb0ea('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb0ea('0x2')],'defaultValue':_0xb0ea('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xb0ea('0x4')](_0xb0ea('0x11'),_0xb0ea('0x12'),_0xb0ea('0x13')),'defaultValue':_0xb0ea('0x11')},'dialAMDActive':{'type':Sequelize[_0xb0ea('0x14')],'defaultValue':0x0,'comment':_0xb0ea('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xb0ea('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb0ea('0x7')](0x9)[_0xb0ea('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb0ea('0x7')](0x9)[_0xb0ea('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb0ea('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0ea('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xb0ea('0x7')](0x9)[_0xb0ea('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb0ea('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb0ea('0x7')](0x9)[_0xb0ea('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb0ea('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb0ea('0x7')](0x9)[_0xb0ea('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb0ea('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb0ea('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb0ea('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb0ea('0x7')](0x9)[_0xb0ea('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0ea('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb0ea('0x4')](_0xb0ea('0x1c'),_0xb0ea('0x1d')),'defaultValue':_0xb0ea('0x1c')},'dialPrefix':{'type':Sequelize[_0xb0ea('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0ea('0x1e')},'dialCutDigit':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0ea('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)[_0xb0ea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0ea('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)[_0xb0ea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0ea('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0ea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)[_0xb0ea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0ea('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb0ea('0x7')](0x3)[_0xb0ea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0ea('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb0ea('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0ea('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5c7a554..b545387 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 _0xbbd5=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','Campaign','includeAll','rows','catch','show','include','find','create','body','user','role','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','update','params','destroy','getHoppers','CmHopper','nolimit','findAll','findOne','CmHopperHistory','pick','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','select','field','CmListId','toString','ListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','ContactId','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x12c4c7,_0x4ee42a){var _0x5146b4=function(_0x10ac09){while(--_0x10ac09){_0x12c4c7['push'](_0x12c4c7['shift']());}};_0x5146b4(++_0x4ee42a);}(_0xbbd5,0x17d));var _0x5bbd=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbbd5[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x5bbd('0x0'));var rimraf=require(_0x5bbd('0x1'));var zipdir=require(_0x5bbd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bbd('0x3'));var moment=require(_0x5bbd('0x4'));var BPromise=require(_0x5bbd('0x5'));var Mustache=require(_0x5bbd('0x6'));var util=require(_0x5bbd('0x7'));var path=require(_0x5bbd('0x8'));var sox=require(_0x5bbd('0x9'));var csv=require(_0x5bbd('0xa'));var ejs=require(_0x5bbd('0xb'));var fs=require('fs');var fs_extra=require(_0x5bbd('0xc'));var _=require(_0x5bbd('0xd'));var squel=require('squel');var crypto=require(_0x5bbd('0xe'));var jsforce=require(_0x5bbd('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5bbd('0x10'));var Papa=require(_0x5bbd('0x11'));var Redis=require(_0x5bbd('0x12'));var authService=require(_0x5bbd('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bbd('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5bbd('0x15'));var db=require(_0x5bbd('0x16'))['db'];function respondWithStatusCode(_0x5bdb60,_0x4caf25){_0x4caf25=_0x4caf25||0xcc;return function(_0x17ba0c){if(_0x17ba0c){return _0x5bdb60[_0x5bbd('0x17')](_0x4caf25);}return _0x5bdb60[_0x5bbd('0x18')](_0x4caf25)[_0x5bbd('0x19')]();};}function respondWithResult(_0x22b901,_0x507695){_0x507695=_0x507695||0xc8;return function(_0xd0b922){if(_0xd0b922){return _0x22b901[_0x5bbd('0x18')](_0x507695)[_0x5bbd('0x1a')](_0xd0b922);}};}function respondWithFilteredResult(_0x2a374d,_0x53825e){return function(_0x5e8e3a){if(_0x5e8e3a){var _0x26c0e1=typeof _0x53825e[_0x5bbd('0x1b')]===_0x5bbd('0x1c')&&typeof _0x53825e['limit']===_0x5bbd('0x1c');var _0x5daa71=_0x5e8e3a[_0x5bbd('0x1d')];var _0x4df430=_0x26c0e1?0x0:_0x53825e[_0x5bbd('0x1b')];var _0x3cd416=_0x26c0e1?_0x5e8e3a[_0x5bbd('0x1d')]:_0x53825e[_0x5bbd('0x1b')]+_0x53825e[_0x5bbd('0x1e')];var _0x283e51;if(_0x3cd416>=_0x5daa71){_0x3cd416=_0x5daa71;_0x283e51=0xc8;}else{_0x283e51=0xce;}_0x2a374d['status'](_0x283e51);return _0x2a374d[_0x5bbd('0x1f')](_0x5bbd('0x20'),_0x4df430+'-'+_0x3cd416+'/'+_0x5daa71)['json'](_0x5e8e3a);}return null;};}function patchUpdates(_0x4dbac4){return function(_0x49955d){try{jsonpatch[_0x5bbd('0x21')](_0x49955d,_0x4dbac4,!![]);}catch(_0x59eda1){return BPromise[_0x5bbd('0x22')](_0x59eda1);}return _0x49955d[_0x5bbd('0x23')]();};}function saveUpdates(_0x6cd953,_0xcd6217){return function(_0x55dcc4){if(_0x55dcc4){return _0x55dcc4['update'](_0x6cd953)['then'](function(_0x3b0a48){return _0x3b0a48;});}return null;};}function removeEntity(_0x4da80e,_0x399b17){return function(_0x768659){if(_0x768659){return _0x768659['destroy']()[_0x5bbd('0x24')](function(){var _0x4ea4ea=_0x768659[_0x5bbd('0x25')]({'plain':!![]});var _0xbe24fe='IvrCampaigns';return db[_0x5bbd('0x26')]['destroy']({'where':{'type':_0xbe24fe,'resourceId':_0x4ea4ea['id']}})[_0x5bbd('0x24')](function(){return _0x768659;});})[_0x5bbd('0x24')](function(){_0x4da80e['status'](0xcc)[_0x5bbd('0x19')]();});}};}function handleEntityNotFound(_0x4fc3a3,_0x384051){return function(_0x406dd5){if(!_0x406dd5){_0x4fc3a3[_0x5bbd('0x17')](0x194);}return _0x406dd5;};}function handleError(_0x40544a,_0x233f67){_0x233f67=_0x233f67||0x1f4;return function(_0x3171d1){logger[_0x5bbd('0x27')](_0x3171d1[_0x5bbd('0x28')]);if(_0x3171d1['name']){delete _0x3171d1[_0x5bbd('0x29')];}_0x40544a[_0x5bbd('0x18')](_0x233f67)[_0x5bbd('0x2a')](_0x3171d1);};}exports[_0x5bbd('0x2b')]=function(_0x3b225b,_0x566ae8){var _0x2780b7={},_0x253964={},_0x4c7afc={'count':0x0,'rows':[]};var _0x3e1b41=_[_0x5bbd('0x2c')](db['Campaign'][_0x5bbd('0x2d')],function(_0x495029){return{'name':_0x495029[_0x5bbd('0x2e')],'type':_0x495029[_0x5bbd('0x2f')]['key']};});_0x253964['model']=_[_0x5bbd('0x2c')](_0x3e1b41,_0x5bbd('0x29'));_0x253964['query']=_[_0x5bbd('0x30')](_0x3b225b[_0x5bbd('0x31')]);_0x253964['filters']=_[_0x5bbd('0x32')](_0x253964[_0x5bbd('0x33')],_0x253964['query']);_0x2780b7[_0x5bbd('0x34')]=_[_0x5bbd('0x32')](_0x253964[_0x5bbd('0x33')],qs['fields'](_0x3b225b[_0x5bbd('0x31')][_0x5bbd('0x35')]));_0x2780b7[_0x5bbd('0x34')]=_0x2780b7['attributes']['length']?_0x2780b7[_0x5bbd('0x34')]:_0x253964[_0x5bbd('0x33')];if(!_0x3b225b[_0x5bbd('0x31')][_0x5bbd('0x36')]('nolimit')){_0x2780b7['limit']=qs[_0x5bbd('0x1e')](_0x3b225b[_0x5bbd('0x31')][_0x5bbd('0x1e')]);_0x2780b7['offset']=qs[_0x5bbd('0x1b')](_0x3b225b['query'][_0x5bbd('0x1b')]);}_0x2780b7[_0x5bbd('0x37')]=qs[_0x5bbd('0x38')](_0x3b225b[_0x5bbd('0x31')][_0x5bbd('0x38')]);_0x2780b7[_0x5bbd('0x39')]=qs[_0x5bbd('0x3a')](_['pick'](_0x3b225b[_0x5bbd('0x31')],_0x253964[_0x5bbd('0x3a')]),_0x3e1b41);if(_0x3b225b[_0x5bbd('0x31')][_0x5bbd('0x3b')]){_0x2780b7['where']=_[_0x5bbd('0x3c')](_0x2780b7[_0x5bbd('0x39')],{'$or':_[_0x5bbd('0x2c')](_0x3e1b41,function(_0x20f53c){if(_0x20f53c[_0x5bbd('0x2f')]!=='VIRTUAL'){var _0x328080={};_0x328080[_0x20f53c[_0x5bbd('0x29')]]={'$like':'%'+_0x3b225b['query']['filter']+'%'};return _0x328080;}})});}_0x2780b7=_[_0x5bbd('0x3c')]({},_0x2780b7,_0x3b225b['options']);var _0x21ce75={'where':_0x2780b7['where']};return db[_0x5bbd('0x3d')]['count'](_0x21ce75)[_0x5bbd('0x24')](function(_0x5a80c9){_0x4c7afc['count']=_0x5a80c9;if(_0x3b225b['query'][_0x5bbd('0x3e')]){_0x2780b7['include']=[{'all':!![]}];}return db[_0x5bbd('0x3d')]['findAll'](_0x2780b7);})[_0x5bbd('0x24')](function(_0x217655){_0x4c7afc[_0x5bbd('0x3f')]=_0x217655;return _0x4c7afc;})[_0x5bbd('0x24')](respondWithFilteredResult(_0x566ae8,_0x2780b7))[_0x5bbd('0x40')](handleError(_0x566ae8,null));};exports[_0x5bbd('0x41')]=function(_0x4f4d1c,_0xc91bb7){var _0x5c11b1={'raw':![],'where':{'id':_0x4f4d1c['params']['id']}},_0x3073c9={};_0x3073c9[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db[_0x5bbd('0x3d')]['rawAttributes']);_0x3073c9[_0x5bbd('0x31')]=_['keys'](_0x4f4d1c[_0x5bbd('0x31')]);_0x3073c9['filters']=_[_0x5bbd('0x32')](_0x3073c9[_0x5bbd('0x33')],_0x3073c9[_0x5bbd('0x31')]);_0x5c11b1[_0x5bbd('0x34')]=_[_0x5bbd('0x32')](_0x3073c9[_0x5bbd('0x33')],qs[_0x5bbd('0x35')](_0x4f4d1c['query'][_0x5bbd('0x35')]));_0x5c11b1[_0x5bbd('0x34')]=_0x5c11b1['attributes']['length']?_0x5c11b1[_0x5bbd('0x34')]:_0x3073c9[_0x5bbd('0x33')];if(_0x4f4d1c[_0x5bbd('0x31')][_0x5bbd('0x3e')]){_0x5c11b1[_0x5bbd('0x42')]=[{'all':!![]}];}_0x5c11b1=_['merge']({},_0x5c11b1,_0x4f4d1c['options']);return db[_0x5bbd('0x3d')][_0x5bbd('0x43')](_0x5c11b1)[_0x5bbd('0x24')](handleEntityNotFound(_0xc91bb7,null))[_0x5bbd('0x24')](respondWithResult(_0xc91bb7,null))[_0x5bbd('0x40')](handleError(_0xc91bb7,null));};exports[_0x5bbd('0x44')]=function(_0x59ff93,_0x28d6c1){return db['Campaign'][_0x5bbd('0x44')](_0x59ff93[_0x5bbd('0x45')],{})['then'](function(_0x433429){var _0x596d80=_0x59ff93[_0x5bbd('0x46')]['get']({'plain':!![]});if(!_0x596d80)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596d80[_0x5bbd('0x47')]===_0x5bbd('0x46')){var _0x12061b=_0x433429[_0x5bbd('0x25')]({'plain':!![]});var _0x5706fb=_0x5bbd('0x48');return db[_0x5bbd('0x49')]['find']({'where':{'name':_0x5706fb,'userProfileId':_0x596d80[_0x5bbd('0x4a')]},'raw':!![]})[_0x5bbd('0x24')](function(_0x3de6c6){if(_0x3de6c6&&_0x3de6c6['autoAssociation']===0x0){return db['UserProfileResource'][_0x5bbd('0x44')]({'name':_0x12061b[_0x5bbd('0x29')],'resourceId':_0x12061b['id'],'type':_0x3de6c6[_0x5bbd('0x29')],'sectionId':_0x3de6c6['id']},{})[_0x5bbd('0x24')](function(){return _0x433429;});}else{return _0x433429;}})['catch'](function(_0x3c379a){logger['error'](_0x5bbd('0x4b'),_0x3c379a);throw _0x3c379a;});}return _0x433429;})[_0x5bbd('0x24')](respondWithResult(_0x28d6c1,0xc9))[_0x5bbd('0x40')](handleError(_0x28d6c1,null));};exports[_0x5bbd('0x4c')]=function(_0x8dbd91,_0x1c0d1f){var _0x1fa7dd={'where':{'id':_0x8dbd91['params']['id']}},_0x268e43={};_0x268e43[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db[_0x5bbd('0x3d')]['rawAttributes']);_0x1fa7dd[_0x5bbd('0x34')]=_[_0x5bbd('0x32')](_0x268e43['model'],qs['fields'](_0x8dbd91[_0x5bbd('0x31')][_0x5bbd('0x35')]));_0x1fa7dd[_0x5bbd('0x34')]=_0x1fa7dd[_0x5bbd('0x34')][_0x5bbd('0x4d')]?_0x1fa7dd[_0x5bbd('0x34')]:_0x268e43[_0x5bbd('0x33')];if(_0x8dbd91[_0x5bbd('0x31')][_0x5bbd('0x3e')]){_0x1fa7dd[_0x5bbd('0x42')]=[{'all':!![]}];}_0x1fa7dd=_[_0x5bbd('0x3c')]({},_0x1fa7dd,_0x8dbd91[_0x5bbd('0x4e')]);return db['Campaign'][_0x5bbd('0x43')](_0x1fa7dd)['then'](handleEntityNotFound(_0x1c0d1f,null))['then'](function(_0x304f96){if(_0x304f96){var _0x3f37db=_0x304f96[_0x5bbd('0x25')]({'plain':!![]});_0x3f37db=qs[_0x5bbd('0x4f')](_0x3f37db,['id',_0x5bbd('0x50'),_0x5bbd('0x51')]);_0x8dbd91[_0x5bbd('0x45')]=_[_0x5bbd('0x4f')](_0x8dbd91[_0x5bbd('0x45')],['id',_0x5bbd('0x50'),_0x5bbd('0x51')]);return db[_0x5bbd('0x3d')][_0x5bbd('0x44')](_[_0x5bbd('0x3c')](_0x3f37db,_0x8dbd91[_0x5bbd('0x45')]),{'include':_0x8dbd91[_0x5bbd('0x31')][_0x5bbd('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x92915e){var _0x5ddf3d=_0x8dbd91[_0x5bbd('0x46')][_0x5bbd('0x25')]({'plain':!![]});if(!_0x5ddf3d)throw new Error(_0x5bbd('0x52'));if(_0x5ddf3d[_0x5bbd('0x47')]===_0x5bbd('0x46')){var _0x328c2e=_0x92915e[_0x5bbd('0x25')]({'plain':!![]});var _0x3bbbdf=_0x5bbd('0x48');return db[_0x5bbd('0x49')]['find']({'where':{'name':_0x3bbbdf,'userProfileId':_0x5ddf3d['userProfileId']},'raw':!![]})['then'](function(_0x45ade6){if(_0x45ade6&&_0x45ade6[_0x5bbd('0x53')]===0x0){return db['UserProfileResource'][_0x5bbd('0x44')]({'name':_0x328c2e[_0x5bbd('0x29')],'resourceId':_0x328c2e['id'],'type':_0x45ade6[_0x5bbd('0x29')],'sectionId':_0x45ade6['id']},{})['then'](function(){return _0x92915e;});}else{return _0x92915e;}})['catch'](function(_0x1ab81e){logger[_0x5bbd('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ab81e);throw _0x1ab81e;});}return _0x92915e;});}})[_0x5bbd('0x24')](respondWithResult(_0x1c0d1f,0xc9))[_0x5bbd('0x40')](handleError(_0x1c0d1f,null));};exports[_0x5bbd('0x54')]=function(_0x287eff,_0x46dd10){if(_0x287eff[_0x5bbd('0x45')]['id']){delete _0x287eff['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x287eff[_0x5bbd('0x55')]['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x46dd10,null))[_0x5bbd('0x24')](saveUpdates(_0x287eff['body'],null))[_0x5bbd('0x24')](respondWithResult(_0x46dd10,null))[_0x5bbd('0x40')](handleError(_0x46dd10,null));};exports[_0x5bbd('0x56')]=function(_0x15110c,_0x20e587){return db[_0x5bbd('0x3d')][_0x5bbd('0x43')]({'where':{'id':_0x15110c['params']['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x20e587,null))[_0x5bbd('0x24')](removeEntity(_0x20e587,null))['catch'](handleError(_0x20e587,null));};exports[_0x5bbd('0x57')]=function(_0x20c006,_0x4ce2c3,_0x1dde5b){var _0x12a783={'raw':!![],'where':{}};var _0x334210={};var _0x4ddef1={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x20c006[_0x5bbd('0x55')]['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x4ce2c3,null))[_0x5bbd('0x24')](function(_0x2db217){if(_0x2db217){_0x334210[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db[_0x5bbd('0x58')][_0x5bbd('0x2d')]);_0x334210[_0x5bbd('0x31')]=_[_0x5bbd('0x30')](_0x20c006[_0x5bbd('0x31')]);_0x334210[_0x5bbd('0x3a')]=_['intersection'](_0x334210[_0x5bbd('0x33')],_0x334210[_0x5bbd('0x31')]);_0x12a783[_0x5bbd('0x34')]=_[_0x5bbd('0x32')](_0x334210[_0x5bbd('0x33')],qs[_0x5bbd('0x35')](_0x20c006['query']['fields']));_0x12a783[_0x5bbd('0x34')]=_0x12a783['attributes']['length']?_0x12a783[_0x5bbd('0x34')]:_0x334210[_0x5bbd('0x33')];if(!_0x20c006[_0x5bbd('0x31')][_0x5bbd('0x36')](_0x5bbd('0x59'))){_0x12a783['limit']=qs[_0x5bbd('0x1e')](_0x20c006[_0x5bbd('0x31')][_0x5bbd('0x1e')]);_0x12a783[_0x5bbd('0x1b')]=qs[_0x5bbd('0x1b')](_0x20c006[_0x5bbd('0x31')][_0x5bbd('0x1b')]);}_0x12a783[_0x5bbd('0x37')]=qs[_0x5bbd('0x38')](_0x20c006[_0x5bbd('0x31')]['sort']);_0x12a783[_0x5bbd('0x39')]=qs['filters'](_['pick'](_0x20c006[_0x5bbd('0x31')],_0x334210[_0x5bbd('0x3a')]));_0x12a783[_0x5bbd('0x39')]['CampaignId']=_0x2db217['id'];if(_0x20c006[_0x5bbd('0x31')][_0x5bbd('0x3b')]){_0x12a783[_0x5bbd('0x39')]=_[_0x5bbd('0x3c')](_0x12a783[_0x5bbd('0x39')],{'$or':_[_0x5bbd('0x2c')](_0x12a783['attributes'],function(_0x5203a8){var _0x313cf2={};_0x313cf2[_0x5203a8]={'$like':'%'+_0x20c006[_0x5bbd('0x31')]['filter']+'%'};return _0x313cf2;})});}_0x12a783=_['merge']({},_0x12a783,_0x20c006[_0x5bbd('0x4e')]);return db['CmHopper'][_0x5bbd('0x1d')]({'where':_0x12a783[_0x5bbd('0x39')]})[_0x5bbd('0x24')](function(_0x459def){_0x4ddef1[_0x5bbd('0x1d')]=_0x459def;if(_0x20c006[_0x5bbd('0x31')][_0x5bbd('0x3e')]){_0x12a783[_0x5bbd('0x42')]=[{'all':!![]}];}return db[_0x5bbd('0x58')][_0x5bbd('0x5a')](_0x12a783);})['then'](function(_0x4b2eb1){_0x4ddef1[_0x5bbd('0x3f')]=_0x4b2eb1;return _0x4ddef1;});}})[_0x5bbd('0x24')](respondWithFilteredResult(_0x4ce2c3,_0x12a783))['catch'](handleError(_0x4ce2c3,null));};exports['getHopperHistories']=function(_0x243fef,_0x3ac280,_0x16492e){var _0x100663={'raw':!![],'where':{}};var _0x513dfa={};var _0xb8681c={'count':0x0,'rows':[]};return db[_0x5bbd('0x3d')][_0x5bbd('0x5b')]({'where':{'id':_0x243fef[_0x5bbd('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ac280,null))[_0x5bbd('0x24')](function(_0x2b6576){if(_0x2b6576){_0x513dfa[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db[_0x5bbd('0x5c')][_0x5bbd('0x2d')]);_0x513dfa[_0x5bbd('0x31')]=_[_0x5bbd('0x30')](_0x243fef[_0x5bbd('0x31')]);_0x513dfa[_0x5bbd('0x3a')]=_['intersection'](_0x513dfa[_0x5bbd('0x33')],_0x513dfa[_0x5bbd('0x31')]);_0x100663['attributes']=_['intersection'](_0x513dfa['model'],qs['fields'](_0x243fef[_0x5bbd('0x31')]['fields']));_0x100663[_0x5bbd('0x34')]=_0x100663['attributes'][_0x5bbd('0x4d')]?_0x100663[_0x5bbd('0x34')]:_0x513dfa['model'];if(!_0x243fef[_0x5bbd('0x31')][_0x5bbd('0x36')]('nolimit')){_0x100663[_0x5bbd('0x1e')]=qs['limit'](_0x243fef['query'][_0x5bbd('0x1e')]);_0x100663['offset']=qs['offset'](_0x243fef['query'][_0x5bbd('0x1b')]);}_0x100663[_0x5bbd('0x37')]=qs[_0x5bbd('0x38')](_0x243fef[_0x5bbd('0x31')][_0x5bbd('0x38')]);_0x100663[_0x5bbd('0x39')]=qs[_0x5bbd('0x3a')](_[_0x5bbd('0x5d')](_0x243fef[_0x5bbd('0x31')],_0x513dfa['filters']));_0x100663[_0x5bbd('0x39')]['CampaignId']=_0x2b6576['id'];if(_0x243fef[_0x5bbd('0x31')][_0x5bbd('0x3b')]){_0x100663['where']=_[_0x5bbd('0x3c')](_0x100663['where'],{'$or':_[_0x5bbd('0x2c')](_0x100663[_0x5bbd('0x34')],function(_0x5bbdad){var _0x19e0c4={};_0x19e0c4[_0x5bbdad]={'$like':'%'+_0x243fef[_0x5bbd('0x31')][_0x5bbd('0x3b')]+'%'};return _0x19e0c4;})});}_0x100663=_[_0x5bbd('0x3c')]({},_0x100663,_0x243fef['options']);return db['CmHopperHistory'][_0x5bbd('0x1d')]({'where':_0x100663['where']})[_0x5bbd('0x24')](function(_0x3751d6){_0xb8681c['count']=_0x3751d6;if(_0x243fef[_0x5bbd('0x31')][_0x5bbd('0x3e')]){_0x100663[_0x5bbd('0x42')]=[{'all':!![]}];}return db[_0x5bbd('0x5c')][_0x5bbd('0x5a')](_0x100663);})[_0x5bbd('0x24')](function(_0x30d3cf){_0xb8681c[_0x5bbd('0x3f')]=_0x30d3cf;return _0xb8681c;});}})[_0x5bbd('0x24')](respondWithFilteredResult(_0x3ac280,_0x100663))[_0x5bbd('0x40')](handleError(_0x3ac280,null));};exports['getHopperFinals']=function(_0x2bed62,_0x5cdb01,_0x361a51){var _0x2e8a62={'raw':!![],'where':{}};var _0x4b5894={};var _0x171b43={'count':0x0,'rows':[]};return db[_0x5bbd('0x3d')][_0x5bbd('0x5b')]({'where':{'id':_0x2bed62[_0x5bbd('0x55')]['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x5cdb01,null))[_0x5bbd('0x24')](function(_0x3f92e2){if(_0x3f92e2){_0x4b5894[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db[_0x5bbd('0x5e')][_0x5bbd('0x2d')]);_0x4b5894[_0x5bbd('0x31')]=_['keys'](_0x2bed62[_0x5bbd('0x31')]);_0x4b5894[_0x5bbd('0x3a')]=_[_0x5bbd('0x32')](_0x4b5894[_0x5bbd('0x33')],_0x4b5894[_0x5bbd('0x31')]);_0x2e8a62['attributes']=_[_0x5bbd('0x32')](_0x4b5894[_0x5bbd('0x33')],qs[_0x5bbd('0x35')](_0x2bed62[_0x5bbd('0x31')]['fields']));_0x2e8a62[_0x5bbd('0x34')]=_0x2e8a62['attributes'][_0x5bbd('0x4d')]?_0x2e8a62[_0x5bbd('0x34')]:_0x4b5894[_0x5bbd('0x33')];if(!_0x2bed62[_0x5bbd('0x31')][_0x5bbd('0x36')](_0x5bbd('0x59'))){_0x2e8a62['limit']=qs['limit'](_0x2bed62[_0x5bbd('0x31')]['limit']);_0x2e8a62[_0x5bbd('0x1b')]=qs[_0x5bbd('0x1b')](_0x2bed62['query'][_0x5bbd('0x1b')]);}_0x2e8a62[_0x5bbd('0x37')]=qs[_0x5bbd('0x38')](_0x2bed62['query'][_0x5bbd('0x38')]);_0x2e8a62[_0x5bbd('0x39')]=qs[_0x5bbd('0x3a')](_[_0x5bbd('0x5d')](_0x2bed62['query'],_0x4b5894[_0x5bbd('0x3a')]));_0x2e8a62[_0x5bbd('0x39')][_0x5bbd('0x5f')]=_0x3f92e2['id'];if(_0x2bed62[_0x5bbd('0x31')][_0x5bbd('0x3b')]){_0x2e8a62[_0x5bbd('0x39')]=_[_0x5bbd('0x3c')](_0x2e8a62[_0x5bbd('0x39')],{'$or':_[_0x5bbd('0x2c')](_0x2e8a62[_0x5bbd('0x34')],function(_0x46879a){var _0x51cc10={};_0x51cc10[_0x46879a]={'$like':'%'+_0x2bed62[_0x5bbd('0x31')][_0x5bbd('0x3b')]+'%'};return _0x51cc10;})});}_0x2e8a62=_[_0x5bbd('0x3c')]({},_0x2e8a62,_0x2bed62['options']);return db['CmHopperFinal'][_0x5bbd('0x1d')]({'where':_0x2e8a62['where']})[_0x5bbd('0x24')](function(_0x3dfcf9){_0x171b43[_0x5bbd('0x1d')]=_0x3dfcf9;if(_0x2bed62['query'][_0x5bbd('0x3e')]){_0x2e8a62[_0x5bbd('0x42')]=[{'all':!![]}];}return db[_0x5bbd('0x5e')][_0x5bbd('0x5a')](_0x2e8a62);})['then'](function(_0x38fd09){_0x171b43[_0x5bbd('0x3f')]=_0x38fd09;return _0x171b43;});}})[_0x5bbd('0x24')](respondWithFilteredResult(_0x5cdb01,_0x2e8a62))['catch'](handleError(_0x5cdb01,null));};exports[_0x5bbd('0x60')]=function(_0x223d8a,_0x599559,_0x4d6e62){var _0x50598e={'raw':!![],'where':{}};var _0xd82adc={};var _0x230f53={'count':0x0,'rows':[]};return db[_0x5bbd('0x3d')][_0x5bbd('0x5b')]({'where':{'id':_0x223d8a['params']['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x599559,null))['then'](function(_0x357751){if(_0x357751){_0xd82adc[_0x5bbd('0x33')]=_['keys'](db[_0x5bbd('0x61')]['rawAttributes']);_0xd82adc['query']=_['keys'](_0x223d8a[_0x5bbd('0x31')]);_0xd82adc[_0x5bbd('0x3a')]=_[_0x5bbd('0x32')](_0xd82adc[_0x5bbd('0x33')],_0xd82adc[_0x5bbd('0x31')]);_0x50598e[_0x5bbd('0x34')]=_['intersection'](_0xd82adc[_0x5bbd('0x33')],qs['fields'](_0x223d8a[_0x5bbd('0x31')]['fields']));_0x50598e[_0x5bbd('0x34')]=_0x50598e['attributes'][_0x5bbd('0x4d')]?_0x50598e[_0x5bbd('0x34')]:_0xd82adc[_0x5bbd('0x33')];if(!_0x223d8a[_0x5bbd('0x31')]['hasOwnProperty'](_0x5bbd('0x59'))){_0x50598e[_0x5bbd('0x1e')]=qs['limit'](_0x223d8a[_0x5bbd('0x31')][_0x5bbd('0x1e')]);_0x50598e[_0x5bbd('0x1b')]=qs[_0x5bbd('0x1b')](_0x223d8a[_0x5bbd('0x31')]['offset']);}_0x50598e[_0x5bbd('0x37')]=qs[_0x5bbd('0x38')](_0x223d8a[_0x5bbd('0x31')][_0x5bbd('0x38')]);_0x50598e[_0x5bbd('0x39')]=qs[_0x5bbd('0x3a')](_['pick'](_0x223d8a['query'],_0xd82adc['filters']));_0x50598e[_0x5bbd('0x39')][_0x5bbd('0x5f')]=_0x357751['id'];if(_0x223d8a['query']['filter']){_0x50598e[_0x5bbd('0x39')]=_[_0x5bbd('0x3c')](_0x50598e[_0x5bbd('0x39')],{'$or':_[_0x5bbd('0x2c')](_0x50598e['attributes'],function(_0x5b1f5c){var _0x34cdcb={};_0x34cdcb[_0x5b1f5c]={'$like':'%'+_0x223d8a[_0x5bbd('0x31')]['filter']+'%'};return _0x34cdcb;})});}_0x50598e=_[_0x5bbd('0x3c')]({},_0x50598e,_0x223d8a[_0x5bbd('0x4e')]);return db[_0x5bbd('0x61')][_0x5bbd('0x1d')]({'where':_0x50598e[_0x5bbd('0x39')]})[_0x5bbd('0x24')](function(_0x64ebbf){_0x230f53[_0x5bbd('0x1d')]=_0x64ebbf;if(_0x223d8a[_0x5bbd('0x31')][_0x5bbd('0x3e')]){_0x50598e[_0x5bbd('0x42')]=[{'all':!![]}];}return db[_0x5bbd('0x61')][_0x5bbd('0x5a')](_0x50598e);})['then'](function(_0x4a9d9d){_0x230f53[_0x5bbd('0x3f')]=_0x4a9d9d;return _0x230f53;});}})[_0x5bbd('0x24')](respondWithFilteredResult(_0x599559,_0x50598e))['catch'](handleError(_0x599559,null));};exports[_0x5bbd('0x62')]=function(_0x2a1812,_0x32373,_0x84ebce){var _0x1b4aa7={};var _0x2d6114={};var _0x39497e;var _0x53af90;return db[_0x5bbd('0x3d')][_0x5bbd('0x5b')]({'where':{'id':_0x2a1812[_0x5bbd('0x55')]['id']}})['then'](handleEntityNotFound(_0x32373,null))['then'](function(_0x445057){if(_0x445057){_0x39497e=_0x445057;_0x2d6114[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db['CmList'][_0x5bbd('0x2d')]);_0x2d6114[_0x5bbd('0x31')]=_[_0x5bbd('0x30')](_0x2a1812['query']);_0x2d6114[_0x5bbd('0x3a')]=_['intersection'](_0x2d6114[_0x5bbd('0x33')],_0x2d6114['query']);_0x1b4aa7['attributes']=_[_0x5bbd('0x32')](_0x2d6114['model'],qs[_0x5bbd('0x35')](_0x2a1812[_0x5bbd('0x31')][_0x5bbd('0x35')]));_0x1b4aa7['attributes']=_0x1b4aa7[_0x5bbd('0x34')][_0x5bbd('0x4d')]?_0x1b4aa7[_0x5bbd('0x34')]:_0x2d6114['model'];_0x1b4aa7[_0x5bbd('0x37')]=qs['sort'](_0x2a1812[_0x5bbd('0x31')]['sort']);_0x1b4aa7[_0x5bbd('0x39')]=qs[_0x5bbd('0x3a')](_[_0x5bbd('0x5d')](_0x2a1812[_0x5bbd('0x31')],_0x2d6114[_0x5bbd('0x3a')]));if(_0x2a1812[_0x5bbd('0x31')]['filter']){_0x1b4aa7[_0x5bbd('0x39')]=_[_0x5bbd('0x3c')](_0x1b4aa7[_0x5bbd('0x39')],{'$or':_[_0x5bbd('0x2c')](_0x1b4aa7['attributes'],function(_0x29f038){var _0x1437be={};_0x1437be[_0x29f038]={'$like':'%'+_0x2a1812[_0x5bbd('0x31')][_0x5bbd('0x3b')]+'%'};return _0x1437be;})});}_0x1b4aa7=_[_0x5bbd('0x3c')]({},_0x1b4aa7,_0x2a1812[_0x5bbd('0x4e')]);return _0x39497e[_0x5bbd('0x62')](_0x1b4aa7);}})[_0x5bbd('0x24')](function(_0x1f2be0){if(_0x1f2be0){_0x53af90=_0x1f2be0[_0x5bbd('0x4d')];if(!_0x2a1812[_0x5bbd('0x31')]['hasOwnProperty'](_0x5bbd('0x59'))){_0x1b4aa7['limit']=qs[_0x5bbd('0x1e')](_0x2a1812['query']['limit']);_0x1b4aa7[_0x5bbd('0x1b')]=qs[_0x5bbd('0x1b')](_0x2a1812[_0x5bbd('0x31')][_0x5bbd('0x1b')]);}return _0x39497e['getLists'](_0x1b4aa7);}})[_0x5bbd('0x24')](function(_0x525392){if(_0x525392){return _0x525392?{'count':_0x53af90,'rows':_0x525392}:null;}})[_0x5bbd('0x24')](respondWithResult(_0x32373,null))[_0x5bbd('0x40')](handleError(_0x32373,null));};exports[_0x5bbd('0x63')]=function(_0x374a4c,_0x530d79,_0x3e60eb){var _0x21db6d,_0x5363f6;return db['Campaign'][_0x5bbd('0x43')]({'where':{'id':_0x374a4c[_0x5bbd('0x55')]['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x530d79,null))['then'](function(_0x52ee7b){if(_0x52ee7b){_0x5363f6=_0x52ee7b;return _0x52ee7b['addLists'](_0x374a4c['body'][_0x5bbd('0x64')],_[_0x5bbd('0x4f')](_0x374a4c[_0x5bbd('0x45')],[_0x5bbd('0x64'),'id'])||{});}return null;})[_0x5bbd('0x65')](function(_0xf3716c){var _0x170495;_0x21db6d=_0xf3716c||[];var _0x37fc9c=[];if(_0xf3716c){for(var _0x51f3da=0x0;_0x51f3da<_0xf3716c[_0x5bbd('0x4d')];_0x51f3da+=0x1){var _0x283cd8=_0xf3716c[_0x51f3da]['get']({'plain':!![]});_0x5363f6[_0x5bbd('0x66')]=_0x374a4c[_0x5bbd('0x45')][_0x5bbd('0x66')]?_0x374a4c[_0x5bbd('0x45')][_0x5bbd('0x66')]:_0x5363f6['dialCheckDuplicateType'];switch(_0x5363f6[_0x5bbd('0x66')]){case _0x5bbd('0x67'):_0x170495=squel[_0x5bbd('0x68')]()[_0x5bbd('0x69')]('cm_hopper')[_0x5bbd('0x6a')]([_0x5bbd('0x6b'),_0x5bbd('0x6c'),'ContactId','ListId',_0x5bbd('0x5f'),_0x5bbd('0x50'),_0x5bbd('0x51')],squel[_0x5bbd('0x6d')]()[_0x5bbd('0x6e')](_0x5bbd('0x6b'),_0x5bbd('0x6b'))[_0x5bbd('0x6e')]('NOW()',_0x5bbd('0x6c'))[_0x5bbd('0x6e')]('id','ContactId')['field'](_0x283cd8[_0x5bbd('0x6f')][_0x5bbd('0x70')](),_0x5bbd('0x71'))[_0x5bbd('0x6e')](_0x374a4c[_0x5bbd('0x55')]['id'][_0x5bbd('0x70')](),'CampaignId')[_0x5bbd('0x6e')](_0x5bbd('0x72'),'createdAt')[_0x5bbd('0x6e')](_0x5bbd('0x72'),_0x5bbd('0x51'))[_0x5bbd('0x73')](_0x5bbd('0x74'))[_0x5bbd('0x39')](_0x5bbd('0x75'))['where'](_0x5bbd('0x76'),_0x283cd8[_0x5bbd('0x6f')][_0x5bbd('0x70')]())[_0x5bbd('0x39')](_0x5bbd('0x77'))[_0x5bbd('0x39')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5bbd('0x6e')](_0x5bbd('0x78'))[_0x5bbd('0x73')]('cm_hopper_final')[_0x5bbd('0x39')]('CampaignId\x20=\x20?',_0x374a4c[_0x5bbd('0x55')]['id'][_0x5bbd('0x70')]()))['where'](_0x5bbd('0x79'),squel[_0x5bbd('0x6d')]()[_0x5bbd('0x6e')](_0x5bbd('0x7a'))['from'](_0x5bbd('0x7b'))[_0x5bbd('0x39')](_0x5bbd('0x7c'),_0x374a4c[_0x5bbd('0x55')]['id'][_0x5bbd('0x70')]())))[_0x5bbd('0x70')]();break;case _0x5bbd('0x7d'):_0x170495=squel['insert']()[_0x5bbd('0x69')](_0x5bbd('0x7b'))['fromQuery']([_0x5bbd('0x6b'),_0x5bbd('0x6c'),_0x5bbd('0x7e'),'ListId',_0x5bbd('0x5f'),'createdAt',_0x5bbd('0x51')],squel[_0x5bbd('0x6d')]()[_0x5bbd('0x6e')]('phone',_0x5bbd('0x6b'))[_0x5bbd('0x6e')](_0x5bbd('0x72'),_0x5bbd('0x6c'))['field']('id','ContactId')['field'](_0x283cd8['CmListId'][_0x5bbd('0x70')](),_0x5bbd('0x71'))[_0x5bbd('0x6e')](_0x374a4c[_0x5bbd('0x55')]['id'][_0x5bbd('0x70')](),_0x5bbd('0x5f'))[_0x5bbd('0x6e')](_0x5bbd('0x72'),_0x5bbd('0x50'))[_0x5bbd('0x6e')](_0x5bbd('0x72'),_0x5bbd('0x51'))[_0x5bbd('0x73')](_0x5bbd('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0x5bbd('0x39')]('ListId\x20=\x20?',_0x283cd8['CmListId'][_0x5bbd('0x70')]())[_0x5bbd('0x39')](_0x5bbd('0x77'))[_0x5bbd('0x39')](_0x5bbd('0x79'),squel[_0x5bbd('0x6d')]()[_0x5bbd('0x6e')](_0x5bbd('0x7a'))[_0x5bbd('0x73')](_0x5bbd('0x7b'))[_0x5bbd('0x39')]('CampaignId\x20=\x20?',_0x374a4c[_0x5bbd('0x55')]['id'][_0x5bbd('0x70')]())))[_0x5bbd('0x70')]();break;default:_0x170495=squel[_0x5bbd('0x68')]()[_0x5bbd('0x69')](_0x5bbd('0x7b'))[_0x5bbd('0x6a')]([_0x5bbd('0x6b'),_0x5bbd('0x6c'),'ContactId',_0x5bbd('0x71'),'CampaignId','createdAt','updatedAt'],squel[_0x5bbd('0x6d')]()[_0x5bbd('0x6e')](_0x5bbd('0x6b'),_0x5bbd('0x6b'))['field'](_0x5bbd('0x72'),_0x5bbd('0x6c'))[_0x5bbd('0x6e')]('id',_0x5bbd('0x7e'))[_0x5bbd('0x6e')](_0x283cd8[_0x5bbd('0x6f')][_0x5bbd('0x70')](),_0x5bbd('0x71'))[_0x5bbd('0x6e')](_0x374a4c['params']['id'][_0x5bbd('0x70')](),_0x5bbd('0x5f'))[_0x5bbd('0x6e')](_0x5bbd('0x72'),'createdAt')[_0x5bbd('0x6e')](_0x5bbd('0x72'),'updatedAt')[_0x5bbd('0x73')]('cm_contacts')[_0x5bbd('0x39')](_0x5bbd('0x75'))[_0x5bbd('0x39')](_0x5bbd('0x76'),_0x283cd8[_0x5bbd('0x6f')][_0x5bbd('0x70')]())[_0x5bbd('0x39')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x37fc9c[_0x5bbd('0x7f')](db[_0x5bbd('0x80')][_0x5bbd('0x31')](_0x170495));}return BPromise['all'](_0x37fc9c);}})[_0x5bbd('0x24')](function(){return _0x21db6d;})[_0x5bbd('0x24')](respondWithResult(_0x530d79,null))[_0x5bbd('0x40')](handleError(_0x530d79,null));};exports[_0x5bbd('0x81')]=function(_0x26630d,_0x26e833,_0x32ea4b){return db[_0x5bbd('0x3d')][_0x5bbd('0x43')]({'where':{'id':_0x26630d['params']['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x26e833,null))[_0x5bbd('0x24')](function(_0x45414a){if(_0x45414a){return _0x45414a[_0x5bbd('0x81')](_0x26630d['query'][_0x5bbd('0x64')]);}})[_0x5bbd('0x24')](function(_0x39e682){if(_0x39e682){return db[_0x5bbd('0x58')][_0x5bbd('0x56')]({'where':{'ListId':_0x26630d[_0x5bbd('0x31')][_0x5bbd('0x64')],'CampaignId':_0x26630d[_0x5bbd('0x55')]['id']}})['then'](function(){return _0x39e682;});}})['then'](respondWithStatusCode(_0x26e833,null))[_0x5bbd('0x40')](handleError(_0x26e833,null));};exports[_0x5bbd('0x82')]=function(_0x5c25be,_0xe5cf06,_0x2c99a8){var _0x29ab31={};var _0x4d843d={};var _0xe851e0;var _0x1771e4;return db[_0x5bbd('0x3d')][_0x5bbd('0x5b')]({'where':{'id':_0x5c25be[_0x5bbd('0x55')]['id']}})['then'](handleEntityNotFound(_0xe5cf06,null))[_0x5bbd('0x24')](function(_0xcd41f1){if(_0xcd41f1){_0xe851e0=_0xcd41f1;_0x4d843d[_0x5bbd('0x33')]=_[_0x5bbd('0x30')](db[_0x5bbd('0x83')][_0x5bbd('0x2d')]);_0x4d843d[_0x5bbd('0x31')]=_[_0x5bbd('0x30')](_0x5c25be[_0x5bbd('0x31')]);_0x4d843d[_0x5bbd('0x3a')]=_[_0x5bbd('0x32')](_0x4d843d[_0x5bbd('0x33')],_0x4d843d[_0x5bbd('0x31')]);_0x29ab31[_0x5bbd('0x34')]=_[_0x5bbd('0x32')](_0x4d843d['model'],qs['fields'](_0x5c25be[_0x5bbd('0x31')][_0x5bbd('0x35')]));_0x29ab31[_0x5bbd('0x34')]=_0x29ab31[_0x5bbd('0x34')]['length']?_0x29ab31[_0x5bbd('0x34')]:_0x4d843d['model'];_0x29ab31[_0x5bbd('0x37')]=qs[_0x5bbd('0x38')](_0x5c25be[_0x5bbd('0x31')]['sort']);_0x29ab31[_0x5bbd('0x39')]=qs['filters'](_[_0x5bbd('0x5d')](_0x5c25be[_0x5bbd('0x31')],_0x4d843d[_0x5bbd('0x3a')]));if(_0x5c25be[_0x5bbd('0x31')][_0x5bbd('0x3b')]){_0x29ab31[_0x5bbd('0x39')]=_[_0x5bbd('0x3c')](_0x29ab31[_0x5bbd('0x39')],{'$or':_[_0x5bbd('0x2c')](_0x29ab31['attributes'],function(_0xf57aa8){var _0x1e2760={};_0x1e2760[_0xf57aa8]={'$like':'%'+_0x5c25be['query']['filter']+'%'};return _0x1e2760;})});}_0x29ab31=_[_0x5bbd('0x3c')]({},_0x29ab31,_0x5c25be['options']);return _0xe851e0['getBlackLists'](_0x29ab31);}})['then'](function(_0x3bc6b8){if(_0x3bc6b8){_0x1771e4=_0x3bc6b8[_0x5bbd('0x4d')];if(!_0x5c25be[_0x5bbd('0x31')][_0x5bbd('0x36')](_0x5bbd('0x59'))){_0x29ab31[_0x5bbd('0x1e')]=qs[_0x5bbd('0x1e')](_0x5c25be[_0x5bbd('0x31')][_0x5bbd('0x1e')]);_0x29ab31[_0x5bbd('0x1b')]=qs[_0x5bbd('0x1b')](_0x5c25be[_0x5bbd('0x31')][_0x5bbd('0x1b')]);}return _0xe851e0['getBlackLists'](_0x29ab31);}})['then'](function(_0x222d12){if(_0x222d12){return _0x222d12?{'count':_0x1771e4,'rows':_0x222d12}:null;}})['then'](respondWithResult(_0xe5cf06,null))[_0x5bbd('0x40')](handleError(_0xe5cf06,null));};exports['addBlackLists']=function(_0xa12d62,_0x1469a1,_0x143d7b){var _0x2d0ba3,_0xb3d3f9;return db[_0x5bbd('0x3d')][_0x5bbd('0x43')]({'where':{'id':_0xa12d62['params']['id']}})[_0x5bbd('0x24')](handleEntityNotFound(_0x1469a1,null))[_0x5bbd('0x24')](function(_0x4e5259){if(_0x4e5259){_0xb3d3f9=_0x4e5259;return _0x4e5259[_0x5bbd('0x84')](_0xa12d62[_0x5bbd('0x45')][_0x5bbd('0x64')],_[_0x5bbd('0x4f')](_0xa12d62[_0x5bbd('0x45')],[_0x5bbd('0x64'),'id'])||{});}return null;})[_0x5bbd('0x65')](function(_0x5281f0){var _0x48cba5;_0x2d0ba3=_0x5281f0||[];var _0xa51f9b=[];if(_0x5281f0){for(var _0xc7ad90=0x0;_0xc7ad90<_0x5281f0[_0x5bbd('0x4d')];_0xc7ad90+=0x1){var _0x253ae5=_0x5281f0[_0xc7ad90][_0x5bbd('0x25')]({'plain':!![]});_0x48cba5=squel[_0x5bbd('0x68')]()['into'](_0x5bbd('0x85'))[_0x5bbd('0x6a')]([_0x5bbd('0x6b'),_0x5bbd('0x7e'),_0x5bbd('0x71'),'CampaignId',_0x5bbd('0x50'),_0x5bbd('0x51')],squel['select']()[_0x5bbd('0x6e')]('phone',_0x5bbd('0x6b'))[_0x5bbd('0x6e')]('id',_0x5bbd('0x7e'))['field'](_0x253ae5[_0x5bbd('0x6f')][_0x5bbd('0x70')](),_0x5bbd('0x71'))[_0x5bbd('0x6e')](_0xa12d62[_0x5bbd('0x55')]['id'][_0x5bbd('0x70')](),_0x5bbd('0x5f'))[_0x5bbd('0x6e')](_0x5bbd('0x72'),_0x5bbd('0x50'))[_0x5bbd('0x6e')](_0x5bbd('0x72'),_0x5bbd('0x51'))[_0x5bbd('0x73')](_0x5bbd('0x74'))[_0x5bbd('0x39')]('deletedAt\x20IS\x20NULL')[_0x5bbd('0x39')](_0x5bbd('0x76'),_0x253ae5[_0x5bbd('0x6f')]['toString']())[_0x5bbd('0x39')](_0x5bbd('0x77')))[_0x5bbd('0x70')]();_0xa51f9b['push'](db[_0x5bbd('0x80')]['query'](_0x48cba5));}return BPromise['all'](_0xa51f9b);}})[_0x5bbd('0x24')](function(){return _0x2d0ba3;})[_0x5bbd('0x24')](respondWithResult(_0x1469a1,null))['catch'](handleError(_0x1469a1,null));};exports[_0x5bbd('0x86')]=function(_0x18f7f9,_0x5c12c1,_0x24153e){return db[_0x5bbd('0x3d')]['find']({'where':{'id':_0x18f7f9[_0x5bbd('0x55')]['id']}})['then'](handleEntityNotFound(_0x5c12c1,null))[_0x5bbd('0x24')](function(_0x1b592a){if(_0x1b592a){return _0x1b592a[_0x5bbd('0x86')](_0x18f7f9['query']['ids']);}})[_0x5bbd('0x24')](function(_0x461095){if(_0x461095){return db[_0x5bbd('0x61')][_0x5bbd('0x56')]({'where':{'ListId':_0x18f7f9[_0x5bbd('0x31')][_0x5bbd('0x64')],'CampaignId':_0x18f7f9[_0x5bbd('0x55')]['id']}})[_0x5bbd('0x24')](function(){return _0x461095;});}})[_0x5bbd('0x24')](respondWithStatusCode(_0x5c12c1,null))[_0x5bbd('0x40')](handleError(_0x5c12c1,null));}; \ No newline at end of file +var _0xa2b6=['addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','push','sequelize','removeLists','CmList','getBlackLists','addBlackLists','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','get','IvrCampaigns','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','Campaign','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','CmHopper','nolimit','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists'];(function(_0x16e044,_0x4ddba6){var _0x142724=function(_0x290a58){while(--_0x290a58){_0x16e044['push'](_0x16e044['shift']());}};_0x142724(++_0x4ddba6);}(_0xa2b6,0xa5));var _0x6a2b=function(_0x100545,_0x2e6cb4){_0x100545=_0x100545-0x0;var _0x27f2e0=_0xa2b6[_0x100545];return _0x27f2e0;};'use strict';var emlformat=require(_0x6a2b('0x0'));var rimraf=require(_0x6a2b('0x1'));var zipdir=require(_0x6a2b('0x2'));var jsonpatch=require(_0x6a2b('0x3'));var rp=require(_0x6a2b('0x4'));var moment=require(_0x6a2b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6a2b('0x6'));var util=require(_0x6a2b('0x7'));var path=require(_0x6a2b('0x8'));var sox=require('sox');var csv=require(_0x6a2b('0x9'));var ejs=require(_0x6a2b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a2b('0xb'));var squel=require(_0x6a2b('0xc'));var crypto=require('crypto');var jsforce=require(_0x6a2b('0xd'));var deskjs=require(_0x6a2b('0xe'));var toCsv=require(_0x6a2b('0x9'));var querystring=require(_0x6a2b('0xf'));var Papa=require('papaparse');var Redis=require(_0x6a2b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6a2b('0x11'));var as=require(_0x6a2b('0x12'));var hardwareService=require(_0x6a2b('0x13'));var logger=require('../../config/logger')(_0x6a2b('0x14'));var utils=require(_0x6a2b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a2b('0x16'))['db'];function respondWithStatusCode(_0x1912fb,_0x4df1cf){_0x4df1cf=_0x4df1cf||0xcc;return function(_0x13d5a3){if(_0x13d5a3){return _0x1912fb[_0x6a2b('0x17')](_0x4df1cf);}return _0x1912fb['status'](_0x4df1cf)[_0x6a2b('0x18')]();};}function respondWithResult(_0x1e778a,_0x297d89){_0x297d89=_0x297d89||0xc8;return function(_0x55ae31){if(_0x55ae31){return _0x1e778a[_0x6a2b('0x19')](_0x297d89)[_0x6a2b('0x1a')](_0x55ae31);}};}function respondWithFilteredResult(_0x2f8405,_0x4cb3cb){return function(_0xfd6773){if(_0xfd6773){var _0xaaaae=typeof _0x4cb3cb['offset']===_0x6a2b('0x1b')&&typeof _0x4cb3cb[_0x6a2b('0x1c')]===_0x6a2b('0x1b');var _0x509767=_0xfd6773[_0x6a2b('0x1d')];var _0x3b09ea=_0xaaaae?0x0:_0x4cb3cb[_0x6a2b('0x1e')];var _0xd38780=_0xaaaae?_0xfd6773['count']:_0x4cb3cb[_0x6a2b('0x1e')]+_0x4cb3cb[_0x6a2b('0x1c')];var _0x20808b;if(_0xd38780>=_0x509767){_0xd38780=_0x509767;_0x20808b=0xc8;}else{_0x20808b=0xce;}_0x2f8405[_0x6a2b('0x19')](_0x20808b);return _0x2f8405['set'](_0x6a2b('0x1f'),_0x3b09ea+'-'+_0xd38780+'/'+_0x509767)[_0x6a2b('0x1a')](_0xfd6773);}return null;};}function patchUpdates(_0x35c29c){return function(_0x23156c){try{jsonpatch[_0x6a2b('0x20')](_0x23156c,_0x35c29c,!![]);}catch(_0x3cc4c0){return BPromise[_0x6a2b('0x21')](_0x3cc4c0);}return _0x23156c[_0x6a2b('0x22')]();};}function saveUpdates(_0x484299,_0x1b86b1){return function(_0x3f8ede){if(_0x3f8ede){return _0x3f8ede['update'](_0x484299)['then'](function(_0x4f0643){return _0x4f0643;});}return null;};}function removeEntity(_0x4cfc79,_0x5eda9e){return function(_0x388f7d){if(_0x388f7d){return _0x388f7d['destroy']()[_0x6a2b('0x23')](function(){var _0x494824=_0x388f7d[_0x6a2b('0x24')]({'plain':!![]});var _0x537b37=_0x6a2b('0x25');return db['UserProfileResource'][_0x6a2b('0x26')]({'where':{'type':_0x537b37,'resourceId':_0x494824['id']}})['then'](function(){return _0x388f7d;});})['then'](function(){_0x4cfc79['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x133f3d,_0x1d42b4){return function(_0xe47a44){if(!_0xe47a44){_0x133f3d[_0x6a2b('0x17')](0x194);}return _0xe47a44;};}function handleError(_0x38c70,_0x10e7c0){_0x10e7c0=_0x10e7c0||0x1f4;return function(_0x231bea){logger['error'](_0x231bea['stack']);if(_0x231bea['name']){delete _0x231bea[_0x6a2b('0x27')];}_0x38c70[_0x6a2b('0x19')](_0x10e7c0)[_0x6a2b('0x28')](_0x231bea);};}exports[_0x6a2b('0x29')]=function(_0x41d87e,_0x5aefa0){var _0x1855ee={},_0x400b9b={},_0x7f7102={'count':0x0,'rows':[]};var _0x28f3b6=_[_0x6a2b('0x2a')](db['Campaign'][_0x6a2b('0x2b')],function(_0x4893a9){return{'name':_0x4893a9[_0x6a2b('0x2c')],'type':_0x4893a9[_0x6a2b('0x2d')][_0x6a2b('0x2e')]};});_0x400b9b[_0x6a2b('0x2f')]=_[_0x6a2b('0x2a')](_0x28f3b6,_0x6a2b('0x27'));_0x400b9b[_0x6a2b('0x30')]=_[_0x6a2b('0x31')](_0x41d87e[_0x6a2b('0x30')]);_0x400b9b[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0x400b9b[_0x6a2b('0x2f')],_0x400b9b[_0x6a2b('0x30')]);_0x1855ee[_0x6a2b('0x34')]=_['intersection'](_0x400b9b[_0x6a2b('0x2f')],qs[_0x6a2b('0x35')](_0x41d87e[_0x6a2b('0x30')]['fields']));_0x1855ee[_0x6a2b('0x34')]=_0x1855ee[_0x6a2b('0x34')][_0x6a2b('0x36')]?_0x1855ee[_0x6a2b('0x34')]:_0x400b9b[_0x6a2b('0x2f')];if(!_0x41d87e[_0x6a2b('0x30')][_0x6a2b('0x37')]('nolimit')){_0x1855ee[_0x6a2b('0x1c')]=qs['limit'](_0x41d87e[_0x6a2b('0x30')][_0x6a2b('0x1c')]);_0x1855ee['offset']=qs[_0x6a2b('0x1e')](_0x41d87e['query']['offset']);}_0x1855ee[_0x6a2b('0x38')]=qs[_0x6a2b('0x39')](_0x41d87e[_0x6a2b('0x30')][_0x6a2b('0x39')]);_0x1855ee[_0x6a2b('0x3a')]=qs['filters'](_[_0x6a2b('0x3b')](_0x41d87e[_0x6a2b('0x30')],_0x400b9b[_0x6a2b('0x32')]),_0x28f3b6);if(_0x41d87e[_0x6a2b('0x30')][_0x6a2b('0x3c')]){_0x1855ee[_0x6a2b('0x3a')]=_[_0x6a2b('0x3d')](_0x1855ee[_0x6a2b('0x3a')],{'$or':_[_0x6a2b('0x2a')](_0x28f3b6,function(_0x2bb964){if(_0x2bb964[_0x6a2b('0x2d')]!=='VIRTUAL'){var _0x277a03={};_0x277a03[_0x2bb964['name']]={'$like':'%'+_0x41d87e['query'][_0x6a2b('0x3c')]+'%'};return _0x277a03;}})});}_0x1855ee=_[_0x6a2b('0x3d')]({},_0x1855ee,_0x41d87e[_0x6a2b('0x3e')]);var _0x487a96={'where':_0x1855ee[_0x6a2b('0x3a')]};return db['Campaign'][_0x6a2b('0x1d')](_0x487a96)[_0x6a2b('0x23')](function(_0x47bdf1){_0x7f7102['count']=_0x47bdf1;if(_0x41d87e[_0x6a2b('0x30')][_0x6a2b('0x3f')]){_0x1855ee[_0x6a2b('0x40')]=[{'all':!![]}];}return db[_0x6a2b('0x41')][_0x6a2b('0x42')](_0x1855ee);})['then'](function(_0x3f0e90){_0x7f7102[_0x6a2b('0x43')]=_0x3f0e90;return _0x7f7102;})[_0x6a2b('0x23')](respondWithFilteredResult(_0x5aefa0,_0x1855ee))[_0x6a2b('0x44')](handleError(_0x5aefa0,null));};exports['show']=function(_0x163425,_0x2c5d3f){var _0x5991bd={'raw':![],'where':{'id':_0x163425[_0x6a2b('0x45')]['id']}},_0x2a4b71={};_0x2a4b71[_0x6a2b('0x2f')]=_[_0x6a2b('0x31')](db[_0x6a2b('0x41')][_0x6a2b('0x2b')]);_0x2a4b71[_0x6a2b('0x30')]=_['keys'](_0x163425[_0x6a2b('0x30')]);_0x2a4b71[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0x2a4b71[_0x6a2b('0x2f')],_0x2a4b71[_0x6a2b('0x30')]);_0x5991bd[_0x6a2b('0x34')]=_[_0x6a2b('0x33')](_0x2a4b71[_0x6a2b('0x2f')],qs['fields'](_0x163425[_0x6a2b('0x30')][_0x6a2b('0x35')]));_0x5991bd[_0x6a2b('0x34')]=_0x5991bd['attributes'][_0x6a2b('0x36')]?_0x5991bd['attributes']:_0x2a4b71[_0x6a2b('0x2f')];if(_0x163425[_0x6a2b('0x30')][_0x6a2b('0x3f')]){_0x5991bd[_0x6a2b('0x40')]=[{'all':!![]}];}_0x5991bd=_[_0x6a2b('0x3d')]({},_0x5991bd,_0x163425[_0x6a2b('0x3e')]);return db[_0x6a2b('0x41')][_0x6a2b('0x46')](_0x5991bd)[_0x6a2b('0x23')](handleEntityNotFound(_0x2c5d3f,null))[_0x6a2b('0x23')](respondWithResult(_0x2c5d3f,null))[_0x6a2b('0x44')](handleError(_0x2c5d3f,null));};exports[_0x6a2b('0x47')]=function(_0x180e28,_0x860c89){return db[_0x6a2b('0x41')][_0x6a2b('0x47')](_0x180e28[_0x6a2b('0x48')],{})['then'](function(_0x12a1bc){var _0x32cabb=_0x180e28['user'][_0x6a2b('0x24')]({'plain':!![]});if(!_0x32cabb)throw new Error(_0x6a2b('0x49'));if(_0x32cabb[_0x6a2b('0x4a')]===_0x6a2b('0x4b')){var _0x53dfd6=_0x12a1bc[_0x6a2b('0x24')]({'plain':!![]});var _0x44f48b='IvrCampaigns';return db[_0x6a2b('0x4c')][_0x6a2b('0x46')]({'where':{'name':_0x44f48b,'userProfileId':_0x32cabb[_0x6a2b('0x4d')]},'raw':!![]})[_0x6a2b('0x23')](function(_0x2a1bcd){if(_0x2a1bcd&&_0x2a1bcd[_0x6a2b('0x4e')]===0x0){return db[_0x6a2b('0x4f')][_0x6a2b('0x47')]({'name':_0x53dfd6[_0x6a2b('0x27')],'resourceId':_0x53dfd6['id'],'type':_0x2a1bcd[_0x6a2b('0x27')],'sectionId':_0x2a1bcd['id']},{})[_0x6a2b('0x23')](function(){return _0x12a1bc;});}else{return _0x12a1bc;}})[_0x6a2b('0x44')](function(_0x3f870c){logger[_0x6a2b('0x50')](_0x6a2b('0x51'),_0x3f870c);throw _0x3f870c;});}return _0x12a1bc;})['then'](respondWithResult(_0x860c89,0xc9))['catch'](handleError(_0x860c89,null));};exports[_0x6a2b('0x52')]=function(_0x48c352,_0x4b96b8){var _0x3c14f9={'where':{'id':_0x48c352[_0x6a2b('0x45')]['id']}},_0x4a68a6={};_0x4a68a6[_0x6a2b('0x2f')]=_[_0x6a2b('0x31')](db[_0x6a2b('0x41')][_0x6a2b('0x2b')]);_0x3c14f9['attributes']=_[_0x6a2b('0x33')](_0x4a68a6[_0x6a2b('0x2f')],qs[_0x6a2b('0x35')](_0x48c352[_0x6a2b('0x30')][_0x6a2b('0x35')]));_0x3c14f9[_0x6a2b('0x34')]=_0x3c14f9[_0x6a2b('0x34')][_0x6a2b('0x36')]?_0x3c14f9[_0x6a2b('0x34')]:_0x4a68a6['model'];if(_0x48c352[_0x6a2b('0x30')][_0x6a2b('0x3f')]){_0x3c14f9[_0x6a2b('0x40')]=[{'all':!![]}];}_0x3c14f9=_[_0x6a2b('0x3d')]({},_0x3c14f9,_0x48c352['options']);return db['Campaign'][_0x6a2b('0x46')](_0x3c14f9)[_0x6a2b('0x23')](handleEntityNotFound(_0x4b96b8,null))[_0x6a2b('0x23')](function(_0x3dd871){if(_0x3dd871){var _0x65e638=_0x3dd871[_0x6a2b('0x24')]({'plain':!![]});_0x65e638=qs[_0x6a2b('0x53')](_0x65e638,['id',_0x6a2b('0x54'),'updatedAt']);_0x48c352[_0x6a2b('0x48')]=_[_0x6a2b('0x53')](_0x48c352[_0x6a2b('0x48')],['id',_0x6a2b('0x54'),_0x6a2b('0x55')]);return db[_0x6a2b('0x41')][_0x6a2b('0x47')](_['merge'](_0x65e638,_0x48c352[_0x6a2b('0x48')]),{'include':_0x48c352[_0x6a2b('0x30')][_0x6a2b('0x3f')]?[{'all':!![]}]:undefined})[_0x6a2b('0x23')](function(_0x19df21){var _0x198fc2=_0x48c352[_0x6a2b('0x4b')][_0x6a2b('0x24')]({'plain':!![]});if(!_0x198fc2)throw new Error(_0x6a2b('0x49'));if(_0x198fc2[_0x6a2b('0x4a')]===_0x6a2b('0x4b')){var _0x55b90c=_0x19df21[_0x6a2b('0x24')]({'plain':!![]});var _0x4cf0c4=_0x6a2b('0x25');return db[_0x6a2b('0x4c')][_0x6a2b('0x46')]({'where':{'name':_0x4cf0c4,'userProfileId':_0x198fc2['userProfileId']},'raw':!![]})[_0x6a2b('0x23')](function(_0x4ea08b){if(_0x4ea08b&&_0x4ea08b[_0x6a2b('0x4e')]===0x0){return db[_0x6a2b('0x4f')]['create']({'name':_0x55b90c[_0x6a2b('0x27')],'resourceId':_0x55b90c['id'],'type':_0x4ea08b[_0x6a2b('0x27')],'sectionId':_0x4ea08b['id']},{})[_0x6a2b('0x23')](function(){return _0x19df21;});}else{return _0x19df21;}})[_0x6a2b('0x44')](function(_0x3687aa){logger[_0x6a2b('0x50')](_0x6a2b('0x51'),_0x3687aa);throw _0x3687aa;});}return _0x19df21;});}})[_0x6a2b('0x23')](respondWithResult(_0x4b96b8,0xc9))[_0x6a2b('0x44')](handleError(_0x4b96b8,null));};exports[_0x6a2b('0x56')]=function(_0x7c3471,_0x1718b5){if(_0x7c3471[_0x6a2b('0x48')]['id']){delete _0x7c3471[_0x6a2b('0x48')]['id'];}return db[_0x6a2b('0x41')][_0x6a2b('0x46')]({'where':{'id':_0x7c3471[_0x6a2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1718b5,null))[_0x6a2b('0x23')](saveUpdates(_0x7c3471[_0x6a2b('0x48')],null))['then'](respondWithResult(_0x1718b5,null))['catch'](handleError(_0x1718b5,null));};exports[_0x6a2b('0x26')]=function(_0x227a1e,_0x1e790c){return db[_0x6a2b('0x41')]['find']({'where':{'id':_0x227a1e[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x1e790c,null))[_0x6a2b('0x23')](removeEntity(_0x1e790c,null))[_0x6a2b('0x44')](handleError(_0x1e790c,null));};exports['getHoppers']=function(_0x575e0e,_0x4f0232,_0x5396b2){var _0x3d33d0={'raw':!![],'where':{}};var _0x1cd836={};var _0x53a880={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x575e0e['params']['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x4f0232,null))[_0x6a2b('0x23')](function(_0x542c0d){if(_0x542c0d){_0x1cd836[_0x6a2b('0x2f')]=_[_0x6a2b('0x31')](db[_0x6a2b('0x57')][_0x6a2b('0x2b')]);_0x1cd836[_0x6a2b('0x30')]=_[_0x6a2b('0x31')](_0x575e0e[_0x6a2b('0x30')]);_0x1cd836[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0x1cd836[_0x6a2b('0x2f')],_0x1cd836[_0x6a2b('0x30')]);_0x3d33d0[_0x6a2b('0x34')]=_[_0x6a2b('0x33')](_0x1cd836['model'],qs[_0x6a2b('0x35')](_0x575e0e[_0x6a2b('0x30')]['fields']));_0x3d33d0[_0x6a2b('0x34')]=_0x3d33d0[_0x6a2b('0x34')]['length']?_0x3d33d0['attributes']:_0x1cd836[_0x6a2b('0x2f')];if(!_0x575e0e[_0x6a2b('0x30')]['hasOwnProperty'](_0x6a2b('0x58'))){_0x3d33d0[_0x6a2b('0x1c')]=qs[_0x6a2b('0x1c')](_0x575e0e[_0x6a2b('0x30')][_0x6a2b('0x1c')]);_0x3d33d0[_0x6a2b('0x1e')]=qs[_0x6a2b('0x1e')](_0x575e0e[_0x6a2b('0x30')][_0x6a2b('0x1e')]);}_0x3d33d0[_0x6a2b('0x38')]=qs[_0x6a2b('0x39')](_0x575e0e[_0x6a2b('0x30')][_0x6a2b('0x39')]);_0x3d33d0[_0x6a2b('0x3a')]=qs[_0x6a2b('0x32')](_['pick'](_0x575e0e['query'],_0x1cd836[_0x6a2b('0x32')]));_0x3d33d0[_0x6a2b('0x3a')][_0x6a2b('0x59')]=_0x542c0d['id'];if(_0x575e0e[_0x6a2b('0x30')][_0x6a2b('0x3c')]){_0x3d33d0[_0x6a2b('0x3a')]=_[_0x6a2b('0x3d')](_0x3d33d0[_0x6a2b('0x3a')],{'$or':_[_0x6a2b('0x2a')](_0x3d33d0[_0x6a2b('0x34')],function(_0x5946df){var _0x28e38c={};_0x28e38c[_0x5946df]={'$like':'%'+_0x575e0e[_0x6a2b('0x30')]['filter']+'%'};return _0x28e38c;})});}_0x3d33d0=_[_0x6a2b('0x3d')]({},_0x3d33d0,_0x575e0e[_0x6a2b('0x3e')]);return db[_0x6a2b('0x57')][_0x6a2b('0x1d')]({'where':_0x3d33d0[_0x6a2b('0x3a')]})[_0x6a2b('0x23')](function(_0x34e0da){_0x53a880['count']=_0x34e0da;if(_0x575e0e[_0x6a2b('0x30')][_0x6a2b('0x3f')]){_0x3d33d0[_0x6a2b('0x40')]=[{'all':!![]}];}return db[_0x6a2b('0x57')][_0x6a2b('0x42')](_0x3d33d0);})[_0x6a2b('0x23')](function(_0x543712){_0x53a880[_0x6a2b('0x43')]=_0x543712;return _0x53a880;});}})[_0x6a2b('0x23')](respondWithFilteredResult(_0x4f0232,_0x3d33d0))['catch'](handleError(_0x4f0232,null));};exports[_0x6a2b('0x5a')]=function(_0x15be94,_0x5af4d5,_0x461b85){var _0x412dea={'raw':!![],'where':{}};var _0xad547f={};var _0x4b4e28={'count':0x0,'rows':[]};return db['Campaign'][_0x6a2b('0x5b')]({'where':{'id':_0x15be94[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x5af4d5,null))[_0x6a2b('0x23')](function(_0x1e6f22){if(_0x1e6f22){_0xad547f['model']=_[_0x6a2b('0x31')](db[_0x6a2b('0x5c')]['rawAttributes']);_0xad547f['query']=_['keys'](_0x15be94[_0x6a2b('0x30')]);_0xad547f[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0xad547f[_0x6a2b('0x2f')],_0xad547f[_0x6a2b('0x30')]);_0x412dea[_0x6a2b('0x34')]=_['intersection'](_0xad547f[_0x6a2b('0x2f')],qs[_0x6a2b('0x35')](_0x15be94[_0x6a2b('0x30')][_0x6a2b('0x35')]));_0x412dea[_0x6a2b('0x34')]=_0x412dea[_0x6a2b('0x34')]['length']?_0x412dea['attributes']:_0xad547f[_0x6a2b('0x2f')];if(!_0x15be94[_0x6a2b('0x30')]['hasOwnProperty'](_0x6a2b('0x58'))){_0x412dea[_0x6a2b('0x1c')]=qs['limit'](_0x15be94['query'][_0x6a2b('0x1c')]);_0x412dea[_0x6a2b('0x1e')]=qs[_0x6a2b('0x1e')](_0x15be94[_0x6a2b('0x30')][_0x6a2b('0x1e')]);}_0x412dea['order']=qs[_0x6a2b('0x39')](_0x15be94['query'][_0x6a2b('0x39')]);_0x412dea[_0x6a2b('0x3a')]=qs['filters'](_[_0x6a2b('0x3b')](_0x15be94[_0x6a2b('0x30')],_0xad547f[_0x6a2b('0x32')]));_0x412dea[_0x6a2b('0x3a')][_0x6a2b('0x59')]=_0x1e6f22['id'];if(_0x15be94[_0x6a2b('0x30')]['filter']){_0x412dea[_0x6a2b('0x3a')]=_[_0x6a2b('0x3d')](_0x412dea[_0x6a2b('0x3a')],{'$or':_[_0x6a2b('0x2a')](_0x412dea['attributes'],function(_0x328011){var _0x41a82e={};_0x41a82e[_0x328011]={'$like':'%'+_0x15be94[_0x6a2b('0x30')]['filter']+'%'};return _0x41a82e;})});}_0x412dea=_['merge']({},_0x412dea,_0x15be94[_0x6a2b('0x3e')]);return db[_0x6a2b('0x5c')]['count']({'where':_0x412dea[_0x6a2b('0x3a')]})[_0x6a2b('0x23')](function(_0x35dcf1){_0x4b4e28[_0x6a2b('0x1d')]=_0x35dcf1;if(_0x15be94[_0x6a2b('0x30')][_0x6a2b('0x3f')]){_0x412dea['include']=[{'all':!![]}];}return db[_0x6a2b('0x5c')]['findAll'](_0x412dea);})[_0x6a2b('0x23')](function(_0x390ba0){_0x4b4e28['rows']=_0x390ba0;return _0x4b4e28;});}})[_0x6a2b('0x23')](respondWithFilteredResult(_0x5af4d5,_0x412dea))[_0x6a2b('0x44')](handleError(_0x5af4d5,null));};exports[_0x6a2b('0x5d')]=function(_0x575055,_0x32cc5a,_0x3b0d41){var _0x27a9c5={'raw':!![],'where':{}};var _0x26cfc9={};var _0x9b5ec7={'count':0x0,'rows':[]};return db[_0x6a2b('0x41')][_0x6a2b('0x5b')]({'where':{'id':_0x575055[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x32cc5a,null))['then'](function(_0x978ccf){if(_0x978ccf){_0x26cfc9[_0x6a2b('0x2f')]=_[_0x6a2b('0x31')](db['CmHopperFinal'][_0x6a2b('0x2b')]);_0x26cfc9[_0x6a2b('0x30')]=_[_0x6a2b('0x31')](_0x575055[_0x6a2b('0x30')]);_0x26cfc9[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0x26cfc9['model'],_0x26cfc9['query']);_0x27a9c5[_0x6a2b('0x34')]=_['intersection'](_0x26cfc9[_0x6a2b('0x2f')],qs[_0x6a2b('0x35')](_0x575055[_0x6a2b('0x30')][_0x6a2b('0x35')]));_0x27a9c5[_0x6a2b('0x34')]=_0x27a9c5[_0x6a2b('0x34')][_0x6a2b('0x36')]?_0x27a9c5[_0x6a2b('0x34')]:_0x26cfc9['model'];if(!_0x575055[_0x6a2b('0x30')]['hasOwnProperty'](_0x6a2b('0x58'))){_0x27a9c5[_0x6a2b('0x1c')]=qs[_0x6a2b('0x1c')](_0x575055['query'][_0x6a2b('0x1c')]);_0x27a9c5[_0x6a2b('0x1e')]=qs[_0x6a2b('0x1e')](_0x575055[_0x6a2b('0x30')][_0x6a2b('0x1e')]);}_0x27a9c5[_0x6a2b('0x38')]=qs[_0x6a2b('0x39')](_0x575055[_0x6a2b('0x30')][_0x6a2b('0x39')]);_0x27a9c5['where']=qs[_0x6a2b('0x32')](_[_0x6a2b('0x3b')](_0x575055[_0x6a2b('0x30')],_0x26cfc9['filters']));_0x27a9c5['where']['CampaignId']=_0x978ccf['id'];if(_0x575055['query'][_0x6a2b('0x3c')]){_0x27a9c5[_0x6a2b('0x3a')]=_['merge'](_0x27a9c5[_0x6a2b('0x3a')],{'$or':_['map'](_0x27a9c5[_0x6a2b('0x34')],function(_0x3475ba){var _0x163fee={};_0x163fee[_0x3475ba]={'$like':'%'+_0x575055[_0x6a2b('0x30')]['filter']+'%'};return _0x163fee;})});}_0x27a9c5=_[_0x6a2b('0x3d')]({},_0x27a9c5,_0x575055[_0x6a2b('0x3e')]);return db[_0x6a2b('0x5e')][_0x6a2b('0x1d')]({'where':_0x27a9c5[_0x6a2b('0x3a')]})[_0x6a2b('0x23')](function(_0x5865c7){_0x9b5ec7[_0x6a2b('0x1d')]=_0x5865c7;if(_0x575055[_0x6a2b('0x30')]['includeAll']){_0x27a9c5[_0x6a2b('0x40')]=[{'all':!![]}];}return db[_0x6a2b('0x5e')][_0x6a2b('0x42')](_0x27a9c5);})['then'](function(_0x652316){_0x9b5ec7[_0x6a2b('0x43')]=_0x652316;return _0x9b5ec7;});}})[_0x6a2b('0x23')](respondWithFilteredResult(_0x32cc5a,_0x27a9c5))[_0x6a2b('0x44')](handleError(_0x32cc5a,null));};exports['getHopperBlacks']=function(_0x50328f,_0xd7269,_0x1077d3){var _0x344938={'raw':!![],'where':{}};var _0x37760c={};var _0x468410={'count':0x0,'rows':[]};return db[_0x6a2b('0x41')][_0x6a2b('0x5b')]({'where':{'id':_0x50328f[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0xd7269,null))[_0x6a2b('0x23')](function(_0x3828b3){if(_0x3828b3){_0x37760c[_0x6a2b('0x2f')]=_['keys'](db[_0x6a2b('0x5f')][_0x6a2b('0x2b')]);_0x37760c[_0x6a2b('0x30')]=_[_0x6a2b('0x31')](_0x50328f[_0x6a2b('0x30')]);_0x37760c['filters']=_[_0x6a2b('0x33')](_0x37760c[_0x6a2b('0x2f')],_0x37760c['query']);_0x344938[_0x6a2b('0x34')]=_[_0x6a2b('0x33')](_0x37760c[_0x6a2b('0x2f')],qs['fields'](_0x50328f[_0x6a2b('0x30')][_0x6a2b('0x35')]));_0x344938[_0x6a2b('0x34')]=_0x344938['attributes'][_0x6a2b('0x36')]?_0x344938[_0x6a2b('0x34')]:_0x37760c[_0x6a2b('0x2f')];if(!_0x50328f[_0x6a2b('0x30')]['hasOwnProperty'](_0x6a2b('0x58'))){_0x344938[_0x6a2b('0x1c')]=qs[_0x6a2b('0x1c')](_0x50328f['query'][_0x6a2b('0x1c')]);_0x344938[_0x6a2b('0x1e')]=qs[_0x6a2b('0x1e')](_0x50328f['query']['offset']);}_0x344938[_0x6a2b('0x38')]=qs['sort'](_0x50328f['query'][_0x6a2b('0x39')]);_0x344938[_0x6a2b('0x3a')]=qs[_0x6a2b('0x32')](_[_0x6a2b('0x3b')](_0x50328f['query'],_0x37760c[_0x6a2b('0x32')]));_0x344938['where'][_0x6a2b('0x59')]=_0x3828b3['id'];if(_0x50328f[_0x6a2b('0x30')][_0x6a2b('0x3c')]){_0x344938['where']=_[_0x6a2b('0x3d')](_0x344938[_0x6a2b('0x3a')],{'$or':_[_0x6a2b('0x2a')](_0x344938['attributes'],function(_0xb420b5){var _0x5d5a79={};_0x5d5a79[_0xb420b5]={'$like':'%'+_0x50328f[_0x6a2b('0x30')]['filter']+'%'};return _0x5d5a79;})});}_0x344938=_['merge']({},_0x344938,_0x50328f[_0x6a2b('0x3e')]);return db[_0x6a2b('0x5f')]['count']({'where':_0x344938[_0x6a2b('0x3a')]})[_0x6a2b('0x23')](function(_0x2a28bc){_0x468410[_0x6a2b('0x1d')]=_0x2a28bc;if(_0x50328f[_0x6a2b('0x30')]['includeAll']){_0x344938[_0x6a2b('0x40')]=[{'all':!![]}];}return db[_0x6a2b('0x5f')][_0x6a2b('0x42')](_0x344938);})[_0x6a2b('0x23')](function(_0x375eaa){_0x468410['rows']=_0x375eaa;return _0x468410;});}})[_0x6a2b('0x23')](respondWithFilteredResult(_0xd7269,_0x344938))[_0x6a2b('0x44')](handleError(_0xd7269,null));};exports['getLists']=function(_0x1a6d93,_0x528302,_0x1bf02d){var _0x3fe92f={};var _0x186a7f={};var _0x4166dc;var _0x2db583;return db['Campaign'][_0x6a2b('0x5b')]({'where':{'id':_0x1a6d93[_0x6a2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x528302,null))['then'](function(_0x5ceb0d){if(_0x5ceb0d){_0x4166dc=_0x5ceb0d;_0x186a7f[_0x6a2b('0x2f')]=_[_0x6a2b('0x31')](db['CmList']['rawAttributes']);_0x186a7f[_0x6a2b('0x30')]=_['keys'](_0x1a6d93[_0x6a2b('0x30')]);_0x186a7f[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0x186a7f['model'],_0x186a7f['query']);_0x3fe92f[_0x6a2b('0x34')]=_[_0x6a2b('0x33')](_0x186a7f['model'],qs[_0x6a2b('0x35')](_0x1a6d93[_0x6a2b('0x30')]['fields']));_0x3fe92f['attributes']=_0x3fe92f[_0x6a2b('0x34')][_0x6a2b('0x36')]?_0x3fe92f[_0x6a2b('0x34')]:_0x186a7f[_0x6a2b('0x2f')];_0x3fe92f[_0x6a2b('0x38')]=qs[_0x6a2b('0x39')](_0x1a6d93[_0x6a2b('0x30')][_0x6a2b('0x39')]);_0x3fe92f['where']=qs[_0x6a2b('0x32')](_[_0x6a2b('0x3b')](_0x1a6d93[_0x6a2b('0x30')],_0x186a7f[_0x6a2b('0x32')]));if(_0x1a6d93[_0x6a2b('0x30')][_0x6a2b('0x3c')]){_0x3fe92f[_0x6a2b('0x3a')]=_[_0x6a2b('0x3d')](_0x3fe92f[_0x6a2b('0x3a')],{'$or':_[_0x6a2b('0x2a')](_0x3fe92f[_0x6a2b('0x34')],function(_0x5f3394){var _0x32581d={};_0x32581d[_0x5f3394]={'$like':'%'+_0x1a6d93[_0x6a2b('0x30')][_0x6a2b('0x3c')]+'%'};return _0x32581d;})});}_0x3fe92f=_[_0x6a2b('0x3d')]({},_0x3fe92f,_0x1a6d93[_0x6a2b('0x3e')]);return _0x4166dc[_0x6a2b('0x60')](_0x3fe92f);}})[_0x6a2b('0x23')](function(_0x279b1b){if(_0x279b1b){_0x2db583=_0x279b1b[_0x6a2b('0x36')];if(!_0x1a6d93[_0x6a2b('0x30')][_0x6a2b('0x37')](_0x6a2b('0x58'))){_0x3fe92f[_0x6a2b('0x1c')]=qs[_0x6a2b('0x1c')](_0x1a6d93[_0x6a2b('0x30')][_0x6a2b('0x1c')]);_0x3fe92f[_0x6a2b('0x1e')]=qs[_0x6a2b('0x1e')](_0x1a6d93[_0x6a2b('0x30')]['offset']);}return _0x4166dc[_0x6a2b('0x60')](_0x3fe92f);}})['then'](function(_0x2b9e89){if(_0x2b9e89){return _0x2b9e89?{'count':_0x2db583,'rows':_0x2b9e89}:null;}})['then'](respondWithResult(_0x528302,null))['catch'](handleError(_0x528302,null));};exports[_0x6a2b('0x61')]=function(_0x113266,_0x5a0725,_0x57ff53){var _0xb98321,_0x2abdfe;return db[_0x6a2b('0x41')][_0x6a2b('0x46')]({'where':{'id':_0x113266[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x5a0725,null))[_0x6a2b('0x23')](function(_0x228af0){if(_0x228af0){_0x2abdfe=_0x228af0;return _0x228af0['addLists'](_0x113266[_0x6a2b('0x48')]['ids'],_[_0x6a2b('0x53')](_0x113266[_0x6a2b('0x48')],[_0x6a2b('0x62'),'id'])||{});}return null;})[_0x6a2b('0x63')](function(_0x20742d){var _0x4d129d;_0xb98321=_0x20742d||[];var _0x557466=[];if(_0x20742d){for(var _0x200923=0x0;_0x200923<_0x20742d[_0x6a2b('0x36')];_0x200923+=0x1){var _0x486439=_0x20742d[_0x200923][_0x6a2b('0x24')]({'plain':!![]});_0x2abdfe['dialCheckDuplicateType']=_0x113266[_0x6a2b('0x48')][_0x6a2b('0x64')]?_0x113266['body'][_0x6a2b('0x64')]:_0x2abdfe[_0x6a2b('0x64')];switch(_0x2abdfe[_0x6a2b('0x64')]){case'always':_0x4d129d=squel[_0x6a2b('0x65')]()[_0x6a2b('0x66')](_0x6a2b('0x67'))[_0x6a2b('0x68')]([_0x6a2b('0x69'),_0x6a2b('0x6a'),_0x6a2b('0x6b'),_0x6a2b('0x6c'),'CampaignId',_0x6a2b('0x54'),_0x6a2b('0x55')],squel[_0x6a2b('0x6d')]()[_0x6a2b('0x6e')](_0x6a2b('0x69'),'phone')[_0x6a2b('0x6e')]('NOW()',_0x6a2b('0x6a'))['field']('id','ContactId')[_0x6a2b('0x6e')](_0x486439[_0x6a2b('0x6f')][_0x6a2b('0x70')](),_0x6a2b('0x6c'))[_0x6a2b('0x6e')](_0x113266[_0x6a2b('0x45')]['id'][_0x6a2b('0x70')](),_0x6a2b('0x59'))[_0x6a2b('0x6e')](_0x6a2b('0x71'),_0x6a2b('0x54'))['field'](_0x6a2b('0x71'),'updatedAt')[_0x6a2b('0x72')](_0x6a2b('0x73'))[_0x6a2b('0x3a')]('deletedAt\x20IS\x20NULL')[_0x6a2b('0x3a')](_0x6a2b('0x74'),_0x486439[_0x6a2b('0x6f')][_0x6a2b('0x70')]())['where'](_0x6a2b('0x75'))[_0x6a2b('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6a2b('0x6d')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x6a2b('0x72')]('cm_hopper_final')['where'](_0x6a2b('0x76'),_0x113266['params']['id']['toString']()))['where'](_0x6a2b('0x77'),squel['select']()[_0x6a2b('0x6e')](_0x6a2b('0x78'))['from'](_0x6a2b('0x67'))[_0x6a2b('0x3a')]('CampaignId\x20=\x20?',_0x113266['params']['id'][_0x6a2b('0x70')]())))[_0x6a2b('0x70')]();break;case _0x6a2b('0x79'):_0x4d129d=squel[_0x6a2b('0x65')]()[_0x6a2b('0x66')](_0x6a2b('0x67'))['fromQuery'](['phone',_0x6a2b('0x6a'),'ContactId',_0x6a2b('0x6c'),_0x6a2b('0x59'),'createdAt',_0x6a2b('0x55')],squel[_0x6a2b('0x6d')]()[_0x6a2b('0x6e')]('phone',_0x6a2b('0x69'))[_0x6a2b('0x6e')](_0x6a2b('0x71'),_0x6a2b('0x6a'))[_0x6a2b('0x6e')]('id',_0x6a2b('0x6b'))[_0x6a2b('0x6e')](_0x486439['CmListId'][_0x6a2b('0x70')](),'ListId')[_0x6a2b('0x6e')](_0x113266[_0x6a2b('0x45')]['id'][_0x6a2b('0x70')](),_0x6a2b('0x59'))[_0x6a2b('0x6e')]('NOW()',_0x6a2b('0x54'))['field']('NOW()',_0x6a2b('0x55'))[_0x6a2b('0x72')](_0x6a2b('0x73'))['where'](_0x6a2b('0x7a'))[_0x6a2b('0x3a')](_0x6a2b('0x74'),_0x486439[_0x6a2b('0x6f')]['toString']())[_0x6a2b('0x3a')](_0x6a2b('0x75'))[_0x6a2b('0x3a')](_0x6a2b('0x77'),squel['select']()['field'](_0x6a2b('0x78'))[_0x6a2b('0x72')](_0x6a2b('0x67'))[_0x6a2b('0x3a')]('CampaignId\x20=\x20?',_0x113266[_0x6a2b('0x45')]['id']['toString']())))['toString']();break;default:_0x4d129d=squel[_0x6a2b('0x65')]()[_0x6a2b('0x66')](_0x6a2b('0x67'))['fromQuery']([_0x6a2b('0x69'),_0x6a2b('0x6a'),'ContactId',_0x6a2b('0x6c'),'CampaignId',_0x6a2b('0x54'),_0x6a2b('0x55')],squel[_0x6a2b('0x6d')]()[_0x6a2b('0x6e')](_0x6a2b('0x69'),_0x6a2b('0x69'))[_0x6a2b('0x6e')](_0x6a2b('0x71'),_0x6a2b('0x6a'))[_0x6a2b('0x6e')]('id',_0x6a2b('0x6b'))['field'](_0x486439['CmListId'][_0x6a2b('0x70')](),_0x6a2b('0x6c'))[_0x6a2b('0x6e')](_0x113266[_0x6a2b('0x45')]['id'][_0x6a2b('0x70')](),'CampaignId')[_0x6a2b('0x6e')]('NOW()',_0x6a2b('0x54'))[_0x6a2b('0x6e')](_0x6a2b('0x71'),_0x6a2b('0x55'))[_0x6a2b('0x72')](_0x6a2b('0x73'))[_0x6a2b('0x3a')](_0x6a2b('0x7a'))['where']('ListId\x20=\x20?',_0x486439['CmListId']['toString']())[_0x6a2b('0x3a')](_0x6a2b('0x75')))[_0x6a2b('0x70')]();}_0x557466[_0x6a2b('0x7b')](db[_0x6a2b('0x7c')][_0x6a2b('0x30')](_0x4d129d));}return BPromise['all'](_0x557466);}})[_0x6a2b('0x23')](function(){return _0xb98321;})[_0x6a2b('0x23')](respondWithResult(_0x5a0725,null))['catch'](handleError(_0x5a0725,null));};exports[_0x6a2b('0x7d')]=function(_0x43575a,_0x5abe7b,_0x3fdc1c){return db['Campaign'][_0x6a2b('0x46')]({'where':{'id':_0x43575a[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x5abe7b,null))[_0x6a2b('0x23')](function(_0x123ba4){if(_0x123ba4){return _0x123ba4[_0x6a2b('0x7d')](_0x43575a[_0x6a2b('0x30')][_0x6a2b('0x62')]);}})[_0x6a2b('0x23')](function(_0x688224){if(_0x688224){return db['CmHopper'][_0x6a2b('0x26')]({'where':{'ListId':_0x43575a[_0x6a2b('0x30')]['ids'],'CampaignId':_0x43575a[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](function(){return _0x688224;});}})[_0x6a2b('0x23')](respondWithStatusCode(_0x5abe7b,null))[_0x6a2b('0x44')](handleError(_0x5abe7b,null));};exports['getBlackLists']=function(_0x588e96,_0x2ad8bf,_0x155bb3){var _0x20ecad={};var _0x28d015={};var _0x57685f;var _0x19024f;return db['Campaign'][_0x6a2b('0x5b')]({'where':{'id':_0x588e96['params']['id']}})['then'](handleEntityNotFound(_0x2ad8bf,null))[_0x6a2b('0x23')](function(_0x57e118){if(_0x57e118){_0x57685f=_0x57e118;_0x28d015[_0x6a2b('0x2f')]=_[_0x6a2b('0x31')](db[_0x6a2b('0x7e')]['rawAttributes']);_0x28d015[_0x6a2b('0x30')]=_['keys'](_0x588e96['query']);_0x28d015[_0x6a2b('0x32')]=_[_0x6a2b('0x33')](_0x28d015[_0x6a2b('0x2f')],_0x28d015[_0x6a2b('0x30')]);_0x20ecad['attributes']=_[_0x6a2b('0x33')](_0x28d015[_0x6a2b('0x2f')],qs['fields'](_0x588e96['query'][_0x6a2b('0x35')]));_0x20ecad[_0x6a2b('0x34')]=_0x20ecad['attributes']['length']?_0x20ecad['attributes']:_0x28d015[_0x6a2b('0x2f')];_0x20ecad[_0x6a2b('0x38')]=qs[_0x6a2b('0x39')](_0x588e96[_0x6a2b('0x30')][_0x6a2b('0x39')]);_0x20ecad[_0x6a2b('0x3a')]=qs[_0x6a2b('0x32')](_[_0x6a2b('0x3b')](_0x588e96[_0x6a2b('0x30')],_0x28d015['filters']));if(_0x588e96[_0x6a2b('0x30')][_0x6a2b('0x3c')]){_0x20ecad[_0x6a2b('0x3a')]=_['merge'](_0x20ecad['where'],{'$or':_['map'](_0x20ecad['attributes'],function(_0x2c2505){var _0x232a6e={};_0x232a6e[_0x2c2505]={'$like':'%'+_0x588e96[_0x6a2b('0x30')][_0x6a2b('0x3c')]+'%'};return _0x232a6e;})});}_0x20ecad=_[_0x6a2b('0x3d')]({},_0x20ecad,_0x588e96[_0x6a2b('0x3e')]);return _0x57685f[_0x6a2b('0x7f')](_0x20ecad);}})[_0x6a2b('0x23')](function(_0x17096a){if(_0x17096a){_0x19024f=_0x17096a[_0x6a2b('0x36')];if(!_0x588e96[_0x6a2b('0x30')][_0x6a2b('0x37')]('nolimit')){_0x20ecad[_0x6a2b('0x1c')]=qs[_0x6a2b('0x1c')](_0x588e96[_0x6a2b('0x30')][_0x6a2b('0x1c')]);_0x20ecad['offset']=qs[_0x6a2b('0x1e')](_0x588e96['query'][_0x6a2b('0x1e')]);}return _0x57685f[_0x6a2b('0x7f')](_0x20ecad);}})['then'](function(_0x175551){if(_0x175551){return _0x175551?{'count':_0x19024f,'rows':_0x175551}:null;}})['then'](respondWithResult(_0x2ad8bf,null))[_0x6a2b('0x44')](handleError(_0x2ad8bf,null));};exports[_0x6a2b('0x80')]=function(_0x1446db,_0x440573,_0x31b0b2){var _0x5a6919,_0x4466fd;return db['Campaign'][_0x6a2b('0x46')]({'where':{'id':_0x1446db[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x440573,null))['then'](function(_0x1f021f){if(_0x1f021f){_0x4466fd=_0x1f021f;return _0x1f021f[_0x6a2b('0x80')](_0x1446db[_0x6a2b('0x48')][_0x6a2b('0x62')],_[_0x6a2b('0x53')](_0x1446db[_0x6a2b('0x48')],[_0x6a2b('0x62'),'id'])||{});}return null;})[_0x6a2b('0x63')](function(_0x2826aa){var _0x297ee8;_0x5a6919=_0x2826aa||[];var _0x47b5c7=[];if(_0x2826aa){for(var _0x4a0c30=0x0;_0x4a0c30<_0x2826aa[_0x6a2b('0x36')];_0x4a0c30+=0x1){var _0x1c8cc7=_0x2826aa[_0x4a0c30][_0x6a2b('0x24')]({'plain':!![]});_0x297ee8=squel['insert']()[_0x6a2b('0x66')]('cm_hopper_black')[_0x6a2b('0x68')](['phone',_0x6a2b('0x6b'),_0x6a2b('0x6c'),'CampaignId',_0x6a2b('0x54'),_0x6a2b('0x55')],squel[_0x6a2b('0x6d')]()['field'](_0x6a2b('0x69'),'phone')['field']('id','ContactId')[_0x6a2b('0x6e')](_0x1c8cc7['CmListId'][_0x6a2b('0x70')](),_0x6a2b('0x6c'))[_0x6a2b('0x6e')](_0x1446db[_0x6a2b('0x45')]['id']['toString'](),_0x6a2b('0x59'))['field'](_0x6a2b('0x71'),_0x6a2b('0x54'))[_0x6a2b('0x6e')](_0x6a2b('0x71'),_0x6a2b('0x55'))['from'](_0x6a2b('0x73'))['where'](_0x6a2b('0x7a'))[_0x6a2b('0x3a')](_0x6a2b('0x74'),_0x1c8cc7['CmListId'][_0x6a2b('0x70')]())[_0x6a2b('0x3a')](_0x6a2b('0x75')))[_0x6a2b('0x70')]();_0x47b5c7[_0x6a2b('0x7b')](db[_0x6a2b('0x7c')][_0x6a2b('0x30')](_0x297ee8));}return BPromise[_0x6a2b('0x81')](_0x47b5c7);}})[_0x6a2b('0x23')](function(){return _0x5a6919;})[_0x6a2b('0x23')](respondWithResult(_0x440573,null))[_0x6a2b('0x44')](handleError(_0x440573,null));};exports[_0x6a2b('0x82')]=function(_0x4d1ade,_0x1cc641,_0x3a86e9){return db[_0x6a2b('0x41')]['find']({'where':{'id':_0x4d1ade['params']['id']}})[_0x6a2b('0x23')](handleEntityNotFound(_0x1cc641,null))[_0x6a2b('0x23')](function(_0x2ab0ae){if(_0x2ab0ae){return _0x2ab0ae[_0x6a2b('0x82')](_0x4d1ade[_0x6a2b('0x30')][_0x6a2b('0x62')]);}})[_0x6a2b('0x23')](function(_0x39f387){if(_0x39f387){return db[_0x6a2b('0x5f')][_0x6a2b('0x26')]({'where':{'ListId':_0x4d1ade[_0x6a2b('0x30')][_0x6a2b('0x62')],'CampaignId':_0x4d1ade[_0x6a2b('0x45')]['id']}})[_0x6a2b('0x23')](function(){return _0x39f387;});}})[_0x6a2b('0x23')](respondWithStatusCode(_0x1cc641,null))[_0x6a2b('0x44')](handleError(_0x1cc641,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 49a9cdf..af16b29 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(_0xfdc4df,_0xecb76c){var _0x1fd26b=function(_0x3b2000){while(--_0x3b2000){_0xfdc4df['push'](_0xfdc4df['shift']());}};_0x1fd26b(++_0xecb76c);}(_0x7a54,0x106));var _0x47a5=function(_0x3e2036,_0x47a8ef){_0x3e2036=_0x3e2036-0x0;var _0x401b80=_0x7a54[_0x3e2036];return _0x401b80;};'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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 33fa873..9de582b 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 _0xd246=['request','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x200196,_0x3519a0){var _0xcc855b=function(_0x2239e2){while(--_0x2239e2){_0x200196['push'](_0x200196['shift']());}};_0xcc855b(++_0x3519a0);}(_0xd246,0xf5));var _0x6d24=function(_0x224f30,_0x4483c7){_0x224f30=_0x224f30-0x0;var _0x2a67ad=_0xd246[_0x224f30];return _0x2a67ad;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var moment=require(_0x6d24('0x2'));var BPromise=require(_0x6d24('0x3'));var rs=require(_0x6d24('0x4'));var fs=require('fs');var Redis=require(_0x6d24('0x5'));var db=require(_0x6d24('0x6'))['db'];var utils=require(_0x6d24('0x7'));var logger=require('../../config/logger')(_0x6d24('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d24('0x9'));var client=jayson['client'][_0x6d24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f6dfa,_0x1dcaa2,_0x358a65){return new BPromise(function(_0x38e1eb,_0x43500f){return client[_0x6d24('0xb')](_0x7f6dfa,_0x358a65)['then'](function(_0x5a05d3){logger[_0x6d24('0xc')]('Campaign,\x20%s,\x20%s',_0x1dcaa2,_0x6d24('0xd'));logger['debug'](_0x6d24('0xe'),_0x1dcaa2,'request\x20sent',JSON[_0x6d24('0xf')](_0x5a05d3));if(_0x5a05d3[_0x6d24('0x10')]){if(_0x5a05d3['error'][_0x6d24('0x11')]===0x1f4){logger['error'](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')]['message']);return _0x43500f(_0x5a05d3['error']['message']);}logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')][_0x6d24('0x13')]);return _0x38e1eb(_0x5a05d3['error']['message']);}else{logger[_0x6d24('0xc')](_0x6d24('0x12'),_0x1dcaa2,_0x6d24('0xd'));_0x38e1eb(_0x5a05d3['result']['message']);}})[_0x6d24('0x14')](function(_0x336aeb){logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x336aeb);_0x43500f(_0x336aeb);});});}exports[_0x6d24('0x15')]=function(_0xad7d02){var _0x49a269=this;return new Promise(function(_0x5b81b4,_0x430b55){return db[_0x6d24('0x16')][_0x6d24('0x17')]({'raw':_0xad7d02['options']?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x19')]===undefined?!![]:![]:!![],'where':_0xad7d02[_0x6d24('0x18')]?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x1a')]||null:null,'attributes':_0xad7d02['options']?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x1b')]||null:null,'limit':_0xad7d02['options']?_0xad7d02[_0x6d24('0x18')]['limit']||null:null,'include':_0xad7d02[_0x6d24('0x18')]?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x1c')]?_[_0x6d24('0x1d')](_0xad7d02[_0x6d24('0x18')][_0x6d24('0x1c')],function(_0x2952f8){return{'model':db[_0x2952f8['model']],'as':_0x2952f8['as'],'attributes':_0x2952f8[_0x6d24('0x1b')],'include':_0x2952f8[_0x6d24('0x1c')]?_['map'](_0x2952f8['include'],function(_0x5a2838){return{'model':db[_0x5a2838[_0x6d24('0x1e')]],'as':_0x5a2838['as'],'attributes':_0x5a2838[_0x6d24('0x1b')],'include':_0x5a2838['include']?_['map'](_0x5a2838[_0x6d24('0x1c')],function(_0xb495c){return{'model':db[_0xb495c[_0x6d24('0x1e')]],'as':_0xb495c['as'],'attributes':_0xb495c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d24('0x1f')](function(_0x101d5a){logger[_0x6d24('0xc')](_0x6d24('0x15'),_0xad7d02);logger['debug'](_0x6d24('0x15'),_0xad7d02,JSON['stringify'](_0x101d5a));_0x5b81b4(_0x101d5a);})[_0x6d24('0x14')](function(_0xaa4bf4){logger[_0x6d24('0x10')](_0x6d24('0x15'),_0xaa4bf4[_0x6d24('0x13')],_0xad7d02);_0x430b55(_0x49a269[_0x6d24('0x10')](0x1f4,_0xaa4bf4[_0x6d24('0x13')]));});});}; \ No newline at end of file +var _0x1c4d=['Campaign','findAll','options','where','attributes','limit','map','include','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign'];(function(_0x277979,_0x4fbd57){var _0x25a1fb=function(_0x2ccf88){while(--_0x2ccf88){_0x277979['push'](_0x277979['shift']());}};_0x25a1fb(++_0x4fbd57);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x46f734,_0x1cb63d){_0x46f734=_0x46f734-0x0;var _0x5a49d3=_0x1c4d[_0x46f734];return _0x5a49d3;};'use strict';var _=require('lodash');var util=require(_0xd1c4('0x0'));var moment=require(_0xd1c4('0x1'));var BPromise=require(_0xd1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1c4('0x3'));var db=require(_0xd1c4('0x4'))['db'];var utils=require(_0xd1c4('0x5'));var logger=require(_0xd1c4('0x6'))('rpc');var config=require(_0xd1c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd1c4('0x8')][_0xd1c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cc76,_0x35cbf5,_0x429dc6){return new BPromise(function(_0xc9284c,_0x49c2dc){return client[_0xd1c4('0xa')](_0x41cc76,_0x429dc6)[_0xd1c4('0xb')](function(_0x5443f3){logger[_0xd1c4('0xc')]('Campaign,\x20%s,\x20%s',_0x35cbf5,_0xd1c4('0xd'));logger[_0xd1c4('0xe')](_0xd1c4('0xf'),_0x35cbf5,_0xd1c4('0xd'),JSON[_0xd1c4('0x10')](_0x5443f3));if(_0x5443f3[_0xd1c4('0x11')]){if(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x12')]===0x1f4){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0x49c2dc(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x14')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0xc9284c(_0x5443f3[_0xd1c4('0x11')]['message']);}else{logger['info'](_0xd1c4('0x13'),_0x35cbf5,'request\x20sent');_0xc9284c(_0x5443f3[_0xd1c4('0x15')][_0xd1c4('0x14')]);}})[_0xd1c4('0x16')](function(_0x4af352){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x4af352);_0x49c2dc(_0x4af352);});});}exports[_0xd1c4('0x17')]=function(_0x41c496){var _0xe25f12=this;return new Promise(function(_0x39e0bb,_0x51a465){return db[_0xd1c4('0x18')][_0xd1c4('0x19')]({'raw':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1b')]||null:null,'attributes':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1c')]||null:null,'limit':_0x41c496['options']?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1d')]||null:null,'include':_0x41c496['options']?_0x41c496[_0xd1c4('0x1a')]['include']?_[_0xd1c4('0x1e')](_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1f')],function(_0x5d24e7){return{'model':db[_0x5d24e7[_0xd1c4('0x20')]],'as':_0x5d24e7['as'],'attributes':_0x5d24e7[_0xd1c4('0x1c')],'include':_0x5d24e7[_0xd1c4('0x1f')]?_[_0xd1c4('0x1e')](_0x5d24e7[_0xd1c4('0x1f')],function(_0x23f9af){return{'model':db[_0x23f9af[_0xd1c4('0x20')]],'as':_0x23f9af['as'],'attributes':_0x23f9af[_0xd1c4('0x1c')],'include':_0x23f9af[_0xd1c4('0x1f')]?_['map'](_0x23f9af[_0xd1c4('0x1f')],function(_0x2cdf75){return{'model':db[_0x2cdf75[_0xd1c4('0x20')]],'as':_0x2cdf75['as'],'attributes':_0x2cdf75[_0xd1c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd1c4('0xb')](function(_0x26fda4){logger['info'](_0xd1c4('0x17'),_0x41c496);logger['debug'](_0xd1c4('0x17'),_0x41c496,JSON[_0xd1c4('0x10')](_0x26fda4));_0x39e0bb(_0x26fda4);})[_0xd1c4('0x16')](function(_0x3ef290){logger[_0xd1c4('0x11')]('GetCampaign',_0x3ef290[_0xd1c4('0x14')],_0x41c496);_0x51a465(_0xe25f12[_0xd1c4('0x11')](0x1f4,_0x3ef290['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 16f7016..2f7e775 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 _0xe4ab=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','addLists','/:id/blacklists','addBlackLists','put','update','delete','/:id','destroy','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','isAuthenticated','show','/:id/hoppers'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe4ab,0x17d));var _0xbe4a=function(_0x44b468,_0x3ffb86){_0x44b468=_0x44b468-0x0;var _0x24f8c0=_0xe4ab[_0x44b468];return _0x24f8c0;};'use strict';var multer=require(_0xbe4a('0x0'));var util=require('util');var path=require(_0xbe4a('0x1'));var timeout=require(_0xbe4a('0x2'));var express=require(_0xbe4a('0x3'));var router=express[_0xbe4a('0x4')]();var fs_extra=require(_0xbe4a('0x5'));var auth=require(_0xbe4a('0x6'));var interaction=require(_0xbe4a('0x7'));var config=require(_0xbe4a('0x8'));var controller=require(_0xbe4a('0x9'));router[_0xbe4a('0xa')]('/',auth['isAuthenticated'](),controller[_0xbe4a('0xb')]);router[_0xbe4a('0xa')]('/:id',auth[_0xbe4a('0xc')](),controller[_0xbe4a('0xd')]);router[_0xbe4a('0xa')](_0xbe4a('0xe'),auth[_0xbe4a('0xc')](),controller[_0xbe4a('0xf')]);router['get'](_0xbe4a('0x10'),auth['isAuthenticated'](),controller[_0xbe4a('0x11')]);router[_0xbe4a('0xa')](_0xbe4a('0x12'),auth['isAuthenticated'](),controller[_0xbe4a('0x13')]);router[_0xbe4a('0xa')]('/:id/hopper_black',auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x14')]);router['get'](_0xbe4a('0x15'),auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x16')]);router[_0xbe4a('0xa')]('/:id/blacklists',auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x17')]);router[_0xbe4a('0x18')]('/',auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x19')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0xbe4a('0x18')](_0xbe4a('0x15'),auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x1a')]);router['post'](_0xbe4a('0x1b'),auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x1c')]);router[_0xbe4a('0x1d')]('/:id',auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x1e')]);router[_0xbe4a('0x1f')](_0xbe4a('0x20'),auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x21')]);router[_0xbe4a('0x1f')](_0xbe4a('0x15'),auth[_0xbe4a('0xc')](),controller[_0xbe4a('0x22')]);router[_0xbe4a('0x1f')](_0xbe4a('0x1b'),auth[_0xbe4a('0xc')](),controller['removeBlackLists']);module[_0xbe4a('0x23')]=router; \ No newline at end of file +var _0x37b6=['addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x32c09c,_0x14ebd4){var _0x5c23e6=function(_0x1170a){while(--_0x1170a){_0x32c09c['push'](_0x32c09c['shift']());}};_0x5c23e6(++_0x14ebd4);}(_0x37b6,0x119));var _0x637b=function(_0x408500,_0xa642d5){_0x408500=_0x408500-0x0;var _0x544e0e=_0x37b6[_0x408500];return _0x544e0e;};'use strict';var multer=require(_0x637b('0x0'));var util=require(_0x637b('0x1'));var path=require(_0x637b('0x2'));var timeout=require(_0x637b('0x3'));var express=require(_0x637b('0x4'));var router=express[_0x637b('0x5')]();var fs_extra=require(_0x637b('0x6'));var auth=require(_0x637b('0x7'));var interaction=require(_0x637b('0x8'));var config=require(_0x637b('0x9'));var controller=require('./campaign.controller');router[_0x637b('0xa')]('/',auth[_0x637b('0xb')](),controller[_0x637b('0xc')]);router['get'](_0x637b('0xd'),auth[_0x637b('0xb')](),controller[_0x637b('0xe')]);router[_0x637b('0xa')](_0x637b('0xf'),auth['isAuthenticated'](),controller[_0x637b('0x10')]);router[_0x637b('0xa')](_0x637b('0x11'),auth['isAuthenticated'](),controller[_0x637b('0x12')]);router[_0x637b('0xa')](_0x637b('0x13'),auth[_0x637b('0xb')](),controller[_0x637b('0x14')]);router[_0x637b('0xa')](_0x637b('0x15'),auth[_0x637b('0xb')](),controller[_0x637b('0x16')]);router['get'](_0x637b('0x17'),auth['isAuthenticated'](),controller[_0x637b('0x18')]);router['get'](_0x637b('0x19'),auth[_0x637b('0xb')](),controller[_0x637b('0x1a')]);router[_0x637b('0x1b')]('/',auth[_0x637b('0xb')](),controller[_0x637b('0x1c')]);router['post'](_0x637b('0x1d'),auth[_0x637b('0xb')](),controller[_0x637b('0x1e')]);router[_0x637b('0x1b')](_0x637b('0x17'),auth[_0x637b('0xb')](),controller[_0x637b('0x1f')]);router[_0x637b('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x637b('0x20')]);router[_0x637b('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x637b('0x22')]);router[_0x637b('0x23')](_0x637b('0xd'),auth[_0x637b('0xb')](),controller[_0x637b('0x24')]);router['delete']('/:id/lists',auth[_0x637b('0xb')](),controller[_0x637b('0x25')]);router[_0x637b('0x23')]('/:id/blacklists',auth[_0x637b('0xb')](),controller[_0x637b('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index bbde2eb..3601011 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 _0xe42e=['VIRTUAL','getDataValue','key','exports','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe42e,0x111));var _0xee42=function(_0x27267e,_0x27126b){_0x27267e=_0x27267e-0x0;var _0x41d733=_0xe42e[_0x27267e];return _0x41d733;};'use strict';var Sequelize=require('sequelize');module[_0xee42('0x0')]={'key':{'type':Sequelize[_0xee42('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xee42('0x1')]},'name':{'type':Sequelize[_0xee42('0x2')],'get':function(){return this[_0xee42('0x3')](_0xee42('0x4'));}}}; \ No newline at end of file +var _0xf51f=['exports','STRING','TEXT','getDataValue','key'];(function(_0x565e88,_0x1e016f){var _0x2d9a38=function(_0x4287cf){while(--_0x4287cf){_0x565e88['push'](_0x565e88['shift']());}};_0x2d9a38(++_0x1e016f);}(_0xf51f,0x190));var _0xff51=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0xf51f[_0x2892da];return _0x28cff2;};'use strict';var Sequelize=require('sequelize');module[_0xff51('0x0')]={'key':{'type':Sequelize[_0xff51('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xff51('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xff51('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xff51('0x3')](_0xff51('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 6262367..ba1b4ec 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 _0xfef5=['reject','save','update','then','destroy','CannedAnswers','error','stack','name','index','map','type','key','query','keys','model','attributes','intersection','fields','length','order','sort','filters','pick','filter','where','merge','options','count','includeAll','include','CannedAnswer','rows','params','rawAttributes','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply'];(function(_0x3895df,_0x435608){var _0x15a155=function(_0xd8f2a1){while(--_0xd8f2a1){_0x3895df['push'](_0x3895df['shift']());}};_0x15a155(++_0x435608);}(_0xfef5,0x1dd));var _0x5fef=function(_0x1f8f39,_0x27289d){_0x1f8f39=_0x1f8f39-0x0;var _0x2dd661=_0xfef5[_0x1f8f39];return _0x2dd661;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fef('0x0'));var zipdir=require(_0x5fef('0x1'));var jsonpatch=require(_0x5fef('0x2'));var rp=require(_0x5fef('0x3'));var moment=require(_0x5fef('0x4'));var BPromise=require(_0x5fef('0x5'));var Mustache=require('mustache');var util=require(_0x5fef('0x6'));var path=require(_0x5fef('0x7'));var sox=require(_0x5fef('0x8'));var csv=require(_0x5fef('0x9'));var ejs=require(_0x5fef('0xa'));var fs=require('fs');var fs_extra=require(_0x5fef('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5fef('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5fef('0x9'));var querystring=require(_0x5fef('0xd'));var Papa=require(_0x5fef('0xe'));var Redis=require(_0x5fef('0xf'));var authService=require(_0x5fef('0x10'));var qs=require(_0x5fef('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fef('0x12'));var logger=require(_0x5fef('0x13'))(_0x5fef('0x14'));var utils=require(_0x5fef('0x15'));var config=require(_0x5fef('0x16'));var licenseUtil=require(_0x5fef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249639,_0x4e49e7){_0x4e49e7=_0x4e49e7||0xcc;return function(_0x54538c){if(_0x54538c){return _0x249639[_0x5fef('0x18')](_0x4e49e7);}return _0x249639[_0x5fef('0x19')](_0x4e49e7)[_0x5fef('0x1a')]();};}function respondWithResult(_0x719d95,_0x14fe7e){_0x14fe7e=_0x14fe7e||0xc8;return function(_0x2e5daf){if(_0x2e5daf){return _0x719d95[_0x5fef('0x19')](_0x14fe7e)['json'](_0x2e5daf);}};}function respondWithFilteredResult(_0x287089,_0x35d573){return function(_0xa936d){if(_0xa936d){var _0x5a6d21=typeof _0x35d573[_0x5fef('0x1b')]===_0x5fef('0x1c')&&typeof _0x35d573[_0x5fef('0x1d')]===_0x5fef('0x1c');var _0x2c4647=_0xa936d['count'];var _0x16fb46=_0x5a6d21?0x0:_0x35d573[_0x5fef('0x1b')];var _0x857e85=_0x5a6d21?_0xa936d['count']:_0x35d573[_0x5fef('0x1b')]+_0x35d573[_0x5fef('0x1d')];var _0x26a0c1;if(_0x857e85>=_0x2c4647){_0x857e85=_0x2c4647;_0x26a0c1=0xc8;}else{_0x26a0c1=0xce;}_0x287089['status'](_0x26a0c1);return _0x287089['set'](_0x5fef('0x1e'),_0x16fb46+'-'+_0x857e85+'/'+_0x2c4647)[_0x5fef('0x1f')](_0xa936d);}return null;};}function patchUpdates(_0x5e2286){return function(_0x32ae1e){try{jsonpatch[_0x5fef('0x20')](_0x32ae1e,_0x5e2286,!![]);}catch(_0x430681){return BPromise[_0x5fef('0x21')](_0x430681);}return _0x32ae1e[_0x5fef('0x22')]();};}function saveUpdates(_0x2ee712,_0x4a9c77){return function(_0x335b6a){if(_0x335b6a){return _0x335b6a[_0x5fef('0x23')](_0x2ee712)[_0x5fef('0x24')](function(_0xcf7874){return _0xcf7874;});}return null;};}function removeEntity(_0x28ebd3,_0x2962b1){return function(_0x4d1d2b){if(_0x4d1d2b){return _0x4d1d2b[_0x5fef('0x25')]()['then'](function(){var _0x361bcc=_0x4d1d2b['get']({'plain':!![]});var _0x2baaf1=_0x5fef('0x26');return db['UserProfileResource'][_0x5fef('0x25')]({'where':{'type':_0x2baaf1,'resourceId':_0x361bcc['id']}})[_0x5fef('0x24')](function(){return _0x4d1d2b;});})['then'](function(){_0x28ebd3[_0x5fef('0x19')](0xcc)[_0x5fef('0x1a')]();});}};}function handleEntityNotFound(_0x164dcf,_0x132263){return function(_0x57dd31){if(!_0x57dd31){_0x164dcf[_0x5fef('0x18')](0x194);}return _0x57dd31;};}function handleError(_0x24665b,_0x5819eb){_0x5819eb=_0x5819eb||0x1f4;return function(_0x3292ad){logger[_0x5fef('0x27')](_0x3292ad[_0x5fef('0x28')]);if(_0x3292ad[_0x5fef('0x29')]){delete _0x3292ad[_0x5fef('0x29')];}_0x24665b[_0x5fef('0x19')](_0x5819eb)['send'](_0x3292ad);};}exports[_0x5fef('0x2a')]=function(_0x121043,_0x21f96b){var _0x4e7ac7={},_0x280ec5={},_0x425502={'count':0x0,'rows':[]};var _0x1217e9=_[_0x5fef('0x2b')](db['CannedAnswer']['rawAttributes'],function(_0x3c55be){return{'name':_0x3c55be['fieldName'],'type':_0x3c55be[_0x5fef('0x2c')][_0x5fef('0x2d')]};});_0x280ec5['model']=_[_0x5fef('0x2b')](_0x1217e9,_0x5fef('0x29'));_0x280ec5[_0x5fef('0x2e')]=_[_0x5fef('0x2f')](_0x121043[_0x5fef('0x2e')]);_0x280ec5['filters']=_['intersection'](_0x280ec5[_0x5fef('0x30')],_0x280ec5['query']);_0x4e7ac7[_0x5fef('0x31')]=_[_0x5fef('0x32')](_0x280ec5[_0x5fef('0x30')],qs[_0x5fef('0x33')](_0x121043[_0x5fef('0x2e')][_0x5fef('0x33')]));_0x4e7ac7['attributes']=_0x4e7ac7['attributes'][_0x5fef('0x34')]?_0x4e7ac7[_0x5fef('0x31')]:_0x280ec5[_0x5fef('0x30')];if(!_0x121043['query']['hasOwnProperty']('nolimit')){_0x4e7ac7[_0x5fef('0x1d')]=qs['limit'](_0x121043[_0x5fef('0x2e')]['limit']);_0x4e7ac7['offset']=qs[_0x5fef('0x1b')](_0x121043['query']['offset']);}_0x4e7ac7[_0x5fef('0x35')]=qs[_0x5fef('0x36')](_0x121043['query'][_0x5fef('0x36')]);_0x4e7ac7['where']=qs[_0x5fef('0x37')](_[_0x5fef('0x38')](_0x121043[_0x5fef('0x2e')],_0x280ec5[_0x5fef('0x37')]),_0x1217e9);if(_0x121043[_0x5fef('0x2e')][_0x5fef('0x39')]){_0x4e7ac7['where']=_['merge'](_0x4e7ac7[_0x5fef('0x3a')],{'$or':[{'key':{'$like':'%'+_0x121043[_0x5fef('0x2e')]['filter']+'%'}},{'value':{'$like':'%'+_0x121043['query'][_0x5fef('0x39')]+'%'}}]});}_0x4e7ac7=_[_0x5fef('0x3b')]({},_0x4e7ac7,_0x121043[_0x5fef('0x3c')]);var _0x5ecf75={'where':_0x4e7ac7[_0x5fef('0x3a')]};return db['CannedAnswer']['count'](_0x5ecf75)['then'](function(_0x146086){_0x425502[_0x5fef('0x3d')]=_0x146086;if(_0x121043['query'][_0x5fef('0x3e')]){_0x4e7ac7[_0x5fef('0x3f')]=[{'all':!![]}];}return db[_0x5fef('0x40')]['findAll'](_0x4e7ac7);})[_0x5fef('0x24')](function(_0x867529){_0x425502[_0x5fef('0x41')]=_0x867529;return _0x425502;})[_0x5fef('0x24')](respondWithFilteredResult(_0x21f96b,_0x4e7ac7))['catch'](handleError(_0x21f96b,null));};exports['show']=function(_0x205558,_0x162562){var _0x4623a6={'raw':!![],'where':{'id':_0x205558[_0x5fef('0x42')]['id']}},_0x5d92da={};_0x5d92da[_0x5fef('0x30')]=_[_0x5fef('0x2f')](db['CannedAnswer'][_0x5fef('0x43')]);_0x5d92da[_0x5fef('0x2e')]=_[_0x5fef('0x2f')](_0x205558[_0x5fef('0x2e')]);_0x5d92da[_0x5fef('0x37')]=_['intersection'](_0x5d92da['model'],_0x5d92da[_0x5fef('0x2e')]);_0x4623a6[_0x5fef('0x31')]=_[_0x5fef('0x32')](_0x5d92da['model'],qs[_0x5fef('0x33')](_0x205558[_0x5fef('0x2e')][_0x5fef('0x33')]));_0x4623a6['attributes']=_0x4623a6['attributes'][_0x5fef('0x34')]?_0x4623a6['attributes']:_0x5d92da[_0x5fef('0x30')];if(_0x205558[_0x5fef('0x2e')][_0x5fef('0x3e')]){_0x4623a6[_0x5fef('0x3f')]=[{'all':!![]}];}_0x4623a6=_[_0x5fef('0x3b')]({},_0x4623a6,_0x205558[_0x5fef('0x3c')]);return db[_0x5fef('0x40')][_0x5fef('0x44')](_0x4623a6)[_0x5fef('0x24')](handleEntityNotFound(_0x162562,null))[_0x5fef('0x24')](respondWithResult(_0x162562,null))[_0x5fef('0x45')](handleError(_0x162562,null));};exports[_0x5fef('0x23')]=function(_0x2e2a0f,_0x1cb5b6){if(_0x2e2a0f[_0x5fef('0x46')]['id']){delete _0x2e2a0f[_0x5fef('0x46')]['id'];}return db[_0x5fef('0x40')][_0x5fef('0x44')]({'where':{'id':_0x2e2a0f[_0x5fef('0x42')]['id']}})[_0x5fef('0x24')](handleEntityNotFound(_0x1cb5b6,null))['then'](saveUpdates(_0x2e2a0f[_0x5fef('0x46')],null))['then'](respondWithResult(_0x1cb5b6,null))[_0x5fef('0x45')](handleError(_0x1cb5b6,null));};exports['destroy']=function(_0x2d6cfa,_0x1b3c21){return db[_0x5fef('0x40')]['find']({'where':{'id':_0x2d6cfa[_0x5fef('0x42')]['id']}})[_0x5fef('0x24')](handleEntityNotFound(_0x1b3c21,null))[_0x5fef('0x24')](removeEntity(_0x1b3c21,null))[_0x5fef('0x45')](handleError(_0x1b3c21,null));};exports[_0x5fef('0x47')]=function(_0x1a8a12,_0x150140){var _0x2daf77={'key':_0x1a8a12[_0x5fef('0x46')]['key']};if(_0x1a8a12[_0x5fef('0x46')]['MailAccountId']){_0x2daf77[_0x5fef('0x48')]=_0x1a8a12[_0x5fef('0x46')]['MailAccountId'];}else if(_0x1a8a12[_0x5fef('0x46')][_0x5fef('0x49')]){_0x2daf77[_0x5fef('0x49')]=_0x1a8a12[_0x5fef('0x46')][_0x5fef('0x49')];}else if(_0x1a8a12[_0x5fef('0x46')][_0x5fef('0x4a')]){_0x2daf77[_0x5fef('0x4a')]=_0x1a8a12[_0x5fef('0x46')][_0x5fef('0x4a')];}else if(_0x1a8a12[_0x5fef('0x46')][_0x5fef('0x4b')]){_0x2daf77[_0x5fef('0x4b')]=_0x1a8a12[_0x5fef('0x46')][_0x5fef('0x4b')];}return db[_0x5fef('0x40')][_0x5fef('0x44')]({'where':_0x2daf77})[_0x5fef('0x24')](function(_0x16edac){if(_0x16edac){throw new db[(_0x5fef('0x4c'))][(_0x5fef('0x4d'))](_0x5fef('0x4e'));}return db[_0x5fef('0x40')][_0x5fef('0x47')](_0x1a8a12[_0x5fef('0x46')]);})[_0x5fef('0x24')](function(_0x5e4289){var _0x2d7e88=_0x1a8a12[_0x5fef('0x4f')][_0x5fef('0x50')]({'plain':!![]});if(!_0x2d7e88)throw new Error(_0x5fef('0x51'));if(_0x2d7e88['role']==='user'){var _0x8bc42d=_0x5e4289['get']({'plain':!![]});return db[_0x5fef('0x52')][_0x5fef('0x44')]({'where':{'name':_0x5fef('0x26'),'userProfileId':_0x2d7e88[_0x5fef('0x53')]},'raw':!![]})[_0x5fef('0x24')](function(_0xe8a813){if(_0xe8a813&&_0xe8a813[_0x5fef('0x54')]===0x0){return db['UserProfileResource'][_0x5fef('0x47')]({'name':_0x8bc42d[_0x5fef('0x29')],'resourceId':_0x8bc42d['id'],'type':_0xe8a813[_0x5fef('0x29')],'sectionId':_0xe8a813['id']},{})[_0x5fef('0x24')](function(){return _0x5e4289;});}else{return _0x5e4289;}})[_0x5fef('0x45')](function(_0x1092a1){logger[_0x5fef('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1092a1);throw _0x1092a1;});}return _0x5e4289;})[_0x5fef('0x24')](respondWithResult(_0x150140,0xc9))[_0x5fef('0x45')](handleError(_0x150140,null));}; \ No newline at end of file +var _0x033c=['end','json','offset','count','Content-Range','apply','reject','save','then','CannedAnswers','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','keys','options','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x16fd68,_0x3d394d){var _0x12cf8e=function(_0x4728c1){while(--_0x4728c1){_0x16fd68['push'](_0x16fd68['shift']());}};_0x12cf8e(++_0x3d394d);}(_0x033c,0x189));var _0xc033=function(_0x4f85a4,_0x21286d){_0x4f85a4=_0x4f85a4-0x0;var _0x32d966=_0x033c[_0x4f85a4];return _0x32d966;};'use strict';var emlformat=require(_0xc033('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc033('0x1'));var rp=require('request-promise');var moment=require(_0xc033('0x2'));var BPromise=require(_0xc033('0x3'));var Mustache=require(_0xc033('0x4'));var util=require(_0xc033('0x5'));var path=require(_0xc033('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc033('0x7'));var _=require('lodash');var squel=require(_0xc033('0x8'));var crypto=require(_0xc033('0x9'));var jsforce=require(_0xc033('0xa'));var deskjs=require(_0xc033('0xb'));var toCsv=require(_0xc033('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc033('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc033('0xe'));var as=require(_0xc033('0xf'));var hardwareService=require(_0xc033('0x10'));var logger=require('../../config/logger')(_0xc033('0x11'));var utils=require(_0xc033('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc033('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fd6af,_0x2ebba9){_0x2ebba9=_0x2ebba9||0xcc;return function(_0x526b38){if(_0x526b38){return _0x4fd6af[_0xc033('0x14')](_0x2ebba9);}return _0x4fd6af[_0xc033('0x15')](_0x2ebba9)[_0xc033('0x16')]();};}function respondWithResult(_0x3764f9,_0xe30401){_0xe30401=_0xe30401||0xc8;return function(_0x5ccaf3){if(_0x5ccaf3){return _0x3764f9[_0xc033('0x15')](_0xe30401)[_0xc033('0x17')](_0x5ccaf3);}};}function respondWithFilteredResult(_0x361e9e,_0x37967f){return function(_0x2b61d4){if(_0x2b61d4){var _0x5b3905=typeof _0x37967f[_0xc033('0x18')]==='undefined'&&typeof _0x37967f['limit']==='undefined';var _0x4b7293=_0x2b61d4[_0xc033('0x19')];var _0x21e78c=_0x5b3905?0x0:_0x37967f[_0xc033('0x18')];var _0x92c435=_0x5b3905?_0x2b61d4[_0xc033('0x19')]:_0x37967f[_0xc033('0x18')]+_0x37967f['limit'];var _0x54af9a;if(_0x92c435>=_0x4b7293){_0x92c435=_0x4b7293;_0x54af9a=0xc8;}else{_0x54af9a=0xce;}_0x361e9e[_0xc033('0x15')](_0x54af9a);return _0x361e9e['set'](_0xc033('0x1a'),_0x21e78c+'-'+_0x92c435+'/'+_0x4b7293)[_0xc033('0x17')](_0x2b61d4);}return null;};}function patchUpdates(_0x4dded3){return function(_0x72d978){try{jsonpatch[_0xc033('0x1b')](_0x72d978,_0x4dded3,!![]);}catch(_0xc5363){return BPromise[_0xc033('0x1c')](_0xc5363);}return _0x72d978[_0xc033('0x1d')]();};}function saveUpdates(_0x37cb29,_0x4e0970){return function(_0x4a2bca){if(_0x4a2bca){return _0x4a2bca['update'](_0x37cb29)[_0xc033('0x1e')](function(_0x4be5c5){return _0x4be5c5;});}return null;};}function removeEntity(_0x7ad54f,_0x41805a){return function(_0x1a8f8d){if(_0x1a8f8d){return _0x1a8f8d['destroy']()['then'](function(){var _0x5c04c3=_0x1a8f8d['get']({'plain':!![]});var _0x5e7190=_0xc033('0x1f');return db[_0xc033('0x20')]['destroy']({'where':{'type':_0x5e7190,'resourceId':_0x5c04c3['id']}})[_0xc033('0x1e')](function(){return _0x1a8f8d;});})[_0xc033('0x1e')](function(){_0x7ad54f['status'](0xcc)[_0xc033('0x16')]();});}};}function handleEntityNotFound(_0x4073e2,_0x40490c){return function(_0xa2cbb9){if(!_0xa2cbb9){_0x4073e2[_0xc033('0x14')](0x194);}return _0xa2cbb9;};}function handleError(_0x212f0c,_0x25549b){_0x25549b=_0x25549b||0x1f4;return function(_0x19aa80){logger[_0xc033('0x21')](_0x19aa80['stack']);if(_0x19aa80[_0xc033('0x22')]){delete _0x19aa80[_0xc033('0x22')];}_0x212f0c[_0xc033('0x15')](_0x25549b)[_0xc033('0x23')](_0x19aa80);};}exports[_0xc033('0x24')]=function(_0x2304ba,_0xe7e48f){var _0xdc69ca={},_0x5b1f3f={},_0x1e654b={'count':0x0,'rows':[]};var _0x4398e5=_[_0xc033('0x25')](db[_0xc033('0x26')][_0xc033('0x27')],function(_0x5dbefc){return{'name':_0x5dbefc[_0xc033('0x28')],'type':_0x5dbefc[_0xc033('0x29')][_0xc033('0x2a')]};});_0x5b1f3f[_0xc033('0x2b')]=_['map'](_0x4398e5,_0xc033('0x22'));_0x5b1f3f[_0xc033('0x2c')]=_['keys'](_0x2304ba['query']);_0x5b1f3f[_0xc033('0x2d')]=_[_0xc033('0x2e')](_0x5b1f3f[_0xc033('0x2b')],_0x5b1f3f[_0xc033('0x2c')]);_0xdc69ca['attributes']=_[_0xc033('0x2e')](_0x5b1f3f[_0xc033('0x2b')],qs[_0xc033('0x2f')](_0x2304ba['query'][_0xc033('0x2f')]));_0xdc69ca[_0xc033('0x30')]=_0xdc69ca['attributes'][_0xc033('0x31')]?_0xdc69ca[_0xc033('0x30')]:_0x5b1f3f[_0xc033('0x2b')];if(!_0x2304ba[_0xc033('0x2c')]['hasOwnProperty'](_0xc033('0x32'))){_0xdc69ca[_0xc033('0x33')]=qs[_0xc033('0x33')](_0x2304ba[_0xc033('0x2c')][_0xc033('0x33')]);_0xdc69ca[_0xc033('0x18')]=qs[_0xc033('0x18')](_0x2304ba[_0xc033('0x2c')]['offset']);}_0xdc69ca[_0xc033('0x34')]=qs[_0xc033('0x35')](_0x2304ba[_0xc033('0x2c')][_0xc033('0x35')]);_0xdc69ca['where']=qs[_0xc033('0x2d')](_[_0xc033('0x36')](_0x2304ba[_0xc033('0x2c')],_0x5b1f3f[_0xc033('0x2d')]),_0x4398e5);if(_0x2304ba[_0xc033('0x2c')][_0xc033('0x37')]){_0xdc69ca[_0xc033('0x38')]=_['merge'](_0xdc69ca['where'],{'$or':[{'key':{'$like':'%'+_0x2304ba[_0xc033('0x2c')][_0xc033('0x37')]+'%'}},{'value':{'$like':'%'+_0x2304ba[_0xc033('0x2c')]['filter']+'%'}}]});}_0xdc69ca=_[_0xc033('0x39')]({},_0xdc69ca,_0x2304ba['options']);var _0x1837c2={'where':_0xdc69ca[_0xc033('0x38')]};return db[_0xc033('0x26')][_0xc033('0x19')](_0x1837c2)[_0xc033('0x1e')](function(_0x3e2cb8){_0x1e654b[_0xc033('0x19')]=_0x3e2cb8;if(_0x2304ba[_0xc033('0x2c')][_0xc033('0x3a')]){_0xdc69ca[_0xc033('0x3b')]=[{'all':!![]}];}return db[_0xc033('0x26')][_0xc033('0x3c')](_0xdc69ca);})[_0xc033('0x1e')](function(_0x24652b){_0x1e654b[_0xc033('0x3d')]=_0x24652b;return _0x1e654b;})['then'](respondWithFilteredResult(_0xe7e48f,_0xdc69ca))[_0xc033('0x3e')](handleError(_0xe7e48f,null));};exports['show']=function(_0x4a99a7,_0x4aa121){var _0x4612c5={'raw':!![],'where':{'id':_0x4a99a7[_0xc033('0x3f')]['id']}},_0x5d684f={};_0x5d684f['model']=_[_0xc033('0x40')](db[_0xc033('0x26')]['rawAttributes']);_0x5d684f[_0xc033('0x2c')]=_[_0xc033('0x40')](_0x4a99a7[_0xc033('0x2c')]);_0x5d684f[_0xc033('0x2d')]=_[_0xc033('0x2e')](_0x5d684f[_0xc033('0x2b')],_0x5d684f[_0xc033('0x2c')]);_0x4612c5[_0xc033('0x30')]=_['intersection'](_0x5d684f['model'],qs[_0xc033('0x2f')](_0x4a99a7[_0xc033('0x2c')][_0xc033('0x2f')]));_0x4612c5[_0xc033('0x30')]=_0x4612c5[_0xc033('0x30')]['length']?_0x4612c5[_0xc033('0x30')]:_0x5d684f[_0xc033('0x2b')];if(_0x4a99a7[_0xc033('0x2c')][_0xc033('0x3a')]){_0x4612c5[_0xc033('0x3b')]=[{'all':!![]}];}_0x4612c5=_['merge']({},_0x4612c5,_0x4a99a7[_0xc033('0x41')]);return db[_0xc033('0x26')]['find'](_0x4612c5)[_0xc033('0x1e')](handleEntityNotFound(_0x4aa121,null))[_0xc033('0x1e')](respondWithResult(_0x4aa121,null))[_0xc033('0x3e')](handleError(_0x4aa121,null));};exports[_0xc033('0x42')]=function(_0x53ef00,_0x700fa8){if(_0x53ef00['body']['id']){delete _0x53ef00['body']['id'];}return db[_0xc033('0x26')]['find']({'where':{'id':_0x53ef00[_0xc033('0x3f')]['id']}})[_0xc033('0x1e')](handleEntityNotFound(_0x700fa8,null))[_0xc033('0x1e')](saveUpdates(_0x53ef00[_0xc033('0x43')],null))[_0xc033('0x1e')](respondWithResult(_0x700fa8,null))[_0xc033('0x3e')](handleError(_0x700fa8,null));};exports['destroy']=function(_0x420013,_0x5266d9){return db[_0xc033('0x26')][_0xc033('0x44')]({'where':{'id':_0x420013['params']['id']}})[_0xc033('0x1e')](handleEntityNotFound(_0x5266d9,null))[_0xc033('0x1e')](removeEntity(_0x5266d9,null))[_0xc033('0x3e')](handleError(_0x5266d9,null));};exports[_0xc033('0x45')]=function(_0x5383ef,_0x20f062){var _0x5ddce6={'key':_0x5383ef['body'][_0xc033('0x2a')]};if(_0x5383ef[_0xc033('0x43')][_0xc033('0x46')]){_0x5ddce6[_0xc033('0x46')]=_0x5383ef[_0xc033('0x43')][_0xc033('0x46')];}else if(_0x5383ef[_0xc033('0x43')]['SmsAccountId']){_0x5ddce6[_0xc033('0x47')]=_0x5383ef['body'][_0xc033('0x47')];}else if(_0x5383ef[_0xc033('0x43')][_0xc033('0x48')]){_0x5ddce6[_0xc033('0x48')]=_0x5383ef['body']['OpenchannelAccountId'];}else if(_0x5383ef[_0xc033('0x43')]['ChatWebsiteId']){_0x5ddce6[_0xc033('0x49')]=_0x5383ef[_0xc033('0x43')][_0xc033('0x49')];}return db[_0xc033('0x26')][_0xc033('0x44')]({'where':_0x5ddce6})[_0xc033('0x1e')](function(_0x1cea4e){if(_0x1cea4e){throw new db[(_0xc033('0x4a'))][(_0xc033('0x4b'))](_0xc033('0x4c'));}return db[_0xc033('0x26')]['create'](_0x5383ef['body']);})[_0xc033('0x1e')](function(_0x25f1a0){var _0x457ab9=_0x5383ef['user']['get']({'plain':!![]});if(!_0x457ab9)throw new Error(_0xc033('0x4d'));if(_0x457ab9['role']===_0xc033('0x4e')){var _0x50d569=_0x25f1a0[_0xc033('0x4f')]({'plain':!![]});return db[_0xc033('0x50')][_0xc033('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x457ab9[_0xc033('0x51')]},'raw':!![]})['then'](function(_0x4cd78e){if(_0x4cd78e&&_0x4cd78e['autoAssociation']===0x0){return db['UserProfileResource'][_0xc033('0x45')]({'name':_0x50d569['name'],'resourceId':_0x50d569['id'],'type':_0x4cd78e[_0xc033('0x22')],'sectionId':_0x4cd78e['id']},{})[_0xc033('0x1e')](function(){return _0x25f1a0;});}else{return _0x25f1a0;}})[_0xc033('0x3e')](function(_0x65677a){logger['error'](_0xc033('0x52'),_0x65677a);throw _0x65677a;});}return _0x25f1a0;})[_0xc033('0x1e')](respondWithResult(_0x20f062,0xc9))['catch'](handleError(_0x20f062,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 15c11c5..1dcbb29 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 _0xa1dd=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x4b46e2,_0x2c3888){var _0x253142=function(_0x5efca8){while(--_0x5efca8){_0x4b46e2['push'](_0x4b46e2['shift']());}};_0x253142(++_0x2c3888);}(_0xa1dd,0x108));var _0xda1d=function(_0xc14bf8,_0x4a280c){_0xc14bf8=_0xc14bf8-0x0;var _0x10b5de=_0xa1dd[_0xc14bf8];return _0x10b5de;};'use strict';var _=require('lodash');var util=require(_0xda1d('0x0'));var logger=require(_0xda1d('0x1'))(_0xda1d('0x2'));var moment=require(_0xda1d('0x3'));var BPromise=require('bluebird');var rp=require(_0xda1d('0x4'));var fs=require('fs');var path=require(_0xda1d('0x5'));var rimraf=require('rimraf');var config=require(_0xda1d('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xda1d('0x7')]=function(_0x3de8b9,_0x3870aa){return _0x3de8b9['define'](_0xda1d('0x8'),attributes,{'tableName':_0xda1d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda1d('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x175f=['moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','util','api'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x175f,0x1ab));var _0xf175=function(_0x1df531,_0x152492){_0x1df531=_0x1df531-0x0;var _0x3c3cff=_0x175f[_0x1df531];return _0x3c3cff;};'use strict';var _=require('lodash');var util=require(_0xf175('0x0'));var logger=require('../../config/logger')(_0xf175('0x1'));var moment=require(_0xf175('0x2'));var BPromise=require('bluebird');var rp=require(_0xf175('0x3'));var fs=require('fs');var path=require(_0xf175('0x4'));var rimraf=require(_0xf175('0x5'));var config=require(_0xf175('0x6'));var attributes=require(_0xf175('0x7'));module[_0xf175('0x8')]=function(_0x6641aa,_0x3c13f0){return _0x6641aa[_0xf175('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf175('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 16424bf..1c6d7ad 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(_0x4b03e8,_0x35b6c5){var _0x531339=function(_0xa93bfa){while(--_0xa93bfa){_0x4b03e8['push'](_0x4b03e8['shift']());}};_0x531339(++_0x35b6c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0xea02f2,_0x2bd7d3){var _0x1b78fb=function(_0x2bbc8a){while(--_0x2bbc8a){_0xea02f2['push'](_0xea02f2['shift']());}};_0x1b78fb(++_0x2bd7d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 99c35db..c3872f5 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 _0xc221=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','path','Router'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xc221,0x1ae));var _0x1c22=function(_0x35b247,_0x58b741){_0x35b247=_0x35b247-0x0;var _0x1395de=_0xc221[_0x35b247];return _0x1395de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c22('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c22('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x1c22('0x2'));var interaction=require(_0x1c22('0x3'));var config=require(_0x1c22('0x4'));var controller=require(_0x1c22('0x5'));router[_0x1c22('0x6')]('/',auth[_0x1c22('0x7')](),controller[_0x1c22('0x8')]);router['get'](_0x1c22('0x9'),auth[_0x1c22('0x7')](),controller[_0x1c22('0xa')]);router['post']('/',auth[_0x1c22('0x7')](),controller[_0x1c22('0xb')]);router[_0x1c22('0xc')](_0x1c22('0x9'),auth[_0x1c22('0x7')](),controller[_0x1c22('0xd')]);router[_0x1c22('0xe')](_0x1c22('0x9'),auth[_0x1c22('0x7')](),controller['destroy']);module[_0x1c22('0xf')]=router; \ No newline at end of file +var _0x5292=['show','post','create','delete','destroy','util','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id'];(function(_0x32f08e,_0x53860c){var _0x1300e5=function(_0x314c51){while(--_0x314c51){_0x32f08e['push'](_0x32f08e['shift']());}};_0x1300e5(++_0x53860c);}(_0x5292,0xf5));var _0x2529=function(_0x235186,_0xf3fdc2){_0x235186=_0x235186-0x0;var _0x103007=_0x5292[_0x235186];return _0x103007;};'use strict';var multer=require('multer');var util=require(_0x2529('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2529('0x1'));var router=express['Router']();var fs_extra=require(_0x2529('0x2'));var auth=require(_0x2529('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2529('0x4'));var controller=require(_0x2529('0x5'));router['get']('/',auth[_0x2529('0x6')](),controller[_0x2529('0x7')]);router[_0x2529('0x8')](_0x2529('0x9'),auth[_0x2529('0x6')](),controller[_0x2529('0xa')]);router[_0x2529('0xb')]('/',auth[_0x2529('0x6')](),controller[_0x2529('0xc')]);router['put'](_0x2529('0x9'),auth[_0x2529('0x6')](),controller['update']);router[_0x2529('0xd')](_0x2529('0x9'),auth[_0x2529('0x6')](),controller[_0x2529('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9a6060b..48851d9 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 _0x3bc8=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0x3bc8,0x1f3));var _0x83bc=function(_0x3f1885,_0x3aa3ff){_0x3f1885=_0x3f1885-0x0;var _0x459832=_0x3bc8[_0x3f1885];return _0x459832;};'use strict';var Sequelize=require('sequelize');module[_0x83bc('0x0')]={'calldate':{'type':Sequelize[_0x83bc('0x1')],'allowNull':![],'defaultValue':_0x83bc('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x83bc('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x83bc('0x3')]},'dstchannel':{'type':Sequelize[_0x83bc('0x3')]},'lastapp':{'type':Sequelize[_0x83bc('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x83bc('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x83bc('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x83bc('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x83bc('0x3')]},'peeraccount':{'type':Sequelize[_0x83bc('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x83bc('0x3')]}}; \ No newline at end of file +var _0xbbfa=['INTEGER','sequelize','DATE','STRING'];(function(_0x474f2b,_0xd55790){var _0x438e78=function(_0x5ce0fa){while(--_0x5ce0fa){_0x474f2b['push'](_0x474f2b['shift']());}};_0x438e78(++_0xd55790);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x2af0bd,_0x30c3ac){_0x2af0bd=_0x2af0bd-0x0;var _0x1f52cd=_0xbbfa[_0x2af0bd];return _0x1f52cd;};'use strict';var Sequelize=require(_0xabbf('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xabbf('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xabbf('0x2')]},'src':{'type':Sequelize[_0xabbf('0x2')]},'dst':{'type':Sequelize[_0xabbf('0x2')]},'dcontext':{'type':Sequelize[_0xabbf('0x2')]},'channel':{'type':Sequelize[_0xabbf('0x2')]},'dstchannel':{'type':Sequelize[_0xabbf('0x2')]},'lastapp':{'type':Sequelize[_0xabbf('0x2')]},'lastdata':{'type':Sequelize[_0xabbf('0x2')]},'duration':{'type':Sequelize[_0xabbf('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xabbf('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xabbf('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xabbf('0x2')]},'linkedid':{'type':Sequelize[_0xabbf('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xabbf('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 5d2bb63..2e033db 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xa4dac2,_0x4ea191){var _0x19d546=function(_0x58ea85){while(--_0x58ea85){_0xa4dac2['push'](_0xa4dac2['shift']());}};_0x19d546(++_0x4ea191);}(_0x24ca,0x8c));var _0xa24c=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0x24ca[_0x260b48];return _0x3f730b;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));}; \ No newline at end of file +var _0x2675=['limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','Cdr','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','body','update','params','describe','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x482180,_0x2c34a9){var _0x11ca21=function(_0x258b5d){while(--_0x258b5d){_0x482180['push'](_0x482180['shift']());}};_0x11ca21(++_0x2c34a9);}(_0x2675,0x75));var _0x5267=function(_0x4a5434,_0x11b90e){_0x4a5434=_0x4a5434-0x0;var _0x230549=_0x2675[_0x4a5434];return _0x230549;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['Cdr'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['Cdr'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['create']=function(_0x12d6a8,_0x4ee826){return db['Cdr'][_0x5267('0x43')](_0x12d6a8[_0x5267('0x44')],{})['then'](respondWithResult(_0x4ee826,0xc9))['catch'](handleError(_0x4ee826,null));};exports[_0x5267('0x45')]=function(_0xe0439e,_0x3d2436){if(_0xe0439e[_0x5267('0x44')]['id']){delete _0xe0439e[_0x5267('0x44')]['id'];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0xe0439e[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x3d2436,null))[_0x5267('0x22')](saveUpdates(_0xe0439e[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0x3d2436,null))[_0x5267('0x3d')](handleError(_0x3d2436,null));};exports[_0x5267('0x21')]=function(_0x4f7f75,_0x8636d0){return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0x4f7f75['params']['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x8636d0,null))[_0x5267('0x22')](removeEntity(_0x8636d0,null))[_0x5267('0x3d')](handleError(_0x8636d0,null));};exports[_0x5267('0x47')]=function(_0x119546,_0x1457cf){return db['Cdr'][_0x5267('0x47')]()['then'](respondWithResult(_0x1457cf,null))[_0x5267('0x3d')](handleError(_0x1457cf,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 286a204..d9f1c08 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(_0x344de6,_0x3a858b){var _0x31380=function(_0x51c524){while(--_0x51c524){_0x344de6['push'](_0x344de6['shift']());}};_0x31380(++_0x3a858b);}(_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':'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(_0x364c38,_0x5e9814){var _0x55d9c7=function(_0x19f2fa){while(--_0x19f2fa){_0x364c38['push'](_0x364c38['shift']());}};_0x55d9c7(++_0x5e9814);}(_0x7a54,0x106));var _0x47a5=function(_0x107a44,_0x153042){_0x107a44=_0x107a44-0x0;var _0x2625ff=_0x7a54[_0x107a44];return _0x2625ff;};'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 b674f56..91ff492 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 _0x0d63=['info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x0d63,0x129));var _0x30d6=function(_0x5b21c9,_0x4352ef){_0x5b21c9=_0x5b21c9-0x0;var _0x241785=_0x0d63[_0x5b21c9];return _0x241785;};'use strict';var _=require(_0x30d6('0x0'));var util=require(_0x30d6('0x1'));var moment=require(_0x30d6('0x2'));var BPromise=require(_0x30d6('0x3'));var rs=require(_0x30d6('0x4'));var fs=require('fs');var Redis=require(_0x30d6('0x5'));var db=require(_0x30d6('0x6'))['db'];var utils=require(_0x30d6('0x7'));var logger=require(_0x30d6('0x8'))('rpc');var config=require(_0x30d6('0x9'));var jayson=require(_0x30d6('0xa'));var client=jayson[_0x30d6('0xb')][_0x30d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa1e26a,_0x2cb08d,_0x46d41b){return new BPromise(function(_0x3dcfc6,_0x5be896){return client[_0x30d6('0xd')](_0xa1e26a,_0x46d41b)[_0x30d6('0xe')](function(_0x43c5de){logger[_0x30d6('0xf')]('Cdr,\x20%s,\x20%s',_0x2cb08d,_0x30d6('0x10'));logger[_0x30d6('0x11')](_0x30d6('0x12'),_0x2cb08d,_0x30d6('0x10'),JSON[_0x30d6('0x13')](_0x43c5de));if(_0x43c5de[_0x30d6('0x14')]){if(_0x43c5de[_0x30d6('0x14')][_0x30d6('0x15')]===0x1f4){logger[_0x30d6('0x14')](_0x30d6('0x16'),_0x2cb08d,_0x43c5de['error']['message']);return _0x5be896(_0x43c5de[_0x30d6('0x14')]['message']);}logger[_0x30d6('0x14')](_0x30d6('0x16'),_0x2cb08d,_0x43c5de['error'][_0x30d6('0x17')]);return _0x3dcfc6(_0x43c5de[_0x30d6('0x14')][_0x30d6('0x17')]);}else{logger[_0x30d6('0xf')](_0x30d6('0x16'),_0x2cb08d,_0x30d6('0x10'));_0x3dcfc6(_0x43c5de['result']['message']);}})['catch'](function(_0x1d82ec){logger['error']('Cdr,\x20%s,\x20%s',_0x2cb08d,_0x1d82ec);_0x5be896(_0x1d82ec);});});} \ No newline at end of file +var _0xd4eb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x30bd73,_0x3bec2c){var _0x488a3b=function(_0x2db655){while(--_0x2db655){_0x30bd73['push'](_0x30bd73['shift']());}};_0x488a3b(++_0x3bec2c);}(_0xd4eb,0x155));var _0xbd4e=function(_0x15b852,_0x40abc8){_0x15b852=_0x15b852-0x0;var _0x1b9f5e=_0xd4eb[_0x15b852];return _0x1b9f5e;};'use strict';var _=require(_0xbd4e('0x0'));var util=require(_0xbd4e('0x1'));var moment=require(_0xbd4e('0x2'));var BPromise=require(_0xbd4e('0x3'));var rs=require(_0xbd4e('0x4'));var fs=require('fs');var Redis=require(_0xbd4e('0x5'));var db=require(_0xbd4e('0x6'))['db'];var utils=require(_0xbd4e('0x7'));var logger=require(_0xbd4e('0x8'))(_0xbd4e('0x9'));var config=require('../../config/environment');var jayson=require(_0xbd4e('0xa'));var client=jayson[_0xbd4e('0xb')][_0xbd4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc7a3c,_0x4063fd,_0x1e4317){return new BPromise(function(_0x3f194c,_0x54aa59){return client['request'](_0xc7a3c,_0x1e4317)['then'](function(_0x144bf9){logger[_0xbd4e('0xd')](_0xbd4e('0xe'),_0x4063fd,_0xbd4e('0xf'));logger[_0xbd4e('0x10')](_0xbd4e('0x11'),_0x4063fd,_0xbd4e('0xf'),JSON[_0xbd4e('0x12')](_0x144bf9));if(_0x144bf9['error']){if(_0x144bf9[_0xbd4e('0x13')][_0xbd4e('0x14')]===0x1f4){logger[_0xbd4e('0x13')](_0xbd4e('0xe'),_0x4063fd,_0x144bf9[_0xbd4e('0x13')][_0xbd4e('0x15')]);return _0x54aa59(_0x144bf9[_0xbd4e('0x13')]['message']);}logger[_0xbd4e('0x13')]('Cdr,\x20%s,\x20%s',_0x4063fd,_0x144bf9[_0xbd4e('0x13')][_0xbd4e('0x15')]);return _0x3f194c(_0x144bf9[_0xbd4e('0x13')]['message']);}else{logger[_0xbd4e('0xd')]('Cdr,\x20%s,\x20%s',_0x4063fd,'request\x20sent');_0x3f194c(_0x144bf9[_0xbd4e('0x16')][_0xbd4e('0x15')]);}})['catch'](function(_0x4f752d){logger[_0xbd4e('0x13')](_0xbd4e('0xe'),_0x4063fd,_0x4f752d);_0x54aa59(_0x4f752d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a3ff65c..fd4265a 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xc0be57,_0x2d1e96){var _0x2d786d=function(_0x5c91fc){while(--_0x5c91fc){_0xc0be57['push'](_0xc0be57['shift']());}};_0x2d786d(++_0x2d1e96);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index b7099a6..5e3d7a3 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 _0x0b6d=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x0b6d,0x19a));var _0xd0b6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x0b6d[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');module[_0xd0b6('0x0')]={'priority':{'type':Sequelize[_0xd0b6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd0b6('0x2')],'allowNull':![],'defaultValue':_0xd0b6('0x3')},'appdata':{'type':Sequelize[_0xd0b6('0x4')]()},'description':{'type':Sequelize[_0xd0b6('0x2')]},'interval':{'type':Sequelize[_0xd0b6('0x2')],'defaultValue':_0xd0b6('0x5')}}; \ No newline at end of file +var _0xed76=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x4f9673,_0x4313bd){var _0x337e5e=function(_0x5677cf){while(--_0x5677cf){_0x4f9673['push'](_0x4f9673['shift']());}};_0x337e5e(++_0x4313bd);}(_0xed76,0x172));var _0x6ed7=function(_0x384f10,_0x3df7c4){_0x384f10=_0x384f10-0x0;var _0x7f2a8c=_0xed76[_0x384f10];return _0x7f2a8c;};'use strict';var Sequelize=require(_0x6ed7('0x0'));module[_0x6ed7('0x1')]={'priority':{'type':Sequelize[_0x6ed7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6ed7('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6ed7('0x4')],'defaultValue':_0x6ed7('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5abe6b9..d4ef49b 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 _0x8b1a=['ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x11ad49,_0x4f010a){var _0x356ecc=function(_0x1874f6){while(--_0x1874f6){_0x11ad49['push'](_0x11ad49['shift']());}};_0x356ecc(++_0x4f010a);}(_0x8b1a,0x152));var _0xa8b1=function(_0x22ff37,_0x40698d){_0x22ff37=_0x22ff37-0x0;var _0x57492b=_0x8b1a[_0x22ff37];return _0x57492b;};'use strict';var emlformat=require(_0xa8b1('0x0'));var rimraf=require(_0xa8b1('0x1'));var zipdir=require(_0xa8b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8b1('0x3'));var moment=require(_0xa8b1('0x4'));var BPromise=require(_0xa8b1('0x5'));var Mustache=require('mustache');var util=require(_0xa8b1('0x6'));var path=require(_0xa8b1('0x7'));var sox=require(_0xa8b1('0x8'));var csv=require(_0xa8b1('0x9'));var ejs=require(_0xa8b1('0xa'));var fs=require('fs');var fs_extra=require(_0xa8b1('0xb'));var _=require('lodash');var squel=require(_0xa8b1('0xc'));var crypto=require(_0xa8b1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa8b1('0xe'));var toCsv=require(_0xa8b1('0x9'));var querystring=require('querystring');var Papa=require(_0xa8b1('0xf'));var Redis=require(_0xa8b1('0x10'));var authService=require(_0xa8b1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8b1('0x12'));var logger=require('../../config/logger')(_0xa8b1('0x13'));var utils=require(_0xa8b1('0x14'));var config=require(_0xa8b1('0x15'));var licenseUtil=require(_0xa8b1('0x16'));var db=require(_0xa8b1('0x17'))['db'];function respondWithStatusCode(_0x371ffc,_0x186fd3){_0x186fd3=_0x186fd3||0xcc;return function(_0x26bed2){if(_0x26bed2){return _0x371ffc['sendStatus'](_0x186fd3);}return _0x371ffc[_0xa8b1('0x18')](_0x186fd3)[_0xa8b1('0x19')]();};}function respondWithResult(_0x4adb3f,_0x193d69){_0x193d69=_0x193d69||0xc8;return function(_0x541cc6){if(_0x541cc6){return _0x4adb3f[_0xa8b1('0x18')](_0x193d69)['json'](_0x541cc6);}};}function respondWithFilteredResult(_0x130f9b,_0xb9662b){return function(_0x459cd7){if(_0x459cd7){var _0x1fbc70=typeof _0xb9662b[_0xa8b1('0x1a')]===_0xa8b1('0x1b')&&typeof _0xb9662b[_0xa8b1('0x1c')]===_0xa8b1('0x1b');var _0x4f8773=_0x459cd7[_0xa8b1('0x1d')];var _0x457967=_0x1fbc70?0x0:_0xb9662b[_0xa8b1('0x1a')];var _0x59ff94=_0x1fbc70?_0x459cd7['count']:_0xb9662b['offset']+_0xb9662b['limit'];var _0x38f4f5;if(_0x59ff94>=_0x4f8773){_0x59ff94=_0x4f8773;_0x38f4f5=0xc8;}else{_0x38f4f5=0xce;}_0x130f9b[_0xa8b1('0x18')](_0x38f4f5);return _0x130f9b[_0xa8b1('0x1e')]('Content-Range',_0x457967+'-'+_0x59ff94+'/'+_0x4f8773)['json'](_0x459cd7);}return null;};}function patchUpdates(_0x22918b){return function(_0x4c866d){try{jsonpatch[_0xa8b1('0x1f')](_0x4c866d,_0x22918b,!![]);}catch(_0x2563cc){return BPromise[_0xa8b1('0x20')](_0x2563cc);}return _0x4c866d[_0xa8b1('0x21')]();};}function saveUpdates(_0x240dc9,_0x5dfba3){return function(_0x2ab5a0){if(_0x2ab5a0){return _0x2ab5a0['update'](_0x240dc9)['then'](function(_0x1fa698){return _0x1fa698;});}return null;};}function removeEntity(_0xebc2c4,_0x1f7c45){return function(_0x8e156f){if(_0x8e156f){return _0x8e156f[_0xa8b1('0x22')]()[_0xa8b1('0x23')](function(){_0xebc2c4[_0xa8b1('0x18')](0xcc)[_0xa8b1('0x19')]();});}};}function handleEntityNotFound(_0x4b9667,_0x45f000){return function(_0x5c3f35){if(!_0x5c3f35){_0x4b9667[_0xa8b1('0x24')](0x194);}return _0x5c3f35;};}function handleError(_0x58a079,_0x55d3e1){_0x55d3e1=_0x55d3e1||0x1f4;return function(_0x7ffbc1){logger[_0xa8b1('0x25')](_0x7ffbc1[_0xa8b1('0x26')]);if(_0x7ffbc1[_0xa8b1('0x27')]){delete _0x7ffbc1[_0xa8b1('0x27')];}_0x58a079[_0xa8b1('0x18')](_0x55d3e1)[_0xa8b1('0x28')](_0x7ffbc1);};}exports[_0xa8b1('0x29')]=function(_0x1f5314,_0x13b5e2){var _0x315add={'raw':!![],'where':{'id':_0x1f5314['params']['id']}},_0x245632={};_0x245632[_0xa8b1('0x2a')]=_[_0xa8b1('0x2b')](db[_0xa8b1('0x2c')]['rawAttributes']);_0x245632[_0xa8b1('0x2d')]=_[_0xa8b1('0x2b')](_0x1f5314[_0xa8b1('0x2d')]);_0x245632[_0xa8b1('0x2e')]=_[_0xa8b1('0x2f')](_0x245632[_0xa8b1('0x2a')],_0x245632['query']);_0x315add['attributes']=_['intersection'](_0x245632['model'],qs['fields'](_0x1f5314['query']['fields']));_0x315add[_0xa8b1('0x30')]=_0x315add[_0xa8b1('0x30')][_0xa8b1('0x31')]?_0x315add[_0xa8b1('0x30')]:_0x245632['model'];if(_0x1f5314[_0xa8b1('0x2d')][_0xa8b1('0x32')]){_0x315add['include']=[{'all':!![]}];}_0x315add=_[_0xa8b1('0x33')]({},_0x315add,_0x1f5314[_0xa8b1('0x34')]);return db['ChatApplication'][_0xa8b1('0x35')](_0x315add)[_0xa8b1('0x23')](handleEntityNotFound(_0x13b5e2,null))['then'](respondWithResult(_0x13b5e2,null))[_0xa8b1('0x36')](handleError(_0x13b5e2,null));};exports[_0xa8b1('0x37')]=function(_0x1f63f7,_0x401c4e){if(_0x1f63f7['body']['id']){delete _0x1f63f7[_0xa8b1('0x38')]['id'];}return db[_0xa8b1('0x2c')][_0xa8b1('0x35')]({'where':{'id':_0x1f63f7[_0xa8b1('0x39')]['id']}})[_0xa8b1('0x23')](handleEntityNotFound(_0x401c4e,null))[_0xa8b1('0x23')](saveUpdates(_0x1f63f7[_0xa8b1('0x38')],null))['then'](respondWithResult(_0x401c4e,null))['catch'](handleError(_0x401c4e,null));};exports[_0xa8b1('0x22')]=function(_0x55dbe4,_0x4fe7b1){return db[_0xa8b1('0x2c')]['find']({'where':{'id':_0x55dbe4[_0xa8b1('0x39')]['id']}})[_0xa8b1('0x23')](handleEntityNotFound(_0x4fe7b1,null))['then'](removeEntity(_0x4fe7b1,null))[_0xa8b1('0x36')](handleError(_0x4fe7b1,null));}; \ No newline at end of file +var _0x2f68=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','desk.js'];(function(_0x3a5a47,_0x5294fa){var _0x4fbaf4=function(_0x397ee4){while(--_0x397ee4){_0x3a5a47['push'](_0x3a5a47['shift']());}};_0x4fbaf4(++_0x5294fa);}(_0x2f68,0x9a));var _0x82f6=function(_0x448883,_0x5a93c8){_0x448883=_0x448883-0x0;var _0x344637=_0x2f68[_0x448883];return _0x344637;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];function respondWithStatusCode(_0x442262,_0x4cc967){_0x4cc967=_0x4cc967||0xcc;return function(_0x194da7){if(_0x194da7){return _0x442262[_0x82f6('0x15')](_0x4cc967);}return _0x442262[_0x82f6('0x16')](_0x4cc967)[_0x82f6('0x17')]();};}function respondWithResult(_0x371481,_0xa00275){_0xa00275=_0xa00275||0xc8;return function(_0x115c7b){if(_0x115c7b){return _0x371481[_0x82f6('0x16')](_0xa00275)[_0x82f6('0x18')](_0x115c7b);}};}function respondWithFilteredResult(_0x55b58e,_0x389949){return function(_0x5d0827){if(_0x5d0827){var _0x249222=typeof _0x389949[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x389949[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x2326ae=_0x5d0827[_0x82f6('0x1c')];var _0xcbc95f=_0x249222?0x0:_0x389949[_0x82f6('0x19')];var _0x2bfd57=_0x249222?_0x5d0827[_0x82f6('0x1c')]:_0x389949[_0x82f6('0x19')]+_0x389949[_0x82f6('0x1b')];var _0x4fe226;if(_0x2bfd57>=_0x2326ae){_0x2bfd57=_0x2326ae;_0x4fe226=0xc8;}else{_0x4fe226=0xce;}_0x55b58e[_0x82f6('0x16')](_0x4fe226);return _0x55b58e['set'](_0x82f6('0x1d'),_0xcbc95f+'-'+_0x2bfd57+'/'+_0x2326ae)[_0x82f6('0x18')](_0x5d0827);}return null;};}function patchUpdates(_0x55cbce){return function(_0x2b03ad){try{jsonpatch[_0x82f6('0x1e')](_0x2b03ad,_0x55cbce,!![]);}catch(_0x46713a){return BPromise[_0x82f6('0x1f')](_0x46713a);}return _0x2b03ad['save']();};}function saveUpdates(_0xdc4dea,_0x4beccf){return function(_0x8668bb){if(_0x8668bb){return _0x8668bb[_0x82f6('0x20')](_0xdc4dea)['then'](function(_0x516deb){return _0x516deb;});}return null;};}function removeEntity(_0x3af5f7,_0x1d96d5){return function(_0x4c57c5){if(_0x4c57c5){return _0x4c57c5['destroy']()[_0x82f6('0x21')](function(){_0x3af5f7[_0x82f6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfd8b68,_0x304e83){return function(_0x5037f8){if(!_0x5037f8){_0xfd8b68['sendStatus'](0x194);}return _0x5037f8;};}function handleError(_0x1c165b,_0x5187d0){_0x5187d0=_0x5187d0||0x1f4;return function(_0x469b6b){logger[_0x82f6('0x22')](_0x469b6b['stack']);if(_0x469b6b[_0x82f6('0x23')]){delete _0x469b6b[_0x82f6('0x23')];}_0x1c165b[_0x82f6('0x16')](_0x5187d0)[_0x82f6('0x24')](_0x469b6b);};}exports['show']=function(_0x40a071,_0x1fb461){var _0x14a309={'raw':!![],'where':{'id':_0x40a071[_0x82f6('0x25')]['id']}},_0x400137={};_0x400137[_0x82f6('0x26')]=_[_0x82f6('0x27')](db[_0x82f6('0x28')][_0x82f6('0x29')]);_0x400137[_0x82f6('0x2a')]=_[_0x82f6('0x27')](_0x40a071[_0x82f6('0x2a')]);_0x400137[_0x82f6('0x2b')]=_[_0x82f6('0x2c')](_0x400137['model'],_0x400137[_0x82f6('0x2a')]);_0x14a309[_0x82f6('0x2d')]=_[_0x82f6('0x2c')](_0x400137['model'],qs[_0x82f6('0x2e')](_0x40a071[_0x82f6('0x2a')][_0x82f6('0x2e')]));_0x14a309[_0x82f6('0x2d')]=_0x14a309[_0x82f6('0x2d')][_0x82f6('0x2f')]?_0x14a309[_0x82f6('0x2d')]:_0x400137[_0x82f6('0x26')];if(_0x40a071[_0x82f6('0x2a')][_0x82f6('0x30')]){_0x14a309[_0x82f6('0x31')]=[{'all':!![]}];}_0x14a309=_[_0x82f6('0x32')]({},_0x14a309,_0x40a071[_0x82f6('0x33')]);return db[_0x82f6('0x28')]['find'](_0x14a309)[_0x82f6('0x21')](handleEntityNotFound(_0x1fb461,null))[_0x82f6('0x21')](respondWithResult(_0x1fb461,null))[_0x82f6('0x34')](handleError(_0x1fb461,null));};exports[_0x82f6('0x20')]=function(_0xa9bd0,_0x4390a9){if(_0xa9bd0[_0x82f6('0x35')]['id']){delete _0xa9bd0[_0x82f6('0x35')]['id'];}return db[_0x82f6('0x28')][_0x82f6('0x36')]({'where':{'id':_0xa9bd0[_0x82f6('0x25')]['id']}})[_0x82f6('0x21')](handleEntityNotFound(_0x4390a9,null))[_0x82f6('0x21')](saveUpdates(_0xa9bd0[_0x82f6('0x35')],null))['then'](respondWithResult(_0x4390a9,null))[_0x82f6('0x34')](handleError(_0x4390a9,null));};exports['destroy']=function(_0x4dd445,_0x321fdc){return db[_0x82f6('0x28')]['find']({'where':{'id':_0x4dd445[_0x82f6('0x25')]['id']}})[_0x82f6('0x21')](handleEntityNotFound(_0x321fdc,null))[_0x82f6('0x21')](removeEntity(_0x321fdc,null))['catch'](handleError(_0x321fdc,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9a416f8..b8cc0ce 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 _0x5197=['ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x125e0b,_0x48f4fb){var _0x382020=function(_0x2da088){while(--_0x2da088){_0x125e0b['push'](_0x125e0b['shift']());}};_0x382020(++_0x48f4fb);}(_0x5197,0x145));var _0x7519=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x5197[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x7519('0x0'));var util=require(_0x7519('0x1'));var logger=require(_0x7519('0x2'))(_0x7519('0x3'));var moment=require('moment');var BPromise=require(_0x7519('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7519('0x5'));var rimraf=require(_0x7519('0x6'));var config=require(_0x7519('0x7'));var attributes=require(_0x7519('0x8'));module[_0x7519('0x9')]=function(_0xa163ac,_0x2419b6){return _0xa163ac[_0x7519('0xa')](_0x7519('0xb'),attributes,{'tableName':_0x7519('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7519('0xd')});}; \ No newline at end of file +var _0x9335=['ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x9335,0xab));var _0x5933=function(_0x5cb1a9,_0x1f7957){_0x5cb1a9=_0x5cb1a9-0x0;var _0x1c5086=_0x9335[_0x5cb1a9];return _0x1c5086;};'use strict';var _=require(_0x5933('0x0'));var util=require(_0x5933('0x1'));var logger=require('../../config/logger')(_0x5933('0x2'));var moment=require(_0x5933('0x3'));var BPromise=require(_0x5933('0x4'));var rp=require(_0x5933('0x5'));var fs=require('fs');var path=require(_0x5933('0x6'));var rimraf=require(_0x5933('0x7'));var config=require(_0x5933('0x8'));var attributes=require('./chatApplication.attributes');module[_0x5933('0x9')]=function(_0x4de024,_0x553710){return _0x4de024[_0x5933('0xa')](_0x5933('0xb'),attributes,{'tableName':_0x5933('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5933('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index ee870d1..32bbc11 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 _0x6a8e=['ChatApplication,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2328fc,_0x444f18){var _0x160f0f=function(_0x5ec9a8){while(--_0x5ec9a8){_0x2328fc['push'](_0x2328fc['shift']());}};_0x160f0f(++_0x444f18);}(_0x6a8e,0x15a));var _0xe6a8=function(_0x4de003,_0x1677e9){_0x4de003=_0x4de003-0x0;var _0x2875b9=_0x6a8e[_0x4de003];return _0x2875b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe6a8('0x0'));var BPromise=require('bluebird');var rs=require(_0xe6a8('0x1'));var fs=require('fs');var Redis=require(_0xe6a8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6a8('0x3'));var logger=require(_0xe6a8('0x4'))(_0xe6a8('0x5'));var config=require(_0xe6a8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe6a8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdefd,_0x43c877,_0x29b417){return new BPromise(function(_0xed8860,_0x253fa2){return client[_0xe6a8('0x8')](_0x4fdefd,_0x29b417)['then'](function(_0x364f03){logger[_0xe6a8('0x9')]('ChatApplication,\x20%s,\x20%s',_0x43c877,_0xe6a8('0xa'));logger['debug'](_0xe6a8('0xb'),_0x43c877,'request\x20sent',JSON[_0xe6a8('0xc')](_0x364f03));if(_0x364f03[_0xe6a8('0xd')]){if(_0x364f03[_0xe6a8('0xd')]['code']===0x1f4){logger[_0xe6a8('0xd')](_0xe6a8('0xe'),_0x43c877,_0x364f03['error']['message']);return _0x253fa2(_0x364f03['error'][_0xe6a8('0xf')]);}logger[_0xe6a8('0xd')](_0xe6a8('0xe'),_0x43c877,_0x364f03[_0xe6a8('0xd')][_0xe6a8('0xf')]);return _0xed8860(_0x364f03[_0xe6a8('0xd')][_0xe6a8('0xf')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x43c877,'request\x20sent');_0xed8860(_0x364f03[_0xe6a8('0x10')]['message']);}})[_0xe6a8('0x11')](function(_0x3a86dc){logger[_0xe6a8('0xd')](_0xe6a8('0xe'),_0x43c877,_0x3a86dc);_0x253fa2(_0x3a86dc);});});} \ No newline at end of file +var _0x02e8=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x02e8,0x1dc));var _0x802e=function(_0x50c633,_0x53bb55){_0x50c633=_0x50c633-0x0;var _0x1f0ae7=_0x02e8[_0x50c633];return _0x1f0ae7;};'use strict';var _=require(_0x802e('0x0'));var util=require(_0x802e('0x1'));var moment=require(_0x802e('0x2'));var BPromise=require(_0x802e('0x3'));var rs=require(_0x802e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x802e('0x5'))['db'];var utils=require(_0x802e('0x6'));var logger=require(_0x802e('0x7'))(_0x802e('0x8'));var config=require(_0x802e('0x9'));var jayson=require(_0x802e('0xa'));var client=jayson['client'][_0x802e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20d36b,_0x247a46,_0x4cc6c5){return new BPromise(function(_0x22db61,_0x22ef11){return client[_0x802e('0xc')](_0x20d36b,_0x4cc6c5)[_0x802e('0xd')](function(_0x1ea7f7){logger[_0x802e('0xe')](_0x802e('0xf'),_0x247a46,'request\x20sent');logger[_0x802e('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x247a46,_0x802e('0x11'),JSON[_0x802e('0x12')](_0x1ea7f7));if(_0x1ea7f7['error']){if(_0x1ea7f7[_0x802e('0x13')][_0x802e('0x14')]===0x1f4){logger[_0x802e('0x13')]('ChatApplication,\x20%s,\x20%s',_0x247a46,_0x1ea7f7[_0x802e('0x13')]['message']);return _0x22ef11(_0x1ea7f7['error']['message']);}logger[_0x802e('0x13')](_0x802e('0xf'),_0x247a46,_0x1ea7f7[_0x802e('0x13')][_0x802e('0x15')]);return _0x22db61(_0x1ea7f7[_0x802e('0x13')][_0x802e('0x15')]);}else{logger['info'](_0x802e('0xf'),_0x247a46,'request\x20sent');_0x22db61(_0x1ea7f7['result']['message']);}})[_0x802e('0x16')](function(_0x3a1712){logger[_0x802e('0x13')](_0x802e('0xf'),_0x247a46,_0x3a1712);_0x22ef11(_0x3a1712);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2d6910d..020bbd3 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 _0xb4f5=['isAuthenticated','show','put','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatApplication.controller','/:id'];(function(_0x369128,_0x13dfde){var _0x202cd4=function(_0x1146de){while(--_0x1146de){_0x369128['push'](_0x369128['shift']());}};_0x202cd4(++_0x13dfde);}(_0xb4f5,0x1c0));var _0x5b4f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb4f5[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b4f('0x0'));var timeout=require(_0x5b4f('0x1'));var express=require(_0x5b4f('0x2'));var router=express['Router']();var fs_extra=require(_0x5b4f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5b4f('0x4'));var config=require('../../config/environment');var controller=require(_0x5b4f('0x5'));router['get'](_0x5b4f('0x6'),auth[_0x5b4f('0x7')](),controller[_0x5b4f('0x8')]);router[_0x5b4f('0x9')](_0x5b4f('0x6'),auth['isAuthenticated'](),controller[_0x5b4f('0xa')]);router['delete']('/:id',auth[_0x5b4f('0x7')](),controller[_0x5b4f('0xb')]);module[_0x5b4f('0xc')]=router; \ No newline at end of file +var _0x795c=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x462992,_0x7198f3){var _0x58293e=function(_0x39c347){while(--_0x39c347){_0x462992['push'](_0x462992['shift']());}};_0x58293e(++_0x7198f3);}(_0x795c,0xd2));var _0xc795=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x795c[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0xc795('0x0'));var util=require(_0xc795('0x1'));var path=require(_0xc795('0x2'));var timeout=require(_0xc795('0x3'));var express=require('express');var router=express[_0xc795('0x4')]();var fs_extra=require(_0xc795('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc795('0x6'));var config=require(_0xc795('0x7'));var controller=require('./chatApplication.controller');router['get'](_0xc795('0x8'),auth[_0xc795('0x9')](),controller[_0xc795('0xa')]);router[_0xc795('0xb')](_0xc795('0x8'),auth[_0xc795('0x9')](),controller[_0xc795('0xc')]);router[_0xc795('0xd')]('/:id',auth[_0xc795('0x9')](),controller[_0xc795('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index d4324a1..c058923 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 _0x22ed=['BOOLEAN','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x22ed,0x1a9));var _0xd22e=function(_0x2c34b6,_0x4083ea){_0x2c34b6=_0x2c34b6-0x0;var _0x18687c=_0x22ed[_0x2c34b6];return _0x18687c;};'use strict';var Sequelize=require(_0xd22e('0x0'));module[_0xd22e('0x1')]={'name':{'type':Sequelize[_0xd22e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd22e('0x2')]},'write':{'type':Sequelize[_0xd22e('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xad1b=['exports','STRING','sequelize'];(function(_0x4b6b39,_0x547f83){var _0x5145df=function(_0x31e37b){while(--_0x31e37b){_0x4b6b39['push'](_0x4b6b39['shift']());}};_0x5145df(++_0x547f83);}(_0xad1b,0x131));var _0xbad1=function(_0x426fab,_0x510061){_0x426fab=_0x426fab-0x0;var _0x3bc957=_0xad1b[_0x426fab];return _0x3bc957;};'use strict';var Sequelize=require(_0xbad1('0x0'));module[_0xbad1('0x1')]={'name':{'type':Sequelize[_0xbad1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbad1('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 50ab04e..ed9f371 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 _0x34a9=['ChatGroupId','$gte','split','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','redis','./chatGroup.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','User','order','filter','getMembers','removeMembers'];(function(_0x8107c8,_0x14a0fd){var _0x5ba63e=function(_0x1b5aec){while(--_0x1b5aec){_0x8107c8['push'](_0x8107c8['shift']());}};_0x5ba63e(++_0x14a0fd);}(_0x34a9,0xc6));var _0x934a=function(_0x194a19,_0xc87d){_0x194a19=_0x194a19-0x0;var _0x3c1ff4=_0x34a9[_0x194a19];return _0x3c1ff4;};'use strict';var emlformat=require(_0x934a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x934a('0x1'));var jsonpatch=require(_0x934a('0x2'));var rp=require(_0x934a('0x3'));var moment=require(_0x934a('0x4'));var BPromise=require(_0x934a('0x5'));var Mustache=require(_0x934a('0x6'));var util=require(_0x934a('0x7'));var path=require('path');var sox=require(_0x934a('0x8'));var csv=require(_0x934a('0x9'));var ejs=require(_0x934a('0xa'));var fs=require('fs');var fs_extra=require(_0x934a('0xb'));var _=require(_0x934a('0xc'));var squel=require(_0x934a('0xd'));var crypto=require(_0x934a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x934a('0x9'));var querystring=require('querystring');var Papa=require(_0x934a('0xf'));var Redis=require(_0x934a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x934a('0x11'));var as=require(_0x934a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x934a('0x13'))(_0x934a('0x14'));var utils=require(_0x934a('0x15'));var config=require(_0x934a('0x16'));var licenseUtil=require(_0x934a('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x934a('0x18')](config['redis'],{'host':_0x934a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x934a('0x1a')]));require(_0x934a('0x1b'))['register'](socket);function respondWithStatusCode(_0x20b9b2,_0x1b118f){_0x1b118f=_0x1b118f||0xcc;return function(_0xf4ee19){if(_0xf4ee19){return _0x20b9b2[_0x934a('0x1c')](_0x1b118f);}return _0x20b9b2[_0x934a('0x1d')](_0x1b118f)[_0x934a('0x1e')]();};}function respondWithResult(_0x25cf95,_0x562d70){_0x562d70=_0x562d70||0xc8;return function(_0x41d2aa){if(_0x41d2aa){return _0x25cf95[_0x934a('0x1d')](_0x562d70)[_0x934a('0x1f')](_0x41d2aa);}};}function respondWithFilteredResult(_0x415f22,_0x37b533){return function(_0x5124de){if(_0x5124de){var _0x38bee0=typeof _0x37b533['offset']==='undefined'&&typeof _0x37b533[_0x934a('0x20')]===_0x934a('0x21');var _0x10774b=_0x5124de[_0x934a('0x22')];var _0x413149=_0x38bee0?0x0:_0x37b533[_0x934a('0x23')];var _0x5974e3=_0x38bee0?_0x5124de[_0x934a('0x22')]:_0x37b533['offset']+_0x37b533['limit'];var _0x44a706;if(_0x5974e3>=_0x10774b){_0x5974e3=_0x10774b;_0x44a706=0xc8;}else{_0x44a706=0xce;}_0x415f22[_0x934a('0x1d')](_0x44a706);return _0x415f22[_0x934a('0x24')](_0x934a('0x25'),_0x413149+'-'+_0x5974e3+'/'+_0x10774b)[_0x934a('0x1f')](_0x5124de);}return null;};}function patchUpdates(_0x4799c6){return function(_0x50b59b){try{jsonpatch[_0x934a('0x26')](_0x50b59b,_0x4799c6,!![]);}catch(_0x4c1a6f){return BPromise[_0x934a('0x27')](_0x4c1a6f);}return _0x50b59b[_0x934a('0x28')]();};}function saveUpdates(_0x4ce268,_0x4c5367){return function(_0x5acffb){if(_0x5acffb){return _0x5acffb[_0x934a('0x29')](_0x4ce268)['then'](function(_0x2185e4){return _0x2185e4;});}return null;};}function removeEntity(_0x9a6041,_0x585113){return function(_0x146924){if(_0x146924){return _0x146924['destroy']()[_0x934a('0x2a')](function(){_0x9a6041['status'](0xcc)[_0x934a('0x1e')]();});}};}function handleEntityNotFound(_0x467506,_0x432994){return function(_0x4b6e91){if(!_0x4b6e91){_0x467506[_0x934a('0x1c')](0x194);}return _0x4b6e91;};}function handleError(_0x4b225e,_0x402285){_0x402285=_0x402285||0x1f4;return function(_0x541eca){logger[_0x934a('0x2b')](_0x541eca[_0x934a('0x2c')]);if(_0x541eca[_0x934a('0x2d')]){delete _0x541eca[_0x934a('0x2d')];}_0x4b225e['status'](_0x402285)[_0x934a('0x2e')](_0x541eca);};}exports[_0x934a('0x2f')]=function(_0x278e96,_0x3edf5c){var _0x2a6270={},_0x2a5514={},_0x5b7e91={'count':0x0,'rows':[]};var _0x4dfa99=_['map'](db[_0x934a('0x30')][_0x934a('0x31')],function(_0x283981){return{'name':_0x283981[_0x934a('0x32')],'type':_0x283981[_0x934a('0x33')][_0x934a('0x34')]};});_0x2a5514[_0x934a('0x35')]=_['map'](_0x4dfa99,_0x934a('0x2d'));_0x2a5514[_0x934a('0x36')]=_[_0x934a('0x37')](_0x278e96['query']);_0x2a5514[_0x934a('0x38')]=_[_0x934a('0x39')](_0x2a5514[_0x934a('0x35')],_0x2a5514[_0x934a('0x36')]);_0x2a6270[_0x934a('0x3a')]=_[_0x934a('0x39')](_0x2a5514[_0x934a('0x35')],qs[_0x934a('0x3b')](_0x278e96['query'][_0x934a('0x3b')]));_0x2a6270[_0x934a('0x3a')]=_0x2a6270[_0x934a('0x3a')][_0x934a('0x3c')]?_0x2a6270[_0x934a('0x3a')]:_0x2a5514['model'];if(!_0x278e96['query'][_0x934a('0x3d')](_0x934a('0x3e'))){_0x2a6270[_0x934a('0x20')]=qs[_0x934a('0x20')](_0x278e96[_0x934a('0x36')][_0x934a('0x20')]);_0x2a6270[_0x934a('0x23')]=qs['offset'](_0x278e96['query'][_0x934a('0x23')]);}_0x2a6270['order']=qs['sort'](_0x278e96['query'][_0x934a('0x3f')]);_0x2a6270[_0x934a('0x40')]=qs[_0x934a('0x38')](_[_0x934a('0x41')](_0x278e96[_0x934a('0x36')],_0x2a5514[_0x934a('0x38')]),_0x4dfa99);if(_0x278e96['query']['filter']){_0x2a6270[_0x934a('0x40')]=_[_0x934a('0x42')](_0x2a6270['where'],{'$or':_[_0x934a('0x43')](_0x4dfa99,function(_0x4cee24){if(_0x4cee24[_0x934a('0x33')]!==_0x934a('0x44')){var _0x3b5760={};_0x3b5760[_0x4cee24[_0x934a('0x2d')]]={'$like':'%'+_0x278e96['query']['filter']+'%'};return _0x3b5760;}})});}_0x2a6270=_[_0x934a('0x42')]({},_0x2a6270,_0x278e96[_0x934a('0x45')]);var _0x5aa335={'where':_0x2a6270[_0x934a('0x40')]};return db[_0x934a('0x30')][_0x934a('0x22')](_0x5aa335)[_0x934a('0x2a')](function(_0x34dfb5){_0x5b7e91['count']=_0x34dfb5;if(_0x278e96['query'][_0x934a('0x46')]){_0x2a6270[_0x934a('0x47')]=[{'all':!![]}];}return db[_0x934a('0x30')]['findAll'](_0x2a6270);})[_0x934a('0x2a')](function(_0x5d7684){_0x5b7e91[_0x934a('0x48')]=_0x5d7684;return _0x5b7e91;})['then'](respondWithFilteredResult(_0x3edf5c,_0x2a6270))['catch'](handleError(_0x3edf5c,null));};exports[_0x934a('0x49')]=function(_0x5a9230,_0x1aa488){var _0x3b27d6={'raw':!![],'where':{'id':_0x5a9230[_0x934a('0x4a')]['id']}},_0x4b0e2e={};_0x4b0e2e[_0x934a('0x35')]=_[_0x934a('0x37')](db[_0x934a('0x30')][_0x934a('0x31')]);_0x4b0e2e[_0x934a('0x36')]=_[_0x934a('0x37')](_0x5a9230[_0x934a('0x36')]);_0x4b0e2e['filters']=_[_0x934a('0x39')](_0x4b0e2e[_0x934a('0x35')],_0x4b0e2e[_0x934a('0x36')]);_0x3b27d6['attributes']=_[_0x934a('0x39')](_0x4b0e2e['model'],qs[_0x934a('0x3b')](_0x5a9230[_0x934a('0x36')][_0x934a('0x3b')]));_0x3b27d6['attributes']=_0x3b27d6[_0x934a('0x3a')]['length']?_0x3b27d6[_0x934a('0x3a')]:_0x4b0e2e[_0x934a('0x35')];if(_0x5a9230['query'][_0x934a('0x46')]){_0x3b27d6['include']=[{'all':!![]}];}_0x3b27d6=_[_0x934a('0x42')]({},_0x3b27d6,_0x5a9230[_0x934a('0x45')]);return db[_0x934a('0x30')][_0x934a('0x4b')](_0x3b27d6)[_0x934a('0x2a')](handleEntityNotFound(_0x1aa488,null))[_0x934a('0x2a')](respondWithResult(_0x1aa488,null))[_0x934a('0x4c')](handleError(_0x1aa488,null));};exports[_0x934a('0x4d')]=function(_0x21caaa,_0x3f5e44){return db[_0x934a('0x30')][_0x934a('0x4d')](_0x21caaa[_0x934a('0x4e')],{})[_0x934a('0x2a')](respondWithResult(_0x3f5e44,0xc9))[_0x934a('0x4c')](handleError(_0x3f5e44,null));};exports['update']=function(_0x380f83,_0x198690){if(_0x380f83[_0x934a('0x4e')]['id']){delete _0x380f83[_0x934a('0x4e')]['id'];}return db[_0x934a('0x30')]['find']({'where':{'id':_0x380f83[_0x934a('0x4a')]['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x198690,null))[_0x934a('0x2a')](saveUpdates(_0x380f83[_0x934a('0x4e')],null))['then'](respondWithResult(_0x198690,null))['catch'](handleError(_0x198690,null));};exports[_0x934a('0x4f')]=function(_0x4d1737,_0x4cfd6c){return db['ChatGroup'][_0x934a('0x4b')]({'where':{'id':_0x4d1737[_0x934a('0x4a')]['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x4cfd6c,null))['then'](removeEntity(_0x4cfd6c,null))[_0x934a('0x4c')](handleError(_0x4cfd6c,null));};exports[_0x934a('0x50')]=function(_0x5146ae,_0x355476){return db['ChatGroup'][_0x934a('0x50')]()[_0x934a('0x2a')](respondWithResult(_0x355476,null))[_0x934a('0x4c')](handleError(_0x355476,null));};exports[_0x934a('0x51')]=function(_0x37d3f3,_0x692e68,_0xeb3003){return db[_0x934a('0x52')][_0x934a('0x22')]({'where':{'ChatGroupId':_0x37d3f3[_0x934a('0x4a')]['id'],'ToId':_0x37d3f3[_0x934a('0x53')]['id'],'read':![]}})[_0x934a('0x2a')](function(_0x545f8a){return{'id':_['toInteger'](_0x37d3f3[_0x934a('0x4a')]['id']),'count':_0x545f8a};})[_0x934a('0x2a')](respondWithResult(_0x692e68,null))[_0x934a('0x4c')](handleError(_0x692e68,null));};exports[_0x934a('0x54')]=function(_0x561a86,_0x1c4830,_0x3a88ee){return db['ChatGroup'][_0x934a('0x4b')]({'where':{'id':_0x561a86[_0x934a('0x4a')]['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x1c4830,null))[_0x934a('0x2a')](function(_0x52bcfb){if(_0x52bcfb){return _0x52bcfb[_0x934a('0x54')](_0x561a86[_0x934a('0x4e')][_0x934a('0x55')],_[_0x934a('0x56')](_0x561a86[_0x934a('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1c4830,null))['catch'](handleError(_0x1c4830,null));};exports['getMembers']=function(_0x5dec8a,_0x1093bf,_0x25412c){var _0xcff56e={};var _0x3552c0={};var _0x1705e1;var _0x3d82fc;return db['ChatGroup'][_0x934a('0x57')]({'where':{'id':_0x5dec8a[_0x934a('0x4a')]['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x1093bf,null))[_0x934a('0x2a')](function(_0x1873f1){if(_0x1873f1){_0x1705e1=_0x1873f1;_0x3552c0['model']=_[_0x934a('0x37')](db[_0x934a('0x58')][_0x934a('0x31')]);_0x3552c0[_0x934a('0x36')]=_['keys'](_0x5dec8a[_0x934a('0x36')]);_0x3552c0[_0x934a('0x38')]=_[_0x934a('0x39')](_0x3552c0[_0x934a('0x35')],_0x3552c0[_0x934a('0x36')]);_0xcff56e['attributes']=_[_0x934a('0x39')](_0x3552c0[_0x934a('0x35')],qs[_0x934a('0x3b')](_0x5dec8a['query'][_0x934a('0x3b')]));_0xcff56e[_0x934a('0x3a')]=_0xcff56e['attributes']['length']?_0xcff56e[_0x934a('0x3a')]:_0x3552c0[_0x934a('0x35')];_0xcff56e[_0x934a('0x59')]=qs[_0x934a('0x3f')](_0x5dec8a[_0x934a('0x36')]['sort']);_0xcff56e[_0x934a('0x40')]=qs['filters'](_['pick'](_0x5dec8a['query'],_0x3552c0[_0x934a('0x38')]));if(_0x5dec8a[_0x934a('0x36')][_0x934a('0x5a')]){_0xcff56e[_0x934a('0x40')]=_[_0x934a('0x42')](_0xcff56e[_0x934a('0x40')],{'$or':_[_0x934a('0x43')](_0xcff56e[_0x934a('0x3a')],function(_0x10b9dd){var _0x1a3a0e={};_0x1a3a0e[_0x10b9dd]={'$like':'%'+_0x5dec8a[_0x934a('0x36')]['filter']+'%'};return _0x1a3a0e;})});}_0xcff56e=_[_0x934a('0x42')]({},_0xcff56e,_0x5dec8a[_0x934a('0x45')]);return _0x1705e1[_0x934a('0x5b')](_0xcff56e);}})[_0x934a('0x2a')](function(_0x51e9a5){if(_0x51e9a5){_0x3d82fc=_0x51e9a5[_0x934a('0x3c')];if(!_0x5dec8a['query'][_0x934a('0x3d')](_0x934a('0x3e'))){_0xcff56e['limit']=qs[_0x934a('0x20')](_0x5dec8a['query'][_0x934a('0x20')]);_0xcff56e[_0x934a('0x23')]=qs[_0x934a('0x23')](_0x5dec8a['query'][_0x934a('0x23')]);}return _0x1705e1[_0x934a('0x5b')](_0xcff56e);}})[_0x934a('0x2a')](function(_0x384f50){if(_0x384f50){return _0x384f50?{'count':_0x3d82fc,'rows':_0x384f50}:null;}})['then'](respondWithResult(_0x1093bf,null))[_0x934a('0x4c')](handleError(_0x1093bf,null));};exports['removeMembers']=function(_0x56a50b,_0x208840,_0x82a0f2){return db['ChatGroup'][_0x934a('0x4b')]({'where':{'id':_0x56a50b[_0x934a('0x4a')]['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x208840,null))['then'](function(_0x53d232){if(_0x53d232){return _0x53d232[_0x934a('0x5c')](_0x56a50b['query']['ids']);}})[_0x934a('0x2a')](respondWithStatusCode(_0x208840,null))[_0x934a('0x4c')](handleError(_0x208840,null));};exports['addMessage']=function(_0x31638b,_0x4025f5,_0x371be9){if(_0x31638b[_0x934a('0x4e')]['id']){delete _0x31638b[_0x934a('0x4e')]['id'];}return db[_0x934a('0x30')][_0x934a('0x4b')]({'where':{'id':_0x31638b['params']['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x4025f5,null))[_0x934a('0x2a')](function(_0x2bc808){if(_0x2bc808){_0x31638b[_0x934a('0x4e')][_0x934a('0x5d')]=_0x2bc808['id'];return db[_0x934a('0x52')][_0x934a('0x4d')](_0x31638b[_0x934a('0x4e')]);}})[_0x934a('0x2a')](respondWithResult(_0x4025f5,null))[_0x934a('0x4c')](handleError(_0x4025f5,null));};exports['getMessages']=function(_0xf7d5e,_0x3aaa83,_0x4746f6){var _0x4740fa={};var _0x789700={};var _0x1d39ed;var _0x8afff1;return db[_0x934a('0x30')][_0x934a('0x57')]({'where':{'id':_0xf7d5e['params']['id']}})[_0x934a('0x2a')](handleEntityNotFound(_0x3aaa83,null))[_0x934a('0x2a')](function(_0x33fb00){if(_0x33fb00){_0x1d39ed=_0x33fb00;_0x789700[_0x934a('0x35')]=_[_0x934a('0x37')](db[_0x934a('0x52')][_0x934a('0x31')]);_0x789700[_0x934a('0x36')]=_[_0x934a('0x37')](_0xf7d5e[_0x934a('0x36')]);_0x789700[_0x934a('0x38')]=_[_0x934a('0x39')](_0x789700[_0x934a('0x35')],_0x789700['query']);_0x4740fa[_0x934a('0x3a')]=_[_0x934a('0x39')](_0x789700[_0x934a('0x35')],qs['fields'](_0xf7d5e[_0x934a('0x36')][_0x934a('0x3b')]));_0x4740fa['attributes']=_0x4740fa[_0x934a('0x3a')]['length']?_0x4740fa[_0x934a('0x3a')]:_0x789700[_0x934a('0x35')];_0x4740fa[_0x934a('0x59')]=qs[_0x934a('0x3f')](_0xf7d5e[_0x934a('0x36')][_0x934a('0x3f')]);_0x4740fa[_0x934a('0x40')]=qs[_0x934a('0x38')](_['pick'](_0xf7d5e['query'],_0x789700['filters']));if(_0xf7d5e[_0x934a('0x36')][_0x934a('0x5a')]){_0x4740fa[_0x934a('0x40')]=_['merge'](_0x4740fa[_0x934a('0x40')],{'$or':_[_0x934a('0x43')](_0x4740fa[_0x934a('0x3a')],function(_0xd01758){var _0x209200={};_0x209200[_0xd01758]={'$like':'%'+_0xf7d5e[_0x934a('0x36')][_0x934a('0x5a')]+'%'};return _0x209200;})});}if(_0xf7d5e[_0x934a('0x36')][_0x934a('0x5e')]){var _0x474d8f=_0xf7d5e[_0x934a('0x36')][_0x934a('0x5e')][_0x934a('0x5f')](',');var _0x6d8aec={};_0x6d8aec[_0x474d8f[0x0]]={'$gte':moment(_0x474d8f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4740fa[_0x934a('0x40')]=_[_0x934a('0x42')](_0x4740fa[_0x934a('0x40')],_0x6d8aec);}_0x4740fa=_['merge']({},_0x4740fa,_0xf7d5e[_0x934a('0x45')]);return _0x1d39ed[_0x934a('0x60')](_0x4740fa);}})['then'](function(_0x3881ba){if(_0x3881ba){_0x8afff1=_0x3881ba['length'];if(!_0xf7d5e['query'][_0x934a('0x3d')](_0x934a('0x3e'))){_0x4740fa[_0x934a('0x20')]=qs[_0x934a('0x20')](_0xf7d5e['query']['limit']);_0x4740fa[_0x934a('0x23')]=qs[_0x934a('0x23')](_0xf7d5e[_0x934a('0x36')]['offset']);}return _0x1d39ed[_0x934a('0x60')](_0x4740fa);}})[_0x934a('0x2a')](function(_0xbe6cd8){if(_0xbe6cd8){return _0xbe6cd8?{'count':_0x8afff1,'rows':_0xbe6cd8}:null;}})[_0x934a('0x2a')](respondWithResult(_0x3aaa83,null))[_0x934a('0x4c')](handleError(_0x3aaa83,null));}; \ No newline at end of file +var _0x0238=['bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','register','status','end','json','limit','count','offset','set','reject','then','destroy','sendStatus','name','send','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','order','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0238,0x17e));var _0x8023=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0238[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8023('0x0'));var rimraf=require(_0x8023('0x1'));var zipdir=require(_0x8023('0x2'));var jsonpatch=require(_0x8023('0x3'));var rp=require(_0x8023('0x4'));var moment=require(_0x8023('0x5'));var BPromise=require(_0x8023('0x6'));var Mustache=require(_0x8023('0x7'));var util=require(_0x8023('0x8'));var path=require(_0x8023('0x9'));var sox=require(_0x8023('0xa'));var csv=require(_0x8023('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8023('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8023('0xd'));var deskjs=require(_0x8023('0xe'));var toCsv=require(_0x8023('0xb'));var querystring=require(_0x8023('0xf'));var Papa=require(_0x8023('0x10'));var Redis=require(_0x8023('0x11'));var authService=require(_0x8023('0x12'));var qs=require(_0x8023('0x13'));var as=require(_0x8023('0x14'));var hardwareService=require(_0x8023('0x15'));var logger=require(_0x8023('0x16'))(_0x8023('0x17'));var utils=require(_0x8023('0x18'));var config=require(_0x8023('0x19'));var licenseUtil=require(_0x8023('0x1a'));var db=require(_0x8023('0x1b'))['db'];config['redis']=_[_0x8023('0x1c')](config[_0x8023('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x8023('0x1e'))(new Redis(config[_0x8023('0x1d')]));require(_0x8023('0x1f'))[_0x8023('0x20')](socket);function respondWithStatusCode(_0x3029bd,_0x55d39e){_0x55d39e=_0x55d39e||0xcc;return function(_0x55b61f){if(_0x55b61f){return _0x3029bd['sendStatus'](_0x55d39e);}return _0x3029bd[_0x8023('0x21')](_0x55d39e)[_0x8023('0x22')]();};}function respondWithResult(_0x450824,_0x8fd7bb){_0x8fd7bb=_0x8fd7bb||0xc8;return function(_0x5c974e){if(_0x5c974e){return _0x450824[_0x8023('0x21')](_0x8fd7bb)[_0x8023('0x23')](_0x5c974e);}};}function respondWithFilteredResult(_0x20481c,_0x18a191){return function(_0x2066a6){if(_0x2066a6){var _0x2e5251=typeof _0x18a191['offset']==='undefined'&&typeof _0x18a191[_0x8023('0x24')]==='undefined';var _0x51757e=_0x2066a6[_0x8023('0x25')];var _0x4d59a3=_0x2e5251?0x0:_0x18a191[_0x8023('0x26')];var _0x870fc=_0x2e5251?_0x2066a6[_0x8023('0x25')]:_0x18a191[_0x8023('0x26')]+_0x18a191['limit'];var _0x3a38f9;if(_0x870fc>=_0x51757e){_0x870fc=_0x51757e;_0x3a38f9=0xc8;}else{_0x3a38f9=0xce;}_0x20481c[_0x8023('0x21')](_0x3a38f9);return _0x20481c[_0x8023('0x27')]('Content-Range',_0x4d59a3+'-'+_0x870fc+'/'+_0x51757e)[_0x8023('0x23')](_0x2066a6);}return null;};}function patchUpdates(_0x12fb56){return function(_0x159c01){try{jsonpatch['apply'](_0x159c01,_0x12fb56,!![]);}catch(_0x4a3713){return BPromise[_0x8023('0x28')](_0x4a3713);}return _0x159c01['save']();};}function saveUpdates(_0x520a12,_0x46485e){return function(_0x3c3819){if(_0x3c3819){return _0x3c3819['update'](_0x520a12)[_0x8023('0x29')](function(_0x472ac6){return _0x472ac6;});}return null;};}function removeEntity(_0x3243a8,_0x3aa862){return function(_0x5afc27){if(_0x5afc27){return _0x5afc27[_0x8023('0x2a')]()[_0x8023('0x29')](function(){_0x3243a8[_0x8023('0x21')](0xcc)[_0x8023('0x22')]();});}};}function handleEntityNotFound(_0x14c4bd,_0x4d2d2b){return function(_0x1fc406){if(!_0x1fc406){_0x14c4bd[_0x8023('0x2b')](0x194);}return _0x1fc406;};}function handleError(_0x4869ec,_0x1ac33c){_0x1ac33c=_0x1ac33c||0x1f4;return function(_0x27341d){logger['error'](_0x27341d['stack']);if(_0x27341d[_0x8023('0x2c')]){delete _0x27341d[_0x8023('0x2c')];}_0x4869ec[_0x8023('0x21')](_0x1ac33c)[_0x8023('0x2d')](_0x27341d);};}exports['index']=function(_0x3efa16,_0x5c7083){var _0x4adbe0={},_0x2336f7={},_0x41b848={'count':0x0,'rows':[]};var _0x4d4add=_[_0x8023('0x2e')](db[_0x8023('0x2f')][_0x8023('0x30')],function(_0x164f7b){return{'name':_0x164f7b[_0x8023('0x31')],'type':_0x164f7b[_0x8023('0x32')]['key']};});_0x2336f7[_0x8023('0x33')]=_[_0x8023('0x2e')](_0x4d4add,'name');_0x2336f7[_0x8023('0x34')]=_[_0x8023('0x35')](_0x3efa16[_0x8023('0x34')]);_0x2336f7[_0x8023('0x36')]=_[_0x8023('0x37')](_0x2336f7['model'],_0x2336f7['query']);_0x4adbe0[_0x8023('0x38')]=_[_0x8023('0x37')](_0x2336f7[_0x8023('0x33')],qs[_0x8023('0x39')](_0x3efa16[_0x8023('0x34')]['fields']));_0x4adbe0['attributes']=_0x4adbe0['attributes']['length']?_0x4adbe0[_0x8023('0x38')]:_0x2336f7[_0x8023('0x33')];if(!_0x3efa16[_0x8023('0x34')][_0x8023('0x3a')](_0x8023('0x3b'))){_0x4adbe0[_0x8023('0x24')]=qs['limit'](_0x3efa16[_0x8023('0x34')][_0x8023('0x24')]);_0x4adbe0[_0x8023('0x26')]=qs[_0x8023('0x26')](_0x3efa16[_0x8023('0x34')][_0x8023('0x26')]);}_0x4adbe0['order']=qs['sort'](_0x3efa16['query'][_0x8023('0x3c')]);_0x4adbe0[_0x8023('0x3d')]=qs[_0x8023('0x36')](_[_0x8023('0x3e')](_0x3efa16[_0x8023('0x34')],_0x2336f7['filters']),_0x4d4add);if(_0x3efa16[_0x8023('0x34')][_0x8023('0x3f')]){_0x4adbe0[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x4adbe0[_0x8023('0x3d')],{'$or':_[_0x8023('0x2e')](_0x4d4add,function(_0xd6271a){if(_0xd6271a[_0x8023('0x32')]!==_0x8023('0x41')){var _0x274128={};_0x274128[_0xd6271a[_0x8023('0x2c')]]={'$like':'%'+_0x3efa16[_0x8023('0x34')]['filter']+'%'};return _0x274128;}})});}_0x4adbe0=_[_0x8023('0x40')]({},_0x4adbe0,_0x3efa16[_0x8023('0x42')]);var _0x1e348d={'where':_0x4adbe0[_0x8023('0x3d')]};return db['ChatGroup'][_0x8023('0x25')](_0x1e348d)[_0x8023('0x29')](function(_0x25c190){_0x41b848[_0x8023('0x25')]=_0x25c190;if(_0x3efa16[_0x8023('0x34')]['includeAll']){_0x4adbe0['include']=[{'all':!![]}];}return db[_0x8023('0x2f')][_0x8023('0x43')](_0x4adbe0);})[_0x8023('0x29')](function(_0x557aa8){_0x41b848[_0x8023('0x44')]=_0x557aa8;return _0x41b848;})[_0x8023('0x29')](respondWithFilteredResult(_0x5c7083,_0x4adbe0))[_0x8023('0x45')](handleError(_0x5c7083,null));};exports[_0x8023('0x46')]=function(_0x238dd5,_0x3b7606){var _0x3f134d={'raw':!![],'where':{'id':_0x238dd5[_0x8023('0x47')]['id']}},_0x37bdcf={};_0x37bdcf[_0x8023('0x33')]=_[_0x8023('0x35')](db[_0x8023('0x2f')][_0x8023('0x30')]);_0x37bdcf[_0x8023('0x34')]=_[_0x8023('0x35')](_0x238dd5[_0x8023('0x34')]);_0x37bdcf[_0x8023('0x36')]=_['intersection'](_0x37bdcf[_0x8023('0x33')],_0x37bdcf[_0x8023('0x34')]);_0x3f134d[_0x8023('0x38')]=_[_0x8023('0x37')](_0x37bdcf[_0x8023('0x33')],qs['fields'](_0x238dd5[_0x8023('0x34')][_0x8023('0x39')]));_0x3f134d[_0x8023('0x38')]=_0x3f134d[_0x8023('0x38')][_0x8023('0x48')]?_0x3f134d[_0x8023('0x38')]:_0x37bdcf['model'];if(_0x238dd5['query'][_0x8023('0x49')]){_0x3f134d[_0x8023('0x4a')]=[{'all':!![]}];}_0x3f134d=_[_0x8023('0x40')]({},_0x3f134d,_0x238dd5['options']);return db[_0x8023('0x2f')][_0x8023('0x4b')](_0x3f134d)['then'](handleEntityNotFound(_0x3b7606,null))[_0x8023('0x29')](respondWithResult(_0x3b7606,null))[_0x8023('0x45')](handleError(_0x3b7606,null));};exports[_0x8023('0x4c')]=function(_0x4122eb,_0x3a2a7f){return db[_0x8023('0x2f')][_0x8023('0x4c')](_0x4122eb[_0x8023('0x4d')],{})[_0x8023('0x29')](respondWithResult(_0x3a2a7f,0xc9))['catch'](handleError(_0x3a2a7f,null));};exports[_0x8023('0x4e')]=function(_0x5bb5c2,_0x22e56c){if(_0x5bb5c2[_0x8023('0x4d')]['id']){delete _0x5bb5c2[_0x8023('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5bb5c2[_0x8023('0x47')]['id']}})[_0x8023('0x29')](handleEntityNotFound(_0x22e56c,null))[_0x8023('0x29')](saveUpdates(_0x5bb5c2[_0x8023('0x4d')],null))['then'](respondWithResult(_0x22e56c,null))[_0x8023('0x45')](handleError(_0x22e56c,null));};exports[_0x8023('0x2a')]=function(_0x16780e,_0x2f597e){return db[_0x8023('0x2f')]['find']({'where':{'id':_0x16780e['params']['id']}})[_0x8023('0x29')](handleEntityNotFound(_0x2f597e,null))[_0x8023('0x29')](removeEntity(_0x2f597e,null))[_0x8023('0x45')](handleError(_0x2f597e,null));};exports[_0x8023('0x4f')]=function(_0x1b109c,_0x4ef88a){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x4ef88a,null))['catch'](handleError(_0x4ef88a,null));};exports[_0x8023('0x50')]=function(_0x452812,_0xdfc677,_0x446b97){return db[_0x8023('0x51')][_0x8023('0x25')]({'where':{'ChatGroupId':_0x452812[_0x8023('0x47')]['id'],'ToId':_0x452812[_0x8023('0x52')]['id'],'read':![]}})[_0x8023('0x29')](function(_0x258b5a){return{'id':_[_0x8023('0x53')](_0x452812[_0x8023('0x47')]['id']),'count':_0x258b5a};})[_0x8023('0x29')](respondWithResult(_0xdfc677,null))[_0x8023('0x45')](handleError(_0xdfc677,null));};exports[_0x8023('0x54')]=function(_0x592309,_0x2df840,_0xcc5049){return db[_0x8023('0x2f')][_0x8023('0x4b')]({'where':{'id':_0x592309['params']['id']}})['then'](handleEntityNotFound(_0x2df840,null))[_0x8023('0x29')](function(_0x1f161b){if(_0x1f161b){return _0x1f161b[_0x8023('0x54')](_0x592309[_0x8023('0x4d')][_0x8023('0x55')],_['omit'](_0x592309['body'],[_0x8023('0x55'),'id'])||{});}})[_0x8023('0x29')](respondWithResult(_0x2df840,null))[_0x8023('0x45')](handleError(_0x2df840,null));};exports[_0x8023('0x56')]=function(_0x29f2ab,_0x272bcd,_0x1156f5){var _0x249cb7={};var _0x19e36c={};var _0xb9bc15;var _0x563411;return db[_0x8023('0x2f')][_0x8023('0x57')]({'where':{'id':_0x29f2ab[_0x8023('0x47')]['id']}})[_0x8023('0x29')](handleEntityNotFound(_0x272bcd,null))[_0x8023('0x29')](function(_0x1216a5){if(_0x1216a5){_0xb9bc15=_0x1216a5;_0x19e36c[_0x8023('0x33')]=_['keys'](db[_0x8023('0x58')][_0x8023('0x30')]);_0x19e36c[_0x8023('0x34')]=_[_0x8023('0x35')](_0x29f2ab['query']);_0x19e36c[_0x8023('0x36')]=_[_0x8023('0x37')](_0x19e36c['model'],_0x19e36c['query']);_0x249cb7[_0x8023('0x38')]=_[_0x8023('0x37')](_0x19e36c[_0x8023('0x33')],qs[_0x8023('0x39')](_0x29f2ab[_0x8023('0x34')][_0x8023('0x39')]));_0x249cb7['attributes']=_0x249cb7[_0x8023('0x38')][_0x8023('0x48')]?_0x249cb7[_0x8023('0x38')]:_0x19e36c[_0x8023('0x33')];_0x249cb7[_0x8023('0x59')]=qs['sort'](_0x29f2ab['query']['sort']);_0x249cb7[_0x8023('0x3d')]=qs['filters'](_[_0x8023('0x3e')](_0x29f2ab[_0x8023('0x34')],_0x19e36c['filters']));if(_0x29f2ab['query'][_0x8023('0x3f')]){_0x249cb7[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x249cb7['where'],{'$or':_[_0x8023('0x2e')](_0x249cb7[_0x8023('0x38')],function(_0x5d9c40){var _0x298435={};_0x298435[_0x5d9c40]={'$like':'%'+_0x29f2ab[_0x8023('0x34')][_0x8023('0x3f')]+'%'};return _0x298435;})});}_0x249cb7=_[_0x8023('0x40')]({},_0x249cb7,_0x29f2ab['options']);return _0xb9bc15[_0x8023('0x56')](_0x249cb7);}})[_0x8023('0x29')](function(_0x4fc690){if(_0x4fc690){_0x563411=_0x4fc690[_0x8023('0x48')];if(!_0x29f2ab[_0x8023('0x34')]['hasOwnProperty']('nolimit')){_0x249cb7['limit']=qs[_0x8023('0x24')](_0x29f2ab['query'][_0x8023('0x24')]);_0x249cb7['offset']=qs[_0x8023('0x26')](_0x29f2ab[_0x8023('0x34')][_0x8023('0x26')]);}return _0xb9bc15[_0x8023('0x56')](_0x249cb7);}})[_0x8023('0x29')](function(_0x63f0d1){if(_0x63f0d1){return _0x63f0d1?{'count':_0x563411,'rows':_0x63f0d1}:null;}})[_0x8023('0x29')](respondWithResult(_0x272bcd,null))['catch'](handleError(_0x272bcd,null));};exports[_0x8023('0x5a')]=function(_0x45b315,_0x1e073f,_0x4c6d05){return db[_0x8023('0x2f')][_0x8023('0x4b')]({'where':{'id':_0x45b315[_0x8023('0x47')]['id']}})[_0x8023('0x29')](handleEntityNotFound(_0x1e073f,null))['then'](function(_0x512906){if(_0x512906){return _0x512906[_0x8023('0x5a')](_0x45b315[_0x8023('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x1e073f,null))[_0x8023('0x45')](handleError(_0x1e073f,null));};exports[_0x8023('0x5b')]=function(_0x4684ac,_0x134e5f,_0x585004){if(_0x4684ac[_0x8023('0x4d')]['id']){delete _0x4684ac['body']['id'];}return db[_0x8023('0x2f')][_0x8023('0x4b')]({'where':{'id':_0x4684ac[_0x8023('0x47')]['id']}})[_0x8023('0x29')](handleEntityNotFound(_0x134e5f,null))[_0x8023('0x29')](function(_0x48d77c){if(_0x48d77c){_0x4684ac[_0x8023('0x4d')][_0x8023('0x5c')]=_0x48d77c['id'];return db['ChatInternalMessage'][_0x8023('0x4c')](_0x4684ac[_0x8023('0x4d')]);}})[_0x8023('0x29')](respondWithResult(_0x134e5f,null))['catch'](handleError(_0x134e5f,null));};exports[_0x8023('0x5d')]=function(_0x11f1c9,_0x2fbd14,_0x44b87e){var _0x167b5e={};var _0x4152b5={};var _0x4e2f61;var _0x428b1d;return db[_0x8023('0x2f')][_0x8023('0x57')]({'where':{'id':_0x11f1c9[_0x8023('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fbd14,null))[_0x8023('0x29')](function(_0x526a0a){if(_0x526a0a){_0x4e2f61=_0x526a0a;_0x4152b5[_0x8023('0x33')]=_[_0x8023('0x35')](db[_0x8023('0x51')][_0x8023('0x30')]);_0x4152b5[_0x8023('0x34')]=_[_0x8023('0x35')](_0x11f1c9['query']);_0x4152b5['filters']=_['intersection'](_0x4152b5['model'],_0x4152b5['query']);_0x167b5e[_0x8023('0x38')]=_[_0x8023('0x37')](_0x4152b5[_0x8023('0x33')],qs[_0x8023('0x39')](_0x11f1c9[_0x8023('0x34')][_0x8023('0x39')]));_0x167b5e[_0x8023('0x38')]=_0x167b5e[_0x8023('0x38')][_0x8023('0x48')]?_0x167b5e[_0x8023('0x38')]:_0x4152b5[_0x8023('0x33')];_0x167b5e[_0x8023('0x59')]=qs[_0x8023('0x3c')](_0x11f1c9[_0x8023('0x34')][_0x8023('0x3c')]);_0x167b5e[_0x8023('0x3d')]=qs[_0x8023('0x36')](_[_0x8023('0x3e')](_0x11f1c9['query'],_0x4152b5['filters']));if(_0x11f1c9['query']['filter']){_0x167b5e[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x167b5e[_0x8023('0x3d')],{'$or':_['map'](_0x167b5e['attributes'],function(_0xe5feb2){var _0x2da50c={};_0x2da50c[_0xe5feb2]={'$like':'%'+_0x11f1c9[_0x8023('0x34')][_0x8023('0x3f')]+'%'};return _0x2da50c;})});}if(_0x11f1c9[_0x8023('0x34')][_0x8023('0x5e')]){var _0x5b1d18=_0x11f1c9['query'][_0x8023('0x5e')][_0x8023('0x5f')](',');var _0x301e93={};_0x301e93[_0x5b1d18[0x0]]={'$gte':moment(_0x5b1d18[0x1])[_0x8023('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x167b5e[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x167b5e[_0x8023('0x3d')],_0x301e93);}_0x167b5e=_[_0x8023('0x40')]({},_0x167b5e,_0x11f1c9[_0x8023('0x42')]);return _0x4e2f61['getMessages'](_0x167b5e);}})[_0x8023('0x29')](function(_0x7dc1db){if(_0x7dc1db){_0x428b1d=_0x7dc1db['length'];if(!_0x11f1c9[_0x8023('0x34')]['hasOwnProperty'](_0x8023('0x3b'))){_0x167b5e[_0x8023('0x24')]=qs[_0x8023('0x24')](_0x11f1c9[_0x8023('0x34')]['limit']);_0x167b5e[_0x8023('0x26')]=qs[_0x8023('0x26')](_0x11f1c9['query'][_0x8023('0x26')]);}return _0x4e2f61['getMessages'](_0x167b5e);}})['then'](function(_0x2b2066){if(_0x2b2066){return _0x2b2066?{'count':_0x428b1d,'rows':_0x2b2066}:null;}})[_0x8023('0x29')](respondWithResult(_0x2fbd14,null))[_0x8023('0x45')](handleError(_0x2fbd14,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3291365..ae565ea 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 _0x0137=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x0137,0x1d8));var _0x7013=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0x0137[_0x5f150e];return _0x2f6957;};'use strict';var EventEmitter=require(_0x7013('0x0'));var ChatGroup=require(_0x7013('0x1'))['db'][_0x7013('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7013('0x3')](0x0);var events={'afterCreate':_0x7013('0x4'),'afterUpdate':'update','afterDestroy':_0x7013('0x5')};function emitEvent(_0x23a553){return function(_0x1d35c3,_0x72e6a9,_0x17462b){ChatGroupEvents[_0x7013('0x6')](_0x23a553+':'+_0x1d35c3['id'],_0x1d35c3);ChatGroupEvents['emit'](_0x23a553,_0x1d35c3);_0x17462b(null);};}for(var e in events){if(events[_0x7013('0x7')](e)){var event=events[e];ChatGroup[_0x7013('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xadb5,0xad));var _0x5adb=function(_0x1661d9,_0x21defa){_0x1661d9=_0x1661d9-0x0;var _0x50f40e=_0xadb5[_0x1661d9];return _0x50f40e;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 6d64532..e098976 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 _0x97a0=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','lodash','../../config/logger'];(function(_0x517a86,_0x1b0466){var _0x5abb1c=function(_0x459bd9){while(--_0x459bd9){_0x517a86['push'](_0x517a86['shift']());}};_0x5abb1c(++_0x1b0466);}(_0x97a0,0xe5));var _0x097a=function(_0x557e6f,_0x1e1b95){_0x557e6f=_0x557e6f-0x0;var _0x257a88=_0x97a0[_0x557e6f];return _0x257a88;};'use strict';var _=require(_0x097a('0x0'));var util=require('util');var logger=require(_0x097a('0x1'))(_0x097a('0x2'));var moment=require(_0x097a('0x3'));var BPromise=require(_0x097a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x097a('0x5'));var rimraf=require(_0x097a('0x6'));var config=require(_0x097a('0x7'));var attributes=require(_0x097a('0x8'));module['exports']=function(_0x2a9b71,_0x251df2){return _0x2a9b71[_0x097a('0x9')](_0x097a('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2abb=['exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatGroup.attributes'];(function(_0x4a8c28,_0x2b0254){var _0x1ee153=function(_0xb8cf9e){while(--_0xb8cf9e){_0x4a8c28['push'](_0x4a8c28['shift']());}};_0x1ee153(++_0x2b0254);}(_0x2abb,0xe8));var _0xb2ab=function(_0x5c193e,_0x42e504){_0x5c193e=_0x5c193e-0x0;var _0x19d8ca=_0x2abb[_0x5c193e];return _0x19d8ca;};'use strict';var _=require(_0xb2ab('0x0'));var util=require(_0xb2ab('0x1'));var logger=require(_0xb2ab('0x2'))('api');var moment=require(_0xb2ab('0x3'));var BPromise=require('bluebird');var rp=require(_0xb2ab('0x4'));var fs=require('fs');var path=require(_0xb2ab('0x5'));var rimraf=require('rimraf');var config=require(_0xb2ab('0x6'));var attributes=require(_0xb2ab('0x7'));module[_0xb2ab('0x8')]=function(_0x91a6c2,_0x337458){return _0x91a6c2[_0xb2ab('0x9')](_0xb2ab('0xa'),attributes,{'tableName':_0xb2ab('0xb'),'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 2f1143f..cfb1845 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 _0xbdb0=['code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x276ee4,_0x8919fa){var _0x280651=function(_0x52b75b){while(--_0x52b75b){_0x276ee4['push'](_0x276ee4['shift']());}};_0x280651(++_0x8919fa);}(_0xbdb0,0x189));var _0x0bdb=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xbdb0[_0x3fb9dd];return _0x20136a;};'use strict';var _=require(_0x0bdb('0x0'));var util=require(_0x0bdb('0x1'));var moment=require(_0x0bdb('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bdb('0x3'));var fs=require('fs');var Redis=require(_0x0bdb('0x4'));var db=require(_0x0bdb('0x5'))['db'];var utils=require(_0x0bdb('0x6'));var logger=require(_0x0bdb('0x7'))('rpc');var config=require(_0x0bdb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bdb('0x9')]['http']({'port':0x232a});config[_0x0bdb('0xa')]=_[_0x0bdb('0xb')](config[_0x0bdb('0xa')],{'host':_0x0bdb('0xc'),'port':0x18eb});var socket=require(_0x0bdb('0xd'))(new Redis(config[_0x0bdb('0xa')]));require(_0x0bdb('0xe'))['register'](socket);function respondWithRpcPromise(_0x1bfd4e,_0x5f5a16,_0x4cd1fc){return new BPromise(function(_0x3306a5,_0x4a9579){return client['request'](_0x1bfd4e,_0x4cd1fc)[_0x0bdb('0xf')](function(_0x5d2077){logger['info'](_0x0bdb('0x10'),_0x5f5a16,_0x0bdb('0x11'));logger[_0x0bdb('0x12')](_0x0bdb('0x13'),_0x5f5a16,_0x0bdb('0x11'),JSON['stringify'](_0x5d2077));if(_0x5d2077[_0x0bdb('0x14')]){if(_0x5d2077[_0x0bdb('0x14')][_0x0bdb('0x15')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5f5a16,_0x5d2077['error'][_0x0bdb('0x16')]);return _0x4a9579(_0x5d2077[_0x0bdb('0x14')][_0x0bdb('0x16')]);}logger[_0x0bdb('0x14')](_0x0bdb('0x10'),_0x5f5a16,_0x5d2077[_0x0bdb('0x14')][_0x0bdb('0x16')]);return _0x3306a5(_0x5d2077[_0x0bdb('0x14')][_0x0bdb('0x16')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x5f5a16,_0x0bdb('0x11'));_0x3306a5(_0x5d2077['result']['message']);}})['catch'](function(_0x11924d){logger[_0x0bdb('0x14')](_0x0bdb('0x10'),_0x5f5a16,_0x11924d);_0x4a9579(_0x11924d);});});} \ No newline at end of file +var _0x2028=['code','message','request\x20sent','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2028,0x1e0));var _0x8202=function(_0x4ba422,_0x45471c){_0x4ba422=_0x4ba422-0x0;var _0x425f05=_0x2028[_0x4ba422];return _0x425f05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8202('0x0'));var BPromise=require('bluebird');var rs=require(_0x8202('0x1'));var fs=require('fs');var Redis=require(_0x8202('0x2'));var db=require(_0x8202('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8202('0x4'))('rpc');var config=require(_0x8202('0x5'));var jayson=require(_0x8202('0x6'));var client=jayson[_0x8202('0x7')][_0x8202('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8202('0x9')],{'host':_0x8202('0xa'),'port':0x18eb});var socket=require(_0x8202('0xb'))(new Redis(config[_0x8202('0x9')]));require('./chatGroup.socket')[_0x8202('0xc')](socket);function respondWithRpcPromise(_0x4393d9,_0x289918,_0xa9228a){return new BPromise(function(_0x49e6a7,_0x1c2336){return client['request'](_0x4393d9,_0xa9228a)[_0x8202('0xd')](function(_0x5e5b3c){logger[_0x8202('0xe')](_0x8202('0xf'),_0x289918,'request\x20sent');logger[_0x8202('0x10')](_0x8202('0x11'),_0x289918,'request\x20sent',JSON[_0x8202('0x12')](_0x5e5b3c));if(_0x5e5b3c[_0x8202('0x13')]){if(_0x5e5b3c['error'][_0x8202('0x14')]===0x1f4){logger[_0x8202('0x13')]('ChatGroup,\x20%s,\x20%s',_0x289918,_0x5e5b3c['error']['message']);return _0x1c2336(_0x5e5b3c['error'][_0x8202('0x15')]);}logger[_0x8202('0x13')](_0x8202('0xf'),_0x289918,_0x5e5b3c[_0x8202('0x13')][_0x8202('0x15')]);return _0x49e6a7(_0x5e5b3c[_0x8202('0x13')][_0x8202('0x15')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x289918,_0x8202('0x16'));_0x49e6a7(_0x5e5b3c[_0x8202('0x17')]['message']);}})[_0x8202('0x18')](function(_0x540127){logger[_0x8202('0x13')](_0x8202('0xf'),_0x289918,_0x540127);_0x1c2336(_0x540127);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 5487bd5..f212872 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 _0xd748=['./chatGroup.events','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0xd748,0x148));var _0x8d74=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0xd748[_0x403c8d];return _0x4ca60d;};'use strict';var ChatGroupEvents=require(_0x8d74('0x0'));var events=['save',_0x8d74('0x1'),_0x8d74('0x2')];function createListener(_0x306a6f,_0x494966){return function(_0x155b76){_0x494966[_0x8d74('0x3')](_0x306a6f,_0x155b76);};}function removeListener(_0x48a51a,_0x19fa58){return function(){ChatGroupEvents[_0x8d74('0x4')](_0x48a51a,_0x19fa58);};}exports[_0x8d74('0x5')]=function(_0x22e6e5){for(var _0x40a4c2=0x0,_0x2f4e8c=events[_0x8d74('0x6')];_0x40a4c2<_0x2f4e8c;_0x40a4c2++){var _0x44af97=events[_0x40a4c2];var _0x5f19b2=createListener(_0x8d74('0x7')+_0x44af97,_0x22e6e5);ChatGroupEvents['on'](_0x44af97,_0x5f19b2);}}; \ No newline at end of file +var _0x74d4=['save','remove','update','emit','register','length','chatGroup:'];(function(_0x2f5e5a,_0x305f19){var _0x283aa8=function(_0x15b17d){while(--_0x15b17d){_0x2f5e5a['push'](_0x2f5e5a['shift']());}};_0x283aa8(++_0x305f19);}(_0x74d4,0x173));var _0x474d=function(_0x43b44d,_0x1fc5d1){_0x43b44d=_0x43b44d-0x0;var _0x3dcd0f=_0x74d4[_0x43b44d];return _0x3dcd0f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x474d('0x0'),_0x474d('0x1'),_0x474d('0x2')];function createListener(_0x201a03,_0x5a1c68){return function(_0x3cd0eb){_0x5a1c68[_0x474d('0x3')](_0x201a03,_0x3cd0eb);};}function removeListener(_0x58f7f0,_0x1532c2){return function(){ChatGroupEvents['removeListener'](_0x58f7f0,_0x1532c2);};}exports[_0x474d('0x4')]=function(_0x2e4765){for(var _0x373543=0x0,_0x1ecf95=events[_0x474d('0x5')];_0x373543<_0x1ecf95;_0x373543++){var _0x360c85=events[_0x373543];var _0x3835fd=createListener(_0x474d('0x6')+_0x360c85,_0x2e4765);ChatGroupEvents['on'](_0x360c85,_0x3835fd);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 501ec17..05020f6 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 _0x5fa4=['/describe','/:id','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x5fa4,0x84));var _0x45fa=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x5fa4[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x45fa('0x0'));var util=require(_0x45fa('0x1'));var path=require(_0x45fa('0x2'));var timeout=require(_0x45fa('0x3'));var express=require('express');var router=express[_0x45fa('0x4')]();var fs_extra=require(_0x45fa('0x5'));var auth=require(_0x45fa('0x6'));var interaction=require(_0x45fa('0x7'));var config=require(_0x45fa('0x8'));var controller=require(_0x45fa('0x9'));router[_0x45fa('0xa')]('/',auth[_0x45fa('0xb')](),controller[_0x45fa('0xc')]);router[_0x45fa('0xa')](_0x45fa('0xd'),auth[_0x45fa('0xb')](),controller['describe']);router[_0x45fa('0xa')](_0x45fa('0xe'),auth[_0x45fa('0xb')](),controller['show']);router[_0x45fa('0xa')]('/:id/unread',auth['isAuthenticated'](),controller[_0x45fa('0xf')]);router[_0x45fa('0xa')]('/:id/members',auth[_0x45fa('0xb')](),controller[_0x45fa('0x10')]);router[_0x45fa('0xa')](_0x45fa('0x11'),auth['isAuthenticated'](),controller[_0x45fa('0x12')]);router[_0x45fa('0x13')]('/',auth[_0x45fa('0xb')](),controller[_0x45fa('0x14')]);router[_0x45fa('0x13')](_0x45fa('0x15'),auth[_0x45fa('0xb')](),controller[_0x45fa('0x16')]);router[_0x45fa('0x13')](_0x45fa('0x11'),auth[_0x45fa('0xb')](),controller[_0x45fa('0x17')]);router[_0x45fa('0x18')](_0x45fa('0xe'),auth[_0x45fa('0xb')](),controller[_0x45fa('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x45fa('0x1a')]);router[_0x45fa('0x1b')](_0x45fa('0x15'),auth[_0x45fa('0xb')](),controller[_0x45fa('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x74de=['getUnread','/:id/members','getMessages','post','create','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x425a69,_0x31a2a9){var _0x3043a0=function(_0xed6470){while(--_0xed6470){_0x425a69['push'](_0x425a69['shift']());}};_0x3043a0(++_0x31a2a9);}(_0x74de,0xdd));var _0xe74d=function(_0x3382f9,_0x2906d7){_0x3382f9=_0x3382f9-0x0;var _0x154d25=_0x74de[_0x3382f9];return _0x154d25;};'use strict';var multer=require(_0xe74d('0x0'));var util=require('util');var path=require(_0xe74d('0x1'));var timeout=require(_0xe74d('0x2'));var express=require(_0xe74d('0x3'));var router=express['Router']();var fs_extra=require(_0xe74d('0x4'));var auth=require(_0xe74d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe74d('0x6'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xe74d('0x7')](),controller[_0xe74d('0x8')]);router[_0xe74d('0x9')](_0xe74d('0xa'),auth[_0xe74d('0x7')](),controller[_0xe74d('0xb')]);router[_0xe74d('0x9')](_0xe74d('0xc'),auth[_0xe74d('0x7')](),controller['show']);router[_0xe74d('0x9')]('/:id/unread',auth[_0xe74d('0x7')](),controller[_0xe74d('0xd')]);router[_0xe74d('0x9')](_0xe74d('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xe74d('0x9')]('/:id/messages',auth[_0xe74d('0x7')](),controller[_0xe74d('0xf')]);router[_0xe74d('0x10')]('/',auth['isAuthenticated'](),controller[_0xe74d('0x11')]);router['post'](_0xe74d('0xe'),auth['isAuthenticated'](),controller[_0xe74d('0x12')]);router[_0xe74d('0x10')](_0xe74d('0x13'),auth['isAuthenticated'](),controller[_0xe74d('0x14')]);router[_0xe74d('0x15')](_0xe74d('0xc'),auth[_0xe74d('0x7')](),controller[_0xe74d('0x16')]);router[_0xe74d('0x17')](_0xe74d('0xc'),auth['isAuthenticated'](),controller[_0xe74d('0x18')]);router[_0xe74d('0x17')](_0xe74d('0xe'),auth['isAuthenticated'](),controller[_0xe74d('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 97a25b0..952393a 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 _0x61d0=['out','sequelize','BOOLEAN','INTEGER','star','TEXT','STRING','DATE','long','ENUM'];(function(_0x268864,_0x4adb95){var _0x44c72f=function(_0x10f02d){while(--_0x10f02d){_0x268864['push'](_0x268864['shift']());}};_0x44c72f(++_0x4adb95);}(_0x61d0,0x187));var _0x061d=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x61d0[_0x1eb585];return _0x497ee2;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x061d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x061d('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x061d('0x3'),'thumb'),'defaultValue':_0x061d('0x3')},'ratingMessage':{'type':Sequelize[_0x061d('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x061d('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x061d('0x6')]},'disposition':{'type':Sequelize[_0x061d('0x5')]},'secondDisposition':{'type':Sequelize[_0x061d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x061d('0x5')]},'note':{'type':Sequelize[_0x061d('0x5')]},'browserName':{'type':Sequelize[_0x061d('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x061d('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x061d('0x5')]},'referer':{'type':Sequelize[_0x061d('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x061d('0x4')](_0x061d('0x7'))},'read1stAt':{'type':Sequelize[_0x061d('0x6')]},'lastMsgAt':{'type':Sequelize[_0x061d('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x061d('0x8')]('in',_0x061d('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x061d('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x061d('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x061d('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c2c=['STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','thumb','star','TEXT','DATE'];(function(_0x3b9bc0,_0x1c48df){var _0x9eeb03=function(_0x7fb47d){while(--_0x7fb47d){_0x3b9bc0['push'](_0x3b9bc0['shift']());}};_0x9eeb03(++_0x1c48df);}(_0x3c2c,0x160));var _0xc3c2=function(_0x29ea35,_0x1733ca){_0x29ea35=_0x29ea35-0x0;var _0x3579e9=_0x3c2c[_0x29ea35];return _0x3579e9;};'use strict';var Sequelize=require(_0xc3c2('0x0'));module[_0xc3c2('0x1')]={'closed':{'type':Sequelize[_0xc3c2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc3c2('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xc3c2('0x4')),'defaultValue':_0xc3c2('0x5')},'ratingMessage':{'type':Sequelize[_0xc3c2('0x6')]},'pathTranscript':{'type':Sequelize[_0xc3c2('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc3c2('0x7')]},'disposition':{'type':Sequelize[_0xc3c2('0x8')]},'secondDisposition':{'type':Sequelize[_0xc3c2('0x8')]},'thirdDisposition':{'type':Sequelize[_0xc3c2('0x8')]},'note':{'type':Sequelize[_0xc3c2('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xc3c2('0x8')]},'deviceModel':{'type':Sequelize[_0xc3c2('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xc3c2('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc3c2('0x6')](_0xc3c2('0x9'))},'read1stAt':{'type':Sequelize[_0xc3c2('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc3c2('0xa')]('in',_0xc3c2('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc3c2('0x8')]},'customerPort':{'type':Sequelize[_0xc3c2('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xc3c2('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4db1540..8b5c42b 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 _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xa75338,_0x4f53fd){_0xa75338=_0xa75338-0x0;var _0x1c36c6=_0xd7d1[_0xa75338];return _0x1c36c6;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('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');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,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(_0x1ae1d4,_0x4fd065){var _0x3dd124=function(_0x3f47c5){while(--_0x3f47c5){_0x1ae1d4['push'](_0x1ae1d4['shift']());}};_0x3dd124(++_0x4fd065);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 459bc86..4d814f2 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 _0x8b6f=['ChatMessage','setMaxListeners','save','update','remove','getUsers','then','findAll','setDataValue','length','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3ba2f6,_0x13cdb9){var _0x5bf772=function(_0x301a3f){while(--_0x301a3f){_0x3ba2f6['push'](_0x3ba2f6['shift']());}};_0x5bf772(++_0x13cdb9);}(_0x8b6f,0xee));var _0xf8b6=function(_0x134de4,_0x49c839){_0x134de4=_0x134de4-0x0;var _0xe97f36=_0x8b6f[_0x134de4];return _0xe97f36;};'use strict';var EventEmitter=require(_0xf8b6('0x0'));var ChatInteraction=require(_0xf8b6('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xf8b6('0x1'))['db'][_0xf8b6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf8b6('0x3')](0x0);var events={'afterCreate':_0xf8b6('0x4'),'afterUpdate':_0xf8b6('0x5'),'afterDestroy':_0xf8b6('0x6')};function emitEvent(_0x4596fc){return function(_0x414f79,_0x210c3d,_0x59d559){_0x414f79[_0xf8b6('0x7')]({'attributes':['id'],'raw':!![]})[_0xf8b6('0x8')](function(_0x51d8d8){_0x414f79['setDataValue']('Users',_0x51d8d8['map'](function(_0x556695){return{'id':_0x556695['id']};}));return ChatMessage[_0xf8b6('0x9')]({'where':{'ChatInteractionId':_0x414f79['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8b6('0x8')](function(_0x2ff713){_0x414f79[_0xf8b6('0xa')]('unreadMessages',_0x2ff713[_0xf8b6('0xb')]);ChatInteractionEvents[_0xf8b6('0xc')](_0x4596fc+':'+_0x414f79['id'],_0x414f79);ChatInteractionEvents[_0xf8b6('0xc')](_0x4596fc,_0x414f79);_0x59d559(null);})['catch'](_0x59d559(null));};}for(var e in events){if(events[_0xf8b6('0xd')](e)){var event=events[e];ChatInteraction[_0xf8b6('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xeb46=['setDataValue','Users','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','save','remove','getUsers','then'];(function(_0x6b23f3,_0x4189c9){var _0x473e8f=function(_0x2112c2){while(--_0x2112c2){_0x6b23f3['push'](_0x6b23f3['shift']());}};_0x473e8f(++_0x4189c9);}(_0xeb46,0x103));var _0x6eb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb46[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6eb4('0x0'));var ChatInteraction=require(_0x6eb4('0x1'))['db'][_0x6eb4('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6eb4('0x3'),'afterUpdate':'update','afterDestroy':_0x6eb4('0x4')};function emitEvent(_0x52b3fe){return function(_0x283e28,_0xc050f1,_0x483183){_0x283e28[_0x6eb4('0x5')]({'attributes':['id'],'raw':!![]})[_0x6eb4('0x6')](function(_0x44fe6e){_0x283e28[_0x6eb4('0x7')](_0x6eb4('0x8'),_0x44fe6e['map'](function(_0x21f310){return{'id':_0x21f310['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x283e28['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6eb4('0x6')](function(_0x29e189){_0x283e28[_0x6eb4('0x7')](_0x6eb4('0x9'),_0x29e189['length']);ChatInteractionEvents[_0x6eb4('0xa')](_0x52b3fe+':'+_0x283e28['id'],_0x283e28);ChatInteractionEvents[_0x6eb4('0xa')](_0x52b3fe,_0x283e28);_0x483183(null);})[_0x6eb4('0xb')](_0x483183(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x6eb4('0xc')](e,emitEvent(event));}}module[_0x6eb4('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index fad1b91..82c0ddd 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 _0x6696=['bluebird','request-promise','path','../../config/environment','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3b3274,_0xfd4af3){var _0xa423e9=function(_0xa6d6cb){while(--_0xa6d6cb){_0x3b3274['push'](_0x3b3274['shift']());}};_0xa423e9(++_0xfd4af3);}(_0x6696,0x177));var _0x6669=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x6696[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0x6669('0x0'));var util=require(_0x6669('0x1'));var logger=require(_0x6669('0x2'))(_0x6669('0x3'));var moment=require(_0x6669('0x4'));var BPromise=require(_0x6669('0x5'));var rp=require(_0x6669('0x6'));var fs=require('fs');var path=require(_0x6669('0x7'));var rimraf=require('rimraf');var config=require(_0x6669('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x6669('0x9')]=function(_0x18a83b,_0x3f660f){return _0x18a83b[_0x6669('0xa')]('ChatInteraction',attributes,{'tableName':_0x6669('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38b3d5,_0x3b3f83,_0x3b11b8){if(_0x38b3d5[_0x6669('0xc')](_0x6669('0xd'))){_0x38b3d5[_0x6669('0xe')]=moment()[_0x6669('0xf')](_0x6669('0x10'));}_0x3b11b8(null,_0x38b3d5);}},'charset':_0x6669('0x11'),'collate':_0x6669('0x12')});}; \ No newline at end of file +var _0xd416=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x343eba,_0x17c4d7){var _0x25770b=function(_0x116abc){while(--_0x116abc){_0x343eba['push'](_0x343eba['shift']());}};_0x25770b(++_0x17c4d7);}(_0xd416,0xb3));var _0x6d41=function(_0xd3972c,_0x22caee){_0xd3972c=_0xd3972c-0x0;var _0x44e843=_0xd416[_0xd3972c];return _0x44e843;};'use strict';var _=require('lodash');var util=require(_0x6d41('0x0'));var logger=require(_0x6d41('0x1'))(_0x6d41('0x2'));var moment=require(_0x6d41('0x3'));var BPromise=require(_0x6d41('0x4'));var rp=require(_0x6d41('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d41('0x6'));var config=require(_0x6d41('0x7'));var attributes=require(_0x6d41('0x8'));module[_0x6d41('0x9')]=function(_0xbcc47,_0x430237){return _0xbcc47[_0x6d41('0xa')](_0x6d41('0xb'),attributes,{'tableName':_0x6d41('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5244eb,_0x43b154,_0x4e7869){if(_0x5244eb['changed']('closed')){_0x5244eb['closedAt']=moment()[_0x6d41('0xd')](_0x6d41('0xe'));}_0x4e7869(null,_0x5244eb);}},'charset':_0x6d41('0xf'),'collate':_0x6d41('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7b3b040..3e1d214 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 _0x2ec3=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','debug','catch','find','ids','omit','spread','AddTags'];(function(_0x3d893e,_0x301997){var _0x125751=function(_0xbf6784){while(--_0xbf6784){_0x3d893e['push'](_0x3d893e['shift']());}};_0x125751(++_0x301997);}(_0x2ec3,0x1ce));var _0x32ec=function(_0x4b7e56,_0x1ae9ff){_0x4b7e56=_0x4b7e56-0x0;var _0xbf4881=_0x2ec3[_0x4b7e56];return _0xbf4881;};'use strict';var _=require('lodash');var util=require(_0x32ec('0x0'));var moment=require(_0x32ec('0x1'));var BPromise=require(_0x32ec('0x2'));var rs=require(_0x32ec('0x3'));var fs=require('fs');var Redis=require(_0x32ec('0x4'));var db=require(_0x32ec('0x5'))['db'];var utils=require(_0x32ec('0x6'));var logger=require(_0x32ec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32ec('0x8'));var client=jayson[_0x32ec('0x9')][_0x32ec('0xa')]({'port':0x232a});config[_0x32ec('0xb')]=_[_0x32ec('0xc')](config[_0x32ec('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x32ec('0xd'))(new Redis(config[_0x32ec('0xb')]));require(_0x32ec('0xe'))[_0x32ec('0xf')](socket);function respondWithRpcPromise(_0x1d718d,_0x26002c,_0x4c7329){return new BPromise(function(_0x1e4275,_0x8cb91e){return client['request'](_0x1d718d,_0x4c7329)[_0x32ec('0x10')](function(_0x42de4f){logger[_0x32ec('0x11')](_0x32ec('0x12'),_0x26002c,_0x32ec('0x13'));logger['debug'](_0x32ec('0x14'),_0x26002c,_0x32ec('0x13'),JSON[_0x32ec('0x15')](_0x42de4f));if(_0x42de4f[_0x32ec('0x16')]){if(_0x42de4f[_0x32ec('0x16')][_0x32ec('0x17')]===0x1f4){logger[_0x32ec('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x26002c,_0x42de4f[_0x32ec('0x16')]['message']);return _0x8cb91e(_0x42de4f[_0x32ec('0x16')][_0x32ec('0x18')]);}logger[_0x32ec('0x16')](_0x32ec('0x12'),_0x26002c,_0x42de4f[_0x32ec('0x16')][_0x32ec('0x18')]);return _0x1e4275(_0x42de4f['error'][_0x32ec('0x18')]);}else{logger[_0x32ec('0x11')](_0x32ec('0x12'),_0x26002c,_0x32ec('0x13'));_0x1e4275(_0x42de4f[_0x32ec('0x19')][_0x32ec('0x18')]);}})['catch'](function(_0x35d957){logger[_0x32ec('0x16')](_0x32ec('0x12'),_0x26002c,_0x35d957);_0x8cb91e(_0x35d957);});});}exports['UpdateChatInteraction']=function(_0x1e8079){var _0x1c8d61=this;return new Promise(function(_0x1b3c79,_0x2541a0){return db[_0x32ec('0x1a')][_0x32ec('0x1b')](_0x1e8079[_0x32ec('0x1c')],{'raw':_0x1e8079[_0x32ec('0x1d')]?_0x1e8079[_0x32ec('0x1d')][_0x32ec('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8079['options']?_0x1e8079[_0x32ec('0x1d')][_0x32ec('0x1f')]||null:null,'attributes':_0x1e8079[_0x32ec('0x1d')]?_0x1e8079[_0x32ec('0x1d')][_0x32ec('0x20')]||null:null,'limit':_0x1e8079[_0x32ec('0x1d')]?_0x1e8079['options'][_0x32ec('0x21')]||null:null})['then'](function(_0x1518b6){logger[_0x32ec('0x11')](_0x32ec('0x22'),_0x1e8079);logger[_0x32ec('0x23')]('UpdateChatInteraction',_0x1e8079,JSON[_0x32ec('0x15')](_0x1518b6));_0x1b3c79(_0x1518b6);})[_0x32ec('0x24')](function(_0x514de6){logger[_0x32ec('0x16')](_0x32ec('0x22'),_0x514de6[_0x32ec('0x18')],_0x1e8079);_0x2541a0(_0x1c8d61[_0x32ec('0x16')](0x1f4,_0x514de6[_0x32ec('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x26d60f){return new Promise(function(_0x45ceeb,_0x13718d){return db[_0x32ec('0x1a')][_0x32ec('0x25')]({'where':_0x26d60f[_0x32ec('0x1d')]?_0x26d60f[_0x32ec('0x1d')][_0x32ec('0x1f')]||null:null})[_0x32ec('0x10')](function(_0x10430f){if(_0x10430f){return _0x10430f['addTags'](_0x26d60f[_0x32ec('0x1c')][_0x32ec('0x26')],_[_0x32ec('0x27')](_0x26d60f['body'],[_0x32ec('0x26'),'id'])||{});}})[_0x32ec('0x28')](function(_0x48b816){logger[_0x32ec('0x11')](_0x32ec('0x29'),_0x26d60f);logger[_0x32ec('0x23')](_0x32ec('0x29'),_0x26d60f,JSON[_0x32ec('0x15')](_0x48b816));_0x45ceeb(_0x48b816);})['catch'](function(_0x50de1f){logger[_0x32ec('0x16')](_0x32ec('0x29'),_0x50de1f[_0x32ec('0x18')],_0x26d60f);_0x13718d(_this[_0x32ec('0x16')](0x1f4,_0x50de1f['message']));});});}; \ No newline at end of file +var _0x9c5d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','lodash'];(function(_0x342619,_0x45bf61){var _0x629eda=function(_0x7d7f51){while(--_0x7d7f51){_0x342619['push'](_0x342619['shift']());}};_0x629eda(++_0x45bf61);}(_0x9c5d,0x107));var _0xd9c5=function(_0x52469e,_0x3579c2){_0x52469e=_0x52469e-0x0;var _0x2e6692=_0x9c5d[_0x52469e];return _0x2e6692;};'use strict';var _=require(_0xd9c5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd9c5('0x1'));var rs=require(_0xd9c5('0x2'));var fs=require('fs');var Redis=require(_0xd9c5('0x3'));var db=require(_0xd9c5('0x4'))['db'];var utils=require(_0xd9c5('0x5'));var logger=require(_0xd9c5('0x6'))(_0xd9c5('0x7'));var config=require(_0xd9c5('0x8'));var jayson=require(_0xd9c5('0x9'));var client=jayson['client'][_0xd9c5('0xa')]({'port':0x232a});config[_0xd9c5('0xb')]=_[_0xd9c5('0xc')](config[_0xd9c5('0xb')],{'host':_0xd9c5('0xd'),'port':0x18eb});var socket=require(_0xd9c5('0xe'))(new Redis(config[_0xd9c5('0xb')]));require(_0xd9c5('0xf'))[_0xd9c5('0x10')](socket);function respondWithRpcPromise(_0x3f7e66,_0x51c4c9,_0x2325d0){return new BPromise(function(_0x4304aa,_0x50b24b){return client[_0xd9c5('0x11')](_0x3f7e66,_0x2325d0)[_0xd9c5('0x12')](function(_0xafff7){logger['info'](_0xd9c5('0x13'),_0x51c4c9,_0xd9c5('0x14'));logger[_0xd9c5('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x51c4c9,_0xd9c5('0x14'),JSON[_0xd9c5('0x16')](_0xafff7));if(_0xafff7[_0xd9c5('0x17')]){if(_0xafff7[_0xd9c5('0x17')][_0xd9c5('0x18')]===0x1f4){logger[_0xd9c5('0x17')](_0xd9c5('0x13'),_0x51c4c9,_0xafff7[_0xd9c5('0x17')][_0xd9c5('0x19')]);return _0x50b24b(_0xafff7[_0xd9c5('0x17')][_0xd9c5('0x19')]);}logger[_0xd9c5('0x17')](_0xd9c5('0x13'),_0x51c4c9,_0xafff7[_0xd9c5('0x17')][_0xd9c5('0x19')]);return _0x4304aa(_0xafff7[_0xd9c5('0x17')][_0xd9c5('0x19')]);}else{logger[_0xd9c5('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x51c4c9,_0xd9c5('0x14'));_0x4304aa(_0xafff7[_0xd9c5('0x1b')][_0xd9c5('0x19')]);}})['catch'](function(_0x131ca3){logger[_0xd9c5('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x51c4c9,_0x131ca3);_0x50b24b(_0x131ca3);});});}exports[_0xd9c5('0x1c')]=function(_0x4c12d1){var _0x44aa91=this;return new Promise(function(_0x6bfb1a,_0x1cc72d){return db[_0xd9c5('0x1d')][_0xd9c5('0x1e')](_0x4c12d1[_0xd9c5('0x1f')],{'raw':_0x4c12d1[_0xd9c5('0x20')]?_0x4c12d1[_0xd9c5('0x20')][_0xd9c5('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c12d1[_0xd9c5('0x20')]?_0x4c12d1[_0xd9c5('0x20')][_0xd9c5('0x22')]||null:null,'attributes':_0x4c12d1[_0xd9c5('0x20')]?_0x4c12d1['options'][_0xd9c5('0x23')]||null:null,'limit':_0x4c12d1[_0xd9c5('0x20')]?_0x4c12d1['options'][_0xd9c5('0x24')]||null:null})[_0xd9c5('0x12')](function(_0x3287d0){logger[_0xd9c5('0x1a')](_0xd9c5('0x1c'),_0x4c12d1);logger[_0xd9c5('0x15')](_0xd9c5('0x1c'),_0x4c12d1,JSON[_0xd9c5('0x16')](_0x3287d0));_0x6bfb1a(_0x3287d0);})[_0xd9c5('0x25')](function(_0x1db0cf){logger[_0xd9c5('0x17')](_0xd9c5('0x1c'),_0x1db0cf[_0xd9c5('0x19')],_0x4c12d1);_0x1cc72d(_0x44aa91['error'](0x1f4,_0x1db0cf[_0xd9c5('0x19')]));});});};exports[_0xd9c5('0x26')]=function(_0x22a3fd){return new Promise(function(_0x4bcfa1,_0xe701d7){return db[_0xd9c5('0x1d')][_0xd9c5('0x27')]({'where':_0x22a3fd[_0xd9c5('0x20')]?_0x22a3fd[_0xd9c5('0x20')][_0xd9c5('0x22')]||null:null})['then'](function(_0x39a827){if(_0x39a827){return _0x39a827[_0xd9c5('0x28')](_0x22a3fd[_0xd9c5('0x1f')][_0xd9c5('0x29')],_[_0xd9c5('0x2a')](_0x22a3fd[_0xd9c5('0x1f')],[_0xd9c5('0x29'),'id'])||{});}})[_0xd9c5('0x2b')](function(_0x145f65){logger[_0xd9c5('0x1a')]('AddTags',_0x22a3fd);logger[_0xd9c5('0x15')]('AddTags',_0x22a3fd,JSON['stringify'](_0x145f65));_0x4bcfa1(_0x145f65);})[_0xd9c5('0x25')](function(_0x11a3cf){logger[_0xd9c5('0x17')]('AddTags',_0x11a3cf[_0xd9c5('0x19')],_0x22a3fd);_0xe701d7(_this[_0xd9c5('0x17')](0x1f4,_0x11a3cf['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a1b0fdf..e226f87 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 _0xf76f=['emit','removeListener','length','./chatInteraction.events','remove','update'];(function(_0x4b7af3,_0x30b25a){var _0x7722ee=function(_0x1bf296){while(--_0x1bf296){_0x4b7af3['push'](_0x4b7af3['shift']());}};_0x7722ee(++_0x30b25a);}(_0xf76f,0x19b));var _0xff76=function(_0x2fe5f0,_0x3a5878){_0x2fe5f0=_0x2fe5f0-0x0;var _0x5180da=_0xf76f[_0x2fe5f0];return _0x5180da;};'use strict';var ChatInteractionEvents=require(_0xff76('0x0'));var events=['save',_0xff76('0x1'),_0xff76('0x2')];function createListener(_0x25e3a9,_0x46d014){return function(_0x229a2f){_0x46d014[_0xff76('0x3')](_0x25e3a9,_0x229a2f);};}function removeListener(_0x3d22ba,_0x171321){return function(){ChatInteractionEvents[_0xff76('0x4')](_0x3d22ba,_0x171321);};}exports['register']=function(_0x5959c8){for(var _0x21b58e=0x0,_0x2be8d7=events[_0xff76('0x5')];_0x21b58e<_0x2be8d7;_0x21b58e++){var _0x4fb7ec=events[_0x21b58e];var _0x4a3a39=createListener('chatInteraction:'+_0x4fb7ec,_0x5959c8);ChatInteractionEvents['on'](_0x4fb7ec,_0x4a3a39);}}; \ No newline at end of file +var _0x9f13=['save','remove','update','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x36d6d5,_0xa446a9){var _0x297f78=function(_0xf29ac3){while(--_0xf29ac3){_0x36d6d5['push'](_0x36d6d5['shift']());}};_0x297f78(++_0xa446a9);}(_0x9f13,0xfb));var _0x39f1=function(_0x457759,_0x4fb33a){_0x457759=_0x457759-0x0;var _0xc50bc9=_0x9f13[_0x457759];return _0xc50bc9;};'use strict';var ChatInteractionEvents=require(_0x39f1('0x0'));var events=[_0x39f1('0x1'),_0x39f1('0x2'),_0x39f1('0x3')];function createListener(_0x3aa4b0,_0x1edbfa){return function(_0x5496fe){_0x1edbfa['emit'](_0x3aa4b0,_0x5496fe);};}function removeListener(_0x55fb53,_0x38937e){return function(){ChatInteractionEvents['removeListener'](_0x55fb53,_0x38937e);};}exports[_0x39f1('0x4')]=function(_0x362c8b){for(var _0x304c78=0x0,_0x2e77c0=events[_0x39f1('0x5')];_0x304c78<_0x2e77c0;_0x304c78++){var _0xee9604=events[_0x304c78];var _0x4419c4=createListener(_0x39f1('0x6')+_0xee9604,_0x362c8b);ChatInteractionEvents['on'](_0xee9604,_0x4419c4);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4fd9eeb..a6cf701 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 _0x1a8f=['index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','chat','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated'];(function(_0x50a1f6,_0x238fd8){var _0x84f8d4=function(_0x2d9586){while(--_0x2d9586){_0x50a1f6['push'](_0x50a1f6['shift']());}};_0x84f8d4(++_0x238fd8);}(_0x1a8f,0xa5));var _0xf1a8=function(_0x558cf5,_0x3caae2){_0x558cf5=_0x558cf5-0x0;var _0x45f531=_0x1a8f[_0x558cf5];return _0x45f531;};'use strict';var multer=require(_0xf1a8('0x0'));var util=require(_0xf1a8('0x1'));var path=require(_0xf1a8('0x2'));var timeout=require(_0xf1a8('0x3'));var express=require(_0xf1a8('0x4'));var router=express[_0xf1a8('0x5')]();var fs_extra=require(_0xf1a8('0x6'));var auth=require(_0xf1a8('0x7'));var interaction=require(_0xf1a8('0x8'));var config=require('../../config/environment');var controller=require(_0xf1a8('0x9'));router[_0xf1a8('0xa')]('/',auth[_0xf1a8('0xb')](),controller[_0xf1a8('0xc')]);router[_0xf1a8('0xa')](_0xf1a8('0xd'),auth[_0xf1a8('0xb')](),controller[_0xf1a8('0xe')]);router['get'](_0xf1a8('0xf'),auth[_0xf1a8('0x10')](),controller[_0xf1a8('0x11')]);router['get'](_0xf1a8('0x12'),auth[_0xf1a8('0x10')](),controller['attachmentDownload']);router[_0xf1a8('0xa')]('/:id/messages',auth[_0xf1a8('0xb')](),controller[_0xf1a8('0x13')]);router[_0xf1a8('0xa')](_0xf1a8('0x14'),auth[_0xf1a8('0x10')](),controller[_0xf1a8('0x15')]);router[_0xf1a8('0xa')](_0xf1a8('0x16'),auth[_0xf1a8('0xb')](),controller[_0xf1a8('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf1a8('0x18')]);router[_0xf1a8('0x19')](_0xf1a8('0x1a'),auth['isAuthenticated'](),controller[_0xf1a8('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcfefea,_0x1f9d34,_0x421e49){_0x421e49(null,path[_0xf1a8('0x1c')](config[_0xf1a8('0x1d')],_0xf1a8('0x1e')));},'filename':function(_0x1d0a32,_0x286a35,_0x228935){_0x228935(null,util[_0xf1a8('0x1f')](_0xf1a8('0x20'),Date[_0xf1a8('0x21')](),_0x286a35[_0xf1a8('0x22')][_0xf1a8('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0xf1a8('0x24')](_0xf1a8('0x25')),controller[_0xf1a8('0x26')]);router[_0xf1a8('0x19')](_0xf1a8('0x27'),auth[_0xf1a8('0x10')](),controller[_0xf1a8('0x28')]);router['post'](_0xf1a8('0x29'),auth[_0xf1a8('0xb')](),interaction[_0xf1a8('0x2a')]('chat',_0xf1a8('0x2b')),controller[_0xf1a8('0x2c')]);router['put'](_0xf1a8('0xf'),auth[_0xf1a8('0xb')](),interaction[_0xf1a8('0x2a')](_0xf1a8('0x2d'),_0xf1a8('0x2e')),controller[_0xf1a8('0x2f')]);router[_0xf1a8('0x30')](_0xf1a8('0x31'),controller[_0xf1a8('0x32')]);router[_0xf1a8('0x30')](_0xf1a8('0x33'),auth[_0xf1a8('0x10')](),controller[_0xf1a8('0x34')]);router[_0xf1a8('0x30')](_0xf1a8('0x35'),controller['close']);router[_0xf1a8('0x36')](_0xf1a8('0xf'),auth[_0xf1a8('0xb')](),interaction[_0xf1a8('0x2a')]('chat',_0xf1a8('0x37')),controller[_0xf1a8('0x38')]);router['delete'](_0xf1a8('0x29'),auth[_0xf1a8('0xb')](),controller[_0xf1a8('0x39')]);module[_0xf1a8('0x3a')]=router; \ No newline at end of file +var _0xaa7e=['/:id/messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','originalname','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id/attachment_download'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0xaa7e,0xf6));var _0xeaa7=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0xaa7e[_0x4cfc1d];return _0x1c01a0;};'use strict';var multer=require(_0xeaa7('0x0'));var util=require(_0xeaa7('0x1'));var path=require(_0xeaa7('0x2'));var timeout=require(_0xeaa7('0x3'));var express=require(_0xeaa7('0x4'));var router=express[_0xeaa7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeaa7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeaa7('0x7'));var controller=require(_0xeaa7('0x8'));router[_0xeaa7('0x9')]('/',auth[_0xeaa7('0xa')](),controller['index']);router['get'](_0xeaa7('0xb'),auth[_0xeaa7('0xa')](),controller[_0xeaa7('0xc')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router['get'](_0xeaa7('0xd'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xeaa7('0x9')](_0xeaa7('0xe'),auth[_0xeaa7('0xa')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0xeaa7('0xf')](),controller[_0xeaa7('0x10')]);router[_0xeaa7('0x9')](_0xeaa7('0x11'),auth['isAuthenticated'](),controller[_0xeaa7('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeaa7('0x13')]);router[_0xeaa7('0x14')](_0xeaa7('0x15'),auth[_0xeaa7('0xa')](),controller[_0xeaa7('0x16')]);var upload=multer({'storage':multer[_0xeaa7('0x17')]({'destination':function(_0x7722d2,_0x5df27c,_0x14e178){_0x14e178(null,path[_0xeaa7('0x18')](config[_0xeaa7('0x19')],_0xeaa7('0x1a')));},'filename':function(_0x35c9e5,_0x2381cb,_0x17d2b2){_0x17d2b2(null,util['format'](_0xeaa7('0x1b'),Date['now'](),_0x2381cb[_0xeaa7('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xeaa7('0x14')](_0xeaa7('0x1d'),upload['single'](_0xeaa7('0x1e')),controller[_0xeaa7('0x1f')]);router[_0xeaa7('0x14')](_0xeaa7('0xe'),auth[_0xeaa7('0xf')](),controller[_0xeaa7('0x20')]);router[_0xeaa7('0x14')](_0xeaa7('0x21'),auth[_0xeaa7('0xa')](),interaction[_0xeaa7('0x22')](_0xeaa7('0x23'),_0xeaa7('0x24')),controller[_0xeaa7('0x25')]);router[_0xeaa7('0x26')](_0xeaa7('0x27'),auth[_0xeaa7('0xa')](),interaction[_0xeaa7('0x22')](_0xeaa7('0x23'),_0xeaa7('0x28')),controller[_0xeaa7('0x29')]);router[_0xeaa7('0x26')](_0xeaa7('0x2a'),controller[_0xeaa7('0x2b')]);router[_0xeaa7('0x26')](_0xeaa7('0x2c'),auth[_0xeaa7('0xf')](),controller[_0xeaa7('0x2d')]);router[_0xeaa7('0x26')]('/:id/close',controller[_0xeaa7('0x2e')]);router[_0xeaa7('0x2f')](_0xeaa7('0x27'),auth['isAuthenticated'](),interaction[_0xeaa7('0x22')](_0xeaa7('0x23'),_0xeaa7('0x30')),controller[_0xeaa7('0x31')]);router[_0xeaa7('0x2f')]('/:id/tags',auth[_0xeaa7('0xa')](),controller[_0xeaa7('0x32')]);module[_0xeaa7('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index bb02cd8..5c2cae6 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 _0xc2c9=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2eff73,_0x3bbaf1){var _0x23f46c=function(_0xd24930){while(--_0xd24930){_0x2eff73['push'](_0x2eff73['shift']());}};_0x23f46c(++_0x3bbaf1);}(_0xc2c9,0xf1));var _0x9c2c=function(_0x58bdae,_0xd4a4f){_0x58bdae=_0x58bdae-0x0;var _0x226c2a=_0xc2c9[_0x58bdae];return _0x226c2a;};'use strict';var Sequelize=require(_0x9c2c('0x0'));module[_0x9c2c('0x1')]={'body':{'type':Sequelize[_0x9c2c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9c2c('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9c2c('0x4')]}}; \ No newline at end of file +var _0x321d=['sequelize','exports','medium'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x321d,0x165));var _0xd321=function(_0x45ddbe,_0x51f76c){_0x45ddbe=_0x45ddbe-0x0;var _0x380aaf=_0x321d[_0x45ddbe];return _0x380aaf;};'use strict';var Sequelize=require(_0xd321('0x0'));module[_0xd321('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd321('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'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 05c352e..4bf4b12 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 _0xe6df=['../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','map','ChatInternalMessage','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','lastMessageAt','lastMessage','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','resourceId','push','messages','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0xe6df,0xc2));var _0xfe6d=function(_0x5d873a,_0x50fab2){_0x5d873a=_0x5d873a-0x0;var _0x3a84a1=_0xe6df[_0x5d873a];return _0x3a84a1;};'use strict';var emlformat=require(_0xfe6d('0x0'));var rimraf=require(_0xfe6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe6d('0x2'));var rp=require('request-promise');var moment=require(_0xfe6d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe6d('0x4'));var util=require(_0xfe6d('0x5'));var path=require(_0xfe6d('0x6'));var sox=require(_0xfe6d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe6d('0x8'));var _=require('lodash');var squel=require(_0xfe6d('0x9'));var crypto=require(_0xfe6d('0xa'));var jsforce=require(_0xfe6d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfe6d('0xc'));var querystring=require(_0xfe6d('0xd'));var Papa=require(_0xfe6d('0xe'));var Redis=require(_0xfe6d('0xf'));var authService=require(_0xfe6d('0x10'));var qs=require(_0xfe6d('0x11'));var as=require(_0xfe6d('0x12'));var hardwareService=require(_0xfe6d('0x13'));var logger=require(_0xfe6d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xfe6d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe6d('0x16'))['db'];config[_0xfe6d('0x17')]=_[_0xfe6d('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfe6d('0x19'))[_0xfe6d('0x1a')](socket);function respondWithStatusCode(_0x181af9,_0x22f7a1){_0x22f7a1=_0x22f7a1||0xcc;return function(_0x49a36f){if(_0x49a36f){return _0x181af9[_0xfe6d('0x1b')](_0x22f7a1);}return _0x181af9[_0xfe6d('0x1c')](_0x22f7a1)[_0xfe6d('0x1d')]();};}function respondWithResult(_0x409e2f,_0x12ffe9){_0x12ffe9=_0x12ffe9||0xc8;return function(_0x20529a){if(_0x20529a){return _0x409e2f['status'](_0x12ffe9)['json'](_0x20529a);}};}function respondWithFilteredResult(_0x44eadd,_0x231266){return function(_0x1ccd97){if(_0x1ccd97){var _0x214186=typeof _0x231266['offset']===_0xfe6d('0x1e')&&typeof _0x231266[_0xfe6d('0x1f')]===_0xfe6d('0x1e');var _0x391af2=_0x1ccd97['count'];var _0x1458c3=_0x214186?0x0:_0x231266[_0xfe6d('0x20')];var _0x16d926=_0x214186?_0x1ccd97[_0xfe6d('0x21')]:_0x231266[_0xfe6d('0x20')]+_0x231266[_0xfe6d('0x1f')];var _0xbe5c75;if(_0x16d926>=_0x391af2){_0x16d926=_0x391af2;_0xbe5c75=0xc8;}else{_0xbe5c75=0xce;}_0x44eadd[_0xfe6d('0x1c')](_0xbe5c75);return _0x44eadd[_0xfe6d('0x22')](_0xfe6d('0x23'),_0x1458c3+'-'+_0x16d926+'/'+_0x391af2)[_0xfe6d('0x24')](_0x1ccd97);}return null;};}function patchUpdates(_0x41c96b){return function(_0x157041){try{jsonpatch[_0xfe6d('0x25')](_0x157041,_0x41c96b,!![]);}catch(_0x181702){return BPromise[_0xfe6d('0x26')](_0x181702);}return _0x157041[_0xfe6d('0x27')]();};}function saveUpdates(_0x411c06,_0x35e50d){return function(_0x56f9d7){if(_0x56f9d7){return _0x56f9d7[_0xfe6d('0x28')](_0x411c06)['then'](function(_0x2af543){return _0x2af543;});}return null;};}function removeEntity(_0x28a4ba,_0x302ea1){return function(_0x30272a){if(_0x30272a){return _0x30272a[_0xfe6d('0x29')]()['then'](function(){_0x28a4ba[_0xfe6d('0x1c')](0xcc)[_0xfe6d('0x1d')]();});}};}function handleEntityNotFound(_0x17a23f,_0x59016c){return function(_0x37a4c6){if(!_0x37a4c6){_0x17a23f['sendStatus'](0x194);}return _0x37a4c6;};}function handleError(_0x2b5290,_0x216475){_0x216475=_0x216475||0x1f4;return function(_0x428d90){logger[_0xfe6d('0x2a')](_0x428d90[_0xfe6d('0x2b')]);if(_0x428d90[_0xfe6d('0x2c')]){delete _0x428d90['name'];}_0x2b5290[_0xfe6d('0x1c')](_0x216475)[_0xfe6d('0x2d')](_0x428d90);};}exports['index']=function(_0x2b5ab0,_0x40024a){var _0x1bc082={},_0x441423={},_0x4a0f7c={'count':0x0,'rows':[]};var _0xa82af9=_[_0xfe6d('0x2e')](db[_0xfe6d('0x2f')]['rawAttributes'],function(_0x3c063a){return{'name':_0x3c063a[_0xfe6d('0x30')],'type':_0x3c063a['type']['key']};});_0x441423[_0xfe6d('0x31')]=_['map'](_0xa82af9,_0xfe6d('0x2c'));_0x441423[_0xfe6d('0x32')]=_[_0xfe6d('0x33')](_0x2b5ab0['query']);_0x441423[_0xfe6d('0x34')]=_[_0xfe6d('0x35')](_0x441423[_0xfe6d('0x31')],_0x441423[_0xfe6d('0x32')]);_0x1bc082[_0xfe6d('0x36')]=_[_0xfe6d('0x35')](_0x441423[_0xfe6d('0x31')],qs[_0xfe6d('0x37')](_0x2b5ab0[_0xfe6d('0x32')]['fields']));_0x1bc082['attributes']=_0x1bc082['attributes'][_0xfe6d('0x38')]?_0x1bc082[_0xfe6d('0x36')]:_0x441423['model'];if(!_0x2b5ab0[_0xfe6d('0x32')]['hasOwnProperty'](_0xfe6d('0x39'))){_0x1bc082[_0xfe6d('0x1f')]=qs[_0xfe6d('0x1f')](_0x2b5ab0[_0xfe6d('0x32')][_0xfe6d('0x1f')]);_0x1bc082['offset']=qs[_0xfe6d('0x20')](_0x2b5ab0[_0xfe6d('0x32')]['offset']);}_0x1bc082[_0xfe6d('0x3a')]=qs[_0xfe6d('0x3b')](_0x2b5ab0[_0xfe6d('0x32')][_0xfe6d('0x3b')]);_0x1bc082['where']=qs['filters'](_[_0xfe6d('0x3c')](_0x2b5ab0[_0xfe6d('0x32')],_0x441423[_0xfe6d('0x34')]),_0xa82af9);if(_0x2b5ab0['query'][_0xfe6d('0x3d')]){_0x1bc082['where']=_[_0xfe6d('0x3e')](_0x1bc082[_0xfe6d('0x3f')],{'$or':_[_0xfe6d('0x2e')](_0xa82af9,function(_0x47d07c){if(_0x47d07c[_0xfe6d('0x40')]!==_0xfe6d('0x41')){var _0x1591cc={};_0x1591cc[_0x47d07c['name']]={'$like':'%'+_0x2b5ab0[_0xfe6d('0x32')][_0xfe6d('0x3d')]+'%'};return _0x1591cc;}})});}_0x1bc082=_[_0xfe6d('0x3e')]({},_0x1bc082,_0x2b5ab0['options']);var _0x1ed89a={'where':_0x1bc082[_0xfe6d('0x3f')]};return db[_0xfe6d('0x2f')][_0xfe6d('0x21')](_0x1ed89a)[_0xfe6d('0x42')](function(_0x594caa){_0x4a0f7c[_0xfe6d('0x21')]=_0x594caa;if(_0x2b5ab0[_0xfe6d('0x32')][_0xfe6d('0x43')]){_0x1bc082[_0xfe6d('0x44')]=[{'all':!![]}];}return db[_0xfe6d('0x2f')][_0xfe6d('0x45')](_0x1bc082);})[_0xfe6d('0x42')](function(_0x27a702){_0x4a0f7c[_0xfe6d('0x46')]=_0x27a702;return _0x4a0f7c;})[_0xfe6d('0x42')](respondWithFilteredResult(_0x40024a,_0x1bc082))[_0xfe6d('0x47')](handleError(_0x40024a,null));};exports[_0xfe6d('0x48')]=function(_0x5cd2b1,_0x465d7c){var _0x3fa28d={'raw':!![],'where':{'id':_0x5cd2b1[_0xfe6d('0x49')]['id']}},_0x4d06b6={};_0x4d06b6[_0xfe6d('0x31')]=_[_0xfe6d('0x33')](db['ChatInternalMessage'][_0xfe6d('0x4a')]);_0x4d06b6[_0xfe6d('0x32')]=_[_0xfe6d('0x33')](_0x5cd2b1[_0xfe6d('0x32')]);_0x4d06b6[_0xfe6d('0x34')]=_[_0xfe6d('0x35')](_0x4d06b6[_0xfe6d('0x31')],_0x4d06b6[_0xfe6d('0x32')]);_0x3fa28d['attributes']=_['intersection'](_0x4d06b6[_0xfe6d('0x31')],qs[_0xfe6d('0x37')](_0x5cd2b1[_0xfe6d('0x32')][_0xfe6d('0x37')]));_0x3fa28d[_0xfe6d('0x36')]=_0x3fa28d[_0xfe6d('0x36')][_0xfe6d('0x38')]?_0x3fa28d[_0xfe6d('0x36')]:_0x4d06b6[_0xfe6d('0x31')];if(_0x5cd2b1[_0xfe6d('0x32')][_0xfe6d('0x43')]){_0x3fa28d[_0xfe6d('0x44')]=[{'all':!![]}];}_0x3fa28d=_[_0xfe6d('0x3e')]({},_0x3fa28d,_0x5cd2b1['options']);return db['ChatInternalMessage'][_0xfe6d('0x4b')](_0x3fa28d)[_0xfe6d('0x42')](handleEntityNotFound(_0x465d7c,null))[_0xfe6d('0x42')](respondWithResult(_0x465d7c,null))[_0xfe6d('0x47')](handleError(_0x465d7c,null));};exports[_0xfe6d('0x4c')]=function(_0x42fead,_0x248f1f){return db[_0xfe6d('0x2f')][_0xfe6d('0x4c')](_0x42fead[_0xfe6d('0x4d')],{})['then'](respondWithResult(_0x248f1f,0xc9))[_0xfe6d('0x47')](handleError(_0x248f1f,null));};exports[_0xfe6d('0x28')]=function(_0x18fb55,_0x298e5b){if(_0x18fb55[_0xfe6d('0x4d')]['id']){delete _0x18fb55[_0xfe6d('0x4d')]['id'];}return db[_0xfe6d('0x2f')]['find']({'where':{'id':_0x18fb55['params']['id']}})['then'](handleEntityNotFound(_0x298e5b,null))[_0xfe6d('0x42')](saveUpdates(_0x18fb55[_0xfe6d('0x4d')],null))['then'](respondWithResult(_0x298e5b,null))[_0xfe6d('0x47')](handleError(_0x298e5b,null));};exports[_0xfe6d('0x29')]=function(_0x5180e2,_0x1aa44f){return db[_0xfe6d('0x2f')][_0xfe6d('0x4b')]({'where':{'id':_0x5180e2['params']['id']}})['then'](handleEntityNotFound(_0x1aa44f,null))[_0xfe6d('0x42')](removeEntity(_0x1aa44f,null))['catch'](handleError(_0x1aa44f,null));};exports[_0xfe6d('0x4e')]=function(_0x5b29b9,_0x2cba37){return db[_0xfe6d('0x2f')][_0xfe6d('0x4e')]()[_0xfe6d('0x42')](respondWithResult(_0x2cba37,null))[_0xfe6d('0x47')](handleError(_0x2cba37,null));};function wrapUser(_0x3afce4){return function(_0x2b00a7){var _0x40f989=_0x3afce4['get']({'plain':!![]});_0x40f989['messages']=[];if(_0x2b00a7){_0x40f989['lastMessageAt']=_0x2b00a7['createdAt'];_0x40f989['lastMessage']=_0x2b00a7;}else{_0x40f989[_0xfe6d('0x4f')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40f989[_0xfe6d('0x50')]={};}return _0x40f989;};}exports['getUsers']=function(_0x1d3b52,_0x151191,_0x49c869){var _0x5b5f9a=[];return db[_0xfe6d('0x51')][_0xfe6d('0x45')]({'where':{'role':[_0xfe6d('0x52'),_0xfe6d('0x53'),_0xfe6d('0x54')]},'attributes':['id',_0xfe6d('0x55'),'name',_0xfe6d('0x56'),_0xfe6d('0x57'),_0xfe6d('0x58'),_0xfe6d('0x59'),'lastLoginAt',_0xfe6d('0x5a'),_0xfe6d('0x5b')],'order':qs[_0xfe6d('0x3b')](_0xfe6d('0x5c')),'include':[{'model':db[_0xfe6d('0x5d')],'as':'VoiceQueues','attributes':['id',_0xfe6d('0x2c'),_0xfe6d('0x40')],'through':{'attributes':[]}}]})[_0xfe6d('0x42')](function(_0x308cfd){if(_0x308cfd){var _0x633944=_0x1d3b52[_0xfe6d('0x54')]['get']({'plain':!![]});if(!_0x633944)throw new Error(_0xfe6d('0x5e'));if(_0x633944[_0xfe6d('0x56')]===_0xfe6d('0x54')){return db[_0xfe6d('0x5f')]['find']({'where':{'name':_0xfe6d('0x60'),'userProfileId':_0x633944[_0xfe6d('0x61')]},'raw':!![]})[_0xfe6d('0x42')](function(_0x19c62c){if(_0x19c62c){if(_0x19c62c['autoAssociation']===0x0){return db[_0xfe6d('0x62')]['findAll']({'where':{'sectionId':_0x19c62c['id']},'raw':!![]})[_0xfe6d('0x42')](function(_0x534fb0){var _0x5bd4e0=[];if(_['isEmpty'](_0x534fb0)){_0x5bd4e0=_[_0xfe6d('0x3d')](_0x308cfd,function(_0x57b32e){if(_0x57b32e['role']!==_0xfe6d('0x52')){return _0x57b32e;}});return _0x5bd4e0;}else{for(var _0x1c8a61=0x0;_0x1c8a61<_0x308cfd[_0xfe6d('0x38')];_0x1c8a61++){var _0x4bc41a=_0x308cfd[_0x1c8a61];if(_0x4bc41a[_0xfe6d('0x56')]===_0xfe6d('0x52')){var _0x28c778=_[_0xfe6d('0x4b')](_0x534fb0,function(_0xb50ee8){return _0xb50ee8[_0xfe6d('0x63')]===_0x4bc41a['id'];});if(_0x28c778)_0x5bd4e0[_0xfe6d('0x64')](_0x4bc41a);}else{_0x5bd4e0[_0xfe6d('0x64')](_0x4bc41a);}}return _0x5bd4e0;}});}else{return _0x308cfd;}}else{var _0xfc0ac0=_['filter'](_0x308cfd,function(_0x5856a8){if(_0x5856a8[_0xfe6d('0x56')]!==_0xfe6d('0x52')){return _0x5856a8;}});return _0xfc0ac0;}});}else{return _0x308cfd;}}})[_0xfe6d('0x42')](function(_0x14f396){var _0x3a25d4=[];if(_0x14f396){_0x5b5f9a=_0x14f396;for(var _0x3c0998=0x0;_0x3c0998<_0x14f396[_0xfe6d('0x38')];_0x3c0998+=0x1){_0x5b5f9a[_0x3c0998][_0xfe6d('0x65')]=[];_0x3a25d4['push'](db[_0xfe6d('0x2f')][_0xfe6d('0x4b')]({'where':{'FromId':[_0x1d3b52['user']['id'],_0x14f396[_0x3c0998]['id']],'ToId':[_0x1d3b52['user']['id'],_0x14f396[_0x3c0998]['id']],'ChatGroupId':null},'attributes':['id',_0xfe6d('0x66'),_0xfe6d('0x67'),_0xfe6d('0x68'),_0xfe6d('0x69'),_0xfe6d('0x4d')],'order':qs['sort'](_0xfe6d('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfe6d('0x42')](wrapUser(_0x14f396[_0x3c0998])));}return BPromise[_0xfe6d('0x6b')](_0x3a25d4);}return[];})[_0xfe6d('0x42')](function(_0x46e018){return{'rows':_0x46e018,'count':_0x46e018['length']};})[_0xfe6d('0x42')](respondWithResult(_0x151191,null))[_0xfe6d('0x47')](handleError(_0x151191,null));}; \ No newline at end of file +var _0x868a=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','update','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','user','role','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x868a,0x13c));var _0xa868=function(_0x3bfee1,_0xc1799){_0x3bfee1=_0x3bfee1-0x0;var _0x330955=_0x868a[_0x3bfee1];return _0x330955;};'use strict';var emlformat=require(_0xa868('0x0'));var rimraf=require(_0xa868('0x1'));var zipdir=require(_0xa868('0x2'));var jsonpatch=require(_0xa868('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa868('0x4'));var Mustache=require(_0xa868('0x5'));var util=require('util');var path=require(_0xa868('0x6'));var sox=require(_0xa868('0x7'));var csv=require(_0xa868('0x8'));var ejs=require(_0xa868('0x9'));var fs=require('fs');var fs_extra=require(_0xa868('0xa'));var _=require(_0xa868('0xb'));var squel=require(_0xa868('0xc'));var crypto=require('crypto');var jsforce=require(_0xa868('0xd'));var deskjs=require(_0xa868('0xe'));var toCsv=require(_0xa868('0x8'));var querystring=require(_0xa868('0xf'));var Papa=require(_0xa868('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa868('0x11'));var as=require(_0xa868('0x12'));var hardwareService=require(_0xa868('0x13'));var logger=require(_0xa868('0x14'))(_0xa868('0x15'));var utils=require(_0xa868('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa868('0x17'))['db'];config[_0xa868('0x18')]=_['defaults'](config[_0xa868('0x18')],{'host':_0xa868('0x19'),'port':0x18eb});var socket=require(_0xa868('0x1a'))(new Redis(config[_0xa868('0x18')]));require(_0xa868('0x1b'))[_0xa868('0x1c')](socket);function respondWithStatusCode(_0x37114d,_0x4cef22){_0x4cef22=_0x4cef22||0xcc;return function(_0xf7aecd){if(_0xf7aecd){return _0x37114d[_0xa868('0x1d')](_0x4cef22);}return _0x37114d['status'](_0x4cef22)[_0xa868('0x1e')]();};}function respondWithResult(_0x5c3ae3,_0x34ebf3){_0x34ebf3=_0x34ebf3||0xc8;return function(_0x1c7c78){if(_0x1c7c78){return _0x5c3ae3[_0xa868('0x1f')](_0x34ebf3)[_0xa868('0x20')](_0x1c7c78);}};}function respondWithFilteredResult(_0x4893bb,_0x19fca2){return function(_0x22cccd){if(_0x22cccd){var _0x16f075=typeof _0x19fca2[_0xa868('0x21')]===_0xa868('0x22')&&typeof _0x19fca2[_0xa868('0x23')]===_0xa868('0x22');var _0xc6ef8b=_0x22cccd[_0xa868('0x24')];var _0x30b4df=_0x16f075?0x0:_0x19fca2[_0xa868('0x21')];var _0x1e944f=_0x16f075?_0x22cccd[_0xa868('0x24')]:_0x19fca2['offset']+_0x19fca2[_0xa868('0x23')];var _0x169479;if(_0x1e944f>=_0xc6ef8b){_0x1e944f=_0xc6ef8b;_0x169479=0xc8;}else{_0x169479=0xce;}_0x4893bb[_0xa868('0x1f')](_0x169479);return _0x4893bb[_0xa868('0x25')](_0xa868('0x26'),_0x30b4df+'-'+_0x1e944f+'/'+_0xc6ef8b)['json'](_0x22cccd);}return null;};}function patchUpdates(_0x441ea4){return function(_0x5892dc){try{jsonpatch['apply'](_0x5892dc,_0x441ea4,!![]);}catch(_0x5210a7){return BPromise[_0xa868('0x27')](_0x5210a7);}return _0x5892dc[_0xa868('0x28')]();};}function saveUpdates(_0x57a7a0,_0x1ba288){return function(_0x4f5727){if(_0x4f5727){return _0x4f5727['update'](_0x57a7a0)[_0xa868('0x29')](function(_0x40a116){return _0x40a116;});}return null;};}function removeEntity(_0x587ebd,_0x4b87d3){return function(_0x30485d){if(_0x30485d){return _0x30485d[_0xa868('0x2a')]()[_0xa868('0x29')](function(){_0x587ebd[_0xa868('0x1f')](0xcc)[_0xa868('0x1e')]();});}};}function handleEntityNotFound(_0x57a2c8,_0x263381){return function(_0x27dc65){if(!_0x27dc65){_0x57a2c8[_0xa868('0x1d')](0x194);}return _0x27dc65;};}function handleError(_0x41a94f,_0x1df0ef){_0x1df0ef=_0x1df0ef||0x1f4;return function(_0xbc0d05){logger['error'](_0xbc0d05['stack']);if(_0xbc0d05[_0xa868('0x2b')]){delete _0xbc0d05[_0xa868('0x2b')];}_0x41a94f[_0xa868('0x1f')](_0x1df0ef)['send'](_0xbc0d05);};}exports['index']=function(_0x3d01dc,_0x264b65){var _0x44fd0e={},_0x524980={},_0x313dd5={'count':0x0,'rows':[]};var _0x36c598=_[_0xa868('0x2c')](db['ChatInternalMessage']['rawAttributes'],function(_0x41eea8){return{'name':_0x41eea8[_0xa868('0x2d')],'type':_0x41eea8[_0xa868('0x2e')][_0xa868('0x2f')]};});_0x524980[_0xa868('0x30')]=_[_0xa868('0x2c')](_0x36c598,_0xa868('0x2b'));_0x524980[_0xa868('0x31')]=_[_0xa868('0x32')](_0x3d01dc[_0xa868('0x31')]);_0x524980[_0xa868('0x33')]=_[_0xa868('0x34')](_0x524980[_0xa868('0x30')],_0x524980[_0xa868('0x31')]);_0x44fd0e[_0xa868('0x35')]=_[_0xa868('0x34')](_0x524980[_0xa868('0x30')],qs['fields'](_0x3d01dc[_0xa868('0x31')][_0xa868('0x36')]));_0x44fd0e[_0xa868('0x35')]=_0x44fd0e[_0xa868('0x35')][_0xa868('0x37')]?_0x44fd0e[_0xa868('0x35')]:_0x524980[_0xa868('0x30')];if(!_0x3d01dc['query'][_0xa868('0x38')](_0xa868('0x39'))){_0x44fd0e[_0xa868('0x23')]=qs[_0xa868('0x23')](_0x3d01dc[_0xa868('0x31')][_0xa868('0x23')]);_0x44fd0e['offset']=qs['offset'](_0x3d01dc[_0xa868('0x31')][_0xa868('0x21')]);}_0x44fd0e[_0xa868('0x3a')]=qs[_0xa868('0x3b')](_0x3d01dc['query'][_0xa868('0x3b')]);_0x44fd0e[_0xa868('0x3c')]=qs[_0xa868('0x33')](_[_0xa868('0x3d')](_0x3d01dc[_0xa868('0x31')],_0x524980[_0xa868('0x33')]),_0x36c598);if(_0x3d01dc[_0xa868('0x31')][_0xa868('0x3e')]){_0x44fd0e[_0xa868('0x3c')]=_[_0xa868('0x3f')](_0x44fd0e[_0xa868('0x3c')],{'$or':_[_0xa868('0x2c')](_0x36c598,function(_0x16c6f9){if(_0x16c6f9['type']!==_0xa868('0x40')){var _0x45d4e2={};_0x45d4e2[_0x16c6f9[_0xa868('0x2b')]]={'$like':'%'+_0x3d01dc[_0xa868('0x31')]['filter']+'%'};return _0x45d4e2;}})});}_0x44fd0e=_['merge']({},_0x44fd0e,_0x3d01dc[_0xa868('0x41')]);var _0x487262={'where':_0x44fd0e[_0xa868('0x3c')]};return db[_0xa868('0x42')]['count'](_0x487262)['then'](function(_0xdce207){_0x313dd5[_0xa868('0x24')]=_0xdce207;if(_0x3d01dc['query'][_0xa868('0x43')]){_0x44fd0e[_0xa868('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xa868('0x45')](_0x44fd0e);})[_0xa868('0x29')](function(_0x1fe9fd){_0x313dd5['rows']=_0x1fe9fd;return _0x313dd5;})[_0xa868('0x29')](respondWithFilteredResult(_0x264b65,_0x44fd0e))[_0xa868('0x46')](handleError(_0x264b65,null));};exports[_0xa868('0x47')]=function(_0x4ca6ca,_0x45a46c){var _0x182c0b={'raw':!![],'where':{'id':_0x4ca6ca['params']['id']}},_0x45ff63={};_0x45ff63[_0xa868('0x30')]=_['keys'](db[_0xa868('0x42')][_0xa868('0x48')]);_0x45ff63[_0xa868('0x31')]=_[_0xa868('0x32')](_0x4ca6ca['query']);_0x45ff63[_0xa868('0x33')]=_[_0xa868('0x34')](_0x45ff63[_0xa868('0x30')],_0x45ff63[_0xa868('0x31')]);_0x182c0b[_0xa868('0x35')]=_[_0xa868('0x34')](_0x45ff63[_0xa868('0x30')],qs[_0xa868('0x36')](_0x4ca6ca[_0xa868('0x31')][_0xa868('0x36')]));_0x182c0b[_0xa868('0x35')]=_0x182c0b[_0xa868('0x35')][_0xa868('0x37')]?_0x182c0b[_0xa868('0x35')]:_0x45ff63[_0xa868('0x30')];if(_0x4ca6ca[_0xa868('0x31')][_0xa868('0x43')]){_0x182c0b[_0xa868('0x44')]=[{'all':!![]}];}_0x182c0b=_['merge']({},_0x182c0b,_0x4ca6ca['options']);return db[_0xa868('0x42')][_0xa868('0x49')](_0x182c0b)[_0xa868('0x29')](handleEntityNotFound(_0x45a46c,null))['then'](respondWithResult(_0x45a46c,null))[_0xa868('0x46')](handleError(_0x45a46c,null));};exports['create']=function(_0x1a09b2,_0x5dc2a3){return db[_0xa868('0x42')][_0xa868('0x4a')](_0x1a09b2[_0xa868('0x4b')],{})[_0xa868('0x29')](respondWithResult(_0x5dc2a3,0xc9))[_0xa868('0x46')](handleError(_0x5dc2a3,null));};exports[_0xa868('0x4c')]=function(_0x2dae63,_0x3d93c7){if(_0x2dae63[_0xa868('0x4b')]['id']){delete _0x2dae63[_0xa868('0x4b')]['id'];}return db[_0xa868('0x42')][_0xa868('0x49')]({'where':{'id':_0x2dae63[_0xa868('0x4d')]['id']}})[_0xa868('0x29')](handleEntityNotFound(_0x3d93c7,null))[_0xa868('0x29')](saveUpdates(_0x2dae63[_0xa868('0x4b')],null))[_0xa868('0x29')](respondWithResult(_0x3d93c7,null))['catch'](handleError(_0x3d93c7,null));};exports[_0xa868('0x2a')]=function(_0xdce484,_0x16b90d){return db[_0xa868('0x42')][_0xa868('0x49')]({'where':{'id':_0xdce484['params']['id']}})[_0xa868('0x29')](handleEntityNotFound(_0x16b90d,null))[_0xa868('0x29')](removeEntity(_0x16b90d,null))[_0xa868('0x46')](handleError(_0x16b90d,null));};exports[_0xa868('0x4e')]=function(_0x1ca83e,_0x4a2b97){return db[_0xa868('0x42')][_0xa868('0x4e')]()[_0xa868('0x29')](respondWithResult(_0x4a2b97,null))[_0xa868('0x46')](handleError(_0x4a2b97,null));};function wrapUser(_0xa8ae4){return function(_0x790dc8){var _0x41b701=_0xa8ae4[_0xa868('0x4f')]({'plain':!![]});_0x41b701[_0xa868('0x50')]=[];if(_0x790dc8){_0x41b701[_0xa868('0x51')]=_0x790dc8[_0xa868('0x52')];_0x41b701[_0xa868('0x53')]=_0x790dc8;}else{_0x41b701[_0xa868('0x51')]=moment(0x0)[_0xa868('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x41b701[_0xa868('0x53')]={};}return _0x41b701;};}exports[_0xa868('0x55')]=function(_0x11fba5,_0xb2805a,_0x420637){var _0xdb4d97=[];return db[_0xa868('0x56')]['findAll']({'where':{'role':[_0xa868('0x57'),'admin',_0xa868('0x58')]},'attributes':['id','fullname',_0xa868('0x2b'),_0xa868('0x59'),'userpic',_0xa868('0x5a'),_0xa868('0x5b'),_0xa868('0x5c'),_0xa868('0x5d'),'showWebBar'],'order':qs[_0xa868('0x3b')](_0xa868('0x5e')),'include':[{'model':db[_0xa868('0x5f')],'as':_0xa868('0x60'),'attributes':['id','name',_0xa868('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0xc0a3cf){if(_0xc0a3cf){var _0x507a8e=_0x11fba5[_0xa868('0x58')][_0xa868('0x4f')]({'plain':!![]});if(!_0x507a8e)throw new Error(_0xa868('0x61'));if(_0x507a8e['role']===_0xa868('0x58')){return db[_0xa868('0x62')][_0xa868('0x49')]({'where':{'name':_0xa868('0x63'),'userProfileId':_0x507a8e[_0xa868('0x64')]},'raw':!![]})[_0xa868('0x29')](function(_0x1929ff){if(_0x1929ff){if(_0x1929ff[_0xa868('0x65')]===0x0){return db[_0xa868('0x66')][_0xa868('0x45')]({'where':{'sectionId':_0x1929ff['id']},'raw':!![]})[_0xa868('0x29')](function(_0x5150c4){var _0x5aa339=[];if(_[_0xa868('0x67')](_0x5150c4)){_0x5aa339=_[_0xa868('0x3e')](_0xc0a3cf,function(_0x34ceb2){if(_0x34ceb2[_0xa868('0x59')]!==_0xa868('0x57')){return _0x34ceb2;}});return _0x5aa339;}else{for(var _0x2120a8=0x0;_0x2120a8<_0xc0a3cf[_0xa868('0x37')];_0x2120a8++){var _0x227d80=_0xc0a3cf[_0x2120a8];if(_0x227d80[_0xa868('0x59')]===_0xa868('0x57')){var _0x2e1304=_[_0xa868('0x49')](_0x5150c4,function(_0x51f199){return _0x51f199['resourceId']===_0x227d80['id'];});if(_0x2e1304)_0x5aa339[_0xa868('0x68')](_0x227d80);}else{_0x5aa339['push'](_0x227d80);}}return _0x5aa339;}});}else{return _0xc0a3cf;}}else{var _0x4ec356=_[_0xa868('0x3e')](_0xc0a3cf,function(_0x555da8){if(_0x555da8['role']!==_0xa868('0x57')){return _0x555da8;}});return _0x4ec356;}});}else{return _0xc0a3cf;}}})[_0xa868('0x29')](function(_0x34c421){var _0x178ae1=[];if(_0x34c421){_0xdb4d97=_0x34c421;for(var _0x1edd6e=0x0;_0x1edd6e<_0x34c421[_0xa868('0x37')];_0x1edd6e+=0x1){_0xdb4d97[_0x1edd6e]['messages']=[];_0x178ae1[_0xa868('0x68')](db[_0xa868('0x42')][_0xa868('0x49')]({'where':{'FromId':[_0x11fba5[_0xa868('0x58')]['id'],_0x34c421[_0x1edd6e]['id']],'ToId':[_0x11fba5[_0xa868('0x58')]['id'],_0x34c421[_0x1edd6e]['id']],'ChatGroupId':null},'attributes':['id',_0xa868('0x52'),_0xa868('0x69'),_0xa868('0x6a'),_0xa868('0x6b'),_0xa868('0x4b')],'order':qs[_0xa868('0x3b')](_0xa868('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa868('0x29')](wrapUser(_0x34c421[_0x1edd6e])));}return BPromise[_0xa868('0x6d')](_0x178ae1);}return[];})['then'](function(_0x92743){return{'rows':_0x92743,'count':_0x92743['length']};})[_0xa868('0x29')](respondWithResult(_0xb2805a,null))[_0xa868('0x46')](handleError(_0xb2805a,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 075ef14..1a41a5b 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 _0xe09e=['update','emit','exports','ChatInternalMessage','setMaxListeners','save'];(function(_0x4d118e,_0x35122f){var _0x2144c4=function(_0x11e892){while(--_0x11e892){_0x4d118e['push'](_0x4d118e['shift']());}};_0x2144c4(++_0x35122f);}(_0xe09e,0x177));var _0xee09=function(_0x38454a,_0x14573e){_0x38454a=_0x38454a-0x0;var _0x3829b6=_0xe09e[_0x38454a];return _0x3829b6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xee09('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xee09('0x1')](0x0);var events={'afterCreate':_0xee09('0x2'),'afterUpdate':_0xee09('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16ef17){return function(_0x6f29f4,_0x530108,_0x9407de){ChatInternalMessageEvents['emit'](_0x16ef17+':'+_0x6f29f4['id'],_0x6f29f4);ChatInternalMessageEvents[_0xee09('0x4')](_0x16ef17,_0x6f29f4);_0x9407de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xee09('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x8eb4=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8eb4,0xb5));var _0x48eb=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x8eb4[_0x1ebeea];return _0x576465;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x48eb('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x48eb('0x1')](0x0);var events={'afterCreate':_0x48eb('0x2'),'afterUpdate':_0x48eb('0x3'),'afterDestroy':_0x48eb('0x4')};function emitEvent(_0x11d634){return function(_0x18e38b,_0x70f297,_0x521e94){ChatInternalMessageEvents[_0x48eb('0x5')](_0x11d634+':'+_0x18e38b['id'],_0x18e38b);ChatInternalMessageEvents[_0x48eb('0x5')](_0x11d634,_0x18e38b);_0x521e94(null);};}for(var e in events){if(events[_0x48eb('0x6')](e)){var event=events[e];ChatInternalMessage[_0x48eb('0x7')](e,emitEvent(event));}}module[_0x48eb('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 749a622..3fe787b 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 _0x6494=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6494,0x1bb));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4649('0x0'));var util=require('util');var logger=require(_0x4649('0x1'))(_0x4649('0x2'));var moment=require(_0x4649('0x3'));var BPromise=require(_0x4649('0x4'));var rp=require(_0x4649('0x5'));var fs=require('fs');var path=require(_0x4649('0x6'));var rimraf=require('rimraf');var config=require(_0x4649('0x7'));var attributes=require(_0x4649('0x8'));module['exports']=function(_0x340018,_0x21180c){return _0x340018[_0x4649('0x9')](_0x4649('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4649('0xb'),'collate':_0x4649('0xc')});}; \ No newline at end of file +var _0x0693=['path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xa24c4f,_0x47939c){var _0x37c6b1=function(_0x44f426){while(--_0x44f426){_0xa24c4f['push'](_0xa24c4f['shift']());}};_0x37c6b1(++_0x47939c);}(_0x0693,0x1db));var _0x3069=function(_0x29a718,_0x10099d){_0x29a718=_0x29a718-0x0;var _0x5ed716=_0x0693[_0x29a718];return _0x5ed716;};'use strict';var _=require(_0x3069('0x0'));var util=require(_0x3069('0x1'));var logger=require(_0x3069('0x2'))('api');var moment=require(_0x3069('0x3'));var BPromise=require(_0x3069('0x4'));var rp=require(_0x3069('0x5'));var fs=require('fs');var path=require(_0x3069('0x6'));var rimraf=require(_0x3069('0x7'));var config=require('../../config/environment');var attributes=require(_0x3069('0x8'));module[_0x3069('0x9')]=function(_0x869de0,_0x433ae2){return _0x869de0[_0x3069('0xa')](_0x3069('0xb'),attributes,{'tableName':_0x3069('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 0232eb6..f94b2f8 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 _0x0869=['debug','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','request\x20sent'];(function(_0x56c155,_0x3ea58c){var _0x2eed44=function(_0x10e8a5){while(--_0x10e8a5){_0x56c155['push'](_0x56c155['shift']());}};_0x2eed44(++_0x3ea58c);}(_0x0869,0xaf));var _0x9086=function(_0x44aa9c,_0x4280c1){_0x44aa9c=_0x44aa9c-0x0;var _0x4b4145=_0x0869[_0x44aa9c];return _0x4b4145;};'use strict';var _=require(_0x9086('0x0'));var util=require(_0x9086('0x1'));var moment=require(_0x9086('0x2'));var BPromise=require(_0x9086('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9086('0x4'));var db=require(_0x9086('0x5'))['db'];var utils=require(_0x9086('0x6'));var logger=require(_0x9086('0x7'))(_0x9086('0x8'));var config=require(_0x9086('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9086('0xa')][_0x9086('0xb')]({'port':0x232a});config[_0x9086('0xc')]=_['defaults'](config[_0x9086('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9086('0xd'))(new Redis(config[_0x9086('0xc')]));require(_0x9086('0xe'))[_0x9086('0xf')](socket);function respondWithRpcPromise(_0x107cc5,_0x1b1fda,_0x317cd3){return new BPromise(function(_0x43c230,_0x5a801e){return client['request'](_0x107cc5,_0x317cd3)['then'](function(_0x3179aa){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1b1fda,_0x9086('0x10'));logger[_0x9086('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1b1fda,_0x9086('0x10'),JSON[_0x9086('0x12')](_0x3179aa));if(_0x3179aa[_0x9086('0x13')]){if(_0x3179aa[_0x9086('0x13')]['code']===0x1f4){logger[_0x9086('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b1fda,_0x3179aa['error']['message']);return _0x5a801e(_0x3179aa[_0x9086('0x13')][_0x9086('0x14')]);}logger[_0x9086('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b1fda,_0x3179aa[_0x9086('0x13')][_0x9086('0x14')]);return _0x43c230(_0x3179aa['error']['message']);}else{logger['info'](_0x9086('0x15'),_0x1b1fda,_0x9086('0x10'));_0x43c230(_0x3179aa[_0x9086('0x16')][_0x9086('0x14')]);}})[_0x9086('0x17')](function(_0x29f450){logger['error'](_0x9086('0x15'),_0x1b1fda,_0x29f450);_0x5a801e(_0x29f450);});});} \ No newline at end of file +var _0x23f5=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','catch','lodash','util','moment'];(function(_0x384f13,_0x5418d0){var _0x5d0935=function(_0x1b5471){while(--_0x1b5471){_0x384f13['push'](_0x384f13['shift']());}};_0x5d0935(++_0x5418d0);}(_0x23f5,0x93));var _0x523f=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0x23f5[_0x1633e9];return _0x549ace;};'use strict';var _=require(_0x523f('0x0'));var util=require(_0x523f('0x1'));var moment=require(_0x523f('0x2'));var BPromise=require('bluebird');var rs=require(_0x523f('0x3'));var fs=require('fs');var Redis=require(_0x523f('0x4'));var db=require(_0x523f('0x5'))['db'];var utils=require(_0x523f('0x6'));var logger=require('../../config/logger')(_0x523f('0x7'));var config=require(_0x523f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x523f('0x9')][_0x523f('0xa')]({'port':0x232a});config[_0x523f('0xb')]=_['defaults'](config['redis'],{'host':_0x523f('0xc'),'port':0x18eb});var socket=require(_0x523f('0xd'))(new Redis(config[_0x523f('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x54ad6b,_0x5ede11,_0x46bf77){return new BPromise(function(_0x499fd3,_0x4b6a95){return client[_0x523f('0xe')](_0x54ad6b,_0x46bf77)['then'](function(_0x4aaefc){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5ede11,_0x523f('0xf'));logger[_0x523f('0x10')](_0x523f('0x11'),_0x5ede11,_0x523f('0xf'),JSON[_0x523f('0x12')](_0x4aaefc));if(_0x4aaefc[_0x523f('0x13')]){if(_0x4aaefc[_0x523f('0x13')][_0x523f('0x14')]===0x1f4){logger[_0x523f('0x13')](_0x523f('0x15'),_0x5ede11,_0x4aaefc[_0x523f('0x13')][_0x523f('0x16')]);return _0x4b6a95(_0x4aaefc[_0x523f('0x13')]['message']);}logger[_0x523f('0x13')](_0x523f('0x15'),_0x5ede11,_0x4aaefc[_0x523f('0x13')][_0x523f('0x16')]);return _0x499fd3(_0x4aaefc['error'][_0x523f('0x16')]);}else{logger[_0x523f('0x17')](_0x523f('0x15'),_0x5ede11,_0x523f('0xf'));_0x499fd3(_0x4aaefc['result']['message']);}})[_0x523f('0x18')](function(_0x5d5537){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5ede11,_0x5d5537);_0x4b6a95(_0x5d5537);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 8fa3daf..338e1fb 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 _0x1ac7=['emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1ac7,0xa4));var _0x71ac=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x1ac7[_0x5cb1af];return _0x8d7940;};'use strict';var ChatInternalMessageEvents=require(_0x71ac('0x0'));var events=[_0x71ac('0x1'),_0x71ac('0x2'),_0x71ac('0x3')];function createListener(_0x437271,_0x266c09){return function(_0x1e2117){_0x266c09[_0x71ac('0x4')](_0x437271,_0x1e2117);};}function removeListener(_0x353525,_0x3eed69){return function(){ChatInternalMessageEvents[_0x71ac('0x5')](_0x353525,_0x3eed69);};}exports[_0x71ac('0x6')]=function(_0x5897fc){for(var _0x40e70f=0x0,_0x231358=events['length'];_0x40e70f<_0x231358;_0x40e70f++){var _0x1ddfbf=events[_0x40e70f];var _0x9c8029=createListener(_0x71ac('0x7')+_0x1ddfbf,_0x5897fc);ChatInternalMessageEvents['on'](_0x1ddfbf,_0x9c8029);}}; \ No newline at end of file +var _0x82cb=['update','removeListener','register','length','./chatInternalMessage.events'];(function(_0x329a90,_0x358158){var _0x2f8e6d=function(_0xb910c){while(--_0xb910c){_0x329a90['push'](_0x329a90['shift']());}};_0x2f8e6d(++_0x358158);}(_0x82cb,0xd1));var _0xb82c=function(_0x296beb,_0x105af7){_0x296beb=_0x296beb-0x0;var _0x486b85=_0x82cb[_0x296beb];return _0x486b85;};'use strict';var ChatInternalMessageEvents=require(_0xb82c('0x0'));var events=['save','remove',_0xb82c('0x1')];function createListener(_0x450d17,_0x23f2c0){return function(_0x9a178e){_0x23f2c0['emit'](_0x450d17,_0x9a178e);};}function removeListener(_0x34c4ff,_0x5a38a0){return function(){ChatInternalMessageEvents[_0xb82c('0x2')](_0x34c4ff,_0x5a38a0);};}exports[_0xb82c('0x3')]=function(_0x4de4ae){for(var _0x3e718e=0x0,_0x1a191d=events[_0xb82c('0x4')];_0x3e718e<_0x1a191d;_0x3e718e++){var _0x2c2afc=events[_0x3e718e];var _0xf5d9e8=createListener('chatInternalMessage:'+_0x2c2afc,_0x4de4ae);ChatInternalMessageEvents['on'](_0x2c2afc,_0xf5d9e8);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index dddb6e6..0666dfb 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 _0x1575=['./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x1575,0x1f1));var _0x5157=function(_0x25ff42,_0x1dd28a){_0x25ff42=_0x25ff42-0x0;var _0x2b9f64=_0x1575[_0x25ff42];return _0x2b9f64;};'use strict';var multer=require(_0x5157('0x0'));var util=require('util');var path=require(_0x5157('0x1'));var timeout=require(_0x5157('0x2'));var express=require(_0x5157('0x3'));var router=express[_0x5157('0x4')]();var fs_extra=require(_0x5157('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5157('0x6'));var controller=require(_0x5157('0x7'));router[_0x5157('0x8')]('/',auth[_0x5157('0x9')](),controller[_0x5157('0xa')]);router[_0x5157('0x8')](_0x5157('0xb'),auth[_0x5157('0x9')](),controller[_0x5157('0xc')]);router[_0x5157('0x8')](_0x5157('0xd'),auth[_0x5157('0x9')](),controller[_0x5157('0xe')]);router['get']('/:id',auth[_0x5157('0x9')](),controller[_0x5157('0xf')]);router[_0x5157('0x10')]('/',auth[_0x5157('0x9')](),controller[_0x5157('0x11')]);router[_0x5157('0x12')](_0x5157('0x13'),controller[_0x5157('0x14')]);router[_0x5157('0x15')](_0x5157('0x13'),auth['isAuthenticated'](),controller[_0x5157('0x16')]);module[_0x5157('0x17')]=router; \ No newline at end of file +var _0xa466=['show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','/describe','isAuthenticated','get','/users','getUsers','/:id'];(function(_0x247821,_0x1571e2){var _0x7ae66b=function(_0x75421){while(--_0x75421){_0x247821['push'](_0x247821['shift']());}};_0x7ae66b(++_0x1571e2);}(_0xa466,0x140));var _0x6a46=function(_0x2dcc5a,_0x2da0f9){_0x2dcc5a=_0x2dcc5a-0x0;var _0x40169e=_0xa466[_0x2dcc5a];return _0x40169e;};'use strict';var multer=require('multer');var util=require(_0x6a46('0x0'));var path=require(_0x6a46('0x1'));var timeout=require(_0x6a46('0x2'));var express=require('express');var router=express[_0x6a46('0x3')]();var fs_extra=require(_0x6a46('0x4'));var auth=require(_0x6a46('0x5'));var interaction=require(_0x6a46('0x6'));var config=require(_0x6a46('0x7'));var controller=require(_0x6a46('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6a46('0x9')]);router['get'](_0x6a46('0xa'),auth[_0x6a46('0xb')](),controller['describe']);router[_0x6a46('0xc')](_0x6a46('0xd'),auth[_0x6a46('0xb')](),controller[_0x6a46('0xe')]);router[_0x6a46('0xc')](_0x6a46('0xf'),auth['isAuthenticated'](),controller[_0x6a46('0x10')]);router[_0x6a46('0x11')]('/',auth[_0x6a46('0xb')](),controller[_0x6a46('0x12')]);router[_0x6a46('0x13')](_0x6a46('0xf'),controller[_0x6a46('0x14')]);router[_0x6a46('0x15')](_0x6a46('0xf'),auth['isAuthenticated'](),controller[_0x6a46('0x16')]);module[_0x6a46('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 4851e95..8a85a62 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 _0x0bb4=['sequelize','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x2a5c40,_0xe800aa){var _0x7324f2=function(_0x16798b){while(--_0x16798b){_0x2a5c40['push'](_0x2a5c40['shift']());}};_0x7324f2(++_0xe800aa);}(_0x0bb4,0x77));var _0x40bb=function(_0x1f8567,_0x1c394c){_0x1f8567=_0x1f8567-0x0;var _0x4316d5=_0x0bb4[_0x1f8567];return _0x4316d5;};'use strict';var Sequelize=require(_0x40bb('0x0'));module[_0x40bb('0x1')]={'body':{'type':Sequelize['TEXT'](_0x40bb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x40bb('0x4')]('in','out'),'defaultValue':_0x40bb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x40bb('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x48ac=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x365e50,_0x516832){var _0x11f323=function(_0x35d5be){while(--_0x35d5be){_0x365e50['push'](_0x365e50['shift']());}};_0x11f323(++_0x516832);}(_0x48ac,0xe0));var _0xc48a=function(_0x189d19,_0x5b3680){_0x189d19=_0x189d19-0x0;var _0x3a60a4=_0x48ac[_0x189d19];return _0x3a60a4;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'body':{'type':Sequelize['TEXT'](_0xc48a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc48a('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc48a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc48a('0x3')),'defaultValue':_0xc48a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc48a('0x4')]},'providerName':{'type':Sequelize[_0xc48a('0x5')]},'providerResponse':{'type':Sequelize[_0xc48a('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 2b65e3f..05d3f7a 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 _0x4a74=['includeAll','options','find','create','body','params','describe','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','../../config/logger','role','contact','rejectmessage','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','end','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x4a74,0xb6));var _0x44a7=function(_0x2d81d4,_0x325a8e){_0x2d81d4=_0x2d81d4-0x0;var _0x36ac0a=_0x4a74[_0x2d81d4];return _0x36ac0a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x44a7('0x0'));var jsonpatch=require(_0x44a7('0x1'));var rp=require('request-promise');var moment=require(_0x44a7('0x2'));var BPromise=require(_0x44a7('0x3'));var Mustache=require(_0x44a7('0x4'));var util=require(_0x44a7('0x5'));var path=require(_0x44a7('0x6'));var sox=require(_0x44a7('0x7'));var csv=require(_0x44a7('0x8'));var ejs=require(_0x44a7('0x9'));var fs=require('fs');var fs_extra=require(_0x44a7('0xa'));var _=require(_0x44a7('0xb'));var squel=require(_0x44a7('0xc'));var crypto=require(_0x44a7('0xd'));var jsforce=require(_0x44a7('0xe'));var deskjs=require(_0x44a7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x44a7('0x10'));var Papa=require(_0x44a7('0x11'));var Redis=require(_0x44a7('0x12'));var authService=require(_0x44a7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x44a7('0x14'));var hardwareService=require(_0x44a7('0x15'));var logger=require('../../config/logger')(_0x44a7('0x16'));var utils=require(_0x44a7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x44a7('0x18'));var db=require(_0x44a7('0x19'))['db'];config[_0x44a7('0x1a')]=_[_0x44a7('0x1b')](config['redis'],{'host':_0x44a7('0x1c'),'port':0x18eb});var socket=require(_0x44a7('0x1d'))(new Redis(config[_0x44a7('0x1a')]));require(_0x44a7('0x1e'))[_0x44a7('0x1f')](socket);var jayson=require(_0x44a7('0x20'));var client=jayson[_0x44a7('0x21')][_0x44a7('0x22')]({'port':0x232c});var client9002=jayson[_0x44a7('0x21')][_0x44a7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4d061f,_0x3fe63b,_0x2d12f0,_0x43f040){return new BPromise(function(_0x5655c2,_0x4a20ec){var _0x28542e=_0x43f040||client;return _0x28542e['request'](_0x4d061f,_0x2d12f0)[_0x44a7('0x23')](function(_0x4d13ef){logger[_0x44a7('0x24')](_0x44a7('0x25'),_0x3fe63b,_0x44a7('0x26'));logger[_0x44a7('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3fe63b,_0x44a7('0x26'),JSON[_0x44a7('0x28')](_0x4d13ef));if(_0x4d13ef[_0x44a7('0x29')]){if(_0x4d13ef[_0x44a7('0x29')][_0x44a7('0x2a')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3fe63b,_0x4d13ef[_0x44a7('0x29')][_0x44a7('0x2b')]);return _0x4a20ec(_0x4d13ef[_0x44a7('0x29')][_0x44a7('0x2b')]);}logger[_0x44a7('0x29')](_0x44a7('0x25'),_0x3fe63b,_0x4d13ef[_0x44a7('0x29')][_0x44a7('0x2b')]);return _0x5655c2(_0x4d13ef[_0x44a7('0x29')][_0x44a7('0x2b')]);}else{logger[_0x44a7('0x24')](_0x44a7('0x25'),_0x3fe63b,_0x44a7('0x26'));_0x5655c2(_0x4d13ef['result'][_0x44a7('0x2b')]);}})[_0x44a7('0x2c')](function(_0x99366d){logger[_0x44a7('0x29')](_0x44a7('0x25'),_0x3fe63b,_0x99366d);_0x4a20ec(_0x99366d);});});}function respondWithStatusCode(_0x53efb7,_0x1fa707){_0x1fa707=_0x1fa707||0xcc;return function(_0x388d43){if(_0x388d43){return _0x53efb7[_0x44a7('0x2d')](_0x1fa707);}return _0x53efb7[_0x44a7('0x2e')](_0x1fa707)['end']();};}function respondWithResult(_0x1ee4e4,_0x5c4280){_0x5c4280=_0x5c4280||0xc8;return function(_0x38e293){if(_0x38e293){return _0x1ee4e4[_0x44a7('0x2e')](_0x5c4280)[_0x44a7('0x2f')](_0x38e293);}};}function respondWithFilteredResult(_0x44c8bb,_0x58647c){return function(_0x4d2672){if(_0x4d2672){var _0x10b5b5=typeof _0x58647c['offset']===_0x44a7('0x30')&&typeof _0x58647c[_0x44a7('0x31')]===_0x44a7('0x30');var _0x4c5ed7=_0x4d2672[_0x44a7('0x32')];var _0x3e4910=_0x10b5b5?0x0:_0x58647c[_0x44a7('0x33')];var _0x5b318f=_0x10b5b5?_0x4d2672[_0x44a7('0x32')]:_0x58647c['offset']+_0x58647c[_0x44a7('0x31')];var _0x384d74;if(_0x5b318f>=_0x4c5ed7){_0x5b318f=_0x4c5ed7;_0x384d74=0xc8;}else{_0x384d74=0xce;}_0x44c8bb[_0x44a7('0x2e')](_0x384d74);return _0x44c8bb[_0x44a7('0x34')](_0x44a7('0x35'),_0x3e4910+'-'+_0x5b318f+'/'+_0x4c5ed7)['json'](_0x4d2672);}return null;};}function patchUpdates(_0x272fe1){return function(_0x58ee60){try{jsonpatch['apply'](_0x58ee60,_0x272fe1,!![]);}catch(_0x4dc272){return BPromise[_0x44a7('0x36')](_0x4dc272);}return _0x58ee60[_0x44a7('0x37')]();};}function saveUpdates(_0x2c2697,_0x96efd2){return function(_0x3adb17){if(_0x3adb17){return _0x3adb17[_0x44a7('0x38')](_0x2c2697)[_0x44a7('0x23')](function(_0x572e5e){return _0x572e5e;});}return null;};}function removeEntity(_0x22429f,_0x244344){return function(_0x133b36){if(_0x133b36){return _0x133b36[_0x44a7('0x39')]()[_0x44a7('0x23')](function(){_0x22429f['status'](0xcc)[_0x44a7('0x3a')]();});}};}function handleEntityNotFound(_0x1b6e57,_0x32a611){return function(_0x7c53c2){if(!_0x7c53c2){_0x1b6e57['sendStatus'](0x194);}return _0x7c53c2;};}function handleError(_0x34c43b,_0x531fea){_0x531fea=_0x531fea||0x1f4;return function(_0xcb405c){logger[_0x44a7('0x29')](_0xcb405c[_0x44a7('0x3b')]);if(_0xcb405c['name']){delete _0xcb405c['name'];}_0x34c43b[_0x44a7('0x2e')](_0x531fea)[_0x44a7('0x3c')](_0xcb405c);};}exports[_0x44a7('0x3d')]=function(_0x2c7c11,_0x1902fa){var _0x131fe7={},_0x5032ae={},_0x3925e4={'count':0x0,'rows':[]};var _0x1eace4=_[_0x44a7('0x3e')](db[_0x44a7('0x3f')][_0x44a7('0x40')],function(_0x131348){return{'name':_0x131348[_0x44a7('0x41')],'type':_0x131348[_0x44a7('0x42')][_0x44a7('0x43')]};});_0x5032ae[_0x44a7('0x44')]=_[_0x44a7('0x3e')](_0x1eace4,_0x44a7('0x45'));_0x5032ae[_0x44a7('0x46')]=_[_0x44a7('0x47')](_0x2c7c11['query']);_0x5032ae[_0x44a7('0x48')]=_[_0x44a7('0x49')](_0x5032ae['model'],_0x5032ae['query']);_0x131fe7[_0x44a7('0x4a')]=_['intersection'](_0x5032ae[_0x44a7('0x44')],qs[_0x44a7('0x4b')](_0x2c7c11[_0x44a7('0x46')][_0x44a7('0x4b')]));_0x131fe7['attributes']=_0x131fe7[_0x44a7('0x4a')][_0x44a7('0x4c')]?_0x131fe7[_0x44a7('0x4a')]:_0x5032ae[_0x44a7('0x44')];if(!_0x2c7c11[_0x44a7('0x46')][_0x44a7('0x4d')](_0x44a7('0x4e'))){_0x131fe7[_0x44a7('0x31')]=qs[_0x44a7('0x31')](_0x2c7c11[_0x44a7('0x46')][_0x44a7('0x31')]);_0x131fe7[_0x44a7('0x33')]=qs[_0x44a7('0x33')](_0x2c7c11[_0x44a7('0x46')]['offset']);}_0x131fe7[_0x44a7('0x4f')]=qs['sort'](_0x2c7c11['query'][_0x44a7('0x50')]);_0x131fe7[_0x44a7('0x51')]=qs[_0x44a7('0x48')](_[_0x44a7('0x52')](_0x2c7c11['query'],_0x5032ae[_0x44a7('0x48')]),_0x1eace4);if(_0x2c7c11['query'][_0x44a7('0x53')]){_0x131fe7['where']=_[_0x44a7('0x54')](_0x131fe7[_0x44a7('0x51')],{'$or':_[_0x44a7('0x3e')](_0x1eace4,function(_0x941190){if(_0x941190[_0x44a7('0x42')]!==_0x44a7('0x55')){var _0x41d30c={};_0x41d30c[_0x941190[_0x44a7('0x45')]]={'$like':'%'+_0x2c7c11[_0x44a7('0x46')][_0x44a7('0x53')]+'%'};return _0x41d30c;}})});}_0x131fe7=_[_0x44a7('0x54')]({},_0x131fe7,_0x2c7c11['options']);var _0x17dbc8={'where':_0x131fe7[_0x44a7('0x51')]};return db['ChatMessage'][_0x44a7('0x32')](_0x17dbc8)[_0x44a7('0x23')](function(_0x3ccff2){_0x3925e4[_0x44a7('0x32')]=_0x3ccff2;if(_0x2c7c11['query']['includeAll']){_0x131fe7[_0x44a7('0x56')]=[{'all':!![]}];}return db[_0x44a7('0x3f')][_0x44a7('0x57')](_0x131fe7);})[_0x44a7('0x23')](function(_0x1c4702){_0x3925e4[_0x44a7('0x58')]=_0x1c4702;return _0x3925e4;})[_0x44a7('0x23')](respondWithFilteredResult(_0x1902fa,_0x131fe7))[_0x44a7('0x2c')](handleError(_0x1902fa,null));};exports[_0x44a7('0x59')]=function(_0x4c22bf,_0x3cded8){var _0x38a84f={'raw':!![],'where':{'id':_0x4c22bf['params']['id']}},_0x556403={};_0x556403[_0x44a7('0x44')]=_[_0x44a7('0x47')](db[_0x44a7('0x3f')][_0x44a7('0x40')]);_0x556403[_0x44a7('0x46')]=_[_0x44a7('0x47')](_0x4c22bf[_0x44a7('0x46')]);_0x556403[_0x44a7('0x48')]=_['intersection'](_0x556403[_0x44a7('0x44')],_0x556403[_0x44a7('0x46')]);_0x38a84f[_0x44a7('0x4a')]=_[_0x44a7('0x49')](_0x556403[_0x44a7('0x44')],qs[_0x44a7('0x4b')](_0x4c22bf[_0x44a7('0x46')][_0x44a7('0x4b')]));_0x38a84f[_0x44a7('0x4a')]=_0x38a84f[_0x44a7('0x4a')]['length']?_0x38a84f[_0x44a7('0x4a')]:_0x556403['model'];if(_0x4c22bf[_0x44a7('0x46')][_0x44a7('0x5a')]){_0x38a84f[_0x44a7('0x56')]=[{'all':!![]}];}_0x38a84f=_['merge']({},_0x38a84f,_0x4c22bf[_0x44a7('0x5b')]);return db['ChatMessage'][_0x44a7('0x5c')](_0x38a84f)[_0x44a7('0x23')](handleEntityNotFound(_0x3cded8,null))['then'](respondWithResult(_0x3cded8,null))['catch'](handleError(_0x3cded8,null));};exports[_0x44a7('0x5d')]=function(_0x4c99fe,_0x34a1b6){return db[_0x44a7('0x3f')][_0x44a7('0x5d')](_0x4c99fe[_0x44a7('0x5e')],{})[_0x44a7('0x23')](respondWithResult(_0x34a1b6,0xc9))['catch'](handleError(_0x34a1b6,null));};exports['update']=function(_0x637127,_0x46cf78){if(_0x637127[_0x44a7('0x5e')]['id']){delete _0x637127[_0x44a7('0x5e')]['id'];}return db[_0x44a7('0x3f')][_0x44a7('0x5c')]({'where':{'id':_0x637127[_0x44a7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x46cf78,null))['then'](saveUpdates(_0x637127['body'],null))[_0x44a7('0x23')](respondWithResult(_0x46cf78,null))[_0x44a7('0x2c')](handleError(_0x46cf78,null));};exports[_0x44a7('0x39')]=function(_0x5df93f,_0x3c5065){return db[_0x44a7('0x3f')]['find']({'where':{'id':_0x5df93f['params']['id']}})[_0x44a7('0x23')](handleEntityNotFound(_0x3c5065,null))[_0x44a7('0x23')](removeEntity(_0x3c5065,null))['catch'](handleError(_0x3c5065,null));};exports[_0x44a7('0x60')]=function(_0x321963,_0x5b86a5){return db[_0x44a7('0x3f')][_0x44a7('0x60')]()[_0x44a7('0x23')](respondWithResult(_0x5b86a5,null))[_0x44a7('0x2c')](handleError(_0x5b86a5,null));};var interaction_log=require('../../config/logger')(_0x44a7('0x61'));exports[_0x44a7('0x62')]=function(_0x56591a,_0x461e51,_0x402689){var _0x3ca216={'agent':{},'channel':_0x44a7('0x63')};if(_0x56591a['body']['id']){delete _0x56591a[_0x44a7('0x5e')]['id'];}_0x56591a[_0x44a7('0x5e')]['read']=!![];_0x56591a[_0x44a7('0x5e')][_0x44a7('0x64')]=moment()['format'](_0x44a7('0x65'));_0x56591a[_0x44a7('0x5e')][_0x44a7('0x66')]=_0x56591a['body']['UserId']||_0x56591a['user']['id'];_0x3ca216[_0x44a7('0x67')]['id']=_0x56591a[_0x44a7('0x5e')][_0x44a7('0x66')];return db[_0x44a7('0x3f')]['find']({'where':{'id':_0x56591a[_0x44a7('0x5f')]['id'],'UserId':null}})[_0x44a7('0x23')](handleEntityNotFound(_0x461e51,null))[_0x44a7('0x23')](saveUpdates(_0x56591a[_0x44a7('0x5e')],null))[_0x44a7('0x23')](function(_0x3890ec){if(_0x3890ec){_0x3ca216['message']=_0x3890ec['get']({'plain':!![]});return db[_0x44a7('0x68')]['find']({'where':{'id':_0x3890ec[_0x44a7('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x461e51,null))['then'](function(_0x23306f){if(_0x23306f){return _0x23306f[_0x44a7('0x38')]({'UserId':_0x56591a[_0x44a7('0x5e')]['UserId'],'read1stAt':_[_0x44a7('0x6a')](_0x23306f['read1stAt'])?moment()[_0x44a7('0x6b')](_0x44a7('0x65')):undefined});}return null;})[_0x44a7('0x23')](function(_0x2eb01a){if(_0x2eb01a){_0x3ca216[_0x44a7('0x6c')]=_0x2eb01a[_0x44a7('0x6d')]({'plain':!![]});interaction_log[_0x44a7('0x24')](_0x44a7('0x6e'),_0x56591a[_0x44a7('0x6f')]['id'],_0x56591a['user'][_0x44a7('0x45')],_0x56591a[_0x44a7('0x6f')]['role'],_0x3ca216[_0x44a7('0x6c')]['id'],_0x56591a[_0x44a7('0x5e')]?JSON[_0x44a7('0x28')](_0x56591a[_0x44a7('0x5e')]):'null');return respondWithRpcPromise(_0x44a7('0x70'),_0x44a7('0x71'),_0x3ca216);}return null;})[_0x44a7('0x23')](function(_0x18dc29){var _0x3d1d0b=_0x44a7('0x72')+_0x18dc29[_0x44a7('0x2b')]['ContactId'];return db[_0x44a7('0x73')][_0x44a7('0x46')](_0x3d1d0b,{'type':db[_0x44a7('0x74')]['QueryTypes'][_0x44a7('0x75')],'raw':!![]})[_0x44a7('0x23')](function(_0x1cae72){return _0x1cae72;});})[_0x44a7('0x23')](function(_0x221bc3){if(_0x221bc3){_0x3ca216[_0x44a7('0x2b')]['contact']=_0x221bc3[0x0];if(!_0x56591a[_0x44a7('0x5e')]['UserId'])return;return db[_0x44a7('0x76')][_0x44a7('0x5c')]({'where':{'id':_0x56591a[_0x44a7('0x5e')][_0x44a7('0x66')],'role':_0x44a7('0x67')},'attributes':['id',_0x44a7('0x45'),_0x44a7('0x77'),_0x44a7('0x78'),_0x44a7('0x79')],'raw':!![]});}return null;})[_0x44a7('0x23')](function(_0x391abf){if(!_0x391abf)return null;_0x3ca216[_0x44a7('0x2b')][_0x44a7('0x67')]=_0x391abf;return _0x3ca216;})[_0x44a7('0x23')](function(_0x3eef55){if(_0x3eef55){if(_0x56591a[_0x44a7('0x5e')][_0x44a7('0x7a')]){_0x3ca216[_0x44a7('0x2b')][_0x44a7('0x7b')]=util['format'](_0x44a7('0x7c'),_0x56591a[_0x44a7('0x6f')][_0x44a7('0x45')]);_0x3ca216['message']['channel']=_0x3ca216['channel'];_0x3ca216[_0x44a7('0x2b')][_0x44a7('0x7d')]=_0x3ca216[_0x44a7('0x7e')];_0x3ca216[_0x44a7('0x2b')][_0x44a7('0x7f')]='accept';return respondWithRpcPromise(_0x44a7('0x80'),_0x44a7('0x80'),{'event':_0x44a7('0x81'),'message':_[_0x44a7('0x54')](_0x3ca216[_0x44a7('0x2b')],JSON[_0x44a7('0x82')](_0x3ca216[_0x44a7('0x6c')][_0x44a7('0x83')]))},client9002)['then'](function(){return _0x3ca216;});}return _0x3ca216;}return null;})[_0x44a7('0x23')](respondWithResult(_0x461e51,null))['catch'](handleError(_0x461e51,null));};var interaction_log=require(_0x44a7('0x84'))('chat-interactions');exports['reject']=function(_0x30eeeb,_0x5283db,_0x4304b7){var _0x2df67c={'agent':{},'channel':_0x44a7('0x63')};if(_0x30eeeb[_0x44a7('0x5e')]['id']){delete _0x30eeeb['body']['id'];}_0x30eeeb[_0x44a7('0x5e')][_0x44a7('0x66')]=_0x30eeeb[_0x44a7('0x5e')][_0x44a7('0x66')]||_0x30eeeb['user']['id'];_0x2df67c[_0x44a7('0x67')]['id']=_0x30eeeb[_0x44a7('0x5e')][_0x44a7('0x66')];return db[_0x44a7('0x3f')][_0x44a7('0x5c')]({'where':{'id':_0x30eeeb[_0x44a7('0x5f')]['id'],'UserId':null}})[_0x44a7('0x23')](handleEntityNotFound(_0x5283db,null))['then'](function(_0x176a59){if(_0x176a59){_0x2df67c['message']=_0x176a59[_0x44a7('0x6d')]({'plain':!![]});return db[_0x44a7('0x68')][_0x44a7('0x5c')]({'where':{'id':_0x176a59[_0x44a7('0x69')]}});}return null;})[_0x44a7('0x23')](handleEntityNotFound(_0x5283db,null))[_0x44a7('0x23')](function(_0x329ef2){if(_0x329ef2){_0x2df67c['interaction']=_0x329ef2[_0x44a7('0x6d')]({'plain':!![]});interaction_log[_0x44a7('0x24')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30eeeb['user']['id'],_0x30eeeb['user'][_0x44a7('0x45')],_0x30eeeb['user'][_0x44a7('0x85')],_0x2df67c[_0x44a7('0x6c')]['id'],_0x30eeeb[_0x44a7('0x5e')]?JSON[_0x44a7('0x28')](_0x30eeeb[_0x44a7('0x5e')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2df67c);}return null;})[_0x44a7('0x23')](function(_0x375d00){var _0xf60547=_0x44a7('0x72')+_0x375d00[_0x44a7('0x2b')]['ContactId'];return db[_0x44a7('0x73')][_0x44a7('0x46')](_0xf60547,{'type':db[_0x44a7('0x74')]['QueryTypes'][_0x44a7('0x75')],'raw':!![]})[_0x44a7('0x23')](function(_0x295d68){return _0x295d68;});})[_0x44a7('0x23')](function(_0x50df49){if(_0x50df49){_0x2df67c['message'][_0x44a7('0x86')]=_0x50df49[0x0];if(!_0x30eeeb[_0x44a7('0x5e')][_0x44a7('0x66')])return;return db[_0x44a7('0x76')][_0x44a7('0x5c')]({'where':{'id':_0x30eeeb[_0x44a7('0x5e')][_0x44a7('0x66')],'role':_0x44a7('0x67')},'attributes':['id',_0x44a7('0x45'),_0x44a7('0x77'),_0x44a7('0x78'),'internal'],'raw':!![]});}return null;})[_0x44a7('0x23')](function(_0x4fbbf9){if(!_0x4fbbf9)return null;_0x2df67c[_0x44a7('0x2b')]['agent']=_0x4fbbf9;return _0x2df67c;})[_0x44a7('0x23')](function(_0xcf6026){if(_0xcf6026){_0xcf6026[_0x44a7('0x2b')][_0x44a7('0x7b')]=util[_0x44a7('0x6b')](_0x44a7('0x7c'),_0x30eeeb[_0x44a7('0x6f')][_0x44a7('0x45')]);_0xcf6026['message'][_0x44a7('0x7e')]=_0x2df67c[_0x44a7('0x7e')];_0xcf6026[_0x44a7('0x2b')][_0x44a7('0x7d')]=_0x2df67c[_0x44a7('0x7e')];_0xcf6026[_0x44a7('0x2b')][_0x44a7('0x7f')]='reject';respondWithRpcPromise('EventManager',_0x44a7('0x80'),{'event':_0x44a7('0x87'),'message':_['merge'](_0x2df67c[_0x44a7('0x2b')],JSON[_0x44a7('0x82')](_0x2df67c['interaction'][_0x44a7('0x83')]))},client9002);return _0x2df67c;}return null;})[_0x44a7('0x23')](respondWithResult(_0x5283db,null))[_0x44a7('0x2c')](handleError(_0x5283db,null));}; \ No newline at end of file +var _0x224b=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','email','interface','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','destroy','name','send','index','map','ChatMessage','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order'];(function(_0x533290,_0x31e3ae){var _0x23f13d=function(_0x3473fb){while(--_0x3473fb){_0x533290['push'](_0x533290['shift']());}};_0x23f13d(++_0x31e3ae);}(_0x224b,0x1bc));var _0xb224=function(_0x24f31b,_0x5a27fa){_0x24f31b=_0x24f31b-0x0;var _0x3ae7d4=_0x224b[_0x24f31b];return _0x3ae7d4;};'use strict';var emlformat=require(_0xb224('0x0'));var rimraf=require(_0xb224('0x1'));var zipdir=require(_0xb224('0x2'));var jsonpatch=require(_0xb224('0x3'));var rp=require('request-promise');var moment=require(_0xb224('0x4'));var BPromise=require(_0xb224('0x5'));var Mustache=require(_0xb224('0x6'));var util=require(_0xb224('0x7'));var path=require(_0xb224('0x8'));var sox=require(_0xb224('0x9'));var csv=require(_0xb224('0xa'));var ejs=require(_0xb224('0xb'));var fs=require('fs');var fs_extra=require(_0xb224('0xc'));var _=require(_0xb224('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb224('0xe'));var deskjs=require(_0xb224('0xf'));var toCsv=require(_0xb224('0xa'));var querystring=require(_0xb224('0x10'));var Papa=require('papaparse');var Redis=require(_0xb224('0x11'));var authService=require(_0xb224('0x12'));var qs=require(_0xb224('0x13'));var as=require(_0xb224('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb224('0x15'));var utils=require(_0xb224('0x16'));var config=require(_0xb224('0x17'));var licenseUtil=require(_0xb224('0x18'));var db=require('../../mysqldb')['db'];config[_0xb224('0x19')]=_[_0xb224('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb224('0x1b'))(new Redis(config[_0xb224('0x19')]));require('./chatMessage.socket')[_0xb224('0x1c')](socket);var jayson=require(_0xb224('0x1d'));var client=jayson[_0xb224('0x1e')][_0xb224('0x1f')]({'port':0x232c});var client9002=jayson[_0xb224('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1391d5,_0x528206,_0x227d60,_0xfeea56){return new BPromise(function(_0x41a38f,_0x5e412f){var _0x5053d6=_0xfeea56||client;return _0x5053d6[_0xb224('0x20')](_0x1391d5,_0x227d60)[_0xb224('0x21')](function(_0x6467ed){logger[_0xb224('0x22')](_0xb224('0x23'),_0x528206,_0xb224('0x24'));logger[_0xb224('0x25')](_0xb224('0x26'),_0x528206,'request\x20sent',JSON['stringify'](_0x6467ed));if(_0x6467ed['error']){if(_0x6467ed[_0xb224('0x27')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x528206,_0x6467ed[_0xb224('0x27')][_0xb224('0x28')]);return _0x5e412f(_0x6467ed[_0xb224('0x27')][_0xb224('0x28')]);}logger[_0xb224('0x27')](_0xb224('0x23'),_0x528206,_0x6467ed[_0xb224('0x27')]['message']);return _0x41a38f(_0x6467ed[_0xb224('0x27')][_0xb224('0x28')]);}else{logger['info'](_0xb224('0x23'),_0x528206,_0xb224('0x24'));_0x41a38f(_0x6467ed[_0xb224('0x29')][_0xb224('0x28')]);}})[_0xb224('0x2a')](function(_0x3a5961){logger[_0xb224('0x27')]('ChatMessage,\x20%s,\x20%s',_0x528206,_0x3a5961);_0x5e412f(_0x3a5961);});});}function respondWithStatusCode(_0x4ecf33,_0x3cf20d){_0x3cf20d=_0x3cf20d||0xcc;return function(_0x4b357c){if(_0x4b357c){return _0x4ecf33[_0xb224('0x2b')](_0x3cf20d);}return _0x4ecf33[_0xb224('0x2c')](_0x3cf20d)[_0xb224('0x2d')]();};}function respondWithResult(_0x4b06ef,_0x38fc11){_0x38fc11=_0x38fc11||0xc8;return function(_0x27775f){if(_0x27775f){return _0x4b06ef['status'](_0x38fc11)['json'](_0x27775f);}};}function respondWithFilteredResult(_0xde9931,_0x33c4a8){return function(_0x31e552){if(_0x31e552){var _0xa6de89=typeof _0x33c4a8[_0xb224('0x2e')]===_0xb224('0x2f')&&typeof _0x33c4a8[_0xb224('0x30')]===_0xb224('0x2f');var _0x273c2d=_0x31e552[_0xb224('0x31')];var _0x54493d=_0xa6de89?0x0:_0x33c4a8[_0xb224('0x2e')];var _0x44a813=_0xa6de89?_0x31e552[_0xb224('0x31')]:_0x33c4a8[_0xb224('0x2e')]+_0x33c4a8[_0xb224('0x30')];var _0xaf73ed;if(_0x44a813>=_0x273c2d){_0x44a813=_0x273c2d;_0xaf73ed=0xc8;}else{_0xaf73ed=0xce;}_0xde9931['status'](_0xaf73ed);return _0xde9931['set']('Content-Range',_0x54493d+'-'+_0x44a813+'/'+_0x273c2d)[_0xb224('0x32')](_0x31e552);}return null;};}function patchUpdates(_0x29f41f){return function(_0x5a37e7){try{jsonpatch['apply'](_0x5a37e7,_0x29f41f,!![]);}catch(_0x3d6aa0){return BPromise[_0xb224('0x33')](_0x3d6aa0);}return _0x5a37e7[_0xb224('0x34')]();};}function saveUpdates(_0x9ff495,_0x55999a){return function(_0x17c21a){if(_0x17c21a){return _0x17c21a[_0xb224('0x35')](_0x9ff495)[_0xb224('0x21')](function(_0xd7d4be){return _0xd7d4be;});}return null;};}function removeEntity(_0x44953f,_0x27ab77){return function(_0xa7e77e){if(_0xa7e77e){return _0xa7e77e[_0xb224('0x36')]()['then'](function(){_0x44953f[_0xb224('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fdd2,_0x4190b4){return function(_0x23316f){if(!_0x23316f){_0x53fdd2['sendStatus'](0x194);}return _0x23316f;};}function handleError(_0x1e508e,_0x1fcdb8){_0x1fcdb8=_0x1fcdb8||0x1f4;return function(_0x57e839){logger[_0xb224('0x27')](_0x57e839['stack']);if(_0x57e839[_0xb224('0x37')]){delete _0x57e839[_0xb224('0x37')];}_0x1e508e[_0xb224('0x2c')](_0x1fcdb8)[_0xb224('0x38')](_0x57e839);};}exports[_0xb224('0x39')]=function(_0x3c7a6e,_0x5e1c73){var _0x1ca826={},_0x6b9274={},_0x9aa6fb={'count':0x0,'rows':[]};var _0x20512e=_[_0xb224('0x3a')](db[_0xb224('0x3b')][_0xb224('0x3c')],function(_0x151ee8){return{'name':_0x151ee8['fieldName'],'type':_0x151ee8[_0xb224('0x3d')][_0xb224('0x3e')]};});_0x6b9274['model']=_[_0xb224('0x3a')](_0x20512e,'name');_0x6b9274[_0xb224('0x3f')]=_['keys'](_0x3c7a6e[_0xb224('0x3f')]);_0x6b9274[_0xb224('0x40')]=_[_0xb224('0x41')](_0x6b9274[_0xb224('0x42')],_0x6b9274[_0xb224('0x3f')]);_0x1ca826['attributes']=_['intersection'](_0x6b9274[_0xb224('0x42')],qs[_0xb224('0x43')](_0x3c7a6e[_0xb224('0x3f')][_0xb224('0x43')]));_0x1ca826[_0xb224('0x44')]=_0x1ca826[_0xb224('0x44')][_0xb224('0x45')]?_0x1ca826[_0xb224('0x44')]:_0x6b9274[_0xb224('0x42')];if(!_0x3c7a6e[_0xb224('0x3f')][_0xb224('0x46')]('nolimit')){_0x1ca826['limit']=qs[_0xb224('0x30')](_0x3c7a6e[_0xb224('0x3f')][_0xb224('0x30')]);_0x1ca826[_0xb224('0x2e')]=qs[_0xb224('0x2e')](_0x3c7a6e[_0xb224('0x3f')]['offset']);}_0x1ca826[_0xb224('0x47')]=qs['sort'](_0x3c7a6e[_0xb224('0x3f')]['sort']);_0x1ca826[_0xb224('0x48')]=qs['filters'](_['pick'](_0x3c7a6e[_0xb224('0x3f')],_0x6b9274[_0xb224('0x40')]),_0x20512e);if(_0x3c7a6e[_0xb224('0x3f')]['filter']){_0x1ca826['where']=_[_0xb224('0x49')](_0x1ca826[_0xb224('0x48')],{'$or':_[_0xb224('0x3a')](_0x20512e,function(_0x19af37){if(_0x19af37['type']!==_0xb224('0x4a')){var _0x43079c={};_0x43079c[_0x19af37[_0xb224('0x37')]]={'$like':'%'+_0x3c7a6e[_0xb224('0x3f')]['filter']+'%'};return _0x43079c;}})});}_0x1ca826=_[_0xb224('0x49')]({},_0x1ca826,_0x3c7a6e[_0xb224('0x4b')]);var _0x3167a1={'where':_0x1ca826[_0xb224('0x48')]};return db['ChatMessage'][_0xb224('0x31')](_0x3167a1)[_0xb224('0x21')](function(_0x464e90){_0x9aa6fb['count']=_0x464e90;if(_0x3c7a6e[_0xb224('0x3f')][_0xb224('0x4c')]){_0x1ca826[_0xb224('0x4d')]=[{'all':!![]}];}return db[_0xb224('0x3b')][_0xb224('0x4e')](_0x1ca826);})[_0xb224('0x21')](function(_0x53b5e7){_0x9aa6fb[_0xb224('0x4f')]=_0x53b5e7;return _0x9aa6fb;})['then'](respondWithFilteredResult(_0x5e1c73,_0x1ca826))['catch'](handleError(_0x5e1c73,null));};exports[_0xb224('0x50')]=function(_0x2d8a8a,_0xdc61cc){var _0x8cc8af={'raw':!![],'where':{'id':_0x2d8a8a[_0xb224('0x51')]['id']}},_0x5abc48={};_0x5abc48[_0xb224('0x42')]=_['keys'](db['ChatMessage'][_0xb224('0x3c')]);_0x5abc48[_0xb224('0x3f')]=_['keys'](_0x2d8a8a['query']);_0x5abc48[_0xb224('0x40')]=_[_0xb224('0x41')](_0x5abc48[_0xb224('0x42')],_0x5abc48[_0xb224('0x3f')]);_0x8cc8af[_0xb224('0x44')]=_[_0xb224('0x41')](_0x5abc48[_0xb224('0x42')],qs['fields'](_0x2d8a8a[_0xb224('0x3f')][_0xb224('0x43')]));_0x8cc8af[_0xb224('0x44')]=_0x8cc8af['attributes']['length']?_0x8cc8af['attributes']:_0x5abc48['model'];if(_0x2d8a8a[_0xb224('0x3f')][_0xb224('0x4c')]){_0x8cc8af[_0xb224('0x4d')]=[{'all':!![]}];}_0x8cc8af=_['merge']({},_0x8cc8af,_0x2d8a8a['options']);return db[_0xb224('0x3b')][_0xb224('0x52')](_0x8cc8af)['then'](handleEntityNotFound(_0xdc61cc,null))[_0xb224('0x21')](respondWithResult(_0xdc61cc,null))[_0xb224('0x2a')](handleError(_0xdc61cc,null));};exports[_0xb224('0x53')]=function(_0x12f909,_0x2e1b79){return db[_0xb224('0x3b')][_0xb224('0x53')](_0x12f909[_0xb224('0x54')],{})[_0xb224('0x21')](respondWithResult(_0x2e1b79,0xc9))[_0xb224('0x2a')](handleError(_0x2e1b79,null));};exports['update']=function(_0xea352d,_0x10c390){if(_0xea352d['body']['id']){delete _0xea352d[_0xb224('0x54')]['id'];}return db['ChatMessage'][_0xb224('0x52')]({'where':{'id':_0xea352d[_0xb224('0x51')]['id']}})['then'](handleEntityNotFound(_0x10c390,null))[_0xb224('0x21')](saveUpdates(_0xea352d['body'],null))[_0xb224('0x21')](respondWithResult(_0x10c390,null))[_0xb224('0x2a')](handleError(_0x10c390,null));};exports['destroy']=function(_0x4a8c75,_0x5e356a){return db['ChatMessage'][_0xb224('0x52')]({'where':{'id':_0x4a8c75[_0xb224('0x51')]['id']}})[_0xb224('0x21')](handleEntityNotFound(_0x5e356a,null))[_0xb224('0x21')](removeEntity(_0x5e356a,null))[_0xb224('0x2a')](handleError(_0x5e356a,null));};exports[_0xb224('0x55')]=function(_0x290655,_0x160b8f){return db[_0xb224('0x3b')][_0xb224('0x55')]()[_0xb224('0x21')](respondWithResult(_0x160b8f,null))[_0xb224('0x2a')](handleError(_0x160b8f,null));};var interaction_log=require(_0xb224('0x56'))('chat-interactions');exports[_0xb224('0x57')]=function(_0x29552e,_0x35f9d8,_0x17c7f0){var _0x37a922={'agent':{},'channel':_0xb224('0x58')};if(_0x29552e[_0xb224('0x54')]['id']){delete _0x29552e[_0xb224('0x54')]['id'];}_0x29552e[_0xb224('0x54')][_0xb224('0x59')]=!![];_0x29552e[_0xb224('0x54')]['readAt']=moment()[_0xb224('0x5a')](_0xb224('0x5b'));_0x29552e[_0xb224('0x54')]['UserId']=_0x29552e[_0xb224('0x54')][_0xb224('0x5c')]||_0x29552e['user']['id'];_0x37a922[_0xb224('0x5d')]['id']=_0x29552e[_0xb224('0x54')][_0xb224('0x5c')];return db[_0xb224('0x3b')][_0xb224('0x52')]({'where':{'id':_0x29552e[_0xb224('0x51')]['id'],'UserId':null}})[_0xb224('0x21')](handleEntityNotFound(_0x35f9d8,null))['then'](saveUpdates(_0x29552e[_0xb224('0x54')],null))[_0xb224('0x21')](function(_0x55a22b){if(_0x55a22b){_0x37a922[_0xb224('0x28')]=_0x55a22b['get']({'plain':!![]});return db[_0xb224('0x5e')][_0xb224('0x52')]({'where':{'id':_0x55a22b['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x35f9d8,null))[_0xb224('0x21')](function(_0x1f44cb){if(_0x1f44cb){return _0x1f44cb[_0xb224('0x35')]({'UserId':_0x29552e[_0xb224('0x54')]['UserId'],'read1stAt':_['isNil'](_0x1f44cb[_0xb224('0x5f')])?moment()[_0xb224('0x5a')](_0xb224('0x5b')):undefined});}return null;})['then'](function(_0x5b5f7d){if(_0x5b5f7d){_0x37a922[_0xb224('0x60')]=_0x5b5f7d['get']({'plain':!![]});interaction_log[_0xb224('0x22')](_0xb224('0x61'),_0x29552e[_0xb224('0x62')]['id'],_0x29552e[_0xb224('0x62')]['name'],_0x29552e[_0xb224('0x62')][_0xb224('0x63')],_0x37a922[_0xb224('0x60')]['id'],_0x29552e[_0xb224('0x54')]?JSON[_0xb224('0x64')](_0x29552e[_0xb224('0x54')]):_0xb224('0x65'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x37a922);}return null;})['then'](function(_0x1533f0){var _0x3b0470=_0xb224('0x66')+_0x1533f0[_0xb224('0x28')][_0xb224('0x67')];return db[_0xb224('0x68')]['query'](_0x3b0470,{'type':db['Sequelize'][_0xb224('0x69')][_0xb224('0x6a')],'raw':!![]})[_0xb224('0x21')](function(_0x59b58d){return _0x59b58d;});})[_0xb224('0x21')](function(_0x56959b){if(_0x56959b){_0x37a922[_0xb224('0x28')][_0xb224('0x6b')]=_0x56959b[0x0];if(!_0x29552e[_0xb224('0x54')][_0xb224('0x5c')])return;return db[_0xb224('0x6c')]['find']({'where':{'id':_0x29552e['body'][_0xb224('0x5c')],'role':_0xb224('0x5d')},'attributes':['id',_0xb224('0x37'),_0xb224('0x6d'),'email',_0xb224('0x6e')],'raw':!![]});}return null;})[_0xb224('0x21')](function(_0x402862){if(!_0x402862)return null;_0x37a922[_0xb224('0x28')][_0xb224('0x5d')]=_0x402862;return _0x37a922;})[_0xb224('0x21')](function(_0x39eaab){if(_0x39eaab){if(_0x29552e[_0xb224('0x54')][_0xb224('0x6f')]){_0x37a922['message']['interface']=util[_0xb224('0x5a')]('SIP/%s',_0x29552e[_0xb224('0x62')][_0xb224('0x37')]);_0x37a922['message'][_0xb224('0x70')]=_0x37a922[_0xb224('0x70')];_0x37a922[_0xb224('0x28')][_0xb224('0x71')]=_0x37a922[_0xb224('0x70')];_0x37a922['message'][_0xb224('0x72')]=_0xb224('0x57');return respondWithRpcPromise(_0xb224('0x73'),_0xb224('0x73'),{'event':_0xb224('0x74'),'message':_['merge'](_0x37a922[_0xb224('0x28')],JSON[_0xb224('0x75')](_0x37a922[_0xb224('0x60')][_0xb224('0x76')]))},client9002)['then'](function(){return _0x37a922;});}return _0x37a922;}return null;})[_0xb224('0x21')](respondWithResult(_0x35f9d8,null))[_0xb224('0x2a')](handleError(_0x35f9d8,null));};var interaction_log=require('../../config/logger')(_0xb224('0x77'));exports[_0xb224('0x33')]=function(_0x23eb67,_0x13f608,_0x492d38){var _0x2cbcaa={'agent':{},'channel':'chat'};if(_0x23eb67[_0xb224('0x54')]['id']){delete _0x23eb67[_0xb224('0x54')]['id'];}_0x23eb67['body']['UserId']=_0x23eb67[_0xb224('0x54')][_0xb224('0x5c')]||_0x23eb67[_0xb224('0x62')]['id'];_0x2cbcaa['agent']['id']=_0x23eb67[_0xb224('0x54')]['UserId'];return db['ChatMessage'][_0xb224('0x52')]({'where':{'id':_0x23eb67[_0xb224('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13f608,null))[_0xb224('0x21')](function(_0x321a01){if(_0x321a01){_0x2cbcaa[_0xb224('0x28')]=_0x321a01[_0xb224('0x78')]({'plain':!![]});return db[_0xb224('0x5e')][_0xb224('0x52')]({'where':{'id':_0x321a01[_0xb224('0x79')]}});}return null;})['then'](handleEntityNotFound(_0x13f608,null))[_0xb224('0x21')](function(_0x11c211){if(_0x11c211){_0x2cbcaa[_0xb224('0x60')]=_0x11c211[_0xb224('0x78')]({'plain':!![]});interaction_log[_0xb224('0x22')](_0xb224('0x7a'),_0x23eb67['user']['id'],_0x23eb67[_0xb224('0x62')][_0xb224('0x37')],_0x23eb67[_0xb224('0x62')][_0xb224('0x63')],_0x2cbcaa['interaction']['id'],_0x23eb67[_0xb224('0x54')]?JSON[_0xb224('0x64')](_0x23eb67[_0xb224('0x54')]):_0xb224('0x65'));return respondWithRpcPromise(_0xb224('0x7b'),_0xb224('0x7c'),_0x2cbcaa);}return null;})[_0xb224('0x21')](function(_0x19eef9){var _0x4246bc=_0xb224('0x66')+_0x19eef9[_0xb224('0x28')][_0xb224('0x67')];return db[_0xb224('0x68')][_0xb224('0x3f')](_0x4246bc,{'type':db[_0xb224('0x7d')][_0xb224('0x69')]['SELECT'],'raw':!![]})['then'](function(_0x206be1){return _0x206be1;});})[_0xb224('0x21')](function(_0x14b440){if(_0x14b440){_0x2cbcaa[_0xb224('0x28')][_0xb224('0x6b')]=_0x14b440[0x0];if(!_0x23eb67[_0xb224('0x54')]['UserId'])return;return db['User'][_0xb224('0x52')]({'where':{'id':_0x23eb67[_0xb224('0x54')]['UserId'],'role':_0xb224('0x5d')},'attributes':['id','name',_0xb224('0x6d'),_0xb224('0x7e'),'internal'],'raw':!![]});}return null;})[_0xb224('0x21')](function(_0x1a7796){if(!_0x1a7796)return null;_0x2cbcaa[_0xb224('0x28')]['agent']=_0x1a7796;return _0x2cbcaa;})[_0xb224('0x21')](function(_0x2dd4ea){if(_0x2dd4ea){_0x2dd4ea[_0xb224('0x28')][_0xb224('0x7f')]=util['format'](_0xb224('0x80'),_0x23eb67['user'][_0xb224('0x37')]);_0x2dd4ea[_0xb224('0x28')]['channel']=_0x2cbcaa['channel'];_0x2dd4ea[_0xb224('0x28')][_0xb224('0x71')]=_0x2cbcaa['channel'];_0x2dd4ea['message'][_0xb224('0x72')]=_0xb224('0x33');respondWithRpcPromise(_0xb224('0x73'),_0xb224('0x73'),{'event':'rejectmessage','message':_[_0xb224('0x49')](_0x2cbcaa[_0xb224('0x28')],JSON['parse'](_0x2cbcaa[_0xb224('0x60')]['formData']))},client9002);return _0x2cbcaa;}return null;})['then'](respondWithResult(_0x13f608,null))[_0xb224('0x2a')](handleError(_0x13f608,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index be571f4..65e08b4 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 _0xe3a5=['hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0x58b7f4,_0x1fe118){var _0x33aa2c=function(_0x11b9d1){while(--_0x11b9d1){_0x58b7f4['push'](_0x58b7f4['shift']());}};_0x33aa2c(++_0x1fe118);}(_0xe3a5,0xfe));var _0x5e3a=function(_0xaf03f2,_0x43d323){_0xaf03f2=_0xaf03f2-0x0;var _0x4c10f6=_0xe3a5[_0xaf03f2];return _0x4c10f6;};'use strict';var EventEmitter=require(_0x5e3a('0x0'));var ChatMessage=require(_0x5e3a('0x1'))['db'][_0x5e3a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5e3a('0x3')](0x0);var events={'afterCreate':_0x5e3a('0x4'),'afterUpdate':_0x5e3a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3e94ff){return function(_0x2ea912,_0x5460b6,_0x1b7db0){ChatMessageEvents[_0x5e3a('0x6')](_0x3e94ff+':'+_0x2ea912['id'],_0x2ea912);ChatMessageEvents[_0x5e3a('0x6')](_0x3e94ff,_0x2ea912);_0x1b7db0(null);};}for(var e in events){if(events[_0x5e3a('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5e3a('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x1c2e=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5de261,_0x435ef4){var _0x2005cf=function(_0x4b58f3){while(--_0x4b58f3){_0x5de261['push'](_0x5de261['shift']());}};_0x2005cf(++_0x435ef4);}(_0x1c2e,0x144));var _0xe1c2=function(_0x5e2f69,_0x1dc3bf){_0x5e2f69=_0x5e2f69-0x0;var _0x3036f0=_0x1c2e[_0x5e2f69];return _0x3036f0;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xe1c2('0x0'))['db'][_0xe1c2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe1c2('0x2')](0x0);var events={'afterCreate':_0xe1c2('0x3'),'afterUpdate':_0xe1c2('0x4'),'afterDestroy':_0xe1c2('0x5')};function emitEvent(_0x577064){return function(_0x5c5ed3,_0x229552,_0x39d9ae){ChatMessageEvents[_0xe1c2('0x6')](_0x577064+':'+_0x5c5ed3['id'],_0x5c5ed3);ChatMessageEvents[_0xe1c2('0x6')](_0x577064,_0x5c5ed3);_0x39d9ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xe1c2('0x7')](e,emitEvent(event));}}module[_0xe1c2('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 9ff1bad..d57aef1 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 _0x25b5=['../../config/environment','./chatMessage.attributes','chat_messages','fti_chat_messages','body','direction','toLowerCase','out','secret','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2c3f08,_0x380f2b){var _0x4ea2ab=function(_0x4b198a){while(--_0x4b198a){_0x2c3f08['push'](_0x2c3f08['shift']());}};_0x4ea2ab(++_0x380f2b);}(_0x25b5,0x198));var _0x525b=function(_0x42a918,_0x57e80c){_0x42a918=_0x42a918-0x0;var _0x503b10=_0x25b5[_0x42a918];return _0x503b10;};'use strict';var _=require(_0x525b('0x0'));var util=require(_0x525b('0x1'));var logger=require(_0x525b('0x2'))(_0x525b('0x3'));var moment=require(_0x525b('0x4'));var BPromise=require('bluebird');var rp=require(_0x525b('0x5'));var fs=require('fs');var path=require(_0x525b('0x6'));var rimraf=require(_0x525b('0x7'));var config=require(_0x525b('0x8'));var attributes=require(_0x525b('0x9'));module['exports']=function(_0x5cca3f,_0x982127){return _0x5cca3f['define']('ChatMessage',attributes,{'tableName':_0x525b('0xa'),'paranoid':![],'indexes':[{'name':_0x525b('0xb'),'fields':[_0x525b('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xff9920,_0x1b2d14,_0x5997d7){var _0x535dd9=_0x5cca3f['models'];var _0x4a91f0=_0xff9920['get']({'plain':!![]});if(_0x4a91f0[_0x525b('0xd')][_0x525b('0xe')]()==='in'||_0x4a91f0['direction'][_0x525b('0xe')]()===_0x525b('0xf')&&!_0x4a91f0[_0x525b('0x10')]&&!_['isNil'](_0x4a91f0['UserId'])){_0x535dd9[_0x525b('0x11')][_0x525b('0x12')]({'where':{'id':_0x4a91f0[_0x525b('0x13')]}})[_0x525b('0x14')](function(_0xde75c3){if(_0xde75c3){_0xde75c3[_0x525b('0x15')]({'lastMsgAt':_0x4a91f0[_0x525b('0x16')],'lastMsgDirection':_0x4a91f0[_0x525b('0xd')][_0x525b('0xe')]()});}})[_0x525b('0x17')](function(_0xe1ace){console['error'](_0xe1ace);});}_0x5997d7();}},'charset':_0x525b('0x18'),'collate':_0x525b('0x19')});}; \ No newline at end of file +var _0x52b2=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','then','createdAt','catch','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x33273d,_0x433a9a){var _0x579018=function(_0x31f583){while(--_0x31f583){_0x33273d['push'](_0x33273d['shift']());}};_0x579018(++_0x433a9a);}(_0x52b2,0x6a));var _0x252b=function(_0x12ac36,_0x480bd8){_0x12ac36=_0x12ac36-0x0;var _0x232646=_0x52b2[_0x12ac36];return _0x232646;};'use strict';var _=require('lodash');var util=require(_0x252b('0x0'));var logger=require(_0x252b('0x1'))('api');var moment=require(_0x252b('0x2'));var BPromise=require(_0x252b('0x3'));var rp=require(_0x252b('0x4'));var fs=require('fs');var path=require(_0x252b('0x5'));var rimraf=require(_0x252b('0x6'));var config=require(_0x252b('0x7'));var attributes=require(_0x252b('0x8'));module[_0x252b('0x9')]=function(_0x13311c,_0x260aaa){return _0x13311c[_0x252b('0xa')](_0x252b('0xb'),attributes,{'tableName':_0x252b('0xc'),'paranoid':![],'indexes':[{'name':_0x252b('0xd'),'fields':[_0x252b('0xe')],'type':_0x252b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x139d3e,_0x1fc046,_0x1acefc){var _0x17e6c5=_0x13311c[_0x252b('0x10')];var _0x22746c=_0x139d3e[_0x252b('0x11')]({'plain':!![]});if(_0x22746c[_0x252b('0x12')][_0x252b('0x13')]()==='in'||_0x22746c[_0x252b('0x12')][_0x252b('0x13')]()===_0x252b('0x14')&&!_0x22746c[_0x252b('0x15')]&&!_[_0x252b('0x16')](_0x22746c[_0x252b('0x17')])){_0x17e6c5[_0x252b('0x18')]['findOne']({'where':{'id':_0x22746c['ChatInteractionId']}})[_0x252b('0x19')](function(_0x537c69){if(_0x537c69){_0x537c69['update']({'lastMsgAt':_0x22746c[_0x252b('0x1a')],'lastMsgDirection':_0x22746c[_0x252b('0x12')][_0x252b('0x13')]()});}})[_0x252b('0x1b')](function(_0x542d45){console['error'](_0x542d45);});}_0x1acefc();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 65248e2..75232e7 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 _0x719c=['register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','http','defaults','localhost','redis','./chatMessage.socket'];(function(_0x5eddb6,_0x4e41d8){var _0x2d34ff=function(_0x579260){while(--_0x579260){_0x5eddb6['push'](_0x5eddb6['shift']());}};_0x2d34ff(++_0x4e41d8);}(_0x719c,0xae));var _0xc719=function(_0x3f6f78,_0x222d85){_0x3f6f78=_0x3f6f78-0x0;var _0x534963=_0x719c[_0x3f6f78];return _0x534963;};'use strict';var _=require(_0xc719('0x0'));var util=require(_0xc719('0x1'));var moment=require(_0xc719('0x2'));var BPromise=require(_0xc719('0x3'));var rs=require(_0xc719('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc719('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc719('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc719('0x7')]({'port':0x232a});config['redis']=_[_0xc719('0x8')](config['redis'],{'host':_0xc719('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc719('0xa')]));require(_0xc719('0xb'))[_0xc719('0xc')](socket);function respondWithRpcPromise(_0x158027,_0xee2434,_0x15b61e){return new BPromise(function(_0xffb19f,_0x238a10){return client[_0xc719('0xd')](_0x158027,_0x15b61e)[_0xc719('0xe')](function(_0x2a1294){logger[_0xc719('0xf')](_0xc719('0x10'),_0xee2434,_0xc719('0x11'));logger[_0xc719('0x12')](_0xc719('0x13'),_0xee2434,_0xc719('0x11'),JSON[_0xc719('0x14')](_0x2a1294));if(_0x2a1294[_0xc719('0x15')]){if(_0x2a1294[_0xc719('0x15')][_0xc719('0x16')]===0x1f4){logger[_0xc719('0x15')](_0xc719('0x10'),_0xee2434,_0x2a1294[_0xc719('0x15')]['message']);return _0x238a10(_0x2a1294[_0xc719('0x15')][_0xc719('0x17')]);}logger[_0xc719('0x15')](_0xc719('0x10'),_0xee2434,_0x2a1294[_0xc719('0x15')][_0xc719('0x17')]);return _0xffb19f(_0x2a1294[_0xc719('0x15')][_0xc719('0x17')]);}else{logger[_0xc719('0xf')](_0xc719('0x10'),_0xee2434,'request\x20sent');_0xffb19f(_0x2a1294[_0xc719('0x18')]['message']);}})[_0xc719('0x19')](function(_0x11c01b){logger[_0xc719('0x15')](_0xc719('0x10'),_0xee2434,_0x11c01b);_0x238a10(_0x11c01b);});});}exports[_0xc719('0x1a')]=function(_0x561114){var _0x199798=this;return new Promise(function(_0x4699e8,_0x4ad16d){return db[_0xc719('0x1b')]['create'](_0x561114[_0xc719('0x1c')],{'raw':_0x561114[_0xc719('0x1d')]?_0x561114[_0xc719('0x1d')][_0xc719('0x1e')]===undefined?!![]:![]:!![]})[_0xc719('0xe')](function(_0x20c8d8){logger['info'](_0xc719('0x1a'),_0x561114);logger[_0xc719('0x12')](_0xc719('0x1a'),_0x561114,JSON[_0xc719('0x14')](_0x20c8d8));_0x4699e8(_0x20c8d8);})[_0xc719('0x19')](function(_0x376b54){logger['error'](_0xc719('0x1a'),_0x376b54['message'],_0x561114);_0x4ad16d(_0x199798[_0xc719('0x15')](0x1f4,_0x376b54['message']));});});}; \ No newline at end of file +var _0x4bb9=['jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bb9,0x1d2));var _0x94bb=function(_0x5c2c2e,_0x2980cb){_0x5c2c2e=_0x5c2c2e-0x0;var _0x5350a5=_0x4bb9[_0x5c2c2e];return _0x5350a5;};'use strict';var _=require(_0x94bb('0x0'));var util=require(_0x94bb('0x1'));var moment=require(_0x94bb('0x2'));var BPromise=require(_0x94bb('0x3'));var rs=require(_0x94bb('0x4'));var fs=require('fs');var Redis=require(_0x94bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x94bb('0x6'));var logger=require(_0x94bb('0x7'))(_0x94bb('0x8'));var config=require(_0x94bb('0x9'));var jayson=require(_0x94bb('0xa'));var client=jayson['client'][_0x94bb('0xb')]({'port':0x232a});config['redis']=_[_0x94bb('0xc')](config[_0x94bb('0xd')],{'host':_0x94bb('0xe'),'port':0x18eb});var socket=require(_0x94bb('0xf'))(new Redis(config[_0x94bb('0xd')]));require(_0x94bb('0x10'))[_0x94bb('0x11')](socket);function respondWithRpcPromise(_0x4639c3,_0x2c5603,_0x479b40){return new BPromise(function(_0x2f9bc0,_0x4a3c1b){return client[_0x94bb('0x12')](_0x4639c3,_0x479b40)['then'](function(_0x1bf303){logger[_0x94bb('0x13')](_0x94bb('0x14'),_0x2c5603,_0x94bb('0x15'));logger[_0x94bb('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2c5603,_0x94bb('0x15'),JSON[_0x94bb('0x17')](_0x1bf303));if(_0x1bf303[_0x94bb('0x18')]){if(_0x1bf303[_0x94bb('0x18')][_0x94bb('0x19')]===0x1f4){logger[_0x94bb('0x18')]('ChatMessage,\x20%s,\x20%s',_0x2c5603,_0x1bf303[_0x94bb('0x18')][_0x94bb('0x1a')]);return _0x4a3c1b(_0x1bf303['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x2c5603,_0x1bf303['error']['message']);return _0x2f9bc0(_0x1bf303[_0x94bb('0x18')]['message']);}else{logger[_0x94bb('0x13')](_0x94bb('0x14'),_0x2c5603,_0x94bb('0x15'));_0x2f9bc0(_0x1bf303[_0x94bb('0x1b')][_0x94bb('0x1a')]);}})[_0x94bb('0x1c')](function(_0x4ed6d1){logger['error'](_0x94bb('0x14'),_0x2c5603,_0x4ed6d1);_0x4a3c1b(_0x4ed6d1);});});}exports[_0x94bb('0x1d')]=function(_0x4b29b8){var _0x232fcf=this;return new Promise(function(_0x2043d9,_0x53472d){return db[_0x94bb('0x1e')][_0x94bb('0x1f')](_0x4b29b8['body'],{'raw':_0x4b29b8[_0x94bb('0x20')]?_0x4b29b8[_0x94bb('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x94bb('0x21')](function(_0x35010f){logger[_0x94bb('0x13')](_0x94bb('0x1d'),_0x4b29b8);logger[_0x94bb('0x16')](_0x94bb('0x1d'),_0x4b29b8,JSON[_0x94bb('0x17')](_0x35010f));_0x2043d9(_0x35010f);})[_0x94bb('0x1c')](function(_0x72c3e3){logger[_0x94bb('0x18')]('CreateChatMessage',_0x72c3e3['message'],_0x4b29b8);_0x53472d(_0x232fcf[_0x94bb('0x18')](0x1f4,_0x72c3e3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 249e3b6..1ddc6a6 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 _0x79d3=['chatMessage:','./chatMessage.events','remove','emit','removeListener','register','length'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x79d3,0x15f));var _0x379d=function(_0x11fa4b,_0x2e0ec1){_0x11fa4b=_0x11fa4b-0x0;var _0x122a99=_0x79d3[_0x11fa4b];return _0x122a99;};'use strict';var ChatMessageEvents=require(_0x379d('0x0'));var events=['save',_0x379d('0x1'),'update'];function createListener(_0x7c246c,_0x3cbcb1){return function(_0x5af1c4){_0x3cbcb1[_0x379d('0x2')](_0x7c246c,_0x5af1c4);};}function removeListener(_0x2be235,_0x30d8ba){return function(){ChatMessageEvents[_0x379d('0x3')](_0x2be235,_0x30d8ba);};}exports[_0x379d('0x4')]=function(_0x2078a6){for(var _0x2a1b43=0x0,_0x5d1b1e=events[_0x379d('0x5')];_0x2a1b43<_0x5d1b1e;_0x2a1b43++){var _0x4ecccf=events[_0x2a1b43];var _0x3e6051=createListener(_0x379d('0x6')+_0x4ecccf,_0x2078a6);ChatMessageEvents['on'](_0x4ecccf,_0x3e6051);}}; \ No newline at end of file +var _0x304b=['remove','update','emit','register','length','chatMessage:','save'];(function(_0x4fd90d,_0x473b5e){var _0x29dd03=function(_0x92e821){while(--_0x92e821){_0x4fd90d['push'](_0x4fd90d['shift']());}};_0x29dd03(++_0x473b5e);}(_0x304b,0xfb));var _0xb304=function(_0x194e72,_0x527433){_0x194e72=_0x194e72-0x0;var _0x18d631=_0x304b[_0x194e72];return _0x18d631;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb304('0x0'),_0xb304('0x1'),_0xb304('0x2')];function createListener(_0x61902e,_0x2c36b9){return function(_0x1a54ea){_0x2c36b9[_0xb304('0x3')](_0x61902e,_0x1a54ea);};}function removeListener(_0xedd10a,_0x546729){return function(){ChatMessageEvents['removeListener'](_0xedd10a,_0x546729);};}exports[_0xb304('0x4')]=function(_0x301a2e){for(var _0x1eef78=0x0,_0x3eb6e0=events[_0xb304('0x5')];_0x1eef78<_0x3eb6e0;_0x1eef78++){var _0xded429=events[_0x1eef78];var _0x1ce82e=createListener(_0xb304('0x6')+_0xded429,_0x301a2e);ChatMessageEvents['on'](_0xded429,_0x1ce82e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e698bd2..5c4d5bf 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 _0x442b=['chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','/:id','show','post','tracked','chat'];(function(_0x498a3f,_0x1d37f8){var _0x42a1e2=function(_0x2a82ab){while(--_0x2a82ab){_0x498a3f['push'](_0x498a3f['shift']());}};_0x42a1e2(++_0x1d37f8);}(_0x442b,0x1d5));var _0xb442=function(_0x1f7b6c,_0x2cb860){_0x1f7b6c=_0x1f7b6c-0x0;var _0x1a06ed=_0x442b[_0x1f7b6c];return _0x1a06ed;};'use strict';var multer=require(_0xb442('0x0'));var util=require('util');var path=require(_0xb442('0x1'));var timeout=require(_0xb442('0x2'));var express=require(_0xb442('0x3'));var router=express[_0xb442('0x4')]();var fs_extra=require(_0xb442('0x5'));var auth=require(_0xb442('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb442('0x7'));var controller=require(_0xb442('0x8'));router['get']('/',auth[_0xb442('0x9')](),controller['index']);router[_0xb442('0xa')](_0xb442('0xb'),auth[_0xb442('0x9')](),controller['describe']);router['get'](_0xb442('0xc'),auth[_0xb442('0x9')](),controller[_0xb442('0xd')]);router[_0xb442('0xe')]('/',auth[_0xb442('0x9')](),interaction[_0xb442('0xf')](_0xb442('0x10'),_0xb442('0x11')),controller['create']);router[_0xb442('0x12')](_0xb442('0xc'),controller[_0xb442('0x13')]);router[_0xb442('0x12')](_0xb442('0x14'),auth[_0xb442('0x9')](),controller[_0xb442('0x15')]);router['put'](_0xb442('0x16'),auth['isAuthenticated'](),controller[_0xb442('0x17')]);router[_0xb442('0x18')]('/:id',auth[_0xb442('0x9')](),controller[_0xb442('0x19')]);module[_0xb442('0x1a')]=router; \ No newline at end of file +var _0xdc5d=['express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','chat','chatmessage:create','create','put','/:id','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1aa22b,_0x50d3c5){var _0x2a9686=function(_0x175b6b){while(--_0x175b6b){_0x1aa22b['push'](_0x1aa22b['shift']());}};_0x2a9686(++_0x50d3c5);}(_0xdc5d,0x135));var _0xddc5=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0xdc5d[_0x435044];return _0x33d4c6;};'use strict';var multer=require('multer');var util=require(_0xddc5('0x0'));var path=require(_0xddc5('0x1'));var timeout=require(_0xddc5('0x2'));var express=require(_0xddc5('0x3'));var router=express['Router']();var fs_extra=require(_0xddc5('0x4'));var auth=require(_0xddc5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xddc5('0x6'));var controller=require(_0xddc5('0x7'));router[_0xddc5('0x8')]('/',auth[_0xddc5('0x9')](),controller[_0xddc5('0xa')]);router[_0xddc5('0x8')](_0xddc5('0xb'),auth[_0xddc5('0x9')](),controller[_0xddc5('0xc')]);router[_0xddc5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xddc5('0xd')]);router[_0xddc5('0xe')]('/',auth[_0xddc5('0x9')](),interaction['tracked'](_0xddc5('0xf'),_0xddc5('0x10')),controller[_0xddc5('0x11')]);router[_0xddc5('0x12')](_0xddc5('0x13'),controller['update']);router['put']('/:id/accept',auth[_0xddc5('0x9')](),controller[_0xddc5('0x14')]);router[_0xddc5('0x12')](_0xddc5('0x15'),auth[_0xddc5('0x9')](),controller[_0xddc5('0x16')]);router[_0xddc5('0x17')](_0xddc5('0x13'),auth['isAuthenticated'](),controller[_0xddc5('0x18')]);module[_0xddc5('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b21e903..724a5aa 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 _0xd7d8=['TEXT','sequelize','exports'];(function(_0x42c61c,_0x1bd8cb){var _0x35a5f9=function(_0x464a1d){while(--_0x464a1d){_0x42c61c['push'](_0x42c61c['shift']());}};_0x35a5f9(++_0x1bd8cb);}(_0xd7d8,0xd9));var _0x8d7d=function(_0x4c541e,_0x3f5673){_0x4c541e=_0x4c541e-0x0;var _0x465752=_0xd7d8[_0x4c541e];return _0x465752;};'use strict';var Sequelize=require(_0x8d7d('0x0'));module[_0x8d7d('0x1')]={'body':{'type':Sequelize[_0x8d7d('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x20c1=['TEXT','medium','sequelize','exports'];(function(_0x34d054,_0x595d7a){var _0x1adc74=function(_0x4b6de9){while(--_0x4b6de9){_0x34d054['push'](_0x34d054['shift']());}};_0x1adc74(++_0x595d7a);}(_0x20c1,0x10e));var _0x120c=function(_0x1ed5e0,_0x486b89){_0x1ed5e0=_0x1ed5e0-0x0;var _0x2bfeb1=_0x20c1[_0x1ed5e0];return _0x2bfeb1;};'use strict';var Sequelize=require(_0x120c('0x0'));module[_0x120c('0x1')]={'body':{'type':Sequelize[_0x120c('0x2')](_0x120c('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index d54b0b3..e22a7fc 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(_0x516efc,_0x3b94d5){var _0x37ea04=function(_0x140f94){while(--_0x140f94){_0x516efc['push'](_0x516efc['shift']());}};_0x37ea04(++_0x3b94d5);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7a54,0x106));var _0x47a5=function(_0x43a6fd,_0x24428e){_0x43a6fd=_0x43a6fd-0x0;var _0x1756fa=_0x7a54[_0x43a6fd];return _0x1756fa;};'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 c136a27..0e7f741 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 _0x9cd8=['define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports'];(function(_0x2d5e95,_0x4f630f){var _0x7a0f36=function(_0x56be95){while(--_0x56be95){_0x2d5e95['push'](_0x2d5e95['shift']());}};_0x7a0f36(++_0x4f630f);}(_0x9cd8,0x92));var _0x89cd=function(_0x23af0d,_0x386482){_0x23af0d=_0x23af0d-0x0;var _0x24b21a=_0x9cd8[_0x23af0d];return _0x24b21a;};'use strict';var _=require('lodash');var util=require(_0x89cd('0x0'));var logger=require(_0x89cd('0x1'))(_0x89cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x89cd('0x3'));var fs=require('fs');var path=require(_0x89cd('0x4'));var rimraf=require(_0x89cd('0x5'));var config=require('../../config/environment');var attributes=require(_0x89cd('0x6'));module[_0x89cd('0x7')]=function(_0x7f6e09,_0x435f60){return _0x7f6e09[_0x89cd('0x8')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x89cd('0x9'),'collate':_0x89cd('0xa')});}; \ No newline at end of file +var _0xdef2=['path','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x3ec15a,_0xbcba29){var _0x401837=function(_0x497f47){while(--_0x497f47){_0x3ec15a['push'](_0x3ec15a['shift']());}};_0x401837(++_0xbcba29);}(_0xdef2,0x1d0));var _0x2def=function(_0x2e5baf,_0x4b77a1){_0x2e5baf=_0x2e5baf-0x0;var _0x4c0797=_0xdef2[_0x2e5baf];return _0x4c0797;};'use strict';var _=require(_0x2def('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2def('0x1'));var moment=require(_0x2def('0x2'));var BPromise=require(_0x2def('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2def('0x4'));var rimraf=require('rimraf');var config=require(_0x2def('0x5'));var attributes=require(_0x2def('0x6'));module[_0x2def('0x7')]=function(_0x4fea3d,_0x5198bd){return _0x4fea3d[_0x2def('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0x2def('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2def('0xa'),'collate':_0x2def('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 9bd2b5f..abc662e 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 _0x3590=['info','debug','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3590,0x158));var _0x0359=function(_0x3ad638,_0x5a06fb){_0x3ad638=_0x3ad638-0x0;var _0x54f981=_0x3590[_0x3ad638];return _0x54f981;};'use strict';var _=require(_0x0359('0x0'));var util=require(_0x0359('0x1'));var moment=require('moment');var BPromise=require(_0x0359('0x2'));var rs=require(_0x0359('0x3'));var fs=require('fs');var Redis=require(_0x0359('0x4'));var db=require(_0x0359('0x5'))['db'];var utils=require(_0x0359('0x6'));var logger=require(_0x0359('0x7'))(_0x0359('0x8'));var config=require(_0x0359('0x9'));var jayson=require(_0x0359('0xa'));var client=jayson['client'][_0x0359('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2035e5,_0x1c7fc9,_0x4ba0dd){return new BPromise(function(_0x4ebaee,_0x3e9384){return client['request'](_0x2035e5,_0x4ba0dd)[_0x0359('0xc')](function(_0xfaa151){logger[_0x0359('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c7fc9,'request\x20sent');logger[_0x0359('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1c7fc9,_0x0359('0xf'),JSON[_0x0359('0x10')](_0xfaa151));if(_0xfaa151['error']){if(_0xfaa151[_0x0359('0x11')]['code']===0x1f4){logger[_0x0359('0x11')](_0x0359('0x12'),_0x1c7fc9,_0xfaa151['error'][_0x0359('0x13')]);return _0x3e9384(_0xfaa151['error'][_0x0359('0x13')]);}logger[_0x0359('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c7fc9,_0xfaa151[_0x0359('0x11')]['message']);return _0x4ebaee(_0xfaa151[_0x0359('0x11')]['message']);}else{logger[_0x0359('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c7fc9,_0x0359('0xf'));_0x4ebaee(_0xfaa151[_0x0359('0x14')][_0x0359('0x13')]);}})['catch'](function(_0x50896d){logger[_0x0359('0x11')](_0x0359('0x12'),_0x1c7fc9,_0x50896d);_0x3e9384(_0x50896d);});});} \ No newline at end of file +var _0x655b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2b4de5,_0x44f73d){var _0x1a477d=function(_0x1ebae2){while(--_0x1ebae2){_0x2b4de5['push'](_0x2b4de5['shift']());}};_0x1a477d(++_0x44f73d);}(_0x655b,0x10e));var _0xb655=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x655b[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xb655('0x0'));var util=require(_0xb655('0x1'));var moment=require(_0xb655('0x2'));var BPromise=require(_0xb655('0x3'));var rs=require(_0xb655('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb655('0x5'))['db'];var utils=require(_0xb655('0x6'));var logger=require(_0xb655('0x7'))('rpc');var config=require(_0xb655('0x8'));var jayson=require(_0xb655('0x9'));var client=jayson['client'][_0xb655('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37bfeb,_0xc12555,_0x2e8bb8){return new BPromise(function(_0x489a08,_0x57a9c9){return client['request'](_0x37bfeb,_0x2e8bb8)[_0xb655('0xb')](function(_0x53f061){logger[_0xb655('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0xc12555,_0xb655('0xd'));logger[_0xb655('0xe')](_0xb655('0xf'),_0xc12555,_0xb655('0xd'),JSON[_0xb655('0x10')](_0x53f061));if(_0x53f061[_0xb655('0x11')]){if(_0x53f061[_0xb655('0x11')][_0xb655('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xc12555,_0x53f061[_0xb655('0x11')]['message']);return _0x57a9c9(_0x53f061['error'][_0xb655('0x13')]);}logger[_0xb655('0x11')](_0xb655('0x14'),_0xc12555,_0x53f061[_0xb655('0x11')][_0xb655('0x13')]);return _0x489a08(_0x53f061[_0xb655('0x11')][_0xb655('0x13')]);}else{logger['info'](_0xb655('0x14'),_0xc12555,_0xb655('0xd'));_0x489a08(_0x53f061[_0xb655('0x15')][_0xb655('0x13')]);}})[_0xb655('0x16')](function(_0x1282a6){logger[_0xb655('0x11')](_0xb655('0x14'),_0xc12555,_0x1282a6);_0x57a9c9(_0x1282a6);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1573b56..1c606c5 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 _0x0211=['update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x597f39,_0xfd99d){var _0x1b7d9b=function(_0x144417){while(--_0x144417){_0x597f39['push'](_0x597f39['shift']());}};_0x1b7d9b(++_0xfd99d);}(_0x0211,0x107));var _0x1021=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0211[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x1021('0x0'));var util=require(_0x1021('0x1'));var path=require(_0x1021('0x2'));var timeout=require(_0x1021('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1021('0x4'));var auth=require(_0x1021('0x5'));var interaction=require(_0x1021('0x6'));var config=require('../../config/environment');var controller=require(_0x1021('0x7'));router[_0x1021('0x8')]('/',auth[_0x1021('0x9')](),controller[_0x1021('0xa')]);router['get'](_0x1021('0xb'),auth['isAuthenticated'](),controller[_0x1021('0xc')]);router['get'](_0x1021('0xd'),auth[_0x1021('0x9')](),controller[_0x1021('0xe')]);router[_0x1021('0xf')]('/',auth[_0x1021('0x9')](),controller[_0x1021('0x10')]);router['put'](_0x1021('0xd'),auth[_0x1021('0x9')](),controller[_0x1021('0x11')]);router[_0x1021('0x12')](_0x1021('0xd'),auth[_0x1021('0x9')](),controller[_0x1021('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb3c8=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index'];(function(_0x1cf2eb,_0x3fdcb7){var _0x4e8edc=function(_0xdc3f23){while(--_0xdc3f23){_0x1cf2eb['push'](_0x1cf2eb['shift']());}};_0x4e8edc(++_0x3fdcb7);}(_0xb3c8,0x180));var _0x8b3c=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb3c8[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x8b3c('0x0'));var util=require(_0x8b3c('0x1'));var path=require(_0x8b3c('0x2'));var timeout=require(_0x8b3c('0x3'));var express=require('express');var router=express[_0x8b3c('0x4')]();var fs_extra=require(_0x8b3c('0x5'));var auth=require(_0x8b3c('0x6'));var interaction=require(_0x8b3c('0x7'));var config=require(_0x8b3c('0x8'));var controller=require(_0x8b3c('0x9'));router[_0x8b3c('0xa')]('/',auth['isAuthenticated'](),controller[_0x8b3c('0xb')]);router[_0x8b3c('0xa')](_0x8b3c('0xc'),auth[_0x8b3c('0xd')](),controller[_0x8b3c('0xe')]);router['get'](_0x8b3c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8b3c('0x10')]('/',auth[_0x8b3c('0xd')](),controller['create']);router[_0x8b3c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8b3c('0x12')]);router[_0x8b3c('0x13')](_0x8b3c('0xf'),auth['isAuthenticated'](),controller[_0x8b3c('0x14')]);module[_0x8b3c('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 3231693..2f7a767 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 _0xaeb5=['sequelize','STRING','ENUM','timeout','mouseOver'];(function(_0x4b869a,_0x1f993d){var _0x10d713=function(_0x30266e){while(--_0x30266e){_0x4b869a['push'](_0x4b869a['shift']());}};_0x10d713(++_0x1f993d);}(_0xaeb5,0x69));var _0x5aeb=function(_0x53fd58,_0x395fac){_0x53fd58=_0x53fd58-0x0;var _0x5923a7=_0xaeb5[_0x53fd58];return _0x5923a7;};'use strict';var Sequelize=require(_0x5aeb('0x0'));module['exports']={'name':{'type':Sequelize[_0x5aeb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5aeb('0x2')]('mouseOver',_0x5aeb('0x3')),'defaultValue':_0x5aeb('0x4')},'selector':{'type':Sequelize[_0x5aeb('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7176=['INTEGER','sequelize','STRING','mouseOver','timeout'];(function(_0x244c34,_0x4e073f){var _0x538905=function(_0x488130){while(--_0x488130){_0x244c34['push'](_0x244c34['shift']());}};_0x538905(++_0x4e073f);}(_0x7176,0xd3));var _0x6717=function(_0xff1762,_0x5ae05a){_0xff1762=_0xff1762-0x0;var _0x5e5abc=_0x7176[_0xff1762];return _0x5e5abc;};'use strict';var Sequelize=require(_0x6717('0x0'));module['exports']={'name':{'type':Sequelize[_0x6717('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6717('0x2'),_0x6717('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6717('0x1')]},'timeout':{'type':Sequelize[_0x6717('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 496e9e2..cb7af6c 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 _0x8558=['count','set','Content-Range','reject','save','update','then','destroy','name','show','params','model','query','keys','filters','intersection','fields','attributes','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit'];(function(_0x30d253,_0x21f1e1){var _0x3411a8=function(_0x5935ea){while(--_0x5935ea){_0x30d253['push'](_0x30d253['shift']());}};_0x3411a8(++_0x21f1e1);}(_0x8558,0x103));var _0x8855=function(_0x11173e,_0x214c2b){_0x11173e=_0x11173e-0x0;var _0x23136b=_0x8558[_0x11173e];return _0x23136b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8855('0x0'));var zipdir=require(_0x8855('0x1'));var jsonpatch=require(_0x8855('0x2'));var rp=require(_0x8855('0x3'));var moment=require(_0x8855('0x4'));var BPromise=require(_0x8855('0x5'));var Mustache=require(_0x8855('0x6'));var util=require('util');var path=require(_0x8855('0x7'));var sox=require('sox');var csv=require(_0x8855('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8855('0x9'));var _=require(_0x8855('0xa'));var squel=require(_0x8855('0xb'));var crypto=require(_0x8855('0xc'));var jsforce=require(_0x8855('0xd'));var deskjs=require(_0x8855('0xe'));var toCsv=require(_0x8855('0x8'));var querystring=require('querystring');var Papa=require(_0x8855('0xf'));var Redis=require(_0x8855('0x10'));var authService=require(_0x8855('0x11'));var qs=require(_0x8855('0x12'));var as=require(_0x8855('0x13'));var hardwareService=require(_0x8855('0x14'));var logger=require(_0x8855('0x15'))(_0x8855('0x16'));var utils=require('../../config/utils');var config=require(_0x8855('0x17'));var licenseUtil=require(_0x8855('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f428,_0x18e792){_0x18e792=_0x18e792||0xcc;return function(_0x4dfa81){if(_0x4dfa81){return _0x25f428[_0x8855('0x19')](_0x18e792);}return _0x25f428[_0x8855('0x1a')](_0x18e792)[_0x8855('0x1b')]();};}function respondWithResult(_0x25e140,_0x49c654){_0x49c654=_0x49c654||0xc8;return function(_0x30d153){if(_0x30d153){return _0x25e140['status'](_0x49c654)[_0x8855('0x1c')](_0x30d153);}};}function respondWithFilteredResult(_0x52710b,_0x1084b3){return function(_0x466da3){if(_0x466da3){var _0x406b81=typeof _0x1084b3[_0x8855('0x1d')]==='undefined'&&typeof _0x1084b3[_0x8855('0x1e')]==='undefined';var _0x466e7e=_0x466da3[_0x8855('0x1f')];var _0x5d5a44=_0x406b81?0x0:_0x1084b3[_0x8855('0x1d')];var _0x1e5c19=_0x406b81?_0x466da3['count']:_0x1084b3[_0x8855('0x1d')]+_0x1084b3[_0x8855('0x1e')];var _0x48cb72;if(_0x1e5c19>=_0x466e7e){_0x1e5c19=_0x466e7e;_0x48cb72=0xc8;}else{_0x48cb72=0xce;}_0x52710b[_0x8855('0x1a')](_0x48cb72);return _0x52710b[_0x8855('0x20')](_0x8855('0x21'),_0x5d5a44+'-'+_0x1e5c19+'/'+_0x466e7e)['json'](_0x466da3);}return null;};}function patchUpdates(_0x57ef72){return function(_0x5103f3){try{jsonpatch['apply'](_0x5103f3,_0x57ef72,!![]);}catch(_0x151527){return BPromise[_0x8855('0x22')](_0x151527);}return _0x5103f3[_0x8855('0x23')]();};}function saveUpdates(_0x2c3fde,_0x43c2a0){return function(_0xb0d645){if(_0xb0d645){return _0xb0d645[_0x8855('0x24')](_0x2c3fde)[_0x8855('0x25')](function(_0x2e5663){return _0x2e5663;});}return null;};}function removeEntity(_0x24371b,_0x59fed2){return function(_0x4c5514){if(_0x4c5514){return _0x4c5514[_0x8855('0x26')]()[_0x8855('0x25')](function(){_0x24371b[_0x8855('0x1a')](0xcc)[_0x8855('0x1b')]();});}};}function handleEntityNotFound(_0x2c4aa5,_0x320386){return function(_0x695777){if(!_0x695777){_0x2c4aa5[_0x8855('0x19')](0x194);}return _0x695777;};}function handleError(_0x3eb6ec,_0x3dca5b){_0x3dca5b=_0x3dca5b||0x1f4;return function(_0x375972){logger['error'](_0x375972['stack']);if(_0x375972[_0x8855('0x27')]){delete _0x375972[_0x8855('0x27')];}_0x3eb6ec[_0x8855('0x1a')](_0x3dca5b)['send'](_0x375972);};}exports[_0x8855('0x28')]=function(_0x44802d,_0x44e0b4){var _0x346b2={'raw':!![],'where':{'id':_0x44802d[_0x8855('0x29')]['id']}},_0x1f26a9={};_0x1f26a9[_0x8855('0x2a')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x1f26a9[_0x8855('0x2b')]=_[_0x8855('0x2c')](_0x44802d[_0x8855('0x2b')]);_0x1f26a9[_0x8855('0x2d')]=_[_0x8855('0x2e')](_0x1f26a9[_0x8855('0x2a')],_0x1f26a9['query']);_0x346b2['attributes']=_['intersection'](_0x1f26a9[_0x8855('0x2a')],qs[_0x8855('0x2f')](_0x44802d['query'][_0x8855('0x2f')]));_0x346b2['attributes']=_0x346b2[_0x8855('0x30')][_0x8855('0x31')]?_0x346b2[_0x8855('0x30')]:_0x1f26a9[_0x8855('0x2a')];if(_0x44802d['query'][_0x8855('0x32')]){_0x346b2[_0x8855('0x33')]=[{'all':!![]}];}_0x346b2=_['merge']({},_0x346b2,_0x44802d[_0x8855('0x34')]);return db[_0x8855('0x35')][_0x8855('0x36')](_0x346b2)[_0x8855('0x25')](handleEntityNotFound(_0x44e0b4,null))['then'](respondWithResult(_0x44e0b4,null))[_0x8855('0x37')](handleError(_0x44e0b4,null));};exports['create']=function(_0x4b6f9b,_0x3fe877){return db[_0x8855('0x35')][_0x8855('0x38')](_0x4b6f9b['body'],{})[_0x8855('0x25')](respondWithResult(_0x3fe877,0xc9))[_0x8855('0x37')](handleError(_0x3fe877,null));};exports[_0x8855('0x24')]=function(_0x308d58,_0x3e7d3e){if(_0x308d58[_0x8855('0x39')]['id']){delete _0x308d58[_0x8855('0x39')]['id'];}return db[_0x8855('0x35')][_0x8855('0x36')]({'where':{'id':_0x308d58[_0x8855('0x29')]['id']}})['then'](handleEntityNotFound(_0x3e7d3e,null))[_0x8855('0x25')](saveUpdates(_0x308d58[_0x8855('0x39')],null))[_0x8855('0x25')](respondWithResult(_0x3e7d3e,null))[_0x8855('0x37')](handleError(_0x3e7d3e,null));};exports[_0x8855('0x26')]=function(_0x496f66,_0x4a72e4){return db[_0x8855('0x35')]['find']({'where':{'id':_0x496f66['params']['id']}})[_0x8855('0x25')](handleEntityNotFound(_0x4a72e4,null))[_0x8855('0x25')](removeEntity(_0x4a72e4,null))[_0x8855('0x37')](handleError(_0x4a72e4,null));}; \ No newline at end of file +var _0x891b=['error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','update','then','destroy'];(function(_0x24ab19,_0x588849){var _0x148dba=function(_0x4796b4){while(--_0x4796b4){_0x24ab19['push'](_0x24ab19['shift']());}};_0x148dba(++_0x588849);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb891('0x0'));var jsonpatch=require(_0xb891('0x1'));var rp=require('request-promise');var moment=require(_0xb891('0x2'));var BPromise=require(_0xb891('0x3'));var Mustache=require(_0xb891('0x4'));var util=require(_0xb891('0x5'));var path=require('path');var sox=require(_0xb891('0x6'));var csv=require(_0xb891('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb891('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb891('0x9'));var deskjs=require(_0xb891('0xa'));var toCsv=require(_0xb891('0x7'));var querystring=require(_0xb891('0xb'));var Papa=require(_0xb891('0xc'));var Redis=require(_0xb891('0xd'));var authService=require(_0xb891('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb891('0xf'));var hardwareService=require(_0xb891('0x10'));var logger=require(_0xb891('0x11'))(_0xb891('0x12'));var utils=require(_0xb891('0x13'));var config=require(_0xb891('0x14'));var licenseUtil=require(_0xb891('0x15'));var db=require(_0xb891('0x16'))['db'];function respondWithStatusCode(_0x1d49b7,_0x447cee){_0x447cee=_0x447cee||0xcc;return function(_0x3629f0){if(_0x3629f0){return _0x1d49b7['sendStatus'](_0x447cee);}return _0x1d49b7[_0xb891('0x17')](_0x447cee)[_0xb891('0x18')]();};}function respondWithResult(_0x917a1b,_0x57c76b){_0x57c76b=_0x57c76b||0xc8;return function(_0x3fe2a0){if(_0x3fe2a0){return _0x917a1b[_0xb891('0x17')](_0x57c76b)['json'](_0x3fe2a0);}};}function respondWithFilteredResult(_0xca0294,_0x4c0e7c){return function(_0x423dec){if(_0x423dec){var _0x2f8fb0=typeof _0x4c0e7c[_0xb891('0x19')]===_0xb891('0x1a')&&typeof _0x4c0e7c[_0xb891('0x1b')]===_0xb891('0x1a');var _0x592f48=_0x423dec['count'];var _0x88e4ad=_0x2f8fb0?0x0:_0x4c0e7c[_0xb891('0x19')];var _0x10a1b3=_0x2f8fb0?_0x423dec[_0xb891('0x1c')]:_0x4c0e7c[_0xb891('0x19')]+_0x4c0e7c[_0xb891('0x1b')];var _0x2b1afa;if(_0x10a1b3>=_0x592f48){_0x10a1b3=_0x592f48;_0x2b1afa=0xc8;}else{_0x2b1afa=0xce;}_0xca0294[_0xb891('0x17')](_0x2b1afa);return _0xca0294['set']('Content-Range',_0x88e4ad+'-'+_0x10a1b3+'/'+_0x592f48)[_0xb891('0x1d')](_0x423dec);}return null;};}function patchUpdates(_0x5f58dc){return function(_0x2d9995){try{jsonpatch[_0xb891('0x1e')](_0x2d9995,_0x5f58dc,!![]);}catch(_0x5cd70a){return BPromise[_0xb891('0x1f')](_0x5cd70a);}return _0x2d9995['save']();};}function saveUpdates(_0x13c5fd,_0x3a233c){return function(_0x46ad5b){if(_0x46ad5b){return _0x46ad5b[_0xb891('0x20')](_0x13c5fd)[_0xb891('0x21')](function(_0x4418b3){return _0x4418b3;});}return null;};}function removeEntity(_0x14e936,_0x458354){return function(_0xa9c55a){if(_0xa9c55a){return _0xa9c55a[_0xb891('0x22')]()[_0xb891('0x21')](function(){_0x14e936[_0xb891('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2ad7,_0xda220a){return function(_0x36c5a9){if(!_0x36c5a9){_0x1c2ad7['sendStatus'](0x194);}return _0x36c5a9;};}function handleError(_0x1da83d,_0x57ee2f){_0x57ee2f=_0x57ee2f||0x1f4;return function(_0x40cbb7){logger[_0xb891('0x23')](_0x40cbb7[_0xb891('0x24')]);if(_0x40cbb7[_0xb891('0x25')]){delete _0x40cbb7[_0xb891('0x25')];}_0x1da83d['status'](_0x57ee2f)['send'](_0x40cbb7);};}exports[_0xb891('0x26')]=function(_0x54f690,_0x49e864){var _0x1291e3={'raw':!![],'where':{'id':_0x54f690[_0xb891('0x27')]['id']}},_0x27024b={};_0x27024b[_0xb891('0x28')]=_[_0xb891('0x29')](db['ChatProactiveAction'][_0xb891('0x2a')]);_0x27024b['query']=_[_0xb891('0x29')](_0x54f690[_0xb891('0x2b')]);_0x27024b[_0xb891('0x2c')]=_['intersection'](_0x27024b[_0xb891('0x28')],_0x27024b['query']);_0x1291e3['attributes']=_[_0xb891('0x2d')](_0x27024b[_0xb891('0x28')],qs[_0xb891('0x2e')](_0x54f690[_0xb891('0x2b')]['fields']));_0x1291e3[_0xb891('0x2f')]=_0x1291e3[_0xb891('0x2f')][_0xb891('0x30')]?_0x1291e3[_0xb891('0x2f')]:_0x27024b[_0xb891('0x28')];if(_0x54f690['query'][_0xb891('0x31')]){_0x1291e3[_0xb891('0x32')]=[{'all':!![]}];}_0x1291e3=_[_0xb891('0x33')]({},_0x1291e3,_0x54f690[_0xb891('0x34')]);return db[_0xb891('0x35')][_0xb891('0x36')](_0x1291e3)[_0xb891('0x21')](handleEntityNotFound(_0x49e864,null))[_0xb891('0x21')](respondWithResult(_0x49e864,null))[_0xb891('0x37')](handleError(_0x49e864,null));};exports[_0xb891('0x38')]=function(_0x3b6905,_0x57185d){return db['ChatProactiveAction'][_0xb891('0x38')](_0x3b6905['body'],{})[_0xb891('0x21')](respondWithResult(_0x57185d,0xc9))[_0xb891('0x37')](handleError(_0x57185d,null));};exports[_0xb891('0x20')]=function(_0x392b72,_0x13e6ed){if(_0x392b72[_0xb891('0x39')]['id']){delete _0x392b72[_0xb891('0x39')]['id'];}return db[_0xb891('0x35')][_0xb891('0x36')]({'where':{'id':_0x392b72[_0xb891('0x27')]['id']}})['then'](handleEntityNotFound(_0x13e6ed,null))[_0xb891('0x21')](saveUpdates(_0x392b72['body'],null))[_0xb891('0x21')](respondWithResult(_0x13e6ed,null))['catch'](handleError(_0x13e6ed,null));};exports[_0xb891('0x22')]=function(_0x58dade,_0x137c69){return db[_0xb891('0x35')][_0xb891('0x36')]({'where':{'id':_0x58dade[_0xb891('0x27')]['id']}})[_0xb891('0x21')](handleEntityNotFound(_0x137c69,null))[_0xb891('0x21')](removeEntity(_0x137c69,null))[_0xb891('0x37')](handleError(_0x137c69,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 62a3211..6c2d4ff 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 _0x6669=['api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','util','../../config/logger'];(function(_0x402013,_0x87b890){var _0x3112e9=function(_0x5c84ff){while(--_0x5c84ff){_0x402013['push'](_0x402013['shift']());}};_0x3112e9(++_0x87b890);}(_0x6669,0x1ed));var _0x9666=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x6669[_0x2261ce];return _0x524640;};'use strict';var _=require('lodash');var util=require(_0x9666('0x0'));var logger=require(_0x9666('0x1'))(_0x9666('0x2'));var moment=require(_0x9666('0x3'));var BPromise=require(_0x9666('0x4'));var rp=require(_0x9666('0x5'));var fs=require('fs');var path=require(_0x9666('0x6'));var rimraf=require('rimraf');var config=require(_0x9666('0x7'));var attributes=require(_0x9666('0x8'));module[_0x9666('0x9')]=function(_0x4a1a0d,_0x389264){return _0x4a1a0d[_0x9666('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06f3=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x21e0a9,_0x5edd42){var _0x2a12f5=function(_0x3c53a4){while(--_0x3c53a4){_0x21e0a9['push'](_0x21e0a9['shift']());}};_0x2a12f5(++_0x5edd42);}(_0x06f3,0xbe));var _0x306f=function(_0x56e2ed,_0x1c4781){_0x56e2ed=_0x56e2ed-0x0;var _0x5237b2=_0x06f3[_0x56e2ed];return _0x5237b2;};'use strict';var _=require(_0x306f('0x0'));var util=require(_0x306f('0x1'));var logger=require(_0x306f('0x2'))(_0x306f('0x3'));var moment=require(_0x306f('0x4'));var BPromise=require('bluebird');var rp=require(_0x306f('0x5'));var fs=require('fs');var path=require(_0x306f('0x6'));var rimraf=require(_0x306f('0x7'));var config=require(_0x306f('0x8'));var attributes=require(_0x306f('0x9'));module[_0x306f('0xa')]=function(_0x14ff57,_0x5b2643){return _0x14ff57[_0x306f('0xb')](_0x306f('0xc'),attributes,{'tableName':_0x306f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 081fe08..4069bae 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 _0xe738=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2e775c,_0x5ead94){var _0xffcb62=function(_0xae6ff1){while(--_0xae6ff1){_0x2e775c['push'](_0x2e775c['shift']());}};_0xffcb62(++_0x5ead94);}(_0xe738,0xcb));var _0x8e73=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe738[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x8e73('0x0'));var util=require('util');var moment=require(_0x8e73('0x1'));var BPromise=require(_0x8e73('0x2'));var rs=require(_0x8e73('0x3'));var fs=require('fs');var Redis=require(_0x8e73('0x4'));var db=require(_0x8e73('0x5'))['db'];var utils=require(_0x8e73('0x6'));var logger=require(_0x8e73('0x7'))(_0x8e73('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e73('0x9')][_0x8e73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31b7c7,_0x178561,_0x58ee5e){return new BPromise(function(_0x2b0c24,_0x33fa75){return client[_0x8e73('0xb')](_0x31b7c7,_0x58ee5e)[_0x8e73('0xc')](function(_0x405e9a){logger[_0x8e73('0xd')](_0x8e73('0xe'),_0x178561,_0x8e73('0xf'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x178561,'request\x20sent',JSON[_0x8e73('0x10')](_0x405e9a));if(_0x405e9a[_0x8e73('0x11')]){if(_0x405e9a[_0x8e73('0x11')][_0x8e73('0x12')]===0x1f4){logger[_0x8e73('0x11')](_0x8e73('0xe'),_0x178561,_0x405e9a['error'][_0x8e73('0x13')]);return _0x33fa75(_0x405e9a[_0x8e73('0x11')]['message']);}logger[_0x8e73('0x11')](_0x8e73('0xe'),_0x178561,_0x405e9a[_0x8e73('0x11')]['message']);return _0x2b0c24(_0x405e9a[_0x8e73('0x11')][_0x8e73('0x13')]);}else{logger[_0x8e73('0xd')](_0x8e73('0xe'),_0x178561,'request\x20sent');_0x2b0c24(_0x405e9a[_0x8e73('0x14')]['message']);}})[_0x8e73('0x15')](function(_0x4690fe){logger['error'](_0x8e73('0xe'),_0x178561,_0x4690fe);_0x33fa75(_0x4690fe);});});} \ No newline at end of file +var _0xee2a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','moment'];(function(_0x4dc114,_0x3e6e48){var _0x2d02b8=function(_0x2f9e99){while(--_0x2f9e99){_0x4dc114['push'](_0x4dc114['shift']());}};_0x2d02b8(++_0x3e6e48);}(_0xee2a,0x1cc));var _0xaee2=function(_0x10ac1c,_0x1e6143){_0x10ac1c=_0x10ac1c-0x0;var _0x8ecd64=_0xee2a[_0x10ac1c];return _0x8ecd64;};'use strict';var _=require('lodash');var util=require(_0xaee2('0x0'));var moment=require(_0xaee2('0x1'));var BPromise=require(_0xaee2('0x2'));var rs=require(_0xaee2('0x3'));var fs=require('fs');var Redis=require(_0xaee2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaee2('0x5'));var logger=require(_0xaee2('0x6'))(_0xaee2('0x7'));var config=require(_0xaee2('0x8'));var jayson=require(_0xaee2('0x9'));var client=jayson[_0xaee2('0xa')][_0xaee2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a6e11,_0x16899c,_0x36e0aa){return new BPromise(function(_0xd288cd,_0x242c57){return client[_0xaee2('0xc')](_0x2a6e11,_0x36e0aa)['then'](function(_0x296342){logger['info'](_0xaee2('0xd'),_0x16899c,_0xaee2('0xe'));logger[_0xaee2('0xf')](_0xaee2('0x10'),_0x16899c,'request\x20sent',JSON['stringify'](_0x296342));if(_0x296342[_0xaee2('0x11')]){if(_0x296342[_0xaee2('0x11')]['code']===0x1f4){logger['error'](_0xaee2('0xd'),_0x16899c,_0x296342[_0xaee2('0x11')][_0xaee2('0x12')]);return _0x242c57(_0x296342[_0xaee2('0x11')][_0xaee2('0x12')]);}logger[_0xaee2('0x11')](_0xaee2('0xd'),_0x16899c,_0x296342['error'][_0xaee2('0x12')]);return _0xd288cd(_0x296342[_0xaee2('0x11')][_0xaee2('0x12')]);}else{logger[_0xaee2('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x16899c,'request\x20sent');_0xd288cd(_0x296342[_0xaee2('0x14')][_0xaee2('0x12')]);}})[_0xaee2('0x15')](function(_0xa1ea53){logger[_0xaee2('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x16899c,_0xa1ea53);_0x242c57(_0xa1ea53);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c38aeb3..17b16ef 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x3cf080,_0x5e475f){var _0x1fac5f=function(_0x430849){while(--_0x430849){_0x3cf080['push'](_0x3cf080['shift']());}};_0x1fac5f(++_0x5e475f);}(_0xeda8,0x104));var _0x8eda=function(_0x3212cd,_0x162636){_0x3212cd=_0x3212cd-0x0;var _0x36b847=_0xeda8[_0x3212cd];return _0x36b847;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router; \ No newline at end of file +var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x5ae5c3,_0x1b5768){var _0x31a216=function(_0x2212d8){while(--_0x2212d8){_0x5ae5c3['push'](_0x5ae5c3['shift']());}};_0x31a216(++_0x1b5768);}(_0x1cb9,0x14e));var _0x91cb=function(_0x10f048,_0x5e9acc){_0x10f048=_0x10f048-0x0;var _0x4de825=_0x1cb9[_0x10f048];return _0x4de825;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7deeebd..c8cdb4e 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 _0x64fc=['ENUM','rrmemory','beepall','sequelize','exports','name','STRING','INTEGER'];(function(_0x183c10,_0x138c39){var _0x4eb944=function(_0x5aa339){while(--_0x5aa339){_0x183c10['push'](_0x183c10['shift']());}};_0x4eb944(++_0x138c39);}(_0x64fc,0x1c3));var _0xc64f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x64fc[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0xc64f('0x0'));module[_0xc64f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc64f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc64f('0x3')]},'timeout':{'type':Sequelize[_0xc64f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc64f('0x5')](_0xc64f('0x6'),_0xc64f('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x3d6a=['STRING','name','INTEGER','ENUM','sequelize','exports'];(function(_0x25af60,_0x2cee79){var _0x1b0bd9=function(_0x532550){while(--_0x532550){_0x25af60['push'](_0x25af60['shift']());}};_0x1b0bd9(++_0x2cee79);}(_0x3d6a,0xf4));var _0xa3d6=function(_0x4df737,_0x37edc3){_0x4df737=_0x4df737-0x0;var _0x41e33f=_0x3d6a[_0x4df737];return _0x41e33f;};'use strict';var Sequelize=require(_0xa3d6('0x0'));module[_0xa3d6('0x1')]={'name':{'type':Sequelize[_0xa3d6('0x2')],'unique':_0xa3d6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa3d6('0x2')]},'timeout':{'type':Sequelize[_0xa3d6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa3d6('0x5')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index a63ee13..843f804 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 _0x3c3b=['QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','code','error','message','catch','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','index','map','rawAttributes','type','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','ChatQueue','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','order','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','createdAt','getTeams','addTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','each','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x18f8d2,_0xbb6e1f){var _0x5743da=function(_0x234cf3){while(--_0x234cf3){_0x18f8d2['push'](_0x18f8d2['shift']());}};_0x5743da(++_0xbb6e1f);}(_0x3c3b,0x13d));var _0xb3c3=function(_0x589dcc,_0x5e3ee2){_0x589dcc=_0x589dcc-0x0;var _0x60e00d=_0x3c3b[_0x589dcc];return _0x60e00d;};'use strict';var emlformat=require(_0xb3c3('0x0'));var rimraf=require(_0xb3c3('0x1'));var zipdir=require(_0xb3c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3c3('0x3'));var moment=require(_0xb3c3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb3c3('0x5'));var csv=require(_0xb3c3('0x6'));var ejs=require(_0xb3c3('0x7'));var fs=require('fs');var fs_extra=require(_0xb3c3('0x8'));var _=require(_0xb3c3('0x9'));var squel=require('squel');var crypto=require(_0xb3c3('0xa'));var jsforce=require(_0xb3c3('0xb'));var deskjs=require(_0xb3c3('0xc'));var toCsv=require(_0xb3c3('0x6'));var querystring=require(_0xb3c3('0xd'));var Papa=require(_0xb3c3('0xe'));var Redis=require(_0xb3c3('0xf'));var authService=require(_0xb3c3('0x10'));var qs=require(_0xb3c3('0x11'));var as=require(_0xb3c3('0x12'));var hardwareService=require(_0xb3c3('0x13'));var logger=require(_0xb3c3('0x14'))(_0xb3c3('0x15'));var utils=require(_0xb3c3('0x16'));var config=require(_0xb3c3('0x17'));var licenseUtil=require(_0xb3c3('0x18'));var db=require(_0xb3c3('0x19'))['db'];config[_0xb3c3('0x1a')]=_[_0xb3c3('0x1b')](config[_0xb3c3('0x1a')],{'host':_0xb3c3('0x1c'),'port':0x18eb});var socket=require(_0xb3c3('0x1d'))(new Redis(config['redis']));require(_0xb3c3('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb3c3('0x1f')][_0xb3c3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x122654,_0x4d87f3,_0x208fb1,_0xcd81df){return new BPromise(function(_0x2215c8,_0x4dd77d){var _0x1ab90b=_0xcd81df||client;return _0x1ab90b[_0xb3c3('0x21')](_0x122654,_0x208fb1)[_0xb3c3('0x22')](function(_0x4aa144){logger[_0xb3c3('0x23')](_0xb3c3('0x24'),_0x4d87f3,_0xb3c3('0x25'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d87f3,'request\x20sent',JSON['stringify'](_0x4aa144));if(_0x4aa144['error']){if(_0x4aa144['error'][_0xb3c3('0x26')]===0x1f4){logger[_0xb3c3('0x27')]('ChatQueue,\x20%s,\x20%s',_0x4d87f3,_0x4aa144[_0xb3c3('0x27')][_0xb3c3('0x28')]);return _0x4dd77d(_0x4aa144[_0xb3c3('0x27')]['message']);}logger[_0xb3c3('0x27')](_0xb3c3('0x24'),_0x4d87f3,_0x4aa144[_0xb3c3('0x27')][_0xb3c3('0x28')]);return _0x2215c8(_0x4aa144[_0xb3c3('0x27')][_0xb3c3('0x28')]);}else{logger[_0xb3c3('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4d87f3,_0xb3c3('0x25'));_0x2215c8(_0x4aa144['result'][_0xb3c3('0x28')]);}})[_0xb3c3('0x29')](function(_0xe5dbec){logger[_0xb3c3('0x27')](_0xb3c3('0x24'),_0x4d87f3,_0xe5dbec);_0x4dd77d(_0xe5dbec);});});}function respondWithStatusCode(_0x448b92,_0x4dbc6a){_0x4dbc6a=_0x4dbc6a||0xcc;return function(_0x356281){if(_0x356281){return _0x448b92[_0xb3c3('0x2a')](_0x4dbc6a);}return _0x448b92['status'](_0x4dbc6a)[_0xb3c3('0x2b')]();};}function respondWithResult(_0xbbc06c,_0x4f959c){_0x4f959c=_0x4f959c||0xc8;return function(_0x3919b8){if(_0x3919b8){return _0xbbc06c['status'](_0x4f959c)[_0xb3c3('0x2c')](_0x3919b8);}};}function respondWithFilteredResult(_0xea57de,_0xf90548){return function(_0x41e218){if(_0x41e218){var _0x3d6d24=typeof _0xf90548[_0xb3c3('0x2d')]==='undefined'&&typeof _0xf90548[_0xb3c3('0x2e')]===_0xb3c3('0x2f');var _0x2d4fd3=_0x41e218['count'];var _0x82de3f=_0x3d6d24?0x0:_0xf90548[_0xb3c3('0x2d')];var _0x82eee5=_0x3d6d24?_0x41e218[_0xb3c3('0x30')]:_0xf90548['offset']+_0xf90548['limit'];var _0x525af9;if(_0x82eee5>=_0x2d4fd3){_0x82eee5=_0x2d4fd3;_0x525af9=0xc8;}else{_0x525af9=0xce;}_0xea57de[_0xb3c3('0x31')](_0x525af9);return _0xea57de['set'](_0xb3c3('0x32'),_0x82de3f+'-'+_0x82eee5+'/'+_0x2d4fd3)[_0xb3c3('0x2c')](_0x41e218);}return null;};}function patchUpdates(_0xb4af21){return function(_0x324284){try{jsonpatch[_0xb3c3('0x33')](_0x324284,_0xb4af21,!![]);}catch(_0x56f669){return BPromise[_0xb3c3('0x34')](_0x56f669);}return _0x324284[_0xb3c3('0x35')]();};}function saveUpdates(_0x27c176,_0x395bf3){return function(_0x4c3163){if(_0x4c3163){return _0x4c3163[_0xb3c3('0x36')](_0x27c176)[_0xb3c3('0x22')](function(_0x1a842f){return _0x1a842f;});}return null;};}function removeEntity(_0x329b97,_0x56f1df){return function(_0x2a7e9e){if(_0x2a7e9e){return _0x2a7e9e[_0xb3c3('0x37')]()[_0xb3c3('0x22')](function(){var _0x450e3d=_0x2a7e9e[_0xb3c3('0x38')]({'plain':!![]});var _0x1675c3='ChatQueues';return db['UserProfileResource'][_0xb3c3('0x37')]({'where':{'type':_0x1675c3,'resourceId':_0x450e3d['id']}})[_0xb3c3('0x22')](function(){return _0x2a7e9e;});})[_0xb3c3('0x22')](function(){_0x329b97[_0xb3c3('0x31')](0xcc)[_0xb3c3('0x2b')]();});}};}function handleEntityNotFound(_0x3ab412,_0x394852){return function(_0x7d13e3){if(!_0x7d13e3){_0x3ab412['sendStatus'](0x194);}return _0x7d13e3;};}function handleError(_0x2a1e82,_0x3224a3){_0x3224a3=_0x3224a3||0x1f4;return function(_0x5d2e16){logger['error'](_0x5d2e16[_0xb3c3('0x39')]);if(_0x5d2e16['name']){delete _0x5d2e16[_0xb3c3('0x3a')];}_0x2a1e82[_0xb3c3('0x31')](_0x3224a3)[_0xb3c3('0x3b')](_0x5d2e16);};}exports[_0xb3c3('0x3c')]=function(_0x3bd693,_0x45a7d1){var _0x514b02={},_0x2e6cf5={},_0x243dda={'count':0x0,'rows':[]};var _0x42b58c=_[_0xb3c3('0x3d')](db['ChatQueue'][_0xb3c3('0x3e')],function(_0x5d1e95){return{'name':_0x5d1e95['fieldName'],'type':_0x5d1e95[_0xb3c3('0x3f')]['key']};});_0x2e6cf5['model']=_['map'](_0x42b58c,'name');_0x2e6cf5[_0xb3c3('0x40')]=_['keys'](_0x3bd693['query']);_0x2e6cf5[_0xb3c3('0x41')]=_[_0xb3c3('0x42')](_0x2e6cf5['model'],_0x2e6cf5[_0xb3c3('0x40')]);_0x514b02[_0xb3c3('0x43')]=_[_0xb3c3('0x42')](_0x2e6cf5['model'],qs[_0xb3c3('0x44')](_0x3bd693['query']['fields']));_0x514b02[_0xb3c3('0x43')]=_0x514b02[_0xb3c3('0x43')][_0xb3c3('0x45')]?_0x514b02[_0xb3c3('0x43')]:_0x2e6cf5[_0xb3c3('0x46')];if(!_0x3bd693['query'][_0xb3c3('0x47')](_0xb3c3('0x48'))){_0x514b02[_0xb3c3('0x2e')]=qs[_0xb3c3('0x2e')](_0x3bd693[_0xb3c3('0x40')]['limit']);_0x514b02[_0xb3c3('0x2d')]=qs[_0xb3c3('0x2d')](_0x3bd693[_0xb3c3('0x40')][_0xb3c3('0x2d')]);}_0x514b02['order']=qs['sort'](_0x3bd693[_0xb3c3('0x40')][_0xb3c3('0x49')]);_0x514b02[_0xb3c3('0x4a')]=qs['filters'](_[_0xb3c3('0x4b')](_0x3bd693[_0xb3c3('0x40')],_0x2e6cf5[_0xb3c3('0x41')]),_0x42b58c);if(_0x3bd693[_0xb3c3('0x40')][_0xb3c3('0x4c')]){_0x514b02[_0xb3c3('0x4a')]=_['merge'](_0x514b02['where'],{'$or':_[_0xb3c3('0x3d')](_0x42b58c,function(_0x3599cd){if(_0x3599cd[_0xb3c3('0x3f')]!==_0xb3c3('0x4d')){var _0x565ca5={};_0x565ca5[_0x3599cd[_0xb3c3('0x3a')]]={'$like':'%'+_0x3bd693[_0xb3c3('0x40')][_0xb3c3('0x4c')]+'%'};return _0x565ca5;}})});}_0x514b02=_[_0xb3c3('0x4e')]({},_0x514b02,_0x3bd693[_0xb3c3('0x4f')]);var _0x2ea49f={'where':_0x514b02[_0xb3c3('0x4a')]};return db['ChatQueue'][_0xb3c3('0x30')](_0x2ea49f)[_0xb3c3('0x22')](function(_0x1902a6){_0x243dda[_0xb3c3('0x30')]=_0x1902a6;if(_0x3bd693[_0xb3c3('0x40')]['includeAll']){_0x514b02[_0xb3c3('0x50')]=[{'all':!![]}];}return db['ChatQueue'][_0xb3c3('0x51')](_0x514b02);})[_0xb3c3('0x22')](function(_0x4b71e7){_0x243dda[_0xb3c3('0x52')]=_0x4b71e7;return _0x243dda;})[_0xb3c3('0x22')](respondWithFilteredResult(_0x45a7d1,_0x514b02))[_0xb3c3('0x29')](handleError(_0x45a7d1,null));};exports[_0xb3c3('0x53')]=function(_0x5776b0,_0x2ebaa){var _0x2dcfeb={'raw':!![],'where':{'id':_0x5776b0[_0xb3c3('0x54')]['id']}},_0x2a470d={};_0x2a470d[_0xb3c3('0x46')]=_[_0xb3c3('0x55')](db[_0xb3c3('0x56')][_0xb3c3('0x3e')]);_0x2a470d[_0xb3c3('0x40')]=_[_0xb3c3('0x55')](_0x5776b0[_0xb3c3('0x40')]);_0x2a470d[_0xb3c3('0x41')]=_['intersection'](_0x2a470d[_0xb3c3('0x46')],_0x2a470d[_0xb3c3('0x40')]);_0x2dcfeb[_0xb3c3('0x43')]=_[_0xb3c3('0x42')](_0x2a470d['model'],qs[_0xb3c3('0x44')](_0x5776b0[_0xb3c3('0x40')][_0xb3c3('0x44')]));_0x2dcfeb['attributes']=_0x2dcfeb[_0xb3c3('0x43')]['length']?_0x2dcfeb[_0xb3c3('0x43')]:_0x2a470d['model'];if(_0x5776b0[_0xb3c3('0x40')]['includeAll']){_0x2dcfeb['include']=[{'all':!![]}];}_0x2dcfeb=_[_0xb3c3('0x4e')]({},_0x2dcfeb,_0x5776b0[_0xb3c3('0x4f')]);return db[_0xb3c3('0x56')][_0xb3c3('0x57')](_0x2dcfeb)[_0xb3c3('0x22')](handleEntityNotFound(_0x2ebaa,null))['then'](respondWithResult(_0x2ebaa,null))[_0xb3c3('0x29')](handleError(_0x2ebaa,null));};exports[_0xb3c3('0x58')]=function(_0x2c4dec,_0x4b36b4){return db['ChatQueue'][_0xb3c3('0x58')](_0x2c4dec['body'],{})['then'](function(_0x589d69){var _0x2afbd9=_0x2c4dec['user'][_0xb3c3('0x38')]({'plain':!![]});if(!_0x2afbd9)throw new Error(_0xb3c3('0x59'));if(_0x2afbd9['role']===_0xb3c3('0x5a')){var _0x346c83=_0x589d69[_0xb3c3('0x38')]({'plain':!![]});var _0x3e429e=_0xb3c3('0x5b');return db[_0xb3c3('0x5c')][_0xb3c3('0x57')]({'where':{'name':_0x3e429e,'userProfileId':_0x2afbd9[_0xb3c3('0x5d')]},'raw':!![]})[_0xb3c3('0x22')](function(_0x31f48d){if(_0x31f48d&&_0x31f48d[_0xb3c3('0x5e')]===0x0){return db[_0xb3c3('0x5f')]['create']({'name':_0x346c83['name'],'resourceId':_0x346c83['id'],'type':_0x31f48d[_0xb3c3('0x3a')],'sectionId':_0x31f48d['id']},{})[_0xb3c3('0x22')](function(){return _0x589d69;});}else{return _0x589d69;}})[_0xb3c3('0x29')](function(_0x55096a){logger[_0xb3c3('0x27')](_0xb3c3('0x60'),_0x55096a);throw _0x55096a;});}return _0x589d69;})[_0xb3c3('0x22')](respondWithResult(_0x4b36b4,0xc9))[_0xb3c3('0x29')](handleError(_0x4b36b4,null));};exports[_0xb3c3('0x36')]=function(_0x39ca50,_0x174697){if(_0x39ca50[_0xb3c3('0x61')]['id']){delete _0x39ca50['body']['id'];}return db['ChatQueue'][_0xb3c3('0x57')]({'where':{'id':_0x39ca50[_0xb3c3('0x54')]['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x174697,null))['then'](saveUpdates(_0x39ca50[_0xb3c3('0x61')],null))[_0xb3c3('0x22')](respondWithResult(_0x174697,null))[_0xb3c3('0x29')](handleError(_0x174697,null));};exports[_0xb3c3('0x37')]=function(_0x28b798,_0x54abe6){return db['ChatQueue']['find']({'where':{'id':_0x28b798[_0xb3c3('0x54')]['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x54abe6,null))[_0xb3c3('0x22')](removeEntity(_0x54abe6,null))[_0xb3c3('0x29')](handleError(_0x54abe6,null));};exports[_0xb3c3('0x62')]=function(_0x4c1a78,_0x495440){return db[_0xb3c3('0x56')][_0xb3c3('0x62')]()[_0xb3c3('0x22')](respondWithResult(_0x495440,null))[_0xb3c3('0x29')](handleError(_0x495440,null));};exports['getMembers']=function(_0x2c3ce2,_0x3c42fa,_0x4dcd12){var _0x2428f9={'raw':!![],'where':{}},_0x436b62={},_0x2aad8a;return db[_0xb3c3('0x56')][_0xb3c3('0x63')]({'where':{'id':_0x2c3ce2['params']['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x3c42fa,null))['then'](function(_0x5b84a1){if(_0x5b84a1){_0x2aad8a=_0x5b84a1[_0xb3c3('0x38')]({'plain':!![]});_0x436b62['model']=_[_0xb3c3('0x55')](db['UserChatQueue'][_0xb3c3('0x3e')]);_0x436b62[_0xb3c3('0x40')]=_[_0xb3c3('0x55')](_0x2c3ce2[_0xb3c3('0x40')]);_0x436b62[_0xb3c3('0x41')]=_[_0xb3c3('0x42')](_0x436b62[_0xb3c3('0x46')],_0x436b62[_0xb3c3('0x40')]);_0x2428f9[_0xb3c3('0x43')]=_[_0xb3c3('0x42')](_0x436b62[_0xb3c3('0x46')],qs[_0xb3c3('0x44')](_0x2c3ce2[_0xb3c3('0x40')]['fields']));_0x2428f9[_0xb3c3('0x43')]=_0x2428f9['attributes'][_0xb3c3('0x45')]?_0x2428f9['attributes']:_0x436b62[_0xb3c3('0x46')];if(!_0x2c3ce2[_0xb3c3('0x40')][_0xb3c3('0x47')](_0xb3c3('0x48'))){_0x2428f9[_0xb3c3('0x2e')]=qs[_0xb3c3('0x2e')](_0x2c3ce2[_0xb3c3('0x40')][_0xb3c3('0x2e')]);_0x2428f9['offset']=qs['offset'](_0x2c3ce2['query']['offset']);}_0x2428f9[_0xb3c3('0x64')]=qs['sort'](_0x2c3ce2[_0xb3c3('0x40')]['sort']);_0x2428f9['where']=qs[_0xb3c3('0x41')](_[_0xb3c3('0x4b')](_0x2c3ce2[_0xb3c3('0x40')],_0x436b62['filters']));_0x2428f9[_0xb3c3('0x4a')][_0xb3c3('0x65')]=_0x5b84a1['id'];if(_0x2c3ce2[_0xb3c3('0x40')]['filter']){_0x2428f9[_0xb3c3('0x4a')]=_[_0xb3c3('0x4e')](_0x2428f9[_0xb3c3('0x4a')],{'$or':_[_0xb3c3('0x3d')](_0x2428f9[_0xb3c3('0x43')],function(_0x3d9ac3){var _0x269a4e={};_0x269a4e[_0x3d9ac3]={'$like':'%'+_0x2c3ce2['query'][_0xb3c3('0x4c')]+'%'};return _0x269a4e;})});}_0x2428f9=_[_0xb3c3('0x4e')]({},_0x2428f9,_0x2c3ce2[_0xb3c3('0x4f')]);return db[_0xb3c3('0x66')][_0xb3c3('0x51')](_0x2428f9);}})[_0xb3c3('0x22')](function(_0x599e2d){if(_0x599e2d){return db[_0xb3c3('0x67')][_0xb3c3('0x68')]({'where':{'id':_['map'](_0x599e2d,_0xb3c3('0x69')),'role':_0xb3c3('0x6a')},'attributes':['id',_0xb3c3('0x3a'),_0xb3c3('0x6b'),'updatedAt','createdAt']});}})[_0xb3c3('0x22')](function(_0x57b2a9){if(_0x57b2a9){return{'count':_0x57b2a9[_0xb3c3('0x30')],'rows':_['map'](_0x57b2a9[_0xb3c3('0x52')],function(_0x2c3019){return{'membername':_0x2c3019[_0xb3c3('0x3a')],'UserId':_0x2c3019['id'],'queue_name':_0x2aad8a['name'],'ChatQueueId':_0x2aad8a['id'],'interface':util['format'](_0xb3c3('0x6c'),_0xb3c3('0x6d'),_0x2c3019['name']),'penalty':0x0,'paused':_0x2c3019[_0xb3c3('0x6b')],'createdAt':_0x2c3019[_0xb3c3('0x6e')],'updatedAt':_0x2c3019['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb3c3('0x22')](respondWithFilteredResult(_0x3c42fa,_0x2428f9))[_0xb3c3('0x29')](handleError(_0x3c42fa,null));};exports[_0xb3c3('0x6f')]=function(_0x460594,_0x3f9b57,_0x56e79c){var _0x4aaa39={};var _0x4d7db8={};var _0x7d63c8;var _0x2b8986;return db[_0xb3c3('0x56')][_0xb3c3('0x63')]({'where':{'id':_0x460594[_0xb3c3('0x54')]['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x3f9b57,null))[_0xb3c3('0x22')](function(_0x1264a0){if(_0x1264a0){_0x7d63c8=_0x1264a0;_0x4d7db8['model']=_[_0xb3c3('0x55')](db['Team'][_0xb3c3('0x3e')]);_0x4d7db8['query']=_[_0xb3c3('0x55')](_0x460594[_0xb3c3('0x40')]);_0x4d7db8[_0xb3c3('0x41')]=_[_0xb3c3('0x42')](_0x4d7db8['model'],_0x4d7db8['query']);_0x4aaa39[_0xb3c3('0x43')]=_['intersection'](_0x4d7db8[_0xb3c3('0x46')],qs[_0xb3c3('0x44')](_0x460594[_0xb3c3('0x40')][_0xb3c3('0x44')]));_0x4aaa39['attributes']=_0x4aaa39[_0xb3c3('0x43')][_0xb3c3('0x45')]?_0x4aaa39[_0xb3c3('0x43')]:_0x4d7db8[_0xb3c3('0x46')];_0x4aaa39[_0xb3c3('0x64')]=qs[_0xb3c3('0x49')](_0x460594[_0xb3c3('0x40')]['sort']);_0x4aaa39[_0xb3c3('0x4a')]=qs[_0xb3c3('0x41')](_[_0xb3c3('0x4b')](_0x460594[_0xb3c3('0x40')],_0x4d7db8[_0xb3c3('0x41')]));if(_0x460594['query']['filter']){_0x4aaa39[_0xb3c3('0x4a')]=_[_0xb3c3('0x4e')](_0x4aaa39[_0xb3c3('0x4a')],{'$or':_[_0xb3c3('0x3d')](_0x4aaa39[_0xb3c3('0x43')],function(_0x2f1750){var _0x571d91={};_0x571d91[_0x2f1750]={'$like':'%'+_0x460594[_0xb3c3('0x40')][_0xb3c3('0x4c')]+'%'};return _0x571d91;})});}_0x4aaa39=_[_0xb3c3('0x4e')]({},_0x4aaa39,_0x460594[_0xb3c3('0x4f')]);return _0x7d63c8[_0xb3c3('0x6f')](_0x4aaa39);}})[_0xb3c3('0x22')](function(_0x59fd51){if(_0x59fd51){_0x2b8986=_0x59fd51[_0xb3c3('0x45')];if(!_0x460594[_0xb3c3('0x40')]['hasOwnProperty'](_0xb3c3('0x48'))){_0x4aaa39[_0xb3c3('0x2e')]=qs['limit'](_0x460594[_0xb3c3('0x40')][_0xb3c3('0x2e')]);_0x4aaa39[_0xb3c3('0x2d')]=qs[_0xb3c3('0x2d')](_0x460594[_0xb3c3('0x40')]['offset']);}return _0x7d63c8[_0xb3c3('0x6f')](_0x4aaa39);}})[_0xb3c3('0x22')](function(_0x613a14){if(_0x613a14){return _0x613a14?{'count':_0x2b8986,'rows':_0x613a14}:null;}})[_0xb3c3('0x22')](respondWithResult(_0x3f9b57,null))['catch'](handleError(_0x3f9b57,null));};exports[_0xb3c3('0x70')]=function(_0x58938a,_0x302ca9,_0x3c922a){var _0x5a6e9d=_0x58938a[_0xb3c3('0x61')]['ids'];return db[_0xb3c3('0x71')]['findAll']({'where':{'id':_0x5a6e9d},'attributes':['id'],'include':[{'model':db[_0xb3c3('0x67')],'as':_0xb3c3('0x72'),'attributes':['id',_0xb3c3('0x3a'),_0xb3c3('0x73'),'voicePause',_0xb3c3('0x74')],'raw':!![]}]})[_0xb3c3('0x22')](function(_0x128285){if(_0x128285){var _0x36a95d=_[_0xb3c3('0x75')](_0x128285,function(_0x11c7e9){var _0x5c7bf3=_0x11c7e9[_0xb3c3('0x38')]({'plain':!![]});return _0x5c7bf3[_0xb3c3('0x72')];});return db[_0xb3c3('0x56')][_0xb3c3('0x57')]({'where':{'id':_0x58938a['params']['id']}})[_0xb3c3('0x22')](function(_0x2e1304){return db[_0xb3c3('0x76')][_0xb3c3('0x77')](function(_0x24e0b2){return _0x2e1304[_0xb3c3('0x70')](_0x5a6e9d,{'transaction':_0x24e0b2})[_0xb3c3('0x22')](function(){return BPromise[_0xb3c3('0x78')](_0x36a95d,function(_0x2a7cbc){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x2a7cbc['id'],'ChatQueueId':_0x58938a[_0xb3c3('0x54')]['id']},'transaction':_0x24e0b2});});})[_0xb3c3('0x22')](function(){_0x36a95d['forEach'](function(_0x1b3fa5){socket[_0xb3c3('0x79')](_0xb3c3('0x7a'),{'UserId':_0x1b3fa5['id'],'ChatQueueId':_0x2e1304['id']});});});});});}})['then'](respondWithStatusCode(_0x302ca9,null))[_0xb3c3('0x29')](handleError(_0x302ca9,null));};exports[_0xb3c3('0x7b')]=function(_0x16dbcc,_0x4d4187,_0x73f25f){return db[_0xb3c3('0x71')][_0xb3c3('0x51')]({'where':{'id':_0x16dbcc[_0xb3c3('0x40')][_0xb3c3('0x7c')]},'attributes':['id'],'include':[{'model':db[_0xb3c3('0x67')],'as':_0xb3c3('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d4187,null))[_0xb3c3('0x22')](function(_0x3887dd){var _0x11b7af=_[_0xb3c3('0x3d')](_0x3887dd,'id');var _0x41f1d7=[];var _0x2ad755=[];var _0x582709=squel[_0xb3c3('0x7d')]();_0x582709[_0xb3c3('0x7e')](_0xb3c3('0x7f'))[_0xb3c3('0x80')](_0xb3c3('0x81'),'tq')['join'](_0xb3c3('0x82'),'ut',_0xb3c3('0x83'))[_0xb3c3('0x4a')]('ChatQueueId\x20=\x20?',_0x16dbcc[_0xb3c3('0x54')]['id']);for(var _0x47e64f=0x0;_0x47e64f<_0x3887dd['length'];_0x47e64f+=0x1){let _0x2bf107=_0x3887dd[_0x47e64f];for(var _0x375166=0x0;_0x375166<_0x2bf107['Agents'][_0xb3c3('0x45')];_0x375166+=0x1){let _0x31bc77=_0x2bf107['Agents'][_0x375166];var _0x25a856=_0x582709[_0xb3c3('0x84')]();_0x25a856[_0xb3c3('0x4a')](_0xb3c3('0x85'),_0x31bc77['id']);_0x2ad755[_0xb3c3('0x86')](db[_0xb3c3('0x76')]['query'](_0x25a856[_0xb3c3('0x87')](),{'type':db[_0xb3c3('0x76')][_0xb3c3('0x88')][_0xb3c3('0x89')]})[_0xb3c3('0x22')](function(_0xc5b721){if(_0xc5b721[_0xb3c3('0x45')]===0x1){return _0x31bc77['id'];}else{var _0x47f04e=_[_0xb3c3('0x8a')](_['map'](_0xc5b721,_0xb3c3('0x8b')),function(_0x5f487c){return _[_0xb3c3('0x8c')](_0x11b7af,_0x5f487c);});if(_0x47f04e){return _0x31bc77['id'];}}}));}}return BPromise[_0xb3c3('0x8d')](_0x2ad755)['then'](function(_0x368f6b){_0x41f1d7=_(_0x41f1d7)['union'](_0x368f6b)[_0xb3c3('0x8e')]()[_0xb3c3('0x8f')]();return db[_0xb3c3('0x56')][_0xb3c3('0x57')]({'where':{'id':_0x16dbcc[_0xb3c3('0x54')]['id']}})[_0xb3c3('0x22')](function(_0x453266){return db[_0xb3c3('0x76')]['transaction'](function(_0x112caa){return _0x453266['removeTeams'](_0x16dbcc[_0xb3c3('0x40')][_0xb3c3('0x7c')],{'transaction':_0x112caa})[_0xb3c3('0x22')](function(){if(!_['isEmpty'](_0x41f1d7)){return _0x453266[_0xb3c3('0x90')](_0x41f1d7,{'transaction':_0x112caa});}})[_0xb3c3('0x22')](function(){_0x41f1d7['forEach'](function(_0x3efcf7){socket[_0xb3c3('0x79')](_0xb3c3('0x91'),{'UserId':_0x3efcf7,'ChatQueueId':_0x453266['id']});});});});});});})[_0xb3c3('0x22')](respondWithStatusCode(_0x4d4187,null))[_0xb3c3('0x29')](handleError(_0x4d4187,null));};exports[_0xb3c3('0x92')]=function(_0x1894cf,_0x3c1ed7,_0x1e1137){return db[_0xb3c3('0x56')]['find']({'where':{'id':_0x1894cf[_0xb3c3('0x54')]['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x3c1ed7,null))[_0xb3c3('0x22')](function(_0x1da81d){if(_0x1da81d){return _0x1da81d[_0xb3c3('0x92')](_0x1894cf[_0xb3c3('0x61')][_0xb3c3('0x7c')],_[_0xb3c3('0x93')](_0x1894cf[_0xb3c3('0x61')],[_0xb3c3('0x7c'),'id'])||{})[_0xb3c3('0x94')](function(_0x223f85){for(var _0x1befef=0x0;_0x1befef<_0x1894cf[_0xb3c3('0x61')][_0xb3c3('0x7c')][_0xb3c3('0x45')];_0x1befef+=0x1){socket[_0xb3c3('0x79')](_0xb3c3('0x7a'),{'UserId':Number(_0x1894cf[_0xb3c3('0x61')][_0xb3c3('0x7c')][_0x1befef]),'ChatQueueId':Number(_0x1894cf[_0xb3c3('0x54')]['id'])});}return _0x223f85;});}})['then'](respondWithResult(_0x3c1ed7,null))['catch'](handleError(_0x3c1ed7,null));};exports[_0xb3c3('0x90')]=function(_0x545f6e,_0x566937,_0x259cff){return db[_0xb3c3('0x56')]['find']({'where':{'id':_0x545f6e[_0xb3c3('0x54')]['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x566937,null))['then'](function(_0x5d1ad0){if(_0x5d1ad0){return _0x5d1ad0[_0xb3c3('0x90')](_0x545f6e[_0xb3c3('0x40')][_0xb3c3('0x7c')])[_0xb3c3('0x22')](function(){if(_[_0xb3c3('0x95')](_0x545f6e['query'][_0xb3c3('0x7c')])){for(var _0x29ad7b=0x0;_0x29ad7b<_0x545f6e[_0xb3c3('0x40')][_0xb3c3('0x7c')][_0xb3c3('0x45')];_0x29ad7b+=0x1){socket[_0xb3c3('0x79')](_0xb3c3('0x91'),{'UserId':Number(_0x545f6e['query'][_0xb3c3('0x7c')][_0x29ad7b]),'ChatQueueId':Number(_0x545f6e[_0xb3c3('0x54')]['id'])});}}else{socket[_0xb3c3('0x79')](_0xb3c3('0x91'),{'UserId':Number(_0x545f6e[_0xb3c3('0x40')]['ids']),'ChatQueueId':Number(_0x545f6e[_0xb3c3('0x54')]['id'])});}});}})[_0xb3c3('0x22')](respondWithStatusCode(_0x566937,null))[_0xb3c3('0x29')](handleError(_0x566937,null));};exports[_0xb3c3('0x96')]=function(_0x5518c4,_0x115927,_0x289909){var _0xa9f33c={};var _0x10fd8f={};var _0x4a89ba;var _0x3bb013;return db[_0xb3c3('0x56')][_0xb3c3('0x63')]({'where':{'id':_0x5518c4['params']['id']}})[_0xb3c3('0x22')](handleEntityNotFound(_0x115927,null))[_0xb3c3('0x22')](function(_0x5c4a93){if(_0x5c4a93){_0x4a89ba=_0x5c4a93;_0x10fd8f['model']=_[_0xb3c3('0x55')](db[_0xb3c3('0x67')]['rawAttributes']);_0x10fd8f[_0xb3c3('0x40')]=_[_0xb3c3('0x55')](_0x5518c4[_0xb3c3('0x40')]);_0x10fd8f[_0xb3c3('0x41')]=_[_0xb3c3('0x42')](_0x10fd8f[_0xb3c3('0x46')],_0x10fd8f[_0xb3c3('0x40')]);_0xa9f33c[_0xb3c3('0x43')]=_[_0xb3c3('0x42')](_0x10fd8f[_0xb3c3('0x46')],qs[_0xb3c3('0x44')](_0x5518c4[_0xb3c3('0x40')]['fields']));_0xa9f33c[_0xb3c3('0x43')]=_0xa9f33c['attributes'][_0xb3c3('0x45')]?_0xa9f33c[_0xb3c3('0x43')]:_0x10fd8f[_0xb3c3('0x46')];_0xa9f33c[_0xb3c3('0x64')]=qs[_0xb3c3('0x49')](_0x5518c4[_0xb3c3('0x40')][_0xb3c3('0x49')]);_0xa9f33c[_0xb3c3('0x4a')]=qs[_0xb3c3('0x41')](_['pick'](_0x5518c4[_0xb3c3('0x40')],_0x10fd8f['filters']));if(_0x5518c4[_0xb3c3('0x40')][_0xb3c3('0x4c')]){_0xa9f33c[_0xb3c3('0x4a')]=_[_0xb3c3('0x4e')](_0xa9f33c[_0xb3c3('0x4a')],{'$or':_[_0xb3c3('0x3d')](_0xa9f33c['attributes'],function(_0x5ac371){var _0x18ba16={};_0x18ba16[_0x5ac371]={'$like':'%'+_0x5518c4['query'][_0xb3c3('0x4c')]+'%'};return _0x18ba16;})});}_0xa9f33c=_[_0xb3c3('0x4e')]({},_0xa9f33c,_0x5518c4['options']);return _0x4a89ba[_0xb3c3('0x96')](_0xa9f33c);}})[_0xb3c3('0x22')](function(_0x6ef984){if(_0x6ef984){_0x3bb013=_0x6ef984[_0xb3c3('0x45')];if(!_0x5518c4[_0xb3c3('0x40')][_0xb3c3('0x47')]('nolimit')){_0xa9f33c[_0xb3c3('0x2e')]=qs[_0xb3c3('0x2e')](_0x5518c4[_0xb3c3('0x40')][_0xb3c3('0x2e')]);_0xa9f33c['offset']=qs['offset'](_0x5518c4[_0xb3c3('0x40')]['offset']);}return _0x4a89ba['getAgents'](_0xa9f33c);}})[_0xb3c3('0x22')](function(_0x43698f){if(_0x43698f){return _0x43698f?{'count':_0x3bb013,'rows':_0x43698f}:null;}})[_0xb3c3('0x22')](respondWithResult(_0x115927,null))['catch'](handleError(_0x115927,null));}; \ No newline at end of file +var _0x3059=['addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','length','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','userChatQueue:remove'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x3059,0x1df));var _0x9305=function(_0x4fb237,_0x2f6f2b){_0x4fb237=_0x4fb237-0x0;var _0x59ca5e=_0x3059[_0x4fb237];return _0x59ca5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9305('0x0'));var zipdir=require(_0x9305('0x1'));var jsonpatch=require(_0x9305('0x2'));var rp=require(_0x9305('0x3'));var moment=require('moment');var BPromise=require(_0x9305('0x4'));var Mustache=require(_0x9305('0x5'));var util=require('util');var path=require(_0x9305('0x6'));var sox=require(_0x9305('0x7'));var csv=require(_0x9305('0x8'));var ejs=require(_0x9305('0x9'));var fs=require('fs');var fs_extra=require(_0x9305('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9305('0xb'));var jsforce=require(_0x9305('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9305('0x8'));var querystring=require(_0x9305('0xd'));var Papa=require(_0x9305('0xe'));var Redis=require(_0x9305('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9305('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9305('0x11'))(_0x9305('0x12'));var utils=require(_0x9305('0x13'));var config=require(_0x9305('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9305('0x15'))['db'];config[_0x9305('0x16')]=_[_0x9305('0x17')](config[_0x9305('0x16')],{'host':_0x9305('0x18'),'port':0x18eb});var socket=require(_0x9305('0x19'))(new Redis(config[_0x9305('0x16')]));require(_0x9305('0x1a'))[_0x9305('0x1b')](socket);var jayson=require(_0x9305('0x1c'));var client=jayson[_0x9305('0x1d')][_0x9305('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3ab8e0,_0x1b3923,_0x1add10,_0x236c33){return new BPromise(function(_0x17ae26,_0x4bcbb6){var _0x554761=_0x236c33||client;return _0x554761['request'](_0x3ab8e0,_0x1add10)[_0x9305('0x1f')](function(_0x1ecb86){logger[_0x9305('0x20')](_0x9305('0x21'),_0x1b3923,_0x9305('0x22'));logger['debug'](_0x9305('0x23'),_0x1b3923,_0x9305('0x22'),JSON['stringify'](_0x1ecb86));if(_0x1ecb86['error']){if(_0x1ecb86[_0x9305('0x24')]['code']===0x1f4){logger[_0x9305('0x24')](_0x9305('0x21'),_0x1b3923,_0x1ecb86[_0x9305('0x24')][_0x9305('0x25')]);return _0x4bcbb6(_0x1ecb86[_0x9305('0x24')][_0x9305('0x25')]);}logger['error'](_0x9305('0x21'),_0x1b3923,_0x1ecb86[_0x9305('0x24')][_0x9305('0x25')]);return _0x17ae26(_0x1ecb86['error'][_0x9305('0x25')]);}else{logger[_0x9305('0x20')](_0x9305('0x21'),_0x1b3923,_0x9305('0x22'));_0x17ae26(_0x1ecb86[_0x9305('0x26')][_0x9305('0x25')]);}})[_0x9305('0x27')](function(_0xfbd70f){logger['error'](_0x9305('0x21'),_0x1b3923,_0xfbd70f);_0x4bcbb6(_0xfbd70f);});});}function respondWithStatusCode(_0x1d0d0b,_0x53a060){_0x53a060=_0x53a060||0xcc;return function(_0x98cc){if(_0x98cc){return _0x1d0d0b['sendStatus'](_0x53a060);}return _0x1d0d0b[_0x9305('0x28')](_0x53a060)['end']();};}function respondWithResult(_0x5b77c2,_0x5960c1){_0x5960c1=_0x5960c1||0xc8;return function(_0x5087bc){if(_0x5087bc){return _0x5b77c2[_0x9305('0x28')](_0x5960c1)[_0x9305('0x29')](_0x5087bc);}};}function respondWithFilteredResult(_0x3f5be8,_0x30f710){return function(_0x382326){if(_0x382326){var _0x12c6af=typeof _0x30f710[_0x9305('0x2a')]===_0x9305('0x2b')&&typeof _0x30f710[_0x9305('0x2c')]===_0x9305('0x2b');var _0x19354b=_0x382326[_0x9305('0x2d')];var _0x14fef2=_0x12c6af?0x0:_0x30f710[_0x9305('0x2a')];var _0x197e89=_0x12c6af?_0x382326['count']:_0x30f710['offset']+_0x30f710[_0x9305('0x2c')];var _0x45a3e6;if(_0x197e89>=_0x19354b){_0x197e89=_0x19354b;_0x45a3e6=0xc8;}else{_0x45a3e6=0xce;}_0x3f5be8[_0x9305('0x28')](_0x45a3e6);return _0x3f5be8[_0x9305('0x2e')](_0x9305('0x2f'),_0x14fef2+'-'+_0x197e89+'/'+_0x19354b)['json'](_0x382326);}return null;};}function patchUpdates(_0x2e594c){return function(_0x5ef96c){try{jsonpatch[_0x9305('0x30')](_0x5ef96c,_0x2e594c,!![]);}catch(_0x45a9db){return BPromise[_0x9305('0x31')](_0x45a9db);}return _0x5ef96c['save']();};}function saveUpdates(_0x451b98,_0x46f390){return function(_0x175aba){if(_0x175aba){return _0x175aba[_0x9305('0x32')](_0x451b98)['then'](function(_0x3df1ab){return _0x3df1ab;});}return null;};}function removeEntity(_0x1e0090,_0xc4ac9c){return function(_0x431158){if(_0x431158){return _0x431158[_0x9305('0x33')]()[_0x9305('0x1f')](function(){var _0x400db2=_0x431158['get']({'plain':!![]});var _0x6454bb=_0x9305('0x34');return db[_0x9305('0x35')]['destroy']({'where':{'type':_0x6454bb,'resourceId':_0x400db2['id']}})[_0x9305('0x1f')](function(){return _0x431158;});})[_0x9305('0x1f')](function(){_0x1e0090[_0x9305('0x28')](0xcc)[_0x9305('0x36')]();});}};}function handleEntityNotFound(_0x37e623,_0x4cd2d4){return function(_0x37c0dd){if(!_0x37c0dd){_0x37e623[_0x9305('0x37')](0x194);}return _0x37c0dd;};}function handleError(_0x5d0194,_0x5801d6){_0x5801d6=_0x5801d6||0x1f4;return function(_0x393b31){logger[_0x9305('0x24')](_0x393b31[_0x9305('0x38')]);if(_0x393b31['name']){delete _0x393b31[_0x9305('0x39')];}_0x5d0194[_0x9305('0x28')](_0x5801d6)[_0x9305('0x3a')](_0x393b31);};}exports[_0x9305('0x3b')]=function(_0x3a7c09,_0x46ddac){var _0x27cbde={},_0x2d6328={},_0x58bec5={'count':0x0,'rows':[]};var _0x5f0eee=_[_0x9305('0x3c')](db[_0x9305('0x3d')][_0x9305('0x3e')],function(_0x734054){return{'name':_0x734054[_0x9305('0x3f')],'type':_0x734054[_0x9305('0x40')][_0x9305('0x41')]};});_0x2d6328[_0x9305('0x42')]=_[_0x9305('0x3c')](_0x5f0eee,_0x9305('0x39'));_0x2d6328['query']=_[_0x9305('0x43')](_0x3a7c09[_0x9305('0x44')]);_0x2d6328[_0x9305('0x45')]=_[_0x9305('0x46')](_0x2d6328[_0x9305('0x42')],_0x2d6328[_0x9305('0x44')]);_0x27cbde[_0x9305('0x47')]=_[_0x9305('0x46')](_0x2d6328[_0x9305('0x42')],qs['fields'](_0x3a7c09[_0x9305('0x44')][_0x9305('0x48')]));_0x27cbde[_0x9305('0x47')]=_0x27cbde['attributes']['length']?_0x27cbde['attributes']:_0x2d6328[_0x9305('0x42')];if(!_0x3a7c09[_0x9305('0x44')][_0x9305('0x49')](_0x9305('0x4a'))){_0x27cbde['limit']=qs[_0x9305('0x2c')](_0x3a7c09[_0x9305('0x44')]['limit']);_0x27cbde['offset']=qs[_0x9305('0x2a')](_0x3a7c09[_0x9305('0x44')][_0x9305('0x2a')]);}_0x27cbde[_0x9305('0x4b')]=qs[_0x9305('0x4c')](_0x3a7c09['query'][_0x9305('0x4c')]);_0x27cbde['where']=qs[_0x9305('0x45')](_[_0x9305('0x4d')](_0x3a7c09[_0x9305('0x44')],_0x2d6328[_0x9305('0x45')]),_0x5f0eee);if(_0x3a7c09[_0x9305('0x44')][_0x9305('0x4e')]){_0x27cbde[_0x9305('0x4f')]=_[_0x9305('0x50')](_0x27cbde[_0x9305('0x4f')],{'$or':_[_0x9305('0x3c')](_0x5f0eee,function(_0x5e3fcb){if(_0x5e3fcb['type']!==_0x9305('0x51')){var _0x2ad07e={};_0x2ad07e[_0x5e3fcb[_0x9305('0x39')]]={'$like':'%'+_0x3a7c09[_0x9305('0x44')][_0x9305('0x4e')]+'%'};return _0x2ad07e;}})});}_0x27cbde=_[_0x9305('0x50')]({},_0x27cbde,_0x3a7c09[_0x9305('0x52')]);var _0x5d7c40={'where':_0x27cbde[_0x9305('0x4f')]};return db['ChatQueue'][_0x9305('0x2d')](_0x5d7c40)[_0x9305('0x1f')](function(_0x1458cb){_0x58bec5[_0x9305('0x2d')]=_0x1458cb;if(_0x3a7c09[_0x9305('0x44')][_0x9305('0x53')]){_0x27cbde[_0x9305('0x54')]=[{'all':!![]}];}return db['ChatQueue'][_0x9305('0x55')](_0x27cbde);})['then'](function(_0x31e19e){_0x58bec5['rows']=_0x31e19e;return _0x58bec5;})['then'](respondWithFilteredResult(_0x46ddac,_0x27cbde))[_0x9305('0x27')](handleError(_0x46ddac,null));};exports[_0x9305('0x56')]=function(_0x51ff00,_0x499e4a){var _0x5a5723={'raw':!![],'where':{'id':_0x51ff00[_0x9305('0x57')]['id']}},_0x515568={};_0x515568[_0x9305('0x42')]=_[_0x9305('0x43')](db[_0x9305('0x3d')]['rawAttributes']);_0x515568[_0x9305('0x44')]=_[_0x9305('0x43')](_0x51ff00['query']);_0x515568[_0x9305('0x45')]=_['intersection'](_0x515568[_0x9305('0x42')],_0x515568[_0x9305('0x44')]);_0x5a5723[_0x9305('0x47')]=_['intersection'](_0x515568['model'],qs[_0x9305('0x48')](_0x51ff00[_0x9305('0x44')][_0x9305('0x48')]));_0x5a5723[_0x9305('0x47')]=_0x5a5723[_0x9305('0x47')]['length']?_0x5a5723['attributes']:_0x515568[_0x9305('0x42')];if(_0x51ff00[_0x9305('0x44')]['includeAll']){_0x5a5723['include']=[{'all':!![]}];}_0x5a5723=_[_0x9305('0x50')]({},_0x5a5723,_0x51ff00[_0x9305('0x52')]);return db[_0x9305('0x3d')][_0x9305('0x58')](_0x5a5723)[_0x9305('0x1f')](handleEntityNotFound(_0x499e4a,null))[_0x9305('0x1f')](respondWithResult(_0x499e4a,null))['catch'](handleError(_0x499e4a,null));};exports['create']=function(_0x5521e0,_0x12efc5){return db[_0x9305('0x3d')][_0x9305('0x59')](_0x5521e0[_0x9305('0x5a')],{})[_0x9305('0x1f')](function(_0x427687){var _0x44a7ad=_0x5521e0[_0x9305('0x5b')][_0x9305('0x5c')]({'plain':!![]});if(!_0x44a7ad)throw new Error(_0x9305('0x5d'));if(_0x44a7ad[_0x9305('0x5e')]===_0x9305('0x5b')){var _0x9c107d=_0x427687['get']({'plain':!![]});var _0x568659=_0x9305('0x34');return db[_0x9305('0x5f')][_0x9305('0x58')]({'where':{'name':_0x568659,'userProfileId':_0x44a7ad[_0x9305('0x60')]},'raw':!![]})[_0x9305('0x1f')](function(_0x5f5b4a){if(_0x5f5b4a&&_0x5f5b4a[_0x9305('0x61')]===0x0){return db[_0x9305('0x35')][_0x9305('0x59')]({'name':_0x9c107d[_0x9305('0x39')],'resourceId':_0x9c107d['id'],'type':_0x5f5b4a[_0x9305('0x39')],'sectionId':_0x5f5b4a['id']},{})['then'](function(){return _0x427687;});}else{return _0x427687;}})['catch'](function(_0x26ed51){logger[_0x9305('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26ed51);throw _0x26ed51;});}return _0x427687;})[_0x9305('0x1f')](respondWithResult(_0x12efc5,0xc9))[_0x9305('0x27')](handleError(_0x12efc5,null));};exports[_0x9305('0x32')]=function(_0x5422b1,_0xf5fb50){if(_0x5422b1[_0x9305('0x5a')]['id']){delete _0x5422b1[_0x9305('0x5a')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x5422b1[_0x9305('0x57')]['id']}})[_0x9305('0x1f')](handleEntityNotFound(_0xf5fb50,null))[_0x9305('0x1f')](saveUpdates(_0x5422b1[_0x9305('0x5a')],null))[_0x9305('0x1f')](respondWithResult(_0xf5fb50,null))[_0x9305('0x27')](handleError(_0xf5fb50,null));};exports['destroy']=function(_0xa7e993,_0x19aca2){return db[_0x9305('0x3d')][_0x9305('0x58')]({'where':{'id':_0xa7e993['params']['id']}})[_0x9305('0x1f')](handleEntityNotFound(_0x19aca2,null))[_0x9305('0x1f')](removeEntity(_0x19aca2,null))[_0x9305('0x27')](handleError(_0x19aca2,null));};exports[_0x9305('0x62')]=function(_0x366b68,_0x38bf1d){return db[_0x9305('0x3d')][_0x9305('0x62')]()['then'](respondWithResult(_0x38bf1d,null))[_0x9305('0x27')](handleError(_0x38bf1d,null));};exports[_0x9305('0x63')]=function(_0xac9a16,_0x4da9e6,_0x9ea91f){var _0x46084d={'raw':!![],'where':{}},_0x598565={},_0x129e81;return db[_0x9305('0x3d')][_0x9305('0x64')]({'where':{'id':_0xac9a16[_0x9305('0x57')]['id']}})['then'](handleEntityNotFound(_0x4da9e6,null))[_0x9305('0x1f')](function(_0x58c751){if(_0x58c751){_0x129e81=_0x58c751['get']({'plain':!![]});_0x598565[_0x9305('0x42')]=_[_0x9305('0x43')](db[_0x9305('0x65')][_0x9305('0x3e')]);_0x598565[_0x9305('0x44')]=_['keys'](_0xac9a16[_0x9305('0x44')]);_0x598565[_0x9305('0x45')]=_[_0x9305('0x46')](_0x598565[_0x9305('0x42')],_0x598565[_0x9305('0x44')]);_0x46084d[_0x9305('0x47')]=_[_0x9305('0x46')](_0x598565['model'],qs[_0x9305('0x48')](_0xac9a16[_0x9305('0x44')][_0x9305('0x48')]));_0x46084d[_0x9305('0x47')]=_0x46084d[_0x9305('0x47')][_0x9305('0x66')]?_0x46084d[_0x9305('0x47')]:_0x598565[_0x9305('0x42')];if(!_0xac9a16[_0x9305('0x44')][_0x9305('0x49')](_0x9305('0x4a'))){_0x46084d[_0x9305('0x2c')]=qs[_0x9305('0x2c')](_0xac9a16[_0x9305('0x44')][_0x9305('0x2c')]);_0x46084d[_0x9305('0x2a')]=qs['offset'](_0xac9a16[_0x9305('0x44')][_0x9305('0x2a')]);}_0x46084d[_0x9305('0x4b')]=qs['sort'](_0xac9a16['query'][_0x9305('0x4c')]);_0x46084d['where']=qs[_0x9305('0x45')](_[_0x9305('0x4d')](_0xac9a16[_0x9305('0x44')],_0x598565[_0x9305('0x45')]));_0x46084d[_0x9305('0x4f')][_0x9305('0x67')]=_0x58c751['id'];if(_0xac9a16['query'][_0x9305('0x4e')]){_0x46084d[_0x9305('0x4f')]=_[_0x9305('0x50')](_0x46084d[_0x9305('0x4f')],{'$or':_[_0x9305('0x3c')](_0x46084d['attributes'],function(_0x1c4041){var _0x47214b={};_0x47214b[_0x1c4041]={'$like':'%'+_0xac9a16[_0x9305('0x44')]['filter']+'%'};return _0x47214b;})});}_0x46084d=_[_0x9305('0x50')]({},_0x46084d,_0xac9a16[_0x9305('0x52')]);return db[_0x9305('0x65')][_0x9305('0x55')](_0x46084d);}})['then'](function(_0x58714f){if(_0x58714f){return db[_0x9305('0x68')][_0x9305('0x69')]({'where':{'id':_[_0x9305('0x3c')](_0x58714f,_0x9305('0x6a')),'role':'agent'},'attributes':['id','name',_0x9305('0x6b'),_0x9305('0x6c'),'createdAt']});}})['then'](function(_0x2dd714){if(_0x2dd714){return{'count':_0x2dd714['count'],'rows':_[_0x9305('0x3c')](_0x2dd714[_0x9305('0x6d')],function(_0xe8b613){return{'membername':_0xe8b613['name'],'UserId':_0xe8b613['id'],'queue_name':_0x129e81[_0x9305('0x39')],'ChatQueueId':_0x129e81['id'],'interface':util[_0x9305('0x6e')](_0x9305('0x6f'),_0x9305('0x70'),_0xe8b613['name']),'penalty':0x0,'paused':_0xe8b613[_0x9305('0x6b')],'createdAt':_0xe8b613[_0x9305('0x71')],'updatedAt':_0xe8b613[_0x9305('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9305('0x1f')](respondWithFilteredResult(_0x4da9e6,_0x46084d))[_0x9305('0x27')](handleError(_0x4da9e6,null));};exports[_0x9305('0x72')]=function(_0x4446d6,_0x140866,_0x3acfba){var _0x4fd72f={};var _0x1a7c92={};var _0x3dc671;var _0x370b53;return db[_0x9305('0x3d')][_0x9305('0x64')]({'where':{'id':_0x4446d6[_0x9305('0x57')]['id']}})[_0x9305('0x1f')](handleEntityNotFound(_0x140866,null))[_0x9305('0x1f')](function(_0x40fe50){if(_0x40fe50){_0x3dc671=_0x40fe50;_0x1a7c92[_0x9305('0x42')]=_[_0x9305('0x43')](db[_0x9305('0x73')][_0x9305('0x3e')]);_0x1a7c92['query']=_[_0x9305('0x43')](_0x4446d6['query']);_0x1a7c92['filters']=_[_0x9305('0x46')](_0x1a7c92['model'],_0x1a7c92['query']);_0x4fd72f[_0x9305('0x47')]=_[_0x9305('0x46')](_0x1a7c92[_0x9305('0x42')],qs[_0x9305('0x48')](_0x4446d6['query'][_0x9305('0x48')]));_0x4fd72f[_0x9305('0x47')]=_0x4fd72f[_0x9305('0x47')][_0x9305('0x66')]?_0x4fd72f['attributes']:_0x1a7c92['model'];_0x4fd72f[_0x9305('0x4b')]=qs[_0x9305('0x4c')](_0x4446d6[_0x9305('0x44')]['sort']);_0x4fd72f['where']=qs[_0x9305('0x45')](_[_0x9305('0x4d')](_0x4446d6[_0x9305('0x44')],_0x1a7c92['filters']));if(_0x4446d6[_0x9305('0x44')][_0x9305('0x4e')]){_0x4fd72f[_0x9305('0x4f')]=_['merge'](_0x4fd72f[_0x9305('0x4f')],{'$or':_[_0x9305('0x3c')](_0x4fd72f[_0x9305('0x47')],function(_0x66af72){var _0x444dbb={};_0x444dbb[_0x66af72]={'$like':'%'+_0x4446d6[_0x9305('0x44')][_0x9305('0x4e')]+'%'};return _0x444dbb;})});}_0x4fd72f=_[_0x9305('0x50')]({},_0x4fd72f,_0x4446d6[_0x9305('0x52')]);return _0x3dc671['getTeams'](_0x4fd72f);}})['then'](function(_0x182c66){if(_0x182c66){_0x370b53=_0x182c66[_0x9305('0x66')];if(!_0x4446d6[_0x9305('0x44')][_0x9305('0x49')](_0x9305('0x4a'))){_0x4fd72f[_0x9305('0x2c')]=qs['limit'](_0x4446d6[_0x9305('0x44')][_0x9305('0x2c')]);_0x4fd72f[_0x9305('0x2a')]=qs[_0x9305('0x2a')](_0x4446d6['query'][_0x9305('0x2a')]);}return _0x3dc671[_0x9305('0x72')](_0x4fd72f);}})[_0x9305('0x1f')](function(_0x26aabf){if(_0x26aabf){return _0x26aabf?{'count':_0x370b53,'rows':_0x26aabf}:null;}})['then'](respondWithResult(_0x140866,null))[_0x9305('0x27')](handleError(_0x140866,null));};exports[_0x9305('0x74')]=function(_0x3ac394,_0x383467,_0x54a124){var _0x15d98a=_0x3ac394[_0x9305('0x5a')][_0x9305('0x75')];return db[_0x9305('0x73')][_0x9305('0x55')]({'where':{'id':_0x15d98a},'attributes':['id'],'include':[{'model':db[_0x9305('0x68')],'as':_0x9305('0x76'),'attributes':['id','name',_0x9305('0x77'),_0x9305('0x78'),_0x9305('0x79')],'raw':!![]}]})[_0x9305('0x1f')](function(_0x23fe69){if(_0x23fe69){var _0x3cf62d=_[_0x9305('0x7a')](_0x23fe69,function(_0xca859d){var _0x19e6d6=_0xca859d[_0x9305('0x5c')]({'plain':!![]});return _0x19e6d6[_0x9305('0x76')];});return db['ChatQueue'][_0x9305('0x58')]({'where':{'id':_0x3ac394[_0x9305('0x57')]['id']}})[_0x9305('0x1f')](function(_0x75871c){return db['sequelize']['transaction'](function(_0x56598f){return _0x75871c[_0x9305('0x74')](_0x15d98a,{'transaction':_0x56598f})[_0x9305('0x1f')](function(){return BPromise[_0x9305('0x7b')](_0x3cf62d,function(_0x2867e0){return db[_0x9305('0x65')][_0x9305('0x7c')]({'where':{'UserId':_0x2867e0['id'],'ChatQueueId':_0x3ac394[_0x9305('0x57')]['id']},'transaction':_0x56598f});});})['then'](function(){_0x3cf62d['forEach'](function(_0x41912f){socket[_0x9305('0x7d')](_0x9305('0x7e'),{'UserId':_0x41912f['id'],'ChatQueueId':_0x75871c['id']});});});});});}})[_0x9305('0x1f')](respondWithStatusCode(_0x383467,null))[_0x9305('0x27')](handleError(_0x383467,null));};exports[_0x9305('0x7f')]=function(_0x58b598,_0x5cb2d2,_0x599ebb){return db['Team'][_0x9305('0x55')]({'where':{'id':_0x58b598[_0x9305('0x44')][_0x9305('0x75')]},'attributes':['id'],'include':[{'model':db[_0x9305('0x68')],'as':_0x9305('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5cb2d2,null))[_0x9305('0x1f')](function(_0x55f8e1){var _0x52c8f5=_[_0x9305('0x3c')](_0x55f8e1,'id');var _0x495163=[];var _0xe1cf7c=[];var _0x2d528e=squel[_0x9305('0x80')]();_0x2d528e[_0x9305('0x81')](_0x9305('0x82'))['from'](_0x9305('0x83'),'tq')[_0x9305('0x84')](_0x9305('0x85'),'ut',_0x9305('0x86'))[_0x9305('0x4f')](_0x9305('0x87'),_0x58b598[_0x9305('0x57')]['id']);for(var _0x1c27fe=0x0;_0x1c27fe<_0x55f8e1[_0x9305('0x66')];_0x1c27fe+=0x1){let _0x3c5c74=_0x55f8e1[_0x1c27fe];for(var _0x444e94=0x0;_0x444e94<_0x3c5c74[_0x9305('0x76')][_0x9305('0x66')];_0x444e94+=0x1){let _0x16120b=_0x3c5c74[_0x9305('0x76')][_0x444e94];var _0x9091b9=_0x2d528e[_0x9305('0x88')]();_0x9091b9[_0x9305('0x4f')](_0x9305('0x89'),_0x16120b['id']);_0xe1cf7c[_0x9305('0x8a')](db[_0x9305('0x8b')][_0x9305('0x44')](_0x9091b9[_0x9305('0x8c')](),{'type':db[_0x9305('0x8b')][_0x9305('0x8d')]['SELECT']})[_0x9305('0x1f')](function(_0x54d300){if(_0x54d300[_0x9305('0x66')]===0x1){return _0x16120b['id'];}else{var _0x2e5c2a=_[_0x9305('0x8e')](_[_0x9305('0x3c')](_0x54d300,_0x9305('0x8f')),function(_0x59ed13){return _['includes'](_0x52c8f5,_0x59ed13);});if(_0x2e5c2a){return _0x16120b['id'];}}}));}}return BPromise[_0x9305('0x90')](_0xe1cf7c)[_0x9305('0x1f')](function(_0x5b104f){_0x495163=_(_0x495163)[_0x9305('0x91')](_0x5b104f)[_0x9305('0x92')]()[_0x9305('0x93')]();return db[_0x9305('0x3d')][_0x9305('0x58')]({'where':{'id':_0x58b598[_0x9305('0x57')]['id']}})[_0x9305('0x1f')](function(_0x370137){return db['sequelize'][_0x9305('0x94')](function(_0x24ffaa){return _0x370137[_0x9305('0x7f')](_0x58b598[_0x9305('0x44')][_0x9305('0x75')],{'transaction':_0x24ffaa})[_0x9305('0x1f')](function(){if(!_[_0x9305('0x95')](_0x495163)){return _0x370137[_0x9305('0x96')](_0x495163,{'transaction':_0x24ffaa});}})[_0x9305('0x1f')](function(){_0x495163[_0x9305('0x97')](function(_0x4a9369){socket[_0x9305('0x7d')](_0x9305('0x98'),{'UserId':_0x4a9369,'ChatQueueId':_0x370137['id']});});});});});});})[_0x9305('0x1f')](respondWithStatusCode(_0x5cb2d2,null))[_0x9305('0x27')](handleError(_0x5cb2d2,null));};exports[_0x9305('0x99')]=function(_0x42d89c,_0x1264b4,_0x641cd4){return db[_0x9305('0x3d')][_0x9305('0x58')]({'where':{'id':_0x42d89c[_0x9305('0x57')]['id']}})[_0x9305('0x1f')](handleEntityNotFound(_0x1264b4,null))[_0x9305('0x1f')](function(_0x48fadd){if(_0x48fadd){return _0x48fadd[_0x9305('0x99')](_0x42d89c[_0x9305('0x5a')]['ids'],_[_0x9305('0x9a')](_0x42d89c[_0x9305('0x5a')],[_0x9305('0x75'),'id'])||{})[_0x9305('0x9b')](function(_0x373b12){for(var _0x5bf415=0x0;_0x5bf415<_0x42d89c[_0x9305('0x5a')][_0x9305('0x75')]['length'];_0x5bf415+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x42d89c[_0x9305('0x5a')][_0x9305('0x75')][_0x5bf415]),'ChatQueueId':Number(_0x42d89c['params']['id'])});}return _0x373b12;});}})[_0x9305('0x1f')](respondWithResult(_0x1264b4,null))['catch'](handleError(_0x1264b4,null));};exports[_0x9305('0x96')]=function(_0x3b07e3,_0x3ecc1f,_0x155884){return db[_0x9305('0x3d')]['find']({'where':{'id':_0x3b07e3[_0x9305('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ecc1f,null))[_0x9305('0x1f')](function(_0x55b682){if(_0x55b682){return _0x55b682['removeAgents'](_0x3b07e3[_0x9305('0x44')]['ids'])[_0x9305('0x1f')](function(){if(_[_0x9305('0x9c')](_0x3b07e3[_0x9305('0x44')][_0x9305('0x75')])){for(var _0x27796a=0x0;_0x27796a<_0x3b07e3[_0x9305('0x44')][_0x9305('0x75')][_0x9305('0x66')];_0x27796a+=0x1){socket[_0x9305('0x7d')](_0x9305('0x98'),{'UserId':Number(_0x3b07e3[_0x9305('0x44')]['ids'][_0x27796a]),'ChatQueueId':Number(_0x3b07e3[_0x9305('0x57')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x3b07e3[_0x9305('0x44')]['ids']),'ChatQueueId':Number(_0x3b07e3[_0x9305('0x57')]['id'])});}});}})[_0x9305('0x1f')](respondWithStatusCode(_0x3ecc1f,null))[_0x9305('0x27')](handleError(_0x3ecc1f,null));};exports[_0x9305('0x9d')]=function(_0x2e2710,_0xb3c2ba,_0x5593f5){var _0xbfa416={};var _0x24209c={};var _0x25359d;var _0x13ddaa;return db[_0x9305('0x3d')]['findOne']({'where':{'id':_0x2e2710[_0x9305('0x57')]['id']}})[_0x9305('0x1f')](handleEntityNotFound(_0xb3c2ba,null))[_0x9305('0x1f')](function(_0x252327){if(_0x252327){_0x25359d=_0x252327;_0x24209c[_0x9305('0x42')]=_[_0x9305('0x43')](db[_0x9305('0x68')]['rawAttributes']);_0x24209c[_0x9305('0x44')]=_[_0x9305('0x43')](_0x2e2710['query']);_0x24209c['filters']=_[_0x9305('0x46')](_0x24209c[_0x9305('0x42')],_0x24209c[_0x9305('0x44')]);_0xbfa416[_0x9305('0x47')]=_['intersection'](_0x24209c[_0x9305('0x42')],qs[_0x9305('0x48')](_0x2e2710[_0x9305('0x44')]['fields']));_0xbfa416[_0x9305('0x47')]=_0xbfa416['attributes']['length']?_0xbfa416[_0x9305('0x47')]:_0x24209c[_0x9305('0x42')];_0xbfa416[_0x9305('0x4b')]=qs[_0x9305('0x4c')](_0x2e2710[_0x9305('0x44')][_0x9305('0x4c')]);_0xbfa416[_0x9305('0x4f')]=qs['filters'](_['pick'](_0x2e2710[_0x9305('0x44')],_0x24209c[_0x9305('0x45')]));if(_0x2e2710[_0x9305('0x44')]['filter']){_0xbfa416[_0x9305('0x4f')]=_[_0x9305('0x50')](_0xbfa416[_0x9305('0x4f')],{'$or':_[_0x9305('0x3c')](_0xbfa416[_0x9305('0x47')],function(_0x94886b){var _0x9d3e0f={};_0x9d3e0f[_0x94886b]={'$like':'%'+_0x2e2710['query'][_0x9305('0x4e')]+'%'};return _0x9d3e0f;})});}_0xbfa416=_[_0x9305('0x50')]({},_0xbfa416,_0x2e2710[_0x9305('0x52')]);return _0x25359d['getAgents'](_0xbfa416);}})[_0x9305('0x1f')](function(_0x879fca){if(_0x879fca){_0x13ddaa=_0x879fca[_0x9305('0x66')];if(!_0x2e2710[_0x9305('0x44')][_0x9305('0x49')]('nolimit')){_0xbfa416['limit']=qs[_0x9305('0x2c')](_0x2e2710[_0x9305('0x44')]['limit']);_0xbfa416['offset']=qs[_0x9305('0x2a')](_0x2e2710[_0x9305('0x44')][_0x9305('0x2a')]);}return _0x25359d[_0x9305('0x9d')](_0xbfa416);}})[_0x9305('0x1f')](function(_0x1e7e2d){if(_0x1e7e2d){return _0x1e7e2d?{'count':_0x13ddaa,'rows':_0x1e7e2d}:null;}})[_0x9305('0x1f')](respondWithResult(_0xb3c2ba,null))[_0x9305('0x27')](handleError(_0xb3c2ba,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 29388a4..e04bec7 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 _0x3b55=['hook','exports','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x353d6d,_0x17e130){var _0x1ce58a=function(_0x20eee5){while(--_0x20eee5){_0x353d6d['push'](_0x353d6d['shift']());}};_0x1ce58a(++_0x17e130);}(_0x3b55,0xc2));var _0x53b5=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3b55[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0x53b5('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x53b5('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x53b5('0x2')](0x0);var events={'afterCreate':_0x53b5('0x3'),'afterUpdate':'update','afterDestroy':_0x53b5('0x4')};function emitEvent(_0x15fc74){return function(_0x432ebe,_0x561ed6,_0x1cb40c){ChatQueueEvents['emit'](_0x15fc74+':'+_0x432ebe['id'],_0x432ebe);ChatQueueEvents[_0x53b5('0x5')](_0x15fc74,_0x432ebe);_0x1cb40c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x53b5('0x6')](e,emitEvent(event));}}module[_0x53b5('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xa3cd=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0xf04c6d,_0xe98786){var _0x4a804e=function(_0x431a0a){while(--_0x431a0a){_0xf04c6d['push'](_0xf04c6d['shift']());}};_0x4a804e(++_0xe98786);}(_0xa3cd,0xef));var _0xda3c=function(_0x5ca3c0,_0x1c6b41){_0x5ca3c0=_0x5ca3c0-0x0;var _0xfe958c=_0xa3cd[_0x5ca3c0];return _0xfe958c;};'use strict';var EventEmitter=require(_0xda3c('0x0'));var ChatQueue=require(_0xda3c('0x1'))['db'][_0xda3c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xda3c('0x3')](0x0);var events={'afterCreate':_0xda3c('0x4'),'afterUpdate':_0xda3c('0x5'),'afterDestroy':_0xda3c('0x6')};function emitEvent(_0x42e960){return function(_0x1a00fc,_0x24bd38,_0x4c77bf){ChatQueueEvents[_0xda3c('0x7')](_0x42e960+':'+_0x1a00fc['id'],_0x1a00fc);ChatQueueEvents[_0xda3c('0x7')](_0x42e960,_0x1a00fc);_0x4c77bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xda3c('0x8')](e,emitEvent(event));}}module[_0xda3c('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 00d2e13..81d8b92 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 _0x34d6=['api','moment','bluebird','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x58f261,_0x10e8de){var _0x5e8172=function(_0x1ff011){while(--_0x1ff011){_0x58f261['push'](_0x58f261['shift']());}};_0x5e8172(++_0x10e8de);}(_0x34d6,0x81));var _0x634d=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x34d6[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x634d('0x0'));var util=require(_0x634d('0x1'));var logger=require(_0x634d('0x2'))(_0x634d('0x3'));var moment=require(_0x634d('0x4'));var BPromise=require(_0x634d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x634d('0x6'));var config=require(_0x634d('0x7'));var attributes=require(_0x634d('0x8'));module[_0x634d('0x9')]=function(_0x2ad958,_0x2a0214){return _0x2ad958[_0x634d('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec7=['request-promise','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','util','api','moment','bluebird'];(function(_0x34b9a2,_0x129b93){var _0x7b14f0=function(_0x4ccfed){while(--_0x4ccfed){_0x34b9a2['push'](_0x34b9a2['shift']());}};_0x7b14f0(++_0x129b93);}(_0xbec7,0xe3));var _0x7bec=function(_0x3e367d,_0x3f0ae5){_0x3e367d=_0x3e367d-0x0;var _0x22bf4f=_0xbec7[_0x3e367d];return _0x22bf4f;};'use strict';var _=require('lodash');var util=require(_0x7bec('0x0'));var logger=require('../../config/logger')(_0x7bec('0x1'));var moment=require(_0x7bec('0x2'));var BPromise=require(_0x7bec('0x3'));var rp=require(_0x7bec('0x4'));var fs=require('fs');var path=require(_0x7bec('0x5'));var rimraf=require(_0x7bec('0x6'));var config=require('../../config/environment');var attributes=require(_0x7bec('0x7'));module['exports']=function(_0x51e8d6,_0x2e074e){return _0x51e8d6[_0x7bec('0x8')](_0x7bec('0x9'),attributes,{'tableName':_0x7bec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 28e6881..8e490d8 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 _0x530f=['redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','info','catch','ShowChatQueue','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x402067,_0x30f543){var _0x104ede=function(_0x5c2378){while(--_0x5c2378){_0x402067['push'](_0x402067['shift']());}};_0x104ede(++_0x30f543);}(_0x530f,0x167));var _0xf530=function(_0x1793e7,_0x4cba8a){_0x1793e7=_0x1793e7-0x0;var _0x3b5854=_0x530f[_0x1793e7];return _0x3b5854;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf530('0x1'));var fs=require('fs');var Redis=require(_0xf530('0x2'));var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require(_0xf530('0x5'))(_0xf530('0x6'));var config=require(_0xf530('0x7'));var jayson=require(_0xf530('0x8'));var client=jayson['client'][_0xf530('0x9')]({'port':0x232a});config[_0xf530('0xa')]=_[_0xf530('0xb')](config['redis'],{'host':_0xf530('0xc'),'port':0x18eb});var socket=require(_0xf530('0xd'))(new Redis(config[_0xf530('0xa')]));require(_0xf530('0xe'))[_0xf530('0xf')](socket);function respondWithRpcPromise(_0x1b3603,_0x4b8336,_0xd747c3){return new BPromise(function(_0x2fd24d,_0x383493){return client[_0xf530('0x10')](_0x1b3603,_0xd747c3)[_0xf530('0x11')](function(_0x39912f){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4b8336,_0xf530('0x12'));logger[_0xf530('0x13')](_0xf530('0x14'),_0x4b8336,_0xf530('0x12'),JSON[_0xf530('0x15')](_0x39912f));if(_0x39912f['error']){if(_0x39912f[_0xf530('0x16')][_0xf530('0x17')]===0x1f4){logger[_0xf530('0x16')](_0xf530('0x18'),_0x4b8336,_0x39912f[_0xf530('0x16')][_0xf530('0x19')]);return _0x383493(_0x39912f[_0xf530('0x16')][_0xf530('0x19')]);}logger['error'](_0xf530('0x18'),_0x4b8336,_0x39912f[_0xf530('0x16')]['message']);return _0x2fd24d(_0x39912f[_0xf530('0x16')][_0xf530('0x19')]);}else{logger['info'](_0xf530('0x18'),_0x4b8336,_0xf530('0x12'));_0x2fd24d(_0x39912f[_0xf530('0x1a')][_0xf530('0x19')]);}})['catch'](function(_0x34742c){logger[_0xf530('0x16')](_0xf530('0x18'),_0x4b8336,_0x34742c);_0x383493(_0x34742c);});});}exports[_0xf530('0x1b')]=function(_0x2bd710){var _0x3cb0f7=this;return new Promise(function(_0x48f834,_0x3f47ad){return db[_0xf530('0x1c')][_0xf530('0x1d')]({'raw':_0x2bd710[_0xf530('0x1e')]?_0x2bd710[_0xf530('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd710['options']?_0x2bd710['options'][_0xf530('0x1f')]||null:null,'attributes':_0x2bd710[_0xf530('0x1e')]?_0x2bd710[_0xf530('0x1e')][_0xf530('0x20')]||null:null,'limit':_0x2bd710[_0xf530('0x1e')]?_0x2bd710['options'][_0xf530('0x21')]||null:null,'include':_0x2bd710[_0xf530('0x1e')]?_0x2bd710[_0xf530('0x1e')][_0xf530('0x22')]?_[_0xf530('0x23')](_0x2bd710[_0xf530('0x1e')][_0xf530('0x22')],function(_0x148ebe){return{'model':db[_0x148ebe[_0xf530('0x24')]],'as':_0x148ebe['as'],'attributes':_0x148ebe[_0xf530('0x20')],'include':_0x148ebe[_0xf530('0x22')]?_['map'](_0x148ebe[_0xf530('0x22')],function(_0x1471eb){return{'model':db[_0x1471eb[_0xf530('0x24')]],'as':_0x1471eb['as'],'attributes':_0x1471eb['attributes'],'include':_0x1471eb[_0xf530('0x22')]?_['map'](_0x1471eb['include'],function(_0x3108d){return{'model':db[_0x3108d[_0xf530('0x24')]],'as':_0x3108d['as'],'attributes':_0x3108d[_0xf530('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf1c4f2){logger[_0xf530('0x25')](_0xf530('0x1b'),_0x2bd710);logger[_0xf530('0x13')](_0xf530('0x1b'),_0x2bd710,JSON[_0xf530('0x15')](_0xf1c4f2));_0x48f834(_0xf1c4f2);})[_0xf530('0x26')](function(_0x439951){logger[_0xf530('0x16')](_0xf530('0x1b'),_0x439951['message'],_0x2bd710);_0x3f47ad(_0x3cb0f7[_0xf530('0x16')](0x1f4,_0x439951['message']));});});};exports[_0xf530('0x27')]=function(_0x14ce26){var _0x4d60ad=this;return new Promise(function(_0x5e082c,_0x588856){return db[_0xf530('0x1c')][_0xf530('0x28')]({'raw':_0x14ce26[_0xf530('0x1e')]?_0x14ce26[_0xf530('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x14ce26['options']?_0x14ce26[_0xf530('0x1e')][_0xf530('0x1f')]||null:null,'attributes':_0x14ce26[_0xf530('0x1e')]?_0x14ce26[_0xf530('0x1e')][_0xf530('0x20')]||null:null,'include':_0x14ce26[_0xf530('0x1e')]?_0x14ce26[_0xf530('0x1e')]['include']?_[_0xf530('0x23')](_0x14ce26[_0xf530('0x1e')][_0xf530('0x22')],function(_0x1375de){return{'model':db[_0x1375de[_0xf530('0x24')]],'as':_0x1375de['as'],'attributes':_0x1375de['attributes'],'include':_0x1375de[_0xf530('0x22')]?_['map'](_0x1375de[_0xf530('0x22')],function(_0x53c95a){return{'model':db[_0x53c95a[_0xf530('0x24')]],'as':_0x53c95a['as'],'attributes':_0x53c95a[_0xf530('0x20')],'include':_0x53c95a[_0xf530('0x22')]?_[_0xf530('0x23')](_0x53c95a['include'],function(_0x44bd4d){return{'model':db[_0x44bd4d['model']],'as':_0x44bd4d['as'],'attributes':_0x44bd4d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf530('0x11')](function(_0x3c6c96){logger[_0xf530('0x25')](_0xf530('0x27'),_0x14ce26);logger[_0xf530('0x13')](_0xf530('0x27'),_0x14ce26,JSON[_0xf530('0x15')](_0x3c6c96));_0x5e082c(_0x3c6c96);})[_0xf530('0x26')](function(_0x2d6fd2){logger[_0xf530('0x16')](_0xf530('0x27'),_0x2d6fd2[_0xf530('0x19')],_0x14ce26);_0x588856(_0x4d60ad['error'](0x1f4,_0x2d6fd2[_0xf530('0x19')]));});});}; \ No newline at end of file +var _0xcf55=['stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','./chatQueue.socket','register','request','then','info','debug','request\x20sent'];(function(_0x1b48ce,_0x2bf70f){var _0x5524a8=function(_0x48fa0c){while(--_0x48fa0c){_0x1b48ce['push'](_0x1b48ce['shift']());}};_0x5524a8(++_0x2bf70f);}(_0xcf55,0x14b));var _0x5cf5=function(_0x65eb73,_0x1cc017){_0x65eb73=_0x65eb73-0x0;var _0x4e0f06=_0xcf55[_0x65eb73];return _0x4e0f06;};'use strict';var _=require(_0x5cf5('0x0'));var util=require(_0x5cf5('0x1'));var moment=require(_0x5cf5('0x2'));var BPromise=require(_0x5cf5('0x3'));var rs=require(_0x5cf5('0x4'));var fs=require('fs');var Redis=require(_0x5cf5('0x5'));var db=require(_0x5cf5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cf5('0x7'))(_0x5cf5('0x8'));var config=require(_0x5cf5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5cf5('0xa')][_0x5cf5('0xb')]({'port':0x232a});config[_0x5cf5('0xc')]=_['defaults'](config[_0x5cf5('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5cf5('0xd'))[_0x5cf5('0xe')](socket);function respondWithRpcPromise(_0x31068b,_0x3e516f,_0x64b95e){return new BPromise(function(_0x46d180,_0x3be7b7){return client[_0x5cf5('0xf')](_0x31068b,_0x64b95e)[_0x5cf5('0x10')](function(_0x4c5a96){logger[_0x5cf5('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3e516f,'request\x20sent');logger[_0x5cf5('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3e516f,_0x5cf5('0x13'),JSON[_0x5cf5('0x14')](_0x4c5a96));if(_0x4c5a96[_0x5cf5('0x15')]){if(_0x4c5a96[_0x5cf5('0x15')][_0x5cf5('0x16')]===0x1f4){logger['error'](_0x5cf5('0x17'),_0x3e516f,_0x4c5a96['error']['message']);return _0x3be7b7(_0x4c5a96[_0x5cf5('0x15')][_0x5cf5('0x18')]);}logger['error'](_0x5cf5('0x17'),_0x3e516f,_0x4c5a96[_0x5cf5('0x15')][_0x5cf5('0x18')]);return _0x46d180(_0x4c5a96[_0x5cf5('0x15')][_0x5cf5('0x18')]);}else{logger['info'](_0x5cf5('0x17'),_0x3e516f,_0x5cf5('0x13'));_0x46d180(_0x4c5a96[_0x5cf5('0x19')][_0x5cf5('0x18')]);}})[_0x5cf5('0x1a')](function(_0x36b365){logger[_0x5cf5('0x15')](_0x5cf5('0x17'),_0x3e516f,_0x36b365);_0x3be7b7(_0x36b365);});});}exports[_0x5cf5('0x1b')]=function(_0x11fdde){var _0x48e1d9=this;return new Promise(function(_0x52c9d7,_0x21a995){return db[_0x5cf5('0x1c')]['findAll']({'raw':_0x11fdde[_0x5cf5('0x1d')]?_0x11fdde[_0x5cf5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x11fdde['options']?_0x11fdde[_0x5cf5('0x1d')][_0x5cf5('0x1e')]||null:null,'attributes':_0x11fdde[_0x5cf5('0x1d')]?_0x11fdde[_0x5cf5('0x1d')][_0x5cf5('0x1f')]||null:null,'limit':_0x11fdde[_0x5cf5('0x1d')]?_0x11fdde[_0x5cf5('0x1d')][_0x5cf5('0x20')]||null:null,'include':_0x11fdde[_0x5cf5('0x1d')]?_0x11fdde[_0x5cf5('0x1d')][_0x5cf5('0x21')]?_[_0x5cf5('0x22')](_0x11fdde[_0x5cf5('0x1d')][_0x5cf5('0x21')],function(_0x4ea372){return{'model':db[_0x4ea372['model']],'as':_0x4ea372['as'],'attributes':_0x4ea372['attributes'],'include':_0x4ea372[_0x5cf5('0x21')]?_[_0x5cf5('0x22')](_0x4ea372['include'],function(_0x31acff){return{'model':db[_0x31acff[_0x5cf5('0x23')]],'as':_0x31acff['as'],'attributes':_0x31acff[_0x5cf5('0x1f')],'include':_0x31acff[_0x5cf5('0x21')]?_[_0x5cf5('0x22')](_0x31acff['include'],function(_0x326dae){return{'model':db[_0x326dae['model']],'as':_0x326dae['as'],'attributes':_0x326dae['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46ffe6){logger[_0x5cf5('0x11')](_0x5cf5('0x1b'),_0x11fdde);logger[_0x5cf5('0x12')](_0x5cf5('0x1b'),_0x11fdde,JSON[_0x5cf5('0x14')](_0x46ffe6));_0x52c9d7(_0x46ffe6);})['catch'](function(_0x1d6df8){logger[_0x5cf5('0x15')](_0x5cf5('0x1b'),_0x1d6df8[_0x5cf5('0x18')],_0x11fdde);_0x21a995(_0x48e1d9[_0x5cf5('0x15')](0x1f4,_0x1d6df8['message']));});});};exports[_0x5cf5('0x24')]=function(_0x462151){var _0x504715=this;return new Promise(function(_0xd295eb,_0xd029e0){return db['ChatQueue'][_0x5cf5('0x25')]({'raw':_0x462151[_0x5cf5('0x1d')]?_0x462151[_0x5cf5('0x1d')][_0x5cf5('0x26')]===undefined?!![]:![]:!![],'where':_0x462151['options']?_0x462151[_0x5cf5('0x1d')][_0x5cf5('0x1e')]||null:null,'attributes':_0x462151[_0x5cf5('0x1d')]?_0x462151['options'][_0x5cf5('0x1f')]||null:null,'include':_0x462151[_0x5cf5('0x1d')]?_0x462151['options']['include']?_[_0x5cf5('0x22')](_0x462151['options'][_0x5cf5('0x21')],function(_0x197358){return{'model':db[_0x197358[_0x5cf5('0x23')]],'as':_0x197358['as'],'attributes':_0x197358[_0x5cf5('0x1f')],'include':_0x197358[_0x5cf5('0x21')]?_['map'](_0x197358[_0x5cf5('0x21')],function(_0x5b14e7){return{'model':db[_0x5b14e7['model']],'as':_0x5b14e7['as'],'attributes':_0x5b14e7[_0x5cf5('0x1f')],'include':_0x5b14e7[_0x5cf5('0x21')]?_[_0x5cf5('0x22')](_0x5b14e7['include'],function(_0x199f32){return{'model':db[_0x199f32[_0x5cf5('0x23')]],'as':_0x199f32['as'],'attributes':_0x199f32[_0x5cf5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5cf5('0x10')](function(_0x12e5af){logger[_0x5cf5('0x11')]('ShowChatQueue',_0x462151);logger[_0x5cf5('0x12')](_0x5cf5('0x24'),_0x462151,JSON['stringify'](_0x12e5af));_0xd295eb(_0x12e5af);})['catch'](function(_0x475418){logger['error'](_0x5cf5('0x24'),_0x475418[_0x5cf5('0x18')],_0x462151);_0xd029e0(_0x504715['error'](0x1f4,_0x475418[_0x5cf5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b0b8f16..b086c9a 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 _0xf72b=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','emit'];(function(_0x1f4907,_0x5ce009){var _0x5f2fb4=function(_0x50f098){while(--_0x50f098){_0x1f4907['push'](_0x1f4907['shift']());}};_0x5f2fb4(++_0x5ce009);}(_0xf72b,0x1d9));var _0xbf72=function(_0x24e068,_0x3ba1b2){_0x24e068=_0x24e068-0x0;var _0x473805=_0xf72b[_0x24e068];return _0x473805;};'use strict';var ChatQueueEvents=require(_0xbf72('0x0'));var events=['save',_0xbf72('0x1'),'update'];function createListener(_0xd09dd2,_0x1880d0){return function(_0x5a9feb){_0x1880d0[_0xbf72('0x2')](_0xd09dd2,_0x5a9feb);};}function removeListener(_0x550a9e,_0x37afc8){return function(){ChatQueueEvents[_0xbf72('0x3')](_0x550a9e,_0x37afc8);};}exports[_0xbf72('0x4')]=function(_0x2b8440){for(var _0x5ee060=0x0,_0x41c11d=events[_0xbf72('0x5')];_0x5ee060<_0x41c11d;_0x5ee060++){var _0x119807=events[_0x5ee060];var _0xd0402c=createListener(_0xbf72('0x6')+_0x119807,_0x2b8440);ChatQueueEvents['on'](_0x119807,_0xd0402c);}}; \ No newline at end of file +var _0x70e0=['chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x2f4f8f,_0x3a9161){var _0x12aae4=function(_0x5a0dc0){while(--_0x5a0dc0){_0x2f4f8f['push'](_0x2f4f8f['shift']());}};_0x12aae4(++_0x3a9161);}(_0x70e0,0x17b));var _0x070e=function(_0x57f33f,_0x9fee24){_0x57f33f=_0x57f33f-0x0;var _0x2b86df=_0x70e0[_0x57f33f];return _0x2b86df;};'use strict';var ChatQueueEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatQueueEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatQueueEvents['on'](_0x35ab0c,_0x1e11f0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 6f49672..7bfb3dc 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x5fc3[_0x2ed8f3];return _0x525a55;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x110641,_0x48cdcd){var _0x1d3a1a=function(_0x5c6877){while(--_0x5c6877){_0x110641['push'](_0x110641['shift']());}};_0x1d3a1a(++_0x48cdcd);}(_0xe14b,0x93));var _0xbe14=function(_0x451053,_0x4af3f4){_0x451053=_0x451053-0x0;var _0x38c42b=_0xe14b[_0x451053];return _0x38c42b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 40d0d20..92d2edf 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 _0xff14=['STRING','DATE','sequelize','exports'];(function(_0xf58718,_0x33541a){var _0x5aea10=function(_0x16f386){while(--_0x16f386){_0xf58718['push'](_0xf58718['shift']());}};_0x5aea10(++_0x33541a);}(_0xff14,0x186));var _0x4ff1=function(_0x170f4c,_0x4a4c80){_0x170f4c=_0x170f4c-0x0;var _0x52eedd=_0xff14[_0x170f4c];return _0x52eedd;};'use strict';var moment=require('moment');var Sequelize=require(_0x4ff1('0x0'));module[_0x4ff1('0x1')]={'uniqueid':{'type':Sequelize[_0x4ff1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4ff1('0x2')]},'joinAt':{'type':Sequelize[_0x4ff1('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4ff1('0x2')]}}; \ No newline at end of file +var _0x314c=['sequelize','STRING','DATE','moment'];(function(_0x13bab1,_0xc7d9ec){var _0xe70595=function(_0x5e9a18){while(--_0x5e9a18){_0x13bab1['push'](_0x13bab1['shift']());}};_0xe70595(++_0xc7d9ec);}(_0x314c,0x17f));var _0xc314=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x314c[_0x45d55e];return _0x29812a;};'use strict';var moment=require(_0xc314('0x0'));var Sequelize=require(_0xc314('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc314('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc314('0x3')]},'leaveAt':{'type':Sequelize[_0xc314('0x3')]},'acceptAt':{'type':Sequelize[_0xc314('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc314('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 3c4d6c5..9d3abac 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 _0x1f2d=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','error','stack','name','send','index','ChatQueueReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','then','include','findAll','catch','show','params','rawAttributes','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xbd1920,_0x2df391){var _0x451a09=function(_0x8763aa){while(--_0x8763aa){_0xbd1920['push'](_0xbd1920['shift']());}};_0x451a09(++_0x2df391);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x25e995,_0x143cdc){_0x25e995=_0x25e995-0x0;var _0x446a58=_0x1f2d[_0x25e995];return _0x446a58;};'use strict';var emlformat=require(_0xd1f2('0x0'));var rimraf=require(_0xd1f2('0x1'));var zipdir=require(_0xd1f2('0x2'));var jsonpatch=require(_0xd1f2('0x3'));var rp=require('request-promise');var moment=require(_0xd1f2('0x4'));var BPromise=require(_0xd1f2('0x5'));var Mustache=require(_0xd1f2('0x6'));var util=require(_0xd1f2('0x7'));var path=require(_0xd1f2('0x8'));var sox=require(_0xd1f2('0x9'));var csv=require(_0xd1f2('0xa'));var ejs=require(_0xd1f2('0xb'));var fs=require('fs');var fs_extra=require(_0xd1f2('0xc'));var _=require(_0xd1f2('0xd'));var squel=require(_0xd1f2('0xe'));var crypto=require(_0xd1f2('0xf'));var jsforce=require(_0xd1f2('0x10'));var deskjs=require(_0xd1f2('0x11'));var toCsv=require(_0xd1f2('0xa'));var querystring=require(_0xd1f2('0x12'));var Papa=require(_0xd1f2('0x13'));var Redis=require('ioredis');var authService=require(_0xd1f2('0x14'));var qs=require(_0xd1f2('0x15'));var as=require(_0xd1f2('0x16'));var hardwareService=require(_0xd1f2('0x17'));var logger=require('../../config/logger')(_0xd1f2('0x18'));var utils=require(_0xd1f2('0x19'));var config=require(_0xd1f2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1f2('0x1b'))['db'];function respondWithStatusCode(_0x347eba,_0x2ef331){_0x2ef331=_0x2ef331||0xcc;return function(_0x1d09f6){if(_0x1d09f6){return _0x347eba[_0xd1f2('0x1c')](_0x2ef331);}return _0x347eba[_0xd1f2('0x1d')](_0x2ef331)[_0xd1f2('0x1e')]();};}function respondWithResult(_0x596a54,_0x4d71d1){_0x4d71d1=_0x4d71d1||0xc8;return function(_0x5a3c44){if(_0x5a3c44){return _0x596a54['status'](_0x4d71d1)['json'](_0x5a3c44);}};}function respondWithFilteredResult(_0x19eb09,_0x1e0226){return function(_0x20d25d){if(_0x20d25d){var _0x1bd6ac=typeof _0x1e0226[_0xd1f2('0x1f')]===_0xd1f2('0x20')&&typeof _0x1e0226[_0xd1f2('0x21')]==='undefined';var _0x2af2d8=_0x20d25d[_0xd1f2('0x22')];var _0x2cd4fa=_0x1bd6ac?0x0:_0x1e0226[_0xd1f2('0x1f')];var _0x1f05f4=_0x1bd6ac?_0x20d25d[_0xd1f2('0x22')]:_0x1e0226[_0xd1f2('0x1f')]+_0x1e0226['limit'];var _0x12343a;if(_0x1f05f4>=_0x2af2d8){_0x1f05f4=_0x2af2d8;_0x12343a=0xc8;}else{_0x12343a=0xce;}_0x19eb09[_0xd1f2('0x1d')](_0x12343a);return _0x19eb09[_0xd1f2('0x23')](_0xd1f2('0x24'),_0x2cd4fa+'-'+_0x1f05f4+'/'+_0x2af2d8)[_0xd1f2('0x25')](_0x20d25d);}return null;};}function patchUpdates(_0x40b992){return function(_0x2a666f){try{jsonpatch[_0xd1f2('0x26')](_0x2a666f,_0x40b992,!![]);}catch(_0x23250f){return BPromise[_0xd1f2('0x27')](_0x23250f);}return _0x2a666f[_0xd1f2('0x28')]();};}function saveUpdates(_0x4b74ff,_0x3ccd12){return function(_0x779022){if(_0x779022){return _0x779022['update'](_0x4b74ff)['then'](function(_0x36c147){return _0x36c147;});}return null;};}function removeEntity(_0x824485,_0x5a5278){return function(_0x527471){if(_0x527471){return _0x527471['destroy']()['then'](function(){_0x824485['status'](0xcc)[_0xd1f2('0x1e')]();});}};}function handleEntityNotFound(_0x3f181b,_0x2557d0){return function(_0x2c0bbb){if(!_0x2c0bbb){_0x3f181b[_0xd1f2('0x1c')](0x194);}return _0x2c0bbb;};}function handleError(_0x493870,_0xf935fc){_0xf935fc=_0xf935fc||0x1f4;return function(_0x3a99b2){logger[_0xd1f2('0x29')](_0x3a99b2[_0xd1f2('0x2a')]);if(_0x3a99b2[_0xd1f2('0x2b')]){delete _0x3a99b2[_0xd1f2('0x2b')];}_0x493870[_0xd1f2('0x1d')](_0xf935fc)[_0xd1f2('0x2c')](_0x3a99b2);};}exports[_0xd1f2('0x2d')]=function(_0x2c1d0e,_0x3e5e6c){var _0x58dd7c={},_0x4ef315={},_0x174306={'count':0x0,'rows':[]};var _0x409640=_['map'](db[_0xd1f2('0x2e')]['rawAttributes'],function(_0x1b9c0f){return{'name':_0x1b9c0f[_0xd1f2('0x2f')],'type':_0x1b9c0f[_0xd1f2('0x30')]['key']};});_0x4ef315[_0xd1f2('0x31')]=_['map'](_0x409640,'name');_0x4ef315[_0xd1f2('0x32')]=_[_0xd1f2('0x33')](_0x2c1d0e[_0xd1f2('0x32')]);_0x4ef315[_0xd1f2('0x34')]=_['intersection'](_0x4ef315[_0xd1f2('0x31')],_0x4ef315['query']);_0x58dd7c[_0xd1f2('0x35')]=_[_0xd1f2('0x36')](_0x4ef315['model'],qs[_0xd1f2('0x37')](_0x2c1d0e['query'][_0xd1f2('0x37')]));_0x58dd7c[_0xd1f2('0x35')]=_0x58dd7c[_0xd1f2('0x35')][_0xd1f2('0x38')]?_0x58dd7c[_0xd1f2('0x35')]:_0x4ef315[_0xd1f2('0x31')];if(!_0x2c1d0e['query'][_0xd1f2('0x39')](_0xd1f2('0x3a'))){_0x58dd7c[_0xd1f2('0x21')]=qs[_0xd1f2('0x21')](_0x2c1d0e[_0xd1f2('0x32')]['limit']);_0x58dd7c[_0xd1f2('0x1f')]=qs[_0xd1f2('0x1f')](_0x2c1d0e['query'][_0xd1f2('0x1f')]);}_0x58dd7c['order']=qs[_0xd1f2('0x3b')](_0x2c1d0e[_0xd1f2('0x32')][_0xd1f2('0x3b')]);_0x58dd7c[_0xd1f2('0x3c')]=qs['filters'](_[_0xd1f2('0x3d')](_0x2c1d0e[_0xd1f2('0x32')],_0x4ef315[_0xd1f2('0x34')]),_0x409640);if(_0x2c1d0e[_0xd1f2('0x32')][_0xd1f2('0x3e')]){_0x58dd7c[_0xd1f2('0x3c')]=_[_0xd1f2('0x3f')](_0x58dd7c['where'],{'$or':_[_0xd1f2('0x40')](_0x409640,function(_0x5db7f0){if(_0x5db7f0[_0xd1f2('0x30')]!==_0xd1f2('0x41')){var _0x1edc3d={};_0x1edc3d[_0x5db7f0['name']]={'$like':'%'+_0x2c1d0e[_0xd1f2('0x32')]['filter']+'%'};return _0x1edc3d;}})});}_0x58dd7c=_[_0xd1f2('0x3f')]({},_0x58dd7c,_0x2c1d0e[_0xd1f2('0x42')]);var _0x3c4cc1={'where':_0x58dd7c[_0xd1f2('0x3c')]};return db[_0xd1f2('0x2e')]['count'](_0x3c4cc1)[_0xd1f2('0x43')](function(_0x468311){_0x174306['count']=_0x468311;if(_0x2c1d0e[_0xd1f2('0x32')]['includeAll']){_0x58dd7c[_0xd1f2('0x44')]=[{'all':!![]}];}return db[_0xd1f2('0x2e')][_0xd1f2('0x45')](_0x58dd7c);})['then'](function(_0x3af39d){_0x174306['rows']=_0x3af39d;return _0x174306;})[_0xd1f2('0x43')](respondWithFilteredResult(_0x3e5e6c,_0x58dd7c))[_0xd1f2('0x46')](handleError(_0x3e5e6c,null));};exports[_0xd1f2('0x47')]=function(_0x6c46f8,_0x4256b6){var _0x1cca88={'raw':!![],'where':{'id':_0x6c46f8[_0xd1f2('0x48')]['id']}},_0x436b8b={};_0x436b8b['model']=_[_0xd1f2('0x33')](db[_0xd1f2('0x2e')][_0xd1f2('0x49')]);_0x436b8b[_0xd1f2('0x32')]=_[_0xd1f2('0x33')](_0x6c46f8[_0xd1f2('0x32')]);_0x436b8b['filters']=_[_0xd1f2('0x36')](_0x436b8b[_0xd1f2('0x31')],_0x436b8b[_0xd1f2('0x32')]);_0x1cca88['attributes']=_[_0xd1f2('0x36')](_0x436b8b[_0xd1f2('0x31')],qs[_0xd1f2('0x37')](_0x6c46f8[_0xd1f2('0x32')][_0xd1f2('0x37')]));_0x1cca88[_0xd1f2('0x35')]=_0x1cca88['attributes'][_0xd1f2('0x38')]?_0x1cca88[_0xd1f2('0x35')]:_0x436b8b[_0xd1f2('0x31')];if(_0x6c46f8[_0xd1f2('0x32')]['includeAll']){_0x1cca88[_0xd1f2('0x44')]=[{'all':!![]}];}_0x1cca88=_[_0xd1f2('0x3f')]({},_0x1cca88,_0x6c46f8['options']);return db[_0xd1f2('0x2e')]['find'](_0x1cca88)[_0xd1f2('0x43')](handleEntityNotFound(_0x4256b6,null))['then'](respondWithResult(_0x4256b6,null))[_0xd1f2('0x46')](handleError(_0x4256b6,null));};exports[_0xd1f2('0x4a')]=function(_0x45b0c6,_0x1b7b47){return db[_0xd1f2('0x2e')][_0xd1f2('0x4a')](_0x45b0c6['body'],{})[_0xd1f2('0x43')](respondWithResult(_0x1b7b47,0xc9))[_0xd1f2('0x46')](handleError(_0x1b7b47,null));};exports[_0xd1f2('0x4b')]=function(_0x83734e,_0xc33ad5){if(_0x83734e['body']['id']){delete _0x83734e[_0xd1f2('0x4c')]['id'];}return db[_0xd1f2('0x2e')][_0xd1f2('0x4d')]({'where':{'id':_0x83734e[_0xd1f2('0x48')]['id']}})[_0xd1f2('0x43')](handleEntityNotFound(_0xc33ad5,null))['then'](saveUpdates(_0x83734e[_0xd1f2('0x4c')],null))[_0xd1f2('0x43')](respondWithResult(_0xc33ad5,null))[_0xd1f2('0x46')](handleError(_0xc33ad5,null));};exports[_0xd1f2('0x4e')]=function(_0x23b429,_0x1f7d4c){return db[_0xd1f2('0x2e')][_0xd1f2('0x4d')]({'where':{'id':_0x23b429[_0xd1f2('0x48')]['id']}})[_0xd1f2('0x43')](handleEntityNotFound(_0x1f7d4c,null))['then'](removeEntity(_0x1f7d4c,null))['catch'](handleError(_0x1f7d4c,null));};exports[_0xd1f2('0x4f')]=function(_0x11730e,_0x37a3a8){return db[_0xd1f2('0x2e')][_0xd1f2('0x4f')]()['then'](respondWithResult(_0x37a3a8,null))[_0xd1f2('0x46')](handleError(_0x37a3a8,null));}; \ No newline at end of file +var _0xfa45=['end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x50f370,_0x442185){var _0x5158fa=function(_0x360752){while(--_0x360752){_0x50f370['push'](_0x50f370['shift']());}};_0x5158fa(++_0x442185);}(_0xfa45,0x11b));var _0x5fa4=function(_0xcde76e,_0x12f87c){_0xcde76e=_0xcde76e-0x0;var _0x524a39=_0xfa45[_0xcde76e];return _0x524a39;};'use strict';var emlformat=require(_0x5fa4('0x0'));var rimraf=require(_0x5fa4('0x1'));var zipdir=require(_0x5fa4('0x2'));var jsonpatch=require(_0x5fa4('0x3'));var rp=require(_0x5fa4('0x4'));var moment=require(_0x5fa4('0x5'));var BPromise=require(_0x5fa4('0x6'));var Mustache=require('mustache');var util=require(_0x5fa4('0x7'));var path=require('path');var sox=require(_0x5fa4('0x8'));var csv=require(_0x5fa4('0x9'));var ejs=require(_0x5fa4('0xa'));var fs=require('fs');var fs_extra=require(_0x5fa4('0xb'));var _=require(_0x5fa4('0xc'));var squel=require(_0x5fa4('0xd'));var crypto=require(_0x5fa4('0xe'));var jsforce=require(_0x5fa4('0xf'));var deskjs=require(_0x5fa4('0x10'));var toCsv=require(_0x5fa4('0x9'));var querystring=require('querystring');var Papa=require(_0x5fa4('0x11'));var Redis=require('ioredis');var authService=require(_0x5fa4('0x12'));var qs=require(_0x5fa4('0x13'));var as=require(_0x5fa4('0x14'));var hardwareService=require(_0x5fa4('0x15'));var logger=require(_0x5fa4('0x16'))(_0x5fa4('0x17'));var utils=require(_0x5fa4('0x18'));var config=require(_0x5fa4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fa4('0x1a'))['db'];function respondWithStatusCode(_0x4a6ce3,_0x25abcd){_0x25abcd=_0x25abcd||0xcc;return function(_0x2eeea3){if(_0x2eeea3){return _0x4a6ce3[_0x5fa4('0x1b')](_0x25abcd);}return _0x4a6ce3[_0x5fa4('0x1c')](_0x25abcd)[_0x5fa4('0x1d')]();};}function respondWithResult(_0x51af4c,_0x397328){_0x397328=_0x397328||0xc8;return function(_0x3921b0){if(_0x3921b0){return _0x51af4c['status'](_0x397328)[_0x5fa4('0x1e')](_0x3921b0);}};}function respondWithFilteredResult(_0x40ce98,_0x4d8471){return function(_0x442064){if(_0x442064){var _0x5cacd7=typeof _0x4d8471['offset']===_0x5fa4('0x1f')&&typeof _0x4d8471[_0x5fa4('0x20')]===_0x5fa4('0x1f');var _0x21d502=_0x442064[_0x5fa4('0x21')];var _0x100a46=_0x5cacd7?0x0:_0x4d8471['offset'];var _0x3d6380=_0x5cacd7?_0x442064[_0x5fa4('0x21')]:_0x4d8471[_0x5fa4('0x22')]+_0x4d8471[_0x5fa4('0x20')];var _0x7273f9;if(_0x3d6380>=_0x21d502){_0x3d6380=_0x21d502;_0x7273f9=0xc8;}else{_0x7273f9=0xce;}_0x40ce98[_0x5fa4('0x1c')](_0x7273f9);return _0x40ce98[_0x5fa4('0x23')](_0x5fa4('0x24'),_0x100a46+'-'+_0x3d6380+'/'+_0x21d502)[_0x5fa4('0x1e')](_0x442064);}return null;};}function patchUpdates(_0x1b50c6){return function(_0x7998dc){try{jsonpatch[_0x5fa4('0x25')](_0x7998dc,_0x1b50c6,!![]);}catch(_0x541f44){return BPromise['reject'](_0x541f44);}return _0x7998dc[_0x5fa4('0x26')]();};}function saveUpdates(_0x3b23d6,_0x18eb29){return function(_0x1cd221){if(_0x1cd221){return _0x1cd221['update'](_0x3b23d6)['then'](function(_0x45f9d9){return _0x45f9d9;});}return null;};}function removeEntity(_0x54134f,_0xe63c6b){return function(_0x1a242a){if(_0x1a242a){return _0x1a242a[_0x5fa4('0x27')]()[_0x5fa4('0x28')](function(){_0x54134f['status'](0xcc)[_0x5fa4('0x1d')]();});}};}function handleEntityNotFound(_0x3d2abb,_0x452b9f){return function(_0x198d4b){if(!_0x198d4b){_0x3d2abb['sendStatus'](0x194);}return _0x198d4b;};}function handleError(_0x57996b,_0x169d61){_0x169d61=_0x169d61||0x1f4;return function(_0x46a1d9){logger[_0x5fa4('0x29')](_0x46a1d9[_0x5fa4('0x2a')]);if(_0x46a1d9['name']){delete _0x46a1d9[_0x5fa4('0x2b')];}_0x57996b[_0x5fa4('0x1c')](_0x169d61)[_0x5fa4('0x2c')](_0x46a1d9);};}exports[_0x5fa4('0x2d')]=function(_0x51833c,_0x49209e){var _0x27dcff={},_0x379fff={},_0x256fc8={'count':0x0,'rows':[]};var _0x34d33a=_['map'](db[_0x5fa4('0x2e')][_0x5fa4('0x2f')],function(_0x14ea77){return{'name':_0x14ea77[_0x5fa4('0x30')],'type':_0x14ea77[_0x5fa4('0x31')][_0x5fa4('0x32')]};});_0x379fff[_0x5fa4('0x33')]=_[_0x5fa4('0x34')](_0x34d33a,_0x5fa4('0x2b'));_0x379fff['query']=_[_0x5fa4('0x35')](_0x51833c[_0x5fa4('0x36')]);_0x379fff[_0x5fa4('0x37')]=_['intersection'](_0x379fff[_0x5fa4('0x33')],_0x379fff[_0x5fa4('0x36')]);_0x27dcff[_0x5fa4('0x38')]=_[_0x5fa4('0x39')](_0x379fff[_0x5fa4('0x33')],qs[_0x5fa4('0x3a')](_0x51833c['query'][_0x5fa4('0x3a')]));_0x27dcff[_0x5fa4('0x38')]=_0x27dcff[_0x5fa4('0x38')][_0x5fa4('0x3b')]?_0x27dcff[_0x5fa4('0x38')]:_0x379fff['model'];if(!_0x51833c[_0x5fa4('0x36')][_0x5fa4('0x3c')]('nolimit')){_0x27dcff[_0x5fa4('0x20')]=qs['limit'](_0x51833c[_0x5fa4('0x36')]['limit']);_0x27dcff[_0x5fa4('0x22')]=qs[_0x5fa4('0x22')](_0x51833c['query']['offset']);}_0x27dcff['order']=qs[_0x5fa4('0x3d')](_0x51833c[_0x5fa4('0x36')][_0x5fa4('0x3d')]);_0x27dcff[_0x5fa4('0x3e')]=qs['filters'](_['pick'](_0x51833c[_0x5fa4('0x36')],_0x379fff[_0x5fa4('0x37')]),_0x34d33a);if(_0x51833c[_0x5fa4('0x36')]['filter']){_0x27dcff[_0x5fa4('0x3e')]=_[_0x5fa4('0x3f')](_0x27dcff[_0x5fa4('0x3e')],{'$or':_['map'](_0x34d33a,function(_0x90a874){if(_0x90a874[_0x5fa4('0x31')]!=='VIRTUAL'){var _0x3d8692={};_0x3d8692[_0x90a874['name']]={'$like':'%'+_0x51833c[_0x5fa4('0x36')][_0x5fa4('0x40')]+'%'};return _0x3d8692;}})});}_0x27dcff=_[_0x5fa4('0x3f')]({},_0x27dcff,_0x51833c[_0x5fa4('0x41')]);var _0x47e864={'where':_0x27dcff[_0x5fa4('0x3e')]};return db[_0x5fa4('0x2e')][_0x5fa4('0x21')](_0x47e864)[_0x5fa4('0x28')](function(_0x527e20){_0x256fc8[_0x5fa4('0x21')]=_0x527e20;if(_0x51833c[_0x5fa4('0x36')][_0x5fa4('0x42')]){_0x27dcff[_0x5fa4('0x43')]=[{'all':!![]}];}return db[_0x5fa4('0x2e')][_0x5fa4('0x44')](_0x27dcff);})[_0x5fa4('0x28')](function(_0x41683c){_0x256fc8[_0x5fa4('0x45')]=_0x41683c;return _0x256fc8;})['then'](respondWithFilteredResult(_0x49209e,_0x27dcff))[_0x5fa4('0x46')](handleError(_0x49209e,null));};exports[_0x5fa4('0x47')]=function(_0x36248e,_0xd80796){var _0x3b94be={'raw':!![],'where':{'id':_0x36248e[_0x5fa4('0x48')]['id']}},_0x282257={};_0x282257[_0x5fa4('0x33')]=_[_0x5fa4('0x35')](db[_0x5fa4('0x2e')][_0x5fa4('0x2f')]);_0x282257[_0x5fa4('0x36')]=_['keys'](_0x36248e[_0x5fa4('0x36')]);_0x282257[_0x5fa4('0x37')]=_[_0x5fa4('0x39')](_0x282257[_0x5fa4('0x33')],_0x282257[_0x5fa4('0x36')]);_0x3b94be['attributes']=_[_0x5fa4('0x39')](_0x282257[_0x5fa4('0x33')],qs[_0x5fa4('0x3a')](_0x36248e[_0x5fa4('0x36')][_0x5fa4('0x3a')]));_0x3b94be[_0x5fa4('0x38')]=_0x3b94be[_0x5fa4('0x38')][_0x5fa4('0x3b')]?_0x3b94be[_0x5fa4('0x38')]:_0x282257[_0x5fa4('0x33')];if(_0x36248e['query'][_0x5fa4('0x42')]){_0x3b94be[_0x5fa4('0x43')]=[{'all':!![]}];}_0x3b94be=_[_0x5fa4('0x3f')]({},_0x3b94be,_0x36248e[_0x5fa4('0x41')]);return db[_0x5fa4('0x2e')][_0x5fa4('0x49')](_0x3b94be)[_0x5fa4('0x28')](handleEntityNotFound(_0xd80796,null))['then'](respondWithResult(_0xd80796,null))['catch'](handleError(_0xd80796,null));};exports[_0x5fa4('0x4a')]=function(_0x561927,_0x46ff29){return db[_0x5fa4('0x2e')][_0x5fa4('0x4a')](_0x561927[_0x5fa4('0x4b')],{})[_0x5fa4('0x28')](respondWithResult(_0x46ff29,0xc9))[_0x5fa4('0x46')](handleError(_0x46ff29,null));};exports[_0x5fa4('0x4c')]=function(_0x571cd2,_0x6e95a){if(_0x571cd2[_0x5fa4('0x4b')]['id']){delete _0x571cd2[_0x5fa4('0x4b')]['id'];}return db['ChatQueueReport'][_0x5fa4('0x49')]({'where':{'id':_0x571cd2['params']['id']}})[_0x5fa4('0x28')](handleEntityNotFound(_0x6e95a,null))[_0x5fa4('0x28')](saveUpdates(_0x571cd2[_0x5fa4('0x4b')],null))[_0x5fa4('0x28')](respondWithResult(_0x6e95a,null))[_0x5fa4('0x46')](handleError(_0x6e95a,null));};exports[_0x5fa4('0x27')]=function(_0xcba431,_0x5374a7){return db[_0x5fa4('0x2e')][_0x5fa4('0x49')]({'where':{'id':_0xcba431[_0x5fa4('0x48')]['id']}})[_0x5fa4('0x28')](handleEntityNotFound(_0x5374a7,null))[_0x5fa4('0x28')](removeEntity(_0x5374a7,null))[_0x5fa4('0x46')](handleError(_0x5374a7,null));};exports[_0x5fa4('0x4d')]=function(_0x3588ef,_0x1f2785){return db[_0x5fa4('0x2e')]['describe']()[_0x5fa4('0x28')](respondWithResult(_0x1f2785,null))[_0x5fa4('0x46')](handleError(_0x1f2785,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d250999..728516c 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x53bdec,_0x2ab14c){var _0x9539b5=function(_0xf0dbf4){while(--_0xf0dbf4){_0x53bdec['push'](_0x53bdec['shift']());}};_0x9539b5(++_0x2ab14c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0xcb91[_0x44f974];return _0x805dbd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 5f8d6aa..43baa33 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 _0xeda8=['ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','stringify','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug'];(function(_0x11f4bb,_0x1c900b){var _0x14f530=function(_0x31fe45){while(--_0x31fe45){_0x11f4bb['push'](_0x11f4bb['shift']());}};_0x14f530(++_0x1c900b);}(_0xeda8,0x130));var _0x8eda=function(_0x7269b,_0x21e192){_0x7269b=_0x7269b-0x0;var _0x5ed997=_0xeda8[_0x7269b];return _0x5ed997;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require(_0x8eda('0x2'));var BPromise=require(_0x8eda('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eda('0x5'));var logger=require(_0x8eda('0x6'))(_0x8eda('0x7'));var config=require('../../config/environment');var jayson=require(_0x8eda('0x8'));var client=jayson[_0x8eda('0x9')][_0x8eda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e6468,_0x124726,_0x4f65eb){return new BPromise(function(_0xdb9566,_0x70d39d){return client[_0x8eda('0xb')](_0x1e6468,_0x4f65eb)[_0x8eda('0xc')](function(_0x58e307){logger[_0x8eda('0xd')](_0x8eda('0xe'),_0x124726,'request\x20sent');logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x124726,_0x8eda('0x11'),JSON['stringify'](_0x58e307));if(_0x58e307[_0x8eda('0x12')]){if(_0x58e307[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0xe'),_0x124726,_0x58e307[_0x8eda('0x12')][_0x8eda('0x14')]);return _0x70d39d(_0x58e307[_0x8eda('0x12')][_0x8eda('0x14')]);}logger[_0x8eda('0x12')](_0x8eda('0xe'),_0x124726,_0x58e307[_0x8eda('0x12')][_0x8eda('0x14')]);return _0xdb9566(_0x58e307['error'][_0x8eda('0x14')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x124726,_0x8eda('0x11'));_0xdb9566(_0x58e307[_0x8eda('0x15')]['message']);}})[_0x8eda('0x16')](function(_0x3da5f4){logger[_0x8eda('0x12')](_0x8eda('0xe'),_0x124726,_0x3da5f4);_0x70d39d(_0x3da5f4);});});}exports[_0x8eda('0x17')]=function(_0x10b07f){var _0x48e837=this;return new Promise(function(_0x15c2ce,_0x2b3377){return db[_0x8eda('0x18')][_0x8eda('0x19')](_0x10b07f['body'],{'raw':_0x10b07f[_0x8eda('0x1a')]?_0x10b07f[_0x8eda('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8eda('0xc')](function(_0x1b683a){logger['info'](_0x8eda('0x17'),_0x10b07f);logger[_0x8eda('0xf')](_0x8eda('0x17'),_0x10b07f,JSON[_0x8eda('0x1b')](_0x1b683a));_0x15c2ce(_0x1b683a);})[_0x8eda('0x16')](function(_0x1e0034){logger[_0x8eda('0x12')]('CreateChatQueueReport',_0x1e0034['message'],_0x10b07f);_0x2b3377(_0x48e837['error'](0x1f4,_0x1e0034[_0x8eda('0x14')]));});});};exports[_0x8eda('0x1c')]=function(_0x5f0a6c){var _0xb87a95=this;return new Promise(function(_0x198cd0,_0x5d43fd){return db[_0x8eda('0x18')]['update'](_0x5f0a6c['body'],{'raw':_0x5f0a6c['options']?_0x5f0a6c[_0x8eda('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0a6c['options']?_0x5f0a6c[_0x8eda('0x1a')][_0x8eda('0x1d')]||null:null,'attributes':_0x5f0a6c[_0x8eda('0x1a')]?_0x5f0a6c[_0x8eda('0x1a')][_0x8eda('0x1e')]||null:null,'limit':_0x5f0a6c[_0x8eda('0x1a')]?_0x5f0a6c[_0x8eda('0x1a')][_0x8eda('0x1f')]||null:null})[_0x8eda('0xc')](function(_0x370696){logger[_0x8eda('0xd')]('UpdateChatQueueReport',_0x5f0a6c);logger['debug'](_0x8eda('0x1c'),_0x5f0a6c,JSON[_0x8eda('0x1b')](_0x370696));_0x198cd0(_0x370696);})['catch'](function(_0x23933d){logger[_0x8eda('0x12')](_0x8eda('0x1c'),_0x23933d[_0x8eda('0x14')],_0x5f0a6c);_0x5d43fd(_0xb87a95[_0x8eda('0x12')](0x1f4,_0x23933d[_0x8eda('0x14')]));});});}; \ No newline at end of file +var _0x3e59=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','body','options','UpdateChatQueueReport','update','raw','attributes','limit','lodash','moment','ioredis','../../mysqldb'];(function(_0x48d8aa,_0x2c2126){var _0x1ecf43=function(_0x43451d){while(--_0x43451d){_0x48d8aa['push'](_0x48d8aa['shift']());}};_0x1ecf43(++_0x2c2126);}(_0x3e59,0xec));var _0x93e5=function(_0x245e0e,_0xcab6db){_0x245e0e=_0x245e0e-0x0;var _0xafcff4=_0x3e59[_0x245e0e];return _0xafcff4;};'use strict';var _=require(_0x93e5('0x0'));var util=require('util');var moment=require(_0x93e5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93e5('0x2'));var db=require(_0x93e5('0x3'))['db'];var utils=require(_0x93e5('0x4'));var logger=require(_0x93e5('0x5'))(_0x93e5('0x6'));var config=require(_0x93e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93e5('0x8')][_0x93e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xffea1,_0xeeb973,_0x4dc16d){return new BPromise(function(_0x1b04ae,_0x2438c1){return client['request'](_0xffea1,_0x4dc16d)[_0x93e5('0xa')](function(_0x2c60a4){logger[_0x93e5('0xb')](_0x93e5('0xc'),_0xeeb973,_0x93e5('0xd'));logger[_0x93e5('0xe')](_0x93e5('0xf'),_0xeeb973,_0x93e5('0xd'),JSON[_0x93e5('0x10')](_0x2c60a4));if(_0x2c60a4[_0x93e5('0x11')]){if(_0x2c60a4['error'][_0x93e5('0x12')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xeeb973,_0x2c60a4['error'][_0x93e5('0x13')]);return _0x2438c1(_0x2c60a4['error'][_0x93e5('0x13')]);}logger[_0x93e5('0x11')](_0x93e5('0xc'),_0xeeb973,_0x2c60a4['error']['message']);return _0x1b04ae(_0x2c60a4['error'][_0x93e5('0x13')]);}else{logger[_0x93e5('0xb')](_0x93e5('0xc'),_0xeeb973,_0x93e5('0xd'));_0x1b04ae(_0x2c60a4['result']['message']);}})[_0x93e5('0x14')](function(_0x5e2421){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xeeb973,_0x5e2421);_0x2438c1(_0x5e2421);});});}exports[_0x93e5('0x15')]=function(_0x893ea5){var _0x2addc2=this;return new Promise(function(_0x2ada2a,_0x4a8977){return db[_0x93e5('0x16')]['create'](_0x893ea5[_0x93e5('0x17')],{'raw':_0x893ea5[_0x93e5('0x18')]?_0x893ea5[_0x93e5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x93e5('0xa')](function(_0x24ed09){logger[_0x93e5('0xb')]('CreateChatQueueReport',_0x893ea5);logger[_0x93e5('0xe')]('CreateChatQueueReport',_0x893ea5,JSON['stringify'](_0x24ed09));_0x2ada2a(_0x24ed09);})[_0x93e5('0x14')](function(_0x45a9e6){logger['error'](_0x93e5('0x15'),_0x45a9e6[_0x93e5('0x13')],_0x893ea5);_0x4a8977(_0x2addc2[_0x93e5('0x11')](0x1f4,_0x45a9e6['message']));});});};exports[_0x93e5('0x19')]=function(_0x1c8100){var _0x47b444=this;return new Promise(function(_0x22f8e7,_0x141d7e){return db['ChatQueueReport'][_0x93e5('0x1a')](_0x1c8100[_0x93e5('0x17')],{'raw':_0x1c8100[_0x93e5('0x18')]?_0x1c8100[_0x93e5('0x18')][_0x93e5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c8100[_0x93e5('0x18')]?_0x1c8100[_0x93e5('0x18')]['where']||null:null,'attributes':_0x1c8100['options']?_0x1c8100[_0x93e5('0x18')][_0x93e5('0x1c')]||null:null,'limit':_0x1c8100[_0x93e5('0x18')]?_0x1c8100[_0x93e5('0x18')][_0x93e5('0x1d')]||null:null})[_0x93e5('0xa')](function(_0x9636b6){logger[_0x93e5('0xb')](_0x93e5('0x19'),_0x1c8100);logger[_0x93e5('0xe')](_0x93e5('0x19'),_0x1c8100,JSON['stringify'](_0x9636b6));_0x22f8e7(_0x9636b6);})['catch'](function(_0x74eb8c){logger[_0x93e5('0x11')](_0x93e5('0x19'),_0x74eb8c['message'],_0x1c8100);_0x141d7e(_0x47b444[_0x93e5('0x11')](0x1f4,_0x74eb8c[_0x93e5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 419b016..13bc430 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 _0x1bbd=['isAuthenticated','describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x1bbd,0x13a));var _0xd1bb=function(_0x38b9e9,_0x32f794){_0x38b9e9=_0x38b9e9-0x0;var _0x2f1d5a=_0x1bbd[_0x38b9e9];return _0x2f1d5a;};'use strict';var multer=require(_0xd1bb('0x0'));var util=require(_0xd1bb('0x1'));var path=require(_0xd1bb('0x2'));var timeout=require(_0xd1bb('0x3'));var express=require(_0xd1bb('0x4'));var router=express['Router']();var fs_extra=require(_0xd1bb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1bb('0x6'));var config=require(_0xd1bb('0x7'));var controller=require(_0xd1bb('0x8'));router[_0xd1bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd1bb('0x9')]('/describe',auth[_0xd1bb('0xa')](),controller[_0xd1bb('0xb')]);router[_0xd1bb('0x9')](_0xd1bb('0xc'),auth['isAuthenticated'](),controller[_0xd1bb('0xd')]);router['post']('/',auth[_0xd1bb('0xa')](),controller['create']);router[_0xd1bb('0xe')](_0xd1bb('0xc'),auth[_0xd1bb('0xa')](),controller[_0xd1bb('0xf')]);router['delete'](_0xd1bb('0xc'),auth[_0xd1bb('0xa')](),controller[_0xd1bb('0x10')]);module[_0xd1bb('0x11')]=router; \ No newline at end of file +var _0x35ab=['../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','create','put','/:id','update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4161cf,_0xa9bacc){var _0x748da=function(_0x3c54f2){while(--_0x3c54f2){_0x4161cf['push'](_0x4161cf['shift']());}};_0x748da(++_0xa9bacc);}(_0x35ab,0xa3));var _0xb35a=function(_0x360926,_0x15f49f){_0x360926=_0x360926-0x0;var _0x33a85a=_0x35ab[_0x360926];return _0x33a85a;};'use strict';var multer=require('multer');var util=require(_0xb35a('0x0'));var path=require(_0xb35a('0x1'));var timeout=require(_0xb35a('0x2'));var express=require('express');var router=express[_0xb35a('0x3')]();var fs_extra=require(_0xb35a('0x4'));var auth=require(_0xb35a('0x5'));var interaction=require(_0xb35a('0x6'));var config=require(_0xb35a('0x7'));var controller=require(_0xb35a('0x8'));router[_0xb35a('0x9')]('/',auth[_0xb35a('0xa')](),controller['index']);router['get']('/describe',auth[_0xb35a('0xa')](),controller[_0xb35a('0xb')]);router[_0xb35a('0x9')]('/:id',auth[_0xb35a('0xa')](),controller['show']);router['post']('/',auth[_0xb35a('0xa')](),controller[_0xb35a('0xc')]);router[_0xb35a('0xd')](_0xb35a('0xe'),auth[_0xb35a('0xa')](),controller[_0xb35a('0xf')]);router[_0xb35a('0x10')](_0xb35a('0xe'),auth[_0xb35a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e1c5279..5176b68 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x272c81,_0x5b6d26){var _0x4f5ef0=function(_0x138e90){while(--_0x138e90){_0x272c81['push'](_0x272c81['shift']());}};_0x4f5ef0(++_0x5b6d26);}(_0xaa88,0x137));var _0x8aa8=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xaa88[_0x1526e1];return _0x249a1e;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5afb18,_0x1f0456){var _0x33acc8=function(_0x4c7917){while(--_0x4c7917){_0x5afb18['push'](_0x5afb18['shift']());}};_0x33acc8(++_0x1f0456);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5bdb79,_0x2a256f){_0x5bdb79=_0x5bdb79-0x0;var _0x518e6e=_0xf4eb[_0x5bdb79];return _0x518e6e;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index f8e044b..d6c8863 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 _0xc8af=['fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../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','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x8266d1,_0x2863a3){var _0x5192fc=function(_0x1339a2){while(--_0x1339a2){_0x8266d1['push'](_0x8266d1['shift']());}};_0x5192fc(++_0x2863a3);}(_0xc8af,0x1a2));var _0xfc8a=function(_0x51da60,_0x5585f8){_0x51da60=_0x51da60-0x0;var _0x4f49cd=_0xc8af[_0x51da60];return _0x4f49cd;};'use strict';var emlformat=require(_0xfc8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc8a('0x1'));var jsonpatch=require(_0xfc8a('0x2'));var rp=require('request-promise');var moment=require(_0xfc8a('0x3'));var BPromise=require(_0xfc8a('0x4'));var Mustache=require(_0xfc8a('0x5'));var util=require(_0xfc8a('0x6'));var path=require(_0xfc8a('0x7'));var sox=require(_0xfc8a('0x8'));var csv=require('to-csv');var ejs=require(_0xfc8a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc8a('0xa'));var crypto=require(_0xfc8a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfc8a('0xc'));var toCsv=require(_0xfc8a('0xd'));var querystring=require('querystring');var Papa=require(_0xfc8a('0xe'));var Redis=require(_0xfc8a('0xf'));var authService=require(_0xfc8a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfc8a('0x11'));var hardwareService=require(_0xfc8a('0x12'));var logger=require(_0xfc8a('0x13'))(_0xfc8a('0x14'));var utils=require('../../config/utils');var config=require(_0xfc8a('0x15'));var licenseUtil=require(_0xfc8a('0x16'));var db=require(_0xfc8a('0x17'))['db'];function respondWithStatusCode(_0x318625,_0x293a4e){_0x293a4e=_0x293a4e||0xcc;return function(_0x257b92){if(_0x257b92){return _0x318625[_0xfc8a('0x18')](_0x293a4e);}return _0x318625['status'](_0x293a4e)['end']();};}function respondWithResult(_0x306324,_0x19e075){_0x19e075=_0x19e075||0xc8;return function(_0x2f240b){if(_0x2f240b){return _0x306324[_0xfc8a('0x19')](_0x19e075)['json'](_0x2f240b);}};}function respondWithFilteredResult(_0x59db58,_0x2b227c){return function(_0x279f7e){if(_0x279f7e){var _0x15f522=typeof _0x2b227c[_0xfc8a('0x1a')]===_0xfc8a('0x1b')&&typeof _0x2b227c[_0xfc8a('0x1c')]==='undefined';var _0x40cdec=_0x279f7e[_0xfc8a('0x1d')];var _0x1157ca=_0x15f522?0x0:_0x2b227c['offset'];var _0x2dd7f2=_0x15f522?_0x279f7e[_0xfc8a('0x1d')]:_0x2b227c[_0xfc8a('0x1a')]+_0x2b227c[_0xfc8a('0x1c')];var _0x27be4d;if(_0x2dd7f2>=_0x40cdec){_0x2dd7f2=_0x40cdec;_0x27be4d=0xc8;}else{_0x27be4d=0xce;}_0x59db58[_0xfc8a('0x19')](_0x27be4d);return _0x59db58[_0xfc8a('0x1e')](_0xfc8a('0x1f'),_0x1157ca+'-'+_0x2dd7f2+'/'+_0x40cdec)[_0xfc8a('0x20')](_0x279f7e);}return null;};}function patchUpdates(_0x5a5ed7){return function(_0x1d6208){try{jsonpatch[_0xfc8a('0x21')](_0x1d6208,_0x5a5ed7,!![]);}catch(_0x25800f){return BPromise[_0xfc8a('0x22')](_0x25800f);}return _0x1d6208[_0xfc8a('0x23')]();};}function saveUpdates(_0x451cd4,_0x218126){return function(_0x1dd052){if(_0x1dd052){return _0x1dd052[_0xfc8a('0x24')](_0x451cd4)[_0xfc8a('0x25')](function(_0x55d1f5){return _0x55d1f5;});}return null;};}function removeEntity(_0x3239b2,_0x563561){return function(_0x1f7b4f){if(_0x1f7b4f){return _0x1f7b4f[_0xfc8a('0x26')]()[_0xfc8a('0x25')](function(){_0x3239b2[_0xfc8a('0x19')](0xcc)[_0xfc8a('0x27')]();});}};}function handleEntityNotFound(_0x4ad104,_0x143e07){return function(_0x5488cc){if(!_0x5488cc){_0x4ad104['sendStatus'](0x194);}return _0x5488cc;};}function handleError(_0x36549d,_0x354a36){_0x354a36=_0x354a36||0x1f4;return function(_0x1e9a37){logger[_0xfc8a('0x28')](_0x1e9a37[_0xfc8a('0x29')]);if(_0x1e9a37[_0xfc8a('0x2a')]){delete _0x1e9a37['name'];}_0x36549d[_0xfc8a('0x19')](_0x354a36)[_0xfc8a('0x2b')](_0x1e9a37);};}exports[_0xfc8a('0x2c')]=function(_0x288f39,_0x347137){var _0x2f2219={},_0x4aa5a0={},_0x3f997f={'count':0x0,'rows':[]};var _0x21990e=_[_0xfc8a('0x2d')](db[_0xfc8a('0x2e')][_0xfc8a('0x2f')],function(_0x3ecb96){return{'name':_0x3ecb96[_0xfc8a('0x30')],'type':_0x3ecb96[_0xfc8a('0x31')][_0xfc8a('0x32')]};});_0x4aa5a0[_0xfc8a('0x33')]=_[_0xfc8a('0x2d')](_0x21990e,_0xfc8a('0x2a'));_0x4aa5a0[_0xfc8a('0x34')]=_[_0xfc8a('0x35')](_0x288f39[_0xfc8a('0x34')]);_0x4aa5a0[_0xfc8a('0x36')]=_[_0xfc8a('0x37')](_0x4aa5a0[_0xfc8a('0x33')],_0x4aa5a0[_0xfc8a('0x34')]);_0x2f2219['attributes']=_[_0xfc8a('0x37')](_0x4aa5a0[_0xfc8a('0x33')],qs[_0xfc8a('0x38')](_0x288f39[_0xfc8a('0x34')][_0xfc8a('0x38')]));_0x2f2219['attributes']=_0x2f2219[_0xfc8a('0x39')][_0xfc8a('0x3a')]?_0x2f2219[_0xfc8a('0x39')]:_0x4aa5a0[_0xfc8a('0x33')];if(!_0x288f39['query'][_0xfc8a('0x3b')](_0xfc8a('0x3c'))){_0x2f2219[_0xfc8a('0x1c')]=qs[_0xfc8a('0x1c')](_0x288f39[_0xfc8a('0x34')][_0xfc8a('0x1c')]);_0x2f2219['offset']=qs['offset'](_0x288f39['query'][_0xfc8a('0x1a')]);}_0x2f2219[_0xfc8a('0x3d')]=qs['sort'](_0x288f39[_0xfc8a('0x34')]['sort']);_0x2f2219[_0xfc8a('0x3e')]=qs[_0xfc8a('0x36')](_[_0xfc8a('0x3f')](_0x288f39[_0xfc8a('0x34')],_0x4aa5a0[_0xfc8a('0x36')]),_0x21990e);if(_0x288f39[_0xfc8a('0x34')][_0xfc8a('0x40')]){_0x2f2219[_0xfc8a('0x3e')]=_[_0xfc8a('0x41')](_0x2f2219[_0xfc8a('0x3e')],{'$or':_[_0xfc8a('0x2d')](_0x21990e,function(_0xa0af7b){if(_0xa0af7b['type']!==_0xfc8a('0x42')){var _0x273e49={};_0x273e49[_0xa0af7b['name']]={'$like':'%'+_0x288f39['query']['filter']+'%'};return _0x273e49;}})});}_0x2f2219=_[_0xfc8a('0x41')]({},_0x2f2219,_0x288f39[_0xfc8a('0x43')]);var _0x1e3bb4={'where':_0x2f2219[_0xfc8a('0x3e')]};return db['ChatTransferReport'][_0xfc8a('0x1d')](_0x1e3bb4)[_0xfc8a('0x25')](function(_0x23b4fd){_0x3f997f[_0xfc8a('0x1d')]=_0x23b4fd;if(_0x288f39[_0xfc8a('0x34')]['includeAll']){_0x2f2219[_0xfc8a('0x44')]=[{'all':!![]}];}return db[_0xfc8a('0x2e')][_0xfc8a('0x45')](_0x2f2219);})[_0xfc8a('0x25')](function(_0x1e5d88){_0x3f997f[_0xfc8a('0x46')]=_0x1e5d88;return _0x3f997f;})[_0xfc8a('0x25')](respondWithFilteredResult(_0x347137,_0x2f2219))[_0xfc8a('0x47')](handleError(_0x347137,null));};exports[_0xfc8a('0x48')]=function(_0x4a83d3,_0x56a36e){var _0x4fb7b3={'raw':!![],'where':{'id':_0x4a83d3[_0xfc8a('0x49')]['id']}},_0x271f7b={};_0x271f7b['model']=_[_0xfc8a('0x35')](db['ChatTransferReport']['rawAttributes']);_0x271f7b[_0xfc8a('0x34')]=_[_0xfc8a('0x35')](_0x4a83d3['query']);_0x271f7b[_0xfc8a('0x36')]=_[_0xfc8a('0x37')](_0x271f7b[_0xfc8a('0x33')],_0x271f7b[_0xfc8a('0x34')]);_0x4fb7b3['attributes']=_['intersection'](_0x271f7b['model'],qs[_0xfc8a('0x38')](_0x4a83d3[_0xfc8a('0x34')][_0xfc8a('0x38')]));_0x4fb7b3[_0xfc8a('0x39')]=_0x4fb7b3[_0xfc8a('0x39')]['length']?_0x4fb7b3['attributes']:_0x271f7b[_0xfc8a('0x33')];if(_0x4a83d3[_0xfc8a('0x34')][_0xfc8a('0x4a')]){_0x4fb7b3[_0xfc8a('0x44')]=[{'all':!![]}];}_0x4fb7b3=_[_0xfc8a('0x41')]({},_0x4fb7b3,_0x4a83d3['options']);return db[_0xfc8a('0x2e')][_0xfc8a('0x4b')](_0x4fb7b3)['then'](handleEntityNotFound(_0x56a36e,null))['then'](respondWithResult(_0x56a36e,null))[_0xfc8a('0x47')](handleError(_0x56a36e,null));};exports['create']=function(_0x10719d,_0x45da99){return db[_0xfc8a('0x2e')][_0xfc8a('0x4c')](_0x10719d['body'],{})['then'](respondWithResult(_0x45da99,0xc9))['catch'](handleError(_0x45da99,null));};exports[_0xfc8a('0x24')]=function(_0x35d205,_0x16fe0f){if(_0x35d205[_0xfc8a('0x4d')]['id']){delete _0x35d205[_0xfc8a('0x4d')]['id'];}return db[_0xfc8a('0x2e')][_0xfc8a('0x4b')]({'where':{'id':_0x35d205[_0xfc8a('0x49')]['id']}})[_0xfc8a('0x25')](handleEntityNotFound(_0x16fe0f,null))[_0xfc8a('0x25')](saveUpdates(_0x35d205[_0xfc8a('0x4d')],null))[_0xfc8a('0x25')](respondWithResult(_0x16fe0f,null))['catch'](handleError(_0x16fe0f,null));};exports[_0xfc8a('0x26')]=function(_0x229283,_0x18d150){return db[_0xfc8a('0x2e')][_0xfc8a('0x4b')]({'where':{'id':_0x229283[_0xfc8a('0x49')]['id']}})[_0xfc8a('0x25')](handleEntityNotFound(_0x18d150,null))[_0xfc8a('0x25')](removeEntity(_0x18d150,null))[_0xfc8a('0x47')](handleError(_0x18d150,null));};exports[_0xfc8a('0x4e')]=function(_0x1d0e4d,_0x34ba79){return db['ChatTransferReport'][_0xfc8a('0x4e')]()['then'](respondWithResult(_0x34ba79,null))[_0xfc8a('0x47')](handleError(_0x34ba79,null));}; \ No newline at end of file +var _0xb06f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','papaparse','ioredis'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xb06f,0x86));var _0xfb06=function(_0x2f98c7,_0x4ba5ed){_0x2f98c7=_0x2f98c7-0x0;var _0x9911ed=_0xb06f[_0x2f98c7];return _0x9911ed;};'use strict';var emlformat=require(_0xfb06('0x0'));var rimraf=require(_0xfb06('0x1'));var zipdir=require(_0xfb06('0x2'));var jsonpatch=require(_0xfb06('0x3'));var rp=require(_0xfb06('0x4'));var moment=require(_0xfb06('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfb06('0x6'));var util=require(_0xfb06('0x7'));var path=require(_0xfb06('0x8'));var sox=require(_0xfb06('0x9'));var csv=require(_0xfb06('0xa'));var ejs=require(_0xfb06('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb06('0xc'));var squel=require(_0xfb06('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb06('0xa'));var querystring=require('querystring');var Papa=require(_0xfb06('0xe'));var Redis=require(_0xfb06('0xf'));var authService=require(_0xfb06('0x10'));var qs=require(_0xfb06('0x11'));var as=require(_0xfb06('0x12'));var hardwareService=require(_0xfb06('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfb06('0x14'));var config=require(_0xfb06('0x15'));var licenseUtil=require(_0xfb06('0x16'));var db=require(_0xfb06('0x17'))['db'];function respondWithStatusCode(_0x54583b,_0x253f12){_0x253f12=_0x253f12||0xcc;return function(_0x6db952){if(_0x6db952){return _0x54583b[_0xfb06('0x18')](_0x253f12);}return _0x54583b[_0xfb06('0x19')](_0x253f12)[_0xfb06('0x1a')]();};}function respondWithResult(_0x3f425b,_0x5e68b4){_0x5e68b4=_0x5e68b4||0xc8;return function(_0x938fa5){if(_0x938fa5){return _0x3f425b['status'](_0x5e68b4)['json'](_0x938fa5);}};}function respondWithFilteredResult(_0x35a855,_0x560f69){return function(_0x3a2efd){if(_0x3a2efd){var _0x3c5238=typeof _0x560f69[_0xfb06('0x1b')]===_0xfb06('0x1c')&&typeof _0x560f69[_0xfb06('0x1d')]===_0xfb06('0x1c');var _0xd10576=_0x3a2efd['count'];var _0x297674=_0x3c5238?0x0:_0x560f69[_0xfb06('0x1b')];var _0x30737d=_0x3c5238?_0x3a2efd[_0xfb06('0x1e')]:_0x560f69[_0xfb06('0x1b')]+_0x560f69[_0xfb06('0x1d')];var _0x2d1c5f;if(_0x30737d>=_0xd10576){_0x30737d=_0xd10576;_0x2d1c5f=0xc8;}else{_0x2d1c5f=0xce;}_0x35a855[_0xfb06('0x19')](_0x2d1c5f);return _0x35a855[_0xfb06('0x1f')](_0xfb06('0x20'),_0x297674+'-'+_0x30737d+'/'+_0xd10576)[_0xfb06('0x21')](_0x3a2efd);}return null;};}function patchUpdates(_0x51c6a1){return function(_0x3ee20f){try{jsonpatch[_0xfb06('0x22')](_0x3ee20f,_0x51c6a1,!![]);}catch(_0x47531d){return BPromise[_0xfb06('0x23')](_0x47531d);}return _0x3ee20f[_0xfb06('0x24')]();};}function saveUpdates(_0xa7692f,_0x5d06ff){return function(_0x2c5576){if(_0x2c5576){return _0x2c5576[_0xfb06('0x25')](_0xa7692f)['then'](function(_0x4363c1){return _0x4363c1;});}return null;};}function removeEntity(_0x5b5b59,_0x395b7d){return function(_0x2a7892){if(_0x2a7892){return _0x2a7892['destroy']()[_0xfb06('0x26')](function(){_0x5b5b59[_0xfb06('0x19')](0xcc)[_0xfb06('0x1a')]();});}};}function handleEntityNotFound(_0x33f9be,_0x145e67){return function(_0x2c4a6c){if(!_0x2c4a6c){_0x33f9be[_0xfb06('0x18')](0x194);}return _0x2c4a6c;};}function handleError(_0xaba9b8,_0x56a2a4){_0x56a2a4=_0x56a2a4||0x1f4;return function(_0x39efc4){logger['error'](_0x39efc4['stack']);if(_0x39efc4[_0xfb06('0x27')]){delete _0x39efc4[_0xfb06('0x27')];}_0xaba9b8[_0xfb06('0x19')](_0x56a2a4)[_0xfb06('0x28')](_0x39efc4);};}exports['index']=function(_0x32cbcd,_0x549775){var _0x46bb30={},_0x1a17ff={},_0x12fae1={'count':0x0,'rows':[]};var _0x25b13b=_[_0xfb06('0x29')](db[_0xfb06('0x2a')][_0xfb06('0x2b')],function(_0x173617){return{'name':_0x173617[_0xfb06('0x2c')],'type':_0x173617[_0xfb06('0x2d')][_0xfb06('0x2e')]};});_0x1a17ff[_0xfb06('0x2f')]=_[_0xfb06('0x29')](_0x25b13b,_0xfb06('0x27'));_0x1a17ff['query']=_['keys'](_0x32cbcd[_0xfb06('0x30')]);_0x1a17ff[_0xfb06('0x31')]=_[_0xfb06('0x32')](_0x1a17ff[_0xfb06('0x2f')],_0x1a17ff['query']);_0x46bb30[_0xfb06('0x33')]=_[_0xfb06('0x32')](_0x1a17ff[_0xfb06('0x2f')],qs[_0xfb06('0x34')](_0x32cbcd[_0xfb06('0x30')][_0xfb06('0x34')]));_0x46bb30[_0xfb06('0x33')]=_0x46bb30[_0xfb06('0x33')]['length']?_0x46bb30['attributes']:_0x1a17ff[_0xfb06('0x2f')];if(!_0x32cbcd['query'][_0xfb06('0x35')]('nolimit')){_0x46bb30[_0xfb06('0x1d')]=qs[_0xfb06('0x1d')](_0x32cbcd['query'][_0xfb06('0x1d')]);_0x46bb30['offset']=qs['offset'](_0x32cbcd[_0xfb06('0x30')][_0xfb06('0x1b')]);}_0x46bb30[_0xfb06('0x36')]=qs['sort'](_0x32cbcd[_0xfb06('0x30')][_0xfb06('0x37')]);_0x46bb30[_0xfb06('0x38')]=qs['filters'](_[_0xfb06('0x39')](_0x32cbcd[_0xfb06('0x30')],_0x1a17ff[_0xfb06('0x31')]),_0x25b13b);if(_0x32cbcd[_0xfb06('0x30')][_0xfb06('0x3a')]){_0x46bb30[_0xfb06('0x38')]=_[_0xfb06('0x3b')](_0x46bb30[_0xfb06('0x38')],{'$or':_[_0xfb06('0x29')](_0x25b13b,function(_0x14006d){if(_0x14006d['type']!==_0xfb06('0x3c')){var _0x375da1={};_0x375da1[_0x14006d[_0xfb06('0x27')]]={'$like':'%'+_0x32cbcd[_0xfb06('0x30')][_0xfb06('0x3a')]+'%'};return _0x375da1;}})});}_0x46bb30=_[_0xfb06('0x3b')]({},_0x46bb30,_0x32cbcd[_0xfb06('0x3d')]);var _0x306b1a={'where':_0x46bb30[_0xfb06('0x38')]};return db[_0xfb06('0x2a')][_0xfb06('0x1e')](_0x306b1a)[_0xfb06('0x26')](function(_0x146e22){_0x12fae1[_0xfb06('0x1e')]=_0x146e22;if(_0x32cbcd[_0xfb06('0x30')][_0xfb06('0x3e')]){_0x46bb30[_0xfb06('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xfb06('0x40')](_0x46bb30);})[_0xfb06('0x26')](function(_0x2c57bf){_0x12fae1[_0xfb06('0x41')]=_0x2c57bf;return _0x12fae1;})['then'](respondWithFilteredResult(_0x549775,_0x46bb30))[_0xfb06('0x42')](handleError(_0x549775,null));};exports[_0xfb06('0x43')]=function(_0x45884f,_0x2fed2f){var _0x23d380={'raw':!![],'where':{'id':_0x45884f[_0xfb06('0x44')]['id']}},_0x1e1e97={};_0x1e1e97['model']=_[_0xfb06('0x45')](db[_0xfb06('0x2a')]['rawAttributes']);_0x1e1e97[_0xfb06('0x30')]=_['keys'](_0x45884f[_0xfb06('0x30')]);_0x1e1e97[_0xfb06('0x31')]=_[_0xfb06('0x32')](_0x1e1e97[_0xfb06('0x2f')],_0x1e1e97[_0xfb06('0x30')]);_0x23d380[_0xfb06('0x33')]=_[_0xfb06('0x32')](_0x1e1e97['model'],qs[_0xfb06('0x34')](_0x45884f['query'][_0xfb06('0x34')]));_0x23d380[_0xfb06('0x33')]=_0x23d380['attributes'][_0xfb06('0x46')]?_0x23d380['attributes']:_0x1e1e97[_0xfb06('0x2f')];if(_0x45884f[_0xfb06('0x30')][_0xfb06('0x3e')]){_0x23d380[_0xfb06('0x3f')]=[{'all':!![]}];}_0x23d380=_[_0xfb06('0x3b')]({},_0x23d380,_0x45884f['options']);return db[_0xfb06('0x2a')][_0xfb06('0x47')](_0x23d380)[_0xfb06('0x26')](handleEntityNotFound(_0x2fed2f,null))[_0xfb06('0x26')](respondWithResult(_0x2fed2f,null))['catch'](handleError(_0x2fed2f,null));};exports[_0xfb06('0x48')]=function(_0x372962,_0x28521e){return db[_0xfb06('0x2a')][_0xfb06('0x48')](_0x372962[_0xfb06('0x49')],{})[_0xfb06('0x26')](respondWithResult(_0x28521e,0xc9))['catch'](handleError(_0x28521e,null));};exports[_0xfb06('0x25')]=function(_0xbf15c2,_0x23378d){if(_0xbf15c2[_0xfb06('0x49')]['id']){delete _0xbf15c2[_0xfb06('0x49')]['id'];}return db[_0xfb06('0x2a')]['find']({'where':{'id':_0xbf15c2[_0xfb06('0x44')]['id']}})['then'](handleEntityNotFound(_0x23378d,null))['then'](saveUpdates(_0xbf15c2['body'],null))['then'](respondWithResult(_0x23378d,null))[_0xfb06('0x42')](handleError(_0x23378d,null));};exports['destroy']=function(_0x1d5c88,_0x2f9c21){return db['ChatTransferReport']['find']({'where':{'id':_0x1d5c88['params']['id']}})[_0xfb06('0x26')](handleEntityNotFound(_0x2f9c21,null))[_0xfb06('0x26')](removeEntity(_0x2f9c21,null))[_0xfb06('0x42')](handleError(_0x2f9c21,null));};exports[_0xfb06('0x4a')]=function(_0xa4b17e,_0x4f78d2){return db[_0xfb06('0x2a')][_0xfb06('0x4a')]()[_0xfb06('0x26')](respondWithResult(_0x4f78d2,null))['catch'](handleError(_0x4f78d2,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 03a0291..926192a 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 _0x8594=['./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','lodash','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x8594,0x122));var _0x4859=function(_0x4d87ba,_0x447fb2){_0x4d87ba=_0x4d87ba-0x0;var _0x474405=_0x8594[_0x4d87ba];return _0x474405;};'use strict';var _=require(_0x4859('0x0'));var util=require(_0x4859('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4859('0x2'));var BPromise=require(_0x4859('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4859('0x4'));var rimraf=require(_0x4859('0x5'));var config=require(_0x4859('0x6'));var attributes=require(_0x4859('0x7'));module[_0x4859('0x8')]=function(_0x13dcf1,_0x391d8a){return _0x13dcf1['define']('ChatTransferReport',attributes,{'tableName':_0x4859('0x9'),'paranoid':![],'indexes':[{'name':_0x4859('0xa'),'fields':[_0x4859('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4288=['path','rimraf','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x11c221,_0x65c6a5){var _0x26deef=function(_0x2fa41a){while(--_0x2fa41a){_0x11c221['push'](_0x11c221['shift']());}};_0x26deef(++_0x65c6a5);}(_0x4288,0x159));var _0x8428=function(_0x491bdf,_0x21701b){_0x491bdf=_0x491bdf-0x0;var _0x492af7=_0x4288[_0x491bdf];return _0x492af7;};'use strict';var _=require(_0x8428('0x0'));var util=require(_0x8428('0x1'));var logger=require(_0x8428('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8428('0x3'));var rp=require(_0x8428('0x4'));var fs=require('fs');var path=require(_0x8428('0x5'));var rimraf=require(_0x8428('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x570b2b,_0xc6e94e){return _0x570b2b[_0x8428('0x7')]('ChatTransferReport',attributes,{'tableName':_0x8428('0x8'),'paranoid':![],'indexes':[{'name':_0x8428('0x9'),'fields':[_0x8428('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 7bf7b2e..0e3e4ed 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 _0xa1b8=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4be57c,_0x151881){var _0x5901da=function(_0x455972){while(--_0x455972){_0x4be57c['push'](_0x4be57c['shift']());}};_0x5901da(++_0x151881);}(_0xa1b8,0xab));var _0x8a1b=function(_0x7f7d0d,_0x376ff8){_0x7f7d0d=_0x7f7d0d-0x0;var _0x218fb5=_0xa1b8[_0x7f7d0d];return _0x218fb5;};'use strict';var _=require('lodash');var util=require(_0x8a1b('0x0'));var moment=require(_0x8a1b('0x1'));var BPromise=require(_0x8a1b('0x2'));var rs=require(_0x8a1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a1b('0x4'));var logger=require('../../config/logger')(_0x8a1b('0x5'));var config=require(_0x8a1b('0x6'));var jayson=require(_0x8a1b('0x7'));var client=jayson[_0x8a1b('0x8')][_0x8a1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x567c00,_0x5e62dd,_0x307696){return new BPromise(function(_0x4efe8d,_0x1e4e3a){return client[_0x8a1b('0xa')](_0x567c00,_0x307696)[_0x8a1b('0xb')](function(_0x2e3d06){logger[_0x8a1b('0xc')](_0x8a1b('0xd'),_0x5e62dd,'request\x20sent');logger['debug'](_0x8a1b('0xe'),_0x5e62dd,_0x8a1b('0xf'),JSON[_0x8a1b('0x10')](_0x2e3d06));if(_0x2e3d06[_0x8a1b('0x11')]){if(_0x2e3d06[_0x8a1b('0x11')]['code']===0x1f4){logger[_0x8a1b('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x5e62dd,_0x2e3d06[_0x8a1b('0x11')][_0x8a1b('0x12')]);return _0x1e4e3a(_0x2e3d06[_0x8a1b('0x11')][_0x8a1b('0x12')]);}logger[_0x8a1b('0x11')](_0x8a1b('0xd'),_0x5e62dd,_0x2e3d06[_0x8a1b('0x11')][_0x8a1b('0x12')]);return _0x4efe8d(_0x2e3d06['error'][_0x8a1b('0x12')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x5e62dd,_0x8a1b('0xf'));_0x4efe8d(_0x2e3d06['result'][_0x8a1b('0x12')]);}})[_0x8a1b('0x13')](function(_0x500af6){logger['error'](_0x8a1b('0xd'),_0x5e62dd,_0x500af6);_0x1e4e3a(_0x500af6);});});} \ No newline at end of file +var _0x3031=['code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x585134,_0x2c6d5c){var _0x108d86=function(_0xe6a11a){while(--_0xe6a11a){_0x585134['push'](_0x585134['shift']());}};_0x108d86(++_0x2c6d5c);}(_0x3031,0x13f));var _0x1303=function(_0xd1e128,_0x5a360d){_0xd1e128=_0xd1e128-0x0;var _0x28aede=_0x3031[_0xd1e128];return _0x28aede;};'use strict';var _=require(_0x1303('0x0'));var util=require(_0x1303('0x1'));var moment=require(_0x1303('0x2'));var BPromise=require(_0x1303('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1303('0x4'));var db=require(_0x1303('0x5'))['db'];var utils=require(_0x1303('0x6'));var logger=require(_0x1303('0x7'))(_0x1303('0x8'));var config=require('../../config/environment');var jayson=require(_0x1303('0x9'));var client=jayson['client'][_0x1303('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfccbff,_0x8c7616,_0x294b89){return new BPromise(function(_0x4781ff,_0x3757c7){return client[_0x1303('0xb')](_0xfccbff,_0x294b89)[_0x1303('0xc')](function(_0x2bda99){logger['info'](_0x1303('0xd'),_0x8c7616,_0x1303('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x8c7616,_0x1303('0xe'),JSON[_0x1303('0xf')](_0x2bda99));if(_0x2bda99[_0x1303('0x10')]){if(_0x2bda99['error'][_0x1303('0x11')]===0x1f4){logger[_0x1303('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x8c7616,_0x2bda99['error'][_0x1303('0x12')]);return _0x3757c7(_0x2bda99[_0x1303('0x10')][_0x1303('0x12')]);}logger['error'](_0x1303('0xd'),_0x8c7616,_0x2bda99[_0x1303('0x10')][_0x1303('0x12')]);return _0x4781ff(_0x2bda99['error']['message']);}else{logger[_0x1303('0x13')](_0x1303('0xd'),_0x8c7616,_0x1303('0xe'));_0x4781ff(_0x2bda99['result'][_0x1303('0x12')]);}})[_0x1303('0x14')](function(_0xc63a72){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x8c7616,_0xc63a72);_0x3757c7(_0xc63a72);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index a3afe36..054becc 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 _0xa426=['../../components/interaction/service','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xa426,0xb8));var _0x6a42=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xa426[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require(_0x6a42('0x0'));var path=require(_0x6a42('0x1'));var timeout=require(_0x6a42('0x2'));var express=require(_0x6a42('0x3'));var router=express[_0x6a42('0x4')]();var fs_extra=require(_0x6a42('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a42('0x6'));var config=require('../../config/environment');var controller=require(_0x6a42('0x7'));router[_0x6a42('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6a42('0x9'),auth[_0x6a42('0xa')](),controller[_0x6a42('0xb')]);router[_0x6a42('0x8')](_0x6a42('0xc'),auth[_0x6a42('0xa')](),controller[_0x6a42('0xd')]);router[_0x6a42('0xe')]('/',auth['isAuthenticated'](),controller[_0x6a42('0xf')]);router[_0x6a42('0x10')](_0x6a42('0xc'),auth[_0x6a42('0xa')](),controller['update']);router[_0x6a42('0x11')](_0x6a42('0xc'),auth[_0x6a42('0xa')](),controller[_0x6a42('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3674=['put','/:id','update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3674,0xe2));var _0x4367=function(_0x43b833,_0x345a9e){_0x43b833=_0x43b833-0x0;var _0x5085d0=_0x3674[_0x43b833];return _0x5085d0;};'use strict';var multer=require(_0x4367('0x0'));var util=require(_0x4367('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4367('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4367('0x3'));var interaction=require(_0x4367('0x4'));var config=require(_0x4367('0x5'));var controller=require(_0x4367('0x6'));router[_0x4367('0x7')]('/',auth[_0x4367('0x8')](),controller['index']);router[_0x4367('0x7')](_0x4367('0x9'),auth[_0x4367('0x8')](),controller[_0x4367('0xa')]);router[_0x4367('0x7')]('/:id',auth[_0x4367('0x8')](),controller[_0x4367('0xb')]);router[_0x4367('0xc')]('/',auth[_0x4367('0x8')](),controller[_0x4367('0xd')]);router[_0x4367('0xe')](_0x4367('0xf'),auth[_0x4367('0x8')](),controller[_0x4367('0x10')]);router[_0x4367('0x11')](_0x4367('0xf'),auth[_0x4367('0x8')](),controller[_0x4367('0x12')]);module[_0x4367('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index d41ae8c..77e8180 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 _0x7dec=['Feedback','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x7dec,0xe3));var _0xc7de=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x7dec[_0x511bd1];return _0x4c48ec;};'use strict';var Sequelize=require(_0xc7de('0x0'));var rs=require(_0xc7de('0x1'));module[_0xc7de('0x2')]={'name':{'type':Sequelize[_0xc7de('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xc7de('0x3')],'allowNull':![],'unique':_0xc7de('0x4')},'description':{'type':Sequelize[_0xc7de('0x3')]},'mapKey':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x5')},'key':{'type':Sequelize[_0xc7de('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x6')},'customerAlias':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc7de('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc7de('0x3')],'allowNull':![],'defaultValue':_0xc7de('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc7de('0x3')],'allowNull':![],'defaultValue':_0xc7de('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc7de('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc7de('0x3')]},'animation':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc7de('0xb')](_0xc7de('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0xd')},'offline_chat_button':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0xe')},'header_offline':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0xf')},'download_transcript':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc7de('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc7de('0x11')]},'closingQuestion':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x15')},'closingMessageButton':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0xe')},'skipMessageButton':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x17')},'ratingType':{'type':Sequelize[_0xc7de('0xb')](_0xc7de('0x18'),_0xc7de('0x19')),'defaultValue':_0xc7de('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xc7de('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc7de('0x11')],'defaultValue':function(){return JSON[_0xc7de('0x1a')]({'items':[{'type':_0xc7de('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0xc7de('0x1c'),'required':!![]},'props':{'title':_0xc7de('0x1d'),'helpText':''}},{'type':_0xc7de('0x1b'),'props':{'title':_0xc7de('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc7de('0x5'),'type':_0xc7de('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc7de('0x1e')](_0xc7de('0x1f'))?JSON[_0xc7de('0x20')](this[_0xc7de('0x1e')]('onlineForm')):{};},'set':function(_0x272a47){return this[_0xc7de('0x21')](_0xc7de('0x1f'),JSON['stringify'](_0x272a47));}},'offlineForm':{'type':Sequelize[_0xc7de('0x11')],'defaultValue':function(){return JSON[_0xc7de('0x1a')]({'items':[{'type':_0xc7de('0x1b'),'props':{'title':_0xc7de('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc7de('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0xc7de('0x22')},'props':{'title':_0xc7de('0x22'),'helpText':_0xc7de('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xc7de('0x1e')](_0xc7de('0x24'))?JSON[_0xc7de('0x20')](this['getDataValue'](_0xc7de('0x24'))):{};},'set':function(_0x17836f){return this[_0xc7de('0x21')](_0xc7de('0x24'),JSON[_0xc7de('0x1a')](_0x17836f));}},'token':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc7de('0x3')]},'waitingTitle':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x25')},'waitingMessage':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x27')},'offlineMessageBody':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x29')},'skipUnmanaged':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x16')},'sendUnmanaged':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc7de('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc7de('0x2a');}},'notificationSound':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xc7de('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xc7de('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xc7de('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc7de('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc7de('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc7de('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':_0xc7de('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![],'comment':_0xc7de('0x2e'),'set':function(_0x43363e){if(!_0x43363e)this[_0xc7de('0x21')](_0xc7de('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x43363e);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc7de('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc7de('0x30')},'vidaooNote':{'type':Sequelize[_0xc7de('0x3')],'defaultValue':function(){return _0xc7de('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xc7de('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc7de('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc7de('0x11')]}}; \ No newline at end of file +var _0xb255=['Type\x20a\x20message','Skip','Feedback','thumb','star','stringify','input','text','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.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','squared','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error'];(function(_0x13a117,_0x361988){var _0x4e0590=function(_0x897486){while(--_0x897486){_0x13a117['push'](_0x13a117['shift']());}};_0x4e0590(++_0x361988);}(_0xb255,0x17d));var _0x5b25=function(_0x3e7e88,_0x28a495){_0x3e7e88=_0x3e7e88-0x0;var _0x2658c0=_0xb255[_0x3e7e88];return _0x2658c0;};'use strict';var Sequelize=require(_0x5b25('0x0'));var rs=require(_0x5b25('0x1'));module[_0x5b25('0x2')]={'name':{'type':Sequelize[_0x5b25('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5b25('0x4')},'description':{'type':Sequelize[_0x5b25('0x3')]},'mapKey':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x6')},'customerAlias':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5b25('0x3')],'allowNull':![],'defaultValue':_0x5b25('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5b25('0x3')],'allowNull':![],'defaultValue':_0x5b25('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5b25('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5b25('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5b25('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5b25('0x9')](_0x5b25('0xa'),_0x5b25('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0xc')},'offline_chat_button':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0xe')},'download_transcript':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5b25('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x12')},'noteTitle':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0xd')},'skipMessageButton':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0x15')},'ratingType':{'type':Sequelize[_0x5b25('0x9')]('star',_0x5b25('0x16')),'defaultValue':_0x5b25('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5b25('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5b25('0x18')]({'items':[{'type':_0x5b25('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x5b25('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5b25('0x19'),'props':{'title':_0x5b25('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5b25('0x5'),'type':_0x5b25('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5b25('0x1b')](_0x5b25('0x1c'))?JSON[_0x5b25('0x1d')](this['getDataValue'](_0x5b25('0x1c'))):{};},'set':function(_0x1442dc){return this[_0x5b25('0x1e')](_0x5b25('0x1c'),JSON[_0x5b25('0x18')](_0x1442dc));}},'offlineForm':{'type':Sequelize[_0x5b25('0x11')],'defaultValue':function(){return JSON[_0x5b25('0x18')]({'items':[{'type':_0x5b25('0x19'),'props':{'title':_0x5b25('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5b25('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x5b25('0x1f')},'props':{'title':_0x5b25('0x1f'),'helpText':_0x5b25('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x5b25('0x1b')](_0x5b25('0x21'))?JSON[_0x5b25('0x1d')](this[_0x5b25('0x1b')](_0x5b25('0x21'))):{};},'set':function(_0x3d3d8b){return this[_0x5b25('0x1e')](_0x5b25('0x21'),JSON[_0x5b25('0x18')](_0x3d3d8b));}},'token':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':function(){return rs[_0x5b25('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5b25('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5b25('0x3')]},'waitingTitle':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':_0x5b25('0x26')},'skipUnmanaged':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5b25('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5b25('0x3')]},'notificationTemplate':{'type':Sequelize[_0x5b25('0x11')],'defaultValue':function(){return _0x5b25('0x27');}},'notificationSound':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x5b25('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0x28')},'verticalAlignment':{'type':Sequelize[_0x5b25('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x5b25('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5b25('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5b25('0x3')],'allowNull':![],'defaultValue':_0x5b25('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5b25('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b25('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x5b25('0x2b')},'systemAvatar':{'type':Sequelize[_0x5b25('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b25('0x8')],'comment':_0x5b25('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![],'comment':_0x5b25('0x2d'),'set':function(_0x1b30f4){if(!_0x1b30f4)this['setDataValue'](_0x5b25('0x2e'),null);this[_0x5b25('0x1e')](_0x5b25('0x2f'),_0x1b30f4);}},'vidaooEscalation':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5b25('0x30')},'vidaooNote':{'type':Sequelize[_0x5b25('0x3')],'defaultValue':function(){return _0x5b25('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5b25('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5b25('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index e5d141d..d7a572a 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 _0xb8fe=['Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','UserProfileResource','destroy','send','map','ChatWebsite','rawAttributes','fieldName','name','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChatWebsites','UserProfileSection','autoAssociation','mandatoryDispositionPause','describe','addDisposition','Disposition','findOne','intersection','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','priority','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','UserId','unshift','agent','Start','startRouting','EventManager','notify','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','ListId','findOrCreate','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','nolimit','User','fullname','Tag','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8fe,0x14b));var _0xeb8f=function(_0x420ddd,_0x213ecb){_0x420ddd=_0x420ddd-0x0;var _0xcc294=_0xb8fe[_0x420ddd];return _0xcc294;};'use strict';var emlformat=require(_0xeb8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb8f('0x1'));var rp=require(_0xeb8f('0x2'));var moment=require(_0xeb8f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeb8f('0x4'));var path=require(_0xeb8f('0x5'));var sox=require(_0xeb8f('0x6'));var csv=require(_0xeb8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb8f('0x8'));var _=require('lodash');var squel=require(_0xeb8f('0x9'));var crypto=require(_0xeb8f('0xa'));var jsforce=require(_0xeb8f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeb8f('0x7'));var querystring=require(_0xeb8f('0xc'));var Papa=require(_0xeb8f('0xd'));var Redis=require(_0xeb8f('0xe'));var authService=require(_0xeb8f('0xf'));var qs=require(_0xeb8f('0x10'));var as=require(_0xeb8f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb8f('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeb8f('0x13'))['db'];config[_0xeb8f('0x14')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb8f('0x15'))(new Redis(config[_0xeb8f('0x14')]));require(_0xeb8f('0x16'))[_0xeb8f('0x17')](socket);var jayson=require(_0xeb8f('0x18'));var client=jayson[_0xeb8f('0x19')][_0xeb8f('0x1a')]({'port':0x232c});var client9002=jayson[_0xeb8f('0x19')][_0xeb8f('0x1a')]({'port':0x232a});var client9003=jayson[_0xeb8f('0x19')][_0xeb8f('0x1a')]({'port':0x232b});var client9001=jayson[_0xeb8f('0x19')][_0xeb8f('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x399868,_0x4b0471,_0x5503f1,_0x48acbe){return new BPromise(function(_0xfa8dec,_0x199cfc){var _0x32e32b=_0x48acbe||client;return _0x32e32b[_0xeb8f('0x1b')](_0x399868,_0x5503f1)[_0xeb8f('0x1c')](function(_0x808cda){logger[_0xeb8f('0x1d')](_0xeb8f('0x1e'),_0x4b0471,'request\x20sent');logger[_0xeb8f('0x1f')](_0xeb8f('0x20'),_0x4b0471,_0xeb8f('0x21'),JSON[_0xeb8f('0x22')](_0x808cda));if(_0x808cda['error']){if(_0x808cda[_0xeb8f('0x23')][_0xeb8f('0x24')]===0x1f4){logger['error'](_0xeb8f('0x1e'),_0x4b0471,_0x808cda[_0xeb8f('0x23')][_0xeb8f('0x25')]);return _0x199cfc(_0x808cda[_0xeb8f('0x23')][_0xeb8f('0x25')]);}logger[_0xeb8f('0x23')](_0xeb8f('0x1e'),_0x4b0471,_0x808cda[_0xeb8f('0x23')][_0xeb8f('0x25')]);return _0xfa8dec(_0x808cda[_0xeb8f('0x23')][_0xeb8f('0x25')]);}else{logger[_0xeb8f('0x1d')](_0xeb8f('0x1e'),_0x4b0471,_0xeb8f('0x21'));_0xfa8dec(_0x808cda['result'][_0xeb8f('0x25')]);}})[_0xeb8f('0x26')](function(_0x11cb01){logger['error'](_0xeb8f('0x1e'),_0x4b0471,_0x11cb01);_0x199cfc(_0x11cb01);});});}function respondWithStatusCode(_0x2a271c,_0x27fc47){_0x27fc47=_0x27fc47||0xcc;return function(_0x50c275){if(_0x50c275){return _0x2a271c[_0xeb8f('0x27')](_0x27fc47);}return _0x2a271c[_0xeb8f('0x28')](_0x27fc47)[_0xeb8f('0x29')]();};}function respondWithResult(_0x27e6f6,_0x26c25b){_0x26c25b=_0x26c25b||0xc8;return function(_0x1ff8cc){if(_0x1ff8cc){return _0x27e6f6[_0xeb8f('0x28')](_0x26c25b)['json'](_0x1ff8cc);}};}function respondWithFilteredResult(_0x1cce59,_0x3bba24){return function(_0x56a360){if(_0x56a360){var _0x335db3=typeof _0x3bba24[_0xeb8f('0x2a')]===_0xeb8f('0x2b')&&typeof _0x3bba24[_0xeb8f('0x2c')]===_0xeb8f('0x2b');var _0x336df8=_0x56a360[_0xeb8f('0x2d')];var _0x2a0770=_0x335db3?0x0:_0x3bba24['offset'];var _0x275f67=_0x335db3?_0x56a360[_0xeb8f('0x2d')]:_0x3bba24[_0xeb8f('0x2a')]+_0x3bba24['limit'];var _0x518dce;if(_0x275f67>=_0x336df8){_0x275f67=_0x336df8;_0x518dce=0xc8;}else{_0x518dce=0xce;}_0x1cce59[_0xeb8f('0x28')](_0x518dce);return _0x1cce59[_0xeb8f('0x2e')](_0xeb8f('0x2f'),_0x2a0770+'-'+_0x275f67+'/'+_0x336df8)['json'](_0x56a360);}return null;};}function patchUpdates(_0x1ffbb5){return function(_0x1b7a32){try{jsonpatch[_0xeb8f('0x30')](_0x1b7a32,_0x1ffbb5,!![]);}catch(_0x41245b){return BPromise[_0xeb8f('0x31')](_0x41245b);}return _0x1b7a32['save']();};}function saveUpdates(_0x366732,_0x549392){return function(_0xb7c112){if(_0xb7c112){return _0xb7c112[_0xeb8f('0x32')](_0x366732)[_0xeb8f('0x1c')](function(_0x1b40dc){return _0x1b40dc;});}return null;};}function removeEntity(_0x4361d4,_0x6df854){return function(_0x5c930e){if(_0x5c930e){return _0x5c930e['destroy']()[_0xeb8f('0x1c')](function(){var _0x8712c4=_0x5c930e['get']({'plain':!![]});var _0x125338='ChatWebsites';return db[_0xeb8f('0x33')][_0xeb8f('0x34')]({'where':{'type':_0x125338,'resourceId':_0x8712c4['id']}})[_0xeb8f('0x1c')](function(){return _0x5c930e;});})['then'](function(){_0x4361d4['status'](0xcc)[_0xeb8f('0x29')]();});}};}function handleEntityNotFound(_0x49d3cd,_0x2dfc94){return function(_0x53e231){if(!_0x53e231){_0x49d3cd[_0xeb8f('0x27')](0x194);}return _0x53e231;};}function handleError(_0x1e183f,_0x30264c){_0x30264c=_0x30264c||0x1f4;return function(_0x50ca39){logger[_0xeb8f('0x23')](_0x50ca39['stack']);if(_0x50ca39['name']){delete _0x50ca39['name'];}_0x1e183f[_0xeb8f('0x28')](_0x30264c)[_0xeb8f('0x35')](_0x50ca39);};}exports['index']=function(_0x12fe67,_0x72ab8e){var _0x4e7d27={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4e98d8={},_0x154586={'count':0x0,'rows':[]};var _0x4f41a1=_[_0xeb8f('0x36')](db[_0xeb8f('0x37')][_0xeb8f('0x38')],function(_0x51fa05){return{'name':_0x51fa05[_0xeb8f('0x39')],'type':_0x51fa05['type']['key']};});_0x4e98d8['model']=_[_0xeb8f('0x36')](_0x4f41a1,_0xeb8f('0x3a'));_0x4e98d8[_0xeb8f('0x3b')]=_[_0xeb8f('0x3c')](_0x12fe67[_0xeb8f('0x3b')]);_0x4e98d8[_0xeb8f('0x3d')]=_['intersection'](_0x4e98d8['model'],_0x4e98d8[_0xeb8f('0x3b')]);_0x4e7d27['attributes']=_['intersection'](_0x4e98d8[_0xeb8f('0x3e')],qs[_0xeb8f('0x3f')](_0x12fe67[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0x4e7d27[_0xeb8f('0x40')]=_0x4e7d27[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0x4e7d27['attributes']:_0x4e98d8[_0xeb8f('0x3e')];if(!_0x12fe67['query'][_0xeb8f('0x42')]('nolimit')){_0x4e7d27['limit']=qs[_0xeb8f('0x2c')](_0x12fe67['query'][_0xeb8f('0x2c')]);_0x4e7d27[_0xeb8f('0x2a')]=qs['offset'](_0x12fe67['query'][_0xeb8f('0x2a')]);}_0x4e7d27[_0xeb8f('0x43')]=qs[_0xeb8f('0x44')](_0x12fe67[_0xeb8f('0x3b')]['sort']);_0x4e7d27['where']=qs[_0xeb8f('0x3d')](_[_0xeb8f('0x45')](_0x12fe67[_0xeb8f('0x3b')],_0x4e98d8['filters']),_0x4f41a1);if(_0x12fe67['query'][_0xeb8f('0x46')]){_0x4e7d27[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0x4e7d27['where'],{'$or':_[_0xeb8f('0x36')](_0x4f41a1,function(_0x4b9c86){if(_0x4b9c86[_0xeb8f('0x49')]!=='VIRTUAL'){var _0x79ca13={};_0x79ca13[_0x4b9c86[_0xeb8f('0x3a')]]={'$like':'%'+_0x12fe67[_0xeb8f('0x3b')]['filter']+'%'};return _0x79ca13;}})});}_0x4e7d27=_[_0xeb8f('0x48')]({},_0x4e7d27,_0x12fe67[_0xeb8f('0x4a')]);var _0x2c2825={'where':_0x4e7d27[_0xeb8f('0x47')]};return db['ChatWebsite']['count'](_0x2c2825)['then'](function(_0x5af74b){_0x154586[_0xeb8f('0x2d')]=_0x5af74b;if(_0x12fe67[_0xeb8f('0x3b')][_0xeb8f('0x4b')]){_0x4e7d27[_0xeb8f('0x4c')]=[{'all':!![]}];}return db[_0xeb8f('0x37')]['findAll'](_0x4e7d27);})[_0xeb8f('0x1c')](function(_0x176070){_0x154586[_0xeb8f('0x4d')]=_0x176070;return _0x154586;})[_0xeb8f('0x1c')](respondWithFilteredResult(_0x72ab8e,_0x4e7d27))[_0xeb8f('0x26')](handleError(_0x72ab8e,null));};exports[_0xeb8f('0x4e')]=function(_0x4b4873,_0x2f6f77){var _0x247e95={'raw':![],'where':{'id':_0x4b4873[_0xeb8f('0x4f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x33b29c={};_0x33b29c[_0xeb8f('0x3e')]=_[_0xeb8f('0x3c')](db[_0xeb8f('0x37')]['rawAttributes']);_0x33b29c[_0xeb8f('0x3b')]=_[_0xeb8f('0x3c')](_0x4b4873[_0xeb8f('0x3b')]);_0x33b29c['filters']=_['intersection'](_0x33b29c[_0xeb8f('0x3e')],_0x33b29c[_0xeb8f('0x3b')]);_0x247e95[_0xeb8f('0x40')]=_['intersection'](_0x33b29c['model'],qs[_0xeb8f('0x3f')](_0x4b4873[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0x247e95['attributes']=_0x247e95[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0x247e95[_0xeb8f('0x40')]:_0x33b29c[_0xeb8f('0x3e')];if(_0x4b4873[_0xeb8f('0x3b')]['includeAll']){_0x247e95[_0xeb8f('0x4c')]=[{'all':!![]}];}_0x247e95=_[_0xeb8f('0x48')]({},_0x247e95,_0x4b4873[_0xeb8f('0x4a')]);return db[_0xeb8f('0x37')][_0xeb8f('0x50')](_0x247e95)[_0xeb8f('0x1c')](handleEntityNotFound(_0x2f6f77,null))[_0xeb8f('0x1c')](respondWithResult(_0x2f6f77,null))[_0xeb8f('0x26')](handleError(_0x2f6f77,null));};exports[_0xeb8f('0x51')]=function(_0x40fd3a,_0x5dc5fb){return db['ChatWebsite']['create'](_0x40fd3a[_0xeb8f('0x52')],{})[_0xeb8f('0x1c')](function(_0x2b0ade){var _0x1b4c44=_0x40fd3a[_0xeb8f('0x53')]['get']({'plain':!![]});if(!_0x1b4c44)throw new Error(_0xeb8f('0x54'));if(_0x1b4c44[_0xeb8f('0x55')]===_0xeb8f('0x53')){var _0x57159e=_0x2b0ade[_0xeb8f('0x56')]({'plain':!![]});var _0x21f782=_0xeb8f('0x57');return db[_0xeb8f('0x58')][_0xeb8f('0x50')]({'where':{'name':_0x21f782,'userProfileId':_0x1b4c44['userProfileId']},'raw':!![]})[_0xeb8f('0x1c')](function(_0x2f9c4f){if(_0x2f9c4f&&_0x2f9c4f[_0xeb8f('0x59')]===0x0){return db[_0xeb8f('0x33')][_0xeb8f('0x51')]({'name':_0x57159e[_0xeb8f('0x3a')],'resourceId':_0x57159e['id'],'type':_0x2f9c4f[_0xeb8f('0x3a')],'sectionId':_0x2f9c4f['id']},{})[_0xeb8f('0x1c')](function(){return _0x2b0ade;});}else{return _0x2b0ade;}})[_0xeb8f('0x26')](function(_0x25a296){logger[_0xeb8f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25a296);throw _0x25a296;});}return _0x2b0ade;})[_0xeb8f('0x1c')](respondWithResult(_0x5dc5fb,0xc9))['catch'](handleError(_0x5dc5fb,null));};exports[_0xeb8f('0x32')]=function(_0x1aa58c,_0x1b5d0f){if(_0x1aa58c[_0xeb8f('0x52')]['id']){delete _0x1aa58c[_0xeb8f('0x52')]['id'];}return db['ChatWebsite'][_0xeb8f('0x50')]({'where':{'id':_0x1aa58c[_0xeb8f('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0xeb8f('0x5a')}]})[_0xeb8f('0x1c')](handleEntityNotFound(_0x1b5d0f,null))[_0xeb8f('0x1c')](saveUpdates(_0x1aa58c[_0xeb8f('0x52')],null))[_0xeb8f('0x1c')](respondWithResult(_0x1b5d0f,null))[_0xeb8f('0x26')](handleError(_0x1b5d0f,null));};exports[_0xeb8f('0x34')]=function(_0x71915e,_0x175a7d){return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x71915e[_0xeb8f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x175a7d,null))[_0xeb8f('0x1c')](removeEntity(_0x175a7d,null))[_0xeb8f('0x26')](handleError(_0x175a7d,null));};exports[_0xeb8f('0x5b')]=function(_0x4e7d38,_0x3c39bd){return db[_0xeb8f('0x37')]['describe']()['then'](respondWithResult(_0x3c39bd,null))['catch'](handleError(_0x3c39bd,null));};exports[_0xeb8f('0x5c')]=function(_0x56703a,_0x25c4f0,_0x207114){if(_0x56703a[_0xeb8f('0x52')]['id']){delete _0x56703a[_0xeb8f('0x52')]['id'];}return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x56703a[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x25c4f0,null))['then'](function(_0x446c54){if(_0x446c54){_0x56703a[_0xeb8f('0x52')]['ChatWebsiteId']=_0x446c54['id'];return db[_0xeb8f('0x5d')][_0xeb8f('0x51')](_0x56703a[_0xeb8f('0x52')]);}})['then'](respondWithResult(_0x25c4f0,null))[_0xeb8f('0x26')](handleError(_0x25c4f0,null));};exports['getDispositions']=function(_0x1c3169,_0x29312c,_0x224c6d){var _0x265044={'raw':![],'where':{}};var _0x31fff7={};var _0x41fb4d={'count':0x0,'rows':[]};return db[_0xeb8f('0x37')][_0xeb8f('0x5e')]({'where':{'id':_0x1c3169[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x29312c,null))[_0xeb8f('0x1c')](function(_0x32be69){if(_0x32be69){_0x31fff7['model']=_['keys'](db['Disposition'][_0xeb8f('0x38')]);_0x31fff7[_0xeb8f('0x3b')]=_[_0xeb8f('0x3c')](_0x1c3169[_0xeb8f('0x3b')]);_0x31fff7[_0xeb8f('0x3d')]=_[_0xeb8f('0x5f')](_0x31fff7[_0xeb8f('0x3e')],_0x31fff7['query']);_0x265044[_0xeb8f('0x40')]=_[_0xeb8f('0x5f')](_0x31fff7[_0xeb8f('0x3e')],qs[_0xeb8f('0x3f')](_0x1c3169[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0x265044[_0xeb8f('0x40')]=_0x265044[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0x265044['attributes']:_0x31fff7[_0xeb8f('0x3e')];if(!_0x1c3169[_0xeb8f('0x3b')]['hasOwnProperty']('nolimit')){_0x265044[_0xeb8f('0x2c')]=qs[_0xeb8f('0x2c')](_0x1c3169[_0xeb8f('0x3b')][_0xeb8f('0x2c')]);_0x265044[_0xeb8f('0x2a')]=qs[_0xeb8f('0x2a')](_0x1c3169['query'][_0xeb8f('0x2a')]);}_0x265044['order']=qs[_0xeb8f('0x44')](_0x1c3169[_0xeb8f('0x3b')]['sort']);_0x265044[_0xeb8f('0x47')]=qs[_0xeb8f('0x3d')](_['pick'](_0x1c3169[_0xeb8f('0x3b')],_0x31fff7[_0xeb8f('0x3d')]));_0x265044[_0xeb8f('0x47')][_0xeb8f('0x60')]=_0x32be69['id'];if(_0x1c3169[_0xeb8f('0x3b')][_0xeb8f('0x46')]){_0x265044[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0x265044[_0xeb8f('0x47')],{'$or':_[_0xeb8f('0x36')](_0x265044['attributes'],function(_0x4ca2a0){var _0x51c77a={};_0x51c77a[_0x4ca2a0]={'$like':'%'+_0x1c3169[_0xeb8f('0x3b')][_0xeb8f('0x46')]+'%'};return _0x51c77a;})});}_0x265044=_[_0xeb8f('0x48')]({},_0x265044,_0x1c3169['options']);return db[_0xeb8f('0x5d')][_0xeb8f('0x2d')]({'where':_0x265044[_0xeb8f('0x47')]})['then'](function(_0x509271){_0x41fb4d[_0xeb8f('0x2d')]=_0x509271;if(_0x1c3169[_0xeb8f('0x3b')][_0xeb8f('0x4b')]){_0x265044[_0xeb8f('0x4c')]=[{'all':!![]}];}return db[_0xeb8f('0x5d')][_0xeb8f('0x61')](_0x265044);})['then'](function(_0x410860){_0x41fb4d[_0xeb8f('0x4d')]=_0x410860;return _0x41fb4d;});}})[_0xeb8f('0x1c')](respondWithFilteredResult(_0x29312c,_0x265044))[_0xeb8f('0x26')](handleError(_0x29312c,null));};exports[_0xeb8f('0x62')]=function(_0x2e16c4,_0x293c39,_0x3c248d){return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x2e16c4[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x293c39,null))['then'](function(_0x126e30){if(_0x126e30){return _0x126e30[_0xeb8f('0x62')](_0x2e16c4[_0xeb8f('0x3b')][_0xeb8f('0x63')]);}})[_0xeb8f('0x1c')](respondWithStatusCode(_0x293c39,null))[_0xeb8f('0x26')](handleError(_0x293c39,null));};exports[_0xeb8f('0x64')]=function(_0x280504,_0x17141d,_0x4620b1){if(_0x280504[_0xeb8f('0x52')]['id']){delete _0x280504[_0xeb8f('0x52')]['id'];}return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x280504[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x17141d,null))[_0xeb8f('0x1c')](function(_0x3ac8df){if(_0x3ac8df){_0x280504[_0xeb8f('0x52')][_0xeb8f('0x60')]=_0x3ac8df['id'];return db[_0xeb8f('0x65')][_0xeb8f('0x51')](_0x280504[_0xeb8f('0x52')]);}})[_0xeb8f('0x1c')](respondWithResult(_0x17141d,null))[_0xeb8f('0x26')](handleError(_0x17141d,null));};exports[_0xeb8f('0x66')]=function(_0x31bb92,_0x3f695b,_0x2faa3d){var _0x502d06={'raw':![],'where':{}};var _0x36ab5c={};var _0x11cf45={'count':0x0,'rows':[]};return db[_0xeb8f('0x37')][_0xeb8f('0x5e')]({'where':{'id':_0x31bb92[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x3f695b,null))[_0xeb8f('0x1c')](function(_0x476507){if(_0x476507){_0x36ab5c[_0xeb8f('0x3e')]=_[_0xeb8f('0x3c')](db['CannedAnswer']['rawAttributes']);_0x36ab5c[_0xeb8f('0x3b')]=_[_0xeb8f('0x3c')](_0x31bb92['query']);_0x36ab5c['filters']=_[_0xeb8f('0x5f')](_0x36ab5c[_0xeb8f('0x3e')],_0x36ab5c[_0xeb8f('0x3b')]);_0x502d06[_0xeb8f('0x40')]=_['intersection'](_0x36ab5c[_0xeb8f('0x3e')],qs[_0xeb8f('0x3f')](_0x31bb92['query'][_0xeb8f('0x3f')]));_0x502d06[_0xeb8f('0x40')]=_0x502d06[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0x502d06['attributes']:_0x36ab5c['model'];if(!_0x31bb92[_0xeb8f('0x3b')]['hasOwnProperty']('nolimit')){_0x502d06['limit']=qs[_0xeb8f('0x2c')](_0x31bb92['query'][_0xeb8f('0x2c')]);_0x502d06[_0xeb8f('0x2a')]=qs[_0xeb8f('0x2a')](_0x31bb92['query'][_0xeb8f('0x2a')]);}_0x502d06[_0xeb8f('0x43')]=qs[_0xeb8f('0x44')](_0x31bb92[_0xeb8f('0x3b')]['sort']);_0x502d06['where']=qs[_0xeb8f('0x3d')](_['pick'](_0x31bb92[_0xeb8f('0x3b')],_0x36ab5c[_0xeb8f('0x3d')]));_0x502d06[_0xeb8f('0x47')][_0xeb8f('0x60')]=_0x476507['id'];if(_0x31bb92[_0xeb8f('0x3b')]['filter']){_0x502d06[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0x502d06['where'],{'$or':_[_0xeb8f('0x36')](_0x502d06[_0xeb8f('0x40')],function(_0xd61352){var _0x34bd35={};_0x34bd35[_0xd61352]={'$like':'%'+_0x31bb92[_0xeb8f('0x3b')][_0xeb8f('0x46')]+'%'};return _0x34bd35;})});}_0x502d06=_[_0xeb8f('0x48')]({},_0x502d06,_0x31bb92[_0xeb8f('0x4a')]);return db['CannedAnswer'][_0xeb8f('0x2d')]({'where':_0x502d06[_0xeb8f('0x47')]})['then'](function(_0x2a8907){_0x11cf45[_0xeb8f('0x2d')]=_0x2a8907;if(_0x31bb92[_0xeb8f('0x3b')][_0xeb8f('0x4b')]){_0x502d06[_0xeb8f('0x4c')]=[{'all':!![]}];}return db[_0xeb8f('0x65')][_0xeb8f('0x61')](_0x502d06);})[_0xeb8f('0x1c')](function(_0x2b9d22){_0x11cf45[_0xeb8f('0x4d')]=_0x2b9d22;return _0x11cf45;});}})[_0xeb8f('0x1c')](respondWithFilteredResult(_0x3f695b,_0x502d06))['catch'](handleError(_0x3f695b,null));};exports['removeAnswers']=function(_0x41d607,_0xcd88bf,_0x257918){return db[_0xeb8f('0x37')]['find']({'where':{'id':_0x41d607[_0xeb8f('0x4f')]['id']}})['then'](handleEntityNotFound(_0xcd88bf,null))[_0xeb8f('0x1c')](function(_0x55723d){if(_0x55723d){return _0x55723d[_0xeb8f('0x67')](_0x41d607[_0xeb8f('0x3b')][_0xeb8f('0x63')]);}})['then'](respondWithStatusCode(_0xcd88bf,null))[_0xeb8f('0x26')](handleError(_0xcd88bf,null));};exports[_0xeb8f('0x68')]=function(_0x5150a6,_0x12f6d1,_0x4d2f6b){_0x5150a6[_0xeb8f('0x52')][_0xeb8f('0x69')]=_0x5150a6[_0xeb8f('0x6a')][_0xeb8f('0x6b')];return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x5150a6[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x12f6d1,null))['then'](saveUpdates(_0x5150a6[_0xeb8f('0x52')],null))['then'](respondWithResult(_0x12f6d1,null))[_0xeb8f('0x26')](handleError(_0x12f6d1,null));};exports['addAvatar']=function(_0x3c6d25,_0x193213,_0x3da206){_0x3c6d25[_0xeb8f('0x52')][_0xeb8f('0x6c')]=_0x3c6d25[_0xeb8f('0x6a')][_0xeb8f('0x6b')];return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x3c6d25[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x193213,null))[_0xeb8f('0x1c')](saveUpdates(_0x3c6d25[_0xeb8f('0x52')],null))[_0xeb8f('0x1c')](respondWithResult(_0x193213,null))[_0xeb8f('0x26')](handleError(_0x193213,null));};exports[_0xeb8f('0x6d')]=function(_0x389b41,_0x5385be,_0x292946){_0x389b41[_0xeb8f('0x52')][_0xeb8f('0x6e')]=_0x389b41[_0xeb8f('0x6a')][_0xeb8f('0x6b')];return db[_0xeb8f('0x37')]['find']({'where':{'id':_0x389b41[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x5385be,null))[_0xeb8f('0x1c')](saveUpdates(_0x389b41['body'],null))[_0xeb8f('0x1c')](respondWithResult(_0x5385be,null))[_0xeb8f('0x26')](handleError(_0x5385be,null));};exports[_0xeb8f('0x6f')]=function(_0x53beed,_0x40d522,_0x6b1c08){_0x53beed[_0xeb8f('0x52')]['systemAvatar']=_0x53beed['file']['filename'];return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x53beed['params']['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x40d522,null))['then'](saveUpdates(_0x53beed[_0xeb8f('0x52')],null))['then'](respondWithResult(_0x40d522,null))[_0xeb8f('0x26')](handleError(_0x40d522,null));};exports[_0xeb8f('0x70')]=function(_0xe28e8,_0x36b092,_0x2f1a20){var _0x5ac317=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x73'));var _0x40e93c={'where':{'id':_0xe28e8[_0xeb8f('0x4f')]['id']},'attributes':['id',_0xeb8f('0x69')],'raw':!![]};var _0x38b4d2=![];return require(_0xeb8f('0x74'))[_0xeb8f('0x75')]()['then'](function(_0x2358a0){if(_0x2358a0){_0x38b4d2=_0x2358a0[_0xeb8f('0x76')];}})[_0xeb8f('0x1c')](function(){return db[_0xeb8f('0x37')]['find'](_0x40e93c);})[_0xeb8f('0x1c')](handleEntityNotFound(_0x36b092,null))[_0xeb8f('0x1c')](function(_0x159b89){if(_0x159b89){if(!_[_0xeb8f('0x77')](_0x159b89[_0xeb8f('0x69')])){if(fs['existsSync'](path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],'server/files/images/logos/',_0x159b89[_0xeb8f('0x69')]))&&_0x38b4d2){_0x5ac317=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x78'),_0x159b89[_0xeb8f('0x69')]);}}return _0x36b092[_0xeb8f('0x79')](_0x5ac317);}})['catch'](handleError(_0x36b092,null));};exports[_0xeb8f('0x7a')]=function(_0x38ab05,_0x59df3a,_0x165835){var _0x37d859=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x7b'));var _0x2dad68={'where':{'id':_0x38ab05['params']['id']},'attributes':['id',_0xeb8f('0x6c')],'raw':!![]};return db['ChatWebsite'][_0xeb8f('0x50')](_0x2dad68)[_0xeb8f('0x1c')](handleEntityNotFound(_0x59df3a,null))[_0xeb8f('0x1c')](function(_0x133d2a){if(_0x133d2a){if(!_[_0xeb8f('0x77')](_0x133d2a[_0xeb8f('0x6c')])){if(fs[_0xeb8f('0x7c')](path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x7d'),_0x133d2a[_0xeb8f('0x6c')]))){_0x37d859=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],'server/files/images/avatars/',_0x133d2a[_0xeb8f('0x6c')]);}}return _0x59df3a[_0xeb8f('0x79')](_0x37d859);}})['catch'](handleError(_0x59df3a,null));};exports['getCustomerAvatar']=function(_0x298fba,_0x16fa98,_0x1fb8c6){var _0x4940b0=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x7e'));var _0x46062d={'where':{'id':_0x298fba['params']['id']},'attributes':['id',_0xeb8f('0x6e'),_0xeb8f('0x7f')],'raw':!![]};return db[_0xeb8f('0x37')][_0xeb8f('0x50')](_0x46062d)[_0xeb8f('0x1c')](handleEntityNotFound(_0x16fa98,null))['then'](function(_0x24f527){if(_0x24f527){if(!_[_0xeb8f('0x77')](_0x24f527[_0xeb8f('0x6e')])){if(fs[_0xeb8f('0x7c')](path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x7d'),_0x24f527['customerAvatar']))&&_0x24f527[_0xeb8f('0x7f')]){_0x4940b0=path['join'](config[_0xeb8f('0x72')],'server/files/images/avatars/',_0x24f527[_0xeb8f('0x6e')]);}}return _0x16fa98[_0xeb8f('0x79')](_0x4940b0);}})[_0xeb8f('0x26')](handleError(_0x16fa98,null));};exports[_0xeb8f('0x80')]=function(_0x51a1b8,_0x3bf3d7,_0x2689d9){var _0x228397=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x81'));var _0x15ffb7={'where':{'id':_0x51a1b8[_0xeb8f('0x4f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xeb8f('0x37')][_0xeb8f('0x50')](_0x15ffb7)['then'](handleEntityNotFound(_0x3bf3d7,null))['then'](function(_0x5d52af){if(_0x5d52af){if(!_[_0xeb8f('0x77')](_0x5d52af[_0xeb8f('0x82')])){if(fs['existsSync'](path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x7d'),_0x5d52af['systemAvatar']))){_0x228397=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0x7d'),_0x5d52af['systemAvatar']);}}return _0x3bf3d7['download'](_0x228397);}})[_0xeb8f('0x26')](handleError(_0x3bf3d7,null));};exports['notify']=function(_0x586aaf,_0x3652e2,_0x47a7f9){var _0x8ea87f=require(_0xeb8f('0x83'));var _0x3ac2c1=new _0x8ea87f();var _0x3d0573=_0x3ac2c1[_0xeb8f('0x84')](_0x586aaf[_0xeb8f('0x85')][_0xeb8f('0x86')])[_0xeb8f('0x87')]();var _0x2dfabd={'body':_0x586aaf[_0xeb8f('0x52')],'channel':_0xeb8f('0x88')};var _0x295b6d=[];var _0x464d9d=[];var _0x375fb0={};var _0x3dcda4=![];return db[_0xeb8f('0x89')]['describe']()['then'](function(_0x516c2c){if(!_0x516c2c){throw new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))](_0xeb8f('0x8c'));}_0x295b6d=_[_0xeb8f('0x8d')](_[_0xeb8f('0x3c')](_0x516c2c),['createdAt',_0xeb8f('0x8e')]);_0x464d9d=_['difference'](_[_0xeb8f('0x3c')](_0x516c2c),['createdAt',_0xeb8f('0x8e'),_0xeb8f('0x8f'),'ListId']);if(_0x586aaf[_0xeb8f('0x52')]['id']){delete _0x586aaf['body']['id'];}if(_[_0xeb8f('0x77')](_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0x90')])){throw new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))](_0xeb8f('0x91'));}if(_[_0xeb8f('0x77')](_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0x52')])||_0x586aaf['body'][_0xeb8f('0x52')]===''){throw new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))](_0xeb8f('0x92'));}if(_[_0xeb8f('0x77')](_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0x93')])){throw new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))](_0xeb8f('0x94')+_0x464d9d);}if(!_['includes'](_0x464d9d,_0x586aaf['body']['mapKey'])){throw new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x464d9d);}_0x375fb0[_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0x93')]]=_0x586aaf['body'][_0xeb8f('0x90')];})[_0xeb8f('0x1c')](function(){return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x586aaf[_0xeb8f('0x4f')]['id']},'include':[{'model':db[_0xeb8f('0x95')],'as':_0xeb8f('0x96'),'include':[{'model':db['CmContact'],'as':_0xeb8f('0x97'),'where':_0x375fb0,'limit':0x1,'order':[['updatedAt',_0xeb8f('0x98')]]}]},{'model':db[_0xeb8f('0x99')],'as':_0xeb8f('0x9a')}]});})['then'](handleEntityNotFound(_0x3652e2,null))[_0xeb8f('0x1c')](function(_0x530379){if(_0x530379&&_0x530379[_0xeb8f('0x96')]){_0x2dfabd['account']=_0x530379;_0x2dfabd[_0xeb8f('0x9b')]=_0x530379[_0xeb8f('0x9a')];_0x2dfabd[_0xeb8f('0x9c')]=_0x530379['List'];_0x2dfabd[_0xeb8f('0x9b')]=_[_0xeb8f('0x9d')](_0x2dfabd[_0xeb8f('0x9b')],[_0xeb8f('0x9e')],['asc']);if(_0x2dfabd['account']['Applications']){delete _0x2dfabd[_0xeb8f('0x9f')][_0xeb8f('0x9a')];}if(_0x2dfabd[_0xeb8f('0x9f')][_0xeb8f('0x96')]&&_0x2dfabd['account'][_0xeb8f('0x96')]['Contacts']['length']){return _0x2dfabd[_0xeb8f('0x9f')][_0xeb8f('0x96')]['Contacts'][0x0];}var _0x1585c8=_[_0xeb8f('0xa0')](_0x586aaf[_0xeb8f('0x52')],{'firstName':_0x586aaf['body']['from'],'ListId':_0x530379['ListId']});_0x1585c8[_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0x93')]]=_0x586aaf['body'][_0xeb8f('0x90')];return db[_0xeb8f('0x89')][_0xeb8f('0x51')](_0x1585c8,{'fields':_0x295b6d,'raw':!![]});}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x3652e2,null))['then'](function(_0x63cfb6){_0x2dfabd[_0xeb8f('0xa1')]=_0x63cfb6;var _0x40698e=_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xa2')];if(_0x586aaf[_0xeb8f('0x85')][_0xeb8f('0xa3')]){_0x40698e=_0x586aaf[_0xeb8f('0x85')][_0xeb8f('0xa3')];}else if(_0x586aaf['headers']['x-forwarded-for']){_0x40698e=_['first'](_0x586aaf['headers'][_0xeb8f('0xa4')][_0xeb8f('0xa5')](','));}if(_0x63cfb6){var _0x207172={'ContactId':_0x63cfb6['id'],'ChatWebsiteId':_0x586aaf[_0xeb8f('0x4f')]['id'],'from':(_0x63cfb6[_0xeb8f('0xa6')]||'')+'\x20'+(_0x63cfb6['lastName']||''),'customerIp':_0x40698e,'customerPort':_0x586aaf[_0xeb8f('0x85')]['x-real-port']?_0x586aaf[_0xeb8f('0x85')][_0xeb8f('0xa7')]:null,'referer':_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xa8')],'browserName':_0x3d0573[_0xeb8f('0xa9')][_0xeb8f('0x3a')]&&_0x3d0573[_0xeb8f('0xa9')][_0xeb8f('0xaa')]?util[_0xeb8f('0xab')](_0xeb8f('0xac'),_0x3d0573['browser'][_0xeb8f('0x3a')],_0x3d0573[_0xeb8f('0xa9')][_0xeb8f('0xaa')]):_0xeb8f('0xad'),'browserVersion':_0x3d0573['browser']['version']||_0xeb8f('0xad'),'osName':util[_0xeb8f('0xab')](_0xeb8f('0xac'),_0x3d0573['os'][_0xeb8f('0x3a')],_0x3d0573['os'][_0xeb8f('0xaa')]),'osVersion':_0x3d0573['os'][_0xeb8f('0xaa')],'deviceModel':_0x3d0573[_0xeb8f('0xae')]['model']&&_0x3d0573[_0xeb8f('0xae')][_0xeb8f('0xaf')]?util[_0xeb8f('0xab')]('%s\x20%s\x20%s',_0x3d0573[_0xeb8f('0xae')][_0xeb8f('0x3e')],_0x3d0573[_0xeb8f('0xae')][_0xeb8f('0xaf')],_0x3d0573[_0xeb8f('0xae')]['type']):null,'deviceVendor':_0x3d0573[_0xeb8f('0xae')][_0xeb8f('0xaf')],'deviceType':_0x3d0573[_0xeb8f('0xae')][_0xeb8f('0x49')],'formData':JSON[_0xeb8f('0x22')](_0x586aaf[_0xeb8f('0x52')])};var _0x50791a={'ChatWebsiteId':_0x586aaf['params']['id'],'closed':![]};if(_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb0')]){_0x50791a[_0xeb8f('0xb0')]=_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb0')];return db[_0xeb8f('0xb1')][_0xeb8f('0x50')]({'where':_0x50791a})[_0xeb8f('0x1c')](function(_0x4e71dc){if(_0x4e71dc){return[_0x4e71dc,![]];}_0x207172[_0xeb8f('0xb0')]=_0x586aaf[_0xeb8f('0x52')]['threadId'];_0x207172['externalUrl']=_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb2')];return db[_0xeb8f('0xb1')][_0xeb8f('0x51')](_0x207172)[_0xeb8f('0x1c')](function(_0x284684){return[_0x284684,!![]];});});}_0x50791a[_0xeb8f('0xb3')]=_0x63cfb6['id'];if(_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb4')]&&_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb4')]['id']){_0x50791a['id']=_0x586aaf[_0xeb8f('0x52')]['interaction']['id'];return db[_0xeb8f('0xb1')]['find']({'where':_0x50791a})[_0xeb8f('0x1c')](function(_0x3b6d42){if(_0x3b6d42){return[_0x3b6d42,![]];}return db[_0xeb8f('0xb1')][_0xeb8f('0x51')](_0x207172)['then'](function(_0x3200aa){return[_0x3200aa,!![]];});});}return db[_0xeb8f('0xb1')][_0xeb8f('0x51')](_0x207172)[_0xeb8f('0x1c')](function(_0x5eb905){return[_0x5eb905,!![]];});}})[_0xeb8f('0xb5')](function(_0x4d4b5d,_0x2b4d2b){if(_0x4d4b5d){_0x3dcda4=_0x2b4d2b;if(!_0x2b4d2b){var _0x233133={'from':(_0x2dfabd[_0xeb8f('0xa1')][_0xeb8f('0xa6')]||'')+'\x20'+(_0x2dfabd[_0xeb8f('0xa1')][_0xeb8f('0xb6')]||'')};if(_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb0')]&&_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0xb7')]&&_0x586aaf[_0xeb8f('0x52')]['threadId']!=_0x586aaf[_0xeb8f('0x52')]['messageId']){_0x233133[_0xeb8f('0xb0')]=_0x586aaf[_0xeb8f('0x52')]['messageId'];}return _0x4d4b5d[_0xeb8f('0x32')](_0x233133);}else{return _0x4d4b5d;}}})['then'](function(_0x26cf98){_0x2dfabd[_0xeb8f('0xb4')]=_0x26cf98['get']({'plain':!![]});_0x2dfabd[_0xeb8f('0xb4')][_0xeb8f('0xb8')]=_0x3dcda4;if(_0x2dfabd[_0xeb8f('0xb4')][_0xeb8f('0xb8')]){if(_0x2dfabd['account'][_0xeb8f('0xb9')]){_0x2dfabd[_0xeb8f('0x9b')][_0xeb8f('0xba')]({'id':0x0,'priority':_0x2dfabd[_0xeb8f('0x9b')][_0xeb8f('0x41')]+0x1,'app':_0xeb8f('0xbb'),'appdata':'unmanaged','interval':_0xeb8f('0xbc')});}}return db[_0xeb8f('0xbd')][_0xeb8f('0x51')]({'body':_0x586aaf[_0xeb8f('0x52')][_0xeb8f('0x52')],'ChatWebsiteId':_0x586aaf['params']['id'],'ChatInteractionId':_0x26cf98['id'],'direction':'in','ContactId':_0x2dfabd[_0xeb8f('0xa1')]['id'],'AttachmentId':_0x586aaf[_0xeb8f('0x52')]['AttachmentId']});})[_0xeb8f('0x1c')](function(_0x19c61a){_0x2dfabd['message']=_0x19c61a;if(_0x2dfabd[_0xeb8f('0xb4')][_0xeb8f('0xbe')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x2dfabd['interaction'][_0xeb8f('0xbe')]}})[_0xeb8f('0x1c')](function(_0x46143c){if(_0x46143c){_0x2dfabd[_0xeb8f('0x9b')][_0xeb8f('0xbf')]({'id':0x0,'priority':0x0,'app':_0xeb8f('0xc0'),'appdata':_0x46143c['name']+','+(_0x2dfabd[_0xeb8f('0x9f')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x2dfabd['forcedOwnership']=!![];}return respondWithRpcPromise(_0xeb8f('0xc1'),'startRouting',_0x2dfabd);});}return respondWithRpcPromise(_0xeb8f('0xc1'),_0xeb8f('0xc2'),_0x2dfabd);})[_0xeb8f('0x1c')](function(_0x4beb26){respondWithRpcPromise(_0xeb8f('0xc3'),_0xeb8f('0xc3'),{'event':_0xeb8f('0xc4'),'message':_0x4beb26},client9002);return _0x4beb26;})['then'](respondWithResult(_0x3652e2,null))['catch'](handleError(_0x3652e2,null));};exports['offline']=function(_0x3161b5,_0x267517,_0x37a0be){var _0x165d68,_0x1af7c7,_0x4300e1;var _0x16da4e=[];var _0x46cf32=[];var _0x5d1208={};var _0x458168=_0x3161b5[_0xeb8f('0xc5')]||[];var _0xeba390=[];var _0x57a175;return db[_0xeb8f('0x89')][_0xeb8f('0x5b')]()['then'](function(_0xd0e715){if(!_0xd0e715){throw new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))]('no\x20available\x20attributes');}_0x46cf32=_['difference'](_[_0xeb8f('0x3c')](_0xd0e715),[_0xeb8f('0xc6'),'updatedAt']);_0x16da4e=_[_0xeb8f('0x8d')](_[_0xeb8f('0x3c')](_0xd0e715),[_0xeb8f('0xc6'),_0xeb8f('0x8e'),_0xeb8f('0x8f'),'ListId']);if(_0x3161b5['body']['id']){delete _0x3161b5[_0xeb8f('0x52')]['id'];}if(_['isNil'](_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0x90')])){throw _0x267517[_0xeb8f('0x28')](0x1f4)[_0xeb8f('0x35')](new db[(_0xeb8f('0x8a'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xeb8f('0x77')](_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0x52')])||_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0x52')]===''){throw _0x267517[_0xeb8f('0x28')](0x1f4)[_0xeb8f('0x35')](new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))](_0xeb8f('0x92')));}if(_['isNil'](_0x3161b5['body'][_0xeb8f('0xc7')])){throw _0x267517[_0xeb8f('0x28')](0x1f4)[_0xeb8f('0x35')](new db[(_0xeb8f('0x8a'))][(_0xeb8f('0x8b'))](_0xeb8f('0xc8')+_0x16da4e));}if(!_[_0xeb8f('0xc9')](_0x16da4e,_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0xc7')])){throw _0x267517['status'](0x1f4)[_0xeb8f('0x35')](new db[(_0xeb8f('0x8a'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16da4e));}_0x5d1208[_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0xc7')]]=_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0x90')];})['then'](function(){return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x3161b5['params']['id']},'include':[{'model':db['CmList'],'as':_0xeb8f('0x96')},{'model':db[_0xeb8f('0xca')],'as':_0xeb8f('0xca')}]});})[_0xeb8f('0x1c')](handleEntityNotFound(_0x267517,null))['then'](function(_0x384479){if(_0x384479&&_0x384479[_0xeb8f('0x96')]){_0x1af7c7=_0x384479;var _0x24e0e0=_['defaults'](_0x3161b5[_0xeb8f('0x52')],{'firstName':_0x3161b5['body'][_0xeb8f('0x90')],'phone':_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0x90')],'ListId':_0x384479[_0xeb8f('0xcb')]});_0x24e0e0[_0x3161b5['body'][_0xeb8f('0xc7')]]=_0x3161b5['body']['from'];return db[_0xeb8f('0x89')][_0xeb8f('0xcc')]({'where':_0x5d1208,'defaults':_0x24e0e0});}})['spread'](function(_0x39150c){if(_0x39150c){_0x4300e1=_0x39150c;var _0x18f733=fs['readFileSync'](path['join'](config[_0xeb8f('0x72')],'server/files/templates/chatOfflineMessage.ejs'),_0xeb8f('0xcd'));var _0x420fc8=ejs[_0xeb8f('0xce')](_0x18f733,{'body':_[_0xeb8f('0xcf')](_0x3161b5[_0xeb8f('0x52')][_0xeb8f('0x52')]),'bodyTitle':_0x1af7c7[_0xeb8f('0xd0')]});return db[_0xeb8f('0xd1')][_0xeb8f('0x51')]({'body':_0x420fc8,'ContactId':_0x39150c['id'],'ChatWebsiteId':_0x1af7c7['id']});}})[_0xeb8f('0x1c')](function(_0x19789b){_0x57a175=_0x19789b;if(_0x458168['length']){var _0x558a5c=_0x458168[_0xeb8f('0x36')](function(_0x32440e){return{'name':_0x32440e['originalname'],'basename':_0x32440e[_0xeb8f('0x6b')],'type':_0x32440e[_0xeb8f('0xd2')],'ChatOfflineMessageId':_0x19789b['id']};});_0xeba390=_0x558a5c[_0xeb8f('0x36')](_0x1f9536=>{var _0x122c86={'filename':_0x1f9536[_0xeb8f('0x3a')],'path':path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],_0xeb8f('0xd3'),_0xeb8f('0xc5'),_0xeb8f('0xd4'),_0xeb8f('0xd5'),_0x1f9536[_0xeb8f('0xd6')])};return _0x122c86;});if(!_0x1af7c7[_0xeb8f('0xd7')]){return db[_0xeb8f('0xd8')][_0xeb8f('0xd9')](function(_0xd385ec){return db[_0xeb8f('0xda')][_0xeb8f('0xdb')](_0x558a5c,{'transaction':_0xd385ec});});}}})['then'](function(){if(_0x57a175){_0x165d68=_0x57a175;return db[_0xeb8f('0xca')][_0xeb8f('0x5e')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xeb8f('0xdc'),'raw':!![]}]});}})[_0xeb8f('0x1c')](function(_0x3b595b){if(_0x3b595b&&_0x3b595b[_0xeb8f('0xdc')]&&_0x1af7c7[_0xeb8f('0xdd')]&&_0x1af7c7[_0xeb8f('0xde')]){var _0x3e6958={'tls':{'rejectUnauthorized':![]}};if(_0x3b595b['Smtp'][_0xeb8f('0xdf')]){_0x3e6958[_0xeb8f('0xdf')]=_0x3b595b[_0xeb8f('0xdc')][_0xeb8f('0xdf')];}else{_0x3e6958[_0xeb8f('0xe0')]=_0x3b595b[_0xeb8f('0xdc')][_0xeb8f('0xe0')];_0x3e6958[_0xeb8f('0xe1')]=_0x3b595b[_0xeb8f('0xdc')][_0xeb8f('0xe1')];_0x3e6958[_0xeb8f('0xe2')]=_0x3b595b[_0xeb8f('0xdc')][_0xeb8f('0xe2')];}if(_0x3b595b[_0xeb8f('0xdc')]['authentication']){_0x3e6958['auth']={'user':_0x3b595b[_0xeb8f('0xdc')]['user'],'pass':_0x3b595b[_0xeb8f('0xdc')][_0xeb8f('0xe3')]};}return respondWithRpcPromise(_0xeb8f('0xe4'),_0xeb8f('0xe5'),{'account':_0x3e6958,'message':{'from':util[_0xeb8f('0xab')](_0xeb8f('0xe6'),_0x3b595b[_0xeb8f('0x3a')],_0x3b595b[_0xeb8f('0xe7')]||_0x3b595b[_0xeb8f('0xdc')][_0xeb8f('0x53')]),'to':_0x1af7c7[_0xeb8f('0xde')],'subject':_0x1af7c7['offlineMessageSubject'],'html':_0x165d68[_0xeb8f('0x52')],'attachments':_0xeba390}},client9003)[_0xeb8f('0x1c')](function(){return _0x165d68;})[_0xeb8f('0x26')](function(_0x2e9529){console[_0xeb8f('0x23')](_0x2e9529);});}})['then'](function(){if(_0x1af7c7&&_0x1af7c7['openNewInteraction']&&_0x1af7c7[_0xeb8f('0xe8')]){var _0x328ae8=[];if(_0x458168[_0xeb8f('0x41')]){_0x328ae8=_0x458168[_0xeb8f('0x36')](function(_0x89da0e){return{'name':_0x89da0e['originalname'],'basename':_0x89da0e[_0xeb8f('0x6b')],'type':_0x89da0e[_0xeb8f('0xd2')],'ChatOfflineMessageId':_0x57a175['id']};});}var _0x42b390;if(!_[_0xeb8f('0x77')](_0x1af7c7[_0xeb8f('0xe9')])){var _0x2b1396=_[_0xeb8f('0x36')](_0x3161b5[_0xeb8f('0x52')],function(_0x48db57){return _0x48db57;});var _0x2e5ce5=_[_0xeb8f('0xea')](_0x2b1396)[0x0];var _0x4c0749=_[_0xeb8f('0xeb')](_0x2e5ce5,function(_0x20ac1d){return _0x20ac1d;});_0x42b390=_0x4c0749[0x1][_0x1af7c7[_0xeb8f('0xe9')]];}var _0x5ee154={'from':_0x4300e1[_0xeb8f('0xe7')],'firstName':_0x4300e1[_0xeb8f('0xa6')],'lastName':_0x4300e1[_0xeb8f('0xb6')],'mapKey':'email','message':{'from':_0x4300e1['email'],'to':_0x1af7c7[_0xeb8f('0xca')][_0xeb8f('0xe7')],'cc':'','subject':_[_0xeb8f('0x77')](_0x42b390)?_0x1af7c7['offlineMessageSubject']:_0x42b390,'messageId':'','sentAt':new Date(),'attach':_0x328ae8[_0xeb8f('0x41')],'attachments':_0x328ae8,'originChannel':_0xeb8f('0xec'),'ChatWebsiteId':_0x1af7c7['id'],'ChatOfflineMessageId':_0x165d68['id'],'originTo':_0x1af7c7[_0xeb8f('0xca')][_0xeb8f('0xe7')]},'body':_0x165d68[_0xeb8f('0x52')]};var _0x3f852c={'account':{'id':_0x1af7c7['MailAccountId']},'body':_0x5ee154,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xeb8f('0xed'),_0xeb8f('0xee'),_0x3f852c,client9001)[_0xeb8f('0x1c')](function(){return _0x165d68;})[_0xeb8f('0x26')](function(_0x4197d9){console['error'](_0x4197d9);});}return;})[_0xeb8f('0x1c')](function(){if(_0x165d68){return _0x165d68;}})['then'](respondWithResult(_0x267517,null))['catch'](function(_0x1a00ae){console[_0xeb8f('0x23')](_0xeb8f('0x26'),_0x1a00ae);for(var _0x2f2b0f of _0x458168){var _0x15617a=path[_0xeb8f('0x71')](config[_0xeb8f('0x72')],'server',_0xeb8f('0xc5'),_0xeb8f('0xd4'),_0xeb8f('0xd5'),_0x2f2b0f[_0xeb8f('0x6b')]);fs_extra['remove'](_0x15617a)['catch'](function(_0x82622){console['error'](_0xeb8f('0xef'),_0x15617a,_0x82622);});}});};exports[_0xeb8f('0xf0')]=function(_0x1d4b12,_0x397e2d,_0x3f15b5){return db[_0xeb8f('0xb1')]['find']({'where':{'id':_0x1d4b12[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x397e2d,null))[_0xeb8f('0x1c')](function(_0x4cce9e){if(_0x4cce9e){return _0x4cce9e['addInteraction'](_0x1d4b12['body'][_0xeb8f('0x63')],_['omit'](_0x1d4b12[_0xeb8f('0x52')],[_0xeb8f('0x63'),'id'])||{});}})['then'](respondWithResult(_0x397e2d,null))[_0xeb8f('0x26')](handleError(_0x397e2d,null));};exports[_0xeb8f('0xf1')]=function(_0x2c5e55,_0x1327e2,_0x331347){var _0xf920b={'raw':![],'where':{}};var _0x2b7070={};var _0x10729a={'count':0x0,'rows':[]};return db[_0xeb8f('0x37')][_0xeb8f('0x5e')]({'where':{'id':_0x2c5e55[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x1327e2,null))[_0xeb8f('0x1c')](function(_0x189b13){if(_0x189b13){_0x2b7070[_0xeb8f('0x3e')]=_['keys'](db['ChatInteraction'][_0xeb8f('0x38')]);_0x2b7070[_0xeb8f('0x3b')]=_['keys'](_0x2c5e55['query']);_0x2b7070['filters']=_['intersection'](_0x2b7070[_0xeb8f('0x3e')],_0x2b7070[_0xeb8f('0x3b')]);_0xf920b[_0xeb8f('0x40')]=_[_0xeb8f('0x5f')](_0x2b7070[_0xeb8f('0x3e')],qs[_0xeb8f('0x3f')](_0x2c5e55[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0xf920b['attributes']=_0xf920b[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0xf920b['attributes']:_0x2b7070[_0xeb8f('0x3e')];if(!_0x2c5e55[_0xeb8f('0x3b')]['hasOwnProperty'](_0xeb8f('0xf2'))){_0xf920b[_0xeb8f('0x2c')]=qs[_0xeb8f('0x2c')](_0x2c5e55[_0xeb8f('0x3b')][_0xeb8f('0x2c')]);_0xf920b[_0xeb8f('0x2a')]=qs['offset'](_0x2c5e55['query'][_0xeb8f('0x2a')]);}_0xf920b[_0xeb8f('0x43')]=qs[_0xeb8f('0x44')](_0x2c5e55[_0xeb8f('0x3b')]['sort']);_0xf920b[_0xeb8f('0x47')]=qs[_0xeb8f('0x3d')](_['pick'](_0x2c5e55[_0xeb8f('0x3b')],_0x2b7070[_0xeb8f('0x3d')]));_0xf920b['where'][_0xeb8f('0x60')]=_0x189b13['id'];if(_0x2c5e55['query'][_0xeb8f('0x46')]){_0xf920b[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0xf920b['where'],{'$or':_[_0xeb8f('0x36')](_0xf920b[_0xeb8f('0x40')],function(_0x4336f3){var _0x347668={};_0x347668[_0x4336f3]={'$like':'%'+_0x2c5e55['query'][_0xeb8f('0x46')]+'%'};return _0x347668;})});}_0xf920b=_[_0xeb8f('0x48')]({},_0xf920b,_0x2c5e55[_0xeb8f('0x4a')]);return db[_0xeb8f('0xb1')][_0xeb8f('0x2d')]({'where':_0xf920b[_0xeb8f('0x47')]})[_0xeb8f('0x1c')](function(_0xb501bf){_0x10729a['count']=_0xb501bf;if(_0x2c5e55[_0xeb8f('0x3b')]['includeAll']){_0xf920b[_0xeb8f('0x4c')]=[{'model':db[_0xeb8f('0x89')],'as':'Contact','required':![]},{'model':db[_0xeb8f('0xf3')],'as':'Owner','attributes':['name',_0xeb8f('0xf4'),'internal'],'required':![]},{'model':db[_0xeb8f('0xf5')],'as':'Tags','attributes':['id',_0xeb8f('0x3a'),_0xeb8f('0xf6')],'where':_0x2c5e55[_0xeb8f('0x3b')][_0xeb8f('0xf7')]?{'id':_0x2c5e55[_0xeb8f('0x3b')][_0xeb8f('0xf7')]}:undefined,'required':_0x2c5e55[_0xeb8f('0x3b')][_0xeb8f('0xf7')]?!![]:![]}];}return db[_0xeb8f('0xb1')][_0xeb8f('0x61')](_0xf920b);})[_0xeb8f('0x1c')](function(_0x2684f4){_0x10729a[_0xeb8f('0x4d')]=_0x2684f4;return _0x10729a;});}})[_0xeb8f('0x1c')](respondWithFilteredResult(_0x1327e2,_0xf920b))[_0xeb8f('0x26')](handleError(_0x1327e2,null));};function iftimePromise(_0x19d0e0,_0x5bd577){return respondWithRpcPromise(_0xeb8f('0xf8'),'getSnippet',{'command':_0x5bd577[_0xeb8f('0xf9')]?util[_0xeb8f('0xab')](_0xeb8f('0xfa'),_0x19d0e0[_0xeb8f('0xfb')],_0x5bd577[_0xeb8f('0xf9')]):util['format'](_0xeb8f('0xfc'),_0x19d0e0['interval'])},client9002)[_0xeb8f('0x1c')](function(_0x2ba1cf){var _0x3ee655=_0x2ba1cf&&_0x2ba1cf[_0xeb8f('0xfd')](_0xeb8f('0xfe'))>=0x0?!![]:![];logger[_0xeb8f('0x1d')](_0xeb8f('0xff'),_0x5bd577['id'],_0x19d0e0['id'],_0x19d0e0[_0xeb8f('0xfb')],_0x3ee655?_0xeb8f('0x100'):'OFFLINE',_0x5bd577[_0xeb8f('0xf9')]?_0x5bd577[_0xeb8f('0xf9')]:_0xeb8f('0x101'));return _0x3ee655;})[_0xeb8f('0x26')](function(_0x482add){logger['error'](_0xeb8f('0xff'),_0x5bd577['id'],_0x19d0e0['id'],_0x19d0e0['interval'],util['inspect'](_0x482add,{'showHidden':![],'depth':null}),_0x5bd577[_0xeb8f('0xf9')]?_0x5bd577[_0xeb8f('0xf9')]:_0xeb8f('0x101'));return![];});}exports['getSnippet']=function(_0x1d6d97,_0x267316,_0x5b59a5){var _0x3b1ada=0x0;var _0x351173=0x0;var _0x51a466=![];var _0x22a1af;var _0x3d5cef;return db[_0xeb8f('0x37')]['find']({'where':{'id':_0x1d6d97[_0xeb8f('0x4f')]['id']},'include':[{'model':db[_0xeb8f('0x102')],'as':_0xeb8f('0x102'),'include':[{'model':db[_0xeb8f('0x102')],'as':_0xeb8f('0x103'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xeb8f('0x1c')](handleEntityNotFound(_0x267316,null))[_0xeb8f('0x1c')](function(_0xa81027){if(_0xa81027){_0x22a1af=_0xa81027;return _0xa81027[_0xeb8f('0x104')]({'raw':!![]});}})[_0xeb8f('0x1c')](function(_0x28ba1d){if(_0x22a1af){if(_0x28ba1d){_0x3d5cef=_0x28ba1d;}}return require(_0xeb8f('0x74'))[_0xeb8f('0x75')]();})['then'](function(_0x5b491a){if(_0x5b491a){_0x351173=_0x5b491a[_0xeb8f('0x105')];_0x51a466=_0x5b491a[_0xeb8f('0x76')];}})[_0xeb8f('0x1c')](function(){return db['ChatInteraction'][_0xeb8f('0x2d')]({'where':{'closed':![]}});})[_0xeb8f('0x1c')](function(_0x10282e){_0x3b1ada=_0x10282e;if(_0x351173&&_0x10282e>_0x351173){return db[_0xeb8f('0x106')][_0xeb8f('0x5e')]({'where':{'id':0x1}})[_0xeb8f('0x1c')](function(_0x1f663b){if(_0x1f663b){_0x1f663b[_0xeb8f('0x107')](_0xeb8f('0x108'));}});}})[_0xeb8f('0x1c')](function(){if(_0x22a1af[_0xeb8f('0x102')]&&_0x22a1af[_0xeb8f('0x102')][_0xeb8f('0x103')]){var _0x22df70=[];for(var _0x4f7cf2=0x0;_0x4f7cf2<_0x22a1af[_0xeb8f('0x102')]['Intervals'][_0xeb8f('0x41')];_0x4f7cf2++){var _0x59cc17=_0x22a1af[_0xeb8f('0x102')][_0xeb8f('0x103')][_0x4f7cf2][_0xeb8f('0x56')]({'plain':!![]});_0x22df70[_0xeb8f('0xba')](iftimePromise(_0x59cc17,_0x22a1af));}return BPromise[_0xeb8f('0x109')](_0x22df70)[_0xeb8f('0x1c')](function(_0x38de11){return _[_0xeb8f('0x10a')](_0x38de11);});}else{return!![];}})[_0xeb8f('0x1c')](function(_0x44b6ef){var _0xed2473=fs['readFileSync'](path[_0xeb8f('0x71')](config['root'],_0xeb8f('0x10b')),_0xeb8f('0xcd'));var _0x25d209={'remote':_0x22a1af['remote'],'query':querystring['stringify'](_[_0xeb8f('0x48')](_0x22a1af[_0xeb8f('0x56')]({'plain':!![]}),{'customerIp':_0x1d6d97[_0xeb8f('0x85')][_0xeb8f('0xa4')]||_0x1d6d97['headers']['x-real-ip']||_0x1d6d97[_0xeb8f('0x10c')][_0xeb8f('0x10d')]||_0x1d6d97['ip'],'referer':_0x1d6d97[_0xeb8f('0x85')][_0xeb8f('0xa8')],'openedInteractions':_0x3b1ada,'maxInteractions':_0x351173,'virtual':_0x51a466[_0xeb8f('0x105')],'online':_0x44b6ef,'custom':_0x51a466}))[_0xeb8f('0x10e')](/'/g,'\x5c\x27')};_0x267316['send'](ejs[_0xeb8f('0xce')](Mustache[_0xeb8f('0xce')](_0xed2473,_0x25d209),{'proactiveActions':_0x3d5cef,'alignment':_0x22a1af[_0xeb8f('0x10f')],'verticalAlignment':_0x22a1af[_0xeb8f('0x110')],'div_color':_0x22a1af[_0xeb8f('0xf6')],'text_color':_0x22a1af[_0xeb8f('0x111')],'button_color':_0x22a1af['color_button'],'background_color':_0x22a1af['backgroundColor']}));})[_0xeb8f('0x26')](handleError(_0x267316,null));};exports[_0xeb8f('0x112')]=function(_0x409264,_0x3f4426,_0xf134b4){return db['ChatWebsite'][_0xeb8f('0x5e')]({'where':{'id':_0x409264['params']['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x3f4426,null))['then'](function(_0x1127ac){if(_0x1127ac){return db['sequelize'][_0xeb8f('0xd9')](function(_0x344d89){return db[_0xeb8f('0x99')][_0xeb8f('0x34')]({'where':{'ChatWebsiteId':_0x409264[_0xeb8f('0x4f')]['id']},'transaction':_0x344d89})[_0xeb8f('0x1c')](function(_0x2fa5ff){var _0x17f7a3=_[_0xeb8f('0x36')](_0x409264[_0xeb8f('0x52')],function(_0x4d7877){_0x4d7877[_0xeb8f('0x60')]=_0x409264[_0xeb8f('0x4f')]['id'];return _0x4d7877;});return db[_0xeb8f('0x99')][_0xeb8f('0xdb')](_0x17f7a3,{'transaction':_0x344d89});});})['then'](function(){return db[_0xeb8f('0x99')][_0xeb8f('0x113')]({'where':{'ChatWebsiteId':_0x409264[_0xeb8f('0x4f')]['id']},'order':_0xeb8f('0x9e')});});}})[_0xeb8f('0x1c')](respondWithResult(_0x3f4426,null))[_0xeb8f('0x26')](handleError(_0x3f4426,null));};exports[_0xeb8f('0x114')]=function(_0x2bf15a,_0x442534,_0x416173){var _0x223b00={};var _0xa48892={};var _0xcfc5e8;var _0x3a8f3b;return db['ChatWebsite']['findOne']({'where':{'id':_0x2bf15a['params']['id']}})['then'](handleEntityNotFound(_0x442534,null))[_0xeb8f('0x1c')](function(_0x4c131d){if(_0x4c131d){_0xcfc5e8=_0x4c131d;_0xa48892['model']=_[_0xeb8f('0x3c')](db['ChatApplication'][_0xeb8f('0x38')]);_0xa48892[_0xeb8f('0x3b')]=_[_0xeb8f('0x3c')](_0x2bf15a[_0xeb8f('0x3b')]);_0xa48892[_0xeb8f('0x3d')]=_[_0xeb8f('0x5f')](_0xa48892['model'],_0xa48892[_0xeb8f('0x3b')]);_0x223b00[_0xeb8f('0x40')]=_[_0xeb8f('0x5f')](_0xa48892[_0xeb8f('0x3e')],qs['fields'](_0x2bf15a[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0x223b00['attributes']=_0x223b00[_0xeb8f('0x40')]['length']?_0x223b00['attributes']:_0xa48892['model'];_0x223b00[_0xeb8f('0x43')]=qs[_0xeb8f('0x44')](_0x2bf15a[_0xeb8f('0x3b')][_0xeb8f('0x44')]);_0x223b00[_0xeb8f('0x47')]=qs[_0xeb8f('0x3d')](_[_0xeb8f('0x45')](_0x2bf15a['query'],_0xa48892[_0xeb8f('0x3d')]));if(_0x2bf15a[_0xeb8f('0x3b')][_0xeb8f('0x46')]){_0x223b00[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0x223b00[_0xeb8f('0x47')],{'$or':_[_0xeb8f('0x36')](_0x223b00[_0xeb8f('0x40')],function(_0x3b55ef){var _0x5442ed={};_0x5442ed[_0x3b55ef]={'$like':'%'+_0x2bf15a['query'][_0xeb8f('0x46')]+'%'};return _0x5442ed;})});}_0x223b00=_[_0xeb8f('0x48')]({},_0x223b00,_0x2bf15a[_0xeb8f('0x4a')]);return _0xcfc5e8[_0xeb8f('0x114')](_0x223b00);}})[_0xeb8f('0x1c')](function(_0x5a4efb){if(_0x5a4efb){_0x3a8f3b=_0x5a4efb[_0xeb8f('0x41')];if(!_0x2bf15a[_0xeb8f('0x3b')][_0xeb8f('0x42')](_0xeb8f('0xf2'))){_0x223b00['limit']=qs[_0xeb8f('0x2c')](_0x2bf15a[_0xeb8f('0x3b')]['limit']);_0x223b00[_0xeb8f('0x2a')]=qs[_0xeb8f('0x2a')](_0x2bf15a[_0xeb8f('0x3b')][_0xeb8f('0x2a')]);}return _0xcfc5e8[_0xeb8f('0x114')](_0x223b00);}})['then'](function(_0x5764b2){if(_0x5764b2){return _0x5764b2?{'count':_0x3a8f3b,'rows':_0x5764b2}:null;}})[_0xeb8f('0x1c')](respondWithResult(_0x442534,null))[_0xeb8f('0x26')](handleError(_0x442534,null));};exports[_0xeb8f('0x115')]=function(_0x22f95e,_0xae9a93,_0x5c2e51){return db[_0xeb8f('0x116')][_0xeb8f('0x50')]({'where':{'id':_0x22f95e[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0xae9a93,null))[_0xeb8f('0x1c')](function(_0x5d154c){if(_0x5d154c){return _0x5d154c[_0xeb8f('0x115')](_0x22f95e['body'][_0xeb8f('0x63')],_[_0xeb8f('0x117')](_0x22f95e[_0xeb8f('0x52')],['ids','id'])||{});}})[_0xeb8f('0x1c')](respondWithResult(_0xae9a93,null))[_0xeb8f('0x26')](handleError(_0xae9a93,null));};exports[_0xeb8f('0x104')]=function(_0x25fcc2,_0x3568a3,_0x1db7f2){var _0x5ac4d6={};var _0x4a7877={};var _0x6b7e77;var _0x4d6f8b;return db[_0xeb8f('0x37')][_0xeb8f('0x5e')]({'where':{'id':_0x25fcc2[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x3568a3,null))[_0xeb8f('0x1c')](function(_0x538027){if(_0x538027){_0x6b7e77=_0x538027;_0x4a7877[_0xeb8f('0x3e')]=_[_0xeb8f('0x3c')](db[_0xeb8f('0x118')][_0xeb8f('0x38')]);_0x4a7877[_0xeb8f('0x3b')]=_['keys'](_0x25fcc2['query']);_0x4a7877['filters']=_[_0xeb8f('0x5f')](_0x4a7877[_0xeb8f('0x3e')],_0x4a7877[_0xeb8f('0x3b')]);_0x5ac4d6['attributes']=_['intersection'](_0x4a7877['model'],qs[_0xeb8f('0x3f')](_0x25fcc2['query'][_0xeb8f('0x3f')]));_0x5ac4d6[_0xeb8f('0x40')]=_0x5ac4d6[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0x5ac4d6[_0xeb8f('0x40')]:_0x4a7877[_0xeb8f('0x3e')];_0x5ac4d6[_0xeb8f('0x43')]=qs['sort'](_0x25fcc2['query']['sort']);_0x5ac4d6[_0xeb8f('0x47')]=qs['filters'](_[_0xeb8f('0x45')](_0x25fcc2['query'],_0x4a7877['filters']));if(_0x25fcc2[_0xeb8f('0x3b')][_0xeb8f('0x46')]){_0x5ac4d6['where']=_[_0xeb8f('0x48')](_0x5ac4d6[_0xeb8f('0x47')],{'$or':_[_0xeb8f('0x36')](_0x5ac4d6[_0xeb8f('0x40')],function(_0x22bd31){var _0x373204={};_0x373204[_0x22bd31]={'$like':'%'+_0x25fcc2[_0xeb8f('0x3b')]['filter']+'%'};return _0x373204;})});}_0x5ac4d6=_[_0xeb8f('0x48')]({},_0x5ac4d6,_0x25fcc2[_0xeb8f('0x4a')]);return _0x6b7e77['getProactiveActions'](_0x5ac4d6);}})['then'](function(_0x118a8e){if(_0x118a8e){_0x4d6f8b=_0x118a8e[_0xeb8f('0x41')];if(!_0x25fcc2['query'][_0xeb8f('0x42')](_0xeb8f('0xf2'))){_0x5ac4d6['limit']=qs[_0xeb8f('0x2c')](_0x25fcc2[_0xeb8f('0x3b')]['limit']);_0x5ac4d6[_0xeb8f('0x2a')]=qs[_0xeb8f('0x2a')](_0x25fcc2[_0xeb8f('0x3b')][_0xeb8f('0x2a')]);}return _0x6b7e77[_0xeb8f('0x104')](_0x5ac4d6);}})['then'](function(_0xda7dab){if(_0xda7dab){return _0xda7dab?{'count':_0x4d6f8b,'rows':_0xda7dab}:null;}})['then'](respondWithResult(_0x3568a3,null))[_0xeb8f('0x26')](handleError(_0x3568a3,null));};exports[_0xeb8f('0x119')]=function(_0x238fee,_0x12a1e3,_0x5d3406){var _0x1dab63=_0x238fee[_0xeb8f('0x3b')]['online']===_0xeb8f('0x11a')?_0xeb8f('0x11b'):_0xeb8f('0x11c');return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'attributes':['id',_0x1dab63],'where':{'id':_0x238fee['params']['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x12a1e3,null))['then'](function(_0x81090f){if(_0x81090f){var _0x2d67d6=_0x81090f[_0x1dab63];var _0x43470d=_0x2d67d6&&_0x2d67d6[_0xeb8f('0x11d')]?_0x2d67d6[_0xeb8f('0x11d')]:[];_0x12a1e3[_0xeb8f('0x35')]({'fromKey':_['isNil'](_0x2d67d6['fromKey'])?undefined:_0x2d67d6['fromKey'],'count':_0x43470d[_0xeb8f('0x41')],'rows':_0x43470d});}})[_0xeb8f('0x26')](handleError(_0x12a1e3,null));};exports[_0xeb8f('0x11e')]=function(_0x4d2f33,_0x54afc9,_0x16bdf2){var _0x2736ed={'raw':![],'where':{}};var _0x396b96={};var _0x290b29={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xeb8f('0x5e')]({'where':{'id':_0x4d2f33[_0xeb8f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x54afc9,null))['then'](function(_0x1615c8){if(_0x1615c8){_0x396b96[_0xeb8f('0x3e')]=_[_0xeb8f('0x3c')](db[_0xeb8f('0xd1')]['rawAttributes']);_0x396b96[_0xeb8f('0x3b')]=_[_0xeb8f('0x3c')](_0x4d2f33[_0xeb8f('0x3b')]);_0x396b96[_0xeb8f('0x3d')]=_['intersection'](_0x396b96[_0xeb8f('0x3e')],_0x396b96['query']);_0x2736ed[_0xeb8f('0x40')]=_[_0xeb8f('0x5f')](_0x396b96['model'],qs[_0xeb8f('0x3f')](_0x4d2f33[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0x2736ed[_0xeb8f('0x40')]=_0x2736ed[_0xeb8f('0x40')][_0xeb8f('0x41')]?_0x2736ed[_0xeb8f('0x40')]:_0x396b96[_0xeb8f('0x3e')];if(!_0x4d2f33[_0xeb8f('0x3b')][_0xeb8f('0x42')](_0xeb8f('0xf2'))){_0x2736ed[_0xeb8f('0x2c')]=qs[_0xeb8f('0x2c')](_0x4d2f33[_0xeb8f('0x3b')]['limit']);_0x2736ed[_0xeb8f('0x2a')]=qs[_0xeb8f('0x2a')](_0x4d2f33['query'][_0xeb8f('0x2a')]);}_0x2736ed[_0xeb8f('0x43')]=qs[_0xeb8f('0x44')](_0x4d2f33[_0xeb8f('0x3b')]['sort']);_0x2736ed['where']=qs[_0xeb8f('0x3d')](_[_0xeb8f('0x45')](_0x4d2f33[_0xeb8f('0x3b')],_0x396b96[_0xeb8f('0x3d')]));_0x2736ed[_0xeb8f('0x47')]['ChatWebsiteId']=_0x1615c8['id'];if(_0x4d2f33[_0xeb8f('0x3b')][_0xeb8f('0x46')]){_0x2736ed[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0x2736ed[_0xeb8f('0x47')],{'$or':_[_0xeb8f('0x36')](_0x2736ed[_0xeb8f('0x40')],function(_0x3671ad){var _0xe71c0a={};_0xe71c0a[_0x3671ad]={'$like':'%'+_0x4d2f33[_0xeb8f('0x3b')][_0xeb8f('0x46')]+'%'};return _0xe71c0a;})});}_0x2736ed=_[_0xeb8f('0x48')]({},_0x2736ed,_0x4d2f33['options']);return db['ChatOfflineMessage'][_0xeb8f('0x2d')]({'where':_0x2736ed['where']})['then'](function(_0x4ee74d){_0x290b29['count']=_0x4ee74d;if(_0x4d2f33[_0xeb8f('0x3b')][_0xeb8f('0x4b')]){_0x2736ed[_0xeb8f('0x4c')]=[{'all':!![]}];}else{_0x2736ed['include']=[{'model':db[_0xeb8f('0x89')],'as':_0xeb8f('0x11f'),'required':![]},{'model':db[_0xeb8f('0xda')],'as':'Attachments','required':![]}];}return db[_0xeb8f('0xd1')][_0xeb8f('0x61')](_0x2736ed);})[_0xeb8f('0x1c')](function(_0x2dc902){_0x290b29[_0xeb8f('0x4d')]=_0x2dc902;return _0x290b29;});}})[_0xeb8f('0x1c')](respondWithFilteredResult(_0x54afc9,_0x2736ed))[_0xeb8f('0x26')](handleError(_0x54afc9,null));};exports[_0xeb8f('0x120')]=function(_0x4b8f0a,_0x3bb7ee,_0x565715){return db[_0xeb8f('0x37')]['find']({'where':{'id':_0x4b8f0a[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x3bb7ee,null))[_0xeb8f('0x1c')](function(_0x78991f){if(_0x78991f){return _0x78991f['addAgents'](_0x4b8f0a['body'][_0xeb8f('0x63')],_[_0xeb8f('0x117')](_0x4b8f0a[_0xeb8f('0x52')],[_0xeb8f('0x63'),'id'])||{})[_0xeb8f('0xb5')](function(_0x31df34){for(var _0x1d5db8=0x0;_0x1d5db8<_0x4b8f0a[_0xeb8f('0x52')][_0xeb8f('0x63')][_0xeb8f('0x41')];_0x1d5db8+=0x1){socket[_0xeb8f('0x121')](_0xeb8f('0x122'),{'UserId':Number(_0x4b8f0a[_0xeb8f('0x52')]['ids'][_0x1d5db8]),'ChatWebsiteId':Number(_0x4b8f0a[_0xeb8f('0x4f')]['id'])});}return _0x31df34;});}})[_0xeb8f('0x1c')](respondWithResult(_0x3bb7ee,null))['catch'](handleError(_0x3bb7ee,null));};exports['removeAgents']=function(_0x30691a,_0x221d9f,_0x3b9535){return db[_0xeb8f('0x37')][_0xeb8f('0x50')]({'where':{'id':_0x30691a[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0x221d9f,null))[_0xeb8f('0x1c')](function(_0x4d340d){if(_0x4d340d){return _0x4d340d[_0xeb8f('0x123')](_0x30691a['query'][_0xeb8f('0x63')])['then'](function(){if(_[_0xeb8f('0x124')](_0x30691a[_0xeb8f('0x3b')][_0xeb8f('0x63')])){for(var _0x483d36=0x0;_0x483d36<_0x30691a['query'][_0xeb8f('0x63')][_0xeb8f('0x41')];_0x483d36+=0x1){socket[_0xeb8f('0x121')](_0xeb8f('0x125'),{'UserId':Number(_0x30691a['query']['ids'][_0x483d36]),'ChatWebsiteId':Number(_0x30691a[_0xeb8f('0x4f')]['id'])});}}else{socket[_0xeb8f('0x121')]('userChatWebsite:remove',{'UserId':Number(_0x30691a[_0xeb8f('0x3b')]['ids']),'ChatWebsiteId':Number(_0x30691a[_0xeb8f('0x4f')]['id'])});}});}})[_0xeb8f('0x1c')](respondWithStatusCode(_0x221d9f,null))[_0xeb8f('0x26')](handleError(_0x221d9f,null));};exports[_0xeb8f('0x126')]=function(_0x58a461,_0xa7180c,_0x1c37f1){var _0xdcabf7={};var _0x141e6d={};var _0x193831;var _0x48fa3c;return db['ChatWebsite'][_0xeb8f('0x5e')]({'where':{'id':_0x58a461[_0xeb8f('0x4f')]['id']}})[_0xeb8f('0x1c')](handleEntityNotFound(_0xa7180c,null))[_0xeb8f('0x1c')](function(_0x720268){if(_0x720268){_0x193831=_0x720268;_0x141e6d[_0xeb8f('0x3e')]=_['keys'](db[_0xeb8f('0xf3')][_0xeb8f('0x38')]);_0x141e6d['query']=_[_0xeb8f('0x3c')](_0x58a461[_0xeb8f('0x3b')]);_0x141e6d['filters']=_['intersection'](_0x141e6d[_0xeb8f('0x3e')],_0x141e6d[_0xeb8f('0x3b')]);_0xdcabf7[_0xeb8f('0x40')]=_[_0xeb8f('0x5f')](_0x141e6d[_0xeb8f('0x3e')],qs[_0xeb8f('0x3f')](_0x58a461[_0xeb8f('0x3b')][_0xeb8f('0x3f')]));_0xdcabf7[_0xeb8f('0x40')]=_0xdcabf7[_0xeb8f('0x40')]['length']?_0xdcabf7[_0xeb8f('0x40')]:_0x141e6d[_0xeb8f('0x3e')];_0xdcabf7[_0xeb8f('0x43')]=qs['sort'](_0x58a461[_0xeb8f('0x3b')][_0xeb8f('0x44')]);_0xdcabf7[_0xeb8f('0x47')]=qs[_0xeb8f('0x3d')](_[_0xeb8f('0x45')](_0x58a461[_0xeb8f('0x3b')],_0x141e6d['filters']));if(_0x58a461[_0xeb8f('0x3b')][_0xeb8f('0x46')]){_0xdcabf7[_0xeb8f('0x47')]=_[_0xeb8f('0x48')](_0xdcabf7['where'],{'$or':_[_0xeb8f('0x36')](_0xdcabf7[_0xeb8f('0x40')],function(_0x7187be){var _0x40c2f8={};_0x40c2f8[_0x7187be]={'$like':'%'+_0x58a461['query'][_0xeb8f('0x46')]+'%'};return _0x40c2f8;})});}_0xdcabf7=_[_0xeb8f('0x48')]({},_0xdcabf7,_0x58a461[_0xeb8f('0x4a')]);return _0x193831[_0xeb8f('0x126')](_0xdcabf7);}})[_0xeb8f('0x1c')](function(_0x1208c6){if(_0x1208c6){_0x48fa3c=_0x1208c6[_0xeb8f('0x41')];if(!_0x58a461[_0xeb8f('0x3b')][_0xeb8f('0x42')]('nolimit')){_0xdcabf7[_0xeb8f('0x2c')]=qs[_0xeb8f('0x2c')](_0x58a461[_0xeb8f('0x3b')][_0xeb8f('0x2c')]);_0xdcabf7[_0xeb8f('0x2a')]=qs[_0xeb8f('0x2a')](_0x58a461[_0xeb8f('0x3b')][_0xeb8f('0x2a')]);}return _0x193831[_0xeb8f('0x126')](_0xdcabf7);}})[_0xeb8f('0x1c')](function(_0x4dadf4){if(_0x4dadf4){return _0x4dadf4?{'count':_0x48fa3c,'rows':_0x4dadf4}:null;}})[_0xeb8f('0x1c')](respondWithResult(_0xa7180c,null))['catch'](handleError(_0xa7180c,null));}; \ No newline at end of file +var _0x53e2=['ContactId','interaction','spread','messageId','created','push','unmanaged','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','pass','SendMail','email','MailAccountId','mimetype','subjectOffline','toPairsIn','lastName','offlineMessageSubject','Chat','NotifyMailAccount','addInteraction','Owner','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','virtual','some','server/files/chat/iframe.ejs','x-real-ip','remoteAddress','referer','alignment','verticalAlignment','textColor','backgroundColor','sequelize','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','omit','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','map','type','VIRTUAL','merge','options','ChatWebsite','includeAll','include','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','sort','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','sitepic','existsSync','server/files/images/logos/','root','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','headers','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','CmList','List','CmContact','updatedAt','DESC','account','applications','Applications','list','orderBy','asc','Contacts','ListId','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','threadId','externalUrl','ChatInteraction'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x53e2,0x196));var _0x253e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x253e('0x0'));var rimraf=require(_0x253e('0x1'));var zipdir=require(_0x253e('0x2'));var jsonpatch=require(_0x253e('0x3'));var rp=require(_0x253e('0x4'));var moment=require(_0x253e('0x5'));var BPromise=require(_0x253e('0x6'));var Mustache=require(_0x253e('0x7'));var util=require(_0x253e('0x8'));var path=require(_0x253e('0x9'));var sox=require(_0x253e('0xa'));var csv=require(_0x253e('0xb'));var ejs=require(_0x253e('0xc'));var fs=require('fs');var fs_extra=require(_0x253e('0xd'));var _=require('lodash');var squel=require(_0x253e('0xe'));var crypto=require(_0x253e('0xf'));var jsforce=require(_0x253e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x253e('0xb'));var querystring=require(_0x253e('0x11'));var Papa=require('papaparse');var Redis=require(_0x253e('0x12'));var authService=require(_0x253e('0x13'));var qs=require(_0x253e('0x14'));var as=require(_0x253e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x253e('0x16'))(_0x253e('0x17'));var utils=require(_0x253e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x253e('0x19'));var db=require(_0x253e('0x1a'))['db'];config[_0x253e('0x1b')]=_[_0x253e('0x1c')](config[_0x253e('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x253e('0x1d'))(new Redis(config['redis']));require(_0x253e('0x1e'))[_0x253e('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x253e('0x20')][_0x253e('0x21')]({'port':0x232c});var client9002=jayson[_0x253e('0x20')]['http']({'port':0x232a});var client9003=jayson['client'][_0x253e('0x21')]({'port':0x232b});var client9001=jayson[_0x253e('0x20')][_0x253e('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x42ccf2,_0x45ce8b,_0x5de5a1,_0x1ef170){return new BPromise(function(_0x5da469,_0xe2f658){var _0x1354a1=_0x1ef170||client;return _0x1354a1[_0x253e('0x22')](_0x42ccf2,_0x5de5a1)[_0x253e('0x23')](function(_0x2331b9){logger[_0x253e('0x24')](_0x253e('0x25'),_0x45ce8b,_0x253e('0x26'));logger[_0x253e('0x27')](_0x253e('0x28'),_0x45ce8b,_0x253e('0x26'),JSON[_0x253e('0x29')](_0x2331b9));if(_0x2331b9[_0x253e('0x2a')]){if(_0x2331b9[_0x253e('0x2a')]['code']===0x1f4){logger['error'](_0x253e('0x25'),_0x45ce8b,_0x2331b9['error']['message']);return _0xe2f658(_0x2331b9['error'][_0x253e('0x2b')]);}logger[_0x253e('0x2a')](_0x253e('0x25'),_0x45ce8b,_0x2331b9[_0x253e('0x2a')][_0x253e('0x2b')]);return _0x5da469(_0x2331b9[_0x253e('0x2a')][_0x253e('0x2b')]);}else{logger[_0x253e('0x24')](_0x253e('0x25'),_0x45ce8b,'request\x20sent');_0x5da469(_0x2331b9[_0x253e('0x2c')][_0x253e('0x2b')]);}})['catch'](function(_0x425362){logger['error'](_0x253e('0x25'),_0x45ce8b,_0x425362);_0xe2f658(_0x425362);});});}function respondWithStatusCode(_0x1f0244,_0xf4f9a6){_0xf4f9a6=_0xf4f9a6||0xcc;return function(_0xcc7ac4){if(_0xcc7ac4){return _0x1f0244[_0x253e('0x2d')](_0xf4f9a6);}return _0x1f0244['status'](_0xf4f9a6)[_0x253e('0x2e')]();};}function respondWithResult(_0x31f1cb,_0x558227){_0x558227=_0x558227||0xc8;return function(_0x52cfb0){if(_0x52cfb0){return _0x31f1cb['status'](_0x558227)[_0x253e('0x2f')](_0x52cfb0);}};}function respondWithFilteredResult(_0x249c21,_0x44e92e){return function(_0x44b3e3){if(_0x44b3e3){var _0x162c44=typeof _0x44e92e[_0x253e('0x30')]===_0x253e('0x31')&&typeof _0x44e92e[_0x253e('0x32')]==='undefined';var _0x251398=_0x44b3e3['count'];var _0x41d8ce=_0x162c44?0x0:_0x44e92e[_0x253e('0x30')];var _0x16bb15=_0x162c44?_0x44b3e3[_0x253e('0x33')]:_0x44e92e[_0x253e('0x30')]+_0x44e92e[_0x253e('0x32')];var _0x23d7d1;if(_0x16bb15>=_0x251398){_0x16bb15=_0x251398;_0x23d7d1=0xc8;}else{_0x23d7d1=0xce;}_0x249c21[_0x253e('0x34')](_0x23d7d1);return _0x249c21[_0x253e('0x35')](_0x253e('0x36'),_0x41d8ce+'-'+_0x16bb15+'/'+_0x251398)[_0x253e('0x2f')](_0x44b3e3);}return null;};}function patchUpdates(_0x26bb84){return function(_0x46eea1){try{jsonpatch[_0x253e('0x37')](_0x46eea1,_0x26bb84,!![]);}catch(_0x4739a9){return BPromise[_0x253e('0x38')](_0x4739a9);}return _0x46eea1['save']();};}function saveUpdates(_0x75d20a,_0x80a364){return function(_0x3084a0){if(_0x3084a0){return _0x3084a0[_0x253e('0x39')](_0x75d20a)['then'](function(_0x2b5c37){return _0x2b5c37;});}return null;};}function removeEntity(_0x45ba27,_0x16bfef){return function(_0x1c4295){if(_0x1c4295){return _0x1c4295['destroy']()['then'](function(){var _0x46656e=_0x1c4295[_0x253e('0x3a')]({'plain':!![]});var _0x15aa8c=_0x253e('0x3b');return db[_0x253e('0x3c')]['destroy']({'where':{'type':_0x15aa8c,'resourceId':_0x46656e['id']}})['then'](function(){return _0x1c4295;});})[_0x253e('0x23')](function(){_0x45ba27[_0x253e('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12869f,_0x5c56b8){return function(_0xf206dc){if(!_0xf206dc){_0x12869f[_0x253e('0x2d')](0x194);}return _0xf206dc;};}function handleError(_0x2a76ef,_0x295853){_0x295853=_0x295853||0x1f4;return function(_0x490e31){logger[_0x253e('0x2a')](_0x490e31[_0x253e('0x3d')]);if(_0x490e31[_0x253e('0x3e')]){delete _0x490e31[_0x253e('0x3e')];}_0x2a76ef['status'](_0x295853)['send'](_0x490e31);};}exports[_0x253e('0x3f')]=function(_0x5e84c1,_0x53a4e1){var _0x1c48cb={'include':[{'model':db[_0x253e('0x40')],'as':_0x253e('0x41')}]},_0x3fb8fb={},_0x18b613={'count':0x0,'rows':[]};var _0x379ec2=_['map'](db['ChatWebsite'][_0x253e('0x42')],function(_0x237e40){return{'name':_0x237e40[_0x253e('0x43')],'type':_0x237e40['type'][_0x253e('0x44')]};});_0x3fb8fb[_0x253e('0x45')]=_['map'](_0x379ec2,'name');_0x3fb8fb[_0x253e('0x46')]=_[_0x253e('0x47')](_0x5e84c1['query']);_0x3fb8fb[_0x253e('0x48')]=_['intersection'](_0x3fb8fb[_0x253e('0x45')],_0x3fb8fb[_0x253e('0x46')]);_0x1c48cb['attributes']=_[_0x253e('0x49')](_0x3fb8fb[_0x253e('0x45')],qs[_0x253e('0x4a')](_0x5e84c1[_0x253e('0x46')][_0x253e('0x4a')]));_0x1c48cb[_0x253e('0x4b')]=_0x1c48cb[_0x253e('0x4b')][_0x253e('0x4c')]?_0x1c48cb[_0x253e('0x4b')]:_0x3fb8fb['model'];if(!_0x5e84c1[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x1c48cb[_0x253e('0x32')]=qs[_0x253e('0x32')](_0x5e84c1[_0x253e('0x46')]['limit']);_0x1c48cb[_0x253e('0x30')]=qs[_0x253e('0x30')](_0x5e84c1['query'][_0x253e('0x30')]);}_0x1c48cb[_0x253e('0x4f')]=qs['sort'](_0x5e84c1[_0x253e('0x46')]['sort']);_0x1c48cb['where']=qs[_0x253e('0x48')](_[_0x253e('0x50')](_0x5e84c1[_0x253e('0x46')],_0x3fb8fb[_0x253e('0x48')]),_0x379ec2);if(_0x5e84c1[_0x253e('0x46')][_0x253e('0x51')]){_0x1c48cb[_0x253e('0x52')]=_['merge'](_0x1c48cb[_0x253e('0x52')],{'$or':_[_0x253e('0x53')](_0x379ec2,function(_0x1b7271){if(_0x1b7271[_0x253e('0x54')]!==_0x253e('0x55')){var _0x1997a7={};_0x1997a7[_0x1b7271[_0x253e('0x3e')]]={'$like':'%'+_0x5e84c1[_0x253e('0x46')][_0x253e('0x51')]+'%'};return _0x1997a7;}})});}_0x1c48cb=_[_0x253e('0x56')]({},_0x1c48cb,_0x5e84c1[_0x253e('0x57')]);var _0x3f1061={'where':_0x1c48cb[_0x253e('0x52')]};return db[_0x253e('0x58')][_0x253e('0x33')](_0x3f1061)[_0x253e('0x23')](function(_0x284129){_0x18b613[_0x253e('0x33')]=_0x284129;if(_0x5e84c1[_0x253e('0x46')][_0x253e('0x59')]){_0x1c48cb[_0x253e('0x5a')]=[{'all':!![]}];}return db[_0x253e('0x58')]['findAll'](_0x1c48cb);})[_0x253e('0x23')](function(_0xc276ef){_0x18b613['rows']=_0xc276ef;return _0x18b613;})[_0x253e('0x23')](respondWithFilteredResult(_0x53a4e1,_0x1c48cb))[_0x253e('0x5b')](handleError(_0x53a4e1,null));};exports[_0x253e('0x5c')]=function(_0x4f6a92,_0x29236c){var _0x5b37a1={'raw':![],'where':{'id':_0x4f6a92['params']['id']},'include':[{'model':db[_0x253e('0x40')],'as':_0x253e('0x41')}]},_0xacf41d={};_0xacf41d[_0x253e('0x45')]=_[_0x253e('0x47')](db[_0x253e('0x58')][_0x253e('0x42')]);_0xacf41d[_0x253e('0x46')]=_['keys'](_0x4f6a92[_0x253e('0x46')]);_0xacf41d['filters']=_[_0x253e('0x49')](_0xacf41d[_0x253e('0x45')],_0xacf41d[_0x253e('0x46')]);_0x5b37a1[_0x253e('0x4b')]=_[_0x253e('0x49')](_0xacf41d[_0x253e('0x45')],qs[_0x253e('0x4a')](_0x4f6a92[_0x253e('0x46')][_0x253e('0x4a')]));_0x5b37a1[_0x253e('0x4b')]=_0x5b37a1[_0x253e('0x4b')][_0x253e('0x4c')]?_0x5b37a1[_0x253e('0x4b')]:_0xacf41d[_0x253e('0x45')];if(_0x4f6a92['query'][_0x253e('0x59')]){_0x5b37a1[_0x253e('0x5a')]=[{'all':!![]}];}_0x5b37a1=_[_0x253e('0x56')]({},_0x5b37a1,_0x4f6a92[_0x253e('0x57')]);return db[_0x253e('0x58')][_0x253e('0x5d')](_0x5b37a1)['then'](handleEntityNotFound(_0x29236c,null))[_0x253e('0x23')](respondWithResult(_0x29236c,null))[_0x253e('0x5b')](handleError(_0x29236c,null));};exports[_0x253e('0x5e')]=function(_0x25a249,_0x35c70b){return db[_0x253e('0x58')]['create'](_0x25a249[_0x253e('0x5f')],{})[_0x253e('0x23')](function(_0x5976b5){var _0x249b96=_0x25a249[_0x253e('0x60')][_0x253e('0x3a')]({'plain':!![]});if(!_0x249b96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x249b96[_0x253e('0x61')]===_0x253e('0x60')){var _0x5c7647=_0x5976b5[_0x253e('0x3a')]({'plain':!![]});var _0xe46d0c='ChatWebsites';return db[_0x253e('0x62')][_0x253e('0x5d')]({'where':{'name':_0xe46d0c,'userProfileId':_0x249b96[_0x253e('0x63')]},'raw':!![]})[_0x253e('0x23')](function(_0x280a74){if(_0x280a74&&_0x280a74[_0x253e('0x64')]===0x0){return db[_0x253e('0x3c')][_0x253e('0x5e')]({'name':_0x5c7647[_0x253e('0x3e')],'resourceId':_0x5c7647['id'],'type':_0x280a74[_0x253e('0x3e')],'sectionId':_0x280a74['id']},{})[_0x253e('0x23')](function(){return _0x5976b5;});}else{return _0x5976b5;}})[_0x253e('0x5b')](function(_0x1804d1){logger[_0x253e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1804d1);throw _0x1804d1;});}return _0x5976b5;})[_0x253e('0x23')](respondWithResult(_0x35c70b,0xc9))[_0x253e('0x5b')](handleError(_0x35c70b,null));};exports['update']=function(_0x2b950f,_0x363714){if(_0x2b950f[_0x253e('0x5f')]['id']){delete _0x2b950f[_0x253e('0x5f')]['id'];}return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x2b950f[_0x253e('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x253e('0x41')}]})['then'](handleEntityNotFound(_0x363714,null))[_0x253e('0x23')](saveUpdates(_0x2b950f[_0x253e('0x5f')],null))[_0x253e('0x23')](respondWithResult(_0x363714,null))['catch'](handleError(_0x363714,null));};exports[_0x253e('0x66')]=function(_0x3db17d,_0x314a7f){return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x3db17d[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x314a7f,null))[_0x253e('0x23')](removeEntity(_0x314a7f,null))[_0x253e('0x5b')](handleError(_0x314a7f,null));};exports[_0x253e('0x67')]=function(_0x346320,_0x52c20d){return db[_0x253e('0x58')]['describe']()[_0x253e('0x23')](respondWithResult(_0x52c20d,null))['catch'](handleError(_0x52c20d,null));};exports[_0x253e('0x68')]=function(_0x1c98f3,_0x293c40,_0x5752c0){if(_0x1c98f3['body']['id']){delete _0x1c98f3[_0x253e('0x5f')]['id'];}return db['ChatWebsite'][_0x253e('0x5d')]({'where':{'id':_0x1c98f3['params']['id']}})['then'](handleEntityNotFound(_0x293c40,null))[_0x253e('0x23')](function(_0x137dce){if(_0x137dce){_0x1c98f3[_0x253e('0x5f')][_0x253e('0x69')]=_0x137dce['id'];return db[_0x253e('0x6a')][_0x253e('0x5e')](_0x1c98f3['body']);}})[_0x253e('0x23')](respondWithResult(_0x293c40,null))[_0x253e('0x5b')](handleError(_0x293c40,null));};exports[_0x253e('0x6b')]=function(_0xb312,_0x3049d4,_0x36469f){var _0x14bc87={'raw':![],'where':{}};var _0x4ec83e={};var _0x498b37={'count':0x0,'rows':[]};return db[_0x253e('0x58')]['findOne']({'where':{'id':_0xb312['params']['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x3049d4,null))[_0x253e('0x23')](function(_0x59357d){if(_0x59357d){_0x4ec83e[_0x253e('0x45')]=_[_0x253e('0x47')](db['Disposition'][_0x253e('0x42')]);_0x4ec83e[_0x253e('0x46')]=_[_0x253e('0x47')](_0xb312['query']);_0x4ec83e[_0x253e('0x48')]=_[_0x253e('0x49')](_0x4ec83e[_0x253e('0x45')],_0x4ec83e['query']);_0x14bc87[_0x253e('0x4b')]=_[_0x253e('0x49')](_0x4ec83e[_0x253e('0x45')],qs[_0x253e('0x4a')](_0xb312[_0x253e('0x46')][_0x253e('0x4a')]));_0x14bc87[_0x253e('0x4b')]=_0x14bc87[_0x253e('0x4b')][_0x253e('0x4c')]?_0x14bc87[_0x253e('0x4b')]:_0x4ec83e['model'];if(!_0xb312[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x14bc87[_0x253e('0x32')]=qs[_0x253e('0x32')](_0xb312[_0x253e('0x46')]['limit']);_0x14bc87[_0x253e('0x30')]=qs[_0x253e('0x30')](_0xb312[_0x253e('0x46')][_0x253e('0x30')]);}_0x14bc87[_0x253e('0x4f')]=qs[_0x253e('0x6c')](_0xb312[_0x253e('0x46')][_0x253e('0x6c')]);_0x14bc87[_0x253e('0x52')]=qs['filters'](_[_0x253e('0x50')](_0xb312[_0x253e('0x46')],_0x4ec83e[_0x253e('0x48')]));_0x14bc87[_0x253e('0x52')][_0x253e('0x69')]=_0x59357d['id'];if(_0xb312[_0x253e('0x46')]['filter']){_0x14bc87[_0x253e('0x52')]=_[_0x253e('0x56')](_0x14bc87[_0x253e('0x52')],{'$or':_['map'](_0x14bc87[_0x253e('0x4b')],function(_0x1169a8){var _0x5f4c53={};_0x5f4c53[_0x1169a8]={'$like':'%'+_0xb312[_0x253e('0x46')][_0x253e('0x51')]+'%'};return _0x5f4c53;})});}_0x14bc87=_[_0x253e('0x56')]({},_0x14bc87,_0xb312[_0x253e('0x57')]);return db[_0x253e('0x6a')][_0x253e('0x33')]({'where':_0x14bc87['where']})['then'](function(_0x5b4800){_0x498b37[_0x253e('0x33')]=_0x5b4800;if(_0xb312['query'][_0x253e('0x59')]){_0x14bc87[_0x253e('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x253e('0x6d')](_0x14bc87);})[_0x253e('0x23')](function(_0x59dae0){_0x498b37[_0x253e('0x6e')]=_0x59dae0;return _0x498b37;});}})[_0x253e('0x23')](respondWithFilteredResult(_0x3049d4,_0x14bc87))['catch'](handleError(_0x3049d4,null));};exports[_0x253e('0x6f')]=function(_0x278c20,_0x535088,_0x5c2e6a){return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x278c20['params']['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x535088,null))[_0x253e('0x23')](function(_0x252c92){if(_0x252c92){return _0x252c92[_0x253e('0x6f')](_0x278c20[_0x253e('0x46')][_0x253e('0x70')]);}})[_0x253e('0x23')](respondWithStatusCode(_0x535088,null))[_0x253e('0x5b')](handleError(_0x535088,null));};exports[_0x253e('0x71')]=function(_0x2f6c59,_0x224d3e,_0x71139c){if(_0x2f6c59[_0x253e('0x5f')]['id']){delete _0x2f6c59[_0x253e('0x5f')]['id'];}return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x2f6c59[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x224d3e,null))['then'](function(_0x2bb0c6){if(_0x2bb0c6){_0x2f6c59[_0x253e('0x5f')][_0x253e('0x69')]=_0x2bb0c6['id'];return db[_0x253e('0x72')][_0x253e('0x5e')](_0x2f6c59[_0x253e('0x5f')]);}})['then'](respondWithResult(_0x224d3e,null))[_0x253e('0x5b')](handleError(_0x224d3e,null));};exports[_0x253e('0x73')]=function(_0x5db170,_0x456689,_0x2a7c48){var _0x40d51b={'raw':![],'where':{}};var _0x55a4fb={};var _0xf3c7dd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x253e('0x74')]({'where':{'id':_0x5db170[_0x253e('0x65')]['id']}})['then'](handleEntityNotFound(_0x456689,null))[_0x253e('0x23')](function(_0x3c94b0){if(_0x3c94b0){_0x55a4fb['model']=_[_0x253e('0x47')](db[_0x253e('0x72')][_0x253e('0x42')]);_0x55a4fb[_0x253e('0x46')]=_[_0x253e('0x47')](_0x5db170[_0x253e('0x46')]);_0x55a4fb[_0x253e('0x48')]=_[_0x253e('0x49')](_0x55a4fb[_0x253e('0x45')],_0x55a4fb[_0x253e('0x46')]);_0x40d51b[_0x253e('0x4b')]=_['intersection'](_0x55a4fb[_0x253e('0x45')],qs[_0x253e('0x4a')](_0x5db170[_0x253e('0x46')][_0x253e('0x4a')]));_0x40d51b['attributes']=_0x40d51b[_0x253e('0x4b')][_0x253e('0x4c')]?_0x40d51b[_0x253e('0x4b')]:_0x55a4fb['model'];if(!_0x5db170[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x40d51b[_0x253e('0x32')]=qs['limit'](_0x5db170[_0x253e('0x46')][_0x253e('0x32')]);_0x40d51b[_0x253e('0x30')]=qs[_0x253e('0x30')](_0x5db170[_0x253e('0x46')][_0x253e('0x30')]);}_0x40d51b['order']=qs[_0x253e('0x6c')](_0x5db170['query'][_0x253e('0x6c')]);_0x40d51b[_0x253e('0x52')]=qs[_0x253e('0x48')](_['pick'](_0x5db170['query'],_0x55a4fb[_0x253e('0x48')]));_0x40d51b['where'][_0x253e('0x69')]=_0x3c94b0['id'];if(_0x5db170[_0x253e('0x46')][_0x253e('0x51')]){_0x40d51b[_0x253e('0x52')]=_[_0x253e('0x56')](_0x40d51b[_0x253e('0x52')],{'$or':_[_0x253e('0x53')](_0x40d51b[_0x253e('0x4b')],function(_0x1479bd){var _0x31fcdf={};_0x31fcdf[_0x1479bd]={'$like':'%'+_0x5db170[_0x253e('0x46')][_0x253e('0x51')]+'%'};return _0x31fcdf;})});}_0x40d51b=_[_0x253e('0x56')]({},_0x40d51b,_0x5db170[_0x253e('0x57')]);return db[_0x253e('0x72')]['count']({'where':_0x40d51b[_0x253e('0x52')]})['then'](function(_0x3c6705){_0xf3c7dd[_0x253e('0x33')]=_0x3c6705;if(_0x5db170[_0x253e('0x46')][_0x253e('0x59')]){_0x40d51b[_0x253e('0x5a')]=[{'all':!![]}];}return db[_0x253e('0x72')][_0x253e('0x6d')](_0x40d51b);})[_0x253e('0x23')](function(_0xf0fdab){_0xf3c7dd[_0x253e('0x6e')]=_0xf0fdab;return _0xf3c7dd;});}})[_0x253e('0x23')](respondWithFilteredResult(_0x456689,_0x40d51b))[_0x253e('0x5b')](handleError(_0x456689,null));};exports[_0x253e('0x75')]=function(_0x92c9f8,_0x266ee8,_0x32d6ac){return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x92c9f8[_0x253e('0x65')]['id']}})['then'](handleEntityNotFound(_0x266ee8,null))[_0x253e('0x23')](function(_0x44f3f2){if(_0x44f3f2){return _0x44f3f2[_0x253e('0x75')](_0x92c9f8[_0x253e('0x46')][_0x253e('0x70')]);}})[_0x253e('0x23')](respondWithStatusCode(_0x266ee8,null))[_0x253e('0x5b')](handleError(_0x266ee8,null));};exports[_0x253e('0x76')]=function(_0x4679ac,_0x5dc9d6,_0x141aa5){_0x4679ac[_0x253e('0x5f')]['sitepic']=_0x4679ac[_0x253e('0x77')][_0x253e('0x78')];return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x4679ac[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x5dc9d6,null))[_0x253e('0x23')](saveUpdates(_0x4679ac[_0x253e('0x5f')],null))[_0x253e('0x23')](respondWithResult(_0x5dc9d6,null))[_0x253e('0x5b')](handleError(_0x5dc9d6,null));};exports[_0x253e('0x79')]=function(_0x369e16,_0x4fbe39,_0x49d169){_0x369e16[_0x253e('0x5f')][_0x253e('0x7a')]=_0x369e16[_0x253e('0x77')][_0x253e('0x78')];return db[_0x253e('0x58')]['find']({'where':{'id':_0x369e16[_0x253e('0x65')]['id']}})['then'](handleEntityNotFound(_0x4fbe39,null))[_0x253e('0x23')](saveUpdates(_0x369e16[_0x253e('0x5f')],null))[_0x253e('0x23')](respondWithResult(_0x4fbe39,null))['catch'](handleError(_0x4fbe39,null));};exports[_0x253e('0x7b')]=function(_0x3adedd,_0x4f96cd,_0x230285){_0x3adedd[_0x253e('0x5f')][_0x253e('0x7c')]=_0x3adedd['file'][_0x253e('0x78')];return db[_0x253e('0x58')]['find']({'where':{'id':_0x3adedd[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x4f96cd,null))[_0x253e('0x23')](saveUpdates(_0x3adedd[_0x253e('0x5f')],null))[_0x253e('0x23')](respondWithResult(_0x4f96cd,null))['catch'](handleError(_0x4f96cd,null));};exports[_0x253e('0x7d')]=function(_0x2e0993,_0x8459cd,_0x3a9720){_0x2e0993[_0x253e('0x5f')][_0x253e('0x7e')]=_0x2e0993[_0x253e('0x77')][_0x253e('0x78')];return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x2e0993['params']['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x8459cd,null))[_0x253e('0x23')](saveUpdates(_0x2e0993['body'],null))[_0x253e('0x23')](respondWithResult(_0x8459cd,null))[_0x253e('0x5b')](handleError(_0x8459cd,null));};exports[_0x253e('0x7f')]=function(_0xf77fec,_0x20da94,_0x41d0da){var _0x5850f2=path[_0x253e('0x80')](config['root'],'server/files/images/logos/default_logo.svg');var _0x417d43={'where':{'id':_0xf77fec[_0x253e('0x65')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x34f037=![];return require(_0x253e('0x19'))[_0x253e('0x81')]()[_0x253e('0x23')](function(_0x46c048){if(_0x46c048){_0x34f037=_0x46c048[_0x253e('0x82')];}})[_0x253e('0x23')](function(){return db[_0x253e('0x58')][_0x253e('0x5d')](_0x417d43);})[_0x253e('0x23')](handleEntityNotFound(_0x20da94,null))[_0x253e('0x23')](function(_0x1dce31){if(_0x1dce31){if(!_[_0x253e('0x83')](_0x1dce31[_0x253e('0x84')])){if(fs[_0x253e('0x85')](path[_0x253e('0x80')](config['root'],_0x253e('0x86'),_0x1dce31['sitepic']))&&_0x34f037){_0x5850f2=path[_0x253e('0x80')](config[_0x253e('0x87')],_0x253e('0x86'),_0x1dce31[_0x253e('0x84')]);}}return _0x20da94['download'](_0x5850f2);}})['catch'](handleError(_0x20da94,null));};exports[_0x253e('0x88')]=function(_0x41ea94,_0x241252,_0x23e864){var _0xe9b17e=path[_0x253e('0x80')](config[_0x253e('0x87')],_0x253e('0x89'));var _0x1e53b9={'where':{'id':_0x41ea94[_0x253e('0x65')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x1e53b9)[_0x253e('0x23')](handleEntityNotFound(_0x241252,null))[_0x253e('0x23')](function(_0x314c34){if(_0x314c34){if(!_[_0x253e('0x83')](_0x314c34[_0x253e('0x7a')])){if(fs[_0x253e('0x85')](path[_0x253e('0x80')](config[_0x253e('0x87')],_0x253e('0x8a'),_0x314c34[_0x253e('0x7a')]))){_0xe9b17e=path[_0x253e('0x80')](config[_0x253e('0x87')],_0x253e('0x8a'),_0x314c34[_0x253e('0x7a')]);}}return _0x241252[_0x253e('0x8b')](_0xe9b17e);}})['catch'](handleError(_0x241252,null));};exports[_0x253e('0x8c')]=function(_0x412e1a,_0x1e9f9d,_0x496c3e){var _0x297017=path[_0x253e('0x80')](config[_0x253e('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x54c70f={'where':{'id':_0x412e1a[_0x253e('0x65')]['id']},'attributes':['id',_0x253e('0x7c'),_0x253e('0x8d')],'raw':!![]};return db[_0x253e('0x58')][_0x253e('0x5d')](_0x54c70f)[_0x253e('0x23')](handleEntityNotFound(_0x1e9f9d,null))['then'](function(_0x10f4b7){if(_0x10f4b7){if(!_['isNil'](_0x10f4b7[_0x253e('0x7c')])){if(fs['existsSync'](path['join'](config[_0x253e('0x87')],'server/files/images/avatars/',_0x10f4b7[_0x253e('0x7c')]))&&_0x10f4b7['showCustomerAvatar']){_0x297017=path['join'](config[_0x253e('0x87')],_0x253e('0x8a'),_0x10f4b7[_0x253e('0x7c')]);}}return _0x1e9f9d[_0x253e('0x8b')](_0x297017);}})[_0x253e('0x5b')](handleError(_0x1e9f9d,null));};exports[_0x253e('0x8e')]=function(_0x1a3026,_0xc43b7a,_0x2ddedd){var _0x37eaa8=path[_0x253e('0x80')](config[_0x253e('0x87')],'server/files/images/avatars/system_avatar.png');var _0x41c707={'where':{'id':_0x1a3026[_0x253e('0x65')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x253e('0x58')][_0x253e('0x5d')](_0x41c707)['then'](handleEntityNotFound(_0xc43b7a,null))['then'](function(_0x28fc19){if(_0x28fc19){if(!_['isNil'](_0x28fc19[_0x253e('0x7e')])){if(fs[_0x253e('0x85')](path[_0x253e('0x80')](config[_0x253e('0x87')],_0x253e('0x8a'),_0x28fc19[_0x253e('0x7e')]))){_0x37eaa8=path[_0x253e('0x80')](config[_0x253e('0x87')],_0x253e('0x8a'),_0x28fc19[_0x253e('0x7e')]);}}return _0xc43b7a[_0x253e('0x8b')](_0x37eaa8);}})[_0x253e('0x5b')](handleError(_0xc43b7a,null));};exports[_0x253e('0x8f')]=function(_0x282b45,_0x3677c6,_0x14a13e){var _0x43ac5f=require(_0x253e('0x90'));var _0x52122a=new _0x43ac5f();var _0x46b9f4=_0x52122a['setUA'](_0x282b45[_0x253e('0x91')]['user-agent'])[_0x253e('0x92')]();var _0x27bbc6={'body':_0x282b45[_0x253e('0x5f')],'channel':_0x253e('0x93')};var _0x3ca80f=[];var _0x37dd10=[];var _0x45450a={};var _0x1fc478=![];return db['CmContact'][_0x253e('0x67')]()[_0x253e('0x23')](function(_0xaf0e46){if(!_0xaf0e46){throw new db['Sequelize'][(_0x253e('0x94'))](_0x253e('0x95'));}_0x3ca80f=_[_0x253e('0x96')](_[_0x253e('0x47')](_0xaf0e46),[_0x253e('0x97'),'updatedAt']);_0x37dd10=_['difference'](_[_0x253e('0x47')](_0xaf0e46),['createdAt','updatedAt',_0x253e('0x98'),'ListId']);if(_0x282b45[_0x253e('0x5f')]['id']){delete _0x282b45[_0x253e('0x5f')]['id'];}if(_[_0x253e('0x83')](_0x282b45[_0x253e('0x5f')]['from'])){throw new db[(_0x253e('0x99'))][(_0x253e('0x94'))](_0x253e('0x9a'));}if(_['isNil'](_0x282b45[_0x253e('0x5f')][_0x253e('0x5f')])||_0x282b45[_0x253e('0x5f')][_0x253e('0x5f')]===''){throw new db[(_0x253e('0x99'))]['ValidationError'](_0x253e('0x9b'));}if(_[_0x253e('0x83')](_0x282b45[_0x253e('0x5f')][_0x253e('0x9c')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x37dd10);}if(!_[_0x253e('0x9d')](_0x37dd10,_0x282b45['body'][_0x253e('0x9c')])){throw new db[(_0x253e('0x99'))][(_0x253e('0x94'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x37dd10);}_0x45450a[_0x282b45['body']['mapKey']]=_0x282b45[_0x253e('0x5f')][_0x253e('0x9e')];})[_0x253e('0x23')](function(){return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x282b45[_0x253e('0x65')]['id']},'include':[{'model':db[_0x253e('0x9f')],'as':_0x253e('0xa0'),'include':[{'model':db[_0x253e('0xa1')],'as':'Contacts','where':_0x45450a,'limit':0x1,'order':[[_0x253e('0xa2'),_0x253e('0xa3')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x253e('0x23')](handleEntityNotFound(_0x3677c6,null))[_0x253e('0x23')](function(_0x456437){if(_0x456437&&_0x456437[_0x253e('0xa0')]){_0x27bbc6[_0x253e('0xa4')]=_0x456437;_0x27bbc6[_0x253e('0xa5')]=_0x456437[_0x253e('0xa6')];_0x27bbc6[_0x253e('0xa7')]=_0x456437['List'];_0x27bbc6['applications']=_[_0x253e('0xa8')](_0x27bbc6[_0x253e('0xa5')],['priority'],[_0x253e('0xa9')]);if(_0x27bbc6[_0x253e('0xa4')]['Applications']){delete _0x27bbc6[_0x253e('0xa4')]['Applications'];}if(_0x27bbc6[_0x253e('0xa4')][_0x253e('0xa0')]&&_0x27bbc6[_0x253e('0xa4')][_0x253e('0xa0')][_0x253e('0xaa')][_0x253e('0x4c')]){return _0x27bbc6[_0x253e('0xa4')][_0x253e('0xa0')][_0x253e('0xaa')][0x0];}var _0x494fa7=_[_0x253e('0x1c')](_0x282b45['body'],{'firstName':_0x282b45[_0x253e('0x5f')][_0x253e('0x9e')],'ListId':_0x456437[_0x253e('0xab')]});_0x494fa7[_0x282b45[_0x253e('0x5f')][_0x253e('0x9c')]]=_0x282b45[_0x253e('0x5f')][_0x253e('0x9e')];return db['CmContact'][_0x253e('0x5e')](_0x494fa7,{'fields':_0x3ca80f,'raw':!![]});}})[_0x253e('0x23')](handleEntityNotFound(_0x3677c6,null))[_0x253e('0x23')](function(_0x58de63){_0x27bbc6[_0x253e('0xac')]=_0x58de63;var _0x4783ff=_0x282b45[_0x253e('0x5f')][_0x253e('0xad')];if(_0x282b45[_0x253e('0x91')][_0x253e('0xae')]){_0x4783ff=_0x282b45[_0x253e('0x91')]['cf-connecting-ip'];}else if(_0x282b45[_0x253e('0x91')]['x-forwarded-for']){_0x4783ff=_[_0x253e('0xaf')](_0x282b45[_0x253e('0x91')][_0x253e('0xb0')][_0x253e('0xb1')](','));}if(_0x58de63){var _0x54b127={'ContactId':_0x58de63['id'],'ChatWebsiteId':_0x282b45[_0x253e('0x65')]['id'],'from':(_0x58de63[_0x253e('0xb2')]||'')+'\x20'+(_0x58de63['lastName']||''),'customerIp':_0x4783ff,'customerPort':_0x282b45[_0x253e('0x91')][_0x253e('0xb3')]?_0x282b45['headers'][_0x253e('0xb3')]:null,'referer':_0x282b45[_0x253e('0x5f')]['referer'],'browserName':_0x46b9f4['browser'][_0x253e('0x3e')]&&_0x46b9f4[_0x253e('0xb4')]['version']?util['format']('%s\x20%s',_0x46b9f4[_0x253e('0xb4')][_0x253e('0x3e')],_0x46b9f4[_0x253e('0xb4')][_0x253e('0xb5')]):'unknown','browserVersion':_0x46b9f4[_0x253e('0xb4')]['version']||_0x253e('0xb6'),'osName':util[_0x253e('0xb7')](_0x253e('0xb8'),_0x46b9f4['os']['name'],_0x46b9f4['os'][_0x253e('0xb5')]),'osVersion':_0x46b9f4['os']['version'],'deviceModel':_0x46b9f4['device'][_0x253e('0x45')]&&_0x46b9f4[_0x253e('0xb9')][_0x253e('0xba')]?util['format']('%s\x20%s\x20%s',_0x46b9f4[_0x253e('0xb9')][_0x253e('0x45')],_0x46b9f4[_0x253e('0xb9')][_0x253e('0xba')],_0x46b9f4[_0x253e('0xb9')][_0x253e('0x54')]):null,'deviceVendor':_0x46b9f4['device'][_0x253e('0xba')],'deviceType':_0x46b9f4[_0x253e('0xb9')]['type'],'formData':JSON['stringify'](_0x282b45[_0x253e('0x5f')])};var _0x4018a8={'ChatWebsiteId':_0x282b45[_0x253e('0x65')]['id'],'closed':![]};if(_0x282b45[_0x253e('0x5f')]['threadId']){_0x4018a8[_0x253e('0xbb')]=_0x282b45['body'][_0x253e('0xbb')];return db['ChatInteraction'][_0x253e('0x5d')]({'where':_0x4018a8})[_0x253e('0x23')](function(_0x16a06b){if(_0x16a06b){return[_0x16a06b,![]];}_0x54b127[_0x253e('0xbb')]=_0x282b45['body'][_0x253e('0xbb')];_0x54b127['externalUrl']=_0x282b45[_0x253e('0x5f')][_0x253e('0xbc')];return db[_0x253e('0xbd')][_0x253e('0x5e')](_0x54b127)[_0x253e('0x23')](function(_0x569a2d){return[_0x569a2d,!![]];});});}_0x4018a8[_0x253e('0xbe')]=_0x58de63['id'];if(_0x282b45[_0x253e('0x5f')][_0x253e('0xbf')]&&_0x282b45[_0x253e('0x5f')][_0x253e('0xbf')]['id']){_0x4018a8['id']=_0x282b45[_0x253e('0x5f')][_0x253e('0xbf')]['id'];return db[_0x253e('0xbd')][_0x253e('0x5d')]({'where':_0x4018a8})['then'](function(_0x394103){if(_0x394103){return[_0x394103,![]];}return db[_0x253e('0xbd')][_0x253e('0x5e')](_0x54b127)['then'](function(_0x4d62ae){return[_0x4d62ae,!![]];});});}return db[_0x253e('0xbd')][_0x253e('0x5e')](_0x54b127)[_0x253e('0x23')](function(_0x2590ec){return[_0x2590ec,!![]];});}})[_0x253e('0xc0')](function(_0x384d72,_0x356748){if(_0x384d72){_0x1fc478=_0x356748;if(!_0x356748){var _0x309662={'from':(_0x27bbc6[_0x253e('0xac')][_0x253e('0xb2')]||'')+'\x20'+(_0x27bbc6['contact']['lastName']||'')};if(_0x282b45[_0x253e('0x5f')][_0x253e('0xbb')]&&_0x282b45[_0x253e('0x5f')][_0x253e('0xc1')]&&_0x282b45['body'][_0x253e('0xbb')]!=_0x282b45[_0x253e('0x5f')][_0x253e('0xc1')]){_0x309662[_0x253e('0xbb')]=_0x282b45[_0x253e('0x5f')][_0x253e('0xc1')];}return _0x384d72[_0x253e('0x39')](_0x309662);}else{return _0x384d72;}}})[_0x253e('0x23')](function(_0x33d77f){_0x27bbc6[_0x253e('0xbf')]=_0x33d77f[_0x253e('0x3a')]({'plain':!![]});_0x27bbc6[_0x253e('0xbf')][_0x253e('0xc2')]=_0x1fc478;if(_0x27bbc6[_0x253e('0xbf')][_0x253e('0xc2')]){if(_0x27bbc6['account']['autoclose']){_0x27bbc6[_0x253e('0xa5')][_0x253e('0xc3')]({'id':0x0,'priority':_0x27bbc6[_0x253e('0xa5')][_0x253e('0x4c')]+0x1,'app':'close','appdata':_0x253e('0xc4'),'interval':_0x253e('0xc5')});}}return db['ChatMessage'][_0x253e('0x5e')]({'body':_0x282b45['body'][_0x253e('0x5f')],'ChatWebsiteId':_0x282b45['params']['id'],'ChatInteractionId':_0x33d77f['id'],'direction':'in','ContactId':_0x27bbc6['contact']['id'],'AttachmentId':_0x282b45[_0x253e('0x5f')]['AttachmentId']});})[_0x253e('0x23')](function(_0x15758d){_0x27bbc6['message']=_0x15758d;if(_0x27bbc6[_0x253e('0xbf')][_0x253e('0xc6')]){return db[_0x253e('0xc7')][_0x253e('0x5d')]({'attributes':['id','name'],'where':{'id':_0x27bbc6['interaction']['UserId']}})[_0x253e('0x23')](function(_0x381199){if(_0x381199){_0x27bbc6[_0x253e('0xa5')]['unshift']({'id':0x0,'priority':0x0,'app':_0x253e('0xc8'),'appdata':_0x381199['name']+','+(_0x27bbc6[_0x253e('0xa4')][_0x253e('0xc9')]||0xa),'interval':_0x253e('0xc5')});_0x27bbc6[_0x253e('0xca')]=!![];}return respondWithRpcPromise('Start',_0x253e('0xcb'),_0x27bbc6);});}return respondWithRpcPromise(_0x253e('0xcc'),_0x253e('0xcb'),_0x27bbc6);})['then'](function(_0x189ec7){respondWithRpcPromise('EventManager',_0x253e('0xcd'),{'event':'notify','message':_0x189ec7},client9002);return _0x189ec7;})['then'](respondWithResult(_0x3677c6,null))[_0x253e('0x5b')](handleError(_0x3677c6,null));};exports[_0x253e('0xce')]=function(_0x3edbd9,_0x4c6035,_0x35826a){var _0x47454b,_0x5b98d6,_0x20d9ad;var _0x5107cd=[];var _0x688826=[];var _0x36343c={};var _0x2eff0c=_0x3edbd9[_0x253e('0xcf')]||[];var _0x42af7f=[];var _0x491fe3;return db[_0x253e('0xa1')][_0x253e('0x67')]()[_0x253e('0x23')](function(_0x19f550){if(!_0x19f550){throw new db['Sequelize'][(_0x253e('0x94'))]('no\x20available\x20attributes');}_0x688826=_[_0x253e('0x96')](_['keys'](_0x19f550),['createdAt',_0x253e('0xa2')]);_0x5107cd=_[_0x253e('0x96')](_[_0x253e('0x47')](_0x19f550),[_0x253e('0x97'),_0x253e('0xa2'),_0x253e('0x98'),'ListId']);if(_0x3edbd9['body']['id']){delete _0x3edbd9[_0x253e('0x5f')]['id'];}if(_['isNil'](_0x3edbd9[_0x253e('0x5f')]['from'])){throw _0x4c6035[_0x253e('0x34')](0x1f4)[_0x253e('0xd0')](new db[(_0x253e('0x99'))][(_0x253e('0x94'))](_0x253e('0x9a')));}if(_['isNil'](_0x3edbd9['body']['body'])||_0x3edbd9[_0x253e('0x5f')][_0x253e('0x5f')]===''){throw _0x4c6035['status'](0x1f4)['send'](new db[(_0x253e('0x99'))][(_0x253e('0x94'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x253e('0x83')](_0x3edbd9[_0x253e('0x5f')][_0x253e('0xd1')])){throw _0x4c6035[_0x253e('0x34')](0x1f4)[_0x253e('0xd0')](new db['Sequelize'][(_0x253e('0x94'))](_0x253e('0xd2')+_0x5107cd));}if(!_['includes'](_0x5107cd,_0x3edbd9[_0x253e('0x5f')][_0x253e('0xd1')])){throw _0x4c6035['status'](0x1f4)[_0x253e('0xd0')](new db[(_0x253e('0x99'))][(_0x253e('0x94'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5107cd));}_0x36343c[_0x3edbd9[_0x253e('0x5f')][_0x253e('0xd1')]]=_0x3edbd9[_0x253e('0x5f')][_0x253e('0x9e')];})[_0x253e('0x23')](function(){return db['ChatWebsite'][_0x253e('0x5d')]({'where':{'id':_0x3edbd9[_0x253e('0x65')]['id']},'include':[{'model':db[_0x253e('0x9f')],'as':'List'},{'model':db[_0x253e('0xd3')],'as':_0x253e('0xd3')}]});})[_0x253e('0x23')](handleEntityNotFound(_0x4c6035,null))[_0x253e('0x23')](function(_0x54f6de){if(_0x54f6de&&_0x54f6de['List']){_0x5b98d6=_0x54f6de;var _0x304758=_[_0x253e('0x1c')](_0x3edbd9[_0x253e('0x5f')],{'firstName':_0x3edbd9[_0x253e('0x5f')][_0x253e('0x9e')],'phone':_0x3edbd9[_0x253e('0x5f')][_0x253e('0x9e')],'ListId':_0x54f6de['ListId']});_0x304758[_0x3edbd9[_0x253e('0x5f')][_0x253e('0xd1')]]=_0x3edbd9[_0x253e('0x5f')][_0x253e('0x9e')];return db[_0x253e('0xa1')]['findOrCreate']({'where':_0x36343c,'defaults':_0x304758});}})[_0x253e('0xc0')](function(_0xf02a86){if(_0xf02a86){_0x20d9ad=_0xf02a86;var _0x474a5c=fs[_0x253e('0xd4')](path[_0x253e('0x80')](config[_0x253e('0x87')],'server/files/templates/chatOfflineMessage.ejs'),_0x253e('0xd5'));var _0x469460=ejs[_0x253e('0xd6')](_0x474a5c,{'body':_[_0x253e('0xd7')](_0x3edbd9[_0x253e('0x5f')][_0x253e('0x5f')]),'bodyTitle':_0x5b98d6[_0x253e('0xd8')]});return db[_0x253e('0xd9')]['create']({'body':_0x469460,'ContactId':_0xf02a86['id'],'ChatWebsiteId':_0x5b98d6['id']});}})[_0x253e('0x23')](function(_0xb89c70){_0x491fe3=_0xb89c70;if(_0x2eff0c[_0x253e('0x4c')]){var _0x11b6c4=_0x2eff0c[_0x253e('0x53')](function(_0x4e88bb){return{'name':_0x4e88bb[_0x253e('0xda')],'basename':_0x4e88bb[_0x253e('0x78')],'type':_0x4e88bb['mimetype'],'ChatOfflineMessageId':_0xb89c70['id']};});_0x42af7f=_0x11b6c4[_0x253e('0x53')](_0x1b6d5b=>{var _0x455482={'filename':_0x1b6d5b[_0x253e('0x3e')],'path':path[_0x253e('0x80')](config['root'],_0x253e('0xdb'),_0x253e('0xcf'),'attachments',_0x253e('0xdc'),_0x1b6d5b[_0x253e('0xdd')])};return _0x455482;});if(!_0x5b98d6[_0x253e('0xde')]){return db['sequelize'][_0x253e('0xdf')](function(_0x50d12a){return db[_0x253e('0xe0')][_0x253e('0xe1')](_0x11b6c4,{'transaction':_0x50d12a});});}}})[_0x253e('0x23')](function(){if(_0x491fe3){_0x47454b=_0x491fe3;return db[_0x253e('0xd3')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x253e('0xe2')],'as':_0x253e('0xe3'),'raw':!![]}]});}})[_0x253e('0x23')](function(_0x3cbd16){if(_0x3cbd16&&_0x3cbd16['Smtp']&&_0x5b98d6['forwardOffline']&&_0x5b98d6[_0x253e('0xe4')]){var _0x560636={'tls':{'rejectUnauthorized':![]}};if(_0x3cbd16[_0x253e('0xe3')]['service']){_0x560636[_0x253e('0xe5')]=_0x3cbd16[_0x253e('0xe3')][_0x253e('0xe5')];}else{_0x560636['host']=_0x3cbd16[_0x253e('0xe3')][_0x253e('0xe6')];_0x560636[_0x253e('0xe7')]=_0x3cbd16[_0x253e('0xe3')]['port'];_0x560636[_0x253e('0xe8')]=_0x3cbd16[_0x253e('0xe3')][_0x253e('0xe8')];}if(_0x3cbd16[_0x253e('0xe3')]['authentication']){_0x560636['auth']={'user':_0x3cbd16[_0x253e('0xe3')][_0x253e('0x60')],'pass':_0x3cbd16['Smtp'][_0x253e('0xe9')]};}return respondWithRpcPromise(_0x253e('0xea'),'sendMail',{'account':_0x560636,'message':{'from':util[_0x253e('0xb7')]('\x22%s\x22\x20<%s>',_0x3cbd16['name'],_0x3cbd16[_0x253e('0xeb')]||_0x3cbd16[_0x253e('0xe3')][_0x253e('0x60')]),'to':_0x5b98d6[_0x253e('0xe4')],'subject':_0x5b98d6['offlineMessageSubject'],'html':_0x47454b[_0x253e('0x5f')],'attachments':_0x42af7f}},client9003)[_0x253e('0x23')](function(){return _0x47454b;})[_0x253e('0x5b')](function(_0x3f9fda){console['error'](_0x3f9fda);});}})[_0x253e('0x23')](function(){if(_0x5b98d6&&_0x5b98d6[_0x253e('0xde')]&&_0x5b98d6[_0x253e('0xec')]){var _0x7f0ce8=[];if(_0x2eff0c[_0x253e('0x4c')]){_0x7f0ce8=_0x2eff0c[_0x253e('0x53')](function(_0x592844){return{'name':_0x592844['originalname'],'basename':_0x592844[_0x253e('0x78')],'type':_0x592844[_0x253e('0xed')],'ChatOfflineMessageId':_0x491fe3['id']};});}var _0x9509c7;if(!_[_0x253e('0x83')](_0x5b98d6[_0x253e('0xee')])){var _0x31a6c5=_['map'](_0x3edbd9['body'],function(_0x2fea5b){return _0x2fea5b;});var _0x5893d4=_[_0x253e('0xef')](_0x31a6c5)[0x0];var _0x38fee1=_['mapValues'](_0x5893d4,function(_0x469762){return _0x469762;});_0x9509c7=_0x38fee1[0x1][_0x5b98d6[_0x253e('0xee')]];}var _0x48befe={'from':_0x20d9ad[_0x253e('0xeb')],'firstName':_0x20d9ad[_0x253e('0xb2')],'lastName':_0x20d9ad[_0x253e('0xf0')],'mapKey':_0x253e('0xeb'),'message':{'from':_0x20d9ad[_0x253e('0xeb')],'to':_0x5b98d6[_0x253e('0xd3')][_0x253e('0xeb')],'cc':'','subject':_[_0x253e('0x83')](_0x9509c7)?_0x5b98d6[_0x253e('0xf1')]:_0x9509c7,'messageId':'','sentAt':new Date(),'attach':_0x7f0ce8['length'],'attachments':_0x7f0ce8,'originChannel':_0x253e('0xf2'),'ChatWebsiteId':_0x5b98d6['id'],'ChatOfflineMessageId':_0x47454b['id'],'originTo':_0x5b98d6['MailAccount'][_0x253e('0xeb')]},'body':_0x47454b['body']};var _0x1881d3={'account':{'id':_0x5b98d6['MailAccountId']},'body':_0x48befe,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x253e('0xf3'),'notifyMail',_0x1881d3,client9001)[_0x253e('0x23')](function(){return _0x47454b;})['catch'](function(_0xf214af){console['error'](_0xf214af);});}return;})[_0x253e('0x23')](function(){if(_0x47454b){return _0x47454b;}})[_0x253e('0x23')](respondWithResult(_0x4c6035,null))['catch'](function(_0x5ce4bb){console['error'](_0x253e('0x5b'),_0x5ce4bb);for(var _0x4c3773 of _0x2eff0c){var _0x3c6691=path[_0x253e('0x80')](config['root'],'server','files','attachments','offline-chat',_0x4c3773[_0x253e('0x78')]);fs_extra['remove'](_0x3c6691)['catch'](function(_0x4b7283){console[_0x253e('0x2a')]('Could\x20not\x20remove\x20attachment\x20file',_0x3c6691,_0x4b7283);});}});};exports[_0x253e('0xf4')]=function(_0x3402bb,_0xa2cdce,_0x4a93fb){return db[_0x253e('0xbd')][_0x253e('0x5d')]({'where':{'id':_0x3402bb['params']['id']}})[_0x253e('0x23')](handleEntityNotFound(_0xa2cdce,null))['then'](function(_0x3fadaf){if(_0x3fadaf){return _0x3fadaf[_0x253e('0xf4')](_0x3402bb['body'][_0x253e('0x70')],_['omit'](_0x3402bb['body'],[_0x253e('0x70'),'id'])||{});}})[_0x253e('0x23')](respondWithResult(_0xa2cdce,null))[_0x253e('0x5b')](handleError(_0xa2cdce,null));};exports['getInteractions']=function(_0x189cad,_0x47c617,_0x11699c){var _0x4fb136={'raw':![],'where':{}};var _0x5192a3={};var _0xfc2a29={'count':0x0,'rows':[]};return db[_0x253e('0x58')][_0x253e('0x74')]({'where':{'id':_0x189cad[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x47c617,null))[_0x253e('0x23')](function(_0x4f91ad){if(_0x4f91ad){_0x5192a3[_0x253e('0x45')]=_[_0x253e('0x47')](db[_0x253e('0xbd')]['rawAttributes']);_0x5192a3[_0x253e('0x46')]=_[_0x253e('0x47')](_0x189cad[_0x253e('0x46')]);_0x5192a3[_0x253e('0x48')]=_[_0x253e('0x49')](_0x5192a3[_0x253e('0x45')],_0x5192a3[_0x253e('0x46')]);_0x4fb136[_0x253e('0x4b')]=_['intersection'](_0x5192a3[_0x253e('0x45')],qs[_0x253e('0x4a')](_0x189cad['query']['fields']));_0x4fb136[_0x253e('0x4b')]=_0x4fb136[_0x253e('0x4b')]['length']?_0x4fb136[_0x253e('0x4b')]:_0x5192a3['model'];if(!_0x189cad[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x4fb136['limit']=qs[_0x253e('0x32')](_0x189cad[_0x253e('0x46')][_0x253e('0x32')]);_0x4fb136['offset']=qs['offset'](_0x189cad[_0x253e('0x46')]['offset']);}_0x4fb136['order']=qs[_0x253e('0x6c')](_0x189cad[_0x253e('0x46')][_0x253e('0x6c')]);_0x4fb136[_0x253e('0x52')]=qs[_0x253e('0x48')](_[_0x253e('0x50')](_0x189cad[_0x253e('0x46')],_0x5192a3[_0x253e('0x48')]));_0x4fb136[_0x253e('0x52')][_0x253e('0x69')]=_0x4f91ad['id'];if(_0x189cad[_0x253e('0x46')]['filter']){_0x4fb136['where']=_[_0x253e('0x56')](_0x4fb136['where'],{'$or':_['map'](_0x4fb136[_0x253e('0x4b')],function(_0x27ee2f){var _0x32fc5d={};_0x32fc5d[_0x27ee2f]={'$like':'%'+_0x189cad[_0x253e('0x46')]['filter']+'%'};return _0x32fc5d;})});}_0x4fb136=_[_0x253e('0x56')]({},_0x4fb136,_0x189cad['options']);return db[_0x253e('0xbd')][_0x253e('0x33')]({'where':_0x4fb136[_0x253e('0x52')]})['then'](function(_0x3bb752){_0xfc2a29[_0x253e('0x33')]=_0x3bb752;if(_0x189cad[_0x253e('0x46')][_0x253e('0x59')]){_0x4fb136[_0x253e('0x5a')]=[{'model':db[_0x253e('0xa1')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x253e('0xf5'),'attributes':[_0x253e('0x3e'),'fullname',_0x253e('0xf6')],'required':![]},{'model':db[_0x253e('0xf7')],'as':_0x253e('0xf8'),'attributes':['id','name',_0x253e('0xf9')],'where':_0x189cad[_0x253e('0x46')][_0x253e('0xfa')]?{'id':_0x189cad['query']['tag']}:undefined,'required':_0x189cad['query'][_0x253e('0xfa')]?!![]:![]}];}return db['ChatInteraction'][_0x253e('0x6d')](_0x4fb136);})[_0x253e('0x23')](function(_0x30579f){_0xfc2a29[_0x253e('0x6e')]=_0x30579f;return _0xfc2a29;});}})[_0x253e('0x23')](respondWithFilteredResult(_0x47c617,_0x4fb136))[_0x253e('0x5b')](handleError(_0x47c617,null));};function iftimePromise(_0x29c708,_0x1adad1){return respondWithRpcPromise(_0x253e('0xfb'),'getSnippet',{'command':_0x1adad1['timezone']?util[_0x253e('0xb7')](_0x253e('0xfc'),_0x29c708[_0x253e('0xfd')],_0x1adad1[_0x253e('0xfe')]):util['format'](_0x253e('0xff'),_0x29c708[_0x253e('0xfd')])},client9002)['then'](function(_0x15b2fd){var _0x3ce724=_0x15b2fd&&_0x15b2fd[_0x253e('0x100')](_0x253e('0x101'))>=0x0?!![]:![];logger[_0x253e('0x24')](_0x253e('0x102'),_0x1adad1['id'],_0x29c708['id'],_0x29c708[_0x253e('0xfd')],_0x3ce724?_0x253e('0x103'):_0x253e('0x104'),_0x1adad1[_0x253e('0xfe')]?_0x1adad1[_0x253e('0xfe')]:'No\x20timezone');return _0x3ce724;})[_0x253e('0x5b')](function(_0x5c8517){logger[_0x253e('0x2a')](_0x253e('0x102'),_0x1adad1['id'],_0x29c708['id'],_0x29c708[_0x253e('0xfd')],util[_0x253e('0x105')](_0x5c8517,{'showHidden':![],'depth':null}),_0x1adad1[_0x253e('0xfe')]?_0x1adad1[_0x253e('0xfe')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x2da21c,_0x5aeec7,_0x2fe692){var _0x5ce09d=0x0;var _0x279570=0x0;var _0x507838=![];var _0x13da0d;var _0x501f3b;return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0x2da21c[_0x253e('0x65')]['id']},'include':[{'model':db[_0x253e('0x106')],'as':_0x253e('0x106'),'include':[{'model':db[_0x253e('0x106')],'as':_0x253e('0x107'),'attributes':['id',_0x253e('0xfd')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5aeec7,null))[_0x253e('0x23')](function(_0x53ce82){if(_0x53ce82){_0x13da0d=_0x53ce82;return _0x53ce82[_0x253e('0x108')]({'raw':!![]});}})[_0x253e('0x23')](function(_0x583741){if(_0x13da0d){if(_0x583741){_0x501f3b=_0x583741;}}return require('../../config/license/util')[_0x253e('0x81')]();})[_0x253e('0x23')](function(_0x37e921){if(_0x37e921){_0x279570=_0x37e921[_0x253e('0x109')];_0x507838=_0x37e921[_0x253e('0x82')];}})[_0x253e('0x23')](function(){return db[_0x253e('0xbd')][_0x253e('0x33')]({'where':{'closed':![]}});})['then'](function(_0x2f8b5c){_0x5ce09d=_0x2f8b5c;if(_0x279570&&_0x2f8b5c>_0x279570){return db['License'][_0x253e('0x74')]({'where':{'id':0x1}})['then'](function(_0x14571b){if(_0x14571b){_0x14571b['increment']('chatLicenseExceeded');}});}})[_0x253e('0x23')](function(){if(_0x13da0d[_0x253e('0x106')]&&_0x13da0d['Interval'][_0x253e('0x107')]){var _0x4c105f=[];for(var _0xe2972e=0x0;_0xe2972e<_0x13da0d[_0x253e('0x106')][_0x253e('0x107')][_0x253e('0x4c')];_0xe2972e++){var _0x29b39a=_0x13da0d['Interval'][_0x253e('0x107')][_0xe2972e]['get']({'plain':!![]});_0x4c105f[_0x253e('0xc3')](iftimePromise(_0x29b39a,_0x13da0d));}return BPromise['all'](_0x4c105f)['then'](function(_0x58eff4){return _[_0x253e('0x10a')](_0x58eff4);});}else{return!![];}})[_0x253e('0x23')](function(_0x5f02d3){var _0x26e890=fs[_0x253e('0xd4')](path['join'](config[_0x253e('0x87')],_0x253e('0x10b')),'utf8');var _0x1dc6b9={'remote':_0x13da0d['remote'],'query':querystring[_0x253e('0x29')](_[_0x253e('0x56')](_0x13da0d[_0x253e('0x3a')]({'plain':!![]}),{'customerIp':_0x2da21c[_0x253e('0x91')]['x-forwarded-for']||_0x2da21c['headers'][_0x253e('0x10c')]||_0x2da21c['connection'][_0x253e('0x10d')]||_0x2da21c['ip'],'referer':_0x2da21c[_0x253e('0x91')][_0x253e('0x10e')],'openedInteractions':_0x5ce09d,'maxInteractions':_0x279570,'virtual':_0x507838['virtual'],'online':_0x5f02d3,'custom':_0x507838}))['replace'](/'/g,'\x5c\x27')};_0x5aeec7[_0x253e('0xd0')](ejs[_0x253e('0xd6')](Mustache['render'](_0x26e890,_0x1dc6b9),{'proactiveActions':_0x501f3b,'alignment':_0x13da0d[_0x253e('0x10f')],'verticalAlignment':_0x13da0d[_0x253e('0x110')],'div_color':_0x13da0d[_0x253e('0xf9')],'text_color':_0x13da0d[_0x253e('0x111')],'button_color':_0x13da0d['color_button'],'background_color':_0x13da0d[_0x253e('0x112')]}));})[_0x253e('0x5b')](handleError(_0x5aeec7,null));};exports['addApplications']=function(_0x2a1bf7,_0x3fca6e,_0x65d499){return db['ChatWebsite'][_0x253e('0x74')]({'where':{'id':_0x2a1bf7[_0x253e('0x65')]['id']}})['then'](handleEntityNotFound(_0x3fca6e,null))[_0x253e('0x23')](function(_0x592c9e){if(_0x592c9e){return db[_0x253e('0x113')][_0x253e('0xdf')](function(_0x4908ce){return db['ChatApplication'][_0x253e('0x66')]({'where':{'ChatWebsiteId':_0x2a1bf7['params']['id']},'transaction':_0x4908ce})['then'](function(_0x40d547){var _0x4eab68=_['map'](_0x2a1bf7[_0x253e('0x5f')],function(_0x413670){_0x413670[_0x253e('0x69')]=_0x2a1bf7[_0x253e('0x65')]['id'];return _0x413670;});return db['ChatApplication'][_0x253e('0xe1')](_0x4eab68,{'transaction':_0x4908ce});});})[_0x253e('0x23')](function(){return db[_0x253e('0x114')][_0x253e('0x115')]({'where':{'ChatWebsiteId':_0x2a1bf7[_0x253e('0x65')]['id']},'order':_0x253e('0x116')});});}})['then'](respondWithResult(_0x3fca6e,null))['catch'](handleError(_0x3fca6e,null));};exports[_0x253e('0x117')]=function(_0x49ad7b,_0x43ce24,_0x4cc05a){var _0x45c147={};var _0x455447={};var _0x3fe027;var _0x1db437;return db[_0x253e('0x58')]['findOne']({'where':{'id':_0x49ad7b[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x43ce24,null))[_0x253e('0x23')](function(_0xa8e3a6){if(_0xa8e3a6){_0x3fe027=_0xa8e3a6;_0x455447[_0x253e('0x45')]=_['keys'](db[_0x253e('0x114')][_0x253e('0x42')]);_0x455447[_0x253e('0x46')]=_['keys'](_0x49ad7b['query']);_0x455447['filters']=_[_0x253e('0x49')](_0x455447[_0x253e('0x45')],_0x455447[_0x253e('0x46')]);_0x45c147[_0x253e('0x4b')]=_['intersection'](_0x455447[_0x253e('0x45')],qs[_0x253e('0x4a')](_0x49ad7b['query']['fields']));_0x45c147[_0x253e('0x4b')]=_0x45c147[_0x253e('0x4b')]['length']?_0x45c147[_0x253e('0x4b')]:_0x455447[_0x253e('0x45')];_0x45c147[_0x253e('0x4f')]=qs['sort'](_0x49ad7b[_0x253e('0x46')][_0x253e('0x6c')]);_0x45c147[_0x253e('0x52')]=qs[_0x253e('0x48')](_[_0x253e('0x50')](_0x49ad7b[_0x253e('0x46')],_0x455447[_0x253e('0x48')]));if(_0x49ad7b['query'][_0x253e('0x51')]){_0x45c147[_0x253e('0x52')]=_[_0x253e('0x56')](_0x45c147[_0x253e('0x52')],{'$or':_[_0x253e('0x53')](_0x45c147[_0x253e('0x4b')],function(_0x1aaf8e){var _0x1474a0={};_0x1474a0[_0x1aaf8e]={'$like':'%'+_0x49ad7b[_0x253e('0x46')][_0x253e('0x51')]+'%'};return _0x1474a0;})});}_0x45c147=_[_0x253e('0x56')]({},_0x45c147,_0x49ad7b[_0x253e('0x57')]);return _0x3fe027[_0x253e('0x117')](_0x45c147);}})[_0x253e('0x23')](function(_0x285a7b){if(_0x285a7b){_0x1db437=_0x285a7b[_0x253e('0x4c')];if(!_0x49ad7b[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x45c147[_0x253e('0x32')]=qs[_0x253e('0x32')](_0x49ad7b[_0x253e('0x46')][_0x253e('0x32')]);_0x45c147['offset']=qs['offset'](_0x49ad7b[_0x253e('0x46')][_0x253e('0x30')]);}return _0x3fe027['getApplications'](_0x45c147);}})[_0x253e('0x23')](function(_0x243c45){if(_0x243c45){return _0x243c45?{'count':_0x1db437,'rows':_0x243c45}:null;}})['then'](respondWithResult(_0x43ce24,null))[_0x253e('0x5b')](handleError(_0x43ce24,null));};exports[_0x253e('0x118')]=function(_0x23107a,_0x12edf5,_0xba2629){return db['chatProactiveAction']['find']({'where':{'id':_0x23107a[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x12edf5,null))['then'](function(_0x1f76b7){if(_0x1f76b7){return _0x1f76b7['addProactiveActions'](_0x23107a['body'][_0x253e('0x70')],_['omit'](_0x23107a[_0x253e('0x5f')],[_0x253e('0x70'),'id'])||{});}})[_0x253e('0x23')](respondWithResult(_0x12edf5,null))[_0x253e('0x5b')](handleError(_0x12edf5,null));};exports['getProactiveActions']=function(_0x3dbdff,_0x1f1776,_0x202e16){var _0x5a372f={};var _0x3b8ba2={};var _0x573b15;var _0x21611d;return db[_0x253e('0x58')][_0x253e('0x74')]({'where':{'id':_0x3dbdff[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x1f1776,null))[_0x253e('0x23')](function(_0x5f33b2){if(_0x5f33b2){_0x573b15=_0x5f33b2;_0x3b8ba2[_0x253e('0x45')]=_['keys'](db[_0x253e('0x119')][_0x253e('0x42')]);_0x3b8ba2[_0x253e('0x46')]=_[_0x253e('0x47')](_0x3dbdff[_0x253e('0x46')]);_0x3b8ba2['filters']=_[_0x253e('0x49')](_0x3b8ba2['model'],_0x3b8ba2[_0x253e('0x46')]);_0x5a372f[_0x253e('0x4b')]=_[_0x253e('0x49')](_0x3b8ba2[_0x253e('0x45')],qs['fields'](_0x3dbdff['query'][_0x253e('0x4a')]));_0x5a372f[_0x253e('0x4b')]=_0x5a372f['attributes']['length']?_0x5a372f['attributes']:_0x3b8ba2[_0x253e('0x45')];_0x5a372f['order']=qs[_0x253e('0x6c')](_0x3dbdff[_0x253e('0x46')][_0x253e('0x6c')]);_0x5a372f[_0x253e('0x52')]=qs['filters'](_[_0x253e('0x50')](_0x3dbdff[_0x253e('0x46')],_0x3b8ba2['filters']));if(_0x3dbdff[_0x253e('0x46')]['filter']){_0x5a372f[_0x253e('0x52')]=_[_0x253e('0x56')](_0x5a372f['where'],{'$or':_[_0x253e('0x53')](_0x5a372f[_0x253e('0x4b')],function(_0x35bb21){var _0x4aa7b2={};_0x4aa7b2[_0x35bb21]={'$like':'%'+_0x3dbdff[_0x253e('0x46')]['filter']+'%'};return _0x4aa7b2;})});}_0x5a372f=_[_0x253e('0x56')]({},_0x5a372f,_0x3dbdff[_0x253e('0x57')]);return _0x573b15[_0x253e('0x108')](_0x5a372f);}})[_0x253e('0x23')](function(_0x597de5){if(_0x597de5){_0x21611d=_0x597de5[_0x253e('0x4c')];if(!_0x3dbdff[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x5a372f[_0x253e('0x32')]=qs[_0x253e('0x32')](_0x3dbdff[_0x253e('0x46')][_0x253e('0x32')]);_0x5a372f[_0x253e('0x30')]=qs[_0x253e('0x30')](_0x3dbdff[_0x253e('0x46')][_0x253e('0x30')]);}return _0x573b15['getProactiveActions'](_0x5a372f);}})[_0x253e('0x23')](function(_0x3fcaff){if(_0x3fcaff){return _0x3fcaff?{'count':_0x21611d,'rows':_0x3fcaff}:null;}})[_0x253e('0x23')](respondWithResult(_0x1f1776,null))[_0x253e('0x5b')](handleError(_0x1f1776,null));};exports[_0x253e('0x11a')]=function(_0x23940a,_0x460c11,_0x125a2e){var _0x3228e5=_0x23940a['query'][_0x253e('0x11b')]==='false'?_0x253e('0x11c'):_0x253e('0x11d');return db[_0x253e('0x58')][_0x253e('0x5d')]({'attributes':['id',_0x3228e5],'where':{'id':_0x23940a[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x460c11,null))[_0x253e('0x23')](function(_0x3a3d26){if(_0x3a3d26){var _0x28b192=_0x3a3d26[_0x3228e5];var _0x2bad41=_0x28b192&&_0x28b192[_0x253e('0x11e')]?_0x28b192[_0x253e('0x11e')]:[];_0x460c11[_0x253e('0xd0')]({'fromKey':_[_0x253e('0x83')](_0x28b192['fromKey'])?undefined:_0x28b192[_0x253e('0x11f')],'count':_0x2bad41['length'],'rows':_0x2bad41});}})[_0x253e('0x5b')](handleError(_0x460c11,null));};exports[_0x253e('0x120')]=function(_0x21d437,_0x509077,_0x183434){var _0x9bcb30={'raw':![],'where':{}};var _0x2468ab={};var _0x3e7a96={'count':0x0,'rows':[]};return db[_0x253e('0x58')][_0x253e('0x74')]({'where':{'id':_0x21d437['params']['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x509077,null))['then'](function(_0x3be895){if(_0x3be895){_0x2468ab[_0x253e('0x45')]=_[_0x253e('0x47')](db[_0x253e('0xd9')][_0x253e('0x42')]);_0x2468ab[_0x253e('0x46')]=_[_0x253e('0x47')](_0x21d437['query']);_0x2468ab[_0x253e('0x48')]=_[_0x253e('0x49')](_0x2468ab[_0x253e('0x45')],_0x2468ab[_0x253e('0x46')]);_0x9bcb30[_0x253e('0x4b')]=_['intersection'](_0x2468ab['model'],qs[_0x253e('0x4a')](_0x21d437[_0x253e('0x46')][_0x253e('0x4a')]));_0x9bcb30['attributes']=_0x9bcb30[_0x253e('0x4b')][_0x253e('0x4c')]?_0x9bcb30[_0x253e('0x4b')]:_0x2468ab[_0x253e('0x45')];if(!_0x21d437[_0x253e('0x46')][_0x253e('0x4d')](_0x253e('0x4e'))){_0x9bcb30[_0x253e('0x32')]=qs['limit'](_0x21d437[_0x253e('0x46')][_0x253e('0x32')]);_0x9bcb30['offset']=qs['offset'](_0x21d437[_0x253e('0x46')][_0x253e('0x30')]);}_0x9bcb30[_0x253e('0x4f')]=qs['sort'](_0x21d437[_0x253e('0x46')][_0x253e('0x6c')]);_0x9bcb30[_0x253e('0x52')]=qs[_0x253e('0x48')](_[_0x253e('0x50')](_0x21d437['query'],_0x2468ab[_0x253e('0x48')]));_0x9bcb30[_0x253e('0x52')][_0x253e('0x69')]=_0x3be895['id'];if(_0x21d437[_0x253e('0x46')][_0x253e('0x51')]){_0x9bcb30['where']=_[_0x253e('0x56')](_0x9bcb30[_0x253e('0x52')],{'$or':_[_0x253e('0x53')](_0x9bcb30[_0x253e('0x4b')],function(_0x2fbd48){var _0x4d77d6={};_0x4d77d6[_0x2fbd48]={'$like':'%'+_0x21d437[_0x253e('0x46')][_0x253e('0x51')]+'%'};return _0x4d77d6;})});}_0x9bcb30=_[_0x253e('0x56')]({},_0x9bcb30,_0x21d437[_0x253e('0x57')]);return db[_0x253e('0xd9')]['count']({'where':_0x9bcb30['where']})[_0x253e('0x23')](function(_0x36ec87){_0x3e7a96['count']=_0x36ec87;if(_0x21d437[_0x253e('0x46')][_0x253e('0x59')]){_0x9bcb30['include']=[{'all':!![]}];}else{_0x9bcb30[_0x253e('0x5a')]=[{'model':db[_0x253e('0xa1')],'as':_0x253e('0x121'),'required':![]},{'model':db[_0x253e('0xe0')],'as':_0x253e('0x122'),'required':![]}];}return db[_0x253e('0xd9')]['findAll'](_0x9bcb30);})['then'](function(_0x13bf75){_0x3e7a96[_0x253e('0x6e')]=_0x13bf75;return _0x3e7a96;});}})[_0x253e('0x23')](respondWithFilteredResult(_0x509077,_0x9bcb30))[_0x253e('0x5b')](handleError(_0x509077,null));};exports[_0x253e('0x123')]=function(_0xa6f62e,_0x1ad746,_0x201142){return db[_0x253e('0x58')][_0x253e('0x5d')]({'where':{'id':_0xa6f62e[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x1ad746,null))[_0x253e('0x23')](function(_0xd0c889){if(_0xd0c889){return _0xd0c889[_0x253e('0x123')](_0xa6f62e[_0x253e('0x5f')]['ids'],_[_0x253e('0x124')](_0xa6f62e[_0x253e('0x5f')],['ids','id'])||{})[_0x253e('0xc0')](function(_0x3d65c1){for(var _0x378654=0x0;_0x378654<_0xa6f62e['body'][_0x253e('0x70')][_0x253e('0x4c')];_0x378654+=0x1){socket[_0x253e('0x125')](_0x253e('0x126'),{'UserId':Number(_0xa6f62e['body'][_0x253e('0x70')][_0x378654]),'ChatWebsiteId':Number(_0xa6f62e[_0x253e('0x65')]['id'])});}return _0x3d65c1;});}})[_0x253e('0x23')](respondWithResult(_0x1ad746,null))['catch'](handleError(_0x1ad746,null));};exports['removeAgents']=function(_0x12db29,_0x104313,_0x53cc67){return db['ChatWebsite'][_0x253e('0x5d')]({'where':{'id':_0x12db29[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x104313,null))[_0x253e('0x23')](function(_0x55ac9b){if(_0x55ac9b){return _0x55ac9b['removeAgents'](_0x12db29[_0x253e('0x46')]['ids'])[_0x253e('0x23')](function(){if(_[_0x253e('0x127')](_0x12db29[_0x253e('0x46')][_0x253e('0x70')])){for(var _0x250789=0x0;_0x250789<_0x12db29['query']['ids']['length'];_0x250789+=0x1){socket[_0x253e('0x125')](_0x253e('0x128'),{'UserId':Number(_0x12db29['query']['ids'][_0x250789]),'ChatWebsiteId':Number(_0x12db29[_0x253e('0x65')]['id'])});}}else{socket[_0x253e('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x12db29[_0x253e('0x46')][_0x253e('0x70')]),'ChatWebsiteId':Number(_0x12db29['params']['id'])});}});}})[_0x253e('0x23')](respondWithStatusCode(_0x104313,null))['catch'](handleError(_0x104313,null));};exports[_0x253e('0x129')]=function(_0x58684e,_0x2cc875,_0x22464c){var _0xe13cfb={};var _0x4255b6={};var _0x4c5406;var _0x28b53f;return db[_0x253e('0x58')][_0x253e('0x74')]({'where':{'id':_0x58684e[_0x253e('0x65')]['id']}})[_0x253e('0x23')](handleEntityNotFound(_0x2cc875,null))[_0x253e('0x23')](function(_0x505be0){if(_0x505be0){_0x4c5406=_0x505be0;_0x4255b6['model']=_[_0x253e('0x47')](db[_0x253e('0xc7')][_0x253e('0x42')]);_0x4255b6['query']=_[_0x253e('0x47')](_0x58684e[_0x253e('0x46')]);_0x4255b6['filters']=_[_0x253e('0x49')](_0x4255b6[_0x253e('0x45')],_0x4255b6[_0x253e('0x46')]);_0xe13cfb[_0x253e('0x4b')]=_[_0x253e('0x49')](_0x4255b6[_0x253e('0x45')],qs[_0x253e('0x4a')](_0x58684e[_0x253e('0x46')][_0x253e('0x4a')]));_0xe13cfb[_0x253e('0x4b')]=_0xe13cfb[_0x253e('0x4b')][_0x253e('0x4c')]?_0xe13cfb['attributes']:_0x4255b6['model'];_0xe13cfb[_0x253e('0x4f')]=qs['sort'](_0x58684e[_0x253e('0x46')]['sort']);_0xe13cfb['where']=qs[_0x253e('0x48')](_[_0x253e('0x50')](_0x58684e[_0x253e('0x46')],_0x4255b6['filters']));if(_0x58684e['query'][_0x253e('0x51')]){_0xe13cfb['where']=_['merge'](_0xe13cfb[_0x253e('0x52')],{'$or':_[_0x253e('0x53')](_0xe13cfb[_0x253e('0x4b')],function(_0x2ab448){var _0x57789e={};_0x57789e[_0x2ab448]={'$like':'%'+_0x58684e[_0x253e('0x46')][_0x253e('0x51')]+'%'};return _0x57789e;})});}_0xe13cfb=_['merge']({},_0xe13cfb,_0x58684e[_0x253e('0x57')]);return _0x4c5406[_0x253e('0x129')](_0xe13cfb);}})[_0x253e('0x23')](function(_0xd7752a){if(_0xd7752a){_0x28b53f=_0xd7752a[_0x253e('0x4c')];if(!_0x58684e['query'][_0x253e('0x4d')](_0x253e('0x4e'))){_0xe13cfb[_0x253e('0x32')]=qs[_0x253e('0x32')](_0x58684e[_0x253e('0x46')][_0x253e('0x32')]);_0xe13cfb[_0x253e('0x30')]=qs[_0x253e('0x30')](_0x58684e[_0x253e('0x46')][_0x253e('0x30')]);}return _0x4c5406[_0x253e('0x129')](_0xe13cfb);}})[_0x253e('0x23')](function(_0x32b00e){if(_0x32b00e){return _0x32b00e?{'count':_0x28b53f,'rows':_0x32b00e}:null;}})['then'](respondWithResult(_0x2cc875,null))['catch'](handleError(_0x2cc875,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1e8f33e..aa2f178 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 _0x01fe=['hook','exports','events','ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0xe4e1a8,_0x4a39ca){var _0x31c223=function(_0x537ceb){while(--_0x537ceb){_0xe4e1a8['push'](_0xe4e1a8['shift']());}};_0x31c223(++_0x4a39ca);}(_0x01fe,0x102));var _0xe01f=function(_0x7944c4,_0x5e6381){_0x7944c4=_0x7944c4-0x0;var _0x20397a=_0x01fe[_0x7944c4];return _0x20397a;};'use strict';var EventEmitter=require(_0xe01f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xe01f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe01f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe01f('0x3')};function emitEvent(_0x1212f6){return function(_0x9505fa,_0x92b885,_0x58223b){ChatWebsiteEvents[_0xe01f('0x4')](_0x1212f6+':'+_0x9505fa['id'],_0x9505fa);ChatWebsiteEvents['emit'](_0x1212f6,_0x9505fa);_0x58223b(null);};}for(var e in events){if(events[_0xe01f('0x5')](e)){var event=events[e];ChatWebsite[_0xe01f('0x6')](e,emitEvent(event));}}module[_0xe01f('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3613=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x50df57,_0x13d686){var _0x53cfbf=function(_0x5a162b){while(--_0x5a162b){_0x50df57['push'](_0x50df57['shift']());}};_0x53cfbf(++_0x13d686);}(_0x3613,0x198));var _0x3361=function(_0x4f879f,_0x301924){_0x4f879f=_0x4f879f-0x0;var _0x1b5d34=_0x3613[_0x4f879f];return _0x1b5d34;};'use strict';var EventEmitter=require(_0x3361('0x0'));var ChatWebsite=require(_0x3361('0x1'))['db'][_0x3361('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3361('0x3')](0x0);var events={'afterCreate':_0x3361('0x4'),'afterUpdate':_0x3361('0x5'),'afterDestroy':_0x3361('0x6')};function emitEvent(_0x56bafb){return function(_0xe6f993,_0x585bf7,_0x21cd23){ChatWebsiteEvents[_0x3361('0x7')](_0x56bafb+':'+_0xe6f993['id'],_0xe6f993);ChatWebsiteEvents[_0x3361('0x7')](_0x56bafb,_0xe6f993);_0x21cd23(null);};}for(var e in events){if(events[_0x3361('0x8')](e)){var event=events[e];ChatWebsite[_0x3361('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 292dff3..28b03bf 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 _0xecd4=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x3b6ebe,_0x48d66e){var _0x1be350=function(_0x56a980){while(--_0x56a980){_0x3b6ebe['push'](_0x3b6ebe['shift']());}};_0x1be350(++_0x48d66e);}(_0xecd4,0x6a));var _0x4ecd=function(_0x1ec280,_0x5b56b3){_0x1ec280=_0x1ec280-0x0;var _0x4eaf0d=_0xecd4[_0x1ec280];return _0x4eaf0d;};'use strict';var _=require(_0x4ecd('0x0'));var util=require(_0x4ecd('0x1'));var logger=require(_0x4ecd('0x2'))(_0x4ecd('0x3'));var moment=require(_0x4ecd('0x4'));var BPromise=require(_0x4ecd('0x5'));var rp=require(_0x4ecd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ecd('0x7'));var config=require(_0x4ecd('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x50e241,_0x2e87dc){return _0x50e241[_0x4ecd('0x9')](_0x4ecd('0xa'),attributes,{'tableName':_0x4ecd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27af=['../../config/logger','api','moment','path','../../config/environment','exports','ChatWebsite','lodash','util'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x27af,0x1db));var _0xf27a=function(_0x5b7e52,_0x2330f1){_0x5b7e52=_0x5b7e52-0x0;var _0x5f2592=_0x27af[_0x5b7e52];return _0x5f2592;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var logger=require(_0xf27a('0x2'))(_0xf27a('0x3'));var moment=require(_0xf27a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf27a('0x5'));var rimraf=require('rimraf');var config=require(_0xf27a('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xf27a('0x7')]=function(_0x298edc,_0x5aa6e5){return _0x298edc['define'](_0xf27a('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 5093e1c..ec769fa 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 _0xce00=['./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xce00,0x8e));var _0x0ce0=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0xce00[_0x52f1e6];return _0x21f104;};'use strict';var _=require('lodash');var util=require(_0x0ce0('0x0'));var moment=require(_0x0ce0('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ce0('0x2'));var fs=require('fs');var Redis=require(_0x0ce0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ce0('0x4'));var logger=require(_0x0ce0('0x5'))('rpc');var config=require(_0x0ce0('0x6'));var jayson=require(_0x0ce0('0x7'));var client=jayson[_0x0ce0('0x8')][_0x0ce0('0x9')]({'port':0x232a});config[_0x0ce0('0xa')]=_[_0x0ce0('0xb')](config[_0x0ce0('0xa')],{'host':_0x0ce0('0xc'),'port':0x18eb});var socket=require(_0x0ce0('0xd'))(new Redis(config[_0x0ce0('0xa')]));require(_0x0ce0('0xe'))['register'](socket);function respondWithRpcPromise(_0xdf65d2,_0x56d286,_0x2f0d32){return new BPromise(function(_0x3f80d1,_0x524a90){return client[_0x0ce0('0xf')](_0xdf65d2,_0x2f0d32)[_0x0ce0('0x10')](function(_0x4ae744){logger[_0x0ce0('0x11')](_0x0ce0('0x12'),_0x56d286,_0x0ce0('0x13'));logger[_0x0ce0('0x14')](_0x0ce0('0x15'),_0x56d286,_0x0ce0('0x13'),JSON[_0x0ce0('0x16')](_0x4ae744));if(_0x4ae744[_0x0ce0('0x17')]){if(_0x4ae744[_0x0ce0('0x17')]['code']===0x1f4){logger[_0x0ce0('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x56d286,_0x4ae744[_0x0ce0('0x17')][_0x0ce0('0x18')]);return _0x524a90(_0x4ae744[_0x0ce0('0x17')][_0x0ce0('0x18')]);}logger[_0x0ce0('0x17')](_0x0ce0('0x12'),_0x56d286,_0x4ae744['error'][_0x0ce0('0x18')]);return _0x3f80d1(_0x4ae744['error'][_0x0ce0('0x18')]);}else{logger[_0x0ce0('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x56d286,'request\x20sent');_0x3f80d1(_0x4ae744[_0x0ce0('0x19')][_0x0ce0('0x18')]);}})['catch'](function(_0x1543cd){logger[_0x0ce0('0x17')](_0x0ce0('0x12'),_0x56d286,_0x1543cd);_0x524a90(_0x1543cd);});});} \ No newline at end of file +var _0x10ba=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x10ba,0x12b));var _0xa10b=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x10ba[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0xa10b('0x0'));var util=require('util');var moment=require(_0xa10b('0x1'));var BPromise=require(_0xa10b('0x2'));var rs=require(_0xa10b('0x3'));var fs=require('fs');var Redis=require(_0xa10b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa10b('0x5'))(_0xa10b('0x6'));var config=require('../../config/environment');var jayson=require(_0xa10b('0x7'));var client=jayson[_0xa10b('0x8')]['http']({'port':0x232a});config[_0xa10b('0x9')]=_[_0xa10b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa10b('0xb'))(new Redis(config[_0xa10b('0x9')]));require(_0xa10b('0xc'))[_0xa10b('0xd')](socket);function respondWithRpcPromise(_0x1951ca,_0x22288f,_0x122e40){return new BPromise(function(_0x91176,_0x1ec3f0){return client[_0xa10b('0xe')](_0x1951ca,_0x122e40)['then'](function(_0x563ac4){logger[_0xa10b('0xf')](_0xa10b('0x10'),_0x22288f,'request\x20sent');logger[_0xa10b('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x22288f,_0xa10b('0x12'),JSON[_0xa10b('0x13')](_0x563ac4));if(_0x563ac4[_0xa10b('0x14')]){if(_0x563ac4[_0xa10b('0x14')][_0xa10b('0x15')]===0x1f4){logger[_0xa10b('0x14')](_0xa10b('0x10'),_0x22288f,_0x563ac4['error'][_0xa10b('0x16')]);return _0x1ec3f0(_0x563ac4[_0xa10b('0x14')][_0xa10b('0x16')]);}logger['error'](_0xa10b('0x10'),_0x22288f,_0x563ac4['error'][_0xa10b('0x16')]);return _0x91176(_0x563ac4[_0xa10b('0x14')][_0xa10b('0x16')]);}else{logger[_0xa10b('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x22288f,_0xa10b('0x12'));_0x91176(_0x563ac4[_0xa10b('0x17')][_0xa10b('0x16')]);}})[_0xa10b('0x18')](function(_0x3656cf){logger['error'](_0xa10b('0x10'),_0x22288f,_0x3656cf);_0x1ec3f0(_0x3656cf);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 50cefd4..57a5cc2 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 _0x74fd=['register','length','chatWebsite:','./chatWebsite.events','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x74fd,0x19b));var _0xd74f=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x74fd[_0x3ab353];return _0x1e2285;};'use strict';var ChatWebsiteEvents=require(_0xd74f('0x0'));var events=['save',_0xd74f('0x1'),'update'];function createListener(_0x1bbb30,_0x8bf58d){return function(_0x3b4347){_0x8bf58d[_0xd74f('0x2')](_0x1bbb30,_0x3b4347);};}function removeListener(_0x38289d,_0x552d24){return function(){ChatWebsiteEvents['removeListener'](_0x38289d,_0x552d24);};}exports[_0xd74f('0x3')]=function(_0x393050){for(var _0x21bf0d=0x0,_0xbf948a=events[_0xd74f('0x4')];_0x21bf0d<_0xbf948a;_0x21bf0d++){var _0x3c26c2=events[_0x21bf0d];var _0x21a100=createListener(_0xd74f('0x5')+_0x3c26c2,_0x393050);ChatWebsiteEvents['on'](_0x3c26c2,_0x21a100);}}; \ No newline at end of file +var _0x19be=['removeListener','register','chatWebsite:','save','remove','emit'];(function(_0x2e7044,_0x5409b8){var _0x26a3c2=function(_0x4cd168){while(--_0x4cd168){_0x2e7044['push'](_0x2e7044['shift']());}};_0x26a3c2(++_0x5409b8);}(_0x19be,0xe1));var _0xe19b=function(_0x33a580,_0x4d85bd){_0x33a580=_0x33a580-0x0;var _0x5c1d62=_0x19be[_0x33a580];return _0x5c1d62;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe19b('0x0'),_0xe19b('0x1'),'update'];function createListener(_0x313107,_0x4e8f3a){return function(_0x1646a2){_0x4e8f3a[_0xe19b('0x2')](_0x313107,_0x1646a2);};}function removeListener(_0xb9028a,_0x5bbe50){return function(){ChatWebsiteEvents[_0xe19b('0x3')](_0xb9028a,_0x5bbe50);};}exports[_0xe19b('0x4')]=function(_0x44c827){for(var _0x235e4c=0x0,_0x233907=events['length'];_0x235e4c<_0x233907;_0x235e4c++){var _0x3d0c0a=events[_0x235e4c];var _0x451a66=createListener(_0xe19b('0x5')+_0x3d0c0a,_0x44c827);ChatWebsiteEvents['on'](_0x3d0c0a,_0x451a66);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index d20e06c..4bd4b0e 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 _0xa134=['destroy','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','root','server/files/images/avatars/','originalname','file','single','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put'];(function(_0x2edd53,_0x4f86ad){var _0x3435b2=function(_0xd267){while(--_0xd267){_0x2edd53['push'](_0x2edd53['shift']());}};_0x3435b2(++_0x4f86ad);}(_0xa134,0xcc));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x4a13('0x0'));var path=require('path');var timeout=require(_0x4a13('0x1'));var express=require(_0x4a13('0x2'));var router=express[_0x4a13('0x3')]();var fs_extra=require(_0x4a13('0x4'));var auth=require(_0x4a13('0x5'));var interaction=require(_0x4a13('0x6'));var config=require(_0x4a13('0x7'));var controller=require('./chatWebsite.controller');router[_0x4a13('0x8')]('/',auth[_0x4a13('0x9')](),controller[_0x4a13('0xa')]);router['get'](_0x4a13('0xb'),auth[_0x4a13('0x9')](),controller[_0x4a13('0xc')]);router[_0x4a13('0x8')](_0x4a13('0xd'),auth[_0x4a13('0x9')](),controller['show']);router[_0x4a13('0x8')](_0x4a13('0xe'),auth[_0x4a13('0x9')](),controller['getDispositions']);router[_0x4a13('0x8')](_0x4a13('0xf'),auth['isAuthenticated'](),controller[_0x4a13('0x10')]);router[_0x4a13('0x8')](_0x4a13('0x11'),controller['getLogo']);router[_0x4a13('0x8')](_0x4a13('0x12'),controller[_0x4a13('0x13')]);router[_0x4a13('0x8')](_0x4a13('0x14'),controller[_0x4a13('0x15')]);router[_0x4a13('0x8')](_0x4a13('0x16'),controller[_0x4a13('0x17')]);router[_0x4a13('0x8')]('/:id/interactions',auth[_0x4a13('0x9')](),controller[_0x4a13('0x18')]);router[_0x4a13('0x8')]('/:id/snippet',controller[_0x4a13('0x19')]);router[_0x4a13('0x8')](_0x4a13('0x1a'),auth[_0x4a13('0x9')](),controller[_0x4a13('0x1b')]);router[_0x4a13('0x8')]('/:id/proactive_actions',auth[_0x4a13('0x9')](),controller['getProactiveActions']);router[_0x4a13('0x8')]('/:id/fields',controller[_0x4a13('0x1c')]);router[_0x4a13('0x8')]('/:id/offline_messages',auth[_0x4a13('0x9')](),controller[_0x4a13('0x1d')]);router[_0x4a13('0x8')](_0x4a13('0x1e'),auth[_0x4a13('0x9')](),controller[_0x4a13('0x1f')]);router[_0x4a13('0x20')]('/',auth[_0x4a13('0x9')](),controller[_0x4a13('0x21')]);router['post']('/:id/dispositions',auth[_0x4a13('0x9')](),controller[_0x4a13('0x22')]);router[_0x4a13('0x20')](_0x4a13('0xf'),auth['isAuthenticated'](),controller[_0x4a13('0x23')]);var upload=multer({'storage':multer[_0x4a13('0x24')]({'destination':function(_0x224945,_0x2510df,_0x4353e1){_0x4353e1(null,path[_0x4a13('0x25')](config['root'],_0x4a13('0x26')));},'filename':function(_0x35ebec,_0x43c81e,_0x350c22){_0x350c22(null,util[_0x4a13('0x27')](_0x4a13('0x28'),Date[_0x4a13('0x29')](),_0x43c81e['originalname']));}})});router[_0x4a13('0x20')]('/:id/logo',upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x4a13('0x24')]({'destination':function(_0x2b693c,_0x143de6,_0x535545){_0x535545(null,path['join'](config[_0x4a13('0x2a')],_0x4a13('0x2b')));},'filename':function(_0x15df40,_0x184b54,_0x8a4e78){_0x8a4e78(null,util['format']('%s-%s',Date[_0x4a13('0x29')](),_0x184b54[_0x4a13('0x2c')]));}})});router[_0x4a13('0x20')]('/:id/avatar',upload['single'](_0x4a13('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f0996,_0xda57e0,_0x264e81){_0x264e81(null,path['join'](config['root'],_0x4a13('0x2b')));},'filename':function(_0x26690c,_0x598eb2,_0x2dd240){_0x2dd240(null,util[_0x4a13('0x27')](_0x4a13('0x28'),Date[_0x4a13('0x29')](),_0x598eb2['originalname']));}})});router[_0x4a13('0x20')](_0x4a13('0x14'),upload[_0x4a13('0x2e')](_0x4a13('0x2d')),controller[_0x4a13('0x2f')]);var upload=multer({'storage':multer[_0x4a13('0x24')]({'destination':function(_0x48f4ec,_0x9e7b3a,_0x4e3f76){_0x4e3f76(null,path['join'](config[_0x4a13('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x331a8a,_0x1e526f,_0x405b16){_0x405b16(null,util[_0x4a13('0x27')](_0x4a13('0x28'),Date[_0x4a13('0x29')](),_0x1e526f[_0x4a13('0x2c')]));}})});router[_0x4a13('0x20')](_0x4a13('0x16'),upload[_0x4a13('0x2e')](_0x4a13('0x2d')),controller[_0x4a13('0x30')]);router[_0x4a13('0x20')]('/:id/notify',controller[_0x4a13('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3e0b6d,_0x2b6355,_0x21b658){const _0x5ddd25=path['join'](config['root'],_0x4a13('0x32'),_0x4a13('0x33'),_0x4a13('0x34'));fs_extra[_0x4a13('0x35')](_0x5ddd25,function(){_0x21b658(null,_0x5ddd25);});},'filename':function(_0x454639,_0x3064a3,_0x4b8b5d){const _0x416ce4=_0x3064a3[_0x4a13('0x2c')][_0x4a13('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x111fbb=path[_0x4a13('0x37')](_0x416ce4);const _0xf6132c=Date[_0x4a13('0x29')]()+'-'+_0x416ce4['replace'](_0x111fbb,'')+_0x111fbb;_0x4b8b5d(null,_0xf6132c);}})});router[_0x4a13('0x20')]('/:id/offline',offlineUploadMulter[_0x4a13('0x38')](),controller[_0x4a13('0x39')]);router[_0x4a13('0x20')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x4a13('0x3a')]);router['post']('/:id/applications',auth[_0x4a13('0x9')](),controller[_0x4a13('0x3b')]);router[_0x4a13('0x20')](_0x4a13('0x3c'),auth['isAuthenticated'](),controller[_0x4a13('0x3d')]);router[_0x4a13('0x20')]('/:id/users',auth[_0x4a13('0x9')](),controller[_0x4a13('0x3e')]);router[_0x4a13('0x3f')](_0x4a13('0xd'),auth[_0x4a13('0x9')](),controller['update']);router['delete'](_0x4a13('0xd'),auth[_0x4a13('0x9')](),controller[_0x4a13('0x40')]);router[_0x4a13('0x41')]('/:id/dispositions',auth[_0x4a13('0x9')](),controller['removeDispositions']);router[_0x4a13('0x41')]('/:id/canned_answers',auth[_0x4a13('0x9')](),controller['removeAnswers']);router[_0x4a13('0x41')](_0x4a13('0x1e'),auth[_0x4a13('0x9')](),controller['removeAgents']);module[_0x4a13('0x42')]=router; \ No newline at end of file +var _0x2363=['addApplications','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','single','join','file','addAvatar','server/files/images/avatars/','originalname','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','any','offline','addInteraction'];(function(_0x29c75c,_0x4057af){var _0x35a4a8=function(_0x38c056){while(--_0x38c056){_0x29c75c['push'](_0x29c75c['shift']());}};_0x35a4a8(++_0x4057af);}(_0x2363,0x126));var _0x3236=function(_0x44b1a6,_0x4c3d75){_0x44b1a6=_0x44b1a6-0x0;var _0x69e2ed=_0x2363[_0x44b1a6];return _0x69e2ed;};'use strict';var multer=require(_0x3236('0x0'));var util=require(_0x3236('0x1'));var path=require(_0x3236('0x2'));var timeout=require(_0x3236('0x3'));var express=require('express');var router=express[_0x3236('0x4')]();var fs_extra=require(_0x3236('0x5'));var auth=require(_0x3236('0x6'));var interaction=require(_0x3236('0x7'));var config=require(_0x3236('0x8'));var controller=require(_0x3236('0x9'));router[_0x3236('0xa')]('/',auth[_0x3236('0xb')](),controller[_0x3236('0xc')]);router[_0x3236('0xa')](_0x3236('0xd'),auth[_0x3236('0xb')](),controller[_0x3236('0xe')]);router[_0x3236('0xa')](_0x3236('0xf'),auth[_0x3236('0xb')](),controller['show']);router[_0x3236('0xa')](_0x3236('0x10'),auth[_0x3236('0xb')](),controller['getDispositions']);router[_0x3236('0xa')](_0x3236('0x11'),auth[_0x3236('0xb')](),controller[_0x3236('0x12')]);router[_0x3236('0xa')](_0x3236('0x13'),controller[_0x3236('0x14')]);router[_0x3236('0xa')](_0x3236('0x15'),controller['getAvatar']);router[_0x3236('0xa')](_0x3236('0x16'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router['get'](_0x3236('0x17'),auth[_0x3236('0xb')](),controller[_0x3236('0x18')]);router['get']('/:id/snippet',controller[_0x3236('0x19')]);router[_0x3236('0xa')](_0x3236('0x1a'),auth[_0x3236('0xb')](),controller[_0x3236('0x1b')]);router[_0x3236('0xa')]('/:id/proactive_actions',auth[_0x3236('0xb')](),controller[_0x3236('0x1c')]);router[_0x3236('0xa')](_0x3236('0x1d'),controller[_0x3236('0x1e')]);router[_0x3236('0xa')](_0x3236('0x1f'),auth[_0x3236('0xb')](),controller[_0x3236('0x20')]);router[_0x3236('0xa')](_0x3236('0x21'),auth[_0x3236('0xb')](),controller[_0x3236('0x22')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3236('0x23')]);router[_0x3236('0x24')](_0x3236('0x10'),auth[_0x3236('0xb')](),controller[_0x3236('0x25')]);router[_0x3236('0x24')](_0x3236('0x11'),auth[_0x3236('0xb')](),controller[_0x3236('0x26')]);var upload=multer({'storage':multer[_0x3236('0x27')]({'destination':function(_0x2508ec,_0x294e72,_0x12b20d){_0x12b20d(null,path['join'](config[_0x3236('0x28')],'server/files/images/logos/'));},'filename':function(_0x2174cd,_0x1c0cd8,_0x32ed4c){_0x32ed4c(null,util[_0x3236('0x29')](_0x3236('0x2a'),Date[_0x3236('0x2b')](),_0x1c0cd8['originalname']));}})});router[_0x3236('0x24')](_0x3236('0x13'),upload[_0x3236('0x2c')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x3236('0x27')]({'destination':function(_0x3db01d,_0x18bd20,_0x3d6ab7){_0x3d6ab7(null,path[_0x3236('0x2d')](config[_0x3236('0x28')],'server/files/images/avatars/'));},'filename':function(_0x380e83,_0x373e9f,_0x2576df){_0x2576df(null,util[_0x3236('0x29')](_0x3236('0x2a'),Date[_0x3236('0x2b')](),_0x373e9f['originalname']));}})});router['post'](_0x3236('0x15'),upload['single'](_0x3236('0x2e')),controller[_0x3236('0x2f')]);var upload=multer({'storage':multer[_0x3236('0x27')]({'destination':function(_0x3a88d5,_0x4f9a70,_0x44fa3e){_0x44fa3e(null,path[_0x3236('0x2d')](config[_0x3236('0x28')],_0x3236('0x30')));},'filename':function(_0xbd1b82,_0x51c6be,_0xb1b6b6){_0xb1b6b6(null,util[_0x3236('0x29')](_0x3236('0x2a'),Date[_0x3236('0x2b')](),_0x51c6be[_0x3236('0x31')]));}})});router['post'](_0x3236('0x16'),upload[_0x3236('0x2c')](_0x3236('0x2e')),controller[_0x3236('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x445a2d,_0x3f250c,_0x328828){_0x328828(null,path['join'](config['root'],_0x3236('0x30')));},'filename':function(_0x4dd1ea,_0x2ffc33,_0x4a7d33){_0x4a7d33(null,util[_0x3236('0x29')]('%s-%s',Date[_0x3236('0x2b')](),_0x2ffc33[_0x3236('0x31')]));}})});router[_0x3236('0x24')]('/:id/system_avatar',upload[_0x3236('0x2c')](_0x3236('0x2e')),controller[_0x3236('0x33')]);router[_0x3236('0x24')]('/:id/notify',controller[_0x3236('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x3236('0x27')]({'destination':function(_0x43ebdb,_0xbe3ad6,_0x227387){const _0x3ab1a5=path['join'](config['root'],_0x3236('0x35'),_0x3236('0x36'),'offline-chat');fs_extra[_0x3236('0x37')](_0x3ab1a5,function(){_0x227387(null,_0x3ab1a5);});},'filename':function(_0x200220,_0x1f05a2,_0x35ac6a){const _0x492139=_0x1f05a2['originalname'][_0x3236('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x464d35=path[_0x3236('0x39')](_0x492139);const _0x35612b=Date['now']()+'-'+_0x492139[_0x3236('0x38')](_0x464d35,'')+_0x464d35;_0x35ac6a(null,_0x35612b);}})});router[_0x3236('0x24')]('/:id/offline',offlineUploadMulter[_0x3236('0x3a')](),controller[_0x3236('0x3b')]);router[_0x3236('0x24')](_0x3236('0x17'),auth[_0x3236('0xb')](),controller[_0x3236('0x3c')]);router['post'](_0x3236('0x1a'),auth[_0x3236('0xb')](),controller[_0x3236('0x3d')]);router[_0x3236('0x24')](_0x3236('0x3e'),auth['isAuthenticated'](),controller[_0x3236('0x3f')]);router[_0x3236('0x24')]('/:id/users',auth[_0x3236('0xb')](),controller[_0x3236('0x40')]);router['put'](_0x3236('0xf'),auth[_0x3236('0xb')](),controller[_0x3236('0x41')]);router[_0x3236('0x42')](_0x3236('0xf'),auth['isAuthenticated'](),controller[_0x3236('0x43')]);router[_0x3236('0x42')](_0x3236('0x10'),auth['isAuthenticated'](),controller[_0x3236('0x44')]);router[_0x3236('0x42')]('/:id/canned_answers',auth[_0x3236('0xb')](),controller[_0x3236('0x45')]);router[_0x3236('0x42')](_0x3236('0x21'),auth[_0x3236('0xb')](),controller['removeAgents']);module[_0x3236('0x46')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index a00b2c3..243223d 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 _0x1561=['Google','STRING','ENUM','AmazonAWS'];(function(_0x6d8c3,_0x174023){var _0x30385e=function(_0x38dbe3){while(--_0x38dbe3){_0x6d8c3['push'](_0x6d8c3['shift']());}};_0x30385e(++_0x174023);}(_0x1561,0x1bd));var _0x1156=function(_0x4e2537,_0x3a15ee){_0x4e2537=_0x4e2537-0x0;var _0x57e71f=_0x1561[_0x4e2537];return _0x57e71f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1156('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1156('0x1')](_0x1156('0x2'),_0x1156('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x1156('0x0')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x292c=['AmazonAWS','Google','sequelize','STRING','ENUM'];(function(_0xf11b94,_0x168b04){var _0x5815ca=function(_0x1aa241){while(--_0x1aa241){_0xf11b94['push'](_0xf11b94['shift']());}};_0x5815ca(++_0x168b04);}(_0x292c,0x66));var _0xc292=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x292c[_0x55ef8b];return _0x359c84;};'use strict';var Sequelize=require(_0xc292('0x0'));module['exports']={'name':{'type':Sequelize[_0xc292('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc292('0x2')](_0xc292('0x3'),_0xc292('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xc292('0x1')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a5c986a..c8ee547 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(_0x2ff936,_0x4b413d){var _0x516f7b=function(_0x37f0c9){while(--_0x37f0c9){_0x2ff936['push'](_0x2ff936['shift']());}};_0x516f7b(++_0x4b413d);}(_0x7a54,0x106));var _0x47a5=function(_0x5def06,_0x2aa570){_0x5def06=_0x5def06-0x0;var _0x332e7c=_0x7a54[_0x5def06];return _0x332e7c;};'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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','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','CloudProvider','fieldName','type','key'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xadb5,0xad));var _0x5adb=function(_0x1ce956,_0x3b9629){_0x1ce956=_0x1ce956-0x0;var _0x2305b0=_0xadb5[_0x1ce956];return _0x2305b0;};'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['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a9657f3..b59672a 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 _0xe83c=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','moment','path','rimraf'];(function(_0x5f487f,_0x5961c6){var _0x3207b2=function(_0x1874bf){while(--_0x1874bf){_0x5f487f['push'](_0x5f487f['shift']());}};_0x3207b2(++_0x5961c6);}(_0xe83c,0xf6));var _0xce83=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0xe83c[_0x379799];return _0x46e431;};'use strict';var _=require('lodash');var util=require(_0xce83('0x0'));var logger=require(_0xce83('0x1'))(_0xce83('0x2'));var moment=require(_0xce83('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xce83('0x4'));var rimraf=require(_0xce83('0x5'));var config=require(_0xce83('0x6'));var attributes=require(_0xce83('0x7'));module[_0xce83('0x8')]=function(_0x3cadca,_0x541393){return _0x3cadca[_0xce83('0x9')](_0xce83('0xa'),attributes,{'tableName':_0xce83('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0098=['cloud_providers','lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','CloudProvider'];(function(_0x4fa291,_0x76fbb6){var _0x20b059=function(_0xed0748){while(--_0xed0748){_0x4fa291['push'](_0x4fa291['shift']());}};_0x20b059(++_0x76fbb6);}(_0x0098,0x8d));var _0x8009=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0098[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x8009('0x0'));var util=require('util');var logger=require(_0x8009('0x1'))(_0x8009('0x2'));var moment=require('moment');var BPromise=require(_0x8009('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8009('0x4'));var rimraf=require(_0x8009('0x5'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x8009('0x6')]=function(_0x52912a,_0x1d0186){return _0x52912a[_0x8009('0x7')](_0x8009('0x8'),attributes,{'tableName':_0x8009('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 bbfd177..e38a2fb 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 _0xb7e2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e2,0x103));var _0x2b7e=function(_0x5973a0,_0x3a7770){_0x5973a0=_0x5973a0-0x0;var _0x26bfc2=_0xb7e2[_0x5973a0];return _0x26bfc2;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});} \ No newline at end of file +var _0xf29d=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','debug'];(function(_0x3ee99e,_0x4affec){var _0x1b56e1=function(_0x3857a2){while(--_0x3857a2){_0x3ee99e['push'](_0x3ee99e['shift']());}};_0x1b56e1(++_0x4affec);}(_0xf29d,0xc4));var _0xdf29=function(_0x17b705,_0x12b687){_0x17b705=_0x17b705-0x0;var _0x4e36f4=_0xf29d[_0x17b705];return _0x4e36f4;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var moment=require('moment');var BPromise=require(_0xdf29('0x2'));var rs=require(_0xdf29('0x3'));var fs=require('fs');var Redis=require(_0xdf29('0x4'));var db=require(_0xdf29('0x5'))['db'];var utils=require(_0xdf29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf29('0x7'));var client=jayson[_0xdf29('0x8')][_0xdf29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b648e,_0x39b352,_0x1927a3){return new BPromise(function(_0x289aad,_0x54d108){return client[_0xdf29('0xa')](_0x4b648e,_0x1927a3)[_0xdf29('0xb')](function(_0x1fb3f1){logger[_0xdf29('0xc')]('CloudProvider,\x20%s,\x20%s',_0x39b352,'request\x20sent');logger[_0xdf29('0xd')](_0xdf29('0xe'),_0x39b352,'request\x20sent',JSON[_0xdf29('0xf')](_0x1fb3f1));if(_0x1fb3f1[_0xdf29('0x10')]){if(_0x1fb3f1[_0xdf29('0x10')][_0xdf29('0x11')]===0x1f4){logger[_0xdf29('0x10')]('CloudProvider,\x20%s,\x20%s',_0x39b352,_0x1fb3f1[_0xdf29('0x10')]['message']);return _0x54d108(_0x1fb3f1[_0xdf29('0x10')][_0xdf29('0x12')]);}logger[_0xdf29('0x10')]('CloudProvider,\x20%s,\x20%s',_0x39b352,_0x1fb3f1[_0xdf29('0x10')][_0xdf29('0x12')]);return _0x289aad(_0x1fb3f1['error'][_0xdf29('0x12')]);}else{logger[_0xdf29('0xc')](_0xdf29('0x13'),_0x39b352,'request\x20sent');_0x289aad(_0x1fb3f1[_0xdf29('0x14')]['message']);}})['catch'](function(_0x1c993b){logger[_0xdf29('0x10')]('CloudProvider,\x20%s,\x20%s',_0x39b352,_0x1c993b);_0x54d108(_0x1c993b);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 6a59cd6..a998b9b 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 _0xc6aa=['post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x56af7f,_0x22eb19){var _0x44ec9a=function(_0x4f9a86){while(--_0x4f9a86){_0x56af7f['push'](_0x56af7f['shift']());}};_0x44ec9a(++_0x22eb19);}(_0xc6aa,0x1f4));var _0xac6a=function(_0x23af61,_0x3336f1){_0x23af61=_0x23af61-0x0;var _0x5dd575=_0xc6aa[_0x23af61];return _0x5dd575;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xac6a('0x0'));var timeout=require(_0xac6a('0x1'));var express=require(_0xac6a('0x2'));var router=express[_0xac6a('0x3')]();var fs_extra=require(_0xac6a('0x4'));var auth=require(_0xac6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac6a('0x6'));var controller=require('./cloudProvider.controller');router[_0xac6a('0x7')]('/',auth[_0xac6a('0x8')](),controller['index']);router['get'](_0xac6a('0x9'),auth[_0xac6a('0x8')](),controller['show']);router[_0xac6a('0xa')]('/',auth[_0xac6a('0x8')](),controller[_0xac6a('0xb')]);router[_0xac6a('0xc')](_0xac6a('0x9'),auth[_0xac6a('0x8')](),controller['update']);router['delete']('/:id',auth[_0xac6a('0x8')](),controller[_0xac6a('0xd')]);module[_0xac6a('0xe')]=router; \ No newline at end of file +var _0x02fe=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports'];(function(_0x105e05,_0x3d5ea6){var _0x3fd2ba=function(_0x5ab71a){while(--_0x5ab71a){_0x105e05['push'](_0x105e05['shift']());}};_0x3fd2ba(++_0x3d5ea6);}(_0x02fe,0x1b8));var _0xe02f=function(_0x581bbd,_0x453184){_0x581bbd=_0x581bbd-0x0;var _0x460f18=_0x02fe[_0x581bbd];return _0x460f18;};'use strict';var multer=require('multer');var util=require(_0xe02f('0x0'));var path=require(_0xe02f('0x1'));var timeout=require(_0xe02f('0x2'));var express=require(_0xe02f('0x3'));var router=express[_0xe02f('0x4')]();var fs_extra=require(_0xe02f('0x5'));var auth=require(_0xe02f('0x6'));var interaction=require(_0xe02f('0x7'));var config=require(_0xe02f('0x8'));var controller=require(_0xe02f('0x9'));router[_0xe02f('0xa')]('/',auth[_0xe02f('0xb')](),controller[_0xe02f('0xc')]);router[_0xe02f('0xa')](_0xe02f('0xd'),auth[_0xe02f('0xb')](),controller['show']);router[_0xe02f('0xe')]('/',auth['isAuthenticated'](),controller[_0xe02f('0xf')]);router[_0xe02f('0x10')](_0xe02f('0xd'),auth[_0xe02f('0xb')](),controller['update']);router[_0xe02f('0x11')](_0xe02f('0xd'),auth[_0xe02f('0xb')](),controller[_0xe02f('0x12')]);module[_0xe02f('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 3d1fdd4..43b1bb7 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 _0x9055=['STRING','sequelize'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0x9055,0x1eb));var _0x5905=function(_0x7acd9c,_0x4ebb68){_0x7acd9c=_0x7acd9c-0x0;var _0x4af9d8=_0x9055[_0x7acd9c];return _0x4af9d8;};'use strict';var Sequelize=require(_0x5905('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5905('0x1')]},'website':{'type':Sequelize[_0x5905('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5905('0x1')]},'type':{'type':Sequelize[_0x5905('0x1')]},'street':{'type':Sequelize[_0x5905('0x1')]},'postalCode':{'type':Sequelize[_0x5905('0x1')]},'city':{'type':Sequelize[_0x5905('0x1')]},'country':{'type':Sequelize[_0x5905('0x1')]},'email':{'type':Sequelize[_0x5905('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5905('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x5905('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5905('0x1')]}}; \ No newline at end of file +var _0x400c=['STRING','sequelize','exports','name'];(function(_0x38f2ed,_0x4408c8){var _0x7434e8=function(_0x346c0c){while(--_0x346c0c){_0x38f2ed['push'](_0x38f2ed['shift']());}};_0x7434e8(++_0x4408c8);}(_0x400c,0x81));var _0xc400=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x400c[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xc400('0x0'));module[_0xc400('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc400('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc400('0x3')]},'companyId':{'type':Sequelize[_0xc400('0x3')]},'website':{'type':Sequelize[_0xc400('0x3')]},'phone':{'type':Sequelize[_0xc400('0x3')]},'fax':{'type':Sequelize[_0xc400('0x3')]},'type':{'type':Sequelize[_0xc400('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc400('0x3')]},'city':{'type':Sequelize[_0xc400('0x3')]},'country':{'type':Sequelize[_0xc400('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc400('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc400('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xc400('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 7ac5993..08d53fb 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 _0x895f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','options','includeAll','include','rows','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','order','pick','filter','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x37b7a2,_0x3d36e4){var _0x237868=function(_0x110b33){while(--_0x110b33){_0x37b7a2['push'](_0x37b7a2['shift']());}};_0x237868(++_0x3d36e4);}(_0x895f,0x189));var _0xf895=function(_0x47a4bf,_0x23cfd2){_0x47a4bf=_0x47a4bf-0x0;var _0xa79015=_0x895f[_0x47a4bf];return _0xa79015;};'use strict';var emlformat=require(_0xf895('0x0'));var rimraf=require(_0xf895('0x1'));var zipdir=require(_0xf895('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf895('0x3'));var BPromise=require(_0xf895('0x4'));var Mustache=require(_0xf895('0x5'));var util=require(_0xf895('0x6'));var path=require(_0xf895('0x7'));var sox=require(_0xf895('0x8'));var csv=require(_0xf895('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf895('0xa'));var _=require(_0xf895('0xb'));var squel=require(_0xf895('0xc'));var crypto=require(_0xf895('0xd'));var jsforce=require(_0xf895('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf895('0x9'));var querystring=require(_0xf895('0xf'));var Papa=require(_0xf895('0x10'));var Redis=require('ioredis');var authService=require(_0xf895('0x11'));var qs=require(_0xf895('0x12'));var as=require(_0xf895('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf895('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf624c2,_0x1ab27a){_0x1ab27a=_0x1ab27a||0xcc;return function(_0x1a434a){if(_0x1a434a){return _0xf624c2[_0xf895('0x15')](_0x1ab27a);}return _0xf624c2['status'](_0x1ab27a)[_0xf895('0x16')]();};}function respondWithResult(_0x283f17,_0x53751d){_0x53751d=_0x53751d||0xc8;return function(_0x1e8c78){if(_0x1e8c78){return _0x283f17[_0xf895('0x17')](_0x53751d)[_0xf895('0x18')](_0x1e8c78);}};}function respondWithFilteredResult(_0x200586,_0x5e5239){return function(_0x519a3c){if(_0x519a3c){var _0x235aba=typeof _0x5e5239[_0xf895('0x19')]===_0xf895('0x1a')&&typeof _0x5e5239[_0xf895('0x1b')]==='undefined';var _0x51d347=_0x519a3c[_0xf895('0x1c')];var _0x4f6cfa=_0x235aba?0x0:_0x5e5239[_0xf895('0x19')];var _0x1aa51f=_0x235aba?_0x519a3c[_0xf895('0x1c')]:_0x5e5239[_0xf895('0x19')]+_0x5e5239[_0xf895('0x1b')];var _0x528258;if(_0x1aa51f>=_0x51d347){_0x1aa51f=_0x51d347;_0x528258=0xc8;}else{_0x528258=0xce;}_0x200586[_0xf895('0x17')](_0x528258);return _0x200586[_0xf895('0x1d')](_0xf895('0x1e'),_0x4f6cfa+'-'+_0x1aa51f+'/'+_0x51d347)[_0xf895('0x18')](_0x519a3c);}return null;};}function patchUpdates(_0x3cba84){return function(_0x37f962){try{jsonpatch[_0xf895('0x1f')](_0x37f962,_0x3cba84,!![]);}catch(_0x2e5e3d){return BPromise['reject'](_0x2e5e3d);}return _0x37f962['save']();};}function saveUpdates(_0x4ae480,_0x518849){return function(_0x1edeec){if(_0x1edeec){return _0x1edeec[_0xf895('0x20')](_0x4ae480)['then'](function(_0x1922bd){return _0x1922bd;});}return null;};}function removeEntity(_0x1f86da,_0x75d904){return function(_0x3bbd1d){if(_0x3bbd1d){return _0x3bbd1d[_0xf895('0x21')]()[_0xf895('0x22')](function(){var _0x181fa7=_0x3bbd1d[_0xf895('0x23')]({'plain':!![]});var _0x263a01=_0xf895('0x24');return db[_0xf895('0x25')][_0xf895('0x21')]({'where':{'type':_0x263a01,'resourceId':_0x181fa7['id']}})['then'](function(){return _0x3bbd1d;});})[_0xf895('0x22')](function(){_0x1f86da[_0xf895('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d9458,_0x33f726){return function(_0x2d04f6){if(!_0x2d04f6){_0x4d9458[_0xf895('0x15')](0x194);}return _0x2d04f6;};}function handleError(_0x431b83,_0x1ba303){_0x1ba303=_0x1ba303||0x1f4;return function(_0x5d29c5){logger['error'](_0x5d29c5[_0xf895('0x26')]);if(_0x5d29c5[_0xf895('0x27')]){delete _0x5d29c5[_0xf895('0x27')];}_0x431b83[_0xf895('0x17')](_0x1ba303)[_0xf895('0x28')](_0x5d29c5);};}exports[_0xf895('0x29')]=function(_0x356295,_0x5983a4){var _0x3ed2af={},_0xc098b0={},_0x206f37={'count':0x0,'rows':[]};return db[_0xf895('0x2a')][_0xf895('0x2b')]()[_0xf895('0x22')](function(_0x14186f){_0xc098b0['model']=_[_0xf895('0x2c')](_0x14186f);_0xc098b0[_0xf895('0x2d')]=_[_0xf895('0x2c')](_0x356295[_0xf895('0x2d')]);_0xc098b0[_0xf895('0x2e')]=_[_0xf895('0x2f')](_0xc098b0[_0xf895('0x30')],_0xc098b0[_0xf895('0x2d')]);_0x3ed2af[_0xf895('0x31')]=_[_0xf895('0x2f')](_0xc098b0[_0xf895('0x30')],qs[_0xf895('0x32')](_0x356295[_0xf895('0x2d')]['fields']));_0x3ed2af[_0xf895('0x31')]=_0x3ed2af[_0xf895('0x31')][_0xf895('0x33')]?_0x3ed2af['attributes']:_0xc098b0[_0xf895('0x30')];if(!_0x356295[_0xf895('0x2d')][_0xf895('0x34')](_0xf895('0x35'))){_0x3ed2af[_0xf895('0x1b')]=qs[_0xf895('0x1b')](_0x356295[_0xf895('0x2d')][_0xf895('0x1b')]);_0x3ed2af['offset']=qs[_0xf895('0x19')](_0x356295[_0xf895('0x2d')]['offset']);}_0x3ed2af['order']=qs[_0xf895('0x36')](_0x356295[_0xf895('0x2d')][_0xf895('0x36')]);_0x3ed2af[_0xf895('0x37')]=qs[_0xf895('0x2e')](_['pick'](_0x356295[_0xf895('0x2d')],_0xc098b0[_0xf895('0x2e')]),_0x14186f);if(_0x356295['query']['filter']){_0x3ed2af[_0xf895('0x37')]=_[_0xf895('0x38')](_0x3ed2af[_0xf895('0x37')],{'$or':_[_0xf895('0x39')](_0x3ed2af[_0xf895('0x31')],function(_0x1d32b4){var _0x3625e8={};_0x3625e8[_0x1d32b4]={'$like':'%'+_0x356295['query']['filter']+'%'};return _0x3625e8;})});}_0x3ed2af=_[_0xf895('0x38')]({},_0x3ed2af,_0x356295[_0xf895('0x3a')]);var _0x23fbd7={'where':_0x3ed2af['where']};return db[_0xf895('0x2a')]['count'](_0x23fbd7)[_0xf895('0x22')](function(_0x8cd96b){_0x206f37['count']=_0x8cd96b;if(_0x356295[_0xf895('0x2d')][_0xf895('0x3b')]){_0x3ed2af[_0xf895('0x3c')]=[{'all':!![]}];}return db[_0xf895('0x2a')]['findAll'](_0x3ed2af);})[_0xf895('0x22')](function(_0x2efd31){_0x206f37[_0xf895('0x3d')]=_0x2efd31;return _0x206f37;})[_0xf895('0x22')](respondWithFilteredResult(_0x5983a4,_0x3ed2af))['catch'](handleError(_0x5983a4,null));})['catch'](handleError(_0x5983a4,null));};exports['show']=function(_0x5a5017,_0x5044c9){var _0x2ca508={'raw':![],'where':{'id':_0x5a5017[_0xf895('0x3e')]['id']}},_0x423060={};_0x423060[_0xf895('0x30')]=_[_0xf895('0x2c')](db[_0xf895('0x2a')][_0xf895('0x3f')]);_0x423060[_0xf895('0x2d')]=_[_0xf895('0x2c')](_0x5a5017['query']);_0x423060[_0xf895('0x2e')]=_['intersection'](_0x423060['model'],_0x423060[_0xf895('0x2d')]);_0x2ca508[_0xf895('0x31')]=_['intersection'](_0x423060[_0xf895('0x30')],qs[_0xf895('0x32')](_0x5a5017['query'][_0xf895('0x32')]));_0x2ca508[_0xf895('0x31')]=_0x2ca508[_0xf895('0x31')]['length']?_0x2ca508[_0xf895('0x31')]:_0x423060[_0xf895('0x30')];if(_0x5a5017['query'][_0xf895('0x3b')]){_0x2ca508['include']=[{'all':!![]}];}_0x2ca508=_[_0xf895('0x38')]({},_0x2ca508,_0x5a5017[_0xf895('0x3a')]);return db[_0xf895('0x2a')]['find'](_0x2ca508)[_0xf895('0x22')](handleEntityNotFound(_0x5044c9,null))['then'](respondWithResult(_0x5044c9,null))[_0xf895('0x40')](handleError(_0x5044c9,null));};exports[_0xf895('0x41')]=function(_0x5dbd41,_0x2bd58e){return db[_0xf895('0x2a')]['create'](_0x5dbd41[_0xf895('0x42')],{})[_0xf895('0x22')](function(_0x5efa1f){var _0x3b254c=_0x5dbd41[_0xf895('0x43')][_0xf895('0x23')]({'plain':!![]});if(!_0x3b254c)throw new Error(_0xf895('0x44'));if(_0x3b254c['role']===_0xf895('0x43')){var _0x124b82=_0x5efa1f['get']({'plain':!![]});var _0x3b035a='Companies';return db[_0xf895('0x45')][_0xf895('0x46')]({'where':{'name':_0x3b035a,'userProfileId':_0x3b254c['userProfileId']},'raw':!![]})[_0xf895('0x22')](function(_0x2b7ad7){if(_0x2b7ad7&&_0x2b7ad7[_0xf895('0x47')]===0x0){return db[_0xf895('0x25')][_0xf895('0x41')]({'name':_0x124b82[_0xf895('0x27')],'resourceId':_0x124b82['id'],'type':_0x2b7ad7[_0xf895('0x27')],'sectionId':_0x2b7ad7['id']},{})[_0xf895('0x22')](function(){return _0x5efa1f;});}else{return _0x5efa1f;}})[_0xf895('0x40')](function(_0x46af2d){logger[_0xf895('0x48')](_0xf895('0x49'),_0x46af2d);throw _0x46af2d;});}return _0x5efa1f;})[_0xf895('0x22')](respondWithResult(_0x2bd58e,0xc9))[_0xf895('0x40')](handleError(_0x2bd58e,null));};exports[_0xf895('0x20')]=function(_0x1e7e9d,_0x2a777e){if(_0x1e7e9d['body']['id']){delete _0x1e7e9d['body']['id'];}return db['CmCompany'][_0xf895('0x46')]({'where':{'id':_0x1e7e9d[_0xf895('0x3e')]['id']}})[_0xf895('0x22')](handleEntityNotFound(_0x2a777e,null))[_0xf895('0x22')](saveUpdates(_0x1e7e9d['body'],null))[_0xf895('0x22')](respondWithResult(_0x2a777e,null))['catch'](handleError(_0x2a777e,null));};exports[_0xf895('0x21')]=function(_0x1f5a81,_0xbdfc8c){return db[_0xf895('0x2a')][_0xf895('0x46')]({'where':{'id':_0x1f5a81['params']['id']}})['then'](handleEntityNotFound(_0xbdfc8c,null))[_0xf895('0x22')](removeEntity(_0xbdfc8c,null))[_0xf895('0x40')](handleError(_0xbdfc8c,null));};exports[_0xf895('0x2b')]=function(_0x338f7d,_0x1647b0){return db['CmCompany'][_0xf895('0x2b')]()[_0xf895('0x22')](respondWithResult(_0x1647b0,null))['catch'](handleError(_0x1647b0,null));};exports[_0xf895('0x4a')]=function(_0x22bc44,_0x452af8,_0x5648e4){return db[_0xf895('0x4b')][_0xf895('0x46')]({'where':{'id':_0x22bc44[_0xf895('0x3e')]['id']}})[_0xf895('0x22')](handleEntityNotFound(_0x452af8,null))[_0xf895('0x22')](function(_0x3a60bd){if(_0x3a60bd){return _0x3a60bd[_0xf895('0x4a')](_0x22bc44[_0xf895('0x42')][_0xf895('0x4c')],_[_0xf895('0x4d')](_0x22bc44['body'],[_0xf895('0x4c'),'id'])||{});}})[_0xf895('0x22')](respondWithResult(_0x452af8,null))[_0xf895('0x40')](handleError(_0x452af8,null));};exports[_0xf895('0x4e')]=function(_0x495625,_0x505161,_0x2b2fd8){var _0xf3a381={};var _0x1022b9={};var _0x413be3;var _0x1accaf;return db['CmCompany']['findOne']({'where':{'id':_0x495625[_0xf895('0x3e')]['id']}})[_0xf895('0x22')](handleEntityNotFound(_0x505161,null))[_0xf895('0x22')](function(_0x4b95fc){if(_0x4b95fc){_0x413be3=_0x4b95fc;_0x1022b9[_0xf895('0x30')]=_[_0xf895('0x2c')](db[_0xf895('0x4b')][_0xf895('0x3f')]);_0x1022b9['query']=_['keys'](_0x495625[_0xf895('0x2d')]);_0x1022b9[_0xf895('0x2e')]=_[_0xf895('0x2f')](_0x1022b9[_0xf895('0x30')],_0x1022b9[_0xf895('0x2d')]);_0xf3a381['attributes']=_[_0xf895('0x2f')](_0x1022b9[_0xf895('0x30')],qs[_0xf895('0x32')](_0x495625[_0xf895('0x2d')][_0xf895('0x32')]));_0xf3a381['attributes']=_0xf3a381[_0xf895('0x31')][_0xf895('0x33')]?_0xf3a381[_0xf895('0x31')]:_0x1022b9['model'];_0xf3a381[_0xf895('0x4f')]=qs['sort'](_0x495625[_0xf895('0x2d')][_0xf895('0x36')]);_0xf3a381['where']=qs[_0xf895('0x2e')](_[_0xf895('0x50')](_0x495625['query'],_0x1022b9[_0xf895('0x2e')]));if(_0x495625['query'][_0xf895('0x51')]){_0xf3a381[_0xf895('0x37')]=_[_0xf895('0x38')](_0xf3a381['where'],{'$or':_['map'](_0xf3a381[_0xf895('0x31')],function(_0x2a3ab1){var _0x57dd83={};_0x57dd83[_0x2a3ab1]={'$like':'%'+_0x495625[_0xf895('0x2d')]['filter']+'%'};return _0x57dd83;})});}_0xf3a381=_[_0xf895('0x38')]({},_0xf3a381,_0x495625[_0xf895('0x3a')]);return _0x413be3['getContacts'](_0xf3a381);}})[_0xf895('0x22')](function(_0x2d3550){if(_0x2d3550){_0x1accaf=_0x2d3550[_0xf895('0x33')];if(!_0x495625[_0xf895('0x2d')][_0xf895('0x34')]('nolimit')){_0xf3a381[_0xf895('0x1b')]=qs[_0xf895('0x1b')](_0x495625['query'][_0xf895('0x1b')]);_0xf3a381['offset']=qs[_0xf895('0x19')](_0x495625['query'][_0xf895('0x19')]);}return _0x413be3['getContacts'](_0xf3a381);}})['then'](function(_0x188bab){if(_0x188bab){return _0x188bab?{'count':_0x1accaf,'rows':_0x188bab}:null;}})[_0xf895('0x22')](respondWithResult(_0x505161,null))[_0xf895('0x40')](handleError(_0x505161,null));}; \ No newline at end of file +var _0x11a8=['omit','getContacts','findOne','order','filter','hasOwnProperty','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','length','nolimit','sort','where','pick','merge','map','options','include','findAll','rows','catch','params','rawAttributes','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids'];(function(_0x2c768d,_0x5b3efb){var _0x2e0941=function(_0x3caae9){while(--_0x3caae9){_0x2c768d['push'](_0x2c768d['shift']());}};_0x2e0941(++_0x5b3efb);}(_0x11a8,0x1a0));var _0x811a=function(_0x3b69a7,_0x188a29){_0x3b69a7=_0x3b69a7-0x0;var _0x3c7501=_0x11a8[_0x3b69a7];return _0x3c7501;};'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(_0x811a('0x0'));var moment=require('moment');var BPromise=require(_0x811a('0x1'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x811a('0x2'));var csv=require(_0x811a('0x3'));var ejs=require(_0x811a('0x4'));var fs=require('fs');var fs_extra=require(_0x811a('0x5'));var _=require(_0x811a('0x6'));var squel=require('squel');var crypto=require(_0x811a('0x7'));var jsforce=require(_0x811a('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x811a('0x3'));var querystring=require(_0x811a('0x9'));var Papa=require(_0x811a('0xa'));var Redis=require(_0x811a('0xb'));var authService=require(_0x811a('0xc'));var qs=require(_0x811a('0xd'));var as=require(_0x811a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x811a('0xf'))(_0x811a('0x10'));var utils=require('../../config/utils');var config=require(_0x811a('0x11'));var licenseUtil=require(_0x811a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53d571,_0x47092b){_0x47092b=_0x47092b||0xcc;return function(_0x454505){if(_0x454505){return _0x53d571[_0x811a('0x13')](_0x47092b);}return _0x53d571['status'](_0x47092b)['end']();};}function respondWithResult(_0xd8d394,_0x4baf41){_0x4baf41=_0x4baf41||0xc8;return function(_0x5a0dec){if(_0x5a0dec){return _0xd8d394[_0x811a('0x14')](_0x4baf41)[_0x811a('0x15')](_0x5a0dec);}};}function respondWithFilteredResult(_0x477b4d,_0x5e06b7){return function(_0x5e96c4){if(_0x5e96c4){var _0x5fbab5=typeof _0x5e06b7[_0x811a('0x16')]===_0x811a('0x17')&&typeof _0x5e06b7[_0x811a('0x18')]==='undefined';var _0x564166=_0x5e96c4[_0x811a('0x19')];var _0x10e1ca=_0x5fbab5?0x0:_0x5e06b7[_0x811a('0x16')];var _0x573034=_0x5fbab5?_0x5e96c4['count']:_0x5e06b7[_0x811a('0x16')]+_0x5e06b7[_0x811a('0x18')];var _0x24325f;if(_0x573034>=_0x564166){_0x573034=_0x564166;_0x24325f=0xc8;}else{_0x24325f=0xce;}_0x477b4d[_0x811a('0x14')](_0x24325f);return _0x477b4d[_0x811a('0x1a')](_0x811a('0x1b'),_0x10e1ca+'-'+_0x573034+'/'+_0x564166)['json'](_0x5e96c4);}return null;};}function patchUpdates(_0x59ceaf){return function(_0x5787c8){try{jsonpatch[_0x811a('0x1c')](_0x5787c8,_0x59ceaf,!![]);}catch(_0x5f036d){return BPromise['reject'](_0x5f036d);}return _0x5787c8['save']();};}function saveUpdates(_0x10c827,_0xc3c611){return function(_0xf39fa9){if(_0xf39fa9){return _0xf39fa9[_0x811a('0x1d')](_0x10c827)[_0x811a('0x1e')](function(_0x46f400){return _0x46f400;});}return null;};}function removeEntity(_0x45ae21,_0x6423da){return function(_0x1f8535){if(_0x1f8535){return _0x1f8535[_0x811a('0x1f')]()['then'](function(){var _0x1c8dd7=_0x1f8535[_0x811a('0x20')]({'plain':!![]});var _0x25f010='Companies';return db[_0x811a('0x21')][_0x811a('0x1f')]({'where':{'type':_0x25f010,'resourceId':_0x1c8dd7['id']}})[_0x811a('0x1e')](function(){return _0x1f8535;});})['then'](function(){_0x45ae21[_0x811a('0x14')](0xcc)[_0x811a('0x22')]();});}};}function handleEntityNotFound(_0x1fca02,_0x116ca9){return function(_0x3d6ffe){if(!_0x3d6ffe){_0x1fca02[_0x811a('0x13')](0x194);}return _0x3d6ffe;};}function handleError(_0x527e2d,_0x1e22eb){_0x1e22eb=_0x1e22eb||0x1f4;return function(_0x2e5445){logger[_0x811a('0x23')](_0x2e5445[_0x811a('0x24')]);if(_0x2e5445[_0x811a('0x25')]){delete _0x2e5445[_0x811a('0x25')];}_0x527e2d[_0x811a('0x14')](_0x1e22eb)[_0x811a('0x26')](_0x2e5445);};}exports[_0x811a('0x27')]=function(_0x1ec73e,_0x406861){var _0x1a94af={},_0x1bcffa={},_0x5c333b={'count':0x0,'rows':[]};return db[_0x811a('0x28')][_0x811a('0x29')]()[_0x811a('0x1e')](function(_0xd4c656){_0x1bcffa[_0x811a('0x2a')]=_[_0x811a('0x2b')](_0xd4c656);_0x1bcffa[_0x811a('0x2c')]=_['keys'](_0x1ec73e[_0x811a('0x2c')]);_0x1bcffa[_0x811a('0x2d')]=_[_0x811a('0x2e')](_0x1bcffa['model'],_0x1bcffa[_0x811a('0x2c')]);_0x1a94af['attributes']=_[_0x811a('0x2e')](_0x1bcffa[_0x811a('0x2a')],qs['fields'](_0x1ec73e['query']['fields']));_0x1a94af['attributes']=_0x1a94af[_0x811a('0x2f')][_0x811a('0x30')]?_0x1a94af[_0x811a('0x2f')]:_0x1bcffa[_0x811a('0x2a')];if(!_0x1ec73e[_0x811a('0x2c')]['hasOwnProperty'](_0x811a('0x31'))){_0x1a94af['limit']=qs[_0x811a('0x18')](_0x1ec73e[_0x811a('0x2c')][_0x811a('0x18')]);_0x1a94af[_0x811a('0x16')]=qs['offset'](_0x1ec73e['query'][_0x811a('0x16')]);}_0x1a94af['order']=qs[_0x811a('0x32')](_0x1ec73e[_0x811a('0x2c')]['sort']);_0x1a94af[_0x811a('0x33')]=qs['filters'](_[_0x811a('0x34')](_0x1ec73e[_0x811a('0x2c')],_0x1bcffa[_0x811a('0x2d')]),_0xd4c656);if(_0x1ec73e[_0x811a('0x2c')]['filter']){_0x1a94af[_0x811a('0x33')]=_[_0x811a('0x35')](_0x1a94af[_0x811a('0x33')],{'$or':_[_0x811a('0x36')](_0x1a94af['attributes'],function(_0x5bd31b){var _0x484136={};_0x484136[_0x5bd31b]={'$like':'%'+_0x1ec73e['query']['filter']+'%'};return _0x484136;})});}_0x1a94af=_[_0x811a('0x35')]({},_0x1a94af,_0x1ec73e[_0x811a('0x37')]);var _0x531b0c={'where':_0x1a94af[_0x811a('0x33')]};return db['CmCompany'][_0x811a('0x19')](_0x531b0c)[_0x811a('0x1e')](function(_0x287e96){_0x5c333b[_0x811a('0x19')]=_0x287e96;if(_0x1ec73e[_0x811a('0x2c')]['includeAll']){_0x1a94af[_0x811a('0x38')]=[{'all':!![]}];}return db[_0x811a('0x28')][_0x811a('0x39')](_0x1a94af);})[_0x811a('0x1e')](function(_0x47214a){_0x5c333b[_0x811a('0x3a')]=_0x47214a;return _0x5c333b;})['then'](respondWithFilteredResult(_0x406861,_0x1a94af))[_0x811a('0x3b')](handleError(_0x406861,null));})['catch'](handleError(_0x406861,null));};exports['show']=function(_0x10036b,_0x1083c4){var _0x219352={'raw':![],'where':{'id':_0x10036b[_0x811a('0x3c')]['id']}},_0x5dc702={};_0x5dc702[_0x811a('0x2a')]=_['keys'](db[_0x811a('0x28')][_0x811a('0x3d')]);_0x5dc702['query']=_[_0x811a('0x2b')](_0x10036b[_0x811a('0x2c')]);_0x5dc702['filters']=_[_0x811a('0x2e')](_0x5dc702[_0x811a('0x2a')],_0x5dc702[_0x811a('0x2c')]);_0x219352[_0x811a('0x2f')]=_['intersection'](_0x5dc702[_0x811a('0x2a')],qs[_0x811a('0x3e')](_0x10036b[_0x811a('0x2c')][_0x811a('0x3e')]));_0x219352[_0x811a('0x2f')]=_0x219352[_0x811a('0x2f')][_0x811a('0x30')]?_0x219352[_0x811a('0x2f')]:_0x5dc702[_0x811a('0x2a')];if(_0x10036b[_0x811a('0x2c')][_0x811a('0x3f')]){_0x219352[_0x811a('0x38')]=[{'all':!![]}];}_0x219352=_[_0x811a('0x35')]({},_0x219352,_0x10036b['options']);return db[_0x811a('0x28')][_0x811a('0x40')](_0x219352)[_0x811a('0x1e')](handleEntityNotFound(_0x1083c4,null))[_0x811a('0x1e')](respondWithResult(_0x1083c4,null))[_0x811a('0x3b')](handleError(_0x1083c4,null));};exports[_0x811a('0x41')]=function(_0x4a6dfa,_0x114eb7){return db[_0x811a('0x28')][_0x811a('0x41')](_0x4a6dfa[_0x811a('0x42')],{})[_0x811a('0x1e')](function(_0x4685d2){var _0x230604=_0x4a6dfa['user']['get']({'plain':!![]});if(!_0x230604)throw new Error(_0x811a('0x43'));if(_0x230604['role']===_0x811a('0x44')){var _0x3d97dd=_0x4685d2['get']({'plain':!![]});var _0x193bdb=_0x811a('0x45');return db[_0x811a('0x46')]['find']({'where':{'name':_0x193bdb,'userProfileId':_0x230604[_0x811a('0x47')]},'raw':!![]})['then'](function(_0x40896f){if(_0x40896f&&_0x40896f['autoAssociation']===0x0){return db[_0x811a('0x21')][_0x811a('0x41')]({'name':_0x3d97dd[_0x811a('0x25')],'resourceId':_0x3d97dd['id'],'type':_0x40896f[_0x811a('0x25')],'sectionId':_0x40896f['id']},{})[_0x811a('0x1e')](function(){return _0x4685d2;});}else{return _0x4685d2;}})[_0x811a('0x3b')](function(_0x587764){logger['error'](_0x811a('0x48'),_0x587764);throw _0x587764;});}return _0x4685d2;})['then'](respondWithResult(_0x114eb7,0xc9))['catch'](handleError(_0x114eb7,null));};exports[_0x811a('0x1d')]=function(_0x3aa48f,_0x24ed8b){if(_0x3aa48f[_0x811a('0x42')]['id']){delete _0x3aa48f['body']['id'];}return db[_0x811a('0x28')][_0x811a('0x40')]({'where':{'id':_0x3aa48f['params']['id']}})[_0x811a('0x1e')](handleEntityNotFound(_0x24ed8b,null))[_0x811a('0x1e')](saveUpdates(_0x3aa48f[_0x811a('0x42')],null))[_0x811a('0x1e')](respondWithResult(_0x24ed8b,null))[_0x811a('0x3b')](handleError(_0x24ed8b,null));};exports[_0x811a('0x1f')]=function(_0xd7a579,_0x5a23cb){return db['CmCompany'][_0x811a('0x40')]({'where':{'id':_0xd7a579[_0x811a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5a23cb,null))[_0x811a('0x1e')](removeEntity(_0x5a23cb,null))[_0x811a('0x3b')](handleError(_0x5a23cb,null));};exports[_0x811a('0x29')]=function(_0x55e4b6,_0x288ae6){return db[_0x811a('0x28')][_0x811a('0x29')]()['then'](respondWithResult(_0x288ae6,null))['catch'](handleError(_0x288ae6,null));};exports[_0x811a('0x49')]=function(_0xd961d0,_0x23c51f,_0x244fa2){return db[_0x811a('0x4a')][_0x811a('0x40')]({'where':{'id':_0xd961d0[_0x811a('0x3c')]['id']}})[_0x811a('0x1e')](handleEntityNotFound(_0x23c51f,null))[_0x811a('0x1e')](function(_0x17b4a2){if(_0x17b4a2){return _0x17b4a2[_0x811a('0x49')](_0xd961d0[_0x811a('0x42')][_0x811a('0x4b')],_[_0x811a('0x4c')](_0xd961d0[_0x811a('0x42')],[_0x811a('0x4b'),'id'])||{});}})[_0x811a('0x1e')](respondWithResult(_0x23c51f,null))[_0x811a('0x3b')](handleError(_0x23c51f,null));};exports[_0x811a('0x4d')]=function(_0x1cb1b7,_0x28a3d6,_0x52fc28){var _0x17ac21={};var _0x1d2ad2={};var _0x3a04d5;var _0x419f24;return db[_0x811a('0x28')][_0x811a('0x4e')]({'where':{'id':_0x1cb1b7[_0x811a('0x3c')]['id']}})[_0x811a('0x1e')](handleEntityNotFound(_0x28a3d6,null))[_0x811a('0x1e')](function(_0x1cd501){if(_0x1cd501){_0x3a04d5=_0x1cd501;_0x1d2ad2[_0x811a('0x2a')]=_[_0x811a('0x2b')](db['CmContact'][_0x811a('0x3d')]);_0x1d2ad2['query']=_[_0x811a('0x2b')](_0x1cb1b7[_0x811a('0x2c')]);_0x1d2ad2[_0x811a('0x2d')]=_[_0x811a('0x2e')](_0x1d2ad2[_0x811a('0x2a')],_0x1d2ad2[_0x811a('0x2c')]);_0x17ac21[_0x811a('0x2f')]=_[_0x811a('0x2e')](_0x1d2ad2[_0x811a('0x2a')],qs['fields'](_0x1cb1b7[_0x811a('0x2c')][_0x811a('0x3e')]));_0x17ac21['attributes']=_0x17ac21[_0x811a('0x2f')][_0x811a('0x30')]?_0x17ac21[_0x811a('0x2f')]:_0x1d2ad2[_0x811a('0x2a')];_0x17ac21[_0x811a('0x4f')]=qs[_0x811a('0x32')](_0x1cb1b7[_0x811a('0x2c')][_0x811a('0x32')]);_0x17ac21['where']=qs[_0x811a('0x2d')](_[_0x811a('0x34')](_0x1cb1b7[_0x811a('0x2c')],_0x1d2ad2[_0x811a('0x2d')]));if(_0x1cb1b7[_0x811a('0x2c')][_0x811a('0x50')]){_0x17ac21[_0x811a('0x33')]=_[_0x811a('0x35')](_0x17ac21[_0x811a('0x33')],{'$or':_[_0x811a('0x36')](_0x17ac21[_0x811a('0x2f')],function(_0x339961){var _0x330f44={};_0x330f44[_0x339961]={'$like':'%'+_0x1cb1b7[_0x811a('0x2c')][_0x811a('0x50')]+'%'};return _0x330f44;})});}_0x17ac21=_[_0x811a('0x35')]({},_0x17ac21,_0x1cb1b7[_0x811a('0x37')]);return _0x3a04d5['getContacts'](_0x17ac21);}})[_0x811a('0x1e')](function(_0x49c1c6){if(_0x49c1c6){_0x419f24=_0x49c1c6[_0x811a('0x30')];if(!_0x1cb1b7[_0x811a('0x2c')][_0x811a('0x51')](_0x811a('0x31'))){_0x17ac21[_0x811a('0x18')]=qs[_0x811a('0x18')](_0x1cb1b7[_0x811a('0x2c')]['limit']);_0x17ac21['offset']=qs[_0x811a('0x16')](_0x1cb1b7[_0x811a('0x2c')][_0x811a('0x16')]);}return _0x3a04d5[_0x811a('0x4d')](_0x17ac21);}})[_0x811a('0x1e')](function(_0x353eea){if(_0x353eea){return _0x353eea?{'count':_0x419f24,'rows':_0x353eea}:null;}})['then'](respondWithResult(_0x28a3d6,null))['catch'](handleError(_0x28a3d6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 265de5a..20adaef 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 _0x5a77=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies','lodash','util','bluebird'];(function(_0x3d177f,_0x5d861b){var _0x2ea471=function(_0x544feb){while(--_0x544feb){_0x3d177f['push'](_0x3d177f['shift']());}};_0x2ea471(++_0x5d861b);}(_0x5a77,0x69));var _0x75a7=function(_0x1e76c8,_0x80064e){_0x1e76c8=_0x1e76c8-0x0;var _0xb27ade=_0x5a77[_0x1e76c8];return _0xb27ade;};'use strict';var _=require(_0x75a7('0x0'));var util=require(_0x75a7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x75a7('0x2'));var rp=require(_0x75a7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75a7('0x4'));var config=require(_0x75a7('0x5'));var attributes=require(_0x75a7('0x6'));module[_0x75a7('0x7')]=function(_0x501c65,_0x328194){return _0x501c65['define']('CmCompany',attributes,{'tableName':_0x75a7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8be7=['define','CmCompany','cm_companies','util','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8be7,0xb3));var _0x78be=function(_0x4d9607,_0x4a2515){_0x4d9607=_0x4d9607-0x0;var _0x5e510f=_0x8be7[_0x4d9607];return _0x5e510f;};'use strict';var _=require('lodash');var util=require(_0x78be('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x78be('0x1'));var BPromise=require('bluebird');var rp=require(_0x78be('0x2'));var fs=require('fs');var path=require(_0x78be('0x3'));var rimraf=require(_0x78be('0x4'));var config=require(_0x78be('0x5'));var attributes=require(_0x78be('0x6'));module[_0x78be('0x7')]=function(_0x5d624b,_0x32eb8f){return _0x5d624b[_0x78be('0x8')](_0x78be('0x9'),attributes,{'tableName':_0x78be('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 cd544dd..48e0bf1 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 _0x957f=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x49699f,_0x16e96f){var _0x4ac9a8=function(_0x1aaa1c){while(--_0x1aaa1c){_0x49699f['push'](_0x49699f['shift']());}};_0x4ac9a8(++_0x16e96f);}(_0x957f,0x88));var _0xf957=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x957f[_0x5bb4e8];return _0x2a86f2;};'use strict';var _=require(_0xf957('0x0'));var util=require(_0xf957('0x1'));var moment=require('moment');var BPromise=require(_0xf957('0x2'));var rs=require(_0xf957('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf957('0x4'))['db'];var utils=require(_0xf957('0x5'));var logger=require(_0xf957('0x6'))(_0xf957('0x7'));var config=require('../../config/environment');var jayson=require(_0xf957('0x8'));var client=jayson['client'][_0xf957('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a6c5f,_0x3f26b8,_0x2980e0){return new BPromise(function(_0x1061f8,_0x24ee29){return client['request'](_0x1a6c5f,_0x2980e0)[_0xf957('0xa')](function(_0x2d894d){logger['info'](_0xf957('0xb'),_0x3f26b8,_0xf957('0xc'));logger[_0xf957('0xd')](_0xf957('0xe'),_0x3f26b8,_0xf957('0xc'),JSON['stringify'](_0x2d894d));if(_0x2d894d['error']){if(_0x2d894d[_0xf957('0xf')][_0xf957('0x10')]===0x1f4){logger[_0xf957('0xf')](_0xf957('0xb'),_0x3f26b8,_0x2d894d[_0xf957('0xf')][_0xf957('0x11')]);return _0x24ee29(_0x2d894d[_0xf957('0xf')][_0xf957('0x11')]);}logger[_0xf957('0xf')](_0xf957('0xb'),_0x3f26b8,_0x2d894d[_0xf957('0xf')][_0xf957('0x11')]);return _0x1061f8(_0x2d894d[_0xf957('0xf')][_0xf957('0x11')]);}else{logger[_0xf957('0x12')]('CmCompany,\x20%s,\x20%s',_0x3f26b8,_0xf957('0xc'));_0x1061f8(_0x2d894d[_0xf957('0x13')][_0xf957('0x11')]);}})[_0xf957('0x14')](function(_0x46f7fb){logger[_0xf957('0xf')](_0xf957('0xb'),_0x3f26b8,_0x46f7fb);_0x24ee29(_0x46f7fb);});});} \ No newline at end of file +var _0x37f0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x37f0,0x18d));var _0x037f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x37f0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x037f('0x0'));var util=require(_0x037f('0x1'));var moment=require(_0x037f('0x2'));var BPromise=require(_0x037f('0x3'));var rs=require(_0x037f('0x4'));var fs=require('fs');var Redis=require(_0x037f('0x5'));var db=require(_0x037f('0x6'))['db'];var utils=require(_0x037f('0x7'));var logger=require(_0x037f('0x8'))(_0x037f('0x9'));var config=require(_0x037f('0xa'));var jayson=require(_0x037f('0xb'));var client=jayson[_0x037f('0xc')][_0x037f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d0478,_0x13b675,_0xf638a3){return new BPromise(function(_0x456205,_0x3056af){return client[_0x037f('0xe')](_0x1d0478,_0xf638a3)['then'](function(_0x281614){logger[_0x037f('0xf')]('CmCompany,\x20%s,\x20%s',_0x13b675,_0x037f('0x10'));logger[_0x037f('0x11')](_0x037f('0x12'),_0x13b675,'request\x20sent',JSON[_0x037f('0x13')](_0x281614));if(_0x281614[_0x037f('0x14')]){if(_0x281614[_0x037f('0x14')][_0x037f('0x15')]===0x1f4){logger[_0x037f('0x14')](_0x037f('0x16'),_0x13b675,_0x281614[_0x037f('0x14')]['message']);return _0x3056af(_0x281614[_0x037f('0x14')]['message']);}logger[_0x037f('0x14')]('CmCompany,\x20%s,\x20%s',_0x13b675,_0x281614[_0x037f('0x14')][_0x037f('0x17')]);return _0x456205(_0x281614[_0x037f('0x14')][_0x037f('0x17')]);}else{logger[_0x037f('0xf')](_0x037f('0x16'),_0x13b675,'request\x20sent');_0x456205(_0x281614['result'][_0x037f('0x17')]);}})[_0x037f('0x18')](function(_0x14d03b){logger[_0x037f('0x14')](_0x037f('0x16'),_0x13b675,_0x14d03b);_0x3056af(_0x14d03b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index caa7996..8184923 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 _0xec14=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','post','create','/:id/contacts','put','update','delete','util'];(function(_0x24a6e7,_0x5ea9f5){var _0x41f42d=function(_0x2591ce){while(--_0x2591ce){_0x24a6e7['push'](_0x24a6e7['shift']());}};_0x41f42d(++_0x5ea9f5);}(_0xec14,0x131));var _0x4ec1=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0xec14[_0x359bbe];return _0x1b3353;};'use strict';var multer=require('multer');var util=require(_0x4ec1('0x0'));var path=require(_0x4ec1('0x1'));var timeout=require(_0x4ec1('0x2'));var express=require('express');var router=express[_0x4ec1('0x3')]();var fs_extra=require(_0x4ec1('0x4'));var auth=require(_0x4ec1('0x5'));var interaction=require(_0x4ec1('0x6'));var config=require(_0x4ec1('0x7'));var controller=require(_0x4ec1('0x8'));router[_0x4ec1('0x9')]('/',auth[_0x4ec1('0xa')](),controller['index']);router[_0x4ec1('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4ec1('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4ec1('0x9')]('/:id/contacts',auth[_0x4ec1('0xa')](),controller['getContacts']);router[_0x4ec1('0xb')]('/',auth[_0x4ec1('0xa')](),controller[_0x4ec1('0xc')]);router['post'](_0x4ec1('0xd'),auth['isAuthenticated'](),controller['addContacts']);router[_0x4ec1('0xe')]('/:id',auth[_0x4ec1('0xa')](),controller[_0x4ec1('0xf')]);router[_0x4ec1('0x10')]('/:id',auth[_0x4ec1('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf954=['connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','show','post','create','addContacts','put','/:id','delete','destroy','multer','util','path'];(function(_0x51a029,_0x5159e0){var _0x4c4d3c=function(_0x3afa82){while(--_0x3afa82){_0x51a029['push'](_0x51a029['shift']());}};_0x4c4d3c(++_0x5159e0);}(_0xf954,0x10e));var _0x4f95=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0xf954[_0x4ac48d];return _0x7537af;};'use strict';var multer=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var path=require(_0x4f95('0x2'));var timeout=require(_0x4f95('0x3'));var express=require(_0x4f95('0x4'));var router=express[_0x4f95('0x5')]();var fs_extra=require(_0x4f95('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4f95('0x7'));var controller=require(_0x4f95('0x8'));router[_0x4f95('0x9')]('/',auth[_0x4f95('0xa')](),controller['index']);router[_0x4f95('0x9')](_0x4f95('0xb'),auth[_0x4f95('0xa')](),controller[_0x4f95('0xc')]);router['get']('/:id',auth[_0x4f95('0xa')](),controller[_0x4f95('0xd')]);router[_0x4f95('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x4f95('0xe')]('/',auth[_0x4f95('0xa')](),controller[_0x4f95('0xf')]);router[_0x4f95('0xe')]('/:id/contacts',auth[_0x4f95('0xa')](),controller[_0x4f95('0x10')]);router[_0x4f95('0x11')](_0x4f95('0x12'),auth[_0x4f95('0xa')](),controller['update']);router[_0x4f95('0x13')](_0x4f95('0x12'),auth[_0x4f95('0xa')](),controller[_0x4f95('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7395e2e..2601bd5 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 _0x460c=['TEXT','INTEGER','UNSIGNED','lodash','STRING'];(function(_0x14e220,_0x57056){var _0x746d60=function(_0x376042){while(--_0x376042){_0x14e220['push'](_0x14e220['shift']());}};_0x746d60(++_0x57056);}(_0x460c,0x125));var _0xc460=function(_0x7b214a,_0x52aa7a){_0x7b214a=_0x7b214a-0x0;var _0x2e2037=_0x460c[_0x7b214a];return _0x2e2037;};'use strict';var _=require(_0xc460('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0xc460('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc460('0x1')]},'street':{'type':Sequelize[_0xc460('0x1')]},'postalCode':{'type':Sequelize[_0xc460('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xc460('0x1')]},'description':{'type':Sequelize[_0xc460('0x2')]},'phone':{'type':Sequelize[_0xc460('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc460('0x1')]},'email':{'type':Sequelize[_0xc460('0x1')]},'url':{'type':Sequelize[_0xc460('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xc460('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xc460('0x1')]},'teams':{'type':Sequelize[_0xc460('0x1')]},'viber':{'type':Sequelize[_0xc460('0x1')]},'line':{'type':Sequelize[_0xc460('0x1')]},'wechat':{'type':Sequelize[_0xc460('0x1')]},'telegram':{'type':Sequelize[_0xc460('0x1')]},'UserId':{'type':Sequelize[_0xc460('0x3')]},'priority':{'type':Sequelize[_0xc460('0x3')](0x2)[_0xc460('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x2fd8=['STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize'];(function(_0x15acb7,_0x26461a){var _0x10693d=function(_0x162287){while(--_0x162287){_0x15acb7['push'](_0x15acb7['shift']());}};_0x10693d(++_0x26461a);}(_0x2fd8,0x147));var _0x82fd=function(_0x34e79d,_0x1fb826){_0x34e79d=_0x34e79d-0x0;var _0x56afa8=_0x2fd8[_0x34e79d];return _0x56afa8;};'use strict';var _=require(_0x82fd('0x0'));var Sequelize=require(_0x82fd('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x82fd('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x82fd('0x2')]},'street':{'type':Sequelize[_0x82fd('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x82fd('0x2')]},'country':{'type':Sequelize[_0x82fd('0x2')]},'dateOfBirth':{'type':Sequelize[_0x82fd('0x2')]},'description':{'type':Sequelize[_0x82fd('0x3')]},'phone':{'type':Sequelize[_0x82fd('0x2')]},'mobile':{'type':Sequelize[_0x82fd('0x2')]},'fax':{'type':Sequelize[_0x82fd('0x2')]},'email':{'type':Sequelize[_0x82fd('0x2')]},'url':{'type':Sequelize[_0x82fd('0x2')]},'facebook':{'type':Sequelize[_0x82fd('0x2')]},'fb_data':{'type':Sequelize[_0x82fd('0x2')]},'twitter':{'type':Sequelize[_0x82fd('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x82fd('0x2')]},'viber':{'type':Sequelize[_0x82fd('0x2')]},'line':{'type':Sequelize[_0x82fd('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x82fd('0x2')]},'UserId':{'type':Sequelize[_0x82fd('0x4')]},'priority':{'type':Sequelize[_0x82fd('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x82fd('0x5')],'defaultValue':Sequelize[_0x82fd('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d7ffe9b..253548c 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 _0x1989=['get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','format','cf_%d','$and','pickBy','isEmpty','table','setFields','toParam','values','phone','CmHopper','getTags','findOne','rawAttributes','setTags','ids','getHoppers','options','includeAll','include','ContactId','getJscriptySessions','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','file','parse','meta','import','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','start\x20child\x20process\x20correctly!','pid','exit','getJourney','mail','chat','sms','fax','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','Website','Account','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','flatten','reverse','slice','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','then','end','sendStatus','stack','name','send','index','CmContact','describe','keys','cf_','CmCustomField','trimStart','all','length','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','buildExpression','text','start','filter','isNil','Contact','push','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','clone','DESC','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','startsWith','columnName','displayName','findAll','custom','body'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1989,0x82));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x9198('0x0'));var BPromise=require(_0x9198('0x1'));var util=require('util');var path=require(_0x9198('0x2'));var fs=require('fs');var _=require(_0x9198('0x3'));var squel=require(_0x9198('0x4'));var Papa=require(_0x9198('0x5'));var Redis=require(_0x9198('0x6'));var qs=require(_0x9198('0x7'));var as=require(_0x9198('0x8'));var logger=require(_0x9198('0x9'))('api');var config=require(_0x9198('0xa'));var db=require(_0x9198('0xb'))['db'];config[_0x9198('0xc')]=_[_0x9198('0xd')](config[_0x9198('0xc')],{'host':_0x9198('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9198('0xc')]));require('./cmContact.socket')[_0x9198('0xf')](socket);function respondWithResult(_0x2e01c3,_0x7b93f5){_0x7b93f5=_0x7b93f5||0xc8;return function(_0x5bf6df){if(_0x5bf6df){return _0x2e01c3['status'](_0x7b93f5)[_0x9198('0x10')](_0x5bf6df);}};}function respondWithFilteredResult(_0x2c7900,_0x13a625){return function(_0x1c4c8f){if(_0x1c4c8f){var _0x29a375=typeof _0x13a625[_0x9198('0x11')]===_0x9198('0x12')&&typeof _0x13a625[_0x9198('0x13')]===_0x9198('0x12');var _0x3add6f=_0x1c4c8f[_0x9198('0x14')];var _0x223877=_0x29a375?0x0:_0x13a625[_0x9198('0x11')];var _0x44fe7b=_0x29a375?_0x1c4c8f[_0x9198('0x14')]:_0x13a625[_0x9198('0x11')]+_0x13a625[_0x9198('0x13')];var _0x138f83;if(_0x44fe7b>=_0x3add6f){_0x44fe7b=_0x3add6f;_0x138f83=0xc8;}else{_0x138f83=0xce;}_0x2c7900[_0x9198('0x15')](_0x138f83);return _0x2c7900[_0x9198('0x16')](_0x9198('0x17'),_0x223877+'-'+_0x44fe7b+'/'+_0x3add6f)['json'](_0x1c4c8f);}return null;};}function saveUpdates(_0xf56948){return function(_0x313b99){if(_0x313b99){return _0x313b99[_0x9198('0x18')](_0xf56948)['then'](function(_0x196e39){return _0x196e39;});}return null;};}function removeEntity(_0x16793d){return function(_0x5a2d43){if(_0x5a2d43){return _0x5a2d43[_0x9198('0x19')]()[_0x9198('0x1a')](function(){_0x16793d['status'](0xcc)[_0x9198('0x1b')]();});}};}function handleEntityNotFound(_0x1a0764){return function(_0x4a4142){if(!_0x4a4142){_0x1a0764[_0x9198('0x1c')](0x194);}return _0x4a4142;};}function handleError(_0x44aea6,_0x404a69){_0x404a69=_0x404a69||0x1f4;return function(_0x5df8c6){logger['error'](_0x5df8c6[_0x9198('0x1d')]);if(_0x5df8c6[_0x9198('0x1e')]){delete _0x5df8c6[_0x9198('0x1e')];}_0x44aea6[_0x9198('0x15')](_0x404a69)[_0x9198('0x1f')](_0x5df8c6);};}exports[_0x9198('0x20')]=function(_0x429d91,_0x5a34a1){var _0x1bb410={},_0x402bdc={},_0x21555c={'count':0x0,'rows':[]};return db[_0x9198('0x21')][_0x9198('0x22')]()[_0x9198('0x1a')](function(_0x1f742c){var _0x348bbf=[];for(var _0x4fe768=0x0;_0x4fe7680x1){_0x22d327['or'](_0x9198('0x64'),qs[_0x9198('0x65')](_0x265443),null);}else{if(qs['isNumeric'](_0x265443)){_0x22d327['or']('c.id\x20LIKE\x20?',_0x265443+'%');_0x22d327['or'](_0x9198('0x66'),_0x265443+'%');_0x22d327['or'](_0x9198('0x67'),_0x265443+'%');_0x22d327['or'](_0x9198('0x68'),_0x265443+'%');}else if(qs['isEmail'](_0x265443)){_0x22d327['or']('c.email\x20LIKE\x20?',_0x265443+'%');}else{_0x22d327['or'](_0x9198('0x69'),'%'+_0x265443+'%');_0x22d327['or']('c.lastName\x20LIKE\x20?','%'+_0x265443+'%');_0x22d327['or'](_0x9198('0x6a'),'%'+_0x265443+'%');}}}}_0x3efde4[_0x9198('0x40')](_0x22d327);_0x3efde4[_0x9198('0x6b')](_0x9198('0x6c'));var _0x5bec26={'type':db['Sequelize'][_0x9198('0x6d')]['SELECT'],'raw':!![]};var _0x4062c9=_0x3efde4[_0x9198('0x6e')]()['field']('c.id');if(_0x1bb410[_0x9198('0x32')]){_0x1bb410[_0x9198('0x32')]['forEach'](function(_0x460cd2){_0x3efde4['order']('c.'+_0x460cd2[0x0],_0x460cd2[0x1]===_0x9198('0x6f')?![]:!![]);});}if(!_['isEmpty'](_0x1c8e6c)){_0x3efde4['having'](_0x38b96e);_0x4062c9['where']('t.id\x20IN\x20?',_0x1c8e6c);}BPromise[_0x9198('0x70')]()[_0x9198('0x1a')](function(){if(!_0x30ee98)return;if(_0x429d91[_0x9198('0x71')][_0x9198('0x72')]!==_0x9198('0x73'))return;if(!_[_0x9198('0x74')](_0x30ee98[_0x9198('0x45')],[_0x9198('0x36'),'User'])){return _0x429d91['user'][_0x9198('0x75')]({'attributes':['id'],'raw':!![]})[_0x9198('0x1a')](function(_0xdcd641){if(_['isEmpty'](_0xdcd641)){_0x4062c9[_0x9198('0x40')]('c.ListId\x20IS\x20NULL');_0x3efde4[_0x9198('0x40')](_0x9198('0x76'));}else{_0x4062c9[_0x9198('0x40')](_0x9198('0x5d'),_[_0x9198('0x4a')](_0xdcd641,'id'));_0x3efde4[_0x9198('0x40')](_0x9198('0x5d'),_[_0x9198('0x4a')](_0xdcd641,'id'));}});}})[_0x9198('0x1a')](function(){if(_0x429d91[_0x9198('0x71')][_0x9198('0x72')]==='agent'&&!_0x30ee98&&!_0x429d91[_0x9198('0x2b')][_0x9198('0x5c')])return[];return db[_0x9198('0x77')]['query'](_0x4062c9[_0x9198('0x78')](),_0x5bec26);})[_0x9198('0x1a')](function(_0xc00a4d){_0x21555c[_0x9198('0x14')]=_0xc00a4d[_0x9198('0x28')];if(_0x21555c[_0x9198('0x14')]===0x0)return[];return db[_0x9198('0x77')][_0x9198('0x2b')](_0x17a7fa[_0x9198('0x78')](),_0x5bec26)['then'](function(_0x3e64f8){_0x51d74e=_[_0x9198('0x79')](_0x3e64f8,'id');_0x5bec26=_[_0x9198('0x7a')](_0x5bec26,{'model':db[_0x9198('0x21')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x429d91[_0x9198('0x2b')]['fields']){_0x1bb410[_0x9198('0x2d')][_0x9198('0x4b')](function(_0x521b3e){_0x3efde4[_0x9198('0x36')]('c.'+_0x521b3e);});}else{_0x3efde4[_0x9198('0x36')]('c.id');_0x3efde4[_0x9198('0x36')](_0x9198('0x7b'));_0x3efde4[_0x9198('0x36')](_0x9198('0x7c'));_0x3efde4[_0x9198('0x36')](_0x9198('0x7d'));_0x3efde4[_0x9198('0x36')](_0x9198('0x7e'));_0x3efde4[_0x9198('0x36')](_0x9198('0x7f'));_0x3efde4[_0x9198('0x36')](_0x9198('0x80'));_0x3efde4[_0x9198('0x36')](_0x9198('0x81'));_0x3efde4['field'](_0x9198('0x82'));_0x3efde4[_0x9198('0x36')](_0x9198('0x83'));_0x3efde4[_0x9198('0x36')]('c.CompanyId');_0x3efde4[_0x9198('0x36')](_0x9198('0x84'),_0x9198('0x85'));}if(_0x1bb410[_0x9198('0x13')])_0x3efde4[_0x9198('0x13')](_0x1bb410[_0x9198('0x13')]);if(_0x1bb410[_0x9198('0x11')])_0x3efde4[_0x9198('0x11')](_0x1bb410[_0x9198('0x11')]);return db[_0x9198('0x77')]['query'](_0x3efde4[_0x9198('0x78')](),_0x5bec26);});})[_0x9198('0x1a')](function(_0x3c2b6b){_0x3c2b6b['forEach'](function(_0x4fde71){if(_0x4fde71[_0x9198('0x85')]){_0x4fde71[_0x9198('0x86')]=[];_0x4fde71[_0x9198('0x85')][_0x9198('0x49')](',')[_0x9198('0x4b')](function(_0x4dd276){_0x4fde71[_0x9198('0x86')][_0x9198('0x5b')](_0x51d74e[_0x4dd276]);});}delete _0x4fde71[_0x9198('0x85')];});_0x21555c[_0x9198('0x87')]=_0x3c2b6b;return _0x21555c;})[_0x9198('0x1a')](respondWithFilteredResult(_0x5a34a1,_0x1bb410));})[_0x9198('0x88')](handleError(_0x5a34a1,null));};exports['destroy']=function(_0x44cd92,_0x115e26){return db[_0x9198('0x21')][_0x9198('0x46')]({'where':{'id':_0x44cd92[_0x9198('0x89')]['id']}})[_0x9198('0x1a')](handleEntityNotFound(_0x115e26,null))[_0x9198('0x1a')](removeEntity(_0x115e26,null))[_0x9198('0x88')](handleError(_0x115e26,null));};exports[_0x9198('0x22')]=function(_0x456d5d,_0x2e9858){return db[_0x9198('0x21')][_0x9198('0x22')]()['then'](function(_0x12e643){delete _0x12e643[_0x9198('0x8a')];for(var _0xb315a7=0x0;_0xb315a7=_0x49b937){_0x2c44b5=_0x49b937;_0x13fc93=0xc8;}else{_0x13fc93=0xce;}_0x3892f3[_0x218f('0x11')](_0x13fc93);return _0x3892f3['set'](_0x218f('0x17'),_0x343bed+'-'+_0x2c44b5+'/'+_0x49b937)[_0x218f('0x12')](_0x54b831);}return null;};}function saveUpdates(_0x54feaf){return function(_0x4e827e){if(_0x4e827e){return _0x4e827e[_0x218f('0x18')](_0x54feaf)['then'](function(_0x204c8a){return _0x204c8a;});}return null;};}function removeEntity(_0x4ed92d){return function(_0xfaacad){if(_0xfaacad){return _0xfaacad[_0x218f('0x19')]()[_0x218f('0x1a')](function(){_0x4ed92d[_0x218f('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d49b){return function(_0x398ebd){if(!_0x398ebd){_0x40d49b[_0x218f('0x1b')](0x194);}return _0x398ebd;};}function handleError(_0x23bb61,_0x116f52){_0x116f52=_0x116f52||0x1f4;return function(_0x4b164f){logger[_0x218f('0x1c')](_0x4b164f['stack']);if(_0x4b164f[_0x218f('0x1d')]){delete _0x4b164f['name'];}_0x23bb61[_0x218f('0x11')](_0x116f52)[_0x218f('0x1e')](_0x4b164f);};}exports['index']=function(_0x10ddef,_0x2582c4){var _0x5ac25a={},_0x5b74f1={},_0x240c17={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x218f('0x1a')](function(_0x45856b){var _0x35bfbb=[];for(var _0x2ec3a3=0x0;_0x2ec3a30x1){_0xce4c3d['or'](_0x218f('0x5d'),qs['getFullTextValue'](_0x3b7ae1),null);}else{if(qs[_0x218f('0x5e')](_0x3b7ae1)){_0xce4c3d['or']('c.id\x20LIKE\x20?',_0x3b7ae1+'%');_0xce4c3d['or']('c.phone\x20LIKE\x20?',_0x3b7ae1+'%');_0xce4c3d['or']('c.mobile\x20LIKE\x20?',_0x3b7ae1+'%');_0xce4c3d['or'](_0x218f('0x5f'),_0x3b7ae1+'%');}else if(qs[_0x218f('0x60')](_0x3b7ae1)){_0xce4c3d['or'](_0x218f('0x61'),_0x3b7ae1+'%');}else{_0xce4c3d['or'](_0x218f('0x62'),'%'+_0x3b7ae1+'%');_0xce4c3d['or']('c.lastName\x20LIKE\x20?','%'+_0x3b7ae1+'%');_0xce4c3d['or'](_0x218f('0x61'),'%'+_0x3b7ae1+'%');}}}}_0x442fe8['where'](_0xce4c3d);_0x442fe8['group'](_0x218f('0x63'));var _0x211bd4={'type':db['Sequelize']['QueryTypes'][_0x218f('0x64')],'raw':!![]};var _0x46ab9e=_0x442fe8[_0x218f('0x65')]()[_0x218f('0x34')](_0x218f('0x63'));if(_0x5ac25a[_0x218f('0x2f')]){_0x5ac25a['order'][_0x218f('0x49')](function(_0x275a3a){_0x442fe8['order']('c.'+_0x275a3a[0x0],_0x275a3a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x218f('0x55')](_0x493b27)){_0x442fe8['having'](_0x456721);_0x46ab9e[_0x218f('0x31')]('t.id\x20IN\x20?',_0x493b27);}BPromise[_0x218f('0x66')]()[_0x218f('0x1a')](function(){if(!_0x41c1bc)return;if(_0x10ddef['user']['role']!==_0x218f('0x67'))return;if(!_[_0x218f('0x68')](_0x41c1bc[_0x218f('0x43')],[_0x218f('0x34'),'User'])){return _0x10ddef[_0x218f('0x69')][_0x218f('0x6a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x371986){if(_['isEmpty'](_0x371986)){_0x46ab9e['where']('c.ListId\x20IS\x20NULL');_0x442fe8[_0x218f('0x31')](_0x218f('0x6b'));}else{_0x46ab9e[_0x218f('0x31')]('c.ListId\x20IN\x20?',_['map'](_0x371986,'id'));_0x442fe8[_0x218f('0x31')](_0x218f('0x57'),_[_0x218f('0x48')](_0x371986,'id'));}});}})[_0x218f('0x1a')](function(){if(_0x10ddef[_0x218f('0x69')]['role']===_0x218f('0x67')&&!_0x41c1bc&&!_0x10ddef[_0x218f('0x28')][_0x218f('0x56')])return[];return db['sequelize']['query'](_0x46ab9e[_0x218f('0x6c')](),_0x211bd4);})[_0x218f('0x1a')](function(_0x4fd1ef){_0x240c17[_0x218f('0x16')]=_0x4fd1ef['length'];if(_0x240c17[_0x218f('0x16')]===0x0)return[];return db[_0x218f('0x6d')][_0x218f('0x28')](_0x8d9186['toString'](),_0x211bd4)[_0x218f('0x1a')](function(_0x5d7132){_0x21a9d0=_['keyBy'](_0x5d7132,'id');_0x211bd4=_['merge'](_0x211bd4,{'model':db[_0x218f('0x6e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10ddef[_0x218f('0x28')]['fields']){_0x5ac25a[_0x218f('0x2b')]['forEach'](function(_0x300d80){_0x442fe8[_0x218f('0x34')]('c.'+_0x300d80);});}else{_0x442fe8[_0x218f('0x34')](_0x218f('0x63'));_0x442fe8['field'](_0x218f('0x6f'));_0x442fe8[_0x218f('0x34')](_0x218f('0x70'));_0x442fe8[_0x218f('0x34')](_0x218f('0x71'));_0x442fe8[_0x218f('0x34')](_0x218f('0x72'));_0x442fe8['field'](_0x218f('0x73'));_0x442fe8[_0x218f('0x34')](_0x218f('0x74'));_0x442fe8[_0x218f('0x34')](_0x218f('0x75'));_0x442fe8[_0x218f('0x34')](_0x218f('0x76'));_0x442fe8[_0x218f('0x34')](_0x218f('0x77'));_0x442fe8[_0x218f('0x34')]('c.CompanyId');_0x442fe8[_0x218f('0x34')](_0x218f('0x78'),_0x218f('0x79'));}if(_0x5ac25a['limit'])_0x442fe8[_0x218f('0x14')](_0x5ac25a[_0x218f('0x14')]);if(_0x5ac25a[_0x218f('0x13')])_0x442fe8[_0x218f('0x13')](_0x5ac25a[_0x218f('0x13')]);return db[_0x218f('0x6d')][_0x218f('0x28')](_0x442fe8[_0x218f('0x6c')](),_0x211bd4);});})[_0x218f('0x1a')](function(_0x14edd4){_0x14edd4[_0x218f('0x49')](function(_0x55fd5f){if(_0x55fd5f[_0x218f('0x79')]){_0x55fd5f[_0x218f('0x7a')]=[];_0x55fd5f['TagIds']['split'](',')[_0x218f('0x49')](function(_0x101348){_0x55fd5f['Tags']['push'](_0x21a9d0[_0x101348]);});}delete _0x55fd5f[_0x218f('0x79')];});_0x240c17[_0x218f('0x7b')]=_0x14edd4;return _0x240c17;})[_0x218f('0x1a')](respondWithFilteredResult(_0x2582c4,_0x5ac25a));})[_0x218f('0x7c')](handleError(_0x2582c4,null));};exports[_0x218f('0x19')]=function(_0x1fc583,_0x2fc1c3){return db[_0x218f('0x6e')][_0x218f('0x44')]({'where':{'id':_0x1fc583['params']['id']}})['then'](handleEntityNotFound(_0x2fc1c3,null))[_0x218f('0x1a')](removeEntity(_0x2fc1c3,null))[_0x218f('0x7c')](handleError(_0x2fc1c3,null));};exports[_0x218f('0x7d')]=function(_0x21f487,_0x20d219){return db[_0x218f('0x6e')][_0x218f('0x7d')]()[_0x218f('0x1a')](function(_0x3235ea){delete _0x3235ea[_0x218f('0x7e')];for(var _0x5bf2de=0x0;_0x5bf2de{}\s\\|]/g,'-');_0x210a8a(null,util[_0xf96b('0x22')](_0xf96b('0x23'),path[_0xf96b('0x24')](_0x483363[_0xf96b('0x20')],path[_0xf96b('0x25')](_0x483363[_0xf96b('0x20')])),Date[_0xf96b('0x26')](),path[_0xf96b('0x25')](_0x483363[_0xf96b('0x20')])));}})});router[_0xf96b('0x18')]('/csv',upload[_0xf96b('0x27')](_0xf96b('0x28')),controller[_0xf96b('0x29')]);var upload=multer({'storage':multer[_0xf96b('0x1d')]({'destination':function(_0x2ab00d,_0xa0e9c9,_0x5216e6){_0x5216e6(null,path[_0xf96b('0x1e')](config[_0xf96b('0x1f')],'server/files/tmp'));},'filename':function(_0x3de838,_0x4accb9,_0x3ae4bb){_0x4accb9[_0xf96b('0x20')]=_0x4accb9[_0xf96b('0x20')][_0xf96b('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ae4bb(null,util['format'](_0xf96b('0x23'),path[_0xf96b('0x24')](_0x4accb9[_0xf96b('0x20')],path[_0xf96b('0x25')](_0x4accb9[_0xf96b('0x20')])),Date['now'](),path[_0xf96b('0x25')](_0x4accb9[_0xf96b('0x20')])));}})});router['post'](_0xf96b('0x2a'),upload[_0xf96b('0x27')](_0xf96b('0x28')),controller[_0xf96b('0x2b')]);router['post'](_0xf96b('0x2c'),auth[_0xf96b('0x7')](),controller['import']);router[_0xf96b('0x2d')](_0xf96b('0xa'),auth[_0xf96b('0x7')](),controller[_0xf96b('0x2e')]);router[_0xf96b('0x2f')](_0xf96b('0xa'),auth[_0xf96b('0x7')](),controller['destroy']);module[_0xf96b('0x30')]=router; \ No newline at end of file +var _0xf5bd=['/create_many','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','now','single','file','extname','/upload','/upload/:id','import','put','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','post','merge','create'];(function(_0x18948a,_0x52ca8b){var _0x1e072c=function(_0x3bc08e){while(--_0x3bc08e){_0x18948a['push'](_0x18948a['shift']());}};_0x1e072c(++_0x52ca8b);}(_0xf5bd,0x165));var _0xdf5b=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xf5bd[_0x132558];return _0x34f138;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf5b('0x0'));var timeout=require(_0xdf5b('0x1'));var express=require('express');var router=express[_0xdf5b('0x2')]();var fs_extra=require(_0xdf5b('0x3'));var auth=require(_0xdf5b('0x4'));var interaction=require(_0xdf5b('0x5'));var config=require(_0xdf5b('0x6'));var controller=require('./cmContact.controller');router[_0xdf5b('0x7')]('/',auth['isAuthenticated'](),controller[_0xdf5b('0x8')]);router[_0xdf5b('0x7')](_0xdf5b('0x9'),auth[_0xdf5b('0xa')](),controller[_0xdf5b('0xb')]);router[_0xdf5b('0x7')](_0xdf5b('0xc'),auth['isAuthenticated'](),controller[_0xdf5b('0xd')]);router['get'](_0xdf5b('0xe'),auth[_0xdf5b('0xa')](),controller[_0xdf5b('0xf')]);router[_0xdf5b('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xdf5b('0x10')]);router['get'](_0xdf5b('0x11'),auth[_0xdf5b('0xa')](),controller[_0xdf5b('0x12')]);router[_0xdf5b('0x7')](_0xdf5b('0x13'),auth['isAuthenticated'](),controller[_0xdf5b('0x14')]);router[_0xdf5b('0x7')]('/:id/jscripty_sessions',auth['isAuthenticated'](),controller[_0xdf5b('0x15')]);router['get'](_0xdf5b('0x16'),auth[_0xdf5b('0xa')](),controller[_0xdf5b('0x17')]);router[_0xdf5b('0x18')]('/merge',auth[_0xdf5b('0xa')](),controller[_0xdf5b('0x19')]);router[_0xdf5b('0x18')]('/',auth[_0xdf5b('0xa')](),controller[_0xdf5b('0x1a')]);router['post'](_0xdf5b('0x1b'),auth[_0xdf5b('0xa')](),controller['bulkCreate']);router['post']('/:id/tags',auth[_0xdf5b('0xa')](),controller[_0xdf5b('0x1c')]);var upload=multer({'storage':multer[_0xdf5b('0x1d')]({'destination':function(_0x1ebdb4,_0x13c58b,_0x104f0c){_0x104f0c(null,path[_0xdf5b('0x1e')](config[_0xdf5b('0x1f')],_0xdf5b('0x20')));},'filename':function(_0x3ab2d9,_0x5955b8,_0x298523){_0x5955b8[_0xdf5b('0x21')]=_0x5955b8['originalname'][_0xdf5b('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x298523(null,util[_0xdf5b('0x23')](_0xdf5b('0x24'),path[_0xdf5b('0x25')](_0x5955b8[_0xdf5b('0x21')],path['extname'](_0x5955b8['originalname'])),Date[_0xdf5b('0x26')](),path['extname'](_0x5955b8[_0xdf5b('0x21')])));}})});router[_0xdf5b('0x18')]('/csv',upload[_0xdf5b('0x27')](_0xdf5b('0x28')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xdf5b('0x1d')]({'destination':function(_0x30e086,_0x148b0e,_0x1b4a0d){_0x1b4a0d(null,path['join'](config['root'],_0xdf5b('0x20')));},'filename':function(_0x44f816,_0x518849,_0xf89131){_0x518849[_0xdf5b('0x21')]=_0x518849[_0xdf5b('0x21')][_0xdf5b('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xf89131(null,util[_0xdf5b('0x23')](_0xdf5b('0x24'),path[_0xdf5b('0x25')](_0x518849[_0xdf5b('0x21')],path[_0xdf5b('0x29')](_0x518849[_0xdf5b('0x21')])),Date['now'](),path['extname'](_0x518849['originalname'])));}})});router['post'](_0xdf5b('0x2a'),upload[_0xdf5b('0x27')](_0xdf5b('0x28')),controller['upload']);router[_0xdf5b('0x18')](_0xdf5b('0x2b'),auth['isAuthenticated'](),controller[_0xdf5b('0x2c')]);router[_0xdf5b('0x2d')](_0xdf5b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xdf5b('0x2e')](_0xdf5b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xdf5b('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 25c513a..019a6cc 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 _0xe6d4=['values','isArray','setDataValue','BOOLEAN','voice','lodash','getDataValue','alias','STRING','TEXT','long','select','parse'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xe6d4,0x7a));var _0x4e6d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe6d4[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4e6d('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2d7358){return this[_0x4e6d('0x1')](_0x4e6d('0x2'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xb243d4){this['setDataValue']('alias',_0xb243d4?_0xb243d4:this[_0x4e6d('0x1')]('name'));}},'type':{'type':Sequelize[_0x4e6d('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x4e6d('0x4')](_0x4e6d('0x5')),'get':function(){if(this['getDataValue']('type')===_0x4e6d('0x6')){return JSON[_0x4e6d('0x7')](this['getDataValue'](_0x4e6d('0x8')));}else{return this[_0x4e6d('0x1')](_0x4e6d('0x8'));}},'set':function(_0x49f4f1){if(Array[_0x4e6d('0x9')](_0x49f4f1)){this[_0x4e6d('0xa')]('values',JSON['stringify'](_0x49f4f1));}else{this[_0x4e6d('0xa')](_0x4e6d('0x8'),_0x49f4f1);}}},'required':{'type':Sequelize[_0x4e6d('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4e6d('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x4e6d('0xc'))}}; \ No newline at end of file +var _0x5276=['VIRTUAL','alias','STRING','setDataValue','getDataValue','name','long','type','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash'];(function(_0x56ad39,_0x36cd70){var _0x24e6a3=function(_0x3a1d30){while(--_0x3a1d30){_0x56ad39['push'](_0x56ad39['shift']());}};_0x24e6a3(++_0x36cd70);}(_0x5276,0x86));var _0x6527=function(_0x5211e5,_0x1e2e16){_0x5211e5=_0x5211e5-0x0;var _0x435b06=_0x5276[_0x5211e5];return _0x435b06;};'use strict';var Sequelize=require(_0x6527('0x0'));var _=require(_0x6527('0x1'));module['exports']={'name':{'type':Sequelize[_0x6527('0x2')],'get':function(_0x490e7e){return this['getDataValue'](_0x6527('0x3'));}},'alias':{'type':Sequelize[_0x6527('0x4')],'allowNull':![],'set':function(_0x4ad665){this[_0x6527('0x5')]('alias',_0x4ad665?_0x4ad665:this[_0x6527('0x6')](_0x6527('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x6527('0x8')),'get':function(){if(this[_0x6527('0x6')](_0x6527('0x9'))==='select'){return JSON[_0x6527('0xa')](this[_0x6527('0x6')]('values'));}else{return this[_0x6527('0x6')](_0x6527('0xb'));}},'set':function(_0x1f0080){if(Array[_0x6527('0xc')](_0x1f0080)){this[_0x6527('0x5')](_0x6527('0xb'),JSON[_0x6527('0xd')](_0x1f0080));}else{this[_0x6527('0x5')](_0x6527('0xb'),_0x1f0080);}}},'required':{'type':Sequelize[_0x6527('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6527('0xf')](_0x6527('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index ca7b823..5e179d1 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 _0x55e7=['order','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','includeAll','include','findAll','rows','show','params','keys','find','update','body','create','transaction','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','sequelize','addColumn','format','cf_%d','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../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','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x55e7,0x138));var _0x755e=function(_0x148683,_0x57ce95){_0x148683=_0x148683-0x0;var _0x507b50=_0x55e7[_0x148683];return _0x507b50;};'use strict';var emlformat=require(_0x755e('0x0'));var rimraf=require(_0x755e('0x1'));var zipdir=require(_0x755e('0x2'));var jsonpatch=require(_0x755e('0x3'));var rp=require(_0x755e('0x4'));var moment=require('moment');var BPromise=require(_0x755e('0x5'));var Mustache=require(_0x755e('0x6'));var util=require(_0x755e('0x7'));var path=require(_0x755e('0x8'));var sox=require(_0x755e('0x9'));var csv=require('to-csv');var ejs=require(_0x755e('0xa'));var fs=require('fs');var fs_extra=require(_0x755e('0xb'));var _=require(_0x755e('0xc'));var squel=require(_0x755e('0xd'));var crypto=require(_0x755e('0xe'));var jsforce=require(_0x755e('0xf'));var deskjs=require(_0x755e('0x10'));var toCsv=require(_0x755e('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x755e('0x12'));var authService=require(_0x755e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x755e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x755e('0x15'));var utils=require(_0x755e('0x16'));var config=require(_0x755e('0x17'));var licenseUtil=require(_0x755e('0x18'));var db=require(_0x755e('0x19'))['db'];function respondWithStatusCode(_0x5de79a,_0xc7793d){_0xc7793d=_0xc7793d||0xcc;return function(_0x25ca55){if(_0x25ca55){return _0x5de79a[_0x755e('0x1a')](_0xc7793d);}return _0x5de79a[_0x755e('0x1b')](_0xc7793d)[_0x755e('0x1c')]();};}function respondWithResult(_0x65e387,_0x2bff95){_0x2bff95=_0x2bff95||0xc8;return function(_0x582b5c){if(_0x582b5c){return _0x65e387[_0x755e('0x1b')](_0x2bff95)[_0x755e('0x1d')](_0x582b5c);}};}function respondWithFilteredResult(_0x411ee1,_0x404c2c){return function(_0xcba795){if(_0xcba795){var _0x4198b7=typeof _0x404c2c[_0x755e('0x1e')]===_0x755e('0x1f')&&typeof _0x404c2c[_0x755e('0x20')]===_0x755e('0x1f');var _0x685a7=_0xcba795[_0x755e('0x21')];var _0x3417ab=_0x4198b7?0x0:_0x404c2c[_0x755e('0x1e')];var _0x4fe848=_0x4198b7?_0xcba795[_0x755e('0x21')]:_0x404c2c[_0x755e('0x1e')]+_0x404c2c[_0x755e('0x20')];var _0x5420da;if(_0x4fe848>=_0x685a7){_0x4fe848=_0x685a7;_0x5420da=0xc8;}else{_0x5420da=0xce;}_0x411ee1[_0x755e('0x1b')](_0x5420da);return _0x411ee1[_0x755e('0x22')](_0x755e('0x23'),_0x3417ab+'-'+_0x4fe848+'/'+_0x685a7)[_0x755e('0x1d')](_0xcba795);}return null;};}function patchUpdates(_0x4a293e){return function(_0x3b5c7d){try{jsonpatch[_0x755e('0x24')](_0x3b5c7d,_0x4a293e,!![]);}catch(_0x3f80ee){return BPromise[_0x755e('0x25')](_0x3f80ee);}return _0x3b5c7d[_0x755e('0x26')]();};}function saveUpdates(_0x373533,_0x1f9ad0){return function(_0x4c3676){if(_0x4c3676){return _0x4c3676['update'](_0x373533)[_0x755e('0x27')](function(_0x260119){return _0x260119;});}return null;};}function removeEntity(_0x73994,_0x3771c0){return function(_0x219c52){if(_0x219c52){return _0x219c52[_0x755e('0x28')]()[_0x755e('0x27')](function(){_0x73994[_0x755e('0x1b')](0xcc)[_0x755e('0x1c')]();});}};}function handleEntityNotFound(_0xb5fbdb,_0x1a28c5){return function(_0x5aa8cd){if(!_0x5aa8cd){_0xb5fbdb[_0x755e('0x1a')](0x194);}return _0x5aa8cd;};}function handleError(_0x2f47be,_0x188b2d){_0x188b2d=_0x188b2d||0x1f4;return function(_0x4e65ee){logger[_0x755e('0x29')](_0x4e65ee[_0x755e('0x2a')]);if(_0x4e65ee[_0x755e('0x2b')]){delete _0x4e65ee['name'];}_0x2f47be[_0x755e('0x1b')](_0x188b2d)[_0x755e('0x2c')](_0x4e65ee);};}exports[_0x755e('0x2d')]=function(_0x5b5ee5,_0xc254d6){var _0x181a6={},_0x9f70ba={},_0x249499={'count':0x0,'rows':[]};var _0xd57329=_[_0x755e('0x2e')](db['CmCustomField'][_0x755e('0x2f')],function(_0x1fad00){return{'name':_0x1fad00[_0x755e('0x30')],'type':_0x1fad00[_0x755e('0x31')][_0x755e('0x32')]};});_0x9f70ba[_0x755e('0x33')]=_['differenceBy'](_[_0x755e('0x2e')](_0xd57329,_0x755e('0x2b')),[_0x755e('0x2b')]);_0x9f70ba[_0x755e('0x34')]=_['keys'](_0x5b5ee5[_0x755e('0x34')]);_0x9f70ba[_0x755e('0x35')]=_[_0x755e('0x36')](_0x9f70ba[_0x755e('0x33')],_0x9f70ba[_0x755e('0x34')]);_0x181a6[_0x755e('0x37')]=_[_0x755e('0x36')](_0x9f70ba[_0x755e('0x33')],qs[_0x755e('0x38')](_0x5b5ee5['query']['fields']));_0x181a6['attributes']=_0x181a6[_0x755e('0x37')][_0x755e('0x39')]?_0x181a6['attributes']:_0x9f70ba[_0x755e('0x33')];if(!_0x5b5ee5['query'][_0x755e('0x3a')](_0x755e('0x3b'))){_0x181a6[_0x755e('0x20')]=qs[_0x755e('0x20')](_0x5b5ee5['query']['limit']);_0x181a6[_0x755e('0x1e')]=qs['offset'](_0x5b5ee5['query'][_0x755e('0x1e')]);}_0x181a6[_0x755e('0x3c')]=qs[_0x755e('0x3d')](_0x5b5ee5[_0x755e('0x34')][_0x755e('0x3d')]);_0x181a6[_0x755e('0x3e')]=qs[_0x755e('0x35')](_[_0x755e('0x3f')](_0x5b5ee5[_0x755e('0x34')],_0x9f70ba[_0x755e('0x35')]),_0xd57329);if(_0x5b5ee5[_0x755e('0x34')][_0x755e('0x40')]){_0x181a6[_0x755e('0x3e')]=_[_0x755e('0x41')](_0x181a6[_0x755e('0x3e')],{'$or':_[_0x755e('0x2e')](_0xd57329,function(_0x4528a5){if(_0x4528a5[_0x755e('0x31')]!==_0x755e('0x42')){var _0x15a4e9={};_0x15a4e9[_0x4528a5[_0x755e('0x2b')]]={'$like':'%'+_0x5b5ee5[_0x755e('0x34')]['filter']+'%'};return _0x15a4e9;}})});}_0x181a6=_[_0x755e('0x41')]({},_0x181a6,_0x5b5ee5[_0x755e('0x43')]);var _0x3f315f={'where':_0x181a6[_0x755e('0x3e')]};return db[_0x755e('0x44')][_0x755e('0x21')](_0x3f315f)[_0x755e('0x27')](function(_0xc85bfd){_0x249499[_0x755e('0x21')]=_0xc85bfd;if(_0x5b5ee5[_0x755e('0x34')][_0x755e('0x45')]){_0x181a6[_0x755e('0x46')]=[{'all':!![]}];}return db[_0x755e('0x44')][_0x755e('0x47')](_0x181a6);})[_0x755e('0x27')](function(_0x5cd51e){_0x249499[_0x755e('0x48')]=_0x5cd51e;return _0x249499;})[_0x755e('0x27')](respondWithFilteredResult(_0xc254d6,_0x181a6))['catch'](handleError(_0xc254d6,null));};exports[_0x755e('0x49')]=function(_0x5ddab4,_0x269ce2){var _0x5d79ed={'raw':!![],'where':{'id':_0x5ddab4[_0x755e('0x4a')]['id']}},_0x18017e={};_0x18017e[_0x755e('0x33')]=_['keys'](db[_0x755e('0x44')]['rawAttributes']);_0x18017e[_0x755e('0x34')]=_[_0x755e('0x4b')](_0x5ddab4[_0x755e('0x34')]);_0x18017e[_0x755e('0x35')]=_['intersection'](_0x18017e[_0x755e('0x33')],_0x18017e[_0x755e('0x34')]);_0x5d79ed['attributes']=_[_0x755e('0x36')](_0x18017e['model'],qs['fields'](_0x5ddab4[_0x755e('0x34')]['fields']));_0x5d79ed[_0x755e('0x37')]=_0x5d79ed[_0x755e('0x37')][_0x755e('0x39')]?_0x5d79ed[_0x755e('0x37')]:_0x18017e[_0x755e('0x33')];if(_0x5ddab4[_0x755e('0x34')][_0x755e('0x45')]){_0x5d79ed['include']=[{'all':!![]}];}_0x5d79ed=_[_0x755e('0x41')]({},_0x5d79ed,_0x5ddab4[_0x755e('0x43')]);return db[_0x755e('0x44')][_0x755e('0x4c')](_0x5d79ed)[_0x755e('0x27')](handleEntityNotFound(_0x269ce2,null))[_0x755e('0x27')](respondWithResult(_0x269ce2,null))['catch'](handleError(_0x269ce2,null));};exports[_0x755e('0x4d')]=function(_0x1b4001,_0xdd1822){if(_0x1b4001[_0x755e('0x4e')]['id']){delete _0x1b4001[_0x755e('0x4e')]['id'];}return db[_0x755e('0x44')][_0x755e('0x4c')]({'where':{'id':_0x1b4001['params']['id']}})[_0x755e('0x27')](handleEntityNotFound(_0xdd1822,null))[_0x755e('0x27')](saveUpdates(_0x1b4001['body'],null))['then'](respondWithResult(_0xdd1822,null))['catch'](handleError(_0xdd1822,null));};exports['destroy']=function(_0x2b08cf,_0x5af2b4){return db[_0x755e('0x44')][_0x755e('0x4c')]({'where':{'id':_0x2b08cf[_0x755e('0x4a')]['id']}})[_0x755e('0x27')](handleEntityNotFound(_0x5af2b4,null))['then'](removeEntity(_0x5af2b4,null))['catch'](handleError(_0x5af2b4,null));};exports[_0x755e('0x4f')]=function(_0x349a7f,_0x2208f4){var _0x34a1b6;return db['sequelize'][_0x755e('0x50')](function(_0x4f4b79){return db['CmCustomField'][_0x755e('0x4f')](_0x349a7f[_0x755e('0x4e')],{'transaction':_0x4f4b79})[_0x755e('0x27')](function(_0x38233d){_0x34a1b6=_0x38233d;var _0x30c63d={'type':db[_0x755e('0x51')]['TEXT'],'transaction':_0x4f4b79};switch(_0x349a7f['body'][_0x755e('0x31')]){case _0x755e('0x52'):_0x30c63d[_0x755e('0x31')]=db['Sequelize'][_0x755e('0x53')];break;case _0x755e('0x54'):_0x30c63d[_0x755e('0x31')]=db[_0x755e('0x51')][_0x755e('0x55')];break;case'switch':_0x30c63d[_0x755e('0x31')]=db['Sequelize'][_0x755e('0x56')];_0x30c63d[_0x755e('0x57')]=![];break;default:}return db[_0x755e('0x58')]['queryInterface'][_0x755e('0x59')]('cm_contacts',util[_0x755e('0x5a')](_0x755e('0x5b'),_0x34a1b6['id']),_0x30c63d);})['then'](function(){return _0x34a1b6;});})[_0x755e('0x27')](respondWithResult(_0x2208f4,0xc9))[_0x755e('0x5c')](handleError(_0x2208f4,null));}; \ No newline at end of file +var _0x69cf=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','destroy','error','name','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','include','CmCustomField','catch','show','options','find','body','params','create','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x306095,_0x21cbce){var _0x3ac326=function(_0x1f054a){while(--_0x1f054a){_0x306095['push'](_0x306095['shift']());}};_0x3ac326(++_0x21cbce);}(_0x69cf,0xa3));var _0xf69c=function(_0x1e2bbe,_0x4df37d){_0x1e2bbe=_0x1e2bbe-0x0;var _0x435438=_0x69cf[_0x1e2bbe];return _0x435438;};'use strict';var emlformat=require(_0xf69c('0x0'));var rimraf=require(_0xf69c('0x1'));var zipdir=require(_0xf69c('0x2'));var jsonpatch=require(_0xf69c('0x3'));var rp=require(_0xf69c('0x4'));var moment=require(_0xf69c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf69c('0x6'));var util=require(_0xf69c('0x7'));var path=require(_0xf69c('0x8'));var sox=require(_0xf69c('0x9'));var csv=require(_0xf69c('0xa'));var ejs=require(_0xf69c('0xb'));var fs=require('fs');var fs_extra=require(_0xf69c('0xc'));var _=require(_0xf69c('0xd'));var squel=require(_0xf69c('0xe'));var crypto=require(_0xf69c('0xf'));var jsforce=require(_0xf69c('0x10'));var deskjs=require(_0xf69c('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf69c('0x12'));var Papa=require(_0xf69c('0x13'));var Redis=require(_0xf69c('0x14'));var authService=require(_0xf69c('0x15'));var qs=require(_0xf69c('0x16'));var as=require(_0xf69c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf69c('0x18'));var config=require(_0xf69c('0x19'));var licenseUtil=require(_0xf69c('0x1a'));var db=require(_0xf69c('0x1b'))['db'];function respondWithStatusCode(_0x2aeb86,_0x1338b5){_0x1338b5=_0x1338b5||0xcc;return function(_0xd6998b){if(_0xd6998b){return _0x2aeb86[_0xf69c('0x1c')](_0x1338b5);}return _0x2aeb86[_0xf69c('0x1d')](_0x1338b5)[_0xf69c('0x1e')]();};}function respondWithResult(_0x13e881,_0x5c5113){_0x5c5113=_0x5c5113||0xc8;return function(_0x26649c){if(_0x26649c){return _0x13e881['status'](_0x5c5113)['json'](_0x26649c);}};}function respondWithFilteredResult(_0x48f78c,_0x1a2a40){return function(_0x19b683){if(_0x19b683){var _0x4c27f6=typeof _0x1a2a40['offset']===_0xf69c('0x1f')&&typeof _0x1a2a40[_0xf69c('0x20')]==='undefined';var _0x2213ed=_0x19b683[_0xf69c('0x21')];var _0x549cde=_0x4c27f6?0x0:_0x1a2a40[_0xf69c('0x22')];var _0x52bbac=_0x4c27f6?_0x19b683['count']:_0x1a2a40[_0xf69c('0x22')]+_0x1a2a40[_0xf69c('0x20')];var _0xdef25a;if(_0x52bbac>=_0x2213ed){_0x52bbac=_0x2213ed;_0xdef25a=0xc8;}else{_0xdef25a=0xce;}_0x48f78c['status'](_0xdef25a);return _0x48f78c[_0xf69c('0x23')]('Content-Range',_0x549cde+'-'+_0x52bbac+'/'+_0x2213ed)[_0xf69c('0x24')](_0x19b683);}return null;};}function patchUpdates(_0x1aefb6){return function(_0x4c88c1){try{jsonpatch[_0xf69c('0x25')](_0x4c88c1,_0x1aefb6,!![]);}catch(_0x8e608){return BPromise[_0xf69c('0x26')](_0x8e608);}return _0x4c88c1['save']();};}function saveUpdates(_0x1bf0ac,_0x14a193){return function(_0x475d2e){if(_0x475d2e){return _0x475d2e[_0xf69c('0x27')](_0x1bf0ac)['then'](function(_0x582cae){return _0x582cae;});}return null;};}function removeEntity(_0x31a23d,_0x2a32b2){return function(_0x807553){if(_0x807553){return _0x807553[_0xf69c('0x28')]()['then'](function(){_0x31a23d['status'](0xcc)[_0xf69c('0x1e')]();});}};}function handleEntityNotFound(_0x213ae7,_0x126b49){return function(_0x311ceb){if(!_0x311ceb){_0x213ae7[_0xf69c('0x1c')](0x194);}return _0x311ceb;};}function handleError(_0x117f53,_0x48d511){_0x48d511=_0x48d511||0x1f4;return function(_0x4581cd){logger[_0xf69c('0x29')](_0x4581cd['stack']);if(_0x4581cd['name']){delete _0x4581cd[_0xf69c('0x2a')];}_0x117f53['status'](_0x48d511)['send'](_0x4581cd);};}exports[_0xf69c('0x2b')]=function(_0x517717,_0x1e4289){var _0x1cb838={},_0x63e5ee={},_0x55cc0c={'count':0x0,'rows':[]};var _0x5e4416=_[_0xf69c('0x2c')](db['CmCustomField'][_0xf69c('0x2d')],function(_0x17a476){return{'name':_0x17a476[_0xf69c('0x2e')],'type':_0x17a476['type'][_0xf69c('0x2f')]};});_0x63e5ee['model']=_[_0xf69c('0x30')](_[_0xf69c('0x2c')](_0x5e4416,_0xf69c('0x2a')),[_0xf69c('0x2a')]);_0x63e5ee[_0xf69c('0x31')]=_[_0xf69c('0x32')](_0x517717[_0xf69c('0x31')]);_0x63e5ee[_0xf69c('0x33')]=_[_0xf69c('0x34')](_0x63e5ee[_0xf69c('0x35')],_0x63e5ee[_0xf69c('0x31')]);_0x1cb838[_0xf69c('0x36')]=_[_0xf69c('0x34')](_0x63e5ee[_0xf69c('0x35')],qs[_0xf69c('0x37')](_0x517717[_0xf69c('0x31')][_0xf69c('0x37')]));_0x1cb838[_0xf69c('0x36')]=_0x1cb838[_0xf69c('0x36')][_0xf69c('0x38')]?_0x1cb838[_0xf69c('0x36')]:_0x63e5ee[_0xf69c('0x35')];if(!_0x517717['query'][_0xf69c('0x39')]('nolimit')){_0x1cb838[_0xf69c('0x20')]=qs[_0xf69c('0x20')](_0x517717[_0xf69c('0x31')][_0xf69c('0x20')]);_0x1cb838[_0xf69c('0x22')]=qs[_0xf69c('0x22')](_0x517717[_0xf69c('0x31')][_0xf69c('0x22')]);}_0x1cb838[_0xf69c('0x3a')]=qs['sort'](_0x517717[_0xf69c('0x31')][_0xf69c('0x3b')]);_0x1cb838[_0xf69c('0x3c')]=qs[_0xf69c('0x33')](_[_0xf69c('0x3d')](_0x517717[_0xf69c('0x31')],_0x63e5ee['filters']),_0x5e4416);if(_0x517717[_0xf69c('0x31')][_0xf69c('0x3e')]){_0x1cb838['where']=_[_0xf69c('0x3f')](_0x1cb838[_0xf69c('0x3c')],{'$or':_[_0xf69c('0x2c')](_0x5e4416,function(_0x2ef22c){if(_0x2ef22c[_0xf69c('0x40')]!==_0xf69c('0x41')){var _0x3941d3={};_0x3941d3[_0x2ef22c['name']]={'$like':'%'+_0x517717[_0xf69c('0x31')]['filter']+'%'};return _0x3941d3;}})});}_0x1cb838=_[_0xf69c('0x3f')]({},_0x1cb838,_0x517717['options']);var _0x4519c2={'where':_0x1cb838[_0xf69c('0x3c')]};return db['CmCustomField']['count'](_0x4519c2)[_0xf69c('0x42')](function(_0x2ecb15){_0x55cc0c[_0xf69c('0x21')]=_0x2ecb15;if(_0x517717['query'][_0xf69c('0x43')]){_0x1cb838[_0xf69c('0x44')]=[{'all':!![]}];}return db[_0xf69c('0x45')]['findAll'](_0x1cb838);})[_0xf69c('0x42')](function(_0x3723ce){_0x55cc0c['rows']=_0x3723ce;return _0x55cc0c;})[_0xf69c('0x42')](respondWithFilteredResult(_0x1e4289,_0x1cb838))[_0xf69c('0x46')](handleError(_0x1e4289,null));};exports[_0xf69c('0x47')]=function(_0x375e96,_0xf0fad0){var _0x196257={'raw':!![],'where':{'id':_0x375e96['params']['id']}},_0x4409ec={};_0x4409ec[_0xf69c('0x35')]=_[_0xf69c('0x32')](db['CmCustomField'][_0xf69c('0x2d')]);_0x4409ec[_0xf69c('0x31')]=_[_0xf69c('0x32')](_0x375e96[_0xf69c('0x31')]);_0x4409ec[_0xf69c('0x33')]=_[_0xf69c('0x34')](_0x4409ec[_0xf69c('0x35')],_0x4409ec[_0xf69c('0x31')]);_0x196257[_0xf69c('0x36')]=_[_0xf69c('0x34')](_0x4409ec[_0xf69c('0x35')],qs[_0xf69c('0x37')](_0x375e96[_0xf69c('0x31')][_0xf69c('0x37')]));_0x196257[_0xf69c('0x36')]=_0x196257['attributes']['length']?_0x196257[_0xf69c('0x36')]:_0x4409ec[_0xf69c('0x35')];if(_0x375e96[_0xf69c('0x31')][_0xf69c('0x43')]){_0x196257[_0xf69c('0x44')]=[{'all':!![]}];}_0x196257=_[_0xf69c('0x3f')]({},_0x196257,_0x375e96[_0xf69c('0x48')]);return db[_0xf69c('0x45')][_0xf69c('0x49')](_0x196257)['then'](handleEntityNotFound(_0xf0fad0,null))[_0xf69c('0x42')](respondWithResult(_0xf0fad0,null))['catch'](handleError(_0xf0fad0,null));};exports[_0xf69c('0x27')]=function(_0xfa2083,_0x2b6ffc){if(_0xfa2083[_0xf69c('0x4a')]['id']){delete _0xfa2083['body']['id'];}return db['CmCustomField'][_0xf69c('0x49')]({'where':{'id':_0xfa2083[_0xf69c('0x4b')]['id']}})[_0xf69c('0x42')](handleEntityNotFound(_0x2b6ffc,null))[_0xf69c('0x42')](saveUpdates(_0xfa2083['body'],null))[_0xf69c('0x42')](respondWithResult(_0x2b6ffc,null))['catch'](handleError(_0x2b6ffc,null));};exports[_0xf69c('0x28')]=function(_0xafc888,_0x3f0bbf){return db[_0xf69c('0x45')]['find']({'where':{'id':_0xafc888[_0xf69c('0x4b')]['id']}})[_0xf69c('0x42')](handleEntityNotFound(_0x3f0bbf,null))['then'](removeEntity(_0x3f0bbf,null))['catch'](handleError(_0x3f0bbf,null));};exports[_0xf69c('0x4c')]=function(_0x50ac52,_0x246587){var _0x4ba0a5;return db['sequelize']['transaction'](function(_0xa384e4){return db[_0xf69c('0x45')][_0xf69c('0x4c')](_0x50ac52[_0xf69c('0x4a')],{'transaction':_0xa384e4})[_0xf69c('0x42')](function(_0x4507de){_0x4ba0a5=_0x4507de;var _0xcdb718={'type':db['Sequelize'][_0xf69c('0x4d')],'transaction':_0xa384e4};switch(_0x50ac52[_0xf69c('0x4a')][_0xf69c('0x40')]){case _0xf69c('0x4e'):_0xcdb718[_0xf69c('0x40')]=db['Sequelize'][_0xf69c('0x4d')];break;case'number':_0xcdb718['type']=db[_0xf69c('0x4f')][_0xf69c('0x50')];break;case _0xf69c('0x51'):_0xcdb718['type']=db['Sequelize'][_0xf69c('0x52')];_0xcdb718[_0xf69c('0x53')]=![];break;default:}return db[_0xf69c('0x54')][_0xf69c('0x55')]['addColumn']('cm_contacts',util[_0xf69c('0x56')](_0xf69c('0x57'),_0x4ba0a5['id']),_0xcdb718);})['then'](function(){return _0x4ba0a5;});})[_0xf69c('0x42')](respondWithResult(_0x246587,0xc9))['catch'](handleError(_0x246587,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 3f0b820..88dd45d 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 _0x54d2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField'];(function(_0x2a5a0f,_0x3f549c){var _0x46845d=function(_0x195fcf){while(--_0x195fcf){_0x2a5a0f['push'](_0x2a5a0f['shift']());}};_0x46845d(++_0x3f549c);}(_0x54d2,0x13f));var _0x254d=function(_0x40d8aa,_0x4621a1){_0x40d8aa=_0x40d8aa-0x0;var _0x29a783=_0x54d2[_0x40d8aa];return _0x29a783;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x254d('0x0'))(_0x254d('0x1'));var moment=require(_0x254d('0x2'));var BPromise=require(_0x254d('0x3'));var rp=require(_0x254d('0x4'));var fs=require('fs');var path=require(_0x254d('0x5'));var rimraf=require(_0x254d('0x6'));var config=require(_0x254d('0x7'));var attributes=require(_0x254d('0x8'));module['exports']=function(_0x663df9,_0x2af3f3){return _0x663df9[_0x254d('0x9')](_0x254d('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc57=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x23e5f8,_0xecf14a){var _0x131a58=function(_0x49a338){while(--_0x49a338){_0x23e5f8['push'](_0x23e5f8['shift']());}};_0x131a58(++_0xecf14a);}(_0xbc57,0x98));var _0x7bc5=function(_0x40063e,_0x542fae){_0x40063e=_0x40063e-0x0;var _0x2b6c67=_0xbc57[_0x40063e];return _0x2b6c67;};'use strict';var _=require(_0x7bc5('0x0'));var util=require(_0x7bc5('0x1'));var logger=require(_0x7bc5('0x2'))('api');var moment=require(_0x7bc5('0x3'));var BPromise=require(_0x7bc5('0x4'));var rp=require(_0x7bc5('0x5'));var fs=require('fs');var path=require(_0x7bc5('0x6'));var rimraf=require('rimraf');var config=require(_0x7bc5('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x3882a1,_0x3f9c2f){return _0x3882a1[_0x7bc5('0x8')](_0x7bc5('0x9'),attributes,{'tableName':_0x7bc5('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 23ac568..9c697f2 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 _0x91e4=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x1f7a5f,_0x109eb1){var _0xf0530e=function(_0x4d4a37){while(--_0x4d4a37){_0x1f7a5f['push'](_0x1f7a5f['shift']());}};_0xf0530e(++_0x109eb1);}(_0x91e4,0x1e4));var _0x491e=function(_0x479e8c,_0x3f3ace){_0x479e8c=_0x479e8c-0x0;var _0x3b2453=_0x91e4[_0x479e8c];return _0x3b2453;};'use strict';var _=require(_0x491e('0x0'));var util=require(_0x491e('0x1'));var moment=require(_0x491e('0x2'));var BPromise=require(_0x491e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x491e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x491e('0x5'))(_0x491e('0x6'));var config=require(_0x491e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x491e('0x8')][_0x491e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x458913,_0x8b8787,_0x1fec89){return new BPromise(function(_0x23b388,_0x480585){return client[_0x491e('0xa')](_0x458913,_0x1fec89)[_0x491e('0xb')](function(_0x31dcc9){logger[_0x491e('0xc')](_0x491e('0xd'),_0x8b8787,_0x491e('0xe'));logger[_0x491e('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x8b8787,_0x491e('0xe'),JSON[_0x491e('0x10')](_0x31dcc9));if(_0x31dcc9[_0x491e('0x11')]){if(_0x31dcc9[_0x491e('0x11')]['code']===0x1f4){logger[_0x491e('0x11')]('CmCustomField,\x20%s,\x20%s',_0x8b8787,_0x31dcc9[_0x491e('0x11')][_0x491e('0x12')]);return _0x480585(_0x31dcc9[_0x491e('0x11')][_0x491e('0x12')]);}logger['error'](_0x491e('0xd'),_0x8b8787,_0x31dcc9[_0x491e('0x11')][_0x491e('0x12')]);return _0x23b388(_0x31dcc9[_0x491e('0x11')][_0x491e('0x12')]);}else{logger[_0x491e('0xc')](_0x491e('0xd'),_0x8b8787,_0x491e('0xe'));_0x23b388(_0x31dcc9[_0x491e('0x13')][_0x491e('0x12')]);}})[_0x491e('0x14')](function(_0x1c036c){logger[_0x491e('0x11')](_0x491e('0xd'),_0x8b8787,_0x1c036c);_0x480585(_0x1c036c);});});} \ No newline at end of file +var _0xdd0e=['CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s'];(function(_0x2d3686,_0x41cf63){var _0x27745f=function(_0xfe9054){while(--_0xfe9054){_0x2d3686['push'](_0x2d3686['shift']());}};_0x27745f(++_0x41cf63);}(_0xdd0e,0x1d5));var _0xedd0=function(_0x2b9c6f,_0x52b826){_0x2b9c6f=_0x2b9c6f-0x0;var _0x2c9c10=_0xdd0e[_0x2b9c6f];return _0x2c9c10;};'use strict';var _=require(_0xedd0('0x0'));var util=require(_0xedd0('0x1'));var moment=require(_0xedd0('0x2'));var BPromise=require(_0xedd0('0x3'));var rs=require(_0xedd0('0x4'));var fs=require('fs');var Redis=require(_0xedd0('0x5'));var db=require(_0xedd0('0x6'))['db'];var utils=require(_0xedd0('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xedd0('0x8'));var client=jayson[_0xedd0('0x9')][_0xedd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f323b,_0x5f12e8,_0x51e698){return new BPromise(function(_0xaabd58,_0x1d233c){return client[_0xedd0('0xb')](_0x1f323b,_0x51e698)[_0xedd0('0xc')](function(_0x4c3093){logger['info'](_0xedd0('0xd'),_0x5f12e8,'request\x20sent');logger['debug'](_0xedd0('0xe'),_0x5f12e8,_0xedd0('0xf'),JSON['stringify'](_0x4c3093));if(_0x4c3093[_0xedd0('0x10')]){if(_0x4c3093['error']['code']===0x1f4){logger[_0xedd0('0x10')](_0xedd0('0xd'),_0x5f12e8,_0x4c3093[_0xedd0('0x10')][_0xedd0('0x11')]);return _0x1d233c(_0x4c3093[_0xedd0('0x10')]['message']);}logger['error'](_0xedd0('0xd'),_0x5f12e8,_0x4c3093['error'][_0xedd0('0x11')]);return _0xaabd58(_0x4c3093[_0xedd0('0x10')][_0xedd0('0x11')]);}else{logger[_0xedd0('0x12')]('CmCustomField,\x20%s,\x20%s',_0x5f12e8,_0xedd0('0xf'));_0xaabd58(_0x4c3093[_0xedd0('0x13')][_0xedd0('0x11')]);}})[_0xedd0('0x14')](function(_0x2c226a){logger[_0xedd0('0x10')](_0xedd0('0xd'),_0x5f12e8,_0x2c226a);_0x1d233c(_0x2c226a);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 11ccd6a..707024f 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 _0x0be3=['./cmCustomField.controller','index','get','isAuthenticated','show','post','create','put','/:id','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x241ac8,_0x271141){var _0x3aa7b8=function(_0x490fc7){while(--_0x490fc7){_0x241ac8['push'](_0x241ac8['shift']());}};_0x3aa7b8(++_0x271141);}(_0x0be3,0x9a));var _0x30be=function(_0x2f7892,_0x1c26c5){_0x2f7892=_0x2f7892-0x0;var _0x2f9e9c=_0x0be3[_0x2f7892];return _0x2f9e9c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30be('0x0'));var timeout=require(_0x30be('0x1'));var express=require(_0x30be('0x2'));var router=express['Router']();var fs_extra=require(_0x30be('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x30be('0x4'));var config=require(_0x30be('0x5'));var controller=require(_0x30be('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x30be('0x7')]);router[_0x30be('0x8')]('/:id',auth[_0x30be('0x9')](),controller[_0x30be('0xa')]);router[_0x30be('0xb')]('/',auth['isAuthenticated'](),controller[_0x30be('0xc')]);router[_0x30be('0xd')](_0x30be('0xe'),auth[_0x30be('0x9')](),controller['update']);router['delete']('/:id',auth[_0x30be('0x9')](),controller['destroy']);module[_0x30be('0xf')]=router; \ No newline at end of file +var _0x6c84=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0xe7650f,_0x542351){var _0x590017=function(_0x430d8c){while(--_0x430d8c){_0xe7650f['push'](_0xe7650f['shift']());}};_0x590017(++_0x542351);}(_0x6c84,0x112));var _0x46c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c84[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var path=require(_0x46c8('0x2'));var timeout=require(_0x46c8('0x3'));var express=require(_0x46c8('0x4'));var router=express['Router']();var fs_extra=require(_0x46c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x46c8('0x6'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x46c8('0x7')]('/',auth[_0x46c8('0x8')](),controller[_0x46c8('0x9')]);router[_0x46c8('0x7')](_0x46c8('0xa'),auth[_0x46c8('0x8')](),controller[_0x46c8('0xb')]);router[_0x46c8('0xc')]('/',auth['isAuthenticated'](),controller[_0x46c8('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x46c8('0xe')]);router['delete'](_0x46c8('0xa'),auth[_0x46c8('0x8')](),controller[_0x46c8('0xf')]);module[_0x46c8('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 2206b90..927c746 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 _0x1df8=['sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1df8,0x135));var _0x81df=function(_0x128b4f,_0x47ab41){_0x128b4f=_0x128b4f-0x0;var _0x262d44=_0x1df8[_0x128b4f];return _0x262d44;};'use strict';var moment=require(_0x81df('0x0'));var Sequelize=require(_0x81df('0x1'));module['exports']={'phone':{'type':Sequelize[_0x81df('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x81df('0x3')],'defaultValue':moment()[_0x81df('0x4')](_0x81df('0x5'))},'countbusyretry':{'type':Sequelize[_0x81df('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x81df('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x81df('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x81df('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x81df('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x81df('0x3')]},'priority':{'type':Sequelize[_0x81df('0x6')](0x2)[_0x81df('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x81df('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x81df('0x6')],'unique':_0x81df('0x9')},'ListId':{'type':Sequelize[_0x81df('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x81df('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x81df('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x81df('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x81df('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6e93=['INTEGER','BOOLEAN','contactListQueue','exports','STRING'];(function(_0x1ec685,_0x5e97e8){var _0x48d5be=function(_0x29464f){while(--_0x29464f){_0x1ec685['push'](_0x1ec685['shift']());}};_0x48d5be(++_0x5e97e8);}(_0x6e93,0x143));var _0x36e9=function(_0x21a07c,_0x1e5671){_0x21a07c=_0x21a07c-0x0;var _0x3b8248=_0x6e93[_0x21a07c];return _0x3b8248;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x36e9('0x0')]={'phone':{'type':Sequelize[_0x36e9('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x36e9('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x36e9('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x36e9('0x2')],'unique':_0x36e9('0x4')},'ListId':{'type':Sequelize[_0x36e9('0x2')],'unique':_0x36e9('0x4')},'UserId':{'type':Sequelize[_0x36e9('0x2')]},'VoiceQueueId':{'type':Sequelize[_0x36e9('0x2')],'unique':_0x36e9('0x4')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x36e9('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 98a0f47..9f3d4e9 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 _0xd4ab=['$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','dataValues','updatedAt','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','lastName','calleridname','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopper','rawAttributes','model','query','keys','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$ne','$not','$notBetween','$notIn','$like'];(function(_0x2cd814,_0x5c5066){var _0x4f0058=function(_0xad0f81){while(--_0xad0f81){_0x2cd814['push'](_0x2cd814['shift']());}};_0x4f0058(++_0x5c5066);}(_0xd4ab,0x173));var _0xbd4a=function(_0x4d590c,_0x30fc6b){_0x4d590c=_0x4d590c-0x0;var _0x42a0f4=_0xd4ab[_0x4d590c];return _0x42a0f4;};'use strict';var emlformat=require(_0xbd4a('0x0'));var rimraf=require(_0xbd4a('0x1'));var zipdir=require(_0xbd4a('0x2'));var jsonpatch=require(_0xbd4a('0x3'));var rp=require(_0xbd4a('0x4'));var moment=require(_0xbd4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbd4a('0x6'));var path=require(_0xbd4a('0x7'));var sox=require('sox');var csv=require(_0xbd4a('0x8'));var ejs=require(_0xbd4a('0x9'));var fs=require('fs');var fs_extra=require(_0xbd4a('0xa'));var _=require(_0xbd4a('0xb'));var squel=require(_0xbd4a('0xc'));var crypto=require('crypto');var jsforce=require(_0xbd4a('0xd'));var deskjs=require(_0xbd4a('0xe'));var toCsv=require(_0xbd4a('0x8'));var querystring=require(_0xbd4a('0xf'));var Papa=require(_0xbd4a('0x10'));var Redis=require(_0xbd4a('0x11'));var authService=require(_0xbd4a('0x12'));var qs=require(_0xbd4a('0x13'));var as=require(_0xbd4a('0x14'));var hardwareService=require(_0xbd4a('0x15'));var logger=require(_0xbd4a('0x16'))('api');var utils=require(_0xbd4a('0x17'));var config=require(_0xbd4a('0x18'));var licenseUtil=require(_0xbd4a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dac37,_0x5b48d4){_0x5b48d4=_0x5b48d4||0xcc;return function(_0x2cbe12){if(_0x2cbe12){return _0x1dac37[_0xbd4a('0x1a')](_0x5b48d4);}return _0x1dac37[_0xbd4a('0x1b')](_0x5b48d4)['end']();};}function respondWithResult(_0x5f0138,_0x53e639){_0x53e639=_0x53e639||0xc8;return function(_0x155a4e){if(_0x155a4e){return _0x5f0138[_0xbd4a('0x1b')](_0x53e639)['json'](_0x155a4e);}};}function respondWithFilteredResult(_0x5ddc43,_0x3c9a9a){return function(_0x42ad0e){if(_0x42ad0e){var _0x254e8e=typeof _0x3c9a9a[_0xbd4a('0x1c')]==='undefined'&&typeof _0x3c9a9a[_0xbd4a('0x1d')]===_0xbd4a('0x1e');var _0x3f2e47=_0x42ad0e[_0xbd4a('0x1f')];var _0x157346=_0x254e8e?0x0:_0x3c9a9a[_0xbd4a('0x1c')];var _0x464d8d=_0x254e8e?_0x42ad0e[_0xbd4a('0x1f')]:_0x3c9a9a[_0xbd4a('0x1c')]+_0x3c9a9a[_0xbd4a('0x1d')];var _0xfd652e;if(_0x464d8d>=_0x3f2e47){_0x464d8d=_0x3f2e47;_0xfd652e=0xc8;}else{_0xfd652e=0xce;}_0x5ddc43[_0xbd4a('0x1b')](_0xfd652e);return _0x5ddc43[_0xbd4a('0x20')](_0xbd4a('0x21'),_0x157346+'-'+_0x464d8d+'/'+_0x3f2e47)[_0xbd4a('0x22')](_0x42ad0e);}return null;};}function patchUpdates(_0x417d2c){return function(_0x11766e){try{jsonpatch['apply'](_0x11766e,_0x417d2c,!![]);}catch(_0x829a10){return BPromise[_0xbd4a('0x23')](_0x829a10);}return _0x11766e[_0xbd4a('0x24')]();};}function saveUpdates(_0x5b2c32,_0x5ea156){return function(_0x4f88aa){if(_0x4f88aa){return _0x4f88aa[_0xbd4a('0x25')](_0x5b2c32)[_0xbd4a('0x26')](function(_0x4c0524){return _0x4c0524;});}return null;};}function removeEntity(_0x4269db,_0x248180){return function(_0x231f6b){if(_0x231f6b){return _0x231f6b[_0xbd4a('0x27')]()['then'](function(){_0x4269db[_0xbd4a('0x1b')](0xcc)[_0xbd4a('0x28')]();});}};}function handleEntityNotFound(_0x16c79d,_0x21e990){return function(_0x292cfe){if(!_0x292cfe){_0x16c79d['sendStatus'](0x194);}return _0x292cfe;};}function handleError(_0x5eaef9,_0x96702){_0x96702=_0x96702||0x1f4;return function(_0x1b5949){logger[_0xbd4a('0x29')](_0x1b5949['stack']);if(_0x1b5949[_0xbd4a('0x2a')]){delete _0x1b5949['name'];}_0x5eaef9[_0xbd4a('0x1b')](_0x96702)[_0xbd4a('0x2b')](_0x1b5949);};}exports[_0xbd4a('0x2c')]=function(_0xbaf06b,_0x50f817){var _0x594a45={},_0x188ff8={},_0x228121={'count':0x0,'rows':[]};var _0xebefbb=_[_0xbd4a('0x2d')](db[_0xbd4a('0x2e')][_0xbd4a('0x2f')],function(_0x1a4d82){return{'name':_0x1a4d82['fieldName'],'type':_0x1a4d82['type']['key']};});_0x188ff8[_0xbd4a('0x30')]=_[_0xbd4a('0x2d')](_0xebefbb,_0xbd4a('0x2a'));_0x188ff8[_0xbd4a('0x31')]=_[_0xbd4a('0x32')](_0xbaf06b[_0xbd4a('0x31')]);_0x188ff8[_0xbd4a('0x33')]=_[_0xbd4a('0x34')](_0x188ff8['model'],_0x188ff8['query']);_0x188ff8['filters']=_[_0xbd4a('0x35')](_0x188ff8[_0xbd4a('0x33')],[_0xbd4a('0x36'),_0xbd4a('0x37'),_0xbd4a('0x38'),'$gte',_0xbd4a('0x39'),_0xbd4a('0x3a'),_0xbd4a('0x3b'),'$eq',_0xbd4a('0x3c'),'$between',_0xbd4a('0x3d'),'$in',_0xbd4a('0x3e'),_0xbd4a('0x3f'),_0xbd4a('0x40'),_0xbd4a('0x41'),_0xbd4a('0x42'),_0xbd4a('0x3f'),'$overlap',_0xbd4a('0x43'),_0xbd4a('0x44'),_0xbd4a('0x45')]);_0x594a45[_0xbd4a('0x46')]=_['intersection'](_0x188ff8[_0xbd4a('0x30')],qs[_0xbd4a('0x47')](_0xbaf06b['query']['fields']));_0x594a45[_0xbd4a('0x46')]=_0x594a45['attributes'][_0xbd4a('0x48')]?_0x594a45[_0xbd4a('0x46')]:_0x188ff8[_0xbd4a('0x30')];if(!_0xbaf06b[_0xbd4a('0x31')][_0xbd4a('0x49')]('nolimit')){_0x594a45[_0xbd4a('0x1d')]=qs['limit'](_0xbaf06b['query'][_0xbd4a('0x1d')]);_0x594a45[_0xbd4a('0x1c')]=qs['offset'](_0xbaf06b[_0xbd4a('0x31')][_0xbd4a('0x1c')]);}_0x594a45[_0xbd4a('0x4a')]=qs['sort'](_0xbaf06b[_0xbd4a('0x31')][_0xbd4a('0x4b')]);_0x594a45[_0xbd4a('0x4c')]=qs['filters'](_['pick'](_0xbaf06b[_0xbd4a('0x31')],_0x188ff8[_0xbd4a('0x33')]),_0xebefbb);if(_0xbaf06b[_0xbd4a('0x31')]['filter']){_0x594a45[_0xbd4a('0x4c')]=_[_0xbd4a('0x4d')](_0x594a45[_0xbd4a('0x4c')],{'$or':_[_0xbd4a('0x2d')](_0xebefbb,function(_0x5d58a6){if(_0x5d58a6[_0xbd4a('0x4e')]!==_0xbd4a('0x4f')){var _0x4076b4={};_0x4076b4[_0x5d58a6[_0xbd4a('0x2a')]]={'$like':'%'+_0xbaf06b['query'][_0xbd4a('0x50')]+'%'};return _0x4076b4;}})});}_0x594a45=_[_0xbd4a('0x4d')]({},_0x594a45,_0xbaf06b[_0xbd4a('0x51')]);var _0x45e6e1={'where':_0x594a45[_0xbd4a('0x4c')]};return db[_0xbd4a('0x2e')][_0xbd4a('0x1f')](_0x45e6e1)[_0xbd4a('0x26')](function(_0xfee35d){_0x228121[_0xbd4a('0x1f')]=_0xfee35d;if(_0xbaf06b[_0xbd4a('0x31')][_0xbd4a('0x52')]){_0x594a45[_0xbd4a('0x53')]=[{'all':!![]}];}return db[_0xbd4a('0x2e')][_0xbd4a('0x54')](_0x594a45);})[_0xbd4a('0x26')](function(_0xa51060){_0x228121[_0xbd4a('0x55')]=_0xa51060;return _0x228121;})['then'](respondWithFilteredResult(_0x50f817,_0x594a45))[_0xbd4a('0x56')](handleError(_0x50f817,null));};exports[_0xbd4a('0x57')]=function(_0x53d409,_0x4088e2){var _0x2da861={'raw':!![],'where':{'id':_0x53d409[_0xbd4a('0x58')]['id']}},_0x27a7b7={};_0x27a7b7[_0xbd4a('0x30')]=_[_0xbd4a('0x32')](db[_0xbd4a('0x2e')]['rawAttributes']);_0x27a7b7[_0xbd4a('0x31')]=_[_0xbd4a('0x32')](_0x53d409['query']);_0x27a7b7[_0xbd4a('0x33')]=_[_0xbd4a('0x34')](_0x27a7b7[_0xbd4a('0x30')],_0x27a7b7[_0xbd4a('0x31')]);_0x2da861[_0xbd4a('0x46')]=_[_0xbd4a('0x34')](_0x27a7b7[_0xbd4a('0x30')],qs[_0xbd4a('0x47')](_0x53d409['query'][_0xbd4a('0x47')]));_0x2da861[_0xbd4a('0x46')]=_0x2da861[_0xbd4a('0x46')][_0xbd4a('0x48')]?_0x2da861[_0xbd4a('0x46')]:_0x27a7b7[_0xbd4a('0x30')];if(_0x53d409[_0xbd4a('0x31')][_0xbd4a('0x52')]){_0x2da861['include']=[{'all':!![]}];}_0x2da861=_[_0xbd4a('0x4d')]({},_0x2da861,_0x53d409['options']);return db['CmHopper'][_0xbd4a('0x59')](_0x2da861)[_0xbd4a('0x26')](handleEntityNotFound(_0x4088e2,null))[_0xbd4a('0x26')](respondWithResult(_0x4088e2,null))[_0xbd4a('0x56')](handleError(_0x4088e2,null));};exports[_0xbd4a('0x5a')]=function(_0x1ed7e9,_0x40cbe7){return db[_0xbd4a('0x2e')]['create'](_0x1ed7e9[_0xbd4a('0x5b')],{})[_0xbd4a('0x26')](respondWithResult(_0x40cbe7,0xc9))[_0xbd4a('0x56')](handleError(_0x40cbe7,null));};exports[_0xbd4a('0x25')]=function(_0x4b054c,_0x42f5eb){if(_0x4b054c[_0xbd4a('0x5b')]['id']){delete _0x4b054c['body']['id'];}return db[_0xbd4a('0x2e')][_0xbd4a('0x59')]({'where':{'id':_0x4b054c[_0xbd4a('0x58')]['id']}})[_0xbd4a('0x26')](handleEntityNotFound(_0x42f5eb,null))[_0xbd4a('0x26')](saveUpdates(_0x4b054c[_0xbd4a('0x5b')],null))[_0xbd4a('0x26')](respondWithResult(_0x42f5eb,null))[_0xbd4a('0x56')](handleError(_0x42f5eb,null));};exports[_0xbd4a('0x5c')]=function(_0x2b3795,_0x4279d2){return db[_0xbd4a('0x2e')][_0xbd4a('0x5c')]()['then'](respondWithResult(_0x4279d2,null))[_0xbd4a('0x56')](handleError(_0x4279d2,null));};exports[_0xbd4a('0x27')]=function(_0x5101f0,_0xfc481c){var _0x5e1710;return db[_0xbd4a('0x2e')][_0xbd4a('0x59')]({'where':{'id':_0x5101f0[_0xbd4a('0x58')]['id']}})[_0xbd4a('0x26')](handleEntityNotFound(_0xfc481c,null))['then'](function(_0x2eea14){if(_0x2eea14){return _0x2eea14['destroy']()[_0xbd4a('0x26')](function(_0x12ec08){return _0x12ec08;});}})[_0xbd4a('0x26')](function(_0x36e406){_0x5e1710=_0x36e406;if(_0x36e406){if(_0x36e406[_0xbd4a('0x5d')]||_0x36e406[_0xbd4a('0x5e')]){return db[_0x36e406['VoiceQueueId']?_0xbd4a('0x5f'):'Campaign']['find']({'where':{'id':_0x36e406[_0xbd4a('0x5d')]?_0x36e406[_0xbd4a('0x5d')]:_0x36e406[_0xbd4a('0x5e')]},'attributes':['id',_0xbd4a('0x2a')],'raw':!![]});}}})[_0xbd4a('0x26')](function(_0x540499){var _0x5df820={};if(_0x540499){_[_0xbd4a('0x4d')](_0x5df820,_['omit'](_0x5e1710[_0xbd4a('0x60')],['createdAt',_0xbd4a('0x61'),'id']));_0x5df820['state']=0x15;_0x5df820['statedesc']='deleted';_0x5df820['campaign']=_0x540499[_0xbd4a('0x2a')];_0x5df820[_0xbd4a('0x62')]=_0x5101f0['user']['name'];_0x5df820[_0xbd4a('0x63')]=_0x5101f0[_0xbd4a('0x64')]['id'];_0x5df820['deleted']=!![];_0x5df820['deletedat']=moment()[_0xbd4a('0x65')](_0xbd4a('0x66'));_0x5df820[_0xbd4a('0x67')]=_0x5e1710[_0xbd4a('0x68')];_0x5df820[_0xbd4a('0x69')]=_0x5e1710[_0xbd4a('0x5d')]?_0xbd4a('0x6a'):_0xbd4a('0x6b');return db[_0xbd4a('0x6c')][_0xbd4a('0x59')]({'where':{'id':_0x5df820[_0xbd4a('0x6d')]},'attributes':[_0xbd4a('0x6e'),'lastName']})[_0xbd4a('0x26')](function(_0x2c7b2b){if(!_[_0xbd4a('0x6f')](_0xfc481c)&&!_['isNil'](_0x2c7b2b[_0xbd4a('0x6e')])){_0x5df820['calleridname']=_0x2c7b2b[_0xbd4a('0x6e')];if(!_[_0xbd4a('0x6f')](_0x2c7b2b[_0xbd4a('0x70')])){_0x5df820[_0xbd4a('0x71')]+='\x20'+_0x2c7b2b[_0xbd4a('0x70')];}}})['finally'](function(){return db['CmHopperFinal'][_0xbd4a('0x5a')](_0x5df820);});}})['then'](function(){return _0xfc481c[_0xbd4a('0x1b')](0xcc)[_0xbd4a('0x28')]();})[_0xbd4a('0x56')](handleError(_0xfc481c,null));};exports[_0xbd4a('0x72')]=function(_0x3527fb,_0x17b19e,_0x4b8f9f){var _0x27759c=[];return db[_0xbd4a('0x6c')][_0xbd4a('0x5c')]()[_0xbd4a('0x26')](function(_0x35dd93){_0x27759c=_['keys'](_0x35dd93);return _0x3527fb[_0xbd4a('0x64')][_0xbd4a('0x73')]({'where':{'type':_0xbd4a('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xbd4a('0x75')],'raw':!![]});})['then'](function(_0x229e68){if(_0x229e68&&_0x229e68[_0xbd4a('0x48')]){return db[_0xbd4a('0x76')][_0xbd4a('0x77')](function(_0x271053){var _0x3d1d58={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd4a('0x65')](_0xbd4a('0x66'))},'VoiceQueueId':{'$in':_[_0xbd4a('0x2d')](_0x229e68,'id')},'$or':[{'UserId':null},{'UserId':_0x3527fb[_0xbd4a('0x64')]['id']}]};var _0x5a6a08=[];if(_0x3527fb[_0xbd4a('0x5b')][_0xbd4a('0x78')]&&_0x3527fb[_0xbd4a('0x5b')][_0xbd4a('0x78')]===_0xbd4a('0x79')){if(!_[_0xbd4a('0x7a')](_0x3527fb[_0xbd4a('0x5b')]['hopperIds'])){_0x3d1d58['id']={'$in':_0x3527fb[_0xbd4a('0x5b')][_0xbd4a('0x7b')]};}_0x5a6a08=[[_0xbd4a('0x7c'),'ASC'],['scheduledAt',_0x229e68[0x0][_0xbd4a('0x75')]===_0xbd4a('0x7d')?_0xbd4a('0x7e'):'ASC'],db[_0xbd4a('0x76')][_0xbd4a('0x7f')](_0xbd4a('0x80')),['id',_0xbd4a('0x7e')]];}else{if(!_[_0xbd4a('0x7a')](_0x3527fb[_0xbd4a('0x5b')][_0xbd4a('0x7b')])){_0x3d1d58['id']={'$notIn':_0x3527fb[_0xbd4a('0x5b')][_0xbd4a('0x7b')]};}_0x5a6a08=[['priority','DESC'],[_0xbd4a('0x81'),_0x229e68[0x0][_0xbd4a('0x75')]],db[_0xbd4a('0x76')][_0xbd4a('0x7f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xbd4a('0x7d')]];}return db[_0xbd4a('0x2e')][_0xbd4a('0x82')]({'attributes':['id',_0xbd4a('0x83')],'where':_0x3d1d58,'order':_0x5a6a08,'transaction':_0x271053,'lock':_0x271053[_0xbd4a('0x84')][_0xbd4a('0x85')],'include':[{'model':db[_0xbd4a('0x6c')],'as':_0xbd4a('0x86'),'attributes':_0x27759c,'include':[{'model':db[_0xbd4a('0x87')],'as':_0xbd4a('0x88'),'attributes':['id','name']}]},{'model':db[_0xbd4a('0x89')],'as':'List','attributes':['id','name']},{'model':db[_0xbd4a('0x5f')],'as':_0xbd4a('0x8a'),'attributes':['id','name',_0xbd4a('0x8b')]}]})['then'](function(_0x40aa26){if(_0x40aa26){return _0x40aa26[_0xbd4a('0x25')]({'UserId':_0x3527fb['user']['id']},{'transaction':_0x271053});}});});}})[_0xbd4a('0x26')](handleEntityNotFound(_0x17b19e,null))['then'](respondWithResult(_0x17b19e,null))['catch'](handleError(_0x17b19e,null));};exports[_0xbd4a('0x8c')]=function(_0x5ed315,_0x27a975,_0x25aad7){return _0x5ed315['user'][_0xbd4a('0x73')]({'where':{'type':_0xbd4a('0x74'),'dialActive':!![],'dialMethod':_0xbd4a('0x8d')},'attributes':['id'],'raw':!![]})[_0xbd4a('0x26')](function(_0x1b4370){if(_0x1b4370&&_0x1b4370['length']){return db['CmHopper'][_0xbd4a('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd4a('0x65')](_0xbd4a('0x66'))},'VoiceQueueId':{'$in':_['map'](_0x1b4370,'id')},'$or':[{'UserId':null},{'UserId':_0x5ed315['user']['id']}]}});}return 0x0;})[_0xbd4a('0x26')](function(_0x456e05){if(!_['isNil'](_0x456e05)&&_[_0xbd4a('0x8e')](_0x456e05)){return _0x27a975['status'](0xc8)[_0xbd4a('0x22')]({'contacts':_0x456e05});}else{logger[_0xbd4a('0x29')](_0xbd4a('0x8f'),'getOpenContacts',0x194,_0xbd4a('0x90'));_0x27a975['sendStatus'](0x194);}})['catch'](handleError(_0x27a975,null));}; \ No newline at end of file +var _0xe477=['length','includeAll','create','body','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','find','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','end','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','Contact','CmCompany','CmList','dialActive','getOpenContacts','getVoiceQueues','isNumber','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','concat','$or','$gte','$lt','$lte','$ne','$eq','$in','$notIn','$notLike','$iLike','$contains','$contained','$any','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show'];(function(_0x1c7be8,_0x4cbae4){var _0x8ca9c5=function(_0x442695){while(--_0x442695){_0x1c7be8['push'](_0x1c7be8['shift']());}};_0x8ca9c5(++_0x4cbae4);}(_0xe477,0x1f1));var _0x7e47=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0xe477[_0x1ca93c];return _0x185169;};'use strict';var emlformat=require(_0x7e47('0x0'));var rimraf=require(_0x7e47('0x1'));var zipdir=require(_0x7e47('0x2'));var jsonpatch=require(_0x7e47('0x3'));var rp=require(_0x7e47('0x4'));var moment=require('moment');var BPromise=require(_0x7e47('0x5'));var Mustache=require('mustache');var util=require(_0x7e47('0x6'));var path=require(_0x7e47('0x7'));var sox=require(_0x7e47('0x8'));var csv=require(_0x7e47('0x9'));var ejs=require(_0x7e47('0xa'));var fs=require('fs');var fs_extra=require(_0x7e47('0xb'));var _=require(_0x7e47('0xc'));var squel=require(_0x7e47('0xd'));var crypto=require(_0x7e47('0xe'));var jsforce=require(_0x7e47('0xf'));var deskjs=require(_0x7e47('0x10'));var toCsv=require(_0x7e47('0x9'));var querystring=require('querystring');var Papa=require(_0x7e47('0x11'));var Redis=require(_0x7e47('0x12'));var authService=require(_0x7e47('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e47('0x14'));var logger=require(_0x7e47('0x15'))('api');var utils=require(_0x7e47('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7e47('0x17'))['db'];function respondWithStatusCode(_0x4186c0,_0x3040a8){_0x3040a8=_0x3040a8||0xcc;return function(_0x46fc5c){if(_0x46fc5c){return _0x4186c0['sendStatus'](_0x3040a8);}return _0x4186c0[_0x7e47('0x18')](_0x3040a8)['end']();};}function respondWithResult(_0xa1c8da,_0x27d9c5){_0x27d9c5=_0x27d9c5||0xc8;return function(_0x55bb4e){if(_0x55bb4e){return _0xa1c8da[_0x7e47('0x18')](_0x27d9c5)[_0x7e47('0x19')](_0x55bb4e);}};}function respondWithFilteredResult(_0x52c6b1,_0x447d84){return function(_0x5e0202){if(_0x5e0202){var _0x4aab3d=typeof _0x447d84[_0x7e47('0x1a')]===_0x7e47('0x1b')&&typeof _0x447d84['limit']===_0x7e47('0x1b');var _0x296446=_0x5e0202[_0x7e47('0x1c')];var _0x2334af=_0x4aab3d?0x0:_0x447d84[_0x7e47('0x1a')];var _0x35141a=_0x4aab3d?_0x5e0202[_0x7e47('0x1c')]:_0x447d84[_0x7e47('0x1a')]+_0x447d84[_0x7e47('0x1d')];var _0x570599;if(_0x35141a>=_0x296446){_0x35141a=_0x296446;_0x570599=0xc8;}else{_0x570599=0xce;}_0x52c6b1[_0x7e47('0x18')](_0x570599);return _0x52c6b1[_0x7e47('0x1e')]('Content-Range',_0x2334af+'-'+_0x35141a+'/'+_0x296446)[_0x7e47('0x19')](_0x5e0202);}return null;};}function patchUpdates(_0x40258c){return function(_0xd5481d){try{jsonpatch[_0x7e47('0x1f')](_0xd5481d,_0x40258c,!![]);}catch(_0x2ffbe3){return BPromise[_0x7e47('0x20')](_0x2ffbe3);}return _0xd5481d['save']();};}function saveUpdates(_0x316127,_0x45753d){return function(_0x2a1785){if(_0x2a1785){return _0x2a1785[_0x7e47('0x21')](_0x316127)['then'](function(_0x2d511c){return _0x2d511c;});}return null;};}function removeEntity(_0x2165d4,_0x39bf3b){return function(_0x571728){if(_0x571728){return _0x571728[_0x7e47('0x22')]()[_0x7e47('0x23')](function(){_0x2165d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8ed8,_0x5e1688){return function(_0xbbf021){if(!_0xbbf021){_0x4b8ed8[_0x7e47('0x24')](0x194);}return _0xbbf021;};}function handleError(_0x335ab7,_0xed59a7){_0xed59a7=_0xed59a7||0x1f4;return function(_0x1481e3){logger[_0x7e47('0x25')](_0x1481e3[_0x7e47('0x26')]);if(_0x1481e3[_0x7e47('0x27')]){delete _0x1481e3[_0x7e47('0x27')];}_0x335ab7[_0x7e47('0x18')](_0xed59a7)[_0x7e47('0x28')](_0x1481e3);};}exports[_0x7e47('0x29')]=function(_0x4069fc,_0x7d04e7){var _0x8aa598={},_0x3b246e={},_0x3064bd={'count':0x0,'rows':[]};var _0x1bdfcb=_['map'](db[_0x7e47('0x2a')][_0x7e47('0x2b')],function(_0x2d8c77){return{'name':_0x2d8c77[_0x7e47('0x2c')],'type':_0x2d8c77[_0x7e47('0x2d')][_0x7e47('0x2e')]};});_0x3b246e[_0x7e47('0x2f')]=_[_0x7e47('0x30')](_0x1bdfcb,_0x7e47('0x27'));_0x3b246e['query']=_[_0x7e47('0x31')](_0x4069fc[_0x7e47('0x32')]);_0x3b246e[_0x7e47('0x33')]=_[_0x7e47('0x34')](_0x3b246e[_0x7e47('0x2f')],_0x3b246e[_0x7e47('0x32')]);_0x3b246e[_0x7e47('0x33')]=_[_0x7e47('0x35')](_0x3b246e[_0x7e47('0x33')],['$and',_0x7e47('0x36'),'$gt',_0x7e47('0x37'),_0x7e47('0x38'),_0x7e47('0x39'),_0x7e47('0x3a'),_0x7e47('0x3b'),'$not','$between','$notBetween',_0x7e47('0x3c'),_0x7e47('0x3d'),'$like',_0x7e47('0x3e'),_0x7e47('0x3f'),'$notILike','$like','$overlap',_0x7e47('0x40'),_0x7e47('0x41'),_0x7e47('0x42')]);_0x8aa598[_0x7e47('0x43')]=_[_0x7e47('0x34')](_0x3b246e[_0x7e47('0x2f')],qs[_0x7e47('0x44')](_0x4069fc[_0x7e47('0x32')][_0x7e47('0x44')]));_0x8aa598[_0x7e47('0x43')]=_0x8aa598['attributes']['length']?_0x8aa598['attributes']:_0x3b246e['model'];if(!_0x4069fc['query']['hasOwnProperty'](_0x7e47('0x45'))){_0x8aa598[_0x7e47('0x1d')]=qs[_0x7e47('0x1d')](_0x4069fc[_0x7e47('0x32')][_0x7e47('0x1d')]);_0x8aa598['offset']=qs['offset'](_0x4069fc['query'][_0x7e47('0x1a')]);}_0x8aa598[_0x7e47('0x46')]=qs['sort'](_0x4069fc[_0x7e47('0x32')][_0x7e47('0x47')]);_0x8aa598[_0x7e47('0x48')]=qs[_0x7e47('0x33')](_[_0x7e47('0x49')](_0x4069fc['query'],_0x3b246e['filters']),_0x1bdfcb);if(_0x4069fc[_0x7e47('0x32')]['filter']){_0x8aa598[_0x7e47('0x48')]=_[_0x7e47('0x4a')](_0x8aa598[_0x7e47('0x48')],{'$or':_['map'](_0x1bdfcb,function(_0x2f1577){if(_0x2f1577['type']!==_0x7e47('0x4b')){var _0x332a23={};_0x332a23[_0x2f1577[_0x7e47('0x27')]]={'$like':'%'+_0x4069fc['query'][_0x7e47('0x4c')]+'%'};return _0x332a23;}})});}_0x8aa598=_[_0x7e47('0x4a')]({},_0x8aa598,_0x4069fc[_0x7e47('0x4d')]);var _0x1fa17e={'where':_0x8aa598[_0x7e47('0x48')]};return db['CmHopper'][_0x7e47('0x1c')](_0x1fa17e)[_0x7e47('0x23')](function(_0x178240){_0x3064bd['count']=_0x178240;if(_0x4069fc[_0x7e47('0x32')]['includeAll']){_0x8aa598[_0x7e47('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0x7e47('0x4f')](_0x8aa598);})['then'](function(_0x9397bb){_0x3064bd[_0x7e47('0x50')]=_0x9397bb;return _0x3064bd;})[_0x7e47('0x23')](respondWithFilteredResult(_0x7d04e7,_0x8aa598))[_0x7e47('0x51')](handleError(_0x7d04e7,null));};exports[_0x7e47('0x52')]=function(_0x11834c,_0x2324a4){var _0x1739e={'raw':!![],'where':{'id':_0x11834c['params']['id']}},_0xba7ebb={};_0xba7ebb['model']=_['keys'](db[_0x7e47('0x2a')][_0x7e47('0x2b')]);_0xba7ebb[_0x7e47('0x32')]=_['keys'](_0x11834c[_0x7e47('0x32')]);_0xba7ebb[_0x7e47('0x33')]=_['intersection'](_0xba7ebb['model'],_0xba7ebb[_0x7e47('0x32')]);_0x1739e[_0x7e47('0x43')]=_[_0x7e47('0x34')](_0xba7ebb['model'],qs[_0x7e47('0x44')](_0x11834c[_0x7e47('0x32')][_0x7e47('0x44')]));_0x1739e[_0x7e47('0x43')]=_0x1739e[_0x7e47('0x43')][_0x7e47('0x53')]?_0x1739e['attributes']:_0xba7ebb[_0x7e47('0x2f')];if(_0x11834c[_0x7e47('0x32')][_0x7e47('0x54')]){_0x1739e[_0x7e47('0x4e')]=[{'all':!![]}];}_0x1739e=_[_0x7e47('0x4a')]({},_0x1739e,_0x11834c[_0x7e47('0x4d')]);return db[_0x7e47('0x2a')]['find'](_0x1739e)[_0x7e47('0x23')](handleEntityNotFound(_0x2324a4,null))[_0x7e47('0x23')](respondWithResult(_0x2324a4,null))['catch'](handleError(_0x2324a4,null));};exports[_0x7e47('0x55')]=function(_0x562896,_0x32f9ed){return db['CmHopper'][_0x7e47('0x55')](_0x562896[_0x7e47('0x56')],{})[_0x7e47('0x23')](respondWithResult(_0x32f9ed,0xc9))[_0x7e47('0x51')](handleError(_0x32f9ed,null));};exports[_0x7e47('0x21')]=function(_0x5a9606,_0xcb1581){if(_0x5a9606[_0x7e47('0x56')]['id']){delete _0x5a9606['body']['id'];}return db[_0x7e47('0x2a')]['find']({'where':{'id':_0x5a9606[_0x7e47('0x57')]['id']}})[_0x7e47('0x23')](handleEntityNotFound(_0xcb1581,null))[_0x7e47('0x23')](saveUpdates(_0x5a9606[_0x7e47('0x56')],null))['then'](respondWithResult(_0xcb1581,null))[_0x7e47('0x51')](handleError(_0xcb1581,null));};exports['describe']=function(_0x48f3c0,_0x22c212){return db[_0x7e47('0x2a')][_0x7e47('0x58')]()[_0x7e47('0x23')](respondWithResult(_0x22c212,null))[_0x7e47('0x51')](handleError(_0x22c212,null));};exports[_0x7e47('0x22')]=function(_0x1cd57f,_0x2e953f){var _0x4f4cbc;return db[_0x7e47('0x2a')]['find']({'where':{'id':_0x1cd57f[_0x7e47('0x57')]['id']}})[_0x7e47('0x23')](handleEntityNotFound(_0x2e953f,null))[_0x7e47('0x23')](function(_0x51b624){if(_0x51b624){return _0x51b624[_0x7e47('0x22')]()[_0x7e47('0x23')](function(_0x408131){return _0x408131;});}})['then'](function(_0x518b9a){_0x4f4cbc=_0x518b9a;if(_0x518b9a){if(_0x518b9a[_0x7e47('0x59')]||_0x518b9a[_0x7e47('0x5a')]){return db[_0x518b9a[_0x7e47('0x59')]?_0x7e47('0x5b'):_0x7e47('0x5c')][_0x7e47('0x5d')]({'where':{'id':_0x518b9a[_0x7e47('0x59')]?_0x518b9a[_0x7e47('0x59')]:_0x518b9a[_0x7e47('0x5a')]},'attributes':['id',_0x7e47('0x27')],'raw':!![]});}}})[_0x7e47('0x23')](function(_0x1f700b){var _0x5f5627={};if(_0x1f700b){_[_0x7e47('0x4a')](_0x5f5627,_[_0x7e47('0x5e')](_0x4f4cbc[_0x7e47('0x5f')],[_0x7e47('0x60'),_0x7e47('0x61'),'id']));_0x5f5627[_0x7e47('0x62')]=0x15;_0x5f5627[_0x7e47('0x63')]=_0x7e47('0x64');_0x5f5627[_0x7e47('0x65')]=_0x1f700b[_0x7e47('0x27')];_0x5f5627[_0x7e47('0x66')]=_0x1cd57f[_0x7e47('0x67')][_0x7e47('0x27')];_0x5f5627[_0x7e47('0x68')]=_0x1cd57f[_0x7e47('0x67')]['id'];_0x5f5627[_0x7e47('0x64')]=!![];_0x5f5627[_0x7e47('0x69')]=moment()[_0x7e47('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f5627['calleridnum']=_0x4f4cbc[_0x7e47('0x6b')];_0x5f5627[_0x7e47('0x6c')]=_0x4f4cbc['VoiceQueueId']?_0x7e47('0x6d'):_0x7e47('0x6e');return db[_0x7e47('0x6f')][_0x7e47('0x5d')]({'where':{'id':_0x5f5627[_0x7e47('0x70')]},'attributes':[_0x7e47('0x71'),'lastName']})[_0x7e47('0x23')](function(_0x54fab8){if(!_[_0x7e47('0x72')](_0x2e953f)&&!_[_0x7e47('0x72')](_0x54fab8[_0x7e47('0x71')])){_0x5f5627[_0x7e47('0x73')]=_0x54fab8[_0x7e47('0x71')];if(!_[_0x7e47('0x72')](_0x54fab8[_0x7e47('0x74')])){_0x5f5627['calleridname']+='\x20'+_0x54fab8[_0x7e47('0x74')];}}})[_0x7e47('0x75')](function(){return db[_0x7e47('0x76')][_0x7e47('0x55')](_0x5f5627);});}})['then'](function(){return _0x2e953f[_0x7e47('0x18')](0xcc)[_0x7e47('0x77')]();})['catch'](handleError(_0x2e953f,null));};exports['getPreview']=function(_0x4dd7d7,_0x285521,_0x430cfc){var _0x3aa9e7=[];return db[_0x7e47('0x6f')][_0x7e47('0x58')]()[_0x7e47('0x23')](function(_0x4ec936){_0x3aa9e7=_['keys'](_0x4ec936);return _0x4dd7d7[_0x7e47('0x67')]['getVoiceQueues']({'where':{'type':_0x7e47('0x78'),'dialActive':!![],'dialMethod':_0x7e47('0x79')},'attributes':['id',_0x7e47('0x7a')],'raw':!![]});})[_0x7e47('0x23')](function(_0x1c1ce3){if(_0x1c1ce3&&_0x1c1ce3[_0x7e47('0x53')]){return db[_0x7e47('0x7b')][_0x7e47('0x7c')](function(_0xcebff4){var _0x4cbc99={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7e47('0x6a')](_0x7e47('0x7d'))},'VoiceQueueId':{'$in':_[_0x7e47('0x30')](_0x1c1ce3,'id')},'$or':[{'UserId':null},{'UserId':_0x4dd7d7[_0x7e47('0x67')]['id']}]};var _0x3ab05b=[];if(_0x4dd7d7['body'][_0x7e47('0x7e')]&&_0x4dd7d7['body']['direction']==='prev'){if(!_[_0x7e47('0x7f')](_0x4dd7d7['body']['hopperIds'])){_0x4cbc99['id']={'$in':_0x4dd7d7[_0x7e47('0x56')][_0x7e47('0x80')]};}_0x3ab05b=[[_0x7e47('0x81'),_0x7e47('0x82')],[_0x7e47('0x83'),_0x1c1ce3[0x0][_0x7e47('0x7a')]===_0x7e47('0x82')?_0x7e47('0x84'):_0x7e47('0x82')],db[_0x7e47('0x7b')][_0x7e47('0x85')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7e47('0x84')]];}else{if(!_[_0x7e47('0x7f')](_0x4dd7d7[_0x7e47('0x56')][_0x7e47('0x80')])){_0x4cbc99['id']={'$notIn':_0x4dd7d7[_0x7e47('0x56')][_0x7e47('0x80')]};}_0x3ab05b=[['priority',_0x7e47('0x84')],[_0x7e47('0x83'),_0x1c1ce3[0x0]['dialOrderByScheduledAt']],db[_0x7e47('0x7b')][_0x7e47('0x85')](_0x7e47('0x86')),['id',_0x7e47('0x82')]];}return db[_0x7e47('0x2a')][_0x7e47('0x87')]({'attributes':['id',_0x7e47('0x88')],'where':_0x4cbc99,'order':_0x3ab05b,'transaction':_0xcebff4,'lock':_0xcebff4['LOCK']['UPDATE'],'include':[{'model':db[_0x7e47('0x6f')],'as':_0x7e47('0x89'),'attributes':_0x3aa9e7,'include':[{'model':db[_0x7e47('0x8a')],'as':'Company','attributes':['id',_0x7e47('0x27')]}]},{'model':db[_0x7e47('0x8b')],'as':'List','attributes':['id',_0x7e47('0x27')]},{'model':db[_0x7e47('0x5b')],'as':'Queue','attributes':['id',_0x7e47('0x27'),_0x7e47('0x8c')]}]})[_0x7e47('0x23')](function(_0xf12f00){if(_0xf12f00){return _0xf12f00[_0x7e47('0x21')]({'UserId':_0x4dd7d7['user']['id']},{'transaction':_0xcebff4});}});});}})['then'](handleEntityNotFound(_0x285521,null))[_0x7e47('0x23')](respondWithResult(_0x285521,null))['catch'](handleError(_0x285521,null));};exports[_0x7e47('0x8d')]=function(_0x3eb477,_0x34dd64,_0x3cded3){return _0x3eb477[_0x7e47('0x67')][_0x7e47('0x8e')]({'where':{'type':_0x7e47('0x78'),'dialActive':!![],'dialMethod':_0x7e47('0x79')},'attributes':['id'],'raw':!![]})[_0x7e47('0x23')](function(_0x21b4ab){if(_0x21b4ab&&_0x21b4ab['length']){return db['CmHopper'][_0x7e47('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7e47('0x6a')](_0x7e47('0x7d'))},'VoiceQueueId':{'$in':_['map'](_0x21b4ab,'id')},'$or':[{'UserId':null},{'UserId':_0x3eb477[_0x7e47('0x67')]['id']}]}});}return 0x0;})[_0x7e47('0x23')](function(_0x355779){if(!_[_0x7e47('0x72')](_0x355779)&&_[_0x7e47('0x8f')](_0x355779)){return _0x34dd64[_0x7e47('0x18')](0xc8)[_0x7e47('0x19')]({'contacts':_0x355779});}else{logger[_0x7e47('0x25')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x7e47('0x90'));_0x34dd64[_0x7e47('0x24')](0x194);}})[_0x7e47('0x51')](handleError(_0x34dd64,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 855a017..4c797fa 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 _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3ec9a4,_0x2fdc0f){_0x3ec9a4=_0x3ec9a4-0x0;var _0x17f96d=_0xc6ac[_0x3ec9a4];return _0x17f96d;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x250c37,_0x1582b3){var _0x175c29=function(_0x4b254b){while(--_0x4b254b){_0x250c37['push'](_0x250c37['shift']());}};_0x175c29(++_0x1582b3);}(_0x2542,0x169));var _0x2254=function(_0xdb6fe8,_0x2ef81e){_0xdb6fe8=_0xdb6fe8-0x0;var _0x3d235d=_0x2542[_0xdb6fe8];return _0x3d235d;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 34a42a5..c631f92 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 _0x6860=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes','limit','map','model','include','stringify','ShowCmHopper','CmHopper','find','create','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','UserId','body','includes','push','all','MoveContactManagedDialer','CmHopperFinal','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','Contact','lodash','util'];(function(_0x1879f7,_0x231de9){var _0x510026=function(_0x129c81){while(--_0x129c81){_0x1879f7['push'](_0x1879f7['shift']());}};_0x510026(++_0x231de9);}(_0x6860,0xe5));var _0x0686=function(_0x3ea7dd,_0x3f07fa){_0x3ea7dd=_0x3ea7dd-0x0;var _0x45f281=_0x6860[_0x3ea7dd];return _0x45f281;};'use strict';var _=require(_0x0686('0x0'));var util=require(_0x0686('0x1'));var moment=require(_0x0686('0x2'));var BPromise=require(_0x0686('0x3'));var rs=require(_0x0686('0x4'));var fs=require('fs');var Redis=require(_0x0686('0x5'));var db=require(_0x0686('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0686('0x7'))(_0x0686('0x8'));var config=require(_0x0686('0x9'));var jayson=require(_0x0686('0xa'));var client=jayson[_0x0686('0xb')][_0x0686('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19fca8,_0x140437,_0x338559){return new BPromise(function(_0x3ecf0e,_0x3426cd){return client[_0x0686('0xd')](_0x19fca8,_0x338559)[_0x0686('0xe')](function(_0x3fd390){logger[_0x0686('0xf')](_0x0686('0x10'),_0x140437,_0x0686('0x11'));logger[_0x0686('0x12')](_0x0686('0x13'),_0x140437,_0x0686('0x11'),JSON['stringify'](_0x3fd390));if(_0x3fd390[_0x0686('0x14')]){if(_0x3fd390[_0x0686('0x14')][_0x0686('0x15')]===0x1f4){logger[_0x0686('0x14')](_0x0686('0x10'),_0x140437,_0x3fd390[_0x0686('0x14')][_0x0686('0x16')]);return _0x3426cd(_0x3fd390[_0x0686('0x14')]['message']);}logger[_0x0686('0x14')](_0x0686('0x10'),_0x140437,_0x3fd390[_0x0686('0x14')][_0x0686('0x16')]);return _0x3ecf0e(_0x3fd390[_0x0686('0x14')][_0x0686('0x16')]);}else{logger[_0x0686('0xf')]('CmHopper,\x20%s,\x20%s',_0x140437,'request\x20sent');_0x3ecf0e(_0x3fd390[_0x0686('0x17')][_0x0686('0x16')]);}})[_0x0686('0x18')](function(_0x4d8aaa){logger['error'](_0x0686('0x10'),_0x140437,_0x4d8aaa);_0x3426cd(_0x4d8aaa);});});}exports[_0x0686('0x19')]=function(_0x5de6d3){var _0x4fb941=this;return new Promise(function(_0x57df74,_0x1639e7){return db['CmHopper'][_0x0686('0x1a')]({'raw':_0x5de6d3[_0x0686('0x1b')]?_0x5de6d3[_0x0686('0x1b')][_0x0686('0x1c')]===undefined?!![]:![]:!![],'where':_0x5de6d3[_0x0686('0x1b')]?_0x5de6d3[_0x0686('0x1b')][_0x0686('0x1d')]||null:null,'attributes':_0x5de6d3[_0x0686('0x1b')]?_0x5de6d3[_0x0686('0x1b')][_0x0686('0x1e')]||null:null,'limit':_0x5de6d3['options']?_0x5de6d3[_0x0686('0x1b')][_0x0686('0x1f')]||null:null,'include':_0x5de6d3['options']?_0x5de6d3['options']['include']?_[_0x0686('0x20')](_0x5de6d3[_0x0686('0x1b')]['include'],function(_0x5a70e6){return{'model':db[_0x5a70e6[_0x0686('0x21')]],'as':_0x5a70e6['as'],'attributes':_0x5a70e6[_0x0686('0x1e')],'include':_0x5a70e6[_0x0686('0x22')]?_[_0x0686('0x20')](_0x5a70e6[_0x0686('0x22')],function(_0x756c15){return{'model':db[_0x756c15[_0x0686('0x21')]],'as':_0x756c15['as'],'attributes':_0x756c15[_0x0686('0x1e')],'include':_0x756c15['include']?_[_0x0686('0x20')](_0x756c15[_0x0686('0x22')],function(_0x523c01){return{'model':db[_0x523c01['model']],'as':_0x523c01['as'],'attributes':_0x523c01[_0x0686('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdb7bc){logger[_0x0686('0xf')](_0x0686('0x19'),_0x5de6d3);logger[_0x0686('0x12')]('GetCmHopper',_0x5de6d3,JSON[_0x0686('0x23')](_0xdb7bc));_0x57df74(_0xdb7bc);})['catch'](function(_0x133c0a){logger[_0x0686('0x14')](_0x0686('0x19'),_0x133c0a[_0x0686('0x16')],_0x5de6d3);_0x1639e7(_0x4fb941['error'](0x1f4,_0x133c0a['message']));});});};exports[_0x0686('0x24')]=function(_0x151c7e){var _0x310737=this;return new Promise(function(_0x481a5c,_0x4f42d7){return db[_0x0686('0x25')][_0x0686('0x26')]({'raw':_0x151c7e['options']?_0x151c7e['options'][_0x0686('0x1c')]===undefined?!![]:![]:!![],'where':_0x151c7e[_0x0686('0x1b')]?_0x151c7e[_0x0686('0x1b')][_0x0686('0x1d')]||null:null,'attributes':_0x151c7e[_0x0686('0x1b')]?_0x151c7e[_0x0686('0x1b')][_0x0686('0x1e')]||null:null,'include':_0x151c7e['options']?_0x151c7e[_0x0686('0x1b')][_0x0686('0x22')]?_[_0x0686('0x20')](_0x151c7e[_0x0686('0x1b')][_0x0686('0x22')],function(_0xa826da){return{'model':db[_0xa826da[_0x0686('0x21')]],'as':_0xa826da['as'],'attributes':_0xa826da[_0x0686('0x1e')],'include':_0xa826da[_0x0686('0x22')]?_['map'](_0xa826da[_0x0686('0x22')],function(_0x47f908){return{'model':db[_0x47f908[_0x0686('0x21')]],'as':_0x47f908['as'],'attributes':_0x47f908[_0x0686('0x1e')],'include':_0x47f908['include']?_['map'](_0x47f908[_0x0686('0x22')],function(_0x4b67a0){return{'model':db[_0x4b67a0[_0x0686('0x21')]],'as':_0x4b67a0['as'],'attributes':_0x4b67a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x0686('0xe')](function(_0x33eb4c){logger[_0x0686('0xf')](_0x0686('0x24'),_0x151c7e);logger[_0x0686('0x12')]('ShowCmHopper',_0x151c7e,JSON[_0x0686('0x23')](_0x33eb4c));_0x481a5c(_0x33eb4c);})[_0x0686('0x18')](function(_0x358044){logger['error']('ShowCmHopper',_0x358044[_0x0686('0x16')],_0x151c7e);_0x4f42d7(_0x310737[_0x0686('0x14')](0x1f4,_0x358044[_0x0686('0x16')]));});});};exports['CreateCmHopper']=function(_0x3b95e6){var _0x3daec0=this;return new Promise(function(_0xe4effc,_0x14d0cc){return db[_0x0686('0x25')][_0x0686('0x27')](_0x3b95e6['body'],{'raw':_0x3b95e6['options']?_0x3b95e6[_0x0686('0x1b')][_0x0686('0x1c')]===undefined?!![]:![]:!![]})[_0x0686('0xe')](function(_0x4fcebd){logger['info'](_0x0686('0x28'),_0x3b95e6);logger[_0x0686('0x12')](_0x0686('0x28'),_0x3b95e6,JSON['stringify'](_0x4fcebd));_0xe4effc(_0x4fcebd);})[_0x0686('0x18')](function(_0x2162c9){logger['error'](_0x0686('0x28'),_0x2162c9[_0x0686('0x16')],_0x3b95e6);_0x14d0cc(_0x3daec0['error'](0x1f4,_0x2162c9['message']));});});};exports[_0x0686('0x29')]=function(_0x8244bf){var _0x480645=this;return new Promise(function(_0x418d93,_0x3bb069){return db[_0x0686('0x25')][_0x0686('0x2a')](_0x8244bf['body'],{'raw':_0x8244bf[_0x0686('0x1b')]?_0x8244bf[_0x0686('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8244bf['options']?_0x8244bf[_0x0686('0x1b')][_0x0686('0x1d')]||null:null,'attributes':_0x8244bf[_0x0686('0x1b')]?_0x8244bf[_0x0686('0x1b')][_0x0686('0x1e')]||null:null,'limit':_0x8244bf[_0x0686('0x1b')]?_0x8244bf[_0x0686('0x1b')][_0x0686('0x1f')]||null:null})[_0x0686('0xe')](function(_0x9f8118){logger[_0x0686('0xf')](_0x0686('0x29'),_0x8244bf);logger[_0x0686('0x12')](_0x0686('0x29'),_0x8244bf,JSON[_0x0686('0x23')](_0x9f8118));_0x418d93(_0x9f8118);})['catch'](function(_0x1a4931){logger[_0x0686('0x14')](_0x0686('0x29'),_0x1a4931[_0x0686('0x16')],_0x8244bf);_0x3bb069(_0x480645[_0x0686('0x14')](0x1f4,_0x1a4931['message']));});});};exports[_0x0686('0x2b')]=function(_0x2a35c5){var _0x545793=this;return new Promise(function(_0x20cb4e,_0x31a959){return db['CmHopper']['destroy']({'where':_0x2a35c5[_0x0686('0x1b')]?_0x2a35c5[_0x0686('0x1b')]['where']||null:null})[_0x0686('0xe')](function(_0x4897d5){logger[_0x0686('0xf')](_0x0686('0x2b'),_0x2a35c5);logger[_0x0686('0x12')]('DestroyCmHopper',_0x2a35c5,JSON[_0x0686('0x23')](_0x4897d5));_0x20cb4e(_0x4897d5);})[_0x0686('0x18')](function(_0x356090){logger[_0x0686('0x14')](_0x0686('0x2b'),_0x356090[_0x0686('0x16')],_0x2a35c5);_0x31a959(_0x545793[_0x0686('0x14')](0x1f4,_0x356090[_0x0686('0x16')]));});});};exports[_0x0686('0x2c')]=function(_0x2cc313){var _0x502190=this;return new Promise(function(_0xe549a5,_0x57d336){return db[_0x0686('0x2d')][_0x0686('0x2e')]()[_0x0686('0xe')](function(_0x4a153a){return db[_0x0686('0x2f')][_0x0686('0x30')](function(_0x2e523e){return db[_0x0686('0x25')][_0x0686('0x1a')]({'where':_0x2cc313[_0x0686('0x1b')]?_0x2cc313[_0x0686('0x1b')]['where']||null:null,'attributes':_0x2cc313['options']?_0x2cc313[_0x0686('0x1b')]['attributes']||null:null,'limit':_0x2cc313[_0x0686('0x1b')]?_0x2cc313[_0x0686('0x1b')][_0x0686('0x1f')]||null:null,'order':_0x2cc313[_0x0686('0x1b')]?_0x2cc313['options'][_0x0686('0x31')]||null:null,'transaction':_0x2e523e,'lock':_0x2e523e[_0x0686('0x32')][_0x0686('0x33')],'include':[{'model':db[_0x0686('0x2d')],'as':'Contact','attributes':_[_0x0686('0x34')](_0x4a153a)},{'model':db[_0x0686('0x35')],'as':_0x0686('0x36'),'attributes':['id',_0x0686('0x37'),_0x0686('0x38')]}]})['then'](function(_0x1f2485){var _0x2db1eb=[];var _0x1e03d3=[];for(var _0x2d07ed=0x0;_0x2d07ed<_0x1f2485[_0x0686('0x39')];_0x2d07ed+=0x1){var _0xb34630=_0x1f2485[_0x2d07ed][_0x0686('0x3a')];if(_0xb34630===null){_0x2db1eb['push'](_0x1f2485[_0x2d07ed][_0x0686('0x2a')](_0x2cc313[_0x0686('0x3b')],{'transaction':_0x2e523e}));}else if(!_0x1e03d3[_0x0686('0x3c')](_0xb34630)){_0x1e03d3['push'](_0xb34630);_0x2db1eb[_0x0686('0x3d')](_0x1f2485[_0x2d07ed][_0x0686('0x2a')](_0x2cc313[_0x0686('0x3b')],{'transaction':_0x2e523e}));}}return BPromise[_0x0686('0x3e')](_0x2db1eb);});})[_0x0686('0xe')](function(_0x4a5f33){logger[_0x0686('0xf')](_0x0686('0x2c'),_0x2cc313);logger[_0x0686('0x12')](_0x0686('0x2c'),_0x2cc313,JSON[_0x0686('0x23')](_0x4a5f33));_0xe549a5(_0x4a5f33);})[_0x0686('0x18')](function(_0x17f86b){logger[_0x0686('0x14')]('GetContactDialer',_0x17f86b[_0x0686('0x16')],_0x2cc313);_0x57d336(_0x502190[_0x0686('0x14')](0x1f4,_0x17f86b['message']));});});});};exports[_0x0686('0x3f')]=function(_0x3b96a0){var _0x1e962a=this;return new Promise(function(_0x4a6e47,_0x41df5c){return db[_0x0686('0x2f')][_0x0686('0x30')](function(_0x5cceda){return db[_0x0686('0x40')]['create'](_0x3b96a0[_0x0686('0x3b')],{'raw':_0x3b96a0[_0x0686('0x1b')]?_0x3b96a0[_0x0686('0x1b')][_0x0686('0x1c')]===undefined?!![]:![]:!![],'transaction':_0x5cceda})[_0x0686('0xe')](function(){return db[_0x0686('0x25')][_0x0686('0x41')]({'where':_0x3b96a0[_0x0686('0x1b')]?_0x3b96a0[_0x0686('0x1b')]['where']||null:null,'transaction':_0x5cceda});});})[_0x0686('0xe')](function(_0x4b9163){logger[_0x0686('0xf')]('MoveContactManagedDialer',_0x3b96a0);logger[_0x0686('0x12')](_0x0686('0x3f'),_0x3b96a0,JSON['stringify'](_0x4b9163));_0x4a6e47(_0x4b9163);})[_0x0686('0x18')](function(_0x4bccca){logger[_0x0686('0x14')](_0x0686('0x3f'),_0x4bccca['message'],_0x3b96a0);_0x41df5c(_0x1e962a[_0x0686('0x14')](0x1f4,_0x4bccca[_0x0686('0x16')]));});});};exports[_0x0686('0x42')]=function(_0x2431b9){var _0x506a4c=this;return new Promise(function(_0x5d1082,_0x173118){return db['CmHopper']['findAll']({'raw':_0x2431b9['options']?_0x2431b9[_0x0686('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2431b9['options']?_0x2431b9[_0x0686('0x1b')][_0x0686('0x1d')]||null:null,'attributes':[[db[_0x0686('0x2f')]['fn'](_0x0686('0x43'),db[_0x0686('0x2f')]['fn']('IF',db[_0x0686('0x2f')]['literal'](_0x0686('0x44')+util[_0x0686('0x45')](_0x0686('0x46'),moment()['format'](_0x0686('0x47')))+_0x0686('0x48')))),_0x0686('0x49')]]})[_0x0686('0xe')](function(_0x555fd6){logger[_0x0686('0xf')](_0x0686('0x42'),_0x2431b9);logger[_0x0686('0x12')]('CountReScheduled',_0x2431b9,JSON[_0x0686('0x23')](_0x555fd6));_0x5d1082(_0x555fd6);})['catch'](function(_0x333f62){logger[_0x0686('0x14')](_0x0686('0x42'),_0x333f62[_0x0686('0x16')],_0x2431b9);_0x173118(_0x506a4c[_0x0686('0x14')](0x1f4,_0x333f62[_0x0686('0x16')]));});});};exports[_0x0686('0x4a')]=function(_0x4da473){var _0x13f4ce=this;return new Promise(function(_0x363c56,_0x1408f4){return db[_0x0686('0x2d')][_0x0686('0x2e')]()[_0x0686('0xe')](function(_0x48522d){return db[_0x0686('0x2f')][_0x0686('0x30')](function(_0x1d4cd1){return db[_0x0686('0x25')]['findAll']({'where':_0x4da473[_0x0686('0x1b')]?_0x4da473[_0x0686('0x1b')][_0x0686('0x1d')]||null:null,'attributes':_0x4da473[_0x0686('0x1b')]?_0x4da473[_0x0686('0x1b')][_0x0686('0x1e')]||null:null,'limit':0x1,'order':_0x4da473[_0x0686('0x1b')]?_0x4da473[_0x0686('0x1b')]['order']||null:null,'group':db[_0x0686('0x25')]['UserId'],'transaction':_0x1d4cd1,'lock':_0x1d4cd1[_0x0686('0x32')][_0x0686('0x33')],'include':_0x4da473[_0x0686('0x1b')]?_0x4da473[_0x0686('0x1b')][_0x0686('0x22')]?_[_0x0686('0x20')](_0x4da473[_0x0686('0x1b')][_0x0686('0x22')],function(_0x5b933f){return{'model':db[_0x5b933f['model']],'as':_0x5b933f['as'],'attributes':_0x5b933f[_0x0686('0x1e')],'include':_0x5b933f[_0x0686('0x22')]?_[_0x0686('0x20')](_0x5b933f['include'],function(_0xf8f0cc){return{'model':db[_0xf8f0cc[_0x0686('0x21')]],'as':_0xf8f0cc['as'],'attributes':_0xf8f0cc[_0x0686('0x1e')],'include':_0xf8f0cc[_0x0686('0x22')]?_[_0x0686('0x20')](_0xf8f0cc[_0x0686('0x22')],function(_0xff022a){return{'model':db[_0xff022a['model']],'as':_0xff022a['as'],'attributes':_0xff022a[_0x0686('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x233b31){var _0x54c2d2=[];for(var _0x4a3a27=0x0;_0x4a3a27<_0x233b31[_0x0686('0x39')];_0x4a3a27+=0x1){_0x54c2d2[_0x0686('0x3d')](_0x233b31[_0x4a3a27]['update'](_0x4da473[_0x0686('0x3b')],{'transaction':_0x1d4cd1}));}return BPromise['all'](_0x54c2d2);});})[_0x0686('0xe')](function(_0x390a7f){logger['info'](_0x0686('0x4a'),_0x4da473);logger[_0x0686('0x12')](_0x0686('0x4a'),_0x4da473,JSON['stringify'](_0x390a7f));_0x363c56(_0x390a7f);})[_0x0686('0x18')](function(_0x4a7b4f){logger[_0x0686('0x14')](_0x0686('0x4a'),_0x4a7b4f[_0x0686('0x16')],_0x4da473);_0x1408f4(_0x13f4ce[_0x0686('0x14')](0x1f4,_0x4a7b4f[_0x0686('0x16')]));});});});};exports[_0x0686('0x4b')]=function(_0xb6bc30){var _0x3107db=this;return new Promise(function(_0x52eac7,_0x2dbe72){db[_0x0686('0x2d')][_0x0686('0x2e')]()['then'](function(_0x317777){return db[_0x0686('0x25')]['findAll']({'raw':_0xb6bc30['options']?_0xb6bc30[_0x0686('0x1b')][_0x0686('0x1c')]===undefined?!![]:![]:!![],'where':_0xb6bc30[_0x0686('0x1b')]?_0xb6bc30['options'][_0x0686('0x1d')]||null:null,'attributes':_0xb6bc30['options']?_0xb6bc30['options'][_0x0686('0x1e')]||null:null,'limit':_0xb6bc30['options']?_0xb6bc30[_0x0686('0x1b')]['limit']||null:null,'include':_0xb6bc30['options']?_0xb6bc30[_0x0686('0x1b')]['include']?_[_0x0686('0x20')](_0xb6bc30['options']['include'],function(_0x5e2795){return{'model':db[_0x5e2795[_0x0686('0x21')]],'as':_0x5e2795['as'],'attributes':_0x5e2795['as']===_0x0686('0x4c')?_[_0x0686('0x34')](_0x317777):_0x5e2795[_0x0686('0x1e')],'include':_0x5e2795[_0x0686('0x22')]?_[_0x0686('0x20')](_0x5e2795['include'],function(_0x814667){return{'model':db[_0x814667[_0x0686('0x21')]],'as':_0x814667['as'],'attributes':_0x814667[_0x0686('0x1e')],'include':_0x814667[_0x0686('0x22')]?_['map'](_0x814667['include'],function(_0x54a063){return{'model':db[_0x54a063['model']],'as':_0x54a063['as'],'attributes':_0x54a063[_0x0686('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0686('0xe')](function(_0x523c25){logger['info']('GetCmHopper',_0xb6bc30);logger[_0x0686('0x12')]('GetCmHopper',_0xb6bc30,JSON[_0x0686('0x23')](_0x523c25));_0x52eac7(_0x523c25);})[_0x0686('0x18')](function(_0x2b539a){logger[_0x0686('0x14')](_0x0686('0x19'),_0x2b539a[_0x0686('0x16')],_0xb6bc30);_0x2dbe72(_0x3107db[_0x0686('0x14')](0x1f4,_0x2b539a['message']));});});});}; \ No newline at end of file +var _0x3b04=['body','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','UPDATE','Contact','keys','User','Agent','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','LOCK','GetContactRecallMe','GetCmHopperPreview','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','include','map','model','attributes','then','ShowCmHopper','CmHopper','CreateCmHopper','create'];(function(_0x280a09,_0x524095){var _0x32080e=function(_0x1d98f9){while(--_0x1d98f9){_0x280a09['push'](_0x280a09['shift']());}};_0x32080e(++_0x524095);}(_0x3b04,0x69));var _0x43b0=function(_0x376c5b,_0x268dd0){_0x376c5b=_0x376c5b-0x0;var _0xf7b453=_0x3b04[_0x376c5b];return _0xf7b453;};'use strict';var _=require('lodash');var util=require(_0x43b0('0x0'));var moment=require(_0x43b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x43b0('0x2'));var fs=require('fs');var Redis=require(_0x43b0('0x3'));var db=require(_0x43b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43b0('0x5'))(_0x43b0('0x6'));var config=require(_0x43b0('0x7'));var jayson=require(_0x43b0('0x8'));var client=jayson[_0x43b0('0x9')][_0x43b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24177b,_0x4b0714,_0x3a02f6){return new BPromise(function(_0x354614,_0x2d7825){return client[_0x43b0('0xb')](_0x24177b,_0x3a02f6)['then'](function(_0x190c51){logger[_0x43b0('0xc')](_0x43b0('0xd'),_0x4b0714,_0x43b0('0xe'));logger[_0x43b0('0xf')](_0x43b0('0x10'),_0x4b0714,_0x43b0('0xe'),JSON[_0x43b0('0x11')](_0x190c51));if(_0x190c51[_0x43b0('0x12')]){if(_0x190c51[_0x43b0('0x12')][_0x43b0('0x13')]===0x1f4){logger['error'](_0x43b0('0xd'),_0x4b0714,_0x190c51[_0x43b0('0x12')][_0x43b0('0x14')]);return _0x2d7825(_0x190c51['error'][_0x43b0('0x14')]);}logger[_0x43b0('0x12')](_0x43b0('0xd'),_0x4b0714,_0x190c51[_0x43b0('0x12')]['message']);return _0x354614(_0x190c51[_0x43b0('0x12')][_0x43b0('0x14')]);}else{logger[_0x43b0('0xc')](_0x43b0('0xd'),_0x4b0714,_0x43b0('0xe'));_0x354614(_0x190c51[_0x43b0('0x15')][_0x43b0('0x14')]);}})[_0x43b0('0x16')](function(_0x1a2995){logger['error']('CmHopper,\x20%s,\x20%s',_0x4b0714,_0x1a2995);_0x2d7825(_0x1a2995);});});}exports[_0x43b0('0x17')]=function(_0x46e0bc){var _0xb19cec=this;return new Promise(function(_0x35e2ea,_0x77052){return db['CmHopper'][_0x43b0('0x18')]({'raw':_0x46e0bc[_0x43b0('0x19')]?_0x46e0bc[_0x43b0('0x19')][_0x43b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x46e0bc[_0x43b0('0x19')]?_0x46e0bc['options'][_0x43b0('0x1b')]||null:null,'attributes':_0x46e0bc[_0x43b0('0x19')]?_0x46e0bc[_0x43b0('0x19')]['attributes']||null:null,'limit':_0x46e0bc[_0x43b0('0x19')]?_0x46e0bc[_0x43b0('0x19')]['limit']||null:null,'include':_0x46e0bc[_0x43b0('0x19')]?_0x46e0bc[_0x43b0('0x19')][_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x46e0bc['options'][_0x43b0('0x1c')],function(_0x24c740){return{'model':db[_0x24c740[_0x43b0('0x1e')]],'as':_0x24c740['as'],'attributes':_0x24c740[_0x43b0('0x1f')],'include':_0x24c740[_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x24c740[_0x43b0('0x1c')],function(_0x363fd7){return{'model':db[_0x363fd7['model']],'as':_0x363fd7['as'],'attributes':_0x363fd7[_0x43b0('0x1f')],'include':_0x363fd7[_0x43b0('0x1c')]?_['map'](_0x363fd7[_0x43b0('0x1c')],function(_0x261d74){return{'model':db[_0x261d74[_0x43b0('0x1e')]],'as':_0x261d74['as'],'attributes':_0x261d74[_0x43b0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x43b0('0x20')](function(_0xdcc2d0){logger[_0x43b0('0xc')]('GetCmHopper',_0x46e0bc);logger[_0x43b0('0xf')](_0x43b0('0x17'),_0x46e0bc,JSON[_0x43b0('0x11')](_0xdcc2d0));_0x35e2ea(_0xdcc2d0);})[_0x43b0('0x16')](function(_0x23cece){logger['error'](_0x43b0('0x17'),_0x23cece[_0x43b0('0x14')],_0x46e0bc);_0x77052(_0xb19cec[_0x43b0('0x12')](0x1f4,_0x23cece[_0x43b0('0x14')]));});});};exports[_0x43b0('0x21')]=function(_0x5b54ac){var _0x11db9e=this;return new Promise(function(_0x2a2887,_0x43d323){return db[_0x43b0('0x22')]['find']({'raw':_0x5b54ac[_0x43b0('0x19')]?_0x5b54ac[_0x43b0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5b54ac[_0x43b0('0x19')]?_0x5b54ac[_0x43b0('0x19')]['where']||null:null,'attributes':_0x5b54ac[_0x43b0('0x19')]?_0x5b54ac[_0x43b0('0x19')][_0x43b0('0x1f')]||null:null,'include':_0x5b54ac[_0x43b0('0x19')]?_0x5b54ac[_0x43b0('0x19')][_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x5b54ac[_0x43b0('0x19')]['include'],function(_0x839d8b){return{'model':db[_0x839d8b[_0x43b0('0x1e')]],'as':_0x839d8b['as'],'attributes':_0x839d8b[_0x43b0('0x1f')],'include':_0x839d8b['include']?_['map'](_0x839d8b[_0x43b0('0x1c')],function(_0x4c3492){return{'model':db[_0x4c3492['model']],'as':_0x4c3492['as'],'attributes':_0x4c3492[_0x43b0('0x1f')],'include':_0x4c3492[_0x43b0('0x1c')]?_['map'](_0x4c3492[_0x43b0('0x1c')],function(_0x427520){return{'model':db[_0x427520['model']],'as':_0x427520['as'],'attributes':_0x427520[_0x43b0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19681a){logger[_0x43b0('0xc')](_0x43b0('0x21'),_0x5b54ac);logger[_0x43b0('0xf')](_0x43b0('0x21'),_0x5b54ac,JSON[_0x43b0('0x11')](_0x19681a));_0x2a2887(_0x19681a);})[_0x43b0('0x16')](function(_0x4dfab6){logger[_0x43b0('0x12')](_0x43b0('0x21'),_0x4dfab6[_0x43b0('0x14')],_0x5b54ac);_0x43d323(_0x11db9e[_0x43b0('0x12')](0x1f4,_0x4dfab6[_0x43b0('0x14')]));});});};exports[_0x43b0('0x23')]=function(_0x352503){var _0x2cf2f0=this;return new Promise(function(_0x471d4b,_0x1068d6){return db[_0x43b0('0x22')][_0x43b0('0x24')](_0x352503[_0x43b0('0x25')],{'raw':_0x352503['options']?_0x352503['options']['raw']===undefined?!![]:![]:!![]})[_0x43b0('0x20')](function(_0xe9464b){logger[_0x43b0('0xc')](_0x43b0('0x23'),_0x352503);logger[_0x43b0('0xf')]('CreateCmHopper',_0x352503,JSON[_0x43b0('0x11')](_0xe9464b));_0x471d4b(_0xe9464b);})[_0x43b0('0x16')](function(_0x4af59b){logger['error'](_0x43b0('0x23'),_0x4af59b[_0x43b0('0x14')],_0x352503);_0x1068d6(_0x2cf2f0[_0x43b0('0x12')](0x1f4,_0x4af59b[_0x43b0('0x14')]));});});};exports[_0x43b0('0x26')]=function(_0x3e1e19){var _0x6e4f26=this;return new Promise(function(_0x378108,_0x542575){return db['CmHopper'][_0x43b0('0x27')](_0x3e1e19[_0x43b0('0x25')],{'raw':_0x3e1e19[_0x43b0('0x19')]?_0x3e1e19[_0x43b0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e1e19[_0x43b0('0x19')]?_0x3e1e19[_0x43b0('0x19')][_0x43b0('0x1b')]||null:null,'attributes':_0x3e1e19['options']?_0x3e1e19[_0x43b0('0x19')][_0x43b0('0x1f')]||null:null,'limit':_0x3e1e19[_0x43b0('0x19')]?_0x3e1e19[_0x43b0('0x19')][_0x43b0('0x28')]||null:null})['then'](function(_0x20ff85){logger[_0x43b0('0xc')](_0x43b0('0x26'),_0x3e1e19);logger['debug'](_0x43b0('0x26'),_0x3e1e19,JSON['stringify'](_0x20ff85));_0x378108(_0x20ff85);})[_0x43b0('0x16')](function(_0x3aeb3c){logger[_0x43b0('0x12')](_0x43b0('0x26'),_0x3aeb3c[_0x43b0('0x14')],_0x3e1e19);_0x542575(_0x6e4f26[_0x43b0('0x12')](0x1f4,_0x3aeb3c[_0x43b0('0x14')]));});});};exports[_0x43b0('0x29')]=function(_0x3ebada){var _0x535928=this;return new Promise(function(_0x17f924,_0x4c5804){return db['CmHopper'][_0x43b0('0x2a')]({'where':_0x3ebada[_0x43b0('0x19')]?_0x3ebada['options'][_0x43b0('0x1b')]||null:null})[_0x43b0('0x20')](function(_0x1894f9){logger['info']('DestroyCmHopper',_0x3ebada);logger[_0x43b0('0xf')](_0x43b0('0x29'),_0x3ebada,JSON['stringify'](_0x1894f9));_0x17f924(_0x1894f9);})['catch'](function(_0x1a75ed){logger[_0x43b0('0x12')]('DestroyCmHopper',_0x1a75ed['message'],_0x3ebada);_0x4c5804(_0x535928[_0x43b0('0x12')](0x1f4,_0x1a75ed[_0x43b0('0x14')]));});});};exports[_0x43b0('0x2b')]=function(_0x325c6a){var _0x3ba1d0=this;return new Promise(function(_0x15a6f5,_0x3f840d){return db[_0x43b0('0x2c')][_0x43b0('0x2d')]()[_0x43b0('0x20')](function(_0x1bf90f){return db['sequelize'][_0x43b0('0x2e')](function(_0x248b58){return db[_0x43b0('0x22')][_0x43b0('0x18')]({'where':_0x325c6a['options']?_0x325c6a[_0x43b0('0x19')]['where']||null:null,'attributes':_0x325c6a[_0x43b0('0x19')]?_0x325c6a['options'][_0x43b0('0x1f')]||null:null,'limit':_0x325c6a['options']?_0x325c6a[_0x43b0('0x19')][_0x43b0('0x28')]||null:null,'order':_0x325c6a[_0x43b0('0x19')]?_0x325c6a[_0x43b0('0x19')][_0x43b0('0x2f')]||null:null,'transaction':_0x248b58,'lock':_0x248b58['LOCK'][_0x43b0('0x30')],'include':[{'model':db[_0x43b0('0x2c')],'as':_0x43b0('0x31'),'attributes':_[_0x43b0('0x32')](_0x1bf90f)},{'model':db[_0x43b0('0x33')],'as':_0x43b0('0x34'),'attributes':['id','name',_0x43b0('0x35')]}]})[_0x43b0('0x20')](function(_0x277a44){var _0xd34620=[];var _0x2312e5=[];for(var _0x59080b=0x0;_0x59080b<_0x277a44[_0x43b0('0x36')];_0x59080b+=0x1){var _0xca0bba=_0x277a44[_0x59080b][_0x43b0('0x37')];if(_0xca0bba===null){_0xd34620[_0x43b0('0x38')](_0x277a44[_0x59080b]['update'](_0x325c6a['body'],{'transaction':_0x248b58}));}else if(!_0x2312e5[_0x43b0('0x39')](_0xca0bba)){_0x2312e5['push'](_0xca0bba);_0xd34620[_0x43b0('0x38')](_0x277a44[_0x59080b][_0x43b0('0x27')](_0x325c6a['body'],{'transaction':_0x248b58}));}}return BPromise[_0x43b0('0x3a')](_0xd34620);});})[_0x43b0('0x20')](function(_0x2cfb65){logger[_0x43b0('0xc')](_0x43b0('0x2b'),_0x325c6a);logger[_0x43b0('0xf')]('GetContactDialer',_0x325c6a,JSON[_0x43b0('0x11')](_0x2cfb65));_0x15a6f5(_0x2cfb65);})[_0x43b0('0x16')](function(_0x518349){logger[_0x43b0('0x12')](_0x43b0('0x2b'),_0x518349[_0x43b0('0x14')],_0x325c6a);_0x3f840d(_0x3ba1d0[_0x43b0('0x12')](0x1f4,_0x518349[_0x43b0('0x14')]));});});});};exports[_0x43b0('0x3b')]=function(_0x38642f){var _0x7c6990=this;return new Promise(function(_0x569083,_0x18610d){return db['sequelize'][_0x43b0('0x2e')](function(_0x137948){return db[_0x43b0('0x3c')][_0x43b0('0x24')](_0x38642f[_0x43b0('0x25')],{'raw':_0x38642f[_0x43b0('0x19')]?_0x38642f[_0x43b0('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x137948})[_0x43b0('0x20')](function(){return db[_0x43b0('0x22')][_0x43b0('0x2a')]({'where':_0x38642f[_0x43b0('0x19')]?_0x38642f['options'][_0x43b0('0x1b')]||null:null,'transaction':_0x137948});});})[_0x43b0('0x20')](function(_0x48af8e){logger['info'](_0x43b0('0x3b'),_0x38642f);logger['debug'](_0x43b0('0x3b'),_0x38642f,JSON[_0x43b0('0x11')](_0x48af8e));_0x569083(_0x48af8e);})[_0x43b0('0x16')](function(_0x231894){logger['error']('MoveContactManagedDialer',_0x231894[_0x43b0('0x14')],_0x38642f);_0x18610d(_0x7c6990[_0x43b0('0x12')](0x1f4,_0x231894[_0x43b0('0x14')]));});});};exports[_0x43b0('0x3d')]=function(_0x1e1add){var _0x23462b=this;return new Promise(function(_0x3529e4,_0x405951){return db[_0x43b0('0x22')][_0x43b0('0x18')]({'raw':_0x1e1add[_0x43b0('0x19')]?_0x1e1add[_0x43b0('0x19')][_0x43b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e1add['options']?_0x1e1add[_0x43b0('0x19')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x43b0('0x3e')]['fn']('IF',db[_0x43b0('0x3e')][_0x43b0('0x3f')](_0x43b0('0x40')+util[_0x43b0('0x41')](_0x43b0('0x42'),moment()[_0x43b0('0x41')](_0x43b0('0x43')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x3db896){logger[_0x43b0('0xc')](_0x43b0('0x3d'),_0x1e1add);logger[_0x43b0('0xf')](_0x43b0('0x3d'),_0x1e1add,JSON['stringify'](_0x3db896));_0x3529e4(_0x3db896);})[_0x43b0('0x16')](function(_0x457432){logger[_0x43b0('0x12')](_0x43b0('0x3d'),_0x457432[_0x43b0('0x14')],_0x1e1add);_0x405951(_0x23462b['error'](0x1f4,_0x457432['message']));});});};exports['GetContactRecallMe']=function(_0x2f7359){var _0xf5a289=this;return new Promise(function(_0x3d858e,_0x5446e4){return db[_0x43b0('0x2c')]['describe']()['then'](function(_0x269d35){return db['sequelize'][_0x43b0('0x2e')](function(_0x4ecf9e){return db[_0x43b0('0x22')][_0x43b0('0x18')]({'where':_0x2f7359[_0x43b0('0x19')]?_0x2f7359[_0x43b0('0x19')][_0x43b0('0x1b')]||null:null,'attributes':_0x2f7359[_0x43b0('0x19')]?_0x2f7359[_0x43b0('0x19')][_0x43b0('0x1f')]||null:null,'limit':0x1,'order':_0x2f7359[_0x43b0('0x19')]?_0x2f7359['options'][_0x43b0('0x2f')]||null:null,'group':db[_0x43b0('0x22')][_0x43b0('0x37')],'transaction':_0x4ecf9e,'lock':_0x4ecf9e[_0x43b0('0x44')][_0x43b0('0x30')],'include':_0x2f7359['options']?_0x2f7359[_0x43b0('0x19')][_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x2f7359[_0x43b0('0x19')]['include'],function(_0x4f4152){return{'model':db[_0x4f4152[_0x43b0('0x1e')]],'as':_0x4f4152['as'],'attributes':_0x4f4152[_0x43b0('0x1f')],'include':_0x4f4152[_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x4f4152[_0x43b0('0x1c')],function(_0x23424e){return{'model':db[_0x23424e[_0x43b0('0x1e')]],'as':_0x23424e['as'],'attributes':_0x23424e[_0x43b0('0x1f')],'include':_0x23424e[_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x23424e[_0x43b0('0x1c')],function(_0x2af0e9){return{'model':db[_0x2af0e9[_0x43b0('0x1e')]],'as':_0x2af0e9['as'],'attributes':_0x2af0e9[_0x43b0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x43b0('0x20')](function(_0x63dcd7){var _0x2a6e2b=[];for(var _0x40313e=0x0;_0x40313e<_0x63dcd7[_0x43b0('0x36')];_0x40313e+=0x1){_0x2a6e2b['push'](_0x63dcd7[_0x40313e][_0x43b0('0x27')](_0x2f7359[_0x43b0('0x25')],{'transaction':_0x4ecf9e}));}return BPromise[_0x43b0('0x3a')](_0x2a6e2b);});})['then'](function(_0x2f3ad5){logger['info'](_0x43b0('0x45'),_0x2f7359);logger['debug']('GetContactRecallMe',_0x2f7359,JSON[_0x43b0('0x11')](_0x2f3ad5));_0x3d858e(_0x2f3ad5);})[_0x43b0('0x16')](function(_0x15abd5){logger[_0x43b0('0x12')]('GetContactRecallMe',_0x15abd5[_0x43b0('0x14')],_0x2f7359);_0x5446e4(_0xf5a289[_0x43b0('0x12')](0x1f4,_0x15abd5['message']));});});});};exports[_0x43b0('0x46')]=function(_0x4c1ea1){var _0x265d6b=this;return new Promise(function(_0x3c1a90,_0x56dd0d){db[_0x43b0('0x2c')][_0x43b0('0x2d')]()['then'](function(_0x20e885){return db['CmHopper'][_0x43b0('0x18')]({'raw':_0x4c1ea1[_0x43b0('0x19')]?_0x4c1ea1['options'][_0x43b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c1ea1[_0x43b0('0x19')]?_0x4c1ea1[_0x43b0('0x19')]['where']||null:null,'attributes':_0x4c1ea1[_0x43b0('0x19')]?_0x4c1ea1[_0x43b0('0x19')][_0x43b0('0x1f')]||null:null,'limit':_0x4c1ea1[_0x43b0('0x19')]?_0x4c1ea1['options'][_0x43b0('0x28')]||null:null,'include':_0x4c1ea1['options']?_0x4c1ea1['options'][_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x4c1ea1[_0x43b0('0x19')]['include'],function(_0x31261b){return{'model':db[_0x31261b[_0x43b0('0x1e')]],'as':_0x31261b['as'],'attributes':_0x31261b['as']===_0x43b0('0x31')?_[_0x43b0('0x32')](_0x20e885):_0x31261b[_0x43b0('0x1f')],'include':_0x31261b[_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x31261b[_0x43b0('0x1c')],function(_0x3e3c33){return{'model':db[_0x3e3c33[_0x43b0('0x1e')]],'as':_0x3e3c33['as'],'attributes':_0x3e3c33[_0x43b0('0x1f')],'include':_0x3e3c33[_0x43b0('0x1c')]?_[_0x43b0('0x1d')](_0x3e3c33[_0x43b0('0x1c')],function(_0x1651e7){return{'model':db[_0x1651e7[_0x43b0('0x1e')]],'as':_0x1651e7['as'],'attributes':_0x1651e7[_0x43b0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x43b0('0x20')](function(_0x48ecb6){logger[_0x43b0('0xc')](_0x43b0('0x17'),_0x4c1ea1);logger[_0x43b0('0xf')]('GetCmHopper',_0x4c1ea1,JSON[_0x43b0('0x11')](_0x48ecb6));_0x3c1a90(_0x48ecb6);})[_0x43b0('0x16')](function(_0x1b82a9){logger[_0x43b0('0x12')]('GetCmHopper',_0x1b82a9[_0x43b0('0x14')],_0x4c1ea1);_0x56dd0d(_0x265d6b[_0x43b0('0x12')](0x1f4,_0x1b82a9[_0x43b0('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 1514265..6b5ba05 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 _0x40ca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3ad024,_0x2bb57b){var _0x3b633e=function(_0x3b382b){while(--_0x3b382b){_0x3ad024['push'](_0x3ad024['shift']());}};_0x3b633e(++_0x2bb57b);}(_0x40ca,0x119));var _0xa40c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x40ca[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xa40c('0x0'));var util=require(_0xa40c('0x1'));var path=require(_0xa40c('0x2'));var timeout=require(_0xa40c('0x3'));var express=require(_0xa40c('0x4'));var router=express[_0xa40c('0x5')]();var fs_extra=require(_0xa40c('0x6'));var auth=require(_0xa40c('0x7'));var interaction=require(_0xa40c('0x8'));var config=require('../../config/environment');var controller=require(_0xa40c('0x9'));router[_0xa40c('0xa')]('/',auth[_0xa40c('0xb')](),controller[_0xa40c('0xc')]);router[_0xa40c('0xa')](_0xa40c('0xd'),auth[_0xa40c('0xb')](),controller[_0xa40c('0xe')]);router[_0xa40c('0xa')](_0xa40c('0xf'),auth[_0xa40c('0xb')](),controller['getOpenContacts']);router[_0xa40c('0xa')](_0xa40c('0x10'),auth['isAuthenticated'](),controller[_0xa40c('0x11')]);router[_0xa40c('0x12')]('/',auth[_0xa40c('0xb')](),controller[_0xa40c('0x13')]);router['post']('/preview',auth[_0xa40c('0xb')](),controller['getPreview']);router['put'](_0xa40c('0x10'),auth[_0xa40c('0xb')](),controller['update']);router['delete'](_0xa40c('0x10'),auth[_0xa40c('0xb')](),controller[_0xa40c('0x14')]);module[_0xa40c('0x15')]=router; \ No newline at end of file +var _0x476f=['index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','getPreview','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4a5d1d,_0x27fd73){var _0x4c963f=function(_0x19c0ca){while(--_0x19c0ca){_0x4a5d1d['push'](_0x4a5d1d['shift']());}};_0x4c963f(++_0x27fd73);}(_0x476f,0x80));var _0xf476=function(_0x5d56a8,_0x8acd80){_0x5d56a8=_0x5d56a8-0x0;var _0xd04a40=_0x476f[_0x5d56a8];return _0xd04a40;};'use strict';var multer=require(_0xf476('0x0'));var util=require(_0xf476('0x1'));var path=require('path');var timeout=require(_0xf476('0x2'));var express=require(_0xf476('0x3'));var router=express['Router']();var fs_extra=require(_0xf476('0x4'));var auth=require(_0xf476('0x5'));var interaction=require(_0xf476('0x6'));var config=require(_0xf476('0x7'));var controller=require('./cmHopper.controller');router[_0xf476('0x8')]('/',auth[_0xf476('0x9')](),controller[_0xf476('0xa')]);router[_0xf476('0x8')](_0xf476('0xb'),auth[_0xf476('0x9')](),controller[_0xf476('0xc')]);router[_0xf476('0x8')](_0xf476('0xd'),auth[_0xf476('0x9')](),controller[_0xf476('0xe')]);router[_0xf476('0x8')](_0xf476('0xf'),auth[_0xf476('0x9')](),controller[_0xf476('0x10')]);router[_0xf476('0x11')]('/',auth['isAuthenticated'](),controller[_0xf476('0x12')]);router[_0xf476('0x11')]('/preview',auth[_0xf476('0x9')](),controller[_0xf476('0x13')]);router[_0xf476('0x14')](_0xf476('0xf'),auth[_0xf476('0x9')](),controller[_0xf476('0x15')]);router['delete'](_0xf476('0xf'),auth[_0xf476('0x9')](),controller['destroy']);module[_0xf476('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c442cce..c3b4994 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 _0x6851=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x6851,0x1df));var _0x1685=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x6851[_0x349148];return _0x2f2b0f;};'use strict';var moment=require(_0x1685('0x0'));var Sequelize=require('sequelize');module[_0x1685('0x1')]={'phone':{'type':Sequelize[_0x1685('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1685('0x3')],'unique':_0x1685('0x4')},'ListId':{'type':Sequelize[_0x1685('0x3')],'unique':_0x1685('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xdfd2=['INTEGER','moment','exports','STRING','contactListQueue'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xdfd2,0xf6));var _0x2dfd=function(_0x16d59d,_0x348ad8){_0x16d59d=_0x16d59d-0x0;var _0x2d2ea9=_0xdfd2[_0x16d59d];return _0x2d2ea9;};'use strict';var moment=require(_0x2dfd('0x0'));var Sequelize=require('sequelize');module[_0x2dfd('0x1')]={'phone':{'type':Sequelize[_0x2dfd('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x2dfd('0x3')},'ListId':{'type':Sequelize[_0x2dfd('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2dfd('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2d6206d..864f3d1 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 _0x20f8=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x37e716,_0x409ba8){var _0x521eaf=function(_0x5df25a){while(--_0x5df25a){_0x37e716['push'](_0x37e716['shift']());}};_0x521eaf(++_0x409ba8);}(_0x20f8,0x1ea));var _0x820f=function(_0x2dd54b,_0x3214a5){_0x2dd54b=_0x2dd54b-0x0;var _0xe0a591=_0x20f8[_0x2dd54b];return _0xe0a591;};'use strict';var emlformat=require(_0x820f('0x0'));var rimraf=require(_0x820f('0x1'));var zipdir=require(_0x820f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x820f('0x3'));var Mustache=require(_0x820f('0x4'));var util=require(_0x820f('0x5'));var path=require(_0x820f('0x6'));var sox=require(_0x820f('0x7'));var csv=require(_0x820f('0x8'));var ejs=require(_0x820f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x820f('0xa'));var crypto=require(_0x820f('0xb'));var jsforce=require(_0x820f('0xc'));var deskjs=require(_0x820f('0xd'));var toCsv=require(_0x820f('0x8'));var querystring=require(_0x820f('0xe'));var Papa=require(_0x820f('0xf'));var Redis=require(_0x820f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x820f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x820f('0x12'))(_0x820f('0x13'));var utils=require(_0x820f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x820f('0x15'));var db=require(_0x820f('0x16'))['db'];function respondWithStatusCode(_0x1668fb,_0x2ddcc1){_0x2ddcc1=_0x2ddcc1||0xcc;return function(_0x53ab04){if(_0x53ab04){return _0x1668fb[_0x820f('0x17')](_0x2ddcc1);}return _0x1668fb[_0x820f('0x18')](_0x2ddcc1)[_0x820f('0x19')]();};}function respondWithResult(_0x20a292,_0x36bc9b){_0x36bc9b=_0x36bc9b||0xc8;return function(_0x305249){if(_0x305249){return _0x20a292[_0x820f('0x18')](_0x36bc9b)[_0x820f('0x1a')](_0x305249);}};}function respondWithFilteredResult(_0x5bfd19,_0x58e952){return function(_0x3b5286){if(_0x3b5286){var _0x5e54db=typeof _0x58e952[_0x820f('0x1b')]==='undefined'&&typeof _0x58e952[_0x820f('0x1c')]===_0x820f('0x1d');var _0x359838=_0x3b5286[_0x820f('0x1e')];var _0xb70918=_0x5e54db?0x0:_0x58e952[_0x820f('0x1b')];var _0xb3e1ca=_0x5e54db?_0x3b5286[_0x820f('0x1e')]:_0x58e952['offset']+_0x58e952[_0x820f('0x1c')];var _0x153dd7;if(_0xb3e1ca>=_0x359838){_0xb3e1ca=_0x359838;_0x153dd7=0xc8;}else{_0x153dd7=0xce;}_0x5bfd19['status'](_0x153dd7);return _0x5bfd19[_0x820f('0x1f')](_0x820f('0x20'),_0xb70918+'-'+_0xb3e1ca+'/'+_0x359838)['json'](_0x3b5286);}return null;};}function patchUpdates(_0x4de861){return function(_0x30a53c){try{jsonpatch['apply'](_0x30a53c,_0x4de861,!![]);}catch(_0x1d39e2){return BPromise['reject'](_0x1d39e2);}return _0x30a53c[_0x820f('0x21')]();};}function saveUpdates(_0x1350a0,_0x580c89){return function(_0x1a7dc7){if(_0x1a7dc7){return _0x1a7dc7[_0x820f('0x22')](_0x1350a0)[_0x820f('0x23')](function(_0x51b0c5){return _0x51b0c5;});}return null;};}function removeEntity(_0x427b21,_0x295730){return function(_0x39f3ca){if(_0x39f3ca){return _0x39f3ca[_0x820f('0x24')]()[_0x820f('0x23')](function(){_0x427b21[_0x820f('0x18')](0xcc)[_0x820f('0x19')]();});}};}function handleEntityNotFound(_0x2c6107,_0x119b40){return function(_0x141355){if(!_0x141355){_0x2c6107[_0x820f('0x17')](0x194);}return _0x141355;};}function handleError(_0x12951a,_0x3ac998){_0x3ac998=_0x3ac998||0x1f4;return function(_0x236bef){logger[_0x820f('0x25')](_0x236bef['stack']);if(_0x236bef['name']){delete _0x236bef[_0x820f('0x26')];}_0x12951a[_0x820f('0x18')](_0x3ac998)[_0x820f('0x27')](_0x236bef);};}exports[_0x820f('0x28')]=function(_0x3e1f42,_0x2f7c73){var _0x2428b1={},_0x5be5e1={},_0x7f42b9={'count':0x0,'rows':[]};var _0x5811f9=_[_0x820f('0x29')](db[_0x820f('0x2a')][_0x820f('0x2b')],function(_0x3dff13){return{'name':_0x3dff13[_0x820f('0x2c')],'type':_0x3dff13['type'][_0x820f('0x2d')]};});_0x5be5e1[_0x820f('0x2e')]=_[_0x820f('0x29')](_0x5811f9,_0x820f('0x26'));_0x5be5e1['query']=_[_0x820f('0x2f')](_0x3e1f42[_0x820f('0x30')]);_0x5be5e1[_0x820f('0x31')]=_[_0x820f('0x32')](_0x5be5e1[_0x820f('0x2e')],_0x5be5e1[_0x820f('0x30')]);_0x2428b1[_0x820f('0x33')]=_[_0x820f('0x32')](_0x5be5e1[_0x820f('0x2e')],qs[_0x820f('0x34')](_0x3e1f42[_0x820f('0x30')][_0x820f('0x34')]));_0x2428b1['attributes']=_0x2428b1[_0x820f('0x33')]['length']?_0x2428b1[_0x820f('0x33')]:_0x5be5e1[_0x820f('0x2e')];if(!_0x3e1f42[_0x820f('0x30')]['hasOwnProperty'](_0x820f('0x35'))){_0x2428b1[_0x820f('0x1c')]=qs[_0x820f('0x1c')](_0x3e1f42[_0x820f('0x30')][_0x820f('0x1c')]);_0x2428b1[_0x820f('0x1b')]=qs['offset'](_0x3e1f42['query'][_0x820f('0x1b')]);}_0x2428b1[_0x820f('0x36')]=qs[_0x820f('0x37')](_0x3e1f42[_0x820f('0x30')][_0x820f('0x37')]);_0x2428b1[_0x820f('0x38')]=qs[_0x820f('0x31')](_['pick'](_0x3e1f42['query'],_0x5be5e1[_0x820f('0x31')]),_0x5811f9);if(_0x3e1f42[_0x820f('0x30')][_0x820f('0x39')]){_0x2428b1[_0x820f('0x38')]=_['merge'](_0x2428b1[_0x820f('0x38')],{'$or':_[_0x820f('0x29')](_0x5811f9,function(_0x1534b3){if(_0x1534b3[_0x820f('0x3a')]!==_0x820f('0x3b')){var _0x38d29a={};_0x38d29a[_0x1534b3['name']]={'$like':'%'+_0x3e1f42['query'][_0x820f('0x39')]+'%'};return _0x38d29a;}})});}_0x2428b1=_[_0x820f('0x3c')]({},_0x2428b1,_0x3e1f42[_0x820f('0x3d')]);var _0x5acb8a={'where':_0x2428b1[_0x820f('0x38')]};return db[_0x820f('0x2a')][_0x820f('0x1e')](_0x5acb8a)[_0x820f('0x23')](function(_0x56f8dc){_0x7f42b9[_0x820f('0x1e')]=_0x56f8dc;if(_0x3e1f42[_0x820f('0x30')]['includeAll']){_0x2428b1[_0x820f('0x3e')]=[{'all':!![]}];}return db[_0x820f('0x2a')][_0x820f('0x3f')](_0x2428b1);})['then'](function(_0x2f9e69){_0x7f42b9[_0x820f('0x40')]=_0x2f9e69;return _0x7f42b9;})[_0x820f('0x23')](respondWithFilteredResult(_0x2f7c73,_0x2428b1))[_0x820f('0x41')](handleError(_0x2f7c73,null));};exports[_0x820f('0x42')]=function(_0x22b6ad,_0xe4b749){var _0x48682e={'raw':!![],'where':{'id':_0x22b6ad[_0x820f('0x43')]['id']}},_0x4a3e37={};_0x4a3e37[_0x820f('0x2e')]=_[_0x820f('0x2f')](db[_0x820f('0x2a')][_0x820f('0x2b')]);_0x4a3e37[_0x820f('0x30')]=_[_0x820f('0x2f')](_0x22b6ad['query']);_0x4a3e37[_0x820f('0x31')]=_[_0x820f('0x32')](_0x4a3e37[_0x820f('0x2e')],_0x4a3e37[_0x820f('0x30')]);_0x48682e[_0x820f('0x33')]=_[_0x820f('0x32')](_0x4a3e37[_0x820f('0x2e')],qs[_0x820f('0x34')](_0x22b6ad[_0x820f('0x30')][_0x820f('0x34')]));_0x48682e['attributes']=_0x48682e[_0x820f('0x33')][_0x820f('0x44')]?_0x48682e['attributes']:_0x4a3e37[_0x820f('0x2e')];if(_0x22b6ad[_0x820f('0x30')][_0x820f('0x45')]){_0x48682e[_0x820f('0x3e')]=[{'all':!![]}];}_0x48682e=_[_0x820f('0x3c')]({},_0x48682e,_0x22b6ad[_0x820f('0x3d')]);return db['CmHopperBlack'][_0x820f('0x46')](_0x48682e)[_0x820f('0x23')](handleEntityNotFound(_0xe4b749,null))[_0x820f('0x23')](respondWithResult(_0xe4b749,null))[_0x820f('0x41')](handleError(_0xe4b749,null));};exports[_0x820f('0x22')]=function(_0x40d2c6,_0xd16a4){if(_0x40d2c6[_0x820f('0x47')]['id']){delete _0x40d2c6[_0x820f('0x47')]['id'];}return db[_0x820f('0x2a')][_0x820f('0x46')]({'where':{'id':_0x40d2c6[_0x820f('0x43')]['id']}})[_0x820f('0x23')](handleEntityNotFound(_0xd16a4,null))[_0x820f('0x23')](saveUpdates(_0x40d2c6[_0x820f('0x47')],null))['then'](respondWithResult(_0xd16a4,null))['catch'](handleError(_0xd16a4,null));};exports[_0x820f('0x24')]=function(_0x241d9a,_0x10ebae){return db['CmHopperBlack'][_0x820f('0x46')]({'where':{'id':_0x241d9a[_0x820f('0x43')]['id']}})[_0x820f('0x23')](handleEntityNotFound(_0x10ebae,null))[_0x820f('0x23')](removeEntity(_0x10ebae,null))[_0x820f('0x41')](handleError(_0x10ebae,null));};exports[_0x820f('0x48')]=function(_0x4a9be3,_0x43409e){return db['CmHopperBlack'][_0x820f('0x48')]()[_0x820f('0x23')](respondWithResult(_0x43409e,null))[_0x820f('0x41')](handleError(_0x43409e,null));}; \ No newline at end of file +var _0xd9fb=['fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','map','options','includeAll','show','params','fields','include','merge','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','CmHopperBlack','rawAttributes'];(function(_0x2d7988,_0x1a8265){var _0x507cd7=function(_0x5bf3d3){while(--_0x5bf3d3){_0x2d7988['push'](_0x2d7988['shift']());}};_0x507cd7(++_0x1a8265);}(_0xd9fb,0x189));var _0xbd9f=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd9fb[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0xbd9f('0x0'));var rimraf=require(_0xbd9f('0x1'));var zipdir=require(_0xbd9f('0x2'));var jsonpatch=require(_0xbd9f('0x3'));var rp=require(_0xbd9f('0x4'));var moment=require(_0xbd9f('0x5'));var BPromise=require(_0xbd9f('0x6'));var Mustache=require('mustache');var util=require(_0xbd9f('0x7'));var path=require(_0xbd9f('0x8'));var sox=require('sox');var csv=require(_0xbd9f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd9f('0xa'));var _=require(_0xbd9f('0xb'));var squel=require('squel');var crypto=require(_0xbd9f('0xc'));var jsforce=require(_0xbd9f('0xd'));var deskjs=require(_0xbd9f('0xe'));var toCsv=require(_0xbd9f('0x9'));var querystring=require('querystring');var Papa=require(_0xbd9f('0xf'));var Redis=require(_0xbd9f('0x10'));var authService=require(_0xbd9f('0x11'));var qs=require(_0xbd9f('0x12'));var as=require(_0xbd9f('0x13'));var hardwareService=require(_0xbd9f('0x14'));var logger=require(_0xbd9f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbd9f('0x16'))['db'];function respondWithStatusCode(_0x5e800a,_0x16b916){_0x16b916=_0x16b916||0xcc;return function(_0x44672c){if(_0x44672c){return _0x5e800a[_0xbd9f('0x17')](_0x16b916);}return _0x5e800a['status'](_0x16b916)[_0xbd9f('0x18')]();};}function respondWithResult(_0x5beefe,_0x192fbb){_0x192fbb=_0x192fbb||0xc8;return function(_0x699e8f){if(_0x699e8f){return _0x5beefe[_0xbd9f('0x19')](_0x192fbb)[_0xbd9f('0x1a')](_0x699e8f);}};}function respondWithFilteredResult(_0x5ec72a,_0x442253){return function(_0x25557f){if(_0x25557f){var _0x104cfd=typeof _0x442253[_0xbd9f('0x1b')]===_0xbd9f('0x1c')&&typeof _0x442253[_0xbd9f('0x1d')]===_0xbd9f('0x1c');var _0x4f6181=_0x25557f['count'];var _0x35be6d=_0x104cfd?0x0:_0x442253['offset'];var _0x2f52dd=_0x104cfd?_0x25557f[_0xbd9f('0x1e')]:_0x442253[_0xbd9f('0x1b')]+_0x442253[_0xbd9f('0x1d')];var _0x2c276b;if(_0x2f52dd>=_0x4f6181){_0x2f52dd=_0x4f6181;_0x2c276b=0xc8;}else{_0x2c276b=0xce;}_0x5ec72a[_0xbd9f('0x19')](_0x2c276b);return _0x5ec72a[_0xbd9f('0x1f')](_0xbd9f('0x20'),_0x35be6d+'-'+_0x2f52dd+'/'+_0x4f6181)['json'](_0x25557f);}return null;};}function patchUpdates(_0x365775){return function(_0xdb7e4e){try{jsonpatch[_0xbd9f('0x21')](_0xdb7e4e,_0x365775,!![]);}catch(_0x144051){return BPromise[_0xbd9f('0x22')](_0x144051);}return _0xdb7e4e[_0xbd9f('0x23')]();};}function saveUpdates(_0x5f7881,_0x30e745){return function(_0x3d0d68){if(_0x3d0d68){return _0x3d0d68[_0xbd9f('0x24')](_0x5f7881)[_0xbd9f('0x25')](function(_0x4e929d){return _0x4e929d;});}return null;};}function removeEntity(_0x3bde09,_0x10697a){return function(_0x256aec){if(_0x256aec){return _0x256aec[_0xbd9f('0x26')]()['then'](function(){_0x3bde09[_0xbd9f('0x19')](0xcc)[_0xbd9f('0x18')]();});}};}function handleEntityNotFound(_0x278a10,_0x36f503){return function(_0x46fcc0){if(!_0x46fcc0){_0x278a10[_0xbd9f('0x17')](0x194);}return _0x46fcc0;};}function handleError(_0x7fd831,_0x5885d2){_0x5885d2=_0x5885d2||0x1f4;return function(_0xd89fc2){logger[_0xbd9f('0x27')](_0xd89fc2[_0xbd9f('0x28')]);if(_0xd89fc2[_0xbd9f('0x29')]){delete _0xd89fc2[_0xbd9f('0x29')];}_0x7fd831['status'](_0x5885d2)['send'](_0xd89fc2);};}exports[_0xbd9f('0x2a')]=function(_0x2b26bf,_0x1d92fa){var _0x4a8a91={},_0xe884e8={},_0x7fff9={'count':0x0,'rows':[]};var _0x294d81=_['map'](db[_0xbd9f('0x2b')][_0xbd9f('0x2c')],function(_0xcbfaa2){return{'name':_0xcbfaa2[_0xbd9f('0x2d')],'type':_0xcbfaa2[_0xbd9f('0x2e')][_0xbd9f('0x2f')]};});_0xe884e8[_0xbd9f('0x30')]=_['map'](_0x294d81,'name');_0xe884e8[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x2b26bf[_0xbd9f('0x31')]);_0xe884e8[_0xbd9f('0x33')]=_[_0xbd9f('0x34')](_0xe884e8[_0xbd9f('0x30')],_0xe884e8[_0xbd9f('0x31')]);_0x4a8a91[_0xbd9f('0x35')]=_[_0xbd9f('0x34')](_0xe884e8['model'],qs['fields'](_0x2b26bf[_0xbd9f('0x31')]['fields']));_0x4a8a91['attributes']=_0x4a8a91[_0xbd9f('0x35')][_0xbd9f('0x36')]?_0x4a8a91[_0xbd9f('0x35')]:_0xe884e8[_0xbd9f('0x30')];if(!_0x2b26bf[_0xbd9f('0x31')][_0xbd9f('0x37')](_0xbd9f('0x38'))){_0x4a8a91[_0xbd9f('0x1d')]=qs['limit'](_0x2b26bf[_0xbd9f('0x31')][_0xbd9f('0x1d')]);_0x4a8a91[_0xbd9f('0x1b')]=qs['offset'](_0x2b26bf['query'][_0xbd9f('0x1b')]);}_0x4a8a91[_0xbd9f('0x39')]=qs['sort'](_0x2b26bf[_0xbd9f('0x31')]['sort']);_0x4a8a91[_0xbd9f('0x3a')]=qs[_0xbd9f('0x33')](_[_0xbd9f('0x3b')](_0x2b26bf[_0xbd9f('0x31')],_0xe884e8[_0xbd9f('0x33')]),_0x294d81);if(_0x2b26bf['query'][_0xbd9f('0x3c')]){_0x4a8a91[_0xbd9f('0x3a')]=_['merge'](_0x4a8a91[_0xbd9f('0x3a')],{'$or':_[_0xbd9f('0x3d')](_0x294d81,function(_0x356548){if(_0x356548[_0xbd9f('0x2e')]!=='VIRTUAL'){var _0x3ee34e={};_0x3ee34e[_0x356548[_0xbd9f('0x29')]]={'$like':'%'+_0x2b26bf[_0xbd9f('0x31')][_0xbd9f('0x3c')]+'%'};return _0x3ee34e;}})});}_0x4a8a91=_['merge']({},_0x4a8a91,_0x2b26bf[_0xbd9f('0x3e')]);var _0x315291={'where':_0x4a8a91[_0xbd9f('0x3a')]};return db[_0xbd9f('0x2b')]['count'](_0x315291)['then'](function(_0x39eb9e){_0x7fff9[_0xbd9f('0x1e')]=_0x39eb9e;if(_0x2b26bf['query'][_0xbd9f('0x3f')]){_0x4a8a91['include']=[{'all':!![]}];}return db[_0xbd9f('0x2b')]['findAll'](_0x4a8a91);})[_0xbd9f('0x25')](function(_0x342ada){_0x7fff9['rows']=_0x342ada;return _0x7fff9;})['then'](respondWithFilteredResult(_0x1d92fa,_0x4a8a91))['catch'](handleError(_0x1d92fa,null));};exports[_0xbd9f('0x40')]=function(_0x23816d,_0x533339){var _0x5a4739={'raw':!![],'where':{'id':_0x23816d[_0xbd9f('0x41')]['id']}},_0x163e36={};_0x163e36[_0xbd9f('0x30')]=_[_0xbd9f('0x32')](db['CmHopperBlack'][_0xbd9f('0x2c')]);_0x163e36[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x23816d[_0xbd9f('0x31')]);_0x163e36[_0xbd9f('0x33')]=_['intersection'](_0x163e36[_0xbd9f('0x30')],_0x163e36[_0xbd9f('0x31')]);_0x5a4739[_0xbd9f('0x35')]=_[_0xbd9f('0x34')](_0x163e36['model'],qs[_0xbd9f('0x42')](_0x23816d[_0xbd9f('0x31')][_0xbd9f('0x42')]));_0x5a4739['attributes']=_0x5a4739['attributes'][_0xbd9f('0x36')]?_0x5a4739[_0xbd9f('0x35')]:_0x163e36[_0xbd9f('0x30')];if(_0x23816d[_0xbd9f('0x31')]['includeAll']){_0x5a4739[_0xbd9f('0x43')]=[{'all':!![]}];}_0x5a4739=_[_0xbd9f('0x44')]({},_0x5a4739,_0x23816d[_0xbd9f('0x3e')]);return db[_0xbd9f('0x2b')]['find'](_0x5a4739)['then'](handleEntityNotFound(_0x533339,null))[_0xbd9f('0x25')](respondWithResult(_0x533339,null))[_0xbd9f('0x45')](handleError(_0x533339,null));};exports[_0xbd9f('0x24')]=function(_0x585065,_0x381646){if(_0x585065[_0xbd9f('0x46')]['id']){delete _0x585065[_0xbd9f('0x46')]['id'];}return db[_0xbd9f('0x2b')][_0xbd9f('0x47')]({'where':{'id':_0x585065[_0xbd9f('0x41')]['id']}})[_0xbd9f('0x25')](handleEntityNotFound(_0x381646,null))[_0xbd9f('0x25')](saveUpdates(_0x585065[_0xbd9f('0x46')],null))[_0xbd9f('0x25')](respondWithResult(_0x381646,null))[_0xbd9f('0x45')](handleError(_0x381646,null));};exports[_0xbd9f('0x26')]=function(_0x1e8d5a,_0x30f6e8){return db[_0xbd9f('0x2b')]['find']({'where':{'id':_0x1e8d5a[_0xbd9f('0x41')]['id']}})['then'](handleEntityNotFound(_0x30f6e8,null))[_0xbd9f('0x25')](removeEntity(_0x30f6e8,null))[_0xbd9f('0x45')](handleError(_0x30f6e8,null));};exports['describe']=function(_0x52a85f,_0x3334c6){return db[_0xbd9f('0x2b')][_0xbd9f('0x48')]()[_0xbd9f('0x25')](respondWithResult(_0x3334c6,null))[_0xbd9f('0x45')](handleError(_0x3334c6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3f0fe78..f3eae2f 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 _0x7342=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x437b14,_0xcf17d4){var _0x1ad24e=function(_0x44b236){while(--_0x44b236){_0x437b14['push'](_0x437b14['shift']());}};_0x1ad24e(++_0xcf17d4);}(_0x7342,0x1d6));var _0x2734=function(_0x52ab32,_0x3b3264){_0x52ab32=_0x52ab32-0x0;var _0x280d56=_0x7342[_0x52ab32];return _0x280d56;};'use strict';var _=require(_0x2734('0x0'));var util=require(_0x2734('0x1'));var logger=require(_0x2734('0x2'))(_0x2734('0x3'));var moment=require(_0x2734('0x4'));var BPromise=require(_0x2734('0x5'));var rp=require(_0x2734('0x6'));var fs=require('fs');var path=require(_0x2734('0x7'));var rimraf=require(_0x2734('0x8'));var config=require(_0x2734('0x9'));var attributes=require(_0x2734('0xa'));module['exports']=function(_0x2d67bc,_0x24e383){return _0x2d67bc[_0x2734('0xb')](_0x2734('0xc'),attributes,{'tableName':_0x2734('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeedf=['moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x51a445,_0x3a705d){var _0x26ba52=function(_0x4917c4){while(--_0x4917c4){_0x51a445['push'](_0x51a445['shift']());}};_0x26ba52(++_0x3a705d);}(_0xeedf,0xe6));var _0xfeed=function(_0x413e73,_0x2a8d07){_0x413e73=_0x413e73-0x0;var _0x324c77=_0xeedf[_0x413e73];return _0x324c77;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))(_0xfeed('0x3'));var moment=require(_0xfeed('0x4'));var BPromise=require(_0xfeed('0x5'));var rp=require(_0xfeed('0x6'));var fs=require('fs');var path=require(_0xfeed('0x7'));var rimraf=require(_0xfeed('0x8'));var config=require('../../config/environment');var attributes=require(_0xfeed('0x9'));module['exports']=function(_0x391f2b,_0x519e3b){return _0x391f2b[_0xfeed('0xa')](_0xfeed('0xb'),attributes,{'tableName':_0xfeed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index d8ed2d3..903160a 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 _0x29d9=['client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','GetCmHopperBlack','body','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x53fa2d,_0x4b6c99){var _0x2c9f9f=function(_0x1a892d){while(--_0x1a892d){_0x53fa2d['push'](_0x53fa2d['shift']());}};_0x2c9f9f(++_0x4b6c99);}(_0x29d9,0xf6));var _0x929d=function(_0x3e3c3c,_0x58c0f4){_0x3e3c3c=_0x3e3c3c-0x0;var _0x4b3dc6=_0x29d9[_0x3e3c3c];return _0x4b3dc6;};'use strict';var _=require(_0x929d('0x0'));var util=require('util');var moment=require(_0x929d('0x1'));var BPromise=require(_0x929d('0x2'));var rs=require(_0x929d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x929d('0x4'))['db'];var utils=require(_0x929d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x929d('0x6')][_0x929d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b18cf,_0x51aac8,_0x2645a0){return new BPromise(function(_0x18423b,_0x30dea9){return client[_0x929d('0x8')](_0x1b18cf,_0x2645a0)['then'](function(_0x420aaa){logger[_0x929d('0x9')](_0x929d('0xa'),_0x51aac8,_0x929d('0xb'));logger[_0x929d('0xc')](_0x929d('0xd'),_0x51aac8,_0x929d('0xb'),JSON[_0x929d('0xe')](_0x420aaa));if(_0x420aaa[_0x929d('0xf')]){if(_0x420aaa[_0x929d('0xf')][_0x929d('0x10')]===0x1f4){logger[_0x929d('0xf')](_0x929d('0xa'),_0x51aac8,_0x420aaa['error']['message']);return _0x30dea9(_0x420aaa['error'][_0x929d('0x11')]);}logger[_0x929d('0xf')](_0x929d('0xa'),_0x51aac8,_0x420aaa[_0x929d('0xf')]['message']);return _0x18423b(_0x420aaa[_0x929d('0xf')]['message']);}else{logger[_0x929d('0x9')](_0x929d('0xa'),_0x51aac8,_0x929d('0xb'));_0x18423b(_0x420aaa[_0x929d('0x12')]['message']);}})[_0x929d('0x13')](function(_0x5dd91b){logger[_0x929d('0xf')](_0x929d('0xa'),_0x51aac8,_0x5dd91b);_0x30dea9(_0x5dd91b);});});}exports['GetCmHopperBlack']=function(_0x51e2eb){var _0x1941c0=this;return new Promise(function(_0x17e4f2,_0x4be814){return db[_0x929d('0x14')][_0x929d('0x15')]({'raw':_0x51e2eb[_0x929d('0x16')]?_0x51e2eb['options'][_0x929d('0x17')]===undefined?!![]:![]:!![],'where':_0x51e2eb[_0x929d('0x16')]?_0x51e2eb[_0x929d('0x16')][_0x929d('0x18')]||null:null,'attributes':_0x51e2eb[_0x929d('0x16')]?_0x51e2eb[_0x929d('0x16')]['attributes']||null:null,'limit':_0x51e2eb['options']?_0x51e2eb['options'][_0x929d('0x19')]||null:null,'include':_0x51e2eb[_0x929d('0x16')]?_0x51e2eb[_0x929d('0x16')][_0x929d('0x1a')]?_[_0x929d('0x1b')](_0x51e2eb[_0x929d('0x16')][_0x929d('0x1a')],function(_0x1c00b3){return{'model':db[_0x1c00b3[_0x929d('0x1c')]],'as':_0x1c00b3['as'],'attributes':_0x1c00b3[_0x929d('0x1d')],'include':_0x1c00b3[_0x929d('0x1a')]?_[_0x929d('0x1b')](_0x1c00b3['include'],function(_0x59a999){return{'model':db[_0x59a999[_0x929d('0x1c')]],'as':_0x59a999['as'],'attributes':_0x59a999['attributes'],'include':_0x59a999[_0x929d('0x1a')]?_[_0x929d('0x1b')](_0x59a999['include'],function(_0x4dc14a){return{'model':db[_0x4dc14a[_0x929d('0x1c')]],'as':_0x4dc14a['as'],'attributes':_0x4dc14a[_0x929d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a5b21){logger[_0x929d('0x9')](_0x929d('0x1e'),_0x51e2eb);logger[_0x929d('0xc')](_0x929d('0x1e'),_0x51e2eb,JSON[_0x929d('0xe')](_0x1a5b21));_0x17e4f2(_0x1a5b21);})[_0x929d('0x13')](function(_0x5e703d){logger[_0x929d('0xf')](_0x929d('0x1e'),_0x5e703d['message'],_0x51e2eb);_0x4be814(_0x1941c0['error'](0x1f4,_0x5e703d['message']));});});};exports['UpdateCmHopperBlack']=function(_0x1b343c){var _0xc20d45=this;return new Promise(function(_0x122f81,_0x9803ae){return db[_0x929d('0x14')]['update'](_0x1b343c[_0x929d('0x1f')],{'raw':_0x1b343c[_0x929d('0x16')]?_0x1b343c[_0x929d('0x16')][_0x929d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b343c[_0x929d('0x16')]?_0x1b343c[_0x929d('0x16')]['where']||null:null,'attributes':_0x1b343c['options']?_0x1b343c[_0x929d('0x16')][_0x929d('0x1d')]||null:null,'limit':_0x1b343c['options']?_0x1b343c['options'][_0x929d('0x19')]||null:null})[_0x929d('0x20')](function(_0x203ef8){logger[_0x929d('0x9')](_0x929d('0x21'),_0x1b343c);logger['debug'](_0x929d('0x21'),_0x1b343c,JSON['stringify'](_0x203ef8));_0x122f81(_0x203ef8);})[_0x929d('0x13')](function(_0x34b14f){logger[_0x929d('0xf')](_0x929d('0x21'),_0x34b14f[_0x929d('0x11')],_0x1b343c);_0x9803ae(_0xc20d45['error'](0x1f4,_0x34b14f['message']));});});};exports[_0x929d('0x22')]=function(_0x33c439){var _0x4fffcd=this;return new Promise(function(_0x26db17,_0x51dba9){return db[_0x929d('0x14')][_0x929d('0x23')]({'where':_0x33c439[_0x929d('0x16')]?_0x33c439[_0x929d('0x16')]['where']||null:null})[_0x929d('0x20')](function(_0x516406){logger['info'](_0x929d('0x22'),_0x33c439);logger[_0x929d('0xc')](_0x929d('0x22'),_0x33c439,JSON[_0x929d('0xe')](_0x516406));_0x26db17(_0x516406);})['catch'](function(_0x17a556){logger['error']('DestroyCmHopperBlack',_0x17a556[_0x929d('0x11')],_0x33c439);_0x51dba9(_0x4fffcd[_0x929d('0xf')](0x1f4,_0x17a556[_0x929d('0x11')]));});});}; \ No newline at end of file +var _0x9ede=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9ede,0x120));var _0xe9ed=function(_0x2e018b,_0x5bdbbf){_0x2e018b=_0x2e018b-0x0;var _0x5a5caa=_0x9ede[_0x2e018b];return _0x5a5caa;};'use strict';var _=require(_0xe9ed('0x0'));var util=require(_0xe9ed('0x1'));var moment=require(_0xe9ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9ed('0x3'));var db=require(_0xe9ed('0x4'))['db'];var utils=require(_0xe9ed('0x5'));var logger=require(_0xe9ed('0x6'))(_0xe9ed('0x7'));var config=require(_0xe9ed('0x8'));var jayson=require(_0xe9ed('0x9'));var client=jayson['client'][_0xe9ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5208cb,_0x189369,_0x5d4763){return new BPromise(function(_0x3b0a87,_0x45c056){return client[_0xe9ed('0xb')](_0x5208cb,_0x5d4763)['then'](function(_0x18b374){logger[_0xe9ed('0xc')](_0xe9ed('0xd'),_0x189369,_0xe9ed('0xe'));logger[_0xe9ed('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x189369,_0xe9ed('0xe'),JSON[_0xe9ed('0x10')](_0x18b374));if(_0x18b374[_0xe9ed('0x11')]){if(_0x18b374[_0xe9ed('0x11')][_0xe9ed('0x12')]===0x1f4){logger[_0xe9ed('0x11')](_0xe9ed('0xd'),_0x189369,_0x18b374['error'][_0xe9ed('0x13')]);return _0x45c056(_0x18b374[_0xe9ed('0x11')][_0xe9ed('0x13')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x189369,_0x18b374[_0xe9ed('0x11')][_0xe9ed('0x13')]);return _0x3b0a87(_0x18b374[_0xe9ed('0x11')][_0xe9ed('0x13')]);}else{logger['info'](_0xe9ed('0xd'),_0x189369,_0xe9ed('0xe'));_0x3b0a87(_0x18b374['result'][_0xe9ed('0x13')]);}})[_0xe9ed('0x14')](function(_0x23b2e1){logger[_0xe9ed('0x11')](_0xe9ed('0xd'),_0x189369,_0x23b2e1);_0x45c056(_0x23b2e1);});});}exports[_0xe9ed('0x15')]=function(_0x52051d){var _0x5a2650=this;return new Promise(function(_0x1786f0,_0x2a5bf6){return db[_0xe9ed('0x16')][_0xe9ed('0x17')]({'raw':_0x52051d['options']?_0x52051d[_0xe9ed('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52051d['options']?_0x52051d[_0xe9ed('0x18')][_0xe9ed('0x19')]||null:null,'attributes':_0x52051d[_0xe9ed('0x18')]?_0x52051d[_0xe9ed('0x18')][_0xe9ed('0x1a')]||null:null,'limit':_0x52051d[_0xe9ed('0x18')]?_0x52051d[_0xe9ed('0x18')][_0xe9ed('0x1b')]||null:null,'include':_0x52051d[_0xe9ed('0x18')]?_0x52051d['options'][_0xe9ed('0x1c')]?_[_0xe9ed('0x1d')](_0x52051d[_0xe9ed('0x18')]['include'],function(_0x1fca0e){return{'model':db[_0x1fca0e['model']],'as':_0x1fca0e['as'],'attributes':_0x1fca0e[_0xe9ed('0x1a')],'include':_0x1fca0e[_0xe9ed('0x1c')]?_[_0xe9ed('0x1d')](_0x1fca0e[_0xe9ed('0x1c')],function(_0x55ada8){return{'model':db[_0x55ada8[_0xe9ed('0x1e')]],'as':_0x55ada8['as'],'attributes':_0x55ada8[_0xe9ed('0x1a')],'include':_0x55ada8[_0xe9ed('0x1c')]?_[_0xe9ed('0x1d')](_0x55ada8[_0xe9ed('0x1c')],function(_0x4f41c6){return{'model':db[_0x4f41c6[_0xe9ed('0x1e')]],'as':_0x4f41c6['as'],'attributes':_0x4f41c6[_0xe9ed('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x259ea0){logger['info'](_0xe9ed('0x15'),_0x52051d);logger[_0xe9ed('0xf')](_0xe9ed('0x15'),_0x52051d,JSON[_0xe9ed('0x10')](_0x259ea0));_0x1786f0(_0x259ea0);})['catch'](function(_0x49101b){logger['error'](_0xe9ed('0x15'),_0x49101b[_0xe9ed('0x13')],_0x52051d);_0x2a5bf6(_0x5a2650[_0xe9ed('0x11')](0x1f4,_0x49101b[_0xe9ed('0x13')]));});});};exports[_0xe9ed('0x1f')]=function(_0x582131){var _0x37a6fc=this;return new Promise(function(_0x6f689e,_0x434566){return db[_0xe9ed('0x16')][_0xe9ed('0x20')](_0x582131[_0xe9ed('0x21')],{'raw':_0x582131[_0xe9ed('0x18')]?_0x582131[_0xe9ed('0x18')][_0xe9ed('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x582131[_0xe9ed('0x18')]?_0x582131[_0xe9ed('0x18')][_0xe9ed('0x19')]||null:null,'attributes':_0x582131['options']?_0x582131[_0xe9ed('0x18')][_0xe9ed('0x1a')]||null:null,'limit':_0x582131['options']?_0x582131[_0xe9ed('0x18')]['limit']||null:null})['then'](function(_0x42902d){logger['info'](_0xe9ed('0x1f'),_0x582131);logger[_0xe9ed('0xf')](_0xe9ed('0x1f'),_0x582131,JSON[_0xe9ed('0x10')](_0x42902d));_0x6f689e(_0x42902d);})['catch'](function(_0x3e4d30){logger['error'](_0xe9ed('0x1f'),_0x3e4d30[_0xe9ed('0x13')],_0x582131);_0x434566(_0x37a6fc['error'](0x1f4,_0x3e4d30[_0xe9ed('0x13')]));});});};exports[_0xe9ed('0x23')]=function(_0x1abda3){var _0x3b314e=this;return new Promise(function(_0x5298a3,_0x59e7dd){return db[_0xe9ed('0x16')]['destroy']({'where':_0x1abda3[_0xe9ed('0x18')]?_0x1abda3['options'][_0xe9ed('0x19')]||null:null})['then'](function(_0x39c6dc){logger[_0xe9ed('0xc')](_0xe9ed('0x23'),_0x1abda3);logger[_0xe9ed('0xf')]('DestroyCmHopperBlack',_0x1abda3,JSON[_0xe9ed('0x10')](_0x39c6dc));_0x5298a3(_0x39c6dc);})[_0xe9ed('0x14')](function(_0x34f951){logger[_0xe9ed('0x11')](_0xe9ed('0x23'),_0x34f951[_0xe9ed('0x13')],_0x1abda3);_0x59e7dd(_0x3b314e['error'](0x1f4,_0x34f951[_0xe9ed('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b8f19de..bbd6786 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 _0xabce=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe'];(function(_0x524c9e,_0x587eff){var _0x3126dc=function(_0x433865){while(--_0x433865){_0x524c9e['push'](_0x524c9e['shift']());}};_0x3126dc(++_0x587eff);}(_0xabce,0x103));var _0xeabc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xabce[_0x543084];return _0x306a57;};'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('./cmHopperBlack.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('0xc')](_0xeabc('0xd'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xe')]);router[_0xeabc('0xf')](_0xeabc('0xd'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);module[_0xeabc('0x11')]=router; \ No newline at end of file +var _0xf2e3=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy'];(function(_0xa861aa,_0x2895a4){var _0x1e34de=function(_0x41ed53){while(--_0x41ed53){_0xa861aa['push'](_0xa861aa['shift']());}};_0x1e34de(++_0x2895a4);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xf2e3[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0x11')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0x13')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);module[_0x3f2e('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index be20831..7c0ac28 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 _0xfd40=['dispositionat','BOOLEAN','sequelize','moment','exports','DATE','INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x124a53,_0x64c1b9){var _0x24cdea=function(_0x51fadc){while(--_0x51fadc){_0x124a53['push'](_0x124a53['shift']());}};_0x24cdea(++_0x64c1b9);}(_0xfd40,0x1ec));var _0x0fd4=function(_0x32fb11,_0x513b41){_0x32fb11=_0x32fb11-0x0;var _0x25547e=_0xfd40[_0x32fb11];return _0x25547e;};'use strict';var Sequelize=require(_0x0fd4('0x0'));var moment=require(_0x0fd4('0x1'));module[_0x0fd4('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x0fd4('0x3')]},'countbusyretry':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0fd4('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x0fd4('0x5')]},'originatecalleridname':{'type':Sequelize[_0x0fd4('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0fd4('0x5')]},'starttime':{'type':Sequelize[_0x0fd4('0x3')]},'responsetime':{'type':Sequelize[_0x0fd4('0x3')]},'answertime':{'type':Sequelize[_0x0fd4('0x3')]},'droptime':{'type':Sequelize[_0x0fd4('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0fd4('0x5')]},'campaign':{'type':Sequelize[_0x0fd4('0x5')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0fd4('0x5')]},'reason':{'type':Sequelize[_0x0fd4('0x5')]},'disposition':{'type':Sequelize[_0x0fd4('0x5')]},'secondDisposition':{'type':Sequelize[_0x0fd4('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0fd4('0x5')]},'dispositionat':{'type':Sequelize[_0x0fd4('0x3')],'set':function(_0x24006d){var _0x35b474=this[_0x0fd4('0x6')](_0x0fd4('0x7'));if(_0x35b474&&_0x24006d){this[_0x0fd4('0x8')](_0x0fd4('0x9'),moment(_0x24006d)[_0x0fd4('0xa')](moment(_0x35b474),_0x0fd4('0xb')));}return this[_0x0fd4('0x8')](_0x0fd4('0xc'),_0x24006d);}},'amd':{'type':Sequelize[_0x0fd4('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0fd4('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0fd4('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0fd4('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0fd4('0x3')]},'callback':{'type':Sequelize[_0x0fd4('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0fd4('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x0fd4('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0fd4('0x3')]},'recallme':{'type':Sequelize[_0x0fd4('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0fd4('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0fd4('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8ac6=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','dispositionat','BOOLEAN','sequelize'];(function(_0x333137,_0x139fc2){var _0x2657f4=function(_0x36ceb1){while(--_0x36ceb1){_0x333137['push'](_0x333137['shift']());}};_0x2657f4(++_0x139fc2);}(_0x8ac6,0x9b));var _0x68ac=function(_0x55cb3d,_0x3926ce){_0x55cb3d=_0x55cb3d-0x0;var _0x4e5c6d=_0x8ac6[_0x55cb3d];return _0x4e5c6d;};'use strict';var Sequelize=require(_0x68ac('0x0'));var moment=require(_0x68ac('0x1'));module[_0x68ac('0x2')]={'state':{'type':Sequelize[_0x68ac('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x68ac('0x4')]},'scheduledat':{'type':Sequelize[_0x68ac('0x5')]},'countbusyretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x68ac('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x68ac('0x4')]},'originatecalleridname':{'type':Sequelize[_0x68ac('0x4')]},'calleridnum':{'type':Sequelize[_0x68ac('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x68ac('0x5')]},'responsetime':{'type':Sequelize[_0x68ac('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x68ac('0x5')]},'endtime':{'type':Sequelize[_0x68ac('0x5')]},'ringtime':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x68ac('0x4')]},'campaign':{'type':Sequelize[_0x68ac('0x4')]},'campaigntype':{'type':Sequelize[_0x68ac('0x4')]},'membername':{'type':Sequelize[_0x68ac('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x68ac('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x68ac('0x4')]},'dispositionat':{'type':Sequelize[_0x68ac('0x5')],'set':function(_0x48ea5e){var _0x32e04f=this[_0x68ac('0x6')](_0x68ac('0x7'));if(_0x32e04f&&_0x48ea5e){this[_0x68ac('0x8')](_0x68ac('0x9'),moment(_0x48ea5e)['diff'](moment(_0x32e04f),'seconds'));}return this[_0x68ac('0x8')](_0x68ac('0xa'),_0x48ea5e);}},'amd':{'type':Sequelize[_0x68ac('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x68ac('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x68ac('0x5')]},'callback':{'type':Sequelize[_0x68ac('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x68ac('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x68ac('0x5')]},'deleted':{'type':Sequelize[_0x68ac('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x68ac('0x5')]},'recallme':{'type':Sequelize[_0x68ac('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x68ac('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x68ac('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 26206f7..159aa10 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 _0xadb5=['`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','VoiceQueue','find','insert','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','Campaign','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','VoiceQueueId','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','CmHopperFinal','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x356102,_0xdb5cc8){var _0x4faa04=function(_0x36113d){while(--_0x36113d){_0x356102['push'](_0x356102['shift']());}};_0x4faa04(++_0xdb5cc8);}(_0xadb5,0xad));var _0x5adb=function(_0x34e1a6,_0x35646a){_0x34e1a6=_0x34e1a6-0x0;var _0x52ed88=_0xadb5[_0x34e1a6];return _0x52ed88;};'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['CmHopperFinal']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')]()['then'](respondWithResult(_0x3a5409,null))[_0x5adb('0x42')](handleError(_0x3a5409,null));};exports['update']=function(_0x51bc49,_0x5015ee){if(_0x51bc49[_0x5adb('0x47')][_0x5adb('0x48')]){delete _0x51bc49[_0x5adb('0x47')]['uniqueid'];}return db[_0x5adb('0x2a')]['find']({'where':{'uniqueid':_0x51bc49[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x5015ee,null))[_0x5adb('0x22')](saveUpdates(_0x51bc49['body'],null))[_0x5adb('0x22')](respondWithResult(_0x5015ee,null))['catch'](handleError(_0x5015ee,null));};exports[_0x5adb('0x49')]=function(_0x6dc067,_0x55c535,_0x2402a3){return db[_0x5adb('0x2a')][_0x5adb('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x6dc067[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x4c')))),'noSuchContacts'],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize'][_0x5adb('0x4b')](_0x5adb('0x4e')))),_0x5adb('0x4f')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x52')))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),_0x5adb('0x58')],[db[_0x5adb('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})['then'](handleEntityNotFound(_0x55c535,null))[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x42')](handleError(_0x55c535,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5cb50e,_0x476e62,_0x1505f7){return db['CmHopperFinal'][_0x5adb('0x40')]({'raw':![],'where':{'CampaignId':_0x5cb50e[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x4c')))),_0x5adb('0x5b')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x5adb('0x4f')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})[_0x5adb('0x22')](handleEntityNotFound(_0x476e62,null))[_0x5adb('0x22')](respondWithResult(_0x476e62,null))[_0x5adb('0x42')](handleError(_0x476e62,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5e55c2,_0x1fc73b,_0x56df90){return db[_0x5adb('0x5c')][_0x5adb('0x5d')]({'where':{'id':_0x5e55c2[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x1fc73b,null))[_0x5adb('0x22')](function(_0x236f59){var _0x338aee;if(_0x236f59){_0x338aee=squel[_0x5adb('0x5e')]()['into'](_0x5adb('0x5f'))[_0x5adb('0x60')]([_0x5adb('0x61'),'scheduledAt',_0x5adb('0x62'),_0x5adb('0x63'),'VoiceQueueId',_0x5adb('0x64'),'updatedAt'],squel[_0x5adb('0x65')]()[_0x5adb('0x66')]('ANY_VALUE(calleridnum)',_0x5adb('0x61'))[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')]('ANY_VALUE(ListId)',_0x5adb('0x63'))[_0x5adb('0x66')](_0x5adb('0x6a'),'VoiceQueueId')['field'](_0x5adb('0x67'),'createdAt')[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x6b'))['from'](_0x5adb('0x6c'))[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())['where'](_0x5adb('0x6f'),_0x5e55c2[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())['where'](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x61'))[_0x5adb('0x73')]('cm_hopper')[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2['params']['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5adb('0x65')]()['field'](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')]('VoiceQueueId\x20=\x20?',_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')]('ContactId'))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')][_0x5adb('0x2f')](_0x338aee);}return[];})[_0x5adb('0x22')](respondWithResult(_0x1fc73b,null))['catch'](handleError(_0x1fc73b,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x3f3db9,_0x461a07,_0x2e5c96){return db[_0x5adb('0x77')][_0x5adb('0x5d')]({'where':{'id':_0x3f3db9[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x461a07,null))['then'](function(_0xda26cc){var _0x14bada;if(_0xda26cc){_0x14bada=squel[_0x5adb('0x5e')]()[_0x5adb('0x78')]('cm_hopper')[_0x5adb('0x60')]([_0x5adb('0x61'),_0x5adb('0x68'),_0x5adb('0x62'),_0x5adb('0x63'),_0x5adb('0x79'),_0x5adb('0x64'),_0x5adb('0x6b')],squel[_0x5adb('0x65')]()['field'](_0x5adb('0x7a'),_0x5adb('0x61'))['field'](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')](_0x5adb('0x7b'),_0x5adb('0x63'))['field'](_0x5adb('0x7c'),_0x5adb('0x79'))['field'](_0x5adb('0x67'),_0x5adb('0x64'))[_0x5adb('0x66')]('NOW()','updatedAt')[_0x5adb('0x73')](_0x5adb('0x6c'))[_0x5adb('0x37')]('CampaignId\x20=\x20?',_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x6f'),_0x3f3db9[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()['field']('phone')[_0x5adb('0x73')](_0x5adb('0x5f'))['where'](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id']['toString']())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')](_0x5adb('0x62')))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')]['query'](_0x14bada);}return[];})[_0x5adb('0x22')](respondWithResult(_0x461a07,null))[_0x5adb('0x42')](handleError(_0x461a07,null));};exports[_0x5adb('0x7e')]=function(_0x1e5532,_0x2c3af8,_0x3a201a){return db[_0x5adb('0x7f')][_0x5adb('0x80')]({'where':{'VoiceQueueId':_0x1e5532[_0x5adb('0x47')][_0x5adb('0x81')],'CampaignId':_0x1e5532['body'][_0x5adb('0x79')],'ContactId':_0x1e5532['body'][_0x5adb('0x62')]}})[_0x5adb('0x22')](handleEntityNotFound(_0x2c3af8,null))[_0x5adb('0x22')](function(_0x193a29){if(_0x193a29){return _0x193a29;}return null;})[_0x5adb('0x22')](respondWithResult(_0x2c3af8,null))['catch'](handleError(_0x2c3af8,null));}; \ No newline at end of file +var _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x13ea36,_0x2805ad){var _0x312066=function(_0xfbee88){while(--_0xfbee88){_0x13ea36['push'](_0x13ea36['shift']());}};_0x312066(++_0x2805ad);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ce82377..fac78b5 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 _0x2a44=['define','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x204c64,_0x5960b7){var _0x33c2e6=function(_0x3f46da){while(--_0x3f46da){_0x204c64['push'](_0x204c64['shift']());}};_0x33c2e6(++_0x5960b7);}(_0x2a44,0x66));var _0x42a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a44[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x42a4('0x0'));var logger=require(_0x42a4('0x1'))('api');var moment=require(_0x42a4('0x2'));var BPromise=require(_0x42a4('0x3'));var rp=require(_0x42a4('0x4'));var fs=require('fs');var path=require(_0x42a4('0x5'));var rimraf=require(_0x42a4('0x6'));var config=require(_0x42a4('0x7'));var attributes=require(_0x42a4('0x8'));module[_0x42a4('0x9')]=function(_0x37b5dd,_0x1ce3db){return _0x37b5dd[_0x42a4('0xa')]('CmHopperFinal',attributes,{'tableName':_0x42a4('0xb'),'paranoid':![],'indexes':[{'name':_0x42a4('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x42a4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x26df=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0xe66e24,_0x3688c1){var _0x586475=function(_0x367c5d){while(--_0x367c5d){_0xe66e24['push'](_0xe66e24['shift']());}};_0x586475(++_0x3688c1);}(_0x26df,0x106));var _0xf26d=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0x26df[_0x3bceea];return _0x30a8d3;};'use strict';var _=require(_0xf26d('0x0'));var util=require(_0xf26d('0x1'));var logger=require(_0xf26d('0x2'))(_0xf26d('0x3'));var moment=require(_0xf26d('0x4'));var BPromise=require('bluebird');var rp=require(_0xf26d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26d('0x6'));var config=require(_0xf26d('0x7'));var attributes=require(_0xf26d('0x8'));module[_0xf26d('0x9')]=function(_0x1596a2,_0x1d9f2a){return _0x1596a2[_0xf26d('0xa')](_0xf26d('0xb'),attributes,{'tableName':_0xf26d('0xc'),'paranoid':![],'indexes':[{'name':_0xf26d('0xd'),'fields':[_0xf26d('0xd')]},{'name':_0xf26d('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 7fb72c6..352c28e 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x6f3edd,_0x3e687a){var _0x125bfe=function(_0x29b2b5){while(--_0x29b2b5){_0x6f3edd['push'](_0x6f3edd['shift']());}};_0x125bfe(++_0x3e687a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cd675,_0x352cca){_0x5cd675=_0x5cd675-0x0;var _0x2379b0=_0xb10b[_0x5cd675];return _0x2379b0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x578638,_0x30ee19){var _0x4db853=function(_0x4609bb){while(--_0x4609bb){_0x578638['push'](_0x578638['shift']());}};_0x4db853(++_0x30ee19);}(_0xb10b,0x12a));var _0xbb10=function(_0x2dbf6d,_0x1ed975){_0x2dbf6d=_0x2dbf6d-0x0;var _0x269475=_0xb10b[_0x2dbf6d];return _0x269475;};'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 9a34639..dde041e 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 _0x7887=['put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper'];(function(_0x3b306c,_0x2edb3f){var _0x2119dd=function(_0xab8b89){while(--_0xab8b89){_0x3b306c['push'](_0x3b306c['shift']());}};_0x2119dd(++_0x2edb3f);}(_0x7887,0x1b3));var _0x7788=function(_0x50db5c,_0x1114f6){_0x50db5c=_0x50db5c-0x0;var _0x42aa85=_0x7887[_0x50db5c];return _0x42aa85;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7788('0x0'));var timeout=require(_0x7788('0x1'));var express=require(_0x7788('0x2'));var router=express[_0x7788('0x3')]();var fs_extra=require(_0x7788('0x4'));var auth=require(_0x7788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7788('0x6'));var controller=require('./cmHopperFinal.controller');router[_0x7788('0x7')]('/',auth[_0x7788('0x8')](),controller['index']);router[_0x7788('0x7')](_0x7788('0x9'),auth[_0x7788('0x8')](),controller[_0x7788('0xa')]);router[_0x7788('0x7')](_0x7788('0xb'),auth[_0x7788('0x8')](),controller[_0x7788('0xc')]);router[_0x7788('0x7')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x7788('0xd')]);router[_0x7788('0x7')](_0x7788('0xe'),auth[_0x7788('0x8')](),controller[_0x7788('0xf')]);router[_0x7788('0x10')]('/voice/queue/moveContacts/:id',auth[_0x7788('0x8')](),controller[_0x7788('0x11')]);router[_0x7788('0x10')](_0x7788('0x12'),auth[_0x7788('0x8')](),controller[_0x7788('0x13')]);router[_0x7788('0x10')]('/checkContactHopper',auth[_0x7788('0x8')](),controller[_0x7788('0x14')]);router[_0x7788('0x15')]('/:id',auth[_0x7788('0x8')](),controller[_0x7788('0x16')]);module[_0x7788('0x17')]=router; \ No newline at end of file +var _0xf229=['isAuthenticated','index','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2df85f,_0x2a4de7){var _0x44dde0=function(_0x3ed6dc){while(--_0x3ed6dc){_0x2df85f['push'](_0x2df85f['shift']());}};_0x44dde0(++_0x2a4de7);}(_0xf229,0xb1));var _0x9f22=function(_0x257b68,_0x58de4d){_0x257b68=_0x257b68-0x0;var _0x5b06d1=_0xf229[_0x257b68];return _0x5b06d1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9f22('0x0'));var express=require(_0x9f22('0x1'));var router=express['Router']();var fs_extra=require(_0x9f22('0x2'));var auth=require(_0x9f22('0x3'));var interaction=require(_0x9f22('0x4'));var config=require(_0x9f22('0x5'));var controller=require('./cmHopperFinal.controller');router[_0x9f22('0x6')]('/',auth[_0x9f22('0x7')](),controller[_0x9f22('0x8')]);router['get']('/describe',auth[_0x9f22('0x7')](),controller[_0x9f22('0x9')]);router['get'](_0x9f22('0xa'),auth[_0x9f22('0x7')](),controller[_0x9f22('0xb')]);router[_0x9f22('0x6')](_0x9f22('0xc'),auth[_0x9f22('0x7')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x9f22('0x6')](_0x9f22('0xd'),auth[_0x9f22('0x7')](),controller[_0x9f22('0xe')]);router[_0x9f22('0xf')](_0x9f22('0x10'),auth[_0x9f22('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x9f22('0xf')]('/voice/campaign/moveContacts/:id',auth[_0x9f22('0x7')](),controller[_0x9f22('0x11')]);router[_0x9f22('0xf')](_0x9f22('0x12'),auth['isAuthenticated'](),controller[_0x9f22('0x13')]);router[_0x9f22('0x14')](_0x9f22('0xa'),auth[_0x9f22('0x7')](),controller[_0x9f22('0x15')]);module[_0x9f22('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 dd908f1..7453b99 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 _0x4e16=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x4e16,0x1df));var _0x64e1=function(_0x19a59e,_0x17c763){_0x19a59e=_0x19a59e-0x0;var _0x4b87ae=_0x4e16[_0x19a59e];return _0x4b87ae;};'use strict';var Sequelize=require(_0x64e1('0x0'));module[_0x64e1('0x1')]={'state':{'type':Sequelize[_0x64e1('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x64e1('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x64e1('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x64e1('0x3')]},'starttime':{'type':Sequelize[_0x64e1('0x4')]},'responsetime':{'type':Sequelize[_0x64e1('0x4')]},'answertime':{'type':Sequelize[_0x64e1('0x4')]},'droptime':{'type':Sequelize[_0x64e1('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x64e1('0x3')]},'campaign':{'type':Sequelize[_0x64e1('0x3')]},'campaigntype':{'type':Sequelize[_0x64e1('0x3')]},'membername':{'type':Sequelize[_0x64e1('0x3')]},'reason':{'type':Sequelize[_0x64e1('0x3')]},'amd':{'type':Sequelize[_0x64e1('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x64e1('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x64e1('0x4')]},'recallme':{'type':Sequelize[_0x64e1('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x64e1('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x64e1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x929b=['STRING','DATE','INTEGER','BOOLEAN','exports'];(function(_0x213f9e,_0x416874){var _0x24b107=function(_0x43e505){while(--_0x43e505){_0x213f9e['push'](_0x213f9e['shift']());}};_0x24b107(++_0x416874);}(_0x929b,0x12b));var _0xb929=function(_0x389c88,_0x46d30a){_0x389c88=_0x389c88-0x0;var _0x32b899=_0x929b[_0x389c88];return _0x32b899;};'use strict';var Sequelize=require('sequelize');module[_0xb929('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb929('0x1')]},'scheduledat':{'type':Sequelize[_0xb929('0x2')]},'countbusyretry':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb929('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xb929('0x1')]},'originatecalleridname':{'type':Sequelize[_0xb929('0x1')]},'calleridnum':{'type':Sequelize[_0xb929('0x1')]},'calleridname':{'type':Sequelize[_0xb929('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb929('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb929('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb929('0x1')]},'campaign':{'type':Sequelize[_0xb929('0x1')]},'campaigntype':{'type':Sequelize[_0xb929('0x1')]},'membername':{'type':Sequelize[_0xb929('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xb929('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb929('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb929('0x2')]},'recallme':{'type':Sequelize[_0xb929('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb929('0x2')]},'edited':{'type':Sequelize[_0xb929('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb929('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb929('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 f4517a5..ce13bdf 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 _0x92e8=['CmHopperHistory','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','describe','update','body','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','destroy','then','end','stack','name','send','index','map'];(function(_0x13896c,_0x419715){var _0x5e5ef8=function(_0x4c977d){while(--_0x4c977d){_0x13896c['push'](_0x13896c['shift']());}};_0x5e5ef8(++_0x419715);}(_0x92e8,0x69));var _0x892e=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0x92e8[_0x30a528];return _0x3e029c;};'use strict';var emlformat=require(_0x892e('0x0'));var rimraf=require(_0x892e('0x1'));var zipdir=require(_0x892e('0x2'));var jsonpatch=require(_0x892e('0x3'));var rp=require(_0x892e('0x4'));var moment=require(_0x892e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x892e('0x6'));var util=require('util');var path=require(_0x892e('0x7'));var sox=require(_0x892e('0x8'));var csv=require(_0x892e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x892e('0xa'));var squel=require('squel');var crypto=require(_0x892e('0xb'));var jsforce=require(_0x892e('0xc'));var deskjs=require(_0x892e('0xd'));var toCsv=require(_0x892e('0x9'));var querystring=require(_0x892e('0xe'));var Papa=require(_0x892e('0xf'));var Redis=require(_0x892e('0x10'));var authService=require(_0x892e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x892e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x892e('0x13'))(_0x892e('0x14'));var utils=require('../../config/utils');var config=require(_0x892e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x892e('0x16'))['db'];function respondWithStatusCode(_0x469609,_0x591b47){_0x591b47=_0x591b47||0xcc;return function(_0xbd2345){if(_0xbd2345){return _0x469609[_0x892e('0x17')](_0x591b47);}return _0x469609[_0x892e('0x18')](_0x591b47)['end']();};}function respondWithResult(_0x3fcdf8,_0x38d14b){_0x38d14b=_0x38d14b||0xc8;return function(_0x52cc59){if(_0x52cc59){return _0x3fcdf8['status'](_0x38d14b)[_0x892e('0x19')](_0x52cc59);}};}function respondWithFilteredResult(_0x33b959,_0x3a18a4){return function(_0xefd3ed){if(_0xefd3ed){var _0x3579ad=typeof _0x3a18a4[_0x892e('0x1a')]==='undefined'&&typeof _0x3a18a4['limit']===_0x892e('0x1b');var _0x13de2d=_0xefd3ed['count'];var _0x5e5c4c=_0x3579ad?0x0:_0x3a18a4[_0x892e('0x1a')];var _0x227012=_0x3579ad?_0xefd3ed[_0x892e('0x1c')]:_0x3a18a4[_0x892e('0x1a')]+_0x3a18a4[_0x892e('0x1d')];var _0x477245;if(_0x227012>=_0x13de2d){_0x227012=_0x13de2d;_0x477245=0xc8;}else{_0x477245=0xce;}_0x33b959['status'](_0x477245);return _0x33b959['set'](_0x892e('0x1e'),_0x5e5c4c+'-'+_0x227012+'/'+_0x13de2d)[_0x892e('0x19')](_0xefd3ed);}return null;};}function patchUpdates(_0x2b603a){return function(_0x57087f){try{jsonpatch[_0x892e('0x1f')](_0x57087f,_0x2b603a,!![]);}catch(_0x221141){return BPromise[_0x892e('0x20')](_0x221141);}return _0x57087f['save']();};}function saveUpdates(_0x2bcdcf,_0xb6a783){return function(_0x223ac9){if(_0x223ac9){return _0x223ac9['update'](_0x2bcdcf)['then'](function(_0x4434bc){return _0x4434bc;});}return null;};}function removeEntity(_0xa2ba9f,_0x3d9642){return function(_0x3ef3d8){if(_0x3ef3d8){return _0x3ef3d8[_0x892e('0x21')]()[_0x892e('0x22')](function(){_0xa2ba9f[_0x892e('0x18')](0xcc)[_0x892e('0x23')]();});}};}function handleEntityNotFound(_0x486fd5,_0x59ead1){return function(_0x13f04f){if(!_0x13f04f){_0x486fd5[_0x892e('0x17')](0x194);}return _0x13f04f;};}function handleError(_0x1b66b9,_0x676bd6){_0x676bd6=_0x676bd6||0x1f4;return function(_0x2e199d){logger['error'](_0x2e199d[_0x892e('0x24')]);if(_0x2e199d[_0x892e('0x25')]){delete _0x2e199d[_0x892e('0x25')];}_0x1b66b9[_0x892e('0x18')](_0x676bd6)[_0x892e('0x26')](_0x2e199d);};}exports[_0x892e('0x27')]=function(_0x173c55,_0x431137){var _0x21e9f5={},_0x456cb7={},_0x365b22={'count':0x0,'rows':[]};var _0x32ba44=_[_0x892e('0x28')](db[_0x892e('0x29')][_0x892e('0x2a')],function(_0x312bdc){return{'name':_0x312bdc['fieldName'],'type':_0x312bdc[_0x892e('0x2b')]['key']};});_0x456cb7['model']=_[_0x892e('0x28')](_0x32ba44,_0x892e('0x25'));_0x456cb7['query']=_['keys'](_0x173c55[_0x892e('0x2c')]);_0x456cb7['filters']=_[_0x892e('0x2d')](_0x456cb7[_0x892e('0x2e')],_0x456cb7[_0x892e('0x2c')]);_0x21e9f5[_0x892e('0x2f')]=_[_0x892e('0x2d')](_0x456cb7[_0x892e('0x2e')],qs['fields'](_0x173c55[_0x892e('0x2c')][_0x892e('0x30')]));_0x21e9f5['attributes']=_0x21e9f5[_0x892e('0x2f')][_0x892e('0x31')]?_0x21e9f5[_0x892e('0x2f')]:_0x456cb7[_0x892e('0x2e')];if(!_0x173c55[_0x892e('0x2c')][_0x892e('0x32')](_0x892e('0x33'))){_0x21e9f5['limit']=qs[_0x892e('0x1d')](_0x173c55['query'][_0x892e('0x1d')]);_0x21e9f5[_0x892e('0x1a')]=qs[_0x892e('0x1a')](_0x173c55[_0x892e('0x2c')][_0x892e('0x1a')]);}_0x21e9f5[_0x892e('0x34')]=qs['sort'](_0x173c55[_0x892e('0x2c')]['sort']);_0x21e9f5[_0x892e('0x35')]=qs[_0x892e('0x36')](_[_0x892e('0x37')](_0x173c55[_0x892e('0x2c')],_0x456cb7['filters']),_0x32ba44);if(_0x173c55[_0x892e('0x2c')][_0x892e('0x38')]){_0x21e9f5['where']=_[_0x892e('0x39')](_0x21e9f5[_0x892e('0x35')],{'$or':_[_0x892e('0x28')](_0x32ba44,function(_0x266a41){if(_0x266a41[_0x892e('0x2b')]!=='VIRTUAL'){var _0x5da352={};_0x5da352[_0x266a41[_0x892e('0x25')]]={'$like':'%'+_0x173c55[_0x892e('0x2c')][_0x892e('0x38')]+'%'};return _0x5da352;}})});}_0x21e9f5=_[_0x892e('0x39')]({},_0x21e9f5,_0x173c55[_0x892e('0x3a')]);var _0x3be653={'where':_0x21e9f5['where']};return db[_0x892e('0x29')][_0x892e('0x1c')](_0x3be653)['then'](function(_0x1750d1){_0x365b22[_0x892e('0x1c')]=_0x1750d1;if(_0x173c55[_0x892e('0x2c')][_0x892e('0x3b')]){_0x21e9f5[_0x892e('0x3c')]=[{'all':!![]}];}return db[_0x892e('0x29')][_0x892e('0x3d')](_0x21e9f5);})[_0x892e('0x22')](function(_0x4cb64b){_0x365b22[_0x892e('0x3e')]=_0x4cb64b;return _0x365b22;})['then'](respondWithFilteredResult(_0x431137,_0x21e9f5))[_0x892e('0x3f')](handleError(_0x431137,null));};exports[_0x892e('0x40')]=function(_0x14be19,_0x104a37){var _0x56de30={'raw':!![],'where':{'id':_0x14be19['params']['id']}},_0x416771={};_0x416771[_0x892e('0x2e')]=_[_0x892e('0x41')](db['CmHopperHistory']['rawAttributes']);_0x416771['query']=_[_0x892e('0x41')](_0x14be19[_0x892e('0x2c')]);_0x416771[_0x892e('0x36')]=_[_0x892e('0x2d')](_0x416771[_0x892e('0x2e')],_0x416771[_0x892e('0x2c')]);_0x56de30[_0x892e('0x2f')]=_[_0x892e('0x2d')](_0x416771['model'],qs[_0x892e('0x30')](_0x14be19[_0x892e('0x2c')]['fields']));_0x56de30[_0x892e('0x2f')]=_0x56de30[_0x892e('0x2f')][_0x892e('0x31')]?_0x56de30[_0x892e('0x2f')]:_0x416771[_0x892e('0x2e')];if(_0x14be19[_0x892e('0x2c')][_0x892e('0x3b')]){_0x56de30[_0x892e('0x3c')]=[{'all':!![]}];}_0x56de30=_[_0x892e('0x39')]({},_0x56de30,_0x14be19[_0x892e('0x3a')]);return db['CmHopperHistory'][_0x892e('0x42')](_0x56de30)[_0x892e('0x22')](handleEntityNotFound(_0x104a37,null))['then'](respondWithResult(_0x104a37,null))[_0x892e('0x3f')](handleError(_0x104a37,null));};exports[_0x892e('0x43')]=function(_0x33d7de,_0x133683){return db[_0x892e('0x29')][_0x892e('0x43')](_0x33d7de['body'],{})[_0x892e('0x22')](respondWithResult(_0x133683,0xc9))[_0x892e('0x3f')](handleError(_0x133683,null));};exports[_0x892e('0x44')]=function(_0x5dfd6e,_0x571961){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0x571961,null))['catch'](handleError(_0x571961,null));};exports[_0x892e('0x45')]=function(_0x65c6ec,_0xf4c71c){if(_0x65c6ec[_0x892e('0x46')][_0x892e('0x47')]){delete _0x65c6ec[_0x892e('0x46')]['uniqueid'];}return db[_0x892e('0x29')][_0x892e('0x42')]({'where':{'uniqueid':_0x65c6ec[_0x892e('0x48')]['id']}})[_0x892e('0x22')](handleEntityNotFound(_0xf4c71c,null))[_0x892e('0x22')](saveUpdates(_0x65c6ec[_0x892e('0x46')],null))[_0x892e('0x22')](respondWithResult(_0xf4c71c,null))['catch'](handleError(_0xf4c71c,null));}; \ No newline at end of file +var _0x0e42=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','end','error','name','index','map','CmHopperHistory','fieldName','type','key','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','model','rawAttributes','length','find','catch','create','body','describe','uniqueid','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0e42,0x1a0));var _0x20e4=function(_0x31c7c1,_0x732b4){_0x31c7c1=_0x31c7c1-0x0;var _0x4fa5a7=_0x0e42[_0x31c7c1];return _0x4fa5a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20e4('0x0'));var zipdir=require(_0x20e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20e4('0x2'));var moment=require(_0x20e4('0x3'));var BPromise=require(_0x20e4('0x4'));var Mustache=require(_0x20e4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x20e4('0x6'));var csv=require(_0x20e4('0x7'));var ejs=require(_0x20e4('0x8'));var fs=require('fs');var fs_extra=require(_0x20e4('0x9'));var _=require(_0x20e4('0xa'));var squel=require(_0x20e4('0xb'));var crypto=require('crypto');var jsforce=require(_0x20e4('0xc'));var deskjs=require(_0x20e4('0xd'));var toCsv=require(_0x20e4('0x7'));var querystring=require(_0x20e4('0xe'));var Papa=require(_0x20e4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20e4('0x10'));var as=require(_0x20e4('0x11'));var hardwareService=require(_0x20e4('0x12'));var logger=require(_0x20e4('0x13'))(_0x20e4('0x14'));var utils=require(_0x20e4('0x15'));var config=require(_0x20e4('0x16'));var licenseUtil=require(_0x20e4('0x17'));var db=require(_0x20e4('0x18'))['db'];function respondWithStatusCode(_0x54d992,_0x1a1015){_0x1a1015=_0x1a1015||0xcc;return function(_0x4a3ce6){if(_0x4a3ce6){return _0x54d992[_0x20e4('0x19')](_0x1a1015);}return _0x54d992[_0x20e4('0x1a')](_0x1a1015)['end']();};}function respondWithResult(_0x3211f8,_0x2228ff){_0x2228ff=_0x2228ff||0xc8;return function(_0x1e96e9){if(_0x1e96e9){return _0x3211f8['status'](_0x2228ff)[_0x20e4('0x1b')](_0x1e96e9);}};}function respondWithFilteredResult(_0x22f012,_0x34030e){return function(_0xeb1ba4){if(_0xeb1ba4){var _0x5026bf=typeof _0x34030e[_0x20e4('0x1c')]===_0x20e4('0x1d')&&typeof _0x34030e[_0x20e4('0x1e')]==='undefined';var _0x4aa78e=_0xeb1ba4[_0x20e4('0x1f')];var _0x28173f=_0x5026bf?0x0:_0x34030e['offset'];var _0x438c96=_0x5026bf?_0xeb1ba4[_0x20e4('0x1f')]:_0x34030e[_0x20e4('0x1c')]+_0x34030e[_0x20e4('0x1e')];var _0x33d92d;if(_0x438c96>=_0x4aa78e){_0x438c96=_0x4aa78e;_0x33d92d=0xc8;}else{_0x33d92d=0xce;}_0x22f012[_0x20e4('0x1a')](_0x33d92d);return _0x22f012['set'](_0x20e4('0x20'),_0x28173f+'-'+_0x438c96+'/'+_0x4aa78e)['json'](_0xeb1ba4);}return null;};}function patchUpdates(_0x2b02ae){return function(_0x30f823){try{jsonpatch['apply'](_0x30f823,_0x2b02ae,!![]);}catch(_0x4ff58b){return BPromise['reject'](_0x4ff58b);}return _0x30f823[_0x20e4('0x21')]();};}function saveUpdates(_0x32aadb,_0x227c82){return function(_0x17bb65){if(_0x17bb65){return _0x17bb65[_0x20e4('0x22')](_0x32aadb)[_0x20e4('0x23')](function(_0x22b7fc){return _0x22b7fc;});}return null;};}function removeEntity(_0x10d566,_0x316d9a){return function(_0x2242b8){if(_0x2242b8){return _0x2242b8['destroy']()[_0x20e4('0x23')](function(){_0x10d566[_0x20e4('0x1a')](0xcc)[_0x20e4('0x24')]();});}};}function handleEntityNotFound(_0x78722a,_0xf9d69){return function(_0x27f29d){if(!_0x27f29d){_0x78722a[_0x20e4('0x19')](0x194);}return _0x27f29d;};}function handleError(_0x5b9ad0,_0x14733b){_0x14733b=_0x14733b||0x1f4;return function(_0x19bd70){logger[_0x20e4('0x25')](_0x19bd70['stack']);if(_0x19bd70[_0x20e4('0x26')]){delete _0x19bd70[_0x20e4('0x26')];}_0x5b9ad0[_0x20e4('0x1a')](_0x14733b)['send'](_0x19bd70);};}exports[_0x20e4('0x27')]=function(_0x250931,_0x13acb8){var _0x15090f={},_0x5de243={},_0x3f5acf={'count':0x0,'rows':[]};var _0x4c8e39=_[_0x20e4('0x28')](db[_0x20e4('0x29')]['rawAttributes'],function(_0x5172c0){return{'name':_0x5172c0[_0x20e4('0x2a')],'type':_0x5172c0[_0x20e4('0x2b')][_0x20e4('0x2c')]};});_0x5de243['model']=_[_0x20e4('0x28')](_0x4c8e39,_0x20e4('0x26'));_0x5de243[_0x20e4('0x2d')]=_[_0x20e4('0x2e')](_0x250931[_0x20e4('0x2d')]);_0x5de243['filters']=_[_0x20e4('0x2f')](_0x5de243['model'],_0x5de243['query']);_0x15090f[_0x20e4('0x30')]=_[_0x20e4('0x2f')](_0x5de243['model'],qs['fields'](_0x250931['query'][_0x20e4('0x31')]));_0x15090f[_0x20e4('0x30')]=_0x15090f[_0x20e4('0x30')]['length']?_0x15090f[_0x20e4('0x30')]:_0x5de243['model'];if(!_0x250931[_0x20e4('0x2d')][_0x20e4('0x32')]('nolimit')){_0x15090f[_0x20e4('0x1e')]=qs['limit'](_0x250931['query'][_0x20e4('0x1e')]);_0x15090f[_0x20e4('0x1c')]=qs['offset'](_0x250931['query'][_0x20e4('0x1c')]);}_0x15090f[_0x20e4('0x33')]=qs[_0x20e4('0x34')](_0x250931[_0x20e4('0x2d')][_0x20e4('0x34')]);_0x15090f[_0x20e4('0x35')]=qs[_0x20e4('0x36')](_[_0x20e4('0x37')](_0x250931['query'],_0x5de243[_0x20e4('0x36')]),_0x4c8e39);if(_0x250931[_0x20e4('0x2d')][_0x20e4('0x38')]){_0x15090f[_0x20e4('0x35')]=_[_0x20e4('0x39')](_0x15090f[_0x20e4('0x35')],{'$or':_['map'](_0x4c8e39,function(_0x2c9f9e){if(_0x2c9f9e[_0x20e4('0x2b')]!==_0x20e4('0x3a')){var _0xf265d2={};_0xf265d2[_0x2c9f9e[_0x20e4('0x26')]]={'$like':'%'+_0x250931[_0x20e4('0x2d')]['filter']+'%'};return _0xf265d2;}})});}_0x15090f=_[_0x20e4('0x39')]({},_0x15090f,_0x250931['options']);var _0x486419={'where':_0x15090f[_0x20e4('0x35')]};return db[_0x20e4('0x29')][_0x20e4('0x1f')](_0x486419)['then'](function(_0x58e279){_0x3f5acf['count']=_0x58e279;if(_0x250931[_0x20e4('0x2d')][_0x20e4('0x3b')]){_0x15090f[_0x20e4('0x3c')]=[{'all':!![]}];}return db[_0x20e4('0x29')][_0x20e4('0x3d')](_0x15090f);})[_0x20e4('0x23')](function(_0x273caa){_0x3f5acf['rows']=_0x273caa;return _0x3f5acf;})[_0x20e4('0x23')](respondWithFilteredResult(_0x13acb8,_0x15090f))['catch'](handleError(_0x13acb8,null));};exports[_0x20e4('0x3e')]=function(_0x5882c7,_0x1331fc){var _0x1afbe9={'raw':!![],'where':{'id':_0x5882c7[_0x20e4('0x3f')]['id']}},_0xd08731={};_0xd08731[_0x20e4('0x40')]=_[_0x20e4('0x2e')](db[_0x20e4('0x29')][_0x20e4('0x41')]);_0xd08731[_0x20e4('0x2d')]=_['keys'](_0x5882c7[_0x20e4('0x2d')]);_0xd08731[_0x20e4('0x36')]=_[_0x20e4('0x2f')](_0xd08731[_0x20e4('0x40')],_0xd08731['query']);_0x1afbe9['attributes']=_[_0x20e4('0x2f')](_0xd08731[_0x20e4('0x40')],qs[_0x20e4('0x31')](_0x5882c7[_0x20e4('0x2d')]['fields']));_0x1afbe9[_0x20e4('0x30')]=_0x1afbe9[_0x20e4('0x30')][_0x20e4('0x42')]?_0x1afbe9[_0x20e4('0x30')]:_0xd08731[_0x20e4('0x40')];if(_0x5882c7['query'][_0x20e4('0x3b')]){_0x1afbe9[_0x20e4('0x3c')]=[{'all':!![]}];}_0x1afbe9=_['merge']({},_0x1afbe9,_0x5882c7['options']);return db[_0x20e4('0x29')][_0x20e4('0x43')](_0x1afbe9)[_0x20e4('0x23')](handleEntityNotFound(_0x1331fc,null))[_0x20e4('0x23')](respondWithResult(_0x1331fc,null))[_0x20e4('0x44')](handleError(_0x1331fc,null));};exports[_0x20e4('0x45')]=function(_0x1ec73e,_0x198ed0){return db[_0x20e4('0x29')]['create'](_0x1ec73e[_0x20e4('0x46')],{})[_0x20e4('0x23')](respondWithResult(_0x198ed0,0xc9))['catch'](handleError(_0x198ed0,null));};exports[_0x20e4('0x47')]=function(_0x229fa0,_0x122945){return db[_0x20e4('0x29')][_0x20e4('0x47')]()[_0x20e4('0x23')](respondWithResult(_0x122945,null))[_0x20e4('0x44')](handleError(_0x122945,null));};exports['update']=function(_0x3d1ee9,_0x3b5909){if(_0x3d1ee9[_0x20e4('0x46')][_0x20e4('0x48')]){delete _0x3d1ee9[_0x20e4('0x46')][_0x20e4('0x48')];}return db['CmHopperHistory'][_0x20e4('0x43')]({'where':{'uniqueid':_0x3d1ee9[_0x20e4('0x3f')]['id']}})[_0x20e4('0x23')](handleEntityNotFound(_0x3b5909,null))[_0x20e4('0x23')](saveUpdates(_0x3d1ee9[_0x20e4('0x46')],null))[_0x20e4('0x23')](respondWithResult(_0x3b5909,null))[_0x20e4('0x44')](handleError(_0x3b5909,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8bfda08..590dd07 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 _0x38b2=['./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x38b2,0xf6));var _0x238b=function(_0x1a226e,_0x49fd32){_0x1a226e=_0x1a226e-0x0;var _0x51ef25=_0x38b2[_0x1a226e];return _0x51ef25;};'use strict';var _=require(_0x238b('0x0'));var util=require(_0x238b('0x1'));var logger=require(_0x238b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x238b('0x3'));var rp=require(_0x238b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x238b('0x5'));var config=require('../../config/environment');var attributes=require(_0x238b('0x6'));module[_0x238b('0x7')]=function(_0x2fb980,_0xb6f089){return _0x2fb980['define'](_0x238b('0x8'),attributes,{'tableName':_0x238b('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x238b('0xa')]},{'name':_0x238b('0xb'),'fields':[_0x238b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x297f=['uniqueid','lodash','util','moment','bluebird','request-promise','path','../../config/environment','exports','cm_hopper_history','endtime'];(function(_0x241de9,_0xd0673f){var _0x10917c=function(_0x218567){while(--_0x218567){_0x241de9['push'](_0x241de9['shift']());}};_0x10917c(++_0xd0673f);}(_0x297f,0x1f0));var _0xf297=function(_0x323616,_0x299d4f){_0x323616=_0x323616-0x0;var _0x4cb4fe=_0x297f[_0x323616];return _0x4cb4fe;};'use strict';var _=require(_0xf297('0x0'));var util=require(_0xf297('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf297('0x2'));var BPromise=require(_0xf297('0x3'));var rp=require(_0xf297('0x4'));var fs=require('fs');var path=require(_0xf297('0x5'));var rimraf=require('rimraf');var config=require(_0xf297('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0xf297('0x7')]=function(_0x353e78,_0x2282eb){return _0x353e78['define']('CmHopperHistory',attributes,{'tableName':_0xf297('0x8'),'paranoid':![],'indexes':[{'name':_0xf297('0x9'),'fields':[_0xf297('0x9')]},{'name':'uniqueid','fields':[_0xf297('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index a2993be..af32d5f 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 _0xc17f=['options','raw','then','debug','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0xc17f,0xb8));var _0xfc17=function(_0x36f3bb,_0x33c34c){_0x36f3bb=_0x36f3bb-0x0;var _0x46bab0=_0xc17f[_0x36f3bb];return _0x46bab0;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc17('0x6'));var logger=require(_0xfc17('0x7'))(_0xfc17('0x8'));var config=require(_0xfc17('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc17('0xa')][_0xfc17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21c2ef,_0x11fa33,_0x404ee0){return new BPromise(function(_0x3cd590,_0x149054){return client[_0xfc17('0xc')](_0x21c2ef,_0x404ee0)['then'](function(_0x33bd35){logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x11fa33,_0xfc17('0xf'),JSON[_0xfc17('0x10')](_0x33bd35));if(_0x33bd35[_0xfc17('0x11')]){if(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x12')]===0x1f4){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);return _0x149054(_0x33bd35[_0xfc17('0x11')]['message']);}logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')]['message']);return _0x3cd590(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);}else{logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));_0x3cd590(_0x33bd35[_0xfc17('0x14')][_0xfc17('0x13')]);}})[_0xfc17('0x15')](function(_0x35f947){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x35f947);_0x149054(_0x35f947);});});}exports[_0xfc17('0x16')]=function(_0x2bbb0e){var _0x5b2c7c=this;return new Promise(function(_0x544740,_0x2aa3a2){return db[_0xfc17('0x17')][_0xfc17('0x18')](_0x2bbb0e[_0xfc17('0x19')],{'raw':_0x2bbb0e[_0xfc17('0x1a')]?_0x2bbb0e[_0xfc17('0x1a')][_0xfc17('0x1b')]===undefined?!![]:![]:!![]})[_0xfc17('0x1c')](function(_0x48edb4){logger[_0xfc17('0xd')](_0xfc17('0x16'),_0x2bbb0e);logger[_0xfc17('0x1d')](_0xfc17('0x16'),_0x2bbb0e,JSON[_0xfc17('0x10')](_0x48edb4));_0x544740(_0x48edb4);})[_0xfc17('0x15')](function(_0x223fab){logger[_0xfc17('0x11')](_0xfc17('0x16'),_0x223fab[_0xfc17('0x13')],_0x2bbb0e);_0x2aa3a2(_0x5b2c7c['error'](0x1f4,_0x223fab[_0xfc17('0x13')]));});});};exports[_0xfc17('0x1e')]=function(_0x10a81f){var _0x163c3b=this;return new Promise(function(_0x24af50,_0x1dfe66){return db['CmHopperHistory'][_0xfc17('0x1f')]({'raw':_0x10a81f[_0xfc17('0x1a')]?_0x10a81f['options'][_0xfc17('0x1b')]===undefined?!![]:![]:!![],'where':_0x10a81f[_0xfc17('0x1a')]?_0x10a81f['options']['where']||null:null,'attributes':[[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db['sequelize'][_0xfc17('0x22')]('id')),_0xfc17('0x23')],[db['sequelize']['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db['sequelize'][_0xfc17('0x24')](_0xfc17('0x25')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')][_0xfc17('0x24')](_0xfc17('0x26')))),_0xfc17('0x27')],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db['sequelize'][_0xfc17('0x24')](_0xfc17('0x28')))),_0xfc17('0x29')],[db['sequelize']['fn'](_0xfc17('0x2a'),db['sequelize']['fn']('IF',db[_0xfc17('0x20')][_0xfc17('0x24')](_0xfc17('0x2b')))),_0xfc17('0x2c')],[db['sequelize']['fn'](_0xfc17('0x2a'),db[_0xfc17('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xfc17('0x2d')]]})[_0xfc17('0x1c')](function(_0x3bec23){logger[_0xfc17('0xd')](_0xfc17('0x1e'),_0x10a81f);logger['debug'](_0xfc17('0x1e'),_0x10a81f,JSON[_0xfc17('0x10')](_0x3bec23));_0x24af50(_0x3bec23);})['catch'](function(_0x35e7ca){logger[_0xfc17('0x11')]('AvgHandleTime',_0x35e7ca['message'],_0x10a81f);_0x1dfe66(_0x163c3b[_0xfc17('0x11')](0x1f4,_0x35e7ca['message']));});});};exports[_0xfc17('0x2e')]=function(_0x4a4ddb){var _0x49edad=this;return new Promise(function(_0xb13289,_0x353a69){return db[_0xfc17('0x17')][_0xfc17('0x1f')]({'raw':_0x4a4ddb[_0xfc17('0x1a')]?_0x4a4ddb[_0xfc17('0x1a')][_0xfc17('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a4ddb['options']?_0x4a4ddb[_0xfc17('0x1a')][_0xfc17('0x2f')]||null:null,'attributes':[[_0xfc17('0x30'),_0xfc17('0x31')],[db['sequelize']['fn']('COUNT',db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')][_0xfc17('0x24')](_0xfc17('0x32')))),_0xfc17('0x33')],[db['sequelize']['fn'](_0xfc17('0x21'),db['sequelize']['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x34')))),'outboundNoAnswerCallsDay'],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')][_0xfc17('0x24')](_0xfc17('0x25')))),'outboundAnswerCallsDay'],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x35')))),'outboundBusyCallsDay'],[db[_0xfc17('0x20')]['fn']('COUNT',db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x36')))),_0xfc17('0x37')],[db[_0xfc17('0x20')]['fn']('COUNT',db[_0xfc17('0x20')]['fn']('IF',db['sequelize'][_0xfc17('0x24')](_0xfc17('0x38')))),_0xfc17('0x39')],[db[_0xfc17('0x20')]['fn']('COUNT',db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x3a')))),'outboundDropCallsDayCallersExit'],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db['sequelize']['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x3b')))),_0xfc17('0x3c')],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x3d')))),'outboundBlacklistCallsDay'],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')][_0xfc17('0x24')](_0xfc17('0x3e')))),_0xfc17('0x3f')],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db['sequelize']['fn']('IF',db[_0xfc17('0x20')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0xfc17('0x40')],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db['sequelize'][_0xfc17('0x24')](_0xfc17('0x41')))),_0xfc17('0x40')],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xfc17('0x42')))),'outboundReCallsDay']],'group':[_0xfc17('0x30')]})[_0xfc17('0x1c')](function(_0x4a7146){logger[_0xfc17('0xd')]('GetVoiceQueueHopperHistory',_0x4a4ddb);logger['debug'](_0xfc17('0x2e'),_0x4a4ddb,JSON[_0xfc17('0x10')](_0x4a7146));_0xb13289(_0x4a7146);})[_0xfc17('0x15')](function(_0x17234d){logger['error'](_0xfc17('0x2e'),_0x17234d['message'],_0x4a4ddb);_0x353a69(_0x49edad['error'](0x1f4,_0x17234d['message']));});});};exports['GetCampaignHopperHistory']=function(_0xfc087){var _0x4da6bf=this;return new Promise(function(_0x518ebd,_0x27b50c){return db[_0xfc17('0x17')][_0xfc17('0x1f')]({'raw':_0xfc087[_0xfc17('0x1a')]?_0xfc087[_0xfc17('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xfc087[_0xfc17('0x1a')]?_0xfc087[_0xfc17('0x1a')][_0xfc17('0x2f')]||null:null,'attributes':[[_0xfc17('0x30'),'name'],[db['sequelize']['fn']('COUNT',db[_0xfc17('0x20')][_0xfc17('0x22')]('id')),_0xfc17('0x43')],[db[_0xfc17('0x20')]['fn'](_0xfc17('0x21'),db[_0xfc17('0x20')]['fn']('IF',db[_0xfc17('0x20')]['literal'](_0xfc17('0x25')))),_0xfc17('0x44')]],'group':['campaign']})[_0xfc17('0x1c')](function(_0x4063f4){logger[_0xfc17('0xd')](_0xfc17('0x45'),_0xfc087);logger[_0xfc17('0x1d')]('GetCampaignHopperHistory',_0xfc087,JSON[_0xfc17('0x10')](_0x4063f4));_0x518ebd(_0x4063f4);})[_0xfc17('0x15')](function(_0x116ed8){logger[_0xfc17('0x11')]('GetCampaignHopperHistory',_0x116ed8[_0xfc17('0x13')],_0xfc087);_0x27b50c(_0x4da6bf[_0xfc17('0x11')](0x1f4,_0x116ed8[_0xfc17('0x13')]));});});}; \ No newline at end of file +var _0x4b8a=['outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','options','raw','CmHopperHistory','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0xc4e092,_0x5059f7){var _0xa4f542=function(_0x302769){while(--_0x302769){_0xc4e092['push'](_0xc4e092['shift']());}};_0xa4f542(++_0x5059f7);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4b8a[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xa4b8('0x0'));var moment=require('moment');var BPromise=require(_0xa4b8('0x1'));var rs=require(_0xa4b8('0x2'));var fs=require('fs');var Redis=require(_0xa4b8('0x3'));var db=require(_0xa4b8('0x4'))['db'];var utils=require(_0xa4b8('0x5'));var logger=require(_0xa4b8('0x6'))(_0xa4b8('0x7'));var config=require(_0xa4b8('0x8'));var jayson=require(_0xa4b8('0x9'));var client=jayson[_0xa4b8('0xa')][_0xa4b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2de84d,_0x455722,_0x1fea78){return new BPromise(function(_0x517970,_0x4632f3){return client[_0xa4b8('0xc')](_0x2de84d,_0x1fea78)[_0xa4b8('0xd')](function(_0x3fe4ed){logger[_0xa4b8('0xe')](_0xa4b8('0xf'),_0x455722,_0xa4b8('0x10'));logger[_0xa4b8('0x11')](_0xa4b8('0x12'),_0x455722,_0xa4b8('0x10'),JSON[_0xa4b8('0x13')](_0x3fe4ed));if(_0x3fe4ed[_0xa4b8('0x14')]){if(_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x15')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x455722,_0x3fe4ed[_0xa4b8('0x14')]['message']);return _0x4632f3(_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x16')]);}logger['error'](_0xa4b8('0xf'),_0x455722,_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x16')]);return _0x517970(_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x16')]);}else{logger[_0xa4b8('0xe')](_0xa4b8('0xf'),_0x455722,_0xa4b8('0x10'));_0x517970(_0x3fe4ed[_0xa4b8('0x17')]['message']);}})[_0xa4b8('0x18')](function(_0x3c8ebb){logger['error'](_0xa4b8('0xf'),_0x455722,_0x3c8ebb);_0x4632f3(_0x3c8ebb);});});}exports[_0xa4b8('0x19')]=function(_0x215cdf){var _0x2b7f3a=this;return new Promise(function(_0x20cf62,_0x4c6341){return db['CmHopperHistory']['create'](_0x215cdf['body'],{'raw':_0x215cdf[_0xa4b8('0x1a')]?_0x215cdf[_0xa4b8('0x1a')][_0xa4b8('0x1b')]===undefined?!![]:![]:!![]})[_0xa4b8('0xd')](function(_0x39676c){logger[_0xa4b8('0xe')](_0xa4b8('0x19'),_0x215cdf);logger[_0xa4b8('0x11')](_0xa4b8('0x19'),_0x215cdf,JSON[_0xa4b8('0x13')](_0x39676c));_0x20cf62(_0x39676c);})[_0xa4b8('0x18')](function(_0x46c994){logger[_0xa4b8('0x14')](_0xa4b8('0x19'),_0x46c994[_0xa4b8('0x16')],_0x215cdf);_0x4c6341(_0x2b7f3a[_0xa4b8('0x14')](0x1f4,_0x46c994[_0xa4b8('0x16')]));});});};exports['AvgHandleTime']=function(_0x27530c){var _0x1f3c4b=this;return new Promise(function(_0x5e2f85,_0xf5638b){return db[_0xa4b8('0x1c')]['findAll']({'raw':_0x27530c['options']?_0x27530c['options'][_0xa4b8('0x1b')]===undefined?!![]:![]:!![],'where':_0x27530c[_0xa4b8('0x1a')]?_0x27530c[_0xa4b8('0x1a')][_0xa4b8('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')][_0xa4b8('0x20')]('id')),_0xa4b8('0x21')],[db['sequelize']['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x23')))),_0xa4b8('0x24')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db['sequelize'][_0xa4b8('0x22')](_0xa4b8('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0xa4b8('0x1f')]['literal'](_0xa4b8('0x27')))),_0xa4b8('0x28')],[db[_0xa4b8('0x1f')]['fn']('AVG',db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x29')))),_0xa4b8('0x2a')]]})['then'](function(_0x8ed6a4){logger[_0xa4b8('0xe')](_0xa4b8('0x2b'),_0x27530c);logger[_0xa4b8('0x11')](_0xa4b8('0x2b'),_0x27530c,JSON[_0xa4b8('0x13')](_0x8ed6a4));_0x5e2f85(_0x8ed6a4);})[_0xa4b8('0x18')](function(_0x4f923c){logger[_0xa4b8('0x14')](_0xa4b8('0x2b'),_0x4f923c[_0xa4b8('0x16')],_0x27530c);_0xf5638b(_0x1f3c4b[_0xa4b8('0x14')](0x1f4,_0x4f923c[_0xa4b8('0x16')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x13c7d7){var _0x456bfe=this;return new Promise(function(_0x2c64a6,_0x1992de){return db['CmHopperHistory']['findAll']({'raw':_0x13c7d7[_0xa4b8('0x1a')]?_0x13c7d7[_0xa4b8('0x1a')][_0xa4b8('0x1b')]===undefined?!![]:![]:!![],'where':_0x13c7d7[_0xa4b8('0x1a')]?_0x13c7d7[_0xa4b8('0x1a')][_0xa4b8('0x1d')]||null:null,'attributes':[[_0xa4b8('0x2c'),_0xa4b8('0x2d')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x2e')))),'outboundNoSuchCallsDay'],[db[_0xa4b8('0x1f')]['fn']('COUNT',db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xa4b8('0x2f')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xa4b8('0x30')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db['sequelize']['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x31')))),_0xa4b8('0x32')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')]('`state`\x20=\x208,\x201,\x20null'))),_0xa4b8('0x33')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x34')))),'outboundDropCallsDayTimeout'],[db[_0xa4b8('0x1f')]['fn']('COUNT',db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')]['literal'](_0xa4b8('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x36')))),_0xa4b8('0x37')],[db[_0xa4b8('0x1f')]['fn'](_0xa4b8('0x1e'),db['sequelize']['fn']('IF',db[_0xa4b8('0x1f')]['literal'](_0xa4b8('0x38')))),_0xa4b8('0x39')],[db[_0xa4b8('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),_0xa4b8('0x3a')],[db['sequelize']['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')]['literal'](_0xa4b8('0x3b')))),_0xa4b8('0x3c')],[db[_0xa4b8('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x3d')))),_0xa4b8('0x3e')],[db[_0xa4b8('0x1f')]['fn']('COUNT',db[_0xa4b8('0x1f')]['fn']('IF',db['sequelize'][_0xa4b8('0x22')](_0xa4b8('0x3f')))),_0xa4b8('0x3c')],[db['sequelize']['fn'](_0xa4b8('0x1e'),db[_0xa4b8('0x1f')]['fn']('IF',db[_0xa4b8('0x1f')][_0xa4b8('0x22')](_0xa4b8('0x40')))),_0xa4b8('0x41')]],'group':[_0xa4b8('0x2c')]})[_0xa4b8('0xd')](function(_0x3c2c6b){logger[_0xa4b8('0xe')](_0xa4b8('0x42'),_0x13c7d7);logger['debug'](_0xa4b8('0x42'),_0x13c7d7,JSON[_0xa4b8('0x13')](_0x3c2c6b));_0x2c64a6(_0x3c2c6b);})[_0xa4b8('0x18')](function(_0x457746){logger[_0xa4b8('0x14')](_0xa4b8('0x42'),_0x457746[_0xa4b8('0x16')],_0x13c7d7);_0x1992de(_0x456bfe['error'](0x1f4,_0x457746['message']));});});};exports[_0xa4b8('0x43')]=function(_0x21edff){var _0x532741=this;return new Promise(function(_0x559403,_0x53ef85){return db['CmHopperHistory']['findAll']({'raw':_0x21edff[_0xa4b8('0x1a')]?_0x21edff[_0xa4b8('0x1a')][_0xa4b8('0x1b')]===undefined?!![]:![]:!![],'where':_0x21edff[_0xa4b8('0x1a')]?_0x21edff[_0xa4b8('0x1a')][_0xa4b8('0x1d')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn']('COUNT',db[_0xa4b8('0x1f')][_0xa4b8('0x20')]('id')),_0xa4b8('0x44')],[db['sequelize']['fn'](_0xa4b8('0x1e'),db['sequelize']['fn']('IF',db[_0xa4b8('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xa4b8('0x2c')]})['then'](function(_0x2db5b5){logger[_0xa4b8('0xe')](_0xa4b8('0x43'),_0x21edff);logger['debug'](_0xa4b8('0x43'),_0x21edff,JSON[_0xa4b8('0x13')](_0x2db5b5));_0x559403(_0x2db5b5);})[_0xa4b8('0x18')](function(_0x3dcf2b){logger[_0xa4b8('0x14')](_0xa4b8('0x43'),_0x3dcf2b[_0xa4b8('0x16')],_0x21edff);_0x53ef85(_0x532741[_0xa4b8('0x14')](0x1f4,_0x3dcf2b[_0xa4b8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index df34d58..f44abdb 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 _0x9987=['/:id','update','exports','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1fc36f,_0x464552){var _0x2856b4=function(_0x2487f3){while(--_0x2487f3){_0x1fc36f['push'](_0x1fc36f['shift']());}};_0x2856b4(++_0x464552);}(_0x9987,0x93));var _0x7998=function(_0x53a661,_0x10aa72){_0x53a661=_0x53a661-0x0;var _0x2ee0a0=_0x9987[_0x53a661];return _0x2ee0a0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7998('0x0'));var router=express[_0x7998('0x1')]();var fs_extra=require(_0x7998('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7998('0x3'));var controller=require(_0x7998('0x4'));router[_0x7998('0x5')]('/',auth[_0x7998('0x6')](),controller[_0x7998('0x7')]);router[_0x7998('0x5')](_0x7998('0x8'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7998('0x9')]);router[_0x7998('0xa')]('/',auth[_0x7998('0x6')](),controller[_0x7998('0xb')]);router[_0x7998('0xc')](_0x7998('0xd'),auth[_0x7998('0x6')](),controller[_0x7998('0xe')]);module[_0x7998('0xf')]=router; \ No newline at end of file +var _0xf7e5=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperHistory.controller','get','index','isAuthenticated','describe','show','create','put','update'];(function(_0x4ea10a,_0x40f3be){var _0x2e774e=function(_0x53f330){while(--_0x53f330){_0x4ea10a['push'](_0x4ea10a['shift']());}};_0x2e774e(++_0x40f3be);}(_0xf7e5,0x1e1));var _0x5f7e=function(_0x4d75b4,_0x1eca80){_0x4d75b4=_0x4d75b4-0x0;var _0xaf0841=_0xf7e5[_0x4d75b4];return _0xaf0841;};'use strict';var multer=require('multer');var util=require(_0x5f7e('0x0'));var path=require('path');var timeout=require(_0x5f7e('0x1'));var express=require(_0x5f7e('0x2'));var router=express[_0x5f7e('0x3')]();var fs_extra=require(_0x5f7e('0x4'));var auth=require(_0x5f7e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5f7e('0x6'));router[_0x5f7e('0x7')]('/',auth['isAuthenticated'](),controller[_0x5f7e('0x8')]);router[_0x5f7e('0x7')]('/describe',auth[_0x5f7e('0x9')](),controller[_0x5f7e('0xa')]);router['get']('/:id',auth[_0x5f7e('0x9')](),controller[_0x5f7e('0xb')]);router['post']('/',auth[_0x5f7e('0x9')](),controller[_0x5f7e('0xc')]);router[_0x5f7e('0xd')]('/:id',auth[_0x5f7e('0x9')](),controller[_0x5f7e('0xe')]);module[_0x5f7e('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index bf8355f..189a2da 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 _0x3a32=['exports','STRING','name','sequelize'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x3a32,0x9b));var _0x23a3=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x3a32[_0x13ce0c];return _0x4388fb;};'use strict';var Sequelize=require(_0x23a3('0x0'));module[_0x23a3('0x1')]={'name':{'type':Sequelize[_0x23a3('0x2')],'unique':_0x23a3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x23a3('0x2')]},'dialPrefix':{'type':Sequelize[_0x23a3('0x2')]}}; \ No newline at end of file +var _0x4853=['exports','name','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x3485('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x3485('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3485('0x2')]},'dialPrefix':{'type':Sequelize[_0x3485('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d940348..43b3f4a 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 _0x7132=['download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','getAgents','User','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','./cmList.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','sendStatus','error','stack','name','send','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','ListId','getDispositions','findOne','Disposition','length','order','pick','findAll','removeDispositions','ids','CmContact','tags','join','isArray','push','each','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','raw','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv'];(function(_0x228800,_0x1a89fe){var _0x5383f9=function(_0x20e98b){while(--_0x20e98b){_0x228800['push'](_0x228800['shift']());}};_0x5383f9(++_0x1a89fe);}(_0x7132,0x1cf));var _0x2713=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x7132[_0x102ff9];return _0x24fa97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2713('0x0'));var zipdir=require(_0x2713('0x1'));var jsonpatch=require(_0x2713('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2713('0x3'));var util=require('util');var path=require(_0x2713('0x4'));var sox=require(_0x2713('0x5'));var csv=require(_0x2713('0x6'));var ejs=require(_0x2713('0x7'));var fs=require('fs');var fs_extra=require(_0x2713('0x8'));var _=require(_0x2713('0x9'));var squel=require(_0x2713('0xa'));var crypto=require('crypto');var jsforce=require(_0x2713('0xb'));var deskjs=require(_0x2713('0xc'));var toCsv=require(_0x2713('0x6'));var querystring=require(_0x2713('0xd'));var Papa=require(_0x2713('0xe'));var Redis=require(_0x2713('0xf'));var authService=require(_0x2713('0x10'));var qs=require(_0x2713('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2713('0x12'));var logger=require(_0x2713('0x13'))(_0x2713('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2713('0x15'));var db=require('../../mysqldb')['db'];config[_0x2713('0x16')]=_[_0x2713('0x17')](config[_0x2713('0x16')],{'host':_0x2713('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2713('0x16')]));require(_0x2713('0x19'))[_0x2713('0x1a')](socket);function respondWithStatusCode(_0x245bd3,_0x2a6b8c){_0x2a6b8c=_0x2a6b8c||0xcc;return function(_0x171615){if(_0x171615){return _0x245bd3['sendStatus'](_0x2a6b8c);}return _0x245bd3['status'](_0x2a6b8c)['end']();};}function respondWithResult(_0x3d0840,_0x501aff){_0x501aff=_0x501aff||0xc8;return function(_0x2307dd){if(_0x2307dd){return _0x3d0840['status'](_0x501aff)[_0x2713('0x1b')](_0x2307dd);}};}function respondWithFilteredResult(_0x1eec5c,_0x1e2ab6){return function(_0x23a088){if(_0x23a088){var _0x5c16a9=typeof _0x1e2ab6[_0x2713('0x1c')]===_0x2713('0x1d')&&typeof _0x1e2ab6[_0x2713('0x1e')]===_0x2713('0x1d');var _0x2241f0=_0x23a088[_0x2713('0x1f')];var _0x1ca6b7=_0x5c16a9?0x0:_0x1e2ab6[_0x2713('0x1c')];var _0x28d3c3=_0x5c16a9?_0x23a088['count']:_0x1e2ab6[_0x2713('0x1c')]+_0x1e2ab6[_0x2713('0x1e')];var _0x3d446e;if(_0x28d3c3>=_0x2241f0){_0x28d3c3=_0x2241f0;_0x3d446e=0xc8;}else{_0x3d446e=0xce;}_0x1eec5c[_0x2713('0x20')](_0x3d446e);return _0x1eec5c[_0x2713('0x21')](_0x2713('0x22'),_0x1ca6b7+'-'+_0x28d3c3+'/'+_0x2241f0)['json'](_0x23a088);}return null;};}function patchUpdates(_0x559815){return function(_0x21721c){try{jsonpatch[_0x2713('0x23')](_0x21721c,_0x559815,!![]);}catch(_0x100467){return BPromise[_0x2713('0x24')](_0x100467);}return _0x21721c[_0x2713('0x25')]();};}function saveUpdates(_0x598dc5,_0x4bac27){return function(_0xdf48b4){if(_0xdf48b4){return _0xdf48b4[_0x2713('0x26')](_0x598dc5)[_0x2713('0x27')](function(_0x434cfb){return _0x434cfb;});}return null;};}function removeEntity(_0xe6a9b1,_0x106bd8){return function(_0x473717){if(_0x473717){return _0x473717[_0x2713('0x28')]()[_0x2713('0x27')](function(){var _0x582a21=_0x473717[_0x2713('0x29')]({'plain':!![]});var _0x24f2e7=_0x2713('0x2a');return db['UserProfileResource'][_0x2713('0x28')]({'where':{'type':_0x24f2e7,'resourceId':_0x582a21['id']}})[_0x2713('0x27')](function(){return _0x473717;});})[_0x2713('0x27')](function(){_0xe6a9b1[_0x2713('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407570,_0x411e33){return function(_0x34c911){if(!_0x34c911){_0x407570[_0x2713('0x2b')](0x194);}return _0x34c911;};}function handleError(_0x56878c,_0x15ebae){_0x15ebae=_0x15ebae||0x1f4;return function(_0x28174b){logger[_0x2713('0x2c')](_0x28174b[_0x2713('0x2d')]);if(_0x28174b[_0x2713('0x2e')]){delete _0x28174b[_0x2713('0x2e')];}_0x56878c[_0x2713('0x20')](_0x15ebae)[_0x2713('0x2f')](_0x28174b);};}exports['index']=function(_0x2e030b,_0x17b2e6){var _0x5db84b={},_0x1e2dbc={},_0x26968d={'count':0x0,'rows':[]};var _0x12e6b2=_[_0x2713('0x30')](db[_0x2713('0x31')][_0x2713('0x32')],function(_0xf1019){return{'name':_0xf1019[_0x2713('0x33')],'type':_0xf1019[_0x2713('0x34')][_0x2713('0x35')]};});_0x1e2dbc[_0x2713('0x36')]=_['map'](_0x12e6b2,_0x2713('0x2e'));_0x1e2dbc[_0x2713('0x37')]=_[_0x2713('0x38')](_0x2e030b['query']);_0x1e2dbc[_0x2713('0x39')]=_['intersection'](_0x1e2dbc[_0x2713('0x36')],_0x1e2dbc['query']);_0x5db84b[_0x2713('0x3a')]=_['intersection'](_0x1e2dbc['model'],qs[_0x2713('0x3b')](_0x2e030b[_0x2713('0x37')]['fields']));_0x5db84b[_0x2713('0x3a')]=_0x5db84b['attributes']['length']?_0x5db84b[_0x2713('0x3a')]:_0x1e2dbc[_0x2713('0x36')];if(!_0x2e030b[_0x2713('0x37')][_0x2713('0x3c')](_0x2713('0x3d'))){_0x5db84b[_0x2713('0x1e')]=qs[_0x2713('0x1e')](_0x2e030b[_0x2713('0x37')][_0x2713('0x1e')]);_0x5db84b[_0x2713('0x1c')]=qs['offset'](_0x2e030b[_0x2713('0x37')][_0x2713('0x1c')]);}_0x5db84b['order']=qs[_0x2713('0x3e')](_0x2e030b[_0x2713('0x37')][_0x2713('0x3e')]);_0x5db84b[_0x2713('0x3f')]=qs[_0x2713('0x39')](_['pick'](_0x2e030b[_0x2713('0x37')],_0x1e2dbc[_0x2713('0x39')]),_0x12e6b2);if(_0x2e030b[_0x2713('0x37')][_0x2713('0x40')]){_0x5db84b[_0x2713('0x3f')]=_[_0x2713('0x41')](_0x5db84b[_0x2713('0x3f')],{'$or':_[_0x2713('0x30')](_0x12e6b2,function(_0x2731db){if(_0x2731db[_0x2713('0x34')]!==_0x2713('0x42')){var _0x20c2f7={};_0x20c2f7[_0x2731db[_0x2713('0x2e')]]={'$like':'%'+_0x2e030b[_0x2713('0x37')]['filter']+'%'};return _0x20c2f7;}})});}_0x5db84b=_[_0x2713('0x41')]({},_0x5db84b,_0x2e030b[_0x2713('0x43')]);var _0xc733f5={'where':_0x5db84b[_0x2713('0x3f')]};return db[_0x2713('0x31')][_0x2713('0x1f')](_0xc733f5)[_0x2713('0x27')](function(_0x27b6ab){_0x26968d[_0x2713('0x1f')]=_0x27b6ab;if(_0x2e030b[_0x2713('0x37')][_0x2713('0x44')]){_0x5db84b[_0x2713('0x45')]=[{'all':!![]}];}return db[_0x2713('0x31')]['findAll'](_0x5db84b);})[_0x2713('0x27')](function(_0x42b749){_0x26968d[_0x2713('0x46')]=_0x42b749;return _0x26968d;})['then'](respondWithFilteredResult(_0x17b2e6,_0x5db84b))[_0x2713('0x47')](handleError(_0x17b2e6,null));};exports['show']=function(_0x906088,_0x455334){var _0xb3f3f2={'raw':![],'where':{'id':_0x906088['params']['id']}},_0x1f7bd0={};_0x1f7bd0['model']=_[_0x2713('0x38')](db[_0x2713('0x31')][_0x2713('0x32')]);_0x1f7bd0[_0x2713('0x37')]=_[_0x2713('0x38')](_0x906088[_0x2713('0x37')]);_0x1f7bd0[_0x2713('0x39')]=_[_0x2713('0x48')](_0x1f7bd0['model'],_0x1f7bd0[_0x2713('0x37')]);_0xb3f3f2[_0x2713('0x3a')]=_[_0x2713('0x48')](_0x1f7bd0[_0x2713('0x36')],qs['fields'](_0x906088[_0x2713('0x37')]['fields']));_0xb3f3f2[_0x2713('0x3a')]=_0xb3f3f2[_0x2713('0x3a')]['length']?_0xb3f3f2[_0x2713('0x3a')]:_0x1f7bd0[_0x2713('0x36')];if(_0x906088[_0x2713('0x37')][_0x2713('0x44')]){_0xb3f3f2[_0x2713('0x45')]=[{'all':!![]}];}_0xb3f3f2=_[_0x2713('0x41')]({},_0xb3f3f2,_0x906088[_0x2713('0x43')]);return db[_0x2713('0x31')][_0x2713('0x49')](_0xb3f3f2)['then'](handleEntityNotFound(_0x455334,null))[_0x2713('0x27')](respondWithResult(_0x455334,null))[_0x2713('0x47')](handleError(_0x455334,null));};exports[_0x2713('0x4a')]=function(_0x3a05ad,_0x4b9d82){return db['CmList']['create'](_0x3a05ad['body'],{})[_0x2713('0x27')](function(_0x29e72f){var _0x106578=_0x3a05ad[_0x2713('0x4b')]['get']({'plain':!![]});if(!_0x106578)throw new Error(_0x2713('0x4c'));if(_0x106578[_0x2713('0x4d')]===_0x2713('0x4b')){var _0x2a0f1d=_0x29e72f[_0x2713('0x29')]({'plain':!![]});var _0x3e5dd4=_0x2713('0x2a');return db[_0x2713('0x4e')][_0x2713('0x49')]({'where':{'name':_0x3e5dd4,'userProfileId':_0x106578[_0x2713('0x4f')]},'raw':!![]})[_0x2713('0x27')](function(_0x45d431){if(_0x45d431&&_0x45d431[_0x2713('0x50')]===0x0){return db[_0x2713('0x51')]['create']({'name':_0x2a0f1d[_0x2713('0x2e')],'resourceId':_0x2a0f1d['id'],'type':_0x45d431['name'],'sectionId':_0x45d431['id']},{})[_0x2713('0x27')](function(){return _0x29e72f;});}else{return _0x29e72f;}})['catch'](function(_0x42a4c7){logger[_0x2713('0x2c')](_0x2713('0x52'),_0x42a4c7);throw _0x42a4c7;});}return _0x29e72f;})[_0x2713('0x27')](respondWithResult(_0x4b9d82,0xc9))[_0x2713('0x47')](handleError(_0x4b9d82,null));};exports['update']=function(_0x4423de,_0x4553b6){if(_0x4423de[_0x2713('0x53')]['id']){delete _0x4423de['body']['id'];}return db[_0x2713('0x31')]['find']({'where':{'id':_0x4423de['params']['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x4553b6,null))[_0x2713('0x27')](saveUpdates(_0x4423de['body'],null))[_0x2713('0x27')](respondWithResult(_0x4553b6,null))[_0x2713('0x47')](handleError(_0x4553b6,null));};exports[_0x2713('0x28')]=function(_0x4aa521,_0x1fd750){return db[_0x2713('0x31')]['find']({'where':{'id':_0x4aa521[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x1fd750,null))[_0x2713('0x27')](removeEntity(_0x1fd750,null))[_0x2713('0x47')](handleError(_0x1fd750,null));};exports[_0x2713('0x55')]=function(_0x346a7c,_0x4c5f01){return db[_0x2713('0x31')][_0x2713('0x55')]()['then'](respondWithResult(_0x4c5f01,null))[_0x2713('0x47')](handleError(_0x4c5f01,null));};exports['addDisposition']=function(_0x22be33,_0x4923d0,_0x339d78){if(_0x22be33[_0x2713('0x53')]['id']){delete _0x22be33[_0x2713('0x53')]['id'];}return db[_0x2713('0x31')][_0x2713('0x49')]({'where':{'id':_0x22be33[_0x2713('0x54')]['id']}})['then'](handleEntityNotFound(_0x4923d0,null))[_0x2713('0x27')](function(_0x371dcf){if(_0x371dcf){_0x22be33[_0x2713('0x53')][_0x2713('0x56')]=_0x371dcf['id'];return db['Disposition'][_0x2713('0x4a')](_0x22be33[_0x2713('0x53')]);}})[_0x2713('0x27')](respondWithResult(_0x4923d0,null))[_0x2713('0x47')](handleError(_0x4923d0,null));};exports[_0x2713('0x57')]=function(_0x43e5a7,_0x5569f9,_0x5e8624){var _0x476180={'raw':![],'where':{}};var _0x19d942={};var _0x2d0954={'count':0x0,'rows':[]};return db[_0x2713('0x31')][_0x2713('0x58')]({'where':{'id':_0x43e5a7[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x5569f9,null))[_0x2713('0x27')](function(_0x32ea06){if(_0x32ea06){_0x19d942[_0x2713('0x36')]=_['keys'](db[_0x2713('0x59')]['rawAttributes']);_0x19d942[_0x2713('0x37')]=_[_0x2713('0x38')](_0x43e5a7[_0x2713('0x37')]);_0x19d942[_0x2713('0x39')]=_[_0x2713('0x48')](_0x19d942[_0x2713('0x36')],_0x19d942['query']);_0x476180['attributes']=_[_0x2713('0x48')](_0x19d942[_0x2713('0x36')],qs[_0x2713('0x3b')](_0x43e5a7[_0x2713('0x37')][_0x2713('0x3b')]));_0x476180[_0x2713('0x3a')]=_0x476180[_0x2713('0x3a')][_0x2713('0x5a')]?_0x476180[_0x2713('0x3a')]:_0x19d942[_0x2713('0x36')];if(!_0x43e5a7[_0x2713('0x37')][_0x2713('0x3c')](_0x2713('0x3d'))){_0x476180['limit']=qs[_0x2713('0x1e')](_0x43e5a7[_0x2713('0x37')][_0x2713('0x1e')]);_0x476180[_0x2713('0x1c')]=qs[_0x2713('0x1c')](_0x43e5a7['query'][_0x2713('0x1c')]);}_0x476180[_0x2713('0x5b')]=qs[_0x2713('0x3e')](_0x43e5a7[_0x2713('0x37')][_0x2713('0x3e')]);_0x476180['where']=qs[_0x2713('0x39')](_[_0x2713('0x5c')](_0x43e5a7[_0x2713('0x37')],_0x19d942[_0x2713('0x39')]));_0x476180[_0x2713('0x3f')][_0x2713('0x56')]=_0x32ea06['id'];if(_0x43e5a7[_0x2713('0x37')][_0x2713('0x40')]){_0x476180['where']=_[_0x2713('0x41')](_0x476180[_0x2713('0x3f')],{'$or':_[_0x2713('0x30')](_0x476180[_0x2713('0x3a')],function(_0x4e6c98){var _0x42d982={};_0x42d982[_0x4e6c98]={'$like':'%'+_0x43e5a7[_0x2713('0x37')][_0x2713('0x40')]+'%'};return _0x42d982;})});}_0x476180=_[_0x2713('0x41')]({},_0x476180,_0x43e5a7['options']);return db[_0x2713('0x59')]['count']({'where':_0x476180['where']})[_0x2713('0x27')](function(_0x34a967){_0x2d0954[_0x2713('0x1f')]=_0x34a967;if(_0x43e5a7[_0x2713('0x37')][_0x2713('0x44')]){_0x476180[_0x2713('0x45')]=[{'all':!![]}];}return db[_0x2713('0x59')][_0x2713('0x5d')](_0x476180);})[_0x2713('0x27')](function(_0x157b80){_0x2d0954['rows']=_0x157b80;return _0x2d0954;});}})['then'](respondWithFilteredResult(_0x5569f9,_0x476180))['catch'](handleError(_0x5569f9,null));};exports[_0x2713('0x5e')]=function(_0x547e9f,_0x5c7602,_0xaacab5){return db[_0x2713('0x31')][_0x2713('0x49')]({'where':{'id':_0x547e9f[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x5c7602,null))['then'](function(_0x468b61){if(_0x468b61){return _0x468b61[_0x2713('0x5e')](_0x547e9f[_0x2713('0x37')][_0x2713('0x5f')]);}})['then'](respondWithStatusCode(_0x5c7602,null))[_0x2713('0x47')](handleError(_0x5c7602,null));};exports['addContacts']=function(_0x37a75b,_0x50f9e6,_0x2c7c8c){return db[_0x2713('0x31')][_0x2713('0x49')]({'where':{'id':_0x37a75b['params']['id']}})['then'](handleEntityNotFound(_0x50f9e6,null))[_0x2713('0x27')](function(_0x592ecb){if(_0x592ecb){var _0x2d2911=[];var _0x53f85b={'success':[],'errors':[]};return db[_0x2713('0x60')][_0x2713('0x55')]()[_0x2713('0x27')](function(_0x3b23f4){if(_0x37a75b[_0x2713('0x53')][_0x2713('0x61')]&&_['isArray'](_0x37a75b['body']['tags'])){if(_0x37a75b['body'][_0x2713('0x61')][_0x2713('0x5a')]){_0x37a75b[_0x2713('0x53')]['tags']=_0x37a75b[_0x2713('0x53')][_0x2713('0x61')][_0x2713('0x62')](';')+';';}else{_0x37a75b[_0x2713('0x53')]['tags']=null;}}else{_0x37a75b['body']['tags']=null;}if(_0x37a75b[_0x2713('0x53')]&&_[_0x2713('0x63')](_0x37a75b[_0x2713('0x53')])){for(var _0x22d31e=0x0;_0x22d31e<_0x37a75b[_0x2713('0x53')][_0x2713('0x5a')];_0x22d31e+=0x1){_0x37a75b['body'][_0x22d31e][_0x2713('0x56')]=_0x37a75b[_0x2713('0x54')]['id'];_0x2d2911[_0x2713('0x64')](_0x37a75b[_0x2713('0x53')][_0x22d31e]);}return BPromise[_0x2713('0x65')](_0x2d2911,function(_0x5603d0){return db[_0x2713('0x60')][_0x2713('0x4a')](_['omit'](_0x5603d0,['ids','id'])||{},{'fields':_[_0x2713('0x38')](_0x3b23f4),'raw':!![]})[_0x2713('0x27')](function(_0x4dcafa){_0x53f85b['success'][_0x2713('0x64')](_0x4dcafa[_0x2713('0x66')]);})[_0x2713('0x47')](function(_0x6580a5){_0x53f85b[_0x2713('0x67')][_0x2713('0x64')]({'data':_0x5603d0,'error':_0x6580a5[_0x2713('0x68')]});});})[_0x2713('0x27')](function(_0x1e9dbf){return _0x53f85b;})[_0x2713('0x47')](function(_0x33ffaa){return _0x33ffaa;});}else{_0x50f9e6[_0x2713('0x20')](0x190)[_0x2713('0x1b')]({'message':_0x2713('0x69')});}});}})[_0x2713('0x27')](respondWithResult(_0x50f9e6,null))[_0x2713('0x47')](handleError(_0x50f9e6,null));};exports[_0x2713('0x6a')]=function(_0x273600,_0x473174,_0x49079d){var _0x51224a;return db['CmList'][_0x2713('0x49')]({'where':{'id':_0x273600[_0x2713('0x54')]['id']},'include':[{'model':db[_0x2713('0x6b')],'as':_0x2713('0x6c')}]})[_0x2713('0x27')](handleEntityNotFound(_0x473174,null))[_0x2713('0x27')](function(_0x16bd10){if(_0x16bd10){_0x51224a=_0x16bd10;return db['CmContact'][_0x2713('0x32')];}})[_0x2713('0x27')](function(_0x43bc57){if(_0x43bc57){var _0x23f801={};var _0x228aa9={};_0x228aa9[_0x2713('0x36')]=_[_0x2713('0x6d')](_[_0x2713('0x38')](_0x43bc57),_[_0x2713('0x30')](_0x51224a['CustomFields'],function(_0x121af2){return util['format']('cf_%d',_0x121af2['id']);}));_0x228aa9[_0x2713('0x37')]=_['keys'](_0x273600['query']);_0x228aa9[_0x2713('0x39')]=_[_0x2713('0x48')](_0x228aa9[_0x2713('0x36')],_0x228aa9[_0x2713('0x37')]);_0x23f801[_0x2713('0x3a')]=_[_0x2713('0x48')](_0x228aa9[_0x2713('0x36')],qs[_0x2713('0x3b')](_0x273600['query']['fields']));_0x23f801[_0x2713('0x3a')]=_0x23f801[_0x2713('0x3a')][_0x2713('0x5a')]?_0x23f801[_0x2713('0x3a')]:_0x228aa9[_0x2713('0x36')];if(!_0x273600[_0x2713('0x37')][_0x2713('0x3c')](_0x2713('0x3d'))){_0x23f801['limit']=qs[_0x2713('0x1e')](_0x273600[_0x2713('0x37')][_0x2713('0x1e')]);_0x23f801[_0x2713('0x1c')]=qs[_0x2713('0x1c')](_0x273600[_0x2713('0x37')][_0x2713('0x1c')]);}_0x23f801[_0x2713('0x5b')]=qs['sort'](_0x273600[_0x2713('0x37')][_0x2713('0x3e')]);_0x23f801[_0x2713('0x3f')]=qs['filters'](_[_0x2713('0x5c')](_0x273600[_0x2713('0x37')],_0x228aa9['filters']));_0x23f801[_0x2713('0x6e')]=!![];if(_0x273600[_0x2713('0x37')][_0x2713('0x40')]){_0x23f801[_0x2713('0x3f')]=_[_0x2713('0x41')](_0x23f801[_0x2713('0x3f')],{'$or':_[_0x2713('0x30')](_0x23f801[_0x2713('0x3a')],function(_0x1ff4ef){var _0x19fe75={};_0x19fe75[_0x1ff4ef]={'$like':'%'+_0x273600[_0x2713('0x37')][_0x2713('0x40')]+'%'};return _0x19fe75;})});}_0x23f801=_['merge']({},_0x23f801,_0x273600['options']);return _0x51224a[_0x2713('0x6a')](_0x23f801);}})[_0x2713('0x27')](respondWithResult(_0x473174,null))[_0x2713('0x47')](handleError(_0x473174,null));};exports['getContactsCsv']=function(_0x210156,_0xfe1a69,_0x5a54f9){var _0x280e69;return db['CmList']['find']({'where':{'id':_0x210156[_0x2713('0x54')]['id']},'include':[{'model':db[_0x2713('0x6b')],'as':_0x2713('0x6c')}]})[_0x2713('0x27')](handleEntityNotFound(_0xfe1a69,null))[_0x2713('0x27')](function(_0x2ae69f){if(_0x2ae69f){_0x280e69=_0x2ae69f;return db[_0x2713('0x60')][_0x2713('0x32')];}})['then'](function(_0x55ad8c){if(_0x55ad8c){var _0x50d9ce={};var _0xe22568={};_0xe22568[_0x2713('0x36')]=_['concat'](_[_0x2713('0x38')](_0x55ad8c),_[_0x2713('0x30')](_0x280e69[_0x2713('0x6c')],function(_0x56f6ad){return util[_0x2713('0x6f')]('cf_%d',_0x56f6ad['id']);}));_0xe22568[_0x2713('0x37')]=_['keys'](_0x210156[_0x2713('0x37')]);_0xe22568[_0x2713('0x39')]=_[_0x2713('0x48')](_0xe22568['model'],_0xe22568[_0x2713('0x37')]);_0x50d9ce[_0x2713('0x3a')]=_['intersection'](_0xe22568[_0x2713('0x36')],qs['fields'](_0x210156['query']['fields']));_0x50d9ce[_0x2713('0x3a')]=_0x50d9ce[_0x2713('0x3a')][_0x2713('0x5a')]?_0x50d9ce[_0x2713('0x3a')]:_0xe22568[_0x2713('0x36')];if(!_0x210156[_0x2713('0x37')][_0x2713('0x3c')](_0x2713('0x3d'))){_0x50d9ce['limit']=qs['limit'](_0x210156[_0x2713('0x37')][_0x2713('0x1e')]);_0x50d9ce['offset']=qs['offset'](_0x210156[_0x2713('0x37')][_0x2713('0x1c')]);}_0x50d9ce['order']=qs[_0x2713('0x3e')](_0x210156['query'][_0x2713('0x3e')]);_0x50d9ce[_0x2713('0x3f')]=qs['filters'](_[_0x2713('0x5c')](_0x210156['query'],_0xe22568['filters']));_0x50d9ce['raw']=!![];if(_0x210156['query'][_0x2713('0x40')]){_0x50d9ce[_0x2713('0x3f')]=_[_0x2713('0x41')](_0x50d9ce['where'],{'$or':_['map'](_0x50d9ce[_0x2713('0x3a')],function(_0x17f57e){var _0x42a95e={};_0x42a95e[_0x17f57e]={'$like':'%'+_0x210156['query']['filter']+'%'};return _0x42a95e;})});}_0x50d9ce=_['merge']({},_0x50d9ce,_0x210156['options']);return _0x280e69['getContacts'](_0x50d9ce);}})['then'](function(_0x44e319){if(!_[_0x2713('0x70')](_0x44e319)){var _0x44c05f=toCsv(_0x44e319);var _0x5777fa=Date['now']();fs[_0x2713('0x71')](util[_0x2713('0x6f')](_0x2713('0x72'),_0x280e69['id'],_0x5777fa),_0x44c05f);_0xfe1a69[_0x2713('0x73')](_0x2713('0x74'),_0x2713('0x75')+util['format'](_0x2713('0x76'),_0x280e69['id'],_0x5777fa));_0xfe1a69[_0x2713('0x73')](_0x2713('0x77'),_0x2713('0x78'));return _0xfe1a69[_0x2713('0x79')](util[_0x2713('0x6f')]('/tmp/list_%d_%s.csv',_0x280e69['id'],_0x5777fa));}else{return _0xfe1a69[_0x2713('0x2b')](0xcc);}})['catch'](handleError(_0xfe1a69,null));};exports[_0x2713('0x7a')]=function(_0x58f57d,_0x31cfd9,_0x275f48){var _0x11a653;delete _0x58f57d[_0x2713('0x53')]['id'];return db[_0x2713('0x31')][_0x2713('0x58')]({'where':{'id':_0x58f57d['params']['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x31cfd9,null))['then'](function(_0x5c4999){if(_0x5c4999){return db[_0x2713('0x7b')][_0x2713('0x7c')](function(_0x229adf){return db[_0x2713('0x6b')]['create'](_0x58f57d[_0x2713('0x53')],{'transaction':_0x229adf})[_0x2713('0x27')](function(_0x594276){_0x11a653=_0x594276;return _0x5c4999[_0x2713('0x7d')](_0x594276,{'transaction':_0x229adf});})[_0x2713('0x27')](function(){var _0x217e62={'type':db[_0x2713('0x7e')][_0x2713('0x7f')],'transaction':_0x229adf};switch(_0x58f57d[_0x2713('0x53')]['type']){case _0x2713('0x80'):_0x217e62[_0x2713('0x34')]=db[_0x2713('0x7e')][_0x2713('0x7f')];break;case _0x2713('0x81'):_0x217e62[_0x2713('0x34')]=db[_0x2713('0x7e')][_0x2713('0x82')];break;case _0x2713('0x83'):_0x217e62[_0x2713('0x34')]=db[_0x2713('0x7e')][_0x2713('0x84')];_0x217e62[_0x2713('0x85')]=![];break;default:}return db[_0x2713('0x7b')]['queryInterface'][_0x2713('0x86')](_0x2713('0x87'),util['format']('cf_%s',_0x11a653['id']),_0x217e62);})[_0x2713('0x27')](function(){return _0x11a653;});});}})[_0x2713('0x27')](respondWithResult(_0x31cfd9,null))['catch'](handleError(_0x31cfd9,null));};exports[_0x2713('0x88')]=function(_0x4895a0,_0x35f9b3,_0x262895){var _0xd94c01={};var _0x1a0697={};var _0x334df2;var _0x4b29a0;return db['CmList'][_0x2713('0x58')]({'where':{'id':_0x4895a0[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x35f9b3,null))[_0x2713('0x27')](function(_0x3de73d){if(_0x3de73d){_0x334df2=_0x3de73d;_0x1a0697[_0x2713('0x36')]=_[_0x2713('0x38')](db[_0x2713('0x6b')]['rawAttributes']);_0x1a0697['query']=_[_0x2713('0x38')](_0x4895a0[_0x2713('0x37')]);_0x1a0697[_0x2713('0x39')]=_[_0x2713('0x48')](_0x1a0697[_0x2713('0x36')],_0x1a0697[_0x2713('0x37')]);_0xd94c01['attributes']=_[_0x2713('0x48')](_0x1a0697[_0x2713('0x36')],qs[_0x2713('0x3b')](_0x4895a0[_0x2713('0x37')]['fields']));_0xd94c01['attributes']=_0xd94c01[_0x2713('0x3a')]['length']?_0xd94c01[_0x2713('0x3a')]:_0x1a0697[_0x2713('0x36')];_0xd94c01[_0x2713('0x5b')]=qs[_0x2713('0x3e')](_0x4895a0['query'][_0x2713('0x3e')]);_0xd94c01[_0x2713('0x3f')]=qs[_0x2713('0x39')](_[_0x2713('0x5c')](_0x4895a0[_0x2713('0x37')],_0x1a0697['filters']));_0xd94c01['where']=_[_0x2713('0x41')](_0xd94c01[_0x2713('0x3f')],{'$or':[{'ListId':_0x3de73d['id']},{'ListId':null}]});if(_0x4895a0[_0x2713('0x37')]['filter']){_0xd94c01[_0x2713('0x3f')]=_[_0x2713('0x41')](_0xd94c01['where'],{'$or':_['map'](_0xd94c01[_0x2713('0x3a')],function(_0x5d8311){var _0x31f8f9={};_0x31f8f9[_0x5d8311]={'$like':'%'+_0x4895a0[_0x2713('0x37')][_0x2713('0x40')]+'%'};return _0x31f8f9;})});}_0xd94c01=_[_0x2713('0x41')]({},_0xd94c01,_0x4895a0[_0x2713('0x43')]);return db[_0x2713('0x6b')][_0x2713('0x89')](_0xd94c01);}})['then'](respondWithResult(_0x35f9b3,null))[_0x2713('0x47')](handleError(_0x35f9b3,null));};exports[_0x2713('0x8a')]=function(_0x50ab30,_0x49f18c,_0x56172e){return db[_0x2713('0x31')][_0x2713('0x49')]({'where':{'id':_0x50ab30[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x49f18c,null))[_0x2713('0x27')](function(_0x4f0a70){if(_0x4f0a70){return _0x4f0a70[_0x2713('0x8a')](_0x50ab30[_0x2713('0x53')][_0x2713('0x5f')],_[_0x2713('0x8b')](_0x50ab30[_0x2713('0x53')],[_0x2713('0x5f'),'id'])||{})[_0x2713('0x8c')](function(_0x3959a0){for(var _0x7cd9a8=0x0;_0x7cd9a8<_0x50ab30[_0x2713('0x53')][_0x2713('0x5f')]['length'];_0x7cd9a8+=0x1){socket[_0x2713('0x8d')](_0x2713('0x8e'),{'UserId':Number(_0x50ab30[_0x2713('0x53')][_0x2713('0x5f')][_0x7cd9a8]),'CmListId':Number(_0x50ab30['params']['id'])});}return _0x3959a0;});}})[_0x2713('0x27')](respondWithResult(_0x49f18c,null))[_0x2713('0x47')](handleError(_0x49f18c,null));};exports[_0x2713('0x8f')]=function(_0x35fcb6,_0x5f5b06,_0x41ff97){return db[_0x2713('0x31')][_0x2713('0x49')]({'where':{'id':_0x35fcb6[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x5f5b06,null))[_0x2713('0x27')](function(_0x189450){if(_0x189450){return _0x189450[_0x2713('0x8f')](_0x35fcb6[_0x2713('0x37')][_0x2713('0x5f')])[_0x2713('0x27')](function(){if(_['isArray'](_0x35fcb6[_0x2713('0x37')]['ids'])){for(var _0x12419c=0x0;_0x12419c<_0x35fcb6[_0x2713('0x37')][_0x2713('0x5f')][_0x2713('0x5a')];_0x12419c+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x35fcb6[_0x2713('0x37')]['ids'][_0x12419c]),'CmListId':Number(_0x35fcb6['params']['id'])});}}else{socket[_0x2713('0x8d')]('userCmList:remove',{'UserId':Number(_0x35fcb6['query']['ids']),'CmListId':Number(_0x35fcb6[_0x2713('0x54')]['id'])});}});}})[_0x2713('0x27')](respondWithStatusCode(_0x5f5b06,null))['catch'](handleError(_0x5f5b06,null));};exports[_0x2713('0x90')]=function(_0x58f212,_0x438e24,_0x3a7569){var _0x38858c={};var _0x70959e={};var _0x1235d8;var _0x274856;return db[_0x2713('0x31')]['findOne']({'where':{'id':_0x58f212[_0x2713('0x54')]['id']}})[_0x2713('0x27')](handleEntityNotFound(_0x438e24,null))[_0x2713('0x27')](function(_0x9413d){if(_0x9413d){_0x1235d8=_0x9413d;_0x70959e[_0x2713('0x36')]=_[_0x2713('0x38')](db[_0x2713('0x91')][_0x2713('0x32')]);_0x70959e[_0x2713('0x37')]=_[_0x2713('0x38')](_0x58f212[_0x2713('0x37')]);_0x70959e[_0x2713('0x39')]=_[_0x2713('0x48')](_0x70959e[_0x2713('0x36')],_0x70959e[_0x2713('0x37')]);_0x38858c['attributes']=_[_0x2713('0x48')](_0x70959e['model'],qs['fields'](_0x58f212[_0x2713('0x37')][_0x2713('0x3b')]));_0x38858c[_0x2713('0x3a')]=_0x38858c[_0x2713('0x3a')]['length']?_0x38858c['attributes']:_0x70959e[_0x2713('0x36')];_0x38858c[_0x2713('0x5b')]=qs[_0x2713('0x3e')](_0x58f212[_0x2713('0x37')][_0x2713('0x3e')]);_0x38858c[_0x2713('0x3f')]=qs[_0x2713('0x39')](_[_0x2713('0x5c')](_0x58f212[_0x2713('0x37')],_0x70959e[_0x2713('0x39')]));if(_0x58f212[_0x2713('0x37')][_0x2713('0x40')]){_0x38858c[_0x2713('0x3f')]=_[_0x2713('0x41')](_0x38858c[_0x2713('0x3f')],{'$or':_[_0x2713('0x30')](_0x38858c[_0x2713('0x3a')],function(_0x5d8b79){var _0x103e0d={};_0x103e0d[_0x5d8b79]={'$like':'%'+_0x58f212[_0x2713('0x37')][_0x2713('0x40')]+'%'};return _0x103e0d;})});}_0x38858c=_[_0x2713('0x41')]({},_0x38858c,_0x58f212[_0x2713('0x43')]);return _0x1235d8[_0x2713('0x90')](_0x38858c);}})[_0x2713('0x27')](function(_0x8ef0a8){if(_0x8ef0a8){_0x274856=_0x8ef0a8[_0x2713('0x5a')];if(!_0x58f212[_0x2713('0x37')][_0x2713('0x3c')]('nolimit')){_0x38858c['limit']=qs[_0x2713('0x1e')](_0x58f212['query'][_0x2713('0x1e')]);_0x38858c['offset']=qs['offset'](_0x58f212['query'][_0x2713('0x1c')]);}return _0x1235d8[_0x2713('0x90')](_0x38858c);}})[_0x2713('0x27')](function(_0x18680f){if(_0x18680f){return _0x18680f?{'count':_0x274856,'rows':_0x18680f}:null;}})['then'](respondWithResult(_0x438e24,null))['catch'](handleError(_0x438e24,null));}; \ No newline at end of file +var _0xe5ca=['../../config/license/hardware','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','Lists','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','params','intersection','length','find','catch','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','pick','filter','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','ListId','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','CustomFields','cf_%d','getContactsCsv','CmCustomField','concat','raw','getContacts','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','addCustomFields','Sequelize','text','TEXT','number','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x534c44,_0x375e8f){var _0x4ff4a0=function(_0x486b52){while(--_0x486b52){_0x534c44['push'](_0x534c44['shift']());}};_0x4ff4a0(++_0x375e8f);}(_0xe5ca,0x7d));var _0xae5c=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xe5ca[_0x145b3c];return _0x1b6e36;};'use strict';var emlformat=require(_0xae5c('0x0'));var rimraf=require(_0xae5c('0x1'));var zipdir=require(_0xae5c('0x2'));var jsonpatch=require(_0xae5c('0x3'));var rp=require(_0xae5c('0x4'));var moment=require(_0xae5c('0x5'));var BPromise=require(_0xae5c('0x6'));var Mustache=require(_0xae5c('0x7'));var util=require('util');var path=require(_0xae5c('0x8'));var sox=require(_0xae5c('0x9'));var csv=require('to-csv');var ejs=require(_0xae5c('0xa'));var fs=require('fs');var fs_extra=require(_0xae5c('0xb'));var _=require(_0xae5c('0xc'));var squel=require(_0xae5c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xae5c('0xe'));var toCsv=require(_0xae5c('0xf'));var querystring=require(_0xae5c('0x10'));var Papa=require(_0xae5c('0x11'));var Redis=require(_0xae5c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae5c('0x13'));var hardwareService=require(_0xae5c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xae5c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xae5c('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xae5c('0x17')](config[_0xae5c('0x18')],{'host':_0xae5c('0x19'),'port':0x18eb});var socket=require(_0xae5c('0x1a'))(new Redis(config[_0xae5c('0x18')]));require('./cmList.socket')[_0xae5c('0x1b')](socket);function respondWithStatusCode(_0x57b0ab,_0x3c3206){_0x3c3206=_0x3c3206||0xcc;return function(_0x32ec0f){if(_0x32ec0f){return _0x57b0ab[_0xae5c('0x1c')](_0x3c3206);}return _0x57b0ab['status'](_0x3c3206)[_0xae5c('0x1d')]();};}function respondWithResult(_0x5d9e31,_0x515956){_0x515956=_0x515956||0xc8;return function(_0x5583eb){if(_0x5583eb){return _0x5d9e31[_0xae5c('0x1e')](_0x515956)['json'](_0x5583eb);}};}function respondWithFilteredResult(_0x270522,_0x5d5033){return function(_0x2ba308){if(_0x2ba308){var _0x5617b2=typeof _0x5d5033['offset']===_0xae5c('0x1f')&&typeof _0x5d5033['limit']===_0xae5c('0x1f');var _0x5106cb=_0x2ba308[_0xae5c('0x20')];var _0x54e87f=_0x5617b2?0x0:_0x5d5033[_0xae5c('0x21')];var _0x77d5b6=_0x5617b2?_0x2ba308[_0xae5c('0x20')]:_0x5d5033['offset']+_0x5d5033[_0xae5c('0x22')];var _0x24de05;if(_0x77d5b6>=_0x5106cb){_0x77d5b6=_0x5106cb;_0x24de05=0xc8;}else{_0x24de05=0xce;}_0x270522[_0xae5c('0x1e')](_0x24de05);return _0x270522['set'](_0xae5c('0x23'),_0x54e87f+'-'+_0x77d5b6+'/'+_0x5106cb)[_0xae5c('0x24')](_0x2ba308);}return null;};}function patchUpdates(_0x5420a3){return function(_0x4d4816){try{jsonpatch[_0xae5c('0x25')](_0x4d4816,_0x5420a3,!![]);}catch(_0x3f953f){return BPromise[_0xae5c('0x26')](_0x3f953f);}return _0x4d4816[_0xae5c('0x27')]();};}function saveUpdates(_0x4b4fff,_0x10659f){return function(_0x226c23){if(_0x226c23){return _0x226c23[_0xae5c('0x28')](_0x4b4fff)['then'](function(_0x501c02){return _0x501c02;});}return null;};}function removeEntity(_0x2d10ad,_0xe0cd11){return function(_0x3fd9d8){if(_0x3fd9d8){return _0x3fd9d8[_0xae5c('0x29')]()[_0xae5c('0x2a')](function(){var _0x3c6a4d=_0x3fd9d8['get']({'plain':!![]});var _0x42da7d=_0xae5c('0x2b');return db[_0xae5c('0x2c')][_0xae5c('0x29')]({'where':{'type':_0x42da7d,'resourceId':_0x3c6a4d['id']}})['then'](function(){return _0x3fd9d8;});})[_0xae5c('0x2a')](function(){_0x2d10ad[_0xae5c('0x1e')](0xcc)[_0xae5c('0x1d')]();});}};}function handleEntityNotFound(_0x21cf1b,_0x57b0c5){return function(_0x13196f){if(!_0x13196f){_0x21cf1b[_0xae5c('0x1c')](0x194);}return _0x13196f;};}function handleError(_0x210fc6,_0x5465a1){_0x5465a1=_0x5465a1||0x1f4;return function(_0x24bc50){logger[_0xae5c('0x2d')](_0x24bc50[_0xae5c('0x2e')]);if(_0x24bc50[_0xae5c('0x2f')]){delete _0x24bc50[_0xae5c('0x2f')];}_0x210fc6['status'](_0x5465a1)['send'](_0x24bc50);};}exports[_0xae5c('0x30')]=function(_0x293f61,_0x2e6e6c){var _0xf31da8={},_0x88462d={},_0x79dfbd={'count':0x0,'rows':[]};var _0x116d83=_[_0xae5c('0x31')](db['CmList'][_0xae5c('0x32')],function(_0x4fec69){return{'name':_0x4fec69['fieldName'],'type':_0x4fec69[_0xae5c('0x33')][_0xae5c('0x34')]};});_0x88462d[_0xae5c('0x35')]=_[_0xae5c('0x31')](_0x116d83,_0xae5c('0x2f'));_0x88462d[_0xae5c('0x36')]=_[_0xae5c('0x37')](_0x293f61['query']);_0x88462d[_0xae5c('0x38')]=_['intersection'](_0x88462d['model'],_0x88462d[_0xae5c('0x36')]);_0xf31da8[_0xae5c('0x39')]=_['intersection'](_0x88462d[_0xae5c('0x35')],qs[_0xae5c('0x3a')](_0x293f61[_0xae5c('0x36')]['fields']));_0xf31da8['attributes']=_0xf31da8[_0xae5c('0x39')]['length']?_0xf31da8['attributes']:_0x88462d[_0xae5c('0x35')];if(!_0x293f61[_0xae5c('0x36')][_0xae5c('0x3b')](_0xae5c('0x3c'))){_0xf31da8[_0xae5c('0x22')]=qs[_0xae5c('0x22')](_0x293f61[_0xae5c('0x36')][_0xae5c('0x22')]);_0xf31da8[_0xae5c('0x21')]=qs[_0xae5c('0x21')](_0x293f61[_0xae5c('0x36')][_0xae5c('0x21')]);}_0xf31da8[_0xae5c('0x3d')]=qs[_0xae5c('0x3e')](_0x293f61[_0xae5c('0x36')][_0xae5c('0x3e')]);_0xf31da8[_0xae5c('0x3f')]=qs[_0xae5c('0x38')](_['pick'](_0x293f61[_0xae5c('0x36')],_0x88462d['filters']),_0x116d83);if(_0x293f61['query']['filter']){_0xf31da8['where']=_[_0xae5c('0x40')](_0xf31da8[_0xae5c('0x3f')],{'$or':_[_0xae5c('0x31')](_0x116d83,function(_0x74c7ba){if(_0x74c7ba[_0xae5c('0x33')]!==_0xae5c('0x41')){var _0x3236f0={};_0x3236f0[_0x74c7ba[_0xae5c('0x2f')]]={'$like':'%'+_0x293f61[_0xae5c('0x36')]['filter']+'%'};return _0x3236f0;}})});}_0xf31da8=_[_0xae5c('0x40')]({},_0xf31da8,_0x293f61[_0xae5c('0x42')]);var _0x5cac17={'where':_0xf31da8[_0xae5c('0x3f')]};return db[_0xae5c('0x43')][_0xae5c('0x20')](_0x5cac17)[_0xae5c('0x2a')](function(_0x782bd7){_0x79dfbd[_0xae5c('0x20')]=_0x782bd7;if(_0x293f61['query'][_0xae5c('0x44')]){_0xf31da8[_0xae5c('0x45')]=[{'all':!![]}];}return db[_0xae5c('0x43')][_0xae5c('0x46')](_0xf31da8);})[_0xae5c('0x2a')](function(_0xab4822){_0x79dfbd[_0xae5c('0x47')]=_0xab4822;return _0x79dfbd;})[_0xae5c('0x2a')](respondWithFilteredResult(_0x2e6e6c,_0xf31da8))['catch'](handleError(_0x2e6e6c,null));};exports['show']=function(_0x3db221,_0x39981b){var _0x26e751={'raw':![],'where':{'id':_0x3db221[_0xae5c('0x48')]['id']}},_0x2d9c53={};_0x2d9c53['model']=_[_0xae5c('0x37')](db[_0xae5c('0x43')]['rawAttributes']);_0x2d9c53[_0xae5c('0x36')]=_['keys'](_0x3db221[_0xae5c('0x36')]);_0x2d9c53['filters']=_[_0xae5c('0x49')](_0x2d9c53[_0xae5c('0x35')],_0x2d9c53['query']);_0x26e751[_0xae5c('0x39')]=_['intersection'](_0x2d9c53[_0xae5c('0x35')],qs[_0xae5c('0x3a')](_0x3db221[_0xae5c('0x36')][_0xae5c('0x3a')]));_0x26e751[_0xae5c('0x39')]=_0x26e751[_0xae5c('0x39')][_0xae5c('0x4a')]?_0x26e751[_0xae5c('0x39')]:_0x2d9c53[_0xae5c('0x35')];if(_0x3db221['query']['includeAll']){_0x26e751[_0xae5c('0x45')]=[{'all':!![]}];}_0x26e751=_['merge']({},_0x26e751,_0x3db221['options']);return db['CmList'][_0xae5c('0x4b')](_0x26e751)['then'](handleEntityNotFound(_0x39981b,null))[_0xae5c('0x2a')](respondWithResult(_0x39981b,null))[_0xae5c('0x4c')](handleError(_0x39981b,null));};exports[_0xae5c('0x4d')]=function(_0x39b975,_0x1dd44f){return db['CmList']['create'](_0x39b975[_0xae5c('0x4e')],{})[_0xae5c('0x2a')](function(_0x136dc1){var _0x156968=_0x39b975[_0xae5c('0x4f')]['get']({'plain':!![]});if(!_0x156968)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x156968[_0xae5c('0x50')]===_0xae5c('0x4f')){var _0x44c5ce=_0x136dc1[_0xae5c('0x51')]({'plain':!![]});var _0x3aa611=_0xae5c('0x2b');return db[_0xae5c('0x52')][_0xae5c('0x4b')]({'where':{'name':_0x3aa611,'userProfileId':_0x156968[_0xae5c('0x53')]},'raw':!![]})[_0xae5c('0x2a')](function(_0x4bf8c0){if(_0x4bf8c0&&_0x4bf8c0[_0xae5c('0x54')]===0x0){return db['UserProfileResource'][_0xae5c('0x4d')]({'name':_0x44c5ce['name'],'resourceId':_0x44c5ce['id'],'type':_0x4bf8c0['name'],'sectionId':_0x4bf8c0['id']},{})['then'](function(){return _0x136dc1;});}else{return _0x136dc1;}})['catch'](function(_0x339e4c){logger[_0xae5c('0x2d')](_0xae5c('0x55'),_0x339e4c);throw _0x339e4c;});}return _0x136dc1;})[_0xae5c('0x2a')](respondWithResult(_0x1dd44f,0xc9))['catch'](handleError(_0x1dd44f,null));};exports['update']=function(_0x429970,_0x5c11ab){if(_0x429970[_0xae5c('0x4e')]['id']){delete _0x429970[_0xae5c('0x4e')]['id'];}return db['CmList'][_0xae5c('0x4b')]({'where':{'id':_0x429970['params']['id']}})['then'](handleEntityNotFound(_0x5c11ab,null))[_0xae5c('0x2a')](saveUpdates(_0x429970[_0xae5c('0x4e')],null))['then'](respondWithResult(_0x5c11ab,null))[_0xae5c('0x4c')](handleError(_0x5c11ab,null));};exports['destroy']=function(_0x4c7fcc,_0x27c026){return db[_0xae5c('0x43')][_0xae5c('0x4b')]({'where':{'id':_0x4c7fcc[_0xae5c('0x48')]['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x27c026,null))[_0xae5c('0x2a')](removeEntity(_0x27c026,null))[_0xae5c('0x4c')](handleError(_0x27c026,null));};exports[_0xae5c('0x56')]=function(_0x2bfccf,_0x39c416){return db[_0xae5c('0x43')]['describe']()[_0xae5c('0x2a')](respondWithResult(_0x39c416,null))['catch'](handleError(_0x39c416,null));};exports['addDisposition']=function(_0x4d8cbd,_0x20f9f9,_0x454142){if(_0x4d8cbd[_0xae5c('0x4e')]['id']){delete _0x4d8cbd[_0xae5c('0x4e')]['id'];}return db['CmList'][_0xae5c('0x4b')]({'where':{'id':_0x4d8cbd[_0xae5c('0x48')]['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x20f9f9,null))[_0xae5c('0x2a')](function(_0x13f050){if(_0x13f050){_0x4d8cbd[_0xae5c('0x4e')]['ListId']=_0x13f050['id'];return db[_0xae5c('0x57')][_0xae5c('0x4d')](_0x4d8cbd[_0xae5c('0x4e')]);}})[_0xae5c('0x2a')](respondWithResult(_0x20f9f9,null))['catch'](handleError(_0x20f9f9,null));};exports[_0xae5c('0x58')]=function(_0x14c963,_0x78daa,_0x31672e){var _0xac8b6d={'raw':![],'where':{}};var _0x3587aa={};var _0x1f36e9={'count':0x0,'rows':[]};return db[_0xae5c('0x43')][_0xae5c('0x59')]({'where':{'id':_0x14c963[_0xae5c('0x48')]['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x78daa,null))[_0xae5c('0x2a')](function(_0x3e8bdb){if(_0x3e8bdb){_0x3587aa[_0xae5c('0x35')]=_['keys'](db[_0xae5c('0x57')][_0xae5c('0x32')]);_0x3587aa[_0xae5c('0x36')]=_['keys'](_0x14c963['query']);_0x3587aa[_0xae5c('0x38')]=_['intersection'](_0x3587aa[_0xae5c('0x35')],_0x3587aa[_0xae5c('0x36')]);_0xac8b6d[_0xae5c('0x39')]=_[_0xae5c('0x49')](_0x3587aa['model'],qs[_0xae5c('0x3a')](_0x14c963['query'][_0xae5c('0x3a')]));_0xac8b6d[_0xae5c('0x39')]=_0xac8b6d[_0xae5c('0x39')][_0xae5c('0x4a')]?_0xac8b6d[_0xae5c('0x39')]:_0x3587aa[_0xae5c('0x35')];if(!_0x14c963[_0xae5c('0x36')]['hasOwnProperty'](_0xae5c('0x3c'))){_0xac8b6d[_0xae5c('0x22')]=qs[_0xae5c('0x22')](_0x14c963[_0xae5c('0x36')][_0xae5c('0x22')]);_0xac8b6d[_0xae5c('0x21')]=qs[_0xae5c('0x21')](_0x14c963[_0xae5c('0x36')][_0xae5c('0x21')]);}_0xac8b6d[_0xae5c('0x3d')]=qs[_0xae5c('0x3e')](_0x14c963[_0xae5c('0x36')][_0xae5c('0x3e')]);_0xac8b6d[_0xae5c('0x3f')]=qs[_0xae5c('0x38')](_[_0xae5c('0x5a')](_0x14c963['query'],_0x3587aa[_0xae5c('0x38')]));_0xac8b6d[_0xae5c('0x3f')]['ListId']=_0x3e8bdb['id'];if(_0x14c963[_0xae5c('0x36')][_0xae5c('0x5b')]){_0xac8b6d[_0xae5c('0x3f')]=_[_0xae5c('0x40')](_0xac8b6d[_0xae5c('0x3f')],{'$or':_[_0xae5c('0x31')](_0xac8b6d[_0xae5c('0x39')],function(_0x481e75){var _0x1edbbf={};_0x1edbbf[_0x481e75]={'$like':'%'+_0x14c963[_0xae5c('0x36')][_0xae5c('0x5b')]+'%'};return _0x1edbbf;})});}_0xac8b6d=_[_0xae5c('0x40')]({},_0xac8b6d,_0x14c963[_0xae5c('0x42')]);return db['Disposition'][_0xae5c('0x20')]({'where':_0xac8b6d[_0xae5c('0x3f')]})[_0xae5c('0x2a')](function(_0xf46331){_0x1f36e9[_0xae5c('0x20')]=_0xf46331;if(_0x14c963[_0xae5c('0x36')][_0xae5c('0x44')]){_0xac8b6d[_0xae5c('0x45')]=[{'all':!![]}];}return db[_0xae5c('0x57')][_0xae5c('0x46')](_0xac8b6d);})['then'](function(_0x5c6c13){_0x1f36e9[_0xae5c('0x47')]=_0x5c6c13;return _0x1f36e9;});}})[_0xae5c('0x2a')](respondWithFilteredResult(_0x78daa,_0xac8b6d))[_0xae5c('0x4c')](handleError(_0x78daa,null));};exports[_0xae5c('0x5c')]=function(_0x315c9c,_0x286df2,_0x1720ea){return db['CmList'][_0xae5c('0x4b')]({'where':{'id':_0x315c9c[_0xae5c('0x48')]['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x286df2,null))[_0xae5c('0x2a')](function(_0xdc4b5b){if(_0xdc4b5b){return _0xdc4b5b[_0xae5c('0x5c')](_0x315c9c[_0xae5c('0x36')][_0xae5c('0x5d')]);}})['then'](respondWithStatusCode(_0x286df2,null))[_0xae5c('0x4c')](handleError(_0x286df2,null));};exports[_0xae5c('0x5e')]=function(_0x3b8d13,_0xe7661f,_0x2897be){return db['CmList'][_0xae5c('0x4b')]({'where':{'id':_0x3b8d13[_0xae5c('0x48')]['id']}})['then'](handleEntityNotFound(_0xe7661f,null))[_0xae5c('0x2a')](function(_0x2af42b){if(_0x2af42b){var _0x27508c=[];var _0x450b9b={'success':[],'errors':[]};return db[_0xae5c('0x5f')][_0xae5c('0x56')]()['then'](function(_0x43fd76){if(_0x3b8d13[_0xae5c('0x4e')][_0xae5c('0x60')]&&_[_0xae5c('0x61')](_0x3b8d13[_0xae5c('0x4e')][_0xae5c('0x60')])){if(_0x3b8d13[_0xae5c('0x4e')][_0xae5c('0x60')]['length']){_0x3b8d13[_0xae5c('0x4e')][_0xae5c('0x60')]=_0x3b8d13[_0xae5c('0x4e')][_0xae5c('0x60')][_0xae5c('0x62')](';')+';';}else{_0x3b8d13[_0xae5c('0x4e')]['tags']=null;}}else{_0x3b8d13['body'][_0xae5c('0x60')]=null;}if(_0x3b8d13[_0xae5c('0x4e')]&&_[_0xae5c('0x61')](_0x3b8d13['body'])){for(var _0x4ad3bc=0x0;_0x4ad3bc<_0x3b8d13[_0xae5c('0x4e')][_0xae5c('0x4a')];_0x4ad3bc+=0x1){_0x3b8d13['body'][_0x4ad3bc][_0xae5c('0x63')]=_0x3b8d13[_0xae5c('0x48')]['id'];_0x27508c[_0xae5c('0x64')](_0x3b8d13[_0xae5c('0x4e')][_0x4ad3bc]);}return BPromise['each'](_0x27508c,function(_0x45e1c7){return db[_0xae5c('0x5f')][_0xae5c('0x4d')](_[_0xae5c('0x65')](_0x45e1c7,['ids','id'])||{},{'fields':_[_0xae5c('0x37')](_0x43fd76),'raw':!![]})[_0xae5c('0x2a')](function(_0x439ba7){_0x450b9b[_0xae5c('0x66')][_0xae5c('0x64')](_0x439ba7[_0xae5c('0x67')]);})[_0xae5c('0x4c')](function(_0x5d4051){_0x450b9b[_0xae5c('0x68')][_0xae5c('0x64')]({'data':_0x45e1c7,'error':_0x5d4051[_0xae5c('0x69')]});});})['then'](function(_0x467469){return _0x450b9b;})[_0xae5c('0x4c')](function(_0x1d52f6){return _0x1d52f6;});}else{_0xe7661f['status'](0x190)[_0xae5c('0x24')]({'message':_0xae5c('0x6a')});}});}})['then'](respondWithResult(_0xe7661f,null))[_0xae5c('0x4c')](handleError(_0xe7661f,null));};exports['getContacts']=function(_0x38fdad,_0x5a6c00,_0xeffaec){var _0xd36da6;return db[_0xae5c('0x43')][_0xae5c('0x4b')]({'where':{'id':_0x38fdad[_0xae5c('0x48')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xae5c('0x6b')}]})[_0xae5c('0x2a')](handleEntityNotFound(_0x5a6c00,null))[_0xae5c('0x2a')](function(_0x1b212d){if(_0x1b212d){_0xd36da6=_0x1b212d;return db[_0xae5c('0x5f')][_0xae5c('0x32')];}})[_0xae5c('0x2a')](function(_0xdf486f){if(_0xdf486f){var _0x15b738={};var _0x35029e={};_0x35029e[_0xae5c('0x35')]=_['concat'](_[_0xae5c('0x37')](_0xdf486f),_[_0xae5c('0x31')](_0xd36da6[_0xae5c('0x6b')],function(_0x4fbc41){return util['format'](_0xae5c('0x6c'),_0x4fbc41['id']);}));_0x35029e[_0xae5c('0x36')]=_[_0xae5c('0x37')](_0x38fdad[_0xae5c('0x36')]);_0x35029e[_0xae5c('0x38')]=_[_0xae5c('0x49')](_0x35029e[_0xae5c('0x35')],_0x35029e[_0xae5c('0x36')]);_0x15b738[_0xae5c('0x39')]=_[_0xae5c('0x49')](_0x35029e['model'],qs[_0xae5c('0x3a')](_0x38fdad[_0xae5c('0x36')][_0xae5c('0x3a')]));_0x15b738[_0xae5c('0x39')]=_0x15b738[_0xae5c('0x39')][_0xae5c('0x4a')]?_0x15b738['attributes']:_0x35029e[_0xae5c('0x35')];if(!_0x38fdad[_0xae5c('0x36')]['hasOwnProperty'](_0xae5c('0x3c'))){_0x15b738[_0xae5c('0x22')]=qs[_0xae5c('0x22')](_0x38fdad[_0xae5c('0x36')][_0xae5c('0x22')]);_0x15b738[_0xae5c('0x21')]=qs[_0xae5c('0x21')](_0x38fdad[_0xae5c('0x36')][_0xae5c('0x21')]);}_0x15b738[_0xae5c('0x3d')]=qs[_0xae5c('0x3e')](_0x38fdad[_0xae5c('0x36')][_0xae5c('0x3e')]);_0x15b738['where']=qs[_0xae5c('0x38')](_['pick'](_0x38fdad['query'],_0x35029e[_0xae5c('0x38')]));_0x15b738['raw']=!![];if(_0x38fdad[_0xae5c('0x36')]['filter']){_0x15b738[_0xae5c('0x3f')]=_[_0xae5c('0x40')](_0x15b738[_0xae5c('0x3f')],{'$or':_[_0xae5c('0x31')](_0x15b738['attributes'],function(_0x2d2395){var _0x19a32d={};_0x19a32d[_0x2d2395]={'$like':'%'+_0x38fdad[_0xae5c('0x36')][_0xae5c('0x5b')]+'%'};return _0x19a32d;})});}_0x15b738=_['merge']({},_0x15b738,_0x38fdad['options']);return _0xd36da6['getContacts'](_0x15b738);}})[_0xae5c('0x2a')](respondWithResult(_0x5a6c00,null))[_0xae5c('0x4c')](handleError(_0x5a6c00,null));};exports[_0xae5c('0x6d')]=function(_0x253c2e,_0x42e7bb,_0x2f0316){var _0x5653f8;return db[_0xae5c('0x43')][_0xae5c('0x4b')]({'where':{'id':_0x253c2e[_0xae5c('0x48')]['id']},'include':[{'model':db[_0xae5c('0x6e')],'as':_0xae5c('0x6b')}]})[_0xae5c('0x2a')](handleEntityNotFound(_0x42e7bb,null))[_0xae5c('0x2a')](function(_0x478f74){if(_0x478f74){_0x5653f8=_0x478f74;return db['CmContact'][_0xae5c('0x32')];}})[_0xae5c('0x2a')](function(_0x52f5a1){if(_0x52f5a1){var _0x5dc1ef={};var _0x30094b={};_0x30094b[_0xae5c('0x35')]=_[_0xae5c('0x6f')](_[_0xae5c('0x37')](_0x52f5a1),_['map'](_0x5653f8[_0xae5c('0x6b')],function(_0x598cf4){return util['format']('cf_%d',_0x598cf4['id']);}));_0x30094b[_0xae5c('0x36')]=_[_0xae5c('0x37')](_0x253c2e[_0xae5c('0x36')]);_0x30094b[_0xae5c('0x38')]=_['intersection'](_0x30094b[_0xae5c('0x35')],_0x30094b['query']);_0x5dc1ef[_0xae5c('0x39')]=_[_0xae5c('0x49')](_0x30094b[_0xae5c('0x35')],qs[_0xae5c('0x3a')](_0x253c2e[_0xae5c('0x36')][_0xae5c('0x3a')]));_0x5dc1ef[_0xae5c('0x39')]=_0x5dc1ef[_0xae5c('0x39')][_0xae5c('0x4a')]?_0x5dc1ef[_0xae5c('0x39')]:_0x30094b[_0xae5c('0x35')];if(!_0x253c2e[_0xae5c('0x36')][_0xae5c('0x3b')]('nolimit')){_0x5dc1ef[_0xae5c('0x22')]=qs['limit'](_0x253c2e[_0xae5c('0x36')][_0xae5c('0x22')]);_0x5dc1ef[_0xae5c('0x21')]=qs[_0xae5c('0x21')](_0x253c2e[_0xae5c('0x36')][_0xae5c('0x21')]);}_0x5dc1ef[_0xae5c('0x3d')]=qs[_0xae5c('0x3e')](_0x253c2e[_0xae5c('0x36')]['sort']);_0x5dc1ef[_0xae5c('0x3f')]=qs[_0xae5c('0x38')](_[_0xae5c('0x5a')](_0x253c2e[_0xae5c('0x36')],_0x30094b[_0xae5c('0x38')]));_0x5dc1ef[_0xae5c('0x70')]=!![];if(_0x253c2e[_0xae5c('0x36')][_0xae5c('0x5b')]){_0x5dc1ef[_0xae5c('0x3f')]=_['merge'](_0x5dc1ef[_0xae5c('0x3f')],{'$or':_['map'](_0x5dc1ef['attributes'],function(_0x20d9ca){var _0x3d19dd={};_0x3d19dd[_0x20d9ca]={'$like':'%'+_0x253c2e[_0xae5c('0x36')][_0xae5c('0x5b')]+'%'};return _0x3d19dd;})});}_0x5dc1ef=_[_0xae5c('0x40')]({},_0x5dc1ef,_0x253c2e[_0xae5c('0x42')]);return _0x5653f8[_0xae5c('0x71')](_0x5dc1ef);}})[_0xae5c('0x2a')](function(_0x38633a){if(!_['isEmpty'](_0x38633a)){var _0x3a1134=toCsv(_0x38633a);var _0x36e942=Date[_0xae5c('0x72')]();fs[_0xae5c('0x73')](util[_0xae5c('0x74')](_0xae5c('0x75'),_0x5653f8['id'],_0x36e942),_0x3a1134);_0x42e7bb[_0xae5c('0x76')]('Content-disposition','attachment;\x20filename='+util[_0xae5c('0x74')](_0xae5c('0x77'),_0x5653f8['id'],_0x36e942));_0x42e7bb[_0xae5c('0x76')](_0xae5c('0x78'),_0xae5c('0x79'));return _0x42e7bb[_0xae5c('0x7a')](util[_0xae5c('0x74')](_0xae5c('0x75'),_0x5653f8['id'],_0x36e942));}else{return _0x42e7bb['sendStatus'](0xcc);}})[_0xae5c('0x4c')](handleError(_0x42e7bb,null));};exports[_0xae5c('0x7b')]=function(_0x427a07,_0xf9de63,_0x2036b3){var _0x1e2d6a;delete _0x427a07['body']['id'];return db['CmList'][_0xae5c('0x59')]({'where':{'id':_0x427a07[_0xae5c('0x48')]['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0xf9de63,null))[_0xae5c('0x2a')](function(_0x4731ab){if(_0x4731ab){return db['sequelize']['transaction'](function(_0x409f86){return db[_0xae5c('0x6e')][_0xae5c('0x4d')](_0x427a07['body'],{'transaction':_0x409f86})[_0xae5c('0x2a')](function(_0x2af190){_0x1e2d6a=_0x2af190;return _0x4731ab[_0xae5c('0x7c')](_0x2af190,{'transaction':_0x409f86});})['then'](function(){var _0x2079e9={'type':db[_0xae5c('0x7d')]['TEXT'],'transaction':_0x409f86};switch(_0x427a07[_0xae5c('0x4e')][_0xae5c('0x33')]){case _0xae5c('0x7e'):_0x2079e9[_0xae5c('0x33')]=db[_0xae5c('0x7d')][_0xae5c('0x7f')];break;case _0xae5c('0x80'):_0x2079e9[_0xae5c('0x33')]=db[_0xae5c('0x7d')]['INTEGER'];break;case _0xae5c('0x81'):_0x2079e9[_0xae5c('0x33')]=db[_0xae5c('0x7d')]['BOOLEAN'];_0x2079e9[_0xae5c('0x82')]=![];break;default:}return db[_0xae5c('0x83')][_0xae5c('0x84')][_0xae5c('0x85')](_0xae5c('0x86'),util[_0xae5c('0x74')](_0xae5c('0x87'),_0x1e2d6a['id']),_0x2079e9);})[_0xae5c('0x2a')](function(){return _0x1e2d6a;});});}})[_0xae5c('0x2a')](respondWithResult(_0xf9de63,null))['catch'](handleError(_0xf9de63,null));};exports[_0xae5c('0x88')]=function(_0x30941d,_0x521c87,_0x1440ce){var _0x370a98={};var _0x546afe={};var _0x1008a3;var _0x185949;return db['CmList'][_0xae5c('0x59')]({'where':{'id':_0x30941d['params']['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x521c87,null))[_0xae5c('0x2a')](function(_0x2e1ffb){if(_0x2e1ffb){_0x1008a3=_0x2e1ffb;_0x546afe[_0xae5c('0x35')]=_['keys'](db[_0xae5c('0x6e')]['rawAttributes']);_0x546afe[_0xae5c('0x36')]=_['keys'](_0x30941d[_0xae5c('0x36')]);_0x546afe['filters']=_['intersection'](_0x546afe[_0xae5c('0x35')],_0x546afe[_0xae5c('0x36')]);_0x370a98[_0xae5c('0x39')]=_[_0xae5c('0x49')](_0x546afe[_0xae5c('0x35')],qs['fields'](_0x30941d[_0xae5c('0x36')]['fields']));_0x370a98[_0xae5c('0x39')]=_0x370a98[_0xae5c('0x39')][_0xae5c('0x4a')]?_0x370a98[_0xae5c('0x39')]:_0x546afe[_0xae5c('0x35')];_0x370a98['order']=qs[_0xae5c('0x3e')](_0x30941d[_0xae5c('0x36')][_0xae5c('0x3e')]);_0x370a98['where']=qs['filters'](_[_0xae5c('0x5a')](_0x30941d[_0xae5c('0x36')],_0x546afe[_0xae5c('0x38')]));_0x370a98[_0xae5c('0x3f')]=_[_0xae5c('0x40')](_0x370a98[_0xae5c('0x3f')],{'$or':[{'ListId':_0x2e1ffb['id']},{'ListId':null}]});if(_0x30941d['query']['filter']){_0x370a98[_0xae5c('0x3f')]=_[_0xae5c('0x40')](_0x370a98['where'],{'$or':_['map'](_0x370a98['attributes'],function(_0x423095){var _0x20599f={};_0x20599f[_0x423095]={'$like':'%'+_0x30941d[_0xae5c('0x36')][_0xae5c('0x5b')]+'%'};return _0x20599f;})});}_0x370a98=_['merge']({},_0x370a98,_0x30941d['options']);return db[_0xae5c('0x6e')][_0xae5c('0x89')](_0x370a98);}})[_0xae5c('0x2a')](respondWithResult(_0x521c87,null))[_0xae5c('0x4c')](handleError(_0x521c87,null));};exports[_0xae5c('0x8a')]=function(_0x4d4a45,_0x2fecbd,_0x12f626){return db[_0xae5c('0x43')]['find']({'where':{'id':_0x4d4a45['params']['id']}})['then'](handleEntityNotFound(_0x2fecbd,null))[_0xae5c('0x2a')](function(_0x315ded){if(_0x315ded){return _0x315ded[_0xae5c('0x8a')](_0x4d4a45['body']['ids'],_[_0xae5c('0x65')](_0x4d4a45[_0xae5c('0x4e')],[_0xae5c('0x5d'),'id'])||{})[_0xae5c('0x8b')](function(_0x5220c6){for(var _0x2b710b=0x0;_0x2b710b<_0x4d4a45[_0xae5c('0x4e')]['ids'][_0xae5c('0x4a')];_0x2b710b+=0x1){socket[_0xae5c('0x8c')](_0xae5c('0x8d'),{'UserId':Number(_0x4d4a45['body'][_0xae5c('0x5d')][_0x2b710b]),'CmListId':Number(_0x4d4a45[_0xae5c('0x48')]['id'])});}return _0x5220c6;});}})[_0xae5c('0x2a')](respondWithResult(_0x2fecbd,null))['catch'](handleError(_0x2fecbd,null));};exports[_0xae5c('0x8e')]=function(_0x1d35ee,_0x10c557,_0x111f4d){return db[_0xae5c('0x43')]['find']({'where':{'id':_0x1d35ee['params']['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x10c557,null))[_0xae5c('0x2a')](function(_0x2455c1){if(_0x2455c1){return _0x2455c1[_0xae5c('0x8e')](_0x1d35ee['query'][_0xae5c('0x5d')])[_0xae5c('0x2a')](function(){if(_['isArray'](_0x1d35ee[_0xae5c('0x36')][_0xae5c('0x5d')])){for(var _0x3110cf=0x0;_0x3110cf<_0x1d35ee[_0xae5c('0x36')][_0xae5c('0x5d')][_0xae5c('0x4a')];_0x3110cf+=0x1){socket[_0xae5c('0x8c')](_0xae5c('0x8f'),{'UserId':Number(_0x1d35ee[_0xae5c('0x36')][_0xae5c('0x5d')][_0x3110cf]),'CmListId':Number(_0x1d35ee[_0xae5c('0x48')]['id'])});}}else{socket[_0xae5c('0x8c')]('userCmList:remove',{'UserId':Number(_0x1d35ee[_0xae5c('0x36')][_0xae5c('0x5d')]),'CmListId':Number(_0x1d35ee[_0xae5c('0x48')]['id'])});}});}})[_0xae5c('0x2a')](respondWithStatusCode(_0x10c557,null))[_0xae5c('0x4c')](handleError(_0x10c557,null));};exports[_0xae5c('0x90')]=function(_0x34fd9b,_0x2b8051,_0x2d8f86){var _0x3525f0={};var _0x3844b8={};var _0x1d4da9;var _0x18ee3d;return db['CmList']['findOne']({'where':{'id':_0x34fd9b[_0xae5c('0x48')]['id']}})[_0xae5c('0x2a')](handleEntityNotFound(_0x2b8051,null))['then'](function(_0x5c5404){if(_0x5c5404){_0x1d4da9=_0x5c5404;_0x3844b8[_0xae5c('0x35')]=_['keys'](db['User'][_0xae5c('0x32')]);_0x3844b8[_0xae5c('0x36')]=_[_0xae5c('0x37')](_0x34fd9b[_0xae5c('0x36')]);_0x3844b8[_0xae5c('0x38')]=_[_0xae5c('0x49')](_0x3844b8[_0xae5c('0x35')],_0x3844b8['query']);_0x3525f0[_0xae5c('0x39')]=_[_0xae5c('0x49')](_0x3844b8['model'],qs[_0xae5c('0x3a')](_0x34fd9b[_0xae5c('0x36')][_0xae5c('0x3a')]));_0x3525f0[_0xae5c('0x39')]=_0x3525f0[_0xae5c('0x39')][_0xae5c('0x4a')]?_0x3525f0[_0xae5c('0x39')]:_0x3844b8['model'];_0x3525f0['order']=qs['sort'](_0x34fd9b[_0xae5c('0x36')]['sort']);_0x3525f0[_0xae5c('0x3f')]=qs[_0xae5c('0x38')](_[_0xae5c('0x5a')](_0x34fd9b[_0xae5c('0x36')],_0x3844b8[_0xae5c('0x38')]));if(_0x34fd9b[_0xae5c('0x36')][_0xae5c('0x5b')]){_0x3525f0[_0xae5c('0x3f')]=_['merge'](_0x3525f0[_0xae5c('0x3f')],{'$or':_['map'](_0x3525f0['attributes'],function(_0x5a4cbc){var _0x16aa91={};_0x16aa91[_0x5a4cbc]={'$like':'%'+_0x34fd9b[_0xae5c('0x36')][_0xae5c('0x5b')]+'%'};return _0x16aa91;})});}_0x3525f0=_['merge']({},_0x3525f0,_0x34fd9b[_0xae5c('0x42')]);return _0x1d4da9['getAgents'](_0x3525f0);}})['then'](function(_0x5b7ea2){if(_0x5b7ea2){_0x18ee3d=_0x5b7ea2['length'];if(!_0x34fd9b[_0xae5c('0x36')][_0xae5c('0x3b')](_0xae5c('0x3c'))){_0x3525f0[_0xae5c('0x22')]=qs[_0xae5c('0x22')](_0x34fd9b[_0xae5c('0x36')]['limit']);_0x3525f0['offset']=qs[_0xae5c('0x21')](_0x34fd9b[_0xae5c('0x36')]['offset']);}return _0x1d4da9[_0xae5c('0x90')](_0x3525f0);}})['then'](function(_0x3fdf30){if(_0x3fdf30){return _0x3fdf30?{'count':_0x18ee3d,'rows':_0x3fdf30}:null;}})[_0xae5c('0x2a')](respondWithResult(_0x2b8051,null))['catch'](handleError(_0x2b8051,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index fdd3beb..c72724e 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x5fc3[_0x580971];return _0x16d873;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x432517,_0x441302){var _0x37b1bf=function(_0x445075){while(--_0x445075){_0x432517['push'](_0x432517['shift']());}};_0x37b1bf(++_0x441302);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index c7057fc..2acf54c 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 _0x1be1=['define','cm_lists','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x1be1,0x192));var _0x11be=function(_0x4a1c18,_0x3d51ef){_0x4a1c18=_0x4a1c18-0x0;var _0x2412ff=_0x1be1[_0x4a1c18];return _0x2412ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('CmList',attributes,{'tableName':_0x11be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./cmList.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x601c7e,_0x5a7c8d){var _0x30bd1e=function(_0x2ec38f){while(--_0x2ec38f){_0x601c7e['push'](_0x601c7e['shift']());}};_0x30bd1e(++_0x5a7c8d);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0xb4e6[_0x5c5c52];return _0x4229ff;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 2d04af9..44da1fa 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 _0x62b9=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','request\x20sent','debug'];(function(_0x3c66df,_0x308c0f){var _0xf4b8c0=function(_0x36b188){while(--_0x36b188){_0x3c66df['push'](_0x3c66df['shift']());}};_0xf4b8c0(++_0x308c0f);}(_0x62b9,0xfc));var _0x962b=function(_0x52bd34,_0x33a88e){_0x52bd34=_0x52bd34-0x0;var _0x2c2f01=_0x62b9[_0x52bd34];return _0x2c2f01;};'use strict';var _=require('lodash');var util=require(_0x962b('0x0'));var moment=require(_0x962b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x962b('0x2'));var db=require(_0x962b('0x3'))['db'];var utils=require(_0x962b('0x4'));var logger=require(_0x962b('0x5'))(_0x962b('0x6'));var config=require(_0x962b('0x7'));var jayson=require(_0x962b('0x8'));var client=jayson['client'][_0x962b('0x9')]({'port':0x232a});config[_0x962b('0xa')]=_['defaults'](config[_0x962b('0xa')],{'host':_0x962b('0xb'),'port':0x18eb});var socket=require(_0x962b('0xc'))(new Redis(config[_0x962b('0xa')]));require(_0x962b('0xd'))[_0x962b('0xe')](socket);function respondWithRpcPromise(_0x112951,_0x5da1ef,_0x138a27){return new BPromise(function(_0x2b0f81,_0x2d800f){return client[_0x962b('0xf')](_0x112951,_0x138a27)['then'](function(_0x809827){logger['info']('CmList,\x20%s,\x20%s',_0x5da1ef,_0x962b('0x10'));logger[_0x962b('0x11')](_0x962b('0x12'),_0x5da1ef,'request\x20sent',JSON[_0x962b('0x13')](_0x809827));if(_0x809827[_0x962b('0x14')]){if(_0x809827[_0x962b('0x14')][_0x962b('0x15')]===0x1f4){logger['error'](_0x962b('0x16'),_0x5da1ef,_0x809827[_0x962b('0x14')][_0x962b('0x17')]);return _0x2d800f(_0x809827[_0x962b('0x14')]['message']);}logger[_0x962b('0x14')]('CmList,\x20%s,\x20%s',_0x5da1ef,_0x809827[_0x962b('0x14')][_0x962b('0x17')]);return _0x2b0f81(_0x809827[_0x962b('0x14')][_0x962b('0x17')]);}else{logger[_0x962b('0x18')](_0x962b('0x16'),_0x5da1ef,'request\x20sent');_0x2b0f81(_0x809827[_0x962b('0x19')][_0x962b('0x17')]);}})[_0x962b('0x1a')](function(_0x52c20d){logger[_0x962b('0x14')](_0x962b('0x16'),_0x5da1ef,_0x52c20d);_0x2d800f(_0x52c20d);});});} \ No newline at end of file +var _0x6eef=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5b772d,_0x2fa8c8){var _0x19dfe6=function(_0x496852){while(--_0x496852){_0x5b772d['push'](_0x5b772d['shift']());}};_0x19dfe6(++_0x2fa8c8);}(_0x6eef,0x108));var _0xf6ee=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x6eef[_0x3a4f18];return _0x4c20fc;};'use strict';var _=require(_0xf6ee('0x0'));var util=require(_0xf6ee('0x1'));var moment=require(_0xf6ee('0x2'));var BPromise=require(_0xf6ee('0x3'));var rs=require(_0xf6ee('0x4'));var fs=require('fs');var Redis=require(_0xf6ee('0x5'));var db=require(_0xf6ee('0x6'))['db'];var utils=require(_0xf6ee('0x7'));var logger=require(_0xf6ee('0x8'))('rpc');var config=require(_0xf6ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf6ee('0xa')][_0xf6ee('0xb')]({'port':0x232a});config[_0xf6ee('0xc')]=_[_0xf6ee('0xd')](config['redis'],{'host':_0xf6ee('0xe'),'port':0x18eb});var socket=require(_0xf6ee('0xf'))(new Redis(config[_0xf6ee('0xc')]));require(_0xf6ee('0x10'))[_0xf6ee('0x11')](socket);function respondWithRpcPromise(_0xeaa5d,_0x496ea8,_0x2e118e){return new BPromise(function(_0x3ae362,_0x462d39){return client[_0xf6ee('0x12')](_0xeaa5d,_0x2e118e)[_0xf6ee('0x13')](function(_0x3ecc38){logger[_0xf6ee('0x14')](_0xf6ee('0x15'),_0x496ea8,_0xf6ee('0x16'));logger[_0xf6ee('0x17')](_0xf6ee('0x18'),_0x496ea8,_0xf6ee('0x16'),JSON['stringify'](_0x3ecc38));if(_0x3ecc38[_0xf6ee('0x19')]){if(_0x3ecc38[_0xf6ee('0x19')][_0xf6ee('0x1a')]===0x1f4){logger['error'](_0xf6ee('0x15'),_0x496ea8,_0x3ecc38[_0xf6ee('0x19')][_0xf6ee('0x1b')]);return _0x462d39(_0x3ecc38[_0xf6ee('0x19')][_0xf6ee('0x1b')]);}logger[_0xf6ee('0x19')](_0xf6ee('0x15'),_0x496ea8,_0x3ecc38[_0xf6ee('0x19')][_0xf6ee('0x1b')]);return _0x3ae362(_0x3ecc38[_0xf6ee('0x19')][_0xf6ee('0x1b')]);}else{logger['info'](_0xf6ee('0x15'),_0x496ea8,_0xf6ee('0x16'));_0x3ae362(_0x3ecc38[_0xf6ee('0x1c')][_0xf6ee('0x1b')]);}})[_0xf6ee('0x1d')](function(_0x22f80b){logger[_0xf6ee('0x19')]('CmList,\x20%s,\x20%s',_0x496ea8,_0x22f80b);_0x462d39(_0x22f80b);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4a4b203..5776007 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 _0xd184=['cmList:','save','remove','update','length'];(function(_0x2ded66,_0x4da3b9){var _0x9e8952=function(_0x313262){while(--_0x313262){_0x2ded66['push'](_0x2ded66['shift']());}};_0x9e8952(++_0x4da3b9);}(_0xd184,0x1d2));var _0x4d18=function(_0x5cebc8,_0x12baa0){_0x5cebc8=_0x5cebc8-0x0;var _0x5d6379=_0xd184[_0x5cebc8];return _0x5d6379;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x4d18('0x0'),_0x4d18('0x1'),_0x4d18('0x2')];function createListener(_0x4b5dff,_0x1230d6){return function(_0x4630df){_0x1230d6['emit'](_0x4b5dff,_0x4630df);};}function removeListener(_0x50dd78,_0x4ead2f){return function(){CmListEvents['removeListener'](_0x50dd78,_0x4ead2f);};}exports['register']=function(_0x44d028){for(var _0x3429f4=0x0,_0x567263=events[_0x4d18('0x3')];_0x3429f4<_0x567263;_0x3429f4++){var _0x4a0305=events[_0x3429f4];var _0x32a73c=createListener(_0x4d18('0x4')+_0x4a0305,_0x44d028);CmListEvents['on'](_0x4a0305,_0x32a73c);}}; \ No newline at end of file +var _0xe4b0=['remove','update','emit','register','length','cmList:','./cmList.events','save'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe4b0,0x7e));var _0x0e4b=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0xe4b0[_0x10bcc4];return _0x2da988;};'use strict';var CmListEvents=require(_0x0e4b('0x0'));var events=[_0x0e4b('0x1'),_0x0e4b('0x2'),_0x0e4b('0x3')];function createListener(_0x143cf0,_0x17bc09){return function(_0x49a8d1){_0x17bc09[_0x0e4b('0x4')](_0x143cf0,_0x49a8d1);};}function removeListener(_0x5bb286,_0x4dfb9a){return function(){CmListEvents['removeListener'](_0x5bb286,_0x4dfb9a);};}exports[_0x0e4b('0x5')]=function(_0x4b0b17){for(var _0x49f867=0x0,_0x26fa74=events[_0x0e4b('0x6')];_0x49f867<_0x26fa74;_0x49f867++){var _0x11d0dd=events[_0x49f867];var _0x12267e=createListener(_0x0e4b('0x7')+_0x11d0dd,_0x4b0b17);CmListEvents['on'](_0x11d0dd,_0x12267e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 4299dfd..9b61bf1 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 _0x43f5=['delete','destroy','path','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','update'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x43f5,0x12e));var _0x543f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x43f5[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x543f('0x0'));var timeout=require(_0x543f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x543f('0x2'));var auth=require(_0x543f('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x543f('0x4')]('/',auth[_0x543f('0x5')](),controller[_0x543f('0x6')]);router[_0x543f('0x4')](_0x543f('0x7'),auth['isAuthenticated'](),controller[_0x543f('0x8')]);router[_0x543f('0x4')](_0x543f('0x9'),auth[_0x543f('0x5')](),controller[_0x543f('0xa')]);router[_0x543f('0x4')](_0x543f('0xb'),auth[_0x543f('0x5')](),controller[_0x543f('0xc')]);router['get'](_0x543f('0xd'),auth[_0x543f('0x5')](),controller[_0x543f('0xe')]);router[_0x543f('0x4')](_0x543f('0xf'),auth[_0x543f('0x5')](),controller[_0x543f('0x10')]);router[_0x543f('0x4')](_0x543f('0x11'),auth[_0x543f('0x5')](),controller[_0x543f('0x12')]);router[_0x543f('0x4')](_0x543f('0x13'),auth[_0x543f('0x5')](),controller[_0x543f('0x14')]);router[_0x543f('0x15')]('/',auth[_0x543f('0x5')](),controller['create']);router[_0x543f('0x15')](_0x543f('0xb'),auth[_0x543f('0x5')](),controller[_0x543f('0x16')]);router[_0x543f('0x15')](_0x543f('0xd'),auth['isAuthenticated'](),controller[_0x543f('0x17')]);router[_0x543f('0x15')](_0x543f('0x11'),auth[_0x543f('0x5')](),controller[_0x543f('0x18')]);router[_0x543f('0x15')](_0x543f('0x13'),auth[_0x543f('0x5')](),controller[_0x543f('0x19')]);router[_0x543f('0x1a')](_0x543f('0x9'),auth[_0x543f('0x5')](),controller[_0x543f('0x1b')]);router[_0x543f('0x1c')](_0x543f('0x9'),auth[_0x543f('0x5')](),controller[_0x543f('0x1d')]);router[_0x543f('0x1c')](_0x543f('0xb'),auth[_0x543f('0x5')](),controller['removeDispositions']);router[_0x543f('0x1c')](_0x543f('0x13'),auth[_0x543f('0x5')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x84ab=['/:id','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','/describe','describe','isAuthenticated','/:id/dispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents'];(function(_0x4f5fbc,_0x74cb4e){var _0x486e0e=function(_0x306829){while(--_0x306829){_0x4f5fbc['push'](_0x4f5fbc['shift']());}};_0x486e0e(++_0x74cb4e);}(_0x84ab,0x12f));var _0xb84a=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x84ab[_0x1678c8];return _0x387aa9;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0x9')]('/:id',auth[_0xb84a('0xc')](),controller['show']);router[_0xb84a('0x9')](_0xb84a('0xd'),auth[_0xb84a('0xc')](),controller['getDispositions']);router['get']('/:id/contacts',auth[_0xb84a('0xc')](),controller[_0xb84a('0xe')]);router[_0xb84a('0x9')](_0xb84a('0xf'),auth[_0xb84a('0xc')](),controller['getContactsCsv']);router[_0xb84a('0x9')](_0xb84a('0x10'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x11')]);router[_0xb84a('0x9')](_0xb84a('0x12'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x13')]);router[_0xb84a('0x14')]('/',auth[_0xb84a('0xc')](),controller[_0xb84a('0x15')]);router[_0xb84a('0x14')]('/:id/dispositions',auth[_0xb84a('0xc')](),controller[_0xb84a('0x16')]);router[_0xb84a('0x14')](_0xb84a('0x17'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x18')]);router[_0xb84a('0x14')](_0xb84a('0x10'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x19')]);router[_0xb84a('0x14')](_0xb84a('0x12'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x1a')]);router['put'](_0xb84a('0x1b'),auth[_0xb84a('0xc')](),controller['update']);router[_0xb84a('0x1c')](_0xb84a('0x1b'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x1d')]);router['delete']('/:id/dispositions',auth[_0xb84a('0xc')](),controller[_0xb84a('0x1e')]);router[_0xb84a('0x1c')](_0xb84a('0x12'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x1f')]);module[_0xb84a('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e8d53ca..dce8d0f 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 _0xc4bb=['STRING','sequelize','VIRTUAL'];(function(_0x5aae01,_0x271b14){var _0x59a87c=function(_0x2786c5){while(--_0x2786c5){_0x5aae01['push'](_0x5aae01['shift']());}};_0x59a87c(++_0x271b14);}(_0xc4bb,0x109));var _0xbc4b=function(_0x2b43b0,_0x565f18){_0x2b43b0=_0x2b43b0-0x0;var _0x3e6de0=_0xc4bb[_0x2b43b0];return _0x3e6de0;};'use strict';var Sequelize=require(_0xbc4b('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc4b('0x1')],'get':function(_0x2bca30){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0xbc4b('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0xbc4b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xbc4b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb2d4=['STRING','exports','getDataValue','field'];(function(_0x288d17,_0xb1bf09){var _0x5936a9=function(_0x2e6fb9){while(--_0x2e6fb9){_0x288d17['push'](_0x288d17['shift']());}};_0x5936a9(++_0xb1bf09);}(_0xb2d4,0x121));var _0x4b2d=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xb2d4[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require('sequelize');module[_0x4b2d('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2321c0){return this[_0x4b2d('0x1')](_0x4b2d('0x2'));}},'field':{'type':Sequelize[_0x4b2d('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x4b2d('0x3')],'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 b2a953d..65b5718 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2a8d86,_0x4e246a){var _0x431d74=function(_0x1c2760){while(--_0x1c2760){_0x2a8d86['push'](_0x2a8d86['shift']());}};_0x431d74(++_0x4e246a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2ed1f2,_0x5bdea3){var _0x4c2ca7=function(_0x3f96d5){while(--_0x3f96d5){_0x2ed1f2['push'](_0x2ed1f2['shift']());}};_0x4c2ca7(++_0x5bdea3);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index cff4a45..a623755 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 _0x95a6=['rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','../../config/logger','moment','request-promise','path'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x95a6,0x119));var _0x695a=function(_0x35e4d2,_0x49ff9b){_0x35e4d2=_0x35e4d2-0x0;var _0x4abb8c=_0x95a6[_0x35e4d2];return _0x4abb8c;};'use strict';var _=require(_0x695a('0x0'));var util=require('util');var logger=require(_0x695a('0x1'))('api');var moment=require(_0x695a('0x2'));var BPromise=require('bluebird');var rp=require(_0x695a('0x3'));var fs=require('fs');var path=require(_0x695a('0x4'));var rimraf=require(_0x695a('0x5'));var config=require(_0x695a('0x6'));var attributes=require(_0x695a('0x7'));module['exports']=function(_0x491fb7,_0x2895e2){return _0x491fb7[_0x695a('0x8')](_0x695a('0x9'),attributes,{'tableName':_0x695a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1afb=['./condition.attributes','define','tools_conditions','lodash','util','moment','request-promise','path','rimraf'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x1afb,0x1f2));var _0xb1af=function(_0x5b097b,_0x3f0831){_0x5b097b=_0x5b097b-0x0;var _0x37745c=_0x1afb[_0x5b097b];return _0x37745c;};'use strict';var _=require(_0xb1af('0x0'));var util=require(_0xb1af('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb1af('0x2'));var BPromise=require('bluebird');var rp=require(_0xb1af('0x3'));var fs=require('fs');var path=require(_0xb1af('0x4'));var rimraf=require(_0xb1af('0x5'));var config=require('../../config/environment');var attributes=require(_0xb1af('0x6'));module['exports']=function(_0x4999d2,_0x30efa0){return _0x4999d2[_0xb1af('0x7')]('Condition',attributes,{'tableName':_0xb1af('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 7960a5f..6386296 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 _0x54ea=['../../config/logger','rpc','../../config/environment','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3bca9f,_0x385e57){var _0x45d799=function(_0x3adaa3){while(--_0x3adaa3){_0x3bca9f['push'](_0x3bca9f['shift']());}};_0x45d799(++_0x385e57);}(_0x54ea,0xd0));var _0xa54e=function(_0x629eed,_0x26368c){_0x629eed=_0x629eed-0x0;var _0x202d31=_0x54ea[_0x629eed];return _0x202d31;};'use strict';var _=require(_0xa54e('0x0'));var util=require(_0xa54e('0x1'));var moment=require(_0xa54e('0x2'));var BPromise=require(_0xa54e('0x3'));var rs=require(_0xa54e('0x4'));var fs=require('fs');var Redis=require(_0xa54e('0x5'));var db=require(_0xa54e('0x6'))['db'];var utils=require(_0xa54e('0x7'));var logger=require(_0xa54e('0x8'))(_0xa54e('0x9'));var config=require(_0xa54e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa54e('0xb')][_0xa54e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x298352,_0x4a7af8,_0x45983e){return new BPromise(function(_0x11319a,_0xa1d64b){return client[_0xa54e('0xd')](_0x298352,_0x45983e)[_0xa54e('0xe')](function(_0x4d64dc){logger['info'](_0xa54e('0xf'),_0x4a7af8,_0xa54e('0x10'));logger[_0xa54e('0x11')](_0xa54e('0x12'),_0x4a7af8,_0xa54e('0x10'),JSON[_0xa54e('0x13')](_0x4d64dc));if(_0x4d64dc['error']){if(_0x4d64dc[_0xa54e('0x14')]['code']===0x1f4){logger[_0xa54e('0x14')]('Condition,\x20%s,\x20%s',_0x4a7af8,_0x4d64dc['error'][_0xa54e('0x15')]);return _0xa1d64b(_0x4d64dc[_0xa54e('0x14')][_0xa54e('0x15')]);}logger[_0xa54e('0x14')]('Condition,\x20%s,\x20%s',_0x4a7af8,_0x4d64dc['error']['message']);return _0x11319a(_0x4d64dc[_0xa54e('0x14')][_0xa54e('0x15')]);}else{logger['info'](_0xa54e('0xf'),_0x4a7af8,'request\x20sent');_0x11319a(_0x4d64dc[_0xa54e('0x16')][_0xa54e('0x15')]);}})[_0xa54e('0x17')](function(_0x4b8cc5){logger['error'](_0xa54e('0xf'),_0x4a7af8,_0x4b8cc5);_0xa1d64b(_0x4b8cc5);});});} \ No newline at end of file +var _0x01e3=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0x01e3,0x16d));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x301e('0x0'));var util=require(_0x301e('0x1'));var moment=require(_0x301e('0x2'));var BPromise=require('bluebird');var rs=require(_0x301e('0x3'));var fs=require('fs');var Redis=require(_0x301e('0x4'));var db=require(_0x301e('0x5'))['db'];var utils=require(_0x301e('0x6'));var logger=require('../../config/logger')(_0x301e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x301e('0x8')][_0x301e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ad360,_0x32cf72,_0x584fc9){return new BPromise(function(_0x1e22e7,_0x38bc58){return client[_0x301e('0xa')](_0x1ad360,_0x584fc9)[_0x301e('0xb')](function(_0x18a2bd){logger[_0x301e('0xc')](_0x301e('0xd'),_0x32cf72,_0x301e('0xe'));logger[_0x301e('0xf')](_0x301e('0x10'),_0x32cf72,_0x301e('0xe'),JSON[_0x301e('0x11')](_0x18a2bd));if(_0x18a2bd[_0x301e('0x12')]){if(_0x18a2bd[_0x301e('0x12')][_0x301e('0x13')]===0x1f4){logger['error'](_0x301e('0xd'),_0x32cf72,_0x18a2bd[_0x301e('0x12')][_0x301e('0x14')]);return _0x38bc58(_0x18a2bd[_0x301e('0x12')][_0x301e('0x14')]);}logger['error']('Condition,\x20%s,\x20%s',_0x32cf72,_0x18a2bd[_0x301e('0x12')][_0x301e('0x14')]);return _0x1e22e7(_0x18a2bd['error'][_0x301e('0x14')]);}else{logger['info'](_0x301e('0xd'),_0x32cf72,_0x301e('0xe'));_0x1e22e7(_0x18a2bd[_0x301e('0x15')][_0x301e('0x14')]);}})[_0x301e('0x16')](function(_0x573c42){logger[_0x301e('0x12')](_0x301e('0xd'),_0x32cf72,_0x573c42);_0x38bc58(_0x573c42);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ce52638..48043f9 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 _0xcafc=['../../config/environment','put','delete','/:id','isAuthenticated','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1cfef0,_0x1df19c){var _0x3226a9=function(_0x5dd4e7){while(--_0x5dd4e7){_0x1cfef0['push'](_0x1cfef0['shift']());}};_0x3226a9(++_0x1df19c);}(_0xcafc,0x69));var _0xccaf=function(_0x421c9f,_0x1539cd){_0x421c9f=_0x421c9f-0x0;var _0x401bfe=_0xcafc[_0x421c9f];return _0x401bfe;};'use strict';var multer=require(_0xccaf('0x0'));var util=require(_0xccaf('0x1'));var path=require(_0xccaf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xccaf('0x3')]();var fs_extra=require(_0xccaf('0x4'));var auth=require(_0xccaf('0x5'));var interaction=require(_0xccaf('0x6'));var config=require(_0xccaf('0x7'));var controller=require('./condition.controller');router[_0xccaf('0x8')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xccaf('0x9')](_0xccaf('0xa'),auth[_0xccaf('0xb')](),controller[_0xccaf('0xc')]);module[_0xccaf('0xd')]=router; \ No newline at end of file +var _0xab3b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xab3b,0x6c));var _0xbab3=function(_0x2309a7,_0x30d044){_0x2309a7=_0x2309a7-0x0;var _0x30a1f8=_0xab3b[_0x2309a7];return _0x30a1f8;};'use strict';var multer=require(_0xbab3('0x0'));var util=require(_0xbab3('0x1'));var path=require(_0xbab3('0x2'));var timeout=require(_0xbab3('0x3'));var express=require(_0xbab3('0x4'));var router=express[_0xbab3('0x5')]();var fs_extra=require(_0xbab3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbab3('0x7'));var config=require(_0xbab3('0x8'));var controller=require('./condition.controller');router['put'](_0xbab3('0x9'),auth[_0xbab3('0xa')](),controller[_0xbab3('0xb')]);router[_0xbab3('0xc')](_0xbab3('0x9'),auth[_0xbab3('0xa')](),controller[_0xbab3('0xd')]);module[_0xbab3('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 3c73a9c..d0a0d49 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(_0x192519,_0x5b51d1){var _0x44cb01=function(_0x3401ba){while(--_0x3401ba){_0x192519['push'](_0x192519['shift']());}};_0x44cb01(++_0x5b51d1);}(_0x2032,0xd9));var _0x2203=function(_0x55c8ef,_0x2bdf08){_0x55c8ef=_0x55c8ef-0x0;var _0x106fb6=_0x2032[_0x55c8ef];return _0x106fb6;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 8e8bceb..9bdd494 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 _0xe053=['then','get','CustomDashboards','UserProfileResource','sendStatus','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','catch','error','clone','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','stringify','addItem','findOne','DashboardItem','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0xe053,0x1bb));var _0x3e05=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xe053[_0x47adb8];return _0x4689a8;};'use strict';var emlformat=require(_0x3e05('0x0'));var rimraf=require(_0x3e05('0x1'));var zipdir=require(_0x3e05('0x2'));var jsonpatch=require(_0x3e05('0x3'));var rp=require(_0x3e05('0x4'));var moment=require(_0x3e05('0x5'));var BPromise=require(_0x3e05('0x6'));var Mustache=require('mustache');var util=require(_0x3e05('0x7'));var path=require(_0x3e05('0x8'));var sox=require(_0x3e05('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e05('0xa'));var _=require(_0x3e05('0xb'));var squel=require(_0x3e05('0xc'));var crypto=require(_0x3e05('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3e05('0xe'));var toCsv=require(_0x3e05('0xf'));var querystring=require(_0x3e05('0x10'));var Papa=require(_0x3e05('0x11'));var Redis=require('ioredis');var authService=require(_0x3e05('0x12'));var qs=require(_0x3e05('0x13'));var as=require(_0x3e05('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e05('0x15'));var utils=require(_0x3e05('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3e05('0x17'));var db=require(_0x3e05('0x18'))['db'];config['redis']=_[_0x3e05('0x19')](config[_0x3e05('0x1a')],{'host':_0x3e05('0x1b'),'port':0x18eb});var socket=require(_0x3e05('0x1c'))(new Redis(config[_0x3e05('0x1a')]));require(_0x3e05('0x1d'))['register'](socket);function respondWithStatusCode(_0x5cd34c,_0x1e0011){_0x1e0011=_0x1e0011||0xcc;return function(_0x313c57){if(_0x313c57){return _0x5cd34c['sendStatus'](_0x1e0011);}return _0x5cd34c[_0x3e05('0x1e')](_0x1e0011)[_0x3e05('0x1f')]();};}function respondWithResult(_0x59e44e,_0x22f8b4){_0x22f8b4=_0x22f8b4||0xc8;return function(_0x10b6da){if(_0x10b6da){return _0x59e44e[_0x3e05('0x1e')](_0x22f8b4)['json'](_0x10b6da);}};}function respondWithFilteredResult(_0x114215,_0x441a43){return function(_0x5126e1){if(_0x5126e1){var _0x43b794=typeof _0x441a43[_0x3e05('0x20')]==='undefined'&&typeof _0x441a43['limit']===_0x3e05('0x21');var _0x52ae17=_0x5126e1[_0x3e05('0x22')];var _0x44b33d=_0x43b794?0x0:_0x441a43['offset'];var _0x4c0250=_0x43b794?_0x5126e1[_0x3e05('0x22')]:_0x441a43[_0x3e05('0x20')]+_0x441a43[_0x3e05('0x23')];var _0x2954cf;if(_0x4c0250>=_0x52ae17){_0x4c0250=_0x52ae17;_0x2954cf=0xc8;}else{_0x2954cf=0xce;}_0x114215[_0x3e05('0x1e')](_0x2954cf);return _0x114215[_0x3e05('0x24')](_0x3e05('0x25'),_0x44b33d+'-'+_0x4c0250+'/'+_0x52ae17)['json'](_0x5126e1);}return null;};}function patchUpdates(_0x5a134a){return function(_0x555d31){try{jsonpatch[_0x3e05('0x26')](_0x555d31,_0x5a134a,!![]);}catch(_0x5b2048){return BPromise[_0x3e05('0x27')](_0x5b2048);}return _0x555d31['save']();};}function saveUpdates(_0x26526f,_0x32cd2f){return function(_0xa37e21){if(_0xa37e21){return _0xa37e21['update'](_0x26526f)['then'](function(_0x58de8b){return _0x58de8b;});}return null;};}function removeEntity(_0x27f004,_0x8ddd39){return function(_0x490f7b){if(_0x490f7b){return _0x490f7b[_0x3e05('0x28')]()[_0x3e05('0x29')](function(){var _0x157005=_0x490f7b[_0x3e05('0x2a')]({'plain':!![]});var _0xae8450=_0x3e05('0x2b');return db[_0x3e05('0x2c')][_0x3e05('0x28')]({'where':{'type':_0xae8450,'resourceId':_0x157005['id']}})['then'](function(){return _0x490f7b;});})[_0x3e05('0x29')](function(){_0x27f004['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24ad12,_0x13067d){return function(_0x1db9d9){if(!_0x1db9d9){_0x24ad12[_0x3e05('0x2d')](0x194);}return _0x1db9d9;};}function handleError(_0x228038,_0x4c1e85){_0x4c1e85=_0x4c1e85||0x1f4;return function(_0x3eb613){logger['error'](_0x3eb613['stack']);if(_0x3eb613['name']){delete _0x3eb613[_0x3e05('0x2e')];}_0x228038['status'](_0x4c1e85)[_0x3e05('0x2f')](_0x3eb613);};}exports[_0x3e05('0x30')]=function(_0x40a79b,_0x2acdfd){var _0x48c499={},_0xa7fc41={},_0x3864a8={'count':0x0,'rows':[]};var _0x420268=_[_0x3e05('0x31')](db[_0x3e05('0x32')][_0x3e05('0x33')],function(_0x2a7454){return{'name':_0x2a7454[_0x3e05('0x34')],'type':_0x2a7454[_0x3e05('0x35')][_0x3e05('0x36')]};});_0xa7fc41['model']=_[_0x3e05('0x31')](_0x420268,_0x3e05('0x2e'));_0xa7fc41[_0x3e05('0x37')]=_[_0x3e05('0x38')](_0x40a79b[_0x3e05('0x37')]);_0xa7fc41['filters']=_[_0x3e05('0x39')](_0xa7fc41[_0x3e05('0x3a')],_0xa7fc41[_0x3e05('0x37')]);_0x48c499[_0x3e05('0x3b')]=_[_0x3e05('0x39')](_0xa7fc41[_0x3e05('0x3a')],qs[_0x3e05('0x3c')](_0x40a79b[_0x3e05('0x37')][_0x3e05('0x3c')]));_0x48c499[_0x3e05('0x3b')]=_0x48c499['attributes'][_0x3e05('0x3d')]?_0x48c499[_0x3e05('0x3b')]:_0xa7fc41[_0x3e05('0x3a')];if(!_0x40a79b[_0x3e05('0x37')][_0x3e05('0x3e')](_0x3e05('0x3f'))){_0x48c499['limit']=qs[_0x3e05('0x23')](_0x40a79b[_0x3e05('0x37')][_0x3e05('0x23')]);_0x48c499[_0x3e05('0x20')]=qs['offset'](_0x40a79b[_0x3e05('0x37')][_0x3e05('0x20')]);}_0x48c499[_0x3e05('0x40')]=qs[_0x3e05('0x41')](_0x40a79b[_0x3e05('0x37')][_0x3e05('0x41')]);_0x48c499[_0x3e05('0x42')]=qs[_0x3e05('0x43')](_[_0x3e05('0x44')](_0x40a79b[_0x3e05('0x37')],_0xa7fc41[_0x3e05('0x43')]),_0x420268);if(_0x40a79b[_0x3e05('0x37')][_0x3e05('0x45')]){_0x48c499[_0x3e05('0x42')]=_[_0x3e05('0x46')](_0x48c499[_0x3e05('0x42')],{'$or':_[_0x3e05('0x31')](_0x420268,function(_0x481932){if(_0x481932[_0x3e05('0x35')]!=='VIRTUAL'){var _0x1617da={};_0x1617da[_0x481932[_0x3e05('0x2e')]]={'$like':'%'+_0x40a79b['query']['filter']+'%'};return _0x1617da;}})});}_0x48c499=_['merge']({},_0x48c499,_0x40a79b[_0x3e05('0x47')]);var _0x2b7bfa={'where':_0x48c499[_0x3e05('0x42')]};return db['Dashboard'][_0x3e05('0x22')](_0x2b7bfa)['then'](function(_0x9a4be0){_0x3864a8['count']=_0x9a4be0;if(_0x40a79b['query'][_0x3e05('0x48')]){_0x48c499['include']=[{'all':!![]}];}return db[_0x3e05('0x32')][_0x3e05('0x49')](_0x48c499);})['then'](function(_0x1c564d){_0x3864a8[_0x3e05('0x4a')]=_0x1c564d;return _0x3864a8;})['then'](respondWithFilteredResult(_0x2acdfd,_0x48c499))['catch'](handleError(_0x2acdfd,null));};exports[_0x3e05('0x4b')]=function(_0x3ab545,_0x4c975c){var _0x67126f={'raw':![],'where':{'id':_0x3ab545[_0x3e05('0x4c')]['id']}},_0x238e54={};_0x238e54['model']=_[_0x3e05('0x38')](db['Dashboard'][_0x3e05('0x33')]);_0x238e54[_0x3e05('0x37')]=_['keys'](_0x3ab545[_0x3e05('0x37')]);_0x238e54['filters']=_[_0x3e05('0x39')](_0x238e54[_0x3e05('0x3a')],_0x238e54[_0x3e05('0x37')]);_0x67126f[_0x3e05('0x3b')]=_[_0x3e05('0x39')](_0x238e54[_0x3e05('0x3a')],qs[_0x3e05('0x3c')](_0x3ab545['query'][_0x3e05('0x3c')]));_0x67126f['attributes']=_0x67126f['attributes'][_0x3e05('0x3d')]?_0x67126f[_0x3e05('0x3b')]:_0x238e54[_0x3e05('0x3a')];if(_0x3ab545['query'][_0x3e05('0x48')]){_0x67126f[_0x3e05('0x4d')]=[{'all':!![]}];}_0x67126f=_[_0x3e05('0x46')]({},_0x67126f,_0x3ab545['options']);return db['Dashboard']['find'](_0x67126f)[_0x3e05('0x29')](handleEntityNotFound(_0x4c975c,null))[_0x3e05('0x29')](respondWithResult(_0x4c975c,null))['catch'](handleError(_0x4c975c,null));};exports[_0x3e05('0x4e')]=function(_0x48c044,_0x1f30ff){return db[_0x3e05('0x32')][_0x3e05('0x4e')](_0x48c044[_0x3e05('0x4f')],{})[_0x3e05('0x29')](function(_0x4677bc){var _0x120dec=_0x48c044[_0x3e05('0x50')][_0x3e05('0x2a')]({'plain':!![]});if(!_0x120dec)throw new Error(_0x3e05('0x51'));if(_0x120dec['role']==='user'){var _0x47080e=_0x4677bc[_0x3e05('0x2a')]({'plain':!![]});var _0x2746a1=_0x3e05('0x2b');return db[_0x3e05('0x52')][_0x3e05('0x53')]({'where':{'name':_0x2746a1,'userProfileId':_0x120dec[_0x3e05('0x54')]},'raw':!![]})[_0x3e05('0x29')](function(_0x5ec482){if(_0x5ec482&&_0x5ec482['autoAssociation']===0x0){return db['UserProfileResource'][_0x3e05('0x4e')]({'name':_0x47080e['name'],'resourceId':_0x47080e['id'],'type':_0x5ec482[_0x3e05('0x2e')],'sectionId':_0x5ec482['id']},{})['then'](function(){return _0x4677bc;});}else{return _0x4677bc;}})[_0x3e05('0x55')](function(_0x17f39b){logger[_0x3e05('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17f39b);throw _0x17f39b;});}return _0x4677bc;})[_0x3e05('0x29')](respondWithResult(_0x1f30ff,0xc9))['catch'](handleError(_0x1f30ff,null));};exports[_0x3e05('0x57')]=function(_0x4db97c,_0xa32d16){var _0x5889d3={'where':{'id':_0x4db97c[_0x3e05('0x4c')]['id']}},_0x1f54ab={};_0x1f54ab[_0x3e05('0x3a')]=_[_0x3e05('0x38')](db[_0x3e05('0x32')]['rawAttributes']);_0x5889d3[_0x3e05('0x3b')]=_[_0x3e05('0x39')](_0x1f54ab[_0x3e05('0x3a')],qs['fields'](_0x4db97c['query'][_0x3e05('0x3c')]));_0x5889d3[_0x3e05('0x3b')]=_0x5889d3[_0x3e05('0x3b')][_0x3e05('0x3d')]?_0x5889d3['attributes']:_0x1f54ab[_0x3e05('0x3a')];if(_0x4db97c[_0x3e05('0x37')][_0x3e05('0x48')]){_0x5889d3[_0x3e05('0x4d')]=[{'all':!![]}];}_0x5889d3=_[_0x3e05('0x46')]({},_0x5889d3,_0x4db97c[_0x3e05('0x47')]);return db['Dashboard'][_0x3e05('0x53')](_0x5889d3)[_0x3e05('0x29')](handleEntityNotFound(_0xa32d16,null))['then'](function(_0x2446dd){if(_0x2446dd){var _0x5cb3db=_0x2446dd[_0x3e05('0x2a')]({'plain':!![]});_0x5cb3db=qs[_0x3e05('0x58')](_0x5cb3db,['id',_0x3e05('0x59'),_0x3e05('0x5a')]);_0x4db97c[_0x3e05('0x4f')]=_[_0x3e05('0x58')](_0x4db97c[_0x3e05('0x4f')],['id',_0x3e05('0x59'),'updatedAt']);return db['Dashboard']['create'](_[_0x3e05('0x46')](_0x5cb3db,_0x4db97c[_0x3e05('0x4f')]),{'include':_0x4db97c[_0x3e05('0x37')][_0x3e05('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x385d63){var _0x32571d=_0x4db97c[_0x3e05('0x50')][_0x3e05('0x2a')]({'plain':!![]});if(!_0x32571d)throw new Error(_0x3e05('0x51'));if(_0x32571d[_0x3e05('0x5b')]==='user'){var _0x3dfbee=_0x385d63['get']({'plain':!![]});var _0x59174b=_0x3e05('0x2b');return db[_0x3e05('0x52')][_0x3e05('0x53')]({'where':{'name':_0x59174b,'userProfileId':_0x32571d[_0x3e05('0x54')]},'raw':!![]})[_0x3e05('0x29')](function(_0x430c57){if(_0x430c57&&_0x430c57[_0x3e05('0x5c')]===0x0){return db['UserProfileResource'][_0x3e05('0x4e')]({'name':_0x3dfbee[_0x3e05('0x2e')],'resourceId':_0x3dfbee['id'],'type':_0x430c57[_0x3e05('0x2e')],'sectionId':_0x430c57['id']},{})['then'](function(){return _0x385d63;});}else{return _0x385d63;}})[_0x3e05('0x55')](function(_0xe6c244){logger[_0x3e05('0x56')](_0x3e05('0x5d'),_0xe6c244);throw _0xe6c244;});}return _0x385d63;});}})[_0x3e05('0x29')](respondWithResult(_0xa32d16,0xc9))['catch'](handleError(_0xa32d16,null));};exports['update']=function(_0x3f5e8d,_0xfcfc2a){if(_0x3f5e8d[_0x3e05('0x4f')]['id']){delete _0x3f5e8d['body']['id'];}return db[_0x3e05('0x32')][_0x3e05('0x53')]({'where':{'id':_0x3f5e8d[_0x3e05('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfcfc2a,null))[_0x3e05('0x29')](saveUpdates(_0x3f5e8d[_0x3e05('0x4f')],null))['then'](respondWithResult(_0xfcfc2a,null))[_0x3e05('0x55')](handleError(_0xfcfc2a,null));};exports['destroy']=function(_0x542eb5,_0xa7dcb8){return db[_0x3e05('0x32')][_0x3e05('0x53')]({'where':{'id':_0x542eb5[_0x3e05('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa7dcb8,null))[_0x3e05('0x29')](removeEntity(_0xa7dcb8,null))[_0x3e05('0x55')](handleError(_0xa7dcb8,null));};function widgetAttributes(_0x32b3ce){try{switch(_0x32b3ce['type']){case'iframe':return[{'name':_0x3e05('0x5e'),'value':_0x32b3ce[_0x3e05('0x5e')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce['attrs'][0x0]?_0x32b3ce[_0x3e05('0x5f')][0x0][_0x3e05('0x60')]:undefined)||_0x3e05('0x61')}];case _0x3e05('0x62'):return[{'name':_0x3e05('0x63'),'value':_0x32b3ce[_0x3e05('0x63')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x0]?_0x32b3ce['attrs'][0x0][_0x3e05('0x60')]:undefined)||''}];case _0x3e05('0x64'):return[{'name':_0x3e05('0x65'),'value':_0x32b3ce['attrHourFormat']||(_0x32b3ce['attrs']&&_0x32b3ce[_0x3e05('0x5f')][0x0]?_0x32b3ce[_0x3e05('0x5f')][0x0][_0x3e05('0x60')]:undefined)||_0x3e05('0x66')},{'name':_0x3e05('0x67'),'value':_0x32b3ce[_0x3e05('0x67')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x1]?_0x32b3ce[_0x3e05('0x5f')][0x1][_0x3e05('0x60')]:undefined)||_0x3e05('0x68')},{'name':'attrFontSize','value':_0x32b3ce[_0x3e05('0x69')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce['attrs'][0x2]?_0x32b3ce['attrs'][0x2]['value']:undefined)||0xc}];case _0x3e05('0x6a'):return[{'name':_0x3e05('0x6b'),'value':_0x32b3ce[_0x3e05('0x6b')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x0]?_0x32b3ce[_0x3e05('0x5f')][0x0][_0x3e05('0x60')]:undefined)||_0x3e05('0x6c')},{'name':_0x3e05('0x6d'),'value':_0x32b3ce[_0x3e05('0x6d')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x1]?_0x32b3ce['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x32b3ce[_0x3e05('0x69')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x2]?_0x32b3ce[_0x3e05('0x5f')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x3e05('0x6e'),'value':_0x32b3ce[_0x3e05('0x6e')]||(_0x32b3ce['attrs']&&_0x32b3ce[_0x3e05('0x5f')][0x0]?_0x32b3ce[_0x3e05('0x5f')][0x0]['value']:undefined)||'total'},{'name':_0x3e05('0x6f'),'value':_0x32b3ce[_0x3e05('0x6f')]||(_0x32b3ce['attrs']&&_0x32b3ce['attrs'][0x1]?_0x32b3ce['attrs'][0x1][_0x3e05('0x60')]:undefined)||null},{'name':_0x3e05('0x70'),'value':_0x32b3ce[_0x3e05('0x70')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x2]?_0x32b3ce[_0x3e05('0x5f')][0x2][_0x3e05('0x60')]:undefined)||null},{'name':_0x3e05('0x6d'),'value':_0x32b3ce['attrVoiceQueues']||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce['attrs'][0x3]?_0x32b3ce[_0x3e05('0x5f')][0x3][_0x3e05('0x60')]:undefined)||[]}];case'web-report':return[{'name':_0x3e05('0x71'),'type':_0x32b3ce[_0x3e05('0x72')]||(_0x32b3ce['attrs']&&_0x32b3ce[_0x3e05('0x5f')][0x0]?_0x32b3ce[_0x3e05('0x5f')][0x0]['type']:undefined)||null,'value':_0x32b3ce[_0x3e05('0x71')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce['attrs'][0x0]?_0x32b3ce[_0x3e05('0x5f')][0x0][_0x3e05('0x60')]:undefined)||null},{'name':_0x3e05('0x73'),'value':_0x32b3ce[_0x3e05('0x73')]||(_0x32b3ce[_0x3e05('0x5f')]&&_0x32b3ce[_0x3e05('0x5f')][0x1]?_0x32b3ce[_0x3e05('0x5f')][0x1][_0x3e05('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x158295){logger[_0x3e05('0x56')]('widgetAttributes:\x20%s',JSON[_0x3e05('0x74')](_0x158295));return[];}}exports[_0x3e05('0x75')]=function(_0x16f47a,_0x44b44e,_0xcd0e97){if(_0x16f47a[_0x3e05('0x4f')]['id']){delete _0x16f47a[_0x3e05('0x4f')]['id'];}return db[_0x3e05('0x32')][_0x3e05('0x53')]({'where':{'id':_0x16f47a[_0x3e05('0x4c')]['id']}})[_0x3e05('0x29')](handleEntityNotFound(_0x44b44e,null))[_0x3e05('0x29')](function(_0x21ffc8){if(_0x21ffc8){_0x16f47a[_0x3e05('0x4f')]['DashboardId']=_0x21ffc8['id'];_0x16f47a[_0x3e05('0x4f')][_0x3e05('0x5f')]=widgetAttributes(_0x16f47a['body']);return db['DashboardItem'][_0x3e05('0x4e')](_0x16f47a[_0x3e05('0x4f')]);}})[_0x3e05('0x29')](respondWithResult(_0x44b44e,null))[_0x3e05('0x55')](handleError(_0x44b44e,null));};exports['getItems']=function(_0x30cdd5,_0x3d2bc3,_0x203f8c){var _0x17f3c7={};var _0x238d5e={};var _0x580bf7;var _0x2fbfe1;return db[_0x3e05('0x32')][_0x3e05('0x76')]({'where':{'id':_0x30cdd5[_0x3e05('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d2bc3,null))[_0x3e05('0x29')](function(_0x3fb8a0){if(_0x3fb8a0){_0x580bf7=_0x3fb8a0;_0x238d5e['model']=_[_0x3e05('0x38')](db[_0x3e05('0x77')]['rawAttributes']);_0x238d5e['query']=_[_0x3e05('0x38')](_0x30cdd5[_0x3e05('0x37')]);_0x238d5e[_0x3e05('0x43')]=_['intersection'](_0x238d5e['model'],_0x238d5e[_0x3e05('0x37')]);_0x17f3c7[_0x3e05('0x3b')]=_[_0x3e05('0x39')](_0x238d5e[_0x3e05('0x3a')],qs[_0x3e05('0x3c')](_0x30cdd5[_0x3e05('0x37')][_0x3e05('0x3c')]));_0x17f3c7[_0x3e05('0x3b')]=_0x17f3c7[_0x3e05('0x3b')]['length']?_0x17f3c7[_0x3e05('0x3b')]:_0x238d5e[_0x3e05('0x3a')];_0x17f3c7['order']=qs[_0x3e05('0x41')](_0x30cdd5[_0x3e05('0x37')][_0x3e05('0x41')]);_0x17f3c7[_0x3e05('0x42')]=qs[_0x3e05('0x43')](_['pick'](_0x30cdd5[_0x3e05('0x37')],_0x238d5e[_0x3e05('0x43')]));if(_0x30cdd5['query'][_0x3e05('0x45')]){_0x17f3c7[_0x3e05('0x42')]=_[_0x3e05('0x46')](_0x17f3c7[_0x3e05('0x42')],{'$or':_[_0x3e05('0x31')](_0x17f3c7[_0x3e05('0x3b')],function(_0x49491b){var _0x92d751={};_0x92d751[_0x49491b]={'$like':'%'+_0x30cdd5[_0x3e05('0x37')]['filter']+'%'};return _0x92d751;})});}_0x17f3c7=_[_0x3e05('0x46')]({},_0x17f3c7,_0x30cdd5[_0x3e05('0x47')]);return _0x580bf7[_0x3e05('0x78')](_0x17f3c7);}})[_0x3e05('0x29')](function(_0x1788c6){if(_0x1788c6){_0x2fbfe1=_0x1788c6[_0x3e05('0x3d')];if(!_0x30cdd5[_0x3e05('0x37')][_0x3e05('0x3e')](_0x3e05('0x3f'))){_0x17f3c7[_0x3e05('0x23')]=qs['limit'](_0x30cdd5[_0x3e05('0x37')][_0x3e05('0x23')]);_0x17f3c7[_0x3e05('0x20')]=qs[_0x3e05('0x20')](_0x30cdd5[_0x3e05('0x37')][_0x3e05('0x20')]);}return _0x580bf7['getItems'](_0x17f3c7);}})[_0x3e05('0x29')](function(_0xd66c74){if(_0xd66c74){return _0xd66c74?{'count':_0x2fbfe1,'rows':_0xd66c74}:null;}})[_0x3e05('0x29')](respondWithResult(_0x3d2bc3,null))[_0x3e05('0x55')](handleError(_0x3d2bc3,null));}; \ No newline at end of file +var _0xa6aa=['include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','rawAttributes','omit','updatedAt','body','role','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','addItem','DashboardId','findOne','DashboardItem','getItems','hasOwnProperty','limit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','status','end','json','offset','undefined','count','Content-Range','save','update','destroy','then','get','CustomDashboards','sendStatus','error','stack','name','send','index','Dashboard','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0xa6aa,0xa7));var _0xaa6a=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0xa6aa[_0x4529b3];return _0x21e907;};'use strict';var emlformat=require(_0xaa6a('0x0'));var rimraf=require(_0xaa6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa6a('0x2'));var rp=require(_0xaa6a('0x3'));var moment=require(_0xaa6a('0x4'));var BPromise=require(_0xaa6a('0x5'));var Mustache=require(_0xaa6a('0x6'));var util=require('util');var path=require(_0xaa6a('0x7'));var sox=require(_0xaa6a('0x8'));var csv=require(_0xaa6a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa6a('0xa'));var _=require(_0xaa6a('0xb'));var squel=require(_0xaa6a('0xc'));var crypto=require('crypto');var jsforce=require(_0xaa6a('0xd'));var deskjs=require(_0xaa6a('0xe'));var toCsv=require(_0xaa6a('0x9'));var querystring=require(_0xaa6a('0xf'));var Papa=require(_0xaa6a('0x10'));var Redis=require('ioredis');var authService=require(_0xaa6a('0x11'));var qs=require(_0xaa6a('0x12'));var as=require(_0xaa6a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa6a('0x14'))(_0xaa6a('0x15'));var utils=require(_0xaa6a('0x16'));var config=require(_0xaa6a('0x17'));var licenseUtil=require(_0xaa6a('0x18'));var db=require(_0xaa6a('0x19'))['db'];config[_0xaa6a('0x1a')]=_[_0xaa6a('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa6a('0x1a')]));require(_0xaa6a('0x1c'))['register'](socket);function respondWithStatusCode(_0x2be466,_0x4278f7){_0x4278f7=_0x4278f7||0xcc;return function(_0x25528){if(_0x25528){return _0x2be466['sendStatus'](_0x4278f7);}return _0x2be466[_0xaa6a('0x1d')](_0x4278f7)[_0xaa6a('0x1e')]();};}function respondWithResult(_0x5133e5,_0x3926dc){_0x3926dc=_0x3926dc||0xc8;return function(_0x398391){if(_0x398391){return _0x5133e5[_0xaa6a('0x1d')](_0x3926dc)[_0xaa6a('0x1f')](_0x398391);}};}function respondWithFilteredResult(_0x4e754b,_0x5b0ace){return function(_0x4143ae){if(_0x4143ae){var _0x1cedc9=typeof _0x5b0ace[_0xaa6a('0x20')]===_0xaa6a('0x21')&&typeof _0x5b0ace['limit']==='undefined';var _0x30a427=_0x4143ae[_0xaa6a('0x22')];var _0x8eb5ea=_0x1cedc9?0x0:_0x5b0ace['offset'];var _0x279582=_0x1cedc9?_0x4143ae[_0xaa6a('0x22')]:_0x5b0ace[_0xaa6a('0x20')]+_0x5b0ace['limit'];var _0x5caadb;if(_0x279582>=_0x30a427){_0x279582=_0x30a427;_0x5caadb=0xc8;}else{_0x5caadb=0xce;}_0x4e754b[_0xaa6a('0x1d')](_0x5caadb);return _0x4e754b['set'](_0xaa6a('0x23'),_0x8eb5ea+'-'+_0x279582+'/'+_0x30a427)['json'](_0x4143ae);}return null;};}function patchUpdates(_0x5aff34){return function(_0x10ecc8){try{jsonpatch['apply'](_0x10ecc8,_0x5aff34,!![]);}catch(_0x6890c9){return BPromise['reject'](_0x6890c9);}return _0x10ecc8[_0xaa6a('0x24')]();};}function saveUpdates(_0x201170,_0xbdce73){return function(_0x1cb082){if(_0x1cb082){return _0x1cb082[_0xaa6a('0x25')](_0x201170)['then'](function(_0x1f4e4a){return _0x1f4e4a;});}return null;};}function removeEntity(_0x121da5,_0x762ae0){return function(_0xd2aaf7){if(_0xd2aaf7){return _0xd2aaf7[_0xaa6a('0x26')]()[_0xaa6a('0x27')](function(){var _0x530124=_0xd2aaf7[_0xaa6a('0x28')]({'plain':!![]});var _0x2577ef=_0xaa6a('0x29');return db['UserProfileResource'][_0xaa6a('0x26')]({'where':{'type':_0x2577ef,'resourceId':_0x530124['id']}})[_0xaa6a('0x27')](function(){return _0xd2aaf7;});})[_0xaa6a('0x27')](function(){_0x121da5[_0xaa6a('0x1d')](0xcc)[_0xaa6a('0x1e')]();});}};}function handleEntityNotFound(_0x1b61f3,_0x461ec3){return function(_0x428139){if(!_0x428139){_0x1b61f3[_0xaa6a('0x2a')](0x194);}return _0x428139;};}function handleError(_0x37c49d,_0x1672a5){_0x1672a5=_0x1672a5||0x1f4;return function(_0x1eb74a){logger[_0xaa6a('0x2b')](_0x1eb74a[_0xaa6a('0x2c')]);if(_0x1eb74a['name']){delete _0x1eb74a[_0xaa6a('0x2d')];}_0x37c49d[_0xaa6a('0x1d')](_0x1672a5)[_0xaa6a('0x2e')](_0x1eb74a);};}exports[_0xaa6a('0x2f')]=function(_0x1f961f,_0x4e4d6d){var _0x5c6646={},_0x1aacb3={},_0x4a2930={'count':0x0,'rows':[]};var _0x97e95d=_['map'](db[_0xaa6a('0x30')]['rawAttributes'],function(_0x599ecc){return{'name':_0x599ecc['fieldName'],'type':_0x599ecc[_0xaa6a('0x31')][_0xaa6a('0x32')]};});_0x1aacb3['model']=_[_0xaa6a('0x33')](_0x97e95d,_0xaa6a('0x2d'));_0x1aacb3[_0xaa6a('0x34')]=_[_0xaa6a('0x35')](_0x1f961f['query']);_0x1aacb3[_0xaa6a('0x36')]=_[_0xaa6a('0x37')](_0x1aacb3[_0xaa6a('0x38')],_0x1aacb3['query']);_0x5c6646[_0xaa6a('0x39')]=_[_0xaa6a('0x37')](_0x1aacb3[_0xaa6a('0x38')],qs['fields'](_0x1f961f[_0xaa6a('0x34')][_0xaa6a('0x3a')]));_0x5c6646[_0xaa6a('0x39')]=_0x5c6646[_0xaa6a('0x39')][_0xaa6a('0x3b')]?_0x5c6646[_0xaa6a('0x39')]:_0x1aacb3[_0xaa6a('0x38')];if(!_0x1f961f[_0xaa6a('0x34')]['hasOwnProperty'](_0xaa6a('0x3c'))){_0x5c6646['limit']=qs['limit'](_0x1f961f[_0xaa6a('0x34')]['limit']);_0x5c6646[_0xaa6a('0x20')]=qs['offset'](_0x1f961f[_0xaa6a('0x34')][_0xaa6a('0x20')]);}_0x5c6646[_0xaa6a('0x3d')]=qs[_0xaa6a('0x3e')](_0x1f961f[_0xaa6a('0x34')][_0xaa6a('0x3e')]);_0x5c6646[_0xaa6a('0x3f')]=qs[_0xaa6a('0x36')](_[_0xaa6a('0x40')](_0x1f961f['query'],_0x1aacb3['filters']),_0x97e95d);if(_0x1f961f[_0xaa6a('0x34')][_0xaa6a('0x41')]){_0x5c6646[_0xaa6a('0x3f')]=_[_0xaa6a('0x42')](_0x5c6646['where'],{'$or':_[_0xaa6a('0x33')](_0x97e95d,function(_0x8bb073){if(_0x8bb073['type']!==_0xaa6a('0x43')){var _0x275093={};_0x275093[_0x8bb073[_0xaa6a('0x2d')]]={'$like':'%'+_0x1f961f[_0xaa6a('0x34')]['filter']+'%'};return _0x275093;}})});}_0x5c6646=_[_0xaa6a('0x42')]({},_0x5c6646,_0x1f961f[_0xaa6a('0x44')]);var _0x2e1d92={'where':_0x5c6646['where']};return db[_0xaa6a('0x30')][_0xaa6a('0x22')](_0x2e1d92)['then'](function(_0x3161ab){_0x4a2930['count']=_0x3161ab;if(_0x1f961f['query'][_0xaa6a('0x45')]){_0x5c6646['include']=[{'all':!![]}];}return db[_0xaa6a('0x30')][_0xaa6a('0x46')](_0x5c6646);})['then'](function(_0x59d674){_0x4a2930[_0xaa6a('0x47')]=_0x59d674;return _0x4a2930;})[_0xaa6a('0x27')](respondWithFilteredResult(_0x4e4d6d,_0x5c6646))['catch'](handleError(_0x4e4d6d,null));};exports['show']=function(_0x11d22c,_0x56be03){var _0x2e2a3e={'raw':![],'where':{'id':_0x11d22c[_0xaa6a('0x48')]['id']}},_0x4eb62d={};_0x4eb62d['model']=_[_0xaa6a('0x35')](db[_0xaa6a('0x30')]['rawAttributes']);_0x4eb62d['query']=_[_0xaa6a('0x35')](_0x11d22c[_0xaa6a('0x34')]);_0x4eb62d[_0xaa6a('0x36')]=_[_0xaa6a('0x37')](_0x4eb62d[_0xaa6a('0x38')],_0x4eb62d[_0xaa6a('0x34')]);_0x2e2a3e[_0xaa6a('0x39')]=_['intersection'](_0x4eb62d[_0xaa6a('0x38')],qs[_0xaa6a('0x3a')](_0x11d22c['query'][_0xaa6a('0x3a')]));_0x2e2a3e[_0xaa6a('0x39')]=_0x2e2a3e[_0xaa6a('0x39')]['length']?_0x2e2a3e[_0xaa6a('0x39')]:_0x4eb62d['model'];if(_0x11d22c[_0xaa6a('0x34')]['includeAll']){_0x2e2a3e[_0xaa6a('0x49')]=[{'all':!![]}];}_0x2e2a3e=_[_0xaa6a('0x42')]({},_0x2e2a3e,_0x11d22c[_0xaa6a('0x44')]);return db[_0xaa6a('0x30')][_0xaa6a('0x4a')](_0x2e2a3e)[_0xaa6a('0x27')](handleEntityNotFound(_0x56be03,null))[_0xaa6a('0x27')](respondWithResult(_0x56be03,null))['catch'](handleError(_0x56be03,null));};exports[_0xaa6a('0x4b')]=function(_0x22ffe0,_0xc7a692){return db['Dashboard'][_0xaa6a('0x4b')](_0x22ffe0['body'],{})[_0xaa6a('0x27')](function(_0xda9224){var _0x5f5df2=_0x22ffe0[_0xaa6a('0x4c')][_0xaa6a('0x28')]({'plain':!![]});if(!_0x5f5df2)throw new Error(_0xaa6a('0x4d'));if(_0x5f5df2['role']==='user'){var _0x2aa8c9=_0xda9224[_0xaa6a('0x28')]({'plain':!![]});var _0x4e975a=_0xaa6a('0x29');return db[_0xaa6a('0x4e')][_0xaa6a('0x4a')]({'where':{'name':_0x4e975a,'userProfileId':_0x5f5df2['userProfileId']},'raw':!![]})[_0xaa6a('0x27')](function(_0x19d10e){if(_0x19d10e&&_0x19d10e[_0xaa6a('0x4f')]===0x0){return db[_0xaa6a('0x50')][_0xaa6a('0x4b')]({'name':_0x2aa8c9['name'],'resourceId':_0x2aa8c9['id'],'type':_0x19d10e[_0xaa6a('0x2d')],'sectionId':_0x19d10e['id']},{})['then'](function(){return _0xda9224;});}else{return _0xda9224;}})['catch'](function(_0xa59f2e){logger[_0xaa6a('0x2b')](_0xaa6a('0x51'),_0xa59f2e);throw _0xa59f2e;});}return _0xda9224;})[_0xaa6a('0x27')](respondWithResult(_0xc7a692,0xc9))[_0xaa6a('0x52')](handleError(_0xc7a692,null));};exports[_0xaa6a('0x53')]=function(_0x3fce97,_0x5e7e68){var _0x3e8c20={'where':{'id':_0x3fce97[_0xaa6a('0x48')]['id']}},_0x1842ef={};_0x1842ef['model']=_[_0xaa6a('0x35')](db[_0xaa6a('0x30')][_0xaa6a('0x54')]);_0x3e8c20['attributes']=_[_0xaa6a('0x37')](_0x1842ef[_0xaa6a('0x38')],qs[_0xaa6a('0x3a')](_0x3fce97[_0xaa6a('0x34')][_0xaa6a('0x3a')]));_0x3e8c20[_0xaa6a('0x39')]=_0x3e8c20[_0xaa6a('0x39')]['length']?_0x3e8c20[_0xaa6a('0x39')]:_0x1842ef[_0xaa6a('0x38')];if(_0x3fce97[_0xaa6a('0x34')][_0xaa6a('0x45')]){_0x3e8c20[_0xaa6a('0x49')]=[{'all':!![]}];}_0x3e8c20=_[_0xaa6a('0x42')]({},_0x3e8c20,_0x3fce97[_0xaa6a('0x44')]);return db[_0xaa6a('0x30')][_0xaa6a('0x4a')](_0x3e8c20)[_0xaa6a('0x27')](handleEntityNotFound(_0x5e7e68,null))[_0xaa6a('0x27')](function(_0x14cae7){if(_0x14cae7){var _0x299213=_0x14cae7[_0xaa6a('0x28')]({'plain':!![]});_0x299213=qs[_0xaa6a('0x55')](_0x299213,['id','createdAt',_0xaa6a('0x56')]);_0x3fce97[_0xaa6a('0x57')]=_['omit'](_0x3fce97[_0xaa6a('0x57')],['id','createdAt','updatedAt']);return db[_0xaa6a('0x30')][_0xaa6a('0x4b')](_[_0xaa6a('0x42')](_0x299213,_0x3fce97[_0xaa6a('0x57')]),{'include':_0x3fce97[_0xaa6a('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xaa6a('0x27')](function(_0x3e3c62){var _0x4888f0=_0x3fce97[_0xaa6a('0x4c')]['get']({'plain':!![]});if(!_0x4888f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4888f0[_0xaa6a('0x58')]==='user'){var _0x45f0c3=_0x3e3c62['get']({'plain':!![]});var _0x508974=_0xaa6a('0x29');return db[_0xaa6a('0x4e')][_0xaa6a('0x4a')]({'where':{'name':_0x508974,'userProfileId':_0x4888f0['userProfileId']},'raw':!![]})[_0xaa6a('0x27')](function(_0x3c9195){if(_0x3c9195&&_0x3c9195[_0xaa6a('0x4f')]===0x0){return db[_0xaa6a('0x50')][_0xaa6a('0x4b')]({'name':_0x45f0c3[_0xaa6a('0x2d')],'resourceId':_0x45f0c3['id'],'type':_0x3c9195[_0xaa6a('0x2d')],'sectionId':_0x3c9195['id']},{})['then'](function(){return _0x3e3c62;});}else{return _0x3e3c62;}})[_0xaa6a('0x52')](function(_0x53daf7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53daf7);throw _0x53daf7;});}return _0x3e3c62;});}})[_0xaa6a('0x27')](respondWithResult(_0x5e7e68,0xc9))[_0xaa6a('0x52')](handleError(_0x5e7e68,null));};exports[_0xaa6a('0x25')]=function(_0x320b94,_0x23de76){if(_0x320b94['body']['id']){delete _0x320b94[_0xaa6a('0x57')]['id'];}return db[_0xaa6a('0x30')][_0xaa6a('0x4a')]({'where':{'id':_0x320b94['params']['id']}})[_0xaa6a('0x27')](handleEntityNotFound(_0x23de76,null))[_0xaa6a('0x27')](saveUpdates(_0x320b94['body'],null))[_0xaa6a('0x27')](respondWithResult(_0x23de76,null))[_0xaa6a('0x52')](handleError(_0x23de76,null));};exports[_0xaa6a('0x26')]=function(_0x20fac6,_0x120949){return db[_0xaa6a('0x30')]['find']({'where':{'id':_0x20fac6[_0xaa6a('0x48')]['id']}})[_0xaa6a('0x27')](handleEntityNotFound(_0x120949,null))['then'](removeEntity(_0x120949,null))['catch'](handleError(_0x120949,null));};function widgetAttributes(_0x4611d5){try{switch(_0x4611d5[_0xaa6a('0x31')]){case _0xaa6a('0x59'):return[{'name':_0xaa6a('0x5a'),'value':_0x4611d5[_0xaa6a('0x5a')]||(_0x4611d5['attrs']&&_0x4611d5[_0xaa6a('0x5b')][0x0]?_0x4611d5['attrs'][0x0][_0xaa6a('0x5c')]:undefined)||_0xaa6a('0x5d')}];case _0xaa6a('0x5e'):return[{'name':'attrPath','value':_0x4611d5[_0xaa6a('0x5f')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x0]?_0x4611d5['attrs'][0x0]['value']:undefined)||''}];case _0xaa6a('0x60'):return[{'name':'attrHourFormat','value':_0x4611d5[_0xaa6a('0x61')]||(_0x4611d5['attrs']&&_0x4611d5['attrs'][0x0]?_0x4611d5[_0xaa6a('0x5b')][0x0][_0xaa6a('0x5c')]:undefined)||_0xaa6a('0x62')},{'name':_0xaa6a('0x63'),'value':_0x4611d5[_0xaa6a('0x63')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x1]?_0x4611d5[_0xaa6a('0x5b')][0x1]['value']:undefined)||_0xaa6a('0x64')},{'name':_0xaa6a('0x65'),'value':_0x4611d5[_0xaa6a('0x65')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5[_0xaa6a('0x5b')][0x2]?_0x4611d5[_0xaa6a('0x5b')][0x2][_0xaa6a('0x5c')]:undefined)||0xc}];case'counter':return[{'name':_0xaa6a('0x66'),'value':_0x4611d5[_0xaa6a('0x66')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x0]?_0x4611d5['attrs'][0x0][_0xaa6a('0x5c')]:undefined)||_0xaa6a('0x67')},{'name':_0xaa6a('0x68'),'value':_0x4611d5['attrVoiceQueues']||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5[_0xaa6a('0x5b')][0x1]?_0x4611d5[_0xaa6a('0x5b')][0x1][_0xaa6a('0x5c')]:undefined)||[]},{'name':_0xaa6a('0x65'),'value':_0x4611d5['attrFontSize']||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x2]?_0x4611d5[_0xaa6a('0x5b')][0x2][_0xaa6a('0x5c')]:undefined)||0x14}];case _0xaa6a('0x69'):case'pie-chart':return[{'name':'attrSerie1','value':_0x4611d5[_0xaa6a('0x6a')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x0]?_0x4611d5[_0xaa6a('0x5b')][0x0]['value']:undefined)||'total'},{'name':_0xaa6a('0x6b'),'value':_0x4611d5['attrSerie2']||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5[_0xaa6a('0x5b')][0x1]?_0x4611d5[_0xaa6a('0x5b')][0x1][_0xaa6a('0x5c')]:undefined)||null},{'name':_0xaa6a('0x6c'),'value':_0x4611d5['attrSerie3']||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x2]?_0x4611d5[_0xaa6a('0x5b')][0x2][_0xaa6a('0x5c')]:undefined)||null},{'name':_0xaa6a('0x68'),'value':_0x4611d5[_0xaa6a('0x68')]||(_0x4611d5['attrs']&&_0x4611d5['attrs'][0x3]?_0x4611d5[_0xaa6a('0x5b')][0x3][_0xaa6a('0x5c')]:undefined)||[]}];case _0xaa6a('0x6d'):return[{'name':'attrReport','type':_0x4611d5[_0xaa6a('0x6e')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x0]?_0x4611d5['attrs'][0x0]['type']:undefined)||null,'value':_0x4611d5[_0xaa6a('0x6f')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5['attrs'][0x0]?_0x4611d5[_0xaa6a('0x5b')][0x0][_0xaa6a('0x5c')]:undefined)||null},{'name':_0xaa6a('0x70'),'value':_0x4611d5[_0xaa6a('0x70')]||(_0x4611d5[_0xaa6a('0x5b')]&&_0x4611d5[_0xaa6a('0x5b')][0x1]?_0x4611d5['attrs'][0x1][_0xaa6a('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x136ae3){logger[_0xaa6a('0x2b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x136ae3));return[];}}exports[_0xaa6a('0x71')]=function(_0x22ec2a,_0x26c08e,_0x4ff05c){if(_0x22ec2a['body']['id']){delete _0x22ec2a[_0xaa6a('0x57')]['id'];}return db[_0xaa6a('0x30')][_0xaa6a('0x4a')]({'where':{'id':_0x22ec2a[_0xaa6a('0x48')]['id']}})[_0xaa6a('0x27')](handleEntityNotFound(_0x26c08e,null))[_0xaa6a('0x27')](function(_0x20e27c){if(_0x20e27c){_0x22ec2a['body'][_0xaa6a('0x72')]=_0x20e27c['id'];_0x22ec2a[_0xaa6a('0x57')]['attrs']=widgetAttributes(_0x22ec2a[_0xaa6a('0x57')]);return db['DashboardItem']['create'](_0x22ec2a[_0xaa6a('0x57')]);}})[_0xaa6a('0x27')](respondWithResult(_0x26c08e,null))[_0xaa6a('0x52')](handleError(_0x26c08e,null));};exports['getItems']=function(_0x51aa08,_0x364641,_0x139930){var _0x4338c2={};var _0x7a2f3={};var _0x3f539a;var _0x1f42be;return db[_0xaa6a('0x30')][_0xaa6a('0x73')]({'where':{'id':_0x51aa08[_0xaa6a('0x48')]['id']}})[_0xaa6a('0x27')](handleEntityNotFound(_0x364641,null))['then'](function(_0x4070ca){if(_0x4070ca){_0x3f539a=_0x4070ca;_0x7a2f3['model']=_[_0xaa6a('0x35')](db[_0xaa6a('0x74')][_0xaa6a('0x54')]);_0x7a2f3[_0xaa6a('0x34')]=_[_0xaa6a('0x35')](_0x51aa08['query']);_0x7a2f3[_0xaa6a('0x36')]=_[_0xaa6a('0x37')](_0x7a2f3[_0xaa6a('0x38')],_0x7a2f3[_0xaa6a('0x34')]);_0x4338c2['attributes']=_['intersection'](_0x7a2f3[_0xaa6a('0x38')],qs[_0xaa6a('0x3a')](_0x51aa08['query'][_0xaa6a('0x3a')]));_0x4338c2['attributes']=_0x4338c2[_0xaa6a('0x39')]['length']?_0x4338c2[_0xaa6a('0x39')]:_0x7a2f3[_0xaa6a('0x38')];_0x4338c2[_0xaa6a('0x3d')]=qs[_0xaa6a('0x3e')](_0x51aa08[_0xaa6a('0x34')]['sort']);_0x4338c2[_0xaa6a('0x3f')]=qs['filters'](_[_0xaa6a('0x40')](_0x51aa08[_0xaa6a('0x34')],_0x7a2f3[_0xaa6a('0x36')]));if(_0x51aa08[_0xaa6a('0x34')][_0xaa6a('0x41')]){_0x4338c2[_0xaa6a('0x3f')]=_[_0xaa6a('0x42')](_0x4338c2['where'],{'$or':_[_0xaa6a('0x33')](_0x4338c2[_0xaa6a('0x39')],function(_0x527e9c){var _0x1ecc70={};_0x1ecc70[_0x527e9c]={'$like':'%'+_0x51aa08[_0xaa6a('0x34')][_0xaa6a('0x41')]+'%'};return _0x1ecc70;})});}_0x4338c2=_[_0xaa6a('0x42')]({},_0x4338c2,_0x51aa08[_0xaa6a('0x44')]);return _0x3f539a[_0xaa6a('0x75')](_0x4338c2);}})[_0xaa6a('0x27')](function(_0x229fc2){if(_0x229fc2){_0x1f42be=_0x229fc2[_0xaa6a('0x3b')];if(!_0x51aa08['query'][_0xaa6a('0x76')](_0xaa6a('0x3c'))){_0x4338c2[_0xaa6a('0x77')]=qs[_0xaa6a('0x77')](_0x51aa08['query']['limit']);_0x4338c2[_0xaa6a('0x20')]=qs[_0xaa6a('0x20')](_0x51aa08['query'][_0xaa6a('0x20')]);}return _0x3f539a[_0xaa6a('0x75')](_0x4338c2);}})[_0xaa6a('0x27')](function(_0x27fda6){if(_0x27fda6){return _0x27fda6?{'count':_0x1f42be,'rows':_0x27fda6}:null;}})[_0xaa6a('0x27')](respondWithResult(_0x364641,null))[_0xaa6a('0x52')](handleError(_0x364641,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index bf39e97..3bf52d1 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 _0xed10=['Dashboard','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xed10,0xa0));var _0x0ed1=function(_0xd55444,_0x18220b){_0xd55444=_0xd55444-0x0;var _0x29dc54=_0xed10[_0xd55444];return _0x29dc54;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x0ed1('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0ed1('0x1')](0x0);var events={'afterCreate':_0x0ed1('0x2'),'afterUpdate':_0x0ed1('0x3'),'afterDestroy':_0x0ed1('0x4')};function emitEvent(_0x3b0dde){return function(_0x3a739a,_0x355b4e,_0x5c8e93){DashboardEvents[_0x0ed1('0x5')](_0x3b0dde+':'+_0x3a739a['id'],_0x3a739a);DashboardEvents['emit'](_0x3b0dde,_0x3a739a);_0x5c8e93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x0ed1('0x6')](e,emitEvent(event));}}module[_0x0ed1('0x7')]=DashboardEvents; \ No newline at end of file +var _0xbb65=['events','Dashboard','setMaxListeners','save','remove','emit','hook','exports'];(function(_0xb426b1,_0x1d3a8c){var _0x34daae=function(_0x5384dc){while(--_0x5384dc){_0xb426b1['push'](_0xb426b1['shift']());}};_0x34daae(++_0x1d3a8c);}(_0xbb65,0x118));var _0x5bb6=function(_0x3f4c2e,_0x1dd433){_0x3f4c2e=_0x3f4c2e-0x0;var _0x4f0bc3=_0xbb65[_0x3f4c2e];return _0x4f0bc3;};'use strict';var EventEmitter=require(_0x5bb6('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x5bb6('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5bb6('0x2')](0x0);var events={'afterCreate':_0x5bb6('0x3'),'afterUpdate':'update','afterDestroy':_0x5bb6('0x4')};function emitEvent(_0x347477){return function(_0x165129,_0x26e34e,_0x243fe4){DashboardEvents[_0x5bb6('0x5')](_0x347477+':'+_0x165129['id'],_0x165129);DashboardEvents[_0x5bb6('0x5')](_0x347477,_0x165129);_0x243fe4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x5bb6('0x6')](e,emitEvent(event));}}module[_0x5bb6('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index a496eb1..d9c2417 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 _0x7a82=['path','rimraf','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x531a73,_0x5478b2){var _0x44d03d=function(_0x12cfe1){while(--_0x12cfe1){_0x531a73['push'](_0x531a73['shift']());}};_0x44d03d(++_0x5478b2);}(_0x7a82,0x8a));var _0x27a8=function(_0xcc93a5,_0x46accf){_0xcc93a5=_0xcc93a5-0x0;var _0x3c13a7=_0x7a82[_0xcc93a5];return _0x3c13a7;};'use strict';var _=require(_0x27a8('0x0'));var util=require(_0x27a8('0x1'));var logger=require(_0x27a8('0x2'))(_0x27a8('0x3'));var moment=require('moment');var BPromise=require(_0x27a8('0x4'));var rp=require(_0x27a8('0x5'));var fs=require('fs');var path=require(_0x27a8('0x6'));var rimraf=require(_0x27a8('0x7'));var config=require('../../config/environment');var attributes=require(_0x27a8('0x8'));module['exports']=function(_0x520627,_0x2d47ba){return _0x520627[_0x27a8('0x9')](_0x27a8('0xa'),attributes,{'tableName':_0x27a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x360c=['path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x549579,_0x3cdd8){var _0x1fdf0e=function(_0x1f49e6){while(--_0x1f49e6){_0x549579['push'](_0x549579['shift']());}};_0x1fdf0e(++_0x3cdd8);}(_0x360c,0x1db));var _0xc360=function(_0x63a239,_0x1e63a7){_0x63a239=_0x63a239-0x0;var _0x1a1587=_0x360c[_0x63a239];return _0x1a1587;};'use strict';var _=require(_0xc360('0x0'));var util=require(_0xc360('0x1'));var logger=require(_0xc360('0x2'))(_0xc360('0x3'));var moment=require(_0xc360('0x4'));var BPromise=require('bluebird');var rp=require(_0xc360('0x5'));var fs=require('fs');var path=require(_0xc360('0x6'));var rimraf=require('rimraf');var config=require(_0xc360('0x7'));var attributes=require(_0xc360('0x8'));module[_0xc360('0x9')]=function(_0x20bfe9,_0x2fc4dc){return _0x20bfe9[_0xc360('0xa')](_0xc360('0xb'),attributes,{'tableName':_0xc360('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 1889622..28c1feb 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 _0x567a=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x7399cc,_0x2709c){var _0x1907fe=function(_0x459788){while(--_0x459788){_0x7399cc['push'](_0x7399cc['shift']());}};_0x1907fe(++_0x2709c);}(_0x567a,0x136));var _0xa567=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x567a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa567('0x0'));var util=require(_0xa567('0x1'));var moment=require(_0xa567('0x2'));var BPromise=require(_0xa567('0x3'));var rs=require(_0xa567('0x4'));var fs=require('fs');var Redis=require(_0xa567('0x5'));var db=require(_0xa567('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa567('0x7'))(_0xa567('0x8'));var config=require(_0xa567('0x9'));var jayson=require(_0xa567('0xa'));var client=jayson['client'][_0xa567('0xb')]({'port':0x232a});config[_0xa567('0xc')]=_[_0xa567('0xd')](config['redis'],{'host':_0xa567('0xe'),'port':0x18eb});var socket=require(_0xa567('0xf'))(new Redis(config[_0xa567('0xc')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x13fce1,_0x212771,_0xab30bd){return new BPromise(function(_0xcdac4f,_0x422379){return client[_0xa567('0x10')](_0x13fce1,_0xab30bd)[_0xa567('0x11')](function(_0x14fb07){logger[_0xa567('0x12')](_0xa567('0x13'),_0x212771,_0xa567('0x14'));logger[_0xa567('0x15')](_0xa567('0x16'),_0x212771,_0xa567('0x14'),JSON[_0xa567('0x17')](_0x14fb07));if(_0x14fb07[_0xa567('0x18')]){if(_0x14fb07[_0xa567('0x18')][_0xa567('0x19')]===0x1f4){logger[_0xa567('0x18')](_0xa567('0x13'),_0x212771,_0x14fb07[_0xa567('0x18')]['message']);return _0x422379(_0x14fb07['error']['message']);}logger['error'](_0xa567('0x13'),_0x212771,_0x14fb07[_0xa567('0x18')][_0xa567('0x1a')]);return _0xcdac4f(_0x14fb07[_0xa567('0x18')]['message']);}else{logger['info'](_0xa567('0x13'),_0x212771,'request\x20sent');_0xcdac4f(_0x14fb07[_0xa567('0x1b')][_0xa567('0x1a')]);}})[_0xa567('0x1c')](function(_0x41f8e9){logger['error']('Dashboard,\x20%s,\x20%s',_0x212771,_0x41f8e9);_0x422379(_0x41f8e9);});});} \ No newline at end of file +var _0xb73c=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x55b037,_0x2d9392){var _0x5f1053=function(_0x7a13d4){while(--_0x7a13d4){_0x55b037['push'](_0x55b037['shift']());}};_0x5f1053(++_0x2d9392);}(_0xb73c,0x18e));var _0xcb73=function(_0x31ed89,_0x2096ff){_0x31ed89=_0x31ed89-0x0;var _0x597e79=_0xb73c[_0x31ed89];return _0x597e79;};'use strict';var _=require(_0xcb73('0x0'));var util=require(_0xcb73('0x1'));var moment=require(_0xcb73('0x2'));var BPromise=require(_0xcb73('0x3'));var rs=require(_0xcb73('0x4'));var fs=require('fs');var Redis=require(_0xcb73('0x5'));var db=require(_0xcb73('0x6'))['db'];var utils=require(_0xcb73('0x7'));var logger=require('../../config/logger')(_0xcb73('0x8'));var config=require(_0xcb73('0x9'));var jayson=require(_0xcb73('0xa'));var client=jayson[_0xcb73('0xb')][_0xcb73('0xc')]({'port':0x232a});config['redis']=_[_0xcb73('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcb73('0xe'))(new Redis(config[_0xcb73('0xf')]));require(_0xcb73('0x10'))[_0xcb73('0x11')](socket);function respondWithRpcPromise(_0x40c491,_0x1b30b4,_0x86afdb){return new BPromise(function(_0x1cb1ce,_0xa0fb10){return client['request'](_0x40c491,_0x86afdb)[_0xcb73('0x12')](function(_0x4edf37){logger['info'](_0xcb73('0x13'),_0x1b30b4,_0xcb73('0x14'));logger[_0xcb73('0x15')](_0xcb73('0x16'),_0x1b30b4,'request\x20sent',JSON[_0xcb73('0x17')](_0x4edf37));if(_0x4edf37[_0xcb73('0x18')]){if(_0x4edf37[_0xcb73('0x18')]['code']===0x1f4){logger[_0xcb73('0x18')](_0xcb73('0x13'),_0x1b30b4,_0x4edf37['error'][_0xcb73('0x19')]);return _0xa0fb10(_0x4edf37[_0xcb73('0x18')][_0xcb73('0x19')]);}logger[_0xcb73('0x18')](_0xcb73('0x13'),_0x1b30b4,_0x4edf37[_0xcb73('0x18')]['message']);return _0x1cb1ce(_0x4edf37[_0xcb73('0x18')][_0xcb73('0x19')]);}else{logger['info'](_0xcb73('0x13'),_0x1b30b4,_0xcb73('0x14'));_0x1cb1ce(_0x4edf37['result'][_0xcb73('0x19')]);}})[_0xcb73('0x1a')](function(_0x2e7d15){logger[_0xcb73('0x18')](_0xcb73('0x13'),_0x1b30b4,_0x2e7d15);_0xa0fb10(_0x2e7d15);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 45b8f68..8486e59 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 _0x788d=['remove','emit','removeListener','register','dashboard:','./dashboard.events','save'];(function(_0x21c649,_0x2f3d38){var _0x877388=function(_0x11dbab){while(--_0x11dbab){_0x21c649['push'](_0x21c649['shift']());}};_0x877388(++_0x2f3d38);}(_0x788d,0x1c5));var _0xd788=function(_0x5392e1,_0x5e0a81){_0x5392e1=_0x5392e1-0x0;var _0x46b802=_0x788d[_0x5392e1];return _0x46b802;};'use strict';var DashboardEvents=require(_0xd788('0x0'));var events=[_0xd788('0x1'),_0xd788('0x2'),'update'];function createListener(_0x2ec888,_0x40907e){return function(_0x492842){_0x40907e[_0xd788('0x3')](_0x2ec888,_0x492842);};}function removeListener(_0x911781,_0x3d083a){return function(){DashboardEvents[_0xd788('0x4')](_0x911781,_0x3d083a);};}exports[_0xd788('0x5')]=function(_0x518a71){for(var _0x493eaa=0x0,_0x86d9fe=events['length'];_0x493eaa<_0x86d9fe;_0x493eaa++){var _0x1a851a=events[_0x493eaa];var _0x50bf2c=createListener(_0xd788('0x6')+_0x1a851a,_0x518a71);DashboardEvents['on'](_0x1a851a,_0x50bf2c);}}; \ No newline at end of file +var _0x1148=['./dashboard.events','save','update','emit','removeListener','length'];(function(_0x4e99ea,_0x35df1f){var _0x29177c=function(_0x289a36){while(--_0x289a36){_0x4e99ea['push'](_0x4e99ea['shift']());}};_0x29177c(++_0x35df1f);}(_0x1148,0x13e));var _0x8114=function(_0x462a0c,_0x26063b){_0x462a0c=_0x462a0c-0x0;var _0x33184a=_0x1148[_0x462a0c];return _0x33184a;};'use strict';var DashboardEvents=require(_0x8114('0x0'));var events=[_0x8114('0x1'),'remove',_0x8114('0x2')];function createListener(_0x29ffe7,_0x30ad53){return function(_0x4d6910){_0x30ad53[_0x8114('0x3')](_0x29ffe7,_0x4d6910);};}function removeListener(_0x168e1a,_0x2657b5){return function(){DashboardEvents[_0x8114('0x4')](_0x168e1a,_0x2657b5);};}exports['register']=function(_0x4037b4){for(var _0x9284db=0x0,_0x32be0d=events[_0x8114('0x5')];_0x9284db<_0x32be0d;_0x9284db++){var _0x55cbd5=events[_0x9284db];var _0x49c96c=createListener('dashboard:'+_0x55cbd5,_0x4037b4);DashboardEvents['on'](_0x55cbd5,_0x49c96c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index da5c3af..279c37c 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 _0x5722=['/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index'];(function(_0x15e50b,_0x56f477){var _0x4dbdf8=function(_0x51d87f){while(--_0x51d87f){_0x15e50b['push'](_0x15e50b['shift']());}};_0x4dbdf8(++_0x56f477);}(_0x5722,0xc7));var _0x2572=function(_0x4142c1,_0x24d3bd){_0x4142c1=_0x4142c1-0x0;var _0x32a610=_0x5722[_0x4142c1];return _0x32a610;};'use strict';var multer=require(_0x2572('0x0'));var util=require(_0x2572('0x1'));var path=require(_0x2572('0x2'));var timeout=require('connect-timeout');var express=require(_0x2572('0x3'));var router=express[_0x2572('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2572('0x5'));var interaction=require(_0x2572('0x6'));var config=require('../../config/environment');var controller=require(_0x2572('0x7'));router[_0x2572('0x8')]('/',auth[_0x2572('0x9')](),controller[_0x2572('0xa')]);router[_0x2572('0x8')](_0x2572('0xb'),auth['isAuthenticated'](),controller[_0x2572('0xc')]);router[_0x2572('0x8')](_0x2572('0xd'),auth['isAuthenticated'](),controller[_0x2572('0xe')]);router[_0x2572('0xf')]('/',auth[_0x2572('0x9')](),controller[_0x2572('0x10')]);router[_0x2572('0xf')](_0x2572('0x11'),auth[_0x2572('0x9')](),controller[_0x2572('0x12')]);router[_0x2572('0xf')](_0x2572('0xd'),auth[_0x2572('0x9')](),controller['addItem']);router[_0x2572('0x13')](_0x2572('0xb'),auth[_0x2572('0x9')](),controller['update']);router[_0x2572('0x14')](_0x2572('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2a56=['/:id','/:id/items','isAuthenticated','getItems','post','create','/:id/clone','clone','addItem','put','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','index','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2a56,0xf3));var _0x62a5=function(_0x2e6f4c,_0x2f46a4){_0x2e6f4c=_0x2e6f4c-0x0;var _0x1737a6=_0x2a56[_0x2e6f4c];return _0x1737a6;};'use strict';var multer=require(_0x62a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x62a5('0x1'));var router=express[_0x62a5('0x2')]();var fs_extra=require(_0x62a5('0x3'));var auth=require(_0x62a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x62a5('0x5'));var controller=require(_0x62a5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x62a5('0x7')]);router[_0x62a5('0x8')](_0x62a5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x62a5('0x8')](_0x62a5('0xa'),auth[_0x62a5('0xb')](),controller[_0x62a5('0xc')]);router[_0x62a5('0xd')]('/',auth[_0x62a5('0xb')](),controller[_0x62a5('0xe')]);router[_0x62a5('0xd')](_0x62a5('0xf'),auth[_0x62a5('0xb')](),controller[_0x62a5('0x10')]);router[_0x62a5('0xd')]('/:id/items',auth[_0x62a5('0xb')](),controller[_0x62a5('0x11')]);router[_0x62a5('0x12')](_0x62a5('0x9'),auth[_0x62a5('0xb')](),controller['update']);router[_0x62a5('0x13')]('/:id',auth[_0x62a5('0xb')](),controller[_0x62a5('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 474291d..b1bb796 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 _0x90b1=['#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x1780ec,_0x3af2fa){var _0x5c5663=function(_0x23eac9){while(--_0x23eac9){_0x1780ec['push'](_0x1780ec['shift']());}};_0x5c5663(++_0x3af2fa);}(_0x90b1,0x1bb));var _0x190b=function(_0x3a1771,_0xc4a050){_0x3a1771=_0x3a1771-0x0;var _0x1493a5=_0x90b1[_0x3a1771];return _0x1493a5;};'use strict';var Sequelize=require(_0x190b('0x0'));var squel=require(_0x190b('0x1'));var _=require(_0x190b('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x190b('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x190b('0x4')](_0x190b('0x5')),'get':function(){try{return JSON[_0x190b('0x6')](this['getDataValue']('attrs'));}catch(_0x5cbebb){return[];}},'set':function(_0x5da9c1){try{this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')](_0x5da9c1));}catch(_0x626aa1){this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x190b('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x190b('0xa')]},'col':{'type':Sequelize[_0x190b('0xa')]},'background':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x190b('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xf494=['squel','lodash','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xf494,0x1c6));var _0x4f49=function(_0x311680,_0x43b0a6){_0x311680=_0x311680-0x0;var _0xa96cee=_0xf494[_0x311680];return _0xa96cee;};'use strict';var Sequelize=require(_0x4f49('0x0'));var squel=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));module['exports']={'title':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4f49('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5')),'get':function(){try{return JSON[_0x4f49('0x6')](this[_0x4f49('0x7')](_0x4f49('0x8')));}catch(_0x790e8b){return[];}},'set':function(_0xc5e778){try{this[_0x4f49('0x9')](_0x4f49('0x8'),JSON['stringify'](_0xc5e778));}catch(_0x58e9a0){this[_0x4f49('0x9')](_0x4f49('0x8'),JSON[_0x4f49('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x4f49('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4f49('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4f49('0xb')]},'col':{'type':Sequelize[_0x4f49('0xb')]},'background':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![],'defaultValue':_0x4f49('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x4f49('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 012174a..e02ff9a 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 _0xcd88=['undefined','count','limit','reject','save','update','destroy','then','error','stack','name','status','show','params','model','DashboardItem','keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd88,0x8e));var _0x8cd8=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xcd88[_0x9dfc10];return _0x4f938a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cd8('0x0'));var zipdir=require(_0x8cd8('0x1'));var jsonpatch=require(_0x8cd8('0x2'));var rp=require('request-promise');var moment=require(_0x8cd8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8cd8('0x4'));var util=require(_0x8cd8('0x5'));var path=require(_0x8cd8('0x6'));var sox=require(_0x8cd8('0x7'));var csv=require(_0x8cd8('0x8'));var ejs=require(_0x8cd8('0x9'));var fs=require('fs');var fs_extra=require(_0x8cd8('0xa'));var _=require(_0x8cd8('0xb'));var squel=require(_0x8cd8('0xc'));var crypto=require(_0x8cd8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8cd8('0xe'));var toCsv=require(_0x8cd8('0x8'));var querystring=require(_0x8cd8('0xf'));var Papa=require(_0x8cd8('0x10'));var Redis=require(_0x8cd8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8cd8('0x12'));var as=require(_0x8cd8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8cd8('0x14'));var utils=require(_0x8cd8('0x15'));var config=require(_0x8cd8('0x16'));var licenseUtil=require(_0x8cd8('0x17'));var db=require(_0x8cd8('0x18'))['db'];config['redis']=_[_0x8cd8('0x19')](config[_0x8cd8('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8cd8('0x1b'))(new Redis(config[_0x8cd8('0x1a')]));require('./dashboardItem.socket')[_0x8cd8('0x1c')](socket);function respondWithStatusCode(_0x2bbddd,_0x3bca1a){_0x3bca1a=_0x3bca1a||0xcc;return function(_0x3ea458){if(_0x3ea458){return _0x2bbddd['sendStatus'](_0x3bca1a);}return _0x2bbddd['status'](_0x3bca1a)[_0x8cd8('0x1d')]();};}function respondWithResult(_0x4ba42a,_0x5deb27){_0x5deb27=_0x5deb27||0xc8;return function(_0xfbcfdc){if(_0xfbcfdc){return _0x4ba42a['status'](_0x5deb27)[_0x8cd8('0x1e')](_0xfbcfdc);}};}function respondWithFilteredResult(_0x21aa53,_0x35a886){return function(_0xc16d9e){if(_0xc16d9e){var _0x2d05e9=typeof _0x35a886[_0x8cd8('0x1f')]===_0x8cd8('0x20')&&typeof _0x35a886['limit']===_0x8cd8('0x20');var _0x48d256=_0xc16d9e[_0x8cd8('0x21')];var _0x4ff36a=_0x2d05e9?0x0:_0x35a886['offset'];var _0xb547d7=_0x2d05e9?_0xc16d9e['count']:_0x35a886['offset']+_0x35a886[_0x8cd8('0x22')];var _0x5ee649;if(_0xb547d7>=_0x48d256){_0xb547d7=_0x48d256;_0x5ee649=0xc8;}else{_0x5ee649=0xce;}_0x21aa53['status'](_0x5ee649);return _0x21aa53['set']('Content-Range',_0x4ff36a+'-'+_0xb547d7+'/'+_0x48d256)[_0x8cd8('0x1e')](_0xc16d9e);}return null;};}function patchUpdates(_0x408e35){return function(_0x3d219b){try{jsonpatch['apply'](_0x3d219b,_0x408e35,!![]);}catch(_0x460b6f){return BPromise[_0x8cd8('0x23')](_0x460b6f);}return _0x3d219b[_0x8cd8('0x24')]();};}function saveUpdates(_0x5da806,_0x8ddcfb){return function(_0x27a494){if(_0x27a494){return _0x27a494[_0x8cd8('0x25')](_0x5da806)['then'](function(_0x25d54b){return _0x25d54b;});}return null;};}function removeEntity(_0x4ae801,_0xc9966b){return function(_0x961bd1){if(_0x961bd1){return _0x961bd1[_0x8cd8('0x26')]()[_0x8cd8('0x27')](function(){_0x4ae801['status'](0xcc)[_0x8cd8('0x1d')]();});}};}function handleEntityNotFound(_0x581ce2,_0x37fe62){return function(_0x1bdcca){if(!_0x1bdcca){_0x581ce2['sendStatus'](0x194);}return _0x1bdcca;};}function handleError(_0x1dc944,_0x135ceb){_0x135ceb=_0x135ceb||0x1f4;return function(_0x3c475d){logger[_0x8cd8('0x28')](_0x3c475d[_0x8cd8('0x29')]);if(_0x3c475d[_0x8cd8('0x2a')]){delete _0x3c475d[_0x8cd8('0x2a')];}_0x1dc944[_0x8cd8('0x2b')](_0x135ceb)['send'](_0x3c475d);};}exports[_0x8cd8('0x2c')]=function(_0x54afd3,_0x38d092){var _0x2adb0b={'raw':![],'where':{'id':_0x54afd3[_0x8cd8('0x2d')]['id']}},_0x26b329={};_0x26b329[_0x8cd8('0x2e')]=_['keys'](db[_0x8cd8('0x2f')]['rawAttributes']);_0x26b329['query']=_[_0x8cd8('0x30')](_0x54afd3[_0x8cd8('0x31')]);_0x26b329[_0x8cd8('0x32')]=_[_0x8cd8('0x33')](_0x26b329[_0x8cd8('0x2e')],_0x26b329[_0x8cd8('0x31')]);_0x2adb0b[_0x8cd8('0x34')]=_[_0x8cd8('0x33')](_0x26b329[_0x8cd8('0x2e')],qs['fields'](_0x54afd3[_0x8cd8('0x31')]['fields']));_0x2adb0b[_0x8cd8('0x34')]=_0x2adb0b['attributes'][_0x8cd8('0x35')]?_0x2adb0b[_0x8cd8('0x34')]:_0x26b329[_0x8cd8('0x2e')];if(_0x54afd3[_0x8cd8('0x31')][_0x8cd8('0x36')]){_0x2adb0b[_0x8cd8('0x37')]=[{'all':!![]}];}_0x2adb0b=_[_0x8cd8('0x38')]({},_0x2adb0b,_0x54afd3[_0x8cd8('0x39')]);return db[_0x8cd8('0x2f')][_0x8cd8('0x3a')](_0x2adb0b)[_0x8cd8('0x27')](handleEntityNotFound(_0x38d092,null))[_0x8cd8('0x27')](respondWithResult(_0x38d092,null))[_0x8cd8('0x3b')](handleError(_0x38d092,null));};exports[_0x8cd8('0x26')]=function(_0xe56de0,_0x4cb4cd){return db[_0x8cd8('0x2f')][_0x8cd8('0x3a')]({'where':{'id':_0xe56de0[_0x8cd8('0x2d')]['id']}})[_0x8cd8('0x27')](handleEntityNotFound(_0x4cb4cd,null))['then'](removeEntity(_0x4cb4cd,null))[_0x8cd8('0x3b')](handleError(_0x4cb4cd,null));};function widgetAttributes(_0xc3b686){try{switch(_0xc3b686['type']){case'iframe':return[{'name':_0x8cd8('0x3c'),'value':_0xc3b686[_0x8cd8('0x3c')]||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x0]?_0xc3b686[_0x8cd8('0x3d')][0x0]['value']:undefined)||_0x8cd8('0x3e')}];case _0x8cd8('0x3f'):return[{'name':_0x8cd8('0x40'),'value':_0xc3b686[_0x8cd8('0x40')]||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x0]?_0xc3b686['attrs'][0x0][_0x8cd8('0x41')]:undefined)||''}];case _0x8cd8('0x42'):return[{'name':_0x8cd8('0x43'),'value':_0xc3b686['attrHourFormat']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x0]?_0xc3b686[_0x8cd8('0x3d')][0x0][_0x8cd8('0x41')]:undefined)||_0x8cd8('0x44')},{'name':_0x8cd8('0x45'),'value':_0xc3b686['attrTimezone']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686['attrs'][0x1]?_0xc3b686[_0x8cd8('0x3d')][0x1]['value']:undefined)||_0x8cd8('0x46')},{'name':_0x8cd8('0x47'),'value':_0xc3b686['attrFontSize']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x2]?_0xc3b686[_0x8cd8('0x3d')][0x2][_0x8cd8('0x41')]:undefined)||0xc}];case _0x8cd8('0x48'):return[{'name':_0x8cd8('0x49'),'value':_0xc3b686['attrMetric']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x0]?_0xc3b686[_0x8cd8('0x3d')][0x0][_0x8cd8('0x41')]:undefined)||_0x8cd8('0x4a')},{'name':_0x8cd8('0x4b'),'value':_0xc3b686['attrVoiceQueues']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x1]?_0xc3b686[_0x8cd8('0x3d')][0x1][_0x8cd8('0x41')]:undefined)||[]},{'name':_0x8cd8('0x47'),'value':_0xc3b686[_0x8cd8('0x47')]||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686['attrs'][0x2]?_0xc3b686[_0x8cd8('0x3d')][0x2][_0x8cd8('0x41')]:undefined)||0x14}];case _0x8cd8('0x4c'):case'pie-chart':return[{'name':_0x8cd8('0x4d'),'value':_0xc3b686[_0x8cd8('0x4d')]||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x0]?_0xc3b686[_0x8cd8('0x3d')][0x0][_0x8cd8('0x41')]:undefined)||_0x8cd8('0x4a')},{'name':_0x8cd8('0x4e'),'value':_0xc3b686['attrSerie2']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x1]?_0xc3b686[_0x8cd8('0x3d')][0x1]['value']:undefined)||null},{'name':_0x8cd8('0x4f'),'value':_0xc3b686[_0x8cd8('0x4f')]||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686['attrs'][0x2]?_0xc3b686[_0x8cd8('0x3d')][0x2][_0x8cd8('0x41')]:undefined)||null},{'name':_0x8cd8('0x4b'),'value':_0xc3b686['attrVoiceQueues']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686['attrs'][0x3]?_0xc3b686[_0x8cd8('0x3d')][0x3]['value']:undefined)||[]}];case _0x8cd8('0x50'):return[{'name':_0x8cd8('0x51'),'type':_0xc3b686['reportType']||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686[_0x8cd8('0x3d')][0x0]?_0xc3b686[_0x8cd8('0x3d')][0x0][_0x8cd8('0x52')]:undefined)||null,'value':_0xc3b686[_0x8cd8('0x51')]||(_0xc3b686[_0x8cd8('0x3d')]&&_0xc3b686['attrs'][0x0]?_0xc3b686[_0x8cd8('0x3d')][0x0][_0x8cd8('0x41')]:undefined)||null},{'name':_0x8cd8('0x53'),'value':_0xc3b686['attrRefresh']||(_0xc3b686['attrs']&&_0xc3b686['attrs'][0x1]?_0xc3b686[_0x8cd8('0x3d')][0x1][_0x8cd8('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x43aed7){logger[_0x8cd8('0x28')](_0x8cd8('0x54'),JSON['stringify'](_0x43aed7));return[];}}exports[_0x8cd8('0x55')]=function(_0x13aff8,_0x15e14c){if(_0x13aff8[_0x8cd8('0x56')]){_0x13aff8[_0x8cd8('0x56')][_0x8cd8('0x3d')]=widgetAttributes(_0x13aff8[_0x8cd8('0x56')]);}return db[_0x8cd8('0x2f')][_0x8cd8('0x55')](_0x13aff8['body'],{})[_0x8cd8('0x27')](respondWithResult(_0x15e14c,0xc9))[_0x8cd8('0x3b')](handleError(_0x15e14c,null));};exports[_0x8cd8('0x25')]=function(_0x14323f,_0x2fd9fc){if(_0x14323f['body']['id']){delete _0x14323f[_0x8cd8('0x56')]['id'];}_0x14323f[_0x8cd8('0x56')][_0x8cd8('0x3d')]=widgetAttributes(_0x14323f[_0x8cd8('0x56')]);return db['DashboardItem'][_0x8cd8('0x3a')]({'where':{'id':_0x14323f[_0x8cd8('0x2d')]['id']}})[_0x8cd8('0x27')](handleEntityNotFound(_0x2fd9fc,null))[_0x8cd8('0x27')](saveUpdates(_0x14323f[_0x8cd8('0x56')],null))['then'](respondWithResult(_0x2fd9fc,null))[_0x8cd8('0x3b')](handleError(_0x2fd9fc,null));}; \ No newline at end of file +var _0x09d9=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./dashboardItem.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrTimezone','0.00','attrFontSize','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x89c40f,_0xd92eb2){var _0x17acbb=function(_0xd57d85){while(--_0xd57d85){_0x89c40f['push'](_0x89c40f['shift']());}};_0x17acbb(++_0xd92eb2);}(_0x09d9,0xaf));var _0x909d=function(_0x26fbb9,_0x18f6a1){_0x26fbb9=_0x26fbb9-0x0;var _0x2427a8=_0x09d9[_0x26fbb9];return _0x2427a8;};'use strict';var emlformat=require(_0x909d('0x0'));var rimraf=require(_0x909d('0x1'));var zipdir=require(_0x909d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x909d('0x3'));var moment=require(_0x909d('0x4'));var BPromise=require(_0x909d('0x5'));var Mustache=require(_0x909d('0x6'));var util=require(_0x909d('0x7'));var path=require('path');var sox=require(_0x909d('0x8'));var csv=require(_0x909d('0x9'));var ejs=require(_0x909d('0xa'));var fs=require('fs');var fs_extra=require(_0x909d('0xb'));var _=require(_0x909d('0xc'));var squel=require(_0x909d('0xd'));var crypto=require(_0x909d('0xe'));var jsforce=require(_0x909d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x909d('0x9'));var querystring=require(_0x909d('0x10'));var Papa=require(_0x909d('0x11'));var Redis=require(_0x909d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x909d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x909d('0x14'));var logger=require(_0x909d('0x15'))(_0x909d('0x16'));var utils=require(_0x909d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x909d('0x18'));var db=require(_0x909d('0x19'))['db'];config['redis']=_[_0x909d('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x909d('0x1b'))(new Redis(config[_0x909d('0x1c')]));require(_0x909d('0x1d'))[_0x909d('0x1e')](socket);function respondWithStatusCode(_0x1b975c,_0x9bbe8e){_0x9bbe8e=_0x9bbe8e||0xcc;return function(_0x4ee51e){if(_0x4ee51e){return _0x1b975c[_0x909d('0x1f')](_0x9bbe8e);}return _0x1b975c['status'](_0x9bbe8e)[_0x909d('0x20')]();};}function respondWithResult(_0x19ee9a,_0x475a02){_0x475a02=_0x475a02||0xc8;return function(_0x5bdd05){if(_0x5bdd05){return _0x19ee9a[_0x909d('0x21')](_0x475a02)[_0x909d('0x22')](_0x5bdd05);}};}function respondWithFilteredResult(_0x3f213f,_0xde584a){return function(_0x72c0f2){if(_0x72c0f2){var _0x3812a0=typeof _0xde584a['offset']===_0x909d('0x23')&&typeof _0xde584a['limit']===_0x909d('0x23');var _0x58e720=_0x72c0f2[_0x909d('0x24')];var _0x4d1ee5=_0x3812a0?0x0:_0xde584a[_0x909d('0x25')];var _0x12fb5d=_0x3812a0?_0x72c0f2[_0x909d('0x24')]:_0xde584a[_0x909d('0x25')]+_0xde584a[_0x909d('0x26')];var _0xd6156a;if(_0x12fb5d>=_0x58e720){_0x12fb5d=_0x58e720;_0xd6156a=0xc8;}else{_0xd6156a=0xce;}_0x3f213f['status'](_0xd6156a);return _0x3f213f[_0x909d('0x27')](_0x909d('0x28'),_0x4d1ee5+'-'+_0x12fb5d+'/'+_0x58e720)['json'](_0x72c0f2);}return null;};}function patchUpdates(_0x5d5f84){return function(_0x42231a){try{jsonpatch[_0x909d('0x29')](_0x42231a,_0x5d5f84,!![]);}catch(_0x279e63){return BPromise[_0x909d('0x2a')](_0x279e63);}return _0x42231a[_0x909d('0x2b')]();};}function saveUpdates(_0x4d4318,_0x3886f7){return function(_0x21db7a){if(_0x21db7a){return _0x21db7a[_0x909d('0x2c')](_0x4d4318)[_0x909d('0x2d')](function(_0x979084){return _0x979084;});}return null;};}function removeEntity(_0x23f8da,_0x5c1e2a){return function(_0x2a83e2){if(_0x2a83e2){return _0x2a83e2[_0x909d('0x2e')]()[_0x909d('0x2d')](function(){_0x23f8da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc534b,_0x57723e){return function(_0x5141a0){if(!_0x5141a0){_0xbc534b[_0x909d('0x1f')](0x194);}return _0x5141a0;};}function handleError(_0x106375,_0x1082a6){_0x1082a6=_0x1082a6||0x1f4;return function(_0x330f02){logger['error'](_0x330f02[_0x909d('0x2f')]);if(_0x330f02[_0x909d('0x30')]){delete _0x330f02['name'];}_0x106375['status'](_0x1082a6)[_0x909d('0x31')](_0x330f02);};}exports['show']=function(_0x4bc18e,_0x2420bf){var _0x37878f={'raw':![],'where':{'id':_0x4bc18e[_0x909d('0x32')]['id']}},_0x59570e={};_0x59570e[_0x909d('0x33')]=_[_0x909d('0x34')](db[_0x909d('0x35')][_0x909d('0x36')]);_0x59570e['query']=_[_0x909d('0x34')](_0x4bc18e[_0x909d('0x37')]);_0x59570e['filters']=_[_0x909d('0x38')](_0x59570e[_0x909d('0x33')],_0x59570e[_0x909d('0x37')]);_0x37878f[_0x909d('0x39')]=_[_0x909d('0x38')](_0x59570e[_0x909d('0x33')],qs[_0x909d('0x3a')](_0x4bc18e[_0x909d('0x37')]['fields']));_0x37878f['attributes']=_0x37878f['attributes'][_0x909d('0x3b')]?_0x37878f[_0x909d('0x39')]:_0x59570e[_0x909d('0x33')];if(_0x4bc18e['query'][_0x909d('0x3c')]){_0x37878f[_0x909d('0x3d')]=[{'all':!![]}];}_0x37878f=_[_0x909d('0x3e')]({},_0x37878f,_0x4bc18e[_0x909d('0x3f')]);return db[_0x909d('0x35')][_0x909d('0x40')](_0x37878f)[_0x909d('0x2d')](handleEntityNotFound(_0x2420bf,null))[_0x909d('0x2d')](respondWithResult(_0x2420bf,null))[_0x909d('0x41')](handleError(_0x2420bf,null));};exports['destroy']=function(_0x3a91ad,_0x38e55a){return db['DashboardItem'][_0x909d('0x40')]({'where':{'id':_0x3a91ad[_0x909d('0x32')]['id']}})[_0x909d('0x2d')](handleEntityNotFound(_0x38e55a,null))[_0x909d('0x2d')](removeEntity(_0x38e55a,null))['catch'](handleError(_0x38e55a,null));};function widgetAttributes(_0xdf02ea){try{switch(_0xdf02ea[_0x909d('0x42')]){case _0x909d('0x43'):return[{'name':'attrUrl','value':_0xdf02ea[_0x909d('0x44')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0]['value']:undefined)||_0x909d('0x46')}];case _0x909d('0x47'):return[{'name':_0x909d('0x48'),'value':_0xdf02ea[_0x909d('0x48')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0][_0x909d('0x49')]:undefined)||''}];case _0x909d('0x4a'):return[{'name':'attrHourFormat','value':_0xdf02ea['attrHourFormat']||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0][_0x909d('0x49')]:undefined)||'HH:mm:ss'},{'name':_0x909d('0x4b'),'value':_0xdf02ea[_0x909d('0x4b')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x1]?_0xdf02ea[_0x909d('0x45')][0x1]['value']:undefined)||_0x909d('0x4c')},{'name':'attrFontSize','value':_0xdf02ea[_0x909d('0x4d')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x2]?_0xdf02ea[_0x909d('0x45')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x909d('0x4e'),'value':_0xdf02ea[_0x909d('0x4e')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0][_0x909d('0x49')]:undefined)||_0x909d('0x4f')},{'name':'attrVoiceQueues','value':_0xdf02ea['attrVoiceQueues']||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x1]?_0xdf02ea[_0x909d('0x45')][0x1][_0x909d('0x49')]:undefined)||[]},{'name':_0x909d('0x4d'),'value':_0xdf02ea[_0x909d('0x4d')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x2]?_0xdf02ea[_0x909d('0x45')][0x2]['value']:undefined)||0x14}];case _0x909d('0x50'):case _0x909d('0x51'):return[{'name':_0x909d('0x52'),'value':_0xdf02ea[_0x909d('0x52')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0]['value']:undefined)||_0x909d('0x4f')},{'name':_0x909d('0x53'),'value':_0xdf02ea[_0x909d('0x53')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x1]?_0xdf02ea['attrs'][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0xdf02ea['attrSerie3']||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea['attrs'][0x2]?_0xdf02ea[_0x909d('0x45')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0xdf02ea['attrVoiceQueues']||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x3]?_0xdf02ea[_0x909d('0x45')][0x3][_0x909d('0x49')]:undefined)||[]}];case _0x909d('0x54'):return[{'name':_0x909d('0x55'),'type':_0xdf02ea[_0x909d('0x56')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0][_0x909d('0x42')]:undefined)||null,'value':_0xdf02ea[_0x909d('0x55')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x0]?_0xdf02ea[_0x909d('0x45')][0x0][_0x909d('0x49')]:undefined)||null},{'name':_0x909d('0x57'),'value':_0xdf02ea[_0x909d('0x57')]||(_0xdf02ea[_0x909d('0x45')]&&_0xdf02ea[_0x909d('0x45')][0x1]?_0xdf02ea[_0x909d('0x45')][0x1][_0x909d('0x49')]:undefined)||0x0}];default:return[];}}catch(_0x1a1dde){logger[_0x909d('0x58')]('widgetAttributes:\x20%s',JSON[_0x909d('0x59')](_0x1a1dde));return[];}}exports[_0x909d('0x5a')]=function(_0x23ea6c,_0x56e41b){if(_0x23ea6c[_0x909d('0x5b')]){_0x23ea6c[_0x909d('0x5b')][_0x909d('0x45')]=widgetAttributes(_0x23ea6c[_0x909d('0x5b')]);}return db[_0x909d('0x35')][_0x909d('0x5a')](_0x23ea6c[_0x909d('0x5b')],{})['then'](respondWithResult(_0x56e41b,0xc9))['catch'](handleError(_0x56e41b,null));};exports[_0x909d('0x2c')]=function(_0x1ec2a6,_0x1e51dd){if(_0x1ec2a6[_0x909d('0x5b')]['id']){delete _0x1ec2a6[_0x909d('0x5b')]['id'];}_0x1ec2a6['body']['attrs']=widgetAttributes(_0x1ec2a6[_0x909d('0x5b')]);return db[_0x909d('0x35')][_0x909d('0x40')]({'where':{'id':_0x1ec2a6[_0x909d('0x32')]['id']}})['then'](handleEntityNotFound(_0x1e51dd,null))['then'](saveUpdates(_0x1ec2a6[_0x909d('0x5b')],null))[_0x909d('0x2d')](respondWithResult(_0x1e51dd,null))['catch'](handleError(_0x1e51dd,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1c03be8..8d21590 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 _0x950c=['../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x950c,0x86));var _0xc950=function(_0x38ffbb,_0x42dfeb){_0x38ffbb=_0x38ffbb-0x0;var _0x2477fd=_0x950c[_0x38ffbb];return _0x2477fd;};'use strict';var EventEmitter=require(_0xc950('0x0'));var DashboardItem=require(_0xc950('0x1'))['db'][_0xc950('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc950('0x3'),'afterUpdate':_0xc950('0x4'),'afterDestroy':_0xc950('0x5')};function emitEvent(_0x53b228){return function(_0x1db7b6,_0x4142df,_0x3bfc18){DashboardItemEvents[_0xc950('0x6')](_0x53b228+':'+_0x1db7b6['id'],_0x1db7b6);DashboardItemEvents['emit'](_0x53b228,_0x1db7b6);_0x3bfc18(null);};}for(var e in events){if(events[_0xc950('0x7')](e)){var event=events[e];DashboardItem[_0xc950('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x38b8=['remove','emit','hook','exports','../../mysqldb','save','update'];(function(_0x41b6f5,_0x1ad42f){var _0x5d6142=function(_0xb46850){while(--_0xb46850){_0x41b6f5['push'](_0x41b6f5['shift']());}};_0x5d6142(++_0x1ad42f);}(_0x38b8,0x7b));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x838b('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x838b('0x1'),'afterUpdate':_0x838b('0x2'),'afterDestroy':_0x838b('0x3')};function emitEvent(_0x2d7e3d){return function(_0x262916,_0x3f1f73,_0x4c6b93){DashboardItemEvents[_0x838b('0x4')](_0x2d7e3d+':'+_0x262916['id'],_0x262916);DashboardItemEvents[_0x838b('0x4')](_0x2d7e3d,_0x262916);_0x4c6b93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x838b('0x5')](e,emitEvent(event));}}module[_0x838b('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 39e2691..ccf90fc 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 _0x8413=['path','rimraf','./dashboardItem.attributes','exports','define','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x92ccfd,_0x29b2eb){var _0x960a4d=function(_0x50e70b){while(--_0x50e70b){_0x92ccfd['push'](_0x92ccfd['shift']());}};_0x960a4d(++_0x29b2eb);}(_0x8413,0x7b));var _0x3841=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x8413[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x3841('0x0'));var util=require(_0x3841('0x1'));var logger=require(_0x3841('0x2'))(_0x3841('0x3'));var moment=require(_0x3841('0x4'));var BPromise=require(_0x3841('0x5'));var rp=require(_0x3841('0x6'));var fs=require('fs');var path=require(_0x3841('0x7'));var rimraf=require(_0x3841('0x8'));var config=require('../../config/environment');var attributes=require(_0x3841('0x9'));module[_0x3841('0xa')]=function(_0x3cdddc,_0x41e6ab){return _0x3cdddc[_0x3841('0xb')]('DashboardItem',attributes,{'tableName':_0x3841('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8f6=['dashboard_items','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./dashboardItem.attributes','exports','DashboardItem'];(function(_0x2b6b02,_0x29dd9a){var _0x2231f0=function(_0x7bffaf){while(--_0x7bffaf){_0x2b6b02['push'](_0x2b6b02['shift']());}};_0x2231f0(++_0x29dd9a);}(_0xd8f6,0x6f));var _0x6d8f=function(_0x4e6cf0,_0x18c85c){_0x4e6cf0=_0x4e6cf0-0x0;var _0x74ea64=_0xd8f6[_0x4e6cf0];return _0x74ea64;};'use strict';var _=require(_0x6d8f('0x0'));var util=require('util');var logger=require(_0x6d8f('0x1'))('api');var moment=require(_0x6d8f('0x2'));var BPromise=require(_0x6d8f('0x3'));var rp=require(_0x6d8f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d8f('0x5'));var config=require('../../config/environment');var attributes=require(_0x6d8f('0x6'));module[_0x6d8f('0x7')]=function(_0x3173e5,_0x3cc67d){return _0x3173e5['define'](_0x6d8f('0x8'),attributes,{'tableName':_0x6d8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 7d13fcc..4570ae6 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 _0xae41=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xae41,0x177));var _0x1ae4=function(_0x2ba159,_0x1c03ca){_0x2ba159=_0x2ba159-0x0;var _0x528b9e=_0xae41[_0x2ba159];return _0x528b9e;};'use strict';var _=require(_0x1ae4('0x0'));var util=require('util');var moment=require(_0x1ae4('0x1'));var BPromise=require(_0x1ae4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ae4('0x3'));var db=require(_0x1ae4('0x4'))['db'];var utils=require(_0x1ae4('0x5'));var logger=require(_0x1ae4('0x6'))(_0x1ae4('0x7'));var config=require(_0x1ae4('0x8'));var jayson=require(_0x1ae4('0x9'));var client=jayson[_0x1ae4('0xa')][_0x1ae4('0xb')]({'port':0x232a});config[_0x1ae4('0xc')]=_[_0x1ae4('0xd')](config[_0x1ae4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ae4('0xe'))(new Redis(config[_0x1ae4('0xc')]));require(_0x1ae4('0xf'))[_0x1ae4('0x10')](socket);function respondWithRpcPromise(_0x31f362,_0x51a241,_0x352f8e){return new BPromise(function(_0xadf5a0,_0xcfe84e){return client[_0x1ae4('0x11')](_0x31f362,_0x352f8e)[_0x1ae4('0x12')](function(_0x4e3078){logger[_0x1ae4('0x13')](_0x1ae4('0x14'),_0x51a241,_0x1ae4('0x15'));logger['debug'](_0x1ae4('0x16'),_0x51a241,_0x1ae4('0x15'),JSON['stringify'](_0x4e3078));if(_0x4e3078[_0x1ae4('0x17')]){if(_0x4e3078['error'][_0x1ae4('0x18')]===0x1f4){logger[_0x1ae4('0x17')](_0x1ae4('0x14'),_0x51a241,_0x4e3078[_0x1ae4('0x17')][_0x1ae4('0x19')]);return _0xcfe84e(_0x4e3078[_0x1ae4('0x17')][_0x1ae4('0x19')]);}logger[_0x1ae4('0x17')](_0x1ae4('0x14'),_0x51a241,_0x4e3078['error'][_0x1ae4('0x19')]);return _0xadf5a0(_0x4e3078[_0x1ae4('0x17')][_0x1ae4('0x19')]);}else{logger[_0x1ae4('0x13')](_0x1ae4('0x14'),_0x51a241,_0x1ae4('0x15'));_0xadf5a0(_0x4e3078[_0x1ae4('0x1a')]['message']);}})[_0x1ae4('0x1b')](function(_0x59def0){logger[_0x1ae4('0x17')](_0x1ae4('0x14'),_0x51a241,_0x59def0);_0xcfe84e(_0x59def0);});});} \ No newline at end of file +var _0xd651=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd651,0x18d));var _0x1d65=function(_0x2b2499,_0x1719f4){_0x2b2499=_0x2b2499-0x0;var _0x23cf01=_0xd651[_0x2b2499];return _0x23cf01;};'use strict';var _=require(_0x1d65('0x0'));var util=require(_0x1d65('0x1'));var moment=require(_0x1d65('0x2'));var BPromise=require(_0x1d65('0x3'));var rs=require(_0x1d65('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d65('0x5'))['db'];var utils=require(_0x1d65('0x6'));var logger=require('../../config/logger')(_0x1d65('0x7'));var config=require(_0x1d65('0x8'));var jayson=require(_0x1d65('0x9'));var client=jayson[_0x1d65('0xa')][_0x1d65('0xb')]({'port':0x232a});config[_0x1d65('0xc')]=_[_0x1d65('0xd')](config['redis'],{'host':_0x1d65('0xe'),'port':0x18eb});var socket=require(_0x1d65('0xf'))(new Redis(config['redis']));require(_0x1d65('0x10'))['register'](socket);function respondWithRpcPromise(_0x210525,_0x460a46,_0x1c9b6d){return new BPromise(function(_0x5ebb65,_0x388214){return client[_0x1d65('0x11')](_0x210525,_0x1c9b6d)[_0x1d65('0x12')](function(_0x306d85){logger[_0x1d65('0x13')]('DashboardItem,\x20%s,\x20%s',_0x460a46,'request\x20sent');logger['debug'](_0x1d65('0x14'),_0x460a46,_0x1d65('0x15'),JSON[_0x1d65('0x16')](_0x306d85));if(_0x306d85[_0x1d65('0x17')]){if(_0x306d85[_0x1d65('0x17')][_0x1d65('0x18')]===0x1f4){logger[_0x1d65('0x17')](_0x1d65('0x19'),_0x460a46,_0x306d85[_0x1d65('0x17')][_0x1d65('0x1a')]);return _0x388214(_0x306d85[_0x1d65('0x17')][_0x1d65('0x1a')]);}logger[_0x1d65('0x17')](_0x1d65('0x19'),_0x460a46,_0x306d85[_0x1d65('0x17')][_0x1d65('0x1a')]);return _0x5ebb65(_0x306d85['error'][_0x1d65('0x1a')]);}else{logger[_0x1d65('0x13')](_0x1d65('0x19'),_0x460a46,_0x1d65('0x15'));_0x5ebb65(_0x306d85['result'][_0x1d65('0x1a')]);}})['catch'](function(_0x1fd811){logger[_0x1d65('0x17')](_0x1d65('0x19'),_0x460a46,_0x1fd811);_0x388214(_0x1fd811);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index bcfadf0..25780fe 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 _0xb6df=['./dashboardItem.events','save','remove','update','emit','removeListener','length','dashboardItem:'];(function(_0x3476cd,_0xccd22b){var _0x4875a4=function(_0x1a2bbd){while(--_0x1a2bbd){_0x3476cd['push'](_0x3476cd['shift']());}};_0x4875a4(++_0xccd22b);}(_0xb6df,0x170));var _0xfb6d=function(_0x360d0e,_0x1986e8){_0x360d0e=_0x360d0e-0x0;var _0x26f76b=_0xb6df[_0x360d0e];return _0x26f76b;};'use strict';var DashboardItemEvents=require(_0xfb6d('0x0'));var events=[_0xfb6d('0x1'),_0xfb6d('0x2'),_0xfb6d('0x3')];function createListener(_0x498c81,_0xc364a6){return function(_0x11bb8e){_0xc364a6[_0xfb6d('0x4')](_0x498c81,_0x11bb8e);};}function removeListener(_0x4f2324,_0xf2bd55){return function(){DashboardItemEvents[_0xfb6d('0x5')](_0x4f2324,_0xf2bd55);};}exports['register']=function(_0x1c4cb0){for(var _0x2ccc93=0x0,_0xb8894b=events[_0xfb6d('0x6')];_0x2ccc93<_0xb8894b;_0x2ccc93++){var _0x4e7a2a=events[_0x2ccc93];var _0x541074=createListener(_0xfb6d('0x7')+_0x4e7a2a,_0x1c4cb0);DashboardItemEvents['on'](_0x4e7a2a,_0x541074);}}; \ No newline at end of file +var _0x956f=['length','dashboardItem:','save','update','removeListener','register'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x956f,0x9e));var _0xf956=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x956f[_0x2543d6];return _0x55213c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf956('0x0'),'remove',_0xf956('0x1')];function createListener(_0x3de4da,_0xf2616){return function(_0x5e94e3){_0xf2616['emit'](_0x3de4da,_0x5e94e3);};}function removeListener(_0x42bc4e,_0x336c38){return function(){DashboardItemEvents[_0xf956('0x2')](_0x42bc4e,_0x336c38);};}exports[_0xf956('0x3')]=function(_0xf5e31e){for(var _0x559704=0x0,_0x16f566=events[_0xf956('0x4')];_0x559704<_0x16f566;_0x559704++){var _0x4ea469=events[_0x559704];var _0x389296=createListener(_0xf956('0x5')+_0x4ea469,_0xf5e31e);DashboardItemEvents['on'](_0x4ea469,_0x389296);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 6e16444..b8dd7dc 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 _0x2274=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./dashboardItem.controller','show','isAuthenticated','create','put','/:id','update','delete'];(function(_0x3b3dcb,_0x6ff907){var _0x3d43cc=function(_0x5c386b){while(--_0x5c386b){_0x3b3dcb['push'](_0x3b3dcb['shift']());}};_0x3d43cc(++_0x6ff907);}(_0x2274,0x134));var _0x4227=function(_0x357649,_0x361303){_0x357649=_0x357649-0x0;var _0xeb0f26=_0x2274[_0x357649];return _0xeb0f26;};'use strict';var multer=require(_0x4227('0x0'));var util=require(_0x4227('0x1'));var path=require(_0x4227('0x2'));var timeout=require(_0x4227('0x3'));var express=require(_0x4227('0x4'));var router=express[_0x4227('0x5')]();var fs_extra=require(_0x4227('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4227('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x4227('0x8')]);router['post']('/',auth[_0x4227('0x9')](),controller[_0x4227('0xa')]);router[_0x4227('0xb')](_0x4227('0xc'),auth['isAuthenticated'](),controller[_0x4227('0xd')]);router[_0x4227('0xe')](_0x4227('0xc'),auth[_0x4227('0x9')](),controller[_0x4227('0xf')]);module[_0x4227('0x10')]=router; \ No newline at end of file +var _0xb6a1=['update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','show','put','isAuthenticated'];(function(_0x2309fb,_0x4c7769){var _0x27aa43=function(_0x586aa5){while(--_0x586aa5){_0x2309fb['push'](_0x2309fb['shift']());}};_0x27aa43(++_0x4c7769);}(_0xb6a1,0x9c));var _0x1b6a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb6a1[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var path=require(_0x1b6a('0x2'));var timeout=require(_0x1b6a('0x3'));var express=require(_0x1b6a('0x4'));var router=express['Router']();var fs_extra=require(_0x1b6a('0x5'));var auth=require(_0x1b6a('0x6'));var interaction=require(_0x1b6a('0x7'));var config=require(_0x1b6a('0x8'));var controller=require(_0x1b6a('0x9'));router['get'](_0x1b6a('0xa'),auth['isAuthenticated'](),controller[_0x1b6a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1b6a('0xc')](_0x1b6a('0xa'),auth[_0x1b6a('0xd')](),controller[_0x1b6a('0xe')]);router[_0x1b6a('0xf')](_0x1b6a('0xa'),auth[_0x1b6a('0xd')](),controller['destroy']);module[_0x1b6a('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 89fd37f..e010c67 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 _0xe7d5=['third','sequelize','STRING','first','second'];(function(_0x431e1d,_0x4ba9e4){var _0x2f5db2=function(_0x77e90b){while(--_0x77e90b){_0x431e1d['push'](_0x431e1d['shift']());}};_0x2f5db2(++_0x4ba9e4);}(_0xe7d5,0x1aa));var _0x5e7d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xe7d5[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x5e7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x5e7d('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x5e7d('0x2'),_0x5e7d('0x3'),_0x5e7d('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x5e7d('0x1')]}}; \ No newline at end of file +var _0x6e08=['STRING','ENUM','first','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6e08,0x157));var _0x86e0=function(_0x325509,_0x108fb9){_0x325509=_0x325509-0x0;var _0x3c4f84=_0x6e08[_0x325509];return _0x3c4f84;};'use strict';var Sequelize=require('sequelize');module[_0x86e0('0x0')]={'name':{'type':Sequelize[_0x86e0('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x86e0('0x2')](_0x86e0('0x3'),'second','third'),'allowNull':![],'defaultValue':_0x86e0('0x3')},'description':{'type':Sequelize[_0x86e0('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 081aad0..a2689ca 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 _0xe292=['role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','map','Disposition','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1d75f7,_0x139d5e){var _0x307f9a=function(_0x400ae1){while(--_0x400ae1){_0x1d75f7['push'](_0x1d75f7['shift']());}};_0x307f9a(++_0x139d5e);}(_0xe292,0x19e));var _0x2e29=function(_0x441dbc,_0xeeb655){_0x441dbc=_0x441dbc-0x0;var _0x2a4376=_0xe292[_0x441dbc];return _0x2a4376;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e29('0x0'));var jsonpatch=require(_0x2e29('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2e29('0x2'));var Mustache=require(_0x2e29('0x3'));var util=require('util');var path=require('path');var sox=require(_0x2e29('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e29('0x5'));var _=require(_0x2e29('0x6'));var squel=require(_0x2e29('0x7'));var crypto=require(_0x2e29('0x8'));var jsforce=require(_0x2e29('0x9'));var deskjs=require(_0x2e29('0xa'));var toCsv=require(_0x2e29('0xb'));var querystring=require(_0x2e29('0xc'));var Papa=require(_0x2e29('0xd'));var Redis=require(_0x2e29('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2e29('0xf'));var as=require(_0x2e29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e29('0x11'))(_0x2e29('0x12'));var utils=require(_0x2e29('0x13'));var config=require(_0x2e29('0x14'));var licenseUtil=require(_0x2e29('0x15'));var db=require(_0x2e29('0x16'))['db'];function respondWithStatusCode(_0x5aef56,_0x91d02){_0x91d02=_0x91d02||0xcc;return function(_0x3e1257){if(_0x3e1257){return _0x5aef56[_0x2e29('0x17')](_0x91d02);}return _0x5aef56[_0x2e29('0x18')](_0x91d02)[_0x2e29('0x19')]();};}function respondWithResult(_0x4f92c5,_0x4b79ad){_0x4b79ad=_0x4b79ad||0xc8;return function(_0x32344b){if(_0x32344b){return _0x4f92c5[_0x2e29('0x18')](_0x4b79ad)[_0x2e29('0x1a')](_0x32344b);}};}function respondWithFilteredResult(_0x615f4d,_0x22a196){return function(_0x5dbc41){if(_0x5dbc41){var _0x5e57c2=typeof _0x22a196[_0x2e29('0x1b')]==='undefined'&&typeof _0x22a196['limit']===_0x2e29('0x1c');var _0x11bd92=_0x5dbc41[_0x2e29('0x1d')];var _0x3fe3e9=_0x5e57c2?0x0:_0x22a196[_0x2e29('0x1b')];var _0x318f4b=_0x5e57c2?_0x5dbc41[_0x2e29('0x1d')]:_0x22a196['offset']+_0x22a196['limit'];var _0x3fb2a6;if(_0x318f4b>=_0x11bd92){_0x318f4b=_0x11bd92;_0x3fb2a6=0xc8;}else{_0x3fb2a6=0xce;}_0x615f4d['status'](_0x3fb2a6);return _0x615f4d[_0x2e29('0x1e')](_0x2e29('0x1f'),_0x3fe3e9+'-'+_0x318f4b+'/'+_0x11bd92)[_0x2e29('0x1a')](_0x5dbc41);}return null;};}function patchUpdates(_0x4c31d4){return function(_0x5c4d4c){try{jsonpatch[_0x2e29('0x20')](_0x5c4d4c,_0x4c31d4,!![]);}catch(_0xe8a103){return BPromise[_0x2e29('0x21')](_0xe8a103);}return _0x5c4d4c[_0x2e29('0x22')]();};}function saveUpdates(_0x5c73c3,_0x16a485){return function(_0x1c3da0){if(_0x1c3da0){return _0x1c3da0[_0x2e29('0x23')](_0x5c73c3)[_0x2e29('0x24')](function(_0x18ed9f){return _0x18ed9f;});}return null;};}function removeEntity(_0x4d7369,_0xee5a46){return function(_0x47617c){if(_0x47617c){return _0x47617c[_0x2e29('0x25')]()[_0x2e29('0x24')](function(){var _0x32edc5=_0x47617c[_0x2e29('0x26')]({'plain':!![]});var _0x3a2713=_0x2e29('0x27');return db[_0x2e29('0x28')][_0x2e29('0x25')]({'where':{'type':_0x3a2713,'resourceId':_0x32edc5['id']}})[_0x2e29('0x24')](function(){return _0x47617c;});})['then'](function(){_0x4d7369[_0x2e29('0x18')](0xcc)[_0x2e29('0x19')]();});}};}function handleEntityNotFound(_0x367dae,_0x2b49b2){return function(_0x22ec51){if(!_0x22ec51){_0x367dae[_0x2e29('0x17')](0x194);}return _0x22ec51;};}function handleError(_0x45a6dd,_0x487e7a){_0x487e7a=_0x487e7a||0x1f4;return function(_0x3b8b61){logger[_0x2e29('0x29')](_0x3b8b61[_0x2e29('0x2a')]);if(_0x3b8b61[_0x2e29('0x2b')]){delete _0x3b8b61[_0x2e29('0x2b')];}_0x45a6dd[_0x2e29('0x18')](_0x487e7a)['send'](_0x3b8b61);};}exports[_0x2e29('0x2c')]=function(_0x3f871c,_0x5441fa){var _0x387fd0={},_0x2feb5c={},_0x4ab417={'count':0x0,'rows':[]};var _0x2ac55b=_[_0x2e29('0x2d')](db[_0x2e29('0x2e')][_0x2e29('0x2f')],function(_0x31c282){return{'name':_0x31c282['fieldName'],'type':_0x31c282[_0x2e29('0x30')][_0x2e29('0x31')]};});_0x2feb5c[_0x2e29('0x32')]=_[_0x2e29('0x2d')](_0x2ac55b,_0x2e29('0x2b'));_0x2feb5c['query']=_[_0x2e29('0x33')](_0x3f871c[_0x2e29('0x34')]);_0x2feb5c[_0x2e29('0x35')]=_[_0x2e29('0x36')](_0x2feb5c[_0x2e29('0x32')],_0x2feb5c['query']);_0x387fd0[_0x2e29('0x37')]=_[_0x2e29('0x36')](_0x2feb5c['model'],qs[_0x2e29('0x38')](_0x3f871c['query'][_0x2e29('0x38')]));_0x387fd0['attributes']=_0x387fd0[_0x2e29('0x37')]['length']?_0x387fd0['attributes']:_0x2feb5c['model'];if(!_0x3f871c[_0x2e29('0x34')][_0x2e29('0x39')](_0x2e29('0x3a'))){_0x387fd0[_0x2e29('0x3b')]=qs[_0x2e29('0x3b')](_0x3f871c[_0x2e29('0x34')][_0x2e29('0x3b')]);_0x387fd0[_0x2e29('0x1b')]=qs[_0x2e29('0x1b')](_0x3f871c[_0x2e29('0x34')][_0x2e29('0x1b')]);}_0x387fd0[_0x2e29('0x3c')]=qs[_0x2e29('0x3d')](_0x3f871c[_0x2e29('0x34')][_0x2e29('0x3d')]);_0x387fd0['where']=qs[_0x2e29('0x35')](_['pick'](_0x3f871c[_0x2e29('0x34')],_0x2feb5c['filters']),_0x2ac55b);if(_0x3f871c[_0x2e29('0x34')][_0x2e29('0x3e')]){_0x387fd0[_0x2e29('0x3f')]=_['merge'](_0x387fd0[_0x2e29('0x3f')],{'$or':_[_0x2e29('0x2d')](_0x2ac55b,function(_0x61d31b){if(_0x61d31b['type']!==_0x2e29('0x40')){var _0x325984={};_0x325984[_0x61d31b[_0x2e29('0x2b')]]={'$like':'%'+_0x3f871c[_0x2e29('0x34')][_0x2e29('0x3e')]+'%'};return _0x325984;}})});}_0x387fd0=_[_0x2e29('0x41')]({},_0x387fd0,_0x3f871c[_0x2e29('0x42')]);var _0x4b4f91={'where':_0x387fd0[_0x2e29('0x3f')]};return db[_0x2e29('0x2e')]['count'](_0x4b4f91)[_0x2e29('0x24')](function(_0x3951a5){_0x4ab417['count']=_0x3951a5;if(_0x3f871c[_0x2e29('0x34')]['includeAll']){_0x387fd0[_0x2e29('0x43')]=[{'all':!![]}];}return db[_0x2e29('0x2e')][_0x2e29('0x44')](_0x387fd0);})[_0x2e29('0x24')](function(_0x340c1a){_0x4ab417['rows']=_0x340c1a;return _0x4ab417;})[_0x2e29('0x24')](respondWithFilteredResult(_0x5441fa,_0x387fd0))[_0x2e29('0x45')](handleError(_0x5441fa,null));};exports[_0x2e29('0x46')]=function(_0x59f4f3,_0x8923f4){var _0x7fc57c={'raw':!![],'where':{'id':_0x59f4f3[_0x2e29('0x47')]['id']}},_0x593bd7={};_0x593bd7[_0x2e29('0x32')]=_[_0x2e29('0x33')](db[_0x2e29('0x2e')]['rawAttributes']);_0x593bd7[_0x2e29('0x34')]=_[_0x2e29('0x33')](_0x59f4f3['query']);_0x593bd7[_0x2e29('0x35')]=_[_0x2e29('0x36')](_0x593bd7['model'],_0x593bd7['query']);_0x7fc57c[_0x2e29('0x37')]=_[_0x2e29('0x36')](_0x593bd7[_0x2e29('0x32')],qs['fields'](_0x59f4f3[_0x2e29('0x34')]['fields']));_0x7fc57c['attributes']=_0x7fc57c[_0x2e29('0x37')][_0x2e29('0x48')]?_0x7fc57c[_0x2e29('0x37')]:_0x593bd7[_0x2e29('0x32')];if(_0x59f4f3[_0x2e29('0x34')]['includeAll']){_0x7fc57c[_0x2e29('0x43')]=[{'all':!![]}];}_0x7fc57c=_[_0x2e29('0x41')]({},_0x7fc57c,_0x59f4f3[_0x2e29('0x42')]);return db[_0x2e29('0x2e')][_0x2e29('0x49')](_0x7fc57c)[_0x2e29('0x24')](handleEntityNotFound(_0x8923f4,null))[_0x2e29('0x24')](respondWithResult(_0x8923f4,null))[_0x2e29('0x45')](handleError(_0x8923f4,null));};exports[_0x2e29('0x4a')]=function(_0xe2a0bf,_0x37d4bf){return db[_0x2e29('0x2e')][_0x2e29('0x4a')](_0xe2a0bf[_0x2e29('0x4b')],{})['then'](function(_0x3e2f17){var _0x4084fe=_0xe2a0bf[_0x2e29('0x4c')][_0x2e29('0x26')]({'plain':!![]});if(!_0x4084fe)throw new Error(_0x2e29('0x4d'));if(_0x4084fe[_0x2e29('0x4e')]==='user'){var _0x467ff9=_0x3e2f17[_0x2e29('0x26')]({'plain':!![]});var _0x1a7cad=_0x2e29('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x1a7cad,'userProfileId':_0x4084fe[_0x2e29('0x4f')]},'raw':!![]})[_0x2e29('0x24')](function(_0x3785a1){if(_0x3785a1&&_0x3785a1[_0x2e29('0x50')]===0x0){return db[_0x2e29('0x28')][_0x2e29('0x4a')]({'name':_0x467ff9[_0x2e29('0x2b')],'resourceId':_0x467ff9['id'],'type':_0x3785a1[_0x2e29('0x2b')],'sectionId':_0x3785a1['id']},{})[_0x2e29('0x24')](function(){return _0x3e2f17;});}else{return _0x3e2f17;}})[_0x2e29('0x45')](function(_0x4485a8){logger[_0x2e29('0x29')](_0x2e29('0x51'),_0x4485a8);throw _0x4485a8;});}return _0x3e2f17;})[_0x2e29('0x24')](respondWithResult(_0x37d4bf,0xc9))['catch'](handleError(_0x37d4bf,null));};exports[_0x2e29('0x23')]=function(_0x645030,_0x2fe2fa){if(_0x645030[_0x2e29('0x4b')]['id']){delete _0x645030[_0x2e29('0x4b')]['id'];}return db[_0x2e29('0x2e')][_0x2e29('0x49')]({'where':{'id':_0x645030[_0x2e29('0x47')]['id']}})[_0x2e29('0x24')](handleEntityNotFound(_0x2fe2fa,null))[_0x2e29('0x24')](saveUpdates(_0x645030['body'],null))[_0x2e29('0x24')](respondWithResult(_0x2fe2fa,null))[_0x2e29('0x45')](handleError(_0x2fe2fa,null));};exports['destroy']=function(_0x4b90d3,_0x15cd2a){return db['Disposition'][_0x2e29('0x49')]({'where':{'id':_0x4b90d3[_0x2e29('0x47')]['id']}})[_0x2e29('0x24')](handleEntityNotFound(_0x15cd2a,null))[_0x2e29('0x24')](removeEntity(_0x15cd2a,null))[_0x2e29('0x45')](handleError(_0x15cd2a,null));}; \ No newline at end of file +var _0x8bc3=['count','Content-Range','apply','reject','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','undefined'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0x8bc3,0x82));var _0x38bc=function(_0xab7655,_0x58a0b7){_0xab7655=_0xab7655-0x0;var _0x1dfa50=_0x8bc3[_0xab7655];return _0x1dfa50;};'use strict';var emlformat=require(_0x38bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38bc('0x2'));var moment=require(_0x38bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38bc('0x4'));var util=require(_0x38bc('0x5'));var path=require(_0x38bc('0x6'));var sox=require(_0x38bc('0x7'));var csv=require('to-csv');var ejs=require(_0x38bc('0x8'));var fs=require('fs');var fs_extra=require(_0x38bc('0x9'));var _=require(_0x38bc('0xa'));var squel=require(_0x38bc('0xb'));var crypto=require(_0x38bc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38bc('0xd'));var querystring=require(_0x38bc('0xe'));var Papa=require(_0x38bc('0xf'));var Redis=require(_0x38bc('0x10'));var authService=require(_0x38bc('0x11'));var qs=require(_0x38bc('0x12'));var as=require(_0x38bc('0x13'));var hardwareService=require(_0x38bc('0x14'));var logger=require(_0x38bc('0x15'))(_0x38bc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5f4b,_0x56fdcf){_0x56fdcf=_0x56fdcf||0xcc;return function(_0x486c59){if(_0x486c59){return _0x1a5f4b['sendStatus'](_0x56fdcf);}return _0x1a5f4b['status'](_0x56fdcf)[_0x38bc('0x17')]();};}function respondWithResult(_0x1a7903,_0x454eac){_0x454eac=_0x454eac||0xc8;return function(_0x5d4997){if(_0x5d4997){return _0x1a7903[_0x38bc('0x18')](_0x454eac)[_0x38bc('0x19')](_0x5d4997);}};}function respondWithFilteredResult(_0x1ff95d,_0x322c4e){return function(_0x2c223e){if(_0x2c223e){var _0x1c0cd2=typeof _0x322c4e[_0x38bc('0x1a')]===_0x38bc('0x1b')&&typeof _0x322c4e['limit']===_0x38bc('0x1b');var _0x55940b=_0x2c223e[_0x38bc('0x1c')];var _0x1f0e08=_0x1c0cd2?0x0:_0x322c4e[_0x38bc('0x1a')];var _0x30b309=_0x1c0cd2?_0x2c223e[_0x38bc('0x1c')]:_0x322c4e[_0x38bc('0x1a')]+_0x322c4e['limit'];var _0x36ccda;if(_0x30b309>=_0x55940b){_0x30b309=_0x55940b;_0x36ccda=0xc8;}else{_0x36ccda=0xce;}_0x1ff95d['status'](_0x36ccda);return _0x1ff95d['set'](_0x38bc('0x1d'),_0x1f0e08+'-'+_0x30b309+'/'+_0x55940b)[_0x38bc('0x19')](_0x2c223e);}return null;};}function patchUpdates(_0x325b14){return function(_0x19f3af){try{jsonpatch[_0x38bc('0x1e')](_0x19f3af,_0x325b14,!![]);}catch(_0x40e3b6){return BPromise[_0x38bc('0x1f')](_0x40e3b6);}return _0x19f3af['save']();};}function saveUpdates(_0x4a43c7,_0x2999b0){return function(_0x46b863){if(_0x46b863){return _0x46b863['update'](_0x4a43c7)[_0x38bc('0x20')](function(_0x5f4026){return _0x5f4026;});}return null;};}function removeEntity(_0x897a6b,_0x4251ee){return function(_0x434007){if(_0x434007){return _0x434007['destroy']()[_0x38bc('0x20')](function(){var _0xa4d246=_0x434007[_0x38bc('0x21')]({'plain':!![]});var _0x49c92d=_0x38bc('0x22');return db[_0x38bc('0x23')][_0x38bc('0x24')]({'where':{'type':_0x49c92d,'resourceId':_0xa4d246['id']}})[_0x38bc('0x20')](function(){return _0x434007;});})['then'](function(){_0x897a6b['status'](0xcc)[_0x38bc('0x17')]();});}};}function handleEntityNotFound(_0x114cc8,_0x2210ad){return function(_0x712745){if(!_0x712745){_0x114cc8['sendStatus'](0x194);}return _0x712745;};}function handleError(_0x5a4dd9,_0x50bcf6){_0x50bcf6=_0x50bcf6||0x1f4;return function(_0x456a78){logger[_0x38bc('0x25')](_0x456a78[_0x38bc('0x26')]);if(_0x456a78['name']){delete _0x456a78[_0x38bc('0x27')];}_0x5a4dd9[_0x38bc('0x18')](_0x50bcf6)['send'](_0x456a78);};}exports['index']=function(_0x14984e,_0x4b94d7){var _0x4ffc31={},_0x3d224c={},_0x3f7dc0={'count':0x0,'rows':[]};var _0x1548be=_[_0x38bc('0x28')](db[_0x38bc('0x29')]['rawAttributes'],function(_0x326012){return{'name':_0x326012[_0x38bc('0x2a')],'type':_0x326012[_0x38bc('0x2b')][_0x38bc('0x2c')]};});_0x3d224c[_0x38bc('0x2d')]=_['map'](_0x1548be,'name');_0x3d224c[_0x38bc('0x2e')]=_[_0x38bc('0x2f')](_0x14984e[_0x38bc('0x2e')]);_0x3d224c[_0x38bc('0x30')]=_[_0x38bc('0x31')](_0x3d224c[_0x38bc('0x2d')],_0x3d224c[_0x38bc('0x2e')]);_0x4ffc31['attributes']=_[_0x38bc('0x31')](_0x3d224c[_0x38bc('0x2d')],qs['fields'](_0x14984e[_0x38bc('0x2e')][_0x38bc('0x32')]));_0x4ffc31[_0x38bc('0x33')]=_0x4ffc31[_0x38bc('0x33')][_0x38bc('0x34')]?_0x4ffc31['attributes']:_0x3d224c[_0x38bc('0x2d')];if(!_0x14984e['query'][_0x38bc('0x35')](_0x38bc('0x36'))){_0x4ffc31[_0x38bc('0x37')]=qs[_0x38bc('0x37')](_0x14984e[_0x38bc('0x2e')][_0x38bc('0x37')]);_0x4ffc31[_0x38bc('0x1a')]=qs[_0x38bc('0x1a')](_0x14984e['query'][_0x38bc('0x1a')]);}_0x4ffc31[_0x38bc('0x38')]=qs[_0x38bc('0x39')](_0x14984e['query']['sort']);_0x4ffc31[_0x38bc('0x3a')]=qs[_0x38bc('0x30')](_[_0x38bc('0x3b')](_0x14984e[_0x38bc('0x2e')],_0x3d224c[_0x38bc('0x30')]),_0x1548be);if(_0x14984e[_0x38bc('0x2e')][_0x38bc('0x3c')]){_0x4ffc31[_0x38bc('0x3a')]=_['merge'](_0x4ffc31[_0x38bc('0x3a')],{'$or':_['map'](_0x1548be,function(_0x10377e){if(_0x10377e[_0x38bc('0x2b')]!==_0x38bc('0x3d')){var _0x17ccf3={};_0x17ccf3[_0x10377e[_0x38bc('0x27')]]={'$like':'%'+_0x14984e['query'][_0x38bc('0x3c')]+'%'};return _0x17ccf3;}})});}_0x4ffc31=_[_0x38bc('0x3e')]({},_0x4ffc31,_0x14984e[_0x38bc('0x3f')]);var _0x199cae={'where':_0x4ffc31[_0x38bc('0x3a')]};return db[_0x38bc('0x29')][_0x38bc('0x1c')](_0x199cae)[_0x38bc('0x20')](function(_0x2d1b29){_0x3f7dc0[_0x38bc('0x1c')]=_0x2d1b29;if(_0x14984e['query'][_0x38bc('0x40')]){_0x4ffc31[_0x38bc('0x41')]=[{'all':!![]}];}return db[_0x38bc('0x29')]['findAll'](_0x4ffc31);})['then'](function(_0x29c5ab){_0x3f7dc0[_0x38bc('0x42')]=_0x29c5ab;return _0x3f7dc0;})['then'](respondWithFilteredResult(_0x4b94d7,_0x4ffc31))[_0x38bc('0x43')](handleError(_0x4b94d7,null));};exports[_0x38bc('0x44')]=function(_0x3b049a,_0xb70c91){var _0x705f3f={'raw':!![],'where':{'id':_0x3b049a['params']['id']}},_0x13e074={};_0x13e074[_0x38bc('0x2d')]=_[_0x38bc('0x2f')](db[_0x38bc('0x29')][_0x38bc('0x45')]);_0x13e074[_0x38bc('0x2e')]=_['keys'](_0x3b049a[_0x38bc('0x2e')]);_0x13e074[_0x38bc('0x30')]=_[_0x38bc('0x31')](_0x13e074['model'],_0x13e074[_0x38bc('0x2e')]);_0x705f3f['attributes']=_[_0x38bc('0x31')](_0x13e074['model'],qs[_0x38bc('0x32')](_0x3b049a[_0x38bc('0x2e')][_0x38bc('0x32')]));_0x705f3f[_0x38bc('0x33')]=_0x705f3f['attributes'][_0x38bc('0x34')]?_0x705f3f['attributes']:_0x13e074[_0x38bc('0x2d')];if(_0x3b049a[_0x38bc('0x2e')][_0x38bc('0x40')]){_0x705f3f[_0x38bc('0x41')]=[{'all':!![]}];}_0x705f3f=_[_0x38bc('0x3e')]({},_0x705f3f,_0x3b049a[_0x38bc('0x3f')]);return db[_0x38bc('0x29')][_0x38bc('0x46')](_0x705f3f)[_0x38bc('0x20')](handleEntityNotFound(_0xb70c91,null))['then'](respondWithResult(_0xb70c91,null))[_0x38bc('0x43')](handleError(_0xb70c91,null));};exports[_0x38bc('0x47')]=function(_0x548e79,_0x193c4f){return db['Disposition'][_0x38bc('0x47')](_0x548e79[_0x38bc('0x48')],{})[_0x38bc('0x20')](function(_0x33b186){var _0x56d4c0=_0x548e79[_0x38bc('0x49')]['get']({'plain':!![]});if(!_0x56d4c0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56d4c0[_0x38bc('0x4a')]===_0x38bc('0x49')){var _0x130f01=_0x33b186[_0x38bc('0x21')]({'plain':!![]});var _0x4232ad=_0x38bc('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x4232ad,'userProfileId':_0x56d4c0[_0x38bc('0x4b')]},'raw':!![]})[_0x38bc('0x20')](function(_0x583a68){if(_0x583a68&&_0x583a68[_0x38bc('0x4c')]===0x0){return db[_0x38bc('0x23')][_0x38bc('0x47')]({'name':_0x130f01['name'],'resourceId':_0x130f01['id'],'type':_0x583a68['name'],'sectionId':_0x583a68['id']},{})[_0x38bc('0x20')](function(){return _0x33b186;});}else{return _0x33b186;}})[_0x38bc('0x43')](function(_0x4891c4){logger[_0x38bc('0x25')](_0x38bc('0x4d'),_0x4891c4);throw _0x4891c4;});}return _0x33b186;})['then'](respondWithResult(_0x193c4f,0xc9))['catch'](handleError(_0x193c4f,null));};exports['update']=function(_0x55e566,_0x41b7e4){if(_0x55e566['body']['id']){delete _0x55e566[_0x38bc('0x48')]['id'];}return db[_0x38bc('0x29')][_0x38bc('0x46')]({'where':{'id':_0x55e566['params']['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x41b7e4,null))[_0x38bc('0x20')](saveUpdates(_0x55e566[_0x38bc('0x48')],null))['then'](respondWithResult(_0x41b7e4,null))['catch'](handleError(_0x41b7e4,null));};exports['destroy']=function(_0xd22c06,_0x1ab736){return db[_0x38bc('0x29')]['find']({'where':{'id':_0xd22c06[_0x38bc('0x4e')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x1ab736,null))['then'](removeEntity(_0x1ab736,null))['catch'](handleError(_0x1ab736,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index bcb4118..714d993 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 _0x7ef2=['exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','SmsAccountId','name_fax','name_whatsapp','WhatsappAccountId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x119b41,_0x33b045){var _0x3f181e=function(_0xb408d6){while(--_0xb408d6){_0x119b41['push'](_0x119b41['shift']());}};_0x3f181e(++_0x33b045);}(_0x7ef2,0xe9));var _0x27ef=function(_0x38c564,_0x3d99fa){_0x38c564=_0x38c564-0x0;var _0x21f1d1=_0x7ef2[_0x38c564];return _0x21f1d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x27ef('0x0'))(_0x27ef('0x1'));var moment=require(_0x27ef('0x2'));var BPromise=require(_0x27ef('0x3'));var rp=require(_0x27ef('0x4'));var fs=require('fs');var path=require(_0x27ef('0x5'));var rimraf=require(_0x27ef('0x6'));var config=require(_0x27ef('0x7'));var attributes=require(_0x27ef('0x8'));module[_0x27ef('0x9')]=function(_0x419882,_0xd25fa6){return _0x419882[_0x27ef('0xa')](_0x27ef('0xb'),attributes,{'tableName':_0x27ef('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x27ef('0xd'),'fields':[_0x27ef('0xe'),_0x27ef('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0x27ef('0xe'),_0x27ef('0x10')]},{'unique':!![],'name':'name_mail','fields':['name',_0x27ef('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x27ef('0xe'),_0x27ef('0x12')]},{'unique':!![],'name':_0x27ef('0x13'),'fields':[_0x27ef('0xe'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x27ef('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0x27ef('0x14'),'fields':[_0x27ef('0xe'),_0x27ef('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6620=['MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','api','request-promise','path','../../config/environment','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId'];(function(_0xcddf79,_0x4afb8c){var _0x30a38a=function(_0x2d1eb5){while(--_0x2d1eb5){_0xcddf79['push'](_0xcddf79['shift']());}};_0x30a38a(++_0x4afb8c);}(_0x6620,0x1eb));var _0x0662=function(_0x3965fc,_0x549b6c){_0x3965fc=_0x3965fc-0x0;var _0x4608f5=_0x6620[_0x3965fc];return _0x4608f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0662('0x0'))(_0x0662('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0662('0x2'));var fs=require('fs');var path=require(_0x0662('0x3'));var rimraf=require('rimraf');var config=require(_0x0662('0x4'));var attributes=require('./disposition.attributes');module['exports']=function(_0x7c4cc3,_0x56150b){return _0x7c4cc3[_0x0662('0x5')](_0x0662('0x6'),attributes,{'tableName':_0x0662('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0662('0x8'),'fields':[_0x0662('0x9'),_0x0662('0xa')]},{'unique':!![],'name':_0x0662('0xb'),'fields':[_0x0662('0x9'),_0x0662('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0x0662('0x9'),_0x0662('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0x0662('0x9'),_0x0662('0xe')]},{'unique':!![],'name':_0x0662('0xf'),'fields':[_0x0662('0x9'),_0x0662('0x10')]},{'unique':!![],'name':_0x0662('0x11'),'fields':[_0x0662('0x9'),_0x0662('0x12')]},{'unique':!![],'name':_0x0662('0x13'),'fields':[_0x0662('0x9'),_0x0662('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 6616c43..a05f46c 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(_0x24b153,_0x3498c4){var _0x12f2e5=function(_0x399517){while(--_0x399517){_0x24b153['push'](_0x24b153['shift']());}};_0x12f2e5(++_0x3498c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x336358,_0x44a1b4){var _0x103794=function(_0x5b1502){while(--_0x5b1502){_0x336358['push'](_0x336358['shift']());}};_0x103794(++_0x44a1b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 9945fe3..e2847e0 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 _0x4016=['create','update','util','path','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','post','isAuthenticated'];(function(_0x220d1a,_0x31f1e3){var _0x4f0fe3=function(_0x45d6b7){while(--_0x45d6b7){_0x220d1a['push'](_0x220d1a['shift']());}};_0x4f0fe3(++_0x31f1e3);}(_0x4016,0x1a2));var _0x6401=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4016[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x6401('0x0'));var path=require(_0x6401('0x1'));var timeout=require(_0x6401('0x2'));var express=require(_0x6401('0x3'));var router=express[_0x6401('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6401('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x6401('0x6')]('/',auth['isAuthenticated'](),controller[_0x6401('0x7')]);router[_0x6401('0x6')](_0x6401('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x6401('0x9')]('/',auth[_0x6401('0xa')](),controller[_0x6401('0xb')]);router['put'](_0x6401('0x8'),auth[_0x6401('0xa')](),controller[_0x6401('0xc')]);router['delete'](_0x6401('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3e66=['destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e66,0x122));var _0x63e6=function(_0x1964c9,_0x486de4){_0x1964c9=_0x1964c9-0x0;var _0x21a2c7=_0x3e66[_0x1964c9];return _0x21a2c7;};'use strict';var multer=require('multer');var util=require(_0x63e6('0x0'));var path=require('path');var timeout=require(_0x63e6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x63e6('0x2'));var interaction=require(_0x63e6('0x3'));var config=require(_0x63e6('0x4'));var controller=require(_0x63e6('0x5'));router[_0x63e6('0x6')]('/',auth[_0x63e6('0x7')](),controller[_0x63e6('0x8')]);router['get']('/:id',auth[_0x63e6('0x7')](),controller[_0x63e6('0x9')]);router[_0x63e6('0xa')]('/',auth[_0x63e6('0x7')](),controller[_0x63e6('0xb')]);router[_0x63e6('0xc')](_0x63e6('0xd'),auth[_0x63e6('0x7')](),controller[_0x63e6('0xe')]);router[_0x63e6('0xf')]('/:id',auth[_0x63e6('0x7')](),controller[_0x63e6('0x10')]);module[_0x63e6('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index cdef974..d7f5ad1 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 _0x5ce9=['sequelize','exports','ENUM','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x8f93a,_0x5ca8d5){var _0x17c7d7=function(_0x39bb70){while(--_0x39bb70){_0x8f93a['push'](_0x8f93a['shift']());}};_0x17c7d7(++_0x5ca8d5);}(_0x5ce9,0x177));var _0x95ce=function(_0x392514,_0x3a7394){_0x392514=_0x392514-0x0;var _0x368e5e=_0x5ce9[_0x392514];return _0x368e5e;};'use strict';var Sequelize=require(_0x95ce('0x0'));module[_0x95ce('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x95ce('0x2')](_0x95ce('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x95ce('0x4')],'defaultValue':_0x95ce('0x5')},'localstationid':{'type':Sequelize[_0x95ce('0x4')],'unique':_0x95ce('0x6')},'minrate':{'type':Sequelize[_0x95ce('0x2')](_0x95ce('0x7'),_0x95ce('0x8'),_0x95ce('0x9'),_0x95ce('0xa'),_0x95ce('0xb'),_0x95ce('0xc')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x95ce('0x7'),_0x95ce('0x8'),_0x95ce('0x9'),'9600',_0x95ce('0xb'),'14400'),'defaultValue':_0x95ce('0xc')},'modem':{'type':Sequelize[_0x95ce('0x4')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x95ce('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x95ce('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x95ce('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x95ce('0x2')](_0x95ce('0xe'),_0x95ce('0xf'),_0x95ce('0x10'),_0x95ce('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x95ce('0x12')],'defaultValue':function(){return _0x95ce('0x13');}},'notificationSound':{'type':Sequelize[_0x95ce('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x95ce('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x95ce('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x95ce('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x95ce('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x95ce('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x95ce('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x95ce('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x95ce('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4827f7){if(!_0x4827f7)this[_0x95ce('0x16')](_0x95ce('0x17'),null);this[_0x95ce('0x16')](_0x95ce('0x18'),_0x4827f7);}}}; \ No newline at end of file +var _0x201e=['9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200'];(function(_0x68b997,_0x25a390){var _0x5b5085=function(_0x3c9879){while(--_0x3c9879){_0x68b997['push'](_0x68b997['shift']());}};_0x5b5085(++_0x25a390);}(_0x201e,0xd8));var _0xe201=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x201e[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require(_0xe201('0x0'));module[_0xe201('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe201('0x2')]},'ecm':{'type':Sequelize[_0xe201('0x3')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xe201('0x4')},'localstationid':{'type':Sequelize[_0xe201('0x2')],'unique':_0xe201('0x5')},'minrate':{'type':Sequelize[_0xe201('0x3')](_0xe201('0x6'),_0xe201('0x7'),_0xe201('0x8'),_0xe201('0x9'),_0xe201('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xe201('0x3')](_0xe201('0x6'),_0xe201('0x7'),_0xe201('0x8'),_0xe201('0x9'),_0xe201('0xa'),'14400'),'defaultValue':_0xe201('0xb')},'modem':{'type':Sequelize[_0xe201('0x2')],'defaultValue':_0xe201('0xc')},'gateway':{'type':Sequelize[_0xe201('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe201('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe201('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xe201('0xe'),_0xe201('0xf'),_0xe201('0x10'),'KHOMP'),'defaultValue':_0xe201('0xe')},'key':{'type':Sequelize[_0xe201('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe201('0x11')],'defaultValue':function(){return _0xe201('0x12');}},'notificationSound':{'type':Sequelize[_0xe201('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe201('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe201('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe201('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe201('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe201('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe201('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xe201('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xe201('0x13')],'defaultValue':![],'comment':_0xe201('0x15'),'set':function(_0x22203e){if(!_0x22203e)this['setDataValue'](_0xe201('0x16'),null);this[_0xe201('0x17')](_0xe201('0x18'),_0x22203e);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ab15f84..21d4df8 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 _0x56f9=['removeAgents','isArray','emit','userFaxAccount:remove','User','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','request','then','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','rawAttributes','intersection','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','params','describe','Disposition','getDispositions','findOne','nolimit','order','FaxAccountId','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tags','color','tag','sequelize','FaxApplication','priority','getApplications','exten','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','tech','updatedAt','TrunkId','getMessages','FaxMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save'];(function(_0x5cf5be,_0x59aeb2){var _0x53dcbf=function(_0x205e1c){while(--_0x205e1c){_0x5cf5be['push'](_0x5cf5be['shift']());}};_0x53dcbf(++_0x59aeb2);}(_0x56f9,0xc1));var _0x956f=function(_0x26ae8e,_0x53003e){_0x26ae8e=_0x26ae8e-0x0;var _0x22f5a8=_0x56f9[_0x26ae8e];return _0x22f5a8;};'use strict';var emlformat=require(_0x956f('0x0'));var rimraf=require(_0x956f('0x1'));var zipdir=require(_0x956f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x956f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x956f('0x4'));var path=require(_0x956f('0x5'));var sox=require(_0x956f('0x6'));var csv=require(_0x956f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x956f('0x8'));var _=require(_0x956f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x956f('0xa'));var deskjs=require(_0x956f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x956f('0xc'));var Papa=require(_0x956f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x956f('0xe'));var hardwareService=require(_0x956f('0xf'));var logger=require(_0x956f('0x10'))(_0x956f('0x11'));var utils=require(_0x956f('0x12'));var config=require(_0x956f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x956f('0x14'))['db'];config[_0x956f('0x15')]=_[_0x956f('0x16')](config['redis'],{'host':_0x956f('0x17'),'port':0x18eb});var socket=require(_0x956f('0x18'))(new Redis(config['redis']));require(_0x956f('0x19'))['register'](socket);var jayson=require(_0x956f('0x1a'));var client=jayson['client'][_0x956f('0x1b')]({'port':0x232c});var client9002=jayson[_0x956f('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14cdf5,_0x3c9779,_0x3236c0,_0x3a62a7){return new BPromise(function(_0x36e9f0,_0xaecb4d){var _0xaaf8aa=_0x3a62a7||client;return _0xaaf8aa[_0x956f('0x1d')](_0x14cdf5,_0x3236c0)[_0x956f('0x1e')](function(_0x2ebc5f){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3c9779,_0x956f('0x1f'));logger[_0x956f('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3c9779,_0x956f('0x1f'),JSON[_0x956f('0x21')](_0x2ebc5f));if(_0x2ebc5f[_0x956f('0x22')]){if(_0x2ebc5f[_0x956f('0x22')][_0x956f('0x23')]===0x1f4){logger[_0x956f('0x22')](_0x956f('0x24'),_0x3c9779,_0x2ebc5f[_0x956f('0x22')][_0x956f('0x25')]);return _0xaecb4d(_0x2ebc5f[_0x956f('0x22')][_0x956f('0x25')]);}logger[_0x956f('0x22')](_0x956f('0x24'),_0x3c9779,_0x2ebc5f[_0x956f('0x22')][_0x956f('0x25')]);return _0x36e9f0(_0x2ebc5f[_0x956f('0x22')][_0x956f('0x25')]);}else{logger[_0x956f('0x26')]('FaxAccount,\x20%s,\x20%s',_0x3c9779,_0x956f('0x1f'));_0x36e9f0(_0x2ebc5f[_0x956f('0x27')]['message']);}})['catch'](function(_0x274a16){logger[_0x956f('0x22')](_0x956f('0x24'),_0x3c9779,_0x274a16);_0xaecb4d(_0x274a16);});});}function respondWithStatusCode(_0x472972,_0x4cfd5c){_0x4cfd5c=_0x4cfd5c||0xcc;return function(_0x5dc2de){if(_0x5dc2de){return _0x472972[_0x956f('0x28')](_0x4cfd5c);}return _0x472972[_0x956f('0x29')](_0x4cfd5c)[_0x956f('0x2a')]();};}function respondWithResult(_0x31ceae,_0x4a173e){_0x4a173e=_0x4a173e||0xc8;return function(_0x252e3e){if(_0x252e3e){return _0x31ceae[_0x956f('0x29')](_0x4a173e)[_0x956f('0x2b')](_0x252e3e);}};}function respondWithFilteredResult(_0x1a751b,_0xb8eeed){return function(_0x150821){if(_0x150821){var _0xf59ca9=typeof _0xb8eeed['offset']===_0x956f('0x2c')&&typeof _0xb8eeed['limit']==='undefined';var _0x344a2f=_0x150821[_0x956f('0x2d')];var _0x117ba6=_0xf59ca9?0x0:_0xb8eeed[_0x956f('0x2e')];var _0x2bd392=_0xf59ca9?_0x150821[_0x956f('0x2d')]:_0xb8eeed[_0x956f('0x2e')]+_0xb8eeed[_0x956f('0x2f')];var _0x1a78fe;if(_0x2bd392>=_0x344a2f){_0x2bd392=_0x344a2f;_0x1a78fe=0xc8;}else{_0x1a78fe=0xce;}_0x1a751b[_0x956f('0x29')](_0x1a78fe);return _0x1a751b['set'](_0x956f('0x30'),_0x117ba6+'-'+_0x2bd392+'/'+_0x344a2f)[_0x956f('0x2b')](_0x150821);}return null;};}function patchUpdates(_0x2f3839){return function(_0x15836b){try{jsonpatch[_0x956f('0x31')](_0x15836b,_0x2f3839,!![]);}catch(_0x521d32){return BPromise[_0x956f('0x32')](_0x521d32);}return _0x15836b[_0x956f('0x33')]();};}function saveUpdates(_0x5ad9de,_0x520595){return function(_0x5c8eb3){if(_0x5c8eb3){return _0x5c8eb3[_0x956f('0x34')](_0x5ad9de)[_0x956f('0x1e')](function(_0xe4fa62){return _0xe4fa62;});}return null;};}function removeEntity(_0x4ad083,_0x108a17){return function(_0x5e77fd){if(_0x5e77fd){return _0x5e77fd[_0x956f('0x35')]()[_0x956f('0x1e')](function(){var _0x3683ea=_0x5e77fd[_0x956f('0x36')]({'plain':!![]});var _0x1e7a94=_0x956f('0x37');return db[_0x956f('0x38')][_0x956f('0x35')]({'where':{'type':_0x1e7a94,'resourceId':_0x3683ea['id']}})[_0x956f('0x1e')](function(){return _0x5e77fd;});})[_0x956f('0x1e')](function(){_0x4ad083[_0x956f('0x29')](0xcc)[_0x956f('0x2a')]();});}};}function handleEntityNotFound(_0x35f6c8,_0xed4022){return function(_0x2f0d97){if(!_0x2f0d97){_0x35f6c8[_0x956f('0x28')](0x194);}return _0x2f0d97;};}function handleError(_0x3151f2,_0x8a2c15){_0x8a2c15=_0x8a2c15||0x1f4;return function(_0x1378c8){logger[_0x956f('0x22')](_0x1378c8[_0x956f('0x39')]);if(_0x1378c8['name']){delete _0x1378c8['name'];}_0x3151f2['status'](_0x8a2c15)[_0x956f('0x3a')](_0x1378c8);};}exports[_0x956f('0x3b')]=function(_0x373f69,_0x56f8be){var _0x1f1e4e={'include':[{'model':db[_0x956f('0x3c')],'as':_0x956f('0x3d')}]},_0x411bc8={},_0xa9642b={'count':0x0,'rows':[]};var _0x2cc4bc=_[_0x956f('0x3e')](db[_0x956f('0x3f')]['rawAttributes'],function(_0x492b5b){return{'name':_0x492b5b[_0x956f('0x40')],'type':_0x492b5b[_0x956f('0x41')][_0x956f('0x42')]};});_0x411bc8[_0x956f('0x43')]=_[_0x956f('0x3e')](_0x2cc4bc,_0x956f('0x44'));_0x411bc8[_0x956f('0x45')]=_[_0x956f('0x46')](_0x373f69[_0x956f('0x45')]);_0x411bc8[_0x956f('0x47')]=_['intersection'](_0x411bc8[_0x956f('0x43')],_0x411bc8['query']);_0x1f1e4e[_0x956f('0x48')]=_['intersection'](_0x411bc8[_0x956f('0x43')],qs[_0x956f('0x49')](_0x373f69[_0x956f('0x45')][_0x956f('0x49')]));_0x1f1e4e[_0x956f('0x48')]=_0x1f1e4e['attributes'][_0x956f('0x4a')]?_0x1f1e4e[_0x956f('0x48')]:_0x411bc8[_0x956f('0x43')];if(!_0x373f69['query'][_0x956f('0x4b')]('nolimit')){_0x1f1e4e[_0x956f('0x2f')]=qs[_0x956f('0x2f')](_0x373f69[_0x956f('0x45')][_0x956f('0x2f')]);_0x1f1e4e['offset']=qs['offset'](_0x373f69[_0x956f('0x45')][_0x956f('0x2e')]);}_0x1f1e4e['order']=qs[_0x956f('0x4c')](_0x373f69[_0x956f('0x45')][_0x956f('0x4c')]);_0x1f1e4e[_0x956f('0x4d')]=qs[_0x956f('0x47')](_[_0x956f('0x4e')](_0x373f69['query'],_0x411bc8[_0x956f('0x47')]),_0x2cc4bc);if(_0x373f69[_0x956f('0x45')][_0x956f('0x4f')]){_0x1f1e4e[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x1f1e4e[_0x956f('0x4d')],{'$or':_[_0x956f('0x3e')](_0x2cc4bc,function(_0x342270){if(_0x342270[_0x956f('0x41')]!=='VIRTUAL'){var _0x4a09f6={};_0x4a09f6[_0x342270[_0x956f('0x44')]]={'$like':'%'+_0x373f69[_0x956f('0x45')]['filter']+'%'};return _0x4a09f6;}})});}_0x1f1e4e=_[_0x956f('0x50')]({},_0x1f1e4e,_0x373f69[_0x956f('0x51')]);var _0x3d28db={'where':_0x1f1e4e[_0x956f('0x4d')]};return db[_0x956f('0x3f')][_0x956f('0x2d')](_0x3d28db)[_0x956f('0x1e')](function(_0x20ca51){_0xa9642b[_0x956f('0x2d')]=_0x20ca51;if(_0x373f69[_0x956f('0x45')][_0x956f('0x52')]){_0x1f1e4e[_0x956f('0x53')]=[{'all':!![]}];}return db['FaxAccount'][_0x956f('0x54')](_0x1f1e4e);})['then'](function(_0x57b231){_0xa9642b['rows']=_0x57b231;return _0xa9642b;})[_0x956f('0x1e')](respondWithFilteredResult(_0x56f8be,_0x1f1e4e))[_0x956f('0x55')](handleError(_0x56f8be,null));};exports['show']=function(_0x10aaac,_0x41648c){var _0x36f985={'raw':![],'where':{'id':_0x10aaac['params']['id']},'include':[{'model':db[_0x956f('0x3c')],'as':_0x956f('0x3d')}]},_0x23f87f={};_0x23f87f[_0x956f('0x43')]=_['keys'](db[_0x956f('0x3f')][_0x956f('0x56')]);_0x23f87f['query']=_[_0x956f('0x46')](_0x10aaac[_0x956f('0x45')]);_0x23f87f['filters']=_[_0x956f('0x57')](_0x23f87f[_0x956f('0x43')],_0x23f87f[_0x956f('0x45')]);_0x36f985[_0x956f('0x48')]=_['intersection'](_0x23f87f[_0x956f('0x43')],qs['fields'](_0x10aaac[_0x956f('0x45')][_0x956f('0x49')]));_0x36f985[_0x956f('0x48')]=_0x36f985[_0x956f('0x48')][_0x956f('0x4a')]?_0x36f985[_0x956f('0x48')]:_0x23f87f['model'];if(_0x10aaac['query'][_0x956f('0x52')]){_0x36f985[_0x956f('0x53')]=[{'all':!![]}];}_0x36f985=_[_0x956f('0x50')]({},_0x36f985,_0x10aaac[_0x956f('0x51')]);return db[_0x956f('0x3f')][_0x956f('0x58')](_0x36f985)[_0x956f('0x1e')](handleEntityNotFound(_0x41648c,null))[_0x956f('0x1e')](respondWithResult(_0x41648c,null))['catch'](handleError(_0x41648c,null));};exports[_0x956f('0x59')]=function(_0x33b84d,_0x186821){return db['FaxAccount'][_0x956f('0x59')](_0x33b84d[_0x956f('0x5a')],{})[_0x956f('0x1e')](function(_0x53bc40){var _0x3f6763=_0x33b84d[_0x956f('0x5b')][_0x956f('0x36')]({'plain':!![]});if(!_0x3f6763)throw new Error(_0x956f('0x5c'));if(_0x3f6763[_0x956f('0x5d')]===_0x956f('0x5b')){var _0x3b8306=_0x53bc40[_0x956f('0x36')]({'plain':!![]});var _0x4ea830=_0x956f('0x37');return db[_0x956f('0x5e')][_0x956f('0x58')]({'where':{'name':_0x4ea830,'userProfileId':_0x3f6763[_0x956f('0x5f')]},'raw':!![]})['then'](function(_0x564ac4){if(_0x564ac4&&_0x564ac4[_0x956f('0x60')]===0x0){return db[_0x956f('0x38')]['create']({'name':_0x3b8306[_0x956f('0x44')],'resourceId':_0x3b8306['id'],'type':_0x564ac4['name'],'sectionId':_0x564ac4['id']},{})['then'](function(){return _0x53bc40;});}else{return _0x53bc40;}})[_0x956f('0x55')](function(_0x4bf438){logger['error'](_0x956f('0x61'),_0x4bf438);throw _0x4bf438;});}return _0x53bc40;})[_0x956f('0x1e')](respondWithResult(_0x186821,0xc9))[_0x956f('0x55')](handleError(_0x186821,null));};exports[_0x956f('0x34')]=function(_0x4d90d4,_0x560d4a){if(_0x4d90d4[_0x956f('0x5a')]['id']){delete _0x4d90d4[_0x956f('0x5a')]['id'];}return db[_0x956f('0x3f')][_0x956f('0x58')]({'where':{'id':_0x4d90d4[_0x956f('0x62')]['id']},'include':[{'model':db[_0x956f('0x3c')],'as':_0x956f('0x3d')}]})[_0x956f('0x1e')](handleEntityNotFound(_0x560d4a,null))['then'](saveUpdates(_0x4d90d4[_0x956f('0x5a')],null))[_0x956f('0x1e')](respondWithResult(_0x560d4a,null))[_0x956f('0x55')](handleError(_0x560d4a,null));};exports[_0x956f('0x35')]=function(_0x5a2193,_0x3cc3ab){return db['FaxAccount'][_0x956f('0x58')]({'where':{'id':_0x5a2193[_0x956f('0x62')]['id']}})['then'](handleEntityNotFound(_0x3cc3ab,null))[_0x956f('0x1e')](removeEntity(_0x3cc3ab,null))[_0x956f('0x55')](handleError(_0x3cc3ab,null));};exports[_0x956f('0x63')]=function(_0x449c1f,_0x23277c){return db[_0x956f('0x3f')][_0x956f('0x63')]()[_0x956f('0x1e')](respondWithResult(_0x23277c,null))[_0x956f('0x55')](handleError(_0x23277c,null));};exports['addDisposition']=function(_0x4172e4,_0x28c251,_0x25268b){if(_0x4172e4[_0x956f('0x5a')]['id']){delete _0x4172e4['body']['id'];}return db['FaxAccount'][_0x956f('0x58')]({'where':{'id':_0x4172e4[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x28c251,null))[_0x956f('0x1e')](function(_0x3aca2c){if(_0x3aca2c){_0x4172e4[_0x956f('0x5a')]['FaxAccountId']=_0x3aca2c['id'];return db[_0x956f('0x64')][_0x956f('0x59')](_0x4172e4[_0x956f('0x5a')]);}})[_0x956f('0x1e')](respondWithResult(_0x28c251,null))['catch'](handleError(_0x28c251,null));};exports[_0x956f('0x65')]=function(_0x197bd5,_0x5e6e30,_0x31cfe6){var _0x55396c={'raw':![],'where':{}};var _0x3085d7={};var _0x554b0b={'count':0x0,'rows':[]};return db['FaxAccount'][_0x956f('0x66')]({'where':{'id':_0x197bd5[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x5e6e30,null))[_0x956f('0x1e')](function(_0x2e29a2){if(_0x2e29a2){_0x3085d7['model']=_['keys'](db[_0x956f('0x64')]['rawAttributes']);_0x3085d7[_0x956f('0x45')]=_[_0x956f('0x46')](_0x197bd5[_0x956f('0x45')]);_0x3085d7['filters']=_[_0x956f('0x57')](_0x3085d7['model'],_0x3085d7[_0x956f('0x45')]);_0x55396c[_0x956f('0x48')]=_[_0x956f('0x57')](_0x3085d7[_0x956f('0x43')],qs[_0x956f('0x49')](_0x197bd5['query']['fields']));_0x55396c['attributes']=_0x55396c['attributes'][_0x956f('0x4a')]?_0x55396c['attributes']:_0x3085d7[_0x956f('0x43')];if(!_0x197bd5[_0x956f('0x45')][_0x956f('0x4b')](_0x956f('0x67'))){_0x55396c[_0x956f('0x2f')]=qs['limit'](_0x197bd5[_0x956f('0x45')]['limit']);_0x55396c['offset']=qs['offset'](_0x197bd5[_0x956f('0x45')][_0x956f('0x2e')]);}_0x55396c[_0x956f('0x68')]=qs[_0x956f('0x4c')](_0x197bd5['query'][_0x956f('0x4c')]);_0x55396c[_0x956f('0x4d')]=qs[_0x956f('0x47')](_[_0x956f('0x4e')](_0x197bd5[_0x956f('0x45')],_0x3085d7['filters']));_0x55396c[_0x956f('0x4d')][_0x956f('0x69')]=_0x2e29a2['id'];if(_0x197bd5['query'][_0x956f('0x4f')]){_0x55396c[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x55396c['where'],{'$or':_[_0x956f('0x3e')](_0x55396c[_0x956f('0x48')],function(_0x304e3c){var _0x1987fb={};_0x1987fb[_0x304e3c]={'$like':'%'+_0x197bd5[_0x956f('0x45')]['filter']+'%'};return _0x1987fb;})});}_0x55396c=_[_0x956f('0x50')]({},_0x55396c,_0x197bd5[_0x956f('0x51')]);return db[_0x956f('0x64')]['count']({'where':_0x55396c[_0x956f('0x4d')]})['then'](function(_0xa962da){_0x554b0b[_0x956f('0x2d')]=_0xa962da;if(_0x197bd5[_0x956f('0x45')]['includeAll']){_0x55396c[_0x956f('0x53')]=[{'all':!![]}];}return db[_0x956f('0x64')][_0x956f('0x54')](_0x55396c);})[_0x956f('0x1e')](function(_0x1ace4b){_0x554b0b['rows']=_0x1ace4b;return _0x554b0b;});}})[_0x956f('0x1e')](respondWithFilteredResult(_0x5e6e30,_0x55396c))[_0x956f('0x55')](handleError(_0x5e6e30,null));};exports['removeDispositions']=function(_0x4da2e1,_0x268f19,_0x3f170c){return db[_0x956f('0x3f')][_0x956f('0x58')]({'where':{'id':_0x4da2e1['params']['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x268f19,null))[_0x956f('0x1e')](function(_0xbffcec){if(_0xbffcec){return _0xbffcec['removeDispositions'](_0x4da2e1['query'][_0x956f('0x6a')]);}})[_0x956f('0x1e')](respondWithStatusCode(_0x268f19,null))['catch'](handleError(_0x268f19,null));};exports[_0x956f('0x6b')]=function(_0x383076,_0x84a866,_0x178719){if(_0x383076['body']['id']){delete _0x383076['body']['id'];}return db[_0x956f('0x3f')][_0x956f('0x58')]({'where':{'id':_0x383076['params']['id']}})['then'](handleEntityNotFound(_0x84a866,null))[_0x956f('0x1e')](function(_0x1e4ce5){if(_0x1e4ce5){_0x383076[_0x956f('0x5a')][_0x956f('0x69')]=_0x1e4ce5['id'];return db[_0x956f('0x6c')][_0x956f('0x59')](_0x383076[_0x956f('0x5a')]);}})['then'](respondWithResult(_0x84a866,null))[_0x956f('0x55')](handleError(_0x84a866,null));};exports[_0x956f('0x6d')]=function(_0x49b7ec,_0x12022e,_0x15ebbd){var _0x1b88ab={'raw':![],'where':{}};var _0xe40de1={};var _0x293f16={'count':0x0,'rows':[]};return db[_0x956f('0x3f')]['findOne']({'where':{'id':_0x49b7ec['params']['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x12022e,null))[_0x956f('0x1e')](function(_0x7e4bd5){if(_0x7e4bd5){_0xe40de1[_0x956f('0x43')]=_[_0x956f('0x46')](db[_0x956f('0x6c')][_0x956f('0x56')]);_0xe40de1['query']=_[_0x956f('0x46')](_0x49b7ec[_0x956f('0x45')]);_0xe40de1['filters']=_['intersection'](_0xe40de1[_0x956f('0x43')],_0xe40de1[_0x956f('0x45')]);_0x1b88ab[_0x956f('0x48')]=_[_0x956f('0x57')](_0xe40de1[_0x956f('0x43')],qs[_0x956f('0x49')](_0x49b7ec[_0x956f('0x45')][_0x956f('0x49')]));_0x1b88ab[_0x956f('0x48')]=_0x1b88ab[_0x956f('0x48')]['length']?_0x1b88ab[_0x956f('0x48')]:_0xe40de1['model'];if(!_0x49b7ec[_0x956f('0x45')]['hasOwnProperty'](_0x956f('0x67'))){_0x1b88ab[_0x956f('0x2f')]=qs[_0x956f('0x2f')](_0x49b7ec[_0x956f('0x45')][_0x956f('0x2f')]);_0x1b88ab[_0x956f('0x2e')]=qs[_0x956f('0x2e')](_0x49b7ec[_0x956f('0x45')]['offset']);}_0x1b88ab['order']=qs[_0x956f('0x4c')](_0x49b7ec['query'][_0x956f('0x4c')]);_0x1b88ab[_0x956f('0x4d')]=qs[_0x956f('0x47')](_[_0x956f('0x4e')](_0x49b7ec[_0x956f('0x45')],_0xe40de1[_0x956f('0x47')]));_0x1b88ab[_0x956f('0x4d')][_0x956f('0x69')]=_0x7e4bd5['id'];if(_0x49b7ec[_0x956f('0x45')][_0x956f('0x4f')]){_0x1b88ab[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x1b88ab[_0x956f('0x4d')],{'$or':_['map'](_0x1b88ab[_0x956f('0x48')],function(_0x527710){var _0x45d45c={};_0x45d45c[_0x527710]={'$like':'%'+_0x49b7ec['query'][_0x956f('0x4f')]+'%'};return _0x45d45c;})});}_0x1b88ab=_[_0x956f('0x50')]({},_0x1b88ab,_0x49b7ec[_0x956f('0x51')]);return db[_0x956f('0x6c')]['count']({'where':_0x1b88ab[_0x956f('0x4d')]})['then'](function(_0x3934f2){_0x293f16[_0x956f('0x2d')]=_0x3934f2;if(_0x49b7ec[_0x956f('0x45')][_0x956f('0x52')]){_0x1b88ab[_0x956f('0x53')]=[{'all':!![]}];}return db[_0x956f('0x6c')]['findAll'](_0x1b88ab);})[_0x956f('0x1e')](function(_0x2b4280){_0x293f16[_0x956f('0x6e')]=_0x2b4280;return _0x293f16;});}})[_0x956f('0x1e')](respondWithFilteredResult(_0x12022e,_0x1b88ab))[_0x956f('0x55')](handleError(_0x12022e,null));};exports['removeAnswers']=function(_0x720715,_0x32d617,_0x3ea7fa){return db[_0x956f('0x3f')][_0x956f('0x58')]({'where':{'id':_0x720715[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x32d617,null))['then'](function(_0x5e9486){if(_0x5e9486){return _0x5e9486[_0x956f('0x6f')](_0x720715[_0x956f('0x45')][_0x956f('0x6a')]);}})['then'](respondWithStatusCode(_0x32d617,null))[_0x956f('0x55')](handleError(_0x32d617,null));};exports[_0x956f('0x70')]=function(_0xbd8e82,_0x4a0e80,_0x197809){return db[_0x956f('0x71')][_0x956f('0x58')]({'where':{'id':_0xbd8e82['params']['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x4a0e80,null))[_0x956f('0x1e')](function(_0xc69daa){if(_0xc69daa){return _0xc69daa[_0x956f('0x70')](_0xbd8e82[_0x956f('0x5a')]['ids'],_[_0x956f('0x72')](_0xbd8e82[_0x956f('0x5a')],[_0x956f('0x6a'),'id'])||{});}})[_0x956f('0x1e')](respondWithResult(_0x4a0e80,null))['catch'](handleError(_0x4a0e80,null));};exports[_0x956f('0x73')]=function(_0x287d6d,_0xe3c31c,_0x54853f){var _0x110561={'raw':![],'where':{}};var _0x3d14c9={};var _0x4410bb={'count':0x0,'rows':[]};return db[_0x956f('0x3f')][_0x956f('0x66')]({'where':{'id':_0x287d6d[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0xe3c31c,null))['then'](function(_0x208ddc){if(_0x208ddc){_0x3d14c9[_0x956f('0x43')]=_[_0x956f('0x46')](db[_0x956f('0x71')]['rawAttributes']);_0x3d14c9['query']=_[_0x956f('0x46')](_0x287d6d['query']);_0x3d14c9[_0x956f('0x47')]=_[_0x956f('0x57')](_0x3d14c9['model'],_0x3d14c9[_0x956f('0x45')]);_0x110561[_0x956f('0x48')]=_['intersection'](_0x3d14c9[_0x956f('0x43')],qs[_0x956f('0x49')](_0x287d6d['query'][_0x956f('0x49')]));_0x110561[_0x956f('0x48')]=_0x110561[_0x956f('0x48')][_0x956f('0x4a')]?_0x110561[_0x956f('0x48')]:_0x3d14c9['model'];if(!_0x287d6d[_0x956f('0x45')][_0x956f('0x4b')](_0x956f('0x67'))){_0x110561[_0x956f('0x2f')]=qs[_0x956f('0x2f')](_0x287d6d[_0x956f('0x45')]['limit']);_0x110561[_0x956f('0x2e')]=qs[_0x956f('0x2e')](_0x287d6d[_0x956f('0x45')][_0x956f('0x2e')]);}_0x110561[_0x956f('0x68')]=qs['sort'](_0x287d6d['query'][_0x956f('0x4c')]);_0x110561[_0x956f('0x4d')]=qs[_0x956f('0x47')](_['pick'](_0x287d6d[_0x956f('0x45')],_0x3d14c9[_0x956f('0x47')]));_0x110561[_0x956f('0x4d')][_0x956f('0x69')]=_0x208ddc['id'];if(_0x287d6d['query']['filter']){_0x110561[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x110561[_0x956f('0x4d')],{'$or':_[_0x956f('0x3e')](_0x110561[_0x956f('0x48')],function(_0x44535c){var _0x37e42e={};_0x37e42e[_0x44535c]={'$like':'%'+_0x287d6d[_0x956f('0x45')][_0x956f('0x4f')]+'%'};return _0x37e42e;})});}_0x110561=_['merge']({},_0x110561,_0x287d6d['options']);return db[_0x956f('0x71')][_0x956f('0x2d')]({'where':_0x110561['where']})[_0x956f('0x1e')](function(_0x29df94){_0x4410bb['count']=_0x29df94;if(_0x287d6d['query'][_0x956f('0x52')]){_0x110561['include']=[{'model':db[_0x956f('0x74')],'as':_0x956f('0x75'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x956f('0x44'),_0x956f('0x76'),_0x956f('0x77')],'required':![]},{'model':db['Tag'],'as':_0x956f('0x78'),'attributes':['id',_0x956f('0x44'),_0x956f('0x79')],'where':_0x287d6d['query'][_0x956f('0x7a')]?{'id':_0x287d6d[_0x956f('0x45')][_0x956f('0x7a')]}:undefined,'required':_0x287d6d[_0x956f('0x45')][_0x956f('0x7a')]?!![]:![]}];}return db['FaxInteraction'][_0x956f('0x54')](_0x110561);})['then'](function(_0x572d2a){_0x4410bb['rows']=_0x572d2a;return _0x4410bb;});}})[_0x956f('0x1e')](respondWithFilteredResult(_0xe3c31c,_0x110561))['catch'](handleError(_0xe3c31c,null));};exports['addApplications']=function(_0x3fea9e,_0x5f70d5,_0x2f25e5){return db[_0x956f('0x3f')][_0x956f('0x66')]({'where':{'id':_0x3fea9e[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x5f70d5,null))[_0x956f('0x1e')](function(_0x317563){if(_0x317563){return db[_0x956f('0x7b')]['transaction'](function(_0x379e53){return db[_0x956f('0x7c')][_0x956f('0x35')]({'where':{'FaxAccountId':_0x3fea9e[_0x956f('0x62')]['id']},'transaction':_0x379e53})[_0x956f('0x1e')](function(_0x106de7){var _0x6d4607=_['map'](_0x3fea9e[_0x956f('0x5a')],function(_0x850999){_0x850999[_0x956f('0x69')]=_0x3fea9e[_0x956f('0x62')]['id'];return _0x850999;});return db[_0x956f('0x7c')]['bulkCreate'](_0x6d4607,{'transaction':_0x379e53});});})['then'](function(){return db[_0x956f('0x7c')]['findAndCountAll']({'where':{'FaxAccountId':_0x3fea9e[_0x956f('0x62')]['id']},'order':_0x956f('0x7d')});});}})[_0x956f('0x1e')](respondWithResult(_0x5f70d5,null))[_0x956f('0x55')](handleError(_0x5f70d5,null));};exports['getApplications']=function(_0x2e9592,_0x303050,_0x1795d0){var _0x53d7ce={};var _0x49857={};var _0xed028e;var _0x2b193f;return db[_0x956f('0x3f')]['findOne']({'where':{'id':_0x2e9592[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x303050,null))[_0x956f('0x1e')](function(_0x160870){if(_0x160870){_0xed028e=_0x160870;_0x49857[_0x956f('0x43')]=_[_0x956f('0x46')](db['FaxApplication'][_0x956f('0x56')]);_0x49857[_0x956f('0x45')]=_['keys'](_0x2e9592[_0x956f('0x45')]);_0x49857['filters']=_[_0x956f('0x57')](_0x49857['model'],_0x49857[_0x956f('0x45')]);_0x53d7ce[_0x956f('0x48')]=_[_0x956f('0x57')](_0x49857[_0x956f('0x43')],qs[_0x956f('0x49')](_0x2e9592[_0x956f('0x45')][_0x956f('0x49')]));_0x53d7ce[_0x956f('0x48')]=_0x53d7ce[_0x956f('0x48')][_0x956f('0x4a')]?_0x53d7ce[_0x956f('0x48')]:_0x49857['model'];_0x53d7ce['order']=qs[_0x956f('0x4c')](_0x2e9592[_0x956f('0x45')][_0x956f('0x4c')]);_0x53d7ce[_0x956f('0x4d')]=qs[_0x956f('0x47')](_[_0x956f('0x4e')](_0x2e9592[_0x956f('0x45')],_0x49857[_0x956f('0x47')]));if(_0x2e9592[_0x956f('0x45')][_0x956f('0x4f')]){_0x53d7ce[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x53d7ce[_0x956f('0x4d')],{'$or':_['map'](_0x53d7ce[_0x956f('0x48')],function(_0x497b9c){var _0xc19a06={};_0xc19a06[_0x497b9c]={'$like':'%'+_0x2e9592[_0x956f('0x45')]['filter']+'%'};return _0xc19a06;})});}_0x53d7ce=_[_0x956f('0x50')]({},_0x53d7ce,_0x2e9592[_0x956f('0x51')]);return _0xed028e[_0x956f('0x7e')](_0x53d7ce);}})[_0x956f('0x1e')](function(_0x477b6d){if(_0x477b6d){_0x2b193f=_0x477b6d[_0x956f('0x4a')];if(!_0x2e9592[_0x956f('0x45')]['hasOwnProperty'](_0x956f('0x67'))){_0x53d7ce[_0x956f('0x2f')]=qs[_0x956f('0x2f')](_0x2e9592['query'][_0x956f('0x2f')]);_0x53d7ce[_0x956f('0x2e')]=qs[_0x956f('0x2e')](_0x2e9592[_0x956f('0x45')][_0x956f('0x2e')]);}return _0xed028e[_0x956f('0x7e')](_0x53d7ce);}})[_0x956f('0x1e')](function(_0x30a0ed){if(_0x30a0ed){return _0x30a0ed?{'count':_0x2b193f,'rows':_0x30a0ed}:null;}})['then'](respondWithResult(_0x303050,null))[_0x956f('0x55')](handleError(_0x303050,null));};function Extension(_0x4f41c4,_0x4426b7,_0x42080d,_0x22af24){this['context']='from-voip-provider';this[_0x956f('0x7f')]=_0x4f41c4['localstationid'];this['app']=_0x22af24;this[_0x956f('0x41')]=_0x956f('0x80');this[_0x956f('0x81')]=_0x956f('0x82');this['FaxAccountId']=_0x4f41c4['id'];this[_0x956f('0x7d')]=_0x4426b7;this[_0x956f('0x83')]=_0x42080d;}function createExtensionsReciveFax(_0x184d4d){var _0x9cf218=0x1;var _0x1f3b09=[];_0x1f3b09[_0x956f('0x84')](new Extension(_0x184d4d,_0x9cf218,'','Answer'));_0x9cf218+=0x1;_0x1f3b09[_0x956f('0x84')](new Extension(_0x184d4d,_0x9cf218,_0x956f('0x85'),_0x956f('0x86')));_0x9cf218+=0x1;for(var _0x4ca6f3 in _0x184d4d){if(_0x184d4d[_0x956f('0x4b')](_0x4ca6f3)&&(_0x4ca6f3===_0x956f('0x87')||_0x4ca6f3==='localstationid'||_0x4ca6f3===_0x956f('0x88')||_0x4ca6f3===_0x956f('0x89')||_0x4ca6f3==='headerinfo'||_0x4ca6f3===_0x956f('0x8a')||_0x4ca6f3==='minrate'||_0x4ca6f3===_0x956f('0x8b')||_0x4ca6f3===_0x956f('0x8c'))){_0x1f3b09['push'](new Extension(_0x184d4d,_0x9cf218,_0x956f('0x8d')+_0x4ca6f3+')='+_0x184d4d[_0x4ca6f3],'Set'));_0x9cf218+=0x1;}}_0x1f3b09[_0x956f('0x84')](new Extension(_0x184d4d,_0x9cf218,'6',_0x956f('0x8e')));_0x9cf218+=0x1;_0x1f3b09[_0x956f('0x84')](new Extension(_0x184d4d,_0x9cf218,_0x956f('0x8f'),_0x956f('0x90')));_0x9cf218=0x0;return _0x1f3b09;}exports[_0x956f('0x91')]=function(_0x59ec85,_0x2a41d9,_0x58fa3b){var _0x432e87;return db[_0x956f('0x7b')][_0x956f('0x92')](function(_0x57713f){return db[_0x956f('0x3f')][_0x956f('0x59')](_0x59ec85[_0x956f('0x5a')],{'transaction':_0x57713f})['then'](function(_0x540ada){_0x432e87=_0x540ada[_0x956f('0x36')]({'plain':!![]});return db[_0x956f('0x93')][_0x956f('0x94')](createExtensionsReciveFax(_0x432e87),{'transaction':_0x57713f});});})[_0x956f('0x1e')](function(){return _0x432e87;})[_0x956f('0x1e')](respondWithResult(_0x2a41d9,null))[_0x956f('0x55')](handleError(_0x2a41d9,null));};exports[_0x956f('0x95')]=function(_0x2f79e7,_0x23d07d,_0x3c60ff){var _0x69aca3;return db[_0x956f('0x7b')][_0x956f('0x92')](function(_0x2b38cf){return db[_0x956f('0x3f')][_0x956f('0x34')](_0x2f79e7[_0x956f('0x5a')],{'where':{'id':_0x2f79e7[_0x956f('0x5a')]['id']},'transaction':_0x2b38cf})[_0x956f('0x1e')](function(_0x5b8006){return db['VoiceExtension'][_0x956f('0x35')]({'where':{'FaxAccountId':_0x2f79e7[_0x956f('0x5a')]['id']},'transaction':_0x2b38cf})[_0x956f('0x1e')](function(_0x57cee7){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x2f79e7[_0x956f('0x5a')],[_0x956f('0x96'),'key','createdAt',_0x956f('0x97'),_0x956f('0x98'),'ListId'])),{'transaction':_0x2b38cf});});});})[_0x956f('0x1e')](function(){return db[_0x956f('0x3f')]['findById'](_0x2f79e7[_0x956f('0x5a')]['id']);})[_0x956f('0x1e')](respondWithResult(_0x23d07d,null))[_0x956f('0x55')](handleError(_0x23d07d,null));};exports[_0x956f('0x99')]=function(_0x34dacf,_0x239b03,_0x3a7d72){var _0x2cca84={'raw':!![],'where':{}};var _0x2980e5={};var _0x36bbf5={'count':0x0,'rows':[]};return db[_0x956f('0x3f')]['findOne']({'where':{'id':_0x34dacf[_0x956f('0x62')]['id']}})[_0x956f('0x1e')](handleEntityNotFound(_0x239b03,null))[_0x956f('0x1e')](function(_0xb52ee9){if(_0xb52ee9){_0x2980e5['model']=_[_0x956f('0x46')](db[_0x956f('0x9a')][_0x956f('0x56')]);_0x2980e5[_0x956f('0x45')]=_['keys'](_0x34dacf['query']);_0x2980e5[_0x956f('0x47')]=_[_0x956f('0x57')](_0x2980e5[_0x956f('0x43')],_0x2980e5[_0x956f('0x45')]);_0x2cca84[_0x956f('0x48')]=_[_0x956f('0x57')](_0x2980e5['model'],qs[_0x956f('0x49')](_0x34dacf[_0x956f('0x45')]['fields']));_0x2cca84['attributes']=_0x2cca84[_0x956f('0x48')][_0x956f('0x4a')]?_0x2cca84['attributes']:_0x2980e5[_0x956f('0x43')];if(!_0x34dacf[_0x956f('0x45')][_0x956f('0x4b')](_0x956f('0x67'))){_0x2cca84[_0x956f('0x2f')]=qs[_0x956f('0x2f')](_0x34dacf[_0x956f('0x45')][_0x956f('0x2f')]);_0x2cca84[_0x956f('0x2e')]=qs[_0x956f('0x2e')](_0x34dacf[_0x956f('0x45')]['offset']);}_0x2cca84[_0x956f('0x68')]=qs[_0x956f('0x4c')](_0x34dacf['query']['sort']);_0x2cca84[_0x956f('0x4d')]=qs[_0x956f('0x47')](_[_0x956f('0x4e')](_0x34dacf[_0x956f('0x45')],_0x2980e5[_0x956f('0x47')]));_0x2cca84[_0x956f('0x4d')][_0x956f('0x69')]=_0xb52ee9['id'];if(_0x34dacf[_0x956f('0x45')][_0x956f('0x4f')]){_0x2cca84[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x2cca84[_0x956f('0x4d')],{'$or':_[_0x956f('0x3e')](_0x2cca84['attributes'],function(_0x137d70){var _0x4db94d={};_0x4db94d[_0x137d70]={'$like':'%'+_0x34dacf[_0x956f('0x45')]['filter']+'%'};return _0x4db94d;})});}if(_0x34dacf[_0x956f('0x45')]['$gte']){var _0x34b26c=_0x34dacf[_0x956f('0x45')]['$gte'][_0x956f('0x9b')](',');var _0xcbfcc6={};_0xcbfcc6[_0x34b26c[0x0]]={'$gte':moment(_0x34b26c[0x1])[_0x956f('0x9c')](_0x956f('0x9d'))};_0x2cca84[_0x956f('0x4d')]=_[_0x956f('0x50')](_0x2cca84['where'],_0xcbfcc6);}_0x2cca84=_[_0x956f('0x50')]({},_0x2cca84,_0x34dacf[_0x956f('0x51')]);return db[_0x956f('0x9a')]['count']({'where':_0x2cca84[_0x956f('0x4d')]})[_0x956f('0x1e')](function(_0x5a2f53){_0x36bbf5[_0x956f('0x2d')]=_0x5a2f53;if(_0x34dacf[_0x956f('0x45')]['includeAll']){_0x2cca84['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x2cca84);})[_0x956f('0x1e')](function(_0x1f9479){_0x36bbf5[_0x956f('0x6e')]=_0x1f9479;return _0x36bbf5;});}})[_0x956f('0x1e')](respondWithFilteredResult(_0x239b03,_0x2cca84))[_0x956f('0x55')](handleError(_0x239b03,null));};exports[_0x956f('0x3a')]=function(_0x611b38,_0x4464d9,_0x280926){var _0x223951,_0x2ca323={},_0x5d2261;if(_0x611b38[_0x956f('0x5a')]['to']){_0x5d2261=_0x611b38['body']['to'][0x0];}return db[_0x956f('0x3f')][_0x956f('0x58')]({'where':{'id':_0x611b38[_0x956f('0x62')]['id']},'include':[{'model':db[_0x956f('0x9e')],'as':_0x956f('0x9f'),'include':[{'model':db[_0x956f('0x74')],'as':_0x956f('0xa0'),'where':{'fax':_0x5d2261},'limit':0x1,'order':[[_0x956f('0x97'),_0x956f('0xa1')]]}]}]})['then'](handleEntityNotFound(_0x4464d9,null))[_0x956f('0x1e')](function(_0x5e4856){_0x223951=_0x5e4856;if(_0x611b38['body'][_0x956f('0xa2')]&&_0x611b38[_0x956f('0x5a')]['attachments'][_0x956f('0x4a')]){for(var _0x19a7e1=0x0;_0x19a7e1<_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][_0x956f('0x4a')];_0x19a7e1+=0x1){_0x611b38[_0x956f('0x5a')]['attachments'][_0x19a7e1]={'filename':_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][_0x19a7e1]['name'],'id':_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][_0x19a7e1]['id'],'path':path[_0x956f('0xa3')](config[_0x956f('0xa4')],_0x956f('0xa5'),_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][_0x19a7e1][_0x956f('0xa6')])};}}return respondWithRpcPromise(_0x956f('0xa7'),_0x956f('0xa7'),{'FaxAccountId':_[_0x956f('0xa8')](_0x611b38[_0x956f('0x62')]['id'])?undefined:_0x611b38[_0x956f('0x62')]['id'],'path':_[_0x956f('0xa8')](_0x611b38[_0x956f('0x5a')]['attachments'][0x0][_0x956f('0x5')])?undefined:_0x611b38['body'][_0x956f('0xa2')][0x0][_0x956f('0x5')],'fax':_[_0x956f('0xa8')](_0x611b38['body']['to'][0x0])?undefined:_0x611b38[_0x956f('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x223951){if(_['isNil'](_0x611b38[_0x956f('0x5a')][_0x956f('0xa9')])){_0x611b38[_0x956f('0x5a')][_0x956f('0xa9')]=util['format']('\x22%s\x22\x20<%s>',_0x223951[_0x956f('0x44')],_0x223951[_0x956f('0xaa')]);}if(_0x223951[_0x956f('0x9f')]){if(_0x223951[_0x956f('0x9f')][_0x956f('0xa0')][_0x956f('0x4a')]){return _0x223951[_0x956f('0x9f')][_0x956f('0xa0')][0x0];}else{return db[_0x956f('0x74')][_0x956f('0x59')](_[_0x956f('0x16')](_0x611b38[_0x956f('0x5a')],{'firstName':_0x611b38[_0x956f('0x5a')]['to'][0x0],'phone':_0x611b38[_0x956f('0x5a')]['to'][0x0],'fax':_0x611b38[_0x956f('0x5a')]['to'][0x0],'ListId':_0x223951[_0x956f('0xab')]}));}}else{throw new Error(_0x956f('0xac'));}}else{throw new Error(_0x956f('0xad'));}})[_0x956f('0x1e')](function(_0x71d1bf){if(_0x71d1bf){return db[_0x956f('0x71')][_0x956f('0x58')]({'where':{'ContactId':_0x71d1bf['id'],'closed':![],'FaxAccountId':_0x223951['id']}})[_0x956f('0x1e')](function(_0xd0e5a9){if(_0xd0e5a9){return[_0xd0e5a9,![]];}return db[_0x956f('0x71')][_0x956f('0x59')]({'UserId':_0x611b38[_0x956f('0x5b')]['id'],'ContactId':_0x71d1bf['id'],'FaxAccountId':_0x223951['id'],'fax':_0x611b38['body']['to'][0x0],'firstMsgDirection':_0x956f('0xae'),'Messages':[_[_0x956f('0x50')](_0x611b38[_0x956f('0x5a')],{'read':![],'body':_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][0x0]['filename'],'FaxAccountId':_0x223951['id'],'UserId':_0x611b38['user']['id'],'ContactId':_0x71d1bf['id'],'AttachmentId':_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x956f('0xaf')}]})['then'](function(_0x2835da){return[_0x2835da,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x42983b,_0x50194e){if(_0x50194e){return _0x42983b;}return db['FaxMessage'][_0x956f('0x59')]({'direction':_0x956f('0xae'),'read':![],'body':_0x611b38[_0x956f('0x5a')]['attachments'][0x0][_0x956f('0xb0')],'FaxAccountId':_0x223951['id'],'FaxInteractionId':_0x42983b['id'],'UserId':_0x611b38[_0x956f('0x5b')]['id'],'ContactId':_0x42983b['ContactId'],'AttachmentId':_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][0x0]['id']})[_0x956f('0x1e')](function(_0x41c554){_0x42983b[_0x956f('0xb1')]['Messages']=[];_0x42983b[_0x956f('0xb1')]['Messages'][_0x956f('0x84')](_0x41c554['dataValues']);return _0x42983b;});})[_0x956f('0x1e')](function(_0x21c840){respondWithRpcPromise('SendFax',_0x956f('0xb2'),{'FaxAccountId':_[_0x956f('0xa8')](_0x611b38[_0x956f('0x62')]['id'])?undefined:_0x611b38[_0x956f('0x62')]['id'],'path':_[_0x956f('0xa8')](_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][0x0][_0x956f('0x5')])?undefined:_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][0x0][_0x956f('0x5')],'fax':_[_0x956f('0xa8')](_0x611b38['body']['to'][0x0])?undefined:_0x611b38[_0x956f('0x5a')]['to'][0x0],'AttachmentId':_0x611b38[_0x956f('0x5a')][_0x956f('0xa2')][0x0]['id']},client9002)[_0x956f('0x1e')](function(_0x546073){logger['info'](_0x956f('0xb3'),_0x546073);})['catch'](function(_0x29a5f1){logger[_0x956f('0x26')]('SendFaxRpc,\x20%s',_0x29a5f1);});return _0x21c840;})[_0x956f('0x1e')](respondWithResult(_0x4464d9,null))[_0x956f('0x55')](handleError(_0x4464d9,null));};exports[_0x956f('0xb4')]=function(_0x13d474,_0x5d12c6,_0x135239){return db[_0x956f('0x3f')][_0x956f('0x58')]({'where':{'id':_0x13d474[_0x956f('0x62')]['id']}})['then'](handleEntityNotFound(_0x5d12c6,null))[_0x956f('0x1e')](function(_0x3fc8bf){if(_0x3fc8bf){return _0x3fc8bf[_0x956f('0xb4')](_0x13d474[_0x956f('0x5a')][_0x956f('0x6a')],_[_0x956f('0x72')](_0x13d474['body'],['ids','id'])||{})[_0x956f('0xb5')](function(_0x436bf0){for(var _0x5aff04=0x0;_0x5aff04<_0x13d474[_0x956f('0x5a')][_0x956f('0x6a')][_0x956f('0x4a')];_0x5aff04+=0x1){socket['emit'](_0x956f('0xb6'),{'UserId':Number(_0x13d474['body'][_0x956f('0x6a')][_0x5aff04]),'FaxAccountId':Number(_0x13d474[_0x956f('0x62')]['id'])});}return _0x436bf0;});}})['then'](respondWithResult(_0x5d12c6,null))['catch'](handleError(_0x5d12c6,null));};exports[_0x956f('0xb7')]=function(_0x5a0a26,_0x2b7d15,_0xacd4f0){return db[_0x956f('0x3f')]['find']({'where':{'id':_0x5a0a26[_0x956f('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b7d15,null))[_0x956f('0x1e')](function(_0x30369f){if(_0x30369f){return _0x30369f[_0x956f('0xb7')](_0x5a0a26[_0x956f('0x45')]['ids'])[_0x956f('0x1e')](function(){if(_[_0x956f('0xb8')](_0x5a0a26[_0x956f('0x45')][_0x956f('0x6a')])){for(var _0x19dec0=0x0;_0x19dec0<_0x5a0a26[_0x956f('0x45')]['ids'][_0x956f('0x4a')];_0x19dec0+=0x1){socket[_0x956f('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x5a0a26['query'][_0x956f('0x6a')][_0x19dec0]),'FaxAccountId':Number(_0x5a0a26[_0x956f('0x62')]['id'])});}}else{socket[_0x956f('0xb9')](_0x956f('0xba'),{'UserId':Number(_0x5a0a26[_0x956f('0x45')][_0x956f('0x6a')]),'FaxAccountId':Number(_0x5a0a26[_0x956f('0x62')]['id'])});}});}})[_0x956f('0x1e')](respondWithStatusCode(_0x2b7d15,null))[_0x956f('0x55')](handleError(_0x2b7d15,null));};exports['getAgents']=function(_0x3df49a,_0x291792,_0x41658f){var _0x2f2e80={};var _0x168e3b={};var _0x4ff80c;var _0x4d5cbf;return db[_0x956f('0x3f')]['findOne']({'where':{'id':_0x3df49a['params']['id']}})['then'](handleEntityNotFound(_0x291792,null))[_0x956f('0x1e')](function(_0x5f41ac){if(_0x5f41ac){_0x4ff80c=_0x5f41ac;_0x168e3b[_0x956f('0x43')]=_[_0x956f('0x46')](db[_0x956f('0xbb')][_0x956f('0x56')]);_0x168e3b['query']=_['keys'](_0x3df49a[_0x956f('0x45')]);_0x168e3b[_0x956f('0x47')]=_[_0x956f('0x57')](_0x168e3b['model'],_0x168e3b[_0x956f('0x45')]);_0x2f2e80['attributes']=_[_0x956f('0x57')](_0x168e3b[_0x956f('0x43')],qs[_0x956f('0x49')](_0x3df49a['query']['fields']));_0x2f2e80['attributes']=_0x2f2e80[_0x956f('0x48')][_0x956f('0x4a')]?_0x2f2e80[_0x956f('0x48')]:_0x168e3b[_0x956f('0x43')];_0x2f2e80[_0x956f('0x68')]=qs[_0x956f('0x4c')](_0x3df49a[_0x956f('0x45')][_0x956f('0x4c')]);_0x2f2e80['where']=qs[_0x956f('0x47')](_[_0x956f('0x4e')](_0x3df49a[_0x956f('0x45')],_0x168e3b[_0x956f('0x47')]));if(_0x3df49a[_0x956f('0x45')][_0x956f('0x4f')]){_0x2f2e80[_0x956f('0x4d')]=_['merge'](_0x2f2e80[_0x956f('0x4d')],{'$or':_[_0x956f('0x3e')](_0x2f2e80[_0x956f('0x48')],function(_0x2fc56d){var _0x139534={};_0x139534[_0x2fc56d]={'$like':'%'+_0x3df49a[_0x956f('0x45')][_0x956f('0x4f')]+'%'};return _0x139534;})});}_0x2f2e80=_['merge']({},_0x2f2e80,_0x3df49a[_0x956f('0x51')]);return _0x4ff80c['getAgents'](_0x2f2e80);}})[_0x956f('0x1e')](function(_0x150826){if(_0x150826){_0x4d5cbf=_0x150826['length'];if(!_0x3df49a[_0x956f('0x45')][_0x956f('0x4b')](_0x956f('0x67'))){_0x2f2e80[_0x956f('0x2f')]=qs['limit'](_0x3df49a['query']['limit']);_0x2f2e80['offset']=qs[_0x956f('0x2e')](_0x3df49a[_0x956f('0x45')][_0x956f('0x2e')]);}return _0x4ff80c['getAgents'](_0x2f2e80);}})[_0x956f('0x1e')](function(_0xa0201a){if(_0xa0201a){return _0xa0201a?{'count':_0x4d5cbf,'rows':_0xa0201a}:null;}})[_0x956f('0x1e')](respondWithResult(_0x291792,null))[_0x956f('0x55')](handleError(_0x291792,null));}; \ No newline at end of file +var _0xcc4b=['description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','CmContact','Contacts','DESC','attachments','join','root','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','addAgents','omit','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','getInteractions','FaxInteraction','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','bulkCreate','priority','getApplications','FaxApplication','context','from-voip-provider','exten','localstationid','app','system'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xcc4b,0x104));var _0xbcc4=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0xcc4b[_0x104a84];return _0x4973ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbcc4('0x0'));var jsonpatch=require(_0xbcc4('0x1'));var rp=require(_0xbcc4('0x2'));var moment=require(_0xbcc4('0x3'));var BPromise=require(_0xbcc4('0x4'));var Mustache=require(_0xbcc4('0x5'));var util=require(_0xbcc4('0x6'));var path=require('path');var sox=require(_0xbcc4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcc4('0x8'));var _=require(_0xbcc4('0x9'));var squel=require(_0xbcc4('0xa'));var crypto=require(_0xbcc4('0xb'));var jsforce=require(_0xbcc4('0xc'));var deskjs=require(_0xbcc4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbcc4('0xe'));var Papa=require('papaparse');var Redis=require(_0xbcc4('0xf'));var authService=require(_0xbcc4('0x10'));var qs=require(_0xbcc4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcc4('0x12'));var logger=require(_0xbcc4('0x13'))(_0xbcc4('0x14'));var utils=require('../../config/utils');var config=require(_0xbcc4('0x15'));var licenseUtil=require(_0xbcc4('0x16'));var db=require(_0xbcc4('0x17'))['db'];config[_0xbcc4('0x18')]=_['defaults'](config['redis'],{'host':_0xbcc4('0x19'),'port':0x18eb});var socket=require(_0xbcc4('0x1a'))(new Redis(config[_0xbcc4('0x18')]));require(_0xbcc4('0x1b'))[_0xbcc4('0x1c')](socket);var jayson=require(_0xbcc4('0x1d'));var client=jayson[_0xbcc4('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xbcc4('0x1e')][_0xbcc4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xc88868,_0x443d5c,_0x25d333,_0x2ca970){return new BPromise(function(_0x2993f0,_0x1a9a86){var _0x54e53d=_0x2ca970||client;return _0x54e53d[_0xbcc4('0x20')](_0xc88868,_0x25d333)[_0xbcc4('0x21')](function(_0x3e5865){logger[_0xbcc4('0x22')](_0xbcc4('0x23'),_0x443d5c,'request\x20sent');logger[_0xbcc4('0x24')](_0xbcc4('0x25'),_0x443d5c,'request\x20sent',JSON[_0xbcc4('0x26')](_0x3e5865));if(_0x3e5865[_0xbcc4('0x27')]){if(_0x3e5865[_0xbcc4('0x27')][_0xbcc4('0x28')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x443d5c,_0x3e5865[_0xbcc4('0x27')]['message']);return _0x1a9a86(_0x3e5865['error']['message']);}logger[_0xbcc4('0x27')](_0xbcc4('0x23'),_0x443d5c,_0x3e5865[_0xbcc4('0x27')][_0xbcc4('0x29')]);return _0x2993f0(_0x3e5865[_0xbcc4('0x27')][_0xbcc4('0x29')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x443d5c,_0xbcc4('0x2a'));_0x2993f0(_0x3e5865[_0xbcc4('0x2b')][_0xbcc4('0x29')]);}})['catch'](function(_0x40041e){logger[_0xbcc4('0x27')]('FaxAccount,\x20%s,\x20%s',_0x443d5c,_0x40041e);_0x1a9a86(_0x40041e);});});}function respondWithStatusCode(_0x5b0bfa,_0x353005){_0x353005=_0x353005||0xcc;return function(_0x31d376){if(_0x31d376){return _0x5b0bfa['sendStatus'](_0x353005);}return _0x5b0bfa[_0xbcc4('0x2c')](_0x353005)[_0xbcc4('0x2d')]();};}function respondWithResult(_0x180a00,_0x3b5bac){_0x3b5bac=_0x3b5bac||0xc8;return function(_0x3c5c2f){if(_0x3c5c2f){return _0x180a00['status'](_0x3b5bac)[_0xbcc4('0x2e')](_0x3c5c2f);}};}function respondWithFilteredResult(_0x55f527,_0x5cac74){return function(_0x29d875){if(_0x29d875){var _0x259c70=typeof _0x5cac74[_0xbcc4('0x2f')]===_0xbcc4('0x30')&&typeof _0x5cac74[_0xbcc4('0x31')]===_0xbcc4('0x30');var _0x3a8b39=_0x29d875[_0xbcc4('0x32')];var _0x45d7fe=_0x259c70?0x0:_0x5cac74[_0xbcc4('0x2f')];var _0xa67e87=_0x259c70?_0x29d875['count']:_0x5cac74[_0xbcc4('0x2f')]+_0x5cac74['limit'];var _0x236895;if(_0xa67e87>=_0x3a8b39){_0xa67e87=_0x3a8b39;_0x236895=0xc8;}else{_0x236895=0xce;}_0x55f527[_0xbcc4('0x2c')](_0x236895);return _0x55f527[_0xbcc4('0x33')](_0xbcc4('0x34'),_0x45d7fe+'-'+_0xa67e87+'/'+_0x3a8b39)[_0xbcc4('0x2e')](_0x29d875);}return null;};}function patchUpdates(_0x39545f){return function(_0x13d860){try{jsonpatch[_0xbcc4('0x35')](_0x13d860,_0x39545f,!![]);}catch(_0x1353fb){return BPromise[_0xbcc4('0x36')](_0x1353fb);}return _0x13d860[_0xbcc4('0x37')]();};}function saveUpdates(_0xf2b770,_0x29cbdf){return function(_0x448ffd){if(_0x448ffd){return _0x448ffd[_0xbcc4('0x38')](_0xf2b770)[_0xbcc4('0x21')](function(_0xcb59a8){return _0xcb59a8;});}return null;};}function removeEntity(_0x229b4e,_0x223a6f){return function(_0x518c48){if(_0x518c48){return _0x518c48[_0xbcc4('0x39')]()[_0xbcc4('0x21')](function(){var _0x28984f=_0x518c48[_0xbcc4('0x3a')]({'plain':!![]});var _0x5ce78c=_0xbcc4('0x3b');return db[_0xbcc4('0x3c')]['destroy']({'where':{'type':_0x5ce78c,'resourceId':_0x28984f['id']}})['then'](function(){return _0x518c48;});})[_0xbcc4('0x21')](function(){_0x229b4e[_0xbcc4('0x2c')](0xcc)[_0xbcc4('0x2d')]();});}};}function handleEntityNotFound(_0x36bc91,_0x26ad42){return function(_0x9545ae){if(!_0x9545ae){_0x36bc91[_0xbcc4('0x3d')](0x194);}return _0x9545ae;};}function handleError(_0xdc2ea8,_0x669721){_0x669721=_0x669721||0x1f4;return function(_0x342e52){logger['error'](_0x342e52[_0xbcc4('0x3e')]);if(_0x342e52[_0xbcc4('0x3f')]){delete _0x342e52[_0xbcc4('0x3f')];}_0xdc2ea8['status'](_0x669721)['send'](_0x342e52);};}exports[_0xbcc4('0x40')]=function(_0x15c991,_0x149a6f){var _0x461a48={'include':[{'model':db[_0xbcc4('0x41')],'as':_0xbcc4('0x42')}]},_0x507d66={},_0x2716b8={'count':0x0,'rows':[]};var _0x488882=_['map'](db[_0xbcc4('0x43')][_0xbcc4('0x44')],function(_0xd6dda5){return{'name':_0xd6dda5[_0xbcc4('0x45')],'type':_0xd6dda5[_0xbcc4('0x46')][_0xbcc4('0x47')]};});_0x507d66[_0xbcc4('0x48')]=_[_0xbcc4('0x49')](_0x488882,'name');_0x507d66[_0xbcc4('0x4a')]=_[_0xbcc4('0x4b')](_0x15c991[_0xbcc4('0x4a')]);_0x507d66[_0xbcc4('0x4c')]=_[_0xbcc4('0x4d')](_0x507d66['model'],_0x507d66[_0xbcc4('0x4a')]);_0x461a48[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x507d66[_0xbcc4('0x48')],qs[_0xbcc4('0x4f')](_0x15c991[_0xbcc4('0x4a')][_0xbcc4('0x4f')]));_0x461a48[_0xbcc4('0x4e')]=_0x461a48[_0xbcc4('0x4e')][_0xbcc4('0x50')]?_0x461a48['attributes']:_0x507d66['model'];if(!_0x15c991['query'][_0xbcc4('0x51')]('nolimit')){_0x461a48['limit']=qs[_0xbcc4('0x31')](_0x15c991['query'][_0xbcc4('0x31')]);_0x461a48[_0xbcc4('0x2f')]=qs['offset'](_0x15c991[_0xbcc4('0x4a')]['offset']);}_0x461a48['order']=qs[_0xbcc4('0x52')](_0x15c991[_0xbcc4('0x4a')][_0xbcc4('0x52')]);_0x461a48['where']=qs[_0xbcc4('0x4c')](_[_0xbcc4('0x53')](_0x15c991[_0xbcc4('0x4a')],_0x507d66[_0xbcc4('0x4c')]),_0x488882);if(_0x15c991[_0xbcc4('0x4a')][_0xbcc4('0x54')]){_0x461a48['where']=_[_0xbcc4('0x55')](_0x461a48[_0xbcc4('0x56')],{'$or':_['map'](_0x488882,function(_0x10b39f){if(_0x10b39f['type']!==_0xbcc4('0x57')){var _0x4bffa3={};_0x4bffa3[_0x10b39f[_0xbcc4('0x3f')]]={'$like':'%'+_0x15c991['query'][_0xbcc4('0x54')]+'%'};return _0x4bffa3;}})});}_0x461a48=_[_0xbcc4('0x55')]({},_0x461a48,_0x15c991['options']);var _0x43d002={'where':_0x461a48['where']};return db['FaxAccount'][_0xbcc4('0x32')](_0x43d002)[_0xbcc4('0x21')](function(_0x36ceb9){_0x2716b8['count']=_0x36ceb9;if(_0x15c991[_0xbcc4('0x4a')][_0xbcc4('0x58')]){_0x461a48[_0xbcc4('0x59')]=[{'all':!![]}];}return db['FaxAccount'][_0xbcc4('0x5a')](_0x461a48);})[_0xbcc4('0x21')](function(_0x5f3903){_0x2716b8[_0xbcc4('0x5b')]=_0x5f3903;return _0x2716b8;})[_0xbcc4('0x21')](respondWithFilteredResult(_0x149a6f,_0x461a48))[_0xbcc4('0x5c')](handleError(_0x149a6f,null));};exports[_0xbcc4('0x5d')]=function(_0x29ab61,_0x46be99){var _0x2f06ca={'raw':![],'where':{'id':_0x29ab61[_0xbcc4('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xbcc4('0x42')}]},_0x9dec06={};_0x9dec06[_0xbcc4('0x48')]=_[_0xbcc4('0x4b')](db[_0xbcc4('0x43')]['rawAttributes']);_0x9dec06[_0xbcc4('0x4a')]=_[_0xbcc4('0x4b')](_0x29ab61['query']);_0x9dec06[_0xbcc4('0x4c')]=_[_0xbcc4('0x4d')](_0x9dec06['model'],_0x9dec06['query']);_0x2f06ca[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x9dec06['model'],qs[_0xbcc4('0x4f')](_0x29ab61[_0xbcc4('0x4a')]['fields']));_0x2f06ca['attributes']=_0x2f06ca['attributes'][_0xbcc4('0x50')]?_0x2f06ca[_0xbcc4('0x4e')]:_0x9dec06[_0xbcc4('0x48')];if(_0x29ab61[_0xbcc4('0x4a')][_0xbcc4('0x58')]){_0x2f06ca['include']=[{'all':!![]}];}_0x2f06ca=_[_0xbcc4('0x55')]({},_0x2f06ca,_0x29ab61[_0xbcc4('0x5f')]);return db[_0xbcc4('0x43')][_0xbcc4('0x60')](_0x2f06ca)[_0xbcc4('0x21')](handleEntityNotFound(_0x46be99,null))[_0xbcc4('0x21')](respondWithResult(_0x46be99,null))[_0xbcc4('0x5c')](handleError(_0x46be99,null));};exports['create']=function(_0x4a3480,_0x11ea01){return db[_0xbcc4('0x43')][_0xbcc4('0x61')](_0x4a3480[_0xbcc4('0x62')],{})[_0xbcc4('0x21')](function(_0x21ccdc){var _0x1757cb=_0x4a3480['user']['get']({'plain':!![]});if(!_0x1757cb)throw new Error(_0xbcc4('0x63'));if(_0x1757cb['role']===_0xbcc4('0x64')){var _0x54184e=_0x21ccdc[_0xbcc4('0x3a')]({'plain':!![]});var _0x16a46d=_0xbcc4('0x3b');return db['UserProfileSection'][_0xbcc4('0x60')]({'where':{'name':_0x16a46d,'userProfileId':_0x1757cb[_0xbcc4('0x65')]},'raw':!![]})[_0xbcc4('0x21')](function(_0x48d3e3){if(_0x48d3e3&&_0x48d3e3[_0xbcc4('0x66')]===0x0){return db[_0xbcc4('0x3c')][_0xbcc4('0x61')]({'name':_0x54184e['name'],'resourceId':_0x54184e['id'],'type':_0x48d3e3[_0xbcc4('0x3f')],'sectionId':_0x48d3e3['id']},{})[_0xbcc4('0x21')](function(){return _0x21ccdc;});}else{return _0x21ccdc;}})[_0xbcc4('0x5c')](function(_0x1118a0){logger[_0xbcc4('0x27')](_0xbcc4('0x67'),_0x1118a0);throw _0x1118a0;});}return _0x21ccdc;})['then'](respondWithResult(_0x11ea01,0xc9))['catch'](handleError(_0x11ea01,null));};exports[_0xbcc4('0x38')]=function(_0xe9c6b0,_0x16f48b){if(_0xe9c6b0[_0xbcc4('0x62')]['id']){delete _0xe9c6b0[_0xbcc4('0x62')]['id'];}return db[_0xbcc4('0x43')][_0xbcc4('0x60')]({'where':{'id':_0xe9c6b0[_0xbcc4('0x5e')]['id']},'include':[{'model':db[_0xbcc4('0x41')],'as':_0xbcc4('0x42')}]})['then'](handleEntityNotFound(_0x16f48b,null))[_0xbcc4('0x21')](saveUpdates(_0xe9c6b0[_0xbcc4('0x62')],null))[_0xbcc4('0x21')](respondWithResult(_0x16f48b,null))[_0xbcc4('0x5c')](handleError(_0x16f48b,null));};exports['destroy']=function(_0x3d7a72,_0x5862b0){return db[_0xbcc4('0x43')]['find']({'where':{'id':_0x3d7a72[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x5862b0,null))[_0xbcc4('0x21')](removeEntity(_0x5862b0,null))['catch'](handleError(_0x5862b0,null));};exports[_0xbcc4('0x68')]=function(_0x92dd2c,_0x22e126){return db['FaxAccount'][_0xbcc4('0x68')]()[_0xbcc4('0x21')](respondWithResult(_0x22e126,null))[_0xbcc4('0x5c')](handleError(_0x22e126,null));};exports[_0xbcc4('0x69')]=function(_0x371f36,_0x4e05a5,_0x1884dc){if(_0x371f36[_0xbcc4('0x62')]['id']){delete _0x371f36['body']['id'];}return db[_0xbcc4('0x43')][_0xbcc4('0x60')]({'where':{'id':_0x371f36['params']['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x4e05a5,null))[_0xbcc4('0x21')](function(_0x43a2aa){if(_0x43a2aa){_0x371f36['body'][_0xbcc4('0x6a')]=_0x43a2aa['id'];return db[_0xbcc4('0x6b')][_0xbcc4('0x61')](_0x371f36[_0xbcc4('0x62')]);}})[_0xbcc4('0x21')](respondWithResult(_0x4e05a5,null))[_0xbcc4('0x5c')](handleError(_0x4e05a5,null));};exports['getDispositions']=function(_0x41d6b7,_0x4fc805,_0x3e9192){var _0x3c6bca={'raw':![],'where':{}};var _0x25dd82={};var _0xf28564={'count':0x0,'rows':[]};return db['FaxAccount'][_0xbcc4('0x6c')]({'where':{'id':_0x41d6b7[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x4fc805,null))[_0xbcc4('0x21')](function(_0x5d87b4){if(_0x5d87b4){_0x25dd82[_0xbcc4('0x48')]=_['keys'](db[_0xbcc4('0x6b')][_0xbcc4('0x44')]);_0x25dd82['query']=_[_0xbcc4('0x4b')](_0x41d6b7['query']);_0x25dd82['filters']=_[_0xbcc4('0x4d')](_0x25dd82['model'],_0x25dd82[_0xbcc4('0x4a')]);_0x3c6bca['attributes']=_[_0xbcc4('0x4d')](_0x25dd82[_0xbcc4('0x48')],qs[_0xbcc4('0x4f')](_0x41d6b7['query'][_0xbcc4('0x4f')]));_0x3c6bca['attributes']=_0x3c6bca[_0xbcc4('0x4e')][_0xbcc4('0x50')]?_0x3c6bca[_0xbcc4('0x4e')]:_0x25dd82['model'];if(!_0x41d6b7['query']['hasOwnProperty'](_0xbcc4('0x6d'))){_0x3c6bca[_0xbcc4('0x31')]=qs['limit'](_0x41d6b7[_0xbcc4('0x4a')][_0xbcc4('0x31')]);_0x3c6bca['offset']=qs[_0xbcc4('0x2f')](_0x41d6b7['query']['offset']);}_0x3c6bca[_0xbcc4('0x6e')]=qs[_0xbcc4('0x52')](_0x41d6b7[_0xbcc4('0x4a')][_0xbcc4('0x52')]);_0x3c6bca[_0xbcc4('0x56')]=qs[_0xbcc4('0x4c')](_[_0xbcc4('0x53')](_0x41d6b7[_0xbcc4('0x4a')],_0x25dd82[_0xbcc4('0x4c')]));_0x3c6bca[_0xbcc4('0x56')]['FaxAccountId']=_0x5d87b4['id'];if(_0x41d6b7[_0xbcc4('0x4a')][_0xbcc4('0x54')]){_0x3c6bca[_0xbcc4('0x56')]=_[_0xbcc4('0x55')](_0x3c6bca[_0xbcc4('0x56')],{'$or':_[_0xbcc4('0x49')](_0x3c6bca[_0xbcc4('0x4e')],function(_0x3e5318){var _0x4a4648={};_0x4a4648[_0x3e5318]={'$like':'%'+_0x41d6b7[_0xbcc4('0x4a')]['filter']+'%'};return _0x4a4648;})});}_0x3c6bca=_[_0xbcc4('0x55')]({},_0x3c6bca,_0x41d6b7['options']);return db['Disposition']['count']({'where':_0x3c6bca[_0xbcc4('0x56')]})[_0xbcc4('0x21')](function(_0x307932){_0xf28564['count']=_0x307932;if(_0x41d6b7[_0xbcc4('0x4a')][_0xbcc4('0x58')]){_0x3c6bca[_0xbcc4('0x59')]=[{'all':!![]}];}return db[_0xbcc4('0x6b')]['findAll'](_0x3c6bca);})[_0xbcc4('0x21')](function(_0xc7279d){_0xf28564[_0xbcc4('0x5b')]=_0xc7279d;return _0xf28564;});}})[_0xbcc4('0x21')](respondWithFilteredResult(_0x4fc805,_0x3c6bca))[_0xbcc4('0x5c')](handleError(_0x4fc805,null));};exports['removeDispositions']=function(_0x4cce8d,_0x32ebba,_0x5e771a){return db[_0xbcc4('0x43')][_0xbcc4('0x60')]({'where':{'id':_0x4cce8d[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x32ebba,null))[_0xbcc4('0x21')](function(_0x3589c3){if(_0x3589c3){return _0x3589c3[_0xbcc4('0x6f')](_0x4cce8d[_0xbcc4('0x4a')][_0xbcc4('0x70')]);}})[_0xbcc4('0x21')](respondWithStatusCode(_0x32ebba,null))[_0xbcc4('0x5c')](handleError(_0x32ebba,null));};exports[_0xbcc4('0x71')]=function(_0x29d40f,_0x10e0a8,_0x37d7ee){if(_0x29d40f[_0xbcc4('0x62')]['id']){delete _0x29d40f[_0xbcc4('0x62')]['id'];}return db[_0xbcc4('0x43')][_0xbcc4('0x60')]({'where':{'id':_0x29d40f[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x10e0a8,null))[_0xbcc4('0x21')](function(_0x9d584e){if(_0x9d584e){_0x29d40f[_0xbcc4('0x62')]['FaxAccountId']=_0x9d584e['id'];return db['CannedAnswer'][_0xbcc4('0x61')](_0x29d40f[_0xbcc4('0x62')]);}})[_0xbcc4('0x21')](respondWithResult(_0x10e0a8,null))[_0xbcc4('0x5c')](handleError(_0x10e0a8,null));};exports[_0xbcc4('0x72')]=function(_0x60bed1,_0x585333,_0x229753){var _0x558f82={'raw':![],'where':{}};var _0x27be90={};var _0x5918a8={'count':0x0,'rows':[]};return db[_0xbcc4('0x43')][_0xbcc4('0x6c')]({'where':{'id':_0x60bed1[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x585333,null))[_0xbcc4('0x21')](function(_0x57385d){if(_0x57385d){_0x27be90[_0xbcc4('0x48')]=_[_0xbcc4('0x4b')](db[_0xbcc4('0x73')]['rawAttributes']);_0x27be90[_0xbcc4('0x4a')]=_['keys'](_0x60bed1[_0xbcc4('0x4a')]);_0x27be90['filters']=_[_0xbcc4('0x4d')](_0x27be90[_0xbcc4('0x48')],_0x27be90[_0xbcc4('0x4a')]);_0x558f82[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x27be90['model'],qs[_0xbcc4('0x4f')](_0x60bed1[_0xbcc4('0x4a')][_0xbcc4('0x4f')]));_0x558f82[_0xbcc4('0x4e')]=_0x558f82[_0xbcc4('0x4e')][_0xbcc4('0x50')]?_0x558f82[_0xbcc4('0x4e')]:_0x27be90['model'];if(!_0x60bed1[_0xbcc4('0x4a')]['hasOwnProperty'](_0xbcc4('0x6d'))){_0x558f82[_0xbcc4('0x31')]=qs[_0xbcc4('0x31')](_0x60bed1[_0xbcc4('0x4a')][_0xbcc4('0x31')]);_0x558f82['offset']=qs[_0xbcc4('0x2f')](_0x60bed1[_0xbcc4('0x4a')][_0xbcc4('0x2f')]);}_0x558f82[_0xbcc4('0x6e')]=qs[_0xbcc4('0x52')](_0x60bed1[_0xbcc4('0x4a')][_0xbcc4('0x52')]);_0x558f82['where']=qs[_0xbcc4('0x4c')](_[_0xbcc4('0x53')](_0x60bed1[_0xbcc4('0x4a')],_0x27be90[_0xbcc4('0x4c')]));_0x558f82[_0xbcc4('0x56')][_0xbcc4('0x6a')]=_0x57385d['id'];if(_0x60bed1[_0xbcc4('0x4a')]['filter']){_0x558f82['where']=_['merge'](_0x558f82['where'],{'$or':_[_0xbcc4('0x49')](_0x558f82['attributes'],function(_0x1e950e){var _0xbbbc2c={};_0xbbbc2c[_0x1e950e]={'$like':'%'+_0x60bed1[_0xbcc4('0x4a')][_0xbcc4('0x54')]+'%'};return _0xbbbc2c;})});}_0x558f82=_[_0xbcc4('0x55')]({},_0x558f82,_0x60bed1['options']);return db[_0xbcc4('0x73')]['count']({'where':_0x558f82[_0xbcc4('0x56')]})[_0xbcc4('0x21')](function(_0x286f48){_0x5918a8[_0xbcc4('0x32')]=_0x286f48;if(_0x60bed1[_0xbcc4('0x4a')]['includeAll']){_0x558f82[_0xbcc4('0x59')]=[{'all':!![]}];}return db[_0xbcc4('0x73')]['findAll'](_0x558f82);})[_0xbcc4('0x21')](function(_0x46ed18){_0x5918a8[_0xbcc4('0x5b')]=_0x46ed18;return _0x5918a8;});}})['then'](respondWithFilteredResult(_0x585333,_0x558f82))[_0xbcc4('0x5c')](handleError(_0x585333,null));};exports[_0xbcc4('0x74')]=function(_0x16ce5b,_0x244317,_0x4ba386){return db[_0xbcc4('0x43')][_0xbcc4('0x60')]({'where':{'id':_0x16ce5b[_0xbcc4('0x5e')]['id']}})['then'](handleEntityNotFound(_0x244317,null))['then'](function(_0x2fe5ea){if(_0x2fe5ea){return _0x2fe5ea[_0xbcc4('0x74')](_0x16ce5b[_0xbcc4('0x4a')][_0xbcc4('0x70')]);}})[_0xbcc4('0x21')](respondWithStatusCode(_0x244317,null))[_0xbcc4('0x5c')](handleError(_0x244317,null));};exports[_0xbcc4('0x75')]=function(_0x17a278,_0x4f4f80,_0x529acb){return db['FaxInteraction']['find']({'where':{'id':_0x17a278['params']['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x4f4f80,null))[_0xbcc4('0x21')](function(_0x294daf){if(_0x294daf){return _0x294daf[_0xbcc4('0x75')](_0x17a278[_0xbcc4('0x62')][_0xbcc4('0x70')],_['omit'](_0x17a278['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4f4f80,null))['catch'](handleError(_0x4f4f80,null));};exports[_0xbcc4('0x76')]=function(_0x1f7d1d,_0x508427,_0x41ca71){var _0x45b4c7={'raw':![],'where':{}};var _0x5d6a3f={};var _0x1b8eb2={'count':0x0,'rows':[]};return db[_0xbcc4('0x43')][_0xbcc4('0x6c')]({'where':{'id':_0x1f7d1d[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x508427,null))[_0xbcc4('0x21')](function(_0x2a91d8){if(_0x2a91d8){_0x5d6a3f[_0xbcc4('0x48')]=_['keys'](db[_0xbcc4('0x77')][_0xbcc4('0x44')]);_0x5d6a3f['query']=_[_0xbcc4('0x4b')](_0x1f7d1d[_0xbcc4('0x4a')]);_0x5d6a3f[_0xbcc4('0x4c')]=_[_0xbcc4('0x4d')](_0x5d6a3f[_0xbcc4('0x48')],_0x5d6a3f[_0xbcc4('0x4a')]);_0x45b4c7[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x5d6a3f[_0xbcc4('0x48')],qs['fields'](_0x1f7d1d[_0xbcc4('0x4a')]['fields']));_0x45b4c7[_0xbcc4('0x4e')]=_0x45b4c7[_0xbcc4('0x4e')][_0xbcc4('0x50')]?_0x45b4c7[_0xbcc4('0x4e')]:_0x5d6a3f[_0xbcc4('0x48')];if(!_0x1f7d1d[_0xbcc4('0x4a')]['hasOwnProperty'](_0xbcc4('0x6d'))){_0x45b4c7[_0xbcc4('0x31')]=qs[_0xbcc4('0x31')](_0x1f7d1d['query']['limit']);_0x45b4c7[_0xbcc4('0x2f')]=qs[_0xbcc4('0x2f')](_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x2f')]);}_0x45b4c7[_0xbcc4('0x6e')]=qs[_0xbcc4('0x52')](_0x1f7d1d[_0xbcc4('0x4a')]['sort']);_0x45b4c7['where']=qs[_0xbcc4('0x4c')](_[_0xbcc4('0x53')](_0x1f7d1d[_0xbcc4('0x4a')],_0x5d6a3f['filters']));_0x45b4c7[_0xbcc4('0x56')][_0xbcc4('0x6a')]=_0x2a91d8['id'];if(_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x54')]){_0x45b4c7[_0xbcc4('0x56')]=_[_0xbcc4('0x55')](_0x45b4c7['where'],{'$or':_[_0xbcc4('0x49')](_0x45b4c7[_0xbcc4('0x4e')],function(_0x5e1b76){var _0x283816={};_0x283816[_0x5e1b76]={'$like':'%'+_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x54')]+'%'};return _0x283816;})});}_0x45b4c7=_[_0xbcc4('0x55')]({},_0x45b4c7,_0x1f7d1d['options']);return db[_0xbcc4('0x77')][_0xbcc4('0x32')]({'where':_0x45b4c7[_0xbcc4('0x56')]})[_0xbcc4('0x21')](function(_0x2798a7){_0x1b8eb2[_0xbcc4('0x32')]=_0x2798a7;if(_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x58')]){_0x45b4c7[_0xbcc4('0x59')]=[{'model':db['CmContact'],'as':_0xbcc4('0x78'),'required':![]},{'model':db[_0xbcc4('0x79')],'as':_0xbcc4('0x7a'),'attributes':[_0xbcc4('0x3f'),'fullname',_0xbcc4('0x7b')],'required':![]},{'model':db[_0xbcc4('0x7c')],'as':_0xbcc4('0x7d'),'attributes':['id','name',_0xbcc4('0x7e')],'where':_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x7f')]?{'id':_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x7f')]}:undefined,'required':_0x1f7d1d[_0xbcc4('0x4a')][_0xbcc4('0x7f')]?!![]:![]}];}return db[_0xbcc4('0x77')][_0xbcc4('0x5a')](_0x45b4c7);})[_0xbcc4('0x21')](function(_0x3f2c96){_0x1b8eb2[_0xbcc4('0x5b')]=_0x3f2c96;return _0x1b8eb2;});}})[_0xbcc4('0x21')](respondWithFilteredResult(_0x508427,_0x45b4c7))[_0xbcc4('0x5c')](handleError(_0x508427,null));};exports['addApplications']=function(_0x5e2aab,_0x3d2ac2,_0x48519c){return db['FaxAccount'][_0xbcc4('0x6c')]({'where':{'id':_0x5e2aab[_0xbcc4('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3d2ac2,null))[_0xbcc4('0x21')](function(_0x300979){if(_0x300979){return db[_0xbcc4('0x80')][_0xbcc4('0x81')](function(_0x47ccd5){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x5e2aab[_0xbcc4('0x5e')]['id']},'transaction':_0x47ccd5})[_0xbcc4('0x21')](function(_0x26ac61){var _0x180886=_[_0xbcc4('0x49')](_0x5e2aab['body'],function(_0x5d786d){_0x5d786d['FaxAccountId']=_0x5e2aab[_0xbcc4('0x5e')]['id'];return _0x5d786d;});return db['FaxApplication'][_0xbcc4('0x82')](_0x180886,{'transaction':_0x47ccd5});});})[_0xbcc4('0x21')](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x5e2aab[_0xbcc4('0x5e')]['id']},'order':_0xbcc4('0x83')});});}})[_0xbcc4('0x21')](respondWithResult(_0x3d2ac2,null))[_0xbcc4('0x5c')](handleError(_0x3d2ac2,null));};exports[_0xbcc4('0x84')]=function(_0x5d37f0,_0x35b7e6,_0x14bfd6){var _0x2a7731={};var _0x21361f={};var _0x2ce7a8;var _0x4f9215;return db[_0xbcc4('0x43')][_0xbcc4('0x6c')]({'where':{'id':_0x5d37f0[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x35b7e6,null))[_0xbcc4('0x21')](function(_0x3e163f){if(_0x3e163f){_0x2ce7a8=_0x3e163f;_0x21361f[_0xbcc4('0x48')]=_[_0xbcc4('0x4b')](db[_0xbcc4('0x85')][_0xbcc4('0x44')]);_0x21361f[_0xbcc4('0x4a')]=_['keys'](_0x5d37f0['query']);_0x21361f[_0xbcc4('0x4c')]=_[_0xbcc4('0x4d')](_0x21361f[_0xbcc4('0x48')],_0x21361f[_0xbcc4('0x4a')]);_0x2a7731[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x21361f[_0xbcc4('0x48')],qs['fields'](_0x5d37f0[_0xbcc4('0x4a')]['fields']));_0x2a7731['attributes']=_0x2a7731['attributes'][_0xbcc4('0x50')]?_0x2a7731[_0xbcc4('0x4e')]:_0x21361f[_0xbcc4('0x48')];_0x2a7731[_0xbcc4('0x6e')]=qs[_0xbcc4('0x52')](_0x5d37f0[_0xbcc4('0x4a')][_0xbcc4('0x52')]);_0x2a7731[_0xbcc4('0x56')]=qs[_0xbcc4('0x4c')](_[_0xbcc4('0x53')](_0x5d37f0[_0xbcc4('0x4a')],_0x21361f[_0xbcc4('0x4c')]));if(_0x5d37f0[_0xbcc4('0x4a')]['filter']){_0x2a7731[_0xbcc4('0x56')]=_[_0xbcc4('0x55')](_0x2a7731['where'],{'$or':_['map'](_0x2a7731[_0xbcc4('0x4e')],function(_0x51815c){var _0x131e83={};_0x131e83[_0x51815c]={'$like':'%'+_0x5d37f0['query'][_0xbcc4('0x54')]+'%'};return _0x131e83;})});}_0x2a7731=_['merge']({},_0x2a7731,_0x5d37f0['options']);return _0x2ce7a8[_0xbcc4('0x84')](_0x2a7731);}})[_0xbcc4('0x21')](function(_0x4c7508){if(_0x4c7508){_0x4f9215=_0x4c7508[_0xbcc4('0x50')];if(!_0x5d37f0[_0xbcc4('0x4a')][_0xbcc4('0x51')](_0xbcc4('0x6d'))){_0x2a7731[_0xbcc4('0x31')]=qs['limit'](_0x5d37f0[_0xbcc4('0x4a')][_0xbcc4('0x31')]);_0x2a7731[_0xbcc4('0x2f')]=qs[_0xbcc4('0x2f')](_0x5d37f0[_0xbcc4('0x4a')][_0xbcc4('0x2f')]);}return _0x2ce7a8[_0xbcc4('0x84')](_0x2a7731);}})[_0xbcc4('0x21')](function(_0x3d8d19){if(_0x3d8d19){return _0x3d8d19?{'count':_0x4f9215,'rows':_0x3d8d19}:null;}})[_0xbcc4('0x21')](respondWithResult(_0x35b7e6,null))['catch'](handleError(_0x35b7e6,null));};function Extension(_0x2daf12,_0x25afc5,_0x188abb,_0x5a2fbd){this[_0xbcc4('0x86')]=_0xbcc4('0x87');this[_0xbcc4('0x88')]=_0x2daf12[_0xbcc4('0x89')];this[_0xbcc4('0x8a')]=_0x5a2fbd;this[_0xbcc4('0x46')]=_0xbcc4('0x8b');this[_0xbcc4('0x8c')]=_0xbcc4('0x8d');this[_0xbcc4('0x6a')]=_0x2daf12['id'];this[_0xbcc4('0x83')]=_0x25afc5;this[_0xbcc4('0x8e')]=_0x188abb;}function createExtensionsReciveFax(_0x5504a0){var _0xf6059e=0x1;var _0x36f63d=[];_0x36f63d[_0xbcc4('0x8f')](new Extension(_0x5504a0,_0xf6059e,'',_0xbcc4('0x90')));_0xf6059e+=0x1;_0x36f63d[_0xbcc4('0x8f')](new Extension(_0x5504a0,_0xf6059e,_0xbcc4('0x91'),_0xbcc4('0x92')));_0xf6059e+=0x1;for(var _0x291788 in _0x5504a0){if(_0x5504a0[_0xbcc4('0x51')](_0x291788)&&(_0x291788===_0xbcc4('0x93')||_0x291788===_0xbcc4('0x89')||_0x291788===_0xbcc4('0x94')||_0x291788===_0xbcc4('0x95')||_0x291788===_0xbcc4('0x96')||_0x291788===_0xbcc4('0x97')||_0x291788==='minrate'||_0x291788==='modem'||_0x291788===_0xbcc4('0x98'))){_0x36f63d['push'](new Extension(_0x5504a0,_0xf6059e,_0xbcc4('0x99')+_0x291788+')='+_0x5504a0[_0x291788],_0xbcc4('0x92')));_0xf6059e+=0x1;}}_0x36f63d[_0xbcc4('0x8f')](new Extension(_0x5504a0,_0xf6059e,'6','Wait'));_0xf6059e+=0x1;_0x36f63d['push'](new Extension(_0x5504a0,_0xf6059e,_0xbcc4('0x9a'),_0xbcc4('0x9b')));_0xf6059e=0x0;return _0x36f63d;}exports['addAccountApplications']=function(_0x35e701,_0x5c26e1,_0x45553b){var _0xb64f34;return db['sequelize'][_0xbcc4('0x81')](function(_0x7b2cc){return db[_0xbcc4('0x43')][_0xbcc4('0x61')](_0x35e701[_0xbcc4('0x62')],{'transaction':_0x7b2cc})[_0xbcc4('0x21')](function(_0x12811d){_0xb64f34=_0x12811d[_0xbcc4('0x3a')]({'plain':!![]});return db[_0xbcc4('0x9c')][_0xbcc4('0x82')](createExtensionsReciveFax(_0xb64f34),{'transaction':_0x7b2cc});});})[_0xbcc4('0x21')](function(){return _0xb64f34;})[_0xbcc4('0x21')](respondWithResult(_0x5c26e1,null))[_0xbcc4('0x5c')](handleError(_0x5c26e1,null));};exports[_0xbcc4('0x9d')]=function(_0x3c4c5b,_0xeb531a,_0x478b4f){var _0x23a0ec;return db[_0xbcc4('0x80')]['transaction'](function(_0x54c4db){return db['FaxAccount'][_0xbcc4('0x38')](_0x3c4c5b['body'],{'where':{'id':_0x3c4c5b[_0xbcc4('0x62')]['id']},'transaction':_0x54c4db})['then'](function(_0x5b09db){return db[_0xbcc4('0x9c')][_0xbcc4('0x39')]({'where':{'FaxAccountId':_0x3c4c5b[_0xbcc4('0x62')]['id']},'transaction':_0x54c4db})[_0xbcc4('0x21')](function(_0x4ce89a){return db[_0xbcc4('0x9c')][_0xbcc4('0x82')](createExtensionsReciveFax(_['omit'](_0x3c4c5b[_0xbcc4('0x62')],['tech','key',_0xbcc4('0x9e'),_0xbcc4('0x9f'),_0xbcc4('0xa0'),_0xbcc4('0xa1')])),{'transaction':_0x54c4db});});});})['then'](function(){return db[_0xbcc4('0x43')]['findById'](_0x3c4c5b['body']['id']);})[_0xbcc4('0x21')](respondWithResult(_0xeb531a,null))[_0xbcc4('0x5c')](handleError(_0xeb531a,null));};exports[_0xbcc4('0xa2')]=function(_0x5c8f7c,_0x54cd65,_0x2a1e1e){var _0x460552={'raw':!![],'where':{}};var _0x3bffaa={};var _0xbff081={'count':0x0,'rows':[]};return db[_0xbcc4('0x43')]['findOne']({'where':{'id':_0x5c8f7c[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x54cd65,null))[_0xbcc4('0x21')](function(_0x528bb0){if(_0x528bb0){_0x3bffaa[_0xbcc4('0x48')]=_[_0xbcc4('0x4b')](db[_0xbcc4('0xa3')][_0xbcc4('0x44')]);_0x3bffaa[_0xbcc4('0x4a')]=_[_0xbcc4('0x4b')](_0x5c8f7c[_0xbcc4('0x4a')]);_0x3bffaa['filters']=_[_0xbcc4('0x4d')](_0x3bffaa[_0xbcc4('0x48')],_0x3bffaa[_0xbcc4('0x4a')]);_0x460552[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x3bffaa['model'],qs[_0xbcc4('0x4f')](_0x5c8f7c[_0xbcc4('0x4a')][_0xbcc4('0x4f')]));_0x460552['attributes']=_0x460552[_0xbcc4('0x4e')][_0xbcc4('0x50')]?_0x460552[_0xbcc4('0x4e')]:_0x3bffaa[_0xbcc4('0x48')];if(!_0x5c8f7c['query'][_0xbcc4('0x51')](_0xbcc4('0x6d'))){_0x460552[_0xbcc4('0x31')]=qs[_0xbcc4('0x31')](_0x5c8f7c['query'][_0xbcc4('0x31')]);_0x460552['offset']=qs[_0xbcc4('0x2f')](_0x5c8f7c['query'][_0xbcc4('0x2f')]);}_0x460552[_0xbcc4('0x6e')]=qs[_0xbcc4('0x52')](_0x5c8f7c[_0xbcc4('0x4a')]['sort']);_0x460552[_0xbcc4('0x56')]=qs[_0xbcc4('0x4c')](_['pick'](_0x5c8f7c[_0xbcc4('0x4a')],_0x3bffaa[_0xbcc4('0x4c')]));_0x460552[_0xbcc4('0x56')]['FaxAccountId']=_0x528bb0['id'];if(_0x5c8f7c['query']['filter']){_0x460552['where']=_['merge'](_0x460552[_0xbcc4('0x56')],{'$or':_[_0xbcc4('0x49')](_0x460552[_0xbcc4('0x4e')],function(_0x4db7d3){var _0x405964={};_0x405964[_0x4db7d3]={'$like':'%'+_0x5c8f7c[_0xbcc4('0x4a')][_0xbcc4('0x54')]+'%'};return _0x405964;})});}if(_0x5c8f7c[_0xbcc4('0x4a')][_0xbcc4('0xa4')]){var _0x1d2067=_0x5c8f7c['query']['$gte']['split'](',');var _0x3ff623={};_0x3ff623[_0x1d2067[0x0]]={'$gte':moment(_0x1d2067[0x1])[_0xbcc4('0xa5')](_0xbcc4('0xa6'))};_0x460552[_0xbcc4('0x56')]=_['merge'](_0x460552[_0xbcc4('0x56')],_0x3ff623);}_0x460552=_[_0xbcc4('0x55')]({},_0x460552,_0x5c8f7c[_0xbcc4('0x5f')]);return db[_0xbcc4('0xa3')][_0xbcc4('0x32')]({'where':_0x460552[_0xbcc4('0x56')]})[_0xbcc4('0x21')](function(_0x55e4bf){_0xbff081[_0xbcc4('0x32')]=_0x55e4bf;if(_0x5c8f7c[_0xbcc4('0x4a')][_0xbcc4('0x58')]){_0x460552[_0xbcc4('0x59')]=[{'all':!![]}];}return db[_0xbcc4('0xa3')][_0xbcc4('0x5a')](_0x460552);})[_0xbcc4('0x21')](function(_0x26d378){_0xbff081[_0xbcc4('0x5b')]=_0x26d378;return _0xbff081;});}})[_0xbcc4('0x21')](respondWithFilteredResult(_0x54cd65,_0x460552))[_0xbcc4('0x5c')](handleError(_0x54cd65,null));};exports[_0xbcc4('0xa7')]=function(_0x256b8f,_0x49edf3,_0x1c6ce9){var _0x342b41,_0xc6911b={},_0x376493;if(_0x256b8f[_0xbcc4('0x62')]['to']){_0x376493=_0x256b8f[_0xbcc4('0x62')]['to'][0x0];}return db['FaxAccount'][_0xbcc4('0x60')]({'where':{'id':_0x256b8f[_0xbcc4('0x5e')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xbcc4('0xa8')],'as':_0xbcc4('0xa9'),'where':{'fax':_0x376493},'limit':0x1,'order':[[_0xbcc4('0x9f'),_0xbcc4('0xaa')]]}]}]})[_0xbcc4('0x21')](handleEntityNotFound(_0x49edf3,null))['then'](function(_0x43d330){_0x342b41=_0x43d330;if(_0x256b8f['body'][_0xbcc4('0xab')]&&_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][_0xbcc4('0x50')]){for(var _0x1f65b6=0x0;_0x1f65b6<_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][_0xbcc4('0x50')];_0x1f65b6+=0x1){_0x256b8f['body']['attachments'][_0x1f65b6]={'filename':_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][_0x1f65b6][_0xbcc4('0x3f')],'id':_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][_0x1f65b6]['id'],'path':path[_0xbcc4('0xac')](config[_0xbcc4('0xad')],'server/files/attachments',_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][_0x1f65b6]['basename'])};}}return respondWithRpcPromise(_0xbcc4('0xae'),'CheckAfterSend',{'FaxAccountId':_[_0xbcc4('0xaf')](_0x256b8f[_0xbcc4('0x5e')]['id'])?undefined:_0x256b8f[_0xbcc4('0x5e')]['id'],'path':_[_0xbcc4('0xaf')](_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][0x0][_0xbcc4('0xb0')])?undefined:_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][0x0][_0xbcc4('0xb0')],'fax':_[_0xbcc4('0xaf')](_0x256b8f[_0xbcc4('0x62')]['to'][0x0])?undefined:_0x256b8f[_0xbcc4('0x62')]['to'][0x0]},client9002);})[_0xbcc4('0x21')](function(){if(_0x342b41){if(_[_0xbcc4('0xaf')](_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xb1')])){_0x256b8f['body'][_0xbcc4('0xb1')]=util['format'](_0xbcc4('0xb2'),_0x342b41[_0xbcc4('0x3f')],_0x342b41[_0xbcc4('0xb3')]);}if(_0x342b41[_0xbcc4('0xb4')]){if(_0x342b41[_0xbcc4('0xb4')]['Contacts'][_0xbcc4('0x50')]){return _0x342b41[_0xbcc4('0xb4')][_0xbcc4('0xa9')][0x0];}else{return db['CmContact'][_0xbcc4('0x61')](_[_0xbcc4('0xb5')](_0x256b8f[_0xbcc4('0x62')],{'firstName':_0x256b8f['body']['to'][0x0],'phone':_0x256b8f[_0xbcc4('0x62')]['to'][0x0],'fax':_0x256b8f[_0xbcc4('0x62')]['to'][0x0],'ListId':_0x342b41['ListId']}));}}else{throw new Error(_0xbcc4('0xb6'));}}else{throw new Error(_0xbcc4('0xb7'));}})['then'](function(_0x59f02a){if(_0x59f02a){return db[_0xbcc4('0x77')][_0xbcc4('0x60')]({'where':{'ContactId':_0x59f02a['id'],'closed':![],'FaxAccountId':_0x342b41['id']}})[_0xbcc4('0x21')](function(_0x58f849){if(_0x58f849){return[_0x58f849,![]];}return db[_0xbcc4('0x77')][_0xbcc4('0x61')]({'UserId':_0x256b8f['user']['id'],'ContactId':_0x59f02a['id'],'FaxAccountId':_0x342b41['id'],'fax':_0x256b8f[_0xbcc4('0x62')]['to'][0x0],'firstMsgDirection':_0xbcc4('0xb8'),'Messages':[_[_0xbcc4('0x55')](_0x256b8f[_0xbcc4('0x62')],{'read':![],'body':_0x256b8f['body'][_0xbcc4('0xab')][0x0][_0xbcc4('0xb9')],'FaxAccountId':_0x342b41['id'],'UserId':_0x256b8f[_0xbcc4('0x64')]['id'],'ContactId':_0x59f02a['id'],'AttachmentId':_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xbcc4('0xa3')],'as':'Messages'}]})[_0xbcc4('0x21')](function(_0x19ee58){return[_0x19ee58,!![]];});});}else{throw new Error(_0xbcc4('0xba'));}})[_0xbcc4('0xbb')](function(_0x26553f,_0x2682a3){if(_0x2682a3){return _0x26553f;}return db[_0xbcc4('0xa3')][_0xbcc4('0x61')]({'direction':'out','read':![],'body':_0x256b8f['body'][_0xbcc4('0xab')][0x0]['filename'],'FaxAccountId':_0x342b41['id'],'FaxInteractionId':_0x26553f['id'],'UserId':_0x256b8f[_0xbcc4('0x64')]['id'],'ContactId':_0x26553f[_0xbcc4('0xbc')],'AttachmentId':_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][0x0]['id']})[_0xbcc4('0x21')](function(_0xda2ead){_0x26553f[_0xbcc4('0xbd')][_0xbcc4('0xbe')]=[];_0x26553f['dataValues']['Messages'][_0xbcc4('0x8f')](_0xda2ead['dataValues']);return _0x26553f;});})[_0xbcc4('0x21')](function(_0x33efb5){respondWithRpcPromise(_0xbcc4('0xbf'),_0xbcc4('0xbf'),{'FaxAccountId':_[_0xbcc4('0xaf')](_0x256b8f[_0xbcc4('0x5e')]['id'])?undefined:_0x256b8f['params']['id'],'path':_[_0xbcc4('0xaf')](_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][0x0][_0xbcc4('0xb0')])?undefined:_0x256b8f[_0xbcc4('0x62')][_0xbcc4('0xab')][0x0][_0xbcc4('0xb0')],'fax':_['isNil'](_0x256b8f['body']['to'][0x0])?undefined:_0x256b8f[_0xbcc4('0x62')]['to'][0x0],'AttachmentId':_0x256b8f[_0xbcc4('0x62')]['attachments'][0x0]['id']},client9002)[_0xbcc4('0x21')](function(_0x50cc27){logger[_0xbcc4('0x22')]('SendFaxRpc,\x20%s',_0x50cc27);})[_0xbcc4('0x5c')](function(_0x4a72c6){logger['info']('SendFaxRpc,\x20%s',_0x4a72c6);});return _0x33efb5;})['then'](respondWithResult(_0x49edf3,null))[_0xbcc4('0x5c')](handleError(_0x49edf3,null));};exports['addAgents']=function(_0x3354ff,_0x7b01b8,_0x568dde){return db['FaxAccount'][_0xbcc4('0x60')]({'where':{'id':_0x3354ff[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x7b01b8,null))[_0xbcc4('0x21')](function(_0x1ff524){if(_0x1ff524){return _0x1ff524[_0xbcc4('0xc0')](_0x3354ff[_0xbcc4('0x62')]['ids'],_[_0xbcc4('0xc1')](_0x3354ff[_0xbcc4('0x62')],[_0xbcc4('0x70'),'id'])||{})[_0xbcc4('0xbb')](function(_0x154dce){for(var _0x52b738=0x0;_0x52b738<_0x3354ff['body'][_0xbcc4('0x70')][_0xbcc4('0x50')];_0x52b738+=0x1){socket['emit'](_0xbcc4('0xc2'),{'UserId':Number(_0x3354ff[_0xbcc4('0x62')][_0xbcc4('0x70')][_0x52b738]),'FaxAccountId':Number(_0x3354ff[_0xbcc4('0x5e')]['id'])});}return _0x154dce;});}})[_0xbcc4('0x21')](respondWithResult(_0x7b01b8,null))[_0xbcc4('0x5c')](handleError(_0x7b01b8,null));};exports[_0xbcc4('0xc3')]=function(_0x8a3739,_0x4440c1,_0x30ca0d){return db[_0xbcc4('0x43')]['find']({'where':{'id':_0x8a3739[_0xbcc4('0x5e')]['id']}})[_0xbcc4('0x21')](handleEntityNotFound(_0x4440c1,null))[_0xbcc4('0x21')](function(_0x2f39cd){if(_0x2f39cd){return _0x2f39cd[_0xbcc4('0xc3')](_0x8a3739['query'][_0xbcc4('0x70')])['then'](function(){if(_[_0xbcc4('0xc4')](_0x8a3739[_0xbcc4('0x4a')]['ids'])){for(var _0x1b791f=0x0;_0x1b791f<_0x8a3739[_0xbcc4('0x4a')][_0xbcc4('0x70')]['length'];_0x1b791f+=0x1){socket[_0xbcc4('0xc5')](_0xbcc4('0xc6'),{'UserId':Number(_0x8a3739[_0xbcc4('0x4a')][_0xbcc4('0x70')][_0x1b791f]),'FaxAccountId':Number(_0x8a3739[_0xbcc4('0x5e')]['id'])});}}else{socket[_0xbcc4('0xc5')](_0xbcc4('0xc6'),{'UserId':Number(_0x8a3739[_0xbcc4('0x4a')][_0xbcc4('0x70')]),'FaxAccountId':Number(_0x8a3739[_0xbcc4('0x5e')]['id'])});}});}})[_0xbcc4('0x21')](respondWithStatusCode(_0x4440c1,null))[_0xbcc4('0x5c')](handleError(_0x4440c1,null));};exports[_0xbcc4('0xc7')]=function(_0x2b043d,_0x10f777,_0x5040ae){var _0x55f3a1={};var _0x2e5d90={};var _0x47b2f2;var _0x36d1c5;return db[_0xbcc4('0x43')][_0xbcc4('0x6c')]({'where':{'id':_0x2b043d[_0xbcc4('0x5e')]['id']}})['then'](handleEntityNotFound(_0x10f777,null))[_0xbcc4('0x21')](function(_0x45f0c7){if(_0x45f0c7){_0x47b2f2=_0x45f0c7;_0x2e5d90[_0xbcc4('0x48')]=_[_0xbcc4('0x4b')](db[_0xbcc4('0x79')][_0xbcc4('0x44')]);_0x2e5d90[_0xbcc4('0x4a')]=_['keys'](_0x2b043d[_0xbcc4('0x4a')]);_0x2e5d90[_0xbcc4('0x4c')]=_[_0xbcc4('0x4d')](_0x2e5d90[_0xbcc4('0x48')],_0x2e5d90[_0xbcc4('0x4a')]);_0x55f3a1[_0xbcc4('0x4e')]=_[_0xbcc4('0x4d')](_0x2e5d90[_0xbcc4('0x48')],qs[_0xbcc4('0x4f')](_0x2b043d[_0xbcc4('0x4a')][_0xbcc4('0x4f')]));_0x55f3a1[_0xbcc4('0x4e')]=_0x55f3a1[_0xbcc4('0x4e')][_0xbcc4('0x50')]?_0x55f3a1[_0xbcc4('0x4e')]:_0x2e5d90[_0xbcc4('0x48')];_0x55f3a1['order']=qs[_0xbcc4('0x52')](_0x2b043d[_0xbcc4('0x4a')][_0xbcc4('0x52')]);_0x55f3a1[_0xbcc4('0x56')]=qs['filters'](_[_0xbcc4('0x53')](_0x2b043d[_0xbcc4('0x4a')],_0x2e5d90[_0xbcc4('0x4c')]));if(_0x2b043d[_0xbcc4('0x4a')][_0xbcc4('0x54')]){_0x55f3a1[_0xbcc4('0x56')]=_['merge'](_0x55f3a1['where'],{'$or':_[_0xbcc4('0x49')](_0x55f3a1[_0xbcc4('0x4e')],function(_0x4f476e){var _0x150903={};_0x150903[_0x4f476e]={'$like':'%'+_0x2b043d['query'][_0xbcc4('0x54')]+'%'};return _0x150903;})});}_0x55f3a1=_['merge']({},_0x55f3a1,_0x2b043d['options']);return _0x47b2f2[_0xbcc4('0xc7')](_0x55f3a1);}})[_0xbcc4('0x21')](function(_0x3069f1){if(_0x3069f1){_0x36d1c5=_0x3069f1[_0xbcc4('0x50')];if(!_0x2b043d[_0xbcc4('0x4a')][_0xbcc4('0x51')]('nolimit')){_0x55f3a1[_0xbcc4('0x31')]=qs[_0xbcc4('0x31')](_0x2b043d[_0xbcc4('0x4a')]['limit']);_0x55f3a1[_0xbcc4('0x2f')]=qs[_0xbcc4('0x2f')](_0x2b043d[_0xbcc4('0x4a')]['offset']);}return _0x47b2f2[_0xbcc4('0xc7')](_0x55f3a1);}})['then'](function(_0x4609e7){if(_0x4609e7){return _0x4609e7?{'count':_0x36d1c5,'rows':_0x4609e7}:null;}})['then'](respondWithResult(_0x10f777,null))[_0xbcc4('0x5c')](handleError(_0x10f777,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 20d9e40..e37994b 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 _0x95c8=['hook','exports','../../mysqldb','FaxAccount','save','update','emit','hasOwnProperty'];(function(_0x43d214,_0x254a47){var _0x3620ab=function(_0x13d2d5){while(--_0x13d2d5){_0x43d214['push'](_0x43d214['shift']());}};_0x3620ab(++_0x254a47);}(_0x95c8,0x16a));var _0x895c=function(_0x54ff6b,_0xcc22e8){_0x54ff6b=_0x54ff6b-0x0;var _0x1e4946=_0x95c8[_0x54ff6b];return _0x1e4946;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x895c('0x0'))['db'][_0x895c('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x895c('0x2'),'afterUpdate':_0x895c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25a39e){return function(_0x8f63a,_0x3d77b0,_0x38a8e9){FaxAccountEvents[_0x895c('0x4')](_0x25a39e+':'+_0x8f63a['id'],_0x8f63a);FaxAccountEvents[_0x895c('0x4')](_0x25a39e,_0x8f63a);_0x38a8e9(null);};}for(var e in events){if(events[_0x895c('0x5')](e)){var event=events[e];FaxAccount[_0x895c('0x6')](e,emitEvent(event));}}module[_0x895c('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x5ef8=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x5ef8,0x94));var _0x85ef=function(_0x12a1f5,_0x252768){_0x12a1f5=_0x12a1f5-0x0;var _0x2f8009=_0x5ef8[_0x12a1f5];return _0x2f8009;};'use strict';var EventEmitter=require(_0x85ef('0x0'));var FaxAccount=require(_0x85ef('0x1'))['db'][_0x85ef('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x85ef('0x3')](0x0);var events={'afterCreate':_0x85ef('0x4'),'afterUpdate':_0x85ef('0x5'),'afterDestroy':_0x85ef('0x6')};function emitEvent(_0x10a03f){return function(_0x47adbc,_0x1e40c2,_0x3420f0){FaxAccountEvents[_0x85ef('0x7')](_0x10a03f+':'+_0x47adbc['id'],_0x47adbc);FaxAccountEvents['emit'](_0x10a03f,_0x47adbc);_0x3420f0(null);};}for(var e in events){if(events[_0x85ef('0x8')](e)){var event=events[e];FaxAccount[_0x85ef('0x9')](e,emitEvent(event));}}module[_0x85ef('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 21be904..7f62236 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 _0x4a1e=['request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird'];(function(_0xa84867,_0x5ef796){var _0x473d9a=function(_0x228d1c){while(--_0x228d1c){_0xa84867['push'](_0xa84867['shift']());}};_0x473d9a(++_0x5ef796);}(_0x4a1e,0xa3));var _0xe4a1=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x4a1e[_0x5bfb78];return _0x4efd00;};'use strict';var _=require(_0xe4a1('0x0'));var util=require(_0xe4a1('0x1'));var logger=require('../../config/logger')(_0xe4a1('0x2'));var moment=require(_0xe4a1('0x3'));var BPromise=require(_0xe4a1('0x4'));var rp=require(_0xe4a1('0x5'));var fs=require('fs');var path=require(_0xe4a1('0x6'));var rimraf=require(_0xe4a1('0x7'));var config=require(_0xe4a1('0x8'));var attributes=require(_0xe4a1('0x9'));module['exports']=function(_0x133016,_0x126f84){return _0x133016['define'](_0xe4a1('0xa'),attributes,{'tableName':_0xe4a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeeda=['exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x45856b,_0x996f16){var _0x528021=function(_0x2dd503){while(--_0x2dd503){_0x45856b['push'](_0x45856b['shift']());}};_0x528021(++_0x996f16);}(_0xeeda,0x88));var _0xaeed=function(_0x3fd66d,_0x56f385){_0x3fd66d=_0x3fd66d-0x0;var _0x2ce24d=_0xeeda[_0x3fd66d];return _0x2ce24d;};'use strict';var _=require(_0xaeed('0x0'));var util=require('util');var logger=require(_0xaeed('0x1'))(_0xaeed('0x2'));var moment=require('moment');var BPromise=require(_0xaeed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaeed('0x4'));var config=require(_0xaeed('0x5'));var attributes=require(_0xaeed('0x6'));module[_0xaeed('0x7')]=function(_0x401037,_0x258603){return _0x401037[_0xaeed('0x8')](_0xaeed('0x9'),attributes,{'tableName':_0xaeed('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 257d241..003eea7 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 _0x9438=['FaxAccount,\x20%s,\x20%s','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','Applications','List','get','applications','list','priority','length','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','create','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','./faxAccount.socket','register','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x583121,_0x7a91e6){var _0x4a9736=function(_0x43182c){while(--_0x43182c){_0x583121['push'](_0x583121['shift']());}};_0x4a9736(++_0x7a91e6);}(_0x9438,0xf5));var _0x8943=function(_0x552950,_0x1bdbe6){_0x552950=_0x552950-0x0;var _0x35cda2=_0x9438[_0x552950];return _0x35cda2;};'use strict';var _=require(_0x8943('0x0'));var util=require(_0x8943('0x1'));var moment=require(_0x8943('0x2'));var BPromise=require(_0x8943('0x3'));var rs=require(_0x8943('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8943('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8943('0x6'))(_0x8943('0x7'));var config=require('../../config/environment');var jayson=require(_0x8943('0x8'));var client=jayson['client'][_0x8943('0x9')]({'port':0x232c});config[_0x8943('0xa')]=_['defaults'](config[_0x8943('0xa')],{'host':_0x8943('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8943('0xa')]));require(_0x8943('0xc'))[_0x8943('0xd')](socket);function respondWithRpcPromise(_0x3e8d79,_0x401b04,_0x350ee7){return new BPromise(function(_0x3eebe6,_0x708f9){return client['request'](_0x3e8d79,_0x350ee7)[_0x8943('0xe')](function(_0x5b76f1){logger['info']('FaxAccount,\x20%s,\x20%s',_0x401b04,_0x8943('0xf'));logger[_0x8943('0x10')](_0x8943('0x11'),_0x401b04,_0x8943('0xf'),JSON[_0x8943('0x12')](_0x5b76f1));if(_0x5b76f1['error']){if(_0x5b76f1[_0x8943('0x13')][_0x8943('0x14')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x401b04,_0x5b76f1[_0x8943('0x13')][_0x8943('0x15')]);return _0x708f9(_0x5b76f1['error']['message']);}logger[_0x8943('0x13')](_0x8943('0x16'),_0x401b04,_0x5b76f1[_0x8943('0x13')]['message']);return _0x3eebe6(_0x5b76f1[_0x8943('0x13')][_0x8943('0x15')]);}else{logger[_0x8943('0x17')](_0x8943('0x16'),_0x401b04,_0x8943('0xf'));_0x3eebe6(_0x5b76f1[_0x8943('0x18')]['message']);}})[_0x8943('0x19')](function(_0x51cf54){logger['error'](_0x8943('0x16'),_0x401b04,_0x51cf54);_0x708f9(_0x51cf54);});});}exports[_0x8943('0x1a')]=function(_0x1b96fb){var _0x38c010=this;return new Promise(function(_0x13248c,_0x4513ff){return db[_0x8943('0x1b')][_0x8943('0x1c')]({'raw':_0x1b96fb[_0x8943('0x1d')]?_0x1b96fb[_0x8943('0x1d')][_0x8943('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b96fb[_0x8943('0x1d')]?_0x1b96fb['options']['where']||null:null,'attributes':_0x1b96fb['options']?_0x1b96fb[_0x8943('0x1d')][_0x8943('0x1f')]||null:null,'limit':_0x1b96fb[_0x8943('0x1d')]?_0x1b96fb['options']['limit']||null:null,'include':_0x1b96fb[_0x8943('0x1d')]?_0x1b96fb[_0x8943('0x1d')][_0x8943('0x20')]?_[_0x8943('0x21')](_0x1b96fb['options'][_0x8943('0x20')],function(_0x446ff3){return{'model':db[_0x446ff3[_0x8943('0x22')]],'as':_0x446ff3['as'],'attributes':_0x446ff3['attributes'],'include':_0x446ff3[_0x8943('0x20')]?_[_0x8943('0x21')](_0x446ff3[_0x8943('0x20')],function(_0x2ed282){return{'model':db[_0x2ed282[_0x8943('0x22')]],'as':_0x2ed282['as'],'attributes':_0x2ed282[_0x8943('0x1f')],'include':_0x2ed282[_0x8943('0x20')]?_[_0x8943('0x21')](_0x2ed282[_0x8943('0x20')],function(_0xcabef9){return{'model':db[_0xcabef9[_0x8943('0x22')]],'as':_0xcabef9['as'],'attributes':_0xcabef9[_0x8943('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf2794c){logger[_0x8943('0x17')]('GetFaxAccount',_0x1b96fb);logger[_0x8943('0x10')](_0x8943('0x1a'),_0x1b96fb,JSON[_0x8943('0x12')](_0xf2794c));_0x13248c(_0xf2794c);})[_0x8943('0x19')](function(_0x4238c7){logger[_0x8943('0x13')](_0x8943('0x1a'),_0x4238c7['message'],_0x1b96fb);_0x4513ff(_0x38c010[_0x8943('0x13')](0x1f4,_0x4238c7[_0x8943('0x15')]));});});};exports[_0x8943('0x23')]=function(_0x4be647,_0x18e0e2,_0x540ee8){var _0x29bf60=this;return new Promise(function(_0x9ccdcd,_0x3e47d6){var _0x5658b8={'body':_0x4be647[_0x8943('0x24')],'channel':_0x8943('0x25')};var _0x5e02fb=[];var _0x54e557=[];var _0xa098b1={};return db[_0x8943('0x26')][_0x8943('0x27')]()['then'](function(_0x7b5ba0){if(!_0x7b5ba0){throw new db['Sequelize'][(_0x8943('0x28'))]('no\x20available\x20attributes');}_0x5e02fb=_[_0x8943('0x29')](_['keys'](_0x7b5ba0),[_0x8943('0x2a'),_0x8943('0x2b')]);_0x54e557=_[_0x8943('0x29')](_[_0x8943('0x2c')](_0x7b5ba0),[_0x8943('0x2a'),_0x8943('0x2b'),_0x8943('0x2d'),_0x8943('0x2e')]);if(_0x4be647[_0x8943('0x24')]['id']){delete _0x4be647[_0x8943('0x24')]['id'];}if(_[_0x8943('0x2f')](_0x4be647[_0x8943('0x24')][_0x8943('0x30')])){throw new db['Sequelize']['ValidationError'](_0x8943('0x31'));}if(_[_0x8943('0x2f')](_0x4be647[_0x8943('0x24')][_0x8943('0x24')])||_0x4be647[_0x8943('0x24')]['body']===''){throw new db[(_0x8943('0x32'))][(_0x8943('0x28'))](_0x8943('0x33'));}if(_[_0x8943('0x2f')](_0x4be647['body'][_0x8943('0x34')])){throw new db[(_0x8943('0x32'))][(_0x8943('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54e557);}if(!_[_0x8943('0x35')](_0x54e557,_0x4be647[_0x8943('0x24')]['mapKey'])){throw new db['Sequelize'][(_0x8943('0x28'))](_0x8943('0x36')+_0x54e557);}_0xa098b1[_0x4be647['body'][_0x8943('0x34')]]=_0x4be647[_0x8943('0x24')][_0x8943('0x30')];})['then'](function(){return db[_0x8943('0x1b')][_0x8943('0x37')]({'where':{'id':_0x4be647[_0x8943('0x38')]['id']},'include':[{'model':db[_0x8943('0x39')],'as':'List','include':[{'model':db[_0x8943('0x26')],'as':_0x8943('0x3a'),'where':_0xa098b1,'limit':0x1,'order':[[_0x8943('0x2b'),_0x8943('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0x8943('0x3c')}]});})[_0x8943('0xe')](function(_0x27cf56){if(_0x27cf56&&_0x27cf56[_0x8943('0x3d')]){var _0xe55081=_0x27cf56[_0x8943('0x3e')]({'plain':!![]});_0x5658b8[_0x8943('0x38')]=_0xe55081;_0x5658b8[_0x8943('0x3f')]=_0xe55081['Applications'];_0x5658b8[_0x8943('0x40')]=_0xe55081[_0x8943('0x3d')];_0x5658b8[_0x8943('0x3f')]=_['orderBy'](_0x5658b8[_0x8943('0x3f')],[_0x8943('0x41')],['asc']);if(_0x5658b8['account'][_0x8943('0x3c')]){delete _0x5658b8[_0x8943('0x38')][_0x8943('0x3c')];}if(_0x5658b8['account'][_0x8943('0x3d')]&&_0x5658b8[_0x8943('0x38')][_0x8943('0x3d')]['Contacts'][_0x8943('0x42')]){return _0x5658b8[_0x8943('0x38')][_0x8943('0x3d')][_0x8943('0x3a')][0x0];}var _0x43d67f=_['defaults'](_0x4be647[_0x8943('0x24')],{'firstName':_0x4be647[_0x8943('0x24')][_0x8943('0x30')],'ListId':_0xe55081[_0x8943('0x2e')]});_0x43d67f[_0x4be647[_0x8943('0x24')][_0x8943('0x34')]]=_0x4be647[_0x8943('0x24')][_0x8943('0x30')];return db[_0x8943('0x26')]['create'](_0x43d67f,{'fields':_0x5e02fb,'raw':!![]});}})['then'](function(_0x3527a5){_0x5658b8[_0x8943('0x43')]=_0x3527a5;if(_0x3527a5){var _0x4ae891={'ContactId':_0x3527a5['id'],'FaxAccountId':_0x4be647[_0x8943('0x38')]['id'],'fax':_0x3527a5[_0x8943('0x25')]};return db[_0x8943('0x44')][_0x8943('0x37')]({'where':{'ContactId':_0x3527a5['id'],'closed':![],'FaxAccountId':_0x4be647['account']['id']}})[_0x8943('0xe')](function(_0x3dccc1){if(_0x3dccc1){return[_0x3dccc1,![]];}return db[_0x8943('0x44')]['create'](_0x4ae891)[_0x8943('0xe')](function(_0x410fcd){return[_0x410fcd,!![]];});});}else{throw new Error(_0x8943('0x45'));}})[_0x8943('0x46')](function(_0x2a9e50,_0x473ba1){var _0x2d86e2=_0x2a9e50['get']({'plain':!![]});if(_0x473ba1){if(_0x5658b8['account'][_0x8943('0x47')]){_0x5658b8[_0x8943('0x3f')][_0x8943('0x48')]({'id':0x0,'priority':_0x5658b8[_0x8943('0x3f')][_0x8943('0x42')]+0x1,'app':_0x8943('0x49'),'appdata':'unmanaged','interval':_0x8943('0x4a')});}_0x2d86e2[_0x8943('0x4b')]=!![];}else{_0x2d86e2[_0x8943('0x4b')]=![];}_0x5658b8[_0x8943('0x4c')]=_0x2d86e2;return db[_0x8943('0x4d')][_0x8943('0x4e')]({'body':_0x4be647[_0x8943('0x24')]['body'],'FaxAccountId':_0x4be647['account']['id'],'FaxInteractionId':_0x2a9e50['id'],'direction':'in','ContactId':_0x2a9e50[_0x8943('0x4f')],'AttachmentId':_0x4be647[_0x8943('0x24')][_0x8943('0x50')]});})['then'](function(_0x7bdf09){_0x5658b8[_0x8943('0x15')]=_0x7bdf09;if(_0x5658b8['interaction'][_0x8943('0x51')]){return db[_0x8943('0x52')][_0x8943('0x37')]({'attributes':['id',_0x8943('0x53')],'where':{'id':_0x5658b8[_0x8943('0x4c')]['UserId']}})[_0x8943('0xe')](function(_0x33ca5b){if(_0x33ca5b){_0x5658b8[_0x8943('0x3f')][_0x8943('0x54')]({'id':0x0,'priority':0x0,'app':_0x8943('0x55'),'appdata':_0x33ca5b['name']+','+(_0x5658b8[_0x8943('0x38')][_0x8943('0x56')]||0xa),'interval':_0x8943('0x4a')});}return respondWithRpcPromise('Start','startRouting',_0x5658b8);});}return respondWithRpcPromise(_0x8943('0x57'),_0x8943('0x58'),_0x5658b8);})[_0x8943('0xe')](function(_0xeec2a8){_0x9ccdcd(_0xeec2a8);})[_0x8943('0x19')](function(_0x469a32){_0x3e47d6(_0x29bf60[_0x8943('0x13')](0x1f4,_0x469a32[_0x8943('0x15')]));});});}; \ No newline at end of file +var _0xd937=['map','model','stringify','GetFaxAccount','body','fax','CmContact','describe','ValidationError','keys','updatedAt','difference','createdAt','CompanyId','ListId','from','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','get','applications','Applications','list','orderBy','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','FaxAccount,\x20%s,\x20%s','message','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x28ac88,_0x37e1cf){var _0x761a26=function(_0x31240b){while(--_0x31240b){_0x28ac88['push'](_0x28ac88['shift']());}};_0x761a26(++_0x37e1cf);}(_0xd937,0x196));var _0x7d93=function(_0x35e7c5,_0x3c3fa5){_0x35e7c5=_0x35e7c5-0x0;var _0x2d010f=_0xd937[_0x35e7c5];return _0x2d010f;};'use strict';var _=require(_0x7d93('0x0'));var util=require(_0x7d93('0x1'));var moment=require(_0x7d93('0x2'));var BPromise=require(_0x7d93('0x3'));var rs=require(_0x7d93('0x4'));var fs=require('fs');var Redis=require(_0x7d93('0x5'));var db=require(_0x7d93('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d93('0x7'))(_0x7d93('0x8'));var config=require(_0x7d93('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d93('0xa')][_0x7d93('0xb')]({'port':0x232c});config[_0x7d93('0xc')]=_['defaults'](config[_0x7d93('0xc')],{'host':_0x7d93('0xd'),'port':0x18eb});var socket=require(_0x7d93('0xe'))(new Redis(config[_0x7d93('0xc')]));require('./faxAccount.socket')[_0x7d93('0xf')](socket);function respondWithRpcPromise(_0x36a699,_0x1a92fa,_0x14d9e1){return new BPromise(function(_0x376176,_0x1d77b0){return client[_0x7d93('0x10')](_0x36a699,_0x14d9e1)[_0x7d93('0x11')](function(_0x46619d){logger[_0x7d93('0x12')]('FaxAccount,\x20%s,\x20%s',_0x1a92fa,_0x7d93('0x13'));logger[_0x7d93('0x14')](_0x7d93('0x15'),_0x1a92fa,_0x7d93('0x13'),JSON['stringify'](_0x46619d));if(_0x46619d[_0x7d93('0x16')]){if(_0x46619d[_0x7d93('0x16')]['code']===0x1f4){logger[_0x7d93('0x16')](_0x7d93('0x17'),_0x1a92fa,_0x46619d[_0x7d93('0x16')]['message']);return _0x1d77b0(_0x46619d[_0x7d93('0x16')][_0x7d93('0x18')]);}logger[_0x7d93('0x16')](_0x7d93('0x17'),_0x1a92fa,_0x46619d[_0x7d93('0x16')][_0x7d93('0x18')]);return _0x376176(_0x46619d[_0x7d93('0x16')][_0x7d93('0x18')]);}else{logger[_0x7d93('0x12')]('FaxAccount,\x20%s,\x20%s',_0x1a92fa,'request\x20sent');_0x376176(_0x46619d['result'][_0x7d93('0x18')]);}})[_0x7d93('0x19')](function(_0x55d430){logger['error'](_0x7d93('0x17'),_0x1a92fa,_0x55d430);_0x1d77b0(_0x55d430);});});}exports['GetFaxAccount']=function(_0x26e72c){var _0xda31c7=this;return new Promise(function(_0x520879,_0x4782a7){return db[_0x7d93('0x1a')][_0x7d93('0x1b')]({'raw':_0x26e72c[_0x7d93('0x1c')]?_0x26e72c[_0x7d93('0x1c')][_0x7d93('0x1d')]===undefined?!![]:![]:!![],'where':_0x26e72c[_0x7d93('0x1c')]?_0x26e72c[_0x7d93('0x1c')][_0x7d93('0x1e')]||null:null,'attributes':_0x26e72c[_0x7d93('0x1c')]?_0x26e72c[_0x7d93('0x1c')][_0x7d93('0x1f')]||null:null,'limit':_0x26e72c[_0x7d93('0x1c')]?_0x26e72c[_0x7d93('0x1c')][_0x7d93('0x20')]||null:null,'include':_0x26e72c[_0x7d93('0x1c')]?_0x26e72c[_0x7d93('0x1c')][_0x7d93('0x21')]?_[_0x7d93('0x22')](_0x26e72c[_0x7d93('0x1c')][_0x7d93('0x21')],function(_0x3a6337){return{'model':db[_0x3a6337['model']],'as':_0x3a6337['as'],'attributes':_0x3a6337[_0x7d93('0x1f')],'include':_0x3a6337[_0x7d93('0x21')]?_[_0x7d93('0x22')](_0x3a6337[_0x7d93('0x21')],function(_0x18472d){return{'model':db[_0x18472d[_0x7d93('0x23')]],'as':_0x18472d['as'],'attributes':_0x18472d[_0x7d93('0x1f')],'include':_0x18472d[_0x7d93('0x21')]?_['map'](_0x18472d[_0x7d93('0x21')],function(_0x388dd4){return{'model':db[_0x388dd4[_0x7d93('0x23')]],'as':_0x388dd4['as'],'attributes':_0x388dd4[_0x7d93('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7d93('0x11')](function(_0x336259){logger['info']('GetFaxAccount',_0x26e72c);logger[_0x7d93('0x14')]('GetFaxAccount',_0x26e72c,JSON[_0x7d93('0x24')](_0x336259));_0x520879(_0x336259);})[_0x7d93('0x19')](function(_0x292ede){logger['error'](_0x7d93('0x25'),_0x292ede[_0x7d93('0x18')],_0x26e72c);_0x4782a7(_0xda31c7[_0x7d93('0x16')](0x1f4,_0x292ede[_0x7d93('0x18')]));});});};exports['NotifyFaxAccount']=function(_0xc32016,_0x368517,_0x160578){var _0x189d45=this;return new Promise(function(_0x34bc6d,_0x151db9){var _0x345c1f={'body':_0xc32016[_0x7d93('0x26')],'channel':_0x7d93('0x27')};var _0x568cc3=[];var _0x117187=[];var _0x9fb7d9={};return db[_0x7d93('0x28')][_0x7d93('0x29')]()[_0x7d93('0x11')](function(_0x5af08f){if(!_0x5af08f){throw new db['Sequelize'][(_0x7d93('0x2a'))]('no\x20available\x20attributes');}_0x568cc3=_['difference'](_[_0x7d93('0x2b')](_0x5af08f),['createdAt',_0x7d93('0x2c')]);_0x117187=_[_0x7d93('0x2d')](_[_0x7d93('0x2b')](_0x5af08f),[_0x7d93('0x2e'),_0x7d93('0x2c'),_0x7d93('0x2f'),_0x7d93('0x30')]);if(_0xc32016['body']['id']){delete _0xc32016[_0x7d93('0x26')]['id'];}if(_['isNil'](_0xc32016['body'][_0x7d93('0x31')])){throw new db['Sequelize'][(_0x7d93('0x2a'))]('from\x20is\x20mandatory');}if(_[_0x7d93('0x32')](_0xc32016[_0x7d93('0x26')]['body'])||_0xc32016['body']['body']===''){throw new db[(_0x7d93('0x33'))][(_0x7d93('0x2a'))](_0x7d93('0x34'));}if(_[_0x7d93('0x32')](_0xc32016[_0x7d93('0x26')]['mapKey'])){throw new db[(_0x7d93('0x33'))][(_0x7d93('0x2a'))](_0x7d93('0x35')+_0x117187);}if(!_[_0x7d93('0x36')](_0x117187,_0xc32016[_0x7d93('0x26')][_0x7d93('0x37')])){throw new db[(_0x7d93('0x33'))][(_0x7d93('0x2a'))](_0x7d93('0x38')+_0x117187);}_0x9fb7d9[_0xc32016[_0x7d93('0x26')][_0x7d93('0x37')]]=_0xc32016[_0x7d93('0x26')][_0x7d93('0x31')];})[_0x7d93('0x11')](function(){return db[_0x7d93('0x1a')][_0x7d93('0x39')]({'where':{'id':_0xc32016[_0x7d93('0x3a')]['id']},'include':[{'model':db[_0x7d93('0x3b')],'as':_0x7d93('0x3c'),'include':[{'model':db[_0x7d93('0x28')],'as':_0x7d93('0x3d'),'where':_0x9fb7d9,'limit':0x1,'order':[[_0x7d93('0x2c'),'DESC']]}]},{'model':db[_0x7d93('0x3e')],'as':'Applications'}]});})['then'](function(_0x1253b4){if(_0x1253b4&&_0x1253b4['List']){var _0x31dd85=_0x1253b4[_0x7d93('0x3f')]({'plain':!![]});_0x345c1f[_0x7d93('0x3a')]=_0x31dd85;_0x345c1f[_0x7d93('0x40')]=_0x31dd85[_0x7d93('0x41')];_0x345c1f[_0x7d93('0x42')]=_0x31dd85[_0x7d93('0x3c')];_0x345c1f[_0x7d93('0x40')]=_[_0x7d93('0x43')](_0x345c1f[_0x7d93('0x40')],['priority'],['asc']);if(_0x345c1f[_0x7d93('0x3a')][_0x7d93('0x41')]){delete _0x345c1f[_0x7d93('0x3a')][_0x7d93('0x41')];}if(_0x345c1f[_0x7d93('0x3a')][_0x7d93('0x3c')]&&_0x345c1f[_0x7d93('0x3a')][_0x7d93('0x3c')][_0x7d93('0x3d')][_0x7d93('0x44')]){return _0x345c1f['account'][_0x7d93('0x3c')]['Contacts'][0x0];}var _0x185b56=_['defaults'](_0xc32016[_0x7d93('0x26')],{'firstName':_0xc32016[_0x7d93('0x26')]['from'],'ListId':_0x31dd85['ListId']});_0x185b56[_0xc32016[_0x7d93('0x26')][_0x7d93('0x37')]]=_0xc32016[_0x7d93('0x26')][_0x7d93('0x31')];return db[_0x7d93('0x28')][_0x7d93('0x45')](_0x185b56,{'fields':_0x568cc3,'raw':!![]});}})[_0x7d93('0x11')](function(_0xf0db0c){_0x345c1f[_0x7d93('0x46')]=_0xf0db0c;if(_0xf0db0c){var _0x320017={'ContactId':_0xf0db0c['id'],'FaxAccountId':_0xc32016[_0x7d93('0x3a')]['id'],'fax':_0xf0db0c['fax']};return db['FaxInteraction'][_0x7d93('0x39')]({'where':{'ContactId':_0xf0db0c['id'],'closed':![],'FaxAccountId':_0xc32016[_0x7d93('0x3a')]['id']}})[_0x7d93('0x11')](function(_0x4389e8){if(_0x4389e8){return[_0x4389e8,![]];}return db[_0x7d93('0x47')][_0x7d93('0x45')](_0x320017)[_0x7d93('0x11')](function(_0x4db802){return[_0x4db802,!![]];});});}else{throw new Error(_0x7d93('0x48'));}})[_0x7d93('0x49')](function(_0x6305bc,_0x15ea32){var _0x3da1fc=_0x6305bc[_0x7d93('0x3f')]({'plain':!![]});if(_0x15ea32){if(_0x345c1f[_0x7d93('0x3a')]['autoclose']){_0x345c1f['applications'][_0x7d93('0x4a')]({'id':0x0,'priority':_0x345c1f['applications'][_0x7d93('0x44')]+0x1,'app':_0x7d93('0x4b'),'appdata':_0x7d93('0x4c'),'interval':'*,*,*,*'});}_0x3da1fc[_0x7d93('0x4d')]=!![];}else{_0x3da1fc[_0x7d93('0x4d')]=![];}_0x345c1f[_0x7d93('0x4e')]=_0x3da1fc;return db[_0x7d93('0x4f')]['create']({'body':_0xc32016[_0x7d93('0x26')][_0x7d93('0x26')],'FaxAccountId':_0xc32016[_0x7d93('0x3a')]['id'],'FaxInteractionId':_0x6305bc['id'],'direction':'in','ContactId':_0x6305bc[_0x7d93('0x50')],'AttachmentId':_0xc32016['body'][_0x7d93('0x51')]});})[_0x7d93('0x11')](function(_0x3f77d6){_0x345c1f[_0x7d93('0x18')]=_0x3f77d6;if(_0x345c1f[_0x7d93('0x4e')][_0x7d93('0x52')]){return db[_0x7d93('0x53')][_0x7d93('0x39')]({'attributes':['id',_0x7d93('0x54')],'where':{'id':_0x345c1f[_0x7d93('0x4e')]['UserId']}})[_0x7d93('0x11')](function(_0x18d2f4){if(_0x18d2f4){_0x345c1f[_0x7d93('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x18d2f4[_0x7d93('0x54')]+','+(_0x345c1f['account'][_0x7d93('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x7d93('0x56'),_0x345c1f);});}return respondWithRpcPromise(_0x7d93('0x57'),_0x7d93('0x56'),_0x345c1f);})['then'](function(_0x3aaaed){_0x34bc6d(_0x3aaaed);})[_0x7d93('0x19')](function(_0x39a7a6){_0x151db9(_0x189d45['error'](0x1f4,_0x39a7a6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index d4bfa69..100f65c 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 _0x085c=['faxAccount:','./faxAccount.events','save','remove','update','emit','register','length'];(function(_0x46fa2d,_0x39edbd){var _0x34ace0=function(_0x5b95bc){while(--_0x5b95bc){_0x46fa2d['push'](_0x46fa2d['shift']());}};_0x34ace0(++_0x39edbd);}(_0x085c,0x1b1));var _0xc085=function(_0x3855f4,_0x16073b){_0x3855f4=_0x3855f4-0x0;var _0x3d4e63=_0x085c[_0x3855f4];return _0x3d4e63;};'use strict';var FaxAccountEvents=require(_0xc085('0x0'));var events=[_0xc085('0x1'),_0xc085('0x2'),_0xc085('0x3')];function createListener(_0xe5afa,_0x5978ec){return function(_0x548d24){_0x5978ec[_0xc085('0x4')](_0xe5afa,_0x548d24);};}function removeListener(_0x3deaa4,_0x3b277f){return function(){FaxAccountEvents['removeListener'](_0x3deaa4,_0x3b277f);};}exports[_0xc085('0x5')]=function(_0x462e44){for(var _0x44ca02=0x0,_0x4304fc=events[_0xc085('0x6')];_0x44ca02<_0x4304fc;_0x44ca02++){var _0x2b1e9f=events[_0x44ca02];var _0x63ecf2=createListener(_0xc085('0x7')+_0x2b1e9f,_0x462e44);FaxAccountEvents['on'](_0x2b1e9f,_0x63ecf2);}}; \ No newline at end of file +var _0xb22b=['length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb22b,0x14f));var _0xbb22=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb22b[_0x321bb2];return _0x9c12ed;};'use strict';var FaxAccountEvents=require(_0xbb22('0x0'));var events=[_0xbb22('0x1'),_0xbb22('0x2'),_0xbb22('0x3')];function createListener(_0x1364d6,_0x31aa3a){return function(_0x41a5fc){_0x31aa3a[_0xbb22('0x4')](_0x1364d6,_0x41a5fc);};}function removeListener(_0x4a65f6,_0x20152f){return function(){FaxAccountEvents[_0xbb22('0x5')](_0x4a65f6,_0x20152f);};}exports[_0xbb22('0x6')]=function(_0x5977a0){for(var _0x1b8ca6=0x0,_0x2b93e3=events[_0xbb22('0x7')];_0x1b8ca6<_0x2b93e3;_0x1b8ca6++){var _0x3deb1a=events[_0x1b8ca6];var _0x294abb=createListener(_0xbb22('0x8')+_0x3deb1a,_0x5977a0);FaxAccountEvents['on'](_0x3deb1a,_0x294abb);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 231d493..08602e8 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(_0xcadfa,_0x59944a){var _0x326d17=function(_0x1fd030){while(--_0x1fd030){_0xcadfa['push'](_0xcadfa['shift']());}};_0x326d17(++_0x59944a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x3e84dc,_0x2e616c){var _0x1b2843=function(_0x485a29){while(--_0x485a29){_0x3e84dc['push'](_0x3e84dc['shift']());}};_0x1b2843(++_0x2e616c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 5861a6d..5e9c5f0 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 _0xef34=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x8935ce,_0x3621c3){var _0x1a422f=function(_0x35cb66){while(--_0x35cb66){_0x8935ce['push'](_0x8935ce['shift']());}};_0x1a422f(++_0x3621c3);}(_0xef34,0x10b));var _0x4ef3=function(_0xed4550,_0xfeae63){_0xed4550=_0xed4550-0x0;var _0x147af5=_0xef34[_0xed4550];return _0x147af5;};'use strict';var Sequelize=require(_0x4ef3('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4ef3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4ef3('0x2')],'allowNull':![],'defaultValue':_0x4ef3('0x3')},'appdata':{'type':Sequelize[_0x4ef3('0x4')]()},'description':{'type':Sequelize[_0x4ef3('0x2')]},'interval':{'type':Sequelize[_0x4ef3('0x2')],'defaultValue':_0x4ef3('0x5')}}; \ No newline at end of file +var _0x306d=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x446b78,_0x29314e){var _0x117983=function(_0x54675a){while(--_0x54675a){_0x446b78['push'](_0x446b78['shift']());}};_0x117983(++_0x29314e);}(_0x306d,0xff));var _0xd306=function(_0x4ce632,_0x57933c){_0x4ce632=_0x4ce632-0x0;var _0x5b2341=_0x306d[_0x4ce632];return _0x5b2341;};'use strict';var Sequelize=require(_0xd306('0x0'));module[_0xd306('0x1')]={'priority':{'type':Sequelize[_0xd306('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd306('0x3')],'allowNull':![],'defaultValue':_0xd306('0x4')},'appdata':{'type':Sequelize[_0xd306('0x5')]()},'description':{'type':Sequelize[_0xd306('0x3')]},'interval':{'type':Sequelize[_0xd306('0x3')],'defaultValue':_0xd306('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9169dba..df80715 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 _0x75a1=['../../config/environment','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2d1067,_0x84fa8c){var _0x4ca52f=function(_0x2c18fe){while(--_0x2c18fe){_0x2d1067['push'](_0x2d1067['shift']());}};_0x4ca52f(++_0x84fa8c);}(_0x75a1,0x7e));var _0x175a=function(_0x2d25cf,_0x4a9399){_0x2d25cf=_0x2d25cf-0x0;var _0x16c861=_0x75a1[_0x2d25cf];return _0x16c861;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x175a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x175a('0x1'));var rp=require(_0x175a('0x2'));var moment=require(_0x175a('0x3'));var BPromise=require(_0x175a('0x4'));var Mustache=require(_0x175a('0x5'));var util=require(_0x175a('0x6'));var path=require(_0x175a('0x7'));var sox=require(_0x175a('0x8'));var csv=require(_0x175a('0x9'));var ejs=require(_0x175a('0xa'));var fs=require('fs');var fs_extra=require(_0x175a('0xb'));var _=require(_0x175a('0xc'));var squel=require('squel');var crypto=require(_0x175a('0xd'));var jsforce=require(_0x175a('0xe'));var deskjs=require(_0x175a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x175a('0x10'));var Papa=require(_0x175a('0x11'));var Redis=require(_0x175a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x175a('0x13'));var hardwareService=require(_0x175a('0x14'));var logger=require(_0x175a('0x15'))(_0x175a('0x16'));var utils=require(_0x175a('0x17'));var config=require(_0x175a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1999,_0x2cc189){_0x2cc189=_0x2cc189||0xcc;return function(_0xdaa19a){if(_0xdaa19a){return _0x4a1999['sendStatus'](_0x2cc189);}return _0x4a1999['status'](_0x2cc189)[_0x175a('0x19')]();};}function respondWithResult(_0x5a284a,_0x44c25c){_0x44c25c=_0x44c25c||0xc8;return function(_0x46637b){if(_0x46637b){return _0x5a284a[_0x175a('0x1a')](_0x44c25c)[_0x175a('0x1b')](_0x46637b);}};}function respondWithFilteredResult(_0x111319,_0x3fd497){return function(_0x3344e0){if(_0x3344e0){var _0x33fb3c=typeof _0x3fd497['offset']===_0x175a('0x1c')&&typeof _0x3fd497[_0x175a('0x1d')]===_0x175a('0x1c');var _0x1437a2=_0x3344e0[_0x175a('0x1e')];var _0x89179a=_0x33fb3c?0x0:_0x3fd497[_0x175a('0x1f')];var _0x5685e1=_0x33fb3c?_0x3344e0[_0x175a('0x1e')]:_0x3fd497[_0x175a('0x1f')]+_0x3fd497['limit'];var _0x9ed775;if(_0x5685e1>=_0x1437a2){_0x5685e1=_0x1437a2;_0x9ed775=0xc8;}else{_0x9ed775=0xce;}_0x111319[_0x175a('0x1a')](_0x9ed775);return _0x111319['set'](_0x175a('0x20'),_0x89179a+'-'+_0x5685e1+'/'+_0x1437a2)[_0x175a('0x1b')](_0x3344e0);}return null;};}function patchUpdates(_0x282711){return function(_0x2e96c5){try{jsonpatch[_0x175a('0x21')](_0x2e96c5,_0x282711,!![]);}catch(_0x494cfb){return BPromise['reject'](_0x494cfb);}return _0x2e96c5[_0x175a('0x22')]();};}function saveUpdates(_0x200462,_0x436898){return function(_0xc7dbfa){if(_0xc7dbfa){return _0xc7dbfa['update'](_0x200462)[_0x175a('0x23')](function(_0x35a448){return _0x35a448;});}return null;};}function removeEntity(_0xa50c2,_0x1dc487){return function(_0x2f6d2b){if(_0x2f6d2b){return _0x2f6d2b[_0x175a('0x24')]()['then'](function(){_0xa50c2[_0x175a('0x1a')](0xcc)[_0x175a('0x19')]();});}};}function handleEntityNotFound(_0x36ab8d,_0x434662){return function(_0x3491ff){if(!_0x3491ff){_0x36ab8d['sendStatus'](0x194);}return _0x3491ff;};}function handleError(_0x32c329,_0x20929e){_0x20929e=_0x20929e||0x1f4;return function(_0x576907){logger[_0x175a('0x25')](_0x576907[_0x175a('0x26')]);if(_0x576907[_0x175a('0x27')]){delete _0x576907[_0x175a('0x27')];}_0x32c329[_0x175a('0x1a')](_0x20929e)[_0x175a('0x28')](_0x576907);};}exports[_0x175a('0x29')]=function(_0x426df8,_0x2560fa){var _0x2e3cae={},_0x5bcde8={},_0x47e4a5={'count':0x0,'rows':[]};var _0x4a2d19=_[_0x175a('0x2a')](db[_0x175a('0x2b')]['rawAttributes'],function(_0x6a09ac){return{'name':_0x6a09ac[_0x175a('0x2c')],'type':_0x6a09ac[_0x175a('0x2d')][_0x175a('0x2e')]};});_0x5bcde8[_0x175a('0x2f')]=_[_0x175a('0x2a')](_0x4a2d19,'name');_0x5bcde8[_0x175a('0x30')]=_[_0x175a('0x31')](_0x426df8[_0x175a('0x30')]);_0x5bcde8['filters']=_[_0x175a('0x32')](_0x5bcde8['model'],_0x5bcde8[_0x175a('0x30')]);_0x2e3cae[_0x175a('0x33')]=_[_0x175a('0x32')](_0x5bcde8[_0x175a('0x2f')],qs['fields'](_0x426df8[_0x175a('0x30')][_0x175a('0x34')]));_0x2e3cae[_0x175a('0x33')]=_0x2e3cae['attributes'][_0x175a('0x35')]?_0x2e3cae[_0x175a('0x33')]:_0x5bcde8[_0x175a('0x2f')];if(!_0x426df8[_0x175a('0x30')][_0x175a('0x36')](_0x175a('0x37'))){_0x2e3cae[_0x175a('0x1d')]=qs['limit'](_0x426df8[_0x175a('0x30')][_0x175a('0x1d')]);_0x2e3cae[_0x175a('0x1f')]=qs[_0x175a('0x1f')](_0x426df8['query'][_0x175a('0x1f')]);}_0x2e3cae[_0x175a('0x38')]=qs[_0x175a('0x39')](_0x426df8[_0x175a('0x30')]['sort']);_0x2e3cae[_0x175a('0x3a')]=qs[_0x175a('0x3b')](_['pick'](_0x426df8['query'],_0x5bcde8['filters']),_0x4a2d19);if(_0x426df8['query'][_0x175a('0x3c')]){_0x2e3cae['where']=_[_0x175a('0x3d')](_0x2e3cae[_0x175a('0x3a')],{'$or':_['map'](_0x4a2d19,function(_0x222a9a){if(_0x222a9a[_0x175a('0x2d')]!==_0x175a('0x3e')){var _0x4caac1={};_0x4caac1[_0x222a9a['name']]={'$like':'%'+_0x426df8['query']['filter']+'%'};return _0x4caac1;}})});}_0x2e3cae=_[_0x175a('0x3d')]({},_0x2e3cae,_0x426df8[_0x175a('0x3f')]);var _0x684d00={'where':_0x2e3cae[_0x175a('0x3a')]};return db[_0x175a('0x2b')]['count'](_0x684d00)['then'](function(_0x18536c){_0x47e4a5['count']=_0x18536c;if(_0x426df8['query'][_0x175a('0x40')]){_0x2e3cae[_0x175a('0x41')]=[{'all':!![]}];}return db[_0x175a('0x2b')][_0x175a('0x42')](_0x2e3cae);})[_0x175a('0x23')](function(_0xfaa2c5){_0x47e4a5[_0x175a('0x43')]=_0xfaa2c5;return _0x47e4a5;})[_0x175a('0x23')](respondWithFilteredResult(_0x2560fa,_0x2e3cae))[_0x175a('0x44')](handleError(_0x2560fa,null));};exports[_0x175a('0x45')]=function(_0x3a4e29,_0xbc3f3d){var _0x4a7eea={'raw':!![],'where':{'id':_0x3a4e29[_0x175a('0x46')]['id']}},_0x44a1b1={};_0x44a1b1[_0x175a('0x2f')]=_[_0x175a('0x31')](db['FaxApplication']['rawAttributes']);_0x44a1b1[_0x175a('0x30')]=_[_0x175a('0x31')](_0x3a4e29[_0x175a('0x30')]);_0x44a1b1[_0x175a('0x3b')]=_['intersection'](_0x44a1b1[_0x175a('0x2f')],_0x44a1b1['query']);_0x4a7eea['attributes']=_[_0x175a('0x32')](_0x44a1b1[_0x175a('0x2f')],qs[_0x175a('0x34')](_0x3a4e29['query']['fields']));_0x4a7eea[_0x175a('0x33')]=_0x4a7eea[_0x175a('0x33')][_0x175a('0x35')]?_0x4a7eea['attributes']:_0x44a1b1[_0x175a('0x2f')];if(_0x3a4e29['query'][_0x175a('0x40')]){_0x4a7eea[_0x175a('0x41')]=[{'all':!![]}];}_0x4a7eea=_['merge']({},_0x4a7eea,_0x3a4e29[_0x175a('0x3f')]);return db['FaxApplication']['find'](_0x4a7eea)[_0x175a('0x23')](handleEntityNotFound(_0xbc3f3d,null))['then'](respondWithResult(_0xbc3f3d,null))[_0x175a('0x44')](handleError(_0xbc3f3d,null));};exports['create']=function(_0x18ba76,_0x3315b0){return db[_0x175a('0x2b')][_0x175a('0x47')](_0x18ba76[_0x175a('0x48')],{})['then'](respondWithResult(_0x3315b0,0xc9))[_0x175a('0x44')](handleError(_0x3315b0,null));};exports[_0x175a('0x49')]=function(_0x2db317,_0x204b95){if(_0x2db317[_0x175a('0x48')]['id']){delete _0x2db317['body']['id'];}return db[_0x175a('0x2b')][_0x175a('0x4a')]({'where':{'id':_0x2db317[_0x175a('0x46')]['id']}})[_0x175a('0x23')](handleEntityNotFound(_0x204b95,null))['then'](saveUpdates(_0x2db317[_0x175a('0x48')],null))[_0x175a('0x23')](respondWithResult(_0x204b95,null))[_0x175a('0x44')](handleError(_0x204b95,null));};exports[_0x175a('0x24')]=function(_0x2ab3ca,_0x3b0a92){return db[_0x175a('0x2b')]['find']({'where':{'id':_0x2ab3ca[_0x175a('0x46')]['id']}})[_0x175a('0x23')](handleEntityNotFound(_0x3b0a92,null))[_0x175a('0x23')](removeEntity(_0x3b0a92,null))[_0x175a('0x44')](handleError(_0x3b0a92,null));}; \ No newline at end of file +var _0xba43=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','options','then','includeAll','include','findAll','rows','catch','show','merge','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x913af0,_0xf67d98){var _0x466696=function(_0x2f4cdf){while(--_0x2f4cdf){_0x913af0['push'](_0x913af0['shift']());}};_0x466696(++_0xf67d98);}(_0xba43,0x10e));var _0x3ba4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xba43[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ba4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ba4('0x1'));var rp=require(_0x3ba4('0x2'));var moment=require(_0x3ba4('0x3'));var BPromise=require(_0x3ba4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ba4('0x5'));var sox=require(_0x3ba4('0x6'));var csv=require(_0x3ba4('0x7'));var ejs=require(_0x3ba4('0x8'));var fs=require('fs');var fs_extra=require(_0x3ba4('0x9'));var _=require(_0x3ba4('0xa'));var squel=require(_0x3ba4('0xb'));var crypto=require(_0x3ba4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3ba4('0xd'));var toCsv=require(_0x3ba4('0x7'));var querystring=require(_0x3ba4('0xe'));var Papa=require('papaparse');var Redis=require(_0x3ba4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3ba4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ba4('0x11'));var logger=require(_0x3ba4('0x12'))(_0x3ba4('0x13'));var utils=require(_0x3ba4('0x14'));var config=require(_0x3ba4('0x15'));var licenseUtil=require(_0x3ba4('0x16'));var db=require(_0x3ba4('0x17'))['db'];function respondWithStatusCode(_0x1f3464,_0xd424a8){_0xd424a8=_0xd424a8||0xcc;return function(_0x15428b){if(_0x15428b){return _0x1f3464[_0x3ba4('0x18')](_0xd424a8);}return _0x1f3464[_0x3ba4('0x19')](_0xd424a8)[_0x3ba4('0x1a')]();};}function respondWithResult(_0x28e2b5,_0x11aa13){_0x11aa13=_0x11aa13||0xc8;return function(_0x4e31c0){if(_0x4e31c0){return _0x28e2b5['status'](_0x11aa13)[_0x3ba4('0x1b')](_0x4e31c0);}};}function respondWithFilteredResult(_0x146755,_0x517c63){return function(_0x3d9cbd){if(_0x3d9cbd){var _0x8f316f=typeof _0x517c63[_0x3ba4('0x1c')]===_0x3ba4('0x1d')&&typeof _0x517c63['limit']===_0x3ba4('0x1d');var _0x52ba21=_0x3d9cbd['count'];var _0xe3eab1=_0x8f316f?0x0:_0x517c63[_0x3ba4('0x1c')];var _0x437f89=_0x8f316f?_0x3d9cbd[_0x3ba4('0x1e')]:_0x517c63['offset']+_0x517c63[_0x3ba4('0x1f')];var _0x427ccb;if(_0x437f89>=_0x52ba21){_0x437f89=_0x52ba21;_0x427ccb=0xc8;}else{_0x427ccb=0xce;}_0x146755[_0x3ba4('0x19')](_0x427ccb);return _0x146755[_0x3ba4('0x20')](_0x3ba4('0x21'),_0xe3eab1+'-'+_0x437f89+'/'+_0x52ba21)[_0x3ba4('0x1b')](_0x3d9cbd);}return null;};}function patchUpdates(_0xa6b367){return function(_0x4e3749){try{jsonpatch[_0x3ba4('0x22')](_0x4e3749,_0xa6b367,!![]);}catch(_0x591aea){return BPromise[_0x3ba4('0x23')](_0x591aea);}return _0x4e3749['save']();};}function saveUpdates(_0x1d8193,_0x47be4e){return function(_0x5b5da4){if(_0x5b5da4){return _0x5b5da4[_0x3ba4('0x24')](_0x1d8193)['then'](function(_0x482dd4){return _0x482dd4;});}return null;};}function removeEntity(_0x5b772f,_0x214ebc){return function(_0x264d3f){if(_0x264d3f){return _0x264d3f['destroy']()['then'](function(){_0x5b772f['status'](0xcc)[_0x3ba4('0x1a')]();});}};}function handleEntityNotFound(_0x11be49,_0x2c683d){return function(_0x5b152c){if(!_0x5b152c){_0x11be49[_0x3ba4('0x18')](0x194);}return _0x5b152c;};}function handleError(_0x387b5b,_0x1380bd){_0x1380bd=_0x1380bd||0x1f4;return function(_0x417dd6){logger['error'](_0x417dd6[_0x3ba4('0x25')]);if(_0x417dd6['name']){delete _0x417dd6[_0x3ba4('0x26')];}_0x387b5b[_0x3ba4('0x19')](_0x1380bd)[_0x3ba4('0x27')](_0x417dd6);};}exports[_0x3ba4('0x28')]=function(_0x1d1e6d,_0x1852d1){var _0x5a9702={},_0x16c243={},_0x10c7e2={'count':0x0,'rows':[]};var _0x15e748=_['map'](db[_0x3ba4('0x29')][_0x3ba4('0x2a')],function(_0x158b00){return{'name':_0x158b00[_0x3ba4('0x2b')],'type':_0x158b00[_0x3ba4('0x2c')][_0x3ba4('0x2d')]};});_0x16c243[_0x3ba4('0x2e')]=_[_0x3ba4('0x2f')](_0x15e748,_0x3ba4('0x26'));_0x16c243[_0x3ba4('0x30')]=_[_0x3ba4('0x31')](_0x1d1e6d[_0x3ba4('0x30')]);_0x16c243[_0x3ba4('0x32')]=_['intersection'](_0x16c243[_0x3ba4('0x2e')],_0x16c243[_0x3ba4('0x30')]);_0x5a9702['attributes']=_[_0x3ba4('0x33')](_0x16c243[_0x3ba4('0x2e')],qs[_0x3ba4('0x34')](_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x34')]));_0x5a9702['attributes']=_0x5a9702['attributes'][_0x3ba4('0x35')]?_0x5a9702[_0x3ba4('0x36')]:_0x16c243[_0x3ba4('0x2e')];if(!_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x37')](_0x3ba4('0x38'))){_0x5a9702[_0x3ba4('0x1f')]=qs[_0x3ba4('0x1f')](_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x1f')]);_0x5a9702[_0x3ba4('0x1c')]=qs['offset'](_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x1c')]);}_0x5a9702[_0x3ba4('0x39')]=qs[_0x3ba4('0x3a')](_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x3a')]);_0x5a9702[_0x3ba4('0x3b')]=qs['filters'](_['pick'](_0x1d1e6d[_0x3ba4('0x30')],_0x16c243[_0x3ba4('0x32')]),_0x15e748);if(_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x3c')]){_0x5a9702['where']=_['merge'](_0x5a9702[_0x3ba4('0x3b')],{'$or':_[_0x3ba4('0x2f')](_0x15e748,function(_0x52de0f){if(_0x52de0f['type']!=='VIRTUAL'){var _0x3ef5c3={};_0x3ef5c3[_0x52de0f[_0x3ba4('0x26')]]={'$like':'%'+_0x1d1e6d['query'][_0x3ba4('0x3c')]+'%'};return _0x3ef5c3;}})});}_0x5a9702=_['merge']({},_0x5a9702,_0x1d1e6d[_0x3ba4('0x3d')]);var _0x8f3319={'where':_0x5a9702[_0x3ba4('0x3b')]};return db['FaxApplication'][_0x3ba4('0x1e')](_0x8f3319)[_0x3ba4('0x3e')](function(_0x4d5659){_0x10c7e2[_0x3ba4('0x1e')]=_0x4d5659;if(_0x1d1e6d[_0x3ba4('0x30')][_0x3ba4('0x3f')]){_0x5a9702[_0x3ba4('0x40')]=[{'all':!![]}];}return db[_0x3ba4('0x29')][_0x3ba4('0x41')](_0x5a9702);})[_0x3ba4('0x3e')](function(_0x19f1c1){_0x10c7e2[_0x3ba4('0x42')]=_0x19f1c1;return _0x10c7e2;})[_0x3ba4('0x3e')](respondWithFilteredResult(_0x1852d1,_0x5a9702))[_0x3ba4('0x43')](handleError(_0x1852d1,null));};exports[_0x3ba4('0x44')]=function(_0x3bbc98,_0x8a4e92){var _0x30f803={'raw':!![],'where':{'id':_0x3bbc98['params']['id']}},_0x773c0f={};_0x773c0f[_0x3ba4('0x2e')]=_[_0x3ba4('0x31')](db[_0x3ba4('0x29')][_0x3ba4('0x2a')]);_0x773c0f[_0x3ba4('0x30')]=_['keys'](_0x3bbc98[_0x3ba4('0x30')]);_0x773c0f[_0x3ba4('0x32')]=_[_0x3ba4('0x33')](_0x773c0f[_0x3ba4('0x2e')],_0x773c0f['query']);_0x30f803[_0x3ba4('0x36')]=_[_0x3ba4('0x33')](_0x773c0f[_0x3ba4('0x2e')],qs[_0x3ba4('0x34')](_0x3bbc98[_0x3ba4('0x30')][_0x3ba4('0x34')]));_0x30f803['attributes']=_0x30f803[_0x3ba4('0x36')]['length']?_0x30f803[_0x3ba4('0x36')]:_0x773c0f[_0x3ba4('0x2e')];if(_0x3bbc98[_0x3ba4('0x30')]['includeAll']){_0x30f803[_0x3ba4('0x40')]=[{'all':!![]}];}_0x30f803=_[_0x3ba4('0x45')]({},_0x30f803,_0x3bbc98[_0x3ba4('0x3d')]);return db['FaxApplication'][_0x3ba4('0x46')](_0x30f803)[_0x3ba4('0x3e')](handleEntityNotFound(_0x8a4e92,null))[_0x3ba4('0x3e')](respondWithResult(_0x8a4e92,null))[_0x3ba4('0x43')](handleError(_0x8a4e92,null));};exports[_0x3ba4('0x47')]=function(_0x523bae,_0x4b789f){return db[_0x3ba4('0x29')]['create'](_0x523bae[_0x3ba4('0x48')],{})[_0x3ba4('0x3e')](respondWithResult(_0x4b789f,0xc9))[_0x3ba4('0x43')](handleError(_0x4b789f,null));};exports[_0x3ba4('0x24')]=function(_0x7754a9,_0x293054){if(_0x7754a9['body']['id']){delete _0x7754a9[_0x3ba4('0x48')]['id'];}return db[_0x3ba4('0x29')][_0x3ba4('0x46')]({'where':{'id':_0x7754a9['params']['id']}})['then'](handleEntityNotFound(_0x293054,null))['then'](saveUpdates(_0x7754a9['body'],null))[_0x3ba4('0x3e')](respondWithResult(_0x293054,null))['catch'](handleError(_0x293054,null));};exports[_0x3ba4('0x49')]=function(_0x951e61,_0x351793){return db[_0x3ba4('0x29')][_0x3ba4('0x46')]({'where':{'id':_0x951e61['params']['id']}})[_0x3ba4('0x3e')](handleEntityNotFound(_0x351793,null))['then'](removeEntity(_0x351793,null))['catch'](handleError(_0x351793,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6b72c1d..b3f0b84 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 _0x6628=['rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5a0d79,_0x17aed4){var _0x5bee8d=function(_0x12a468){while(--_0x12a468){_0x5a0d79['push'](_0x5a0d79['shift']());}};_0x5bee8d(++_0x17aed4);}(_0x6628,0x99));var _0x8662=function(_0x3ae752,_0xb69b99){_0x3ae752=_0x3ae752-0x0;var _0x108c59=_0x6628[_0x3ae752];return _0x108c59;};'use strict';var _=require(_0x8662('0x0'));var util=require(_0x8662('0x1'));var logger=require(_0x8662('0x2'))('api');var moment=require(_0x8662('0x3'));var BPromise=require(_0x8662('0x4'));var rp=require(_0x8662('0x5'));var fs=require('fs');var path=require(_0x8662('0x6'));var rimraf=require(_0x8662('0x7'));var config=require(_0x8662('0x8'));var attributes=require(_0x8662('0x9'));module[_0x8662('0xa')]=function(_0x273f08,_0x464c22){return _0x273f08[_0x8662('0xb')](_0x8662('0xc'),attributes,{'tableName':_0x8662('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8662('0xe'),'collate':_0x8662('0xf')});}; \ No newline at end of file +var _0x9f5d=['fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','./faxApplication.attributes','exports','FaxApplication'];(function(_0x2d738e,_0x35dac3){var _0x18c4c0=function(_0x37a652){while(--_0x37a652){_0x2d738e['push'](_0x2d738e['shift']());}};_0x18c4c0(++_0x35dac3);}(_0x9f5d,0x116));var _0xd9f5=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x9f5d[_0x5b78e8];return _0xf2c321;};'use strict';var _=require('lodash');var util=require(_0xd9f5('0x0'));var logger=require(_0xd9f5('0x1'))(_0xd9f5('0x2'));var moment=require(_0xd9f5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9f5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd9f5('0x5'));module[_0xd9f5('0x6')]=function(_0x5425cc,_0x3ae1fa){return _0x5425cc['define'](_0xd9f5('0x7'),attributes,{'tableName':_0xd9f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd9f5('0x9'),'collate':_0xd9f5('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 593a736..5cf764a 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 _0xdb57=['request','then','request\x20sent','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','info','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','debug','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f807d,_0x32a3b1){var _0x45ad62=function(_0x32b5d9){while(--_0x32b5d9){_0x3f807d['push'](_0x3f807d['shift']());}};_0x45ad62(++_0x32a3b1);}(_0xdb57,0x148));var _0x7db5=function(_0x30ba6c,_0x234a17){_0x30ba6c=_0x30ba6c-0x0;var _0x9c7617=_0xdb57[_0x30ba6c];return _0x9c7617;};'use strict';var _=require('lodash');var util=require(_0x7db5('0x0'));var moment=require('moment');var BPromise=require(_0x7db5('0x1'));var rs=require(_0x7db5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7db5('0x3'));var config=require(_0x7db5('0x4'));var jayson=require(_0x7db5('0x5'));var client=jayson[_0x7db5('0x6')][_0x7db5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16597a,_0x18f3a3,_0x3e64e5){return new BPromise(function(_0x51d615,_0x4d62a8){return client[_0x7db5('0x8')](_0x16597a,_0x3e64e5)[_0x7db5('0x9')](function(_0x52bdb2){logger['info']('FaxApplication,\x20%s,\x20%s',_0x18f3a3,_0x7db5('0xa'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x18f3a3,_0x7db5('0xa'),JSON[_0x7db5('0xb')](_0x52bdb2));if(_0x52bdb2[_0x7db5('0xc')]){if(_0x52bdb2['error'][_0x7db5('0xd')]===0x1f4){logger[_0x7db5('0xc')](_0x7db5('0xe'),_0x18f3a3,_0x52bdb2[_0x7db5('0xc')]['message']);return _0x4d62a8(_0x52bdb2[_0x7db5('0xc')]['message']);}logger[_0x7db5('0xc')](_0x7db5('0xe'),_0x18f3a3,_0x52bdb2[_0x7db5('0xc')][_0x7db5('0xf')]);return _0x51d615(_0x52bdb2[_0x7db5('0xc')][_0x7db5('0xf')]);}else{logger[_0x7db5('0x10')](_0x7db5('0xe'),_0x18f3a3,_0x7db5('0xa'));_0x51d615(_0x52bdb2[_0x7db5('0x11')][_0x7db5('0xf')]);}})[_0x7db5('0x12')](function(_0x3ff86a){logger['error'](_0x7db5('0xe'),_0x18f3a3,_0x3ff86a);_0x4d62a8(_0x3ff86a);});});}exports[_0x7db5('0x13')]=function(_0x2b8449){var _0x4e34ba=this;return new Promise(function(_0x14f2ed,_0x4dfe14){return db[_0x7db5('0x14')][_0x7db5('0x15')](_0x2b8449[_0x7db5('0x16')],{'raw':_0x2b8449[_0x7db5('0x17')]?_0x2b8449[_0x7db5('0x17')][_0x7db5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b8449[_0x7db5('0x17')]?_0x2b8449['options'][_0x7db5('0x19')]||null:null,'attributes':_0x2b8449[_0x7db5('0x17')]?_0x2b8449[_0x7db5('0x17')]['attributes']||null:null,'limit':_0x2b8449[_0x7db5('0x17')]?_0x2b8449[_0x7db5('0x17')][_0x7db5('0x1a')]||null:null})['then'](function(_0x2e9d1c){logger['info'](_0x7db5('0x13'),_0x2b8449);logger[_0x7db5('0x1b')](_0x7db5('0x13'),_0x2b8449,JSON[_0x7db5('0xb')](_0x2e9d1c));_0x14f2ed(_0x2e9d1c);})[_0x7db5('0x12')](function(_0x27164f){logger[_0x7db5('0xc')](_0x7db5('0x13'),_0x27164f[_0x7db5('0xf')],_0x2b8449);_0x4dfe14(_0x4e34ba[_0x7db5('0xc')](0x1f4,_0x27164f['message']));});});}; \ No newline at end of file +var _0xdf1c=['raw','where','limit','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','UpdateFaxApplication','FaxApplication','update','body','options'];(function(_0x3e3f18,_0x2d8889){var _0x1715d6=function(_0x2e8278){while(--_0x2e8278){_0x3e3f18['push'](_0x3e3f18['shift']());}};_0x1715d6(++_0x2d8889);}(_0xdf1c,0x112));var _0xcdf1=function(_0x31bc38,_0x76b09c){_0x31bc38=_0x31bc38-0x0;var _0x5e2429=_0xdf1c[_0x31bc38];return _0x5e2429;};'use strict';var _=require(_0xcdf1('0x0'));var util=require(_0xcdf1('0x1'));var moment=require('moment');var BPromise=require(_0xcdf1('0x2'));var rs=require(_0xcdf1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdf1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdf1('0x5'))(_0xcdf1('0x6'));var config=require(_0xcdf1('0x7'));var jayson=require(_0xcdf1('0x8'));var client=jayson[_0xcdf1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x760dc6,_0x4a1325,_0x5da55d){return new BPromise(function(_0x524058,_0x376dab){return client[_0xcdf1('0xa')](_0x760dc6,_0x5da55d)[_0xcdf1('0xb')](function(_0x691964){logger['info'](_0xcdf1('0xc'),_0x4a1325,_0xcdf1('0xd'));logger[_0xcdf1('0xe')](_0xcdf1('0xf'),_0x4a1325,_0xcdf1('0xd'),JSON[_0xcdf1('0x10')](_0x691964));if(_0x691964['error']){if(_0x691964['error'][_0xcdf1('0x11')]===0x1f4){logger[_0xcdf1('0x12')](_0xcdf1('0xc'),_0x4a1325,_0x691964['error'][_0xcdf1('0x13')]);return _0x376dab(_0x691964['error']['message']);}logger['error'](_0xcdf1('0xc'),_0x4a1325,_0x691964[_0xcdf1('0x12')][_0xcdf1('0x13')]);return _0x524058(_0x691964[_0xcdf1('0x12')]['message']);}else{logger[_0xcdf1('0x14')](_0xcdf1('0xc'),_0x4a1325,_0xcdf1('0xd'));_0x524058(_0x691964['result'][_0xcdf1('0x13')]);}})['catch'](function(_0x1623af){logger[_0xcdf1('0x12')](_0xcdf1('0xc'),_0x4a1325,_0x1623af);_0x376dab(_0x1623af);});});}exports[_0xcdf1('0x15')]=function(_0x3d42eb){var _0x53d429=this;return new Promise(function(_0x40fb84,_0x48b2a2){return db[_0xcdf1('0x16')][_0xcdf1('0x17')](_0x3d42eb[_0xcdf1('0x18')],{'raw':_0x3d42eb['options']?_0x3d42eb[_0xcdf1('0x19')][_0xcdf1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d42eb['options']?_0x3d42eb[_0xcdf1('0x19')][_0xcdf1('0x1b')]||null:null,'attributes':_0x3d42eb['options']?_0x3d42eb[_0xcdf1('0x19')]['attributes']||null:null,'limit':_0x3d42eb[_0xcdf1('0x19')]?_0x3d42eb[_0xcdf1('0x19')][_0xcdf1('0x1c')]||null:null})[_0xcdf1('0xb')](function(_0x3954fa){logger[_0xcdf1('0x14')](_0xcdf1('0x15'),_0x3d42eb);logger[_0xcdf1('0xe')](_0xcdf1('0x15'),_0x3d42eb,JSON[_0xcdf1('0x10')](_0x3954fa));_0x40fb84(_0x3954fa);})[_0xcdf1('0x1d')](function(_0x3f0b80){logger['error']('UpdateFaxApplication',_0x3f0b80['message'],_0x3d42eb);_0x48b2a2(_0x53d429[_0xcdf1('0x12')](0x1f4,_0x3f0b80[_0xcdf1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a4028f6..0065eae 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 _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x21d0e6,_0x5a7aa6){var _0x1cc2d1=function(_0x25ded8){while(--_0x25ded8){_0x21d0e6['push'](_0x21d0e6['shift']());}};_0x1cc2d1(++_0x5a7aa6);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('0x11')]=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x336092,_0x22c0e1){var _0x57c708=function(_0x2cd18b){while(--_0x2cd18b){_0x336092['push'](_0x336092['shift']());}};_0x57c708(++_0x22c0e1);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('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 5b344a2..e92b86b 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 _0x54b4=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x12c2f7,_0x28d113){var _0x4182b8=function(_0x277157){while(--_0x277157){_0x12c2f7['push'](_0x12c2f7['shift']());}};_0x4182b8(++_0x28d113);}(_0x54b4,0x1a1));var _0x454b=function(_0x3787e2,_0x4de8f4){_0x3787e2=_0x3787e2-0x0;var _0xbcaba5=_0x54b4[_0x3787e2];return _0xbcaba5;};'use strict';var Sequelize=require(_0x454b('0x0'));module['exports']={'closed':{'type':Sequelize[_0x454b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x454b('0x2')]},'disposition':{'type':Sequelize[_0x454b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x454b('0x3')]},'note':{'type':Sequelize[_0x454b('0x3')]},'read1stAt':{'type':Sequelize[_0x454b('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x454b('0x4')]('in',_0x454b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x454b('0x4')]('in',_0x454b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x2f65=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2f65,0x112));var _0x52f6=function(_0x1a1d00,_0x4d3057){_0x1a1d00=_0x1a1d00-0x0;var _0x2af0d7=_0x2f65[_0x1a1d00];return _0x2af0d7;};'use strict';var Sequelize=require('sequelize');module[_0x52f6('0x0')]={'closed':{'type':Sequelize[_0x52f6('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x52f6('0x2')]},'disposition':{'type':Sequelize[_0x52f6('0x3')]},'secondDisposition':{'type':Sequelize[_0x52f6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x52f6('0x3')]},'note':{'type':Sequelize[_0x52f6('0x3')]},'read1stAt':{'type':Sequelize[_0x52f6('0x2')]},'fax':{'type':Sequelize[_0x52f6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x52f6('0x4')]('in',_0x52f6('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x52f6('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f9a15bf..8e4029c 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 _0xbe07=['getMessages','FaxMessage','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','findAll','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','json','limit','undefined','offset','set','apply','save','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','FaxInteraction','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','u.id','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','length','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','$substring','value','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','includeAll','options','create','body','params','describe','addMessage','ids','omit'];(function(_0x1058d1,_0x122d13){var _0x3078cf=function(_0x3361a5){while(--_0x3361a5){_0x1058d1['push'](_0x1058d1['shift']());}};_0x3078cf(++_0x122d13);}(_0xbe07,0xf7));var _0x7be0=function(_0x3f1601,_0xcceb85){_0x3f1601=_0x3f1601-0x0;var _0x1035b4=_0xbe07[_0x3f1601];return _0x1035b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7be0('0x0'));var zipdir=require(_0x7be0('0x1'));var jsonpatch=require(_0x7be0('0x2'));var rp=require(_0x7be0('0x3'));var moment=require('moment');var BPromise=require(_0x7be0('0x4'));var Mustache=require(_0x7be0('0x5'));var util=require(_0x7be0('0x6'));var path=require('path');var sox=require(_0x7be0('0x7'));var csv=require(_0x7be0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7be0('0x9'));var _=require(_0x7be0('0xa'));var squel=require(_0x7be0('0xb'));var crypto=require(_0x7be0('0xc'));var jsforce=require(_0x7be0('0xd'));var deskjs=require(_0x7be0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7be0('0xf'));var Papa=require(_0x7be0('0x10'));var Redis=require('ioredis');var authService=require(_0x7be0('0x11'));var qs=require(_0x7be0('0x12'));var as=require(_0x7be0('0x13'));var hardwareService=require(_0x7be0('0x14'));var logger=require(_0x7be0('0x15'))(_0x7be0('0x16'));var utils=require(_0x7be0('0x17'));var config=require(_0x7be0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7be0('0x19'))['db'];config[_0x7be0('0x1a')]=_[_0x7be0('0x1b')](config[_0x7be0('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7be0('0x1c'))(new Redis(config[_0x7be0('0x1a')]));require(_0x7be0('0x1d'))[_0x7be0('0x1e')](socket);function respondWithStatusCode(_0x474b13,_0x43c45f){_0x43c45f=_0x43c45f||0xcc;return function(_0x391133){if(_0x391133){return _0x474b13['sendStatus'](_0x43c45f);}return _0x474b13[_0x7be0('0x1f')](_0x43c45f)[_0x7be0('0x20')]();};}function respondWithResult(_0x7568ba,_0xef8244){_0xef8244=_0xef8244||0xc8;return function(_0x3e0afe){if(_0x3e0afe){return _0x7568ba[_0x7be0('0x1f')](_0xef8244)[_0x7be0('0x21')](_0x3e0afe);}};}function respondWithFilteredResult(_0x10e730,_0x40cb1e){return function(_0x485f68){if(_0x485f68){var _0x561d09=typeof _0x40cb1e['offset']==='undefined'&&typeof _0x40cb1e[_0x7be0('0x22')]===_0x7be0('0x23');var _0x2ae951=_0x485f68['count'];var _0x269f04=_0x561d09?0x0:_0x40cb1e['offset'];var _0x872d0a=_0x561d09?_0x485f68['count']:_0x40cb1e[_0x7be0('0x24')]+_0x40cb1e['limit'];var _0x40fa96;if(_0x872d0a>=_0x2ae951){_0x872d0a=_0x2ae951;_0x40fa96=0xc8;}else{_0x40fa96=0xce;}_0x10e730[_0x7be0('0x1f')](_0x40fa96);return _0x10e730[_0x7be0('0x25')]('Content-Range',_0x269f04+'-'+_0x872d0a+'/'+_0x2ae951)[_0x7be0('0x21')](_0x485f68);}return null;};}function patchUpdates(_0x20207c){return function(_0x5844f6){try{jsonpatch[_0x7be0('0x26')](_0x5844f6,_0x20207c,!![]);}catch(_0xb370d2){return BPromise['reject'](_0xb370d2);}return _0x5844f6[_0x7be0('0x27')]();};}function saveUpdates(_0x509e18,_0x1d78fa){return function(_0x45bae5){if(_0x45bae5){return _0x45bae5['update'](_0x509e18)[_0x7be0('0x28')](function(_0x147462){return _0x147462;});}return null;};}function removeEntity(_0x337642,_0x47b49d){return function(_0x40599f){if(_0x40599f){return _0x40599f[_0x7be0('0x29')]()['then'](function(){_0x337642['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ae1c6,_0x3b7429){return function(_0x30dbf4){if(!_0x30dbf4){_0x3ae1c6[_0x7be0('0x2a')](0x194);}return _0x30dbf4;};}function handleError(_0x578f4e,_0x402320){_0x402320=_0x402320||0x1f4;return function(_0x140bbf){logger[_0x7be0('0x2b')](_0x140bbf[_0x7be0('0x2c')]);if(_0x140bbf[_0x7be0('0x2d')]){delete _0x140bbf[_0x7be0('0x2d')];}_0x578f4e[_0x7be0('0x1f')](_0x402320)[_0x7be0('0x2e')](_0x140bbf);};}function getInteractionUsers(_0x1b6010,_0x4dd6ae){return new BPromise(function(_0x210e81,_0x2ee729){try{if(_0x4dd6ae[_0x1b6010['id']]){_0x1b6010[_0x7be0('0x2f')]=_[_0x7be0('0x30')](_0x4dd6ae[_0x1b6010['id']],function(_0x3583f8){return{'id':_0x3583f8['id'],'fullname':_0x3583f8[_0x7be0('0x31')]};});}}catch(_0x1f592d){_0x2ee729(_0x1f592d);}_0x210e81(_0x1b6010);});}function getInteractionTags(_0x19a89b,_0x11ed3d){return new BPromise(function(_0xff0e16,_0x204225){try{if(_0x19a89b[_0x7be0('0x32')]){_0x19a89b[_0x7be0('0x33')]=[];_0x19a89b[_0x7be0('0x32')][_0x7be0('0x34')](',')['forEach'](function(_0x504ea8){_0x19a89b[_0x7be0('0x33')][_0x7be0('0x35')](_0x11ed3d[_0x504ea8]);});}delete _0x19a89b['TagIds'];}catch(_0xa22722){_0x204225(_0xa22722);}_0xff0e16(_0x19a89b);});}function updateFaxInteraction(_0x26ac09,_0x4dc0db,_0x3f388d){return new BPromise(function(_0x38dc0c,_0x599cd1){return getInteractionUsers(_0x26ac09,_0x3f388d)[_0x7be0('0x28')](function(_0x569ce3){return getInteractionTags(_0x569ce3,_0x4dc0db);})[_0x7be0('0x28')](function(_0x3bb499){_0x38dc0c(_0x3bb499);})[_0x7be0('0x36')](function(_0x227433){_0x599cd1(_0x227433);});});}exports[_0x7be0('0x37')]=function(_0xaa485c,_0x174211){var _0x4f8670={},_0x5564bf={},_0x46e0ee={'count':0x0,'rows':[]};var _0x2b7e13=_[_0x7be0('0x30')](db[_0x7be0('0x38')][_0x7be0('0x39')],function(_0x2f5413){return{'name':_0x2f5413['fieldName'],'type':_0x2f5413[_0x7be0('0x3a')][_0x7be0('0x3b')]};});_0x5564bf['model']=_[_0x7be0('0x30')](_0x2b7e13,_0x7be0('0x2d'));_0x5564bf[_0x7be0('0x3c')]=_[_0x7be0('0x3d')](_0xaa485c[_0x7be0('0x3c')]);_0x5564bf[_0x7be0('0x3e')]=_[_0x7be0('0x3f')](_0x5564bf[_0x7be0('0x40')],_0x5564bf[_0x7be0('0x3c')]);_0x4f8670['attributes']=_[_0x7be0('0x3f')](_0x5564bf[_0x7be0('0x40')],qs[_0x7be0('0x41')](_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x41')]));_0x4f8670[_0x7be0('0x42')]=_0x4f8670['attributes']['length']?_0x4f8670['attributes']:_0x5564bf['model'];if(!_0xaa485c['query'][_0x7be0('0x43')](_0x7be0('0x44'))){_0x4f8670[_0x7be0('0x22')]=qs[_0x7be0('0x22')](_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x22')]);_0x4f8670[_0x7be0('0x24')]=qs[_0x7be0('0x24')](_0xaa485c['query'][_0x7be0('0x24')]);}_0x4f8670[_0x7be0('0x45')]=qs[_0x7be0('0x46')](_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x46')]);_0x4f8670['where']=qs[_0x7be0('0x3e')](_[_0x7be0('0x47')](_0xaa485c[_0x7be0('0x3c')],_0x5564bf[_0x7be0('0x3e')]),_0x2b7e13);var _0x5b28d6=[];var _0x4263f4=squel[_0x7be0('0x48')]()[_0x7be0('0x49')]('id')[_0x7be0('0x49')](_0x7be0('0x2d'))[_0x7be0('0x49')](_0x7be0('0x4a'))['from'](_0x7be0('0x4b'));var _0x4ade91=squel['select']()['field'](_0x7be0('0x4c'))['field']('u.fullname')['field'](_0x7be0('0x4d'))[_0x7be0('0x4e')](_0x7be0('0x4f'),'ui')[_0x7be0('0x50')](_0x7be0('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x162c57=squel[_0x7be0('0x48')]()['from'](_0x7be0('0x52'),'i')[_0x7be0('0x50')]('cm_contacts','c',_0x7be0('0x53'))[_0x7be0('0x50')](_0x7be0('0x51'),'o',_0x7be0('0x54'))[_0x7be0('0x50')]('fax_accounts','a',_0x7be0('0x55'))[_0x7be0('0x50')](_0x7be0('0x56'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x7be0('0x50')](_0x7be0('0x57'),'it',_0x7be0('0x58'))[_0x7be0('0x50')](_0x7be0('0x4b'),'t',_0x7be0('0x59'));var _0x4dfb62=squel[_0x7be0('0x5a')]();var _0x5312e8=[];var _0x1a2d10=squel['expr']();var _0x3822c4;if(_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x5b')]){_0x3822c4=as['parseSearch'](_0xaa485c[_0x7be0('0x3c')]['search']);var _0x4992d3=_0x3822c4[_0x7be0('0x5c')];for(var _0x46e515=0x0;_0x46e515<_0x3822c4['conditions'][_0x7be0('0x5d')];_0x46e515++){var _0x4d06fa=_0x3822c4[_0x7be0('0x5e')][_0x46e515];var _0x1e522f='i';var _0x5da37f=_[_0x7be0('0x5f')](_0x2b7e13,[_0x7be0('0x2d'),_0x4d06fa['field']]);if(!_0x5da37f){switch(_0x4d06fa[_0x7be0('0x49')]){case _0x7be0('0x60'):if(_0x4d06fa['value']==0x1){_0x162c57[_0x7be0('0x61')]('`'+_0x4d06fa[_0x7be0('0x49')]+_0x7be0('0x62'));}else{_0x162c57[_0x7be0('0x61')]('`'+_0x4d06fa[_0x7be0('0x49')]+_0x7be0('0x63'));}break;case'Contact':if(_0x4d06fa['operator']===_0x7be0('0x64')){if(_0x4d06fa[_0x7be0('0x65')][_0x7be0('0x34')]('\x20')[_0x7be0('0x5d')]>0x1){_0x4dfb62[_0x4992d3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4d06fa['value']),null);}else{var _0x186e7d='%'+_0x4d06fa[_0x7be0('0x65')]+'%';_0x4dfb62[_0x4992d3]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x186e7d,_0x186e7d,_0x186e7d);}}else{_0x5da37f=_[_0x7be0('0x5f')](_0x2b7e13,[_0x7be0('0x2d'),_0x7be0('0x66')]);_0x4d06fa[_0x7be0('0x49')]=_0x7be0('0x66');_0x3c6029=as[_0x7be0('0x67')](_0x1e522f,_0x5da37f[_0x7be0('0x3a')],_0x4d06fa);_0x4dfb62[_0x4992d3](_0x3c6029[_0x7be0('0x68')],_0x3c6029[_0x7be0('0x65')][_0x7be0('0x69')],_0x3c6029[_0x7be0('0x65')]['end']);}break;case'Tag':var _0x21f01d=_0x4d06fa['value'][_0x7be0('0x34')](',')['map'](function(_0x36675e){return Number(_0x36675e);});_0x21f01d[_0x7be0('0x6a')](function(_0x37a6bf){_0x1a2d10['or'](_0x7be0('0x6b'),'%,'+_0x37a6bf+',%');});_0x5312e8=_['union'](_0x5312e8,_0x21f01d);break;case'User':if(_0x4d06fa[_0x7be0('0x6c')]==='$substring'){_0x4dfb62[_0x4992d3](_0x7be0('0x6d'),'%'+_0x4d06fa['value']+'%',null);}else{_0x5da37f=_['find'](_0x2b7e13,[_0x7be0('0x2d'),'UserId']);_0x4d06fa['field']=_0x7be0('0x6e');_0x3c6029=as[_0x7be0('0x67')](_0x1e522f,_0x5da37f[_0x7be0('0x3a')],_0x4d06fa);_0x4dfb62[_0x4992d3](_0x3c6029[_0x7be0('0x68')],_0x3c6029[_0x7be0('0x65')][_0x7be0('0x69')],_0x3c6029[_0x7be0('0x65')]['end']);}break;case'body':_0x3c6029=as[_0x7be0('0x67')]('me',null,_0x4d06fa);_0x4dfb62[_0x4992d3](_0x3c6029[_0x7be0('0x68')],_0x3c6029[_0x7be0('0x65')]['start'],_0x3c6029[_0x7be0('0x65')][_0x7be0('0x20')]);break;}}else{var _0x3c6029=as['buildExpression'](_0x1e522f,_0x5da37f[_0x7be0('0x3a')],_0x4d06fa);_0x4dfb62[_0x4992d3](_0x3c6029['text'],_0x3c6029[_0x7be0('0x65')][_0x7be0('0x69')],_0x3c6029['value'][_0x7be0('0x20')]);}}}else{var _0x7ea293=_(_0xaa485c[_0x7be0('0x3c')])[_0x7be0('0x3d')]()['map'](function(_0x424e23){return _[_0x7be0('0x6f')](_0x2b7e13,[_0x7be0('0x2d'),_0x424e23])?_0x424e23:undefined;})[_0x7be0('0x70')]()[_0x7be0('0x65')]();if(!_['isEmpty'](_0x7ea293)){_0x7ea293['forEach'](function(_0x225664){if(_0x225664===_0x7be0('0x71')){_0x162c57[_0x7be0('0x72')](_0x7be0('0x73'),[]['concat'](_0xaa485c['query'][_0x225664]));}else if(_0x225664===_0x7be0('0x74')){var _0x55b3c8=JSON[_0x7be0('0x75')](_0xaa485c[_0x7be0('0x3c')][_0x225664])[_0x7be0('0x76')];var _0x7a6a59=JSON['parse'](_0xaa485c[_0x7be0('0x3c')][_0x225664])[_0x7be0('0x77')];_0x162c57[_0x7be0('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x55b3c8,_0x7a6a59);}else{if(_0xaa485c[_0x7be0('0x3c')][_0x225664]===_0x7be0('0x78')){_0x162c57[_0x7be0('0x72')]('i.'+_0x225664+_0x7be0('0x79'));}else{_0x162c57['where']('i.'+_0x225664+_0x7be0('0x7a'),_0xaa485c['query'][_0x225664]);}}});}if(_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x7b')]){if(_0xaa485c['query'][_0x7be0('0x7b')]==0x1){_0x162c57[_0x7be0('0x61')](_0x7be0('0x7c'));}else{_0x162c57['having']('`unreadMessages`\x20>\x200');}}if(_0xaa485c['query']['tag']){_0x5312e8=_[_0x7be0('0x7d')](_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x7e')])?_0xaa485c['query'][_0x7be0('0x7e')]:new Array(_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x7e')]);_0x5312e8['forEach'](function(_0x3d9cbe){_0x1a2d10['or'](_0x7be0('0x6b'),'%,'+_0x3d9cbe+',%');});}if(_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x7f')]){var _0x2ecc77=_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x7be0('0x80')](/'/g,'\x27\x27');if(qs[_0x7be0('0x81')](_0x2ecc77)){_0x4dfb62['or'](_0x7be0('0x82'),_0x2ecc77+'%')['or']('i.fax\x20LIKE\x20?',_0x2ecc77+'%');}_0x4dfb62['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2ecc77+'%');}}_0x162c57[_0x7be0('0x72')](_0x4dfb62);_0x162c57[_0x7be0('0x83')]('i.id');var _0x32a817={'type':db[_0x7be0('0x84')][_0x7be0('0x85')][_0x7be0('0x86')],'raw':!![]};var _0x311a5b=_0x162c57[_0x7be0('0x87')]();_0x311a5b[_0x7be0('0x49')]('i.id');_0x311a5b[_0x7be0('0x49')](_0x7be0('0x88'),_0x7be0('0x60'));if(_0x4f8670[_0x7be0('0x45')]){_0x4f8670['order'][_0x7be0('0x6a')](function(_0x55cbf0){var _0x50a9a1=_0x55cbf0[0x0]===_0x7be0('0x89')?_0x55cbf0[0x0]:'i.'+_0x55cbf0[0x0];_0x162c57[_0x7be0('0x45')](_0x50a9a1,_0x55cbf0[0x1]==='DESC'?![]:!![]);});}if(!_[_0x7be0('0x8a')](_0x5312e8)){_0x162c57[_0x7be0('0x61')](_0x1a2d10);_0x311a5b['where']('t.id\x20IN\x20?',_0x5312e8);}BPromise[_0x7be0('0x8b')]()[_0x7be0('0x28')](function(){if(!_0x3822c4){if(_0xaa485c['query'][_0x7be0('0x71')])return;_0x311a5b[_0x7be0('0x72')](_0x7be0('0x8c'));_0x162c57['where'](_0x7be0('0x8c'));return;}if(_0xaa485c[_0x7be0('0x8d')][_0x7be0('0x8e')]!==_0x7be0('0x8f'))return;return _0xaa485c['user'][_0x7be0('0x90')]({'attributes':['id'],'raw':!![]})[_0x7be0('0x28')](function(_0x35509f){if(_['isEmpty'](_0x35509f)){_0x311a5b['where']('i.FaxAccountId\x20IS\x20NULL');_0x162c57['where'](_0x7be0('0x91'));}else{_0x311a5b[_0x7be0('0x72')](_0x7be0('0x73'),_['map'](_0x35509f,'id'));_0x162c57[_0x7be0('0x72')]('i.FaxAccountId\x20IN\x20?',_[_0x7be0('0x30')](_0x35509f,'id'));}});})[_0x7be0('0x28')](function(){if(_0xaa485c[_0x7be0('0x8d')]['role']===_0x7be0('0x8f')&&!_0x3822c4&&!_0xaa485c[_0x7be0('0x3c')][_0x7be0('0x71')])return[];return db[_0x7be0('0x92')][_0x7be0('0x3c')](_0x311a5b[_0x7be0('0x93')](),_0x32a817);})[_0x7be0('0x28')](function(_0x32a9e3){_0x46e0ee[_0x7be0('0x94')]=_0x32a9e3[_0x7be0('0x5d')];if(_0x46e0ee[_0x7be0('0x94')]===0x0)return[];return db[_0x7be0('0x92')][_0x7be0('0x3c')](_0x4263f4[_0x7be0('0x93')](),_0x32a817)[_0x7be0('0x28')](function(_0x5ae8a0){_0x5b28d6=_[_0x7be0('0x95')](_0x5ae8a0,'id');_0x32a817=_[_0x7be0('0x96')](_0x32a817,{'model':db[_0x7be0('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xaa485c[_0x7be0('0x3c')]['fields']){_0x4f8670['attributes'][_0x7be0('0x6a')](function(_0x4e944f){_0x162c57[_0x7be0('0x49')]('i.'+_0x4e944f);});}else{_0x162c57[_0x7be0('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7be0('0x60'));_0x162c57[_0x7be0('0x49')](_0x7be0('0x97'),_0x7be0('0x98'));_0x162c57['field'](_0x7be0('0x99'),_0x7be0('0x9a'));_0x162c57[_0x7be0('0x49')](_0x7be0('0x9b'),_0x7be0('0x89'));_0x162c57[_0x7be0('0x49')](_0x7be0('0x9c'));_0x162c57[_0x7be0('0x49')](_0x7be0('0x9d'),'Contact.firstName');_0x162c57[_0x7be0('0x49')](_0x7be0('0x9e'),_0x7be0('0x9f'));_0x162c57[_0x7be0('0x49')](_0x7be0('0xa0'),_0x7be0('0xa1'));_0x162c57[_0x7be0('0x49')](_0x7be0('0xa2'),_0x7be0('0xa3'));_0x162c57[_0x7be0('0x49')]('c.mobile','Contact.mobile');_0x162c57[_0x7be0('0x49')](_0x7be0('0xa4'),_0x7be0('0xa5'));_0x162c57['field']('o.fullname','Owner.fullname');_0x162c57['field'](_0x7be0('0xa6'),_0x7be0('0xa7'));_0x162c57[_0x7be0('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7be0('0x32'));}if(_0x4f8670[_0x7be0('0x22')])_0x162c57['limit'](_0x4f8670[_0x7be0('0x22')]);if(_0x4f8670['offset'])_0x162c57[_0x7be0('0x24')](_0x4f8670[_0x7be0('0x24')]);return db[_0x7be0('0x92')]['query'](_0x162c57[_0x7be0('0x93')](),_0x32a817);})[_0x7be0('0x28')](function(_0x677a9b){if(_0x677a9b[_0x7be0('0x5d')]>0x0)_0x4ade91['where'](_0x7be0('0xa8'),_['map'](_0x677a9b,'id'));return db['sequelize']['query'](_0x4ade91[_0x7be0('0x93')](),_0x32a817)['then'](function(_0x3217d1){var _0x13e2dc=_['groupBy'](_0x3217d1,_0x7be0('0xa9'));var _0xf6d0ee=[];_0x677a9b[_0x7be0('0x6a')](function(_0x4aca93){_0xf6d0ee[_0x7be0('0x35')](updateFaxInteraction(_0x4aca93,_0x5b28d6,_0x13e2dc));});return BPromise[_0x7be0('0xaa')](_0xf6d0ee);});});})[_0x7be0('0x28')](function(_0x41c061){_0x46e0ee['rows']=_0x41c061;return _0x46e0ee;})['then'](respondWithFilteredResult(_0x174211,_0x4f8670))[_0x7be0('0x36')](handleError(_0x174211,null));};exports[_0x7be0('0xab')]=function(_0x349399,_0x938b9){var _0x458b0f={'raw':![],'where':{'id':_0x349399['params']['id']}},_0x3deec2={};_0x3deec2[_0x7be0('0x40')]=_[_0x7be0('0x3d')](db[_0x7be0('0x38')][_0x7be0('0x39')]);_0x3deec2[_0x7be0('0x3c')]=_['keys'](_0x349399['query']);_0x3deec2[_0x7be0('0x3e')]=_[_0x7be0('0x3f')](_0x3deec2[_0x7be0('0x40')],_0x3deec2['query']);_0x458b0f['attributes']=_[_0x7be0('0x3f')](_0x3deec2[_0x7be0('0x40')],qs['fields'](_0x349399[_0x7be0('0x3c')][_0x7be0('0x41')]));_0x458b0f[_0x7be0('0x42')]=_0x458b0f[_0x7be0('0x42')][_0x7be0('0x5d')]?_0x458b0f[_0x7be0('0x42')]:_0x3deec2[_0x7be0('0x40')];if(_0x349399[_0x7be0('0x3c')][_0x7be0('0xac')]){_0x458b0f['include']=[{'all':!![]}];}_0x458b0f=_['merge']({},_0x458b0f,_0x349399[_0x7be0('0xad')]);return db[_0x7be0('0x38')][_0x7be0('0x5f')](_0x458b0f)[_0x7be0('0x28')](handleEntityNotFound(_0x938b9,null))[_0x7be0('0x28')](respondWithResult(_0x938b9,null))['catch'](handleError(_0x938b9,null));};exports['create']=function(_0x490529,_0x55bf83){return db[_0x7be0('0x38')][_0x7be0('0xae')](_0x490529[_0x7be0('0xaf')],{})[_0x7be0('0x28')](respondWithResult(_0x55bf83,0xc9))[_0x7be0('0x36')](handleError(_0x55bf83,null));};exports['update']=function(_0x5b5718,_0x4721e3){if(_0x5b5718[_0x7be0('0xaf')]['id']){delete _0x5b5718['body']['id'];}return db['FaxInteraction'][_0x7be0('0x5f')]({'where':{'id':_0x5b5718['params']['id']}})[_0x7be0('0x28')](handleEntityNotFound(_0x4721e3,null))[_0x7be0('0x28')](saveUpdates(_0x5b5718[_0x7be0('0xaf')],null))[_0x7be0('0x28')](respondWithResult(_0x4721e3,null))[_0x7be0('0x36')](handleError(_0x4721e3,null));};exports[_0x7be0('0x29')]=function(_0x18843c,_0x4c0b88){return db[_0x7be0('0x38')]['find']({'where':{'id':_0x18843c[_0x7be0('0xb0')]['id']}})[_0x7be0('0x28')](handleEntityNotFound(_0x4c0b88,null))[_0x7be0('0x28')](removeEntity(_0x4c0b88,null))[_0x7be0('0x36')](handleError(_0x4c0b88,null));};exports[_0x7be0('0xb1')]=function(_0x3d9e80,_0x187351){return db[_0x7be0('0x38')][_0x7be0('0xb1')]()[_0x7be0('0x28')](respondWithResult(_0x187351,null))[_0x7be0('0x36')](handleError(_0x187351,null));};exports['addMessage']=function(_0x59bad8,_0x523fea,_0x22dfc3){return db['FaxMessage'][_0x7be0('0x5f')]({'where':{'id':_0x59bad8[_0x7be0('0xb0')]['id']}})['then'](handleEntityNotFound(_0x523fea,null))[_0x7be0('0x28')](function(_0x65d00e){if(_0x65d00e){return _0x65d00e[_0x7be0('0xb2')](_0x59bad8[_0x7be0('0xaf')][_0x7be0('0xb3')],_[_0x7be0('0xb4')](_0x59bad8['body'],[_0x7be0('0xb3'),'id'])||{});}})[_0x7be0('0x28')](respondWithResult(_0x523fea,null))[_0x7be0('0x36')](handleError(_0x523fea,null));};exports[_0x7be0('0xb5')]=function(_0x1885ba,_0x1be0cb,_0x4b6454){var _0x383cb4={'raw':![],'where':{}};var _0x861dac={};var _0x379551={'count':0x0,'rows':[]};return db[_0x7be0('0x38')]['findOne']({'where':{'id':_0x1885ba[_0x7be0('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1be0cb,null))[_0x7be0('0x28')](function(_0x1fa968){if(_0x1fa968){_0x861dac[_0x7be0('0x40')]=_[_0x7be0('0x3d')](db[_0x7be0('0xb6')]['rawAttributes']);_0x861dac['query']=_[_0x7be0('0x3d')](_0x1885ba[_0x7be0('0x3c')]);_0x861dac[_0x7be0('0x3e')]=_[_0x7be0('0x3f')](_0x861dac['model'],_0x861dac[_0x7be0('0x3c')]);_0x383cb4['attributes']=_[_0x7be0('0x3f')](_0x861dac['model'],qs[_0x7be0('0x41')](_0x1885ba[_0x7be0('0x3c')][_0x7be0('0x41')]));_0x383cb4[_0x7be0('0x42')]=_0x383cb4[_0x7be0('0x42')][_0x7be0('0x5d')]?_0x383cb4[_0x7be0('0x42')]:_0x861dac[_0x7be0('0x40')];if(!_0x1885ba[_0x7be0('0x3c')][_0x7be0('0x43')](_0x7be0('0x44'))){_0x383cb4['limit']=qs[_0x7be0('0x22')](_0x1885ba['query'][_0x7be0('0x22')]);_0x383cb4[_0x7be0('0x24')]=qs[_0x7be0('0x24')](_0x1885ba[_0x7be0('0x3c')][_0x7be0('0x24')]);}_0x383cb4[_0x7be0('0x45')]=qs[_0x7be0('0x46')](_0x1885ba[_0x7be0('0x3c')]['sort']);_0x383cb4[_0x7be0('0x72')]=qs[_0x7be0('0x3e')](_[_0x7be0('0x47')](_0x1885ba[_0x7be0('0x3c')],_0x861dac[_0x7be0('0x3e')]));_0x383cb4[_0x7be0('0x72')][_0x7be0('0xa9')]=_0x1fa968['id'];if(_0x1885ba['query'][_0x7be0('0x7f')]){_0x383cb4['where']=_[_0x7be0('0x96')](_0x383cb4[_0x7be0('0x72')],{'$or':_[_0x7be0('0x30')](_0x383cb4['attributes'],function(_0x212763){var _0x149bae={};_0x149bae[_0x212763]={'$like':'%'+_0x1885ba[_0x7be0('0x3c')][_0x7be0('0x7f')]+'%'};return _0x149bae;})});}if(_0x1885ba[_0x7be0('0x3c')][_0x7be0('0x76')]){var _0x102abc=_0x1885ba[_0x7be0('0x3c')][_0x7be0('0x76')][_0x7be0('0x34')](',');var _0x247be9={};_0x247be9[_0x102abc[0x0]]={'$gte':moment(_0x102abc[0x1])[_0x7be0('0xb7')](_0x7be0('0xb8'))};_0x383cb4[_0x7be0('0x72')]=_[_0x7be0('0x96')](_0x383cb4['where'],_0x247be9);}_0x383cb4=_[_0x7be0('0x96')]({},_0x383cb4,_0x1885ba['options']);return db[_0x7be0('0xb6')][_0x7be0('0x94')]({'where':_0x383cb4[_0x7be0('0x72')]})[_0x7be0('0x28')](function(_0x5cd95a){_0x379551[_0x7be0('0x94')]=_0x5cd95a;if(_0x1885ba[_0x7be0('0x3c')][_0x7be0('0xac')]){_0x383cb4[_0x7be0('0xb9')]=[{'all':!![]}];}return db[_0x7be0('0xb6')]['findAll'](_0x383cb4);})[_0x7be0('0x28')](function(_0x25e449){_0x379551[_0x7be0('0xba')]=_0x25e449;return _0x379551;});}})[_0x7be0('0x28')](respondWithFilteredResult(_0x1be0cb,_0x383cb4))[_0x7be0('0x36')](handleError(_0x1be0cb,null));};exports[_0x7be0('0xbb')]=function(_0x4f3d63,_0x1044cf,_0x8f7528){return db[_0x7be0('0x38')]['find']({'where':{'id':_0x4f3d63[_0x7be0('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1044cf,null))['then'](function(_0x26430c){if(_0x26430c){return _0x26430c[_0x7be0('0xbc')](_0x4f3d63['body']['ids'],_['omit'](_0x4f3d63[_0x7be0('0xaf')],['ids','id'])||{})[_0x7be0('0xbd')](function(){return db[_0x7be0('0xbe')][_0x7be0('0xbf')]({'attributes':['id',_0x7be0('0x2d'),'color'],'where':{'id':_0x4f3d63[_0x7be0('0xaf')][_0x7be0('0xb3')]}});})[_0x7be0('0x28')](function(_0x2b9038){socket[_0x7be0('0xc0')](_0x7be0('0xc1'),{'id':Number(_0x4f3d63['params']['id']),'tags':_0x2b9038||[]});return{'id':Number(_0x4f3d63['params']['id']),'tags':_0x2b9038||[]};});}})['then'](respondWithResult(_0x1044cf,null))[_0x7be0('0x36')](handleError(_0x1044cf,null));};exports[_0x7be0('0xc2')]=function(_0x5d82a8,_0x18f1c6,_0x342449){return db[_0x7be0('0x38')][_0x7be0('0x5f')]({'where':{'id':_0x5d82a8[_0x7be0('0xb0')]['id']}})[_0x7be0('0x28')](handleEntityNotFound(_0x18f1c6,null))['then'](function(_0x2f1bdc){if(_0x2f1bdc){return _0x2f1bdc[_0x7be0('0xc2')](_0x5d82a8[_0x7be0('0x3c')][_0x7be0('0xb3')]);}})[_0x7be0('0x28')](respondWithStatusCode(_0x18f1c6,null))[_0x7be0('0x36')](handleError(_0x18f1c6,null));};exports[_0x7be0('0xc3')]=function(_0x3ce6ed,_0x1445cc){var _0x196567=moment()[_0x7be0('0xc4')]()[_0x7be0('0x93')]();var _0x12892b=path[_0x7be0('0xc5')](config[_0x7be0('0xc6')],_0x7be0('0xc7'),_0x7be0('0xc8'),_0x7be0('0xc9'));var _0xbc8882=path[_0x7be0('0xc5')](config[_0x7be0('0xc6')],_0x7be0('0xc7'),_0x7be0('0xc8'),_0x7be0('0xca'));var _0x52ffaf=path[_0x7be0('0xc5')](_0x12892b,_0x196567);var _0x497595=util['format'](_0x7be0('0xcb'),_0x3ce6ed[_0x7be0('0xb0')]['id'],_0x196567);var _0x47e514=path[_0x7be0('0xc5')](_0x12892b,_0x497595);var _0x3edb9f=[];_0x3edb9f['push']({'model':db[_0x7be0('0xcc')],'as':_0x7be0('0xcc'),'raw':!![]});var _0x220ee8=[{'model':db[_0x7be0('0xb6')],'as':_0x7be0('0xcd'),'attributes':['id',_0x7be0('0xaf'),'createdAt'],'include':_0x3edb9f}];return db[_0x7be0('0x38')][_0x7be0('0x5f')]({'where':{'id':_0x3ce6ed[_0x7be0('0xb0')]['id']},'include':_0x220ee8})['then'](handleEntityNotFound(_0x1445cc,null))[_0x7be0('0x28')](function(_0x3fc86e){if(_0x3fc86e&&_0x3fc86e['Messages']){var _0x59be23=_0x3fc86e[_0x7be0('0xce')]({'plain':!![]});fs[_0x7be0('0xcf')](_0x52ffaf);for(var _0x11e2f2=0x0;_0x11e2f2<_0x59be23[_0x7be0('0xcd')][_0x7be0('0x5d')];_0x11e2f2++){var _0x35a452=_0x59be23['Messages'][_0x11e2f2]['Attachment'];if(_0x35a452){var _0x51b78d=path[_0x7be0('0xc5')](_0xbc8882,_0x35a452[_0x7be0('0xd0')]);if(fs['existsSync'](_0x51b78d)){fs[_0x7be0('0xd1')](_0x51b78d)[_0x7be0('0xd2')](fs[_0x7be0('0xd3')](path[_0x7be0('0xc5')](_0x52ffaf,_0x35a452[_0x7be0('0xd0')])));}}}return BPromise['resolve']()[_0x7be0('0x28')](function(){return new BPromise(function(_0x5d8ca8,_0x112e6b){zipdir(_0x52ffaf,{'saveTo':_0x47e514},function(_0x3b333b,_0x43a8ed){if(_0x3b333b)return _0x112e6b(_0x3b333b);return _0x5d8ca8(_0x43a8ed);});})[_0x7be0('0x28')](function(){return new BPromise(function(_0x27c01e,_0x248028){rimraf(_0x52ffaf,function(_0x2bb9f7){if(_0x2bb9f7)_0x248028(_0x2bb9f7);return _0x27c01e();});});})[_0x7be0('0x28')](function(){return _0x1445cc[_0x7be0('0xc3')](_0x47e514,_0x497595,function(_0xbfb1bb){if(_0xbfb1bb){console[_0x7be0('0xd4')](_0x7be0('0xd5'),_0xbfb1bb);}else{fs['unlinkSync'](_0x47e514);}});});});}else{return _0x1445cc[_0x7be0('0x2a')](0xc8);}})[_0x7be0('0x36')](handleError(_0x1445cc,null));}; \ No newline at end of file +var _0xd607=['catch','index','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','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?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','FaxAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','contactName','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','user','sequelize','toString','count','keyBy','FaxInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','push','all','rows','show','includeAll','include','merge','options','create','body','params','describe','addMessage','FaxMessage','omit','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','ids','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','format','Messages','createdAt','get','mkdirSync','basename','createReadStream','createWriteStream','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','register','sendStatus','end','status','limit','undefined','offset','Content-Range','json','save','update','destroy','then','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xd607,0x16e));var _0x7d60=function(_0x168533,_0x3e2ad4){_0x168533=_0x168533-0x0;var _0x4ac387=_0xd607[_0x168533];return _0x4ac387;};'use strict';var emlformat=require(_0x7d60('0x0'));var rimraf=require(_0x7d60('0x1'));var zipdir=require(_0x7d60('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d60('0x3'));var moment=require(_0x7d60('0x4'));var BPromise=require(_0x7d60('0x5'));var Mustache=require(_0x7d60('0x6'));var util=require(_0x7d60('0x7'));var path=require(_0x7d60('0x8'));var sox=require('sox');var csv=require(_0x7d60('0x9'));var ejs=require(_0x7d60('0xa'));var fs=require('fs');var fs_extra=require(_0x7d60('0xb'));var _=require('lodash');var squel=require(_0x7d60('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d60('0xd'));var deskjs=require(_0x7d60('0xe'));var toCsv=require(_0x7d60('0x9'));var querystring=require('querystring');var Papa=require(_0x7d60('0xf'));var Redis=require(_0x7d60('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7d60('0x11'));var as=require(_0x7d60('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d60('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d60('0x14'));var db=require(_0x7d60('0x15'))['db'];config['redis']=_['defaults'](config[_0x7d60('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d60('0x16')]));require('./faxInteraction.socket')[_0x7d60('0x17')](socket);function respondWithStatusCode(_0x733328,_0x4595b){_0x4595b=_0x4595b||0xcc;return function(_0x5b064e){if(_0x5b064e){return _0x733328[_0x7d60('0x18')](_0x4595b);}return _0x733328['status'](_0x4595b)[_0x7d60('0x19')]();};}function respondWithResult(_0x56ed27,_0x362c63){_0x362c63=_0x362c63||0xc8;return function(_0x571a59){if(_0x571a59){return _0x56ed27[_0x7d60('0x1a')](_0x362c63)['json'](_0x571a59);}};}function respondWithFilteredResult(_0x4e38ea,_0x33032d){return function(_0x5cffa8){if(_0x5cffa8){var _0x192c32=typeof _0x33032d['offset']==='undefined'&&typeof _0x33032d[_0x7d60('0x1b')]===_0x7d60('0x1c');var _0x283396=_0x5cffa8['count'];var _0x4b1fea=_0x192c32?0x0:_0x33032d[_0x7d60('0x1d')];var _0x28a473=_0x192c32?_0x5cffa8['count']:_0x33032d[_0x7d60('0x1d')]+_0x33032d['limit'];var _0x458a45;if(_0x28a473>=_0x283396){_0x28a473=_0x283396;_0x458a45=0xc8;}else{_0x458a45=0xce;}_0x4e38ea[_0x7d60('0x1a')](_0x458a45);return _0x4e38ea['set'](_0x7d60('0x1e'),_0x4b1fea+'-'+_0x28a473+'/'+_0x283396)[_0x7d60('0x1f')](_0x5cffa8);}return null;};}function patchUpdates(_0x3fd840){return function(_0x343bb9){try{jsonpatch['apply'](_0x343bb9,_0x3fd840,!![]);}catch(_0xab062a){return BPromise['reject'](_0xab062a);}return _0x343bb9[_0x7d60('0x20')]();};}function saveUpdates(_0x8b6c35,_0x2b9298){return function(_0x3feef3){if(_0x3feef3){return _0x3feef3[_0x7d60('0x21')](_0x8b6c35)['then'](function(_0x4d6a9b){return _0x4d6a9b;});}return null;};}function removeEntity(_0x32deb3,_0x53ce8d){return function(_0x5d978d){if(_0x5d978d){return _0x5d978d[_0x7d60('0x22')]()[_0x7d60('0x23')](function(){_0x32deb3['status'](0xcc)[_0x7d60('0x19')]();});}};}function handleEntityNotFound(_0x544247,_0x58ca3e){return function(_0x3bac3d){if(!_0x3bac3d){_0x544247[_0x7d60('0x18')](0x194);}return _0x3bac3d;};}function handleError(_0x3ad060,_0x3698bf){_0x3698bf=_0x3698bf||0x1f4;return function(_0x43c6bc){logger['error'](_0x43c6bc[_0x7d60('0x24')]);if(_0x43c6bc['name']){delete _0x43c6bc[_0x7d60('0x25')];}_0x3ad060[_0x7d60('0x1a')](_0x3698bf)[_0x7d60('0x26')](_0x43c6bc);};}function getInteractionUsers(_0x1430c2,_0x8ae79b){return new BPromise(function(_0x22d35f,_0x2441fc){try{if(_0x8ae79b[_0x1430c2['id']]){_0x1430c2[_0x7d60('0x27')]=_[_0x7d60('0x28')](_0x8ae79b[_0x1430c2['id']],function(_0x5ae212){return{'id':_0x5ae212['id'],'fullname':_0x5ae212[_0x7d60('0x29')]};});}}catch(_0x548edd){_0x2441fc(_0x548edd);}_0x22d35f(_0x1430c2);});}function getInteractionTags(_0x423206,_0x2a4015){return new BPromise(function(_0x334669,_0x59780f){try{if(_0x423206[_0x7d60('0x2a')]){_0x423206['Tags']=[];_0x423206[_0x7d60('0x2a')][_0x7d60('0x2b')](',')[_0x7d60('0x2c')](function(_0x3344b8){_0x423206[_0x7d60('0x2d')]['push'](_0x2a4015[_0x3344b8]);});}delete _0x423206[_0x7d60('0x2a')];}catch(_0x25e8a1){_0x59780f(_0x25e8a1);}_0x334669(_0x423206);});}function updateFaxInteraction(_0x5efc89,_0x3fcfb6,_0x172f59){return new BPromise(function(_0x54ac38,_0x213493){return getInteractionUsers(_0x5efc89,_0x172f59)['then'](function(_0x25eea6){return getInteractionTags(_0x25eea6,_0x3fcfb6);})[_0x7d60('0x23')](function(_0x4d2dfd){_0x54ac38(_0x4d2dfd);})[_0x7d60('0x2e')](function(_0x5b0ec8){_0x213493(_0x5b0ec8);});});}exports[_0x7d60('0x2f')]=function(_0x4b793f,_0x4959e3){var _0x193435={},_0xea37cf={},_0xdcc3c6={'count':0x0,'rows':[]};var _0x40bb99=_[_0x7d60('0x28')](db['FaxInteraction'][_0x7d60('0x30')],function(_0x3a7595){return{'name':_0x3a7595[_0x7d60('0x31')],'type':_0x3a7595[_0x7d60('0x32')]['key']};});_0xea37cf[_0x7d60('0x33')]=_[_0x7d60('0x28')](_0x40bb99,_0x7d60('0x25'));_0xea37cf[_0x7d60('0x34')]=_[_0x7d60('0x35')](_0x4b793f[_0x7d60('0x34')]);_0xea37cf['filters']=_[_0x7d60('0x36')](_0xea37cf[_0x7d60('0x33')],_0xea37cf['query']);_0x193435[_0x7d60('0x37')]=_['intersection'](_0xea37cf[_0x7d60('0x33')],qs['fields'](_0x4b793f[_0x7d60('0x34')][_0x7d60('0x38')]));_0x193435['attributes']=_0x193435[_0x7d60('0x37')][_0x7d60('0x39')]?_0x193435[_0x7d60('0x37')]:_0xea37cf['model'];if(!_0x4b793f[_0x7d60('0x34')]['hasOwnProperty'](_0x7d60('0x3a'))){_0x193435['limit']=qs[_0x7d60('0x1b')](_0x4b793f['query'][_0x7d60('0x1b')]);_0x193435[_0x7d60('0x1d')]=qs[_0x7d60('0x1d')](_0x4b793f['query'][_0x7d60('0x1d')]);}_0x193435[_0x7d60('0x3b')]=qs[_0x7d60('0x3c')](_0x4b793f[_0x7d60('0x34')][_0x7d60('0x3c')]);_0x193435[_0x7d60('0x3d')]=qs[_0x7d60('0x3e')](_['pick'](_0x4b793f[_0x7d60('0x34')],_0xea37cf[_0x7d60('0x3e')]),_0x40bb99);var _0x492d1e=[];var _0x1a8172=squel['select']()[_0x7d60('0x3f')]('id')['field'](_0x7d60('0x25'))[_0x7d60('0x3f')](_0x7d60('0x40'))[_0x7d60('0x41')](_0x7d60('0x42'));var _0x516717=squel['select']()[_0x7d60('0x3f')](_0x7d60('0x43'))[_0x7d60('0x3f')]('u.fullname')[_0x7d60('0x3f')](_0x7d60('0x44'))['from'](_0x7d60('0x45'),'ui')[_0x7d60('0x46')](_0x7d60('0x47'),'u',_0x7d60('0x48'));var _0x4373f0=squel[_0x7d60('0x49')]()[_0x7d60('0x41')]('fax_interactions','i')[_0x7d60('0x46')](_0x7d60('0x4a'),'c',_0x7d60('0x4b'))[_0x7d60('0x46')]('users','o',_0x7d60('0x4c'))[_0x7d60('0x46')](_0x7d60('0x4d'),'a',_0x7d60('0x4e'))[_0x7d60('0x46')](_0x7d60('0x4f'),'me',_0x7d60('0x50'))[_0x7d60('0x46')](_0x7d60('0x51'),'it',_0x7d60('0x52'))[_0x7d60('0x46')](_0x7d60('0x42'),'t',_0x7d60('0x53'));var _0x55b0e1=squel[_0x7d60('0x54')]();var _0x2836f5=[];var _0x37c96d=squel[_0x7d60('0x54')]();var _0x58da8a;if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x55')]){_0x58da8a=as['parseSearch'](_0x4b793f[_0x7d60('0x34')][_0x7d60('0x55')]);var _0x312556=_0x58da8a[_0x7d60('0x56')];for(var _0x5a67f8=0x0;_0x5a67f8<_0x58da8a[_0x7d60('0x57')][_0x7d60('0x39')];_0x5a67f8++){var _0x5d6367=_0x58da8a[_0x7d60('0x57')][_0x5a67f8];var _0x55609c='i';var _0x3b78e6=_[_0x7d60('0x58')](_0x40bb99,[_0x7d60('0x25'),_0x5d6367[_0x7d60('0x3f')]]);if(!_0x3b78e6){switch(_0x5d6367['field']){case _0x7d60('0x59'):if(_0x5d6367[_0x7d60('0x5a')]==0x1){_0x4373f0[_0x7d60('0x5b')]('`'+_0x5d6367[_0x7d60('0x3f')]+_0x7d60('0x5c'));}else{_0x4373f0[_0x7d60('0x5b')]('`'+_0x5d6367['field']+_0x7d60('0x5d'));}break;case'Contact':if(_0x5d6367[_0x7d60('0x5e')]==='$substring'){if(_0x5d6367[_0x7d60('0x5a')][_0x7d60('0x2b')]('\x20')[_0x7d60('0x39')]>0x1){_0x55b0e1[_0x312556]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7d60('0x5f')](_0x5d6367[_0x7d60('0x5a')]),null);}else{var _0x39b13a='%'+_0x5d6367[_0x7d60('0x5a')]+'%';_0x55b0e1[_0x312556](_0x7d60('0x60'),_0x39b13a,_0x39b13a,_0x39b13a);}}else{_0x3b78e6=_[_0x7d60('0x58')](_0x40bb99,[_0x7d60('0x25'),'ContactId']);_0x5d6367['field']=_0x7d60('0x61');_0x536abe=as[_0x7d60('0x62')](_0x55609c,_0x3b78e6[_0x7d60('0x32')],_0x5d6367);_0x55b0e1[_0x312556](_0x536abe[_0x7d60('0x63')],_0x536abe[_0x7d60('0x5a')]['start'],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x19')]);}break;case _0x7d60('0x64'):var _0x55a82e=_0x5d6367[_0x7d60('0x5a')][_0x7d60('0x2b')](',')[_0x7d60('0x28')](function(_0x4d5924){return Number(_0x4d5924);});_0x55a82e['forEach'](function(_0x4b60b8){_0x37c96d['or'](_0x7d60('0x65'),'%,'+_0x4b60b8+',%');});_0x2836f5=_['union'](_0x2836f5,_0x55a82e);break;case _0x7d60('0x66'):if(_0x5d6367[_0x7d60('0x5e')]==='$substring'){_0x55b0e1[_0x312556](_0x7d60('0x67'),'%'+_0x5d6367[_0x7d60('0x5a')]+'%',null);}else{_0x3b78e6=_[_0x7d60('0x58')](_0x40bb99,[_0x7d60('0x25'),_0x7d60('0x68')]);_0x5d6367[_0x7d60('0x3f')]=_0x7d60('0x68');_0x536abe=as[_0x7d60('0x62')](_0x55609c,_0x3b78e6[_0x7d60('0x32')],_0x5d6367);_0x55b0e1[_0x312556](_0x536abe[_0x7d60('0x63')],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x69')],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x19')]);}break;case'body':_0x536abe=as['buildExpression']('me',null,_0x5d6367);_0x55b0e1[_0x312556](_0x536abe['text'],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x69')],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x19')]);break;}}else{var _0x536abe=as[_0x7d60('0x62')](_0x55609c,_0x3b78e6[_0x7d60('0x32')],_0x5d6367);_0x55b0e1[_0x312556](_0x536abe[_0x7d60('0x63')],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x69')],_0x536abe[_0x7d60('0x5a')][_0x7d60('0x19')]);}}}else{var _0x463814=_(_0x4b793f[_0x7d60('0x34')])[_0x7d60('0x35')]()['map'](function(_0x449713){return _['some'](_0x40bb99,[_0x7d60('0x25'),_0x449713])?_0x449713:undefined;})[_0x7d60('0x6a')]()[_0x7d60('0x5a')]();if(!_[_0x7d60('0x6b')](_0x463814)){_0x463814[_0x7d60('0x2c')](function(_0x20dc79){if(_0x20dc79===_0x7d60('0x6c')){_0x4373f0[_0x7d60('0x3d')]('i.FaxAccountId\x20IN\x20?',[][_0x7d60('0x6d')](_0x4b793f[_0x7d60('0x34')][_0x20dc79]));}else if(_0x20dc79==='createdAt'){var _0x148d11=JSON[_0x7d60('0x6e')](_0x4b793f[_0x7d60('0x34')][_0x20dc79])[_0x7d60('0x6f')];var _0x7d5d=JSON['parse'](_0x4b793f[_0x7d60('0x34')][_0x20dc79])[_0x7d60('0x70')];_0x4373f0[_0x7d60('0x3d')](_0x7d60('0x71'),_0x148d11,_0x7d5d);}else{if(_0x4b793f['query'][_0x20dc79]===_0x7d60('0x72')){_0x4373f0[_0x7d60('0x3d')]('i.'+_0x20dc79+_0x7d60('0x73'));}else{_0x4373f0[_0x7d60('0x3d')]('i.'+_0x20dc79+'\x20=\x20?',_0x4b793f['query'][_0x20dc79]);}}});}if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x74')]){if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x74')]==0x1){_0x4373f0[_0x7d60('0x5b')](_0x7d60('0x75'));}else{_0x4373f0[_0x7d60('0x5b')](_0x7d60('0x76'));}}if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x77')]){_0x2836f5=_[_0x7d60('0x78')](_0x4b793f[_0x7d60('0x34')][_0x7d60('0x77')])?_0x4b793f[_0x7d60('0x34')][_0x7d60('0x77')]:new Array(_0x4b793f[_0x7d60('0x34')]['tag']);_0x2836f5['forEach'](function(_0x4833e3){_0x37c96d['or'](_0x7d60('0x65'),'%,'+_0x4833e3+',%');});}if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x79')]){var _0x21ad33=_0x4b793f['query'][_0x7d60('0x79')][_0x7d60('0x7a')]('\x5c','\x5c\x5c')[_0x7d60('0x7a')](/'/g,'\x27\x27');if(qs[_0x7d60('0x7b')](_0x21ad33)){_0x55b0e1['or'](_0x7d60('0x7c'),_0x21ad33+'%')['or'](_0x7d60('0x7d'),_0x21ad33+'%');}_0x55b0e1['or'](_0x7d60('0x7e'),_0x21ad33+'%');}}_0x4373f0[_0x7d60('0x3d')](_0x55b0e1);_0x4373f0[_0x7d60('0x7f')]('i.id');var _0x35cf6={'type':db[_0x7d60('0x80')][_0x7d60('0x81')][_0x7d60('0x82')],'raw':!![]};var _0x10567b=_0x4373f0[_0x7d60('0x83')]();_0x10567b[_0x7d60('0x3f')]('i.id');_0x10567b[_0x7d60('0x3f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7d60('0x59'));if(_0x193435[_0x7d60('0x3b')]){_0x193435['order'][_0x7d60('0x2c')](function(_0x36c7d4){var _0x1ca251=_0x36c7d4[0x0]===_0x7d60('0x84')?_0x36c7d4[0x0]:'i.'+_0x36c7d4[0x0];_0x4373f0['order'](_0x1ca251,_0x36c7d4[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2836f5)){_0x4373f0[_0x7d60('0x5b')](_0x37c96d);_0x10567b[_0x7d60('0x3d')]('t.id\x20IN\x20?',_0x2836f5);}BPromise[_0x7d60('0x85')]()[_0x7d60('0x23')](function(){if(!_0x58da8a){if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x6c')])return;_0x10567b['where'](_0x7d60('0x86'));_0x4373f0['where'](_0x7d60('0x86'));return;}if(_0x4b793f['user'][_0x7d60('0x87')]!==_0x7d60('0x88'))return;return _0x4b793f['user'][_0x7d60('0x89')]({'attributes':['id'],'raw':!![]})[_0x7d60('0x23')](function(_0x303a54){if(_[_0x7d60('0x6b')](_0x303a54)){_0x10567b[_0x7d60('0x3d')](_0x7d60('0x8a'));_0x4373f0[_0x7d60('0x3d')](_0x7d60('0x8a'));}else{_0x10567b[_0x7d60('0x3d')](_0x7d60('0x8b'),_['map'](_0x303a54,'id'));_0x4373f0[_0x7d60('0x3d')](_0x7d60('0x8b'),_[_0x7d60('0x28')](_0x303a54,'id'));}});})[_0x7d60('0x23')](function(){if(_0x4b793f[_0x7d60('0x8c')][_0x7d60('0x87')]===_0x7d60('0x88')&&!_0x58da8a&&!_0x4b793f[_0x7d60('0x34')][_0x7d60('0x6c')])return[];return db[_0x7d60('0x8d')][_0x7d60('0x34')](_0x10567b[_0x7d60('0x8e')](),_0x35cf6);})[_0x7d60('0x23')](function(_0x1b08a8){_0xdcc3c6[_0x7d60('0x8f')]=_0x1b08a8[_0x7d60('0x39')];if(_0xdcc3c6[_0x7d60('0x8f')]===0x0)return[];return db[_0x7d60('0x8d')][_0x7d60('0x34')](_0x1a8172[_0x7d60('0x8e')](),_0x35cf6)[_0x7d60('0x23')](function(_0x1c0470){_0x492d1e=_[_0x7d60('0x90')](_0x1c0470,'id');_0x35cf6=_['merge'](_0x35cf6,{'model':db[_0x7d60('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b793f[_0x7d60('0x34')][_0x7d60('0x38')]){_0x193435[_0x7d60('0x37')]['forEach'](function(_0x4159b5){_0x4373f0[_0x7d60('0x3f')]('i.'+_0x4159b5);});}else{_0x4373f0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7d60('0x59'));_0x4373f0[_0x7d60('0x3f')](_0x7d60('0x92'),'Account.key');_0x4373f0['field'](_0x7d60('0x93'),_0x7d60('0x94'));_0x4373f0['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x7d60('0x84'));_0x4373f0[_0x7d60('0x3f')](_0x7d60('0x95'));_0x4373f0[_0x7d60('0x3f')]('c.firstName',_0x7d60('0x96'));_0x4373f0['field'](_0x7d60('0x97'),_0x7d60('0x98'));_0x4373f0[_0x7d60('0x3f')]('c.email','Contact.email');_0x4373f0[_0x7d60('0x3f')](_0x7d60('0x99'),'Contact.phone');_0x4373f0['field'](_0x7d60('0x9a'),_0x7d60('0x9b'));_0x4373f0['field'](_0x7d60('0x9c'),'Contact.fax');_0x4373f0[_0x7d60('0x3f')](_0x7d60('0x9d'),_0x7d60('0x9e'));_0x4373f0[_0x7d60('0x3f')](_0x7d60('0x9f'),_0x7d60('0xa0'));_0x4373f0[_0x7d60('0x3f')](_0x7d60('0xa1'),_0x7d60('0x2a'));}if(_0x193435[_0x7d60('0x1b')])_0x4373f0[_0x7d60('0x1b')](_0x193435['limit']);if(_0x193435[_0x7d60('0x1d')])_0x4373f0['offset'](_0x193435[_0x7d60('0x1d')]);return db[_0x7d60('0x8d')]['query'](_0x4373f0[_0x7d60('0x8e')](),_0x35cf6);})['then'](function(_0x89115b){if(_0x89115b[_0x7d60('0x39')]>0x0)_0x516717['where']('ui.FaxInteractionId\x20IN\x20?',_[_0x7d60('0x28')](_0x89115b,'id'));return db['sequelize']['query'](_0x516717[_0x7d60('0x8e')](),_0x35cf6)[_0x7d60('0x23')](function(_0x1e9218){var _0x4bcee1=_[_0x7d60('0xa2')](_0x1e9218,_0x7d60('0xa3'));var _0x1add6c=[];_0x89115b['forEach'](function(_0x50693b){_0x1add6c[_0x7d60('0xa4')](updateFaxInteraction(_0x50693b,_0x492d1e,_0x4bcee1));});return BPromise[_0x7d60('0xa5')](_0x1add6c);});});})['then'](function(_0x3e57d2){_0xdcc3c6[_0x7d60('0xa6')]=_0x3e57d2;return _0xdcc3c6;})['then'](respondWithFilteredResult(_0x4959e3,_0x193435))['catch'](handleError(_0x4959e3,null));};exports[_0x7d60('0xa7')]=function(_0x28ae75,_0x278975){var _0x4d7232={'raw':![],'where':{'id':_0x28ae75['params']['id']}},_0x5bfdb4={};_0x5bfdb4[_0x7d60('0x33')]=_['keys'](db[_0x7d60('0x91')]['rawAttributes']);_0x5bfdb4[_0x7d60('0x34')]=_[_0x7d60('0x35')](_0x28ae75[_0x7d60('0x34')]);_0x5bfdb4[_0x7d60('0x3e')]=_[_0x7d60('0x36')](_0x5bfdb4[_0x7d60('0x33')],_0x5bfdb4['query']);_0x4d7232[_0x7d60('0x37')]=_[_0x7d60('0x36')](_0x5bfdb4['model'],qs[_0x7d60('0x38')](_0x28ae75['query']['fields']));_0x4d7232['attributes']=_0x4d7232['attributes'][_0x7d60('0x39')]?_0x4d7232[_0x7d60('0x37')]:_0x5bfdb4[_0x7d60('0x33')];if(_0x28ae75[_0x7d60('0x34')][_0x7d60('0xa8')]){_0x4d7232[_0x7d60('0xa9')]=[{'all':!![]}];}_0x4d7232=_[_0x7d60('0xaa')]({},_0x4d7232,_0x28ae75[_0x7d60('0xab')]);return db[_0x7d60('0x91')][_0x7d60('0x58')](_0x4d7232)[_0x7d60('0x23')](handleEntityNotFound(_0x278975,null))[_0x7d60('0x23')](respondWithResult(_0x278975,null))[_0x7d60('0x2e')](handleError(_0x278975,null));};exports[_0x7d60('0xac')]=function(_0x289e69,_0x2cc7d4){return db[_0x7d60('0x91')]['create'](_0x289e69[_0x7d60('0xad')],{})[_0x7d60('0x23')](respondWithResult(_0x2cc7d4,0xc9))[_0x7d60('0x2e')](handleError(_0x2cc7d4,null));};exports[_0x7d60('0x21')]=function(_0x28f663,_0x388694){if(_0x28f663[_0x7d60('0xad')]['id']){delete _0x28f663['body']['id'];}return db[_0x7d60('0x91')]['find']({'where':{'id':_0x28f663['params']['id']}})[_0x7d60('0x23')](handleEntityNotFound(_0x388694,null))[_0x7d60('0x23')](saveUpdates(_0x28f663['body'],null))['then'](respondWithResult(_0x388694,null))['catch'](handleError(_0x388694,null));};exports[_0x7d60('0x22')]=function(_0x312288,_0x634e6a){return db[_0x7d60('0x91')][_0x7d60('0x58')]({'where':{'id':_0x312288[_0x7d60('0xae')]['id']}})[_0x7d60('0x23')](handleEntityNotFound(_0x634e6a,null))['then'](removeEntity(_0x634e6a,null))[_0x7d60('0x2e')](handleError(_0x634e6a,null));};exports['describe']=function(_0x2f4666,_0x43adb6){return db[_0x7d60('0x91')][_0x7d60('0xaf')]()[_0x7d60('0x23')](respondWithResult(_0x43adb6,null))[_0x7d60('0x2e')](handleError(_0x43adb6,null));};exports[_0x7d60('0xb0')]=function(_0x24abf0,_0x1ac4f3,_0x5663af){return db[_0x7d60('0xb1')]['find']({'where':{'id':_0x24abf0[_0x7d60('0xae')]['id']}})[_0x7d60('0x23')](handleEntityNotFound(_0x1ac4f3,null))[_0x7d60('0x23')](function(_0x14befa){if(_0x14befa){return _0x14befa['addMessage'](_0x24abf0['body']['ids'],_[_0x7d60('0xb2')](_0x24abf0[_0x7d60('0xad')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ac4f3,null))[_0x7d60('0x2e')](handleError(_0x1ac4f3,null));};exports['getMessages']=function(_0x38f2e6,_0x259be3,_0x43e266){var _0x5d62a9={'raw':![],'where':{}};var _0x2326c4={};var _0x19c9eb={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x38f2e6['params']['id']}})[_0x7d60('0x23')](handleEntityNotFound(_0x259be3,null))[_0x7d60('0x23')](function(_0x883a2d){if(_0x883a2d){_0x2326c4[_0x7d60('0x33')]=_[_0x7d60('0x35')](db[_0x7d60('0xb1')][_0x7d60('0x30')]);_0x2326c4[_0x7d60('0x34')]=_[_0x7d60('0x35')](_0x38f2e6['query']);_0x2326c4[_0x7d60('0x3e')]=_[_0x7d60('0x36')](_0x2326c4[_0x7d60('0x33')],_0x2326c4[_0x7d60('0x34')]);_0x5d62a9[_0x7d60('0x37')]=_[_0x7d60('0x36')](_0x2326c4[_0x7d60('0x33')],qs['fields'](_0x38f2e6['query']['fields']));_0x5d62a9[_0x7d60('0x37')]=_0x5d62a9[_0x7d60('0x37')][_0x7d60('0x39')]?_0x5d62a9[_0x7d60('0x37')]:_0x2326c4['model'];if(!_0x38f2e6[_0x7d60('0x34')]['hasOwnProperty'](_0x7d60('0x3a'))){_0x5d62a9[_0x7d60('0x1b')]=qs[_0x7d60('0x1b')](_0x38f2e6[_0x7d60('0x34')][_0x7d60('0x1b')]);_0x5d62a9[_0x7d60('0x1d')]=qs['offset'](_0x38f2e6[_0x7d60('0x34')][_0x7d60('0x1d')]);}_0x5d62a9['order']=qs[_0x7d60('0x3c')](_0x38f2e6[_0x7d60('0x34')][_0x7d60('0x3c')]);_0x5d62a9[_0x7d60('0x3d')]=qs[_0x7d60('0x3e')](_[_0x7d60('0xb3')](_0x38f2e6[_0x7d60('0x34')],_0x2326c4[_0x7d60('0x3e')]));_0x5d62a9[_0x7d60('0x3d')][_0x7d60('0xa3')]=_0x883a2d['id'];if(_0x38f2e6['query'][_0x7d60('0x79')]){_0x5d62a9[_0x7d60('0x3d')]=_[_0x7d60('0xaa')](_0x5d62a9[_0x7d60('0x3d')],{'$or':_[_0x7d60('0x28')](_0x5d62a9[_0x7d60('0x37')],function(_0x402271){var _0x16a3ee={};_0x16a3ee[_0x402271]={'$like':'%'+_0x38f2e6[_0x7d60('0x34')][_0x7d60('0x79')]+'%'};return _0x16a3ee;})});}if(_0x38f2e6[_0x7d60('0x34')][_0x7d60('0x6f')]){var _0x3e6a3a=_0x38f2e6[_0x7d60('0x34')][_0x7d60('0x6f')][_0x7d60('0x2b')](',');var _0x150611={};_0x150611[_0x3e6a3a[0x0]]={'$gte':moment(_0x3e6a3a[0x1])['format'](_0x7d60('0xb4'))};_0x5d62a9[_0x7d60('0x3d')]=_[_0x7d60('0xaa')](_0x5d62a9[_0x7d60('0x3d')],_0x150611);}_0x5d62a9=_['merge']({},_0x5d62a9,_0x38f2e6[_0x7d60('0xab')]);return db[_0x7d60('0xb1')][_0x7d60('0x8f')]({'where':_0x5d62a9['where']})['then'](function(_0x418aa7){_0x19c9eb[_0x7d60('0x8f')]=_0x418aa7;if(_0x38f2e6[_0x7d60('0x34')][_0x7d60('0xa8')]){_0x5d62a9[_0x7d60('0xa9')]=[{'all':!![]}];}return db[_0x7d60('0xb1')][_0x7d60('0xb5')](_0x5d62a9);})[_0x7d60('0x23')](function(_0x5199df){_0x19c9eb[_0x7d60('0xa6')]=_0x5199df;return _0x19c9eb;});}})['then'](respondWithFilteredResult(_0x259be3,_0x5d62a9))['catch'](handleError(_0x259be3,null));};exports[_0x7d60('0xb6')]=function(_0x16993b,_0x3185d6,_0x598217){return db[_0x7d60('0x91')]['find']({'where':{'id':_0x16993b['params']['id']}})['then'](handleEntityNotFound(_0x3185d6,null))[_0x7d60('0x23')](function(_0x167cf8){if(_0x167cf8){return _0x167cf8['setTags'](_0x16993b['body'][_0x7d60('0xb7')],_['omit'](_0x16993b[_0x7d60('0xad')],[_0x7d60('0xb7'),'id'])||{})[_0x7d60('0xb8')](function(){return db['Tag'][_0x7d60('0xb5')]({'attributes':['id','name',_0x7d60('0x40')],'where':{'id':_0x16993b['body'][_0x7d60('0xb7')]}});})[_0x7d60('0x23')](function(_0x1bd3fa){socket[_0x7d60('0xb9')](_0x7d60('0xba'),{'id':Number(_0x16993b[_0x7d60('0xae')]['id']),'tags':_0x1bd3fa||[]});return{'id':Number(_0x16993b[_0x7d60('0xae')]['id']),'tags':_0x1bd3fa||[]};});}})[_0x7d60('0x23')](respondWithResult(_0x3185d6,null))[_0x7d60('0x2e')](handleError(_0x3185d6,null));};exports[_0x7d60('0xbb')]=function(_0x324d3f,_0xfb54e8,_0x4de687){return db['FaxInteraction'][_0x7d60('0x58')]({'where':{'id':_0x324d3f[_0x7d60('0xae')]['id']}})['then'](handleEntityNotFound(_0xfb54e8,null))[_0x7d60('0x23')](function(_0x52e8af){if(_0x52e8af){return _0x52e8af[_0x7d60('0xbb')](_0x324d3f[_0x7d60('0x34')][_0x7d60('0xb7')]);}})[_0x7d60('0x23')](respondWithStatusCode(_0xfb54e8,null))['catch'](handleError(_0xfb54e8,null));};exports[_0x7d60('0xbc')]=function(_0x2b2d2c,_0x77938e){var _0x20749f=moment()[_0x7d60('0xbd')]()[_0x7d60('0x8e')]();var _0x1c05dd=path['join'](config[_0x7d60('0xbe')],_0x7d60('0xbf'),_0x7d60('0xc0'),_0x7d60('0xc1'));var _0x4ef5b0=path[_0x7d60('0xc2')](config[_0x7d60('0xbe')],_0x7d60('0xbf'),'files',_0x7d60('0xc3'));var _0x188610=path[_0x7d60('0xc2')](_0x1c05dd,_0x20749f);var _0x239011=util[_0x7d60('0xc4')]('transcript-%d-%s.zip',_0x2b2d2c['params']['id'],_0x20749f);var _0x49d09b=path['join'](_0x1c05dd,_0x239011);var _0x205d05=[];_0x205d05[_0x7d60('0xa4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0xb010ae=[{'model':db[_0x7d60('0xb1')],'as':_0x7d60('0xc5'),'attributes':['id',_0x7d60('0xad'),_0x7d60('0xc6')],'include':_0x205d05}];return db[_0x7d60('0x91')][_0x7d60('0x58')]({'where':{'id':_0x2b2d2c[_0x7d60('0xae')]['id']},'include':_0xb010ae})['then'](handleEntityNotFound(_0x77938e,null))['then'](function(_0x51c036){if(_0x51c036&&_0x51c036['Messages']){var _0x1b9172=_0x51c036[_0x7d60('0xc7')]({'plain':!![]});fs[_0x7d60('0xc8')](_0x188610);for(var _0x5884d3=0x0;_0x5884d3<_0x1b9172[_0x7d60('0xc5')][_0x7d60('0x39')];_0x5884d3++){var _0xc1c391=_0x1b9172[_0x7d60('0xc5')][_0x5884d3]['Attachment'];if(_0xc1c391){var _0x157584=path[_0x7d60('0xc2')](_0x4ef5b0,_0xc1c391[_0x7d60('0xc9')]);if(fs['existsSync'](_0x157584)){fs[_0x7d60('0xca')](_0x157584)['pipe'](fs[_0x7d60('0xcb')](path[_0x7d60('0xc2')](_0x188610,_0xc1c391['basename'])));}}}return BPromise['resolve']()[_0x7d60('0x23')](function(){return new BPromise(function(_0x4734b1,_0xe20e6){zipdir(_0x188610,{'saveTo':_0x49d09b},function(_0x44bbfc,_0x5edd79){if(_0x44bbfc)return _0xe20e6(_0x44bbfc);return _0x4734b1(_0x5edd79);});})[_0x7d60('0x23')](function(){return new BPromise(function(_0x4d6747,_0x2e8bfd){rimraf(_0x188610,function(_0x342fe4){if(_0x342fe4)_0x2e8bfd(_0x342fe4);return _0x4d6747();});});})[_0x7d60('0x23')](function(){return _0x77938e[_0x7d60('0xbc')](_0x49d09b,_0x239011,function(_0x42afb4){if(_0x42afb4){console['log'](_0x7d60('0xcc'),_0x42afb4);}else{fs[_0x7d60('0xcd')](_0x49d09b);}});});});}else{return _0x77938e[_0x7d60('0x18')](0xc8);}})[_0x7d60('0x2e')](handleError(_0x77938e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index fb6c75f..b06ec4f 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 _0xa592=['update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners'];(function(_0x5707db,_0x51929d){var _0x50bcc2=function(_0x5e4712){while(--_0x5e4712){_0x5707db['push'](_0x5707db['shift']());}};_0x50bcc2(++_0x51929d);}(_0xa592,0x72));var _0x2a59=function(_0x13f4f5,_0x5496d5){_0x13f4f5=_0x13f4f5-0x0;var _0x4a6951=_0xa592[_0x13f4f5];return _0x4a6951;};'use strict';var EventEmitter=require(_0x2a59('0x0'));var FaxInteraction=require(_0x2a59('0x1'))['db'][_0x2a59('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x2a59('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2a59('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2a59('0x5'),'afterDestroy':'remove'};function emitEvent(_0x420294){return function(_0x4c985f,_0x4ddcd2,_0x23f9e6){_0x4c985f[_0x2a59('0x6')]({'attributes':['id'],'raw':!![]})[_0x2a59('0x7')](function(_0x17763b){_0x4c985f[_0x2a59('0x8')](_0x2a59('0x9'),_0x17763b[_0x2a59('0xa')](function(_0x325589){return{'id':_0x325589['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4c985f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x45e50b){_0x4c985f[_0x2a59('0x8')](_0x2a59('0xb'),_0x45e50b[_0x2a59('0xc')]);FaxInteractionEvents[_0x2a59('0xd')](_0x420294+':'+_0x4c985f['id'],_0x4c985f);FaxInteractionEvents['emit'](_0x420294,_0x4c985f);_0x23f9e6(null);})[_0x2a59('0xe')](_0x23f9e6(null));};}for(var e in events){if(events[_0x2a59('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x2a59('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xf78d=['findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','FaxInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map'];(function(_0x4ad191,_0xbe563a){var _0x436317=function(_0x917caa){while(--_0x917caa){_0x4ad191['push'](_0x4ad191['shift']());}};_0x436317(++_0xbe563a);}(_0xf78d,0x15b));var _0xdf78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf78d[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0xdf78('0x0')];var FaxMessage=require(_0xdf78('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xdf78('0x2')](0x0);var events={'afterCreate':_0xdf78('0x3'),'afterUpdate':_0xdf78('0x4'),'afterDestroy':_0xdf78('0x5')};function emitEvent(_0xe1c81c){return function(_0xfa6a4,_0xf55e90,_0x2f4ed5){_0xfa6a4[_0xdf78('0x6')]({'attributes':['id'],'raw':!![]})[_0xdf78('0x7')](function(_0x2dca85){_0xfa6a4[_0xdf78('0x8')]('Users',_0x2dca85[_0xdf78('0x9')](function(_0x14c296){return{'id':_0x14c296['id']};}));return FaxMessage[_0xdf78('0xa')]({'where':{'FaxInteractionId':_0xfa6a4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x219382){_0xfa6a4[_0xdf78('0x8')](_0xdf78('0xb'),_0x219382[_0xdf78('0xc')]);FaxInteractionEvents[_0xdf78('0xd')](_0xe1c81c+':'+_0xfa6a4['id'],_0xfa6a4);FaxInteractionEvents[_0xdf78('0xd')](_0xe1c81c,_0xfa6a4);_0x2f4ed5(null);})['catch'](_0x2f4ed5(null));};}for(var e in events){if(events[_0xdf78('0xe')](e)){var event=events[e];FaxInteraction[_0xdf78('0xf')](e,emitEvent(event));}}module[_0xdf78('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 8def957..ab36fc5 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 _0x8a83=['bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x8a83,0x1b0));var _0x38a8=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x8a83[_0x531d15];return _0x271a18;};'use strict';var _=require(_0x38a8('0x0'));var util=require(_0x38a8('0x1'));var logger=require(_0x38a8('0x2'))(_0x38a8('0x3'));var moment=require(_0x38a8('0x4'));var BPromise=require(_0x38a8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38a8('0x6'));var rimraf=require(_0x38a8('0x7'));var config=require(_0x38a8('0x8'));var attributes=require(_0x38a8('0x9'));module[_0x38a8('0xa')]=function(_0xc90f2c,_0xc45234){return _0xc90f2c[_0x38a8('0xb')](_0x38a8('0xc'),attributes,{'tableName':_0x38a8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1cf4d0,_0x3aa21a,_0x4766f8){if(_0x1cf4d0[_0x38a8('0xe')](_0x38a8('0xf'))){_0x1cf4d0[_0x38a8('0x10')]=moment()[_0x38a8('0x11')](_0x38a8('0x12'));}_0x4766f8(null,_0x1cf4d0);}}});}; \ No newline at end of file +var _0x1315=['api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','format','lodash','util','../../config/logger'];(function(_0x1b8086,_0x1220c1){var _0x33e083=function(_0x51297b){while(--_0x51297b){_0x1b8086['push'](_0x1b8086['shift']());}};_0x33e083(++_0x1220c1);}(_0x1315,0xdd));var _0x5131=function(_0x2d414e,_0x4b72be){_0x2d414e=_0x2d414e-0x0;var _0x1471ab=_0x1315[_0x2d414e];return _0x1471ab;};'use strict';var _=require(_0x5131('0x0'));var util=require(_0x5131('0x1'));var logger=require(_0x5131('0x2'))(_0x5131('0x3'));var moment=require(_0x5131('0x4'));var BPromise=require(_0x5131('0x5'));var rp=require(_0x5131('0x6'));var fs=require('fs');var path=require(_0x5131('0x7'));var rimraf=require(_0x5131('0x8'));var config=require('../../config/environment');var attributes=require(_0x5131('0x9'));module[_0x5131('0xa')]=function(_0x539190,_0x1762f7){return _0x539190[_0x5131('0xb')](_0x5131('0xc'),attributes,{'tableName':_0x5131('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12ed7e,_0x3e8e13,_0x3cd291){if(_0x12ed7e[_0x5131('0xe')]('closed')){_0x12ed7e['closedAt']=moment()[_0x5131('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3cd291(null,_0x12ed7e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index eeafb3d..5ef4510 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 _0xc5b0=['socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','info','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x1b7af0,_0x237037){var _0x1d9939=function(_0x4b451e){while(--_0x4b451e){_0x1b7af0['push'](_0x1b7af0['shift']());}};_0x1d9939(++_0x237037);}(_0xc5b0,0x93));var _0x0c5b=function(_0x18ce3d,_0x19c7c8){_0x18ce3d=_0x18ce3d-0x0;var _0x279b17=_0xc5b0[_0x18ce3d];return _0x279b17;};'use strict';var _=require(_0x0c5b('0x0'));var util=require(_0x0c5b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c5b('0x2'));var fs=require('fs');var Redis=require(_0x0c5b('0x3'));var db=require(_0x0c5b('0x4'))['db'];var utils=require(_0x0c5b('0x5'));var logger=require('../../config/logger')(_0x0c5b('0x6'));var config=require(_0x0c5b('0x7'));var jayson=require(_0x0c5b('0x8'));var client=jayson['client'][_0x0c5b('0x9')]({'port':0x232a});config[_0x0c5b('0xa')]=_[_0x0c5b('0xb')](config[_0x0c5b('0xa')],{'host':_0x0c5b('0xc'),'port':0x18eb});var socket=require(_0x0c5b('0xd'))(new Redis(config[_0x0c5b('0xa')]));require('./faxInteraction.socket')[_0x0c5b('0xe')](socket);function respondWithRpcPromise(_0x2d36cf,_0x5a8793,_0x56a90b){return new BPromise(function(_0x32a5c2,_0x216388){return client[_0x0c5b('0xf')](_0x2d36cf,_0x56a90b)[_0x0c5b('0x10')](function(_0x38bb29){logger['info'](_0x0c5b('0x11'),_0x5a8793,_0x0c5b('0x12'));logger[_0x0c5b('0x13')](_0x0c5b('0x14'),_0x5a8793,_0x0c5b('0x12'),JSON[_0x0c5b('0x15')](_0x38bb29));if(_0x38bb29['error']){if(_0x38bb29[_0x0c5b('0x16')]['code']===0x1f4){logger[_0x0c5b('0x16')](_0x0c5b('0x11'),_0x5a8793,_0x38bb29[_0x0c5b('0x16')][_0x0c5b('0x17')]);return _0x216388(_0x38bb29[_0x0c5b('0x16')]['message']);}logger[_0x0c5b('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x5a8793,_0x38bb29['error'][_0x0c5b('0x17')]);return _0x32a5c2(_0x38bb29[_0x0c5b('0x16')][_0x0c5b('0x17')]);}else{logger['info'](_0x0c5b('0x11'),_0x5a8793,_0x0c5b('0x12'));_0x32a5c2(_0x38bb29[_0x0c5b('0x18')][_0x0c5b('0x17')]);}})['catch'](function(_0x197fd2){logger['error'](_0x0c5b('0x11'),_0x5a8793,_0x197fd2);_0x216388(_0x197fd2);});});}exports[_0x0c5b('0x19')]=function(_0x59116b){var _0x11a594=this;return new Promise(function(_0x428ed9,_0x224e8f){return db[_0x0c5b('0x1a')][_0x0c5b('0x1b')](_0x59116b[_0x0c5b('0x1c')],{'raw':_0x59116b[_0x0c5b('0x1d')]?_0x59116b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59116b[_0x0c5b('0x1d')]?_0x59116b['options'][_0x0c5b('0x1e')]||null:null,'attributes':_0x59116b['options']?_0x59116b['options'][_0x0c5b('0x1f')]||null:null,'limit':_0x59116b['options']?_0x59116b['options'][_0x0c5b('0x20')]||null:null})[_0x0c5b('0x10')](function(_0x4c6ae1){logger[_0x0c5b('0x21')](_0x0c5b('0x19'),_0x59116b);logger[_0x0c5b('0x13')](_0x0c5b('0x19'),_0x59116b,JSON['stringify'](_0x4c6ae1));_0x428ed9(_0x4c6ae1);})['catch'](function(_0x1192cd){logger[_0x0c5b('0x16')]('UpdateFaxInteraction',_0x1192cd['message'],_0x59116b);_0x224e8f(_0x11a594[_0x0c5b('0x16')](0x1f4,_0x1192cd[_0x0c5b('0x17')]));});});};exports[_0x0c5b('0x22')]=function(_0x4c27d4){return new Promise(function(_0x4b6fc7,_0x4ae1cc){return db[_0x0c5b('0x1a')]['find']({'where':_0x4c27d4[_0x0c5b('0x1d')]?_0x4c27d4[_0x0c5b('0x1d')][_0x0c5b('0x1e')]||null:null})[_0x0c5b('0x10')](function(_0x108bdd){if(_0x108bdd){return _0x108bdd[_0x0c5b('0x23')](_0x4c27d4['body'][_0x0c5b('0x24')],_[_0x0c5b('0x25')](_0x4c27d4[_0x0c5b('0x1c')],[_0x0c5b('0x24'),'id'])||{});}})[_0x0c5b('0x26')](function(_0x57b5e8){logger['info'](_0x0c5b('0x27'),_0x4c27d4);logger[_0x0c5b('0x13')](_0x0c5b('0x27'),_0x4c27d4,JSON['stringify'](_0x57b5e8));_0x4b6fc7(_0x57b5e8);})['catch'](function(_0x4318f4){logger[_0x0c5b('0x16')](_0x0c5b('0x27'),_0x4318f4[_0x0c5b('0x17')],_0x4c27d4);_0x4ae1cc(_this['error'](0x1f4,_0x4318f4['message']));});});}; \ No newline at end of file +var _0x1502=['../../config/environment','redis','defaults','localhost','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','catch','AddTagsToFaxInteraction','find','where','addTags','ids','omit','spread','AddTags','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2dabcd,_0x20abef){var _0x29c7ab=function(_0xbbe3ce){while(--_0xbbe3ce){_0x2dabcd['push'](_0x2dabcd['shift']());}};_0x29c7ab(++_0x20abef);}(_0x1502,0x116));var _0x2150=function(_0x13cb18,_0x5ee529){_0x13cb18=_0x13cb18-0x0;var _0x24c219=_0x1502[_0x13cb18];return _0x24c219;};'use strict';var _=require(_0x2150('0x0'));var util=require('util');var moment=require(_0x2150('0x1'));var BPromise=require(_0x2150('0x2'));var rs=require(_0x2150('0x3'));var fs=require('fs');var Redis=require(_0x2150('0x4'));var db=require(_0x2150('0x5'))['db'];var utils=require(_0x2150('0x6'));var logger=require(_0x2150('0x7'))(_0x2150('0x8'));var config=require(_0x2150('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2150('0xa')]=_[_0x2150('0xb')](config[_0x2150('0xa')],{'host':_0x2150('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2150('0xa')]));require(_0x2150('0xd'))[_0x2150('0xe')](socket);function respondWithRpcPromise(_0x112f96,_0x1fb10b,_0x34daa4){return new BPromise(function(_0x14a552,_0x447a5c){return client['request'](_0x112f96,_0x34daa4)[_0x2150('0xf')](function(_0x157c23){logger['info'](_0x2150('0x10'),_0x1fb10b,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x1fb10b,'request\x20sent',JSON[_0x2150('0x11')](_0x157c23));if(_0x157c23['error']){if(_0x157c23[_0x2150('0x12')][_0x2150('0x13')]===0x1f4){logger[_0x2150('0x12')](_0x2150('0x10'),_0x1fb10b,_0x157c23['error']['message']);return _0x447a5c(_0x157c23[_0x2150('0x12')][_0x2150('0x14')]);}logger[_0x2150('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x1fb10b,_0x157c23['error'][_0x2150('0x14')]);return _0x14a552(_0x157c23[_0x2150('0x12')][_0x2150('0x14')]);}else{logger[_0x2150('0x15')](_0x2150('0x10'),_0x1fb10b,_0x2150('0x16'));_0x14a552(_0x157c23[_0x2150('0x17')]['message']);}})['catch'](function(_0x32a2e0){logger[_0x2150('0x12')](_0x2150('0x10'),_0x1fb10b,_0x32a2e0);_0x447a5c(_0x32a2e0);});});}exports[_0x2150('0x18')]=function(_0x581597){var _0x4e5d5a=this;return new Promise(function(_0x4ac014,_0x2fab59){return db[_0x2150('0x19')][_0x2150('0x1a')](_0x581597[_0x2150('0x1b')],{'raw':_0x581597[_0x2150('0x1c')]?_0x581597['options'][_0x2150('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581597[_0x2150('0x1c')]?_0x581597['options']['where']||null:null,'attributes':_0x581597[_0x2150('0x1c')]?_0x581597[_0x2150('0x1c')]['attributes']||null:null,'limit':_0x581597[_0x2150('0x1c')]?_0x581597[_0x2150('0x1c')][_0x2150('0x1e')]||null:null})[_0x2150('0xf')](function(_0x4edf2c){logger[_0x2150('0x15')](_0x2150('0x18'),_0x581597);logger['debug'](_0x2150('0x18'),_0x581597,JSON['stringify'](_0x4edf2c));_0x4ac014(_0x4edf2c);})[_0x2150('0x1f')](function(_0x416210){logger[_0x2150('0x12')](_0x2150('0x18'),_0x416210[_0x2150('0x14')],_0x581597);_0x2fab59(_0x4e5d5a['error'](0x1f4,_0x416210[_0x2150('0x14')]));});});};exports[_0x2150('0x20')]=function(_0x87904e){return new Promise(function(_0x5178d0,_0x5aab25){return db[_0x2150('0x19')][_0x2150('0x21')]({'where':_0x87904e[_0x2150('0x1c')]?_0x87904e[_0x2150('0x1c')][_0x2150('0x22')]||null:null})[_0x2150('0xf')](function(_0x403221){if(_0x403221){return _0x403221[_0x2150('0x23')](_0x87904e[_0x2150('0x1b')][_0x2150('0x24')],_[_0x2150('0x25')](_0x87904e[_0x2150('0x1b')],['ids','id'])||{});}})[_0x2150('0x26')](function(_0x5937af){logger[_0x2150('0x15')](_0x2150('0x27'),_0x87904e);logger[_0x2150('0x28')]('AddTags',_0x87904e,JSON['stringify'](_0x5937af));_0x5178d0(_0x5937af);})[_0x2150('0x1f')](function(_0x2e2718){logger['error'](_0x2150('0x27'),_0x2e2718[_0x2150('0x14')],_0x87904e);_0x5aab25(_this[_0x2150('0x12')](0x1f4,_0x2e2718['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 3bc8157..fee6073 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 _0xf1dc=['emit','removeListener','length','faxInteraction:','remove','update'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xf1dc,0x1f0));var _0xcf1d=function(_0x1dda82,_0x21b1cf){_0x1dda82=_0x1dda82-0x0;var _0x470b22=_0xf1dc[_0x1dda82];return _0x470b22;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0xcf1d('0x0'),_0xcf1d('0x1')];function createListener(_0x2c8bdd,_0x1fbdf9){return function(_0x58b510){_0x1fbdf9[_0xcf1d('0x2')](_0x2c8bdd,_0x58b510);};}function removeListener(_0x3e5547,_0x3d1362){return function(){FaxInteractionEvents[_0xcf1d('0x3')](_0x3e5547,_0x3d1362);};}exports['register']=function(_0x55b04e){for(var _0x4b6d53=0x0,_0x44709d=events[_0xcf1d('0x4')];_0x4b6d53<_0x44709d;_0x4b6d53++){var _0x575bb7=events[_0x4b6d53];var _0x43ee5d=createListener(_0xcf1d('0x5')+_0x575bb7,_0x55b04e);FaxInteractionEvents['on'](_0x575bb7,_0x43ee5d);}}; \ No newline at end of file +var _0x0555=['faxInteraction:','save','remove','update','removeListener','register'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x0555,0x1e1));var _0x5055=function(_0x145ab6,_0x489f01){_0x145ab6=_0x145ab6-0x0;var _0x1ae999=_0x0555[_0x145ab6];return _0x1ae999;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x5055('0x0'),_0x5055('0x1'),_0x5055('0x2')];function createListener(_0x250e15,_0x306562){return function(_0x347812){_0x306562['emit'](_0x250e15,_0x347812);};}function removeListener(_0x4a4ba1,_0x59df1d){return function(){FaxInteractionEvents[_0x5055('0x3')](_0x4a4ba1,_0x59df1d);};}exports[_0x5055('0x4')]=function(_0x24641a){for(var _0x5c1271=0x0,_0x21351c=events['length'];_0x5c1271<_0x21351c;_0x5c1271++){var _0x54807e=events[_0x5c1271];var _0x7ecfa9=createListener(_0x5055('0x5')+_0x54807e,_0x24641a);FaxInteractionEvents['on'](_0x54807e,_0x7ecfa9);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9b0d7d0..3be11a4 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 _0x4d4b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','express','Router'];(function(_0x5c0929,_0x5905e8){var _0x125094=function(_0x32ec47){while(--_0x32ec47){_0x5c0929['push'](_0x5c0929['shift']());}};_0x125094(++_0x5905e8);}(_0x4d4b,0x1a8));var _0xb4d4=function(_0x2b0649,_0x574cb3){_0x2b0649=_0x2b0649-0x0;var _0x32512c=_0x4d4b[_0x2b0649];return _0x32512c;};'use strict';var multer=require(_0xb4d4('0x0'));var util=require(_0xb4d4('0x1'));var path=require(_0xb4d4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4d4('0x3'));var router=express[_0xb4d4('0x4')]();var fs_extra=require(_0xb4d4('0x5'));var auth=require(_0xb4d4('0x6'));var interaction=require(_0xb4d4('0x7'));var config=require(_0xb4d4('0x8'));var controller=require(_0xb4d4('0x9'));router['get']('/',auth[_0xb4d4('0xa')](),controller[_0xb4d4('0xb')]);router[_0xb4d4('0xc')](_0xb4d4('0xd'),auth['isAuthenticated'](),controller[_0xb4d4('0xe')]);router[_0xb4d4('0xc')](_0xb4d4('0xf'),auth['isAuthenticated'](),controller[_0xb4d4('0x10')]);router['get'](_0xb4d4('0x11'),auth['isAuthenticated'](),controller[_0xb4d4('0x12')]);router[_0xb4d4('0xc')](_0xb4d4('0x13'),auth[_0xb4d4('0xa')](),controller[_0xb4d4('0x14')]);router['post']('/',auth[_0xb4d4('0xa')](),controller['create']);router[_0xb4d4('0x15')]('/:id/messages',auth[_0xb4d4('0xa')](),controller['addMessage']);router['post'](_0xb4d4('0x16'),auth[_0xb4d4('0xa')](),interaction[_0xb4d4('0x17')](_0xb4d4('0x18'),_0xb4d4('0x19')),controller['addTags']);router[_0xb4d4('0x1a')](_0xb4d4('0xf'),auth[_0xb4d4('0xa')](),interaction[_0xb4d4('0x17')](_0xb4d4('0x18'),_0xb4d4('0x1b')),controller[_0xb4d4('0x1c')]);router[_0xb4d4('0x1d')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xb4d4('0x18'),_0xb4d4('0x1e')),controller[_0xb4d4('0x1f')]);router['delete'](_0xb4d4('0x16'),auth[_0xb4d4('0xa')](),controller['removeTags']);module[_0xb4d4('0x20')]=router; \ No newline at end of file +var _0x91f4=['/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','delete','destroy','removeTags','util','Router','../../components/auth/service','get','index','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage'];(function(_0x27bba,_0x3269eb){var _0x156dc0=function(_0x447df4){while(--_0x447df4){_0x27bba['push'](_0x27bba['shift']());}};_0x156dc0(++_0x3269eb);}(_0x91f4,0xc9));var _0x491f=function(_0x3d3c41,_0x146ab5){_0x3d3c41=_0x3d3c41-0x0;var _0x8dcb3b=_0x91f4[_0x3d3c41];return _0x8dcb3b;};'use strict';var multer=require('multer');var util=require(_0x491f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x491f('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x491f('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x491f('0x3')]('/',auth['isAuthenticated'](),controller[_0x491f('0x4')]);router[_0x491f('0x3')]('/describe',auth[_0x491f('0x5')](),controller[_0x491f('0x6')]);router[_0x491f('0x3')](_0x491f('0x7'),auth['isAuthenticated'](),controller[_0x491f('0x8')]);router[_0x491f('0x3')](_0x491f('0x9'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x491f('0xa'),auth[_0x491f('0x5')](),controller[_0x491f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x491f('0xc')]);router[_0x491f('0xd')]('/:id/messages',auth[_0x491f('0x5')](),controller[_0x491f('0xe')]);router['post'](_0x491f('0xf'),auth[_0x491f('0x5')](),interaction[_0x491f('0x10')](_0x491f('0x11'),_0x491f('0x12')),controller['addTags']);router[_0x491f('0x13')]('/:id',auth[_0x491f('0x5')](),interaction[_0x491f('0x10')](_0x491f('0x11'),_0x491f('0x14')),controller['update']);router[_0x491f('0x15')](_0x491f('0x7'),auth[_0x491f('0x5')](),interaction['tracked'](_0x491f('0x11'),'faxinteraction:destroy'),controller[_0x491f('0x16')]);router[_0x491f('0x15')](_0x491f('0xf'),auth[_0x491f('0x5')](),controller[_0x491f('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 9b12b3d..358be00 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 _0x8c25=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4231a4,_0x16ecb6){var _0x35791d=function(_0x78db82){while(--_0x78db82){_0x4231a4['push'](_0x4231a4['shift']());}};_0x35791d(++_0x16ecb6);}(_0x8c25,0x15e));var _0x58c2=function(_0x5046a8,_0x41d8fd){_0x5046a8=_0x5046a8-0x0;var _0x420612=_0x8c25[_0x5046a8];return _0x420612;};'use strict';var Sequelize=require(_0x58c2('0x0'));module[_0x58c2('0x1')]={'body':{'type':Sequelize[_0x58c2('0x2')](_0x58c2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x58c2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x58c2('0x5')]('in','out'),'defaultValue':_0x58c2('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x55ca=['sequelize','exports','ENUM','out','TEXT','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x57b38f,_0xc26f33){_0x57b38f=_0x57b38f-0x0;var _0x6aa12c=_0x55ca[_0x57b38f];return _0x6aa12c;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa55c('0x2')]('in',_0xa55c('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xa55c('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa55c('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8224e63..abd6f92 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 _0x2ff0=['SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','email','rejectmessage','create','CmContact','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','server','files','Attachment','basename','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./faxMessage.socket','register','jayson/promise','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','findAll','catch','show','keys','rawAttributes','length','find','body','params','describe','fax-interactions','accept','read','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x110d48,_0x101cfd){var _0x452882=function(_0x2dc7d3){while(--_0x2dc7d3){_0x110d48['push'](_0x110d48['shift']());}};_0x452882(++_0x101cfd);}(_0x2ff0,0xae));var _0x02ff=function(_0x14fe11,_0x3215a6){_0x14fe11=_0x14fe11-0x0;var _0x341819=_0x2ff0[_0x14fe11];return _0x341819;};'use strict';var emlformat=require(_0x02ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02ff('0x1'));var jsonpatch=require(_0x02ff('0x2'));var rp=require(_0x02ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02ff('0x4'));var path=require('path');var sox=require(_0x02ff('0x5'));var csv=require(_0x02ff('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02ff('0x7'));var squel=require('squel');var crypto=require(_0x02ff('0x8'));var jsforce=require(_0x02ff('0x9'));var deskjs=require(_0x02ff('0xa'));var toCsv=require(_0x02ff('0x6'));var querystring=require(_0x02ff('0xb'));var Papa=require('papaparse');var Redis=require(_0x02ff('0xc'));var authService=require(_0x02ff('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x02ff('0xe'));var hardwareService=require(_0x02ff('0xf'));var logger=require(_0x02ff('0x10'))(_0x02ff('0x11'));var utils=require('../../config/utils');var config=require(_0x02ff('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x02ff('0x13'))['db'];config[_0x02ff('0x14')]=_[_0x02ff('0x15')](config[_0x02ff('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02ff('0x14')]));require(_0x02ff('0x16'))[_0x02ff('0x17')](socket);var jayson=require(_0x02ff('0x18'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x02ff('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x26caee,_0x487058,_0x3edc84,_0x41ea32){return new BPromise(function(_0x59b75e,_0x36eb93){var _0x4a2495=_0x41ea32||client;return _0x4a2495[_0x02ff('0x1a')](_0x26caee,_0x3edc84)['then'](function(_0x2a1aed){logger['info'](_0x02ff('0x1b'),_0x487058,_0x02ff('0x1c'));logger[_0x02ff('0x1d')](_0x02ff('0x1e'),_0x487058,_0x02ff('0x1c'),JSON[_0x02ff('0x1f')](_0x2a1aed));if(_0x2a1aed[_0x02ff('0x20')]){if(_0x2a1aed[_0x02ff('0x20')][_0x02ff('0x21')]===0x1f4){logger['error'](_0x02ff('0x1b'),_0x487058,_0x2a1aed['error'][_0x02ff('0x22')]);return _0x36eb93(_0x2a1aed[_0x02ff('0x20')][_0x02ff('0x22')]);}logger[_0x02ff('0x20')](_0x02ff('0x1b'),_0x487058,_0x2a1aed[_0x02ff('0x20')][_0x02ff('0x22')]);return _0x59b75e(_0x2a1aed[_0x02ff('0x20')][_0x02ff('0x22')]);}else{logger[_0x02ff('0x23')](_0x02ff('0x1b'),_0x487058,_0x02ff('0x1c'));_0x59b75e(_0x2a1aed['result'][_0x02ff('0x22')]);}})['catch'](function(_0x571078){logger[_0x02ff('0x20')]('FaxMessage,\x20%s,\x20%s',_0x487058,_0x571078);_0x36eb93(_0x571078);});});}function respondWithStatusCode(_0x362dba,_0x3d9257){_0x3d9257=_0x3d9257||0xcc;return function(_0x4ca64d){if(_0x4ca64d){return _0x362dba['sendStatus'](_0x3d9257);}return _0x362dba['status'](_0x3d9257)[_0x02ff('0x24')]();};}function respondWithResult(_0x55dd0a,_0x50f1f8){_0x50f1f8=_0x50f1f8||0xc8;return function(_0x2b0095){if(_0x2b0095){return _0x55dd0a[_0x02ff('0x25')](_0x50f1f8)['json'](_0x2b0095);}};}function respondWithFilteredResult(_0x248d85,_0x2ec959){return function(_0x45669e){if(_0x45669e){var _0xf8d87a=typeof _0x2ec959['offset']===_0x02ff('0x26')&&typeof _0x2ec959['limit']===_0x02ff('0x26');var _0x1fe941=_0x45669e[_0x02ff('0x27')];var _0x1a94d5=_0xf8d87a?0x0:_0x2ec959[_0x02ff('0x28')];var _0x306e45=_0xf8d87a?_0x45669e[_0x02ff('0x27')]:_0x2ec959[_0x02ff('0x28')]+_0x2ec959[_0x02ff('0x29')];var _0x6afffa;if(_0x306e45>=_0x1fe941){_0x306e45=_0x1fe941;_0x6afffa=0xc8;}else{_0x6afffa=0xce;}_0x248d85[_0x02ff('0x25')](_0x6afffa);return _0x248d85[_0x02ff('0x2a')](_0x02ff('0x2b'),_0x1a94d5+'-'+_0x306e45+'/'+_0x1fe941)[_0x02ff('0x2c')](_0x45669e);}return null;};}function patchUpdates(_0x26e5f1){return function(_0x51101d){try{jsonpatch[_0x02ff('0x2d')](_0x51101d,_0x26e5f1,!![]);}catch(_0x2e775c){return BPromise[_0x02ff('0x2e')](_0x2e775c);}return _0x51101d['save']();};}function saveUpdates(_0x4144bc,_0x2ba3d9){return function(_0x4f0390){if(_0x4f0390){return _0x4f0390[_0x02ff('0x2f')](_0x4144bc)[_0x02ff('0x30')](function(_0x3e36aa){return _0x3e36aa;});}return null;};}function removeEntity(_0x3496c8,_0x4f1d8b){return function(_0x3e5bc2){if(_0x3e5bc2){return _0x3e5bc2[_0x02ff('0x31')]()[_0x02ff('0x30')](function(){_0x3496c8[_0x02ff('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3385,_0x1cde77){return function(_0x38e5d2){if(!_0x38e5d2){_0x4b3385[_0x02ff('0x32')](0x194);}return _0x38e5d2;};}function handleError(_0x582af4,_0x3104bf){_0x3104bf=_0x3104bf||0x1f4;return function(_0x1051c4){logger[_0x02ff('0x20')](_0x1051c4[_0x02ff('0x33')]);if(_0x1051c4['name']){delete _0x1051c4[_0x02ff('0x34')];}_0x582af4['status'](_0x3104bf)[_0x02ff('0x35')](_0x1051c4);};}exports[_0x02ff('0x36')]=function(_0x29a416,_0x14fe9f){var _0x58ba3e={},_0x1256bb={},_0x23204e={'count':0x0,'rows':[]};var _0x293b43=_[_0x02ff('0x37')](db['FaxMessage']['rawAttributes'],function(_0x3280bf){return{'name':_0x3280bf[_0x02ff('0x38')],'type':_0x3280bf[_0x02ff('0x39')][_0x02ff('0x3a')]};});_0x1256bb[_0x02ff('0x3b')]=_[_0x02ff('0x37')](_0x293b43,'name');_0x1256bb['query']=_['keys'](_0x29a416[_0x02ff('0x3c')]);_0x1256bb['filters']=_[_0x02ff('0x3d')](_0x1256bb[_0x02ff('0x3b')],_0x1256bb[_0x02ff('0x3c')]);_0x58ba3e[_0x02ff('0x3e')]=_['intersection'](_0x1256bb['model'],qs[_0x02ff('0x3f')](_0x29a416['query']['fields']));_0x58ba3e[_0x02ff('0x3e')]=_0x58ba3e[_0x02ff('0x3e')]['length']?_0x58ba3e[_0x02ff('0x3e')]:_0x1256bb['model'];if(!_0x29a416[_0x02ff('0x3c')]['hasOwnProperty'](_0x02ff('0x40'))){_0x58ba3e[_0x02ff('0x29')]=qs['limit'](_0x29a416[_0x02ff('0x3c')]['limit']);_0x58ba3e[_0x02ff('0x28')]=qs[_0x02ff('0x28')](_0x29a416[_0x02ff('0x3c')][_0x02ff('0x28')]);}_0x58ba3e[_0x02ff('0x41')]=qs[_0x02ff('0x42')](_0x29a416[_0x02ff('0x3c')][_0x02ff('0x42')]);_0x58ba3e['where']=qs[_0x02ff('0x43')](_['pick'](_0x29a416[_0x02ff('0x3c')],_0x1256bb[_0x02ff('0x43')]),_0x293b43);if(_0x29a416[_0x02ff('0x3c')]['filter']){_0x58ba3e[_0x02ff('0x44')]=_[_0x02ff('0x45')](_0x58ba3e[_0x02ff('0x44')],{'$or':_[_0x02ff('0x37')](_0x293b43,function(_0x3f2a62){if(_0x3f2a62[_0x02ff('0x39')]!==_0x02ff('0x46')){var _0x5a77a6={};_0x5a77a6[_0x3f2a62[_0x02ff('0x34')]]={'$like':'%'+_0x29a416['query'][_0x02ff('0x47')]+'%'};return _0x5a77a6;}})});}_0x58ba3e=_['merge']({},_0x58ba3e,_0x29a416[_0x02ff('0x48')]);var _0x550157={'where':_0x58ba3e[_0x02ff('0x44')]};return db[_0x02ff('0x49')][_0x02ff('0x27')](_0x550157)[_0x02ff('0x30')](function(_0x5b2246){_0x23204e[_0x02ff('0x27')]=_0x5b2246;if(_0x29a416['query'][_0x02ff('0x4a')]){_0x58ba3e[_0x02ff('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x02ff('0x4c')](_0x58ba3e);})['then'](function(_0xb437c2){_0x23204e['rows']=_0xb437c2;return _0x23204e;})[_0x02ff('0x30')](respondWithFilteredResult(_0x14fe9f,_0x58ba3e))[_0x02ff('0x4d')](handleError(_0x14fe9f,null));};exports[_0x02ff('0x4e')]=function(_0x3c1c75,_0x20fe4d){var _0x3d0dd8={'raw':!![],'where':{'id':_0x3c1c75['params']['id']}},_0x298b3b={};_0x298b3b[_0x02ff('0x3b')]=_[_0x02ff('0x4f')](db[_0x02ff('0x49')][_0x02ff('0x50')]);_0x298b3b[_0x02ff('0x3c')]=_[_0x02ff('0x4f')](_0x3c1c75[_0x02ff('0x3c')]);_0x298b3b['filters']=_[_0x02ff('0x3d')](_0x298b3b['model'],_0x298b3b[_0x02ff('0x3c')]);_0x3d0dd8[_0x02ff('0x3e')]=_[_0x02ff('0x3d')](_0x298b3b[_0x02ff('0x3b')],qs[_0x02ff('0x3f')](_0x3c1c75[_0x02ff('0x3c')][_0x02ff('0x3f')]));_0x3d0dd8[_0x02ff('0x3e')]=_0x3d0dd8[_0x02ff('0x3e')][_0x02ff('0x51')]?_0x3d0dd8[_0x02ff('0x3e')]:_0x298b3b[_0x02ff('0x3b')];if(_0x3c1c75[_0x02ff('0x3c')]['includeAll']){_0x3d0dd8[_0x02ff('0x4b')]=[{'all':!![]}];}_0x3d0dd8=_[_0x02ff('0x45')]({},_0x3d0dd8,_0x3c1c75[_0x02ff('0x48')]);return db['FaxMessage'][_0x02ff('0x52')](_0x3d0dd8)['then'](handleEntityNotFound(_0x20fe4d,null))[_0x02ff('0x30')](respondWithResult(_0x20fe4d,null))[_0x02ff('0x4d')](handleError(_0x20fe4d,null));};exports[_0x02ff('0x2f')]=function(_0x43196c,_0x297161){if(_0x43196c[_0x02ff('0x53')]['id']){delete _0x43196c[_0x02ff('0x53')]['id'];}return db[_0x02ff('0x49')][_0x02ff('0x52')]({'where':{'id':_0x43196c[_0x02ff('0x54')]['id']}})[_0x02ff('0x30')](handleEntityNotFound(_0x297161,null))[_0x02ff('0x30')](saveUpdates(_0x43196c[_0x02ff('0x53')],null))['then'](respondWithResult(_0x297161,null))['catch'](handleError(_0x297161,null));};exports[_0x02ff('0x31')]=function(_0x1551ff,_0x10d789){return db[_0x02ff('0x49')][_0x02ff('0x52')]({'where':{'id':_0x1551ff['params']['id']}})['then'](handleEntityNotFound(_0x10d789,null))['then'](removeEntity(_0x10d789,null))['catch'](handleError(_0x10d789,null));};exports[_0x02ff('0x55')]=function(_0x5478af,_0x4b02b1){return db['FaxMessage'][_0x02ff('0x55')]()[_0x02ff('0x30')](respondWithResult(_0x4b02b1,null))[_0x02ff('0x4d')](handleError(_0x4b02b1,null));};var interaction_log=require(_0x02ff('0x10'))(_0x02ff('0x56'));exports[_0x02ff('0x57')]=function(_0x4aaaa7,_0x2f7754,_0x3bf199){var _0x31254b={'agent':{},'channel':'fax'};if(_0x4aaaa7[_0x02ff('0x53')]['id']){delete _0x4aaaa7[_0x02ff('0x53')]['id'];}_0x4aaaa7['body'][_0x02ff('0x58')]=!![];_0x4aaaa7[_0x02ff('0x53')][_0x02ff('0x59')]=moment()[_0x02ff('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4aaaa7[_0x02ff('0x53')][_0x02ff('0x5b')]=_0x4aaaa7[_0x02ff('0x53')]['UserId']||_0x4aaaa7[_0x02ff('0x5c')]['id'];_0x31254b[_0x02ff('0x5d')]['id']=_0x4aaaa7[_0x02ff('0x53')][_0x02ff('0x5b')];return db[_0x02ff('0x49')][_0x02ff('0x52')]({'where':{'id':_0x4aaaa7['params']['id'],'UserId':null}})[_0x02ff('0x30')](handleEntityNotFound(_0x2f7754,null))[_0x02ff('0x30')](saveUpdates(_0x4aaaa7[_0x02ff('0x53')],null))[_0x02ff('0x30')](function(_0x4640d8){if(_0x4640d8){_0x31254b[_0x02ff('0x22')]=_0x4640d8[_0x02ff('0x5e')]({'plain':!![]});return db[_0x02ff('0x5f')]['find']({'where':{'id':_0x4640d8[_0x02ff('0x60')]}});}return null;})[_0x02ff('0x30')](handleEntityNotFound(_0x2f7754,null))[_0x02ff('0x30')](function(_0x24dbca){if(_0x24dbca){return _0x24dbca[_0x02ff('0x2f')]({'UserId':_0x4aaaa7[_0x02ff('0x53')][_0x02ff('0x5b')],'read1stAt':_[_0x02ff('0x61')](_0x24dbca[_0x02ff('0x62')])?moment()[_0x02ff('0x5a')](_0x02ff('0x63')):undefined});}return null;})[_0x02ff('0x30')](function(_0x35f7bc){if(_0x35f7bc){_0x31254b[_0x02ff('0x64')]=_0x35f7bc[_0x02ff('0x5e')]({'plain':!![]});interaction_log[_0x02ff('0x23')](_0x02ff('0x65'),_0x4aaaa7[_0x02ff('0x5c')]['id'],_0x4aaaa7[_0x02ff('0x5c')]['name'],_0x4aaaa7[_0x02ff('0x5c')][_0x02ff('0x66')],_0x31254b['interaction']['id'],_0x4aaaa7[_0x02ff('0x53')]?JSON[_0x02ff('0x1f')](_0x4aaaa7[_0x02ff('0x53')]):'null');return respondWithRpcPromise(_0x02ff('0x67'),_0x02ff('0x68'),_0x31254b);}return null;})['then'](function(_0x22243c){var _0x5bc454=_0x02ff('0x69')+_0x22243c[_0x02ff('0x22')][_0x02ff('0x6a')];return db[_0x02ff('0x6b')][_0x02ff('0x3c')](_0x5bc454,{'type':db[_0x02ff('0x6c')][_0x02ff('0x6d')][_0x02ff('0x6e')],'raw':!![]})[_0x02ff('0x30')](function(_0x74ce1a){return _0x74ce1a;});})[_0x02ff('0x30')](function(_0x1f2e3d){if(_0x1f2e3d){_0x31254b[_0x02ff('0x22')][_0x02ff('0x6f')]=_0x1f2e3d[0x0];if(!_0x4aaaa7[_0x02ff('0x53')]['UserId'])return;return db[_0x02ff('0x70')][_0x02ff('0x52')]({'where':{'id':_0x4aaaa7[_0x02ff('0x53')][_0x02ff('0x5b')],'role':'agent'},'attributes':['id',_0x02ff('0x34'),_0x02ff('0x71'),'email',_0x02ff('0x72')],'raw':!![]});}return null;})['then'](function(_0xfc0e20){if(!_0xfc0e20)return null;_0x31254b[_0x02ff('0x22')][_0x02ff('0x5d')]=_0xfc0e20;return _0x31254b;})['then'](function(_0x6fe4ad){if(_0x6fe4ad){if(_0x4aaaa7[_0x02ff('0x53')][_0x02ff('0x73')]){_0x31254b['message'][_0x02ff('0x74')]=util[_0x02ff('0x5a')](_0x02ff('0x75'),_0x4aaaa7[_0x02ff('0x5c')]['name']);_0x31254b[_0x02ff('0x22')][_0x02ff('0x76')]=_0x31254b[_0x02ff('0x76')];_0x31254b['message'][_0x02ff('0x77')]=_0x31254b[_0x02ff('0x76')];_0x31254b[_0x02ff('0x22')][_0x02ff('0x78')]='accept';return respondWithRpcPromise(_0x02ff('0x79'),'EventManager',{'event':'acceptmessage','message':_0x31254b['message']},client9002)[_0x02ff('0x30')](function(){return _0x31254b;});}return _0x31254b;}return null;})[_0x02ff('0x30')](respondWithResult(_0x2f7754,null))['catch'](handleError(_0x2f7754,null));};var interaction_log=require(_0x02ff('0x10'))(_0x02ff('0x56'));exports['reject']=function(_0x9dcd,_0x5090f9,_0x10ccfa){var _0x60f051={'agent':{},'channel':_0x02ff('0x7a')};if(_0x9dcd['body']['id']){delete _0x9dcd[_0x02ff('0x53')]['id'];}_0x9dcd['body']['UserId']=_0x9dcd[_0x02ff('0x53')]['UserId']||_0x9dcd[_0x02ff('0x5c')]['id'];_0x60f051[_0x02ff('0x5d')]['id']=_0x9dcd['body'][_0x02ff('0x5b')];return db[_0x02ff('0x49')][_0x02ff('0x52')]({'where':{'id':_0x9dcd['params']['id'],'UserId':null}})[_0x02ff('0x30')](handleEntityNotFound(_0x5090f9,null))[_0x02ff('0x30')](function(_0x3808d5){if(_0x3808d5){_0x60f051[_0x02ff('0x22')]=_0x3808d5['get']({'plain':!![]});return db[_0x02ff('0x5f')][_0x02ff('0x52')]({'where':{'id':_0x3808d5[_0x02ff('0x60')]}});}return null;})[_0x02ff('0x30')](handleEntityNotFound(_0x5090f9,null))[_0x02ff('0x30')](function(_0x17cddb){if(_0x17cddb){_0x60f051[_0x02ff('0x64')]=_0x17cddb[_0x02ff('0x5e')]({'plain':!![]});interaction_log['info'](_0x02ff('0x7b'),_0x9dcd['user']['id'],_0x9dcd[_0x02ff('0x5c')][_0x02ff('0x34')],_0x9dcd[_0x02ff('0x5c')][_0x02ff('0x66')],_0x60f051['interaction']['id'],_0x9dcd[_0x02ff('0x53')]?JSON['stringify'](_0x9dcd['body']):_0x02ff('0x7c'));return respondWithRpcPromise(_0x02ff('0x7d'),'rejectMessage',_0x60f051);}return null;})[_0x02ff('0x30')](function(_0x51e4f3){var _0x4227ce=_0x02ff('0x69')+_0x51e4f3[_0x02ff('0x22')][_0x02ff('0x6a')];return db[_0x02ff('0x6b')][_0x02ff('0x3c')](_0x4227ce,{'type':db[_0x02ff('0x6c')][_0x02ff('0x6d')][_0x02ff('0x6e')],'raw':!![]})['then'](function(_0x5b8554){return _0x5b8554;});})[_0x02ff('0x30')](function(_0x16ce71){if(_0x16ce71){_0x60f051[_0x02ff('0x22')][_0x02ff('0x6f')]=_0x16ce71[0x0];if(!_0x9dcd[_0x02ff('0x53')][_0x02ff('0x5b')])return;return db['User']['find']({'where':{'id':_0x9dcd['body'][_0x02ff('0x5b')],'role':'agent'},'attributes':['id',_0x02ff('0x34'),_0x02ff('0x71'),_0x02ff('0x7e'),_0x02ff('0x72')],'raw':!![]});}return null;})[_0x02ff('0x30')](function(_0x49f8d3){if(!_0x49f8d3)return null;_0x60f051[_0x02ff('0x22')][_0x02ff('0x5d')]=_0x49f8d3;return _0x60f051;})[_0x02ff('0x30')](function(_0x57533e){if(_0x57533e){_0x57533e[_0x02ff('0x22')][_0x02ff('0x74')]=util[_0x02ff('0x5a')](_0x02ff('0x75'),_0x9dcd[_0x02ff('0x5c')][_0x02ff('0x34')]);_0x57533e[_0x02ff('0x22')]['channel']=_0x60f051[_0x02ff('0x76')];_0x57533e[_0x02ff('0x22')][_0x02ff('0x77')]=_0x60f051[_0x02ff('0x76')];_0x57533e[_0x02ff('0x22')]['event']='reject';respondWithRpcPromise(_0x02ff('0x79'),'EventManager',{'event':_0x02ff('0x7f'),'message':_0x57533e['message']},client9002);return _0x60f051;}return null;})[_0x02ff('0x30')](respondWithResult(_0x5090f9,null))[_0x02ff('0x4d')](handleError(_0x5090f9,null));};exports[_0x02ff('0x80')]=function(_0x1c77d5,_0x2e5f88){var _0x439c06;return db[_0x02ff('0x49')]['create'](_0x1c77d5['body'],{})[_0x02ff('0x30')](function(_0x37cb47){_0x439c06=_0x37cb47;return db[_0x02ff('0x81')]['findOne']({'where':{'id':_0x439c06['ContactId']}});})[_0x02ff('0x30')](function(_0x329579){if(_[_0x02ff('0x61')](_0x329579)){return;}else{_0x439c06['fax']=_0x329579[_0x02ff('0x7a')];return db['Attachment'][_0x02ff('0x82')]({'where':{'id':_0x439c06['AttachmentId']}});}})[_0x02ff('0x30')](function(_0x401ed3){return respondWithRpcPromise(_0x02ff('0x83'),_0x02ff('0x83'),{'FaxAccountId':_[_0x02ff('0x61')](_0x1c77d5[_0x02ff('0x53')])?undefined:_0x1c77d5[_0x02ff('0x53')][_0x02ff('0x84')],'path':_['isNil'](_0x401ed3)?undefined:util[_0x02ff('0x5a')](_0x02ff('0x85'),_0x401ed3['basename']),'fax':_[_0x02ff('0x61')](_0x439c06[_0x02ff('0x7a')])?undefined:_0x439c06[_0x02ff('0x7a')],'AttachmentId':_0x439c06[_0x02ff('0x86')]},client9002);})[_0x02ff('0x30')](respondWithResult(_0x2e5f88,0xc9))[_0x02ff('0x4d')](handleError(_0x2e5f88,null));};exports[_0x02ff('0x87')]=function(_0x33b0fc,_0x12b9b0){var _0x37be20=path[_0x02ff('0x88')](config[_0x02ff('0x89')],_0x02ff('0x8a'),_0x02ff('0x8b'),'attachments');return db[_0x02ff('0x49')][_0x02ff('0x52')]({'where':{'id':_0x33b0fc[_0x02ff('0x54')]['id']},'include':[{'model':db[_0x02ff('0x8c')],'as':_0x02ff('0x8c')}]})[_0x02ff('0x30')](handleEntityNotFound(_0x12b9b0,null))[_0x02ff('0x30')](function(_0x283214){if(_0x283214){return _0x12b9b0[_0x02ff('0x87')](path[_0x02ff('0x88')](_0x37be20,_0x283214[_0x02ff('0x8c')][_0x02ff('0x8d')]));}})['catch'](handleError(_0x12b9b0,null));}; \ No newline at end of file +var _0xc830=['format','UserId','user','get','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','email','interface','motionChannel','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','files','attachments','basename','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','destroy','then','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','include','findAll','params','includeAll','merge','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt'];(function(_0xb2c3ec,_0x4b19b1){var _0x2a4576=function(_0x1f8346){while(--_0x1f8346){_0xb2c3ec['push'](_0xb2c3ec['shift']());}};_0x2a4576(++_0x4b19b1);}(_0xc830,0x1ec));var _0x0c83=function(_0x410e5b,_0x352265){_0x410e5b=_0x410e5b-0x0;var _0x582867=_0xc830[_0x410e5b];return _0x582867;};'use strict';var emlformat=require(_0x0c83('0x0'));var rimraf=require(_0x0c83('0x1'));var zipdir=require(_0x0c83('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c83('0x3'));var moment=require('moment');var BPromise=require(_0x0c83('0x4'));var Mustache=require(_0x0c83('0x5'));var util=require(_0x0c83('0x6'));var path=require(_0x0c83('0x7'));var sox=require('sox');var csv=require(_0x0c83('0x8'));var ejs=require(_0x0c83('0x9'));var fs=require('fs');var fs_extra=require(_0x0c83('0xa'));var _=require(_0x0c83('0xb'));var squel=require(_0x0c83('0xc'));var crypto=require(_0x0c83('0xd'));var jsforce=require(_0x0c83('0xe'));var deskjs=require(_0x0c83('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0c83('0x10'));var Papa=require(_0x0c83('0x11'));var Redis=require('ioredis');var authService=require(_0x0c83('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0c83('0x13'));var hardwareService=require(_0x0c83('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0c83('0x15'));var config=require(_0x0c83('0x16'));var licenseUtil=require(_0x0c83('0x17'));var db=require('../../mysqldb')['db'];config[_0x0c83('0x18')]=_['defaults'](config[_0x0c83('0x18')],{'host':_0x0c83('0x19'),'port':0x18eb});var socket=require(_0x0c83('0x1a'))(new Redis(config['redis']));require(_0x0c83('0x1b'))[_0x0c83('0x1c')](socket);var jayson=require(_0x0c83('0x1d'));var client=jayson['client'][_0x0c83('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x0c83('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3468f7,_0x1df48d,_0x325013,_0x3f1394){return new BPromise(function(_0x2eaf86,_0x3556a4){var _0x391a5e=_0x3f1394||client;return _0x391a5e[_0x0c83('0x1f')](_0x3468f7,_0x325013)['then'](function(_0x6f2220){logger[_0x0c83('0x20')](_0x0c83('0x21'),_0x1df48d,_0x0c83('0x22'));logger[_0x0c83('0x23')](_0x0c83('0x24'),_0x1df48d,_0x0c83('0x22'),JSON[_0x0c83('0x25')](_0x6f2220));if(_0x6f2220[_0x0c83('0x26')]){if(_0x6f2220[_0x0c83('0x26')][_0x0c83('0x27')]===0x1f4){logger[_0x0c83('0x26')](_0x0c83('0x21'),_0x1df48d,_0x6f2220[_0x0c83('0x26')][_0x0c83('0x28')]);return _0x3556a4(_0x6f2220['error'][_0x0c83('0x28')]);}logger['error'](_0x0c83('0x21'),_0x1df48d,_0x6f2220[_0x0c83('0x26')][_0x0c83('0x28')]);return _0x2eaf86(_0x6f2220[_0x0c83('0x26')][_0x0c83('0x28')]);}else{logger['info'](_0x0c83('0x21'),_0x1df48d,_0x0c83('0x22'));_0x2eaf86(_0x6f2220[_0x0c83('0x29')][_0x0c83('0x28')]);}})[_0x0c83('0x2a')](function(_0x318496){logger[_0x0c83('0x26')]('FaxMessage,\x20%s,\x20%s',_0x1df48d,_0x318496);_0x3556a4(_0x318496);});});}function respondWithStatusCode(_0x31062b,_0x45f6e7){_0x45f6e7=_0x45f6e7||0xcc;return function(_0x179a62){if(_0x179a62){return _0x31062b[_0x0c83('0x2b')](_0x45f6e7);}return _0x31062b[_0x0c83('0x2c')](_0x45f6e7)[_0x0c83('0x2d')]();};}function respondWithResult(_0x3c18d2,_0x894e99){_0x894e99=_0x894e99||0xc8;return function(_0x5cbfbc){if(_0x5cbfbc){return _0x3c18d2[_0x0c83('0x2c')](_0x894e99)['json'](_0x5cbfbc);}};}function respondWithFilteredResult(_0x17a54f,_0x1324db){return function(_0x1ba04a){if(_0x1ba04a){var _0x572e4b=typeof _0x1324db[_0x0c83('0x2e')]===_0x0c83('0x2f')&&typeof _0x1324db[_0x0c83('0x30')]===_0x0c83('0x2f');var _0x5d4728=_0x1ba04a[_0x0c83('0x31')];var _0x3d964=_0x572e4b?0x0:_0x1324db[_0x0c83('0x2e')];var _0x13c869=_0x572e4b?_0x1ba04a[_0x0c83('0x31')]:_0x1324db[_0x0c83('0x2e')]+_0x1324db[_0x0c83('0x30')];var _0x3d3b58;if(_0x13c869>=_0x5d4728){_0x13c869=_0x5d4728;_0x3d3b58=0xc8;}else{_0x3d3b58=0xce;}_0x17a54f[_0x0c83('0x2c')](_0x3d3b58);return _0x17a54f['set']('Content-Range',_0x3d964+'-'+_0x13c869+'/'+_0x5d4728)[_0x0c83('0x32')](_0x1ba04a);}return null;};}function patchUpdates(_0x32b61e){return function(_0x4eff81){try{jsonpatch[_0x0c83('0x33')](_0x4eff81,_0x32b61e,!![]);}catch(_0x380bdb){return BPromise[_0x0c83('0x34')](_0x380bdb);}return _0x4eff81['save']();};}function saveUpdates(_0x18522c,_0x14947e){return function(_0x5a8940){if(_0x5a8940){return _0x5a8940[_0x0c83('0x35')](_0x18522c)['then'](function(_0x128f25){return _0x128f25;});}return null;};}function removeEntity(_0x317587,_0x2d2d04){return function(_0x4340ad){if(_0x4340ad){return _0x4340ad[_0x0c83('0x36')]()[_0x0c83('0x37')](function(){_0x317587[_0x0c83('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac938,_0x42bca8){return function(_0x4248d0){if(!_0x4248d0){_0x1ac938[_0x0c83('0x2b')](0x194);}return _0x4248d0;};}function handleError(_0x697730,_0x57cd5f){_0x57cd5f=_0x57cd5f||0x1f4;return function(_0x409edc){logger[_0x0c83('0x26')](_0x409edc[_0x0c83('0x38')]);if(_0x409edc[_0x0c83('0x39')]){delete _0x409edc[_0x0c83('0x39')];}_0x697730['status'](_0x57cd5f)[_0x0c83('0x3a')](_0x409edc);};}exports[_0x0c83('0x3b')]=function(_0x4e26d1,_0x1bea79){var _0xb41686={},_0x22c58e={},_0x2d7684={'count':0x0,'rows':[]};var _0x4a9082=_[_0x0c83('0x3c')](db[_0x0c83('0x3d')][_0x0c83('0x3e')],function(_0x59ea4b){return{'name':_0x59ea4b[_0x0c83('0x3f')],'type':_0x59ea4b['type'][_0x0c83('0x40')]};});_0x22c58e['model']=_['map'](_0x4a9082,_0x0c83('0x39'));_0x22c58e['query']=_[_0x0c83('0x41')](_0x4e26d1['query']);_0x22c58e[_0x0c83('0x42')]=_[_0x0c83('0x43')](_0x22c58e[_0x0c83('0x44')],_0x22c58e[_0x0c83('0x45')]);_0xb41686[_0x0c83('0x46')]=_['intersection'](_0x22c58e[_0x0c83('0x44')],qs[_0x0c83('0x47')](_0x4e26d1[_0x0c83('0x45')]['fields']));_0xb41686[_0x0c83('0x46')]=_0xb41686[_0x0c83('0x46')][_0x0c83('0x48')]?_0xb41686[_0x0c83('0x46')]:_0x22c58e['model'];if(!_0x4e26d1['query'][_0x0c83('0x49')](_0x0c83('0x4a'))){_0xb41686[_0x0c83('0x30')]=qs[_0x0c83('0x30')](_0x4e26d1[_0x0c83('0x45')]['limit']);_0xb41686['offset']=qs[_0x0c83('0x2e')](_0x4e26d1[_0x0c83('0x45')][_0x0c83('0x2e')]);}_0xb41686[_0x0c83('0x4b')]=qs[_0x0c83('0x4c')](_0x4e26d1[_0x0c83('0x45')]['sort']);_0xb41686[_0x0c83('0x4d')]=qs['filters'](_['pick'](_0x4e26d1['query'],_0x22c58e[_0x0c83('0x42')]),_0x4a9082);if(_0x4e26d1[_0x0c83('0x45')][_0x0c83('0x4e')]){_0xb41686[_0x0c83('0x4d')]=_['merge'](_0xb41686[_0x0c83('0x4d')],{'$or':_['map'](_0x4a9082,function(_0x32e579){if(_0x32e579[_0x0c83('0x4f')]!==_0x0c83('0x50')){var _0x581653={};_0x581653[_0x32e579['name']]={'$like':'%'+_0x4e26d1[_0x0c83('0x45')][_0x0c83('0x4e')]+'%'};return _0x581653;}})});}_0xb41686=_['merge']({},_0xb41686,_0x4e26d1[_0x0c83('0x51')]);var _0x45d2de={'where':_0xb41686[_0x0c83('0x4d')]};return db[_0x0c83('0x3d')][_0x0c83('0x31')](_0x45d2de)[_0x0c83('0x37')](function(_0x240553){_0x2d7684[_0x0c83('0x31')]=_0x240553;if(_0x4e26d1[_0x0c83('0x45')]['includeAll']){_0xb41686[_0x0c83('0x52')]=[{'all':!![]}];}return db[_0x0c83('0x3d')][_0x0c83('0x53')](_0xb41686);})[_0x0c83('0x37')](function(_0x4fbad2){_0x2d7684['rows']=_0x4fbad2;return _0x2d7684;})['then'](respondWithFilteredResult(_0x1bea79,_0xb41686))[_0x0c83('0x2a')](handleError(_0x1bea79,null));};exports['show']=function(_0x2179e9,_0x10dacf){var _0x55659a={'raw':!![],'where':{'id':_0x2179e9[_0x0c83('0x54')]['id']}},_0x29b4ba={};_0x29b4ba[_0x0c83('0x44')]=_['keys'](db['FaxMessage'][_0x0c83('0x3e')]);_0x29b4ba['query']=_[_0x0c83('0x41')](_0x2179e9['query']);_0x29b4ba[_0x0c83('0x42')]=_[_0x0c83('0x43')](_0x29b4ba['model'],_0x29b4ba[_0x0c83('0x45')]);_0x55659a['attributes']=_[_0x0c83('0x43')](_0x29b4ba[_0x0c83('0x44')],qs[_0x0c83('0x47')](_0x2179e9['query'][_0x0c83('0x47')]));_0x55659a[_0x0c83('0x46')]=_0x55659a[_0x0c83('0x46')]['length']?_0x55659a[_0x0c83('0x46')]:_0x29b4ba[_0x0c83('0x44')];if(_0x2179e9['query'][_0x0c83('0x55')]){_0x55659a['include']=[{'all':!![]}];}_0x55659a=_[_0x0c83('0x56')]({},_0x55659a,_0x2179e9[_0x0c83('0x51')]);return db[_0x0c83('0x3d')][_0x0c83('0x57')](_0x55659a)[_0x0c83('0x37')](handleEntityNotFound(_0x10dacf,null))[_0x0c83('0x37')](respondWithResult(_0x10dacf,null))['catch'](handleError(_0x10dacf,null));};exports[_0x0c83('0x35')]=function(_0x4f1f5c,_0x316b6a){if(_0x4f1f5c[_0x0c83('0x58')]['id']){delete _0x4f1f5c[_0x0c83('0x58')]['id'];}return db[_0x0c83('0x3d')][_0x0c83('0x57')]({'where':{'id':_0x4f1f5c[_0x0c83('0x54')]['id']}})[_0x0c83('0x37')](handleEntityNotFound(_0x316b6a,null))['then'](saveUpdates(_0x4f1f5c['body'],null))[_0x0c83('0x37')](respondWithResult(_0x316b6a,null))['catch'](handleError(_0x316b6a,null));};exports[_0x0c83('0x36')]=function(_0xd44285,_0x121cae){return db[_0x0c83('0x3d')][_0x0c83('0x57')]({'where':{'id':_0xd44285[_0x0c83('0x54')]['id']}})[_0x0c83('0x37')](handleEntityNotFound(_0x121cae,null))['then'](removeEntity(_0x121cae,null))['catch'](handleError(_0x121cae,null));};exports[_0x0c83('0x59')]=function(_0x2622e9,_0x258998){return db[_0x0c83('0x3d')][_0x0c83('0x59')]()['then'](respondWithResult(_0x258998,null))[_0x0c83('0x2a')](handleError(_0x258998,null));};var interaction_log=require(_0x0c83('0x5a'))(_0x0c83('0x5b'));exports[_0x0c83('0x5c')]=function(_0x3757b7,_0x226a7d,_0x1d1d63){var _0x543b23={'agent':{},'channel':_0x0c83('0x5d')};if(_0x3757b7[_0x0c83('0x58')]['id']){delete _0x3757b7[_0x0c83('0x58')]['id'];}_0x3757b7[_0x0c83('0x58')][_0x0c83('0x5e')]=!![];_0x3757b7[_0x0c83('0x58')][_0x0c83('0x5f')]=moment()[_0x0c83('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x3757b7[_0x0c83('0x58')][_0x0c83('0x61')]=_0x3757b7['body'][_0x0c83('0x61')]||_0x3757b7[_0x0c83('0x62')]['id'];_0x543b23['agent']['id']=_0x3757b7[_0x0c83('0x58')][_0x0c83('0x61')];return db['FaxMessage'][_0x0c83('0x57')]({'where':{'id':_0x3757b7[_0x0c83('0x54')]['id'],'UserId':null}})[_0x0c83('0x37')](handleEntityNotFound(_0x226a7d,null))[_0x0c83('0x37')](saveUpdates(_0x3757b7[_0x0c83('0x58')],null))[_0x0c83('0x37')](function(_0x24f928){if(_0x24f928){_0x543b23[_0x0c83('0x28')]=_0x24f928[_0x0c83('0x63')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x24f928[_0x0c83('0x64')]}});}return null;})[_0x0c83('0x37')](handleEntityNotFound(_0x226a7d,null))[_0x0c83('0x37')](function(_0x9e29a6){if(_0x9e29a6){return _0x9e29a6[_0x0c83('0x35')]({'UserId':_0x3757b7[_0x0c83('0x58')][_0x0c83('0x61')],'read1stAt':_['isNil'](_0x9e29a6[_0x0c83('0x65')])?moment()[_0x0c83('0x60')](_0x0c83('0x66')):undefined});}return null;})[_0x0c83('0x37')](function(_0x95738d){if(_0x95738d){_0x543b23[_0x0c83('0x67')]=_0x95738d[_0x0c83('0x63')]({'plain':!![]});interaction_log['info'](_0x0c83('0x68'),_0x3757b7[_0x0c83('0x62')]['id'],_0x3757b7[_0x0c83('0x62')][_0x0c83('0x39')],_0x3757b7[_0x0c83('0x62')][_0x0c83('0x69')],_0x543b23['interaction']['id'],_0x3757b7[_0x0c83('0x58')]?JSON[_0x0c83('0x25')](_0x3757b7[_0x0c83('0x58')]):_0x0c83('0x6a'));return respondWithRpcPromise(_0x0c83('0x6b'),_0x0c83('0x6c'),_0x543b23);}return null;})['then'](function(_0x1e1fc1){var _0x1661bb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e1fc1[_0x0c83('0x28')][_0x0c83('0x6d')];return db[_0x0c83('0x6e')][_0x0c83('0x45')](_0x1661bb,{'type':db[_0x0c83('0x6f')][_0x0c83('0x70')][_0x0c83('0x71')],'raw':!![]})['then'](function(_0x43dddf){return _0x43dddf;});})[_0x0c83('0x37')](function(_0xa8deec){if(_0xa8deec){_0x543b23[_0x0c83('0x28')][_0x0c83('0x72')]=_0xa8deec[0x0];if(!_0x3757b7[_0x0c83('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x3757b7[_0x0c83('0x58')]['UserId'],'role':_0x0c83('0x73')},'attributes':['id',_0x0c83('0x39'),_0x0c83('0x74'),'email',_0x0c83('0x75')],'raw':!![]});}return null;})[_0x0c83('0x37')](function(_0x31cded){if(!_0x31cded)return null;_0x543b23['message']['agent']=_0x31cded;return _0x543b23;})[_0x0c83('0x37')](function(_0x26929e){if(_0x26929e){if(_0x3757b7['body'][_0x0c83('0x76')]){_0x543b23['message']['interface']=util[_0x0c83('0x60')](_0x0c83('0x77'),_0x3757b7['user'][_0x0c83('0x39')]);_0x543b23[_0x0c83('0x28')][_0x0c83('0x78')]=_0x543b23[_0x0c83('0x78')];_0x543b23[_0x0c83('0x28')]['motionChannel']=_0x543b23[_0x0c83('0x78')];_0x543b23['message'][_0x0c83('0x79')]=_0x0c83('0x5c');return respondWithRpcPromise('EventManager',_0x0c83('0x7a'),{'event':_0x0c83('0x7b'),'message':_0x543b23[_0x0c83('0x28')]},client9002)[_0x0c83('0x37')](function(){return _0x543b23;});}return _0x543b23;}return null;})['then'](respondWithResult(_0x226a7d,null))[_0x0c83('0x2a')](handleError(_0x226a7d,null));};var interaction_log=require(_0x0c83('0x5a'))(_0x0c83('0x5b'));exports[_0x0c83('0x34')]=function(_0x14c7cc,_0x5cb2bb,_0x2ab562){var _0x34a9d9={'agent':{},'channel':_0x0c83('0x5d')};if(_0x14c7cc['body']['id']){delete _0x14c7cc[_0x0c83('0x58')]['id'];}_0x14c7cc[_0x0c83('0x58')]['UserId']=_0x14c7cc[_0x0c83('0x58')][_0x0c83('0x61')]||_0x14c7cc[_0x0c83('0x62')]['id'];_0x34a9d9[_0x0c83('0x73')]['id']=_0x14c7cc[_0x0c83('0x58')][_0x0c83('0x61')];return db[_0x0c83('0x3d')][_0x0c83('0x57')]({'where':{'id':_0x14c7cc['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5cb2bb,null))['then'](function(_0x39f2f8){if(_0x39f2f8){_0x34a9d9['message']=_0x39f2f8[_0x0c83('0x63')]({'plain':!![]});return db[_0x0c83('0x7c')][_0x0c83('0x57')]({'where':{'id':_0x39f2f8[_0x0c83('0x64')]}});}return null;})[_0x0c83('0x37')](handleEntityNotFound(_0x5cb2bb,null))[_0x0c83('0x37')](function(_0x10ee60){if(_0x10ee60){_0x34a9d9[_0x0c83('0x67')]=_0x10ee60[_0x0c83('0x63')]({'plain':!![]});interaction_log[_0x0c83('0x20')](_0x0c83('0x7d'),_0x14c7cc['user']['id'],_0x14c7cc[_0x0c83('0x62')][_0x0c83('0x39')],_0x14c7cc['user'][_0x0c83('0x69')],_0x34a9d9[_0x0c83('0x67')]['id'],_0x14c7cc[_0x0c83('0x58')]?JSON[_0x0c83('0x25')](_0x14c7cc['body']):_0x0c83('0x6a'));return respondWithRpcPromise(_0x0c83('0x7e'),'rejectMessage',_0x34a9d9);}return null;})[_0x0c83('0x37')](function(_0x444303){var _0x16faf7=_0x0c83('0x7f')+_0x444303[_0x0c83('0x28')][_0x0c83('0x6d')];return db[_0x0c83('0x6e')]['query'](_0x16faf7,{'type':db[_0x0c83('0x6f')]['QueryTypes'][_0x0c83('0x71')],'raw':!![]})[_0x0c83('0x37')](function(_0x3b5702){return _0x3b5702;});})[_0x0c83('0x37')](function(_0x2fd6b4){if(_0x2fd6b4){_0x34a9d9['message']['contact']=_0x2fd6b4[0x0];if(!_0x14c7cc[_0x0c83('0x58')][_0x0c83('0x61')])return;return db[_0x0c83('0x80')][_0x0c83('0x57')]({'where':{'id':_0x14c7cc[_0x0c83('0x58')][_0x0c83('0x61')],'role':_0x0c83('0x73')},'attributes':['id',_0x0c83('0x39'),_0x0c83('0x74'),_0x0c83('0x81'),_0x0c83('0x75')],'raw':!![]});}return null;})[_0x0c83('0x37')](function(_0x198a10){if(!_0x198a10)return null;_0x34a9d9['message'][_0x0c83('0x73')]=_0x198a10;return _0x34a9d9;})[_0x0c83('0x37')](function(_0x5e8f7a){if(_0x5e8f7a){_0x5e8f7a[_0x0c83('0x28')][_0x0c83('0x82')]=util['format'](_0x0c83('0x77'),_0x14c7cc[_0x0c83('0x62')][_0x0c83('0x39')]);_0x5e8f7a[_0x0c83('0x28')]['channel']=_0x34a9d9[_0x0c83('0x78')];_0x5e8f7a[_0x0c83('0x28')][_0x0c83('0x83')]=_0x34a9d9['channel'];_0x5e8f7a[_0x0c83('0x28')][_0x0c83('0x79')]='reject';respondWithRpcPromise(_0x0c83('0x7a'),_0x0c83('0x7a'),{'event':_0x0c83('0x84'),'message':_0x5e8f7a[_0x0c83('0x28')]},client9002);return _0x34a9d9;}return null;})[_0x0c83('0x37')](respondWithResult(_0x5cb2bb,null))['catch'](handleError(_0x5cb2bb,null));};exports[_0x0c83('0x85')]=function(_0x40db6a,_0x3bad9b){var _0x3f4dce;return db[_0x0c83('0x3d')][_0x0c83('0x85')](_0x40db6a[_0x0c83('0x58')],{})['then'](function(_0x491db5){_0x3f4dce=_0x491db5;return db[_0x0c83('0x86')][_0x0c83('0x87')]({'where':{'id':_0x3f4dce[_0x0c83('0x6d')]}});})[_0x0c83('0x37')](function(_0x1cfa3e){if(_[_0x0c83('0x88')](_0x1cfa3e)){return;}else{_0x3f4dce[_0x0c83('0x5d')]=_0x1cfa3e[_0x0c83('0x5d')];return db[_0x0c83('0x89')][_0x0c83('0x87')]({'where':{'id':_0x3f4dce[_0x0c83('0x8a')]}});}})[_0x0c83('0x37')](function(_0x1a001f){return respondWithRpcPromise(_0x0c83('0x8b'),_0x0c83('0x8b'),{'FaxAccountId':_['isNil'](_0x40db6a[_0x0c83('0x58')])?undefined:_0x40db6a[_0x0c83('0x58')][_0x0c83('0x8c')],'path':_[_0x0c83('0x88')](_0x1a001f)?undefined:util[_0x0c83('0x60')](_0x0c83('0x8d'),_0x1a001f['basename']),'fax':_[_0x0c83('0x88')](_0x3f4dce[_0x0c83('0x5d')])?undefined:_0x3f4dce[_0x0c83('0x5d')],'AttachmentId':_0x3f4dce[_0x0c83('0x8a')]},client9002);})[_0x0c83('0x37')](respondWithResult(_0x3bad9b,0xc9))[_0x0c83('0x2a')](handleError(_0x3bad9b,null));};exports[_0x0c83('0x8e')]=function(_0x2fe522,_0x5b6a2d){var _0xa86a82=path[_0x0c83('0x8f')](config['root'],'server',_0x0c83('0x90'),_0x0c83('0x91'));return db['FaxMessage']['find']({'where':{'id':_0x2fe522[_0x0c83('0x54')]['id']},'include':[{'model':db[_0x0c83('0x89')],'as':_0x0c83('0x89')}]})[_0x0c83('0x37')](handleEntityNotFound(_0x5b6a2d,null))[_0x0c83('0x37')](function(_0x259694){if(_0x259694){return _0x5b6a2d[_0x0c83('0x8e')](path[_0x0c83('0x8f')](_0xa86a82,_0x259694[_0x0c83('0x89')][_0x0c83('0x92')]));}})[_0x0c83('0x2a')](handleError(_0x5b6a2d,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6cb0d69..4db1461 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 _0xe056=['hook','exports','FaxMessage','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x39da6c,_0x325472){var _0x1881f1=function(_0x1ab3a0){while(--_0x1ab3a0){_0x39da6c['push'](_0x39da6c['shift']());}};_0x1881f1(++_0x325472);}(_0xe056,0xdb));var _0x6e05=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0xe056[_0xab9f3d];return _0x5283bf;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x6e05('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6e05('0x1')](0x0);var events={'afterCreate':_0x6e05('0x2'),'afterUpdate':'update','afterDestroy':_0x6e05('0x3')};function emitEvent(_0x518934){return function(_0x13ea30,_0x1bec29,_0x5205e6){FaxMessageEvents['emit'](_0x518934+':'+_0x13ea30['id'],_0x13ea30);FaxMessageEvents['emit'](_0x518934,_0x13ea30);_0x5205e6(null);};}for(var e in events){if(events[_0x6e05('0x4')](e)){var event=events[e];FaxMessage[_0x6e05('0x5')](e,emitEvent(event));}}module[_0x6e05('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x5f71=['save','emit','hasOwnProperty','hook','exports','events','FaxMessage'];(function(_0x412e6d,_0x3ffa8f){var _0x10407c=function(_0x325d3e){while(--_0x325d3e){_0x412e6d['push'](_0x412e6d['shift']());}};_0x10407c(++_0x3ffa8f);}(_0x5f71,0xc9));var _0x15f7=function(_0x5a5718,_0x392ac8){_0x5a5718=_0x5a5718-0x0;var _0x276e46=_0x5f71[_0x5a5718];return _0x276e46;};'use strict';var EventEmitter=require(_0x15f7('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x15f7('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15f7('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x510b60){return function(_0x3a9fe1,_0x3fa535,_0x5593f3){FaxMessageEvents[_0x15f7('0x3')](_0x510b60+':'+_0x3a9fe1['id'],_0x3a9fe1);FaxMessageEvents[_0x15f7('0x3')](_0x510b60,_0x3a9fe1);_0x5593f3(null);};}for(var e in events){if(events[_0x15f7('0x4')](e)){var event=events[e];FaxMessage[_0x15f7('0x5')](e,emitEvent(event));}}module[_0x15f7('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index ddbe2e3..a30ae68 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 _0xec83=['fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','secret','isNil','FaxInteraction','findOne','FaxInteractionId','update','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages'];(function(_0x31f9ac,_0x571b2b){var _0x5adec9=function(_0x4322ba){while(--_0x4322ba){_0x31f9ac['push'](_0x31f9ac['shift']());}};_0x5adec9(++_0x571b2b);}(_0xec83,0x6b));var _0x3ec8=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0xec83[_0x9fb081];return _0x43f8b0;};'use strict';var _=require(_0x3ec8('0x0'));var util=require(_0x3ec8('0x1'));var logger=require(_0x3ec8('0x2'))('api');var moment=require(_0x3ec8('0x3'));var BPromise=require(_0x3ec8('0x4'));var rp=require(_0x3ec8('0x5'));var fs=require('fs');var path=require(_0x3ec8('0x6'));var rimraf=require(_0x3ec8('0x7'));var config=require(_0x3ec8('0x8'));var attributes=require('./faxMessage.attributes');module[_0x3ec8('0x9')]=function(_0x208282,_0x465fd5){return _0x208282[_0x3ec8('0xa')](_0x3ec8('0xb'),attributes,{'tableName':_0x3ec8('0xc'),'paranoid':![],'indexes':[{'name':_0x3ec8('0xd'),'fields':[_0x3ec8('0xe')],'type':_0x3ec8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55000d,_0x22cd97,_0x42c5bd){var _0x274a7e=_0x208282[_0x3ec8('0x10')];var _0x43531a=_0x55000d[_0x3ec8('0x11')]({'plain':!![]});if(_0x43531a['direction'][_0x3ec8('0x12')]()==='in'||_0x43531a['direction'][_0x3ec8('0x12')]()==='out'&&!_0x43531a[_0x3ec8('0x13')]&&!_[_0x3ec8('0x14')](_0x43531a['UserId'])){_0x274a7e[_0x3ec8('0x15')][_0x3ec8('0x16')]({'where':{'id':_0x43531a[_0x3ec8('0x17')]}})['then'](function(_0x4ad0dd){if(_0x4ad0dd){_0x4ad0dd[_0x3ec8('0x18')]({'lastMsgAt':_0x43531a['createdAt'],'lastMsgDirection':_0x43531a[_0x3ec8('0x19')][_0x3ec8('0x12')]()});}})[_0x3ec8('0x1a')](function(_0x1c87d3){console[_0x3ec8('0x1b')](_0x1c87d3);});}_0x42c5bd();}},'charset':_0x3ec8('0x1c'),'collate':_0x3ec8('0x1d')});}; \ No newline at end of file +var _0x8f5e=['toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT'];(function(_0xfcd451,_0x3eec0b){var _0x2df9f1=function(_0x34aa04){while(--_0x34aa04){_0xfcd451['push'](_0xfcd451['shift']());}};_0x2df9f1(++_0x3eec0b);}(_0x8f5e,0x1cd));var _0xe8f5=function(_0x4e518e,_0x355862){_0x4e518e=_0x4e518e-0x0;var _0x557ce9=_0x8f5e[_0x4e518e];return _0x557ce9;};'use strict';var _=require(_0xe8f5('0x0'));var util=require('util');var logger=require(_0xe8f5('0x1'))(_0xe8f5('0x2'));var moment=require(_0xe8f5('0x3'));var BPromise=require(_0xe8f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8f5('0x5'));var rimraf=require(_0xe8f5('0x6'));var config=require(_0xe8f5('0x7'));var attributes=require(_0xe8f5('0x8'));module['exports']=function(_0xc4968,_0x2901f1){return _0xc4968[_0xe8f5('0x9')](_0xe8f5('0xa'),attributes,{'tableName':_0xe8f5('0xb'),'paranoid':![],'indexes':[{'name':_0xe8f5('0xc'),'fields':[_0xe8f5('0xd')],'type':_0xe8f5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26e488,_0x103012,_0x1afdca){var _0x26a06d=_0xc4968['models'];var _0x27c4bc=_0x26e488['get']({'plain':!![]});if(_0x27c4bc['direction'][_0xe8f5('0xf')]()==='in'||_0x27c4bc['direction']['toLowerCase']()===_0xe8f5('0x10')&&!_0x27c4bc[_0xe8f5('0x11')]&&!_[_0xe8f5('0x12')](_0x27c4bc[_0xe8f5('0x13')])){_0x26a06d['FaxInteraction'][_0xe8f5('0x14')]({'where':{'id':_0x27c4bc[_0xe8f5('0x15')]}})['then'](function(_0x177f5d){if(_0x177f5d){_0x177f5d['update']({'lastMsgAt':_0x27c4bc[_0xe8f5('0x16')],'lastMsgDirection':_0x27c4bc[_0xe8f5('0x17')][_0xe8f5('0xf')]()});}})[_0xe8f5('0x18')](function(_0x1ba0e2){console[_0xe8f5('0x19')](_0x1ba0e2);});}_0x1afdca();}},'charset':_0xe8f5('0x1a'),'collate':_0xe8f5('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 983107c..c0fd798 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 _0x5636=['error','code','message','result','CreateFaxMessage','FaxMessage','body','options','then','UpdateFaxMessage','update','where','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3eb4ae,_0x493c5b){var _0x1aa0d4=function(_0x194a3b){while(--_0x194a3b){_0x3eb4ae['push'](_0x3eb4ae['shift']());}};_0x1aa0d4(++_0x493c5b);}(_0x5636,0x102));var _0x6563=function(_0x15fbaf,_0x46ddb8){_0x15fbaf=_0x15fbaf-0x0;var _0x23745d=_0x5636[_0x15fbaf];return _0x23745d;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});}exports[_0x6563('0x1a')]=function(_0xf8b544){var _0x10811d=this;return new Promise(function(_0x37ba3,_0x93a45){return db[_0x6563('0x1b')]['create'](_0xf8b544[_0x6563('0x1c')],{'raw':_0xf8b544[_0x6563('0x1d')]?_0xf8b544[_0x6563('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6563('0x1e')](function(_0x5c37bb){logger[_0x6563('0x10')](_0x6563('0x1a'),_0xf8b544);logger['debug']('CreateFaxMessage',_0xf8b544,JSON[_0x6563('0x15')](_0x5c37bb));_0x37ba3(_0x5c37bb);})['catch'](function(_0x1097d0){logger[_0x6563('0x16')](_0x6563('0x1a'),_0x1097d0['message'],_0xf8b544);_0x93a45(_0x10811d[_0x6563('0x16')](0x1f4,_0x1097d0['message']));});});};exports[_0x6563('0x1f')]=function(_0x1590e6){var _0x5e5aeb=this;return new Promise(function(_0x365b16,_0x28252d){return db['FaxMessage'][_0x6563('0x20')](_0x1590e6['body'],{'raw':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')][_0x6563('0x21')]||null:null,'attributes':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')]['attributes']||null:null,'limit':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['limit']||null:null})[_0x6563('0x1e')](function(_0x35af37){logger[_0x6563('0x10')](_0x6563('0x1f'),_0x1590e6);logger[_0x6563('0x13')](_0x6563('0x1f'),_0x1590e6,JSON[_0x6563('0x15')](_0x35af37));_0x365b16(_0x35af37);})[_0x6563('0x22')](function(_0x101b24){logger[_0x6563('0x16')]('UpdateFaxMessage',_0x101b24[_0x6563('0x18')],_0x1590e6);_0x28252d(_0x5e5aeb[_0x6563('0x16')](0x1f4,_0x101b24[_0x6563('0x18')]));});});}; \ No newline at end of file +var _0x9957=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','body','options','raw','CreateFaxMessage','catch','UpdateFaxMessage','FaxMessage','where','attributes','lodash'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('FaxMessage,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['CreateFaxMessage']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['FaxMessage']['create'](_0x3ec178[_0x7995('0x1c')],{'raw':_0x3ec178[_0x7995('0x1d')]?_0x3ec178[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![]})[_0x7995('0x12')](function(_0x1c278a){logger['info'](_0x7995('0x1f'),_0x3ec178);logger[_0x7995('0x15')](_0x7995('0x1f'),_0x3ec178,JSON[_0x7995('0x17')](_0x1c278a));_0x4cbe10(_0x1c278a);})[_0x7995('0x20')](function(_0x13bc35){logger[_0x7995('0x18')](_0x7995('0x1f'),_0x13bc35['message'],_0x3ec178);_0x3a9b54(_0x3d463e[_0x7995('0x18')](0x1f4,_0x13bc35[_0x7995('0x19')]));});});};exports[_0x7995('0x21')]=function(_0x268ce7){var _0x3a3fcf=this;return new Promise(function(_0x2a307e,_0x56691a){return db[_0x7995('0x22')]['update'](_0x268ce7[_0x7995('0x1c')],{'raw':_0x268ce7[_0x7995('0x1d')]?_0x268ce7[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options'][_0x7995('0x23')]||null:null,'attributes':_0x268ce7['options']?_0x268ce7[_0x7995('0x1d')][_0x7995('0x24')]||null:null,'limit':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options']['limit']||null:null})['then'](function(_0x3573be){logger[_0x7995('0x1a')](_0x7995('0x21'),_0x268ce7);logger[_0x7995('0x15')](_0x7995('0x21'),_0x268ce7,JSON[_0x7995('0x17')](_0x3573be));_0x2a307e(_0x3573be);})['catch'](function(_0x481c74){logger[_0x7995('0x18')]('UpdateFaxMessage',_0x481c74[_0x7995('0x19')],_0x268ce7);_0x56691a(_0x3a3fcf[_0x7995('0x18')](0x1f4,_0x481c74[_0x7995('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d5e173d..037e732 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 _0x2ee5=['removeListener','register','length','faxMessage:','save','remove','update','emit'];(function(_0x7033ad,_0x4f191a){var _0x4117fb=function(_0x537976){while(--_0x537976){_0x7033ad['push'](_0x7033ad['shift']());}};_0x4117fb(++_0x4f191a);}(_0x2ee5,0x184));var _0x52ee=function(_0x2dfc93,_0xbf234e){_0x2dfc93=_0x2dfc93-0x0;var _0x4d8361=_0x2ee5[_0x2dfc93];return _0x4d8361;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x52ee('0x0'),_0x52ee('0x1'),_0x52ee('0x2')];function createListener(_0x255453,_0x4ddb4b){return function(_0x25d03f){_0x4ddb4b[_0x52ee('0x3')](_0x255453,_0x25d03f);};}function removeListener(_0xcde555,_0x12d395){return function(){FaxMessageEvents[_0x52ee('0x4')](_0xcde555,_0x12d395);};}exports[_0x52ee('0x5')]=function(_0x50b161){for(var _0x1aa02e=0x0,_0xe72934=events[_0x52ee('0x6')];_0x1aa02e<_0xe72934;_0x1aa02e++){var _0x44da6b=events[_0x1aa02e];var _0x42510a=createListener(_0x52ee('0x7')+_0x44da6b,_0x50b161);FaxMessageEvents['on'](_0x44da6b,_0x42510a);}}; \ No newline at end of file +var _0x7148=['save','remove','update','removeListener','register'];(function(_0x216937,_0x469568){var _0x9d49c8=function(_0x48c32c){while(--_0x48c32c){_0x216937['push'](_0x216937['shift']());}};_0x9d49c8(++_0x469568);}(_0x7148,0x1cc));var _0x8714=function(_0x3e27a5,_0x5ee1c0){_0x3e27a5=_0x3e27a5-0x0;var _0x13d585=_0x7148[_0x3e27a5];return _0x13d585;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x8714('0x0'),_0x8714('0x1'),_0x8714('0x2')];function createListener(_0x496c5f,_0x514f63){return function(_0x389095){_0x514f63['emit'](_0x496c5f,_0x389095);};}function removeListener(_0x48751e,_0x1a9418){return function(){FaxMessageEvents[_0x8714('0x3')](_0x48751e,_0x1a9418);};}exports[_0x8714('0x4')]=function(_0x30aa2f){for(var _0x302897=0x0,_0x2b3d6f=events['length'];_0x302897<_0x2b3d6f;_0x302897++){var _0xb358f4=events[_0x302897];var _0xdd6cb=createListener('faxMessage:'+_0xb358f4,_0x30aa2f);FaxMessageEvents['on'](_0xb358f4,_0xdd6cb);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9cf7c80..879ecaa 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 _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','download','post','tracked','fax','faxmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x6324,0x142));var _0x4632=function(_0x177452,_0x76dd98){_0x177452=_0x177452-0x0;var _0x4e41fa=_0x6324[_0x177452];return _0x4e41fa;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxMessage.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/download',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/',auth[_0x4632('0x8')](),interaction[_0x4632('0xe')](_0x4632('0xf'),_0x4632('0x10')),controller[_0x4632('0x11')]);router['put'](_0x4632('0x12'),auth['isAuthenticated'](),controller[_0x4632('0x13')]);router[_0x4632('0x14')](_0x4632('0x15'),auth[_0x4632('0x8')](),controller['accept']);router[_0x4632('0x14')](_0x4632('0x16'),auth[_0x4632('0x8')](),controller[_0x4632('0x17')]);router[_0x4632('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0x19')]);module[_0x4632('0x1a')]=router; \ No newline at end of file +var _0xc368=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','util','connect-timeout'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xc368,0x7b));var _0x8c36=function(_0x2d8f08,_0x6d1b3f){_0x2d8f08=_0x2d8f08-0x0;var _0x5ec811=_0xc368[_0x2d8f08];return _0x5ec811;};'use strict';var multer=require('multer');var util=require(_0x8c36('0x0'));var path=require('path');var timeout=require(_0x8c36('0x1'));var express=require(_0x8c36('0x2'));var router=express[_0x8c36('0x3')]();var fs_extra=require(_0x8c36('0x4'));var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth[_0x8c36('0x9')](),controller['index']);router['get'](_0x8c36('0xa'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller['show']);router['get']('/:id/download',auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router['post']('/',auth[_0x8c36('0x9')](),interaction[_0x8c36('0xe')](_0x8c36('0xf'),_0x8c36('0x10')),controller[_0x8c36('0x11')]);router[_0x8c36('0x12')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x13')]);router[_0x8c36('0x12')](_0x8c36('0x14'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x15')]);router[_0x8c36('0x12')]('/:id/reject',auth[_0x8c36('0x9')](),controller['reject']);router[_0x8c36('0x16')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x17')]);module[_0x8c36('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 20170ca..f16f676 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 _0xe070=['ENUM','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x111c17,_0x275184){var _0x5ff50a=function(_0x4ebc34){while(--_0x4ebc34){_0x111c17['push'](_0x111c17['shift']());}};_0x5ff50a(++_0x275184);}(_0xe070,0x167));var _0x0e07=function(_0x2417f9,_0x803ba4){_0x2417f9=_0x2417f9-0x0;var _0x142d82=_0xe070[_0x2417f9];return _0x142d82;};'use strict';var Sequelize=require(_0x0e07('0x0'));module[_0x0e07('0x1')]={'name':{'type':Sequelize[_0x0e07('0x2')],'unique':_0x0e07('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e07('0x2')]},'timeout':{'type':Sequelize[_0x0e07('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e07('0x5')]('rrmemory','beepall',_0x0e07('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2e43=['sequelize','exports','STRING','ENUM','beepall','roundrobin','INTEGER'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x2e43,0x15e));var _0x32e4=function(_0x400550,_0x5a0f71){_0x400550=_0x400550-0x0;var _0xdbab93=_0x2e43[_0x400550];return _0xdbab93;};'use strict';var Sequelize=require(_0x32e4('0x0'));module[_0x32e4('0x1')]={'name':{'type':Sequelize[_0x32e4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x32e4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x32e4('0x3')]('rrmemory',_0x32e4('0x4'),_0x32e4('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x32e4('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 1d6f7b0..e7d1d37 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 _0x692c=['getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','name','FaxQueue','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','user','role','userProfileId','params','getMembers','UserFaxQueue','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','getTeams','findOne','Team','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','union','compact','value','ids','removeAgents','userFaxQueue:remove','addAgents','spread','isArray'];(function(_0x16a29d,_0x2b03fe){var _0x3924c2=function(_0x2e3df2){while(--_0x2e3df2){_0x16a29d['push'](_0x16a29d['shift']());}};_0x3924c2(++_0x2b03fe);}(_0x692c,0x19c));var _0xc692=function(_0x4f74ea,_0x546da8){_0x4f74ea=_0x4f74ea-0x0;var _0x2f6a8a=_0x692c[_0x4f74ea];return _0x2f6a8a;};'use strict';var emlformat=require(_0xc692('0x0'));var rimraf=require(_0xc692('0x1'));var zipdir=require(_0xc692('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc692('0x3'));var Mustache=require(_0xc692('0x4'));var util=require('util');var path=require(_0xc692('0x5'));var sox=require(_0xc692('0x6'));var csv=require('to-csv');var ejs=require(_0xc692('0x7'));var fs=require('fs');var fs_extra=require(_0xc692('0x8'));var _=require('lodash');var squel=require(_0xc692('0x9'));var crypto=require(_0xc692('0xa'));var jsforce=require(_0xc692('0xb'));var deskjs=require(_0xc692('0xc'));var toCsv=require(_0xc692('0xd'));var querystring=require(_0xc692('0xe'));var Papa=require(_0xc692('0xf'));var Redis=require(_0xc692('0x10'));var authService=require(_0xc692('0x11'));var qs=require(_0xc692('0x12'));var as=require(_0xc692('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc692('0x14'))('api');var utils=require(_0xc692('0x15'));var config=require(_0xc692('0x16'));var licenseUtil=require(_0xc692('0x17'));var db=require(_0xc692('0x18'))['db'];config[_0xc692('0x19')]=_['defaults'](config[_0xc692('0x19')],{'host':_0xc692('0x1a'),'port':0x18eb});var socket=require(_0xc692('0x1b'))(new Redis(config[_0xc692('0x19')]));require('./faxQueue.socket')[_0xc692('0x1c')](socket);function respondWithStatusCode(_0x577669,_0x2d8d04){_0x2d8d04=_0x2d8d04||0xcc;return function(_0x1aadd0){if(_0x1aadd0){return _0x577669[_0xc692('0x1d')](_0x2d8d04);}return _0x577669[_0xc692('0x1e')](_0x2d8d04)['end']();};}function respondWithResult(_0x5b8e0c,_0x5e2bd8){_0x5e2bd8=_0x5e2bd8||0xc8;return function(_0x22728e){if(_0x22728e){return _0x5b8e0c[_0xc692('0x1e')](_0x5e2bd8)['json'](_0x22728e);}};}function respondWithFilteredResult(_0x36f08d,_0x1d1ced){return function(_0x1a6662){if(_0x1a6662){var _0x272e36=typeof _0x1d1ced[_0xc692('0x1f')]===_0xc692('0x20')&&typeof _0x1d1ced[_0xc692('0x21')]===_0xc692('0x20');var _0x104d50=_0x1a6662['count'];var _0xfea65b=_0x272e36?0x0:_0x1d1ced[_0xc692('0x1f')];var _0x47d553=_0x272e36?_0x1a6662[_0xc692('0x22')]:_0x1d1ced[_0xc692('0x1f')]+_0x1d1ced[_0xc692('0x21')];var _0x1de4da;if(_0x47d553>=_0x104d50){_0x47d553=_0x104d50;_0x1de4da=0xc8;}else{_0x1de4da=0xce;}_0x36f08d['status'](_0x1de4da);return _0x36f08d[_0xc692('0x23')](_0xc692('0x24'),_0xfea65b+'-'+_0x47d553+'/'+_0x104d50)[_0xc692('0x25')](_0x1a6662);}return null;};}function patchUpdates(_0x2a1a10){return function(_0x17b29e){try{jsonpatch[_0xc692('0x26')](_0x17b29e,_0x2a1a10,!![]);}catch(_0x5d29b2){return BPromise['reject'](_0x5d29b2);}return _0x17b29e[_0xc692('0x27')]();};}function saveUpdates(_0x8a3bba,_0x903bd9){return function(_0x361712){if(_0x361712){return _0x361712[_0xc692('0x28')](_0x8a3bba)[_0xc692('0x29')](function(_0x4a60ff){return _0x4a60ff;});}return null;};}function removeEntity(_0x329b41,_0x189aaf){return function(_0x552f8c){if(_0x552f8c){return _0x552f8c[_0xc692('0x2a')]()[_0xc692('0x29')](function(){var _0x5d798b=_0x552f8c[_0xc692('0x2b')]({'plain':!![]});var _0xea013=_0xc692('0x2c');return db[_0xc692('0x2d')][_0xc692('0x2a')]({'where':{'type':_0xea013,'resourceId':_0x5d798b['id']}})[_0xc692('0x29')](function(){return _0x552f8c;});})[_0xc692('0x29')](function(){_0x329b41[_0xc692('0x1e')](0xcc)[_0xc692('0x2e')]();});}};}function handleEntityNotFound(_0x106bc9,_0x145df0){return function(_0x4ba27d){if(!_0x4ba27d){_0x106bc9[_0xc692('0x1d')](0x194);}return _0x4ba27d;};}function handleError(_0x556d1d,_0x32de87){_0x32de87=_0x32de87||0x1f4;return function(_0x5b8b5f){logger[_0xc692('0x2f')](_0x5b8b5f['stack']);if(_0x5b8b5f[_0xc692('0x30')]){delete _0x5b8b5f[_0xc692('0x30')];}_0x556d1d[_0xc692('0x1e')](_0x32de87)['send'](_0x5b8b5f);};}exports['index']=function(_0x4858a0,_0x5d41a2){var _0x11506e={},_0x5c40da={},_0xfd2a29={'count':0x0,'rows':[]};var _0x4a2000=_['map'](db[_0xc692('0x31')]['rawAttributes'],function(_0x520f3f){return{'name':_0x520f3f['fieldName'],'type':_0x520f3f[_0xc692('0x32')]['key']};});_0x5c40da[_0xc692('0x33')]=_[_0xc692('0x34')](_0x4a2000,_0xc692('0x30'));_0x5c40da[_0xc692('0x35')]=_[_0xc692('0x36')](_0x4858a0[_0xc692('0x35')]);_0x5c40da['filters']=_[_0xc692('0x37')](_0x5c40da[_0xc692('0x33')],_0x5c40da['query']);_0x11506e['attributes']=_[_0xc692('0x37')](_0x5c40da[_0xc692('0x33')],qs[_0xc692('0x38')](_0x4858a0[_0xc692('0x35')]['fields']));_0x11506e[_0xc692('0x39')]=_0x11506e[_0xc692('0x39')][_0xc692('0x3a')]?_0x11506e['attributes']:_0x5c40da[_0xc692('0x33')];if(!_0x4858a0[_0xc692('0x35')][_0xc692('0x3b')](_0xc692('0x3c'))){_0x11506e[_0xc692('0x21')]=qs[_0xc692('0x21')](_0x4858a0[_0xc692('0x35')][_0xc692('0x21')]);_0x11506e[_0xc692('0x1f')]=qs[_0xc692('0x1f')](_0x4858a0['query'][_0xc692('0x1f')]);}_0x11506e[_0xc692('0x3d')]=qs[_0xc692('0x3e')](_0x4858a0[_0xc692('0x35')][_0xc692('0x3e')]);_0x11506e[_0xc692('0x3f')]=qs[_0xc692('0x40')](_[_0xc692('0x41')](_0x4858a0[_0xc692('0x35')],_0x5c40da[_0xc692('0x40')]),_0x4a2000);if(_0x4858a0[_0xc692('0x35')][_0xc692('0x42')]){_0x11506e['where']=_[_0xc692('0x43')](_0x11506e['where'],{'$or':_['map'](_0x4a2000,function(_0x2ef4e1){if(_0x2ef4e1[_0xc692('0x32')]!==_0xc692('0x44')){var _0x164d6a={};_0x164d6a[_0x2ef4e1[_0xc692('0x30')]]={'$like':'%'+_0x4858a0[_0xc692('0x35')]['filter']+'%'};return _0x164d6a;}})});}_0x11506e=_[_0xc692('0x43')]({},_0x11506e,_0x4858a0['options']);var _0x4c6d35={'where':_0x11506e[_0xc692('0x3f')]};return db[_0xc692('0x31')][_0xc692('0x22')](_0x4c6d35)[_0xc692('0x29')](function(_0x9637e4){_0xfd2a29[_0xc692('0x22')]=_0x9637e4;if(_0x4858a0[_0xc692('0x35')][_0xc692('0x45')]){_0x11506e[_0xc692('0x46')]=[{'all':!![]}];}return db[_0xc692('0x31')][_0xc692('0x47')](_0x11506e);})[_0xc692('0x29')](function(_0x331773){_0xfd2a29['rows']=_0x331773;return _0xfd2a29;})[_0xc692('0x29')](respondWithFilteredResult(_0x5d41a2,_0x11506e))[_0xc692('0x48')](handleError(_0x5d41a2,null));};exports[_0xc692('0x49')]=function(_0x3a0d1d,_0x1c9729){var _0x222d4c={'raw':!![],'where':{'id':_0x3a0d1d['params']['id']}},_0x145592={};_0x145592['model']=_[_0xc692('0x36')](db[_0xc692('0x31')][_0xc692('0x4a')]);_0x145592[_0xc692('0x35')]=_[_0xc692('0x36')](_0x3a0d1d['query']);_0x145592[_0xc692('0x40')]=_[_0xc692('0x37')](_0x145592[_0xc692('0x33')],_0x145592[_0xc692('0x35')]);_0x222d4c['attributes']=_['intersection'](_0x145592[_0xc692('0x33')],qs[_0xc692('0x38')](_0x3a0d1d[_0xc692('0x35')]['fields']));_0x222d4c[_0xc692('0x39')]=_0x222d4c[_0xc692('0x39')]['length']?_0x222d4c['attributes']:_0x145592[_0xc692('0x33')];if(_0x3a0d1d[_0xc692('0x35')][_0xc692('0x45')]){_0x222d4c[_0xc692('0x46')]=[{'all':!![]}];}_0x222d4c=_['merge']({},_0x222d4c,_0x3a0d1d[_0xc692('0x4b')]);return db[_0xc692('0x31')][_0xc692('0x4c')](_0x222d4c)[_0xc692('0x29')](handleEntityNotFound(_0x1c9729,null))[_0xc692('0x29')](respondWithResult(_0x1c9729,null))[_0xc692('0x48')](handleError(_0x1c9729,null));};exports[_0xc692('0x4d')]=function(_0x2a51d7,_0x554bf5){return db[_0xc692('0x31')]['create'](_0x2a51d7[_0xc692('0x4e')],{})['then'](function(_0x5ec9eb){var _0x5b6a81=_0x2a51d7[_0xc692('0x4f')][_0xc692('0x2b')]({'plain':!![]});if(!_0x5b6a81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b6a81[_0xc692('0x50')]==='user'){var _0x3dbe72=_0x5ec9eb[_0xc692('0x2b')]({'plain':!![]});var _0x3478ae='FaxQueues';return db['UserProfileSection'][_0xc692('0x4c')]({'where':{'name':_0x3478ae,'userProfileId':_0x5b6a81[_0xc692('0x51')]},'raw':!![]})['then'](function(_0x5d74fc){if(_0x5d74fc&&_0x5d74fc['autoAssociation']===0x0){return db[_0xc692('0x2d')][_0xc692('0x4d')]({'name':_0x3dbe72['name'],'resourceId':_0x3dbe72['id'],'type':_0x5d74fc[_0xc692('0x30')],'sectionId':_0x5d74fc['id']},{})[_0xc692('0x29')](function(){return _0x5ec9eb;});}else{return _0x5ec9eb;}})[_0xc692('0x48')](function(_0x59866e){logger[_0xc692('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59866e);throw _0x59866e;});}return _0x5ec9eb;})[_0xc692('0x29')](respondWithResult(_0x554bf5,0xc9))['catch'](handleError(_0x554bf5,null));};exports[_0xc692('0x28')]=function(_0x5bd8b1,_0x25a4ff){if(_0x5bd8b1[_0xc692('0x4e')]['id']){delete _0x5bd8b1[_0xc692('0x4e')]['id'];}return db[_0xc692('0x31')]['find']({'where':{'id':_0x5bd8b1[_0xc692('0x52')]['id']}})[_0xc692('0x29')](handleEntityNotFound(_0x25a4ff,null))['then'](saveUpdates(_0x5bd8b1[_0xc692('0x4e')],null))[_0xc692('0x29')](respondWithResult(_0x25a4ff,null))[_0xc692('0x48')](handleError(_0x25a4ff,null));};exports['destroy']=function(_0x4b1ce7,_0x1e23fe){return db[_0xc692('0x31')][_0xc692('0x4c')]({'where':{'id':_0x4b1ce7[_0xc692('0x52')]['id']}})[_0xc692('0x29')](handleEntityNotFound(_0x1e23fe,null))[_0xc692('0x29')](removeEntity(_0x1e23fe,null))[_0xc692('0x48')](handleError(_0x1e23fe,null));};exports['describe']=function(_0xeaf5a2,_0x4ae9c7){return db['FaxQueue']['describe']()[_0xc692('0x29')](respondWithResult(_0x4ae9c7,null))[_0xc692('0x48')](handleError(_0x4ae9c7,null));};exports[_0xc692('0x53')]=function(_0x420597,_0x5d83c6,_0x547d35){var _0x584835={'raw':!![],'where':{}},_0x126bd2={},_0x4fc934;return db[_0xc692('0x31')]['findOne']({'where':{'id':_0x420597[_0xc692('0x52')]['id']}})[_0xc692('0x29')](handleEntityNotFound(_0x5d83c6,null))[_0xc692('0x29')](function(_0x5ed610){if(_0x5ed610){_0x4fc934=_0x5ed610[_0xc692('0x2b')]({'plain':!![]});_0x126bd2[_0xc692('0x33')]=_['keys'](db[_0xc692('0x54')][_0xc692('0x4a')]);_0x126bd2[_0xc692('0x35')]=_['keys'](_0x420597['query']);_0x126bd2[_0xc692('0x40')]=_[_0xc692('0x37')](_0x126bd2[_0xc692('0x33')],_0x126bd2[_0xc692('0x35')]);_0x584835[_0xc692('0x39')]=_[_0xc692('0x37')](_0x126bd2[_0xc692('0x33')],qs[_0xc692('0x38')](_0x420597[_0xc692('0x35')][_0xc692('0x38')]));_0x584835[_0xc692('0x39')]=_0x584835[_0xc692('0x39')][_0xc692('0x3a')]?_0x584835['attributes']:_0x126bd2[_0xc692('0x33')];if(!_0x420597[_0xc692('0x35')][_0xc692('0x3b')](_0xc692('0x3c'))){_0x584835[_0xc692('0x21')]=qs[_0xc692('0x21')](_0x420597['query']['limit']);_0x584835[_0xc692('0x1f')]=qs[_0xc692('0x1f')](_0x420597[_0xc692('0x35')]['offset']);}_0x584835['order']=qs[_0xc692('0x3e')](_0x420597[_0xc692('0x35')]['sort']);_0x584835[_0xc692('0x3f')]=qs['filters'](_[_0xc692('0x41')](_0x420597[_0xc692('0x35')],_0x126bd2['filters']));_0x584835[_0xc692('0x3f')]['FaxQueueId']=_0x5ed610['id'];if(_0x420597['query'][_0xc692('0x42')]){_0x584835['where']=_[_0xc692('0x43')](_0x584835['where'],{'$or':_[_0xc692('0x34')](_0x584835[_0xc692('0x39')],function(_0x27ddf4){var _0x97dec4={};_0x97dec4[_0x27ddf4]={'$like':'%'+_0x420597[_0xc692('0x35')][_0xc692('0x42')]+'%'};return _0x97dec4;})});}_0x584835=_[_0xc692('0x43')]({},_0x584835,_0x420597[_0xc692('0x4b')]);return db['UserFaxQueue'][_0xc692('0x47')](_0x584835);}})[_0xc692('0x29')](function(_0x416b9c){if(_0x416b9c){return db['User'][_0xc692('0x55')]({'where':{'id':_['map'](_0x416b9c,_0xc692('0x56')),'role':_0xc692('0x57')},'attributes':['id',_0xc692('0x30'),'faxPause',_0xc692('0x58'),_0xc692('0x59')]});}})[_0xc692('0x29')](function(_0x3fdfc9){if(_0x3fdfc9){return{'count':_0x3fdfc9['count'],'rows':_[_0xc692('0x34')](_0x3fdfc9[_0xc692('0x5a')],function(_0x2b00cd){return{'membername':_0x2b00cd['name'],'UserId':_0x2b00cd['id'],'queue_name':_0x4fc934[_0xc692('0x30')],'FaxQueueId':_0x4fc934['id'],'interface':util[_0xc692('0x5b')](_0xc692('0x5c'),_0xc692('0x5d'),_0x2b00cd[_0xc692('0x30')]),'penalty':0x0,'paused':_0x2b00cd[_0xc692('0x5e')],'createdAt':_0x2b00cd['createdAt'],'updatedAt':_0x2b00cd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5d83c6,_0x584835))[_0xc692('0x48')](handleError(_0x5d83c6,null));};exports[_0xc692('0x5f')]=function(_0x3a6546,_0x7deabd,_0x2e5341){var _0x5c4a09={};var _0x3e59a0={};var _0x2de2d3;var _0x1470ee;return db['FaxQueue'][_0xc692('0x60')]({'where':{'id':_0x3a6546[_0xc692('0x52')]['id']}})[_0xc692('0x29')](handleEntityNotFound(_0x7deabd,null))[_0xc692('0x29')](function(_0x50b4b3){if(_0x50b4b3){_0x2de2d3=_0x50b4b3;_0x3e59a0[_0xc692('0x33')]=_[_0xc692('0x36')](db[_0xc692('0x61')][_0xc692('0x4a')]);_0x3e59a0[_0xc692('0x35')]=_[_0xc692('0x36')](_0x3a6546[_0xc692('0x35')]);_0x3e59a0['filters']=_['intersection'](_0x3e59a0[_0xc692('0x33')],_0x3e59a0['query']);_0x5c4a09['attributes']=_[_0xc692('0x37')](_0x3e59a0[_0xc692('0x33')],qs[_0xc692('0x38')](_0x3a6546[_0xc692('0x35')]['fields']));_0x5c4a09[_0xc692('0x39')]=_0x5c4a09[_0xc692('0x39')][_0xc692('0x3a')]?_0x5c4a09[_0xc692('0x39')]:_0x3e59a0[_0xc692('0x33')];_0x5c4a09[_0xc692('0x3d')]=qs['sort'](_0x3a6546[_0xc692('0x35')][_0xc692('0x3e')]);_0x5c4a09[_0xc692('0x3f')]=qs['filters'](_['pick'](_0x3a6546[_0xc692('0x35')],_0x3e59a0[_0xc692('0x40')]));if(_0x3a6546[_0xc692('0x35')][_0xc692('0x42')]){_0x5c4a09[_0xc692('0x3f')]=_[_0xc692('0x43')](_0x5c4a09['where'],{'$or':_['map'](_0x5c4a09[_0xc692('0x39')],function(_0x234479){var _0x293868={};_0x293868[_0x234479]={'$like':'%'+_0x3a6546[_0xc692('0x35')][_0xc692('0x42')]+'%'};return _0x293868;})});}_0x5c4a09=_[_0xc692('0x43')]({},_0x5c4a09,_0x3a6546[_0xc692('0x4b')]);return _0x2de2d3['getTeams'](_0x5c4a09);}})[_0xc692('0x29')](function(_0x3ddad1){if(_0x3ddad1){_0x1470ee=_0x3ddad1[_0xc692('0x3a')];if(!_0x3a6546[_0xc692('0x35')]['hasOwnProperty'](_0xc692('0x3c'))){_0x5c4a09[_0xc692('0x21')]=qs[_0xc692('0x21')](_0x3a6546[_0xc692('0x35')][_0xc692('0x21')]);_0x5c4a09[_0xc692('0x1f')]=qs['offset'](_0x3a6546[_0xc692('0x35')]['offset']);}return _0x2de2d3[_0xc692('0x5f')](_0x5c4a09);}})['then'](function(_0x4358ea){if(_0x4358ea){return _0x4358ea?{'count':_0x1470ee,'rows':_0x4358ea}:null;}})[_0xc692('0x29')](respondWithResult(_0x7deabd,null))['catch'](handleError(_0x7deabd,null));};exports[_0xc692('0x62')]=function(_0x5d5f40,_0x102f91,_0x35a8c4){var _0x56b70c=_0x5d5f40[_0xc692('0x4e')]['ids'];return db[_0xc692('0x61')][_0xc692('0x47')]({'where':{'id':_0x56b70c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc692('0x63'),'attributes':['id',_0xc692('0x30'),'online',_0xc692('0x64'),_0xc692('0x65')],'raw':!![]}]})[_0xc692('0x29')](function(_0x5e3e41){if(_0x5e3e41){var _0x30ba0f=_[_0xc692('0x66')](_0x5e3e41,function(_0xeed22b){var _0x547f9b=_0xeed22b[_0xc692('0x2b')]({'plain':!![]});return _0x547f9b['Agents'];});return db[_0xc692('0x31')][_0xc692('0x4c')]({'where':{'id':_0x5d5f40[_0xc692('0x52')]['id']}})[_0xc692('0x29')](function(_0x41b364){return db[_0xc692('0x67')][_0xc692('0x68')](function(_0x4be704){return _0x41b364[_0xc692('0x62')](_0x56b70c,{'transaction':_0x4be704})[_0xc692('0x29')](function(){return BPromise[_0xc692('0x69')](_0x30ba0f,function(_0xfd42b){return db['UserFaxQueue'][_0xc692('0x6a')]({'where':{'UserId':_0xfd42b['id'],'FaxQueueId':_0x5d5f40[_0xc692('0x52')]['id']},'transaction':_0x4be704});});})[_0xc692('0x29')](function(){_0x30ba0f[_0xc692('0x6b')](function(_0x214a59){socket[_0xc692('0x6c')](_0xc692('0x6d'),{'UserId':_0x214a59['id'],'FaxQueueId':_0x41b364['id']});});});});});}})[_0xc692('0x29')](respondWithStatusCode(_0x102f91,null))['catch'](handleError(_0x102f91,null));};exports[_0xc692('0x6e')]=function(_0x444a99,_0x562cda,_0x1c8df4){return db[_0xc692('0x61')]['findAll']({'where':{'id':_0x444a99[_0xc692('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc692('0x6f')],'as':_0xc692('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x562cda,null))[_0xc692('0x29')](function(_0x2a4045){var _0x53e29f=_[_0xc692('0x34')](_0x2a4045,'id');var _0x55ebc7=[];var _0x3ee5dd=[];var _0x56d80f=squel[_0xc692('0x70')]();_0x56d80f[_0xc692('0x71')](_0xc692('0x72'))[_0xc692('0x73')](_0xc692('0x74'),'tq')['join'](_0xc692('0x75'),'ut',_0xc692('0x76'))[_0xc692('0x3f')](_0xc692('0x77'),_0x444a99[_0xc692('0x52')]['id']);for(var _0x375a62=0x0;_0x375a62<_0x2a4045[_0xc692('0x3a')];_0x375a62+=0x1){let _0x30ee1e=_0x2a4045[_0x375a62];for(var _0xbc67f9=0x0;_0xbc67f9<_0x30ee1e[_0xc692('0x63')][_0xc692('0x3a')];_0xbc67f9+=0x1){let _0xc04fc2=_0x30ee1e['Agents'][_0xbc67f9];var _0x14dc9f=_0x56d80f[_0xc692('0x78')]();_0x14dc9f[_0xc692('0x3f')](_0xc692('0x79'),_0xc04fc2['id']);_0x3ee5dd['push'](db[_0xc692('0x67')][_0xc692('0x35')](_0x14dc9f[_0xc692('0x7a')](),{'type':db[_0xc692('0x67')]['QueryTypes'][_0xc692('0x7b')]})['then'](function(_0x505e26){if(_0x505e26[_0xc692('0x3a')]===0x1){return _0xc04fc2['id'];}else{var _0x14f5e9=_[_0xc692('0x7c')](_[_0xc692('0x34')](_0x505e26,_0xc692('0x7d')),function(_0x155d2c){return _[_0xc692('0x7e')](_0x53e29f,_0x155d2c);});if(_0x14f5e9){return _0xc04fc2['id'];}}}));}}return BPromise['all'](_0x3ee5dd)['then'](function(_0xb22946){_0x55ebc7=_(_0x55ebc7)[_0xc692('0x7f')](_0xb22946)[_0xc692('0x80')]()[_0xc692('0x81')]();return db['FaxQueue'][_0xc692('0x4c')]({'where':{'id':_0x444a99[_0xc692('0x52')]['id']}})['then'](function(_0x56103e){return db[_0xc692('0x67')][_0xc692('0x68')](function(_0x1dcb4a){return _0x56103e[_0xc692('0x6e')](_0x444a99[_0xc692('0x35')][_0xc692('0x82')],{'transaction':_0x1dcb4a})[_0xc692('0x29')](function(){if(!_['isEmpty'](_0x55ebc7)){return _0x56103e[_0xc692('0x83')](_0x55ebc7,{'transaction':_0x1dcb4a});}})[_0xc692('0x29')](function(){_0x55ebc7[_0xc692('0x6b')](function(_0x8d5e48){socket[_0xc692('0x6c')](_0xc692('0x84'),{'UserId':_0x8d5e48,'FaxQueueId':_0x56103e['id']});});});});});});})[_0xc692('0x29')](respondWithStatusCode(_0x562cda,null))['catch'](handleError(_0x562cda,null));};exports[_0xc692('0x85')]=function(_0x581229,_0x3d19ad,_0x50b9bc){return db[_0xc692('0x31')]['find']({'where':{'id':_0x581229['params']['id']}})[_0xc692('0x29')](handleEntityNotFound(_0x3d19ad,null))[_0xc692('0x29')](function(_0x353c52){if(_0x353c52){return _0x353c52[_0xc692('0x85')](_0x581229[_0xc692('0x4e')][_0xc692('0x82')],_['omit'](_0x581229[_0xc692('0x4e')],['ids','id'])||{})[_0xc692('0x86')](function(_0x4dacb4){for(var _0x16b4bb=0x0;_0x16b4bb<_0x581229[_0xc692('0x4e')][_0xc692('0x82')]['length'];_0x16b4bb+=0x1){socket[_0xc692('0x6c')]('userFaxQueue:save',{'UserId':Number(_0x581229['body'][_0xc692('0x82')][_0x16b4bb]),'FaxQueueId':Number(_0x581229[_0xc692('0x52')]['id'])});}return _0x4dacb4;});}})[_0xc692('0x29')](respondWithResult(_0x3d19ad,null))[_0xc692('0x48')](handleError(_0x3d19ad,null));};exports[_0xc692('0x83')]=function(_0x4adb49,_0x40b792,_0x187214){return db[_0xc692('0x31')]['find']({'where':{'id':_0x4adb49[_0xc692('0x52')]['id']}})[_0xc692('0x29')](handleEntityNotFound(_0x40b792,null))[_0xc692('0x29')](function(_0x35e234){if(_0x35e234){return _0x35e234['removeAgents'](_0x4adb49[_0xc692('0x35')][_0xc692('0x82')])[_0xc692('0x29')](function(){if(_[_0xc692('0x87')](_0x4adb49[_0xc692('0x35')][_0xc692('0x82')])){for(var _0x329375=0x0;_0x329375<_0x4adb49[_0xc692('0x35')][_0xc692('0x82')][_0xc692('0x3a')];_0x329375+=0x1){socket[_0xc692('0x6c')](_0xc692('0x84'),{'UserId':Number(_0x4adb49[_0xc692('0x35')][_0xc692('0x82')][_0x329375]),'FaxQueueId':Number(_0x4adb49[_0xc692('0x52')]['id'])});}}else{socket['emit'](_0xc692('0x84'),{'UserId':Number(_0x4adb49[_0xc692('0x35')][_0xc692('0x82')]),'FaxQueueId':Number(_0x4adb49['params']['id'])});}});}})[_0xc692('0x29')](respondWithStatusCode(_0x40b792,null))[_0xc692('0x48')](handleError(_0x40b792,null));};exports[_0xc692('0x88')]=function(_0x4a3c2c,_0xeb12e0,_0x54e42f){var _0x11c13e={};var _0x13550c={};var _0x3d360c;var _0x2c9924;return db['FaxQueue'][_0xc692('0x60')]({'where':{'id':_0x4a3c2c['params']['id']}})[_0xc692('0x29')](handleEntityNotFound(_0xeb12e0,null))[_0xc692('0x29')](function(_0x32ee84){if(_0x32ee84){_0x3d360c=_0x32ee84;_0x13550c[_0xc692('0x33')]=_[_0xc692('0x36')](db[_0xc692('0x6f')]['rawAttributes']);_0x13550c[_0xc692('0x35')]=_['keys'](_0x4a3c2c[_0xc692('0x35')]);_0x13550c[_0xc692('0x40')]=_[_0xc692('0x37')](_0x13550c['model'],_0x13550c['query']);_0x11c13e[_0xc692('0x39')]=_[_0xc692('0x37')](_0x13550c[_0xc692('0x33')],qs['fields'](_0x4a3c2c[_0xc692('0x35')]['fields']));_0x11c13e[_0xc692('0x39')]=_0x11c13e[_0xc692('0x39')]['length']?_0x11c13e[_0xc692('0x39')]:_0x13550c[_0xc692('0x33')];_0x11c13e[_0xc692('0x3d')]=qs[_0xc692('0x3e')](_0x4a3c2c[_0xc692('0x35')][_0xc692('0x3e')]);_0x11c13e['where']=qs[_0xc692('0x40')](_[_0xc692('0x41')](_0x4a3c2c[_0xc692('0x35')],_0x13550c['filters']));if(_0x4a3c2c[_0xc692('0x35')][_0xc692('0x42')]){_0x11c13e[_0xc692('0x3f')]=_[_0xc692('0x43')](_0x11c13e[_0xc692('0x3f')],{'$or':_[_0xc692('0x34')](_0x11c13e[_0xc692('0x39')],function(_0xb35422){var _0x4b5046={};_0x4b5046[_0xb35422]={'$like':'%'+_0x4a3c2c[_0xc692('0x35')][_0xc692('0x42')]+'%'};return _0x4b5046;})});}_0x11c13e=_[_0xc692('0x43')]({},_0x11c13e,_0x4a3c2c[_0xc692('0x4b')]);return _0x3d360c['getAgents'](_0x11c13e);}})[_0xc692('0x29')](function(_0x552e81){if(_0x552e81){_0x2c9924=_0x552e81[_0xc692('0x3a')];if(!_0x4a3c2c['query'][_0xc692('0x3b')](_0xc692('0x3c'))){_0x11c13e[_0xc692('0x21')]=qs['limit'](_0x4a3c2c[_0xc692('0x35')][_0xc692('0x21')]);_0x11c13e[_0xc692('0x1f')]=qs[_0xc692('0x1f')](_0x4a3c2c['query'][_0xc692('0x1f')]);}return _0x3d360c[_0xc692('0x88')](_0x11c13e);}})[_0xc692('0x29')](function(_0x4f1def){if(_0x4f1def){return _0x4f1def?{'count':_0x2c9924,'rows':_0x4f1def}:null;}})['then'](respondWithResult(_0xeb12e0,null))[_0xc692('0x48')](handleError(_0xeb12e0,null));}; \ No newline at end of file +var _0xfe9b=['forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','UserProfileResource','error','stack','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','VIRTUAL','filter','merge','FaxQueue','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','catch','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','findOrCreate'];(function(_0x18295b,_0x1c0aea){var _0x59890b=function(_0x1ff845){while(--_0x1ff845){_0x18295b['push'](_0x18295b['shift']());}};_0x59890b(++_0x1c0aea);}(_0xfe9b,0x1d9));var _0xbfe9=function(_0x133c71,_0x5681a2){_0x133c71=_0x133c71-0x0;var _0x3a25b3=_0xfe9b[_0x133c71];return _0x3a25b3;};'use strict';var emlformat=require(_0xbfe9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbfe9('0x1'));var jsonpatch=require(_0xbfe9('0x2'));var rp=require(_0xbfe9('0x3'));var moment=require(_0xbfe9('0x4'));var BPromise=require(_0xbfe9('0x5'));var Mustache=require(_0xbfe9('0x6'));var util=require(_0xbfe9('0x7'));var path=require(_0xbfe9('0x8'));var sox=require(_0xbfe9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfe9('0xa'));var _=require('lodash');var squel=require(_0xbfe9('0xb'));var crypto=require('crypto');var jsforce=require(_0xbfe9('0xc'));var deskjs=require(_0xbfe9('0xd'));var toCsv=require(_0xbfe9('0xe'));var querystring=require(_0xbfe9('0xf'));var Papa=require(_0xbfe9('0x10'));var Redis=require(_0xbfe9('0x11'));var authService=require(_0xbfe9('0x12'));var qs=require(_0xbfe9('0x13'));var as=require(_0xbfe9('0x14'));var hardwareService=require(_0xbfe9('0x15'));var logger=require(_0xbfe9('0x16'))(_0xbfe9('0x17'));var utils=require(_0xbfe9('0x18'));var config=require(_0xbfe9('0x19'));var licenseUtil=require(_0xbfe9('0x1a'));var db=require(_0xbfe9('0x1b'))['db'];config[_0xbfe9('0x1c')]=_[_0xbfe9('0x1d')](config[_0xbfe9('0x1c')],{'host':_0xbfe9('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfe9('0x1c')]));require(_0xbfe9('0x1f'))[_0xbfe9('0x20')](socket);function respondWithStatusCode(_0x1e4d40,_0x1c64c4){_0x1c64c4=_0x1c64c4||0xcc;return function(_0x2a9e1d){if(_0x2a9e1d){return _0x1e4d40[_0xbfe9('0x21')](_0x1c64c4);}return _0x1e4d40[_0xbfe9('0x22')](_0x1c64c4)[_0xbfe9('0x23')]();};}function respondWithResult(_0x50f4c0,_0x252501){_0x252501=_0x252501||0xc8;return function(_0x2cbcde){if(_0x2cbcde){return _0x50f4c0[_0xbfe9('0x22')](_0x252501)['json'](_0x2cbcde);}};}function respondWithFilteredResult(_0x19fff6,_0x4b1178){return function(_0x41f664){if(_0x41f664){var _0x569287=typeof _0x4b1178['offset']===_0xbfe9('0x24')&&typeof _0x4b1178[_0xbfe9('0x25')]===_0xbfe9('0x24');var _0x46f0ae=_0x41f664[_0xbfe9('0x26')];var _0x9e1ec8=_0x569287?0x0:_0x4b1178['offset'];var _0x3a14c8=_0x569287?_0x41f664['count']:_0x4b1178['offset']+_0x4b1178[_0xbfe9('0x25')];var _0x22df4c;if(_0x3a14c8>=_0x46f0ae){_0x3a14c8=_0x46f0ae;_0x22df4c=0xc8;}else{_0x22df4c=0xce;}_0x19fff6[_0xbfe9('0x22')](_0x22df4c);return _0x19fff6[_0xbfe9('0x27')](_0xbfe9('0x28'),_0x9e1ec8+'-'+_0x3a14c8+'/'+_0x46f0ae)[_0xbfe9('0x29')](_0x41f664);}return null;};}function patchUpdates(_0x4a6e20){return function(_0x56aa7b){try{jsonpatch[_0xbfe9('0x2a')](_0x56aa7b,_0x4a6e20,!![]);}catch(_0x541f08){return BPromise['reject'](_0x541f08);}return _0x56aa7b['save']();};}function saveUpdates(_0x2be4ee,_0x38d163){return function(_0x48b891){if(_0x48b891){return _0x48b891[_0xbfe9('0x2b')](_0x2be4ee)[_0xbfe9('0x2c')](function(_0x25b47e){return _0x25b47e;});}return null;};}function removeEntity(_0x104afd,_0x399f49){return function(_0x27919d){if(_0x27919d){return _0x27919d[_0xbfe9('0x2d')]()[_0xbfe9('0x2c')](function(){var _0x409a35=_0x27919d[_0xbfe9('0x2e')]({'plain':!![]});var _0x1f83a0='FaxQueues';return db[_0xbfe9('0x2f')][_0xbfe9('0x2d')]({'where':{'type':_0x1f83a0,'resourceId':_0x409a35['id']}})['then'](function(){return _0x27919d;});})[_0xbfe9('0x2c')](function(){_0x104afd[_0xbfe9('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aa3ca,_0x422f69){return function(_0x35600e){if(!_0x35600e){_0x1aa3ca[_0xbfe9('0x21')](0x194);}return _0x35600e;};}function handleError(_0x5865c1,_0x4628f2){_0x4628f2=_0x4628f2||0x1f4;return function(_0x16c116){logger[_0xbfe9('0x30')](_0x16c116[_0xbfe9('0x31')]);if(_0x16c116['name']){delete _0x16c116['name'];}_0x5865c1[_0xbfe9('0x22')](_0x4628f2)['send'](_0x16c116);};}exports[_0xbfe9('0x32')]=function(_0x26ec33,_0x96b588){var _0x9baab3={},_0x1562ed={},_0x455a1e={'count':0x0,'rows':[]};var _0x33dd12=_[_0xbfe9('0x33')](db['FaxQueue']['rawAttributes'],function(_0x43fd59){return{'name':_0x43fd59[_0xbfe9('0x34')],'type':_0x43fd59[_0xbfe9('0x35')][_0xbfe9('0x36')]};});_0x1562ed[_0xbfe9('0x37')]=_[_0xbfe9('0x33')](_0x33dd12,_0xbfe9('0x38'));_0x1562ed[_0xbfe9('0x39')]=_[_0xbfe9('0x3a')](_0x26ec33['query']);_0x1562ed[_0xbfe9('0x3b')]=_[_0xbfe9('0x3c')](_0x1562ed[_0xbfe9('0x37')],_0x1562ed[_0xbfe9('0x39')]);_0x9baab3['attributes']=_[_0xbfe9('0x3c')](_0x1562ed[_0xbfe9('0x37')],qs[_0xbfe9('0x3d')](_0x26ec33[_0xbfe9('0x39')][_0xbfe9('0x3d')]));_0x9baab3[_0xbfe9('0x3e')]=_0x9baab3[_0xbfe9('0x3e')][_0xbfe9('0x3f')]?_0x9baab3[_0xbfe9('0x3e')]:_0x1562ed['model'];if(!_0x26ec33[_0xbfe9('0x39')][_0xbfe9('0x40')](_0xbfe9('0x41'))){_0x9baab3[_0xbfe9('0x25')]=qs['limit'](_0x26ec33[_0xbfe9('0x39')][_0xbfe9('0x25')]);_0x9baab3[_0xbfe9('0x42')]=qs['offset'](_0x26ec33['query'][_0xbfe9('0x42')]);}_0x9baab3[_0xbfe9('0x43')]=qs[_0xbfe9('0x44')](_0x26ec33[_0xbfe9('0x39')][_0xbfe9('0x44')]);_0x9baab3[_0xbfe9('0x45')]=qs[_0xbfe9('0x3b')](_[_0xbfe9('0x46')](_0x26ec33[_0xbfe9('0x39')],_0x1562ed[_0xbfe9('0x3b')]),_0x33dd12);if(_0x26ec33[_0xbfe9('0x39')]['filter']){_0x9baab3[_0xbfe9('0x45')]=_['merge'](_0x9baab3['where'],{'$or':_[_0xbfe9('0x33')](_0x33dd12,function(_0x184283){if(_0x184283['type']!==_0xbfe9('0x47')){var _0x11b527={};_0x11b527[_0x184283[_0xbfe9('0x38')]]={'$like':'%'+_0x26ec33[_0xbfe9('0x39')][_0xbfe9('0x48')]+'%'};return _0x11b527;}})});}_0x9baab3=_[_0xbfe9('0x49')]({},_0x9baab3,_0x26ec33['options']);var _0xce6978={'where':_0x9baab3[_0xbfe9('0x45')]};return db[_0xbfe9('0x4a')][_0xbfe9('0x26')](_0xce6978)[_0xbfe9('0x2c')](function(_0x25e494){_0x455a1e[_0xbfe9('0x26')]=_0x25e494;if(_0x26ec33[_0xbfe9('0x39')][_0xbfe9('0x4b')]){_0x9baab3[_0xbfe9('0x4c')]=[{'all':!![]}];}return db[_0xbfe9('0x4a')][_0xbfe9('0x4d')](_0x9baab3);})[_0xbfe9('0x2c')](function(_0x3dab8a){_0x455a1e[_0xbfe9('0x4e')]=_0x3dab8a;return _0x455a1e;})['then'](respondWithFilteredResult(_0x96b588,_0x9baab3))['catch'](handleError(_0x96b588,null));};exports[_0xbfe9('0x4f')]=function(_0x5a7396,_0x53f634){var _0x1f40df={'raw':!![],'where':{'id':_0x5a7396[_0xbfe9('0x50')]['id']}},_0x3df60b={};_0x3df60b['model']=_[_0xbfe9('0x3a')](db[_0xbfe9('0x4a')][_0xbfe9('0x51')]);_0x3df60b['query']=_[_0xbfe9('0x3a')](_0x5a7396['query']);_0x3df60b[_0xbfe9('0x3b')]=_[_0xbfe9('0x3c')](_0x3df60b['model'],_0x3df60b[_0xbfe9('0x39')]);_0x1f40df[_0xbfe9('0x3e')]=_['intersection'](_0x3df60b['model'],qs[_0xbfe9('0x3d')](_0x5a7396[_0xbfe9('0x39')][_0xbfe9('0x3d')]));_0x1f40df['attributes']=_0x1f40df[_0xbfe9('0x3e')][_0xbfe9('0x3f')]?_0x1f40df[_0xbfe9('0x3e')]:_0x3df60b[_0xbfe9('0x37')];if(_0x5a7396[_0xbfe9('0x39')][_0xbfe9('0x4b')]){_0x1f40df['include']=[{'all':!![]}];}_0x1f40df=_['merge']({},_0x1f40df,_0x5a7396[_0xbfe9('0x52')]);return db[_0xbfe9('0x4a')][_0xbfe9('0x53')](_0x1f40df)[_0xbfe9('0x2c')](handleEntityNotFound(_0x53f634,null))['then'](respondWithResult(_0x53f634,null))['catch'](handleError(_0x53f634,null));};exports[_0xbfe9('0x54')]=function(_0x241b50,_0x20a13b){return db[_0xbfe9('0x4a')]['create'](_0x241b50[_0xbfe9('0x55')],{})['then'](function(_0x76a5a9){var _0x1d3486=_0x241b50[_0xbfe9('0x56')][_0xbfe9('0x2e')]({'plain':!![]});if(!_0x1d3486)throw new Error(_0xbfe9('0x57'));if(_0x1d3486[_0xbfe9('0x58')]==='user'){var _0x5d9c3f=_0x76a5a9[_0xbfe9('0x2e')]({'plain':!![]});var _0x10b0b6=_0xbfe9('0x59');return db[_0xbfe9('0x5a')][_0xbfe9('0x53')]({'where':{'name':_0x10b0b6,'userProfileId':_0x1d3486[_0xbfe9('0x5b')]},'raw':!![]})[_0xbfe9('0x2c')](function(_0x5a5bbe){if(_0x5a5bbe&&_0x5a5bbe[_0xbfe9('0x5c')]===0x0){return db[_0xbfe9('0x2f')][_0xbfe9('0x54')]({'name':_0x5d9c3f[_0xbfe9('0x38')],'resourceId':_0x5d9c3f['id'],'type':_0x5a5bbe[_0xbfe9('0x38')],'sectionId':_0x5a5bbe['id']},{})[_0xbfe9('0x2c')](function(){return _0x76a5a9;});}else{return _0x76a5a9;}})[_0xbfe9('0x5d')](function(_0x14cdc0){logger[_0xbfe9('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14cdc0);throw _0x14cdc0;});}return _0x76a5a9;})['then'](respondWithResult(_0x20a13b,0xc9))[_0xbfe9('0x5d')](handleError(_0x20a13b,null));};exports[_0xbfe9('0x2b')]=function(_0x237ad5,_0x235b9b){if(_0x237ad5[_0xbfe9('0x55')]['id']){delete _0x237ad5[_0xbfe9('0x55')]['id'];}return db[_0xbfe9('0x4a')][_0xbfe9('0x53')]({'where':{'id':_0x237ad5[_0xbfe9('0x50')]['id']}})[_0xbfe9('0x2c')](handleEntityNotFound(_0x235b9b,null))[_0xbfe9('0x2c')](saveUpdates(_0x237ad5[_0xbfe9('0x55')],null))[_0xbfe9('0x2c')](respondWithResult(_0x235b9b,null))[_0xbfe9('0x5d')](handleError(_0x235b9b,null));};exports[_0xbfe9('0x2d')]=function(_0x3c84c1,_0x466a3f){return db[_0xbfe9('0x4a')][_0xbfe9('0x53')]({'where':{'id':_0x3c84c1[_0xbfe9('0x50')]['id']}})['then'](handleEntityNotFound(_0x466a3f,null))['then'](removeEntity(_0x466a3f,null))['catch'](handleError(_0x466a3f,null));};exports[_0xbfe9('0x5e')]=function(_0x1ab924,_0x25e3d3){return db[_0xbfe9('0x4a')][_0xbfe9('0x5e')]()[_0xbfe9('0x2c')](respondWithResult(_0x25e3d3,null))[_0xbfe9('0x5d')](handleError(_0x25e3d3,null));};exports[_0xbfe9('0x5f')]=function(_0x38c56b,_0xb0831,_0x277052){var _0x481117={'raw':!![],'where':{}},_0x16393b={},_0x52a585;return db['FaxQueue'][_0xbfe9('0x60')]({'where':{'id':_0x38c56b[_0xbfe9('0x50')]['id']}})[_0xbfe9('0x2c')](handleEntityNotFound(_0xb0831,null))[_0xbfe9('0x2c')](function(_0x521911){if(_0x521911){_0x52a585=_0x521911[_0xbfe9('0x2e')]({'plain':!![]});_0x16393b['model']=_[_0xbfe9('0x3a')](db[_0xbfe9('0x61')][_0xbfe9('0x51')]);_0x16393b['query']=_[_0xbfe9('0x3a')](_0x38c56b[_0xbfe9('0x39')]);_0x16393b[_0xbfe9('0x3b')]=_[_0xbfe9('0x3c')](_0x16393b[_0xbfe9('0x37')],_0x16393b[_0xbfe9('0x39')]);_0x481117[_0xbfe9('0x3e')]=_[_0xbfe9('0x3c')](_0x16393b['model'],qs[_0xbfe9('0x3d')](_0x38c56b[_0xbfe9('0x39')][_0xbfe9('0x3d')]));_0x481117[_0xbfe9('0x3e')]=_0x481117[_0xbfe9('0x3e')]['length']?_0x481117['attributes']:_0x16393b[_0xbfe9('0x37')];if(!_0x38c56b[_0xbfe9('0x39')][_0xbfe9('0x40')]('nolimit')){_0x481117[_0xbfe9('0x25')]=qs[_0xbfe9('0x25')](_0x38c56b[_0xbfe9('0x39')]['limit']);_0x481117[_0xbfe9('0x42')]=qs['offset'](_0x38c56b['query'][_0xbfe9('0x42')]);}_0x481117['order']=qs[_0xbfe9('0x44')](_0x38c56b[_0xbfe9('0x39')][_0xbfe9('0x44')]);_0x481117[_0xbfe9('0x45')]=qs[_0xbfe9('0x3b')](_[_0xbfe9('0x46')](_0x38c56b['query'],_0x16393b[_0xbfe9('0x3b')]));_0x481117[_0xbfe9('0x45')][_0xbfe9('0x62')]=_0x521911['id'];if(_0x38c56b[_0xbfe9('0x39')][_0xbfe9('0x48')]){_0x481117[_0xbfe9('0x45')]=_[_0xbfe9('0x49')](_0x481117['where'],{'$or':_[_0xbfe9('0x33')](_0x481117[_0xbfe9('0x3e')],function(_0x9bd506){var _0x50f618={};_0x50f618[_0x9bd506]={'$like':'%'+_0x38c56b[_0xbfe9('0x39')][_0xbfe9('0x48')]+'%'};return _0x50f618;})});}_0x481117=_[_0xbfe9('0x49')]({},_0x481117,_0x38c56b[_0xbfe9('0x52')]);return db[_0xbfe9('0x61')][_0xbfe9('0x4d')](_0x481117);}})[_0xbfe9('0x2c')](function(_0x551786){if(_0x551786){return db['User'][_0xbfe9('0x63')]({'where':{'id':_[_0xbfe9('0x33')](_0x551786,_0xbfe9('0x64')),'role':_0xbfe9('0x65')},'attributes':['id','name',_0xbfe9('0x66'),_0xbfe9('0x67'),_0xbfe9('0x68')]});}})['then'](function(_0x31faa8){if(_0x31faa8){return{'count':_0x31faa8[_0xbfe9('0x26')],'rows':_[_0xbfe9('0x33')](_0x31faa8[_0xbfe9('0x4e')],function(_0x1e9b36){return{'membername':_0x1e9b36[_0xbfe9('0x38')],'UserId':_0x1e9b36['id'],'queue_name':_0x52a585[_0xbfe9('0x38')],'FaxQueueId':_0x52a585['id'],'interface':util[_0xbfe9('0x69')](_0xbfe9('0x6a'),_0xbfe9('0x6b'),_0x1e9b36[_0xbfe9('0x38')]),'penalty':0x0,'paused':_0x1e9b36['faxPause'],'createdAt':_0x1e9b36['createdAt'],'updatedAt':_0x1e9b36[_0xbfe9('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbfe9('0x2c')](respondWithFilteredResult(_0xb0831,_0x481117))['catch'](handleError(_0xb0831,null));};exports[_0xbfe9('0x6c')]=function(_0x49103c,_0x243e33,_0x403181){var _0x2ee7dc={};var _0x2ffb04={};var _0x5c6bbe;var _0x292a83;return db[_0xbfe9('0x4a')][_0xbfe9('0x60')]({'where':{'id':_0x49103c[_0xbfe9('0x50')]['id']}})['then'](handleEntityNotFound(_0x243e33,null))[_0xbfe9('0x2c')](function(_0x27037a){if(_0x27037a){_0x5c6bbe=_0x27037a;_0x2ffb04[_0xbfe9('0x37')]=_[_0xbfe9('0x3a')](db[_0xbfe9('0x6d')][_0xbfe9('0x51')]);_0x2ffb04[_0xbfe9('0x39')]=_[_0xbfe9('0x3a')](_0x49103c[_0xbfe9('0x39')]);_0x2ffb04[_0xbfe9('0x3b')]=_[_0xbfe9('0x3c')](_0x2ffb04[_0xbfe9('0x37')],_0x2ffb04[_0xbfe9('0x39')]);_0x2ee7dc[_0xbfe9('0x3e')]=_[_0xbfe9('0x3c')](_0x2ffb04[_0xbfe9('0x37')],qs[_0xbfe9('0x3d')](_0x49103c['query'][_0xbfe9('0x3d')]));_0x2ee7dc[_0xbfe9('0x3e')]=_0x2ee7dc[_0xbfe9('0x3e')][_0xbfe9('0x3f')]?_0x2ee7dc[_0xbfe9('0x3e')]:_0x2ffb04[_0xbfe9('0x37')];_0x2ee7dc['order']=qs['sort'](_0x49103c[_0xbfe9('0x39')][_0xbfe9('0x44')]);_0x2ee7dc['where']=qs[_0xbfe9('0x3b')](_['pick'](_0x49103c['query'],_0x2ffb04[_0xbfe9('0x3b')]));if(_0x49103c['query'][_0xbfe9('0x48')]){_0x2ee7dc[_0xbfe9('0x45')]=_[_0xbfe9('0x49')](_0x2ee7dc[_0xbfe9('0x45')],{'$or':_['map'](_0x2ee7dc[_0xbfe9('0x3e')],function(_0x50c6e9){var _0x443fd1={};_0x443fd1[_0x50c6e9]={'$like':'%'+_0x49103c[_0xbfe9('0x39')][_0xbfe9('0x48')]+'%'};return _0x443fd1;})});}_0x2ee7dc=_[_0xbfe9('0x49')]({},_0x2ee7dc,_0x49103c['options']);return _0x5c6bbe[_0xbfe9('0x6c')](_0x2ee7dc);}})[_0xbfe9('0x2c')](function(_0x228766){if(_0x228766){_0x292a83=_0x228766[_0xbfe9('0x3f')];if(!_0x49103c['query'][_0xbfe9('0x40')]('nolimit')){_0x2ee7dc['limit']=qs[_0xbfe9('0x25')](_0x49103c[_0xbfe9('0x39')][_0xbfe9('0x25')]);_0x2ee7dc[_0xbfe9('0x42')]=qs[_0xbfe9('0x42')](_0x49103c[_0xbfe9('0x39')]['offset']);}return _0x5c6bbe[_0xbfe9('0x6c')](_0x2ee7dc);}})[_0xbfe9('0x2c')](function(_0x420887){if(_0x420887){return _0x420887?{'count':_0x292a83,'rows':_0x420887}:null;}})['then'](respondWithResult(_0x243e33,null))[_0xbfe9('0x5d')](handleError(_0x243e33,null));};exports[_0xbfe9('0x6e')]=function(_0x63ff82,_0x40fc66,_0x161f6b){var _0x3888dc=_0x63ff82[_0xbfe9('0x55')][_0xbfe9('0x6f')];return db[_0xbfe9('0x6d')][_0xbfe9('0x4d')]({'where':{'id':_0x3888dc},'attributes':['id'],'include':[{'model':db[_0xbfe9('0x70')],'as':_0xbfe9('0x71'),'attributes':['id',_0xbfe9('0x38'),_0xbfe9('0x72'),'voicePause',_0xbfe9('0x73')],'raw':!![]}]})[_0xbfe9('0x2c')](function(_0x2b403b){if(_0x2b403b){var _0xbf5a67=_[_0xbfe9('0x74')](_0x2b403b,function(_0x39ac92){var _0x455516=_0x39ac92[_0xbfe9('0x2e')]({'plain':!![]});return _0x455516[_0xbfe9('0x71')];});return db['FaxQueue'][_0xbfe9('0x53')]({'where':{'id':_0x63ff82[_0xbfe9('0x50')]['id']}})['then'](function(_0x4d03b1){return db[_0xbfe9('0x75')]['transaction'](function(_0x5a03ae){return _0x4d03b1[_0xbfe9('0x6e')](_0x3888dc,{'transaction':_0x5a03ae})[_0xbfe9('0x2c')](function(){return BPromise['each'](_0xbf5a67,function(_0x11a8ac){return db['UserFaxQueue'][_0xbfe9('0x76')]({'where':{'UserId':_0x11a8ac['id'],'FaxQueueId':_0x63ff82[_0xbfe9('0x50')]['id']},'transaction':_0x5a03ae});});})['then'](function(){_0xbf5a67[_0xbfe9('0x77')](function(_0x1e9071){socket[_0xbfe9('0x78')](_0xbfe9('0x79'),{'UserId':_0x1e9071['id'],'FaxQueueId':_0x4d03b1['id']});});});});});}})['then'](respondWithStatusCode(_0x40fc66,null))['catch'](handleError(_0x40fc66,null));};exports[_0xbfe9('0x7a')]=function(_0x331c56,_0x3a7a51,_0x54704d){return db[_0xbfe9('0x6d')][_0xbfe9('0x4d')]({'where':{'id':_0x331c56[_0xbfe9('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbfe9('0x70')],'as':_0xbfe9('0x71'),'attributes':['id'],'raw':!![]}]})[_0xbfe9('0x2c')](handleEntityNotFound(_0x3a7a51,null))['then'](function(_0x2bcad4){var _0x429e2e=_[_0xbfe9('0x33')](_0x2bcad4,'id');var _0x564113=[];var _0x2c501a=[];var _0x26d867=squel['select']();_0x26d867[_0xbfe9('0x7b')](_0xbfe9('0x7c'))[_0xbfe9('0x7d')]('team_has_fax_queues','tq')[_0xbfe9('0x7e')]('user_has_teams','ut',_0xbfe9('0x7f'))['where'](_0xbfe9('0x80'),_0x331c56['params']['id']);for(var _0x30bf20=0x0;_0x30bf20<_0x2bcad4[_0xbfe9('0x3f')];_0x30bf20+=0x1){let _0x587ea4=_0x2bcad4[_0x30bf20];for(var _0x51706c=0x0;_0x51706c<_0x587ea4['Agents'][_0xbfe9('0x3f')];_0x51706c+=0x1){let _0x2fdbc9=_0x587ea4[_0xbfe9('0x71')][_0x51706c];var _0x2a9654=_0x26d867[_0xbfe9('0x81')]();_0x2a9654[_0xbfe9('0x45')](_0xbfe9('0x82'),_0x2fdbc9['id']);_0x2c501a['push'](db['sequelize'][_0xbfe9('0x39')](_0x2a9654['toString'](),{'type':db[_0xbfe9('0x75')][_0xbfe9('0x83')][_0xbfe9('0x84')]})[_0xbfe9('0x2c')](function(_0xdc6b5){if(_0xdc6b5[_0xbfe9('0x3f')]===0x1){return _0x2fdbc9['id'];}else{var _0x37b60c=_[_0xbfe9('0x85')](_[_0xbfe9('0x33')](_0xdc6b5,_0xbfe9('0x86')),function(_0x1c8232){return _[_0xbfe9('0x87')](_0x429e2e,_0x1c8232);});if(_0x37b60c){return _0x2fdbc9['id'];}}}));}}return BPromise[_0xbfe9('0x88')](_0x2c501a)[_0xbfe9('0x2c')](function(_0x59183a){_0x564113=_(_0x564113)[_0xbfe9('0x89')](_0x59183a)['compact']()[_0xbfe9('0x8a')]();return db['FaxQueue'][_0xbfe9('0x53')]({'where':{'id':_0x331c56[_0xbfe9('0x50')]['id']}})['then'](function(_0x22f038){return db[_0xbfe9('0x75')][_0xbfe9('0x8b')](function(_0x5095cb){return _0x22f038['removeTeams'](_0x331c56[_0xbfe9('0x39')][_0xbfe9('0x6f')],{'transaction':_0x5095cb})[_0xbfe9('0x2c')](function(){if(!_[_0xbfe9('0x8c')](_0x564113)){return _0x22f038[_0xbfe9('0x8d')](_0x564113,{'transaction':_0x5095cb});}})[_0xbfe9('0x2c')](function(){_0x564113[_0xbfe9('0x77')](function(_0x4781e3){socket[_0xbfe9('0x78')](_0xbfe9('0x8e'),{'UserId':_0x4781e3,'FaxQueueId':_0x22f038['id']});});});});});});})[_0xbfe9('0x2c')](respondWithStatusCode(_0x3a7a51,null))[_0xbfe9('0x5d')](handleError(_0x3a7a51,null));};exports['addAgents']=function(_0x57b9ee,_0x2251bf,_0x228c23){return db[_0xbfe9('0x4a')][_0xbfe9('0x53')]({'where':{'id':_0x57b9ee[_0xbfe9('0x50')]['id']}})[_0xbfe9('0x2c')](handleEntityNotFound(_0x2251bf,null))['then'](function(_0x4905bc){if(_0x4905bc){return _0x4905bc[_0xbfe9('0x8f')](_0x57b9ee[_0xbfe9('0x55')][_0xbfe9('0x6f')],_[_0xbfe9('0x90')](_0x57b9ee[_0xbfe9('0x55')],[_0xbfe9('0x6f'),'id'])||{})[_0xbfe9('0x91')](function(_0x464324){for(var _0x13605e=0x0;_0x13605e<_0x57b9ee[_0xbfe9('0x55')][_0xbfe9('0x6f')]['length'];_0x13605e+=0x1){socket[_0xbfe9('0x78')](_0xbfe9('0x79'),{'UserId':Number(_0x57b9ee['body']['ids'][_0x13605e]),'FaxQueueId':Number(_0x57b9ee[_0xbfe9('0x50')]['id'])});}return _0x464324;});}})['then'](respondWithResult(_0x2251bf,null))[_0xbfe9('0x5d')](handleError(_0x2251bf,null));};exports['removeAgents']=function(_0x4c5c2c,_0x3eddd0,_0xca66f2){return db['FaxQueue'][_0xbfe9('0x53')]({'where':{'id':_0x4c5c2c['params']['id']}})['then'](handleEntityNotFound(_0x3eddd0,null))[_0xbfe9('0x2c')](function(_0x5399ac){if(_0x5399ac){return _0x5399ac[_0xbfe9('0x8d')](_0x4c5c2c[_0xbfe9('0x39')][_0xbfe9('0x6f')])['then'](function(){if(_[_0xbfe9('0x92')](_0x4c5c2c[_0xbfe9('0x39')][_0xbfe9('0x6f')])){for(var _0x34a6ce=0x0;_0x34a6ce<_0x4c5c2c[_0xbfe9('0x39')][_0xbfe9('0x6f')][_0xbfe9('0x3f')];_0x34a6ce+=0x1){socket[_0xbfe9('0x78')]('userFaxQueue:remove',{'UserId':Number(_0x4c5c2c[_0xbfe9('0x39')][_0xbfe9('0x6f')][_0x34a6ce]),'FaxQueueId':Number(_0x4c5c2c['params']['id'])});}}else{socket[_0xbfe9('0x78')](_0xbfe9('0x8e'),{'UserId':Number(_0x4c5c2c[_0xbfe9('0x39')]['ids']),'FaxQueueId':Number(_0x4c5c2c[_0xbfe9('0x50')]['id'])});}});}})[_0xbfe9('0x2c')](respondWithStatusCode(_0x3eddd0,null))['catch'](handleError(_0x3eddd0,null));};exports[_0xbfe9('0x93')]=function(_0x34fb2f,_0x2b2a84,_0x45a314){var _0x2a4ae8={};var _0xe9c24b={};var _0x24e4e4;var _0x348612;return db[_0xbfe9('0x4a')][_0xbfe9('0x60')]({'where':{'id':_0x34fb2f[_0xbfe9('0x50')]['id']}})[_0xbfe9('0x2c')](handleEntityNotFound(_0x2b2a84,null))['then'](function(_0x13848c){if(_0x13848c){_0x24e4e4=_0x13848c;_0xe9c24b[_0xbfe9('0x37')]=_[_0xbfe9('0x3a')](db[_0xbfe9('0x70')][_0xbfe9('0x51')]);_0xe9c24b['query']=_[_0xbfe9('0x3a')](_0x34fb2f[_0xbfe9('0x39')]);_0xe9c24b['filters']=_['intersection'](_0xe9c24b[_0xbfe9('0x37')],_0xe9c24b[_0xbfe9('0x39')]);_0x2a4ae8[_0xbfe9('0x3e')]=_[_0xbfe9('0x3c')](_0xe9c24b[_0xbfe9('0x37')],qs[_0xbfe9('0x3d')](_0x34fb2f[_0xbfe9('0x39')][_0xbfe9('0x3d')]));_0x2a4ae8[_0xbfe9('0x3e')]=_0x2a4ae8[_0xbfe9('0x3e')]['length']?_0x2a4ae8['attributes']:_0xe9c24b[_0xbfe9('0x37')];_0x2a4ae8[_0xbfe9('0x43')]=qs[_0xbfe9('0x44')](_0x34fb2f[_0xbfe9('0x39')][_0xbfe9('0x44')]);_0x2a4ae8[_0xbfe9('0x45')]=qs[_0xbfe9('0x3b')](_['pick'](_0x34fb2f[_0xbfe9('0x39')],_0xe9c24b[_0xbfe9('0x3b')]));if(_0x34fb2f['query'][_0xbfe9('0x48')]){_0x2a4ae8[_0xbfe9('0x45')]=_[_0xbfe9('0x49')](_0x2a4ae8[_0xbfe9('0x45')],{'$or':_[_0xbfe9('0x33')](_0x2a4ae8['attributes'],function(_0x4ff5d7){var _0x269c9e={};_0x269c9e[_0x4ff5d7]={'$like':'%'+_0x34fb2f['query'][_0xbfe9('0x48')]+'%'};return _0x269c9e;})});}_0x2a4ae8=_[_0xbfe9('0x49')]({},_0x2a4ae8,_0x34fb2f[_0xbfe9('0x52')]);return _0x24e4e4[_0xbfe9('0x93')](_0x2a4ae8);}})[_0xbfe9('0x2c')](function(_0x422317){if(_0x422317){_0x348612=_0x422317[_0xbfe9('0x3f')];if(!_0x34fb2f[_0xbfe9('0x39')][_0xbfe9('0x40')](_0xbfe9('0x41'))){_0x2a4ae8[_0xbfe9('0x25')]=qs[_0xbfe9('0x25')](_0x34fb2f[_0xbfe9('0x39')][_0xbfe9('0x25')]);_0x2a4ae8['offset']=qs['offset'](_0x34fb2f[_0xbfe9('0x39')]['offset']);}return _0x24e4e4[_0xbfe9('0x93')](_0x2a4ae8);}})[_0xbfe9('0x2c')](function(_0x3406ee){if(_0x3406ee){return _0x3406ee?{'count':_0x348612,'rows':_0x3406ee}:null;}})[_0xbfe9('0x2c')](respondWithResult(_0x2b2a84,null))[_0xbfe9('0x5d')](handleError(_0x2b2a84,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c6aa7e4..c9ee30d 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 _0x2f3f=['events','../../mysqldb','FaxQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x2f3f,0x6c));var _0xf2f3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x2f3f[_0x199572];return _0x13cfa3;};'use strict';var EventEmitter=require(_0xf2f3('0x0'));var FaxQueue=require(_0xf2f3('0x1'))['db'][_0xf2f3('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf2f3('0x3'),'afterUpdate':_0xf2f3('0x4'),'afterDestroy':_0xf2f3('0x5')};function emitEvent(_0x110fe2){return function(_0x561d4c,_0x30a728,_0x19417c){FaxQueueEvents[_0xf2f3('0x6')](_0x110fe2+':'+_0x561d4c['id'],_0x561d4c);FaxQueueEvents[_0xf2f3('0x6')](_0x110fe2,_0x561d4c);_0x19417c(null);};}for(var e in events){if(events[_0xf2f3('0x7')](e)){var event=events[e];FaxQueue[_0xf2f3('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xba24=['../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hook','events'];(function(_0xcbec44,_0x3f6de7){var _0x398a0f=function(_0xa1d069){while(--_0xa1d069){_0xcbec44['push'](_0xcbec44['shift']());}};_0x398a0f(++_0x3f6de7);}(_0xba24,0x14f));var _0x4ba2=function(_0x1100ab,_0x4c9b52){_0x1100ab=_0x1100ab-0x0;var _0x6342bd=_0xba24[_0x1100ab];return _0x6342bd;};'use strict';var EventEmitter=require(_0x4ba2('0x0'));var FaxQueue=require(_0x4ba2('0x1'))['db'][_0x4ba2('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4ba2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4ba2('0x4'),'afterDestroy':_0x4ba2('0x5')};function emitEvent(_0x506f98){return function(_0x50c039,_0x13b361,_0xac0a00){FaxQueueEvents[_0x4ba2('0x6')](_0x506f98+':'+_0x50c039['id'],_0x50c039);FaxQueueEvents[_0x4ba2('0x6')](_0x506f98,_0x50c039);_0xac0a00(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x4ba2('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 4878bb4..7cbb608 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 _0xf0bd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','util'];(function(_0x45f6d2,_0x3730bf){var _0x3a724c=function(_0x48e8a){while(--_0x48e8a){_0x45f6d2['push'](_0x45f6d2['shift']());}};_0x3a724c(++_0x3730bf);}(_0xf0bd,0x173));var _0xdf0b=function(_0x4548ca,_0x4b9074){_0x4548ca=_0x4548ca-0x0;var _0x45f913=_0xf0bd[_0x4548ca];return _0x45f913;};'use strict';var _=require('lodash');var util=require(_0xdf0b('0x0'));var logger=require(_0xdf0b('0x1'))(_0xdf0b('0x2'));var moment=require(_0xdf0b('0x3'));var BPromise=require(_0xdf0b('0x4'));var rp=require(_0xdf0b('0x5'));var fs=require('fs');var path=require(_0xdf0b('0x6'));var rimraf=require(_0xdf0b('0x7'));var config=require(_0xdf0b('0x8'));var attributes=require(_0xdf0b('0x9'));module['exports']=function(_0x2b7cb5,_0x76cecd){return _0x2b7cb5[_0xdf0b('0xa')](_0xdf0b('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbac=['fax_queues','lodash','api','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue'];(function(_0x29c3eb,_0x3b4356){var _0x539d0d=function(_0x2fb549){while(--_0x2fb549){_0x29c3eb['push'](_0x29c3eb['shift']());}};_0x539d0d(++_0x3b4356);}(_0xfbac,0xa6));var _0xcfba=function(_0x1be8a3,_0x80288a){_0x1be8a3=_0x1be8a3-0x0;var _0x374e5d=_0xfbac[_0x1be8a3];return _0x374e5d;};'use strict';var _=require(_0xcfba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfba('0x1'));var moment=require('moment');var BPromise=require(_0xcfba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfba('0x3'));var rimraf=require(_0xcfba('0x4'));var config=require(_0xcfba('0x5'));var attributes=require(_0xcfba('0x6'));module[_0xcfba('0x7')]=function(_0x8a0b8e,_0x54d1fb){return _0x8a0b8e[_0xcfba('0x8')](_0xcfba('0x9'),attributes,{'tableName':_0xcfba('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 76afebb..56385d7 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 _0x67c2=['FaxQueue','findAll','options','raw','where','limit','include','map','attributes','model','catch','ShowFaxQueue','find','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFaxQueue'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x67c2,0x17e));var _0x267c=function(_0x42f895,_0xd1ef16){_0x42f895=_0x42f895-0x0;var _0x585ca4=_0x67c2[_0x42f895];return _0x585ca4;};'use strict';var _=require(_0x267c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x267c('0x1'));var rs=require(_0x267c('0x2'));var fs=require('fs');var Redis=require(_0x267c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x267c('0x4'));var logger=require(_0x267c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x267c('0x6'));var client=jayson[_0x267c('0x7')][_0x267c('0x8')]({'port':0x232a});config[_0x267c('0x9')]=_[_0x267c('0xa')](config[_0x267c('0x9')],{'host':_0x267c('0xb'),'port':0x18eb});var socket=require(_0x267c('0xc'))(new Redis(config[_0x267c('0x9')]));require(_0x267c('0xd'))[_0x267c('0xe')](socket);function respondWithRpcPromise(_0x4eff9a,_0x4c02c9,_0x29ecdf){return new BPromise(function(_0x47813e,_0x3160a8){return client[_0x267c('0xf')](_0x4eff9a,_0x29ecdf)[_0x267c('0x10')](function(_0x4a5cc5){logger['info'](_0x267c('0x11'),_0x4c02c9,_0x267c('0x12'));logger[_0x267c('0x13')](_0x267c('0x14'),_0x4c02c9,_0x267c('0x12'),JSON[_0x267c('0x15')](_0x4a5cc5));if(_0x4a5cc5[_0x267c('0x16')]){if(_0x4a5cc5[_0x267c('0x16')][_0x267c('0x17')]===0x1f4){logger[_0x267c('0x16')]('FaxQueue,\x20%s,\x20%s',_0x4c02c9,_0x4a5cc5[_0x267c('0x16')]['message']);return _0x3160a8(_0x4a5cc5[_0x267c('0x16')][_0x267c('0x18')]);}logger['error'](_0x267c('0x11'),_0x4c02c9,_0x4a5cc5[_0x267c('0x16')][_0x267c('0x18')]);return _0x47813e(_0x4a5cc5[_0x267c('0x16')][_0x267c('0x18')]);}else{logger[_0x267c('0x19')](_0x267c('0x11'),_0x4c02c9,'request\x20sent');_0x47813e(_0x4a5cc5[_0x267c('0x1a')]['message']);}})['catch'](function(_0x141eba){logger[_0x267c('0x16')](_0x267c('0x11'),_0x4c02c9,_0x141eba);_0x3160a8(_0x141eba);});});}exports[_0x267c('0x1b')]=function(_0x3db084){var _0x4bb7ce=this;return new Promise(function(_0x5874a7,_0x51998d){return db[_0x267c('0x1c')][_0x267c('0x1d')]({'raw':_0x3db084[_0x267c('0x1e')]?_0x3db084[_0x267c('0x1e')][_0x267c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3db084[_0x267c('0x1e')]?_0x3db084[_0x267c('0x1e')][_0x267c('0x20')]||null:null,'attributes':_0x3db084[_0x267c('0x1e')]?_0x3db084[_0x267c('0x1e')]['attributes']||null:null,'limit':_0x3db084[_0x267c('0x1e')]?_0x3db084[_0x267c('0x1e')][_0x267c('0x21')]||null:null,'include':_0x3db084[_0x267c('0x1e')]?_0x3db084[_0x267c('0x1e')][_0x267c('0x22')]?_[_0x267c('0x23')](_0x3db084[_0x267c('0x1e')]['include'],function(_0x56070c){return{'model':db[_0x56070c['model']],'as':_0x56070c['as'],'attributes':_0x56070c[_0x267c('0x24')],'include':_0x56070c[_0x267c('0x22')]?_[_0x267c('0x23')](_0x56070c[_0x267c('0x22')],function(_0x589b70){return{'model':db[_0x589b70[_0x267c('0x25')]],'as':_0x589b70['as'],'attributes':_0x589b70[_0x267c('0x24')],'include':_0x589b70['include']?_[_0x267c('0x23')](_0x589b70[_0x267c('0x22')],function(_0x5819dd){return{'model':db[_0x5819dd[_0x267c('0x25')]],'as':_0x5819dd['as'],'attributes':_0x5819dd[_0x267c('0x24')]};}):[]};}):[]};}):[]:[]})[_0x267c('0x10')](function(_0x587185){logger[_0x267c('0x19')](_0x267c('0x1b'),_0x3db084);logger[_0x267c('0x13')](_0x267c('0x1b'),_0x3db084,JSON[_0x267c('0x15')](_0x587185));_0x5874a7(_0x587185);})[_0x267c('0x26')](function(_0x44eb09){logger[_0x267c('0x16')](_0x267c('0x1b'),_0x44eb09[_0x267c('0x18')],_0x3db084);_0x51998d(_0x4bb7ce[_0x267c('0x16')](0x1f4,_0x44eb09[_0x267c('0x18')]));});});};exports[_0x267c('0x27')]=function(_0x2681df){var _0x266066=this;return new Promise(function(_0x670752,_0x239481){return db[_0x267c('0x1c')][_0x267c('0x28')]({'raw':_0x2681df[_0x267c('0x1e')]?_0x2681df[_0x267c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2681df['options']?_0x2681df[_0x267c('0x1e')][_0x267c('0x20')]||null:null,'attributes':_0x2681df['options']?_0x2681df['options'][_0x267c('0x24')]||null:null,'include':_0x2681df[_0x267c('0x1e')]?_0x2681df[_0x267c('0x1e')][_0x267c('0x22')]?_[_0x267c('0x23')](_0x2681df[_0x267c('0x1e')]['include'],function(_0x105894){return{'model':db[_0x105894[_0x267c('0x25')]],'as':_0x105894['as'],'attributes':_0x105894['attributes'],'include':_0x105894[_0x267c('0x22')]?_[_0x267c('0x23')](_0x105894[_0x267c('0x22')],function(_0x521a7c){return{'model':db[_0x521a7c['model']],'as':_0x521a7c['as'],'attributes':_0x521a7c[_0x267c('0x24')],'include':_0x521a7c[_0x267c('0x22')]?_[_0x267c('0x23')](_0x521a7c[_0x267c('0x22')],function(_0x309672){return{'model':db[_0x309672[_0x267c('0x25')]],'as':_0x309672['as'],'attributes':_0x309672[_0x267c('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x430695){logger[_0x267c('0x19')](_0x267c('0x27'),_0x2681df);logger[_0x267c('0x13')]('ShowFaxQueue',_0x2681df,JSON['stringify'](_0x430695));_0x670752(_0x430695);})['catch'](function(_0x3cbe4b){logger[_0x267c('0x16')](_0x267c('0x27'),_0x3cbe4b[_0x267c('0x18')],_0x2681df);_0x239481(_0x266066[_0x267c('0x16')](0x1f4,_0x3cbe4b['message']));});});}; \ No newline at end of file +var _0xe51b=['raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxQueue','findAll','options','where','attributes','limit','include','model','map','then','GetFaxQueue','stringify','ShowFaxQueue','find'];(function(_0x196e4e,_0x3e7e44){var _0x191127=function(_0x4ae37f){while(--_0x4ae37f){_0x196e4e['push'](_0x196e4e['shift']());}};_0x191127(++_0x3e7e44);}(_0xe51b,0xe5));var _0xbe51=function(_0x17bc0a,_0x3884b5){_0x17bc0a=_0x17bc0a-0x0;var _0x3fb222=_0xe51b[_0x17bc0a];return _0x3fb222;};'use strict';var _=require(_0xbe51('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbe51('0x1'));var rs=require(_0xbe51('0x2'));var fs=require('fs');var Redis=require(_0xbe51('0x3'));var db=require(_0xbe51('0x4'))['db'];var utils=require(_0xbe51('0x5'));var logger=require(_0xbe51('0x6'))(_0xbe51('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe51('0x8'));var client=jayson[_0xbe51('0x9')][_0xbe51('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbe51('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xbe51('0xc')](socket);function respondWithRpcPromise(_0x36f530,_0x2a1aae,_0x39b0dd){return new BPromise(function(_0x53e74d,_0xfbd6fd){return client['request'](_0x36f530,_0x39b0dd)['then'](function(_0x28431f){logger[_0xbe51('0xd')](_0xbe51('0xe'),_0x2a1aae,_0xbe51('0xf'));logger[_0xbe51('0x10')](_0xbe51('0x11'),_0x2a1aae,'request\x20sent',JSON['stringify'](_0x28431f));if(_0x28431f[_0xbe51('0x12')]){if(_0x28431f['error'][_0xbe51('0x13')]===0x1f4){logger[_0xbe51('0x12')](_0xbe51('0xe'),_0x2a1aae,_0x28431f[_0xbe51('0x12')]['message']);return _0xfbd6fd(_0x28431f[_0xbe51('0x12')][_0xbe51('0x14')]);}logger['error'](_0xbe51('0xe'),_0x2a1aae,_0x28431f['error']['message']);return _0x53e74d(_0x28431f[_0xbe51('0x12')][_0xbe51('0x14')]);}else{logger[_0xbe51('0xd')](_0xbe51('0xe'),_0x2a1aae,_0xbe51('0xf'));_0x53e74d(_0x28431f[_0xbe51('0x15')][_0xbe51('0x14')]);}})[_0xbe51('0x16')](function(_0x3fa35b){logger[_0xbe51('0x12')](_0xbe51('0xe'),_0x2a1aae,_0x3fa35b);_0xfbd6fd(_0x3fa35b);});});}exports['GetFaxQueue']=function(_0x2ecce0){var _0x1109e3=this;return new Promise(function(_0x368cd3,_0x149e5b){return db[_0xbe51('0x17')][_0xbe51('0x18')]({'raw':_0x2ecce0['options']?_0x2ecce0[_0xbe51('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2ecce0[_0xbe51('0x19')]?_0x2ecce0['options'][_0xbe51('0x1a')]||null:null,'attributes':_0x2ecce0[_0xbe51('0x19')]?_0x2ecce0['options'][_0xbe51('0x1b')]||null:null,'limit':_0x2ecce0[_0xbe51('0x19')]?_0x2ecce0[_0xbe51('0x19')][_0xbe51('0x1c')]||null:null,'include':_0x2ecce0[_0xbe51('0x19')]?_0x2ecce0[_0xbe51('0x19')][_0xbe51('0x1d')]?_['map'](_0x2ecce0[_0xbe51('0x19')][_0xbe51('0x1d')],function(_0x44446d){return{'model':db[_0x44446d[_0xbe51('0x1e')]],'as':_0x44446d['as'],'attributes':_0x44446d[_0xbe51('0x1b')],'include':_0x44446d['include']?_[_0xbe51('0x1f')](_0x44446d[_0xbe51('0x1d')],function(_0x44b9a5){return{'model':db[_0x44b9a5['model']],'as':_0x44b9a5['as'],'attributes':_0x44b9a5['attributes'],'include':_0x44b9a5['include']?_['map'](_0x44b9a5[_0xbe51('0x1d')],function(_0x2f6084){return{'model':db[_0x2f6084['model']],'as':_0x2f6084['as'],'attributes':_0x2f6084['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe51('0x20')](function(_0x43e98e){logger[_0xbe51('0xd')](_0xbe51('0x21'),_0x2ecce0);logger[_0xbe51('0x10')](_0xbe51('0x21'),_0x2ecce0,JSON[_0xbe51('0x22')](_0x43e98e));_0x368cd3(_0x43e98e);})[_0xbe51('0x16')](function(_0x286a57){logger[_0xbe51('0x12')](_0xbe51('0x21'),_0x286a57[_0xbe51('0x14')],_0x2ecce0);_0x149e5b(_0x1109e3[_0xbe51('0x12')](0x1f4,_0x286a57['message']));});});};exports[_0xbe51('0x23')]=function(_0x307bea){var _0x3c8c7b=this;return new Promise(function(_0x342b53,_0x135a1a){return db['FaxQueue'][_0xbe51('0x24')]({'raw':_0x307bea[_0xbe51('0x19')]?_0x307bea[_0xbe51('0x19')][_0xbe51('0x25')]===undefined?!![]:![]:!![],'where':_0x307bea['options']?_0x307bea[_0xbe51('0x19')]['where']||null:null,'attributes':_0x307bea[_0xbe51('0x19')]?_0x307bea['options'][_0xbe51('0x1b')]||null:null,'include':_0x307bea[_0xbe51('0x19')]?_0x307bea[_0xbe51('0x19')][_0xbe51('0x1d')]?_[_0xbe51('0x1f')](_0x307bea[_0xbe51('0x19')]['include'],function(_0x338459){return{'model':db[_0x338459['model']],'as':_0x338459['as'],'attributes':_0x338459['attributes'],'include':_0x338459[_0xbe51('0x1d')]?_['map'](_0x338459[_0xbe51('0x1d')],function(_0x6829d3){return{'model':db[_0x6829d3[_0xbe51('0x1e')]],'as':_0x6829d3['as'],'attributes':_0x6829d3['attributes'],'include':_0x6829d3[_0xbe51('0x1d')]?_['map'](_0x6829d3[_0xbe51('0x1d')],function(_0x17b411){return{'model':db[_0x17b411[_0xbe51('0x1e')]],'as':_0x17b411['as'],'attributes':_0x17b411['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe51('0x20')](function(_0x97400d){logger[_0xbe51('0xd')]('ShowFaxQueue',_0x307bea);logger[_0xbe51('0x10')](_0xbe51('0x23'),_0x307bea,JSON[_0xbe51('0x22')](_0x97400d));_0x342b53(_0x97400d);})[_0xbe51('0x16')](function(_0x46322e){logger[_0xbe51('0x12')](_0xbe51('0x23'),_0x46322e[_0xbe51('0x14')],_0x307bea);_0x135a1a(_0x3c8c7b[_0xbe51('0x12')](0x1f4,_0x46322e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2c51e1b..e7f78b2 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 _0x5c5d=['save','remove','update','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x349248,_0x5eded1){var _0x39687f=function(_0x5426e6){while(--_0x5426e6){_0x349248['push'](_0x349248['shift']());}};_0x39687f(++_0x5eded1);}(_0x5c5d,0xb7));var _0xd5c5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5c5d[_0x397e5f];return _0x5302b8;};'use strict';var FaxQueueEvents=require(_0xd5c5('0x0'));var events=[_0xd5c5('0x1'),_0xd5c5('0x2'),_0xd5c5('0x3')];function createListener(_0x198e2f,_0x5df1a7){return function(_0x2e076b){_0x5df1a7[_0xd5c5('0x4')](_0x198e2f,_0x2e076b);};}function removeListener(_0x32441d,_0x1e47cf){return function(){FaxQueueEvents[_0xd5c5('0x5')](_0x32441d,_0x1e47cf);};}exports['register']=function(_0x485566){for(var _0x5694fa=0x0,_0x5f57ca=events[_0xd5c5('0x6')];_0x5694fa<_0x5f57ca;_0x5694fa++){var _0x56806c=events[_0x5694fa];var _0x1bf20e=createListener(_0xd5c5('0x7')+_0x56806c,_0x485566);FaxQueueEvents['on'](_0x56806c,_0x1bf20e);}}; \ No newline at end of file +var _0xe8eb=['register','length','./faxQueue.events','save','remove','emit'];(function(_0x1b5b87,_0x567051){var _0x3f5219=function(_0x2b2fe7){while(--_0x2b2fe7){_0x1b5b87['push'](_0x1b5b87['shift']());}};_0x3f5219(++_0x567051);}(_0xe8eb,0xce));var _0xbe8e=function(_0x4f0635,_0x83cc33){_0x4f0635=_0x4f0635-0x0;var _0x2e8060=_0xe8eb[_0x4f0635];return _0x2e8060;};'use strict';var FaxQueueEvents=require(_0xbe8e('0x0'));var events=[_0xbe8e('0x1'),_0xbe8e('0x2'),'update'];function createListener(_0x17512e,_0x2fd4ac){return function(_0x27a3fb){_0x2fd4ac[_0xbe8e('0x3')](_0x17512e,_0x27a3fb);};}function removeListener(_0xdbc1fa,_0x3e8c47){return function(){FaxQueueEvents['removeListener'](_0xdbc1fa,_0x3e8c47);};}exports[_0xbe8e('0x4')]=function(_0x1aa97b){for(var _0x537395=0x0,_0x141770=events[_0xbe8e('0x5')];_0x537395<_0x141770;_0x537395++){var _0x36366e=events[_0x537395];var _0x99197f=createListener('faxQueue:'+_0x36366e,_0x1aa97b);FaxQueueEvents['on'](_0x36366e,_0x99197f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e36a6ec..e74b383 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 _0xdb28=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb28,0x106));var _0x8db2=function(_0x442ee7,_0x290ea6){_0x442ee7=_0x442ee7-0x0;var _0x3b5846=_0xdb28[_0x442ee7];return _0x3b5846;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./faxQueue.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getTeams']);router[_0x8db2('0x9')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8db2('0x14')](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x15')]);router[_0x8db2('0x14')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);router[_0x8db2('0x17')](_0x8db2('0xd'),auth['isAuthenticated'](),controller[_0x8db2('0x18')]);router[_0x8db2('0x19')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1a')]);router[_0x8db2('0x19')](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1b')]);router['delete']('/:id/users',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1c')]);module[_0x8db2('0x1d')]=router; \ No newline at end of file +var _0x583c=['util','path','connect-timeout','Router','fs-extra','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','/:id','delete','removeTeams','removeAgents','exports','multer'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x583c,0x12b));var _0xc583=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0x583c[_0x51bb38];return _0x51c09b;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var fs_extra=require(_0xc583('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc583('0x6'));var controller=require(_0xc583('0x7'));router['get']('/',auth[_0xc583('0x8')](),controller[_0xc583('0x9')]);router[_0xc583('0xa')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xa')]('/:id',auth[_0xc583('0x8')](),controller[_0xc583('0xd')]);router[_0xc583('0xa')](_0xc583('0xe'),auth[_0xc583('0x8')](),controller['getMembers']);router[_0xc583('0xa')](_0xc583('0xf'),auth['isAuthenticated'](),controller[_0xc583('0x10')]);router[_0xc583('0xa')]('/:id/users',auth[_0xc583('0x8')](),controller[_0xc583('0x11')]);router[_0xc583('0x12')]('/',auth[_0xc583('0x8')](),controller[_0xc583('0x13')]);router[_0xc583('0x12')](_0xc583('0xf'),auth[_0xc583('0x8')](),controller[_0xc583('0x14')]);router['post'](_0xc583('0x15'),auth['isAuthenticated'](),controller[_0xc583('0x16')]);router[_0xc583('0x17')]('/:id',auth[_0xc583('0x8')](),controller[_0xc583('0x18')]);router['delete'](_0xc583('0x19'),auth[_0xc583('0x8')](),controller['destroy']);router[_0xc583('0x1a')](_0xc583('0xf'),auth[_0xc583('0x8')](),controller[_0xc583('0x1b')]);router['delete'](_0xc583('0x15'),auth['isAuthenticated'](),controller[_0xc583('0x1c')]);module[_0xc583('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 92bf6b8..3efa05a 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 _0x37b2=['DATE','sequelize','exports','STRING'];(function(_0x3aadd1,_0x5cd1e3){var _0x114dcc=function(_0x218913){while(--_0x218913){_0x3aadd1['push'](_0x3aadd1['shift']());}};_0x114dcc(++_0x5cd1e3);}(_0x37b2,0x1f1));var _0x237b=function(_0x2e7025,_0x187270){_0x2e7025=_0x2e7025-0x0;var _0x5373ed=_0x37b2[_0x2e7025];return _0x5373ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x237b('0x0'));module[_0x237b('0x1')]={'uniqueid':{'type':Sequelize[_0x237b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x237b('0x2')]},'joinAt':{'type':Sequelize[_0x237b('0x3')]},'leaveAt':{'type':Sequelize[_0x237b('0x3')]},'acceptAt':{'type':Sequelize[_0x237b('0x3')]},'exitAt':{'type':Sequelize[_0x237b('0x3')]},'reason':{'type':Sequelize[_0x237b('0x2')]}}; \ No newline at end of file +var _0x9e06=['moment','sequelize','exports','STRING','DATE'];(function(_0x1506cf,_0x1746f5){var _0x1c6f49=function(_0x1f6901){while(--_0x1f6901){_0x1506cf['push'](_0x1506cf['shift']());}};_0x1c6f49(++_0x1746f5);}(_0x9e06,0x14f));var _0x69e0=function(_0x2b0b47,_0x3caccd){_0x2b0b47=_0x2b0b47-0x0;var _0x53a762=_0x9e06[_0x2b0b47];return _0x53a762;};'use strict';var moment=require(_0x69e0('0x0'));var Sequelize=require(_0x69e0('0x1'));module[_0x69e0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x69e0('0x3')]},'joinAt':{'type':Sequelize[_0x69e0('0x4')]},'leaveAt':{'type':Sequelize[_0x69e0('0x4')]},'acceptAt':{'type':Sequelize[_0x69e0('0x4')]},'exitAt':{'type':Sequelize[_0x69e0('0x4')]},'reason':{'type':Sequelize[_0x69e0('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0568533..eab6df9 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 _0x0a34=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x1f845e,_0xa4cf17){var _0x5370e5=function(_0x3cf1f0){while(--_0x3cf1f0){_0x1f845e['push'](_0x1f845e['shift']());}};_0x5370e5(++_0xa4cf17);}(_0x0a34,0x12a));var _0x40a3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0a34[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x40a3('0x0'));var rimraf=require(_0x40a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40a3('0x2'));var rp=require(_0x40a3('0x3'));var moment=require(_0x40a3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x40a3('0x5'));var util=require(_0x40a3('0x6'));var path=require(_0x40a3('0x7'));var sox=require('sox');var csv=require(_0x40a3('0x8'));var ejs=require(_0x40a3('0x9'));var fs=require('fs');var fs_extra=require(_0x40a3('0xa'));var _=require(_0x40a3('0xb'));var squel=require(_0x40a3('0xc'));var crypto=require(_0x40a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x40a3('0xe'));var toCsv=require(_0x40a3('0x8'));var querystring=require(_0x40a3('0xf'));var Papa=require(_0x40a3('0x10'));var Redis=require(_0x40a3('0x11'));var authService=require(_0x40a3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x40a3('0x13'));var hardwareService=require(_0x40a3('0x14'));var logger=require(_0x40a3('0x15'))('api');var utils=require(_0x40a3('0x16'));var config=require(_0x40a3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x40a3('0x18'))['db'];function respondWithStatusCode(_0x36c29c,_0x4b809b){_0x4b809b=_0x4b809b||0xcc;return function(_0x2b3122){if(_0x2b3122){return _0x36c29c[_0x40a3('0x19')](_0x4b809b);}return _0x36c29c['status'](_0x4b809b)[_0x40a3('0x1a')]();};}function respondWithResult(_0x3ced7b,_0x13ac55){_0x13ac55=_0x13ac55||0xc8;return function(_0x476c82){if(_0x476c82){return _0x3ced7b['status'](_0x13ac55)['json'](_0x476c82);}};}function respondWithFilteredResult(_0x561554,_0x28bb05){return function(_0x19e09e){if(_0x19e09e){var _0x20d6cf=typeof _0x28bb05['offset']===_0x40a3('0x1b')&&typeof _0x28bb05[_0x40a3('0x1c')]==='undefined';var _0x4d6499=_0x19e09e[_0x40a3('0x1d')];var _0x31aef5=_0x20d6cf?0x0:_0x28bb05[_0x40a3('0x1e')];var _0x1c5102=_0x20d6cf?_0x19e09e['count']:_0x28bb05[_0x40a3('0x1e')]+_0x28bb05[_0x40a3('0x1c')];var _0x3b4b67;if(_0x1c5102>=_0x4d6499){_0x1c5102=_0x4d6499;_0x3b4b67=0xc8;}else{_0x3b4b67=0xce;}_0x561554[_0x40a3('0x1f')](_0x3b4b67);return _0x561554[_0x40a3('0x20')](_0x40a3('0x21'),_0x31aef5+'-'+_0x1c5102+'/'+_0x4d6499)[_0x40a3('0x22')](_0x19e09e);}return null;};}function patchUpdates(_0xb723d3){return function(_0x975ca){try{jsonpatch[_0x40a3('0x23')](_0x975ca,_0xb723d3,!![]);}catch(_0x2d18d6){return BPromise[_0x40a3('0x24')](_0x2d18d6);}return _0x975ca[_0x40a3('0x25')]();};}function saveUpdates(_0x1416d2,_0x1dbc00){return function(_0x1daace){if(_0x1daace){return _0x1daace['update'](_0x1416d2)[_0x40a3('0x26')](function(_0x46fbbe){return _0x46fbbe;});}return null;};}function removeEntity(_0x1d0cf0,_0x1e11fb){return function(_0x1d034a){if(_0x1d034a){return _0x1d034a[_0x40a3('0x27')]()['then'](function(){_0x1d0cf0[_0x40a3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37321a,_0x348685){return function(_0x5a9b6f){if(!_0x5a9b6f){_0x37321a[_0x40a3('0x19')](0x194);}return _0x5a9b6f;};}function handleError(_0x3eb097,_0x1b6c7c){_0x1b6c7c=_0x1b6c7c||0x1f4;return function(_0x599474){logger[_0x40a3('0x28')](_0x599474[_0x40a3('0x29')]);if(_0x599474[_0x40a3('0x2a')]){delete _0x599474[_0x40a3('0x2a')];}_0x3eb097[_0x40a3('0x1f')](_0x1b6c7c)[_0x40a3('0x2b')](_0x599474);};}exports[_0x40a3('0x2c')]=function(_0x3d50d7,_0x5d288e){var _0x4b7b86={},_0x355a8f={},_0x4a7fd8={'count':0x0,'rows':[]};var _0x58beaf=_[_0x40a3('0x2d')](db[_0x40a3('0x2e')][_0x40a3('0x2f')],function(_0x4fdf27){return{'name':_0x4fdf27[_0x40a3('0x30')],'type':_0x4fdf27[_0x40a3('0x31')][_0x40a3('0x32')]};});_0x355a8f[_0x40a3('0x33')]=_['map'](_0x58beaf,_0x40a3('0x2a'));_0x355a8f[_0x40a3('0x34')]=_[_0x40a3('0x35')](_0x3d50d7[_0x40a3('0x34')]);_0x355a8f[_0x40a3('0x36')]=_[_0x40a3('0x37')](_0x355a8f[_0x40a3('0x33')],_0x355a8f[_0x40a3('0x34')]);_0x4b7b86[_0x40a3('0x38')]=_[_0x40a3('0x37')](_0x355a8f[_0x40a3('0x33')],qs[_0x40a3('0x39')](_0x3d50d7[_0x40a3('0x34')][_0x40a3('0x39')]));_0x4b7b86[_0x40a3('0x38')]=_0x4b7b86[_0x40a3('0x38')][_0x40a3('0x3a')]?_0x4b7b86[_0x40a3('0x38')]:_0x355a8f[_0x40a3('0x33')];if(!_0x3d50d7[_0x40a3('0x34')][_0x40a3('0x3b')](_0x40a3('0x3c'))){_0x4b7b86[_0x40a3('0x1c')]=qs[_0x40a3('0x1c')](_0x3d50d7['query'][_0x40a3('0x1c')]);_0x4b7b86[_0x40a3('0x1e')]=qs[_0x40a3('0x1e')](_0x3d50d7[_0x40a3('0x34')][_0x40a3('0x1e')]);}_0x4b7b86[_0x40a3('0x3d')]=qs[_0x40a3('0x3e')](_0x3d50d7['query'][_0x40a3('0x3e')]);_0x4b7b86[_0x40a3('0x3f')]=qs[_0x40a3('0x36')](_['pick'](_0x3d50d7[_0x40a3('0x34')],_0x355a8f[_0x40a3('0x36')]),_0x58beaf);if(_0x3d50d7[_0x40a3('0x34')][_0x40a3('0x40')]){_0x4b7b86[_0x40a3('0x3f')]=_[_0x40a3('0x41')](_0x4b7b86[_0x40a3('0x3f')],{'$or':_[_0x40a3('0x2d')](_0x58beaf,function(_0x523bfd){if(_0x523bfd['type']!==_0x40a3('0x42')){var _0x316408={};_0x316408[_0x523bfd[_0x40a3('0x2a')]]={'$like':'%'+_0x3d50d7[_0x40a3('0x34')]['filter']+'%'};return _0x316408;}})});}_0x4b7b86=_[_0x40a3('0x41')]({},_0x4b7b86,_0x3d50d7[_0x40a3('0x43')]);var _0x39b22c={'where':_0x4b7b86[_0x40a3('0x3f')]};return db[_0x40a3('0x2e')][_0x40a3('0x1d')](_0x39b22c)[_0x40a3('0x26')](function(_0x5dc963){_0x4a7fd8[_0x40a3('0x1d')]=_0x5dc963;if(_0x3d50d7[_0x40a3('0x34')][_0x40a3('0x44')]){_0x4b7b86[_0x40a3('0x45')]=[{'all':!![]}];}return db[_0x40a3('0x2e')][_0x40a3('0x46')](_0x4b7b86);})[_0x40a3('0x26')](function(_0x483819){_0x4a7fd8[_0x40a3('0x47')]=_0x483819;return _0x4a7fd8;})[_0x40a3('0x26')](respondWithFilteredResult(_0x5d288e,_0x4b7b86))[_0x40a3('0x48')](handleError(_0x5d288e,null));};exports[_0x40a3('0x49')]=function(_0x521842,_0x279a85){var _0x289989={'raw':!![],'where':{'id':_0x521842[_0x40a3('0x4a')]['id']}},_0x265d58={};_0x265d58[_0x40a3('0x33')]=_[_0x40a3('0x35')](db['FaxQueueReport'][_0x40a3('0x2f')]);_0x265d58[_0x40a3('0x34')]=_['keys'](_0x521842['query']);_0x265d58[_0x40a3('0x36')]=_[_0x40a3('0x37')](_0x265d58[_0x40a3('0x33')],_0x265d58[_0x40a3('0x34')]);_0x289989[_0x40a3('0x38')]=_['intersection'](_0x265d58[_0x40a3('0x33')],qs['fields'](_0x521842[_0x40a3('0x34')][_0x40a3('0x39')]));_0x289989[_0x40a3('0x38')]=_0x289989[_0x40a3('0x38')][_0x40a3('0x3a')]?_0x289989[_0x40a3('0x38')]:_0x265d58[_0x40a3('0x33')];if(_0x521842[_0x40a3('0x34')]['includeAll']){_0x289989[_0x40a3('0x45')]=[{'all':!![]}];}_0x289989=_[_0x40a3('0x41')]({},_0x289989,_0x521842[_0x40a3('0x43')]);return db['FaxQueueReport']['find'](_0x289989)[_0x40a3('0x26')](handleEntityNotFound(_0x279a85,null))[_0x40a3('0x26')](respondWithResult(_0x279a85,null))[_0x40a3('0x48')](handleError(_0x279a85,null));};exports[_0x40a3('0x4b')]=function(_0x4d3c1b,_0x24798f){return db[_0x40a3('0x2e')][_0x40a3('0x4b')](_0x4d3c1b[_0x40a3('0x4c')],{})['then'](respondWithResult(_0x24798f,0xc9))[_0x40a3('0x48')](handleError(_0x24798f,null));};exports[_0x40a3('0x4d')]=function(_0x12889d,_0x35d952){if(_0x12889d[_0x40a3('0x4c')]['id']){delete _0x12889d[_0x40a3('0x4c')]['id'];}return db[_0x40a3('0x2e')]['find']({'where':{'id':_0x12889d[_0x40a3('0x4a')]['id']}})[_0x40a3('0x26')](handleEntityNotFound(_0x35d952,null))['then'](saveUpdates(_0x12889d[_0x40a3('0x4c')],null))['then'](respondWithResult(_0x35d952,null))[_0x40a3('0x48')](handleError(_0x35d952,null));};exports['destroy']=function(_0x2a9bd1,_0x3eda1b){return db['FaxQueueReport']['find']({'where':{'id':_0x2a9bd1[_0x40a3('0x4a')]['id']}})[_0x40a3('0x26')](handleEntityNotFound(_0x3eda1b,null))[_0x40a3('0x26')](removeEntity(_0x3eda1b,null))[_0x40a3('0x48')](handleError(_0x3eda1b,null));};exports[_0x40a3('0x4e')]=function(_0xf5a21b,_0x3229c3){return db[_0x40a3('0x2e')][_0x40a3('0x4e')]()[_0x40a3('0x26')](respondWithResult(_0x3229c3,null))[_0x40a3('0x48')](handleError(_0x3229c3,null));}; \ No newline at end of file +var _0xbd3b=['bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','length','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x2bd8fe,_0x4aeef7){_0x2bd8fe=_0x2bd8fe-0x0;var _0x2979e6=_0xbd3b[_0x2bd8fe];return _0x2979e6;};'use strict';var emlformat=require(_0xbbd3('0x0'));var rimraf=require(_0xbbd3('0x1'));var zipdir=require(_0xbbd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbd3('0x3'));var moment=require(_0xbbd3('0x4'));var BPromise=require(_0xbbd3('0x5'));var Mustache=require(_0xbbd3('0x6'));var util=require('util');var path=require(_0xbbd3('0x7'));var sox=require(_0xbbd3('0x8'));var csv=require('to-csv');var ejs=require(_0xbbd3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbd3('0xa'));var squel=require(_0xbbd3('0xb'));var crypto=require(_0xbbd3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbd3('0xd'));var toCsv=require(_0xbbd3('0xe'));var querystring=require(_0xbbd3('0xf'));var Papa=require(_0xbbd3('0x10'));var Redis=require('ioredis');var authService=require(_0xbbd3('0x11'));var qs=require(_0xbbd3('0x12'));var as=require(_0xbbd3('0x13'));var hardwareService=require(_0xbbd3('0x14'));var logger=require('../../config/logger')(_0xbbd3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbbd3('0x16'));var db=require(_0xbbd3('0x17'))['db'];function respondWithStatusCode(_0x4004a3,_0x35d473){_0x35d473=_0x35d473||0xcc;return function(_0x26283b){if(_0x26283b){return _0x4004a3[_0xbbd3('0x18')](_0x35d473);}return _0x4004a3[_0xbbd3('0x19')](_0x35d473)[_0xbbd3('0x1a')]();};}function respondWithResult(_0x469ef2,_0xf12c2d){_0xf12c2d=_0xf12c2d||0xc8;return function(_0x4a8ea8){if(_0x4a8ea8){return _0x469ef2['status'](_0xf12c2d)[_0xbbd3('0x1b')](_0x4a8ea8);}};}function respondWithFilteredResult(_0xda19d6,_0x38b4ba){return function(_0x38ab26){if(_0x38ab26){var _0xbeeb6b=typeof _0x38b4ba['offset']===_0xbbd3('0x1c')&&typeof _0x38b4ba['limit']===_0xbbd3('0x1c');var _0x830690=_0x38ab26[_0xbbd3('0x1d')];var _0x240a46=_0xbeeb6b?0x0:_0x38b4ba['offset'];var _0x50b6e4=_0xbeeb6b?_0x38ab26[_0xbbd3('0x1d')]:_0x38b4ba[_0xbbd3('0x1e')]+_0x38b4ba['limit'];var _0x398c80;if(_0x50b6e4>=_0x830690){_0x50b6e4=_0x830690;_0x398c80=0xc8;}else{_0x398c80=0xce;}_0xda19d6['status'](_0x398c80);return _0xda19d6[_0xbbd3('0x1f')](_0xbbd3('0x20'),_0x240a46+'-'+_0x50b6e4+'/'+_0x830690)[_0xbbd3('0x1b')](_0x38ab26);}return null;};}function patchUpdates(_0x1fa586){return function(_0xe79e48){try{jsonpatch[_0xbbd3('0x21')](_0xe79e48,_0x1fa586,!![]);}catch(_0x223e02){return BPromise['reject'](_0x223e02);}return _0xe79e48[_0xbbd3('0x22')]();};}function saveUpdates(_0x57544e,_0x5392eb){return function(_0x1e3fa8){if(_0x1e3fa8){return _0x1e3fa8[_0xbbd3('0x23')](_0x57544e)[_0xbbd3('0x24')](function(_0x18ce17){return _0x18ce17;});}return null;};}function removeEntity(_0x56197e,_0x79e118){return function(_0x51d5ee){if(_0x51d5ee){return _0x51d5ee[_0xbbd3('0x25')]()['then'](function(){_0x56197e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e13a,_0x1c6689){return function(_0x414cf4){if(!_0x414cf4){_0x51e13a['sendStatus'](0x194);}return _0x414cf4;};}function handleError(_0x4b2780,_0x28ff80){_0x28ff80=_0x28ff80||0x1f4;return function(_0x276f43){logger[_0xbbd3('0x26')](_0x276f43['stack']);if(_0x276f43[_0xbbd3('0x27')]){delete _0x276f43['name'];}_0x4b2780[_0xbbd3('0x19')](_0x28ff80)[_0xbbd3('0x28')](_0x276f43);};}exports['index']=function(_0x279cb1,_0x20e872){var _0x3610a3={},_0x1c241f={},_0x3780e4={'count':0x0,'rows':[]};var _0xc70b0e=_[_0xbbd3('0x29')](db[_0xbbd3('0x2a')][_0xbbd3('0x2b')],function(_0x49ece8){return{'name':_0x49ece8[_0xbbd3('0x2c')],'type':_0x49ece8[_0xbbd3('0x2d')][_0xbbd3('0x2e')]};});_0x1c241f[_0xbbd3('0x2f')]=_['map'](_0xc70b0e,'name');_0x1c241f[_0xbbd3('0x30')]=_[_0xbbd3('0x31')](_0x279cb1[_0xbbd3('0x30')]);_0x1c241f[_0xbbd3('0x32')]=_['intersection'](_0x1c241f[_0xbbd3('0x2f')],_0x1c241f[_0xbbd3('0x30')]);_0x3610a3[_0xbbd3('0x33')]=_['intersection'](_0x1c241f[_0xbbd3('0x2f')],qs[_0xbbd3('0x34')](_0x279cb1[_0xbbd3('0x30')][_0xbbd3('0x34')]));_0x3610a3[_0xbbd3('0x33')]=_0x3610a3[_0xbbd3('0x33')]['length']?_0x3610a3['attributes']:_0x1c241f['model'];if(!_0x279cb1[_0xbbd3('0x30')][_0xbbd3('0x35')]('nolimit')){_0x3610a3['limit']=qs['limit'](_0x279cb1['query'][_0xbbd3('0x36')]);_0x3610a3[_0xbbd3('0x1e')]=qs[_0xbbd3('0x1e')](_0x279cb1[_0xbbd3('0x30')]['offset']);}_0x3610a3[_0xbbd3('0x37')]=qs[_0xbbd3('0x38')](_0x279cb1['query'][_0xbbd3('0x38')]);_0x3610a3[_0xbbd3('0x39')]=qs[_0xbbd3('0x32')](_[_0xbbd3('0x3a')](_0x279cb1['query'],_0x1c241f[_0xbbd3('0x32')]),_0xc70b0e);if(_0x279cb1[_0xbbd3('0x30')][_0xbbd3('0x3b')]){_0x3610a3[_0xbbd3('0x39')]=_[_0xbbd3('0x3c')](_0x3610a3[_0xbbd3('0x39')],{'$or':_[_0xbbd3('0x29')](_0xc70b0e,function(_0x10d278){if(_0x10d278[_0xbbd3('0x2d')]!==_0xbbd3('0x3d')){var _0xc60e17={};_0xc60e17[_0x10d278[_0xbbd3('0x27')]]={'$like':'%'+_0x279cb1[_0xbbd3('0x30')][_0xbbd3('0x3b')]+'%'};return _0xc60e17;}})});}_0x3610a3=_['merge']({},_0x3610a3,_0x279cb1['options']);var _0x19440b={'where':_0x3610a3[_0xbbd3('0x39')]};return db[_0xbbd3('0x2a')]['count'](_0x19440b)[_0xbbd3('0x24')](function(_0x287011){_0x3780e4[_0xbbd3('0x1d')]=_0x287011;if(_0x279cb1[_0xbbd3('0x30')][_0xbbd3('0x3e')]){_0x3610a3[_0xbbd3('0x3f')]=[{'all':!![]}];}return db[_0xbbd3('0x2a')][_0xbbd3('0x40')](_0x3610a3);})['then'](function(_0x310b82){_0x3780e4[_0xbbd3('0x41')]=_0x310b82;return _0x3780e4;})[_0xbbd3('0x24')](respondWithFilteredResult(_0x20e872,_0x3610a3))['catch'](handleError(_0x20e872,null));};exports[_0xbbd3('0x42')]=function(_0x2986db,_0x213897){var _0x1fc549={'raw':!![],'where':{'id':_0x2986db[_0xbbd3('0x43')]['id']}},_0x252857={};_0x252857['model']=_[_0xbbd3('0x31')](db[_0xbbd3('0x2a')][_0xbbd3('0x2b')]);_0x252857['query']=_[_0xbbd3('0x31')](_0x2986db[_0xbbd3('0x30')]);_0x252857['filters']=_[_0xbbd3('0x44')](_0x252857['model'],_0x252857['query']);_0x1fc549[_0xbbd3('0x33')]=_[_0xbbd3('0x44')](_0x252857[_0xbbd3('0x2f')],qs[_0xbbd3('0x34')](_0x2986db[_0xbbd3('0x30')][_0xbbd3('0x34')]));_0x1fc549[_0xbbd3('0x33')]=_0x1fc549[_0xbbd3('0x33')][_0xbbd3('0x45')]?_0x1fc549[_0xbbd3('0x33')]:_0x252857['model'];if(_0x2986db['query']['includeAll']){_0x1fc549['include']=[{'all':!![]}];}_0x1fc549=_[_0xbbd3('0x3c')]({},_0x1fc549,_0x2986db[_0xbbd3('0x46')]);return db[_0xbbd3('0x2a')][_0xbbd3('0x47')](_0x1fc549)[_0xbbd3('0x24')](handleEntityNotFound(_0x213897,null))[_0xbbd3('0x24')](respondWithResult(_0x213897,null))[_0xbbd3('0x48')](handleError(_0x213897,null));};exports['create']=function(_0x9d80bb,_0x39d3c0){return db['FaxQueueReport'][_0xbbd3('0x49')](_0x9d80bb[_0xbbd3('0x4a')],{})['then'](respondWithResult(_0x39d3c0,0xc9))[_0xbbd3('0x48')](handleError(_0x39d3c0,null));};exports[_0xbbd3('0x23')]=function(_0x32404f,_0x22feba){if(_0x32404f['body']['id']){delete _0x32404f['body']['id'];}return db['FaxQueueReport'][_0xbbd3('0x47')]({'where':{'id':_0x32404f['params']['id']}})[_0xbbd3('0x24')](handleEntityNotFound(_0x22feba,null))[_0xbbd3('0x24')](saveUpdates(_0x32404f[_0xbbd3('0x4a')],null))[_0xbbd3('0x24')](respondWithResult(_0x22feba,null))[_0xbbd3('0x48')](handleError(_0x22feba,null));};exports['destroy']=function(_0x5c5f16,_0x1bbbac){return db[_0xbbd3('0x2a')][_0xbbd3('0x47')]({'where':{'id':_0x5c5f16[_0xbbd3('0x43')]['id']}})[_0xbbd3('0x24')](handleEntityNotFound(_0x1bbbac,null))['then'](removeEntity(_0x1bbbac,null))[_0xbbd3('0x48')](handleError(_0x1bbbac,null));};exports[_0xbbd3('0x4b')]=function(_0x3cbf4b,_0x4e49f5){return db[_0xbbd3('0x2a')][_0xbbd3('0x4b')]()[_0xbbd3('0x24')](respondWithResult(_0x4e49f5,null))[_0xbbd3('0x48')](handleError(_0x4e49f5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 82348f6..01f4377 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x41de53,_0x1a3151){var _0x3fcb11=function(_0x16d28c){while(--_0x16d28c){_0x41de53['push'](_0x41de53['shift']());}};_0x3fcb11(++_0x1a3151);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0x5fc3[_0x4c2dfc];return _0xfd728d;};'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')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x1be0d0,_0x21fc06){var _0x523d20=function(_0x8dfeab){while(--_0x8dfeab){_0x1be0d0['push'](_0x1be0d0['shift']());}};_0x523d20(++_0x21fc06);}(_0xf494,0x1c6));var _0x4f49=function(_0x366f0c,_0x3dd0e7){_0x366f0c=_0x366f0c-0x0;var _0x9bc3bc=_0xf494[_0x366f0c];return _0x9bc3bc;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('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 2db0107..2585437 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 _0xd1db=['body','options','raw','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','FaxQueueReport','limit','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','error','code','message','result','catch'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xd1db,0x18e));var _0xbd1d=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0xd1db[_0x1ebe2f];return _0xdeb06f;};'use strict';var _=require('lodash');var util=require(_0xbd1d('0x0'));var moment=require(_0xbd1d('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd1d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd1d('0x3'))['db'];var utils=require(_0xbd1d('0x4'));var logger=require(_0xbd1d('0x5'))('rpc');var config=require(_0xbd1d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd1d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x159945,_0x594867,_0x5e5cd4){return new BPromise(function(_0x188c8e,_0x52719e){return client[_0xbd1d('0x8')](_0x159945,_0x5e5cd4)[_0xbd1d('0x9')](function(_0x8ffe9f){logger[_0xbd1d('0xa')](_0xbd1d('0xb'),_0x594867,'request\x20sent');logger[_0xbd1d('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x594867,'request\x20sent',JSON['stringify'](_0x8ffe9f));if(_0x8ffe9f['error']){if(_0x8ffe9f[_0xbd1d('0xd')][_0xbd1d('0xe')]===0x1f4){logger[_0xbd1d('0xd')](_0xbd1d('0xb'),_0x594867,_0x8ffe9f['error'][_0xbd1d('0xf')]);return _0x52719e(_0x8ffe9f[_0xbd1d('0xd')]['message']);}logger[_0xbd1d('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x594867,_0x8ffe9f[_0xbd1d('0xd')][_0xbd1d('0xf')]);return _0x188c8e(_0x8ffe9f[_0xbd1d('0xd')][_0xbd1d('0xf')]);}else{logger[_0xbd1d('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x594867,'request\x20sent');_0x188c8e(_0x8ffe9f[_0xbd1d('0x10')][_0xbd1d('0xf')]);}})[_0xbd1d('0x11')](function(_0x150f08){logger[_0xbd1d('0xd')](_0xbd1d('0xb'),_0x594867,_0x150f08);_0x52719e(_0x150f08);});});}exports['CreateFaxQueueReport']=function(_0x514f05){var _0x3df0f1=this;return new Promise(function(_0x41ba16,_0x5ea1f8){return db['FaxQueueReport']['create'](_0x514f05[_0xbd1d('0x12')],{'raw':_0x514f05[_0xbd1d('0x13')]?_0x514f05['options'][_0xbd1d('0x14')]===undefined?!![]:![]:!![]})[_0xbd1d('0x9')](function(_0x57bc7a){logger[_0xbd1d('0xa')](_0xbd1d('0x15'),_0x514f05);logger[_0xbd1d('0xc')](_0xbd1d('0x15'),_0x514f05,JSON[_0xbd1d('0x16')](_0x57bc7a));_0x41ba16(_0x57bc7a);})[_0xbd1d('0x11')](function(_0xa27f07){logger['error'](_0xbd1d('0x15'),_0xa27f07[_0xbd1d('0xf')],_0x514f05);_0x5ea1f8(_0x3df0f1[_0xbd1d('0xd')](0x1f4,_0xa27f07['message']));});});};exports[_0xbd1d('0x17')]=function(_0x5b9171){var _0x3aa4fc=this;return new Promise(function(_0x565734,_0x2ee0fb){return db[_0xbd1d('0x18')]['update'](_0x5b9171[_0xbd1d('0x12')],{'raw':_0x5b9171[_0xbd1d('0x13')]?_0x5b9171[_0xbd1d('0x13')][_0xbd1d('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b9171[_0xbd1d('0x13')]?_0x5b9171[_0xbd1d('0x13')]['where']||null:null,'attributes':_0x5b9171[_0xbd1d('0x13')]?_0x5b9171[_0xbd1d('0x13')]['attributes']||null:null,'limit':_0x5b9171[_0xbd1d('0x13')]?_0x5b9171[_0xbd1d('0x13')][_0xbd1d('0x19')]||null:null})['then'](function(_0x3f0ae0){logger[_0xbd1d('0xa')](_0xbd1d('0x17'),_0x5b9171);logger['debug']('UpdateFaxQueueReport',_0x5b9171,JSON[_0xbd1d('0x16')](_0x3f0ae0));_0x565734(_0x3f0ae0);})[_0xbd1d('0x11')](function(_0x46e099){logger[_0xbd1d('0xd')](_0xbd1d('0x17'),_0x46e099[_0xbd1d('0xf')],_0x5b9171);_0x2ee0fb(_0x3aa4fc['error'](0x1f4,_0x46e099[_0xbd1d('0xf')]));});});}; \ No newline at end of file +var _0xa3b1=['result','catch','FaxQueueReport','create','body','options','CreateFaxQueueReport','UpdateFaxQueueReport','update','raw','where','limit','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','request','then','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0xa3b1,0xd7));var _0x1a3b=function(_0x2fbfe8,_0x2acad1){_0x2fbfe8=_0x2fbfe8-0x0;var _0x7298da=_0xa3b1[_0x2fbfe8];return _0x7298da;};'use strict';var _=require(_0x1a3b('0x0'));var util=require('util');var moment=require(_0x1a3b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a3b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a3b('0x3'))(_0x1a3b('0x4'));var config=require(_0x1a3b('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x162415,_0x1f1870,_0x4d093b){return new BPromise(function(_0x5c6dff,_0x19e2fe){return client[_0x1a3b('0x6')](_0x162415,_0x4d093b)[_0x1a3b('0x7')](function(_0x5532d5){logger['info'](_0x1a3b('0x8'),_0x1f1870,'request\x20sent');logger[_0x1a3b('0x9')](_0x1a3b('0xa'),_0x1f1870,_0x1a3b('0xb'),JSON[_0x1a3b('0xc')](_0x5532d5));if(_0x5532d5[_0x1a3b('0xd')]){if(_0x5532d5[_0x1a3b('0xd')][_0x1a3b('0xe')]===0x1f4){logger[_0x1a3b('0xd')](_0x1a3b('0x8'),_0x1f1870,_0x5532d5[_0x1a3b('0xd')][_0x1a3b('0xf')]);return _0x19e2fe(_0x5532d5['error']['message']);}logger[_0x1a3b('0xd')](_0x1a3b('0x8'),_0x1f1870,_0x5532d5[_0x1a3b('0xd')][_0x1a3b('0xf')]);return _0x5c6dff(_0x5532d5['error']['message']);}else{logger[_0x1a3b('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x1f1870,_0x1a3b('0xb'));_0x5c6dff(_0x5532d5[_0x1a3b('0x11')][_0x1a3b('0xf')]);}})[_0x1a3b('0x12')](function(_0x13e14a){logger[_0x1a3b('0xd')](_0x1a3b('0x8'),_0x1f1870,_0x13e14a);_0x19e2fe(_0x13e14a);});});}exports['CreateFaxQueueReport']=function(_0xf356bf){var _0x5708ca=this;return new Promise(function(_0x77f7eb,_0x26b1ec){return db[_0x1a3b('0x13')][_0x1a3b('0x14')](_0xf356bf[_0x1a3b('0x15')],{'raw':_0xf356bf[_0x1a3b('0x16')]?_0xf356bf[_0x1a3b('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33e363){logger[_0x1a3b('0x10')](_0x1a3b('0x17'),_0xf356bf);logger[_0x1a3b('0x9')](_0x1a3b('0x17'),_0xf356bf,JSON['stringify'](_0x33e363));_0x77f7eb(_0x33e363);})['catch'](function(_0x43c94d){logger[_0x1a3b('0xd')]('CreateFaxQueueReport',_0x43c94d[_0x1a3b('0xf')],_0xf356bf);_0x26b1ec(_0x5708ca['error'](0x1f4,_0x43c94d[_0x1a3b('0xf')]));});});};exports[_0x1a3b('0x18')]=function(_0x26b7c0){var _0x48268c=this;return new Promise(function(_0x1fa47f,_0x48ce18){return db[_0x1a3b('0x13')][_0x1a3b('0x19')](_0x26b7c0['body'],{'raw':_0x26b7c0[_0x1a3b('0x16')]?_0x26b7c0[_0x1a3b('0x16')][_0x1a3b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26b7c0[_0x1a3b('0x16')]?_0x26b7c0['options'][_0x1a3b('0x1b')]||null:null,'attributes':_0x26b7c0[_0x1a3b('0x16')]?_0x26b7c0['options']['attributes']||null:null,'limit':_0x26b7c0[_0x1a3b('0x16')]?_0x26b7c0[_0x1a3b('0x16')][_0x1a3b('0x1c')]||null:null})[_0x1a3b('0x7')](function(_0x421063){logger[_0x1a3b('0x10')]('UpdateFaxQueueReport',_0x26b7c0);logger[_0x1a3b('0x9')](_0x1a3b('0x18'),_0x26b7c0,JSON['stringify'](_0x421063));_0x1fa47f(_0x421063);})[_0x1a3b('0x12')](function(_0x4089ac){logger[_0x1a3b('0xd')](_0x1a3b('0x18'),_0x4089ac['message'],_0x26b7c0);_0x48ce18(_0x48268c[_0x1a3b('0xd')](0x1f4,_0x4089ac[_0x1a3b('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index fd6fb13..32a028f 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 _0xb85c=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','post','create','put','/:id'];(function(_0x135a49,_0x3db9f4){var _0xbdc749=function(_0x45fec0){while(--_0x45fec0){_0x135a49['push'](_0x135a49['shift']());}};_0xbdc749(++_0x3db9f4);}(_0xb85c,0x68));var _0xcb85=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb85c[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xcb85('0x0'));var util=require(_0xcb85('0x1'));var path=require('path');var timeout=require(_0xcb85('0x2'));var express=require(_0xcb85('0x3'));var router=express[_0xcb85('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb85('0x5'));var interaction=require(_0xcb85('0x6'));var config=require(_0xcb85('0x7'));var controller=require('./faxQueueReport.controller');router[_0xcb85('0x8')]('/',auth[_0xcb85('0x9')](),controller['index']);router[_0xcb85('0x8')]('/describe',auth[_0xcb85('0x9')](),controller[_0xcb85('0xa')]);router['get']('/:id',auth[_0xcb85('0x9')](),controller[_0xcb85('0xb')]);router[_0xcb85('0xc')]('/',auth[_0xcb85('0x9')](),controller[_0xcb85('0xd')]);router[_0xcb85('0xe')](_0xcb85('0xf'),auth[_0xcb85('0x9')](),controller[_0xcb85('0x10')]);router[_0xcb85('0x11')](_0xcb85('0xf'),auth[_0xcb85('0x9')](),controller[_0xcb85('0x12')]);module[_0xcb85('0x13')]=router; \ No newline at end of file +var _0x5bbd=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4cafb1,_0x2954df){var _0x5d0869=function(_0x43667a){while(--_0x43667a){_0x4cafb1['push'](_0x4cafb1['shift']());}};_0x5d0869(++_0x2954df);}(_0x5bbd,0x130));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5bb('0x0'));var util=require(_0xd5bb('0x1'));var path=require(_0xd5bb('0x2'));var timeout=require(_0xd5bb('0x3'));var express=require(_0xd5bb('0x4'));var router=express['Router']();var fs_extra=require(_0xd5bb('0x5'));var auth=require(_0xd5bb('0x6'));var interaction=require(_0xd5bb('0x7'));var config=require(_0xd5bb('0x8'));var controller=require('./faxQueueReport.controller');router[_0xd5bb('0x9')]('/',auth['isAuthenticated'](),controller[_0xd5bb('0xa')]);router[_0xd5bb('0x9')](_0xd5bb('0xb'),auth[_0xd5bb('0xc')](),controller['describe']);router[_0xd5bb('0x9')](_0xd5bb('0xd'),auth[_0xd5bb('0xc')](),controller[_0xd5bb('0xe')]);router[_0xd5bb('0xf')]('/',auth[_0xd5bb('0xc')](),controller[_0xd5bb('0x10')]);router[_0xd5bb('0x11')](_0xd5bb('0xd'),auth['isAuthenticated'](),controller[_0xd5bb('0x12')]);router[_0xd5bb('0x13')](_0xd5bb('0xd'),auth[_0xd5bb('0xc')](),controller[_0xd5bb('0x14')]);module[_0xd5bb('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 1b2f957..e9591bf 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5c33d4,_0x3621db){var _0x76150=function(_0xfbef69){while(--_0xfbef69){_0x5c33d4['push'](_0x5c33d4['shift']());}};_0x76150(++_0x3621db);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x170ec7,_0x4ddd37){var _0x10fa27=function(_0x52b053){while(--_0x52b053){_0x170ec7['push'](_0x170ec7['shift']());}};_0x10fa27(++_0x4ddd37);}(_0xaa88,0x137));var _0x8aa8=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0xaa88[_0x17e771];return _0x1f3a6d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0f2692a..6ad985c 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 _0xc919=['../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','FaxTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xd6e8a6,_0x1b3b98){var _0x398bc2=function(_0x2c884d){while(--_0x2c884d){_0xd6e8a6['push'](_0xd6e8a6['shift']());}};_0x398bc2(++_0x1b3b98);}(_0xc919,0x120));var _0x9c91=function(_0x24aa13,_0x5df808){_0x24aa13=_0x24aa13-0x0;var _0x3d018e=_0xc919[_0x24aa13];return _0x3d018e;};'use strict';var emlformat=require(_0x9c91('0x0'));var rimraf=require(_0x9c91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c91('0x2'));var rp=require(_0x9c91('0x3'));var moment=require(_0x9c91('0x4'));var BPromise=require(_0x9c91('0x5'));var Mustache=require(_0x9c91('0x6'));var util=require('util');var path=require(_0x9c91('0x7'));var sox=require(_0x9c91('0x8'));var csv=require(_0x9c91('0x9'));var ejs=require(_0x9c91('0xa'));var fs=require('fs');var fs_extra=require(_0x9c91('0xb'));var _=require(_0x9c91('0xc'));var squel=require(_0x9c91('0xd'));var crypto=require(_0x9c91('0xe'));var jsforce=require(_0x9c91('0xf'));var deskjs=require(_0x9c91('0x10'));var toCsv=require(_0x9c91('0x9'));var querystring=require(_0x9c91('0x11'));var Papa=require('papaparse');var Redis=require(_0x9c91('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9c91('0x13'));var as=require(_0x9c91('0x14'));var hardwareService=require(_0x9c91('0x15'));var logger=require(_0x9c91('0x16'))(_0x9c91('0x17'));var utils=require(_0x9c91('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9c91('0x19'))['db'];function respondWithStatusCode(_0x19ff0b,_0x36eb58){_0x36eb58=_0x36eb58||0xcc;return function(_0x58606c){if(_0x58606c){return _0x19ff0b[_0x9c91('0x1a')](_0x36eb58);}return _0x19ff0b[_0x9c91('0x1b')](_0x36eb58)[_0x9c91('0x1c')]();};}function respondWithResult(_0x16fc8f,_0x1168d6){_0x1168d6=_0x1168d6||0xc8;return function(_0xa78244){if(_0xa78244){return _0x16fc8f[_0x9c91('0x1b')](_0x1168d6)['json'](_0xa78244);}};}function respondWithFilteredResult(_0x321977,_0x15636a){return function(_0x1a6000){if(_0x1a6000){var _0x38cb23=typeof _0x15636a[_0x9c91('0x1d')]===_0x9c91('0x1e')&&typeof _0x15636a[_0x9c91('0x1f')]===_0x9c91('0x1e');var _0x354427=_0x1a6000[_0x9c91('0x20')];var _0xd92338=_0x38cb23?0x0:_0x15636a['offset'];var _0x9d9a1a=_0x38cb23?_0x1a6000[_0x9c91('0x20')]:_0x15636a['offset']+_0x15636a[_0x9c91('0x1f')];var _0x491d8a;if(_0x9d9a1a>=_0x354427){_0x9d9a1a=_0x354427;_0x491d8a=0xc8;}else{_0x491d8a=0xce;}_0x321977['status'](_0x491d8a);return _0x321977[_0x9c91('0x21')]('Content-Range',_0xd92338+'-'+_0x9d9a1a+'/'+_0x354427)[_0x9c91('0x22')](_0x1a6000);}return null;};}function patchUpdates(_0x230840){return function(_0x4d43d6){try{jsonpatch[_0x9c91('0x23')](_0x4d43d6,_0x230840,!![]);}catch(_0x4c092b){return BPromise[_0x9c91('0x24')](_0x4c092b);}return _0x4d43d6[_0x9c91('0x25')]();};}function saveUpdates(_0x180097,_0x258db4){return function(_0x58f899){if(_0x58f899){return _0x58f899[_0x9c91('0x26')](_0x180097)['then'](function(_0x521fdb){return _0x521fdb;});}return null;};}function removeEntity(_0x1d2a77,_0x55bbe3){return function(_0x270afc){if(_0x270afc){return _0x270afc[_0x9c91('0x27')]()[_0x9c91('0x28')](function(){_0x1d2a77[_0x9c91('0x1b')](0xcc)[_0x9c91('0x1c')]();});}};}function handleEntityNotFound(_0x2a9a44,_0x2f1345){return function(_0xd01809){if(!_0xd01809){_0x2a9a44['sendStatus'](0x194);}return _0xd01809;};}function handleError(_0x23443a,_0x599250){_0x599250=_0x599250||0x1f4;return function(_0x1ba9ca){logger[_0x9c91('0x29')](_0x1ba9ca[_0x9c91('0x2a')]);if(_0x1ba9ca[_0x9c91('0x2b')]){delete _0x1ba9ca[_0x9c91('0x2b')];}_0x23443a[_0x9c91('0x1b')](_0x599250)[_0x9c91('0x2c')](_0x1ba9ca);};}exports['index']=function(_0x559b3c,_0x1a148c){var _0x1c7b69={},_0x22112b={},_0x129703={'count':0x0,'rows':[]};var _0x29d674=_['map'](db[_0x9c91('0x2d')][_0x9c91('0x2e')],function(_0x3faad5){return{'name':_0x3faad5[_0x9c91('0x2f')],'type':_0x3faad5[_0x9c91('0x30')]['key']};});_0x22112b['model']=_['map'](_0x29d674,'name');_0x22112b[_0x9c91('0x31')]=_[_0x9c91('0x32')](_0x559b3c[_0x9c91('0x31')]);_0x22112b[_0x9c91('0x33')]=_[_0x9c91('0x34')](_0x22112b[_0x9c91('0x35')],_0x22112b['query']);_0x1c7b69[_0x9c91('0x36')]=_['intersection'](_0x22112b[_0x9c91('0x35')],qs['fields'](_0x559b3c['query'][_0x9c91('0x37')]));_0x1c7b69[_0x9c91('0x36')]=_0x1c7b69['attributes']['length']?_0x1c7b69[_0x9c91('0x36')]:_0x22112b[_0x9c91('0x35')];if(!_0x559b3c[_0x9c91('0x31')][_0x9c91('0x38')](_0x9c91('0x39'))){_0x1c7b69[_0x9c91('0x1f')]=qs[_0x9c91('0x1f')](_0x559b3c['query'][_0x9c91('0x1f')]);_0x1c7b69[_0x9c91('0x1d')]=qs[_0x9c91('0x1d')](_0x559b3c[_0x9c91('0x31')][_0x9c91('0x1d')]);}_0x1c7b69[_0x9c91('0x3a')]=qs['sort'](_0x559b3c[_0x9c91('0x31')][_0x9c91('0x3b')]);_0x1c7b69[_0x9c91('0x3c')]=qs['filters'](_[_0x9c91('0x3d')](_0x559b3c[_0x9c91('0x31')],_0x22112b[_0x9c91('0x33')]),_0x29d674);if(_0x559b3c['query'][_0x9c91('0x3e')]){_0x1c7b69[_0x9c91('0x3c')]=_[_0x9c91('0x3f')](_0x1c7b69['where'],{'$or':_[_0x9c91('0x40')](_0x29d674,function(_0x5d5c61){if(_0x5d5c61[_0x9c91('0x30')]!==_0x9c91('0x41')){var _0x1c8105={};_0x1c8105[_0x5d5c61[_0x9c91('0x2b')]]={'$like':'%'+_0x559b3c[_0x9c91('0x31')][_0x9c91('0x3e')]+'%'};return _0x1c8105;}})});}_0x1c7b69=_['merge']({},_0x1c7b69,_0x559b3c[_0x9c91('0x42')]);var _0x4ff44c={'where':_0x1c7b69[_0x9c91('0x3c')]};return db[_0x9c91('0x2d')][_0x9c91('0x20')](_0x4ff44c)['then'](function(_0x1272d8){_0x129703[_0x9c91('0x20')]=_0x1272d8;if(_0x559b3c[_0x9c91('0x31')][_0x9c91('0x43')]){_0x1c7b69[_0x9c91('0x44')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x9c91('0x45')](_0x1c7b69);})['then'](function(_0x45f983){_0x129703[_0x9c91('0x46')]=_0x45f983;return _0x129703;})[_0x9c91('0x28')](respondWithFilteredResult(_0x1a148c,_0x1c7b69))[_0x9c91('0x47')](handleError(_0x1a148c,null));};exports[_0x9c91('0x48')]=function(_0x13b4b3,_0x55e125){var _0x32e125={'raw':!![],'where':{'id':_0x13b4b3[_0x9c91('0x49')]['id']}},_0x3be216={};_0x3be216[_0x9c91('0x35')]=_['keys'](db[_0x9c91('0x2d')][_0x9c91('0x2e')]);_0x3be216[_0x9c91('0x31')]=_[_0x9c91('0x32')](_0x13b4b3['query']);_0x3be216[_0x9c91('0x33')]=_[_0x9c91('0x34')](_0x3be216[_0x9c91('0x35')],_0x3be216[_0x9c91('0x31')]);_0x32e125[_0x9c91('0x36')]=_[_0x9c91('0x34')](_0x3be216[_0x9c91('0x35')],qs['fields'](_0x13b4b3[_0x9c91('0x31')][_0x9c91('0x37')]));_0x32e125['attributes']=_0x32e125['attributes']['length']?_0x32e125[_0x9c91('0x36')]:_0x3be216[_0x9c91('0x35')];if(_0x13b4b3['query']['includeAll']){_0x32e125[_0x9c91('0x44')]=[{'all':!![]}];}_0x32e125=_[_0x9c91('0x3f')]({},_0x32e125,_0x13b4b3[_0x9c91('0x42')]);return db['FaxTransferReport'][_0x9c91('0x4a')](_0x32e125)[_0x9c91('0x28')](handleEntityNotFound(_0x55e125,null))[_0x9c91('0x28')](respondWithResult(_0x55e125,null))[_0x9c91('0x47')](handleError(_0x55e125,null));};exports[_0x9c91('0x4b')]=function(_0x2663f3,_0x5bc42c){return db[_0x9c91('0x2d')][_0x9c91('0x4b')](_0x2663f3[_0x9c91('0x4c')],{})[_0x9c91('0x28')](respondWithResult(_0x5bc42c,0xc9))['catch'](handleError(_0x5bc42c,null));};exports[_0x9c91('0x26')]=function(_0x4417e9,_0xf6a9e9){if(_0x4417e9['body']['id']){delete _0x4417e9[_0x9c91('0x4c')]['id'];}return db[_0x9c91('0x2d')][_0x9c91('0x4a')]({'where':{'id':_0x4417e9['params']['id']}})[_0x9c91('0x28')](handleEntityNotFound(_0xf6a9e9,null))[_0x9c91('0x28')](saveUpdates(_0x4417e9['body'],null))['then'](respondWithResult(_0xf6a9e9,null))[_0x9c91('0x47')](handleError(_0xf6a9e9,null));};exports[_0x9c91('0x27')]=function(_0x2eb4b4,_0x4caedf){return db[_0x9c91('0x2d')][_0x9c91('0x4a')]({'where':{'id':_0x2eb4b4[_0x9c91('0x49')]['id']}})[_0x9c91('0x28')](handleEntityNotFound(_0x4caedf,null))['then'](removeEntity(_0x4caedf,null))[_0x9c91('0x47')](handleError(_0x4caedf,null));};exports[_0x9c91('0x4d')]=function(_0x28e77a,_0x4ba978){return db[_0x9c91('0x2d')][_0x9c91('0x4d')]()[_0x9c91('0x28')](respondWithResult(_0x4ba978,null))['catch'](handleError(_0x4ba978,null));}; \ No newline at end of file +var _0xb529=['count','set','Content-Range','apply','reject','update','sendStatus','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','then','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xb529,0x111));var _0x9b52=function(_0x40c511,_0x568c3f){_0x40c511=_0x40c511-0x0;var _0x4f4e56=_0xb529[_0x40c511];return _0x4f4e56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b52('0x0'));var zipdir=require(_0x9b52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b52('0x2'));var moment=require(_0x9b52('0x3'));var BPromise=require(_0x9b52('0x4'));var Mustache=require(_0x9b52('0x5'));var util=require(_0x9b52('0x6'));var path=require(_0x9b52('0x7'));var sox=require(_0x9b52('0x8'));var csv=require(_0x9b52('0x9'));var ejs=require(_0x9b52('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b52('0xb'));var squel=require(_0x9b52('0xc'));var crypto=require(_0x9b52('0xd'));var jsforce=require(_0x9b52('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9b52('0x9'));var querystring=require(_0x9b52('0xf'));var Papa=require(_0x9b52('0x10'));var Redis=require(_0x9b52('0x11'));var authService=require(_0x9b52('0x12'));var qs=require(_0x9b52('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b52('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9b52('0x15'));var config=require(_0x9b52('0x16'));var licenseUtil=require(_0x9b52('0x17'));var db=require(_0x9b52('0x18'))['db'];function respondWithStatusCode(_0x2c870c,_0x2f7d89){_0x2f7d89=_0x2f7d89||0xcc;return function(_0x39367c){if(_0x39367c){return _0x2c870c['sendStatus'](_0x2f7d89);}return _0x2c870c[_0x9b52('0x19')](_0x2f7d89)[_0x9b52('0x1a')]();};}function respondWithResult(_0x482e2b,_0x559f35){_0x559f35=_0x559f35||0xc8;return function(_0x485b68){if(_0x485b68){return _0x482e2b[_0x9b52('0x19')](_0x559f35)[_0x9b52('0x1b')](_0x485b68);}};}function respondWithFilteredResult(_0x4fa0da,_0xd1fc94){return function(_0x9ebf58){if(_0x9ebf58){var _0x4ab67e=typeof _0xd1fc94[_0x9b52('0x1c')]===_0x9b52('0x1d')&&typeof _0xd1fc94[_0x9b52('0x1e')]===_0x9b52('0x1d');var _0x28b2e4=_0x9ebf58[_0x9b52('0x1f')];var _0x45ad5b=_0x4ab67e?0x0:_0xd1fc94[_0x9b52('0x1c')];var _0x492b37=_0x4ab67e?_0x9ebf58[_0x9b52('0x1f')]:_0xd1fc94[_0x9b52('0x1c')]+_0xd1fc94[_0x9b52('0x1e')];var _0x2f1bef;if(_0x492b37>=_0x28b2e4){_0x492b37=_0x28b2e4;_0x2f1bef=0xc8;}else{_0x2f1bef=0xce;}_0x4fa0da[_0x9b52('0x19')](_0x2f1bef);return _0x4fa0da[_0x9b52('0x20')](_0x9b52('0x21'),_0x45ad5b+'-'+_0x492b37+'/'+_0x28b2e4)['json'](_0x9ebf58);}return null;};}function patchUpdates(_0x18b748){return function(_0x45182d){try{jsonpatch[_0x9b52('0x22')](_0x45182d,_0x18b748,!![]);}catch(_0x158007){return BPromise[_0x9b52('0x23')](_0x158007);}return _0x45182d['save']();};}function saveUpdates(_0x543991,_0x80f212){return function(_0x37e267){if(_0x37e267){return _0x37e267[_0x9b52('0x24')](_0x543991)['then'](function(_0x15dab){return _0x15dab;});}return null;};}function removeEntity(_0x561e02,_0xd0ef60){return function(_0x1f87ce){if(_0x1f87ce){return _0x1f87ce['destroy']()['then'](function(){_0x561e02[_0x9b52('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453ad5,_0x576421){return function(_0x32a694){if(!_0x32a694){_0x453ad5[_0x9b52('0x25')](0x194);}return _0x32a694;};}function handleError(_0x12ffbc,_0x3dc26f){_0x3dc26f=_0x3dc26f||0x1f4;return function(_0x459c04){logger['error'](_0x459c04['stack']);if(_0x459c04[_0x9b52('0x26')]){delete _0x459c04['name'];}_0x12ffbc[_0x9b52('0x19')](_0x3dc26f)[_0x9b52('0x27')](_0x459c04);};}exports[_0x9b52('0x28')]=function(_0x37d34e,_0x2ff4c4){var _0x42656a={},_0x422600={},_0x190764={'count':0x0,'rows':[]};var _0x4f24ef=_['map'](db[_0x9b52('0x29')][_0x9b52('0x2a')],function(_0x56b24f){return{'name':_0x56b24f[_0x9b52('0x2b')],'type':_0x56b24f[_0x9b52('0x2c')][_0x9b52('0x2d')]};});_0x422600[_0x9b52('0x2e')]=_[_0x9b52('0x2f')](_0x4f24ef,_0x9b52('0x26'));_0x422600['query']=_[_0x9b52('0x30')](_0x37d34e[_0x9b52('0x31')]);_0x422600[_0x9b52('0x32')]=_[_0x9b52('0x33')](_0x422600['model'],_0x422600[_0x9b52('0x31')]);_0x42656a[_0x9b52('0x34')]=_[_0x9b52('0x33')](_0x422600[_0x9b52('0x2e')],qs[_0x9b52('0x35')](_0x37d34e['query'][_0x9b52('0x35')]));_0x42656a[_0x9b52('0x34')]=_0x42656a['attributes'][_0x9b52('0x36')]?_0x42656a[_0x9b52('0x34')]:_0x422600['model'];if(!_0x37d34e[_0x9b52('0x31')][_0x9b52('0x37')](_0x9b52('0x38'))){_0x42656a['limit']=qs[_0x9b52('0x1e')](_0x37d34e['query'][_0x9b52('0x1e')]);_0x42656a['offset']=qs[_0x9b52('0x1c')](_0x37d34e[_0x9b52('0x31')][_0x9b52('0x1c')]);}_0x42656a[_0x9b52('0x39')]=qs['sort'](_0x37d34e[_0x9b52('0x31')][_0x9b52('0x3a')]);_0x42656a[_0x9b52('0x3b')]=qs['filters'](_[_0x9b52('0x3c')](_0x37d34e[_0x9b52('0x31')],_0x422600[_0x9b52('0x32')]),_0x4f24ef);if(_0x37d34e[_0x9b52('0x31')][_0x9b52('0x3d')]){_0x42656a[_0x9b52('0x3b')]=_[_0x9b52('0x3e')](_0x42656a[_0x9b52('0x3b')],{'$or':_[_0x9b52('0x2f')](_0x4f24ef,function(_0xc89d23){if(_0xc89d23['type']!==_0x9b52('0x3f')){var _0x556156={};_0x556156[_0xc89d23[_0x9b52('0x26')]]={'$like':'%'+_0x37d34e[_0x9b52('0x31')]['filter']+'%'};return _0x556156;}})});}_0x42656a=_[_0x9b52('0x3e')]({},_0x42656a,_0x37d34e[_0x9b52('0x40')]);var _0x35f4b5={'where':_0x42656a[_0x9b52('0x3b')]};return db[_0x9b52('0x29')][_0x9b52('0x1f')](_0x35f4b5)['then'](function(_0x19e638){_0x190764[_0x9b52('0x1f')]=_0x19e638;if(_0x37d34e['query'][_0x9b52('0x41')]){_0x42656a[_0x9b52('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x9b52('0x43')](_0x42656a);})['then'](function(_0x2c2bda){_0x190764[_0x9b52('0x44')]=_0x2c2bda;return _0x190764;})['then'](respondWithFilteredResult(_0x2ff4c4,_0x42656a))[_0x9b52('0x45')](handleError(_0x2ff4c4,null));};exports['show']=function(_0xcf8a9,_0x3fd086){var _0x2c3a1b={'raw':!![],'where':{'id':_0xcf8a9[_0x9b52('0x46')]['id']}},_0x12567d={};_0x12567d[_0x9b52('0x2e')]=_[_0x9b52('0x30')](db[_0x9b52('0x29')][_0x9b52('0x2a')]);_0x12567d['query']=_[_0x9b52('0x30')](_0xcf8a9[_0x9b52('0x31')]);_0x12567d[_0x9b52('0x32')]=_[_0x9b52('0x33')](_0x12567d[_0x9b52('0x2e')],_0x12567d[_0x9b52('0x31')]);_0x2c3a1b['attributes']=_[_0x9b52('0x33')](_0x12567d[_0x9b52('0x2e')],qs[_0x9b52('0x35')](_0xcf8a9[_0x9b52('0x31')][_0x9b52('0x35')]));_0x2c3a1b[_0x9b52('0x34')]=_0x2c3a1b[_0x9b52('0x34')]['length']?_0x2c3a1b[_0x9b52('0x34')]:_0x12567d['model'];if(_0xcf8a9[_0x9b52('0x31')][_0x9b52('0x41')]){_0x2c3a1b[_0x9b52('0x42')]=[{'all':!![]}];}_0x2c3a1b=_[_0x9b52('0x3e')]({},_0x2c3a1b,_0xcf8a9[_0x9b52('0x40')]);return db['FaxTransferReport']['find'](_0x2c3a1b)[_0x9b52('0x47')](handleEntityNotFound(_0x3fd086,null))[_0x9b52('0x47')](respondWithResult(_0x3fd086,null))[_0x9b52('0x45')](handleError(_0x3fd086,null));};exports[_0x9b52('0x48')]=function(_0x39cc19,_0x4f9636){return db[_0x9b52('0x29')][_0x9b52('0x48')](_0x39cc19[_0x9b52('0x49')],{})[_0x9b52('0x47')](respondWithResult(_0x4f9636,0xc9))['catch'](handleError(_0x4f9636,null));};exports[_0x9b52('0x24')]=function(_0x45cd77,_0x2a0db0){if(_0x45cd77[_0x9b52('0x49')]['id']){delete _0x45cd77[_0x9b52('0x49')]['id'];}return db[_0x9b52('0x29')][_0x9b52('0x4a')]({'where':{'id':_0x45cd77['params']['id']}})[_0x9b52('0x47')](handleEntityNotFound(_0x2a0db0,null))['then'](saveUpdates(_0x45cd77[_0x9b52('0x49')],null))[_0x9b52('0x47')](respondWithResult(_0x2a0db0,null))[_0x9b52('0x45')](handleError(_0x2a0db0,null));};exports['destroy']=function(_0x3ab0dc,_0x825e5b){return db['FaxTransferReport'][_0x9b52('0x4a')]({'where':{'id':_0x3ab0dc[_0x9b52('0x46')]['id']}})[_0x9b52('0x47')](handleEntityNotFound(_0x825e5b,null))[_0x9b52('0x47')](removeEntity(_0x825e5b,null))[_0x9b52('0x45')](handleError(_0x825e5b,null));};exports[_0x9b52('0x4b')]=function(_0x51f7df,_0x443220){return db[_0x9b52('0x29')]['describe']()['then'](respondWithResult(_0x443220,null))[_0x9b52('0x45')](handleError(_0x443220,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3737cc0..df6c01f 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 _0x3162=['moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash'];(function(_0x4fed7e,_0x2fb8e7){var _0x465f5f=function(_0x161e75){while(--_0x161e75){_0x4fed7e['push'](_0x4fed7e['shift']());}};_0x465f5f(++_0x2fb8e7);}(_0x3162,0xd0));var _0x2316=function(_0x14b989,_0x46995a){_0x14b989=_0x14b989-0x0;var _0x3e33af=_0x3162[_0x14b989];return _0x3e33af;};'use strict';var _=require(_0x2316('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2316('0x1'));var BPromise=require('bluebird');var rp=require(_0x2316('0x2'));var fs=require('fs');var path=require(_0x2316('0x3'));var rimraf=require(_0x2316('0x4'));var config=require(_0x2316('0x5'));var attributes=require(_0x2316('0x6'));module[_0x2316('0x7')]=function(_0x1d50ad,_0x535376){return _0x1d50ad[_0x2316('0x8')](_0x2316('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x2316('0xa'),'fields':[_0x2316('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12c8=['api','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x317cbe,_0x24ab35){var _0x579b98=function(_0x4e666c){while(--_0x4e666c){_0x317cbe['push'](_0x317cbe['shift']());}};_0x579b98(++_0x24ab35);}(_0x12c8,0x1a1));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x812c('0x0'));var util=require(_0x812c('0x1'));var logger=require(_0x812c('0x2'))(_0x812c('0x3'));var moment=require('moment');var BPromise=require(_0x812c('0x4'));var rp=require(_0x812c('0x5'));var fs=require('fs');var path=require(_0x812c('0x6'));var rimraf=require(_0x812c('0x7'));var config=require(_0x812c('0x8'));var attributes=require(_0x812c('0x9'));module[_0x812c('0xa')]=function(_0x3fd3fb,_0x361c2e){return _0x3fd3fb[_0x812c('0xb')](_0x812c('0xc'),attributes,{'tableName':_0x812c('0xd'),'paranoid':![],'indexes':[{'name':_0x812c('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 87718d9..8d4ee94 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 _0x1af2=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x5bc0f9,_0x2d5751){var _0xe73d48=function(_0x1784c9){while(--_0x1784c9){_0x5bc0f9['push'](_0x5bc0f9['shift']());}};_0xe73d48(++_0x2d5751);}(_0x1af2,0x11d));var _0x21af=function(_0x87d3ec,_0x387888){_0x87d3ec=_0x87d3ec-0x0;var _0x5f3f6f=_0x1af2[_0x87d3ec];return _0x5f3f6f;};'use strict';var _=require(_0x21af('0x0'));var util=require(_0x21af('0x1'));var moment=require('moment');var BPromise=require(_0x21af('0x2'));var rs=require(_0x21af('0x3'));var fs=require('fs');var Redis=require(_0x21af('0x4'));var db=require(_0x21af('0x5'))['db'];var utils=require(_0x21af('0x6'));var logger=require(_0x21af('0x7'))('rpc');var config=require(_0x21af('0x8'));var jayson=require(_0x21af('0x9'));var client=jayson[_0x21af('0xa')][_0x21af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e53d5,_0x114dc1,_0x4e05b9){return new BPromise(function(_0x4f9705,_0x564dc7){return client['request'](_0x2e53d5,_0x4e05b9)[_0x21af('0xc')](function(_0x94fda2){logger[_0x21af('0xd')](_0x21af('0xe'),_0x114dc1,_0x21af('0xf'));logger[_0x21af('0x10')](_0x21af('0x11'),_0x114dc1,_0x21af('0xf'),JSON[_0x21af('0x12')](_0x94fda2));if(_0x94fda2[_0x21af('0x13')]){if(_0x94fda2[_0x21af('0x13')]['code']===0x1f4){logger[_0x21af('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x114dc1,_0x94fda2[_0x21af('0x13')][_0x21af('0x14')]);return _0x564dc7(_0x94fda2[_0x21af('0x13')]['message']);}logger['error'](_0x21af('0xe'),_0x114dc1,_0x94fda2['error']['message']);return _0x4f9705(_0x94fda2[_0x21af('0x13')][_0x21af('0x14')]);}else{logger[_0x21af('0xd')](_0x21af('0xe'),_0x114dc1,_0x21af('0xf'));_0x4f9705(_0x94fda2[_0x21af('0x15')][_0x21af('0x14')]);}})['catch'](function(_0x807361){logger['error'](_0x21af('0xe'),_0x114dc1,_0x807361);_0x564dc7(_0x807361);});});} \ No newline at end of file +var _0x19d6=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x19d6,0x1c6));var _0x619d=function(_0x1843a5,_0x491ed9){_0x1843a5=_0x1843a5-0x0;var _0x13e2ae=_0x19d6[_0x1843a5];return _0x13e2ae;};'use strict';var _=require(_0x619d('0x0'));var util=require(_0x619d('0x1'));var moment=require('moment');var BPromise=require(_0x619d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x619d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x619d('0x4'));var logger=require(_0x619d('0x5'))(_0x619d('0x6'));var config=require(_0x619d('0x7'));var jayson=require(_0x619d('0x8'));var client=jayson[_0x619d('0x9')][_0x619d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6c02,_0x15521f,_0x49f1ff){return new BPromise(function(_0x31d29e,_0x132c5b){return client['request'](_0x4e6c02,_0x49f1ff)[_0x619d('0xb')](function(_0x53b398){logger[_0x619d('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x15521f,_0x619d('0xd'));logger['debug'](_0x619d('0xe'),_0x15521f,'request\x20sent',JSON['stringify'](_0x53b398));if(_0x53b398[_0x619d('0xf')]){if(_0x53b398[_0x619d('0xf')][_0x619d('0x10')]===0x1f4){logger[_0x619d('0xf')](_0x619d('0x11'),_0x15521f,_0x53b398[_0x619d('0xf')][_0x619d('0x12')]);return _0x132c5b(_0x53b398[_0x619d('0xf')][_0x619d('0x12')]);}logger['error'](_0x619d('0x11'),_0x15521f,_0x53b398[_0x619d('0xf')][_0x619d('0x12')]);return _0x31d29e(_0x53b398[_0x619d('0xf')][_0x619d('0x12')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x15521f,_0x619d('0xd'));_0x31d29e(_0x53b398[_0x619d('0x13')][_0x619d('0x12')]);}})['catch'](function(_0x46fee5){logger[_0x619d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x15521f,_0x46fee5);_0x132c5b(_0x46fee5);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f15c1aa..5f6f52c 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 _0x8f92=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8f92,0xfd));var _0x28f9=function(_0x4ae2df,_0x522ed8){_0x4ae2df=_0x4ae2df-0x0;var _0x182a3e=_0x8f92[_0x4ae2df];return _0x182a3e;};'use strict';var multer=require(_0x28f9('0x0'));var util=require(_0x28f9('0x1'));var path=require(_0x28f9('0x2'));var timeout=require(_0x28f9('0x3'));var express=require(_0x28f9('0x4'));var router=express[_0x28f9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x28f9('0x6'));var interaction=require(_0x28f9('0x7'));var config=require(_0x28f9('0x8'));var controller=require(_0x28f9('0x9'));router[_0x28f9('0xa')]('/',auth[_0x28f9('0xb')](),controller['index']);router['get'](_0x28f9('0xc'),auth['isAuthenticated'](),controller[_0x28f9('0xd')]);router[_0x28f9('0xa')](_0x28f9('0xe'),auth[_0x28f9('0xb')](),controller[_0x28f9('0xf')]);router[_0x28f9('0x10')]('/',auth['isAuthenticated'](),controller[_0x28f9('0x11')]);router[_0x28f9('0x12')](_0x28f9('0xe'),auth[_0x28f9('0xb')](),controller[_0x28f9('0x13')]);router[_0x28f9('0x14')](_0x28f9('0xe'),auth[_0x28f9('0xb')](),controller[_0x28f9('0x15')]);module[_0x28f9('0x16')]=router; \ No newline at end of file +var _0xe596=['put','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create'];(function(_0x183400,_0x222317){var _0x3e0113=function(_0x535dd1){while(--_0x535dd1){_0x183400['push'](_0x183400['shift']());}};_0x3e0113(++_0x222317);}(_0xe596,0xf5));var _0x6e59=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe596[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x6e59('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6e59('0x1'));var router=express['Router']();var fs_extra=require(_0x6e59('0x2'));var auth=require(_0x6e59('0x3'));var interaction=require(_0x6e59('0x4'));var config=require(_0x6e59('0x5'));var controller=require(_0x6e59('0x6'));router['get']('/',auth[_0x6e59('0x7')](),controller[_0x6e59('0x8')]);router[_0x6e59('0x9')]('/describe',auth[_0x6e59('0x7')](),controller[_0x6e59('0xa')]);router[_0x6e59('0x9')](_0x6e59('0xb'),auth[_0x6e59('0x7')](),controller[_0x6e59('0xc')]);router[_0x6e59('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e59('0xe')]);router[_0x6e59('0xf')](_0x6e59('0xb'),auth[_0x6e59('0x7')](),controller[_0x6e59('0x10')]);router[_0x6e59('0x11')]('/:id',auth[_0x6e59('0x7')](),controller[_0x6e59('0x12')]);module[_0x6e59('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6330e11..fd37597 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 _0x8159=['isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8159,0x91));var _0x9815=function(_0x164470,_0x4ed989){_0x164470=_0x164470-0x0;var _0x5c8edb=_0x8159[_0x164470];return _0x5c8edb;};'use strict';var multer=require('multer');var util=require(_0x9815('0x0'));var path=require(_0x9815('0x1'));var timeout=require(_0x9815('0x2'));var express=require(_0x9815('0x3'));var router=express[_0x9815('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9815('0x5'));var interaction=require(_0x9815('0x6'));var config=require(_0x9815('0x7'));var controller=require(_0x9815('0x8'));router['get']('/',auth[_0x9815('0x9')](),controller[_0x9815('0xa')]);router[_0x9815('0xb')](_0x9815('0xc'),auth[_0x9815('0x9')](),controller['show']);router[_0x9815('0xb')](_0x9815('0xd'),auth[_0x9815('0x9')](),controller[_0x9815('0xe')]);router[_0x9815('0xb')]('/:id/fields',auth[_0x9815('0x9')](),controller[_0x9815('0xf')]);router[_0x9815('0x10')]('/',auth[_0x9815('0x9')](),controller[_0x9815('0x11')]);router[_0x9815('0x10')](_0x9815('0xd'),auth[_0x9815('0x9')](),controller[_0x9815('0x12')]);router[_0x9815('0x13')](_0x9815('0xc'),auth[_0x9815('0x9')](),controller['update']);router[_0x9815('0x14')](_0x9815('0xc'),auth[_0x9815('0x9')](),controller['destroy']);module[_0x9815('0x15')]=router; \ No newline at end of file +var _0x43ab=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0x43ab,0x7e));var _0xb43a=function(_0xfda470,_0x558a8e){_0xfda470=_0xfda470-0x0;var _0x114a9f=_0x43ab[_0xfda470];return _0x114a9f;};'use strict';var multer=require(_0xb43a('0x0'));var util=require(_0xb43a('0x1'));var path=require(_0xb43a('0x2'));var timeout=require('connect-timeout');var express=require(_0xb43a('0x3'));var router=express['Router']();var fs_extra=require(_0xb43a('0x4'));var auth=require(_0xb43a('0x5'));var interaction=require(_0xb43a('0x6'));var config=require(_0xb43a('0x7'));var controller=require(_0xb43a('0x8'));router[_0xb43a('0x9')]('/',auth['isAuthenticated'](),controller[_0xb43a('0xa')]);router[_0xb43a('0x9')](_0xb43a('0xb'),auth[_0xb43a('0xc')](),controller[_0xb43a('0xd')]);router[_0xb43a('0x9')](_0xb43a('0xe'),auth[_0xb43a('0xc')](),controller[_0xb43a('0xf')]);router['get'](_0xb43a('0x10'),auth['isAuthenticated'](),controller[_0xb43a('0x11')]);router[_0xb43a('0x12')]('/',auth[_0xb43a('0xc')](),controller[_0xb43a('0x13')]);router[_0xb43a('0x12')](_0xb43a('0xe'),auth[_0xb43a('0xc')](),controller[_0xb43a('0x14')]);router[_0xb43a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb43a('0x16')]);router[_0xb43a('0x17')](_0xb43a('0xb'),auth[_0xb43a('0xc')](),controller[_0xb43a('0x18')]);module[_0xb43a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 028b864..efe0f77 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 _0x906b=['integrationTab','newTab','exports','STRING','ENUM','basic'];(function(_0x583161,_0x3e0a3e){var _0x67a621=function(_0x555390){while(--_0x555390){_0x583161['push'](_0x583161['shift']());}};_0x67a621(++_0x3e0a3e);}(_0x906b,0x116));var _0xb906=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x906b[_0xb66df];return _0x42a702;};'use strict';var Sequelize=require('sequelize');module[_0xb906('0x0')]={'name':{'type':Sequelize[_0xb906('0x1')]},'description':{'type':Sequelize[_0xb906('0x1')]},'username':{'type':Sequelize[_0xb906('0x1')]},'remoteUri':{'type':Sequelize[_0xb906('0x1')]},'authType':{'type':Sequelize[_0xb906('0x2')]('basic'),'defaultValue':_0xb906('0x3')},'password':{'type':Sequelize[_0xb906('0x1')]},'consumerKey':{'type':Sequelize[_0xb906('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb906('0x1')]},'tokenSecret':{'type':Sequelize[_0xb906('0x1')]},'serverUrl':{'type':Sequelize[_0xb906('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb906('0x4'),_0xb906('0x5')),'defaultValue':_0xb906('0x4')}}; \ No newline at end of file +var _0x56ad=['STRING','ENUM','basic','integrationTab','sequelize','exports'];(function(_0x1b33bc,_0x282af6){var _0x23b81c=function(_0x67994a){while(--_0x67994a){_0x1b33bc['push'](_0x1b33bc['shift']());}};_0x23b81c(++_0x282af6);}(_0x56ad,0x1e4));var _0xd56a=function(_0x58619f,_0x7fe474){_0x58619f=_0x58619f-0x0;var _0xafddc7=_0x56ad[_0x58619f];return _0xafddc7;};'use strict';var Sequelize=require(_0xd56a('0x0'));module[_0xd56a('0x1')]={'name':{'type':Sequelize[_0xd56a('0x2')]},'description':{'type':Sequelize[_0xd56a('0x2')]},'username':{'type':Sequelize[_0xd56a('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xd56a('0x3')](_0xd56a('0x4')),'defaultValue':_0xd56a('0x4')},'password':{'type':Sequelize[_0xd56a('0x2')]},'consumerKey':{'type':Sequelize[_0xd56a('0x2')]},'consumerSecret':{'type':Sequelize[_0xd56a('0x2')]},'token':{'type':Sequelize[_0xd56a('0x2')]},'tokenSecret':{'type':Sequelize[_0xd56a('0x2')]},'serverUrl':{'type':Sequelize[_0xd56a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd56a('0x3')](_0xd56a('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1048ca6..5761eb6 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 _0x5219=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','DeskAccount','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','application/json','headers','Authorization','%s:%s','toString','base64','concat','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials'];(function(_0x4f9971,_0x4a1f33){var _0x1a2798=function(_0x104765){while(--_0x104765){_0x4f9971['push'](_0x4f9971['shift']());}};_0x1a2798(++_0x4a1f33);}(_0x5219,0xd8));var _0x9521=function(_0x52be20,_0x205716){_0x52be20=_0x52be20-0x0;var _0x462e1c=_0x5219[_0x52be20];return _0x462e1c;};'use strict';var emlformat=require(_0x9521('0x0'));var rimraf=require(_0x9521('0x1'));var zipdir=require(_0x9521('0x2'));var jsonpatch=require(_0x9521('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9521('0x4'));var Mustache=require(_0x9521('0x5'));var util=require(_0x9521('0x6'));var path=require(_0x9521('0x7'));var sox=require('sox');var csv=require(_0x9521('0x8'));var ejs=require(_0x9521('0x9'));var fs=require('fs');var fs_extra=require(_0x9521('0xa'));var _=require('lodash');var squel=require(_0x9521('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9521('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9521('0xd'));var Papa=require(_0x9521('0xe'));var Redis=require(_0x9521('0xf'));var authService=require(_0x9521('0x10'));var qs=require(_0x9521('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9521('0x12'));var logger=require(_0x9521('0x13'))('api');var utils=require(_0x9521('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9521('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3b22ef,_0x4a2883){_0x4a2883=_0x4a2883||0xcc;return function(_0x450ac1){if(_0x450ac1){return _0x3b22ef['sendStatus'](_0x4a2883);}return _0x3b22ef[_0x9521('0x16')](_0x4a2883)[_0x9521('0x17')]();};}function respondWithResult(_0x5ac4f9,_0x5bbbae){_0x5bbbae=_0x5bbbae||0xc8;return function(_0x30b11d){if(_0x30b11d){return _0x5ac4f9[_0x9521('0x16')](_0x5bbbae)[_0x9521('0x18')](_0x30b11d);}};}function respondWithFilteredResult(_0x3f16b4,_0x11cc56){return function(_0x40feaa){if(_0x40feaa){var _0x377600=typeof _0x11cc56[_0x9521('0x19')]===_0x9521('0x1a')&&typeof _0x11cc56['limit']===_0x9521('0x1a');var _0x256871=_0x40feaa[_0x9521('0x1b')];var _0x204982=_0x377600?0x0:_0x11cc56[_0x9521('0x19')];var _0x146177=_0x377600?_0x40feaa['count']:_0x11cc56[_0x9521('0x19')]+_0x11cc56[_0x9521('0x1c')];var _0x488bb1;if(_0x146177>=_0x256871){_0x146177=_0x256871;_0x488bb1=0xc8;}else{_0x488bb1=0xce;}_0x3f16b4[_0x9521('0x16')](_0x488bb1);return _0x3f16b4[_0x9521('0x1d')](_0x9521('0x1e'),_0x204982+'-'+_0x146177+'/'+_0x256871)[_0x9521('0x18')](_0x40feaa);}return null;};}function patchUpdates(_0x244a7b){return function(_0x3cb5c6){try{jsonpatch[_0x9521('0x1f')](_0x3cb5c6,_0x244a7b,!![]);}catch(_0x50fe45){return BPromise['reject'](_0x50fe45);}return _0x3cb5c6['save']();};}function saveUpdates(_0x1cc9fb,_0x1586a8){return function(_0xa4ab37){if(_0xa4ab37){return _0xa4ab37[_0x9521('0x20')](_0x1cc9fb)[_0x9521('0x21')](function(_0x5e650a){return _0x5e650a;});}return null;};}function removeEntity(_0x4e17f6,_0x2d9f7c){return function(_0x32486a){if(_0x32486a){return _0x32486a[_0x9521('0x22')]()[_0x9521('0x21')](function(){_0x4e17f6[_0x9521('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277dbd,_0x1af3bd){return function(_0x3e8db8){if(!_0x3e8db8){_0x277dbd['sendStatus'](0x194);}return _0x3e8db8;};}function handleError(_0x2fcae2,_0x13785b){_0x13785b=_0x13785b||0x1f4;return function(_0xf7ae){logger[_0x9521('0x23')](_0xf7ae[_0x9521('0x24')]);if(_0xf7ae[_0x9521('0x25')]){delete _0xf7ae[_0x9521('0x25')];}_0x2fcae2[_0x9521('0x16')](_0x13785b)[_0x9521('0x26')](_0xf7ae);};}exports['index']=function(_0x3e24f6,_0x2d4cf6){var _0x5b00a8={},_0x59dfe1={},_0x57a65b={'count':0x0,'rows':[]};var _0x2a532a=_[_0x9521('0x27')](db['DeskAccount']['rawAttributes'],function(_0x2cfa72){return{'name':_0x2cfa72[_0x9521('0x28')],'type':_0x2cfa72[_0x9521('0x29')][_0x9521('0x2a')]};});_0x59dfe1[_0x9521('0x2b')]=_[_0x9521('0x27')](_0x2a532a,_0x9521('0x25'));_0x59dfe1[_0x9521('0x2c')]=_[_0x9521('0x2d')](_0x3e24f6[_0x9521('0x2c')]);_0x59dfe1[_0x9521('0x2e')]=_[_0x9521('0x2f')](_0x59dfe1['model'],_0x59dfe1[_0x9521('0x2c')]);_0x5b00a8[_0x9521('0x30')]=_[_0x9521('0x2f')](_0x59dfe1[_0x9521('0x2b')],qs[_0x9521('0x31')](_0x3e24f6['query'][_0x9521('0x31')]));_0x5b00a8[_0x9521('0x30')]=_0x5b00a8[_0x9521('0x30')][_0x9521('0x32')]?_0x5b00a8[_0x9521('0x30')]:_0x59dfe1[_0x9521('0x2b')];if(!_0x3e24f6[_0x9521('0x2c')][_0x9521('0x33')](_0x9521('0x34'))){_0x5b00a8[_0x9521('0x1c')]=qs[_0x9521('0x1c')](_0x3e24f6['query'][_0x9521('0x1c')]);_0x5b00a8['offset']=qs[_0x9521('0x19')](_0x3e24f6[_0x9521('0x2c')][_0x9521('0x19')]);}_0x5b00a8[_0x9521('0x35')]=qs[_0x9521('0x36')](_0x3e24f6['query'][_0x9521('0x36')]);_0x5b00a8['where']=qs[_0x9521('0x2e')](_[_0x9521('0x37')](_0x3e24f6[_0x9521('0x2c')],_0x59dfe1[_0x9521('0x2e')]),_0x2a532a);if(_0x3e24f6[_0x9521('0x2c')][_0x9521('0x38')]){_0x5b00a8[_0x9521('0x39')]=_[_0x9521('0x3a')](_0x5b00a8[_0x9521('0x39')],{'$or':_[_0x9521('0x27')](_0x2a532a,function(_0x775a99){if(_0x775a99[_0x9521('0x29')]!==_0x9521('0x3b')){var _0x4e8eb2={};_0x4e8eb2[_0x775a99[_0x9521('0x25')]]={'$like':'%'+_0x3e24f6[_0x9521('0x2c')][_0x9521('0x38')]+'%'};return _0x4e8eb2;}})});}_0x5b00a8=_[_0x9521('0x3a')]({},_0x5b00a8,_0x3e24f6[_0x9521('0x3c')]);var _0x537451={'where':_0x5b00a8[_0x9521('0x39')]};return db[_0x9521('0x3d')][_0x9521('0x1b')](_0x537451)['then'](function(_0xb59fcb){_0x57a65b[_0x9521('0x1b')]=_0xb59fcb;if(_0x3e24f6[_0x9521('0x2c')][_0x9521('0x3e')]){_0x5b00a8[_0x9521('0x3f')]=[{'all':!![]}];}return db[_0x9521('0x3d')][_0x9521('0x40')](_0x5b00a8);})[_0x9521('0x21')](function(_0x509b33){_0x57a65b[_0x9521('0x41')]=_0x509b33;return _0x57a65b;})[_0x9521('0x21')](respondWithFilteredResult(_0x2d4cf6,_0x5b00a8))['catch'](handleError(_0x2d4cf6,null));};exports[_0x9521('0x42')]=function(_0x3df6a0,_0x11edca){var _0x795701={'raw':![],'where':{'id':_0x3df6a0[_0x9521('0x43')]['id']}},_0x57c8eb={};_0x57c8eb[_0x9521('0x2b')]=_[_0x9521('0x2d')](db[_0x9521('0x3d')][_0x9521('0x44')]);_0x57c8eb[_0x9521('0x2c')]=_['keys'](_0x3df6a0[_0x9521('0x2c')]);_0x57c8eb[_0x9521('0x2e')]=_[_0x9521('0x2f')](_0x57c8eb['model'],_0x57c8eb[_0x9521('0x2c')]);_0x795701[_0x9521('0x30')]=_['intersection'](_0x57c8eb[_0x9521('0x2b')],qs[_0x9521('0x31')](_0x3df6a0[_0x9521('0x2c')][_0x9521('0x31')]));_0x795701[_0x9521('0x30')]=_0x795701['attributes'][_0x9521('0x32')]?_0x795701[_0x9521('0x30')]:_0x57c8eb[_0x9521('0x2b')];if(_0x3df6a0[_0x9521('0x2c')]['includeAll']){_0x795701['include']=[{'all':!![]}];}_0x795701=_[_0x9521('0x3a')]({},_0x795701,_0x3df6a0[_0x9521('0x3c')]);return db[_0x9521('0x3d')][_0x9521('0x45')](_0x795701)[_0x9521('0x21')](handleEntityNotFound(_0x11edca,null))['then'](respondWithResult(_0x11edca,null))[_0x9521('0x46')](handleError(_0x11edca,null));};exports[_0x9521('0x47')]=function(_0x453371,_0x59e5c9){return db[_0x9521('0x3d')][_0x9521('0x47')](_0x453371[_0x9521('0x48')],{})['then'](respondWithResult(_0x59e5c9,0xc9))[_0x9521('0x46')](handleError(_0x59e5c9,null));};exports[_0x9521('0x20')]=function(_0x928305,_0x31f3f0){if(_0x928305[_0x9521('0x48')]['id']){delete _0x928305['body']['id'];}return db[_0x9521('0x3d')]['find']({'where':{'id':_0x928305[_0x9521('0x43')]['id']}})[_0x9521('0x21')](handleEntityNotFound(_0x31f3f0,null))[_0x9521('0x21')](saveUpdates(_0x928305[_0x9521('0x48')],null))['then'](respondWithResult(_0x31f3f0,null))[_0x9521('0x46')](handleError(_0x31f3f0,null));};exports[_0x9521('0x22')]=function(_0x1795c4,_0x5dca29){return db[_0x9521('0x3d')][_0x9521('0x45')]({'where':{'id':_0x1795c4[_0x9521('0x43')]['id']}})[_0x9521('0x21')](handleEntityNotFound(_0x5dca29,null))['then'](removeEntity(_0x5dca29,null))[_0x9521('0x46')](handleError(_0x5dca29,null));};exports[_0x9521('0x49')]=function(_0x1fc88b,_0x562cbc,_0x163d02){var _0x99bc2a={};var _0x333edc={};var _0x22c0c7;var _0x53a99e;return db[_0x9521('0x3d')][_0x9521('0x4a')]({'where':{'id':_0x1fc88b[_0x9521('0x43')]['id']}})['then'](handleEntityNotFound(_0x562cbc,null))[_0x9521('0x21')](function(_0x30d6db){if(_0x30d6db){_0x22c0c7=_0x30d6db;_0x333edc[_0x9521('0x2b')]=_['keys'](db[_0x9521('0x4b')][_0x9521('0x44')]);_0x333edc[_0x9521('0x2c')]=_[_0x9521('0x2d')](_0x1fc88b['query']);_0x333edc[_0x9521('0x2e')]=_[_0x9521('0x2f')](_0x333edc[_0x9521('0x2b')],_0x333edc[_0x9521('0x2c')]);_0x99bc2a[_0x9521('0x30')]=_[_0x9521('0x2f')](_0x333edc[_0x9521('0x2b')],qs[_0x9521('0x31')](_0x1fc88b[_0x9521('0x2c')][_0x9521('0x31')]));_0x99bc2a[_0x9521('0x30')]=_0x99bc2a[_0x9521('0x30')][_0x9521('0x32')]?_0x99bc2a[_0x9521('0x30')]:_0x333edc['model'];_0x99bc2a[_0x9521('0x35')]=qs[_0x9521('0x36')](_0x1fc88b[_0x9521('0x2c')][_0x9521('0x36')]);_0x99bc2a[_0x9521('0x39')]=qs['filters'](_[_0x9521('0x37')](_0x1fc88b[_0x9521('0x2c')],_0x333edc['filters']));if(_0x1fc88b[_0x9521('0x2c')][_0x9521('0x38')]){_0x99bc2a[_0x9521('0x39')]=_[_0x9521('0x3a')](_0x99bc2a['where'],{'$or':_[_0x9521('0x27')](_0x99bc2a[_0x9521('0x30')],function(_0x303735){var _0x34b987={};_0x34b987[_0x303735]={'$like':'%'+_0x1fc88b[_0x9521('0x2c')][_0x9521('0x38')]+'%'};return _0x34b987;})});}_0x99bc2a=_[_0x9521('0x3a')]({},_0x99bc2a,_0x1fc88b[_0x9521('0x3c')]);return _0x22c0c7[_0x9521('0x49')](_0x99bc2a);}})[_0x9521('0x21')](function(_0x444fd1){if(_0x444fd1){_0x53a99e=_0x444fd1['length'];if(!_0x1fc88b[_0x9521('0x2c')][_0x9521('0x33')](_0x9521('0x34'))){_0x99bc2a[_0x9521('0x1c')]=qs[_0x9521('0x1c')](_0x1fc88b[_0x9521('0x2c')]['limit']);_0x99bc2a[_0x9521('0x19')]=qs[_0x9521('0x19')](_0x1fc88b['query']['offset']);}return _0x22c0c7[_0x9521('0x49')](_0x99bc2a);}})['then'](function(_0x256628){if(_0x256628){return _0x256628?{'count':_0x53a99e,'rows':_0x256628}:null;}})[_0x9521('0x21')](respondWithResult(_0x562cbc,null))['catch'](handleError(_0x562cbc,null));};exports[_0x9521('0x4c')]=function(_0x3dd830,_0x1223a7,_0x6436a){if(_0x3dd830[_0x9521('0x48')]['id']){delete _0x3dd830['body']['id'];}return db[_0x9521('0x3d')]['findOne']({'where':{'id':_0x3dd830['params']['id']}})[_0x9521('0x21')](handleEntityNotFound(_0x1223a7,null))[_0x9521('0x21')](function(_0x658168){if(_0x658168){_0x3dd830[_0x9521('0x48')][_0x9521('0x4d')]=_0x658168['id'];_0x3dd830[_0x9521('0x48')][_0x9521('0x4e')]=integrations[_0x9521('0x4f')](_0x3dd830[_0x9521('0x48')][_0x9521('0x50')],_0x3dd830['body']['type']);_0x3dd830[_0x9521('0x48')][_0x9521('0x51')]=integrations[_0x9521('0x52')](_0x3dd830['body'][_0x9521('0x50')],_0x3dd830['body'][_0x9521('0x29')]);return db[_0x9521('0x4b')]['create'](_0x3dd830[_0x9521('0x48')],{'include':[{'model':db[_0x9521('0x53')],'as':_0x9521('0x4e')},{'model':db[_0x9521('0x53')],'as':'Descriptions'}]});}return null;})[_0x9521('0x21')](respondWithResult(_0x1223a7,null))[_0x9521('0x46')](handleError(_0x1223a7,null));};exports['getFields']=function(_0x51f33a,_0x16cac5,_0x1799fe){var _0x51fe11=[{'name':_0x9521('0x54'),'label':_0x9521('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2e4c4f='';return db['DeskAccount'][_0x9521('0x4a')]({'where':{'id':_0x51f33a[_0x9521('0x43')]['id']},'attributes':['id',_0x9521('0x55'),'authType',_0x9521('0x56'),_0x9521('0x57'),_0x9521('0x58'),_0x9521('0x59'),'token',_0x9521('0x5a')]})['then'](handleEntityNotFound(_0x16cac5,null))[_0x9521('0x21')](function(_0x1a84a9){if(_0x1a84a9){_0x2e4c4f=_0x1a84a9[_0x9521('0x55')];var _0x2a54d9=_0x2e4c4f[_0x9521('0x5b')](-0x1);if(_0x2a54d9==='/'){_0x2e4c4f=_0x2e4c4f[_0x9521('0x5c')](0x0,_0x2e4c4f[_0x9521('0x5d')](_0x2a54d9));}var _0x478f2f={'method':_0x9521('0x5e'),'uri':util['format']('%s/custom_fields',_0x2e4c4f),'headers':{'Content-Type':_0x9521('0x5f'),'Accept':_0x9521('0x5f')},'json':!![]};if(_0x1a84a9['authType']==='basic'){_0x478f2f[_0x9521('0x60')][_0x9521('0x61')]=util['format']('Basic\x20%s',new Buffer(util['format'](_0x9521('0x62'),_0x1a84a9[_0x9521('0x56')],_0x1a84a9['password']))[_0x9521('0x63')](_0x9521('0x64')));}return rp(_0x478f2f)[_0x9521('0x21')](function(_0x18d79b){return _0x51fe11[_0x9521('0x65')](_[_0x9521('0x27')](_0x18d79b[_0x9521('0x66')]['entries'],function(_0xca0045){return{'id':_0xca0045[_0x9521('0x25')],'name':_0xca0045[_0x9521('0x25')],'type':_0xca0045[_0x9521('0x29')],'active':_0xca0045[_0x9521('0x67')],'label':_0xca0045['label'],'custom':!![]};}));});}})[_0x9521('0x21')](function(_0x11cfbe){return{'count':_0x11cfbe[_0x9521('0x32')],'rows':_0x11cfbe};})[_0x9521('0x21')](respondWithResult(_0x16cac5,null))[_0x9521('0x46')](function(_0x4e4d00){var _0x2696e7=_0x51f33a[_0x9521('0x2c')][_0x9521('0x68')]?0x1f4:_0x4e4d00[_0x9521('0x69')]||0x1f4;logger[_0x9521('0x23')](_0x9521('0x6a'),'getFields',_0x2696e7,JSON['stringify'](_0x4e4d00));delete _0x4e4d00[_0x9521('0x25')];if(_0x2696e7===0x191){_0x2696e7=0x190;}_0x16cac5[_0x9521('0x16')](_0x2696e7)[_0x9521('0x26')](_0x51f33a[_0x9521('0x2c')][_0x9521('0x68')]?{'message':_0x9521('0x6b'),'statusCode':_0x4e4d00[_0x9521('0x69')]}:_0x4e4d00);});}; \ No newline at end of file +var _0x0007=['sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','update','params','findOne','DeskConfiguration','order','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','password','consumerKey','token','tokenSecret','lastIndexOf','GET','format','application/json','basic','Authorization','Basic\x20%s','username','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','then','destroy','end','error','stack','name','send','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x3b9b8d,_0x4bef31){var _0x3e70e7=function(_0x1e161d){while(--_0x1e161d){_0x3b9b8d['push'](_0x3b9b8d['shift']());}};_0x3e70e7(++_0x4bef31);}(_0x0007,0x125));var _0x7000=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x0007[_0x163742];return _0x1152ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7000('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7000('0x1'));var rp=require(_0x7000('0x2'));var moment=require(_0x7000('0x3'));var BPromise=require(_0x7000('0x4'));var Mustache=require(_0x7000('0x5'));var util=require(_0x7000('0x6'));var path=require(_0x7000('0x7'));var sox=require(_0x7000('0x8'));var csv=require(_0x7000('0x9'));var ejs=require(_0x7000('0xa'));var fs=require('fs');var fs_extra=require(_0x7000('0xb'));var _=require(_0x7000('0xc'));var squel=require(_0x7000('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7000('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7000('0xf'));var Papa=require(_0x7000('0x10'));var Redis=require(_0x7000('0x11'));var authService=require(_0x7000('0x12'));var qs=require(_0x7000('0x13'));var as=require(_0x7000('0x14'));var hardwareService=require(_0x7000('0x15'));var logger=require(_0x7000('0x16'))(_0x7000('0x17'));var utils=require(_0x7000('0x18'));var config=require(_0x7000('0x19'));var licenseUtil=require(_0x7000('0x1a'));var db=require(_0x7000('0x1b'))['db'];var integrations=require(_0x7000('0x1c'));function respondWithStatusCode(_0x56b4eb,_0x16c6f7){_0x16c6f7=_0x16c6f7||0xcc;return function(_0x57fba0){if(_0x57fba0){return _0x56b4eb[_0x7000('0x1d')](_0x16c6f7);}return _0x56b4eb[_0x7000('0x1e')](_0x16c6f7)['end']();};}function respondWithResult(_0x302828,_0x56759d){_0x56759d=_0x56759d||0xc8;return function(_0x3fcf7b){if(_0x3fcf7b){return _0x302828['status'](_0x56759d)[_0x7000('0x1f')](_0x3fcf7b);}};}function respondWithFilteredResult(_0x4c5dd1,_0xddd640){return function(_0x4384bc){if(_0x4384bc){var _0xbf111b=typeof _0xddd640['offset']===_0x7000('0x20')&&typeof _0xddd640[_0x7000('0x21')]===_0x7000('0x20');var _0x4671f7=_0x4384bc[_0x7000('0x22')];var _0x4ebeda=_0xbf111b?0x0:_0xddd640[_0x7000('0x23')];var _0x261812=_0xbf111b?_0x4384bc[_0x7000('0x22')]:_0xddd640[_0x7000('0x23')]+_0xddd640[_0x7000('0x21')];var _0x4869eb;if(_0x261812>=_0x4671f7){_0x261812=_0x4671f7;_0x4869eb=0xc8;}else{_0x4869eb=0xce;}_0x4c5dd1['status'](_0x4869eb);return _0x4c5dd1[_0x7000('0x24')]('Content-Range',_0x4ebeda+'-'+_0x261812+'/'+_0x4671f7)[_0x7000('0x1f')](_0x4384bc);}return null;};}function patchUpdates(_0x1389e0){return function(_0x41352d){try{jsonpatch[_0x7000('0x25')](_0x41352d,_0x1389e0,!![]);}catch(_0x3b27ac){return BPromise['reject'](_0x3b27ac);}return _0x41352d[_0x7000('0x26')]();};}function saveUpdates(_0xc71a1a,_0x406067){return function(_0x5b6a0f){if(_0x5b6a0f){return _0x5b6a0f['update'](_0xc71a1a)[_0x7000('0x27')](function(_0x54101f){return _0x54101f;});}return null;};}function removeEntity(_0x370392,_0xa9627c){return function(_0x1fe249){if(_0x1fe249){return _0x1fe249[_0x7000('0x28')]()['then'](function(){_0x370392[_0x7000('0x1e')](0xcc)[_0x7000('0x29')]();});}};}function handleEntityNotFound(_0x3e3d3a,_0x5c7a99){return function(_0x3b071d){if(!_0x3b071d){_0x3e3d3a[_0x7000('0x1d')](0x194);}return _0x3b071d;};}function handleError(_0x52b174,_0x389cf5){_0x389cf5=_0x389cf5||0x1f4;return function(_0x56d7e3){logger[_0x7000('0x2a')](_0x56d7e3[_0x7000('0x2b')]);if(_0x56d7e3['name']){delete _0x56d7e3[_0x7000('0x2c')];}_0x52b174[_0x7000('0x1e')](_0x389cf5)[_0x7000('0x2d')](_0x56d7e3);};}exports['index']=function(_0x39394d,_0x510b65){var _0x596902={},_0x1250a4={},_0x5176b3={'count':0x0,'rows':[]};var _0x323bea=_['map'](db[_0x7000('0x2e')][_0x7000('0x2f')],function(_0x54bcc5){return{'name':_0x54bcc5[_0x7000('0x30')],'type':_0x54bcc5[_0x7000('0x31')][_0x7000('0x32')]};});_0x1250a4[_0x7000('0x33')]=_[_0x7000('0x34')](_0x323bea,_0x7000('0x2c'));_0x1250a4[_0x7000('0x35')]=_[_0x7000('0x36')](_0x39394d[_0x7000('0x35')]);_0x1250a4[_0x7000('0x37')]=_[_0x7000('0x38')](_0x1250a4['model'],_0x1250a4[_0x7000('0x35')]);_0x596902['attributes']=_['intersection'](_0x1250a4['model'],qs[_0x7000('0x39')](_0x39394d[_0x7000('0x35')]['fields']));_0x596902[_0x7000('0x3a')]=_0x596902[_0x7000('0x3a')]['length']?_0x596902['attributes']:_0x1250a4[_0x7000('0x33')];if(!_0x39394d['query'][_0x7000('0x3b')](_0x7000('0x3c'))){_0x596902[_0x7000('0x21')]=qs['limit'](_0x39394d[_0x7000('0x35')][_0x7000('0x21')]);_0x596902['offset']=qs[_0x7000('0x23')](_0x39394d[_0x7000('0x35')][_0x7000('0x23')]);}_0x596902['order']=qs[_0x7000('0x3d')](_0x39394d[_0x7000('0x35')][_0x7000('0x3d')]);_0x596902[_0x7000('0x3e')]=qs['filters'](_['pick'](_0x39394d[_0x7000('0x35')],_0x1250a4[_0x7000('0x37')]),_0x323bea);if(_0x39394d[_0x7000('0x35')][_0x7000('0x3f')]){_0x596902[_0x7000('0x3e')]=_['merge'](_0x596902[_0x7000('0x3e')],{'$or':_[_0x7000('0x34')](_0x323bea,function(_0x46d9f8){if(_0x46d9f8[_0x7000('0x31')]!==_0x7000('0x40')){var _0x2ad237={};_0x2ad237[_0x46d9f8[_0x7000('0x2c')]]={'$like':'%'+_0x39394d[_0x7000('0x35')]['filter']+'%'};return _0x2ad237;}})});}_0x596902=_[_0x7000('0x41')]({},_0x596902,_0x39394d[_0x7000('0x42')]);var _0x35d295={'where':_0x596902['where']};return db['DeskAccount'][_0x7000('0x22')](_0x35d295)[_0x7000('0x27')](function(_0x1ef0d9){_0x5176b3[_0x7000('0x22')]=_0x1ef0d9;if(_0x39394d[_0x7000('0x35')][_0x7000('0x43')]){_0x596902[_0x7000('0x44')]=[{'all':!![]}];}return db[_0x7000('0x2e')][_0x7000('0x45')](_0x596902);})[_0x7000('0x27')](function(_0x3eeacf){_0x5176b3['rows']=_0x3eeacf;return _0x5176b3;})[_0x7000('0x27')](respondWithFilteredResult(_0x510b65,_0x596902))[_0x7000('0x46')](handleError(_0x510b65,null));};exports[_0x7000('0x47')]=function(_0x4833c9,_0x366262){var _0x132843={'raw':![],'where':{'id':_0x4833c9['params']['id']}},_0x35c189={};_0x35c189[_0x7000('0x33')]=_[_0x7000('0x36')](db['DeskAccount'][_0x7000('0x2f')]);_0x35c189[_0x7000('0x35')]=_['keys'](_0x4833c9[_0x7000('0x35')]);_0x35c189['filters']=_[_0x7000('0x38')](_0x35c189[_0x7000('0x33')],_0x35c189[_0x7000('0x35')]);_0x132843[_0x7000('0x3a')]=_['intersection'](_0x35c189[_0x7000('0x33')],qs[_0x7000('0x39')](_0x4833c9[_0x7000('0x35')][_0x7000('0x39')]));_0x132843[_0x7000('0x3a')]=_0x132843[_0x7000('0x3a')][_0x7000('0x48')]?_0x132843[_0x7000('0x3a')]:_0x35c189['model'];if(_0x4833c9['query'][_0x7000('0x43')]){_0x132843[_0x7000('0x44')]=[{'all':!![]}];}_0x132843=_[_0x7000('0x41')]({},_0x132843,_0x4833c9[_0x7000('0x42')]);return db[_0x7000('0x2e')][_0x7000('0x49')](_0x132843)[_0x7000('0x27')](handleEntityNotFound(_0x366262,null))[_0x7000('0x27')](respondWithResult(_0x366262,null))[_0x7000('0x46')](handleError(_0x366262,null));};exports['create']=function(_0x5d7ee2,_0x5157ba){return db[_0x7000('0x2e')][_0x7000('0x4a')](_0x5d7ee2[_0x7000('0x4b')],{})[_0x7000('0x27')](respondWithResult(_0x5157ba,0xc9))[_0x7000('0x46')](handleError(_0x5157ba,null));};exports[_0x7000('0x4c')]=function(_0x5b0d7a,_0x1ce78b){if(_0x5b0d7a['body']['id']){delete _0x5b0d7a[_0x7000('0x4b')]['id'];}return db[_0x7000('0x2e')][_0x7000('0x49')]({'where':{'id':_0x5b0d7a[_0x7000('0x4d')]['id']}})[_0x7000('0x27')](handleEntityNotFound(_0x1ce78b,null))[_0x7000('0x27')](saveUpdates(_0x5b0d7a[_0x7000('0x4b')],null))['then'](respondWithResult(_0x1ce78b,null))[_0x7000('0x46')](handleError(_0x1ce78b,null));};exports[_0x7000('0x28')]=function(_0x47443f,_0x4b58e7){return db[_0x7000('0x2e')][_0x7000('0x49')]({'where':{'id':_0x47443f[_0x7000('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b58e7,null))[_0x7000('0x27')](removeEntity(_0x4b58e7,null))[_0x7000('0x46')](handleError(_0x4b58e7,null));};exports['getConfigurations']=function(_0x2d55c4,_0x36a708,_0x26fc04){var _0xdd097b={};var _0xd48eec={};var _0x415123;var _0x370c05;return db[_0x7000('0x2e')][_0x7000('0x4e')]({'where':{'id':_0x2d55c4[_0x7000('0x4d')]['id']}})[_0x7000('0x27')](handleEntityNotFound(_0x36a708,null))['then'](function(_0x3009b0){if(_0x3009b0){_0x415123=_0x3009b0;_0xd48eec[_0x7000('0x33')]=_[_0x7000('0x36')](db[_0x7000('0x4f')][_0x7000('0x2f')]);_0xd48eec[_0x7000('0x35')]=_[_0x7000('0x36')](_0x2d55c4[_0x7000('0x35')]);_0xd48eec[_0x7000('0x37')]=_[_0x7000('0x38')](_0xd48eec['model'],_0xd48eec[_0x7000('0x35')]);_0xdd097b[_0x7000('0x3a')]=_[_0x7000('0x38')](_0xd48eec[_0x7000('0x33')],qs[_0x7000('0x39')](_0x2d55c4[_0x7000('0x35')]['fields']));_0xdd097b['attributes']=_0xdd097b[_0x7000('0x3a')][_0x7000('0x48')]?_0xdd097b['attributes']:_0xd48eec[_0x7000('0x33')];_0xdd097b[_0x7000('0x50')]=qs['sort'](_0x2d55c4['query']['sort']);_0xdd097b[_0x7000('0x3e')]=qs[_0x7000('0x37')](_[_0x7000('0x51')](_0x2d55c4[_0x7000('0x35')],_0xd48eec[_0x7000('0x37')]));if(_0x2d55c4['query'][_0x7000('0x3f')]){_0xdd097b[_0x7000('0x3e')]=_[_0x7000('0x41')](_0xdd097b[_0x7000('0x3e')],{'$or':_[_0x7000('0x34')](_0xdd097b[_0x7000('0x3a')],function(_0x4f5b4c){var _0x4b0424={};_0x4b0424[_0x4f5b4c]={'$like':'%'+_0x2d55c4[_0x7000('0x35')][_0x7000('0x3f')]+'%'};return _0x4b0424;})});}_0xdd097b=_[_0x7000('0x41')]({},_0xdd097b,_0x2d55c4[_0x7000('0x42')]);return _0x415123[_0x7000('0x52')](_0xdd097b);}})[_0x7000('0x27')](function(_0x3390a7){if(_0x3390a7){_0x370c05=_0x3390a7[_0x7000('0x48')];if(!_0x2d55c4['query'][_0x7000('0x3b')](_0x7000('0x3c'))){_0xdd097b[_0x7000('0x21')]=qs[_0x7000('0x21')](_0x2d55c4[_0x7000('0x35')][_0x7000('0x21')]);_0xdd097b[_0x7000('0x23')]=qs['offset'](_0x2d55c4[_0x7000('0x35')][_0x7000('0x23')]);}return _0x415123['getConfigurations'](_0xdd097b);}})['then'](function(_0x48f4ac){if(_0x48f4ac){return _0x48f4ac?{'count':_0x370c05,'rows':_0x48f4ac}:null;}})[_0x7000('0x27')](respondWithResult(_0x36a708,null))[_0x7000('0x46')](handleError(_0x36a708,null));};exports['addConfiguration']=function(_0x23d994,_0x48377a,_0x562043){if(_0x23d994[_0x7000('0x4b')]['id']){delete _0x23d994['body']['id'];}return db['DeskAccount'][_0x7000('0x4e')]({'where':{'id':_0x23d994[_0x7000('0x4d')]['id']}})[_0x7000('0x27')](handleEntityNotFound(_0x48377a,null))[_0x7000('0x27')](function(_0xcd4412){if(_0xcd4412){_0x23d994[_0x7000('0x4b')][_0x7000('0x53')]=_0xcd4412['id'];_0x23d994[_0x7000('0x4b')][_0x7000('0x54')]=integrations[_0x7000('0x55')](_0x23d994[_0x7000('0x4b')][_0x7000('0x56')],_0x23d994[_0x7000('0x4b')][_0x7000('0x31')]);_0x23d994[_0x7000('0x4b')][_0x7000('0x57')]=integrations[_0x7000('0x58')](_0x23d994[_0x7000('0x4b')][_0x7000('0x56')],_0x23d994[_0x7000('0x4b')]['type']);return db[_0x7000('0x4f')]['create'](_0x23d994[_0x7000('0x4b')],{'include':[{'model':db[_0x7000('0x59')],'as':'Subjects'},{'model':db[_0x7000('0x59')],'as':'Descriptions'}]});}return null;})[_0x7000('0x27')](respondWithResult(_0x48377a,null))['catch'](handleError(_0x48377a,null));};exports['getFields']=function(_0x25546d,_0x8c0683,_0x485d80){var _0x19d168=[{'name':_0x7000('0x5a'),'label':_0x7000('0x5a'),'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 _0x28d414='';return db[_0x7000('0x2e')][_0x7000('0x4e')]({'where':{'id':_0x25546d[_0x7000('0x4d')]['id']},'attributes':['id',_0x7000('0x5b'),_0x7000('0x5c'),'username',_0x7000('0x5d'),_0x7000('0x5e'),'consumerSecret',_0x7000('0x5f'),_0x7000('0x60')]})[_0x7000('0x27')](handleEntityNotFound(_0x8c0683,null))['then'](function(_0x492cf8){if(_0x492cf8){_0x28d414=_0x492cf8['remoteUri'];var _0x1e8a61=_0x28d414['slice'](-0x1);if(_0x1e8a61==='/'){_0x28d414=_0x28d414['substring'](0x0,_0x28d414[_0x7000('0x61')](_0x1e8a61));}var _0x54684f={'method':_0x7000('0x62'),'uri':util[_0x7000('0x63')]('%s/custom_fields',_0x28d414),'headers':{'Content-Type':_0x7000('0x64'),'Accept':'application/json'},'json':!![]};if(_0x492cf8[_0x7000('0x5c')]===_0x7000('0x65')){_0x54684f['headers'][_0x7000('0x66')]=util['format'](_0x7000('0x67'),new Buffer(util[_0x7000('0x63')]('%s:%s',_0x492cf8[_0x7000('0x68')],_0x492cf8['password']))[_0x7000('0x69')](_0x7000('0x6a')));}return rp(_0x54684f)[_0x7000('0x27')](function(_0x5b52db){return _0x19d168[_0x7000('0x6b')](_['map'](_0x5b52db[_0x7000('0x6c')][_0x7000('0x6d')],function(_0x484c24){return{'id':_0x484c24['name'],'name':_0x484c24[_0x7000('0x2c')],'type':_0x484c24[_0x7000('0x31')],'active':_0x484c24[_0x7000('0x6e')],'label':_0x484c24[_0x7000('0x6f')],'custom':!![]};}));});}})[_0x7000('0x27')](function(_0xe58488){return{'count':_0xe58488[_0x7000('0x48')],'rows':_0xe58488};})['then'](respondWithResult(_0x8c0683,null))[_0x7000('0x46')](function(_0x18a0ab){var _0x5d0cff=_0x25546d[_0x7000('0x35')][_0x7000('0x70')]?0x1f4:_0x18a0ab[_0x7000('0x71')]||0x1f4;logger[_0x7000('0x2a')](_0x7000('0x72'),_0x7000('0x73'),_0x5d0cff,JSON[_0x7000('0x74')](_0x18a0ab));delete _0x18a0ab['name'];if(_0x5d0cff===0x191){_0x5d0cff=0x190;}_0x8c0683['status'](_0x5d0cff)[_0x7000('0x2d')](_0x25546d[_0x7000('0x35')][_0x7000('0x70')]?{'message':_0x7000('0x75'),'statusCode':_0x18a0ab['statusCode']}:_0x18a0ab);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3120ef2..1b2a34c 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 _0xc5d7=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x242005,_0xc9c464){var _0x5bb233=function(_0x5bd4f6){while(--_0x5bd4f6){_0x242005['push'](_0x242005['shift']());}};_0x5bb233(++_0xc9c464);}(_0xc5d7,0x79));var _0x7c5d=function(_0x2ed3ba,_0x4a46ce){_0x2ed3ba=_0x2ed3ba-0x0;var _0x224b47=_0xc5d7[_0x2ed3ba];return _0x224b47;};'use strict';var _=require(_0x7c5d('0x0'));var util=require(_0x7c5d('0x1'));var logger=require(_0x7c5d('0x2'))(_0x7c5d('0x3'));var moment=require(_0x7c5d('0x4'));var BPromise=require(_0x7c5d('0x5'));var rp=require(_0x7c5d('0x6'));var fs=require('fs');var path=require(_0x7c5d('0x7'));var rimraf=require(_0x7c5d('0x8'));var config=require(_0x7c5d('0x9'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x7c5d('0xa'));module[_0x7c5d('0xb')]=function(_0x345566,_0x460b19){return _0x345566['define'](_0x7c5d('0xc'),attributes,{'tableName':_0x7c5d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb35d=['define','DeskAccount','int_desk_accounts','util','../../config/logger','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb35d,0xc1));var _0xdb35=function(_0x381bff,_0x19d01f){_0x381bff=_0x381bff-0x0;var _0x201ab1=_0xb35d[_0x381bff];return _0x201ab1;};'use strict';var _=require('lodash');var util=require(_0xdb35('0x0'));var logger=require(_0xdb35('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb35('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb35('0x3'));var attributes=require(_0xdb35('0x4'));var integrations=require(_0xdb35('0x5'));module[_0xdb35('0x6')]=function(_0x71a8fa,_0x120a21){return _0x71a8fa[_0xdb35('0x7')](_0xdb35('0x8'),attributes,{'tableName':_0xdb35('0x9'),'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 3d795c0..21416c1 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 _0x5431=['DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowDeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','error','code'];(function(_0x5eae84,_0x193d5e){var _0x5b44cc=function(_0x501640){while(--_0x501640){_0x5eae84['push'](_0x5eae84['shift']());}};_0x5b44cc(++_0x193d5e);}(_0x5431,0x10f));var _0x1543=function(_0x14c666,_0xfb4191){_0x14c666=_0x14c666-0x0;var _0x51c1af=_0x5431[_0x14c666];return _0x51c1af;};'use strict';var _=require(_0x1543('0x0'));var util=require('util');var moment=require(_0x1543('0x1'));var BPromise=require(_0x1543('0x2'));var rs=require(_0x1543('0x3'));var fs=require('fs');var Redis=require(_0x1543('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1543('0x5'));var logger=require(_0x1543('0x6'))(_0x1543('0x7'));var config=require('../../config/environment');var jayson=require(_0x1543('0x8'));var client=jayson[_0x1543('0x9')][_0x1543('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x129b11,_0x2d781d,_0x399cbd){return new BPromise(function(_0x2822e3,_0x59593c){return client[_0x1543('0xb')](_0x129b11,_0x399cbd)[_0x1543('0xc')](function(_0x2c1249){logger['info']('DeskAccount,\x20%s,\x20%s',_0x2d781d,_0x1543('0xd'));logger[_0x1543('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2d781d,_0x1543('0xd'),JSON['stringify'](_0x2c1249));if(_0x2c1249[_0x1543('0xf')]){if(_0x2c1249[_0x1543('0xf')][_0x1543('0x10')]===0x1f4){logger['error'](_0x1543('0x11'),_0x2d781d,_0x2c1249[_0x1543('0xf')][_0x1543('0x12')]);return _0x59593c(_0x2c1249[_0x1543('0xf')]['message']);}logger[_0x1543('0xf')](_0x1543('0x11'),_0x2d781d,_0x2c1249[_0x1543('0xf')][_0x1543('0x12')]);return _0x2822e3(_0x2c1249[_0x1543('0xf')][_0x1543('0x12')]);}else{logger[_0x1543('0x13')]('DeskAccount,\x20%s,\x20%s',_0x2d781d,_0x1543('0xd'));_0x2822e3(_0x2c1249[_0x1543('0x14')][_0x1543('0x12')]);}})[_0x1543('0x15')](function(_0x2aaccf){logger[_0x1543('0xf')]('DeskAccount,\x20%s,\x20%s',_0x2d781d,_0x2aaccf);_0x59593c(_0x2aaccf);});});}exports[_0x1543('0x16')]=function(_0x664fbf){var _0x26b490=this;return new Promise(function(_0x5179f1,_0x5e209a){return db[_0x1543('0x17')][_0x1543('0x18')]({'raw':_0x664fbf[_0x1543('0x19')]?_0x664fbf[_0x1543('0x19')][_0x1543('0x1a')]===undefined?!![]:![]:!![],'where':_0x664fbf[_0x1543('0x19')]?_0x664fbf[_0x1543('0x19')][_0x1543('0x1b')]||null:null,'attributes':_0x664fbf['options']?_0x664fbf['options']['attributes']||null:null,'limit':_0x664fbf[_0x1543('0x19')]?_0x664fbf['options'][_0x1543('0x1c')]||null:null,'include':_0x664fbf[_0x1543('0x19')]?_0x664fbf['options'][_0x1543('0x1d')]?_[_0x1543('0x1e')](_0x664fbf[_0x1543('0x19')][_0x1543('0x1d')],function(_0x3f3d51){return{'model':db[_0x3f3d51[_0x1543('0x1f')]],'as':_0x3f3d51['as'],'attributes':_0x3f3d51['attributes'],'include':_0x3f3d51[_0x1543('0x1d')]?_['map'](_0x3f3d51[_0x1543('0x1d')],function(_0x4c3530){return{'model':db[_0x4c3530[_0x1543('0x1f')]],'as':_0x4c3530['as'],'attributes':_0x4c3530[_0x1543('0x20')],'include':_0x4c3530[_0x1543('0x1d')]?_['map'](_0x4c3530[_0x1543('0x1d')],function(_0x2e898d){return{'model':db[_0x2e898d[_0x1543('0x1f')]],'as':_0x2e898d['as'],'attributes':_0x2e898d[_0x1543('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1543('0xc')](function(_0x50c2ad){logger[_0x1543('0x13')]('GetDeskAccount',_0x664fbf);logger[_0x1543('0xe')](_0x1543('0x16'),_0x664fbf,JSON[_0x1543('0x21')](_0x50c2ad));_0x5179f1(_0x50c2ad);})[_0x1543('0x15')](function(_0x171be8){logger[_0x1543('0xf')](_0x1543('0x16'),_0x171be8[_0x1543('0x12')],_0x664fbf);_0x5e209a(_0x26b490[_0x1543('0xf')](0x1f4,_0x171be8['message']));});});};exports[_0x1543('0x22')]=function(_0x2a43a6){var _0x3199aa=this;return new Promise(function(_0x2b98cc,_0xfb5877){return db['DeskAccount'][_0x1543('0x23')]({'raw':_0x2a43a6[_0x1543('0x19')]?_0x2a43a6['options'][_0x1543('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a43a6['options']?_0x2a43a6[_0x1543('0x19')][_0x1543('0x1b')]||null:null,'attributes':_0x2a43a6[_0x1543('0x19')]?_0x2a43a6[_0x1543('0x19')]['attributes']||null:null,'include':_0x2a43a6[_0x1543('0x19')]?_0x2a43a6[_0x1543('0x19')][_0x1543('0x1d')]?_[_0x1543('0x1e')](_0x2a43a6[_0x1543('0x19')][_0x1543('0x1d')],function(_0x596d89){return{'model':db[_0x596d89[_0x1543('0x1f')]],'as':_0x596d89['as'],'attributes':_0x596d89[_0x1543('0x20')],'include':_0x596d89[_0x1543('0x1d')]?_[_0x1543('0x1e')](_0x596d89[_0x1543('0x1d')],function(_0x3e9d02){return{'model':db[_0x3e9d02[_0x1543('0x1f')]],'as':_0x3e9d02['as'],'attributes':_0x3e9d02[_0x1543('0x20')],'include':_0x3e9d02[_0x1543('0x1d')]?_['map'](_0x3e9d02['include'],function(_0x4f4e9e){return{'model':db[_0x4f4e9e[_0x1543('0x1f')]],'as':_0x4f4e9e['as'],'attributes':_0x4f4e9e[_0x1543('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1543('0xc')](function(_0x535983){logger['info'](_0x1543('0x22'),_0x2a43a6);logger['debug'](_0x1543('0x22'),_0x2a43a6,JSON['stringify'](_0x535983));_0x2b98cc(_0x535983);})[_0x1543('0x15')](function(_0x17be48){logger[_0x1543('0xf')](_0x1543('0x22'),_0x17be48[_0x1543('0x12')],_0x2a43a6);_0xfb5877(_0x3199aa['error'](0x1f4,_0x17be48[_0x1543('0x12')]));});});}; \ No newline at end of file +var _0xe55f=['stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowDeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4511e5,_0x262a06){var _0x1867be=function(_0x305d5a){while(--_0x305d5a){_0x4511e5['push'](_0x4511e5['shift']());}};_0x1867be(++_0x262a06);}(_0xe55f,0xc8));var _0xfe55=function(_0x4b33c0,_0x17fb55){_0x4b33c0=_0x4b33c0-0x0;var _0x43c889=_0xe55f[_0x4b33c0];return _0x43c889;};'use strict';var _=require('lodash');var util=require(_0xfe55('0x0'));var moment=require(_0xfe55('0x1'));var BPromise=require(_0xfe55('0x2'));var rs=require(_0xfe55('0x3'));var fs=require('fs');var Redis=require(_0xfe55('0x4'));var db=require(_0xfe55('0x5'))['db'];var utils=require(_0xfe55('0x6'));var logger=require(_0xfe55('0x7'))('rpc');var config=require(_0xfe55('0x8'));var jayson=require(_0xfe55('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45eefc,_0x3efad1,_0x4ad6b7){return new BPromise(function(_0x4fc796,_0xa42c52){return client[_0xfe55('0xa')](_0x45eefc,_0x4ad6b7)[_0xfe55('0xb')](function(_0x34a434){logger[_0xfe55('0xc')]('DeskAccount,\x20%s,\x20%s',_0x3efad1,_0xfe55('0xd'));logger[_0xfe55('0xe')](_0xfe55('0xf'),_0x3efad1,_0xfe55('0xd'),JSON[_0xfe55('0x10')](_0x34a434));if(_0x34a434[_0xfe55('0x11')]){if(_0x34a434[_0xfe55('0x11')][_0xfe55('0x12')]===0x1f4){logger[_0xfe55('0x11')](_0xfe55('0x13'),_0x3efad1,_0x34a434['error'][_0xfe55('0x14')]);return _0xa42c52(_0x34a434['error'][_0xfe55('0x14')]);}logger['error'](_0xfe55('0x13'),_0x3efad1,_0x34a434[_0xfe55('0x11')]['message']);return _0x4fc796(_0x34a434[_0xfe55('0x11')]['message']);}else{logger[_0xfe55('0xc')](_0xfe55('0x13'),_0x3efad1,'request\x20sent');_0x4fc796(_0x34a434[_0xfe55('0x15')][_0xfe55('0x14')]);}})[_0xfe55('0x16')](function(_0x1e91ac){logger[_0xfe55('0x11')](_0xfe55('0x13'),_0x3efad1,_0x1e91ac);_0xa42c52(_0x1e91ac);});});}exports[_0xfe55('0x17')]=function(_0x4bba10){var _0xd42fa0=this;return new Promise(function(_0x16f240,_0x687312){return db[_0xfe55('0x18')][_0xfe55('0x19')]({'raw':_0x4bba10[_0xfe55('0x1a')]?_0x4bba10[_0xfe55('0x1a')][_0xfe55('0x1b')]===undefined?!![]:![]:!![],'where':_0x4bba10[_0xfe55('0x1a')]?_0x4bba10[_0xfe55('0x1a')][_0xfe55('0x1c')]||null:null,'attributes':_0x4bba10[_0xfe55('0x1a')]?_0x4bba10['options']['attributes']||null:null,'limit':_0x4bba10['options']?_0x4bba10['options'][_0xfe55('0x1d')]||null:null,'include':_0x4bba10[_0xfe55('0x1a')]?_0x4bba10[_0xfe55('0x1a')][_0xfe55('0x1e')]?_[_0xfe55('0x1f')](_0x4bba10['options'][_0xfe55('0x1e')],function(_0x5668e3){return{'model':db[_0x5668e3['model']],'as':_0x5668e3['as'],'attributes':_0x5668e3[_0xfe55('0x20')],'include':_0x5668e3[_0xfe55('0x1e')]?_['map'](_0x5668e3['include'],function(_0x51bf09){return{'model':db[_0x51bf09[_0xfe55('0x21')]],'as':_0x51bf09['as'],'attributes':_0x51bf09['attributes'],'include':_0x51bf09['include']?_[_0xfe55('0x1f')](_0x51bf09[_0xfe55('0x1e')],function(_0x324b6e){return{'model':db[_0x324b6e['model']],'as':_0x324b6e['as'],'attributes':_0x324b6e[_0xfe55('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc824){logger[_0xfe55('0xc')]('GetDeskAccount',_0x4bba10);logger[_0xfe55('0xe')](_0xfe55('0x17'),_0x4bba10,JSON[_0xfe55('0x10')](_0x4bc824));_0x16f240(_0x4bc824);})[_0xfe55('0x16')](function(_0x422e09){logger[_0xfe55('0x11')]('GetDeskAccount',_0x422e09[_0xfe55('0x14')],_0x4bba10);_0x687312(_0xd42fa0['error'](0x1f4,_0x422e09[_0xfe55('0x14')]));});});};exports[_0xfe55('0x22')]=function(_0x433108){var _0x18af14=this;return new Promise(function(_0x9cb7a3,_0x137a28){return db[_0xfe55('0x18')][_0xfe55('0x23')]({'raw':_0x433108[_0xfe55('0x1a')]?_0x433108[_0xfe55('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x433108[_0xfe55('0x1a')]?_0x433108['options'][_0xfe55('0x1c')]||null:null,'attributes':_0x433108[_0xfe55('0x1a')]?_0x433108['options']['attributes']||null:null,'include':_0x433108['options']?_0x433108[_0xfe55('0x1a')][_0xfe55('0x1e')]?_[_0xfe55('0x1f')](_0x433108[_0xfe55('0x1a')][_0xfe55('0x1e')],function(_0x30879c){return{'model':db[_0x30879c[_0xfe55('0x21')]],'as':_0x30879c['as'],'attributes':_0x30879c[_0xfe55('0x20')],'include':_0x30879c[_0xfe55('0x1e')]?_[_0xfe55('0x1f')](_0x30879c[_0xfe55('0x1e')],function(_0x461b4d){return{'model':db[_0x461b4d['model']],'as':_0x461b4d['as'],'attributes':_0x461b4d[_0xfe55('0x20')],'include':_0x461b4d['include']?_[_0xfe55('0x1f')](_0x461b4d[_0xfe55('0x1e')],function(_0x452fb3){return{'model':db[_0x452fb3['model']],'as':_0x452fb3['as'],'attributes':_0x452fb3[_0xfe55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfe55('0xb')](function(_0x2713bc){logger[_0xfe55('0xc')](_0xfe55('0x22'),_0x433108);logger[_0xfe55('0xe')]('ShowDeskAccount',_0x433108,JSON[_0xfe55('0x10')](_0x2713bc));_0x9cb7a3(_0x2713bc);})[_0xfe55('0x16')](function(_0x149db5){logger[_0xfe55('0x11')](_0xfe55('0x22'),_0x149db5[_0xfe55('0x14')],_0x433108);_0x137a28(_0x18af14[_0xfe55('0x11')](0x1f4,_0x149db5['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 69b7384..dc2326d 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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x1282d2,_0x346ec6){var _0x5aa36c=function(_0x719bb3){while(--_0x719bb3){_0x1282d2['push'](_0x1282d2['shift']());}};_0x5aa36c(++_0x346ec6);}(_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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x18f3f3,_0x110826){var _0x1d20c4=function(_0x247459){while(--_0x247459){_0x18f3f3['push'](_0x18f3f3['shift']());}};_0x1d20c4(++_0x110826);}(_0x008c,0x188));var _0xc008=function(_0x18ccd6,_0x1098e8){_0x18ccd6=_0x18ccd6-0x0;var _0x587d2c=_0x008c[_0x18ccd6];return _0x587d2c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f69e2b4..f171b4c 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 _0x018a=['sequelize','exports','STRING'];(function(_0x181cbd,_0x51a26e){var _0x45b84c=function(_0x17a151){while(--_0x17a151){_0x181cbd['push'](_0x181cbd['shift']());}};_0x45b84c(++_0x51a26e);}(_0x018a,0xed));var _0xa018=function(_0x17de24,_0x3c6c3c){_0x17de24=_0x17de24-0x0;var _0x4a7763=_0x018a[_0x17de24];return _0x4a7763;};'use strict';var Sequelize=require(_0xa018('0x0'));module[_0xa018('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa018('0x2')]}}; \ No newline at end of file +var _0x6077=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6077,0xff));var _0x7607=function(_0x3ab596,_0x219a15){_0x3ab596=_0x3ab596-0x0;var _0x345992=_0x6077[_0x3ab596];return _0x345992;};'use strict';var Sequelize=require('sequelize');module[_0x7607('0x0')]={'name':{'type':Sequelize[_0x7607('0x1')]},'description':{'type':Sequelize[_0x7607('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index d590e0b..998ee7e 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 _0x98a9=['fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','index','rawAttributes','fieldName','type','key','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','DeskConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','catch','getFields','findOne','DeskField','options','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0x98a9,0xfa));var _0x998a=function(_0x5fae11,_0x812d2a){_0x5fae11=_0x5fae11-0x0;var _0x22695b=_0x98a9[_0x5fae11];return _0x22695b;};'use strict';var emlformat=require(_0x998a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x998a('0x1'));var jsonpatch=require(_0x998a('0x2'));var rp=require(_0x998a('0x3'));var moment=require(_0x998a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x998a('0x5'));var util=require(_0x998a('0x6'));var path=require(_0x998a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x998a('0x8'));var _=require(_0x998a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x998a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x998a('0xb'));var Papa=require(_0x998a('0xc'));var Redis=require(_0x998a('0xd'));var authService=require(_0x998a('0xe'));var qs=require(_0x998a('0xf'));var as=require(_0x998a('0x10'));var hardwareService=require(_0x998a('0x11'));var logger=require(_0x998a('0x12'))(_0x998a('0x13'));var utils=require(_0x998a('0x14'));var config=require(_0x998a('0x15'));var licenseUtil=require(_0x998a('0x16'));var db=require(_0x998a('0x17'))['db'];function respondWithStatusCode(_0x50b4cc,_0x4a5d4d){_0x4a5d4d=_0x4a5d4d||0xcc;return function(_0x5ae52f){if(_0x5ae52f){return _0x50b4cc[_0x998a('0x18')](_0x4a5d4d);}return _0x50b4cc[_0x998a('0x19')](_0x4a5d4d)[_0x998a('0x1a')]();};}function respondWithResult(_0x21ff00,_0x420277){_0x420277=_0x420277||0xc8;return function(_0x4c3db7){if(_0x4c3db7){return _0x21ff00[_0x998a('0x19')](_0x420277)[_0x998a('0x1b')](_0x4c3db7);}};}function respondWithFilteredResult(_0x3ed55a,_0x524c5d){return function(_0x4a2923){if(_0x4a2923){var _0x5557e6=typeof _0x524c5d[_0x998a('0x1c')]==='undefined'&&typeof _0x524c5d[_0x998a('0x1d')]===_0x998a('0x1e');var _0x455d20=_0x4a2923[_0x998a('0x1f')];var _0x4379d0=_0x5557e6?0x0:_0x524c5d[_0x998a('0x1c')];var _0x5b7aa1=_0x5557e6?_0x4a2923[_0x998a('0x1f')]:_0x524c5d[_0x998a('0x1c')]+_0x524c5d[_0x998a('0x1d')];var _0x5b4d68;if(_0x5b7aa1>=_0x455d20){_0x5b7aa1=_0x455d20;_0x5b4d68=0xc8;}else{_0x5b4d68=0xce;}_0x3ed55a['status'](_0x5b4d68);return _0x3ed55a[_0x998a('0x20')]('Content-Range',_0x4379d0+'-'+_0x5b7aa1+'/'+_0x455d20)['json'](_0x4a2923);}return null;};}function patchUpdates(_0x138ac8){return function(_0x14d9d3){try{jsonpatch[_0x998a('0x21')](_0x14d9d3,_0x138ac8,!![]);}catch(_0x4a1547){return BPromise[_0x998a('0x22')](_0x4a1547);}return _0x14d9d3[_0x998a('0x23')]();};}function saveUpdates(_0x59f13a,_0x3df3b5){return function(_0x41429a){if(_0x41429a){return _0x41429a[_0x998a('0x24')](_0x59f13a)[_0x998a('0x25')](function(_0x12d572){return _0x12d572;});}return null;};}function removeEntity(_0x559479,_0x4d5cbf){return function(_0x40490e){if(_0x40490e){return _0x40490e[_0x998a('0x26')]()[_0x998a('0x25')](function(){_0x559479[_0x998a('0x19')](0xcc)[_0x998a('0x1a')]();});}};}function handleEntityNotFound(_0x2961bc,_0x108a9a){return function(_0xfcc34e){if(!_0xfcc34e){_0x2961bc[_0x998a('0x18')](0x194);}return _0xfcc34e;};}function handleError(_0x370d1b,_0x524661){_0x524661=_0x524661||0x1f4;return function(_0x367983){logger[_0x998a('0x27')](_0x367983[_0x998a('0x28')]);if(_0x367983['name']){delete _0x367983['name'];}_0x370d1b[_0x998a('0x19')](_0x524661)['send'](_0x367983);};}exports[_0x998a('0x29')]=function(_0x5c63e8,_0x2fd8a8){var _0x4b03b8={},_0x14e2ee={},_0x33234a={'count':0x0,'rows':[]};var _0x23e432=_['map'](db['DeskConfiguration'][_0x998a('0x2a')],function(_0x33d1db){return{'name':_0x33d1db[_0x998a('0x2b')],'type':_0x33d1db[_0x998a('0x2c')][_0x998a('0x2d')]};});_0x14e2ee[_0x998a('0x2e')]=_[_0x998a('0x2f')](_0x23e432,_0x998a('0x30'));_0x14e2ee['query']=_[_0x998a('0x31')](_0x5c63e8[_0x998a('0x32')]);_0x14e2ee['filters']=_[_0x998a('0x33')](_0x14e2ee[_0x998a('0x2e')],_0x14e2ee[_0x998a('0x32')]);_0x4b03b8[_0x998a('0x34')]=_['intersection'](_0x14e2ee[_0x998a('0x2e')],qs[_0x998a('0x35')](_0x5c63e8[_0x998a('0x32')][_0x998a('0x35')]));_0x4b03b8[_0x998a('0x34')]=_0x4b03b8[_0x998a('0x34')][_0x998a('0x36')]?_0x4b03b8[_0x998a('0x34')]:_0x14e2ee[_0x998a('0x2e')];if(!_0x5c63e8[_0x998a('0x32')][_0x998a('0x37')]('nolimit')){_0x4b03b8[_0x998a('0x1d')]=qs[_0x998a('0x1d')](_0x5c63e8[_0x998a('0x32')][_0x998a('0x1d')]);_0x4b03b8['offset']=qs[_0x998a('0x1c')](_0x5c63e8[_0x998a('0x32')][_0x998a('0x1c')]);}_0x4b03b8[_0x998a('0x38')]=qs[_0x998a('0x39')](_0x5c63e8[_0x998a('0x32')][_0x998a('0x39')]);_0x4b03b8['where']=qs[_0x998a('0x3a')](_[_0x998a('0x3b')](_0x5c63e8['query'],_0x14e2ee[_0x998a('0x3a')]),_0x23e432);if(_0x5c63e8['query'][_0x998a('0x3c')]){_0x4b03b8[_0x998a('0x3d')]=_[_0x998a('0x3e')](_0x4b03b8['where'],{'$or':_[_0x998a('0x2f')](_0x23e432,function(_0x587596){if(_0x587596[_0x998a('0x2c')]!==_0x998a('0x3f')){var _0x460920={};_0x460920[_0x587596[_0x998a('0x30')]]={'$like':'%'+_0x5c63e8[_0x998a('0x32')][_0x998a('0x3c')]+'%'};return _0x460920;}})});}_0x4b03b8=_[_0x998a('0x3e')]({},_0x4b03b8,_0x5c63e8['options']);var _0x2d6dfe={'where':_0x4b03b8[_0x998a('0x3d')]};return db[_0x998a('0x40')]['count'](_0x2d6dfe)[_0x998a('0x25')](function(_0xe85021){_0x33234a[_0x998a('0x1f')]=_0xe85021;if(_0x5c63e8[_0x998a('0x32')][_0x998a('0x41')]){_0x4b03b8[_0x998a('0x42')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x998a('0x43')](_0x4b03b8);})[_0x998a('0x25')](function(_0x3ae38d){_0x33234a[_0x998a('0x44')]=_0x3ae38d;return _0x33234a;})[_0x998a('0x25')](respondWithFilteredResult(_0x2fd8a8,_0x4b03b8))['catch'](handleError(_0x2fd8a8,null));};exports[_0x998a('0x45')]=function(_0x44f733,_0x248486){var _0x4b1018={'raw':![],'where':{'id':_0x44f733[_0x998a('0x46')]['id']}},_0x4134bc={};_0x4134bc[_0x998a('0x2e')]=_[_0x998a('0x31')](db['DeskConfiguration']['rawAttributes']);_0x4134bc['query']=_[_0x998a('0x31')](_0x44f733['query']);_0x4134bc['filters']=_[_0x998a('0x33')](_0x4134bc['model'],_0x4134bc[_0x998a('0x32')]);_0x4b1018[_0x998a('0x34')]=_[_0x998a('0x33')](_0x4134bc[_0x998a('0x2e')],qs[_0x998a('0x35')](_0x44f733['query']['fields']));_0x4b1018[_0x998a('0x34')]=_0x4b1018['attributes'][_0x998a('0x36')]?_0x4b1018[_0x998a('0x34')]:_0x4134bc[_0x998a('0x2e')];if(_0x44f733[_0x998a('0x32')][_0x998a('0x41')]){_0x4b1018[_0x998a('0x42')]=[{'all':!![]}];}_0x4b1018=_['merge']({},_0x4b1018,_0x44f733['options']);return db[_0x998a('0x40')][_0x998a('0x47')](_0x4b1018)[_0x998a('0x25')](handleEntityNotFound(_0x248486,null))[_0x998a('0x25')](respondWithResult(_0x248486,null))['catch'](handleError(_0x248486,null));};exports['create']=function(_0x65035d,_0x27c495){return db[_0x998a('0x40')][_0x998a('0x48')](_0x65035d[_0x998a('0x49')],{})[_0x998a('0x25')](respondWithResult(_0x27c495,0xc9))[_0x998a('0x4a')](handleError(_0x27c495,null));};exports[_0x998a('0x24')]=function(_0x453917,_0x1e965f){if(_0x453917[_0x998a('0x49')]['id']){delete _0x453917[_0x998a('0x49')]['id'];}return db[_0x998a('0x40')][_0x998a('0x47')]({'where':{'id':_0x453917[_0x998a('0x46')]['id']}})[_0x998a('0x25')](handleEntityNotFound(_0x1e965f,null))[_0x998a('0x25')](saveUpdates(_0x453917[_0x998a('0x49')],null))[_0x998a('0x25')](respondWithResult(_0x1e965f,null))[_0x998a('0x4a')](handleError(_0x1e965f,null));};exports[_0x998a('0x26')]=function(_0x3478c8,_0x5a881d){return db[_0x998a('0x40')][_0x998a('0x47')]({'where':{'id':_0x3478c8[_0x998a('0x46')]['id']}})[_0x998a('0x25')](handleEntityNotFound(_0x5a881d,null))[_0x998a('0x25')](removeEntity(_0x5a881d,null))[_0x998a('0x4a')](handleError(_0x5a881d,null));};exports[_0x998a('0x4b')]=function(_0x4a2dc3,_0x1841f4,_0xa16ae0){var _0xfbd8a6={};var _0x29120f={};var _0x42ebb4;var _0x825a6d;return db['DeskConfiguration'][_0x998a('0x4c')]({'where':{'id':_0x4a2dc3[_0x998a('0x46')]['id']}})[_0x998a('0x25')](handleEntityNotFound(_0x1841f4,null))[_0x998a('0x25')](function(_0x5bbead){if(_0x5bbead){_0x42ebb4=_0x5bbead;_0x29120f[_0x998a('0x2e')]=_[_0x998a('0x31')](db[_0x998a('0x4d')][_0x998a('0x2a')]);_0x29120f[_0x998a('0x32')]=_[_0x998a('0x31')](_0x4a2dc3[_0x998a('0x32')]);_0x29120f[_0x998a('0x3a')]=_[_0x998a('0x33')](_0x29120f[_0x998a('0x2e')],_0x29120f[_0x998a('0x32')]);_0xfbd8a6[_0x998a('0x34')]=_['intersection'](_0x29120f[_0x998a('0x2e')],qs[_0x998a('0x35')](_0x4a2dc3['query'][_0x998a('0x35')]));_0xfbd8a6[_0x998a('0x34')]=_0xfbd8a6[_0x998a('0x34')]['length']?_0xfbd8a6[_0x998a('0x34')]:_0x29120f[_0x998a('0x2e')];_0xfbd8a6[_0x998a('0x38')]=qs[_0x998a('0x39')](_0x4a2dc3[_0x998a('0x32')][_0x998a('0x39')]);_0xfbd8a6[_0x998a('0x3d')]=qs[_0x998a('0x3a')](_[_0x998a('0x3b')](_0x4a2dc3[_0x998a('0x32')],_0x29120f[_0x998a('0x3a')]));if(_0x4a2dc3[_0x998a('0x32')][_0x998a('0x3c')]){_0xfbd8a6[_0x998a('0x3d')]=_[_0x998a('0x3e')](_0xfbd8a6[_0x998a('0x3d')],{'$or':_[_0x998a('0x2f')](_0xfbd8a6[_0x998a('0x34')],function(_0x2ad65e){var _0x412387={};_0x412387[_0x2ad65e]={'$like':'%'+_0x4a2dc3['query'][_0x998a('0x3c')]+'%'};return _0x412387;})});}_0xfbd8a6=_[_0x998a('0x3e')]({},_0xfbd8a6,_0x4a2dc3[_0x998a('0x4e')]);return _0x42ebb4['getFields'](_0xfbd8a6);}})[_0x998a('0x25')](function(_0x53f135){if(_0x53f135){_0x825a6d=_0x53f135[_0x998a('0x36')];if(!_0x4a2dc3['query'][_0x998a('0x37')](_0x998a('0x4f'))){_0xfbd8a6[_0x998a('0x1d')]=qs[_0x998a('0x1d')](_0x4a2dc3['query'][_0x998a('0x1d')]);_0xfbd8a6[_0x998a('0x1c')]=qs['offset'](_0x4a2dc3[_0x998a('0x32')][_0x998a('0x1c')]);}return _0x42ebb4[_0x998a('0x4b')](_0xfbd8a6);}})[_0x998a('0x25')](function(_0xcfe578){if(_0xcfe578){return _0xcfe578?{'count':_0x825a6d,'rows':_0xcfe578}:null;}})['then'](respondWithResult(_0x1841f4,null))[_0x998a('0x4a')](handleError(_0x1841f4,null));};exports['getSubjects']=function(_0x3b805d,_0x9e05fe,_0x20474b){var _0xa18dce={};var _0x1c905a={};var _0x281576;var _0x42fbcf;return db['DeskConfiguration'][_0x998a('0x4c')]({'where':{'id':_0x3b805d['params']['id']}})[_0x998a('0x25')](handleEntityNotFound(_0x9e05fe,null))[_0x998a('0x25')](function(_0x51a53d){if(_0x51a53d){_0x281576=_0x51a53d;_0x1c905a['model']=_[_0x998a('0x31')](db[_0x998a('0x4d')][_0x998a('0x2a')]);_0x1c905a['query']=_[_0x998a('0x31')](_0x3b805d[_0x998a('0x32')]);_0x1c905a[_0x998a('0x3a')]=_[_0x998a('0x33')](_0x1c905a['model'],_0x1c905a[_0x998a('0x32')]);_0xa18dce[_0x998a('0x34')]=_[_0x998a('0x33')](_0x1c905a[_0x998a('0x2e')],qs['fields'](_0x3b805d[_0x998a('0x32')][_0x998a('0x35')]));_0xa18dce[_0x998a('0x34')]=_0xa18dce[_0x998a('0x34')][_0x998a('0x36')]?_0xa18dce[_0x998a('0x34')]:_0x1c905a[_0x998a('0x2e')];_0xa18dce[_0x998a('0x38')]=qs['sort'](_0x3b805d[_0x998a('0x32')][_0x998a('0x39')]);_0xa18dce[_0x998a('0x3d')]=qs[_0x998a('0x3a')](_[_0x998a('0x3b')](_0x3b805d[_0x998a('0x32')],_0x1c905a[_0x998a('0x3a')]));if(_0x3b805d[_0x998a('0x32')]['filter']){_0xa18dce[_0x998a('0x3d')]=_[_0x998a('0x3e')](_0xa18dce[_0x998a('0x3d')],{'$or':_[_0x998a('0x2f')](_0xa18dce[_0x998a('0x34')],function(_0x3783cf){var _0x2ade60={};_0x2ade60[_0x3783cf]={'$like':'%'+_0x3b805d[_0x998a('0x32')][_0x998a('0x3c')]+'%'};return _0x2ade60;})});}_0xa18dce=_[_0x998a('0x3e')]({},_0xa18dce,_0x3b805d['options']);return _0x281576['getSubjects'](_0xa18dce);}})['then'](function(_0x15a652){if(_0x15a652){_0x42fbcf=_0x15a652['length'];if(!_0x3b805d[_0x998a('0x32')][_0x998a('0x37')]('nolimit')){_0xa18dce[_0x998a('0x1d')]=qs['limit'](_0x3b805d[_0x998a('0x32')][_0x998a('0x1d')]);_0xa18dce[_0x998a('0x1c')]=qs[_0x998a('0x1c')](_0x3b805d['query']['offset']);}return _0x281576[_0x998a('0x50')](_0xa18dce);}})['then'](function(_0x7b1f01){if(_0x7b1f01){return _0x7b1f01?{'count':_0x42fbcf,'rows':_0x7b1f01}:null;}})[_0x998a('0x25')](respondWithResult(_0x9e05fe,null))[_0x998a('0x4a')](handleError(_0x9e05fe,null));};exports[_0x998a('0x51')]=function(_0x35a3bf,_0x38c3a2,_0x132641){var _0xe54d5c={};var _0x43acda={};var _0x2509f8;var _0x31b8a5;return db[_0x998a('0x40')][_0x998a('0x4c')]({'where':{'id':_0x35a3bf['params']['id']}})[_0x998a('0x25')](handleEntityNotFound(_0x38c3a2,null))[_0x998a('0x25')](function(_0xc2cd39){if(_0xc2cd39){_0x2509f8=_0xc2cd39;_0x43acda['model']=_[_0x998a('0x31')](db[_0x998a('0x4d')][_0x998a('0x2a')]);_0x43acda['query']=_[_0x998a('0x31')](_0x35a3bf[_0x998a('0x32')]);_0x43acda['filters']=_[_0x998a('0x33')](_0x43acda['model'],_0x43acda[_0x998a('0x32')]);_0xe54d5c[_0x998a('0x34')]=_['intersection'](_0x43acda[_0x998a('0x2e')],qs[_0x998a('0x35')](_0x35a3bf[_0x998a('0x32')]['fields']));_0xe54d5c[_0x998a('0x34')]=_0xe54d5c[_0x998a('0x34')]['length']?_0xe54d5c['attributes']:_0x43acda['model'];_0xe54d5c[_0x998a('0x38')]=qs[_0x998a('0x39')](_0x35a3bf['query']['sort']);_0xe54d5c[_0x998a('0x3d')]=qs[_0x998a('0x3a')](_['pick'](_0x35a3bf[_0x998a('0x32')],_0x43acda[_0x998a('0x3a')]));if(_0x35a3bf[_0x998a('0x32')][_0x998a('0x3c')]){_0xe54d5c['where']=_[_0x998a('0x3e')](_0xe54d5c[_0x998a('0x3d')],{'$or':_[_0x998a('0x2f')](_0xe54d5c['attributes'],function(_0x5c44fc){var _0x1cedb0={};_0x1cedb0[_0x5c44fc]={'$like':'%'+_0x35a3bf[_0x998a('0x32')][_0x998a('0x3c')]+'%'};return _0x1cedb0;})});}_0xe54d5c=_[_0x998a('0x3e')]({},_0xe54d5c,_0x35a3bf['options']);return _0x2509f8[_0x998a('0x51')](_0xe54d5c);}})['then'](function(_0x481628){if(_0x481628){_0x31b8a5=_0x481628[_0x998a('0x36')];if(!_0x35a3bf[_0x998a('0x32')][_0x998a('0x37')](_0x998a('0x4f'))){_0xe54d5c[_0x998a('0x1d')]=qs[_0x998a('0x1d')](_0x35a3bf[_0x998a('0x32')][_0x998a('0x1d')]);_0xe54d5c[_0x998a('0x1c')]=qs[_0x998a('0x1c')](_0x35a3bf['query'][_0x998a('0x1c')]);}return _0x2509f8[_0x998a('0x51')](_0xe54d5c);}})[_0x998a('0x25')](function(_0x294ea3){if(_0x294ea3){return _0x294ea3?{'count':_0x31b8a5,'rows':_0x294ea3}:null;}})[_0x998a('0x25')](respondWithResult(_0x38c3a2,null))[_0x998a('0x4a')](handleError(_0x38c3a2,null));};exports['getTags']=function(_0x358df9,_0x4b0c7e,_0x286b50){var _0x2b759e={};var _0x5f138c={};var _0x2ceef8;var _0x53e005;return db['DeskConfiguration'][_0x998a('0x4c')]({'where':{'id':_0x358df9[_0x998a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b0c7e,null))['then'](function(_0x4450e8){if(_0x4450e8){_0x2ceef8=_0x4450e8;_0x5f138c[_0x998a('0x2e')]=_[_0x998a('0x31')](db[_0x998a('0x52')][_0x998a('0x2a')]);_0x5f138c['query']=_[_0x998a('0x31')](_0x358df9[_0x998a('0x32')]);_0x5f138c['filters']=_['intersection'](_0x5f138c[_0x998a('0x2e')],_0x5f138c[_0x998a('0x32')]);_0x2b759e[_0x998a('0x34')]=_[_0x998a('0x33')](_0x5f138c[_0x998a('0x2e')],qs[_0x998a('0x35')](_0x358df9['query'][_0x998a('0x35')]));_0x2b759e[_0x998a('0x34')]=_0x2b759e[_0x998a('0x34')][_0x998a('0x36')]?_0x2b759e[_0x998a('0x34')]:_0x5f138c[_0x998a('0x2e')];_0x2b759e[_0x998a('0x38')]=qs[_0x998a('0x39')](_0x358df9[_0x998a('0x32')]['sort']);_0x2b759e[_0x998a('0x3d')]=qs[_0x998a('0x3a')](_[_0x998a('0x3b')](_0x358df9[_0x998a('0x32')],_0x5f138c['filters']));if(_0x358df9['query']['filter']){_0x2b759e[_0x998a('0x3d')]=_[_0x998a('0x3e')](_0x2b759e['where'],{'$or':_[_0x998a('0x2f')](_0x2b759e['attributes'],function(_0x108b2c){var _0x4dccdb={};_0x4dccdb[_0x108b2c]={'$like':'%'+_0x358df9[_0x998a('0x32')][_0x998a('0x3c')]+'%'};return _0x4dccdb;})});}_0x2b759e=_['merge']({},_0x2b759e,_0x358df9['options']);return _0x2ceef8[_0x998a('0x53')](_0x2b759e);}})[_0x998a('0x25')](function(_0x1008d2){if(_0x1008d2){_0x53e005=_0x1008d2[_0x998a('0x36')];if(!_0x358df9[_0x998a('0x32')][_0x998a('0x37')](_0x998a('0x4f'))){_0x2b759e[_0x998a('0x1d')]=qs[_0x998a('0x1d')](_0x358df9[_0x998a('0x32')]['limit']);_0x2b759e[_0x998a('0x1c')]=qs[_0x998a('0x1c')](_0x358df9[_0x998a('0x32')][_0x998a('0x1c')]);}return _0x2ceef8[_0x998a('0x53')](_0x2b759e);}})[_0x998a('0x25')](function(_0x242b7f){if(_0x242b7f){return _0x242b7f?{'count':_0x53e005,'rows':_0x242b7f}:null;}})[_0x998a('0x25')](respondWithResult(_0x4b0c7e,null))['catch'](handleError(_0x4b0c7e,null));};exports[_0x998a('0x54')]=function(_0x41abf1,_0x4f87ac,_0x308c41){if(_0x41abf1[_0x998a('0x49')]['id']){delete _0x41abf1[_0x998a('0x49')]['id'];}return db[_0x998a('0x40')][_0x998a('0x4c')]({'where':{'id':_0x41abf1[_0x998a('0x46')]['id']}})[_0x998a('0x25')](handleEntityNotFound(_0x4f87ac,null))[_0x998a('0x25')](function(_0x50b68e){if(_0x50b68e){return _0x50b68e[_0x998a('0x54')](_0x41abf1[_0x998a('0x49')][_0x998a('0x55')]||[]);}return null;})[_0x998a('0x25')](respondWithResult(_0x4f87ac,null))[_0x998a('0x4a')](handleError(_0x4f87ac,null));}; \ No newline at end of file +var _0x54a8=['apply','reject','save','update','destroy','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','getFields','findOne','keys','hasOwnProperty','getSubjects','getDescriptions','DeskField','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54a8,0x8c));var _0x854a=function(_0x618262,_0x49404d){_0x618262=_0x618262-0x0;var _0x505533=_0x54a8[_0x618262];return _0x505533;};'use strict';var emlformat=require(_0x854a('0x0'));var rimraf=require(_0x854a('0x1'));var zipdir=require(_0x854a('0x2'));var jsonpatch=require(_0x854a('0x3'));var rp=require('request-promise');var moment=require(_0x854a('0x4'));var BPromise=require(_0x854a('0x5'));var Mustache=require(_0x854a('0x6'));var util=require(_0x854a('0x7'));var path=require(_0x854a('0x8'));var sox=require(_0x854a('0x9'));var csv=require(_0x854a('0xa'));var ejs=require(_0x854a('0xb'));var fs=require('fs');var fs_extra=require(_0x854a('0xc'));var _=require(_0x854a('0xd'));var squel=require('squel');var crypto=require(_0x854a('0xe'));var jsforce=require(_0x854a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x854a('0xa'));var querystring=require(_0x854a('0x10'));var Papa=require(_0x854a('0x11'));var Redis=require(_0x854a('0x12'));var authService=require(_0x854a('0x13'));var qs=require(_0x854a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x854a('0x15'));var logger=require(_0x854a('0x16'))(_0x854a('0x17'));var utils=require(_0x854a('0x18'));var config=require(_0x854a('0x19'));var licenseUtil=require(_0x854a('0x1a'));var db=require(_0x854a('0x1b'))['db'];function respondWithStatusCode(_0x3fd85e,_0x3be182){_0x3be182=_0x3be182||0xcc;return function(_0x38bb9d){if(_0x38bb9d){return _0x3fd85e[_0x854a('0x1c')](_0x3be182);}return _0x3fd85e['status'](_0x3be182)[_0x854a('0x1d')]();};}function respondWithResult(_0x4c49f0,_0x494fd8){_0x494fd8=_0x494fd8||0xc8;return function(_0xc3b065){if(_0xc3b065){return _0x4c49f0[_0x854a('0x1e')](_0x494fd8)['json'](_0xc3b065);}};}function respondWithFilteredResult(_0x3f4243,_0x56426b){return function(_0x1ded77){if(_0x1ded77){var _0x2641fd=typeof _0x56426b['offset']==='undefined'&&typeof _0x56426b[_0x854a('0x1f')]===_0x854a('0x20');var _0x270666=_0x1ded77['count'];var _0x1d9831=_0x2641fd?0x0:_0x56426b[_0x854a('0x21')];var _0x2966f6=_0x2641fd?_0x1ded77[_0x854a('0x22')]:_0x56426b[_0x854a('0x21')]+_0x56426b[_0x854a('0x1f')];var _0x3e4337;if(_0x2966f6>=_0x270666){_0x2966f6=_0x270666;_0x3e4337=0xc8;}else{_0x3e4337=0xce;}_0x3f4243['status'](_0x3e4337);return _0x3f4243[_0x854a('0x23')](_0x854a('0x24'),_0x1d9831+'-'+_0x2966f6+'/'+_0x270666)[_0x854a('0x25')](_0x1ded77);}return null;};}function patchUpdates(_0x3da340){return function(_0x559e7e){try{jsonpatch[_0x854a('0x26')](_0x559e7e,_0x3da340,!![]);}catch(_0x122f69){return BPromise[_0x854a('0x27')](_0x122f69);}return _0x559e7e[_0x854a('0x28')]();};}function saveUpdates(_0x4029a1,_0x274b9a){return function(_0x127ac3){if(_0x127ac3){return _0x127ac3[_0x854a('0x29')](_0x4029a1)['then'](function(_0x44770f){return _0x44770f;});}return null;};}function removeEntity(_0x4ccd0e,_0x1db0e3){return function(_0x18e90d){if(_0x18e90d){return _0x18e90d[_0x854a('0x2a')]()[_0x854a('0x2b')](function(){_0x4ccd0e[_0x854a('0x1e')](0xcc)[_0x854a('0x1d')]();});}};}function handleEntityNotFound(_0x2e3a27,_0x2c2fc7){return function(_0x5b55f9){if(!_0x5b55f9){_0x2e3a27['sendStatus'](0x194);}return _0x5b55f9;};}function handleError(_0x4df341,_0x2ce17c){_0x2ce17c=_0x2ce17c||0x1f4;return function(_0x173bd0){logger[_0x854a('0x2c')](_0x173bd0[_0x854a('0x2d')]);if(_0x173bd0[_0x854a('0x2e')]){delete _0x173bd0[_0x854a('0x2e')];}_0x4df341[_0x854a('0x1e')](_0x2ce17c)[_0x854a('0x2f')](_0x173bd0);};}exports[_0x854a('0x30')]=function(_0x453794,_0x412026){var _0x29392c={},_0x2bf1ad={},_0x5e2b36={'count':0x0,'rows':[]};var _0x2791d3=_[_0x854a('0x31')](db[_0x854a('0x32')][_0x854a('0x33')],function(_0x4b7e7f){return{'name':_0x4b7e7f[_0x854a('0x34')],'type':_0x4b7e7f[_0x854a('0x35')]['key']};});_0x2bf1ad[_0x854a('0x36')]=_['map'](_0x2791d3,_0x854a('0x2e'));_0x2bf1ad['query']=_['keys'](_0x453794[_0x854a('0x37')]);_0x2bf1ad[_0x854a('0x38')]=_[_0x854a('0x39')](_0x2bf1ad['model'],_0x2bf1ad[_0x854a('0x37')]);_0x29392c[_0x854a('0x3a')]=_[_0x854a('0x39')](_0x2bf1ad['model'],qs[_0x854a('0x3b')](_0x453794['query'][_0x854a('0x3b')]));_0x29392c[_0x854a('0x3a')]=_0x29392c['attributes']['length']?_0x29392c['attributes']:_0x2bf1ad['model'];if(!_0x453794['query']['hasOwnProperty'](_0x854a('0x3c'))){_0x29392c[_0x854a('0x1f')]=qs[_0x854a('0x1f')](_0x453794['query'][_0x854a('0x1f')]);_0x29392c[_0x854a('0x21')]=qs[_0x854a('0x21')](_0x453794[_0x854a('0x37')][_0x854a('0x21')]);}_0x29392c[_0x854a('0x3d')]=qs[_0x854a('0x3e')](_0x453794['query'][_0x854a('0x3e')]);_0x29392c[_0x854a('0x3f')]=qs[_0x854a('0x38')](_[_0x854a('0x40')](_0x453794[_0x854a('0x37')],_0x2bf1ad[_0x854a('0x38')]),_0x2791d3);if(_0x453794[_0x854a('0x37')][_0x854a('0x41')]){_0x29392c[_0x854a('0x3f')]=_[_0x854a('0x42')](_0x29392c[_0x854a('0x3f')],{'$or':_[_0x854a('0x31')](_0x2791d3,function(_0x4a6647){if(_0x4a6647[_0x854a('0x35')]!==_0x854a('0x43')){var _0x41fe19={};_0x41fe19[_0x4a6647['name']]={'$like':'%'+_0x453794[_0x854a('0x37')][_0x854a('0x41')]+'%'};return _0x41fe19;}})});}_0x29392c=_[_0x854a('0x42')]({},_0x29392c,_0x453794['options']);var _0x51ea3b={'where':_0x29392c[_0x854a('0x3f')]};return db['DeskConfiguration'][_0x854a('0x22')](_0x51ea3b)[_0x854a('0x2b')](function(_0x42c0b9){_0x5e2b36[_0x854a('0x22')]=_0x42c0b9;if(_0x453794[_0x854a('0x37')][_0x854a('0x44')]){_0x29392c['include']=[{'all':!![]}];}return db[_0x854a('0x32')][_0x854a('0x45')](_0x29392c);})[_0x854a('0x2b')](function(_0x1c1455){_0x5e2b36[_0x854a('0x46')]=_0x1c1455;return _0x5e2b36;})[_0x854a('0x2b')](respondWithFilteredResult(_0x412026,_0x29392c))[_0x854a('0x47')](handleError(_0x412026,null));};exports[_0x854a('0x48')]=function(_0x1f0ba8,_0x3216ae){var _0x5c4af1={'raw':![],'where':{'id':_0x1f0ba8[_0x854a('0x49')]['id']}},_0x51997c={};_0x51997c[_0x854a('0x36')]=_['keys'](db[_0x854a('0x32')][_0x854a('0x33')]);_0x51997c[_0x854a('0x37')]=_['keys'](_0x1f0ba8[_0x854a('0x37')]);_0x51997c['filters']=_[_0x854a('0x39')](_0x51997c[_0x854a('0x36')],_0x51997c[_0x854a('0x37')]);_0x5c4af1['attributes']=_[_0x854a('0x39')](_0x51997c['model'],qs[_0x854a('0x3b')](_0x1f0ba8[_0x854a('0x37')][_0x854a('0x3b')]));_0x5c4af1[_0x854a('0x3a')]=_0x5c4af1['attributes'][_0x854a('0x4a')]?_0x5c4af1[_0x854a('0x3a')]:_0x51997c['model'];if(_0x1f0ba8[_0x854a('0x37')][_0x854a('0x44')]){_0x5c4af1[_0x854a('0x4b')]=[{'all':!![]}];}_0x5c4af1=_[_0x854a('0x42')]({},_0x5c4af1,_0x1f0ba8[_0x854a('0x4c')]);return db[_0x854a('0x32')][_0x854a('0x4d')](_0x5c4af1)[_0x854a('0x2b')](handleEntityNotFound(_0x3216ae,null))[_0x854a('0x2b')](respondWithResult(_0x3216ae,null))['catch'](handleError(_0x3216ae,null));};exports[_0x854a('0x4e')]=function(_0x98e079,_0x5516aa){return db[_0x854a('0x32')]['create'](_0x98e079[_0x854a('0x4f')],{})[_0x854a('0x2b')](respondWithResult(_0x5516aa,0xc9))[_0x854a('0x47')](handleError(_0x5516aa,null));};exports[_0x854a('0x29')]=function(_0x9ac488,_0x1585df){if(_0x9ac488[_0x854a('0x4f')]['id']){delete _0x9ac488[_0x854a('0x4f')]['id'];}return db[_0x854a('0x32')][_0x854a('0x4d')]({'where':{'id':_0x9ac488[_0x854a('0x49')]['id']}})[_0x854a('0x2b')](handleEntityNotFound(_0x1585df,null))['then'](saveUpdates(_0x9ac488[_0x854a('0x4f')],null))[_0x854a('0x2b')](respondWithResult(_0x1585df,null))['catch'](handleError(_0x1585df,null));};exports['destroy']=function(_0x332532,_0x3744f5){return db[_0x854a('0x32')][_0x854a('0x4d')]({'where':{'id':_0x332532[_0x854a('0x49')]['id']}})[_0x854a('0x2b')](handleEntityNotFound(_0x3744f5,null))[_0x854a('0x2b')](removeEntity(_0x3744f5,null))[_0x854a('0x47')](handleError(_0x3744f5,null));};exports[_0x854a('0x50')]=function(_0xcb0cd5,_0x2cc6a0,_0x398cce){var _0x3847b6={};var _0xca01ce={};var _0x468adf;var _0x269d4d;return db[_0x854a('0x32')][_0x854a('0x51')]({'where':{'id':_0xcb0cd5['params']['id']}})[_0x854a('0x2b')](handleEntityNotFound(_0x2cc6a0,null))[_0x854a('0x2b')](function(_0x2b58f0){if(_0x2b58f0){_0x468adf=_0x2b58f0;_0xca01ce['model']=_[_0x854a('0x52')](db['DeskField']['rawAttributes']);_0xca01ce[_0x854a('0x37')]=_[_0x854a('0x52')](_0xcb0cd5[_0x854a('0x37')]);_0xca01ce[_0x854a('0x38')]=_[_0x854a('0x39')](_0xca01ce['model'],_0xca01ce[_0x854a('0x37')]);_0x3847b6[_0x854a('0x3a')]=_['intersection'](_0xca01ce[_0x854a('0x36')],qs[_0x854a('0x3b')](_0xcb0cd5['query'][_0x854a('0x3b')]));_0x3847b6[_0x854a('0x3a')]=_0x3847b6['attributes']['length']?_0x3847b6[_0x854a('0x3a')]:_0xca01ce[_0x854a('0x36')];_0x3847b6['order']=qs['sort'](_0xcb0cd5['query'][_0x854a('0x3e')]);_0x3847b6[_0x854a('0x3f')]=qs[_0x854a('0x38')](_[_0x854a('0x40')](_0xcb0cd5['query'],_0xca01ce[_0x854a('0x38')]));if(_0xcb0cd5[_0x854a('0x37')][_0x854a('0x41')]){_0x3847b6['where']=_[_0x854a('0x42')](_0x3847b6['where'],{'$or':_[_0x854a('0x31')](_0x3847b6[_0x854a('0x3a')],function(_0x94e0c8){var _0x4b856f={};_0x4b856f[_0x94e0c8]={'$like':'%'+_0xcb0cd5[_0x854a('0x37')]['filter']+'%'};return _0x4b856f;})});}_0x3847b6=_['merge']({},_0x3847b6,_0xcb0cd5[_0x854a('0x4c')]);return _0x468adf['getFields'](_0x3847b6);}})[_0x854a('0x2b')](function(_0x5cdbcd){if(_0x5cdbcd){_0x269d4d=_0x5cdbcd['length'];if(!_0xcb0cd5[_0x854a('0x37')][_0x854a('0x53')](_0x854a('0x3c'))){_0x3847b6[_0x854a('0x1f')]=qs[_0x854a('0x1f')](_0xcb0cd5[_0x854a('0x37')]['limit']);_0x3847b6[_0x854a('0x21')]=qs[_0x854a('0x21')](_0xcb0cd5[_0x854a('0x37')]['offset']);}return _0x468adf[_0x854a('0x50')](_0x3847b6);}})[_0x854a('0x2b')](function(_0x3192ef){if(_0x3192ef){return _0x3192ef?{'count':_0x269d4d,'rows':_0x3192ef}:null;}})['then'](respondWithResult(_0x2cc6a0,null))['catch'](handleError(_0x2cc6a0,null));};exports[_0x854a('0x54')]=function(_0x476d06,_0x1fcfff,_0x5261e7){var _0x3448c3={};var _0x282b00={};var _0x55df69;var _0x54ecb2;return db[_0x854a('0x32')][_0x854a('0x51')]({'where':{'id':_0x476d06[_0x854a('0x49')]['id']}})[_0x854a('0x2b')](handleEntityNotFound(_0x1fcfff,null))['then'](function(_0x480ea6){if(_0x480ea6){_0x55df69=_0x480ea6;_0x282b00[_0x854a('0x36')]=_[_0x854a('0x52')](db['DeskField']['rawAttributes']);_0x282b00[_0x854a('0x37')]=_[_0x854a('0x52')](_0x476d06['query']);_0x282b00[_0x854a('0x38')]=_[_0x854a('0x39')](_0x282b00[_0x854a('0x36')],_0x282b00[_0x854a('0x37')]);_0x3448c3[_0x854a('0x3a')]=_['intersection'](_0x282b00[_0x854a('0x36')],qs[_0x854a('0x3b')](_0x476d06['query'][_0x854a('0x3b')]));_0x3448c3[_0x854a('0x3a')]=_0x3448c3[_0x854a('0x3a')][_0x854a('0x4a')]?_0x3448c3[_0x854a('0x3a')]:_0x282b00[_0x854a('0x36')];_0x3448c3[_0x854a('0x3d')]=qs[_0x854a('0x3e')](_0x476d06[_0x854a('0x37')][_0x854a('0x3e')]);_0x3448c3[_0x854a('0x3f')]=qs[_0x854a('0x38')](_['pick'](_0x476d06[_0x854a('0x37')],_0x282b00[_0x854a('0x38')]));if(_0x476d06[_0x854a('0x37')]['filter']){_0x3448c3[_0x854a('0x3f')]=_[_0x854a('0x42')](_0x3448c3[_0x854a('0x3f')],{'$or':_[_0x854a('0x31')](_0x3448c3[_0x854a('0x3a')],function(_0x149ff2){var _0x4dbe0d={};_0x4dbe0d[_0x149ff2]={'$like':'%'+_0x476d06[_0x854a('0x37')][_0x854a('0x41')]+'%'};return _0x4dbe0d;})});}_0x3448c3=_[_0x854a('0x42')]({},_0x3448c3,_0x476d06[_0x854a('0x4c')]);return _0x55df69[_0x854a('0x54')](_0x3448c3);}})['then'](function(_0x1e2a35){if(_0x1e2a35){_0x54ecb2=_0x1e2a35['length'];if(!_0x476d06[_0x854a('0x37')][_0x854a('0x53')]('nolimit')){_0x3448c3['limit']=qs[_0x854a('0x1f')](_0x476d06[_0x854a('0x37')][_0x854a('0x1f')]);_0x3448c3[_0x854a('0x21')]=qs[_0x854a('0x21')](_0x476d06[_0x854a('0x37')]['offset']);}return _0x55df69[_0x854a('0x54')](_0x3448c3);}})[_0x854a('0x2b')](function(_0x3c516c){if(_0x3c516c){return _0x3c516c?{'count':_0x54ecb2,'rows':_0x3c516c}:null;}})[_0x854a('0x2b')](respondWithResult(_0x1fcfff,null))[_0x854a('0x47')](handleError(_0x1fcfff,null));};exports[_0x854a('0x55')]=function(_0x113d19,_0x5878a5,_0x1b857c){var _0x10fe11={};var _0x4b9817={};var _0x31438b;var _0x2e1731;return db[_0x854a('0x32')][_0x854a('0x51')]({'where':{'id':_0x113d19[_0x854a('0x49')]['id']}})[_0x854a('0x2b')](handleEntityNotFound(_0x5878a5,null))[_0x854a('0x2b')](function(_0x59a6e9){if(_0x59a6e9){_0x31438b=_0x59a6e9;_0x4b9817[_0x854a('0x36')]=_[_0x854a('0x52')](db[_0x854a('0x56')]['rawAttributes']);_0x4b9817[_0x854a('0x37')]=_['keys'](_0x113d19[_0x854a('0x37')]);_0x4b9817['filters']=_['intersection'](_0x4b9817['model'],_0x4b9817[_0x854a('0x37')]);_0x10fe11[_0x854a('0x3a')]=_[_0x854a('0x39')](_0x4b9817[_0x854a('0x36')],qs['fields'](_0x113d19[_0x854a('0x37')][_0x854a('0x3b')]));_0x10fe11['attributes']=_0x10fe11[_0x854a('0x3a')]['length']?_0x10fe11[_0x854a('0x3a')]:_0x4b9817[_0x854a('0x36')];_0x10fe11[_0x854a('0x3d')]=qs[_0x854a('0x3e')](_0x113d19['query']['sort']);_0x10fe11[_0x854a('0x3f')]=qs[_0x854a('0x38')](_[_0x854a('0x40')](_0x113d19['query'],_0x4b9817[_0x854a('0x38')]));if(_0x113d19['query']['filter']){_0x10fe11[_0x854a('0x3f')]=_[_0x854a('0x42')](_0x10fe11[_0x854a('0x3f')],{'$or':_[_0x854a('0x31')](_0x10fe11[_0x854a('0x3a')],function(_0x2c02f1){var _0x164acc={};_0x164acc[_0x2c02f1]={'$like':'%'+_0x113d19['query'][_0x854a('0x41')]+'%'};return _0x164acc;})});}_0x10fe11=_['merge']({},_0x10fe11,_0x113d19[_0x854a('0x4c')]);return _0x31438b['getDescriptions'](_0x10fe11);}})[_0x854a('0x2b')](function(_0x5cff2b){if(_0x5cff2b){_0x2e1731=_0x5cff2b[_0x854a('0x4a')];if(!_0x113d19[_0x854a('0x37')][_0x854a('0x53')](_0x854a('0x3c'))){_0x10fe11[_0x854a('0x1f')]=qs[_0x854a('0x1f')](_0x113d19['query'][_0x854a('0x1f')]);_0x10fe11['offset']=qs[_0x854a('0x21')](_0x113d19[_0x854a('0x37')]['offset']);}return _0x31438b[_0x854a('0x55')](_0x10fe11);}})[_0x854a('0x2b')](function(_0x151b1d){if(_0x151b1d){return _0x151b1d?{'count':_0x2e1731,'rows':_0x151b1d}:null;}})[_0x854a('0x2b')](respondWithResult(_0x5878a5,null))[_0x854a('0x47')](handleError(_0x5878a5,null));};exports['getTags']=function(_0x3b970d,_0x5c5d70,_0x5c240e){var _0x43fdbd={};var _0x3e319e={};var _0x574d6e;var _0x8c3d0d;return db['DeskConfiguration'][_0x854a('0x51')]({'where':{'id':_0x3b970d[_0x854a('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c5d70,null))[_0x854a('0x2b')](function(_0x572457){if(_0x572457){_0x574d6e=_0x572457;_0x3e319e[_0x854a('0x36')]=_['keys'](db['Tag']['rawAttributes']);_0x3e319e[_0x854a('0x37')]=_[_0x854a('0x52')](_0x3b970d[_0x854a('0x37')]);_0x3e319e[_0x854a('0x38')]=_[_0x854a('0x39')](_0x3e319e[_0x854a('0x36')],_0x3e319e[_0x854a('0x37')]);_0x43fdbd[_0x854a('0x3a')]=_[_0x854a('0x39')](_0x3e319e[_0x854a('0x36')],qs[_0x854a('0x3b')](_0x3b970d[_0x854a('0x37')]['fields']));_0x43fdbd[_0x854a('0x3a')]=_0x43fdbd[_0x854a('0x3a')][_0x854a('0x4a')]?_0x43fdbd[_0x854a('0x3a')]:_0x3e319e[_0x854a('0x36')];_0x43fdbd[_0x854a('0x3d')]=qs[_0x854a('0x3e')](_0x3b970d[_0x854a('0x37')]['sort']);_0x43fdbd[_0x854a('0x3f')]=qs[_0x854a('0x38')](_[_0x854a('0x40')](_0x3b970d[_0x854a('0x37')],_0x3e319e[_0x854a('0x38')]));if(_0x3b970d[_0x854a('0x37')][_0x854a('0x41')]){_0x43fdbd['where']=_[_0x854a('0x42')](_0x43fdbd[_0x854a('0x3f')],{'$or':_[_0x854a('0x31')](_0x43fdbd[_0x854a('0x3a')],function(_0x2d455c){var _0xc873d4={};_0xc873d4[_0x2d455c]={'$like':'%'+_0x3b970d[_0x854a('0x37')][_0x854a('0x41')]+'%'};return _0xc873d4;})});}_0x43fdbd=_[_0x854a('0x42')]({},_0x43fdbd,_0x3b970d['options']);return _0x574d6e[_0x854a('0x57')](_0x43fdbd);}})['then'](function(_0xf13a52){if(_0xf13a52){_0x8c3d0d=_0xf13a52[_0x854a('0x4a')];if(!_0x3b970d[_0x854a('0x37')]['hasOwnProperty'](_0x854a('0x3c'))){_0x43fdbd['limit']=qs[_0x854a('0x1f')](_0x3b970d[_0x854a('0x37')]['limit']);_0x43fdbd[_0x854a('0x21')]=qs[_0x854a('0x21')](_0x3b970d[_0x854a('0x37')][_0x854a('0x21')]);}return _0x574d6e[_0x854a('0x57')](_0x43fdbd);}})['then'](function(_0x4c9210){if(_0x4c9210){return _0x4c9210?{'count':_0x8c3d0d,'rows':_0x4c9210}:null;}})[_0x854a('0x2b')](respondWithResult(_0x5c5d70,null))['catch'](handleError(_0x5c5d70,null));};exports[_0x854a('0x58')]=function(_0x434027,_0x10ffe4,_0x336715){if(_0x434027[_0x854a('0x4f')]['id']){delete _0x434027['body']['id'];}return db['DeskConfiguration'][_0x854a('0x51')]({'where':{'id':_0x434027[_0x854a('0x49')]['id']}})[_0x854a('0x2b')](handleEntityNotFound(_0x10ffe4,null))[_0x854a('0x2b')](function(_0x13ca08){if(_0x13ca08){return _0x13ca08[_0x854a('0x58')](_0x434027[_0x854a('0x4f')]['ids']||[]);}return null;})[_0x854a('0x2b')](respondWithResult(_0x10ffe4,null))[_0x854a('0x47')](handleError(_0x10ffe4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index a89725d..ea6bbc7 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 _0xf87a=['rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','request-promise','path'];(function(_0x5d5de5,_0x1b0c88){var _0x52937a=function(_0x3b0ea1){while(--_0x3b0ea1){_0x5d5de5['push'](_0x5d5de5['shift']());}};_0x52937a(++_0x1b0c88);}(_0xf87a,0x103));var _0xaf87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf87a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xaf87('0x0'));var util=require(_0xaf87('0x1'));var logger=require(_0xaf87('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf87('0x3'));var fs=require('fs');var path=require(_0xaf87('0x4'));var rimraf=require(_0xaf87('0x5'));var config=require(_0xaf87('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0xaf87('0x7')]=function(_0x22fd9a,_0x1e2578){return _0x22fd9a[_0xaf87('0x8')](_0xaf87('0x9'),attributes,{'tableName':_0xaf87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2484=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','../../config/logger','api','moment'];(function(_0x3ec74a,_0x220548){var _0xb03500=function(_0x4f4e33){while(--_0x4f4e33){_0x3ec74a['push'](_0x3ec74a['shift']());}};_0xb03500(++_0x220548);}(_0x2484,0x171));var _0x4248=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x2484[_0x5a7e3c];return _0x59252b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4248('0x0'))(_0x4248('0x1'));var moment=require(_0x4248('0x2'));var BPromise=require(_0x4248('0x3'));var rp=require(_0x4248('0x4'));var fs=require('fs');var path=require(_0x4248('0x5'));var rimraf=require(_0x4248('0x6'));var config=require(_0x4248('0x7'));var attributes=require(_0x4248('0x8'));module[_0x4248('0x9')]=function(_0x59a7c3,_0x47676a){return _0x59a7c3[_0x4248('0xa')](_0x4248('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 2327e16..da87021 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 _0x2fe5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','message','DeskConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x6f2ce5,_0x4231eb){var _0x28a54a=function(_0x1bc980){while(--_0x1bc980){_0x6f2ce5['push'](_0x6f2ce5['shift']());}};_0x28a54a(++_0x4231eb);}(_0x2fe5,0x14b));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x52fe('0x2'));var fs=require('fs');var Redis=require(_0x52fe('0x3'));var db=require(_0x52fe('0x4'))['db'];var utils=require(_0x52fe('0x5'));var logger=require(_0x52fe('0x6'))('rpc');var config=require(_0x52fe('0x7'));var jayson=require(_0x52fe('0x8'));var client=jayson['client'][_0x52fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157c5a,_0x2b3f41,_0x31b5dd){return new BPromise(function(_0x408cef,_0x49f7d9){return client[_0x52fe('0xa')](_0x157c5a,_0x31b5dd)[_0x52fe('0xb')](function(_0xe73ece){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x2b3f41,_0x52fe('0xc'));logger[_0x52fe('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2b3f41,_0x52fe('0xc'),JSON[_0x52fe('0xe')](_0xe73ece));if(_0xe73ece[_0x52fe('0xf')]){if(_0xe73ece[_0x52fe('0xf')]['code']===0x1f4){logger[_0x52fe('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2b3f41,_0xe73ece[_0x52fe('0xf')]['message']);return _0x49f7d9(_0xe73ece[_0x52fe('0xf')][_0x52fe('0x10')]);}logger[_0x52fe('0xf')](_0x52fe('0x11'),_0x2b3f41,_0xe73ece['error'][_0x52fe('0x10')]);return _0x408cef(_0xe73ece[_0x52fe('0xf')][_0x52fe('0x10')]);}else{logger[_0x52fe('0x12')](_0x52fe('0x11'),_0x2b3f41,_0x52fe('0xc'));_0x408cef(_0xe73ece[_0x52fe('0x13')][_0x52fe('0x10')]);}})[_0x52fe('0x14')](function(_0x33ab22){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2b3f41,_0x33ab22);_0x49f7d9(_0x33ab22);});});} \ No newline at end of file +var _0x56fd=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash'];(function(_0x42b789,_0x46d8d4){var _0x3dee14=function(_0x2fe865){while(--_0x2fe865){_0x42b789['push'](_0x42b789['shift']());}};_0x3dee14(++_0x46d8d4);}(_0x56fd,0x15f));var _0xd56f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56fd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd56f('0x0'));var util=require(_0xd56f('0x1'));var moment=require(_0xd56f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd56f('0x3'));var fs=require('fs');var Redis=require(_0xd56f('0x4'));var db=require(_0xd56f('0x5'))['db'];var utils=require(_0xd56f('0x6'));var logger=require('../../config/logger')(_0xd56f('0x7'));var config=require(_0xd56f('0x8'));var jayson=require(_0xd56f('0x9'));var client=jayson[_0xd56f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9bc7,_0x7105fb,_0x33e451){return new BPromise(function(_0xb00fdf,_0x4cf2f6){return client[_0xd56f('0xb')](_0x4c9bc7,_0x33e451)[_0xd56f('0xc')](function(_0xc1ec1f){logger['info'](_0xd56f('0xd'),_0x7105fb,_0xd56f('0xe'));logger[_0xd56f('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x7105fb,_0xd56f('0xe'),JSON[_0xd56f('0x10')](_0xc1ec1f));if(_0xc1ec1f[_0xd56f('0x11')]){if(_0xc1ec1f[_0xd56f('0x11')][_0xd56f('0x12')]===0x1f4){logger[_0xd56f('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x7105fb,_0xc1ec1f['error'][_0xd56f('0x13')]);return _0x4cf2f6(_0xc1ec1f[_0xd56f('0x11')][_0xd56f('0x13')]);}logger[_0xd56f('0x11')](_0xd56f('0xd'),_0x7105fb,_0xc1ec1f['error']['message']);return _0xb00fdf(_0xc1ec1f[_0xd56f('0x11')]['message']);}else{logger[_0xd56f('0x14')](_0xd56f('0xd'),_0x7105fb,'request\x20sent');_0xb00fdf(_0xc1ec1f[_0xd56f('0x15')][_0xd56f('0x13')]);}})['catch'](function(_0x20c42d){logger[_0xd56f('0x11')](_0xd56f('0xd'),_0x7105fb,_0x20c42d);_0x4cf2f6(_0x20c42d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4b60751..ba7b3e9 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 _0x4361=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','util','path','express'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x4361,0x1ea));var _0x1436=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4361[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x1436('0x0'));var path=require(_0x1436('0x1'));var timeout=require('connect-timeout');var express=require(_0x1436('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1436('0x3'));var interaction=require(_0x1436('0x4'));var config=require(_0x1436('0x5'));var controller=require(_0x1436('0x6'));router[_0x1436('0x7')]('/',auth[_0x1436('0x8')](),controller['index']);router[_0x1436('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1436('0x9')]);router[_0x1436('0xa')]('/',auth[_0x1436('0x8')](),controller[_0x1436('0xb')]);router[_0x1436('0xc')](_0x1436('0xd'),auth[_0x1436('0x8')](),controller[_0x1436('0xe')]);router['delete'](_0x1436('0xd'),auth[_0x1436('0x8')](),controller[_0x1436('0xf')]);module[_0x1436('0x10')]=router; \ No newline at end of file +var _0x48ae=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x31eb73,_0x26ed90){var _0x4d0e02=function(_0x5aaedb){while(--_0x5aaedb){_0x31eb73['push'](_0x31eb73['shift']());}};_0x4d0e02(++_0x26ed90);}(_0x48ae,0xd2));var _0xe48a=function(_0x2061e7,_0x54a195){_0x2061e7=_0x2061e7-0x0;var _0x40b072=_0x48ae[_0x2061e7];return _0x40b072;};'use strict';var multer=require(_0xe48a('0x0'));var util=require(_0xe48a('0x1'));var path=require(_0xe48a('0x2'));var timeout=require(_0xe48a('0x3'));var express=require(_0xe48a('0x4'));var router=express[_0xe48a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe48a('0x6'));var interaction=require(_0xe48a('0x7'));var config=require(_0xe48a('0x8'));var controller=require('./intDeskField.controller');router[_0xe48a('0x9')]('/',auth[_0xe48a('0xa')](),controller[_0xe48a('0xb')]);router[_0xe48a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe48a('0xc')]);router[_0xe48a('0xd')]('/',auth[_0xe48a('0xa')](),controller['create']);router[_0xe48a('0xe')](_0xe48a('0xf'),auth[_0xe48a('0xa')](),controller['update']);router[_0xe48a('0x10')]('/:id',auth[_0xe48a('0xa')](),controller[_0xe48a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 0f5ed7a..c4f963c 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 _0xc298=['customVariable','keyValue','string','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xc298,0x156));var _0x8c29=function(_0x219e2c,_0x49bdf2){_0x219e2c=_0x219e2c-0x0;var _0x1dee0a=_0xc298[_0x219e2c];return _0x1dee0a;};'use strict';var Sequelize=require(_0x8c29('0x0'));module[_0x8c29('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x8c29('0x2'),_0x8c29('0x3'),'picklist'),'defaultValue':_0x8c29('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8c29('0x5')]},'keyType':{'type':Sequelize[_0x8c29('0x6')](_0x8c29('0x4'),'variable',_0x8c29('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8c29('0x5')]},'customField':{'type':Sequelize[_0x8c29('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c29('0x5')]}}; \ No newline at end of file +var _0x3952=['sequelize','ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3952,0x14d));var _0x2395=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x3952[_0x556927];return _0x5f1235;};'use strict';var Sequelize=require(_0x2395('0x0'));module['exports']={'type':{'type':Sequelize[_0x2395('0x1')]('string','variable',_0x2395('0x2'),_0x2395('0x3'),_0x2395('0x4')),'defaultValue':_0x2395('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2395('0x6')]},'keyType':{'type':Sequelize[_0x2395('0x1')](_0x2395('0x5'),_0x2395('0x7'),_0x2395('0x2'))},'keyContent':{'type':Sequelize[_0x2395('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2395('0x6')]},'customField':{'type':Sequelize[_0x2395('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2395('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index c982c1a..e6fde0c 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 _0xf435=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','fields','length','include','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x1fa0c1,_0x3e9e00){var _0x3d9e14=function(_0x5e7790){while(--_0x5e7790){_0x1fa0c1['push'](_0x1fa0c1['shift']());}};_0x3d9e14(++_0x3e9e00);}(_0xf435,0x174));var _0x5f43=function(_0xdd501d,_0x2218de){_0xdd501d=_0xdd501d-0x0;var _0xff9fa4=_0xf435[_0xdd501d];return _0xff9fa4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f43('0x0'));var zipdir=require(_0x5f43('0x1'));var jsonpatch=require(_0x5f43('0x2'));var rp=require(_0x5f43('0x3'));var moment=require(_0x5f43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f43('0x5'));var util=require(_0x5f43('0x6'));var path=require(_0x5f43('0x7'));var sox=require(_0x5f43('0x8'));var csv=require('to-csv');var ejs=require(_0x5f43('0x9'));var fs=require('fs');var fs_extra=require(_0x5f43('0xa'));var _=require(_0x5f43('0xb'));var squel=require('squel');var crypto=require(_0x5f43('0xc'));var jsforce=require(_0x5f43('0xd'));var deskjs=require(_0x5f43('0xe'));var toCsv=require(_0x5f43('0xf'));var querystring=require(_0x5f43('0x10'));var Papa=require(_0x5f43('0x11'));var Redis=require(_0x5f43('0x12'));var authService=require(_0x5f43('0x13'));var qs=require(_0x5f43('0x14'));var as=require(_0x5f43('0x15'));var hardwareService=require(_0x5f43('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x5f43('0x17'));var config=require(_0x5f43('0x18'));var licenseUtil=require(_0x5f43('0x19'));var db=require(_0x5f43('0x1a'))['db'];function respondWithStatusCode(_0x397ed3,_0x56618d){_0x56618d=_0x56618d||0xcc;return function(_0x16d337){if(_0x16d337){return _0x397ed3[_0x5f43('0x1b')](_0x56618d);}return _0x397ed3['status'](_0x56618d)[_0x5f43('0x1c')]();};}function respondWithResult(_0x4f2908,_0x3c7342){_0x3c7342=_0x3c7342||0xc8;return function(_0x599852){if(_0x599852){return _0x4f2908[_0x5f43('0x1d')](_0x3c7342)[_0x5f43('0x1e')](_0x599852);}};}function respondWithFilteredResult(_0x45c005,_0x275060){return function(_0x50cb6a){if(_0x50cb6a){var _0x34de1f=typeof _0x275060[_0x5f43('0x1f')]===_0x5f43('0x20')&&typeof _0x275060['limit']===_0x5f43('0x20');var _0x53f8b3=_0x50cb6a[_0x5f43('0x21')];var _0xfdee97=_0x34de1f?0x0:_0x275060[_0x5f43('0x1f')];var _0x2a5c6c=_0x34de1f?_0x50cb6a['count']:_0x275060[_0x5f43('0x1f')]+_0x275060[_0x5f43('0x22')];var _0x53e640;if(_0x2a5c6c>=_0x53f8b3){_0x2a5c6c=_0x53f8b3;_0x53e640=0xc8;}else{_0x53e640=0xce;}_0x45c005[_0x5f43('0x1d')](_0x53e640);return _0x45c005[_0x5f43('0x23')](_0x5f43('0x24'),_0xfdee97+'-'+_0x2a5c6c+'/'+_0x53f8b3)[_0x5f43('0x1e')](_0x50cb6a);}return null;};}function patchUpdates(_0x750a7d){return function(_0x221c6e){try{jsonpatch['apply'](_0x221c6e,_0x750a7d,!![]);}catch(_0x2b3eea){return BPromise['reject'](_0x2b3eea);}return _0x221c6e[_0x5f43('0x25')]();};}function saveUpdates(_0x4a2d3d,_0x49621e){return function(_0x4d7dc7){if(_0x4d7dc7){return _0x4d7dc7[_0x5f43('0x26')](_0x4a2d3d)[_0x5f43('0x27')](function(_0x8ee422){return _0x8ee422;});}return null;};}function removeEntity(_0x1a8fbe,_0x364e61){return function(_0x1e133f){if(_0x1e133f){return _0x1e133f[_0x5f43('0x28')]()[_0x5f43('0x27')](function(){_0x1a8fbe[_0x5f43('0x1d')](0xcc)[_0x5f43('0x1c')]();});}};}function handleEntityNotFound(_0x569d0d,_0x541cd8){return function(_0x31bd88){if(!_0x31bd88){_0x569d0d[_0x5f43('0x1b')](0x194);}return _0x31bd88;};}function handleError(_0x5c2283,_0x2f2481){_0x2f2481=_0x2f2481||0x1f4;return function(_0x1f79fd){logger[_0x5f43('0x29')](_0x1f79fd[_0x5f43('0x2a')]);if(_0x1f79fd[_0x5f43('0x2b')]){delete _0x1f79fd[_0x5f43('0x2b')];}_0x5c2283[_0x5f43('0x1d')](_0x2f2481)[_0x5f43('0x2c')](_0x1f79fd);};}exports[_0x5f43('0x2d')]=function(_0x2de728,_0xadd507){var _0x531cd4={},_0x292ff6={},_0x3a0240={'count':0x0,'rows':[]};var _0x2d8363=_[_0x5f43('0x2e')](db[_0x5f43('0x2f')][_0x5f43('0x30')],function(_0x43eb59){return{'name':_0x43eb59[_0x5f43('0x31')],'type':_0x43eb59[_0x5f43('0x32')][_0x5f43('0x33')]};});_0x292ff6['model']=_[_0x5f43('0x2e')](_0x2d8363,'name');_0x292ff6[_0x5f43('0x34')]=_[_0x5f43('0x35')](_0x2de728[_0x5f43('0x34')]);_0x292ff6[_0x5f43('0x36')]=_['intersection'](_0x292ff6[_0x5f43('0x37')],_0x292ff6[_0x5f43('0x34')]);_0x531cd4['attributes']=_[_0x5f43('0x38')](_0x292ff6[_0x5f43('0x37')],qs['fields'](_0x2de728['query']['fields']));_0x531cd4[_0x5f43('0x39')]=_0x531cd4[_0x5f43('0x39')]['length']?_0x531cd4[_0x5f43('0x39')]:_0x292ff6[_0x5f43('0x37')];if(!_0x2de728[_0x5f43('0x34')]['hasOwnProperty'](_0x5f43('0x3a'))){_0x531cd4['limit']=qs['limit'](_0x2de728[_0x5f43('0x34')]['limit']);_0x531cd4[_0x5f43('0x1f')]=qs['offset'](_0x2de728[_0x5f43('0x34')][_0x5f43('0x1f')]);}_0x531cd4[_0x5f43('0x3b')]=qs[_0x5f43('0x3c')](_0x2de728[_0x5f43('0x34')][_0x5f43('0x3c')]);_0x531cd4[_0x5f43('0x3d')]=qs[_0x5f43('0x36')](_[_0x5f43('0x3e')](_0x2de728[_0x5f43('0x34')],_0x292ff6['filters']),_0x2d8363);if(_0x2de728[_0x5f43('0x34')][_0x5f43('0x3f')]){_0x531cd4[_0x5f43('0x3d')]=_[_0x5f43('0x40')](_0x531cd4[_0x5f43('0x3d')],{'$or':_[_0x5f43('0x2e')](_0x2d8363,function(_0x4ac5e2){if(_0x4ac5e2[_0x5f43('0x32')]!==_0x5f43('0x41')){var _0x48ce1f={};_0x48ce1f[_0x4ac5e2[_0x5f43('0x2b')]]={'$like':'%'+_0x2de728['query'][_0x5f43('0x3f')]+'%'};return _0x48ce1f;}})});}_0x531cd4=_['merge']({},_0x531cd4,_0x2de728[_0x5f43('0x42')]);var _0x3c42e2={'where':_0x531cd4[_0x5f43('0x3d')]};return db[_0x5f43('0x2f')][_0x5f43('0x21')](_0x3c42e2)[_0x5f43('0x27')](function(_0x34d0df){_0x3a0240['count']=_0x34d0df;if(_0x2de728['query'][_0x5f43('0x43')]){_0x531cd4['include']=[{'all':!![]}];}return db[_0x5f43('0x2f')][_0x5f43('0x44')](_0x531cd4);})[_0x5f43('0x27')](function(_0x2dabe9){_0x3a0240['rows']=_0x2dabe9;return _0x3a0240;})[_0x5f43('0x27')](respondWithFilteredResult(_0xadd507,_0x531cd4))['catch'](handleError(_0xadd507,null));};exports[_0x5f43('0x45')]=function(_0x8eada9,_0x4ddd6b){var _0x1d185d={'raw':!![],'where':{'id':_0x8eada9[_0x5f43('0x46')]['id']}},_0x4e6245={};_0x4e6245[_0x5f43('0x37')]=_['keys'](db[_0x5f43('0x2f')][_0x5f43('0x30')]);_0x4e6245['query']=_[_0x5f43('0x35')](_0x8eada9[_0x5f43('0x34')]);_0x4e6245[_0x5f43('0x36')]=_[_0x5f43('0x38')](_0x4e6245['model'],_0x4e6245[_0x5f43('0x34')]);_0x1d185d[_0x5f43('0x39')]=_['intersection'](_0x4e6245['model'],qs[_0x5f43('0x47')](_0x8eada9['query'][_0x5f43('0x47')]));_0x1d185d[_0x5f43('0x39')]=_0x1d185d['attributes'][_0x5f43('0x48')]?_0x1d185d[_0x5f43('0x39')]:_0x4e6245[_0x5f43('0x37')];if(_0x8eada9[_0x5f43('0x34')][_0x5f43('0x43')]){_0x1d185d[_0x5f43('0x49')]=[{'all':!![]}];}_0x1d185d=_[_0x5f43('0x40')]({},_0x1d185d,_0x8eada9[_0x5f43('0x42')]);return db[_0x5f43('0x2f')][_0x5f43('0x4a')](_0x1d185d)[_0x5f43('0x27')](handleEntityNotFound(_0x4ddd6b,null))[_0x5f43('0x27')](respondWithResult(_0x4ddd6b,null))['catch'](handleError(_0x4ddd6b,null));};exports[_0x5f43('0x4b')]=function(_0x51fb64,_0x5bc422){return db[_0x5f43('0x2f')][_0x5f43('0x4b')](_0x51fb64[_0x5f43('0x4c')],{})[_0x5f43('0x27')](respondWithResult(_0x5bc422,0xc9))[_0x5f43('0x4d')](handleError(_0x5bc422,null));};exports[_0x5f43('0x26')]=function(_0x5614d3,_0x195605){if(_0x5614d3[_0x5f43('0x4c')]['id']){delete _0x5614d3['body']['id'];}return db[_0x5f43('0x2f')][_0x5f43('0x4a')]({'where':{'id':_0x5614d3[_0x5f43('0x46')]['id']}})[_0x5f43('0x27')](handleEntityNotFound(_0x195605,null))['then'](saveUpdates(_0x5614d3[_0x5f43('0x4c')],null))[_0x5f43('0x27')](respondWithResult(_0x195605,null))[_0x5f43('0x4d')](handleError(_0x195605,null));};exports['destroy']=function(_0x572850,_0x5ea85e){return db['DeskField']['find']({'where':{'id':_0x572850[_0x5f43('0x46')]['id']}})[_0x5f43('0x27')](handleEntityNotFound(_0x5ea85e,null))[_0x5f43('0x27')](removeEntity(_0x5ea85e,null))[_0x5f43('0x4d')](handleError(_0x5ea85e,null));}; \ No newline at end of file +var _0x2d85=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','map','DeskField','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body'];(function(_0x1e8221,_0xf1c999){var _0x428bf3=function(_0x1eb603){while(--_0x1eb603){_0x1e8221['push'](_0x1e8221['shift']());}};_0x428bf3(++_0xf1c999);}(_0x2d85,0xd8));var _0x52d8=function(_0x318ad1,_0x381fdd){_0x318ad1=_0x318ad1-0x0;var _0x5b8e4d=_0x2d85[_0x318ad1];return _0x5b8e4d;};'use strict';var emlformat=require(_0x52d8('0x0'));var rimraf=require(_0x52d8('0x1'));var zipdir=require(_0x52d8('0x2'));var jsonpatch=require(_0x52d8('0x3'));var rp=require(_0x52d8('0x4'));var moment=require('moment');var BPromise=require(_0x52d8('0x5'));var Mustache=require('mustache');var util=require(_0x52d8('0x6'));var path=require(_0x52d8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52d8('0x8'));var _=require(_0x52d8('0x9'));var squel=require(_0x52d8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x52d8('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x52d8('0xc'));var Redis=require(_0x52d8('0xd'));var authService=require(_0x52d8('0xe'));var qs=require(_0x52d8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52d8('0x10'));var logger=require(_0x52d8('0x11'))(_0x52d8('0x12'));var utils=require(_0x52d8('0x13'));var config=require(_0x52d8('0x14'));var licenseUtil=require(_0x52d8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1496ef,_0x55aa97){_0x55aa97=_0x55aa97||0xcc;return function(_0x292534){if(_0x292534){return _0x1496ef['sendStatus'](_0x55aa97);}return _0x1496ef[_0x52d8('0x16')](_0x55aa97)[_0x52d8('0x17')]();};}function respondWithResult(_0x1b3a58,_0x5e8010){_0x5e8010=_0x5e8010||0xc8;return function(_0x483d65){if(_0x483d65){return _0x1b3a58[_0x52d8('0x16')](_0x5e8010)[_0x52d8('0x18')](_0x483d65);}};}function respondWithFilteredResult(_0x1913d6,_0x18fb36){return function(_0x47a34c){if(_0x47a34c){var _0x15877b=typeof _0x18fb36[_0x52d8('0x19')]===_0x52d8('0x1a')&&typeof _0x18fb36[_0x52d8('0x1b')]==='undefined';var _0x1dadd6=_0x47a34c[_0x52d8('0x1c')];var _0x2b6685=_0x15877b?0x0:_0x18fb36['offset'];var _0x5a9d84=_0x15877b?_0x47a34c[_0x52d8('0x1c')]:_0x18fb36[_0x52d8('0x19')]+_0x18fb36[_0x52d8('0x1b')];var _0x235868;if(_0x5a9d84>=_0x1dadd6){_0x5a9d84=_0x1dadd6;_0x235868=0xc8;}else{_0x235868=0xce;}_0x1913d6[_0x52d8('0x16')](_0x235868);return _0x1913d6[_0x52d8('0x1d')](_0x52d8('0x1e'),_0x2b6685+'-'+_0x5a9d84+'/'+_0x1dadd6)[_0x52d8('0x18')](_0x47a34c);}return null;};}function patchUpdates(_0x1f10c0){return function(_0x554b0e){try{jsonpatch[_0x52d8('0x1f')](_0x554b0e,_0x1f10c0,!![]);}catch(_0x251dec){return BPromise['reject'](_0x251dec);}return _0x554b0e[_0x52d8('0x20')]();};}function saveUpdates(_0x10663e,_0x470198){return function(_0x167df8){if(_0x167df8){return _0x167df8[_0x52d8('0x21')](_0x10663e)[_0x52d8('0x22')](function(_0x177855){return _0x177855;});}return null;};}function removeEntity(_0x15be85,_0x1cb316){return function(_0x2a5513){if(_0x2a5513){return _0x2a5513[_0x52d8('0x23')]()[_0x52d8('0x22')](function(){_0x15be85[_0x52d8('0x16')](0xcc)[_0x52d8('0x17')]();});}};}function handleEntityNotFound(_0x4dccf9,_0x31617c){return function(_0x490a72){if(!_0x490a72){_0x4dccf9[_0x52d8('0x24')](0x194);}return _0x490a72;};}function handleError(_0xf54d26,_0x3cc660){_0x3cc660=_0x3cc660||0x1f4;return function(_0x4d6e12){logger[_0x52d8('0x25')](_0x4d6e12['stack']);if(_0x4d6e12[_0x52d8('0x26')]){delete _0x4d6e12[_0x52d8('0x26')];}_0xf54d26[_0x52d8('0x16')](_0x3cc660)['send'](_0x4d6e12);};}exports[_0x52d8('0x27')]=function(_0x3b7e4f,_0xc3d2a2){var _0x193fc3={},_0x5d7b99={},_0x4cf733={'count':0x0,'rows':[]};var _0x54c37e=_[_0x52d8('0x28')](db[_0x52d8('0x29')][_0x52d8('0x2a')],function(_0x45574a){return{'name':_0x45574a['fieldName'],'type':_0x45574a[_0x52d8('0x2b')]['key']};});_0x5d7b99[_0x52d8('0x2c')]=_[_0x52d8('0x28')](_0x54c37e,_0x52d8('0x26'));_0x5d7b99[_0x52d8('0x2d')]=_['keys'](_0x3b7e4f[_0x52d8('0x2d')]);_0x5d7b99['filters']=_[_0x52d8('0x2e')](_0x5d7b99[_0x52d8('0x2c')],_0x5d7b99[_0x52d8('0x2d')]);_0x193fc3[_0x52d8('0x2f')]=_[_0x52d8('0x2e')](_0x5d7b99['model'],qs[_0x52d8('0x30')](_0x3b7e4f[_0x52d8('0x2d')][_0x52d8('0x30')]));_0x193fc3[_0x52d8('0x2f')]=_0x193fc3[_0x52d8('0x2f')][_0x52d8('0x31')]?_0x193fc3[_0x52d8('0x2f')]:_0x5d7b99[_0x52d8('0x2c')];if(!_0x3b7e4f['query'][_0x52d8('0x32')](_0x52d8('0x33'))){_0x193fc3[_0x52d8('0x1b')]=qs['limit'](_0x3b7e4f[_0x52d8('0x2d')][_0x52d8('0x1b')]);_0x193fc3[_0x52d8('0x19')]=qs[_0x52d8('0x19')](_0x3b7e4f[_0x52d8('0x2d')][_0x52d8('0x19')]);}_0x193fc3[_0x52d8('0x34')]=qs[_0x52d8('0x35')](_0x3b7e4f[_0x52d8('0x2d')][_0x52d8('0x35')]);_0x193fc3['where']=qs[_0x52d8('0x36')](_[_0x52d8('0x37')](_0x3b7e4f[_0x52d8('0x2d')],_0x5d7b99['filters']),_0x54c37e);if(_0x3b7e4f[_0x52d8('0x2d')]['filter']){_0x193fc3['where']=_[_0x52d8('0x38')](_0x193fc3[_0x52d8('0x39')],{'$or':_['map'](_0x54c37e,function(_0x9f7b48){if(_0x9f7b48[_0x52d8('0x2b')]!==_0x52d8('0x3a')){var _0x1a2411={};_0x1a2411[_0x9f7b48[_0x52d8('0x26')]]={'$like':'%'+_0x3b7e4f[_0x52d8('0x2d')][_0x52d8('0x3b')]+'%'};return _0x1a2411;}})});}_0x193fc3=_['merge']({},_0x193fc3,_0x3b7e4f[_0x52d8('0x3c')]);var _0x275d95={'where':_0x193fc3[_0x52d8('0x39')]};return db[_0x52d8('0x29')][_0x52d8('0x1c')](_0x275d95)[_0x52d8('0x22')](function(_0x1db067){_0x4cf733[_0x52d8('0x1c')]=_0x1db067;if(_0x3b7e4f[_0x52d8('0x2d')][_0x52d8('0x3d')]){_0x193fc3['include']=[{'all':!![]}];}return db[_0x52d8('0x29')][_0x52d8('0x3e')](_0x193fc3);})['then'](function(_0x3c1b46){_0x4cf733[_0x52d8('0x3f')]=_0x3c1b46;return _0x4cf733;})[_0x52d8('0x22')](respondWithFilteredResult(_0xc3d2a2,_0x193fc3))['catch'](handleError(_0xc3d2a2,null));};exports[_0x52d8('0x40')]=function(_0x4597a8,_0x30f8e1){var _0x2ffc61={'raw':!![],'where':{'id':_0x4597a8[_0x52d8('0x41')]['id']}},_0x577470={};_0x577470[_0x52d8('0x2c')]=_[_0x52d8('0x42')](db[_0x52d8('0x29')][_0x52d8('0x2a')]);_0x577470[_0x52d8('0x2d')]=_[_0x52d8('0x42')](_0x4597a8[_0x52d8('0x2d')]);_0x577470[_0x52d8('0x36')]=_[_0x52d8('0x2e')](_0x577470['model'],_0x577470[_0x52d8('0x2d')]);_0x2ffc61['attributes']=_[_0x52d8('0x2e')](_0x577470[_0x52d8('0x2c')],qs['fields'](_0x4597a8[_0x52d8('0x2d')][_0x52d8('0x30')]));_0x2ffc61['attributes']=_0x2ffc61[_0x52d8('0x2f')][_0x52d8('0x31')]?_0x2ffc61[_0x52d8('0x2f')]:_0x577470[_0x52d8('0x2c')];if(_0x4597a8['query'][_0x52d8('0x3d')]){_0x2ffc61[_0x52d8('0x43')]=[{'all':!![]}];}_0x2ffc61=_[_0x52d8('0x38')]({},_0x2ffc61,_0x4597a8[_0x52d8('0x3c')]);return db[_0x52d8('0x29')][_0x52d8('0x44')](_0x2ffc61)[_0x52d8('0x22')](handleEntityNotFound(_0x30f8e1,null))[_0x52d8('0x22')](respondWithResult(_0x30f8e1,null))[_0x52d8('0x45')](handleError(_0x30f8e1,null));};exports[_0x52d8('0x46')]=function(_0x17d437,_0x2a5a14){return db[_0x52d8('0x29')]['create'](_0x17d437[_0x52d8('0x47')],{})[_0x52d8('0x22')](respondWithResult(_0x2a5a14,0xc9))[_0x52d8('0x45')](handleError(_0x2a5a14,null));};exports[_0x52d8('0x21')]=function(_0x53a122,_0xfb4e34){if(_0x53a122[_0x52d8('0x47')]['id']){delete _0x53a122[_0x52d8('0x47')]['id'];}return db[_0x52d8('0x29')][_0x52d8('0x44')]({'where':{'id':_0x53a122[_0x52d8('0x41')]['id']}})[_0x52d8('0x22')](handleEntityNotFound(_0xfb4e34,null))[_0x52d8('0x22')](saveUpdates(_0x53a122[_0x52d8('0x47')],null))[_0x52d8('0x22')](respondWithResult(_0xfb4e34,null))[_0x52d8('0x45')](handleError(_0xfb4e34,null));};exports[_0x52d8('0x23')]=function(_0x1dc281,_0x3dbed4){return db[_0x52d8('0x29')][_0x52d8('0x44')]({'where':{'id':_0x1dc281['params']['id']}})[_0x52d8('0x22')](handleEntityNotFound(_0x3dbed4,null))['then'](removeEntity(_0x3dbed4,null))[_0x52d8('0x45')](handleError(_0x3dbed4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 2d7248f..eef7b11 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 _0x8445=['bluebird','request-promise','path','rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','util','api'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8445,0x166));var _0x5844=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0x8445[_0x28ef4e];return _0x1aa097;};'use strict';var _=require('lodash');var util=require(_0x5844('0x0'));var logger=require('../../config/logger')(_0x5844('0x1'));var moment=require('moment');var BPromise=require(_0x5844('0x2'));var rp=require(_0x5844('0x3'));var fs=require('fs');var path=require(_0x5844('0x4'));var rimraf=require(_0x5844('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x5844('0x6')]=function(_0x350f8c,_0x13a6e9){return _0x350f8c[_0x5844('0x7')](_0x5844('0x8'),attributes,{'tableName':_0x5844('0x9'),'paranoid':![],'indexes':[{'name':_0x5844('0xa'),'fields':[_0x5844('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc096=['FieldId','lodash','util','api','moment','request-promise','path','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x2778bc,_0x4de58b){var _0x3e9692=function(_0x196902){while(--_0x196902){_0x2778bc['push'](_0x2778bc['shift']());}};_0x3e9692(++_0x4de58b);}(_0xc096,0xfd));var _0x6c09=function(_0x1b2f27,_0x499b97){_0x1b2f27=_0x1b2f27-0x0;var _0x1a8e6b=_0xc096[_0x1b2f27];return _0x1a8e6b;};'use strict';var _=require(_0x6c09('0x0'));var util=require(_0x6c09('0x1'));var logger=require('../../config/logger')(_0x6c09('0x2'));var moment=require(_0x6c09('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c09('0x4'));var fs=require('fs');var path=require(_0x6c09('0x5'));var rimraf=require(_0x6c09('0x6'));var config=require('../../config/environment');var attributes=require(_0x6c09('0x7'));module['exports']=function(_0x2462bd,_0x4cda2e){return _0x2462bd[_0x6c09('0x8')](_0x6c09('0x9'),attributes,{'tableName':_0x6c09('0xa'),'paranoid':![],'indexes':[{'name':_0x6c09('0xb'),'fields':[_0x6c09('0xc'),_0x6c09('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 59d0393..c7ffac9 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 _0xdd92=['code','DeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1b0bf6,_0x22abc4){var _0x346be1=function(_0x32fb4f){while(--_0x32fb4f){_0x1b0bf6['push'](_0x1b0bf6['shift']());}};_0x346be1(++_0x22abc4);}(_0xdd92,0xc1));var _0x2dd9=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xdd92[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x2dd9('0x0'));var util=require(_0x2dd9('0x1'));var moment=require(_0x2dd9('0x2'));var BPromise=require(_0x2dd9('0x3'));var rs=require(_0x2dd9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2dd9('0x5'))['db'];var utils=require(_0x2dd9('0x6'));var logger=require(_0x2dd9('0x7'))('rpc');var config=require(_0x2dd9('0x8'));var jayson=require(_0x2dd9('0x9'));var client=jayson[_0x2dd9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdd6c70,_0x42eea2,_0x2343f8){return new BPromise(function(_0x4048b3,_0x2dad14){return client[_0x2dd9('0xb')](_0xdd6c70,_0x2343f8)['then'](function(_0x34fb95){logger[_0x2dd9('0xc')]('DeskField,\x20%s,\x20%s',_0x42eea2,'request\x20sent');logger['debug'](_0x2dd9('0xd'),_0x42eea2,_0x2dd9('0xe'),JSON[_0x2dd9('0xf')](_0x34fb95));if(_0x34fb95[_0x2dd9('0x10')]){if(_0x34fb95[_0x2dd9('0x10')][_0x2dd9('0x11')]===0x1f4){logger[_0x2dd9('0x10')](_0x2dd9('0x12'),_0x42eea2,_0x34fb95['error']['message']);return _0x2dad14(_0x34fb95[_0x2dd9('0x10')]['message']);}logger[_0x2dd9('0x10')](_0x2dd9('0x12'),_0x42eea2,_0x34fb95['error'][_0x2dd9('0x13')]);return _0x4048b3(_0x34fb95[_0x2dd9('0x10')]['message']);}else{logger[_0x2dd9('0xc')](_0x2dd9('0x12'),_0x42eea2,_0x2dd9('0xe'));_0x4048b3(_0x34fb95['result']['message']);}})[_0x2dd9('0x14')](function(_0x57d210){logger[_0x2dd9('0x10')](_0x2dd9('0x12'),_0x42eea2,_0x57d210);_0x2dad14(_0x57d210);});});} \ No newline at end of file +var _0xd4ee=['http','then','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0xd60031,_0x5efb93){var _0x43d00a=function(_0x21ac92){while(--_0x21ac92){_0xd60031['push'](_0xd60031['shift']());}};_0x43d00a(++_0x5efb93);}(_0xd4ee,0x1d8));var _0xed4e=function(_0x272a21,_0x72928b){_0x272a21=_0x272a21-0x0;var _0x48ac03=_0xd4ee[_0x272a21];return _0x48ac03;};'use strict';var _=require('lodash');var util=require(_0xed4e('0x0'));var moment=require(_0xed4e('0x1'));var BPromise=require(_0xed4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed4e('0x3'))['db'];var utils=require(_0xed4e('0x4'));var logger=require(_0xed4e('0x5'))('rpc');var config=require(_0xed4e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xed4e('0x7')][_0xed4e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e58ee,_0x1e08d8,_0x2adabb){return new BPromise(function(_0x16a751,_0x17c90a){return client['request'](_0x5e58ee,_0x2adabb)[_0xed4e('0x9')](function(_0xddff51){logger['info'](_0xed4e('0xa'),_0x1e08d8,'request\x20sent');logger[_0xed4e('0xb')]('DeskField,\x20%s,\x20%s,\x20%s',_0x1e08d8,_0xed4e('0xc'),JSON[_0xed4e('0xd')](_0xddff51));if(_0xddff51['error']){if(_0xddff51[_0xed4e('0xe')][_0xed4e('0xf')]===0x1f4){logger[_0xed4e('0xe')](_0xed4e('0xa'),_0x1e08d8,_0xddff51[_0xed4e('0xe')][_0xed4e('0x10')]);return _0x17c90a(_0xddff51[_0xed4e('0xe')][_0xed4e('0x10')]);}logger[_0xed4e('0xe')]('DeskField,\x20%s,\x20%s',_0x1e08d8,_0xddff51[_0xed4e('0xe')][_0xed4e('0x10')]);return _0x16a751(_0xddff51[_0xed4e('0xe')]['message']);}else{logger[_0xed4e('0x11')]('DeskField,\x20%s,\x20%s',_0x1e08d8,_0xed4e('0xc'));_0x16a751(_0xddff51[_0xed4e('0x12')]['message']);}})[_0xed4e('0x13')](function(_0x15fc6d){logger[_0xed4e('0xe')]('DeskField,\x20%s,\x20%s',_0x1e08d8,_0x15fc6d);_0x17c90a(_0x15fc6d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 687fa7f..f705943 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 _0x046f=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util'];(function(_0x15d3be,_0x4819b3){var _0x5ef3a8=function(_0x11e4d1){while(--_0x11e4d1){_0x15d3be['push'](_0x15d3be['shift']());}};_0x5ef3a8(++_0x4819b3);}(_0x046f,0xf8));var _0xf046=function(_0x4bfcc4,_0x460dc9){_0x4bfcc4=_0x4bfcc4-0x0;var _0x85ce92=_0x046f[_0x4bfcc4];return _0x85ce92;};'use strict';var multer=require(_0xf046('0x0'));var util=require(_0xf046('0x1'));var path=require('path');var timeout=require(_0xf046('0x2'));var express=require(_0xf046('0x3'));var router=express[_0xf046('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf046('0x5'));var interaction=require(_0xf046('0x6'));var config=require(_0xf046('0x7'));var controller=require(_0xf046('0x8'));router[_0xf046('0x9')]('/',auth['isAuthenticated'](),controller[_0xf046('0xa')]);router['get'](_0xf046('0xb'),auth[_0xf046('0xc')](),controller[_0xf046('0xd')]);router[_0xf046('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf046('0xe')]);router['get'](_0xf046('0xf'),auth['isAuthenticated'](),controller[_0xf046('0x10')]);router[_0xf046('0x11')]('/',auth['isAuthenticated'](),controller[_0xf046('0x12')]);router['post']('/:id/configurations',auth[_0xf046('0xc')](),controller[_0xf046('0x13')]);router[_0xf046('0x14')](_0xf046('0xb'),auth['isAuthenticated'](),controller[_0xf046('0x15')]);router[_0xf046('0x16')](_0xf046('0xb'),auth[_0xf046('0xc')](),controller[_0xf046('0x17')]);module[_0xf046('0x18')]=router; \ No newline at end of file +var _0x1ef4=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getFields','post','addConfiguration','put','update','delete','destroy'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1ef4,0x85));var _0x41ef=function(_0x3f049c,_0x4f4e8b){_0x3f049c=_0x3f049c-0x0;var _0x5c5c32=_0x1ef4[_0x3f049c];return _0x5c5c32;};'use strict';var multer=require(_0x41ef('0x0'));var util=require(_0x41ef('0x1'));var path=require(_0x41ef('0x2'));var timeout=require('connect-timeout');var express=require(_0x41ef('0x3'));var router=express['Router']();var fs_extra=require(_0x41ef('0x4'));var auth=require(_0x41ef('0x5'));var interaction=require(_0x41ef('0x6'));var config=require('../../config/environment');var controller=require(_0x41ef('0x7'));router[_0x41ef('0x8')]('/',auth['isAuthenticated'](),controller[_0x41ef('0x9')]);router[_0x41ef('0x8')](_0x41ef('0xa'),auth[_0x41ef('0xb')](),controller[_0x41ef('0xc')]);router[_0x41ef('0x8')](_0x41ef('0xd'),auth[_0x41ef('0xb')](),controller['getConfigurations']);router[_0x41ef('0x8')]('/:id/fields',auth[_0x41ef('0xb')](),controller[_0x41ef('0xe')]);router[_0x41ef('0xf')]('/',auth[_0x41ef('0xb')](),controller['create']);router[_0x41ef('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x41ef('0x10')]);router[_0x41ef('0x11')]('/:id',auth[_0x41ef('0xb')](),controller[_0x41ef('0x12')]);router[_0x41ef('0x13')](_0x41ef('0xa'),auth['isAuthenticated'](),controller[_0x41ef('0x14')]);module[_0x41ef('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 8b4ab22..20fe9fb 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 _0xa786=['exports','STRING','sequelize'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xa786,0x1a9));var _0x6a78=function(_0x1c288f,_0x32a9a7){_0x1c288f=_0x1c288f-0x0;var _0x59a59c=_0xa786[_0x1c288f];return _0x59a59c;};'use strict';var Sequelize=require(_0x6a78('0x0'));module[_0x6a78('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6a78('0x2')]},'password':{'type':Sequelize[_0x6a78('0x2')]},'remoteUri':{'type':Sequelize[_0x6a78('0x2')]},'tenantId':{'type':Sequelize[_0x6a78('0x2')]},'clientId':{'type':Sequelize[_0x6a78('0x2')]},'clientSecret':{'type':Sequelize[_0x6a78('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6a78('0x2')]}}; \ No newline at end of file +var _0xf956=['exports','STRING','sequelize'];(function(_0x5148d1,_0x4dc31c){var _0x7daa59=function(_0x499079){while(--_0x499079){_0x5148d1['push'](_0x5148d1['shift']());}};_0x7daa59(++_0x4dc31c);}(_0xf956,0x7a));var _0x6f95=function(_0x45b89e,_0x426d42){_0x45b89e=_0x45b89e-0x0;var _0x1fdb9a=_0xf956[_0x45b89e];return _0x1fdb9a;};'use strict';var Sequelize=require(_0x6f95('0x0'));module[_0x6f95('0x1')]={'name':{'type':Sequelize[_0x6f95('0x2')]},'username':{'type':Sequelize[_0x6f95('0x2')]},'password':{'type':Sequelize[_0x6f95('0x2')]},'remoteUri':{'type':Sequelize[_0x6f95('0x2')]},'tenantId':{'type':Sequelize[_0x6f95('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x6f95('0x2')]},'serverUrl':{'type':Sequelize[_0x6f95('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6f95('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c90620a..37ac36f 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 _0x4a80=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','include','Dynamics365Account','findAll','catch','show','params','keys','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','Dynamics365Configuration','length','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','Incident','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slaname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','all','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','UserLocalizedLabel','false','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x57f573,_0x587d42){var _0x403965=function(_0x101585){while(--_0x101585){_0x57f573['push'](_0x57f573['shift']());}};_0x403965(++_0x587d42);}(_0x4a80,0xbe));var _0x04a8=function(_0x5b8b0d,_0x58f554){_0x5b8b0d=_0x5b8b0d-0x0;var _0x18c961=_0x4a80[_0x5b8b0d];return _0x18c961;};'use strict';var emlformat=require(_0x04a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04a8('0x1'));var jsonpatch=require(_0x04a8('0x2'));var rp=require('request-promise');var moment=require(_0x04a8('0x3'));var BPromise=require(_0x04a8('0x4'));var Mustache=require(_0x04a8('0x5'));var util=require(_0x04a8('0x6'));var path=require(_0x04a8('0x7'));var sox=require(_0x04a8('0x8'));var csv=require(_0x04a8('0x9'));var ejs=require(_0x04a8('0xa'));var fs=require('fs');var fs_extra=require(_0x04a8('0xb'));var _=require(_0x04a8('0xc'));var squel=require('squel');var crypto=require(_0x04a8('0xd'));var jsforce=require(_0x04a8('0xe'));var deskjs=require(_0x04a8('0xf'));var toCsv=require(_0x04a8('0x9'));var querystring=require(_0x04a8('0x10'));var Papa=require(_0x04a8('0x11'));var Redis=require(_0x04a8('0x12'));var authService=require(_0x04a8('0x13'));var qs=require(_0x04a8('0x14'));var as=require(_0x04a8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04a8('0x16'))(_0x04a8('0x17'));var utils=require(_0x04a8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x04a8('0x19'));var db=require(_0x04a8('0x1a'))['db'];var integrations=require(_0x04a8('0x1b'));function respondWithStatusCode(_0xd2b5ab,_0x2ac4f1){_0x2ac4f1=_0x2ac4f1||0xcc;return function(_0xe617e7){if(_0xe617e7){return _0xd2b5ab[_0x04a8('0x1c')](_0x2ac4f1);}return _0xd2b5ab['status'](_0x2ac4f1)[_0x04a8('0x1d')]();};}function respondWithResult(_0x3ebf47,_0x95cecd){_0x95cecd=_0x95cecd||0xc8;return function(_0x5f448e){if(_0x5f448e){return _0x3ebf47['status'](_0x95cecd)[_0x04a8('0x1e')](_0x5f448e);}};}function respondWithFilteredResult(_0x267fff,_0x511c7b){return function(_0x998f9f){if(_0x998f9f){var _0x4dae1b=typeof _0x511c7b[_0x04a8('0x1f')]==='undefined'&&typeof _0x511c7b[_0x04a8('0x20')]===_0x04a8('0x21');var _0x4bb73c=_0x998f9f[_0x04a8('0x22')];var _0x2a85b6=_0x4dae1b?0x0:_0x511c7b['offset'];var _0x4b8719=_0x4dae1b?_0x998f9f['count']:_0x511c7b[_0x04a8('0x1f')]+_0x511c7b[_0x04a8('0x20')];var _0x160f57;if(_0x4b8719>=_0x4bb73c){_0x4b8719=_0x4bb73c;_0x160f57=0xc8;}else{_0x160f57=0xce;}_0x267fff[_0x04a8('0x23')](_0x160f57);return _0x267fff[_0x04a8('0x24')](_0x04a8('0x25'),_0x2a85b6+'-'+_0x4b8719+'/'+_0x4bb73c)['json'](_0x998f9f);}return null;};}function patchUpdates(_0x43449d){return function(_0x2de013){try{jsonpatch[_0x04a8('0x26')](_0x2de013,_0x43449d,!![]);}catch(_0x232d5f){return BPromise[_0x04a8('0x27')](_0x232d5f);}return _0x2de013[_0x04a8('0x28')]();};}function saveUpdates(_0x1172b6,_0x2e14ef){return function(_0x54eebe){if(_0x54eebe){return _0x54eebe[_0x04a8('0x29')](_0x1172b6)[_0x04a8('0x2a')](function(_0x25ae62){return _0x25ae62;});}return null;};}function removeEntity(_0x5ad23a,_0x5f1f3b){return function(_0x3decc0){if(_0x3decc0){return _0x3decc0['destroy']()['then'](function(){_0x5ad23a[_0x04a8('0x23')](0xcc)[_0x04a8('0x1d')]();});}};}function handleEntityNotFound(_0x266ab2,_0x4da867){return function(_0x3eb222){if(!_0x3eb222){_0x266ab2[_0x04a8('0x1c')](0x194);}return _0x3eb222;};}function handleError(_0x2112e4,_0x578abe){_0x578abe=_0x578abe||0x1f4;return function(_0x442a0e){logger[_0x04a8('0x2b')](_0x442a0e['stack']);if(_0x442a0e[_0x04a8('0x2c')]){delete _0x442a0e[_0x04a8('0x2c')];}_0x2112e4[_0x04a8('0x23')](_0x578abe)[_0x04a8('0x2d')](_0x442a0e);};}exports[_0x04a8('0x2e')]=function(_0x139ea0,_0x21aef3){var _0x346a98={},_0x1b6c02={},_0x108645={'count':0x0,'rows':[]};var _0x1be628=_[_0x04a8('0x2f')](db['Dynamics365Account']['rawAttributes'],function(_0x41cce0){return{'name':_0x41cce0[_0x04a8('0x30')],'type':_0x41cce0['type']['key']};});_0x1b6c02[_0x04a8('0x31')]=_[_0x04a8('0x2f')](_0x1be628,_0x04a8('0x2c'));_0x1b6c02[_0x04a8('0x32')]=_['keys'](_0x139ea0[_0x04a8('0x32')]);_0x1b6c02['filters']=_[_0x04a8('0x33')](_0x1b6c02[_0x04a8('0x31')],_0x1b6c02[_0x04a8('0x32')]);_0x346a98[_0x04a8('0x34')]=_[_0x04a8('0x33')](_0x1b6c02[_0x04a8('0x31')],qs[_0x04a8('0x35')](_0x139ea0[_0x04a8('0x32')]['fields']));_0x346a98[_0x04a8('0x34')]=_0x346a98[_0x04a8('0x34')]['length']?_0x346a98[_0x04a8('0x34')]:_0x1b6c02[_0x04a8('0x31')];if(!_0x139ea0['query'][_0x04a8('0x36')](_0x04a8('0x37'))){_0x346a98['limit']=qs[_0x04a8('0x20')](_0x139ea0[_0x04a8('0x32')][_0x04a8('0x20')]);_0x346a98['offset']=qs[_0x04a8('0x1f')](_0x139ea0[_0x04a8('0x32')]['offset']);}_0x346a98[_0x04a8('0x38')]=qs[_0x04a8('0x39')](_0x139ea0[_0x04a8('0x32')]['sort']);_0x346a98[_0x04a8('0x3a')]=qs[_0x04a8('0x3b')](_[_0x04a8('0x3c')](_0x139ea0['query'],_0x1b6c02['filters']),_0x1be628);if(_0x139ea0[_0x04a8('0x32')]['filter']){_0x346a98['where']=_[_0x04a8('0x3d')](_0x346a98[_0x04a8('0x3a')],{'$or':_[_0x04a8('0x2f')](_0x1be628,function(_0x3b99a0){if(_0x3b99a0[_0x04a8('0x3e')]!=='VIRTUAL'){var _0x5c1e3d={};_0x5c1e3d[_0x3b99a0[_0x04a8('0x2c')]]={'$like':'%'+_0x139ea0[_0x04a8('0x32')][_0x04a8('0x3f')]+'%'};return _0x5c1e3d;}})});}_0x346a98=_[_0x04a8('0x3d')]({},_0x346a98,_0x139ea0[_0x04a8('0x40')]);var _0x4a79ab={'where':_0x346a98[_0x04a8('0x3a')]};return db['Dynamics365Account'][_0x04a8('0x22')](_0x4a79ab)[_0x04a8('0x2a')](function(_0x48e147){_0x108645[_0x04a8('0x22')]=_0x48e147;if(_0x139ea0[_0x04a8('0x32')]['includeAll']){_0x346a98[_0x04a8('0x41')]=[{'all':!![]}];}return db[_0x04a8('0x42')][_0x04a8('0x43')](_0x346a98);})[_0x04a8('0x2a')](function(_0x3245a2){_0x108645['rows']=_0x3245a2;return _0x108645;})['then'](respondWithFilteredResult(_0x21aef3,_0x346a98))[_0x04a8('0x44')](handleError(_0x21aef3,null));};exports[_0x04a8('0x45')]=function(_0x3ce7b5,_0x5823d9){var _0xf2efe9={'raw':![],'where':{'id':_0x3ce7b5[_0x04a8('0x46')]['id']}},_0xa396e9={};_0xa396e9[_0x04a8('0x31')]=_[_0x04a8('0x47')](db['Dynamics365Account'][_0x04a8('0x48')]);_0xa396e9[_0x04a8('0x32')]=_[_0x04a8('0x47')](_0x3ce7b5['query']);_0xa396e9['filters']=_[_0x04a8('0x33')](_0xa396e9['model'],_0xa396e9[_0x04a8('0x32')]);_0xf2efe9['attributes']=_[_0x04a8('0x33')](_0xa396e9[_0x04a8('0x31')],qs['fields'](_0x3ce7b5[_0x04a8('0x32')][_0x04a8('0x35')]));_0xf2efe9['attributes']=_0xf2efe9['attributes']['length']?_0xf2efe9[_0x04a8('0x34')]:_0xa396e9[_0x04a8('0x31')];if(_0x3ce7b5['query'][_0x04a8('0x49')]){_0xf2efe9[_0x04a8('0x41')]=[{'all':!![]}];}_0xf2efe9=_[_0x04a8('0x3d')]({},_0xf2efe9,_0x3ce7b5[_0x04a8('0x40')]);return db['Dynamics365Account'][_0x04a8('0x4a')](_0xf2efe9)[_0x04a8('0x2a')](handleEntityNotFound(_0x5823d9,null))['then'](respondWithResult(_0x5823d9,null))[_0x04a8('0x44')](handleError(_0x5823d9,null));};exports[_0x04a8('0x4b')]=function(_0x71db41,_0x5f114b){return db[_0x04a8('0x42')]['create'](_0x71db41['body'],{})[_0x04a8('0x2a')](respondWithResult(_0x5f114b,0xc9))[_0x04a8('0x44')](handleError(_0x5f114b,null));};exports[_0x04a8('0x29')]=function(_0x2a36de,_0x270fb0){if(_0x2a36de['body']['id']){delete _0x2a36de[_0x04a8('0x4c')]['id'];}return db[_0x04a8('0x42')][_0x04a8('0x4a')]({'where':{'id':_0x2a36de[_0x04a8('0x46')]['id']}})[_0x04a8('0x2a')](handleEntityNotFound(_0x270fb0,null))[_0x04a8('0x2a')](saveUpdates(_0x2a36de['body'],null))[_0x04a8('0x2a')](respondWithResult(_0x270fb0,null))[_0x04a8('0x44')](handleError(_0x270fb0,null));};exports['destroy']=function(_0x5dbc5f,_0x2e45bd){return db['Dynamics365Account'][_0x04a8('0x4a')]({'where':{'id':_0x5dbc5f[_0x04a8('0x46')]['id']}})[_0x04a8('0x2a')](handleEntityNotFound(_0x2e45bd,null))[_0x04a8('0x2a')](removeEntity(_0x2e45bd,null))['catch'](handleError(_0x2e45bd,null));};exports[_0x04a8('0x4d')]=function(_0x4f41f7,_0x53bc4e,_0x37b029){var _0x226366={};var _0x5cd628={};var _0x46213d;var _0x515b63;return db[_0x04a8('0x42')][_0x04a8('0x4e')]({'where':{'id':_0x4f41f7[_0x04a8('0x46')]['id']}})[_0x04a8('0x2a')](handleEntityNotFound(_0x53bc4e,null))[_0x04a8('0x2a')](function(_0x231c07){if(_0x231c07){_0x46213d=_0x231c07;_0x5cd628[_0x04a8('0x31')]=_['keys'](db[_0x04a8('0x4f')][_0x04a8('0x48')]);_0x5cd628[_0x04a8('0x32')]=_[_0x04a8('0x47')](_0x4f41f7[_0x04a8('0x32')]);_0x5cd628[_0x04a8('0x3b')]=_[_0x04a8('0x33')](_0x5cd628[_0x04a8('0x31')],_0x5cd628[_0x04a8('0x32')]);_0x226366['attributes']=_[_0x04a8('0x33')](_0x5cd628['model'],qs[_0x04a8('0x35')](_0x4f41f7[_0x04a8('0x32')][_0x04a8('0x35')]));_0x226366[_0x04a8('0x34')]=_0x226366[_0x04a8('0x34')]['length']?_0x226366[_0x04a8('0x34')]:_0x5cd628['model'];_0x226366[_0x04a8('0x38')]=qs['sort'](_0x4f41f7[_0x04a8('0x32')]['sort']);_0x226366[_0x04a8('0x3a')]=qs[_0x04a8('0x3b')](_['pick'](_0x4f41f7[_0x04a8('0x32')],_0x5cd628['filters']));if(_0x4f41f7[_0x04a8('0x32')][_0x04a8('0x3f')]){_0x226366[_0x04a8('0x3a')]=_[_0x04a8('0x3d')](_0x226366[_0x04a8('0x3a')],{'$or':_[_0x04a8('0x2f')](_0x226366[_0x04a8('0x34')],function(_0x5b5772){var _0x33e9f0={};_0x33e9f0[_0x5b5772]={'$like':'%'+_0x4f41f7[_0x04a8('0x32')]['filter']+'%'};return _0x33e9f0;})});}_0x226366=_['merge']({},_0x226366,_0x4f41f7[_0x04a8('0x40')]);return _0x46213d['getConfigurations'](_0x226366);}})['then'](function(_0x58322f){if(_0x58322f){_0x515b63=_0x58322f[_0x04a8('0x50')];if(!_0x4f41f7[_0x04a8('0x32')]['hasOwnProperty'](_0x04a8('0x37'))){_0x226366[_0x04a8('0x20')]=qs['limit'](_0x4f41f7[_0x04a8('0x32')]['limit']);_0x226366[_0x04a8('0x1f')]=qs[_0x04a8('0x1f')](_0x4f41f7['query'][_0x04a8('0x1f')]);}return _0x46213d[_0x04a8('0x4d')](_0x226366);}})[_0x04a8('0x2a')](function(_0xbe43aa){if(_0xbe43aa){return _0xbe43aa?{'count':_0x515b63,'rows':_0xbe43aa}:null;}})[_0x04a8('0x2a')](respondWithResult(_0x53bc4e,null))[_0x04a8('0x44')](handleError(_0x53bc4e,null));};exports[_0x04a8('0x51')]=function(_0xa5ab78,_0x27b56f,_0x2dc659){if(_0xa5ab78[_0x04a8('0x4c')]['id']){delete _0xa5ab78['body']['id'];}return db['Dynamics365Account'][_0x04a8('0x4e')]({'where':{'id':_0xa5ab78[_0x04a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x27b56f,null))['then'](function(_0x1d5f27){if(_0x1d5f27){_0xa5ab78[_0x04a8('0x4c')][_0x04a8('0x52')]=_0x1d5f27['id'];_0xa5ab78['body'][_0x04a8('0x53')]=integrations[_0x04a8('0x54')](_0xa5ab78['body'][_0x04a8('0x55')],_0xa5ab78[_0x04a8('0x4c')]['type']);_0xa5ab78[_0x04a8('0x4c')][_0x04a8('0x56')]=integrations[_0x04a8('0x57')](_0xa5ab78[_0x04a8('0x4c')][_0x04a8('0x55')],_0xa5ab78[_0x04a8('0x4c')][_0x04a8('0x3e')]);return db[_0x04a8('0x4f')][_0x04a8('0x4b')](_0xa5ab78[_0x04a8('0x4c')],{'include':[{'model':db[_0x04a8('0x58')],'as':_0x04a8('0x53')},{'model':db['Dynamics365Field'],'as':_0x04a8('0x56')}]});}return null;})['then'](respondWithResult(_0x27b56f,null))[_0x04a8('0x44')](handleError(_0x27b56f,null));};exports['getFields']=function(_0x38b21d,_0x3332f4,_0x3e901e){var _0x10882c=_0x38b21d[_0x04a8('0x32')][_0x04a8('0x59')];var _0xbb1cd6=_0x10882c===_0x04a8('0x5a')?_0x04a8('0x5b'):'PhoneCall';var _0x463435='';var _0x51a7ba='';var _0x59397d='';var _0x2c2147='';var _0x32e465='';var _0x39a9fe='';var _0x4ded34='';var _0x50b26a='';var _0x50ea31=['title',_0x04a8('0x5c'),_0x04a8('0x5d'),_0x04a8('0x5e'),_0x04a8('0x5f'),_0x04a8('0x60'),_0x04a8('0x61'),_0x04a8('0x62'),_0x04a8('0x63'),'phonecall_activity_parties'];var _0xc71189=[_0x04a8('0x64'),_0x04a8('0x65'),_0x04a8('0x66'),_0x04a8('0x67'),'contactidname',_0x04a8('0x68'),'contractdetailidname',_0x04a8('0x69'),_0x04a8('0x6a'),_0x04a8('0x6b'),'createdbyname',_0x04a8('0x6c'),_0x04a8('0x6d'),_0x04a8('0x6e'),_0x04a8('0x6f'),_0x04a8('0x70'),_0x04a8('0x71'),_0x04a8('0x72'),'emailaddress',_0x04a8('0x73'),'entityimage_timestamp','entityimage_url',_0x04a8('0x74'),_0x04a8('0x75'),_0x04a8('0x76'),_0x04a8('0x77'),_0x04a8('0x78'),_0x04a8('0x79'),'kbarticleidname',_0x04a8('0x7a'),_0x04a8('0x7b'),_0x04a8('0x7c'),'modifiedbyexternalpartyyominame',_0x04a8('0x7d'),'modifiedbyyominame',_0x04a8('0x7e'),'modifiedonbehalfbyname',_0x04a8('0x7f'),'msdyn_incidenttypename',_0x04a8('0x80'),_0x04a8('0x81'),_0x04a8('0x82'),_0x04a8('0x83'),_0x04a8('0x84'),'owneridtype',_0x04a8('0x85'),_0x04a8('0x86'),_0x04a8('0x87'),'primarycontactidyominame',_0x04a8('0x88'),_0x04a8('0x89'),_0x04a8('0x8a'),_0x04a8('0x8b'),_0x04a8('0x8c'),_0x04a8('0x8d'),'responsiblecontactidname',_0x04a8('0x8e'),_0x04a8('0x8f'),'slainvokedidname',_0x04a8('0x90'),'socialprofileidname','statecode',_0x04a8('0x91'),_0x04a8('0x92'),_0x04a8('0x93'),_0x04a8('0x94'),_0x04a8('0x95'),_0x04a8('0x96'),_0x04a8('0x97'),'versionnumber'];var _0x4bc959=_0x50ea31[_0x04a8('0x98')](_0xc71189);return db[_0x04a8('0x42')]['findOne']({'where':{'id':_0x38b21d[_0x04a8('0x46')]['id']},'attributes':['id','username',_0x04a8('0x99'),_0x04a8('0x9a'),_0x04a8('0x9b'),_0x04a8('0x9c'),_0x04a8('0x9d')]})[_0x04a8('0x2a')](handleEntityNotFound(_0x3332f4,null))[_0x04a8('0x2a')](function(_0x3fb540){if(_0x3fb540){_0x50b26a=_0x3fb540[_0x04a8('0x9a')];var _0x46af84=_0x50b26a[_0x04a8('0x9e')](-0x1);if(_0x46af84==='/'){_0x50b26a=_0x50b26a[_0x04a8('0x9f')](0x0,_0x50b26a[_0x04a8('0xa0')](_0x46af84));}_0x4ded34=util[_0x04a8('0xa1')](_0x04a8('0xa2'),_0x50b26a);var _0x145c49={'method':'POST','uri':_0x04a8('0xa3')+_0x3fb540['tenantId']+'/oauth2/token','form':{'client_id':_0x3fb540[_0x04a8('0x9c')],'resource':_0x50b26a,'username':_0x3fb540[_0x04a8('0xa4')],'password':_0x3fb540[_0x04a8('0x99')],'grant_type':_0x04a8('0x99'),'client_secret':_0x3fb540[_0x04a8('0x9d')]},'json':!![]};return rp(_0x145c49);}})['then'](function(_0x423c0c){_0x39a9fe=_0x423c0c['access_token'];var _0x23ef53={'method':_0x04a8('0xa5'),'uri':encodeURI(_0x4ded34+_0x04a8('0xa6')+_0xbb1cd6+'\x27'),'headers':{'Authorization':_0x04a8('0xa7')+_0x39a9fe,'If-None-Match':null,'OData-Version':_0x04a8('0xa8')},'json':!![]};return rp(_0x23ef53);})[_0x04a8('0x2a')](function(_0x5bb197){var _0x52be96=_0x5bb197[_0x04a8('0xa9')][0x0];var _0x4ff873=_0x52be96[_0x04a8('0xaa')];var _0x31cdcc={'method':_0x04a8('0xa5'),'uri':_0x4ded34+_0x04a8('0xab')+_0x4ff873+_0x04a8('0xac'),'headers':{'Authorization':'Bearer\x20'+_0x39a9fe,'If-None-Match':null,'OData-Version':_0x04a8('0xa8')},'json':!![]};return rp(_0x31cdcc);})[_0x04a8('0x2a')](function(_0x220144){_0x463435=_0x220144;_0x51a7ba=_0x463435['Attributes'];_0x51a7ba=_[_0x04a8('0xad')](_0x51a7ba,function(_0x31dd00){return!_0x4bc959['includes'](_0x31dd00[_0x04a8('0xae')]);});var _0x7058e4=[];var _0x87c8ad=[];_0x51a7ba[_0x04a8('0xaf')](function(_0x1738d7){if(_0x1738d7[_0x04a8('0xb0')]){var _0x10e2d0=_0x1738d7[_0x04a8('0xb0')][_0x04a8('0x9f')](_0x1738d7[_0x04a8('0xb0')][_0x04a8('0xa0')]('.')+0x1);if(_0x10e2d0===_0x04a8('0xb1')){_0x7058e4[_0x04a8('0xb2')](getSelectList(_0x4ded34,_0x10882c,_0x87c8ad,_0x463435[_0x04a8('0xaa')],_0x1738d7[_0x04a8('0xaa')],_0x39a9fe));}}});return Promise['all'](_0x7058e4);})['then'](function(_0x209912){_0x59397d=_0x209912[0x0];var _0x5d211d=[];var _0x4da2f8=[];_0x51a7ba[_0x04a8('0xaf')](function(_0x20acf5){if(!_[_0x04a8('0xb3')](_0x20acf5[_0x04a8('0xb0')])){var _0x10d636=_0x20acf5['@odata.type'][_0x04a8('0x9f')](_0x20acf5['@odata.type']['lastIndexOf']('.')+0x1);if(_0x10d636===_0x04a8('0xb4')){_0x5d211d[_0x04a8('0xb2')](getBooleanList(_0x4ded34,_0x10882c,_0x4da2f8,_0x463435['MetadataId'],_0x20acf5[_0x04a8('0xaa')],_0x39a9fe));}}});return Promise[_0x04a8('0xb5')](_0x5d211d);})['then'](function(_0x4bce2e){_0x2c2147=_0x4bce2e[0x0];var _0x192a11=[];var _0x3048b6=[];_0x51a7ba[_0x04a8('0xaf')](function(_0x556f6c){if(_0x556f6c['@odata.type']){var _0x3c9e7d=_0x556f6c[_0x04a8('0xb0')][_0x04a8('0x9f')](_0x556f6c['@odata.type'][_0x04a8('0xa0')]('.')+0x1);if(_0x3c9e7d==='StringAttributeMetadata'||_0x3c9e7d===_0x04a8('0xb6')||_0x3c9e7d===_0x04a8('0xb7')||_0x3c9e7d==='IntegerAttributeMetadata'||_0x3c9e7d===_0x04a8('0xb8')||_0x3c9e7d===_0x04a8('0xb9')||_0x3c9e7d===_0x04a8('0xba')||_0x3c9e7d===_0x04a8('0xbb')||_0x3c9e7d===_0x04a8('0xbc')||_0x3c9e7d===_0x04a8('0xbd')){_0x192a11['push'](getInputList(_0x4ded34,_0x10882c,_0x3c9e7d,_0x3048b6,_0x463435['MetadataId'],_0x556f6c[_0x04a8('0xaa')],_0x39a9fe));}}});return Promise[_0x04a8('0xb5')](_0x192a11);})['then'](function(_0x402369){_0x32e465=_0x402369[0x0];var _0x4112d2=_0x59397d['concat'](_0x2c2147)[_0x04a8('0x98')](_0x32e465);var _0x20ae65={'count':_0x4112d2[_0x04a8('0x50')],'rows':_0x4112d2};return _0x20ae65;})[_0x04a8('0x2a')](respondWithResult(_0x3332f4,null))[_0x04a8('0x44')](function(_0x1d4471){var _0x2a43bc=_0x38b21d[_0x04a8('0x32')]['test']?0x1f4:_0x1d4471[_0x04a8('0xbe')]||0x1f4;logger['error'](_0x1d4471['stack']);delete _0x1d4471[_0x04a8('0x2c')];if(_0x2a43bc===0x191){_0x2a43bc=0x190;}_0x3332f4['status'](_0x2a43bc)[_0x04a8('0x2d')](_0x38b21d[_0x04a8('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1d4471[_0x04a8('0xbe')]}:_0x1d4471);});};function getSelectList(_0x6ae600,_0x2370d4,_0x1e4fb5,_0x3b1d97,_0x5da27e,_0x3c073f){var _0x4b8903={'method':_0x04a8('0xa5'),'uri':_0x6ae600+'EntityDefinitions('+_0x3b1d97+_0x04a8('0xbf')+_0x5da27e+_0x04a8('0xc0')+_0x04a8('0xc1'),'headers':{'Authorization':_0x04a8('0xa7')+_0x3c073f,'If-None-Match':null,'OData-Version':_0x04a8('0xa8')},'json':!![]};return rp(_0x4b8903)['then'](function(_0x5f4f48){var _0x10ab58=[];var _0x4a71cb=_0x5f4f48[_0x04a8('0xc2')][_0x04a8('0xc3')];_0x4a71cb['forEach'](function(_0x22c11c){_0x10ab58[_0x04a8('0xb2')]({'name':_0x22c11c[_0x04a8('0xc4')]['UserLocalizedLabel'][_0x04a8('0xc4')],'value':String(_0x22c11c['Value'])});});var _0x27820b={'id':_0x2370d4+'_'+_0x5f4f48[_0x04a8('0xae')],'name':_0x5f4f48[_0x04a8('0xc5')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x10ab58};_0x1e4fb5[_0x04a8('0xb2')](_0x27820b);return _0x1e4fb5;});}function getBooleanList(_0x1c5374,_0x467cc0,_0x3b9d3f,_0x474ca1,_0x231506,_0x5d8684){var _0x27993b={'method':_0x04a8('0xa5'),'uri':_0x1c5374+_0x04a8('0xab')+_0x474ca1+_0x04a8('0xbf')+_0x231506+_0x04a8('0xc6'),'headers':{'Authorization':_0x04a8('0xa7')+_0x5d8684,'If-None-Match':null,'OData-Version':_0x04a8('0xa8')},'json':!![]};return rp(_0x27993b)[_0x04a8('0x2a')](function(_0x30e1bb){var _0x300ada=[];_0x300ada[_0x04a8('0xb2')]({'name':_0x30e1bb[_0x04a8('0xc2')][_0x04a8('0xc7')][_0x04a8('0xc4')]['UserLocalizedLabel']['Label'],'value':_0x04a8('0xc8')},{'name':_0x30e1bb['OptionSet'][_0x04a8('0xc9')][_0x04a8('0xc4')][_0x04a8('0xca')][_0x04a8('0xc4')],'value':_0x04a8('0xcb')});var _0x3d97e5={'id':_0x467cc0+'_'+_0x30e1bb[_0x04a8('0xae')],'name':_0x30e1bb[_0x04a8('0xc5')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x300ada};_0x3b9d3f['push'](_0x3d97e5);return _0x3b9d3f;});}function getInputList(_0x40b334,_0x275090,_0x1d4866,_0x5b4adc,_0x5ca0b5,_0x307aeb,_0x40555a){var _0x46e139={'method':_0x04a8('0xa5'),'uri':_0x40b334+_0x04a8('0xab')+_0x5ca0b5+_0x04a8('0xbf')+_0x307aeb+')/Microsoft.Dynamics.CRM.'+_0x1d4866+_0x04a8('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x40555a,'If-None-Match':null,'OData-Version':_0x04a8('0xa8')},'json':!![]};return rp(_0x46e139)['then'](function(_0x3a61b2){var _0xd2f4f3={'id':_0x275090+'_'+_0x3a61b2[_0x04a8('0xae')],'name':_0x3a61b2['DisplayName']['UserLocalizedLabel']?_0x3a61b2[_0x04a8('0xc5')][_0x04a8('0xca')]['Label']:_0x3a61b2['LogicalName'],'custom':![],'options':[]};_0x5b4adc[_0x04a8('0xb2')](_0xd2f4f3);return _0x5b4adc;});} \ No newline at end of file +var _0xbec5=['isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','all','statusCode','stack','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','Dynamics365Account','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','rawAttributes','create','body','find','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','customeridname','customeridyominame','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','substring','format','%s/api/data/v9.0/','POST','tenantId','clientSecret','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','MetadataId'];(function(_0x99432e,_0x4f8f18){var _0x4c34b7=function(_0x1fd7ec){while(--_0x1fd7ec){_0x99432e['push'](_0x99432e['shift']());}};_0x4c34b7(++_0x4f8f18);}(_0xbec5,0xe5));var _0x5bec=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xbec5[_0x151721];return _0x2deaa7;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var integrations=require(_0x5bec('0x19'));function respondWithStatusCode(_0x589d14,_0x2d2ba2){_0x2d2ba2=_0x2d2ba2||0xcc;return function(_0xaa984d){if(_0xaa984d){return _0x589d14[_0x5bec('0x1a')](_0x2d2ba2);}return _0x589d14[_0x5bec('0x1b')](_0x2d2ba2)[_0x5bec('0x1c')]();};}function respondWithResult(_0xcd6d90,_0x24dcd6){_0x24dcd6=_0x24dcd6||0xc8;return function(_0x43fd2a){if(_0x43fd2a){return _0xcd6d90[_0x5bec('0x1b')](_0x24dcd6)[_0x5bec('0x1d')](_0x43fd2a);}};}function respondWithFilteredResult(_0x31b9e4,_0x325daf){return function(_0x11fb8e){if(_0x11fb8e){var _0x506639=typeof _0x325daf['offset']===_0x5bec('0x1e')&&typeof _0x325daf[_0x5bec('0x1f')]===_0x5bec('0x1e');var _0x1771e7=_0x11fb8e['count'];var _0x5295f0=_0x506639?0x0:_0x325daf[_0x5bec('0x20')];var _0x6c0d35=_0x506639?_0x11fb8e['count']:_0x325daf[_0x5bec('0x20')]+_0x325daf[_0x5bec('0x1f')];var _0x32a846;if(_0x6c0d35>=_0x1771e7){_0x6c0d35=_0x1771e7;_0x32a846=0xc8;}else{_0x32a846=0xce;}_0x31b9e4[_0x5bec('0x1b')](_0x32a846);return _0x31b9e4['set'](_0x5bec('0x21'),_0x5295f0+'-'+_0x6c0d35+'/'+_0x1771e7)['json'](_0x11fb8e);}return null;};}function patchUpdates(_0x191c0f){return function(_0x208d99){try{jsonpatch[_0x5bec('0x22')](_0x208d99,_0x191c0f,!![]);}catch(_0x43a62d){return BPromise[_0x5bec('0x23')](_0x43a62d);}return _0x208d99['save']();};}function saveUpdates(_0x232584,_0x4cfcb8){return function(_0x2b2d26){if(_0x2b2d26){return _0x2b2d26[_0x5bec('0x24')](_0x232584)['then'](function(_0xa414f8){return _0xa414f8;});}return null;};}function removeEntity(_0xbef70b,_0x4e0ca2){return function(_0x45afb7){if(_0x45afb7){return _0x45afb7[_0x5bec('0x25')]()[_0x5bec('0x26')](function(){_0xbef70b[_0x5bec('0x1b')](0xcc)[_0x5bec('0x1c')]();});}};}function handleEntityNotFound(_0x131143,_0x2dc014){return function(_0x4de66a){if(!_0x4de66a){_0x131143['sendStatus'](0x194);}return _0x4de66a;};}function handleError(_0x5e44b3,_0x2961bd){_0x2961bd=_0x2961bd||0x1f4;return function(_0x2cdd2f){logger[_0x5bec('0x27')](_0x2cdd2f['stack']);if(_0x2cdd2f[_0x5bec('0x28')]){delete _0x2cdd2f[_0x5bec('0x28')];}_0x5e44b3['status'](_0x2961bd)[_0x5bec('0x29')](_0x2cdd2f);};}exports[_0x5bec('0x2a')]=function(_0x51dc1e,_0x5336b3){var _0x3575e7={},_0x2a82d5={},_0x3039f0={'count':0x0,'rows':[]};var _0x2c7a7b=_[_0x5bec('0x2b')](db[_0x5bec('0x2c')]['rawAttributes'],function(_0x2987ca){return{'name':_0x2987ca['fieldName'],'type':_0x2987ca[_0x5bec('0x2d')][_0x5bec('0x2e')]};});_0x2a82d5[_0x5bec('0x2f')]=_[_0x5bec('0x2b')](_0x2c7a7b,'name');_0x2a82d5[_0x5bec('0x30')]=_[_0x5bec('0x31')](_0x51dc1e[_0x5bec('0x30')]);_0x2a82d5['filters']=_[_0x5bec('0x32')](_0x2a82d5['model'],_0x2a82d5[_0x5bec('0x30')]);_0x3575e7[_0x5bec('0x33')]=_[_0x5bec('0x32')](_0x2a82d5['model'],qs[_0x5bec('0x34')](_0x51dc1e[_0x5bec('0x30')]['fields']));_0x3575e7[_0x5bec('0x33')]=_0x3575e7[_0x5bec('0x33')][_0x5bec('0x35')]?_0x3575e7[_0x5bec('0x33')]:_0x2a82d5[_0x5bec('0x2f')];if(!_0x51dc1e['query'][_0x5bec('0x36')]('nolimit')){_0x3575e7[_0x5bec('0x1f')]=qs[_0x5bec('0x1f')](_0x51dc1e[_0x5bec('0x30')][_0x5bec('0x1f')]);_0x3575e7[_0x5bec('0x20')]=qs[_0x5bec('0x20')](_0x51dc1e['query'][_0x5bec('0x20')]);}_0x3575e7[_0x5bec('0x37')]=qs[_0x5bec('0x38')](_0x51dc1e['query'][_0x5bec('0x38')]);_0x3575e7[_0x5bec('0x39')]=qs['filters'](_[_0x5bec('0x3a')](_0x51dc1e['query'],_0x2a82d5[_0x5bec('0x3b')]),_0x2c7a7b);if(_0x51dc1e[_0x5bec('0x30')][_0x5bec('0x3c')]){_0x3575e7['where']=_[_0x5bec('0x3d')](_0x3575e7[_0x5bec('0x39')],{'$or':_[_0x5bec('0x2b')](_0x2c7a7b,function(_0x139859){if(_0x139859[_0x5bec('0x2d')]!==_0x5bec('0x3e')){var _0x3b7e50={};_0x3b7e50[_0x139859['name']]={'$like':'%'+_0x51dc1e[_0x5bec('0x30')][_0x5bec('0x3c')]+'%'};return _0x3b7e50;}})});}_0x3575e7=_[_0x5bec('0x3d')]({},_0x3575e7,_0x51dc1e[_0x5bec('0x3f')]);var _0x598e53={'where':_0x3575e7[_0x5bec('0x39')]};return db[_0x5bec('0x2c')][_0x5bec('0x40')](_0x598e53)['then'](function(_0x54ecf3){_0x3039f0[_0x5bec('0x40')]=_0x54ecf3;if(_0x51dc1e[_0x5bec('0x30')][_0x5bec('0x41')]){_0x3575e7[_0x5bec('0x42')]=[{'all':!![]}];}return db[_0x5bec('0x2c')]['findAll'](_0x3575e7);})['then'](function(_0x411306){_0x3039f0['rows']=_0x411306;return _0x3039f0;})[_0x5bec('0x26')](respondWithFilteredResult(_0x5336b3,_0x3575e7))[_0x5bec('0x43')](handleError(_0x5336b3,null));};exports[_0x5bec('0x44')]=function(_0x5ac578,_0x1e59a3){var _0x26a4a5={'raw':![],'where':{'id':_0x5ac578[_0x5bec('0x45')]['id']}},_0x4fbbd4={};_0x4fbbd4[_0x5bec('0x2f')]=_[_0x5bec('0x31')](db[_0x5bec('0x2c')][_0x5bec('0x46')]);_0x4fbbd4[_0x5bec('0x30')]=_[_0x5bec('0x31')](_0x5ac578['query']);_0x4fbbd4['filters']=_[_0x5bec('0x32')](_0x4fbbd4['model'],_0x4fbbd4['query']);_0x26a4a5[_0x5bec('0x33')]=_['intersection'](_0x4fbbd4['model'],qs['fields'](_0x5ac578[_0x5bec('0x30')][_0x5bec('0x34')]));_0x26a4a5[_0x5bec('0x33')]=_0x26a4a5[_0x5bec('0x33')]['length']?_0x26a4a5[_0x5bec('0x33')]:_0x4fbbd4[_0x5bec('0x2f')];if(_0x5ac578[_0x5bec('0x30')][_0x5bec('0x41')]){_0x26a4a5['include']=[{'all':!![]}];}_0x26a4a5=_[_0x5bec('0x3d')]({},_0x26a4a5,_0x5ac578[_0x5bec('0x3f')]);return db[_0x5bec('0x2c')]['find'](_0x26a4a5)[_0x5bec('0x26')](handleEntityNotFound(_0x1e59a3,null))['then'](respondWithResult(_0x1e59a3,null))[_0x5bec('0x43')](handleError(_0x1e59a3,null));};exports[_0x5bec('0x47')]=function(_0x133d5c,_0x218f7c){return db['Dynamics365Account'][_0x5bec('0x47')](_0x133d5c[_0x5bec('0x48')],{})[_0x5bec('0x26')](respondWithResult(_0x218f7c,0xc9))[_0x5bec('0x43')](handleError(_0x218f7c,null));};exports[_0x5bec('0x24')]=function(_0x123758,_0x807808){if(_0x123758['body']['id']){delete _0x123758[_0x5bec('0x48')]['id'];}return db[_0x5bec('0x2c')]['find']({'where':{'id':_0x123758[_0x5bec('0x45')]['id']}})[_0x5bec('0x26')](handleEntityNotFound(_0x807808,null))[_0x5bec('0x26')](saveUpdates(_0x123758[_0x5bec('0x48')],null))[_0x5bec('0x26')](respondWithResult(_0x807808,null))[_0x5bec('0x43')](handleError(_0x807808,null));};exports[_0x5bec('0x25')]=function(_0x4f08d9,_0x101dcb){return db['Dynamics365Account'][_0x5bec('0x49')]({'where':{'id':_0x4f08d9[_0x5bec('0x45')]['id']}})[_0x5bec('0x26')](handleEntityNotFound(_0x101dcb,null))[_0x5bec('0x26')](removeEntity(_0x101dcb,null))[_0x5bec('0x43')](handleError(_0x101dcb,null));};exports[_0x5bec('0x4a')]=function(_0x1c3225,_0x3bc0c9,_0x418ed2){var _0x3f238={};var _0x580c75={};var _0x153f71;var _0x51af88;return db['Dynamics365Account'][_0x5bec('0x4b')]({'where':{'id':_0x1c3225['params']['id']}})['then'](handleEntityNotFound(_0x3bc0c9,null))[_0x5bec('0x26')](function(_0x2114e5){if(_0x2114e5){_0x153f71=_0x2114e5;_0x580c75[_0x5bec('0x2f')]=_['keys'](db[_0x5bec('0x4c')][_0x5bec('0x46')]);_0x580c75[_0x5bec('0x30')]=_[_0x5bec('0x31')](_0x1c3225['query']);_0x580c75[_0x5bec('0x3b')]=_[_0x5bec('0x32')](_0x580c75[_0x5bec('0x2f')],_0x580c75[_0x5bec('0x30')]);_0x3f238[_0x5bec('0x33')]=_[_0x5bec('0x32')](_0x580c75[_0x5bec('0x2f')],qs['fields'](_0x1c3225['query'][_0x5bec('0x34')]));_0x3f238['attributes']=_0x3f238[_0x5bec('0x33')][_0x5bec('0x35')]?_0x3f238['attributes']:_0x580c75[_0x5bec('0x2f')];_0x3f238['order']=qs[_0x5bec('0x38')](_0x1c3225[_0x5bec('0x30')][_0x5bec('0x38')]);_0x3f238[_0x5bec('0x39')]=qs[_0x5bec('0x3b')](_[_0x5bec('0x3a')](_0x1c3225[_0x5bec('0x30')],_0x580c75[_0x5bec('0x3b')]));if(_0x1c3225[_0x5bec('0x30')][_0x5bec('0x3c')]){_0x3f238[_0x5bec('0x39')]=_[_0x5bec('0x3d')](_0x3f238[_0x5bec('0x39')],{'$or':_[_0x5bec('0x2b')](_0x3f238['attributes'],function(_0x2e33a7){var _0x17b22e={};_0x17b22e[_0x2e33a7]={'$like':'%'+_0x1c3225[_0x5bec('0x30')]['filter']+'%'};return _0x17b22e;})});}_0x3f238=_[_0x5bec('0x3d')]({},_0x3f238,_0x1c3225[_0x5bec('0x3f')]);return _0x153f71[_0x5bec('0x4a')](_0x3f238);}})[_0x5bec('0x26')](function(_0x19a1c9){if(_0x19a1c9){_0x51af88=_0x19a1c9['length'];if(!_0x1c3225[_0x5bec('0x30')][_0x5bec('0x36')](_0x5bec('0x4d'))){_0x3f238[_0x5bec('0x1f')]=qs['limit'](_0x1c3225[_0x5bec('0x30')]['limit']);_0x3f238[_0x5bec('0x20')]=qs[_0x5bec('0x20')](_0x1c3225[_0x5bec('0x30')][_0x5bec('0x20')]);}return _0x153f71['getConfigurations'](_0x3f238);}})[_0x5bec('0x26')](function(_0x3ec201){if(_0x3ec201){return _0x3ec201?{'count':_0x51af88,'rows':_0x3ec201}:null;}})[_0x5bec('0x26')](respondWithResult(_0x3bc0c9,null))[_0x5bec('0x43')](handleError(_0x3bc0c9,null));};exports[_0x5bec('0x4e')]=function(_0x2d040e,_0x43e688,_0x164408){if(_0x2d040e[_0x5bec('0x48')]['id']){delete _0x2d040e[_0x5bec('0x48')]['id'];}return db[_0x5bec('0x2c')][_0x5bec('0x4b')]({'where':{'id':_0x2d040e[_0x5bec('0x45')]['id']}})[_0x5bec('0x26')](handleEntityNotFound(_0x43e688,null))[_0x5bec('0x26')](function(_0x490d4b){if(_0x490d4b){_0x2d040e[_0x5bec('0x48')][_0x5bec('0x4f')]=_0x490d4b['id'];_0x2d040e['body'][_0x5bec('0x50')]=integrations['getSubjects'](_0x2d040e[_0x5bec('0x48')][_0x5bec('0x51')],_0x2d040e['body']['type']);_0x2d040e[_0x5bec('0x48')][_0x5bec('0x52')]=integrations[_0x5bec('0x53')](_0x2d040e[_0x5bec('0x48')][_0x5bec('0x51')],_0x2d040e['body'][_0x5bec('0x2d')]);return db[_0x5bec('0x4c')]['create'](_0x2d040e[_0x5bec('0x48')],{'include':[{'model':db[_0x5bec('0x54')],'as':_0x5bec('0x50')},{'model':db[_0x5bec('0x54')],'as':'Descriptions'}]});}return null;})[_0x5bec('0x26')](respondWithResult(_0x43e688,null))['catch'](handleError(_0x43e688,null));};exports[_0x5bec('0x55')]=function(_0x18d7af,_0x3ede1d,_0x34e172){var _0x31b2c6=_0x18d7af[_0x5bec('0x30')][_0x5bec('0x56')];var _0x340b5c=_0x31b2c6===_0x5bec('0x57')?_0x5bec('0x58'):_0x5bec('0x59');var _0x5bbd32='';var _0x5a9d3f='';var _0x3c305e='';var _0x2949a5='';var _0x84b315='';var _0x41bf69='';var _0x459a71='';var _0x4745a7='';var _0xbf8b50=['title','description',_0x5bec('0x5a'),_0x5bec('0x5b'),_0x5bec('0x5c'),_0x5bec('0x5d'),_0x5bec('0x5e'),_0x5bec('0x5f'),_0x5bec('0x60'),_0x5bec('0x61')];var _0x132c57=[_0x5bec('0x62'),_0x5bec('0x63'),_0x5bec('0x64'),_0x5bec('0x65'),_0x5bec('0x66'),_0x5bec('0x67'),_0x5bec('0x68'),_0x5bec('0x69'),_0x5bec('0x6a'),_0x5bec('0x6b'),_0x5bec('0x6c'),'createdbyyominame',_0x5bec('0x6d'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x5bec('0x6e'),'customeridtype',_0x5bec('0x6f'),'emailaddress','entitlementidname',_0x5bec('0x70'),_0x5bec('0x71'),'escalatedon',_0x5bec('0x72'),_0x5bec('0x73'),_0x5bec('0x74'),_0x5bec('0x75'),_0x5bec('0x76'),_0x5bec('0x77'),_0x5bec('0x78'),_0x5bec('0x79'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x5bec('0x7a'),_0x5bec('0x7b'),_0x5bec('0x7c'),_0x5bec('0x7d'),'modifiedonbehalfbyyominame',_0x5bec('0x7e'),'msdyn_iotalertname',_0x5bec('0x7f'),_0x5bec('0x80'),_0x5bec('0x81'),_0x5bec('0x82'),_0x5bec('0x83'),_0x5bec('0x84'),_0x5bec('0x85'),_0x5bec('0x86'),'primarycontactidyominame',_0x5bec('0x87'),_0x5bec('0x88'),_0x5bec('0x89'),_0x5bec('0x8a'),_0x5bec('0x8b'),'responseby',_0x5bec('0x8c'),_0x5bec('0x8d'),'sentimentvalue',_0x5bec('0x8e'),'slaname',_0x5bec('0x8f'),_0x5bec('0x90'),_0x5bec('0x91'),_0x5bec('0x92'),_0x5bec('0x93'),_0x5bec('0x94'),_0x5bec('0x95'),_0x5bec('0x96'),_0x5bec('0x97'),_0x5bec('0x98')];var _0x1c44f5=_0xbf8b50[_0x5bec('0x99')](_0x132c57);return db[_0x5bec('0x2c')][_0x5bec('0x4b')]({'where':{'id':_0x18d7af[_0x5bec('0x45')]['id']},'attributes':['id',_0x5bec('0x9a'),_0x5bec('0x9b'),_0x5bec('0x9c'),'tenantId',_0x5bec('0x9d'),'clientSecret']})[_0x5bec('0x26')](handleEntityNotFound(_0x3ede1d,null))[_0x5bec('0x26')](function(_0x48ae24){if(_0x48ae24){_0x4745a7=_0x48ae24['remoteUri'];var _0x289324=_0x4745a7['slice'](-0x1);if(_0x289324==='/'){_0x4745a7=_0x4745a7[_0x5bec('0x9e')](0x0,_0x4745a7['lastIndexOf'](_0x289324));}_0x459a71=util[_0x5bec('0x9f')](_0x5bec('0xa0'),_0x4745a7);var _0x5c26b9={'method':_0x5bec('0xa1'),'uri':'https://login.microsoftonline.com/'+_0x48ae24[_0x5bec('0xa2')]+'/oauth2/token','form':{'client_id':_0x48ae24[_0x5bec('0x9d')],'resource':_0x4745a7,'username':_0x48ae24[_0x5bec('0x9a')],'password':_0x48ae24['password'],'grant_type':_0x5bec('0x9b'),'client_secret':_0x48ae24[_0x5bec('0xa3')]},'json':!![]};return rp(_0x5c26b9);}})[_0x5bec('0x26')](function(_0x2bfa87){_0x41bf69=_0x2bfa87[_0x5bec('0xa4')];var _0x405660={'method':'GET','uri':encodeURI(_0x459a71+_0x5bec('0xa5')+_0x340b5c+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x41bf69,'If-None-Match':null,'OData-Version':_0x5bec('0xa6')},'json':!![]};return rp(_0x405660);})['then'](function(_0x59882b){var _0x2900e3=_0x59882b[_0x5bec('0xa7')][0x0];var _0xce9676=_0x2900e3['MetadataId'];var _0x4182c1={'method':_0x5bec('0xa8'),'uri':_0x459a71+_0x5bec('0xa9')+_0xce9676+_0x5bec('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x41bf69,'If-None-Match':null,'OData-Version':_0x5bec('0xa6')},'json':!![]};return rp(_0x4182c1);})[_0x5bec('0x26')](function(_0x12a7d6){_0x5bbd32=_0x12a7d6;_0x5a9d3f=_0x5bbd32[_0x5bec('0xab')];_0x5a9d3f=_['remove'](_0x5a9d3f,function(_0x15b57f){return!_0x1c44f5[_0x5bec('0xac')](_0x15b57f[_0x5bec('0xad')]);});var _0x268680=[];var _0x21023e=[];_0x5a9d3f[_0x5bec('0xae')](function(_0x13fbfc){if(_0x13fbfc[_0x5bec('0xaf')]){var _0x5b8560=_0x13fbfc[_0x5bec('0xaf')][_0x5bec('0x9e')](_0x13fbfc[_0x5bec('0xaf')][_0x5bec('0xb0')]('.')+0x1);if(_0x5b8560===_0x5bec('0xb1')){_0x268680['push'](getSelectList(_0x459a71,_0x31b2c6,_0x21023e,_0x5bbd32[_0x5bec('0xb2')],_0x13fbfc[_0x5bec('0xb2')],_0x41bf69));}}});return Promise['all'](_0x268680);})[_0x5bec('0x26')](function(_0x528102){_0x3c305e=_0x528102[0x0];var _0x1ed963=[];var _0x3e09e5=[];_0x5a9d3f[_0x5bec('0xae')](function(_0x229d13){if(!_[_0x5bec('0xb3')](_0x229d13['@odata.type'])){var _0x1e019b=_0x229d13[_0x5bec('0xaf')][_0x5bec('0x9e')](_0x229d13[_0x5bec('0xaf')][_0x5bec('0xb0')]('.')+0x1);if(_0x1e019b===_0x5bec('0xb4')){_0x1ed963[_0x5bec('0xb5')](getBooleanList(_0x459a71,_0x31b2c6,_0x3e09e5,_0x5bbd32[_0x5bec('0xb2')],_0x229d13[_0x5bec('0xb2')],_0x41bf69));}}});return Promise['all'](_0x1ed963);})[_0x5bec('0x26')](function(_0x160d40){_0x2949a5=_0x160d40[0x0];var _0x187416=[];var _0x52b869=[];_0x5a9d3f['forEach'](function(_0x1b7573){if(_0x1b7573[_0x5bec('0xaf')]){var _0x50caf8=_0x1b7573[_0x5bec('0xaf')]['substring'](_0x1b7573[_0x5bec('0xaf')]['lastIndexOf']('.')+0x1);if(_0x50caf8===_0x5bec('0xb6')||_0x50caf8==='DoubleAttributeMetadata'||_0x50caf8===_0x5bec('0xb7')||_0x50caf8==='IntegerAttributeMetadata'||_0x50caf8===_0x5bec('0xb8')||_0x50caf8==='DateTimeAttributeMetadata'||_0x50caf8===_0x5bec('0xb9')||_0x50caf8===_0x5bec('0xba')||_0x50caf8==='StateAttributeMetadata'||_0x50caf8===_0x5bec('0xbb')){_0x187416[_0x5bec('0xb5')](getInputList(_0x459a71,_0x31b2c6,_0x50caf8,_0x52b869,_0x5bbd32['MetadataId'],_0x1b7573[_0x5bec('0xb2')],_0x41bf69));}}});return Promise[_0x5bec('0xbc')](_0x187416);})[_0x5bec('0x26')](function(_0x278ea0){_0x84b315=_0x278ea0[0x0];var _0x14b1ac=_0x3c305e[_0x5bec('0x99')](_0x2949a5)[_0x5bec('0x99')](_0x84b315);var _0x1c9f75={'count':_0x14b1ac[_0x5bec('0x35')],'rows':_0x14b1ac};return _0x1c9f75;})['then'](respondWithResult(_0x3ede1d,null))['catch'](function(_0x57bab4){var _0x53f093=_0x18d7af[_0x5bec('0x30')]['test']?0x1f4:_0x57bab4[_0x5bec('0xbd')]||0x1f4;logger['error'](_0x57bab4[_0x5bec('0xbe')]);delete _0x57bab4[_0x5bec('0x28')];if(_0x53f093===0x191){_0x53f093=0x190;}_0x3ede1d[_0x5bec('0x1b')](_0x53f093)['send'](_0x18d7af[_0x5bec('0x30')]['test']?{'message':_0x5bec('0xbf'),'statusCode':_0x57bab4[_0x5bec('0xbd')]}:_0x57bab4);});};function getSelectList(_0x2db359,_0x4082c2,_0x3bfd18,_0x2ffee8,_0x18fec4,_0x58f63b){var _0x456510={'method':_0x5bec('0xa8'),'uri':_0x2db359+_0x5bec('0xa9')+_0x2ffee8+_0x5bec('0xc0')+_0x18fec4+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x5bec('0xc1'),'headers':{'Authorization':_0x5bec('0xc2')+_0x58f63b,'If-None-Match':null,'OData-Version':_0x5bec('0xa6')},'json':!![]};return rp(_0x456510)[_0x5bec('0x26')](function(_0x1f805c){var _0x5b57ab=[];var _0x4efccc=_0x1f805c['OptionSet']['Options'];_0x4efccc['forEach'](function(_0xd8e688){_0x5b57ab['push']({'name':_0xd8e688[_0x5bec('0xc3')][_0x5bec('0xc4')]['Label'],'value':String(_0xd8e688[_0x5bec('0xc5')])});});var _0x30c84c={'id':_0x4082c2+'_'+_0x1f805c['LogicalName'],'name':_0x1f805c[_0x5bec('0xc6')][_0x5bec('0xc4')][_0x5bec('0xc3')],'custom':![],'options':_0x5b57ab};_0x3bfd18[_0x5bec('0xb5')](_0x30c84c);return _0x3bfd18;});}function getBooleanList(_0xc7c50a,_0x1d567a,_0x2f2c85,_0x27cc51,_0x54e6d0,_0x18fb4b){var _0x2e94c0={'method':_0x5bec('0xa8'),'uri':_0xc7c50a+_0x5bec('0xa9')+_0x27cc51+_0x5bec('0xc0')+_0x54e6d0+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x18fb4b,'If-None-Match':null,'OData-Version':_0x5bec('0xa6')},'json':!![]};return rp(_0x2e94c0)[_0x5bec('0x26')](function(_0x35294f){var _0x9d4c85=[];_0x9d4c85[_0x5bec('0xb5')]({'name':_0x35294f['OptionSet'][_0x5bec('0xc7')][_0x5bec('0xc3')]['UserLocalizedLabel'][_0x5bec('0xc3')],'value':_0x5bec('0xc8')},{'name':_0x35294f['OptionSet'][_0x5bec('0xc9')][_0x5bec('0xc3')][_0x5bec('0xc4')][_0x5bec('0xc3')],'value':_0x5bec('0xca')});var _0x47ff58={'id':_0x1d567a+'_'+_0x35294f['LogicalName'],'name':_0x35294f['DisplayName']['UserLocalizedLabel'][_0x5bec('0xc3')],'custom':![],'options':_0x9d4c85};_0x2f2c85[_0x5bec('0xb5')](_0x47ff58);return _0x2f2c85;});}function getInputList(_0x41d461,_0x1481ad,_0x222b26,_0x1c3e9e,_0x558695,_0x4b7841,_0x3da745){var _0x8d8363={'method':'GET','uri':_0x41d461+'EntityDefinitions('+_0x558695+_0x5bec('0xc0')+_0x4b7841+_0x5bec('0xcb')+_0x222b26+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5bec('0xc2')+_0x3da745,'If-None-Match':null,'OData-Version':_0x5bec('0xa6')},'json':!![]};return rp(_0x8d8363)[_0x5bec('0x26')](function(_0xa8d9c3){var _0x561e40={'id':_0x1481ad+'_'+_0xa8d9c3[_0x5bec('0xad')],'name':_0xa8d9c3[_0x5bec('0xc6')]['UserLocalizedLabel']?_0xa8d9c3[_0x5bec('0xc6')]['UserLocalizedLabel']['Label']:_0xa8d9c3[_0x5bec('0xad')],'custom':![],'options':[]};_0x1c3e9e[_0x5bec('0xb5')](_0x561e40);return _0x1c3e9e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 9a78538..59ec726 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x4f1b13,_0x4a4173){var _0x314628=function(_0x522433){while(--_0x522433){_0x4f1b13['push'](_0x4f1b13['shift']());}};_0x314628(++_0x4a4173);}(_0x757a,0xde));var _0xa757=function(_0x4aaf51,_0x54a845){_0x4aaf51=_0x4aaf51-0x0;var _0x67ae9e=_0x757a[_0x4aaf51];return _0x67ae9e;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1d557d,_0xe6439d){var _0x1a5b86=function(_0x583712){while(--_0x583712){_0x1d557d['push'](_0x1d557d['shift']());}};_0x1a5b86(++_0xe6439d);}(_0x757a,0xde));var _0xa757=function(_0x34932d,_0x59ee49){_0x34932d=_0x34932d-0x0;var _0x52adda=_0x757a[_0x34932d];return _0x52adda;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'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 afcb254..330fb68 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 _0x1df0=['attributes','map','model','include','GetDynamics365Account','ShowDynamics365Account','raw','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Dynamics365Account,\x20%s,\x20%s','debug','stringify','error','message','result','Dynamics365Account','options','where'];(function(_0x5c396e,_0x1a7293){var _0x58b007=function(_0x45c286){while(--_0x45c286){_0x5c396e['push'](_0x5c396e['shift']());}};_0x58b007(++_0x1a7293);}(_0x1df0,0xd3));var _0x01df=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x1df0[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x01df('0x0'));var util=require(_0x01df('0x1'));var moment=require(_0x01df('0x2'));var BPromise=require(_0x01df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01df('0x4'))['db'];var utils=require(_0x01df('0x5'));var logger=require(_0x01df('0x6'))('rpc');var config=require(_0x01df('0x7'));var jayson=require(_0x01df('0x8'));var client=jayson['client'][_0x01df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d4211,_0x336c89,_0x1e2e8a){return new BPromise(function(_0x2b2674,_0x6e8d50){return client['request'](_0x1d4211,_0x1e2e8a)[_0x01df('0xa')](function(_0x43c3c2){logger[_0x01df('0xb')](_0x01df('0xc'),_0x336c89,'request\x20sent');logger[_0x01df('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x336c89,'request\x20sent',JSON[_0x01df('0xe')](_0x43c3c2));if(_0x43c3c2[_0x01df('0xf')]){if(_0x43c3c2[_0x01df('0xf')]['code']===0x1f4){logger[_0x01df('0xf')](_0x01df('0xc'),_0x336c89,_0x43c3c2['error'][_0x01df('0x10')]);return _0x6e8d50(_0x43c3c2[_0x01df('0xf')]['message']);}logger[_0x01df('0xf')](_0x01df('0xc'),_0x336c89,_0x43c3c2[_0x01df('0xf')][_0x01df('0x10')]);return _0x2b2674(_0x43c3c2[_0x01df('0xf')][_0x01df('0x10')]);}else{logger[_0x01df('0xb')](_0x01df('0xc'),_0x336c89,'request\x20sent');_0x2b2674(_0x43c3c2[_0x01df('0x11')][_0x01df('0x10')]);}})['catch'](function(_0x3acdca){logger[_0x01df('0xf')](_0x01df('0xc'),_0x336c89,_0x3acdca);_0x6e8d50(_0x3acdca);});});}exports['GetDynamics365Account']=function(_0x1723fa){var _0x2e93e9=this;return new Promise(function(_0x4dcd85,_0x56efab){return db[_0x01df('0x12')]['findAll']({'raw':_0x1723fa['options']?_0x1723fa[_0x01df('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x1723fa['options']?_0x1723fa[_0x01df('0x13')][_0x01df('0x14')]||null:null,'attributes':_0x1723fa[_0x01df('0x13')]?_0x1723fa[_0x01df('0x13')][_0x01df('0x15')]||null:null,'limit':_0x1723fa[_0x01df('0x13')]?_0x1723fa[_0x01df('0x13')]['limit']||null:null,'include':_0x1723fa[_0x01df('0x13')]?_0x1723fa['options']['include']?_[_0x01df('0x16')](_0x1723fa[_0x01df('0x13')]['include'],function(_0x516765){return{'model':db[_0x516765[_0x01df('0x17')]],'as':_0x516765['as'],'attributes':_0x516765['attributes'],'include':_0x516765[_0x01df('0x18')]?_[_0x01df('0x16')](_0x516765['include'],function(_0x567ab2){return{'model':db[_0x567ab2[_0x01df('0x17')]],'as':_0x567ab2['as'],'attributes':_0x567ab2[_0x01df('0x15')],'include':_0x567ab2[_0x01df('0x18')]?_[_0x01df('0x16')](_0x567ab2[_0x01df('0x18')],function(_0x26e2ef){return{'model':db[_0x26e2ef['model']],'as':_0x26e2ef['as'],'attributes':_0x26e2ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x01df('0xa')](function(_0x545de8){logger[_0x01df('0xb')](_0x01df('0x19'),_0x1723fa);logger[_0x01df('0xd')](_0x01df('0x19'),_0x1723fa,JSON[_0x01df('0xe')](_0x545de8));_0x4dcd85(_0x545de8);})['catch'](function(_0x9f4272){logger['error'](_0x01df('0x19'),_0x9f4272[_0x01df('0x10')],_0x1723fa);_0x56efab(_0x2e93e9[_0x01df('0xf')](0x1f4,_0x9f4272['message']));});});};exports[_0x01df('0x1a')]=function(_0x348193){var _0x329d79=this;return new Promise(function(_0x1108c7,_0x34e142){return db['Dynamics365Account']['find']({'raw':_0x348193[_0x01df('0x13')]?_0x348193['options'][_0x01df('0x1b')]===undefined?!![]:![]:!![],'where':_0x348193[_0x01df('0x13')]?_0x348193[_0x01df('0x13')]['where']||null:null,'attributes':_0x348193[_0x01df('0x13')]?_0x348193[_0x01df('0x13')][_0x01df('0x15')]||null:null,'include':_0x348193[_0x01df('0x13')]?_0x348193[_0x01df('0x13')][_0x01df('0x18')]?_[_0x01df('0x16')](_0x348193[_0x01df('0x13')][_0x01df('0x18')],function(_0x256788){return{'model':db[_0x256788['model']],'as':_0x256788['as'],'attributes':_0x256788[_0x01df('0x15')],'include':_0x256788['include']?_['map'](_0x256788['include'],function(_0x5d9ae2){return{'model':db[_0x5d9ae2[_0x01df('0x17')]],'as':_0x5d9ae2['as'],'attributes':_0x5d9ae2[_0x01df('0x15')],'include':_0x5d9ae2[_0x01df('0x18')]?_[_0x01df('0x16')](_0x5d9ae2[_0x01df('0x18')],function(_0x28c553){return{'model':db[_0x28c553[_0x01df('0x17')]],'as':_0x28c553['as'],'attributes':_0x28c553['attributes']};}):[]};}):[]};}):[]:[]})[_0x01df('0xa')](function(_0x46ab9c){logger['info'](_0x01df('0x1a'),_0x348193);logger[_0x01df('0xd')](_0x01df('0x1a'),_0x348193,JSON['stringify'](_0x46ab9c));_0x1108c7(_0x46ab9c);})[_0x01df('0x1c')](function(_0x25c873){logger[_0x01df('0xf')](_0x01df('0x1a'),_0x25c873[_0x01df('0x10')],_0x348193);_0x34e142(_0x329d79[_0x01df('0xf')](0x1f4,_0x25c873[_0x01df('0x10')]));});});}; \ No newline at end of file +var _0xe5e8=['raw','map','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','options','where','limit','include','model','attributes','then','GetDynamics365Account','find'];(function(_0x255be9,_0x3345d9){var _0x34fedf=function(_0x2e198c){while(--_0x2e198c){_0x255be9['push'](_0x255be9['shift']());}};_0x34fedf(++_0x3345d9);}(_0xe5e8,0x150));var _0x8e5e=function(_0x2683d8,_0x5b80f9){_0x2683d8=_0x2683d8-0x0;var _0xd51e9c=_0xe5e8[_0x2683d8];return _0xd51e9c;};'use strict';var _=require(_0x8e5e('0x0'));var util=require(_0x8e5e('0x1'));var moment=require(_0x8e5e('0x2'));var BPromise=require(_0x8e5e('0x3'));var rs=require(_0x8e5e('0x4'));var fs=require('fs');var Redis=require(_0x8e5e('0x5'));var db=require(_0x8e5e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e5e('0x7'))(_0x8e5e('0x8'));var config=require(_0x8e5e('0x9'));var jayson=require(_0x8e5e('0xa'));var client=jayson[_0x8e5e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33cdcc,_0x1572bf,_0xc3e0f6){return new BPromise(function(_0x58d01c,_0x45c33d){return client[_0x8e5e('0xc')](_0x33cdcc,_0xc3e0f6)['then'](function(_0x478451){logger[_0x8e5e('0xd')](_0x8e5e('0xe'),_0x1572bf,_0x8e5e('0xf'));logger[_0x8e5e('0x10')](_0x8e5e('0x11'),_0x1572bf,_0x8e5e('0xf'),JSON[_0x8e5e('0x12')](_0x478451));if(_0x478451[_0x8e5e('0x13')]){if(_0x478451[_0x8e5e('0x13')][_0x8e5e('0x14')]===0x1f4){logger[_0x8e5e('0x13')](_0x8e5e('0xe'),_0x1572bf,_0x478451['error'][_0x8e5e('0x15')]);return _0x45c33d(_0x478451[_0x8e5e('0x13')]['message']);}logger['error'](_0x8e5e('0xe'),_0x1572bf,_0x478451[_0x8e5e('0x13')]['message']);return _0x58d01c(_0x478451['error'][_0x8e5e('0x15')]);}else{logger[_0x8e5e('0xd')](_0x8e5e('0xe'),_0x1572bf,_0x8e5e('0xf'));_0x58d01c(_0x478451[_0x8e5e('0x16')]['message']);}})[_0x8e5e('0x17')](function(_0x17f850){logger[_0x8e5e('0x13')](_0x8e5e('0xe'),_0x1572bf,_0x17f850);_0x45c33d(_0x17f850);});});}exports['GetDynamics365Account']=function(_0x22b53d){var _0x2da70e=this;return new Promise(function(_0x42d033,_0x5e0b25){return db[_0x8e5e('0x18')]['findAll']({'raw':_0x22b53d[_0x8e5e('0x19')]?_0x22b53d['options']['raw']===undefined?!![]:![]:!![],'where':_0x22b53d[_0x8e5e('0x19')]?_0x22b53d[_0x8e5e('0x19')][_0x8e5e('0x1a')]||null:null,'attributes':_0x22b53d['options']?_0x22b53d[_0x8e5e('0x19')]['attributes']||null:null,'limit':_0x22b53d[_0x8e5e('0x19')]?_0x22b53d[_0x8e5e('0x19')][_0x8e5e('0x1b')]||null:null,'include':_0x22b53d['options']?_0x22b53d[_0x8e5e('0x19')][_0x8e5e('0x1c')]?_['map'](_0x22b53d[_0x8e5e('0x19')]['include'],function(_0x5d9753){return{'model':db[_0x5d9753[_0x8e5e('0x1d')]],'as':_0x5d9753['as'],'attributes':_0x5d9753[_0x8e5e('0x1e')],'include':_0x5d9753[_0x8e5e('0x1c')]?_['map'](_0x5d9753[_0x8e5e('0x1c')],function(_0x2cce09){return{'model':db[_0x2cce09[_0x8e5e('0x1d')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0x8e5e('0x1e')],'include':_0x2cce09[_0x8e5e('0x1c')]?_['map'](_0x2cce09['include'],function(_0x221b8a){return{'model':db[_0x221b8a[_0x8e5e('0x1d')]],'as':_0x221b8a['as'],'attributes':_0x221b8a[_0x8e5e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8e5e('0x1f')](function(_0x2b0386){logger[_0x8e5e('0xd')](_0x8e5e('0x20'),_0x22b53d);logger['debug']('GetDynamics365Account',_0x22b53d,JSON['stringify'](_0x2b0386));_0x42d033(_0x2b0386);})[_0x8e5e('0x17')](function(_0x3947df){logger[_0x8e5e('0x13')]('GetDynamics365Account',_0x3947df[_0x8e5e('0x15')],_0x22b53d);_0x5e0b25(_0x2da70e[_0x8e5e('0x13')](0x1f4,_0x3947df[_0x8e5e('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x50265f){var _0x2b9696=this;return new Promise(function(_0x21b9cb,_0x5cd986){return db['Dynamics365Account'][_0x8e5e('0x21')]({'raw':_0x50265f[_0x8e5e('0x19')]?_0x50265f[_0x8e5e('0x19')][_0x8e5e('0x22')]===undefined?!![]:![]:!![],'where':_0x50265f[_0x8e5e('0x19')]?_0x50265f[_0x8e5e('0x19')][_0x8e5e('0x1a')]||null:null,'attributes':_0x50265f['options']?_0x50265f['options'][_0x8e5e('0x1e')]||null:null,'include':_0x50265f[_0x8e5e('0x19')]?_0x50265f[_0x8e5e('0x19')]['include']?_[_0x8e5e('0x23')](_0x50265f[_0x8e5e('0x19')][_0x8e5e('0x1c')],function(_0x5e13ba){return{'model':db[_0x5e13ba[_0x8e5e('0x1d')]],'as':_0x5e13ba['as'],'attributes':_0x5e13ba['attributes'],'include':_0x5e13ba[_0x8e5e('0x1c')]?_['map'](_0x5e13ba[_0x8e5e('0x1c')],function(_0x4cef33){return{'model':db[_0x4cef33[_0x8e5e('0x1d')]],'as':_0x4cef33['as'],'attributes':_0x4cef33['attributes'],'include':_0x4cef33[_0x8e5e('0x1c')]?_[_0x8e5e('0x23')](_0x4cef33['include'],function(_0x2bfa60){return{'model':db[_0x2bfa60['model']],'as':_0x2bfa60['as'],'attributes':_0x2bfa60[_0x8e5e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x251f5f){logger[_0x8e5e('0xd')](_0x8e5e('0x24'),_0x50265f);logger['debug'](_0x8e5e('0x24'),_0x50265f,JSON[_0x8e5e('0x12')](_0x251f5f));_0x21b9cb(_0x251f5f);})[_0x8e5e('0x17')](function(_0xea58b4){logger[_0x8e5e('0x13')](_0x8e5e('0x24'),_0xea58b4[_0x8e5e('0x15')],_0x50265f);_0x5cd986(_0x2b9696[_0x8e5e('0x13')](0x1f4,_0xea58b4[_0x8e5e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ecb0acd..083e52f 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 _0x2781=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','/:id','update','delete','exports','multer','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2781,0xe4));var _0x1278=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x2781[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x1278('0x0'));var util=require(_0x1278('0x1'));var path=require(_0x1278('0x2'));var timeout=require(_0x1278('0x3'));var express=require(_0x1278('0x4'));var router=express[_0x1278('0x5')]();var fs_extra=require(_0x1278('0x6'));var auth=require(_0x1278('0x7'));var interaction=require(_0x1278('0x8'));var config=require(_0x1278('0x9'));var controller=require('./intDynamics365Configuration.controller');router[_0x1278('0xa')]('/',auth[_0x1278('0xb')](),controller['index']);router[_0x1278('0xa')]('/:id',auth[_0x1278('0xb')](),controller[_0x1278('0xc')]);router['get'](_0x1278('0xd'),auth[_0x1278('0xb')](),controller[_0x1278('0xe')]);router[_0x1278('0xa')](_0x1278('0xf'),auth[_0x1278('0xb')](),controller[_0x1278('0x10')]);router['get'](_0x1278('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x1278('0xb')](),controller[_0x1278('0x12')]);router['put'](_0x1278('0x13'),auth[_0x1278('0xb')](),controller[_0x1278('0x14')]);router[_0x1278('0x15')](_0x1278('0x13'),auth[_0x1278('0xb')](),controller['destroy']);module[_0x1278('0x16')]=router; \ No newline at end of file +var _0xf274=['./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3024f1,_0x21413a){var _0x39ea83=function(_0x3b11a7){while(--_0x3b11a7){_0x3024f1['push'](_0x3024f1['shift']());}};_0x39ea83(++_0x21413a);}(_0xf274,0x99));var _0x4f27=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xf274[_0x819464];return _0x49dcc0;};'use strict';var multer=require('multer');var util=require(_0x4f27('0x0'));var path=require(_0x4f27('0x1'));var timeout=require(_0x4f27('0x2'));var express=require(_0x4f27('0x3'));var router=express[_0x4f27('0x4')]();var fs_extra=require(_0x4f27('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4f27('0x6'));var config=require(_0x4f27('0x7'));var controller=require(_0x4f27('0x8'));router[_0x4f27('0x9')]('/',auth[_0x4f27('0xa')](),controller['index']);router[_0x4f27('0x9')](_0x4f27('0xb'),auth[_0x4f27('0xa')](),controller[_0x4f27('0xc')]);router[_0x4f27('0x9')](_0x4f27('0xd'),auth[_0x4f27('0xa')](),controller['getFields']);router['get'](_0x4f27('0xe'),auth[_0x4f27('0xa')](),controller['getSubjects']);router[_0x4f27('0x9')](_0x4f27('0xf'),auth[_0x4f27('0xa')](),controller[_0x4f27('0x10')]);router['post']('/',auth[_0x4f27('0xa')](),controller[_0x4f27('0x11')]);router[_0x4f27('0x12')]('/:id',auth[_0x4f27('0xa')](),controller[_0x4f27('0x13')]);router[_0x4f27('0x14')](_0x4f27('0xb'),auth[_0x4f27('0xa')](),controller[_0x4f27('0x15')]);module[_0x4f27('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 22dec34..297fa8f 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 _0x4ac6=['incident','exports','STRING','ENUM','phonecall'];(function(_0x74797,_0x20546b){var _0x134aa3=function(_0x45eca2){while(--_0x45eca2){_0x74797['push'](_0x74797['shift']());}};_0x134aa3(++_0x20546b);}(_0x4ac6,0x10f));var _0x64ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ac6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x64ac('0x0')]={'name':{'type':Sequelize[_0x64ac('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x64ac('0x2')]('incident',_0x64ac('0x3')),'defaultValue':_0x64ac('0x4')}}; \ No newline at end of file +var _0x00a7=['exports','STRING','ENUM','incident'];(function(_0x10cb6f,_0x3f8276){var _0x2ac9c0=function(_0xf57e39){while(--_0xf57e39){_0x10cb6f['push'](_0x10cb6f['shift']());}};_0x2ac9c0(++_0x3f8276);}(_0x00a7,0xd4));var _0x700a=function(_0xa11e23,_0x46b85f){_0xa11e23=_0xa11e23-0x0;var _0x121913=_0x00a7[_0xa11e23];return _0x121913;};'use strict';var Sequelize=require('sequelize');module[_0x700a('0x0')]={'name':{'type':Sequelize[_0x700a('0x1')]},'description':{'type':Sequelize[_0x700a('0x1')]},'ticketType':{'type':Sequelize[_0x700a('0x2')](_0x700a('0x3'),'phonecall'),'defaultValue':_0x700a('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 752f9ad..3759ddd 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 _0x8d2d=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','Dynamics365Configuration','update','body','getFields','findOne','getSubjects','Dynamics365Field','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes'];(function(_0x348c50,_0x5a99bb){var _0x39dd7b=function(_0x54988f){while(--_0x54988f){_0x348c50['push'](_0x348c50['shift']());}};_0x39dd7b(++_0x5a99bb);}(_0x8d2d,0x1f1));var _0xd8d2=function(_0x493b88,_0x557689){_0x493b88=_0x493b88-0x0;var _0x32fb0f=_0x8d2d[_0x493b88];return _0x32fb0f;};'use strict';var emlformat=require(_0xd8d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd8d2('0x1'));var rp=require(_0xd8d2('0x2'));var moment=require(_0xd8d2('0x3'));var BPromise=require(_0xd8d2('0x4'));var Mustache=require(_0xd8d2('0x5'));var util=require(_0xd8d2('0x6'));var path=require(_0xd8d2('0x7'));var sox=require(_0xd8d2('0x8'));var csv=require(_0xd8d2('0x9'));var ejs=require(_0xd8d2('0xa'));var fs=require('fs');var fs_extra=require(_0xd8d2('0xb'));var _=require(_0xd8d2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd8d2('0xd'));var toCsv=require(_0xd8d2('0x9'));var querystring=require('querystring');var Papa=require(_0xd8d2('0xe'));var Redis=require('ioredis');var authService=require(_0xd8d2('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8d2('0x10'));var logger=require(_0xd8d2('0x11'))('api');var utils=require(_0xd8d2('0x12'));var config=require(_0xd8d2('0x13'));var licenseUtil=require(_0xd8d2('0x14'));var db=require(_0xd8d2('0x15'))['db'];function respondWithStatusCode(_0x54d593,_0x3ff867){_0x3ff867=_0x3ff867||0xcc;return function(_0x50fe9a){if(_0x50fe9a){return _0x54d593['sendStatus'](_0x3ff867);}return _0x54d593[_0xd8d2('0x16')](_0x3ff867)[_0xd8d2('0x17')]();};}function respondWithResult(_0x45b031,_0x11d980){_0x11d980=_0x11d980||0xc8;return function(_0x5a300d){if(_0x5a300d){return _0x45b031[_0xd8d2('0x16')](_0x11d980)[_0xd8d2('0x18')](_0x5a300d);}};}function respondWithFilteredResult(_0x38ab34,_0x5dc9da){return function(_0x28d7a1){if(_0x28d7a1){var _0x5e786e=typeof _0x5dc9da[_0xd8d2('0x19')]===_0xd8d2('0x1a')&&typeof _0x5dc9da['limit']===_0xd8d2('0x1a');var _0x2f19d2=_0x28d7a1[_0xd8d2('0x1b')];var _0x2f280f=_0x5e786e?0x0:_0x5dc9da[_0xd8d2('0x19')];var _0x42e93b=_0x5e786e?_0x28d7a1['count']:_0x5dc9da[_0xd8d2('0x19')]+_0x5dc9da[_0xd8d2('0x1c')];var _0x4620fd;if(_0x42e93b>=_0x2f19d2){_0x42e93b=_0x2f19d2;_0x4620fd=0xc8;}else{_0x4620fd=0xce;}_0x38ab34[_0xd8d2('0x16')](_0x4620fd);return _0x38ab34[_0xd8d2('0x1d')](_0xd8d2('0x1e'),_0x2f280f+'-'+_0x42e93b+'/'+_0x2f19d2)[_0xd8d2('0x18')](_0x28d7a1);}return null;};}function patchUpdates(_0x198fc5){return function(_0x4e4937){try{jsonpatch[_0xd8d2('0x1f')](_0x4e4937,_0x198fc5,!![]);}catch(_0x28c34a){return BPromise['reject'](_0x28c34a);}return _0x4e4937['save']();};}function saveUpdates(_0x34131b,_0x253008){return function(_0x4bd345){if(_0x4bd345){return _0x4bd345['update'](_0x34131b)[_0xd8d2('0x20')](function(_0x5e2f60){return _0x5e2f60;});}return null;};}function removeEntity(_0x4e5f63,_0x12941b){return function(_0xb2c4ed){if(_0xb2c4ed){return _0xb2c4ed[_0xd8d2('0x21')]()[_0xd8d2('0x20')](function(){_0x4e5f63[_0xd8d2('0x16')](0xcc)[_0xd8d2('0x17')]();});}};}function handleEntityNotFound(_0x5acf41,_0x7d9807){return function(_0x422804){if(!_0x422804){_0x5acf41[_0xd8d2('0x22')](0x194);}return _0x422804;};}function handleError(_0x365891,_0x53dc76){_0x53dc76=_0x53dc76||0x1f4;return function(_0x36eedc){logger[_0xd8d2('0x23')](_0x36eedc[_0xd8d2('0x24')]);if(_0x36eedc['name']){delete _0x36eedc[_0xd8d2('0x25')];}_0x365891[_0xd8d2('0x16')](_0x53dc76)[_0xd8d2('0x26')](_0x36eedc);};}exports[_0xd8d2('0x27')]=function(_0x206ed3,_0x227edf){var _0x5c6643={},_0x1c48c6={},_0x3c50df={'count':0x0,'rows':[]};var _0x3303ca=_['map'](db['Dynamics365Configuration'][_0xd8d2('0x28')],function(_0x1835e0){return{'name':_0x1835e0['fieldName'],'type':_0x1835e0[_0xd8d2('0x29')][_0xd8d2('0x2a')]};});_0x1c48c6['model']=_[_0xd8d2('0x2b')](_0x3303ca,_0xd8d2('0x25'));_0x1c48c6[_0xd8d2('0x2c')]=_['keys'](_0x206ed3[_0xd8d2('0x2c')]);_0x1c48c6[_0xd8d2('0x2d')]=_[_0xd8d2('0x2e')](_0x1c48c6[_0xd8d2('0x2f')],_0x1c48c6[_0xd8d2('0x2c')]);_0x5c6643[_0xd8d2('0x30')]=_[_0xd8d2('0x2e')](_0x1c48c6[_0xd8d2('0x2f')],qs[_0xd8d2('0x31')](_0x206ed3[_0xd8d2('0x2c')][_0xd8d2('0x31')]));_0x5c6643['attributes']=_0x5c6643[_0xd8d2('0x30')][_0xd8d2('0x32')]?_0x5c6643[_0xd8d2('0x30')]:_0x1c48c6[_0xd8d2('0x2f')];if(!_0x206ed3[_0xd8d2('0x2c')][_0xd8d2('0x33')](_0xd8d2('0x34'))){_0x5c6643['limit']=qs[_0xd8d2('0x1c')](_0x206ed3[_0xd8d2('0x2c')][_0xd8d2('0x1c')]);_0x5c6643[_0xd8d2('0x19')]=qs[_0xd8d2('0x19')](_0x206ed3['query'][_0xd8d2('0x19')]);}_0x5c6643[_0xd8d2('0x35')]=qs[_0xd8d2('0x36')](_0x206ed3['query']['sort']);_0x5c6643[_0xd8d2('0x37')]=qs[_0xd8d2('0x2d')](_[_0xd8d2('0x38')](_0x206ed3[_0xd8d2('0x2c')],_0x1c48c6[_0xd8d2('0x2d')]),_0x3303ca);if(_0x206ed3[_0xd8d2('0x2c')][_0xd8d2('0x39')]){_0x5c6643['where']=_[_0xd8d2('0x3a')](_0x5c6643['where'],{'$or':_[_0xd8d2('0x2b')](_0x3303ca,function(_0x441753){if(_0x441753[_0xd8d2('0x29')]!==_0xd8d2('0x3b')){var _0x14e7dd={};_0x14e7dd[_0x441753[_0xd8d2('0x25')]]={'$like':'%'+_0x206ed3[_0xd8d2('0x2c')][_0xd8d2('0x39')]+'%'};return _0x14e7dd;}})});}_0x5c6643=_[_0xd8d2('0x3a')]({},_0x5c6643,_0x206ed3[_0xd8d2('0x3c')]);var _0x59da00={'where':_0x5c6643[_0xd8d2('0x37')]};return db['Dynamics365Configuration'][_0xd8d2('0x1b')](_0x59da00)[_0xd8d2('0x20')](function(_0x4c09e4){_0x3c50df['count']=_0x4c09e4;if(_0x206ed3['query'][_0xd8d2('0x3d')]){_0x5c6643[_0xd8d2('0x3e')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xd8d2('0x3f')](_0x5c6643);})[_0xd8d2('0x20')](function(_0x4223fa){_0x3c50df[_0xd8d2('0x40')]=_0x4223fa;return _0x3c50df;})[_0xd8d2('0x20')](respondWithFilteredResult(_0x227edf,_0x5c6643))[_0xd8d2('0x41')](handleError(_0x227edf,null));};exports['show']=function(_0x813483,_0xb9e8be){var _0x106e33={'raw':![],'where':{'id':_0x813483[_0xd8d2('0x42')]['id']}},_0x172222={};_0x172222[_0xd8d2('0x2f')]=_[_0xd8d2('0x43')](db['Dynamics365Configuration'][_0xd8d2('0x28')]);_0x172222[_0xd8d2('0x2c')]=_[_0xd8d2('0x43')](_0x813483['query']);_0x172222[_0xd8d2('0x2d')]=_[_0xd8d2('0x2e')](_0x172222[_0xd8d2('0x2f')],_0x172222[_0xd8d2('0x2c')]);_0x106e33['attributes']=_['intersection'](_0x172222[_0xd8d2('0x2f')],qs[_0xd8d2('0x31')](_0x813483['query'][_0xd8d2('0x31')]));_0x106e33[_0xd8d2('0x30')]=_0x106e33['attributes'][_0xd8d2('0x32')]?_0x106e33['attributes']:_0x172222[_0xd8d2('0x2f')];if(_0x813483[_0xd8d2('0x2c')][_0xd8d2('0x3d')]){_0x106e33['include']=[{'all':!![]}];}_0x106e33=_[_0xd8d2('0x3a')]({},_0x106e33,_0x813483['options']);return db['Dynamics365Configuration'][_0xd8d2('0x44')](_0x106e33)[_0xd8d2('0x20')](handleEntityNotFound(_0xb9e8be,null))['then'](respondWithResult(_0xb9e8be,null))['catch'](handleError(_0xb9e8be,null));};exports[_0xd8d2('0x45')]=function(_0x4ff105,_0x6aba84){return db[_0xd8d2('0x46')][_0xd8d2('0x45')](_0x4ff105['body'],{})[_0xd8d2('0x20')](respondWithResult(_0x6aba84,0xc9))[_0xd8d2('0x41')](handleError(_0x6aba84,null));};exports[_0xd8d2('0x47')]=function(_0x4b700c,_0x29076b){if(_0x4b700c[_0xd8d2('0x48')]['id']){delete _0x4b700c['body']['id'];}return db[_0xd8d2('0x46')][_0xd8d2('0x44')]({'where':{'id':_0x4b700c[_0xd8d2('0x42')]['id']}})[_0xd8d2('0x20')](handleEntityNotFound(_0x29076b,null))[_0xd8d2('0x20')](saveUpdates(_0x4b700c[_0xd8d2('0x48')],null))['then'](respondWithResult(_0x29076b,null))['catch'](handleError(_0x29076b,null));};exports[_0xd8d2('0x21')]=function(_0x1c75f7,_0x1e191d){return db['Dynamics365Configuration'][_0xd8d2('0x44')]({'where':{'id':_0x1c75f7[_0xd8d2('0x42')]['id']}})[_0xd8d2('0x20')](handleEntityNotFound(_0x1e191d,null))[_0xd8d2('0x20')](removeEntity(_0x1e191d,null))[_0xd8d2('0x41')](handleError(_0x1e191d,null));};exports[_0xd8d2('0x49')]=function(_0x48dfcb,_0x15dba9,_0x556dad){var _0x3f764c={};var _0x161d09={};var _0x3c5f75;var _0x2d9de6;return db[_0xd8d2('0x46')][_0xd8d2('0x4a')]({'where':{'id':_0x48dfcb[_0xd8d2('0x42')]['id']}})[_0xd8d2('0x20')](handleEntityNotFound(_0x15dba9,null))[_0xd8d2('0x20')](function(_0x4dc658){if(_0x4dc658){_0x3c5f75=_0x4dc658;_0x161d09[_0xd8d2('0x2f')]=_[_0xd8d2('0x43')](db['Dynamics365Field'][_0xd8d2('0x28')]);_0x161d09[_0xd8d2('0x2c')]=_['keys'](_0x48dfcb['query']);_0x161d09['filters']=_[_0xd8d2('0x2e')](_0x161d09[_0xd8d2('0x2f')],_0x161d09[_0xd8d2('0x2c')]);_0x3f764c['attributes']=_[_0xd8d2('0x2e')](_0x161d09['model'],qs[_0xd8d2('0x31')](_0x48dfcb[_0xd8d2('0x2c')][_0xd8d2('0x31')]));_0x3f764c[_0xd8d2('0x30')]=_0x3f764c[_0xd8d2('0x30')][_0xd8d2('0x32')]?_0x3f764c['attributes']:_0x161d09[_0xd8d2('0x2f')];_0x3f764c[_0xd8d2('0x35')]=qs[_0xd8d2('0x36')](_0x48dfcb[_0xd8d2('0x2c')][_0xd8d2('0x36')]);_0x3f764c[_0xd8d2('0x37')]=qs[_0xd8d2('0x2d')](_[_0xd8d2('0x38')](_0x48dfcb[_0xd8d2('0x2c')],_0x161d09['filters']));if(_0x48dfcb[_0xd8d2('0x2c')][_0xd8d2('0x39')]){_0x3f764c[_0xd8d2('0x37')]=_[_0xd8d2('0x3a')](_0x3f764c['where'],{'$or':_['map'](_0x3f764c[_0xd8d2('0x30')],function(_0x52298d){var _0x4773cf={};_0x4773cf[_0x52298d]={'$like':'%'+_0x48dfcb[_0xd8d2('0x2c')][_0xd8d2('0x39')]+'%'};return _0x4773cf;})});}_0x3f764c=_[_0xd8d2('0x3a')]({},_0x3f764c,_0x48dfcb[_0xd8d2('0x3c')]);return _0x3c5f75[_0xd8d2('0x49')](_0x3f764c);}})[_0xd8d2('0x20')](function(_0x45e6a7){if(_0x45e6a7){_0x2d9de6=_0x45e6a7[_0xd8d2('0x32')];if(!_0x48dfcb['query'][_0xd8d2('0x33')](_0xd8d2('0x34'))){_0x3f764c[_0xd8d2('0x1c')]=qs[_0xd8d2('0x1c')](_0x48dfcb[_0xd8d2('0x2c')][_0xd8d2('0x1c')]);_0x3f764c[_0xd8d2('0x19')]=qs[_0xd8d2('0x19')](_0x48dfcb[_0xd8d2('0x2c')]['offset']);}return _0x3c5f75[_0xd8d2('0x49')](_0x3f764c);}})['then'](function(_0x3a20f0){if(_0x3a20f0){return _0x3a20f0?{'count':_0x2d9de6,'rows':_0x3a20f0}:null;}})[_0xd8d2('0x20')](respondWithResult(_0x15dba9,null))[_0xd8d2('0x41')](handleError(_0x15dba9,null));};exports[_0xd8d2('0x4b')]=function(_0x436d09,_0x16e978,_0x30b12d){var _0x975ec6={};var _0x898107={};var _0x785fa2;var _0x5c9688;return db[_0xd8d2('0x46')][_0xd8d2('0x4a')]({'where':{'id':_0x436d09[_0xd8d2('0x42')]['id']}})['then'](handleEntityNotFound(_0x16e978,null))[_0xd8d2('0x20')](function(_0xc44a36){if(_0xc44a36){_0x785fa2=_0xc44a36;_0x898107[_0xd8d2('0x2f')]=_[_0xd8d2('0x43')](db[_0xd8d2('0x4c')][_0xd8d2('0x28')]);_0x898107[_0xd8d2('0x2c')]=_[_0xd8d2('0x43')](_0x436d09[_0xd8d2('0x2c')]);_0x898107[_0xd8d2('0x2d')]=_['intersection'](_0x898107[_0xd8d2('0x2f')],_0x898107[_0xd8d2('0x2c')]);_0x975ec6[_0xd8d2('0x30')]=_[_0xd8d2('0x2e')](_0x898107[_0xd8d2('0x2f')],qs[_0xd8d2('0x31')](_0x436d09[_0xd8d2('0x2c')][_0xd8d2('0x31')]));_0x975ec6[_0xd8d2('0x30')]=_0x975ec6[_0xd8d2('0x30')]['length']?_0x975ec6[_0xd8d2('0x30')]:_0x898107[_0xd8d2('0x2f')];_0x975ec6[_0xd8d2('0x35')]=qs[_0xd8d2('0x36')](_0x436d09[_0xd8d2('0x2c')][_0xd8d2('0x36')]);_0x975ec6['where']=qs['filters'](_[_0xd8d2('0x38')](_0x436d09[_0xd8d2('0x2c')],_0x898107[_0xd8d2('0x2d')]));if(_0x436d09[_0xd8d2('0x2c')]['filter']){_0x975ec6['where']=_[_0xd8d2('0x3a')](_0x975ec6[_0xd8d2('0x37')],{'$or':_[_0xd8d2('0x2b')](_0x975ec6[_0xd8d2('0x30')],function(_0x576cfe){var _0x33b2e9={};_0x33b2e9[_0x576cfe]={'$like':'%'+_0x436d09[_0xd8d2('0x2c')]['filter']+'%'};return _0x33b2e9;})});}_0x975ec6=_['merge']({},_0x975ec6,_0x436d09[_0xd8d2('0x3c')]);return _0x785fa2[_0xd8d2('0x4b')](_0x975ec6);}})[_0xd8d2('0x20')](function(_0x11fd69){if(_0x11fd69){_0x5c9688=_0x11fd69[_0xd8d2('0x32')];if(!_0x436d09['query'][_0xd8d2('0x33')](_0xd8d2('0x34'))){_0x975ec6[_0xd8d2('0x1c')]=qs['limit'](_0x436d09[_0xd8d2('0x2c')][_0xd8d2('0x1c')]);_0x975ec6[_0xd8d2('0x19')]=qs[_0xd8d2('0x19')](_0x436d09['query'][_0xd8d2('0x19')]);}return _0x785fa2[_0xd8d2('0x4b')](_0x975ec6);}})[_0xd8d2('0x20')](function(_0x23414a){if(_0x23414a){return _0x23414a?{'count':_0x5c9688,'rows':_0x23414a}:null;}})[_0xd8d2('0x20')](respondWithResult(_0x16e978,null))['catch'](handleError(_0x16e978,null));};exports[_0xd8d2('0x4d')]=function(_0x5aab6f,_0x4c22ce,_0x5a7b0a){var _0x34b1e5={};var _0x1d69bf={};var _0xd24b2;var _0x550102;return db['Dynamics365Configuration'][_0xd8d2('0x4a')]({'where':{'id':_0x5aab6f[_0xd8d2('0x42')]['id']}})[_0xd8d2('0x20')](handleEntityNotFound(_0x4c22ce,null))['then'](function(_0x43b175){if(_0x43b175){_0xd24b2=_0x43b175;_0x1d69bf[_0xd8d2('0x2f')]=_[_0xd8d2('0x43')](db['Dynamics365Field'][_0xd8d2('0x28')]);_0x1d69bf[_0xd8d2('0x2c')]=_[_0xd8d2('0x43')](_0x5aab6f[_0xd8d2('0x2c')]);_0x1d69bf[_0xd8d2('0x2d')]=_[_0xd8d2('0x2e')](_0x1d69bf[_0xd8d2('0x2f')],_0x1d69bf['query']);_0x34b1e5['attributes']=_[_0xd8d2('0x2e')](_0x1d69bf[_0xd8d2('0x2f')],qs[_0xd8d2('0x31')](_0x5aab6f[_0xd8d2('0x2c')][_0xd8d2('0x31')]));_0x34b1e5['attributes']=_0x34b1e5['attributes'][_0xd8d2('0x32')]?_0x34b1e5['attributes']:_0x1d69bf[_0xd8d2('0x2f')];_0x34b1e5[_0xd8d2('0x35')]=qs[_0xd8d2('0x36')](_0x5aab6f[_0xd8d2('0x2c')][_0xd8d2('0x36')]);_0x34b1e5[_0xd8d2('0x37')]=qs[_0xd8d2('0x2d')](_[_0xd8d2('0x38')](_0x5aab6f[_0xd8d2('0x2c')],_0x1d69bf[_0xd8d2('0x2d')]));if(_0x5aab6f[_0xd8d2('0x2c')][_0xd8d2('0x39')]){_0x34b1e5[_0xd8d2('0x37')]=_[_0xd8d2('0x3a')](_0x34b1e5[_0xd8d2('0x37')],{'$or':_[_0xd8d2('0x2b')](_0x34b1e5[_0xd8d2('0x30')],function(_0x4d6ec0){var _0x572628={};_0x572628[_0x4d6ec0]={'$like':'%'+_0x5aab6f[_0xd8d2('0x2c')][_0xd8d2('0x39')]+'%'};return _0x572628;})});}_0x34b1e5=_['merge']({},_0x34b1e5,_0x5aab6f[_0xd8d2('0x3c')]);return _0xd24b2['getDescriptions'](_0x34b1e5);}})[_0xd8d2('0x20')](function(_0x2e5610){if(_0x2e5610){_0x550102=_0x2e5610[_0xd8d2('0x32')];if(!_0x5aab6f[_0xd8d2('0x2c')][_0xd8d2('0x33')](_0xd8d2('0x34'))){_0x34b1e5['limit']=qs[_0xd8d2('0x1c')](_0x5aab6f[_0xd8d2('0x2c')]['limit']);_0x34b1e5['offset']=qs[_0xd8d2('0x19')](_0x5aab6f[_0xd8d2('0x2c')][_0xd8d2('0x19')]);}return _0xd24b2['getDescriptions'](_0x34b1e5);}})[_0xd8d2('0x20')](function(_0x48370c){if(_0x48370c){return _0x48370c?{'count':_0x550102,'rows':_0x48370c}:null;}})[_0xd8d2('0x20')](respondWithResult(_0x4c22ce,null))[_0xd8d2('0x41')](handleError(_0x4c22ce,null));}; \ No newline at end of file +var _0x61f5=['find','create','body','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','Dynamics365Configuration','findAll','rows','catch','show','params','includeAll'];(function(_0x52decd,_0xfdbb1a){var _0x95b46e=function(_0x398e45){while(--_0x398e45){_0x52decd['push'](_0x52decd['shift']());}};_0x95b46e(++_0xfdbb1a);}(_0x61f5,0xf9));var _0x561f=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x61f5[_0x1fdb40];return _0x281f93;};'use strict';var emlformat=require(_0x561f('0x0'));var rimraf=require(_0x561f('0x1'));var zipdir=require(_0x561f('0x2'));var jsonpatch=require(_0x561f('0x3'));var rp=require(_0x561f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x561f('0x5'));var util=require(_0x561f('0x6'));var path=require(_0x561f('0x7'));var sox=require(_0x561f('0x8'));var csv=require(_0x561f('0x9'));var ejs=require(_0x561f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x561f('0xb'));var squel=require(_0x561f('0xc'));var crypto=require(_0x561f('0xd'));var jsforce=require(_0x561f('0xe'));var deskjs=require(_0x561f('0xf'));var toCsv=require(_0x561f('0x9'));var querystring=require(_0x561f('0x10'));var Papa=require(_0x561f('0x11'));var Redis=require(_0x561f('0x12'));var authService=require(_0x561f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x561f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x561f('0x15'));var utils=require('../../config/utils');var config=require(_0x561f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40a30d,_0x3df47d){_0x3df47d=_0x3df47d||0xcc;return function(_0x33ff57){if(_0x33ff57){return _0x40a30d[_0x561f('0x17')](_0x3df47d);}return _0x40a30d['status'](_0x3df47d)[_0x561f('0x18')]();};}function respondWithResult(_0x54b6a2,_0x4c6f29){_0x4c6f29=_0x4c6f29||0xc8;return function(_0xf4f43){if(_0xf4f43){return _0x54b6a2[_0x561f('0x19')](_0x4c6f29)[_0x561f('0x1a')](_0xf4f43);}};}function respondWithFilteredResult(_0x32e14c,_0x42f1bd){return function(_0x13e214){if(_0x13e214){var _0x1e4928=typeof _0x42f1bd[_0x561f('0x1b')]===_0x561f('0x1c')&&typeof _0x42f1bd[_0x561f('0x1d')]===_0x561f('0x1c');var _0x46fe88=_0x13e214[_0x561f('0x1e')];var _0x1090a4=_0x1e4928?0x0:_0x42f1bd['offset'];var _0x57dfbd=_0x1e4928?_0x13e214[_0x561f('0x1e')]:_0x42f1bd[_0x561f('0x1b')]+_0x42f1bd['limit'];var _0x35965e;if(_0x57dfbd>=_0x46fe88){_0x57dfbd=_0x46fe88;_0x35965e=0xc8;}else{_0x35965e=0xce;}_0x32e14c['status'](_0x35965e);return _0x32e14c['set'](_0x561f('0x1f'),_0x1090a4+'-'+_0x57dfbd+'/'+_0x46fe88)[_0x561f('0x1a')](_0x13e214);}return null;};}function patchUpdates(_0xce428e){return function(_0x28fa47){try{jsonpatch[_0x561f('0x20')](_0x28fa47,_0xce428e,!![]);}catch(_0x50b0ed){return BPromise[_0x561f('0x21')](_0x50b0ed);}return _0x28fa47[_0x561f('0x22')]();};}function saveUpdates(_0x1faaef,_0x559798){return function(_0x5f5280){if(_0x5f5280){return _0x5f5280[_0x561f('0x23')](_0x1faaef)[_0x561f('0x24')](function(_0x238c93){return _0x238c93;});}return null;};}function removeEntity(_0x45b8df,_0x3ef4f5){return function(_0x5196b4){if(_0x5196b4){return _0x5196b4[_0x561f('0x25')]()[_0x561f('0x24')](function(){_0x45b8df[_0x561f('0x19')](0xcc)[_0x561f('0x18')]();});}};}function handleEntityNotFound(_0x8fd78f,_0x48e164){return function(_0x219d70){if(!_0x219d70){_0x8fd78f[_0x561f('0x17')](0x194);}return _0x219d70;};}function handleError(_0xf74c60,_0xc65687){_0xc65687=_0xc65687||0x1f4;return function(_0x497d05){logger[_0x561f('0x26')](_0x497d05[_0x561f('0x27')]);if(_0x497d05['name']){delete _0x497d05[_0x561f('0x28')];}_0xf74c60['status'](_0xc65687)[_0x561f('0x29')](_0x497d05);};}exports['index']=function(_0x433f21,_0x379679){var _0x5063a5={},_0x480e11={},_0x2c6cd0={'count':0x0,'rows':[]};var _0x1afe71=_[_0x561f('0x2a')](db['Dynamics365Configuration'][_0x561f('0x2b')],function(_0x4063e4){return{'name':_0x4063e4[_0x561f('0x2c')],'type':_0x4063e4[_0x561f('0x2d')][_0x561f('0x2e')]};});_0x480e11[_0x561f('0x2f')]=_[_0x561f('0x2a')](_0x1afe71,_0x561f('0x28'));_0x480e11['query']=_[_0x561f('0x30')](_0x433f21[_0x561f('0x31')]);_0x480e11['filters']=_[_0x561f('0x32')](_0x480e11[_0x561f('0x2f')],_0x480e11[_0x561f('0x31')]);_0x5063a5[_0x561f('0x33')]=_[_0x561f('0x32')](_0x480e11[_0x561f('0x2f')],qs[_0x561f('0x34')](_0x433f21[_0x561f('0x31')][_0x561f('0x34')]));_0x5063a5[_0x561f('0x33')]=_0x5063a5[_0x561f('0x33')][_0x561f('0x35')]?_0x5063a5[_0x561f('0x33')]:_0x480e11[_0x561f('0x2f')];if(!_0x433f21[_0x561f('0x31')][_0x561f('0x36')](_0x561f('0x37'))){_0x5063a5['limit']=qs[_0x561f('0x1d')](_0x433f21[_0x561f('0x31')][_0x561f('0x1d')]);_0x5063a5['offset']=qs['offset'](_0x433f21['query']['offset']);}_0x5063a5[_0x561f('0x38')]=qs[_0x561f('0x39')](_0x433f21[_0x561f('0x31')][_0x561f('0x39')]);_0x5063a5['where']=qs[_0x561f('0x3a')](_['pick'](_0x433f21[_0x561f('0x31')],_0x480e11[_0x561f('0x3a')]),_0x1afe71);if(_0x433f21[_0x561f('0x31')][_0x561f('0x3b')]){_0x5063a5['where']=_['merge'](_0x5063a5[_0x561f('0x3c')],{'$or':_[_0x561f('0x2a')](_0x1afe71,function(_0x5b2736){if(_0x5b2736[_0x561f('0x2d')]!==_0x561f('0x3d')){var _0x4f38ea={};_0x4f38ea[_0x5b2736['name']]={'$like':'%'+_0x433f21[_0x561f('0x31')][_0x561f('0x3b')]+'%'};return _0x4f38ea;}})});}_0x5063a5=_[_0x561f('0x3e')]({},_0x5063a5,_0x433f21[_0x561f('0x3f')]);var _0x53ba14={'where':_0x5063a5[_0x561f('0x3c')]};return db[_0x561f('0x40')][_0x561f('0x1e')](_0x53ba14)[_0x561f('0x24')](function(_0x4888c9){_0x2c6cd0[_0x561f('0x1e')]=_0x4888c9;if(_0x433f21['query']['includeAll']){_0x5063a5['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x561f('0x41')](_0x5063a5);})[_0x561f('0x24')](function(_0xfada0c){_0x2c6cd0[_0x561f('0x42')]=_0xfada0c;return _0x2c6cd0;})[_0x561f('0x24')](respondWithFilteredResult(_0x379679,_0x5063a5))[_0x561f('0x43')](handleError(_0x379679,null));};exports[_0x561f('0x44')]=function(_0x13ac90,_0x1c6fa9){var _0x4ab63a={'raw':![],'where':{'id':_0x13ac90[_0x561f('0x45')]['id']}},_0x1dbe7a={};_0x1dbe7a[_0x561f('0x2f')]=_['keys'](db[_0x561f('0x40')][_0x561f('0x2b')]);_0x1dbe7a[_0x561f('0x31')]=_[_0x561f('0x30')](_0x13ac90[_0x561f('0x31')]);_0x1dbe7a[_0x561f('0x3a')]=_[_0x561f('0x32')](_0x1dbe7a[_0x561f('0x2f')],_0x1dbe7a[_0x561f('0x31')]);_0x4ab63a[_0x561f('0x33')]=_[_0x561f('0x32')](_0x1dbe7a[_0x561f('0x2f')],qs[_0x561f('0x34')](_0x13ac90[_0x561f('0x31')][_0x561f('0x34')]));_0x4ab63a[_0x561f('0x33')]=_0x4ab63a[_0x561f('0x33')][_0x561f('0x35')]?_0x4ab63a[_0x561f('0x33')]:_0x1dbe7a[_0x561f('0x2f')];if(_0x13ac90[_0x561f('0x31')][_0x561f('0x46')]){_0x4ab63a['include']=[{'all':!![]}];}_0x4ab63a=_[_0x561f('0x3e')]({},_0x4ab63a,_0x13ac90[_0x561f('0x3f')]);return db['Dynamics365Configuration'][_0x561f('0x47')](_0x4ab63a)[_0x561f('0x24')](handleEntityNotFound(_0x1c6fa9,null))['then'](respondWithResult(_0x1c6fa9,null))[_0x561f('0x43')](handleError(_0x1c6fa9,null));};exports[_0x561f('0x48')]=function(_0x318d44,_0x5bb75e){return db['Dynamics365Configuration']['create'](_0x318d44[_0x561f('0x49')],{})[_0x561f('0x24')](respondWithResult(_0x5bb75e,0xc9))[_0x561f('0x43')](handleError(_0x5bb75e,null));};exports[_0x561f('0x23')]=function(_0x41a9bd,_0x54ac75){if(_0x41a9bd[_0x561f('0x49')]['id']){delete _0x41a9bd['body']['id'];}return db['Dynamics365Configuration'][_0x561f('0x47')]({'where':{'id':_0x41a9bd['params']['id']}})[_0x561f('0x24')](handleEntityNotFound(_0x54ac75,null))[_0x561f('0x24')](saveUpdates(_0x41a9bd[_0x561f('0x49')],null))[_0x561f('0x24')](respondWithResult(_0x54ac75,null))[_0x561f('0x43')](handleError(_0x54ac75,null));};exports[_0x561f('0x25')]=function(_0xdd137d,_0x491a3a){return db['Dynamics365Configuration']['find']({'where':{'id':_0xdd137d[_0x561f('0x45')]['id']}})['then'](handleEntityNotFound(_0x491a3a,null))[_0x561f('0x24')](removeEntity(_0x491a3a,null))['catch'](handleError(_0x491a3a,null));};exports[_0x561f('0x4a')]=function(_0x133f19,_0x15ed8a,_0x5d4438){var _0x3e0da3={};var _0x50db08={};var _0x2e11ca;var _0x1cc645;return db[_0x561f('0x40')][_0x561f('0x4b')]({'where':{'id':_0x133f19[_0x561f('0x45')]['id']}})[_0x561f('0x24')](handleEntityNotFound(_0x15ed8a,null))[_0x561f('0x24')](function(_0x4fb3e5){if(_0x4fb3e5){_0x2e11ca=_0x4fb3e5;_0x50db08[_0x561f('0x2f')]=_['keys'](db[_0x561f('0x4c')][_0x561f('0x2b')]);_0x50db08['query']=_[_0x561f('0x30')](_0x133f19[_0x561f('0x31')]);_0x50db08[_0x561f('0x3a')]=_[_0x561f('0x32')](_0x50db08[_0x561f('0x2f')],_0x50db08[_0x561f('0x31')]);_0x3e0da3[_0x561f('0x33')]=_[_0x561f('0x32')](_0x50db08[_0x561f('0x2f')],qs[_0x561f('0x34')](_0x133f19['query'][_0x561f('0x34')]));_0x3e0da3[_0x561f('0x33')]=_0x3e0da3[_0x561f('0x33')][_0x561f('0x35')]?_0x3e0da3[_0x561f('0x33')]:_0x50db08[_0x561f('0x2f')];_0x3e0da3[_0x561f('0x38')]=qs[_0x561f('0x39')](_0x133f19[_0x561f('0x31')][_0x561f('0x39')]);_0x3e0da3[_0x561f('0x3c')]=qs[_0x561f('0x3a')](_[_0x561f('0x4d')](_0x133f19[_0x561f('0x31')],_0x50db08['filters']));if(_0x133f19[_0x561f('0x31')][_0x561f('0x3b')]){_0x3e0da3[_0x561f('0x3c')]=_[_0x561f('0x3e')](_0x3e0da3[_0x561f('0x3c')],{'$or':_[_0x561f('0x2a')](_0x3e0da3[_0x561f('0x33')],function(_0x5a284a){var _0x2affe1={};_0x2affe1[_0x5a284a]={'$like':'%'+_0x133f19[_0x561f('0x31')][_0x561f('0x3b')]+'%'};return _0x2affe1;})});}_0x3e0da3=_[_0x561f('0x3e')]({},_0x3e0da3,_0x133f19[_0x561f('0x3f')]);return _0x2e11ca['getFields'](_0x3e0da3);}})[_0x561f('0x24')](function(_0x2b9d85){if(_0x2b9d85){_0x1cc645=_0x2b9d85[_0x561f('0x35')];if(!_0x133f19[_0x561f('0x31')]['hasOwnProperty'](_0x561f('0x37'))){_0x3e0da3[_0x561f('0x1d')]=qs[_0x561f('0x1d')](_0x133f19[_0x561f('0x31')][_0x561f('0x1d')]);_0x3e0da3['offset']=qs[_0x561f('0x1b')](_0x133f19[_0x561f('0x31')][_0x561f('0x1b')]);}return _0x2e11ca[_0x561f('0x4a')](_0x3e0da3);}})['then'](function(_0xb57343){if(_0xb57343){return _0xb57343?{'count':_0x1cc645,'rows':_0xb57343}:null;}})[_0x561f('0x24')](respondWithResult(_0x15ed8a,null))[_0x561f('0x43')](handleError(_0x15ed8a,null));};exports['getSubjects']=function(_0x59b3cc,_0x4f9a00,_0x4369c9){var _0x382d17={};var _0x2c0a83={};var _0x2c9d6c;var _0x32aaa4;return db[_0x561f('0x40')][_0x561f('0x4b')]({'where':{'id':_0x59b3cc['params']['id']}})[_0x561f('0x24')](handleEntityNotFound(_0x4f9a00,null))['then'](function(_0x22d615){if(_0x22d615){_0x2c9d6c=_0x22d615;_0x2c0a83[_0x561f('0x2f')]=_[_0x561f('0x30')](db[_0x561f('0x4c')][_0x561f('0x2b')]);_0x2c0a83[_0x561f('0x31')]=_[_0x561f('0x30')](_0x59b3cc[_0x561f('0x31')]);_0x2c0a83[_0x561f('0x3a')]=_[_0x561f('0x32')](_0x2c0a83['model'],_0x2c0a83['query']);_0x382d17[_0x561f('0x33')]=_['intersection'](_0x2c0a83[_0x561f('0x2f')],qs[_0x561f('0x34')](_0x59b3cc[_0x561f('0x31')]['fields']));_0x382d17[_0x561f('0x33')]=_0x382d17[_0x561f('0x33')][_0x561f('0x35')]?_0x382d17[_0x561f('0x33')]:_0x2c0a83['model'];_0x382d17['order']=qs['sort'](_0x59b3cc[_0x561f('0x31')][_0x561f('0x39')]);_0x382d17[_0x561f('0x3c')]=qs[_0x561f('0x3a')](_['pick'](_0x59b3cc[_0x561f('0x31')],_0x2c0a83['filters']));if(_0x59b3cc['query'][_0x561f('0x3b')]){_0x382d17[_0x561f('0x3c')]=_[_0x561f('0x3e')](_0x382d17['where'],{'$or':_[_0x561f('0x2a')](_0x382d17[_0x561f('0x33')],function(_0x4c12e2){var _0x677e32={};_0x677e32[_0x4c12e2]={'$like':'%'+_0x59b3cc[_0x561f('0x31')][_0x561f('0x3b')]+'%'};return _0x677e32;})});}_0x382d17=_['merge']({},_0x382d17,_0x59b3cc[_0x561f('0x3f')]);return _0x2c9d6c[_0x561f('0x4e')](_0x382d17);}})[_0x561f('0x24')](function(_0x4c8903){if(_0x4c8903){_0x32aaa4=_0x4c8903[_0x561f('0x35')];if(!_0x59b3cc[_0x561f('0x31')][_0x561f('0x36')]('nolimit')){_0x382d17[_0x561f('0x1d')]=qs[_0x561f('0x1d')](_0x59b3cc['query'][_0x561f('0x1d')]);_0x382d17[_0x561f('0x1b')]=qs[_0x561f('0x1b')](_0x59b3cc[_0x561f('0x31')][_0x561f('0x1b')]);}return _0x2c9d6c[_0x561f('0x4e')](_0x382d17);}})['then'](function(_0x48a339){if(_0x48a339){return _0x48a339?{'count':_0x32aaa4,'rows':_0x48a339}:null;}})[_0x561f('0x24')](respondWithResult(_0x4f9a00,null))[_0x561f('0x43')](handleError(_0x4f9a00,null));};exports[_0x561f('0x4f')]=function(_0x44f6cc,_0x509850,_0x41d562){var _0x190e07={};var _0x272518={};var _0x441714;var _0x19d666;return db[_0x561f('0x40')]['findOne']({'where':{'id':_0x44f6cc[_0x561f('0x45')]['id']}})[_0x561f('0x24')](handleEntityNotFound(_0x509850,null))[_0x561f('0x24')](function(_0x3220d7){if(_0x3220d7){_0x441714=_0x3220d7;_0x272518['model']=_['keys'](db[_0x561f('0x4c')]['rawAttributes']);_0x272518[_0x561f('0x31')]=_['keys'](_0x44f6cc[_0x561f('0x31')]);_0x272518[_0x561f('0x3a')]=_[_0x561f('0x32')](_0x272518[_0x561f('0x2f')],_0x272518['query']);_0x190e07[_0x561f('0x33')]=_['intersection'](_0x272518[_0x561f('0x2f')],qs['fields'](_0x44f6cc[_0x561f('0x31')]['fields']));_0x190e07[_0x561f('0x33')]=_0x190e07[_0x561f('0x33')][_0x561f('0x35')]?_0x190e07['attributes']:_0x272518['model'];_0x190e07[_0x561f('0x38')]=qs[_0x561f('0x39')](_0x44f6cc['query'][_0x561f('0x39')]);_0x190e07[_0x561f('0x3c')]=qs[_0x561f('0x3a')](_['pick'](_0x44f6cc['query'],_0x272518[_0x561f('0x3a')]));if(_0x44f6cc[_0x561f('0x31')][_0x561f('0x3b')]){_0x190e07[_0x561f('0x3c')]=_[_0x561f('0x3e')](_0x190e07[_0x561f('0x3c')],{'$or':_['map'](_0x190e07[_0x561f('0x33')],function(_0x49974b){var _0x27bf9a={};_0x27bf9a[_0x49974b]={'$like':'%'+_0x44f6cc[_0x561f('0x31')]['filter']+'%'};return _0x27bf9a;})});}_0x190e07=_[_0x561f('0x3e')]({},_0x190e07,_0x44f6cc[_0x561f('0x3f')]);return _0x441714['getDescriptions'](_0x190e07);}})['then'](function(_0x2e53b8){if(_0x2e53b8){_0x19d666=_0x2e53b8[_0x561f('0x35')];if(!_0x44f6cc[_0x561f('0x31')]['hasOwnProperty'](_0x561f('0x37'))){_0x190e07[_0x561f('0x1d')]=qs[_0x561f('0x1d')](_0x44f6cc[_0x561f('0x31')][_0x561f('0x1d')]);_0x190e07['offset']=qs[_0x561f('0x1b')](_0x44f6cc[_0x561f('0x31')][_0x561f('0x1b')]);}return _0x441714['getDescriptions'](_0x190e07);}})[_0x561f('0x24')](function(_0x4cd5dc){if(_0x4cd5dc){return _0x4cd5dc?{'count':_0x19d666,'rows':_0x4cd5dc}:null;}})[_0x561f('0x24')](respondWithResult(_0x509850,null))[_0x561f('0x43')](handleError(_0x509850,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 083e384..7aa89d7 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x488235,_0x54507e){var _0x454dfe=function(_0x220572){while(--_0x220572){_0x488235['push'](_0x488235['shift']());}};_0x454dfe(++_0x54507e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0xb4e6[_0x51b1a5];return _0x15c738;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x51dd90,_0x2675e4){var _0x38afee=function(_0x4e1cdf){while(--_0x4e1cdf){_0x51dd90['push'](_0x51dd90['shift']());}};_0x38afee(++_0x2675e4);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1afc3d,_0x33a114){_0x1afc3d=_0x1afc3d-0x0;var _0x3361bf=_0x8d0e[_0x1afc3d];return _0x3361bf;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'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 4ca5f26..b34d3b5 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 _0x6c8a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','info','result','catch','lodash'];(function(_0x5abf27,_0x49de30){var _0x18c44b=function(_0x21c8bc){while(--_0x21c8bc){_0x5abf27['push'](_0x5abf27['shift']());}};_0x18c44b(++_0x49de30);}(_0x6c8a,0x1b7));var _0xa6c8=function(_0x1a7851,_0x155255){_0x1a7851=_0x1a7851-0x0;var _0x23908e=_0x6c8a[_0x1a7851];return _0x23908e;};'use strict';var _=require(_0xa6c8('0x0'));var util=require(_0xa6c8('0x1'));var moment=require(_0xa6c8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6c8('0x3'));var fs=require('fs');var Redis=require(_0xa6c8('0x4'));var db=require(_0xa6c8('0x5'))['db'];var utils=require(_0xa6c8('0x6'));var logger=require(_0xa6c8('0x7'))(_0xa6c8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa6c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d9e8,_0x5232d1,_0x2eb752){return new BPromise(function(_0xd7aad4,_0xe5b8e6){return client['request'](_0x59d9e8,_0x2eb752)['then'](function(_0x30c7cf){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x5232d1,'request\x20sent');logger[_0xa6c8('0xa')](_0xa6c8('0xb'),_0x5232d1,_0xa6c8('0xc'),JSON['stringify'](_0x30c7cf));if(_0x30c7cf[_0xa6c8('0xd')]){if(_0x30c7cf[_0xa6c8('0xd')][_0xa6c8('0xe')]===0x1f4){logger[_0xa6c8('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5232d1,_0x30c7cf['error'][_0xa6c8('0xf')]);return _0xe5b8e6(_0x30c7cf[_0xa6c8('0xd')][_0xa6c8('0xf')]);}logger[_0xa6c8('0xd')](_0xa6c8('0x10'),_0x5232d1,_0x30c7cf[_0xa6c8('0xd')][_0xa6c8('0xf')]);return _0xd7aad4(_0x30c7cf[_0xa6c8('0xd')][_0xa6c8('0xf')]);}else{logger[_0xa6c8('0x11')](_0xa6c8('0x10'),_0x5232d1,_0xa6c8('0xc'));_0xd7aad4(_0x30c7cf[_0xa6c8('0x12')][_0xa6c8('0xf')]);}})[_0xa6c8('0x13')](function(_0x42d32b){logger['error'](_0xa6c8('0x10'),_0x5232d1,_0x42d32b);_0xe5b8e6(_0x42d32b);});});} \ No newline at end of file +var _0xfb6b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x584b87,_0x3542b8){var _0x3e7b7e=function(_0xe8964d){while(--_0xe8964d){_0x584b87['push'](_0x584b87['shift']());}};_0x3e7b7e(++_0x3542b8);}(_0xfb6b,0x1e1));var _0xbfb6=function(_0x5de892,_0x1f6740){_0x5de892=_0x5de892-0x0;var _0x458d1e=_0xfb6b[_0x5de892];return _0x458d1e;};'use strict';var _=require(_0xbfb6('0x0'));var util=require(_0xbfb6('0x1'));var moment=require(_0xbfb6('0x2'));var BPromise=require(_0xbfb6('0x3'));var rs=require(_0xbfb6('0x4'));var fs=require('fs');var Redis=require(_0xbfb6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfb6('0x6'));var logger=require('../../config/logger')(_0xbfb6('0x7'));var config=require(_0xbfb6('0x8'));var jayson=require(_0xbfb6('0x9'));var client=jayson[_0xbfb6('0xa')][_0xbfb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23483f,_0x26e6bb,_0x50c6eb){return new BPromise(function(_0x2181e9,_0x15b07c){return client[_0xbfb6('0xc')](_0x23483f,_0x50c6eb)[_0xbfb6('0xd')](function(_0x5f4cd8){logger['info'](_0xbfb6('0xe'),_0x26e6bb,_0xbfb6('0xf'));logger[_0xbfb6('0x10')](_0xbfb6('0x11'),_0x26e6bb,_0xbfb6('0xf'),JSON[_0xbfb6('0x12')](_0x5f4cd8));if(_0x5f4cd8[_0xbfb6('0x13')]){if(_0x5f4cd8[_0xbfb6('0x13')][_0xbfb6('0x14')]===0x1f4){logger['error'](_0xbfb6('0xe'),_0x26e6bb,_0x5f4cd8[_0xbfb6('0x13')][_0xbfb6('0x15')]);return _0x15b07c(_0x5f4cd8[_0xbfb6('0x13')]['message']);}logger['error'](_0xbfb6('0xe'),_0x26e6bb,_0x5f4cd8['error'][_0xbfb6('0x15')]);return _0x2181e9(_0x5f4cd8[_0xbfb6('0x13')][_0xbfb6('0x15')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x26e6bb,'request\x20sent');_0x2181e9(_0x5f4cd8[_0xbfb6('0x16')][_0xbfb6('0x15')]);}})[_0xbfb6('0x17')](function(_0x28a4a3){logger[_0xbfb6('0x13')](_0xbfb6('0xe'),_0x26e6bb,_0x28a4a3);_0x15b07c(_0x28a4a3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 689c373..72ae0e3 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 _0x4957=['isAuthenticated','get','/:id','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4957,0x13b));var _0x7495=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x4957[_0x2f9467];return _0x39894c;};'use strict';var multer=require(_0x7495('0x0'));var util=require('util');var path=require(_0x7495('0x1'));var timeout=require('connect-timeout');var express=require(_0x7495('0x2'));var router=express[_0x7495('0x3')]();var fs_extra=require(_0x7495('0x4'));var auth=require(_0x7495('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7495('0x6'));var controller=require(_0x7495('0x7'));router['get']('/',auth[_0x7495('0x8')](),controller['index']);router[_0x7495('0x9')](_0x7495('0xa'),auth[_0x7495('0x8')](),controller['show']);router['post']('/',auth[_0x7495('0x8')](),controller[_0x7495('0xb')]);router[_0x7495('0xc')](_0x7495('0xa'),auth['isAuthenticated'](),controller[_0x7495('0xd')]);router[_0x7495('0xe')]('/:id',auth[_0x7495('0x8')](),controller[_0x7495('0xf')]);module[_0x7495('0x10')]=router; \ No newline at end of file +var _0x0467=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','multer','util','path','express','Router','fs-extra'];(function(_0x1cdcab,_0x17a516){var _0x4393d0=function(_0x53b841){while(--_0x53b841){_0x1cdcab['push'](_0x1cdcab['shift']());}};_0x4393d0(++_0x17a516);}(_0x0467,0x92));var _0x7046=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0467[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7046('0x0'));var util=require(_0x7046('0x1'));var path=require(_0x7046('0x2'));var timeout=require('connect-timeout');var express=require(_0x7046('0x3'));var router=express[_0x7046('0x4')]();var fs_extra=require(_0x7046('0x5'));var auth=require(_0x7046('0x6'));var interaction=require(_0x7046('0x7'));var config=require(_0x7046('0x8'));var controller=require(_0x7046('0x9'));router[_0x7046('0xa')]('/',auth[_0x7046('0xb')](),controller[_0x7046('0xc')]);router[_0x7046('0xa')]('/:id',auth[_0x7046('0xb')](),controller[_0x7046('0xd')]);router[_0x7046('0xe')]('/',auth['isAuthenticated'](),controller[_0x7046('0xf')]);router[_0x7046('0x10')]('/:id',auth[_0x7046('0xb')](),controller[_0x7046('0x11')]);router['delete'](_0x7046('0x12'),auth[_0x7046('0xb')](),controller['destroy']);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 007816c..f034bfd 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 _0xa664=['customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x410669,_0x71ccd3){var _0x174320=function(_0x204b06){while(--_0x204b06){_0x410669['push'](_0x410669['shift']());}};_0x174320(++_0x71ccd3);}(_0xa664,0x150));var _0x4a66=function(_0x207d85,_0x2863cc){_0x207d85=_0x207d85-0x0;var _0x1e54a7=_0xa664[_0x207d85];return _0x1e54a7;};'use strict';var Sequelize=require(_0x4a66('0x0'));module[_0x4a66('0x1')]={'type':{'type':Sequelize[_0x4a66('0x2')]('string',_0x4a66('0x3'),_0x4a66('0x4'),_0x4a66('0x5'),_0x4a66('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4a66('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4a66('0x8'),_0x4a66('0x3'),_0x4a66('0x4'))},'keyContent':{'type':Sequelize[_0x4a66('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4a66('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4a66('0x7')]}}; \ No newline at end of file +var _0xe99e=['keyValue','picklist','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x29c7aa,_0x41c047){var _0x37cfb9=function(_0x37f5e2){while(--_0x37f5e2){_0x29c7aa['push'](_0x29c7aa['shift']());}};_0x37cfb9(++_0x41c047);}(_0xe99e,0x1a3));var _0xee99=function(_0x42d21c,_0x2d6ce3){_0x42d21c=_0x42d21c-0x0;var _0x51f398=_0xe99e[_0x42d21c];return _0x51f398;};'use strict';var Sequelize=require(_0xee99('0x0'));module['exports']={'type':{'type':Sequelize[_0xee99('0x1')](_0xee99('0x2'),_0xee99('0x3'),_0xee99('0x4'),_0xee99('0x5'),_0xee99('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xee99('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xee99('0x2'),_0xee99('0x3'),_0xee99('0x4'))},'keyContent':{'type':Sequelize[_0xee99('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xee99('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xee99('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index a3e447e..65abab6 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 _0x2e22=['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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','destroy','rimraf','bluebird'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x2e22,0x152));var _0x22e2=function(_0x3849ff,_0x4ae25e){_0x3849ff=_0x3849ff-0x0;var _0x3ab676=_0x2e22[_0x3849ff];return _0x3ab676;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22e2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x22e2('0x1'));var Mustache=require(_0x22e2('0x2'));var util=require(_0x22e2('0x3'));var path=require('path');var sox=require(_0x22e2('0x4'));var csv=require(_0x22e2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22e2('0x6'));var _=require(_0x22e2('0x7'));var squel=require(_0x22e2('0x8'));var crypto=require(_0x22e2('0x9'));var jsforce=require(_0x22e2('0xa'));var deskjs=require(_0x22e2('0xb'));var toCsv=require('to-csv');var querystring=require(_0x22e2('0xc'));var Papa=require(_0x22e2('0xd'));var Redis=require('ioredis');var authService=require(_0x22e2('0xe'));var qs=require(_0x22e2('0xf'));var as=require(_0x22e2('0x10'));var hardwareService=require(_0x22e2('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x22e2('0x12'));var db=require(_0x22e2('0x13'))['db'];function respondWithStatusCode(_0xa6de38,_0xced2da){_0xced2da=_0xced2da||0xcc;return function(_0xb37396){if(_0xb37396){return _0xa6de38[_0x22e2('0x14')](_0xced2da);}return _0xa6de38[_0x22e2('0x15')](_0xced2da)[_0x22e2('0x16')]();};}function respondWithResult(_0x29ef7e,_0x1e28b5){_0x1e28b5=_0x1e28b5||0xc8;return function(_0x6e3c65){if(_0x6e3c65){return _0x29ef7e['status'](_0x1e28b5)[_0x22e2('0x17')](_0x6e3c65);}};}function respondWithFilteredResult(_0x56a1fe,_0x2e9de4){return function(_0x55e5e1){if(_0x55e5e1){var _0x33977c=typeof _0x2e9de4[_0x22e2('0x18')]===_0x22e2('0x19')&&typeof _0x2e9de4[_0x22e2('0x1a')]===_0x22e2('0x19');var _0x4760fa=_0x55e5e1[_0x22e2('0x1b')];var _0x2c2d7d=_0x33977c?0x0:_0x2e9de4[_0x22e2('0x18')];var _0x27a142=_0x33977c?_0x55e5e1['count']:_0x2e9de4['offset']+_0x2e9de4[_0x22e2('0x1a')];var _0x564771;if(_0x27a142>=_0x4760fa){_0x27a142=_0x4760fa;_0x564771=0xc8;}else{_0x564771=0xce;}_0x56a1fe['status'](_0x564771);return _0x56a1fe[_0x22e2('0x1c')](_0x22e2('0x1d'),_0x2c2d7d+'-'+_0x27a142+'/'+_0x4760fa)[_0x22e2('0x17')](_0x55e5e1);}return null;};}function patchUpdates(_0xa9195b){return function(_0x5f559d){try{jsonpatch['apply'](_0x5f559d,_0xa9195b,!![]);}catch(_0x4518eb){return BPromise['reject'](_0x4518eb);}return _0x5f559d[_0x22e2('0x1e')]();};}function saveUpdates(_0x5aef71,_0x40e5e5){return function(_0x17c0b7){if(_0x17c0b7){return _0x17c0b7[_0x22e2('0x1f')](_0x5aef71)[_0x22e2('0x20')](function(_0x2005bf){return _0x2005bf;});}return null;};}function removeEntity(_0x32509f,_0x56630b){return function(_0x4f0774){if(_0x4f0774){return _0x4f0774['destroy']()[_0x22e2('0x20')](function(){_0x32509f['status'](0xcc)[_0x22e2('0x16')]();});}};}function handleEntityNotFound(_0x2c20a9,_0x4483a1){return function(_0x49edef){if(!_0x49edef){_0x2c20a9[_0x22e2('0x14')](0x194);}return _0x49edef;};}function handleError(_0xba6b54,_0x1ef00d){_0x1ef00d=_0x1ef00d||0x1f4;return function(_0x582a9a){logger[_0x22e2('0x21')](_0x582a9a[_0x22e2('0x22')]);if(_0x582a9a[_0x22e2('0x23')]){delete _0x582a9a['name'];}_0xba6b54[_0x22e2('0x15')](_0x1ef00d)[_0x22e2('0x24')](_0x582a9a);};}exports[_0x22e2('0x25')]=function(_0x5239af,_0x429e6e){var _0x1dd35c={},_0x302e12={},_0x8e79ed={'count':0x0,'rows':[]};var _0x590368=_[_0x22e2('0x26')](db[_0x22e2('0x27')][_0x22e2('0x28')],function(_0x144955){return{'name':_0x144955[_0x22e2('0x29')],'type':_0x144955['type'][_0x22e2('0x2a')]};});_0x302e12[_0x22e2('0x2b')]=_[_0x22e2('0x26')](_0x590368,_0x22e2('0x23'));_0x302e12[_0x22e2('0x2c')]=_['keys'](_0x5239af[_0x22e2('0x2c')]);_0x302e12[_0x22e2('0x2d')]=_[_0x22e2('0x2e')](_0x302e12[_0x22e2('0x2b')],_0x302e12[_0x22e2('0x2c')]);_0x1dd35c[_0x22e2('0x2f')]=_[_0x22e2('0x2e')](_0x302e12[_0x22e2('0x2b')],qs[_0x22e2('0x30')](_0x5239af[_0x22e2('0x2c')]['fields']));_0x1dd35c[_0x22e2('0x2f')]=_0x1dd35c[_0x22e2('0x2f')][_0x22e2('0x31')]?_0x1dd35c['attributes']:_0x302e12['model'];if(!_0x5239af[_0x22e2('0x2c')]['hasOwnProperty'](_0x22e2('0x32'))){_0x1dd35c['limit']=qs[_0x22e2('0x1a')](_0x5239af[_0x22e2('0x2c')]['limit']);_0x1dd35c['offset']=qs[_0x22e2('0x18')](_0x5239af['query'][_0x22e2('0x18')]);}_0x1dd35c['order']=qs[_0x22e2('0x33')](_0x5239af['query']['sort']);_0x1dd35c['where']=qs['filters'](_['pick'](_0x5239af[_0x22e2('0x2c')],_0x302e12[_0x22e2('0x2d')]),_0x590368);if(_0x5239af['query']['filter']){_0x1dd35c[_0x22e2('0x34')]=_['merge'](_0x1dd35c['where'],{'$or':_[_0x22e2('0x26')](_0x590368,function(_0x4eed50){if(_0x4eed50[_0x22e2('0x35')]!==_0x22e2('0x36')){var _0x27fb42={};_0x27fb42[_0x4eed50['name']]={'$like':'%'+_0x5239af[_0x22e2('0x2c')][_0x22e2('0x37')]+'%'};return _0x27fb42;}})});}_0x1dd35c=_[_0x22e2('0x38')]({},_0x1dd35c,_0x5239af[_0x22e2('0x39')]);var _0x4d9832={'where':_0x1dd35c[_0x22e2('0x34')]};return db[_0x22e2('0x27')][_0x22e2('0x1b')](_0x4d9832)[_0x22e2('0x20')](function(_0x3b0961){_0x8e79ed[_0x22e2('0x1b')]=_0x3b0961;if(_0x5239af[_0x22e2('0x2c')][_0x22e2('0x3a')]){_0x1dd35c[_0x22e2('0x3b')]=[{'all':!![]}];}return db[_0x22e2('0x27')][_0x22e2('0x3c')](_0x1dd35c);})[_0x22e2('0x20')](function(_0x139740){_0x8e79ed['rows']=_0x139740;return _0x8e79ed;})[_0x22e2('0x20')](respondWithFilteredResult(_0x429e6e,_0x1dd35c))[_0x22e2('0x3d')](handleError(_0x429e6e,null));};exports['show']=function(_0x3be4c1,_0x463e10){var _0x3295bd={'raw':!![],'where':{'id':_0x3be4c1[_0x22e2('0x3e')]['id']}},_0x131aab={};_0x131aab[_0x22e2('0x2b')]=_[_0x22e2('0x3f')](db[_0x22e2('0x27')]['rawAttributes']);_0x131aab['query']=_[_0x22e2('0x3f')](_0x3be4c1[_0x22e2('0x2c')]);_0x131aab['filters']=_[_0x22e2('0x2e')](_0x131aab[_0x22e2('0x2b')],_0x131aab['query']);_0x3295bd[_0x22e2('0x2f')]=_[_0x22e2('0x2e')](_0x131aab['model'],qs['fields'](_0x3be4c1[_0x22e2('0x2c')][_0x22e2('0x30')]));_0x3295bd[_0x22e2('0x2f')]=_0x3295bd[_0x22e2('0x2f')][_0x22e2('0x31')]?_0x3295bd[_0x22e2('0x2f')]:_0x131aab[_0x22e2('0x2b')];if(_0x3be4c1[_0x22e2('0x2c')]['includeAll']){_0x3295bd[_0x22e2('0x3b')]=[{'all':!![]}];}_0x3295bd=_['merge']({},_0x3295bd,_0x3be4c1[_0x22e2('0x39')]);return db[_0x22e2('0x27')][_0x22e2('0x40')](_0x3295bd)[_0x22e2('0x20')](handleEntityNotFound(_0x463e10,null))[_0x22e2('0x20')](respondWithResult(_0x463e10,null))['catch'](handleError(_0x463e10,null));};exports['create']=function(_0x3f3024,_0x1d164c){return db[_0x22e2('0x27')][_0x22e2('0x41')](_0x3f3024[_0x22e2('0x42')],{})[_0x22e2('0x20')](respondWithResult(_0x1d164c,0xc9))[_0x22e2('0x3d')](handleError(_0x1d164c,null));};exports[_0x22e2('0x1f')]=function(_0x11d17e,_0x527885){if(_0x11d17e[_0x22e2('0x42')]['id']){delete _0x11d17e['body']['id'];}return db[_0x22e2('0x27')][_0x22e2('0x40')]({'where':{'id':_0x11d17e['params']['id']}})['then'](handleEntityNotFound(_0x527885,null))['then'](saveUpdates(_0x11d17e[_0x22e2('0x42')],null))[_0x22e2('0x20')](respondWithResult(_0x527885,null))[_0x22e2('0x3d')](handleError(_0x527885,null));};exports[_0x22e2('0x43')]=function(_0x3fd6f6,_0xc39907){return db[_0x22e2('0x27')][_0x22e2('0x40')]({'where':{'id':_0x3fd6f6[_0x22e2('0x3e')]['id']}})[_0x22e2('0x20')](handleEntityNotFound(_0xc39907,null))[_0x22e2('0x20')](removeEntity(_0xc39907,null))[_0x22e2('0x3d')](handleError(_0xc39907,null));}; \ No newline at end of file +var _0x806e=['name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','set','apply','reject','update','destroy','then','error','stack'];(function(_0x448da4,_0x1173be){var _0xfcc0fc=function(_0x1a9bc6){while(--_0x1a9bc6){_0x448da4['push'](_0x448da4['shift']());}};_0xfcc0fc(++_0x1173be);}(_0x806e,0x18f));var _0xe806=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x806e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xe806('0x0'));var rimraf=require(_0xe806('0x1'));var zipdir=require(_0xe806('0x2'));var jsonpatch=require(_0xe806('0x3'));var rp=require('request-promise');var moment=require(_0xe806('0x4'));var BPromise=require(_0xe806('0x5'));var Mustache=require(_0xe806('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe806('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe806('0x8'));var _=require(_0xe806('0x9'));var squel=require(_0xe806('0xa'));var crypto=require(_0xe806('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe806('0xc'));var toCsv=require(_0xe806('0xd'));var querystring=require(_0xe806('0xe'));var Papa=require(_0xe806('0xf'));var Redis=require('ioredis');var authService=require(_0xe806('0x10'));var qs=require(_0xe806('0x11'));var as=require(_0xe806('0x12'));var hardwareService=require(_0xe806('0x13'));var logger=require(_0xe806('0x14'))(_0xe806('0x15'));var utils=require(_0xe806('0x16'));var config=require(_0xe806('0x17'));var licenseUtil=require(_0xe806('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a3e9,_0x430fe0){_0x430fe0=_0x430fe0||0xcc;return function(_0x46c2d4){if(_0x46c2d4){return _0x15a3e9[_0xe806('0x19')](_0x430fe0);}return _0x15a3e9[_0xe806('0x1a')](_0x430fe0)[_0xe806('0x1b')]();};}function respondWithResult(_0x16e0a7,_0x4d00d4){_0x4d00d4=_0x4d00d4||0xc8;return function(_0x13c0fb){if(_0x13c0fb){return _0x16e0a7[_0xe806('0x1a')](_0x4d00d4)[_0xe806('0x1c')](_0x13c0fb);}};}function respondWithFilteredResult(_0x5803c6,_0x8e643d){return function(_0x42682f){if(_0x42682f){var _0x473e49=typeof _0x8e643d[_0xe806('0x1d')]===_0xe806('0x1e')&&typeof _0x8e643d['limit']===_0xe806('0x1e');var _0x36e3da=_0x42682f['count'];var _0x3184c9=_0x473e49?0x0:_0x8e643d['offset'];var _0x3760c1=_0x473e49?_0x42682f['count']:_0x8e643d['offset']+_0x8e643d['limit'];var _0x100fd8;if(_0x3760c1>=_0x36e3da){_0x3760c1=_0x36e3da;_0x100fd8=0xc8;}else{_0x100fd8=0xce;}_0x5803c6[_0xe806('0x1a')](_0x100fd8);return _0x5803c6[_0xe806('0x1f')]('Content-Range',_0x3184c9+'-'+_0x3760c1+'/'+_0x36e3da)['json'](_0x42682f);}return null;};}function patchUpdates(_0x277ad7){return function(_0x164880){try{jsonpatch[_0xe806('0x20')](_0x164880,_0x277ad7,!![]);}catch(_0x1d7fbc){return BPromise[_0xe806('0x21')](_0x1d7fbc);}return _0x164880['save']();};}function saveUpdates(_0x45355d,_0x579cca){return function(_0xeebbb3){if(_0xeebbb3){return _0xeebbb3[_0xe806('0x22')](_0x45355d)['then'](function(_0x4a6af4){return _0x4a6af4;});}return null;};}function removeEntity(_0x214a4a,_0x4a996d){return function(_0x110f25){if(_0x110f25){return _0x110f25[_0xe806('0x23')]()[_0xe806('0x24')](function(){_0x214a4a[_0xe806('0x1a')](0xcc)[_0xe806('0x1b')]();});}};}function handleEntityNotFound(_0x2788b9,_0x5a6c07){return function(_0x384593){if(!_0x384593){_0x2788b9[_0xe806('0x19')](0x194);}return _0x384593;};}function handleError(_0xc3e34f,_0x1e976e){_0x1e976e=_0x1e976e||0x1f4;return function(_0x4823f0){logger[_0xe806('0x25')](_0x4823f0[_0xe806('0x26')]);if(_0x4823f0[_0xe806('0x27')]){delete _0x4823f0[_0xe806('0x27')];}_0xc3e34f[_0xe806('0x1a')](_0x1e976e)[_0xe806('0x28')](_0x4823f0);};}exports[_0xe806('0x29')]=function(_0x3bcf72,_0x50b551){var _0x11d449={},_0x38ead8={},_0x5214ba={'count':0x0,'rows':[]};var _0x1db71d=_[_0xe806('0x2a')](db[_0xe806('0x2b')][_0xe806('0x2c')],function(_0x209b2d){return{'name':_0x209b2d[_0xe806('0x2d')],'type':_0x209b2d[_0xe806('0x2e')]['key']};});_0x38ead8[_0xe806('0x2f')]=_['map'](_0x1db71d,'name');_0x38ead8[_0xe806('0x30')]=_[_0xe806('0x31')](_0x3bcf72[_0xe806('0x30')]);_0x38ead8[_0xe806('0x32')]=_[_0xe806('0x33')](_0x38ead8[_0xe806('0x2f')],_0x38ead8[_0xe806('0x30')]);_0x11d449[_0xe806('0x34')]=_[_0xe806('0x33')](_0x38ead8['model'],qs[_0xe806('0x35')](_0x3bcf72[_0xe806('0x30')][_0xe806('0x35')]));_0x11d449['attributes']=_0x11d449[_0xe806('0x34')]['length']?_0x11d449[_0xe806('0x34')]:_0x38ead8[_0xe806('0x2f')];if(!_0x3bcf72[_0xe806('0x30')][_0xe806('0x36')](_0xe806('0x37'))){_0x11d449[_0xe806('0x38')]=qs[_0xe806('0x38')](_0x3bcf72[_0xe806('0x30')][_0xe806('0x38')]);_0x11d449[_0xe806('0x1d')]=qs[_0xe806('0x1d')](_0x3bcf72[_0xe806('0x30')][_0xe806('0x1d')]);}_0x11d449['order']=qs['sort'](_0x3bcf72[_0xe806('0x30')][_0xe806('0x39')]);_0x11d449[_0xe806('0x3a')]=qs[_0xe806('0x32')](_[_0xe806('0x3b')](_0x3bcf72[_0xe806('0x30')],_0x38ead8[_0xe806('0x32')]),_0x1db71d);if(_0x3bcf72[_0xe806('0x30')]['filter']){_0x11d449[_0xe806('0x3a')]=_[_0xe806('0x3c')](_0x11d449[_0xe806('0x3a')],{'$or':_['map'](_0x1db71d,function(_0x3416e5){if(_0x3416e5[_0xe806('0x2e')]!==_0xe806('0x3d')){var _0x3c8e96={};_0x3c8e96[_0x3416e5['name']]={'$like':'%'+_0x3bcf72[_0xe806('0x30')]['filter']+'%'};return _0x3c8e96;}})});}_0x11d449=_[_0xe806('0x3c')]({},_0x11d449,_0x3bcf72[_0xe806('0x3e')]);var _0x4de57d={'where':_0x11d449[_0xe806('0x3a')]};return db[_0xe806('0x2b')][_0xe806('0x3f')](_0x4de57d)[_0xe806('0x24')](function(_0xf1ec11){_0x5214ba[_0xe806('0x3f')]=_0xf1ec11;if(_0x3bcf72['query'][_0xe806('0x40')]){_0x11d449['include']=[{'all':!![]}];}return db[_0xe806('0x2b')][_0xe806('0x41')](_0x11d449);})[_0xe806('0x24')](function(_0x37cf1e){_0x5214ba[_0xe806('0x42')]=_0x37cf1e;return _0x5214ba;})[_0xe806('0x24')](respondWithFilteredResult(_0x50b551,_0x11d449))[_0xe806('0x43')](handleError(_0x50b551,null));};exports['show']=function(_0x4bca21,_0x510728){var _0x587e3a={'raw':!![],'where':{'id':_0x4bca21['params']['id']}},_0x4b5713={};_0x4b5713[_0xe806('0x2f')]=_[_0xe806('0x31')](db[_0xe806('0x2b')]['rawAttributes']);_0x4b5713[_0xe806('0x30')]=_[_0xe806('0x31')](_0x4bca21[_0xe806('0x30')]);_0x4b5713['filters']=_[_0xe806('0x33')](_0x4b5713[_0xe806('0x2f')],_0x4b5713[_0xe806('0x30')]);_0x587e3a[_0xe806('0x34')]=_[_0xe806('0x33')](_0x4b5713[_0xe806('0x2f')],qs[_0xe806('0x35')](_0x4bca21['query']['fields']));_0x587e3a[_0xe806('0x34')]=_0x587e3a[_0xe806('0x34')][_0xe806('0x44')]?_0x587e3a['attributes']:_0x4b5713['model'];if(_0x4bca21[_0xe806('0x30')][_0xe806('0x40')]){_0x587e3a['include']=[{'all':!![]}];}_0x587e3a=_[_0xe806('0x3c')]({},_0x587e3a,_0x4bca21[_0xe806('0x3e')]);return db[_0xe806('0x2b')][_0xe806('0x45')](_0x587e3a)[_0xe806('0x24')](handleEntityNotFound(_0x510728,null))['then'](respondWithResult(_0x510728,null))[_0xe806('0x43')](handleError(_0x510728,null));};exports['create']=function(_0x1e13a4,_0x5e8f56){return db[_0xe806('0x2b')][_0xe806('0x46')](_0x1e13a4[_0xe806('0x47')],{})[_0xe806('0x24')](respondWithResult(_0x5e8f56,0xc9))['catch'](handleError(_0x5e8f56,null));};exports[_0xe806('0x22')]=function(_0x458bd6,_0x9b6f03){if(_0x458bd6[_0xe806('0x47')]['id']){delete _0x458bd6[_0xe806('0x47')]['id'];}return db['Dynamics365Field'][_0xe806('0x45')]({'where':{'id':_0x458bd6[_0xe806('0x48')]['id']}})[_0xe806('0x24')](handleEntityNotFound(_0x9b6f03,null))[_0xe806('0x24')](saveUpdates(_0x458bd6[_0xe806('0x47')],null))[_0xe806('0x24')](respondWithResult(_0x9b6f03,null))[_0xe806('0x43')](handleError(_0x9b6f03,null));};exports[_0xe806('0x23')]=function(_0x30a207,_0x41dc0e){return db[_0xe806('0x2b')]['find']({'where':{'id':_0x30a207['params']['id']}})[_0xe806('0x24')](handleEntityNotFound(_0x41dc0e,null))['then'](removeEntity(_0x41dc0e,null))[_0xe806('0x43')](handleError(_0x41dc0e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 94d497d..0ab2282 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 _0x49b7=['define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x492552,_0x21fdd7){var _0xd0a355=function(_0x5a021d){while(--_0x5a021d){_0x492552['push'](_0x492552['shift']());}};_0xd0a355(++_0x21fdd7);}(_0x49b7,0x101));var _0x749b=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x49b7[_0x189305];return _0xea3406;};'use strict';var _=require(_0x749b('0x0'));var util=require('util');var logger=require(_0x749b('0x1'))(_0x749b('0x2'));var moment=require('moment');var BPromise=require(_0x749b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x749b('0x4'));var rimraf=require(_0x749b('0x5'));var config=require(_0x749b('0x6'));var attributes=require(_0x749b('0x7'));module[_0x749b('0x8')]=function(_0x48f860,_0x29e5b4){return _0x48f860[_0x749b('0x9')](_0x749b('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x749b('0xb'),'fields':[_0x749b('0xc'),_0x749b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c4=['request-promise','path','../../config/environment','./intDynamics365Field.attributes','int_dynamics365_fields','FieldId','lodash','../../config/logger','moment','bluebird'];(function(_0x4a3553,_0x12e68f){var _0x569d42=function(_0x28860d){while(--_0x28860d){_0x4a3553['push'](_0x4a3553['shift']());}};_0x569d42(++_0x12e68f);}(_0xb4c4,0xf6));var _0x4b4c=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xb4c4[_0x552fce];return _0x3e27a2;};'use strict';var _=require(_0x4b4c('0x0'));var util=require('util');var logger=require(_0x4b4c('0x1'))('api');var moment=require(_0x4b4c('0x2'));var BPromise=require(_0x4b4c('0x3'));var rp=require(_0x4b4c('0x4'));var fs=require('fs');var path=require(_0x4b4c('0x5'));var rimraf=require('rimraf');var config=require(_0x4b4c('0x6'));var attributes=require(_0x4b4c('0x7'));module['exports']=function(_0x35f075,_0x1fc139){return _0x35f075['define']('Dynamics365Field',attributes,{'tableName':_0x4b4c('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x4b4c('0x9')],'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 a4c91f4..0c4e963 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 _0x5efe=['catch','lodash','moment','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5efe,0x91));var _0xe5ef=function(_0x179a1b,_0x389344){_0x179a1b=_0x179a1b-0x0;var _0x15b2c5=_0x5efe[_0x179a1b];return _0x15b2c5;};'use strict';var _=require(_0xe5ef('0x0'));var util=require('util');var moment=require(_0xe5ef('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5ef('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5ef('0x3'));var logger=require('../../config/logger')(_0xe5ef('0x4'));var config=require('../../config/environment');var jayson=require(_0xe5ef('0x5'));var client=jayson[_0xe5ef('0x6')][_0xe5ef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ed7d9,_0x39472c,_0x5c7c56){return new BPromise(function(_0x317b47,_0x1fe490){return client['request'](_0x1ed7d9,_0x5c7c56)[_0xe5ef('0x8')](function(_0x5e97dc){logger[_0xe5ef('0x9')](_0xe5ef('0xa'),_0x39472c,'request\x20sent');logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x39472c,_0xe5ef('0xb'),JSON[_0xe5ef('0xc')](_0x5e97dc));if(_0x5e97dc[_0xe5ef('0xd')]){if(_0x5e97dc[_0xe5ef('0xd')][_0xe5ef('0xe')]===0x1f4){logger[_0xe5ef('0xd')](_0xe5ef('0xa'),_0x39472c,_0x5e97dc[_0xe5ef('0xd')][_0xe5ef('0xf')]);return _0x1fe490(_0x5e97dc[_0xe5ef('0xd')][_0xe5ef('0xf')]);}logger[_0xe5ef('0xd')](_0xe5ef('0xa'),_0x39472c,_0x5e97dc['error'][_0xe5ef('0xf')]);return _0x317b47(_0x5e97dc[_0xe5ef('0xd')][_0xe5ef('0xf')]);}else{logger['info'](_0xe5ef('0xa'),_0x39472c,_0xe5ef('0xb'));_0x317b47(_0x5e97dc[_0xe5ef('0x10')][_0xe5ef('0xf')]);}})[_0xe5ef('0x11')](function(_0x3a9c64){logger[_0xe5ef('0xd')](_0xe5ef('0xa'),_0x39472c,_0x3a9c64);_0x1fe490(_0x3a9c64);});});} \ No newline at end of file +var _0xb962=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x22adf9,_0x4ee3b7){var _0x2b9a4a=function(_0x42abf4){while(--_0x42abf4){_0x22adf9['push'](_0x22adf9['shift']());}};_0x2b9a4a(++_0x4ee3b7);}(_0xb962,0x87));var _0x2b96=function(_0x549bfa,_0x2f597c){_0x549bfa=_0x549bfa-0x0;var _0x1e18c3=_0xb962[_0x549bfa];return _0x1e18c3;};'use strict';var _=require(_0x2b96('0x0'));var util=require('util');var moment=require(_0x2b96('0x1'));var BPromise=require(_0x2b96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b96('0x3'));var db=require(_0x2b96('0x4'))['db'];var utils=require(_0x2b96('0x5'));var logger=require(_0x2b96('0x6'))(_0x2b96('0x7'));var config=require(_0x2b96('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2b96('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x582942,_0x5950d0,_0x3820a5){return new BPromise(function(_0x26d21e,_0x37854f){return client[_0x2b96('0xa')](_0x582942,_0x3820a5)[_0x2b96('0xb')](function(_0x9c77fc){logger[_0x2b96('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5950d0,'request\x20sent');logger[_0x2b96('0xd')](_0x2b96('0xe'),_0x5950d0,_0x2b96('0xf'),JSON[_0x2b96('0x10')](_0x9c77fc));if(_0x9c77fc[_0x2b96('0x11')]){if(_0x9c77fc['error'][_0x2b96('0x12')]===0x1f4){logger[_0x2b96('0x11')](_0x2b96('0x13'),_0x5950d0,_0x9c77fc[_0x2b96('0x11')][_0x2b96('0x14')]);return _0x37854f(_0x9c77fc['error'][_0x2b96('0x14')]);}logger[_0x2b96('0x11')](_0x2b96('0x13'),_0x5950d0,_0x9c77fc[_0x2b96('0x11')][_0x2b96('0x14')]);return _0x26d21e(_0x9c77fc[_0x2b96('0x11')][_0x2b96('0x14')]);}else{logger[_0x2b96('0xc')](_0x2b96('0x13'),_0x5950d0,_0x2b96('0xf'));_0x26d21e(_0x9c77fc[_0x2b96('0x15')][_0x2b96('0x14')]);}})[_0x2b96('0x16')](function(_0x3d98de){logger[_0x2b96('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x5950d0,_0x3d98de);_0x37854f(_0x3d98de);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f9e099f..c5243df 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 _0x4064=['/:id/configurations','getConfigurations','post','create','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4064,0xaf));var _0x4406=function(_0x3b13bd,_0x2271ee){_0x3b13bd=_0x3b13bd-0x0;var _0x585de7=_0x4064[_0x3b13bd];return _0x585de7;};'use strict';var multer=require(_0x4406('0x0'));var util=require('util');var path=require(_0x4406('0x1'));var timeout=require('connect-timeout');var express=require(_0x4406('0x2'));var router=express[_0x4406('0x3')]();var fs_extra=require(_0x4406('0x4'));var auth=require(_0x4406('0x5'));var interaction=require(_0x4406('0x6'));var config=require(_0x4406('0x7'));var controller=require(_0x4406('0x8'));router[_0x4406('0x9')]('/',auth['isAuthenticated'](),controller[_0x4406('0xa')]);router['get'](_0x4406('0xb'),auth[_0x4406('0xc')](),controller[_0x4406('0xd')]);router[_0x4406('0x9')](_0x4406('0xe'),auth['isAuthenticated'](),controller[_0x4406('0xf')]);router[_0x4406('0x9')]('/:id/fields',auth[_0x4406('0xc')](),controller['getFields']);router[_0x4406('0x10')]('/',auth[_0x4406('0xc')](),controller[_0x4406('0x11')]);router[_0x4406('0x10')]('/:id/configurations',auth[_0x4406('0xc')](),controller['addConfiguration']);router['put'](_0x4406('0xb'),auth[_0x4406('0xc')](),controller['update']);router[_0x4406('0x12')](_0x4406('0xb'),auth[_0x4406('0xc')](),controller[_0x4406('0x13')]);module[_0x4406('0x14')]=router; \ No newline at end of file +var _0xa026=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x3e948f,_0x19484d){var _0x4cc3de=function(_0x335e95){while(--_0x335e95){_0x3e948f['push'](_0x3e948f['shift']());}};_0x4cc3de(++_0x19484d);}(_0xa026,0x1c8));var _0x6a02=function(_0x2ace95,_0x186b37){_0x2ace95=_0x2ace95-0x0;var _0x35ecfa=_0xa026[_0x2ace95];return _0x35ecfa;};'use strict';var multer=require(_0x6a02('0x0'));var util=require(_0x6a02('0x1'));var path=require(_0x6a02('0x2'));var timeout=require(_0x6a02('0x3'));var express=require('express');var router=express[_0x6a02('0x4')]();var fs_extra=require(_0x6a02('0x5'));var auth=require(_0x6a02('0x6'));var interaction=require(_0x6a02('0x7'));var config=require(_0x6a02('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x6a02('0x9')]('/',auth[_0x6a02('0xa')](),controller[_0x6a02('0xb')]);router[_0x6a02('0x9')](_0x6a02('0xc'),auth[_0x6a02('0xa')](),controller[_0x6a02('0xd')]);router[_0x6a02('0x9')]('/:id/configurations',auth[_0x6a02('0xa')](),controller[_0x6a02('0xe')]);router[_0x6a02('0x9')](_0x6a02('0xf'),auth[_0x6a02('0xa')](),controller['getFields']);router[_0x6a02('0x10')]('/',auth[_0x6a02('0xa')](),controller[_0x6a02('0x11')]);router[_0x6a02('0x10')]('/:id/configurations',auth[_0x6a02('0xa')](),controller[_0x6a02('0x12')]);router[_0x6a02('0x13')](_0x6a02('0xc'),auth[_0x6a02('0xa')](),controller[_0x6a02('0x14')]);router[_0x6a02('0x15')](_0x6a02('0xc'),auth[_0x6a02('0xa')](),controller[_0x6a02('0x16')]);module[_0x6a02('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 8428635..a3c09fc 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 _0x896e=['exports','STRING','username','remoteUri','sequelize'];(function(_0x54b0f3,_0x1fe2f7){var _0x5ae957=function(_0x2749eb){while(--_0x2749eb){_0x54b0f3['push'](_0x54b0f3['shift']());}};_0x5ae957(++_0x1fe2f7);}(_0x896e,0x1e9));var _0xe896=function(_0x108395,_0x20e57c){_0x108395=_0x108395-0x0;var _0x38928b=_0x896e[_0x108395];return _0x38928b;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'name':{'type':Sequelize[_0xe896('0x2')]},'description':{'type':Sequelize[_0xe896('0x2')]},'username':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x3')},'apiKey':{'type':Sequelize[_0xe896('0x2')]},'remoteUri':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x4')},'serverUrl':{'type':Sequelize[_0xe896('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4213=['exports','STRING','username','remoteUri','sequelize'];(function(_0x5ebe24,_0x56e9d0){var _0x1ada76=function(_0x1e1387){while(--_0x1e1387){_0x5ebe24['push'](_0x5ebe24['shift']());}};_0x1ada76(++_0x56e9d0);}(_0x4213,0x77));var _0x3421=function(_0x1f30eb,_0x6c455d){_0x1f30eb=_0x1f30eb-0x0;var _0x33c421=_0x4213[_0x1f30eb];return _0x33c421;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')]},'description':{'type':Sequelize[_0x3421('0x2')]},'username':{'type':Sequelize[_0x3421('0x2')],'unique':_0x3421('0x3')},'apiKey':{'type':Sequelize[_0x3421('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3421('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ec11cc0..83098cf 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 _0x9780=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','custom_dropdown','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x9780,0x1d4));var _0x0978=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0x9780[_0x2f7d18];return _0x425175;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0978('0x0'));var jsonpatch=require(_0x0978('0x1'));var rp=require(_0x0978('0x2'));var moment=require(_0x0978('0x3'));var BPromise=require(_0x0978('0x4'));var Mustache=require(_0x0978('0x5'));var util=require(_0x0978('0x6'));var path=require(_0x0978('0x7'));var sox=require(_0x0978('0x8'));var csv=require(_0x0978('0x9'));var ejs=require(_0x0978('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0978('0xb'));var squel=require(_0x0978('0xc'));var crypto=require(_0x0978('0xd'));var jsforce=require(_0x0978('0xe'));var deskjs=require(_0x0978('0xf'));var toCsv=require(_0x0978('0x9'));var querystring=require(_0x0978('0x10'));var Papa=require(_0x0978('0x11'));var Redis=require(_0x0978('0x12'));var authService=require(_0x0978('0x13'));var qs=require(_0x0978('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0978('0x15'));var logger=require('../../config/logger')(_0x0978('0x16'));var utils=require(_0x0978('0x17'));var config=require(_0x0978('0x18'));var licenseUtil=require(_0x0978('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0978('0x1a'));function respondWithStatusCode(_0x4cb5f5,_0x3cc5e6){_0x3cc5e6=_0x3cc5e6||0xcc;return function(_0x3ec1a8){if(_0x3ec1a8){return _0x4cb5f5[_0x0978('0x1b')](_0x3cc5e6);}return _0x4cb5f5[_0x0978('0x1c')](_0x3cc5e6)[_0x0978('0x1d')]();};}function respondWithResult(_0xe18785,_0x1fc724){_0x1fc724=_0x1fc724||0xc8;return function(_0x28c4ad){if(_0x28c4ad){return _0xe18785['status'](_0x1fc724)[_0x0978('0x1e')](_0x28c4ad);}};}function respondWithFilteredResult(_0x2177e0,_0x1fe6a9){return function(_0x20e9ab){if(_0x20e9ab){var _0x3024e1=typeof _0x1fe6a9[_0x0978('0x1f')]===_0x0978('0x20')&&typeof _0x1fe6a9[_0x0978('0x21')]===_0x0978('0x20');var _0x55f8f9=_0x20e9ab[_0x0978('0x22')];var _0x24ab43=_0x3024e1?0x0:_0x1fe6a9[_0x0978('0x1f')];var _0x33615c=_0x3024e1?_0x20e9ab[_0x0978('0x22')]:_0x1fe6a9[_0x0978('0x1f')]+_0x1fe6a9[_0x0978('0x21')];var _0xd01b3a;if(_0x33615c>=_0x55f8f9){_0x33615c=_0x55f8f9;_0xd01b3a=0xc8;}else{_0xd01b3a=0xce;}_0x2177e0[_0x0978('0x1c')](_0xd01b3a);return _0x2177e0['set'](_0x0978('0x23'),_0x24ab43+'-'+_0x33615c+'/'+_0x55f8f9)[_0x0978('0x1e')](_0x20e9ab);}return null;};}function patchUpdates(_0x346ffc){return function(_0x57a4e7){try{jsonpatch[_0x0978('0x24')](_0x57a4e7,_0x346ffc,!![]);}catch(_0x2fd1f2){return BPromise[_0x0978('0x25')](_0x2fd1f2);}return _0x57a4e7['save']();};}function saveUpdates(_0x1c97a9,_0x5b3c5c){return function(_0x293121){if(_0x293121){return _0x293121['update'](_0x1c97a9)[_0x0978('0x26')](function(_0x4f4fa6){return _0x4f4fa6;});}return null;};}function removeEntity(_0x1a968d,_0x58e40d){return function(_0x39c5aa){if(_0x39c5aa){return _0x39c5aa['destroy']()['then'](function(){_0x1a968d[_0x0978('0x1c')](0xcc)[_0x0978('0x1d')]();});}};}function handleEntityNotFound(_0x453e2c,_0x2e3612){return function(_0xfc2d7e){if(!_0xfc2d7e){_0x453e2c[_0x0978('0x1b')](0x194);}return _0xfc2d7e;};}function handleError(_0x3f5c6d,_0x39fff2){_0x39fff2=_0x39fff2||0x1f4;return function(_0x309ec1){logger[_0x0978('0x27')](_0x309ec1[_0x0978('0x28')]);if(_0x309ec1[_0x0978('0x29')]){delete _0x309ec1[_0x0978('0x29')];}_0x3f5c6d[_0x0978('0x1c')](_0x39fff2)[_0x0978('0x2a')](_0x309ec1);};}exports[_0x0978('0x2b')]=function(_0x16a8e8,_0xc68e34){var _0x111966={},_0x5739c6={},_0x3c5196={'count':0x0,'rows':[]};var _0x56e327=_[_0x0978('0x2c')](db[_0x0978('0x2d')][_0x0978('0x2e')],function(_0x10c2db){return{'name':_0x10c2db[_0x0978('0x2f')],'type':_0x10c2db[_0x0978('0x30')][_0x0978('0x31')]};});_0x5739c6[_0x0978('0x32')]=_[_0x0978('0x2c')](_0x56e327,_0x0978('0x29'));_0x5739c6[_0x0978('0x33')]=_[_0x0978('0x34')](_0x16a8e8[_0x0978('0x33')]);_0x5739c6[_0x0978('0x35')]=_[_0x0978('0x36')](_0x5739c6[_0x0978('0x32')],_0x5739c6[_0x0978('0x33')]);_0x111966[_0x0978('0x37')]=_['intersection'](_0x5739c6[_0x0978('0x32')],qs[_0x0978('0x38')](_0x16a8e8[_0x0978('0x33')][_0x0978('0x38')]));_0x111966[_0x0978('0x37')]=_0x111966['attributes'][_0x0978('0x39')]?_0x111966[_0x0978('0x37')]:_0x5739c6[_0x0978('0x32')];if(!_0x16a8e8[_0x0978('0x33')]['hasOwnProperty']('nolimit')){_0x111966[_0x0978('0x21')]=qs[_0x0978('0x21')](_0x16a8e8[_0x0978('0x33')]['limit']);_0x111966[_0x0978('0x1f')]=qs[_0x0978('0x1f')](_0x16a8e8[_0x0978('0x33')][_0x0978('0x1f')]);}_0x111966['order']=qs[_0x0978('0x3a')](_0x16a8e8['query'][_0x0978('0x3a')]);_0x111966[_0x0978('0x3b')]=qs[_0x0978('0x35')](_[_0x0978('0x3c')](_0x16a8e8[_0x0978('0x33')],_0x5739c6[_0x0978('0x35')]),_0x56e327);if(_0x16a8e8[_0x0978('0x33')]['filter']){_0x111966[_0x0978('0x3b')]=_[_0x0978('0x3d')](_0x111966[_0x0978('0x3b')],{'$or':_['map'](_0x56e327,function(_0x122fa5){if(_0x122fa5[_0x0978('0x30')]!==_0x0978('0x3e')){var _0x3433b6={};_0x3433b6[_0x122fa5['name']]={'$like':'%'+_0x16a8e8['query'][_0x0978('0x3f')]+'%'};return _0x3433b6;}})});}_0x111966=_['merge']({},_0x111966,_0x16a8e8[_0x0978('0x40')]);var _0x34ad50={'where':_0x111966[_0x0978('0x3b')]};return db[_0x0978('0x2d')][_0x0978('0x22')](_0x34ad50)[_0x0978('0x26')](function(_0x520f40){_0x3c5196['count']=_0x520f40;if(_0x16a8e8['query'][_0x0978('0x41')]){_0x111966['include']=[{'all':!![]}];}return db[_0x0978('0x2d')]['findAll'](_0x111966);})[_0x0978('0x26')](function(_0x5393b3){_0x3c5196[_0x0978('0x42')]=_0x5393b3;return _0x3c5196;})['then'](respondWithFilteredResult(_0xc68e34,_0x111966))[_0x0978('0x43')](handleError(_0xc68e34,null));};exports[_0x0978('0x44')]=function(_0x41e104,_0x5325f4){var _0x5a9ad4={'raw':![],'where':{'id':_0x41e104[_0x0978('0x45')]['id']}},_0x5b882a={};_0x5b882a[_0x0978('0x32')]=_[_0x0978('0x34')](db['FreshdeskAccount'][_0x0978('0x2e')]);_0x5b882a[_0x0978('0x33')]=_[_0x0978('0x34')](_0x41e104[_0x0978('0x33')]);_0x5b882a[_0x0978('0x35')]=_[_0x0978('0x36')](_0x5b882a['model'],_0x5b882a[_0x0978('0x33')]);_0x5a9ad4[_0x0978('0x37')]=_[_0x0978('0x36')](_0x5b882a[_0x0978('0x32')],qs[_0x0978('0x38')](_0x41e104['query'][_0x0978('0x38')]));_0x5a9ad4[_0x0978('0x37')]=_0x5a9ad4['attributes'][_0x0978('0x39')]?_0x5a9ad4[_0x0978('0x37')]:_0x5b882a[_0x0978('0x32')];if(_0x41e104[_0x0978('0x33')]['includeAll']){_0x5a9ad4[_0x0978('0x46')]=[{'all':!![]}];}_0x5a9ad4=_[_0x0978('0x3d')]({},_0x5a9ad4,_0x41e104[_0x0978('0x40')]);return db['FreshdeskAccount'][_0x0978('0x47')](_0x5a9ad4)['then'](handleEntityNotFound(_0x5325f4,null))[_0x0978('0x26')](respondWithResult(_0x5325f4,null))[_0x0978('0x43')](handleError(_0x5325f4,null));};exports[_0x0978('0x48')]=function(_0x2c7fb8,_0x550769){return db['FreshdeskAccount'][_0x0978('0x48')](_0x2c7fb8[_0x0978('0x49')],{})[_0x0978('0x26')](respondWithResult(_0x550769,0xc9))[_0x0978('0x43')](handleError(_0x550769,null));};exports[_0x0978('0x4a')]=function(_0x3bc6ab,_0x282cc4){if(_0x3bc6ab[_0x0978('0x49')]['id']){delete _0x3bc6ab[_0x0978('0x49')]['id'];}return db[_0x0978('0x2d')][_0x0978('0x47')]({'where':{'id':_0x3bc6ab['params']['id']}})[_0x0978('0x26')](handleEntityNotFound(_0x282cc4,null))[_0x0978('0x26')](saveUpdates(_0x3bc6ab[_0x0978('0x49')],null))['then'](respondWithResult(_0x282cc4,null))[_0x0978('0x43')](handleError(_0x282cc4,null));};exports[_0x0978('0x4b')]=function(_0x598aa7,_0x58e1e7){return db['FreshdeskAccount'][_0x0978('0x47')]({'where':{'id':_0x598aa7['params']['id']}})[_0x0978('0x26')](handleEntityNotFound(_0x58e1e7,null))[_0x0978('0x26')](removeEntity(_0x58e1e7,null))[_0x0978('0x43')](handleError(_0x58e1e7,null));};exports[_0x0978('0x4c')]=function(_0x5f8358,_0x309132,_0x53eb1b){var _0x1109d5={};var _0x48c2e0={};var _0x3e26b3;var _0x38574d;return db['FreshdeskAccount'][_0x0978('0x4d')]({'where':{'id':_0x5f8358[_0x0978('0x45')]['id']}})['then'](handleEntityNotFound(_0x309132,null))[_0x0978('0x26')](function(_0x4aba77){if(_0x4aba77){_0x3e26b3=_0x4aba77;_0x48c2e0[_0x0978('0x32')]=_[_0x0978('0x34')](db[_0x0978('0x4e')][_0x0978('0x2e')]);_0x48c2e0['query']=_[_0x0978('0x34')](_0x5f8358[_0x0978('0x33')]);_0x48c2e0[_0x0978('0x35')]=_[_0x0978('0x36')](_0x48c2e0[_0x0978('0x32')],_0x48c2e0['query']);_0x1109d5[_0x0978('0x37')]=_[_0x0978('0x36')](_0x48c2e0[_0x0978('0x32')],qs['fields'](_0x5f8358['query']['fields']));_0x1109d5[_0x0978('0x37')]=_0x1109d5[_0x0978('0x37')][_0x0978('0x39')]?_0x1109d5[_0x0978('0x37')]:_0x48c2e0[_0x0978('0x32')];_0x1109d5['order']=qs['sort'](_0x5f8358['query'][_0x0978('0x3a')]);_0x1109d5[_0x0978('0x3b')]=qs[_0x0978('0x35')](_[_0x0978('0x3c')](_0x5f8358[_0x0978('0x33')],_0x48c2e0[_0x0978('0x35')]));if(_0x5f8358[_0x0978('0x33')][_0x0978('0x3f')]){_0x1109d5[_0x0978('0x3b')]=_[_0x0978('0x3d')](_0x1109d5[_0x0978('0x3b')],{'$or':_[_0x0978('0x2c')](_0x1109d5[_0x0978('0x37')],function(_0x3b8f43){var _0x47a862={};_0x47a862[_0x3b8f43]={'$like':'%'+_0x5f8358['query'][_0x0978('0x3f')]+'%'};return _0x47a862;})});}_0x1109d5=_[_0x0978('0x3d')]({},_0x1109d5,_0x5f8358[_0x0978('0x40')]);return _0x3e26b3[_0x0978('0x4c')](_0x1109d5);}})['then'](function(_0x4b6bb2){if(_0x4b6bb2){_0x38574d=_0x4b6bb2[_0x0978('0x39')];if(!_0x5f8358['query'][_0x0978('0x4f')](_0x0978('0x50'))){_0x1109d5['limit']=qs['limit'](_0x5f8358[_0x0978('0x33')][_0x0978('0x21')]);_0x1109d5['offset']=qs['offset'](_0x5f8358[_0x0978('0x33')][_0x0978('0x1f')]);}return _0x3e26b3['getConfigurations'](_0x1109d5);}})[_0x0978('0x26')](function(_0x188e96){if(_0x188e96){return _0x188e96?{'count':_0x38574d,'rows':_0x188e96}:null;}})[_0x0978('0x26')](respondWithResult(_0x309132,null))[_0x0978('0x43')](handleError(_0x309132,null));};exports[_0x0978('0x51')]=function(_0x2a7ffa,_0xede249,_0x1b4b23){if(_0x2a7ffa[_0x0978('0x49')]['id']){delete _0x2a7ffa[_0x0978('0x49')]['id'];}return db[_0x0978('0x2d')][_0x0978('0x4d')]({'where':{'id':_0x2a7ffa['params']['id']}})[_0x0978('0x26')](handleEntityNotFound(_0xede249,null))[_0x0978('0x26')](function(_0x28b454){if(_0x28b454){_0x2a7ffa[_0x0978('0x49')][_0x0978('0x52')]=_0x28b454['id'];_0x2a7ffa[_0x0978('0x49')][_0x0978('0x53')]=integrations[_0x0978('0x54')](_0x2a7ffa[_0x0978('0x49')][_0x0978('0x55')],_0x2a7ffa[_0x0978('0x49')]['type']);_0x2a7ffa[_0x0978('0x49')][_0x0978('0x56')]=integrations[_0x0978('0x57')](_0x2a7ffa[_0x0978('0x49')][_0x0978('0x55')],_0x2a7ffa[_0x0978('0x49')][_0x0978('0x30')]);return db[_0x0978('0x4e')][_0x0978('0x48')](_0x2a7ffa[_0x0978('0x49')],{'include':[{'model':db[_0x0978('0x58')],'as':'Subjects'},{'model':db[_0x0978('0x58')],'as':_0x0978('0x56')}]});}return null;})['then'](respondWithResult(_0xede249,null))['catch'](handleError(_0xede249,null));};exports[_0x0978('0x59')]=function(_0x58aca9,_0x330a09,_0x39aad6){var _0x355d21='';return db[_0x0978('0x2d')]['findOne']({'where':{'id':_0x58aca9[_0x0978('0x45')]['id']},'attributes':['id',_0x0978('0x5a'),_0x0978('0x5b')]})['then'](handleEntityNotFound(_0x330a09,null))[_0x0978('0x26')](function(_0x5148c6){if(_0x5148c6){_0x355d21=_0x5148c6[_0x0978('0x5a')];var _0x3d1206=_0x355d21[_0x0978('0x5c')](-0x1);if(_0x3d1206==='/'){_0x355d21=_0x355d21[_0x0978('0x5d')](0x0,_0x355d21[_0x0978('0x5e')](_0x3d1206));}return rp({'method':_0x0978('0x5f'),'uri':util[_0x0978('0x60')](_0x0978('0x61'),_0x355d21,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x0978('0x62'),new Buffer(util[_0x0978('0x60')]('%s:X',_0x5148c6[_0x0978('0x5b')]))[_0x0978('0x63')](_0x0978('0x64')))},'json':!![]});}})[_0x0978('0x26')](function(_0x597372){if(_0x597372){var _0x4a2bfe=[_0x0978('0x65'),_0x0978('0x66'),_0x0978('0x67'),_0x0978('0x68'),'status',_0x0978('0x69'),_0x0978('0x6a'),_0x0978('0x6b'),_0x0978('0x6c'),_0x0978('0x6a'),'company'];_[_0x0978('0x6d')](_0x597372,function(_0x37e237){return _0x4a2bfe[_0x0978('0x6e')](_0x37e237[_0x0978('0x29')])||!_0x37e237['default']&&_0x37e237[_0x0978('0x30')]!=='custom_text'&&_0x37e237['type']!==_0x0978('0x6f');});return{'count':_0x597372['length'],'rows':_[_0x0978('0x2c')](_0x597372,function(_0x24e92b){return{'id':_0x24e92b[_0x0978('0x29')],'name':_0x24e92b['label'],'custom':!_0x24e92b[_0x0978('0x70')],'options':_0x24e92b[_0x0978('0x71')]?_[_0x0978('0x2c')](_0x24e92b[_0x0978('0x71')],function(_0x41c829){return{'name':_['capitalize'](_0x41c829),'value':_0x41c829};}):[]};})};}})[_0x0978('0x26')](respondWithResult(_0x330a09,null))['catch'](function(_0x266b21){var _0x61e753=_0x58aca9[_0x0978('0x33')][_0x0978('0x72')]?0x1f4:_0x266b21[_0x0978('0x73')]||0x1f4;logger[_0x0978('0x27')](_0x0978('0x74'),_0x0978('0x59'),_0x61e753,JSON[_0x0978('0x75')](_0x266b21));delete _0x266b21[_0x0978('0x29')];if(_0x61e753===0x191){_0x61e753=0x190;}_0x330a09[_0x0978('0x1c')](_0x61e753)[_0x0978('0x2a')](_0x58aca9[_0x0978('0x33')][_0x0978('0x72')]?{'message':_0x0978('0x76'),'statusCode':_0x266b21[_0x0978('0x73')]}:_0x266b21);});}; \ No newline at end of file +var _0xc788=['update','then','destroy','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','priority','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','error','stringify','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0xaa7931,_0x27d113){var _0x230866=function(_0x154f37){while(--_0x154f37){_0xaa7931['push'](_0xaa7931['shift']());}};_0x230866(++_0x27d113);}(_0xc788,0xc4));var _0x8c78=function(_0x22d53d,_0x339808){_0x22d53d=_0x22d53d-0x0;var _0x40dd91=_0xc788[_0x22d53d];return _0x40dd91;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['FreshdeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['FreshdeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['FreshdeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x3dcee2){if(_0x3dcee2){_0x3c6886=_0x3dcee2[_0x8c78('0x57')];var _0x594a3c=_0x3c6886['slice'](-0x1);if(_0x594a3c==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x59')](0x0,_0x3c6886['lastIndexOf'](_0x594a3c));}return rp({'method':_0x8c78('0x5a'),'uri':util[_0x8c78('0x5b')](_0x8c78('0x5c'),_0x3c6886,_0x8c78('0x5d')),'headers':{'Authorization':util[_0x8c78('0x5b')](_0x8c78('0x5e'),new Buffer(util['format']('%s:X',_0x3dcee2[_0x8c78('0x58')]))[_0x8c78('0x5f')](_0x8c78('0x60')))},'json':!![]});}})[_0x8c78('0x25')](function(_0x2c35c7){if(_0x2c35c7){var _0x4c09fd=[_0x8c78('0x61'),_0x8c78('0x62'),_0x8c78('0x63'),_0x8c78('0x64'),_0x8c78('0x19'),_0x8c78('0x65'),'group',_0x8c78('0x66'),_0x8c78('0x67'),'group',_0x8c78('0x68')];_[_0x8c78('0x69')](_0x2c35c7,function(_0xae45a8){return _0x4c09fd[_0x8c78('0x6a')](_0xae45a8[_0x8c78('0x28')])||!_0xae45a8[_0x8c78('0x6b')]&&_0xae45a8[_0x8c78('0x2f')]!==_0x8c78('0x6c')&&_0xae45a8[_0x8c78('0x2f')]!==_0x8c78('0x6d');});return{'count':_0x2c35c7[_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x2c35c7,function(_0x3ba98a){return{'id':_0x3ba98a[_0x8c78('0x28')],'name':_0x3ba98a[_0x8c78('0x6e')],'custom':!_0x3ba98a[_0x8c78('0x6b')],'options':_0x3ba98a[_0x8c78('0x6f')]?_['map'](_0x3ba98a[_0x8c78('0x6f')],function(_0x4da5dc){return{'name':_['capitalize'](_0x4da5dc),'value':_0x4da5dc};}):[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))[_0x8c78('0x49')](function(_0x2e540b){var _0x3b3c51=_0x5646ff['query'][_0x8c78('0x70')]?0x1f4:_0x2e540b[_0x8c78('0x71')]||0x1f4;logger[_0x8c78('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x8c78('0x56'),_0x3b3c51,JSON[_0x8c78('0x73')](_0x2e540b));delete _0x2e540b[_0x8c78('0x28')];if(_0x3b3c51===0x191){_0x3b3c51=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x3b3c51)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x2e540b['statusCode']}:_0x2e540b);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1693bf5..1e1c3d2 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 _0x7661=['path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56a7ed,_0x3fcb41){var _0x179c66=function(_0x588acf){while(--_0x588acf){_0x56a7ed['push'](_0x56a7ed['shift']());}};_0x179c66(++_0x3fcb41);}(_0x7661,0x125));var _0x1766=function(_0x49861a,_0x4fb639){_0x49861a=_0x49861a-0x0;var _0x19f754=_0x7661[_0x49861a];return _0x19f754;};'use strict';var _=require(_0x1766('0x0'));var util=require(_0x1766('0x1'));var logger=require(_0x1766('0x2'))(_0x1766('0x3'));var moment=require(_0x1766('0x4'));var BPromise=require(_0x1766('0x5'));var rp=require(_0x1766('0x6'));var fs=require('fs');var path=require(_0x1766('0x7'));var rimraf=require(_0x1766('0x8'));var config=require('../../config/environment');var attributes=require(_0x1766('0x9'));var integrations=require(_0x1766('0xa'));module[_0x1766('0xb')]=function(_0x11fa12,_0x52f04e){return _0x11fa12[_0x1766('0xc')](_0x1766('0xd'),attributes,{'tableName':_0x1766('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd37f=['./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd37f,0x138));var _0xfd37=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xd37f[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xfd37('0x0'));var util=require(_0xfd37('0x1'));var logger=require(_0xfd37('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfd37('0x3'));var rp=require(_0xfd37('0x4'));var fs=require('fs');var path=require(_0xfd37('0x5'));var rimraf=require(_0xfd37('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd37('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xfd37('0x8')]=function(_0x4d8ce3,_0x290e5e){return _0x4d8ce3[_0xfd37('0x9')](_0xfd37('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 5feccb1..fa8a743 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 _0xa01c=['result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','then','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message'];(function(_0x4ef170,_0x59f8eb){var _0x256a36=function(_0x5b137c){while(--_0x5b137c){_0x4ef170['push'](_0x4ef170['shift']());}};_0x256a36(++_0x59f8eb);}(_0xa01c,0x14b));var _0xca01=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa01c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xca01('0x0'));var util=require(_0xca01('0x1'));var moment=require(_0xca01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca01('0x3'));var db=require(_0xca01('0x4'))['db'];var utils=require(_0xca01('0x5'));var logger=require(_0xca01('0x6'))('rpc');var config=require(_0xca01('0x7'));var jayson=require(_0xca01('0x8'));var client=jayson[_0xca01('0x9')][_0xca01('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x551eb0,_0x138843,_0x5a42c5){return new BPromise(function(_0x50774c,_0x1776f7){return client[_0xca01('0xb')](_0x551eb0,_0x5a42c5)['then'](function(_0x4dbd54){logger[_0xca01('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x138843,_0xca01('0xd'));logger['debug'](_0xca01('0xe'),_0x138843,_0xca01('0xd'),JSON[_0xca01('0xf')](_0x4dbd54));if(_0x4dbd54[_0xca01('0x10')]){if(_0x4dbd54[_0xca01('0x10')]['code']===0x1f4){logger['error'](_0xca01('0x11'),_0x138843,_0x4dbd54['error'][_0xca01('0x12')]);return _0x1776f7(_0x4dbd54[_0xca01('0x10')][_0xca01('0x12')]);}logger[_0xca01('0x10')](_0xca01('0x11'),_0x138843,_0x4dbd54[_0xca01('0x10')]['message']);return _0x50774c(_0x4dbd54[_0xca01('0x10')][_0xca01('0x12')]);}else{logger[_0xca01('0xc')](_0xca01('0x11'),_0x138843,_0xca01('0xd'));_0x50774c(_0x4dbd54[_0xca01('0x13')][_0xca01('0x12')]);}})[_0xca01('0x14')](function(_0x2a8b92){logger['error'](_0xca01('0x11'),_0x138843,_0x2a8b92);_0x1776f7(_0x2a8b92);});});}exports['GetFreshdeskAccount']=function(_0x372697){var _0x2416ee=this;return new Promise(function(_0x8e4fcb,_0x2365bc){return db[_0xca01('0x15')][_0xca01('0x16')]({'raw':_0x372697[_0xca01('0x17')]?_0x372697['options'][_0xca01('0x18')]===undefined?!![]:![]:!![],'where':_0x372697[_0xca01('0x17')]?_0x372697[_0xca01('0x17')][_0xca01('0x19')]||null:null,'attributes':_0x372697[_0xca01('0x17')]?_0x372697[_0xca01('0x17')][_0xca01('0x1a')]||null:null,'limit':_0x372697[_0xca01('0x17')]?_0x372697[_0xca01('0x17')]['limit']||null:null,'include':_0x372697[_0xca01('0x17')]?_0x372697[_0xca01('0x17')]['include']?_['map'](_0x372697[_0xca01('0x17')][_0xca01('0x1b')],function(_0x2d755f){return{'model':db[_0x2d755f[_0xca01('0x1c')]],'as':_0x2d755f['as'],'attributes':_0x2d755f[_0xca01('0x1a')],'include':_0x2d755f[_0xca01('0x1b')]?_[_0xca01('0x1d')](_0x2d755f[_0xca01('0x1b')],function(_0x5bcbac){return{'model':db[_0x5bcbac[_0xca01('0x1c')]],'as':_0x5bcbac['as'],'attributes':_0x5bcbac[_0xca01('0x1a')],'include':_0x5bcbac[_0xca01('0x1b')]?_[_0xca01('0x1d')](_0x5bcbac[_0xca01('0x1b')],function(_0x4f1033){return{'model':db[_0x4f1033['model']],'as':_0x4f1033['as'],'attributes':_0x4f1033[_0xca01('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xca01('0x1e')](function(_0x1085aa){logger[_0xca01('0xc')](_0xca01('0x1f'),_0x372697);logger[_0xca01('0x20')]('GetFreshdeskAccount',_0x372697,JSON[_0xca01('0xf')](_0x1085aa));_0x8e4fcb(_0x1085aa);})[_0xca01('0x14')](function(_0x1dfee4){logger[_0xca01('0x10')](_0xca01('0x1f'),_0x1dfee4[_0xca01('0x12')],_0x372697);_0x2365bc(_0x2416ee[_0xca01('0x10')](0x1f4,_0x1dfee4[_0xca01('0x12')]));});});};exports[_0xca01('0x21')]=function(_0x590086){var _0xf130f5=this;return new Promise(function(_0xee81ad,_0x277fef){return db[_0xca01('0x15')][_0xca01('0x22')]({'raw':_0x590086[_0xca01('0x17')]?_0x590086[_0xca01('0x17')][_0xca01('0x18')]===undefined?!![]:![]:!![],'where':_0x590086['options']?_0x590086[_0xca01('0x17')][_0xca01('0x19')]||null:null,'attributes':_0x590086[_0xca01('0x17')]?_0x590086['options']['attributes']||null:null,'include':_0x590086[_0xca01('0x17')]?_0x590086[_0xca01('0x17')]['include']?_[_0xca01('0x1d')](_0x590086[_0xca01('0x17')][_0xca01('0x1b')],function(_0x2342fe){return{'model':db[_0x2342fe[_0xca01('0x1c')]],'as':_0x2342fe['as'],'attributes':_0x2342fe[_0xca01('0x1a')],'include':_0x2342fe['include']?_[_0xca01('0x1d')](_0x2342fe[_0xca01('0x1b')],function(_0xc2d002){return{'model':db[_0xc2d002[_0xca01('0x1c')]],'as':_0xc2d002['as'],'attributes':_0xc2d002[_0xca01('0x1a')],'include':_0xc2d002[_0xca01('0x1b')]?_[_0xca01('0x1d')](_0xc2d002[_0xca01('0x1b')],function(_0x3b84df){return{'model':db[_0x3b84df[_0xca01('0x1c')]],'as':_0x3b84df['as'],'attributes':_0x3b84df['attributes']};}):[]};}):[]};}):[]:[]})[_0xca01('0x1e')](function(_0x4db0b4){logger[_0xca01('0xc')]('ShowFreshdeskAccount',_0x590086);logger[_0xca01('0x20')](_0xca01('0x21'),_0x590086,JSON[_0xca01('0xf')](_0x4db0b4));_0xee81ad(_0x4db0b4);})[_0xca01('0x14')](function(_0x3faa58){logger[_0xca01('0x10')](_0xca01('0x21'),_0x3faa58[_0xca01('0x12')],_0x590086);_0x277fef(_0xf130f5[_0xca01('0x10')](0x1f4,_0x3faa58[_0xca01('0x12')]));});});}; \ No newline at end of file +var _0x480c=['options','raw','where','attributes','model','map','include','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','then','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','findAll'];(function(_0x5e0d3a,_0xdbe75a){var _0x449d9d=function(_0x470293){while(--_0x470293){_0x5e0d3a['push'](_0x5e0d3a['shift']());}};_0x449d9d(++_0xdbe75a);}(_0x480c,0xcc));var _0xc480=function(_0xe22444,_0x5f3d36){_0xe22444=_0xe22444-0x0;var _0x18da92=_0x480c[_0xe22444];return _0x18da92;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc480('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc480('0x1'));var db=require(_0xc480('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc480('0x3'))(_0xc480('0x4'));var config=require(_0xc480('0x5'));var jayson=require(_0xc480('0x6'));var client=jayson['client'][_0xc480('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ff99,_0x44aab1,_0x13ef07){return new BPromise(function(_0xab8d3f,_0x2e917d){return client['request'](_0x16ff99,_0x13ef07)['then'](function(_0x21a2ba){logger[_0xc480('0x8')](_0xc480('0x9'),_0x44aab1,'request\x20sent');logger['debug'](_0xc480('0xa'),_0x44aab1,_0xc480('0xb'),JSON[_0xc480('0xc')](_0x21a2ba));if(_0x21a2ba[_0xc480('0xd')]){if(_0x21a2ba['error'][_0xc480('0xe')]===0x1f4){logger[_0xc480('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x44aab1,_0x21a2ba['error'][_0xc480('0xf')]);return _0x2e917d(_0x21a2ba[_0xc480('0xd')][_0xc480('0xf')]);}logger['error'](_0xc480('0x9'),_0x44aab1,_0x21a2ba[_0xc480('0xd')]['message']);return _0xab8d3f(_0x21a2ba[_0xc480('0xd')]['message']);}else{logger[_0xc480('0x8')](_0xc480('0x9'),_0x44aab1,_0xc480('0xb'));_0xab8d3f(_0x21a2ba[_0xc480('0x10')]['message']);}})[_0xc480('0x11')](function(_0x35a317){logger[_0xc480('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x44aab1,_0x35a317);_0x2e917d(_0x35a317);});});}exports['GetFreshdeskAccount']=function(_0x440366){var _0x372b87=this;return new Promise(function(_0x48ed6a,_0x52915e){return db[_0xc480('0x12')][_0xc480('0x13')]({'raw':_0x440366[_0xc480('0x14')]?_0x440366[_0xc480('0x14')][_0xc480('0x15')]===undefined?!![]:![]:!![],'where':_0x440366[_0xc480('0x14')]?_0x440366[_0xc480('0x14')][_0xc480('0x16')]||null:null,'attributes':_0x440366['options']?_0x440366[_0xc480('0x14')][_0xc480('0x17')]||null:null,'limit':_0x440366['options']?_0x440366[_0xc480('0x14')]['limit']||null:null,'include':_0x440366[_0xc480('0x14')]?_0x440366[_0xc480('0x14')]['include']?_['map'](_0x440366['options']['include'],function(_0x4c8a05){return{'model':db[_0x4c8a05[_0xc480('0x18')]],'as':_0x4c8a05['as'],'attributes':_0x4c8a05[_0xc480('0x17')],'include':_0x4c8a05['include']?_[_0xc480('0x19')](_0x4c8a05[_0xc480('0x1a')],function(_0x55ba75){return{'model':db[_0x55ba75[_0xc480('0x18')]],'as':_0x55ba75['as'],'attributes':_0x55ba75['attributes'],'include':_0x55ba75[_0xc480('0x1a')]?_[_0xc480('0x19')](_0x55ba75[_0xc480('0x1a')],function(_0x549060){return{'model':db[_0x549060[_0xc480('0x18')]],'as':_0x549060['as'],'attributes':_0x549060[_0xc480('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eaaf2){logger[_0xc480('0x8')](_0xc480('0x1b'),_0x440366);logger[_0xc480('0x1c')]('GetFreshdeskAccount',_0x440366,JSON[_0xc480('0xc')](_0x4eaaf2));_0x48ed6a(_0x4eaaf2);})[_0xc480('0x11')](function(_0x2e0b6f){logger['error'](_0xc480('0x1b'),_0x2e0b6f['message'],_0x440366);_0x52915e(_0x372b87[_0xc480('0xd')](0x1f4,_0x2e0b6f[_0xc480('0xf')]));});});};exports[_0xc480('0x1d')]=function(_0x152dda){var _0x55263a=this;return new Promise(function(_0x59e351,_0x489681){return db[_0xc480('0x12')][_0xc480('0x1e')]({'raw':_0x152dda[_0xc480('0x14')]?_0x152dda[_0xc480('0x14')][_0xc480('0x15')]===undefined?!![]:![]:!![],'where':_0x152dda[_0xc480('0x14')]?_0x152dda[_0xc480('0x14')]['where']||null:null,'attributes':_0x152dda[_0xc480('0x14')]?_0x152dda[_0xc480('0x14')][_0xc480('0x17')]||null:null,'include':_0x152dda[_0xc480('0x14')]?_0x152dda[_0xc480('0x14')]['include']?_[_0xc480('0x19')](_0x152dda['options'][_0xc480('0x1a')],function(_0x12e47d){return{'model':db[_0x12e47d[_0xc480('0x18')]],'as':_0x12e47d['as'],'attributes':_0x12e47d[_0xc480('0x17')],'include':_0x12e47d['include']?_[_0xc480('0x19')](_0x12e47d['include'],function(_0x113270){return{'model':db[_0x113270['model']],'as':_0x113270['as'],'attributes':_0x113270[_0xc480('0x17')],'include':_0x113270[_0xc480('0x1a')]?_[_0xc480('0x19')](_0x113270[_0xc480('0x1a')],function(_0x57f336){return{'model':db[_0x57f336[_0xc480('0x18')]],'as':_0x57f336['as'],'attributes':_0x57f336['attributes']};}):[]};}):[]};}):[]:[]})[_0xc480('0x1f')](function(_0x153587){logger[_0xc480('0x8')](_0xc480('0x1d'),_0x152dda);logger[_0xc480('0x1c')](_0xc480('0x1d'),_0x152dda,JSON[_0xc480('0xc')](_0x153587));_0x59e351(_0x153587);})[_0xc480('0x11')](function(_0x174866){logger[_0xc480('0xd')](_0xc480('0x1d'),_0x174866['message'],_0x152dda);_0x489681(_0x55263a[_0xc480('0xd')](0x1f4,_0x174866[_0xc480('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 535b346..bbac121 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 _0x0385=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','destroy','exports','util','path','connect-timeout','express'];(function(_0xee8f1c,_0x4256b8){var _0x2dcaf7=function(_0x48d910){while(--_0x48d910){_0xee8f1c['push'](_0xee8f1c['shift']());}};_0x2dcaf7(++_0x4256b8);}(_0x0385,0xd8));var _0x5038=function(_0x243f64,_0x510ea8){_0x243f64=_0x243f64-0x0;var _0x44d876=_0x0385[_0x243f64];return _0x44d876;};'use strict';var multer=require('multer');var util=require(_0x5038('0x0'));var path=require(_0x5038('0x1'));var timeout=require(_0x5038('0x2'));var express=require(_0x5038('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5038('0x4'));var interaction=require(_0x5038('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x5038('0x6')](),controller['index']);router[_0x5038('0x7')](_0x5038('0x8'),auth[_0x5038('0x6')](),controller[_0x5038('0x9')]);router['get']('/:id/fields',auth[_0x5038('0x6')](),controller[_0x5038('0xa')]);router[_0x5038('0x7')](_0x5038('0xb'),auth[_0x5038('0x6')](),controller[_0x5038('0xc')]);router[_0x5038('0x7')](_0x5038('0xd'),auth[_0x5038('0x6')](),controller[_0x5038('0xe')]);router[_0x5038('0x7')](_0x5038('0xf'),auth[_0x5038('0x6')](),controller[_0x5038('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5038('0x11')]);router[_0x5038('0x12')](_0x5038('0xf'),auth[_0x5038('0x6')](),controller[_0x5038('0x13')]);router['put'](_0x5038('0x8'),auth[_0x5038('0x6')](),controller['update']);router['delete']('/:id',auth[_0x5038('0x6')](),controller[_0x5038('0x14')]);module[_0x5038('0x15')]=router; \ No newline at end of file +var _0x1e7c=['./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','update','delete','/:id','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x1e7c,0x1f4));var _0xc1e7=function(_0x1f5863,_0x4e5dac){_0x1f5863=_0x1f5863-0x0;var _0x53f445=_0x1e7c[_0x1f5863];return _0x53f445;};'use strict';var multer=require(_0xc1e7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc1e7('0x1'));var router=express[_0xc1e7('0x2')]();var fs_extra=require(_0xc1e7('0x3'));var auth=require(_0xc1e7('0x4'));var interaction=require(_0xc1e7('0x5'));var config=require('../../config/environment');var controller=require(_0xc1e7('0x6'));router[_0xc1e7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc1e7('0x7')]('/:id',auth[_0xc1e7('0x8')](),controller['show']);router[_0xc1e7('0x7')](_0xc1e7('0x9'),auth[_0xc1e7('0x8')](),controller['getFields']);router['get'](_0xc1e7('0xa'),auth[_0xc1e7('0x8')](),controller[_0xc1e7('0xb')]);router[_0xc1e7('0x7')](_0xc1e7('0xc'),auth['isAuthenticated'](),controller[_0xc1e7('0xd')]);router[_0xc1e7('0x7')](_0xc1e7('0xe'),auth[_0xc1e7('0x8')](),controller[_0xc1e7('0xf')]);router['post']('/',auth[_0xc1e7('0x8')](),controller[_0xc1e7('0x10')]);router[_0xc1e7('0x11')](_0xc1e7('0xe'),auth['isAuthenticated'](),controller[_0xc1e7('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc1e7('0x13')]);router[_0xc1e7('0x14')](_0xc1e7('0x15'),auth[_0xc1e7('0x8')](),controller['destroy']);module[_0xc1e7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 06e095d..0757945 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 _0x7290=['STRING','sequelize'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x7290,0x1bd));var _0x0729=function(_0x1843b3,_0x10995a){_0x1843b3=_0x1843b3-0x0;var _0x3c7de0=_0x7290[_0x1843b3];return _0x3c7de0;};'use strict';var Sequelize=require(_0x0729('0x0'));module['exports']={'name':{'type':Sequelize[_0x0729('0x1')]},'description':{'type':Sequelize[_0x0729('0x1')]}}; \ No newline at end of file +var _0x8c0f=['exports','STRING','sequelize'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x8c0f,0x146));var _0xf8c0=function(_0x44e672,_0x266808){_0x44e672=_0x44e672-0x0;var _0x167073=_0x8c0f[_0x44e672];return _0x167073;};'use strict';var Sequelize=require(_0xf8c0('0x0'));module[_0xf8c0('0x1')]={'name':{'type':Sequelize[_0xf8c0('0x2')]},'description':{'type':Sequelize[_0xf8c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 1037c26..a1b8fbf 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 _0xc81d=['stack','name','index','map','FreshdeskConfiguration','fieldName','type','model','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','keys','intersection','includeAll','include','find','create','body','destroy','getFields','findOne','rawAttributes','getDescriptions','FreshdeskField','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error'];(function(_0x35257f,_0x2a44b7){var _0x330e91=function(_0x470a90){while(--_0x470a90){_0x35257f['push'](_0x35257f['shift']());}};_0x330e91(++_0x2a44b7);}(_0xc81d,0x82));var _0xdc81=function(_0x172b10,_0x29c893){_0x172b10=_0x172b10-0x0;var _0x222911=_0xc81d[_0x172b10];return _0x222911;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc81('0x0'));var zipdir=require(_0xdc81('0x1'));var jsonpatch=require(_0xdc81('0x2'));var rp=require(_0xdc81('0x3'));var moment=require(_0xdc81('0x4'));var BPromise=require(_0xdc81('0x5'));var Mustache=require(_0xdc81('0x6'));var util=require('util');var path=require('path');var sox=require(_0xdc81('0x7'));var csv=require(_0xdc81('0x8'));var ejs=require(_0xdc81('0x9'));var fs=require('fs');var fs_extra=require(_0xdc81('0xa'));var _=require(_0xdc81('0xb'));var squel=require('squel');var crypto=require(_0xdc81('0xc'));var jsforce=require(_0xdc81('0xd'));var deskjs=require(_0xdc81('0xe'));var toCsv=require(_0xdc81('0x8'));var querystring=require(_0xdc81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdc81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdc81('0x11'));var hardwareService=require(_0xdc81('0x12'));var logger=require(_0xdc81('0x13'))(_0xdc81('0x14'));var utils=require(_0xdc81('0x15'));var config=require(_0xdc81('0x16'));var licenseUtil=require(_0xdc81('0x17'));var db=require(_0xdc81('0x18'))['db'];function respondWithStatusCode(_0x354b6a,_0x38f063){_0x38f063=_0x38f063||0xcc;return function(_0x3b894a){if(_0x3b894a){return _0x354b6a[_0xdc81('0x19')](_0x38f063);}return _0x354b6a['status'](_0x38f063)[_0xdc81('0x1a')]();};}function respondWithResult(_0x509c58,_0x1892a0){_0x1892a0=_0x1892a0||0xc8;return function(_0x433e44){if(_0x433e44){return _0x509c58[_0xdc81('0x1b')](_0x1892a0)['json'](_0x433e44);}};}function respondWithFilteredResult(_0xe2a3f5,_0x5c16cf){return function(_0x1073f3){if(_0x1073f3){var _0x231f66=typeof _0x5c16cf[_0xdc81('0x1c')]===_0xdc81('0x1d')&&typeof _0x5c16cf['limit']==='undefined';var _0x313ec7=_0x1073f3[_0xdc81('0x1e')];var _0x5ae3df=_0x231f66?0x0:_0x5c16cf[_0xdc81('0x1c')];var _0x41364e=_0x231f66?_0x1073f3['count']:_0x5c16cf[_0xdc81('0x1c')]+_0x5c16cf['limit'];var _0x502fc9;if(_0x41364e>=_0x313ec7){_0x41364e=_0x313ec7;_0x502fc9=0xc8;}else{_0x502fc9=0xce;}_0xe2a3f5['status'](_0x502fc9);return _0xe2a3f5[_0xdc81('0x1f')](_0xdc81('0x20'),_0x5ae3df+'-'+_0x41364e+'/'+_0x313ec7)[_0xdc81('0x21')](_0x1073f3);}return null;};}function patchUpdates(_0x4788ec){return function(_0x81ad6){try{jsonpatch[_0xdc81('0x22')](_0x81ad6,_0x4788ec,!![]);}catch(_0x565c9c){return BPromise[_0xdc81('0x23')](_0x565c9c);}return _0x81ad6[_0xdc81('0x24')]();};}function saveUpdates(_0x2a44fc,_0x14d4ec){return function(_0x1890aa){if(_0x1890aa){return _0x1890aa[_0xdc81('0x25')](_0x2a44fc)[_0xdc81('0x26')](function(_0x348f42){return _0x348f42;});}return null;};}function removeEntity(_0x4f4d93,_0x3f13f0){return function(_0x5c288d){if(_0x5c288d){return _0x5c288d['destroy']()[_0xdc81('0x26')](function(){_0x4f4d93[_0xdc81('0x1b')](0xcc)[_0xdc81('0x1a')]();});}};}function handleEntityNotFound(_0x318047,_0x482a81){return function(_0x62477b){if(!_0x62477b){_0x318047[_0xdc81('0x19')](0x194);}return _0x62477b;};}function handleError(_0x1e3e8e,_0x45bd77){_0x45bd77=_0x45bd77||0x1f4;return function(_0x491f81){logger[_0xdc81('0x27')](_0x491f81[_0xdc81('0x28')]);if(_0x491f81[_0xdc81('0x29')]){delete _0x491f81['name'];}_0x1e3e8e[_0xdc81('0x1b')](_0x45bd77)['send'](_0x491f81);};}exports[_0xdc81('0x2a')]=function(_0x3ffb5e,_0x22886a){var _0x3dcc58={},_0x222983={},_0x36e952={'count':0x0,'rows':[]};var _0x41f416=_[_0xdc81('0x2b')](db[_0xdc81('0x2c')]['rawAttributes'],function(_0xf34b59){return{'name':_0xf34b59[_0xdc81('0x2d')],'type':_0xf34b59[_0xdc81('0x2e')]['key']};});_0x222983[_0xdc81('0x2f')]=_[_0xdc81('0x2b')](_0x41f416,'name');_0x222983[_0xdc81('0x30')]=_['keys'](_0x3ffb5e[_0xdc81('0x30')]);_0x222983['filters']=_['intersection'](_0x222983['model'],_0x222983[_0xdc81('0x30')]);_0x3dcc58['attributes']=_['intersection'](_0x222983[_0xdc81('0x2f')],qs[_0xdc81('0x31')](_0x3ffb5e['query']['fields']));_0x3dcc58[_0xdc81('0x32')]=_0x3dcc58[_0xdc81('0x32')][_0xdc81('0x33')]?_0x3dcc58['attributes']:_0x222983[_0xdc81('0x2f')];if(!_0x3ffb5e[_0xdc81('0x30')][_0xdc81('0x34')](_0xdc81('0x35'))){_0x3dcc58['limit']=qs['limit'](_0x3ffb5e[_0xdc81('0x30')][_0xdc81('0x36')]);_0x3dcc58[_0xdc81('0x1c')]=qs[_0xdc81('0x1c')](_0x3ffb5e['query'][_0xdc81('0x1c')]);}_0x3dcc58[_0xdc81('0x37')]=qs[_0xdc81('0x38')](_0x3ffb5e[_0xdc81('0x30')]['sort']);_0x3dcc58[_0xdc81('0x39')]=qs[_0xdc81('0x3a')](_[_0xdc81('0x3b')](_0x3ffb5e[_0xdc81('0x30')],_0x222983[_0xdc81('0x3a')]),_0x41f416);if(_0x3ffb5e['query'][_0xdc81('0x3c')]){_0x3dcc58[_0xdc81('0x39')]=_[_0xdc81('0x3d')](_0x3dcc58[_0xdc81('0x39')],{'$or':_[_0xdc81('0x2b')](_0x41f416,function(_0x230f7b){if(_0x230f7b['type']!==_0xdc81('0x3e')){var _0x122953={};_0x122953[_0x230f7b[_0xdc81('0x29')]]={'$like':'%'+_0x3ffb5e[_0xdc81('0x30')][_0xdc81('0x3c')]+'%'};return _0x122953;}})});}_0x3dcc58=_[_0xdc81('0x3d')]({},_0x3dcc58,_0x3ffb5e[_0xdc81('0x3f')]);var _0x126745={'where':_0x3dcc58['where']};return db['FreshdeskConfiguration']['count'](_0x126745)['then'](function(_0x46610f){_0x36e952[_0xdc81('0x1e')]=_0x46610f;if(_0x3ffb5e[_0xdc81('0x30')]['includeAll']){_0x3dcc58['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xdc81('0x40')](_0x3dcc58);})[_0xdc81('0x26')](function(_0x5980f4){_0x36e952[_0xdc81('0x41')]=_0x5980f4;return _0x36e952;})[_0xdc81('0x26')](respondWithFilteredResult(_0x22886a,_0x3dcc58))[_0xdc81('0x42')](handleError(_0x22886a,null));};exports['show']=function(_0xfc3893,_0x44fa4a){var _0x35aa66={'raw':![],'where':{'id':_0xfc3893[_0xdc81('0x43')]['id']}},_0x31d7e1={};_0x31d7e1[_0xdc81('0x2f')]=_['keys'](db[_0xdc81('0x2c')]['rawAttributes']);_0x31d7e1['query']=_[_0xdc81('0x44')](_0xfc3893[_0xdc81('0x30')]);_0x31d7e1[_0xdc81('0x3a')]=_[_0xdc81('0x45')](_0x31d7e1[_0xdc81('0x2f')],_0x31d7e1[_0xdc81('0x30')]);_0x35aa66[_0xdc81('0x32')]=_[_0xdc81('0x45')](_0x31d7e1['model'],qs[_0xdc81('0x31')](_0xfc3893['query'][_0xdc81('0x31')]));_0x35aa66[_0xdc81('0x32')]=_0x35aa66[_0xdc81('0x32')][_0xdc81('0x33')]?_0x35aa66[_0xdc81('0x32')]:_0x31d7e1[_0xdc81('0x2f')];if(_0xfc3893[_0xdc81('0x30')][_0xdc81('0x46')]){_0x35aa66[_0xdc81('0x47')]=[{'all':!![]}];}_0x35aa66=_[_0xdc81('0x3d')]({},_0x35aa66,_0xfc3893[_0xdc81('0x3f')]);return db[_0xdc81('0x2c')][_0xdc81('0x48')](_0x35aa66)[_0xdc81('0x26')](handleEntityNotFound(_0x44fa4a,null))[_0xdc81('0x26')](respondWithResult(_0x44fa4a,null))[_0xdc81('0x42')](handleError(_0x44fa4a,null));};exports[_0xdc81('0x49')]=function(_0x1d3eff,_0x29ea70){return db[_0xdc81('0x2c')][_0xdc81('0x49')](_0x1d3eff['body'],{})[_0xdc81('0x26')](respondWithResult(_0x29ea70,0xc9))[_0xdc81('0x42')](handleError(_0x29ea70,null));};exports[_0xdc81('0x25')]=function(_0x3dc1fb,_0x48e27e){if(_0x3dc1fb[_0xdc81('0x4a')]['id']){delete _0x3dc1fb[_0xdc81('0x4a')]['id'];}return db[_0xdc81('0x2c')]['find']({'where':{'id':_0x3dc1fb[_0xdc81('0x43')]['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x48e27e,null))[_0xdc81('0x26')](saveUpdates(_0x3dc1fb[_0xdc81('0x4a')],null))[_0xdc81('0x26')](respondWithResult(_0x48e27e,null))[_0xdc81('0x42')](handleError(_0x48e27e,null));};exports[_0xdc81('0x4b')]=function(_0x15ba9a,_0x2f4c61){return db[_0xdc81('0x2c')][_0xdc81('0x48')]({'where':{'id':_0x15ba9a[_0xdc81('0x43')]['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x2f4c61,null))[_0xdc81('0x26')](removeEntity(_0x2f4c61,null))[_0xdc81('0x42')](handleError(_0x2f4c61,null));};exports[_0xdc81('0x4c')]=function(_0xdb4d11,_0x2b60d9,_0x58c010){var _0x4a96e6={};var _0x1b70ed={};var _0x37bfe1;var _0x356cca;return db[_0xdc81('0x2c')][_0xdc81('0x4d')]({'where':{'id':_0xdb4d11[_0xdc81('0x43')]['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x2b60d9,null))['then'](function(_0x1dd2c5){if(_0x1dd2c5){_0x37bfe1=_0x1dd2c5;_0x1b70ed[_0xdc81('0x2f')]=_[_0xdc81('0x44')](db['FreshdeskField'][_0xdc81('0x4e')]);_0x1b70ed[_0xdc81('0x30')]=_[_0xdc81('0x44')](_0xdb4d11[_0xdc81('0x30')]);_0x1b70ed['filters']=_['intersection'](_0x1b70ed['model'],_0x1b70ed['query']);_0x4a96e6[_0xdc81('0x32')]=_[_0xdc81('0x45')](_0x1b70ed[_0xdc81('0x2f')],qs[_0xdc81('0x31')](_0xdb4d11[_0xdc81('0x30')][_0xdc81('0x31')]));_0x4a96e6['attributes']=_0x4a96e6[_0xdc81('0x32')]['length']?_0x4a96e6[_0xdc81('0x32')]:_0x1b70ed[_0xdc81('0x2f')];_0x4a96e6['order']=qs['sort'](_0xdb4d11[_0xdc81('0x30')][_0xdc81('0x38')]);_0x4a96e6[_0xdc81('0x39')]=qs[_0xdc81('0x3a')](_['pick'](_0xdb4d11[_0xdc81('0x30')],_0x1b70ed[_0xdc81('0x3a')]));if(_0xdb4d11[_0xdc81('0x30')]['filter']){_0x4a96e6[_0xdc81('0x39')]=_[_0xdc81('0x3d')](_0x4a96e6[_0xdc81('0x39')],{'$or':_['map'](_0x4a96e6[_0xdc81('0x32')],function(_0x539e70){var _0x31269b={};_0x31269b[_0x539e70]={'$like':'%'+_0xdb4d11['query'][_0xdc81('0x3c')]+'%'};return _0x31269b;})});}_0x4a96e6=_['merge']({},_0x4a96e6,_0xdb4d11['options']);return _0x37bfe1[_0xdc81('0x4c')](_0x4a96e6);}})[_0xdc81('0x26')](function(_0x45293e){if(_0x45293e){_0x356cca=_0x45293e[_0xdc81('0x33')];if(!_0xdb4d11[_0xdc81('0x30')][_0xdc81('0x34')](_0xdc81('0x35'))){_0x4a96e6[_0xdc81('0x36')]=qs['limit'](_0xdb4d11['query'][_0xdc81('0x36')]);_0x4a96e6[_0xdc81('0x1c')]=qs['offset'](_0xdb4d11[_0xdc81('0x30')][_0xdc81('0x1c')]);}return _0x37bfe1[_0xdc81('0x4c')](_0x4a96e6);}})[_0xdc81('0x26')](function(_0x1c897a){if(_0x1c897a){return _0x1c897a?{'count':_0x356cca,'rows':_0x1c897a}:null;}})[_0xdc81('0x26')](respondWithResult(_0x2b60d9,null))['catch'](handleError(_0x2b60d9,null));};exports['getSubjects']=function(_0xd5cb3c,_0x35b392,_0x3c7838){var _0x3b71f3={};var _0x5f24f6={};var _0x195e69;var _0x2f0601;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0xd5cb3c[_0xdc81('0x43')]['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x35b392,null))[_0xdc81('0x26')](function(_0x474044){if(_0x474044){_0x195e69=_0x474044;_0x5f24f6[_0xdc81('0x2f')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x5f24f6[_0xdc81('0x30')]=_[_0xdc81('0x44')](_0xd5cb3c[_0xdc81('0x30')]);_0x5f24f6[_0xdc81('0x3a')]=_[_0xdc81('0x45')](_0x5f24f6[_0xdc81('0x2f')],_0x5f24f6['query']);_0x3b71f3[_0xdc81('0x32')]=_['intersection'](_0x5f24f6[_0xdc81('0x2f')],qs['fields'](_0xd5cb3c['query']['fields']));_0x3b71f3[_0xdc81('0x32')]=_0x3b71f3[_0xdc81('0x32')]['length']?_0x3b71f3[_0xdc81('0x32')]:_0x5f24f6[_0xdc81('0x2f')];_0x3b71f3['order']=qs['sort'](_0xd5cb3c[_0xdc81('0x30')][_0xdc81('0x38')]);_0x3b71f3[_0xdc81('0x39')]=qs['filters'](_[_0xdc81('0x3b')](_0xd5cb3c['query'],_0x5f24f6[_0xdc81('0x3a')]));if(_0xd5cb3c['query']['filter']){_0x3b71f3[_0xdc81('0x39')]=_[_0xdc81('0x3d')](_0x3b71f3['where'],{'$or':_[_0xdc81('0x2b')](_0x3b71f3['attributes'],function(_0xd9ba64){var _0xaf8d40={};_0xaf8d40[_0xd9ba64]={'$like':'%'+_0xd5cb3c[_0xdc81('0x30')][_0xdc81('0x3c')]+'%'};return _0xaf8d40;})});}_0x3b71f3=_[_0xdc81('0x3d')]({},_0x3b71f3,_0xd5cb3c[_0xdc81('0x3f')]);return _0x195e69['getSubjects'](_0x3b71f3);}})[_0xdc81('0x26')](function(_0x5dc542){if(_0x5dc542){_0x2f0601=_0x5dc542[_0xdc81('0x33')];if(!_0xd5cb3c[_0xdc81('0x30')][_0xdc81('0x34')](_0xdc81('0x35'))){_0x3b71f3[_0xdc81('0x36')]=qs[_0xdc81('0x36')](_0xd5cb3c[_0xdc81('0x30')][_0xdc81('0x36')]);_0x3b71f3[_0xdc81('0x1c')]=qs['offset'](_0xd5cb3c[_0xdc81('0x30')]['offset']);}return _0x195e69['getSubjects'](_0x3b71f3);}})[_0xdc81('0x26')](function(_0x31d034){if(_0x31d034){return _0x31d034?{'count':_0x2f0601,'rows':_0x31d034}:null;}})[_0xdc81('0x26')](respondWithResult(_0x35b392,null))[_0xdc81('0x42')](handleError(_0x35b392,null));};exports[_0xdc81('0x4f')]=function(_0x529fcc,_0x4d807c,_0x4056cc){var _0x4a6a92={};var _0x225a1f={};var _0xe63bee;var _0x594091;return db['FreshdeskConfiguration'][_0xdc81('0x4d')]({'where':{'id':_0x529fcc[_0xdc81('0x43')]['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x4d807c,null))[_0xdc81('0x26')](function(_0xb5f8f5){if(_0xb5f8f5){_0xe63bee=_0xb5f8f5;_0x225a1f['model']=_[_0xdc81('0x44')](db[_0xdc81('0x50')]['rawAttributes']);_0x225a1f['query']=_[_0xdc81('0x44')](_0x529fcc[_0xdc81('0x30')]);_0x225a1f[_0xdc81('0x3a')]=_[_0xdc81('0x45')](_0x225a1f[_0xdc81('0x2f')],_0x225a1f[_0xdc81('0x30')]);_0x4a6a92[_0xdc81('0x32')]=_[_0xdc81('0x45')](_0x225a1f[_0xdc81('0x2f')],qs[_0xdc81('0x31')](_0x529fcc[_0xdc81('0x30')][_0xdc81('0x31')]));_0x4a6a92['attributes']=_0x4a6a92[_0xdc81('0x32')][_0xdc81('0x33')]?_0x4a6a92['attributes']:_0x225a1f[_0xdc81('0x2f')];_0x4a6a92['order']=qs['sort'](_0x529fcc[_0xdc81('0x30')][_0xdc81('0x38')]);_0x4a6a92[_0xdc81('0x39')]=qs[_0xdc81('0x3a')](_[_0xdc81('0x3b')](_0x529fcc[_0xdc81('0x30')],_0x225a1f[_0xdc81('0x3a')]));if(_0x529fcc[_0xdc81('0x30')][_0xdc81('0x3c')]){_0x4a6a92[_0xdc81('0x39')]=_[_0xdc81('0x3d')](_0x4a6a92[_0xdc81('0x39')],{'$or':_['map'](_0x4a6a92['attributes'],function(_0xf914ba){var _0x2f836e={};_0x2f836e[_0xf914ba]={'$like':'%'+_0x529fcc[_0xdc81('0x30')]['filter']+'%'};return _0x2f836e;})});}_0x4a6a92=_[_0xdc81('0x3d')]({},_0x4a6a92,_0x529fcc[_0xdc81('0x3f')]);return _0xe63bee[_0xdc81('0x4f')](_0x4a6a92);}})[_0xdc81('0x26')](function(_0x33fab1){if(_0x33fab1){_0x594091=_0x33fab1['length'];if(!_0x529fcc['query']['hasOwnProperty'](_0xdc81('0x35'))){_0x4a6a92[_0xdc81('0x36')]=qs[_0xdc81('0x36')](_0x529fcc[_0xdc81('0x30')]['limit']);_0x4a6a92[_0xdc81('0x1c')]=qs[_0xdc81('0x1c')](_0x529fcc['query'][_0xdc81('0x1c')]);}return _0xe63bee['getDescriptions'](_0x4a6a92);}})[_0xdc81('0x26')](function(_0x4d51ac){if(_0x4d51ac){return _0x4d51ac?{'count':_0x594091,'rows':_0x4d51ac}:null;}})[_0xdc81('0x26')](respondWithResult(_0x4d807c,null))[_0xdc81('0x42')](handleError(_0x4d807c,null));};exports[_0xdc81('0x51')]=function(_0x3606b6,_0x358c9f,_0x1c54ca){var _0x3491ea={};var _0x5e64fb={};var _0x32f2f8;var _0x5b0693;return db['FreshdeskConfiguration'][_0xdc81('0x4d')]({'where':{'id':_0x3606b6['params']['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x358c9f,null))[_0xdc81('0x26')](function(_0x214302){if(_0x214302){_0x32f2f8=_0x214302;_0x5e64fb[_0xdc81('0x2f')]=_['keys'](db[_0xdc81('0x52')][_0xdc81('0x4e')]);_0x5e64fb[_0xdc81('0x30')]=_[_0xdc81('0x44')](_0x3606b6[_0xdc81('0x30')]);_0x5e64fb['filters']=_['intersection'](_0x5e64fb['model'],_0x5e64fb[_0xdc81('0x30')]);_0x3491ea[_0xdc81('0x32')]=_[_0xdc81('0x45')](_0x5e64fb[_0xdc81('0x2f')],qs['fields'](_0x3606b6[_0xdc81('0x30')]['fields']));_0x3491ea[_0xdc81('0x32')]=_0x3491ea['attributes'][_0xdc81('0x33')]?_0x3491ea[_0xdc81('0x32')]:_0x5e64fb['model'];_0x3491ea[_0xdc81('0x37')]=qs['sort'](_0x3606b6[_0xdc81('0x30')][_0xdc81('0x38')]);_0x3491ea['where']=qs[_0xdc81('0x3a')](_[_0xdc81('0x3b')](_0x3606b6[_0xdc81('0x30')],_0x5e64fb[_0xdc81('0x3a')]));if(_0x3606b6[_0xdc81('0x30')]['filter']){_0x3491ea['where']=_['merge'](_0x3491ea[_0xdc81('0x39')],{'$or':_[_0xdc81('0x2b')](_0x3491ea['attributes'],function(_0x10162e){var _0x1e7336={};_0x1e7336[_0x10162e]={'$like':'%'+_0x3606b6[_0xdc81('0x30')][_0xdc81('0x3c')]+'%'};return _0x1e7336;})});}_0x3491ea=_['merge']({},_0x3491ea,_0x3606b6['options']);return _0x32f2f8[_0xdc81('0x51')](_0x3491ea);}})[_0xdc81('0x26')](function(_0x5b2321){if(_0x5b2321){_0x5b0693=_0x5b2321[_0xdc81('0x33')];if(!_0x3606b6[_0xdc81('0x30')][_0xdc81('0x34')](_0xdc81('0x35'))){_0x3491ea[_0xdc81('0x36')]=qs[_0xdc81('0x36')](_0x3606b6[_0xdc81('0x30')][_0xdc81('0x36')]);_0x3491ea[_0xdc81('0x1c')]=qs[_0xdc81('0x1c')](_0x3606b6[_0xdc81('0x30')]['offset']);}return _0x32f2f8['getTags'](_0x3491ea);}})['then'](function(_0x35b820){if(_0x35b820){return _0x35b820?{'count':_0x5b0693,'rows':_0x35b820}:null;}})[_0xdc81('0x26')](respondWithResult(_0x358c9f,null))[_0xdc81('0x42')](handleError(_0x358c9f,null));};exports[_0xdc81('0x53')]=function(_0x33bbaa,_0x145b83,_0x1161b2){if(_0x33bbaa[_0xdc81('0x4a')]['id']){delete _0x33bbaa[_0xdc81('0x4a')]['id'];}return db[_0xdc81('0x2c')]['findOne']({'where':{'id':_0x33bbaa[_0xdc81('0x43')]['id']}})[_0xdc81('0x26')](handleEntityNotFound(_0x145b83,null))[_0xdc81('0x26')](function(_0x13e60a){if(_0x13e60a){return _0x13e60a[_0xdc81('0x53')](_0x33bbaa[_0xdc81('0x4a')][_0xdc81('0x54')]||[]);}return null;})[_0xdc81('0x26')](respondWithResult(_0x145b83,null))[_0xdc81('0x42')](handleError(_0x145b83,null));}; \ No newline at end of file +var _0x45f2=['options','find','catch','create','body','getFields','FreshdeskField','sort','pick','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','merge','filter','includeAll','include','findAll','show','params','keys','rawAttributes','fields','length'];(function(_0x141ff6,_0x34c46d){var _0x5cb6a8=function(_0x14663f){while(--_0x14663f){_0x141ff6['push'](_0x141ff6['shift']());}};_0x5cb6a8(++_0x34c46d);}(_0x45f2,0xfc));var _0x245f=function(_0xfe66bf,_0xf3aa55){_0xfe66bf=_0xfe66bf-0x0;var _0x11d09f=_0x45f2[_0xfe66bf];return _0x11d09f;};'use strict';var emlformat=require(_0x245f('0x0'));var rimraf=require(_0x245f('0x1'));var zipdir=require(_0x245f('0x2'));var jsonpatch=require(_0x245f('0x3'));var rp=require(_0x245f('0x4'));var moment=require('moment');var BPromise=require(_0x245f('0x5'));var Mustache=require('mustache');var util=require(_0x245f('0x6'));var path=require('path');var sox=require(_0x245f('0x7'));var csv=require('to-csv');var ejs=require(_0x245f('0x8'));var fs=require('fs');var fs_extra=require(_0x245f('0x9'));var _=require(_0x245f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x245f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x245f('0xc'));var Papa=require(_0x245f('0xd'));var Redis=require(_0x245f('0xe'));var authService=require(_0x245f('0xf'));var qs=require(_0x245f('0x10'));var as=require(_0x245f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x245f('0x12'))('api');var utils=require(_0x245f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x245f('0x14'));var db=require(_0x245f('0x15'))['db'];function respondWithStatusCode(_0x2fb08f,_0x286af3){_0x286af3=_0x286af3||0xcc;return function(_0x59aeaa){if(_0x59aeaa){return _0x2fb08f['sendStatus'](_0x286af3);}return _0x2fb08f[_0x245f('0x16')](_0x286af3)[_0x245f('0x17')]();};}function respondWithResult(_0xc026a4,_0x42313e){_0x42313e=_0x42313e||0xc8;return function(_0x45574f){if(_0x45574f){return _0xc026a4[_0x245f('0x16')](_0x42313e)['json'](_0x45574f);}};}function respondWithFilteredResult(_0x589bcf,_0x475813){return function(_0x10a8b1){if(_0x10a8b1){var _0x351d43=typeof _0x475813[_0x245f('0x18')]===_0x245f('0x19')&&typeof _0x475813[_0x245f('0x1a')]===_0x245f('0x19');var _0x1e3493=_0x10a8b1['count'];var _0x575609=_0x351d43?0x0:_0x475813[_0x245f('0x18')];var _0x90bce0=_0x351d43?_0x10a8b1[_0x245f('0x1b')]:_0x475813[_0x245f('0x18')]+_0x475813['limit'];var _0x171d6a;if(_0x90bce0>=_0x1e3493){_0x90bce0=_0x1e3493;_0x171d6a=0xc8;}else{_0x171d6a=0xce;}_0x589bcf[_0x245f('0x16')](_0x171d6a);return _0x589bcf[_0x245f('0x1c')](_0x245f('0x1d'),_0x575609+'-'+_0x90bce0+'/'+_0x1e3493)['json'](_0x10a8b1);}return null;};}function patchUpdates(_0x5350f1){return function(_0x2dcdf2){try{jsonpatch['apply'](_0x2dcdf2,_0x5350f1,!![]);}catch(_0x1e9e4f){return BPromise[_0x245f('0x1e')](_0x1e9e4f);}return _0x2dcdf2[_0x245f('0x1f')]();};}function saveUpdates(_0x1c6205,_0x10e7f1){return function(_0xb5cc){if(_0xb5cc){return _0xb5cc[_0x245f('0x20')](_0x1c6205)[_0x245f('0x21')](function(_0x225c7d){return _0x225c7d;});}return null;};}function removeEntity(_0x31fbc6,_0x151d2a){return function(_0x1d75cd){if(_0x1d75cd){return _0x1d75cd[_0x245f('0x22')]()[_0x245f('0x21')](function(){_0x31fbc6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x387da5,_0x3eaa54){return function(_0x4aa9c7){if(!_0x4aa9c7){_0x387da5['sendStatus'](0x194);}return _0x4aa9c7;};}function handleError(_0x2f4c47,_0x17f954){_0x17f954=_0x17f954||0x1f4;return function(_0x2f7e78){logger[_0x245f('0x23')](_0x2f7e78[_0x245f('0x24')]);if(_0x2f7e78[_0x245f('0x25')]){delete _0x2f7e78[_0x245f('0x25')];}_0x2f4c47['status'](_0x17f954)[_0x245f('0x26')](_0x2f7e78);};}exports[_0x245f('0x27')]=function(_0x460a22,_0x1462e1){var _0x5e1e3f={},_0x182346={},_0x5bb2f3={'count':0x0,'rows':[]};var _0x62331c=_['map'](db[_0x245f('0x28')]['rawAttributes'],function(_0x2bf6bb){return{'name':_0x2bf6bb['fieldName'],'type':_0x2bf6bb[_0x245f('0x29')][_0x245f('0x2a')]};});_0x182346[_0x245f('0x2b')]=_[_0x245f('0x2c')](_0x62331c,_0x245f('0x25'));_0x182346['query']=_['keys'](_0x460a22[_0x245f('0x2d')]);_0x182346[_0x245f('0x2e')]=_[_0x245f('0x2f')](_0x182346['model'],_0x182346['query']);_0x5e1e3f[_0x245f('0x30')]=_[_0x245f('0x2f')](_0x182346[_0x245f('0x2b')],qs['fields'](_0x460a22[_0x245f('0x2d')]['fields']));_0x5e1e3f['attributes']=_0x5e1e3f['attributes']['length']?_0x5e1e3f[_0x245f('0x30')]:_0x182346['model'];if(!_0x460a22[_0x245f('0x2d')][_0x245f('0x31')](_0x245f('0x32'))){_0x5e1e3f['limit']=qs['limit'](_0x460a22['query'][_0x245f('0x1a')]);_0x5e1e3f['offset']=qs[_0x245f('0x18')](_0x460a22['query'][_0x245f('0x18')]);}_0x5e1e3f[_0x245f('0x33')]=qs['sort'](_0x460a22[_0x245f('0x2d')]['sort']);_0x5e1e3f[_0x245f('0x34')]=qs[_0x245f('0x2e')](_['pick'](_0x460a22['query'],_0x182346['filters']),_0x62331c);if(_0x460a22[_0x245f('0x2d')]['filter']){_0x5e1e3f[_0x245f('0x34')]=_[_0x245f('0x35')](_0x5e1e3f['where'],{'$or':_[_0x245f('0x2c')](_0x62331c,function(_0x4db984){if(_0x4db984[_0x245f('0x29')]!=='VIRTUAL'){var _0x5bbcd0={};_0x5bbcd0[_0x4db984[_0x245f('0x25')]]={'$like':'%'+_0x460a22[_0x245f('0x2d')][_0x245f('0x36')]+'%'};return _0x5bbcd0;}})});}_0x5e1e3f=_['merge']({},_0x5e1e3f,_0x460a22['options']);var _0x532832={'where':_0x5e1e3f['where']};return db[_0x245f('0x28')]['count'](_0x532832)['then'](function(_0x122529){_0x5bb2f3[_0x245f('0x1b')]=_0x122529;if(_0x460a22[_0x245f('0x2d')][_0x245f('0x37')]){_0x5e1e3f[_0x245f('0x38')]=[{'all':!![]}];}return db[_0x245f('0x28')][_0x245f('0x39')](_0x5e1e3f);})[_0x245f('0x21')](function(_0x2b425f){_0x5bb2f3['rows']=_0x2b425f;return _0x5bb2f3;})['then'](respondWithFilteredResult(_0x1462e1,_0x5e1e3f))['catch'](handleError(_0x1462e1,null));};exports[_0x245f('0x3a')]=function(_0x24d60,_0x4c9a7c){var _0x463ff0={'raw':![],'where':{'id':_0x24d60[_0x245f('0x3b')]['id']}},_0x2a4c4d={};_0x2a4c4d[_0x245f('0x2b')]=_[_0x245f('0x3c')](db[_0x245f('0x28')][_0x245f('0x3d')]);_0x2a4c4d[_0x245f('0x2d')]=_[_0x245f('0x3c')](_0x24d60[_0x245f('0x2d')]);_0x2a4c4d[_0x245f('0x2e')]=_[_0x245f('0x2f')](_0x2a4c4d[_0x245f('0x2b')],_0x2a4c4d[_0x245f('0x2d')]);_0x463ff0[_0x245f('0x30')]=_[_0x245f('0x2f')](_0x2a4c4d['model'],qs[_0x245f('0x3e')](_0x24d60[_0x245f('0x2d')]['fields']));_0x463ff0[_0x245f('0x30')]=_0x463ff0[_0x245f('0x30')][_0x245f('0x3f')]?_0x463ff0['attributes']:_0x2a4c4d['model'];if(_0x24d60['query'][_0x245f('0x37')]){_0x463ff0['include']=[{'all':!![]}];}_0x463ff0=_[_0x245f('0x35')]({},_0x463ff0,_0x24d60[_0x245f('0x40')]);return db[_0x245f('0x28')][_0x245f('0x41')](_0x463ff0)[_0x245f('0x21')](handleEntityNotFound(_0x4c9a7c,null))[_0x245f('0x21')](respondWithResult(_0x4c9a7c,null))[_0x245f('0x42')](handleError(_0x4c9a7c,null));};exports[_0x245f('0x43')]=function(_0x537e6b,_0x811869){return db['FreshdeskConfiguration']['create'](_0x537e6b[_0x245f('0x44')],{})[_0x245f('0x21')](respondWithResult(_0x811869,0xc9))[_0x245f('0x42')](handleError(_0x811869,null));};exports['update']=function(_0x58c78c,_0x443934){if(_0x58c78c['body']['id']){delete _0x58c78c[_0x245f('0x44')]['id'];}return db[_0x245f('0x28')][_0x245f('0x41')]({'where':{'id':_0x58c78c[_0x245f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x443934,null))[_0x245f('0x21')](saveUpdates(_0x58c78c[_0x245f('0x44')],null))['then'](respondWithResult(_0x443934,null))[_0x245f('0x42')](handleError(_0x443934,null));};exports[_0x245f('0x22')]=function(_0x18159a,_0x12d4f3){return db[_0x245f('0x28')]['find']({'where':{'id':_0x18159a[_0x245f('0x3b')]['id']}})[_0x245f('0x21')](handleEntityNotFound(_0x12d4f3,null))[_0x245f('0x21')](removeEntity(_0x12d4f3,null))[_0x245f('0x42')](handleError(_0x12d4f3,null));};exports[_0x245f('0x45')]=function(_0x2b2ee8,_0x370c62,_0x3ce1fa){var _0x21a5a9={};var _0x40d8e2={};var _0x38da80;var _0x15cc4b;return db[_0x245f('0x28')]['findOne']({'where':{'id':_0x2b2ee8[_0x245f('0x3b')]['id']}})[_0x245f('0x21')](handleEntityNotFound(_0x370c62,null))[_0x245f('0x21')](function(_0x10103c){if(_0x10103c){_0x38da80=_0x10103c;_0x40d8e2[_0x245f('0x2b')]=_[_0x245f('0x3c')](db[_0x245f('0x46')][_0x245f('0x3d')]);_0x40d8e2[_0x245f('0x2d')]=_[_0x245f('0x3c')](_0x2b2ee8[_0x245f('0x2d')]);_0x40d8e2[_0x245f('0x2e')]=_[_0x245f('0x2f')](_0x40d8e2[_0x245f('0x2b')],_0x40d8e2['query']);_0x21a5a9['attributes']=_[_0x245f('0x2f')](_0x40d8e2[_0x245f('0x2b')],qs[_0x245f('0x3e')](_0x2b2ee8['query'][_0x245f('0x3e')]));_0x21a5a9[_0x245f('0x30')]=_0x21a5a9[_0x245f('0x30')][_0x245f('0x3f')]?_0x21a5a9['attributes']:_0x40d8e2[_0x245f('0x2b')];_0x21a5a9[_0x245f('0x33')]=qs[_0x245f('0x47')](_0x2b2ee8[_0x245f('0x2d')][_0x245f('0x47')]);_0x21a5a9['where']=qs[_0x245f('0x2e')](_[_0x245f('0x48')](_0x2b2ee8[_0x245f('0x2d')],_0x40d8e2[_0x245f('0x2e')]));if(_0x2b2ee8[_0x245f('0x2d')][_0x245f('0x36')]){_0x21a5a9[_0x245f('0x34')]=_[_0x245f('0x35')](_0x21a5a9['where'],{'$or':_['map'](_0x21a5a9[_0x245f('0x30')],function(_0x11766a){var _0x3c2902={};_0x3c2902[_0x11766a]={'$like':'%'+_0x2b2ee8[_0x245f('0x2d')]['filter']+'%'};return _0x3c2902;})});}_0x21a5a9=_[_0x245f('0x35')]({},_0x21a5a9,_0x2b2ee8[_0x245f('0x40')]);return _0x38da80[_0x245f('0x45')](_0x21a5a9);}})[_0x245f('0x21')](function(_0x3161e4){if(_0x3161e4){_0x15cc4b=_0x3161e4['length'];if(!_0x2b2ee8['query'][_0x245f('0x31')](_0x245f('0x32'))){_0x21a5a9[_0x245f('0x1a')]=qs[_0x245f('0x1a')](_0x2b2ee8['query'][_0x245f('0x1a')]);_0x21a5a9[_0x245f('0x18')]=qs[_0x245f('0x18')](_0x2b2ee8[_0x245f('0x2d')][_0x245f('0x18')]);}return _0x38da80[_0x245f('0x45')](_0x21a5a9);}})[_0x245f('0x21')](function(_0x483597){if(_0x483597){return _0x483597?{'count':_0x15cc4b,'rows':_0x483597}:null;}})[_0x245f('0x21')](respondWithResult(_0x370c62,null))[_0x245f('0x42')](handleError(_0x370c62,null));};exports[_0x245f('0x49')]=function(_0x486095,_0x34786c,_0x4e0c7a){var _0x49813a={};var _0x988608={};var _0x148618;var _0x400dbf;return db[_0x245f('0x28')][_0x245f('0x4a')]({'where':{'id':_0x486095[_0x245f('0x3b')]['id']}})[_0x245f('0x21')](handleEntityNotFound(_0x34786c,null))[_0x245f('0x21')](function(_0x3d137a){if(_0x3d137a){_0x148618=_0x3d137a;_0x988608[_0x245f('0x2b')]=_[_0x245f('0x3c')](db[_0x245f('0x46')][_0x245f('0x3d')]);_0x988608[_0x245f('0x2d')]=_[_0x245f('0x3c')](_0x486095[_0x245f('0x2d')]);_0x988608['filters']=_['intersection'](_0x988608[_0x245f('0x2b')],_0x988608[_0x245f('0x2d')]);_0x49813a['attributes']=_[_0x245f('0x2f')](_0x988608['model'],qs[_0x245f('0x3e')](_0x486095[_0x245f('0x2d')][_0x245f('0x3e')]));_0x49813a['attributes']=_0x49813a['attributes'][_0x245f('0x3f')]?_0x49813a[_0x245f('0x30')]:_0x988608[_0x245f('0x2b')];_0x49813a[_0x245f('0x33')]=qs[_0x245f('0x47')](_0x486095[_0x245f('0x2d')][_0x245f('0x47')]);_0x49813a['where']=qs[_0x245f('0x2e')](_['pick'](_0x486095['query'],_0x988608[_0x245f('0x2e')]));if(_0x486095[_0x245f('0x2d')][_0x245f('0x36')]){_0x49813a[_0x245f('0x34')]=_[_0x245f('0x35')](_0x49813a['where'],{'$or':_['map'](_0x49813a[_0x245f('0x30')],function(_0x234839){var _0x3f5ca3={};_0x3f5ca3[_0x234839]={'$like':'%'+_0x486095['query'][_0x245f('0x36')]+'%'};return _0x3f5ca3;})});}_0x49813a=_['merge']({},_0x49813a,_0x486095[_0x245f('0x40')]);return _0x148618[_0x245f('0x49')](_0x49813a);}})[_0x245f('0x21')](function(_0x4dcbde){if(_0x4dcbde){_0x400dbf=_0x4dcbde[_0x245f('0x3f')];if(!_0x486095[_0x245f('0x2d')][_0x245f('0x31')](_0x245f('0x32'))){_0x49813a['limit']=qs[_0x245f('0x1a')](_0x486095['query'][_0x245f('0x1a')]);_0x49813a[_0x245f('0x18')]=qs[_0x245f('0x18')](_0x486095[_0x245f('0x2d')][_0x245f('0x18')]);}return _0x148618[_0x245f('0x49')](_0x49813a);}})[_0x245f('0x21')](function(_0x598dcc){if(_0x598dcc){return _0x598dcc?{'count':_0x400dbf,'rows':_0x598dcc}:null;}})[_0x245f('0x21')](respondWithResult(_0x34786c,null))[_0x245f('0x42')](handleError(_0x34786c,null));};exports['getDescriptions']=function(_0x2446e3,_0x5c8a31,_0x2ff16f){var _0x12dc75={};var _0x31754a={};var _0x545dc9;var _0x5c1896;return db[_0x245f('0x28')][_0x245f('0x4a')]({'where':{'id':_0x2446e3[_0x245f('0x3b')]['id']}})[_0x245f('0x21')](handleEntityNotFound(_0x5c8a31,null))[_0x245f('0x21')](function(_0x28f2bd){if(_0x28f2bd){_0x545dc9=_0x28f2bd;_0x31754a[_0x245f('0x2b')]=_['keys'](db[_0x245f('0x46')]['rawAttributes']);_0x31754a['query']=_[_0x245f('0x3c')](_0x2446e3[_0x245f('0x2d')]);_0x31754a[_0x245f('0x2e')]=_[_0x245f('0x2f')](_0x31754a[_0x245f('0x2b')],_0x31754a['query']);_0x12dc75['attributes']=_['intersection'](_0x31754a[_0x245f('0x2b')],qs[_0x245f('0x3e')](_0x2446e3[_0x245f('0x2d')][_0x245f('0x3e')]));_0x12dc75[_0x245f('0x30')]=_0x12dc75['attributes']['length']?_0x12dc75[_0x245f('0x30')]:_0x31754a[_0x245f('0x2b')];_0x12dc75[_0x245f('0x33')]=qs['sort'](_0x2446e3[_0x245f('0x2d')][_0x245f('0x47')]);_0x12dc75['where']=qs[_0x245f('0x2e')](_[_0x245f('0x48')](_0x2446e3[_0x245f('0x2d')],_0x31754a[_0x245f('0x2e')]));if(_0x2446e3[_0x245f('0x2d')][_0x245f('0x36')]){_0x12dc75[_0x245f('0x34')]=_[_0x245f('0x35')](_0x12dc75['where'],{'$or':_[_0x245f('0x2c')](_0x12dc75[_0x245f('0x30')],function(_0x358e39){var _0xc4fcba={};_0xc4fcba[_0x358e39]={'$like':'%'+_0x2446e3[_0x245f('0x2d')]['filter']+'%'};return _0xc4fcba;})});}_0x12dc75=_[_0x245f('0x35')]({},_0x12dc75,_0x2446e3[_0x245f('0x40')]);return _0x545dc9['getDescriptions'](_0x12dc75);}})[_0x245f('0x21')](function(_0x86b9b){if(_0x86b9b){_0x5c1896=_0x86b9b[_0x245f('0x3f')];if(!_0x2446e3[_0x245f('0x2d')]['hasOwnProperty']('nolimit')){_0x12dc75[_0x245f('0x1a')]=qs[_0x245f('0x1a')](_0x2446e3[_0x245f('0x2d')][_0x245f('0x1a')]);_0x12dc75[_0x245f('0x18')]=qs['offset'](_0x2446e3[_0x245f('0x2d')][_0x245f('0x18')]);}return _0x545dc9[_0x245f('0x4b')](_0x12dc75);}})[_0x245f('0x21')](function(_0x50fb0b){if(_0x50fb0b){return _0x50fb0b?{'count':_0x5c1896,'rows':_0x50fb0b}:null;}})[_0x245f('0x21')](respondWithResult(_0x5c8a31,null))[_0x245f('0x42')](handleError(_0x5c8a31,null));};exports['getTags']=function(_0x10e914,_0x1ea684,_0x3b88ba){var _0x5ef08f={};var _0x135c59={};var _0x49f339;var _0x22f841;return db[_0x245f('0x28')][_0x245f('0x4a')]({'where':{'id':_0x10e914[_0x245f('0x3b')]['id']}})[_0x245f('0x21')](handleEntityNotFound(_0x1ea684,null))[_0x245f('0x21')](function(_0x4788a2){if(_0x4788a2){_0x49f339=_0x4788a2;_0x135c59[_0x245f('0x2b')]=_['keys'](db['Tag'][_0x245f('0x3d')]);_0x135c59['query']=_[_0x245f('0x3c')](_0x10e914[_0x245f('0x2d')]);_0x135c59[_0x245f('0x2e')]=_[_0x245f('0x2f')](_0x135c59['model'],_0x135c59[_0x245f('0x2d')]);_0x5ef08f[_0x245f('0x30')]=_[_0x245f('0x2f')](_0x135c59[_0x245f('0x2b')],qs[_0x245f('0x3e')](_0x10e914['query'][_0x245f('0x3e')]));_0x5ef08f['attributes']=_0x5ef08f[_0x245f('0x30')]['length']?_0x5ef08f['attributes']:_0x135c59['model'];_0x5ef08f[_0x245f('0x33')]=qs[_0x245f('0x47')](_0x10e914['query']['sort']);_0x5ef08f[_0x245f('0x34')]=qs[_0x245f('0x2e')](_['pick'](_0x10e914[_0x245f('0x2d')],_0x135c59[_0x245f('0x2e')]));if(_0x10e914[_0x245f('0x2d')][_0x245f('0x36')]){_0x5ef08f['where']=_[_0x245f('0x35')](_0x5ef08f[_0x245f('0x34')],{'$or':_['map'](_0x5ef08f[_0x245f('0x30')],function(_0x5e76de){var _0xd1ca35={};_0xd1ca35[_0x5e76de]={'$like':'%'+_0x10e914['query'][_0x245f('0x36')]+'%'};return _0xd1ca35;})});}_0x5ef08f=_[_0x245f('0x35')]({},_0x5ef08f,_0x10e914[_0x245f('0x40')]);return _0x49f339[_0x245f('0x4c')](_0x5ef08f);}})[_0x245f('0x21')](function(_0x14cc20){if(_0x14cc20){_0x22f841=_0x14cc20[_0x245f('0x3f')];if(!_0x10e914[_0x245f('0x2d')][_0x245f('0x31')]('nolimit')){_0x5ef08f[_0x245f('0x1a')]=qs['limit'](_0x10e914[_0x245f('0x2d')][_0x245f('0x1a')]);_0x5ef08f['offset']=qs['offset'](_0x10e914[_0x245f('0x2d')][_0x245f('0x18')]);}return _0x49f339[_0x245f('0x4c')](_0x5ef08f);}})[_0x245f('0x21')](function(_0x2e9fe1){if(_0x2e9fe1){return _0x2e9fe1?{'count':_0x22f841,'rows':_0x2e9fe1}:null;}})['then'](respondWithResult(_0x1ea684,null))[_0x245f('0x42')](handleError(_0x1ea684,null));};exports[_0x245f('0x4d')]=function(_0x4699ac,_0x19b38e,_0x1a5558){if(_0x4699ac[_0x245f('0x44')]['id']){delete _0x4699ac[_0x245f('0x44')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4699ac[_0x245f('0x3b')]['id']}})[_0x245f('0x21')](handleEntityNotFound(_0x19b38e,null))[_0x245f('0x21')](function(_0x51b3db){if(_0x51b3db){return _0x51b3db[_0x245f('0x4d')](_0x4699ac['body'][_0x245f('0x4e')]||[]);}return null;})[_0x245f('0x21')](respondWithResult(_0x19b38e,null))[_0x245f('0x42')](handleError(_0x19b38e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index e74b202..4e6803f 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 _0x844f=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x844f,0x67));var _0xf844=function(_0x5ac5d6,_0x51eb3e){_0x5ac5d6=_0x5ac5d6-0x0;var _0x2c8e34=_0x844f[_0x5ac5d6];return _0x2c8e34;};'use strict';var _=require('lodash');var util=require(_0xf844('0x0'));var logger=require(_0xf844('0x1'))(_0xf844('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf844('0x3'));var fs=require('fs');var path=require(_0xf844('0x4'));var rimraf=require('rimraf');var config=require(_0xf844('0x5'));var attributes=require(_0xf844('0x6'));module[_0xf844('0x7')]=function(_0x463a0a,_0x255e7d){return _0x463a0a[_0xf844('0x8')](_0xf844('0x9'),attributes,{'tableName':_0xf844('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11b4=['../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3eaefc,_0x3dea4f){var _0x48c06c=function(_0x56dd6e){while(--_0x56dd6e){_0x3eaefc['push'](_0x3eaefc['shift']());}};_0x48c06c(++_0x3dea4f);}(_0x11b4,0x88));var _0x411b=function(_0x3697bf,_0x462563){_0x3697bf=_0x3697bf-0x0;var _0x3bdd9c=_0x11b4[_0x3697bf];return _0x3bdd9c;};'use strict';var _=require(_0x411b('0x0'));var util=require(_0x411b('0x1'));var logger=require(_0x411b('0x2'))(_0x411b('0x3'));var moment=require(_0x411b('0x4'));var BPromise=require('bluebird');var rp=require(_0x411b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x411b('0x6'));var config=require(_0x411b('0x7'));var attributes=require(_0x411b('0x8'));module['exports']=function(_0x8657a5,_0x2a7224){return _0x8657a5[_0x411b('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x411b('0xa'),'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 5f3530a..db491a0 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 _0x89d4=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x507669,_0xcb0c75){var _0x602951=function(_0x13111e){while(--_0x13111e){_0x507669['push'](_0x507669['shift']());}};_0x602951(++_0xcb0c75);}(_0x89d4,0x1cf));var _0x489d=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x89d4[_0x4f0e62];return _0x117ab8;};'use strict';var _=require(_0x489d('0x0'));var util=require(_0x489d('0x1'));var moment=require(_0x489d('0x2'));var BPromise=require(_0x489d('0x3'));var rs=require(_0x489d('0x4'));var fs=require('fs');var Redis=require(_0x489d('0x5'));var db=require(_0x489d('0x6'))['db'];var utils=require(_0x489d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x489d('0x8'));var jayson=require(_0x489d('0x9'));var client=jayson[_0x489d('0xa')][_0x489d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x345dc1,_0x439afd,_0x243849){return new BPromise(function(_0x46c53a,_0x21ecfc){return client['request'](_0x345dc1,_0x243849)[_0x489d('0xc')](function(_0x329825){logger[_0x489d('0xd')](_0x489d('0xe'),_0x439afd,_0x489d('0xf'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x439afd,'request\x20sent',JSON[_0x489d('0x10')](_0x329825));if(_0x329825[_0x489d('0x11')]){if(_0x329825[_0x489d('0x11')][_0x489d('0x12')]===0x1f4){logger[_0x489d('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x439afd,_0x329825[_0x489d('0x11')][_0x489d('0x13')]);return _0x21ecfc(_0x329825[_0x489d('0x11')]['message']);}logger[_0x489d('0x11')](_0x489d('0xe'),_0x439afd,_0x329825[_0x489d('0x11')][_0x489d('0x13')]);return _0x46c53a(_0x329825['error']['message']);}else{logger[_0x489d('0xd')](_0x489d('0xe'),_0x439afd,'request\x20sent');_0x46c53a(_0x329825['result'][_0x489d('0x13')]);}})[_0x489d('0x14')](function(_0x41bcd2){logger[_0x489d('0x11')](_0x489d('0xe'),_0x439afd,_0x41bcd2);_0x21ecfc(_0x41bcd2);});});} \ No newline at end of file +var _0x26cc=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26cc,0x13f));var _0xc26c=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0x26cc[_0x56825b];return _0x69ce77;};'use strict';var _=require(_0xc26c('0x0'));var util=require(_0xc26c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc26c('0x2'));var fs=require('fs');var Redis=require(_0xc26c('0x3'));var db=require(_0xc26c('0x4'))['db'];var utils=require(_0xc26c('0x5'));var logger=require(_0xc26c('0x6'))(_0xc26c('0x7'));var config=require(_0xc26c('0x8'));var jayson=require(_0xc26c('0x9'));var client=jayson[_0xc26c('0xa')][_0xc26c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1758ce,_0x554100,_0x22bbf7){return new BPromise(function(_0x454f10,_0x3d93ec){return client[_0xc26c('0xc')](_0x1758ce,_0x22bbf7)[_0xc26c('0xd')](function(_0x3230aa){logger[_0xc26c('0xe')](_0xc26c('0xf'),_0x554100,_0xc26c('0x10'));logger[_0xc26c('0x11')](_0xc26c('0x12'),_0x554100,_0xc26c('0x10'),JSON[_0xc26c('0x13')](_0x3230aa));if(_0x3230aa[_0xc26c('0x14')]){if(_0x3230aa[_0xc26c('0x14')]['code']===0x1f4){logger[_0xc26c('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x554100,_0x3230aa['error'][_0xc26c('0x15')]);return _0x3d93ec(_0x3230aa[_0xc26c('0x14')][_0xc26c('0x15')]);}logger['error'](_0xc26c('0xf'),_0x554100,_0x3230aa[_0xc26c('0x14')][_0xc26c('0x15')]);return _0x454f10(_0x3230aa['error'][_0xc26c('0x15')]);}else{logger[_0xc26c('0xe')](_0xc26c('0xf'),_0x554100,_0xc26c('0x10'));_0x454f10(_0x3230aa[_0xc26c('0x16')][_0xc26c('0x15')]);}})[_0xc26c('0x17')](function(_0x21c73a){logger['error'](_0xc26c('0xf'),_0x554100,_0x21c73a);_0x3d93ec(_0x21c73a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 8e62950..b7cd131 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 _0xd8d1=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','./intFreshdeskField.controller'];(function(_0x1e5516,_0x5b9430){var _0x2caed7=function(_0x408b5c){while(--_0x408b5c){_0x1e5516['push'](_0x1e5516['shift']());}};_0x2caed7(++_0x5b9430);}(_0xd8d1,0x174));var _0x1d8d=function(_0x38a8f8,_0x1f577a){_0x38a8f8=_0x38a8f8-0x0;var _0x22c832=_0xd8d1[_0x38a8f8];return _0x22c832;};'use strict';var multer=require('multer');var util=require(_0x1d8d('0x0'));var path=require(_0x1d8d('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d8d('0x2'));var router=express[_0x1d8d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1d8d('0x4'));var config=require('../../config/environment');var controller=require(_0x1d8d('0x5'));router[_0x1d8d('0x6')]('/',auth[_0x1d8d('0x7')](),controller[_0x1d8d('0x8')]);router[_0x1d8d('0x6')](_0x1d8d('0x9'),auth['isAuthenticated'](),controller[_0x1d8d('0xa')]);router[_0x1d8d('0xb')]('/',auth[_0x1d8d('0x7')](),controller[_0x1d8d('0xc')]);router[_0x1d8d('0xd')](_0x1d8d('0x9'),auth[_0x1d8d('0x7')](),controller[_0x1d8d('0xe')]);router[_0x1d8d('0xf')](_0x1d8d('0x9'),auth['isAuthenticated'](),controller[_0x1d8d('0x10')]);module[_0x1d8d('0x11')]=router; \ No newline at end of file +var _0x1609=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1609,0x12b));var _0x9160=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x1609[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x9160('0x0'));var util=require(_0x9160('0x1'));var path=require(_0x9160('0x2'));var timeout=require(_0x9160('0x3'));var express=require(_0x9160('0x4'));var router=express['Router']();var fs_extra=require(_0x9160('0x5'));var auth=require(_0x9160('0x6'));var interaction=require(_0x9160('0x7'));var config=require(_0x9160('0x8'));var controller=require(_0x9160('0x9'));router[_0x9160('0xa')]('/',auth['isAuthenticated'](),controller[_0x9160('0xb')]);router['get'](_0x9160('0xc'),auth[_0x9160('0xd')](),controller[_0x9160('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9160('0xf')]);router[_0x9160('0x10')](_0x9160('0xc'),auth[_0x9160('0xd')](),controller['update']);router[_0x9160('0x11')]('/:id',auth[_0x9160('0xd')](),controller['destroy']);module[_0x9160('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5adb73d..fa1ca9e 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 _0xbf73=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','exports','string'];(function(_0x2c80c1,_0xf479b3){var _0x375cd8=function(_0xeb509a){while(--_0xeb509a){_0x2c80c1['push'](_0x2c80c1['shift']());}};_0x375cd8(++_0xf479b3);}(_0xbf73,0x130));var _0x3bf7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbf73[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x3bf7('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3bf7('0x1'),_0x3bf7('0x2'),_0x3bf7('0x3'),_0x3bf7('0x4'),_0x3bf7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3bf7('0x6')]},'key':{'type':Sequelize[_0x3bf7('0x6')]},'keyType':{'type':Sequelize[_0x3bf7('0x7')](_0x3bf7('0x1'),_0x3bf7('0x2'),_0x3bf7('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3bf7('0x6')]},'nameField':{'type':Sequelize[_0x3bf7('0x6')]},'customField':{'type':Sequelize[_0x3bf7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3bf7('0x6')]}}; \ No newline at end of file +var _0xe006=['STRING','customVariable','sequelize','exports','string','variable','keyValue','picklist'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe006,0x142));var _0x6e00=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0xe006[_0x26d386];return _0x4ef9a8;};'use strict';var Sequelize=require(_0x6e00('0x0'));module[_0x6e00('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6e00('0x2'),_0x6e00('0x3'),'customVariable',_0x6e00('0x4'),_0x6e00('0x5')),'defaultValue':_0x6e00('0x2')},'content':{'type':Sequelize[_0x6e00('0x6')]},'key':{'type':Sequelize[_0x6e00('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x6e00('0x2'),_0x6e00('0x3'),_0x6e00('0x7'))},'keyContent':{'type':Sequelize[_0x6e00('0x6')]},'idField':{'type':Sequelize[_0x6e00('0x6')]},'nameField':{'type':Sequelize[_0x6e00('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e00('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7d86f2f..5be8868 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 _0x9c5e=['body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','keys','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x1bbf75,_0x32c120){_0x1bbf75=_0x1bbf75-0x0;var _0x2cee40=_0x9c5e[_0x1bbf75];return _0x2cee40;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={},_0x46d253={},_0x334f5a={'count':0x0,'rows':[]};var _0x37cfa5=_[_0xe9c5('0x2c')](db['FreshdeskField'][_0xe9c5('0x2d')],function(_0x4fcabd){return{'name':_0x4fcabd[_0xe9c5('0x2e')],'type':_0x4fcabd['type'][_0xe9c5('0x2f')]};});_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x2c')](_0x37cfa5,_0xe9c5('0x2a'));_0x46d253[_0xe9c5('0x31')]=_['keys'](_0x2112a6[_0xe9c5('0x31')]);_0x46d253[_0xe9c5('0x32')]=_[_0xe9c5('0x33')](_0x46d253[_0xe9c5('0x30')],_0x46d253[_0xe9c5('0x31')]);_0x36d145['attributes']=_['intersection'](_0x46d253[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x35')]=_0x36d145[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x36d145[_0xe9c5('0x35')]:_0x46d253['model'];if(!_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x37')]('nolimit')){_0x36d145[_0xe9c5('0x1d')]=qs['limit'](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1d')]);_0x36d145[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1f')]);}_0x36d145[_0xe9c5('0x38')]=qs[_0xe9c5('0x39')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x39')]);_0x36d145[_0xe9c5('0x3a')]=qs[_0xe9c5('0x32')](_[_0xe9c5('0x3b')](_0x2112a6[_0xe9c5('0x31')],_0x46d253[_0xe9c5('0x32')]),_0x37cfa5);if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x3c')]){_0x36d145[_0xe9c5('0x3a')]=_[_0xe9c5('0x3d')](_0x36d145['where'],{'$or':_[_0xe9c5('0x2c')](_0x37cfa5,function(_0x2e3f15){if(_0x2e3f15[_0xe9c5('0x3e')]!==_0xe9c5('0x3f')){var _0x204b53={};_0x204b53[_0x2e3f15[_0xe9c5('0x2a')]]={'$like':'%'+_0x2112a6['query'][_0xe9c5('0x3c')]+'%'};return _0x204b53;}})});}_0x36d145=_[_0xe9c5('0x3d')]({},_0x36d145,_0x2112a6[_0xe9c5('0x40')]);var _0x480b83={'where':_0x36d145[_0xe9c5('0x3a')]};return db[_0xe9c5('0x41')][_0xe9c5('0x1e')](_0x480b83)[_0xe9c5('0x26')](function(_0x2c1615){_0x334f5a[_0xe9c5('0x1e')]=_0x2c1615;if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x36d145[_0xe9c5('0x43')]=[{'all':!![]}];}return db[_0xe9c5('0x41')][_0xe9c5('0x44')](_0x36d145);})['then'](function(_0x51dd18){_0x334f5a[_0xe9c5('0x45')]=_0x51dd18;return _0x334f5a;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x52d008,_0x36d145))[_0xe9c5('0x46')](handleError(_0x52d008,null));};exports[_0xe9c5('0x47')]=function(_0x4ca4b0,_0x4a3fc5){var _0x382405={'raw':!![],'where':{'id':_0x4ca4b0['params']['id']}},_0x144e85={};_0x144e85[_0xe9c5('0x30')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x144e85[_0xe9c5('0x31')]=_[_0xe9c5('0x48')](_0x4ca4b0[_0xe9c5('0x31')]);_0x144e85[_0xe9c5('0x32')]=_['intersection'](_0x144e85[_0xe9c5('0x30')],_0x144e85[_0xe9c5('0x31')]);_0x382405[_0xe9c5('0x35')]=_[_0xe9c5('0x33')](_0x144e85[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x382405['attributes']=_0x382405[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x382405[_0xe9c5('0x35')]:_0x144e85[_0xe9c5('0x30')];if(_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x382405['include']=[{'all':!![]}];}_0x382405=_['merge']({},_0x382405,_0x4ca4b0['options']);return db['FreshdeskField'][_0xe9c5('0x49')](_0x382405)[_0xe9c5('0x26')](handleEntityNotFound(_0x4a3fc5,null))[_0xe9c5('0x26')](respondWithResult(_0x4a3fc5,null))['catch'](handleError(_0x4a3fc5,null));};exports[_0xe9c5('0x4a')]=function(_0x520248,_0x1ed99e){return db[_0xe9c5('0x41')][_0xe9c5('0x4a')](_0x520248[_0xe9c5('0x4b')],{})['then'](respondWithResult(_0x1ed99e,0xc9))[_0xe9c5('0x46')](handleError(_0x1ed99e,null));};exports[_0xe9c5('0x25')]=function(_0x1da6a3,_0x249940){if(_0x1da6a3['body']['id']){delete _0x1da6a3[_0xe9c5('0x4b')]['id'];}return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x1da6a3[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x249940,null))[_0xe9c5('0x26')](saveUpdates(_0x1da6a3['body'],null))[_0xe9c5('0x26')](respondWithResult(_0x249940,null))[_0xe9c5('0x46')](handleError(_0x249940,null));};exports[_0xe9c5('0x27')]=function(_0x9d0154,_0x5e7c24){return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x9d0154[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x5e7c24,null))[_0xe9c5('0x26')](removeEntity(_0x5e7c24,null))[_0xe9c5('0x46')](handleError(_0x5e7c24,null));}; \ No newline at end of file +var _0x41bb=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','FreshdeskField','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x101dca,_0x349265){var _0x21c671=function(_0x252f27){while(--_0x252f27){_0x101dca['push'](_0x101dca['shift']());}};_0x21c671(++_0x349265);}(_0x41bb,0xc5));var _0xb41b=function(_0x586439,_0x5d62b5){_0x586439=_0x586439-0x0;var _0xa90581=_0x41bb[_0x586439];return _0xa90581;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require(_0xb41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb41b('0x2'));var rp=require('request-promise');var moment=require(_0xb41b('0x3'));var BPromise=require(_0xb41b('0x4'));var Mustache=require(_0xb41b('0x5'));var util=require(_0xb41b('0x6'));var path=require('path');var sox=require(_0xb41b('0x7'));var csv=require(_0xb41b('0x8'));var ejs=require(_0xb41b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x8'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var as=require(_0xb41b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb41b('0x12'))('api');var utils=require(_0xb41b('0x13'));var config=require(_0xb41b('0x14'));var licenseUtil=require(_0xb41b('0x15'));var db=require(_0xb41b('0x16'))['db'];function respondWithStatusCode(_0x2066d5,_0x5f1ea4){_0x5f1ea4=_0x5f1ea4||0xcc;return function(_0x353ba3){if(_0x353ba3){return _0x2066d5[_0xb41b('0x17')](_0x5f1ea4);}return _0x2066d5[_0xb41b('0x18')](_0x5f1ea4)[_0xb41b('0x19')]();};}function respondWithResult(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xc8;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['status'](_0x4e8603)[_0xb41b('0x1a')](_0x4e7f11);}};}function respondWithFilteredResult(_0xdc5fb0,_0x143a81){return function(_0x338920){if(_0x338920){var _0x29ea51=typeof _0x143a81['offset']===_0xb41b('0x1b')&&typeof _0x143a81[_0xb41b('0x1c')]===_0xb41b('0x1b');var _0xcf0728=_0x338920[_0xb41b('0x1d')];var _0x47154d=_0x29ea51?0x0:_0x143a81[_0xb41b('0x1e')];var _0x5df8c2=_0x29ea51?_0x338920['count']:_0x143a81['offset']+_0x143a81[_0xb41b('0x1c')];var _0x503e86;if(_0x5df8c2>=_0xcf0728){_0x5df8c2=_0xcf0728;_0x503e86=0xc8;}else{_0x503e86=0xce;}_0xdc5fb0[_0xb41b('0x18')](_0x503e86);return _0xdc5fb0[_0xb41b('0x1f')](_0xb41b('0x20'),_0x47154d+'-'+_0x5df8c2+'/'+_0xcf0728)['json'](_0x338920);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x21')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x22')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x23')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x24')](_0x42dccb)[_0xb41b('0x25')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x25')](function(){_0x583741[_0xb41b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed3c7e,_0x4a7992){return function(_0x2d0f27){if(!_0x2d0f27){_0xed3c7e[_0xb41b('0x17')](0x194);}return _0x2d0f27;};}function handleError(_0x53e3a2,_0x3af2c){_0x3af2c=_0x3af2c||0x1f4;return function(_0x4265b8){logger['error'](_0x4265b8['stack']);if(_0x4265b8[_0xb41b('0x26')]){delete _0x4265b8[_0xb41b('0x26')];}_0x53e3a2[_0xb41b('0x18')](_0x3af2c)[_0xb41b('0x27')](_0x4265b8);};}exports[_0xb41b('0x28')]=function(_0x181cbd,_0x253efb){var _0x545395={},_0x26ef96={},_0xb68029={'count':0x0,'rows':[]};var _0x5069aa=_[_0xb41b('0x29')](db['FreshdeskField'][_0xb41b('0x2a')],function(_0x31d4cd){return{'name':_0x31d4cd['fieldName'],'type':_0x31d4cd[_0xb41b('0x2b')]['key']};});_0x26ef96[_0xb41b('0x2c')]=_[_0xb41b('0x29')](_0x5069aa,'name');_0x26ef96[_0xb41b('0x2d')]=_[_0xb41b('0x2e')](_0x181cbd[_0xb41b('0x2d')]);_0x26ef96[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],_0x26ef96[_0xb41b('0x2d')]);_0x545395[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],qs['fields'](_0x181cbd[_0xb41b('0x2d')]['fields']));_0x545395['attributes']=_0x545395[_0xb41b('0x31')][_0xb41b('0x32')]?_0x545395[_0xb41b('0x31')]:_0x26ef96[_0xb41b('0x2c')];if(!_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x33')](_0xb41b('0x34'))){_0x545395[_0xb41b('0x1c')]=qs[_0xb41b('0x1c')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1c')]);_0x545395['offset']=qs[_0xb41b('0x1e')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1e')]);}_0x545395[_0xb41b('0x35')]=qs[_0xb41b('0x36')](_0x181cbd[_0xb41b('0x2d')]['sort']);_0x545395['where']=qs[_0xb41b('0x2f')](_[_0xb41b('0x37')](_0x181cbd['query'],_0x26ef96[_0xb41b('0x2f')]),_0x5069aa);if(_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]){_0x545395[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x545395['where'],{'$or':_[_0xb41b('0x29')](_0x5069aa,function(_0x5775d3){if(_0x5775d3[_0xb41b('0x2b')]!==_0xb41b('0x3b')){var _0x799d6={};_0x799d6[_0x5775d3[_0xb41b('0x26')]]={'$like':'%'+_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]+'%'};return _0x799d6;}})});}_0x545395=_[_0xb41b('0x3a')]({},_0x545395,_0x181cbd[_0xb41b('0x3c')]);var _0x2b0721={'where':_0x545395['where']};return db['FreshdeskField']['count'](_0x2b0721)[_0xb41b('0x25')](function(_0x5147ce){_0xb68029['count']=_0x5147ce;if(_0x181cbd[_0xb41b('0x2d')]['includeAll']){_0x545395[_0xb41b('0x3d')]=[{'all':!![]}];}return db[_0xb41b('0x3e')][_0xb41b('0x3f')](_0x545395);})[_0xb41b('0x25')](function(_0x4fa390){_0xb68029[_0xb41b('0x40')]=_0x4fa390;return _0xb68029;})[_0xb41b('0x25')](respondWithFilteredResult(_0x253efb,_0x545395))['catch'](handleError(_0x253efb,null));};exports[_0xb41b('0x41')]=function(_0xa70324,_0x3f181c){var _0x174d6c={'raw':!![],'where':{'id':_0xa70324[_0xb41b('0x42')]['id']}},_0x47bab5={};_0x47bab5['model']=_[_0xb41b('0x2e')](db[_0xb41b('0x3e')][_0xb41b('0x2a')]);_0x47bab5['query']=_['keys'](_0xa70324[_0xb41b('0x2d')]);_0x47bab5[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x47bab5[_0xb41b('0x2c')],_0x47bab5[_0xb41b('0x2d')]);_0x174d6c[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x47bab5['model'],qs['fields'](_0xa70324[_0xb41b('0x2d')]['fields']));_0x174d6c[_0xb41b('0x31')]=_0x174d6c['attributes'][_0xb41b('0x32')]?_0x174d6c['attributes']:_0x47bab5[_0xb41b('0x2c')];if(_0xa70324['query'][_0xb41b('0x43')]){_0x174d6c[_0xb41b('0x3d')]=[{'all':!![]}];}_0x174d6c=_[_0xb41b('0x3a')]({},_0x174d6c,_0xa70324[_0xb41b('0x3c')]);return db['FreshdeskField'][_0xb41b('0x44')](_0x174d6c)[_0xb41b('0x25')](handleEntityNotFound(_0x3f181c,null))['then'](respondWithResult(_0x3f181c,null))[_0xb41b('0x45')](handleError(_0x3f181c,null));};exports['create']=function(_0x5cc658,_0x5733d0){return db['FreshdeskField'][_0xb41b('0x46')](_0x5cc658[_0xb41b('0x47')],{})[_0xb41b('0x25')](respondWithResult(_0x5733d0,0xc9))[_0xb41b('0x45')](handleError(_0x5733d0,null));};exports[_0xb41b('0x24')]=function(_0x349a6c,_0x34d076){if(_0x349a6c[_0xb41b('0x47')]['id']){delete _0x349a6c[_0xb41b('0x47')]['id'];}return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x349a6c[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x34d076,null))[_0xb41b('0x25')](saveUpdates(_0x349a6c[_0xb41b('0x47')],null))[_0xb41b('0x25')](respondWithResult(_0x34d076,null))['catch'](handleError(_0x34d076,null));};exports[_0xb41b('0x48')]=function(_0x5e041d,_0x4a7aa3){return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x5e041d[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x4a7aa3,null))[_0xb41b('0x25')](removeEntity(_0x4a7aa3,null))[_0xb41b('0x45')](handleError(_0x4a7aa3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4c9a647..f5d8788 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 _0x9f78=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','FreshdeskField','freshdesk_unique_index','lodash','util'];(function(_0x53abed,_0x3656e8){var _0x402ebc=function(_0x165f56){while(--_0x165f56){_0x53abed['push'](_0x53abed['shift']());}};_0x402ebc(++_0x3656e8);}(_0x9f78,0x76));var _0x89f7=function(_0x5cbb42,_0xcb7a75){_0x5cbb42=_0x5cbb42-0x0;var _0x37761c=_0x9f78[_0x5cbb42];return _0x37761c;};'use strict';var _=require(_0x89f7('0x0'));var util=require(_0x89f7('0x1'));var logger=require(_0x89f7('0x2'))(_0x89f7('0x3'));var moment=require(_0x89f7('0x4'));var BPromise=require('bluebird');var rp=require(_0x89f7('0x5'));var fs=require('fs');var path=require(_0x89f7('0x6'));var rimraf=require('rimraf');var config=require(_0x89f7('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x89f7('0x8')]=function(_0x3ea47a,_0xbec568){return _0x3ea47a[_0x89f7('0x9')](_0x89f7('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x89f7('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf1f=['lodash','api','moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','idField','FieldId'];(function(_0x7bc197,_0x322cee){var _0x34bce9=function(_0x12fa7b){while(--_0x12fa7b){_0x7bc197['push'](_0x7bc197['shift']());}};_0x34bce9(++_0x322cee);}(_0xdf1f,0x1ec));var _0xfdf1=function(_0x1b64bd,_0x3071e2){_0x1b64bd=_0x1b64bd-0x0;var _0x303f29=_0xdf1f[_0x1b64bd];return _0x303f29;};'use strict';var _=require(_0xfdf1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfdf1('0x1'));var moment=require(_0xfdf1('0x2'));var BPromise=require(_0xfdf1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdf1('0x4'));var rimraf=require('rimraf');var config=require(_0xfdf1('0x5'));var attributes=require(_0xfdf1('0x6'));module[_0xfdf1('0x7')]=function(_0x67ce1b,_0x41c10a){return _0x67ce1b[_0xfdf1('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xfdf1('0x9'),'fields':[_0xfdf1('0xa'),_0xfdf1('0xb')],'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 dbb4280..790d125 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 _0x351d=['client','http','request','info','request\x20sent','debug','stringify','error','FreshdeskField,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x116346,_0x460a97){var _0x2eb2b1=function(_0x2d310a){while(--_0x2d310a){_0x116346['push'](_0x116346['shift']());}};_0x2eb2b1(++_0x460a97);}(_0x351d,0x90));var _0xd351=function(_0xbd5c1a,_0x1ca984){_0xbd5c1a=_0xbd5c1a-0x0;var _0x1dd088=_0x351d[_0xbd5c1a];return _0x1dd088;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});} \ No newline at end of file +var _0xa2f1=['then','info','request\x20sent','stringify','code','FreshdeskField,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5eb022,_0xb010ee){var _0x1be654=function(_0xfc4943){while(--_0xfc4943){_0x5eb022['push'](_0x5eb022['shift']());}};_0x1be654(++_0xb010ee);}(_0xa2f1,0x186));var _0x1a2f=function(_0x40778f,_0x44516d){_0x40778f=_0x40778f-0x0;var _0x2bdae6=_0xa2f1[_0x40778f];return _0x2bdae6;};'use strict';var _=require(_0x1a2f('0x0'));var util=require(_0x1a2f('0x1'));var moment=require(_0x1a2f('0x2'));var BPromise=require(_0x1a2f('0x3'));var rs=require(_0x1a2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a2f('0x5'));var logger=require('../../config/logger')(_0x1a2f('0x6'));var config=require(_0x1a2f('0x7'));var jayson=require(_0x1a2f('0x8'));var client=jayson['client'][_0x1a2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ef297,_0x3a85f9,_0x358826){return new BPromise(function(_0x18c1f6,_0x37e2b3){return client['request'](_0x1ef297,_0x358826)[_0x1a2f('0xa')](function(_0x4d4611){logger[_0x1a2f('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x3a85f9,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3a85f9,_0x1a2f('0xc'),JSON[_0x1a2f('0xd')](_0x4d4611));if(_0x4d4611['error']){if(_0x4d4611['error'][_0x1a2f('0xe')]===0x1f4){logger['error'](_0x1a2f('0xf'),_0x3a85f9,_0x4d4611[_0x1a2f('0x10')][_0x1a2f('0x11')]);return _0x37e2b3(_0x4d4611['error'][_0x1a2f('0x11')]);}logger[_0x1a2f('0x10')](_0x1a2f('0xf'),_0x3a85f9,_0x4d4611[_0x1a2f('0x10')][_0x1a2f('0x11')]);return _0x18c1f6(_0x4d4611[_0x1a2f('0x10')][_0x1a2f('0x11')]);}else{logger[_0x1a2f('0xb')](_0x1a2f('0xf'),_0x3a85f9,_0x1a2f('0xc'));_0x18c1f6(_0x4d4611[_0x1a2f('0x12')][_0x1a2f('0x11')]);}})[_0x1a2f('0x13')](function(_0x6f62a5){logger['error'](_0x1a2f('0xf'),_0x3a85f9,_0x6f62a5);_0x37e2b3(_0x6f62a5);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index de2bc7d..ae2f84b 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 _0xc900=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x44def8,_0x11ed94){var _0x58985f=function(_0x2d560f){while(--_0x2d560f){_0x44def8['push'](_0x44def8['shift']());}};_0x58985f(++_0x11ed94);}(_0xc900,0xb3));var _0x0c90=function(_0x1e5543,_0x5815d2){_0x1e5543=_0x1e5543-0x0;var _0x36ce52=_0xc900[_0x1e5543];return _0x36ce52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c90('0x0'));var timeout=require(_0x0c90('0x1'));var express=require(_0x0c90('0x2'));var router=express['Router']();var fs_extra=require(_0x0c90('0x3'));var auth=require(_0x0c90('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0c90('0x5'));var controller=require(_0x0c90('0x6'));router[_0x0c90('0x7')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x9')]);router[_0x0c90('0x7')]('/:id',auth[_0x0c90('0x8')](),controller[_0x0c90('0xa')]);router[_0x0c90('0x7')](_0x0c90('0xb'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xc')]);router[_0x0c90('0x7')](_0x0c90('0xd'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xe')]);router[_0x0c90('0xf')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x10')]);router['post'](_0x0c90('0xb'),auth['isAuthenticated'](),controller[_0x0c90('0x11')]);router['put'](_0x0c90('0x12'),auth[_0x0c90('0x8')](),controller[_0x0c90('0x13')]);router[_0x0c90('0x14')](_0x0c90('0x12'),auth['isAuthenticated'](),controller[_0x0c90('0x15')]);module[_0x0c90('0x16')]=router; \ No newline at end of file +var _0x6cb4=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','delete'];(function(_0x38f737,_0x54f685){var _0x7afda3=function(_0x1ac1d7){while(--_0x1ac1d7){_0x38f737['push'](_0x38f737['shift']());}};_0x7afda3(++_0x54f685);}(_0x6cb4,0xff));var _0x46cb=function(_0x10f2de,_0x2cedaf){_0x10f2de=_0x10f2de-0x0;var _0x2450fe=_0x6cb4[_0x10f2de];return _0x2450fe;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/fields',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['post']('/',auth[_0x46cb('0xa')](),controller[_0x46cb('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller['update']);router[_0x46cb('0x14')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x15')]);module[_0x46cb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 548c026..6254067 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x27f026,_0x469929){var _0x1019bc=function(_0xf8e221){while(--_0xf8e221){_0x27f026['push'](_0x27f026['shift']());}};_0x1019bc(++_0x469929);}(_0x0120,0x6f));var _0x0012=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0120[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb145=['STRING','username','remoteUri','exports'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0xb145,0xa3));var _0x5b14=function(_0x5e00bd,_0x54532d){_0x5e00bd=_0x5e00bd-0x0;var _0x11b429=_0xb145[_0x5e00bd];return _0x11b429;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'name':{'type':Sequelize[_0x5b14('0x1')]},'description':{'type':Sequelize[_0x5b14('0x1')]},'username':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x2')},'apiKey':{'type':Sequelize[_0x5b14('0x1')]},'remoteUri':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index af3a184..b54b1cc 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 _0x11eb=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','length','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x199572,_0x5b76c6){var _0x29948e=function(_0x41f3f){while(--_0x41f3f){_0x199572['push'](_0x199572['shift']());}};_0x29948e(++_0x5b76c6);}(_0x11eb,0xbf));var _0xb11e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x11eb[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb11e('0x0'));var jsonpatch=require(_0xb11e('0x1'));var rp=require(_0xb11e('0x2'));var moment=require(_0xb11e('0x3'));var BPromise=require(_0xb11e('0x4'));var Mustache=require('mustache');var util=require(_0xb11e('0x5'));var path=require('path');var sox=require(_0xb11e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb11e('0x7'));var _=require(_0xb11e('0x8'));var squel=require(_0xb11e('0x9'));var crypto=require(_0xb11e('0xa'));var jsforce=require(_0xb11e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb11e('0xc'));var querystring=require(_0xb11e('0xd'));var Papa=require('papaparse');var Redis=require(_0xb11e('0xe'));var authService=require(_0xb11e('0xf'));var qs=require(_0xb11e('0x10'));var as=require(_0xb11e('0x11'));var hardwareService=require(_0xb11e('0x12'));var logger=require(_0xb11e('0x13'))('api');var utils=require(_0xb11e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb11e('0x15'));var db=require(_0xb11e('0x16'))['db'];var integrations=require(_0xb11e('0x17'));function respondWithStatusCode(_0x293bbb,_0x5296b4){_0x5296b4=_0x5296b4||0xcc;return function(_0x18e53d){if(_0x18e53d){return _0x293bbb[_0xb11e('0x18')](_0x5296b4);}return _0x293bbb[_0xb11e('0x19')](_0x5296b4)[_0xb11e('0x1a')]();};}function respondWithResult(_0x2935a9,_0x23ea79){_0x23ea79=_0x23ea79||0xc8;return function(_0x3a2510){if(_0x3a2510){return _0x2935a9[_0xb11e('0x19')](_0x23ea79)[_0xb11e('0x1b')](_0x3a2510);}};}function respondWithFilteredResult(_0x5a949f,_0x59cb6e){return function(_0x5cd8d3){if(_0x5cd8d3){var _0x3ca61f=typeof _0x59cb6e[_0xb11e('0x1c')]===_0xb11e('0x1d')&&typeof _0x59cb6e['limit']==='undefined';var _0x8fea0b=_0x5cd8d3[_0xb11e('0x1e')];var _0x329b8e=_0x3ca61f?0x0:_0x59cb6e[_0xb11e('0x1c')];var _0x27cf77=_0x3ca61f?_0x5cd8d3['count']:_0x59cb6e[_0xb11e('0x1c')]+_0x59cb6e[_0xb11e('0x1f')];var _0x211b5f;if(_0x27cf77>=_0x8fea0b){_0x27cf77=_0x8fea0b;_0x211b5f=0xc8;}else{_0x211b5f=0xce;}_0x5a949f['status'](_0x211b5f);return _0x5a949f[_0xb11e('0x20')]('Content-Range',_0x329b8e+'-'+_0x27cf77+'/'+_0x8fea0b)[_0xb11e('0x1b')](_0x5cd8d3);}return null;};}function patchUpdates(_0x65acd2){return function(_0x5e237a){try{jsonpatch['apply'](_0x5e237a,_0x65acd2,!![]);}catch(_0x3520d3){return BPromise[_0xb11e('0x21')](_0x3520d3);}return _0x5e237a['save']();};}function saveUpdates(_0x3cc1ec,_0x4b22ff){return function(_0x39ed05){if(_0x39ed05){return _0x39ed05[_0xb11e('0x22')](_0x3cc1ec)[_0xb11e('0x23')](function(_0x1e4e34){return _0x1e4e34;});}return null;};}function removeEntity(_0x3476b3,_0x1497f7){return function(_0x507fe7){if(_0x507fe7){return _0x507fe7[_0xb11e('0x24')]()['then'](function(){_0x3476b3['status'](0xcc)[_0xb11e('0x1a')]();});}};}function handleEntityNotFound(_0x13ab1b,_0x1233cd){return function(_0x2fb8cc){if(!_0x2fb8cc){_0x13ab1b[_0xb11e('0x18')](0x194);}return _0x2fb8cc;};}function handleError(_0x2ef8e3,_0x409499){_0x409499=_0x409499||0x1f4;return function(_0x4a5568){logger[_0xb11e('0x25')](_0x4a5568[_0xb11e('0x26')]);if(_0x4a5568[_0xb11e('0x27')]){delete _0x4a5568[_0xb11e('0x27')];}_0x2ef8e3[_0xb11e('0x19')](_0x409499)[_0xb11e('0x28')](_0x4a5568);};}exports[_0xb11e('0x29')]=function(_0x313bec,_0xfd6e2){var _0x97a364={},_0x596362={},_0x5212ed={'count':0x0,'rows':[]};var _0x288eda=_[_0xb11e('0x2a')](db[_0xb11e('0x2b')][_0xb11e('0x2c')],function(_0x21a78a){return{'name':_0x21a78a[_0xb11e('0x2d')],'type':_0x21a78a[_0xb11e('0x2e')]['key']};});_0x596362[_0xb11e('0x2f')]=_['map'](_0x288eda,_0xb11e('0x27'));_0x596362['query']=_[_0xb11e('0x30')](_0x313bec['query']);_0x596362[_0xb11e('0x31')]=_[_0xb11e('0x32')](_0x596362[_0xb11e('0x2f')],_0x596362[_0xb11e('0x33')]);_0x97a364[_0xb11e('0x34')]=_[_0xb11e('0x32')](_0x596362[_0xb11e('0x2f')],qs['fields'](_0x313bec[_0xb11e('0x33')][_0xb11e('0x35')]));_0x97a364['attributes']=_0x97a364['attributes']['length']?_0x97a364['attributes']:_0x596362['model'];if(!_0x313bec[_0xb11e('0x33')][_0xb11e('0x36')](_0xb11e('0x37'))){_0x97a364[_0xb11e('0x1f')]=qs['limit'](_0x313bec[_0xb11e('0x33')][_0xb11e('0x1f')]);_0x97a364[_0xb11e('0x1c')]=qs[_0xb11e('0x1c')](_0x313bec[_0xb11e('0x33')][_0xb11e('0x1c')]);}_0x97a364['order']=qs[_0xb11e('0x38')](_0x313bec[_0xb11e('0x33')]['sort']);_0x97a364[_0xb11e('0x39')]=qs[_0xb11e('0x31')](_[_0xb11e('0x3a')](_0x313bec['query'],_0x596362[_0xb11e('0x31')]),_0x288eda);if(_0x313bec['query'][_0xb11e('0x3b')]){_0x97a364[_0xb11e('0x39')]=_[_0xb11e('0x3c')](_0x97a364[_0xb11e('0x39')],{'$or':_['map'](_0x288eda,function(_0x2bb4aa){if(_0x2bb4aa[_0xb11e('0x2e')]!==_0xb11e('0x3d')){var _0x1fd8cc={};_0x1fd8cc[_0x2bb4aa[_0xb11e('0x27')]]={'$like':'%'+_0x313bec['query'][_0xb11e('0x3b')]+'%'};return _0x1fd8cc;}})});}_0x97a364=_['merge']({},_0x97a364,_0x313bec[_0xb11e('0x3e')]);var _0x5988d4={'where':_0x97a364[_0xb11e('0x39')]};return db[_0xb11e('0x2b')]['count'](_0x5988d4)[_0xb11e('0x23')](function(_0x19d1cb){_0x5212ed[_0xb11e('0x1e')]=_0x19d1cb;if(_0x313bec[_0xb11e('0x33')][_0xb11e('0x3f')]){_0x97a364[_0xb11e('0x40')]=[{'all':!![]}];}return db[_0xb11e('0x2b')][_0xb11e('0x41')](_0x97a364);})[_0xb11e('0x23')](function(_0x288f52){_0x5212ed[_0xb11e('0x42')]=_0x288f52;return _0x5212ed;})[_0xb11e('0x23')](respondWithFilteredResult(_0xfd6e2,_0x97a364))[_0xb11e('0x43')](handleError(_0xfd6e2,null));};exports[_0xb11e('0x44')]=function(_0x3674c2,_0x35d68d){var _0x35e021={'raw':![],'where':{'id':_0x3674c2['params']['id']}},_0x49489f={};_0x49489f[_0xb11e('0x2f')]=_[_0xb11e('0x30')](db[_0xb11e('0x2b')]['rawAttributes']);_0x49489f[_0xb11e('0x33')]=_['keys'](_0x3674c2['query']);_0x49489f[_0xb11e('0x31')]=_[_0xb11e('0x32')](_0x49489f['model'],_0x49489f[_0xb11e('0x33')]);_0x35e021[_0xb11e('0x34')]=_[_0xb11e('0x32')](_0x49489f[_0xb11e('0x2f')],qs[_0xb11e('0x35')](_0x3674c2[_0xb11e('0x33')][_0xb11e('0x35')]));_0x35e021[_0xb11e('0x34')]=_0x35e021[_0xb11e('0x34')]['length']?_0x35e021[_0xb11e('0x34')]:_0x49489f['model'];if(_0x3674c2['query'][_0xb11e('0x3f')]){_0x35e021[_0xb11e('0x40')]=[{'all':!![]}];}_0x35e021=_[_0xb11e('0x3c')]({},_0x35e021,_0x3674c2[_0xb11e('0x3e')]);return db[_0xb11e('0x2b')][_0xb11e('0x45')](_0x35e021)[_0xb11e('0x23')](handleEntityNotFound(_0x35d68d,null))[_0xb11e('0x23')](respondWithResult(_0x35d68d,null))[_0xb11e('0x43')](handleError(_0x35d68d,null));};exports['create']=function(_0x1b00f1,_0x3e7a99){return db[_0xb11e('0x2b')][_0xb11e('0x46')](_0x1b00f1[_0xb11e('0x47')],{})[_0xb11e('0x23')](respondWithResult(_0x3e7a99,0xc9))['catch'](handleError(_0x3e7a99,null));};exports[_0xb11e('0x22')]=function(_0x57c525,_0x2307fe){if(_0x57c525[_0xb11e('0x47')]['id']){delete _0x57c525['body']['id'];}return db['FreshsalesAccount'][_0xb11e('0x45')]({'where':{'id':_0x57c525[_0xb11e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2307fe,null))[_0xb11e('0x23')](saveUpdates(_0x57c525[_0xb11e('0x47')],null))['then'](respondWithResult(_0x2307fe,null))[_0xb11e('0x43')](handleError(_0x2307fe,null));};exports['destroy']=function(_0x46ff88,_0x43e4e0){return db['FreshsalesAccount'][_0xb11e('0x45')]({'where':{'id':_0x46ff88['params']['id']}})[_0xb11e('0x23')](handleEntityNotFound(_0x43e4e0,null))['then'](removeEntity(_0x43e4e0,null))['catch'](handleError(_0x43e4e0,null));};exports[_0xb11e('0x49')]=function(_0x52ec27,_0x432f49,_0x323f13){var _0x11e476={};var _0x50d1ea={};var _0x2270e8;var _0x294c2d;return db[_0xb11e('0x2b')][_0xb11e('0x4a')]({'where':{'id':_0x52ec27[_0xb11e('0x48')]['id']}})['then'](handleEntityNotFound(_0x432f49,null))[_0xb11e('0x23')](function(_0x48a5c7){if(_0x48a5c7){_0x2270e8=_0x48a5c7;_0x50d1ea[_0xb11e('0x2f')]=_[_0xb11e('0x30')](db[_0xb11e('0x4b')][_0xb11e('0x2c')]);_0x50d1ea['query']=_['keys'](_0x52ec27[_0xb11e('0x33')]);_0x50d1ea['filters']=_[_0xb11e('0x32')](_0x50d1ea['model'],_0x50d1ea['query']);_0x11e476[_0xb11e('0x34')]=_[_0xb11e('0x32')](_0x50d1ea[_0xb11e('0x2f')],qs['fields'](_0x52ec27[_0xb11e('0x33')][_0xb11e('0x35')]));_0x11e476['attributes']=_0x11e476[_0xb11e('0x34')][_0xb11e('0x4c')]?_0x11e476[_0xb11e('0x34')]:_0x50d1ea[_0xb11e('0x2f')];_0x11e476[_0xb11e('0x4d')]=qs[_0xb11e('0x38')](_0x52ec27['query'][_0xb11e('0x38')]);_0x11e476['where']=qs[_0xb11e('0x31')](_[_0xb11e('0x3a')](_0x52ec27[_0xb11e('0x33')],_0x50d1ea[_0xb11e('0x31')]));if(_0x52ec27[_0xb11e('0x33')]['filter']){_0x11e476['where']=_[_0xb11e('0x3c')](_0x11e476[_0xb11e('0x39')],{'$or':_[_0xb11e('0x2a')](_0x11e476[_0xb11e('0x34')],function(_0x4a3f09){var _0x3b5ef6={};_0x3b5ef6[_0x4a3f09]={'$like':'%'+_0x52ec27[_0xb11e('0x33')][_0xb11e('0x3b')]+'%'};return _0x3b5ef6;})});}_0x11e476=_[_0xb11e('0x3c')]({},_0x11e476,_0x52ec27[_0xb11e('0x3e')]);return _0x2270e8[_0xb11e('0x49')](_0x11e476);}})['then'](function(_0x37ac53){if(_0x37ac53){_0x294c2d=_0x37ac53[_0xb11e('0x4c')];if(!_0x52ec27[_0xb11e('0x33')]['hasOwnProperty'](_0xb11e('0x37'))){_0x11e476[_0xb11e('0x1f')]=qs[_0xb11e('0x1f')](_0x52ec27[_0xb11e('0x33')][_0xb11e('0x1f')]);_0x11e476[_0xb11e('0x1c')]=qs[_0xb11e('0x1c')](_0x52ec27[_0xb11e('0x33')][_0xb11e('0x1c')]);}return _0x2270e8[_0xb11e('0x49')](_0x11e476);}})['then'](function(_0x5573ea){if(_0x5573ea){return _0x5573ea?{'count':_0x294c2d,'rows':_0x5573ea}:null;}})[_0xb11e('0x23')](respondWithResult(_0x432f49,null))[_0xb11e('0x43')](handleError(_0x432f49,null));};exports[_0xb11e('0x4e')]=function(_0x58abab,_0x1a8080,_0x16e8db){if(_0x58abab[_0xb11e('0x47')]['id']){delete _0x58abab[_0xb11e('0x47')]['id'];}return db[_0xb11e('0x2b')][_0xb11e('0x4a')]({'where':{'id':_0x58abab[_0xb11e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a8080,null))[_0xb11e('0x23')](function(_0xf47913){if(_0xf47913){_0x58abab[_0xb11e('0x47')][_0xb11e('0x4f')]=_0xf47913['id'];_0x58abab[_0xb11e('0x47')][_0xb11e('0x50')]=integrations[_0xb11e('0x51')](_0x58abab[_0xb11e('0x47')][_0xb11e('0x52')],_0x58abab[_0xb11e('0x47')][_0xb11e('0x2e')]);_0x58abab['body'][_0xb11e('0x53')]=integrations[_0xb11e('0x54')](_0x58abab['body'][_0xb11e('0x52')],_0x58abab[_0xb11e('0x47')][_0xb11e('0x2e')]);return db[_0xb11e('0x4b')][_0xb11e('0x46')](_0x58abab[_0xb11e('0x47')],{'include':[{'model':db[_0xb11e('0x55')],'as':_0xb11e('0x50')},{'model':db[_0xb11e('0x55')],'as':_0xb11e('0x53')}]});}return null;})[_0xb11e('0x23')](respondWithResult(_0x1a8080,null))[_0xb11e('0x43')](handleError(_0x1a8080,null));};exports[_0xb11e('0x56')]=function(_0x38b8d7,_0x32bf9e,_0x2473ce){var _0x5e4866='';var _0x5966c0='';return db[_0xb11e('0x2b')]['findOne']({'where':{'id':_0x38b8d7[_0xb11e('0x48')]['id']},'attributes':['id',_0xb11e('0x57'),'remoteUri',_0xb11e('0x58')]})[_0xb11e('0x23')](handleEntityNotFound(_0x32bf9e,null))['then'](function(_0x2af6bb){if(_0x2af6bb){_0x5966c0=_0x2af6bb['username'];_0x5e4866=_0x2af6bb[_0xb11e('0x59')];var _0x1b66b0=_0x2af6bb['remoteUri'][_0xb11e('0x5a')](-0x1);if(_0x1b66b0==='/'){_0x5e4866=_0x5e4866[_0xb11e('0x5b')](0x0,_0x5e4866[_0xb11e('0x5c')](_0x1b66b0));}return rp({'method':_0xb11e('0x5d'),'uri':util[_0xb11e('0x5e')](_0xb11e('0x5f'),_0x5e4866,_0xb11e('0x60')),'headers':{'Authorization':_0xb11e('0x61')+_0x2af6bb[_0xb11e('0x58')]},'json':!![]});}})[_0xb11e('0x23')](function(_0x762765){if(_0x762765){var _0x2ce543=_0x762765[_0xb11e('0x62')];var _0x57fbd0=![];var _0x1a2e8b=null;for(_0x1a2e8b=0x0;_0x1a2e8b<_0x2ce543[_0xb11e('0x4c')];_0x1a2e8b++){if(_0x2ce543[_0x1a2e8b][_0xb11e('0x63')]===_0x5966c0){_0x57fbd0=!![];}}if(_0x57fbd0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb11e('0x64')});}}})[_0xb11e('0x23')](respondWithResult(_0x32bf9e,null))[_0xb11e('0x43')](function(_0x282a09){var _0x53f018=_0x38b8d7[_0xb11e('0x33')][_0xb11e('0x65')]?0x1f4:_0x282a09[_0xb11e('0x66')]||0x1f4;logger[_0xb11e('0x25')](_0xb11e('0x67'),_0xb11e('0x56'),_0x53f018,JSON[_0xb11e('0x68')](_0x282a09));delete _0x282a09['name'];if(_0x53f018===0x191){_0x53f018=0x190;}_0x32bf9e[_0xb11e('0x19')](_0x53f018)[_0xb11e('0x28')](_0x38b8d7[_0xb11e('0x33')]['test']?{'message':_0xb11e('0x69'),'statusCode':_0x282a09[_0xb11e('0x66')]}:_0x282a09);});}; \ No newline at end of file +var _0x2957=['apiKey','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','then','error','stack','name','send','index','map','FreshsalesAccount','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','update','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','remoteUri','username','slice','substring','lastIndexOf','%s%s','Token\x20token='];(function(_0x33f213,_0xba86c6){var _0x4b953a=function(_0x5ea3d7){while(--_0x5ea3d7){_0x33f213['push'](_0x33f213['shift']());}};_0x4b953a(++_0xba86c6);}(_0x2957,0x1a4));var _0x7295=function(_0xc5fc31,_0x5b9de2){_0xc5fc31=_0xc5fc31-0x0;var _0x4e5cdf=_0x2957[_0xc5fc31];return _0x4e5cdf;};'use strict';var emlformat=require(_0x7295('0x0'));var rimraf=require(_0x7295('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7295('0x2'));var rp=require(_0x7295('0x3'));var moment=require(_0x7295('0x4'));var BPromise=require(_0x7295('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7295('0x6'));var sox=require(_0x7295('0x7'));var csv=require(_0x7295('0x8'));var ejs=require(_0x7295('0x9'));var fs=require('fs');var fs_extra=require(_0x7295('0xa'));var _=require(_0x7295('0xb'));var squel=require(_0x7295('0xc'));var crypto=require(_0x7295('0xd'));var jsforce=require(_0x7295('0xe'));var deskjs=require(_0x7295('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7295('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7295('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7295('0x12'));var hardwareService=require(_0x7295('0x13'));var logger=require(_0x7295('0x14'))('api');var utils=require(_0x7295('0x15'));var config=require(_0x7295('0x16'));var licenseUtil=require(_0x7295('0x17'));var db=require(_0x7295('0x18'))['db'];var integrations=require(_0x7295('0x19'));function respondWithStatusCode(_0x7f491,_0x2ff3ae){_0x2ff3ae=_0x2ff3ae||0xcc;return function(_0x13ea20){if(_0x13ea20){return _0x7f491[_0x7295('0x1a')](_0x2ff3ae);}return _0x7f491[_0x7295('0x1b')](_0x2ff3ae)[_0x7295('0x1c')]();};}function respondWithResult(_0x5e61c7,_0x1d4049){_0x1d4049=_0x1d4049||0xc8;return function(_0x3560b4){if(_0x3560b4){return _0x5e61c7[_0x7295('0x1b')](_0x1d4049)['json'](_0x3560b4);}};}function respondWithFilteredResult(_0x1b705a,_0x57dbb6){return function(_0x5efc09){if(_0x5efc09){var _0x4927fa=typeof _0x57dbb6[_0x7295('0x1d')]===_0x7295('0x1e')&&typeof _0x57dbb6['limit']===_0x7295('0x1e');var _0x3a5302=_0x5efc09[_0x7295('0x1f')];var _0x3c07d4=_0x4927fa?0x0:_0x57dbb6[_0x7295('0x1d')];var _0x3d8dc2=_0x4927fa?_0x5efc09[_0x7295('0x1f')]:_0x57dbb6[_0x7295('0x1d')]+_0x57dbb6[_0x7295('0x20')];var _0x4612dd;if(_0x3d8dc2>=_0x3a5302){_0x3d8dc2=_0x3a5302;_0x4612dd=0xc8;}else{_0x4612dd=0xce;}_0x1b705a[_0x7295('0x1b')](_0x4612dd);return _0x1b705a['set'](_0x7295('0x21'),_0x3c07d4+'-'+_0x3d8dc2+'/'+_0x3a5302)[_0x7295('0x22')](_0x5efc09);}return null;};}function patchUpdates(_0x41bd22){return function(_0x370a18){try{jsonpatch[_0x7295('0x23')](_0x370a18,_0x41bd22,!![]);}catch(_0x50672e){return BPromise['reject'](_0x50672e);}return _0x370a18[_0x7295('0x24')]();};}function saveUpdates(_0x1a332f,_0x2d993a){return function(_0x4db7a9){if(_0x4db7a9){return _0x4db7a9['update'](_0x1a332f)[_0x7295('0x25')](function(_0x3f3de0){return _0x3f3de0;});}return null;};}function removeEntity(_0x1e3554,_0x129a42){return function(_0x446dcb){if(_0x446dcb){return _0x446dcb['destroy']()[_0x7295('0x25')](function(){_0x1e3554[_0x7295('0x1b')](0xcc)[_0x7295('0x1c')]();});}};}function handleEntityNotFound(_0x5c9e1d,_0x48ea0d){return function(_0x29cfe0){if(!_0x29cfe0){_0x5c9e1d[_0x7295('0x1a')](0x194);}return _0x29cfe0;};}function handleError(_0x470b7b,_0x1f355c){_0x1f355c=_0x1f355c||0x1f4;return function(_0x92532e){logger[_0x7295('0x26')](_0x92532e[_0x7295('0x27')]);if(_0x92532e[_0x7295('0x28')]){delete _0x92532e[_0x7295('0x28')];}_0x470b7b[_0x7295('0x1b')](_0x1f355c)[_0x7295('0x29')](_0x92532e);};}exports[_0x7295('0x2a')]=function(_0x1dc1b8,_0x4a1424){var _0xb4fb27={},_0x5b74fd={},_0x1707c2={'count':0x0,'rows':[]};var _0x2ef711=_[_0x7295('0x2b')](db[_0x7295('0x2c')]['rawAttributes'],function(_0x2a7c78){return{'name':_0x2a7c78['fieldName'],'type':_0x2a7c78[_0x7295('0x2d')][_0x7295('0x2e')]};});_0x5b74fd[_0x7295('0x2f')]=_[_0x7295('0x2b')](_0x2ef711,_0x7295('0x28'));_0x5b74fd[_0x7295('0x30')]=_[_0x7295('0x31')](_0x1dc1b8[_0x7295('0x30')]);_0x5b74fd[_0x7295('0x32')]=_[_0x7295('0x33')](_0x5b74fd[_0x7295('0x2f')],_0x5b74fd[_0x7295('0x30')]);_0xb4fb27['attributes']=_['intersection'](_0x5b74fd[_0x7295('0x2f')],qs['fields'](_0x1dc1b8[_0x7295('0x30')][_0x7295('0x34')]));_0xb4fb27[_0x7295('0x35')]=_0xb4fb27[_0x7295('0x35')][_0x7295('0x36')]?_0xb4fb27[_0x7295('0x35')]:_0x5b74fd[_0x7295('0x2f')];if(!_0x1dc1b8[_0x7295('0x30')][_0x7295('0x37')](_0x7295('0x38'))){_0xb4fb27[_0x7295('0x20')]=qs['limit'](_0x1dc1b8[_0x7295('0x30')][_0x7295('0x20')]);_0xb4fb27[_0x7295('0x1d')]=qs['offset'](_0x1dc1b8[_0x7295('0x30')][_0x7295('0x1d')]);}_0xb4fb27[_0x7295('0x39')]=qs['sort'](_0x1dc1b8[_0x7295('0x30')][_0x7295('0x3a')]);_0xb4fb27[_0x7295('0x3b')]=qs[_0x7295('0x32')](_[_0x7295('0x3c')](_0x1dc1b8[_0x7295('0x30')],_0x5b74fd['filters']),_0x2ef711);if(_0x1dc1b8[_0x7295('0x30')][_0x7295('0x3d')]){_0xb4fb27[_0x7295('0x3b')]=_[_0x7295('0x3e')](_0xb4fb27[_0x7295('0x3b')],{'$or':_[_0x7295('0x2b')](_0x2ef711,function(_0x18e0f9){if(_0x18e0f9[_0x7295('0x2d')]!==_0x7295('0x3f')){var _0x4bfc6c={};_0x4bfc6c[_0x18e0f9[_0x7295('0x28')]]={'$like':'%'+_0x1dc1b8[_0x7295('0x30')][_0x7295('0x3d')]+'%'};return _0x4bfc6c;}})});}_0xb4fb27=_[_0x7295('0x3e')]({},_0xb4fb27,_0x1dc1b8['options']);var _0x17f9c8={'where':_0xb4fb27[_0x7295('0x3b')]};return db[_0x7295('0x2c')][_0x7295('0x1f')](_0x17f9c8)['then'](function(_0x2b99ec){_0x1707c2[_0x7295('0x1f')]=_0x2b99ec;if(_0x1dc1b8['query'][_0x7295('0x40')]){_0xb4fb27[_0x7295('0x41')]=[{'all':!![]}];}return db[_0x7295('0x2c')][_0x7295('0x42')](_0xb4fb27);})[_0x7295('0x25')](function(_0x1ba326){_0x1707c2[_0x7295('0x43')]=_0x1ba326;return _0x1707c2;})[_0x7295('0x25')](respondWithFilteredResult(_0x4a1424,_0xb4fb27))[_0x7295('0x44')](handleError(_0x4a1424,null));};exports['show']=function(_0x415c9c,_0x202eac){var _0x42c670={'raw':![],'where':{'id':_0x415c9c[_0x7295('0x45')]['id']}},_0x585118={};_0x585118[_0x7295('0x2f')]=_[_0x7295('0x31')](db[_0x7295('0x2c')][_0x7295('0x46')]);_0x585118[_0x7295('0x30')]=_[_0x7295('0x31')](_0x415c9c[_0x7295('0x30')]);_0x585118[_0x7295('0x32')]=_[_0x7295('0x33')](_0x585118[_0x7295('0x2f')],_0x585118[_0x7295('0x30')]);_0x42c670['attributes']=_[_0x7295('0x33')](_0x585118['model'],qs[_0x7295('0x34')](_0x415c9c[_0x7295('0x30')][_0x7295('0x34')]));_0x42c670[_0x7295('0x35')]=_0x42c670[_0x7295('0x35')]['length']?_0x42c670[_0x7295('0x35')]:_0x585118[_0x7295('0x2f')];if(_0x415c9c['query']['includeAll']){_0x42c670[_0x7295('0x41')]=[{'all':!![]}];}_0x42c670=_[_0x7295('0x3e')]({},_0x42c670,_0x415c9c['options']);return db['FreshsalesAccount'][_0x7295('0x47')](_0x42c670)[_0x7295('0x25')](handleEntityNotFound(_0x202eac,null))['then'](respondWithResult(_0x202eac,null))[_0x7295('0x44')](handleError(_0x202eac,null));};exports[_0x7295('0x48')]=function(_0x1b4277,_0x4e8383){return db[_0x7295('0x2c')][_0x7295('0x48')](_0x1b4277['body'],{})[_0x7295('0x25')](respondWithResult(_0x4e8383,0xc9))[_0x7295('0x44')](handleError(_0x4e8383,null));};exports[_0x7295('0x49')]=function(_0x52540e,_0x3ff700){if(_0x52540e[_0x7295('0x4a')]['id']){delete _0x52540e[_0x7295('0x4a')]['id'];}return db[_0x7295('0x2c')][_0x7295('0x47')]({'where':{'id':_0x52540e[_0x7295('0x45')]['id']}})[_0x7295('0x25')](handleEntityNotFound(_0x3ff700,null))['then'](saveUpdates(_0x52540e[_0x7295('0x4a')],null))[_0x7295('0x25')](respondWithResult(_0x3ff700,null))[_0x7295('0x44')](handleError(_0x3ff700,null));};exports[_0x7295('0x4b')]=function(_0x541920,_0x397e2f){return db[_0x7295('0x2c')][_0x7295('0x47')]({'where':{'id':_0x541920[_0x7295('0x45')]['id']}})[_0x7295('0x25')](handleEntityNotFound(_0x397e2f,null))[_0x7295('0x25')](removeEntity(_0x397e2f,null))[_0x7295('0x44')](handleError(_0x397e2f,null));};exports[_0x7295('0x4c')]=function(_0x47bd4d,_0xc44ea8,_0x1ecb98){var _0x4ddb81={};var _0x197274={};var _0x28be10;var _0x5a5a35;return db[_0x7295('0x2c')][_0x7295('0x4d')]({'where':{'id':_0x47bd4d[_0x7295('0x45')]['id']}})[_0x7295('0x25')](handleEntityNotFound(_0xc44ea8,null))[_0x7295('0x25')](function(_0xd069e1){if(_0xd069e1){_0x28be10=_0xd069e1;_0x197274[_0x7295('0x2f')]=_[_0x7295('0x31')](db[_0x7295('0x4e')][_0x7295('0x46')]);_0x197274[_0x7295('0x30')]=_[_0x7295('0x31')](_0x47bd4d['query']);_0x197274[_0x7295('0x32')]=_[_0x7295('0x33')](_0x197274[_0x7295('0x2f')],_0x197274[_0x7295('0x30')]);_0x4ddb81[_0x7295('0x35')]=_[_0x7295('0x33')](_0x197274['model'],qs[_0x7295('0x34')](_0x47bd4d[_0x7295('0x30')][_0x7295('0x34')]));_0x4ddb81['attributes']=_0x4ddb81[_0x7295('0x35')][_0x7295('0x36')]?_0x4ddb81[_0x7295('0x35')]:_0x197274[_0x7295('0x2f')];_0x4ddb81[_0x7295('0x39')]=qs[_0x7295('0x3a')](_0x47bd4d[_0x7295('0x30')][_0x7295('0x3a')]);_0x4ddb81[_0x7295('0x3b')]=qs['filters'](_[_0x7295('0x3c')](_0x47bd4d[_0x7295('0x30')],_0x197274['filters']));if(_0x47bd4d[_0x7295('0x30')][_0x7295('0x3d')]){_0x4ddb81[_0x7295('0x3b')]=_['merge'](_0x4ddb81['where'],{'$or':_[_0x7295('0x2b')](_0x4ddb81['attributes'],function(_0x4803f2){var _0x247dac={};_0x247dac[_0x4803f2]={'$like':'%'+_0x47bd4d[_0x7295('0x30')]['filter']+'%'};return _0x247dac;})});}_0x4ddb81=_['merge']({},_0x4ddb81,_0x47bd4d[_0x7295('0x4f')]);return _0x28be10[_0x7295('0x4c')](_0x4ddb81);}})[_0x7295('0x25')](function(_0x1dbe08){if(_0x1dbe08){_0x5a5a35=_0x1dbe08[_0x7295('0x36')];if(!_0x47bd4d[_0x7295('0x30')][_0x7295('0x37')](_0x7295('0x38'))){_0x4ddb81[_0x7295('0x20')]=qs[_0x7295('0x20')](_0x47bd4d[_0x7295('0x30')][_0x7295('0x20')]);_0x4ddb81['offset']=qs['offset'](_0x47bd4d[_0x7295('0x30')][_0x7295('0x1d')]);}return _0x28be10[_0x7295('0x4c')](_0x4ddb81);}})[_0x7295('0x25')](function(_0x37d491){if(_0x37d491){return _0x37d491?{'count':_0x5a5a35,'rows':_0x37d491}:null;}})[_0x7295('0x25')](respondWithResult(_0xc44ea8,null))['catch'](handleError(_0xc44ea8,null));};exports[_0x7295('0x50')]=function(_0x58ac1b,_0x40a24d,_0xf84af1){if(_0x58ac1b[_0x7295('0x4a')]['id']){delete _0x58ac1b['body']['id'];}return db['FreshsalesAccount'][_0x7295('0x4d')]({'where':{'id':_0x58ac1b['params']['id']}})['then'](handleEntityNotFound(_0x40a24d,null))[_0x7295('0x25')](function(_0x57c31a){if(_0x57c31a){_0x58ac1b[_0x7295('0x4a')][_0x7295('0x51')]=_0x57c31a['id'];_0x58ac1b[_0x7295('0x4a')][_0x7295('0x52')]=integrations[_0x7295('0x53')](_0x58ac1b[_0x7295('0x4a')][_0x7295('0x54')],_0x58ac1b[_0x7295('0x4a')][_0x7295('0x2d')]);_0x58ac1b[_0x7295('0x4a')][_0x7295('0x55')]=integrations[_0x7295('0x56')](_0x58ac1b[_0x7295('0x4a')][_0x7295('0x54')],_0x58ac1b[_0x7295('0x4a')][_0x7295('0x2d')]);return db[_0x7295('0x4e')][_0x7295('0x48')](_0x58ac1b[_0x7295('0x4a')],{'include':[{'model':db[_0x7295('0x57')],'as':_0x7295('0x52')},{'model':db[_0x7295('0x57')],'as':'Descriptions'}]});}return null;})[_0x7295('0x25')](respondWithResult(_0x40a24d,null))[_0x7295('0x44')](handleError(_0x40a24d,null));};exports['getFields']=function(_0x50623e,_0x8dd8d3,_0x31368b){var _0x10d5e0='';var _0x1e21ae='';return db['FreshsalesAccount'][_0x7295('0x4d')]({'where':{'id':_0x50623e[_0x7295('0x45')]['id']},'attributes':['id','username',_0x7295('0x58'),'apiKey']})[_0x7295('0x25')](handleEntityNotFound(_0x8dd8d3,null))[_0x7295('0x25')](function(_0x1b627f){if(_0x1b627f){_0x1e21ae=_0x1b627f[_0x7295('0x59')];_0x10d5e0=_0x1b627f[_0x7295('0x58')];var _0x56c25b=_0x1b627f['remoteUri'][_0x7295('0x5a')](-0x1);if(_0x56c25b==='/'){_0x10d5e0=_0x10d5e0[_0x7295('0x5b')](0x0,_0x10d5e0[_0x7295('0x5c')](_0x56c25b));}return rp({'method':'GET','uri':util['format'](_0x7295('0x5d'),_0x10d5e0,'/api/selector/owners'),'headers':{'Authorization':_0x7295('0x5e')+_0x1b627f[_0x7295('0x5f')]},'json':!![]});}})[_0x7295('0x25')](function(_0x5e8f84){if(_0x5e8f84){var _0x45cb20=_0x5e8f84[_0x7295('0x60')];var _0x5a08dd=![];var _0x208b2c=null;for(_0x208b2c=0x0;_0x208b2c<_0x45cb20['length'];_0x208b2c++){if(_0x45cb20[_0x208b2c][_0x7295('0x61')]===_0x1e21ae){_0x5a08dd=!![];}}if(_0x5a08dd){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x8dd8d3,null))['catch'](function(_0x37e9f1){var _0x105cb5=_0x50623e['query']['test']?0x1f4:_0x37e9f1[_0x7295('0x62')]||0x1f4;logger[_0x7295('0x26')](_0x7295('0x63'),_0x7295('0x64'),_0x105cb5,JSON['stringify'](_0x37e9f1));delete _0x37e9f1[_0x7295('0x28')];if(_0x105cb5===0x191){_0x105cb5=0x190;}_0x8dd8d3['status'](_0x105cb5)[_0x7295('0x29')](_0x50623e[_0x7295('0x30')][_0x7295('0x65')]?{'message':_0x7295('0x66'),'statusCode':_0x37e9f1[_0x7295('0x62')]}:_0x37e9f1);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 4f570b9..35be11d 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 _0x01d9=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x4771d4,_0x393fca){var _0x34de1c=function(_0x41ea4e){while(--_0x41ea4e){_0x4771d4['push'](_0x4771d4['shift']());}};_0x34de1c(++_0x393fca);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));var integrations=require(_0x901d('0xa'));module['exports']=function(_0x1e5d7d,_0x6c9ac8){return _0x1e5d7d[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x323f=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x111723,_0x431bed){var _0x1ce0a0=function(_0x5f2c19){while(--_0x5f2c19){_0x111723['push'](_0x111723['shift']());}};_0x1ce0a0(++_0x431bed);}(_0x323f,0x1ee));var _0xf323=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x323f[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));var integrations=require(_0xf323('0x9'));module[_0xf323('0xa')]=function(_0x5d7d60,_0xb9a667){return _0x5d7d60[_0xf323('0xb')](_0xf323('0xc'),attributes,{'tableName':_0xf323('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 70ca9d7..bf50850 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 _0x0120=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0120,0x6f));var _0x0012=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0120[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['FreshsalesAccount'][_0x0012('0x17')]({'raw':_0x1d0423[_0x0012('0x18')]?_0x1d0423['options'][_0x0012('0x19')]===undefined?!![]:![]:!![],'where':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x1d0423['options']?_0x1d0423['options'][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1c')]||null:null,'include':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x1d0423['options'][_0x0012('0x1d')],function(_0x24a280){return{'model':db[_0x24a280['model']],'as':_0x24a280['as'],'attributes':_0x24a280[_0x0012('0x1b')],'include':_0x24a280[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x24a280[_0x0012('0x1d')],function(_0x42bcd7){return{'model':db[_0x42bcd7['model']],'as':_0x42bcd7['as'],'attributes':_0x42bcd7[_0x0012('0x1b')],'include':_0x42bcd7[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x42bcd7[_0x0012('0x1d')],function(_0x173cb3){return{'model':db[_0x173cb3[_0x0012('0x1f')]],'as':_0x173cb3['as'],'attributes':_0x173cb3[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0012('0x20')](function(_0x300e13){logger[_0x0012('0xd')](_0x0012('0x16'),_0x1d0423);logger[_0x0012('0x21')](_0x0012('0x16'),_0x1d0423,JSON[_0x0012('0x11')](_0x300e13));_0x1e78ee(_0x300e13);})[_0x0012('0x22')](function(_0x276389){logger[_0x0012('0x12')](_0x0012('0x16'),_0x276389[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1[_0x0012('0x12')](0x1f4,_0x276389[_0x0012('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x283134){var _0x1bb49b=this;return new Promise(function(_0x4c2601,_0x2fa6a2){return db[_0x0012('0x23')][_0x0012('0x24')]({'raw':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x283134['options']?_0x283134[_0x0012('0x18')][_0x0012('0x1b')]||null:null,'include':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x283134['options'][_0x0012('0x1d')],function(_0x30dfd8){return{'model':db[_0x30dfd8[_0x0012('0x1f')]],'as':_0x30dfd8['as'],'attributes':_0x30dfd8[_0x0012('0x1b')],'include':_0x30dfd8['include']?_['map'](_0x30dfd8[_0x0012('0x1d')],function(_0x30f8a2){return{'model':db[_0x30f8a2[_0x0012('0x1f')]],'as':_0x30f8a2['as'],'attributes':_0x30f8a2[_0x0012('0x1b')],'include':_0x30f8a2[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x30f8a2[_0x0012('0x1d')],function(_0x4f13b9){return{'model':db[_0x4f13b9[_0x0012('0x1f')]],'as':_0x4f13b9['as'],'attributes':_0x4f13b9[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196222){logger[_0x0012('0xd')](_0x0012('0x25'),_0x283134);logger[_0x0012('0x21')](_0x0012('0x25'),_0x283134,JSON[_0x0012('0x11')](_0x196222));_0x4c2601(_0x196222);})[_0x0012('0x22')](function(_0x4a4af8){logger[_0x0012('0x12')]('ShowFreshsalesAccount',_0x4a4af8[_0x0012('0x14')],_0x283134);_0x2fa6a2(_0x1bb49b['error'](0x1f4,_0x4a4af8['message']));});});}; \ No newline at end of file +var _0x4325=['stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3216a1,_0x13a4c7){var _0x2fad9a=function(_0x45cf39){while(--_0x45cf39){_0x3216a1['push'](_0x3216a1['shift']());}};_0x2fad9a(++_0x13a4c7);}(_0x4325,0x1da));var _0x5432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4325[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')]({'raw':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options'][_0x5432('0x1c')]||null:null,'attributes':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'limit':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options']['limit']||null:null,'include':_0x32fe60['options']?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x32fe60[_0x5432('0x1a')]['include'],function(_0x4af5f4){return{'model':db[_0x4af5f4[_0x5432('0x20')]],'as':_0x4af5f4['as'],'attributes':_0x4af5f4[_0x5432('0x1d')],'include':_0x4af5f4['include']?_[_0x5432('0x1f')](_0x4af5f4[_0x5432('0x1e')],function(_0x637582){return{'model':db[_0x637582['model']],'as':_0x637582['as'],'attributes':_0x637582[_0x5432('0x1d')],'include':_0x637582[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x637582['include'],function(_0x4ab09d){return{'model':db[_0x4ab09d[_0x5432('0x20')]],'as':_0x4ab09d['as'],'attributes':_0x4ab09d[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1abe73){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug'](_0x5432('0x17'),_0x32fe60,JSON['stringify'](_0x1abe73));_0x5f011f(_0x1abe73);})['catch'](function(_0x6fc7f5){logger['error'](_0x5432('0x17'),_0x6fc7f5['message'],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x6fc7f5[_0x5432('0x13')]));});});};exports[_0x5432('0x21')]=function(_0x345b51){var _0x4e92d5=this;return new Promise(function(_0x31490c,_0x1d436c){return db[_0x5432('0x18')][_0x5432('0x22')]({'raw':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')]['where']||null:null,'attributes':_0x345b51['options']?_0x345b51[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'include':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1e')]?_['map'](_0x345b51[_0x5432('0x1a')]['include'],function(_0x2955e0){return{'model':db[_0x2955e0[_0x5432('0x20')]],'as':_0x2955e0['as'],'attributes':_0x2955e0[_0x5432('0x1d')],'include':_0x2955e0[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x2955e0[_0x5432('0x1e')],function(_0x5c3c77){return{'model':db[_0x5c3c77[_0x5432('0x20')]],'as':_0x5c3c77['as'],'attributes':_0x5c3c77[_0x5432('0x1d')],'include':_0x5c3c77[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x5c3c77['include'],function(_0xe01f4b){return{'model':db[_0xe01f4b[_0x5432('0x20')]],'as':_0xe01f4b['as'],'attributes':_0xe01f4b[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5432('0xb')](function(_0x3fb586){logger[_0x5432('0x14')](_0x5432('0x21'),_0x345b51);logger[_0x5432('0xd')](_0x5432('0x21'),_0x345b51,JSON[_0x5432('0x10')](_0x3fb586));_0x31490c(_0x3fb586);})[_0x5432('0x16')](function(_0x1f4679){logger[_0x5432('0x12')](_0x5432('0x21'),_0x1f4679['message'],_0x345b51);_0x1d436c(_0x4e92d5[_0x5432('0x12')](0x1f4,_0x1f4679['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 24c40b0..3e03249 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 _0x51ed=['getFields','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0x15aef6,_0x25345c){var _0x422f3d=function(_0x2b46c8){while(--_0x2b46c8){_0x15aef6['push'](_0x15aef6['shift']());}};_0x422f3d(++_0x25345c);}(_0x51ed,0x188));var _0xd51e=function(_0x11c2cc,_0x4faeca){_0x11c2cc=_0x11c2cc-0x0;var _0x41866d=_0x51ed[_0x11c2cc];return _0x41866d;};'use strict';var multer=require('multer');var util=require(_0xd51e('0x0'));var path=require(_0xd51e('0x1'));var timeout=require(_0xd51e('0x2'));var express=require(_0xd51e('0x3'));var router=express['Router']();var fs_extra=require(_0xd51e('0x4'));var auth=require(_0xd51e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd51e('0x6'));router[_0xd51e('0x7')]('/',auth[_0xd51e('0x8')](),controller[_0xd51e('0x9')]);router[_0xd51e('0x7')]('/:id',auth[_0xd51e('0x8')](),controller[_0xd51e('0xa')]);router[_0xd51e('0x7')](_0xd51e('0xb'),auth[_0xd51e('0x8')](),controller[_0xd51e('0xc')]);router['get'](_0xd51e('0xd'),auth[_0xd51e('0x8')](),controller[_0xd51e('0xe')]);router['get'](_0xd51e('0xf'),auth[_0xd51e('0x8')](),controller[_0xd51e('0x10')]);router['post']('/',auth[_0xd51e('0x8')](),controller[_0xd51e('0x11')]);router[_0xd51e('0x12')](_0xd51e('0x13'),auth[_0xd51e('0x8')](),controller[_0xd51e('0x14')]);router[_0xd51e('0x15')](_0xd51e('0x13'),auth['isAuthenticated'](),controller[_0xd51e('0x16')]);module[_0xd51e('0x17')]=router; \ No newline at end of file +var _0x8baa=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x20d550,_0x13b136){var _0x4afb12=function(_0x157767){while(--_0x157767){_0x20d550['push'](_0x20d550['shift']());}};_0x4afb12(++_0x13b136);}(_0x8baa,0x1bc));var _0xa8ba=function(_0x1c3fdd,_0xfbc946){_0x1c3fdd=_0x1c3fdd-0x0;var _0x574541=_0x8baa[_0x1c3fdd];return _0x574541;};'use strict';var multer=require(_0xa8ba('0x0'));var util=require(_0xa8ba('0x1'));var path=require(_0xa8ba('0x2'));var timeout=require(_0xa8ba('0x3'));var express=require(_0xa8ba('0x4'));var router=express[_0xa8ba('0x5')]();var fs_extra=require(_0xa8ba('0x6'));var auth=require(_0xa8ba('0x7'));var interaction=require(_0xa8ba('0x8'));var config=require(_0xa8ba('0x9'));var controller=require(_0xa8ba('0xa'));router['get']('/',auth[_0xa8ba('0xb')](),controller[_0xa8ba('0xc')]);router[_0xa8ba('0xd')](_0xa8ba('0xe'),auth['isAuthenticated'](),controller[_0xa8ba('0xf')]);router['get'](_0xa8ba('0x10'),auth[_0xa8ba('0xb')](),controller[_0xa8ba('0x11')]);router[_0xa8ba('0xd')](_0xa8ba('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa8ba('0xd')](_0xa8ba('0x13'),auth[_0xa8ba('0xb')](),controller['getFields']);router[_0xa8ba('0x14')]('/',auth[_0xa8ba('0xb')](),controller[_0xa8ba('0x15')]);router[_0xa8ba('0x16')](_0xa8ba('0xe'),auth['isAuthenticated'](),controller[_0xa8ba('0x17')]);router['delete'](_0xa8ba('0xe'),auth[_0xa8ba('0xb')](),controller['destroy']);module[_0xa8ba('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 9485d76..aae5028 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 _0x9409=['exports','STRING','sequelize'];(function(_0x3d8075,_0x310f36){var _0x1c641b=function(_0x235085){while(--_0x235085){_0x3d8075['push'](_0x3d8075['shift']());}};_0x1c641b(++_0x310f36);}(_0x9409,0x13a));var _0x9940=function(_0x5e4ffa,_0x56154d){_0x5e4ffa=_0x5e4ffa-0x0;var _0x43a656=_0x9409[_0x5e4ffa];return _0x43a656;};'use strict';var Sequelize=require(_0x9940('0x0'));module[_0x9940('0x1')]={'name':{'type':Sequelize[_0x9940('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2813=['exports','STRING'];(function(_0x1aad88,_0x1003ac){var _0x10f854=function(_0x262cd8){while(--_0x262cd8){_0x1aad88['push'](_0x1aad88['shift']());}};_0x10f854(++_0x1003ac);}(_0x2813,0x186));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3281('0x0')]={'name':{'type':Sequelize[_0x3281('0x1')]},'description':{'type':Sequelize[_0x3281('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index dea0896..3322ede 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 _0xb317=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','error','stack','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','count','includeAll','findAll','rows','length','include','options','find','body','catch','params','getSubjects','FreshsalesField','pick','merge','getDescriptions','findOne','hasOwnProperty','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4dda07,_0x1c0ce6){var _0x5bea70=function(_0x4aad1c){while(--_0x4aad1c){_0x4dda07['push'](_0x4dda07['shift']());}};_0x5bea70(++_0x1c0ce6);}(_0xb317,0x188));var _0x7b31=function(_0x1c00b4,_0x3dc122){_0x1c00b4=_0x1c00b4-0x0;var _0x1ca50a=_0xb317[_0x1c00b4];return _0x1ca50a;};'use strict';var emlformat=require(_0x7b31('0x0'));var rimraf=require(_0x7b31('0x1'));var zipdir=require(_0x7b31('0x2'));var jsonpatch=require(_0x7b31('0x3'));var rp=require(_0x7b31('0x4'));var moment=require(_0x7b31('0x5'));var BPromise=require(_0x7b31('0x6'));var Mustache=require(_0x7b31('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7b31('0x8'));var csv=require(_0x7b31('0x9'));var ejs=require(_0x7b31('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b31('0xb'));var squel=require(_0x7b31('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b31('0xd'));var toCsv=require(_0x7b31('0x9'));var querystring=require(_0x7b31('0xe'));var Papa=require(_0x7b31('0xf'));var Redis=require(_0x7b31('0x10'));var authService=require(_0x7b31('0x11'));var qs=require(_0x7b31('0x12'));var as=require(_0x7b31('0x13'));var hardwareService=require(_0x7b31('0x14'));var logger=require(_0x7b31('0x15'))(_0x7b31('0x16'));var utils=require(_0x7b31('0x17'));var config=require(_0x7b31('0x18'));var licenseUtil=require(_0x7b31('0x19'));var db=require(_0x7b31('0x1a'))['db'];function respondWithStatusCode(_0x12a4d2,_0x48f87d){_0x48f87d=_0x48f87d||0xcc;return function(_0x5c6526){if(_0x5c6526){return _0x12a4d2[_0x7b31('0x1b')](_0x48f87d);}return _0x12a4d2[_0x7b31('0x1c')](_0x48f87d)[_0x7b31('0x1d')]();};}function respondWithResult(_0x2ac245,_0x3db2e6){_0x3db2e6=_0x3db2e6||0xc8;return function(_0x54bc93){if(_0x54bc93){return _0x2ac245[_0x7b31('0x1c')](_0x3db2e6)[_0x7b31('0x1e')](_0x54bc93);}};}function respondWithFilteredResult(_0x1fae3a,_0x3d05a3){return function(_0x478804){if(_0x478804){var _0x5cea35=typeof _0x3d05a3[_0x7b31('0x1f')]===_0x7b31('0x20')&&typeof _0x3d05a3[_0x7b31('0x21')]===_0x7b31('0x20');var _0x16f848=_0x478804['count'];var _0x1cfeab=_0x5cea35?0x0:_0x3d05a3[_0x7b31('0x1f')];var _0x33bf28=_0x5cea35?_0x478804['count']:_0x3d05a3[_0x7b31('0x1f')]+_0x3d05a3['limit'];var _0x445656;if(_0x33bf28>=_0x16f848){_0x33bf28=_0x16f848;_0x445656=0xc8;}else{_0x445656=0xce;}_0x1fae3a['status'](_0x445656);return _0x1fae3a[_0x7b31('0x22')](_0x7b31('0x23'),_0x1cfeab+'-'+_0x33bf28+'/'+_0x16f848)['json'](_0x478804);}return null;};}function patchUpdates(_0x3fb4d8){return function(_0x16f73a){try{jsonpatch['apply'](_0x16f73a,_0x3fb4d8,!![]);}catch(_0x43b813){return BPromise['reject'](_0x43b813);}return _0x16f73a[_0x7b31('0x24')]();};}function saveUpdates(_0x4703fc,_0x426e30){return function(_0x11548b){if(_0x11548b){return _0x11548b[_0x7b31('0x25')](_0x4703fc)[_0x7b31('0x26')](function(_0xd6ea9){return _0xd6ea9;});}return null;};}function removeEntity(_0x20963b,_0x45578b){return function(_0x2862ef){if(_0x2862ef){return _0x2862ef[_0x7b31('0x27')]()[_0x7b31('0x26')](function(){_0x20963b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x122394,_0x2e2120){return function(_0x56de18){if(!_0x56de18){_0x122394[_0x7b31('0x1b')](0x194);}return _0x56de18;};}function handleError(_0x1ebd8e,_0x5da634){_0x5da634=_0x5da634||0x1f4;return function(_0x6be243){logger[_0x7b31('0x28')](_0x6be243[_0x7b31('0x29')]);if(_0x6be243['name']){delete _0x6be243['name'];}_0x1ebd8e[_0x7b31('0x1c')](_0x5da634)[_0x7b31('0x2a')](_0x6be243);};}exports[_0x7b31('0x2b')]=function(_0x3758bb,_0x1cbc47){var _0x1858ba={},_0x33e28a={},_0x2a415f={'count':0x0,'rows':[]};var _0x32b355=_[_0x7b31('0x2c')](db[_0x7b31('0x2d')][_0x7b31('0x2e')],function(_0x3c3843){return{'name':_0x3c3843[_0x7b31('0x2f')],'type':_0x3c3843[_0x7b31('0x30')][_0x7b31('0x31')]};});_0x33e28a[_0x7b31('0x32')]=_[_0x7b31('0x2c')](_0x32b355,_0x7b31('0x33'));_0x33e28a[_0x7b31('0x34')]=_[_0x7b31('0x35')](_0x3758bb['query']);_0x33e28a[_0x7b31('0x36')]=_[_0x7b31('0x37')](_0x33e28a[_0x7b31('0x32')],_0x33e28a['query']);_0x1858ba[_0x7b31('0x38')]=_[_0x7b31('0x37')](_0x33e28a[_0x7b31('0x32')],qs['fields'](_0x3758bb[_0x7b31('0x34')][_0x7b31('0x39')]));_0x1858ba['attributes']=_0x1858ba[_0x7b31('0x38')]['length']?_0x1858ba[_0x7b31('0x38')]:_0x33e28a[_0x7b31('0x32')];if(!_0x3758bb[_0x7b31('0x34')]['hasOwnProperty'](_0x7b31('0x3a'))){_0x1858ba[_0x7b31('0x21')]=qs['limit'](_0x3758bb[_0x7b31('0x34')][_0x7b31('0x21')]);_0x1858ba[_0x7b31('0x1f')]=qs['offset'](_0x3758bb[_0x7b31('0x34')][_0x7b31('0x1f')]);}_0x1858ba[_0x7b31('0x3b')]=qs[_0x7b31('0x3c')](_0x3758bb[_0x7b31('0x34')][_0x7b31('0x3c')]);_0x1858ba[_0x7b31('0x3d')]=qs['filters'](_['pick'](_0x3758bb[_0x7b31('0x34')],_0x33e28a[_0x7b31('0x36')]),_0x32b355);if(_0x3758bb[_0x7b31('0x34')][_0x7b31('0x3e')]){_0x1858ba[_0x7b31('0x3d')]=_['merge'](_0x1858ba[_0x7b31('0x3d')],{'$or':_[_0x7b31('0x2c')](_0x32b355,function(_0x3589c3){if(_0x3589c3[_0x7b31('0x30')]!==_0x7b31('0x3f')){var _0x56dad6={};_0x56dad6[_0x3589c3[_0x7b31('0x33')]]={'$like':'%'+_0x3758bb[_0x7b31('0x34')][_0x7b31('0x3e')]+'%'};return _0x56dad6;}})});}_0x1858ba=_['merge']({},_0x1858ba,_0x3758bb['options']);var _0xee5c91={'where':_0x1858ba[_0x7b31('0x3d')]};return db[_0x7b31('0x2d')]['count'](_0xee5c91)[_0x7b31('0x26')](function(_0x786de6){_0x2a415f[_0x7b31('0x40')]=_0x786de6;if(_0x3758bb[_0x7b31('0x34')][_0x7b31('0x41')]){_0x1858ba['include']=[{'all':!![]}];}return db[_0x7b31('0x2d')][_0x7b31('0x42')](_0x1858ba);})[_0x7b31('0x26')](function(_0x41e651){_0x2a415f[_0x7b31('0x43')]=_0x41e651;return _0x2a415f;})[_0x7b31('0x26')](respondWithFilteredResult(_0x1cbc47,_0x1858ba))['catch'](handleError(_0x1cbc47,null));};exports['show']=function(_0x3ce19f,_0x5d64c5){var _0x5ec79b={'raw':![],'where':{'id':_0x3ce19f['params']['id']}},_0x400bd9={};_0x400bd9[_0x7b31('0x32')]=_[_0x7b31('0x35')](db['FreshsalesConfiguration'][_0x7b31('0x2e')]);_0x400bd9[_0x7b31('0x34')]=_[_0x7b31('0x35')](_0x3ce19f[_0x7b31('0x34')]);_0x400bd9[_0x7b31('0x36')]=_[_0x7b31('0x37')](_0x400bd9['model'],_0x400bd9[_0x7b31('0x34')]);_0x5ec79b['attributes']=_[_0x7b31('0x37')](_0x400bd9['model'],qs[_0x7b31('0x39')](_0x3ce19f[_0x7b31('0x34')][_0x7b31('0x39')]));_0x5ec79b[_0x7b31('0x38')]=_0x5ec79b[_0x7b31('0x38')][_0x7b31('0x44')]?_0x5ec79b[_0x7b31('0x38')]:_0x400bd9[_0x7b31('0x32')];if(_0x3ce19f['query'][_0x7b31('0x41')]){_0x5ec79b[_0x7b31('0x45')]=[{'all':!![]}];}_0x5ec79b=_['merge']({},_0x5ec79b,_0x3ce19f[_0x7b31('0x46')]);return db[_0x7b31('0x2d')][_0x7b31('0x47')](_0x5ec79b)[_0x7b31('0x26')](handleEntityNotFound(_0x5d64c5,null))[_0x7b31('0x26')](respondWithResult(_0x5d64c5,null))['catch'](handleError(_0x5d64c5,null));};exports['create']=function(_0x153c60,_0x228da6){return db[_0x7b31('0x2d')]['create'](_0x153c60[_0x7b31('0x48')],{})[_0x7b31('0x26')](respondWithResult(_0x228da6,0xc9))[_0x7b31('0x49')](handleError(_0x228da6,null));};exports[_0x7b31('0x25')]=function(_0x36afd4,_0x2499d5){if(_0x36afd4[_0x7b31('0x48')]['id']){delete _0x36afd4[_0x7b31('0x48')]['id'];}return db['FreshsalesConfiguration'][_0x7b31('0x47')]({'where':{'id':_0x36afd4[_0x7b31('0x4a')]['id']}})[_0x7b31('0x26')](handleEntityNotFound(_0x2499d5,null))[_0x7b31('0x26')](saveUpdates(_0x36afd4[_0x7b31('0x48')],null))['then'](respondWithResult(_0x2499d5,null))[_0x7b31('0x49')](handleError(_0x2499d5,null));};exports[_0x7b31('0x27')]=function(_0x589ed9,_0x2ed0f7){return db[_0x7b31('0x2d')][_0x7b31('0x47')]({'where':{'id':_0x589ed9[_0x7b31('0x4a')]['id']}})[_0x7b31('0x26')](handleEntityNotFound(_0x2ed0f7,null))['then'](removeEntity(_0x2ed0f7,null))['catch'](handleError(_0x2ed0f7,null));};exports[_0x7b31('0x4b')]=function(_0xccf651,_0x2b4c20,_0x490ea7){var _0xa6e0ca={};var _0x14bb6b={};var _0x536431;var _0x4b9bb6;return db[_0x7b31('0x2d')]['findOne']({'where':{'id':_0xccf651[_0x7b31('0x4a')]['id']}})[_0x7b31('0x26')](handleEntityNotFound(_0x2b4c20,null))['then'](function(_0x1f1e47){if(_0x1f1e47){_0x536431=_0x1f1e47;_0x14bb6b[_0x7b31('0x32')]=_[_0x7b31('0x35')](db[_0x7b31('0x4c')]['rawAttributes']);_0x14bb6b['query']=_[_0x7b31('0x35')](_0xccf651[_0x7b31('0x34')]);_0x14bb6b[_0x7b31('0x36')]=_['intersection'](_0x14bb6b[_0x7b31('0x32')],_0x14bb6b[_0x7b31('0x34')]);_0xa6e0ca[_0x7b31('0x38')]=_['intersection'](_0x14bb6b['model'],qs[_0x7b31('0x39')](_0xccf651[_0x7b31('0x34')][_0x7b31('0x39')]));_0xa6e0ca['attributes']=_0xa6e0ca[_0x7b31('0x38')]['length']?_0xa6e0ca['attributes']:_0x14bb6b[_0x7b31('0x32')];_0xa6e0ca['order']=qs['sort'](_0xccf651[_0x7b31('0x34')][_0x7b31('0x3c')]);_0xa6e0ca[_0x7b31('0x3d')]=qs[_0x7b31('0x36')](_[_0x7b31('0x4d')](_0xccf651[_0x7b31('0x34')],_0x14bb6b[_0x7b31('0x36')]));if(_0xccf651[_0x7b31('0x34')][_0x7b31('0x3e')]){_0xa6e0ca[_0x7b31('0x3d')]=_[_0x7b31('0x4e')](_0xa6e0ca[_0x7b31('0x3d')],{'$or':_[_0x7b31('0x2c')](_0xa6e0ca['attributes'],function(_0x1f8a5b){var _0x14f11d={};_0x14f11d[_0x1f8a5b]={'$like':'%'+_0xccf651[_0x7b31('0x34')][_0x7b31('0x3e')]+'%'};return _0x14f11d;})});}_0xa6e0ca=_['merge']({},_0xa6e0ca,_0xccf651[_0x7b31('0x46')]);return _0x536431[_0x7b31('0x4b')](_0xa6e0ca);}})['then'](function(_0x43dd0d){if(_0x43dd0d){_0x4b9bb6=_0x43dd0d[_0x7b31('0x44')];if(!_0xccf651['query']['hasOwnProperty'](_0x7b31('0x3a'))){_0xa6e0ca['limit']=qs[_0x7b31('0x21')](_0xccf651['query'][_0x7b31('0x21')]);_0xa6e0ca[_0x7b31('0x1f')]=qs['offset'](_0xccf651[_0x7b31('0x34')][_0x7b31('0x1f')]);}return _0x536431[_0x7b31('0x4b')](_0xa6e0ca);}})[_0x7b31('0x26')](function(_0x249b4f){if(_0x249b4f){return _0x249b4f?{'count':_0x4b9bb6,'rows':_0x249b4f}:null;}})[_0x7b31('0x26')](respondWithResult(_0x2b4c20,null))['catch'](handleError(_0x2b4c20,null));};exports[_0x7b31('0x4f')]=function(_0x3c17f4,_0x181800,_0x3d80e8){var _0x447dab={};var _0x13dd82={};var _0x29acc4;var _0x33fe4c;return db['FreshsalesConfiguration'][_0x7b31('0x50')]({'where':{'id':_0x3c17f4['params']['id']}})['then'](handleEntityNotFound(_0x181800,null))[_0x7b31('0x26')](function(_0x96e85c){if(_0x96e85c){_0x29acc4=_0x96e85c;_0x13dd82[_0x7b31('0x32')]=_[_0x7b31('0x35')](db[_0x7b31('0x4c')][_0x7b31('0x2e')]);_0x13dd82[_0x7b31('0x34')]=_[_0x7b31('0x35')](_0x3c17f4['query']);_0x13dd82[_0x7b31('0x36')]=_[_0x7b31('0x37')](_0x13dd82['model'],_0x13dd82[_0x7b31('0x34')]);_0x447dab[_0x7b31('0x38')]=_['intersection'](_0x13dd82[_0x7b31('0x32')],qs[_0x7b31('0x39')](_0x3c17f4[_0x7b31('0x34')][_0x7b31('0x39')]));_0x447dab[_0x7b31('0x38')]=_0x447dab[_0x7b31('0x38')][_0x7b31('0x44')]?_0x447dab[_0x7b31('0x38')]:_0x13dd82['model'];_0x447dab[_0x7b31('0x3b')]=qs[_0x7b31('0x3c')](_0x3c17f4[_0x7b31('0x34')][_0x7b31('0x3c')]);_0x447dab[_0x7b31('0x3d')]=qs['filters'](_['pick'](_0x3c17f4[_0x7b31('0x34')],_0x13dd82['filters']));if(_0x3c17f4[_0x7b31('0x34')][_0x7b31('0x3e')]){_0x447dab['where']=_[_0x7b31('0x4e')](_0x447dab[_0x7b31('0x3d')],{'$or':_[_0x7b31('0x2c')](_0x447dab['attributes'],function(_0x37f848){var _0x15fbbc={};_0x15fbbc[_0x37f848]={'$like':'%'+_0x3c17f4[_0x7b31('0x34')]['filter']+'%'};return _0x15fbbc;})});}_0x447dab=_[_0x7b31('0x4e')]({},_0x447dab,_0x3c17f4[_0x7b31('0x46')]);return _0x29acc4[_0x7b31('0x4f')](_0x447dab);}})['then'](function(_0x1448ba){if(_0x1448ba){_0x33fe4c=_0x1448ba[_0x7b31('0x44')];if(!_0x3c17f4['query'][_0x7b31('0x51')](_0x7b31('0x3a'))){_0x447dab['limit']=qs[_0x7b31('0x21')](_0x3c17f4[_0x7b31('0x34')]['limit']);_0x447dab[_0x7b31('0x1f')]=qs['offset'](_0x3c17f4[_0x7b31('0x34')]['offset']);}return _0x29acc4[_0x7b31('0x4f')](_0x447dab);}})[_0x7b31('0x26')](function(_0x4a6cf9){if(_0x4a6cf9){return _0x4a6cf9?{'count':_0x33fe4c,'rows':_0x4a6cf9}:null;}})[_0x7b31('0x26')](respondWithResult(_0x181800,null))[_0x7b31('0x49')](handleError(_0x181800,null));};exports[_0x7b31('0x52')]=function(_0x25734c,_0x4ceaf3,_0xf3852c){var _0x92bea9={};var _0x346f9b={};var _0x5c1862;var _0x4ad7be;return db[_0x7b31('0x2d')]['findOne']({'where':{'id':_0x25734c[_0x7b31('0x4a')]['id']}})[_0x7b31('0x26')](handleEntityNotFound(_0x4ceaf3,null))[_0x7b31('0x26')](function(_0x59bf38){if(_0x59bf38){_0x5c1862=_0x59bf38;_0x346f9b[_0x7b31('0x32')]=_[_0x7b31('0x35')](db[_0x7b31('0x4c')]['rawAttributes']);_0x346f9b['query']=_[_0x7b31('0x35')](_0x25734c['query']);_0x346f9b[_0x7b31('0x36')]=_['intersection'](_0x346f9b[_0x7b31('0x32')],_0x346f9b[_0x7b31('0x34')]);_0x92bea9[_0x7b31('0x38')]=_[_0x7b31('0x37')](_0x346f9b['model'],qs[_0x7b31('0x39')](_0x25734c['query']['fields']));_0x92bea9[_0x7b31('0x38')]=_0x92bea9[_0x7b31('0x38')][_0x7b31('0x44')]?_0x92bea9['attributes']:_0x346f9b[_0x7b31('0x32')];_0x92bea9[_0x7b31('0x3b')]=qs[_0x7b31('0x3c')](_0x25734c['query']['sort']);_0x92bea9[_0x7b31('0x3d')]=qs['filters'](_[_0x7b31('0x4d')](_0x25734c['query'],_0x346f9b['filters']));if(_0x25734c[_0x7b31('0x34')][_0x7b31('0x3e')]){_0x92bea9[_0x7b31('0x3d')]=_[_0x7b31('0x4e')](_0x92bea9[_0x7b31('0x3d')],{'$or':_[_0x7b31('0x2c')](_0x92bea9[_0x7b31('0x38')],function(_0x42f21b){var _0x1af4e0={};_0x1af4e0[_0x42f21b]={'$like':'%'+_0x25734c[_0x7b31('0x34')][_0x7b31('0x3e')]+'%'};return _0x1af4e0;})});}_0x92bea9=_['merge']({},_0x92bea9,_0x25734c[_0x7b31('0x46')]);return _0x5c1862[_0x7b31('0x52')](_0x92bea9);}})[_0x7b31('0x26')](function(_0x348959){if(_0x348959){_0x4ad7be=_0x348959['length'];if(!_0x25734c[_0x7b31('0x34')][_0x7b31('0x51')](_0x7b31('0x3a'))){_0x92bea9['limit']=qs[_0x7b31('0x21')](_0x25734c[_0x7b31('0x34')][_0x7b31('0x21')]);_0x92bea9[_0x7b31('0x1f')]=qs['offset'](_0x25734c[_0x7b31('0x34')][_0x7b31('0x1f')]);}return _0x5c1862[_0x7b31('0x52')](_0x92bea9);}})[_0x7b31('0x26')](function(_0x164aee){if(_0x164aee){return _0x164aee?{'count':_0x4ad7be,'rows':_0x164aee}:null;}})[_0x7b31('0x26')](respondWithResult(_0x4ceaf3,null))[_0x7b31('0x49')](handleError(_0x4ceaf3,null));}; \ No newline at end of file +var _0xc185=['include','findAll','rows','show','params','keys','FreshsalesConfiguration','find','catch','create','body','findOne','options','getSubjects','getDescriptions','getFields','FreshsalesField','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc185,0x10a));var _0x5c18=function(_0x3b8fa6,_0x3a6c00){_0x3b8fa6=_0x3b8fa6-0x0;var _0x5ed275=_0xc185[_0x3b8fa6];return _0x5ed275;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c18('0x0'));var zipdir=require(_0x5c18('0x1'));var jsonpatch=require(_0x5c18('0x2'));var rp=require(_0x5c18('0x3'));var moment=require(_0x5c18('0x4'));var BPromise=require(_0x5c18('0x5'));var Mustache=require(_0x5c18('0x6'));var util=require('util');var path=require(_0x5c18('0x7'));var sox=require(_0x5c18('0x8'));var csv=require(_0x5c18('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c18('0xa'));var _=require(_0x5c18('0xb'));var squel=require(_0x5c18('0xc'));var crypto=require(_0x5c18('0xd'));var jsforce=require(_0x5c18('0xe'));var deskjs=require(_0x5c18('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5c18('0x10'));var Papa=require(_0x5c18('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c18('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c18('0x13'))(_0x5c18('0x14'));var utils=require(_0x5c18('0x15'));var config=require(_0x5c18('0x16'));var licenseUtil=require(_0x5c18('0x17'));var db=require(_0x5c18('0x18'))['db'];function respondWithStatusCode(_0x11e2f6,_0x5cb6b3){_0x5cb6b3=_0x5cb6b3||0xcc;return function(_0x55bcdc){if(_0x55bcdc){return _0x11e2f6[_0x5c18('0x19')](_0x5cb6b3);}return _0x11e2f6[_0x5c18('0x1a')](_0x5cb6b3)[_0x5c18('0x1b')]();};}function respondWithResult(_0x2d584d,_0x5ba8f8){_0x5ba8f8=_0x5ba8f8||0xc8;return function(_0x5a007a){if(_0x5a007a){return _0x2d584d[_0x5c18('0x1a')](_0x5ba8f8)[_0x5c18('0x1c')](_0x5a007a);}};}function respondWithFilteredResult(_0x47fae6,_0xd423b3){return function(_0xc36e55){if(_0xc36e55){var _0x1289e4=typeof _0xd423b3[_0x5c18('0x1d')]==='undefined'&&typeof _0xd423b3[_0x5c18('0x1e')]===_0x5c18('0x1f');var _0x1f9292=_0xc36e55['count'];var _0xc3ed67=_0x1289e4?0x0:_0xd423b3['offset'];var _0x7ea5f9=_0x1289e4?_0xc36e55[_0x5c18('0x20')]:_0xd423b3[_0x5c18('0x1d')]+_0xd423b3[_0x5c18('0x1e')];var _0x565fda;if(_0x7ea5f9>=_0x1f9292){_0x7ea5f9=_0x1f9292;_0x565fda=0xc8;}else{_0x565fda=0xce;}_0x47fae6[_0x5c18('0x1a')](_0x565fda);return _0x47fae6[_0x5c18('0x21')]('Content-Range',_0xc3ed67+'-'+_0x7ea5f9+'/'+_0x1f9292)[_0x5c18('0x1c')](_0xc36e55);}return null;};}function patchUpdates(_0x22d593){return function(_0x1bf75d){try{jsonpatch[_0x5c18('0x22')](_0x1bf75d,_0x22d593,!![]);}catch(_0x4da3ec){return BPromise[_0x5c18('0x23')](_0x4da3ec);}return _0x1bf75d[_0x5c18('0x24')]();};}function saveUpdates(_0x79aefc,_0x10d1ca){return function(_0x16865a){if(_0x16865a){return _0x16865a[_0x5c18('0x25')](_0x79aefc)[_0x5c18('0x26')](function(_0x4f11a2){return _0x4f11a2;});}return null;};}function removeEntity(_0x2721c3,_0x7b8ede){return function(_0x1072a0){if(_0x1072a0){return _0x1072a0[_0x5c18('0x27')]()[_0x5c18('0x26')](function(){_0x2721c3[_0x5c18('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3ff3,_0x55e128){return function(_0x30eb08){if(!_0x30eb08){_0x4b3ff3[_0x5c18('0x19')](0x194);}return _0x30eb08;};}function handleError(_0x2c7fb2,_0x28b248){_0x28b248=_0x28b248||0x1f4;return function(_0x5af445){logger[_0x5c18('0x28')](_0x5af445[_0x5c18('0x29')]);if(_0x5af445['name']){delete _0x5af445[_0x5c18('0x2a')];}_0x2c7fb2[_0x5c18('0x1a')](_0x28b248)[_0x5c18('0x2b')](_0x5af445);};}exports[_0x5c18('0x2c')]=function(_0x4af314,_0x245617){var _0x138801={},_0x4021b3={},_0x4e5a7c={'count':0x0,'rows':[]};var _0x264228=_['map'](db['FreshsalesConfiguration'][_0x5c18('0x2d')],function(_0xca016b){return{'name':_0xca016b[_0x5c18('0x2e')],'type':_0xca016b[_0x5c18('0x2f')]['key']};});_0x4021b3[_0x5c18('0x30')]=_[_0x5c18('0x31')](_0x264228,_0x5c18('0x2a'));_0x4021b3[_0x5c18('0x32')]=_['keys'](_0x4af314[_0x5c18('0x32')]);_0x4021b3['filters']=_[_0x5c18('0x33')](_0x4021b3['model'],_0x4021b3[_0x5c18('0x32')]);_0x138801[_0x5c18('0x34')]=_[_0x5c18('0x33')](_0x4021b3['model'],qs[_0x5c18('0x35')](_0x4af314[_0x5c18('0x32')]['fields']));_0x138801['attributes']=_0x138801['attributes'][_0x5c18('0x36')]?_0x138801['attributes']:_0x4021b3[_0x5c18('0x30')];if(!_0x4af314[_0x5c18('0x32')][_0x5c18('0x37')](_0x5c18('0x38'))){_0x138801[_0x5c18('0x1e')]=qs[_0x5c18('0x1e')](_0x4af314['query'][_0x5c18('0x1e')]);_0x138801['offset']=qs['offset'](_0x4af314['query'][_0x5c18('0x1d')]);}_0x138801[_0x5c18('0x39')]=qs[_0x5c18('0x3a')](_0x4af314['query'][_0x5c18('0x3a')]);_0x138801[_0x5c18('0x3b')]=qs['filters'](_[_0x5c18('0x3c')](_0x4af314[_0x5c18('0x32')],_0x4021b3[_0x5c18('0x3d')]),_0x264228);if(_0x4af314[_0x5c18('0x32')][_0x5c18('0x3e')]){_0x138801[_0x5c18('0x3b')]=_[_0x5c18('0x3f')](_0x138801[_0x5c18('0x3b')],{'$or':_[_0x5c18('0x31')](_0x264228,function(_0x2e412b){if(_0x2e412b[_0x5c18('0x2f')]!==_0x5c18('0x40')){var _0x5a0939={};_0x5a0939[_0x2e412b['name']]={'$like':'%'+_0x4af314[_0x5c18('0x32')][_0x5c18('0x3e')]+'%'};return _0x5a0939;}})});}_0x138801=_['merge']({},_0x138801,_0x4af314['options']);var _0x43224a={'where':_0x138801[_0x5c18('0x3b')]};return db['FreshsalesConfiguration'][_0x5c18('0x20')](_0x43224a)[_0x5c18('0x26')](function(_0x24022d){_0x4e5a7c[_0x5c18('0x20')]=_0x24022d;if(_0x4af314[_0x5c18('0x32')][_0x5c18('0x41')]){_0x138801[_0x5c18('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x5c18('0x43')](_0x138801);})[_0x5c18('0x26')](function(_0x2f5dfe){_0x4e5a7c[_0x5c18('0x44')]=_0x2f5dfe;return _0x4e5a7c;})[_0x5c18('0x26')](respondWithFilteredResult(_0x245617,_0x138801))['catch'](handleError(_0x245617,null));};exports[_0x5c18('0x45')]=function(_0x344126,_0x35b82a){var _0x4adafe={'raw':![],'where':{'id':_0x344126[_0x5c18('0x46')]['id']}},_0x42562b={};_0x42562b[_0x5c18('0x30')]=_[_0x5c18('0x47')](db[_0x5c18('0x48')][_0x5c18('0x2d')]);_0x42562b['query']=_[_0x5c18('0x47')](_0x344126[_0x5c18('0x32')]);_0x42562b[_0x5c18('0x3d')]=_[_0x5c18('0x33')](_0x42562b['model'],_0x42562b[_0x5c18('0x32')]);_0x4adafe[_0x5c18('0x34')]=_[_0x5c18('0x33')](_0x42562b[_0x5c18('0x30')],qs[_0x5c18('0x35')](_0x344126[_0x5c18('0x32')]['fields']));_0x4adafe['attributes']=_0x4adafe[_0x5c18('0x34')][_0x5c18('0x36')]?_0x4adafe[_0x5c18('0x34')]:_0x42562b[_0x5c18('0x30')];if(_0x344126[_0x5c18('0x32')][_0x5c18('0x41')]){_0x4adafe['include']=[{'all':!![]}];}_0x4adafe=_['merge']({},_0x4adafe,_0x344126['options']);return db[_0x5c18('0x48')][_0x5c18('0x49')](_0x4adafe)['then'](handleEntityNotFound(_0x35b82a,null))['then'](respondWithResult(_0x35b82a,null))[_0x5c18('0x4a')](handleError(_0x35b82a,null));};exports['create']=function(_0x4c5366,_0x238ae9){return db['FreshsalesConfiguration'][_0x5c18('0x4b')](_0x4c5366[_0x5c18('0x4c')],{})['then'](respondWithResult(_0x238ae9,0xc9))[_0x5c18('0x4a')](handleError(_0x238ae9,null));};exports[_0x5c18('0x25')]=function(_0x434a04,_0x36d027){if(_0x434a04[_0x5c18('0x4c')]['id']){delete _0x434a04[_0x5c18('0x4c')]['id'];}return db[_0x5c18('0x48')][_0x5c18('0x49')]({'where':{'id':_0x434a04[_0x5c18('0x46')]['id']}})[_0x5c18('0x26')](handleEntityNotFound(_0x36d027,null))[_0x5c18('0x26')](saveUpdates(_0x434a04[_0x5c18('0x4c')],null))['then'](respondWithResult(_0x36d027,null))[_0x5c18('0x4a')](handleError(_0x36d027,null));};exports['destroy']=function(_0x413948,_0x420817){return db[_0x5c18('0x48')]['find']({'where':{'id':_0x413948[_0x5c18('0x46')]['id']}})['then'](handleEntityNotFound(_0x420817,null))[_0x5c18('0x26')](removeEntity(_0x420817,null))[_0x5c18('0x4a')](handleError(_0x420817,null));};exports['getSubjects']=function(_0xbbe9b1,_0xc8721e,_0x45f103){var _0xa44794={};var _0x2fd7d={};var _0x10c511;var _0x1770b2;return db['FreshsalesConfiguration'][_0x5c18('0x4d')]({'where':{'id':_0xbbe9b1['params']['id']}})['then'](handleEntityNotFound(_0xc8721e,null))[_0x5c18('0x26')](function(_0x27c975){if(_0x27c975){_0x10c511=_0x27c975;_0x2fd7d[_0x5c18('0x30')]=_['keys'](db['FreshsalesField'][_0x5c18('0x2d')]);_0x2fd7d['query']=_[_0x5c18('0x47')](_0xbbe9b1[_0x5c18('0x32')]);_0x2fd7d[_0x5c18('0x3d')]=_['intersection'](_0x2fd7d[_0x5c18('0x30')],_0x2fd7d['query']);_0xa44794[_0x5c18('0x34')]=_[_0x5c18('0x33')](_0x2fd7d[_0x5c18('0x30')],qs[_0x5c18('0x35')](_0xbbe9b1[_0x5c18('0x32')][_0x5c18('0x35')]));_0xa44794[_0x5c18('0x34')]=_0xa44794[_0x5c18('0x34')]['length']?_0xa44794[_0x5c18('0x34')]:_0x2fd7d[_0x5c18('0x30')];_0xa44794[_0x5c18('0x39')]=qs['sort'](_0xbbe9b1[_0x5c18('0x32')][_0x5c18('0x3a')]);_0xa44794[_0x5c18('0x3b')]=qs[_0x5c18('0x3d')](_['pick'](_0xbbe9b1[_0x5c18('0x32')],_0x2fd7d[_0x5c18('0x3d')]));if(_0xbbe9b1[_0x5c18('0x32')][_0x5c18('0x3e')]){_0xa44794[_0x5c18('0x3b')]=_[_0x5c18('0x3f')](_0xa44794[_0x5c18('0x3b')],{'$or':_[_0x5c18('0x31')](_0xa44794['attributes'],function(_0x360f5a){var _0x4ac78d={};_0x4ac78d[_0x360f5a]={'$like':'%'+_0xbbe9b1[_0x5c18('0x32')][_0x5c18('0x3e')]+'%'};return _0x4ac78d;})});}_0xa44794=_[_0x5c18('0x3f')]({},_0xa44794,_0xbbe9b1[_0x5c18('0x4e')]);return _0x10c511[_0x5c18('0x4f')](_0xa44794);}})['then'](function(_0x23d927){if(_0x23d927){_0x1770b2=_0x23d927['length'];if(!_0xbbe9b1[_0x5c18('0x32')]['hasOwnProperty']('nolimit')){_0xa44794['limit']=qs[_0x5c18('0x1e')](_0xbbe9b1[_0x5c18('0x32')][_0x5c18('0x1e')]);_0xa44794[_0x5c18('0x1d')]=qs[_0x5c18('0x1d')](_0xbbe9b1[_0x5c18('0x32')]['offset']);}return _0x10c511[_0x5c18('0x4f')](_0xa44794);}})[_0x5c18('0x26')](function(_0x5f05c9){if(_0x5f05c9){return _0x5f05c9?{'count':_0x1770b2,'rows':_0x5f05c9}:null;}})[_0x5c18('0x26')](respondWithResult(_0xc8721e,null))[_0x5c18('0x4a')](handleError(_0xc8721e,null));};exports[_0x5c18('0x50')]=function(_0x3094ec,_0x732b64,_0x3ee8c1){var _0x95c6e2={};var _0x5d8020={};var _0x21f3f4;var _0x515434;return db['FreshsalesConfiguration'][_0x5c18('0x4d')]({'where':{'id':_0x3094ec[_0x5c18('0x46')]['id']}})[_0x5c18('0x26')](handleEntityNotFound(_0x732b64,null))[_0x5c18('0x26')](function(_0x432fad){if(_0x432fad){_0x21f3f4=_0x432fad;_0x5d8020['model']=_['keys'](db['FreshsalesField'][_0x5c18('0x2d')]);_0x5d8020[_0x5c18('0x32')]=_[_0x5c18('0x47')](_0x3094ec[_0x5c18('0x32')]);_0x5d8020['filters']=_['intersection'](_0x5d8020[_0x5c18('0x30')],_0x5d8020['query']);_0x95c6e2[_0x5c18('0x34')]=_[_0x5c18('0x33')](_0x5d8020['model'],qs[_0x5c18('0x35')](_0x3094ec[_0x5c18('0x32')][_0x5c18('0x35')]));_0x95c6e2[_0x5c18('0x34')]=_0x95c6e2[_0x5c18('0x34')][_0x5c18('0x36')]?_0x95c6e2[_0x5c18('0x34')]:_0x5d8020[_0x5c18('0x30')];_0x95c6e2[_0x5c18('0x39')]=qs[_0x5c18('0x3a')](_0x3094ec[_0x5c18('0x32')][_0x5c18('0x3a')]);_0x95c6e2['where']=qs['filters'](_[_0x5c18('0x3c')](_0x3094ec[_0x5c18('0x32')],_0x5d8020[_0x5c18('0x3d')]));if(_0x3094ec[_0x5c18('0x32')][_0x5c18('0x3e')]){_0x95c6e2[_0x5c18('0x3b')]=_[_0x5c18('0x3f')](_0x95c6e2[_0x5c18('0x3b')],{'$or':_[_0x5c18('0x31')](_0x95c6e2[_0x5c18('0x34')],function(_0x959f3c){var _0x2b1acb={};_0x2b1acb[_0x959f3c]={'$like':'%'+_0x3094ec[_0x5c18('0x32')][_0x5c18('0x3e')]+'%'};return _0x2b1acb;})});}_0x95c6e2=_[_0x5c18('0x3f')]({},_0x95c6e2,_0x3094ec[_0x5c18('0x4e')]);return _0x21f3f4['getDescriptions'](_0x95c6e2);}})[_0x5c18('0x26')](function(_0x2ffadc){if(_0x2ffadc){_0x515434=_0x2ffadc['length'];if(!_0x3094ec[_0x5c18('0x32')][_0x5c18('0x37')](_0x5c18('0x38'))){_0x95c6e2[_0x5c18('0x1e')]=qs[_0x5c18('0x1e')](_0x3094ec[_0x5c18('0x32')]['limit']);_0x95c6e2[_0x5c18('0x1d')]=qs[_0x5c18('0x1d')](_0x3094ec['query'][_0x5c18('0x1d')]);}return _0x21f3f4['getDescriptions'](_0x95c6e2);}})['then'](function(_0x33060a){if(_0x33060a){return _0x33060a?{'count':_0x515434,'rows':_0x33060a}:null;}})['then'](respondWithResult(_0x732b64,null))[_0x5c18('0x4a')](handleError(_0x732b64,null));};exports[_0x5c18('0x51')]=function(_0x56b657,_0x1abd11,_0x54f0aa){var _0x14bee7={};var _0x3f629={};var _0x3028b8;var _0x4086c7;return db[_0x5c18('0x48')][_0x5c18('0x4d')]({'where':{'id':_0x56b657[_0x5c18('0x46')]['id']}})[_0x5c18('0x26')](handleEntityNotFound(_0x1abd11,null))['then'](function(_0x17af52){if(_0x17af52){_0x3028b8=_0x17af52;_0x3f629[_0x5c18('0x30')]=_[_0x5c18('0x47')](db[_0x5c18('0x52')][_0x5c18('0x2d')]);_0x3f629['query']=_[_0x5c18('0x47')](_0x56b657[_0x5c18('0x32')]);_0x3f629[_0x5c18('0x3d')]=_[_0x5c18('0x33')](_0x3f629[_0x5c18('0x30')],_0x3f629[_0x5c18('0x32')]);_0x14bee7[_0x5c18('0x34')]=_[_0x5c18('0x33')](_0x3f629['model'],qs[_0x5c18('0x35')](_0x56b657[_0x5c18('0x32')]['fields']));_0x14bee7[_0x5c18('0x34')]=_0x14bee7[_0x5c18('0x34')][_0x5c18('0x36')]?_0x14bee7['attributes']:_0x3f629['model'];_0x14bee7['order']=qs[_0x5c18('0x3a')](_0x56b657[_0x5c18('0x32')]['sort']);_0x14bee7[_0x5c18('0x3b')]=qs[_0x5c18('0x3d')](_[_0x5c18('0x3c')](_0x56b657[_0x5c18('0x32')],_0x3f629['filters']));if(_0x56b657[_0x5c18('0x32')][_0x5c18('0x3e')]){_0x14bee7[_0x5c18('0x3b')]=_[_0x5c18('0x3f')](_0x14bee7['where'],{'$or':_['map'](_0x14bee7[_0x5c18('0x34')],function(_0x2430b9){var _0x189c85={};_0x189c85[_0x2430b9]={'$like':'%'+_0x56b657['query']['filter']+'%'};return _0x189c85;})});}_0x14bee7=_[_0x5c18('0x3f')]({},_0x14bee7,_0x56b657[_0x5c18('0x4e')]);return _0x3028b8[_0x5c18('0x51')](_0x14bee7);}})[_0x5c18('0x26')](function(_0x3fb1a7){if(_0x3fb1a7){_0x4086c7=_0x3fb1a7[_0x5c18('0x36')];if(!_0x56b657[_0x5c18('0x32')][_0x5c18('0x37')](_0x5c18('0x38'))){_0x14bee7[_0x5c18('0x1e')]=qs[_0x5c18('0x1e')](_0x56b657[_0x5c18('0x32')][_0x5c18('0x1e')]);_0x14bee7[_0x5c18('0x1d')]=qs[_0x5c18('0x1d')](_0x56b657[_0x5c18('0x32')][_0x5c18('0x1d')]);}return _0x3028b8[_0x5c18('0x51')](_0x14bee7);}})[_0x5c18('0x26')](function(_0x583fbd){if(_0x583fbd){return _0x583fbd?{'count':_0x4086c7,'rows':_0x583fbd}:null;}})[_0x5c18('0x26')](respondWithResult(_0x1abd11,null))[_0x5c18('0x4a')](handleError(_0x1abd11,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 1828596..39da636 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 _0x1ae3=['int_freshsales_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x1ae3,0x139));var _0x31ae=function(_0x208aa6,_0x67e085){_0x208aa6=_0x208aa6-0x0;var _0xd7bf3=_0x1ae3[_0x208aa6];return _0xd7bf3;};'use strict';var _=require(_0x31ae('0x0'));var util=require(_0x31ae('0x1'));var logger=require('../../config/logger')(_0x31ae('0x2'));var moment=require(_0x31ae('0x3'));var BPromise=require(_0x31ae('0x4'));var rp=require(_0x31ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31ae('0x6'));var config=require(_0x31ae('0x7'));var attributes=require(_0x31ae('0x8'));module[_0x31ae('0x9')]=function(_0xe1202b,_0x3f2e91){return _0xe1202b[_0x31ae('0xa')](_0x31ae('0xb'),attributes,{'tableName':_0x31ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94e8=['exports','define','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x2de196,_0x4a75ca){var _0x49d01c=function(_0x4e5ea6){while(--_0x4e5ea6){_0x2de196['push'](_0x2de196['shift']());}};_0x49d01c(++_0x4a75ca);}(_0x94e8,0xe9));var _0x894e=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x94e8[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0x894e('0x0'));var util=require(_0x894e('0x1'));var logger=require(_0x894e('0x2'))('api');var moment=require(_0x894e('0x3'));var BPromise=require('bluebird');var rp=require(_0x894e('0x4'));var fs=require('fs');var path=require(_0x894e('0x5'));var rimraf=require(_0x894e('0x6'));var config=require(_0x894e('0x7'));var attributes=require(_0x894e('0x8'));module[_0x894e('0x9')]=function(_0x1d0dfd,_0x2d532c){return _0x1d0dfd[_0x894e('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index afbdca2..24bb0e1 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 _0x3622=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x491189,_0x31ce96){var _0x372549=function(_0x20434f){while(--_0x20434f){_0x491189['push'](_0x491189['shift']());}};_0x372549(++_0x31ce96);}(_0x3622,0x17f));var _0x2362=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x3622[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require('lodash');var util=require(_0x2362('0x0'));var moment=require(_0x2362('0x1'));var BPromise=require(_0x2362('0x2'));var rs=require(_0x2362('0x3'));var fs=require('fs');var Redis=require(_0x2362('0x4'));var db=require(_0x2362('0x5'))['db'];var utils=require(_0x2362('0x6'));var logger=require('../../config/logger')(_0x2362('0x7'));var config=require(_0x2362('0x8'));var jayson=require(_0x2362('0x9'));var client=jayson[_0x2362('0xa')][_0x2362('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40e403,_0x14a047,_0x233f2c){return new BPromise(function(_0x4eed88,_0x30357d){return client[_0x2362('0xc')](_0x40e403,_0x233f2c)[_0x2362('0xd')](function(_0x226649){logger[_0x2362('0xe')](_0x2362('0xf'),_0x14a047,_0x2362('0x10'));logger[_0x2362('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x14a047,_0x2362('0x10'),JSON[_0x2362('0x12')](_0x226649));if(_0x226649[_0x2362('0x13')]){if(_0x226649[_0x2362('0x13')][_0x2362('0x14')]===0x1f4){logger[_0x2362('0x13')](_0x2362('0xf'),_0x14a047,_0x226649[_0x2362('0x13')][_0x2362('0x15')]);return _0x30357d(_0x226649[_0x2362('0x13')]['message']);}logger[_0x2362('0x13')](_0x2362('0xf'),_0x14a047,_0x226649['error'][_0x2362('0x15')]);return _0x4eed88(_0x226649[_0x2362('0x13')][_0x2362('0x15')]);}else{logger[_0x2362('0xe')](_0x2362('0xf'),_0x14a047,'request\x20sent');_0x4eed88(_0x226649[_0x2362('0x16')][_0x2362('0x15')]);}})[_0x2362('0x17')](function(_0x1e8ee8){logger[_0x2362('0x13')](_0x2362('0xf'),_0x14a047,_0x1e8ee8);_0x30357d(_0x1e8ee8);});});} \ No newline at end of file +var _0xa970=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x183eb8,_0x500b42){var _0x4465cc=function(_0x2474cb){while(--_0x2474cb){_0x183eb8['push'](_0x183eb8['shift']());}};_0x4465cc(++_0x500b42);}(_0xa970,0x157));var _0x0a97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa970[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a97('0x0'));var util=require(_0x0a97('0x1'));var moment=require('moment');var BPromise=require(_0x0a97('0x2'));var rs=require(_0x0a97('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0a97('0x4'))('rpc');var config=require(_0x0a97('0x5'));var jayson=require(_0x0a97('0x6'));var client=jayson[_0x0a97('0x7')][_0x0a97('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf31656,_0x544330,_0x30f7c3){return new BPromise(function(_0x195165,_0x54573b){return client['request'](_0xf31656,_0x30f7c3)['then'](function(_0xeafd9c){logger['info'](_0x0a97('0x9'),_0x544330,_0x0a97('0xa'));logger[_0x0a97('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x544330,_0x0a97('0xa'),JSON['stringify'](_0xeafd9c));if(_0xeafd9c[_0x0a97('0xc')]){if(_0xeafd9c['error'][_0x0a97('0xd')]===0x1f4){logger['error'](_0x0a97('0x9'),_0x544330,_0xeafd9c[_0x0a97('0xc')]['message']);return _0x54573b(_0xeafd9c['error'][_0x0a97('0xe')]);}logger[_0x0a97('0xc')](_0x0a97('0x9'),_0x544330,_0xeafd9c[_0x0a97('0xc')][_0x0a97('0xe')]);return _0x195165(_0xeafd9c[_0x0a97('0xc')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x544330,'request\x20sent');_0x195165(_0xeafd9c[_0x0a97('0xf')][_0x0a97('0xe')]);}})['catch'](function(_0x589caf){logger[_0x0a97('0xc')](_0x0a97('0x9'),_0x544330,_0x589caf);_0x54573b(_0x589caf);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 365e3d3..d25a8aa 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 _0x1782=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x1d7cc1,_0xf5292b){var _0x56f525=function(_0x3b71a3){while(--_0x3b71a3){_0x1d7cc1['push'](_0x1d7cc1['shift']());}};_0x56f525(++_0xf5292b);}(_0x1782,0x13e));var _0x2178=function(_0x5c750f,_0x37a483){_0x5c750f=_0x5c750f-0x0;var _0x3777aa=_0x1782[_0x5c750f];return _0x3777aa;};'use strict';var multer=require(_0x2178('0x0'));var util=require('util');var path=require(_0x2178('0x1'));var timeout=require(_0x2178('0x2'));var express=require(_0x2178('0x3'));var router=express[_0x2178('0x4')]();var fs_extra=require(_0x2178('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2178('0x6'));var config=require(_0x2178('0x7'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x2178('0x8')](),controller[_0x2178('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2178('0xa')]);router[_0x2178('0xb')]('/',auth[_0x2178('0x8')](),controller[_0x2178('0xc')]);router[_0x2178('0xd')](_0x2178('0xe'),auth['isAuthenticated'](),controller[_0x2178('0xf')]);router[_0x2178('0x10')](_0x2178('0xe'),auth[_0x2178('0x8')](),controller[_0x2178('0x11')]);module[_0x2178('0x12')]=router; \ No newline at end of file +var _0x6e16=['update','delete','destroy','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x525a3e,_0x246b27){var _0x8b013d=function(_0x1dbb73){while(--_0x1dbb73){_0x525a3e['push'](_0x525a3e['shift']());}};_0x8b013d(++_0x246b27);}(_0x6e16,0x1d3));var _0x66e1=function(_0x113efe,_0xb56371){_0x113efe=_0x113efe-0x0;var _0x5c1de4=_0x6e16[_0x113efe];return _0x5c1de4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x66e1('0x0'));var timeout=require('connect-timeout');var express=require(_0x66e1('0x1'));var router=express['Router']();var fs_extra=require(_0x66e1('0x2'));var auth=require(_0x66e1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x66e1('0x4'));var controller=require('./intFreshsalesField.controller');router[_0x66e1('0x5')]('/',auth[_0x66e1('0x6')](),controller[_0x66e1('0x7')]);router['get'](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller[_0x66e1('0x9')]);router[_0x66e1('0xa')]('/',auth[_0x66e1('0x6')](),controller[_0x66e1('0xb')]);router[_0x66e1('0xc')](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller[_0x66e1('0xd')]);router[_0x66e1('0xe')](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller[_0x66e1('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index b1892f6..300da82 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 _0xeed5=['ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xeed5,0x1d2));var _0x5eed=function(_0x7328d7,_0x3762b1){_0x7328d7=_0x7328d7-0x0;var _0x2d9f2b=_0xeed5[_0x7328d7];return _0x2d9f2b;};'use strict';var Sequelize=require(_0x5eed('0x0'));module[_0x5eed('0x1')]={'type':{'type':Sequelize[_0x5eed('0x2')](_0x5eed('0x3'),_0x5eed('0x4'),'customVariable',_0x5eed('0x5'),'picklist'),'defaultValue':_0x5eed('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5eed('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5eed('0x3'),_0x5eed('0x4'),_0x5eed('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5eed('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5eed('0x6')]}}; \ No newline at end of file +var _0x20e8=['picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x20e8,0x1e4));var _0x820e=function(_0x4e19ed,_0x448fd6){_0x4e19ed=_0x4e19ed-0x0;var _0x181ee4=_0x20e8[_0x4e19ed];return _0x181ee4;};'use strict';var Sequelize=require(_0x820e('0x0'));module[_0x820e('0x1')]={'type':{'type':Sequelize[_0x820e('0x2')]('string',_0x820e('0x3'),_0x820e('0x4'),_0x820e('0x5'),_0x820e('0x6')),'defaultValue':_0x820e('0x7')},'content':{'type':Sequelize[_0x820e('0x8')]},'key':{'type':Sequelize[_0x820e('0x8')]},'keyType':{'type':Sequelize[_0x820e('0x2')]('string',_0x820e('0x3'),_0x820e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x820e('0x8')]},'nameField':{'type':Sequelize[_0x820e('0x8')]},'customField':{'type':Sequelize[_0x820e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x820e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 3f745a0..a5970e6 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 _0x13ca=['catch','show','keys','length','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','VIRTUAL','merge','includeAll','include','FreshsalesField','rows'];(function(_0x4b5c36,_0x45a730){var _0x3767f0=function(_0x5ecf15){while(--_0x5ecf15){_0x4b5c36['push'](_0x4b5c36['shift']());}};_0x3767f0(++_0x45a730);}(_0x13ca,0x1d7));var _0xa13c=function(_0x4bd96,_0xed872c){_0x4bd96=_0x4bd96-0x0;var _0x550062=_0x13ca[_0x4bd96];return _0x550062;};'use strict';var emlformat=require(_0xa13c('0x0'));var rimraf=require(_0xa13c('0x1'));var zipdir=require(_0xa13c('0x2'));var jsonpatch=require(_0xa13c('0x3'));var rp=require(_0xa13c('0x4'));var moment=require(_0xa13c('0x5'));var BPromise=require(_0xa13c('0x6'));var Mustache=require(_0xa13c('0x7'));var util=require(_0xa13c('0x8'));var path=require(_0xa13c('0x9'));var sox=require('sox');var csv=require(_0xa13c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa13c('0xb'));var _=require(_0xa13c('0xc'));var squel=require('squel');var crypto=require(_0xa13c('0xd'));var jsforce=require(_0xa13c('0xe'));var deskjs=require(_0xa13c('0xf'));var toCsv=require(_0xa13c('0xa'));var querystring=require(_0xa13c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa13c('0x11'));var authService=require(_0xa13c('0x12'));var qs=require(_0xa13c('0x13'));var as=require(_0xa13c('0x14'));var hardwareService=require(_0xa13c('0x15'));var logger=require(_0xa13c('0x16'))(_0xa13c('0x17'));var utils=require('../../config/utils');var config=require(_0xa13c('0x18'));var licenseUtil=require(_0xa13c('0x19'));var db=require(_0xa13c('0x1a'))['db'];function respondWithStatusCode(_0x524a50,_0x1fa255){_0x1fa255=_0x1fa255||0xcc;return function(_0x43f585){if(_0x43f585){return _0x524a50[_0xa13c('0x1b')](_0x1fa255);}return _0x524a50[_0xa13c('0x1c')](_0x1fa255)[_0xa13c('0x1d')]();};}function respondWithResult(_0x260693,_0x5d9b5a){_0x5d9b5a=_0x5d9b5a||0xc8;return function(_0x1b7e8d){if(_0x1b7e8d){return _0x260693[_0xa13c('0x1c')](_0x5d9b5a)[_0xa13c('0x1e')](_0x1b7e8d);}};}function respondWithFilteredResult(_0x20e063,_0x501713){return function(_0x500d5e){if(_0x500d5e){var _0x420231=typeof _0x501713[_0xa13c('0x1f')]===_0xa13c('0x20')&&typeof _0x501713[_0xa13c('0x21')]==='undefined';var _0x4a898e=_0x500d5e[_0xa13c('0x22')];var _0x1bbc63=_0x420231?0x0:_0x501713[_0xa13c('0x1f')];var _0x3d4f4d=_0x420231?_0x500d5e[_0xa13c('0x22')]:_0x501713[_0xa13c('0x1f')]+_0x501713['limit'];var _0x54b418;if(_0x3d4f4d>=_0x4a898e){_0x3d4f4d=_0x4a898e;_0x54b418=0xc8;}else{_0x54b418=0xce;}_0x20e063[_0xa13c('0x1c')](_0x54b418);return _0x20e063[_0xa13c('0x23')](_0xa13c('0x24'),_0x1bbc63+'-'+_0x3d4f4d+'/'+_0x4a898e)['json'](_0x500d5e);}return null;};}function patchUpdates(_0x31b523){return function(_0x34c6e0){try{jsonpatch[_0xa13c('0x25')](_0x34c6e0,_0x31b523,!![]);}catch(_0x4ce02f){return BPromise[_0xa13c('0x26')](_0x4ce02f);}return _0x34c6e0[_0xa13c('0x27')]();};}function saveUpdates(_0x346e41,_0x6ba8ec){return function(_0x38fa38){if(_0x38fa38){return _0x38fa38[_0xa13c('0x28')](_0x346e41)[_0xa13c('0x29')](function(_0x13d683){return _0x13d683;});}return null;};}function removeEntity(_0xcd9ba5,_0xf14385){return function(_0x296d20){if(_0x296d20){return _0x296d20[_0xa13c('0x2a')]()[_0xa13c('0x29')](function(){_0xcd9ba5[_0xa13c('0x1c')](0xcc)[_0xa13c('0x1d')]();});}};}function handleEntityNotFound(_0xed66ca,_0x163c23){return function(_0x3a082c){if(!_0x3a082c){_0xed66ca[_0xa13c('0x1b')](0x194);}return _0x3a082c;};}function handleError(_0x3fc32b,_0x243d02){_0x243d02=_0x243d02||0x1f4;return function(_0x1a1885){logger[_0xa13c('0x2b')](_0x1a1885[_0xa13c('0x2c')]);if(_0x1a1885[_0xa13c('0x2d')]){delete _0x1a1885[_0xa13c('0x2d')];}_0x3fc32b[_0xa13c('0x1c')](_0x243d02)[_0xa13c('0x2e')](_0x1a1885);};}exports['index']=function(_0x135ba4,_0x528c31){var _0x3c1824={},_0x580b30={},_0x396062={'count':0x0,'rows':[]};var _0x43a694=_[_0xa13c('0x2f')](db['FreshsalesField'][_0xa13c('0x30')],function(_0x5f07c5){return{'name':_0x5f07c5[_0xa13c('0x31')],'type':_0x5f07c5[_0xa13c('0x32')][_0xa13c('0x33')]};});_0x580b30[_0xa13c('0x34')]=_[_0xa13c('0x2f')](_0x43a694,_0xa13c('0x2d'));_0x580b30[_0xa13c('0x35')]=_['keys'](_0x135ba4['query']);_0x580b30['filters']=_[_0xa13c('0x36')](_0x580b30[_0xa13c('0x34')],_0x580b30[_0xa13c('0x35')]);_0x3c1824[_0xa13c('0x37')]=_[_0xa13c('0x36')](_0x580b30['model'],qs[_0xa13c('0x38')](_0x135ba4[_0xa13c('0x35')][_0xa13c('0x38')]));_0x3c1824[_0xa13c('0x37')]=_0x3c1824[_0xa13c('0x37')]['length']?_0x3c1824[_0xa13c('0x37')]:_0x580b30[_0xa13c('0x34')];if(!_0x135ba4[_0xa13c('0x35')]['hasOwnProperty'](_0xa13c('0x39'))){_0x3c1824['limit']=qs[_0xa13c('0x21')](_0x135ba4[_0xa13c('0x35')][_0xa13c('0x21')]);_0x3c1824[_0xa13c('0x1f')]=qs[_0xa13c('0x1f')](_0x135ba4[_0xa13c('0x35')][_0xa13c('0x1f')]);}_0x3c1824['order']=qs[_0xa13c('0x3a')](_0x135ba4[_0xa13c('0x35')][_0xa13c('0x3a')]);_0x3c1824[_0xa13c('0x3b')]=qs[_0xa13c('0x3c')](_[_0xa13c('0x3d')](_0x135ba4[_0xa13c('0x35')],_0x580b30[_0xa13c('0x3c')]),_0x43a694);if(_0x135ba4[_0xa13c('0x35')]['filter']){_0x3c1824['where']=_['merge'](_0x3c1824['where'],{'$or':_['map'](_0x43a694,function(_0x36deaa){if(_0x36deaa[_0xa13c('0x32')]!==_0xa13c('0x3e')){var _0x28023e={};_0x28023e[_0x36deaa[_0xa13c('0x2d')]]={'$like':'%'+_0x135ba4[_0xa13c('0x35')]['filter']+'%'};return _0x28023e;}})});}_0x3c1824=_[_0xa13c('0x3f')]({},_0x3c1824,_0x135ba4['options']);var _0x584144={'where':_0x3c1824[_0xa13c('0x3b')]};return db['FreshsalesField']['count'](_0x584144)[_0xa13c('0x29')](function(_0xeb8789){_0x396062[_0xa13c('0x22')]=_0xeb8789;if(_0x135ba4[_0xa13c('0x35')][_0xa13c('0x40')]){_0x3c1824[_0xa13c('0x41')]=[{'all':!![]}];}return db[_0xa13c('0x42')]['findAll'](_0x3c1824);})[_0xa13c('0x29')](function(_0x48887c){_0x396062[_0xa13c('0x43')]=_0x48887c;return _0x396062;})['then'](respondWithFilteredResult(_0x528c31,_0x3c1824))[_0xa13c('0x44')](handleError(_0x528c31,null));};exports[_0xa13c('0x45')]=function(_0x3f22d4,_0x3be540){var _0x4cb94d={'raw':!![],'where':{'id':_0x3f22d4['params']['id']}},_0xcef44d={};_0xcef44d[_0xa13c('0x34')]=_[_0xa13c('0x46')](db[_0xa13c('0x42')][_0xa13c('0x30')]);_0xcef44d[_0xa13c('0x35')]=_[_0xa13c('0x46')](_0x3f22d4['query']);_0xcef44d[_0xa13c('0x3c')]=_[_0xa13c('0x36')](_0xcef44d[_0xa13c('0x34')],_0xcef44d[_0xa13c('0x35')]);_0x4cb94d[_0xa13c('0x37')]=_[_0xa13c('0x36')](_0xcef44d[_0xa13c('0x34')],qs[_0xa13c('0x38')](_0x3f22d4['query'][_0xa13c('0x38')]));_0x4cb94d[_0xa13c('0x37')]=_0x4cb94d['attributes'][_0xa13c('0x47')]?_0x4cb94d['attributes']:_0xcef44d['model'];if(_0x3f22d4[_0xa13c('0x35')][_0xa13c('0x40')]){_0x4cb94d[_0xa13c('0x41')]=[{'all':!![]}];}_0x4cb94d=_[_0xa13c('0x3f')]({},_0x4cb94d,_0x3f22d4[_0xa13c('0x48')]);return db[_0xa13c('0x42')][_0xa13c('0x49')](_0x4cb94d)[_0xa13c('0x29')](handleEntityNotFound(_0x3be540,null))[_0xa13c('0x29')](respondWithResult(_0x3be540,null))[_0xa13c('0x44')](handleError(_0x3be540,null));};exports['create']=function(_0x562b06,_0x2fc8e7){return db[_0xa13c('0x42')][_0xa13c('0x4a')](_0x562b06[_0xa13c('0x4b')],{})[_0xa13c('0x29')](respondWithResult(_0x2fc8e7,0xc9))[_0xa13c('0x44')](handleError(_0x2fc8e7,null));};exports[_0xa13c('0x28')]=function(_0x5f500d,_0x2044c3){if(_0x5f500d['body']['id']){delete _0x5f500d[_0xa13c('0x4b')]['id'];}return db[_0xa13c('0x42')][_0xa13c('0x49')]({'where':{'id':_0x5f500d[_0xa13c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2044c3,null))[_0xa13c('0x29')](saveUpdates(_0x5f500d[_0xa13c('0x4b')],null))[_0xa13c('0x29')](respondWithResult(_0x2044c3,null))[_0xa13c('0x44')](handleError(_0x2044c3,null));};exports[_0xa13c('0x2a')]=function(_0x318cec,_0x444e7d){return db[_0xa13c('0x42')]['find']({'where':{'id':_0x318cec[_0xa13c('0x4c')]['id']}})[_0xa13c('0x29')](handleEntityNotFound(_0x444e7d,null))[_0xa13c('0x29')](removeEntity(_0x444e7d,null))[_0xa13c('0x44')](handleError(_0x444e7d,null));}; \ No newline at end of file +var _0xe090=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0xe090,0x7b));var _0x0e09=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe090[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x0e09('0x0'));var rimraf=require(_0x0e09('0x1'));var zipdir=require(_0x0e09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0e09('0x3'));var util=require(_0x0e09('0x4'));var path=require(_0x0e09('0x5'));var sox=require(_0x0e09('0x6'));var csv=require(_0x0e09('0x7'));var ejs=require(_0x0e09('0x8'));var fs=require('fs');var fs_extra=require(_0x0e09('0x9'));var _=require('lodash');var squel=require(_0x0e09('0xa'));var crypto=require(_0x0e09('0xb'));var jsforce=require(_0x0e09('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e09('0xd'));var authService=require(_0x0e09('0xe'));var qs=require(_0x0e09('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e09('0x10'))(_0x0e09('0x11'));var utils=require(_0x0e09('0x12'));var config=require(_0x0e09('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e09('0x14'))['db'];function respondWithStatusCode(_0x48d02c,_0x4489a6){_0x4489a6=_0x4489a6||0xcc;return function(_0x11281f){if(_0x11281f){return _0x48d02c[_0x0e09('0x15')](_0x4489a6);}return _0x48d02c[_0x0e09('0x16')](_0x4489a6)[_0x0e09('0x17')]();};}function respondWithResult(_0x5736f2,_0x3652ee){_0x3652ee=_0x3652ee||0xc8;return function(_0x55fd70){if(_0x55fd70){return _0x5736f2[_0x0e09('0x16')](_0x3652ee)[_0x0e09('0x18')](_0x55fd70);}};}function respondWithFilteredResult(_0x80f6bc,_0x435896){return function(_0x12f39f){if(_0x12f39f){var _0x1f845e=typeof _0x435896[_0x0e09('0x19')]===_0x0e09('0x1a')&&typeof _0x435896['limit']==='undefined';var _0x577cf9=_0x12f39f[_0x0e09('0x1b')];var _0x49472a=_0x1f845e?0x0:_0x435896['offset'];var _0x54a224=_0x1f845e?_0x12f39f[_0x0e09('0x1b')]:_0x435896['offset']+_0x435896[_0x0e09('0x1c')];var _0x1c36b7;if(_0x54a224>=_0x577cf9){_0x54a224=_0x577cf9;_0x1c36b7=0xc8;}else{_0x1c36b7=0xce;}_0x80f6bc[_0x0e09('0x16')](_0x1c36b7);return _0x80f6bc[_0x0e09('0x1d')](_0x0e09('0x1e'),_0x49472a+'-'+_0x54a224+'/'+_0x577cf9)[_0x0e09('0x18')](_0x12f39f);}return null;};}function patchUpdates(_0x17d11b){return function(_0x1eddf7){try{jsonpatch[_0x0e09('0x1f')](_0x1eddf7,_0x17d11b,!![]);}catch(_0x2da737){return BPromise['reject'](_0x2da737);}return _0x1eddf7[_0x0e09('0x20')]();};}function saveUpdates(_0x122a69,_0x148927){return function(_0x5c82fd){if(_0x5c82fd){return _0x5c82fd[_0x0e09('0x21')](_0x122a69)[_0x0e09('0x22')](function(_0x2e05a5){return _0x2e05a5;});}return null;};}function removeEntity(_0x194512,_0x487430){return function(_0x46381c){if(_0x46381c){return _0x46381c[_0x0e09('0x23')]()[_0x0e09('0x22')](function(){_0x194512['status'](0xcc)[_0x0e09('0x17')]();});}};}function handleEntityNotFound(_0x32393b,_0x122203){return function(_0x5c2597){if(!_0x5c2597){_0x32393b[_0x0e09('0x15')](0x194);}return _0x5c2597;};}function handleError(_0x5393fe,_0x48bd05){_0x48bd05=_0x48bd05||0x1f4;return function(_0x4f47c9){logger[_0x0e09('0x24')](_0x4f47c9[_0x0e09('0x25')]);if(_0x4f47c9['name']){delete _0x4f47c9[_0x0e09('0x26')];}_0x5393fe[_0x0e09('0x16')](_0x48bd05)['send'](_0x4f47c9);};}exports[_0x0e09('0x27')]=function(_0x495467,_0x27ff4c){var _0x8d5b42={},_0x5e85e0={},_0x1475b6={'count':0x0,'rows':[]};var _0x33a4a5=_[_0x0e09('0x28')](db[_0x0e09('0x29')][_0x0e09('0x2a')],function(_0x4fe195){return{'name':_0x4fe195[_0x0e09('0x2b')],'type':_0x4fe195['type'][_0x0e09('0x2c')]};});_0x5e85e0[_0x0e09('0x2d')]=_[_0x0e09('0x28')](_0x33a4a5,_0x0e09('0x26'));_0x5e85e0['query']=_[_0x0e09('0x2e')](_0x495467[_0x0e09('0x2f')]);_0x5e85e0[_0x0e09('0x30')]=_['intersection'](_0x5e85e0[_0x0e09('0x2d')],_0x5e85e0[_0x0e09('0x2f')]);_0x8d5b42[_0x0e09('0x31')]=_[_0x0e09('0x32')](_0x5e85e0[_0x0e09('0x2d')],qs[_0x0e09('0x33')](_0x495467['query'][_0x0e09('0x33')]));_0x8d5b42[_0x0e09('0x31')]=_0x8d5b42[_0x0e09('0x31')]['length']?_0x8d5b42['attributes']:_0x5e85e0['model'];if(!_0x495467[_0x0e09('0x2f')][_0x0e09('0x34')](_0x0e09('0x35'))){_0x8d5b42[_0x0e09('0x1c')]=qs['limit'](_0x495467['query'][_0x0e09('0x1c')]);_0x8d5b42[_0x0e09('0x19')]=qs['offset'](_0x495467[_0x0e09('0x2f')][_0x0e09('0x19')]);}_0x8d5b42[_0x0e09('0x36')]=qs[_0x0e09('0x37')](_0x495467[_0x0e09('0x2f')][_0x0e09('0x37')]);_0x8d5b42[_0x0e09('0x38')]=qs['filters'](_['pick'](_0x495467[_0x0e09('0x2f')],_0x5e85e0['filters']),_0x33a4a5);if(_0x495467[_0x0e09('0x2f')]['filter']){_0x8d5b42['where']=_[_0x0e09('0x39')](_0x8d5b42[_0x0e09('0x38')],{'$or':_[_0x0e09('0x28')](_0x33a4a5,function(_0x1e5f00){if(_0x1e5f00['type']!==_0x0e09('0x3a')){var _0x180ad3={};_0x180ad3[_0x1e5f00['name']]={'$like':'%'+_0x495467[_0x0e09('0x2f')][_0x0e09('0x3b')]+'%'};return _0x180ad3;}})});}_0x8d5b42=_[_0x0e09('0x39')]({},_0x8d5b42,_0x495467[_0x0e09('0x3c')]);var _0x2d4e4a={'where':_0x8d5b42[_0x0e09('0x38')]};return db['FreshsalesField']['count'](_0x2d4e4a)[_0x0e09('0x22')](function(_0x21183f){_0x1475b6[_0x0e09('0x1b')]=_0x21183f;if(_0x495467['query'][_0x0e09('0x3d')]){_0x8d5b42[_0x0e09('0x3e')]=[{'all':!![]}];}return db['FreshsalesField'][_0x0e09('0x3f')](_0x8d5b42);})[_0x0e09('0x22')](function(_0x161793){_0x1475b6[_0x0e09('0x40')]=_0x161793;return _0x1475b6;})[_0x0e09('0x22')](respondWithFilteredResult(_0x27ff4c,_0x8d5b42))[_0x0e09('0x41')](handleError(_0x27ff4c,null));};exports[_0x0e09('0x42')]=function(_0x4effc5,_0x4a65fd){var _0x2a7b95={'raw':!![],'where':{'id':_0x4effc5[_0x0e09('0x43')]['id']}},_0x273c20={};_0x273c20[_0x0e09('0x2d')]=_[_0x0e09('0x2e')](db[_0x0e09('0x29')]['rawAttributes']);_0x273c20[_0x0e09('0x2f')]=_[_0x0e09('0x2e')](_0x4effc5[_0x0e09('0x2f')]);_0x273c20['filters']=_[_0x0e09('0x32')](_0x273c20[_0x0e09('0x2d')],_0x273c20[_0x0e09('0x2f')]);_0x2a7b95[_0x0e09('0x31')]=_[_0x0e09('0x32')](_0x273c20['model'],qs[_0x0e09('0x33')](_0x4effc5['query'][_0x0e09('0x33')]));_0x2a7b95[_0x0e09('0x31')]=_0x2a7b95[_0x0e09('0x31')][_0x0e09('0x44')]?_0x2a7b95[_0x0e09('0x31')]:_0x273c20[_0x0e09('0x2d')];if(_0x4effc5[_0x0e09('0x2f')][_0x0e09('0x3d')]){_0x2a7b95[_0x0e09('0x3e')]=[{'all':!![]}];}_0x2a7b95=_['merge']({},_0x2a7b95,_0x4effc5[_0x0e09('0x3c')]);return db[_0x0e09('0x29')]['find'](_0x2a7b95)[_0x0e09('0x22')](handleEntityNotFound(_0x4a65fd,null))['then'](respondWithResult(_0x4a65fd,null))['catch'](handleError(_0x4a65fd,null));};exports[_0x0e09('0x45')]=function(_0x301066,_0x1d0724){return db[_0x0e09('0x29')][_0x0e09('0x45')](_0x301066[_0x0e09('0x46')],{})[_0x0e09('0x22')](respondWithResult(_0x1d0724,0xc9))[_0x0e09('0x41')](handleError(_0x1d0724,null));};exports['update']=function(_0x551656,_0x593d71){if(_0x551656[_0x0e09('0x46')]['id']){delete _0x551656[_0x0e09('0x46')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x551656[_0x0e09('0x43')]['id']}})[_0x0e09('0x22')](handleEntityNotFound(_0x593d71,null))[_0x0e09('0x22')](saveUpdates(_0x551656[_0x0e09('0x46')],null))[_0x0e09('0x22')](respondWithResult(_0x593d71,null))[_0x0e09('0x41')](handleError(_0x593d71,null));};exports[_0x0e09('0x23')]=function(_0x425a7d,_0x35e0f4){return db['FreshsalesField']['find']({'where':{'id':_0x425a7d[_0x0e09('0x43')]['id']}})['then'](handleEntityNotFound(_0x35e0f4,null))[_0x0e09('0x22')](removeEntity(_0x35e0f4,null))['catch'](handleError(_0x35e0f4,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index c488109..6713797 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 _0x3c85=['request-promise','path','rimraf','./intFreshsalesField.attributes','exports','freshsales_unique_index','lodash','util','../../config/logger','api'];(function(_0x28d54c,_0x53d9ba){var _0x32ab5c=function(_0x18959b){while(--_0x18959b){_0x28d54c['push'](_0x28d54c['shift']());}};_0x32ab5c(++_0x53d9ba);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1fe0ae,_0x154d47){_0x1fe0ae=_0x1fe0ae-0x0;var _0x3d18e7=_0x3c85[_0x1fe0ae];return _0x3d18e7;};'use strict';var _=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var logger=require(_0x53c8('0x2'))(_0x53c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53c8('0x4'));var fs=require('fs');var path=require(_0x53c8('0x5'));var rimraf=require(_0x53c8('0x6'));var config=require('../../config/environment');var attributes=require(_0x53c8('0x7'));module[_0x53c8('0x8')]=function(_0x4758fd,_0x4c2e1b){return _0x4758fd['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x53c8('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb35=['idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index'];(function(_0x5b8d93,_0x35f96e){var _0x430323=function(_0x46a916){while(--_0x46a916){_0x5b8d93['push'](_0x5b8d93['shift']());}};_0x430323(++_0x35f96e);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x460bfb,_0x85ed31){_0x460bfb=_0x460bfb-0x0;var _0x3c124e=_0xbb35[_0x460bfb];return _0x3c124e;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var logger=require(_0x5bb3('0x1'))(_0x5bb3('0x2'));var moment=require(_0x5bb3('0x3'));var BPromise=require(_0x5bb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bb3('0x5'));var rimraf=require(_0x5bb3('0x6'));var config=require(_0x5bb3('0x7'));var attributes=require(_0x5bb3('0x8'));module[_0x5bb3('0x9')]=function(_0x321535,_0x46ef03){return _0x321535[_0x5bb3('0xa')](_0x5bb3('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x5bb3('0xc'),'fields':[_0x5bb3('0xd'),_0x5bb3('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 443b795..6be4876 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 _0x7096=['code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0x7096,0x10c));var _0x6709=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x7096[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x241627,_0x3cb86d){var _0x3e91ad=function(_0x15cd3d){while(--_0x15cd3d){_0x241627['push'](_0x241627['shift']());}};_0x3e91ad(++_0x3cb86d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x310690,_0x16ebba){_0x310690=_0x310690-0x0;var _0x53451f=_0xc6ac[_0x310690];return _0x53451f;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d867e70..8869c6c 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(_0x217eab,_0x3abf2d){var _0x3702af=function(_0x43c815){while(--_0x43c815){_0x217eab['push'](_0x217eab['shift']());}};_0x3702af(++_0x3abf2d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x3c26e2,_0x18ee22){var _0x245eb5=function(_0x3bda26){while(--_0x3bda26){_0x3c26e2['push'](_0x3c26e2['shift']());}};_0x245eb5(++_0x18ee22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 831b26a..7aee65f 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 _0x0699=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x4597b4,_0xea2b02){var _0x4eab5e=function(_0x546bc7){while(--_0x546bc7){_0x4597b4['push'](_0x4597b4['shift']());}};_0x4eab5e(++_0xea2b02);}(_0x0699,0x1db));var _0x9069=function(_0x1dc63e,_0x608bb7){_0x1dc63e=_0x1dc63e-0x0;var _0x36816f=_0x0699[_0x1dc63e];return _0x36816f;};'use strict';var Sequelize=require(_0x9069('0x0'));module['exports']={'name':{'type':Sequelize[_0x9069('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9069('0x1')],'unique':_0x9069('0x2')},'remoteUri':{'type':Sequelize[_0x9069('0x1')]},'password':{'type':Sequelize[_0x9069('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x9069('0x1')]},'securityToken':{'type':Sequelize[_0x9069('0x1')]},'serverUrl':{'type':Sequelize[_0x9069('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9069('0x3')](_0x9069('0x4'),_0x9069('0x5')),'defaultValue':_0x9069('0x4')}}; \ No newline at end of file +var _0x689b=['integrationTab','newTab','sequelize','STRING','username'];(function(_0x101807,_0x1143f7){var _0x3ea2ab=function(_0x52b794){while(--_0x52b794){_0x101807['push'](_0x101807['shift']());}};_0x3ea2ab(++_0x1143f7);}(_0x689b,0x142));var _0xb689=function(_0xc9e666,_0x2cca30){_0xc9e666=_0xc9e666-0x0;var _0x4b7f5e=_0x689b[_0xc9e666];return _0x4b7f5e;};'use strict';var Sequelize=require(_0xb689('0x0'));module['exports']={'name':{'type':Sequelize[_0xb689('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xb689('0x2')},'remoteUri':{'type':Sequelize[_0xb689('0x1')]},'password':{'type':Sequelize[_0xb689('0x1')]},'clientId':{'type':Sequelize[_0xb689('0x1')]},'clientSecret':{'type':Sequelize[_0xb689('0x1')]},'securityToken':{'type':Sequelize[_0xb689('0x1')]},'serverUrl':{'type':Sequelize[_0xb689('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb689('0x3'),_0xb689('0x4')),'defaultValue':_0xb689('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 14b1d10..e4b72cd 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 _0x9e01=['reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','merge','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','lastIndexOf','Connection','login','password','concat','isNil','ticketType','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','email','textarea','phone','includes','picklistValues','label','value','boolean','true','False','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','Content-Range'];(function(_0x419a47,_0x17697b){var _0x46ea5e=function(_0x5fa4a0){while(--_0x5fa4a0){_0x419a47['push'](_0x419a47['shift']());}};_0x46ea5e(++_0x17697b);}(_0x9e01,0xd4));var _0x19e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9e01[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x19e0('0x0'));var rimraf=require(_0x19e0('0x1'));var zipdir=require(_0x19e0('0x2'));var jsonpatch=require(_0x19e0('0x3'));var rp=require(_0x19e0('0x4'));var moment=require(_0x19e0('0x5'));var BPromise=require(_0x19e0('0x6'));var Mustache=require(_0x19e0('0x7'));var util=require(_0x19e0('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x19e0('0x9'));var ejs=require(_0x19e0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19e0('0xb'));var squel=require('squel');var crypto=require(_0x19e0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x19e0('0xd'));var toCsv=require(_0x19e0('0x9'));var querystring=require(_0x19e0('0xe'));var Papa=require(_0x19e0('0xf'));var Redis=require(_0x19e0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x19e0('0x11'));var as=require(_0x19e0('0x12'));var hardwareService=require(_0x19e0('0x13'));var logger=require(_0x19e0('0x14'))('api');var utils=require(_0x19e0('0x15'));var config=require(_0x19e0('0x16'));var licenseUtil=require(_0x19e0('0x17'));var db=require(_0x19e0('0x18'))['db'];var integrations=require(_0x19e0('0x19'));function respondWithStatusCode(_0x2b0f34,_0x4b6b81){_0x4b6b81=_0x4b6b81||0xcc;return function(_0x48a3ac){if(_0x48a3ac){return _0x2b0f34['sendStatus'](_0x4b6b81);}return _0x2b0f34['status'](_0x4b6b81)[_0x19e0('0x1a')]();};}function respondWithResult(_0x3e5602,_0x5c79ff){_0x5c79ff=_0x5c79ff||0xc8;return function(_0x121a6e){if(_0x121a6e){return _0x3e5602['status'](_0x5c79ff)[_0x19e0('0x1b')](_0x121a6e);}};}function respondWithFilteredResult(_0x5e2f80,_0x29b522){return function(_0xe1a4c0){if(_0xe1a4c0){var _0x3cac09=typeof _0x29b522[_0x19e0('0x1c')]===_0x19e0('0x1d')&&typeof _0x29b522['limit']===_0x19e0('0x1d');var _0x5344b9=_0xe1a4c0[_0x19e0('0x1e')];var _0x965adc=_0x3cac09?0x0:_0x29b522[_0x19e0('0x1c')];var _0x353440=_0x3cac09?_0xe1a4c0['count']:_0x29b522['offset']+_0x29b522[_0x19e0('0x1f')];var _0x32c789;if(_0x353440>=_0x5344b9){_0x353440=_0x5344b9;_0x32c789=0xc8;}else{_0x32c789=0xce;}_0x5e2f80[_0x19e0('0x20')](_0x32c789);return _0x5e2f80['set'](_0x19e0('0x21'),_0x965adc+'-'+_0x353440+'/'+_0x5344b9)[_0x19e0('0x1b')](_0xe1a4c0);}return null;};}function patchUpdates(_0x4392b5){return function(_0x21a747){try{jsonpatch['apply'](_0x21a747,_0x4392b5,!![]);}catch(_0x2408ea){return BPromise[_0x19e0('0x22')](_0x2408ea);}return _0x21a747[_0x19e0('0x23')]();};}function saveUpdates(_0x2be1ec,_0x3f16c4){return function(_0x195933){if(_0x195933){return _0x195933[_0x19e0('0x24')](_0x2be1ec)['then'](function(_0x121081){return _0x121081;});}return null;};}function removeEntity(_0x4804d6,_0x191ad8){return function(_0x40e97d){if(_0x40e97d){return _0x40e97d[_0x19e0('0x25')]()['then'](function(){_0x4804d6['status'](0xcc)[_0x19e0('0x1a')]();});}};}function handleEntityNotFound(_0x48c1a9,_0x249057){return function(_0x3566c6){if(!_0x3566c6){_0x48c1a9[_0x19e0('0x26')](0x194);}return _0x3566c6;};}function handleError(_0x18fc93,_0x23dc68){_0x23dc68=_0x23dc68||0x1f4;return function(_0x16b249){logger[_0x19e0('0x27')](_0x16b249[_0x19e0('0x28')]);if(_0x16b249[_0x19e0('0x29')]){delete _0x16b249[_0x19e0('0x29')];}_0x18fc93[_0x19e0('0x20')](_0x23dc68)[_0x19e0('0x2a')](_0x16b249);};}exports[_0x19e0('0x2b')]=function(_0x2c5186,_0x4a35ea){var _0x74d528={},_0x275f45={},_0x15aba9={'count':0x0,'rows':[]};var _0x6fb7b=_[_0x19e0('0x2c')](db[_0x19e0('0x2d')][_0x19e0('0x2e')],function(_0x1ab7d1){return{'name':_0x1ab7d1[_0x19e0('0x2f')],'type':_0x1ab7d1[_0x19e0('0x30')]['key']};});_0x275f45['model']=_[_0x19e0('0x2c')](_0x6fb7b,_0x19e0('0x29'));_0x275f45[_0x19e0('0x31')]=_[_0x19e0('0x32')](_0x2c5186[_0x19e0('0x31')]);_0x275f45[_0x19e0('0x33')]=_[_0x19e0('0x34')](_0x275f45[_0x19e0('0x35')],_0x275f45[_0x19e0('0x31')]);_0x74d528[_0x19e0('0x36')]=_[_0x19e0('0x34')](_0x275f45[_0x19e0('0x35')],qs[_0x19e0('0x37')](_0x2c5186[_0x19e0('0x31')]['fields']));_0x74d528['attributes']=_0x74d528['attributes'][_0x19e0('0x38')]?_0x74d528[_0x19e0('0x36')]:_0x275f45[_0x19e0('0x35')];if(!_0x2c5186[_0x19e0('0x31')][_0x19e0('0x39')]('nolimit')){_0x74d528[_0x19e0('0x1f')]=qs['limit'](_0x2c5186[_0x19e0('0x31')][_0x19e0('0x1f')]);_0x74d528[_0x19e0('0x1c')]=qs[_0x19e0('0x1c')](_0x2c5186['query'][_0x19e0('0x1c')]);}_0x74d528[_0x19e0('0x3a')]=qs[_0x19e0('0x3b')](_0x2c5186[_0x19e0('0x31')][_0x19e0('0x3b')]);_0x74d528[_0x19e0('0x3c')]=qs['filters'](_['pick'](_0x2c5186['query'],_0x275f45['filters']),_0x6fb7b);if(_0x2c5186[_0x19e0('0x31')][_0x19e0('0x3d')]){_0x74d528[_0x19e0('0x3c')]=_['merge'](_0x74d528[_0x19e0('0x3c')],{'$or':_[_0x19e0('0x2c')](_0x6fb7b,function(_0x26a28e){if(_0x26a28e[_0x19e0('0x30')]!==_0x19e0('0x3e')){var _0xcac65f={};_0xcac65f[_0x26a28e[_0x19e0('0x29')]]={'$like':'%'+_0x2c5186[_0x19e0('0x31')][_0x19e0('0x3d')]+'%'};return _0xcac65f;}})});}_0x74d528=_['merge']({},_0x74d528,_0x2c5186[_0x19e0('0x3f')]);var _0x3a7405={'where':_0x74d528[_0x19e0('0x3c')]};return db[_0x19e0('0x2d')]['count'](_0x3a7405)[_0x19e0('0x40')](function(_0x2416e9){_0x15aba9[_0x19e0('0x1e')]=_0x2416e9;if(_0x2c5186[_0x19e0('0x31')][_0x19e0('0x41')]){_0x74d528[_0x19e0('0x42')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x19e0('0x43')](_0x74d528);})[_0x19e0('0x40')](function(_0x3596dd){_0x15aba9[_0x19e0('0x44')]=_0x3596dd;return _0x15aba9;})[_0x19e0('0x40')](respondWithFilteredResult(_0x4a35ea,_0x74d528))[_0x19e0('0x45')](handleError(_0x4a35ea,null));};exports['show']=function(_0x1807b5,_0x1832cc){var _0x4aee6a={'raw':![],'where':{'id':_0x1807b5[_0x19e0('0x46')]['id']}},_0x4b860b={};_0x4b860b[_0x19e0('0x35')]=_[_0x19e0('0x32')](db[_0x19e0('0x2d')]['rawAttributes']);_0x4b860b[_0x19e0('0x31')]=_[_0x19e0('0x32')](_0x1807b5[_0x19e0('0x31')]);_0x4b860b[_0x19e0('0x33')]=_['intersection'](_0x4b860b['model'],_0x4b860b[_0x19e0('0x31')]);_0x4aee6a['attributes']=_[_0x19e0('0x34')](_0x4b860b[_0x19e0('0x35')],qs[_0x19e0('0x37')](_0x1807b5[_0x19e0('0x31')]['fields']));_0x4aee6a['attributes']=_0x4aee6a['attributes']['length']?_0x4aee6a[_0x19e0('0x36')]:_0x4b860b[_0x19e0('0x35')];if(_0x1807b5['query'][_0x19e0('0x41')]){_0x4aee6a[_0x19e0('0x42')]=[{'all':!![]}];}_0x4aee6a=_[_0x19e0('0x47')]({},_0x4aee6a,_0x1807b5['options']);return db['SalesforceAccount'][_0x19e0('0x48')](_0x4aee6a)['then'](handleEntityNotFound(_0x1832cc,null))['then'](respondWithResult(_0x1832cc,null))[_0x19e0('0x45')](handleError(_0x1832cc,null));};exports[_0x19e0('0x49')]=function(_0x297192,_0x21ea8a){return db['SalesforceAccount'][_0x19e0('0x49')](_0x297192[_0x19e0('0x4a')],{})[_0x19e0('0x40')](respondWithResult(_0x21ea8a,0xc9))[_0x19e0('0x45')](handleError(_0x21ea8a,null));};exports[_0x19e0('0x24')]=function(_0x285033,_0x6ccb0){if(_0x285033[_0x19e0('0x4a')]['id']){delete _0x285033['body']['id'];}return db[_0x19e0('0x2d')][_0x19e0('0x48')]({'where':{'id':_0x285033[_0x19e0('0x46')]['id']}})[_0x19e0('0x40')](handleEntityNotFound(_0x6ccb0,null))[_0x19e0('0x40')](saveUpdates(_0x285033[_0x19e0('0x4a')],null))[_0x19e0('0x40')](respondWithResult(_0x6ccb0,null))[_0x19e0('0x45')](handleError(_0x6ccb0,null));};exports[_0x19e0('0x25')]=function(_0x99a12f,_0xd29fa5){return db[_0x19e0('0x2d')][_0x19e0('0x48')]({'where':{'id':_0x99a12f['params']['id']}})[_0x19e0('0x40')](handleEntityNotFound(_0xd29fa5,null))[_0x19e0('0x40')](removeEntity(_0xd29fa5,null))[_0x19e0('0x45')](handleError(_0xd29fa5,null));};exports[_0x19e0('0x4b')]=function(_0x294bd7,_0x1314f6,_0x1edad8){var _0x1357bc={};var _0x30a69a={};var _0x35cc16;var _0x22b675;return db[_0x19e0('0x2d')][_0x19e0('0x4c')]({'where':{'id':_0x294bd7[_0x19e0('0x46')]['id']}})[_0x19e0('0x40')](handleEntityNotFound(_0x1314f6,null))['then'](function(_0x28c3be){if(_0x28c3be){_0x35cc16=_0x28c3be;_0x30a69a[_0x19e0('0x35')]=_[_0x19e0('0x32')](db[_0x19e0('0x4d')][_0x19e0('0x2e')]);_0x30a69a[_0x19e0('0x31')]=_[_0x19e0('0x32')](_0x294bd7[_0x19e0('0x31')]);_0x30a69a['filters']=_[_0x19e0('0x34')](_0x30a69a[_0x19e0('0x35')],_0x30a69a[_0x19e0('0x31')]);_0x1357bc[_0x19e0('0x36')]=_[_0x19e0('0x34')](_0x30a69a[_0x19e0('0x35')],qs[_0x19e0('0x37')](_0x294bd7[_0x19e0('0x31')][_0x19e0('0x37')]));_0x1357bc[_0x19e0('0x36')]=_0x1357bc[_0x19e0('0x36')][_0x19e0('0x38')]?_0x1357bc[_0x19e0('0x36')]:_0x30a69a[_0x19e0('0x35')];_0x1357bc[_0x19e0('0x3a')]=qs['sort'](_0x294bd7[_0x19e0('0x31')][_0x19e0('0x3b')]);_0x1357bc[_0x19e0('0x3c')]=qs[_0x19e0('0x33')](_[_0x19e0('0x4e')](_0x294bd7[_0x19e0('0x31')],_0x30a69a[_0x19e0('0x33')]));if(_0x294bd7[_0x19e0('0x31')][_0x19e0('0x3d')]){_0x1357bc[_0x19e0('0x3c')]=_['merge'](_0x1357bc[_0x19e0('0x3c')],{'$or':_[_0x19e0('0x2c')](_0x1357bc[_0x19e0('0x36')],function(_0x202d5e){var _0x4d26b4={};_0x4d26b4[_0x202d5e]={'$like':'%'+_0x294bd7[_0x19e0('0x31')]['filter']+'%'};return _0x4d26b4;})});}_0x1357bc=_[_0x19e0('0x47')]({},_0x1357bc,_0x294bd7[_0x19e0('0x3f')]);return _0x35cc16[_0x19e0('0x4b')](_0x1357bc);}})[_0x19e0('0x40')](function(_0x262a28){if(_0x262a28){_0x22b675=_0x262a28['length'];if(!_0x294bd7[_0x19e0('0x31')]['hasOwnProperty'](_0x19e0('0x4f'))){_0x1357bc[_0x19e0('0x1f')]=qs[_0x19e0('0x1f')](_0x294bd7[_0x19e0('0x31')][_0x19e0('0x1f')]);_0x1357bc[_0x19e0('0x1c')]=qs['offset'](_0x294bd7[_0x19e0('0x31')]['offset']);}return _0x35cc16[_0x19e0('0x4b')](_0x1357bc);}})[_0x19e0('0x40')](function(_0x27ae40){if(_0x27ae40){return _0x27ae40?{'count':_0x22b675,'rows':_0x27ae40}:null;}})[_0x19e0('0x40')](respondWithResult(_0x1314f6,null))[_0x19e0('0x45')](handleError(_0x1314f6,null));};exports[_0x19e0('0x50')]=function(_0x41a317,_0x56cae7,_0x5183a0){if(_0x41a317[_0x19e0('0x4a')]['id']){delete _0x41a317[_0x19e0('0x4a')]['id'];}return db[_0x19e0('0x2d')][_0x19e0('0x4c')]({'where':{'id':_0x41a317[_0x19e0('0x46')]['id']}})[_0x19e0('0x40')](handleEntityNotFound(_0x56cae7,null))[_0x19e0('0x40')](function(_0x2faaf0){if(_0x2faaf0){_0x41a317[_0x19e0('0x4a')]['AccountId']=_0x2faaf0['id'];_0x41a317[_0x19e0('0x4a')][_0x19e0('0x51')]=integrations[_0x19e0('0x52')](_0x41a317[_0x19e0('0x4a')][_0x19e0('0x53')],_0x41a317[_0x19e0('0x4a')][_0x19e0('0x30')]);_0x41a317[_0x19e0('0x4a')][_0x19e0('0x54')]=integrations[_0x19e0('0x55')](_0x41a317[_0x19e0('0x4a')][_0x19e0('0x53')],_0x41a317[_0x19e0('0x4a')][_0x19e0('0x30')]);return db['SalesforceConfiguration'][_0x19e0('0x49')](_0x41a317['body'],{'include':[{'model':db[_0x19e0('0x56')],'as':'Subjects'},{'model':db[_0x19e0('0x56')],'as':_0x19e0('0x54')}]});}return null;})[_0x19e0('0x40')](respondWithResult(_0x56cae7,null))[_0x19e0('0x45')](handleError(_0x56cae7,null));};exports[_0x19e0('0x57')]=function(_0x1550a9,_0x1dbad5,_0x44d225){var _0x270d12;var _0x1a6b35='';var _0x4e92a1=_0x19e0('0x58');return db[_0x19e0('0x2d')][_0x19e0('0x4c')]({'where':{'id':_0x1550a9[_0x19e0('0x46')]['id']},'attributes':['id',_0x19e0('0x59'),_0x19e0('0x5a'),_0x19e0('0x5b'),_0x19e0('0x5c'),'password',_0x19e0('0x5d')]})[_0x19e0('0x40')](handleEntityNotFound(_0x1dbad5,null))['then'](function(_0x502800){if(_0x502800){_0x1a6b35=_0x502800[_0x19e0('0x59')];var _0x2d0aef=_0x1a6b35[_0x19e0('0x5e')](-0x1);if(_0x2d0aef==='/'){_0x1a6b35=_0x1a6b35['substring'](0x0,_0x1a6b35[_0x19e0('0x5f')](_0x2d0aef));}_0x270d12=new jsforce[(_0x19e0('0x60'))]({'oauth2':{'loginUrl':_0x1a6b35,'clientId':_0x502800[_0x19e0('0x5a')],'clientSecret':_0x502800[_0x19e0('0x5b')]}});return _0x270d12[_0x19e0('0x61')](_0x502800['username'],_0x502800[_0x19e0('0x62')][_0x19e0('0x63')](_0x502800[_0x19e0('0x5d')]));}})[_0x19e0('0x40')](function(_0x46c3ed){if(_0x46c3ed){if(!_[_0x19e0('0x64')](_0x1550a9[_0x19e0('0x31')][_0x19e0('0x65')])){_0x4e92a1=_0x1550a9[_0x19e0('0x31')][_0x19e0('0x65')];}return _0x270d12['sobject'](_0x4e92a1)['describe']();}})[_0x19e0('0x40')](function(_0x41cf8a){var _0x51032d=[_0x19e0('0x66'),_0x19e0('0x67'),_0x19e0('0x68'),_0x19e0('0x69'),_0x19e0('0x6a'),'Description'];var _0x45620f=[_0x19e0('0x6b'),_0x19e0('0x6c'),_0x19e0('0x6d'),'boolean',_0x19e0('0x6e'),_0x19e0('0x6f'),_0x19e0('0x70')];if(_0x41cf8a){_['remove'](_0x41cf8a[_0x19e0('0x37')],function(_0xa09630){return _0x51032d[_0x19e0('0x71')](_0xa09630['name'])||!_0x45620f[_0x19e0('0x71')](_0xa09630['type']);});return{'count':_0x41cf8a['fields'][_0x19e0('0x38')],'rows':_[_0x19e0('0x2c')](_0x41cf8a[_0x19e0('0x37')],function(_0x279017){return{'id':_0x279017[_0x19e0('0x29')],'name':_0x279017['label'],'custom':_0x279017['custom'],'options':_0x279017['picklistValues'][_0x19e0('0x38')]>0x0?_['map'](_0x279017[_0x19e0('0x72')],function(_0x3c112f){return{'name':_0x3c112f[_0x19e0('0x73')],'value':_0x3c112f[_0x19e0('0x74')]};}):_0x279017[_0x19e0('0x30')]==_0x19e0('0x75')?[{'name':'True','value':_0x19e0('0x76')},{'name':_0x19e0('0x77'),'value':'false'}]:[]};})};}})[_0x19e0('0x40')](respondWithResult(_0x1dbad5,null))[_0x19e0('0x45')](function(_0x46cca2){var _0x55bacb=_0x1550a9['query'][_0x19e0('0x78')]?0x1f4:_0x46cca2['statusCode']||0x1f4;logger[_0x19e0('0x27')](_0x19e0('0x79'),_0x19e0('0x57'),_0x55bacb,JSON['stringify'](_0x46cca2));delete _0x46cca2[_0x19e0('0x29')];if(_0x55bacb===0x191){_0x55bacb=0x190;}_0x1dbad5[_0x19e0('0x20')](_0x55bacb)[_0x19e0('0x2a')](_0x1550a9[_0x19e0('0x31')][_0x19e0('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x46cca2[_0x19e0('0x7a')]}:_0x46cca2);});}; \ No newline at end of file +var _0x83a5=['offset','undefined','count','limit','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','map','SalesforceAccount','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','params','rawAttributes','keys','find','catch','create','body','SalesforceConfiguration','order','options','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','username','concat','ticketType','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json'];(function(_0x3170c0,_0x79458){var _0x35cf63=function(_0x2d5824){while(--_0x2d5824){_0x3170c0['push'](_0x3170c0['shift']());}};_0x35cf63(++_0x79458);}(_0x83a5,0x1c2));var _0x583a=function(_0x1be2cf,_0x29a0ab){_0x1be2cf=_0x1be2cf-0x0;var _0x491b32=_0x83a5[_0x1be2cf];return _0x491b32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x583a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x583a('0x1'));var rp=require(_0x583a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x583a('0x3'));var util=require(_0x583a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x583a('0x5'));var ejs=require(_0x583a('0x6'));var fs=require('fs');var fs_extra=require(_0x583a('0x7'));var _=require(_0x583a('0x8'));var squel=require(_0x583a('0x9'));var crypto=require('crypto');var jsforce=require(_0x583a('0xa'));var deskjs=require(_0x583a('0xb'));var toCsv=require(_0x583a('0x5'));var querystring=require(_0x583a('0xc'));var Papa=require(_0x583a('0xd'));var Redis=require('ioredis');var authService=require(_0x583a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x583a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x583a('0x10'))(_0x583a('0x11'));var utils=require(_0x583a('0x12'));var config=require(_0x583a('0x13'));var licenseUtil=require(_0x583a('0x14'));var db=require(_0x583a('0x15'))['db'];var integrations=require(_0x583a('0x16'));function respondWithStatusCode(_0x25c077,_0x1200c0){_0x1200c0=_0x1200c0||0xcc;return function(_0x46940a){if(_0x46940a){return _0x25c077['sendStatus'](_0x1200c0);}return _0x25c077[_0x583a('0x17')](_0x1200c0)[_0x583a('0x18')]();};}function respondWithResult(_0x5078f7,_0x504137){_0x504137=_0x504137||0xc8;return function(_0x3464b8){if(_0x3464b8){return _0x5078f7[_0x583a('0x17')](_0x504137)[_0x583a('0x19')](_0x3464b8);}};}function respondWithFilteredResult(_0x576ecc,_0x50644a){return function(_0x26b2b4){if(_0x26b2b4){var _0x52e95f=typeof _0x50644a[_0x583a('0x1a')]===_0x583a('0x1b')&&typeof _0x50644a['limit']===_0x583a('0x1b');var _0x1c0d48=_0x26b2b4[_0x583a('0x1c')];var _0x220acb=_0x52e95f?0x0:_0x50644a['offset'];var _0x1348d4=_0x52e95f?_0x26b2b4['count']:_0x50644a[_0x583a('0x1a')]+_0x50644a[_0x583a('0x1d')];var _0x38ec07;if(_0x1348d4>=_0x1c0d48){_0x1348d4=_0x1c0d48;_0x38ec07=0xc8;}else{_0x38ec07=0xce;}_0x576ecc[_0x583a('0x17')](_0x38ec07);return _0x576ecc['set'](_0x583a('0x1e'),_0x220acb+'-'+_0x1348d4+'/'+_0x1c0d48)[_0x583a('0x19')](_0x26b2b4);}return null;};}function patchUpdates(_0x296fdd){return function(_0x2dd213){try{jsonpatch['apply'](_0x2dd213,_0x296fdd,!![]);}catch(_0x55d643){return BPromise[_0x583a('0x1f')](_0x55d643);}return _0x2dd213['save']();};}function saveUpdates(_0x39745b,_0x2376bb){return function(_0x4af25e){if(_0x4af25e){return _0x4af25e[_0x583a('0x20')](_0x39745b)[_0x583a('0x21')](function(_0x17dd04){return _0x17dd04;});}return null;};}function removeEntity(_0x609a8b,_0x56213f){return function(_0x2574b9){if(_0x2574b9){return _0x2574b9[_0x583a('0x22')]()['then'](function(){_0x609a8b[_0x583a('0x17')](0xcc)[_0x583a('0x18')]();});}};}function handleEntityNotFound(_0x3adc84,_0x3cb128){return function(_0x5081ee){if(!_0x5081ee){_0x3adc84[_0x583a('0x23')](0x194);}return _0x5081ee;};}function handleError(_0x42c44c,_0x29d76c){_0x29d76c=_0x29d76c||0x1f4;return function(_0x3fae6e){logger[_0x583a('0x24')](_0x3fae6e['stack']);if(_0x3fae6e[_0x583a('0x25')]){delete _0x3fae6e['name'];}_0x42c44c['status'](_0x29d76c)[_0x583a('0x26')](_0x3fae6e);};}exports['index']=function(_0x3b7271,_0x5a1e31){var _0x16a7ed={},_0x15bb11={},_0x4472c5={'count':0x0,'rows':[]};var _0x759e91=_[_0x583a('0x27')](db[_0x583a('0x28')]['rawAttributes'],function(_0x1f4f9c){return{'name':_0x1f4f9c[_0x583a('0x29')],'type':_0x1f4f9c[_0x583a('0x2a')][_0x583a('0x2b')]};});_0x15bb11['model']=_[_0x583a('0x27')](_0x759e91,_0x583a('0x25'));_0x15bb11['query']=_['keys'](_0x3b7271[_0x583a('0x2c')]);_0x15bb11[_0x583a('0x2d')]=_[_0x583a('0x2e')](_0x15bb11[_0x583a('0x2f')],_0x15bb11[_0x583a('0x2c')]);_0x16a7ed[_0x583a('0x30')]=_[_0x583a('0x2e')](_0x15bb11['model'],qs['fields'](_0x3b7271[_0x583a('0x2c')][_0x583a('0x31')]));_0x16a7ed[_0x583a('0x30')]=_0x16a7ed[_0x583a('0x30')][_0x583a('0x32')]?_0x16a7ed['attributes']:_0x15bb11['model'];if(!_0x3b7271[_0x583a('0x2c')][_0x583a('0x33')](_0x583a('0x34'))){_0x16a7ed[_0x583a('0x1d')]=qs[_0x583a('0x1d')](_0x3b7271[_0x583a('0x2c')][_0x583a('0x1d')]);_0x16a7ed[_0x583a('0x1a')]=qs[_0x583a('0x1a')](_0x3b7271[_0x583a('0x2c')][_0x583a('0x1a')]);}_0x16a7ed['order']=qs[_0x583a('0x35')](_0x3b7271[_0x583a('0x2c')][_0x583a('0x35')]);_0x16a7ed[_0x583a('0x36')]=qs['filters'](_[_0x583a('0x37')](_0x3b7271[_0x583a('0x2c')],_0x15bb11['filters']),_0x759e91);if(_0x3b7271['query'][_0x583a('0x38')]){_0x16a7ed[_0x583a('0x36')]=_[_0x583a('0x39')](_0x16a7ed[_0x583a('0x36')],{'$or':_[_0x583a('0x27')](_0x759e91,function(_0x5c497f){if(_0x5c497f[_0x583a('0x2a')]!=='VIRTUAL'){var _0x3dd78f={};_0x3dd78f[_0x5c497f['name']]={'$like':'%'+_0x3b7271[_0x583a('0x2c')][_0x583a('0x38')]+'%'};return _0x3dd78f;}})});}_0x16a7ed=_[_0x583a('0x39')]({},_0x16a7ed,_0x3b7271['options']);var _0x2a592e={'where':_0x16a7ed[_0x583a('0x36')]};return db[_0x583a('0x28')]['count'](_0x2a592e)[_0x583a('0x21')](function(_0x239235){_0x4472c5['count']=_0x239235;if(_0x3b7271[_0x583a('0x2c')][_0x583a('0x3a')]){_0x16a7ed[_0x583a('0x3b')]=[{'all':!![]}];}return db[_0x583a('0x28')]['findAll'](_0x16a7ed);})['then'](function(_0x3b14a1){_0x4472c5[_0x583a('0x3c')]=_0x3b14a1;return _0x4472c5;})['then'](respondWithFilteredResult(_0x5a1e31,_0x16a7ed))['catch'](handleError(_0x5a1e31,null));};exports['show']=function(_0x56597b,_0x4bd4e6){var _0x2540d8={'raw':![],'where':{'id':_0x56597b[_0x583a('0x3d')]['id']}},_0x46be4d={};_0x46be4d[_0x583a('0x2f')]=_['keys'](db[_0x583a('0x28')][_0x583a('0x3e')]);_0x46be4d[_0x583a('0x2c')]=_[_0x583a('0x3f')](_0x56597b[_0x583a('0x2c')]);_0x46be4d[_0x583a('0x2d')]=_[_0x583a('0x2e')](_0x46be4d[_0x583a('0x2f')],_0x46be4d[_0x583a('0x2c')]);_0x2540d8[_0x583a('0x30')]=_['intersection'](_0x46be4d[_0x583a('0x2f')],qs['fields'](_0x56597b[_0x583a('0x2c')][_0x583a('0x31')]));_0x2540d8[_0x583a('0x30')]=_0x2540d8[_0x583a('0x30')][_0x583a('0x32')]?_0x2540d8[_0x583a('0x30')]:_0x46be4d[_0x583a('0x2f')];if(_0x56597b[_0x583a('0x2c')][_0x583a('0x3a')]){_0x2540d8[_0x583a('0x3b')]=[{'all':!![]}];}_0x2540d8=_[_0x583a('0x39')]({},_0x2540d8,_0x56597b['options']);return db['SalesforceAccount'][_0x583a('0x40')](_0x2540d8)[_0x583a('0x21')](handleEntityNotFound(_0x4bd4e6,null))[_0x583a('0x21')](respondWithResult(_0x4bd4e6,null))[_0x583a('0x41')](handleError(_0x4bd4e6,null));};exports['create']=function(_0x9057b7,_0x17540d){return db[_0x583a('0x28')][_0x583a('0x42')](_0x9057b7['body'],{})['then'](respondWithResult(_0x17540d,0xc9))[_0x583a('0x41')](handleError(_0x17540d,null));};exports[_0x583a('0x20')]=function(_0x35c904,_0x1e8066){if(_0x35c904[_0x583a('0x43')]['id']){delete _0x35c904['body']['id'];}return db[_0x583a('0x28')]['find']({'where':{'id':_0x35c904[_0x583a('0x3d')]['id']}})[_0x583a('0x21')](handleEntityNotFound(_0x1e8066,null))[_0x583a('0x21')](saveUpdates(_0x35c904[_0x583a('0x43')],null))[_0x583a('0x21')](respondWithResult(_0x1e8066,null))[_0x583a('0x41')](handleError(_0x1e8066,null));};exports['destroy']=function(_0x5a4e41,_0x33519e){return db[_0x583a('0x28')][_0x583a('0x40')]({'where':{'id':_0x5a4e41[_0x583a('0x3d')]['id']}})[_0x583a('0x21')](handleEntityNotFound(_0x33519e,null))[_0x583a('0x21')](removeEntity(_0x33519e,null))[_0x583a('0x41')](handleError(_0x33519e,null));};exports['getConfigurations']=function(_0x3cd5a0,_0x15f2ce,_0x1be747){var _0x1bce73={};var _0x4718a8={};var _0x7709f9;var _0x19b715;return db[_0x583a('0x28')]['findOne']({'where':{'id':_0x3cd5a0['params']['id']}})[_0x583a('0x21')](handleEntityNotFound(_0x15f2ce,null))[_0x583a('0x21')](function(_0xfde654){if(_0xfde654){_0x7709f9=_0xfde654;_0x4718a8[_0x583a('0x2f')]=_[_0x583a('0x3f')](db[_0x583a('0x44')][_0x583a('0x3e')]);_0x4718a8[_0x583a('0x2c')]=_[_0x583a('0x3f')](_0x3cd5a0['query']);_0x4718a8[_0x583a('0x2d')]=_[_0x583a('0x2e')](_0x4718a8[_0x583a('0x2f')],_0x4718a8[_0x583a('0x2c')]);_0x1bce73[_0x583a('0x30')]=_[_0x583a('0x2e')](_0x4718a8[_0x583a('0x2f')],qs[_0x583a('0x31')](_0x3cd5a0[_0x583a('0x2c')]['fields']));_0x1bce73[_0x583a('0x30')]=_0x1bce73[_0x583a('0x30')][_0x583a('0x32')]?_0x1bce73[_0x583a('0x30')]:_0x4718a8[_0x583a('0x2f')];_0x1bce73[_0x583a('0x45')]=qs[_0x583a('0x35')](_0x3cd5a0[_0x583a('0x2c')]['sort']);_0x1bce73[_0x583a('0x36')]=qs[_0x583a('0x2d')](_[_0x583a('0x37')](_0x3cd5a0[_0x583a('0x2c')],_0x4718a8['filters']));if(_0x3cd5a0[_0x583a('0x2c')][_0x583a('0x38')]){_0x1bce73[_0x583a('0x36')]=_['merge'](_0x1bce73[_0x583a('0x36')],{'$or':_[_0x583a('0x27')](_0x1bce73[_0x583a('0x30')],function(_0x207a7e){var _0x286436={};_0x286436[_0x207a7e]={'$like':'%'+_0x3cd5a0[_0x583a('0x2c')][_0x583a('0x38')]+'%'};return _0x286436;})});}_0x1bce73=_[_0x583a('0x39')]({},_0x1bce73,_0x3cd5a0[_0x583a('0x46')]);return _0x7709f9['getConfigurations'](_0x1bce73);}})[_0x583a('0x21')](function(_0x57f9a8){if(_0x57f9a8){_0x19b715=_0x57f9a8['length'];if(!_0x3cd5a0[_0x583a('0x2c')][_0x583a('0x33')](_0x583a('0x34'))){_0x1bce73[_0x583a('0x1d')]=qs[_0x583a('0x1d')](_0x3cd5a0['query']['limit']);_0x1bce73['offset']=qs['offset'](_0x3cd5a0['query'][_0x583a('0x1a')]);}return _0x7709f9[_0x583a('0x47')](_0x1bce73);}})[_0x583a('0x21')](function(_0x53f341){if(_0x53f341){return _0x53f341?{'count':_0x19b715,'rows':_0x53f341}:null;}})[_0x583a('0x21')](respondWithResult(_0x15f2ce,null))['catch'](handleError(_0x15f2ce,null));};exports[_0x583a('0x48')]=function(_0x18880c,_0x33778d,_0x5cf12c){if(_0x18880c['body']['id']){delete _0x18880c['body']['id'];}return db[_0x583a('0x28')][_0x583a('0x49')]({'where':{'id':_0x18880c['params']['id']}})[_0x583a('0x21')](handleEntityNotFound(_0x33778d,null))[_0x583a('0x21')](function(_0x2ff800){if(_0x2ff800){_0x18880c['body'][_0x583a('0x4a')]=_0x2ff800['id'];_0x18880c[_0x583a('0x43')]['Subjects']=integrations[_0x583a('0x4b')](_0x18880c[_0x583a('0x43')][_0x583a('0x4c')],_0x18880c['body'][_0x583a('0x2a')]);_0x18880c[_0x583a('0x43')][_0x583a('0x4d')]=integrations[_0x583a('0x4e')](_0x18880c[_0x583a('0x43')][_0x583a('0x4c')],_0x18880c[_0x583a('0x43')][_0x583a('0x2a')]);return db[_0x583a('0x44')][_0x583a('0x42')](_0x18880c[_0x583a('0x43')],{'include':[{'model':db[_0x583a('0x4f')],'as':_0x583a('0x50')},{'model':db[_0x583a('0x4f')],'as':'Descriptions'}]});}return null;})[_0x583a('0x21')](respondWithResult(_0x33778d,null))[_0x583a('0x41')](handleError(_0x33778d,null));};exports[_0x583a('0x51')]=function(_0x31eac3,_0x3cd04a,_0x1c22a1){var _0x59e84e;var _0x5125e3='';var _0x263bfc=_0x583a('0x52');return db['SalesforceAccount']['findOne']({'where':{'id':_0x31eac3[_0x583a('0x3d')]['id']},'attributes':['id',_0x583a('0x53'),_0x583a('0x54'),_0x583a('0x55'),'username',_0x583a('0x56'),_0x583a('0x57')]})[_0x583a('0x21')](handleEntityNotFound(_0x3cd04a,null))[_0x583a('0x21')](function(_0x40abfc){if(_0x40abfc){_0x5125e3=_0x40abfc[_0x583a('0x53')];var _0x3956a3=_0x5125e3[_0x583a('0x58')](-0x1);if(_0x3956a3==='/'){_0x5125e3=_0x5125e3[_0x583a('0x59')](0x0,_0x5125e3[_0x583a('0x5a')](_0x3956a3));}_0x59e84e=new jsforce[(_0x583a('0x5b'))]({'oauth2':{'loginUrl':_0x5125e3,'clientId':_0x40abfc['clientId'],'clientSecret':_0x40abfc[_0x583a('0x55')]}});return _0x59e84e[_0x583a('0x5c')](_0x40abfc[_0x583a('0x5d')],_0x40abfc[_0x583a('0x56')][_0x583a('0x5e')](_0x40abfc[_0x583a('0x57')]));}})[_0x583a('0x21')](function(_0xe46d84){if(_0xe46d84){if(!_['isNil'](_0x31eac3['query']['ticketType'])){_0x263bfc=_0x31eac3['query'][_0x583a('0x5f')];}return _0x59e84e['sobject'](_0x263bfc)['describe']();}})['then'](function(_0x288a37){var _0x16e239=['OwnerId',_0x583a('0x60'),_0x583a('0x61'),_0x583a('0x62'),_0x583a('0x63'),_0x583a('0x64')];var _0x2c26b6=[_0x583a('0x65'),'int',_0x583a('0x66'),_0x583a('0x67'),'email','textarea','phone'];if(_0x288a37){_[_0x583a('0x68')](_0x288a37[_0x583a('0x31')],function(_0x2cdf58){return _0x16e239[_0x583a('0x69')](_0x2cdf58['name'])||!_0x2c26b6['includes'](_0x2cdf58[_0x583a('0x2a')]);});return{'count':_0x288a37[_0x583a('0x31')][_0x583a('0x32')],'rows':_[_0x583a('0x27')](_0x288a37[_0x583a('0x31')],function(_0x1d983c){return{'id':_0x1d983c[_0x583a('0x25')],'name':_0x1d983c[_0x583a('0x6a')],'custom':_0x1d983c[_0x583a('0x6b')],'options':_0x1d983c[_0x583a('0x6c')]['length']>0x0?_['map'](_0x1d983c[_0x583a('0x6c')],function(_0x3de90d){return{'name':_0x3de90d['label'],'value':_0x3de90d[_0x583a('0x6d')]};}):_0x1d983c[_0x583a('0x2a')]==_0x583a('0x67')?[{'name':_0x583a('0x6e'),'value':_0x583a('0x6f')},{'name':_0x583a('0x70'),'value':_0x583a('0x71')}]:[]};})};}})['then'](respondWithResult(_0x3cd04a,null))[_0x583a('0x41')](function(_0x143a2b){var _0x146dcc=_0x31eac3[_0x583a('0x2c')][_0x583a('0x72')]?0x1f4:_0x143a2b[_0x583a('0x73')]||0x1f4;logger['error'](_0x583a('0x74'),_0x583a('0x51'),_0x146dcc,JSON[_0x583a('0x75')](_0x143a2b));delete _0x143a2b['name'];if(_0x146dcc===0x191){_0x146dcc=0x190;}_0x3cd04a[_0x583a('0x17')](_0x146dcc)[_0x583a('0x26')](_0x31eac3[_0x583a('0x2c')][_0x583a('0x72')]?{'message':_0x583a('0x76'),'statusCode':_0x143a2b[_0x583a('0x73')]}:_0x143a2b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 67339db..c8cb854 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 _0x3738=['../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x5e8763,_0x558211){var _0x286b08=function(_0x4ceb40){while(--_0x4ceb40){_0x5e8763['push'](_0x5e8763['shift']());}};_0x286b08(++_0x558211);}(_0x3738,0x1e5));var _0x8373=function(_0x559b3e,_0x1f539a){_0x559b3e=_0x559b3e-0x0;var _0x4fdf3b=_0x3738[_0x559b3e];return _0x4fdf3b;};'use strict';var _=require('lodash');var util=require(_0x8373('0x0'));var logger=require(_0x8373('0x1'))(_0x8373('0x2'));var moment=require(_0x8373('0x3'));var BPromise=require(_0x8373('0x4'));var rp=require(_0x8373('0x5'));var fs=require('fs');var path=require(_0x8373('0x6'));var rimraf=require(_0x8373('0x7'));var config=require(_0x8373('0x8'));var attributes=require(_0x8373('0x9'));var integrations=require(_0x8373('0xa'));module[_0x8373('0xb')]=function(_0x5f3c70,_0x83d36){return _0x5f3c70[_0x8373('0xc')](_0x8373('0xd'),attributes,{'tableName':_0x8373('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3294=['request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','api','bluebird'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3294,0x1db));var _0x4329=function(_0x52793a,_0x42d243){_0x52793a=_0x52793a-0x0;var _0x2f2b98=_0x3294[_0x52793a];return _0x2f2b98;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4329('0x0'));var moment=require('moment');var BPromise=require(_0x4329('0x1'));var rp=require(_0x4329('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4329('0x3'));var config=require(_0x4329('0x4'));var attributes=require(_0x4329('0x5'));var integrations=require(_0x4329('0x6'));module['exports']=function(_0x54268f,_0x49e568){return _0x54268f[_0x4329('0x7')]('SalesforceAccount',attributes,{'tableName':_0x4329('0x8'),'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 98579de..e88d5c6 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 _0xf34b=['request\x20sent','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','model','map','attributes','ShowSalesforceAccount','find','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0xf34b,0xb1));var _0xbf34=function(_0x256e40,_0x7a0a5f){_0x256e40=_0x256e40-0x0;var _0x1ab26e=_0xf34b[_0x256e40];return _0x1ab26e;};'use strict';var _=require(_0xbf34('0x0'));var util=require(_0xbf34('0x1'));var moment=require(_0xbf34('0x2'));var BPromise=require(_0xbf34('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf34('0x4'));var db=require(_0xbf34('0x5'))['db'];var utils=require(_0xbf34('0x6'));var logger=require(_0xbf34('0x7'))(_0xbf34('0x8'));var config=require(_0xbf34('0x9'));var jayson=require(_0xbf34('0xa'));var client=jayson[_0xbf34('0xb')][_0xbf34('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a809f,_0x596c61,_0x41ba9b){return new BPromise(function(_0x2fd294,_0x386ad2){return client[_0xbf34('0xd')](_0x4a809f,_0x41ba9b)[_0xbf34('0xe')](function(_0x51a436){logger[_0xbf34('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x596c61,'request\x20sent');logger[_0xbf34('0x10')](_0xbf34('0x11'),_0x596c61,_0xbf34('0x12'),JSON[_0xbf34('0x13')](_0x51a436));if(_0x51a436[_0xbf34('0x14')]){if(_0x51a436[_0xbf34('0x14')][_0xbf34('0x15')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x596c61,_0x51a436[_0xbf34('0x14')][_0xbf34('0x16')]);return _0x386ad2(_0x51a436[_0xbf34('0x14')][_0xbf34('0x16')]);}logger[_0xbf34('0x14')](_0xbf34('0x17'),_0x596c61,_0x51a436[_0xbf34('0x14')][_0xbf34('0x16')]);return _0x2fd294(_0x51a436['error'][_0xbf34('0x16')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x596c61,_0xbf34('0x12'));_0x2fd294(_0x51a436[_0xbf34('0x18')]['message']);}})['catch'](function(_0x14eac9){logger[_0xbf34('0x14')](_0xbf34('0x17'),_0x596c61,_0x14eac9);_0x386ad2(_0x14eac9);});});}exports[_0xbf34('0x19')]=function(_0x70b706){var _0x5ef0c3=this;return new Promise(function(_0x1348ae,_0x1c5bed){return db[_0xbf34('0x1a')][_0xbf34('0x1b')]({'raw':_0x70b706['options']?_0x70b706[_0xbf34('0x1c')][_0xbf34('0x1d')]===undefined?!![]:![]:!![],'where':_0x70b706['options']?_0x70b706[_0xbf34('0x1c')][_0xbf34('0x1e')]||null:null,'attributes':_0x70b706[_0xbf34('0x1c')]?_0x70b706[_0xbf34('0x1c')]['attributes']||null:null,'limit':_0x70b706[_0xbf34('0x1c')]?_0x70b706[_0xbf34('0x1c')][_0xbf34('0x1f')]||null:null,'include':_0x70b706[_0xbf34('0x1c')]?_0x70b706['options'][_0xbf34('0x20')]?_['map'](_0x70b706[_0xbf34('0x1c')][_0xbf34('0x20')],function(_0x174f0f){return{'model':db[_0x174f0f[_0xbf34('0x21')]],'as':_0x174f0f['as'],'attributes':_0x174f0f['attributes'],'include':_0x174f0f[_0xbf34('0x20')]?_[_0xbf34('0x22')](_0x174f0f['include'],function(_0x4b0163){return{'model':db[_0x4b0163[_0xbf34('0x21')]],'as':_0x4b0163['as'],'attributes':_0x4b0163[_0xbf34('0x23')],'include':_0x4b0163[_0xbf34('0x20')]?_['map'](_0x4b0163['include'],function(_0x53009e){return{'model':db[_0x53009e[_0xbf34('0x21')]],'as':_0x53009e['as'],'attributes':_0x53009e[_0xbf34('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbf34('0xe')](function(_0x4a138f){logger[_0xbf34('0xf')]('GetSalesforceAccount',_0x70b706);logger[_0xbf34('0x10')](_0xbf34('0x19'),_0x70b706,JSON['stringify'](_0x4a138f));_0x1348ae(_0x4a138f);})['catch'](function(_0x18f339){logger['error'](_0xbf34('0x19'),_0x18f339[_0xbf34('0x16')],_0x70b706);_0x1c5bed(_0x5ef0c3[_0xbf34('0x14')](0x1f4,_0x18f339[_0xbf34('0x16')]));});});};exports[_0xbf34('0x24')]=function(_0x51174b){var _0x4f0428=this;return new Promise(function(_0x5f6e2e,_0x24c077){return db['SalesforceAccount'][_0xbf34('0x25')]({'raw':_0x51174b[_0xbf34('0x1c')]?_0x51174b['options'][_0xbf34('0x1d')]===undefined?!![]:![]:!![],'where':_0x51174b[_0xbf34('0x1c')]?_0x51174b['options'][_0xbf34('0x1e')]||null:null,'attributes':_0x51174b[_0xbf34('0x1c')]?_0x51174b[_0xbf34('0x1c')]['attributes']||null:null,'include':_0x51174b['options']?_0x51174b[_0xbf34('0x1c')][_0xbf34('0x20')]?_['map'](_0x51174b[_0xbf34('0x1c')][_0xbf34('0x20')],function(_0x4ba9e5){return{'model':db[_0x4ba9e5[_0xbf34('0x21')]],'as':_0x4ba9e5['as'],'attributes':_0x4ba9e5[_0xbf34('0x23')],'include':_0x4ba9e5[_0xbf34('0x20')]?_['map'](_0x4ba9e5[_0xbf34('0x20')],function(_0x1a65ea){return{'model':db[_0x1a65ea[_0xbf34('0x21')]],'as':_0x1a65ea['as'],'attributes':_0x1a65ea[_0xbf34('0x23')],'include':_0x1a65ea[_0xbf34('0x20')]?_[_0xbf34('0x22')](_0x1a65ea[_0xbf34('0x20')],function(_0x504008){return{'model':db[_0x504008[_0xbf34('0x21')]],'as':_0x504008['as'],'attributes':_0x504008[_0xbf34('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbf34('0xe')](function(_0x5297b9){logger[_0xbf34('0xf')](_0xbf34('0x24'),_0x51174b);logger[_0xbf34('0x10')](_0xbf34('0x24'),_0x51174b,JSON[_0xbf34('0x13')](_0x5297b9));_0x5f6e2e(_0x5297b9);})[_0xbf34('0x26')](function(_0x9d792d){logger[_0xbf34('0x14')]('ShowSalesforceAccount',_0x9d792d[_0xbf34('0x16')],_0x51174b);_0x24c077(_0x4f0428[_0xbf34('0x14')](0x1f4,_0x9d792d[_0xbf34('0x16')]));});});}; \ No newline at end of file +var _0x9655=['include','map','model','ShowSalesforceAccount','SalesforceAccount','find','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','findAll','options','where','attributes','limit'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x9655,0xe5));var _0x5965=function(_0x1a3df4,_0x10d3cf){_0x1a3df4=_0x1a3df4-0x0;var _0x52fe80=_0x9655[_0x1a3df4];return _0x52fe80;};'use strict';var _=require(_0x5965('0x0'));var util=require(_0x5965('0x1'));var moment=require(_0x5965('0x2'));var BPromise=require('bluebird');var rs=require(_0x5965('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5965('0x4'))['db'];var utils=require(_0x5965('0x5'));var logger=require('../../config/logger')(_0x5965('0x6'));var config=require(_0x5965('0x7'));var jayson=require(_0x5965('0x8'));var client=jayson[_0x5965('0x9')][_0x5965('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bb7d7,_0x4ea543,_0x3f6566){return new BPromise(function(_0x471737,_0x1f6385){return client[_0x5965('0xb')](_0x5bb7d7,_0x3f6566)[_0x5965('0xc')](function(_0x453185){logger[_0x5965('0xd')](_0x5965('0xe'),_0x4ea543,_0x5965('0xf'));logger[_0x5965('0x10')](_0x5965('0x11'),_0x4ea543,_0x5965('0xf'),JSON[_0x5965('0x12')](_0x453185));if(_0x453185[_0x5965('0x13')]){if(_0x453185[_0x5965('0x13')][_0x5965('0x14')]===0x1f4){logger['error'](_0x5965('0xe'),_0x4ea543,_0x453185['error'][_0x5965('0x15')]);return _0x1f6385(_0x453185[_0x5965('0x13')][_0x5965('0x15')]);}logger[_0x5965('0x13')](_0x5965('0xe'),_0x4ea543,_0x453185[_0x5965('0x13')][_0x5965('0x15')]);return _0x471737(_0x453185[_0x5965('0x13')][_0x5965('0x15')]);}else{logger[_0x5965('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4ea543,_0x5965('0xf'));_0x471737(_0x453185[_0x5965('0x16')][_0x5965('0x15')]);}})[_0x5965('0x17')](function(_0x319c25){logger[_0x5965('0x13')](_0x5965('0xe'),_0x4ea543,_0x319c25);_0x1f6385(_0x319c25);});});}exports[_0x5965('0x18')]=function(_0x33c277){var _0x5a2421=this;return new Promise(function(_0x51a5f7,_0x10e6f8){return db['SalesforceAccount'][_0x5965('0x19')]({'raw':_0x33c277[_0x5965('0x1a')]?_0x33c277['options']['raw']===undefined?!![]:![]:!![],'where':_0x33c277[_0x5965('0x1a')]?_0x33c277['options'][_0x5965('0x1b')]||null:null,'attributes':_0x33c277[_0x5965('0x1a')]?_0x33c277[_0x5965('0x1a')][_0x5965('0x1c')]||null:null,'limit':_0x33c277[_0x5965('0x1a')]?_0x33c277[_0x5965('0x1a')][_0x5965('0x1d')]||null:null,'include':_0x33c277['options']?_0x33c277[_0x5965('0x1a')][_0x5965('0x1e')]?_[_0x5965('0x1f')](_0x33c277[_0x5965('0x1a')]['include'],function(_0xb54ff5){return{'model':db[_0xb54ff5[_0x5965('0x20')]],'as':_0xb54ff5['as'],'attributes':_0xb54ff5[_0x5965('0x1c')],'include':_0xb54ff5[_0x5965('0x1e')]?_[_0x5965('0x1f')](_0xb54ff5[_0x5965('0x1e')],function(_0xe30d58){return{'model':db[_0xe30d58[_0x5965('0x20')]],'as':_0xe30d58['as'],'attributes':_0xe30d58['attributes'],'include':_0xe30d58[_0x5965('0x1e')]?_[_0x5965('0x1f')](_0xe30d58['include'],function(_0x1d9631){return{'model':db[_0x1d9631[_0x5965('0x20')]],'as':_0x1d9631['as'],'attributes':_0x1d9631[_0x5965('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1feaab){logger['info'](_0x5965('0x18'),_0x33c277);logger[_0x5965('0x10')](_0x5965('0x18'),_0x33c277,JSON[_0x5965('0x12')](_0x1feaab));_0x51a5f7(_0x1feaab);})[_0x5965('0x17')](function(_0x494769){logger[_0x5965('0x13')](_0x5965('0x18'),_0x494769[_0x5965('0x15')],_0x33c277);_0x10e6f8(_0x5a2421[_0x5965('0x13')](0x1f4,_0x494769['message']));});});};exports[_0x5965('0x21')]=function(_0x89bf19){var _0x407c2c=this;return new Promise(function(_0x26605a,_0x2ac33f){return db[_0x5965('0x22')][_0x5965('0x23')]({'raw':_0x89bf19[_0x5965('0x1a')]?_0x89bf19['options'][_0x5965('0x24')]===undefined?!![]:![]:!![],'where':_0x89bf19[_0x5965('0x1a')]?_0x89bf19['options'][_0x5965('0x1b')]||null:null,'attributes':_0x89bf19['options']?_0x89bf19[_0x5965('0x1a')]['attributes']||null:null,'include':_0x89bf19['options']?_0x89bf19[_0x5965('0x1a')][_0x5965('0x1e')]?_[_0x5965('0x1f')](_0x89bf19[_0x5965('0x1a')][_0x5965('0x1e')],function(_0x514169){return{'model':db[_0x514169[_0x5965('0x20')]],'as':_0x514169['as'],'attributes':_0x514169['attributes'],'include':_0x514169[_0x5965('0x1e')]?_['map'](_0x514169['include'],function(_0x38903a){return{'model':db[_0x38903a[_0x5965('0x20')]],'as':_0x38903a['as'],'attributes':_0x38903a[_0x5965('0x1c')],'include':_0x38903a['include']?_[_0x5965('0x1f')](_0x38903a['include'],function(_0x4bb6a3){return{'model':db[_0x4bb6a3[_0x5965('0x20')]],'as':_0x4bb6a3['as'],'attributes':_0x4bb6a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x5965('0xc')](function(_0x29484d){logger[_0x5965('0xd')](_0x5965('0x21'),_0x89bf19);logger[_0x5965('0x10')](_0x5965('0x21'),_0x89bf19,JSON[_0x5965('0x12')](_0x29484d));_0x26605a(_0x29484d);})[_0x5965('0x17')](function(_0x483164){logger[_0x5965('0x13')](_0x5965('0x21'),_0x483164[_0x5965('0x15')],_0x89bf19);_0x2ac33f(_0x407c2c[_0x5965('0x13')](0x1f4,_0x483164[_0x5965('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index a460524..c1909d7 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2af0d5,_0x1e2607){var _0x5a0bf7=function(_0x30356a){while(--_0x30356a){_0x2af0d5['push'](_0x2af0d5['shift']());}};_0x5a0bf7(++_0x1e2607);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x514e8b,_0x52e7a1){var _0x5a7d10=function(_0x2f2bcc){while(--_0x2f2bcc){_0x514e8b['push'](_0x514e8b['shift']());}};_0x5a7d10(++_0x52e7a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x537952,_0x28ce41){_0x537952=_0x537952-0x0;var _0x5879b7=_0x5f2f[_0x537952];return _0x5879b7;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 92eb0e4..b983bca 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 _0xbdd4=['Task','contact_lead','contact','lead','account','STRING','Case'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xbdd4[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4bdd('0x0')]},'description':{'type':Sequelize[_0x4bdd('0x0')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x4bdd('0x1')),'defaultValue':_0x4bdd('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x4bdd('0x3'),_0x4bdd('0x4'),_0x4bdd('0x5'),'account_contact_lead',_0x4bdd('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x4bdd('0x4'),'lead',_0x4bdd('0x6')),'defaultValue':_0x4bdd('0x5')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x4bdd('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x4bdd('0x0')]},'additionalSearchLead':{'type':Sequelize[_0x4bdd('0x0')]}}; \ No newline at end of file +var _0xe13b=['nothing','lead','STRING','ENUM','Case','Task','contact_lead','contact','account'];(function(_0x10b6be,_0x20d4fc){var _0x25dfc4=function(_0x224c9d){while(--_0x224c9d){_0x10b6be['push'](_0x10b6be['shift']());}};_0x25dfc4(++_0x20d4fc);}(_0xe13b,0xe3));var _0xbe13=function(_0x4dec24,_0x5c522b){_0x4dec24=_0x4dec24-0x0;var _0x493868=_0xe13b[_0x4dec24];return _0x493868;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbe13('0x0')]},'ticketType':{'type':Sequelize[_0xbe13('0x1')]('Task',_0xbe13('0x2')),'defaultValue':_0xbe13('0x3')},'moduleSearch':{'type':Sequelize[_0xbe13('0x1')](_0xbe13('0x4'),_0xbe13('0x5'),'lead','account_contact_lead',_0xbe13('0x6')),'defaultValue':_0xbe13('0x4')},'moduleCreate':{'type':Sequelize[_0xbe13('0x1')](_0xbe13('0x7'),_0xbe13('0x5'),'lead',_0xbe13('0x6')),'defaultValue':_0xbe13('0x8')},'leadId':{'type':Sequelize[_0xbe13('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xbe13('0x0')]},'additionalSearchContact':{'type':Sequelize[_0xbe13('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 01fbbca..ca71a16 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 _0xa166=['../../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','name','index','SalesforceConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','rawAttributes','length','create','body','find','params','getFields','findOne','SalesforceField','order','options','getSubjects','getDescriptions','eml-format','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x16cf22,_0x504218){var _0x113c09=function(_0x34df3f){while(--_0x34df3f){_0x16cf22['push'](_0x16cf22['shift']());}};_0x113c09(++_0x504218);}(_0xa166,0x1be));var _0x6a16=function(_0xc4b495,_0x4e0601){_0xc4b495=_0xc4b495-0x0;var _0x250baf=_0xa166[_0xc4b495];return _0x250baf;};'use strict';var emlformat=require(_0x6a16('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6a16('0x1'));var moment=require(_0x6a16('0x2'));var BPromise=require(_0x6a16('0x3'));var Mustache=require('mustache');var util=require(_0x6a16('0x4'));var path=require('path');var sox=require(_0x6a16('0x5'));var csv=require(_0x6a16('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a16('0x7'));var squel=require(_0x6a16('0x8'));var crypto=require(_0x6a16('0x9'));var jsforce=require(_0x6a16('0xa'));var deskjs=require(_0x6a16('0xb'));var toCsv=require(_0x6a16('0x6'));var querystring=require(_0x6a16('0xc'));var Papa=require('papaparse');var Redis=require(_0x6a16('0xd'));var authService=require(_0x6a16('0xe'));var qs=require(_0x6a16('0xf'));var as=require(_0x6a16('0x10'));var hardwareService=require(_0x6a16('0x11'));var logger=require(_0x6a16('0x12'))('api');var utils=require(_0x6a16('0x13'));var config=require(_0x6a16('0x14'));var licenseUtil=require(_0x6a16('0x15'));var db=require(_0x6a16('0x16'))['db'];function respondWithStatusCode(_0x1fc1e0,_0x4d55c2){_0x4d55c2=_0x4d55c2||0xcc;return function(_0x2a03ff){if(_0x2a03ff){return _0x1fc1e0['sendStatus'](_0x4d55c2);}return _0x1fc1e0[_0x6a16('0x17')](_0x4d55c2)[_0x6a16('0x18')]();};}function respondWithResult(_0x5c4888,_0x4829da){_0x4829da=_0x4829da||0xc8;return function(_0x38835f){if(_0x38835f){return _0x5c4888[_0x6a16('0x17')](_0x4829da)[_0x6a16('0x19')](_0x38835f);}};}function respondWithFilteredResult(_0x2195bf,_0x36a3ac){return function(_0x2d05a0){if(_0x2d05a0){var _0x530c32=typeof _0x36a3ac[_0x6a16('0x1a')]===_0x6a16('0x1b')&&typeof _0x36a3ac[_0x6a16('0x1c')]===_0x6a16('0x1b');var _0x244d01=_0x2d05a0[_0x6a16('0x1d')];var _0x3f36a7=_0x530c32?0x0:_0x36a3ac['offset'];var _0x4704fa=_0x530c32?_0x2d05a0['count']:_0x36a3ac[_0x6a16('0x1a')]+_0x36a3ac[_0x6a16('0x1c')];var _0x33f637;if(_0x4704fa>=_0x244d01){_0x4704fa=_0x244d01;_0x33f637=0xc8;}else{_0x33f637=0xce;}_0x2195bf['status'](_0x33f637);return _0x2195bf[_0x6a16('0x1e')](_0x6a16('0x1f'),_0x3f36a7+'-'+_0x4704fa+'/'+_0x244d01)['json'](_0x2d05a0);}return null;};}function patchUpdates(_0xe7d99f){return function(_0x5e0a5f){try{jsonpatch[_0x6a16('0x20')](_0x5e0a5f,_0xe7d99f,!![]);}catch(_0x2fcd9b){return BPromise[_0x6a16('0x21')](_0x2fcd9b);}return _0x5e0a5f[_0x6a16('0x22')]();};}function saveUpdates(_0x11e210,_0x8aa476){return function(_0x4b027d){if(_0x4b027d){return _0x4b027d[_0x6a16('0x23')](_0x11e210)[_0x6a16('0x24')](function(_0x2bf7ab){return _0x2bf7ab;});}return null;};}function removeEntity(_0x2d0d7e,_0x9cb29e){return function(_0x9fbd6f){if(_0x9fbd6f){return _0x9fbd6f[_0x6a16('0x25')]()['then'](function(){_0x2d0d7e[_0x6a16('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11dc41,_0x2a42b0){return function(_0x2c70c4){if(!_0x2c70c4){_0x11dc41['sendStatus'](0x194);}return _0x2c70c4;};}function handleError(_0xd6583e,_0x1ee5d1){_0x1ee5d1=_0x1ee5d1||0x1f4;return function(_0x2c9052){logger['error'](_0x2c9052['stack']);if(_0x2c9052['name']){delete _0x2c9052[_0x6a16('0x26')];}_0xd6583e['status'](_0x1ee5d1)['send'](_0x2c9052);};}exports[_0x6a16('0x27')]=function(_0x3e4b67,_0x5f564d){var _0x4a361e={},_0x4a4381={},_0x3e4411={'count':0x0,'rows':[]};var _0x40a0d9=_['map'](db[_0x6a16('0x28')]['rawAttributes'],function(_0x2f0eee){return{'name':_0x2f0eee[_0x6a16('0x29')],'type':_0x2f0eee[_0x6a16('0x2a')][_0x6a16('0x2b')]};});_0x4a4381[_0x6a16('0x2c')]=_[_0x6a16('0x2d')](_0x40a0d9,_0x6a16('0x26'));_0x4a4381[_0x6a16('0x2e')]=_[_0x6a16('0x2f')](_0x3e4b67[_0x6a16('0x2e')]);_0x4a4381[_0x6a16('0x30')]=_[_0x6a16('0x31')](_0x4a4381[_0x6a16('0x2c')],_0x4a4381[_0x6a16('0x2e')]);_0x4a361e['attributes']=_[_0x6a16('0x31')](_0x4a4381[_0x6a16('0x2c')],qs[_0x6a16('0x32')](_0x3e4b67[_0x6a16('0x2e')]['fields']));_0x4a361e[_0x6a16('0x33')]=_0x4a361e[_0x6a16('0x33')]['length']?_0x4a361e[_0x6a16('0x33')]:_0x4a4381[_0x6a16('0x2c')];if(!_0x3e4b67['query'][_0x6a16('0x34')](_0x6a16('0x35'))){_0x4a361e[_0x6a16('0x1c')]=qs[_0x6a16('0x1c')](_0x3e4b67['query']['limit']);_0x4a361e[_0x6a16('0x1a')]=qs[_0x6a16('0x1a')](_0x3e4b67['query']['offset']);}_0x4a361e['order']=qs[_0x6a16('0x36')](_0x3e4b67[_0x6a16('0x2e')]['sort']);_0x4a361e[_0x6a16('0x37')]=qs['filters'](_[_0x6a16('0x38')](_0x3e4b67[_0x6a16('0x2e')],_0x4a4381[_0x6a16('0x30')]),_0x40a0d9);if(_0x3e4b67[_0x6a16('0x2e')][_0x6a16('0x39')]){_0x4a361e['where']=_[_0x6a16('0x3a')](_0x4a361e['where'],{'$or':_[_0x6a16('0x2d')](_0x40a0d9,function(_0x29351c){if(_0x29351c['type']!=='VIRTUAL'){var _0x29961b={};_0x29961b[_0x29351c[_0x6a16('0x26')]]={'$like':'%'+_0x3e4b67[_0x6a16('0x2e')][_0x6a16('0x39')]+'%'};return _0x29961b;}})});}_0x4a361e=_[_0x6a16('0x3a')]({},_0x4a361e,_0x3e4b67['options']);var _0x3fdb7f={'where':_0x4a361e['where']};return db[_0x6a16('0x28')][_0x6a16('0x1d')](_0x3fdb7f)[_0x6a16('0x24')](function(_0x293a67){_0x3e4411[_0x6a16('0x1d')]=_0x293a67;if(_0x3e4b67['query'][_0x6a16('0x3b')]){_0x4a361e[_0x6a16('0x3c')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x6a16('0x3d')](_0x4a361e);})['then'](function(_0x301878){_0x3e4411['rows']=_0x301878;return _0x3e4411;})['then'](respondWithFilteredResult(_0x5f564d,_0x4a361e))[_0x6a16('0x3e')](handleError(_0x5f564d,null));};exports[_0x6a16('0x3f')]=function(_0x2258c6,_0x1d079b){var _0x85bab9={'raw':![],'where':{'id':_0x2258c6['params']['id']}},_0x5e020e={};_0x5e020e[_0x6a16('0x2c')]=_['keys'](db[_0x6a16('0x28')][_0x6a16('0x40')]);_0x5e020e[_0x6a16('0x2e')]=_[_0x6a16('0x2f')](_0x2258c6[_0x6a16('0x2e')]);_0x5e020e[_0x6a16('0x30')]=_['intersection'](_0x5e020e[_0x6a16('0x2c')],_0x5e020e[_0x6a16('0x2e')]);_0x85bab9[_0x6a16('0x33')]=_[_0x6a16('0x31')](_0x5e020e[_0x6a16('0x2c')],qs[_0x6a16('0x32')](_0x2258c6[_0x6a16('0x2e')][_0x6a16('0x32')]));_0x85bab9[_0x6a16('0x33')]=_0x85bab9['attributes'][_0x6a16('0x41')]?_0x85bab9[_0x6a16('0x33')]:_0x5e020e[_0x6a16('0x2c')];if(_0x2258c6['query'][_0x6a16('0x3b')]){_0x85bab9[_0x6a16('0x3c')]=[{'all':!![]}];}_0x85bab9=_[_0x6a16('0x3a')]({},_0x85bab9,_0x2258c6['options']);return db[_0x6a16('0x28')]['find'](_0x85bab9)['then'](handleEntityNotFound(_0x1d079b,null))['then'](respondWithResult(_0x1d079b,null))['catch'](handleError(_0x1d079b,null));};exports[_0x6a16('0x42')]=function(_0x396091,_0x417f78){return db['SalesforceConfiguration'][_0x6a16('0x42')](_0x396091['body'],{})[_0x6a16('0x24')](respondWithResult(_0x417f78,0xc9))[_0x6a16('0x3e')](handleError(_0x417f78,null));};exports[_0x6a16('0x23')]=function(_0x5b08cc,_0x4a80a2){if(_0x5b08cc[_0x6a16('0x43')]['id']){delete _0x5b08cc['body']['id'];}return db[_0x6a16('0x28')][_0x6a16('0x44')]({'where':{'id':_0x5b08cc[_0x6a16('0x45')]['id']}})[_0x6a16('0x24')](handleEntityNotFound(_0x4a80a2,null))[_0x6a16('0x24')](saveUpdates(_0x5b08cc[_0x6a16('0x43')],null))[_0x6a16('0x24')](respondWithResult(_0x4a80a2,null))[_0x6a16('0x3e')](handleError(_0x4a80a2,null));};exports[_0x6a16('0x25')]=function(_0x4d74ec,_0x37fc06){return db[_0x6a16('0x28')]['find']({'where':{'id':_0x4d74ec[_0x6a16('0x45')]['id']}})[_0x6a16('0x24')](handleEntityNotFound(_0x37fc06,null))[_0x6a16('0x24')](removeEntity(_0x37fc06,null))[_0x6a16('0x3e')](handleError(_0x37fc06,null));};exports[_0x6a16('0x46')]=function(_0x39e253,_0x58eeda,_0x4137f4){var _0x44fcf6={};var _0x5144c9={};var _0x5d5fbc;var _0x211986;return db['SalesforceConfiguration'][_0x6a16('0x47')]({'where':{'id':_0x39e253[_0x6a16('0x45')]['id']}})[_0x6a16('0x24')](handleEntityNotFound(_0x58eeda,null))[_0x6a16('0x24')](function(_0x3527d8){if(_0x3527d8){_0x5d5fbc=_0x3527d8;_0x5144c9[_0x6a16('0x2c')]=_['keys'](db[_0x6a16('0x48')]['rawAttributes']);_0x5144c9['query']=_[_0x6a16('0x2f')](_0x39e253[_0x6a16('0x2e')]);_0x5144c9[_0x6a16('0x30')]=_[_0x6a16('0x31')](_0x5144c9[_0x6a16('0x2c')],_0x5144c9[_0x6a16('0x2e')]);_0x44fcf6[_0x6a16('0x33')]=_[_0x6a16('0x31')](_0x5144c9[_0x6a16('0x2c')],qs['fields'](_0x39e253['query'][_0x6a16('0x32')]));_0x44fcf6[_0x6a16('0x33')]=_0x44fcf6['attributes']['length']?_0x44fcf6['attributes']:_0x5144c9[_0x6a16('0x2c')];_0x44fcf6[_0x6a16('0x49')]=qs[_0x6a16('0x36')](_0x39e253[_0x6a16('0x2e')][_0x6a16('0x36')]);_0x44fcf6[_0x6a16('0x37')]=qs[_0x6a16('0x30')](_[_0x6a16('0x38')](_0x39e253[_0x6a16('0x2e')],_0x5144c9[_0x6a16('0x30')]));if(_0x39e253[_0x6a16('0x2e')][_0x6a16('0x39')]){_0x44fcf6['where']=_[_0x6a16('0x3a')](_0x44fcf6['where'],{'$or':_[_0x6a16('0x2d')](_0x44fcf6[_0x6a16('0x33')],function(_0x1c6412){var _0x3c921={};_0x3c921[_0x1c6412]={'$like':'%'+_0x39e253[_0x6a16('0x2e')][_0x6a16('0x39')]+'%'};return _0x3c921;})});}_0x44fcf6=_[_0x6a16('0x3a')]({},_0x44fcf6,_0x39e253[_0x6a16('0x4a')]);return _0x5d5fbc[_0x6a16('0x46')](_0x44fcf6);}})['then'](function(_0x53aeda){if(_0x53aeda){_0x211986=_0x53aeda[_0x6a16('0x41')];if(!_0x39e253['query']['hasOwnProperty'](_0x6a16('0x35'))){_0x44fcf6['limit']=qs[_0x6a16('0x1c')](_0x39e253[_0x6a16('0x2e')][_0x6a16('0x1c')]);_0x44fcf6[_0x6a16('0x1a')]=qs[_0x6a16('0x1a')](_0x39e253[_0x6a16('0x2e')]['offset']);}return _0x5d5fbc[_0x6a16('0x46')](_0x44fcf6);}})[_0x6a16('0x24')](function(_0x5c3fd4){if(_0x5c3fd4){return _0x5c3fd4?{'count':_0x211986,'rows':_0x5c3fd4}:null;}})[_0x6a16('0x24')](respondWithResult(_0x58eeda,null))['catch'](handleError(_0x58eeda,null));};exports['getSubjects']=function(_0x2a9124,_0x11ba18,_0x4f0b3b){var _0x1d3922={};var _0x21feb9={};var _0x4f332b;var _0xf193ba;return db[_0x6a16('0x28')][_0x6a16('0x47')]({'where':{'id':_0x2a9124[_0x6a16('0x45')]['id']}})[_0x6a16('0x24')](handleEntityNotFound(_0x11ba18,null))[_0x6a16('0x24')](function(_0x3ce777){if(_0x3ce777){_0x4f332b=_0x3ce777;_0x21feb9[_0x6a16('0x2c')]=_[_0x6a16('0x2f')](db[_0x6a16('0x48')]['rawAttributes']);_0x21feb9[_0x6a16('0x2e')]=_[_0x6a16('0x2f')](_0x2a9124[_0x6a16('0x2e')]);_0x21feb9[_0x6a16('0x30')]=_[_0x6a16('0x31')](_0x21feb9[_0x6a16('0x2c')],_0x21feb9[_0x6a16('0x2e')]);_0x1d3922[_0x6a16('0x33')]=_['intersection'](_0x21feb9[_0x6a16('0x2c')],qs[_0x6a16('0x32')](_0x2a9124[_0x6a16('0x2e')][_0x6a16('0x32')]));_0x1d3922[_0x6a16('0x33')]=_0x1d3922[_0x6a16('0x33')][_0x6a16('0x41')]?_0x1d3922['attributes']:_0x21feb9[_0x6a16('0x2c')];_0x1d3922['order']=qs[_0x6a16('0x36')](_0x2a9124['query']['sort']);_0x1d3922[_0x6a16('0x37')]=qs['filters'](_['pick'](_0x2a9124[_0x6a16('0x2e')],_0x21feb9['filters']));if(_0x2a9124[_0x6a16('0x2e')][_0x6a16('0x39')]){_0x1d3922['where']=_[_0x6a16('0x3a')](_0x1d3922[_0x6a16('0x37')],{'$or':_['map'](_0x1d3922[_0x6a16('0x33')],function(_0x506c9a){var _0x29120c={};_0x29120c[_0x506c9a]={'$like':'%'+_0x2a9124[_0x6a16('0x2e')]['filter']+'%'};return _0x29120c;})});}_0x1d3922=_['merge']({},_0x1d3922,_0x2a9124[_0x6a16('0x4a')]);return _0x4f332b[_0x6a16('0x4b')](_0x1d3922);}})[_0x6a16('0x24')](function(_0x36222f){if(_0x36222f){_0xf193ba=_0x36222f[_0x6a16('0x41')];if(!_0x2a9124[_0x6a16('0x2e')][_0x6a16('0x34')](_0x6a16('0x35'))){_0x1d3922[_0x6a16('0x1c')]=qs[_0x6a16('0x1c')](_0x2a9124[_0x6a16('0x2e')]['limit']);_0x1d3922['offset']=qs[_0x6a16('0x1a')](_0x2a9124['query'][_0x6a16('0x1a')]);}return _0x4f332b[_0x6a16('0x4b')](_0x1d3922);}})[_0x6a16('0x24')](function(_0x492c69){if(_0x492c69){return _0x492c69?{'count':_0xf193ba,'rows':_0x492c69}:null;}})[_0x6a16('0x24')](respondWithResult(_0x11ba18,null))['catch'](handleError(_0x11ba18,null));};exports[_0x6a16('0x4c')]=function(_0x39447b,_0x35c8f2,_0x23771c){var _0x178fad={};var _0x868e3e={};var _0x8f7438;var _0xce263b;return db[_0x6a16('0x28')][_0x6a16('0x47')]({'where':{'id':_0x39447b[_0x6a16('0x45')]['id']}})[_0x6a16('0x24')](handleEntityNotFound(_0x35c8f2,null))['then'](function(_0x150959){if(_0x150959){_0x8f7438=_0x150959;_0x868e3e[_0x6a16('0x2c')]=_[_0x6a16('0x2f')](db['SalesforceField'][_0x6a16('0x40')]);_0x868e3e[_0x6a16('0x2e')]=_['keys'](_0x39447b['query']);_0x868e3e[_0x6a16('0x30')]=_[_0x6a16('0x31')](_0x868e3e['model'],_0x868e3e[_0x6a16('0x2e')]);_0x178fad[_0x6a16('0x33')]=_[_0x6a16('0x31')](_0x868e3e[_0x6a16('0x2c')],qs[_0x6a16('0x32')](_0x39447b['query'][_0x6a16('0x32')]));_0x178fad[_0x6a16('0x33')]=_0x178fad[_0x6a16('0x33')][_0x6a16('0x41')]?_0x178fad['attributes']:_0x868e3e[_0x6a16('0x2c')];_0x178fad[_0x6a16('0x49')]=qs[_0x6a16('0x36')](_0x39447b['query'][_0x6a16('0x36')]);_0x178fad['where']=qs[_0x6a16('0x30')](_[_0x6a16('0x38')](_0x39447b[_0x6a16('0x2e')],_0x868e3e['filters']));if(_0x39447b[_0x6a16('0x2e')]['filter']){_0x178fad[_0x6a16('0x37')]=_['merge'](_0x178fad[_0x6a16('0x37')],{'$or':_[_0x6a16('0x2d')](_0x178fad[_0x6a16('0x33')],function(_0x57e6f5){var _0x51f2af={};_0x51f2af[_0x57e6f5]={'$like':'%'+_0x39447b['query'][_0x6a16('0x39')]+'%'};return _0x51f2af;})});}_0x178fad=_[_0x6a16('0x3a')]({},_0x178fad,_0x39447b['options']);return _0x8f7438[_0x6a16('0x4c')](_0x178fad);}})[_0x6a16('0x24')](function(_0x37f5b3){if(_0x37f5b3){_0xce263b=_0x37f5b3[_0x6a16('0x41')];if(!_0x39447b[_0x6a16('0x2e')][_0x6a16('0x34')](_0x6a16('0x35'))){_0x178fad['limit']=qs[_0x6a16('0x1c')](_0x39447b[_0x6a16('0x2e')][_0x6a16('0x1c')]);_0x178fad[_0x6a16('0x1a')]=qs[_0x6a16('0x1a')](_0x39447b[_0x6a16('0x2e')][_0x6a16('0x1a')]);}return _0x8f7438[_0x6a16('0x4c')](_0x178fad);}})[_0x6a16('0x24')](function(_0x26ff78){if(_0x26ff78){return _0x26ff78?{'count':_0xce263b,'rows':_0x26ff78}:null;}})[_0x6a16('0x24')](respondWithResult(_0x35c8f2,null))[_0x6a16('0x3e')](handleError(_0x35c8f2,null));}; \ No newline at end of file +var _0xffde=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','then','destroy','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','options','SalesforceConfiguration','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','SalesforceField','filter','getSubjects','pick','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xffde,0x9f));var _0xeffd=function(_0x19caeb,_0x5c6f81){_0x19caeb=_0x19caeb-0x0;var _0x56f1f5=_0xffde[_0x19caeb];return _0x56f1f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeffd('0x0'));var zipdir=require(_0xeffd('0x1'));var jsonpatch=require(_0xeffd('0x2'));var rp=require(_0xeffd('0x3'));var moment=require(_0xeffd('0x4'));var BPromise=require(_0xeffd('0x5'));var Mustache=require(_0xeffd('0x6'));var util=require(_0xeffd('0x7'));var path=require('path');var sox=require(_0xeffd('0x8'));var csv=require(_0xeffd('0x9'));var ejs=require(_0xeffd('0xa'));var fs=require('fs');var fs_extra=require(_0xeffd('0xb'));var _=require(_0xeffd('0xc'));var squel=require(_0xeffd('0xd'));var crypto=require('crypto');var jsforce=require(_0xeffd('0xe'));var deskjs=require(_0xeffd('0xf'));var toCsv=require(_0xeffd('0x9'));var querystring=require(_0xeffd('0x10'));var Papa=require(_0xeffd('0x11'));var Redis=require(_0xeffd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xeffd('0x13'));var as=require(_0xeffd('0x14'));var hardwareService=require(_0xeffd('0x15'));var logger=require(_0xeffd('0x16'))(_0xeffd('0x17'));var utils=require(_0xeffd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xeffd('0x19'));var db=require(_0xeffd('0x1a'))['db'];function respondWithStatusCode(_0x13f59a,_0x4945d4){_0x4945d4=_0x4945d4||0xcc;return function(_0x4c0a87){if(_0x4c0a87){return _0x13f59a[_0xeffd('0x1b')](_0x4945d4);}return _0x13f59a['status'](_0x4945d4)[_0xeffd('0x1c')]();};}function respondWithResult(_0x2b53aa,_0x1651a1){_0x1651a1=_0x1651a1||0xc8;return function(_0x346de3){if(_0x346de3){return _0x2b53aa[_0xeffd('0x1d')](_0x1651a1)[_0xeffd('0x1e')](_0x346de3);}};}function respondWithFilteredResult(_0x2f45ba,_0x41f77d){return function(_0x40d2c1){if(_0x40d2c1){var _0x3943b8=typeof _0x41f77d[_0xeffd('0x1f')]==='undefined'&&typeof _0x41f77d[_0xeffd('0x20')]===_0xeffd('0x21');var _0x4bbbe0=_0x40d2c1[_0xeffd('0x22')];var _0x1fd60f=_0x3943b8?0x0:_0x41f77d[_0xeffd('0x1f')];var _0x4625b5=_0x3943b8?_0x40d2c1[_0xeffd('0x22')]:_0x41f77d[_0xeffd('0x1f')]+_0x41f77d[_0xeffd('0x20')];var _0x10e3f7;if(_0x4625b5>=_0x4bbbe0){_0x4625b5=_0x4bbbe0;_0x10e3f7=0xc8;}else{_0x10e3f7=0xce;}_0x2f45ba[_0xeffd('0x1d')](_0x10e3f7);return _0x2f45ba[_0xeffd('0x23')](_0xeffd('0x24'),_0x1fd60f+'-'+_0x4625b5+'/'+_0x4bbbe0)[_0xeffd('0x1e')](_0x40d2c1);}return null;};}function patchUpdates(_0x67efa4){return function(_0x58dc3e){try{jsonpatch[_0xeffd('0x25')](_0x58dc3e,_0x67efa4,!![]);}catch(_0x1f000e){return BPromise['reject'](_0x1f000e);}return _0x58dc3e['save']();};}function saveUpdates(_0x5bbea2,_0x489b0b){return function(_0x47a701){if(_0x47a701){return _0x47a701['update'](_0x5bbea2)[_0xeffd('0x26')](function(_0x4631dd){return _0x4631dd;});}return null;};}function removeEntity(_0x2d053b,_0x2028a1){return function(_0x3b921f){if(_0x3b921f){return _0x3b921f[_0xeffd('0x27')]()[_0xeffd('0x26')](function(){_0x2d053b[_0xeffd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f38a1,_0x25aaa5){return function(_0xf6dd45){if(!_0xf6dd45){_0x3f38a1[_0xeffd('0x1b')](0x194);}return _0xf6dd45;};}function handleError(_0x4b9577,_0x2058d8){_0x2058d8=_0x2058d8||0x1f4;return function(_0x32ad8b){logger[_0xeffd('0x28')](_0x32ad8b['stack']);if(_0x32ad8b['name']){delete _0x32ad8b[_0xeffd('0x29')];}_0x4b9577[_0xeffd('0x1d')](_0x2058d8)[_0xeffd('0x2a')](_0x32ad8b);};}exports[_0xeffd('0x2b')]=function(_0x5b7084,_0x96bc03){var _0x5375e8={},_0x1de88e={},_0x4bd735={'count':0x0,'rows':[]};var _0x1b076e=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x100dc1){return{'name':_0x100dc1[_0xeffd('0x2c')],'type':_0x100dc1[_0xeffd('0x2d')][_0xeffd('0x2e')]};});_0x1de88e[_0xeffd('0x2f')]=_[_0xeffd('0x30')](_0x1b076e,_0xeffd('0x29'));_0x1de88e[_0xeffd('0x31')]=_[_0xeffd('0x32')](_0x5b7084[_0xeffd('0x31')]);_0x1de88e[_0xeffd('0x33')]=_[_0xeffd('0x34')](_0x1de88e['model'],_0x1de88e[_0xeffd('0x31')]);_0x5375e8['attributes']=_['intersection'](_0x1de88e[_0xeffd('0x2f')],qs['fields'](_0x5b7084[_0xeffd('0x31')][_0xeffd('0x35')]));_0x5375e8['attributes']=_0x5375e8[_0xeffd('0x36')][_0xeffd('0x37')]?_0x5375e8[_0xeffd('0x36')]:_0x1de88e[_0xeffd('0x2f')];if(!_0x5b7084[_0xeffd('0x31')][_0xeffd('0x38')](_0xeffd('0x39'))){_0x5375e8[_0xeffd('0x20')]=qs['limit'](_0x5b7084['query'][_0xeffd('0x20')]);_0x5375e8['offset']=qs[_0xeffd('0x1f')](_0x5b7084[_0xeffd('0x31')][_0xeffd('0x1f')]);}_0x5375e8[_0xeffd('0x3a')]=qs[_0xeffd('0x3b')](_0x5b7084[_0xeffd('0x31')][_0xeffd('0x3b')]);_0x5375e8[_0xeffd('0x3c')]=qs[_0xeffd('0x33')](_['pick'](_0x5b7084[_0xeffd('0x31')],_0x1de88e[_0xeffd('0x33')]),_0x1b076e);if(_0x5b7084['query']['filter']){_0x5375e8[_0xeffd('0x3c')]=_[_0xeffd('0x3d')](_0x5375e8['where'],{'$or':_['map'](_0x1b076e,function(_0x3237b8){if(_0x3237b8[_0xeffd('0x2d')]!=='VIRTUAL'){var _0xc374d5={};_0xc374d5[_0x3237b8[_0xeffd('0x29')]]={'$like':'%'+_0x5b7084['query']['filter']+'%'};return _0xc374d5;}})});}_0x5375e8=_[_0xeffd('0x3d')]({},_0x5375e8,_0x5b7084[_0xeffd('0x3e')]);var _0x397ea4={'where':_0x5375e8[_0xeffd('0x3c')]};return db[_0xeffd('0x3f')][_0xeffd('0x22')](_0x397ea4)[_0xeffd('0x26')](function(_0x9ce788){_0x4bd735[_0xeffd('0x22')]=_0x9ce788;if(_0x5b7084['query']['includeAll']){_0x5375e8[_0xeffd('0x40')]=[{'all':!![]}];}return db[_0xeffd('0x3f')][_0xeffd('0x41')](_0x5375e8);})[_0xeffd('0x26')](function(_0x3c6dba){_0x4bd735[_0xeffd('0x42')]=_0x3c6dba;return _0x4bd735;})[_0xeffd('0x26')](respondWithFilteredResult(_0x96bc03,_0x5375e8))[_0xeffd('0x43')](handleError(_0x96bc03,null));};exports[_0xeffd('0x44')]=function(_0x1c4641,_0xf649f){var _0x45cec8={'raw':![],'where':{'id':_0x1c4641[_0xeffd('0x45')]['id']}},_0x15ea62={};_0x15ea62[_0xeffd('0x2f')]=_[_0xeffd('0x32')](db[_0xeffd('0x3f')][_0xeffd('0x46')]);_0x15ea62[_0xeffd('0x31')]=_['keys'](_0x1c4641[_0xeffd('0x31')]);_0x15ea62['filters']=_[_0xeffd('0x34')](_0x15ea62[_0xeffd('0x2f')],_0x15ea62[_0xeffd('0x31')]);_0x45cec8[_0xeffd('0x36')]=_[_0xeffd('0x34')](_0x15ea62[_0xeffd('0x2f')],qs[_0xeffd('0x35')](_0x1c4641[_0xeffd('0x31')]['fields']));_0x45cec8[_0xeffd('0x36')]=_0x45cec8[_0xeffd('0x36')][_0xeffd('0x37')]?_0x45cec8[_0xeffd('0x36')]:_0x15ea62[_0xeffd('0x2f')];if(_0x1c4641[_0xeffd('0x31')][_0xeffd('0x47')]){_0x45cec8[_0xeffd('0x40')]=[{'all':!![]}];}_0x45cec8=_[_0xeffd('0x3d')]({},_0x45cec8,_0x1c4641['options']);return db[_0xeffd('0x3f')][_0xeffd('0x48')](_0x45cec8)[_0xeffd('0x26')](handleEntityNotFound(_0xf649f,null))['then'](respondWithResult(_0xf649f,null))['catch'](handleError(_0xf649f,null));};exports['create']=function(_0x531f62,_0x47dee0){return db[_0xeffd('0x3f')][_0xeffd('0x49')](_0x531f62['body'],{})['then'](respondWithResult(_0x47dee0,0xc9))[_0xeffd('0x43')](handleError(_0x47dee0,null));};exports['update']=function(_0x57dd3f,_0x185d6b){if(_0x57dd3f[_0xeffd('0x4a')]['id']){delete _0x57dd3f[_0xeffd('0x4a')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x57dd3f[_0xeffd('0x45')]['id']}})['then'](handleEntityNotFound(_0x185d6b,null))['then'](saveUpdates(_0x57dd3f['body'],null))[_0xeffd('0x26')](respondWithResult(_0x185d6b,null))[_0xeffd('0x43')](handleError(_0x185d6b,null));};exports[_0xeffd('0x27')]=function(_0x377d29,_0xd09ff2){return db[_0xeffd('0x3f')][_0xeffd('0x48')]({'where':{'id':_0x377d29['params']['id']}})['then'](handleEntityNotFound(_0xd09ff2,null))[_0xeffd('0x26')](removeEntity(_0xd09ff2,null))[_0xeffd('0x43')](handleError(_0xd09ff2,null));};exports[_0xeffd('0x4b')]=function(_0x5d0647,_0x51ab0b,_0x5852bf){var _0x17744b={};var _0x1b78b0={};var _0x4c3a48;var _0x1b193d;return db['SalesforceConfiguration'][_0xeffd('0x4c')]({'where':{'id':_0x5d0647[_0xeffd('0x45')]['id']}})['then'](handleEntityNotFound(_0x51ab0b,null))[_0xeffd('0x26')](function(_0x4b0fca){if(_0x4b0fca){_0x4c3a48=_0x4b0fca;_0x1b78b0['model']=_['keys'](db[_0xeffd('0x4d')][_0xeffd('0x46')]);_0x1b78b0[_0xeffd('0x31')]=_[_0xeffd('0x32')](_0x5d0647[_0xeffd('0x31')]);_0x1b78b0[_0xeffd('0x33')]=_[_0xeffd('0x34')](_0x1b78b0[_0xeffd('0x2f')],_0x1b78b0[_0xeffd('0x31')]);_0x17744b[_0xeffd('0x36')]=_[_0xeffd('0x34')](_0x1b78b0[_0xeffd('0x2f')],qs[_0xeffd('0x35')](_0x5d0647['query'][_0xeffd('0x35')]));_0x17744b[_0xeffd('0x36')]=_0x17744b[_0xeffd('0x36')][_0xeffd('0x37')]?_0x17744b[_0xeffd('0x36')]:_0x1b78b0['model'];_0x17744b['order']=qs['sort'](_0x5d0647[_0xeffd('0x31')]['sort']);_0x17744b[_0xeffd('0x3c')]=qs[_0xeffd('0x33')](_['pick'](_0x5d0647[_0xeffd('0x31')],_0x1b78b0['filters']));if(_0x5d0647[_0xeffd('0x31')]['filter']){_0x17744b[_0xeffd('0x3c')]=_[_0xeffd('0x3d')](_0x17744b[_0xeffd('0x3c')],{'$or':_[_0xeffd('0x30')](_0x17744b['attributes'],function(_0x504edb){var _0xf25a39={};_0xf25a39[_0x504edb]={'$like':'%'+_0x5d0647[_0xeffd('0x31')][_0xeffd('0x4e')]+'%'};return _0xf25a39;})});}_0x17744b=_[_0xeffd('0x3d')]({},_0x17744b,_0x5d0647[_0xeffd('0x3e')]);return _0x4c3a48['getFields'](_0x17744b);}})[_0xeffd('0x26')](function(_0x185012){if(_0x185012){_0x1b193d=_0x185012[_0xeffd('0x37')];if(!_0x5d0647[_0xeffd('0x31')][_0xeffd('0x38')]('nolimit')){_0x17744b[_0xeffd('0x20')]=qs[_0xeffd('0x20')](_0x5d0647[_0xeffd('0x31')]['limit']);_0x17744b[_0xeffd('0x1f')]=qs['offset'](_0x5d0647[_0xeffd('0x31')][_0xeffd('0x1f')]);}return _0x4c3a48[_0xeffd('0x4b')](_0x17744b);}})[_0xeffd('0x26')](function(_0x5bd9e6){if(_0x5bd9e6){return _0x5bd9e6?{'count':_0x1b193d,'rows':_0x5bd9e6}:null;}})['then'](respondWithResult(_0x51ab0b,null))[_0xeffd('0x43')](handleError(_0x51ab0b,null));};exports[_0xeffd('0x4f')]=function(_0x55bbf4,_0x1ea122,_0x953ef1){var _0x17fe8e={};var _0x1705c9={};var _0x518d66;var _0x94a46e;return db[_0xeffd('0x3f')][_0xeffd('0x4c')]({'where':{'id':_0x55bbf4[_0xeffd('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ea122,null))['then'](function(_0x15f352){if(_0x15f352){_0x518d66=_0x15f352;_0x1705c9['model']=_[_0xeffd('0x32')](db[_0xeffd('0x4d')]['rawAttributes']);_0x1705c9[_0xeffd('0x31')]=_['keys'](_0x55bbf4[_0xeffd('0x31')]);_0x1705c9['filters']=_['intersection'](_0x1705c9['model'],_0x1705c9[_0xeffd('0x31')]);_0x17fe8e[_0xeffd('0x36')]=_[_0xeffd('0x34')](_0x1705c9[_0xeffd('0x2f')],qs[_0xeffd('0x35')](_0x55bbf4[_0xeffd('0x31')][_0xeffd('0x35')]));_0x17fe8e['attributes']=_0x17fe8e[_0xeffd('0x36')][_0xeffd('0x37')]?_0x17fe8e[_0xeffd('0x36')]:_0x1705c9[_0xeffd('0x2f')];_0x17fe8e[_0xeffd('0x3a')]=qs[_0xeffd('0x3b')](_0x55bbf4[_0xeffd('0x31')][_0xeffd('0x3b')]);_0x17fe8e[_0xeffd('0x3c')]=qs['filters'](_[_0xeffd('0x50')](_0x55bbf4[_0xeffd('0x31')],_0x1705c9[_0xeffd('0x33')]));if(_0x55bbf4['query']['filter']){_0x17fe8e[_0xeffd('0x3c')]=_['merge'](_0x17fe8e[_0xeffd('0x3c')],{'$or':_[_0xeffd('0x30')](_0x17fe8e[_0xeffd('0x36')],function(_0x16ee5e){var _0x2ade93={};_0x2ade93[_0x16ee5e]={'$like':'%'+_0x55bbf4['query'][_0xeffd('0x4e')]+'%'};return _0x2ade93;})});}_0x17fe8e=_[_0xeffd('0x3d')]({},_0x17fe8e,_0x55bbf4[_0xeffd('0x3e')]);return _0x518d66[_0xeffd('0x4f')](_0x17fe8e);}})[_0xeffd('0x26')](function(_0x3c638f){if(_0x3c638f){_0x94a46e=_0x3c638f['length'];if(!_0x55bbf4[_0xeffd('0x31')][_0xeffd('0x38')](_0xeffd('0x39'))){_0x17fe8e[_0xeffd('0x20')]=qs['limit'](_0x55bbf4[_0xeffd('0x31')][_0xeffd('0x20')]);_0x17fe8e[_0xeffd('0x1f')]=qs[_0xeffd('0x1f')](_0x55bbf4['query']['offset']);}return _0x518d66[_0xeffd('0x4f')](_0x17fe8e);}})['then'](function(_0x1ff7e2){if(_0x1ff7e2){return _0x1ff7e2?{'count':_0x94a46e,'rows':_0x1ff7e2}:null;}})[_0xeffd('0x26')](respondWithResult(_0x1ea122,null))[_0xeffd('0x43')](handleError(_0x1ea122,null));};exports[_0xeffd('0x51')]=function(_0x25c7cf,_0x47ae13,_0x5b8196){var _0x15becb={};var _0x5be21f={};var _0x35a88e;var _0x488874;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x25c7cf[_0xeffd('0x45')]['id']}})[_0xeffd('0x26')](handleEntityNotFound(_0x47ae13,null))[_0xeffd('0x26')](function(_0x1e6ec0){if(_0x1e6ec0){_0x35a88e=_0x1e6ec0;_0x5be21f['model']=_[_0xeffd('0x32')](db[_0xeffd('0x4d')][_0xeffd('0x46')]);_0x5be21f[_0xeffd('0x31')]=_[_0xeffd('0x32')](_0x25c7cf[_0xeffd('0x31')]);_0x5be21f[_0xeffd('0x33')]=_[_0xeffd('0x34')](_0x5be21f['model'],_0x5be21f[_0xeffd('0x31')]);_0x15becb['attributes']=_[_0xeffd('0x34')](_0x5be21f['model'],qs[_0xeffd('0x35')](_0x25c7cf[_0xeffd('0x31')][_0xeffd('0x35')]));_0x15becb[_0xeffd('0x36')]=_0x15becb['attributes']['length']?_0x15becb[_0xeffd('0x36')]:_0x5be21f[_0xeffd('0x2f')];_0x15becb[_0xeffd('0x3a')]=qs['sort'](_0x25c7cf[_0xeffd('0x31')][_0xeffd('0x3b')]);_0x15becb[_0xeffd('0x3c')]=qs[_0xeffd('0x33')](_[_0xeffd('0x50')](_0x25c7cf['query'],_0x5be21f[_0xeffd('0x33')]));if(_0x25c7cf[_0xeffd('0x31')][_0xeffd('0x4e')]){_0x15becb['where']=_['merge'](_0x15becb[_0xeffd('0x3c')],{'$or':_[_0xeffd('0x30')](_0x15becb['attributes'],function(_0x536e83){var _0x259df4={};_0x259df4[_0x536e83]={'$like':'%'+_0x25c7cf['query']['filter']+'%'};return _0x259df4;})});}_0x15becb=_['merge']({},_0x15becb,_0x25c7cf[_0xeffd('0x3e')]);return _0x35a88e[_0xeffd('0x51')](_0x15becb);}})['then'](function(_0x8d8597){if(_0x8d8597){_0x488874=_0x8d8597['length'];if(!_0x25c7cf['query'][_0xeffd('0x38')]('nolimit')){_0x15becb[_0xeffd('0x20')]=qs['limit'](_0x25c7cf['query'][_0xeffd('0x20')]);_0x15becb['offset']=qs['offset'](_0x25c7cf[_0xeffd('0x31')]['offset']);}return _0x35a88e['getDescriptions'](_0x15becb);}})[_0xeffd('0x26')](function(_0x3dfb15){if(_0x3dfb15){return _0x3dfb15?{'count':_0x488874,'rows':_0x3dfb15}:null;}})[_0xeffd('0x26')](respondWithResult(_0x47ae13,null))[_0xeffd('0x43')](handleError(_0x47ae13,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index f4bde5f..0592166 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 _0xf90e=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5182ac,_0x475e2a){var _0x1298a8=function(_0x515341){while(--_0x515341){_0x5182ac['push'](_0x5182ac['shift']());}};_0x1298a8(++_0x475e2a);}(_0xf90e,0x6b));var _0xef90=function(_0x35a250,_0x105b14){_0x35a250=_0x35a250-0x0;var _0x4b7e19=_0xf90e[_0x35a250];return _0x4b7e19;};'use strict';var _=require(_0xef90('0x0'));var util=require(_0xef90('0x1'));var logger=require('../../config/logger')(_0xef90('0x2'));var moment=require(_0xef90('0x3'));var BPromise=require(_0xef90('0x4'));var rp=require(_0xef90('0x5'));var fs=require('fs');var path=require(_0xef90('0x6'));var rimraf=require(_0xef90('0x7'));var config=require(_0xef90('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xef90('0x9')]=function(_0x94ba33,_0x106ed1){return _0x94ba33[_0xef90('0xa')](_0xef90('0xb'),attributes,{'tableName':_0xef90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x342b=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x355e2b,_0x1e99eb){var _0x2b59bb=function(_0x14f698){while(--_0x14f698){_0x355e2b['push'](_0x355e2b['shift']());}};_0x2b59bb(++_0x1e99eb);}(_0x342b,0x108));var _0xb342=function(_0x1713dd,_0x28b8c5){_0x1713dd=_0x1713dd-0x0;var _0x3f1b8d=_0x342b[_0x1713dd];return _0x3f1b8d;};'use strict';var _=require('lodash');var util=require(_0xb342('0x0'));var logger=require(_0xb342('0x1'))(_0xb342('0x2'));var moment=require(_0xb342('0x3'));var BPromise=require('bluebird');var rp=require(_0xb342('0x4'));var fs=require('fs');var path=require(_0xb342('0x5'));var rimraf=require(_0xb342('0x6'));var config=require('../../config/environment');var attributes=require(_0xb342('0x7'));module[_0xb342('0x8')]=function(_0x6edc7f,_0x4624ac){return _0x6edc7f['define'](_0xb342('0x9'),attributes,{'tableName':_0xb342('0xa'),'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 0fd8cd9..41a3f7c 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 _0x6eca=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x170a9f,_0x5ecb4a){var _0x9be5af=function(_0x28c2d6){while(--_0x28c2d6){_0x170a9f['push'](_0x170a9f['shift']());}};_0x9be5af(++_0x5ecb4a);}(_0x6eca,0x15f));var _0xa6ec=function(_0x35a158,_0x1ceb7f){_0x35a158=_0x35a158-0x0;var _0x13970c=_0x6eca[_0x35a158];return _0x13970c;};'use strict';var _=require(_0xa6ec('0x0'));var util=require(_0xa6ec('0x1'));var moment=require(_0xa6ec('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6ec('0x4'))['db'];var utils=require(_0xa6ec('0x5'));var logger=require(_0xa6ec('0x6'))(_0xa6ec('0x7'));var config=require(_0xa6ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa6ec('0x9')][_0xa6ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22a156,_0x27d122,_0x2cbfc0){return new BPromise(function(_0x79dab4,_0x5d15af){return client[_0xa6ec('0xb')](_0x22a156,_0x2cbfc0)[_0xa6ec('0xc')](function(_0x17b0e4){logger[_0xa6ec('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x27d122,_0xa6ec('0xe'));logger['debug'](_0xa6ec('0xf'),_0x27d122,'request\x20sent',JSON[_0xa6ec('0x10')](_0x17b0e4));if(_0x17b0e4[_0xa6ec('0x11')]){if(_0x17b0e4[_0xa6ec('0x11')][_0xa6ec('0x12')]===0x1f4){logger['error'](_0xa6ec('0x13'),_0x27d122,_0x17b0e4[_0xa6ec('0x11')][_0xa6ec('0x14')]);return _0x5d15af(_0x17b0e4['error']['message']);}logger[_0xa6ec('0x11')](_0xa6ec('0x13'),_0x27d122,_0x17b0e4[_0xa6ec('0x11')][_0xa6ec('0x14')]);return _0x79dab4(_0x17b0e4[_0xa6ec('0x11')]['message']);}else{logger[_0xa6ec('0xd')](_0xa6ec('0x13'),_0x27d122,_0xa6ec('0xe'));_0x79dab4(_0x17b0e4['result'][_0xa6ec('0x14')]);}})['catch'](function(_0x45ccd5){logger[_0xa6ec('0x11')](_0xa6ec('0x13'),_0x27d122,_0x45ccd5);_0x5d15af(_0x45ccd5);});});} \ No newline at end of file +var _0x2b64=['debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x4f8fe4,_0x20a13c){var _0x256e90=function(_0x504f8a){while(--_0x504f8a){_0x4f8fe4['push'](_0x4f8fe4['shift']());}};_0x256e90(++_0x20a13c);}(_0x2b64,0x1ea));var _0x42b6=function(_0x260dba,_0x2765f6){_0x260dba=_0x260dba-0x0;var _0x58fec0=_0x2b64[_0x260dba];return _0x58fec0;};'use strict';var _=require(_0x42b6('0x0'));var util=require(_0x42b6('0x1'));var moment=require(_0x42b6('0x2'));var BPromise=require(_0x42b6('0x3'));var rs=require(_0x42b6('0x4'));var fs=require('fs');var Redis=require(_0x42b6('0x5'));var db=require(_0x42b6('0x6'))['db'];var utils=require(_0x42b6('0x7'));var logger=require(_0x42b6('0x8'))('rpc');var config=require(_0x42b6('0x9'));var jayson=require(_0x42b6('0xa'));var client=jayson['client'][_0x42b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x251825,_0x274c54,_0x2f63c6){return new BPromise(function(_0x3c0653,_0x20aac2){return client[_0x42b6('0xc')](_0x251825,_0x2f63c6)[_0x42b6('0xd')](function(_0x116006){logger[_0x42b6('0xe')](_0x42b6('0xf'),_0x274c54,'request\x20sent');logger[_0x42b6('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x274c54,'request\x20sent',JSON['stringify'](_0x116006));if(_0x116006[_0x42b6('0x11')]){if(_0x116006['error'][_0x42b6('0x12')]===0x1f4){logger[_0x42b6('0x11')](_0x42b6('0xf'),_0x274c54,_0x116006['error'][_0x42b6('0x13')]);return _0x20aac2(_0x116006[_0x42b6('0x11')][_0x42b6('0x13')]);}logger[_0x42b6('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x274c54,_0x116006['error'][_0x42b6('0x13')]);return _0x3c0653(_0x116006[_0x42b6('0x11')][_0x42b6('0x13')]);}else{logger[_0x42b6('0xe')](_0x42b6('0xf'),_0x274c54,'request\x20sent');_0x3c0653(_0x116006[_0x42b6('0x14')][_0x42b6('0x13')]);}})[_0x42b6('0x15')](function(_0x3af2ad){logger[_0x42b6('0x11')](_0x42b6('0xf'),_0x274c54,_0x3af2ad);_0x20aac2(_0x3af2ad);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5fef495..9aa8c00 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 _0x42d8=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0x23ca0b,_0x2c9a47){var _0x235eb6=function(_0xf0979b){while(--_0xf0979b){_0x23ca0b['push'](_0x23ca0b['shift']());}};_0x235eb6(++_0x2c9a47);}(_0x42d8,0x90));var _0x842d=function(_0x13d153,_0x3edda1){_0x13d153=_0x13d153-0x0;var _0x508a08=_0x42d8[_0x13d153];return _0x508a08;};'use strict';var multer=require(_0x842d('0x0'));var util=require('util');var path=require(_0x842d('0x1'));var timeout=require(_0x842d('0x2'));var express=require(_0x842d('0x3'));var router=express[_0x842d('0x4')]();var fs_extra=require(_0x842d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x842d('0x6'));var config=require(_0x842d('0x7'));var controller=require(_0x842d('0x8'));router[_0x842d('0x9')]('/',auth['isAuthenticated'](),controller[_0x842d('0xa')]);router['get'](_0x842d('0xb'),auth[_0x842d('0xc')](),controller['show']);router[_0x842d('0xd')]('/',auth[_0x842d('0xc')](),controller[_0x842d('0xe')]);router[_0x842d('0xf')](_0x842d('0xb'),auth[_0x842d('0xc')](),controller[_0x842d('0x10')]);router[_0x842d('0x11')](_0x842d('0xb'),auth[_0x842d('0xc')](),controller[_0x842d('0x12')]);module[_0x842d('0x13')]=router; \ No newline at end of file +var _0xd00b=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x4ec270,_0x3e1ef1){var _0x2efea7=function(_0xf2f3e){while(--_0xf2f3e){_0x4ec270['push'](_0x4ec270['shift']());}};_0x2efea7(++_0x3e1ef1);}(_0xd00b,0xe8));var _0xbd00=function(_0x1859d6,_0x245331){_0x1859d6=_0x1859d6-0x0;var _0x26dc11=_0xd00b[_0x1859d6];return _0x26dc11;};'use strict';var multer=require(_0xbd00('0x0'));var util=require(_0xbd00('0x1'));var path=require(_0xbd00('0x2'));var timeout=require(_0xbd00('0x3'));var express=require(_0xbd00('0x4'));var router=express[_0xbd00('0x5')]();var fs_extra=require(_0xbd00('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbd00('0x7'));var config=require('../../config/environment');var controller=require(_0xbd00('0x8'));router[_0xbd00('0x9')]('/',auth[_0xbd00('0xa')](),controller[_0xbd00('0xb')]);router['get']('/:id',auth[_0xbd00('0xa')](),controller['show']);router['post']('/',auth[_0xbd00('0xa')](),controller[_0xbd00('0xc')]);router[_0xbd00('0xd')](_0xbd00('0xe'),auth[_0xbd00('0xa')](),controller[_0xbd00('0xf')]);router['delete'](_0xbd00('0xe'),auth[_0xbd00('0xa')](),controller[_0xbd00('0x10')]);module[_0xbd00('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 9fcca7d..b76f3c1 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 _0xa21e=['customVariable','sequelize','exports','ENUM','string','variable','picklist','STRING'];(function(_0x220ab5,_0x43781d){var _0x2dba13=function(_0x1875a2){while(--_0x1875a2){_0x220ab5['push'](_0x220ab5['shift']());}};_0x2dba13(++_0x43781d);}(_0xa21e,0x69));var _0xea21=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xa21e[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require(_0xea21('0x0'));module[_0xea21('0x1')]={'type':{'type':Sequelize[_0xea21('0x2')](_0xea21('0x3'),_0xea21('0x4'),'customVariable','keyValue',_0xea21('0x5')),'defaultValue':_0xea21('0x3')},'content':{'type':Sequelize[_0xea21('0x6')]},'key':{'type':Sequelize[_0xea21('0x6')]},'keyType':{'type':Sequelize[_0xea21('0x2')](_0xea21('0x3'),_0xea21('0x4'),_0xea21('0x7'))},'keyContent':{'type':Sequelize[_0xea21('0x6')]},'idField':{'type':Sequelize[_0xea21('0x6')]},'variableName':{'type':Sequelize[_0xea21('0x6')]}}; \ No newline at end of file +var _0x2c69=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0xe38e0c,_0x5884ea){var _0x2c6987=function(_0x335bea){while(--_0x335bea){_0xe38e0c['push'](_0xe38e0c['shift']());}};_0x2c6987(++_0x5884ea);}(_0x2c69,0x102));var _0x92c6=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x2c69[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x92c6('0x0'));module[_0x92c6('0x1')]={'type':{'type':Sequelize[_0x92c6('0x2')](_0x92c6('0x3'),_0x92c6('0x4'),_0x92c6('0x5'),_0x92c6('0x6'),_0x92c6('0x7')),'defaultValue':_0x92c6('0x3')},'content':{'type':Sequelize[_0x92c6('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x92c6('0x2')](_0x92c6('0x3'),_0x92c6('0x4'),_0x92c6('0x5'))},'keyContent':{'type':Sequelize[_0x92c6('0x8')]},'idField':{'type':Sequelize[_0x92c6('0x8')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 01254f1..a1258e1 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 _0x9999=['sox','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','length','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x1cc753,_0x4bef3d){var _0x4fa891=function(_0x303ada){while(--_0x303ada){_0x1cc753['push'](_0x1cc753['shift']());}};_0x4fa891(++_0x4bef3d);}(_0x9999,0x15d));var _0x9999=function(_0x270277,_0x17ef83){_0x270277=_0x270277-0x0;var _0x4d104b=_0x9999[_0x270277];return _0x4d104b;};'use strict';var emlformat=require(_0x9999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9999('0x1'));var jsonpatch=require(_0x9999('0x2'));var rp=require(_0x9999('0x3'));var moment=require(_0x9999('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9999('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9999('0x6'));var csv=require('to-csv');var ejs=require(_0x9999('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9999('0x8'));var crypto=require('crypto');var jsforce=require(_0x9999('0x9'));var deskjs=require(_0x9999('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9999('0xb'));var Papa=require('papaparse');var Redis=require(_0x9999('0xc'));var authService=require(_0x9999('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9999('0xe'));var hardwareService=require(_0x9999('0xf'));var logger=require(_0x9999('0x10'))('api');var utils=require(_0x9999('0x11'));var config=require(_0x9999('0x12'));var licenseUtil=require(_0x9999('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44254d,_0x494474){_0x494474=_0x494474||0xcc;return function(_0x84c374){if(_0x84c374){return _0x44254d['sendStatus'](_0x494474);}return _0x44254d[_0x9999('0x14')](_0x494474)[_0x9999('0x15')]();};}function respondWithResult(_0x3fb0aa,_0x2ee69f){_0x2ee69f=_0x2ee69f||0xc8;return function(_0x3aa329){if(_0x3aa329){return _0x3fb0aa[_0x9999('0x14')](_0x2ee69f)[_0x9999('0x16')](_0x3aa329);}};}function respondWithFilteredResult(_0x3f06f2,_0x44a124){return function(_0x5db695){if(_0x5db695){var _0x4097ad=typeof _0x44a124[_0x9999('0x17')]===_0x9999('0x18')&&typeof _0x44a124[_0x9999('0x19')]===_0x9999('0x18');var _0x5b2f49=_0x5db695[_0x9999('0x1a')];var _0x597c2a=_0x4097ad?0x0:_0x44a124[_0x9999('0x17')];var _0x22d232=_0x4097ad?_0x5db695[_0x9999('0x1a')]:_0x44a124['offset']+_0x44a124[_0x9999('0x19')];var _0x3ac944;if(_0x22d232>=_0x5b2f49){_0x22d232=_0x5b2f49;_0x3ac944=0xc8;}else{_0x3ac944=0xce;}_0x3f06f2[_0x9999('0x14')](_0x3ac944);return _0x3f06f2[_0x9999('0x1b')](_0x9999('0x1c'),_0x597c2a+'-'+_0x22d232+'/'+_0x5b2f49)[_0x9999('0x16')](_0x5db695);}return null;};}function patchUpdates(_0x1369e9){return function(_0xc53db5){try{jsonpatch[_0x9999('0x1d')](_0xc53db5,_0x1369e9,!![]);}catch(_0x578963){return BPromise[_0x9999('0x1e')](_0x578963);}return _0xc53db5['save']();};}function saveUpdates(_0x4d2963,_0x29b0dc){return function(_0x3fbeaa){if(_0x3fbeaa){return _0x3fbeaa['update'](_0x4d2963)[_0x9999('0x1f')](function(_0x23a939){return _0x23a939;});}return null;};}function removeEntity(_0x4a1f40,_0x54946b){return function(_0x3c1401){if(_0x3c1401){return _0x3c1401[_0x9999('0x20')]()['then'](function(){_0x4a1f40[_0x9999('0x14')](0xcc)[_0x9999('0x15')]();});}};}function handleEntityNotFound(_0x57e81d,_0xa93e44){return function(_0x3cadfe){if(!_0x3cadfe){_0x57e81d[_0x9999('0x21')](0x194);}return _0x3cadfe;};}function handleError(_0xd8c8d0,_0x24d908){_0x24d908=_0x24d908||0x1f4;return function(_0x26b5d4){logger[_0x9999('0x22')](_0x26b5d4[_0x9999('0x23')]);if(_0x26b5d4[_0x9999('0x24')]){delete _0x26b5d4['name'];}_0xd8c8d0[_0x9999('0x14')](_0x24d908)[_0x9999('0x25')](_0x26b5d4);};}exports['index']=function(_0x34eb2c,_0x3dd73b){var _0x1de02f={},_0x598fb6={},_0x482c4d={'count':0x0,'rows':[]};var _0x5c8527=_[_0x9999('0x26')](db[_0x9999('0x27')][_0x9999('0x28')],function(_0x2ee698){return{'name':_0x2ee698[_0x9999('0x29')],'type':_0x2ee698[_0x9999('0x2a')][_0x9999('0x2b')]};});_0x598fb6[_0x9999('0x2c')]=_['map'](_0x5c8527,_0x9999('0x24'));_0x598fb6[_0x9999('0x2d')]=_[_0x9999('0x2e')](_0x34eb2c['query']);_0x598fb6['filters']=_[_0x9999('0x2f')](_0x598fb6[_0x9999('0x2c')],_0x598fb6['query']);_0x1de02f['attributes']=_[_0x9999('0x2f')](_0x598fb6[_0x9999('0x2c')],qs['fields'](_0x34eb2c[_0x9999('0x2d')][_0x9999('0x30')]));_0x1de02f[_0x9999('0x31')]=_0x1de02f[_0x9999('0x31')]['length']?_0x1de02f['attributes']:_0x598fb6[_0x9999('0x2c')];if(!_0x34eb2c[_0x9999('0x2d')][_0x9999('0x32')](_0x9999('0x33'))){_0x1de02f[_0x9999('0x19')]=qs['limit'](_0x34eb2c['query'][_0x9999('0x19')]);_0x1de02f[_0x9999('0x17')]=qs['offset'](_0x34eb2c[_0x9999('0x2d')][_0x9999('0x17')]);}_0x1de02f[_0x9999('0x34')]=qs[_0x9999('0x35')](_0x34eb2c[_0x9999('0x2d')][_0x9999('0x35')]);_0x1de02f[_0x9999('0x36')]=qs[_0x9999('0x37')](_[_0x9999('0x38')](_0x34eb2c[_0x9999('0x2d')],_0x598fb6[_0x9999('0x37')]),_0x5c8527);if(_0x34eb2c[_0x9999('0x2d')]['filter']){_0x1de02f[_0x9999('0x36')]=_[_0x9999('0x39')](_0x1de02f[_0x9999('0x36')],{'$or':_[_0x9999('0x26')](_0x5c8527,function(_0x58699e){if(_0x58699e['type']!==_0x9999('0x3a')){var _0x326a3e={};_0x326a3e[_0x58699e[_0x9999('0x24')]]={'$like':'%'+_0x34eb2c[_0x9999('0x2d')][_0x9999('0x3b')]+'%'};return _0x326a3e;}})});}_0x1de02f=_[_0x9999('0x39')]({},_0x1de02f,_0x34eb2c[_0x9999('0x3c')]);var _0x4ef451={'where':_0x1de02f[_0x9999('0x36')]};return db[_0x9999('0x27')][_0x9999('0x1a')](_0x4ef451)['then'](function(_0x26a28b){_0x482c4d[_0x9999('0x1a')]=_0x26a28b;if(_0x34eb2c['query'][_0x9999('0x3d')]){_0x1de02f[_0x9999('0x3e')]=[{'all':!![]}];}return db[_0x9999('0x27')]['findAll'](_0x1de02f);})[_0x9999('0x1f')](function(_0xf11890){_0x482c4d[_0x9999('0x3f')]=_0xf11890;return _0x482c4d;})[_0x9999('0x1f')](respondWithFilteredResult(_0x3dd73b,_0x1de02f))['catch'](handleError(_0x3dd73b,null));};exports[_0x9999('0x40')]=function(_0x5e3170,_0x54c5e0){var _0x4ea894={'raw':!![],'where':{'id':_0x5e3170[_0x9999('0x41')]['id']}},_0xf310f={};_0xf310f['model']=_[_0x9999('0x2e')](db['SalesforceField'][_0x9999('0x28')]);_0xf310f[_0x9999('0x2d')]=_[_0x9999('0x2e')](_0x5e3170[_0x9999('0x2d')]);_0xf310f[_0x9999('0x37')]=_[_0x9999('0x2f')](_0xf310f[_0x9999('0x2c')],_0xf310f['query']);_0x4ea894[_0x9999('0x31')]=_['intersection'](_0xf310f[_0x9999('0x2c')],qs[_0x9999('0x30')](_0x5e3170['query']['fields']));_0x4ea894[_0x9999('0x31')]=_0x4ea894[_0x9999('0x31')][_0x9999('0x42')]?_0x4ea894[_0x9999('0x31')]:_0xf310f[_0x9999('0x2c')];if(_0x5e3170[_0x9999('0x2d')][_0x9999('0x3d')]){_0x4ea894[_0x9999('0x3e')]=[{'all':!![]}];}_0x4ea894=_['merge']({},_0x4ea894,_0x5e3170[_0x9999('0x3c')]);return db[_0x9999('0x27')][_0x9999('0x43')](_0x4ea894)[_0x9999('0x1f')](handleEntityNotFound(_0x54c5e0,null))[_0x9999('0x1f')](respondWithResult(_0x54c5e0,null))['catch'](handleError(_0x54c5e0,null));};exports[_0x9999('0x44')]=function(_0x2638a5,_0x1e3b3a){return db[_0x9999('0x27')][_0x9999('0x44')](_0x2638a5[_0x9999('0x45')],{})[_0x9999('0x1f')](respondWithResult(_0x1e3b3a,0xc9))[_0x9999('0x46')](handleError(_0x1e3b3a,null));};exports['update']=function(_0x4678f8,_0x59225c){if(_0x4678f8[_0x9999('0x45')]['id']){delete _0x4678f8[_0x9999('0x45')]['id'];}return db[_0x9999('0x27')]['find']({'where':{'id':_0x4678f8[_0x9999('0x41')]['id']}})[_0x9999('0x1f')](handleEntityNotFound(_0x59225c,null))['then'](saveUpdates(_0x4678f8['body'],null))[_0x9999('0x1f')](respondWithResult(_0x59225c,null))[_0x9999('0x46')](handleError(_0x59225c,null));};exports['destroy']=function(_0x4664c8,_0x1bdcbe){return db['SalesforceField'][_0x9999('0x43')]({'where':{'id':_0x4664c8['params']['id']}})[_0x9999('0x1f')](handleEntityNotFound(_0x1bdcbe,null))[_0x9999('0x1f')](removeEntity(_0x1bdcbe,null))[_0x9999('0x46')](handleError(_0x1bdcbe,null));}; \ No newline at end of file +var _0x9e6b=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','catch','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x19544d,_0x4ee1a3){var _0x2e42c3=function(_0x2d485b){while(--_0x2d485b){_0x19544d['push'](_0x19544d['shift']());}};_0x2e42c3(++_0x4ee1a3);}(_0x9e6b,0xb8));var _0xb9e6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9e6b[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9e6('0x0'));var zipdir=require(_0xb9e6('0x1'));var jsonpatch=require(_0xb9e6('0x2'));var rp=require(_0xb9e6('0x3'));var moment=require(_0xb9e6('0x4'));var BPromise=require(_0xb9e6('0x5'));var Mustache=require(_0xb9e6('0x6'));var util=require(_0xb9e6('0x7'));var path=require('path');var sox=require(_0xb9e6('0x8'));var csv=require('to-csv');var ejs=require(_0xb9e6('0x9'));var fs=require('fs');var fs_extra=require(_0xb9e6('0xa'));var _=require(_0xb9e6('0xb'));var squel=require(_0xb9e6('0xc'));var crypto=require(_0xb9e6('0xd'));var jsforce=require(_0xb9e6('0xe'));var deskjs=require(_0xb9e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb9e6('0x10'));var Papa=require('papaparse');var Redis=require(_0xb9e6('0x11'));var authService=require(_0xb9e6('0x12'));var qs=require(_0xb9e6('0x13'));var as=require(_0xb9e6('0x14'));var hardwareService=require(_0xb9e6('0x15'));var logger=require(_0xb9e6('0x16'))(_0xb9e6('0x17'));var utils=require(_0xb9e6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb9e6('0x19'));var db=require(_0xb9e6('0x1a'))['db'];function respondWithStatusCode(_0x3615e8,_0xbd1238){_0xbd1238=_0xbd1238||0xcc;return function(_0x4033e0){if(_0x4033e0){return _0x3615e8[_0xb9e6('0x1b')](_0xbd1238);}return _0x3615e8[_0xb9e6('0x1c')](_0xbd1238)[_0xb9e6('0x1d')]();};}function respondWithResult(_0x127f8e,_0x52cbc4){_0x52cbc4=_0x52cbc4||0xc8;return function(_0x621c32){if(_0x621c32){return _0x127f8e['status'](_0x52cbc4)[_0xb9e6('0x1e')](_0x621c32);}};}function respondWithFilteredResult(_0x308ad3,_0x476e20){return function(_0x377a44){if(_0x377a44){var _0x677b8c=typeof _0x476e20[_0xb9e6('0x1f')]==='undefined'&&typeof _0x476e20[_0xb9e6('0x20')]===_0xb9e6('0x21');var _0x43eef5=_0x377a44[_0xb9e6('0x22')];var _0xa93682=_0x677b8c?0x0:_0x476e20[_0xb9e6('0x1f')];var _0x206215=_0x677b8c?_0x377a44[_0xb9e6('0x22')]:_0x476e20[_0xb9e6('0x1f')]+_0x476e20[_0xb9e6('0x20')];var _0x2605a1;if(_0x206215>=_0x43eef5){_0x206215=_0x43eef5;_0x2605a1=0xc8;}else{_0x2605a1=0xce;}_0x308ad3[_0xb9e6('0x1c')](_0x2605a1);return _0x308ad3[_0xb9e6('0x23')]('Content-Range',_0xa93682+'-'+_0x206215+'/'+_0x43eef5)[_0xb9e6('0x1e')](_0x377a44);}return null;};}function patchUpdates(_0x40bcf4){return function(_0x13c92b){try{jsonpatch[_0xb9e6('0x24')](_0x13c92b,_0x40bcf4,!![]);}catch(_0x511b12){return BPromise[_0xb9e6('0x25')](_0x511b12);}return _0x13c92b[_0xb9e6('0x26')]();};}function saveUpdates(_0x24eda0,_0x4d4bf5){return function(_0x155f35){if(_0x155f35){return _0x155f35[_0xb9e6('0x27')](_0x24eda0)[_0xb9e6('0x28')](function(_0x3f7cbf){return _0x3f7cbf;});}return null;};}function removeEntity(_0xc3d1dc,_0x54532a){return function(_0x315fca){if(_0x315fca){return _0x315fca['destroy']()[_0xb9e6('0x28')](function(){_0xc3d1dc[_0xb9e6('0x1c')](0xcc)[_0xb9e6('0x1d')]();});}};}function handleEntityNotFound(_0x27ff61,_0x5ad8bf){return function(_0x5e2d68){if(!_0x5e2d68){_0x27ff61['sendStatus'](0x194);}return _0x5e2d68;};}function handleError(_0x29aaa7,_0x5473a3){_0x5473a3=_0x5473a3||0x1f4;return function(_0x11857a){logger[_0xb9e6('0x29')](_0x11857a[_0xb9e6('0x2a')]);if(_0x11857a[_0xb9e6('0x2b')]){delete _0x11857a[_0xb9e6('0x2b')];}_0x29aaa7['status'](_0x5473a3)[_0xb9e6('0x2c')](_0x11857a);};}exports[_0xb9e6('0x2d')]=function(_0x45db1a,_0x35fdb9){var _0x110e5f={},_0x2f6b08={},_0x1dbd27={'count':0x0,'rows':[]};var _0x512648=_[_0xb9e6('0x2e')](db[_0xb9e6('0x2f')][_0xb9e6('0x30')],function(_0x57b761){return{'name':_0x57b761[_0xb9e6('0x31')],'type':_0x57b761[_0xb9e6('0x32')]['key']};});_0x2f6b08[_0xb9e6('0x33')]=_[_0xb9e6('0x2e')](_0x512648,_0xb9e6('0x2b'));_0x2f6b08[_0xb9e6('0x34')]=_[_0xb9e6('0x35')](_0x45db1a[_0xb9e6('0x34')]);_0x2f6b08[_0xb9e6('0x36')]=_[_0xb9e6('0x37')](_0x2f6b08[_0xb9e6('0x33')],_0x2f6b08[_0xb9e6('0x34')]);_0x110e5f[_0xb9e6('0x38')]=_[_0xb9e6('0x37')](_0x2f6b08[_0xb9e6('0x33')],qs['fields'](_0x45db1a[_0xb9e6('0x34')][_0xb9e6('0x39')]));_0x110e5f[_0xb9e6('0x38')]=_0x110e5f[_0xb9e6('0x38')]['length']?_0x110e5f[_0xb9e6('0x38')]:_0x2f6b08[_0xb9e6('0x33')];if(!_0x45db1a['query'][_0xb9e6('0x3a')](_0xb9e6('0x3b'))){_0x110e5f[_0xb9e6('0x20')]=qs[_0xb9e6('0x20')](_0x45db1a[_0xb9e6('0x34')][_0xb9e6('0x20')]);_0x110e5f[_0xb9e6('0x1f')]=qs[_0xb9e6('0x1f')](_0x45db1a[_0xb9e6('0x34')][_0xb9e6('0x1f')]);}_0x110e5f[_0xb9e6('0x3c')]=qs['sort'](_0x45db1a[_0xb9e6('0x34')][_0xb9e6('0x3d')]);_0x110e5f[_0xb9e6('0x3e')]=qs[_0xb9e6('0x36')](_[_0xb9e6('0x3f')](_0x45db1a['query'],_0x2f6b08['filters']),_0x512648);if(_0x45db1a['query'][_0xb9e6('0x40')]){_0x110e5f[_0xb9e6('0x3e')]=_[_0xb9e6('0x41')](_0x110e5f[_0xb9e6('0x3e')],{'$or':_[_0xb9e6('0x2e')](_0x512648,function(_0x5846da){if(_0x5846da[_0xb9e6('0x32')]!==_0xb9e6('0x42')){var _0x1029cd={};_0x1029cd[_0x5846da[_0xb9e6('0x2b')]]={'$like':'%'+_0x45db1a[_0xb9e6('0x34')][_0xb9e6('0x40')]+'%'};return _0x1029cd;}})});}_0x110e5f=_[_0xb9e6('0x41')]({},_0x110e5f,_0x45db1a[_0xb9e6('0x43')]);var _0x24f0c8={'where':_0x110e5f['where']};return db[_0xb9e6('0x2f')][_0xb9e6('0x22')](_0x24f0c8)['then'](function(_0x13c4ae){_0x1dbd27[_0xb9e6('0x22')]=_0x13c4ae;if(_0x45db1a[_0xb9e6('0x34')][_0xb9e6('0x44')]){_0x110e5f['include']=[{'all':!![]}];}return db[_0xb9e6('0x2f')][_0xb9e6('0x45')](_0x110e5f);})['then'](function(_0x7b1939){_0x1dbd27[_0xb9e6('0x46')]=_0x7b1939;return _0x1dbd27;})[_0xb9e6('0x28')](respondWithFilteredResult(_0x35fdb9,_0x110e5f))['catch'](handleError(_0x35fdb9,null));};exports[_0xb9e6('0x47')]=function(_0x1f71aa,_0xf0534e){var _0x1ece5b={'raw':!![],'where':{'id':_0x1f71aa[_0xb9e6('0x48')]['id']}},_0x2aa641={};_0x2aa641['model']=_[_0xb9e6('0x35')](db[_0xb9e6('0x2f')][_0xb9e6('0x30')]);_0x2aa641[_0xb9e6('0x34')]=_[_0xb9e6('0x35')](_0x1f71aa[_0xb9e6('0x34')]);_0x2aa641[_0xb9e6('0x36')]=_[_0xb9e6('0x37')](_0x2aa641['model'],_0x2aa641['query']);_0x1ece5b['attributes']=_[_0xb9e6('0x37')](_0x2aa641[_0xb9e6('0x33')],qs[_0xb9e6('0x39')](_0x1f71aa[_0xb9e6('0x34')][_0xb9e6('0x39')]));_0x1ece5b[_0xb9e6('0x38')]=_0x1ece5b['attributes'][_0xb9e6('0x49')]?_0x1ece5b[_0xb9e6('0x38')]:_0x2aa641['model'];if(_0x1f71aa['query'][_0xb9e6('0x44')]){_0x1ece5b[_0xb9e6('0x4a')]=[{'all':!![]}];}_0x1ece5b=_[_0xb9e6('0x41')]({},_0x1ece5b,_0x1f71aa['options']);return db[_0xb9e6('0x2f')]['find'](_0x1ece5b)[_0xb9e6('0x28')](handleEntityNotFound(_0xf0534e,null))[_0xb9e6('0x28')](respondWithResult(_0xf0534e,null))[_0xb9e6('0x4b')](handleError(_0xf0534e,null));};exports[_0xb9e6('0x4c')]=function(_0xe3af83,_0x5489ae){return db[_0xb9e6('0x2f')][_0xb9e6('0x4c')](_0xe3af83['body'],{})[_0xb9e6('0x28')](respondWithResult(_0x5489ae,0xc9))[_0xb9e6('0x4b')](handleError(_0x5489ae,null));};exports[_0xb9e6('0x27')]=function(_0x1ad093,_0x4ff029){if(_0x1ad093[_0xb9e6('0x4d')]['id']){delete _0x1ad093[_0xb9e6('0x4d')]['id'];}return db[_0xb9e6('0x2f')][_0xb9e6('0x4e')]({'where':{'id':_0x1ad093[_0xb9e6('0x48')]['id']}})[_0xb9e6('0x28')](handleEntityNotFound(_0x4ff029,null))['then'](saveUpdates(_0x1ad093[_0xb9e6('0x4d')],null))['then'](respondWithResult(_0x4ff029,null))[_0xb9e6('0x4b')](handleError(_0x4ff029,null));};exports[_0xb9e6('0x4f')]=function(_0x169606,_0x1ac9e0){return db[_0xb9e6('0x2f')]['find']({'where':{'id':_0x169606[_0xb9e6('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ac9e0,null))['then'](removeEntity(_0x1ac9e0,null))['catch'](handleError(_0x1ac9e0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5b12e7d..67a34c0 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 _0xbf1c=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','api','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf1c,0x158));var _0xcbf1=function(_0x4d183d,_0x123de0){_0x4d183d=_0x4d183d-0x0;var _0x431236=_0xbf1c[_0x4d183d];return _0x431236;};'use strict';var _=require(_0xcbf1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcbf1('0x1'));var moment=require('moment');var BPromise=require(_0xcbf1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbf1('0x3'));var rimraf=require(_0xcbf1('0x4'));var config=require(_0xcbf1('0x5'));var attributes=require(_0xcbf1('0x6'));module[_0xcbf1('0x7')]=function(_0xcebc69,_0x4ba99f){return _0xcebc69['define'](_0xcbf1('0x8'),attributes,{'tableName':_0xcbf1('0x9'),'paranoid':![],'indexes':[{'name':_0xcbf1('0xa'),'fields':['idField',_0xcbf1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb33d=['moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','idField','FieldId','lodash','api'];(function(_0x285c2f,_0x2b8c92){var _0x3e174f=function(_0x44104b){while(--_0x44104b){_0x285c2f['push'](_0x285c2f['shift']());}};_0x3e174f(++_0x2b8c92);}(_0xb33d,0x6a));var _0xdb33=function(_0x30fc1f,_0x56890f){_0x30fc1f=_0x30fc1f-0x0;var _0x5b25ff=_0xb33d[_0x30fc1f];return _0x5b25ff;};'use strict';var _=require(_0xdb33('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdb33('0x1'));var moment=require(_0xdb33('0x2'));var BPromise=require('bluebird');var rp=require(_0xdb33('0x3'));var fs=require('fs');var path=require(_0xdb33('0x4'));var rimraf=require(_0xdb33('0x5'));var config=require(_0xdb33('0x6'));var attributes=require(_0xdb33('0x7'));module['exports']=function(_0x3c8268,_0x5939b7){return _0x3c8268[_0xdb33('0x8')](_0xdb33('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xdb33('0xa'),_0xdb33('0xb')],'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 33229b3..455f0de 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 _0x7085=['code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7085,0x1e5));var _0x5708=function(_0x36d11c,_0x6dffa7){_0x36d11c=_0x36d11c-0x0;var _0xd95b50=_0x7085[_0x36d11c];return _0xd95b50;};'use strict';var _=require(_0x5708('0x0'));var util=require(_0x5708('0x1'));var moment=require(_0x5708('0x2'));var BPromise=require('bluebird');var rs=require(_0x5708('0x3'));var fs=require('fs');var Redis=require(_0x5708('0x4'));var db=require(_0x5708('0x5'))['db'];var utils=require(_0x5708('0x6'));var logger=require(_0x5708('0x7'))('rpc');var config=require(_0x5708('0x8'));var jayson=require(_0x5708('0x9'));var client=jayson[_0x5708('0xa')][_0x5708('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c370e,_0x493c5a,_0x343030){return new BPromise(function(_0x38c433,_0x4e8bb2){return client['request'](_0x1c370e,_0x343030)[_0x5708('0xc')](function(_0x353a56){logger['info'](_0x5708('0xd'),_0x493c5a,_0x5708('0xe'));logger[_0x5708('0xf')](_0x5708('0x10'),_0x493c5a,_0x5708('0xe'),JSON[_0x5708('0x11')](_0x353a56));if(_0x353a56[_0x5708('0x12')]){if(_0x353a56[_0x5708('0x12')][_0x5708('0x13')]===0x1f4){logger[_0x5708('0x12')]('SalesforceField,\x20%s,\x20%s',_0x493c5a,_0x353a56[_0x5708('0x12')][_0x5708('0x14')]);return _0x4e8bb2(_0x353a56[_0x5708('0x12')][_0x5708('0x14')]);}logger[_0x5708('0x12')]('SalesforceField,\x20%s,\x20%s',_0x493c5a,_0x353a56[_0x5708('0x12')][_0x5708('0x14')]);return _0x38c433(_0x353a56[_0x5708('0x12')][_0x5708('0x14')]);}else{logger[_0x5708('0x15')](_0x5708('0xd'),_0x493c5a,_0x5708('0xe'));_0x38c433(_0x353a56[_0x5708('0x16')][_0x5708('0x14')]);}})[_0x5708('0x17')](function(_0x56812d){logger[_0x5708('0x12')](_0x5708('0xd'),_0x493c5a,_0x56812d);_0x4e8bb2(_0x56812d);});});} \ No newline at end of file +var _0xce5b=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceField,\x20%s,\x20%s','message'];(function(_0x3b898b,_0xfb72aa){var _0x3924b3=function(_0x282d50){while(--_0x282d50){_0x3b898b['push'](_0x3b898b['shift']());}};_0x3924b3(++_0xfb72aa);}(_0xce5b,0x182));var _0xbce5=function(_0x20f5ac,_0x1a501d){_0x20f5ac=_0x20f5ac-0x0;var _0x40c22f=_0xce5b[_0x20f5ac];return _0x40c22f;};'use strict';var _=require('lodash');var util=require(_0xbce5('0x0'));var moment=require(_0xbce5('0x1'));var BPromise=require(_0xbce5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbce5('0x3'));var db=require(_0xbce5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce5('0x5'))(_0xbce5('0x6'));var config=require(_0xbce5('0x7'));var jayson=require(_0xbce5('0x8'));var client=jayson[_0xbce5('0x9')][_0xbce5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143ba0,_0x5e2a0d,_0x1a01b2){return new BPromise(function(_0x5234cd,_0x264f5f){return client[_0xbce5('0xb')](_0x143ba0,_0x1a01b2)[_0xbce5('0xc')](function(_0x1d4445){logger[_0xbce5('0xd')]('SalesforceField,\x20%s,\x20%s',_0x5e2a0d,'request\x20sent');logger[_0xbce5('0xe')](_0xbce5('0xf'),_0x5e2a0d,_0xbce5('0x10'),JSON[_0xbce5('0x11')](_0x1d4445));if(_0x1d4445[_0xbce5('0x12')]){if(_0x1d4445[_0xbce5('0x12')][_0xbce5('0x13')]===0x1f4){logger[_0xbce5('0x12')](_0xbce5('0x14'),_0x5e2a0d,_0x1d4445[_0xbce5('0x12')][_0xbce5('0x15')]);return _0x264f5f(_0x1d4445[_0xbce5('0x12')]['message']);}logger[_0xbce5('0x12')](_0xbce5('0x14'),_0x5e2a0d,_0x1d4445[_0xbce5('0x12')][_0xbce5('0x15')]);return _0x5234cd(_0x1d4445[_0xbce5('0x12')][_0xbce5('0x15')]);}else{logger[_0xbce5('0xd')](_0xbce5('0x14'),_0x5e2a0d,'request\x20sent');_0x5234cd(_0x1d4445[_0xbce5('0x16')]['message']);}})[_0xbce5('0x17')](function(_0x49f157){logger['error'](_0xbce5('0x14'),_0x5e2a0d,_0x49f157);_0x264f5f(_0x49f157);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index cb8864f..ebdd4d3 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 _0xee4f=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','/:id','show','getConfigurations','get','getFields','post','/:id/configurations','addConfiguration','put','delete'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xee4f,0xad));var _0xfee4=function(_0x2fbe1,_0x41e8d5){_0x2fbe1=_0x2fbe1-0x0;var _0x160d78=_0xee4f[_0x2fbe1];return _0x160d78;};'use strict';var multer=require(_0xfee4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfee4('0x1'));var express=require(_0xfee4('0x2'));var router=express[_0xfee4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfee4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfee4('0x5'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xfee4('0x6')](),controller['index']);router['get'](_0xfee4('0x7'),auth[_0xfee4('0x6')](),controller[_0xfee4('0x8')]);router['get']('/:id/configurations',auth[_0xfee4('0x6')](),controller[_0xfee4('0x9')]);router[_0xfee4('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xfee4('0xb')]);router[_0xfee4('0xc')]('/',auth[_0xfee4('0x6')](),controller['create']);router[_0xfee4('0xc')](_0xfee4('0xd'),auth[_0xfee4('0x6')](),controller[_0xfee4('0xe')]);router[_0xfee4('0xf')](_0xfee4('0x7'),auth[_0xfee4('0x6')](),controller['update']);router[_0xfee4('0x10')](_0xfee4('0x7'),auth['isAuthenticated'](),controller[_0xfee4('0x11')]);module[_0xfee4('0x12')]=router; \ No newline at end of file +var _0xdae9=['put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x58576f,_0x3a4da3){var _0x2a1aeb=function(_0x242ce3){while(--_0x242ce3){_0x58576f['push'](_0x58576f['shift']());}};_0x2a1aeb(++_0x3a4da3);}(_0xdae9,0x15e));var _0x9dae=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xdae9[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require('multer');var util=require(_0x9dae('0x0'));var path=require('path');var timeout=require(_0x9dae('0x1'));var express=require(_0x9dae('0x2'));var router=express[_0x9dae('0x3')]();var fs_extra=require(_0x9dae('0x4'));var auth=require(_0x9dae('0x5'));var interaction=require(_0x9dae('0x6'));var config=require(_0x9dae('0x7'));var controller=require(_0x9dae('0x8'));router[_0x9dae('0x9')]('/',auth[_0x9dae('0xa')](),controller['index']);router[_0x9dae('0x9')](_0x9dae('0xb'),auth['isAuthenticated'](),controller[_0x9dae('0xc')]);router['get'](_0x9dae('0xd'),auth[_0x9dae('0xa')](),controller[_0x9dae('0xe')]);router['get'](_0x9dae('0xf'),auth[_0x9dae('0xa')](),controller[_0x9dae('0x10')]);router[_0x9dae('0x11')]('/',auth[_0x9dae('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0x9dae('0xa')](),controller['addConfiguration']);router[_0x9dae('0x12')](_0x9dae('0xb'),auth[_0x9dae('0xa')](),controller[_0x9dae('0x13')]);router[_0x9dae('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9dae('0x15')]);module[_0x9dae('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 33601e8..188cb12 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 _0xcd8c=['exports','STRING','username','sequelize'];(function(_0x54c101,_0xc2a9b5){var _0x4bc922=function(_0x2bde0b){while(--_0x2bde0b){_0x54c101['push'](_0x54c101['shift']());}};_0x4bc922(++_0xc2a9b5);}(_0xcd8c,0x12b));var _0xccd8=function(_0x4e29f1,_0x3da155){_0x4e29f1=_0x4e29f1-0x0;var _0x4bc72f=_0xcd8c[_0x4e29f1];return _0x4bc72f;};'use strict';var Sequelize=require(_0xccd8('0x0'));module[_0xccd8('0x1')]={'name':{'type':Sequelize[_0xccd8('0x2')]},'description':{'type':Sequelize[_0xccd8('0x2')]},'username':{'type':Sequelize[_0xccd8('0x2')],'unique':_0xccd8('0x3')},'password':{'type':Sequelize[_0xccd8('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xccd8('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xccd8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6513=['username','sequelize','STRING'];(function(_0x384260,_0x15a55a){var _0x3ad6c9=function(_0x599359){while(--_0x599359){_0x384260['push'](_0x384260['shift']());}};_0x3ad6c9(++_0x15a55a);}(_0x6513,0x187));var _0x3651=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x6513[_0x596c43];return _0x4e1315;};'use strict';var Sequelize=require(_0x3651('0x0'));module['exports']={'name':{'type':Sequelize[_0x3651('0x1')]},'description':{'type':Sequelize[_0x3651('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x3651('0x2')},'password':{'type':Sequelize[_0x3651('0x1')]},'email':{'type':Sequelize[_0x3651('0x1')]},'remoteUri':{'type':Sequelize[_0x3651('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x3651('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 4972a7c..ae7fdf2 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 _0x082e=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filter','type','VIRTUAL','merge','options','where','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','update','getConfigurations','findOne','filters','pick','nolimit','addConfiguration','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','close_code','notify','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','order','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','business_service','priority','sys_domain_path','rfc','business_duration','group_list','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','work_start','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','activity_due','assigned_to','comments','approval','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','internalType','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','False','sys_choice?sysparm_query=name=incident^element=','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x32986,_0x4489c8){var _0x355ebb=function(_0x338840){while(--_0x338840){_0x32986['push'](_0x32986['shift']());}};_0x355ebb(++_0x4489c8);}(_0x082e,0xaa));var _0xe082=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x082e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe082('0x0'));var zipdir=require(_0xe082('0x1'));var jsonpatch=require(_0xe082('0x2'));var rp=require(_0xe082('0x3'));var moment=require(_0xe082('0x4'));var BPromise=require(_0xe082('0x5'));var Mustache=require(_0xe082('0x6'));var util=require(_0xe082('0x7'));var path=require(_0xe082('0x8'));var sox=require(_0xe082('0x9'));var csv=require(_0xe082('0xa'));var ejs=require(_0xe082('0xb'));var fs=require('fs');var fs_extra=require(_0xe082('0xc'));var _=require(_0xe082('0xd'));var squel=require(_0xe082('0xe'));var crypto=require(_0xe082('0xf'));var jsforce=require(_0xe082('0x10'));var deskjs=require(_0xe082('0x11'));var toCsv=require(_0xe082('0xa'));var querystring=require('querystring');var Papa=require(_0xe082('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe082('0x13'));var as=require(_0xe082('0x14'));var hardwareService=require(_0xe082('0x15'));var logger=require(_0xe082('0x16'))(_0xe082('0x17'));var utils=require(_0xe082('0x18'));var config=require(_0xe082('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe082('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xf845bc,_0x32dd7b){_0x32dd7b=_0x32dd7b||0xcc;return function(_0x50fc6b){if(_0x50fc6b){return _0xf845bc[_0xe082('0x1b')](_0x32dd7b);}return _0xf845bc[_0xe082('0x1c')](_0x32dd7b)[_0xe082('0x1d')]();};}function respondWithResult(_0x173159,_0x2cc647){_0x2cc647=_0x2cc647||0xc8;return function(_0x7315ff){if(_0x7315ff){return _0x173159[_0xe082('0x1c')](_0x2cc647)[_0xe082('0x1e')](_0x7315ff);}};}function respondWithFilteredResult(_0x172956,_0x1e9cd1){return function(_0x2ee7c8){if(_0x2ee7c8){var _0x4be2ce=typeof _0x1e9cd1['offset']===_0xe082('0x1f')&&typeof _0x1e9cd1[_0xe082('0x20')]===_0xe082('0x1f');var _0x1a528a=_0x2ee7c8[_0xe082('0x21')];var _0x4e2e88=_0x4be2ce?0x0:_0x1e9cd1[_0xe082('0x22')];var _0x59ce96=_0x4be2ce?_0x2ee7c8['count']:_0x1e9cd1[_0xe082('0x22')]+_0x1e9cd1[_0xe082('0x20')];var _0x7a4307;if(_0x59ce96>=_0x1a528a){_0x59ce96=_0x1a528a;_0x7a4307=0xc8;}else{_0x7a4307=0xce;}_0x172956[_0xe082('0x1c')](_0x7a4307);return _0x172956[_0xe082('0x23')](_0xe082('0x24'),_0x4e2e88+'-'+_0x59ce96+'/'+_0x1a528a)[_0xe082('0x1e')](_0x2ee7c8);}return null;};}function patchUpdates(_0x1b1177){return function(_0x133e27){try{jsonpatch[_0xe082('0x25')](_0x133e27,_0x1b1177,!![]);}catch(_0x246e44){return BPromise['reject'](_0x246e44);}return _0x133e27[_0xe082('0x26')]();};}function saveUpdates(_0x36c000,_0x2fdec1){return function(_0x1069da){if(_0x1069da){return _0x1069da['update'](_0x36c000)[_0xe082('0x27')](function(_0x42f3bd){return _0x42f3bd;});}return null;};}function removeEntity(_0x5775da,_0x268353){return function(_0x33a9bd){if(_0x33a9bd){return _0x33a9bd[_0xe082('0x28')]()[_0xe082('0x27')](function(){_0x5775da[_0xe082('0x1c')](0xcc)[_0xe082('0x1d')]();});}};}function handleEntityNotFound(_0x5e2d24,_0x4900f0){return function(_0x14506f){if(!_0x14506f){_0x5e2d24[_0xe082('0x1b')](0x194);}return _0x14506f;};}function handleError(_0x16b925,_0x8b82f8){_0x8b82f8=_0x8b82f8||0x1f4;return function(_0x117960){logger[_0xe082('0x29')](_0x117960[_0xe082('0x2a')]);if(_0x117960[_0xe082('0x2b')]){delete _0x117960[_0xe082('0x2b')];}_0x16b925[_0xe082('0x1c')](_0x8b82f8)[_0xe082('0x2c')](_0x117960);};}exports['index']=function(_0x1a0dcd,_0x1f7afa){var _0x11125e={},_0x1446bb={},_0x27b561={'count':0x0,'rows':[]};var _0x40bd58=_[_0xe082('0x2d')](db[_0xe082('0x2e')][_0xe082('0x2f')],function(_0x453e34){return{'name':_0x453e34[_0xe082('0x30')],'type':_0x453e34['type']['key']};});_0x1446bb[_0xe082('0x31')]=_['map'](_0x40bd58,'name');_0x1446bb[_0xe082('0x32')]=_['keys'](_0x1a0dcd[_0xe082('0x32')]);_0x1446bb['filters']=_[_0xe082('0x33')](_0x1446bb[_0xe082('0x31')],_0x1446bb[_0xe082('0x32')]);_0x11125e[_0xe082('0x34')]=_[_0xe082('0x33')](_0x1446bb[_0xe082('0x31')],qs[_0xe082('0x35')](_0x1a0dcd[_0xe082('0x32')][_0xe082('0x35')]));_0x11125e['attributes']=_0x11125e[_0xe082('0x34')][_0xe082('0x36')]?_0x11125e['attributes']:_0x1446bb['model'];if(!_0x1a0dcd[_0xe082('0x32')][_0xe082('0x37')]('nolimit')){_0x11125e[_0xe082('0x20')]=qs['limit'](_0x1a0dcd[_0xe082('0x32')]['limit']);_0x11125e['offset']=qs[_0xe082('0x22')](_0x1a0dcd[_0xe082('0x32')][_0xe082('0x22')]);}_0x11125e['order']=qs[_0xe082('0x38')](_0x1a0dcd[_0xe082('0x32')]['sort']);_0x11125e['where']=qs['filters'](_['pick'](_0x1a0dcd[_0xe082('0x32')],_0x1446bb['filters']),_0x40bd58);if(_0x1a0dcd['query'][_0xe082('0x39')]){_0x11125e['where']=_['merge'](_0x11125e['where'],{'$or':_[_0xe082('0x2d')](_0x40bd58,function(_0x14b0c2){if(_0x14b0c2[_0xe082('0x3a')]!==_0xe082('0x3b')){var _0x3b0f80={};_0x3b0f80[_0x14b0c2[_0xe082('0x2b')]]={'$like':'%'+_0x1a0dcd[_0xe082('0x32')][_0xe082('0x39')]+'%'};return _0x3b0f80;}})});}_0x11125e=_[_0xe082('0x3c')]({},_0x11125e,_0x1a0dcd[_0xe082('0x3d')]);var _0x2b2b2f={'where':_0x11125e[_0xe082('0x3e')]};return db['ServicenowAccount'][_0xe082('0x21')](_0x2b2b2f)[_0xe082('0x27')](function(_0x28ba75){_0x27b561[_0xe082('0x21')]=_0x28ba75;if(_0x1a0dcd['query']['includeAll']){_0x11125e[_0xe082('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xe082('0x40')](_0x11125e);})[_0xe082('0x27')](function(_0x402d11){_0x27b561[_0xe082('0x41')]=_0x402d11;return _0x27b561;})[_0xe082('0x27')](respondWithFilteredResult(_0x1f7afa,_0x11125e))['catch'](handleError(_0x1f7afa,null));};exports[_0xe082('0x42')]=function(_0x1f34ba,_0x5859ff){var _0x5d0d25={'raw':![],'where':{'id':_0x1f34ba[_0xe082('0x43')]['id']}},_0x3364e0={};_0x3364e0[_0xe082('0x31')]=_['keys'](db['ServicenowAccount'][_0xe082('0x2f')]);_0x3364e0['query']=_[_0xe082('0x44')](_0x1f34ba[_0xe082('0x32')]);_0x3364e0['filters']=_[_0xe082('0x33')](_0x3364e0[_0xe082('0x31')],_0x3364e0[_0xe082('0x32')]);_0x5d0d25[_0xe082('0x34')]=_['intersection'](_0x3364e0['model'],qs[_0xe082('0x35')](_0x1f34ba['query']['fields']));_0x5d0d25[_0xe082('0x34')]=_0x5d0d25[_0xe082('0x34')][_0xe082('0x36')]?_0x5d0d25[_0xe082('0x34')]:_0x3364e0[_0xe082('0x31')];if(_0x1f34ba[_0xe082('0x32')][_0xe082('0x45')]){_0x5d0d25[_0xe082('0x3f')]=[{'all':!![]}];}_0x5d0d25=_[_0xe082('0x3c')]({},_0x5d0d25,_0x1f34ba['options']);return db[_0xe082('0x2e')][_0xe082('0x46')](_0x5d0d25)[_0xe082('0x27')](handleEntityNotFound(_0x5859ff,null))[_0xe082('0x27')](respondWithResult(_0x5859ff,null))[_0xe082('0x47')](handleError(_0x5859ff,null));};exports[_0xe082('0x48')]=function(_0x4c9be0,_0x5743c7){return db['ServicenowAccount'][_0xe082('0x48')](_0x4c9be0[_0xe082('0x49')],{})[_0xe082('0x27')](respondWithResult(_0x5743c7,0xc9))['catch'](handleError(_0x5743c7,null));};exports[_0xe082('0x4a')]=function(_0x183606,_0x1cf0fd){if(_0x183606[_0xe082('0x49')]['id']){delete _0x183606[_0xe082('0x49')]['id'];}return db[_0xe082('0x2e')]['find']({'where':{'id':_0x183606['params']['id']}})[_0xe082('0x27')](handleEntityNotFound(_0x1cf0fd,null))['then'](saveUpdates(_0x183606[_0xe082('0x49')],null))[_0xe082('0x27')](respondWithResult(_0x1cf0fd,null))[_0xe082('0x47')](handleError(_0x1cf0fd,null));};exports[_0xe082('0x28')]=function(_0x36c06a,_0x4297c7){return db[_0xe082('0x2e')][_0xe082('0x46')]({'where':{'id':_0x36c06a['params']['id']}})['then'](handleEntityNotFound(_0x4297c7,null))[_0xe082('0x27')](removeEntity(_0x4297c7,null))['catch'](handleError(_0x4297c7,null));};exports[_0xe082('0x4b')]=function(_0x26574d,_0x3193c3,_0x1581db){var _0x126cba={};var _0x504be6={};var _0x12a288;var _0x1a8b07;return db['ServicenowAccount'][_0xe082('0x4c')]({'where':{'id':_0x26574d[_0xe082('0x43')]['id']}})[_0xe082('0x27')](handleEntityNotFound(_0x3193c3,null))[_0xe082('0x27')](function(_0x1832fe){if(_0x1832fe){_0x12a288=_0x1832fe;_0x504be6['model']=_[_0xe082('0x44')](db['ServicenowConfiguration'][_0xe082('0x2f')]);_0x504be6[_0xe082('0x32')]=_[_0xe082('0x44')](_0x26574d['query']);_0x504be6[_0xe082('0x4d')]=_[_0xe082('0x33')](_0x504be6['model'],_0x504be6[_0xe082('0x32')]);_0x126cba[_0xe082('0x34')]=_[_0xe082('0x33')](_0x504be6['model'],qs['fields'](_0x26574d[_0xe082('0x32')][_0xe082('0x35')]));_0x126cba[_0xe082('0x34')]=_0x126cba[_0xe082('0x34')][_0xe082('0x36')]?_0x126cba[_0xe082('0x34')]:_0x504be6[_0xe082('0x31')];_0x126cba['order']=qs['sort'](_0x26574d['query'][_0xe082('0x38')]);_0x126cba[_0xe082('0x3e')]=qs[_0xe082('0x4d')](_[_0xe082('0x4e')](_0x26574d[_0xe082('0x32')],_0x504be6[_0xe082('0x4d')]));if(_0x26574d[_0xe082('0x32')][_0xe082('0x39')]){_0x126cba[_0xe082('0x3e')]=_[_0xe082('0x3c')](_0x126cba[_0xe082('0x3e')],{'$or':_[_0xe082('0x2d')](_0x126cba['attributes'],function(_0x2a5959){var _0x1e49ea={};_0x1e49ea[_0x2a5959]={'$like':'%'+_0x26574d[_0xe082('0x32')]['filter']+'%'};return _0x1e49ea;})});}_0x126cba=_[_0xe082('0x3c')]({},_0x126cba,_0x26574d[_0xe082('0x3d')]);return _0x12a288[_0xe082('0x4b')](_0x126cba);}})[_0xe082('0x27')](function(_0x9d8484){if(_0x9d8484){_0x1a8b07=_0x9d8484[_0xe082('0x36')];if(!_0x26574d[_0xe082('0x32')][_0xe082('0x37')](_0xe082('0x4f'))){_0x126cba[_0xe082('0x20')]=qs['limit'](_0x26574d['query'][_0xe082('0x20')]);_0x126cba['offset']=qs[_0xe082('0x22')](_0x26574d[_0xe082('0x32')][_0xe082('0x22')]);}return _0x12a288[_0xe082('0x4b')](_0x126cba);}})[_0xe082('0x27')](function(_0x2aabe2){if(_0x2aabe2){return _0x2aabe2?{'count':_0x1a8b07,'rows':_0x2aabe2}:null;}})['then'](respondWithResult(_0x3193c3,null))[_0xe082('0x47')](handleError(_0x3193c3,null));};exports[_0xe082('0x50')]=function(_0x2db58b,_0x54c3a2,_0x53bd35){if(_0x2db58b['body']['id']){delete _0x2db58b[_0xe082('0x49')]['id'];}return db[_0xe082('0x2e')]['findOne']({'where':{'id':_0x2db58b[_0xe082('0x43')]['id']}})[_0xe082('0x27')](handleEntityNotFound(_0x54c3a2,null))[_0xe082('0x27')](function(_0x2899dc){if(_0x2899dc){_0x2db58b[_0xe082('0x49')]['AccountId']=_0x2899dc['id'];_0x2db58b[_0xe082('0x49')]['Subjects']=integrations['getSubjects'](_0x2db58b[_0xe082('0x49')][_0xe082('0x51')],_0x2db58b[_0xe082('0x49')][_0xe082('0x3a')]);_0x2db58b[_0xe082('0x49')][_0xe082('0x52')]=integrations[_0xe082('0x53')](_0x2db58b[_0xe082('0x49')][_0xe082('0x51')],_0x2db58b[_0xe082('0x49')]['type']);return db[_0xe082('0x54')][_0xe082('0x48')](_0x2db58b['body'],{'include':[{'model':db[_0xe082('0x55')],'as':_0xe082('0x56')},{'model':db[_0xe082('0x55')],'as':_0xe082('0x52')}]});}return null;})[_0xe082('0x27')](respondWithResult(_0x54c3a2,null))[_0xe082('0x47')](handleError(_0x54c3a2,null));};exports[_0xe082('0x57')]=function(_0x5a9c88,_0x5ed897,_0x16706b){var _0x340526=[_0xe082('0x58'),_0xe082('0x59'),_0xe082('0x5a'),'subcategory',_0xe082('0x5b'),_0xe082('0x5c'),'incident_state',_0xe082('0x5d'),_0xe082('0x5e')];var _0x2964f1=[_0xe082('0x5f'),_0xe082('0x58'),_0xe082('0x60'),_0xe082('0x61'),'upon_reject',_0xe082('0x62'),_0xe082('0x63'),'hold_reason',_0xe082('0x64'),_0xe082('0x65'),_0xe082('0x66'),_0xe082('0x67'),_0xe082('0x68'),_0xe082('0x69'),_0xe082('0x6a'),_0xe082('0x6b'),_0xe082('0x6c'),_0xe082('0x6d'),_0xe082('0x5a'),_0xe082('0x6e'),_0xe082('0x6f'),_0xe082('0x70'),_0xe082('0x71'),'delivery_plan','impact',_0xe082('0x72'),_0xe082('0x73'),_0xe082('0x74'),_0xe082('0x75'),_0xe082('0x76'),_0xe082('0x77'),'time_worked','expected_start','opened_at',_0xe082('0x78'),_0xe082('0x79'),'work_end',_0xe082('0x7a'),_0xe082('0x7b'),'caller_id',_0xe082('0x7c'),'subcategory',_0xe082('0x7d'),_0xe082('0x7e'),_0xe082('0x5b'),_0xe082('0x7f'),'delivery_task',_0xe082('0x80'),'assignment_group','business_stc',_0xe082('0x81'),'description',_0xe082('0x82'),_0xe082('0x5c'),_0xe082('0x83'),_0xe082('0x84'),_0xe082('0x85'),'follow_up','parent_incident',_0xe082('0x86'),_0xe082('0x87'),_0xe082('0x88'),_0xe082('0x89'),_0xe082('0x8a'),_0xe082('0x8b'),_0xe082('0x8c'),'reassignment_count',_0xe082('0x8d'),_0xe082('0x8e'),_0xe082('0x5d'),_0xe082('0x8f'),'sla_due',_0xe082('0x90'),'comments_and_work_notes','due_date',_0xe082('0x91'),_0xe082('0x92'),_0xe082('0x93'),_0xe082('0x94'),_0xe082('0x95'),_0xe082('0x96'),'location',_0xe082('0x5e')];var _0x3674de='';var _0x35641e='';var _0x106f2f=[];var _0x592872='';var _0x8a1afd='';var _0xf34316=[];var _0x29fd01='';var _0x35bf0e='';var _0x4ed876={};var _0x5ac69a='';return db[_0xe082('0x2e')]['findOne']({'where':{'id':_0x5a9c88[_0xe082('0x43')]['id']},'attributes':['id',_0xe082('0x97'),_0xe082('0x98'),_0xe082('0x99'),'remoteUri','serverUrl']})[_0xe082('0x27')](handleEntityNotFound(_0x5ed897,null))['then'](function(_0x135f15){if(_0x135f15){_0x5ac69a=_0x135f15[_0xe082('0x9a')];var _0x2ca05e=_0x5ac69a[_0xe082('0x9b')](-0x1);if(_0x2ca05e==='/'){_0x5ac69a=_0x5ac69a[_0xe082('0x9c')](0x0,_0x5ac69a['lastIndexOf'](_0x2ca05e));}_0x35bf0e=util[_0xe082('0x9d')](_0xe082('0x9e'),_0x5ac69a);_0x29fd01=util[_0xe082('0x9d')]('%s/api/now/table/',_0x5ac69a);_0x4ed876={'user':_0x135f15[_0xe082('0x97')],'pass':_0x135f15[_0xe082('0x98')]};var _0x4081b4={'method':_0xe082('0x9f'),'uri':_0x35bf0e+_0xe082('0xa0'),'auth':_0x4ed876,'json':!![]};return rp(_0x4081b4);}})['then'](function(_0x598a25){if(_0x598a25[_0xe082('0xa1')]['length']>0x0){_0x3674de=_0x598a25['result'];}console[_0xe082('0xa2')](_0xe082('0xa3'),_0x3674de);_0xf34316=[];_0x35641e=Object[_0xe082('0xa4')]([],_0x3674de);_[_0xe082('0xa5')](_0x35641e,function(_0x27ff8b){return!_0x340526[_0xe082('0xa6')](_0x27ff8b[_0xe082('0x2b')]);});_0x35641e[_0xe082('0xa7')](function(_0x400159){var _0x1dad25=createFieldObject(_0x29fd01,_0x4ed876,_0x400159['internalType'],_0x400159['name'],_0x400159[_0xe082('0xa8')],![]);_0xf34316[_0xe082('0xa9')](_0x1dad25);});return Promise[_0xe082('0xaa')](_0xf34316);})[_0xe082('0x27')](function(_0x17bf9d){_0x106f2f=_0x17bf9d;_0x592872=Object[_0xe082('0xa4')]([],_0x3674de);console[_0xe082('0xa2')]('TCL:\x20_object',_0x3674de);_[_0xe082('0xa5')](_0x592872,function(_0x47449e){return _0x2964f1[_0xe082('0xa6')](_0x47449e[_0xe082('0x2b')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x592872);_0xf34316=[];_0x592872[_0xe082('0xa7')](function(_0x9c4777){var _0x5e908d=createFieldObject(_0x29fd01,_0x4ed876,_0x9c4777[_0xe082('0xab')],_0x9c4777[_0xe082('0x2b')],_0x9c4777[_0xe082('0xa8')],!![]);_0xf34316[_0xe082('0xa9')](_0x5e908d);});return Promise['all'](_0xf34316);})[_0xe082('0x27')](function(_0x1f6c96){_0x8a1afd=_0x1f6c96;var _0x559495=_0x106f2f[_0xe082('0xac')](_0x8a1afd);return{'count':_0x559495[_0xe082('0x36')],'rows':_0x559495};})['then'](respondWithResult(_0x5ed897,null))[_0xe082('0x47')](function(_0x1c8ba6){console['log'](_0xe082('0xad')+_0x1c8ba6);var _0x39eeb6=_0x5a9c88['query']['test']?0x1f4:_0x1c8ba6['statusCode']||0x1f4;logger[_0xe082('0x29')](_0x1c8ba6[_0xe082('0x2a')]);delete _0x1c8ba6[_0xe082('0x2b')];if(_0x39eeb6===0x191){_0x39eeb6=0x190;}_0x5ed897['status'](_0x39eeb6)['send'](_0x5a9c88[_0xe082('0x32')][_0xe082('0xae')]?{'message':_0xe082('0xaf'),'statusCode':_0x1c8ba6[_0xe082('0xb0')]}:_0x1c8ba6);});};function createFieldObject(_0x471367,_0x30f117,_0x1da284,_0x2965c1,_0x3179d3,_0x5703a0){return new Promise(function(_0x583284,_0xca990d){var _0x54a4a5={'id':_0x2965c1,'name':_0x3179d3,'custom':_0x5703a0};if(_0x1da284===_0xe082('0xb1')){_0x54a4a5[_0xe082('0x3d')]=[{'name':_0xe082('0xb2'),'value':'true'},{'name':_0xe082('0xb3'),'value':'false'}];_0x583284(_0x54a4a5);}else{var _0x34eedb={'method':_0xe082('0x9f'),'uri':_0x471367+_0xe082('0xb4')+_0x2965c1,'auth':_0x30f117,'json':!![]};return rp(_0x34eedb)[_0xe082('0x27')](function(_0x4ad8c0){var _0x3323ef=[];if(_0x4ad8c0[_0xe082('0xa1')][_0xe082('0x36')]>0x0){_0x4ad8c0[_0xe082('0xa1')][_0xe082('0xa7')](function(_0x2e6e5a){if(_0x2e6e5a['inactive']==='false'){var _0x5b5ef0={'name':_0x2e6e5a['label'],'value':_0x2e6e5a[_0xe082('0xb5')]};_0x3323ef[_0xe082('0xa9')](_0x5b5ef0);}});}_0x54a4a5[_0xe082('0x3d')]=_0x3323ef;if(_0x54a4a5[_0xe082('0x3d')][_0xe082('0x36')]>0x0){_0x583284(_0x54a4a5);}else{if(_0x5703a0==![]){_0x583284();}else{_0x583284(_0x54a4a5);}}});}});} \ No newline at end of file +var _0x649f=['due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','remoteUri','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','all','TCL:\x20_object','forEach','push','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','error','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','length','create','body','find','params','findOne','ServicenowConfiguration','getConfigurations','AccountId','Subjects','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','number','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','comments_and_work_notes'];(function(_0x270cc8,_0x2ccd04){var _0x4011a5=function(_0x4c1529){while(--_0x4c1529){_0x270cc8['push'](_0x270cc8['shift']());}};_0x4011a5(++_0x2ccd04);}(_0x649f,0x199));var _0xf649=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x649f[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf649('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf649('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf649('0x2'));var path=require(_0xf649('0x3'));var sox=require(_0xf649('0x4'));var csv=require('to-csv');var ejs=require(_0xf649('0x5'));var fs=require('fs');var fs_extra=require(_0xf649('0x6'));var _=require(_0xf649('0x7'));var squel=require(_0xf649('0x8'));var crypto=require(_0xf649('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf649('0xa'));var querystring=require(_0xf649('0xb'));var Papa=require(_0xf649('0xc'));var Redis=require('ioredis');var authService=require(_0xf649('0xd'));var qs=require(_0xf649('0xe'));var as=require(_0xf649('0xf'));var hardwareService=require(_0xf649('0x10'));var logger=require(_0xf649('0x11'))(_0xf649('0x12'));var utils=require(_0xf649('0x13'));var config=require(_0xf649('0x14'));var licenseUtil=require(_0xf649('0x15'));var db=require(_0xf649('0x16'))['db'];var integrations=require(_0xf649('0x17'));function respondWithStatusCode(_0x3f71c0,_0x534039){_0x534039=_0x534039||0xcc;return function(_0xfe84eb){if(_0xfe84eb){return _0x3f71c0[_0xf649('0x18')](_0x534039);}return _0x3f71c0[_0xf649('0x19')](_0x534039)[_0xf649('0x1a')]();};}function respondWithResult(_0xf0d300,_0x2dd7fb){_0x2dd7fb=_0x2dd7fb||0xc8;return function(_0x1d8497){if(_0x1d8497){return _0xf0d300[_0xf649('0x19')](_0x2dd7fb)['json'](_0x1d8497);}};}function respondWithFilteredResult(_0x369245,_0x1175a4){return function(_0x114784){if(_0x114784){var _0x571ffc=typeof _0x1175a4[_0xf649('0x1b')]===_0xf649('0x1c')&&typeof _0x1175a4[_0xf649('0x1d')]===_0xf649('0x1c');var _0x442c79=_0x114784['count'];var _0x2ec809=_0x571ffc?0x0:_0x1175a4[_0xf649('0x1b')];var _0x1da1fe=_0x571ffc?_0x114784[_0xf649('0x1e')]:_0x1175a4[_0xf649('0x1b')]+_0x1175a4[_0xf649('0x1d')];var _0x23feaa;if(_0x1da1fe>=_0x442c79){_0x1da1fe=_0x442c79;_0x23feaa=0xc8;}else{_0x23feaa=0xce;}_0x369245[_0xf649('0x19')](_0x23feaa);return _0x369245['set'](_0xf649('0x1f'),_0x2ec809+'-'+_0x1da1fe+'/'+_0x442c79)[_0xf649('0x20')](_0x114784);}return null;};}function patchUpdates(_0x5d20b2){return function(_0xf3dc16){try{jsonpatch[_0xf649('0x21')](_0xf3dc16,_0x5d20b2,!![]);}catch(_0x5e32ef){return BPromise['reject'](_0x5e32ef);}return _0xf3dc16[_0xf649('0x22')]();};}function saveUpdates(_0x38b26b,_0x341d3b){return function(_0x46bbef){if(_0x46bbef){return _0x46bbef[_0xf649('0x23')](_0x38b26b)['then'](function(_0x275fe6){return _0x275fe6;});}return null;};}function removeEntity(_0x32dc7b,_0x117ec5){return function(_0x1da667){if(_0x1da667){return _0x1da667[_0xf649('0x24')]()['then'](function(){_0x32dc7b['status'](0xcc)[_0xf649('0x1a')]();});}};}function handleEntityNotFound(_0x3b1798,_0x2a59de){return function(_0x26a7a5){if(!_0x26a7a5){_0x3b1798['sendStatus'](0x194);}return _0x26a7a5;};}function handleError(_0x2eb322,_0x23a49e){_0x23a49e=_0x23a49e||0x1f4;return function(_0x4f2793){logger[_0xf649('0x25')](_0x4f2793['stack']);if(_0x4f2793['name']){delete _0x4f2793['name'];}_0x2eb322[_0xf649('0x19')](_0x23a49e)[_0xf649('0x26')](_0x4f2793);};}exports[_0xf649('0x27')]=function(_0x1cd82c,_0x538b40){var _0x45457c={},_0x34e2b1={},_0x381b0a={'count':0x0,'rows':[]};var _0x5a5f1b=_[_0xf649('0x28')](db[_0xf649('0x29')][_0xf649('0x2a')],function(_0x1ce1bf){return{'name':_0x1ce1bf[_0xf649('0x2b')],'type':_0x1ce1bf[_0xf649('0x2c')][_0xf649('0x2d')]};});_0x34e2b1[_0xf649('0x2e')]=_['map'](_0x5a5f1b,_0xf649('0x2f'));_0x34e2b1['query']=_[_0xf649('0x30')](_0x1cd82c['query']);_0x34e2b1[_0xf649('0x31')]=_[_0xf649('0x32')](_0x34e2b1[_0xf649('0x2e')],_0x34e2b1[_0xf649('0x33')]);_0x45457c[_0xf649('0x34')]=_[_0xf649('0x32')](_0x34e2b1[_0xf649('0x2e')],qs[_0xf649('0x35')](_0x1cd82c[_0xf649('0x33')][_0xf649('0x35')]));_0x45457c['attributes']=_0x45457c[_0xf649('0x34')]['length']?_0x45457c[_0xf649('0x34')]:_0x34e2b1['model'];if(!_0x1cd82c['query'][_0xf649('0x36')](_0xf649('0x37'))){_0x45457c[_0xf649('0x1d')]=qs['limit'](_0x1cd82c[_0xf649('0x33')][_0xf649('0x1d')]);_0x45457c[_0xf649('0x1b')]=qs['offset'](_0x1cd82c[_0xf649('0x33')][_0xf649('0x1b')]);}_0x45457c[_0xf649('0x38')]=qs[_0xf649('0x39')](_0x1cd82c[_0xf649('0x33')]['sort']);_0x45457c[_0xf649('0x3a')]=qs[_0xf649('0x31')](_[_0xf649('0x3b')](_0x1cd82c[_0xf649('0x33')],_0x34e2b1[_0xf649('0x31')]),_0x5a5f1b);if(_0x1cd82c[_0xf649('0x33')][_0xf649('0x3c')]){_0x45457c[_0xf649('0x3a')]=_['merge'](_0x45457c[_0xf649('0x3a')],{'$or':_[_0xf649('0x28')](_0x5a5f1b,function(_0x4da1a6){if(_0x4da1a6['type']!==_0xf649('0x3d')){var _0x16005a={};_0x16005a[_0x4da1a6[_0xf649('0x2f')]]={'$like':'%'+_0x1cd82c[_0xf649('0x33')]['filter']+'%'};return _0x16005a;}})});}_0x45457c=_[_0xf649('0x3e')]({},_0x45457c,_0x1cd82c[_0xf649('0x3f')]);var _0x169618={'where':_0x45457c[_0xf649('0x3a')]};return db['ServicenowAccount'][_0xf649('0x1e')](_0x169618)[_0xf649('0x40')](function(_0x206359){_0x381b0a[_0xf649('0x1e')]=_0x206359;if(_0x1cd82c[_0xf649('0x33')][_0xf649('0x41')]){_0x45457c['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xf649('0x42')](_0x45457c);})[_0xf649('0x40')](function(_0x44efbe){_0x381b0a[_0xf649('0x43')]=_0x44efbe;return _0x381b0a;})[_0xf649('0x40')](respondWithFilteredResult(_0x538b40,_0x45457c))[_0xf649('0x44')](handleError(_0x538b40,null));};exports[_0xf649('0x45')]=function(_0x51e821,_0x229323){var _0xe20012={'raw':![],'where':{'id':_0x51e821['params']['id']}},_0x1713b5={};_0x1713b5['model']=_['keys'](db['ServicenowAccount']['rawAttributes']);_0x1713b5['query']=_[_0xf649('0x30')](_0x51e821['query']);_0x1713b5[_0xf649('0x31')]=_[_0xf649('0x32')](_0x1713b5[_0xf649('0x2e')],_0x1713b5[_0xf649('0x33')]);_0xe20012[_0xf649('0x34')]=_[_0xf649('0x32')](_0x1713b5['model'],qs[_0xf649('0x35')](_0x51e821[_0xf649('0x33')]['fields']));_0xe20012['attributes']=_0xe20012[_0xf649('0x34')][_0xf649('0x46')]?_0xe20012[_0xf649('0x34')]:_0x1713b5[_0xf649('0x2e')];if(_0x51e821[_0xf649('0x33')][_0xf649('0x41')]){_0xe20012['include']=[{'all':!![]}];}_0xe20012=_[_0xf649('0x3e')]({},_0xe20012,_0x51e821[_0xf649('0x3f')]);return db[_0xf649('0x29')]['find'](_0xe20012)[_0xf649('0x40')](handleEntityNotFound(_0x229323,null))[_0xf649('0x40')](respondWithResult(_0x229323,null))[_0xf649('0x44')](handleError(_0x229323,null));};exports['create']=function(_0x4d51e0,_0x51cf6c){return db[_0xf649('0x29')][_0xf649('0x47')](_0x4d51e0[_0xf649('0x48')],{})['then'](respondWithResult(_0x51cf6c,0xc9))[_0xf649('0x44')](handleError(_0x51cf6c,null));};exports['update']=function(_0x1e4d3f,_0x3e96a1){if(_0x1e4d3f[_0xf649('0x48')]['id']){delete _0x1e4d3f['body']['id'];}return db[_0xf649('0x29')][_0xf649('0x49')]({'where':{'id':_0x1e4d3f[_0xf649('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e96a1,null))[_0xf649('0x40')](saveUpdates(_0x1e4d3f[_0xf649('0x48')],null))[_0xf649('0x40')](respondWithResult(_0x3e96a1,null))[_0xf649('0x44')](handleError(_0x3e96a1,null));};exports[_0xf649('0x24')]=function(_0x48d94a,_0x2677fe){return db[_0xf649('0x29')][_0xf649('0x49')]({'where':{'id':_0x48d94a[_0xf649('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2677fe,null))[_0xf649('0x40')](removeEntity(_0x2677fe,null))[_0xf649('0x44')](handleError(_0x2677fe,null));};exports['getConfigurations']=function(_0x55f78e,_0x2e11ec,_0x38326c){var _0x593816={};var _0x2a6cdb={};var _0x4ee9ab;var _0x193800;return db[_0xf649('0x29')][_0xf649('0x4b')]({'where':{'id':_0x55f78e[_0xf649('0x4a')]['id']}})[_0xf649('0x40')](handleEntityNotFound(_0x2e11ec,null))[_0xf649('0x40')](function(_0x5865ac){if(_0x5865ac){_0x4ee9ab=_0x5865ac;_0x2a6cdb[_0xf649('0x2e')]=_[_0xf649('0x30')](db[_0xf649('0x4c')][_0xf649('0x2a')]);_0x2a6cdb[_0xf649('0x33')]=_[_0xf649('0x30')](_0x55f78e['query']);_0x2a6cdb['filters']=_['intersection'](_0x2a6cdb[_0xf649('0x2e')],_0x2a6cdb[_0xf649('0x33')]);_0x593816['attributes']=_['intersection'](_0x2a6cdb[_0xf649('0x2e')],qs['fields'](_0x55f78e['query'][_0xf649('0x35')]));_0x593816[_0xf649('0x34')]=_0x593816['attributes'][_0xf649('0x46')]?_0x593816[_0xf649('0x34')]:_0x2a6cdb[_0xf649('0x2e')];_0x593816[_0xf649('0x38')]=qs[_0xf649('0x39')](_0x55f78e[_0xf649('0x33')][_0xf649('0x39')]);_0x593816[_0xf649('0x3a')]=qs[_0xf649('0x31')](_[_0xf649('0x3b')](_0x55f78e[_0xf649('0x33')],_0x2a6cdb[_0xf649('0x31')]));if(_0x55f78e[_0xf649('0x33')][_0xf649('0x3c')]){_0x593816['where']=_[_0xf649('0x3e')](_0x593816[_0xf649('0x3a')],{'$or':_['map'](_0x593816[_0xf649('0x34')],function(_0x197bb8){var _0x10abea={};_0x10abea[_0x197bb8]={'$like':'%'+_0x55f78e[_0xf649('0x33')]['filter']+'%'};return _0x10abea;})});}_0x593816=_['merge']({},_0x593816,_0x55f78e[_0xf649('0x3f')]);return _0x4ee9ab[_0xf649('0x4d')](_0x593816);}})[_0xf649('0x40')](function(_0x4ff7ea){if(_0x4ff7ea){_0x193800=_0x4ff7ea[_0xf649('0x46')];if(!_0x55f78e['query'][_0xf649('0x36')](_0xf649('0x37'))){_0x593816['limit']=qs[_0xf649('0x1d')](_0x55f78e[_0xf649('0x33')][_0xf649('0x1d')]);_0x593816[_0xf649('0x1b')]=qs[_0xf649('0x1b')](_0x55f78e[_0xf649('0x33')][_0xf649('0x1b')]);}return _0x4ee9ab[_0xf649('0x4d')](_0x593816);}})[_0xf649('0x40')](function(_0x8b7572){if(_0x8b7572){return _0x8b7572?{'count':_0x193800,'rows':_0x8b7572}:null;}})[_0xf649('0x40')](respondWithResult(_0x2e11ec,null))[_0xf649('0x44')](handleError(_0x2e11ec,null));};exports['addConfiguration']=function(_0x53b344,_0xe0c657,_0x43ba37){if(_0x53b344[_0xf649('0x48')]['id']){delete _0x53b344[_0xf649('0x48')]['id'];}return db[_0xf649('0x29')][_0xf649('0x4b')]({'where':{'id':_0x53b344[_0xf649('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe0c657,null))[_0xf649('0x40')](function(_0x43669c){if(_0x43669c){_0x53b344['body'][_0xf649('0x4e')]=_0x43669c['id'];_0x53b344['body'][_0xf649('0x4f')]=integrations['getSubjects'](_0x53b344[_0xf649('0x48')]['channel'],_0x53b344[_0xf649('0x48')]['type']);_0x53b344[_0xf649('0x48')]['Descriptions']=integrations['getDescriptions'](_0x53b344['body'][_0xf649('0x50')],_0x53b344[_0xf649('0x48')][_0xf649('0x2c')]);return db[_0xf649('0x4c')][_0xf649('0x47')](_0x53b344['body'],{'include':[{'model':db[_0xf649('0x51')],'as':_0xf649('0x4f')},{'model':db[_0xf649('0x51')],'as':_0xf649('0x52')}]});}return null;})['then'](respondWithResult(_0xe0c657,null))[_0xf649('0x44')](handleError(_0xe0c657,null));};exports[_0xf649('0x53')]=function(_0x31b465,_0x128f1d,_0x131edc){var _0x379bdf=[_0xf649('0x54'),_0xf649('0x55'),'knowledge',_0xf649('0x56'),_0xf649('0x57'),_0xf649('0x58'),_0xf649('0x59'),_0xf649('0x5a'),_0xf649('0x5b')];var _0x9b0ce1=[_0xf649('0x5c'),_0xf649('0x54'),_0xf649('0x5d'),'watch_list',_0xf649('0x5e'),_0xf649('0x5f'),_0xf649('0x60'),_0xf649('0x55'),'approval_history',_0xf649('0x61'),'resolved_by',_0xf649('0x62'),'opened_by',_0xf649('0x63'),_0xf649('0x64'),_0xf649('0x65'),'state',_0xf649('0x66'),_0xf649('0x67'),'order',_0xf649('0x68'),_0xf649('0x69'),_0xf649('0x6a'),_0xf649('0x6b'),_0xf649('0x6c'),_0xf649('0x6d'),_0xf649('0x6e'),_0xf649('0x6f'),'priority',_0xf649('0x70'),_0xf649('0x71'),'time_worked','expected_start','opened_at',_0xf649('0x72'),_0xf649('0x73'),_0xf649('0x74'),'reopened_time',_0xf649('0x75'),_0xf649('0x76'),_0xf649('0x77'),'subcategory',_0xf649('0x78'),_0xf649('0x79'),_0xf649('0x57'),'correlation_display','delivery_task','work_start',_0xf649('0x7a'),_0xf649('0x7b'),_0xf649('0x7c'),_0xf649('0x7d'),_0xf649('0x7e'),'notify',_0xf649('0x7f'),_0xf649('0x80'),'closed_by',_0xf649('0x81'),_0xf649('0x82'),_0xf649('0x83'),'contact_type','reopened_by',_0xf649('0x59'),_0xf649('0x84'),_0xf649('0x85'),_0xf649('0x86'),_0xf649('0x87'),_0xf649('0x88'),_0xf649('0x89'),_0xf649('0x5a'),'comments',_0xf649('0x8a'),'approval',_0xf649('0x8b'),_0xf649('0x8c'),'sys_mod_count',_0xf649('0x8d'),_0xf649('0x8e'),_0xf649('0x8f'),_0xf649('0x90'),_0xf649('0x91'),_0xf649('0x92'),_0xf649('0x5b')];var _0x55f27a='';var _0x4206b6='';var _0x2db70d=[];var _0x2f9552='';var _0x390018='';var _0x5abded=[];var _0x1108a6='';var _0x2ed738='';var _0x2060bc={};var _0x576990='';return db[_0xf649('0x29')][_0xf649('0x4b')]({'where':{'id':_0x31b465[_0xf649('0x4a')]['id']},'attributes':['id','username',_0xf649('0x93'),_0xf649('0x94'),'remoteUri',_0xf649('0x95')]})['then'](handleEntityNotFound(_0x128f1d,null))['then'](function(_0x212707){if(_0x212707){_0x576990=_0x212707[_0xf649('0x96')];var _0x222f35=_0x576990['slice'](-0x1);if(_0x222f35==='/'){_0x576990=_0x576990[_0xf649('0x97')](0x0,_0x576990['lastIndexOf'](_0x222f35));}_0x2ed738=util[_0xf649('0x98')](_0xf649('0x99'),_0x576990);_0x1108a6=util[_0xf649('0x98')](_0xf649('0x9a'),_0x576990);_0x2060bc={'user':_0x212707[_0xf649('0x9b')],'pass':_0x212707[_0xf649('0x93')]};var _0x1e59f7={'method':_0xf649('0x9c'),'uri':_0x2ed738+_0xf649('0x9d'),'auth':_0x2060bc,'json':!![]};return rp(_0x1e59f7);}})['then'](function(_0x4e5fbd){if(_0x4e5fbd[_0xf649('0x9e')]['length']>0x0){_0x55f27a=_0x4e5fbd['result'];}console[_0xf649('0x9f')](_0xf649('0xa0'),_0x55f27a);_0x5abded=[];_0x4206b6=Object[_0xf649('0xa1')]([],_0x55f27a);_[_0xf649('0xa2')](_0x4206b6,function(_0x46738a){return!_0x379bdf[_0xf649('0xa3')](_0x46738a[_0xf649('0x2f')]);});_0x4206b6['forEach'](function(_0x2858e6){var _0x366bd7=createFieldObject(_0x1108a6,_0x2060bc,_0x2858e6[_0xf649('0xa4')],_0x2858e6['name'],_0x2858e6[_0xf649('0xa5')],![]);_0x5abded['push'](_0x366bd7);});return Promise[_0xf649('0xa6')](_0x5abded);})[_0xf649('0x40')](function(_0x2aff86){_0x2db70d=_0x2aff86;_0x2f9552=Object[_0xf649('0xa1')]([],_0x55f27a);console[_0xf649('0x9f')](_0xf649('0xa7'),_0x55f27a);_[_0xf649('0xa2')](_0x2f9552,function(_0xfb5194){return _0x9b0ce1['includes'](_0xfb5194[_0xf649('0x2f')]);});console[_0xf649('0x9f')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2f9552);_0x5abded=[];_0x2f9552[_0xf649('0xa8')](function(_0x4d3929){var _0x532bea=createFieldObject(_0x1108a6,_0x2060bc,_0x4d3929[_0xf649('0xa4')],_0x4d3929[_0xf649('0x2f')],_0x4d3929[_0xf649('0xa5')],!![]);_0x5abded[_0xf649('0xa9')](_0x532bea);});return Promise['all'](_0x5abded);})[_0xf649('0x40')](function(_0x6871a3){_0x390018=_0x6871a3;var _0x1faadf=_0x2db70d[_0xf649('0xaa')](_0x390018);return{'count':_0x1faadf[_0xf649('0x46')],'rows':_0x1faadf};})['then'](respondWithResult(_0x128f1d,null))[_0xf649('0x44')](function(_0x5b2d5d){console['log'](_0xf649('0xab')+_0x5b2d5d);var _0x38b827=_0x31b465[_0xf649('0x33')][_0xf649('0xac')]?0x1f4:_0x5b2d5d[_0xf649('0xad')]||0x1f4;logger[_0xf649('0x25')](_0x5b2d5d[_0xf649('0xae')]);delete _0x5b2d5d['name'];if(_0x38b827===0x191){_0x38b827=0x190;}_0x128f1d[_0xf649('0x19')](_0x38b827)[_0xf649('0x26')](_0x31b465[_0xf649('0x33')]['test']?{'message':_0xf649('0xaf'),'statusCode':_0x5b2d5d['statusCode']}:_0x5b2d5d);});};function createFieldObject(_0x215c1c,_0x4289c4,_0xd65d98,_0x1f938a,_0x282acc,_0x9f1581){return new Promise(function(_0x516a2e,_0x10ea92){var _0x4afd88={'id':_0x1f938a,'name':_0x282acc,'custom':_0x9f1581};if(_0xd65d98===_0xf649('0xb0')){_0x4afd88['options']=[{'name':_0xf649('0xb1'),'value':_0xf649('0xb2')},{'name':'False','value':_0xf649('0xb3')}];_0x516a2e(_0x4afd88);}else{var _0x5dbb8d={'method':'GET','uri':_0x215c1c+_0xf649('0xb4')+_0x1f938a,'auth':_0x4289c4,'json':!![]};return rp(_0x5dbb8d)[_0xf649('0x40')](function(_0x2b9bcb){var _0x39b4a8=[];if(_0x2b9bcb[_0xf649('0x9e')][_0xf649('0x46')]>0x0){_0x2b9bcb[_0xf649('0x9e')][_0xf649('0xa8')](function(_0x507872){if(_0x507872[_0xf649('0xb5')]===_0xf649('0xb3')){var _0x107b46={'name':_0x507872[_0xf649('0xa5')],'value':_0x507872[_0xf649('0xb6')]};_0x39b4a8[_0xf649('0xa9')](_0x107b46);}});}_0x4afd88['options']=_0x39b4a8;if(_0x4afd88['options'][_0xf649('0x46')]>0x0){_0x516a2e(_0x4afd88);}else{if(_0x9f1581==![]){_0x516a2e();}else{_0x516a2e(_0x4afd88);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 6366c81..f045d18 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 _0x7c09=['rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5d386b,_0x352e3f){var _0xdfc622=function(_0xad5ee7){while(--_0xad5ee7){_0x5d386b['push'](_0x5d386b['shift']());}};_0xdfc622(++_0x352e3f);}(_0x7c09,0x102));var _0x97c0=function(_0x5916ec,_0x298be5){_0x5916ec=_0x5916ec-0x0;var _0x40cd74=_0x7c09[_0x5916ec];return _0x40cd74;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x590368,_0x46fdd9){return _0x590368[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc97=['request-promise','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash','util','../../config/logger','moment'];(function(_0xfb7437,_0x205a6d){var _0x1d27eb=function(_0x344fca){while(--_0x344fca){_0xfb7437['push'](_0xfb7437['shift']());}};_0x1d27eb(++_0x205a6d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x220812,_0x3b315d){_0x220812=_0x220812-0x0;var _0x366914=_0xdc97[_0x220812];return _0x366914;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));var integrations=require(_0x7dc9('0x8'));module[_0x7dc9('0x9')]=function(_0x589f02,_0x2636ef){return _0x589f02['define']('ServicenowAccount',attributes,{'tableName':_0x7dc9('0xa'),'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 9531a58..c8bf33c 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 _0xc1c3=['model','GetServicenowAccount','ShowServicenowAccount','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ServicenowAccount','findAll','options','raw','where','limit','include','attributes','map'];(function(_0x37c877,_0x4cdb7f){var _0x13b2cc=function(_0x4c40db){while(--_0x4c40db){_0x37c877['push'](_0x37c877['shift']());}};_0x13b2cc(++_0x4cdb7f);}(_0xc1c3,0xbd));var _0x3c1c=function(_0x37878c,_0x595f2b){_0x37878c=_0x37878c-0x0;var _0x5e7e1e=_0xc1c3[_0x37878c];return _0x5e7e1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3c1c('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c1c('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c1c('0x2'));var logger=require(_0x3c1c('0x3'))(_0x3c1c('0x4'));var config=require(_0x3c1c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3c1c('0x6')][_0x3c1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a10cd,_0x45f4a9,_0x48996b){return new BPromise(function(_0x327d22,_0x266356){return client[_0x3c1c('0x8')](_0x3a10cd,_0x48996b)[_0x3c1c('0x9')](function(_0x455f65){logger[_0x3c1c('0xa')](_0x3c1c('0xb'),_0x45f4a9,_0x3c1c('0xc'));logger[_0x3c1c('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x45f4a9,_0x3c1c('0xc'),JSON[_0x3c1c('0xe')](_0x455f65));if(_0x455f65[_0x3c1c('0xf')]){if(_0x455f65[_0x3c1c('0xf')]['code']===0x1f4){logger[_0x3c1c('0xf')](_0x3c1c('0xb'),_0x45f4a9,_0x455f65['error'][_0x3c1c('0x10')]);return _0x266356(_0x455f65[_0x3c1c('0xf')][_0x3c1c('0x10')]);}logger['error'](_0x3c1c('0xb'),_0x45f4a9,_0x455f65['error'][_0x3c1c('0x10')]);return _0x327d22(_0x455f65[_0x3c1c('0xf')][_0x3c1c('0x10')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x45f4a9,'request\x20sent');_0x327d22(_0x455f65[_0x3c1c('0x11')][_0x3c1c('0x10')]);}})[_0x3c1c('0x12')](function(_0x5a2efe){logger[_0x3c1c('0xf')](_0x3c1c('0xb'),_0x45f4a9,_0x5a2efe);_0x266356(_0x5a2efe);});});}exports['GetServicenowAccount']=function(_0x949d53){var _0x35a0b9=this;return new Promise(function(_0x29ca97,_0x3715a3){return db[_0x3c1c('0x13')][_0x3c1c('0x14')]({'raw':_0x949d53[_0x3c1c('0x15')]?_0x949d53[_0x3c1c('0x15')][_0x3c1c('0x16')]===undefined?!![]:![]:!![],'where':_0x949d53[_0x3c1c('0x15')]?_0x949d53['options'][_0x3c1c('0x17')]||null:null,'attributes':_0x949d53['options']?_0x949d53['options']['attributes']||null:null,'limit':_0x949d53[_0x3c1c('0x15')]?_0x949d53[_0x3c1c('0x15')][_0x3c1c('0x18')]||null:null,'include':_0x949d53[_0x3c1c('0x15')]?_0x949d53[_0x3c1c('0x15')][_0x3c1c('0x19')]?_['map'](_0x949d53[_0x3c1c('0x15')][_0x3c1c('0x19')],function(_0x572fed){return{'model':db[_0x572fed['model']],'as':_0x572fed['as'],'attributes':_0x572fed[_0x3c1c('0x1a')],'include':_0x572fed[_0x3c1c('0x19')]?_[_0x3c1c('0x1b')](_0x572fed[_0x3c1c('0x19')],function(_0x5a0c3f){return{'model':db[_0x5a0c3f[_0x3c1c('0x1c')]],'as':_0x5a0c3f['as'],'attributes':_0x5a0c3f['attributes'],'include':_0x5a0c3f[_0x3c1c('0x19')]?_['map'](_0x5a0c3f[_0x3c1c('0x19')],function(_0x2b824c){return{'model':db[_0x2b824c['model']],'as':_0x2b824c['as'],'attributes':_0x2b824c[_0x3c1c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3c1c('0x9')](function(_0xa4b690){logger['info'](_0x3c1c('0x1d'),_0x949d53);logger['debug'](_0x3c1c('0x1d'),_0x949d53,JSON[_0x3c1c('0xe')](_0xa4b690));_0x29ca97(_0xa4b690);})[_0x3c1c('0x12')](function(_0x362392){logger[_0x3c1c('0xf')](_0x3c1c('0x1d'),_0x362392[_0x3c1c('0x10')],_0x949d53);_0x3715a3(_0x35a0b9[_0x3c1c('0xf')](0x1f4,_0x362392[_0x3c1c('0x10')]));});});};exports[_0x3c1c('0x1e')]=function(_0x5aae41){var _0x398c39=this;return new Promise(function(_0x3023ee,_0x46a551){return db[_0x3c1c('0x13')]['find']({'raw':_0x5aae41[_0x3c1c('0x15')]?_0x5aae41[_0x3c1c('0x15')][_0x3c1c('0x16')]===undefined?!![]:![]:!![],'where':_0x5aae41[_0x3c1c('0x15')]?_0x5aae41['options'][_0x3c1c('0x17')]||null:null,'attributes':_0x5aae41[_0x3c1c('0x15')]?_0x5aae41[_0x3c1c('0x15')][_0x3c1c('0x1a')]||null:null,'include':_0x5aae41[_0x3c1c('0x15')]?_0x5aae41[_0x3c1c('0x15')][_0x3c1c('0x19')]?_[_0x3c1c('0x1b')](_0x5aae41[_0x3c1c('0x15')][_0x3c1c('0x19')],function(_0xee7502){return{'model':db[_0xee7502[_0x3c1c('0x1c')]],'as':_0xee7502['as'],'attributes':_0xee7502[_0x3c1c('0x1a')],'include':_0xee7502[_0x3c1c('0x19')]?_[_0x3c1c('0x1b')](_0xee7502[_0x3c1c('0x19')],function(_0x475cee){return{'model':db[_0x475cee['model']],'as':_0x475cee['as'],'attributes':_0x475cee['attributes'],'include':_0x475cee['include']?_[_0x3c1c('0x1b')](_0x475cee[_0x3c1c('0x19')],function(_0x106f66){return{'model':db[_0x106f66[_0x3c1c('0x1c')]],'as':_0x106f66['as'],'attributes':_0x106f66[_0x3c1c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3c1c('0x9')](function(_0x52b421){logger[_0x3c1c('0xa')](_0x3c1c('0x1e'),_0x5aae41);logger['debug'](_0x3c1c('0x1e'),_0x5aae41,JSON[_0x3c1c('0xe')](_0x52b421));_0x3023ee(_0x52b421);})[_0x3c1c('0x12')](function(_0x4223fc){logger[_0x3c1c('0xf')](_0x3c1c('0x1e'),_0x4223fc[_0x3c1c('0x10')],_0x5aae41);_0x46a551(_0x398c39[_0x3c1c('0xf')](0x1f4,_0x4223fc[_0x3c1c('0x10')]));});});}; \ No newline at end of file +var _0x0053=['debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','GetServicenowAccount','stringify','ShowServicenowAccount','find','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2b3875,_0x36d558){var _0x4e5b5c=function(_0x4f04b6){while(--_0x4f04b6){_0x2b3875['push'](_0x2b3875['shift']());}};_0x4e5b5c(++_0x36d558);}(_0x0053,0x15f));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3005('0x0'));var util=require('util');var moment=require(_0x3005('0x1'));var BPromise=require(_0x3005('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3005('0x3'));var db=require(_0x3005('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3005('0x5'))('rpc');var config=require(_0x3005('0x6'));var jayson=require(_0x3005('0x7'));var client=jayson[_0x3005('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x360807,_0x1fb543,_0x1d7594){return new BPromise(function(_0x2df68b,_0x3de721){return client['request'](_0x360807,_0x1d7594)[_0x3005('0x9')](function(_0x20def4){logger['info'](_0x3005('0xa'),_0x1fb543,_0x3005('0xb'));logger[_0x3005('0xc')](_0x3005('0xd'),_0x1fb543,_0x3005('0xb'),JSON['stringify'](_0x20def4));if(_0x20def4[_0x3005('0xe')]){if(_0x20def4['error'][_0x3005('0xf')]===0x1f4){logger[_0x3005('0xe')](_0x3005('0xa'),_0x1fb543,_0x20def4[_0x3005('0xe')][_0x3005('0x10')]);return _0x3de721(_0x20def4['error'][_0x3005('0x10')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1fb543,_0x20def4[_0x3005('0xe')][_0x3005('0x10')]);return _0x2df68b(_0x20def4[_0x3005('0xe')][_0x3005('0x10')]);}else{logger[_0x3005('0x11')](_0x3005('0xa'),_0x1fb543,_0x3005('0xb'));_0x2df68b(_0x20def4[_0x3005('0x12')]['message']);}})['catch'](function(_0x2f40b1){logger['error'](_0x3005('0xa'),_0x1fb543,_0x2f40b1);_0x3de721(_0x2f40b1);});});}exports['GetServicenowAccount']=function(_0xe21ebe){var _0x1ee853=this;return new Promise(function(_0x4d78b0,_0x45ac4c){return db[_0x3005('0x13')]['findAll']({'raw':_0xe21ebe[_0x3005('0x14')]?_0xe21ebe[_0x3005('0x14')][_0x3005('0x15')]===undefined?!![]:![]:!![],'where':_0xe21ebe[_0x3005('0x14')]?_0xe21ebe[_0x3005('0x14')][_0x3005('0x16')]||null:null,'attributes':_0xe21ebe[_0x3005('0x14')]?_0xe21ebe[_0x3005('0x14')][_0x3005('0x17')]||null:null,'limit':_0xe21ebe['options']?_0xe21ebe[_0x3005('0x14')][_0x3005('0x18')]||null:null,'include':_0xe21ebe[_0x3005('0x14')]?_0xe21ebe[_0x3005('0x14')][_0x3005('0x19')]?_['map'](_0xe21ebe[_0x3005('0x14')]['include'],function(_0x5e82b7){return{'model':db[_0x5e82b7[_0x3005('0x1a')]],'as':_0x5e82b7['as'],'attributes':_0x5e82b7[_0x3005('0x17')],'include':_0x5e82b7[_0x3005('0x19')]?_[_0x3005('0x1b')](_0x5e82b7[_0x3005('0x19')],function(_0x185826){return{'model':db[_0x185826[_0x3005('0x1a')]],'as':_0x185826['as'],'attributes':_0x185826[_0x3005('0x17')],'include':_0x185826[_0x3005('0x19')]?_[_0x3005('0x1b')](_0x185826['include'],function(_0x33cca0){return{'model':db[_0x33cca0[_0x3005('0x1a')]],'as':_0x33cca0['as'],'attributes':_0x33cca0[_0x3005('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3005('0x9')](function(_0x72abb7){logger[_0x3005('0x11')](_0x3005('0x1c'),_0xe21ebe);logger[_0x3005('0xc')](_0x3005('0x1c'),_0xe21ebe,JSON[_0x3005('0x1d')](_0x72abb7));_0x4d78b0(_0x72abb7);})['catch'](function(_0x41ff4d){logger[_0x3005('0xe')]('GetServicenowAccount',_0x41ff4d[_0x3005('0x10')],_0xe21ebe);_0x45ac4c(_0x1ee853[_0x3005('0xe')](0x1f4,_0x41ff4d['message']));});});};exports[_0x3005('0x1e')]=function(_0x513797){var _0x1eb600=this;return new Promise(function(_0x269039,_0x149028){return db[_0x3005('0x13')][_0x3005('0x1f')]({'raw':_0x513797[_0x3005('0x14')]?_0x513797[_0x3005('0x14')][_0x3005('0x15')]===undefined?!![]:![]:!![],'where':_0x513797[_0x3005('0x14')]?_0x513797[_0x3005('0x14')][_0x3005('0x16')]||null:null,'attributes':_0x513797[_0x3005('0x14')]?_0x513797['options']['attributes']||null:null,'include':_0x513797['options']?_0x513797[_0x3005('0x14')]['include']?_[_0x3005('0x1b')](_0x513797['options'][_0x3005('0x19')],function(_0x36aca8){return{'model':db[_0x36aca8[_0x3005('0x1a')]],'as':_0x36aca8['as'],'attributes':_0x36aca8[_0x3005('0x17')],'include':_0x36aca8[_0x3005('0x19')]?_['map'](_0x36aca8[_0x3005('0x19')],function(_0x33e891){return{'model':db[_0x33e891['model']],'as':_0x33e891['as'],'attributes':_0x33e891['attributes'],'include':_0x33e891[_0x3005('0x19')]?_[_0x3005('0x1b')](_0x33e891[_0x3005('0x19')],function(_0x4a7a5c){return{'model':db[_0x4a7a5c[_0x3005('0x1a')]],'as':_0x4a7a5c['as'],'attributes':_0x4a7a5c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x364206){logger[_0x3005('0x11')](_0x3005('0x1e'),_0x513797);logger['debug'](_0x3005('0x1e'),_0x513797,JSON[_0x3005('0x1d')](_0x364206));_0x269039(_0x364206);})[_0x3005('0x20')](function(_0x101341){logger[_0x3005('0xe')](_0x3005('0x1e'),_0x101341[_0x3005('0x10')],_0x513797);_0x149028(_0x1eb600['error'](0x1f4,_0x101341[_0x3005('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f5bbda5..57643cc 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 _0xa87d=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id'];(function(_0x484d8a,_0x152f58){var _0x1ea628=function(_0x248ace){while(--_0x248ace){_0x484d8a['push'](_0x484d8a['shift']());}};_0x1ea628(++_0x152f58);}(_0xa87d,0xc3));var _0xda87=function(_0x3262f1,_0x4f34f8){_0x3262f1=_0x3262f1-0x0;var _0x333c52=_0xa87d[_0x3262f1];return _0x333c52;};'use strict';var multer=require(_0xda87('0x0'));var util=require(_0xda87('0x1'));var path=require(_0xda87('0x2'));var timeout=require(_0xda87('0x3'));var express=require('express');var router=express[_0xda87('0x4')]();var fs_extra=require(_0xda87('0x5'));var auth=require(_0xda87('0x6'));var interaction=require(_0xda87('0x7'));var config=require(_0xda87('0x8'));var controller=require(_0xda87('0x9'));router[_0xda87('0xa')]('/',auth['isAuthenticated'](),controller[_0xda87('0xb')]);router[_0xda87('0xa')](_0xda87('0xc'),auth[_0xda87('0xd')](),controller[_0xda87('0xe')]);router['get'](_0xda87('0xf'),auth[_0xda87('0xd')](),controller[_0xda87('0x10')]);router[_0xda87('0xa')](_0xda87('0x11'),auth[_0xda87('0xd')](),controller[_0xda87('0x12')]);router[_0xda87('0xa')](_0xda87('0x13'),auth['isAuthenticated'](),controller[_0xda87('0x14')]);router[_0xda87('0x15')]('/',auth['isAuthenticated'](),controller[_0xda87('0x16')]);router['put'](_0xda87('0xc'),auth[_0xda87('0xd')](),controller[_0xda87('0x17')]);router[_0xda87('0x18')](_0xda87('0xc'),auth[_0xda87('0xd')](),controller[_0xda87('0x19')]);module['exports']=router; \ No newline at end of file +var _0xa329=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','create'];(function(_0x3e3944,_0x789cda){var _0x42aa47=function(_0x362468){while(--_0x362468){_0x3e3944['push'](_0x3e3944['shift']());}};_0x42aa47(++_0x789cda);}(_0xa329,0xe6));var _0x9a32=function(_0x2e0763,_0x37e6e4){_0x2e0763=_0x2e0763-0x0;var _0x189643=_0xa329[_0x2e0763];return _0x189643;};'use strict';var multer=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var path=require(_0x9a32('0x2'));var timeout=require(_0x9a32('0x3'));var express=require(_0x9a32('0x4'));var router=express[_0x9a32('0x5')]();var fs_extra=require(_0x9a32('0x6'));var auth=require(_0x9a32('0x7'));var interaction=require(_0x9a32('0x8'));var config=require(_0x9a32('0x9'));var controller=require(_0x9a32('0xa'));router[_0x9a32('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9a32('0xc'),auth[_0x9a32('0xd')](),controller[_0x9a32('0xe')]);router[_0x9a32('0xb')](_0x9a32('0xf'),auth[_0x9a32('0xd')](),controller['getFields']);router[_0x9a32('0xb')](_0x9a32('0x10'),auth[_0x9a32('0xd')](),controller[_0x9a32('0x11')]);router[_0x9a32('0xb')]('/:id/descriptions',auth[_0x9a32('0xd')](),controller[_0x9a32('0x12')]);router['post']('/',auth[_0x9a32('0xd')](),controller[_0x9a32('0x13')]);router[_0x9a32('0x14')]('/:id',auth[_0x9a32('0xd')](),controller[_0x9a32('0x15')]);router[_0x9a32('0x16')](_0x9a32('0xc'),auth[_0x9a32('0xd')](),controller[_0x9a32('0x17')]);module[_0x9a32('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index daef935..6d217e0 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 _0x056b=['STRING','sequelize','exports'];(function(_0x46012c,_0x66bacf){var _0x26d30f=function(_0x3a281a){while(--_0x3a281a){_0x46012c['push'](_0x46012c['shift']());}};_0x26d30f(++_0x66bacf);}(_0x056b,0x166));var _0xb056=function(_0x2b9f6f,_0x132d97){_0x2b9f6f=_0x2b9f6f-0x0;var _0x2bc9f8=_0x056b[_0x2b9f6f];return _0x2bc9f8;};'use strict';var Sequelize=require(_0xb056('0x0'));module[_0xb056('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb056('0x2')]}}; \ No newline at end of file +var _0x35e4=['exports','STRING','sequelize'];(function(_0x4bbb86,_0x385744){var _0x2cf22b=function(_0x4b5494){while(--_0x4b5494){_0x4bbb86['push'](_0x4bbb86['shift']());}};_0x2cf22b(++_0x385744);}(_0x35e4,0x1e2));var _0x435e=function(_0x12fae3,_0x2e851d){_0x12fae3=_0x12fae3-0x0;var _0x16dda4=_0x35e4[_0x12fae3];return _0x16dda4;};'use strict';var Sequelize=require(_0x435e('0x0'));module[_0x435e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x435e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 529c2a4..79c2666 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 _0x566d=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','ServicenowConfiguration','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','find','create','body','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel'];(function(_0x57723e,_0x5e5202){var _0x2d9479=function(_0x59a361){while(--_0x59a361){_0x57723e['push'](_0x57723e['shift']());}};_0x2d9479(++_0x5e5202);}(_0x566d,0xdf));var _0xd566=function(_0x547315,_0x1c1060){_0x547315=_0x547315-0x0;var _0x181b1f=_0x566d[_0x547315];return _0x181b1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd566('0x0'));var zipdir=require(_0xd566('0x1'));var jsonpatch=require(_0xd566('0x2'));var rp=require('request-promise');var moment=require(_0xd566('0x3'));var BPromise=require(_0xd566('0x4'));var Mustache=require(_0xd566('0x5'));var util=require(_0xd566('0x6'));var path=require('path');var sox=require(_0xd566('0x7'));var csv=require(_0xd566('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd566('0x9'));var _=require('lodash');var squel=require(_0xd566('0xa'));var crypto=require(_0xd566('0xb'));var jsforce=require(_0xd566('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd566('0x8'));var querystring=require(_0xd566('0xd'));var Papa=require(_0xd566('0xe'));var Redis=require(_0xd566('0xf'));var authService=require(_0xd566('0x10'));var qs=require(_0xd566('0x11'));var as=require(_0xd566('0x12'));var hardwareService=require(_0xd566('0x13'));var logger=require(_0xd566('0x14'))(_0xd566('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x316286,_0x217419){_0x217419=_0x217419||0xcc;return function(_0x2747e2){if(_0x2747e2){return _0x316286[_0xd566('0x16')](_0x217419);}return _0x316286['status'](_0x217419)[_0xd566('0x17')]();};}function respondWithResult(_0x2db0cb,_0x44003f){_0x44003f=_0x44003f||0xc8;return function(_0x4adf73){if(_0x4adf73){return _0x2db0cb[_0xd566('0x18')](_0x44003f)['json'](_0x4adf73);}};}function respondWithFilteredResult(_0x709ca9,_0x16eeb7){return function(_0xf589ef){if(_0xf589ef){var _0x29fb4b=typeof _0x16eeb7['offset']===_0xd566('0x19')&&typeof _0x16eeb7[_0xd566('0x1a')]===_0xd566('0x19');var _0x6df672=_0xf589ef[_0xd566('0x1b')];var _0x574036=_0x29fb4b?0x0:_0x16eeb7['offset'];var _0x5e5e8e=_0x29fb4b?_0xf589ef[_0xd566('0x1b')]:_0x16eeb7[_0xd566('0x1c')]+_0x16eeb7[_0xd566('0x1a')];var _0x3246c4;if(_0x5e5e8e>=_0x6df672){_0x5e5e8e=_0x6df672;_0x3246c4=0xc8;}else{_0x3246c4=0xce;}_0x709ca9[_0xd566('0x18')](_0x3246c4);return _0x709ca9['set'](_0xd566('0x1d'),_0x574036+'-'+_0x5e5e8e+'/'+_0x6df672)[_0xd566('0x1e')](_0xf589ef);}return null;};}function patchUpdates(_0x48e603){return function(_0x30290f){try{jsonpatch[_0xd566('0x1f')](_0x30290f,_0x48e603,!![]);}catch(_0x2a3ae4){return BPromise[_0xd566('0x20')](_0x2a3ae4);}return _0x30290f[_0xd566('0x21')]();};}function saveUpdates(_0xc2191c,_0x5c5bc8){return function(_0x13343c){if(_0x13343c){return _0x13343c[_0xd566('0x22')](_0xc2191c)[_0xd566('0x23')](function(_0x1c8b18){return _0x1c8b18;});}return null;};}function removeEntity(_0x1ad043,_0x51b09b){return function(_0x1e910d){if(_0x1e910d){return _0x1e910d[_0xd566('0x24')]()[_0xd566('0x23')](function(){_0x1ad043[_0xd566('0x18')](0xcc)[_0xd566('0x17')]();});}};}function handleEntityNotFound(_0x151bc1,_0x2ef10d){return function(_0x312012){if(!_0x312012){_0x151bc1[_0xd566('0x16')](0x194);}return _0x312012;};}function handleError(_0x16176a,_0x4c53ba){_0x4c53ba=_0x4c53ba||0x1f4;return function(_0x3570f6){logger[_0xd566('0x25')](_0x3570f6[_0xd566('0x26')]);if(_0x3570f6[_0xd566('0x27')]){delete _0x3570f6[_0xd566('0x27')];}_0x16176a[_0xd566('0x18')](_0x4c53ba)[_0xd566('0x28')](_0x3570f6);};}exports[_0xd566('0x29')]=function(_0x14153d,_0x2545ba){var _0x37e447={},_0x3e8089={},_0x4ef3a6={'count':0x0,'rows':[]};var _0x2eb109=_[_0xd566('0x2a')](db['ServicenowConfiguration']['rawAttributes'],function(_0x2bd9c5){return{'name':_0x2bd9c5['fieldName'],'type':_0x2bd9c5[_0xd566('0x2b')]['key']};});_0x3e8089[_0xd566('0x2c')]=_[_0xd566('0x2a')](_0x2eb109,_0xd566('0x27'));_0x3e8089[_0xd566('0x2d')]=_['keys'](_0x14153d[_0xd566('0x2d')]);_0x3e8089[_0xd566('0x2e')]=_[_0xd566('0x2f')](_0x3e8089[_0xd566('0x2c')],_0x3e8089[_0xd566('0x2d')]);_0x37e447['attributes']=_[_0xd566('0x2f')](_0x3e8089[_0xd566('0x2c')],qs[_0xd566('0x30')](_0x14153d['query'][_0xd566('0x30')]));_0x37e447[_0xd566('0x31')]=_0x37e447['attributes'][_0xd566('0x32')]?_0x37e447[_0xd566('0x31')]:_0x3e8089['model'];if(!_0x14153d[_0xd566('0x2d')]['hasOwnProperty'](_0xd566('0x33'))){_0x37e447['limit']=qs[_0xd566('0x1a')](_0x14153d[_0xd566('0x2d')][_0xd566('0x1a')]);_0x37e447[_0xd566('0x1c')]=qs[_0xd566('0x1c')](_0x14153d['query'][_0xd566('0x1c')]);}_0x37e447[_0xd566('0x34')]=qs['sort'](_0x14153d[_0xd566('0x2d')][_0xd566('0x35')]);_0x37e447['where']=qs[_0xd566('0x2e')](_[_0xd566('0x36')](_0x14153d[_0xd566('0x2d')],_0x3e8089[_0xd566('0x2e')]),_0x2eb109);if(_0x14153d['query'][_0xd566('0x37')]){_0x37e447['where']=_[_0xd566('0x38')](_0x37e447[_0xd566('0x39')],{'$or':_[_0xd566('0x2a')](_0x2eb109,function(_0x38391a){if(_0x38391a['type']!==_0xd566('0x3a')){var _0x2ed5e9={};_0x2ed5e9[_0x38391a[_0xd566('0x27')]]={'$like':'%'+_0x14153d[_0xd566('0x2d')][_0xd566('0x37')]+'%'};return _0x2ed5e9;}})});}_0x37e447=_[_0xd566('0x38')]({},_0x37e447,_0x14153d['options']);var _0x423cd7={'where':_0x37e447[_0xd566('0x39')]};return db[_0xd566('0x3b')][_0xd566('0x1b')](_0x423cd7)[_0xd566('0x23')](function(_0x11f310){_0x4ef3a6[_0xd566('0x1b')]=_0x11f310;if(_0x14153d[_0xd566('0x2d')][_0xd566('0x3c')]){_0x37e447[_0xd566('0x3d')]=[{'all':!![]}];}return db[_0xd566('0x3b')]['findAll'](_0x37e447);})[_0xd566('0x23')](function(_0x4680b3){_0x4ef3a6[_0xd566('0x3e')]=_0x4680b3;return _0x4ef3a6;})[_0xd566('0x23')](respondWithFilteredResult(_0x2545ba,_0x37e447))[_0xd566('0x3f')](handleError(_0x2545ba,null));};exports[_0xd566('0x40')]=function(_0x11e3ad,_0x21e53d){var _0x5541e7={'raw':![],'where':{'id':_0x11e3ad[_0xd566('0x41')]['id']}},_0xecbedd={};_0xecbedd[_0xd566('0x2c')]=_[_0xd566('0x42')](db[_0xd566('0x3b')][_0xd566('0x43')]);_0xecbedd['query']=_[_0xd566('0x42')](_0x11e3ad[_0xd566('0x2d')]);_0xecbedd[_0xd566('0x2e')]=_[_0xd566('0x2f')](_0xecbedd[_0xd566('0x2c')],_0xecbedd[_0xd566('0x2d')]);_0x5541e7[_0xd566('0x31')]=_[_0xd566('0x2f')](_0xecbedd[_0xd566('0x2c')],qs[_0xd566('0x30')](_0x11e3ad['query'][_0xd566('0x30')]));_0x5541e7[_0xd566('0x31')]=_0x5541e7['attributes'][_0xd566('0x32')]?_0x5541e7[_0xd566('0x31')]:_0xecbedd[_0xd566('0x2c')];if(_0x11e3ad[_0xd566('0x2d')][_0xd566('0x3c')]){_0x5541e7[_0xd566('0x3d')]=[{'all':!![]}];}_0x5541e7=_['merge']({},_0x5541e7,_0x11e3ad[_0xd566('0x44')]);return db[_0xd566('0x3b')][_0xd566('0x45')](_0x5541e7)[_0xd566('0x23')](handleEntityNotFound(_0x21e53d,null))['then'](respondWithResult(_0x21e53d,null))[_0xd566('0x3f')](handleError(_0x21e53d,null));};exports['create']=function(_0x5c20f4,_0x4fd794){return db['ServicenowConfiguration'][_0xd566('0x46')](_0x5c20f4['body'],{})['then'](respondWithResult(_0x4fd794,0xc9))['catch'](handleError(_0x4fd794,null));};exports[_0xd566('0x22')]=function(_0x4dcd50,_0x21e1bc){if(_0x4dcd50[_0xd566('0x47')]['id']){delete _0x4dcd50[_0xd566('0x47')]['id'];}return db[_0xd566('0x3b')][_0xd566('0x45')]({'where':{'id':_0x4dcd50[_0xd566('0x41')]['id']}})[_0xd566('0x23')](handleEntityNotFound(_0x21e1bc,null))[_0xd566('0x23')](saveUpdates(_0x4dcd50[_0xd566('0x47')],null))[_0xd566('0x23')](respondWithResult(_0x21e1bc,null))['catch'](handleError(_0x21e1bc,null));};exports[_0xd566('0x24')]=function(_0x2bf60b,_0x388094){return db[_0xd566('0x3b')][_0xd566('0x45')]({'where':{'id':_0x2bf60b[_0xd566('0x41')]['id']}})[_0xd566('0x23')](handleEntityNotFound(_0x388094,null))[_0xd566('0x23')](removeEntity(_0x388094,null))[_0xd566('0x3f')](handleError(_0x388094,null));};exports[_0xd566('0x48')]=function(_0x186f25,_0x29d2c0,_0x56035f){var _0x4b1d81={};var _0x56524f={};var _0x3bdc09;var _0x53836a;return db[_0xd566('0x3b')][_0xd566('0x49')]({'where':{'id':_0x186f25[_0xd566('0x41')]['id']}})[_0xd566('0x23')](handleEntityNotFound(_0x29d2c0,null))[_0xd566('0x23')](function(_0x4140af){if(_0x4140af){_0x3bdc09=_0x4140af;_0x56524f[_0xd566('0x2c')]=_[_0xd566('0x42')](db[_0xd566('0x4a')]['rawAttributes']);_0x56524f[_0xd566('0x2d')]=_[_0xd566('0x42')](_0x186f25[_0xd566('0x2d')]);_0x56524f[_0xd566('0x2e')]=_[_0xd566('0x2f')](_0x56524f['model'],_0x56524f[_0xd566('0x2d')]);_0x4b1d81[_0xd566('0x31')]=_[_0xd566('0x2f')](_0x56524f[_0xd566('0x2c')],qs[_0xd566('0x30')](_0x186f25[_0xd566('0x2d')][_0xd566('0x30')]));_0x4b1d81[_0xd566('0x31')]=_0x4b1d81[_0xd566('0x31')]['length']?_0x4b1d81[_0xd566('0x31')]:_0x56524f[_0xd566('0x2c')];_0x4b1d81['order']=qs[_0xd566('0x35')](_0x186f25['query']['sort']);_0x4b1d81['where']=qs[_0xd566('0x2e')](_[_0xd566('0x36')](_0x186f25[_0xd566('0x2d')],_0x56524f['filters']));if(_0x186f25['query'][_0xd566('0x37')]){_0x4b1d81['where']=_[_0xd566('0x38')](_0x4b1d81[_0xd566('0x39')],{'$or':_[_0xd566('0x2a')](_0x4b1d81[_0xd566('0x31')],function(_0x2ece39){var _0x3ea7a3={};_0x3ea7a3[_0x2ece39]={'$like':'%'+_0x186f25[_0xd566('0x2d')][_0xd566('0x37')]+'%'};return _0x3ea7a3;})});}_0x4b1d81=_[_0xd566('0x38')]({},_0x4b1d81,_0x186f25[_0xd566('0x44')]);return _0x3bdc09[_0xd566('0x48')](_0x4b1d81);}})[_0xd566('0x23')](function(_0x639768){if(_0x639768){_0x53836a=_0x639768[_0xd566('0x32')];if(!_0x186f25[_0xd566('0x2d')][_0xd566('0x4b')](_0xd566('0x33'))){_0x4b1d81['limit']=qs[_0xd566('0x1a')](_0x186f25[_0xd566('0x2d')][_0xd566('0x1a')]);_0x4b1d81[_0xd566('0x1c')]=qs[_0xd566('0x1c')](_0x186f25['query'][_0xd566('0x1c')]);}return _0x3bdc09['getFields'](_0x4b1d81);}})[_0xd566('0x23')](function(_0x5df5ed){if(_0x5df5ed){return _0x5df5ed?{'count':_0x53836a,'rows':_0x5df5ed}:null;}})[_0xd566('0x23')](respondWithResult(_0x29d2c0,null))['catch'](handleError(_0x29d2c0,null));};exports['getSubjects']=function(_0x4026e4,_0x54e51a,_0x30280c){var _0xc628b5={};var _0x27ff89={};var _0x209797;var _0x27cd2f;return db[_0xd566('0x3b')][_0xd566('0x49')]({'where':{'id':_0x4026e4[_0xd566('0x41')]['id']}})[_0xd566('0x23')](handleEntityNotFound(_0x54e51a,null))[_0xd566('0x23')](function(_0xfe5441){if(_0xfe5441){_0x209797=_0xfe5441;_0x27ff89[_0xd566('0x2c')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x27ff89['query']=_[_0xd566('0x42')](_0x4026e4[_0xd566('0x2d')]);_0x27ff89['filters']=_[_0xd566('0x2f')](_0x27ff89[_0xd566('0x2c')],_0x27ff89[_0xd566('0x2d')]);_0xc628b5[_0xd566('0x31')]=_[_0xd566('0x2f')](_0x27ff89[_0xd566('0x2c')],qs[_0xd566('0x30')](_0x4026e4['query'][_0xd566('0x30')]));_0xc628b5[_0xd566('0x31')]=_0xc628b5[_0xd566('0x31')][_0xd566('0x32')]?_0xc628b5[_0xd566('0x31')]:_0x27ff89[_0xd566('0x2c')];_0xc628b5[_0xd566('0x34')]=qs[_0xd566('0x35')](_0x4026e4[_0xd566('0x2d')]['sort']);_0xc628b5['where']=qs[_0xd566('0x2e')](_[_0xd566('0x36')](_0x4026e4['query'],_0x27ff89[_0xd566('0x2e')]));if(_0x4026e4[_0xd566('0x2d')]['filter']){_0xc628b5[_0xd566('0x39')]=_[_0xd566('0x38')](_0xc628b5['where'],{'$or':_['map'](_0xc628b5[_0xd566('0x31')],function(_0x48d3b3){var _0x1011dc={};_0x1011dc[_0x48d3b3]={'$like':'%'+_0x4026e4['query'][_0xd566('0x37')]+'%'};return _0x1011dc;})});}_0xc628b5=_['merge']({},_0xc628b5,_0x4026e4['options']);return _0x209797['getSubjects'](_0xc628b5);}})['then'](function(_0x295efe){if(_0x295efe){_0x27cd2f=_0x295efe[_0xd566('0x32')];if(!_0x4026e4[_0xd566('0x2d')]['hasOwnProperty'](_0xd566('0x33'))){_0xc628b5[_0xd566('0x1a')]=qs[_0xd566('0x1a')](_0x4026e4[_0xd566('0x2d')][_0xd566('0x1a')]);_0xc628b5[_0xd566('0x1c')]=qs['offset'](_0x4026e4['query']['offset']);}return _0x209797[_0xd566('0x4c')](_0xc628b5);}})['then'](function(_0xaeafee){if(_0xaeafee){return _0xaeafee?{'count':_0x27cd2f,'rows':_0xaeafee}:null;}})['then'](respondWithResult(_0x54e51a,null))[_0xd566('0x3f')](handleError(_0x54e51a,null));};exports['getDescriptions']=function(_0x38ec54,_0x358aa1,_0x27b218){var _0x2225df={};var _0x4bff53={};var _0x37139c;var _0x101d07;return db[_0xd566('0x3b')]['findOne']({'where':{'id':_0x38ec54[_0xd566('0x41')]['id']}})[_0xd566('0x23')](handleEntityNotFound(_0x358aa1,null))['then'](function(_0x20afca){if(_0x20afca){_0x37139c=_0x20afca;_0x4bff53[_0xd566('0x2c')]=_[_0xd566('0x42')](db[_0xd566('0x4a')][_0xd566('0x43')]);_0x4bff53[_0xd566('0x2d')]=_[_0xd566('0x42')](_0x38ec54[_0xd566('0x2d')]);_0x4bff53[_0xd566('0x2e')]=_['intersection'](_0x4bff53[_0xd566('0x2c')],_0x4bff53[_0xd566('0x2d')]);_0x2225df['attributes']=_[_0xd566('0x2f')](_0x4bff53[_0xd566('0x2c')],qs[_0xd566('0x30')](_0x38ec54[_0xd566('0x2d')][_0xd566('0x30')]));_0x2225df['attributes']=_0x2225df[_0xd566('0x31')][_0xd566('0x32')]?_0x2225df[_0xd566('0x31')]:_0x4bff53[_0xd566('0x2c')];_0x2225df[_0xd566('0x34')]=qs['sort'](_0x38ec54[_0xd566('0x2d')][_0xd566('0x35')]);_0x2225df['where']=qs['filters'](_[_0xd566('0x36')](_0x38ec54['query'],_0x4bff53[_0xd566('0x2e')]));if(_0x38ec54[_0xd566('0x2d')][_0xd566('0x37')]){_0x2225df[_0xd566('0x39')]=_[_0xd566('0x38')](_0x2225df[_0xd566('0x39')],{'$or':_[_0xd566('0x2a')](_0x2225df[_0xd566('0x31')],function(_0x5e4dab){var _0x4e8059={};_0x4e8059[_0x5e4dab]={'$like':'%'+_0x38ec54['query'][_0xd566('0x37')]+'%'};return _0x4e8059;})});}_0x2225df=_['merge']({},_0x2225df,_0x38ec54[_0xd566('0x44')]);return _0x37139c[_0xd566('0x4d')](_0x2225df);}})[_0xd566('0x23')](function(_0x422fb4){if(_0x422fb4){_0x101d07=_0x422fb4['length'];if(!_0x38ec54[_0xd566('0x2d')][_0xd566('0x4b')](_0xd566('0x33'))){_0x2225df['limit']=qs[_0xd566('0x1a')](_0x38ec54[_0xd566('0x2d')][_0xd566('0x1a')]);_0x2225df[_0xd566('0x1c')]=qs[_0xd566('0x1c')](_0x38ec54[_0xd566('0x2d')]['offset']);}return _0x37139c[_0xd566('0x4d')](_0x2225df);}})['then'](function(_0x254eef){if(_0x254eef){return _0x254eef?{'count':_0x101d07,'rows':_0x254eef}:null;}})[_0xd566('0x23')](respondWithResult(_0x358aa1,null))[_0xd566('0x3f')](handleError(_0x358aa1,null));}; \ No newline at end of file +var _0x901b=['then','destroy','end','sendStatus','error','stack','name','send','ServicenowConfiguration','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','params','keys','rawAttributes','length','find','create','body','getFields','findOne','order','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update'];(function(_0x2f52d0,_0x407519){var _0x305b10=function(_0x396273){while(--_0x396273){_0x2f52d0['push'](_0x2f52d0['shift']());}};_0x305b10(++_0x407519);}(_0x901b,0xca));var _0xb901=function(_0x4f8e4a,_0x226e9d){_0x4f8e4a=_0x4f8e4a-0x0;var _0x210ee5=_0x901b[_0x4f8e4a];return _0x210ee5;};'use strict';var emlformat=require(_0xb901('0x0'));var rimraf=require(_0xb901('0x1'));var zipdir=require(_0xb901('0x2'));var jsonpatch=require(_0xb901('0x3'));var rp=require('request-promise');var moment=require(_0xb901('0x4'));var BPromise=require(_0xb901('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb901('0x6'));var sox=require(_0xb901('0x7'));var csv=require(_0xb901('0x8'));var ejs=require(_0xb901('0x9'));var fs=require('fs');var fs_extra=require(_0xb901('0xa'));var _=require(_0xb901('0xb'));var squel=require(_0xb901('0xc'));var crypto=require(_0xb901('0xd'));var jsforce=require(_0xb901('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb901('0x8'));var querystring=require(_0xb901('0xf'));var Papa=require(_0xb901('0x10'));var Redis=require(_0xb901('0x11'));var authService=require(_0xb901('0x12'));var qs=require(_0xb901('0x13'));var as=require(_0xb901('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb901('0x15'))(_0xb901('0x16'));var utils=require(_0xb901('0x17'));var config=require(_0xb901('0x18'));var licenseUtil=require(_0xb901('0x19'));var db=require(_0xb901('0x1a'))['db'];function respondWithStatusCode(_0xe33f57,_0x303ea0){_0x303ea0=_0x303ea0||0xcc;return function(_0x3d25ec){if(_0x3d25ec){return _0xe33f57['sendStatus'](_0x303ea0);}return _0xe33f57[_0xb901('0x1b')](_0x303ea0)['end']();};}function respondWithResult(_0xc2818a,_0x39035e){_0x39035e=_0x39035e||0xc8;return function(_0x4ef248){if(_0x4ef248){return _0xc2818a[_0xb901('0x1b')](_0x39035e)[_0xb901('0x1c')](_0x4ef248);}};}function respondWithFilteredResult(_0x326675,_0x20380b){return function(_0x223e50){if(_0x223e50){var _0x1a8a93=typeof _0x20380b[_0xb901('0x1d')]===_0xb901('0x1e')&&typeof _0x20380b['limit']==='undefined';var _0x5ae607=_0x223e50[_0xb901('0x1f')];var _0x435b29=_0x1a8a93?0x0:_0x20380b[_0xb901('0x1d')];var _0x336762=_0x1a8a93?_0x223e50[_0xb901('0x1f')]:_0x20380b['offset']+_0x20380b[_0xb901('0x20')];var _0x26b958;if(_0x336762>=_0x5ae607){_0x336762=_0x5ae607;_0x26b958=0xc8;}else{_0x26b958=0xce;}_0x326675[_0xb901('0x1b')](_0x26b958);return _0x326675['set'](_0xb901('0x21'),_0x435b29+'-'+_0x336762+'/'+_0x5ae607)[_0xb901('0x1c')](_0x223e50);}return null;};}function patchUpdates(_0x275043){return function(_0x4608ac){try{jsonpatch[_0xb901('0x22')](_0x4608ac,_0x275043,!![]);}catch(_0x59fe5a){return BPromise[_0xb901('0x23')](_0x59fe5a);}return _0x4608ac[_0xb901('0x24')]();};}function saveUpdates(_0x823f29,_0xf1eeb9){return function(_0x3e8f85){if(_0x3e8f85){return _0x3e8f85[_0xb901('0x25')](_0x823f29)[_0xb901('0x26')](function(_0x3499a2){return _0x3499a2;});}return null;};}function removeEntity(_0x41a611,_0x263664){return function(_0x4d0cd6){if(_0x4d0cd6){return _0x4d0cd6[_0xb901('0x27')]()[_0xb901('0x26')](function(){_0x41a611[_0xb901('0x1b')](0xcc)[_0xb901('0x28')]();});}};}function handleEntityNotFound(_0x108017,_0x59df62){return function(_0x486f94){if(!_0x486f94){_0x108017[_0xb901('0x29')](0x194);}return _0x486f94;};}function handleError(_0x2ec6dc,_0x3e541b){_0x3e541b=_0x3e541b||0x1f4;return function(_0x277c5d){logger[_0xb901('0x2a')](_0x277c5d[_0xb901('0x2b')]);if(_0x277c5d[_0xb901('0x2c')]){delete _0x277c5d[_0xb901('0x2c')];}_0x2ec6dc['status'](_0x3e541b)[_0xb901('0x2d')](_0x277c5d);};}exports['index']=function(_0x14ffb8,_0x768996){var _0x51b90f={},_0x2b2970={},_0x5721d1={'count':0x0,'rows':[]};var _0x21c3b8=_['map'](db[_0xb901('0x2e')]['rawAttributes'],function(_0x46a3b9){return{'name':_0x46a3b9[_0xb901('0x2f')],'type':_0x46a3b9['type']['key']};});_0x2b2970[_0xb901('0x30')]=_['map'](_0x21c3b8,_0xb901('0x2c'));_0x2b2970['query']=_['keys'](_0x14ffb8[_0xb901('0x31')]);_0x2b2970[_0xb901('0x32')]=_[_0xb901('0x33')](_0x2b2970['model'],_0x2b2970[_0xb901('0x31')]);_0x51b90f[_0xb901('0x34')]=_[_0xb901('0x33')](_0x2b2970[_0xb901('0x30')],qs[_0xb901('0x35')](_0x14ffb8['query'][_0xb901('0x35')]));_0x51b90f['attributes']=_0x51b90f['attributes']['length']?_0x51b90f[_0xb901('0x34')]:_0x2b2970[_0xb901('0x30')];if(!_0x14ffb8['query'][_0xb901('0x36')](_0xb901('0x37'))){_0x51b90f[_0xb901('0x20')]=qs[_0xb901('0x20')](_0x14ffb8[_0xb901('0x31')][_0xb901('0x20')]);_0x51b90f[_0xb901('0x1d')]=qs[_0xb901('0x1d')](_0x14ffb8['query']['offset']);}_0x51b90f['order']=qs[_0xb901('0x38')](_0x14ffb8['query'][_0xb901('0x38')]);_0x51b90f[_0xb901('0x39')]=qs[_0xb901('0x32')](_[_0xb901('0x3a')](_0x14ffb8[_0xb901('0x31')],_0x2b2970[_0xb901('0x32')]),_0x21c3b8);if(_0x14ffb8[_0xb901('0x31')][_0xb901('0x3b')]){_0x51b90f[_0xb901('0x39')]=_[_0xb901('0x3c')](_0x51b90f[_0xb901('0x39')],{'$or':_[_0xb901('0x3d')](_0x21c3b8,function(_0x190364){if(_0x190364['type']!==_0xb901('0x3e')){var _0x3fdea3={};_0x3fdea3[_0x190364[_0xb901('0x2c')]]={'$like':'%'+_0x14ffb8[_0xb901('0x31')]['filter']+'%'};return _0x3fdea3;}})});}_0x51b90f=_[_0xb901('0x3c')]({},_0x51b90f,_0x14ffb8[_0xb901('0x3f')]);var _0x130e2f={'where':_0x51b90f[_0xb901('0x39')]};return db[_0xb901('0x2e')][_0xb901('0x1f')](_0x130e2f)[_0xb901('0x26')](function(_0x4298a0){_0x5721d1[_0xb901('0x1f')]=_0x4298a0;if(_0x14ffb8[_0xb901('0x31')]['includeAll']){_0x51b90f[_0xb901('0x40')]=[{'all':!![]}];}return db[_0xb901('0x2e')]['findAll'](_0x51b90f);})['then'](function(_0x87c0c5){_0x5721d1[_0xb901('0x41')]=_0x87c0c5;return _0x5721d1;})['then'](respondWithFilteredResult(_0x768996,_0x51b90f))[_0xb901('0x42')](handleError(_0x768996,null));};exports['show']=function(_0x3b7fcd,_0x5d2e50){var _0x43141d={'raw':![],'where':{'id':_0x3b7fcd[_0xb901('0x43')]['id']}},_0x5afac1={};_0x5afac1[_0xb901('0x30')]=_[_0xb901('0x44')](db[_0xb901('0x2e')][_0xb901('0x45')]);_0x5afac1[_0xb901('0x31')]=_[_0xb901('0x44')](_0x3b7fcd[_0xb901('0x31')]);_0x5afac1['filters']=_['intersection'](_0x5afac1[_0xb901('0x30')],_0x5afac1[_0xb901('0x31')]);_0x43141d[_0xb901('0x34')]=_['intersection'](_0x5afac1[_0xb901('0x30')],qs[_0xb901('0x35')](_0x3b7fcd[_0xb901('0x31')][_0xb901('0x35')]));_0x43141d[_0xb901('0x34')]=_0x43141d['attributes'][_0xb901('0x46')]?_0x43141d[_0xb901('0x34')]:_0x5afac1[_0xb901('0x30')];if(_0x3b7fcd[_0xb901('0x31')]['includeAll']){_0x43141d[_0xb901('0x40')]=[{'all':!![]}];}_0x43141d=_[_0xb901('0x3c')]({},_0x43141d,_0x3b7fcd[_0xb901('0x3f')]);return db[_0xb901('0x2e')][_0xb901('0x47')](_0x43141d)[_0xb901('0x26')](handleEntityNotFound(_0x5d2e50,null))[_0xb901('0x26')](respondWithResult(_0x5d2e50,null))[_0xb901('0x42')](handleError(_0x5d2e50,null));};exports[_0xb901('0x48')]=function(_0x3cf690,_0x28af28){return db[_0xb901('0x2e')][_0xb901('0x48')](_0x3cf690[_0xb901('0x49')],{})[_0xb901('0x26')](respondWithResult(_0x28af28,0xc9))['catch'](handleError(_0x28af28,null));};exports[_0xb901('0x25')]=function(_0x1fa6e9,_0x3968f8){if(_0x1fa6e9[_0xb901('0x49')]['id']){delete _0x1fa6e9[_0xb901('0x49')]['id'];}return db[_0xb901('0x2e')][_0xb901('0x47')]({'where':{'id':_0x1fa6e9[_0xb901('0x43')]['id']}})[_0xb901('0x26')](handleEntityNotFound(_0x3968f8,null))[_0xb901('0x26')](saveUpdates(_0x1fa6e9[_0xb901('0x49')],null))[_0xb901('0x26')](respondWithResult(_0x3968f8,null))[_0xb901('0x42')](handleError(_0x3968f8,null));};exports[_0xb901('0x27')]=function(_0x17bbb3,_0x86f6c6){return db['ServicenowConfiguration'][_0xb901('0x47')]({'where':{'id':_0x17bbb3['params']['id']}})[_0xb901('0x26')](handleEntityNotFound(_0x86f6c6,null))[_0xb901('0x26')](removeEntity(_0x86f6c6,null))[_0xb901('0x42')](handleError(_0x86f6c6,null));};exports[_0xb901('0x4a')]=function(_0x58fd7e,_0x602c00,_0x288b4f){var _0x424201={};var _0x2323d6={};var _0x1fe6f1;var _0x53dd74;return db[_0xb901('0x2e')][_0xb901('0x4b')]({'where':{'id':_0x58fd7e[_0xb901('0x43')]['id']}})[_0xb901('0x26')](handleEntityNotFound(_0x602c00,null))['then'](function(_0x3dfc1a){if(_0x3dfc1a){_0x1fe6f1=_0x3dfc1a;_0x2323d6[_0xb901('0x30')]=_[_0xb901('0x44')](db['ServicenowField']['rawAttributes']);_0x2323d6[_0xb901('0x31')]=_[_0xb901('0x44')](_0x58fd7e[_0xb901('0x31')]);_0x2323d6['filters']=_[_0xb901('0x33')](_0x2323d6['model'],_0x2323d6[_0xb901('0x31')]);_0x424201[_0xb901('0x34')]=_['intersection'](_0x2323d6[_0xb901('0x30')],qs[_0xb901('0x35')](_0x58fd7e[_0xb901('0x31')][_0xb901('0x35')]));_0x424201['attributes']=_0x424201[_0xb901('0x34')][_0xb901('0x46')]?_0x424201[_0xb901('0x34')]:_0x2323d6['model'];_0x424201[_0xb901('0x4c')]=qs['sort'](_0x58fd7e[_0xb901('0x31')][_0xb901('0x38')]);_0x424201[_0xb901('0x39')]=qs['filters'](_[_0xb901('0x3a')](_0x58fd7e[_0xb901('0x31')],_0x2323d6[_0xb901('0x32')]));if(_0x58fd7e[_0xb901('0x31')][_0xb901('0x3b')]){_0x424201[_0xb901('0x39')]=_['merge'](_0x424201[_0xb901('0x39')],{'$or':_[_0xb901('0x3d')](_0x424201[_0xb901('0x34')],function(_0x1934a2){var _0x209acf={};_0x209acf[_0x1934a2]={'$like':'%'+_0x58fd7e[_0xb901('0x31')]['filter']+'%'};return _0x209acf;})});}_0x424201=_[_0xb901('0x3c')]({},_0x424201,_0x58fd7e['options']);return _0x1fe6f1[_0xb901('0x4a')](_0x424201);}})['then'](function(_0xa5bd61){if(_0xa5bd61){_0x53dd74=_0xa5bd61[_0xb901('0x46')];if(!_0x58fd7e[_0xb901('0x31')][_0xb901('0x36')](_0xb901('0x37'))){_0x424201[_0xb901('0x20')]=qs['limit'](_0x58fd7e[_0xb901('0x31')]['limit']);_0x424201['offset']=qs['offset'](_0x58fd7e[_0xb901('0x31')]['offset']);}return _0x1fe6f1['getFields'](_0x424201);}})['then'](function(_0x57acaf){if(_0x57acaf){return _0x57acaf?{'count':_0x53dd74,'rows':_0x57acaf}:null;}})[_0xb901('0x26')](respondWithResult(_0x602c00,null))[_0xb901('0x42')](handleError(_0x602c00,null));};exports[_0xb901('0x4d')]=function(_0x2586e5,_0x36627e,_0x331d80){var _0x5ae787={};var _0x2f2332={};var _0x10ddd4;var _0x1eb5ba;return db[_0xb901('0x2e')][_0xb901('0x4b')]({'where':{'id':_0x2586e5[_0xb901('0x43')]['id']}})['then'](handleEntityNotFound(_0x36627e,null))['then'](function(_0x5c2f4e){if(_0x5c2f4e){_0x10ddd4=_0x5c2f4e;_0x2f2332[_0xb901('0x30')]=_['keys'](db[_0xb901('0x4e')]['rawAttributes']);_0x2f2332[_0xb901('0x31')]=_[_0xb901('0x44')](_0x2586e5[_0xb901('0x31')]);_0x2f2332[_0xb901('0x32')]=_['intersection'](_0x2f2332[_0xb901('0x30')],_0x2f2332['query']);_0x5ae787[_0xb901('0x34')]=_['intersection'](_0x2f2332[_0xb901('0x30')],qs[_0xb901('0x35')](_0x2586e5[_0xb901('0x31')][_0xb901('0x35')]));_0x5ae787['attributes']=_0x5ae787[_0xb901('0x34')][_0xb901('0x46')]?_0x5ae787[_0xb901('0x34')]:_0x2f2332[_0xb901('0x30')];_0x5ae787[_0xb901('0x4c')]=qs[_0xb901('0x38')](_0x2586e5[_0xb901('0x31')][_0xb901('0x38')]);_0x5ae787[_0xb901('0x39')]=qs['filters'](_[_0xb901('0x3a')](_0x2586e5[_0xb901('0x31')],_0x2f2332[_0xb901('0x32')]));if(_0x2586e5[_0xb901('0x31')][_0xb901('0x3b')]){_0x5ae787[_0xb901('0x39')]=_[_0xb901('0x3c')](_0x5ae787[_0xb901('0x39')],{'$or':_[_0xb901('0x3d')](_0x5ae787['attributes'],function(_0x1d4413){var _0x488296={};_0x488296[_0x1d4413]={'$like':'%'+_0x2586e5[_0xb901('0x31')][_0xb901('0x3b')]+'%'};return _0x488296;})});}_0x5ae787=_[_0xb901('0x3c')]({},_0x5ae787,_0x2586e5[_0xb901('0x3f')]);return _0x10ddd4[_0xb901('0x4d')](_0x5ae787);}})[_0xb901('0x26')](function(_0x3fbf44){if(_0x3fbf44){_0x1eb5ba=_0x3fbf44[_0xb901('0x46')];if(!_0x2586e5[_0xb901('0x31')][_0xb901('0x36')](_0xb901('0x37'))){_0x5ae787[_0xb901('0x20')]=qs[_0xb901('0x20')](_0x2586e5[_0xb901('0x31')][_0xb901('0x20')]);_0x5ae787[_0xb901('0x1d')]=qs[_0xb901('0x1d')](_0x2586e5[_0xb901('0x31')][_0xb901('0x1d')]);}return _0x10ddd4[_0xb901('0x4d')](_0x5ae787);}})[_0xb901('0x26')](function(_0xf1d0a4){if(_0xf1d0a4){return _0xf1d0a4?{'count':_0x1eb5ba,'rows':_0xf1d0a4}:null;}})[_0xb901('0x26')](respondWithResult(_0x36627e,null))['catch'](handleError(_0x36627e,null));};exports['getDescriptions']=function(_0x10470d,_0x5a4a84,_0x3581b4){var _0x2026c0={};var _0x5df81d={};var _0x519e12;var _0x3347b5;return db[_0xb901('0x2e')][_0xb901('0x4b')]({'where':{'id':_0x10470d[_0xb901('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a4a84,null))[_0xb901('0x26')](function(_0x34af9e){if(_0x34af9e){_0x519e12=_0x34af9e;_0x5df81d[_0xb901('0x30')]=_[_0xb901('0x44')](db[_0xb901('0x4e')]['rawAttributes']);_0x5df81d[_0xb901('0x31')]=_[_0xb901('0x44')](_0x10470d['query']);_0x5df81d[_0xb901('0x32')]=_[_0xb901('0x33')](_0x5df81d[_0xb901('0x30')],_0x5df81d[_0xb901('0x31')]);_0x2026c0['attributes']=_[_0xb901('0x33')](_0x5df81d[_0xb901('0x30')],qs[_0xb901('0x35')](_0x10470d[_0xb901('0x31')]['fields']));_0x2026c0[_0xb901('0x34')]=_0x2026c0[_0xb901('0x34')][_0xb901('0x46')]?_0x2026c0[_0xb901('0x34')]:_0x5df81d[_0xb901('0x30')];_0x2026c0['order']=qs[_0xb901('0x38')](_0x10470d['query'][_0xb901('0x38')]);_0x2026c0[_0xb901('0x39')]=qs['filters'](_[_0xb901('0x3a')](_0x10470d['query'],_0x5df81d[_0xb901('0x32')]));if(_0x10470d[_0xb901('0x31')][_0xb901('0x3b')]){_0x2026c0['where']=_['merge'](_0x2026c0[_0xb901('0x39')],{'$or':_[_0xb901('0x3d')](_0x2026c0['attributes'],function(_0x1d2a17){var _0x429059={};_0x429059[_0x1d2a17]={'$like':'%'+_0x10470d[_0xb901('0x31')][_0xb901('0x3b')]+'%'};return _0x429059;})});}_0x2026c0=_[_0xb901('0x3c')]({},_0x2026c0,_0x10470d[_0xb901('0x3f')]);return _0x519e12[_0xb901('0x4f')](_0x2026c0);}})[_0xb901('0x26')](function(_0x2b5f0d){if(_0x2b5f0d){_0x3347b5=_0x2b5f0d[_0xb901('0x46')];if(!_0x10470d['query']['hasOwnProperty'](_0xb901('0x37'))){_0x2026c0[_0xb901('0x20')]=qs['limit'](_0x10470d[_0xb901('0x31')][_0xb901('0x20')]);_0x2026c0[_0xb901('0x1d')]=qs[_0xb901('0x1d')](_0x10470d[_0xb901('0x31')]['offset']);}return _0x519e12[_0xb901('0x4f')](_0x2026c0);}})[_0xb901('0x26')](function(_0x58b90f){if(_0x58b90f){return _0x58b90f?{'count':_0x3347b5,'rows':_0x58b90f}:null;}})[_0xb901('0x26')](respondWithResult(_0x5a4a84,null))[_0xb901('0x42')](handleError(_0x5a4a84,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 62c010a..937681a 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 _0x1f81=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x108b92,_0x5eb2c4){var _0x44294f=function(_0xd61014){while(--_0xd61014){_0x108b92['push'](_0x108b92['shift']());}};_0x44294f(++_0x5eb2c4);}(_0x1f81,0xab));var _0x11f8=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x1f81[_0x2c9b79];return _0x265032;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var logger=require('../../config/logger')(_0x11f8('0x2'));var moment=require(_0x11f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x11f8('0x4'));var fs=require('fs');var path=require(_0x11f8('0x5'));var rimraf=require(_0x11f8('0x6'));var config=require(_0x11f8('0x7'));var attributes=require(_0x11f8('0x8'));module[_0x11f8('0x9')]=function(_0x1a16e9,_0xe63071){return _0x1a16e9['define'](_0x11f8('0xa'),attributes,{'tableName':_0x11f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaec5=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x536a0f,_0x1140f5){var _0x4fc5fd=function(_0x34a22e){while(--_0x34a22e){_0x536a0f['push'](_0x536a0f['shift']());}};_0x4fc5fd(++_0x1140f5);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var logger=require(_0x5aec('0x2'))(_0x5aec('0x3'));var moment=require(_0x5aec('0x4'));var BPromise=require(_0x5aec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aec('0x6'));var rimraf=require(_0x5aec('0x7'));var config=require(_0x5aec('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x539cdf,_0x52d725){return _0x539cdf[_0x5aec('0x9')](_0x5aec('0xa'),attributes,{'tableName':_0x5aec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 85829e7..e0c349f 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 _0x97ec=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97ec,0x132));var _0xc97e=function(_0x362c08,_0x368695){_0x362c08=_0x362c08-0x0;var _0x432942=_0x97ec[_0x362c08];return _0x432942;};'use strict';var _=require(_0xc97e('0x0'));var util=require(_0xc97e('0x1'));var moment=require(_0xc97e('0x2'));var BPromise=require(_0xc97e('0x3'));var rs=require(_0xc97e('0x4'));var fs=require('fs');var Redis=require(_0xc97e('0x5'));var db=require(_0xc97e('0x6'))['db'];var utils=require(_0xc97e('0x7'));var logger=require('../../config/logger')(_0xc97e('0x8'));var config=require(_0xc97e('0x9'));var jayson=require(_0xc97e('0xa'));var client=jayson[_0xc97e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x240949,_0x377f83,_0x27b9fb){return new BPromise(function(_0x196aa9,_0x586cb1){return client[_0xc97e('0xc')](_0x240949,_0x27b9fb)['then'](function(_0x133681){logger[_0xc97e('0xd')](_0xc97e('0xe'),_0x377f83,_0xc97e('0xf'));logger[_0xc97e('0x10')](_0xc97e('0x11'),_0x377f83,_0xc97e('0xf'),JSON['stringify'](_0x133681));if(_0x133681[_0xc97e('0x12')]){if(_0x133681[_0xc97e('0x12')][_0xc97e('0x13')]===0x1f4){logger[_0xc97e('0x12')](_0xc97e('0xe'),_0x377f83,_0x133681['error'][_0xc97e('0x14')]);return _0x586cb1(_0x133681[_0xc97e('0x12')][_0xc97e('0x14')]);}logger[_0xc97e('0x12')](_0xc97e('0xe'),_0x377f83,_0x133681[_0xc97e('0x12')][_0xc97e('0x14')]);return _0x196aa9(_0x133681[_0xc97e('0x12')][_0xc97e('0x14')]);}else{logger[_0xc97e('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x377f83,_0xc97e('0xf'));_0x196aa9(_0x133681[_0xc97e('0x15')]['message']);}})[_0xc97e('0x16')](function(_0x229404){logger[_0xc97e('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x377f83,_0x229404);_0x586cb1(_0x229404);});});} \ No newline at end of file +var _0x5a2f=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x589e3f,_0x59e0dd){var _0x496ae1=function(_0x3adbfd){while(--_0x3adbfd){_0x589e3f['push'](_0x589e3f['shift']());}};_0x496ae1(++_0x59e0dd);}(_0x5a2f,0x9b));var _0xf5a2=function(_0x2c5eee,_0x39d6bf){_0x2c5eee=_0x2c5eee-0x0;var _0x134f01=_0x5a2f[_0x2c5eee];return _0x134f01;};'use strict';var _=require(_0xf5a2('0x0'));var util=require(_0xf5a2('0x1'));var moment=require('moment');var BPromise=require(_0xf5a2('0x2'));var rs=require(_0xf5a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5a2('0x5'))('rpc');var config=require(_0xf5a2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf5a2('0x7')][_0xf5a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x310122,_0x5500ed,_0x18437d){return new BPromise(function(_0x53c97c,_0x4d2df8){return client[_0xf5a2('0x9')](_0x310122,_0x18437d)[_0xf5a2('0xa')](function(_0x1aaf96){logger[_0xf5a2('0xb')](_0xf5a2('0xc'),_0x5500ed,_0xf5a2('0xd'));logger[_0xf5a2('0xe')](_0xf5a2('0xf'),_0x5500ed,_0xf5a2('0xd'),JSON[_0xf5a2('0x10')](_0x1aaf96));if(_0x1aaf96[_0xf5a2('0x11')]){if(_0x1aaf96[_0xf5a2('0x11')][_0xf5a2('0x12')]===0x1f4){logger[_0xf5a2('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5500ed,_0x1aaf96[_0xf5a2('0x11')][_0xf5a2('0x13')]);return _0x4d2df8(_0x1aaf96[_0xf5a2('0x11')][_0xf5a2('0x13')]);}logger[_0xf5a2('0x11')](_0xf5a2('0xc'),_0x5500ed,_0x1aaf96[_0xf5a2('0x11')][_0xf5a2('0x13')]);return _0x53c97c(_0x1aaf96['error'][_0xf5a2('0x13')]);}else{logger[_0xf5a2('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5500ed,_0xf5a2('0xd'));_0x53c97c(_0x1aaf96[_0xf5a2('0x14')][_0xf5a2('0x13')]);}})[_0xf5a2('0x15')](function(_0x169455){logger[_0xf5a2('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5500ed,_0x169455);_0x4d2df8(_0x169455);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index a9d61c7..9851dd1 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 _0x0b5f=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0b5f,0x19b));var _0xf0b5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0b5f[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xf0b5('0x0'));var util=require(_0xf0b5('0x1'));var path=require('path');var timeout=require(_0xf0b5('0x2'));var express=require('express');var router=express[_0xf0b5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf0b5('0x4'));var interaction=require(_0xf0b5('0x5'));var config=require(_0xf0b5('0x6'));var controller=require('./intServicenowField.controller');router[_0xf0b5('0x7')]('/',auth[_0xf0b5('0x8')](),controller[_0xf0b5('0x9')]);router[_0xf0b5('0x7')](_0xf0b5('0xa'),auth[_0xf0b5('0x8')](),controller[_0xf0b5('0xb')]);router[_0xf0b5('0xc')]('/',auth[_0xf0b5('0x8')](),controller['create']);router[_0xf0b5('0xd')](_0xf0b5('0xa'),auth['isAuthenticated'](),controller[_0xf0b5('0xe')]);router[_0xf0b5('0xf')]('/:id',auth[_0xf0b5('0x8')](),controller[_0xf0b5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x86bd=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x86bd,0x13b));var _0xd86b=function(_0x3d20cc,_0x3bc09f){_0x3d20cc=_0x3d20cc-0x0;var _0x36d238=_0x86bd[_0x3d20cc];return _0x36d238;};'use strict';var multer=require(_0xd86b('0x0'));var util=require('util');var path=require(_0xd86b('0x1'));var timeout=require(_0xd86b('0x2'));var express=require('express');var router=express[_0xd86b('0x3')]();var fs_extra=require(_0xd86b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd86b('0x5'));var config=require(_0xd86b('0x6'));var controller=require(_0xd86b('0x7'));router[_0xd86b('0x8')]('/',auth[_0xd86b('0x9')](),controller[_0xd86b('0xa')]);router[_0xd86b('0x8')](_0xd86b('0xb'),auth[_0xd86b('0x9')](),controller[_0xd86b('0xc')]);router[_0xd86b('0xd')]('/',auth[_0xd86b('0x9')](),controller[_0xd86b('0xe')]);router['put'](_0xd86b('0xb'),auth[_0xd86b('0x9')](),controller[_0xd86b('0xf')]);router[_0xd86b('0x10')](_0xd86b('0xb'),auth[_0xd86b('0x9')](),controller[_0xd86b('0x11')]);module[_0xd86b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4a17f66..ca3a646 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 _0x0601=['keyValue','picklist','STRING','string','variable'];(function(_0x64efe5,_0x4ddd0d){var _0x58bd4a=function(_0x554af0){while(--_0x554af0){_0x64efe5['push'](_0x64efe5['shift']());}};_0x58bd4a(++_0x4ddd0d);}(_0x0601,0xc6));var _0x1060=function(_0x25e03a,_0x3e4fa9){_0x25e03a=_0x25e03a-0x0;var _0x5528e2=_0x0601[_0x25e03a];return _0x5528e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x1060('0x0'),_0x1060('0x1'),'customVariable',_0x1060('0x2'),_0x1060('0x3')),'defaultValue':_0x1060('0x0')},'content':{'type':Sequelize[_0x1060('0x4')]},'key':{'type':Sequelize[_0x1060('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x1060('0x0'),_0x1060('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x1060('0x4')]},'idField':{'type':Sequelize[_0x1060('0x4')]},'nameField':{'type':Sequelize[_0x1060('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1060('0x4')]}}; \ No newline at end of file +var _0x0a1a=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x0a1a,0xfc));var _0xa0a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a1a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa0a1('0x0'));module[_0xa0a1('0x1')]={'type':{'type':Sequelize[_0xa0a1('0x2')](_0xa0a1('0x3'),'variable',_0xa0a1('0x4'),_0xa0a1('0x5'),_0xa0a1('0x6')),'defaultValue':_0xa0a1('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa0a1('0x7')]},'keyType':{'type':Sequelize[_0xa0a1('0x2')](_0xa0a1('0x3'),'variable',_0xa0a1('0x4'))},'keyContent':{'type':Sequelize[_0xa0a1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa0a1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 46e05c2..189dc2d 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 _0xe3b5=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ServicenowField','includeAll','findAll','catch','show','params','keys','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x22b839,_0x8ca049){var _0x585ca7=function(_0x357bdf){while(--_0x357bdf){_0x22b839['push'](_0x22b839['shift']());}};_0x585ca7(++_0x8ca049);}(_0xe3b5,0x7e));var _0x5e3b=function(_0x1790dd,_0x2c493e){_0x1790dd=_0x1790dd-0x0;var _0x1b2580=_0xe3b5[_0x1790dd];return _0x1b2580;};'use strict';var emlformat=require(_0x5e3b('0x0'));var rimraf=require(_0x5e3b('0x1'));var zipdir=require(_0x5e3b('0x2'));var jsonpatch=require(_0x5e3b('0x3'));var rp=require(_0x5e3b('0x4'));var moment=require(_0x5e3b('0x5'));var BPromise=require(_0x5e3b('0x6'));var Mustache=require(_0x5e3b('0x7'));var util=require(_0x5e3b('0x8'));var path=require('path');var sox=require(_0x5e3b('0x9'));var csv=require(_0x5e3b('0xa'));var ejs=require(_0x5e3b('0xb'));var fs=require('fs');var fs_extra=require(_0x5e3b('0xc'));var _=require(_0x5e3b('0xd'));var squel=require(_0x5e3b('0xe'));var crypto=require(_0x5e3b('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5e3b('0x10'));var Redis=require(_0x5e3b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e3b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e3b('0x13'));var logger=require(_0x5e3b('0x14'))(_0x5e3b('0x15'));var utils=require('../../config/utils');var config=require(_0x5e3b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e3b('0x17'))['db'];function respondWithStatusCode(_0x2e390c,_0x36c0db){_0x36c0db=_0x36c0db||0xcc;return function(_0x2e5536){if(_0x2e5536){return _0x2e390c[_0x5e3b('0x18')](_0x36c0db);}return _0x2e390c[_0x5e3b('0x19')](_0x36c0db)[_0x5e3b('0x1a')]();};}function respondWithResult(_0xb5730a,_0x25deda){_0x25deda=_0x25deda||0xc8;return function(_0x62ab12){if(_0x62ab12){return _0xb5730a[_0x5e3b('0x19')](_0x25deda)[_0x5e3b('0x1b')](_0x62ab12);}};}function respondWithFilteredResult(_0x3c2af9,_0x14e016){return function(_0x50215f){if(_0x50215f){var _0x238d01=typeof _0x14e016[_0x5e3b('0x1c')]==='undefined'&&typeof _0x14e016[_0x5e3b('0x1d')]===_0x5e3b('0x1e');var _0x4d8bde=_0x50215f[_0x5e3b('0x1f')];var _0x4990d5=_0x238d01?0x0:_0x14e016[_0x5e3b('0x1c')];var _0xd83b52=_0x238d01?_0x50215f[_0x5e3b('0x1f')]:_0x14e016[_0x5e3b('0x1c')]+_0x14e016[_0x5e3b('0x1d')];var _0x44ee56;if(_0xd83b52>=_0x4d8bde){_0xd83b52=_0x4d8bde;_0x44ee56=0xc8;}else{_0x44ee56=0xce;}_0x3c2af9['status'](_0x44ee56);return _0x3c2af9[_0x5e3b('0x20')]('Content-Range',_0x4990d5+'-'+_0xd83b52+'/'+_0x4d8bde)['json'](_0x50215f);}return null;};}function patchUpdates(_0x35fae7){return function(_0x2ed9a5){try{jsonpatch[_0x5e3b('0x21')](_0x2ed9a5,_0x35fae7,!![]);}catch(_0x25ec48){return BPromise[_0x5e3b('0x22')](_0x25ec48);}return _0x2ed9a5[_0x5e3b('0x23')]();};}function saveUpdates(_0x38da44,_0x5cc98d){return function(_0x33d30b){if(_0x33d30b){return _0x33d30b[_0x5e3b('0x24')](_0x38da44)[_0x5e3b('0x25')](function(_0x9e9a2a){return _0x9e9a2a;});}return null;};}function removeEntity(_0x263819,_0x301375){return function(_0x1a6e69){if(_0x1a6e69){return _0x1a6e69['destroy']()[_0x5e3b('0x25')](function(){_0x263819['status'](0xcc)[_0x5e3b('0x1a')]();});}};}function handleEntityNotFound(_0x185f68,_0x1955ff){return function(_0x172351){if(!_0x172351){_0x185f68[_0x5e3b('0x18')](0x194);}return _0x172351;};}function handleError(_0x57dc53,_0x161de5){_0x161de5=_0x161de5||0x1f4;return function(_0x403d8b){logger[_0x5e3b('0x26')](_0x403d8b[_0x5e3b('0x27')]);if(_0x403d8b['name']){delete _0x403d8b[_0x5e3b('0x28')];}_0x57dc53[_0x5e3b('0x19')](_0x161de5)[_0x5e3b('0x29')](_0x403d8b);};}exports[_0x5e3b('0x2a')]=function(_0x471134,_0x165bd0){var _0x120bc2={},_0x146566={},_0x2de7a8={'count':0x0,'rows':[]};var _0x5ee53c=_[_0x5e3b('0x2b')](db['ServicenowField'][_0x5e3b('0x2c')],function(_0x5a5e56){return{'name':_0x5a5e56[_0x5e3b('0x2d')],'type':_0x5a5e56[_0x5e3b('0x2e')][_0x5e3b('0x2f')]};});_0x146566[_0x5e3b('0x30')]=_[_0x5e3b('0x2b')](_0x5ee53c,_0x5e3b('0x28'));_0x146566[_0x5e3b('0x31')]=_['keys'](_0x471134[_0x5e3b('0x31')]);_0x146566[_0x5e3b('0x32')]=_[_0x5e3b('0x33')](_0x146566[_0x5e3b('0x30')],_0x146566[_0x5e3b('0x31')]);_0x120bc2[_0x5e3b('0x34')]=_[_0x5e3b('0x33')](_0x146566[_0x5e3b('0x30')],qs[_0x5e3b('0x35')](_0x471134['query'][_0x5e3b('0x35')]));_0x120bc2[_0x5e3b('0x34')]=_0x120bc2[_0x5e3b('0x34')][_0x5e3b('0x36')]?_0x120bc2[_0x5e3b('0x34')]:_0x146566[_0x5e3b('0x30')];if(!_0x471134[_0x5e3b('0x31')][_0x5e3b('0x37')](_0x5e3b('0x38'))){_0x120bc2[_0x5e3b('0x1d')]=qs[_0x5e3b('0x1d')](_0x471134['query'][_0x5e3b('0x1d')]);_0x120bc2['offset']=qs[_0x5e3b('0x1c')](_0x471134[_0x5e3b('0x31')][_0x5e3b('0x1c')]);}_0x120bc2[_0x5e3b('0x39')]=qs[_0x5e3b('0x3a')](_0x471134[_0x5e3b('0x31')][_0x5e3b('0x3a')]);_0x120bc2[_0x5e3b('0x3b')]=qs[_0x5e3b('0x32')](_['pick'](_0x471134[_0x5e3b('0x31')],_0x146566[_0x5e3b('0x32')]),_0x5ee53c);if(_0x471134[_0x5e3b('0x31')][_0x5e3b('0x3c')]){_0x120bc2['where']=_['merge'](_0x120bc2[_0x5e3b('0x3b')],{'$or':_[_0x5e3b('0x2b')](_0x5ee53c,function(_0x1c352e){if(_0x1c352e['type']!==_0x5e3b('0x3d')){var _0x511cc7={};_0x511cc7[_0x1c352e[_0x5e3b('0x28')]]={'$like':'%'+_0x471134['query'][_0x5e3b('0x3c')]+'%'};return _0x511cc7;}})});}_0x120bc2=_[_0x5e3b('0x3e')]({},_0x120bc2,_0x471134[_0x5e3b('0x3f')]);var _0x38d807={'where':_0x120bc2['where']};return db[_0x5e3b('0x40')][_0x5e3b('0x1f')](_0x38d807)[_0x5e3b('0x25')](function(_0x5a64e4){_0x2de7a8[_0x5e3b('0x1f')]=_0x5a64e4;if(_0x471134[_0x5e3b('0x31')][_0x5e3b('0x41')]){_0x120bc2['include']=[{'all':!![]}];}return db['ServicenowField'][_0x5e3b('0x42')](_0x120bc2);})['then'](function(_0x32d804){_0x2de7a8['rows']=_0x32d804;return _0x2de7a8;})[_0x5e3b('0x25')](respondWithFilteredResult(_0x165bd0,_0x120bc2))[_0x5e3b('0x43')](handleError(_0x165bd0,null));};exports[_0x5e3b('0x44')]=function(_0x56286c,_0x554720){var _0x51b85d={'raw':!![],'where':{'id':_0x56286c[_0x5e3b('0x45')]['id']}},_0x10ca1a={};_0x10ca1a[_0x5e3b('0x30')]=_[_0x5e3b('0x46')](db['ServicenowField'][_0x5e3b('0x2c')]);_0x10ca1a[_0x5e3b('0x31')]=_['keys'](_0x56286c['query']);_0x10ca1a[_0x5e3b('0x32')]=_['intersection'](_0x10ca1a[_0x5e3b('0x30')],_0x10ca1a['query']);_0x51b85d[_0x5e3b('0x34')]=_['intersection'](_0x10ca1a['model'],qs[_0x5e3b('0x35')](_0x56286c[_0x5e3b('0x31')][_0x5e3b('0x35')]));_0x51b85d[_0x5e3b('0x34')]=_0x51b85d['attributes'][_0x5e3b('0x36')]?_0x51b85d['attributes']:_0x10ca1a[_0x5e3b('0x30')];if(_0x56286c[_0x5e3b('0x31')][_0x5e3b('0x41')]){_0x51b85d['include']=[{'all':!![]}];}_0x51b85d=_[_0x5e3b('0x3e')]({},_0x51b85d,_0x56286c[_0x5e3b('0x3f')]);return db[_0x5e3b('0x40')][_0x5e3b('0x47')](_0x51b85d)[_0x5e3b('0x25')](handleEntityNotFound(_0x554720,null))[_0x5e3b('0x25')](respondWithResult(_0x554720,null))[_0x5e3b('0x43')](handleError(_0x554720,null));};exports['create']=function(_0x4f9d18,_0x12e145){return db['ServicenowField']['create'](_0x4f9d18[_0x5e3b('0x48')],{})[_0x5e3b('0x25')](respondWithResult(_0x12e145,0xc9))[_0x5e3b('0x43')](handleError(_0x12e145,null));};exports[_0x5e3b('0x24')]=function(_0x39bf78,_0x369e84){if(_0x39bf78[_0x5e3b('0x48')]['id']){delete _0x39bf78[_0x5e3b('0x48')]['id'];}return db[_0x5e3b('0x40')][_0x5e3b('0x47')]({'where':{'id':_0x39bf78[_0x5e3b('0x45')]['id']}})[_0x5e3b('0x25')](handleEntityNotFound(_0x369e84,null))[_0x5e3b('0x25')](saveUpdates(_0x39bf78[_0x5e3b('0x48')],null))[_0x5e3b('0x25')](respondWithResult(_0x369e84,null))[_0x5e3b('0x43')](handleError(_0x369e84,null));};exports[_0x5e3b('0x49')]=function(_0x8cdd2a,_0x42f1da){return db[_0x5e3b('0x40')][_0x5e3b('0x47')]({'where':{'id':_0x8cdd2a[_0x5e3b('0x45')]['id']}})['then'](handleEntityNotFound(_0x42f1da,null))[_0x5e3b('0x25')](removeEntity(_0x42f1da,null))[_0x5e3b('0x43')](handleError(_0x42f1da,null));}; \ No newline at end of file +var _0xda51=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','json','apply','save','then','end','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','includeAll','options','find','create','body','params','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x30b46a,_0x501209){var _0x30172b=function(_0x4ba503){while(--_0x4ba503){_0x30b46a['push'](_0x30b46a['shift']());}};_0x30172b(++_0x501209);}(_0xda51,0x7f));var _0x1da5=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0xda51[_0x35c5a8];return _0x34782c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1da5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1da5('0x1'));var Mustache=require(_0x1da5('0x2'));var util=require(_0x1da5('0x3'));var path=require(_0x1da5('0x4'));var sox=require(_0x1da5('0x5'));var csv=require(_0x1da5('0x6'));var ejs=require(_0x1da5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1da5('0x8'));var squel=require('squel');var crypto=require(_0x1da5('0x9'));var jsforce=require(_0x1da5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1da5('0x6'));var querystring=require(_0x1da5('0xb'));var Papa=require(_0x1da5('0xc'));var Redis=require(_0x1da5('0xd'));var authService=require(_0x1da5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1da5('0xf'));var hardwareService=require(_0x1da5('0x10'));var logger=require(_0x1da5('0x11'))(_0x1da5('0x12'));var utils=require(_0x1da5('0x13'));var config=require(_0x1da5('0x14'));var licenseUtil=require(_0x1da5('0x15'));var db=require(_0x1da5('0x16'))['db'];function respondWithStatusCode(_0x2310b4,_0x4fa2a6){_0x4fa2a6=_0x4fa2a6||0xcc;return function(_0x141317){if(_0x141317){return _0x2310b4['sendStatus'](_0x4fa2a6);}return _0x2310b4[_0x1da5('0x17')](_0x4fa2a6)['end']();};}function respondWithResult(_0x4bcdaa,_0x158019){_0x158019=_0x158019||0xc8;return function(_0xaa1495){if(_0xaa1495){return _0x4bcdaa[_0x1da5('0x17')](_0x158019)['json'](_0xaa1495);}};}function respondWithFilteredResult(_0xd5f69f,_0x29d734){return function(_0x2087ed){if(_0x2087ed){var _0x260f60=typeof _0x29d734['offset']===_0x1da5('0x18')&&typeof _0x29d734[_0x1da5('0x19')]===_0x1da5('0x18');var _0x21921d=_0x2087ed[_0x1da5('0x1a')];var _0x4a675c=_0x260f60?0x0:_0x29d734['offset'];var _0x83a6ff=_0x260f60?_0x2087ed[_0x1da5('0x1a')]:_0x29d734[_0x1da5('0x1b')]+_0x29d734[_0x1da5('0x19')];var _0x438ef9;if(_0x83a6ff>=_0x21921d){_0x83a6ff=_0x21921d;_0x438ef9=0xc8;}else{_0x438ef9=0xce;}_0xd5f69f[_0x1da5('0x17')](_0x438ef9);return _0xd5f69f['set']('Content-Range',_0x4a675c+'-'+_0x83a6ff+'/'+_0x21921d)[_0x1da5('0x1c')](_0x2087ed);}return null;};}function patchUpdates(_0x3a6357){return function(_0x2ada51){try{jsonpatch[_0x1da5('0x1d')](_0x2ada51,_0x3a6357,!![]);}catch(_0x2c3edb){return BPromise['reject'](_0x2c3edb);}return _0x2ada51[_0x1da5('0x1e')]();};}function saveUpdates(_0x4b6fb1,_0x373fe1){return function(_0x4209b0){if(_0x4209b0){return _0x4209b0['update'](_0x4b6fb1)['then'](function(_0x1ed2b5){return _0x1ed2b5;});}return null;};}function removeEntity(_0x5468fc,_0x49b854){return function(_0x4a7580){if(_0x4a7580){return _0x4a7580['destroy']()[_0x1da5('0x1f')](function(){_0x5468fc[_0x1da5('0x17')](0xcc)[_0x1da5('0x20')]();});}};}function handleEntityNotFound(_0x3eb546,_0x85ad64){return function(_0xa6934f){if(!_0xa6934f){_0x3eb546['sendStatus'](0x194);}return _0xa6934f;};}function handleError(_0x2986ee,_0x34beb2){_0x34beb2=_0x34beb2||0x1f4;return function(_0xebdb98){logger[_0x1da5('0x21')](_0xebdb98[_0x1da5('0x22')]);if(_0xebdb98[_0x1da5('0x23')]){delete _0xebdb98[_0x1da5('0x23')];}_0x2986ee[_0x1da5('0x17')](_0x34beb2)[_0x1da5('0x24')](_0xebdb98);};}exports[_0x1da5('0x25')]=function(_0x2034a0,_0x36db1f){var _0x25ac42={},_0x15621e={},_0x25c8f0={'count':0x0,'rows':[]};var _0x44a90b=_['map'](db[_0x1da5('0x26')][_0x1da5('0x27')],function(_0x1bb39e){return{'name':_0x1bb39e[_0x1da5('0x28')],'type':_0x1bb39e[_0x1da5('0x29')][_0x1da5('0x2a')]};});_0x15621e[_0x1da5('0x2b')]=_[_0x1da5('0x2c')](_0x44a90b,_0x1da5('0x23'));_0x15621e[_0x1da5('0x2d')]=_[_0x1da5('0x2e')](_0x2034a0[_0x1da5('0x2d')]);_0x15621e[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x15621e[_0x1da5('0x2b')],_0x15621e['query']);_0x25ac42['attributes']=_[_0x1da5('0x30')](_0x15621e[_0x1da5('0x2b')],qs['fields'](_0x2034a0['query'][_0x1da5('0x31')]));_0x25ac42[_0x1da5('0x32')]=_0x25ac42[_0x1da5('0x32')]['length']?_0x25ac42[_0x1da5('0x32')]:_0x15621e[_0x1da5('0x2b')];if(!_0x2034a0['query']['hasOwnProperty']('nolimit')){_0x25ac42[_0x1da5('0x19')]=qs[_0x1da5('0x19')](_0x2034a0[_0x1da5('0x2d')][_0x1da5('0x19')]);_0x25ac42[_0x1da5('0x1b')]=qs[_0x1da5('0x1b')](_0x2034a0[_0x1da5('0x2d')]['offset']);}_0x25ac42[_0x1da5('0x33')]=qs[_0x1da5('0x34')](_0x2034a0[_0x1da5('0x2d')]['sort']);_0x25ac42[_0x1da5('0x35')]=qs[_0x1da5('0x2f')](_[_0x1da5('0x36')](_0x2034a0[_0x1da5('0x2d')],_0x15621e['filters']),_0x44a90b);if(_0x2034a0[_0x1da5('0x2d')][_0x1da5('0x37')]){_0x25ac42[_0x1da5('0x35')]=_[_0x1da5('0x38')](_0x25ac42[_0x1da5('0x35')],{'$or':_[_0x1da5('0x2c')](_0x44a90b,function(_0x2443bb){if(_0x2443bb[_0x1da5('0x29')]!==_0x1da5('0x39')){var _0xb1e066={};_0xb1e066[_0x2443bb['name']]={'$like':'%'+_0x2034a0['query'][_0x1da5('0x37')]+'%'};return _0xb1e066;}})});}_0x25ac42=_[_0x1da5('0x38')]({},_0x25ac42,_0x2034a0['options']);var _0xe0d8c6={'where':_0x25ac42['where']};return db[_0x1da5('0x26')]['count'](_0xe0d8c6)[_0x1da5('0x1f')](function(_0x21282b){_0x25c8f0[_0x1da5('0x1a')]=_0x21282b;if(_0x2034a0['query']['includeAll']){_0x25ac42[_0x1da5('0x3a')]=[{'all':!![]}];}return db[_0x1da5('0x26')]['findAll'](_0x25ac42);})[_0x1da5('0x1f')](function(_0x2795f7){_0x25c8f0[_0x1da5('0x3b')]=_0x2795f7;return _0x25c8f0;})['then'](respondWithFilteredResult(_0x36db1f,_0x25ac42))[_0x1da5('0x3c')](handleError(_0x36db1f,null));};exports[_0x1da5('0x3d')]=function(_0x525106,_0x597af2){var _0x2c2f39={'raw':!![],'where':{'id':_0x525106['params']['id']}},_0x496242={};_0x496242[_0x1da5('0x2b')]=_[_0x1da5('0x2e')](db[_0x1da5('0x26')][_0x1da5('0x27')]);_0x496242[_0x1da5('0x2d')]=_[_0x1da5('0x2e')](_0x525106['query']);_0x496242[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x496242[_0x1da5('0x2b')],_0x496242[_0x1da5('0x2d')]);_0x2c2f39['attributes']=_[_0x1da5('0x30')](_0x496242[_0x1da5('0x2b')],qs['fields'](_0x525106['query']['fields']));_0x2c2f39[_0x1da5('0x32')]=_0x2c2f39[_0x1da5('0x32')]['length']?_0x2c2f39['attributes']:_0x496242['model'];if(_0x525106[_0x1da5('0x2d')][_0x1da5('0x3e')]){_0x2c2f39[_0x1da5('0x3a')]=[{'all':!![]}];}_0x2c2f39=_[_0x1da5('0x38')]({},_0x2c2f39,_0x525106[_0x1da5('0x3f')]);return db['ServicenowField'][_0x1da5('0x40')](_0x2c2f39)[_0x1da5('0x1f')](handleEntityNotFound(_0x597af2,null))['then'](respondWithResult(_0x597af2,null))[_0x1da5('0x3c')](handleError(_0x597af2,null));};exports[_0x1da5('0x41')]=function(_0x3ffd58,_0x27c778){return db[_0x1da5('0x26')][_0x1da5('0x41')](_0x3ffd58['body'],{})['then'](respondWithResult(_0x27c778,0xc9))[_0x1da5('0x3c')](handleError(_0x27c778,null));};exports['update']=function(_0x28c4bc,_0x5cb158){if(_0x28c4bc['body']['id']){delete _0x28c4bc[_0x1da5('0x42')]['id'];}return db[_0x1da5('0x26')][_0x1da5('0x40')]({'where':{'id':_0x28c4bc[_0x1da5('0x43')]['id']}})[_0x1da5('0x1f')](handleEntityNotFound(_0x5cb158,null))[_0x1da5('0x1f')](saveUpdates(_0x28c4bc[_0x1da5('0x42')],null))['then'](respondWithResult(_0x5cb158,null))[_0x1da5('0x3c')](handleError(_0x5cb158,null));};exports['destroy']=function(_0x1bcd24,_0x1dcbda){return db[_0x1da5('0x26')][_0x1da5('0x40')]({'where':{'id':_0x1bcd24[_0x1da5('0x43')]['id']}})[_0x1da5('0x1f')](handleEntityNotFound(_0x1dcbda,null))[_0x1da5('0x1f')](removeEntity(_0x1dcbda,null))[_0x1da5('0x3c')](handleError(_0x1dcbda,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 0853590..c467718 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 _0xbd05=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0xbd05,0x169));var _0x5bd0=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0xbd05[_0x4e7af4];return _0x2548f1;};'use strict';var _=require(_0x5bd0('0x0'));var util=require(_0x5bd0('0x1'));var logger=require('../../config/logger')(_0x5bd0('0x2'));var moment=require('moment');var BPromise=require(_0x5bd0('0x3'));var rp=require(_0x5bd0('0x4'));var fs=require('fs');var path=require(_0x5bd0('0x5'));var rimraf=require(_0x5bd0('0x6'));var config=require(_0x5bd0('0x7'));var attributes=require(_0x5bd0('0x8'));module[_0x5bd0('0x9')]=function(_0x1a765b,_0x10272e){return _0x1a765b[_0x5bd0('0xa')](_0x5bd0('0xb'),attributes,{'tableName':_0x5bd0('0xc'),'paranoid':![],'indexes':[{'name':_0x5bd0('0xd'),'fields':[_0x5bd0('0xe'),_0x5bd0('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23e8=['api','moment','bluebird','path','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util'];(function(_0x12a2e6,_0x23966e){var _0x287c1c=function(_0x5c92e8){while(--_0x5c92e8){_0x12a2e6['push'](_0x12a2e6['shift']());}};_0x287c1c(++_0x23966e);}(_0x23e8,0x1d2));var _0x823e=function(_0x472f92,_0x1fc731){_0x472f92=_0x472f92-0x0;var _0x3814e8=_0x23e8[_0x472f92];return _0x3814e8;};'use strict';var _=require(_0x823e('0x0'));var util=require(_0x823e('0x1'));var logger=require('../../config/logger')(_0x823e('0x2'));var moment=require(_0x823e('0x3'));var BPromise=require(_0x823e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x823e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x823e('0x6')]=function(_0x150997,_0x53840f){return _0x150997[_0x823e('0x7')](_0x823e('0x8'),attributes,{'tableName':_0x823e('0x9'),'paranoid':![],'indexes':[{'name':_0x823e('0xa'),'fields':[_0x823e('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 18ba59b..eb6fef0 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x5723f4,_0x1e6ea7){var _0x4fd299=function(_0x35400d){while(--_0x35400d){_0x5723f4['push'](_0x5723f4['shift']());}};_0x4fd299(++_0x1e6ea7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x567e5d,_0x2a4ed0){_0x567e5d=_0x567e5d-0x0;var _0x53500e=_0x9ffd[_0x567e5d];return _0x53500e;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x52a903,_0x3bab0f){var _0x14a58e=function(_0x325805){while(--_0x325805){_0x52a903['push'](_0x52a903['shift']());}};_0x14a58e(++_0x3bab0f);}(_0xaa88,0x137));var _0x8aa8=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0xaa88[_0x32bb6b];return _0x58dcb4;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e382d88..6bb5a34 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(_0x4671cd,_0xe94724){var _0xede861=function(_0x367e9f){while(--_0x367e9f){_0x4671cd['push'](_0x4671cd['shift']());}};_0xede861(++_0xe94724);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x253ea5,_0x1e7d1f){var _0x591b87=function(_0x10459e){while(--_0x10459e){_0x253ea5['push'](_0x253ea5['shift']());}};_0x591b87(++_0x1e7d1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 9ed918e..f876a53 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(_0x535e4c,_0x5015dd){var _0x5a5000=function(_0x95d284){while(--_0x95d284){_0x535e4c['push'](_0x535e4c['shift']());}};_0x5a5000(++_0x5015dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x8ff69c,_0x32b12e){var _0x155baf=function(_0x47764d){while(--_0x47764d){_0x8ff69c['push'](_0x8ff69c['shift']());}};_0x155baf(++_0x32b12e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 1c0eaa9..dea81e7 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 _0xf243=['addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','created_by','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','includes','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','sendStatus','error','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','then','include','show','includeAll','options','catch','create','body','params','find','getConfigurations','findOne','filter'];(function(_0x87aa1b,_0x41f4d9){var _0x405f7d=function(_0x59746a){while(--_0x59746a){_0x87aa1b['push'](_0x87aa1b['shift']());}};_0x405f7d(++_0x41f4d9);}(_0xf243,0x181));var _0x3f24=function(_0x656c05,_0x1d4b18){_0x656c05=_0x656c05-0x0;var _0x28475a=_0xf243[_0x656c05];return _0x28475a;};'use strict';var emlformat=require(_0x3f24('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3f24('0x1'));var rp=require(_0x3f24('0x2'));var moment=require('moment');var BPromise=require(_0x3f24('0x3'));var Mustache=require(_0x3f24('0x4'));var util=require(_0x3f24('0x5'));var path=require(_0x3f24('0x6'));var sox=require(_0x3f24('0x7'));var csv=require(_0x3f24('0x8'));var ejs=require(_0x3f24('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f24('0xa'));var squel=require(_0x3f24('0xb'));var crypto=require(_0x3f24('0xc'));var jsforce=require(_0x3f24('0xd'));var deskjs=require(_0x3f24('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f24('0xf'));var Redis=require(_0x3f24('0x10'));var authService=require(_0x3f24('0x11'));var qs=require(_0x3f24('0x12'));var as=require(_0x3f24('0x13'));var hardwareService=require(_0x3f24('0x14'));var logger=require(_0x3f24('0x15'))(_0x3f24('0x16'));var utils=require(_0x3f24('0x17'));var config=require(_0x3f24('0x18'));var licenseUtil=require(_0x3f24('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3f24('0x1a'));function respondWithStatusCode(_0x4135f8,_0x219071){_0x219071=_0x219071||0xcc;return function(_0xc1918d){if(_0xc1918d){return _0x4135f8['sendStatus'](_0x219071);}return _0x4135f8['status'](_0x219071)[_0x3f24('0x1b')]();};}function respondWithResult(_0x4786a2,_0x52319d){_0x52319d=_0x52319d||0xc8;return function(_0x183f82){if(_0x183f82){return _0x4786a2[_0x3f24('0x1c')](_0x52319d)['json'](_0x183f82);}};}function respondWithFilteredResult(_0x323ee5,_0x2af84b){return function(_0x172860){if(_0x172860){var _0x4c5a3b=typeof _0x2af84b[_0x3f24('0x1d')]===_0x3f24('0x1e')&&typeof _0x2af84b['limit']==='undefined';var _0x3305b3=_0x172860[_0x3f24('0x1f')];var _0x4a6a0a=_0x4c5a3b?0x0:_0x2af84b[_0x3f24('0x1d')];var _0x2637b9=_0x4c5a3b?_0x172860[_0x3f24('0x1f')]:_0x2af84b['offset']+_0x2af84b[_0x3f24('0x20')];var _0x5c859b;if(_0x2637b9>=_0x3305b3){_0x2637b9=_0x3305b3;_0x5c859b=0xc8;}else{_0x5c859b=0xce;}_0x323ee5[_0x3f24('0x1c')](_0x5c859b);return _0x323ee5[_0x3f24('0x21')](_0x3f24('0x22'),_0x4a6a0a+'-'+_0x2637b9+'/'+_0x3305b3)[_0x3f24('0x23')](_0x172860);}return null;};}function patchUpdates(_0x4d928e){return function(_0x5de0e5){try{jsonpatch['apply'](_0x5de0e5,_0x4d928e,!![]);}catch(_0x365e54){return BPromise[_0x3f24('0x24')](_0x365e54);}return _0x5de0e5[_0x3f24('0x25')]();};}function saveUpdates(_0x1c52a8,_0x599f40){return function(_0x30ff23){if(_0x30ff23){return _0x30ff23[_0x3f24('0x26')](_0x1c52a8)['then'](function(_0x308410){return _0x308410;});}return null;};}function removeEntity(_0x17e390,_0x51c40d){return function(_0x248d7f){if(_0x248d7f){return _0x248d7f[_0x3f24('0x27')]()['then'](function(){_0x17e390[_0x3f24('0x1c')](0xcc)[_0x3f24('0x1b')]();});}};}function handleEntityNotFound(_0x263a91,_0x6895d9){return function(_0x50fc58){if(!_0x50fc58){_0x263a91[_0x3f24('0x28')](0x194);}return _0x50fc58;};}function handleError(_0x2cc009,_0x16da16){_0x16da16=_0x16da16||0x1f4;return function(_0x2c2401){logger[_0x3f24('0x29')](_0x2c2401['stack']);if(_0x2c2401['name']){delete _0x2c2401[_0x3f24('0x2a')];}_0x2cc009[_0x3f24('0x1c')](_0x16da16)['send'](_0x2c2401);};}exports[_0x3f24('0x2b')]=function(_0x3c8ac6,_0x458e6c){var _0x44985f={},_0x58e06b={},_0x3d2bfd={'count':0x0,'rows':[]};var _0x15c5a0=_[_0x3f24('0x2c')](db[_0x3f24('0x2d')][_0x3f24('0x2e')],function(_0x1db35f){return{'name':_0x1db35f[_0x3f24('0x2f')],'type':_0x1db35f[_0x3f24('0x30')][_0x3f24('0x31')]};});_0x58e06b[_0x3f24('0x32')]=_['map'](_0x15c5a0,_0x3f24('0x2a'));_0x58e06b[_0x3f24('0x33')]=_[_0x3f24('0x34')](_0x3c8ac6[_0x3f24('0x33')]);_0x58e06b[_0x3f24('0x35')]=_[_0x3f24('0x36')](_0x58e06b[_0x3f24('0x32')],_0x58e06b[_0x3f24('0x33')]);_0x44985f[_0x3f24('0x37')]=_[_0x3f24('0x36')](_0x58e06b[_0x3f24('0x32')],qs[_0x3f24('0x38')](_0x3c8ac6[_0x3f24('0x33')]['fields']));_0x44985f[_0x3f24('0x37')]=_0x44985f[_0x3f24('0x37')][_0x3f24('0x39')]?_0x44985f[_0x3f24('0x37')]:_0x58e06b[_0x3f24('0x32')];if(!_0x3c8ac6[_0x3f24('0x33')][_0x3f24('0x3a')](_0x3f24('0x3b'))){_0x44985f['limit']=qs[_0x3f24('0x20')](_0x3c8ac6['query']['limit']);_0x44985f[_0x3f24('0x1d')]=qs['offset'](_0x3c8ac6['query'][_0x3f24('0x1d')]);}_0x44985f[_0x3f24('0x3c')]=qs[_0x3f24('0x3d')](_0x3c8ac6[_0x3f24('0x33')][_0x3f24('0x3d')]);_0x44985f['where']=qs[_0x3f24('0x35')](_[_0x3f24('0x3e')](_0x3c8ac6[_0x3f24('0x33')],_0x58e06b[_0x3f24('0x35')]),_0x15c5a0);if(_0x3c8ac6['query']['filter']){_0x44985f[_0x3f24('0x3f')]=_[_0x3f24('0x40')](_0x44985f['where'],{'$or':_['map'](_0x15c5a0,function(_0x13644c){if(_0x13644c['type']!==_0x3f24('0x41')){var _0x27bbd1={};_0x27bbd1[_0x13644c[_0x3f24('0x2a')]]={'$like':'%'+_0x3c8ac6[_0x3f24('0x33')]['filter']+'%'};return _0x27bbd1;}})});}_0x44985f=_[_0x3f24('0x40')]({},_0x44985f,_0x3c8ac6['options']);var _0x24510c={'where':_0x44985f[_0x3f24('0x3f')]};return db['SugarcrmAccount']['count'](_0x24510c)[_0x3f24('0x42')](function(_0x542f7c){_0x3d2bfd[_0x3f24('0x1f')]=_0x542f7c;if(_0x3c8ac6[_0x3f24('0x33')]['includeAll']){_0x44985f[_0x3f24('0x43')]=[{'all':!![]}];}return db[_0x3f24('0x2d')]['findAll'](_0x44985f);})[_0x3f24('0x42')](function(_0x2dfd26){_0x3d2bfd['rows']=_0x2dfd26;return _0x3d2bfd;})[_0x3f24('0x42')](respondWithFilteredResult(_0x458e6c,_0x44985f))['catch'](handleError(_0x458e6c,null));};exports[_0x3f24('0x44')]=function(_0x466af5,_0x15c040){var _0x364d19={'raw':![],'where':{'id':_0x466af5['params']['id']}},_0xd6bcd0={};_0xd6bcd0[_0x3f24('0x32')]=_['keys'](db[_0x3f24('0x2d')][_0x3f24('0x2e')]);_0xd6bcd0[_0x3f24('0x33')]=_[_0x3f24('0x34')](_0x466af5[_0x3f24('0x33')]);_0xd6bcd0['filters']=_[_0x3f24('0x36')](_0xd6bcd0['model'],_0xd6bcd0[_0x3f24('0x33')]);_0x364d19[_0x3f24('0x37')]=_[_0x3f24('0x36')](_0xd6bcd0[_0x3f24('0x32')],qs[_0x3f24('0x38')](_0x466af5[_0x3f24('0x33')][_0x3f24('0x38')]));_0x364d19[_0x3f24('0x37')]=_0x364d19[_0x3f24('0x37')]['length']?_0x364d19[_0x3f24('0x37')]:_0xd6bcd0[_0x3f24('0x32')];if(_0x466af5['query'][_0x3f24('0x45')]){_0x364d19[_0x3f24('0x43')]=[{'all':!![]}];}_0x364d19=_[_0x3f24('0x40')]({},_0x364d19,_0x466af5[_0x3f24('0x46')]);return db['SugarcrmAccount']['find'](_0x364d19)['then'](handleEntityNotFound(_0x15c040,null))[_0x3f24('0x42')](respondWithResult(_0x15c040,null))[_0x3f24('0x47')](handleError(_0x15c040,null));};exports[_0x3f24('0x48')]=function(_0x5e4ef7,_0x652441){return db[_0x3f24('0x2d')][_0x3f24('0x48')](_0x5e4ef7['body'],{})[_0x3f24('0x42')](respondWithResult(_0x652441,0xc9))[_0x3f24('0x47')](handleError(_0x652441,null));};exports[_0x3f24('0x26')]=function(_0x320549,_0x43ec69){if(_0x320549[_0x3f24('0x49')]['id']){delete _0x320549[_0x3f24('0x49')]['id'];}return db[_0x3f24('0x2d')]['find']({'where':{'id':_0x320549[_0x3f24('0x4a')]['id']}})[_0x3f24('0x42')](handleEntityNotFound(_0x43ec69,null))[_0x3f24('0x42')](saveUpdates(_0x320549[_0x3f24('0x49')],null))['then'](respondWithResult(_0x43ec69,null))[_0x3f24('0x47')](handleError(_0x43ec69,null));};exports[_0x3f24('0x27')]=function(_0x141a41,_0xab8fa3){return db[_0x3f24('0x2d')][_0x3f24('0x4b')]({'where':{'id':_0x141a41[_0x3f24('0x4a')]['id']}})[_0x3f24('0x42')](handleEntityNotFound(_0xab8fa3,null))[_0x3f24('0x42')](removeEntity(_0xab8fa3,null))[_0x3f24('0x47')](handleError(_0xab8fa3,null));};exports[_0x3f24('0x4c')]=function(_0x2fa304,_0x5c0e79,_0x5a17c8){var _0x243c64={};var _0x3e66ea={};var _0x14594a;var _0x4a5b83;return db[_0x3f24('0x2d')][_0x3f24('0x4d')]({'where':{'id':_0x2fa304[_0x3f24('0x4a')]['id']}})[_0x3f24('0x42')](handleEntityNotFound(_0x5c0e79,null))['then'](function(_0x5c6a46){if(_0x5c6a46){_0x14594a=_0x5c6a46;_0x3e66ea[_0x3f24('0x32')]=_[_0x3f24('0x34')](db['SugarcrmConfiguration'][_0x3f24('0x2e')]);_0x3e66ea[_0x3f24('0x33')]=_[_0x3f24('0x34')](_0x2fa304[_0x3f24('0x33')]);_0x3e66ea[_0x3f24('0x35')]=_[_0x3f24('0x36')](_0x3e66ea[_0x3f24('0x32')],_0x3e66ea[_0x3f24('0x33')]);_0x243c64[_0x3f24('0x37')]=_[_0x3f24('0x36')](_0x3e66ea[_0x3f24('0x32')],qs[_0x3f24('0x38')](_0x2fa304['query'][_0x3f24('0x38')]));_0x243c64[_0x3f24('0x37')]=_0x243c64[_0x3f24('0x37')][_0x3f24('0x39')]?_0x243c64[_0x3f24('0x37')]:_0x3e66ea['model'];_0x243c64[_0x3f24('0x3c')]=qs[_0x3f24('0x3d')](_0x2fa304[_0x3f24('0x33')][_0x3f24('0x3d')]);_0x243c64[_0x3f24('0x3f')]=qs['filters'](_['pick'](_0x2fa304[_0x3f24('0x33')],_0x3e66ea[_0x3f24('0x35')]));if(_0x2fa304[_0x3f24('0x33')]['filter']){_0x243c64[_0x3f24('0x3f')]=_[_0x3f24('0x40')](_0x243c64['where'],{'$or':_[_0x3f24('0x2c')](_0x243c64['attributes'],function(_0xa7e7f2){var _0xb99790={};_0xb99790[_0xa7e7f2]={'$like':'%'+_0x2fa304[_0x3f24('0x33')][_0x3f24('0x4e')]+'%'};return _0xb99790;})});}_0x243c64=_['merge']({},_0x243c64,_0x2fa304['options']);return _0x14594a['getConfigurations'](_0x243c64);}})[_0x3f24('0x42')](function(_0x4f0468){if(_0x4f0468){_0x4a5b83=_0x4f0468[_0x3f24('0x39')];if(!_0x2fa304['query'][_0x3f24('0x3a')](_0x3f24('0x3b'))){_0x243c64[_0x3f24('0x20')]=qs['limit'](_0x2fa304[_0x3f24('0x33')]['limit']);_0x243c64[_0x3f24('0x1d')]=qs[_0x3f24('0x1d')](_0x2fa304[_0x3f24('0x33')][_0x3f24('0x1d')]);}return _0x14594a[_0x3f24('0x4c')](_0x243c64);}})['then'](function(_0x185b8c){if(_0x185b8c){return _0x185b8c?{'count':_0x4a5b83,'rows':_0x185b8c}:null;}})[_0x3f24('0x42')](respondWithResult(_0x5c0e79,null))[_0x3f24('0x47')](handleError(_0x5c0e79,null));};exports[_0x3f24('0x4f')]=function(_0xa26b3c,_0x4b7dc6,_0x1ea4c5){if(_0xa26b3c['body']['id']){delete _0xa26b3c[_0x3f24('0x49')]['id'];}return db[_0x3f24('0x2d')][_0x3f24('0x4d')]({'where':{'id':_0xa26b3c[_0x3f24('0x4a')]['id']}})[_0x3f24('0x42')](handleEntityNotFound(_0x4b7dc6,null))[_0x3f24('0x42')](function(_0x41b850){if(_0x41b850){_0xa26b3c[_0x3f24('0x49')][_0x3f24('0x50')]=_0x41b850['id'];_0xa26b3c[_0x3f24('0x49')][_0x3f24('0x51')]=integrations['getSubjects'](_0xa26b3c[_0x3f24('0x49')][_0x3f24('0x52')],_0xa26b3c[_0x3f24('0x49')][_0x3f24('0x30')]);_0xa26b3c[_0x3f24('0x49')][_0x3f24('0x53')]=integrations[_0x3f24('0x54')](_0xa26b3c[_0x3f24('0x49')]['channel'],_0xa26b3c[_0x3f24('0x49')][_0x3f24('0x30')]);return db[_0x3f24('0x55')][_0x3f24('0x48')](_0xa26b3c[_0x3f24('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0x3f24('0x51')},{'model':db[_0x3f24('0x56')],'as':_0x3f24('0x53')}]});}return null;})[_0x3f24('0x42')](respondWithResult(_0x4b7dc6,null))[_0x3f24('0x47')](handleError(_0x4b7dc6,null));};exports[_0x3f24('0x57')]=function(_0x187f4a,_0xafa58,_0x18d6a7){var _0x629ebb='';var _0x463eae=['id','name','assigned_user_id',_0x3f24('0x58'),'description','date_start',_0x3f24('0x59'),_0x3f24('0x5a'),_0x3f24('0x5b'),_0x3f24('0x5c'),'parent_name',_0x3f24('0x5d')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x187f4a[_0x3f24('0x4a')]['id']},'attributes':['id',_0x3f24('0x5e'),_0x3f24('0x5f'),'remoteUri']})['then'](handleEntityNotFound(_0xafa58,null))[_0x3f24('0x42')](function(_0x56103c){if(_0x56103c){_0x629ebb=_0x56103c[_0x3f24('0x60')];var _0x2bd6ce=_0x629ebb['slice'](-0x1);if(_0x2bd6ce==='/'){_0x629ebb=_0x629ebb[_0x3f24('0x61')](0x0,_0x629ebb['lastIndexOf'](_0x2bd6ce));}return rp({'method':'POST','uri':util[_0x3f24('0x62')](_0x3f24('0x63'),_0x629ebb,_0x3f24('0x64')),'json':!![],'form':{'method':_0x3f24('0x65'),'input_type':_0x3f24('0x66'),'response_type':'JSON','rest_data':JSON[_0x3f24('0x67')]({'user_auth':{'user_name':_0x56103c[_0x3f24('0x5e')],'password':_0x56103c['password'],'encryption':_0x3f24('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x4fa9a7){if(_0x4fa9a7&&_0x4fa9a7[_0x3f24('0x2a')]!=='Invalid\x20Login'&&_0x4fa9a7[_0x3f24('0x2a')]!==_0x3f24('0x69')){return rp({'method':_0x3f24('0x6a'),'uri':util[_0x3f24('0x62')](_0x3f24('0x63'),_0x629ebb,_0x3f24('0x64')),'json':!![],'form':{'method':_0x3f24('0x6b'),'input_type':_0x3f24('0x66'),'response_type':_0x3f24('0x66'),'rest_data':JSON[_0x3f24('0x67')]({'session':_0x4fa9a7['id'],'module_name':_0x3f24('0x6c')})}})[_0x3f24('0x42')](function(_0x3eeb56){if(_0x3eeb56){var _0x5caee9=_[_0x3f24('0x6d')](_0x3eeb56[_0x3f24('0x6e')]);_['remove'](_0x5caee9,function(_0x93dc4a){return _0x463eae[_0x3f24('0x6f')](_0x93dc4a[_0x3f24('0x2a')]);});return{'count':_0x5caee9[_0x3f24('0x39')],'rows':_[_0x3f24('0x2c')](_0x5caee9,function(_0x1fbdb0){return{'id':_0x1fbdb0[_0x3f24('0x2a')],'name':_0x1fbdb0['label'],'custom':_['endsWith'](_0x1fbdb0['name'],'_c')?!![]:![],'options':_0x1fbdb0[_0x3f24('0x46')]?_[_0x3f24('0x2c')](_[_0x3f24('0x6d')](_0x1fbdb0[_0x3f24('0x46')]),function(_0x22b27c){return{'name':_0x22b27c['value'],'value':_0x22b27c[_0x3f24('0x2a')]};}):[]};})};}})[_0x3f24('0x42')](respondWithResult(_0xafa58,null))['catch'](function(_0x5287f9){var _0x106f47=_0x187f4a['query'][_0x3f24('0x70')]?0x1f4:_0x5287f9['statusCode']||0x1f4;logger[_0x3f24('0x29')](_0x3f24('0x71'),'getFields',_0x106f47,JSON[_0x3f24('0x67')](_0x5287f9));delete _0x5287f9['name'];if(_0x106f47===0x191){_0x106f47=0x190;}_0xafa58[_0x3f24('0x1c')](_0x106f47)[_0x3f24('0x72')](_0x187f4a['query'][_0x3f24('0x70')]?{'message':_0x3f24('0x73'),'statusCode':_0x5287f9['statusCode']}:_0x5287f9);});}else{var _0x246baf=0x1f4;_0xafa58[_0x3f24('0x1c')](_0x246baf)[_0x3f24('0x72')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x3a0c=['%s%s','/service/v4_1/rest.php','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','remove','includes','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','length','includeAll','options','find','create','update','body','params','SugarcrmConfiguration','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','Subjects','getFields','assigned_user_id','date_start','duration_hours','parent_id','parent_type','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3a0c,0x8c));var _0xc3a0=function(_0x3e25cd,_0x297b9b){_0x3e25cd=_0x3e25cd-0x0;var _0x4a6da5=_0x3a0c[_0x3e25cd];return _0x4a6da5;};'use strict';var emlformat=require(_0xc3a0('0x0'));var rimraf=require(_0xc3a0('0x1'));var zipdir=require(_0xc3a0('0x2'));var jsonpatch=require(_0xc3a0('0x3'));var rp=require(_0xc3a0('0x4'));var moment=require(_0xc3a0('0x5'));var BPromise=require(_0xc3a0('0x6'));var Mustache=require(_0xc3a0('0x7'));var util=require(_0xc3a0('0x8'));var path=require(_0xc3a0('0x9'));var sox=require(_0xc3a0('0xa'));var csv=require(_0xc3a0('0xb'));var ejs=require(_0xc3a0('0xc'));var fs=require('fs');var fs_extra=require(_0xc3a0('0xd'));var _=require(_0xc3a0('0xe'));var squel=require(_0xc3a0('0xf'));var crypto=require('crypto');var jsforce=require(_0xc3a0('0x10'));var deskjs=require(_0xc3a0('0x11'));var toCsv=require(_0xc3a0('0xb'));var querystring=require(_0xc3a0('0x12'));var Papa=require(_0xc3a0('0x13'));var Redis=require(_0xc3a0('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc3a0('0x15'));var as=require(_0xc3a0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3a0('0x17'))(_0xc3a0('0x18'));var utils=require(_0xc3a0('0x19'));var config=require(_0xc3a0('0x1a'));var licenseUtil=require(_0xc3a0('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5a139d,_0x20fb56){_0x20fb56=_0x20fb56||0xcc;return function(_0x9258e6){if(_0x9258e6){return _0x5a139d['sendStatus'](_0x20fb56);}return _0x5a139d[_0xc3a0('0x1c')](_0x20fb56)[_0xc3a0('0x1d')]();};}function respondWithResult(_0x563438,_0x5cf73d){_0x5cf73d=_0x5cf73d||0xc8;return function(_0x22ac51){if(_0x22ac51){return _0x563438[_0xc3a0('0x1c')](_0x5cf73d)[_0xc3a0('0x1e')](_0x22ac51);}};}function respondWithFilteredResult(_0x3f0988,_0x3865c3){return function(_0x5a1653){if(_0x5a1653){var _0x50686c=typeof _0x3865c3[_0xc3a0('0x1f')]===_0xc3a0('0x20')&&typeof _0x3865c3[_0xc3a0('0x21')]==='undefined';var _0x478f61=_0x5a1653[_0xc3a0('0x22')];var _0x251a01=_0x50686c?0x0:_0x3865c3[_0xc3a0('0x1f')];var _0x215484=_0x50686c?_0x5a1653[_0xc3a0('0x22')]:_0x3865c3[_0xc3a0('0x1f')]+_0x3865c3[_0xc3a0('0x21')];var _0x24d7d7;if(_0x215484>=_0x478f61){_0x215484=_0x478f61;_0x24d7d7=0xc8;}else{_0x24d7d7=0xce;}_0x3f0988[_0xc3a0('0x1c')](_0x24d7d7);return _0x3f0988[_0xc3a0('0x23')](_0xc3a0('0x24'),_0x251a01+'-'+_0x215484+'/'+_0x478f61)[_0xc3a0('0x1e')](_0x5a1653);}return null;};}function patchUpdates(_0x5ca346){return function(_0x42e4f4){try{jsonpatch[_0xc3a0('0x25')](_0x42e4f4,_0x5ca346,!![]);}catch(_0x5d3d1f){return BPromise[_0xc3a0('0x26')](_0x5d3d1f);}return _0x42e4f4[_0xc3a0('0x27')]();};}function saveUpdates(_0x1150e6,_0xdb664b){return function(_0x2589bb){if(_0x2589bb){return _0x2589bb['update'](_0x1150e6)[_0xc3a0('0x28')](function(_0x3d0db8){return _0x3d0db8;});}return null;};}function removeEntity(_0x449368,_0x41bb7a){return function(_0x94447){if(_0x94447){return _0x94447[_0xc3a0('0x29')]()[_0xc3a0('0x28')](function(){_0x449368[_0xc3a0('0x1c')](0xcc)[_0xc3a0('0x1d')]();});}};}function handleEntityNotFound(_0x1e4b06,_0x35cff4){return function(_0x204e86){if(!_0x204e86){_0x1e4b06[_0xc3a0('0x2a')](0x194);}return _0x204e86;};}function handleError(_0xb31364,_0x14989c){_0x14989c=_0x14989c||0x1f4;return function(_0xa41d78){logger[_0xc3a0('0x2b')](_0xa41d78[_0xc3a0('0x2c')]);if(_0xa41d78[_0xc3a0('0x2d')]){delete _0xa41d78[_0xc3a0('0x2d')];}_0xb31364['status'](_0x14989c)[_0xc3a0('0x2e')](_0xa41d78);};}exports['index']=function(_0x3362fe,_0x16d643){var _0x24de7d={},_0x296e59={},_0x4321bc={'count':0x0,'rows':[]};var _0x3c819e=_['map'](db[_0xc3a0('0x2f')][_0xc3a0('0x30')],function(_0x488d9b){return{'name':_0x488d9b[_0xc3a0('0x31')],'type':_0x488d9b[_0xc3a0('0x32')][_0xc3a0('0x33')]};});_0x296e59['model']=_[_0xc3a0('0x34')](_0x3c819e,_0xc3a0('0x2d'));_0x296e59[_0xc3a0('0x35')]=_[_0xc3a0('0x36')](_0x3362fe[_0xc3a0('0x35')]);_0x296e59[_0xc3a0('0x37')]=_[_0xc3a0('0x38')](_0x296e59[_0xc3a0('0x39')],_0x296e59[_0xc3a0('0x35')]);_0x24de7d[_0xc3a0('0x3a')]=_[_0xc3a0('0x38')](_0x296e59['model'],qs['fields'](_0x3362fe[_0xc3a0('0x35')][_0xc3a0('0x3b')]));_0x24de7d['attributes']=_0x24de7d['attributes']['length']?_0x24de7d[_0xc3a0('0x3a')]:_0x296e59[_0xc3a0('0x39')];if(!_0x3362fe[_0xc3a0('0x35')]['hasOwnProperty'](_0xc3a0('0x3c'))){_0x24de7d[_0xc3a0('0x21')]=qs[_0xc3a0('0x21')](_0x3362fe[_0xc3a0('0x35')]['limit']);_0x24de7d[_0xc3a0('0x1f')]=qs['offset'](_0x3362fe[_0xc3a0('0x35')][_0xc3a0('0x1f')]);}_0x24de7d[_0xc3a0('0x3d')]=qs[_0xc3a0('0x3e')](_0x3362fe[_0xc3a0('0x35')][_0xc3a0('0x3e')]);_0x24de7d[_0xc3a0('0x3f')]=qs['filters'](_['pick'](_0x3362fe[_0xc3a0('0x35')],_0x296e59[_0xc3a0('0x37')]),_0x3c819e);if(_0x3362fe['query'][_0xc3a0('0x40')]){_0x24de7d[_0xc3a0('0x3f')]=_['merge'](_0x24de7d[_0xc3a0('0x3f')],{'$or':_[_0xc3a0('0x34')](_0x3c819e,function(_0x4bb93e){if(_0x4bb93e[_0xc3a0('0x32')]!==_0xc3a0('0x41')){var _0x1074a4={};_0x1074a4[_0x4bb93e[_0xc3a0('0x2d')]]={'$like':'%'+_0x3362fe[_0xc3a0('0x35')][_0xc3a0('0x40')]+'%'};return _0x1074a4;}})});}_0x24de7d=_[_0xc3a0('0x42')]({},_0x24de7d,_0x3362fe['options']);var _0x37cee4={'where':_0x24de7d[_0xc3a0('0x3f')]};return db[_0xc3a0('0x2f')][_0xc3a0('0x22')](_0x37cee4)[_0xc3a0('0x28')](function(_0x1ec497){_0x4321bc['count']=_0x1ec497;if(_0x3362fe[_0xc3a0('0x35')]['includeAll']){_0x24de7d[_0xc3a0('0x43')]=[{'all':!![]}];}return db[_0xc3a0('0x2f')][_0xc3a0('0x44')](_0x24de7d);})[_0xc3a0('0x28')](function(_0x5c6e2e){_0x4321bc[_0xc3a0('0x45')]=_0x5c6e2e;return _0x4321bc;})[_0xc3a0('0x28')](respondWithFilteredResult(_0x16d643,_0x24de7d))[_0xc3a0('0x46')](handleError(_0x16d643,null));};exports[_0xc3a0('0x47')]=function(_0x327062,_0x4f0156){var _0x344d81={'raw':![],'where':{'id':_0x327062['params']['id']}},_0x5d804e={};_0x5d804e[_0xc3a0('0x39')]=_['keys'](db[_0xc3a0('0x2f')][_0xc3a0('0x30')]);_0x5d804e['query']=_[_0xc3a0('0x36')](_0x327062['query']);_0x5d804e[_0xc3a0('0x37')]=_[_0xc3a0('0x38')](_0x5d804e[_0xc3a0('0x39')],_0x5d804e[_0xc3a0('0x35')]);_0x344d81['attributes']=_['intersection'](_0x5d804e[_0xc3a0('0x39')],qs[_0xc3a0('0x3b')](_0x327062[_0xc3a0('0x35')][_0xc3a0('0x3b')]));_0x344d81[_0xc3a0('0x3a')]=_0x344d81[_0xc3a0('0x3a')][_0xc3a0('0x48')]?_0x344d81[_0xc3a0('0x3a')]:_0x5d804e[_0xc3a0('0x39')];if(_0x327062[_0xc3a0('0x35')][_0xc3a0('0x49')]){_0x344d81[_0xc3a0('0x43')]=[{'all':!![]}];}_0x344d81=_['merge']({},_0x344d81,_0x327062[_0xc3a0('0x4a')]);return db['SugarcrmAccount'][_0xc3a0('0x4b')](_0x344d81)[_0xc3a0('0x28')](handleEntityNotFound(_0x4f0156,null))['then'](respondWithResult(_0x4f0156,null))[_0xc3a0('0x46')](handleError(_0x4f0156,null));};exports[_0xc3a0('0x4c')]=function(_0x3b9720,_0x4ff1f7){return db[_0xc3a0('0x2f')][_0xc3a0('0x4c')](_0x3b9720['body'],{})[_0xc3a0('0x28')](respondWithResult(_0x4ff1f7,0xc9))[_0xc3a0('0x46')](handleError(_0x4ff1f7,null));};exports[_0xc3a0('0x4d')]=function(_0x149e90,_0x1de219){if(_0x149e90[_0xc3a0('0x4e')]['id']){delete _0x149e90['body']['id'];}return db[_0xc3a0('0x2f')][_0xc3a0('0x4b')]({'where':{'id':_0x149e90[_0xc3a0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1de219,null))[_0xc3a0('0x28')](saveUpdates(_0x149e90[_0xc3a0('0x4e')],null))['then'](respondWithResult(_0x1de219,null))['catch'](handleError(_0x1de219,null));};exports[_0xc3a0('0x29')]=function(_0x14f019,_0x141f9b){return db['SugarcrmAccount']['find']({'where':{'id':_0x14f019[_0xc3a0('0x4f')]['id']}})[_0xc3a0('0x28')](handleEntityNotFound(_0x141f9b,null))[_0xc3a0('0x28')](removeEntity(_0x141f9b,null))[_0xc3a0('0x46')](handleError(_0x141f9b,null));};exports['getConfigurations']=function(_0x38e9f5,_0x58a3e3,_0x57ff96){var _0x18cd95={};var _0x269b59={};var _0x243bd8;var _0x1c6a68;return db[_0xc3a0('0x2f')]['findOne']({'where':{'id':_0x38e9f5[_0xc3a0('0x4f')]['id']}})[_0xc3a0('0x28')](handleEntityNotFound(_0x58a3e3,null))['then'](function(_0x40e9e9){if(_0x40e9e9){_0x243bd8=_0x40e9e9;_0x269b59['model']=_['keys'](db[_0xc3a0('0x50')]['rawAttributes']);_0x269b59[_0xc3a0('0x35')]=_[_0xc3a0('0x36')](_0x38e9f5[_0xc3a0('0x35')]);_0x269b59['filters']=_['intersection'](_0x269b59['model'],_0x269b59['query']);_0x18cd95[_0xc3a0('0x3a')]=_['intersection'](_0x269b59[_0xc3a0('0x39')],qs[_0xc3a0('0x3b')](_0x38e9f5[_0xc3a0('0x35')][_0xc3a0('0x3b')]));_0x18cd95[_0xc3a0('0x3a')]=_0x18cd95[_0xc3a0('0x3a')][_0xc3a0('0x48')]?_0x18cd95[_0xc3a0('0x3a')]:_0x269b59[_0xc3a0('0x39')];_0x18cd95['order']=qs[_0xc3a0('0x3e')](_0x38e9f5[_0xc3a0('0x35')][_0xc3a0('0x3e')]);_0x18cd95['where']=qs[_0xc3a0('0x37')](_[_0xc3a0('0x51')](_0x38e9f5[_0xc3a0('0x35')],_0x269b59[_0xc3a0('0x37')]));if(_0x38e9f5[_0xc3a0('0x35')][_0xc3a0('0x40')]){_0x18cd95[_0xc3a0('0x3f')]=_[_0xc3a0('0x42')](_0x18cd95['where'],{'$or':_[_0xc3a0('0x34')](_0x18cd95[_0xc3a0('0x3a')],function(_0x38ce8b){var _0x502cc1={};_0x502cc1[_0x38ce8b]={'$like':'%'+_0x38e9f5[_0xc3a0('0x35')][_0xc3a0('0x40')]+'%'};return _0x502cc1;})});}_0x18cd95=_[_0xc3a0('0x42')]({},_0x18cd95,_0x38e9f5['options']);return _0x243bd8[_0xc3a0('0x52')](_0x18cd95);}})['then'](function(_0x410338){if(_0x410338){_0x1c6a68=_0x410338[_0xc3a0('0x48')];if(!_0x38e9f5[_0xc3a0('0x35')][_0xc3a0('0x53')](_0xc3a0('0x3c'))){_0x18cd95[_0xc3a0('0x21')]=qs[_0xc3a0('0x21')](_0x38e9f5[_0xc3a0('0x35')]['limit']);_0x18cd95[_0xc3a0('0x1f')]=qs[_0xc3a0('0x1f')](_0x38e9f5[_0xc3a0('0x35')][_0xc3a0('0x1f')]);}return _0x243bd8[_0xc3a0('0x52')](_0x18cd95);}})[_0xc3a0('0x28')](function(_0x1c3ebe){if(_0x1c3ebe){return _0x1c3ebe?{'count':_0x1c6a68,'rows':_0x1c3ebe}:null;}})['then'](respondWithResult(_0x58a3e3,null))[_0xc3a0('0x46')](handleError(_0x58a3e3,null));};exports[_0xc3a0('0x54')]=function(_0x10e368,_0x4608e2,_0x1720b4){if(_0x10e368[_0xc3a0('0x4e')]['id']){delete _0x10e368[_0xc3a0('0x4e')]['id'];}return db[_0xc3a0('0x2f')]['findOne']({'where':{'id':_0x10e368[_0xc3a0('0x4f')]['id']}})[_0xc3a0('0x28')](handleEntityNotFound(_0x4608e2,null))[_0xc3a0('0x28')](function(_0x2cdfeb){if(_0x2cdfeb){_0x10e368[_0xc3a0('0x4e')][_0xc3a0('0x55')]=_0x2cdfeb['id'];_0x10e368[_0xc3a0('0x4e')]['Subjects']=integrations[_0xc3a0('0x56')](_0x10e368[_0xc3a0('0x4e')]['channel'],_0x10e368[_0xc3a0('0x4e')]['type']);_0x10e368[_0xc3a0('0x4e')][_0xc3a0('0x57')]=integrations[_0xc3a0('0x58')](_0x10e368['body'][_0xc3a0('0x59')],_0x10e368[_0xc3a0('0x4e')][_0xc3a0('0x32')]);return db[_0xc3a0('0x50')][_0xc3a0('0x4c')](_0x10e368['body'],{'include':[{'model':db[_0xc3a0('0x5a')],'as':_0xc3a0('0x5b')},{'model':db[_0xc3a0('0x5a')],'as':_0xc3a0('0x57')}]});}return null;})[_0xc3a0('0x28')](respondWithResult(_0x4608e2,null))[_0xc3a0('0x46')](handleError(_0x4608e2,null));};exports[_0xc3a0('0x5c')]=function(_0x4a638c,_0x26254a,_0x2d9323){var _0x3a8379='';var _0x4b30b0=['id',_0xc3a0('0x2d'),_0xc3a0('0x5d'),'created_by','description',_0xc3a0('0x5e'),_0xc3a0('0x5f'),'duration_minutes',_0xc3a0('0x60'),_0xc3a0('0x61'),'parent_name',_0xc3a0('0x62')];return db[_0xc3a0('0x2f')]['findOne']({'where':{'id':_0x4a638c['params']['id']},'attributes':['id',_0xc3a0('0x63'),'password',_0xc3a0('0x64')]})[_0xc3a0('0x28')](handleEntityNotFound(_0x26254a,null))[_0xc3a0('0x28')](function(_0x1a8788){if(_0x1a8788){_0x3a8379=_0x1a8788['remoteUri'];var _0x3e7de8=_0x3a8379[_0xc3a0('0x65')](-0x1);if(_0x3e7de8==='/'){_0x3a8379=_0x3a8379[_0xc3a0('0x66')](0x0,_0x3a8379[_0xc3a0('0x67')](_0x3e7de8));}return rp({'method':_0xc3a0('0x68'),'uri':util[_0xc3a0('0x69')](_0xc3a0('0x6a'),_0x3a8379,_0xc3a0('0x6b')),'json':!![],'form':{'method':'login','input_type':_0xc3a0('0x6c'),'response_type':_0xc3a0('0x6c'),'rest_data':JSON[_0xc3a0('0x6d')]({'user_auth':{'user_name':_0x1a8788[_0xc3a0('0x63')],'password':_0x1a8788[_0xc3a0('0x6e')],'encryption':'PLAIN'},'application':_0xc3a0('0x6f')})}});}})['then'](function(_0x41b99a){if(_0x41b99a&&_0x41b99a[_0xc3a0('0x2d')]!==_0xc3a0('0x70')&&_0x41b99a[_0xc3a0('0x2d')]!==_0xc3a0('0x71')){return rp({'method':'POST','uri':util['format']('%s%s',_0x3a8379,_0xc3a0('0x6b')),'json':!![],'form':{'method':_0xc3a0('0x72'),'input_type':_0xc3a0('0x6c'),'response_type':_0xc3a0('0x6c'),'rest_data':JSON['stringify']({'session':_0x41b99a['id'],'module_name':_0xc3a0('0x73')})}})['then'](function(_0x5e8efa){if(_0x5e8efa){var _0x471044=_[_0xc3a0('0x74')](_0x5e8efa['module_fields']);_[_0xc3a0('0x75')](_0x471044,function(_0x1fe3e3){return _0x4b30b0[_0xc3a0('0x76')](_0x1fe3e3[_0xc3a0('0x2d')]);});return{'count':_0x471044[_0xc3a0('0x48')],'rows':_[_0xc3a0('0x34')](_0x471044,function(_0x5302c6){return{'id':_0x5302c6[_0xc3a0('0x2d')],'name':_0x5302c6['label'],'custom':_[_0xc3a0('0x77')](_0x5302c6['name'],'_c')?!![]:![],'options':_0x5302c6[_0xc3a0('0x4a')]?_[_0xc3a0('0x34')](_[_0xc3a0('0x74')](_0x5302c6[_0xc3a0('0x4a')]),function(_0x3038c2){return{'name':_0x3038c2['value'],'value':_0x3038c2[_0xc3a0('0x2d')]};}):[]};})};}})[_0xc3a0('0x28')](respondWithResult(_0x26254a,null))[_0xc3a0('0x46')](function(_0x3c81ba){var _0x4718fa=_0x4a638c[_0xc3a0('0x35')][_0xc3a0('0x78')]?0x1f4:_0x3c81ba['statusCode']||0x1f4;logger['error'](_0xc3a0('0x79'),_0xc3a0('0x5c'),_0x4718fa,JSON[_0xc3a0('0x6d')](_0x3c81ba));delete _0x3c81ba[_0xc3a0('0x2d')];if(_0x4718fa===0x191){_0x4718fa=0x190;}_0x26254a[_0xc3a0('0x1c')](_0x4718fa)[_0xc3a0('0x2e')](_0x4a638c[_0xc3a0('0x35')][_0xc3a0('0x78')]?{'message':_0xc3a0('0x7a'),'statusCode':_0x3c81ba['statusCode']}:_0x3c81ba);});}else{var _0x3263bf=0x1f4;_0x26254a[_0xc3a0('0x1c')](_0x3263bf)['send']({'message':_0xc3a0('0x7a'),'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 5f4fffa..5234121 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 _0xaab2=['moment','bluebird','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','../../config/logger','api'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xaab2,0xf3));var _0x2aab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xaab2[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2aab('0x0'));var util=require(_0x2aab('0x1'));var logger=require(_0x2aab('0x2'))(_0x2aab('0x3'));var moment=require(_0x2aab('0x4'));var BPromise=require(_0x2aab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aab('0x6'));var rimraf=require(_0x2aab('0x7'));var config=require('../../config/environment');var attributes=require(_0x2aab('0x8'));var integrations=require(_0x2aab('0x9'));module[_0x2aab('0xa')]=function(_0x2674ed,_0x3031c8){return _0x2674ed[_0x2aab('0xb')](_0x2aab('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc65a=['lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x58788d,_0x88b74f){var _0x58ceba=function(_0x16a416){while(--_0x16a416){_0x58788d['push'](_0x58788d['shift']());}};_0x58ceba(++_0x88b74f);}(_0xc65a,0xfa));var _0xac65=function(_0x5a9605,_0x1ac75e){_0x5a9605=_0x5a9605-0x0;var _0xef2768=_0xc65a[_0x5a9605];return _0xef2768;};'use strict';var _=require(_0xac65('0x0'));var util=require('util');var logger=require(_0xac65('0x1'))('api');var moment=require('moment');var BPromise=require(_0xac65('0x2'));var rp=require(_0xac65('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac65('0x4'));var config=require(_0xac65('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xac65('0x6'));module[_0xac65('0x7')]=function(_0x20a2f1,_0x13cbd6){return _0x20a2f1['define'](_0xac65('0x8'),attributes,{'tableName':_0xac65('0x9'),'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 d8f67be..a9dca12 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 _0x982c=['SugarcrmAccount','options','where','attributes','limit','include','map','model','info','stringify','ShowSugarcrmAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetSugarcrmAccount'];(function(_0xb080f7,_0x303bcb){var _0x4ac50f=function(_0x301e99){while(--_0x301e99){_0xb080f7['push'](_0xb080f7['shift']());}};_0x4ac50f(++_0x303bcb);}(_0x982c,0xe5));var _0xc982=function(_0x38d241,_0x5e57cf){_0x38d241=_0x38d241-0x0;var _0x11c3cb=_0x982c[_0x38d241];return _0x11c3cb;};'use strict';var _=require(_0xc982('0x0'));var util=require(_0xc982('0x1'));var moment=require(_0xc982('0x2'));var BPromise=require(_0xc982('0x3'));var rs=require(_0xc982('0x4'));var fs=require('fs');var Redis=require(_0xc982('0x5'));var db=require(_0xc982('0x6'))['db'];var utils=require(_0xc982('0x7'));var logger=require(_0xc982('0x8'))(_0xc982('0x9'));var config=require(_0xc982('0xa'));var jayson=require(_0xc982('0xb'));var client=jayson[_0xc982('0xc')][_0xc982('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x45c111,_0x525d97,_0x38ec40){return new BPromise(function(_0x48827c,_0x1eada0){return client[_0xc982('0xe')](_0x45c111,_0x38ec40)[_0xc982('0xf')](function(_0x152db9){logger['info'](_0xc982('0x10'),_0x525d97,_0xc982('0x11'));logger[_0xc982('0x12')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x525d97,_0xc982('0x11'),JSON['stringify'](_0x152db9));if(_0x152db9[_0xc982('0x13')]){if(_0x152db9['error']['code']===0x1f4){logger[_0xc982('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x525d97,_0x152db9['error']['message']);return _0x1eada0(_0x152db9[_0xc982('0x13')][_0xc982('0x14')]);}logger['error'](_0xc982('0x10'),_0x525d97,_0x152db9['error'][_0xc982('0x14')]);return _0x48827c(_0x152db9[_0xc982('0x13')][_0xc982('0x14')]);}else{logger['info'](_0xc982('0x10'),_0x525d97,_0xc982('0x11'));_0x48827c(_0x152db9[_0xc982('0x15')][_0xc982('0x14')]);}})['catch'](function(_0x586cdc){logger[_0xc982('0x13')](_0xc982('0x10'),_0x525d97,_0x586cdc);_0x1eada0(_0x586cdc);});});}exports[_0xc982('0x16')]=function(_0x55246a){var _0xcba64d=this;return new Promise(function(_0x49eec9,_0x207f8b){return db[_0xc982('0x17')]['findAll']({'raw':_0x55246a[_0xc982('0x18')]?_0x55246a[_0xc982('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x55246a[_0xc982('0x18')]?_0x55246a['options'][_0xc982('0x19')]||null:null,'attributes':_0x55246a[_0xc982('0x18')]?_0x55246a['options'][_0xc982('0x1a')]||null:null,'limit':_0x55246a[_0xc982('0x18')]?_0x55246a['options'][_0xc982('0x1b')]||null:null,'include':_0x55246a[_0xc982('0x18')]?_0x55246a[_0xc982('0x18')][_0xc982('0x1c')]?_[_0xc982('0x1d')](_0x55246a['options'][_0xc982('0x1c')],function(_0x31d297){return{'model':db[_0x31d297['model']],'as':_0x31d297['as'],'attributes':_0x31d297[_0xc982('0x1a')],'include':_0x31d297[_0xc982('0x1c')]?_[_0xc982('0x1d')](_0x31d297[_0xc982('0x1c')],function(_0xb9c849){return{'model':db[_0xb9c849[_0xc982('0x1e')]],'as':_0xb9c849['as'],'attributes':_0xb9c849['attributes'],'include':_0xb9c849['include']?_[_0xc982('0x1d')](_0xb9c849[_0xc982('0x1c')],function(_0x157071){return{'model':db[_0x157071[_0xc982('0x1e')]],'as':_0x157071['as'],'attributes':_0x157071[_0xc982('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc982('0xf')](function(_0x1d10ee){logger[_0xc982('0x1f')]('GetSugarcrmAccount',_0x55246a);logger[_0xc982('0x12')]('GetSugarcrmAccount',_0x55246a,JSON[_0xc982('0x20')](_0x1d10ee));_0x49eec9(_0x1d10ee);})['catch'](function(_0x5d68fd){logger['error'](_0xc982('0x16'),_0x5d68fd[_0xc982('0x14')],_0x55246a);_0x207f8b(_0xcba64d['error'](0x1f4,_0x5d68fd[_0xc982('0x14')]));});});};exports[_0xc982('0x21')]=function(_0x597455){var _0x1a95cc=this;return new Promise(function(_0x58ccf6,_0xf581ba){return db[_0xc982('0x17')][_0xc982('0x22')]({'raw':_0x597455[_0xc982('0x18')]?_0x597455['options'][_0xc982('0x23')]===undefined?!![]:![]:!![],'where':_0x597455[_0xc982('0x18')]?_0x597455[_0xc982('0x18')][_0xc982('0x19')]||null:null,'attributes':_0x597455[_0xc982('0x18')]?_0x597455[_0xc982('0x18')][_0xc982('0x1a')]||null:null,'include':_0x597455[_0xc982('0x18')]?_0x597455[_0xc982('0x18')][_0xc982('0x1c')]?_['map'](_0x597455['options'][_0xc982('0x1c')],function(_0x585234){return{'model':db[_0x585234[_0xc982('0x1e')]],'as':_0x585234['as'],'attributes':_0x585234[_0xc982('0x1a')],'include':_0x585234['include']?_[_0xc982('0x1d')](_0x585234[_0xc982('0x1c')],function(_0x27f847){return{'model':db[_0x27f847[_0xc982('0x1e')]],'as':_0x27f847['as'],'attributes':_0x27f847[_0xc982('0x1a')],'include':_0x27f847[_0xc982('0x1c')]?_[_0xc982('0x1d')](_0x27f847[_0xc982('0x1c')],function(_0x307789){return{'model':db[_0x307789[_0xc982('0x1e')]],'as':_0x307789['as'],'attributes':_0x307789[_0xc982('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc982('0xf')](function(_0x530a27){logger['info'](_0xc982('0x21'),_0x597455);logger['debug'](_0xc982('0x21'),_0x597455,JSON[_0xc982('0x20')](_0x530a27));_0x58ccf6(_0x530a27);})['catch'](function(_0x2e5b6e){logger['error'](_0xc982('0x21'),_0x2e5b6e[_0xc982('0x14')],_0x597455);_0xf581ba(_0x1a95cc[_0xc982('0x13')](0x1f4,_0x2e5b6e[_0xc982('0x14')]));});});}; \ No newline at end of file +var _0xcc56=['raw','where','attributes','limit','map','include','model','then','stringify','catch','ShowSugarcrmAccount','SugarcrmAccount','find','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','GetSugarcrmAccount','findAll','options'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xcc56,0x125));var _0x6cc5=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0xcc56[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6cc5('0x0'));var rs=require(_0x6cc5('0x1'));var fs=require('fs');var Redis=require(_0x6cc5('0x2'));var db=require(_0x6cc5('0x3'))['db'];var utils=require(_0x6cc5('0x4'));var logger=require(_0x6cc5('0x5'))(_0x6cc5('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cc5('0x7'));var client=jayson[_0x6cc5('0x8')][_0x6cc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35aaef,_0x2a09df,_0x12fcfe){return new BPromise(function(_0x328d63,_0x2710fd){return client[_0x6cc5('0xa')](_0x35aaef,_0x12fcfe)['then'](function(_0x3a3664){logger[_0x6cc5('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x2a09df,_0x6cc5('0xc'));logger[_0x6cc5('0xd')](_0x6cc5('0xe'),_0x2a09df,_0x6cc5('0xc'),JSON['stringify'](_0x3a3664));if(_0x3a3664[_0x6cc5('0xf')]){if(_0x3a3664[_0x6cc5('0xf')][_0x6cc5('0x10')]===0x1f4){logger[_0x6cc5('0xf')](_0x6cc5('0x11'),_0x2a09df,_0x3a3664[_0x6cc5('0xf')][_0x6cc5('0x12')]);return _0x2710fd(_0x3a3664[_0x6cc5('0xf')][_0x6cc5('0x12')]);}logger[_0x6cc5('0xf')](_0x6cc5('0x11'),_0x2a09df,_0x3a3664[_0x6cc5('0xf')]['message']);return _0x328d63(_0x3a3664[_0x6cc5('0xf')]['message']);}else{logger[_0x6cc5('0xb')](_0x6cc5('0x11'),_0x2a09df,_0x6cc5('0xc'));_0x328d63(_0x3a3664['result'][_0x6cc5('0x12')]);}})['catch'](function(_0x2842a2){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2a09df,_0x2842a2);_0x2710fd(_0x2842a2);});});}exports[_0x6cc5('0x13')]=function(_0x41ea1e){var _0x2310f8=this;return new Promise(function(_0x588957,_0x291548){return db['SugarcrmAccount'][_0x6cc5('0x14')]({'raw':_0x41ea1e[_0x6cc5('0x15')]?_0x41ea1e[_0x6cc5('0x15')][_0x6cc5('0x16')]===undefined?!![]:![]:!![],'where':_0x41ea1e[_0x6cc5('0x15')]?_0x41ea1e[_0x6cc5('0x15')][_0x6cc5('0x17')]||null:null,'attributes':_0x41ea1e[_0x6cc5('0x15')]?_0x41ea1e[_0x6cc5('0x15')][_0x6cc5('0x18')]||null:null,'limit':_0x41ea1e[_0x6cc5('0x15')]?_0x41ea1e[_0x6cc5('0x15')][_0x6cc5('0x19')]||null:null,'include':_0x41ea1e[_0x6cc5('0x15')]?_0x41ea1e[_0x6cc5('0x15')]['include']?_[_0x6cc5('0x1a')](_0x41ea1e[_0x6cc5('0x15')][_0x6cc5('0x1b')],function(_0x5a1b78){return{'model':db[_0x5a1b78[_0x6cc5('0x1c')]],'as':_0x5a1b78['as'],'attributes':_0x5a1b78[_0x6cc5('0x18')],'include':_0x5a1b78[_0x6cc5('0x1b')]?_[_0x6cc5('0x1a')](_0x5a1b78[_0x6cc5('0x1b')],function(_0x1565a1){return{'model':db[_0x1565a1[_0x6cc5('0x1c')]],'as':_0x1565a1['as'],'attributes':_0x1565a1[_0x6cc5('0x18')],'include':_0x1565a1['include']?_['map'](_0x1565a1[_0x6cc5('0x1b')],function(_0x401e4c){return{'model':db[_0x401e4c[_0x6cc5('0x1c')]],'as':_0x401e4c['as'],'attributes':_0x401e4c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cc5('0x1d')](function(_0x5ac7cf){logger[_0x6cc5('0xb')](_0x6cc5('0x13'),_0x41ea1e);logger['debug'](_0x6cc5('0x13'),_0x41ea1e,JSON[_0x6cc5('0x1e')](_0x5ac7cf));_0x588957(_0x5ac7cf);})[_0x6cc5('0x1f')](function(_0x5c5271){logger[_0x6cc5('0xf')](_0x6cc5('0x13'),_0x5c5271[_0x6cc5('0x12')],_0x41ea1e);_0x291548(_0x2310f8[_0x6cc5('0xf')](0x1f4,_0x5c5271[_0x6cc5('0x12')]));});});};exports[_0x6cc5('0x20')]=function(_0x53b4d0){var _0x33f094=this;return new Promise(function(_0x467299,_0x1bac6e){return db[_0x6cc5('0x21')][_0x6cc5('0x22')]({'raw':_0x53b4d0['options']?_0x53b4d0[_0x6cc5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x53b4d0['options']?_0x53b4d0[_0x6cc5('0x15')][_0x6cc5('0x17')]||null:null,'attributes':_0x53b4d0[_0x6cc5('0x15')]?_0x53b4d0[_0x6cc5('0x15')][_0x6cc5('0x18')]||null:null,'include':_0x53b4d0[_0x6cc5('0x15')]?_0x53b4d0[_0x6cc5('0x15')][_0x6cc5('0x1b')]?_[_0x6cc5('0x1a')](_0x53b4d0[_0x6cc5('0x15')]['include'],function(_0x20fbd0){return{'model':db[_0x20fbd0[_0x6cc5('0x1c')]],'as':_0x20fbd0['as'],'attributes':_0x20fbd0['attributes'],'include':_0x20fbd0[_0x6cc5('0x1b')]?_[_0x6cc5('0x1a')](_0x20fbd0[_0x6cc5('0x1b')],function(_0x4ee3c4){return{'model':db[_0x4ee3c4['model']],'as':_0x4ee3c4['as'],'attributes':_0x4ee3c4[_0x6cc5('0x18')],'include':_0x4ee3c4[_0x6cc5('0x1b')]?_['map'](_0x4ee3c4['include'],function(_0x4ec17b){return{'model':db[_0x4ec17b[_0x6cc5('0x1c')]],'as':_0x4ec17b['as'],'attributes':_0x4ec17b[_0x6cc5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6cc5('0x1d')](function(_0x5695f2){logger['info'](_0x6cc5('0x20'),_0x53b4d0);logger[_0x6cc5('0xd')](_0x6cc5('0x20'),_0x53b4d0,JSON[_0x6cc5('0x1e')](_0x5695f2));_0x467299(_0x5695f2);})[_0x6cc5('0x1f')](function(_0x35f94d){logger[_0x6cc5('0xf')]('ShowSugarcrmAccount',_0x35f94d[_0x6cc5('0x12')],_0x53b4d0);_0x1bac6e(_0x33f094['error'](0x1f4,_0x35f94d[_0x6cc5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index b4538c6..6bb4a0a 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 _0x823b=['/:id/subjects','/:id/descriptions','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show'];(function(_0x333e7a,_0x598046){var _0x12f404=function(_0x1a1dfd){while(--_0x1a1dfd){_0x333e7a['push'](_0x333e7a['shift']());}};_0x12f404(++_0x598046);}(_0x823b,0x13a));var _0xb823=function(_0x4e06c3,_0x14340b){_0x4e06c3=_0x4e06c3-0x0;var _0xcec57c=_0x823b[_0x4e06c3];return _0xcec57c;};'use strict';var multer=require(_0xb823('0x0'));var util=require(_0xb823('0x1'));var path=require(_0xb823('0x2'));var timeout=require(_0xb823('0x3'));var express=require(_0xb823('0x4'));var router=express[_0xb823('0x5')]();var fs_extra=require(_0xb823('0x6'));var auth=require(_0xb823('0x7'));var interaction=require(_0xb823('0x8'));var config=require(_0xb823('0x9'));var controller=require(_0xb823('0xa'));router[_0xb823('0xb')]('/',auth['isAuthenticated'](),controller[_0xb823('0xc')]);router['get'](_0xb823('0xd'),auth[_0xb823('0xe')](),controller[_0xb823('0xf')]);router[_0xb823('0xb')]('/:id/fields',auth[_0xb823('0xe')](),controller['getFields']);router[_0xb823('0xb')](_0xb823('0x10'),auth[_0xb823('0xe')](),controller['getSubjects']);router['get'](_0xb823('0x11'),auth[_0xb823('0xe')](),controller['getDescriptions']);router['post']('/',auth[_0xb823('0xe')](),controller[_0xb823('0x12')]);router['put'](_0xb823('0xd'),auth[_0xb823('0xe')](),controller['update']);router[_0xb823('0x13')](_0xb823('0xd'),auth[_0xb823('0xe')](),controller[_0xb823('0x14')]);module[_0xb823('0x15')]=router; \ No newline at end of file +var _0xc1a0=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','multer','path','connect-timeout'];(function(_0x348ea8,_0x330457){var _0x37ddf7=function(_0x3a5c5f){while(--_0x3a5c5f){_0x348ea8['push'](_0x348ea8['shift']());}};_0x37ddf7(++_0x330457);}(_0xc1a0,0x70));var _0x0c1a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc1a0[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x0c1a('0x0'));var util=require('util');var path=require(_0x0c1a('0x1'));var timeout=require(_0x0c1a('0x2'));var express=require(_0x0c1a('0x3'));var router=express[_0x0c1a('0x4')]();var fs_extra=require(_0x0c1a('0x5'));var auth=require(_0x0c1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0c1a('0x7'));var controller=require(_0x0c1a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0c1a('0x9')](_0x0c1a('0xa'),auth['isAuthenticated'](),controller[_0x0c1a('0xb')]);router[_0x0c1a('0x9')](_0x0c1a('0xc'),auth['isAuthenticated'](),controller[_0x0c1a('0xd')]);router[_0x0c1a('0x9')](_0x0c1a('0xe'),auth[_0x0c1a('0xf')](),controller[_0x0c1a('0x10')]);router[_0x0c1a('0x9')](_0x0c1a('0x11'),auth[_0x0c1a('0xf')](),controller[_0x0c1a('0x12')]);router[_0x0c1a('0x13')]('/',auth['isAuthenticated'](),controller[_0x0c1a('0x14')]);router['put'](_0x0c1a('0xa'),auth[_0x0c1a('0xf')](),controller['update']);router[_0x0c1a('0x15')](_0x0c1a('0xa'),auth['isAuthenticated'](),controller[_0x0c1a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index a688135..b7a5d57 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x27ec=['STRING','exports'];(function(_0x123c37,_0x2750ea){var _0x1b526d=function(_0x32ce6c){while(--_0x32ce6c){_0x123c37['push'](_0x123c37['shift']());}};_0x1b526d(++_0x2750ea);}(_0x27ec,0x1a9));var _0xc27e=function(_0x52f55a,_0x53427d){_0x52f55a=_0x52f55a-0x0;var _0x512973=_0x27ec[_0x52f55a];return _0x512973;};'use strict';var Sequelize=require('sequelize');module[_0xc27e('0x0')]={'name':{'type':Sequelize[_0xc27e('0x1')]},'description':{'type':Sequelize[_0xc27e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 20bd6cf..42f2a96 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 _0x5f67=['getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SugarcrmConfiguration','include','findAll','rows','catch','show','params','options','find','create','update','body','getFields','findOne','SugarcrmField','getSubjects'];(function(_0x700063,_0x54d3a3){var _0x51b790=function(_0x4e74b8){while(--_0x4e74b8){_0x700063['push'](_0x700063['shift']());}};_0x51b790(++_0x54d3a3);}(_0x5f67,0x151));var _0x75f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f67[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x75f6('0x0'));var rimraf=require(_0x75f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x75f6('0x2'));var rp=require(_0x75f6('0x3'));var moment=require(_0x75f6('0x4'));var BPromise=require(_0x75f6('0x5'));var Mustache=require(_0x75f6('0x6'));var util=require('util');var path=require(_0x75f6('0x7'));var sox=require(_0x75f6('0x8'));var csv=require(_0x75f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75f6('0xa'));var squel=require(_0x75f6('0xb'));var crypto=require(_0x75f6('0xc'));var jsforce=require(_0x75f6('0xd'));var deskjs=require(_0x75f6('0xe'));var toCsv=require(_0x75f6('0x9'));var querystring=require(_0x75f6('0xf'));var Papa=require(_0x75f6('0x10'));var Redis=require(_0x75f6('0x11'));var authService=require(_0x75f6('0x12'));var qs=require(_0x75f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75f6('0x14'));var logger=require(_0x75f6('0x15'))(_0x75f6('0x16'));var utils=require(_0x75f6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x75f6('0x18'));var db=require(_0x75f6('0x19'))['db'];function respondWithStatusCode(_0x362b85,_0x570363){_0x570363=_0x570363||0xcc;return function(_0x5a9b5f){if(_0x5a9b5f){return _0x362b85[_0x75f6('0x1a')](_0x570363);}return _0x362b85['status'](_0x570363)[_0x75f6('0x1b')]();};}function respondWithResult(_0x31d58b,_0x293f76){_0x293f76=_0x293f76||0xc8;return function(_0x48c327){if(_0x48c327){return _0x31d58b[_0x75f6('0x1c')](_0x293f76)[_0x75f6('0x1d')](_0x48c327);}};}function respondWithFilteredResult(_0x28f889,_0x5c6b16){return function(_0x5d3254){if(_0x5d3254){var _0x31b6cb=typeof _0x5c6b16[_0x75f6('0x1e')]===_0x75f6('0x1f')&&typeof _0x5c6b16[_0x75f6('0x20')]===_0x75f6('0x1f');var _0x2d9b99=_0x5d3254[_0x75f6('0x21')];var _0x2f79fb=_0x31b6cb?0x0:_0x5c6b16[_0x75f6('0x1e')];var _0xd29f98=_0x31b6cb?_0x5d3254[_0x75f6('0x21')]:_0x5c6b16[_0x75f6('0x1e')]+_0x5c6b16[_0x75f6('0x20')];var _0x20bec9;if(_0xd29f98>=_0x2d9b99){_0xd29f98=_0x2d9b99;_0x20bec9=0xc8;}else{_0x20bec9=0xce;}_0x28f889[_0x75f6('0x1c')](_0x20bec9);return _0x28f889[_0x75f6('0x22')](_0x75f6('0x23'),_0x2f79fb+'-'+_0xd29f98+'/'+_0x2d9b99)[_0x75f6('0x1d')](_0x5d3254);}return null;};}function patchUpdates(_0x1c7ce2){return function(_0x5621ba){try{jsonpatch['apply'](_0x5621ba,_0x1c7ce2,!![]);}catch(_0x3a5116){return BPromise[_0x75f6('0x24')](_0x3a5116);}return _0x5621ba[_0x75f6('0x25')]();};}function saveUpdates(_0x311a0a,_0x13fc9d){return function(_0x4caf81){if(_0x4caf81){return _0x4caf81['update'](_0x311a0a)[_0x75f6('0x26')](function(_0x37bedd){return _0x37bedd;});}return null;};}function removeEntity(_0x20edd4,_0x3876d1){return function(_0xb1b094){if(_0xb1b094){return _0xb1b094[_0x75f6('0x27')]()[_0x75f6('0x26')](function(){_0x20edd4[_0x75f6('0x1c')](0xcc)[_0x75f6('0x1b')]();});}};}function handleEntityNotFound(_0xaa4693,_0x46642d){return function(_0x388252){if(!_0x388252){_0xaa4693[_0x75f6('0x1a')](0x194);}return _0x388252;};}function handleError(_0x3a314e,_0x10643f){_0x10643f=_0x10643f||0x1f4;return function(_0x63d395){logger[_0x75f6('0x28')](_0x63d395[_0x75f6('0x29')]);if(_0x63d395[_0x75f6('0x2a')]){delete _0x63d395[_0x75f6('0x2a')];}_0x3a314e[_0x75f6('0x1c')](_0x10643f)[_0x75f6('0x2b')](_0x63d395);};}exports[_0x75f6('0x2c')]=function(_0x12f891,_0x1f427d){var _0x44df62={},_0x1342a5={},_0x4bd98c={'count':0x0,'rows':[]};var _0x1241bf=_[_0x75f6('0x2d')](db['SugarcrmConfiguration'][_0x75f6('0x2e')],function(_0x3bcd93){return{'name':_0x3bcd93[_0x75f6('0x2f')],'type':_0x3bcd93['type'][_0x75f6('0x30')]};});_0x1342a5['model']=_[_0x75f6('0x2d')](_0x1241bf,'name');_0x1342a5[_0x75f6('0x31')]=_[_0x75f6('0x32')](_0x12f891['query']);_0x1342a5[_0x75f6('0x33')]=_['intersection'](_0x1342a5[_0x75f6('0x34')],_0x1342a5[_0x75f6('0x31')]);_0x44df62[_0x75f6('0x35')]=_[_0x75f6('0x36')](_0x1342a5[_0x75f6('0x34')],qs[_0x75f6('0x37')](_0x12f891[_0x75f6('0x31')][_0x75f6('0x37')]));_0x44df62['attributes']=_0x44df62[_0x75f6('0x35')][_0x75f6('0x38')]?_0x44df62[_0x75f6('0x35')]:_0x1342a5['model'];if(!_0x12f891[_0x75f6('0x31')][_0x75f6('0x39')](_0x75f6('0x3a'))){_0x44df62[_0x75f6('0x20')]=qs[_0x75f6('0x20')](_0x12f891[_0x75f6('0x31')][_0x75f6('0x20')]);_0x44df62[_0x75f6('0x1e')]=qs[_0x75f6('0x1e')](_0x12f891[_0x75f6('0x31')][_0x75f6('0x1e')]);}_0x44df62[_0x75f6('0x3b')]=qs[_0x75f6('0x3c')](_0x12f891[_0x75f6('0x31')][_0x75f6('0x3c')]);_0x44df62[_0x75f6('0x3d')]=qs[_0x75f6('0x33')](_[_0x75f6('0x3e')](_0x12f891[_0x75f6('0x31')],_0x1342a5['filters']),_0x1241bf);if(_0x12f891[_0x75f6('0x31')][_0x75f6('0x3f')]){_0x44df62[_0x75f6('0x3d')]=_[_0x75f6('0x40')](_0x44df62[_0x75f6('0x3d')],{'$or':_['map'](_0x1241bf,function(_0x3aa30c){if(_0x3aa30c[_0x75f6('0x41')]!==_0x75f6('0x42')){var _0xf30ce9={};_0xf30ce9[_0x3aa30c['name']]={'$like':'%'+_0x12f891[_0x75f6('0x31')][_0x75f6('0x3f')]+'%'};return _0xf30ce9;}})});}_0x44df62=_[_0x75f6('0x40')]({},_0x44df62,_0x12f891['options']);var _0x25aa08={'where':_0x44df62[_0x75f6('0x3d')]};return db[_0x75f6('0x43')][_0x75f6('0x21')](_0x25aa08)[_0x75f6('0x26')](function(_0x581f81){_0x4bd98c[_0x75f6('0x21')]=_0x581f81;if(_0x12f891['query']['includeAll']){_0x44df62[_0x75f6('0x44')]=[{'all':!![]}];}return db[_0x75f6('0x43')][_0x75f6('0x45')](_0x44df62);})[_0x75f6('0x26')](function(_0x2a0ff0){_0x4bd98c[_0x75f6('0x46')]=_0x2a0ff0;return _0x4bd98c;})[_0x75f6('0x26')](respondWithFilteredResult(_0x1f427d,_0x44df62))[_0x75f6('0x47')](handleError(_0x1f427d,null));};exports[_0x75f6('0x48')]=function(_0x5316b0,_0x350903){var _0x365c71={'raw':![],'where':{'id':_0x5316b0[_0x75f6('0x49')]['id']}},_0x2f0cdf={};_0x2f0cdf[_0x75f6('0x34')]=_[_0x75f6('0x32')](db[_0x75f6('0x43')][_0x75f6('0x2e')]);_0x2f0cdf[_0x75f6('0x31')]=_['keys'](_0x5316b0[_0x75f6('0x31')]);_0x2f0cdf[_0x75f6('0x33')]=_[_0x75f6('0x36')](_0x2f0cdf[_0x75f6('0x34')],_0x2f0cdf[_0x75f6('0x31')]);_0x365c71[_0x75f6('0x35')]=_[_0x75f6('0x36')](_0x2f0cdf[_0x75f6('0x34')],qs[_0x75f6('0x37')](_0x5316b0['query'][_0x75f6('0x37')]));_0x365c71[_0x75f6('0x35')]=_0x365c71[_0x75f6('0x35')][_0x75f6('0x38')]?_0x365c71['attributes']:_0x2f0cdf['model'];if(_0x5316b0[_0x75f6('0x31')]['includeAll']){_0x365c71[_0x75f6('0x44')]=[{'all':!![]}];}_0x365c71=_[_0x75f6('0x40')]({},_0x365c71,_0x5316b0[_0x75f6('0x4a')]);return db[_0x75f6('0x43')][_0x75f6('0x4b')](_0x365c71)['then'](handleEntityNotFound(_0x350903,null))[_0x75f6('0x26')](respondWithResult(_0x350903,null))['catch'](handleError(_0x350903,null));};exports[_0x75f6('0x4c')]=function(_0x3d69dc,_0x3b6cd4){return db['SugarcrmConfiguration'][_0x75f6('0x4c')](_0x3d69dc['body'],{})[_0x75f6('0x26')](respondWithResult(_0x3b6cd4,0xc9))[_0x75f6('0x47')](handleError(_0x3b6cd4,null));};exports[_0x75f6('0x4d')]=function(_0x47c090,_0x268125){if(_0x47c090[_0x75f6('0x4e')]['id']){delete _0x47c090[_0x75f6('0x4e')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x47c090[_0x75f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x268125,null))[_0x75f6('0x26')](saveUpdates(_0x47c090['body'],null))[_0x75f6('0x26')](respondWithResult(_0x268125,null))['catch'](handleError(_0x268125,null));};exports[_0x75f6('0x27')]=function(_0x17c24c,_0x163f52){return db[_0x75f6('0x43')][_0x75f6('0x4b')]({'where':{'id':_0x17c24c[_0x75f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x163f52,null))[_0x75f6('0x26')](removeEntity(_0x163f52,null))['catch'](handleError(_0x163f52,null));};exports[_0x75f6('0x4f')]=function(_0x6ac2b5,_0x50ed80,_0x4e2a59){var _0x495ba4={};var _0x13bbb3={};var _0x59a8ae;var _0x5eb60b;return db[_0x75f6('0x43')][_0x75f6('0x50')]({'where':{'id':_0x6ac2b5[_0x75f6('0x49')]['id']}})[_0x75f6('0x26')](handleEntityNotFound(_0x50ed80,null))[_0x75f6('0x26')](function(_0x46e498){if(_0x46e498){_0x59a8ae=_0x46e498;_0x13bbb3['model']=_['keys'](db[_0x75f6('0x51')][_0x75f6('0x2e')]);_0x13bbb3[_0x75f6('0x31')]=_[_0x75f6('0x32')](_0x6ac2b5[_0x75f6('0x31')]);_0x13bbb3[_0x75f6('0x33')]=_[_0x75f6('0x36')](_0x13bbb3[_0x75f6('0x34')],_0x13bbb3['query']);_0x495ba4['attributes']=_[_0x75f6('0x36')](_0x13bbb3[_0x75f6('0x34')],qs[_0x75f6('0x37')](_0x6ac2b5['query'][_0x75f6('0x37')]));_0x495ba4['attributes']=_0x495ba4[_0x75f6('0x35')]['length']?_0x495ba4[_0x75f6('0x35')]:_0x13bbb3[_0x75f6('0x34')];_0x495ba4[_0x75f6('0x3b')]=qs[_0x75f6('0x3c')](_0x6ac2b5['query'][_0x75f6('0x3c')]);_0x495ba4['where']=qs[_0x75f6('0x33')](_['pick'](_0x6ac2b5[_0x75f6('0x31')],_0x13bbb3[_0x75f6('0x33')]));if(_0x6ac2b5[_0x75f6('0x31')][_0x75f6('0x3f')]){_0x495ba4[_0x75f6('0x3d')]=_['merge'](_0x495ba4['where'],{'$or':_[_0x75f6('0x2d')](_0x495ba4[_0x75f6('0x35')],function(_0x14c775){var _0x5e7ada={};_0x5e7ada[_0x14c775]={'$like':'%'+_0x6ac2b5['query'][_0x75f6('0x3f')]+'%'};return _0x5e7ada;})});}_0x495ba4=_['merge']({},_0x495ba4,_0x6ac2b5[_0x75f6('0x4a')]);return _0x59a8ae['getFields'](_0x495ba4);}})[_0x75f6('0x26')](function(_0x5f5c40){if(_0x5f5c40){_0x5eb60b=_0x5f5c40[_0x75f6('0x38')];if(!_0x6ac2b5[_0x75f6('0x31')]['hasOwnProperty'](_0x75f6('0x3a'))){_0x495ba4[_0x75f6('0x20')]=qs[_0x75f6('0x20')](_0x6ac2b5['query'][_0x75f6('0x20')]);_0x495ba4[_0x75f6('0x1e')]=qs[_0x75f6('0x1e')](_0x6ac2b5[_0x75f6('0x31')][_0x75f6('0x1e')]);}return _0x59a8ae[_0x75f6('0x4f')](_0x495ba4);}})['then'](function(_0x5058af){if(_0x5058af){return _0x5058af?{'count':_0x5eb60b,'rows':_0x5058af}:null;}})['then'](respondWithResult(_0x50ed80,null))[_0x75f6('0x47')](handleError(_0x50ed80,null));};exports['getSubjects']=function(_0x57b3f2,_0x36134f,_0x1798f1){var _0x2b6dc7={};var _0x1ca730={};var _0x5e92e6;var _0x20e721;return db[_0x75f6('0x43')][_0x75f6('0x50')]({'where':{'id':_0x57b3f2['params']['id']}})[_0x75f6('0x26')](handleEntityNotFound(_0x36134f,null))[_0x75f6('0x26')](function(_0x435299){if(_0x435299){_0x5e92e6=_0x435299;_0x1ca730['model']=_[_0x75f6('0x32')](db['SugarcrmField'][_0x75f6('0x2e')]);_0x1ca730[_0x75f6('0x31')]=_[_0x75f6('0x32')](_0x57b3f2['query']);_0x1ca730[_0x75f6('0x33')]=_[_0x75f6('0x36')](_0x1ca730[_0x75f6('0x34')],_0x1ca730['query']);_0x2b6dc7[_0x75f6('0x35')]=_['intersection'](_0x1ca730['model'],qs['fields'](_0x57b3f2[_0x75f6('0x31')][_0x75f6('0x37')]));_0x2b6dc7['attributes']=_0x2b6dc7['attributes'][_0x75f6('0x38')]?_0x2b6dc7[_0x75f6('0x35')]:_0x1ca730[_0x75f6('0x34')];_0x2b6dc7[_0x75f6('0x3b')]=qs[_0x75f6('0x3c')](_0x57b3f2[_0x75f6('0x31')][_0x75f6('0x3c')]);_0x2b6dc7[_0x75f6('0x3d')]=qs['filters'](_[_0x75f6('0x3e')](_0x57b3f2[_0x75f6('0x31')],_0x1ca730[_0x75f6('0x33')]));if(_0x57b3f2[_0x75f6('0x31')][_0x75f6('0x3f')]){_0x2b6dc7[_0x75f6('0x3d')]=_['merge'](_0x2b6dc7['where'],{'$or':_[_0x75f6('0x2d')](_0x2b6dc7[_0x75f6('0x35')],function(_0x5cc72c){var _0x3ec28f={};_0x3ec28f[_0x5cc72c]={'$like':'%'+_0x57b3f2[_0x75f6('0x31')]['filter']+'%'};return _0x3ec28f;})});}_0x2b6dc7=_[_0x75f6('0x40')]({},_0x2b6dc7,_0x57b3f2['options']);return _0x5e92e6[_0x75f6('0x52')](_0x2b6dc7);}})[_0x75f6('0x26')](function(_0x14cabe){if(_0x14cabe){_0x20e721=_0x14cabe['length'];if(!_0x57b3f2[_0x75f6('0x31')][_0x75f6('0x39')]('nolimit')){_0x2b6dc7[_0x75f6('0x20')]=qs['limit'](_0x57b3f2[_0x75f6('0x31')]['limit']);_0x2b6dc7[_0x75f6('0x1e')]=qs[_0x75f6('0x1e')](_0x57b3f2[_0x75f6('0x31')][_0x75f6('0x1e')]);}return _0x5e92e6[_0x75f6('0x52')](_0x2b6dc7);}})['then'](function(_0x609caf){if(_0x609caf){return _0x609caf?{'count':_0x20e721,'rows':_0x609caf}:null;}})[_0x75f6('0x26')](respondWithResult(_0x36134f,null))[_0x75f6('0x47')](handleError(_0x36134f,null));};exports[_0x75f6('0x53')]=function(_0x21b51f,_0x2000ca,_0x660597){var _0x5b52ce={};var _0xa494fc={};var _0x3a7af9;var _0x56f1a6;return db[_0x75f6('0x43')]['findOne']({'where':{'id':_0x21b51f[_0x75f6('0x49')]['id']}})[_0x75f6('0x26')](handleEntityNotFound(_0x2000ca,null))[_0x75f6('0x26')](function(_0x4e9315){if(_0x4e9315){_0x3a7af9=_0x4e9315;_0xa494fc[_0x75f6('0x34')]=_[_0x75f6('0x32')](db[_0x75f6('0x51')][_0x75f6('0x2e')]);_0xa494fc['query']=_[_0x75f6('0x32')](_0x21b51f[_0x75f6('0x31')]);_0xa494fc[_0x75f6('0x33')]=_[_0x75f6('0x36')](_0xa494fc[_0x75f6('0x34')],_0xa494fc['query']);_0x5b52ce[_0x75f6('0x35')]=_[_0x75f6('0x36')](_0xa494fc[_0x75f6('0x34')],qs[_0x75f6('0x37')](_0x21b51f[_0x75f6('0x31')][_0x75f6('0x37')]));_0x5b52ce[_0x75f6('0x35')]=_0x5b52ce[_0x75f6('0x35')][_0x75f6('0x38')]?_0x5b52ce['attributes']:_0xa494fc[_0x75f6('0x34')];_0x5b52ce[_0x75f6('0x3b')]=qs['sort'](_0x21b51f[_0x75f6('0x31')][_0x75f6('0x3c')]);_0x5b52ce['where']=qs['filters'](_['pick'](_0x21b51f[_0x75f6('0x31')],_0xa494fc[_0x75f6('0x33')]));if(_0x21b51f[_0x75f6('0x31')]['filter']){_0x5b52ce[_0x75f6('0x3d')]=_[_0x75f6('0x40')](_0x5b52ce[_0x75f6('0x3d')],{'$or':_[_0x75f6('0x2d')](_0x5b52ce[_0x75f6('0x35')],function(_0xd8b040){var _0x5e180f={};_0x5e180f[_0xd8b040]={'$like':'%'+_0x21b51f['query']['filter']+'%'};return _0x5e180f;})});}_0x5b52ce=_[_0x75f6('0x40')]({},_0x5b52ce,_0x21b51f[_0x75f6('0x4a')]);return _0x3a7af9['getDescriptions'](_0x5b52ce);}})[_0x75f6('0x26')](function(_0x578485){if(_0x578485){_0x56f1a6=_0x578485[_0x75f6('0x38')];if(!_0x21b51f[_0x75f6('0x31')][_0x75f6('0x39')](_0x75f6('0x3a'))){_0x5b52ce[_0x75f6('0x20')]=qs[_0x75f6('0x20')](_0x21b51f[_0x75f6('0x31')][_0x75f6('0x20')]);_0x5b52ce['offset']=qs[_0x75f6('0x1e')](_0x21b51f[_0x75f6('0x31')][_0x75f6('0x1e')]);}return _0x3a7af9[_0x75f6('0x53')](_0x5b52ce);}})[_0x75f6('0x26')](function(_0x3d7277){if(_0x3d7277){return _0x3d7277?{'count':_0x56f1a6,'rows':_0x3d7277}:null;}})['then'](respondWithResult(_0x2000ca,null))[_0x75f6('0x47')](handleError(_0x2000ca,null));}; \ No newline at end of file +var _0xd2a1=['SugarcrmConfiguration','rows','catch','show','params','intersection','find','body','findOne','order','getFields','getSubjects','getDescriptions','SugarcrmField','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xd2a1,0xf8));var _0x1d2a=function(_0x23f0e1,_0x11d94b){_0x23f0e1=_0x23f0e1-0x0;var _0x257f0d=_0xd2a1[_0x23f0e1];return _0x257f0d;};'use strict';var emlformat=require(_0x1d2a('0x0'));var rimraf=require(_0x1d2a('0x1'));var zipdir=require(_0x1d2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d2a('0x3'));var BPromise=require(_0x1d2a('0x4'));var Mustache=require(_0x1d2a('0x5'));var util=require(_0x1d2a('0x6'));var path=require(_0x1d2a('0x7'));var sox=require(_0x1d2a('0x8'));var csv=require(_0x1d2a('0x9'));var ejs=require(_0x1d2a('0xa'));var fs=require('fs');var fs_extra=require(_0x1d2a('0xb'));var _=require(_0x1d2a('0xc'));var squel=require(_0x1d2a('0xd'));var crypto=require(_0x1d2a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1d2a('0xf'));var toCsv=require(_0x1d2a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d2a('0x10'));var authService=require(_0x1d2a('0x11'));var qs=require(_0x1d2a('0x12'));var as=require(_0x1d2a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d2a('0x14'))('api');var utils=require(_0x1d2a('0x15'));var config=require(_0x1d2a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d2a('0x17'))['db'];function respondWithStatusCode(_0x40457c,_0x190bf0){_0x190bf0=_0x190bf0||0xcc;return function(_0x283cf4){if(_0x283cf4){return _0x40457c[_0x1d2a('0x18')](_0x190bf0);}return _0x40457c[_0x1d2a('0x19')](_0x190bf0)[_0x1d2a('0x1a')]();};}function respondWithResult(_0x30fc2e,_0x113abd){_0x113abd=_0x113abd||0xc8;return function(_0x35a987){if(_0x35a987){return _0x30fc2e[_0x1d2a('0x19')](_0x113abd)['json'](_0x35a987);}};}function respondWithFilteredResult(_0x4d5844,_0x5a9d75){return function(_0x3735e5){if(_0x3735e5){var _0x4b5100=typeof _0x5a9d75[_0x1d2a('0x1b')]===_0x1d2a('0x1c')&&typeof _0x5a9d75[_0x1d2a('0x1d')]===_0x1d2a('0x1c');var _0x64961d=_0x3735e5[_0x1d2a('0x1e')];var _0x2cc751=_0x4b5100?0x0:_0x5a9d75['offset'];var _0x1ebe06=_0x4b5100?_0x3735e5['count']:_0x5a9d75[_0x1d2a('0x1b')]+_0x5a9d75[_0x1d2a('0x1d')];var _0x4d64e9;if(_0x1ebe06>=_0x64961d){_0x1ebe06=_0x64961d;_0x4d64e9=0xc8;}else{_0x4d64e9=0xce;}_0x4d5844['status'](_0x4d64e9);return _0x4d5844[_0x1d2a('0x1f')](_0x1d2a('0x20'),_0x2cc751+'-'+_0x1ebe06+'/'+_0x64961d)[_0x1d2a('0x21')](_0x3735e5);}return null;};}function patchUpdates(_0x13ef62){return function(_0x5c6cac){try{jsonpatch[_0x1d2a('0x22')](_0x5c6cac,_0x13ef62,!![]);}catch(_0x38dac9){return BPromise[_0x1d2a('0x23')](_0x38dac9);}return _0x5c6cac['save']();};}function saveUpdates(_0x1a44a8,_0x5d3d9f){return function(_0x3bb747){if(_0x3bb747){return _0x3bb747[_0x1d2a('0x24')](_0x1a44a8)[_0x1d2a('0x25')](function(_0x1873fb){return _0x1873fb;});}return null;};}function removeEntity(_0x30656f,_0x523656){return function(_0x27e5ab){if(_0x27e5ab){return _0x27e5ab['destroy']()[_0x1d2a('0x25')](function(){_0x30656f[_0x1d2a('0x19')](0xcc)[_0x1d2a('0x1a')]();});}};}function handleEntityNotFound(_0x2ab386,_0x2f1b46){return function(_0x313098){if(!_0x313098){_0x2ab386[_0x1d2a('0x18')](0x194);}return _0x313098;};}function handleError(_0x36f551,_0x38e270){_0x38e270=_0x38e270||0x1f4;return function(_0x577a6f){logger['error'](_0x577a6f[_0x1d2a('0x26')]);if(_0x577a6f[_0x1d2a('0x27')]){delete _0x577a6f[_0x1d2a('0x27')];}_0x36f551[_0x1d2a('0x19')](_0x38e270)[_0x1d2a('0x28')](_0x577a6f);};}exports[_0x1d2a('0x29')]=function(_0x74feba,_0x3defda){var _0x29b8bc={},_0x55ba38={},_0x1b2c06={'count':0x0,'rows':[]};var _0x2398f8=_[_0x1d2a('0x2a')](db['SugarcrmConfiguration'][_0x1d2a('0x2b')],function(_0x5a4fe6){return{'name':_0x5a4fe6[_0x1d2a('0x2c')],'type':_0x5a4fe6[_0x1d2a('0x2d')][_0x1d2a('0x2e')]};});_0x55ba38['model']=_['map'](_0x2398f8,_0x1d2a('0x27'));_0x55ba38[_0x1d2a('0x2f')]=_[_0x1d2a('0x30')](_0x74feba[_0x1d2a('0x2f')]);_0x55ba38[_0x1d2a('0x31')]=_['intersection'](_0x55ba38[_0x1d2a('0x32')],_0x55ba38[_0x1d2a('0x2f')]);_0x29b8bc['attributes']=_['intersection'](_0x55ba38[_0x1d2a('0x32')],qs['fields'](_0x74feba[_0x1d2a('0x2f')][_0x1d2a('0x33')]));_0x29b8bc[_0x1d2a('0x34')]=_0x29b8bc[_0x1d2a('0x34')][_0x1d2a('0x35')]?_0x29b8bc[_0x1d2a('0x34')]:_0x55ba38[_0x1d2a('0x32')];if(!_0x74feba[_0x1d2a('0x2f')][_0x1d2a('0x36')](_0x1d2a('0x37'))){_0x29b8bc['limit']=qs[_0x1d2a('0x1d')](_0x74feba[_0x1d2a('0x2f')][_0x1d2a('0x1d')]);_0x29b8bc['offset']=qs[_0x1d2a('0x1b')](_0x74feba['query']['offset']);}_0x29b8bc['order']=qs[_0x1d2a('0x38')](_0x74feba[_0x1d2a('0x2f')][_0x1d2a('0x38')]);_0x29b8bc[_0x1d2a('0x39')]=qs[_0x1d2a('0x31')](_[_0x1d2a('0x3a')](_0x74feba[_0x1d2a('0x2f')],_0x55ba38[_0x1d2a('0x31')]),_0x2398f8);if(_0x74feba[_0x1d2a('0x2f')][_0x1d2a('0x3b')]){_0x29b8bc[_0x1d2a('0x39')]=_[_0x1d2a('0x3c')](_0x29b8bc[_0x1d2a('0x39')],{'$or':_['map'](_0x2398f8,function(_0x5371ef){if(_0x5371ef['type']!=='VIRTUAL'){var _0x593f02={};_0x593f02[_0x5371ef[_0x1d2a('0x27')]]={'$like':'%'+_0x74feba['query'][_0x1d2a('0x3b')]+'%'};return _0x593f02;}})});}_0x29b8bc=_[_0x1d2a('0x3c')]({},_0x29b8bc,_0x74feba[_0x1d2a('0x3d')]);var _0xa59fd5={'where':_0x29b8bc['where']};return db['SugarcrmConfiguration'][_0x1d2a('0x1e')](_0xa59fd5)['then'](function(_0x31d191){_0x1b2c06['count']=_0x31d191;if(_0x74feba[_0x1d2a('0x2f')][_0x1d2a('0x3e')]){_0x29b8bc[_0x1d2a('0x3f')]=[{'all':!![]}];}return db[_0x1d2a('0x40')]['findAll'](_0x29b8bc);})[_0x1d2a('0x25')](function(_0x28ee91){_0x1b2c06[_0x1d2a('0x41')]=_0x28ee91;return _0x1b2c06;})[_0x1d2a('0x25')](respondWithFilteredResult(_0x3defda,_0x29b8bc))[_0x1d2a('0x42')](handleError(_0x3defda,null));};exports[_0x1d2a('0x43')]=function(_0x5e8467,_0x4e923f){var _0x356dc7={'raw':![],'where':{'id':_0x5e8467[_0x1d2a('0x44')]['id']}},_0x4642bc={};_0x4642bc[_0x1d2a('0x32')]=_['keys'](db[_0x1d2a('0x40')][_0x1d2a('0x2b')]);_0x4642bc[_0x1d2a('0x2f')]=_['keys'](_0x5e8467[_0x1d2a('0x2f')]);_0x4642bc[_0x1d2a('0x31')]=_[_0x1d2a('0x45')](_0x4642bc[_0x1d2a('0x32')],_0x4642bc[_0x1d2a('0x2f')]);_0x356dc7[_0x1d2a('0x34')]=_[_0x1d2a('0x45')](_0x4642bc[_0x1d2a('0x32')],qs[_0x1d2a('0x33')](_0x5e8467[_0x1d2a('0x2f')][_0x1d2a('0x33')]));_0x356dc7[_0x1d2a('0x34')]=_0x356dc7['attributes'][_0x1d2a('0x35')]?_0x356dc7[_0x1d2a('0x34')]:_0x4642bc[_0x1d2a('0x32')];if(_0x5e8467['query'][_0x1d2a('0x3e')]){_0x356dc7['include']=[{'all':!![]}];}_0x356dc7=_[_0x1d2a('0x3c')]({},_0x356dc7,_0x5e8467[_0x1d2a('0x3d')]);return db[_0x1d2a('0x40')][_0x1d2a('0x46')](_0x356dc7)[_0x1d2a('0x25')](handleEntityNotFound(_0x4e923f,null))[_0x1d2a('0x25')](respondWithResult(_0x4e923f,null))[_0x1d2a('0x42')](handleError(_0x4e923f,null));};exports['create']=function(_0x410bbc,_0x1a5f5f){return db[_0x1d2a('0x40')]['create'](_0x410bbc['body'],{})['then'](respondWithResult(_0x1a5f5f,0xc9))['catch'](handleError(_0x1a5f5f,null));};exports['update']=function(_0x5a4a85,_0xe523f9){if(_0x5a4a85[_0x1d2a('0x47')]['id']){delete _0x5a4a85[_0x1d2a('0x47')]['id'];}return db[_0x1d2a('0x40')][_0x1d2a('0x46')]({'where':{'id':_0x5a4a85['params']['id']}})[_0x1d2a('0x25')](handleEntityNotFound(_0xe523f9,null))[_0x1d2a('0x25')](saveUpdates(_0x5a4a85[_0x1d2a('0x47')],null))[_0x1d2a('0x25')](respondWithResult(_0xe523f9,null))['catch'](handleError(_0xe523f9,null));};exports['destroy']=function(_0x17e145,_0x588219){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x17e145['params']['id']}})[_0x1d2a('0x25')](handleEntityNotFound(_0x588219,null))[_0x1d2a('0x25')](removeEntity(_0x588219,null))[_0x1d2a('0x42')](handleError(_0x588219,null));};exports['getFields']=function(_0x5003be,_0x351d42,_0x56b539){var _0x13fb13={};var _0x5e7fe9={};var _0x51637e;var _0x322f22;return db['SugarcrmConfiguration'][_0x1d2a('0x48')]({'where':{'id':_0x5003be['params']['id']}})[_0x1d2a('0x25')](handleEntityNotFound(_0x351d42,null))[_0x1d2a('0x25')](function(_0x5c1829){if(_0x5c1829){_0x51637e=_0x5c1829;_0x5e7fe9[_0x1d2a('0x32')]=_[_0x1d2a('0x30')](db['SugarcrmField'][_0x1d2a('0x2b')]);_0x5e7fe9[_0x1d2a('0x2f')]=_[_0x1d2a('0x30')](_0x5003be[_0x1d2a('0x2f')]);_0x5e7fe9[_0x1d2a('0x31')]=_['intersection'](_0x5e7fe9[_0x1d2a('0x32')],_0x5e7fe9[_0x1d2a('0x2f')]);_0x13fb13[_0x1d2a('0x34')]=_[_0x1d2a('0x45')](_0x5e7fe9[_0x1d2a('0x32')],qs['fields'](_0x5003be[_0x1d2a('0x2f')]['fields']));_0x13fb13[_0x1d2a('0x34')]=_0x13fb13[_0x1d2a('0x34')][_0x1d2a('0x35')]?_0x13fb13[_0x1d2a('0x34')]:_0x5e7fe9[_0x1d2a('0x32')];_0x13fb13[_0x1d2a('0x49')]=qs[_0x1d2a('0x38')](_0x5003be[_0x1d2a('0x2f')][_0x1d2a('0x38')]);_0x13fb13['where']=qs[_0x1d2a('0x31')](_[_0x1d2a('0x3a')](_0x5003be[_0x1d2a('0x2f')],_0x5e7fe9[_0x1d2a('0x31')]));if(_0x5003be[_0x1d2a('0x2f')][_0x1d2a('0x3b')]){_0x13fb13['where']=_[_0x1d2a('0x3c')](_0x13fb13['where'],{'$or':_[_0x1d2a('0x2a')](_0x13fb13['attributes'],function(_0x683f3e){var _0x141388={};_0x141388[_0x683f3e]={'$like':'%'+_0x5003be[_0x1d2a('0x2f')][_0x1d2a('0x3b')]+'%'};return _0x141388;})});}_0x13fb13=_[_0x1d2a('0x3c')]({},_0x13fb13,_0x5003be['options']);return _0x51637e[_0x1d2a('0x4a')](_0x13fb13);}})[_0x1d2a('0x25')](function(_0x3b3266){if(_0x3b3266){_0x322f22=_0x3b3266[_0x1d2a('0x35')];if(!_0x5003be[_0x1d2a('0x2f')][_0x1d2a('0x36')]('nolimit')){_0x13fb13[_0x1d2a('0x1d')]=qs[_0x1d2a('0x1d')](_0x5003be['query'][_0x1d2a('0x1d')]);_0x13fb13[_0x1d2a('0x1b')]=qs['offset'](_0x5003be[_0x1d2a('0x2f')]['offset']);}return _0x51637e['getFields'](_0x13fb13);}})[_0x1d2a('0x25')](function(_0x6f9156){if(_0x6f9156){return _0x6f9156?{'count':_0x322f22,'rows':_0x6f9156}:null;}})[_0x1d2a('0x25')](respondWithResult(_0x351d42,null))[_0x1d2a('0x42')](handleError(_0x351d42,null));};exports[_0x1d2a('0x4b')]=function(_0x402cc0,_0x362a8f,_0x50eb03){var _0x2f1d47={};var _0x4f209a={};var _0xcb5e93;var _0x46c944;return db[_0x1d2a('0x40')]['findOne']({'where':{'id':_0x402cc0[_0x1d2a('0x44')]['id']}})[_0x1d2a('0x25')](handleEntityNotFound(_0x362a8f,null))[_0x1d2a('0x25')](function(_0x4312ad){if(_0x4312ad){_0xcb5e93=_0x4312ad;_0x4f209a[_0x1d2a('0x32')]=_[_0x1d2a('0x30')](db['SugarcrmField']['rawAttributes']);_0x4f209a[_0x1d2a('0x2f')]=_[_0x1d2a('0x30')](_0x402cc0['query']);_0x4f209a[_0x1d2a('0x31')]=_[_0x1d2a('0x45')](_0x4f209a[_0x1d2a('0x32')],_0x4f209a[_0x1d2a('0x2f')]);_0x2f1d47[_0x1d2a('0x34')]=_['intersection'](_0x4f209a[_0x1d2a('0x32')],qs[_0x1d2a('0x33')](_0x402cc0[_0x1d2a('0x2f')][_0x1d2a('0x33')]));_0x2f1d47['attributes']=_0x2f1d47[_0x1d2a('0x34')][_0x1d2a('0x35')]?_0x2f1d47['attributes']:_0x4f209a[_0x1d2a('0x32')];_0x2f1d47[_0x1d2a('0x49')]=qs['sort'](_0x402cc0['query'][_0x1d2a('0x38')]);_0x2f1d47[_0x1d2a('0x39')]=qs['filters'](_[_0x1d2a('0x3a')](_0x402cc0[_0x1d2a('0x2f')],_0x4f209a[_0x1d2a('0x31')]));if(_0x402cc0[_0x1d2a('0x2f')][_0x1d2a('0x3b')]){_0x2f1d47[_0x1d2a('0x39')]=_[_0x1d2a('0x3c')](_0x2f1d47[_0x1d2a('0x39')],{'$or':_['map'](_0x2f1d47['attributes'],function(_0x5547bf){var _0x1827a6={};_0x1827a6[_0x5547bf]={'$like':'%'+_0x402cc0['query']['filter']+'%'};return _0x1827a6;})});}_0x2f1d47=_['merge']({},_0x2f1d47,_0x402cc0[_0x1d2a('0x3d')]);return _0xcb5e93[_0x1d2a('0x4b')](_0x2f1d47);}})['then'](function(_0x5a985e){if(_0x5a985e){_0x46c944=_0x5a985e['length'];if(!_0x402cc0[_0x1d2a('0x2f')]['hasOwnProperty'](_0x1d2a('0x37'))){_0x2f1d47[_0x1d2a('0x1d')]=qs[_0x1d2a('0x1d')](_0x402cc0['query'][_0x1d2a('0x1d')]);_0x2f1d47[_0x1d2a('0x1b')]=qs['offset'](_0x402cc0[_0x1d2a('0x2f')][_0x1d2a('0x1b')]);}return _0xcb5e93['getSubjects'](_0x2f1d47);}})[_0x1d2a('0x25')](function(_0x414573){if(_0x414573){return _0x414573?{'count':_0x46c944,'rows':_0x414573}:null;}})['then'](respondWithResult(_0x362a8f,null))[_0x1d2a('0x42')](handleError(_0x362a8f,null));};exports[_0x1d2a('0x4c')]=function(_0x427991,_0x20d8eb,_0x3a6ca3){var _0x580ede={};var _0xeb2a1b={};var _0x2f65a7;var _0x17c786;return db[_0x1d2a('0x40')][_0x1d2a('0x48')]({'where':{'id':_0x427991[_0x1d2a('0x44')]['id']}})['then'](handleEntityNotFound(_0x20d8eb,null))[_0x1d2a('0x25')](function(_0x437889){if(_0x437889){_0x2f65a7=_0x437889;_0xeb2a1b[_0x1d2a('0x32')]=_['keys'](db[_0x1d2a('0x4d')][_0x1d2a('0x2b')]);_0xeb2a1b['query']=_[_0x1d2a('0x30')](_0x427991['query']);_0xeb2a1b[_0x1d2a('0x31')]=_[_0x1d2a('0x45')](_0xeb2a1b[_0x1d2a('0x32')],_0xeb2a1b[_0x1d2a('0x2f')]);_0x580ede[_0x1d2a('0x34')]=_[_0x1d2a('0x45')](_0xeb2a1b['model'],qs[_0x1d2a('0x33')](_0x427991['query'][_0x1d2a('0x33')]));_0x580ede[_0x1d2a('0x34')]=_0x580ede[_0x1d2a('0x34')][_0x1d2a('0x35')]?_0x580ede[_0x1d2a('0x34')]:_0xeb2a1b[_0x1d2a('0x32')];_0x580ede['order']=qs[_0x1d2a('0x38')](_0x427991[_0x1d2a('0x2f')]['sort']);_0x580ede[_0x1d2a('0x39')]=qs[_0x1d2a('0x31')](_[_0x1d2a('0x3a')](_0x427991[_0x1d2a('0x2f')],_0xeb2a1b[_0x1d2a('0x31')]));if(_0x427991['query']['filter']){_0x580ede['where']=_['merge'](_0x580ede[_0x1d2a('0x39')],{'$or':_[_0x1d2a('0x2a')](_0x580ede[_0x1d2a('0x34')],function(_0x549483){var _0x2ce5ee={};_0x2ce5ee[_0x549483]={'$like':'%'+_0x427991[_0x1d2a('0x2f')][_0x1d2a('0x3b')]+'%'};return _0x2ce5ee;})});}_0x580ede=_['merge']({},_0x580ede,_0x427991['options']);return _0x2f65a7['getDescriptions'](_0x580ede);}})[_0x1d2a('0x25')](function(_0x235593){if(_0x235593){_0x17c786=_0x235593['length'];if(!_0x427991[_0x1d2a('0x2f')][_0x1d2a('0x36')]('nolimit')){_0x580ede['limit']=qs[_0x1d2a('0x1d')](_0x427991['query']['limit']);_0x580ede[_0x1d2a('0x1b')]=qs[_0x1d2a('0x1b')](_0x427991['query'][_0x1d2a('0x1b')]);}return _0x2f65a7[_0x1d2a('0x4c')](_0x580ede);}})[_0x1d2a('0x25')](function(_0x1d872b){if(_0x1d872b){return _0x1d872b?{'count':_0x17c786,'rows':_0x1d872b}:null;}})['then'](respondWithResult(_0x20d8eb,null))[_0x1d2a('0x42')](handleError(_0x20d8eb,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 9bcc747..d7741ea 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 _0x6c1a=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','moment','bluebird'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x6c1a,0x1d1));var _0xa6c1=function(_0x1ce866,_0x3d0249){_0x1ce866=_0x1ce866-0x0;var _0xa6dce4=_0x6c1a[_0x1ce866];return _0xa6dce4;};'use strict';var _=require(_0xa6c1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa6c1('0x1'));var BPromise=require(_0xa6c1('0x2'));var rp=require(_0xa6c1('0x3'));var fs=require('fs');var path=require(_0xa6c1('0x4'));var rimraf=require(_0xa6c1('0x5'));var config=require(_0xa6c1('0x6'));var attributes=require(_0xa6c1('0x7'));module[_0xa6c1('0x8')]=function(_0x20224a,_0x590e0f){return _0x20224a[_0xa6c1('0x9')](_0xa6c1('0xa'),attributes,{'tableName':_0xa6c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf90=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration'];(function(_0x225365,_0x575049){var _0x28afb8=function(_0x4f7376){while(--_0x4f7376){_0x225365['push'](_0x225365['shift']());}};_0x28afb8(++_0x575049);}(_0xdf90,0xc0));var _0x0df9=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0xdf90[_0x264b61];return _0x8fff4f;};'use strict';var _=require(_0x0df9('0x0'));var util=require(_0x0df9('0x1'));var logger=require(_0x0df9('0x2'))(_0x0df9('0x3'));var moment=require(_0x0df9('0x4'));var BPromise=require(_0x0df9('0x5'));var rp=require(_0x0df9('0x6'));var fs=require('fs');var path=require(_0x0df9('0x7'));var rimraf=require(_0x0df9('0x8'));var config=require('../../config/environment');var attributes=require(_0x0df9('0x9'));module['exports']=function(_0xb76cb1,_0x4a85d3){return _0xb76cb1[_0x0df9('0xa')](_0x0df9('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 0f51791..63f8a10 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 _0xa9ac=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug'];(function(_0xad8a2d,_0x4a75f2){var _0x5de794=function(_0x46c1af){while(--_0x46c1af){_0xad8a2d['push'](_0xad8a2d['shift']());}};_0x5de794(++_0x4a75f2);}(_0xa9ac,0x80));var _0xca9a=function(_0x3d8cc6,_0x15c86a){_0x3d8cc6=_0x3d8cc6-0x0;var _0x3b8d5d=_0xa9ac[_0x3d8cc6];return _0x3b8d5d;};'use strict';var _=require(_0xca9a('0x0'));var util=require(_0xca9a('0x1'));var moment=require(_0xca9a('0x2'));var BPromise=require(_0xca9a('0x3'));var rs=require(_0xca9a('0x4'));var fs=require('fs');var Redis=require(_0xca9a('0x5'));var db=require(_0xca9a('0x6'))['db'];var utils=require(_0xca9a('0x7'));var logger=require(_0xca9a('0x8'))(_0xca9a('0x9'));var config=require(_0xca9a('0xa'));var jayson=require(_0xca9a('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bdaae,_0x1b4afd,_0x3ef361){return new BPromise(function(_0x11acc7,_0xf04c){return client[_0xca9a('0xc')](_0x5bdaae,_0x3ef361)[_0xca9a('0xd')](function(_0x1e9e69){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1b4afd,_0xca9a('0xe'));logger[_0xca9a('0xf')](_0xca9a('0x10'),_0x1b4afd,'request\x20sent',JSON[_0xca9a('0x11')](_0x1e9e69));if(_0x1e9e69[_0xca9a('0x12')]){if(_0x1e9e69[_0xca9a('0x12')]['code']===0x1f4){logger[_0xca9a('0x12')](_0xca9a('0x13'),_0x1b4afd,_0x1e9e69[_0xca9a('0x12')][_0xca9a('0x14')]);return _0xf04c(_0x1e9e69[_0xca9a('0x12')]['message']);}logger[_0xca9a('0x12')](_0xca9a('0x13'),_0x1b4afd,_0x1e9e69[_0xca9a('0x12')][_0xca9a('0x14')]);return _0x11acc7(_0x1e9e69[_0xca9a('0x12')]['message']);}else{logger[_0xca9a('0x15')](_0xca9a('0x13'),_0x1b4afd,_0xca9a('0xe'));_0x11acc7(_0x1e9e69[_0xca9a('0x16')][_0xca9a('0x14')]);}})[_0xca9a('0x17')](function(_0x35b6ce){logger[_0xca9a('0x12')](_0xca9a('0x13'),_0x1b4afd,_0x35b6ce);_0xf04c(_0x35b6ce);});});} \ No newline at end of file +var _0x874f=['jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x874f,0x108));var _0xf874=function(_0x1a4a49,_0xf73c87){_0x1a4a49=_0x1a4a49-0x0;var _0x3be8cd=_0x874f[_0x1a4a49];return _0x3be8cd;};'use strict';var _=require(_0xf874('0x0'));var util=require(_0xf874('0x1'));var moment=require(_0xf874('0x2'));var BPromise=require('bluebird');var rs=require(_0xf874('0x3'));var fs=require('fs');var Redis=require(_0xf874('0x4'));var db=require(_0xf874('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf874('0x6'))(_0xf874('0x7'));var config=require(_0xf874('0x8'));var jayson=require(_0xf874('0x9'));var client=jayson['client'][_0xf874('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59349d,_0x365e63,_0x3e96a3){return new BPromise(function(_0x503c95,_0xbe27f8){return client[_0xf874('0xb')](_0x59349d,_0x3e96a3)[_0xf874('0xc')](function(_0x1b7af3){logger[_0xf874('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x365e63,_0xf874('0xe'));logger[_0xf874('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x365e63,_0xf874('0xe'),JSON[_0xf874('0x10')](_0x1b7af3));if(_0x1b7af3[_0xf874('0x11')]){if(_0x1b7af3[_0xf874('0x11')]['code']===0x1f4){logger[_0xf874('0x11')](_0xf874('0x12'),_0x365e63,_0x1b7af3[_0xf874('0x11')][_0xf874('0x13')]);return _0xbe27f8(_0x1b7af3['error'][_0xf874('0x13')]);}logger[_0xf874('0x11')](_0xf874('0x12'),_0x365e63,_0x1b7af3[_0xf874('0x11')][_0xf874('0x13')]);return _0x503c95(_0x1b7af3[_0xf874('0x11')][_0xf874('0x13')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x365e63,_0xf874('0xe'));_0x503c95(_0x1b7af3[_0xf874('0x14')][_0xf874('0x13')]);}})['catch'](function(_0x2af431){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x365e63,_0x2af431);_0xbe27f8(_0x2af431);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 12bc796..7973621 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 _0x5547=['get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5547,0x1a9));var _0x7554=function(_0x3c4b44,_0x1f4994){_0x3c4b44=_0x3c4b44-0x0;var _0xd6a408=_0x5547[_0x3c4b44];return _0xd6a408;};'use strict';var multer=require(_0x7554('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7554('0x1')]();var fs_extra=require(_0x7554('0x2'));var auth=require(_0x7554('0x3'));var interaction=require(_0x7554('0x4'));var config=require(_0x7554('0x5'));var controller=require(_0x7554('0x6'));router[_0x7554('0x7')]('/',auth[_0x7554('0x8')](),controller[_0x7554('0x9')]);router[_0x7554('0x7')](_0x7554('0xa'),auth['isAuthenticated'](),controller[_0x7554('0xb')]);router['post']('/',auth[_0x7554('0x8')](),controller['create']);router[_0x7554('0xc')]('/:id',auth[_0x7554('0x8')](),controller['update']);router[_0x7554('0xd')](_0x7554('0xa'),auth[_0x7554('0x8')](),controller[_0x7554('0xe')]);module[_0x7554('0xf')]=router; \ No newline at end of file +var _0x0076=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','index','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0076,0x8e));var _0x6007=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x0076[_0x5ddaac];return _0x2a9c58;};'use strict';var multer=require('multer');var util=require(_0x6007('0x0'));var path=require(_0x6007('0x1'));var timeout=require(_0x6007('0x2'));var express=require(_0x6007('0x3'));var router=express[_0x6007('0x4')]();var fs_extra=require(_0x6007('0x5'));var auth=require(_0x6007('0x6'));var interaction=require(_0x6007('0x7'));var config=require('../../config/environment');var controller=require(_0x6007('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6007('0x9')]);router[_0x6007('0xa')](_0x6007('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6007('0xc')](),controller['create']);router[_0x6007('0xd')](_0x6007('0xb'),auth['isAuthenticated'](),controller[_0x6007('0xe')]);router[_0x6007('0xf')](_0x6007('0xb'),auth[_0x6007('0xc')](),controller[_0x6007('0x10')]);module[_0x6007('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 a1674cb..ac9d838 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 _0x55a6=['string','STRING','BOOLEAN','sequelize','exports','customVariable','keyValue','picklist'];(function(_0x228eda,_0x13f74f){var _0x5e9c49=function(_0x4f7979){while(--_0x4f7979){_0x228eda['push'](_0x228eda['shift']());}};_0x5e9c49(++_0x13f74f);}(_0x55a6,0x1ab));var _0x655a=function(_0x25d84e,_0x4b4edd){_0x25d84e=_0x25d84e-0x0;var _0x2417ad=_0x55a6[_0x25d84e];return _0x2417ad;};'use strict';var Sequelize=require(_0x655a('0x0'));module[_0x655a('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x655a('0x2'),_0x655a('0x3'),_0x655a('0x4')),'defaultValue':_0x655a('0x5')},'content':{'type':Sequelize[_0x655a('0x6')]},'key':{'type':Sequelize[_0x655a('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x655a('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x655a('0x6')]},'customField':{'type':Sequelize[_0x655a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x655a('0x6')]}}; \ No newline at end of file +var _0x9e01=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0xac0079,_0x2ab202){var _0x2fd2fd=function(_0x36262b){while(--_0x36262b){_0xac0079['push'](_0xac0079['shift']());}};_0x2fd2fd(++_0x2ab202);}(_0x9e01,0xfe));var _0x19e0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x9e01[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x19e0('0x0'));module[_0x19e0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x19e0('0x2'),_0x19e0('0x3'),_0x19e0('0x4'),_0x19e0('0x5'),_0x19e0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x19e0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x19e0('0x8')](_0x19e0('0x2'),_0x19e0('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x19e0('0x7')]},'idField':{'type':Sequelize[_0x19e0('0x7')]},'nameField':{'type':Sequelize[_0x19e0('0x7')]},'customField':{'type':Sequelize[_0x19e0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x19e0('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a25fa55..5551511 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 _0x2baa=['name','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','VIRTUAL','options','SugarcrmField','include','rows','catch','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','rawAttributes','type','key'];(function(_0xdff6ec,_0x177300){var _0x3081fe=function(_0x5576e6){while(--_0x5576e6){_0xdff6ec['push'](_0xdff6ec['shift']());}};_0x3081fe(++_0x177300);}(_0x2baa,0xfb));var _0xa2ba=function(_0x4d75e9,_0x287aee){_0x4d75e9=_0x4d75e9-0x0;var _0x46d38a=_0x2baa[_0x4d75e9];return _0x46d38a;};'use strict';var emlformat=require(_0xa2ba('0x0'));var rimraf=require(_0xa2ba('0x1'));var zipdir=require(_0xa2ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2ba('0x3'));var moment=require(_0xa2ba('0x4'));var BPromise=require(_0xa2ba('0x5'));var Mustache=require('mustache');var util=require(_0xa2ba('0x6'));var path=require(_0xa2ba('0x7'));var sox=require(_0xa2ba('0x8'));var csv=require(_0xa2ba('0x9'));var ejs=require(_0xa2ba('0xa'));var fs=require('fs');var fs_extra=require(_0xa2ba('0xb'));var _=require(_0xa2ba('0xc'));var squel=require(_0xa2ba('0xd'));var crypto=require(_0xa2ba('0xe'));var jsforce=require(_0xa2ba('0xf'));var deskjs=require(_0xa2ba('0x10'));var toCsv=require(_0xa2ba('0x9'));var querystring=require(_0xa2ba('0x11'));var Papa=require('papaparse');var Redis=require(_0xa2ba('0x12'));var authService=require(_0xa2ba('0x13'));var qs=require(_0xa2ba('0x14'));var as=require(_0xa2ba('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2ba('0x16'))(_0xa2ba('0x17'));var utils=require('../../config/utils');var config=require(_0xa2ba('0x18'));var licenseUtil=require(_0xa2ba('0x19'));var db=require(_0xa2ba('0x1a'))['db'];function respondWithStatusCode(_0x3d949f,_0x38560b){_0x38560b=_0x38560b||0xcc;return function(_0xe3f718){if(_0xe3f718){return _0x3d949f[_0xa2ba('0x1b')](_0x38560b);}return _0x3d949f[_0xa2ba('0x1c')](_0x38560b)[_0xa2ba('0x1d')]();};}function respondWithResult(_0x26d460,_0x5f237d){_0x5f237d=_0x5f237d||0xc8;return function(_0x598501){if(_0x598501){return _0x26d460[_0xa2ba('0x1c')](_0x5f237d)[_0xa2ba('0x1e')](_0x598501);}};}function respondWithFilteredResult(_0x3fe414,_0x344194){return function(_0x5912b9){if(_0x5912b9){var _0x432b49=typeof _0x344194[_0xa2ba('0x1f')]===_0xa2ba('0x20')&&typeof _0x344194[_0xa2ba('0x21')]===_0xa2ba('0x20');var _0x279455=_0x5912b9['count'];var _0x41cef0=_0x432b49?0x0:_0x344194[_0xa2ba('0x1f')];var _0x5ed0d7=_0x432b49?_0x5912b9[_0xa2ba('0x22')]:_0x344194[_0xa2ba('0x1f')]+_0x344194[_0xa2ba('0x21')];var _0x532647;if(_0x5ed0d7>=_0x279455){_0x5ed0d7=_0x279455;_0x532647=0xc8;}else{_0x532647=0xce;}_0x3fe414[_0xa2ba('0x1c')](_0x532647);return _0x3fe414['set'](_0xa2ba('0x23'),_0x41cef0+'-'+_0x5ed0d7+'/'+_0x279455)[_0xa2ba('0x1e')](_0x5912b9);}return null;};}function patchUpdates(_0xaed6c){return function(_0x2c083f){try{jsonpatch[_0xa2ba('0x24')](_0x2c083f,_0xaed6c,!![]);}catch(_0x39d09a){return BPromise[_0xa2ba('0x25')](_0x39d09a);}return _0x2c083f[_0xa2ba('0x26')]();};}function saveUpdates(_0x56a4f5,_0x2b3b9b){return function(_0x49f460){if(_0x49f460){return _0x49f460[_0xa2ba('0x27')](_0x56a4f5)['then'](function(_0x5821c5){return _0x5821c5;});}return null;};}function removeEntity(_0x158120,_0x138df4){return function(_0x1218e8){if(_0x1218e8){return _0x1218e8['destroy']()[_0xa2ba('0x28')](function(){_0x158120[_0xa2ba('0x1c')](0xcc)[_0xa2ba('0x1d')]();});}};}function handleEntityNotFound(_0x3692b1,_0x400f9c){return function(_0x1557c7){if(!_0x1557c7){_0x3692b1[_0xa2ba('0x1b')](0x194);}return _0x1557c7;};}function handleError(_0x444c34,_0x5a53b9){_0x5a53b9=_0x5a53b9||0x1f4;return function(_0x23c81a){logger[_0xa2ba('0x29')](_0x23c81a[_0xa2ba('0x2a')]);if(_0x23c81a['name']){delete _0x23c81a['name'];}_0x444c34[_0xa2ba('0x1c')](_0x5a53b9)[_0xa2ba('0x2b')](_0x23c81a);};}exports[_0xa2ba('0x2c')]=function(_0x388517,_0x4091c5){var _0x33d8a9={},_0x12a2d6={},_0x1897aa={'count':0x0,'rows':[]};var _0x8a6001=_[_0xa2ba('0x2d')](db['SugarcrmField'][_0xa2ba('0x2e')],function(_0x58ee63){return{'name':_0x58ee63['fieldName'],'type':_0x58ee63[_0xa2ba('0x2f')][_0xa2ba('0x30')]};});_0x12a2d6['model']=_[_0xa2ba('0x2d')](_0x8a6001,_0xa2ba('0x31'));_0x12a2d6[_0xa2ba('0x32')]=_[_0xa2ba('0x33')](_0x388517['query']);_0x12a2d6[_0xa2ba('0x34')]=_[_0xa2ba('0x35')](_0x12a2d6['model'],_0x12a2d6['query']);_0x33d8a9[_0xa2ba('0x36')]=_[_0xa2ba('0x35')](_0x12a2d6['model'],qs['fields'](_0x388517[_0xa2ba('0x32')][_0xa2ba('0x37')]));_0x33d8a9[_0xa2ba('0x36')]=_0x33d8a9[_0xa2ba('0x36')][_0xa2ba('0x38')]?_0x33d8a9[_0xa2ba('0x36')]:_0x12a2d6[_0xa2ba('0x39')];if(!_0x388517[_0xa2ba('0x32')]['hasOwnProperty'](_0xa2ba('0x3a'))){_0x33d8a9[_0xa2ba('0x21')]=qs[_0xa2ba('0x21')](_0x388517['query'][_0xa2ba('0x21')]);_0x33d8a9[_0xa2ba('0x1f')]=qs[_0xa2ba('0x1f')](_0x388517[_0xa2ba('0x32')][_0xa2ba('0x1f')]);}_0x33d8a9[_0xa2ba('0x3b')]=qs[_0xa2ba('0x3c')](_0x388517['query'][_0xa2ba('0x3c')]);_0x33d8a9[_0xa2ba('0x3d')]=qs[_0xa2ba('0x34')](_['pick'](_0x388517[_0xa2ba('0x32')],_0x12a2d6[_0xa2ba('0x34')]),_0x8a6001);if(_0x388517[_0xa2ba('0x32')][_0xa2ba('0x3e')]){_0x33d8a9[_0xa2ba('0x3d')]=_['merge'](_0x33d8a9[_0xa2ba('0x3d')],{'$or':_[_0xa2ba('0x2d')](_0x8a6001,function(_0x5dc3f2){if(_0x5dc3f2['type']!==_0xa2ba('0x3f')){var _0x3d5b1b={};_0x3d5b1b[_0x5dc3f2[_0xa2ba('0x31')]]={'$like':'%'+_0x388517[_0xa2ba('0x32')]['filter']+'%'};return _0x3d5b1b;}})});}_0x33d8a9=_['merge']({},_0x33d8a9,_0x388517[_0xa2ba('0x40')]);var _0x6a982f={'where':_0x33d8a9[_0xa2ba('0x3d')]};return db[_0xa2ba('0x41')][_0xa2ba('0x22')](_0x6a982f)[_0xa2ba('0x28')](function(_0x2db9ad){_0x1897aa[_0xa2ba('0x22')]=_0x2db9ad;if(_0x388517[_0xa2ba('0x32')]['includeAll']){_0x33d8a9[_0xa2ba('0x42')]=[{'all':!![]}];}return db[_0xa2ba('0x41')]['findAll'](_0x33d8a9);})['then'](function(_0x346d68){_0x1897aa[_0xa2ba('0x43')]=_0x346d68;return _0x1897aa;})[_0xa2ba('0x28')](respondWithFilteredResult(_0x4091c5,_0x33d8a9))[_0xa2ba('0x44')](handleError(_0x4091c5,null));};exports['show']=function(_0x5f00e5,_0x6eec06){var _0x402965={'raw':!![],'where':{'id':_0x5f00e5[_0xa2ba('0x45')]['id']}},_0x1b0a49={};_0x1b0a49['model']=_[_0xa2ba('0x33')](db[_0xa2ba('0x41')][_0xa2ba('0x2e')]);_0x1b0a49[_0xa2ba('0x32')]=_[_0xa2ba('0x33')](_0x5f00e5[_0xa2ba('0x32')]);_0x1b0a49['filters']=_[_0xa2ba('0x35')](_0x1b0a49[_0xa2ba('0x39')],_0x1b0a49['query']);_0x402965[_0xa2ba('0x36')]=_[_0xa2ba('0x35')](_0x1b0a49[_0xa2ba('0x39')],qs[_0xa2ba('0x37')](_0x5f00e5['query']['fields']));_0x402965[_0xa2ba('0x36')]=_0x402965['attributes'][_0xa2ba('0x38')]?_0x402965[_0xa2ba('0x36')]:_0x1b0a49[_0xa2ba('0x39')];if(_0x5f00e5[_0xa2ba('0x32')][_0xa2ba('0x46')]){_0x402965[_0xa2ba('0x42')]=[{'all':!![]}];}_0x402965=_['merge']({},_0x402965,_0x5f00e5[_0xa2ba('0x40')]);return db[_0xa2ba('0x41')][_0xa2ba('0x47')](_0x402965)[_0xa2ba('0x28')](handleEntityNotFound(_0x6eec06,null))['then'](respondWithResult(_0x6eec06,null))[_0xa2ba('0x44')](handleError(_0x6eec06,null));};exports[_0xa2ba('0x48')]=function(_0x31464d,_0x5c337d){return db[_0xa2ba('0x41')][_0xa2ba('0x48')](_0x31464d['body'],{})[_0xa2ba('0x28')](respondWithResult(_0x5c337d,0xc9))['catch'](handleError(_0x5c337d,null));};exports[_0xa2ba('0x27')]=function(_0x1262ed,_0x378de3){if(_0x1262ed[_0xa2ba('0x49')]['id']){delete _0x1262ed[_0xa2ba('0x49')]['id'];}return db['SugarcrmField'][_0xa2ba('0x47')]({'where':{'id':_0x1262ed[_0xa2ba('0x45')]['id']}})[_0xa2ba('0x28')](handleEntityNotFound(_0x378de3,null))['then'](saveUpdates(_0x1262ed[_0xa2ba('0x49')],null))[_0xa2ba('0x28')](respondWithResult(_0x378de3,null))[_0xa2ba('0x44')](handleError(_0x378de3,null));};exports[_0xa2ba('0x4a')]=function(_0x10fdd9,_0x358b67){return db['SugarcrmField'][_0xa2ba('0x47')]({'where':{'id':_0x10fdd9[_0xa2ba('0x45')]['id']}})[_0xa2ba('0x28')](handleEntityNotFound(_0x358b67,null))[_0xa2ba('0x28')](removeEntity(_0x358b67,null))[_0xa2ba('0x44')](handleError(_0x358b67,null));}; \ No newline at end of file +var _0x3bde=['index','SugarcrmField','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send'];(function(_0x1dc61f,_0x2443e6){var _0x42547c=function(_0x117882){while(--_0x117882){_0x1dc61f['push'](_0x1dc61f['shift']());}};_0x42547c(++_0x2443e6);}(_0x3bde,0x19a));var _0xe3bd=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x3bde[_0x13b02f];return _0x12e9a6;};'use strict';var emlformat=require(_0xe3bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3bd('0x1'));var jsonpatch=require(_0xe3bd('0x2'));var rp=require(_0xe3bd('0x3'));var moment=require(_0xe3bd('0x4'));var BPromise=require(_0xe3bd('0x5'));var Mustache=require(_0xe3bd('0x6'));var util=require('util');var path=require(_0xe3bd('0x7'));var sox=require(_0xe3bd('0x8'));var csv=require(_0xe3bd('0x9'));var ejs=require(_0xe3bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3bd('0xb'));var squel=require(_0xe3bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe3bd('0xd'));var deskjs=require(_0xe3bd('0xe'));var toCsv=require(_0xe3bd('0x9'));var querystring=require(_0xe3bd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe3bd('0x10'));var qs=require(_0xe3bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3bd('0x12'));var logger=require(_0xe3bd('0x13'))('api');var utils=require(_0xe3bd('0x14'));var config=require(_0xe3bd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3bd('0x16'))['db'];function respondWithStatusCode(_0x51c90e,_0x37adac){_0x37adac=_0x37adac||0xcc;return function(_0x36814a){if(_0x36814a){return _0x51c90e['sendStatus'](_0x37adac);}return _0x51c90e['status'](_0x37adac)[_0xe3bd('0x17')]();};}function respondWithResult(_0x485483,_0x3fe7e4){_0x3fe7e4=_0x3fe7e4||0xc8;return function(_0x1d1b61){if(_0x1d1b61){return _0x485483[_0xe3bd('0x18')](_0x3fe7e4)[_0xe3bd('0x19')](_0x1d1b61);}};}function respondWithFilteredResult(_0x5de3fe,_0xf97876){return function(_0xf43631){if(_0xf43631){var _0x5799b8=typeof _0xf97876[_0xe3bd('0x1a')]===_0xe3bd('0x1b')&&typeof _0xf97876['limit']===_0xe3bd('0x1b');var _0x25c9d3=_0xf43631[_0xe3bd('0x1c')];var _0x351326=_0x5799b8?0x0:_0xf97876[_0xe3bd('0x1a')];var _0x430e75=_0x5799b8?_0xf43631[_0xe3bd('0x1c')]:_0xf97876[_0xe3bd('0x1a')]+_0xf97876[_0xe3bd('0x1d')];var _0x494bf4;if(_0x430e75>=_0x25c9d3){_0x430e75=_0x25c9d3;_0x494bf4=0xc8;}else{_0x494bf4=0xce;}_0x5de3fe[_0xe3bd('0x18')](_0x494bf4);return _0x5de3fe[_0xe3bd('0x1e')](_0xe3bd('0x1f'),_0x351326+'-'+_0x430e75+'/'+_0x25c9d3)[_0xe3bd('0x19')](_0xf43631);}return null;};}function patchUpdates(_0x3b3c40){return function(_0x2f65ca){try{jsonpatch[_0xe3bd('0x20')](_0x2f65ca,_0x3b3c40,!![]);}catch(_0x249d43){return BPromise[_0xe3bd('0x21')](_0x249d43);}return _0x2f65ca[_0xe3bd('0x22')]();};}function saveUpdates(_0x18efb3,_0x485ef1){return function(_0x482234){if(_0x482234){return _0x482234['update'](_0x18efb3)[_0xe3bd('0x23')](function(_0x28e58f){return _0x28e58f;});}return null;};}function removeEntity(_0x3ccdab,_0x2cb2b6){return function(_0x231094){if(_0x231094){return _0x231094['destroy']()[_0xe3bd('0x23')](function(){_0x3ccdab[_0xe3bd('0x18')](0xcc)[_0xe3bd('0x17')]();});}};}function handleEntityNotFound(_0x4891b0,_0x5038be){return function(_0x53bc1a){if(!_0x53bc1a){_0x4891b0[_0xe3bd('0x24')](0x194);}return _0x53bc1a;};}function handleError(_0x268fcc,_0x2780cb){_0x2780cb=_0x2780cb||0x1f4;return function(_0x33b84a){logger[_0xe3bd('0x25')](_0x33b84a['stack']);if(_0x33b84a[_0xe3bd('0x26')]){delete _0x33b84a[_0xe3bd('0x26')];}_0x268fcc[_0xe3bd('0x18')](_0x2780cb)[_0xe3bd('0x27')](_0x33b84a);};}exports[_0xe3bd('0x28')]=function(_0x2c492c,_0x28d490){var _0x513ed5={},_0x4c4c11={},_0x19aeb3={'count':0x0,'rows':[]};var _0x57f36a=_['map'](db[_0xe3bd('0x29')][_0xe3bd('0x2a')],function(_0x5472a0){return{'name':_0x5472a0['fieldName'],'type':_0x5472a0[_0xe3bd('0x2b')][_0xe3bd('0x2c')]};});_0x4c4c11['model']=_[_0xe3bd('0x2d')](_0x57f36a,_0xe3bd('0x26'));_0x4c4c11[_0xe3bd('0x2e')]=_[_0xe3bd('0x2f')](_0x2c492c[_0xe3bd('0x2e')]);_0x4c4c11[_0xe3bd('0x30')]=_[_0xe3bd('0x31')](_0x4c4c11[_0xe3bd('0x32')],_0x4c4c11[_0xe3bd('0x2e')]);_0x513ed5[_0xe3bd('0x33')]=_['intersection'](_0x4c4c11['model'],qs[_0xe3bd('0x34')](_0x2c492c['query']['fields']));_0x513ed5['attributes']=_0x513ed5[_0xe3bd('0x33')]['length']?_0x513ed5[_0xe3bd('0x33')]:_0x4c4c11[_0xe3bd('0x32')];if(!_0x2c492c[_0xe3bd('0x2e')][_0xe3bd('0x35')](_0xe3bd('0x36'))){_0x513ed5[_0xe3bd('0x1d')]=qs[_0xe3bd('0x1d')](_0x2c492c['query']['limit']);_0x513ed5['offset']=qs[_0xe3bd('0x1a')](_0x2c492c['query'][_0xe3bd('0x1a')]);}_0x513ed5[_0xe3bd('0x37')]=qs[_0xe3bd('0x38')](_0x2c492c[_0xe3bd('0x2e')]['sort']);_0x513ed5[_0xe3bd('0x39')]=qs[_0xe3bd('0x30')](_[_0xe3bd('0x3a')](_0x2c492c[_0xe3bd('0x2e')],_0x4c4c11[_0xe3bd('0x30')]),_0x57f36a);if(_0x2c492c[_0xe3bd('0x2e')][_0xe3bd('0x3b')]){_0x513ed5[_0xe3bd('0x39')]=_[_0xe3bd('0x3c')](_0x513ed5[_0xe3bd('0x39')],{'$or':_['map'](_0x57f36a,function(_0x2ded27){if(_0x2ded27[_0xe3bd('0x2b')]!==_0xe3bd('0x3d')){var _0x30523f={};_0x30523f[_0x2ded27[_0xe3bd('0x26')]]={'$like':'%'+_0x2c492c['query'][_0xe3bd('0x3b')]+'%'};return _0x30523f;}})});}_0x513ed5=_['merge']({},_0x513ed5,_0x2c492c[_0xe3bd('0x3e')]);var _0x4735b6={'where':_0x513ed5['where']};return db[_0xe3bd('0x29')][_0xe3bd('0x1c')](_0x4735b6)['then'](function(_0x4d908b){_0x19aeb3[_0xe3bd('0x1c')]=_0x4d908b;if(_0x2c492c['query'][_0xe3bd('0x3f')]){_0x513ed5[_0xe3bd('0x40')]=[{'all':!![]}];}return db[_0xe3bd('0x29')][_0xe3bd('0x41')](_0x513ed5);})['then'](function(_0x36549f){_0x19aeb3[_0xe3bd('0x42')]=_0x36549f;return _0x19aeb3;})[_0xe3bd('0x23')](respondWithFilteredResult(_0x28d490,_0x513ed5))['catch'](handleError(_0x28d490,null));};exports[_0xe3bd('0x43')]=function(_0x368494,_0x51ac9f){var _0x422a57={'raw':!![],'where':{'id':_0x368494[_0xe3bd('0x44')]['id']}},_0xd6b37d={};_0xd6b37d[_0xe3bd('0x32')]=_[_0xe3bd('0x2f')](db['SugarcrmField'][_0xe3bd('0x2a')]);_0xd6b37d['query']=_[_0xe3bd('0x2f')](_0x368494['query']);_0xd6b37d[_0xe3bd('0x30')]=_[_0xe3bd('0x31')](_0xd6b37d['model'],_0xd6b37d[_0xe3bd('0x2e')]);_0x422a57[_0xe3bd('0x33')]=_[_0xe3bd('0x31')](_0xd6b37d[_0xe3bd('0x32')],qs['fields'](_0x368494[_0xe3bd('0x2e')][_0xe3bd('0x34')]));_0x422a57[_0xe3bd('0x33')]=_0x422a57[_0xe3bd('0x33')]['length']?_0x422a57[_0xe3bd('0x33')]:_0xd6b37d[_0xe3bd('0x32')];if(_0x368494['query']['includeAll']){_0x422a57[_0xe3bd('0x40')]=[{'all':!![]}];}_0x422a57=_[_0xe3bd('0x3c')]({},_0x422a57,_0x368494[_0xe3bd('0x3e')]);return db['SugarcrmField'][_0xe3bd('0x45')](_0x422a57)[_0xe3bd('0x23')](handleEntityNotFound(_0x51ac9f,null))[_0xe3bd('0x23')](respondWithResult(_0x51ac9f,null))[_0xe3bd('0x46')](handleError(_0x51ac9f,null));};exports[_0xe3bd('0x47')]=function(_0xf7c810,_0x5412cd){return db[_0xe3bd('0x29')]['create'](_0xf7c810['body'],{})[_0xe3bd('0x23')](respondWithResult(_0x5412cd,0xc9))[_0xe3bd('0x46')](handleError(_0x5412cd,null));};exports[_0xe3bd('0x48')]=function(_0x203e36,_0x43db6e){if(_0x203e36[_0xe3bd('0x49')]['id']){delete _0x203e36['body']['id'];}return db[_0xe3bd('0x29')][_0xe3bd('0x45')]({'where':{'id':_0x203e36['params']['id']}})[_0xe3bd('0x23')](handleEntityNotFound(_0x43db6e,null))[_0xe3bd('0x23')](saveUpdates(_0x203e36[_0xe3bd('0x49')],null))['then'](respondWithResult(_0x43db6e,null))[_0xe3bd('0x46')](handleError(_0x43db6e,null));};exports[_0xe3bd('0x4a')]=function(_0x2801cd,_0x3082b4){return db[_0xe3bd('0x29')][_0xe3bd('0x45')]({'where':{'id':_0x2801cd[_0xe3bd('0x44')]['id']}})[_0xe3bd('0x23')](handleEntityNotFound(_0x3082b4,null))[_0xe3bd('0x23')](removeEntity(_0x3082b4,null))[_0xe3bd('0x46')](handleError(_0x3082b4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index fddcba2..6e87e3c 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 _0xe663=['./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe663,0xd9));var _0x3e66=function(_0x203048,_0x54c112){_0x203048=_0x203048-0x0;var _0x275f98=_0xe663[_0x203048];return _0x275f98;};'use strict';var _=require('lodash');var util=require(_0x3e66('0x0'));var logger=require(_0x3e66('0x1'))(_0x3e66('0x2'));var moment=require(_0x3e66('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e66('0x4'));var fs=require('fs');var path=require(_0x3e66('0x5'));var rimraf=require(_0x3e66('0x6'));var config=require(_0x3e66('0x7'));var attributes=require(_0x3e66('0x8'));module[_0x3e66('0x9')]=function(_0xfb6eb,_0x1036fb){return _0xfb6eb['define'](_0x3e66('0xa'),attributes,{'tableName':_0x3e66('0xb'),'paranoid':![],'indexes':[{'name':_0x3e66('0xc'),'fields':[_0x3e66('0xd'),_0x3e66('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9898=['../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1fbe9a,_0x1894dd){var _0x1e76a7=function(_0x4532b8){while(--_0x4532b8){_0x1fbe9a['push'](_0x1fbe9a['shift']());}};_0x1e76a7(++_0x1894dd);}(_0x9898,0x88));var _0x8989=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x9898[_0x55ff3e];return _0x2709eb;};'use strict';var _=require(_0x8989('0x0'));var util=require(_0x8989('0x1'));var logger=require(_0x8989('0x2'))(_0x8989('0x3'));var moment=require('moment');var BPromise=require(_0x8989('0x4'));var rp=require(_0x8989('0x5'));var fs=require('fs');var path=require(_0x8989('0x6'));var rimraf=require('rimraf');var config=require(_0x8989('0x7'));var attributes=require(_0x8989('0x8'));module[_0x8989('0x9')]=function(_0x36caa2,_0x4b8b5e){return _0x36caa2['define'](_0x8989('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x8989('0xb'),'fields':['idField',_0x8989('0xc')],'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 5dca77e..af64d26 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 _0x052c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x410c89,_0x43b2fd){var _0x51b366=function(_0xa1b055){while(--_0xa1b055){_0x410c89['push'](_0x410c89['shift']());}};_0x51b366(++_0x43b2fd);}(_0x052c,0x180));var _0xc052=function(_0x9b6b28,_0xd195d0){_0x9b6b28=_0x9b6b28-0x0;var _0x35bf5e=_0x052c[_0x9b6b28];return _0x35bf5e;};'use strict';var _=require(_0xc052('0x0'));var util=require(_0xc052('0x1'));var moment=require(_0xc052('0x2'));var BPromise=require(_0xc052('0x3'));var rs=require(_0xc052('0x4'));var fs=require('fs');var Redis=require(_0xc052('0x5'));var db=require(_0xc052('0x6'))['db'];var utils=require(_0xc052('0x7'));var logger=require(_0xc052('0x8'))(_0xc052('0x9'));var config=require(_0xc052('0xa'));var jayson=require(_0xc052('0xb'));var client=jayson[_0xc052('0xc')][_0xc052('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4a06bc,_0x297ca1,_0x172225){return new BPromise(function(_0x4a43aa,_0x3cb71f){return client[_0xc052('0xe')](_0x4a06bc,_0x172225)['then'](function(_0x44d309){logger[_0xc052('0xf')](_0xc052('0x10'),_0x297ca1,_0xc052('0x11'));logger[_0xc052('0x12')](_0xc052('0x13'),_0x297ca1,_0xc052('0x11'),JSON[_0xc052('0x14')](_0x44d309));if(_0x44d309[_0xc052('0x15')]){if(_0x44d309[_0xc052('0x15')][_0xc052('0x16')]===0x1f4){logger['error'](_0xc052('0x10'),_0x297ca1,_0x44d309[_0xc052('0x15')][_0xc052('0x17')]);return _0x3cb71f(_0x44d309['error'][_0xc052('0x17')]);}logger[_0xc052('0x15')]('SugarcrmField,\x20%s,\x20%s',_0x297ca1,_0x44d309['error'][_0xc052('0x17')]);return _0x4a43aa(_0x44d309[_0xc052('0x15')][_0xc052('0x17')]);}else{logger[_0xc052('0xf')](_0xc052('0x10'),_0x297ca1,_0xc052('0x11'));_0x4a43aa(_0x44d309[_0xc052('0x18')]['message']);}})[_0xc052('0x19')](function(_0x163a71){logger[_0xc052('0x15')](_0xc052('0x10'),_0x297ca1,_0x163a71);_0x3cb71f(_0x163a71);});});} \ No newline at end of file +var _0xde97=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xde97,0x156));var _0x7de9=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xde97[_0x2842b4];return _0x2b9521;};'use strict';var _=require(_0x7de9('0x0'));var util=require(_0x7de9('0x1'));var moment=require('moment');var BPromise=require(_0x7de9('0x2'));var rs=require(_0x7de9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7de9('0x4'))['db'];var utils=require(_0x7de9('0x5'));var logger=require(_0x7de9('0x6'))(_0x7de9('0x7'));var config=require(_0x7de9('0x8'));var jayson=require(_0x7de9('0x9'));var client=jayson[_0x7de9('0xa')][_0x7de9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e5bd7,_0x118b7c,_0x149e22){return new BPromise(function(_0x3d3681,_0x3cafd1){return client[_0x7de9('0xc')](_0x2e5bd7,_0x149e22)[_0x7de9('0xd')](function(_0x2b1c12){logger[_0x7de9('0xe')](_0x7de9('0xf'),_0x118b7c,'request\x20sent');logger[_0x7de9('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x118b7c,_0x7de9('0x11'),JSON[_0x7de9('0x12')](_0x2b1c12));if(_0x2b1c12[_0x7de9('0x13')]){if(_0x2b1c12[_0x7de9('0x13')][_0x7de9('0x14')]===0x1f4){logger[_0x7de9('0x13')](_0x7de9('0xf'),_0x118b7c,_0x2b1c12[_0x7de9('0x13')]['message']);return _0x3cafd1(_0x2b1c12[_0x7de9('0x13')][_0x7de9('0x15')]);}logger['error'](_0x7de9('0xf'),_0x118b7c,_0x2b1c12['error'][_0x7de9('0x15')]);return _0x3d3681(_0x2b1c12[_0x7de9('0x13')][_0x7de9('0x15')]);}else{logger[_0x7de9('0xe')](_0x7de9('0xf'),_0x118b7c,_0x7de9('0x11'));_0x3d3681(_0x2b1c12['result']['message']);}})[_0x7de9('0x16')](function(_0x203761){logger[_0x7de9('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x118b7c,_0x203761);_0x3cafd1(_0x203761);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index c92c320..7ecd131 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 _0xbc82=['show','get','/:id/configurations','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','express','../../components/auth/service','./intVtigerAccount.controller','index','isAuthenticated'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbc82,0x13e));var _0x2bc8=function(_0x278726,_0x2d4f1b){_0x278726=_0x278726-0x0;var _0x23e719=_0xbc82[_0x278726];return _0x23e719;};'use strict';var multer=require(_0x2bc8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2bc8('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2bc8('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2bc8('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x2bc8('0x4')]);router['get']('/:id',auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x6')]);router[_0x2bc8('0x7')](_0x2bc8('0x8'),auth[_0x2bc8('0x5')](),controller['getConfigurations']);router[_0x2bc8('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x2bc8('0x9')]('/',auth[_0x2bc8('0x5')](),controller[_0x2bc8('0xa')]);router[_0x2bc8('0x9')](_0x2bc8('0x8'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0xb')]);router[_0x2bc8('0xc')](_0x2bc8('0xd'),auth['isAuthenticated'](),controller[_0x2bc8('0xe')]);router[_0x2bc8('0xf')](_0x2bc8('0xd'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x10')]);module[_0x2bc8('0x11')]=router; \ No newline at end of file +var _0x7aa7=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x556951,_0x52b0bd){var _0x3798aa=function(_0x13df4b){while(--_0x13df4b){_0x556951['push'](_0x556951['shift']());}};_0x3798aa(++_0x52b0bd);}(_0x7aa7,0xfd));var _0x77aa=function(_0x302d68,_0x24089e){_0x302d68=_0x302d68-0x0;var _0xa71fe6=_0x7aa7[_0x302d68];return _0xa71fe6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x77aa('0x0'));var timeout=require(_0x77aa('0x1'));var express=require(_0x77aa('0x2'));var router=express['Router']();var fs_extra=require(_0x77aa('0x3'));var auth=require(_0x77aa('0x4'));var interaction=require(_0x77aa('0x5'));var config=require(_0x77aa('0x6'));var controller=require(_0x77aa('0x7'));router[_0x77aa('0x8')]('/',auth[_0x77aa('0x9')](),controller[_0x77aa('0xa')]);router['get'](_0x77aa('0xb'),auth[_0x77aa('0x9')](),controller[_0x77aa('0xc')]);router[_0x77aa('0x8')](_0x77aa('0xd'),auth[_0x77aa('0x9')](),controller[_0x77aa('0xe')]);router['get'](_0x77aa('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x77aa('0x10')]('/',auth[_0x77aa('0x9')](),controller[_0x77aa('0x11')]);router[_0x77aa('0x10')](_0x77aa('0xd'),auth['isAuthenticated'](),controller[_0x77aa('0x12')]);router[_0x77aa('0x13')](_0x77aa('0xb'),auth[_0x77aa('0x9')](),controller['update']);router[_0x77aa('0x14')](_0x77aa('0xb'),auth[_0x77aa('0x9')](),controller['destroy']);module[_0x77aa('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8e9f249..fb29493 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 _0x956b=['sequelize','STRING','HelpDesk'];(function(_0x489faa,_0x4a22ed){var _0x5babe2=function(_0x2b1529){while(--_0x2b1529){_0x489faa['push'](_0x489faa['shift']());}};_0x5babe2(++_0x4a22ed);}(_0x956b,0xf6));var _0xb956=function(_0x416c50,_0x974ac7){_0x416c50=_0x416c50-0x0;var _0x596d03=_0x956b[_0x416c50];return _0x596d03;};'use strict';var Sequelize=require(_0xb956('0x0'));module['exports']={'name':{'type':Sequelize[_0xb956('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb956('0x1')]},'username':{'type':Sequelize[_0xb956('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb956('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6053=['sequelize','exports','STRING'];(function(_0xff9f9b,_0x569c7b){var _0x498225=function(_0x1bc794){while(--_0x1bc794){_0xff9f9b['push'](_0xff9f9b['shift']());}};_0x498225(++_0x569c7b);}(_0x6053,0x123));var _0x3605=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6053[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3605('0x0'));module[_0x3605('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3605('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3605('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x3605('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3605('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 cb882fe..3398181 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 _0xdd87=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','findOne','VtigerConfiguration','pick','filter','getConfigurations','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','description','accessKey','username','remoteUri','slice','substring','format','GET','getchallenge','POST','login','result','token','success','describe','autogenerated','reference','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end'];(function(_0x5bce18,_0x5b5c5f){var _0x1e5d5a=function(_0x21169a){while(--_0x21169a){_0x5bce18['push'](_0x5bce18['shift']());}};_0x1e5d5a(++_0x5b5c5f);}(_0xdd87,0x158));var _0x7dd8=function(_0x2e5db6,_0x518e24){_0x2e5db6=_0x2e5db6-0x0;var _0x4bbfc0=_0xdd87[_0x2e5db6];return _0x4bbfc0;};'use strict';var emlformat=require(_0x7dd8('0x0'));var rimraf=require(_0x7dd8('0x1'));var zipdir=require(_0x7dd8('0x2'));var jsonpatch=require(_0x7dd8('0x3'));var rp=require(_0x7dd8('0x4'));var moment=require(_0x7dd8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7dd8('0x6'));var path=require(_0x7dd8('0x7'));var sox=require(_0x7dd8('0x8'));var csv=require(_0x7dd8('0x9'));var ejs=require(_0x7dd8('0xa'));var fs=require('fs');var fs_extra=require(_0x7dd8('0xb'));var _=require(_0x7dd8('0xc'));var squel=require(_0x7dd8('0xd'));var crypto=require(_0x7dd8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7dd8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7dd8('0x10'));var Redis=require(_0x7dd8('0x11'));var authService=require(_0x7dd8('0x12'));var qs=require(_0x7dd8('0x13'));var as=require(_0x7dd8('0x14'));var hardwareService=require(_0x7dd8('0x15'));var logger=require(_0x7dd8('0x16'))(_0x7dd8('0x17'));var utils=require(_0x7dd8('0x18'));var config=require(_0x7dd8('0x19'));var licenseUtil=require(_0x7dd8('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7dd8('0x1b'));function respondWithStatusCode(_0x2215ba,_0xffef8){_0xffef8=_0xffef8||0xcc;return function(_0xc769ba){if(_0xc769ba){return _0x2215ba[_0x7dd8('0x1c')](_0xffef8);}return _0x2215ba[_0x7dd8('0x1d')](_0xffef8)[_0x7dd8('0x1e')]();};}function respondWithResult(_0x5ef971,_0x1f96b5){_0x1f96b5=_0x1f96b5||0xc8;return function(_0x4eac05){if(_0x4eac05){return _0x5ef971[_0x7dd8('0x1d')](_0x1f96b5)[_0x7dd8('0x1f')](_0x4eac05);}};}function respondWithFilteredResult(_0xeb7b9f,_0x306ac1){return function(_0x1a89e5){if(_0x1a89e5){var _0xcab331=typeof _0x306ac1[_0x7dd8('0x20')]===_0x7dd8('0x21')&&typeof _0x306ac1[_0x7dd8('0x22')]===_0x7dd8('0x21');var _0x1e984c=_0x1a89e5['count'];var _0x884f51=_0xcab331?0x0:_0x306ac1[_0x7dd8('0x20')];var _0xcf69e9=_0xcab331?_0x1a89e5[_0x7dd8('0x23')]:_0x306ac1[_0x7dd8('0x20')]+_0x306ac1[_0x7dd8('0x22')];var _0x280369;if(_0xcf69e9>=_0x1e984c){_0xcf69e9=_0x1e984c;_0x280369=0xc8;}else{_0x280369=0xce;}_0xeb7b9f[_0x7dd8('0x1d')](_0x280369);return _0xeb7b9f[_0x7dd8('0x24')](_0x7dd8('0x25'),_0x884f51+'-'+_0xcf69e9+'/'+_0x1e984c)[_0x7dd8('0x1f')](_0x1a89e5);}return null;};}function patchUpdates(_0xe597c8){return function(_0x13a9fd){try{jsonpatch[_0x7dd8('0x26')](_0x13a9fd,_0xe597c8,!![]);}catch(_0x31799e){return BPromise[_0x7dd8('0x27')](_0x31799e);}return _0x13a9fd[_0x7dd8('0x28')]();};}function saveUpdates(_0x3dbd74,_0x1b2751){return function(_0x13791b){if(_0x13791b){return _0x13791b[_0x7dd8('0x29')](_0x3dbd74)[_0x7dd8('0x2a')](function(_0x3d17a2){return _0x3d17a2;});}return null;};}function removeEntity(_0x37c62f,_0x21e995){return function(_0x2c0758){if(_0x2c0758){return _0x2c0758['destroy']()[_0x7dd8('0x2a')](function(){_0x37c62f['status'](0xcc)[_0x7dd8('0x1e')]();});}};}function handleEntityNotFound(_0x57babd,_0x4a21f6){return function(_0x1690d2){if(!_0x1690d2){_0x57babd[_0x7dd8('0x1c')](0x194);}return _0x1690d2;};}function handleError(_0x35f763,_0x6c5584){_0x6c5584=_0x6c5584||0x1f4;return function(_0x1670c8){logger[_0x7dd8('0x2b')](_0x1670c8[_0x7dd8('0x2c')]);if(_0x1670c8[_0x7dd8('0x2d')]){delete _0x1670c8[_0x7dd8('0x2d')];}_0x35f763[_0x7dd8('0x1d')](_0x6c5584)[_0x7dd8('0x2e')](_0x1670c8);};}exports[_0x7dd8('0x2f')]=function(_0xe468bf,_0x1252e8){var _0x253846={},_0x4729be={},_0x4fd5d2={'count':0x0,'rows':[]};var _0x2eb8db=_[_0x7dd8('0x30')](db[_0x7dd8('0x31')][_0x7dd8('0x32')],function(_0x722ce3){return{'name':_0x722ce3[_0x7dd8('0x33')],'type':_0x722ce3[_0x7dd8('0x34')]['key']};});_0x4729be[_0x7dd8('0x35')]=_[_0x7dd8('0x30')](_0x2eb8db,_0x7dd8('0x2d'));_0x4729be[_0x7dd8('0x36')]=_[_0x7dd8('0x37')](_0xe468bf['query']);_0x4729be[_0x7dd8('0x38')]=_[_0x7dd8('0x39')](_0x4729be['model'],_0x4729be[_0x7dd8('0x36')]);_0x253846[_0x7dd8('0x3a')]=_[_0x7dd8('0x39')](_0x4729be[_0x7dd8('0x35')],qs[_0x7dd8('0x3b')](_0xe468bf[_0x7dd8('0x36')][_0x7dd8('0x3b')]));_0x253846['attributes']=_0x253846['attributes'][_0x7dd8('0x3c')]?_0x253846[_0x7dd8('0x3a')]:_0x4729be[_0x7dd8('0x35')];if(!_0xe468bf[_0x7dd8('0x36')][_0x7dd8('0x3d')](_0x7dd8('0x3e'))){_0x253846[_0x7dd8('0x22')]=qs['limit'](_0xe468bf[_0x7dd8('0x36')][_0x7dd8('0x22')]);_0x253846[_0x7dd8('0x20')]=qs[_0x7dd8('0x20')](_0xe468bf[_0x7dd8('0x36')][_0x7dd8('0x20')]);}_0x253846[_0x7dd8('0x3f')]=qs[_0x7dd8('0x40')](_0xe468bf[_0x7dd8('0x36')][_0x7dd8('0x40')]);_0x253846[_0x7dd8('0x41')]=qs[_0x7dd8('0x38')](_['pick'](_0xe468bf[_0x7dd8('0x36')],_0x4729be[_0x7dd8('0x38')]),_0x2eb8db);if(_0xe468bf[_0x7dd8('0x36')]['filter']){_0x253846['where']=_[_0x7dd8('0x42')](_0x253846['where'],{'$or':_[_0x7dd8('0x30')](_0x2eb8db,function(_0x306bea){if(_0x306bea[_0x7dd8('0x34')]!==_0x7dd8('0x43')){var _0x7fd2f6={};_0x7fd2f6[_0x306bea[_0x7dd8('0x2d')]]={'$like':'%'+_0xe468bf['query']['filter']+'%'};return _0x7fd2f6;}})});}_0x253846=_[_0x7dd8('0x42')]({},_0x253846,_0xe468bf[_0x7dd8('0x44')]);var _0x41304e={'where':_0x253846[_0x7dd8('0x41')]};return db[_0x7dd8('0x31')][_0x7dd8('0x23')](_0x41304e)[_0x7dd8('0x2a')](function(_0x42b1a7){_0x4fd5d2[_0x7dd8('0x23')]=_0x42b1a7;if(_0xe468bf['query']['includeAll']){_0x253846[_0x7dd8('0x45')]=[{'all':!![]}];}return db['VtigerAccount'][_0x7dd8('0x46')](_0x253846);})[_0x7dd8('0x2a')](function(_0x20c651){_0x4fd5d2[_0x7dd8('0x47')]=_0x20c651;return _0x4fd5d2;})[_0x7dd8('0x2a')](respondWithFilteredResult(_0x1252e8,_0x253846))[_0x7dd8('0x48')](handleError(_0x1252e8,null));};exports[_0x7dd8('0x49')]=function(_0x3f6193,_0x355126){var _0x1260bf={'raw':![],'where':{'id':_0x3f6193[_0x7dd8('0x4a')]['id']}},_0x586844={};_0x586844[_0x7dd8('0x35')]=_[_0x7dd8('0x37')](db['VtigerAccount']['rawAttributes']);_0x586844['query']=_[_0x7dd8('0x37')](_0x3f6193['query']);_0x586844[_0x7dd8('0x38')]=_['intersection'](_0x586844['model'],_0x586844[_0x7dd8('0x36')]);_0x1260bf['attributes']=_[_0x7dd8('0x39')](_0x586844['model'],qs[_0x7dd8('0x3b')](_0x3f6193[_0x7dd8('0x36')][_0x7dd8('0x3b')]));_0x1260bf[_0x7dd8('0x3a')]=_0x1260bf[_0x7dd8('0x3a')]['length']?_0x1260bf[_0x7dd8('0x3a')]:_0x586844[_0x7dd8('0x35')];if(_0x3f6193['query'][_0x7dd8('0x4b')]){_0x1260bf['include']=[{'all':!![]}];}_0x1260bf=_[_0x7dd8('0x42')]({},_0x1260bf,_0x3f6193[_0x7dd8('0x44')]);return db[_0x7dd8('0x31')]['find'](_0x1260bf)[_0x7dd8('0x2a')](handleEntityNotFound(_0x355126,null))[_0x7dd8('0x2a')](respondWithResult(_0x355126,null))[_0x7dd8('0x48')](handleError(_0x355126,null));};exports[_0x7dd8('0x4c')]=function(_0x42642f,_0x4946d9){return db[_0x7dd8('0x31')][_0x7dd8('0x4c')](_0x42642f[_0x7dd8('0x4d')],{})[_0x7dd8('0x2a')](respondWithResult(_0x4946d9,0xc9))[_0x7dd8('0x48')](handleError(_0x4946d9,null));};exports[_0x7dd8('0x29')]=function(_0x56978b,_0x2e3881){if(_0x56978b[_0x7dd8('0x4d')]['id']){delete _0x56978b['body']['id'];}return db['VtigerAccount'][_0x7dd8('0x4e')]({'where':{'id':_0x56978b[_0x7dd8('0x4a')]['id']}})[_0x7dd8('0x2a')](handleEntityNotFound(_0x2e3881,null))[_0x7dd8('0x2a')](saveUpdates(_0x56978b[_0x7dd8('0x4d')],null))[_0x7dd8('0x2a')](respondWithResult(_0x2e3881,null))[_0x7dd8('0x48')](handleError(_0x2e3881,null));};exports[_0x7dd8('0x4f')]=function(_0x86f156,_0x2c3e77){return db[_0x7dd8('0x31')]['find']({'where':{'id':_0x86f156[_0x7dd8('0x4a')]['id']}})[_0x7dd8('0x2a')](handleEntityNotFound(_0x2c3e77,null))['then'](removeEntity(_0x2c3e77,null))[_0x7dd8('0x48')](handleError(_0x2c3e77,null));};exports['getConfigurations']=function(_0x403653,_0x5a75d0,_0x194fcf){var _0x31affd={};var _0x2f51fb={};var _0x383c31;var _0x2bc059;return db['VtigerAccount'][_0x7dd8('0x50')]({'where':{'id':_0x403653[_0x7dd8('0x4a')]['id']}})[_0x7dd8('0x2a')](handleEntityNotFound(_0x5a75d0,null))[_0x7dd8('0x2a')](function(_0x43f83a){if(_0x43f83a){_0x383c31=_0x43f83a;_0x2f51fb[_0x7dd8('0x35')]=_[_0x7dd8('0x37')](db[_0x7dd8('0x51')]['rawAttributes']);_0x2f51fb[_0x7dd8('0x36')]=_['keys'](_0x403653['query']);_0x2f51fb[_0x7dd8('0x38')]=_[_0x7dd8('0x39')](_0x2f51fb['model'],_0x2f51fb['query']);_0x31affd[_0x7dd8('0x3a')]=_[_0x7dd8('0x39')](_0x2f51fb[_0x7dd8('0x35')],qs[_0x7dd8('0x3b')](_0x403653['query'][_0x7dd8('0x3b')]));_0x31affd[_0x7dd8('0x3a')]=_0x31affd[_0x7dd8('0x3a')][_0x7dd8('0x3c')]?_0x31affd['attributes']:_0x2f51fb[_0x7dd8('0x35')];_0x31affd[_0x7dd8('0x3f')]=qs[_0x7dd8('0x40')](_0x403653['query']['sort']);_0x31affd[_0x7dd8('0x41')]=qs[_0x7dd8('0x38')](_[_0x7dd8('0x52')](_0x403653[_0x7dd8('0x36')],_0x2f51fb[_0x7dd8('0x38')]));if(_0x403653[_0x7dd8('0x36')][_0x7dd8('0x53')]){_0x31affd[_0x7dd8('0x41')]=_[_0x7dd8('0x42')](_0x31affd[_0x7dd8('0x41')],{'$or':_[_0x7dd8('0x30')](_0x31affd['attributes'],function(_0x1c1b43){var _0x2cc05f={};_0x2cc05f[_0x1c1b43]={'$like':'%'+_0x403653['query'][_0x7dd8('0x53')]+'%'};return _0x2cc05f;})});}_0x31affd=_['merge']({},_0x31affd,_0x403653[_0x7dd8('0x44')]);return _0x383c31[_0x7dd8('0x54')](_0x31affd);}})[_0x7dd8('0x2a')](function(_0x53f193){if(_0x53f193){_0x2bc059=_0x53f193['length'];if(!_0x403653[_0x7dd8('0x36')][_0x7dd8('0x3d')](_0x7dd8('0x3e'))){_0x31affd['limit']=qs[_0x7dd8('0x22')](_0x403653[_0x7dd8('0x36')]['limit']);_0x31affd[_0x7dd8('0x20')]=qs['offset'](_0x403653[_0x7dd8('0x36')][_0x7dd8('0x20')]);}return _0x383c31[_0x7dd8('0x54')](_0x31affd);}})[_0x7dd8('0x2a')](function(_0x2aefc2){if(_0x2aefc2){return _0x2aefc2?{'count':_0x2bc059,'rows':_0x2aefc2}:null;}})[_0x7dd8('0x2a')](respondWithResult(_0x5a75d0,null))[_0x7dd8('0x48')](handleError(_0x5a75d0,null));};exports['addConfiguration']=function(_0x5f1c37,_0x47a86d,_0x1e1116){if(_0x5f1c37[_0x7dd8('0x4d')]['id']){delete _0x5f1c37[_0x7dd8('0x4d')]['id'];}return db[_0x7dd8('0x31')]['findOne']({'where':{'id':_0x5f1c37[_0x7dd8('0x4a')]['id']}})[_0x7dd8('0x2a')](handleEntityNotFound(_0x47a86d,null))[_0x7dd8('0x2a')](function(_0x5528c4){if(_0x5528c4){_0x5f1c37['body']['AccountId']=_0x5528c4['id'];_0x5f1c37[_0x7dd8('0x4d')][_0x7dd8('0x55')]=integrations[_0x7dd8('0x56')](_0x5f1c37[_0x7dd8('0x4d')]['channel'],_0x5f1c37[_0x7dd8('0x4d')][_0x7dd8('0x34')]);_0x5f1c37[_0x7dd8('0x4d')][_0x7dd8('0x57')]=integrations[_0x7dd8('0x58')](_0x5f1c37[_0x7dd8('0x4d')][_0x7dd8('0x59')],_0x5f1c37[_0x7dd8('0x4d')][_0x7dd8('0x34')]);return db['VtigerConfiguration'][_0x7dd8('0x4c')](_0x5f1c37[_0x7dd8('0x4d')],{'include':[{'model':db[_0x7dd8('0x5a')],'as':'Subjects'},{'model':db[_0x7dd8('0x5a')],'as':_0x7dd8('0x57')}]});}return null;})[_0x7dd8('0x2a')](respondWithResult(_0x47a86d,null))[_0x7dd8('0x48')](handleError(_0x47a86d,null));};var md5=require(_0x7dd8('0x5b'));exports[_0x7dd8('0x5c')]=function(_0x4d84d4,_0x421278,_0x32cfae){var _0x2d463a=null;var _0x153873=null;var _0x483e08=null;var _0x167a25=null;var _0x134e1f='';return db[_0x7dd8('0x31')]['findOne']({'where':{'id':_0x4d84d4[_0x7dd8('0x4a')]['id']},'attributes':['id',_0x7dd8('0x2d'),'username',_0x7dd8('0x5d'),'moduleName','remoteUri','serverUrl',_0x7dd8('0x5e')]})[_0x7dd8('0x2a')](handleEntityNotFound(_0x421278,null))[_0x7dd8('0x2a')](function(_0x3f3ad6){if(_0x3f3ad6){_0x2d463a=_0x3f3ad6[_0x7dd8('0x5f')];_0x153873=_0x3f3ad6[_0x7dd8('0x5e')];_0x483e08=_0x3f3ad6['moduleName'];_0x134e1f=_0x3f3ad6[_0x7dd8('0x60')];var _0x6fbb18=_0x134e1f[_0x7dd8('0x61')](-0x1);if(_0x6fbb18==='/'){_0x134e1f=_0x134e1f[_0x7dd8('0x62')](0x0,_0x134e1f['lastIndexOf'](_0x6fbb18));}_0x167a25=util[_0x7dd8('0x63')]('%s/webservice.php',_0x134e1f);var _0x5b6807={'method':_0x7dd8('0x64'),'uri':_0x167a25,'qs':{'operation':_0x7dd8('0x65'),'username':_0x3f3ad6[_0x7dd8('0x5f')]},'json':!![]};return rp(_0x5b6807);}})[_0x7dd8('0x2a')](function(_0xd02e24){if(_0xd02e24['success']){var _0x180ce4={'method':_0x7dd8('0x66'),'uri':_0x167a25,'form':{'operation':_0x7dd8('0x67'),'username':_0x2d463a,'accessKey':md5(_0xd02e24[_0x7dd8('0x68')][_0x7dd8('0x69')]+_0x153873)},'json':!![]};return rp(_0x180ce4);}})['then'](function(_0x323ebe){if(_0x323ebe[_0x7dd8('0x6a')]){var _0x10782d={'method':_0x7dd8('0x64'),'uri':_0x167a25,'qs':{'operation':_0x7dd8('0x6b'),'username':_0x2d463a,'sessionName':_0x323ebe[_0x7dd8('0x68')]['sessionName'],'elementType':_0x483e08},'json':!![]};return rp(_0x10782d);}})[_0x7dd8('0x2a')](function(_0x26be52){if(_0x26be52[_0x7dd8('0x6a')]){var _0x34822f=[_0x7dd8('0x6c'),_0x7dd8('0x6d'),'owner'];_[_0x7dd8('0x6e')](_0x26be52[_0x7dd8('0x68')]['fields'],function(_0x23ea19){return _0x34822f[_0x7dd8('0x6f')](_0x23ea19['type'][_0x7dd8('0x2d')]);});_[_0x7dd8('0x6e')](_0x26be52[_0x7dd8('0x68')][_0x7dd8('0x3b')],function(_0x168d2e){return _0x168d2e['editable']===_0x7dd8('0x70');});return{'count':_0x26be52[_0x7dd8('0x68')]['fields'][_0x7dd8('0x3c')],'rows':_[_0x7dd8('0x30')](_0x26be52[_0x7dd8('0x68')][_0x7dd8('0x3b')],function(_0x411cc8){return{'id':_0x411cc8[_0x7dd8('0x2d')],'name':_0x411cc8[_0x7dd8('0x71')],'custom':_[_0x7dd8('0x72')](_0x411cc8[_0x7dd8('0x2d')],_0x7dd8('0x73'))?!![]:![],'options':_0x411cc8['type'][_0x7dd8('0x2d')]===_0x7dd8('0x74')&&_0x411cc8[_0x7dd8('0x34')][_0x7dd8('0x75')][_0x7dd8('0x3c')]>0x0?_[_0x7dd8('0x30')](_0x411cc8[_0x7dd8('0x34')][_0x7dd8('0x75')],function(_0x2d31aa){return{'name':_0x2d31aa[_0x7dd8('0x71')],'value':_0x2d31aa[_0x7dd8('0x76')]};}):[]};})};}})[_0x7dd8('0x2a')](respondWithResult(_0x421278,null))[_0x7dd8('0x48')](function(_0x597a39){console[_0x7dd8('0x77')](_0x7dd8('0x78')+_0x597a39);var _0x522283=_0x4d84d4['query']['test']?0x1f4:_0x597a39[_0x7dd8('0x79')]||0x1f4;logger[_0x7dd8('0x2b')](_0x7dd8('0x7a'),_0x7dd8('0x5c'),_0x522283,JSON[_0x7dd8('0x7b')](_0x597a39));delete _0x597a39[_0x7dd8('0x2d')];if(_0x522283===0x191){_0x522283=0x190;}_0x421278[_0x7dd8('0x1d')](_0x522283)[_0x7dd8('0x2e')](_0x4d84d4['query'][_0x7dd8('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x597a39[_0x7dd8('0x79')]}:_0x597a39);});}; \ No newline at end of file +var _0x927d=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','offset','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','filters','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','GET','success','POST','sessionName','autogenerated','reference','owner','remove','result','includes','editable','false','label','cf_','picklistValues','vTiger\x20error:\x20','test','stringify','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3f8e8e,_0x44b308){var _0x16d1bc=function(_0x3ed102){while(--_0x3ed102){_0x3f8e8e['push'](_0x3f8e8e['shift']());}};_0x16d1bc(++_0x44b308);}(_0x927d,0xd0));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd927('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd927('0x1'));var rp=require(_0xd927('0x2'));var moment=require(_0xd927('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd927('0x4'));var util=require(_0xd927('0x5'));var path=require('path');var sox=require(_0xd927('0x6'));var csv=require(_0xd927('0x7'));var ejs=require(_0xd927('0x8'));var fs=require('fs');var fs_extra=require(_0xd927('0x9'));var _=require(_0xd927('0xa'));var squel=require(_0xd927('0xb'));var crypto=require('crypto');var jsforce=require(_0xd927('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd927('0x7'));var querystring=require('querystring');var Papa=require(_0xd927('0xd'));var Redis=require(_0xd927('0xe'));var authService=require(_0xd927('0xf'));var qs=require(_0xd927('0x10'));var as=require(_0xd927('0x11'));var hardwareService=require(_0xd927('0x12'));var logger=require(_0xd927('0x13'))(_0xd927('0x14'));var utils=require('../../config/utils');var config=require(_0xd927('0x15'));var licenseUtil=require(_0xd927('0x16'));var db=require(_0xd927('0x17'))['db'];var integrations=require(_0xd927('0x18'));function respondWithStatusCode(_0x30128d,_0xcb9c7f){_0xcb9c7f=_0xcb9c7f||0xcc;return function(_0x4bd026){if(_0x4bd026){return _0x30128d['sendStatus'](_0xcb9c7f);}return _0x30128d[_0xd927('0x19')](_0xcb9c7f)[_0xd927('0x1a')]();};}function respondWithResult(_0x409503,_0x3fa43f){_0x3fa43f=_0x3fa43f||0xc8;return function(_0x39527b){if(_0x39527b){return _0x409503[_0xd927('0x19')](_0x3fa43f)[_0xd927('0x1b')](_0x39527b);}};}function respondWithFilteredResult(_0x28b71e,_0x174aff){return function(_0x2d64d1){if(_0x2d64d1){var _0x5a7b40=typeof _0x174aff['offset']===_0xd927('0x1c')&&typeof _0x174aff['limit']==='undefined';var _0x313e0f=_0x2d64d1['count'];var _0x3f279c=_0x5a7b40?0x0:_0x174aff[_0xd927('0x1d')];var _0x2a0782=_0x5a7b40?_0x2d64d1[_0xd927('0x1e')]:_0x174aff[_0xd927('0x1d')]+_0x174aff[_0xd927('0x1f')];var _0x4ffee1;if(_0x2a0782>=_0x313e0f){_0x2a0782=_0x313e0f;_0x4ffee1=0xc8;}else{_0x4ffee1=0xce;}_0x28b71e[_0xd927('0x19')](_0x4ffee1);return _0x28b71e['set'](_0xd927('0x20'),_0x3f279c+'-'+_0x2a0782+'/'+_0x313e0f)[_0xd927('0x1b')](_0x2d64d1);}return null;};}function patchUpdates(_0x1f5b0d){return function(_0xd033f6){try{jsonpatch[_0xd927('0x21')](_0xd033f6,_0x1f5b0d,!![]);}catch(_0x329f08){return BPromise['reject'](_0x329f08);}return _0xd033f6[_0xd927('0x22')]();};}function saveUpdates(_0x44226a,_0x4f772a){return function(_0xf6cc6){if(_0xf6cc6){return _0xf6cc6[_0xd927('0x23')](_0x44226a)[_0xd927('0x24')](function(_0x3f09da){return _0x3f09da;});}return null;};}function removeEntity(_0x2cdeb7,_0x4592ab){return function(_0x429c6e){if(_0x429c6e){return _0x429c6e[_0xd927('0x25')]()[_0xd927('0x24')](function(){_0x2cdeb7['status'](0xcc)[_0xd927('0x1a')]();});}};}function handleEntityNotFound(_0x3e8c58,_0x59b82a){return function(_0xe7ae5c){if(!_0xe7ae5c){_0x3e8c58[_0xd927('0x26')](0x194);}return _0xe7ae5c;};}function handleError(_0x2c4f9b,_0x2a8156){_0x2a8156=_0x2a8156||0x1f4;return function(_0x5d403a){logger[_0xd927('0x27')](_0x5d403a[_0xd927('0x28')]);if(_0x5d403a[_0xd927('0x29')]){delete _0x5d403a[_0xd927('0x29')];}_0x2c4f9b['status'](_0x2a8156)[_0xd927('0x2a')](_0x5d403a);};}exports[_0xd927('0x2b')]=function(_0x1256ff,_0x5e88a0){var _0x45a2a2={},_0x285a18={},_0x4c5fa8={'count':0x0,'rows':[]};var _0x2311fd=_[_0xd927('0x2c')](db[_0xd927('0x2d')][_0xd927('0x2e')],function(_0x1639a4){return{'name':_0x1639a4[_0xd927('0x2f')],'type':_0x1639a4[_0xd927('0x30')][_0xd927('0x31')]};});_0x285a18[_0xd927('0x32')]=_['map'](_0x2311fd,_0xd927('0x29'));_0x285a18[_0xd927('0x33')]=_[_0xd927('0x34')](_0x1256ff[_0xd927('0x33')]);_0x285a18['filters']=_[_0xd927('0x35')](_0x285a18[_0xd927('0x32')],_0x285a18[_0xd927('0x33')]);_0x45a2a2['attributes']=_[_0xd927('0x35')](_0x285a18[_0xd927('0x32')],qs[_0xd927('0x36')](_0x1256ff[_0xd927('0x33')]['fields']));_0x45a2a2[_0xd927('0x37')]=_0x45a2a2[_0xd927('0x37')][_0xd927('0x38')]?_0x45a2a2[_0xd927('0x37')]:_0x285a18[_0xd927('0x32')];if(!_0x1256ff[_0xd927('0x33')][_0xd927('0x39')](_0xd927('0x3a'))){_0x45a2a2[_0xd927('0x1f')]=qs[_0xd927('0x1f')](_0x1256ff[_0xd927('0x33')][_0xd927('0x1f')]);_0x45a2a2[_0xd927('0x1d')]=qs['offset'](_0x1256ff[_0xd927('0x33')][_0xd927('0x1d')]);}_0x45a2a2['order']=qs[_0xd927('0x3b')](_0x1256ff[_0xd927('0x33')][_0xd927('0x3b')]);_0x45a2a2[_0xd927('0x3c')]=qs['filters'](_[_0xd927('0x3d')](_0x1256ff[_0xd927('0x33')],_0x285a18['filters']),_0x2311fd);if(_0x1256ff[_0xd927('0x33')][_0xd927('0x3e')]){_0x45a2a2['where']=_[_0xd927('0x3f')](_0x45a2a2[_0xd927('0x3c')],{'$or':_['map'](_0x2311fd,function(_0x4f7aa8){if(_0x4f7aa8['type']!=='VIRTUAL'){var _0x151596={};_0x151596[_0x4f7aa8['name']]={'$like':'%'+_0x1256ff['query']['filter']+'%'};return _0x151596;}})});}_0x45a2a2=_[_0xd927('0x3f')]({},_0x45a2a2,_0x1256ff['options']);var _0x465122={'where':_0x45a2a2[_0xd927('0x3c')]};return db['VtigerAccount'][_0xd927('0x1e')](_0x465122)[_0xd927('0x24')](function(_0x4e0933){_0x4c5fa8[_0xd927('0x1e')]=_0x4e0933;if(_0x1256ff[_0xd927('0x33')][_0xd927('0x40')]){_0x45a2a2[_0xd927('0x41')]=[{'all':!![]}];}return db[_0xd927('0x2d')]['findAll'](_0x45a2a2);})['then'](function(_0xd8aa0f){_0x4c5fa8[_0xd927('0x42')]=_0xd8aa0f;return _0x4c5fa8;})[_0xd927('0x24')](respondWithFilteredResult(_0x5e88a0,_0x45a2a2))[_0xd927('0x43')](handleError(_0x5e88a0,null));};exports[_0xd927('0x44')]=function(_0x42b273,_0x2e0185){var _0x7fcc40={'raw':![],'where':{'id':_0x42b273[_0xd927('0x45')]['id']}},_0x2a624a={};_0x2a624a[_0xd927('0x32')]=_['keys'](db[_0xd927('0x2d')][_0xd927('0x2e')]);_0x2a624a[_0xd927('0x33')]=_[_0xd927('0x34')](_0x42b273[_0xd927('0x33')]);_0x2a624a[_0xd927('0x46')]=_['intersection'](_0x2a624a[_0xd927('0x32')],_0x2a624a[_0xd927('0x33')]);_0x7fcc40[_0xd927('0x37')]=_['intersection'](_0x2a624a[_0xd927('0x32')],qs[_0xd927('0x36')](_0x42b273[_0xd927('0x33')][_0xd927('0x36')]));_0x7fcc40['attributes']=_0x7fcc40[_0xd927('0x37')][_0xd927('0x38')]?_0x7fcc40[_0xd927('0x37')]:_0x2a624a[_0xd927('0x32')];if(_0x42b273[_0xd927('0x33')][_0xd927('0x40')]){_0x7fcc40[_0xd927('0x41')]=[{'all':!![]}];}_0x7fcc40=_['merge']({},_0x7fcc40,_0x42b273[_0xd927('0x47')]);return db['VtigerAccount'][_0xd927('0x48')](_0x7fcc40)['then'](handleEntityNotFound(_0x2e0185,null))[_0xd927('0x24')](respondWithResult(_0x2e0185,null))['catch'](handleError(_0x2e0185,null));};exports[_0xd927('0x49')]=function(_0x5dd1b5,_0x9c7217){return db['VtigerAccount'][_0xd927('0x49')](_0x5dd1b5[_0xd927('0x4a')],{})[_0xd927('0x24')](respondWithResult(_0x9c7217,0xc9))[_0xd927('0x43')](handleError(_0x9c7217,null));};exports[_0xd927('0x23')]=function(_0x5df4aa,_0x35ebf1){if(_0x5df4aa[_0xd927('0x4a')]['id']){delete _0x5df4aa['body']['id'];}return db['VtigerAccount'][_0xd927('0x48')]({'where':{'id':_0x5df4aa[_0xd927('0x45')]['id']}})[_0xd927('0x24')](handleEntityNotFound(_0x35ebf1,null))[_0xd927('0x24')](saveUpdates(_0x5df4aa[_0xd927('0x4a')],null))[_0xd927('0x24')](respondWithResult(_0x35ebf1,null))[_0xd927('0x43')](handleError(_0x35ebf1,null));};exports[_0xd927('0x25')]=function(_0x389976,_0x31f3a4){return db['VtigerAccount']['find']({'where':{'id':_0x389976['params']['id']}})[_0xd927('0x24')](handleEntityNotFound(_0x31f3a4,null))[_0xd927('0x24')](removeEntity(_0x31f3a4,null))[_0xd927('0x43')](handleError(_0x31f3a4,null));};exports[_0xd927('0x4b')]=function(_0x4adde2,_0x3d222a,_0x2b41ca){var _0x26a852={};var _0x4303c3={};var _0x27613a;var _0x3c4bcb;return db[_0xd927('0x2d')][_0xd927('0x4c')]({'where':{'id':_0x4adde2[_0xd927('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d222a,null))[_0xd927('0x24')](function(_0x1ac8f1){if(_0x1ac8f1){_0x27613a=_0x1ac8f1;_0x4303c3['model']=_['keys'](db[_0xd927('0x4d')][_0xd927('0x2e')]);_0x4303c3['query']=_[_0xd927('0x34')](_0x4adde2[_0xd927('0x33')]);_0x4303c3[_0xd927('0x46')]=_['intersection'](_0x4303c3['model'],_0x4303c3[_0xd927('0x33')]);_0x26a852['attributes']=_[_0xd927('0x35')](_0x4303c3[_0xd927('0x32')],qs[_0xd927('0x36')](_0x4adde2[_0xd927('0x33')]['fields']));_0x26a852['attributes']=_0x26a852[_0xd927('0x37')][_0xd927('0x38')]?_0x26a852[_0xd927('0x37')]:_0x4303c3[_0xd927('0x32')];_0x26a852[_0xd927('0x4e')]=qs[_0xd927('0x3b')](_0x4adde2[_0xd927('0x33')][_0xd927('0x3b')]);_0x26a852[_0xd927('0x3c')]=qs['filters'](_['pick'](_0x4adde2[_0xd927('0x33')],_0x4303c3[_0xd927('0x46')]));if(_0x4adde2[_0xd927('0x33')]['filter']){_0x26a852['where']=_['merge'](_0x26a852['where'],{'$or':_[_0xd927('0x2c')](_0x26a852[_0xd927('0x37')],function(_0x467a25){var _0x7c73b8={};_0x7c73b8[_0x467a25]={'$like':'%'+_0x4adde2[_0xd927('0x33')]['filter']+'%'};return _0x7c73b8;})});}_0x26a852=_['merge']({},_0x26a852,_0x4adde2[_0xd927('0x47')]);return _0x27613a[_0xd927('0x4b')](_0x26a852);}})[_0xd927('0x24')](function(_0x4be204){if(_0x4be204){_0x3c4bcb=_0x4be204[_0xd927('0x38')];if(!_0x4adde2[_0xd927('0x33')]['hasOwnProperty'](_0xd927('0x3a'))){_0x26a852['limit']=qs[_0xd927('0x1f')](_0x4adde2[_0xd927('0x33')][_0xd927('0x1f')]);_0x26a852[_0xd927('0x1d')]=qs[_0xd927('0x1d')](_0x4adde2[_0xd927('0x33')][_0xd927('0x1d')]);}return _0x27613a[_0xd927('0x4b')](_0x26a852);}})[_0xd927('0x24')](function(_0x46a053){if(_0x46a053){return _0x46a053?{'count':_0x3c4bcb,'rows':_0x46a053}:null;}})[_0xd927('0x24')](respondWithResult(_0x3d222a,null))[_0xd927('0x43')](handleError(_0x3d222a,null));};exports[_0xd927('0x4f')]=function(_0x371d67,_0x4d1382,_0x100316){if(_0x371d67['body']['id']){delete _0x371d67[_0xd927('0x4a')]['id'];}return db['VtigerAccount'][_0xd927('0x4c')]({'where':{'id':_0x371d67[_0xd927('0x45')]['id']}})[_0xd927('0x24')](handleEntityNotFound(_0x4d1382,null))['then'](function(_0x52200f){if(_0x52200f){_0x371d67[_0xd927('0x4a')][_0xd927('0x50')]=_0x52200f['id'];_0x371d67[_0xd927('0x4a')][_0xd927('0x51')]=integrations['getSubjects'](_0x371d67['body']['channel'],_0x371d67[_0xd927('0x4a')][_0xd927('0x30')]);_0x371d67['body'][_0xd927('0x52')]=integrations[_0xd927('0x53')](_0x371d67[_0xd927('0x4a')][_0xd927('0x54')],_0x371d67[_0xd927('0x4a')][_0xd927('0x30')]);return db[_0xd927('0x4d')][_0xd927('0x49')](_0x371d67['body'],{'include':[{'model':db['VtigerField'],'as':_0xd927('0x51')},{'model':db[_0xd927('0x55')],'as':_0xd927('0x52')}]});}return null;})[_0xd927('0x24')](respondWithResult(_0x4d1382,null))[_0xd927('0x43')](handleError(_0x4d1382,null));};var md5=require('md5');exports[_0xd927('0x56')]=function(_0x138750,_0x258728,_0x5051d2){var _0x10672c=null;var _0x1d433f=null;var _0x5578fa=null;var _0x42ccd9=null;var _0x3179b9='';return db[_0xd927('0x2d')][_0xd927('0x4c')]({'where':{'id':_0x138750[_0xd927('0x45')]['id']},'attributes':['id','name',_0xd927('0x57'),_0xd927('0x58'),_0xd927('0x59'),_0xd927('0x5a'),_0xd927('0x5b'),_0xd927('0x5c')]})['then'](handleEntityNotFound(_0x258728,null))[_0xd927('0x24')](function(_0x18bcc6){if(_0x18bcc6){_0x10672c=_0x18bcc6[_0xd927('0x57')];_0x1d433f=_0x18bcc6['accessKey'];_0x5578fa=_0x18bcc6[_0xd927('0x59')];_0x3179b9=_0x18bcc6[_0xd927('0x5a')];var _0x36b9c0=_0x3179b9['slice'](-0x1);if(_0x36b9c0==='/'){_0x3179b9=_0x3179b9[_0xd927('0x5d')](0x0,_0x3179b9[_0xd927('0x5e')](_0x36b9c0));}_0x42ccd9=util['format']('%s/webservice.php',_0x3179b9);var _0x205fd8={'method':_0xd927('0x5f'),'uri':_0x42ccd9,'qs':{'operation':'getchallenge','username':_0x18bcc6[_0xd927('0x57')]},'json':!![]};return rp(_0x205fd8);}})[_0xd927('0x24')](function(_0x32b5bd){if(_0x32b5bd[_0xd927('0x60')]){var _0x3987a2={'method':_0xd927('0x61'),'uri':_0x42ccd9,'form':{'operation':'login','username':_0x10672c,'accessKey':md5(_0x32b5bd['result']['token']+_0x1d433f)},'json':!![]};return rp(_0x3987a2);}})[_0xd927('0x24')](function(_0x3f0bb3){if(_0x3f0bb3['success']){var _0x550d6f={'method':_0xd927('0x5f'),'uri':_0x42ccd9,'qs':{'operation':'describe','username':_0x10672c,'sessionName':_0x3f0bb3['result'][_0xd927('0x62')],'elementType':_0x5578fa},'json':!![]};return rp(_0x550d6f);}})[_0xd927('0x24')](function(_0x3c1aaa){if(_0x3c1aaa[_0xd927('0x60')]){var _0x325da0=[_0xd927('0x63'),_0xd927('0x64'),_0xd927('0x65')];_[_0xd927('0x66')](_0x3c1aaa[_0xd927('0x67')][_0xd927('0x36')],function(_0x5b7039){return _0x325da0[_0xd927('0x68')](_0x5b7039[_0xd927('0x30')]['name']);});_[_0xd927('0x66')](_0x3c1aaa[_0xd927('0x67')][_0xd927('0x36')],function(_0x3957b7){return _0x3957b7[_0xd927('0x69')]===_0xd927('0x6a');});return{'count':_0x3c1aaa[_0xd927('0x67')]['fields'][_0xd927('0x38')],'rows':_[_0xd927('0x2c')](_0x3c1aaa[_0xd927('0x67')][_0xd927('0x36')],function(_0x351c54){return{'id':_0x351c54[_0xd927('0x29')],'name':_0x351c54[_0xd927('0x6b')],'custom':_['startsWith'](_0x351c54['name'],_0xd927('0x6c'))?!![]:![],'options':_0x351c54[_0xd927('0x30')]['name']==='picklist'&&_0x351c54[_0xd927('0x30')][_0xd927('0x6d')][_0xd927('0x38')]>0x0?_[_0xd927('0x2c')](_0x351c54[_0xd927('0x30')][_0xd927('0x6d')],function(_0x5e385e){return{'name':_0x5e385e['label'],'value':_0x5e385e['value']};}):[]};})};}})[_0xd927('0x24')](respondWithResult(_0x258728,null))[_0xd927('0x43')](function(_0x51efdd){console['log'](_0xd927('0x6e')+_0x51efdd);var _0x2b1fe3=_0x138750[_0xd927('0x33')][_0xd927('0x6f')]?0x1f4:_0x51efdd['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xd927('0x56'),_0x2b1fe3,JSON[_0xd927('0x70')](_0x51efdd));delete _0x51efdd[_0xd927('0x29')];if(_0x2b1fe3===0x191){_0x2b1fe3=0x190;}_0x258728[_0xd927('0x19')](_0x2b1fe3)[_0xd927('0x2a')](_0x138750[_0xd927('0x33')][_0xd927('0x6f')]?{'message':_0xd927('0x71'),'statusCode':_0x51efdd[_0xd927('0x72')]}:_0x51efdd);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index cc07266..eeefb0a 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 _0xf97b=['moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash','../../config/logger','api'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xf97b,0x97));var _0xbf97=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf97b[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xbf97('0x0'));var util=require('util');var logger=require(_0xbf97('0x1'))(_0xbf97('0x2'));var moment=require(_0xbf97('0x3'));var BPromise=require(_0xbf97('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf97('0x5'));var rimraf=require('rimraf');var config=require(_0xbf97('0x6'));var attributes=require(_0xbf97('0x7'));var integrations=require(_0xbf97('0x8'));module['exports']=function(_0x3ae9da,_0x291f8e){return _0x3ae9da[_0xbf97('0x9')]('VtigerAccount',attributes,{'tableName':_0xbf97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82f8=['./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x82f8,0x157));var _0x882f=function(_0x21135a,_0x17a76a){_0x21135a=_0x21135a-0x0;var _0x3fd26f=_0x82f8[_0x21135a];return _0x3fd26f;};'use strict';var _=require('lodash');var util=require(_0x882f('0x0'));var logger=require(_0x882f('0x1'))('api');var moment=require(_0x882f('0x2'));var BPromise=require(_0x882f('0x3'));var rp=require(_0x882f('0x4'));var fs=require('fs');var path=require(_0x882f('0x5'));var rimraf=require(_0x882f('0x6'));var config=require(_0x882f('0x7'));var attributes=require(_0x882f('0x8'));var integrations=require(_0x882f('0x9'));module['exports']=function(_0x57fc29,_0x3c414d){return _0x57fc29[_0x882f('0xa')](_0x882f('0xb'),attributes,{'tableName':_0x882f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 14d44eb..4e0efa4 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 _0xbfcc=['findAll','options','raw','where','attributes','limit','map','model','include','then','GetVtigerAccount','catch','ShowVtigerAccount','VtigerAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xbfcc[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});}exports['GetVtigerAccount']=function(_0x5b078f){var _0x33f731=this;return new Promise(function(_0x99b59d,_0x344510){return db['VtigerAccount'][_0xcbfc('0x12')]({'raw':_0x5b078f['options']?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![],'where':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x15')]||null:null,'attributes':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f['options'][_0xcbfc('0x16')]||null:null,'limit':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f['options'][_0xcbfc('0x17')]||null:null,'include':_0x5b078f['options']?_0x5b078f['options']['include']?_[_0xcbfc('0x18')](_0x5b078f['options']['include'],function(_0x1b3e42){return{'model':db[_0x1b3e42[_0xcbfc('0x19')]],'as':_0x1b3e42['as'],'attributes':_0x1b3e42[_0xcbfc('0x16')],'include':_0x1b3e42[_0xcbfc('0x1a')]?_['map'](_0x1b3e42[_0xcbfc('0x1a')],function(_0x51284a){return{'model':db[_0x51284a[_0xcbfc('0x19')]],'as':_0x51284a['as'],'attributes':_0x51284a[_0xcbfc('0x16')],'include':_0x51284a['include']?_[_0xcbfc('0x18')](_0x51284a[_0xcbfc('0x1a')],function(_0x4ab48e){return{'model':db[_0x4ab48e[_0xcbfc('0x19')]],'as':_0x4ab48e['as'],'attributes':_0x4ab48e[_0xcbfc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcbfc('0x1b')](function(_0x41f3b8){logger['info'](_0xcbfc('0x1c'),_0x5b078f);logger[_0xcbfc('0xb')]('GetVtigerAccount',_0x5b078f,JSON[_0xcbfc('0xd')](_0x41f3b8));_0x99b59d(_0x41f3b8);})[_0xcbfc('0x1d')](function(_0x7cbdfa){logger[_0xcbfc('0xe')](_0xcbfc('0x1c'),_0x7cbdfa[_0xcbfc('0x10')],_0x5b078f);_0x344510(_0x33f731[_0xcbfc('0xe')](0x1f4,_0x7cbdfa['message']));});});};exports[_0xcbfc('0x1e')]=function(_0x433300){var _0x3f9d20=this;return new Promise(function(_0x20a378,_0x500a0b){return db[_0xcbfc('0x1f')][_0xcbfc('0x20')]({'raw':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![],'where':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')]['where']||null:null,'attributes':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')]['attributes']||null:null,'include':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')][_0xcbfc('0x1a')]?_['map'](_0x433300['options']['include'],function(_0x3c6d04){return{'model':db[_0x3c6d04[_0xcbfc('0x19')]],'as':_0x3c6d04['as'],'attributes':_0x3c6d04[_0xcbfc('0x16')],'include':_0x3c6d04[_0xcbfc('0x1a')]?_[_0xcbfc('0x18')](_0x3c6d04[_0xcbfc('0x1a')],function(_0x856e83){return{'model':db[_0x856e83[_0xcbfc('0x19')]],'as':_0x856e83['as'],'attributes':_0x856e83['attributes'],'include':_0x856e83[_0xcbfc('0x1a')]?_[_0xcbfc('0x18')](_0x856e83['include'],function(_0x3093b5){return{'model':db[_0x3093b5['model']],'as':_0x3093b5['as'],'attributes':_0x3093b5[_0xcbfc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcbfc('0x1b')](function(_0x43121e){logger['info'](_0xcbfc('0x1e'),_0x433300);logger['debug']('ShowVtigerAccount',_0x433300,JSON[_0xcbfc('0xd')](_0x43121e));_0x20a378(_0x43121e);})[_0xcbfc('0x1d')](function(_0x382d8b){logger[_0xcbfc('0xe')](_0xcbfc('0x1e'),_0x382d8b[_0xcbfc('0x10')],_0x433300);_0x500a0b(_0x3f9d20[_0xcbfc('0xe')](0x1f4,_0x382d8b[_0xcbfc('0x10')]));});});}; \ No newline at end of file +var _0x9354=['catch','GetVtigerAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowVtigerAccount','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x1a356e,_0xcd8cbb){var _0x22a8bb=function(_0x116e04){while(--_0x116e04){_0x1a356e['push'](_0x1a356e['shift']());}};_0x22a8bb(++_0xcd8cbb);}(_0x9354,0x96));var _0x4935=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0x9354[_0x3e8930];return _0x15b38f;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});}exports[_0x4935('0x15')]=function(_0x429ef3){var _0x4ebc63=this;return new Promise(function(_0xd70eff,_0x145277){return db['VtigerAccount'][_0x4935('0x16')]({'raw':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x18')]||null:null,'attributes':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x19')]||null:null,'limit':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x1a')]||null:null,'include':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')],function(_0x53530f){return{'model':db[_0x53530f['model']],'as':_0x53530f['as'],'attributes':_0x53530f[_0x4935('0x19')],'include':_0x53530f[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x53530f[_0x4935('0x1b')],function(_0x344e51){return{'model':db[_0x344e51[_0x4935('0x1d')]],'as':_0x344e51['as'],'attributes':_0x344e51[_0x4935('0x19')],'include':_0x344e51[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x344e51[_0x4935('0x1b')],function(_0x1d08b5){return{'model':db[_0x1d08b5[_0x4935('0x1d')]],'as':_0x1d08b5['as'],'attributes':_0x1d08b5[_0x4935('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x359522){logger['info']('GetVtigerAccount',_0x429ef3);logger['debug'](_0x4935('0x15'),_0x429ef3,JSON[_0x4935('0x1f')](_0x359522));_0xd70eff(_0x359522);})['catch'](function(_0x3f0707){logger[_0x4935('0x11')](_0x4935('0x15'),_0x3f0707[_0x4935('0x12')],_0x429ef3);_0x145277(_0x4ebc63[_0x4935('0x11')](0x1f4,_0x3f0707[_0x4935('0x12')]));});});};exports[_0x4935('0x20')]=function(_0x2fe6da){var _0x5b3c8e=this;return new Promise(function(_0xb7fe2a,_0x2dcb0b){return db['VtigerAccount']['find']({'raw':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da['options'][_0x4935('0x21')]===undefined?!![]:![]:!![],'where':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da[_0x4935('0x17')]['where']||null:null,'attributes':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x19')]||null:null,'include':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')],function(_0x4a69bc){return{'model':db[_0x4a69bc['model']],'as':_0x4a69bc['as'],'attributes':_0x4a69bc[_0x4935('0x19')],'include':_0x4a69bc[_0x4935('0x1b')]?_['map'](_0x4a69bc['include'],function(_0xb3d934){return{'model':db[_0xb3d934['model']],'as':_0xb3d934['as'],'attributes':_0xb3d934[_0x4935('0x19')],'include':_0xb3d934[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0xb3d934[_0x4935('0x1b')],function(_0x1d77b8){return{'model':db[_0x1d77b8[_0x4935('0x1d')]],'as':_0x1d77b8['as'],'attributes':_0x1d77b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x51b7ac){logger[_0x4935('0xc')]('ShowVtigerAccount',_0x2fe6da);logger[_0x4935('0xf')]('ShowVtigerAccount',_0x2fe6da,JSON[_0x4935('0x1f')](_0x51b7ac));_0xb7fe2a(_0x51b7ac);})[_0x4935('0x14')](function(_0x352679){logger[_0x4935('0x11')](_0x4935('0x20'),_0x352679[_0x4935('0x12')],_0x2fe6da);_0x2dcb0b(_0x5b3c8e[_0x4935('0x11')](0x1f4,_0x352679['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 57dae0d..3f20e77 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 _0xb9c8=['/:id','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','create','update','delete'];(function(_0x5462bd,_0x1a35d5){var _0x12f41e=function(_0x44753c){while(--_0x44753c){_0x5462bd['push'](_0x5462bd['shift']());}};_0x12f41e(++_0x1a35d5);}(_0xb9c8,0x81));var _0x8b9c=function(_0x598b78,_0xf4ee7e){_0x598b78=_0x598b78-0x0;var _0x6392fa=_0xb9c8[_0x598b78];return _0x6392fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b9c('0x0'));var timeout=require(_0x8b9c('0x1'));var express=require(_0x8b9c('0x2'));var router=express['Router']();var fs_extra=require(_0x8b9c('0x3'));var auth=require(_0x8b9c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8b9c('0x5'));var controller=require(_0x8b9c('0x6'));router[_0x8b9c('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b9c('0x8')]);router['get']('/:id',auth[_0x8b9c('0x9')](),controller[_0x8b9c('0xa')]);router[_0x8b9c('0x7')](_0x8b9c('0xb'),auth[_0x8b9c('0x9')](),controller['getFields']);router[_0x8b9c('0x7')](_0x8b9c('0xc'),auth['isAuthenticated'](),controller[_0x8b9c('0xd')]);router['get']('/:id/descriptions',auth[_0x8b9c('0x9')](),controller[_0x8b9c('0xe')]);router['post']('/',auth[_0x8b9c('0x9')](),controller[_0x8b9c('0xf')]);router['put']('/:id',auth[_0x8b9c('0x9')](),controller[_0x8b9c('0x10')]);router[_0x8b9c('0x11')](_0x8b9c('0x12'),auth[_0x8b9c('0x9')](),controller[_0x8b9c('0x13')]);module[_0x8b9c('0x14')]=router; \ No newline at end of file +var _0x1a16=['create','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x27dc8a,_0x3ca48f){var _0x30017a=function(_0x679600){while(--_0x679600){_0x27dc8a['push'](_0x27dc8a['shift']());}};_0x30017a(++_0x3ca48f);}(_0x1a16,0x1e7));var _0x61a1=function(_0x594615,_0x18d2bf){_0x594615=_0x594615-0x0;var _0x4d0ca3=_0x1a16[_0x594615];return _0x4d0ca3;};'use strict';var multer=require(_0x61a1('0x0'));var util=require('util');var path=require(_0x61a1('0x1'));var timeout=require(_0x61a1('0x2'));var express=require(_0x61a1('0x3'));var router=express[_0x61a1('0x4')]();var fs_extra=require(_0x61a1('0x5'));var auth=require(_0x61a1('0x6'));var interaction=require(_0x61a1('0x7'));var config=require(_0x61a1('0x8'));var controller=require(_0x61a1('0x9'));router[_0x61a1('0xa')]('/',auth[_0x61a1('0xb')](),controller['index']);router[_0x61a1('0xa')](_0x61a1('0xc'),auth['isAuthenticated'](),controller[_0x61a1('0xd')]);router[_0x61a1('0xa')](_0x61a1('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x61a1('0xa')]('/:id/subjects',auth[_0x61a1('0xb')](),controller[_0x61a1('0xf')]);router[_0x61a1('0xa')](_0x61a1('0x10'),auth[_0x61a1('0xb')](),controller[_0x61a1('0x11')]);router[_0x61a1('0x12')]('/',auth['isAuthenticated'](),controller[_0x61a1('0x13')]);router['put'](_0x61a1('0xc'),auth[_0x61a1('0xb')](),controller[_0x61a1('0x14')]);router['delete'](_0x61a1('0xc'),auth[_0x61a1('0xb')](),controller['destroy']);module[_0x61a1('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 6148fba..d49b7f2 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 _0xe2e1=['STRING','sequelize','exports'];(function(_0x301d88,_0x36caa3){var _0x5a98e4=function(_0x346680){while(--_0x346680){_0x301d88['push'](_0x301d88['shift']());}};_0x5a98e4(++_0x36caa3);}(_0xe2e1,0x136));var _0x1e2e=function(_0x16eed2,_0x14d1d2){_0x16eed2=_0x16eed2-0x0;var _0x102394=_0xe2e1[_0x16eed2];return _0x102394;};'use strict';var Sequelize=require(_0x1e2e('0x0'));module[_0x1e2e('0x1')]={'name':{'type':Sequelize[_0x1e2e('0x2')]},'description':{'type':Sequelize[_0x1e2e('0x2')]}}; \ No newline at end of file +var _0x6210=['STRING'];(function(_0x49d40d,_0x30e0ea){var _0x5ec463=function(_0x11bab1){while(--_0x11bab1){_0x49d40d['push'](_0x49d40d['shift']());}};_0x5ec463(++_0x30e0ea);}(_0x6210,0x10d));var _0x0621=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x6210[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0621('0x0')]},'description':{'type':Sequelize[_0x0621('0x0')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7568ec1..c904ac1 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 _0x885b=['rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','filters','find','create','body','getFields','findOne','VtigerField','order','options','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerConfiguration'];(function(_0x459978,_0x35ca3d){var _0x5d6b85=function(_0x341796){while(--_0x341796){_0x459978['push'](_0x459978['shift']());}};_0x5d6b85(++_0x35ca3d);}(_0x885b,0x73));var _0xb885=function(_0x1be0fb,_0x2c63b2){_0x1be0fb=_0x1be0fb-0x0;var _0x4275a4=_0x885b[_0x1be0fb];return _0x4275a4;};'use strict';var emlformat=require(_0xb885('0x0'));var rimraf=require(_0xb885('0x1'));var zipdir=require(_0xb885('0x2'));var jsonpatch=require(_0xb885('0x3'));var rp=require('request-promise');var moment=require(_0xb885('0x4'));var BPromise=require(_0xb885('0x5'));var Mustache=require('mustache');var util=require(_0xb885('0x6'));var path=require(_0xb885('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb885('0x8'));var fs=require('fs');var fs_extra=require(_0xb885('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb885('0xa'));var jsforce=require(_0xb885('0xb'));var deskjs=require(_0xb885('0xc'));var toCsv=require(_0xb885('0xd'));var querystring=require(_0xb885('0xe'));var Papa=require('papaparse');var Redis=require(_0xb885('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb885('0x10'));var as=require(_0xb885('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb885('0x12'))(_0xb885('0x13'));var utils=require(_0xb885('0x14'));var config=require(_0xb885('0x15'));var licenseUtil=require(_0xb885('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a9f10,_0x291558){_0x291558=_0x291558||0xcc;return function(_0x37fbce){if(_0x37fbce){return _0x2a9f10['sendStatus'](_0x291558);}return _0x2a9f10[_0xb885('0x17')](_0x291558)[_0xb885('0x18')]();};}function respondWithResult(_0x50e40d,_0x1b90c4){_0x1b90c4=_0x1b90c4||0xc8;return function(_0x57bbeb){if(_0x57bbeb){return _0x50e40d[_0xb885('0x17')](_0x1b90c4)[_0xb885('0x19')](_0x57bbeb);}};}function respondWithFilteredResult(_0x4303fa,_0x53d634){return function(_0xc5e41a){if(_0xc5e41a){var _0x37774a=typeof _0x53d634[_0xb885('0x1a')]===_0xb885('0x1b')&&typeof _0x53d634[_0xb885('0x1c')]===_0xb885('0x1b');var _0x49ae96=_0xc5e41a['count'];var _0x461154=_0x37774a?0x0:_0x53d634[_0xb885('0x1a')];var _0x2e6430=_0x37774a?_0xc5e41a[_0xb885('0x1d')]:_0x53d634[_0xb885('0x1a')]+_0x53d634[_0xb885('0x1c')];var _0x197b10;if(_0x2e6430>=_0x49ae96){_0x2e6430=_0x49ae96;_0x197b10=0xc8;}else{_0x197b10=0xce;}_0x4303fa[_0xb885('0x17')](_0x197b10);return _0x4303fa[_0xb885('0x1e')](_0xb885('0x1f'),_0x461154+'-'+_0x2e6430+'/'+_0x49ae96)[_0xb885('0x19')](_0xc5e41a);}return null;};}function patchUpdates(_0x20bd47){return function(_0x1f75ea){try{jsonpatch[_0xb885('0x20')](_0x1f75ea,_0x20bd47,!![]);}catch(_0xdffa53){return BPromise[_0xb885('0x21')](_0xdffa53);}return _0x1f75ea['save']();};}function saveUpdates(_0x47d72c,_0x4ea3b0){return function(_0x1a639a){if(_0x1a639a){return _0x1a639a[_0xb885('0x22')](_0x47d72c)[_0xb885('0x23')](function(_0x23918e){return _0x23918e;});}return null;};}function removeEntity(_0x1f2399,_0x11b9fc){return function(_0x19444a){if(_0x19444a){return _0x19444a[_0xb885('0x24')]()[_0xb885('0x23')](function(){_0x1f2399['status'](0xcc)[_0xb885('0x18')]();});}};}function handleEntityNotFound(_0x3fd27f,_0x8b6041){return function(_0x24f7b1){if(!_0x24f7b1){_0x3fd27f[_0xb885('0x25')](0x194);}return _0x24f7b1;};}function handleError(_0x2aea9a,_0x1a29f6){_0x1a29f6=_0x1a29f6||0x1f4;return function(_0x3db61b){logger[_0xb885('0x26')](_0x3db61b[_0xb885('0x27')]);if(_0x3db61b[_0xb885('0x28')]){delete _0x3db61b['name'];}_0x2aea9a[_0xb885('0x17')](_0x1a29f6)[_0xb885('0x29')](_0x3db61b);};}exports[_0xb885('0x2a')]=function(_0x46b9de,_0x15e13b){var _0xd98bce={},_0x2c525f={},_0x651e43={'count':0x0,'rows':[]};var _0x28e84d=_[_0xb885('0x2b')](db[_0xb885('0x2c')][_0xb885('0x2d')],function(_0x4e4ef7){return{'name':_0x4e4ef7['fieldName'],'type':_0x4e4ef7[_0xb885('0x2e')][_0xb885('0x2f')]};});_0x2c525f[_0xb885('0x30')]=_['map'](_0x28e84d,_0xb885('0x28'));_0x2c525f[_0xb885('0x31')]=_[_0xb885('0x32')](_0x46b9de[_0xb885('0x31')]);_0x2c525f['filters']=_[_0xb885('0x33')](_0x2c525f[_0xb885('0x30')],_0x2c525f[_0xb885('0x31')]);_0xd98bce[_0xb885('0x34')]=_[_0xb885('0x33')](_0x2c525f[_0xb885('0x30')],qs[_0xb885('0x35')](_0x46b9de[_0xb885('0x31')][_0xb885('0x35')]));_0xd98bce[_0xb885('0x34')]=_0xd98bce[_0xb885('0x34')][_0xb885('0x36')]?_0xd98bce[_0xb885('0x34')]:_0x2c525f[_0xb885('0x30')];if(!_0x46b9de['query']['hasOwnProperty'](_0xb885('0x37'))){_0xd98bce[_0xb885('0x1c')]=qs[_0xb885('0x1c')](_0x46b9de[_0xb885('0x31')]['limit']);_0xd98bce[_0xb885('0x1a')]=qs[_0xb885('0x1a')](_0x46b9de['query'][_0xb885('0x1a')]);}_0xd98bce['order']=qs[_0xb885('0x38')](_0x46b9de[_0xb885('0x31')][_0xb885('0x38')]);_0xd98bce[_0xb885('0x39')]=qs['filters'](_[_0xb885('0x3a')](_0x46b9de[_0xb885('0x31')],_0x2c525f['filters']),_0x28e84d);if(_0x46b9de[_0xb885('0x31')][_0xb885('0x3b')]){_0xd98bce[_0xb885('0x39')]=_[_0xb885('0x3c')](_0xd98bce[_0xb885('0x39')],{'$or':_['map'](_0x28e84d,function(_0x5b4285){if(_0x5b4285['type']!==_0xb885('0x3d')){var _0x1240ac={};_0x1240ac[_0x5b4285['name']]={'$like':'%'+_0x46b9de['query'][_0xb885('0x3b')]+'%'};return _0x1240ac;}})});}_0xd98bce=_[_0xb885('0x3c')]({},_0xd98bce,_0x46b9de['options']);var _0x19e65f={'where':_0xd98bce[_0xb885('0x39')]};return db[_0xb885('0x2c')][_0xb885('0x1d')](_0x19e65f)['then'](function(_0x5a0bbb){_0x651e43['count']=_0x5a0bbb;if(_0x46b9de['query'][_0xb885('0x3e')]){_0xd98bce[_0xb885('0x3f')]=[{'all':!![]}];}return db[_0xb885('0x2c')]['findAll'](_0xd98bce);})[_0xb885('0x23')](function(_0x4593da){_0x651e43[_0xb885('0x40')]=_0x4593da;return _0x651e43;})[_0xb885('0x23')](respondWithFilteredResult(_0x15e13b,_0xd98bce))[_0xb885('0x41')](handleError(_0x15e13b,null));};exports[_0xb885('0x42')]=function(_0x557523,_0x5117fd){var _0x4dc197={'raw':![],'where':{'id':_0x557523[_0xb885('0x43')]['id']}},_0x2e42ce={};_0x2e42ce['model']=_[_0xb885('0x32')](db[_0xb885('0x2c')]['rawAttributes']);_0x2e42ce['query']=_[_0xb885('0x32')](_0x557523[_0xb885('0x31')]);_0x2e42ce[_0xb885('0x44')]=_[_0xb885('0x33')](_0x2e42ce['model'],_0x2e42ce['query']);_0x4dc197[_0xb885('0x34')]=_[_0xb885('0x33')](_0x2e42ce['model'],qs[_0xb885('0x35')](_0x557523[_0xb885('0x31')][_0xb885('0x35')]));_0x4dc197[_0xb885('0x34')]=_0x4dc197['attributes'][_0xb885('0x36')]?_0x4dc197['attributes']:_0x2e42ce[_0xb885('0x30')];if(_0x557523[_0xb885('0x31')]['includeAll']){_0x4dc197[_0xb885('0x3f')]=[{'all':!![]}];}_0x4dc197=_[_0xb885('0x3c')]({},_0x4dc197,_0x557523['options']);return db['VtigerConfiguration'][_0xb885('0x45')](_0x4dc197)['then'](handleEntityNotFound(_0x5117fd,null))[_0xb885('0x23')](respondWithResult(_0x5117fd,null))[_0xb885('0x41')](handleError(_0x5117fd,null));};exports[_0xb885('0x46')]=function(_0xc11e3c,_0xf78b9e){return db['VtigerConfiguration']['create'](_0xc11e3c[_0xb885('0x47')],{})[_0xb885('0x23')](respondWithResult(_0xf78b9e,0xc9))[_0xb885('0x41')](handleError(_0xf78b9e,null));};exports[_0xb885('0x22')]=function(_0x36d386,_0x404c0d){if(_0x36d386[_0xb885('0x47')]['id']){delete _0x36d386[_0xb885('0x47')]['id'];}return db[_0xb885('0x2c')][_0xb885('0x45')]({'where':{'id':_0x36d386['params']['id']}})[_0xb885('0x23')](handleEntityNotFound(_0x404c0d,null))[_0xb885('0x23')](saveUpdates(_0x36d386[_0xb885('0x47')],null))[_0xb885('0x23')](respondWithResult(_0x404c0d,null))['catch'](handleError(_0x404c0d,null));};exports[_0xb885('0x24')]=function(_0x1211e9,_0x4c1e64){return db[_0xb885('0x2c')][_0xb885('0x45')]({'where':{'id':_0x1211e9['params']['id']}})['then'](handleEntityNotFound(_0x4c1e64,null))[_0xb885('0x23')](removeEntity(_0x4c1e64,null))[_0xb885('0x41')](handleError(_0x4c1e64,null));};exports[_0xb885('0x48')]=function(_0x329c71,_0xec7c81,_0x23302b){var _0x5b8c24={};var _0x3bc183={};var _0x7c4fc9;var _0x5aa41a;return db[_0xb885('0x2c')][_0xb885('0x49')]({'where':{'id':_0x329c71[_0xb885('0x43')]['id']}})[_0xb885('0x23')](handleEntityNotFound(_0xec7c81,null))[_0xb885('0x23')](function(_0x1798f3){if(_0x1798f3){_0x7c4fc9=_0x1798f3;_0x3bc183['model']=_[_0xb885('0x32')](db[_0xb885('0x4a')][_0xb885('0x2d')]);_0x3bc183['query']=_['keys'](_0x329c71[_0xb885('0x31')]);_0x3bc183[_0xb885('0x44')]=_[_0xb885('0x33')](_0x3bc183[_0xb885('0x30')],_0x3bc183['query']);_0x5b8c24[_0xb885('0x34')]=_[_0xb885('0x33')](_0x3bc183[_0xb885('0x30')],qs[_0xb885('0x35')](_0x329c71[_0xb885('0x31')]['fields']));_0x5b8c24[_0xb885('0x34')]=_0x5b8c24[_0xb885('0x34')][_0xb885('0x36')]?_0x5b8c24[_0xb885('0x34')]:_0x3bc183[_0xb885('0x30')];_0x5b8c24[_0xb885('0x4b')]=qs['sort'](_0x329c71[_0xb885('0x31')][_0xb885('0x38')]);_0x5b8c24['where']=qs[_0xb885('0x44')](_[_0xb885('0x3a')](_0x329c71[_0xb885('0x31')],_0x3bc183[_0xb885('0x44')]));if(_0x329c71['query'][_0xb885('0x3b')]){_0x5b8c24[_0xb885('0x39')]=_[_0xb885('0x3c')](_0x5b8c24[_0xb885('0x39')],{'$or':_['map'](_0x5b8c24[_0xb885('0x34')],function(_0x12b203){var _0x3acc0c={};_0x3acc0c[_0x12b203]={'$like':'%'+_0x329c71[_0xb885('0x31')][_0xb885('0x3b')]+'%'};return _0x3acc0c;})});}_0x5b8c24=_['merge']({},_0x5b8c24,_0x329c71[_0xb885('0x4c')]);return _0x7c4fc9['getFields'](_0x5b8c24);}})[_0xb885('0x23')](function(_0x1db8ca){if(_0x1db8ca){_0x5aa41a=_0x1db8ca['length'];if(!_0x329c71[_0xb885('0x31')][_0xb885('0x4d')](_0xb885('0x37'))){_0x5b8c24[_0xb885('0x1c')]=qs['limit'](_0x329c71[_0xb885('0x31')][_0xb885('0x1c')]);_0x5b8c24[_0xb885('0x1a')]=qs[_0xb885('0x1a')](_0x329c71['query'][_0xb885('0x1a')]);}return _0x7c4fc9[_0xb885('0x48')](_0x5b8c24);}})['then'](function(_0x171102){if(_0x171102){return _0x171102?{'count':_0x5aa41a,'rows':_0x171102}:null;}})[_0xb885('0x23')](respondWithResult(_0xec7c81,null))[_0xb885('0x41')](handleError(_0xec7c81,null));};exports['getSubjects']=function(_0x448edf,_0x40ebf4,_0x4eb426){var _0x29834b={};var _0x5bb7d3={};var _0x24cc1e;var _0x1f7e48;return db['VtigerConfiguration'][_0xb885('0x49')]({'where':{'id':_0x448edf[_0xb885('0x43')]['id']}})[_0xb885('0x23')](handleEntityNotFound(_0x40ebf4,null))['then'](function(_0x47f978){if(_0x47f978){_0x24cc1e=_0x47f978;_0x5bb7d3[_0xb885('0x30')]=_[_0xb885('0x32')](db[_0xb885('0x4a')][_0xb885('0x2d')]);_0x5bb7d3['query']=_[_0xb885('0x32')](_0x448edf[_0xb885('0x31')]);_0x5bb7d3[_0xb885('0x44')]=_[_0xb885('0x33')](_0x5bb7d3[_0xb885('0x30')],_0x5bb7d3[_0xb885('0x31')]);_0x29834b[_0xb885('0x34')]=_[_0xb885('0x33')](_0x5bb7d3[_0xb885('0x30')],qs['fields'](_0x448edf[_0xb885('0x31')][_0xb885('0x35')]));_0x29834b[_0xb885('0x34')]=_0x29834b['attributes'][_0xb885('0x36')]?_0x29834b[_0xb885('0x34')]:_0x5bb7d3[_0xb885('0x30')];_0x29834b['order']=qs[_0xb885('0x38')](_0x448edf[_0xb885('0x31')][_0xb885('0x38')]);_0x29834b[_0xb885('0x39')]=qs['filters'](_[_0xb885('0x3a')](_0x448edf[_0xb885('0x31')],_0x5bb7d3[_0xb885('0x44')]));if(_0x448edf['query']['filter']){_0x29834b[_0xb885('0x39')]=_[_0xb885('0x3c')](_0x29834b[_0xb885('0x39')],{'$or':_['map'](_0x29834b[_0xb885('0x34')],function(_0x385347){var _0x11cd53={};_0x11cd53[_0x385347]={'$like':'%'+_0x448edf[_0xb885('0x31')]['filter']+'%'};return _0x11cd53;})});}_0x29834b=_['merge']({},_0x29834b,_0x448edf[_0xb885('0x4c')]);return _0x24cc1e['getSubjects'](_0x29834b);}})['then'](function(_0x3253c7){if(_0x3253c7){_0x1f7e48=_0x3253c7['length'];if(!_0x448edf['query'][_0xb885('0x4d')](_0xb885('0x37'))){_0x29834b[_0xb885('0x1c')]=qs['limit'](_0x448edf['query'][_0xb885('0x1c')]);_0x29834b[_0xb885('0x1a')]=qs[_0xb885('0x1a')](_0x448edf[_0xb885('0x31')]['offset']);}return _0x24cc1e[_0xb885('0x4e')](_0x29834b);}})['then'](function(_0x2364e0){if(_0x2364e0){return _0x2364e0?{'count':_0x1f7e48,'rows':_0x2364e0}:null;}})[_0xb885('0x23')](respondWithResult(_0x40ebf4,null))[_0xb885('0x41')](handleError(_0x40ebf4,null));};exports['getDescriptions']=function(_0x3186d5,_0x2e024b,_0x5be232){var _0x4b94d1={};var _0x57cd1f={};var _0x96acc7;var _0x20eab0;return db['VtigerConfiguration'][_0xb885('0x49')]({'where':{'id':_0x3186d5[_0xb885('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e024b,null))[_0xb885('0x23')](function(_0x50219b){if(_0x50219b){_0x96acc7=_0x50219b;_0x57cd1f['model']=_[_0xb885('0x32')](db[_0xb885('0x4a')][_0xb885('0x2d')]);_0x57cd1f[_0xb885('0x31')]=_['keys'](_0x3186d5[_0xb885('0x31')]);_0x57cd1f[_0xb885('0x44')]=_[_0xb885('0x33')](_0x57cd1f[_0xb885('0x30')],_0x57cd1f[_0xb885('0x31')]);_0x4b94d1[_0xb885('0x34')]=_[_0xb885('0x33')](_0x57cd1f[_0xb885('0x30')],qs[_0xb885('0x35')](_0x3186d5[_0xb885('0x31')][_0xb885('0x35')]));_0x4b94d1[_0xb885('0x34')]=_0x4b94d1[_0xb885('0x34')][_0xb885('0x36')]?_0x4b94d1['attributes']:_0x57cd1f[_0xb885('0x30')];_0x4b94d1[_0xb885('0x4b')]=qs[_0xb885('0x38')](_0x3186d5[_0xb885('0x31')][_0xb885('0x38')]);_0x4b94d1['where']=qs['filters'](_[_0xb885('0x3a')](_0x3186d5['query'],_0x57cd1f[_0xb885('0x44')]));if(_0x3186d5[_0xb885('0x31')][_0xb885('0x3b')]){_0x4b94d1[_0xb885('0x39')]=_[_0xb885('0x3c')](_0x4b94d1['where'],{'$or':_[_0xb885('0x2b')](_0x4b94d1[_0xb885('0x34')],function(_0x31b99f){var _0x417528={};_0x417528[_0x31b99f]={'$like':'%'+_0x3186d5[_0xb885('0x31')][_0xb885('0x3b')]+'%'};return _0x417528;})});}_0x4b94d1=_['merge']({},_0x4b94d1,_0x3186d5['options']);return _0x96acc7[_0xb885('0x4f')](_0x4b94d1);}})['then'](function(_0x585894){if(_0x585894){_0x20eab0=_0x585894[_0xb885('0x36')];if(!_0x3186d5[_0xb885('0x31')]['hasOwnProperty'](_0xb885('0x37'))){_0x4b94d1[_0xb885('0x1c')]=qs[_0xb885('0x1c')](_0x3186d5['query'][_0xb885('0x1c')]);_0x4b94d1[_0xb885('0x1a')]=qs[_0xb885('0x1a')](_0x3186d5[_0xb885('0x31')]['offset']);}return _0x96acc7['getDescriptions'](_0x4b94d1);}})['then'](function(_0xa04565){if(_0xa04565){return _0xa04565?{'count':_0x20eab0,'rows':_0xa04565}:null;}})['then'](respondWithResult(_0x2e024b,null))[_0xb885('0x41')](handleError(_0x2e024b,null));}; \ No newline at end of file +var _0x45aa=['error','stack','name','send','index','map','VtigerConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','include','find','body','params','findOne','VtigerField','rawAttributes','nolimit','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0x45aa,0x176));var _0xa45a=function(_0x5b4102,_0x9ee323){_0x5b4102=_0x5b4102-0x0;var _0x190ef0=_0x45aa[_0x5b4102];return _0x190ef0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa45a('0x0'));var zipdir=require(_0xa45a('0x1'));var jsonpatch=require(_0xa45a('0x2'));var rp=require(_0xa45a('0x3'));var moment=require(_0xa45a('0x4'));var BPromise=require(_0xa45a('0x5'));var Mustache=require(_0xa45a('0x6'));var util=require(_0xa45a('0x7'));var path=require(_0xa45a('0x8'));var sox=require(_0xa45a('0x9'));var csv=require(_0xa45a('0xa'));var ejs=require(_0xa45a('0xb'));var fs=require('fs');var fs_extra=require(_0xa45a('0xc'));var _=require(_0xa45a('0xd'));var squel=require(_0xa45a('0xe'));var crypto=require(_0xa45a('0xf'));var jsforce=require(_0xa45a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa45a('0xa'));var querystring=require(_0xa45a('0x11'));var Papa=require(_0xa45a('0x12'));var Redis=require(_0xa45a('0x13'));var authService=require(_0xa45a('0x14'));var qs=require(_0xa45a('0x15'));var as=require(_0xa45a('0x16'));var hardwareService=require(_0xa45a('0x17'));var logger=require(_0xa45a('0x18'))(_0xa45a('0x19'));var utils=require(_0xa45a('0x1a'));var config=require(_0xa45a('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x335df1,_0x4f387a){_0x4f387a=_0x4f387a||0xcc;return function(_0x3194a5){if(_0x3194a5){return _0x335df1['sendStatus'](_0x4f387a);}return _0x335df1[_0xa45a('0x1c')](_0x4f387a)[_0xa45a('0x1d')]();};}function respondWithResult(_0x5228b1,_0x269f37){_0x269f37=_0x269f37||0xc8;return function(_0x325500){if(_0x325500){return _0x5228b1[_0xa45a('0x1c')](_0x269f37)[_0xa45a('0x1e')](_0x325500);}};}function respondWithFilteredResult(_0x4f418c,_0x4fa8cc){return function(_0xaaf761){if(_0xaaf761){var _0x4b2b3e=typeof _0x4fa8cc[_0xa45a('0x1f')]===_0xa45a('0x20')&&typeof _0x4fa8cc[_0xa45a('0x21')]===_0xa45a('0x20');var _0x275af4=_0xaaf761['count'];var _0x1b4c56=_0x4b2b3e?0x0:_0x4fa8cc['offset'];var _0x28cb98=_0x4b2b3e?_0xaaf761['count']:_0x4fa8cc[_0xa45a('0x1f')]+_0x4fa8cc[_0xa45a('0x21')];var _0x261310;if(_0x28cb98>=_0x275af4){_0x28cb98=_0x275af4;_0x261310=0xc8;}else{_0x261310=0xce;}_0x4f418c[_0xa45a('0x1c')](_0x261310);return _0x4f418c[_0xa45a('0x22')](_0xa45a('0x23'),_0x1b4c56+'-'+_0x28cb98+'/'+_0x275af4)[_0xa45a('0x1e')](_0xaaf761);}return null;};}function patchUpdates(_0x3a2944){return function(_0x5a0a0c){try{jsonpatch[_0xa45a('0x24')](_0x5a0a0c,_0x3a2944,!![]);}catch(_0x1e1328){return BPromise[_0xa45a('0x25')](_0x1e1328);}return _0x5a0a0c[_0xa45a('0x26')]();};}function saveUpdates(_0x338c55,_0x3d6d47){return function(_0x144406){if(_0x144406){return _0x144406[_0xa45a('0x27')](_0x338c55)[_0xa45a('0x28')](function(_0x1fc31f){return _0x1fc31f;});}return null;};}function removeEntity(_0x10c6fc,_0x97711d){return function(_0x34c310){if(_0x34c310){return _0x34c310['destroy']()[_0xa45a('0x28')](function(){_0x10c6fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2a20,_0x17f302){return function(_0x9d0ece){if(!_0x9d0ece){_0x2e2a20['sendStatus'](0x194);}return _0x9d0ece;};}function handleError(_0x62136c,_0x18654a){_0x18654a=_0x18654a||0x1f4;return function(_0x150c46){logger[_0xa45a('0x29')](_0x150c46[_0xa45a('0x2a')]);if(_0x150c46[_0xa45a('0x2b')]){delete _0x150c46['name'];}_0x62136c['status'](_0x18654a)[_0xa45a('0x2c')](_0x150c46);};}exports[_0xa45a('0x2d')]=function(_0x5e452f,_0x5ee7ec){var _0x2b0168={},_0x1436c5={},_0x20a73c={'count':0x0,'rows':[]};var _0x39dca7=_[_0xa45a('0x2e')](db[_0xa45a('0x2f')]['rawAttributes'],function(_0x572079){return{'name':_0x572079['fieldName'],'type':_0x572079[_0xa45a('0x30')][_0xa45a('0x31')]};});_0x1436c5[_0xa45a('0x32')]=_['map'](_0x39dca7,_0xa45a('0x2b'));_0x1436c5[_0xa45a('0x33')]=_[_0xa45a('0x34')](_0x5e452f[_0xa45a('0x33')]);_0x1436c5[_0xa45a('0x35')]=_[_0xa45a('0x36')](_0x1436c5['model'],_0x1436c5[_0xa45a('0x33')]);_0x2b0168[_0xa45a('0x37')]=_['intersection'](_0x1436c5[_0xa45a('0x32')],qs[_0xa45a('0x38')](_0x5e452f[_0xa45a('0x33')][_0xa45a('0x38')]));_0x2b0168[_0xa45a('0x37')]=_0x2b0168[_0xa45a('0x37')][_0xa45a('0x39')]?_0x2b0168[_0xa45a('0x37')]:_0x1436c5[_0xa45a('0x32')];if(!_0x5e452f[_0xa45a('0x33')][_0xa45a('0x3a')]('nolimit')){_0x2b0168['limit']=qs[_0xa45a('0x21')](_0x5e452f[_0xa45a('0x33')]['limit']);_0x2b0168[_0xa45a('0x1f')]=qs[_0xa45a('0x1f')](_0x5e452f[_0xa45a('0x33')][_0xa45a('0x1f')]);}_0x2b0168[_0xa45a('0x3b')]=qs[_0xa45a('0x3c')](_0x5e452f[_0xa45a('0x33')]['sort']);_0x2b0168[_0xa45a('0x3d')]=qs['filters'](_[_0xa45a('0x3e')](_0x5e452f[_0xa45a('0x33')],_0x1436c5['filters']),_0x39dca7);if(_0x5e452f[_0xa45a('0x33')][_0xa45a('0x3f')]){_0x2b0168[_0xa45a('0x3d')]=_[_0xa45a('0x40')](_0x2b0168[_0xa45a('0x3d')],{'$or':_[_0xa45a('0x2e')](_0x39dca7,function(_0x165fc0){if(_0x165fc0['type']!==_0xa45a('0x41')){var _0x2a9e07={};_0x2a9e07[_0x165fc0[_0xa45a('0x2b')]]={'$like':'%'+_0x5e452f['query']['filter']+'%'};return _0x2a9e07;}})});}_0x2b0168=_[_0xa45a('0x40')]({},_0x2b0168,_0x5e452f[_0xa45a('0x42')]);var _0x3ceff6={'where':_0x2b0168['where']};return db['VtigerConfiguration'][_0xa45a('0x43')](_0x3ceff6)['then'](function(_0x21e2f6){_0x20a73c[_0xa45a('0x43')]=_0x21e2f6;if(_0x5e452f[_0xa45a('0x33')][_0xa45a('0x44')]){_0x2b0168['include']=[{'all':!![]}];}return db[_0xa45a('0x2f')][_0xa45a('0x45')](_0x2b0168);})[_0xa45a('0x28')](function(_0x444e3c){_0x20a73c[_0xa45a('0x46')]=_0x444e3c;return _0x20a73c;})[_0xa45a('0x28')](respondWithFilteredResult(_0x5ee7ec,_0x2b0168))[_0xa45a('0x47')](handleError(_0x5ee7ec,null));};exports['show']=function(_0x4c5e01,_0xcb61d5){var _0x1ef0ce={'raw':![],'where':{'id':_0x4c5e01['params']['id']}},_0x26d152={};_0x26d152[_0xa45a('0x32')]=_[_0xa45a('0x34')](db['VtigerConfiguration']['rawAttributes']);_0x26d152['query']=_['keys'](_0x4c5e01['query']);_0x26d152[_0xa45a('0x35')]=_[_0xa45a('0x36')](_0x26d152[_0xa45a('0x32')],_0x26d152[_0xa45a('0x33')]);_0x1ef0ce[_0xa45a('0x37')]=_[_0xa45a('0x36')](_0x26d152[_0xa45a('0x32')],qs[_0xa45a('0x38')](_0x4c5e01[_0xa45a('0x33')]['fields']));_0x1ef0ce[_0xa45a('0x37')]=_0x1ef0ce[_0xa45a('0x37')][_0xa45a('0x39')]?_0x1ef0ce[_0xa45a('0x37')]:_0x26d152[_0xa45a('0x32')];if(_0x4c5e01['query'][_0xa45a('0x44')]){_0x1ef0ce[_0xa45a('0x48')]=[{'all':!![]}];}_0x1ef0ce=_['merge']({},_0x1ef0ce,_0x4c5e01['options']);return db[_0xa45a('0x2f')][_0xa45a('0x49')](_0x1ef0ce)[_0xa45a('0x28')](handleEntityNotFound(_0xcb61d5,null))[_0xa45a('0x28')](respondWithResult(_0xcb61d5,null))[_0xa45a('0x47')](handleError(_0xcb61d5,null));};exports['create']=function(_0x39f4fe,_0x2f729f){return db[_0xa45a('0x2f')]['create'](_0x39f4fe[_0xa45a('0x4a')],{})[_0xa45a('0x28')](respondWithResult(_0x2f729f,0xc9))[_0xa45a('0x47')](handleError(_0x2f729f,null));};exports[_0xa45a('0x27')]=function(_0x31d96b,_0x148424){if(_0x31d96b['body']['id']){delete _0x31d96b['body']['id'];}return db[_0xa45a('0x2f')][_0xa45a('0x49')]({'where':{'id':_0x31d96b['params']['id']}})['then'](handleEntityNotFound(_0x148424,null))['then'](saveUpdates(_0x31d96b['body'],null))['then'](respondWithResult(_0x148424,null))['catch'](handleError(_0x148424,null));};exports['destroy']=function(_0x307cc0,_0x271f29){return db[_0xa45a('0x2f')]['find']({'where':{'id':_0x307cc0[_0xa45a('0x4b')]['id']}})[_0xa45a('0x28')](handleEntityNotFound(_0x271f29,null))[_0xa45a('0x28')](removeEntity(_0x271f29,null))[_0xa45a('0x47')](handleError(_0x271f29,null));};exports['getFields']=function(_0x5df68c,_0xf0e3d3,_0x41e278){var _0x52e974={};var _0x4a63d9={};var _0x122102;var _0x266782;return db[_0xa45a('0x2f')][_0xa45a('0x4c')]({'where':{'id':_0x5df68c[_0xa45a('0x4b')]['id']}})[_0xa45a('0x28')](handleEntityNotFound(_0xf0e3d3,null))[_0xa45a('0x28')](function(_0x14ea87){if(_0x14ea87){_0x122102=_0x14ea87;_0x4a63d9[_0xa45a('0x32')]=_['keys'](db[_0xa45a('0x4d')][_0xa45a('0x4e')]);_0x4a63d9[_0xa45a('0x33')]=_['keys'](_0x5df68c[_0xa45a('0x33')]);_0x4a63d9['filters']=_['intersection'](_0x4a63d9[_0xa45a('0x32')],_0x4a63d9[_0xa45a('0x33')]);_0x52e974[_0xa45a('0x37')]=_['intersection'](_0x4a63d9[_0xa45a('0x32')],qs[_0xa45a('0x38')](_0x5df68c['query'][_0xa45a('0x38')]));_0x52e974['attributes']=_0x52e974[_0xa45a('0x37')][_0xa45a('0x39')]?_0x52e974['attributes']:_0x4a63d9[_0xa45a('0x32')];_0x52e974[_0xa45a('0x3b')]=qs[_0xa45a('0x3c')](_0x5df68c[_0xa45a('0x33')][_0xa45a('0x3c')]);_0x52e974[_0xa45a('0x3d')]=qs[_0xa45a('0x35')](_['pick'](_0x5df68c[_0xa45a('0x33')],_0x4a63d9[_0xa45a('0x35')]));if(_0x5df68c[_0xa45a('0x33')][_0xa45a('0x3f')]){_0x52e974['where']=_[_0xa45a('0x40')](_0x52e974[_0xa45a('0x3d')],{'$or':_[_0xa45a('0x2e')](_0x52e974[_0xa45a('0x37')],function(_0x20604b){var _0x20ac91={};_0x20ac91[_0x20604b]={'$like':'%'+_0x5df68c[_0xa45a('0x33')][_0xa45a('0x3f')]+'%'};return _0x20ac91;})});}_0x52e974=_[_0xa45a('0x40')]({},_0x52e974,_0x5df68c[_0xa45a('0x42')]);return _0x122102['getFields'](_0x52e974);}})['then'](function(_0x396b18){if(_0x396b18){_0x266782=_0x396b18['length'];if(!_0x5df68c['query'][_0xa45a('0x3a')](_0xa45a('0x4f'))){_0x52e974['limit']=qs[_0xa45a('0x21')](_0x5df68c[_0xa45a('0x33')][_0xa45a('0x21')]);_0x52e974['offset']=qs['offset'](_0x5df68c[_0xa45a('0x33')][_0xa45a('0x1f')]);}return _0x122102[_0xa45a('0x50')](_0x52e974);}})[_0xa45a('0x28')](function(_0x3750b1){if(_0x3750b1){return _0x3750b1?{'count':_0x266782,'rows':_0x3750b1}:null;}})[_0xa45a('0x28')](respondWithResult(_0xf0e3d3,null))[_0xa45a('0x47')](handleError(_0xf0e3d3,null));};exports[_0xa45a('0x51')]=function(_0x1b2639,_0x2b1014,_0x3ee4ea){var _0x37f3c3={};var _0x337aa8={};var _0x308cbe;var _0x5b58df;return db[_0xa45a('0x2f')][_0xa45a('0x4c')]({'where':{'id':_0x1b2639[_0xa45a('0x4b')]['id']}})[_0xa45a('0x28')](handleEntityNotFound(_0x2b1014,null))['then'](function(_0x37c5d1){if(_0x37c5d1){_0x308cbe=_0x37c5d1;_0x337aa8[_0xa45a('0x32')]=_[_0xa45a('0x34')](db[_0xa45a('0x4d')]['rawAttributes']);_0x337aa8[_0xa45a('0x33')]=_[_0xa45a('0x34')](_0x1b2639[_0xa45a('0x33')]);_0x337aa8['filters']=_[_0xa45a('0x36')](_0x337aa8[_0xa45a('0x32')],_0x337aa8['query']);_0x37f3c3[_0xa45a('0x37')]=_[_0xa45a('0x36')](_0x337aa8[_0xa45a('0x32')],qs[_0xa45a('0x38')](_0x1b2639['query'][_0xa45a('0x38')]));_0x37f3c3[_0xa45a('0x37')]=_0x37f3c3[_0xa45a('0x37')][_0xa45a('0x39')]?_0x37f3c3[_0xa45a('0x37')]:_0x337aa8[_0xa45a('0x32')];_0x37f3c3['order']=qs[_0xa45a('0x3c')](_0x1b2639[_0xa45a('0x33')][_0xa45a('0x3c')]);_0x37f3c3[_0xa45a('0x3d')]=qs['filters'](_[_0xa45a('0x3e')](_0x1b2639[_0xa45a('0x33')],_0x337aa8[_0xa45a('0x35')]));if(_0x1b2639[_0xa45a('0x33')][_0xa45a('0x3f')]){_0x37f3c3[_0xa45a('0x3d')]=_[_0xa45a('0x40')](_0x37f3c3['where'],{'$or':_[_0xa45a('0x2e')](_0x37f3c3['attributes'],function(_0x90feb5){var _0x24a6e0={};_0x24a6e0[_0x90feb5]={'$like':'%'+_0x1b2639['query'][_0xa45a('0x3f')]+'%'};return _0x24a6e0;})});}_0x37f3c3=_[_0xa45a('0x40')]({},_0x37f3c3,_0x1b2639[_0xa45a('0x42')]);return _0x308cbe[_0xa45a('0x51')](_0x37f3c3);}})[_0xa45a('0x28')](function(_0x1d1ab9){if(_0x1d1ab9){_0x5b58df=_0x1d1ab9[_0xa45a('0x39')];if(!_0x1b2639[_0xa45a('0x33')]['hasOwnProperty'](_0xa45a('0x4f'))){_0x37f3c3[_0xa45a('0x21')]=qs['limit'](_0x1b2639['query']['limit']);_0x37f3c3[_0xa45a('0x1f')]=qs[_0xa45a('0x1f')](_0x1b2639['query'][_0xa45a('0x1f')]);}return _0x308cbe[_0xa45a('0x51')](_0x37f3c3);}})[_0xa45a('0x28')](function(_0x2917f9){if(_0x2917f9){return _0x2917f9?{'count':_0x5b58df,'rows':_0x2917f9}:null;}})['then'](respondWithResult(_0x2b1014,null))[_0xa45a('0x47')](handleError(_0x2b1014,null));};exports[_0xa45a('0x52')]=function(_0x58e227,_0x14290b,_0x165d0a){var _0x522b64={};var _0x4a48c1={};var _0x58160c;var _0x1f0243;return db[_0xa45a('0x2f')][_0xa45a('0x4c')]({'where':{'id':_0x58e227['params']['id']}})[_0xa45a('0x28')](handleEntityNotFound(_0x14290b,null))[_0xa45a('0x28')](function(_0x20723f){if(_0x20723f){_0x58160c=_0x20723f;_0x4a48c1['model']=_[_0xa45a('0x34')](db[_0xa45a('0x4d')][_0xa45a('0x4e')]);_0x4a48c1['query']=_[_0xa45a('0x34')](_0x58e227['query']);_0x4a48c1[_0xa45a('0x35')]=_[_0xa45a('0x36')](_0x4a48c1[_0xa45a('0x32')],_0x4a48c1['query']);_0x522b64[_0xa45a('0x37')]=_[_0xa45a('0x36')](_0x4a48c1[_0xa45a('0x32')],qs[_0xa45a('0x38')](_0x58e227[_0xa45a('0x33')]['fields']));_0x522b64['attributes']=_0x522b64['attributes']['length']?_0x522b64[_0xa45a('0x37')]:_0x4a48c1[_0xa45a('0x32')];_0x522b64[_0xa45a('0x3b')]=qs[_0xa45a('0x3c')](_0x58e227[_0xa45a('0x33')]['sort']);_0x522b64[_0xa45a('0x3d')]=qs['filters'](_[_0xa45a('0x3e')](_0x58e227['query'],_0x4a48c1[_0xa45a('0x35')]));if(_0x58e227[_0xa45a('0x33')][_0xa45a('0x3f')]){_0x522b64[_0xa45a('0x3d')]=_['merge'](_0x522b64['where'],{'$or':_[_0xa45a('0x2e')](_0x522b64[_0xa45a('0x37')],function(_0x555abc){var _0x2201b4={};_0x2201b4[_0x555abc]={'$like':'%'+_0x58e227[_0xa45a('0x33')]['filter']+'%'};return _0x2201b4;})});}_0x522b64=_[_0xa45a('0x40')]({},_0x522b64,_0x58e227[_0xa45a('0x42')]);return _0x58160c['getDescriptions'](_0x522b64);}})['then'](function(_0x522941){if(_0x522941){_0x1f0243=_0x522941[_0xa45a('0x39')];if(!_0x58e227[_0xa45a('0x33')][_0xa45a('0x3a')](_0xa45a('0x4f'))){_0x522b64[_0xa45a('0x21')]=qs['limit'](_0x58e227[_0xa45a('0x33')][_0xa45a('0x21')]);_0x522b64[_0xa45a('0x1f')]=qs[_0xa45a('0x1f')](_0x58e227[_0xa45a('0x33')]['offset']);}return _0x58160c[_0xa45a('0x52')](_0x522b64);}})[_0xa45a('0x28')](function(_0x3561e0){if(_0x3561e0){return _0x3561e0?{'count':_0x1f0243,'rows':_0x3561e0}:null;}})[_0xa45a('0x28')](respondWithResult(_0x14290b,null))[_0xa45a('0x47')](handleError(_0x14290b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 02c9eaa..083260b 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 _0x9422=['exports','define','int_vtiger_configurations','lodash','util','api','bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x14df01,_0x2c06a9){var _0x2c23b7=function(_0x5d5e85){while(--_0x5d5e85){_0x14df01['push'](_0x14df01['shift']());}};_0x2c23b7(++_0x2c06a9);}(_0x9422,0x1e3));var _0x2942=function(_0x1e7b88,_0x1bb1ae){_0x1e7b88=_0x1e7b88-0x0;var _0x43cad8=_0x9422[_0x1e7b88];return _0x43cad8;};'use strict';var _=require(_0x2942('0x0'));var util=require(_0x2942('0x1'));var logger=require('../../config/logger')(_0x2942('0x2'));var moment=require('moment');var BPromise=require(_0x2942('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2942('0x4'));var config=require(_0x2942('0x5'));var attributes=require(_0x2942('0x6'));module[_0x2942('0x7')]=function(_0x1cefa2,_0x3905ad){return _0x1cefa2[_0x2942('0x8')]('VtigerConfiguration',attributes,{'tableName':_0x2942('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8bd=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','lodash','util','api'];(function(_0xa963b5,_0x1e791d){var _0xaa1f5b=function(_0x447f31){while(--_0x447f31){_0xa963b5['push'](_0xa963b5['shift']());}};_0xaa1f5b(++_0x1e791d);}(_0xa8bd,0xe7));var _0xda8b=function(_0x7beda5,_0x5d855c){_0x7beda5=_0x7beda5-0x0;var _0x5cea6b=_0xa8bd[_0x7beda5];return _0x5cea6b;};'use strict';var _=require(_0xda8b('0x0'));var util=require(_0xda8b('0x1'));var logger=require('../../config/logger')(_0xda8b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xda8b('0x3'));var fs=require('fs');var path=require(_0xda8b('0x4'));var rimraf=require(_0xda8b('0x5'));var config=require(_0xda8b('0x6'));var attributes=require(_0xda8b('0x7'));module[_0xda8b('0x8')]=function(_0x44c105,_0x524bba){return _0x44c105['define']('VtigerConfiguration',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 b185527..7050dff 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 _0xe993=['rpc','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe993,0x77));var _0x3e99=function(_0x328c87,_0x30b2b6){_0x328c87=_0x328c87-0x0;var _0x4a3a85=_0xe993[_0x328c87];return _0x4a3a85;};'use strict';var _=require(_0x3e99('0x0'));var util=require(_0x3e99('0x1'));var moment=require(_0x3e99('0x2'));var BPromise=require(_0x3e99('0x3'));var rs=require(_0x3e99('0x4'));var fs=require('fs');var Redis=require(_0x3e99('0x5'));var db=require(_0x3e99('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e99('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e99('0x8'));var client=jayson[_0x3e99('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f3ea,_0x2b3cd4,_0x306d26){return new BPromise(function(_0x2caa2a,_0x1dbcde){return client[_0x3e99('0xa')](_0x27f3ea,_0x306d26)[_0x3e99('0xb')](function(_0x140838){logger[_0x3e99('0xc')](_0x3e99('0xd'),_0x2b3cd4,_0x3e99('0xe'));logger['debug'](_0x3e99('0xf'),_0x2b3cd4,_0x3e99('0xe'),JSON[_0x3e99('0x10')](_0x140838));if(_0x140838[_0x3e99('0x11')]){if(_0x140838['error'][_0x3e99('0x12')]===0x1f4){logger[_0x3e99('0x11')](_0x3e99('0xd'),_0x2b3cd4,_0x140838['error'][_0x3e99('0x13')]);return _0x1dbcde(_0x140838[_0x3e99('0x11')]['message']);}logger[_0x3e99('0x11')](_0x3e99('0xd'),_0x2b3cd4,_0x140838[_0x3e99('0x11')][_0x3e99('0x13')]);return _0x2caa2a(_0x140838[_0x3e99('0x11')][_0x3e99('0x13')]);}else{logger[_0x3e99('0xc')](_0x3e99('0xd'),_0x2b3cd4,_0x3e99('0xe'));_0x2caa2a(_0x140838['result'][_0x3e99('0x13')]);}})[_0x3e99('0x14')](function(_0xa390d8){logger[_0x3e99('0x11')](_0x3e99('0xd'),_0x2b3cd4,_0xa390d8);_0x1dbcde(_0xa390d8);});});} \ No newline at end of file +var _0x7e5a=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0x43e5a6,_0x956a14){var _0x5a8fbd=function(_0x54fb43){while(--_0x54fb43){_0x43e5a6['push'](_0x43e5a6['shift']());}};_0x5a8fbd(++_0x956a14);}(_0x7e5a,0x169));var _0xa7e5=function(_0x107c65,_0x36d450){_0x107c65=_0x107c65-0x0;var _0x197267=_0x7e5a[_0x107c65];return _0x197267;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa7e5('0x0'));var BPromise=require('bluebird');var rs=require(_0xa7e5('0x1'));var fs=require('fs');var Redis=require(_0xa7e5('0x2'));var db=require(_0xa7e5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7e5('0x4'))(_0xa7e5('0x5'));var config=require(_0xa7e5('0x6'));var jayson=require(_0xa7e5('0x7'));var client=jayson[_0xa7e5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e652a,_0x49421b,_0x3de02d){return new BPromise(function(_0x24b532,_0x420cb9){return client[_0xa7e5('0x9')](_0x4e652a,_0x3de02d)['then'](function(_0x17a6ae){logger[_0xa7e5('0xa')](_0xa7e5('0xb'),_0x49421b,'request\x20sent');logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x49421b,'request\x20sent',JSON[_0xa7e5('0xc')](_0x17a6ae));if(_0x17a6ae[_0xa7e5('0xd')]){if(_0x17a6ae['error']['code']===0x1f4){logger[_0xa7e5('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x49421b,_0x17a6ae[_0xa7e5('0xd')]['message']);return _0x420cb9(_0x17a6ae[_0xa7e5('0xd')][_0xa7e5('0xe')]);}logger[_0xa7e5('0xd')](_0xa7e5('0xb'),_0x49421b,_0x17a6ae[_0xa7e5('0xd')]['message']);return _0x24b532(_0x17a6ae[_0xa7e5('0xd')][_0xa7e5('0xe')]);}else{logger[_0xa7e5('0xa')](_0xa7e5('0xb'),_0x49421b,_0xa7e5('0xf'));_0x24b532(_0x17a6ae[_0xa7e5('0x10')][_0xa7e5('0xe')]);}})[_0xa7e5('0x11')](function(_0x16b6f6){logger[_0xa7e5('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x49421b,_0x16b6f6);_0x420cb9(_0x16b6f6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 79fe147..ce4b2fa 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 _0x9ffb=['path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ffb,0x1af));var _0xb9ff=function(_0x363694,_0x591b75){_0x363694=_0x363694-0x0;var _0x459be3=_0x9ffb[_0x363694];return _0x459be3;};'use strict';var multer=require(_0xb9ff('0x0'));var util=require('util');var path=require(_0xb9ff('0x1'));var timeout=require(_0xb9ff('0x2'));var express=require(_0xb9ff('0x3'));var router=express[_0xb9ff('0x4')]();var fs_extra=require(_0xb9ff('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb9ff('0x6'));var controller=require('./intVtigerField.controller');router[_0xb9ff('0x7')]('/',auth[_0xb9ff('0x8')](),controller[_0xb9ff('0x9')]);router[_0xb9ff('0x7')]('/:id',auth[_0xb9ff('0x8')](),controller[_0xb9ff('0xa')]);router[_0xb9ff('0xb')]('/',auth[_0xb9ff('0x8')](),controller[_0xb9ff('0xc')]);router[_0xb9ff('0xd')](_0xb9ff('0xe'),auth[_0xb9ff('0x8')](),controller[_0xb9ff('0xf')]);router[_0xb9ff('0x10')](_0xb9ff('0xe'),auth['isAuthenticated'](),controller[_0xb9ff('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8f2d=['../../config/environment','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3db372,_0x47f21c){var _0xce3d79=function(_0x43c2c4){while(--_0x43c2c4){_0x3db372['push'](_0x3db372['shift']());}};_0xce3d79(++_0x47f21c);}(_0x8f2d,0x71));var _0xd8f2=function(_0x5723ba,_0x54a0c1){_0x5723ba=_0x5723ba-0x0;var _0x5e146b=_0x8f2d[_0x5723ba];return _0x5e146b;};'use strict';var multer=require('multer');var util=require(_0xd8f2('0x0'));var path=require('path');var timeout=require(_0xd8f2('0x1'));var express=require('express');var router=express[_0xd8f2('0x2')]();var fs_extra=require(_0xd8f2('0x3'));var auth=require(_0xd8f2('0x4'));var interaction=require(_0xd8f2('0x5'));var config=require(_0xd8f2('0x6'));var controller=require('./intVtigerField.controller');router[_0xd8f2('0x7')]('/',auth[_0xd8f2('0x8')](),controller[_0xd8f2('0x9')]);router[_0xd8f2('0x7')]('/:id',auth[_0xd8f2('0x8')](),controller['show']);router[_0xd8f2('0xa')]('/',auth[_0xd8f2('0x8')](),controller['create']);router[_0xd8f2('0xb')](_0xd8f2('0xc'),auth[_0xd8f2('0x8')](),controller[_0xd8f2('0xd')]);router[_0xd8f2('0xe')](_0xd8f2('0xc'),auth[_0xd8f2('0x8')](),controller[_0xd8f2('0xf')]);module[_0xd8f2('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index cb97168..4b9aa7e 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 _0x19ca=['STRING','ENUM','variable','sequelize','string','customVariable','keyValue'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0x19ca,0x14c));var _0xa19c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x19ca[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xa19c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa19c('0x1'),'variable',_0xa19c('0x2'),_0xa19c('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xa19c('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa19c('0x5')](_0xa19c('0x1'),_0xa19c('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xa19c('0x4')]},'idField':{'type':Sequelize[_0xa19c('0x4')]},'nameField':{'type':Sequelize[_0xa19c('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa19c('0x4')]}}; \ No newline at end of file +var _0xdd9c=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd9c,0x135));var _0xcdd9=function(_0x3aa7ad,_0x10e560){_0x3aa7ad=_0x3aa7ad-0x0;var _0x36f1b1=_0xdd9c[_0x3aa7ad];return _0x36f1b1;};'use strict';var Sequelize=require(_0xcdd9('0x0'));module[_0xcdd9('0x1')]={'type':{'type':Sequelize[_0xcdd9('0x2')]('string',_0xcdd9('0x3'),_0xcdd9('0x4'),_0xcdd9('0x5'),_0xcdd9('0x6')),'defaultValue':_0xcdd9('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcdd9('0x8')]},'keyType':{'type':Sequelize[_0xcdd9('0x2')]('string',_0xcdd9('0x3'),_0xcdd9('0x4'))},'keyContent':{'type':Sequelize[_0xcdd9('0x8')]},'idField':{'type':Sequelize[_0xcdd9('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcdd9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcdd9('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index aa08ced..788cc29 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 _0x541c=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','VtigerField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','fast-json-patch','request-promise','moment','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'];(function(_0x2ee0f6,_0x40efe9){var _0x4c31a8=function(_0x2a4b50){while(--_0x2a4b50){_0x2ee0f6['push'](_0x2ee0f6['shift']());}};_0x4c31a8(++_0x40efe9);}(_0x541c,0x196));var _0xc541=function(_0x291139,_0x7f30de){_0x291139=_0x291139-0x0;var _0x3c42c0=_0x541c[_0x291139];return _0x3c42c0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc541('0x0'));var rp=require(_0xc541('0x1'));var moment=require(_0xc541('0x2'));var BPromise=require(_0xc541('0x3'));var Mustache=require(_0xc541('0x4'));var util=require(_0xc541('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc541('0x6'));var ejs=require(_0xc541('0x7'));var fs=require('fs');var fs_extra=require(_0xc541('0x8'));var _=require(_0xc541('0x9'));var squel=require(_0xc541('0xa'));var crypto=require(_0xc541('0xb'));var jsforce=require(_0xc541('0xc'));var deskjs=require(_0xc541('0xd'));var toCsv=require(_0xc541('0x6'));var querystring=require(_0xc541('0xe'));var Papa=require(_0xc541('0xf'));var Redis=require(_0xc541('0x10'));var authService=require(_0xc541('0x11'));var qs=require(_0xc541('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc541('0x13'));var logger=require(_0xc541('0x14'))(_0xc541('0x15'));var utils=require(_0xc541('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc541('0x17'));var db=require(_0xc541('0x18'))['db'];function respondWithStatusCode(_0x507f5b,_0x1bda4e){_0x1bda4e=_0x1bda4e||0xcc;return function(_0x3744e3){if(_0x3744e3){return _0x507f5b[_0xc541('0x19')](_0x1bda4e);}return _0x507f5b[_0xc541('0x1a')](_0x1bda4e)['end']();};}function respondWithResult(_0x17d6e8,_0x23e2f9){_0x23e2f9=_0x23e2f9||0xc8;return function(_0x2a2253){if(_0x2a2253){return _0x17d6e8[_0xc541('0x1a')](_0x23e2f9)[_0xc541('0x1b')](_0x2a2253);}};}function respondWithFilteredResult(_0x4b3d32,_0x54cd4e){return function(_0x1d02cf){if(_0x1d02cf){var _0x452ed8=typeof _0x54cd4e[_0xc541('0x1c')]==='undefined'&&typeof _0x54cd4e['limit']==='undefined';var _0x5d0d13=_0x1d02cf[_0xc541('0x1d')];var _0x272eb1=_0x452ed8?0x0:_0x54cd4e[_0xc541('0x1c')];var _0x53ff3a=_0x452ed8?_0x1d02cf[_0xc541('0x1d')]:_0x54cd4e[_0xc541('0x1c')]+_0x54cd4e[_0xc541('0x1e')];var _0x5ead91;if(_0x53ff3a>=_0x5d0d13){_0x53ff3a=_0x5d0d13;_0x5ead91=0xc8;}else{_0x5ead91=0xce;}_0x4b3d32['status'](_0x5ead91);return _0x4b3d32[_0xc541('0x1f')](_0xc541('0x20'),_0x272eb1+'-'+_0x53ff3a+'/'+_0x5d0d13)['json'](_0x1d02cf);}return null;};}function patchUpdates(_0x3364e6){return function(_0x506281){try{jsonpatch['apply'](_0x506281,_0x3364e6,!![]);}catch(_0x4224dd){return BPromise[_0xc541('0x21')](_0x4224dd);}return _0x506281[_0xc541('0x22')]();};}function saveUpdates(_0xf79825,_0x400152){return function(_0x26a48c){if(_0x26a48c){return _0x26a48c[_0xc541('0x23')](_0xf79825)['then'](function(_0x4234bf){return _0x4234bf;});}return null;};}function removeEntity(_0x58daa1,_0x14d068){return function(_0x43da4f){if(_0x43da4f){return _0x43da4f[_0xc541('0x24')]()[_0xc541('0x25')](function(){_0x58daa1[_0xc541('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3abbb3,_0x2d811e){return function(_0xe38dfc){if(!_0xe38dfc){_0x3abbb3['sendStatus'](0x194);}return _0xe38dfc;};}function handleError(_0x9b7cf5,_0x152c64){_0x152c64=_0x152c64||0x1f4;return function(_0x280fda){logger[_0xc541('0x26')](_0x280fda['stack']);if(_0x280fda[_0xc541('0x27')]){delete _0x280fda['name'];}_0x9b7cf5[_0xc541('0x1a')](_0x152c64)[_0xc541('0x28')](_0x280fda);};}exports[_0xc541('0x29')]=function(_0x5b1f24,_0x134d35){var _0x1f7f08={},_0xcc1df8={},_0x46717f={'count':0x0,'rows':[]};var _0x45fb27=_[_0xc541('0x2a')](db[_0xc541('0x2b')][_0xc541('0x2c')],function(_0x3e0969){return{'name':_0x3e0969['fieldName'],'type':_0x3e0969['type']['key']};});_0xcc1df8[_0xc541('0x2d')]=_[_0xc541('0x2a')](_0x45fb27,'name');_0xcc1df8[_0xc541('0x2e')]=_[_0xc541('0x2f')](_0x5b1f24[_0xc541('0x2e')]);_0xcc1df8[_0xc541('0x30')]=_[_0xc541('0x31')](_0xcc1df8['model'],_0xcc1df8[_0xc541('0x2e')]);_0x1f7f08[_0xc541('0x32')]=_[_0xc541('0x31')](_0xcc1df8[_0xc541('0x2d')],qs[_0xc541('0x33')](_0x5b1f24['query']['fields']));_0x1f7f08[_0xc541('0x32')]=_0x1f7f08['attributes'][_0xc541('0x34')]?_0x1f7f08[_0xc541('0x32')]:_0xcc1df8[_0xc541('0x2d')];if(!_0x5b1f24['query']['hasOwnProperty'](_0xc541('0x35'))){_0x1f7f08[_0xc541('0x1e')]=qs['limit'](_0x5b1f24[_0xc541('0x2e')][_0xc541('0x1e')]);_0x1f7f08[_0xc541('0x1c')]=qs[_0xc541('0x1c')](_0x5b1f24['query'][_0xc541('0x1c')]);}_0x1f7f08[_0xc541('0x36')]=qs['sort'](_0x5b1f24[_0xc541('0x2e')]['sort']);_0x1f7f08[_0xc541('0x37')]=qs[_0xc541('0x30')](_[_0xc541('0x38')](_0x5b1f24[_0xc541('0x2e')],_0xcc1df8[_0xc541('0x30')]),_0x45fb27);if(_0x5b1f24[_0xc541('0x2e')][_0xc541('0x39')]){_0x1f7f08[_0xc541('0x37')]=_[_0xc541('0x3a')](_0x1f7f08[_0xc541('0x37')],{'$or':_[_0xc541('0x2a')](_0x45fb27,function(_0x1f4b1a){if(_0x1f4b1a[_0xc541('0x3b')]!==_0xc541('0x3c')){var _0x1aedec={};_0x1aedec[_0x1f4b1a[_0xc541('0x27')]]={'$like':'%'+_0x5b1f24[_0xc541('0x2e')][_0xc541('0x39')]+'%'};return _0x1aedec;}})});}_0x1f7f08=_[_0xc541('0x3a')]({},_0x1f7f08,_0x5b1f24[_0xc541('0x3d')]);var _0x579d9a={'where':_0x1f7f08['where']};return db[_0xc541('0x2b')]['count'](_0x579d9a)['then'](function(_0x12aeea){_0x46717f['count']=_0x12aeea;if(_0x5b1f24[_0xc541('0x2e')]['includeAll']){_0x1f7f08[_0xc541('0x3e')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x1f7f08);})[_0xc541('0x25')](function(_0x75fdfe){_0x46717f[_0xc541('0x3f')]=_0x75fdfe;return _0x46717f;})[_0xc541('0x25')](respondWithFilteredResult(_0x134d35,_0x1f7f08))[_0xc541('0x40')](handleError(_0x134d35,null));};exports[_0xc541('0x41')]=function(_0x525f84,_0x5254d4){var _0x1d8b98={'raw':!![],'where':{'id':_0x525f84[_0xc541('0x42')]['id']}},_0x59a6cf={};_0x59a6cf[_0xc541('0x2d')]=_[_0xc541('0x2f')](db['VtigerField'][_0xc541('0x2c')]);_0x59a6cf['query']=_[_0xc541('0x2f')](_0x525f84['query']);_0x59a6cf['filters']=_[_0xc541('0x31')](_0x59a6cf[_0xc541('0x2d')],_0x59a6cf[_0xc541('0x2e')]);_0x1d8b98[_0xc541('0x32')]=_[_0xc541('0x31')](_0x59a6cf[_0xc541('0x2d')],qs[_0xc541('0x33')](_0x525f84[_0xc541('0x2e')][_0xc541('0x33')]));_0x1d8b98[_0xc541('0x32')]=_0x1d8b98[_0xc541('0x32')][_0xc541('0x34')]?_0x1d8b98[_0xc541('0x32')]:_0x59a6cf[_0xc541('0x2d')];if(_0x525f84[_0xc541('0x2e')][_0xc541('0x43')]){_0x1d8b98['include']=[{'all':!![]}];}_0x1d8b98=_[_0xc541('0x3a')]({},_0x1d8b98,_0x525f84[_0xc541('0x3d')]);return db[_0xc541('0x2b')][_0xc541('0x44')](_0x1d8b98)[_0xc541('0x25')](handleEntityNotFound(_0x5254d4,null))[_0xc541('0x25')](respondWithResult(_0x5254d4,null))[_0xc541('0x40')](handleError(_0x5254d4,null));};exports[_0xc541('0x45')]=function(_0xa2cf56,_0x42cdce){return db[_0xc541('0x2b')]['create'](_0xa2cf56[_0xc541('0x46')],{})[_0xc541('0x25')](respondWithResult(_0x42cdce,0xc9))['catch'](handleError(_0x42cdce,null));};exports[_0xc541('0x23')]=function(_0x5036f9,_0x42b3bc){if(_0x5036f9['body']['id']){delete _0x5036f9[_0xc541('0x46')]['id'];}return db[_0xc541('0x2b')][_0xc541('0x44')]({'where':{'id':_0x5036f9[_0xc541('0x42')]['id']}})[_0xc541('0x25')](handleEntityNotFound(_0x42b3bc,null))[_0xc541('0x25')](saveUpdates(_0x5036f9[_0xc541('0x46')],null))[_0xc541('0x25')](respondWithResult(_0x42b3bc,null))[_0xc541('0x40')](handleError(_0x42b3bc,null));};exports['destroy']=function(_0x2a3a8d,_0x509366){return db[_0xc541('0x2b')][_0xc541('0x44')]({'where':{'id':_0x2a3a8d[_0xc541('0x42')]['id']}})[_0xc541('0x25')](handleEntityNotFound(_0x509366,null))[_0xc541('0x25')](removeEntity(_0x509366,null))[_0xc541('0x40')](handleError(_0x509366,null));}; \ No newline at end of file +var _0x0dd5=['nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x1b146c,_0x5bd954){var _0x4c906d=function(_0x65c3f3){while(--_0x65c3f3){_0x1b146c['push'](_0x1b146c['shift']());}};_0x4c906d(++_0x5bd954);}(_0x0dd5,0xf4));var _0x50dd=function(_0x1b81ad,_0x337848){_0x1b81ad=_0x1b81ad-0x0;var _0x2bad0e=_0x0dd5[_0x1b81ad];return _0x2bad0e;};'use strict';var emlformat=require(_0x50dd('0x0'));var rimraf=require(_0x50dd('0x1'));var zipdir=require(_0x50dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50dd('0x3'));var moment=require(_0x50dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50dd('0x5'));var util=require(_0x50dd('0x6'));var path=require(_0x50dd('0x7'));var sox=require(_0x50dd('0x8'));var csv=require(_0x50dd('0x9'));var ejs=require(_0x50dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50dd('0xb'));var squel=require('squel');var crypto=require(_0x50dd('0xc'));var jsforce=require(_0x50dd('0xd'));var deskjs=require(_0x50dd('0xe'));var toCsv=require(_0x50dd('0x9'));var querystring=require('querystring');var Papa=require(_0x50dd('0xf'));var Redis=require(_0x50dd('0x10'));var authService=require(_0x50dd('0x11'));var qs=require(_0x50dd('0x12'));var as=require(_0x50dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x50dd('0x14'))(_0x50dd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x50dd('0x16'));var db=require(_0x50dd('0x17'))['db'];function respondWithStatusCode(_0x42bb59,_0x28fbbb){_0x28fbbb=_0x28fbbb||0xcc;return function(_0x232c2d){if(_0x232c2d){return _0x42bb59['sendStatus'](_0x28fbbb);}return _0x42bb59['status'](_0x28fbbb)[_0x50dd('0x18')]();};}function respondWithResult(_0x229ff9,_0x28b362){_0x28b362=_0x28b362||0xc8;return function(_0x4238cc){if(_0x4238cc){return _0x229ff9['status'](_0x28b362)[_0x50dd('0x19')](_0x4238cc);}};}function respondWithFilteredResult(_0x28bdb4,_0x24a8a1){return function(_0x175ae7){if(_0x175ae7){var _0x145c91=typeof _0x24a8a1[_0x50dd('0x1a')]==='undefined'&&typeof _0x24a8a1[_0x50dd('0x1b')]==='undefined';var _0x101f99=_0x175ae7['count'];var _0x293162=_0x145c91?0x0:_0x24a8a1['offset'];var _0x474c4f=_0x145c91?_0x175ae7['count']:_0x24a8a1['offset']+_0x24a8a1['limit'];var _0x19cd72;if(_0x474c4f>=_0x101f99){_0x474c4f=_0x101f99;_0x19cd72=0xc8;}else{_0x19cd72=0xce;}_0x28bdb4['status'](_0x19cd72);return _0x28bdb4[_0x50dd('0x1c')](_0x50dd('0x1d'),_0x293162+'-'+_0x474c4f+'/'+_0x101f99)[_0x50dd('0x19')](_0x175ae7);}return null;};}function patchUpdates(_0x474d85){return function(_0x407b43){try{jsonpatch[_0x50dd('0x1e')](_0x407b43,_0x474d85,!![]);}catch(_0xfd238a){return BPromise[_0x50dd('0x1f')](_0xfd238a);}return _0x407b43[_0x50dd('0x20')]();};}function saveUpdates(_0x42d261,_0x453ffa){return function(_0x37c332){if(_0x37c332){return _0x37c332['update'](_0x42d261)[_0x50dd('0x21')](function(_0x19508f){return _0x19508f;});}return null;};}function removeEntity(_0x3e819a,_0xf0ee7f){return function(_0x288664){if(_0x288664){return _0x288664[_0x50dd('0x22')]()[_0x50dd('0x21')](function(){_0x3e819a['status'](0xcc)[_0x50dd('0x18')]();});}};}function handleEntityNotFound(_0x50a4a7,_0x9c70ce){return function(_0x160a5d){if(!_0x160a5d){_0x50a4a7[_0x50dd('0x23')](0x194);}return _0x160a5d;};}function handleError(_0x37063e,_0x59f920){_0x59f920=_0x59f920||0x1f4;return function(_0x363f5d){logger[_0x50dd('0x24')](_0x363f5d[_0x50dd('0x25')]);if(_0x363f5d['name']){delete _0x363f5d[_0x50dd('0x26')];}_0x37063e['status'](_0x59f920)[_0x50dd('0x27')](_0x363f5d);};}exports[_0x50dd('0x28')]=function(_0x4ab0eb,_0x15c868){var _0x1a5609={},_0x2b7337={},_0x3f19be={'count':0x0,'rows':[]};var _0xcf3776=_[_0x50dd('0x29')](db[_0x50dd('0x2a')][_0x50dd('0x2b')],function(_0x2d0dfd){return{'name':_0x2d0dfd[_0x50dd('0x2c')],'type':_0x2d0dfd[_0x50dd('0x2d')][_0x50dd('0x2e')]};});_0x2b7337[_0x50dd('0x2f')]=_[_0x50dd('0x29')](_0xcf3776,_0x50dd('0x26'));_0x2b7337[_0x50dd('0x30')]=_[_0x50dd('0x31')](_0x4ab0eb[_0x50dd('0x30')]);_0x2b7337[_0x50dd('0x32')]=_[_0x50dd('0x33')](_0x2b7337[_0x50dd('0x2f')],_0x2b7337['query']);_0x1a5609['attributes']=_[_0x50dd('0x33')](_0x2b7337[_0x50dd('0x2f')],qs[_0x50dd('0x34')](_0x4ab0eb[_0x50dd('0x30')][_0x50dd('0x34')]));_0x1a5609['attributes']=_0x1a5609[_0x50dd('0x35')][_0x50dd('0x36')]?_0x1a5609[_0x50dd('0x35')]:_0x2b7337[_0x50dd('0x2f')];if(!_0x4ab0eb[_0x50dd('0x30')][_0x50dd('0x37')](_0x50dd('0x38'))){_0x1a5609[_0x50dd('0x1b')]=qs[_0x50dd('0x1b')](_0x4ab0eb['query'][_0x50dd('0x1b')]);_0x1a5609['offset']=qs[_0x50dd('0x1a')](_0x4ab0eb[_0x50dd('0x30')][_0x50dd('0x1a')]);}_0x1a5609['order']=qs[_0x50dd('0x39')](_0x4ab0eb['query'][_0x50dd('0x39')]);_0x1a5609['where']=qs[_0x50dd('0x32')](_[_0x50dd('0x3a')](_0x4ab0eb['query'],_0x2b7337[_0x50dd('0x32')]),_0xcf3776);if(_0x4ab0eb[_0x50dd('0x30')][_0x50dd('0x3b')]){_0x1a5609[_0x50dd('0x3c')]=_[_0x50dd('0x3d')](_0x1a5609[_0x50dd('0x3c')],{'$or':_[_0x50dd('0x29')](_0xcf3776,function(_0xdb7a55){if(_0xdb7a55[_0x50dd('0x2d')]!==_0x50dd('0x3e')){var _0x153c96={};_0x153c96[_0xdb7a55[_0x50dd('0x26')]]={'$like':'%'+_0x4ab0eb[_0x50dd('0x30')]['filter']+'%'};return _0x153c96;}})});}_0x1a5609=_[_0x50dd('0x3d')]({},_0x1a5609,_0x4ab0eb[_0x50dd('0x3f')]);var _0x50da10={'where':_0x1a5609['where']};return db[_0x50dd('0x2a')][_0x50dd('0x40')](_0x50da10)[_0x50dd('0x21')](function(_0x950266){_0x3f19be[_0x50dd('0x40')]=_0x950266;if(_0x4ab0eb[_0x50dd('0x30')][_0x50dd('0x41')]){_0x1a5609[_0x50dd('0x42')]=[{'all':!![]}];}return db['VtigerField'][_0x50dd('0x43')](_0x1a5609);})['then'](function(_0x301bb6){_0x3f19be[_0x50dd('0x44')]=_0x301bb6;return _0x3f19be;})[_0x50dd('0x21')](respondWithFilteredResult(_0x15c868,_0x1a5609))[_0x50dd('0x45')](handleError(_0x15c868,null));};exports[_0x50dd('0x46')]=function(_0x5b7c40,_0x3b74fc){var _0x5df769={'raw':!![],'where':{'id':_0x5b7c40[_0x50dd('0x47')]['id']}},_0x3802c7={};_0x3802c7[_0x50dd('0x2f')]=_[_0x50dd('0x31')](db['VtigerField'][_0x50dd('0x2b')]);_0x3802c7[_0x50dd('0x30')]=_[_0x50dd('0x31')](_0x5b7c40[_0x50dd('0x30')]);_0x3802c7[_0x50dd('0x32')]=_[_0x50dd('0x33')](_0x3802c7[_0x50dd('0x2f')],_0x3802c7[_0x50dd('0x30')]);_0x5df769[_0x50dd('0x35')]=_[_0x50dd('0x33')](_0x3802c7[_0x50dd('0x2f')],qs['fields'](_0x5b7c40[_0x50dd('0x30')]['fields']));_0x5df769[_0x50dd('0x35')]=_0x5df769[_0x50dd('0x35')][_0x50dd('0x36')]?_0x5df769[_0x50dd('0x35')]:_0x3802c7['model'];if(_0x5b7c40[_0x50dd('0x30')][_0x50dd('0x41')]){_0x5df769[_0x50dd('0x42')]=[{'all':!![]}];}_0x5df769=_[_0x50dd('0x3d')]({},_0x5df769,_0x5b7c40['options']);return db[_0x50dd('0x2a')][_0x50dd('0x48')](_0x5df769)[_0x50dd('0x21')](handleEntityNotFound(_0x3b74fc,null))['then'](respondWithResult(_0x3b74fc,null))['catch'](handleError(_0x3b74fc,null));};exports[_0x50dd('0x49')]=function(_0x150275,_0xb802cf){return db[_0x50dd('0x2a')][_0x50dd('0x49')](_0x150275[_0x50dd('0x4a')],{})[_0x50dd('0x21')](respondWithResult(_0xb802cf,0xc9))[_0x50dd('0x45')](handleError(_0xb802cf,null));};exports['update']=function(_0x268a1a,_0x40f49f){if(_0x268a1a[_0x50dd('0x4a')]['id']){delete _0x268a1a[_0x50dd('0x4a')]['id'];}return db[_0x50dd('0x2a')][_0x50dd('0x48')]({'where':{'id':_0x268a1a[_0x50dd('0x47')]['id']}})[_0x50dd('0x21')](handleEntityNotFound(_0x40f49f,null))[_0x50dd('0x21')](saveUpdates(_0x268a1a[_0x50dd('0x4a')],null))[_0x50dd('0x21')](respondWithResult(_0x40f49f,null))[_0x50dd('0x45')](handleError(_0x40f49f,null));};exports[_0x50dd('0x22')]=function(_0xdbfc45,_0x5992af){return db[_0x50dd('0x2a')][_0x50dd('0x48')]({'where':{'id':_0xdbfc45[_0x50dd('0x47')]['id']}})[_0x50dd('0x21')](handleEntityNotFound(_0x5992af,null))[_0x50dd('0x21')](removeEntity(_0x5992af,null))['catch'](handleError(_0x5992af,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 55c5504..b5e7f1e 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 _0x1d62=['bluebird','request-promise','exports','define','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x2f3c4d,_0x5736ee){var _0x496734=function(_0x472217){while(--_0x472217){_0x2f3c4d['push'](_0x2f3c4d['shift']());}};_0x496734(++_0x5736ee);}(_0x1d62,0x1a8));var _0x21d6=function(_0x5abcbe,_0x222f97){_0x5abcbe=_0x5abcbe-0x0;var _0xa9bc44=_0x1d62[_0x5abcbe];return _0xa9bc44;};'use strict';var _=require(_0x21d6('0x0'));var util=require(_0x21d6('0x1'));var logger=require(_0x21d6('0x2'))(_0x21d6('0x3'));var moment=require(_0x21d6('0x4'));var BPromise=require(_0x21d6('0x5'));var rp=require(_0x21d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x21d6('0x7')]=function(_0x1cadd5,_0x3b3eb7){return _0x1cadd5[_0x21d6('0x8')](_0x21d6('0x9'),attributes,{'tableName':_0x21d6('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x21d6('0xb'),_0x21d6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x834f=['idField','FieldId','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x834f,0xc6));var _0xf834=function(_0x5d3f1e,_0x11c046){_0x5d3f1e=_0x5d3f1e-0x0;var _0x32bb72=_0x834f[_0x5d3f1e];return _0x32bb72;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf834('0x0'))(_0xf834('0x1'));var moment=require(_0xf834('0x2'));var BPromise=require('bluebird');var rp=require(_0xf834('0x3'));var fs=require('fs');var path=require(_0xf834('0x4'));var rimraf=require(_0xf834('0x5'));var config=require(_0xf834('0x6'));var attributes=require(_0xf834('0x7'));module[_0xf834('0x8')]=function(_0x12d69d,_0x20aa6e){return _0x12d69d['define'](_0xf834('0x9'),attributes,{'tableName':_0xf834('0xa'),'paranoid':![],'indexes':[{'name':_0xf834('0xb'),'fields':[_0xf834('0xc'),_0xf834('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 444eb6e..cd84515 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 _0x83a1=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x113696,_0x1843cc){var _0x1fb234=function(_0x5f1185){while(--_0x5f1185){_0x113696['push'](_0x113696['shift']());}};_0x1fb234(++_0x1843cc);}(_0x83a1,0x11f));var _0x183a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x83a1[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x183a('0x0'));var util=require('util');var moment=require(_0x183a('0x1'));var BPromise=require(_0x183a('0x2'));var rs=require(_0x183a('0x3'));var fs=require('fs');var Redis=require(_0x183a('0x4'));var db=require(_0x183a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x183a('0x6'))(_0x183a('0x7'));var config=require(_0x183a('0x8'));var jayson=require(_0x183a('0x9'));var client=jayson[_0x183a('0xa')][_0x183a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3dc753,_0x17ad8a,_0x575a49){return new BPromise(function(_0x5d821e,_0x290271){return client[_0x183a('0xc')](_0x3dc753,_0x575a49)[_0x183a('0xd')](function(_0xab2dd1){logger['info'](_0x183a('0xe'),_0x17ad8a,'request\x20sent');logger[_0x183a('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x17ad8a,_0x183a('0x10'),JSON[_0x183a('0x11')](_0xab2dd1));if(_0xab2dd1[_0x183a('0x12')]){if(_0xab2dd1[_0x183a('0x12')][_0x183a('0x13')]===0x1f4){logger['error'](_0x183a('0xe'),_0x17ad8a,_0xab2dd1[_0x183a('0x12')]['message']);return _0x290271(_0xab2dd1[_0x183a('0x12')][_0x183a('0x14')]);}logger[_0x183a('0x12')]('VtigerField,\x20%s,\x20%s',_0x17ad8a,_0xab2dd1[_0x183a('0x12')]['message']);return _0x5d821e(_0xab2dd1['error'][_0x183a('0x14')]);}else{logger[_0x183a('0x15')]('VtigerField,\x20%s,\x20%s',_0x17ad8a,'request\x20sent');_0x5d821e(_0xab2dd1[_0x183a('0x16')][_0x183a('0x14')]);}})[_0x183a('0x17')](function(_0xb871e0){logger[_0x183a('0x12')](_0x183a('0xe'),_0x17ad8a,_0xb871e0);_0x290271(_0xb871e0);});});} \ No newline at end of file +var _0xdeb5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x470943,_0x423600){var _0x32dc64=function(_0x8e7f87){while(--_0x8e7f87){_0x470943['push'](_0x470943['shift']());}};_0x32dc64(++_0x423600);}(_0xdeb5,0x107));var _0x5deb=function(_0x5a8007,_0x230d09){_0x5a8007=_0x5a8007-0x0;var _0x5d3a3a=_0xdeb5[_0x5a8007];return _0x5d3a3a;};'use strict';var _=require(_0x5deb('0x0'));var util=require(_0x5deb('0x1'));var moment=require(_0x5deb('0x2'));var BPromise=require(_0x5deb('0x3'));var rs=require(_0x5deb('0x4'));var fs=require('fs');var Redis=require(_0x5deb('0x5'));var db=require(_0x5deb('0x6'))['db'];var utils=require(_0x5deb('0x7'));var logger=require(_0x5deb('0x8'))(_0x5deb('0x9'));var config=require(_0x5deb('0xa'));var jayson=require(_0x5deb('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x488247,_0x25cf1e,_0x38aa5d){return new BPromise(function(_0xff9a1b,_0x2aa18a){return client[_0x5deb('0xc')](_0x488247,_0x38aa5d)[_0x5deb('0xd')](function(_0x51a2a3){logger[_0x5deb('0xe')](_0x5deb('0xf'),_0x25cf1e,'request\x20sent');logger[_0x5deb('0x10')](_0x5deb('0x11'),_0x25cf1e,_0x5deb('0x12'),JSON['stringify'](_0x51a2a3));if(_0x51a2a3[_0x5deb('0x13')]){if(_0x51a2a3['error'][_0x5deb('0x14')]===0x1f4){logger[_0x5deb('0x13')](_0x5deb('0xf'),_0x25cf1e,_0x51a2a3['error'][_0x5deb('0x15')]);return _0x2aa18a(_0x51a2a3[_0x5deb('0x13')][_0x5deb('0x15')]);}logger[_0x5deb('0x13')](_0x5deb('0xf'),_0x25cf1e,_0x51a2a3[_0x5deb('0x13')]['message']);return _0xff9a1b(_0x51a2a3[_0x5deb('0x13')][_0x5deb('0x15')]);}else{logger[_0x5deb('0xe')](_0x5deb('0xf'),_0x25cf1e,_0x5deb('0x12'));_0xff9a1b(_0x51a2a3[_0x5deb('0x16')][_0x5deb('0x15')]);}})[_0x5deb('0x17')](function(_0x3d92c8){logger[_0x5deb('0x13')](_0x5deb('0xf'),_0x25cf1e,_0x3d92c8);_0x2aa18a(_0x3d92c8);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 26965fb..a1f812f 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 _0x1b1f=['post','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x1b1f,0xed));var _0xf1b1=function(_0x5f2349,_0x551a0d){_0x5f2349=_0x5f2349-0x0;var _0x50bc34=_0x1b1f[_0x5f2349];return _0x50bc34;};'use strict';var multer=require(_0xf1b1('0x0'));var util=require(_0xf1b1('0x1'));var path=require(_0xf1b1('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1b1('0x3'));var router=express[_0xf1b1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf1b1('0x5'));var config=require(_0xf1b1('0x6'));var controller=require(_0xf1b1('0x7'));router[_0xf1b1('0x8')]('/',auth[_0xf1b1('0x9')](),controller[_0xf1b1('0xa')]);router[_0xf1b1('0x8')](_0xf1b1('0xb'),auth[_0xf1b1('0x9')](),controller[_0xf1b1('0xc')]);router[_0xf1b1('0x8')]('/:id/configurations',auth[_0xf1b1('0x9')](),controller[_0xf1b1('0xd')]);router[_0xf1b1('0x8')](_0xf1b1('0xe'),auth[_0xf1b1('0x9')](),controller[_0xf1b1('0xf')]);router[_0xf1b1('0x10')]('/',auth[_0xf1b1('0x9')](),controller['create']);router['post'](_0xf1b1('0x11'),auth[_0xf1b1('0x9')](),controller['addConfiguration']);router[_0xf1b1('0x12')]('/:id',auth[_0xf1b1('0x9')](),controller[_0xf1b1('0x13')]);router[_0xf1b1('0x14')](_0xf1b1('0xb'),auth[_0xf1b1('0x9')](),controller[_0xf1b1('0x15')]);module[_0xf1b1('0x16')]=router; \ No newline at end of file +var _0x6e73=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0x6e73,0x1d1));var _0x36e7=function(_0x473033,_0x1e7804){_0x473033=_0x473033-0x0;var _0x2bdbfb=_0x6e73[_0x473033];return _0x2bdbfb;};'use strict';var multer=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var path=require('path');var timeout=require(_0x36e7('0x2'));var express=require(_0x36e7('0x3'));var router=express['Router']();var fs_extra=require(_0x36e7('0x4'));var auth=require(_0x36e7('0x5'));var interaction=require(_0x36e7('0x6'));var config=require('../../config/environment');var controller=require(_0x36e7('0x7'));router[_0x36e7('0x8')]('/',auth[_0x36e7('0x9')](),controller['index']);router[_0x36e7('0x8')](_0x36e7('0xa'),auth['isAuthenticated'](),controller[_0x36e7('0xb')]);router[_0x36e7('0x8')](_0x36e7('0xc'),auth[_0x36e7('0x9')](),controller['getConfigurations']);router[_0x36e7('0x8')](_0x36e7('0xd'),auth[_0x36e7('0x9')](),controller['getFields']);router[_0x36e7('0xe')]('/',auth['isAuthenticated'](),controller[_0x36e7('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x36e7('0x10')]);router[_0x36e7('0x11')]('/:id',auth[_0x36e7('0x9')](),controller['update']);router[_0x36e7('0x12')]('/:id',auth[_0x36e7('0x9')](),controller[_0x36e7('0x13')]);module[_0x36e7('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 44db8aa..8f97996 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 _0x3d49=['integrationTab','exports','STRING','remoteUri','ENUM','password'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3d49,0x151));var _0x93d4=function(_0x4bb593,_0x272ed0){_0x4bb593=_0x4bb593-0x0;var _0x2da2d8=_0x3d49[_0x4bb593];return _0x2da2d8;};'use strict';var Sequelize=require('sequelize');module[_0x93d4('0x0')]={'name':{'type':Sequelize[_0x93d4('0x1')]},'description':{'type':Sequelize[_0x93d4('0x1')]},'username':{'type':Sequelize[_0x93d4('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x93d4('0x1')]},'token':{'type':Sequelize[_0x93d4('0x1')]},'remoteUri':{'type':Sequelize[_0x93d4('0x1')],'unique':_0x93d4('0x2')},'authType':{'type':Sequelize[_0x93d4('0x3')](_0x93d4('0x4'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x93d4('0x5')}}; \ No newline at end of file +var _0xaf5a=['username','ENUM','password','token','integrationTab','newTab','exports','STRING'];(function(_0x3eadea,_0x3a8528){var _0x302f5f=function(_0x36831e){while(--_0x36831e){_0x3eadea['push'](_0x3eadea['shift']());}};_0x302f5f(++_0x3a8528);}(_0xaf5a,0x116));var _0xaaf5=function(_0x3cafb8,_0x32860e){_0x3cafb8=_0x3cafb8-0x0;var _0x4b7f85=_0xaf5a[_0x3cafb8];return _0x4b7f85;};'use strict';var Sequelize=require('sequelize');module[_0xaaf5('0x0')]={'name':{'type':Sequelize[_0xaaf5('0x1')]},'description':{'type':Sequelize[_0xaaf5('0x1')]},'username':{'type':Sequelize[_0xaaf5('0x1')],'unique':_0xaaf5('0x2')},'password':{'type':Sequelize[_0xaaf5('0x1')]},'token':{'type':Sequelize[_0xaaf5('0x1')]},'remoteUri':{'type':Sequelize[_0xaaf5('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xaaf5('0x3')](_0xaaf5('0x4'),_0xaaf5('0x5')),'defaultValue':_0xaaf5('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xaaf5('0x6'),_0xaaf5('0x7')),'defaultValue':_0xaaf5('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 1734e67..c6bce9c 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 _0xc788=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys'];(function(_0x1d769d,_0xce3419){var _0x4b3168=function(_0x305523){while(--_0x305523){_0x1d769d['push'](_0x1d769d['shift']());}};_0x4b3168(++_0xce3419);}(_0xc788,0xc4));var _0x8c78=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xc788[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['ZendeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['ZendeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['ZendeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58'),_0x8c78('0x59'),'authType',_0x8c78('0x5a')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x5e6a23){if(_0x5e6a23){_0x3c6886=_0x5e6a23[_0x8c78('0x5a')];var _0x4dbb47=_0x3c6886[_0x8c78('0x5b')](-0x1);if(_0x4dbb47==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x5c')](0x0,_0x3c6886[_0x8c78('0x5d')](_0x4dbb47));}var _0x476835={'method':_0x8c78('0x5e'),'uri':util[_0x8c78('0x5f')]('%s/%s',_0x3c6886,'ticket_fields'),'json':!![]};switch(_0x5e6a23[_0x8c78('0x60')]){case _0x8c78('0x58'):_0x476835[_0x8c78('0x61')]={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x63'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x58')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;case _0x8c78('0x59'):_0x476835['headers']={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x66'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x59')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;default:throw new db[(_0x8c78('0x67'))][(_0x8c78('0x68'))](_0x8c78('0x69'));}return rp(_0x476835);}})[_0x8c78('0x25')](function(_0x402cff){if(_0x402cff){var _0x280a8b=[_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x6d')];_[_0x8c78('0x6e')](_0x402cff[_0x8c78('0x6f')],function(_0x4c6cc5){return _0x280a8b[_0x8c78('0x70')](_0x4c6cc5['type']);});return{'count':_0x402cff['ticket_fields'][_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x402cff[_0x8c78('0x6f')],function(_0x3b3c51){return{'id':_0x3b3c51['id'],'name':_0x3b3c51['position']>0x7?_0x3b3c51[_0x8c78('0x71')]:_0x3b3c51[_0x8c78('0x2f')],'custom':_0x3b3c51[_0x8c78('0x72')]>0x7?!![]:![],'options':_0x3b3c51['system_field_options']?_0x3b3c51[_0x8c78('0x73')]:_0x3b3c51[_0x8c78('0x74')]?_0x3b3c51[_0x8c78('0x74')]:[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))['catch'](function(_0xfff9a5){var _0x837c68=_0x5646ff['query']['test']?0x1f4:_0xfff9a5['statusCode']||0x1f4;logger[_0x8c78('0x75')](_0x8c78('0x76'),_0x8c78('0x56'),_0x837c68,JSON[_0x8c78('0x77')](_0xfff9a5));delete _0xfff9a5['name'];if(_0x837c68===0x191){_0x837c68=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x837c68)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x78')]?{'message':_0x8c78('0x79'),'statusCode':_0xfff9a5[_0x8c78('0x7a')]}:_0xfff9a5);});}; \ No newline at end of file +var _0x0bb5=['offset','limit','undefined','count','set','json','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','authType','remoteUri','substring','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x32977f,_0x182aee){var _0x484185=function(_0x196077){while(--_0x196077){_0x32977f['push'](_0x32977f['shift']());}};_0x484185(++_0x182aee);}(_0x0bb5,0x148));var _0x50bb=function(_0x432a8a,_0x4eb36f){_0x432a8a=_0x432a8a-0x0;var _0x352d1b=_0x0bb5[_0x432a8a];return _0x352d1b;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x50bb('0x19'));function respondWithStatusCode(_0x58837d,_0x283f04){_0x283f04=_0x283f04||0xcc;return function(_0xd8ab27){if(_0xd8ab27){return _0x58837d[_0x50bb('0x1a')](_0x283f04);}return _0x58837d['status'](_0x283f04)[_0x50bb('0x1b')]();};}function respondWithResult(_0x309986,_0x3094f2){_0x3094f2=_0x3094f2||0xc8;return function(_0x5244b0){if(_0x5244b0){return _0x309986[_0x50bb('0x1c')](_0x3094f2)['json'](_0x5244b0);}};}function respondWithFilteredResult(_0x21befa,_0x3e1a51){return function(_0x253073){if(_0x253073){var _0x42ffab=typeof _0x3e1a51[_0x50bb('0x1d')]==='undefined'&&typeof _0x3e1a51[_0x50bb('0x1e')]===_0x50bb('0x1f');var _0x4b1f5f=_0x253073[_0x50bb('0x20')];var _0x4796ec=_0x42ffab?0x0:_0x3e1a51[_0x50bb('0x1d')];var _0x431ed4=_0x42ffab?_0x253073['count']:_0x3e1a51['offset']+_0x3e1a51[_0x50bb('0x1e')];var _0x1499dc;if(_0x431ed4>=_0x4b1f5f){_0x431ed4=_0x4b1f5f;_0x1499dc=0xc8;}else{_0x1499dc=0xce;}_0x21befa[_0x50bb('0x1c')](_0x1499dc);return _0x21befa[_0x50bb('0x21')]('Content-Range',_0x4796ec+'-'+_0x431ed4+'/'+_0x4b1f5f)[_0x50bb('0x22')](_0x253073);}return null;};}function patchUpdates(_0x32bfc3){return function(_0x4020a0){try{jsonpatch['apply'](_0x4020a0,_0x32bfc3,!![]);}catch(_0x3104c8){return BPromise[_0x50bb('0x23')](_0x3104c8);}return _0x4020a0[_0x50bb('0x24')]();};}function saveUpdates(_0x4825f8,_0x1dbba2){return function(_0x4cc7f9){if(_0x4cc7f9){return _0x4cc7f9[_0x50bb('0x25')](_0x4825f8)[_0x50bb('0x26')](function(_0x1a2a0b){return _0x1a2a0b;});}return null;};}function removeEntity(_0x2ee87a,_0x846311){return function(_0x342078){if(_0x342078){return _0x342078['destroy']()[_0x50bb('0x26')](function(){_0x2ee87a[_0x50bb('0x1c')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x3462c1,_0x5234d7){return function(_0x75fea6){if(!_0x75fea6){_0x3462c1['sendStatus'](0x194);}return _0x75fea6;};}function handleError(_0x55e87b,_0x2befd9){_0x2befd9=_0x2befd9||0x1f4;return function(_0x491632){logger['error'](_0x491632[_0x50bb('0x27')]);if(_0x491632[_0x50bb('0x28')]){delete _0x491632[_0x50bb('0x28')];}_0x55e87b[_0x50bb('0x1c')](_0x2befd9)[_0x50bb('0x29')](_0x491632);};}exports[_0x50bb('0x2a')]=function(_0x41a8ad,_0x41d479){var _0x4f7514={},_0x44ce86={},_0x461cf3={'count':0x0,'rows':[]};var _0x15ee2e=_[_0x50bb('0x2b')](db['ZendeskAccount'][_0x50bb('0x2c')],function(_0x1a62fb){return{'name':_0x1a62fb[_0x50bb('0x2d')],'type':_0x1a62fb[_0x50bb('0x2e')][_0x50bb('0x2f')]};});_0x44ce86[_0x50bb('0x30')]=_[_0x50bb('0x2b')](_0x15ee2e,_0x50bb('0x28'));_0x44ce86[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x41a8ad[_0x50bb('0x31')]);_0x44ce86[_0x50bb('0x33')]=_['intersection'](_0x44ce86[_0x50bb('0x30')],_0x44ce86[_0x50bb('0x31')]);_0x4f7514[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x44ce86[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x36')]));_0x4f7514[_0x50bb('0x34')]=_0x4f7514[_0x50bb('0x34')][_0x50bb('0x37')]?_0x4f7514['attributes']:_0x44ce86[_0x50bb('0x30')];if(!_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x38')](_0x50bb('0x39'))){_0x4f7514[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x41a8ad['query']['limit']);_0x4f7514[_0x50bb('0x1d')]=qs['offset'](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x1d')]);}_0x4f7514[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x41a8ad[_0x50bb('0x31')]['sort']);_0x4f7514[_0x50bb('0x3c')]=qs['filters'](_[_0x50bb('0x3d')](_0x41a8ad[_0x50bb('0x31')],_0x44ce86[_0x50bb('0x33')]),_0x15ee2e);if(_0x41a8ad['query']['filter']){_0x4f7514[_0x50bb('0x3c')]=_[_0x50bb('0x3e')](_0x4f7514[_0x50bb('0x3c')],{'$or':_[_0x50bb('0x2b')](_0x15ee2e,function(_0x51750b){if(_0x51750b[_0x50bb('0x2e')]!=='VIRTUAL'){var _0x52059b={};_0x52059b[_0x51750b[_0x50bb('0x28')]]={'$like':'%'+_0x41a8ad['query'][_0x50bb('0x3f')]+'%'};return _0x52059b;}})});}_0x4f7514=_[_0x50bb('0x3e')]({},_0x4f7514,_0x41a8ad[_0x50bb('0x40')]);var _0x1f156e={'where':_0x4f7514[_0x50bb('0x3c')]};return db[_0x50bb('0x41')][_0x50bb('0x20')](_0x1f156e)[_0x50bb('0x26')](function(_0x46039a){_0x461cf3[_0x50bb('0x20')]=_0x46039a;if(_0x41a8ad['query']['includeAll']){_0x4f7514[_0x50bb('0x42')]=[{'all':!![]}];}return db[_0x50bb('0x41')][_0x50bb('0x43')](_0x4f7514);})[_0x50bb('0x26')](function(_0x5e8085){_0x461cf3[_0x50bb('0x44')]=_0x5e8085;return _0x461cf3;})['then'](respondWithFilteredResult(_0x41d479,_0x4f7514))[_0x50bb('0x45')](handleError(_0x41d479,null));};exports[_0x50bb('0x46')]=function(_0x379944,_0x40748d){var _0x1c438b={'raw':![],'where':{'id':_0x379944[_0x50bb('0x47')]['id']}},_0x355726={};_0x355726[_0x50bb('0x30')]=_[_0x50bb('0x32')](db[_0x50bb('0x41')][_0x50bb('0x2c')]);_0x355726[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x379944[_0x50bb('0x31')]);_0x355726[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x355726['model'],_0x355726[_0x50bb('0x31')]);_0x1c438b['attributes']=_[_0x50bb('0x35')](_0x355726[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x379944[_0x50bb('0x31')][_0x50bb('0x36')]));_0x1c438b[_0x50bb('0x34')]=_0x1c438b[_0x50bb('0x34')][_0x50bb('0x37')]?_0x1c438b[_0x50bb('0x34')]:_0x355726[_0x50bb('0x30')];if(_0x379944[_0x50bb('0x31')][_0x50bb('0x48')]){_0x1c438b[_0x50bb('0x42')]=[{'all':!![]}];}_0x1c438b=_[_0x50bb('0x3e')]({},_0x1c438b,_0x379944['options']);return db[_0x50bb('0x41')]['find'](_0x1c438b)[_0x50bb('0x26')](handleEntityNotFound(_0x40748d,null))[_0x50bb('0x26')](respondWithResult(_0x40748d,null))[_0x50bb('0x45')](handleError(_0x40748d,null));};exports[_0x50bb('0x49')]=function(_0x650e91,_0x39ac1a){return db[_0x50bb('0x41')][_0x50bb('0x49')](_0x650e91['body'],{})[_0x50bb('0x26')](respondWithResult(_0x39ac1a,0xc9))[_0x50bb('0x45')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x25')]=function(_0x13afe2,_0x3659c4){if(_0x13afe2['body']['id']){delete _0x13afe2[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x13afe2[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3659c4,null))['then'](saveUpdates(_0x13afe2['body'],null))[_0x50bb('0x26')](respondWithResult(_0x3659c4,null))['catch'](handleError(_0x3659c4,null));};exports[_0x50bb('0x4c')]=function(_0x57ee0e,_0x4316e4){return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x57ee0e['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x4316e4,null))[_0x50bb('0x26')](removeEntity(_0x4316e4,null))['catch'](handleError(_0x4316e4,null));};exports[_0x50bb('0x4d')]=function(_0x1dff6a,_0x8d62af,_0x3c525c){var _0x55a4a6={};var _0x33e71f={};var _0x46b51e;var _0x2e0032;return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x1dff6a['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x8d62af,null))['then'](function(_0x38a775){if(_0x38a775){_0x46b51e=_0x38a775;_0x33e71f['model']=_['keys'](db[_0x50bb('0x4f')]['rawAttributes']);_0x33e71f['query']=_[_0x50bb('0x32')](_0x1dff6a[_0x50bb('0x31')]);_0x33e71f[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x33e71f[_0x50bb('0x30')],_0x33e71f[_0x50bb('0x31')]);_0x55a4a6[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x33e71f['model'],qs['fields'](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x36')]));_0x55a4a6[_0x50bb('0x34')]=_0x55a4a6[_0x50bb('0x34')][_0x50bb('0x37')]?_0x55a4a6[_0x50bb('0x34')]:_0x33e71f[_0x50bb('0x30')];_0x55a4a6['order']=qs[_0x50bb('0x3b')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3b')]);_0x55a4a6[_0x50bb('0x3c')]=qs[_0x50bb('0x33')](_['pick'](_0x1dff6a[_0x50bb('0x31')],_0x33e71f[_0x50bb('0x33')]));if(_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]){_0x55a4a6[_0x50bb('0x3c')]=_['merge'](_0x55a4a6[_0x50bb('0x3c')],{'$or':_['map'](_0x55a4a6['attributes'],function(_0x170761){var _0x3057f2={};_0x3057f2[_0x170761]={'$like':'%'+_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]+'%'};return _0x3057f2;})});}_0x55a4a6=_[_0x50bb('0x3e')]({},_0x55a4a6,_0x1dff6a[_0x50bb('0x40')]);return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x330299){if(_0x330299){_0x2e0032=_0x330299[_0x50bb('0x37')];if(!_0x1dff6a[_0x50bb('0x31')]['hasOwnProperty'](_0x50bb('0x39'))){_0x55a4a6['limit']=qs[_0x50bb('0x1e')](_0x1dff6a[_0x50bb('0x31')]['limit']);_0x55a4a6[_0x50bb('0x1d')]=qs[_0x50bb('0x1d')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x1d')]);}return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x2b7df6){if(_0x2b7df6){return _0x2b7df6?{'count':_0x2e0032,'rows':_0x2b7df6}:null;}})[_0x50bb('0x26')](respondWithResult(_0x8d62af,null))['catch'](handleError(_0x8d62af,null));};exports[_0x50bb('0x50')]=function(_0x2dc832,_0x3b17c8,_0x4a226d){if(_0x2dc832[_0x50bb('0x4a')]['id']){delete _0x2dc832[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x2dc832[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3b17c8,null))['then'](function(_0xf47641){if(_0xf47641){_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x51')]=_0xf47641['id'];_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x52')]=integrations[_0x50bb('0x53')](_0x2dc832['body'][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x2e')]);_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x55')]=integrations[_0x50bb('0x56')](_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')]['type']);return db[_0x50bb('0x4f')][_0x50bb('0x49')](_0x2dc832[_0x50bb('0x4a')],{'include':[{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x52')},{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x55')}]});}return null;})[_0x50bb('0x26')](respondWithResult(_0x3b17c8,null))[_0x50bb('0x45')](handleError(_0x3b17c8,null));};exports['getFields']=function(_0x58ad41,_0x5babbc,_0x4159ad){var _0x5ba597='';return db['ZendeskAccount'][_0x50bb('0x4e')]({'where':{'id':_0x58ad41[_0x50bb('0x47')]['id']},'attributes':['id',_0x50bb('0x58'),_0x50bb('0x59'),'token',_0x50bb('0x5a'),_0x50bb('0x5b')]})['then'](handleEntityNotFound(_0x5babbc,null))[_0x50bb('0x26')](function(_0x51e64f){if(_0x51e64f){_0x5ba597=_0x51e64f[_0x50bb('0x5b')];var _0x239a82=_0x5ba597['slice'](-0x1);if(_0x239a82==='/'){_0x5ba597=_0x5ba597[_0x50bb('0x5c')](0x0,_0x5ba597['lastIndexOf'](_0x239a82));}var _0x8f5df6={'method':_0x50bb('0x5d'),'uri':util['format'](_0x50bb('0x5e'),_0x5ba597,_0x50bb('0x5f')),'json':!![]};switch(_0x51e64f[_0x50bb('0x5a')]){case'password':_0x8f5df6[_0x50bb('0x60')]={'Authorization':util[_0x50bb('0x61')](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')]('%s:%s',_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x59')]))['toString']('base64'))};break;case _0x50bb('0x63'):_0x8f5df6[_0x50bb('0x60')]={'Authorization':util['format'](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')](_0x50bb('0x64'),_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x50bb('0x65'))][(_0x50bb('0x66'))](_0x50bb('0x67'));}return rp(_0x8f5df6);}})[_0x50bb('0x26')](function(_0x4b51d4){if(_0x4b51d4){var _0x1975f7=['subject',_0x50bb('0x68'),_0x50bb('0x69'),_0x50bb('0x6a')];_[_0x50bb('0x6b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x217170){return _0x1975f7[_0x50bb('0x6c')](_0x217170['type']);});return{'count':_0x4b51d4[_0x50bb('0x5f')][_0x50bb('0x37')],'rows':_[_0x50bb('0x2b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x5d2dc4){return{'id':_0x5d2dc4['id'],'name':_0x5d2dc4[_0x50bb('0x6d')]>0x7?_0x5d2dc4[_0x50bb('0x6e')]:_0x5d2dc4['type'],'custom':_0x5d2dc4[_0x50bb('0x6d')]>0x7?!![]:![],'options':_0x5d2dc4[_0x50bb('0x6f')]?_0x5d2dc4[_0x50bb('0x6f')]:_0x5d2dc4[_0x50bb('0x70')]?_0x5d2dc4[_0x50bb('0x70')]:[]};})};}})['then'](respondWithResult(_0x5babbc,null))['catch'](function(_0x145cf8){var _0x47e80f=_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?0x1f4:_0x145cf8['statusCode']||0x1f4;logger['error'](_0x50bb('0x72'),_0x50bb('0x73'),_0x47e80f,JSON[_0x50bb('0x74')](_0x145cf8));delete _0x145cf8['name'];if(_0x47e80f===0x191){_0x47e80f=0x190;}_0x5babbc[_0x50bb('0x1c')](_0x47e80f)[_0x50bb('0x29')](_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?{'message':_0x50bb('0x75'),'statusCode':_0x145cf8[_0x50bb('0x76')]}:_0x145cf8);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 22fb25c..9f2ce0b 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 _0x906e=['../../config/logger','api','moment','request-promise','path','./intZendeskAccount.attributes','define','ZendeskAccount','util'];(function(_0x351b4c,_0x5d78f5){var _0x4de136=function(_0x2b8565){while(--_0x2b8565){_0x351b4c['push'](_0x351b4c['shift']());}};_0x4de136(++_0x5d78f5);}(_0x906e,0x15e));var _0xe906=function(_0x3b1e3f,_0xf8826b){_0x3b1e3f=_0x3b1e3f-0x0;var _0x3b1cd3=_0x906e[_0x3b1e3f];return _0x3b1cd3;};'use strict';var _=require('lodash');var util=require(_0xe906('0x0'));var logger=require(_0xe906('0x1'))(_0xe906('0x2'));var moment=require(_0xe906('0x3'));var BPromise=require('bluebird');var rp=require(_0xe906('0x4'));var fs=require('fs');var path=require(_0xe906('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe906('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3ebc3a,_0x4df782){return _0x3ebc3a[_0xe906('0x7')](_0xe906('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc24=['request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','define','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x47ea2a,_0x44acee){var _0x1e3f06=function(_0x40423a){while(--_0x40423a){_0x47ea2a['push'](_0x47ea2a['shift']());}};_0x1e3f06(++_0x44acee);}(_0xbc24,0x172));var _0x4bc2=function(_0x55c87c,_0x261ad4){_0x55c87c=_0x55c87c-0x0;var _0x3b3e8d=_0xbc24[_0x55c87c];return _0x3b3e8d;};'use strict';var _=require(_0x4bc2('0x0'));var util=require(_0x4bc2('0x1'));var logger=require(_0x4bc2('0x2'))(_0x4bc2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4bc2('0x4'));var fs=require('fs');var path=require(_0x4bc2('0x5'));var rimraf=require(_0x4bc2('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bc2('0x7'));var integrations=require(_0x4bc2('0x8'));module['exports']=function(_0x3a0668,_0x431996){return _0x3a0668[_0x4bc2('0x9')]('ZendeskAccount',attributes,{'tableName':_0x4bc2('0xa'),'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 c749892..63b0047 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 _0xa3ea=['where','attributes','include','map','model','then','catch','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw'];(function(_0x126a6f,_0x390a17){var _0x3988db=function(_0x162d81){while(--_0x162d81){_0x126a6f['push'](_0x126a6f['shift']());}};_0x3988db(++_0x390a17);}(_0xa3ea,0x77));var _0xaa3e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa3ea[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaa3e('0x0'));var util=require(_0xaa3e('0x1'));var moment=require(_0xaa3e('0x2'));var BPromise=require(_0xaa3e('0x3'));var rs=require(_0xaa3e('0x4'));var fs=require('fs');var Redis=require(_0xaa3e('0x5'));var db=require(_0xaa3e('0x6'))['db'];var utils=require(_0xaa3e('0x7'));var logger=require(_0xaa3e('0x8'))(_0xaa3e('0x9'));var config=require('../../config/environment');var jayson=require(_0xaa3e('0xa'));var client=jayson[_0xaa3e('0xb')][_0xaa3e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d5ee0,_0x2c0f5a,_0x307100){return new BPromise(function(_0x898c0c,_0x3d293d){return client[_0xaa3e('0xd')](_0x2d5ee0,_0x307100)['then'](function(_0x7074f9){logger[_0xaa3e('0xe')](_0xaa3e('0xf'),_0x2c0f5a,_0xaa3e('0x10'));logger[_0xaa3e('0x11')](_0xaa3e('0x12'),_0x2c0f5a,'request\x20sent',JSON[_0xaa3e('0x13')](_0x7074f9));if(_0x7074f9[_0xaa3e('0x14')]){if(_0x7074f9[_0xaa3e('0x14')][_0xaa3e('0x15')]===0x1f4){logger[_0xaa3e('0x14')](_0xaa3e('0xf'),_0x2c0f5a,_0x7074f9['error'][_0xaa3e('0x16')]);return _0x3d293d(_0x7074f9[_0xaa3e('0x14')][_0xaa3e('0x16')]);}logger[_0xaa3e('0x14')](_0xaa3e('0xf'),_0x2c0f5a,_0x7074f9[_0xaa3e('0x14')]['message']);return _0x898c0c(_0x7074f9[_0xaa3e('0x14')][_0xaa3e('0x16')]);}else{logger['info'](_0xaa3e('0xf'),_0x2c0f5a,_0xaa3e('0x10'));_0x898c0c(_0x7074f9[_0xaa3e('0x17')][_0xaa3e('0x16')]);}})['catch'](function(_0xeefecc){logger[_0xaa3e('0x14')](_0xaa3e('0xf'),_0x2c0f5a,_0xeefecc);_0x3d293d(_0xeefecc);});});}exports[_0xaa3e('0x18')]=function(_0x5f3250){var _0x1f8af7=this;return new Promise(function(_0x11b3a5,_0x5904ab){return db[_0xaa3e('0x19')][_0xaa3e('0x1a')]({'raw':_0x5f3250['options']?_0x5f3250[_0xaa3e('0x1b')][_0xaa3e('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f3250[_0xaa3e('0x1b')]?_0x5f3250[_0xaa3e('0x1b')][_0xaa3e('0x1d')]||null:null,'attributes':_0x5f3250['options']?_0x5f3250[_0xaa3e('0x1b')][_0xaa3e('0x1e')]||null:null,'limit':_0x5f3250[_0xaa3e('0x1b')]?_0x5f3250[_0xaa3e('0x1b')]['limit']||null:null,'include':_0x5f3250[_0xaa3e('0x1b')]?_0x5f3250[_0xaa3e('0x1b')][_0xaa3e('0x1f')]?_[_0xaa3e('0x20')](_0x5f3250['options'][_0xaa3e('0x1f')],function(_0xa1bda6){return{'model':db[_0xa1bda6[_0xaa3e('0x21')]],'as':_0xa1bda6['as'],'attributes':_0xa1bda6[_0xaa3e('0x1e')],'include':_0xa1bda6['include']?_[_0xaa3e('0x20')](_0xa1bda6[_0xaa3e('0x1f')],function(_0x400128){return{'model':db[_0x400128[_0xaa3e('0x21')]],'as':_0x400128['as'],'attributes':_0x400128[_0xaa3e('0x1e')],'include':_0x400128[_0xaa3e('0x1f')]?_[_0xaa3e('0x20')](_0x400128[_0xaa3e('0x1f')],function(_0x489b29){return{'model':db[_0x489b29['model']],'as':_0x489b29['as'],'attributes':_0x489b29[_0xaa3e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaa3e('0x22')](function(_0xe9df7a){logger[_0xaa3e('0xe')](_0xaa3e('0x18'),_0x5f3250);logger[_0xaa3e('0x11')](_0xaa3e('0x18'),_0x5f3250,JSON[_0xaa3e('0x13')](_0xe9df7a));_0x11b3a5(_0xe9df7a);})[_0xaa3e('0x23')](function(_0x30b341){logger[_0xaa3e('0x14')](_0xaa3e('0x18'),_0x30b341[_0xaa3e('0x16')],_0x5f3250);_0x5904ab(_0x1f8af7[_0xaa3e('0x14')](0x1f4,_0x30b341[_0xaa3e('0x16')]));});});};exports[_0xaa3e('0x24')]=function(_0x216b82){var _0x24e4f4=this;return new Promise(function(_0x38d707,_0x30696f){return db[_0xaa3e('0x19')]['find']({'raw':_0x216b82[_0xaa3e('0x1b')]?_0x216b82[_0xaa3e('0x1b')][_0xaa3e('0x1c')]===undefined?!![]:![]:!![],'where':_0x216b82[_0xaa3e('0x1b')]?_0x216b82['options'][_0xaa3e('0x1d')]||null:null,'attributes':_0x216b82[_0xaa3e('0x1b')]?_0x216b82[_0xaa3e('0x1b')][_0xaa3e('0x1e')]||null:null,'include':_0x216b82[_0xaa3e('0x1b')]?_0x216b82[_0xaa3e('0x1b')]['include']?_[_0xaa3e('0x20')](_0x216b82[_0xaa3e('0x1b')][_0xaa3e('0x1f')],function(_0x12570d){return{'model':db[_0x12570d['model']],'as':_0x12570d['as'],'attributes':_0x12570d[_0xaa3e('0x1e')],'include':_0x12570d[_0xaa3e('0x1f')]?_['map'](_0x12570d[_0xaa3e('0x1f')],function(_0x5db126){return{'model':db[_0x5db126[_0xaa3e('0x21')]],'as':_0x5db126['as'],'attributes':_0x5db126[_0xaa3e('0x1e')],'include':_0x5db126[_0xaa3e('0x1f')]?_[_0xaa3e('0x20')](_0x5db126[_0xaa3e('0x1f')],function(_0x518195){return{'model':db[_0x518195[_0xaa3e('0x21')]],'as':_0x518195['as'],'attributes':_0x518195[_0xaa3e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaa3e('0x22')](function(_0x1196df){logger[_0xaa3e('0xe')]('ShowZendeskAccount',_0x216b82);logger[_0xaa3e('0x11')](_0xaa3e('0x24'),_0x216b82,JSON[_0xaa3e('0x13')](_0x1196df));_0x38d707(_0x1196df);})['catch'](function(_0x568e33){logger[_0xaa3e('0x14')](_0xaa3e('0x24'),_0x568e33[_0xaa3e('0x16')],_0x216b82);_0x30696f(_0x24e4f4[_0xaa3e('0x14')](0x1f4,_0x568e33['message']));});});}; \ No newline at end of file +var _0x4ae5=['then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowZendeskAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1d48b5,_0x154e43){var _0x2acb89=function(_0x5b522a){while(--_0x5b522a){_0x1d48b5['push'](_0x1d48b5['shift']());}};_0x2acb89(++_0x154e43);}(_0x4ae5,0x1a4));var _0x54ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ae5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x54ae('0x0'));var util=require('util');var moment=require(_0x54ae('0x1'));var BPromise=require(_0x54ae('0x2'));var rs=require(_0x54ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54ae('0x4'))['db'];var utils=require(_0x54ae('0x5'));var logger=require(_0x54ae('0x6'))(_0x54ae('0x7'));var config=require(_0x54ae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x54ae('0x9')][_0x54ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdd56f2,_0x386409,_0x42e4d3){return new BPromise(function(_0xd758b,_0xdd26a1){return client[_0x54ae('0xb')](_0xdd56f2,_0x42e4d3)[_0x54ae('0xc')](function(_0x5a8c98){logger[_0x54ae('0xd')](_0x54ae('0xe'),_0x386409,'request\x20sent');logger['debug'](_0x54ae('0xf'),_0x386409,_0x54ae('0x10'),JSON[_0x54ae('0x11')](_0x5a8c98));if(_0x5a8c98[_0x54ae('0x12')]){if(_0x5a8c98[_0x54ae('0x12')][_0x54ae('0x13')]===0x1f4){logger[_0x54ae('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x386409,_0x5a8c98[_0x54ae('0x12')]['message']);return _0xdd26a1(_0x5a8c98[_0x54ae('0x12')][_0x54ae('0x14')]);}logger[_0x54ae('0x12')](_0x54ae('0xe'),_0x386409,_0x5a8c98['error'][_0x54ae('0x14')]);return _0xd758b(_0x5a8c98[_0x54ae('0x12')][_0x54ae('0x14')]);}else{logger[_0x54ae('0xd')](_0x54ae('0xe'),_0x386409,'request\x20sent');_0xd758b(_0x5a8c98[_0x54ae('0x15')][_0x54ae('0x14')]);}})['catch'](function(_0x454e81){logger['error'](_0x54ae('0xe'),_0x386409,_0x454e81);_0xdd26a1(_0x454e81);});});}exports[_0x54ae('0x16')]=function(_0x57b102){var _0x16c2d8=this;return new Promise(function(_0x3358a0,_0x279031){return db[_0x54ae('0x17')][_0x54ae('0x18')]({'raw':_0x57b102[_0x54ae('0x19')]?_0x57b102[_0x54ae('0x19')][_0x54ae('0x1a')]===undefined?!![]:![]:!![],'where':_0x57b102[_0x54ae('0x19')]?_0x57b102[_0x54ae('0x19')][_0x54ae('0x1b')]||null:null,'attributes':_0x57b102['options']?_0x57b102[_0x54ae('0x19')][_0x54ae('0x1c')]||null:null,'limit':_0x57b102[_0x54ae('0x19')]?_0x57b102[_0x54ae('0x19')]['limit']||null:null,'include':_0x57b102[_0x54ae('0x19')]?_0x57b102['options'][_0x54ae('0x1d')]?_[_0x54ae('0x1e')](_0x57b102[_0x54ae('0x19')][_0x54ae('0x1d')],function(_0xd34c8f){return{'model':db[_0xd34c8f['model']],'as':_0xd34c8f['as'],'attributes':_0xd34c8f[_0x54ae('0x1c')],'include':_0xd34c8f[_0x54ae('0x1d')]?_[_0x54ae('0x1e')](_0xd34c8f[_0x54ae('0x1d')],function(_0x15ee38){return{'model':db[_0x15ee38['model']],'as':_0x15ee38['as'],'attributes':_0x15ee38['attributes'],'include':_0x15ee38[_0x54ae('0x1d')]?_[_0x54ae('0x1e')](_0x15ee38[_0x54ae('0x1d')],function(_0x2ad780){return{'model':db[_0x2ad780[_0x54ae('0x1f')]],'as':_0x2ad780['as'],'attributes':_0x2ad780[_0x54ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x54ae('0xc')](function(_0x168617){logger['info']('GetZendeskAccount',_0x57b102);logger[_0x54ae('0x20')](_0x54ae('0x16'),_0x57b102,JSON[_0x54ae('0x11')](_0x168617));_0x3358a0(_0x168617);})[_0x54ae('0x21')](function(_0x33b24d){logger[_0x54ae('0x12')](_0x54ae('0x16'),_0x33b24d['message'],_0x57b102);_0x279031(_0x16c2d8[_0x54ae('0x12')](0x1f4,_0x33b24d[_0x54ae('0x14')]));});});};exports[_0x54ae('0x22')]=function(_0xb66f8c){var _0x2ce151=this;return new Promise(function(_0x14f405,_0x285304){return db[_0x54ae('0x17')][_0x54ae('0x23')]({'raw':_0xb66f8c[_0x54ae('0x19')]?_0xb66f8c['options'][_0x54ae('0x1a')]===undefined?!![]:![]:!![],'where':_0xb66f8c[_0x54ae('0x19')]?_0xb66f8c[_0x54ae('0x19')]['where']||null:null,'attributes':_0xb66f8c[_0x54ae('0x19')]?_0xb66f8c[_0x54ae('0x19')][_0x54ae('0x1c')]||null:null,'include':_0xb66f8c[_0x54ae('0x19')]?_0xb66f8c[_0x54ae('0x19')][_0x54ae('0x1d')]?_[_0x54ae('0x1e')](_0xb66f8c[_0x54ae('0x19')][_0x54ae('0x1d')],function(_0x4191e7){return{'model':db[_0x4191e7[_0x54ae('0x1f')]],'as':_0x4191e7['as'],'attributes':_0x4191e7[_0x54ae('0x1c')],'include':_0x4191e7['include']?_[_0x54ae('0x1e')](_0x4191e7[_0x54ae('0x1d')],function(_0x3a8850){return{'model':db[_0x3a8850[_0x54ae('0x1f')]],'as':_0x3a8850['as'],'attributes':_0x3a8850[_0x54ae('0x1c')],'include':_0x3a8850[_0x54ae('0x1d')]?_[_0x54ae('0x1e')](_0x3a8850[_0x54ae('0x1d')],function(_0x419585){return{'model':db[_0x419585[_0x54ae('0x1f')]],'as':_0x419585['as'],'attributes':_0x419585[_0x54ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x54ae('0xc')](function(_0x330b37){logger[_0x54ae('0xd')]('ShowZendeskAccount',_0xb66f8c);logger[_0x54ae('0x20')](_0x54ae('0x22'),_0xb66f8c,JSON[_0x54ae('0x11')](_0x330b37));_0x14f405(_0x330b37);})[_0x54ae('0x21')](function(_0x3c1dab){logger[_0x54ae('0x12')](_0x54ae('0x22'),_0x3c1dab[_0x54ae('0x14')],_0xb66f8c);_0x285304(_0x2ce151[_0x54ae('0x12')](0x1f4,_0x3c1dab['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 6b91b83..1325a2e 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 _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x5da89a,_0x8edf4f){var _0x28703c=function(_0x246ee4){while(--_0x246ee4){_0x5da89a['push'](_0x5da89a['shift']());}};_0x28703c(++_0x8edf4f);}(_0x750a,0x140));var _0xa750=function(_0xddc32d,_0x53ae4c){_0xddc32d=_0xddc32d-0x0;var _0x45f398=_0x750a[_0xddc32d];return _0x45f398;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file +var _0x7916=['getDescriptions','get','/:id/tags','getTags','post','create','setTags','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x403425,_0x51c6a2){var _0x22b7e7=function(_0xfd6fd7){while(--_0xfd6fd7){_0x403425['push'](_0x403425['shift']());}};_0x22b7e7(++_0x51c6a2);}(_0x7916,0x128));var _0x6791=function(_0x2e20c1,_0x2e4772){_0x2e20c1=_0x2e20c1-0x0;var _0x3cef7a=_0x7916[_0x2e20c1];return _0x3cef7a;};'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['get']('/:id/fields',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')](_0x6791('0x12'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x14')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x15')]);router[_0x6791('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6791('0x16')]);router['put'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0x17')]);router[_0x6791('0x18')]('/:id',auth[_0x6791('0x8')](),controller['destroy']);module[_0x6791('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9786afb..085009c 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 _0x69dd=['STRING'];(function(_0x5491d9,_0xd98623){var _0x2a4b0a=function(_0x48adb8){while(--_0x48adb8){_0x5491d9['push'](_0x5491d9['shift']());}};_0x2a4b0a(++_0xd98623);}(_0x69dd,0xe1));var _0xd69d=function(_0x3d7315,_0x196ac3){_0x3d7315=_0x3d7315-0x0;var _0x42745e=_0x69dd[_0x3d7315];return _0x42745e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd69d('0x0')]}}; \ No newline at end of file +var _0x9e9a=['STRING','sequelize'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x9e9a,0x1e7));var _0xa9e9=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x9e9a[_0x1ae491];return _0x4958a5;};'use strict';var Sequelize=require(_0xa9e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9e9('0x1')]},'description':{'type':Sequelize[_0xa9e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2130e05..76ed22d 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 _0x629b=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','update','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','destroy','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x629b,0x72));var _0xb629=function(_0x5464ab,_0x5cec0e){_0x5464ab=_0x5464ab-0x0;var _0x58a86f=_0x629b[_0x5464ab];return _0x58a86f;};'use strict';var emlformat=require(_0xb629('0x0'));var rimraf=require(_0xb629('0x1'));var zipdir=require(_0xb629('0x2'));var jsonpatch=require(_0xb629('0x3'));var rp=require('request-promise');var moment=require(_0xb629('0x4'));var BPromise=require(_0xb629('0x5'));var Mustache=require(_0xb629('0x6'));var util=require(_0xb629('0x7'));var path=require(_0xb629('0x8'));var sox=require(_0xb629('0x9'));var csv=require('to-csv');var ejs=require(_0xb629('0xa'));var fs=require('fs');var fs_extra=require(_0xb629('0xb'));var _=require(_0xb629('0xc'));var squel=require(_0xb629('0xd'));var crypto=require(_0xb629('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb629('0xf'));var Papa=require(_0xb629('0x10'));var Redis=require(_0xb629('0x11'));var authService=require(_0xb629('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb629('0x13'));var hardwareService=require(_0xb629('0x14'));var logger=require('../../config/logger')(_0xb629('0x15'));var utils=require(_0xb629('0x16'));var config=require(_0xb629('0x17'));var licenseUtil=require(_0xb629('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39d0de,_0x32d711){_0x32d711=_0x32d711||0xcc;return function(_0x27532c){if(_0x27532c){return _0x39d0de[_0xb629('0x19')](_0x32d711);}return _0x39d0de[_0xb629('0x1a')](_0x32d711)[_0xb629('0x1b')]();};}function respondWithResult(_0x48d580,_0x559937){_0x559937=_0x559937||0xc8;return function(_0x369c1e){if(_0x369c1e){return _0x48d580[_0xb629('0x1a')](_0x559937)['json'](_0x369c1e);}};}function respondWithFilteredResult(_0x1e255b,_0x6e2a5b){return function(_0x44d829){if(_0x44d829){var _0x124d79=typeof _0x6e2a5b[_0xb629('0x1c')]==='undefined'&&typeof _0x6e2a5b[_0xb629('0x1d')]==='undefined';var _0x1c3e92=_0x44d829['count'];var _0x517656=_0x124d79?0x0:_0x6e2a5b['offset'];var _0x68823a=_0x124d79?_0x44d829[_0xb629('0x1e')]:_0x6e2a5b[_0xb629('0x1c')]+_0x6e2a5b[_0xb629('0x1d')];var _0x5727eb;if(_0x68823a>=_0x1c3e92){_0x68823a=_0x1c3e92;_0x5727eb=0xc8;}else{_0x5727eb=0xce;}_0x1e255b[_0xb629('0x1a')](_0x5727eb);return _0x1e255b[_0xb629('0x1f')](_0xb629('0x20'),_0x517656+'-'+_0x68823a+'/'+_0x1c3e92)[_0xb629('0x21')](_0x44d829);}return null;};}function patchUpdates(_0x37d053){return function(_0x36baab){try{jsonpatch['apply'](_0x36baab,_0x37d053,!![]);}catch(_0xab5d04){return BPromise['reject'](_0xab5d04);}return _0x36baab['save']();};}function saveUpdates(_0x8b9dcf,_0x5ec7eb){return function(_0x3c10ac){if(_0x3c10ac){return _0x3c10ac['update'](_0x8b9dcf)['then'](function(_0x21f645){return _0x21f645;});}return null;};}function removeEntity(_0x4b9e05,_0x3cc1cf){return function(_0x30618b){if(_0x30618b){return _0x30618b[_0xb629('0x22')]()[_0xb629('0x23')](function(){_0x4b9e05[_0xb629('0x1a')](0xcc)[_0xb629('0x1b')]();});}};}function handleEntityNotFound(_0x3d61c5,_0x25f85a){return function(_0x41361d){if(!_0x41361d){_0x3d61c5['sendStatus'](0x194);}return _0x41361d;};}function handleError(_0x19ac0d,_0x4c3c01){_0x4c3c01=_0x4c3c01||0x1f4;return function(_0x448598){logger[_0xb629('0x24')](_0x448598[_0xb629('0x25')]);if(_0x448598[_0xb629('0x26')]){delete _0x448598[_0xb629('0x26')];}_0x19ac0d['status'](_0x4c3c01)[_0xb629('0x27')](_0x448598);};}exports[_0xb629('0x28')]=function(_0x4eac0f,_0x388fbc){var _0x12de46={},_0x38838b={},_0x13d8a0={'count':0x0,'rows':[]};var _0x504fff=_[_0xb629('0x29')](db[_0xb629('0x2a')][_0xb629('0x2b')],function(_0x3f2876){return{'name':_0x3f2876[_0xb629('0x2c')],'type':_0x3f2876[_0xb629('0x2d')][_0xb629('0x2e')]};});_0x38838b[_0xb629('0x2f')]=_['map'](_0x504fff,_0xb629('0x26'));_0x38838b[_0xb629('0x30')]=_[_0xb629('0x31')](_0x4eac0f[_0xb629('0x30')]);_0x38838b[_0xb629('0x32')]=_[_0xb629('0x33')](_0x38838b[_0xb629('0x2f')],_0x38838b[_0xb629('0x30')]);_0x12de46['attributes']=_[_0xb629('0x33')](_0x38838b[_0xb629('0x2f')],qs[_0xb629('0x34')](_0x4eac0f[_0xb629('0x30')][_0xb629('0x34')]));_0x12de46[_0xb629('0x35')]=_0x12de46['attributes'][_0xb629('0x36')]?_0x12de46[_0xb629('0x35')]:_0x38838b[_0xb629('0x2f')];if(!_0x4eac0f['query'][_0xb629('0x37')](_0xb629('0x38'))){_0x12de46[_0xb629('0x1d')]=qs['limit'](_0x4eac0f[_0xb629('0x30')][_0xb629('0x1d')]);_0x12de46[_0xb629('0x1c')]=qs[_0xb629('0x1c')](_0x4eac0f[_0xb629('0x30')][_0xb629('0x1c')]);}_0x12de46[_0xb629('0x39')]=qs[_0xb629('0x3a')](_0x4eac0f[_0xb629('0x30')]['sort']);_0x12de46[_0xb629('0x3b')]=qs[_0xb629('0x32')](_[_0xb629('0x3c')](_0x4eac0f[_0xb629('0x30')],_0x38838b[_0xb629('0x32')]),_0x504fff);if(_0x4eac0f['query'][_0xb629('0x3d')]){_0x12de46['where']=_['merge'](_0x12de46[_0xb629('0x3b')],{'$or':_[_0xb629('0x29')](_0x504fff,function(_0x55ecb6){if(_0x55ecb6['type']!==_0xb629('0x3e')){var _0x16d214={};_0x16d214[_0x55ecb6[_0xb629('0x26')]]={'$like':'%'+_0x4eac0f[_0xb629('0x30')][_0xb629('0x3d')]+'%'};return _0x16d214;}})});}_0x12de46=_[_0xb629('0x3f')]({},_0x12de46,_0x4eac0f['options']);var _0x2f8fe8={'where':_0x12de46[_0xb629('0x3b')]};return db['ZendeskConfiguration'][_0xb629('0x1e')](_0x2f8fe8)['then'](function(_0x329e86){_0x13d8a0[_0xb629('0x1e')]=_0x329e86;if(_0x4eac0f[_0xb629('0x30')]['includeAll']){_0x12de46[_0xb629('0x40')]=[{'all':!![]}];}return db[_0xb629('0x2a')][_0xb629('0x41')](_0x12de46);})[_0xb629('0x23')](function(_0xa5de3b){_0x13d8a0[_0xb629('0x42')]=_0xa5de3b;return _0x13d8a0;})[_0xb629('0x23')](respondWithFilteredResult(_0x388fbc,_0x12de46))[_0xb629('0x43')](handleError(_0x388fbc,null));};exports[_0xb629('0x44')]=function(_0x4012b2,_0x1d650d){var _0xfdb704={'raw':![],'where':{'id':_0x4012b2[_0xb629('0x45')]['id']}},_0x39f478={};_0x39f478[_0xb629('0x2f')]=_[_0xb629('0x31')](db['ZendeskConfiguration'][_0xb629('0x2b')]);_0x39f478[_0xb629('0x30')]=_[_0xb629('0x31')](_0x4012b2[_0xb629('0x30')]);_0x39f478[_0xb629('0x32')]=_[_0xb629('0x33')](_0x39f478[_0xb629('0x2f')],_0x39f478['query']);_0xfdb704[_0xb629('0x35')]=_[_0xb629('0x33')](_0x39f478[_0xb629('0x2f')],qs[_0xb629('0x34')](_0x4012b2[_0xb629('0x30')][_0xb629('0x34')]));_0xfdb704[_0xb629('0x35')]=_0xfdb704[_0xb629('0x35')][_0xb629('0x36')]?_0xfdb704[_0xb629('0x35')]:_0x39f478['model'];if(_0x4012b2[_0xb629('0x30')][_0xb629('0x46')]){_0xfdb704[_0xb629('0x40')]=[{'all':!![]}];}_0xfdb704=_[_0xb629('0x3f')]({},_0xfdb704,_0x4012b2[_0xb629('0x47')]);return db[_0xb629('0x2a')][_0xb629('0x48')](_0xfdb704)[_0xb629('0x23')](handleEntityNotFound(_0x1d650d,null))[_0xb629('0x23')](respondWithResult(_0x1d650d,null))[_0xb629('0x43')](handleError(_0x1d650d,null));};exports[_0xb629('0x49')]=function(_0x1ae80d,_0x54a5ee){return db['ZendeskConfiguration'][_0xb629('0x49')](_0x1ae80d[_0xb629('0x4a')],{})['then'](respondWithResult(_0x54a5ee,0xc9))[_0xb629('0x43')](handleError(_0x54a5ee,null));};exports[_0xb629('0x4b')]=function(_0x56eafd,_0x1c7f8e){if(_0x56eafd[_0xb629('0x4a')]['id']){delete _0x56eafd['body']['id'];}return db['ZendeskConfiguration'][_0xb629('0x48')]({'where':{'id':_0x56eafd['params']['id']}})['then'](handleEntityNotFound(_0x1c7f8e,null))[_0xb629('0x23')](saveUpdates(_0x56eafd[_0xb629('0x4a')],null))[_0xb629('0x23')](respondWithResult(_0x1c7f8e,null))[_0xb629('0x43')](handleError(_0x1c7f8e,null));};exports[_0xb629('0x22')]=function(_0x487fe4,_0x2a9a61){return db[_0xb629('0x2a')][_0xb629('0x48')]({'where':{'id':_0x487fe4[_0xb629('0x45')]['id']}})[_0xb629('0x23')](handleEntityNotFound(_0x2a9a61,null))[_0xb629('0x23')](removeEntity(_0x2a9a61,null))[_0xb629('0x43')](handleError(_0x2a9a61,null));};exports[_0xb629('0x4c')]=function(_0x2267e3,_0x49ddad,_0x535124){var _0x516be4={};var _0x1f3cc4={};var _0x320d9d;var _0x4c7193;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2267e3['params']['id']}})[_0xb629('0x23')](handleEntityNotFound(_0x49ddad,null))['then'](function(_0x5ea5d3){if(_0x5ea5d3){_0x320d9d=_0x5ea5d3;_0x1f3cc4[_0xb629('0x2f')]=_[_0xb629('0x31')](db[_0xb629('0x4d')]['rawAttributes']);_0x1f3cc4['query']=_[_0xb629('0x31')](_0x2267e3['query']);_0x1f3cc4['filters']=_[_0xb629('0x33')](_0x1f3cc4[_0xb629('0x2f')],_0x1f3cc4[_0xb629('0x30')]);_0x516be4[_0xb629('0x35')]=_['intersection'](_0x1f3cc4[_0xb629('0x2f')],qs[_0xb629('0x34')](_0x2267e3[_0xb629('0x30')][_0xb629('0x34')]));_0x516be4[_0xb629('0x35')]=_0x516be4[_0xb629('0x35')][_0xb629('0x36')]?_0x516be4[_0xb629('0x35')]:_0x1f3cc4[_0xb629('0x2f')];_0x516be4[_0xb629('0x39')]=qs['sort'](_0x2267e3[_0xb629('0x30')]['sort']);_0x516be4[_0xb629('0x3b')]=qs['filters'](_[_0xb629('0x3c')](_0x2267e3[_0xb629('0x30')],_0x1f3cc4[_0xb629('0x32')]));if(_0x2267e3[_0xb629('0x30')][_0xb629('0x3d')]){_0x516be4[_0xb629('0x3b')]=_[_0xb629('0x3f')](_0x516be4[_0xb629('0x3b')],{'$or':_['map'](_0x516be4[_0xb629('0x35')],function(_0x3f1c63){var _0x4a9a76={};_0x4a9a76[_0x3f1c63]={'$like':'%'+_0x2267e3[_0xb629('0x30')][_0xb629('0x3d')]+'%'};return _0x4a9a76;})});}_0x516be4=_['merge']({},_0x516be4,_0x2267e3['options']);return _0x320d9d[_0xb629('0x4c')](_0x516be4);}})[_0xb629('0x23')](function(_0x1f662d){if(_0x1f662d){_0x4c7193=_0x1f662d[_0xb629('0x36')];if(!_0x2267e3['query'][_0xb629('0x37')]('nolimit')){_0x516be4[_0xb629('0x1d')]=qs['limit'](_0x2267e3['query'][_0xb629('0x1d')]);_0x516be4[_0xb629('0x1c')]=qs[_0xb629('0x1c')](_0x2267e3[_0xb629('0x30')]['offset']);}return _0x320d9d[_0xb629('0x4c')](_0x516be4);}})[_0xb629('0x23')](function(_0x4e1e4a){if(_0x4e1e4a){return _0x4e1e4a?{'count':_0x4c7193,'rows':_0x4e1e4a}:null;}})[_0xb629('0x23')](respondWithResult(_0x49ddad,null))['catch'](handleError(_0x49ddad,null));};exports[_0xb629('0x4e')]=function(_0x57ca5a,_0x1ec020,_0x5c09ba){var _0x5b7bd8={};var _0x528edf={};var _0x584266;var _0x125558;return db[_0xb629('0x2a')][_0xb629('0x4f')]({'where':{'id':_0x57ca5a[_0xb629('0x45')]['id']}})[_0xb629('0x23')](handleEntityNotFound(_0x1ec020,null))[_0xb629('0x23')](function(_0x13bc0a){if(_0x13bc0a){_0x584266=_0x13bc0a;_0x528edf[_0xb629('0x2f')]=_[_0xb629('0x31')](db[_0xb629('0x4d')]['rawAttributes']);_0x528edf[_0xb629('0x30')]=_[_0xb629('0x31')](_0x57ca5a['query']);_0x528edf['filters']=_[_0xb629('0x33')](_0x528edf[_0xb629('0x2f')],_0x528edf[_0xb629('0x30')]);_0x5b7bd8[_0xb629('0x35')]=_['intersection'](_0x528edf[_0xb629('0x2f')],qs['fields'](_0x57ca5a[_0xb629('0x30')][_0xb629('0x34')]));_0x5b7bd8[_0xb629('0x35')]=_0x5b7bd8[_0xb629('0x35')]['length']?_0x5b7bd8[_0xb629('0x35')]:_0x528edf[_0xb629('0x2f')];_0x5b7bd8['order']=qs[_0xb629('0x3a')](_0x57ca5a[_0xb629('0x30')]['sort']);_0x5b7bd8['where']=qs['filters'](_['pick'](_0x57ca5a['query'],_0x528edf[_0xb629('0x32')]));if(_0x57ca5a['query'][_0xb629('0x3d')]){_0x5b7bd8[_0xb629('0x3b')]=_['merge'](_0x5b7bd8[_0xb629('0x3b')],{'$or':_[_0xb629('0x29')](_0x5b7bd8[_0xb629('0x35')],function(_0x4e5613){var _0x379fec={};_0x379fec[_0x4e5613]={'$like':'%'+_0x57ca5a['query'][_0xb629('0x3d')]+'%'};return _0x379fec;})});}_0x5b7bd8=_['merge']({},_0x5b7bd8,_0x57ca5a[_0xb629('0x47')]);return _0x584266[_0xb629('0x4e')](_0x5b7bd8);}})[_0xb629('0x23')](function(_0x488f41){if(_0x488f41){_0x125558=_0x488f41[_0xb629('0x36')];if(!_0x57ca5a[_0xb629('0x30')][_0xb629('0x37')](_0xb629('0x38'))){_0x5b7bd8[_0xb629('0x1d')]=qs[_0xb629('0x1d')](_0x57ca5a[_0xb629('0x30')][_0xb629('0x1d')]);_0x5b7bd8[_0xb629('0x1c')]=qs[_0xb629('0x1c')](_0x57ca5a['query'][_0xb629('0x1c')]);}return _0x584266[_0xb629('0x4e')](_0x5b7bd8);}})['then'](function(_0x2c4960){if(_0x2c4960){return _0x2c4960?{'count':_0x125558,'rows':_0x2c4960}:null;}})[_0xb629('0x23')](respondWithResult(_0x1ec020,null))[_0xb629('0x43')](handleError(_0x1ec020,null));};exports['getDescriptions']=function(_0x1c9dd2,_0xec00d2,_0xcfcbb2){var _0x22103c={};var _0x5073b5={};var _0x3adae6;var _0x34fbf2;return db[_0xb629('0x2a')][_0xb629('0x4f')]({'where':{'id':_0x1c9dd2['params']['id']}})['then'](handleEntityNotFound(_0xec00d2,null))['then'](function(_0x4e2a42){if(_0x4e2a42){_0x3adae6=_0x4e2a42;_0x5073b5['model']=_[_0xb629('0x31')](db['ZendeskField']['rawAttributes']);_0x5073b5['query']=_['keys'](_0x1c9dd2[_0xb629('0x30')]);_0x5073b5[_0xb629('0x32')]=_['intersection'](_0x5073b5['model'],_0x5073b5[_0xb629('0x30')]);_0x22103c['attributes']=_[_0xb629('0x33')](_0x5073b5['model'],qs[_0xb629('0x34')](_0x1c9dd2[_0xb629('0x30')][_0xb629('0x34')]));_0x22103c[_0xb629('0x35')]=_0x22103c[_0xb629('0x35')]['length']?_0x22103c[_0xb629('0x35')]:_0x5073b5['model'];_0x22103c[_0xb629('0x39')]=qs[_0xb629('0x3a')](_0x1c9dd2[_0xb629('0x30')][_0xb629('0x3a')]);_0x22103c[_0xb629('0x3b')]=qs[_0xb629('0x32')](_[_0xb629('0x3c')](_0x1c9dd2[_0xb629('0x30')],_0x5073b5[_0xb629('0x32')]));if(_0x1c9dd2[_0xb629('0x30')][_0xb629('0x3d')]){_0x22103c[_0xb629('0x3b')]=_[_0xb629('0x3f')](_0x22103c['where'],{'$or':_[_0xb629('0x29')](_0x22103c[_0xb629('0x35')],function(_0xf724db){var _0x412084={};_0x412084[_0xf724db]={'$like':'%'+_0x1c9dd2[_0xb629('0x30')][_0xb629('0x3d')]+'%'};return _0x412084;})});}_0x22103c=_[_0xb629('0x3f')]({},_0x22103c,_0x1c9dd2[_0xb629('0x47')]);return _0x3adae6[_0xb629('0x50')](_0x22103c);}})['then'](function(_0x549cc9){if(_0x549cc9){_0x34fbf2=_0x549cc9[_0xb629('0x36')];if(!_0x1c9dd2[_0xb629('0x30')]['hasOwnProperty'](_0xb629('0x38'))){_0x22103c['limit']=qs[_0xb629('0x1d')](_0x1c9dd2[_0xb629('0x30')]['limit']);_0x22103c[_0xb629('0x1c')]=qs[_0xb629('0x1c')](_0x1c9dd2[_0xb629('0x30')][_0xb629('0x1c')]);}return _0x3adae6[_0xb629('0x50')](_0x22103c);}})[_0xb629('0x23')](function(_0x5409b1){if(_0x5409b1){return _0x5409b1?{'count':_0x34fbf2,'rows':_0x5409b1}:null;}})[_0xb629('0x23')](respondWithResult(_0xec00d2,null))['catch'](handleError(_0xec00d2,null));};exports[_0xb629('0x51')]=function(_0x561335,_0xb522d,_0x4759a2){var _0x42543e={};var _0x399774={};var _0x4dbf10;var _0x4b99c0;return db['ZendeskConfiguration'][_0xb629('0x4f')]({'where':{'id':_0x561335[_0xb629('0x45')]['id']}})[_0xb629('0x23')](handleEntityNotFound(_0xb522d,null))['then'](function(_0x4752f5){if(_0x4752f5){_0x4dbf10=_0x4752f5;_0x399774[_0xb629('0x2f')]=_[_0xb629('0x31')](db[_0xb629('0x52')]['rawAttributes']);_0x399774[_0xb629('0x30')]=_['keys'](_0x561335[_0xb629('0x30')]);_0x399774[_0xb629('0x32')]=_[_0xb629('0x33')](_0x399774[_0xb629('0x2f')],_0x399774[_0xb629('0x30')]);_0x42543e[_0xb629('0x35')]=_['intersection'](_0x399774[_0xb629('0x2f')],qs[_0xb629('0x34')](_0x561335[_0xb629('0x30')]['fields']));_0x42543e[_0xb629('0x35')]=_0x42543e[_0xb629('0x35')]['length']?_0x42543e[_0xb629('0x35')]:_0x399774[_0xb629('0x2f')];_0x42543e[_0xb629('0x39')]=qs['sort'](_0x561335[_0xb629('0x30')]['sort']);_0x42543e[_0xb629('0x3b')]=qs[_0xb629('0x32')](_[_0xb629('0x3c')](_0x561335[_0xb629('0x30')],_0x399774[_0xb629('0x32')]));if(_0x561335[_0xb629('0x30')][_0xb629('0x3d')]){_0x42543e[_0xb629('0x3b')]=_[_0xb629('0x3f')](_0x42543e['where'],{'$or':_[_0xb629('0x29')](_0x42543e['attributes'],function(_0x18e462){var _0x1e6fc2={};_0x1e6fc2[_0x18e462]={'$like':'%'+_0x561335[_0xb629('0x30')][_0xb629('0x3d')]+'%'};return _0x1e6fc2;})});}_0x42543e=_[_0xb629('0x3f')]({},_0x42543e,_0x561335[_0xb629('0x47')]);return _0x4dbf10[_0xb629('0x51')](_0x42543e);}})[_0xb629('0x23')](function(_0x3b69ff){if(_0x3b69ff){_0x4b99c0=_0x3b69ff[_0xb629('0x36')];if(!_0x561335[_0xb629('0x30')][_0xb629('0x37')](_0xb629('0x38'))){_0x42543e[_0xb629('0x1d')]=qs[_0xb629('0x1d')](_0x561335[_0xb629('0x30')][_0xb629('0x1d')]);_0x42543e[_0xb629('0x1c')]=qs[_0xb629('0x1c')](_0x561335[_0xb629('0x30')][_0xb629('0x1c')]);}return _0x4dbf10[_0xb629('0x51')](_0x42543e);}})[_0xb629('0x23')](function(_0x30828e){if(_0x30828e){return _0x30828e?{'count':_0x4b99c0,'rows':_0x30828e}:null;}})[_0xb629('0x23')](respondWithResult(_0xb522d,null))[_0xb629('0x43')](handleError(_0xb522d,null));};exports[_0xb629('0x53')]=function(_0x42e088,_0x549235,_0x46bb60){if(_0x42e088['body']['id']){delete _0x42e088[_0xb629('0x4a')]['id'];}return db['ZendeskConfiguration'][_0xb629('0x4f')]({'where':{'id':_0x42e088[_0xb629('0x45')]['id']}})[_0xb629('0x23')](handleEntityNotFound(_0x549235,null))[_0xb629('0x23')](function(_0x49a78a){if(_0x49a78a){return _0x49a78a['setTags'](_0x42e088[_0xb629('0x4a')][_0xb629('0x54')]||[]);}return null;})['then'](respondWithResult(_0x549235,null))[_0xb629('0x43')](handleError(_0x549235,null));}; \ No newline at end of file +var _0x3225=['mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','ZendeskField','length','pick','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x5eae56,_0x2d5d34){var _0x45a293=function(_0x5338a6){while(--_0x5338a6){_0x5eae56['push'](_0x5eae56['shift']());}};_0x45a293(++_0x2d5d34);}(_0x3225,0x199));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5322('0x0'));var rimraf=require(_0x5322('0x1'));var zipdir=require(_0x5322('0x2'));var jsonpatch=require(_0x5322('0x3'));var rp=require('request-promise');var moment=require(_0x5322('0x4'));var BPromise=require(_0x5322('0x5'));var Mustache=require(_0x5322('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5322('0x7'));var csv=require(_0x5322('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5322('0x9'));var squel=require(_0x5322('0xa'));var crypto=require(_0x5322('0xb'));var jsforce=require(_0x5322('0xc'));var deskjs=require(_0x5322('0xd'));var toCsv=require(_0x5322('0x8'));var querystring=require(_0x5322('0xe'));var Papa=require(_0x5322('0xf'));var Redis=require(_0x5322('0x10'));var authService=require(_0x5322('0x11'));var qs=require(_0x5322('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5322('0x13'));var logger=require(_0x5322('0x14'))(_0x5322('0x15'));var utils=require(_0x5322('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5322('0x17'));var db=require(_0x5322('0x18'))['db'];function respondWithStatusCode(_0x5bdc69,_0x495357){_0x495357=_0x495357||0xcc;return function(_0x36c3cc){if(_0x36c3cc){return _0x5bdc69[_0x5322('0x19')](_0x495357);}return _0x5bdc69['status'](_0x495357)[_0x5322('0x1a')]();};}function respondWithResult(_0x4c0b3d,_0x17ae96){_0x17ae96=_0x17ae96||0xc8;return function(_0x270d2c){if(_0x270d2c){return _0x4c0b3d[_0x5322('0x1b')](_0x17ae96)[_0x5322('0x1c')](_0x270d2c);}};}function respondWithFilteredResult(_0x228702,_0x31cfdc){return function(_0x28d4e8){if(_0x28d4e8){var _0x1e11fc=typeof _0x31cfdc[_0x5322('0x1d')]===_0x5322('0x1e')&&typeof _0x31cfdc['limit']==='undefined';var _0x1ec7d1=_0x28d4e8['count'];var _0x27bc08=_0x1e11fc?0x0:_0x31cfdc[_0x5322('0x1d')];var _0xd58f83=_0x1e11fc?_0x28d4e8[_0x5322('0x1f')]:_0x31cfdc[_0x5322('0x1d')]+_0x31cfdc['limit'];var _0x23be8d;if(_0xd58f83>=_0x1ec7d1){_0xd58f83=_0x1ec7d1;_0x23be8d=0xc8;}else{_0x23be8d=0xce;}_0x228702[_0x5322('0x1b')](_0x23be8d);return _0x228702['set'](_0x5322('0x20'),_0x27bc08+'-'+_0xd58f83+'/'+_0x1ec7d1)[_0x5322('0x1c')](_0x28d4e8);}return null;};}function patchUpdates(_0x4407c3){return function(_0x1c6231){try{jsonpatch[_0x5322('0x21')](_0x1c6231,_0x4407c3,!![]);}catch(_0x36ef8d){return BPromise[_0x5322('0x22')](_0x36ef8d);}return _0x1c6231[_0x5322('0x23')]();};}function saveUpdates(_0x31cb16,_0x1645b7){return function(_0x3660e7){if(_0x3660e7){return _0x3660e7[_0x5322('0x24')](_0x31cb16)['then'](function(_0x49d4fa){return _0x49d4fa;});}return null;};}function removeEntity(_0x186e64,_0x55e091){return function(_0x122a0d){if(_0x122a0d){return _0x122a0d[_0x5322('0x25')]()['then'](function(){_0x186e64[_0x5322('0x1b')](0xcc)[_0x5322('0x1a')]();});}};}function handleEntityNotFound(_0x1d239f,_0x2a764c){return function(_0x5479cf){if(!_0x5479cf){_0x1d239f['sendStatus'](0x194);}return _0x5479cf;};}function handleError(_0x475a46,_0x307c6a){_0x307c6a=_0x307c6a||0x1f4;return function(_0x363429){logger['error'](_0x363429[_0x5322('0x26')]);if(_0x363429['name']){delete _0x363429['name'];}_0x475a46['status'](_0x307c6a)['send'](_0x363429);};}exports['index']=function(_0x1594b9,_0x9510b5){var _0x45d9bd={},_0x535c97={},_0x583f6c={'count':0x0,'rows':[]};var _0x2fb061=_[_0x5322('0x27')](db[_0x5322('0x28')][_0x5322('0x29')],function(_0x3a21bd){return{'name':_0x3a21bd[_0x5322('0x2a')],'type':_0x3a21bd[_0x5322('0x2b')][_0x5322('0x2c')]};});_0x535c97[_0x5322('0x2d')]=_[_0x5322('0x27')](_0x2fb061,_0x5322('0x2e'));_0x535c97['query']=_[_0x5322('0x2f')](_0x1594b9[_0x5322('0x30')]);_0x535c97[_0x5322('0x31')]=_[_0x5322('0x32')](_0x535c97[_0x5322('0x2d')],_0x535c97['query']);_0x45d9bd[_0x5322('0x33')]=_[_0x5322('0x32')](_0x535c97[_0x5322('0x2d')],qs[_0x5322('0x34')](_0x1594b9[_0x5322('0x30')][_0x5322('0x34')]));_0x45d9bd[_0x5322('0x33')]=_0x45d9bd[_0x5322('0x33')]['length']?_0x45d9bd[_0x5322('0x33')]:_0x535c97[_0x5322('0x2d')];if(!_0x1594b9['query'][_0x5322('0x35')](_0x5322('0x36'))){_0x45d9bd[_0x5322('0x37')]=qs[_0x5322('0x37')](_0x1594b9[_0x5322('0x30')][_0x5322('0x37')]);_0x45d9bd[_0x5322('0x1d')]=qs[_0x5322('0x1d')](_0x1594b9['query']['offset']);}_0x45d9bd[_0x5322('0x38')]=qs[_0x5322('0x39')](_0x1594b9['query']['sort']);_0x45d9bd['where']=qs[_0x5322('0x31')](_['pick'](_0x1594b9['query'],_0x535c97[_0x5322('0x31')]),_0x2fb061);if(_0x1594b9[_0x5322('0x30')][_0x5322('0x3a')]){_0x45d9bd[_0x5322('0x3b')]=_[_0x5322('0x3c')](_0x45d9bd[_0x5322('0x3b')],{'$or':_['map'](_0x2fb061,function(_0x24371e){if(_0x24371e[_0x5322('0x2b')]!==_0x5322('0x3d')){var _0x3c2706={};_0x3c2706[_0x24371e[_0x5322('0x2e')]]={'$like':'%'+_0x1594b9[_0x5322('0x30')][_0x5322('0x3a')]+'%'};return _0x3c2706;}})});}_0x45d9bd=_[_0x5322('0x3c')]({},_0x45d9bd,_0x1594b9[_0x5322('0x3e')]);var _0x35b495={'where':_0x45d9bd[_0x5322('0x3b')]};return db['ZendeskConfiguration']['count'](_0x35b495)[_0x5322('0x3f')](function(_0x5e195f){_0x583f6c[_0x5322('0x1f')]=_0x5e195f;if(_0x1594b9[_0x5322('0x30')][_0x5322('0x40')]){_0x45d9bd[_0x5322('0x41')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x5322('0x42')](_0x45d9bd);})[_0x5322('0x3f')](function(_0x495294){_0x583f6c[_0x5322('0x43')]=_0x495294;return _0x583f6c;})[_0x5322('0x3f')](respondWithFilteredResult(_0x9510b5,_0x45d9bd))[_0x5322('0x44')](handleError(_0x9510b5,null));};exports['show']=function(_0x172f77,_0x5c9990){var _0x3ceb7e={'raw':![],'where':{'id':_0x172f77[_0x5322('0x45')]['id']}},_0x320659={};_0x320659[_0x5322('0x2d')]=_[_0x5322('0x2f')](db[_0x5322('0x28')][_0x5322('0x29')]);_0x320659['query']=_[_0x5322('0x2f')](_0x172f77[_0x5322('0x30')]);_0x320659[_0x5322('0x31')]=_['intersection'](_0x320659[_0x5322('0x2d')],_0x320659[_0x5322('0x30')]);_0x3ceb7e[_0x5322('0x33')]=_[_0x5322('0x32')](_0x320659['model'],qs['fields'](_0x172f77['query'][_0x5322('0x34')]));_0x3ceb7e[_0x5322('0x33')]=_0x3ceb7e[_0x5322('0x33')]['length']?_0x3ceb7e[_0x5322('0x33')]:_0x320659[_0x5322('0x2d')];if(_0x172f77[_0x5322('0x30')]['includeAll']){_0x3ceb7e['include']=[{'all':!![]}];}_0x3ceb7e=_['merge']({},_0x3ceb7e,_0x172f77[_0x5322('0x3e')]);return db[_0x5322('0x28')][_0x5322('0x46')](_0x3ceb7e)[_0x5322('0x3f')](handleEntityNotFound(_0x5c9990,null))[_0x5322('0x3f')](respondWithResult(_0x5c9990,null))[_0x5322('0x44')](handleError(_0x5c9990,null));};exports[_0x5322('0x47')]=function(_0x11076e,_0x341eb8){return db[_0x5322('0x28')][_0x5322('0x47')](_0x11076e[_0x5322('0x48')],{})[_0x5322('0x3f')](respondWithResult(_0x341eb8,0xc9))[_0x5322('0x44')](handleError(_0x341eb8,null));};exports['update']=function(_0x4fc705,_0x332401){if(_0x4fc705[_0x5322('0x48')]['id']){delete _0x4fc705[_0x5322('0x48')]['id'];}return db['ZendeskConfiguration'][_0x5322('0x46')]({'where':{'id':_0x4fc705['params']['id']}})[_0x5322('0x3f')](handleEntityNotFound(_0x332401,null))[_0x5322('0x3f')](saveUpdates(_0x4fc705['body'],null))[_0x5322('0x3f')](respondWithResult(_0x332401,null))[_0x5322('0x44')](handleError(_0x332401,null));};exports['destroy']=function(_0x4af7a1,_0x39b815){return db[_0x5322('0x28')]['find']({'where':{'id':_0x4af7a1['params']['id']}})[_0x5322('0x3f')](handleEntityNotFound(_0x39b815,null))[_0x5322('0x3f')](removeEntity(_0x39b815,null))[_0x5322('0x44')](handleError(_0x39b815,null));};exports[_0x5322('0x49')]=function(_0x32bcae,_0x4e4daf,_0x28a5b5){var _0x9cc653={};var _0x2f69d4={};var _0x383ecd;var _0x48f4b3;return db[_0x5322('0x28')][_0x5322('0x4a')]({'where':{'id':_0x32bcae['params']['id']}})[_0x5322('0x3f')](handleEntityNotFound(_0x4e4daf,null))[_0x5322('0x3f')](function(_0x2f8809){if(_0x2f8809){_0x383ecd=_0x2f8809;_0x2f69d4[_0x5322('0x2d')]=_[_0x5322('0x2f')](db[_0x5322('0x4b')][_0x5322('0x29')]);_0x2f69d4[_0x5322('0x30')]=_[_0x5322('0x2f')](_0x32bcae['query']);_0x2f69d4[_0x5322('0x31')]=_[_0x5322('0x32')](_0x2f69d4[_0x5322('0x2d')],_0x2f69d4['query']);_0x9cc653[_0x5322('0x33')]=_[_0x5322('0x32')](_0x2f69d4[_0x5322('0x2d')],qs[_0x5322('0x34')](_0x32bcae[_0x5322('0x30')][_0x5322('0x34')]));_0x9cc653[_0x5322('0x33')]=_0x9cc653[_0x5322('0x33')][_0x5322('0x4c')]?_0x9cc653[_0x5322('0x33')]:_0x2f69d4['model'];_0x9cc653[_0x5322('0x38')]=qs[_0x5322('0x39')](_0x32bcae['query'][_0x5322('0x39')]);_0x9cc653['where']=qs[_0x5322('0x31')](_[_0x5322('0x4d')](_0x32bcae[_0x5322('0x30')],_0x2f69d4[_0x5322('0x31')]));if(_0x32bcae['query']['filter']){_0x9cc653[_0x5322('0x3b')]=_[_0x5322('0x3c')](_0x9cc653['where'],{'$or':_[_0x5322('0x27')](_0x9cc653[_0x5322('0x33')],function(_0x3424df){var _0x3f9341={};_0x3f9341[_0x3424df]={'$like':'%'+_0x32bcae[_0x5322('0x30')][_0x5322('0x3a')]+'%'};return _0x3f9341;})});}_0x9cc653=_['merge']({},_0x9cc653,_0x32bcae[_0x5322('0x3e')]);return _0x383ecd[_0x5322('0x49')](_0x9cc653);}})[_0x5322('0x3f')](function(_0x1cd6a9){if(_0x1cd6a9){_0x48f4b3=_0x1cd6a9[_0x5322('0x4c')];if(!_0x32bcae[_0x5322('0x30')]['hasOwnProperty'](_0x5322('0x36'))){_0x9cc653['limit']=qs['limit'](_0x32bcae[_0x5322('0x30')]['limit']);_0x9cc653[_0x5322('0x1d')]=qs['offset'](_0x32bcae['query'][_0x5322('0x1d')]);}return _0x383ecd[_0x5322('0x49')](_0x9cc653);}})[_0x5322('0x3f')](function(_0x58dbb4){if(_0x58dbb4){return _0x58dbb4?{'count':_0x48f4b3,'rows':_0x58dbb4}:null;}})['then'](respondWithResult(_0x4e4daf,null))[_0x5322('0x44')](handleError(_0x4e4daf,null));};exports[_0x5322('0x4e')]=function(_0x1ea6e4,_0x493d22,_0x4a07d4){var _0x1ab5f6={};var _0x3bba8a={};var _0xc217b9;var _0x9bfcb5;return db[_0x5322('0x28')][_0x5322('0x4a')]({'where':{'id':_0x1ea6e4[_0x5322('0x45')]['id']}})[_0x5322('0x3f')](handleEntityNotFound(_0x493d22,null))[_0x5322('0x3f')](function(_0x394058){if(_0x394058){_0xc217b9=_0x394058;_0x3bba8a[_0x5322('0x2d')]=_['keys'](db[_0x5322('0x4b')]['rawAttributes']);_0x3bba8a[_0x5322('0x30')]=_['keys'](_0x1ea6e4[_0x5322('0x30')]);_0x3bba8a[_0x5322('0x31')]=_[_0x5322('0x32')](_0x3bba8a[_0x5322('0x2d')],_0x3bba8a[_0x5322('0x30')]);_0x1ab5f6[_0x5322('0x33')]=_[_0x5322('0x32')](_0x3bba8a[_0x5322('0x2d')],qs[_0x5322('0x34')](_0x1ea6e4[_0x5322('0x30')][_0x5322('0x34')]));_0x1ab5f6[_0x5322('0x33')]=_0x1ab5f6[_0x5322('0x33')][_0x5322('0x4c')]?_0x1ab5f6[_0x5322('0x33')]:_0x3bba8a['model'];_0x1ab5f6[_0x5322('0x38')]=qs[_0x5322('0x39')](_0x1ea6e4[_0x5322('0x30')][_0x5322('0x39')]);_0x1ab5f6[_0x5322('0x3b')]=qs['filters'](_['pick'](_0x1ea6e4[_0x5322('0x30')],_0x3bba8a[_0x5322('0x31')]));if(_0x1ea6e4[_0x5322('0x30')][_0x5322('0x3a')]){_0x1ab5f6[_0x5322('0x3b')]=_['merge'](_0x1ab5f6[_0x5322('0x3b')],{'$or':_[_0x5322('0x27')](_0x1ab5f6[_0x5322('0x33')],function(_0x2782d6){var _0x63bcb2={};_0x63bcb2[_0x2782d6]={'$like':'%'+_0x1ea6e4['query'][_0x5322('0x3a')]+'%'};return _0x63bcb2;})});}_0x1ab5f6=_[_0x5322('0x3c')]({},_0x1ab5f6,_0x1ea6e4[_0x5322('0x3e')]);return _0xc217b9[_0x5322('0x4e')](_0x1ab5f6);}})[_0x5322('0x3f')](function(_0x3e6247){if(_0x3e6247){_0x9bfcb5=_0x3e6247['length'];if(!_0x1ea6e4[_0x5322('0x30')][_0x5322('0x35')]('nolimit')){_0x1ab5f6[_0x5322('0x37')]=qs['limit'](_0x1ea6e4[_0x5322('0x30')][_0x5322('0x37')]);_0x1ab5f6[_0x5322('0x1d')]=qs[_0x5322('0x1d')](_0x1ea6e4[_0x5322('0x30')][_0x5322('0x1d')]);}return _0xc217b9[_0x5322('0x4e')](_0x1ab5f6);}})[_0x5322('0x3f')](function(_0x232a06){if(_0x232a06){return _0x232a06?{'count':_0x9bfcb5,'rows':_0x232a06}:null;}})[_0x5322('0x3f')](respondWithResult(_0x493d22,null))[_0x5322('0x44')](handleError(_0x493d22,null));};exports[_0x5322('0x4f')]=function(_0x32e5be,_0x413fd6,_0x280b07){var _0x1b31f9={};var _0x1d2235={};var _0x5e4d83;var _0x10c4a7;return db[_0x5322('0x28')][_0x5322('0x4a')]({'where':{'id':_0x32e5be[_0x5322('0x45')]['id']}})['then'](handleEntityNotFound(_0x413fd6,null))[_0x5322('0x3f')](function(_0x4f4262){if(_0x4f4262){_0x5e4d83=_0x4f4262;_0x1d2235[_0x5322('0x2d')]=_[_0x5322('0x2f')](db['ZendeskField'][_0x5322('0x29')]);_0x1d2235['query']=_['keys'](_0x32e5be['query']);_0x1d2235['filters']=_[_0x5322('0x32')](_0x1d2235[_0x5322('0x2d')],_0x1d2235[_0x5322('0x30')]);_0x1b31f9[_0x5322('0x33')]=_[_0x5322('0x32')](_0x1d2235[_0x5322('0x2d')],qs['fields'](_0x32e5be['query'][_0x5322('0x34')]));_0x1b31f9[_0x5322('0x33')]=_0x1b31f9[_0x5322('0x33')]['length']?_0x1b31f9[_0x5322('0x33')]:_0x1d2235[_0x5322('0x2d')];_0x1b31f9['order']=qs[_0x5322('0x39')](_0x32e5be[_0x5322('0x30')][_0x5322('0x39')]);_0x1b31f9[_0x5322('0x3b')]=qs[_0x5322('0x31')](_[_0x5322('0x4d')](_0x32e5be[_0x5322('0x30')],_0x1d2235[_0x5322('0x31')]));if(_0x32e5be[_0x5322('0x30')]['filter']){_0x1b31f9[_0x5322('0x3b')]=_[_0x5322('0x3c')](_0x1b31f9['where'],{'$or':_[_0x5322('0x27')](_0x1b31f9['attributes'],function(_0x245003){var _0x1d7bfb={};_0x1d7bfb[_0x245003]={'$like':'%'+_0x32e5be[_0x5322('0x30')][_0x5322('0x3a')]+'%'};return _0x1d7bfb;})});}_0x1b31f9=_[_0x5322('0x3c')]({},_0x1b31f9,_0x32e5be[_0x5322('0x3e')]);return _0x5e4d83[_0x5322('0x4f')](_0x1b31f9);}})[_0x5322('0x3f')](function(_0x5e3188){if(_0x5e3188){_0x10c4a7=_0x5e3188['length'];if(!_0x32e5be[_0x5322('0x30')][_0x5322('0x35')](_0x5322('0x36'))){_0x1b31f9[_0x5322('0x37')]=qs[_0x5322('0x37')](_0x32e5be[_0x5322('0x30')][_0x5322('0x37')]);_0x1b31f9[_0x5322('0x1d')]=qs[_0x5322('0x1d')](_0x32e5be[_0x5322('0x30')][_0x5322('0x1d')]);}return _0x5e4d83[_0x5322('0x4f')](_0x1b31f9);}})[_0x5322('0x3f')](function(_0x693cde){if(_0x693cde){return _0x693cde?{'count':_0x10c4a7,'rows':_0x693cde}:null;}})['then'](respondWithResult(_0x413fd6,null))[_0x5322('0x44')](handleError(_0x413fd6,null));};exports[_0x5322('0x50')]=function(_0x475875,_0x102268,_0x279ecc){var _0x432eb2={};var _0xdc925c={};var _0x3f33d7;var _0x353ac7;return db[_0x5322('0x28')]['findOne']({'where':{'id':_0x475875[_0x5322('0x45')]['id']}})['then'](handleEntityNotFound(_0x102268,null))[_0x5322('0x3f')](function(_0x59b974){if(_0x59b974){_0x3f33d7=_0x59b974;_0xdc925c[_0x5322('0x2d')]=_[_0x5322('0x2f')](db[_0x5322('0x51')]['rawAttributes']);_0xdc925c[_0x5322('0x30')]=_[_0x5322('0x2f')](_0x475875['query']);_0xdc925c[_0x5322('0x31')]=_[_0x5322('0x32')](_0xdc925c['model'],_0xdc925c[_0x5322('0x30')]);_0x432eb2[_0x5322('0x33')]=_[_0x5322('0x32')](_0xdc925c[_0x5322('0x2d')],qs[_0x5322('0x34')](_0x475875[_0x5322('0x30')][_0x5322('0x34')]));_0x432eb2[_0x5322('0x33')]=_0x432eb2[_0x5322('0x33')][_0x5322('0x4c')]?_0x432eb2['attributes']:_0xdc925c[_0x5322('0x2d')];_0x432eb2['order']=qs['sort'](_0x475875[_0x5322('0x30')][_0x5322('0x39')]);_0x432eb2[_0x5322('0x3b')]=qs['filters'](_[_0x5322('0x4d')](_0x475875['query'],_0xdc925c['filters']));if(_0x475875[_0x5322('0x30')][_0x5322('0x3a')]){_0x432eb2[_0x5322('0x3b')]=_['merge'](_0x432eb2[_0x5322('0x3b')],{'$or':_[_0x5322('0x27')](_0x432eb2['attributes'],function(_0x35f858){var _0x2e4913={};_0x2e4913[_0x35f858]={'$like':'%'+_0x475875[_0x5322('0x30')][_0x5322('0x3a')]+'%'};return _0x2e4913;})});}_0x432eb2=_[_0x5322('0x3c')]({},_0x432eb2,_0x475875[_0x5322('0x3e')]);return _0x3f33d7[_0x5322('0x50')](_0x432eb2);}})[_0x5322('0x3f')](function(_0x3ab45f){if(_0x3ab45f){_0x353ac7=_0x3ab45f[_0x5322('0x4c')];if(!_0x475875[_0x5322('0x30')][_0x5322('0x35')]('nolimit')){_0x432eb2[_0x5322('0x37')]=qs[_0x5322('0x37')](_0x475875[_0x5322('0x30')][_0x5322('0x37')]);_0x432eb2[_0x5322('0x1d')]=qs[_0x5322('0x1d')](_0x475875[_0x5322('0x30')][_0x5322('0x1d')]);}return _0x3f33d7[_0x5322('0x50')](_0x432eb2);}})[_0x5322('0x3f')](function(_0x40b0d9){if(_0x40b0d9){return _0x40b0d9?{'count':_0x353ac7,'rows':_0x40b0d9}:null;}})['then'](respondWithResult(_0x102268,null))['catch'](handleError(_0x102268,null));};exports[_0x5322('0x52')]=function(_0x5d8c25,_0xc0557,_0x392dac){if(_0x5d8c25[_0x5322('0x48')]['id']){delete _0x5d8c25[_0x5322('0x48')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5d8c25[_0x5322('0x45')]['id']}})[_0x5322('0x3f')](handleEntityNotFound(_0xc0557,null))['then'](function(_0x116daf){if(_0x116daf){return _0x116daf[_0x5322('0x52')](_0x5d8c25[_0x5322('0x48')]['ids']||[]);}return null;})[_0x5322('0x3f')](respondWithResult(_0xc0557,null))[_0x5322('0x44')](handleError(_0xc0557,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 41d9700..d411e0f 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 _0x34b7=['request-promise','path','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','../../config/logger','api','moment','bluebird'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0x34b7,0x196));var _0x734b=function(_0x13f601,_0x4dc50f){_0x13f601=_0x13f601-0x0;var _0xad44c0=_0x34b7[_0x13f601];return _0xad44c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var moment=require(_0x734b('0x2'));var BPromise=require(_0x734b('0x3'));var rp=require(_0x734b('0x4'));var fs=require('fs');var path=require(_0x734b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x734b('0x6'));module[_0x734b('0x7')]=function(_0x2f3128,_0x34fd70){return _0x2f3128[_0x734b('0x8')](_0x734b('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x955f=['int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','ZendeskConfiguration'];(function(_0x5d81a0,_0x362035){var _0x1486b2=function(_0xbd1bfd){while(--_0xbd1bfd){_0x5d81a0['push'](_0x5d81a0['shift']());}};_0x1486b2(++_0x362035);}(_0x955f,0x1eb));var _0xf955=function(_0x4a5386,_0x38f556){_0x4a5386=_0x4a5386-0x0;var _0x1d5a3b=_0x955f[_0x4a5386];return _0x1d5a3b;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf955('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('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 c99c82a..df77e45 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 _0xfc7e=['rpc','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','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xdf11e9,_0xf877ed){var _0x56d024=function(_0x581c6e){while(--_0x581c6e){_0xdf11e9['push'](_0xdf11e9['shift']());}};_0x56d024(++_0xf877ed);}(_0xfc7e,0x169));var _0xefc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xefc7('0x0'));var util=require(_0xefc7('0x1'));var moment=require('moment');var BPromise=require(_0xefc7('0x2'));var rs=require(_0xefc7('0x3'));var fs=require('fs');var Redis=require(_0xefc7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xefc7('0x5'));var logger=require(_0xefc7('0x6'))(_0xefc7('0x7'));var config=require('../../config/environment');var jayson=require(_0xefc7('0x8'));var client=jayson[_0xefc7('0x9')][_0xefc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1682,_0x1b5d83,_0x5936b7){return new BPromise(function(_0x5e80db,_0x2f0f11){return client[_0xefc7('0xb')](_0x5c1682,_0x5936b7)[_0xefc7('0xc')](function(_0x2d9f51){logger[_0xefc7('0xd')](_0xefc7('0xe'),_0x1b5d83,_0xefc7('0xf'));logger[_0xefc7('0x10')](_0xefc7('0x11'),_0x1b5d83,_0xefc7('0xf'),JSON[_0xefc7('0x12')](_0x2d9f51));if(_0x2d9f51[_0xefc7('0x13')]){if(_0x2d9f51[_0xefc7('0x13')][_0xefc7('0x14')]===0x1f4){logger[_0xefc7('0x13')](_0xefc7('0xe'),_0x1b5d83,_0x2d9f51['error'][_0xefc7('0x15')]);return _0x2f0f11(_0x2d9f51[_0xefc7('0x13')]['message']);}logger[_0xefc7('0x13')](_0xefc7('0xe'),_0x1b5d83,_0x2d9f51[_0xefc7('0x13')]['message']);return _0x5e80db(_0x2d9f51[_0xefc7('0x13')][_0xefc7('0x15')]);}else{logger['info'](_0xefc7('0xe'),_0x1b5d83,_0xefc7('0xf'));_0x5e80db(_0x2d9f51['result'][_0xefc7('0x15')]);}})[_0xefc7('0x16')](function(_0xe23c3b){logger['error'](_0xefc7('0xe'),_0x1b5d83,_0xe23c3b);_0x2f0f11(_0xe23c3b);});});} \ No newline at end of file +var _0xa959=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x176b1c,_0x427b98){var _0x1a06ee=function(_0x295fae){while(--_0x295fae){_0x176b1c['push'](_0x176b1c['shift']());}};_0x1a06ee(++_0x427b98);}(_0xa959,0xa9));var _0x9a95=function(_0x47b88a,_0x2924ef){_0x47b88a=_0x47b88a-0x0;var _0x11112f=_0xa959[_0x47b88a];return _0x11112f;};'use strict';var _=require(_0x9a95('0x0'));var util=require(_0x9a95('0x1'));var moment=require(_0x9a95('0x2'));var BPromise=require(_0x9a95('0x3'));var rs=require(_0x9a95('0x4'));var fs=require('fs');var Redis=require(_0x9a95('0x5'));var db=require(_0x9a95('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a95('0x7'))(_0x9a95('0x8'));var config=require(_0x9a95('0x9'));var jayson=require(_0x9a95('0xa'));var client=jayson[_0x9a95('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c3c43,_0xaa8ff0,_0x32ece6){return new BPromise(function(_0x31fca0,_0x18fb01){return client[_0x9a95('0xc')](_0x5c3c43,_0x32ece6)[_0x9a95('0xd')](function(_0xe27399){logger[_0x9a95('0xe')](_0x9a95('0xf'),_0xaa8ff0,_0x9a95('0x10'));logger[_0x9a95('0x11')](_0x9a95('0x12'),_0xaa8ff0,_0x9a95('0x10'),JSON[_0x9a95('0x13')](_0xe27399));if(_0xe27399[_0x9a95('0x14')]){if(_0xe27399[_0x9a95('0x14')]['code']===0x1f4){logger[_0x9a95('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0xaa8ff0,_0xe27399[_0x9a95('0x14')]['message']);return _0x18fb01(_0xe27399['error'][_0x9a95('0x15')]);}logger['error'](_0x9a95('0xf'),_0xaa8ff0,_0xe27399[_0x9a95('0x14')][_0x9a95('0x15')]);return _0x31fca0(_0xe27399[_0x9a95('0x14')][_0x9a95('0x15')]);}else{logger[_0x9a95('0xe')](_0x9a95('0xf'),_0xaa8ff0,_0x9a95('0x10'));_0x31fca0(_0xe27399[_0x9a95('0x16')][_0x9a95('0x15')]);}})['catch'](function(_0x22853d){logger['error'](_0x9a95('0xf'),_0xaa8ff0,_0x22853d);_0x18fb01(_0x22853d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f06cc3e..624b1f6 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 _0xf4a9=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x3029e5,_0x59cfa2){var _0x47acc6=function(_0x186b66){while(--_0x186b66){_0x3029e5['push'](_0x3029e5['shift']());}};_0x47acc6(++_0x59cfa2);}(_0xf4a9,0xd2));var _0x9f4a=function(_0x4b4c3b,_0x121398){_0x4b4c3b=_0x4b4c3b-0x0;var _0x125d77=_0xf4a9[_0x4b4c3b];return _0x125d77;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9f4a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f4a('0x1'));var auth=require(_0x9f4a('0x2'));var interaction=require(_0x9f4a('0x3'));var config=require(_0x9f4a('0x4'));var controller=require(_0x9f4a('0x5'));router[_0x9f4a('0x6')]('/',auth['isAuthenticated'](),controller[_0x9f4a('0x7')]);router['get'](_0x9f4a('0x8'),auth[_0x9f4a('0x9')](),controller[_0x9f4a('0xa')]);router['post']('/',auth[_0x9f4a('0x9')](),controller[_0x9f4a('0xb')]);router[_0x9f4a('0xc')](_0x9f4a('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x9f4a('0xd')]('/:id',auth[_0x9f4a('0x9')](),controller[_0x9f4a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x12e3=['isAuthenticated','show','update','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x2f8e5a,_0x56f1b1){var _0x3b839d=function(_0x30d324){while(--_0x30d324){_0x2f8e5a['push'](_0x2f8e5a['shift']());}};_0x3b839d(++_0x56f1b1);}(_0x12e3,0x140));var _0x312e=function(_0x5bd3e8,_0x2d77d5){_0x5bd3e8=_0x5bd3e8-0x0;var _0xf83837=_0x12e3[_0x5bd3e8];return _0xf83837;};'use strict';var multer=require('multer');var util=require(_0x312e('0x0'));var path=require(_0x312e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x312e('0x2')]();var fs_extra=require(_0x312e('0x3'));var auth=require(_0x312e('0x4'));var interaction=require(_0x312e('0x5'));var config=require(_0x312e('0x6'));var controller=require('./intZendeskField.controller');router[_0x312e('0x7')]('/',auth['isAuthenticated'](),controller[_0x312e('0x8')]);router['get'](_0x312e('0x9'),auth[_0x312e('0xa')](),controller[_0x312e('0xb')]);router['post']('/',auth[_0x312e('0xa')](),controller['create']);router['put']('/:id',auth[_0x312e('0xa')](),controller[_0x312e('0xc')]);router['delete'](_0x312e('0x9'),auth[_0x312e('0xa')](),controller[_0x312e('0xd')]);module[_0x312e('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index a83c7df..b3438ef 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 _0x30eb=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x4fbfe9,_0x46308d){var _0x1dbbb1=function(_0x2e411e){while(--_0x2e411e){_0x4fbfe9['push'](_0x4fbfe9['shift']());}};_0x1dbbb1(++_0x46308d);}(_0x30eb,0xab));var _0xb30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30eb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb30e('0x0'));module[_0xb30e('0x1')]={'type':{'type':Sequelize[_0xb30e('0x2')](_0xb30e('0x3'),_0xb30e('0x4'),'customVariable',_0xb30e('0x5'),_0xb30e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb30e('0x7')]},'key':{'type':Sequelize[_0xb30e('0x7')]},'keyType':{'type':Sequelize[_0xb30e('0x2')]('string',_0xb30e('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xb30e('0x7')]},'idField':{'type':Sequelize[_0xb30e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb30e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb30e('0x7')]}}; \ No newline at end of file +var _0x34d7=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x34d7,0x1ac));var _0x734d=function(_0x6ac782,_0x5afae8){_0x6ac782=_0x6ac782-0x0;var _0x5d7da9=_0x34d7[_0x6ac782];return _0x5d7da9;};'use strict';var Sequelize=require(_0x734d('0x0'));module[_0x734d('0x1')]={'type':{'type':Sequelize[_0x734d('0x2')](_0x734d('0x3'),_0x734d('0x4'),'customVariable',_0x734d('0x5'),_0x734d('0x6')),'defaultValue':_0x734d('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x734d('0x7')]},'keyType':{'type':Sequelize[_0x734d('0x2')](_0x734d('0x3'),_0x734d('0x4'),_0x734d('0x8'))},'keyContent':{'type':Sequelize[_0x734d('0x7')]},'idField':{'type':Sequelize[_0x734d('0x7')]},'nameField':{'type':Sequelize[_0x734d('0x7')]},'customField':{'type':Sequelize[_0x734d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x734d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1858c37..72168a2 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 _0x0bc1=['jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0bc1,0x1ae));var _0x10bc=function(_0x4ceed5,_0x4e10a5){_0x4ceed5=_0x4ceed5-0x0;var _0x3ea9af=_0x0bc1[_0x4ceed5];return _0x3ea9af;};'use strict';var emlformat=require(_0x10bc('0x0'));var rimraf=require(_0x10bc('0x1'));var zipdir=require(_0x10bc('0x2'));var jsonpatch=require(_0x10bc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x10bc('0x4'));var Mustache=require(_0x10bc('0x5'));var util=require(_0x10bc('0x6'));var path=require(_0x10bc('0x7'));var sox=require(_0x10bc('0x8'));var csv=require('to-csv');var ejs=require(_0x10bc('0x9'));var fs=require('fs');var fs_extra=require(_0x10bc('0xa'));var _=require(_0x10bc('0xb'));var squel=require(_0x10bc('0xc'));var crypto=require(_0x10bc('0xd'));var jsforce=require(_0x10bc('0xe'));var deskjs=require(_0x10bc('0xf'));var toCsv=require(_0x10bc('0x10'));var querystring=require('querystring');var Papa=require(_0x10bc('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x10bc('0x12'));var as=require(_0x10bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10bc('0x14'))(_0x10bc('0x15'));var utils=require(_0x10bc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x10bc('0x17'));var db=require(_0x10bc('0x18'))['db'];function respondWithStatusCode(_0x38eca8,_0x131d7f){_0x131d7f=_0x131d7f||0xcc;return function(_0x448c6d){if(_0x448c6d){return _0x38eca8[_0x10bc('0x19')](_0x131d7f);}return _0x38eca8[_0x10bc('0x1a')](_0x131d7f)[_0x10bc('0x1b')]();};}function respondWithResult(_0x93b9bd,_0x1355cc){_0x1355cc=_0x1355cc||0xc8;return function(_0x1eab9f){if(_0x1eab9f){return _0x93b9bd[_0x10bc('0x1a')](_0x1355cc)[_0x10bc('0x1c')](_0x1eab9f);}};}function respondWithFilteredResult(_0x6f5d1c,_0x3ba14f){return function(_0xf82b30){if(_0xf82b30){var _0xfe8702=typeof _0x3ba14f[_0x10bc('0x1d')]===_0x10bc('0x1e')&&typeof _0x3ba14f['limit']===_0x10bc('0x1e');var _0x4838cc=_0xf82b30[_0x10bc('0x1f')];var _0x5dbc05=_0xfe8702?0x0:_0x3ba14f['offset'];var _0x14e9db=_0xfe8702?_0xf82b30[_0x10bc('0x1f')]:_0x3ba14f[_0x10bc('0x1d')]+_0x3ba14f['limit'];var _0xa82d37;if(_0x14e9db>=_0x4838cc){_0x14e9db=_0x4838cc;_0xa82d37=0xc8;}else{_0xa82d37=0xce;}_0x6f5d1c['status'](_0xa82d37);return _0x6f5d1c[_0x10bc('0x20')]('Content-Range',_0x5dbc05+'-'+_0x14e9db+'/'+_0x4838cc)[_0x10bc('0x1c')](_0xf82b30);}return null;};}function patchUpdates(_0x106233){return function(_0x587793){try{jsonpatch[_0x10bc('0x21')](_0x587793,_0x106233,!![]);}catch(_0xc15dcc){return BPromise['reject'](_0xc15dcc);}return _0x587793[_0x10bc('0x22')]();};}function saveUpdates(_0x177620,_0x34a947){return function(_0x279cf8){if(_0x279cf8){return _0x279cf8[_0x10bc('0x23')](_0x177620)[_0x10bc('0x24')](function(_0x5dd52b){return _0x5dd52b;});}return null;};}function removeEntity(_0x534a34,_0x18d4d1){return function(_0x158efc){if(_0x158efc){return _0x158efc['destroy']()[_0x10bc('0x24')](function(){_0x534a34[_0x10bc('0x1a')](0xcc)[_0x10bc('0x1b')]();});}};}function handleEntityNotFound(_0x385a2e,_0x44dc51){return function(_0x38b1e9){if(!_0x38b1e9){_0x385a2e[_0x10bc('0x19')](0x194);}return _0x38b1e9;};}function handleError(_0x1e9b11,_0x1d4ff9){_0x1d4ff9=_0x1d4ff9||0x1f4;return function(_0x1dca59){logger[_0x10bc('0x25')](_0x1dca59[_0x10bc('0x26')]);if(_0x1dca59[_0x10bc('0x27')]){delete _0x1dca59['name'];}_0x1e9b11[_0x10bc('0x1a')](_0x1d4ff9)['send'](_0x1dca59);};}exports[_0x10bc('0x28')]=function(_0x1f5b2c,_0x547fe9){var _0x42d69c={},_0x4154e6={},_0x11d2eb={'count':0x0,'rows':[]};var _0x1c655d=_[_0x10bc('0x29')](db[_0x10bc('0x2a')][_0x10bc('0x2b')],function(_0x72e124){return{'name':_0x72e124[_0x10bc('0x2c')],'type':_0x72e124['type'][_0x10bc('0x2d')]};});_0x4154e6[_0x10bc('0x2e')]=_[_0x10bc('0x29')](_0x1c655d,_0x10bc('0x27'));_0x4154e6[_0x10bc('0x2f')]=_[_0x10bc('0x30')](_0x1f5b2c['query']);_0x4154e6['filters']=_['intersection'](_0x4154e6[_0x10bc('0x2e')],_0x4154e6[_0x10bc('0x2f')]);_0x42d69c[_0x10bc('0x31')]=_[_0x10bc('0x32')](_0x4154e6[_0x10bc('0x2e')],qs['fields'](_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x33')]));_0x42d69c[_0x10bc('0x31')]=_0x42d69c[_0x10bc('0x31')][_0x10bc('0x34')]?_0x42d69c[_0x10bc('0x31')]:_0x4154e6[_0x10bc('0x2e')];if(!_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x35')]('nolimit')){_0x42d69c[_0x10bc('0x36')]=qs[_0x10bc('0x36')](_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x36')]);_0x42d69c[_0x10bc('0x1d')]=qs['offset'](_0x1f5b2c['query']['offset']);}_0x42d69c[_0x10bc('0x37')]=qs[_0x10bc('0x38')](_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x38')]);_0x42d69c[_0x10bc('0x39')]=qs[_0x10bc('0x3a')](_['pick'](_0x1f5b2c[_0x10bc('0x2f')],_0x4154e6[_0x10bc('0x3a')]),_0x1c655d);if(_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x3b')]){_0x42d69c[_0x10bc('0x39')]=_[_0x10bc('0x3c')](_0x42d69c[_0x10bc('0x39')],{'$or':_['map'](_0x1c655d,function(_0x367e81){if(_0x367e81[_0x10bc('0x3d')]!==_0x10bc('0x3e')){var _0x1a6400={};_0x1a6400[_0x367e81[_0x10bc('0x27')]]={'$like':'%'+_0x1f5b2c[_0x10bc('0x2f')]['filter']+'%'};return _0x1a6400;}})});}_0x42d69c=_[_0x10bc('0x3c')]({},_0x42d69c,_0x1f5b2c[_0x10bc('0x3f')]);var _0x3bfcdd={'where':_0x42d69c[_0x10bc('0x39')]};return db[_0x10bc('0x2a')][_0x10bc('0x1f')](_0x3bfcdd)[_0x10bc('0x24')](function(_0x187db3){_0x11d2eb[_0x10bc('0x1f')]=_0x187db3;if(_0x1f5b2c['query']['includeAll']){_0x42d69c[_0x10bc('0x40')]=[{'all':!![]}];}return db[_0x10bc('0x2a')][_0x10bc('0x41')](_0x42d69c);})[_0x10bc('0x24')](function(_0x249def){_0x11d2eb['rows']=_0x249def;return _0x11d2eb;})[_0x10bc('0x24')](respondWithFilteredResult(_0x547fe9,_0x42d69c))[_0x10bc('0x42')](handleError(_0x547fe9,null));};exports[_0x10bc('0x43')]=function(_0x50c60f,_0x5b7d93){var _0x650bce={'raw':!![],'where':{'id':_0x50c60f[_0x10bc('0x44')]['id']}},_0x455c62={};_0x455c62[_0x10bc('0x2e')]=_[_0x10bc('0x30')](db[_0x10bc('0x2a')][_0x10bc('0x2b')]);_0x455c62[_0x10bc('0x2f')]=_['keys'](_0x50c60f[_0x10bc('0x2f')]);_0x455c62[_0x10bc('0x3a')]=_[_0x10bc('0x32')](_0x455c62[_0x10bc('0x2e')],_0x455c62[_0x10bc('0x2f')]);_0x650bce[_0x10bc('0x31')]=_[_0x10bc('0x32')](_0x455c62['model'],qs[_0x10bc('0x33')](_0x50c60f[_0x10bc('0x2f')][_0x10bc('0x33')]));_0x650bce[_0x10bc('0x31')]=_0x650bce['attributes'][_0x10bc('0x34')]?_0x650bce[_0x10bc('0x31')]:_0x455c62[_0x10bc('0x2e')];if(_0x50c60f[_0x10bc('0x2f')][_0x10bc('0x45')]){_0x650bce[_0x10bc('0x40')]=[{'all':!![]}];}_0x650bce=_[_0x10bc('0x3c')]({},_0x650bce,_0x50c60f['options']);return db[_0x10bc('0x2a')]['find'](_0x650bce)[_0x10bc('0x24')](handleEntityNotFound(_0x5b7d93,null))[_0x10bc('0x24')](respondWithResult(_0x5b7d93,null))[_0x10bc('0x42')](handleError(_0x5b7d93,null));};exports['create']=function(_0x128919,_0xa629ce){return db[_0x10bc('0x2a')][_0x10bc('0x46')](_0x128919[_0x10bc('0x47')],{})['then'](respondWithResult(_0xa629ce,0xc9))[_0x10bc('0x42')](handleError(_0xa629ce,null));};exports[_0x10bc('0x23')]=function(_0x108bc6,_0x36a3ca){if(_0x108bc6[_0x10bc('0x47')]['id']){delete _0x108bc6[_0x10bc('0x47')]['id'];}return db[_0x10bc('0x2a')][_0x10bc('0x48')]({'where':{'id':_0x108bc6[_0x10bc('0x44')]['id']}})[_0x10bc('0x24')](handleEntityNotFound(_0x36a3ca,null))['then'](saveUpdates(_0x108bc6[_0x10bc('0x47')],null))[_0x10bc('0x24')](respondWithResult(_0x36a3ca,null))[_0x10bc('0x42')](handleError(_0x36a3ca,null));};exports[_0x10bc('0x49')]=function(_0x1f224f,_0x408702){return db[_0x10bc('0x2a')]['find']({'where':{'id':_0x1f224f['params']['id']}})[_0x10bc('0x24')](handleEntityNotFound(_0x408702,null))[_0x10bc('0x24')](removeEntity(_0x408702,null))[_0x10bc('0x42')](handleError(_0x408702,null));}; \ No newline at end of file +var _0x7e35=['undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','includeAll','include','findAll','rows','show','params','keys','intersection','length','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x7e35,0xcc));var _0x57e3=function(_0x32170f,_0x3289ad){_0x32170f=_0x32170f-0x0;var _0x10e1b0=_0x7e35[_0x32170f];return _0x10e1b0;};'use strict';var emlformat=require(_0x57e3('0x0'));var rimraf=require(_0x57e3('0x1'));var zipdir=require(_0x57e3('0x2'));var jsonpatch=require(_0x57e3('0x3'));var rp=require(_0x57e3('0x4'));var moment=require(_0x57e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x57e3('0x6'));var util=require(_0x57e3('0x7'));var path=require(_0x57e3('0x8'));var sox=require('sox');var csv=require(_0x57e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57e3('0xa'));var _=require(_0x57e3('0xb'));var squel=require(_0x57e3('0xc'));var crypto=require(_0x57e3('0xd'));var jsforce=require(_0x57e3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x57e3('0x9'));var querystring=require(_0x57e3('0xf'));var Papa=require(_0x57e3('0x10'));var Redis=require('ioredis');var authService=require(_0x57e3('0x11'));var qs=require(_0x57e3('0x12'));var as=require(_0x57e3('0x13'));var hardwareService=require(_0x57e3('0x14'));var logger=require(_0x57e3('0x15'))('api');var utils=require(_0x57e3('0x16'));var config=require(_0x57e3('0x17'));var licenseUtil=require(_0x57e3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba6d7,_0x5ebdfe){_0x5ebdfe=_0x5ebdfe||0xcc;return function(_0x12ada4){if(_0x12ada4){return _0x5ba6d7[_0x57e3('0x19')](_0x5ebdfe);}return _0x5ba6d7[_0x57e3('0x1a')](_0x5ebdfe)[_0x57e3('0x1b')]();};}function respondWithResult(_0xdd8457,_0x4ca7ce){_0x4ca7ce=_0x4ca7ce||0xc8;return function(_0x33a2e3){if(_0x33a2e3){return _0xdd8457[_0x57e3('0x1a')](_0x4ca7ce)[_0x57e3('0x1c')](_0x33a2e3);}};}function respondWithFilteredResult(_0x43436f,_0x19eb39){return function(_0x37a72d){if(_0x37a72d){var _0x210d67=typeof _0x19eb39[_0x57e3('0x1d')]===_0x57e3('0x1e')&&typeof _0x19eb39[_0x57e3('0x1f')]==='undefined';var _0x2e73e7=_0x37a72d[_0x57e3('0x20')];var _0x4b64c8=_0x210d67?0x0:_0x19eb39['offset'];var _0x5a4521=_0x210d67?_0x37a72d[_0x57e3('0x20')]:_0x19eb39[_0x57e3('0x1d')]+_0x19eb39[_0x57e3('0x1f')];var _0x1a3d7c;if(_0x5a4521>=_0x2e73e7){_0x5a4521=_0x2e73e7;_0x1a3d7c=0xc8;}else{_0x1a3d7c=0xce;}_0x43436f[_0x57e3('0x1a')](_0x1a3d7c);return _0x43436f[_0x57e3('0x21')]('Content-Range',_0x4b64c8+'-'+_0x5a4521+'/'+_0x2e73e7)[_0x57e3('0x1c')](_0x37a72d);}return null;};}function patchUpdates(_0x570242){return function(_0x3bf489){try{jsonpatch[_0x57e3('0x22')](_0x3bf489,_0x570242,!![]);}catch(_0x5e2703){return BPromise[_0x57e3('0x23')](_0x5e2703);}return _0x3bf489[_0x57e3('0x24')]();};}function saveUpdates(_0x52b8d0,_0x387744){return function(_0x29f44e){if(_0x29f44e){return _0x29f44e[_0x57e3('0x25')](_0x52b8d0)[_0x57e3('0x26')](function(_0x32c3f4){return _0x32c3f4;});}return null;};}function removeEntity(_0x5b440b,_0x5260bf){return function(_0x591eb4){if(_0x591eb4){return _0x591eb4[_0x57e3('0x27')]()[_0x57e3('0x26')](function(){_0x5b440b[_0x57e3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9fb4,_0x29558b){return function(_0x27f5f0){if(!_0x27f5f0){_0x1b9fb4['sendStatus'](0x194);}return _0x27f5f0;};}function handleError(_0x2609c9,_0x28eedf){_0x28eedf=_0x28eedf||0x1f4;return function(_0x4e1b45){logger[_0x57e3('0x28')](_0x4e1b45[_0x57e3('0x29')]);if(_0x4e1b45[_0x57e3('0x2a')]){delete _0x4e1b45[_0x57e3('0x2a')];}_0x2609c9[_0x57e3('0x1a')](_0x28eedf)[_0x57e3('0x2b')](_0x4e1b45);};}exports[_0x57e3('0x2c')]=function(_0x47e372,_0x4d2f09){var _0x3493b9={},_0x4b9301={},_0x4fa2ee={'count':0x0,'rows':[]};var _0x479d99=_[_0x57e3('0x2d')](db['ZendeskField'][_0x57e3('0x2e')],function(_0x3941b1){return{'name':_0x3941b1[_0x57e3('0x2f')],'type':_0x3941b1[_0x57e3('0x30')][_0x57e3('0x31')]};});_0x4b9301[_0x57e3('0x32')]=_[_0x57e3('0x2d')](_0x479d99,_0x57e3('0x2a'));_0x4b9301[_0x57e3('0x33')]=_['keys'](_0x47e372[_0x57e3('0x33')]);_0x4b9301[_0x57e3('0x34')]=_['intersection'](_0x4b9301['model'],_0x4b9301[_0x57e3('0x33')]);_0x3493b9[_0x57e3('0x35')]=_['intersection'](_0x4b9301[_0x57e3('0x32')],qs['fields'](_0x47e372[_0x57e3('0x33')][_0x57e3('0x36')]));_0x3493b9[_0x57e3('0x35')]=_0x3493b9[_0x57e3('0x35')]['length']?_0x3493b9['attributes']:_0x4b9301[_0x57e3('0x32')];if(!_0x47e372['query'][_0x57e3('0x37')](_0x57e3('0x38'))){_0x3493b9['limit']=qs[_0x57e3('0x1f')](_0x47e372[_0x57e3('0x33')][_0x57e3('0x1f')]);_0x3493b9[_0x57e3('0x1d')]=qs[_0x57e3('0x1d')](_0x47e372[_0x57e3('0x33')]['offset']);}_0x3493b9['order']=qs[_0x57e3('0x39')](_0x47e372['query'][_0x57e3('0x39')]);_0x3493b9[_0x57e3('0x3a')]=qs[_0x57e3('0x34')](_[_0x57e3('0x3b')](_0x47e372['query'],_0x4b9301[_0x57e3('0x34')]),_0x479d99);if(_0x47e372[_0x57e3('0x33')][_0x57e3('0x3c')]){_0x3493b9[_0x57e3('0x3a')]=_[_0x57e3('0x3d')](_0x3493b9[_0x57e3('0x3a')],{'$or':_[_0x57e3('0x2d')](_0x479d99,function(_0x3abcb8){if(_0x3abcb8['type']!==_0x57e3('0x3e')){var _0x4b2807={};_0x4b2807[_0x3abcb8[_0x57e3('0x2a')]]={'$like':'%'+_0x47e372['query'][_0x57e3('0x3c')]+'%'};return _0x4b2807;}})});}_0x3493b9=_['merge']({},_0x3493b9,_0x47e372['options']);var _0x4a7280={'where':_0x3493b9[_0x57e3('0x3a')]};return db[_0x57e3('0x3f')][_0x57e3('0x20')](_0x4a7280)[_0x57e3('0x26')](function(_0x2d85d1){_0x4fa2ee[_0x57e3('0x20')]=_0x2d85d1;if(_0x47e372[_0x57e3('0x33')][_0x57e3('0x40')]){_0x3493b9[_0x57e3('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0x57e3('0x42')](_0x3493b9);})[_0x57e3('0x26')](function(_0x1b185e){_0x4fa2ee[_0x57e3('0x43')]=_0x1b185e;return _0x4fa2ee;})[_0x57e3('0x26')](respondWithFilteredResult(_0x4d2f09,_0x3493b9))['catch'](handleError(_0x4d2f09,null));};exports[_0x57e3('0x44')]=function(_0x55a0b1,_0x5dc53a){var _0x1c9bdb={'raw':!![],'where':{'id':_0x55a0b1[_0x57e3('0x45')]['id']}},_0x189d3f={};_0x189d3f[_0x57e3('0x32')]=_[_0x57e3('0x46')](db['ZendeskField'][_0x57e3('0x2e')]);_0x189d3f[_0x57e3('0x33')]=_[_0x57e3('0x46')](_0x55a0b1[_0x57e3('0x33')]);_0x189d3f['filters']=_[_0x57e3('0x47')](_0x189d3f[_0x57e3('0x32')],_0x189d3f[_0x57e3('0x33')]);_0x1c9bdb['attributes']=_[_0x57e3('0x47')](_0x189d3f['model'],qs[_0x57e3('0x36')](_0x55a0b1[_0x57e3('0x33')][_0x57e3('0x36')]));_0x1c9bdb['attributes']=_0x1c9bdb['attributes'][_0x57e3('0x48')]?_0x1c9bdb[_0x57e3('0x35')]:_0x189d3f[_0x57e3('0x32')];if(_0x55a0b1[_0x57e3('0x33')]['includeAll']){_0x1c9bdb[_0x57e3('0x41')]=[{'all':!![]}];}_0x1c9bdb=_['merge']({},_0x1c9bdb,_0x55a0b1[_0x57e3('0x49')]);return db[_0x57e3('0x3f')][_0x57e3('0x4a')](_0x1c9bdb)['then'](handleEntityNotFound(_0x5dc53a,null))[_0x57e3('0x26')](respondWithResult(_0x5dc53a,null))[_0x57e3('0x4b')](handleError(_0x5dc53a,null));};exports['create']=function(_0x1541ca,_0x5a6531){return db[_0x57e3('0x3f')][_0x57e3('0x4c')](_0x1541ca['body'],{})[_0x57e3('0x26')](respondWithResult(_0x5a6531,0xc9))[_0x57e3('0x4b')](handleError(_0x5a6531,null));};exports[_0x57e3('0x25')]=function(_0x30a9d5,_0x17dd07){if(_0x30a9d5[_0x57e3('0x4d')]['id']){delete _0x30a9d5[_0x57e3('0x4d')]['id'];}return db[_0x57e3('0x3f')][_0x57e3('0x4a')]({'where':{'id':_0x30a9d5[_0x57e3('0x45')]['id']}})[_0x57e3('0x26')](handleEntityNotFound(_0x17dd07,null))[_0x57e3('0x26')](saveUpdates(_0x30a9d5[_0x57e3('0x4d')],null))[_0x57e3('0x26')](respondWithResult(_0x17dd07,null))['catch'](handleError(_0x17dd07,null));};exports[_0x57e3('0x27')]=function(_0x169e14,_0x499dd2){return db['ZendeskField']['find']({'where':{'id':_0x169e14[_0x57e3('0x45')]['id']}})[_0x57e3('0x26')](handleEntityNotFound(_0x499dd2,null))['then'](removeEntity(_0x499dd2,null))[_0x57e3('0x4b')](handleError(_0x499dd2,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index d89b6d1..225468b 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 _0x5a55=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index'];(function(_0x4197f3,_0x4e6b8d){var _0xf840d7=function(_0x45713d){while(--_0x45713d){_0x4197f3['push'](_0x4197f3['shift']());}};_0xf840d7(++_0x4e6b8d);}(_0x5a55,0x13c));var _0x55a5=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x5a55[_0x59616b];return _0x5c4523;};'use strict';var _=require(_0x55a5('0x0'));var util=require(_0x55a5('0x1'));var logger=require(_0x55a5('0x2'))(_0x55a5('0x3'));var moment=require(_0x55a5('0x4'));var BPromise=require(_0x55a5('0x5'));var rp=require(_0x55a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55a5('0x7'));var config=require(_0x55a5('0x8'));var attributes=require(_0x55a5('0x9'));module[_0x55a5('0xa')]=function(_0x29c577,_0xee03ba){return _0x29c577[_0x55a5('0xb')]('ZendeskField',attributes,{'tableName':_0x55a5('0xc'),'paranoid':![],'indexes':[{'name':_0x55a5('0xd'),'fields':['idField',_0x55a5('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd05=['FieldId','../../config/logger','api','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd05,0x79));var _0x5fd0=function(_0x184695,_0x261bde){_0x184695=_0x184695-0x0;var _0x316dd0=_0xfd05[_0x184695];return _0x316dd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5fd0('0x0'))(_0x5fd0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fd0('0x2'));var rimraf=require(_0x5fd0('0x3'));var config=require(_0x5fd0('0x4'));var attributes=require(_0x5fd0('0x5'));module[_0x5fd0('0x6')]=function(_0x1ee245,_0x500eb1){return _0x1ee245[_0x5fd0('0x7')]('ZendeskField',attributes,{'tableName':_0x5fd0('0x8'),'paranoid':![],'indexes':[{'name':_0x5fd0('0x9'),'fields':[_0x5fd0('0xa'),_0x5fd0('0xb')],'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 80aaaf4..af73fe8 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 _0x381f=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5a3f0e,_0x55138f){var _0x5f35b4=function(_0x10ea01){while(--_0x10ea01){_0x5a3f0e['push'](_0x5a3f0e['shift']());}};_0x5f35b4(++_0x55138f);}(_0x381f,0xeb));var _0xf381=function(_0xd1baf5,_0x5b051a){_0xd1baf5=_0xd1baf5-0x0;var _0x1bff22=_0x381f[_0xd1baf5];return _0x1bff22;};'use strict';var _=require(_0xf381('0x0'));var util=require(_0xf381('0x1'));var moment=require('moment');var BPromise=require(_0xf381('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf381('0x3'));var db=require(_0xf381('0x4'))['db'];var utils=require(_0xf381('0x5'));var logger=require(_0xf381('0x6'))(_0xf381('0x7'));var config=require('../../config/environment');var jayson=require(_0xf381('0x8'));var client=jayson[_0xf381('0x9')][_0xf381('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fe790,_0x3c9160,_0x486aa4){return new BPromise(function(_0x257bbd,_0x244607){return client[_0xf381('0xb')](_0x1fe790,_0x486aa4)[_0xf381('0xc')](function(_0x279b0c){logger['info'](_0xf381('0xd'),_0x3c9160,_0xf381('0xe'));logger[_0xf381('0xf')](_0xf381('0x10'),_0x3c9160,_0xf381('0xe'),JSON[_0xf381('0x11')](_0x279b0c));if(_0x279b0c[_0xf381('0x12')]){if(_0x279b0c[_0xf381('0x12')][_0xf381('0x13')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x3c9160,_0x279b0c[_0xf381('0x12')][_0xf381('0x14')]);return _0x244607(_0x279b0c[_0xf381('0x12')][_0xf381('0x14')]);}logger[_0xf381('0x12')](_0xf381('0xd'),_0x3c9160,_0x279b0c[_0xf381('0x12')][_0xf381('0x14')]);return _0x257bbd(_0x279b0c[_0xf381('0x12')][_0xf381('0x14')]);}else{logger['info'](_0xf381('0xd'),_0x3c9160,_0xf381('0xe'));_0x257bbd(_0x279b0c[_0xf381('0x15')]['message']);}})[_0xf381('0x16')](function(_0x4c0226){logger['error'](_0xf381('0xd'),_0x3c9160,_0x4c0226);_0x244607(_0x4c0226);});});} \ No newline at end of file +var _0x442c=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s'];(function(_0x27bec8,_0x19a560){var _0x3bfb99=function(_0x56228a){while(--_0x56228a){_0x27bec8['push'](_0x27bec8['shift']());}};_0x3bfb99(++_0x19a560);}(_0x442c,0x1e9));var _0xc442=function(_0x26479a,_0x3f8a70){_0x26479a=_0x26479a-0x0;var _0x41307e=_0x442c[_0x26479a];return _0x41307e;};'use strict';var _=require(_0xc442('0x0'));var util=require(_0xc442('0x1'));var moment=require(_0xc442('0x2'));var BPromise=require(_0xc442('0x3'));var rs=require(_0xc442('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc442('0x5'))['db'];var utils=require(_0xc442('0x6'));var logger=require(_0xc442('0x7'))('rpc');var config=require(_0xc442('0x8'));var jayson=require(_0xc442('0x9'));var client=jayson[_0xc442('0xa')][_0xc442('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c0eb,_0x5f197c,_0x10e601){return new BPromise(function(_0x51c8c9,_0x236240){return client[_0xc442('0xc')](_0x52c0eb,_0x10e601)[_0xc442('0xd')](function(_0x14dbb8){logger['info'](_0xc442('0xe'),_0x5f197c,'request\x20sent');logger[_0xc442('0xf')](_0xc442('0x10'),_0x5f197c,_0xc442('0x11'),JSON[_0xc442('0x12')](_0x14dbb8));if(_0x14dbb8[_0xc442('0x13')]){if(_0x14dbb8[_0xc442('0x13')][_0xc442('0x14')]===0x1f4){logger[_0xc442('0x13')](_0xc442('0xe'),_0x5f197c,_0x14dbb8[_0xc442('0x13')][_0xc442('0x15')]);return _0x236240(_0x14dbb8[_0xc442('0x13')][_0xc442('0x15')]);}logger[_0xc442('0x13')](_0xc442('0xe'),_0x5f197c,_0x14dbb8[_0xc442('0x13')][_0xc442('0x15')]);return _0x51c8c9(_0x14dbb8['error'][_0xc442('0x15')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x5f197c,'request\x20sent');_0x51c8c9(_0x14dbb8[_0xc442('0x16')]['message']);}})[_0xc442('0x17')](function(_0x21dc3a){logger['error'](_0xc442('0xe'),_0x5f197c,_0x21dc3a);_0x236240(_0x21dc3a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4252c18..49adc02 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 _0xac7e=['/:id','show','/:id/fields','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x3a90b6,_0x258d6b){var _0x1da466=function(_0x3c0f35){while(--_0x3c0f35){_0x3a90b6['push'](_0x3a90b6['shift']());}};_0x1da466(++_0x258d6b);}(_0xac7e,0x14d));var _0xeac7=function(_0x3e8955,_0x47f8f2){_0x3e8955=_0x3e8955-0x0;var _0x2acda5=_0xac7e[_0x3e8955];return _0x2acda5;};'use strict';var multer=require(_0xeac7('0x0'));var util=require(_0xeac7('0x1'));var path=require(_0xeac7('0x2'));var timeout=require(_0xeac7('0x3'));var express=require(_0xeac7('0x4'));var router=express[_0xeac7('0x5')]();var fs_extra=require(_0xeac7('0x6'));var auth=require(_0xeac7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xeac7('0x8'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xeac7('0x9')](),controller[_0xeac7('0xa')]);router[_0xeac7('0xb')](_0xeac7('0xc'),auth[_0xeac7('0x9')](),controller[_0xeac7('0xd')]);router[_0xeac7('0xb')]('/:id/configurations',auth[_0xeac7('0x9')](),controller['getConfigurations']);router['get'](_0xeac7('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xeac7('0x9')](),controller[_0xeac7('0xf')]);router['post'](_0xeac7('0x10'),auth['isAuthenticated'](),controller[_0xeac7('0x11')]);router[_0xeac7('0x12')](_0xeac7('0xc'),auth['isAuthenticated'](),controller[_0xeac7('0x13')]);router[_0xeac7('0x14')](_0xeac7('0xc'),auth[_0xeac7('0x9')](),controller[_0xeac7('0x15')]);module[_0xeac7('0x16')]=router; \ No newline at end of file +var _0x8ae9=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated'];(function(_0x1f852a,_0x4ae7f1){var _0x3d3016=function(_0xb8aae4){while(--_0xb8aae4){_0x1f852a['push'](_0x1f852a['shift']());}};_0x3d3016(++_0x4ae7f1);}(_0x8ae9,0x127));var _0x98ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ae9[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x98ae('0x0'));var util=require(_0x98ae('0x1'));var path=require(_0x98ae('0x2'));var timeout=require(_0x98ae('0x3'));var express=require(_0x98ae('0x4'));var router=express['Router']();var fs_extra=require(_0x98ae('0x5'));var auth=require(_0x98ae('0x6'));var interaction=require(_0x98ae('0x7'));var config=require('../../config/environment');var controller=require(_0x98ae('0x8'));router[_0x98ae('0x9')]('/',auth['isAuthenticated'](),controller[_0x98ae('0xa')]);router['get'](_0x98ae('0xb'),auth[_0x98ae('0xc')](),controller['show']);router[_0x98ae('0x9')](_0x98ae('0xd'),auth[_0x98ae('0xc')](),controller[_0x98ae('0xe')]);router[_0x98ae('0x9')](_0x98ae('0xf'),auth['isAuthenticated'](),controller[_0x98ae('0x10')]);router['post']('/',auth[_0x98ae('0xc')](),controller[_0x98ae('0x11')]);router[_0x98ae('0x12')](_0x98ae('0xd'),auth[_0x98ae('0xc')](),controller[_0x98ae('0x13')]);router[_0x98ae('0x14')](_0x98ae('0xb'),auth[_0x98ae('0xc')](),controller[_0x98ae('0x15')]);router['delete'](_0x98ae('0xb'),auth[_0x98ae('0xc')](),controller['destroy']);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 b2fdbf0..2589304 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 _0x55e0=['STRING','sequelize','exports'];(function(_0xbd201,_0x2d26d0){var _0x103c69=function(_0x1dc5c6){while(--_0x1dc5c6){_0xbd201['push'](_0xbd201['shift']());}};_0x103c69(++_0x2d26d0);}(_0x55e0,0xdc));var _0x055e=function(_0x2a4f36,_0x295417){_0x2a4f36=_0x2a4f36-0x0;var _0x511ab6=_0x55e0[_0x2a4f36];return _0x511ab6;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'name':{'type':Sequelize[_0x055e('0x2')]},'description':{'type':Sequelize[_0x055e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x055e('0x2')]},'clientSecret':{'type':Sequelize[_0x055e('0x2')]},'serverUrl':{'type':Sequelize[_0x055e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x055e('0x2')]},'refreshToken':{'type':Sequelize[_0x055e('0x2')]}}; \ No newline at end of file +var _0x702d=['sequelize','exports','STRING'];(function(_0x2e0367,_0xa5b7ed){var _0x59c6d7=function(_0x43875b){while(--_0x43875b){_0x2e0367['push'](_0x2e0367['shift']());}};_0x59c6d7(++_0xa5b7ed);}(_0x702d,0x147));var _0xd702=function(_0x4ed65a,_0x402708){_0x4ed65a=_0x4ed65a-0x0;var _0x1cdef5=_0x702d[_0x4ed65a];return _0x1cdef5;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'name':{'type':Sequelize[_0xd702('0x2')]},'description':{'type':Sequelize[_0xd702('0x2')]},'host':{'type':Sequelize[_0xd702('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd702('0x2')]},'clientSecret':{'type':Sequelize[_0xd702('0x2')]},'serverUrl':{'type':Sequelize[_0xd702('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xd702('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3319b19..ca49e40 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 _0xefcd=['lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','ZohoAccount','fieldName','type','model','map','name','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','show','params','rawAttributes','include','create','body','catch','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','refreshToken','clientId','clientSecret','access_token','getFields','host','serverUrl','code','com','slice','substring'];(function(_0x36c19d,_0x10a6bc){var _0x5d1df2=function(_0x5940af){while(--_0x5940af){_0x36c19d['push'](_0x36c19d['shift']());}};_0x5d1df2(++_0x10a6bc);}(_0xefcd,0x9a));var _0xdefc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xefcd[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xdefc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdefc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdefc('0x2'));var moment=require(_0xdefc('0x3'));var BPromise=require(_0xdefc('0x4'));var Mustache=require('mustache');var util=require(_0xdefc('0x5'));var path=require(_0xdefc('0x6'));var sox=require(_0xdefc('0x7'));var csv=require('to-csv');var ejs=require(_0xdefc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdefc('0x9'));var crypto=require(_0xdefc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdefc('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdefc('0xc'));var Papa=require(_0xdefc('0xd'));var Redis=require(_0xdefc('0xe'));var authService=require(_0xdefc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdefc('0x10'));var hardwareService=require(_0xdefc('0x11'));var logger=require(_0xdefc('0x12'))(_0xdefc('0x13'));var utils=require(_0xdefc('0x14'));var config=require(_0xdefc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdefc('0x16'))['db'];var integrations=require(_0xdefc('0x17'));function respondWithStatusCode(_0x3d8cf2,_0x4bbd6b){_0x4bbd6b=_0x4bbd6b||0xcc;return function(_0x3f2141){if(_0x3f2141){return _0x3d8cf2[_0xdefc('0x18')](_0x4bbd6b);}return _0x3d8cf2[_0xdefc('0x19')](_0x4bbd6b)[_0xdefc('0x1a')]();};}function respondWithResult(_0x56574a,_0x43d5c8){_0x43d5c8=_0x43d5c8||0xc8;return function(_0x24e6e7){if(_0x24e6e7){return _0x56574a[_0xdefc('0x19')](_0x43d5c8)[_0xdefc('0x1b')](_0x24e6e7);}};}function respondWithFilteredResult(_0x39b293,_0x3d8cfa){return function(_0x16f50a){if(_0x16f50a){var _0x29bf10=typeof _0x3d8cfa[_0xdefc('0x1c')]===_0xdefc('0x1d')&&typeof _0x3d8cfa[_0xdefc('0x1e')]==='undefined';var _0x431bac=_0x16f50a[_0xdefc('0x1f')];var _0x283a39=_0x29bf10?0x0:_0x3d8cfa[_0xdefc('0x1c')];var _0x42406d=_0x29bf10?_0x16f50a[_0xdefc('0x1f')]:_0x3d8cfa['offset']+_0x3d8cfa['limit'];var _0x1ebba1;if(_0x42406d>=_0x431bac){_0x42406d=_0x431bac;_0x1ebba1=0xc8;}else{_0x1ebba1=0xce;}_0x39b293['status'](_0x1ebba1);return _0x39b293['set'](_0xdefc('0x20'),_0x283a39+'-'+_0x42406d+'/'+_0x431bac)[_0xdefc('0x1b')](_0x16f50a);}return null;};}function patchUpdates(_0x36d90e){return function(_0x2a6d0c){try{jsonpatch[_0xdefc('0x21')](_0x2a6d0c,_0x36d90e,!![]);}catch(_0x27c953){return BPromise[_0xdefc('0x22')](_0x27c953);}return _0x2a6d0c[_0xdefc('0x23')]();};}function saveUpdates(_0x3c9566,_0x328a00){return function(_0xa94518){if(_0xa94518){return _0xa94518[_0xdefc('0x24')](_0x3c9566)[_0xdefc('0x25')](function(_0x26606f){return _0x26606f;});}return null;};}function removeEntity(_0x35b2fe,_0x308f7c){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xdefc('0x26')]()[_0xdefc('0x25')](function(){_0x35b2fe[_0xdefc('0x19')](0xcc)[_0xdefc('0x1a')]();});}};}function handleEntityNotFound(_0x33b01b,_0x379ec1){return function(_0x24514e){if(!_0x24514e){_0x33b01b['sendStatus'](0x194);}return _0x24514e;};}function handleError(_0xeedd17,_0x7c2f8){_0x7c2f8=_0x7c2f8||0x1f4;return function(_0x2dddbd){logger['error'](_0x2dddbd[_0xdefc('0x27')]);if(_0x2dddbd['name']){delete _0x2dddbd['name'];}_0xeedd17[_0xdefc('0x19')](_0x7c2f8)[_0xdefc('0x28')](_0x2dddbd);};}exports[_0xdefc('0x29')]=function(_0x4c7295,_0x3f65d3){var _0x1d21e9={},_0x4cce27={},_0x1d6d37={'count':0x0,'rows':[]};var _0x4fd306=_['map'](db[_0xdefc('0x2a')]['rawAttributes'],function(_0x27c904){return{'name':_0x27c904[_0xdefc('0x2b')],'type':_0x27c904[_0xdefc('0x2c')]['key']};});_0x4cce27[_0xdefc('0x2d')]=_[_0xdefc('0x2e')](_0x4fd306,_0xdefc('0x2f'));_0x4cce27['query']=_[_0xdefc('0x30')](_0x4c7295[_0xdefc('0x31')]);_0x4cce27[_0xdefc('0x32')]=_['intersection'](_0x4cce27['model'],_0x4cce27['query']);_0x1d21e9['attributes']=_[_0xdefc('0x33')](_0x4cce27[_0xdefc('0x2d')],qs[_0xdefc('0x34')](_0x4c7295[_0xdefc('0x31')][_0xdefc('0x34')]));_0x1d21e9[_0xdefc('0x35')]=_0x1d21e9[_0xdefc('0x35')][_0xdefc('0x36')]?_0x1d21e9[_0xdefc('0x35')]:_0x4cce27[_0xdefc('0x2d')];if(!_0x4c7295['query']['hasOwnProperty'](_0xdefc('0x37'))){_0x1d21e9[_0xdefc('0x1e')]=qs[_0xdefc('0x1e')](_0x4c7295[_0xdefc('0x31')]['limit']);_0x1d21e9[_0xdefc('0x1c')]=qs[_0xdefc('0x1c')](_0x4c7295[_0xdefc('0x31')][_0xdefc('0x1c')]);}_0x1d21e9[_0xdefc('0x38')]=qs[_0xdefc('0x39')](_0x4c7295[_0xdefc('0x31')][_0xdefc('0x39')]);_0x1d21e9['where']=qs[_0xdefc('0x32')](_[_0xdefc('0x3a')](_0x4c7295['query'],_0x4cce27['filters']),_0x4fd306);if(_0x4c7295['query'][_0xdefc('0x3b')]){_0x1d21e9[_0xdefc('0x3c')]=_[_0xdefc('0x3d')](_0x1d21e9['where'],{'$or':_[_0xdefc('0x2e')](_0x4fd306,function(_0x4cb8bf){if(_0x4cb8bf['type']!==_0xdefc('0x3e')){var _0x4249a6={};_0x4249a6[_0x4cb8bf[_0xdefc('0x2f')]]={'$like':'%'+_0x4c7295[_0xdefc('0x31')][_0xdefc('0x3b')]+'%'};return _0x4249a6;}})});}_0x1d21e9=_[_0xdefc('0x3d')]({},_0x1d21e9,_0x4c7295[_0xdefc('0x3f')]);var _0x5982c2={'where':_0x1d21e9[_0xdefc('0x3c')]};return db['ZohoAccount'][_0xdefc('0x1f')](_0x5982c2)[_0xdefc('0x25')](function(_0x327a53){_0x1d6d37[_0xdefc('0x1f')]=_0x327a53;if(_0x4c7295['query']['includeAll']){_0x1d21e9['include']=[{'all':!![]}];}return db[_0xdefc('0x2a')][_0xdefc('0x40')](_0x1d21e9);})['then'](function(_0x278819){_0x1d6d37['rows']=_0x278819;return _0x1d6d37;})[_0xdefc('0x25')](respondWithFilteredResult(_0x3f65d3,_0x1d21e9))['catch'](handleError(_0x3f65d3,null));};exports[_0xdefc('0x41')]=function(_0xd33a9e,_0x80779f){var _0x341709={'raw':![],'where':{'id':_0xd33a9e[_0xdefc('0x42')]['id']}},_0x143332={};_0x143332['model']=_[_0xdefc('0x30')](db['ZohoAccount'][_0xdefc('0x43')]);_0x143332[_0xdefc('0x31')]=_[_0xdefc('0x30')](_0xd33a9e['query']);_0x143332[_0xdefc('0x32')]=_['intersection'](_0x143332['model'],_0x143332['query']);_0x341709[_0xdefc('0x35')]=_[_0xdefc('0x33')](_0x143332[_0xdefc('0x2d')],qs[_0xdefc('0x34')](_0xd33a9e[_0xdefc('0x31')][_0xdefc('0x34')]));_0x341709[_0xdefc('0x35')]=_0x341709[_0xdefc('0x35')][_0xdefc('0x36')]?_0x341709[_0xdefc('0x35')]:_0x143332[_0xdefc('0x2d')];if(_0xd33a9e[_0xdefc('0x31')]['includeAll']){_0x341709[_0xdefc('0x44')]=[{'all':!![]}];}_0x341709=_['merge']({},_0x341709,_0xd33a9e[_0xdefc('0x3f')]);return db[_0xdefc('0x2a')]['find'](_0x341709)[_0xdefc('0x25')](handleEntityNotFound(_0x80779f,null))['then'](respondWithResult(_0x80779f,null))['catch'](handleError(_0x80779f,null));};exports[_0xdefc('0x45')]=function(_0x55ce2a,_0x420318){return db[_0xdefc('0x2a')]['create'](_0x55ce2a[_0xdefc('0x46')],{})[_0xdefc('0x25')](respondWithResult(_0x420318,0xc9))[_0xdefc('0x47')](handleError(_0x420318,null));};exports['update']=function(_0x271d46,_0x3ef262){if(_0x271d46['body']['id']){delete _0x271d46['body']['id'];}return db[_0xdefc('0x2a')][_0xdefc('0x48')]({'where':{'id':_0x271d46['params']['id']}})[_0xdefc('0x25')](handleEntityNotFound(_0x3ef262,null))[_0xdefc('0x25')](saveUpdates(_0x271d46[_0xdefc('0x46')],null))['then'](respondWithResult(_0x3ef262,null))[_0xdefc('0x47')](handleError(_0x3ef262,null));};exports[_0xdefc('0x26')]=function(_0x3d2225,_0x1a98b6){return db[_0xdefc('0x2a')]['find']({'where':{'id':_0x3d2225[_0xdefc('0x42')]['id']}})[_0xdefc('0x25')](handleEntityNotFound(_0x1a98b6,null))[_0xdefc('0x25')](removeEntity(_0x1a98b6,null))[_0xdefc('0x47')](handleError(_0x1a98b6,null));};exports[_0xdefc('0x49')]=function(_0x557df1,_0x1e8615,_0x3bf089){var _0x400362={};var _0x56a74d={};var _0x223267;var _0x322366;return db['ZohoAccount'][_0xdefc('0x4a')]({'where':{'id':_0x557df1['params']['id']}})[_0xdefc('0x25')](handleEntityNotFound(_0x1e8615,null))['then'](function(_0x9a87c4){if(_0x9a87c4){_0x223267=_0x9a87c4;_0x56a74d['model']=_['keys'](db['ZohoConfiguration'][_0xdefc('0x43')]);_0x56a74d[_0xdefc('0x31')]=_[_0xdefc('0x30')](_0x557df1[_0xdefc('0x31')]);_0x56a74d[_0xdefc('0x32')]=_['intersection'](_0x56a74d['model'],_0x56a74d[_0xdefc('0x31')]);_0x400362[_0xdefc('0x35')]=_['intersection'](_0x56a74d[_0xdefc('0x2d')],qs[_0xdefc('0x34')](_0x557df1[_0xdefc('0x31')][_0xdefc('0x34')]));_0x400362[_0xdefc('0x35')]=_0x400362[_0xdefc('0x35')][_0xdefc('0x36')]?_0x400362[_0xdefc('0x35')]:_0x56a74d[_0xdefc('0x2d')];_0x400362[_0xdefc('0x38')]=qs[_0xdefc('0x39')](_0x557df1['query'][_0xdefc('0x39')]);_0x400362[_0xdefc('0x3c')]=qs[_0xdefc('0x32')](_['pick'](_0x557df1[_0xdefc('0x31')],_0x56a74d[_0xdefc('0x32')]));if(_0x557df1[_0xdefc('0x31')][_0xdefc('0x3b')]){_0x400362[_0xdefc('0x3c')]=_[_0xdefc('0x3d')](_0x400362[_0xdefc('0x3c')],{'$or':_[_0xdefc('0x2e')](_0x400362[_0xdefc('0x35')],function(_0x312f82){var _0x2ab131={};_0x2ab131[_0x312f82]={'$like':'%'+_0x557df1[_0xdefc('0x31')][_0xdefc('0x3b')]+'%'};return _0x2ab131;})});}_0x400362=_['merge']({},_0x400362,_0x557df1['options']);return _0x223267['getConfigurations'](_0x400362);}})[_0xdefc('0x25')](function(_0x26cc5c){if(_0x26cc5c){_0x322366=_0x26cc5c['length'];if(!_0x557df1[_0xdefc('0x31')][_0xdefc('0x4b')](_0xdefc('0x37'))){_0x400362[_0xdefc('0x1e')]=qs[_0xdefc('0x1e')](_0x557df1['query'][_0xdefc('0x1e')]);_0x400362[_0xdefc('0x1c')]=qs[_0xdefc('0x1c')](_0x557df1[_0xdefc('0x31')][_0xdefc('0x1c')]);}return _0x223267[_0xdefc('0x49')](_0x400362);}})[_0xdefc('0x25')](function(_0x24ca27){if(_0x24ca27){return _0x24ca27?{'count':_0x322366,'rows':_0x24ca27}:null;}})[_0xdefc('0x25')](respondWithResult(_0x1e8615,null))[_0xdefc('0x47')](handleError(_0x1e8615,null));};exports[_0xdefc('0x4c')]=function(_0x51dd13,_0x34e876,_0x2338a5){if(_0x51dd13[_0xdefc('0x46')]['id']){delete _0x51dd13[_0xdefc('0x46')]['id'];}return db[_0xdefc('0x2a')][_0xdefc('0x4a')]({'where':{'id':_0x51dd13[_0xdefc('0x42')]['id']}})[_0xdefc('0x25')](handleEntityNotFound(_0x34e876,null))['then'](function(_0x3ea345){if(_0x3ea345){_0x51dd13['body'][_0xdefc('0x4d')]=_0x3ea345['id'];_0x51dd13['body'][_0xdefc('0x4e')]=integrations['getSubjects'](_0x51dd13['body'][_0xdefc('0x4f')],_0x51dd13[_0xdefc('0x46')][_0xdefc('0x2c')]);_0x51dd13[_0xdefc('0x46')][_0xdefc('0x50')]=integrations[_0xdefc('0x51')](_0x51dd13[_0xdefc('0x46')][_0xdefc('0x4f')],_0x51dd13['body']['type']);return db['ZohoConfiguration'][_0xdefc('0x45')](_0x51dd13[_0xdefc('0x46')],{'include':[{'model':db[_0xdefc('0x52')],'as':_0xdefc('0x4e')},{'model':db['ZohoField'],'as':_0xdefc('0x50')}]});}return null;})['then'](respondWithResult(_0x34e876,null))['catch'](handleError(_0x34e876,null));};function getAccessToken(_0x56d224){return new Promise(function(_0x35d9e9,_0x40a8c6){var _0x1322dd;switch(_0x56d224[_0xdefc('0x53')]){case'US':_0x1322dd=_0xdefc('0x54');break;case'AU':_0x1322dd=_0xdefc('0x55');break;case'EU':_0x1322dd='https://accounts.zoho.eu';break;case'IN':_0x1322dd=_0xdefc('0x56');break;case'CN':_0x1322dd='https://accounts.zoho.com.cn';break;default:_0x1322dd='https://accounts.zoho.eu';break;}var _0x1dfbfb={'method':'POST','uri':_0x1322dd+'/oauth/v2/token','qs':{'refresh_token':_0x56d224[_0xdefc('0x57')],'client_id':_0x56d224[_0xdefc('0x58')],'client_secret':_0x56d224[_0xdefc('0x59')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1dfbfb)[_0xdefc('0x25')](function(_0x1de5aa){if(_0x1de5aa[_0xdefc('0x5a')]){_0x35d9e9(_0x1de5aa[_0xdefc('0x5a')]);}else{_0x40a8c6('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x43afff){_0x40a8c6(_0x43afff);});});}exports[_0xdefc('0x5b')]=function(_0x4449cc,_0x57e232,_0x25ff88){var _0x59fcbe,_0x45e9e3,_0xb5e722,_0x676c42,_0x319f69;return db[_0xdefc('0x2a')][_0xdefc('0x4a')]({'where':{'id':_0x4449cc[_0xdefc('0x42')]['id']},'attributes':['id',_0xdefc('0x5c'),'zone',_0xdefc('0x58'),_0xdefc('0x59'),_0xdefc('0x5d'),_0xdefc('0x5e'),_0xdefc('0x57')]})[_0xdefc('0x25')](handleEntityNotFound(_0x57e232,null))[_0xdefc('0x25')](function(_0x520551){_0x319f69=_0x520551;_0x59fcbe=_0x319f69[_0xdefc('0x5c')];_0x45e9e3=_0x59fcbe==='zoho.eu'?'eu':_0xdefc('0x5f');_0xb5e722=_0x319f69[_0xdefc('0x5d')];var _0x1aca41=_0xb5e722[_0xdefc('0x60')](-0x1);if(_0x1aca41==='/'||_0x1aca41==='\x5c'||_0x1aca41===':'){_0xb5e722=_0xb5e722[_0xdefc('0x61')](0x0,_0xb5e722[_0xdefc('0x62')](_0x1aca41));}if(!_0x319f69['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x319f69);})['then'](function(_0x19c5b3){if(_0x19c5b3){return rp({'method':_0xdefc('0x63'),'uri':util[_0xdefc('0x64')](_0xdefc('0x65'),_0x45e9e3),'qs':{'module':_0xdefc('0x66')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x19c5b3},'json':!![]});}})[_0xdefc('0x25')](function(_0x1007e8){if(_0x1007e8){if(_0x1007e8[_0xdefc('0x67')]&&_0x1007e8[_0xdefc('0x67')]['error']){throw new Error(_0x1007e8[_0xdefc('0x67')]['error'][_0xdefc('0x68')]);}var _0x148185=[];var _0x53d3c1=[];var _0x1fa327=[_0xdefc('0x69'),_0xdefc('0x6a'),_0xdefc('0x6b'),_0xdefc('0x6c'),_0xdefc('0x6d'),_0xdefc('0x6e'),_0xdefc('0x6f'),_0xdefc('0x70')];_0x53d3c1=_[_0xdefc('0x71')](_0x1007e8[_0xdefc('0x34')],function(_0x5d8baf){return _0x1fa327[_0xdefc('0x72')](_0x5d8baf['api_name']);});for(var _0x30d6ad=0x0;_0x30d6ad<_0x53d3c1['length'];_0x30d6ad++){if(_0x53d3c1[_0x30d6ad][_0xdefc('0x73')]===![]){_0x148185[_0xdefc('0x74')]({'id':_0x53d3c1[_0x30d6ad]['id'],'name':_0x53d3c1[_0x30d6ad][_0xdefc('0x75')],'custom':_0x53d3c1[_0x30d6ad][_0xdefc('0x76')],'options':_0x53d3c1[_0x30d6ad][_0xdefc('0x77')]==='picklist'&&_0x53d3c1[_0x30d6ad][_0xdefc('0x78')][_0xdefc('0x36')]>-0x1?_[_0xdefc('0x2e')](_0x53d3c1[_0x30d6ad][_0xdefc('0x78')],function(_0x3317c7){return{'name':_0x3317c7,'value':_0x3317c7};}):[]});}}return{'count':_0x148185[_0xdefc('0x36')],'rows':_0x148185};}else{return{'count':0x0,'rows':[]};}})[_0xdefc('0x25')](respondWithResult(_0x57e232,null))[_0xdefc('0x47')](function(_0x141e51){var _0x413242=_0x4449cc['query'][_0xdefc('0x79')]?0x1f4:_0x141e51[_0xdefc('0x7a')]||0x1f4;logger[_0xdefc('0x7b')]('getFields,\x20%s,\x20%s,\x20%s',_0xdefc('0x5b'),_0x413242,JSON[_0xdefc('0x7c')](_0x141e51));delete _0x141e51[_0xdefc('0x2f')];if(_0x413242===0x191){_0x413242=0x190;}_0x57e232[_0xdefc('0x19')](_0x413242)[_0xdefc('0x28')](_0x4449cc[_0xdefc('0x31')]['test']?{'message':_0xdefc('0x7d'),'statusCode':_0x141e51[_0xdefc('0x7a')]}:_0x141e51);});}; \ No newline at end of file +var _0x6b28=['includes','api_name','display_label','custom_field','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','fields','find','create','body','params','getConfigurations','ZohoConfiguration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ZohoField','Descriptions','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','clientId','refresh_token','access_token','host','zone','serverUrl','code','refreshToken','zoho.eu','com','slice','lastIndexOf','GET','format','response','message','Owner','Description','Call_Duration','Call_Start_Time','remove'];(function(_0x1c299b,_0x1fe09f){var _0x22b73f=function(_0x374fef){while(--_0x374fef){_0x1c299b['push'](_0x1c299b['shift']());}};_0x22b73f(++_0x1fe09f);}(_0x6b28,0xf9));var _0x86b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x86b2('0x0'));var jsonpatch=require(_0x86b2('0x1'));var rp=require(_0x86b2('0x2'));var moment=require(_0x86b2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86b2('0x4'));var util=require(_0x86b2('0x5'));var path=require(_0x86b2('0x6'));var sox=require(_0x86b2('0x7'));var csv=require(_0x86b2('0x8'));var ejs=require(_0x86b2('0x9'));var fs=require('fs');var fs_extra=require(_0x86b2('0xa'));var _=require('lodash');var squel=require(_0x86b2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86b2('0xc'));var toCsv=require(_0x86b2('0x8'));var querystring=require(_0x86b2('0xd'));var Papa=require(_0x86b2('0xe'));var Redis=require(_0x86b2('0xf'));var authService=require(_0x86b2('0x10'));var qs=require(_0x86b2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86b2('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x86b2('0x13'));var licenseUtil=require(_0x86b2('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x86b2('0x15'));function respondWithStatusCode(_0x54298d,_0x8e58d7){_0x8e58d7=_0x8e58d7||0xcc;return function(_0x1d0f86){if(_0x1d0f86){return _0x54298d[_0x86b2('0x16')](_0x8e58d7);}return _0x54298d['status'](_0x8e58d7)[_0x86b2('0x17')]();};}function respondWithResult(_0x29d2c9,_0xc56781){_0xc56781=_0xc56781||0xc8;return function(_0x3def9c){if(_0x3def9c){return _0x29d2c9[_0x86b2('0x18')](_0xc56781)[_0x86b2('0x19')](_0x3def9c);}};}function respondWithFilteredResult(_0x16768e,_0x45f16e){return function(_0x1667e4){if(_0x1667e4){var _0x2bdc02=typeof _0x45f16e['offset']==='undefined'&&typeof _0x45f16e[_0x86b2('0x1a')]===_0x86b2('0x1b');var _0x2d1ce3=_0x1667e4[_0x86b2('0x1c')];var _0x228b98=_0x2bdc02?0x0:_0x45f16e[_0x86b2('0x1d')];var _0x3a6141=_0x2bdc02?_0x1667e4[_0x86b2('0x1c')]:_0x45f16e['offset']+_0x45f16e['limit'];var _0x579488;if(_0x3a6141>=_0x2d1ce3){_0x3a6141=_0x2d1ce3;_0x579488=0xc8;}else{_0x579488=0xce;}_0x16768e[_0x86b2('0x18')](_0x579488);return _0x16768e[_0x86b2('0x1e')](_0x86b2('0x1f'),_0x228b98+'-'+_0x3a6141+'/'+_0x2d1ce3)[_0x86b2('0x19')](_0x1667e4);}return null;};}function patchUpdates(_0x5c6e76){return function(_0x241d06){try{jsonpatch['apply'](_0x241d06,_0x5c6e76,!![]);}catch(_0x1fee7f){return BPromise[_0x86b2('0x20')](_0x1fee7f);}return _0x241d06[_0x86b2('0x21')]();};}function saveUpdates(_0x54d40e,_0x5171e2){return function(_0x544a51){if(_0x544a51){return _0x544a51[_0x86b2('0x22')](_0x54d40e)['then'](function(_0x36888d){return _0x36888d;});}return null;};}function removeEntity(_0x3e364e,_0x2160fb){return function(_0x18b204){if(_0x18b204){return _0x18b204[_0x86b2('0x23')]()[_0x86b2('0x24')](function(){_0x3e364e[_0x86b2('0x18')](0xcc)[_0x86b2('0x17')]();});}};}function handleEntityNotFound(_0x502dde,_0x3f8e8e){return function(_0x545258){if(!_0x545258){_0x502dde[_0x86b2('0x16')](0x194);}return _0x545258;};}function handleError(_0x411b87,_0x4607d5){_0x4607d5=_0x4607d5||0x1f4;return function(_0x3f6509){logger[_0x86b2('0x25')](_0x3f6509[_0x86b2('0x26')]);if(_0x3f6509[_0x86b2('0x27')]){delete _0x3f6509[_0x86b2('0x27')];}_0x411b87[_0x86b2('0x18')](_0x4607d5)[_0x86b2('0x28')](_0x3f6509);};}exports[_0x86b2('0x29')]=function(_0x14e439,_0xe14fb0){var _0x2f6add={},_0x23cfa4={},_0x49121a={'count':0x0,'rows':[]};var _0x5b0651=_[_0x86b2('0x2a')](db[_0x86b2('0x2b')][_0x86b2('0x2c')],function(_0x20f893){return{'name':_0x20f893[_0x86b2('0x2d')],'type':_0x20f893[_0x86b2('0x2e')]['key']};});_0x23cfa4[_0x86b2('0x2f')]=_[_0x86b2('0x2a')](_0x5b0651,'name');_0x23cfa4[_0x86b2('0x30')]=_[_0x86b2('0x31')](_0x14e439[_0x86b2('0x30')]);_0x23cfa4[_0x86b2('0x32')]=_[_0x86b2('0x33')](_0x23cfa4['model'],_0x23cfa4[_0x86b2('0x30')]);_0x2f6add[_0x86b2('0x34')]=_[_0x86b2('0x33')](_0x23cfa4[_0x86b2('0x2f')],qs['fields'](_0x14e439['query']['fields']));_0x2f6add['attributes']=_0x2f6add[_0x86b2('0x34')][_0x86b2('0x35')]?_0x2f6add[_0x86b2('0x34')]:_0x23cfa4['model'];if(!_0x14e439[_0x86b2('0x30')]['hasOwnProperty'](_0x86b2('0x36'))){_0x2f6add[_0x86b2('0x1a')]=qs[_0x86b2('0x1a')](_0x14e439[_0x86b2('0x30')][_0x86b2('0x1a')]);_0x2f6add['offset']=qs[_0x86b2('0x1d')](_0x14e439[_0x86b2('0x30')][_0x86b2('0x1d')]);}_0x2f6add[_0x86b2('0x37')]=qs[_0x86b2('0x38')](_0x14e439['query']['sort']);_0x2f6add[_0x86b2('0x39')]=qs[_0x86b2('0x32')](_['pick'](_0x14e439[_0x86b2('0x30')],_0x23cfa4['filters']),_0x5b0651);if(_0x14e439[_0x86b2('0x30')][_0x86b2('0x3a')]){_0x2f6add['where']=_[_0x86b2('0x3b')](_0x2f6add[_0x86b2('0x39')],{'$or':_[_0x86b2('0x2a')](_0x5b0651,function(_0x588b36){if(_0x588b36[_0x86b2('0x2e')]!==_0x86b2('0x3c')){var _0x2cb647={};_0x2cb647[_0x588b36['name']]={'$like':'%'+_0x14e439['query']['filter']+'%'};return _0x2cb647;}})});}_0x2f6add=_[_0x86b2('0x3b')]({},_0x2f6add,_0x14e439[_0x86b2('0x3d')]);var _0x289a55={'where':_0x2f6add[_0x86b2('0x39')]};return db[_0x86b2('0x2b')]['count'](_0x289a55)[_0x86b2('0x24')](function(_0x382522){_0x49121a['count']=_0x382522;if(_0x14e439['query'][_0x86b2('0x3e')]){_0x2f6add[_0x86b2('0x3f')]=[{'all':!![]}];}return db[_0x86b2('0x2b')][_0x86b2('0x40')](_0x2f6add);})[_0x86b2('0x24')](function(_0x413689){_0x49121a[_0x86b2('0x41')]=_0x413689;return _0x49121a;})[_0x86b2('0x24')](respondWithFilteredResult(_0xe14fb0,_0x2f6add))[_0x86b2('0x42')](handleError(_0xe14fb0,null));};exports['show']=function(_0x3bdb13,_0xcac900){var _0x2e9f76={'raw':![],'where':{'id':_0x3bdb13['params']['id']}},_0x4524dc={};_0x4524dc['model']=_[_0x86b2('0x31')](db[_0x86b2('0x2b')]['rawAttributes']);_0x4524dc[_0x86b2('0x30')]=_['keys'](_0x3bdb13[_0x86b2('0x30')]);_0x4524dc[_0x86b2('0x32')]=_[_0x86b2('0x33')](_0x4524dc['model'],_0x4524dc[_0x86b2('0x30')]);_0x2e9f76['attributes']=_[_0x86b2('0x33')](_0x4524dc[_0x86b2('0x2f')],qs[_0x86b2('0x43')](_0x3bdb13[_0x86b2('0x30')][_0x86b2('0x43')]));_0x2e9f76[_0x86b2('0x34')]=_0x2e9f76[_0x86b2('0x34')]['length']?_0x2e9f76[_0x86b2('0x34')]:_0x4524dc['model'];if(_0x3bdb13['query']['includeAll']){_0x2e9f76['include']=[{'all':!![]}];}_0x2e9f76=_[_0x86b2('0x3b')]({},_0x2e9f76,_0x3bdb13[_0x86b2('0x3d')]);return db[_0x86b2('0x2b')][_0x86b2('0x44')](_0x2e9f76)[_0x86b2('0x24')](handleEntityNotFound(_0xcac900,null))[_0x86b2('0x24')](respondWithResult(_0xcac900,null))[_0x86b2('0x42')](handleError(_0xcac900,null));};exports[_0x86b2('0x45')]=function(_0x1244cb,_0x20a389){return db[_0x86b2('0x2b')][_0x86b2('0x45')](_0x1244cb[_0x86b2('0x46')],{})[_0x86b2('0x24')](respondWithResult(_0x20a389,0xc9))[_0x86b2('0x42')](handleError(_0x20a389,null));};exports['update']=function(_0xc31ef2,_0x15f46b){if(_0xc31ef2[_0x86b2('0x46')]['id']){delete _0xc31ef2[_0x86b2('0x46')]['id'];}return db[_0x86b2('0x2b')][_0x86b2('0x44')]({'where':{'id':_0xc31ef2[_0x86b2('0x47')]['id']}})[_0x86b2('0x24')](handleEntityNotFound(_0x15f46b,null))[_0x86b2('0x24')](saveUpdates(_0xc31ef2[_0x86b2('0x46')],null))['then'](respondWithResult(_0x15f46b,null))[_0x86b2('0x42')](handleError(_0x15f46b,null));};exports[_0x86b2('0x23')]=function(_0x1b728a,_0x3e6ee6){return db[_0x86b2('0x2b')][_0x86b2('0x44')]({'where':{'id':_0x1b728a[_0x86b2('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e6ee6,null))[_0x86b2('0x24')](removeEntity(_0x3e6ee6,null))[_0x86b2('0x42')](handleError(_0x3e6ee6,null));};exports[_0x86b2('0x48')]=function(_0x44cbe1,_0x4dad2d,_0x3c6bb4){var _0x535625={};var _0x10c313={};var _0xe50590;var _0x51f2a6;return db[_0x86b2('0x2b')]['findOne']({'where':{'id':_0x44cbe1[_0x86b2('0x47')]['id']}})[_0x86b2('0x24')](handleEntityNotFound(_0x4dad2d,null))[_0x86b2('0x24')](function(_0x44eb3e){if(_0x44eb3e){_0xe50590=_0x44eb3e;_0x10c313[_0x86b2('0x2f')]=_[_0x86b2('0x31')](db[_0x86b2('0x49')][_0x86b2('0x2c')]);_0x10c313[_0x86b2('0x30')]=_[_0x86b2('0x31')](_0x44cbe1[_0x86b2('0x30')]);_0x10c313[_0x86b2('0x32')]=_[_0x86b2('0x33')](_0x10c313[_0x86b2('0x2f')],_0x10c313[_0x86b2('0x30')]);_0x535625[_0x86b2('0x34')]=_[_0x86b2('0x33')](_0x10c313[_0x86b2('0x2f')],qs[_0x86b2('0x43')](_0x44cbe1[_0x86b2('0x30')][_0x86b2('0x43')]));_0x535625[_0x86b2('0x34')]=_0x535625[_0x86b2('0x34')][_0x86b2('0x35')]?_0x535625['attributes']:_0x10c313[_0x86b2('0x2f')];_0x535625[_0x86b2('0x37')]=qs[_0x86b2('0x38')](_0x44cbe1[_0x86b2('0x30')][_0x86b2('0x38')]);_0x535625['where']=qs[_0x86b2('0x32')](_[_0x86b2('0x4a')](_0x44cbe1[_0x86b2('0x30')],_0x10c313[_0x86b2('0x32')]));if(_0x44cbe1[_0x86b2('0x30')]['filter']){_0x535625[_0x86b2('0x39')]=_[_0x86b2('0x3b')](_0x535625[_0x86b2('0x39')],{'$or':_[_0x86b2('0x2a')](_0x535625[_0x86b2('0x34')],function(_0x1389c0){var _0x467360={};_0x467360[_0x1389c0]={'$like':'%'+_0x44cbe1[_0x86b2('0x30')]['filter']+'%'};return _0x467360;})});}_0x535625=_[_0x86b2('0x3b')]({},_0x535625,_0x44cbe1[_0x86b2('0x3d')]);return _0xe50590['getConfigurations'](_0x535625);}})[_0x86b2('0x24')](function(_0x59cad4){if(_0x59cad4){_0x51f2a6=_0x59cad4[_0x86b2('0x35')];if(!_0x44cbe1['query'][_0x86b2('0x4b')](_0x86b2('0x36'))){_0x535625[_0x86b2('0x1a')]=qs[_0x86b2('0x1a')](_0x44cbe1['query'][_0x86b2('0x1a')]);_0x535625[_0x86b2('0x1d')]=qs['offset'](_0x44cbe1[_0x86b2('0x30')]['offset']);}return _0xe50590[_0x86b2('0x48')](_0x535625);}})[_0x86b2('0x24')](function(_0x4f748f){if(_0x4f748f){return _0x4f748f?{'count':_0x51f2a6,'rows':_0x4f748f}:null;}})[_0x86b2('0x24')](respondWithResult(_0x4dad2d,null))[_0x86b2('0x42')](handleError(_0x4dad2d,null));};exports[_0x86b2('0x4c')]=function(_0x2f8d3c,_0x402058,_0x5d61d4){if(_0x2f8d3c[_0x86b2('0x46')]['id']){delete _0x2f8d3c[_0x86b2('0x46')]['id'];}return db['ZohoAccount'][_0x86b2('0x4d')]({'where':{'id':_0x2f8d3c['params']['id']}})[_0x86b2('0x24')](handleEntityNotFound(_0x402058,null))[_0x86b2('0x24')](function(_0xe4d3a9){if(_0xe4d3a9){_0x2f8d3c[_0x86b2('0x46')][_0x86b2('0x4e')]=_0xe4d3a9['id'];_0x2f8d3c[_0x86b2('0x46')][_0x86b2('0x4f')]=integrations[_0x86b2('0x50')](_0x2f8d3c['body']['channel'],_0x2f8d3c['body'][_0x86b2('0x2e')]);_0x2f8d3c[_0x86b2('0x46')]['Descriptions']=integrations['getDescriptions'](_0x2f8d3c[_0x86b2('0x46')][_0x86b2('0x51')],_0x2f8d3c['body'][_0x86b2('0x2e')]);return db[_0x86b2('0x49')][_0x86b2('0x45')](_0x2f8d3c['body'],{'include':[{'model':db[_0x86b2('0x52')],'as':_0x86b2('0x4f')},{'model':db['ZohoField'],'as':_0x86b2('0x53')}]});}return null;})[_0x86b2('0x24')](respondWithResult(_0x402058,null))[_0x86b2('0x42')](handleError(_0x402058,null));};function getAccessToken(_0xb3458){return new Promise(function(_0x13a85c,_0x28e959){var _0x44d384;switch(_0xb3458['zone']){case'US':_0x44d384=_0x86b2('0x54');break;case'AU':_0x44d384=_0x86b2('0x55');break;case'EU':_0x44d384='https://accounts.zoho.eu';break;case'IN':_0x44d384=_0x86b2('0x56');break;case'CN':_0x44d384=_0x86b2('0x57');break;default:_0x44d384=_0x86b2('0x58');break;}var _0x282ae2={'method':'POST','uri':_0x44d384+_0x86b2('0x59'),'qs':{'refresh_token':_0xb3458['refreshToken'],'client_id':_0xb3458[_0x86b2('0x5a')],'client_secret':_0xb3458['clientSecret'],'grant_type':_0x86b2('0x5b')},'json':!![]};return rp(_0x282ae2)[_0x86b2('0x24')](function(_0x4f206b){if(_0x4f206b[_0x86b2('0x5c')]){_0x13a85c(_0x4f206b['access_token']);}else{_0x28e959('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x86b2('0x42')](function(_0x3d681b){_0x28e959(_0x3d681b);});});}exports['getFields']=function(_0x1a531d,_0xb27681,_0x1c0078){var _0x175f11,_0x518672,_0x37fb63,_0x4237b4,_0x45ca55;return db['ZohoAccount']['findOne']({'where':{'id':_0x1a531d[_0x86b2('0x47')]['id']},'attributes':['id',_0x86b2('0x5d'),_0x86b2('0x5e'),_0x86b2('0x5a'),'clientSecret',_0x86b2('0x5f'),_0x86b2('0x60'),_0x86b2('0x61')]})[_0x86b2('0x24')](handleEntityNotFound(_0xb27681,null))[_0x86b2('0x24')](function(_0x3cda32){_0x45ca55=_0x3cda32;_0x175f11=_0x45ca55[_0x86b2('0x5d')];_0x518672=_0x175f11===_0x86b2('0x62')?'eu':_0x86b2('0x63');_0x37fb63=_0x45ca55[_0x86b2('0x5f')];var _0x51217f=_0x37fb63[_0x86b2('0x64')](-0x1);if(_0x51217f==='/'||_0x51217f==='\x5c'||_0x51217f===':'){_0x37fb63=_0x37fb63['substring'](0x0,_0x37fb63[_0x86b2('0x65')](_0x51217f));}if(!_0x45ca55[_0x86b2('0x61')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x45ca55);})['then'](function(_0x114d64){if(_0x114d64){return rp({'method':_0x86b2('0x66'),'uri':util[_0x86b2('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x518672),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x114d64},'json':!![]});}})['then'](function(_0x1dba17){if(_0x1dba17){if(_0x1dba17[_0x86b2('0x68')]&&_0x1dba17['response'][_0x86b2('0x25')]){throw new Error(_0x1dba17['response'][_0x86b2('0x25')][_0x86b2('0x69')]);}var _0x2fe3c=[];var _0x326d18=[];var _0x5391f8=[_0x86b2('0x6a'),'Subject',_0x86b2('0x6b'),'WhoId',_0x86b2('0x6c'),'Call_Result',_0x86b2('0x6d'),'Call_Type'];_0x326d18=_[_0x86b2('0x6e')](_0x1dba17[_0x86b2('0x43')],function(_0x16dc6f){return _0x5391f8[_0x86b2('0x6f')](_0x16dc6f[_0x86b2('0x70')]);});for(var _0x290c86=0x0;_0x290c86<_0x326d18[_0x86b2('0x35')];_0x290c86++){if(_0x326d18[_0x290c86]['system_mandatory']===![]){_0x2fe3c['push']({'id':_0x326d18[_0x290c86]['id'],'name':_0x326d18[_0x290c86][_0x86b2('0x71')],'custom':_0x326d18[_0x290c86][_0x86b2('0x72')],'options':_0x326d18[_0x290c86]['data_type']==='picklist'&&_0x326d18[_0x290c86][_0x86b2('0x73')][_0x86b2('0x35')]>-0x1?_['map'](_0x326d18[_0x290c86][_0x86b2('0x73')],function(_0x41ca36){return{'name':_0x41ca36,'value':_0x41ca36};}):[]});}}return{'count':_0x2fe3c[_0x86b2('0x35')],'rows':_0x2fe3c};}else{return{'count':0x0,'rows':[]};}})[_0x86b2('0x24')](respondWithResult(_0xb27681,null))['catch'](function(_0x3433a9){var _0x50bce8=_0x1a531d[_0x86b2('0x30')]['test']?0x1f4:_0x3433a9[_0x86b2('0x74')]||0x1f4;logger[_0x86b2('0x25')](_0x86b2('0x75'),'getFields',_0x50bce8,JSON[_0x86b2('0x76')](_0x3433a9));delete _0x3433a9['name'];if(_0x50bce8===0x191){_0x50bce8=0x190;}_0xb27681['status'](_0x50bce8)[_0x86b2('0x28')](_0x1a531d[_0x86b2('0x30')][_0x86b2('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x3433a9[_0x86b2('0x74')]}:_0x3433a9);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index e46a181..fd3ce4a 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 _0xaed3=['inspect','catch','https://accounts.zoho.in','util','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','changed','zone','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x55a76f,_0x21937e){var _0x32209a=function(_0x27685a){while(--_0x27685a){_0x55a76f['push'](_0x55a76f['shift']());}};_0x32209a(++_0x21937e);}(_0xaed3,0xc1));var _0x3aed=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xaed3[_0x2053ea];return _0x2232c4;};'use strict';var _=require('lodash');var util=require(_0x3aed('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3aed('0x1'));var rp=require(_0x3aed('0x2'));var fs=require('fs');var path=require(_0x3aed('0x3'));var rimraf=require(_0x3aed('0x4'));var config=require(_0x3aed('0x5'));var attributes=require(_0x3aed('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3aed('0x7')]=function(_0x42790e,_0x5155e0){return _0x42790e['define'](_0x3aed('0x8'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x392721,_0x2a8b3d,_0xc04c67){if(_0x392721[_0x3aed('0x9')](_0x3aed('0xa'))||_0x392721[_0x3aed('0x9')]('serverUrl')||_0x392721[_0x3aed('0x9')](_0x3aed('0xb'))||_0x392721[_0x3aed('0x9')](_0x3aed('0xc'))||_0x392721[_0x3aed('0x9')](_0x3aed('0xd'))||_0x392721['changed'](_0x3aed('0xe'))){var _0x2c6087,_0x556148;_0x2c6087=_0x392721['serverUrl'];var _0x1e7349=_0x2c6087['slice'](-0x1);if(_0x1e7349==='/'||_0x1e7349==='\x5c'||_0x1e7349===':'){_0x2c6087=_0x2c6087[_0x3aed('0xf')](0x0,_0x2c6087[_0x3aed('0x10')](_0x1e7349));}switch(_0x392721[_0x3aed('0xa')]){case'US':_0x556148=_0x3aed('0x11');break;case'AU':_0x556148=_0x3aed('0x12');break;case'IN':_0x556148='https://accounts.zoho.in';break;case'CN':_0x556148='https://accounts.zoho.com.cn';break;default:_0x556148=_0x3aed('0x13');break;}var _0x21e85f={'method':_0x3aed('0x14'),'uri':_0x556148+_0x3aed('0x15'),'form':{'grant_type':_0x3aed('0x16'),'client_id':_0x392721['clientId'],'client_secret':_0x392721['clientSecret'],'redirect_uri':_0x392721[_0x3aed('0x17')],'code':_0x392721[_0x3aed('0xd')]},'headers':{'Content-Type':_0x3aed('0x18')}};return rp(_0x21e85f)[_0x3aed('0x19')](function(_0x76e5ab){var _0x1e499e=JSON[_0x3aed('0x1a')](_0x76e5ab);if(_0x1e499e['refresh_token']){_0x392721[_0x3aed('0x1b')]=_0x1e499e[_0x3aed('0x1c')];logger[_0x3aed('0x1d')](util[_0x3aed('0x1e')](_0x3aed('0x1f'),_0x392721[_0x3aed('0x20')],_0x392721['id']));}else{logger[_0x3aed('0x21')](util[_0x3aed('0x1e')](_0x3aed('0x22'),_0x392721[_0x3aed('0x20')],_0x392721['id']),util[_0x3aed('0x23')](_0x1e499e,{'showHidden':![],'depth':null}));}return _0xc04c67(null,_0x2a8b3d);})[_0x3aed('0x24')](function(_0x2b450b){logger['error'](util[_0x3aed('0x1e')](_0x3aed('0x22'),_0x392721[_0x3aed('0x20')],_0x392721['id']),util[_0x3aed('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xc04c67(_0x2b450b);});}else{return _0xc04c67(null,_0x2a8b3d);}},'beforeUpdate':function(_0x369959,_0x458e8f,_0x2072be){if(_0x369959['changed'](_0x3aed('0xa'))||_0x369959[_0x3aed('0x9')]('serverUrl')||_0x369959['changed'](_0x3aed('0xb'))||_0x369959['changed'](_0x3aed('0xc'))||_0x369959[_0x3aed('0x9')](_0x3aed('0xd'))||_0x369959[_0x3aed('0x9')]('host')){var _0x20fe1a,_0x460b83;_0x20fe1a=_0x369959[_0x3aed('0x17')];var _0xd8760b=_0x20fe1a['slice'](-0x1);if(_0xd8760b==='/'||_0xd8760b==='\x5c'||_0xd8760b===':'){_0x20fe1a=_0x20fe1a['substring'](0x0,_0x20fe1a[_0x3aed('0x10')](_0xd8760b));}switch(_0x369959[_0x3aed('0xa')]){case'US':_0x460b83='https://accounts.zoho.com';break;case'AU':_0x460b83=_0x3aed('0x12');break;case'IN':_0x460b83=_0x3aed('0x25');break;case'CN':_0x460b83='https://accounts.zoho.com.cn';break;default:_0x460b83='https://accounts.zoho.eu';break;}var _0x2016b4={'method':_0x3aed('0x14'),'uri':_0x460b83+_0x3aed('0x15'),'form':{'grant_type':_0x3aed('0x16'),'client_id':_0x369959[_0x3aed('0xb')],'client_secret':_0x369959[_0x3aed('0xc')],'redirect_uri':_0x369959[_0x3aed('0x17')],'code':_0x369959[_0x3aed('0xd')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2016b4)[_0x3aed('0x19')](function(_0x36e203){var _0x3bc000=JSON[_0x3aed('0x1a')](_0x36e203);if(_0x3bc000['refresh_token']){_0x369959[_0x3aed('0x1b')]=_0x3bc000[_0x3aed('0x1c')];logger[_0x3aed('0x1d')](util[_0x3aed('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x369959['name'],_0x369959['id']));}else{logger[_0x3aed('0x21')](util[_0x3aed('0x1e')](_0x3aed('0x22'),_0x369959[_0x3aed('0x20')],_0x369959['id']),util['inspect'](_0x3bc000,{'showHidden':![],'depth':null}));}return _0x2072be(null,_0x458e8f);})[_0x3aed('0x24')](function(_0x4260b3){logger[_0x3aed('0x21')](util[_0x3aed('0x1e')](_0x3aed('0x22'),_0x369959[_0x3aed('0x20')],_0x369959['id']),util[_0x3aed('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x2072be(_0x4260b3);});}else{return _0x2072be(null,_0x458e8f);}}}});}; \ No newline at end of file +var _0x3efc=['lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','code','application/x-www-form-urlencoded','refresh_token','refreshToken','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','zone','clientId','slice','authorization_code','then','info','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','host','substring'];(function(_0x4f796a,_0x382fda){var _0x3a5ebe=function(_0x5c6264){while(--_0x5c6264){_0x4f796a['push'](_0x4f796a['shift']());}};_0x3a5ebe(++_0x382fda);}(_0x3efc,0x6f));var _0xc3ef=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3efc[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xc3ef('0x0'));var util=require(_0xc3ef('0x1'));var logger=require(_0xc3ef('0x2'))(_0xc3ef('0x3'));var moment=require(_0xc3ef('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ef('0x6'));var config=require(_0xc3ef('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xc3ef('0x8'));module[_0xc3ef('0x9')]=function(_0x2b973,_0x30fce2){return _0x2b973[_0xc3ef('0xa')](_0xc3ef('0xb'),attributes,{'tableName':_0xc3ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x19b4c4,_0x1b7860,_0x37325f){if(_0x19b4c4['changed']('zone')||_0x19b4c4[_0xc3ef('0xd')](_0xc3ef('0xe'))||_0x19b4c4[_0xc3ef('0xd')]('clientId')||_0x19b4c4[_0xc3ef('0xd')](_0xc3ef('0xf'))||_0x19b4c4['changed']('code')||_0x19b4c4['changed'](_0xc3ef('0x10'))){var _0x46f6fa,_0x48c6be;_0x46f6fa=_0x19b4c4['serverUrl'];var _0x2a3978=_0x46f6fa['slice'](-0x1);if(_0x2a3978==='/'||_0x2a3978==='\x5c'||_0x2a3978===':'){_0x46f6fa=_0x46f6fa[_0xc3ef('0x11')](0x0,_0x46f6fa[_0xc3ef('0x12')](_0x2a3978));}switch(_0x19b4c4['zone']){case'US':_0x48c6be=_0xc3ef('0x13');break;case'AU':_0x48c6be=_0xc3ef('0x14');break;case'IN':_0x48c6be=_0xc3ef('0x15');break;case'CN':_0x48c6be=_0xc3ef('0x16');break;default:_0x48c6be=_0xc3ef('0x17');break;}var _0x4fd69a={'method':_0xc3ef('0x18'),'uri':_0x48c6be+_0xc3ef('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x19b4c4['clientId'],'client_secret':_0x19b4c4[_0xc3ef('0xf')],'redirect_uri':_0x19b4c4[_0xc3ef('0xe')],'code':_0x19b4c4[_0xc3ef('0x1a')]},'headers':{'Content-Type':_0xc3ef('0x1b')}};return rp(_0x4fd69a)['then'](function(_0x14217f){var _0x42258a=JSON['parse'](_0x14217f);if(_0x42258a[_0xc3ef('0x1c')]){_0x19b4c4[_0xc3ef('0x1d')]=_0x42258a[_0xc3ef('0x1c')];logger['info'](util[_0xc3ef('0x1e')](_0xc3ef('0x1f'),_0x19b4c4[_0xc3ef('0x20')],_0x19b4c4['id']));}else{logger[_0xc3ef('0x21')](util[_0xc3ef('0x1e')](_0xc3ef('0x22'),_0x19b4c4[_0xc3ef('0x20')],_0x19b4c4['id']),util[_0xc3ef('0x23')](_0x42258a,{'showHidden':![],'depth':null}));}return _0x37325f(null,_0x1b7860);})[_0xc3ef('0x24')](function(_0xd46bfc){logger[_0xc3ef('0x21')](util[_0xc3ef('0x1e')](_0xc3ef('0x22'),_0x19b4c4[_0xc3ef('0x20')],_0x19b4c4['id']),util[_0xc3ef('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x37325f(_0xd46bfc);});}else{return _0x37325f(null,_0x1b7860);}},'beforeUpdate':function(_0xf93614,_0x4d8e67,_0x127a8d){if(_0xf93614['changed'](_0xc3ef('0x25'))||_0xf93614[_0xc3ef('0xd')](_0xc3ef('0xe'))||_0xf93614[_0xc3ef('0xd')](_0xc3ef('0x26'))||_0xf93614[_0xc3ef('0xd')](_0xc3ef('0xf'))||_0xf93614[_0xc3ef('0xd')](_0xc3ef('0x1a'))||_0xf93614[_0xc3ef('0xd')](_0xc3ef('0x10'))){var _0x13e8c1,_0x13606e;_0x13e8c1=_0xf93614[_0xc3ef('0xe')];var _0x4054c0=_0x13e8c1[_0xc3ef('0x27')](-0x1);if(_0x4054c0==='/'||_0x4054c0==='\x5c'||_0x4054c0===':'){_0x13e8c1=_0x13e8c1[_0xc3ef('0x11')](0x0,_0x13e8c1[_0xc3ef('0x12')](_0x4054c0));}switch(_0xf93614['zone']){case'US':_0x13606e=_0xc3ef('0x13');break;case'AU':_0x13606e=_0xc3ef('0x14');break;case'IN':_0x13606e='https://accounts.zoho.in';break;case'CN':_0x13606e='https://accounts.zoho.com.cn';break;default:_0x13606e='https://accounts.zoho.eu';break;}var _0x44b462={'method':_0xc3ef('0x18'),'uri':_0x13606e+'/oauth/v2/token','form':{'grant_type':_0xc3ef('0x28'),'client_id':_0xf93614['clientId'],'client_secret':_0xf93614[_0xc3ef('0xf')],'redirect_uri':_0xf93614[_0xc3ef('0xe')],'code':_0xf93614['code']},'headers':{'Content-Type':_0xc3ef('0x1b')}};return rp(_0x44b462)[_0xc3ef('0x29')](function(_0x119734){var _0x254492=JSON['parse'](_0x119734);if(_0x254492[_0xc3ef('0x1c')]){_0xf93614[_0xc3ef('0x1d')]=_0x254492[_0xc3ef('0x1c')];logger[_0xc3ef('0x2a')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf93614[_0xc3ef('0x20')],_0xf93614['id']));}else{logger[_0xc3ef('0x21')](util['format'](_0xc3ef('0x22'),_0xf93614['name'],_0xf93614['id']),util[_0xc3ef('0x23')](_0x254492,{'showHidden':![],'depth':null}));}return _0x127a8d(null,_0x4d8e67);})['catch'](function(_0x115cbe){logger[_0xc3ef('0x21')](util[_0xc3ef('0x1e')](_0xc3ef('0x22'),_0xf93614['name'],_0xf93614['id']),util[_0xc3ef('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x127a8d(_0x115cbe);});}else{return _0x127a8d(null,_0x4d8e67);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index e75e921..29c4950 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 _0xc051=['options','raw','where','attributes','map','include','model','catch','ShowZohoAccount','find','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','GetZohoAccount','ZohoAccount'];(function(_0x5d2703,_0x2a7039){var _0x3b1d56=function(_0x3cc581){while(--_0x3cc581){_0x5d2703['push'](_0x5d2703['shift']());}};_0x3b1d56(++_0x2a7039);}(_0xc051,0xb5));var _0x1c05=function(_0x1bf015,_0x340cc2){_0x1bf015=_0x1bf015-0x0;var _0x346543=_0xc051[_0x1bf015];return _0x346543;};'use strict';var _=require(_0x1c05('0x0'));var util=require(_0x1c05('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1c05('0x2'));var fs=require('fs');var Redis=require(_0x1c05('0x3'));var db=require(_0x1c05('0x4'))['db'];var utils=require(_0x1c05('0x5'));var logger=require('../../config/logger')(_0x1c05('0x6'));var config=require(_0x1c05('0x7'));var jayson=require(_0x1c05('0x8'));var client=jayson[_0x1c05('0x9')][_0x1c05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a978,_0x3a9ba8,_0x44d233){return new BPromise(function(_0x87b897,_0x4f75ea){return client[_0x1c05('0xb')](_0x28a978,_0x44d233)[_0x1c05('0xc')](function(_0x21b6be){logger[_0x1c05('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x3a9ba8,_0x1c05('0xe'));logger[_0x1c05('0xf')](_0x1c05('0x10'),_0x3a9ba8,_0x1c05('0xe'),JSON['stringify'](_0x21b6be));if(_0x21b6be[_0x1c05('0x11')]){if(_0x21b6be['error'][_0x1c05('0x12')]===0x1f4){logger[_0x1c05('0x11')](_0x1c05('0x13'),_0x3a9ba8,_0x21b6be[_0x1c05('0x11')][_0x1c05('0x14')]);return _0x4f75ea(_0x21b6be[_0x1c05('0x11')][_0x1c05('0x14')]);}logger[_0x1c05('0x11')](_0x1c05('0x13'),_0x3a9ba8,_0x21b6be[_0x1c05('0x11')][_0x1c05('0x14')]);return _0x87b897(_0x21b6be[_0x1c05('0x11')]['message']);}else{logger[_0x1c05('0xd')](_0x1c05('0x13'),_0x3a9ba8,_0x1c05('0xe'));_0x87b897(_0x21b6be['result'][_0x1c05('0x14')]);}})['catch'](function(_0x2ad711){logger[_0x1c05('0x11')](_0x1c05('0x13'),_0x3a9ba8,_0x2ad711);_0x4f75ea(_0x2ad711);});});}exports[_0x1c05('0x15')]=function(_0x5ac8cc){var _0x5d9a7e=this;return new Promise(function(_0x6ec656,_0x12a183){return db[_0x1c05('0x16')]['findAll']({'raw':_0x5ac8cc[_0x1c05('0x17')]?_0x5ac8cc[_0x1c05('0x17')][_0x1c05('0x18')]===undefined?!![]:![]:!![],'where':_0x5ac8cc['options']?_0x5ac8cc[_0x1c05('0x17')][_0x1c05('0x19')]||null:null,'attributes':_0x5ac8cc['options']?_0x5ac8cc['options'][_0x1c05('0x1a')]||null:null,'limit':_0x5ac8cc['options']?_0x5ac8cc['options']['limit']||null:null,'include':_0x5ac8cc[_0x1c05('0x17')]?_0x5ac8cc[_0x1c05('0x17')]['include']?_[_0x1c05('0x1b')](_0x5ac8cc[_0x1c05('0x17')][_0x1c05('0x1c')],function(_0x2cf340){return{'model':db[_0x2cf340['model']],'as':_0x2cf340['as'],'attributes':_0x2cf340[_0x1c05('0x1a')],'include':_0x2cf340[_0x1c05('0x1c')]?_[_0x1c05('0x1b')](_0x2cf340[_0x1c05('0x1c')],function(_0x25d863){return{'model':db[_0x25d863[_0x1c05('0x1d')]],'as':_0x25d863['as'],'attributes':_0x25d863['attributes'],'include':_0x25d863[_0x1c05('0x1c')]?_[_0x1c05('0x1b')](_0x25d863[_0x1c05('0x1c')],function(_0x334a42){return{'model':db[_0x334a42[_0x1c05('0x1d')]],'as':_0x334a42['as'],'attributes':_0x334a42[_0x1c05('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1c05('0xc')](function(_0x4f7658){logger[_0x1c05('0xd')](_0x1c05('0x15'),_0x5ac8cc);logger[_0x1c05('0xf')]('GetZohoAccount',_0x5ac8cc,JSON['stringify'](_0x4f7658));_0x6ec656(_0x4f7658);})[_0x1c05('0x1e')](function(_0x1d548e){logger[_0x1c05('0x11')](_0x1c05('0x15'),_0x1d548e[_0x1c05('0x14')],_0x5ac8cc);_0x12a183(_0x5d9a7e[_0x1c05('0x11')](0x1f4,_0x1d548e[_0x1c05('0x14')]));});});};exports[_0x1c05('0x1f')]=function(_0x1224da){var _0x3a9abb=this;return new Promise(function(_0x24b53f,_0x25878e){return db[_0x1c05('0x16')][_0x1c05('0x20')]({'raw':_0x1224da['options']?_0x1224da[_0x1c05('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1224da['options']?_0x1224da[_0x1c05('0x17')][_0x1c05('0x19')]||null:null,'attributes':_0x1224da[_0x1c05('0x17')]?_0x1224da[_0x1c05('0x17')]['attributes']||null:null,'include':_0x1224da[_0x1c05('0x17')]?_0x1224da['options'][_0x1c05('0x1c')]?_['map'](_0x1224da[_0x1c05('0x17')][_0x1c05('0x1c')],function(_0x13acfd){return{'model':db[_0x13acfd[_0x1c05('0x1d')]],'as':_0x13acfd['as'],'attributes':_0x13acfd[_0x1c05('0x1a')],'include':_0x13acfd[_0x1c05('0x1c')]?_[_0x1c05('0x1b')](_0x13acfd[_0x1c05('0x1c')],function(_0x1350e0){return{'model':db[_0x1350e0[_0x1c05('0x1d')]],'as':_0x1350e0['as'],'attributes':_0x1350e0[_0x1c05('0x1a')],'include':_0x1350e0[_0x1c05('0x1c')]?_[_0x1c05('0x1b')](_0x1350e0[_0x1c05('0x1c')],function(_0x84393b){return{'model':db[_0x84393b[_0x1c05('0x1d')]],'as':_0x84393b['as'],'attributes':_0x84393b[_0x1c05('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1c05('0xc')](function(_0x4aead0){logger[_0x1c05('0xd')](_0x1c05('0x1f'),_0x1224da);logger['debug']('ShowZohoAccount',_0x1224da,JSON[_0x1c05('0x21')](_0x4aead0));_0x24b53f(_0x4aead0);})[_0x1c05('0x1e')](function(_0x1eb5bb){logger['error'](_0x1c05('0x1f'),_0x1eb5bb[_0x1c05('0x14')],_0x1224da);_0x25878e(_0x3a9abb[_0x1c05('0x11')](0x1f4,_0x1eb5bb['message']));});});}; \ No newline at end of file +var _0x6691=['ZohoAccount','findAll','options','limit','map','include','model','attributes','ShowZohoAccount','find','raw','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','catch'];(function(_0x18ce99,_0x5a3234){var _0x1a7575=function(_0x531fe3){while(--_0x531fe3){_0x18ce99['push'](_0x18ce99['shift']());}};_0x1a7575(++_0x5a3234);}(_0x6691,0x12d));var _0x1669=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6691[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require(_0x1669('0x8'))(_0x1669('0x9'));var config=require('../../config/environment');var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x348683,_0x55393c,_0x5d23fd){return new BPromise(function(_0x59d1e5,_0x3420d5){return client['request'](_0x348683,_0x5d23fd)['then'](function(_0x51f7ef){logger[_0x1669('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x55393c,_0x1669('0xe'));logger[_0x1669('0xf')](_0x1669('0x10'),_0x55393c,_0x1669('0xe'),JSON[_0x1669('0x11')](_0x51f7ef));if(_0x51f7ef[_0x1669('0x12')]){if(_0x51f7ef[_0x1669('0x12')][_0x1669('0x13')]===0x1f4){logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);return _0x3420d5(_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);}logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);return _0x59d1e5(_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);}else{logger[_0x1669('0xd')](_0x1669('0x14'),_0x55393c,_0x1669('0xe'));_0x59d1e5(_0x51f7ef['result'][_0x1669('0x15')]);}})[_0x1669('0x16')](function(_0x4281dc){logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x4281dc);_0x3420d5(_0x4281dc);});});}exports['GetZohoAccount']=function(_0x56e3d9){var _0x201c59=this;return new Promise(function(_0x31600f,_0x238785){return db[_0x1669('0x17')][_0x1669('0x18')]({'raw':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['where']||null:null,'attributes':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['attributes']||null:null,'limit':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')][_0x1669('0x1a')]||null:null,'include':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['include']?_[_0x1669('0x1b')](_0x56e3d9[_0x1669('0x19')][_0x1669('0x1c')],function(_0x5796f2){return{'model':db[_0x5796f2[_0x1669('0x1d')]],'as':_0x5796f2['as'],'attributes':_0x5796f2['attributes'],'include':_0x5796f2['include']?_[_0x1669('0x1b')](_0x5796f2['include'],function(_0x304b25){return{'model':db[_0x304b25[_0x1669('0x1d')]],'as':_0x304b25['as'],'attributes':_0x304b25[_0x1669('0x1e')],'include':_0x304b25[_0x1669('0x1c')]?_[_0x1669('0x1b')](_0x304b25[_0x1669('0x1c')],function(_0x5283da){return{'model':db[_0x5283da['model']],'as':_0x5283da['as'],'attributes':_0x5283da[_0x1669('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x207c9f){logger[_0x1669('0xd')]('GetZohoAccount',_0x56e3d9);logger[_0x1669('0xf')]('GetZohoAccount',_0x56e3d9,JSON[_0x1669('0x11')](_0x207c9f));_0x31600f(_0x207c9f);})[_0x1669('0x16')](function(_0x31f4f0){logger[_0x1669('0x12')]('GetZohoAccount',_0x31f4f0['message'],_0x56e3d9);_0x238785(_0x201c59['error'](0x1f4,_0x31f4f0[_0x1669('0x15')]));});});};exports[_0x1669('0x1f')]=function(_0x1cbaa7){var _0x1eaa0c=this;return new Promise(function(_0x3af755,_0x59bd31){return db[_0x1669('0x17')][_0x1669('0x20')]({'raw':_0x1cbaa7[_0x1669('0x19')]?_0x1cbaa7[_0x1669('0x19')][_0x1669('0x21')]===undefined?!![]:![]:!![],'where':_0x1cbaa7[_0x1669('0x19')]?_0x1cbaa7[_0x1669('0x19')][_0x1669('0x22')]||null:null,'attributes':_0x1cbaa7['options']?_0x1cbaa7[_0x1669('0x19')]['attributes']||null:null,'include':_0x1cbaa7[_0x1669('0x19')]?_0x1cbaa7['options']['include']?_[_0x1669('0x1b')](_0x1cbaa7[_0x1669('0x19')][_0x1669('0x1c')],function(_0x43c46a){return{'model':db[_0x43c46a[_0x1669('0x1d')]],'as':_0x43c46a['as'],'attributes':_0x43c46a[_0x1669('0x1e')],'include':_0x43c46a[_0x1669('0x1c')]?_[_0x1669('0x1b')](_0x43c46a[_0x1669('0x1c')],function(_0x5326c5){return{'model':db[_0x5326c5[_0x1669('0x1d')]],'as':_0x5326c5['as'],'attributes':_0x5326c5[_0x1669('0x1e')],'include':_0x5326c5[_0x1669('0x1c')]?_[_0x1669('0x1b')](_0x5326c5[_0x1669('0x1c')],function(_0x998010){return{'model':db[_0x998010[_0x1669('0x1d')]],'as':_0x998010['as'],'attributes':_0x998010['attributes']};}):[]};}):[]};}):[]:[]})[_0x1669('0x23')](function(_0x4533bc){logger[_0x1669('0xd')](_0x1669('0x1f'),_0x1cbaa7);logger[_0x1669('0xf')](_0x1669('0x1f'),_0x1cbaa7,JSON['stringify'](_0x4533bc));_0x3af755(_0x4533bc);})['catch'](function(_0x4d444e){logger[_0x1669('0x12')](_0x1669('0x1f'),_0x4d444e[_0x1669('0x15')],_0x1cbaa7);_0x59bd31(_0x1eaa0c[_0x1669('0x12')](0x1f4,_0x4d444e[_0x1669('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 26fc262..cdc0394 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 _0x6f16=['destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','delete'];(function(_0x2a9202,_0x5e68cb){var _0x316625=function(_0x4ae297){while(--_0x4ae297){_0x2a9202['push'](_0x2a9202['shift']());}};_0x316625(++_0x5e68cb);}(_0x6f16,0x74));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x66f1('0x0'));var express=require(_0x66f1('0x1'));var router=express[_0x66f1('0x2')]();var fs_extra=require(_0x66f1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x66f1('0x4'));var config=require('../../config/environment');var controller=require(_0x66f1('0x5'));router[_0x66f1('0x6')]('/',auth[_0x66f1('0x7')](),controller[_0x66f1('0x8')]);router['get']('/:id',auth[_0x66f1('0x7')](),controller['show']);router[_0x66f1('0x6')]('/:id/fields',auth[_0x66f1('0x7')](),controller['getFields']);router[_0x66f1('0x6')](_0x66f1('0x9'),auth[_0x66f1('0x7')](),controller[_0x66f1('0xa')]);router[_0x66f1('0x6')]('/:id/descriptions',auth[_0x66f1('0x7')](),controller[_0x66f1('0xb')]);router[_0x66f1('0xc')]('/',auth[_0x66f1('0x7')](),controller[_0x66f1('0xd')]);router[_0x66f1('0xe')](_0x66f1('0xf'),auth[_0x66f1('0x7')](),controller['update']);router[_0x66f1('0x10')](_0x66f1('0xf'),auth[_0x66f1('0x7')](),controller[_0x66f1('0x11')]);module[_0x66f1('0x12')]=router; \ No newline at end of file +var _0x40f3=['getFields','/:id/subjects','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x4131a2,_0x28cd6c){var _0x21a6e7=function(_0x1936a4){while(--_0x1936a4){_0x4131a2['push'](_0x4131a2['shift']());}};_0x21a6e7(++_0x28cd6c);}(_0x40f3,0x13d));var _0x340f=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x40f3[_0x3c504b];return _0x2e5354;};'use strict';var multer=require(_0x340f('0x0'));var util=require('util');var path=require(_0x340f('0x1'));var timeout=require(_0x340f('0x2'));var express=require(_0x340f('0x3'));var router=express['Router']();var fs_extra=require(_0x340f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x340f('0x5'));var config=require(_0x340f('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x340f('0x7')]('/',auth[_0x340f('0x8')](),controller[_0x340f('0x9')]);router[_0x340f('0x7')](_0x340f('0xa'),auth[_0x340f('0x8')](),controller[_0x340f('0xb')]);router[_0x340f('0x7')](_0x340f('0xc'),auth[_0x340f('0x8')](),controller[_0x340f('0xd')]);router['get'](_0x340f('0xe'),auth[_0x340f('0x8')](),controller['getSubjects']);router[_0x340f('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x340f('0xf')]);router[_0x340f('0x10')]('/',auth[_0x340f('0x8')](),controller[_0x340f('0x11')]);router[_0x340f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x340f('0x13')]);router['delete'](_0x340f('0xa'),auth['isAuthenticated'](),controller[_0x340f('0x14')]);module[_0x340f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 693cb51..e02a733 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 _0x9c5a=['nothing','contact_lead','STRING','sequelize','exports','ENUM','lead','contact'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3257c5,_0x49f201){_0x3257c5=_0x3257c5-0x0;var _0x4cac71=_0x9c5a[_0x3257c5];return _0x4cac71;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xa9c5('0x2')](_0xa9c5('0x3'),_0xa9c5('0x4'),_0xa9c5('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa9c5('0x2')](_0xa9c5('0x6'),'contact',_0xa9c5('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xa9c5('0x7')]}}; \ No newline at end of file +var _0xc43b=['contact','nothing','lead','sequelize','exports','STRING'];(function(_0x5391ef,_0x3c8788){var _0x136499=function(_0x4d80a5){while(--_0x4d80a5){_0x5391ef['push'](_0x5391ef['shift']());}};_0x136499(++_0x3c8788);}(_0xc43b,0x1e3));var _0xbc43=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc43b[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0xbc43('0x0'));module[_0xbc43('0x1')]={'name':{'type':Sequelize[_0xbc43('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xbc43('0x3'),_0xbc43('0x4')),'defaultValue':_0xbc43('0x5')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xbc43('0x3'),_0xbc43('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xbc43('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index d2f1aeb..a3da523 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 _0xb540=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','keys','length','create','body','find','params','getFields','findOne','ZohoField','getSubjects','order','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xb540,0xe2));var _0x0b54=function(_0x313f0c,_0x5ceb27){_0x313f0c=_0x313f0c-0x0;var _0x4c5c43=_0xb540[_0x313f0c];return _0x4c5c43;};'use strict';var emlformat=require(_0x0b54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b54('0x1'));var jsonpatch=require(_0x0b54('0x2'));var rp=require(_0x0b54('0x3'));var moment=require(_0x0b54('0x4'));var BPromise=require(_0x0b54('0x5'));var Mustache=require(_0x0b54('0x6'));var util=require(_0x0b54('0x7'));var path=require('path');var sox=require(_0x0b54('0x8'));var csv=require(_0x0b54('0x9'));var ejs=require(_0x0b54('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0b54('0xb'));var crypto=require(_0x0b54('0xc'));var jsforce=require(_0x0b54('0xd'));var deskjs=require(_0x0b54('0xe'));var toCsv=require(_0x0b54('0x9'));var querystring=require(_0x0b54('0xf'));var Papa=require(_0x0b54('0x10'));var Redis=require(_0x0b54('0x11'));var authService=require(_0x0b54('0x12'));var qs=require(_0x0b54('0x13'));var as=require(_0x0b54('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b54('0x15'))('api');var utils=require(_0x0b54('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0b54('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21854d,_0x5e7e0b){_0x5e7e0b=_0x5e7e0b||0xcc;return function(_0x2b724a){if(_0x2b724a){return _0x21854d[_0x0b54('0x18')](_0x5e7e0b);}return _0x21854d[_0x0b54('0x19')](_0x5e7e0b)[_0x0b54('0x1a')]();};}function respondWithResult(_0x41da1c,_0x29f89b){_0x29f89b=_0x29f89b||0xc8;return function(_0x52222c){if(_0x52222c){return _0x41da1c['status'](_0x29f89b)[_0x0b54('0x1b')](_0x52222c);}};}function respondWithFilteredResult(_0x43d4d2,_0x4872f9){return function(_0x4e5198){if(_0x4e5198){var _0x5bf871=typeof _0x4872f9[_0x0b54('0x1c')]===_0x0b54('0x1d')&&typeof _0x4872f9[_0x0b54('0x1e')]===_0x0b54('0x1d');var _0x3236d8=_0x4e5198['count'];var _0x57239b=_0x5bf871?0x0:_0x4872f9[_0x0b54('0x1c')];var _0x2297c9=_0x5bf871?_0x4e5198[_0x0b54('0x1f')]:_0x4872f9[_0x0b54('0x1c')]+_0x4872f9[_0x0b54('0x1e')];var _0xd7138e;if(_0x2297c9>=_0x3236d8){_0x2297c9=_0x3236d8;_0xd7138e=0xc8;}else{_0xd7138e=0xce;}_0x43d4d2['status'](_0xd7138e);return _0x43d4d2[_0x0b54('0x20')](_0x0b54('0x21'),_0x57239b+'-'+_0x2297c9+'/'+_0x3236d8)[_0x0b54('0x1b')](_0x4e5198);}return null;};}function patchUpdates(_0x38bcfb){return function(_0x1abd13){try{jsonpatch[_0x0b54('0x22')](_0x1abd13,_0x38bcfb,!![]);}catch(_0x49e70f){return BPromise['reject'](_0x49e70f);}return _0x1abd13[_0x0b54('0x23')]();};}function saveUpdates(_0x508af5,_0x1f06cb){return function(_0x46393a){if(_0x46393a){return _0x46393a[_0x0b54('0x24')](_0x508af5)[_0x0b54('0x25')](function(_0x176c29){return _0x176c29;});}return null;};}function removeEntity(_0x42b5e5,_0x21505c){return function(_0x472fdf){if(_0x472fdf){return _0x472fdf[_0x0b54('0x26')]()['then'](function(){_0x42b5e5[_0x0b54('0x19')](0xcc)[_0x0b54('0x1a')]();});}};}function handleEntityNotFound(_0x495bcf,_0x1c844f){return function(_0x304d5e){if(!_0x304d5e){_0x495bcf[_0x0b54('0x18')](0x194);}return _0x304d5e;};}function handleError(_0x21a53b,_0x24ddef){_0x24ddef=_0x24ddef||0x1f4;return function(_0x16852c){logger[_0x0b54('0x27')](_0x16852c['stack']);if(_0x16852c['name']){delete _0x16852c['name'];}_0x21a53b[_0x0b54('0x19')](_0x24ddef)[_0x0b54('0x28')](_0x16852c);};}exports[_0x0b54('0x29')]=function(_0x5d4c66,_0x3ecd81){var _0x5f3334={},_0x2fd12e={},_0x415580={'count':0x0,'rows':[]};var _0x4c683c=_[_0x0b54('0x2a')](db[_0x0b54('0x2b')][_0x0b54('0x2c')],function(_0x5c3f0b){return{'name':_0x5c3f0b[_0x0b54('0x2d')],'type':_0x5c3f0b[_0x0b54('0x2e')]['key']};});_0x2fd12e[_0x0b54('0x2f')]=_[_0x0b54('0x2a')](_0x4c683c,_0x0b54('0x30'));_0x2fd12e[_0x0b54('0x31')]=_['keys'](_0x5d4c66[_0x0b54('0x31')]);_0x2fd12e[_0x0b54('0x32')]=_[_0x0b54('0x33')](_0x2fd12e[_0x0b54('0x2f')],_0x2fd12e[_0x0b54('0x31')]);_0x5f3334[_0x0b54('0x34')]=_[_0x0b54('0x33')](_0x2fd12e[_0x0b54('0x2f')],qs[_0x0b54('0x35')](_0x5d4c66['query']['fields']));_0x5f3334[_0x0b54('0x34')]=_0x5f3334[_0x0b54('0x34')]['length']?_0x5f3334[_0x0b54('0x34')]:_0x2fd12e[_0x0b54('0x2f')];if(!_0x5d4c66[_0x0b54('0x31')]['hasOwnProperty'](_0x0b54('0x36'))){_0x5f3334[_0x0b54('0x1e')]=qs['limit'](_0x5d4c66[_0x0b54('0x31')][_0x0b54('0x1e')]);_0x5f3334[_0x0b54('0x1c')]=qs['offset'](_0x5d4c66['query'][_0x0b54('0x1c')]);}_0x5f3334['order']=qs['sort'](_0x5d4c66[_0x0b54('0x31')][_0x0b54('0x37')]);_0x5f3334[_0x0b54('0x38')]=qs['filters'](_[_0x0b54('0x39')](_0x5d4c66[_0x0b54('0x31')],_0x2fd12e[_0x0b54('0x32')]),_0x4c683c);if(_0x5d4c66[_0x0b54('0x31')][_0x0b54('0x3a')]){_0x5f3334[_0x0b54('0x38')]=_['merge'](_0x5f3334[_0x0b54('0x38')],{'$or':_['map'](_0x4c683c,function(_0x297916){if(_0x297916[_0x0b54('0x2e')]!==_0x0b54('0x3b')){var _0x2c1719={};_0x2c1719[_0x297916[_0x0b54('0x30')]]={'$like':'%'+_0x5d4c66['query'][_0x0b54('0x3a')]+'%'};return _0x2c1719;}})});}_0x5f3334=_[_0x0b54('0x3c')]({},_0x5f3334,_0x5d4c66[_0x0b54('0x3d')]);var _0x2e17dd={'where':_0x5f3334[_0x0b54('0x38')]};return db['ZohoConfiguration'][_0x0b54('0x1f')](_0x2e17dd)[_0x0b54('0x25')](function(_0x4a928c){_0x415580['count']=_0x4a928c;if(_0x5d4c66[_0x0b54('0x31')][_0x0b54('0x3e')]){_0x5f3334['include']=[{'all':!![]}];}return db[_0x0b54('0x2b')][_0x0b54('0x3f')](_0x5f3334);})['then'](function(_0x2bfbeb){_0x415580['rows']=_0x2bfbeb;return _0x415580;})['then'](respondWithFilteredResult(_0x3ecd81,_0x5f3334))[_0x0b54('0x40')](handleError(_0x3ecd81,null));};exports[_0x0b54('0x41')]=function(_0x271896,_0x40c4d4){var _0x2d8fae={'raw':![],'where':{'id':_0x271896['params']['id']}},_0x4362ba={};_0x4362ba[_0x0b54('0x2f')]=_['keys'](db['ZohoConfiguration'][_0x0b54('0x2c')]);_0x4362ba[_0x0b54('0x31')]=_[_0x0b54('0x42')](_0x271896[_0x0b54('0x31')]);_0x4362ba[_0x0b54('0x32')]=_[_0x0b54('0x33')](_0x4362ba[_0x0b54('0x2f')],_0x4362ba[_0x0b54('0x31')]);_0x2d8fae[_0x0b54('0x34')]=_[_0x0b54('0x33')](_0x4362ba[_0x0b54('0x2f')],qs['fields'](_0x271896['query'][_0x0b54('0x35')]));_0x2d8fae[_0x0b54('0x34')]=_0x2d8fae[_0x0b54('0x34')][_0x0b54('0x43')]?_0x2d8fae[_0x0b54('0x34')]:_0x4362ba[_0x0b54('0x2f')];if(_0x271896[_0x0b54('0x31')][_0x0b54('0x3e')]){_0x2d8fae['include']=[{'all':!![]}];}_0x2d8fae=_[_0x0b54('0x3c')]({},_0x2d8fae,_0x271896[_0x0b54('0x3d')]);return db[_0x0b54('0x2b')]['find'](_0x2d8fae)[_0x0b54('0x25')](handleEntityNotFound(_0x40c4d4,null))[_0x0b54('0x25')](respondWithResult(_0x40c4d4,null))[_0x0b54('0x40')](handleError(_0x40c4d4,null));};exports[_0x0b54('0x44')]=function(_0x219eb2,_0x32fb6a){return db[_0x0b54('0x2b')][_0x0b54('0x44')](_0x219eb2[_0x0b54('0x45')],{})['then'](respondWithResult(_0x32fb6a,0xc9))[_0x0b54('0x40')](handleError(_0x32fb6a,null));};exports['update']=function(_0x17c02a,_0x3f837c){if(_0x17c02a[_0x0b54('0x45')]['id']){delete _0x17c02a[_0x0b54('0x45')]['id'];}return db[_0x0b54('0x2b')][_0x0b54('0x46')]({'where':{'id':_0x17c02a[_0x0b54('0x47')]['id']}})[_0x0b54('0x25')](handleEntityNotFound(_0x3f837c,null))[_0x0b54('0x25')](saveUpdates(_0x17c02a['body'],null))['then'](respondWithResult(_0x3f837c,null))[_0x0b54('0x40')](handleError(_0x3f837c,null));};exports[_0x0b54('0x26')]=function(_0x385472,_0x19cf46){return db['ZohoConfiguration'][_0x0b54('0x46')]({'where':{'id':_0x385472[_0x0b54('0x47')]['id']}})[_0x0b54('0x25')](handleEntityNotFound(_0x19cf46,null))[_0x0b54('0x25')](removeEntity(_0x19cf46,null))[_0x0b54('0x40')](handleError(_0x19cf46,null));};exports[_0x0b54('0x48')]=function(_0x20c0ef,_0x246372,_0x20ae78){var _0x4209c2={};var _0x2261d5={};var _0x150f2e;var _0x26f80e;return db['ZohoConfiguration'][_0x0b54('0x49')]({'where':{'id':_0x20c0ef['params']['id']}})[_0x0b54('0x25')](handleEntityNotFound(_0x246372,null))[_0x0b54('0x25')](function(_0x5ad2c9){if(_0x5ad2c9){_0x150f2e=_0x5ad2c9;_0x2261d5[_0x0b54('0x2f')]=_[_0x0b54('0x42')](db[_0x0b54('0x4a')][_0x0b54('0x2c')]);_0x2261d5[_0x0b54('0x31')]=_['keys'](_0x20c0ef['query']);_0x2261d5[_0x0b54('0x32')]=_['intersection'](_0x2261d5['model'],_0x2261d5[_0x0b54('0x31')]);_0x4209c2[_0x0b54('0x34')]=_[_0x0b54('0x33')](_0x2261d5['model'],qs[_0x0b54('0x35')](_0x20c0ef[_0x0b54('0x31')][_0x0b54('0x35')]));_0x4209c2[_0x0b54('0x34')]=_0x4209c2[_0x0b54('0x34')][_0x0b54('0x43')]?_0x4209c2['attributes']:_0x2261d5['model'];_0x4209c2['order']=qs['sort'](_0x20c0ef[_0x0b54('0x31')][_0x0b54('0x37')]);_0x4209c2['where']=qs['filters'](_[_0x0b54('0x39')](_0x20c0ef['query'],_0x2261d5[_0x0b54('0x32')]));if(_0x20c0ef['query'][_0x0b54('0x3a')]){_0x4209c2[_0x0b54('0x38')]=_[_0x0b54('0x3c')](_0x4209c2[_0x0b54('0x38')],{'$or':_[_0x0b54('0x2a')](_0x4209c2['attributes'],function(_0x1383de){var _0x295b86={};_0x295b86[_0x1383de]={'$like':'%'+_0x20c0ef['query'][_0x0b54('0x3a')]+'%'};return _0x295b86;})});}_0x4209c2=_[_0x0b54('0x3c')]({},_0x4209c2,_0x20c0ef[_0x0b54('0x3d')]);return _0x150f2e[_0x0b54('0x48')](_0x4209c2);}})[_0x0b54('0x25')](function(_0x5b7222){if(_0x5b7222){_0x26f80e=_0x5b7222[_0x0b54('0x43')];if(!_0x20c0ef[_0x0b54('0x31')]['hasOwnProperty']('nolimit')){_0x4209c2[_0x0b54('0x1e')]=qs[_0x0b54('0x1e')](_0x20c0ef[_0x0b54('0x31')][_0x0b54('0x1e')]);_0x4209c2['offset']=qs[_0x0b54('0x1c')](_0x20c0ef[_0x0b54('0x31')]['offset']);}return _0x150f2e['getFields'](_0x4209c2);}})[_0x0b54('0x25')](function(_0x300031){if(_0x300031){return _0x300031?{'count':_0x26f80e,'rows':_0x300031}:null;}})[_0x0b54('0x25')](respondWithResult(_0x246372,null))['catch'](handleError(_0x246372,null));};exports[_0x0b54('0x4b')]=function(_0x431da9,_0x22450f,_0x878786){var _0xad0366={};var _0x1161f5={};var _0x1acab9;var _0x34f97d;return db[_0x0b54('0x2b')][_0x0b54('0x49')]({'where':{'id':_0x431da9[_0x0b54('0x47')]['id']}})[_0x0b54('0x25')](handleEntityNotFound(_0x22450f,null))[_0x0b54('0x25')](function(_0x4fa4b6){if(_0x4fa4b6){_0x1acab9=_0x4fa4b6;_0x1161f5[_0x0b54('0x2f')]=_[_0x0b54('0x42')](db[_0x0b54('0x4a')][_0x0b54('0x2c')]);_0x1161f5['query']=_[_0x0b54('0x42')](_0x431da9[_0x0b54('0x31')]);_0x1161f5[_0x0b54('0x32')]=_[_0x0b54('0x33')](_0x1161f5[_0x0b54('0x2f')],_0x1161f5[_0x0b54('0x31')]);_0xad0366[_0x0b54('0x34')]=_[_0x0b54('0x33')](_0x1161f5[_0x0b54('0x2f')],qs[_0x0b54('0x35')](_0x431da9[_0x0b54('0x31')][_0x0b54('0x35')]));_0xad0366['attributes']=_0xad0366['attributes']['length']?_0xad0366[_0x0b54('0x34')]:_0x1161f5[_0x0b54('0x2f')];_0xad0366[_0x0b54('0x4c')]=qs[_0x0b54('0x37')](_0x431da9['query']['sort']);_0xad0366[_0x0b54('0x38')]=qs[_0x0b54('0x32')](_['pick'](_0x431da9[_0x0b54('0x31')],_0x1161f5[_0x0b54('0x32')]));if(_0x431da9[_0x0b54('0x31')]['filter']){_0xad0366['where']=_[_0x0b54('0x3c')](_0xad0366['where'],{'$or':_[_0x0b54('0x2a')](_0xad0366[_0x0b54('0x34')],function(_0x32f802){var _0xcdb68a={};_0xcdb68a[_0x32f802]={'$like':'%'+_0x431da9['query'][_0x0b54('0x3a')]+'%'};return _0xcdb68a;})});}_0xad0366=_['merge']({},_0xad0366,_0x431da9['options']);return _0x1acab9['getSubjects'](_0xad0366);}})['then'](function(_0x417935){if(_0x417935){_0x34f97d=_0x417935[_0x0b54('0x43')];if(!_0x431da9['query'][_0x0b54('0x4d')](_0x0b54('0x36'))){_0xad0366['limit']=qs['limit'](_0x431da9[_0x0b54('0x31')]['limit']);_0xad0366[_0x0b54('0x1c')]=qs[_0x0b54('0x1c')](_0x431da9['query'][_0x0b54('0x1c')]);}return _0x1acab9[_0x0b54('0x4b')](_0xad0366);}})[_0x0b54('0x25')](function(_0x3b0cb9){if(_0x3b0cb9){return _0x3b0cb9?{'count':_0x34f97d,'rows':_0x3b0cb9}:null;}})[_0x0b54('0x25')](respondWithResult(_0x22450f,null))[_0x0b54('0x40')](handleError(_0x22450f,null));};exports[_0x0b54('0x4e')]=function(_0x4d0f85,_0x1795db,_0xdd4d34){var _0x210392={};var _0x1d0f33={};var _0x40817f;var _0x54374d;return db[_0x0b54('0x2b')]['findOne']({'where':{'id':_0x4d0f85['params']['id']}})[_0x0b54('0x25')](handleEntityNotFound(_0x1795db,null))['then'](function(_0x2c6224){if(_0x2c6224){_0x40817f=_0x2c6224;_0x1d0f33[_0x0b54('0x2f')]=_[_0x0b54('0x42')](db[_0x0b54('0x4a')][_0x0b54('0x2c')]);_0x1d0f33[_0x0b54('0x31')]=_[_0x0b54('0x42')](_0x4d0f85[_0x0b54('0x31')]);_0x1d0f33[_0x0b54('0x32')]=_['intersection'](_0x1d0f33[_0x0b54('0x2f')],_0x1d0f33[_0x0b54('0x31')]);_0x210392[_0x0b54('0x34')]=_[_0x0b54('0x33')](_0x1d0f33[_0x0b54('0x2f')],qs['fields'](_0x4d0f85[_0x0b54('0x31')][_0x0b54('0x35')]));_0x210392['attributes']=_0x210392['attributes'][_0x0b54('0x43')]?_0x210392[_0x0b54('0x34')]:_0x1d0f33[_0x0b54('0x2f')];_0x210392['order']=qs['sort'](_0x4d0f85['query'][_0x0b54('0x37')]);_0x210392['where']=qs[_0x0b54('0x32')](_[_0x0b54('0x39')](_0x4d0f85['query'],_0x1d0f33[_0x0b54('0x32')]));if(_0x4d0f85[_0x0b54('0x31')][_0x0b54('0x3a')]){_0x210392[_0x0b54('0x38')]=_[_0x0b54('0x3c')](_0x210392['where'],{'$or':_[_0x0b54('0x2a')](_0x210392[_0x0b54('0x34')],function(_0x1b76fb){var _0x343312={};_0x343312[_0x1b76fb]={'$like':'%'+_0x4d0f85[_0x0b54('0x31')][_0x0b54('0x3a')]+'%'};return _0x343312;})});}_0x210392=_[_0x0b54('0x3c')]({},_0x210392,_0x4d0f85[_0x0b54('0x3d')]);return _0x40817f[_0x0b54('0x4e')](_0x210392);}})['then'](function(_0x29f2ea){if(_0x29f2ea){_0x54374d=_0x29f2ea[_0x0b54('0x43')];if(!_0x4d0f85[_0x0b54('0x31')][_0x0b54('0x4d')]('nolimit')){_0x210392[_0x0b54('0x1e')]=qs[_0x0b54('0x1e')](_0x4d0f85['query'][_0x0b54('0x1e')]);_0x210392[_0x0b54('0x1c')]=qs[_0x0b54('0x1c')](_0x4d0f85[_0x0b54('0x31')][_0x0b54('0x1c')]);}return _0x40817f['getDescriptions'](_0x210392);}})['then'](function(_0x33660f){if(_0x33660f){return _0x33660f?{'count':_0x54374d,'rows':_0x33660f}:null;}})[_0x0b54('0x25')](respondWithResult(_0x1795db,null))[_0x0b54('0x40')](handleError(_0x1795db,null));}; \ No newline at end of file +var _0x9185=['stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','ZohoField','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x9185,0x76));var _0x5918=function(_0x599570,_0x460668){_0x599570=_0x599570-0x0;var _0x3d743f=_0x9185[_0x599570];return _0x3d743f;};'use strict';var emlformat=require(_0x5918('0x0'));var rimraf=require(_0x5918('0x1'));var zipdir=require(_0x5918('0x2'));var jsonpatch=require(_0x5918('0x3'));var rp=require(_0x5918('0x4'));var moment=require(_0x5918('0x5'));var BPromise=require(_0x5918('0x6'));var Mustache=require(_0x5918('0x7'));var util=require(_0x5918('0x8'));var path=require('path');var sox=require(_0x5918('0x9'));var csv=require(_0x5918('0xa'));var ejs=require(_0x5918('0xb'));var fs=require('fs');var fs_extra=require(_0x5918('0xc'));var _=require(_0x5918('0xd'));var squel=require(_0x5918('0xe'));var crypto=require(_0x5918('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5918('0x10'));var toCsv=require(_0x5918('0xa'));var querystring=require(_0x5918('0x11'));var Papa=require(_0x5918('0x12'));var Redis=require(_0x5918('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5918('0x14'));var logger=require(_0x5918('0x15'))(_0x5918('0x16'));var utils=require('../../config/utils');var config=require(_0x5918('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23706d,_0x44723a){_0x44723a=_0x44723a||0xcc;return function(_0x19960b){if(_0x19960b){return _0x23706d[_0x5918('0x18')](_0x44723a);}return _0x23706d[_0x5918('0x19')](_0x44723a)[_0x5918('0x1a')]();};}function respondWithResult(_0x2f83b5,_0x22a128){_0x22a128=_0x22a128||0xc8;return function(_0x1c34f5){if(_0x1c34f5){return _0x2f83b5[_0x5918('0x19')](_0x22a128)[_0x5918('0x1b')](_0x1c34f5);}};}function respondWithFilteredResult(_0x3f065e,_0x4fe9ac){return function(_0x145ca1){if(_0x145ca1){var _0x12a436=typeof _0x4fe9ac[_0x5918('0x1c')]===_0x5918('0x1d')&&typeof _0x4fe9ac[_0x5918('0x1e')]==='undefined';var _0x448765=_0x145ca1[_0x5918('0x1f')];var _0x125e9b=_0x12a436?0x0:_0x4fe9ac[_0x5918('0x1c')];var _0x4f08cb=_0x12a436?_0x145ca1[_0x5918('0x1f')]:_0x4fe9ac['offset']+_0x4fe9ac['limit'];var _0x7a7f64;if(_0x4f08cb>=_0x448765){_0x4f08cb=_0x448765;_0x7a7f64=0xc8;}else{_0x7a7f64=0xce;}_0x3f065e[_0x5918('0x19')](_0x7a7f64);return _0x3f065e[_0x5918('0x20')](_0x5918('0x21'),_0x125e9b+'-'+_0x4f08cb+'/'+_0x448765)[_0x5918('0x1b')](_0x145ca1);}return null;};}function patchUpdates(_0x512d5f){return function(_0x219f16){try{jsonpatch[_0x5918('0x22')](_0x219f16,_0x512d5f,!![]);}catch(_0x4f8c0c){return BPromise[_0x5918('0x23')](_0x4f8c0c);}return _0x219f16['save']();};}function saveUpdates(_0x5ae2fe,_0x55ddf9){return function(_0x1158a5){if(_0x1158a5){return _0x1158a5[_0x5918('0x24')](_0x5ae2fe)[_0x5918('0x25')](function(_0x154f06){return _0x154f06;});}return null;};}function removeEntity(_0x1027a8,_0x2e3a2c){return function(_0x12ee3e){if(_0x12ee3e){return _0x12ee3e[_0x5918('0x26')]()[_0x5918('0x25')](function(){_0x1027a8[_0x5918('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ab8a,_0x4e846c){return function(_0x1fd86f){if(!_0x1fd86f){_0x45ab8a[_0x5918('0x18')](0x194);}return _0x1fd86f;};}function handleError(_0x17f6c4,_0x487b07){_0x487b07=_0x487b07||0x1f4;return function(_0x3e4dd8){logger[_0x5918('0x27')](_0x3e4dd8[_0x5918('0x28')]);if(_0x3e4dd8[_0x5918('0x29')]){delete _0x3e4dd8[_0x5918('0x29')];}_0x17f6c4[_0x5918('0x19')](_0x487b07)[_0x5918('0x2a')](_0x3e4dd8);};}exports['index']=function(_0x165094,_0x19d557){var _0x4099b4={},_0x49d85e={},_0x281f24={'count':0x0,'rows':[]};var _0x5c6906=_[_0x5918('0x2b')](db[_0x5918('0x2c')][_0x5918('0x2d')],function(_0x2d0e19){return{'name':_0x2d0e19[_0x5918('0x2e')],'type':_0x2d0e19[_0x5918('0x2f')][_0x5918('0x30')]};});_0x49d85e[_0x5918('0x31')]=_[_0x5918('0x2b')](_0x5c6906,_0x5918('0x29'));_0x49d85e[_0x5918('0x32')]=_[_0x5918('0x33')](_0x165094['query']);_0x49d85e[_0x5918('0x34')]=_[_0x5918('0x35')](_0x49d85e[_0x5918('0x31')],_0x49d85e[_0x5918('0x32')]);_0x4099b4['attributes']=_[_0x5918('0x35')](_0x49d85e[_0x5918('0x31')],qs[_0x5918('0x36')](_0x165094[_0x5918('0x32')]['fields']));_0x4099b4[_0x5918('0x37')]=_0x4099b4[_0x5918('0x37')][_0x5918('0x38')]?_0x4099b4[_0x5918('0x37')]:_0x49d85e[_0x5918('0x31')];if(!_0x165094['query']['hasOwnProperty'](_0x5918('0x39'))){_0x4099b4[_0x5918('0x1e')]=qs['limit'](_0x165094[_0x5918('0x32')]['limit']);_0x4099b4[_0x5918('0x1c')]=qs['offset'](_0x165094[_0x5918('0x32')][_0x5918('0x1c')]);}_0x4099b4[_0x5918('0x3a')]=qs[_0x5918('0x3b')](_0x165094[_0x5918('0x32')]['sort']);_0x4099b4[_0x5918('0x3c')]=qs[_0x5918('0x34')](_[_0x5918('0x3d')](_0x165094[_0x5918('0x32')],_0x49d85e[_0x5918('0x34')]),_0x5c6906);if(_0x165094[_0x5918('0x32')][_0x5918('0x3e')]){_0x4099b4[_0x5918('0x3c')]=_[_0x5918('0x3f')](_0x4099b4[_0x5918('0x3c')],{'$or':_[_0x5918('0x2b')](_0x5c6906,function(_0x178f2c){if(_0x178f2c['type']!=='VIRTUAL'){var _0x58363a={};_0x58363a[_0x178f2c[_0x5918('0x29')]]={'$like':'%'+_0x165094[_0x5918('0x32')][_0x5918('0x3e')]+'%'};return _0x58363a;}})});}_0x4099b4=_['merge']({},_0x4099b4,_0x165094[_0x5918('0x40')]);var _0x401634={'where':_0x4099b4['where']};return db[_0x5918('0x2c')][_0x5918('0x1f')](_0x401634)[_0x5918('0x25')](function(_0x4bd31b){_0x281f24['count']=_0x4bd31b;if(_0x165094[_0x5918('0x32')][_0x5918('0x41')]){_0x4099b4[_0x5918('0x42')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x5918('0x43')](_0x4099b4);})['then'](function(_0x1cde6a){_0x281f24['rows']=_0x1cde6a;return _0x281f24;})[_0x5918('0x25')](respondWithFilteredResult(_0x19d557,_0x4099b4))[_0x5918('0x44')](handleError(_0x19d557,null));};exports[_0x5918('0x45')]=function(_0x474611,_0x3320a9){var _0x250587={'raw':![],'where':{'id':_0x474611[_0x5918('0x46')]['id']}},_0x953764={};_0x953764['model']=_[_0x5918('0x33')](db[_0x5918('0x2c')][_0x5918('0x2d')]);_0x953764['query']=_[_0x5918('0x33')](_0x474611[_0x5918('0x32')]);_0x953764['filters']=_[_0x5918('0x35')](_0x953764['model'],_0x953764[_0x5918('0x32')]);_0x250587[_0x5918('0x37')]=_[_0x5918('0x35')](_0x953764[_0x5918('0x31')],qs['fields'](_0x474611[_0x5918('0x32')]['fields']));_0x250587['attributes']=_0x250587[_0x5918('0x37')]['length']?_0x250587[_0x5918('0x37')]:_0x953764[_0x5918('0x31')];if(_0x474611[_0x5918('0x32')]['includeAll']){_0x250587['include']=[{'all':!![]}];}_0x250587=_['merge']({},_0x250587,_0x474611[_0x5918('0x40')]);return db['ZohoConfiguration'][_0x5918('0x47')](_0x250587)[_0x5918('0x25')](handleEntityNotFound(_0x3320a9,null))[_0x5918('0x25')](respondWithResult(_0x3320a9,null))[_0x5918('0x44')](handleError(_0x3320a9,null));};exports[_0x5918('0x48')]=function(_0xd867a8,_0x1f4145){return db['ZohoConfiguration'][_0x5918('0x48')](_0xd867a8[_0x5918('0x49')],{})[_0x5918('0x25')](respondWithResult(_0x1f4145,0xc9))[_0x5918('0x44')](handleError(_0x1f4145,null));};exports['update']=function(_0x416272,_0x5e31a4){if(_0x416272['body']['id']){delete _0x416272[_0x5918('0x49')]['id'];}return db[_0x5918('0x2c')][_0x5918('0x47')]({'where':{'id':_0x416272[_0x5918('0x46')]['id']}})[_0x5918('0x25')](handleEntityNotFound(_0x5e31a4,null))[_0x5918('0x25')](saveUpdates(_0x416272[_0x5918('0x49')],null))[_0x5918('0x25')](respondWithResult(_0x5e31a4,null))['catch'](handleError(_0x5e31a4,null));};exports[_0x5918('0x26')]=function(_0x37aff2,_0x2e3ec2){return db[_0x5918('0x2c')][_0x5918('0x47')]({'where':{'id':_0x37aff2['params']['id']}})[_0x5918('0x25')](handleEntityNotFound(_0x2e3ec2,null))[_0x5918('0x25')](removeEntity(_0x2e3ec2,null))[_0x5918('0x44')](handleError(_0x2e3ec2,null));};exports[_0x5918('0x4a')]=function(_0x11e26c,_0x377361,_0x4da16a){var _0x1fc4a2={};var _0x3a866b={};var _0x35a41e;var _0xaab6b2;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x11e26c[_0x5918('0x46')]['id']}})[_0x5918('0x25')](handleEntityNotFound(_0x377361,null))[_0x5918('0x25')](function(_0x59c8e6){if(_0x59c8e6){_0x35a41e=_0x59c8e6;_0x3a866b[_0x5918('0x31')]=_[_0x5918('0x33')](db[_0x5918('0x4b')][_0x5918('0x2d')]);_0x3a866b['query']=_[_0x5918('0x33')](_0x11e26c[_0x5918('0x32')]);_0x3a866b[_0x5918('0x34')]=_['intersection'](_0x3a866b[_0x5918('0x31')],_0x3a866b[_0x5918('0x32')]);_0x1fc4a2[_0x5918('0x37')]=_[_0x5918('0x35')](_0x3a866b[_0x5918('0x31')],qs[_0x5918('0x36')](_0x11e26c[_0x5918('0x32')][_0x5918('0x36')]));_0x1fc4a2['attributes']=_0x1fc4a2[_0x5918('0x37')][_0x5918('0x38')]?_0x1fc4a2[_0x5918('0x37')]:_0x3a866b[_0x5918('0x31')];_0x1fc4a2[_0x5918('0x3a')]=qs[_0x5918('0x3b')](_0x11e26c[_0x5918('0x32')][_0x5918('0x3b')]);_0x1fc4a2[_0x5918('0x3c')]=qs['filters'](_['pick'](_0x11e26c['query'],_0x3a866b[_0x5918('0x34')]));if(_0x11e26c[_0x5918('0x32')]['filter']){_0x1fc4a2[_0x5918('0x3c')]=_[_0x5918('0x3f')](_0x1fc4a2['where'],{'$or':_[_0x5918('0x2b')](_0x1fc4a2[_0x5918('0x37')],function(_0x3fd0a4){var _0x43f317={};_0x43f317[_0x3fd0a4]={'$like':'%'+_0x11e26c[_0x5918('0x32')][_0x5918('0x3e')]+'%'};return _0x43f317;})});}_0x1fc4a2=_[_0x5918('0x3f')]({},_0x1fc4a2,_0x11e26c['options']);return _0x35a41e[_0x5918('0x4a')](_0x1fc4a2);}})[_0x5918('0x25')](function(_0x262f83){if(_0x262f83){_0xaab6b2=_0x262f83['length'];if(!_0x11e26c[_0x5918('0x32')]['hasOwnProperty'](_0x5918('0x39'))){_0x1fc4a2[_0x5918('0x1e')]=qs[_0x5918('0x1e')](_0x11e26c[_0x5918('0x32')][_0x5918('0x1e')]);_0x1fc4a2['offset']=qs[_0x5918('0x1c')](_0x11e26c['query'][_0x5918('0x1c')]);}return _0x35a41e[_0x5918('0x4a')](_0x1fc4a2);}})[_0x5918('0x25')](function(_0x18ae93){if(_0x18ae93){return _0x18ae93?{'count':_0xaab6b2,'rows':_0x18ae93}:null;}})[_0x5918('0x25')](respondWithResult(_0x377361,null))[_0x5918('0x44')](handleError(_0x377361,null));};exports[_0x5918('0x4c')]=function(_0x510429,_0x2582e0,_0x5d19b4){var _0x420a1a={};var _0x4fe689={};var _0x545534;var _0x50b5ca;return db[_0x5918('0x2c')]['findOne']({'where':{'id':_0x510429[_0x5918('0x46')]['id']}})[_0x5918('0x25')](handleEntityNotFound(_0x2582e0,null))[_0x5918('0x25')](function(_0x3c2221){if(_0x3c2221){_0x545534=_0x3c2221;_0x4fe689[_0x5918('0x31')]=_[_0x5918('0x33')](db[_0x5918('0x4b')]['rawAttributes']);_0x4fe689[_0x5918('0x32')]=_['keys'](_0x510429[_0x5918('0x32')]);_0x4fe689[_0x5918('0x34')]=_[_0x5918('0x35')](_0x4fe689['model'],_0x4fe689[_0x5918('0x32')]);_0x420a1a[_0x5918('0x37')]=_['intersection'](_0x4fe689['model'],qs['fields'](_0x510429[_0x5918('0x32')][_0x5918('0x36')]));_0x420a1a[_0x5918('0x37')]=_0x420a1a[_0x5918('0x37')][_0x5918('0x38')]?_0x420a1a[_0x5918('0x37')]:_0x4fe689[_0x5918('0x31')];_0x420a1a['order']=qs['sort'](_0x510429[_0x5918('0x32')][_0x5918('0x3b')]);_0x420a1a['where']=qs[_0x5918('0x34')](_['pick'](_0x510429[_0x5918('0x32')],_0x4fe689[_0x5918('0x34')]));if(_0x510429[_0x5918('0x32')][_0x5918('0x3e')]){_0x420a1a[_0x5918('0x3c')]=_[_0x5918('0x3f')](_0x420a1a[_0x5918('0x3c')],{'$or':_[_0x5918('0x2b')](_0x420a1a['attributes'],function(_0x2a45d7){var _0x209951={};_0x209951[_0x2a45d7]={'$like':'%'+_0x510429[_0x5918('0x32')]['filter']+'%'};return _0x209951;})});}_0x420a1a=_[_0x5918('0x3f')]({},_0x420a1a,_0x510429[_0x5918('0x40')]);return _0x545534[_0x5918('0x4c')](_0x420a1a);}})['then'](function(_0x21ea4e){if(_0x21ea4e){_0x50b5ca=_0x21ea4e[_0x5918('0x38')];if(!_0x510429[_0x5918('0x32')][_0x5918('0x4d')](_0x5918('0x39'))){_0x420a1a[_0x5918('0x1e')]=qs[_0x5918('0x1e')](_0x510429[_0x5918('0x32')]['limit']);_0x420a1a['offset']=qs[_0x5918('0x1c')](_0x510429[_0x5918('0x32')][_0x5918('0x1c')]);}return _0x545534['getSubjects'](_0x420a1a);}})[_0x5918('0x25')](function(_0xa9b44){if(_0xa9b44){return _0xa9b44?{'count':_0x50b5ca,'rows':_0xa9b44}:null;}})[_0x5918('0x25')](respondWithResult(_0x2582e0,null))[_0x5918('0x44')](handleError(_0x2582e0,null));};exports[_0x5918('0x4e')]=function(_0x344aae,_0x9ee9b4,_0x58a125){var _0x34af5e={};var _0x438b77={};var _0x48b4d1;var _0x56c674;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x344aae[_0x5918('0x46')]['id']}})['then'](handleEntityNotFound(_0x9ee9b4,null))['then'](function(_0x30a8d7){if(_0x30a8d7){_0x48b4d1=_0x30a8d7;_0x438b77[_0x5918('0x31')]=_[_0x5918('0x33')](db[_0x5918('0x4b')][_0x5918('0x2d')]);_0x438b77[_0x5918('0x32')]=_['keys'](_0x344aae[_0x5918('0x32')]);_0x438b77[_0x5918('0x34')]=_['intersection'](_0x438b77['model'],_0x438b77[_0x5918('0x32')]);_0x34af5e[_0x5918('0x37')]=_['intersection'](_0x438b77['model'],qs[_0x5918('0x36')](_0x344aae['query'][_0x5918('0x36')]));_0x34af5e[_0x5918('0x37')]=_0x34af5e[_0x5918('0x37')][_0x5918('0x38')]?_0x34af5e[_0x5918('0x37')]:_0x438b77[_0x5918('0x31')];_0x34af5e[_0x5918('0x3a')]=qs['sort'](_0x344aae['query'][_0x5918('0x3b')]);_0x34af5e[_0x5918('0x3c')]=qs[_0x5918('0x34')](_[_0x5918('0x3d')](_0x344aae[_0x5918('0x32')],_0x438b77['filters']));if(_0x344aae[_0x5918('0x32')][_0x5918('0x3e')]){_0x34af5e[_0x5918('0x3c')]=_[_0x5918('0x3f')](_0x34af5e['where'],{'$or':_[_0x5918('0x2b')](_0x34af5e['attributes'],function(_0x58a99f){var _0x1ca120={};_0x1ca120[_0x58a99f]={'$like':'%'+_0x344aae[_0x5918('0x32')][_0x5918('0x3e')]+'%'};return _0x1ca120;})});}_0x34af5e=_[_0x5918('0x3f')]({},_0x34af5e,_0x344aae[_0x5918('0x40')]);return _0x48b4d1[_0x5918('0x4e')](_0x34af5e);}})[_0x5918('0x25')](function(_0x163c59){if(_0x163c59){_0x56c674=_0x163c59[_0x5918('0x38')];if(!_0x344aae[_0x5918('0x32')][_0x5918('0x4d')](_0x5918('0x39'))){_0x34af5e[_0x5918('0x1e')]=qs[_0x5918('0x1e')](_0x344aae[_0x5918('0x32')][_0x5918('0x1e')]);_0x34af5e[_0x5918('0x1c')]=qs[_0x5918('0x1c')](_0x344aae[_0x5918('0x32')][_0x5918('0x1c')]);}return _0x48b4d1[_0x5918('0x4e')](_0x34af5e);}})['then'](function(_0x16d6d2){if(_0x16d6d2){return _0x16d6d2?{'count':_0x56c674,'rows':_0x16d6d2}:null;}})['then'](respondWithResult(_0x9ee9b4,null))[_0x5918('0x44')](handleError(_0x9ee9b4,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9419942..108c082 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 _0x6fa0=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6fa0,0xc6));var _0x06fa=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6fa0[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x06fa('0x0'));var util=require(_0x06fa('0x1'));var logger=require(_0x06fa('0x2'))(_0x06fa('0x3'));var moment=require('moment');var BPromise=require(_0x06fa('0x4'));var rp=require(_0x06fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06fa('0x6'));var config=require(_0x06fa('0x7'));var attributes=require(_0x06fa('0x8'));module[_0x06fa('0x9')]=function(_0x27e052,_0x306d6e){return _0x27e052[_0x06fa('0xa')](_0x06fa('0xb'),attributes,{'tableName':_0x06fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a44=['ZohoConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports'];(function(_0x5f4595,_0x354649){var _0x491113=function(_0x3321b3){while(--_0x3321b3){_0x5f4595['push'](_0x5f4595['shift']());}};_0x491113(++_0x354649);}(_0x7a44,0x1da));var _0x47a4=function(_0x12ef7d,_0x4effe5){_0x12ef7d=_0x12ef7d-0x0;var _0x1b0a01=_0x7a44[_0x12ef7d];return _0x1b0a01;};'use strict';var _=require(_0x47a4('0x0'));var util=require('util');var logger=require(_0x47a4('0x1'))(_0x47a4('0x2'));var moment=require(_0x47a4('0x3'));var BPromise=require(_0x47a4('0x4'));var rp=require(_0x47a4('0x5'));var fs=require('fs');var path=require(_0x47a4('0x6'));var rimraf=require(_0x47a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x47a4('0x8'));module[_0x47a4('0x9')]=function(_0x211c12,_0x4a150f){return _0x211c12['define'](_0x47a4('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index a111503..247fe8f 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 _0x54da=['ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x185d2a,_0x308609){var _0x4dea27=function(_0x513443){while(--_0x513443){_0x185d2a['push'](_0x185d2a['shift']());}};_0x4dea27(++_0x308609);}(_0x54da,0x8d));var _0xa54d=function(_0x42f895,_0x68919f){_0x42f895=_0x42f895-0x0;var _0x57b8f5=_0x54da[_0x42f895];return _0x57b8f5;};'use strict';var _=require('lodash');var util=require(_0xa54d('0x0'));var moment=require(_0xa54d('0x1'));var BPromise=require('bluebird');var rs=require(_0xa54d('0x2'));var fs=require('fs');var Redis=require(_0xa54d('0x3'));var db=require(_0xa54d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa54d('0x5'))(_0xa54d('0x6'));var config=require(_0xa54d('0x7'));var jayson=require(_0xa54d('0x8'));var client=jayson[_0xa54d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354d26,_0x4ca619,_0x3e756a){return new BPromise(function(_0x131861,_0x43c5b5){return client[_0xa54d('0xa')](_0x354d26,_0x3e756a)[_0xa54d('0xb')](function(_0x3afe05){logger[_0xa54d('0xc')](_0xa54d('0xd'),_0x4ca619,'request\x20sent');logger[_0xa54d('0xe')](_0xa54d('0xf'),_0x4ca619,_0xa54d('0x10'),JSON[_0xa54d('0x11')](_0x3afe05));if(_0x3afe05[_0xa54d('0x12')]){if(_0x3afe05['error'][_0xa54d('0x13')]===0x1f4){logger['error'](_0xa54d('0xd'),_0x4ca619,_0x3afe05[_0xa54d('0x12')][_0xa54d('0x14')]);return _0x43c5b5(_0x3afe05[_0xa54d('0x12')]['message']);}logger[_0xa54d('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x4ca619,_0x3afe05[_0xa54d('0x12')][_0xa54d('0x14')]);return _0x131861(_0x3afe05[_0xa54d('0x12')][_0xa54d('0x14')]);}else{logger[_0xa54d('0xc')](_0xa54d('0xd'),_0x4ca619,_0xa54d('0x10'));_0x131861(_0x3afe05['result'][_0xa54d('0x14')]);}})[_0xa54d('0x15')](function(_0x11f535){logger[_0xa54d('0x12')](_0xa54d('0xd'),_0x4ca619,_0x11f535);_0x43c5b5(_0x11f535);});});} \ No newline at end of file +var _0xa7cc=['error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0xa7cc,0x144));var _0xca7c=function(_0x3f3c04,_0x25c16b){_0x3f3c04=_0x3f3c04-0x0;var _0x4e3d93=_0xa7cc[_0x3f3c04];return _0x4e3d93;};'use strict';var _=require('lodash');var util=require(_0xca7c('0x0'));var moment=require('moment');var BPromise=require(_0xca7c('0x1'));var rs=require(_0xca7c('0x2'));var fs=require('fs');var Redis=require(_0xca7c('0x3'));var db=require(_0xca7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xca7c('0x5'))('rpc');var config=require(_0xca7c('0x6'));var jayson=require(_0xca7c('0x7'));var client=jayson[_0xca7c('0x8')][_0xca7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x475d84,_0x22599b,_0x5c6329){return new BPromise(function(_0x3bf79b,_0x4a6506){return client['request'](_0x475d84,_0x5c6329)[_0xca7c('0xa')](function(_0x45b83a){logger[_0xca7c('0xb')](_0xca7c('0xc'),_0x22599b,_0xca7c('0xd'));logger[_0xca7c('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x22599b,'request\x20sent',JSON[_0xca7c('0xf')](_0x45b83a));if(_0x45b83a[_0xca7c('0x10')]){if(_0x45b83a[_0xca7c('0x10')][_0xca7c('0x11')]===0x1f4){logger[_0xca7c('0x10')](_0xca7c('0xc'),_0x22599b,_0x45b83a[_0xca7c('0x10')][_0xca7c('0x12')]);return _0x4a6506(_0x45b83a['error'][_0xca7c('0x12')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x22599b,_0x45b83a[_0xca7c('0x10')]['message']);return _0x3bf79b(_0x45b83a[_0xca7c('0x10')][_0xca7c('0x12')]);}else{logger[_0xca7c('0xb')](_0xca7c('0xc'),_0x22599b,_0xca7c('0xd'));_0x3bf79b(_0x45b83a['result']['message']);}})[_0xca7c('0x13')](function(_0x477250){logger[_0xca7c('0x10')](_0xca7c('0xc'),_0x22599b,_0x477250);_0x4a6506(_0x477250);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 5be8c08..44fd50d 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 _0x963f=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x963f,0x143));var _0xf963=function(_0x403c94,_0x3eb720){_0x403c94=_0x403c94-0x0;var _0x6976f0=_0x963f[_0x403c94];return _0x6976f0;};'use strict';var multer=require(_0xf963('0x0'));var util=require(_0xf963('0x1'));var path=require(_0xf963('0x2'));var timeout=require(_0xf963('0x3'));var express=require('express');var router=express[_0xf963('0x4')]();var fs_extra=require(_0xf963('0x5'));var auth=require(_0xf963('0x6'));var interaction=require(_0xf963('0x7'));var config=require(_0xf963('0x8'));var controller=require(_0xf963('0x9'));router[_0xf963('0xa')]('/',auth[_0xf963('0xb')](),controller['index']);router['get']('/:id',auth[_0xf963('0xb')](),controller[_0xf963('0xc')]);router[_0xf963('0xd')]('/',auth['isAuthenticated'](),controller[_0xf963('0xe')]);router[_0xf963('0xf')](_0xf963('0x10'),auth[_0xf963('0xb')](),controller[_0xf963('0x11')]);router[_0xf963('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf963('0x13')]);module[_0xf963('0x14')]=router; \ No newline at end of file +var _0x5c83=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','delete','/:id','destroy'];(function(_0x16dcf0,_0x558421){var _0x3eabdd=function(_0x180900){while(--_0x180900){_0x16dcf0['push'](_0x16dcf0['shift']());}};_0x3eabdd(++_0x558421);}(_0x5c83,0x77));var _0x35c8=function(_0x287528,_0x2fbba7){_0x287528=_0x287528-0x0;var _0xc05e28=_0x5c83[_0x287528];return _0xc05e28;};'use strict';var multer=require(_0x35c8('0x0'));var util=require(_0x35c8('0x1'));var path=require(_0x35c8('0x2'));var timeout=require(_0x35c8('0x3'));var express=require('express');var router=express[_0x35c8('0x4')]();var fs_extra=require(_0x35c8('0x5'));var auth=require(_0x35c8('0x6'));var interaction=require(_0x35c8('0x7'));var config=require(_0x35c8('0x8'));var controller=require('./intZohoField.controller');router[_0x35c8('0x9')]('/',auth['isAuthenticated'](),controller[_0x35c8('0xa')]);router[_0x35c8('0x9')]('/:id',auth[_0x35c8('0xb')](),controller['show']);router[_0x35c8('0xc')]('/',auth[_0x35c8('0xb')](),controller[_0x35c8('0xd')]);router['put']('/:id',auth[_0x35c8('0xb')](),controller['update']);router[_0x35c8('0xe')](_0x35c8('0xf'),auth[_0x35c8('0xb')](),controller[_0x35c8('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 14dde67..c9c85ba 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 _0xdedf=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3d9094,_0x2a4ff2){var _0x268109=function(_0x5d0c9d){while(--_0x5d0c9d){_0x3d9094['push'](_0x3d9094['shift']());}};_0x268109(++_0x2a4ff2);}(_0xdedf,0x66));var _0xfded=function(_0x4dfddf,_0x236b4c){_0x4dfddf=_0x4dfddf-0x0;var _0x3d9cbf=_0xdedf[_0x4dfddf];return _0x3d9cbf;};'use strict';var Sequelize=require(_0xfded('0x0'));module[_0xfded('0x1')]={'type':{'type':Sequelize[_0xfded('0x2')](_0xfded('0x3'),_0xfded('0x4'),_0xfded('0x5'),_0xfded('0x6'),_0xfded('0x7')),'defaultValue':_0xfded('0x3')},'content':{'type':Sequelize[_0xfded('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xfded('0x3'),'variable',_0xfded('0x5'))},'keyContent':{'type':Sequelize[_0xfded('0x8')]},'idField':{'type':Sequelize[_0xfded('0x8')]},'nameField':{'type':Sequelize[_0xfded('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfded('0x8')]}}; \ No newline at end of file +var _0x53a0=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string'];(function(_0x5e535b,_0x4f2d80){var _0x428022=function(_0x46f40a){while(--_0x46f40a){_0x5e535b['push'](_0x5e535b['shift']());}};_0x428022(++_0x4f2d80);}(_0x53a0,0x141));var _0x053a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x53a0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x053a('0x0'));module[_0x053a('0x1')]={'type':{'type':Sequelize[_0x053a('0x2')]('string',_0x053a('0x3'),_0x053a('0x4'),_0x053a('0x5'),_0x053a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x053a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x053a('0x8'),'variable',_0x053a('0x4'))},'keyContent':{'type':Sequelize[_0x053a('0x7')]},'idField':{'type':Sequelize[_0x053a('0x7')]},'nameField':{'type':Sequelize[_0x053a('0x7')]},'customField':{'type':Sequelize[_0x053a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x053a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 4fad999..b365aa7 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 _0x3dd7=['rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','pick','filters','merge','filter','options','include','findAll'];(function(_0x510da3,_0x53cc10){var _0x496097=function(_0x74dd67){while(--_0x74dd67){_0x510da3['push'](_0x510da3['shift']());}};_0x496097(++_0x53cc10);}(_0x3dd7,0xe9));var _0x73dd=function(_0x2a8fe6,_0x50b968){_0x2a8fe6=_0x2a8fe6-0x0;var _0x4a5456=_0x3dd7[_0x2a8fe6];return _0x4a5456;};'use strict';var emlformat=require(_0x73dd('0x0'));var rimraf=require(_0x73dd('0x1'));var zipdir=require(_0x73dd('0x2'));var jsonpatch=require(_0x73dd('0x3'));var rp=require('request-promise');var moment=require(_0x73dd('0x4'));var BPromise=require(_0x73dd('0x5'));var Mustache=require(_0x73dd('0x6'));var util=require('util');var path=require(_0x73dd('0x7'));var sox=require(_0x73dd('0x8'));var csv=require(_0x73dd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73dd('0xa'));var _=require(_0x73dd('0xb'));var squel=require(_0x73dd('0xc'));var crypto=require(_0x73dd('0xd'));var jsforce=require(_0x73dd('0xe'));var deskjs=require(_0x73dd('0xf'));var toCsv=require(_0x73dd('0x9'));var querystring=require(_0x73dd('0x10'));var Papa=require(_0x73dd('0x11'));var Redis=require(_0x73dd('0x12'));var authService=require(_0x73dd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x73dd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73dd('0x15'))('api');var utils=require(_0x73dd('0x16'));var config=require(_0x73dd('0x17'));var licenseUtil=require(_0x73dd('0x18'));var db=require(_0x73dd('0x19'))['db'];function respondWithStatusCode(_0x2e93bb,_0x17560e){_0x17560e=_0x17560e||0xcc;return function(_0x44035f){if(_0x44035f){return _0x2e93bb[_0x73dd('0x1a')](_0x17560e);}return _0x2e93bb['status'](_0x17560e)['end']();};}function respondWithResult(_0x4efb47,_0x648e0b){_0x648e0b=_0x648e0b||0xc8;return function(_0x59c8f1){if(_0x59c8f1){return _0x4efb47[_0x73dd('0x1b')](_0x648e0b)[_0x73dd('0x1c')](_0x59c8f1);}};}function respondWithFilteredResult(_0x3c3ced,_0x57e806){return function(_0x457401){if(_0x457401){var _0x2748c8=typeof _0x57e806[_0x73dd('0x1d')]===_0x73dd('0x1e')&&typeof _0x57e806[_0x73dd('0x1f')]===_0x73dd('0x1e');var _0x2be9be=_0x457401[_0x73dd('0x20')];var _0x3e3105=_0x2748c8?0x0:_0x57e806[_0x73dd('0x1d')];var _0x277c89=_0x2748c8?_0x457401['count']:_0x57e806['offset']+_0x57e806[_0x73dd('0x1f')];var _0x561b8c;if(_0x277c89>=_0x2be9be){_0x277c89=_0x2be9be;_0x561b8c=0xc8;}else{_0x561b8c=0xce;}_0x3c3ced[_0x73dd('0x1b')](_0x561b8c);return _0x3c3ced['set'](_0x73dd('0x21'),_0x3e3105+'-'+_0x277c89+'/'+_0x2be9be)[_0x73dd('0x1c')](_0x457401);}return null;};}function patchUpdates(_0x472886){return function(_0x14853b){try{jsonpatch[_0x73dd('0x22')](_0x14853b,_0x472886,!![]);}catch(_0x19140a){return BPromise[_0x73dd('0x23')](_0x19140a);}return _0x14853b[_0x73dd('0x24')]();};}function saveUpdates(_0x2cddd7,_0x27f30d){return function(_0x29e69c){if(_0x29e69c){return _0x29e69c[_0x73dd('0x25')](_0x2cddd7)[_0x73dd('0x26')](function(_0x4af3ec){return _0x4af3ec;});}return null;};}function removeEntity(_0x14dbce,_0x1657ca){return function(_0x45c075){if(_0x45c075){return _0x45c075[_0x73dd('0x27')]()[_0x73dd('0x26')](function(){_0x14dbce[_0x73dd('0x1b')](0xcc)[_0x73dd('0x28')]();});}};}function handleEntityNotFound(_0x2b2823,_0x4e3cf7){return function(_0x41cbe3){if(!_0x41cbe3){_0x2b2823[_0x73dd('0x1a')](0x194);}return _0x41cbe3;};}function handleError(_0x4239b8,_0x191058){_0x191058=_0x191058||0x1f4;return function(_0x348254){logger[_0x73dd('0x29')](_0x348254[_0x73dd('0x2a')]);if(_0x348254['name']){delete _0x348254[_0x73dd('0x2b')];}_0x4239b8[_0x73dd('0x1b')](_0x191058)[_0x73dd('0x2c')](_0x348254);};}exports[_0x73dd('0x2d')]=function(_0x1f6688,_0x49001a){var _0xd4f16a={},_0x34a7fb={},_0x47b0c3={'count':0x0,'rows':[]};var _0x59fc4a=_[_0x73dd('0x2e')](db[_0x73dd('0x2f')][_0x73dd('0x30')],function(_0x40101a){return{'name':_0x40101a['fieldName'],'type':_0x40101a[_0x73dd('0x31')][_0x73dd('0x32')]};});_0x34a7fb[_0x73dd('0x33')]=_['map'](_0x59fc4a,_0x73dd('0x2b'));_0x34a7fb['query']=_[_0x73dd('0x34')](_0x1f6688[_0x73dd('0x35')]);_0x34a7fb['filters']=_[_0x73dd('0x36')](_0x34a7fb[_0x73dd('0x33')],_0x34a7fb[_0x73dd('0x35')]);_0xd4f16a[_0x73dd('0x37')]=_[_0x73dd('0x36')](_0x34a7fb['model'],qs['fields'](_0x1f6688[_0x73dd('0x35')][_0x73dd('0x38')]));_0xd4f16a['attributes']=_0xd4f16a[_0x73dd('0x37')]['length']?_0xd4f16a[_0x73dd('0x37')]:_0x34a7fb[_0x73dd('0x33')];if(!_0x1f6688[_0x73dd('0x35')]['hasOwnProperty'](_0x73dd('0x39'))){_0xd4f16a['limit']=qs[_0x73dd('0x1f')](_0x1f6688['query'][_0x73dd('0x1f')]);_0xd4f16a[_0x73dd('0x1d')]=qs[_0x73dd('0x1d')](_0x1f6688[_0x73dd('0x35')]['offset']);}_0xd4f16a['order']=qs[_0x73dd('0x3a')](_0x1f6688['query'][_0x73dd('0x3a')]);_0xd4f16a[_0x73dd('0x3b')]=qs['filters'](_[_0x73dd('0x3c')](_0x1f6688[_0x73dd('0x35')],_0x34a7fb[_0x73dd('0x3d')]),_0x59fc4a);if(_0x1f6688[_0x73dd('0x35')]['filter']){_0xd4f16a[_0x73dd('0x3b')]=_[_0x73dd('0x3e')](_0xd4f16a[_0x73dd('0x3b')],{'$or':_[_0x73dd('0x2e')](_0x59fc4a,function(_0xb8dfe4){if(_0xb8dfe4[_0x73dd('0x31')]!=='VIRTUAL'){var _0x48ec1e={};_0x48ec1e[_0xb8dfe4[_0x73dd('0x2b')]]={'$like':'%'+_0x1f6688[_0x73dd('0x35')][_0x73dd('0x3f')]+'%'};return _0x48ec1e;}})});}_0xd4f16a=_['merge']({},_0xd4f16a,_0x1f6688[_0x73dd('0x40')]);var _0x3520b0={'where':_0xd4f16a[_0x73dd('0x3b')]};return db[_0x73dd('0x2f')][_0x73dd('0x20')](_0x3520b0)[_0x73dd('0x26')](function(_0x181a16){_0x47b0c3[_0x73dd('0x20')]=_0x181a16;if(_0x1f6688['query']['includeAll']){_0xd4f16a[_0x73dd('0x41')]=[{'all':!![]}];}return db['ZohoField'][_0x73dd('0x42')](_0xd4f16a);})[_0x73dd('0x26')](function(_0x5c630c){_0x47b0c3[_0x73dd('0x43')]=_0x5c630c;return _0x47b0c3;})['then'](respondWithFilteredResult(_0x49001a,_0xd4f16a))[_0x73dd('0x44')](handleError(_0x49001a,null));};exports[_0x73dd('0x45')]=function(_0xa6aa75,_0x4346ec){var _0xaf5b87={'raw':!![],'where':{'id':_0xa6aa75[_0x73dd('0x46')]['id']}},_0x3f6da6={};_0x3f6da6[_0x73dd('0x33')]=_[_0x73dd('0x34')](db['ZohoField'][_0x73dd('0x30')]);_0x3f6da6[_0x73dd('0x35')]=_[_0x73dd('0x34')](_0xa6aa75[_0x73dd('0x35')]);_0x3f6da6[_0x73dd('0x3d')]=_['intersection'](_0x3f6da6[_0x73dd('0x33')],_0x3f6da6[_0x73dd('0x35')]);_0xaf5b87[_0x73dd('0x37')]=_['intersection'](_0x3f6da6[_0x73dd('0x33')],qs[_0x73dd('0x38')](_0xa6aa75['query'][_0x73dd('0x38')]));_0xaf5b87[_0x73dd('0x37')]=_0xaf5b87[_0x73dd('0x37')][_0x73dd('0x47')]?_0xaf5b87['attributes']:_0x3f6da6[_0x73dd('0x33')];if(_0xa6aa75[_0x73dd('0x35')]['includeAll']){_0xaf5b87['include']=[{'all':!![]}];}_0xaf5b87=_['merge']({},_0xaf5b87,_0xa6aa75[_0x73dd('0x40')]);return db['ZohoField'][_0x73dd('0x48')](_0xaf5b87)[_0x73dd('0x26')](handleEntityNotFound(_0x4346ec,null))[_0x73dd('0x26')](respondWithResult(_0x4346ec,null))[_0x73dd('0x44')](handleError(_0x4346ec,null));};exports[_0x73dd('0x49')]=function(_0x4dec7f,_0x1b2807){return db['ZohoField'][_0x73dd('0x49')](_0x4dec7f['body'],{})[_0x73dd('0x26')](respondWithResult(_0x1b2807,0xc9))[_0x73dd('0x44')](handleError(_0x1b2807,null));};exports[_0x73dd('0x25')]=function(_0xd92cb1,_0xbd4ac5){if(_0xd92cb1[_0x73dd('0x4a')]['id']){delete _0xd92cb1['body']['id'];}return db[_0x73dd('0x2f')]['find']({'where':{'id':_0xd92cb1[_0x73dd('0x46')]['id']}})[_0x73dd('0x26')](handleEntityNotFound(_0xbd4ac5,null))[_0x73dd('0x26')](saveUpdates(_0xd92cb1[_0x73dd('0x4a')],null))['then'](respondWithResult(_0xbd4ac5,null))[_0x73dd('0x44')](handleError(_0xbd4ac5,null));};exports['destroy']=function(_0x5e1ee5,_0x562763){return db['ZohoField'][_0x73dd('0x48')]({'where':{'id':_0x5e1ee5[_0x73dd('0x46')]['id']}})[_0x73dd('0x26')](handleEntityNotFound(_0x562763,null))['then'](removeEntity(_0x562763,null))['catch'](handleError(_0x562763,null));}; \ No newline at end of file +var _0x5dab=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x39b07a,_0x4a6867){var _0x234f61=function(_0x44ac50){while(--_0x44ac50){_0x39b07a['push'](_0x39b07a['shift']());}};_0x234f61(++_0x4a6867);}(_0x5dab,0x89));var _0xb5da=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x5dab[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require(_0xb5da('0x0'));var rimraf=require(_0xb5da('0x1'));var zipdir=require(_0xb5da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb5da('0x3'));var moment=require(_0xb5da('0x4'));var BPromise=require(_0xb5da('0x5'));var Mustache=require(_0xb5da('0x6'));var util=require(_0xb5da('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb5da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5da('0x9'));var _=require(_0xb5da('0xa'));var squel=require(_0xb5da('0xb'));var crypto=require(_0xb5da('0xc'));var jsforce=require(_0xb5da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb5da('0x8'));var querystring=require(_0xb5da('0xe'));var Papa=require(_0xb5da('0xf'));var Redis=require('ioredis');var authService=require(_0xb5da('0x10'));var qs=require(_0xb5da('0x11'));var as=require(_0xb5da('0x12'));var hardwareService=require(_0xb5da('0x13'));var logger=require(_0xb5da('0x14'))(_0xb5da('0x15'));var utils=require(_0xb5da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb5da('0x17'));var db=require(_0xb5da('0x18'))['db'];function respondWithStatusCode(_0x24a66f,_0x194914){_0x194914=_0x194914||0xcc;return function(_0x251de8){if(_0x251de8){return _0x24a66f['sendStatus'](_0x194914);}return _0x24a66f[_0xb5da('0x19')](_0x194914)[_0xb5da('0x1a')]();};}function respondWithResult(_0x2d780e,_0x46ffac){_0x46ffac=_0x46ffac||0xc8;return function(_0x1f69a5){if(_0x1f69a5){return _0x2d780e[_0xb5da('0x19')](_0x46ffac)[_0xb5da('0x1b')](_0x1f69a5);}};}function respondWithFilteredResult(_0x44630f,_0x17fefb){return function(_0x2c6371){if(_0x2c6371){var _0x1d179e=typeof _0x17fefb[_0xb5da('0x1c')]===_0xb5da('0x1d')&&typeof _0x17fefb[_0xb5da('0x1e')]==='undefined';var _0x456714=_0x2c6371[_0xb5da('0x1f')];var _0xa20665=_0x1d179e?0x0:_0x17fefb[_0xb5da('0x1c')];var _0xfdb313=_0x1d179e?_0x2c6371['count']:_0x17fefb[_0xb5da('0x1c')]+_0x17fefb[_0xb5da('0x1e')];var _0x89fa2a;if(_0xfdb313>=_0x456714){_0xfdb313=_0x456714;_0x89fa2a=0xc8;}else{_0x89fa2a=0xce;}_0x44630f[_0xb5da('0x19')](_0x89fa2a);return _0x44630f[_0xb5da('0x20')](_0xb5da('0x21'),_0xa20665+'-'+_0xfdb313+'/'+_0x456714)[_0xb5da('0x1b')](_0x2c6371);}return null;};}function patchUpdates(_0xedcd4b){return function(_0x2a75d4){try{jsonpatch['apply'](_0x2a75d4,_0xedcd4b,!![]);}catch(_0x105e9c){return BPromise[_0xb5da('0x22')](_0x105e9c);}return _0x2a75d4[_0xb5da('0x23')]();};}function saveUpdates(_0x4fcd0d,_0x2f5e8e){return function(_0x389d1b){if(_0x389d1b){return _0x389d1b[_0xb5da('0x24')](_0x4fcd0d)[_0xb5da('0x25')](function(_0x21ef06){return _0x21ef06;});}return null;};}function removeEntity(_0x14381b,_0x2fc767){return function(_0x580696){if(_0x580696){return _0x580696[_0xb5da('0x26')]()[_0xb5da('0x25')](function(){_0x14381b['status'](0xcc)[_0xb5da('0x1a')]();});}};}function handleEntityNotFound(_0x34f92e,_0x467d2d){return function(_0x20ff38){if(!_0x20ff38){_0x34f92e[_0xb5da('0x27')](0x194);}return _0x20ff38;};}function handleError(_0x40822f,_0x2fec60){_0x2fec60=_0x2fec60||0x1f4;return function(_0x29a24a){logger['error'](_0x29a24a[_0xb5da('0x28')]);if(_0x29a24a[_0xb5da('0x29')]){delete _0x29a24a[_0xb5da('0x29')];}_0x40822f[_0xb5da('0x19')](_0x2fec60)[_0xb5da('0x2a')](_0x29a24a);};}exports[_0xb5da('0x2b')]=function(_0xa7c506,_0x3c40f3){var _0x5784e9={},_0x495297={},_0x119cc3={'count':0x0,'rows':[]};var _0x2d3d21=_[_0xb5da('0x2c')](db[_0xb5da('0x2d')][_0xb5da('0x2e')],function(_0xdca459){return{'name':_0xdca459[_0xb5da('0x2f')],'type':_0xdca459[_0xb5da('0x30')]['key']};});_0x495297[_0xb5da('0x31')]=_[_0xb5da('0x2c')](_0x2d3d21,'name');_0x495297['query']=_[_0xb5da('0x32')](_0xa7c506[_0xb5da('0x33')]);_0x495297['filters']=_['intersection'](_0x495297[_0xb5da('0x31')],_0x495297[_0xb5da('0x33')]);_0x5784e9[_0xb5da('0x34')]=_[_0xb5da('0x35')](_0x495297[_0xb5da('0x31')],qs['fields'](_0xa7c506[_0xb5da('0x33')][_0xb5da('0x36')]));_0x5784e9[_0xb5da('0x34')]=_0x5784e9[_0xb5da('0x34')][_0xb5da('0x37')]?_0x5784e9[_0xb5da('0x34')]:_0x495297['model'];if(!_0xa7c506[_0xb5da('0x33')][_0xb5da('0x38')](_0xb5da('0x39'))){_0x5784e9['limit']=qs['limit'](_0xa7c506[_0xb5da('0x33')][_0xb5da('0x1e')]);_0x5784e9[_0xb5da('0x1c')]=qs[_0xb5da('0x1c')](_0xa7c506['query'][_0xb5da('0x1c')]);}_0x5784e9[_0xb5da('0x3a')]=qs[_0xb5da('0x3b')](_0xa7c506['query']['sort']);_0x5784e9[_0xb5da('0x3c')]=qs['filters'](_[_0xb5da('0x3d')](_0xa7c506['query'],_0x495297[_0xb5da('0x3e')]),_0x2d3d21);if(_0xa7c506['query']['filter']){_0x5784e9[_0xb5da('0x3c')]=_[_0xb5da('0x3f')](_0x5784e9[_0xb5da('0x3c')],{'$or':_[_0xb5da('0x2c')](_0x2d3d21,function(_0x5802d7){if(_0x5802d7[_0xb5da('0x30')]!=='VIRTUAL'){var _0x46d294={};_0x46d294[_0x5802d7[_0xb5da('0x29')]]={'$like':'%'+_0xa7c506[_0xb5da('0x33')]['filter']+'%'};return _0x46d294;}})});}_0x5784e9=_[_0xb5da('0x3f')]({},_0x5784e9,_0xa7c506[_0xb5da('0x40')]);var _0x327554={'where':_0x5784e9[_0xb5da('0x3c')]};return db[_0xb5da('0x2d')][_0xb5da('0x1f')](_0x327554)[_0xb5da('0x25')](function(_0xb75b1f){_0x119cc3[_0xb5da('0x1f')]=_0xb75b1f;if(_0xa7c506[_0xb5da('0x33')]['includeAll']){_0x5784e9[_0xb5da('0x41')]=[{'all':!![]}];}return db[_0xb5da('0x2d')][_0xb5da('0x42')](_0x5784e9);})[_0xb5da('0x25')](function(_0x13de0e){_0x119cc3[_0xb5da('0x43')]=_0x13de0e;return _0x119cc3;})['then'](respondWithFilteredResult(_0x3c40f3,_0x5784e9))['catch'](handleError(_0x3c40f3,null));};exports[_0xb5da('0x44')]=function(_0x32013c,_0x5c4c61){var _0x37c443={'raw':!![],'where':{'id':_0x32013c[_0xb5da('0x45')]['id']}},_0x5259f0={};_0x5259f0['model']=_['keys'](db['ZohoField'][_0xb5da('0x2e')]);_0x5259f0[_0xb5da('0x33')]=_[_0xb5da('0x32')](_0x32013c['query']);_0x5259f0[_0xb5da('0x3e')]=_['intersection'](_0x5259f0[_0xb5da('0x31')],_0x5259f0[_0xb5da('0x33')]);_0x37c443[_0xb5da('0x34')]=_['intersection'](_0x5259f0['model'],qs[_0xb5da('0x36')](_0x32013c[_0xb5da('0x33')][_0xb5da('0x36')]));_0x37c443[_0xb5da('0x34')]=_0x37c443['attributes'][_0xb5da('0x37')]?_0x37c443[_0xb5da('0x34')]:_0x5259f0[_0xb5da('0x31')];if(_0x32013c['query'][_0xb5da('0x46')]){_0x37c443[_0xb5da('0x41')]=[{'all':!![]}];}_0x37c443=_[_0xb5da('0x3f')]({},_0x37c443,_0x32013c[_0xb5da('0x40')]);return db[_0xb5da('0x2d')][_0xb5da('0x47')](_0x37c443)[_0xb5da('0x25')](handleEntityNotFound(_0x5c4c61,null))[_0xb5da('0x25')](respondWithResult(_0x5c4c61,null))[_0xb5da('0x48')](handleError(_0x5c4c61,null));};exports[_0xb5da('0x49')]=function(_0x3493bc,_0x373a3e){return db[_0xb5da('0x2d')]['create'](_0x3493bc[_0xb5da('0x4a')],{})[_0xb5da('0x25')](respondWithResult(_0x373a3e,0xc9))[_0xb5da('0x48')](handleError(_0x373a3e,null));};exports[_0xb5da('0x24')]=function(_0x11935a,_0x5526ce){if(_0x11935a[_0xb5da('0x4a')]['id']){delete _0x11935a[_0xb5da('0x4a')]['id'];}return db[_0xb5da('0x2d')][_0xb5da('0x47')]({'where':{'id':_0x11935a[_0xb5da('0x45')]['id']}})[_0xb5da('0x25')](handleEntityNotFound(_0x5526ce,null))[_0xb5da('0x25')](saveUpdates(_0x11935a['body'],null))[_0xb5da('0x25')](respondWithResult(_0x5526ce,null))[_0xb5da('0x48')](handleError(_0x5526ce,null));};exports[_0xb5da('0x26')]=function(_0x2244e4,_0x2150db){return db[_0xb5da('0x2d')]['find']({'where':{'id':_0x2244e4['params']['id']}})[_0xb5da('0x25')](handleEntityNotFound(_0x2150db,null))['then'](removeEntity(_0x2150db,null))['catch'](handleError(_0x2150db,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index ff43479..5ae558b 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x4819,0xcd));var _0x9481=function(_0x3e3c73,_0x2c8583){_0x3e3c73=_0x3e3c73-0x0;var _0x5d4cb4=_0x4819[_0x3e3c73];return _0x5d4cb4;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xd'),_0x9481('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger'];(function(_0xf3142a,_0x3b655b){var _0x3267d9=function(_0x42e329){while(--_0x42e329){_0xf3142a['push'](_0xf3142a['shift']());}};_0x3267d9(++_0x3b655b);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('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 cbc5c94..7947570 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 _0x4366=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0x4366,0x9b));var _0x6436=function(_0x3012cd,_0x219858){_0x3012cd=_0x3012cd-0x0;var _0x54bf69=_0x4366[_0x3012cd];return _0x54bf69;};'use strict';var _=require(_0x6436('0x0'));var util=require(_0x6436('0x1'));var moment=require(_0x6436('0x2'));var BPromise=require(_0x6436('0x3'));var rs=require(_0x6436('0x4'));var fs=require('fs');var Redis=require(_0x6436('0x5'));var db=require(_0x6436('0x6'))['db'];var utils=require(_0x6436('0x7'));var logger=require(_0x6436('0x8'))(_0x6436('0x9'));var config=require('../../config/environment');var jayson=require(_0x6436('0xa'));var client=jayson['client'][_0x6436('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b3b3a,_0x2dc8a8,_0x256c01){return new BPromise(function(_0x4a06f7,_0x4e5afd){return client[_0x6436('0xc')](_0x4b3b3a,_0x256c01)['then'](function(_0x4bdd9a){logger[_0x6436('0xd')](_0x6436('0xe'),_0x2dc8a8,_0x6436('0xf'));logger['debug'](_0x6436('0x10'),_0x2dc8a8,_0x6436('0xf'),JSON[_0x6436('0x11')](_0x4bdd9a));if(_0x4bdd9a[_0x6436('0x12')]){if(_0x4bdd9a[_0x6436('0x12')][_0x6436('0x13')]===0x1f4){logger[_0x6436('0x12')](_0x6436('0xe'),_0x2dc8a8,_0x4bdd9a['error'][_0x6436('0x14')]);return _0x4e5afd(_0x4bdd9a[_0x6436('0x12')][_0x6436('0x14')]);}logger[_0x6436('0x12')]('ZohoField,\x20%s,\x20%s',_0x2dc8a8,_0x4bdd9a[_0x6436('0x12')][_0x6436('0x14')]);return _0x4a06f7(_0x4bdd9a['error'][_0x6436('0x14')]);}else{logger[_0x6436('0xd')](_0x6436('0xe'),_0x2dc8a8,_0x6436('0xf'));_0x4a06f7(_0x4bdd9a[_0x6436('0x15')]['message']);}})[_0x6436('0x16')](function(_0x4be315){logger[_0x6436('0x12')](_0x6436('0xe'),_0x2dc8a8,_0x4be315);_0x4e5afd(_0x4be315);});});} \ No newline at end of file +var _0x9da4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x9da4,0x8e));var _0x49da=function(_0x4c7e97,_0x439bd2){_0x4c7e97=_0x4c7e97-0x0;var _0x3a6cc6=_0x9da4[_0x4c7e97];return _0x3a6cc6;};'use strict';var _=require(_0x49da('0x0'));var util=require(_0x49da('0x1'));var moment=require(_0x49da('0x2'));var BPromise=require(_0x49da('0x3'));var rs=require(_0x49da('0x4'));var fs=require('fs');var Redis=require(_0x49da('0x5'));var db=require(_0x49da('0x6'))['db'];var utils=require(_0x49da('0x7'));var logger=require('../../config/logger')(_0x49da('0x8'));var config=require(_0x49da('0x9'));var jayson=require(_0x49da('0xa'));var client=jayson[_0x49da('0xb')][_0x49da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x176169,_0x1b1954,_0x205277){return new BPromise(function(_0x213b83,_0x21254b){return client['request'](_0x176169,_0x205277)[_0x49da('0xd')](function(_0x58fddb){logger[_0x49da('0xe')](_0x49da('0xf'),_0x1b1954,_0x49da('0x10'));logger['debug'](_0x49da('0x11'),_0x1b1954,_0x49da('0x10'),JSON[_0x49da('0x12')](_0x58fddb));if(_0x58fddb[_0x49da('0x13')]){if(_0x58fddb['error'][_0x49da('0x14')]===0x1f4){logger[_0x49da('0x13')](_0x49da('0xf'),_0x1b1954,_0x58fddb[_0x49da('0x13')]['message']);return _0x21254b(_0x58fddb['error'][_0x49da('0x15')]);}logger[_0x49da('0x13')]('ZohoField,\x20%s,\x20%s',_0x1b1954,_0x58fddb['error'][_0x49da('0x15')]);return _0x213b83(_0x58fddb[_0x49da('0x13')][_0x49da('0x15')]);}else{logger[_0x49da('0xe')](_0x49da('0xf'),_0x1b1954,_0x49da('0x10'));_0x213b83(_0x58fddb[_0x49da('0x16')][_0x49da('0x15')]);}})[_0x49da('0x17')](function(_0x202acb){logger['error'](_0x49da('0xf'),_0x1b1954,_0x202acb);_0x21254b(_0x202acb);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b80fe1b..98adead 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x401221,_0x29484f){var _0x4270d0=function(_0x542e4a){while(--_0x542e4a){_0x401221['push'](_0x401221['shift']());}};_0x4270d0(++_0x29484f);}(_0x70e0,0x17b));var _0x070e=function(_0x4cf47e,_0x4b656d){_0x4cf47e=_0x4cf47e-0x0;var _0x2c657b=_0x70e0[_0x4cf47e];return _0x2c657b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xc12b74,_0x2e7560){var _0x5a62c7=function(_0x4570b8){while(--_0x4570b8){_0xc12b74['push'](_0xc12b74['shift']());}};_0x5a62c7(++_0x2e7560);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xcb91[_0x462fe4];return _0x82b23a;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 517b458..d7f95ef 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 _0x5b41=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x2962c4,_0x1405de){var _0xbd7faa=function(_0x4544bf){while(--_0x4544bf){_0x2962c4['push'](_0x2962c4['shift']());}};_0xbd7faa(++_0x1405de);}(_0x5b41,0xf5));var _0x15b4=function(_0x12220e,_0x521f86){_0x12220e=_0x12220e-0x0;var _0x50aa0c=_0x5b41[_0x12220e];return _0x50aa0c;};'use strict';var Sequelize=require(_0x15b4('0x0'));module[_0x15b4('0x1')]={'name':{'type':Sequelize[_0x15b4('0x2')],'allowNull':![],'unique':_0x15b4('0x3')},'version':{'type':Sequelize[_0x15b4('0x2')],'allowNull':![],'unique':_0x15b4('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x15b4('0x4')},'filename':{'type':Sequelize[_0x15b4('0x2')]},'path':{'type':Sequelize[_0x15b4('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x15b4('0x5')]},'active':{'type':Sequelize[_0x15b4('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x15b4('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x15b4('0x2')],'unique':_0x15b4('0x7')},'description':{'type':Sequelize[_0x15b4('0x2')]},'title':{'type':Sequelize[_0x15b4('0x2')]},'remoteUri':{'type':Sequelize[_0x15b4('0x2')]},'link':{'type':Sequelize[_0x15b4('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe4f6=['STRING','app.js','INTEGER','sequelize','exports','unique_name_and_version'];(function(_0x13e79f,_0x16aea1){var _0x23b3d4=function(_0x2ff90f){while(--_0x2ff90f){_0x13e79f['push'](_0x13e79f['shift']());}};_0x23b3d4(++_0x16aea1);}(_0xe4f6,0x195));var _0x6e4f=function(_0x13175b,_0x531cea){_0x13175b=_0x13175b-0x0;var _0x5d99a0=_0xe4f6[_0x13175b];return _0x5d99a0;};'use strict';var Sequelize=require(_0x6e4f('0x0'));module[_0x6e4f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6e4f('0x2')},'version':{'type':Sequelize[_0x6e4f('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x6e4f('0x3')],'defaultValue':_0x6e4f('0x4')},'filename':{'type':Sequelize[_0x6e4f('0x3')]},'path':{'type':Sequelize[_0x6e4f('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x6e4f('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x6e4f('0x3')]},'logo':{'type':Sequelize[_0x6e4f('0x3')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x6e4f('0x3')]},'title':{'type':Sequelize[_0x6e4f('0x3')]},'remoteUri':{'type':Sequelize[_0x6e4f('0x3')]},'link':{'type':Sequelize[_0x6e4f('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ed5be85..24361ed 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(_0x537ef7,_0x1bd866){var _0x603c2e=function(_0x5a1cfa){while(--_0x5a1cfa){_0x537ef7['push'](_0x537ef7['shift']());}};_0x603c2e(++_0x1bd866);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'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 _0xfdbd=['findAll','rows','show','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x300c51,_0xc90599){var _0x10955e=function(_0x113dbc){while(--_0x113dbc){_0x300c51['push'](_0x300c51['shift']());}};_0x10955e(++_0xc90599);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x400b6c,_0x4a6139){_0x400b6c=_0x400b6c-0x0;var _0x4c4e3e=_0xfdbd[_0x400b6c];return _0x4c4e3e;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['Integration'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['Integration']['create'](_0x1c08fb[_0xdfdb('0x4b')],{})[_0xdfdb('0x26')](respondWithResult(_0x273477,0xc9))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports['update']=function(_0x36149e,_0x4d4c90){if(_0x36149e[_0xdfdb('0x4b')]['id']){delete _0x36149e[_0xdfdb('0x4b')]['id'];}return db['Integration'][_0xdfdb('0x48')]({'where':{'id':_0x36149e[_0xdfdb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d4c90,null))[_0xdfdb('0x26')](saveUpdates(_0x36149e[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x4d4c90,null))[_0xdfdb('0x49')](handleError(_0x4d4c90,null));};exports[_0xdfdb('0x25')]=function(_0x10b490,_0x17dfdb){return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'id':_0x10b490['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x17dfdb,null))['then'](removeEntity(_0x17dfdb,null))[_0xdfdb('0x49')](handleError(_0x17dfdb,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 6160cac..fad7285 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 _0xbede=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash'];(function(_0x20f361,_0x313cfc){var _0x11c4e1=function(_0x510f22){while(--_0x510f22){_0x20f361['push'](_0x20f361['shift']());}};_0x11c4e1(++_0x313cfc);}(_0xbede,0x1b1));var _0xebed=function(_0x217889,_0x3eef1a){_0x217889=_0x217889-0x0;var _0x33077b=_0xbede[_0x217889];return _0x33077b;};'use strict';var _=require(_0xebed('0x0'));var util=require(_0xebed('0x1'));var logger=require(_0xebed('0x2'))(_0xebed('0x3'));var moment=require(_0xebed('0x4'));var BPromise=require(_0xebed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xebed('0x6'));var rimraf=require(_0xebed('0x7'));var config=require(_0xebed('0x8'));var attributes=require(_0xebed('0x9'));module[_0xebed('0xa')]=function(_0x571354,_0x5648fb){return _0x571354[_0xebed('0xb')](_0xebed('0xc'),attributes,{'tableName':_0xebed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28c6=['integrations','../../config/logger','api','moment','request-promise','rimraf','./integration.attributes','exports','Integration'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x28c6,0x172));var _0x628c=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x28c6[_0x291d3f];return _0x242080;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x628c('0x0'))(_0x628c('0x1'));var moment=require(_0x628c('0x2'));var BPromise=require('bluebird');var rp=require(_0x628c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x628c('0x4'));var config=require('../../config/environment');var attributes=require(_0x628c('0x5'));module[_0x628c('0x6')]=function(_0x1e3b80,_0x39577d){return _0x1e3b80['define'](_0x628c('0x7'),attributes,{'tableName':_0x628c('0x8'),'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 3266aba..c9ad8f4 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 _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x4f2b71,_0x4073fc){var _0x4b5186=function(_0x46c771){while(--_0x46c771){_0x4f2b71['push'](_0x4f2b71['shift']());}};_0x4b5186(++_0x4073fc);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x1a830d,_0x233793){_0x1a830d=_0x1a830d-0x0;var _0x25ba29=_0x7a54[_0x1a830d];return _0x25ba29;};'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')]('Integration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f87917f..2ac9814 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 _0x1967=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x1967,0x173));var _0x7196=function(_0x54037e,_0x14efaf){_0x54037e=_0x54037e-0x0;var _0x104c0b=_0x1967[_0x54037e];return _0x104c0b;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')]('/',auth[_0x7196('0xa')](),controller['create']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x12')]);router[_0x7196('0x13')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x14')]);module[_0x7196('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(_0x156720,_0x1f8239){var _0x4e15a3=function(_0x20034a){while(--_0x20034a){_0x156720['push'](_0x156720['shift']());}};_0x4e15a3(++_0x1f8239);}(_0x4975,0x86));var _0x5497=function(_0x3f0af0,_0x29fc05){_0x3f0af0=_0x3f0af0-0x0;var _0x6eec12=_0x4975[_0x3f0af0];return _0x6eec12;};'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 78d77d1..dfb17cb 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 _0x8f07=['SENDING','RECEIVED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x147f22,_0x3fb477){var _0x480aec=function(_0x42c78d){while(--_0x42c78d){_0x147f22['push'](_0x147f22['shift']());}};_0x480aec(++_0x3fb477);}(_0x8f07,0x161));var _0x78f0=function(_0x2fe4a3,_0x23c051){_0x2fe4a3=_0x2fe4a3-0x0;var _0x4164be=_0x8f07[_0x2fe4a3];return _0x4164be;};'use strict';var Sequelize=require('sequelize');module[_0x78f0('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x78f0('0x1')]},'exitStatus':{'type':Sequelize[_0x78f0('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x78f0('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x78f0('0x1')]},'calleridnum':{'type':Sequelize[_0x78f0('0x1')]},'calleridname':{'type':Sequelize[_0x78f0('0x1')]},'queue':{'type':Sequelize[_0x78f0('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x78f0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x78f0('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x78f0('0x2')]},'agentcomplete':{'type':Sequelize[_0x78f0('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x78f0('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x78f0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x78f0('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x78f0('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x78f0('0x1')]},'channel':{'type':Sequelize[_0x78f0('0x1')]},'channelstate':{'type':Sequelize[_0x78f0('0x2')]},'channelstatedesc':{'type':Sequelize[_0x78f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0x78f0('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x78f0('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x78f0('0x1')]},'destchannelstate':{'type':Sequelize[_0x78f0('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x78f0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x78f0('0x1')]},'destcalleridname':{'type':Sequelize[_0x78f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x78f0('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x78f0('0x1')]},'destaccountcode':{'type':Sequelize[_0x78f0('0x1')]},'destcontext':{'type':Sequelize[_0x78f0('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x78f0('0x1')]},'messageId':{'type':Sequelize[_0x78f0('0x1')]},'inReplyTo':{'type':Sequelize[_0x78f0('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x78f0('0x1')]},'to':{'type':Sequelize[_0x78f0('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x78f0('0x5')]},'html':{'type':Sequelize[_0x78f0('0x5')]},'text':{'type':Sequelize[_0x78f0('0x5')]},'status':{'type':Sequelize['ENUM'](_0x78f0('0x6'),_0x78f0('0x7'),_0x78f0('0x8'),'FAILED')},'url':{'type':Sequelize[_0x78f0('0x1')]},'app':{'type':Sequelize[_0x78f0('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x78f0('0x2')]}}; \ No newline at end of file +var _0xa8e2=['BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','exports','STRING','DATE','INTEGER'];(function(_0xb6337a,_0xee8954){var _0xff7cf1=function(_0x479f2f){while(--_0x479f2f){_0xb6337a['push'](_0xb6337a['shift']());}};_0xff7cf1(++_0xee8954);}(_0xa8e2,0xa6));var _0x2a8e=function(_0x3dca22,_0x37f15c){_0x3dca22=_0x3dca22-0x0;var _0x261e8e=_0xa8e2[_0x3dca22];return _0x261e8e;};'use strict';var Sequelize=require('sequelize');module[_0x2a8e('0x0')]={'integration':{'type':Sequelize[_0x2a8e('0x1')]},'eventChannel':{'type':Sequelize[_0x2a8e('0x1')]},'exitStatus':{'type':Sequelize[_0x2a8e('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x2a8e('0x1')]},'uniqueid':{'type':Sequelize[_0x2a8e('0x1')]},'calleridnum':{'type':Sequelize[_0x2a8e('0x1')]},'calleridname':{'type':Sequelize[_0x2a8e('0x1')]},'queue':{'type':Sequelize[_0x2a8e('0x1')]},'interface':{'type':Sequelize[_0x2a8e('0x1')]},'membername':{'type':Sequelize[_0x2a8e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x2a8e('0x2')]},'agentconnectAt':{'type':Sequelize[_0x2a8e('0x2')]},'holdtime':{'type':Sequelize[_0x2a8e('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x2a8e('0x3')]},'agentacw':{'type':Sequelize[_0x2a8e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2a8e('0x3')]},'reason':{'type':Sequelize[_0x2a8e('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2a8e('0x2')]},'agentdump':{'type':Sequelize[_0x2a8e('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x2a8e('0x1')]},'channel':{'type':Sequelize[_0x2a8e('0x1')]},'channelstate':{'type':Sequelize[_0x2a8e('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2a8e('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2a8e('0x1')]},'connectedlinename':{'type':Sequelize[_0x2a8e('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x2a8e('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2a8e('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x2a8e('0x1')]},'destchannelstate':{'type':Sequelize[_0x2a8e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2a8e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2a8e('0x1')]},'destcalleridname':{'type':Sequelize[_0x2a8e('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x2a8e('0x1')]},'destlanguage':{'type':Sequelize[_0x2a8e('0x1')]},'destaccountcode':{'type':Sequelize[_0x2a8e('0x1')]},'destcontext':{'type':Sequelize[_0x2a8e('0x1')]},'destexten':{'type':Sequelize[_0x2a8e('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x2a8e('0x1')]},'messageId':{'type':Sequelize[_0x2a8e('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x2a8e('0x1')]},'cc':{'type':Sequelize[_0x2a8e('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x2a8e('0x5')]},'text':{'type':Sequelize[_0x2a8e('0x5')]},'status':{'type':Sequelize[_0x2a8e('0x6')](_0x2a8e('0x7'),_0x2a8e('0x8'),'RECEIVED',_0x2a8e('0x9'))},'url':{'type':Sequelize[_0x2a8e('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x2a8e('0x1')]},'projectId':{'type':Sequelize[_0x2a8e('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b8703ce..5ae44f8 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 _0x442e=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','keys','includeAll','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model'];(function(_0x336adb,_0x1c3608){var _0x5be7f5=function(_0x8cb90b){while(--_0x8cb90b){_0x336adb['push'](_0x336adb['shift']());}};_0x5be7f5(++_0x1c3608);}(_0x442e,0x1e9));var _0xe442=function(_0x902ef9,_0x4ac534){_0x902ef9=_0x902ef9-0x0;var _0x4c508d=_0x442e[_0x902ef9];return _0x4c508d;};'use strict';var emlformat=require(_0xe442('0x0'));var rimraf=require(_0xe442('0x1'));var zipdir=require(_0xe442('0x2'));var jsonpatch=require(_0xe442('0x3'));var rp=require(_0xe442('0x4'));var moment=require('moment');var BPromise=require(_0xe442('0x5'));var Mustache=require(_0xe442('0x6'));var util=require(_0xe442('0x7'));var path=require(_0xe442('0x8'));var sox=require(_0xe442('0x9'));var csv=require(_0xe442('0xa'));var ejs=require(_0xe442('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe442('0xc'));var squel=require(_0xe442('0xd'));var crypto=require(_0xe442('0xe'));var jsforce=require(_0xe442('0xf'));var deskjs=require(_0xe442('0x10'));var toCsv=require(_0xe442('0xa'));var querystring=require(_0xe442('0x11'));var Papa=require(_0xe442('0x12'));var Redis=require('ioredis');var authService=require(_0xe442('0x13'));var qs=require(_0xe442('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe442('0x15'));var logger=require(_0xe442('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe442('0x17'));var licenseUtil=require(_0xe442('0x18'));var db=require(_0xe442('0x19'))['db'];function respondWithStatusCode(_0x207ac0,_0xe1346f){_0xe1346f=_0xe1346f||0xcc;return function(_0x15b8b7){if(_0x15b8b7){return _0x207ac0['sendStatus'](_0xe1346f);}return _0x207ac0['status'](_0xe1346f)[_0xe442('0x1a')]();};}function respondWithResult(_0x39b390,_0x339f3a){_0x339f3a=_0x339f3a||0xc8;return function(_0x4cebe9){if(_0x4cebe9){return _0x39b390[_0xe442('0x1b')](_0x339f3a)[_0xe442('0x1c')](_0x4cebe9);}};}function respondWithFilteredResult(_0x4088b9,_0x3a6e69){return function(_0x4e23c6){if(_0x4e23c6){var _0x178878=typeof _0x3a6e69['offset']===_0xe442('0x1d')&&typeof _0x3a6e69[_0xe442('0x1e')]===_0xe442('0x1d');var _0x42ee23=_0x4e23c6[_0xe442('0x1f')];var _0x359b3a=_0x178878?0x0:_0x3a6e69[_0xe442('0x20')];var _0x2d892e=_0x178878?_0x4e23c6[_0xe442('0x1f')]:_0x3a6e69['offset']+_0x3a6e69['limit'];var _0x548ed6;if(_0x2d892e>=_0x42ee23){_0x2d892e=_0x42ee23;_0x548ed6=0xc8;}else{_0x548ed6=0xce;}_0x4088b9[_0xe442('0x1b')](_0x548ed6);return _0x4088b9[_0xe442('0x21')](_0xe442('0x22'),_0x359b3a+'-'+_0x2d892e+'/'+_0x42ee23)[_0xe442('0x1c')](_0x4e23c6);}return null;};}function patchUpdates(_0x19e969){return function(_0x3934e9){try{jsonpatch[_0xe442('0x23')](_0x3934e9,_0x19e969,!![]);}catch(_0x1942d1){return BPromise['reject'](_0x1942d1);}return _0x3934e9[_0xe442('0x24')]();};}function saveUpdates(_0x1d1440,_0x38ce9b){return function(_0x46b016){if(_0x46b016){return _0x46b016[_0xe442('0x25')](_0x1d1440)[_0xe442('0x26')](function(_0x1f0dfe){return _0x1f0dfe;});}return null;};}function removeEntity(_0x8824b6,_0x486e4e){return function(_0x497eb2){if(_0x497eb2){return _0x497eb2['destroy']()[_0xe442('0x26')](function(){_0x8824b6[_0xe442('0x1b')](0xcc)[_0xe442('0x1a')]();});}};}function handleEntityNotFound(_0x1a1303,_0x4c3f4a){return function(_0x51e085){if(!_0x51e085){_0x1a1303['sendStatus'](0x194);}return _0x51e085;};}function handleError(_0xb91c9e,_0x3db98e){_0x3db98e=_0x3db98e||0x1f4;return function(_0x2678bf){logger[_0xe442('0x27')](_0x2678bf[_0xe442('0x28')]);if(_0x2678bf[_0xe442('0x29')]){delete _0x2678bf[_0xe442('0x29')];}_0xb91c9e[_0xe442('0x1b')](_0x3db98e)[_0xe442('0x2a')](_0x2678bf);};}exports['index']=function(_0xb23389,_0x42ab99){var _0x2774d8={},_0x3ad07f={},_0x8d3b48={'count':0x0,'rows':[]};var _0x325719=_[_0xe442('0x2b')](db[_0xe442('0x2c')][_0xe442('0x2d')],function(_0x306632){return{'name':_0x306632[_0xe442('0x2e')],'type':_0x306632[_0xe442('0x2f')][_0xe442('0x30')]};});_0x3ad07f[_0xe442('0x31')]=_['map'](_0x325719,_0xe442('0x29'));_0x3ad07f[_0xe442('0x32')]=_['keys'](_0xb23389[_0xe442('0x32')]);_0x3ad07f[_0xe442('0x33')]=_['intersection'](_0x3ad07f[_0xe442('0x31')],_0x3ad07f[_0xe442('0x32')]);_0x2774d8['attributes']=_[_0xe442('0x34')](_0x3ad07f[_0xe442('0x31')],qs[_0xe442('0x35')](_0xb23389[_0xe442('0x32')][_0xe442('0x35')]));_0x2774d8['attributes']=_0x2774d8[_0xe442('0x36')][_0xe442('0x37')]?_0x2774d8[_0xe442('0x36')]:_0x3ad07f[_0xe442('0x31')];if(!_0xb23389['query'][_0xe442('0x38')](_0xe442('0x39'))){_0x2774d8['limit']=qs[_0xe442('0x1e')](_0xb23389[_0xe442('0x32')]['limit']);_0x2774d8[_0xe442('0x20')]=qs[_0xe442('0x20')](_0xb23389[_0xe442('0x32')][_0xe442('0x20')]);}_0x2774d8[_0xe442('0x3a')]=qs[_0xe442('0x3b')](_0xb23389[_0xe442('0x32')][_0xe442('0x3b')]);_0x2774d8[_0xe442('0x3c')]=qs[_0xe442('0x33')](_[_0xe442('0x3d')](_0xb23389['query'],_0x3ad07f[_0xe442('0x33')]),_0x325719);if(_0xb23389['query']['filter']){_0x2774d8[_0xe442('0x3c')]=_['merge'](_0x2774d8[_0xe442('0x3c')],{'$or':_[_0xe442('0x2b')](_0x325719,function(_0x39fc8f){if(_0x39fc8f[_0xe442('0x2f')]!=='VIRTUAL'){var _0x2e7172={};_0x2e7172[_0x39fc8f[_0xe442('0x29')]]={'$like':'%'+_0xb23389['query'][_0xe442('0x3e')]+'%'};return _0x2e7172;}})});}_0x2774d8=_[_0xe442('0x3f')]({},_0x2774d8,_0xb23389[_0xe442('0x40')]);var _0x74ef02={'where':_0x2774d8[_0xe442('0x3c')]};return db[_0xe442('0x2c')][_0xe442('0x1f')](_0x74ef02)[_0xe442('0x26')](function(_0x5570b8){_0x8d3b48[_0xe442('0x1f')]=_0x5570b8;if(_0xb23389[_0xe442('0x32')]['includeAll']){_0x2774d8[_0xe442('0x41')]=[{'all':!![]}];}return db[_0xe442('0x2c')][_0xe442('0x42')](_0x2774d8);})[_0xe442('0x26')](function(_0xa67a53){_0x8d3b48[_0xe442('0x43')]=_0xa67a53;return _0x8d3b48;})[_0xe442('0x26')](respondWithFilteredResult(_0x42ab99,_0x2774d8))['catch'](handleError(_0x42ab99,null));};exports['show']=function(_0x58436c,_0x126ba8){var _0x3aefd4={'raw':![],'where':{'id':_0x58436c[_0xe442('0x44')]['id']}},_0x79fb02={};_0x79fb02[_0xe442('0x31')]=_['keys'](db[_0xe442('0x2c')][_0xe442('0x2d')]);_0x79fb02[_0xe442('0x32')]=_[_0xe442('0x45')](_0x58436c[_0xe442('0x32')]);_0x79fb02[_0xe442('0x33')]=_[_0xe442('0x34')](_0x79fb02[_0xe442('0x31')],_0x79fb02['query']);_0x3aefd4['attributes']=_['intersection'](_0x79fb02['model'],qs[_0xe442('0x35')](_0x58436c[_0xe442('0x32')][_0xe442('0x35')]));_0x3aefd4[_0xe442('0x36')]=_0x3aefd4[_0xe442('0x36')][_0xe442('0x37')]?_0x3aefd4[_0xe442('0x36')]:_0x79fb02['model'];if(_0x58436c[_0xe442('0x32')][_0xe442('0x46')]){_0x3aefd4['include']=[{'all':!![]}];}_0x3aefd4=_['merge']({},_0x3aefd4,_0x58436c[_0xe442('0x40')]);return db[_0xe442('0x2c')][_0xe442('0x47')](_0x3aefd4)[_0xe442('0x26')](handleEntityNotFound(_0x126ba8,null))[_0xe442('0x26')](respondWithResult(_0x126ba8,null))['catch'](handleError(_0x126ba8,null));};exports[_0xe442('0x48')]=function(_0xfeee1f,_0x46e0d5){return db[_0xe442('0x2c')][_0xe442('0x48')](_0xfeee1f[_0xe442('0x49')],{})[_0xe442('0x26')](respondWithResult(_0x46e0d5,0xc9))[_0xe442('0x4a')](handleError(_0x46e0d5,null));};exports[_0xe442('0x25')]=function(_0x5dc457,_0x2432ed){if(_0x5dc457[_0xe442('0x49')]['id']){delete _0x5dc457[_0xe442('0x49')]['id'];}return db[_0xe442('0x2c')]['find']({'where':{'id':_0x5dc457['params']['id']}})[_0xe442('0x26')](handleEntityNotFound(_0x2432ed,null))[_0xe442('0x26')](saveUpdates(_0x5dc457[_0xe442('0x49')],null))[_0xe442('0x26')](respondWithResult(_0x2432ed,null))[_0xe442('0x4a')](handleError(_0x2432ed,null));};exports[_0xe442('0x4b')]=function(_0x1bd278,_0x2c5664){return db['IntegrationReport'][_0xe442('0x47')]({'where':{'id':_0x1bd278['params']['id']}})['then'](handleEntityNotFound(_0x2c5664,null))[_0xe442('0x26')](removeEntity(_0x2c5664,null))[_0xe442('0x4a')](handleError(_0x2c5664,null));};exports['describe']=function(_0x5f5217,_0x284a14){return db[_0xe442('0x2c')][_0xe442('0x4c')]()[_0xe442('0x26')](respondWithResult(_0x284a14,null))['catch'](handleError(_0x284a14,null));}; \ No newline at end of file +var _0x123b=['map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','length','find','create','body','params','describe','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index'];(function(_0x3170f5,_0x573495){var _0x3cfefd=function(_0xdcb000){while(--_0xdcb000){_0x3170f5['push'](_0x3170f5['shift']());}};_0x3cfefd(++_0x573495);}(_0x123b,0xfd));var _0xb123=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x123b[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb123('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb123('0x1'));var moment=require(_0xb123('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb123('0x3'));var util=require(_0xb123('0x4'));var path=require(_0xb123('0x5'));var sox=require('sox');var csv=require(_0xb123('0x6'));var ejs=require(_0xb123('0x7'));var fs=require('fs');var fs_extra=require(_0xb123('0x8'));var _=require(_0xb123('0x9'));var squel=require('squel');var crypto=require(_0xb123('0xa'));var jsforce=require(_0xb123('0xb'));var deskjs=require(_0xb123('0xc'));var toCsv=require(_0xb123('0x6'));var querystring=require('querystring');var Papa=require(_0xb123('0xd'));var Redis=require(_0xb123('0xe'));var authService=require(_0xb123('0xf'));var qs=require(_0xb123('0x10'));var as=require(_0xb123('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb123('0x12'))(_0xb123('0x13'));var utils=require('../../config/utils');var config=require(_0xb123('0x14'));var licenseUtil=require(_0xb123('0x15'));var db=require(_0xb123('0x16'))['db'];function respondWithStatusCode(_0x326ef1,_0x25334b){_0x25334b=_0x25334b||0xcc;return function(_0x50aa80){if(_0x50aa80){return _0x326ef1['sendStatus'](_0x25334b);}return _0x326ef1[_0xb123('0x17')](_0x25334b)[_0xb123('0x18')]();};}function respondWithResult(_0x58fd48,_0x4e561d){_0x4e561d=_0x4e561d||0xc8;return function(_0x5ea90f){if(_0x5ea90f){return _0x58fd48[_0xb123('0x17')](_0x4e561d)['json'](_0x5ea90f);}};}function respondWithFilteredResult(_0x5a4707,_0x2d770b){return function(_0x1eb67c){if(_0x1eb67c){var _0x4d2112=typeof _0x2d770b['offset']===_0xb123('0x19')&&typeof _0x2d770b['limit']==='undefined';var _0xe9ca1e=_0x1eb67c[_0xb123('0x1a')];var _0x20e704=_0x4d2112?0x0:_0x2d770b[_0xb123('0x1b')];var _0x342696=_0x4d2112?_0x1eb67c['count']:_0x2d770b['offset']+_0x2d770b[_0xb123('0x1c')];var _0x5edda9;if(_0x342696>=_0xe9ca1e){_0x342696=_0xe9ca1e;_0x5edda9=0xc8;}else{_0x5edda9=0xce;}_0x5a4707[_0xb123('0x17')](_0x5edda9);return _0x5a4707[_0xb123('0x1d')](_0xb123('0x1e'),_0x20e704+'-'+_0x342696+'/'+_0xe9ca1e)[_0xb123('0x1f')](_0x1eb67c);}return null;};}function patchUpdates(_0x2739f9){return function(_0x4089b0){try{jsonpatch[_0xb123('0x20')](_0x4089b0,_0x2739f9,!![]);}catch(_0x52b413){return BPromise[_0xb123('0x21')](_0x52b413);}return _0x4089b0[_0xb123('0x22')]();};}function saveUpdates(_0x3cab7e,_0x3dd5f8){return function(_0x477597){if(_0x477597){return _0x477597[_0xb123('0x23')](_0x3cab7e)[_0xb123('0x24')](function(_0x4817f6){return _0x4817f6;});}return null;};}function removeEntity(_0x3319d5,_0x2cd6b6){return function(_0x33f084){if(_0x33f084){return _0x33f084[_0xb123('0x25')]()[_0xb123('0x24')](function(){_0x3319d5[_0xb123('0x17')](0xcc)[_0xb123('0x18')]();});}};}function handleEntityNotFound(_0x558330,_0x2c467f){return function(_0x40ce0f){if(!_0x40ce0f){_0x558330[_0xb123('0x26')](0x194);}return _0x40ce0f;};}function handleError(_0x269bbb,_0x5e009e){_0x5e009e=_0x5e009e||0x1f4;return function(_0x44ad27){logger['error'](_0x44ad27[_0xb123('0x27')]);if(_0x44ad27[_0xb123('0x28')]){delete _0x44ad27[_0xb123('0x28')];}_0x269bbb[_0xb123('0x17')](_0x5e009e)[_0xb123('0x29')](_0x44ad27);};}exports[_0xb123('0x2a')]=function(_0x19c38f,_0x13cd85){var _0x128c4e={},_0x69bbb0={},_0x2ee34e={'count':0x0,'rows':[]};var _0x262c55=_[_0xb123('0x2b')](db[_0xb123('0x2c')][_0xb123('0x2d')],function(_0x14fd64){return{'name':_0x14fd64['fieldName'],'type':_0x14fd64[_0xb123('0x2e')][_0xb123('0x2f')]};});_0x69bbb0[_0xb123('0x30')]=_[_0xb123('0x2b')](_0x262c55,_0xb123('0x28'));_0x69bbb0[_0xb123('0x31')]=_[_0xb123('0x32')](_0x19c38f[_0xb123('0x31')]);_0x69bbb0[_0xb123('0x33')]=_[_0xb123('0x34')](_0x69bbb0['model'],_0x69bbb0[_0xb123('0x31')]);_0x128c4e[_0xb123('0x35')]=_['intersection'](_0x69bbb0[_0xb123('0x30')],qs[_0xb123('0x36')](_0x19c38f['query'][_0xb123('0x36')]));_0x128c4e[_0xb123('0x35')]=_0x128c4e[_0xb123('0x35')]['length']?_0x128c4e[_0xb123('0x35')]:_0x69bbb0['model'];if(!_0x19c38f[_0xb123('0x31')][_0xb123('0x37')](_0xb123('0x38'))){_0x128c4e[_0xb123('0x1c')]=qs['limit'](_0x19c38f['query'][_0xb123('0x1c')]);_0x128c4e[_0xb123('0x1b')]=qs[_0xb123('0x1b')](_0x19c38f[_0xb123('0x31')][_0xb123('0x1b')]);}_0x128c4e[_0xb123('0x39')]=qs[_0xb123('0x3a')](_0x19c38f[_0xb123('0x31')]['sort']);_0x128c4e[_0xb123('0x3b')]=qs[_0xb123('0x33')](_[_0xb123('0x3c')](_0x19c38f[_0xb123('0x31')],_0x69bbb0['filters']),_0x262c55);if(_0x19c38f[_0xb123('0x31')][_0xb123('0x3d')]){_0x128c4e[_0xb123('0x3b')]=_[_0xb123('0x3e')](_0x128c4e[_0xb123('0x3b')],{'$or':_[_0xb123('0x2b')](_0x262c55,function(_0x3f1d37){if(_0x3f1d37[_0xb123('0x2e')]!==_0xb123('0x3f')){var _0x317bac={};_0x317bac[_0x3f1d37[_0xb123('0x28')]]={'$like':'%'+_0x19c38f[_0xb123('0x31')]['filter']+'%'};return _0x317bac;}})});}_0x128c4e=_[_0xb123('0x3e')]({},_0x128c4e,_0x19c38f['options']);var _0x57a727={'where':_0x128c4e['where']};return db['IntegrationReport'][_0xb123('0x1a')](_0x57a727)['then'](function(_0xde2bfa){_0x2ee34e[_0xb123('0x1a')]=_0xde2bfa;if(_0x19c38f['query'][_0xb123('0x40')]){_0x128c4e[_0xb123('0x41')]=[{'all':!![]}];}return db[_0xb123('0x2c')][_0xb123('0x42')](_0x128c4e);})[_0xb123('0x24')](function(_0x1c53eb){_0x2ee34e['rows']=_0x1c53eb;return _0x2ee34e;})[_0xb123('0x24')](respondWithFilteredResult(_0x13cd85,_0x128c4e))[_0xb123('0x43')](handleError(_0x13cd85,null));};exports['show']=function(_0x41420d,_0x493da8){var _0xd92ee2={'raw':![],'where':{'id':_0x41420d['params']['id']}},_0x4a0857={};_0x4a0857[_0xb123('0x30')]=_[_0xb123('0x32')](db[_0xb123('0x2c')][_0xb123('0x2d')]);_0x4a0857['query']=_[_0xb123('0x32')](_0x41420d[_0xb123('0x31')]);_0x4a0857[_0xb123('0x33')]=_[_0xb123('0x34')](_0x4a0857['model'],_0x4a0857['query']);_0xd92ee2['attributes']=_[_0xb123('0x34')](_0x4a0857['model'],qs['fields'](_0x41420d['query'][_0xb123('0x36')]));_0xd92ee2[_0xb123('0x35')]=_0xd92ee2[_0xb123('0x35')][_0xb123('0x44')]?_0xd92ee2[_0xb123('0x35')]:_0x4a0857[_0xb123('0x30')];if(_0x41420d[_0xb123('0x31')][_0xb123('0x40')]){_0xd92ee2['include']=[{'all':!![]}];}_0xd92ee2=_['merge']({},_0xd92ee2,_0x41420d['options']);return db['IntegrationReport'][_0xb123('0x45')](_0xd92ee2)[_0xb123('0x24')](handleEntityNotFound(_0x493da8,null))[_0xb123('0x24')](respondWithResult(_0x493da8,null))[_0xb123('0x43')](handleError(_0x493da8,null));};exports[_0xb123('0x46')]=function(_0x4cb083,_0x4af681){return db[_0xb123('0x2c')][_0xb123('0x46')](_0x4cb083['body'],{})[_0xb123('0x24')](respondWithResult(_0x4af681,0xc9))[_0xb123('0x43')](handleError(_0x4af681,null));};exports[_0xb123('0x23')]=function(_0x26b592,_0x29b31b){if(_0x26b592['body']['id']){delete _0x26b592[_0xb123('0x47')]['id'];}return db[_0xb123('0x2c')][_0xb123('0x45')]({'where':{'id':_0x26b592['params']['id']}})[_0xb123('0x24')](handleEntityNotFound(_0x29b31b,null))['then'](saveUpdates(_0x26b592[_0xb123('0x47')],null))[_0xb123('0x24')](respondWithResult(_0x29b31b,null))[_0xb123('0x43')](handleError(_0x29b31b,null));};exports['destroy']=function(_0xcabec,_0x49dc2a){return db[_0xb123('0x2c')][_0xb123('0x45')]({'where':{'id':_0xcabec[_0xb123('0x48')]['id']}})[_0xb123('0x24')](handleEntityNotFound(_0x49dc2a,null))['then'](removeEntity(_0x49dc2a,null))[_0xb123('0x43')](handleError(_0x49dc2a,null));};exports[_0xb123('0x49')]=function(_0x277aa0,_0x2ab6d5){return db[_0xb123('0x2c')][_0xb123('0x49')]()[_0xb123('0x24')](respondWithResult(_0x2ab6d5,null))[_0xb123('0x43')](handleError(_0x2ab6d5,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 1eca050..a5f442d 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 _0x65fe=['moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','define','report_integration','lodash','util','api'];(function(_0x293dc1,_0x2257c1){var _0x305d33=function(_0x545c41){while(--_0x545c41){_0x293dc1['push'](_0x293dc1['shift']());}};_0x305d33(++_0x2257c1);}(_0x65fe,0x194));var _0xe65f=function(_0x1d5a31,_0xce3b8d){_0x1d5a31=_0x1d5a31-0x0;var _0xa4c302=_0x65fe[_0x1d5a31];return _0xa4c302;};'use strict';var _=require(_0xe65f('0x0'));var util=require(_0xe65f('0x1'));var logger=require('../../config/logger')(_0xe65f('0x2'));var moment=require(_0xe65f('0x3'));var BPromise=require(_0xe65f('0x4'));var rp=require(_0xe65f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe65f('0x6'));var config=require(_0xe65f('0x7'));var attributes=require(_0xe65f('0x8'));module['exports']=function(_0x4c20f1,_0x419fee){return _0x4c20f1[_0xe65f('0x9')]('IntegrationReport',attributes,{'tableName':_0xe65f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2a3=['../../config/logger','moment','bluebird','request-promise','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','lodash'];(function(_0x342fa0,_0x4d0b0f){var _0x431401=function(_0x2b384d){while(--_0x2b384d){_0x342fa0['push'](_0x342fa0['shift']());}};_0x431401(++_0x4d0b0f);}(_0xe2a3,0xf9));var _0x3e2a=function(_0x1967b8,_0x2ce618){_0x1967b8=_0x1967b8-0x0;var _0xeacbb7=_0xe2a3[_0x1967b8];return _0xeacbb7;};'use strict';var _=require(_0x3e2a('0x0'));var util=require('util');var logger=require(_0x3e2a('0x1'))('api');var moment=require(_0x3e2a('0x2'));var BPromise=require(_0x3e2a('0x3'));var rp=require(_0x3e2a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e2a('0x5'));var config=require('../../config/environment');var attributes=require(_0x3e2a('0x6'));module[_0x3e2a('0x7')]=function(_0x47debe,_0x40bef2){return _0x47debe[_0x3e2a('0x8')](_0x3e2a('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 9924489..6f1ad3c 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x5eb003,_0x29d81a){var _0x12bab=function(_0x35a53f){while(--_0x35a53f){_0x5eb003['push'](_0x5eb003['shift']());}};_0x12bab(++_0x29d81a);}(_0x187d,0x93));var _0xd187=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x187d[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x209b9e,_0x5377cc){var _0x49f411=function(_0x208133){while(--_0x208133){_0x209b9e['push'](_0x209b9e['shift']());}};_0x49f411(++_0x5377cc);}(_0x326f,0xd1));var _0xf326=function(_0x1f2808,_0x42163c){_0x1f2808=_0x1f2808-0x0;var _0x41a721=_0x326f[_0x1f2808];return _0x41a721;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 1ef5162..3f95040 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 _0x5e6a=['post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x5e6a,0x1e5));var _0xa5e6=function(_0x59117c,_0x29cf2a){_0x59117c=_0x59117c-0x0;var _0x397d95=_0x5e6a[_0x59117c];return _0x397d95;};'use strict';var multer=require(_0xa5e6('0x0'));var util=require('util');var path=require(_0xa5e6('0x1'));var timeout=require(_0xa5e6('0x2'));var express=require(_0xa5e6('0x3'));var router=express[_0xa5e6('0x4')]();var fs_extra=require(_0xa5e6('0x5'));var auth=require(_0xa5e6('0x6'));var interaction=require(_0xa5e6('0x7'));var config=require(_0xa5e6('0x8'));var controller=require(_0xa5e6('0x9'));router[_0xa5e6('0xa')]('/',auth[_0xa5e6('0xb')](),controller['index']);router[_0xa5e6('0xa')]('/:id',auth[_0xa5e6('0xb')](),controller[_0xa5e6('0xc')]);router[_0xa5e6('0xa')](_0xa5e6('0xd'),auth[_0xa5e6('0xb')](),controller[_0xa5e6('0xe')]);router[_0xa5e6('0xf')]('/',auth[_0xa5e6('0xb')](),controller[_0xa5e6('0x10')]);router['post'](_0xa5e6('0xd'),auth['isAuthenticated'](),controller[_0xa5e6('0x11')]);router['post'](_0xa5e6('0x12'),auth[_0xa5e6('0xb')](),controller[_0xa5e6('0x13')]);router[_0xa5e6('0x14')](_0xa5e6('0x15'),auth[_0xa5e6('0xb')](),controller['update']);router[_0xa5e6('0x16')](_0xa5e6('0x15'),auth['isAuthenticated'](),controller[_0xa5e6('0x17')]);module[_0xa5e6('0x18')]=router; \ No newline at end of file +var _0x0763=['put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x439740,_0x2687cd){var _0xb1fc75=function(_0x4e4eeb){while(--_0x4e4eeb){_0x439740['push'](_0x439740['shift']());}};_0xb1fc75(++_0x2687cd);}(_0x0763,0x87));var _0x3076=function(_0x571852,_0x34ae1f){_0x571852=_0x571852-0x0;var _0x1ec365=_0x0763[_0x571852];return _0x1ec365;};'use strict';var multer=require(_0x3076('0x0'));var util=require('util');var path=require(_0x3076('0x1'));var timeout=require(_0x3076('0x2'));var express=require('express');var router=express[_0x3076('0x3')]();var fs_extra=require(_0x3076('0x4'));var auth=require(_0x3076('0x5'));var interaction=require(_0x3076('0x6'));var config=require('../../config/environment');var controller=require(_0x3076('0x7'));router[_0x3076('0x8')]('/',auth[_0x3076('0x9')](),controller[_0x3076('0xa')]);router[_0x3076('0x8')](_0x3076('0xb'),auth[_0x3076('0x9')](),controller[_0x3076('0xc')]);router[_0x3076('0x8')](_0x3076('0xd'),auth['isAuthenticated'](),controller[_0x3076('0xe')]);router[_0x3076('0xf')]('/',auth[_0x3076('0x9')](),controller['create']);router['post'](_0x3076('0xd'),auth[_0x3076('0x9')](),controller[_0x3076('0x10')]);router[_0x3076('0xf')](_0x3076('0x11'),auth['isAuthenticated'](),controller[_0x3076('0x12')]);router[_0x3076('0x13')](_0x3076('0xb'),auth[_0x3076('0x9')](),controller[_0x3076('0x14')]);router[_0x3076('0x15')](_0x3076('0xb'),auth[_0x3076('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 63e5b66..6854ff5 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 _0xf352=['STRING','sequelize'];(function(_0x2b66c4,_0x535de2){var _0x5bca6c=function(_0x5a2466){while(--_0x5a2466){_0x2b66c4['push'](_0x2b66c4['shift']());}};_0x5bca6c(++_0x535de2);}(_0xf352,0x105));var _0x2f35=function(_0x1e3a4e,_0x69339f){_0x1e3a4e=_0x1e3a4e-0x0;var _0x4967b6=_0xf352[_0x1e3a4e];return _0x4967b6;};'use strict';var Sequelize=require(_0x2f35('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2f35('0x1')]},'interval':{'type':Sequelize[_0x2f35('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x1316=['exports','STRING','sequelize'];(function(_0x131fa2,_0x2e48d2){var _0x28a429=function(_0x30439c){while(--_0x30439c){_0x131fa2['push'](_0x131fa2['shift']());}};_0x28a429(++_0x2e48d2);}(_0x1316,0xf8));var _0x6131=function(_0x293ce8,_0x3cb791){_0x293ce8=_0x293ce8-0x0;var _0x3b9341=_0x1316[_0x293ce8];return _0x3b9341;};'use strict';var Sequelize=require(_0x6131('0x0'));module[_0x6131('0x1')]={'name':{'type':Sequelize[_0x6131('0x2')]},'description':{'type':Sequelize[_0x6131('0x2')]},'interval':{'type':Sequelize[_0x6131('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 9f85c32..a84bf0c 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 _0x81ad=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','nolimit','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x14c6df,_0x5b0aec){var _0x1381b2=function(_0x33024e){while(--_0x33024e){_0x14c6df['push'](_0x14c6df['shift']());}};_0x1381b2(++_0x5b0aec);}(_0x81ad,0x164));var _0xd81a=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x81ad[_0x25248b];return _0x509939;};'use strict';var emlformat=require(_0xd81a('0x0'));var rimraf=require(_0xd81a('0x1'));var zipdir=require(_0xd81a('0x2'));var jsonpatch=require(_0xd81a('0x3'));var rp=require('request-promise');var moment=require(_0xd81a('0x4'));var BPromise=require(_0xd81a('0x5'));var Mustache=require(_0xd81a('0x6'));var util=require(_0xd81a('0x7'));var path=require(_0xd81a('0x8'));var sox=require(_0xd81a('0x9'));var csv=require(_0xd81a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd81a('0xb'));var _=require('lodash');var squel=require(_0xd81a('0xc'));var crypto=require(_0xd81a('0xd'));var jsforce=require(_0xd81a('0xe'));var deskjs=require(_0xd81a('0xf'));var toCsv=require(_0xd81a('0xa'));var querystring=require(_0xd81a('0x10'));var Papa=require('papaparse');var Redis=require(_0xd81a('0x11'));var authService=require(_0xd81a('0x12'));var qs=require(_0xd81a('0x13'));var as=require(_0xd81a('0x14'));var hardwareService=require(_0xd81a('0x15'));var logger=require('../../config/logger')(_0xd81a('0x16'));var utils=require(_0xd81a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd81a('0x18'));var db=require(_0xd81a('0x19'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2f0a87,_0x16d6c8){_0x16d6c8=_0x16d6c8||0xcc;return function(_0x2f16f7){if(_0x2f16f7){return _0x2f0a87[_0xd81a('0x1a')](_0x16d6c8);}return _0x2f0a87[_0xd81a('0x1b')](_0x16d6c8)[_0xd81a('0x1c')]();};}function respondWithResult(_0x4a2cc7,_0x5e7a6){_0x5e7a6=_0x5e7a6||0xc8;return function(_0x1f1cc7){if(_0x1f1cc7){return _0x4a2cc7[_0xd81a('0x1b')](_0x5e7a6)[_0xd81a('0x1d')](_0x1f1cc7);}};}function respondWithFilteredResult(_0x3be4ca,_0x3f822a){return function(_0x19e812){if(_0x19e812){var _0x365d14=typeof _0x3f822a[_0xd81a('0x1e')]===_0xd81a('0x1f')&&typeof _0x3f822a[_0xd81a('0x20')]===_0xd81a('0x1f');var _0x3fb169=_0x19e812[_0xd81a('0x21')];var _0x450d73=_0x365d14?0x0:_0x3f822a['offset'];var _0x105380=_0x365d14?_0x19e812['count']:_0x3f822a[_0xd81a('0x1e')]+_0x3f822a[_0xd81a('0x20')];var _0x1709df;if(_0x105380>=_0x3fb169){_0x105380=_0x3fb169;_0x1709df=0xc8;}else{_0x1709df=0xce;}_0x3be4ca[_0xd81a('0x1b')](_0x1709df);return _0x3be4ca[_0xd81a('0x22')](_0xd81a('0x23'),_0x450d73+'-'+_0x105380+'/'+_0x3fb169)[_0xd81a('0x1d')](_0x19e812);}return null;};}function patchUpdates(_0x38c1d6){return function(_0x11c24e){try{jsonpatch[_0xd81a('0x24')](_0x11c24e,_0x38c1d6,!![]);}catch(_0x156db9){return BPromise[_0xd81a('0x25')](_0x156db9);}return _0x11c24e[_0xd81a('0x26')]();};}function saveUpdates(_0x3e840,_0x92d83a){return function(_0x40fbc9){if(_0x40fbc9){return _0x40fbc9[_0xd81a('0x27')](_0x3e840)['then'](function(_0x5d3445){return _0x5d3445;});}return null;};}function removeEntity(_0x11e2d5,_0x4e71e1){return function(_0x4e63af){if(_0x4e63af){return _0x4e63af[_0xd81a('0x28')]()[_0xd81a('0x29')](function(){var _0x4c069e=_0x4e63af[_0xd81a('0x2a')]({'plain':!![]});var _0xf2a3d7='Intervals';return db[_0xd81a('0x2b')][_0xd81a('0x28')]({'where':{'type':_0xf2a3d7,'resourceId':_0x4c069e['id']}})[_0xd81a('0x29')](function(){return _0x4e63af;});})['then'](function(){_0x11e2d5['status'](0xcc)[_0xd81a('0x1c')]();});}};}function handleEntityNotFound(_0x2cd365,_0x5be791){return function(_0x45727c){if(!_0x45727c){_0x2cd365[_0xd81a('0x1a')](0x194);}return _0x45727c;};}function handleError(_0x57c571,_0x325e43){_0x325e43=_0x325e43||0x1f4;return function(_0x399fc2){logger[_0xd81a('0x2c')](_0x399fc2['stack']);if(_0x399fc2['name']){delete _0x399fc2[_0xd81a('0x2d')];}_0x57c571[_0xd81a('0x1b')](_0x325e43)[_0xd81a('0x2e')](_0x399fc2);};}exports[_0xd81a('0x2f')]=function(_0x55009d,_0x4c8e43){var _0x290696={},_0x17c154={},_0x16cc16={'count':0x0,'rows':[]};var _0xd75bdb=_[_0xd81a('0x30')](db[_0xd81a('0x31')][_0xd81a('0x32')],function(_0x1c6c42){return{'name':_0x1c6c42[_0xd81a('0x33')],'type':_0x1c6c42[_0xd81a('0x34')][_0xd81a('0x35')]};});_0x17c154[_0xd81a('0x36')]=_[_0xd81a('0x30')](_0xd75bdb,'name');_0x17c154[_0xd81a('0x37')]=_[_0xd81a('0x38')](_0x55009d[_0xd81a('0x37')]);_0x17c154['filters']=_[_0xd81a('0x39')](_0x17c154['model'],_0x17c154['query']);_0x290696[_0xd81a('0x3a')]=_[_0xd81a('0x39')](_0x17c154['model'],qs[_0xd81a('0x3b')](_0x55009d[_0xd81a('0x37')][_0xd81a('0x3b')]));_0x290696[_0xd81a('0x3a')]=_0x290696[_0xd81a('0x3a')][_0xd81a('0x3c')]?_0x290696['attributes']:_0x17c154[_0xd81a('0x36')];if(!_0x55009d[_0xd81a('0x37')][_0xd81a('0x3d')]('nolimit')){_0x290696[_0xd81a('0x20')]=qs[_0xd81a('0x20')](_0x55009d['query'][_0xd81a('0x20')]);_0x290696['offset']=qs[_0xd81a('0x1e')](_0x55009d[_0xd81a('0x37')][_0xd81a('0x1e')]);}_0x290696[_0xd81a('0x3e')]=qs[_0xd81a('0x3f')](_0x55009d[_0xd81a('0x37')]['sort']);_0x290696[_0xd81a('0x40')]=qs[_0xd81a('0x41')](_[_0xd81a('0x42')](_0x55009d[_0xd81a('0x37')],_0x17c154[_0xd81a('0x41')]),_0xd75bdb);if(_0x55009d[_0xd81a('0x37')][_0xd81a('0x43')]){_0x290696[_0xd81a('0x40')]=_['merge'](_0x290696[_0xd81a('0x40')],{'$or':_[_0xd81a('0x30')](_0xd75bdb,function(_0x5b48c2){if(_0x5b48c2[_0xd81a('0x34')]!==_0xd81a('0x44')){var _0x503853={};_0x503853[_0x5b48c2[_0xd81a('0x2d')]]={'$like':'%'+_0x55009d[_0xd81a('0x37')][_0xd81a('0x43')]+'%'};return _0x503853;}})});}_0x290696=_[_0xd81a('0x45')]({},_0x290696,_0x55009d[_0xd81a('0x46')]);var _0x5df1d4={'where':_0x290696['where']};return db['Interval'][_0xd81a('0x21')](_0x5df1d4)[_0xd81a('0x29')](function(_0x4648be){_0x16cc16[_0xd81a('0x21')]=_0x4648be;if(_0x55009d['query'][_0xd81a('0x47')]){_0x290696[_0xd81a('0x48')]=[{'all':!![]}];}return db[_0xd81a('0x31')][_0xd81a('0x49')](_0x290696);})[_0xd81a('0x29')](function(_0x2429e4){_0x16cc16[_0xd81a('0x4a')]=_0x2429e4;return _0x16cc16;})[_0xd81a('0x29')](respondWithFilteredResult(_0x4c8e43,_0x290696))[_0xd81a('0x4b')](handleError(_0x4c8e43,null));};exports['show']=function(_0x4c1b2f,_0x261721){var _0x38a752={'raw':!![],'where':{'id':_0x4c1b2f[_0xd81a('0x4c')]['id']}},_0x7ab1c={};_0x7ab1c['model']=_[_0xd81a('0x38')](db[_0xd81a('0x31')][_0xd81a('0x32')]);_0x7ab1c[_0xd81a('0x37')]=_['keys'](_0x4c1b2f[_0xd81a('0x37')]);_0x7ab1c[_0xd81a('0x41')]=_[_0xd81a('0x39')](_0x7ab1c[_0xd81a('0x36')],_0x7ab1c[_0xd81a('0x37')]);_0x38a752[_0xd81a('0x3a')]=_[_0xd81a('0x39')](_0x7ab1c[_0xd81a('0x36')],qs[_0xd81a('0x3b')](_0x4c1b2f[_0xd81a('0x37')][_0xd81a('0x3b')]));_0x38a752[_0xd81a('0x3a')]=_0x38a752['attributes'][_0xd81a('0x3c')]?_0x38a752[_0xd81a('0x3a')]:_0x7ab1c[_0xd81a('0x36')];if(_0x4c1b2f[_0xd81a('0x37')][_0xd81a('0x47')]){_0x38a752[_0xd81a('0x48')]=[{'all':!![]}];}_0x38a752=_[_0xd81a('0x45')]({},_0x38a752,_0x4c1b2f[_0xd81a('0x46')]);return db['Interval'][_0xd81a('0x4d')](_0x38a752)[_0xd81a('0x29')](handleEntityNotFound(_0x261721,null))[_0xd81a('0x29')](respondWithResult(_0x261721,null))['catch'](handleError(_0x261721,null));};exports['create']=function(_0xf56dbe,_0x482800){return db[_0xd81a('0x31')]['create'](_0xf56dbe['body'],{})[_0xd81a('0x29')](function(_0x15c596){var _0xa2d502=_0xf56dbe[_0xd81a('0x4e')][_0xd81a('0x2a')]({'plain':!![]});if(!_0xa2d502)throw new Error(_0xd81a('0x4f'));if(_0xa2d502[_0xd81a('0x50')]==='user'){var _0x3e61c5=_0x15c596[_0xd81a('0x2a')]({'plain':!![]});var _0x1753a3=_0xd81a('0x51');return db[_0xd81a('0x52')][_0xd81a('0x4d')]({'where':{'name':_0x1753a3,'userProfileId':_0xa2d502[_0xd81a('0x53')]},'raw':!![]})[_0xd81a('0x29')](function(_0x325321){if(_0x325321&&_0x325321['autoAssociation']===0x0){return db[_0xd81a('0x2b')][_0xd81a('0x54')]({'name':_0x3e61c5[_0xd81a('0x2d')],'resourceId':_0x3e61c5['id'],'type':_0x325321['name'],'sectionId':_0x325321['id']},{})[_0xd81a('0x29')](function(){return _0x15c596;});}else{return _0x15c596;}})[_0xd81a('0x4b')](function(_0x110e08){logger[_0xd81a('0x2c')](_0xd81a('0x55'),_0x110e08);throw _0x110e08;});}return _0x15c596;})[_0xd81a('0x29')](respondWithResult(_0x482800,0xc9))['catch'](handleError(_0x482800,null));};exports['update']=function(_0x2c8fb2,_0x92aca0){if(_0x2c8fb2[_0xd81a('0x56')]['id']){delete _0x2c8fb2['body']['id'];}return db['Interval'][_0xd81a('0x4d')]({'where':{'id':_0x2c8fb2[_0xd81a('0x4c')]['id']}})[_0xd81a('0x29')](handleEntityNotFound(_0x92aca0,null))[_0xd81a('0x29')](saveUpdates(_0x2c8fb2['body'],null))[_0xd81a('0x29')](respondWithResult(_0x92aca0,null))[_0xd81a('0x4b')](handleError(_0x92aca0,null));};exports['destroy']=function(_0x18003f,_0x15df2e){return db[_0xd81a('0x31')][_0xd81a('0x4d')]({'where':{'id':_0x18003f[_0xd81a('0x4c')]['id']}})[_0xd81a('0x29')](handleEntityNotFound(_0x15df2e,null))[_0xd81a('0x29')](removeEntity(_0x15df2e,null))[_0xd81a('0x4b')](handleError(_0x15df2e,null));};exports[_0xd81a('0x57')]=function(_0x1822dc,_0x2d040a,_0x16e728){if(_0x1822dc[_0xd81a('0x56')]['id']){delete _0x1822dc[_0xd81a('0x56')]['id'];}return db[_0xd81a('0x31')][_0xd81a('0x4d')]({'where':{'id':_0x1822dc['params']['id']}})[_0xd81a('0x29')](handleEntityNotFound(_0x2d040a,null))[_0xd81a('0x29')](function(_0x549e1e){if(_0x549e1e){_0x1822dc[_0xd81a('0x56')][_0xd81a('0x58')]=_0x549e1e['id'];return db[_0xd81a('0x31')][_0xd81a('0x54')](_0x1822dc[_0xd81a('0x56')]);}})[_0xd81a('0x29')](respondWithResult(_0x2d040a,null))[_0xd81a('0x4b')](handleError(_0x2d040a,null));};exports[_0xd81a('0x59')]=function(_0x5b2507,_0x104be9,_0x13b68f){var _0x3c6fed={};var _0x1c227f={};var _0x285310;var _0x49a52e;return db[_0xd81a('0x31')][_0xd81a('0x5a')]({'where':{'id':_0x5b2507[_0xd81a('0x4c')]['id']}})[_0xd81a('0x29')](handleEntityNotFound(_0x104be9,null))[_0xd81a('0x29')](function(_0x4cd973){if(_0x4cd973){_0x285310=_0x4cd973;_0x1c227f[_0xd81a('0x36')]=_[_0xd81a('0x38')](db[_0xd81a('0x31')][_0xd81a('0x32')]);_0x1c227f[_0xd81a('0x37')]=_['keys'](_0x5b2507[_0xd81a('0x37')]);_0x1c227f['filters']=_[_0xd81a('0x39')](_0x1c227f[_0xd81a('0x36')],_0x1c227f['query']);_0x3c6fed[_0xd81a('0x3a')]=_[_0xd81a('0x39')](_0x1c227f[_0xd81a('0x36')],qs[_0xd81a('0x3b')](_0x5b2507[_0xd81a('0x37')]['fields']));_0x3c6fed[_0xd81a('0x3a')]=_0x3c6fed[_0xd81a('0x3a')][_0xd81a('0x3c')]?_0x3c6fed['attributes']:_0x1c227f[_0xd81a('0x36')];_0x3c6fed[_0xd81a('0x3e')]=qs['sort'](_0x5b2507[_0xd81a('0x37')][_0xd81a('0x3f')]);_0x3c6fed[_0xd81a('0x40')]=qs[_0xd81a('0x41')](_['pick'](_0x5b2507['query'],_0x1c227f[_0xd81a('0x41')]));if(_0x5b2507['query'][_0xd81a('0x43')]){_0x3c6fed[_0xd81a('0x40')]=_[_0xd81a('0x45')](_0x3c6fed[_0xd81a('0x40')],{'$or':_[_0xd81a('0x30')](_0x3c6fed[_0xd81a('0x3a')],function(_0x216c1a){var _0x441695={};_0x441695[_0x216c1a]={'$like':'%'+_0x5b2507[_0xd81a('0x37')][_0xd81a('0x43')]+'%'};return _0x441695;})});}_0x3c6fed=_[_0xd81a('0x45')]({},_0x3c6fed,_0x5b2507[_0xd81a('0x46')]);return _0x285310[_0xd81a('0x59')](_0x3c6fed);}})[_0xd81a('0x29')](function(_0x217eec){if(_0x217eec){_0x49a52e=_0x217eec[_0xd81a('0x3c')];if(!_0x5b2507[_0xd81a('0x37')]['hasOwnProperty'](_0xd81a('0x5b'))){_0x3c6fed[_0xd81a('0x20')]=qs['limit'](_0x5b2507['query'][_0xd81a('0x20')]);_0x3c6fed['offset']=qs['offset'](_0x5b2507['query']['offset']);}return _0x285310[_0xd81a('0x59')](_0x3c6fed);}})[_0xd81a('0x29')](function(_0x4ee9fa){if(_0x4ee9fa){return _0x4ee9fa?{'count':_0x49a52e,'rows':_0x4ee9fa}:null;}})[_0xd81a('0x29')](respondWithResult(_0x104be9,null))[_0xd81a('0x4b')](handleError(_0x104be9,null));};exports[_0xd81a('0x5c')]=function(_0x5a590d,_0x40c049,_0x3c66ca){return db[_0xd81a('0x31')]['findOne']({'where':{'id':_0x5a590d['params']['id']}})[_0xd81a('0x29')](handleEntityNotFound(_0x40c049,null))[_0xd81a('0x29')](function(_0x2baca3){if(_0x2baca3){return db[_0xd81a('0x5d')][_0xd81a('0x5e')](function(_0x3f3360){return db[_0xd81a('0x31')][_0xd81a('0x28')]({'where':{'IntervalId':_0x5a590d[_0xd81a('0x4c')]['id']},'transaction':_0x3f3360})[_0xd81a('0x29')](function(_0x4a39f0){var _0x6eb8ce=_[_0xd81a('0x30')](_0x5a590d['body'],function(_0x36908d){delete _0x36908d['id'];_0x36908d[_0xd81a('0x58')]=_0x5a590d[_0xd81a('0x4c')]['id'];return _0x36908d;});return db[_0xd81a('0x31')][_0xd81a('0x5f')](_0x6eb8ce,{'transaction':_0x3f3360});});})[_0xd81a('0x29')](function(){return db[_0xd81a('0x31')][_0xd81a('0x49')]({'where':{'IntervalId':_0x5a590d[_0xd81a('0x4c')]['id']}});});}})[_0xd81a('0x29')](respondWithResult(_0x40c049,null))[_0xd81a('0x4b')](handleError(_0x40c049,null));}; \ No newline at end of file +var _0x5bca=['filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','IntervalId','getIntervals','findOne','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','then','Intervals','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x2ba2ac,_0x36a160){var _0xf0cd81=function(_0x50e206){while(--_0x50e206){_0x2ba2ac['push'](_0x2ba2ac['shift']());}};_0xf0cd81(++_0x36a160);}(_0x5bca,0xe4));var _0xa5bc=function(_0x9d1180,_0x2f71fb){_0x9d1180=_0x9d1180-0x0;var _0x155274=_0x5bca[_0x9d1180];return _0x155274;};'use strict';var emlformat=require(_0xa5bc('0x0'));var rimraf=require(_0xa5bc('0x1'));var zipdir=require(_0xa5bc('0x2'));var jsonpatch=require(_0xa5bc('0x3'));var rp=require(_0xa5bc('0x4'));var moment=require(_0xa5bc('0x5'));var BPromise=require(_0xa5bc('0x6'));var Mustache=require(_0xa5bc('0x7'));var util=require(_0xa5bc('0x8'));var path=require(_0xa5bc('0x9'));var sox=require(_0xa5bc('0xa'));var csv=require(_0xa5bc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5bc('0xc'));var _=require(_0xa5bc('0xd'));var squel=require(_0xa5bc('0xe'));var crypto=require('crypto');var jsforce=require(_0xa5bc('0xf'));var deskjs=require(_0xa5bc('0x10'));var toCsv=require(_0xa5bc('0xb'));var querystring=require(_0xa5bc('0x11'));var Papa=require(_0xa5bc('0x12'));var Redis=require(_0xa5bc('0x13'));var authService=require(_0xa5bc('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa5bc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa5bc('0x16'));var config=require(_0xa5bc('0x17'));var licenseUtil=require(_0xa5bc('0x18'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x43fcab,_0x99589){_0x99589=_0x99589||0xcc;return function(_0x333e4e){if(_0x333e4e){return _0x43fcab[_0xa5bc('0x19')](_0x99589);}return _0x43fcab[_0xa5bc('0x1a')](_0x99589)[_0xa5bc('0x1b')]();};}function respondWithResult(_0x1efefc,_0x159114){_0x159114=_0x159114||0xc8;return function(_0x1d4f71){if(_0x1d4f71){return _0x1efefc[_0xa5bc('0x1a')](_0x159114)['json'](_0x1d4f71);}};}function respondWithFilteredResult(_0x2f84f7,_0x201b43){return function(_0x68c1e8){if(_0x68c1e8){var _0x17c012=typeof _0x201b43['offset']===_0xa5bc('0x1c')&&typeof _0x201b43[_0xa5bc('0x1d')]===_0xa5bc('0x1c');var _0x60d4e2=_0x68c1e8[_0xa5bc('0x1e')];var _0x21cffd=_0x17c012?0x0:_0x201b43[_0xa5bc('0x1f')];var _0x308fce=_0x17c012?_0x68c1e8[_0xa5bc('0x1e')]:_0x201b43[_0xa5bc('0x1f')]+_0x201b43[_0xa5bc('0x1d')];var _0x246b47;if(_0x308fce>=_0x60d4e2){_0x308fce=_0x60d4e2;_0x246b47=0xc8;}else{_0x246b47=0xce;}_0x2f84f7['status'](_0x246b47);return _0x2f84f7[_0xa5bc('0x20')]('Content-Range',_0x21cffd+'-'+_0x308fce+'/'+_0x60d4e2)['json'](_0x68c1e8);}return null;};}function patchUpdates(_0x43f730){return function(_0x394544){try{jsonpatch[_0xa5bc('0x21')](_0x394544,_0x43f730,!![]);}catch(_0x5da641){return BPromise['reject'](_0x5da641);}return _0x394544[_0xa5bc('0x22')]();};}function saveUpdates(_0x5afb09,_0x19df96){return function(_0x549484){if(_0x549484){return _0x549484['update'](_0x5afb09)[_0xa5bc('0x23')](function(_0x5daf15){return _0x5daf15;});}return null;};}function removeEntity(_0x54b212,_0x50756c){return function(_0x5c4a43){if(_0x5c4a43){return _0x5c4a43['destroy']()['then'](function(){var _0x5b3b6f=_0x5c4a43['get']({'plain':!![]});var _0x406cac=_0xa5bc('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x406cac,'resourceId':_0x5b3b6f['id']}})[_0xa5bc('0x23')](function(){return _0x5c4a43;});})[_0xa5bc('0x23')](function(){_0x54b212[_0xa5bc('0x1a')](0xcc)[_0xa5bc('0x1b')]();});}};}function handleEntityNotFound(_0x98d576,_0x397002){return function(_0x57e95e){if(!_0x57e95e){_0x98d576[_0xa5bc('0x19')](0x194);}return _0x57e95e;};}function handleError(_0x58d045,_0x51675f){_0x51675f=_0x51675f||0x1f4;return function(_0xa280e){logger['error'](_0xa280e['stack']);if(_0xa280e[_0xa5bc('0x25')]){delete _0xa280e[_0xa5bc('0x25')];}_0x58d045[_0xa5bc('0x1a')](_0x51675f)[_0xa5bc('0x26')](_0xa280e);};}exports[_0xa5bc('0x27')]=function(_0x438367,_0x31ef22){var _0x3055b4={},_0x4abd93={},_0x15c710={'count':0x0,'rows':[]};var _0x1ba034=_['map'](db[_0xa5bc('0x28')][_0xa5bc('0x29')],function(_0x1d6d7e){return{'name':_0x1d6d7e[_0xa5bc('0x2a')],'type':_0x1d6d7e[_0xa5bc('0x2b')][_0xa5bc('0x2c')]};});_0x4abd93[_0xa5bc('0x2d')]=_[_0xa5bc('0x2e')](_0x1ba034,'name');_0x4abd93[_0xa5bc('0x2f')]=_['keys'](_0x438367['query']);_0x4abd93[_0xa5bc('0x30')]=_['intersection'](_0x4abd93[_0xa5bc('0x2d')],_0x4abd93[_0xa5bc('0x2f')]);_0x3055b4[_0xa5bc('0x31')]=_[_0xa5bc('0x32')](_0x4abd93['model'],qs['fields'](_0x438367[_0xa5bc('0x2f')][_0xa5bc('0x33')]));_0x3055b4[_0xa5bc('0x31')]=_0x3055b4[_0xa5bc('0x31')][_0xa5bc('0x34')]?_0x3055b4[_0xa5bc('0x31')]:_0x4abd93[_0xa5bc('0x2d')];if(!_0x438367[_0xa5bc('0x2f')]['hasOwnProperty']('nolimit')){_0x3055b4[_0xa5bc('0x1d')]=qs[_0xa5bc('0x1d')](_0x438367['query'][_0xa5bc('0x1d')]);_0x3055b4['offset']=qs[_0xa5bc('0x1f')](_0x438367[_0xa5bc('0x2f')]['offset']);}_0x3055b4['order']=qs[_0xa5bc('0x35')](_0x438367[_0xa5bc('0x2f')][_0xa5bc('0x35')]);_0x3055b4[_0xa5bc('0x36')]=qs[_0xa5bc('0x30')](_[_0xa5bc('0x37')](_0x438367['query'],_0x4abd93[_0xa5bc('0x30')]),_0x1ba034);if(_0x438367[_0xa5bc('0x2f')][_0xa5bc('0x38')]){_0x3055b4[_0xa5bc('0x36')]=_[_0xa5bc('0x39')](_0x3055b4[_0xa5bc('0x36')],{'$or':_['map'](_0x1ba034,function(_0x5b69b6){if(_0x5b69b6[_0xa5bc('0x2b')]!==_0xa5bc('0x3a')){var _0x3b4668={};_0x3b4668[_0x5b69b6[_0xa5bc('0x25')]]={'$like':'%'+_0x438367[_0xa5bc('0x2f')]['filter']+'%'};return _0x3b4668;}})});}_0x3055b4=_['merge']({},_0x3055b4,_0x438367[_0xa5bc('0x3b')]);var _0x54dede={'where':_0x3055b4['where']};return db[_0xa5bc('0x28')][_0xa5bc('0x1e')](_0x54dede)[_0xa5bc('0x23')](function(_0x29fc2a){_0x15c710['count']=_0x29fc2a;if(_0x438367[_0xa5bc('0x2f')][_0xa5bc('0x3c')]){_0x3055b4[_0xa5bc('0x3d')]=[{'all':!![]}];}return db[_0xa5bc('0x28')][_0xa5bc('0x3e')](_0x3055b4);})[_0xa5bc('0x23')](function(_0x3c4467){_0x15c710[_0xa5bc('0x3f')]=_0x3c4467;return _0x15c710;})[_0xa5bc('0x23')](respondWithFilteredResult(_0x31ef22,_0x3055b4))[_0xa5bc('0x40')](handleError(_0x31ef22,null));};exports[_0xa5bc('0x41')]=function(_0x56e042,_0x20601d){var _0x44e2df={'raw':!![],'where':{'id':_0x56e042[_0xa5bc('0x42')]['id']}},_0x4b9100={};_0x4b9100['model']=_[_0xa5bc('0x43')](db[_0xa5bc('0x28')]['rawAttributes']);_0x4b9100[_0xa5bc('0x2f')]=_[_0xa5bc('0x43')](_0x56e042[_0xa5bc('0x2f')]);_0x4b9100[_0xa5bc('0x30')]=_[_0xa5bc('0x32')](_0x4b9100[_0xa5bc('0x2d')],_0x4b9100['query']);_0x44e2df[_0xa5bc('0x31')]=_[_0xa5bc('0x32')](_0x4b9100[_0xa5bc('0x2d')],qs[_0xa5bc('0x33')](_0x56e042[_0xa5bc('0x2f')][_0xa5bc('0x33')]));_0x44e2df['attributes']=_0x44e2df[_0xa5bc('0x31')][_0xa5bc('0x34')]?_0x44e2df[_0xa5bc('0x31')]:_0x4b9100[_0xa5bc('0x2d')];if(_0x56e042[_0xa5bc('0x2f')][_0xa5bc('0x3c')]){_0x44e2df[_0xa5bc('0x3d')]=[{'all':!![]}];}_0x44e2df=_[_0xa5bc('0x39')]({},_0x44e2df,_0x56e042[_0xa5bc('0x3b')]);return db[_0xa5bc('0x28')][_0xa5bc('0x44')](_0x44e2df)[_0xa5bc('0x23')](handleEntityNotFound(_0x20601d,null))[_0xa5bc('0x23')](respondWithResult(_0x20601d,null))[_0xa5bc('0x40')](handleError(_0x20601d,null));};exports[_0xa5bc('0x45')]=function(_0x402af9,_0x2e43ea){return db[_0xa5bc('0x28')][_0xa5bc('0x45')](_0x402af9[_0xa5bc('0x46')],{})[_0xa5bc('0x23')](function(_0x54f4a5){var _0x127ee6=_0x402af9[_0xa5bc('0x47')][_0xa5bc('0x48')]({'plain':!![]});if(!_0x127ee6)throw new Error(_0xa5bc('0x49'));if(_0x127ee6[_0xa5bc('0x4a')]===_0xa5bc('0x47')){var _0xcba242=_0x54f4a5[_0xa5bc('0x48')]({'plain':!![]});var _0x1b0c51=_0xa5bc('0x24');return db[_0xa5bc('0x4b')][_0xa5bc('0x44')]({'where':{'name':_0x1b0c51,'userProfileId':_0x127ee6[_0xa5bc('0x4c')]},'raw':!![]})[_0xa5bc('0x23')](function(_0x118fa8){if(_0x118fa8&&_0x118fa8[_0xa5bc('0x4d')]===0x0){return db[_0xa5bc('0x4e')][_0xa5bc('0x45')]({'name':_0xcba242['name'],'resourceId':_0xcba242['id'],'type':_0x118fa8[_0xa5bc('0x25')],'sectionId':_0x118fa8['id']},{})[_0xa5bc('0x23')](function(){return _0x54f4a5;});}else{return _0x54f4a5;}})[_0xa5bc('0x40')](function(_0x5bc4f3){logger[_0xa5bc('0x4f')](_0xa5bc('0x50'),_0x5bc4f3);throw _0x5bc4f3;});}return _0x54f4a5;})['then'](respondWithResult(_0x2e43ea,0xc9))[_0xa5bc('0x40')](handleError(_0x2e43ea,null));};exports[_0xa5bc('0x51')]=function(_0x33ffd0,_0x4ae58a){if(_0x33ffd0[_0xa5bc('0x46')]['id']){delete _0x33ffd0[_0xa5bc('0x46')]['id'];}return db[_0xa5bc('0x28')][_0xa5bc('0x44')]({'where':{'id':_0x33ffd0[_0xa5bc('0x42')]['id']}})[_0xa5bc('0x23')](handleEntityNotFound(_0x4ae58a,null))['then'](saveUpdates(_0x33ffd0['body'],null))[_0xa5bc('0x23')](respondWithResult(_0x4ae58a,null))[_0xa5bc('0x40')](handleError(_0x4ae58a,null));};exports[_0xa5bc('0x52')]=function(_0x389dce,_0x3077f1){return db['Interval'][_0xa5bc('0x44')]({'where':{'id':_0x389dce['params']['id']}})[_0xa5bc('0x23')](handleEntityNotFound(_0x3077f1,null))[_0xa5bc('0x23')](removeEntity(_0x3077f1,null))[_0xa5bc('0x40')](handleError(_0x3077f1,null));};exports['addInterval']=function(_0x10dd62,_0xcb91cb,_0x55dd2c){if(_0x10dd62[_0xa5bc('0x46')]['id']){delete _0x10dd62['body']['id'];}return db[_0xa5bc('0x28')][_0xa5bc('0x44')]({'where':{'id':_0x10dd62['params']['id']}})[_0xa5bc('0x23')](handleEntityNotFound(_0xcb91cb,null))['then'](function(_0x351907){if(_0x351907){_0x10dd62[_0xa5bc('0x46')][_0xa5bc('0x53')]=_0x351907['id'];return db[_0xa5bc('0x28')][_0xa5bc('0x45')](_0x10dd62[_0xa5bc('0x46')]);}})[_0xa5bc('0x23')](respondWithResult(_0xcb91cb,null))[_0xa5bc('0x40')](handleError(_0xcb91cb,null));};exports[_0xa5bc('0x54')]=function(_0x205bd5,_0x545d55,_0x50e85c){var _0x4a0f98={};var _0x5ddfda={};var _0x252464;var _0x2aac99;return db[_0xa5bc('0x28')][_0xa5bc('0x55')]({'where':{'id':_0x205bd5[_0xa5bc('0x42')]['id']}})[_0xa5bc('0x23')](handleEntityNotFound(_0x545d55,null))[_0xa5bc('0x23')](function(_0x1ba900){if(_0x1ba900){_0x252464=_0x1ba900;_0x5ddfda['model']=_[_0xa5bc('0x43')](db['Interval'][_0xa5bc('0x29')]);_0x5ddfda[_0xa5bc('0x2f')]=_['keys'](_0x205bd5['query']);_0x5ddfda[_0xa5bc('0x30')]=_[_0xa5bc('0x32')](_0x5ddfda['model'],_0x5ddfda[_0xa5bc('0x2f')]);_0x4a0f98[_0xa5bc('0x31')]=_[_0xa5bc('0x32')](_0x5ddfda[_0xa5bc('0x2d')],qs['fields'](_0x205bd5[_0xa5bc('0x2f')][_0xa5bc('0x33')]));_0x4a0f98[_0xa5bc('0x31')]=_0x4a0f98[_0xa5bc('0x31')]['length']?_0x4a0f98[_0xa5bc('0x31')]:_0x5ddfda[_0xa5bc('0x2d')];_0x4a0f98['order']=qs[_0xa5bc('0x35')](_0x205bd5[_0xa5bc('0x2f')][_0xa5bc('0x35')]);_0x4a0f98['where']=qs[_0xa5bc('0x30')](_[_0xa5bc('0x37')](_0x205bd5[_0xa5bc('0x2f')],_0x5ddfda[_0xa5bc('0x30')]));if(_0x205bd5['query'][_0xa5bc('0x38')]){_0x4a0f98[_0xa5bc('0x36')]=_[_0xa5bc('0x39')](_0x4a0f98[_0xa5bc('0x36')],{'$or':_[_0xa5bc('0x2e')](_0x4a0f98[_0xa5bc('0x31')],function(_0x48380e){var _0x38dfb4={};_0x38dfb4[_0x48380e]={'$like':'%'+_0x205bd5[_0xa5bc('0x2f')]['filter']+'%'};return _0x38dfb4;})});}_0x4a0f98=_['merge']({},_0x4a0f98,_0x205bd5['options']);return _0x252464[_0xa5bc('0x54')](_0x4a0f98);}})[_0xa5bc('0x23')](function(_0x4b807a){if(_0x4b807a){_0x2aac99=_0x4b807a[_0xa5bc('0x34')];if(!_0x205bd5[_0xa5bc('0x2f')][_0xa5bc('0x56')](_0xa5bc('0x57'))){_0x4a0f98[_0xa5bc('0x1d')]=qs[_0xa5bc('0x1d')](_0x205bd5[_0xa5bc('0x2f')][_0xa5bc('0x1d')]);_0x4a0f98[_0xa5bc('0x1f')]=qs['offset'](_0x205bd5[_0xa5bc('0x2f')][_0xa5bc('0x1f')]);}return _0x252464[_0xa5bc('0x54')](_0x4a0f98);}})['then'](function(_0x1ee7c8){if(_0x1ee7c8){return _0x1ee7c8?{'count':_0x2aac99,'rows':_0x1ee7c8}:null;}})[_0xa5bc('0x23')](respondWithResult(_0x545d55,null))[_0xa5bc('0x40')](handleError(_0x545d55,null));};exports[_0xa5bc('0x58')]=function(_0x815ca1,_0x177ff8,_0x4487d1){return db[_0xa5bc('0x28')][_0xa5bc('0x55')]({'where':{'id':_0x815ca1[_0xa5bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x177ff8,null))[_0xa5bc('0x23')](function(_0x12e4d8){if(_0x12e4d8){return db[_0xa5bc('0x59')][_0xa5bc('0x5a')](function(_0x26010b){return db[_0xa5bc('0x28')][_0xa5bc('0x52')]({'where':{'IntervalId':_0x815ca1[_0xa5bc('0x42')]['id']},'transaction':_0x26010b})['then'](function(_0x2cae32){var _0x1fc07b=_[_0xa5bc('0x2e')](_0x815ca1['body'],function(_0x5e928d){delete _0x5e928d['id'];_0x5e928d[_0xa5bc('0x53')]=_0x815ca1[_0xa5bc('0x42')]['id'];return _0x5e928d;});return db[_0xa5bc('0x28')][_0xa5bc('0x5b')](_0x1fc07b,{'transaction':_0x26010b});});})[_0xa5bc('0x23')](function(){return db[_0xa5bc('0x28')][_0xa5bc('0x3e')]({'where':{'IntervalId':_0x815ca1[_0xa5bc('0x42')]['id']}});});}})[_0xa5bc('0x23')](respondWithResult(_0x177ff8,null))[_0xa5bc('0x40')](handleError(_0x177ff8,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ba6fd85..7cadabb 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 _0xcc8d=['../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x563c0b,_0x391c64){var _0x2ed720=function(_0x4ed8d8){while(--_0x4ed8d8){_0x563c0b['push'](_0x563c0b['shift']());}};_0x2ed720(++_0x391c64);}(_0xcc8d,0xfc));var _0xdcc8=function(_0x1f69bc,_0xaffd71){_0x1f69bc=_0x1f69bc-0x0;var _0x1ac3c5=_0xcc8d[_0x1f69bc];return _0x1ac3c5;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var logger=require('../../config/logger')(_0xdcc8('0x2'));var moment=require('moment');var BPromise=require(_0xdcc8('0x3'));var rp=require(_0xdcc8('0x4'));var fs=require('fs');var path=require(_0xdcc8('0x5'));var rimraf=require(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xdcc8('0x8'));module[_0xdcc8('0x9')]=function(_0x50bf40,_0x2c5482){return _0x50bf40[_0xdcc8('0xa')](_0xdcc8('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a94a2,_0x5e9575){extensions['rewrite'](_0x50bf40,_0x1a94a2);},'afterBulkCreate':function(_0x531e96,_0x5ae4fd,_0x4b7f6b){_0x4b7f6b();extensions[_0xdcc8('0xc')](_0x50bf40,_0x531e96[0x0]);},'afterUpdate':function(_0x1921a4,_0x3cd243){extensions[_0xdcc8('0xc')](_0x50bf40,_0x1921a4);},'afterDestroy':function(_0x2e98d8,_0x28bdf1){extensions[_0xdcc8('0xc')](_0x50bf40,_0x2e98d8);}}});}; \ No newline at end of file +var _0x926e=['moment','bluebird','request-promise','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api'];(function(_0xe86e15,_0x76d055){var _0x4f0c46=function(_0x19e81e){while(--_0x19e81e){_0xe86e15['push'](_0xe86e15['shift']());}};_0x4f0c46(++_0x76d055);}(_0x926e,0xf8));var _0xe926=function(_0xf3413d,_0x35c484){_0xf3413d=_0xf3413d-0x0;var _0x4a750b=_0x926e[_0xf3413d];return _0x4a750b;};'use strict';var _=require(_0xe926('0x0'));var util=require(_0xe926('0x1'));var logger=require(_0xe926('0x2'))(_0xe926('0x3'));var moment=require(_0xe926('0x4'));var BPromise=require(_0xe926('0x5'));var rp=require(_0xe926('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe926('0x7'));var extensions=require(_0xe926('0x8'));module[_0xe926('0x9')]=function(_0x59cc36,_0x22327c){return _0x59cc36[_0xe926('0xa')](_0xe926('0xb'),attributes,{'tableName':_0xe926('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b3859,_0x1fb351){extensions[_0xe926('0xd')](_0x59cc36,_0x3b3859);},'afterBulkCreate':function(_0x4fa168,_0x1b3f80,_0x55333f){_0x55333f();extensions[_0xe926('0xd')](_0x59cc36,_0x4fa168[0x0]);},'afterUpdate':function(_0xc69699,_0xf1828b){extensions[_0xe926('0xd')](_0x59cc36,_0xc69699);},'afterDestroy':function(_0x1b0fb1,_0x2a7a35){extensions[_0xe926('0xd')](_0x59cc36,_0x1b0fb1);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 763a927..fab9abe 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(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 e1855e9..9f50224 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(_0x422467,_0x3a6f97){var _0x2caa2d=function(_0x2d13fb){while(--_0x2d13fb){_0x422467['push'](_0x422467['shift']());}};_0x2caa2d(++_0x3a6f97);}(_0xadb5,0xad));var _0x5adb=function(_0x142221,_0x9bfc3b){_0x142221=_0x142221-0x0;var _0x13771a=_0xadb5[_0x142221];return _0x13771a;};'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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0x0b0e[_0x34473f];return _0x25cf6f;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 225dc38..0c20ab0 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 _0x52c8=['body','headers','remoteAddress','connection','socket','bluebird','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send'];(function(_0x4b9e14,_0x243e97){var _0x24e392=function(_0x33e2b0){while(--_0x33e2b0){_0x4b9e14['push'](_0x4b9e14['shift']());}};_0x24e392(++_0x243e97);}(_0x52c8,0xdc));var _0x852c=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0x52c8[_0x2a9f4];return _0x3c39e0;};'use strict';var BPromise=require(_0x852c('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x852c('0x1'));var USERNAME=_0x852c('0x2');var PASSWORD=_0x852c('0x3');function openIssue(_0x39bf60,_0x2b9a6c){var _0xb80d68={'fields':{'project':{'key':_0x39bf60[_0x852c('0x4')]||'MOTGUI'},'summary':(_0x39bf60[_0x852c('0x5')]||_0x852c('0x6'))+_0x852c('0x7')+_0x39bf60['ip'],'description':_0x39bf60[_0x852c('0x8')]||JSON[_0x852c('0x9')](_0x39bf60),'issuetype':{'name':_0x39bf60[_0x852c('0xa')]||_0x852c('0xb')}}};_0xb80d68['fields'][_0x852c('0xc')]=_0x39bf60[_0x852c('0xd')];_0xb80d68[_0x852c('0xe')]['customfield_11501']=_0x39bf60[_0x852c('0xf')];_0xb80d68[_0x852c('0xe')][_0x852c('0x10')]=_0x39bf60[_0x852c('0x11')];_0xb80d68[_0x852c('0xe')][_0x852c('0x12')]=_0x39bf60[_0x852c('0x13')];_0xb80d68['fields'][_0x852c('0x14')]=_0x39bf60['reason'];_0xb80d68[_0x852c('0xe')]['customfield_10102']=_0x39bf60['ip'];var _0x365dec={'host':_0x852c('0x15'),'port':0x1bb,'path':_0x852c('0x16'),'method':_0x852c('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x852c('0x18'),'Authorization':_0x852c('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x852c('0x1a'))}};var _0x204a1a=JSON[_0x852c('0x9')](_0xb80d68);var _0x345948=https[_0x852c('0x1b')](_0x365dec,function(_0x375dde){_0x375dde['setEncoding'](_0x852c('0x1c'));var _0x2cdc35='';_0x375dde['on'](_0x852c('0x1d'),function(_0x336bb5){_0x2cdc35+=_0x336bb5;});_0x375dde['on'](_0x852c('0x1e'),function(){if(_0x2b9a6c){return _0x2b9a6c[_0x852c('0x1f')](_0x375dde['statusCode'])[_0x852c('0x20')](JSON['parse'](_0x2cdc35));}});});_0x345948['on'](_0x852c('0x21'),function(_0x4872ec){if(_0x2b9a6c){return _0x2b9a6c[_0x852c('0x1f')](0x1f4)[_0x852c('0x20')]({'errors':[{'message':_0x852c('0x22'),'type':_0x852c('0x23')}]});}});_0x345948['write'](_0x204a1a);_0x345948['end']();}exports[_0x852c('0x24')]=openIssue;exports[_0x852c('0x25')]=function(_0x226769,_0x38dde1){_0x226769[_0x852c('0x26')]['ip']=_0x226769[_0x852c('0x27')]['x-forwarded-for']||_0x226769['connection'][_0x852c('0x28')]||_0x226769['socket']['remoteAddress']||_0x226769[_0x852c('0x29')][_0x852c('0x2a')][_0x852c('0x28')];return openIssue(_0x226769[_0x852c('0x26')],_0x38dde1);}; \ No newline at end of file +var _0xcd73=['customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','data','end','status','statusCode','json','parse','error','api.jira','write','send','headers','x-forwarded-for','connection','socket','body','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','email','oldToken'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcd73,0x158));var _0x3cd7=function(_0x5f1fd7,_0x1206fa){_0x5f1fd7=_0x5f1fd7-0x0;var _0xa6b780=_0xcd73[_0x5f1fd7];return _0xa6b780;};'use strict';var BPromise=require(_0x3cd7('0x0'));var https=require(_0x3cd7('0x1'));var logger=require(_0x3cd7('0x2'))(_0x3cd7('0x3'));var USERNAME='support';var PASSWORD=_0x3cd7('0x4');function openIssue(_0x57a541,_0x16e474){var _0x424a67={'fields':{'project':{'key':_0x57a541[_0x3cd7('0x5')]||_0x3cd7('0x6')},'summary':(_0x57a541[_0x3cd7('0x7')]||'Report')+_0x3cd7('0x8')+_0x57a541['ip'],'description':_0x57a541[_0x3cd7('0x9')]||JSON[_0x3cd7('0xa')](_0x57a541),'issuetype':{'name':_0x57a541[_0x3cd7('0xb')]||_0x3cd7('0xc')}}};_0x424a67[_0x3cd7('0xd')]['customfield_11500']=_0x57a541[_0x3cd7('0xe')];_0x424a67[_0x3cd7('0xd')]['customfield_11501']=_0x57a541[_0x3cd7('0xf')];_0x424a67[_0x3cd7('0xd')][_0x3cd7('0x10')]=_0x57a541[_0x3cd7('0x11')];_0x424a67['fields'][_0x3cd7('0x12')]=_0x57a541[_0x3cd7('0x13')];_0x424a67['fields']['customfield_11504']=_0x57a541[_0x3cd7('0x14')];_0x424a67[_0x3cd7('0xd')][_0x3cd7('0x15')]=_0x57a541['ip'];var _0x3c8124={'host':_0x3cd7('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x3cd7('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x3cd7('0x18'),'Authorization':_0x3cd7('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x3cd7('0x1a')](_0x3cd7('0x1b'))}};var _0x2ee2fc=JSON[_0x3cd7('0xa')](_0x424a67);var _0xdc3790=https[_0x3cd7('0x1c')](_0x3c8124,function(_0x439d75){_0x439d75[_0x3cd7('0x1d')]('utf8');var _0x4f921f='';_0x439d75['on'](_0x3cd7('0x1e'),function(_0x2350d1){_0x4f921f+=_0x2350d1;});_0x439d75['on'](_0x3cd7('0x1f'),function(){if(_0x16e474){return _0x16e474[_0x3cd7('0x20')](_0x439d75[_0x3cd7('0x21')])[_0x3cd7('0x22')](JSON[_0x3cd7('0x23')](_0x4f921f));}});});_0xdc3790['on'](_0x3cd7('0x24'),function(_0x479c05){if(_0x16e474){return _0x16e474['status'](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x3cd7('0x25')}]});}});_0xdc3790[_0x3cd7('0x26')](_0x2ee2fc);_0xdc3790[_0x3cd7('0x1f')]();}exports['openIssue']=openIssue;exports[_0x3cd7('0x27')]=function(_0x4a9805,_0x11cc28){_0x4a9805['body']['ip']=_0x4a9805[_0x3cd7('0x28')][_0x3cd7('0x29')]||_0x4a9805[_0x3cd7('0x2a')]['remoteAddress']||_0x4a9805[_0x3cd7('0x2b')]['remoteAddress']||_0x4a9805[_0x3cd7('0x2a')][_0x3cd7('0x2b')]['remoteAddress'];return openIssue(_0x4a9805[_0x3cd7('0x2c')],_0x11cc28);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d5f5513..1e8c534 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 _0xda55=['../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','express','Router','fs-extra'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0xda55,0x6d));var _0x5da5=function(_0xc0b7f7,_0x3eb5e5){_0xc0b7f7=_0xc0b7f7-0x0;var _0x48ab14=_0xda55[_0xc0b7f7];return _0x48ab14;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var fs_extra=require(_0x5da5('0x4'));var auth=require(_0x5da5('0x5'));var interaction=require(_0x5da5('0x6'));var config=require('../../config/environment');var controller=require(_0x5da5('0x7'));router['get']('/',auth[_0x5da5('0x8')](),controller['index']);router[_0x5da5('0x9')](_0x5da5('0xa'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xb')]);router[_0x5da5('0x9')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xd')]);router['post']('/',auth[_0x5da5('0x8')](),controller[_0x5da5('0xe')]);router[_0x5da5('0xf')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0x10')]);router[_0x5da5('0x11')]('/:id',auth[_0x5da5('0x8')](),controller[_0x5da5('0x12')]);module['exports']=router; \ No newline at end of file +var _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x5d7d5b,_0x4af5f7){var _0xf8f690=function(_0x490709){while(--_0x490709){_0x5d7d5b['push'](_0x5d7d5b['shift']());}};_0xf8f690(++_0x4af5f7);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4132cf,_0x30d010){_0x4132cf=_0x4132cf-0x0;var _0x31b569=_0xee5b[_0x4132cf];return _0x31b569;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index e613bea..b1d1c4f 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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x1df07c,_0x45947a){_0x1df07c=_0x1df07c-0x0;var _0x3ef2de=_0x7a54[_0x1df07c];return _0x3ef2de;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x3d0f69,_0x44ed40){_0x3d0f69=_0x3d0f69-0x0;var _0x534b64=_0x7a54[_0x3d0f69];return _0x534b64;};'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 273da2b..57bfb7c 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 _0x444e=['keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','catch','show','fields','options','find','create','body','params','describe','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','status','sendStatus','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model'];(function(_0x19fbdc,_0x2e1d6a){var _0x176533=function(_0x9003da){while(--_0x9003da){_0x19fbdc['push'](_0x19fbdc['shift']());}};_0x176533(++_0x2e1d6a);}(_0x444e,0xe8));var _0xe444=function(_0x467b9d,_0x495c6c){_0x467b9d=_0x467b9d-0x0;var _0x221400=_0x444e[_0x467b9d];return _0x221400;};'use strict';var emlformat=require(_0xe444('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe444('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe444('0x2'));var moment=require('moment');var BPromise=require(_0xe444('0x3'));var Mustache=require('mustache');var util=require(_0xe444('0x4'));var path=require(_0xe444('0x5'));var sox=require(_0xe444('0x6'));var csv=require(_0xe444('0x7'));var ejs=require(_0xe444('0x8'));var fs=require('fs');var fs_extra=require(_0xe444('0x9'));var _=require('lodash');var squel=require(_0xe444('0xa'));var crypto=require('crypto');var jsforce=require(_0xe444('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe444('0x7'));var querystring=require(_0xe444('0xc'));var Papa=require(_0xe444('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe444('0xe'));var as=require(_0xe444('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe444('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe444('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xe444('0x12'))['db'];function respondWithStatusCode(_0x2f9d12,_0x59792f){_0x59792f=_0x59792f||0xcc;return function(_0x28c3e4){if(_0x28c3e4){return _0x2f9d12['sendStatus'](_0x59792f);}return _0x2f9d12['status'](_0x59792f)[_0xe444('0x13')]();};}function respondWithResult(_0x3e3b9f,_0x5eb55c){_0x5eb55c=_0x5eb55c||0xc8;return function(_0x192c1a){if(_0x192c1a){return _0x3e3b9f['status'](_0x5eb55c)[_0xe444('0x14')](_0x192c1a);}};}function respondWithFilteredResult(_0x3acd97,_0x18f7cf){return function(_0x3af415){if(_0x3af415){var _0x363716=typeof _0x18f7cf[_0xe444('0x15')]===_0xe444('0x16')&&typeof _0x18f7cf[_0xe444('0x17')]===_0xe444('0x16');var _0x4009c7=_0x3af415[_0xe444('0x18')];var _0x3d9066=_0x363716?0x0:_0x18f7cf[_0xe444('0x15')];var _0x4e2711=_0x363716?_0x3af415[_0xe444('0x18')]:_0x18f7cf[_0xe444('0x15')]+_0x18f7cf[_0xe444('0x17')];var _0x2f6a4a;if(_0x4e2711>=_0x4009c7){_0x4e2711=_0x4009c7;_0x2f6a4a=0xc8;}else{_0x2f6a4a=0xce;}_0x3acd97['status'](_0x2f6a4a);return _0x3acd97[_0xe444('0x19')](_0xe444('0x1a'),_0x3d9066+'-'+_0x4e2711+'/'+_0x4009c7)[_0xe444('0x14')](_0x3af415);}return null;};}function patchUpdates(_0xf213c0){return function(_0x37c15e){try{jsonpatch['apply'](_0x37c15e,_0xf213c0,!![]);}catch(_0x21d01d){return BPromise[_0xe444('0x1b')](_0x21d01d);}return _0x37c15e['save']();};}function saveUpdates(_0x2b52a6,_0x5ef1a4){return function(_0x13108c){if(_0x13108c){return _0x13108c[_0xe444('0x1c')](_0x2b52a6)[_0xe444('0x1d')](function(_0x322c07){return _0x322c07;});}return null;};}function removeEntity(_0x1fa32b,_0x481762){return function(_0x527bf5){if(_0x527bf5){return _0x527bf5[_0xe444('0x1e')]()[_0xe444('0x1d')](function(){_0x1fa32b[_0xe444('0x1f')](0xcc)[_0xe444('0x13')]();});}};}function handleEntityNotFound(_0x2a03a2,_0x5e0311){return function(_0x3c9cf7){if(!_0x3c9cf7){_0x2a03a2[_0xe444('0x20')](0x194);}return _0x3c9cf7;};}function handleError(_0x5e36bb,_0x32055b){_0x32055b=_0x32055b||0x1f4;return function(_0x4f4412){logger[_0xe444('0x21')](_0x4f4412[_0xe444('0x22')]);if(_0x4f4412[_0xe444('0x23')]){delete _0x4f4412[_0xe444('0x23')];}_0x5e36bb[_0xe444('0x1f')](_0x32055b)['send'](_0x4f4412);};}exports[_0xe444('0x24')]=function(_0xe8814b,_0x311989){var _0x304b33={},_0x5bc063={},_0x594b43={'count':0x0,'rows':[]};var _0x1bfec6=_[_0xe444('0x25')](db[_0xe444('0x26')][_0xe444('0x27')],function(_0x5173d5){return{'name':_0x5173d5[_0xe444('0x28')],'type':_0x5173d5[_0xe444('0x29')][_0xe444('0x2a')]};});_0x5bc063[_0xe444('0x2b')]=_['map'](_0x1bfec6,'name');_0x5bc063['query']=_[_0xe444('0x2c')](_0xe8814b[_0xe444('0x2d')]);_0x5bc063[_0xe444('0x2e')]=_[_0xe444('0x2f')](_0x5bc063[_0xe444('0x2b')],_0x5bc063['query']);_0x304b33[_0xe444('0x30')]=_[_0xe444('0x2f')](_0x5bc063[_0xe444('0x2b')],qs['fields'](_0xe8814b[_0xe444('0x2d')]['fields']));_0x304b33['attributes']=_0x304b33[_0xe444('0x30')][_0xe444('0x31')]?_0x304b33['attributes']:_0x5bc063[_0xe444('0x2b')];if(!_0xe8814b['query'][_0xe444('0x32')]('nolimit')){_0x304b33['limit']=qs[_0xe444('0x17')](_0xe8814b['query'][_0xe444('0x17')]);_0x304b33[_0xe444('0x15')]=qs[_0xe444('0x15')](_0xe8814b[_0xe444('0x2d')]['offset']);}_0x304b33[_0xe444('0x33')]=qs[_0xe444('0x34')](_0xe8814b[_0xe444('0x2d')]['sort']);_0x304b33[_0xe444('0x35')]=qs['filters'](_[_0xe444('0x36')](_0xe8814b[_0xe444('0x2d')],_0x5bc063[_0xe444('0x2e')]),_0x1bfec6);if(_0xe8814b['query']['filter']){_0x304b33[_0xe444('0x35')]=_[_0xe444('0x37')](_0x304b33[_0xe444('0x35')],{'$or':_[_0xe444('0x25')](_0x1bfec6,function(_0xec1e35){if(_0xec1e35[_0xe444('0x29')]!==_0xe444('0x38')){var _0x5c2ddf={};_0x5c2ddf[_0xec1e35['name']]={'$like':'%'+_0xe8814b[_0xe444('0x2d')]['filter']+'%'};return _0x5c2ddf;}})});}_0x304b33=_[_0xe444('0x37')]({},_0x304b33,_0xe8814b['options']);var _0x3ad83c={'where':_0x304b33[_0xe444('0x35')]};return db[_0xe444('0x26')][_0xe444('0x18')](_0x3ad83c)[_0xe444('0x1d')](function(_0x2b1e25){_0x594b43['count']=_0x2b1e25;if(_0xe8814b[_0xe444('0x2d')][_0xe444('0x39')]){_0x304b33[_0xe444('0x3a')]=[{'all':!![]}];}return db[_0xe444('0x26')]['findAll'](_0x304b33);})[_0xe444('0x1d')](function(_0x19283c){_0x594b43[_0xe444('0x3b')]=_0x19283c;return _0x594b43;})[_0xe444('0x1d')](respondWithFilteredResult(_0x311989,_0x304b33))[_0xe444('0x3c')](handleError(_0x311989,null));};exports[_0xe444('0x3d')]=function(_0x62093c,_0x390ba0){var _0x16c249={'raw':!![],'where':{'id':_0x62093c['params']['id']}},_0x543bae={};_0x543bae['model']=_[_0xe444('0x2c')](db[_0xe444('0x26')][_0xe444('0x27')]);_0x543bae[_0xe444('0x2d')]=_[_0xe444('0x2c')](_0x62093c['query']);_0x543bae['filters']=_[_0xe444('0x2f')](_0x543bae[_0xe444('0x2b')],_0x543bae[_0xe444('0x2d')]);_0x16c249['attributes']=_[_0xe444('0x2f')](_0x543bae[_0xe444('0x2b')],qs[_0xe444('0x3e')](_0x62093c[_0xe444('0x2d')][_0xe444('0x3e')]));_0x16c249[_0xe444('0x30')]=_0x16c249['attributes']['length']?_0x16c249[_0xe444('0x30')]:_0x543bae[_0xe444('0x2b')];if(_0x62093c[_0xe444('0x2d')][_0xe444('0x39')]){_0x16c249['include']=[{'all':!![]}];}_0x16c249=_[_0xe444('0x37')]({},_0x16c249,_0x62093c[_0xe444('0x3f')]);return db[_0xe444('0x26')][_0xe444('0x40')](_0x16c249)[_0xe444('0x1d')](handleEntityNotFound(_0x390ba0,null))[_0xe444('0x1d')](respondWithResult(_0x390ba0,null))[_0xe444('0x3c')](handleError(_0x390ba0,null));};exports[_0xe444('0x41')]=function(_0x4ae871,_0x4315e8){return db[_0xe444('0x26')][_0xe444('0x41')](_0x4ae871['body'],{})[_0xe444('0x1d')](respondWithResult(_0x4315e8,0xc9))['catch'](handleError(_0x4315e8,null));};exports['update']=function(_0x4920a4,_0x3b2957){if(_0x4920a4[_0xe444('0x42')]['id']){delete _0x4920a4['body']['id'];}return db['JscriptyAnswerReport'][_0xe444('0x40')]({'where':{'id':_0x4920a4[_0xe444('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b2957,null))[_0xe444('0x1d')](saveUpdates(_0x4920a4[_0xe444('0x42')],null))[_0xe444('0x1d')](respondWithResult(_0x3b2957,null))['catch'](handleError(_0x3b2957,null));};exports[_0xe444('0x1e')]=function(_0x5ad4a8,_0xf40b55){return db[_0xe444('0x26')]['find']({'where':{'id':_0x5ad4a8['params']['id']}})[_0xe444('0x1d')](handleEntityNotFound(_0xf40b55,null))['then'](removeEntity(_0xf40b55,null))[_0xe444('0x3c')](handleError(_0xf40b55,null));};exports[_0xe444('0x44')]=function(_0x4b3b6e,_0x40997e){return db[_0xe444('0x26')][_0xe444('0x44')]()[_0xe444('0x1d')](respondWithResult(_0x40997e,null))[_0xe444('0x3c')](handleError(_0x40997e,null));}; \ No newline at end of file +var _0x7923=['util','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7923,0x8f));var _0x3792=function(_0x1dd4b4,_0x28e670){_0x1dd4b4=_0x1dd4b4-0x0;var _0x22ef0b=_0x7923[_0x1dd4b4];return _0x22ef0b;};'use strict';var emlformat=require(_0x3792('0x0'));var rimraf=require(_0x3792('0x1'));var zipdir=require(_0x3792('0x2'));var jsonpatch=require(_0x3792('0x3'));var rp=require(_0x3792('0x4'));var moment=require(_0x3792('0x5'));var BPromise=require(_0x3792('0x6'));var Mustache=require('mustache');var util=require(_0x3792('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3792('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3792('0x9'));var _=require(_0x3792('0xa'));var squel=require(_0x3792('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3792('0xc'));var toCsv=require(_0x3792('0x8'));var querystring=require('querystring');var Papa=require(_0x3792('0xd'));var Redis=require(_0x3792('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3792('0xf'));var as=require(_0x3792('0x10'));var hardwareService=require(_0x3792('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3792('0x12'));var config=require(_0x3792('0x13'));var licenseUtil=require(_0x3792('0x14'));var db=require(_0x3792('0x15'))['db'];function respondWithStatusCode(_0x5a6d8e,_0x506ec4){_0x506ec4=_0x506ec4||0xcc;return function(_0x3fed73){if(_0x3fed73){return _0x5a6d8e[_0x3792('0x16')](_0x506ec4);}return _0x5a6d8e[_0x3792('0x17')](_0x506ec4)[_0x3792('0x18')]();};}function respondWithResult(_0x10913e,_0x2b86ce){_0x2b86ce=_0x2b86ce||0xc8;return function(_0x41139d){if(_0x41139d){return _0x10913e[_0x3792('0x17')](_0x2b86ce)[_0x3792('0x19')](_0x41139d);}};}function respondWithFilteredResult(_0x11910c,_0x427b53){return function(_0x183c42){if(_0x183c42){var _0x4247cd=typeof _0x427b53[_0x3792('0x1a')]===_0x3792('0x1b')&&typeof _0x427b53[_0x3792('0x1c')]===_0x3792('0x1b');var _0x4a8e1c=_0x183c42[_0x3792('0x1d')];var _0x2547d8=_0x4247cd?0x0:_0x427b53[_0x3792('0x1a')];var _0x3893ed=_0x4247cd?_0x183c42[_0x3792('0x1d')]:_0x427b53['offset']+_0x427b53[_0x3792('0x1c')];var _0xc75467;if(_0x3893ed>=_0x4a8e1c){_0x3893ed=_0x4a8e1c;_0xc75467=0xc8;}else{_0xc75467=0xce;}_0x11910c[_0x3792('0x17')](_0xc75467);return _0x11910c[_0x3792('0x1e')](_0x3792('0x1f'),_0x2547d8+'-'+_0x3893ed+'/'+_0x4a8e1c)['json'](_0x183c42);}return null;};}function patchUpdates(_0x4cd50b){return function(_0x2c1f8a){try{jsonpatch[_0x3792('0x20')](_0x2c1f8a,_0x4cd50b,!![]);}catch(_0x4e0ba4){return BPromise[_0x3792('0x21')](_0x4e0ba4);}return _0x2c1f8a[_0x3792('0x22')]();};}function saveUpdates(_0x386b88,_0x5c2c70){return function(_0x4ca818){if(_0x4ca818){return _0x4ca818[_0x3792('0x23')](_0x386b88)[_0x3792('0x24')](function(_0x3fa77a){return _0x3fa77a;});}return null;};}function removeEntity(_0x7a0f3f,_0x54d99b){return function(_0x515dc0){if(_0x515dc0){return _0x515dc0['destroy']()[_0x3792('0x24')](function(){_0x7a0f3f[_0x3792('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530c04,_0x3bf510){return function(_0x2328fe){if(!_0x2328fe){_0x530c04[_0x3792('0x16')](0x194);}return _0x2328fe;};}function handleError(_0x516929,_0x54f42a){_0x54f42a=_0x54f42a||0x1f4;return function(_0x44499b){logger[_0x3792('0x25')](_0x44499b['stack']);if(_0x44499b['name']){delete _0x44499b[_0x3792('0x26')];}_0x516929[_0x3792('0x17')](_0x54f42a)[_0x3792('0x27')](_0x44499b);};}exports[_0x3792('0x28')]=function(_0x4ca06c,_0x4a2ab2){var _0x3d2091={},_0xcc56d5={},_0x3b9b67={'count':0x0,'rows':[]};var _0x2d3131=_[_0x3792('0x29')](db[_0x3792('0x2a')][_0x3792('0x2b')],function(_0x44cc37){return{'name':_0x44cc37[_0x3792('0x2c')],'type':_0x44cc37['type'][_0x3792('0x2d')]};});_0xcc56d5[_0x3792('0x2e')]=_[_0x3792('0x29')](_0x2d3131,_0x3792('0x26'));_0xcc56d5[_0x3792('0x2f')]=_['keys'](_0x4ca06c['query']);_0xcc56d5['filters']=_[_0x3792('0x30')](_0xcc56d5['model'],_0xcc56d5[_0x3792('0x2f')]);_0x3d2091['attributes']=_[_0x3792('0x30')](_0xcc56d5[_0x3792('0x2e')],qs[_0x3792('0x31')](_0x4ca06c[_0x3792('0x2f')]['fields']));_0x3d2091[_0x3792('0x32')]=_0x3d2091['attributes']['length']?_0x3d2091[_0x3792('0x32')]:_0xcc56d5[_0x3792('0x2e')];if(!_0x4ca06c[_0x3792('0x2f')][_0x3792('0x33')]('nolimit')){_0x3d2091['limit']=qs[_0x3792('0x1c')](_0x4ca06c[_0x3792('0x2f')][_0x3792('0x1c')]);_0x3d2091[_0x3792('0x1a')]=qs[_0x3792('0x1a')](_0x4ca06c[_0x3792('0x2f')]['offset']);}_0x3d2091[_0x3792('0x34')]=qs[_0x3792('0x35')](_0x4ca06c[_0x3792('0x2f')][_0x3792('0x35')]);_0x3d2091[_0x3792('0x36')]=qs[_0x3792('0x37')](_[_0x3792('0x38')](_0x4ca06c[_0x3792('0x2f')],_0xcc56d5['filters']),_0x2d3131);if(_0x4ca06c['query']['filter']){_0x3d2091[_0x3792('0x36')]=_[_0x3792('0x39')](_0x3d2091[_0x3792('0x36')],{'$or':_['map'](_0x2d3131,function(_0x4e8f4d){if(_0x4e8f4d[_0x3792('0x3a')]!==_0x3792('0x3b')){var _0x5d3f53={};_0x5d3f53[_0x4e8f4d[_0x3792('0x26')]]={'$like':'%'+_0x4ca06c[_0x3792('0x2f')][_0x3792('0x3c')]+'%'};return _0x5d3f53;}})});}_0x3d2091=_['merge']({},_0x3d2091,_0x4ca06c[_0x3792('0x3d')]);var _0x51d656={'where':_0x3d2091[_0x3792('0x36')]};return db[_0x3792('0x2a')][_0x3792('0x1d')](_0x51d656)['then'](function(_0x5fa8a7){_0x3b9b67[_0x3792('0x1d')]=_0x5fa8a7;if(_0x4ca06c[_0x3792('0x2f')][_0x3792('0x3e')]){_0x3d2091[_0x3792('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3792('0x40')](_0x3d2091);})[_0x3792('0x24')](function(_0x1d72ca){_0x3b9b67[_0x3792('0x41')]=_0x1d72ca;return _0x3b9b67;})['then'](respondWithFilteredResult(_0x4a2ab2,_0x3d2091))[_0x3792('0x42')](handleError(_0x4a2ab2,null));};exports[_0x3792('0x43')]=function(_0xef303,_0x4b8b54){var _0xaf6c79={'raw':!![],'where':{'id':_0xef303[_0x3792('0x44')]['id']}},_0x32f9a7={};_0x32f9a7[_0x3792('0x2e')]=_[_0x3792('0x45')](db[_0x3792('0x2a')][_0x3792('0x2b')]);_0x32f9a7[_0x3792('0x2f')]=_[_0x3792('0x45')](_0xef303[_0x3792('0x2f')]);_0x32f9a7[_0x3792('0x37')]=_[_0x3792('0x30')](_0x32f9a7[_0x3792('0x2e')],_0x32f9a7[_0x3792('0x2f')]);_0xaf6c79[_0x3792('0x32')]=_[_0x3792('0x30')](_0x32f9a7[_0x3792('0x2e')],qs[_0x3792('0x31')](_0xef303[_0x3792('0x2f')][_0x3792('0x31')]));_0xaf6c79[_0x3792('0x32')]=_0xaf6c79[_0x3792('0x32')]['length']?_0xaf6c79[_0x3792('0x32')]:_0x32f9a7['model'];if(_0xef303[_0x3792('0x2f')][_0x3792('0x3e')]){_0xaf6c79[_0x3792('0x3f')]=[{'all':!![]}];}_0xaf6c79=_['merge']({},_0xaf6c79,_0xef303[_0x3792('0x3d')]);return db[_0x3792('0x2a')]['find'](_0xaf6c79)[_0x3792('0x24')](handleEntityNotFound(_0x4b8b54,null))[_0x3792('0x24')](respondWithResult(_0x4b8b54,null))[_0x3792('0x42')](handleError(_0x4b8b54,null));};exports[_0x3792('0x46')]=function(_0x19d0b7,_0x172f47){return db[_0x3792('0x2a')][_0x3792('0x46')](_0x19d0b7[_0x3792('0x47')],{})[_0x3792('0x24')](respondWithResult(_0x172f47,0xc9))[_0x3792('0x42')](handleError(_0x172f47,null));};exports[_0x3792('0x23')]=function(_0x37e5fc,_0x246143){if(_0x37e5fc[_0x3792('0x47')]['id']){delete _0x37e5fc[_0x3792('0x47')]['id'];}return db[_0x3792('0x2a')][_0x3792('0x48')]({'where':{'id':_0x37e5fc[_0x3792('0x44')]['id']}})[_0x3792('0x24')](handleEntityNotFound(_0x246143,null))[_0x3792('0x24')](saveUpdates(_0x37e5fc[_0x3792('0x47')],null))[_0x3792('0x24')](respondWithResult(_0x246143,null))[_0x3792('0x42')](handleError(_0x246143,null));};exports[_0x3792('0x49')]=function(_0x536d53,_0x4c2b46){return db['JscriptyAnswerReport'][_0x3792('0x48')]({'where':{'id':_0x536d53[_0x3792('0x44')]['id']}})[_0x3792('0x24')](handleEntityNotFound(_0x4c2b46,null))['then'](removeEntity(_0x4c2b46,null))[_0x3792('0x42')](handleError(_0x4c2b46,null));};exports[_0x3792('0x4a')]=function(_0x3fe0d8,_0x1da217){return db[_0x3792('0x2a')]['describe']()[_0x3792('0x24')](respondWithResult(_0x1da217,null))[_0x3792('0x42')](handleError(_0x1da217,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c4e4848..986b6fa 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 _0x58b8=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','lodash','util'];(function(_0x17a2af,_0x34449a){var _0x5d2e1b=function(_0x599548){while(--_0x599548){_0x17a2af['push'](_0x17a2af['shift']());}};_0x5d2e1b(++_0x34449a);}(_0x58b8,0x1db));var _0x858b=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x58b8[_0x2c0ded];return _0x4473e5;};'use strict';var _=require(_0x858b('0x0'));var util=require(_0x858b('0x1'));var logger=require(_0x858b('0x2'))(_0x858b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x858b('0x4'));var fs=require('fs');var path=require(_0x858b('0x5'));var rimraf=require(_0x858b('0x6'));var config=require(_0x858b('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x4b90b1,_0x509b8c){return _0x4b90b1[_0x858b('0x8')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4116=['util','../../config/logger','api','moment','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports','report_jscripty_answers','lodash'];(function(_0xa218ce,_0x14f482){var _0x481521=function(_0x2a51a0){while(--_0x2a51a0){_0xa218ce['push'](_0xa218ce['shift']());}};_0x481521(++_0x14f482);}(_0x4116,0x1cb));var _0x6411=function(_0x307060,_0x26dc3d){_0x307060=_0x307060-0x0;var _0x3a2587=_0x4116[_0x307060];return _0x3a2587;};'use strict';var _=require(_0x6411('0x0'));var util=require(_0x6411('0x1'));var logger=require(_0x6411('0x2'))(_0x6411('0x3'));var moment=require(_0x6411('0x4'));var BPromise=require('bluebird');var rp=require(_0x6411('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6411('0x6'));var config=require('../../config/environment');var attributes=require(_0x6411('0x7'));module[_0x6411('0x8')]=function(_0x30bab1,_0x53c8be){return _0x30bab1['define']('JscriptyAnswerReport',attributes,{'tableName':_0x6411('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index bcefc7f..e0be3e4 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 _0xe37e=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe37e,0x14d));var _0xee37=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xe37e[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0xee37('0x0'));var util=require(_0xee37('0x1'));var moment=require(_0xee37('0x2'));var BPromise=require(_0xee37('0x3'));var rs=require(_0xee37('0x4'));var fs=require('fs');var Redis=require(_0xee37('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xee37('0x6'));var logger=require(_0xee37('0x7'))(_0xee37('0x8'));var config=require(_0xee37('0x9'));var jayson=require(_0xee37('0xa'));var client=jayson['client'][_0xee37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x503718,_0x5c3c7c,_0x4eeb52){return new BPromise(function(_0x34d4e2,_0x114729){return client[_0xee37('0xc')](_0x503718,_0x4eeb52)[_0xee37('0xd')](function(_0x16dbd3){logger[_0xee37('0xe')](_0xee37('0xf'),_0x5c3c7c,_0xee37('0x10'));logger['debug'](_0xee37('0x11'),_0x5c3c7c,_0xee37('0x10'),JSON[_0xee37('0x12')](_0x16dbd3));if(_0x16dbd3['error']){if(_0x16dbd3[_0xee37('0x13')]['code']===0x1f4){logger[_0xee37('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5c3c7c,_0x16dbd3[_0xee37('0x13')][_0xee37('0x14')]);return _0x114729(_0x16dbd3[_0xee37('0x13')][_0xee37('0x14')]);}logger[_0xee37('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5c3c7c,_0x16dbd3[_0xee37('0x13')]['message']);return _0x34d4e2(_0x16dbd3['error']['message']);}else{logger[_0xee37('0xe')](_0xee37('0xf'),_0x5c3c7c,_0xee37('0x10'));_0x34d4e2(_0x16dbd3[_0xee37('0x15')][_0xee37('0x14')]);}})[_0xee37('0x16')](function(_0x308114){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5c3c7c,_0x308114);_0x114729(_0x308114);});});} \ No newline at end of file +var _0x1240=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1240,0x17f));var _0x0124=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x1240[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0x0124('0x0'));var util=require(_0x0124('0x1'));var moment=require(_0x0124('0x2'));var BPromise=require(_0x0124('0x3'));var rs=require(_0x0124('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0124('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0124('0x6'))('rpc');var config=require(_0x0124('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0124('0x8')][_0x0124('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a8eb8,_0x119294,_0xf9833a){return new BPromise(function(_0x2455c1,_0xfdf369){return client[_0x0124('0xa')](_0x3a8eb8,_0xf9833a)[_0x0124('0xb')](function(_0x3b998d){logger['info'](_0x0124('0xc'),_0x119294,_0x0124('0xd'));logger['debug'](_0x0124('0xe'),_0x119294,'request\x20sent',JSON[_0x0124('0xf')](_0x3b998d));if(_0x3b998d[_0x0124('0x10')]){if(_0x3b998d[_0x0124('0x10')]['code']===0x1f4){logger[_0x0124('0x10')](_0x0124('0xc'),_0x119294,_0x3b998d['error'][_0x0124('0x11')]);return _0xfdf369(_0x3b998d[_0x0124('0x10')][_0x0124('0x11')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x119294,_0x3b998d[_0x0124('0x10')][_0x0124('0x11')]);return _0x2455c1(_0x3b998d['error'][_0x0124('0x11')]);}else{logger[_0x0124('0x12')](_0x0124('0xc'),_0x119294,_0x0124('0xd'));_0x2455c1(_0x3b998d[_0x0124('0x13')]['message']);}})[_0x0124('0x14')](function(_0x28f658){logger[_0x0124('0x10')](_0x0124('0xc'),_0x119294,_0x28f658);_0xfdf369(_0x28f658);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8dca78b..5515050 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 _0xb97e=['isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','put','/:id','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','./jscriptyProject.controller','index','get'];(function(_0x192b76,_0x38d22a){var _0x468419=function(_0x201ae2){while(--_0x201ae2){_0x192b76['push'](_0x192b76['shift']());}};_0x468419(++_0x38d22a);}(_0xb97e,0x1f2));var _0xeb97=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xb97e[_0x2d9c6a];return _0xf3c918;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb97('0x0'));var timeout=require(_0xeb97('0x1'));var express=require('express');var router=express[_0xeb97('0x2')]();var fs_extra=require(_0xeb97('0x3'));var auth=require(_0xeb97('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb97('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xeb97('0x6')]);router[_0xeb97('0x7')]('/:id',auth[_0xeb97('0x8')](),controller[_0xeb97('0x9')]);router[_0xeb97('0x7')]('/:id/sessions',auth[_0xeb97('0x8')](),controller[_0xeb97('0xa')]);router[_0xeb97('0x7')](_0xeb97('0xb'),auth[_0xeb97('0x8')](),controller[_0xeb97('0xc')]);router[_0xeb97('0x7')](_0xeb97('0xd'),auth[_0xeb97('0x8')](),timeout(_0xeb97('0xe')),controller[_0xeb97('0xf')]);router[_0xeb97('0x10')]('/',auth[_0xeb97('0x8')](),controller['create']);router['post']('/:id/clone',auth[_0xeb97('0x8')](),controller['clone']);router[_0xeb97('0x11')](_0xeb97('0x12'),auth[_0xeb97('0x8')](),controller[_0xeb97('0x13')]);router[_0xeb97('0x14')]('/:id',auth[_0xeb97('0x8')](),controller[_0xeb97('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3db7=['get','index','/:id','isAuthenticated','/:id/answers','getAnswers','30s','getSummary','create','post','/:id/clone','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3db7,0x12e));var _0x73db=function(_0xbb5842,_0x53f197){_0xbb5842=_0xbb5842-0x0;var _0x1b5933=_0x3db7[_0xbb5842];return _0x1b5933;};'use strict';var multer=require(_0x73db('0x0'));var util=require(_0x73db('0x1'));var path=require(_0x73db('0x2'));var timeout=require(_0x73db('0x3'));var express=require(_0x73db('0x4'));var router=express[_0x73db('0x5')]();var fs_extra=require(_0x73db('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x73db('0x7'));var config=require(_0x73db('0x8'));var controller=require(_0x73db('0x9'));router[_0x73db('0xa')]('/',auth['isAuthenticated'](),controller[_0x73db('0xb')]);router[_0x73db('0xa')](_0x73db('0xc'),auth[_0x73db('0xd')](),controller['show']);router[_0x73db('0xa')]('/:id/sessions',auth[_0x73db('0xd')](),controller['getSessions']);router[_0x73db('0xa')](_0x73db('0xe'),auth[_0x73db('0xd')](),controller[_0x73db('0xf')]);router[_0x73db('0xa')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x73db('0x10')),controller[_0x73db('0x11')]);router['post']('/',auth[_0x73db('0xd')](),controller[_0x73db('0x12')]);router[_0x73db('0x13')](_0x73db('0x14'),auth['isAuthenticated'](),controller['clone']);router['put'](_0x73db('0xc'),auth['isAuthenticated'](),controller[_0x73db('0x15')]);router[_0x73db('0x16')](_0x73db('0xc'),auth[_0x73db('0xd')](),controller[_0x73db('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index fa7d2cb..91e0ead 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 _0x93be=['long','isObjectLike','stringify','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','TEXT'];(function(_0x163673,_0x552ab4){var _0x2a298f=function(_0x41079e){while(--_0x41079e){_0x163673['push'](_0x163673['shift']());}};_0x2a298f(++_0x552ab4);}(_0x93be,0x6a));var _0xe93b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x93be[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xe93b('0x0'));var _=require(_0xe93b('0x1'));var util=require(_0xe93b('0x2'));module['exports']={'name':{'type':Sequelize[_0xe93b('0x3')],'unique':_0xe93b('0x4')},'description':{'type':Sequelize[_0xe93b('0x3')]},'formData':{'type':Sequelize[_0xe93b('0x5')](_0xe93b('0x6')),'set':function(_0x2808a4){if(_[_0xe93b('0x7')](_0x2808a4)){this['setDataValue']('formData',JSON[_0xe93b('0x8')](_0x2808a4));}else if(_['isString'](_0x2808a4)){this[_0xe93b('0x9')](_0xe93b('0xa'),_0x2808a4);}else{this[_0xe93b('0x9')]('formData',util[_0xe93b('0xb')](_0xe93b('0xc'),this[_0xe93b('0xd')](_0xe93b('0x4'))||'',this[_0xe93b('0xd')](_0xe93b('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe93b('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe93b('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x9b2a=['STRING','name','TEXT','isObjectLike','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','util'];(function(_0x4145ed,_0x6c43c){var _0x21115f=function(_0x4b155a){while(--_0x4b155a){_0x4145ed['push'](_0x4145ed['shift']());}};_0x21115f(++_0x6c43c);}(_0x9b2a,0xdb));var _0xa9b2=function(_0x31e6aa,_0x5c0f59){_0x31e6aa=_0x31e6aa-0x0;var _0x44f02a=_0x9b2a[_0x31e6aa];return _0x44f02a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xa9b2('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9b2('0x1')],'unique':_0xa9b2('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa9b2('0x3')]('long'),'set':function(_0x4dd273){if(_[_0xa9b2('0x4')](_0x4dd273)){this[_0xa9b2('0x5')](_0xa9b2('0x6'),JSON['stringify'](_0x4dd273));}else if(_[_0xa9b2('0x7')](_0x4dd273)){this[_0xa9b2('0x5')](_0xa9b2('0x6'),_0x4dd273);}else{this[_0xa9b2('0x5')](_0xa9b2('0x6'),util['format'](_0xa9b2('0x8'),this[_0xa9b2('0x9')](_0xa9b2('0x2'))||'',this[_0xa9b2('0x9')](_0xa9b2('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 5ea1185..356587a 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 _0xb477=['nolimit','pick','ProjectId','getAnswers','JscriptyAnswerReport','indexOf','toString','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','UserProfileSection','params','findOne','JscriptySessionReport'];(function(_0x2e9682,_0x2b5c37){var _0x401c38=function(_0x5dd156){while(--_0x5dd156){_0x2e9682['push'](_0x2e9682['shift']());}};_0x401c38(++_0x2b5c37);}(_0xb477,0x8f));var _0x7b47=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb477[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b47('0x0'));var zipdir=require(_0x7b47('0x1'));var jsonpatch=require(_0x7b47('0x2'));var rp=require('request-promise');var moment=require(_0x7b47('0x3'));var BPromise=require(_0x7b47('0x4'));var Mustache=require(_0x7b47('0x5'));var util=require('util');var path=require(_0x7b47('0x6'));var sox=require(_0x7b47('0x7'));var csv=require(_0x7b47('0x8'));var ejs=require(_0x7b47('0x9'));var fs=require('fs');var fs_extra=require(_0x7b47('0xa'));var _=require('lodash');var squel=require(_0x7b47('0xb'));var crypto=require(_0x7b47('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b47('0xd'));var toCsv=require(_0x7b47('0x8'));var querystring=require(_0x7b47('0xe'));var Papa=require(_0x7b47('0xf'));var Redis=require(_0x7b47('0x10'));var authService=require(_0x7b47('0x11'));var qs=require(_0x7b47('0x12'));var as=require(_0x7b47('0x13'));var hardwareService=require(_0x7b47('0x14'));var logger=require(_0x7b47('0x15'))(_0x7b47('0x16'));var utils=require(_0x7b47('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7b47('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509bac,_0x5ad505){_0x5ad505=_0x5ad505||0xcc;return function(_0x1e4e3d){if(_0x1e4e3d){return _0x509bac[_0x7b47('0x19')](_0x5ad505);}return _0x509bac[_0x7b47('0x1a')](_0x5ad505)[_0x7b47('0x1b')]();};}function respondWithResult(_0x335416,_0x128999){_0x128999=_0x128999||0xc8;return function(_0x5923fd){if(_0x5923fd){return _0x335416[_0x7b47('0x1a')](_0x128999)[_0x7b47('0x1c')](_0x5923fd);}};}function respondWithFilteredResult(_0x23bc3f,_0x56aaa8){return function(_0x11be4f){if(_0x11be4f){var _0x124db3=typeof _0x56aaa8[_0x7b47('0x1d')]===_0x7b47('0x1e')&&typeof _0x56aaa8['limit']===_0x7b47('0x1e');var _0x1af5db=_0x11be4f[_0x7b47('0x1f')];var _0x1f5972=_0x124db3?0x0:_0x56aaa8['offset'];var _0x2ba858=_0x124db3?_0x11be4f['count']:_0x56aaa8[_0x7b47('0x1d')]+_0x56aaa8['limit'];var _0x4dd8d5;if(_0x2ba858>=_0x1af5db){_0x2ba858=_0x1af5db;_0x4dd8d5=0xc8;}else{_0x4dd8d5=0xce;}_0x23bc3f['status'](_0x4dd8d5);return _0x23bc3f[_0x7b47('0x20')]('Content-Range',_0x1f5972+'-'+_0x2ba858+'/'+_0x1af5db)[_0x7b47('0x1c')](_0x11be4f);}return null;};}function patchUpdates(_0x5ea6df){return function(_0xfa32d8){try{jsonpatch[_0x7b47('0x21')](_0xfa32d8,_0x5ea6df,!![]);}catch(_0x57a2a2){return BPromise[_0x7b47('0x22')](_0x57a2a2);}return _0xfa32d8[_0x7b47('0x23')]();};}function saveUpdates(_0x3a8fd5,_0x33562b){return function(_0x2e6a15){if(_0x2e6a15){return _0x2e6a15[_0x7b47('0x24')](_0x3a8fd5)[_0x7b47('0x25')](function(_0x3ca995){return _0x3ca995;});}return null;};}function removeEntity(_0x244bf4,_0x56886b){return function(_0x9aedc8){if(_0x9aedc8){return _0x9aedc8[_0x7b47('0x26')]()[_0x7b47('0x25')](function(){var _0x7b8327=_0x9aedc8[_0x7b47('0x27')]({'plain':!![]});var _0x2f960d=_0x7b47('0x28');return db[_0x7b47('0x29')][_0x7b47('0x26')]({'where':{'type':_0x2f960d,'resourceId':_0x7b8327['id']}})['then'](function(){return _0x9aedc8;});})['then'](function(){_0x244bf4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x847ad2,_0x1017de){return function(_0x1ea575){if(!_0x1ea575){_0x847ad2[_0x7b47('0x19')](0x194);}return _0x1ea575;};}function handleError(_0x5705e2,_0x2bbf1b){_0x2bbf1b=_0x2bbf1b||0x1f4;return function(_0x285e12){logger[_0x7b47('0x2a')](_0x285e12[_0x7b47('0x2b')]);if(_0x285e12[_0x7b47('0x2c')]){delete _0x285e12[_0x7b47('0x2c')];}_0x5705e2[_0x7b47('0x1a')](_0x2bbf1b)[_0x7b47('0x2d')](_0x285e12);};}exports[_0x7b47('0x2e')]=function(_0x5b6fd5,_0x4cc8a3){var _0x592b98={},_0x345016={},_0xd56a68={'count':0x0,'rows':[]};var _0x469970=_[_0x7b47('0x2f')](db[_0x7b47('0x30')][_0x7b47('0x31')],function(_0x5591a7){return{'name':_0x5591a7[_0x7b47('0x32')],'type':_0x5591a7[_0x7b47('0x33')][_0x7b47('0x34')]};});_0x345016[_0x7b47('0x35')]=_['map'](_0x469970,_0x7b47('0x2c'));_0x345016[_0x7b47('0x36')]=_['keys'](_0x5b6fd5[_0x7b47('0x36')]);_0x345016[_0x7b47('0x37')]=_[_0x7b47('0x38')](_0x345016[_0x7b47('0x35')],_0x345016[_0x7b47('0x36')]);_0x592b98[_0x7b47('0x39')]=_[_0x7b47('0x38')](_0x345016['model'],qs['fields'](_0x5b6fd5[_0x7b47('0x36')]['fields']));_0x592b98[_0x7b47('0x39')]=_0x592b98[_0x7b47('0x39')][_0x7b47('0x3a')]?_0x592b98[_0x7b47('0x39')]:_0x345016[_0x7b47('0x35')];if(!_0x5b6fd5[_0x7b47('0x36')][_0x7b47('0x3b')]('nolimit')){_0x592b98[_0x7b47('0x3c')]=qs['limit'](_0x5b6fd5['query'][_0x7b47('0x3c')]);_0x592b98[_0x7b47('0x1d')]=qs['offset'](_0x5b6fd5[_0x7b47('0x36')][_0x7b47('0x1d')]);}_0x592b98[_0x7b47('0x3d')]=qs[_0x7b47('0x3e')](_0x5b6fd5[_0x7b47('0x36')][_0x7b47('0x3e')]);_0x592b98[_0x7b47('0x3f')]=qs[_0x7b47('0x37')](_['pick'](_0x5b6fd5[_0x7b47('0x36')],_0x345016['filters']),_0x469970);if(_0x5b6fd5[_0x7b47('0x36')][_0x7b47('0x40')]){_0x592b98[_0x7b47('0x3f')]=_[_0x7b47('0x41')](_0x592b98['where'],{'$or':_[_0x7b47('0x2f')](_0x469970,function(_0x3485fc){if(_0x3485fc[_0x7b47('0x33')]!==_0x7b47('0x42')){var _0x3db41f={};_0x3db41f[_0x3485fc['name']]={'$like':'%'+_0x5b6fd5[_0x7b47('0x36')]['filter']+'%'};return _0x3db41f;}})});}_0x592b98=_['merge']({},_0x592b98,_0x5b6fd5[_0x7b47('0x43')]);var _0x1b4a61={'where':_0x592b98['where']};return db[_0x7b47('0x30')][_0x7b47('0x1f')](_0x1b4a61)[_0x7b47('0x25')](function(_0xddddd2){_0xd56a68[_0x7b47('0x1f')]=_0xddddd2;if(_0x5b6fd5['query'][_0x7b47('0x44')]){_0x592b98['include']=[{'all':!![]}];}return db[_0x7b47('0x30')][_0x7b47('0x45')](_0x592b98);})[_0x7b47('0x25')](function(_0x189677){_0xd56a68[_0x7b47('0x46')]=_0x189677;return _0xd56a68;})[_0x7b47('0x25')](respondWithFilteredResult(_0x4cc8a3,_0x592b98))[_0x7b47('0x47')](handleError(_0x4cc8a3,null));};exports[_0x7b47('0x48')]=function(_0x53e504,_0x319839){var _0x98c66d={'raw':![],'where':{'id':_0x53e504['params']['id']}},_0x125a1e={};_0x125a1e[_0x7b47('0x35')]=_[_0x7b47('0x49')](db[_0x7b47('0x30')][_0x7b47('0x31')]);_0x125a1e['query']=_[_0x7b47('0x49')](_0x53e504[_0x7b47('0x36')]);_0x125a1e[_0x7b47('0x37')]=_['intersection'](_0x125a1e[_0x7b47('0x35')],_0x125a1e[_0x7b47('0x36')]);_0x98c66d[_0x7b47('0x39')]=_['intersection'](_0x125a1e[_0x7b47('0x35')],qs[_0x7b47('0x4a')](_0x53e504[_0x7b47('0x36')][_0x7b47('0x4a')]));_0x98c66d[_0x7b47('0x39')]=_0x98c66d[_0x7b47('0x39')][_0x7b47('0x3a')]?_0x98c66d['attributes']:_0x125a1e[_0x7b47('0x35')];if(_0x53e504[_0x7b47('0x36')]['includeAll']){_0x98c66d[_0x7b47('0x4b')]=[{'all':!![]}];}_0x98c66d=_[_0x7b47('0x41')]({},_0x98c66d,_0x53e504[_0x7b47('0x43')]);return db['JscriptyProject'][_0x7b47('0x4c')](_0x98c66d)[_0x7b47('0x25')](handleEntityNotFound(_0x319839,null))[_0x7b47('0x25')](respondWithResult(_0x319839,null))['catch'](handleError(_0x319839,null));};exports[_0x7b47('0x4d')]=function(_0x5c4367,_0xf11740){return db[_0x7b47('0x30')][_0x7b47('0x4d')](_0x5c4367[_0x7b47('0x4e')],{})['then'](function(_0x364631){var _0x5a145b=_0x5c4367[_0x7b47('0x4f')]['get']({'plain':!![]});if(!_0x5a145b)throw new Error(_0x7b47('0x50'));if(_0x5a145b[_0x7b47('0x51')]===_0x7b47('0x4f')){var _0x4db0d4=_0x364631[_0x7b47('0x27')]({'plain':!![]});var _0x1e2dc8=_0x7b47('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1e2dc8,'userProfileId':_0x5a145b['userProfileId']},'raw':!![]})[_0x7b47('0x25')](function(_0x4cdc78){if(_0x4cdc78&&_0x4cdc78[_0x7b47('0x52')]===0x0){return db[_0x7b47('0x29')][_0x7b47('0x4d')]({'name':_0x4db0d4[_0x7b47('0x2c')],'resourceId':_0x4db0d4['id'],'type':_0x4cdc78['name'],'sectionId':_0x4cdc78['id']},{})['then'](function(){return _0x364631;});}else{return _0x364631;}})[_0x7b47('0x47')](function(_0x4803e8){logger[_0x7b47('0x2a')](_0x7b47('0x53'),_0x4803e8);throw _0x4803e8;});}return _0x364631;})[_0x7b47('0x25')](respondWithResult(_0xf11740,0xc9))[_0x7b47('0x47')](handleError(_0xf11740,null));};exports[_0x7b47('0x54')]=function(_0x2e8b75,_0x25091f){var _0x3d2953={'where':{'id':_0x2e8b75['params']['id']}},_0x42bdef={};_0x42bdef[_0x7b47('0x35')]=_[_0x7b47('0x49')](db[_0x7b47('0x30')][_0x7b47('0x31')]);_0x3d2953[_0x7b47('0x39')]=_[_0x7b47('0x38')](_0x42bdef['model'],qs[_0x7b47('0x4a')](_0x2e8b75[_0x7b47('0x36')][_0x7b47('0x4a')]));_0x3d2953[_0x7b47('0x39')]=_0x3d2953[_0x7b47('0x39')][_0x7b47('0x3a')]?_0x3d2953[_0x7b47('0x39')]:_0x42bdef[_0x7b47('0x35')];if(_0x2e8b75['query'][_0x7b47('0x44')]){_0x3d2953[_0x7b47('0x4b')]=[{'all':!![]}];}_0x3d2953=_['merge']({},_0x3d2953,_0x2e8b75['options']);return db[_0x7b47('0x30')][_0x7b47('0x4c')](_0x3d2953)[_0x7b47('0x25')](handleEntityNotFound(_0x25091f,null))[_0x7b47('0x25')](function(_0x3eef8b){if(_0x3eef8b){var _0x329882=_0x3eef8b['get']({'plain':!![]});_0x329882=qs['omit'](_0x329882,['id',_0x7b47('0x55'),_0x7b47('0x56')]);_0x2e8b75[_0x7b47('0x4e')]=_['omit'](_0x2e8b75[_0x7b47('0x4e')],['id','createdAt','updatedAt']);return db[_0x7b47('0x30')]['create'](_[_0x7b47('0x41')](_0x329882,_0x2e8b75[_0x7b47('0x4e')]),{'include':_0x2e8b75[_0x7b47('0x36')][_0x7b47('0x44')]?[{'all':!![]}]:undefined})[_0x7b47('0x25')](function(_0x3b432f){var _0x1379a6=_0x2e8b75['user'][_0x7b47('0x27')]({'plain':!![]});if(!_0x1379a6)throw new Error(_0x7b47('0x50'));if(_0x1379a6['role']===_0x7b47('0x4f')){var _0x146991=_0x3b432f[_0x7b47('0x27')]({'plain':!![]});var _0x5cdca6=_0x7b47('0x28');return db[_0x7b47('0x57')][_0x7b47('0x4c')]({'where':{'name':_0x5cdca6,'userProfileId':_0x1379a6['userProfileId']},'raw':!![]})['then'](function(_0x3d2d8a){if(_0x3d2d8a&&_0x3d2d8a[_0x7b47('0x52')]===0x0){return db['UserProfileResource'][_0x7b47('0x4d')]({'name':_0x146991['name'],'resourceId':_0x146991['id'],'type':_0x3d2d8a['name'],'sectionId':_0x3d2d8a['id']},{})[_0x7b47('0x25')](function(){return _0x3b432f;});}else{return _0x3b432f;}})['catch'](function(_0x14c023){logger['error'](_0x7b47('0x53'),_0x14c023);throw _0x14c023;});}return _0x3b432f;});}})[_0x7b47('0x25')](respondWithResult(_0x25091f,0xc9))[_0x7b47('0x47')](handleError(_0x25091f,null));};exports[_0x7b47('0x24')]=function(_0x4fe891,_0x5b7537){if(_0x4fe891[_0x7b47('0x4e')]['id']){delete _0x4fe891[_0x7b47('0x4e')]['id'];}return db[_0x7b47('0x30')]['find']({'where':{'id':_0x4fe891['params']['id']}})[_0x7b47('0x25')](handleEntityNotFound(_0x5b7537,null))[_0x7b47('0x25')](saveUpdates(_0x4fe891[_0x7b47('0x4e')],null))[_0x7b47('0x25')](respondWithResult(_0x5b7537,null))[_0x7b47('0x47')](handleError(_0x5b7537,null));};exports['destroy']=function(_0x46d79f,_0x5dcd5d){return db[_0x7b47('0x30')][_0x7b47('0x4c')]({'where':{'id':_0x46d79f[_0x7b47('0x58')]['id']}})[_0x7b47('0x25')](handleEntityNotFound(_0x5dcd5d,null))[_0x7b47('0x25')](removeEntity(_0x5dcd5d,null))[_0x7b47('0x47')](handleError(_0x5dcd5d,null));};exports['getSessions']=function(_0x1266ba,_0x459cb5,_0x4a8eea){var _0x41dc89={'raw':!![],'where':{}};var _0x3d81b6={};var _0x45ce3c={'count':0x0,'rows':[]};return db[_0x7b47('0x30')][_0x7b47('0x59')]({'where':{'id':_0x1266ba['params']['id']}})[_0x7b47('0x25')](handleEntityNotFound(_0x459cb5,null))[_0x7b47('0x25')](function(_0x594e7a){if(_0x594e7a){_0x3d81b6['model']=_[_0x7b47('0x49')](db[_0x7b47('0x5a')][_0x7b47('0x31')]);_0x3d81b6[_0x7b47('0x36')]=_[_0x7b47('0x49')](_0x1266ba[_0x7b47('0x36')]);_0x3d81b6[_0x7b47('0x37')]=_[_0x7b47('0x38')](_0x3d81b6['model'],_0x3d81b6[_0x7b47('0x36')]);_0x41dc89[_0x7b47('0x39')]=_[_0x7b47('0x38')](_0x3d81b6[_0x7b47('0x35')],qs[_0x7b47('0x4a')](_0x1266ba[_0x7b47('0x36')]['fields']));_0x41dc89[_0x7b47('0x39')]=_0x41dc89[_0x7b47('0x39')][_0x7b47('0x3a')]?_0x41dc89['attributes']:_0x3d81b6['model'];if(!_0x1266ba[_0x7b47('0x36')][_0x7b47('0x3b')](_0x7b47('0x5b'))){_0x41dc89[_0x7b47('0x3c')]=qs[_0x7b47('0x3c')](_0x1266ba[_0x7b47('0x36')][_0x7b47('0x3c')]);_0x41dc89[_0x7b47('0x1d')]=qs[_0x7b47('0x1d')](_0x1266ba['query'][_0x7b47('0x1d')]);}_0x41dc89[_0x7b47('0x3d')]=qs[_0x7b47('0x3e')](_0x1266ba['query'][_0x7b47('0x3e')]);_0x41dc89[_0x7b47('0x3f')]=qs[_0x7b47('0x37')](_[_0x7b47('0x5c')](_0x1266ba[_0x7b47('0x36')],_0x3d81b6[_0x7b47('0x37')]));_0x41dc89['where'][_0x7b47('0x5d')]=_0x594e7a['id'];if(_0x1266ba[_0x7b47('0x36')]['filter']){_0x41dc89[_0x7b47('0x3f')]=_[_0x7b47('0x41')](_0x41dc89['where'],{'$or':_['map'](_0x41dc89[_0x7b47('0x39')],function(_0x490bb8){var _0x4af4bd={};_0x4af4bd[_0x490bb8]={'$like':'%'+_0x1266ba[_0x7b47('0x36')]['filter']+'%'};return _0x4af4bd;})});}_0x41dc89=_[_0x7b47('0x41')]({},_0x41dc89,_0x1266ba[_0x7b47('0x43')]);return db[_0x7b47('0x5a')][_0x7b47('0x1f')]({'where':_0x41dc89[_0x7b47('0x3f')]})[_0x7b47('0x25')](function(_0x276dee){_0x45ce3c['count']=_0x276dee;if(_0x1266ba[_0x7b47('0x36')][_0x7b47('0x44')]){_0x41dc89[_0x7b47('0x4b')]=[{'all':!![]}];}return db[_0x7b47('0x5a')][_0x7b47('0x45')](_0x41dc89);})[_0x7b47('0x25')](function(_0x593c7e){_0x45ce3c[_0x7b47('0x46')]=_0x593c7e;return _0x45ce3c;});}})[_0x7b47('0x25')](respondWithFilteredResult(_0x459cb5,_0x41dc89))[_0x7b47('0x47')](handleError(_0x459cb5,null));};exports[_0x7b47('0x5e')]=function(_0x27de31,_0x2d8a08,_0x4e2b4d){var _0x5cd62f={'raw':!![],'where':{}};var _0xc0f74e={};var _0x426ee2={'count':0x0,'rows':[]};return db[_0x7b47('0x30')]['findOne']({'where':{'id':_0x27de31[_0x7b47('0x58')]['id']}})[_0x7b47('0x25')](handleEntityNotFound(_0x2d8a08,null))[_0x7b47('0x25')](function(_0x15d98f){if(_0x15d98f){_0xc0f74e['model']=_[_0x7b47('0x49')](db['JscriptyAnswerReport']['rawAttributes']);_0xc0f74e[_0x7b47('0x36')]=_[_0x7b47('0x49')](_0x27de31[_0x7b47('0x36')]);_0xc0f74e[_0x7b47('0x37')]=_[_0x7b47('0x38')](_0xc0f74e[_0x7b47('0x35')],_0xc0f74e[_0x7b47('0x36')]);_0x5cd62f[_0x7b47('0x39')]=_[_0x7b47('0x38')](_0xc0f74e['model'],qs[_0x7b47('0x4a')](_0x27de31[_0x7b47('0x36')][_0x7b47('0x4a')]));_0x5cd62f['attributes']=_0x5cd62f[_0x7b47('0x39')][_0x7b47('0x3a')]?_0x5cd62f[_0x7b47('0x39')]:_0xc0f74e['model'];if(!_0x27de31[_0x7b47('0x36')][_0x7b47('0x3b')](_0x7b47('0x5b'))){_0x5cd62f[_0x7b47('0x3c')]=qs['limit'](_0x27de31['query'][_0x7b47('0x3c')]);_0x5cd62f['offset']=qs['offset'](_0x27de31[_0x7b47('0x36')][_0x7b47('0x1d')]);}_0x5cd62f['order']=qs[_0x7b47('0x3e')](_0x27de31[_0x7b47('0x36')][_0x7b47('0x3e')]);_0x5cd62f['where']=qs[_0x7b47('0x37')](_['pick'](_0x27de31[_0x7b47('0x36')],_0xc0f74e['filters']));_0x5cd62f['where'][_0x7b47('0x5d')]=_0x15d98f['id'];if(_0x27de31['query'][_0x7b47('0x40')]){_0x5cd62f[_0x7b47('0x3f')]=_[_0x7b47('0x41')](_0x5cd62f[_0x7b47('0x3f')],{'$or':_[_0x7b47('0x2f')](_0x5cd62f['attributes'],function(_0x33c457){var _0x32aff1={};_0x32aff1[_0x33c457]={'$like':'%'+_0x27de31[_0x7b47('0x36')]['filter']+'%'};return _0x32aff1;})});}_0x5cd62f=_[_0x7b47('0x41')]({},_0x5cd62f,_0x27de31[_0x7b47('0x43')]);return db[_0x7b47('0x5f')][_0x7b47('0x1f')]({'where':_0x5cd62f[_0x7b47('0x3f')]})[_0x7b47('0x25')](function(_0x3c6584){_0x426ee2['count']=_0x3c6584;if(_0x27de31[_0x7b47('0x36')][_0x7b47('0x44')]){_0x5cd62f[_0x7b47('0x4b')]=[{'all':!![]}];}return db[_0x7b47('0x5f')][_0x7b47('0x45')](_0x5cd62f);})[_0x7b47('0x25')](function(_0x3d8650){_0x426ee2[_0x7b47('0x46')]=_0x3d8650;return _0x426ee2;});}})[_0x7b47('0x25')](respondWithFilteredResult(_0x2d8a08,_0x5cd62f))['catch'](handleError(_0x2d8a08,null));};function char(_0x51c38f){return'number'===typeof _0x51c38f?String['fromCharCode'][_0x7b47('0x21')](null,arguments):_0x51c38f;}function needsEncapsulation(_0x173ab0){return!!_0x173ab0&&(_0x173ab0['toString']()[_0x7b47('0x60')](char(0xd))>=0x0||_0x173ab0[_0x7b47('0x61')]()[_0x7b47('0x60')](char(0xa))>=0x0||_0x173ab0[_0x7b47('0x61')]()[_0x7b47('0x60')](char(0x2c))>=0x0||_0x173ab0['toString']()[_0x7b47('0x60')](char(0x22))>=0x0);}function encapsulate(_0x55caa4){var _0x5091ee=char(0x22),_0x1b0959='\x5c'+char(0x22),_0x53dce4=_0x55caa4[_0x7b47('0x61')]()[_0x7b47('0x62')](new RegExp(_0x5091ee,'g'),_0x1b0959);return _0x5091ee+_0x53dce4+_0x5091ee;}exports['getSummary']=function(_0x44cce9,_0x537a95,_0x1fdf30){var _0x454602,_0x4c7d74;var _0x1fa9a9={'where':{'ProjectId':_0x44cce9[_0x7b47('0x58')]['id']}};if(_0x44cce9[_0x7b47('0x36')][_0x7b47('0x63')]){_0x1fa9a9['where'][_0x7b47('0x64')]=JSON[_0x7b47('0x65')](_0x44cce9[_0x7b47('0x36')][_0x7b47('0x63')]);}return db['JscriptySessionReport'][_0x7b47('0x45')](_0x1fa9a9)[_0x7b47('0x25')](handleEntityNotFound(_0x537a95,null))[_0x7b47('0x25')](function(_0x50775e){if(_0x50775e){_0x454602=_0x50775e;return db[_0x7b47('0x66')][_0x7b47('0x45')]({'where':{'SessionId':{'$in':_[_0x7b47('0x2f')](_0x454602,'id')},'ProjectId':_0x44cce9['params']['id']},'order':'-createdAt'});}})[_0x7b47('0x25')](handleEntityNotFound(_0x537a95,null))[_0x7b47('0x25')](function(_0x5a10bd){if(_0x5a10bd){_0x4c7d74=_0x5a10bd;var _0xf47561={};for(var _0x3e92c9=0x0,_0x39fe85=_0x4c7d74[_0x7b47('0x3a')];_0x3e92c9<_0x39fe85;_0x3e92c9++){if(!_0xf47561[_0x7b47('0x3b')](_0x4c7d74[_0x3e92c9][_0x7b47('0x67')])){_0xf47561[_0x4c7d74[_0x3e92c9]['questionId']]=needsEncapsulation(_0x4c7d74[_0x3e92c9]['question'])?encapsulate(_0x4c7d74[_0x3e92c9][_0x7b47('0x68')]):_0x4c7d74[_0x3e92c9][_0x7b47('0x68')];}}var _0x4f3ebd=[],_0x4dcd07={};for(var _0x35183f=0x0,_0x1812e4=_0x454602[_0x7b47('0x3a')];_0x35183f<_0x1812e4;_0x35183f++){_0x4dcd07={'ProjectId':_0x44cce9[_0x7b47('0x58')]['id'],'SessionId':_0x454602[_0x35183f]['id'],'StartTime':moment(_0x454602[_0x35183f][_0x7b47('0x64')])[_0x7b47('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x1a0333=0x0,_0x256f31=_0x4c7d74[_0x7b47('0x3a')];_0x1a0333<_0x256f31;_0x1a0333++){if(_0x4c7d74[_0x1a0333][_0x7b47('0x6a')]==_0x454602[_0x35183f]['id']&&_0xf47561[_0x7b47('0x3b')](_0x4c7d74[_0x1a0333]['questionId'])){_0x4dcd07[_0xf47561[_0x4c7d74[_0x1a0333]['questionId']]]=_0x4c7d74[_0x1a0333][_0x7b47('0x6b')];}}for(var _0x33bdd6 in _0xf47561){if(!_0x4dcd07[_0x7b47('0x3b')](_0xf47561[_0x33bdd6])){_0x4dcd07[_0xf47561[_0x33bdd6]]=null;}}_0x4f3ebd['push'](_0x4dcd07);}return _0x4f3ebd;}})[_0x7b47('0x25')](function(_0x5e30bb){if(!_[_0x7b47('0x6c')](_0x5e30bb)){var _0x5e16ec=toCsv(_0x5e30bb);var _0x124f5a=Date[_0x7b47('0x6d')]();fs['writeFileSync'](util[_0x7b47('0x69')](_0x7b47('0x6e'),_0x44cce9[_0x7b47('0x58')]['id'],_0x124f5a),_0x5e16ec);_0x537a95[_0x7b47('0x6f')]('Content-disposition',_0x7b47('0x70')+util[_0x7b47('0x69')](_0x7b47('0x71'),_0x44cce9[_0x7b47('0x58')]['id'],_0x124f5a));_0x537a95[_0x7b47('0x6f')](_0x7b47('0x72'),_0x7b47('0x73'));return _0x537a95[_0x7b47('0x74')](util[_0x7b47('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x44cce9[_0x7b47('0x58')]['id'],_0x124f5a));}else{return _0x537a95[_0x7b47('0x19')](0xcc);}})[_0x7b47('0x47')](handleError(_0x537a95,null));}; \ No newline at end of file +var _0x3d7f=['where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','autoAssociation','getSessions','findOne','JscriptySessionReport','order','rows','JscriptyAnswerReport','toString','indexOf','replace','getSummary','parse','startTime','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x4c76a5,_0x9c7de0){var _0x94cceb=function(_0x3968d5){while(--_0x3968d5){_0x4c76a5['push'](_0x4c76a5['shift']());}};_0x94cceb(++_0x9c7de0);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x3d7f[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0xf3d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3d7('0x2'));var moment=require(_0xf3d7('0x3'));var BPromise=require(_0xf3d7('0x4'));var Mustache=require(_0xf3d7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf3d7('0x6'));var csv=require(_0xf3d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3d7('0x8'));var squel=require(_0xf3d7('0x9'));var crypto=require(_0xf3d7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf3d7('0xb'));var toCsv=require(_0xf3d7('0x7'));var querystring=require(_0xf3d7('0xc'));var Papa=require(_0xf3d7('0xd'));var Redis=require(_0xf3d7('0xe'));var authService=require(_0xf3d7('0xf'));var qs=require(_0xf3d7('0x10'));var as=require(_0xf3d7('0x11'));var hardwareService=require(_0xf3d7('0x12'));var logger=require(_0xf3d7('0x13'))(_0xf3d7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3d7('0x15'));var db=require(_0xf3d7('0x16'))['db'];function respondWithStatusCode(_0x5e7b43,_0x161613){_0x161613=_0x161613||0xcc;return function(_0xecd54c){if(_0xecd54c){return _0x5e7b43[_0xf3d7('0x17')](_0x161613);}return _0x5e7b43['status'](_0x161613)[_0xf3d7('0x18')]();};}function respondWithResult(_0x1c5bb4,_0x1a895a){_0x1a895a=_0x1a895a||0xc8;return function(_0x14b5d3){if(_0x14b5d3){return _0x1c5bb4[_0xf3d7('0x19')](_0x1a895a)[_0xf3d7('0x1a')](_0x14b5d3);}};}function respondWithFilteredResult(_0x5622c1,_0x415a3f){return function(_0x24e584){if(_0x24e584){var _0x305b5c=typeof _0x415a3f[_0xf3d7('0x1b')]===_0xf3d7('0x1c')&&typeof _0x415a3f[_0xf3d7('0x1d')]===_0xf3d7('0x1c');var _0x4e160f=_0x24e584[_0xf3d7('0x1e')];var _0xaf4f4c=_0x305b5c?0x0:_0x415a3f[_0xf3d7('0x1b')];var _0x189eed=_0x305b5c?_0x24e584[_0xf3d7('0x1e')]:_0x415a3f[_0xf3d7('0x1b')]+_0x415a3f['limit'];var _0x1869e3;if(_0x189eed>=_0x4e160f){_0x189eed=_0x4e160f;_0x1869e3=0xc8;}else{_0x1869e3=0xce;}_0x5622c1[_0xf3d7('0x19')](_0x1869e3);return _0x5622c1[_0xf3d7('0x1f')](_0xf3d7('0x20'),_0xaf4f4c+'-'+_0x189eed+'/'+_0x4e160f)[_0xf3d7('0x1a')](_0x24e584);}return null;};}function patchUpdates(_0x43df6a){return function(_0x4b4fda){try{jsonpatch[_0xf3d7('0x21')](_0x4b4fda,_0x43df6a,!![]);}catch(_0xbcf366){return BPromise[_0xf3d7('0x22')](_0xbcf366);}return _0x4b4fda[_0xf3d7('0x23')]();};}function saveUpdates(_0x564daa,_0x325ca5){return function(_0x1c2a31){if(_0x1c2a31){return _0x1c2a31[_0xf3d7('0x24')](_0x564daa)[_0xf3d7('0x25')](function(_0x2fda73){return _0x2fda73;});}return null;};}function removeEntity(_0x67ad16,_0x573d5e){return function(_0x3943f7){if(_0x3943f7){return _0x3943f7[_0xf3d7('0x26')]()[_0xf3d7('0x25')](function(){var _0xbe9345=_0x3943f7[_0xf3d7('0x27')]({'plain':!![]});var _0x361c12=_0xf3d7('0x28');return db['UserProfileResource'][_0xf3d7('0x26')]({'where':{'type':_0x361c12,'resourceId':_0xbe9345['id']}})[_0xf3d7('0x25')](function(){return _0x3943f7;});})[_0xf3d7('0x25')](function(){_0x67ad16['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x355234,_0x4cb47c){return function(_0x21d058){if(!_0x21d058){_0x355234['sendStatus'](0x194);}return _0x21d058;};}function handleError(_0x8f8013,_0x3aefc9){_0x3aefc9=_0x3aefc9||0x1f4;return function(_0x552e66){logger[_0xf3d7('0x29')](_0x552e66[_0xf3d7('0x2a')]);if(_0x552e66[_0xf3d7('0x2b')]){delete _0x552e66[_0xf3d7('0x2b')];}_0x8f8013[_0xf3d7('0x19')](_0x3aefc9)[_0xf3d7('0x2c')](_0x552e66);};}exports[_0xf3d7('0x2d')]=function(_0x380e33,_0x2b2ed2){var _0xc05c1={},_0xb0469c={},_0x407bea={'count':0x0,'rows':[]};var _0x3b0ad0=_[_0xf3d7('0x2e')](db[_0xf3d7('0x2f')][_0xf3d7('0x30')],function(_0x1a306b){return{'name':_0x1a306b[_0xf3d7('0x31')],'type':_0x1a306b[_0xf3d7('0x32')][_0xf3d7('0x33')]};});_0xb0469c['model']=_[_0xf3d7('0x2e')](_0x3b0ad0,_0xf3d7('0x2b'));_0xb0469c[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0x380e33[_0xf3d7('0x34')]);_0xb0469c[_0xf3d7('0x36')]=_['intersection'](_0xb0469c[_0xf3d7('0x37')],_0xb0469c[_0xf3d7('0x34')]);_0xc05c1[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0xb0469c['model'],qs[_0xf3d7('0x3a')](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0xc05c1[_0xf3d7('0x38')]=_0xc05c1['attributes'][_0xf3d7('0x3b')]?_0xc05c1[_0xf3d7('0x38')]:_0xb0469c[_0xf3d7('0x37')];if(!_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0xc05c1[_0xf3d7('0x1d')]=qs['limit'](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0xc05c1[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0xc05c1['order']=qs['sort'](_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x3e')]);_0xc05c1[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x380e33[_0xf3d7('0x34')],_0xb0469c[_0xf3d7('0x36')]),_0x3b0ad0);if(_0x380e33['query'][_0xf3d7('0x41')]){_0xc05c1[_0xf3d7('0x3f')]=_[_0xf3d7('0x42')](_0xc05c1[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x3b0ad0,function(_0x5378a7){if(_0x5378a7[_0xf3d7('0x32')]!==_0xf3d7('0x43')){var _0x43094c={};_0x43094c[_0x5378a7['name']]={'$like':'%'+_0x380e33[_0xf3d7('0x34')][_0xf3d7('0x41')]+'%'};return _0x43094c;}})});}_0xc05c1=_[_0xf3d7('0x42')]({},_0xc05c1,_0x380e33['options']);var _0x3274c9={'where':_0xc05c1[_0xf3d7('0x3f')]};return db[_0xf3d7('0x2f')][_0xf3d7('0x1e')](_0x3274c9)[_0xf3d7('0x25')](function(_0x2c4e41){_0x407bea[_0xf3d7('0x1e')]=_0x2c4e41;if(_0x380e33['query']['includeAll']){_0xc05c1[_0xf3d7('0x44')]=[{'all':!![]}];}return db[_0xf3d7('0x2f')][_0xf3d7('0x45')](_0xc05c1);})[_0xf3d7('0x25')](function(_0x5c3b3c){_0x407bea['rows']=_0x5c3b3c;return _0x407bea;})[_0xf3d7('0x25')](respondWithFilteredResult(_0x2b2ed2,_0xc05c1))[_0xf3d7('0x46')](handleError(_0x2b2ed2,null));};exports[_0xf3d7('0x47')]=function(_0xa9d6f3,_0x11db5f){var _0x13654f={'raw':![],'where':{'id':_0xa9d6f3[_0xf3d7('0x48')]['id']}},_0x1a9af7={};_0x1a9af7[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x2f')][_0xf3d7('0x30')]);_0x1a9af7[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0xa9d6f3['query']);_0x1a9af7[_0xf3d7('0x36')]=_[_0xf3d7('0x39')](_0x1a9af7[_0xf3d7('0x37')],_0x1a9af7[_0xf3d7('0x34')]);_0x13654f[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x1a9af7['model'],qs[_0xf3d7('0x3a')](_0xa9d6f3[_0xf3d7('0x34')]['fields']));_0x13654f[_0xf3d7('0x38')]=_0x13654f['attributes'][_0xf3d7('0x3b')]?_0x13654f[_0xf3d7('0x38')]:_0x1a9af7[_0xf3d7('0x37')];if(_0xa9d6f3[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x13654f['include']=[{'all':!![]}];}_0x13654f=_[_0xf3d7('0x42')]({},_0x13654f,_0xa9d6f3['options']);return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')](_0x13654f)[_0xf3d7('0x25')](handleEntityNotFound(_0x11db5f,null))[_0xf3d7('0x25')](respondWithResult(_0x11db5f,null))['catch'](handleError(_0x11db5f,null));};exports[_0xf3d7('0x4b')]=function(_0x83d058,_0x40eae9){return db[_0xf3d7('0x2f')][_0xf3d7('0x4b')](_0x83d058[_0xf3d7('0x4c')],{})[_0xf3d7('0x25')](function(_0x180d72){var _0x329de6=_0x83d058['user'][_0xf3d7('0x27')]({'plain':!![]});if(!_0x329de6)throw new Error(_0xf3d7('0x4d'));if(_0x329de6[_0xf3d7('0x4e')]===_0xf3d7('0x4f')){var _0xfce1a=_0x180d72['get']({'plain':!![]});var _0x32c7e8='Projects';return db[_0xf3d7('0x50')][_0xf3d7('0x4a')]({'where':{'name':_0x32c7e8,'userProfileId':_0x329de6[_0xf3d7('0x51')]},'raw':!![]})[_0xf3d7('0x25')](function(_0x937ac){if(_0x937ac&&_0x937ac['autoAssociation']===0x0){return db[_0xf3d7('0x52')][_0xf3d7('0x4b')]({'name':_0xfce1a[_0xf3d7('0x2b')],'resourceId':_0xfce1a['id'],'type':_0x937ac[_0xf3d7('0x2b')],'sectionId':_0x937ac['id']},{})[_0xf3d7('0x25')](function(){return _0x180d72;});}else{return _0x180d72;}})['catch'](function(_0xd564c1){logger[_0xf3d7('0x29')](_0xf3d7('0x53'),_0xd564c1);throw _0xd564c1;});}return _0x180d72;})[_0xf3d7('0x25')](respondWithResult(_0x40eae9,0xc9))[_0xf3d7('0x46')](handleError(_0x40eae9,null));};exports[_0xf3d7('0x54')]=function(_0x1c70dc,_0xca8122){var _0x400d09={'where':{'id':_0x1c70dc[_0xf3d7('0x48')]['id']}},_0x5d0a67={};_0x5d0a67[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db['JscriptyProject'][_0xf3d7('0x30')]);_0x400d09[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x5d0a67[_0xf3d7('0x37')],qs[_0xf3d7('0x3a')](_0x1c70dc[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0x400d09['attributes']=_0x400d09[_0xf3d7('0x38')][_0xf3d7('0x3b')]?_0x400d09[_0xf3d7('0x38')]:_0x5d0a67[_0xf3d7('0x37')];if(_0x1c70dc[_0xf3d7('0x34')]['includeAll']){_0x400d09[_0xf3d7('0x44')]=[{'all':!![]}];}_0x400d09=_[_0xf3d7('0x42')]({},_0x400d09,_0x1c70dc[_0xf3d7('0x55')]);return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')](_0x400d09)[_0xf3d7('0x25')](handleEntityNotFound(_0xca8122,null))[_0xf3d7('0x25')](function(_0x45f886){if(_0x45f886){var _0x3aaf75=_0x45f886[_0xf3d7('0x27')]({'plain':!![]});_0x3aaf75=qs[_0xf3d7('0x56')](_0x3aaf75,['id',_0xf3d7('0x57'),_0xf3d7('0x58')]);_0x1c70dc['body']=_[_0xf3d7('0x56')](_0x1c70dc[_0xf3d7('0x4c')],['id',_0xf3d7('0x57'),_0xf3d7('0x58')]);return db[_0xf3d7('0x2f')][_0xf3d7('0x4b')](_[_0xf3d7('0x42')](_0x3aaf75,_0x1c70dc[_0xf3d7('0x4c')]),{'include':_0x1c70dc[_0xf3d7('0x34')][_0xf3d7('0x49')]?[{'all':!![]}]:undefined})[_0xf3d7('0x25')](function(_0x4312f9){var _0x58af9b=_0x1c70dc[_0xf3d7('0x4f')][_0xf3d7('0x27')]({'plain':!![]});if(!_0x58af9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58af9b[_0xf3d7('0x4e')]===_0xf3d7('0x4f')){var _0x3aaea1=_0x4312f9['get']({'plain':!![]});var _0x582b97=_0xf3d7('0x28');return db[_0xf3d7('0x50')]['find']({'where':{'name':_0x582b97,'userProfileId':_0x58af9b[_0xf3d7('0x51')]},'raw':!![]})[_0xf3d7('0x25')](function(_0x4843eb){if(_0x4843eb&&_0x4843eb[_0xf3d7('0x59')]===0x0){return db[_0xf3d7('0x52')]['create']({'name':_0x3aaea1[_0xf3d7('0x2b')],'resourceId':_0x3aaea1['id'],'type':_0x4843eb[_0xf3d7('0x2b')],'sectionId':_0x4843eb['id']},{})[_0xf3d7('0x25')](function(){return _0x4312f9;});}else{return _0x4312f9;}})[_0xf3d7('0x46')](function(_0x4a0e29){logger[_0xf3d7('0x29')](_0xf3d7('0x53'),_0x4a0e29);throw _0x4a0e29;});}return _0x4312f9;});}})[_0xf3d7('0x25')](respondWithResult(_0xca8122,0xc9))[_0xf3d7('0x46')](handleError(_0xca8122,null));};exports['update']=function(_0x4d87a8,_0x2bed8f){if(_0x4d87a8[_0xf3d7('0x4c')]['id']){delete _0x4d87a8[_0xf3d7('0x4c')]['id'];}return db[_0xf3d7('0x2f')][_0xf3d7('0x4a')]({'where':{'id':_0x4d87a8[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x2bed8f,null))[_0xf3d7('0x25')](saveUpdates(_0x4d87a8[_0xf3d7('0x4c')],null))[_0xf3d7('0x25')](respondWithResult(_0x2bed8f,null))[_0xf3d7('0x46')](handleError(_0x2bed8f,null));};exports[_0xf3d7('0x26')]=function(_0x47c03e,_0x1e38e3){return db[_0xf3d7('0x2f')]['find']({'where':{'id':_0x47c03e[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x1e38e3,null))[_0xf3d7('0x25')](removeEntity(_0x1e38e3,null))[_0xf3d7('0x46')](handleError(_0x1e38e3,null));};exports[_0xf3d7('0x5a')]=function(_0x4e462,_0x2a8b64,_0x98b280){var _0x412703={'raw':!![],'where':{}};var _0x232c7c={};var _0x39bdba={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf3d7('0x5b')]({'where':{'id':_0x4e462['params']['id']}})['then'](handleEntityNotFound(_0x2a8b64,null))[_0xf3d7('0x25')](function(_0x49917b){if(_0x49917b){_0x232c7c[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x5c')][_0xf3d7('0x30')]);_0x232c7c[_0xf3d7('0x34')]=_[_0xf3d7('0x35')](_0x4e462['query']);_0x232c7c[_0xf3d7('0x36')]=_['intersection'](_0x232c7c[_0xf3d7('0x37')],_0x232c7c[_0xf3d7('0x34')]);_0x412703[_0xf3d7('0x38')]=_['intersection'](_0x232c7c[_0xf3d7('0x37')],qs[_0xf3d7('0x3a')](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x3a')]));_0x412703[_0xf3d7('0x38')]=_0x412703[_0xf3d7('0x38')][_0xf3d7('0x3b')]?_0x412703[_0xf3d7('0x38')]:_0x232c7c[_0xf3d7('0x37')];if(!_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x3c')](_0xf3d7('0x3d'))){_0x412703[_0xf3d7('0x1d')]=qs[_0xf3d7('0x1d')](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0x412703[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0x412703[_0xf3d7('0x5d')]=qs['sort'](_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x3e')]);_0x412703[_0xf3d7('0x3f')]=qs[_0xf3d7('0x36')](_[_0xf3d7('0x40')](_0x4e462[_0xf3d7('0x34')],_0x232c7c[_0xf3d7('0x36')]));_0x412703[_0xf3d7('0x3f')]['ProjectId']=_0x49917b['id'];if(_0x4e462[_0xf3d7('0x34')]['filter']){_0x412703[_0xf3d7('0x3f')]=_['merge'](_0x412703[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x412703[_0xf3d7('0x38')],function(_0x275f94){var _0x383ded={};_0x383ded[_0x275f94]={'$like':'%'+_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x41')]+'%'};return _0x383ded;})});}_0x412703=_[_0xf3d7('0x42')]({},_0x412703,_0x4e462[_0xf3d7('0x55')]);return db[_0xf3d7('0x5c')][_0xf3d7('0x1e')]({'where':_0x412703['where']})[_0xf3d7('0x25')](function(_0x3798d8){_0x39bdba[_0xf3d7('0x1e')]=_0x3798d8;if(_0x4e462[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x412703[_0xf3d7('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf3d7('0x45')](_0x412703);})['then'](function(_0x56181d){_0x39bdba[_0xf3d7('0x5e')]=_0x56181d;return _0x39bdba;});}})[_0xf3d7('0x25')](respondWithFilteredResult(_0x2a8b64,_0x412703))['catch'](handleError(_0x2a8b64,null));};exports['getAnswers']=function(_0x33271e,_0x354135,_0x3295da){var _0x578ac5={'raw':!![],'where':{}};var _0x3c95a8={};var _0x4824fc={'count':0x0,'rows':[]};return db[_0xf3d7('0x2f')][_0xf3d7('0x5b')]({'where':{'id':_0x33271e[_0xf3d7('0x48')]['id']}})[_0xf3d7('0x25')](handleEntityNotFound(_0x354135,null))[_0xf3d7('0x25')](function(_0x556663){if(_0x556663){_0x3c95a8[_0xf3d7('0x37')]=_[_0xf3d7('0x35')](db[_0xf3d7('0x5f')]['rawAttributes']);_0x3c95a8['query']=_['keys'](_0x33271e[_0xf3d7('0x34')]);_0x3c95a8['filters']=_[_0xf3d7('0x39')](_0x3c95a8['model'],_0x3c95a8[_0xf3d7('0x34')]);_0x578ac5[_0xf3d7('0x38')]=_[_0xf3d7('0x39')](_0x3c95a8[_0xf3d7('0x37')],qs[_0xf3d7('0x3a')](_0x33271e[_0xf3d7('0x34')]['fields']));_0x578ac5[_0xf3d7('0x38')]=_0x578ac5['attributes'][_0xf3d7('0x3b')]?_0x578ac5[_0xf3d7('0x38')]:_0x3c95a8[_0xf3d7('0x37')];if(!_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x3c')]('nolimit')){_0x578ac5[_0xf3d7('0x1d')]=qs[_0xf3d7('0x1d')](_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x1d')]);_0x578ac5['offset']=qs[_0xf3d7('0x1b')](_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x1b')]);}_0x578ac5['order']=qs[_0xf3d7('0x3e')](_0x33271e['query'][_0xf3d7('0x3e')]);_0x578ac5[_0xf3d7('0x3f')]=qs['filters'](_[_0xf3d7('0x40')](_0x33271e[_0xf3d7('0x34')],_0x3c95a8[_0xf3d7('0x36')]));_0x578ac5[_0xf3d7('0x3f')]['ProjectId']=_0x556663['id'];if(_0x33271e['query']['filter']){_0x578ac5[_0xf3d7('0x3f')]=_[_0xf3d7('0x42')](_0x578ac5[_0xf3d7('0x3f')],{'$or':_[_0xf3d7('0x2e')](_0x578ac5[_0xf3d7('0x38')],function(_0x3338ff){var _0x2a809f={};_0x2a809f[_0x3338ff]={'$like':'%'+_0x33271e[_0xf3d7('0x34')]['filter']+'%'};return _0x2a809f;})});}_0x578ac5=_[_0xf3d7('0x42')]({},_0x578ac5,_0x33271e[_0xf3d7('0x55')]);return db[_0xf3d7('0x5f')]['count']({'where':_0x578ac5['where']})['then'](function(_0x4b222f){_0x4824fc['count']=_0x4b222f;if(_0x33271e[_0xf3d7('0x34')][_0xf3d7('0x49')]){_0x578ac5[_0xf3d7('0x44')]=[{'all':!![]}];}return db[_0xf3d7('0x5f')]['findAll'](_0x578ac5);})[_0xf3d7('0x25')](function(_0x1e753b){_0x4824fc[_0xf3d7('0x5e')]=_0x1e753b;return _0x4824fc;});}})[_0xf3d7('0x25')](respondWithFilteredResult(_0x354135,_0x578ac5))['catch'](handleError(_0x354135,null));};function char(_0x3f0e1a){return'number'===typeof _0x3f0e1a?String['fromCharCode'][_0xf3d7('0x21')](null,arguments):_0x3f0e1a;}function needsEncapsulation(_0x45b8d9){return!!_0x45b8d9&&(_0x45b8d9[_0xf3d7('0x60')]()[_0xf3d7('0x61')](char(0xd))>=0x0||_0x45b8d9['toString']()[_0xf3d7('0x61')](char(0xa))>=0x0||_0x45b8d9[_0xf3d7('0x60')]()[_0xf3d7('0x61')](char(0x2c))>=0x0||_0x45b8d9[_0xf3d7('0x60')]()[_0xf3d7('0x61')](char(0x22))>=0x0);}function encapsulate(_0x3532e3){var _0x5d878e=char(0x22),_0x198ef6='\x5c'+char(0x22),_0x397c84=_0x3532e3[_0xf3d7('0x60')]()[_0xf3d7('0x62')](new RegExp(_0x5d878e,'g'),_0x198ef6);return _0x5d878e+_0x397c84+_0x5d878e;}exports[_0xf3d7('0x63')]=function(_0x5411d9,_0x437c8b,_0x5077fc){var _0x5d7fc5,_0x5786c6;var _0x45fc41={'where':{'ProjectId':_0x5411d9[_0xf3d7('0x48')]['id']}};if(_0x5411d9['query']['startTime']){_0x45fc41[_0xf3d7('0x3f')]['starttime']=JSON[_0xf3d7('0x64')](_0x5411d9[_0xf3d7('0x34')][_0xf3d7('0x65')]);}return db['JscriptySessionReport'][_0xf3d7('0x45')](_0x45fc41)[_0xf3d7('0x25')](handleEntityNotFound(_0x437c8b,null))[_0xf3d7('0x25')](function(_0xe25ecb){if(_0xe25ecb){_0x5d7fc5=_0xe25ecb;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xf3d7('0x2e')](_0x5d7fc5,'id')},'ProjectId':_0x5411d9[_0xf3d7('0x48')]['id']},'order':_0xf3d7('0x66')});}})[_0xf3d7('0x25')](handleEntityNotFound(_0x437c8b,null))[_0xf3d7('0x25')](function(_0x1b498d){if(_0x1b498d){_0x5786c6=_0x1b498d;var _0x3b437a={};for(var _0x267bc3=0x0,_0x176946=_0x5786c6[_0xf3d7('0x3b')];_0x267bc3<_0x176946;_0x267bc3++){if(!_0x3b437a[_0xf3d7('0x3c')](_0x5786c6[_0x267bc3][_0xf3d7('0x67')])){_0x3b437a[_0x5786c6[_0x267bc3]['questionId']]=needsEncapsulation(_0x5786c6[_0x267bc3][_0xf3d7('0x68')])?encapsulate(_0x5786c6[_0x267bc3][_0xf3d7('0x68')]):_0x5786c6[_0x267bc3]['question'];}}var _0x2d10d4=[],_0x33ae8a={};for(var _0x171a2c=0x0,_0x41d7b5=_0x5d7fc5[_0xf3d7('0x3b')];_0x171a2c<_0x41d7b5;_0x171a2c++){_0x33ae8a={'ProjectId':_0x5411d9['params']['id'],'SessionId':_0x5d7fc5[_0x171a2c]['id'],'StartTime':moment(_0x5d7fc5[_0x171a2c][_0xf3d7('0x69')])[_0xf3d7('0x6a')](_0xf3d7('0x6b'))};for(var _0x1be6d7=0x0,_0x26072d=_0x5786c6['length'];_0x1be6d7<_0x26072d;_0x1be6d7++){if(_0x5786c6[_0x1be6d7][_0xf3d7('0x6c')]==_0x5d7fc5[_0x171a2c]['id']&&_0x3b437a['hasOwnProperty'](_0x5786c6[_0x1be6d7][_0xf3d7('0x67')])){_0x33ae8a[_0x3b437a[_0x5786c6[_0x1be6d7][_0xf3d7('0x67')]]]=_0x5786c6[_0x1be6d7]['answer'];}}for(var _0x52b149 in _0x3b437a){if(!_0x33ae8a[_0xf3d7('0x3c')](_0x3b437a[_0x52b149])){_0x33ae8a[_0x3b437a[_0x52b149]]=null;}}_0x2d10d4[_0xf3d7('0x6d')](_0x33ae8a);}return _0x2d10d4;}})[_0xf3d7('0x25')](function(_0x2c0a75){if(!_[_0xf3d7('0x6e')](_0x2c0a75)){var _0x18a5e4=toCsv(_0x2c0a75);var _0x1fc1c9=Date[_0xf3d7('0x6f')]();fs[_0xf3d7('0x70')](util[_0xf3d7('0x6a')](_0xf3d7('0x71'),_0x5411d9[_0xf3d7('0x48')]['id'],_0x1fc1c9),_0x18a5e4);_0x437c8b[_0xf3d7('0x72')](_0xf3d7('0x73'),_0xf3d7('0x74')+util[_0xf3d7('0x6a')](_0xf3d7('0x75'),_0x5411d9[_0xf3d7('0x48')]['id'],_0x1fc1c9));_0x437c8b[_0xf3d7('0x72')]('Content-type',_0xf3d7('0x76'));return _0x437c8b[_0xf3d7('0x77')](util[_0xf3d7('0x6a')](_0xf3d7('0x71'),_0x5411d9[_0xf3d7('0x48')]['id'],_0x1fc1c9));}else{return _0x437c8b[_0xf3d7('0x17')](0xcc);}})[_0xf3d7('0x46')](handleError(_0x437c8b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index bc4118c..f64db8a 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 _0x1f75=['JscriptyProject','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x198eb0,_0x4bc5ab){var _0x13b96d=function(_0x385881){while(--_0x385881){_0x198eb0['push'](_0x198eb0['shift']());}};_0x13b96d(++_0x4bc5ab);}(_0x1f75,0x12c));var _0x51f7=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x1f75[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x51f7('0x0'));var util=require(_0x51f7('0x1'));var logger=require(_0x51f7('0x2'))('api');var moment=require(_0x51f7('0x3'));var BPromise=require(_0x51f7('0x4'));var rp=require(_0x51f7('0x5'));var fs=require('fs');var path=require(_0x51f7('0x6'));var rimraf=require(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var attributes=require(_0x51f7('0x9'));module[_0x51f7('0xa')]=function(_0x292480,_0x22fc29){return _0x292480[_0x51f7('0xb')](_0x51f7('0xc'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a25=['path','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x4a25,0x1d4));var _0x54a2=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0x4a25[_0x55fa03];return _0x2cd7cd;};'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 diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 3197f64..fa69a81 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x131fb0,_0x4f612f){var _0x1c7735=function(_0x577257){while(--_0x577257){_0x131fb0['push'](_0x131fb0['shift']());}};_0x1c7735(++_0x4f612f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1debfb,_0x431c9c){_0x1debfb=_0x1debfb-0x0;var _0xab709e=_0xb43b[_0x1debfb];return _0xab709e;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +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(_0x262e1d,_0x4e3b28){var _0x3e2997=function(_0x5082ed){while(--_0x5082ed){_0x262e1d['push'](_0x262e1d['shift']());}};_0x3e2997(++_0x4e3b28);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ba4f072..3b88fd3 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 _0xa831=['../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa831,0x73));var _0x1a83=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xa831[_0x1f1511];return _0x1d9ab8;};'use strict';var multer=require(_0x1a83('0x0'));var util=require(_0x1a83('0x1'));var path=require('path');var timeout=require(_0x1a83('0x2'));var express=require('express');var router=express[_0x1a83('0x3')]();var fs_extra=require(_0x1a83('0x4'));var auth=require(_0x1a83('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a83('0x6'));var controller=require(_0x1a83('0x7'));router[_0x1a83('0x8')]('/',auth[_0x1a83('0x9')](),controller[_0x1a83('0xa')]);router['get'](_0x1a83('0xb'),auth[_0x1a83('0x9')](),controller[_0x1a83('0xc')]);router['get']('/:id',auth[_0x1a83('0x9')](),controller[_0x1a83('0xd')]);router[_0x1a83('0xe')]('/',auth['isAuthenticated'](),controller[_0x1a83('0xf')]);router[_0x1a83('0x10')](_0x1a83('0x11'),auth[_0x1a83('0x9')](),controller['update']);router[_0x1a83('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1a83('0x13')]=router; \ No newline at end of file +var _0x2780=['show','post','create','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x368c5c,_0x3fa1e0){var _0x1cf62f=function(_0xb3f871){while(--_0xb3f871){_0x368c5c['push'](_0x368c5c['shift']());}};_0x1cf62f(++_0x3fa1e0);}(_0x2780,0x194));var _0x0278=function(_0x20224e,_0x439ea2){_0x20224e=_0x20224e-0x0;var _0x231a08=_0x2780[_0x20224e];return _0x231a08;};'use strict';var multer=require('multer');var util=require(_0x0278('0x0'));var path=require(_0x0278('0x1'));var timeout=require('connect-timeout');var express=require(_0x0278('0x2'));var router=express[_0x0278('0x3')]();var fs_extra=require(_0x0278('0x4'));var auth=require(_0x0278('0x5'));var interaction=require(_0x0278('0x6'));var config=require(_0x0278('0x7'));var controller=require(_0x0278('0x8'));router['get']('/',auth[_0x0278('0x9')](),controller[_0x0278('0xa')]);router[_0x0278('0xb')]('/describe',auth[_0x0278('0x9')](),controller[_0x0278('0xc')]);router[_0x0278('0xb')](_0x0278('0xd'),auth[_0x0278('0x9')](),controller[_0x0278('0xe')]);router[_0x0278('0xf')]('/',auth[_0x0278('0x9')](),controller[_0x0278('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0278('0xd'),auth[_0x0278('0x9')](),controller[_0x0278('0x11')]);module[_0x0278('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 48dc5f7..c958121 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(_0x256665,_0x317c8c){_0x256665=_0x256665-0x0;var _0x5daa69=_0x7a54[_0x256665];return _0x5daa69;};'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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x35e9a9,_0x1b7475){_0x35e9a9=_0x35e9a9-0x0;var _0x472ed0=_0x7a54[_0x35e9a9];return _0x472ed0;};'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 41ab830..9888493 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 _0xad9e=['query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','model','keys'];(function(_0x5564a6,_0x5c3a35){var _0x430687=function(_0x1c34c2){while(--_0x1c34c2){_0x5564a6['push'](_0x5564a6['shift']());}};_0x430687(++_0x5c3a35);}(_0xad9e,0x102));var _0xead9=function(_0x5e091e,_0x580bed){_0x5e091e=_0x5e091e-0x0;var _0x19659d=_0xad9e[_0x5e091e];return _0x19659d;};'use strict';var emlformat=require(_0xead9('0x0'));var rimraf=require(_0xead9('0x1'));var zipdir=require(_0xead9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xead9('0x3'));var moment=require(_0xead9('0x4'));var BPromise=require(_0xead9('0x5'));var Mustache=require(_0xead9('0x6'));var util=require('util');var path=require(_0xead9('0x7'));var sox=require('sox');var csv=require(_0xead9('0x8'));var ejs=require(_0xead9('0x9'));var fs=require('fs');var fs_extra=require(_0xead9('0xa'));var _=require(_0xead9('0xb'));var squel=require(_0xead9('0xc'));var crypto=require('crypto');var jsforce=require(_0xead9('0xd'));var deskjs=require(_0xead9('0xe'));var toCsv=require(_0xead9('0x8'));var querystring=require(_0xead9('0xf'));var Papa=require('papaparse');var Redis=require(_0xead9('0x10'));var authService=require(_0xead9('0x11'));var qs=require(_0xead9('0x12'));var as=require(_0xead9('0x13'));var hardwareService=require(_0xead9('0x14'));var logger=require(_0xead9('0x15'))(_0xead9('0x16'));var utils=require(_0xead9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xead9('0x18'));var db=require(_0xead9('0x19'))['db'];function respondWithStatusCode(_0x453b69,_0x54e580){_0x54e580=_0x54e580||0xcc;return function(_0x1e39ee){if(_0x1e39ee){return _0x453b69[_0xead9('0x1a')](_0x54e580);}return _0x453b69['status'](_0x54e580)[_0xead9('0x1b')]();};}function respondWithResult(_0xdc6d90,_0x357975){_0x357975=_0x357975||0xc8;return function(_0x2afd0d){if(_0x2afd0d){return _0xdc6d90[_0xead9('0x1c')](_0x357975)[_0xead9('0x1d')](_0x2afd0d);}};}function respondWithFilteredResult(_0x551421,_0x40335e){return function(_0x306049){if(_0x306049){var _0x34fca8=typeof _0x40335e[_0xead9('0x1e')]===_0xead9('0x1f')&&typeof _0x40335e[_0xead9('0x20')]===_0xead9('0x1f');var _0x2c8b46=_0x306049['count'];var _0x4d15a1=_0x34fca8?0x0:_0x40335e[_0xead9('0x1e')];var _0x4addcd=_0x34fca8?_0x306049[_0xead9('0x21')]:_0x40335e[_0xead9('0x1e')]+_0x40335e[_0xead9('0x20')];var _0x7e9c71;if(_0x4addcd>=_0x2c8b46){_0x4addcd=_0x2c8b46;_0x7e9c71=0xc8;}else{_0x7e9c71=0xce;}_0x551421['status'](_0x7e9c71);return _0x551421[_0xead9('0x22')](_0xead9('0x23'),_0x4d15a1+'-'+_0x4addcd+'/'+_0x2c8b46)[_0xead9('0x1d')](_0x306049);}return null;};}function patchUpdates(_0x21710b){return function(_0xff4316){try{jsonpatch[_0xead9('0x24')](_0xff4316,_0x21710b,!![]);}catch(_0x2d6da9){return BPromise[_0xead9('0x25')](_0x2d6da9);}return _0xff4316[_0xead9('0x26')]();};}function saveUpdates(_0x2d3396,_0x4c4de7){return function(_0x40bbea){if(_0x40bbea){return _0x40bbea['update'](_0x2d3396)[_0xead9('0x27')](function(_0xb2d695){return _0xb2d695;});}return null;};}function removeEntity(_0x2420cc,_0x3676d3){return function(_0x766ec2){if(_0x766ec2){return _0x766ec2['destroy']()[_0xead9('0x27')](function(){_0x2420cc['status'](0xcc)[_0xead9('0x1b')]();});}};}function handleEntityNotFound(_0x5d8f21,_0x498982){return function(_0x4ae79b){if(!_0x4ae79b){_0x5d8f21[_0xead9('0x1a')](0x194);}return _0x4ae79b;};}function handleError(_0x552c19,_0x476049){_0x476049=_0x476049||0x1f4;return function(_0x54edf8){logger[_0xead9('0x28')](_0x54edf8['stack']);if(_0x54edf8['name']){delete _0x54edf8[_0xead9('0x29')];}_0x552c19['status'](_0x476049)[_0xead9('0x2a')](_0x54edf8);};}exports[_0xead9('0x2b')]=function(_0x43be2c,_0x15c6bc){var _0xe20195={},_0x4f679d={},_0x4c8462={'count':0x0,'rows':[]};var _0x537284=_[_0xead9('0x2c')](db[_0xead9('0x2d')][_0xead9('0x2e')],function(_0x4462fd){return{'name':_0x4462fd[_0xead9('0x2f')],'type':_0x4462fd['type']['key']};});_0x4f679d[_0xead9('0x30')]=_[_0xead9('0x2c')](_0x537284,_0xead9('0x29'));_0x4f679d['query']=_[_0xead9('0x31')](_0x43be2c[_0xead9('0x32')]);_0x4f679d['filters']=_[_0xead9('0x33')](_0x4f679d[_0xead9('0x30')],_0x4f679d[_0xead9('0x32')]);_0xe20195[_0xead9('0x34')]=_[_0xead9('0x33')](_0x4f679d[_0xead9('0x30')],qs[_0xead9('0x35')](_0x43be2c['query'][_0xead9('0x35')]));_0xe20195[_0xead9('0x34')]=_0xe20195['attributes'][_0xead9('0x36')]?_0xe20195[_0xead9('0x34')]:_0x4f679d[_0xead9('0x30')];if(!_0x43be2c[_0xead9('0x32')][_0xead9('0x37')]('nolimit')){_0xe20195[_0xead9('0x20')]=qs[_0xead9('0x20')](_0x43be2c[_0xead9('0x32')][_0xead9('0x20')]);_0xe20195['offset']=qs[_0xead9('0x1e')](_0x43be2c[_0xead9('0x32')][_0xead9('0x1e')]);}_0xe20195['order']=qs[_0xead9('0x38')](_0x43be2c[_0xead9('0x32')][_0xead9('0x38')]);_0xe20195[_0xead9('0x39')]=qs['filters'](_[_0xead9('0x3a')](_0x43be2c[_0xead9('0x32')],_0x4f679d[_0xead9('0x3b')]),_0x537284);if(_0x43be2c[_0xead9('0x32')][_0xead9('0x3c')]){_0xe20195[_0xead9('0x39')]=_[_0xead9('0x3d')](_0xe20195[_0xead9('0x39')],{'$or':_[_0xead9('0x2c')](_0x537284,function(_0x2022a9){if(_0x2022a9[_0xead9('0x3e')]!=='VIRTUAL'){var _0x280403={};_0x280403[_0x2022a9['name']]={'$like':'%'+_0x43be2c['query'][_0xead9('0x3c')]+'%'};return _0x280403;}})});}_0xe20195=_[_0xead9('0x3d')]({},_0xe20195,_0x43be2c[_0xead9('0x3f')]);var _0x54352d={'where':_0xe20195[_0xead9('0x39')]};return db[_0xead9('0x2d')][_0xead9('0x21')](_0x54352d)['then'](function(_0x2a51a5){_0x4c8462[_0xead9('0x21')]=_0x2a51a5;if(_0x43be2c[_0xead9('0x32')][_0xead9('0x40')]){_0xe20195[_0xead9('0x41')]=[{'all':!![]}];}return db[_0xead9('0x2d')][_0xead9('0x42')](_0xe20195);})[_0xead9('0x27')](function(_0x4fac1a){_0x4c8462[_0xead9('0x43')]=_0x4fac1a;return _0x4c8462;})[_0xead9('0x27')](respondWithFilteredResult(_0x15c6bc,_0xe20195))[_0xead9('0x44')](handleError(_0x15c6bc,null));};exports[_0xead9('0x45')]=function(_0x5b04d5,_0x475616){var _0x16f008={'raw':!![],'where':{'id':_0x5b04d5[_0xead9('0x46')]['id']}},_0x59f0f6={};_0x59f0f6[_0xead9('0x30')]=_['keys'](db[_0xead9('0x2d')][_0xead9('0x2e')]);_0x59f0f6['query']=_[_0xead9('0x31')](_0x5b04d5[_0xead9('0x32')]);_0x59f0f6[_0xead9('0x3b')]=_[_0xead9('0x33')](_0x59f0f6[_0xead9('0x30')],_0x59f0f6[_0xead9('0x32')]);_0x16f008['attributes']=_[_0xead9('0x33')](_0x59f0f6[_0xead9('0x30')],qs['fields'](_0x5b04d5['query']['fields']));_0x16f008[_0xead9('0x34')]=_0x16f008[_0xead9('0x34')][_0xead9('0x36')]?_0x16f008[_0xead9('0x34')]:_0x59f0f6[_0xead9('0x30')];if(_0x5b04d5[_0xead9('0x32')][_0xead9('0x40')]){_0x16f008['include']=[{'all':!![]}];}_0x16f008=_[_0xead9('0x3d')]({},_0x16f008,_0x5b04d5[_0xead9('0x3f')]);return db[_0xead9('0x2d')][_0xead9('0x47')](_0x16f008)[_0xead9('0x27')](handleEntityNotFound(_0x475616,null))[_0xead9('0x27')](respondWithResult(_0x475616,null))[_0xead9('0x44')](handleError(_0x475616,null));};exports[_0xead9('0x48')]=function(_0x2f1fa8,_0x31eeac){return db[_0xead9('0x2d')][_0xead9('0x48')](_0x2f1fa8[_0xead9('0x49')],{})[_0xead9('0x27')](respondWithResult(_0x31eeac,0xc9))[_0xead9('0x44')](handleError(_0x31eeac,null));};exports[_0xead9('0x4a')]=function(_0xed6e06,_0xd7aad5){if(_0xed6e06[_0xead9('0x49')]['id']){delete _0xed6e06[_0xead9('0x49')]['id'];}return db['JscriptyQuestionReport'][_0xead9('0x47')]({'where':{'id':_0xed6e06['params']['id']}})[_0xead9('0x27')](handleEntityNotFound(_0xd7aad5,null))[_0xead9('0x27')](saveUpdates(_0xed6e06[_0xead9('0x49')],null))[_0xead9('0x27')](respondWithResult(_0xd7aad5,null))['catch'](handleError(_0xd7aad5,null));};exports[_0xead9('0x4b')]=function(_0x415595,_0x26fba9){return db['JscriptyQuestionReport'][_0xead9('0x47')]({'where':{'id':_0x415595[_0xead9('0x46')]['id']}})['then'](handleEntityNotFound(_0x26fba9,null))[_0xead9('0x27')](removeEntity(_0x26fba9,null))[_0xead9('0x44')](handleError(_0x26fba9,null));};exports['describe']=function(_0x285efb,_0x220815){return db[_0xead9('0x2d')][_0xead9('0x4c')]()[_0xead9('0x27')](respondWithResult(_0x220815,null))[_0xead9('0x44')](handleError(_0x220815,null));}; \ No newline at end of file +var _0xb4e9=['stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x4edf99,_0x4510ed){var _0x3d0e6a=function(_0x547878){while(--_0x547878){_0x4edf99['push'](_0x4edf99['shift']());}};_0x3d0e6a(++_0x4510ed);}(_0xb4e9,0x67));var _0x9b4e=function(_0x53d520,_0x35c166){_0x53d520=_0x53d520-0x0;var _0x488a7e=_0xb4e9[_0x53d520];return _0x488a7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b4e('0x0'));var rp=require(_0x9b4e('0x1'));var moment=require('moment');var BPromise=require(_0x9b4e('0x2'));var Mustache=require(_0x9b4e('0x3'));var util=require(_0x9b4e('0x4'));var path=require(_0x9b4e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b4e('0x6'));var _=require(_0x9b4e('0x7'));var squel=require(_0x9b4e('0x8'));var crypto=require(_0x9b4e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9b4e('0xa'));var toCsv=require(_0x9b4e('0xb'));var querystring=require(_0x9b4e('0xc'));var Papa=require('papaparse');var Redis=require(_0x9b4e('0xd'));var authService=require(_0x9b4e('0xe'));var qs=require(_0x9b4e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b4e('0x10'))(_0x9b4e('0x11'));var utils=require(_0x9b4e('0x12'));var config=require(_0x9b4e('0x13'));var licenseUtil=require(_0x9b4e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aa672,_0x85e622){_0x85e622=_0x85e622||0xcc;return function(_0x448b61){if(_0x448b61){return _0x2aa672['sendStatus'](_0x85e622);}return _0x2aa672[_0x9b4e('0x15')](_0x85e622)[_0x9b4e('0x16')]();};}function respondWithResult(_0x3f1997,_0x162bf0){_0x162bf0=_0x162bf0||0xc8;return function(_0x3f4c09){if(_0x3f4c09){return _0x3f1997[_0x9b4e('0x15')](_0x162bf0)[_0x9b4e('0x17')](_0x3f4c09);}};}function respondWithFilteredResult(_0x4107f1,_0xc19990){return function(_0x793e85){if(_0x793e85){var _0x2272d1=typeof _0xc19990['offset']==='undefined'&&typeof _0xc19990[_0x9b4e('0x18')]==='undefined';var _0x5cf338=_0x793e85[_0x9b4e('0x19')];var _0x1bc375=_0x2272d1?0x0:_0xc19990[_0x9b4e('0x1a')];var _0x271db4=_0x2272d1?_0x793e85[_0x9b4e('0x19')]:_0xc19990['offset']+_0xc19990[_0x9b4e('0x18')];var _0x513a3e;if(_0x271db4>=_0x5cf338){_0x271db4=_0x5cf338;_0x513a3e=0xc8;}else{_0x513a3e=0xce;}_0x4107f1[_0x9b4e('0x15')](_0x513a3e);return _0x4107f1['set'](_0x9b4e('0x1b'),_0x1bc375+'-'+_0x271db4+'/'+_0x5cf338)[_0x9b4e('0x17')](_0x793e85);}return null;};}function patchUpdates(_0x38f7f8){return function(_0x48c293){try{jsonpatch[_0x9b4e('0x1c')](_0x48c293,_0x38f7f8,!![]);}catch(_0x45b9ae){return BPromise[_0x9b4e('0x1d')](_0x45b9ae);}return _0x48c293[_0x9b4e('0x1e')]();};}function saveUpdates(_0x3b08df,_0x39a4b9){return function(_0xac2bbc){if(_0xac2bbc){return _0xac2bbc[_0x9b4e('0x1f')](_0x3b08df)[_0x9b4e('0x20')](function(_0x2a4df1){return _0x2a4df1;});}return null;};}function removeEntity(_0x6508d7,_0x3af7e9){return function(_0x3e2a3c){if(_0x3e2a3c){return _0x3e2a3c[_0x9b4e('0x21')]()[_0x9b4e('0x20')](function(){_0x6508d7[_0x9b4e('0x15')](0xcc)[_0x9b4e('0x16')]();});}};}function handleEntityNotFound(_0x25003c,_0x59c103){return function(_0x2e1925){if(!_0x2e1925){_0x25003c['sendStatus'](0x194);}return _0x2e1925;};}function handleError(_0x5c9089,_0x20f502){_0x20f502=_0x20f502||0x1f4;return function(_0x326456){logger[_0x9b4e('0x22')](_0x326456[_0x9b4e('0x23')]);if(_0x326456[_0x9b4e('0x24')]){delete _0x326456['name'];}_0x5c9089[_0x9b4e('0x15')](_0x20f502)[_0x9b4e('0x25')](_0x326456);};}exports['index']=function(_0x2a88c8,_0x20f7b4){var _0x10c980={},_0x4ac1d5={},_0x38abca={'count':0x0,'rows':[]};var _0x397f6b=_[_0x9b4e('0x26')](db[_0x9b4e('0x27')][_0x9b4e('0x28')],function(_0x924cb3){return{'name':_0x924cb3[_0x9b4e('0x29')],'type':_0x924cb3['type'][_0x9b4e('0x2a')]};});_0x4ac1d5[_0x9b4e('0x2b')]=_[_0x9b4e('0x26')](_0x397f6b,_0x9b4e('0x24'));_0x4ac1d5[_0x9b4e('0x2c')]=_[_0x9b4e('0x2d')](_0x2a88c8[_0x9b4e('0x2c')]);_0x4ac1d5[_0x9b4e('0x2e')]=_[_0x9b4e('0x2f')](_0x4ac1d5[_0x9b4e('0x2b')],_0x4ac1d5['query']);_0x10c980[_0x9b4e('0x30')]=_[_0x9b4e('0x2f')](_0x4ac1d5[_0x9b4e('0x2b')],qs[_0x9b4e('0x31')](_0x2a88c8[_0x9b4e('0x2c')][_0x9b4e('0x31')]));_0x10c980[_0x9b4e('0x30')]=_0x10c980[_0x9b4e('0x30')]['length']?_0x10c980[_0x9b4e('0x30')]:_0x4ac1d5[_0x9b4e('0x2b')];if(!_0x2a88c8[_0x9b4e('0x2c')][_0x9b4e('0x32')](_0x9b4e('0x33'))){_0x10c980[_0x9b4e('0x18')]=qs['limit'](_0x2a88c8[_0x9b4e('0x2c')][_0x9b4e('0x18')]);_0x10c980['offset']=qs[_0x9b4e('0x1a')](_0x2a88c8[_0x9b4e('0x2c')][_0x9b4e('0x1a')]);}_0x10c980['order']=qs[_0x9b4e('0x34')](_0x2a88c8['query'][_0x9b4e('0x34')]);_0x10c980[_0x9b4e('0x35')]=qs[_0x9b4e('0x2e')](_['pick'](_0x2a88c8['query'],_0x4ac1d5[_0x9b4e('0x2e')]),_0x397f6b);if(_0x2a88c8['query'][_0x9b4e('0x36')]){_0x10c980[_0x9b4e('0x35')]=_[_0x9b4e('0x37')](_0x10c980[_0x9b4e('0x35')],{'$or':_['map'](_0x397f6b,function(_0x47cebe){if(_0x47cebe['type']!==_0x9b4e('0x38')){var _0x23b5aa={};_0x23b5aa[_0x47cebe[_0x9b4e('0x24')]]={'$like':'%'+_0x2a88c8[_0x9b4e('0x2c')][_0x9b4e('0x36')]+'%'};return _0x23b5aa;}})});}_0x10c980=_['merge']({},_0x10c980,_0x2a88c8[_0x9b4e('0x39')]);var _0x1a91b7={'where':_0x10c980[_0x9b4e('0x35')]};return db[_0x9b4e('0x27')]['count'](_0x1a91b7)[_0x9b4e('0x20')](function(_0x25121c){_0x38abca[_0x9b4e('0x19')]=_0x25121c;if(_0x2a88c8[_0x9b4e('0x2c')][_0x9b4e('0x3a')]){_0x10c980[_0x9b4e('0x3b')]=[{'all':!![]}];}return db[_0x9b4e('0x27')][_0x9b4e('0x3c')](_0x10c980);})[_0x9b4e('0x20')](function(_0x1a9cfa){_0x38abca['rows']=_0x1a9cfa;return _0x38abca;})[_0x9b4e('0x20')](respondWithFilteredResult(_0x20f7b4,_0x10c980))[_0x9b4e('0x3d')](handleError(_0x20f7b4,null));};exports[_0x9b4e('0x3e')]=function(_0x2e5d24,_0x56ad36){var _0x3868a6={'raw':!![],'where':{'id':_0x2e5d24[_0x9b4e('0x3f')]['id']}},_0x24334b={};_0x24334b[_0x9b4e('0x2b')]=_[_0x9b4e('0x2d')](db['JscriptyQuestionReport'][_0x9b4e('0x28')]);_0x24334b[_0x9b4e('0x2c')]=_[_0x9b4e('0x2d')](_0x2e5d24[_0x9b4e('0x2c')]);_0x24334b[_0x9b4e('0x2e')]=_['intersection'](_0x24334b[_0x9b4e('0x2b')],_0x24334b[_0x9b4e('0x2c')]);_0x3868a6['attributes']=_[_0x9b4e('0x2f')](_0x24334b['model'],qs[_0x9b4e('0x31')](_0x2e5d24[_0x9b4e('0x2c')][_0x9b4e('0x31')]));_0x3868a6[_0x9b4e('0x30')]=_0x3868a6[_0x9b4e('0x30')][_0x9b4e('0x40')]?_0x3868a6[_0x9b4e('0x30')]:_0x24334b['model'];if(_0x2e5d24[_0x9b4e('0x2c')][_0x9b4e('0x3a')]){_0x3868a6[_0x9b4e('0x3b')]=[{'all':!![]}];}_0x3868a6=_[_0x9b4e('0x37')]({},_0x3868a6,_0x2e5d24[_0x9b4e('0x39')]);return db[_0x9b4e('0x27')][_0x9b4e('0x41')](_0x3868a6)[_0x9b4e('0x20')](handleEntityNotFound(_0x56ad36,null))[_0x9b4e('0x20')](respondWithResult(_0x56ad36,null))[_0x9b4e('0x3d')](handleError(_0x56ad36,null));};exports[_0x9b4e('0x42')]=function(_0x37196e,_0x22a454){return db['JscriptyQuestionReport']['create'](_0x37196e[_0x9b4e('0x43')],{})[_0x9b4e('0x20')](respondWithResult(_0x22a454,0xc9))[_0x9b4e('0x3d')](handleError(_0x22a454,null));};exports[_0x9b4e('0x1f')]=function(_0x295da7,_0x48f1d0){if(_0x295da7['body']['id']){delete _0x295da7[_0x9b4e('0x43')]['id'];}return db[_0x9b4e('0x27')]['find']({'where':{'id':_0x295da7[_0x9b4e('0x3f')]['id']}})[_0x9b4e('0x20')](handleEntityNotFound(_0x48f1d0,null))[_0x9b4e('0x20')](saveUpdates(_0x295da7[_0x9b4e('0x43')],null))[_0x9b4e('0x20')](respondWithResult(_0x48f1d0,null))[_0x9b4e('0x3d')](handleError(_0x48f1d0,null));};exports['destroy']=function(_0x5f546e,_0xe0e1cd){return db[_0x9b4e('0x27')][_0x9b4e('0x41')]({'where':{'id':_0x5f546e[_0x9b4e('0x3f')]['id']}})[_0x9b4e('0x20')](handleEntityNotFound(_0xe0e1cd,null))[_0x9b4e('0x20')](removeEntity(_0xe0e1cd,null))[_0x9b4e('0x3d')](handleError(_0xe0e1cd,null));};exports[_0x9b4e('0x44')]=function(_0x489cb1,_0x3a8399){return db[_0x9b4e('0x27')][_0x9b4e('0x44')]()[_0x9b4e('0x20')](respondWithResult(_0x3a8399,null))['catch'](handleError(_0x3a8399,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 06380cc..6118591 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 _0x6caf=['rimraf','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x561363,_0x3aa05e){var _0x426bbe=function(_0x361030){while(--_0x361030){_0x561363['push'](_0x561363['shift']());}};_0x426bbe(++_0x3aa05e);}(_0x6caf,0x7d));var _0xf6ca=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x6caf[_0x5f0501];return _0x3c2c45;};'use strict';var _=require(_0xf6ca('0x0'));var util=require('util');var logger=require(_0xf6ca('0x1'))(_0xf6ca('0x2'));var moment=require(_0xf6ca('0x3'));var BPromise=require(_0xf6ca('0x4'));var rp=require(_0xf6ca('0x5'));var fs=require('fs');var path=require(_0xf6ca('0x6'));var rimraf=require(_0xf6ca('0x7'));var config=require('../../config/environment');var attributes=require(_0xf6ca('0x8'));module[_0xf6ca('0x9')]=function(_0x27167e,_0x455165){return _0x27167e['define'](_0xf6ca('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29b2=['path','rimraf','../../config/environment','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','moment','bluebird'];(function(_0x4caedd,_0x7a6888){var _0x1402f1=function(_0x548cf7){while(--_0x548cf7){_0x4caedd['push'](_0x4caedd['shift']());}};_0x1402f1(++_0x7a6888);}(_0x29b2,0x16e));var _0x229b=function(_0x335b23,_0x5736bf){_0x335b23=_0x335b23-0x0;var _0x13e695=_0x29b2[_0x335b23];return _0x13e695;};'use strict';var _=require('lodash');var util=require(_0x229b('0x0'));var logger=require(_0x229b('0x1'))('api');var moment=require(_0x229b('0x2'));var BPromise=require(_0x229b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x229b('0x4'));var rimraf=require(_0x229b('0x5'));var config=require(_0x229b('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0xdf95ce,_0x33c221){return _0xdf95ce[_0x229b('0x7')](_0x229b('0x8'),attributes,{'tableName':_0x229b('0x9'),'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 dd4104c..c1ab82f 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 _0x304a=['code','message','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x304a,0xc8));var _0xa304=function(_0x136d4d,_0x43ad7a){_0x136d4d=_0x136d4d-0x0;var _0x6cef6f=_0x304a[_0x136d4d];return _0x6cef6f;};'use strict';var _=require(_0xa304('0x0'));var util=require(_0xa304('0x1'));var moment=require('moment');var BPromise=require(_0xa304('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa304('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa304('0x4'));var logger=require(_0xa304('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa304('0x6'));var client=jayson[_0xa304('0x7')][_0xa304('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d9c49,_0x4547e9,_0x5e4557){return new BPromise(function(_0x58f57d,_0x328d99){return client[_0xa304('0x9')](_0x5d9c49,_0x5e4557)[_0xa304('0xa')](function(_0x421f91){logger[_0xa304('0xb')](_0xa304('0xc'),_0x4547e9,_0xa304('0xd'));logger['debug'](_0xa304('0xe'),_0x4547e9,_0xa304('0xd'),JSON['stringify'](_0x421f91));if(_0x421f91[_0xa304('0xf')]){if(_0x421f91[_0xa304('0xf')][_0xa304('0x10')]===0x1f4){logger[_0xa304('0xf')](_0xa304('0xc'),_0x4547e9,_0x421f91['error'][_0xa304('0x11')]);return _0x328d99(_0x421f91['error'][_0xa304('0x11')]);}logger[_0xa304('0xf')](_0xa304('0xc'),_0x4547e9,_0x421f91[_0xa304('0xf')][_0xa304('0x11')]);return _0x58f57d(_0x421f91['error'][_0xa304('0x11')]);}else{logger[_0xa304('0xb')](_0xa304('0xc'),_0x4547e9,_0xa304('0xd'));_0x58f57d(_0x421f91['result']['message']);}})['catch'](function(_0x3fc94e){logger[_0xa304('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4547e9,_0x3fc94e);_0x328d99(_0x3fc94e);});});} \ No newline at end of file +var _0xa561=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1c9d7a,_0x38c088){var _0x427f34=function(_0x5e4f3f){while(--_0x5e4f3f){_0x1c9d7a['push'](_0x1c9d7a['shift']());}};_0x427f34(++_0x38c088);}(_0xa561,0xaa));var _0x1a56=function(_0xd34649,_0x3d3ba9){_0xd34649=_0xd34649-0x0;var _0x4e6b65=_0xa561[_0xd34649];return _0x4e6b65;};'use strict';var _=require(_0x1a56('0x0'));var util=require(_0x1a56('0x1'));var moment=require(_0x1a56('0x2'));var BPromise=require(_0x1a56('0x3'));var rs=require(_0x1a56('0x4'));var fs=require('fs');var Redis=require(_0x1a56('0x5'));var db=require(_0x1a56('0x6'))['db'];var utils=require(_0x1a56('0x7'));var logger=require(_0x1a56('0x8'))(_0x1a56('0x9'));var config=require(_0x1a56('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1a56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19c227,_0x18b4ff,_0x1d2012){return new BPromise(function(_0x264e3d,_0x5b836a){return client[_0x1a56('0xc')](_0x19c227,_0x1d2012)['then'](function(_0x1fff30){logger[_0x1a56('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x18b4ff,_0x1a56('0xe'));logger['debug'](_0x1a56('0xf'),_0x18b4ff,'request\x20sent',JSON[_0x1a56('0x10')](_0x1fff30));if(_0x1fff30[_0x1a56('0x11')]){if(_0x1fff30['error'][_0x1a56('0x12')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x18b4ff,_0x1fff30[_0x1a56('0x11')][_0x1a56('0x13')]);return _0x5b836a(_0x1fff30['error'][_0x1a56('0x13')]);}logger[_0x1a56('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x18b4ff,_0x1fff30['error'][_0x1a56('0x13')]);return _0x264e3d(_0x1fff30[_0x1a56('0x11')][_0x1a56('0x13')]);}else{logger[_0x1a56('0xd')](_0x1a56('0x14'),_0x18b4ff,_0x1a56('0xe'));_0x264e3d(_0x1fff30[_0x1a56('0x15')][_0x1a56('0x13')]);}})['catch'](function(_0x51194b){logger[_0x1a56('0x11')](_0x1a56('0x14'),_0x18b4ff,_0x51194b);_0x5b836a(_0x51194b);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index d8b8bba..a54d9a3 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 _0xe737=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/questions','post','create','update','destroy','exports','multer','util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe737,0x1e1));var _0x7e73=function(_0x4d6846,_0x1c33d8){_0x4d6846=_0x4d6846-0x0;var _0x310c47=_0xe737[_0x4d6846];return _0x310c47;};'use strict';var multer=require(_0x7e73('0x0'));var util=require(_0x7e73('0x1'));var path=require(_0x7e73('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e73('0x3'));var router=express[_0x7e73('0x4')]();var fs_extra=require(_0x7e73('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e73('0x6'));var config=require(_0x7e73('0x7'));var controller=require(_0x7e73('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7e73('0x9')](_0x7e73('0xa'),auth['isAuthenticated'](),controller[_0x7e73('0xb')]);router[_0x7e73('0x9')](_0x7e73('0xc'),auth[_0x7e73('0xd')](),controller[_0x7e73('0xe')]);router[_0x7e73('0x9')](_0x7e73('0xf'),auth[_0x7e73('0xd')](),controller['getQuestions']);router[_0x7e73('0x10')]('/',auth[_0x7e73('0xd')](),controller[_0x7e73('0x11')]);router['put'](_0x7e73('0xc'),auth[_0x7e73('0xd')](),controller[_0x7e73('0x12')]);router['delete'](_0x7e73('0xc'),auth[_0x7e73('0xd')](),controller[_0x7e73('0x13')]);module[_0x7e73('0x14')]=router; \ No newline at end of file +var _0x9a8f=['create','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','describe','/:id','show','/:id/questions','getQuestions','post'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x9a8f,0x14f));var _0xf9a8=function(_0x375e4f,_0x851de7){_0x375e4f=_0x375e4f-0x0;var _0x3a891c=_0x9a8f[_0x375e4f];return _0x3a891c;};'use strict';var multer=require(_0xf9a8('0x0'));var util=require(_0xf9a8('0x1'));var path=require('path');var timeout=require(_0xf9a8('0x2'));var express=require(_0xf9a8('0x3'));var router=express['Router']();var fs_extra=require(_0xf9a8('0x4'));var auth=require(_0xf9a8('0x5'));var interaction=require(_0xf9a8('0x6'));var config=require(_0xf9a8('0x7'));var controller=require(_0xf9a8('0x8'));router['get']('/',auth[_0xf9a8('0x9')](),controller['index']);router[_0xf9a8('0xa')]('/describe',auth[_0xf9a8('0x9')](),controller[_0xf9a8('0xb')]);router[_0xf9a8('0xa')](_0xf9a8('0xc'),auth[_0xf9a8('0x9')](),controller[_0xf9a8('0xd')]);router[_0xf9a8('0xa')](_0xf9a8('0xe'),auth[_0xf9a8('0x9')](),controller[_0xf9a8('0xf')]);router[_0xf9a8('0x10')]('/',auth[_0xf9a8('0x9')](),controller[_0xf9a8('0x11')]);router[_0xf9a8('0x12')](_0xf9a8('0xc'),auth[_0xf9a8('0x9')](),controller['update']);router[_0xf9a8('0x13')](_0xf9a8('0xc'),auth[_0xf9a8('0x9')](),controller[_0xf9a8('0x14')]);module[_0xf9a8('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 fd30f75..b06e915 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 _0x09a7=['BOOLEAN','moment','DATE','setDataValue','format','STRING'];(function(_0x58d27b,_0x49a23a){var _0x47f918=function(_0x5936e5){while(--_0x5936e5){_0x58d27b['push'](_0x58d27b['shift']());}};_0x47f918(++_0x49a23a);}(_0x09a7,0x15d));var _0x709a=function(_0x3bde00,_0x5218c5){_0x3bde00=_0x3bde00-0x0;var _0x11b771=_0x09a7[_0x3bde00];return _0x11b771;};'use strict';var moment=require(_0x709a('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x709a('0x1')],'set':function(_0x3be93d){this[_0x709a('0x2')]('starttime',_0x3be93d);this[_0x709a('0x2')]('endtime',moment()[_0x709a('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x709a('0x1')]},'membername':{'type':Sequelize[_0x709a('0x4')]},'projectname':{'type':Sequelize[_0x709a('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x709a('0x4')]},'calleridname':{'type':Sequelize[_0x709a('0x4')]},'calleridnum':{'type':Sequelize[_0x709a('0x4')]},'completed':{'type':Sequelize[_0x709a('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x6610=['sequelize','exports','setDataValue','format','STRING'];(function(_0x13110a,_0x48c84a){var _0xbe2ec=function(_0x3e0011){while(--_0x3e0011){_0x13110a['push'](_0x13110a['shift']());}};_0xbe2ec(++_0x48c84a);}(_0x6610,0x87));var _0x0661=function(_0x297421,_0x789748){_0x297421=_0x297421-0x0;var _0x52c846=_0x6610[_0x297421];return _0x52c846;};'use strict';var moment=require('moment');var Sequelize=require(_0x0661('0x0'));module[_0x0661('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3643ba){this[_0x0661('0x2')]('starttime',_0x3643ba);this[_0x0661('0x2')]('endtime',moment()[_0x0661('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x0661('0x4')]},'projectname':{'type':Sequelize[_0x0661('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0661('0x4')]},'calleridname':{'type':Sequelize[_0x0661('0x4')]},'calleridnum':{'type':Sequelize[_0x0661('0x4')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index eb9c833..d88eef8 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 _0xd9b2=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','create','body','catch','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','querystring','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys'];(function(_0x45af9d,_0x5d8012){var _0x38d971=function(_0x12ffd2){while(--_0x12ffd2){_0x45af9d['push'](_0x45af9d['shift']());}};_0x38d971(++_0x5d8012);}(_0xd9b2,0x1dc));var _0x2d9b=function(_0x1f803d,_0x1c966e){_0x1f803d=_0x1f803d-0x0;var _0x549186=_0xd9b2[_0x1f803d];return _0x549186;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d9b('0x0'));var zipdir=require(_0x2d9b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d9b('0x2'));var moment=require(_0x2d9b('0x3'));var BPromise=require(_0x2d9b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2d9b('0x5'));var sox=require(_0x2d9b('0x6'));var csv=require(_0x2d9b('0x7'));var ejs=require(_0x2d9b('0x8'));var fs=require('fs');var fs_extra=require(_0x2d9b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d9b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d9b('0x7'));var querystring=require(_0x2d9b('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d9b('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2d9b('0xd'));var utils=require(_0x2d9b('0xe'));var config=require(_0x2d9b('0xf'));var licenseUtil=require(_0x2d9b('0x10'));var db=require(_0x2d9b('0x11'))['db'];function respondWithStatusCode(_0x3bc467,_0xb8a7fb){_0xb8a7fb=_0xb8a7fb||0xcc;return function(_0x4e4e5e){if(_0x4e4e5e){return _0x3bc467[_0x2d9b('0x12')](_0xb8a7fb);}return _0x3bc467[_0x2d9b('0x13')](_0xb8a7fb)[_0x2d9b('0x14')]();};}function respondWithResult(_0x20222e,_0x2a9b0d){_0x2a9b0d=_0x2a9b0d||0xc8;return function(_0x5beacc){if(_0x5beacc){return _0x20222e[_0x2d9b('0x13')](_0x2a9b0d)[_0x2d9b('0x15')](_0x5beacc);}};}function respondWithFilteredResult(_0x1cacdc,_0x53e94f){return function(_0x46ba38){if(_0x46ba38){var _0x10f80e=typeof _0x53e94f[_0x2d9b('0x16')]===_0x2d9b('0x17')&&typeof _0x53e94f[_0x2d9b('0x18')]==='undefined';var _0x1565d3=_0x46ba38['count'];var _0x5a6775=_0x10f80e?0x0:_0x53e94f['offset'];var _0x593c9f=_0x10f80e?_0x46ba38[_0x2d9b('0x19')]:_0x53e94f[_0x2d9b('0x16')]+_0x53e94f[_0x2d9b('0x18')];var _0x5e2213;if(_0x593c9f>=_0x1565d3){_0x593c9f=_0x1565d3;_0x5e2213=0xc8;}else{_0x5e2213=0xce;}_0x1cacdc[_0x2d9b('0x13')](_0x5e2213);return _0x1cacdc[_0x2d9b('0x1a')]('Content-Range',_0x5a6775+'-'+_0x593c9f+'/'+_0x1565d3)[_0x2d9b('0x15')](_0x46ba38);}return null;};}function patchUpdates(_0x38bd39){return function(_0x5babb5){try{jsonpatch[_0x2d9b('0x1b')](_0x5babb5,_0x38bd39,!![]);}catch(_0x491d2a){return BPromise[_0x2d9b('0x1c')](_0x491d2a);}return _0x5babb5[_0x2d9b('0x1d')]();};}function saveUpdates(_0x46b302,_0x1a2706){return function(_0x51dc5e){if(_0x51dc5e){return _0x51dc5e[_0x2d9b('0x1e')](_0x46b302)[_0x2d9b('0x1f')](function(_0x1da18f){return _0x1da18f;});}return null;};}function removeEntity(_0xabe742,_0x33c938){return function(_0x2eb67a){if(_0x2eb67a){return _0x2eb67a['destroy']()['then'](function(){_0xabe742[_0x2d9b('0x13')](0xcc)[_0x2d9b('0x14')]();});}};}function handleEntityNotFound(_0x2e74f6,_0x567995){return function(_0x47d780){if(!_0x47d780){_0x2e74f6[_0x2d9b('0x12')](0x194);}return _0x47d780;};}function handleError(_0x39c8f3,_0x3370ba){_0x3370ba=_0x3370ba||0x1f4;return function(_0x1599ba){logger['error'](_0x1599ba[_0x2d9b('0x20')]);if(_0x1599ba[_0x2d9b('0x21')]){delete _0x1599ba[_0x2d9b('0x21')];}_0x39c8f3[_0x2d9b('0x13')](_0x3370ba)['send'](_0x1599ba);};}exports['index']=function(_0xe2abd8,_0x4131a8){var _0x48ade3={},_0x4f5b98={},_0x6f71b3={'count':0x0,'rows':[]};var _0x460300=_[_0x2d9b('0x22')](db[_0x2d9b('0x23')][_0x2d9b('0x24')],function(_0x23023a){return{'name':_0x23023a[_0x2d9b('0x25')],'type':_0x23023a[_0x2d9b('0x26')][_0x2d9b('0x27')]};});_0x4f5b98['model']=_['map'](_0x460300,_0x2d9b('0x21'));_0x4f5b98[_0x2d9b('0x28')]=_[_0x2d9b('0x29')](_0xe2abd8[_0x2d9b('0x28')]);_0x4f5b98[_0x2d9b('0x2a')]=_[_0x2d9b('0x2b')](_0x4f5b98[_0x2d9b('0x2c')],_0x4f5b98[_0x2d9b('0x28')]);_0x48ade3[_0x2d9b('0x2d')]=_[_0x2d9b('0x2b')](_0x4f5b98[_0x2d9b('0x2c')],qs[_0x2d9b('0x2e')](_0xe2abd8[_0x2d9b('0x28')][_0x2d9b('0x2e')]));_0x48ade3[_0x2d9b('0x2d')]=_0x48ade3[_0x2d9b('0x2d')][_0x2d9b('0x2f')]?_0x48ade3[_0x2d9b('0x2d')]:_0x4f5b98[_0x2d9b('0x2c')];if(!_0xe2abd8[_0x2d9b('0x28')][_0x2d9b('0x30')](_0x2d9b('0x31'))){_0x48ade3[_0x2d9b('0x18')]=qs[_0x2d9b('0x18')](_0xe2abd8['query']['limit']);_0x48ade3[_0x2d9b('0x16')]=qs[_0x2d9b('0x16')](_0xe2abd8[_0x2d9b('0x28')][_0x2d9b('0x16')]);}_0x48ade3[_0x2d9b('0x32')]=qs[_0x2d9b('0x33')](_0xe2abd8['query'][_0x2d9b('0x33')]);_0x48ade3[_0x2d9b('0x34')]=qs[_0x2d9b('0x2a')](_[_0x2d9b('0x35')](_0xe2abd8[_0x2d9b('0x28')],_0x4f5b98[_0x2d9b('0x2a')]),_0x460300);if(_0xe2abd8[_0x2d9b('0x28')][_0x2d9b('0x36')]){_0x48ade3['where']=_[_0x2d9b('0x37')](_0x48ade3[_0x2d9b('0x34')],{'$or':_[_0x2d9b('0x22')](_0x460300,function(_0x384dcb){if(_0x384dcb[_0x2d9b('0x26')]!==_0x2d9b('0x38')){var _0x2ac439={};_0x2ac439[_0x384dcb[_0x2d9b('0x21')]]={'$like':'%'+_0xe2abd8[_0x2d9b('0x28')][_0x2d9b('0x36')]+'%'};return _0x2ac439;}})});}_0x48ade3=_['merge']({},_0x48ade3,_0xe2abd8['options']);var _0xe4beb0={'where':_0x48ade3[_0x2d9b('0x34')]};return db[_0x2d9b('0x23')][_0x2d9b('0x19')](_0xe4beb0)[_0x2d9b('0x1f')](function(_0x1de534){_0x6f71b3[_0x2d9b('0x19')]=_0x1de534;if(_0xe2abd8['query'][_0x2d9b('0x39')]){_0x48ade3['include']=[{'all':!![]}];}return db[_0x2d9b('0x23')][_0x2d9b('0x3a')](_0x48ade3);})['then'](function(_0x1fe604){_0x6f71b3[_0x2d9b('0x3b')]=_0x1fe604;return _0x6f71b3;})[_0x2d9b('0x1f')](respondWithFilteredResult(_0x4131a8,_0x48ade3))['catch'](handleError(_0x4131a8,null));};exports[_0x2d9b('0x3c')]=function(_0x2211cd,_0x3dca29){var _0x1ca40f={'raw':!![],'where':{'id':_0x2211cd[_0x2d9b('0x3d')]['id']}},_0x333f13={};_0x333f13[_0x2d9b('0x2c')]=_[_0x2d9b('0x29')](db[_0x2d9b('0x23')][_0x2d9b('0x24')]);_0x333f13[_0x2d9b('0x28')]=_['keys'](_0x2211cd[_0x2d9b('0x28')]);_0x333f13['filters']=_[_0x2d9b('0x2b')](_0x333f13[_0x2d9b('0x2c')],_0x333f13[_0x2d9b('0x28')]);_0x1ca40f[_0x2d9b('0x2d')]=_[_0x2d9b('0x2b')](_0x333f13['model'],qs[_0x2d9b('0x2e')](_0x2211cd[_0x2d9b('0x28')][_0x2d9b('0x2e')]));_0x1ca40f['attributes']=_0x1ca40f[_0x2d9b('0x2d')][_0x2d9b('0x2f')]?_0x1ca40f['attributes']:_0x333f13['model'];if(_0x2211cd[_0x2d9b('0x28')][_0x2d9b('0x39')]){_0x1ca40f[_0x2d9b('0x3e')]=[{'all':!![]}];}_0x1ca40f=_[_0x2d9b('0x37')]({},_0x1ca40f,_0x2211cd[_0x2d9b('0x3f')]);return db[_0x2d9b('0x23')]['find'](_0x1ca40f)[_0x2d9b('0x1f')](handleEntityNotFound(_0x3dca29,null))[_0x2d9b('0x1f')](respondWithResult(_0x3dca29,null))['catch'](handleError(_0x3dca29,null));};exports[_0x2d9b('0x40')]=function(_0x181014,_0x1dac58){return db['JscriptySessionReport'][_0x2d9b('0x40')](_0x181014[_0x2d9b('0x41')],{})[_0x2d9b('0x1f')](respondWithResult(_0x1dac58,0xc9))[_0x2d9b('0x42')](handleError(_0x1dac58,null));};exports[_0x2d9b('0x1e')]=function(_0x454f51,_0x4d8507){if(_0x454f51[_0x2d9b('0x41')]['id']){delete _0x454f51[_0x2d9b('0x41')]['id'];}return db['JscriptySessionReport'][_0x2d9b('0x43')]({'where':{'id':_0x454f51[_0x2d9b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4d8507,null))['then'](saveUpdates(_0x454f51['body'],null))['then'](respondWithResult(_0x4d8507,null))['catch'](handleError(_0x4d8507,null));};exports[_0x2d9b('0x44')]=function(_0x291d5e,_0x54fb97){return db['JscriptySessionReport']['find']({'where':{'id':_0x291d5e[_0x2d9b('0x3d')]['id']}})[_0x2d9b('0x1f')](handleEntityNotFound(_0x54fb97,null))[_0x2d9b('0x1f')](removeEntity(_0x54fb97,null))[_0x2d9b('0x42')](handleError(_0x54fb97,null));};exports[_0x2d9b('0x45')]=function(_0x32535b,_0xbd962f){return db[_0x2d9b('0x23')][_0x2d9b('0x45')]()[_0x2d9b('0x1f')](respondWithResult(_0xbd962f,null))['catch'](handleError(_0xbd962f,null));};exports[_0x2d9b('0x46')]=function(_0x1d02c6,_0x4c5727,_0x40e94a){var _0x32332d={'raw':!![],'where':{}};var _0x10239f={};var _0x30e992={'count':0x0,'rows':[]};return db[_0x2d9b('0x23')][_0x2d9b('0x47')]({'where':{'id':_0x1d02c6[_0x2d9b('0x3d')]['id']}})[_0x2d9b('0x1f')](handleEntityNotFound(_0x4c5727,null))['then'](function(_0x444cc5){if(_0x444cc5){_0x10239f[_0x2d9b('0x2c')]=_['keys'](db[_0x2d9b('0x48')][_0x2d9b('0x24')]);_0x10239f[_0x2d9b('0x28')]=_[_0x2d9b('0x29')](_0x1d02c6['query']);_0x10239f[_0x2d9b('0x2a')]=_[_0x2d9b('0x2b')](_0x10239f['model'],_0x10239f[_0x2d9b('0x28')]);_0x32332d[_0x2d9b('0x2d')]=_[_0x2d9b('0x2b')](_0x10239f['model'],qs['fields'](_0x1d02c6[_0x2d9b('0x28')][_0x2d9b('0x2e')]));_0x32332d[_0x2d9b('0x2d')]=_0x32332d[_0x2d9b('0x2d')][_0x2d9b('0x2f')]?_0x32332d[_0x2d9b('0x2d')]:_0x10239f[_0x2d9b('0x2c')];if(!_0x1d02c6[_0x2d9b('0x28')][_0x2d9b('0x30')]('nolimit')){_0x32332d[_0x2d9b('0x18')]=qs['limit'](_0x1d02c6[_0x2d9b('0x28')][_0x2d9b('0x18')]);_0x32332d[_0x2d9b('0x16')]=qs[_0x2d9b('0x16')](_0x1d02c6['query'][_0x2d9b('0x16')]);}_0x32332d['order']=qs['sort'](_0x1d02c6[_0x2d9b('0x28')]['sort']);_0x32332d[_0x2d9b('0x34')]=qs[_0x2d9b('0x2a')](_[_0x2d9b('0x35')](_0x1d02c6[_0x2d9b('0x28')],_0x10239f[_0x2d9b('0x2a')]));_0x32332d['where'][_0x2d9b('0x49')]=_0x444cc5['id'];if(_0x1d02c6['query'][_0x2d9b('0x36')]){_0x32332d['where']=_['merge'](_0x32332d[_0x2d9b('0x34')],{'$or':_[_0x2d9b('0x22')](_0x32332d[_0x2d9b('0x2d')],function(_0x55844d){var _0xbcd10={};_0xbcd10[_0x55844d]={'$like':'%'+_0x1d02c6[_0x2d9b('0x28')]['filter']+'%'};return _0xbcd10;})});}_0x32332d=_['merge']({},_0x32332d,_0x1d02c6[_0x2d9b('0x3f')]);return db[_0x2d9b('0x48')][_0x2d9b('0x19')]({'where':_0x32332d['where']})[_0x2d9b('0x1f')](function(_0x269bc8){_0x30e992[_0x2d9b('0x19')]=_0x269bc8;if(_0x1d02c6[_0x2d9b('0x28')][_0x2d9b('0x39')]){_0x32332d[_0x2d9b('0x3e')]=[{'all':!![]}];}return db[_0x2d9b('0x48')]['findAll'](_0x32332d);})[_0x2d9b('0x1f')](function(_0x376a2b){_0x30e992['rows']=_0x376a2b;return _0x30e992;});}})[_0x2d9b('0x1f')](respondWithFilteredResult(_0x4c5727,_0x32332d))[_0x2d9b('0x42')](handleError(_0x4c5727,null));}; \ No newline at end of file +var _0xff67=['util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','describe','JscriptyQuestionReport','hasOwnProperty','pick','filter','eml-format','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x566816,_0x73fea5){var _0x36719c=function(_0x4cb076){while(--_0x4cb076){_0x566816['push'](_0x566816['shift']());}};_0x36719c(++_0x73fea5);}(_0xff67,0x18a));var _0x7ff6=function(_0x400672,_0x43ba85){_0x400672=_0x400672-0x0;var _0x34eb04=_0xff67[_0x400672];return _0x34eb04;};'use strict';var emlformat=require(_0x7ff6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7ff6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ff6('0x2'));var moment=require(_0x7ff6('0x3'));var BPromise=require(_0x7ff6('0x4'));var Mustache=require(_0x7ff6('0x5'));var util=require(_0x7ff6('0x6'));var path=require(_0x7ff6('0x7'));var sox=require('sox');var csv=require(_0x7ff6('0x8'));var ejs=require(_0x7ff6('0x9'));var fs=require('fs');var fs_extra=require(_0x7ff6('0xa'));var _=require(_0x7ff6('0xb'));var squel=require(_0x7ff6('0xc'));var crypto=require(_0x7ff6('0xd'));var jsforce=require(_0x7ff6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7ff6('0x8'));var querystring=require(_0x7ff6('0xf'));var Papa=require(_0x7ff6('0x10'));var Redis=require(_0x7ff6('0x11'));var authService=require(_0x7ff6('0x12'));var qs=require(_0x7ff6('0x13'));var as=require(_0x7ff6('0x14'));var hardwareService=require(_0x7ff6('0x15'));var logger=require(_0x7ff6('0x16'))('api');var utils=require(_0x7ff6('0x17'));var config=require(_0x7ff6('0x18'));var licenseUtil=require(_0x7ff6('0x19'));var db=require(_0x7ff6('0x1a'))['db'];function respondWithStatusCode(_0x4b105f,_0x475939){_0x475939=_0x475939||0xcc;return function(_0x589251){if(_0x589251){return _0x4b105f[_0x7ff6('0x1b')](_0x475939);}return _0x4b105f[_0x7ff6('0x1c')](_0x475939)[_0x7ff6('0x1d')]();};}function respondWithResult(_0x1c8fc8,_0x205e9c){_0x205e9c=_0x205e9c||0xc8;return function(_0x132e89){if(_0x132e89){return _0x1c8fc8[_0x7ff6('0x1c')](_0x205e9c)[_0x7ff6('0x1e')](_0x132e89);}};}function respondWithFilteredResult(_0x140220,_0x459852){return function(_0x25f4d2){if(_0x25f4d2){var _0x545ac3=typeof _0x459852['offset']==='undefined'&&typeof _0x459852['limit']===_0x7ff6('0x1f');var _0x2d84f6=_0x25f4d2[_0x7ff6('0x20')];var _0x5c659a=_0x545ac3?0x0:_0x459852[_0x7ff6('0x21')];var _0x22bf2b=_0x545ac3?_0x25f4d2[_0x7ff6('0x20')]:_0x459852[_0x7ff6('0x21')]+_0x459852['limit'];var _0x2d4281;if(_0x22bf2b>=_0x2d84f6){_0x22bf2b=_0x2d84f6;_0x2d4281=0xc8;}else{_0x2d4281=0xce;}_0x140220['status'](_0x2d4281);return _0x140220[_0x7ff6('0x22')](_0x7ff6('0x23'),_0x5c659a+'-'+_0x22bf2b+'/'+_0x2d84f6)[_0x7ff6('0x1e')](_0x25f4d2);}return null;};}function patchUpdates(_0x872e8f){return function(_0x232f5b){try{jsonpatch[_0x7ff6('0x24')](_0x232f5b,_0x872e8f,!![]);}catch(_0xdfa8bd){return BPromise[_0x7ff6('0x25')](_0xdfa8bd);}return _0x232f5b['save']();};}function saveUpdates(_0x5752b2,_0x188cfc){return function(_0x3ba663){if(_0x3ba663){return _0x3ba663[_0x7ff6('0x26')](_0x5752b2)[_0x7ff6('0x27')](function(_0x57ad9a){return _0x57ad9a;});}return null;};}function removeEntity(_0x1af8e4,_0x4d6bc0){return function(_0xf0cecd){if(_0xf0cecd){return _0xf0cecd[_0x7ff6('0x28')]()[_0x7ff6('0x27')](function(){_0x1af8e4[_0x7ff6('0x1c')](0xcc)[_0x7ff6('0x1d')]();});}};}function handleEntityNotFound(_0x5dcf98,_0x230b79){return function(_0x50120e){if(!_0x50120e){_0x5dcf98['sendStatus'](0x194);}return _0x50120e;};}function handleError(_0x23bc7c,_0x25e018){_0x25e018=_0x25e018||0x1f4;return function(_0x176a93){logger[_0x7ff6('0x29')](_0x176a93[_0x7ff6('0x2a')]);if(_0x176a93[_0x7ff6('0x2b')]){delete _0x176a93[_0x7ff6('0x2b')];}_0x23bc7c[_0x7ff6('0x1c')](_0x25e018)[_0x7ff6('0x2c')](_0x176a93);};}exports['index']=function(_0x1dbd11,_0xd26b58){var _0x37cc96={},_0x120780={},_0x15e034={'count':0x0,'rows':[]};var _0x59f5ab=_[_0x7ff6('0x2d')](db[_0x7ff6('0x2e')][_0x7ff6('0x2f')],function(_0x1dd606){return{'name':_0x1dd606[_0x7ff6('0x30')],'type':_0x1dd606[_0x7ff6('0x31')][_0x7ff6('0x32')]};});_0x120780[_0x7ff6('0x33')]=_[_0x7ff6('0x2d')](_0x59f5ab,_0x7ff6('0x2b'));_0x120780[_0x7ff6('0x34')]=_[_0x7ff6('0x35')](_0x1dbd11['query']);_0x120780['filters']=_[_0x7ff6('0x36')](_0x120780[_0x7ff6('0x33')],_0x120780[_0x7ff6('0x34')]);_0x37cc96[_0x7ff6('0x37')]=_['intersection'](_0x120780[_0x7ff6('0x33')],qs[_0x7ff6('0x38')](_0x1dbd11['query'][_0x7ff6('0x38')]));_0x37cc96[_0x7ff6('0x37')]=_0x37cc96[_0x7ff6('0x37')][_0x7ff6('0x39')]?_0x37cc96[_0x7ff6('0x37')]:_0x120780[_0x7ff6('0x33')];if(!_0x1dbd11[_0x7ff6('0x34')]['hasOwnProperty'](_0x7ff6('0x3a'))){_0x37cc96[_0x7ff6('0x3b')]=qs[_0x7ff6('0x3b')](_0x1dbd11[_0x7ff6('0x34')][_0x7ff6('0x3b')]);_0x37cc96['offset']=qs['offset'](_0x1dbd11[_0x7ff6('0x34')][_0x7ff6('0x21')]);}_0x37cc96[_0x7ff6('0x3c')]=qs[_0x7ff6('0x3d')](_0x1dbd11[_0x7ff6('0x34')][_0x7ff6('0x3d')]);_0x37cc96[_0x7ff6('0x3e')]=qs[_0x7ff6('0x3f')](_['pick'](_0x1dbd11[_0x7ff6('0x34')],_0x120780['filters']),_0x59f5ab);if(_0x1dbd11['query']['filter']){_0x37cc96['where']=_['merge'](_0x37cc96[_0x7ff6('0x3e')],{'$or':_[_0x7ff6('0x2d')](_0x59f5ab,function(_0x30cda2){if(_0x30cda2[_0x7ff6('0x31')]!=='VIRTUAL'){var _0x268fd1={};_0x268fd1[_0x30cda2[_0x7ff6('0x2b')]]={'$like':'%'+_0x1dbd11['query']['filter']+'%'};return _0x268fd1;}})});}_0x37cc96=_['merge']({},_0x37cc96,_0x1dbd11[_0x7ff6('0x40')]);var _0x3dd434={'where':_0x37cc96['where']};return db[_0x7ff6('0x2e')][_0x7ff6('0x20')](_0x3dd434)[_0x7ff6('0x27')](function(_0x3e5562){_0x15e034[_0x7ff6('0x20')]=_0x3e5562;if(_0x1dbd11[_0x7ff6('0x34')]['includeAll']){_0x37cc96[_0x7ff6('0x41')]=[{'all':!![]}];}return db[_0x7ff6('0x2e')][_0x7ff6('0x42')](_0x37cc96);})[_0x7ff6('0x27')](function(_0x41c773){_0x15e034[_0x7ff6('0x43')]=_0x41c773;return _0x15e034;})[_0x7ff6('0x27')](respondWithFilteredResult(_0xd26b58,_0x37cc96))[_0x7ff6('0x44')](handleError(_0xd26b58,null));};exports[_0x7ff6('0x45')]=function(_0x4e1128,_0x287546){var _0x117495={'raw':!![],'where':{'id':_0x4e1128[_0x7ff6('0x46')]['id']}},_0x1168b5={};_0x1168b5[_0x7ff6('0x33')]=_[_0x7ff6('0x35')](db['JscriptySessionReport']['rawAttributes']);_0x1168b5[_0x7ff6('0x34')]=_[_0x7ff6('0x35')](_0x4e1128[_0x7ff6('0x34')]);_0x1168b5[_0x7ff6('0x3f')]=_[_0x7ff6('0x36')](_0x1168b5[_0x7ff6('0x33')],_0x1168b5[_0x7ff6('0x34')]);_0x117495[_0x7ff6('0x37')]=_[_0x7ff6('0x36')](_0x1168b5[_0x7ff6('0x33')],qs['fields'](_0x4e1128[_0x7ff6('0x34')][_0x7ff6('0x38')]));_0x117495['attributes']=_0x117495[_0x7ff6('0x37')][_0x7ff6('0x39')]?_0x117495[_0x7ff6('0x37')]:_0x1168b5[_0x7ff6('0x33')];if(_0x4e1128['query'][_0x7ff6('0x47')]){_0x117495[_0x7ff6('0x41')]=[{'all':!![]}];}_0x117495=_[_0x7ff6('0x48')]({},_0x117495,_0x4e1128['options']);return db['JscriptySessionReport'][_0x7ff6('0x49')](_0x117495)[_0x7ff6('0x27')](handleEntityNotFound(_0x287546,null))[_0x7ff6('0x27')](respondWithResult(_0x287546,null))[_0x7ff6('0x44')](handleError(_0x287546,null));};exports[_0x7ff6('0x4a')]=function(_0x4e51b7,_0x1e077c){return db[_0x7ff6('0x2e')][_0x7ff6('0x4a')](_0x4e51b7['body'],{})[_0x7ff6('0x27')](respondWithResult(_0x1e077c,0xc9))['catch'](handleError(_0x1e077c,null));};exports['update']=function(_0x35b4e3,_0x488ac7){if(_0x35b4e3['body']['id']){delete _0x35b4e3['body']['id'];}return db[_0x7ff6('0x2e')][_0x7ff6('0x49')]({'where':{'id':_0x35b4e3['params']['id']}})[_0x7ff6('0x27')](handleEntityNotFound(_0x488ac7,null))[_0x7ff6('0x27')](saveUpdates(_0x35b4e3['body'],null))[_0x7ff6('0x27')](respondWithResult(_0x488ac7,null))[_0x7ff6('0x44')](handleError(_0x488ac7,null));};exports[_0x7ff6('0x28')]=function(_0x3acb5a,_0x57d765){return db[_0x7ff6('0x2e')][_0x7ff6('0x49')]({'where':{'id':_0x3acb5a[_0x7ff6('0x46')]['id']}})[_0x7ff6('0x27')](handleEntityNotFound(_0x57d765,null))[_0x7ff6('0x27')](removeEntity(_0x57d765,null))[_0x7ff6('0x44')](handleError(_0x57d765,null));};exports[_0x7ff6('0x4b')]=function(_0x17e459,_0x4d370b){return db[_0x7ff6('0x2e')][_0x7ff6('0x4b')]()[_0x7ff6('0x27')](respondWithResult(_0x4d370b,null))[_0x7ff6('0x44')](handleError(_0x4d370b,null));};exports['getQuestions']=function(_0x156dfe,_0xd2df3,_0x32fd7b){var _0xd6061d={'raw':!![],'where':{}};var _0x261ea2={};var _0x1eefad={'count':0x0,'rows':[]};return db[_0x7ff6('0x2e')]['findOne']({'where':{'id':_0x156dfe[_0x7ff6('0x46')]['id']}})[_0x7ff6('0x27')](handleEntityNotFound(_0xd2df3,null))[_0x7ff6('0x27')](function(_0x1afde7){if(_0x1afde7){_0x261ea2[_0x7ff6('0x33')]=_[_0x7ff6('0x35')](db[_0x7ff6('0x4c')][_0x7ff6('0x2f')]);_0x261ea2[_0x7ff6('0x34')]=_[_0x7ff6('0x35')](_0x156dfe[_0x7ff6('0x34')]);_0x261ea2['filters']=_[_0x7ff6('0x36')](_0x261ea2['model'],_0x261ea2[_0x7ff6('0x34')]);_0xd6061d['attributes']=_[_0x7ff6('0x36')](_0x261ea2['model'],qs[_0x7ff6('0x38')](_0x156dfe['query']['fields']));_0xd6061d[_0x7ff6('0x37')]=_0xd6061d[_0x7ff6('0x37')][_0x7ff6('0x39')]?_0xd6061d[_0x7ff6('0x37')]:_0x261ea2['model'];if(!_0x156dfe[_0x7ff6('0x34')][_0x7ff6('0x4d')](_0x7ff6('0x3a'))){_0xd6061d[_0x7ff6('0x3b')]=qs[_0x7ff6('0x3b')](_0x156dfe[_0x7ff6('0x34')][_0x7ff6('0x3b')]);_0xd6061d[_0x7ff6('0x21')]=qs[_0x7ff6('0x21')](_0x156dfe[_0x7ff6('0x34')][_0x7ff6('0x21')]);}_0xd6061d[_0x7ff6('0x3c')]=qs[_0x7ff6('0x3d')](_0x156dfe[_0x7ff6('0x34')][_0x7ff6('0x3d')]);_0xd6061d[_0x7ff6('0x3e')]=qs[_0x7ff6('0x3f')](_[_0x7ff6('0x4e')](_0x156dfe[_0x7ff6('0x34')],_0x261ea2[_0x7ff6('0x3f')]));_0xd6061d['where']['SessionId']=_0x1afde7['id'];if(_0x156dfe['query'][_0x7ff6('0x4f')]){_0xd6061d[_0x7ff6('0x3e')]=_['merge'](_0xd6061d[_0x7ff6('0x3e')],{'$or':_[_0x7ff6('0x2d')](_0xd6061d['attributes'],function(_0x62d408){var _0x2abd61={};_0x2abd61[_0x62d408]={'$like':'%'+_0x156dfe[_0x7ff6('0x34')][_0x7ff6('0x4f')]+'%'};return _0x2abd61;})});}_0xd6061d=_[_0x7ff6('0x48')]({},_0xd6061d,_0x156dfe[_0x7ff6('0x40')]);return db['JscriptyQuestionReport'][_0x7ff6('0x20')]({'where':_0xd6061d[_0x7ff6('0x3e')]})[_0x7ff6('0x27')](function(_0x84fc01){_0x1eefad[_0x7ff6('0x20')]=_0x84fc01;if(_0x156dfe[_0x7ff6('0x34')][_0x7ff6('0x47')]){_0xd6061d['include']=[{'all':!![]}];}return db[_0x7ff6('0x4c')][_0x7ff6('0x42')](_0xd6061d);})[_0x7ff6('0x27')](function(_0x3af5de){_0x1eefad[_0x7ff6('0x43')]=_0x3af5de;return _0x1eefad;});}})['then'](respondWithFilteredResult(_0xd2df3,_0xd6061d))['catch'](handleError(_0xd2df3,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f6dc658..ecba178 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 _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x1104c9,_0x1647b0){var _0x2181bd=function(_0x23ff34){while(--_0x23ff34){_0x1104c9['push'](_0x1104c9['shift']());}};_0x2181bd(++_0x1647b0);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8958=['define','JscriptySessionReport','report_jscripty_sessions','util','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x367143,_0xfbe4b8){var _0x63ad9f=function(_0x3e6bca){while(--_0x3e6bca){_0x367143['push'](_0x367143['shift']());}};_0x63ad9f(++_0xfbe4b8);}(_0x8958,0x93));var _0x8895=function(_0x583473,_0x469bd9){_0x583473=_0x583473-0x0;var _0x216c3f=_0x8958[_0x583473];return _0x216c3f;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));module['exports']=function(_0x22fa52,_0x2f03ad){return _0x22fa52[_0x8895('0x5')](_0x8895('0x6'),attributes,{'tableName':_0x8895('0x7'),'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 a6cd547..3d9d553 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 _0x57ca=['client','http','request','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x353cb7,_0x270dbb){var _0x4a4e4c=function(_0x2517a7){while(--_0x2517a7){_0x353cb7['push'](_0x353cb7['shift']());}};_0x4a4e4c(++_0x270dbb);}(_0x57ca,0x108));var _0xa57c=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0x57ca[_0x284609];return _0x55116b;};'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')]('JscriptySessionReport,\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')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xc14d88,_0x4e465a){var _0x374fca=function(_0x840b47){while(--_0x840b47){_0xc14d88['push'](_0xc14d88['shift']());}};_0x374fca(++_0x4e465a);}(_0x1623,0xab));var _0x3162=function(_0x33ea0a,_0x1437b6){_0x33ea0a=_0x33ea0a-0x0;var _0x3b6495=_0x1623[_0x33ea0a];return _0x3b6495;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 0834886..b6bc804 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 _0x61a5=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','put','/:id','isAuthenticated','update','exports'];(function(_0x57ca06,_0x2c0d21){var _0x4dfae0=function(_0x5aa690){while(--_0x5aa690){_0x57ca06['push'](_0x57ca06['shift']());}};_0x4dfae0(++_0x2c0d21);}(_0x61a5,0xf0));var _0x561a=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x61a5[_0xc8a931];return _0x28bd27;};'use strict';var multer=require(_0x561a('0x0'));var util=require('util');var path=require(_0x561a('0x1'));var timeout=require(_0x561a('0x2'));var express=require(_0x561a('0x3'));var router=express[_0x561a('0x4')]();var fs_extra=require(_0x561a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x561a('0x6'));var config=require(_0x561a('0x7'));var controller=require('./license.controller');router[_0x561a('0x8')]('/',controller[_0x561a('0x9')]);router[_0x561a('0xa')](_0x561a('0xb'),auth[_0x561a('0xc')](),controller[_0x561a('0xd')]);module[_0x561a('0xe')]=router; \ No newline at end of file +var _0x1629=['/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','index','put'];(function(_0x4392b0,_0x25865a){var _0xff4e3b=function(_0x277dc5){while(--_0x277dc5){_0x4392b0['push'](_0x4392b0['shift']());}};_0xff4e3b(++_0x25865a);}(_0x1629,0x1d8));var _0x9162=function(_0x2c356c,_0xee2e9f){_0x2c356c=_0x2c356c-0x0;var _0x3f13dc=_0x1629[_0x2c356c];return _0x3f13dc;};'use strict';var multer=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var path=require(_0x9162('0x2'));var timeout=require(_0x9162('0x3'));var express=require('express');var router=express[_0x9162('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9162('0x5'));var config=require(_0x9162('0x6'));var controller=require('./license.controller');router['get']('/',controller[_0x9162('0x7')]);router[_0x9162('0x8')](_0x9162('0x9'),auth[_0x9162('0xa')](),controller[_0x9162('0xb')]);module[_0x9162('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 8311a1b..2d6a0e3 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 _0x59cd=['exports','TEXT','STRING','sequelize'];(function(_0x2e10bb,_0x216db3){var _0x50978c=function(_0x2c3c59){while(--_0x2c3c59){_0x2e10bb['push'](_0x2e10bb['shift']());}};_0x50978c(++_0x216db3);}(_0x59cd,0x137));var _0xd59c=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x59cd[_0x5df033];return _0x445829;};'use strict';var Sequelize=require(_0xd59c('0x0'));module[_0xd59c('0x1')]={'license':{'type':Sequelize[_0xd59c('0x2')]},'data1':{'type':Sequelize[_0xd59c('0x3')]},'data2':{'type':Sequelize[_0xd59c('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x49e1=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x49e1,0x181));var _0x149e=function(_0x5ef86f,_0x3b6057){_0x5ef86f=_0x5ef86f-0x0;var _0x4e3034=_0x49e1[_0x5ef86f];return _0x4e3034;};'use strict';var Sequelize=require(_0x149e('0x0'));module[_0x149e('0x1')]={'license':{'type':Sequelize[_0x149e('0x2')]},'data1':{'type':Sequelize[_0x149e('0x3')]},'data2':{'type':Sequelize[_0x149e('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x149e('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 16af055..98b2acf 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 _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x289295,_0x1a2ee1){var _0x457e9b=function(_0x3c76be){while(--_0x3c76be){_0x289295['push'](_0x289295['shift']());}};_0x457e9b(++_0x1a2ee1);}(_0x1261,0x144));var _0x1126=function(_0x50ac27,_0x1306e3){_0x50ac27=_0x50ac27-0x0;var _0x45f86a=_0x1261[_0x50ac27];return _0x45f86a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file +var _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x326f,0xd1));var _0xf326=function(_0x1b73dc,_0x478ec3){_0x1b73dc=_0x1b73dc-0x0;var _0xf24221=_0x326f[_0x1b73dc];return _0xf24221;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index d1546aa..4517737 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 _0x6a31=['./license.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x39bbcc,_0x3847cb){var _0x224ea0=function(_0x2a9185){while(--_0x2a9185){_0x39bbcc['push'](_0x39bbcc['shift']());}};_0x224ea0(++_0x3847cb);}(_0x6a31,0x116));var _0x16a3=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x6a31[_0x59e821];return _0x5333f6;};'use strict';var _=require(_0x16a3('0x0'));var util=require('util');var logger=require(_0x16a3('0x1'))(_0x16a3('0x2'));var moment=require(_0x16a3('0x3'));var BPromise=require(_0x16a3('0x4'));var rp=require(_0x16a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16a3('0x6'));var config=require(_0x16a3('0x7'));var attributes=require(_0x16a3('0x8'));module[_0x16a3('0x9')]=function(_0x58e089,_0x453c1e){return _0x58e089[_0x16a3('0xa')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf14a=['license','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','License'];(function(_0x5ea95d,_0x4be084){var _0x13695d=function(_0x1072f5){while(--_0x1072f5){_0x5ea95d['push'](_0x5ea95d['shift']());}};_0x13695d(++_0x4be084);}(_0xf14a,0x9d));var _0xaf14=function(_0x4215ba,_0xb3ce4b){_0x4215ba=_0x4215ba-0x0;var _0x2927ae=_0xf14a[_0x4215ba];return _0x2927ae;};'use strict';var _=require(_0xaf14('0x0'));var util=require(_0xaf14('0x1'));var logger=require('../../config/logger')(_0xaf14('0x2'));var moment=require(_0xaf14('0x3'));var BPromise=require(_0xaf14('0x4'));var rp=require(_0xaf14('0x5'));var fs=require('fs');var path=require(_0xaf14('0x6'));var rimraf=require(_0xaf14('0x7'));var config=require('../../config/environment');var attributes=require(_0xaf14('0x8'));module[_0xaf14('0x9')]=function(_0x5a0662,_0x2915a8){return _0x5a0662['define'](_0xaf14('0xa'),attributes,{'tableName':_0xaf14('0xb'),'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 ab94d2d..952a06e 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 _0x98f3=['rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','License,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa11a16,_0x526fad){var _0x1bdfb3=function(_0xd9227b){while(--_0xd9227b){_0xa11a16['push'](_0xa11a16['shift']());}};_0x1bdfb3(++_0x526fad);}(_0x98f3,0x150));var _0x398f=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0x98f3[_0x163f58];return _0x472ed9;};'use strict';var _=require(_0x398f('0x0'));var util=require(_0x398f('0x1'));var moment=require(_0x398f('0x2'));var BPromise=require(_0x398f('0x3'));var rs=require(_0x398f('0x4'));var fs=require('fs');var Redis=require(_0x398f('0x5'));var db=require(_0x398f('0x6'))['db'];var utils=require(_0x398f('0x7'));var logger=require(_0x398f('0x8'))(_0x398f('0x9'));var config=require(_0x398f('0xa'));var jayson=require(_0x398f('0xb'));var client=jayson[_0x398f('0xc')][_0x398f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xc19e50,_0x102da5,_0x84dcf3){return new BPromise(function(_0x28fc85,_0x16596f){return client['request'](_0xc19e50,_0x84dcf3)[_0x398f('0xe')](function(_0x2e5e8c){logger[_0x398f('0xf')]('License,\x20%s,\x20%s',_0x102da5,'request\x20sent');logger[_0x398f('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x102da5,_0x398f('0x11'),JSON[_0x398f('0x12')](_0x2e5e8c));if(_0x2e5e8c['error']){if(_0x2e5e8c[_0x398f('0x13')]['code']===0x1f4){logger[_0x398f('0x13')](_0x398f('0x14'),_0x102da5,_0x2e5e8c['error']['message']);return _0x16596f(_0x2e5e8c[_0x398f('0x13')][_0x398f('0x15')]);}logger['error'](_0x398f('0x14'),_0x102da5,_0x2e5e8c[_0x398f('0x13')][_0x398f('0x15')]);return _0x28fc85(_0x2e5e8c['error'][_0x398f('0x15')]);}else{logger[_0x398f('0xf')](_0x398f('0x14'),_0x102da5,_0x398f('0x11'));_0x28fc85(_0x2e5e8c['result']['message']);}})[_0x398f('0x16')](function(_0x13636b){logger[_0x398f('0x13')](_0x398f('0x14'),_0x102da5,_0x13636b);_0x16596f(_0x13636b);});});} \ No newline at end of file +var _0x7792=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment'];(function(_0x576c1e,_0x49c1d6){var _0x33a3c3=function(_0x5b56fa){while(--_0x5b56fa){_0x576c1e['push'](_0x576c1e['shift']());}};_0x33a3c3(++_0x49c1d6);}(_0x7792,0x77));var _0x2779=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0x7792[_0x447ef1];return _0x3d72ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2779('0x0'));var BPromise=require(_0x2779('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2779('0x2'));var db=require(_0x2779('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2779('0x4'))(_0x2779('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2779('0x6')][_0x2779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a2b13,_0x7e04f9,_0x5294bf){return new BPromise(function(_0x2f5882,_0x6348e7){return client[_0x2779('0x8')](_0x1a2b13,_0x5294bf)[_0x2779('0x9')](function(_0x31f02e){logger[_0x2779('0xa')](_0x2779('0xb'),_0x7e04f9,_0x2779('0xc'));logger[_0x2779('0xd')](_0x2779('0xe'),_0x7e04f9,'request\x20sent',JSON[_0x2779('0xf')](_0x31f02e));if(_0x31f02e[_0x2779('0x10')]){if(_0x31f02e[_0x2779('0x10')][_0x2779('0x11')]===0x1f4){logger[_0x2779('0x10')](_0x2779('0xb'),_0x7e04f9,_0x31f02e[_0x2779('0x10')][_0x2779('0x12')]);return _0x6348e7(_0x31f02e[_0x2779('0x10')]['message']);}logger['error'](_0x2779('0xb'),_0x7e04f9,_0x31f02e['error']['message']);return _0x2f5882(_0x31f02e[_0x2779('0x10')][_0x2779('0x12')]);}else{logger['info'](_0x2779('0xb'),_0x7e04f9,_0x2779('0xc'));_0x2f5882(_0x31f02e['result'][_0x2779('0x12')]);}})[_0x2779('0x13')](function(_0x427ab4){logger['error'](_0x2779('0xb'),_0x7e04f9,_0x427ab4);_0x6348e7(_0x427ab4);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index ee8235c..726f8de 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 _0xbd99=['removeAnswers','removeImap','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./mailAccount.controller','isAuthenticated','index','/describe','describe','/:id','get','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','getAgents','post','addAnswer','addImap','addSmtp','addInteraction','addAgents','put','delete','removeDispositions'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0xbd99,0x175));var _0x9bd9=function(_0xf2dd8c,_0x3f5acc){_0xf2dd8c=_0xf2dd8c-0x0;var _0x32417d=_0xbd99[_0xf2dd8c];return _0x32417d;};'use strict';var multer=require(_0x9bd9('0x0'));var util=require(_0x9bd9('0x1'));var path=require(_0x9bd9('0x2'));var timeout=require(_0x9bd9('0x3'));var express=require(_0x9bd9('0x4'));var router=express[_0x9bd9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9bd9('0x6'));var controller=require(_0x9bd9('0x7'));router['get']('/',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x9')]);router['get'](_0x9bd9('0xa'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0xb')]);router['get'](_0x9bd9('0xc'),auth[_0x9bd9('0x8')](),controller['show']);router[_0x9bd9('0xd')](_0x9bd9('0xe'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0xf')]);router[_0x9bd9('0xd')](_0x9bd9('0x10'),auth['isAuthenticated'](),controller[_0x9bd9('0x11')]);router['get'](_0x9bd9('0x12'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x13')]);router[_0x9bd9('0xd')](_0x9bd9('0x14'),auth[_0x9bd9('0x8')](),controller['getSmtp']);router[_0x9bd9('0xd')](_0x9bd9('0x15'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x16')]);router[_0x9bd9('0xd')](_0x9bd9('0x17'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x18')]);router[_0x9bd9('0xd')]('/:id/messages',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x19')]);router[_0x9bd9('0xd')]('/:id/verify',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x1a')]);router[_0x9bd9('0xd')]('/:id/users',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x1b')]);router[_0x9bd9('0x1c')]('/:id/dispositions',auth[_0x9bd9('0x8')](),controller['addDisposition']);router[_0x9bd9('0x1c')]('/:id/canned_answers',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x1d')]);router['post']('/',auth[_0x9bd9('0x8')](),controller['create']);router[_0x9bd9('0x1c')](_0x9bd9('0x12'),auth['isAuthenticated'](),controller[_0x9bd9('0x1e')]);router[_0x9bd9('0x1c')]('/:id/out_servers',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x1f')]);router[_0x9bd9('0x1c')](_0x9bd9('0x15'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x20')]);router[_0x9bd9('0x1c')](_0x9bd9('0x17'),auth[_0x9bd9('0x8')](),controller['addApplications']);router[_0x9bd9('0x1c')]('/:id/send',auth[_0x9bd9('0x8')](),controller['send']);router[_0x9bd9('0x1c')]('/:id/users',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x21')]);router[_0x9bd9('0x22')](_0x9bd9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9bd9('0x23')]('/:id/dispositions',auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x24')]);router[_0x9bd9('0x23')](_0x9bd9('0x10'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x25')]);router[_0x9bd9('0x23')](_0x9bd9('0x12'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x26')]);router[_0x9bd9('0x23')](_0x9bd9('0x14'),auth[_0x9bd9('0x8')](),controller['removeSmtp']);router['delete'](_0x9bd9('0xc'),auth[_0x9bd9('0x8')](),controller[_0x9bd9('0x27')]);router['delete']('/:id/users',auth[_0x9bd9('0x8')](),controller['removeAgents']);module[_0x9bd9('0x28')]=router; \ No newline at end of file +var _0x36ae=['delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','post','addDisposition','create','addSmtp','addInteraction','/:id/send','send','put','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x36ae,0x81));var _0xe36a=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x36ae[_0x59b2a1];return _0x4908d1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe36a('0x0'));var express=require(_0xe36a('0x1'));var router=express[_0xe36a('0x2')]();var fs_extra=require(_0xe36a('0x3'));var auth=require(_0xe36a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe36a('0x5'));var controller=require(_0xe36a('0x6'));router['get']('/',auth[_0xe36a('0x7')](),controller['index']);router[_0xe36a('0x8')](_0xe36a('0x9'),auth[_0xe36a('0x7')](),controller[_0xe36a('0xa')]);router[_0xe36a('0x8')](_0xe36a('0xb'),auth[_0xe36a('0x7')](),controller['show']);router['get'](_0xe36a('0xc'),auth['isAuthenticated'](),controller[_0xe36a('0xd')]);router['get'](_0xe36a('0xe'),auth[_0xe36a('0x7')](),controller[_0xe36a('0xf')]);router['get'](_0xe36a('0x10'),auth[_0xe36a('0x7')](),controller['getImap']);router['get'](_0xe36a('0x11'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x12')]);router[_0xe36a('0x8')](_0xe36a('0x13'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x14')]);router['get'](_0xe36a('0x15'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x16')]);router[_0xe36a('0x8')]('/:id/messages',auth[_0xe36a('0x7')](),controller[_0xe36a('0x17')]);router[_0xe36a('0x8')]('/:id/verify',auth[_0xe36a('0x7')](),controller[_0xe36a('0x18')]);router[_0xe36a('0x8')](_0xe36a('0x19'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe36a('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe36a('0x1b')]);router[_0xe36a('0x1a')](_0xe36a('0xe'),auth[_0xe36a('0x7')](),controller['addAnswer']);router[_0xe36a('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe36a('0x1c')]);router[_0xe36a('0x1a')](_0xe36a('0x10'),auth[_0xe36a('0x7')](),controller['addImap']);router[_0xe36a('0x1a')](_0xe36a('0x11'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x1d')]);router[_0xe36a('0x1a')](_0xe36a('0x13'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x1e')]);router[_0xe36a('0x1a')](_0xe36a('0x15'),auth['isAuthenticated'](),controller['addApplications']);router[_0xe36a('0x1a')](_0xe36a('0x1f'),auth['isAuthenticated'](),controller[_0xe36a('0x20')]);router[_0xe36a('0x1a')](_0xe36a('0x19'),auth['isAuthenticated'](),controller['addAgents']);router[_0xe36a('0x21')](_0xe36a('0xb'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x22')]);router[_0xe36a('0x23')](_0xe36a('0xc'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x24')]);router[_0xe36a('0x23')](_0xe36a('0xe'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x25')]);router[_0xe36a('0x23')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xe36a('0x26')]);router[_0xe36a('0x23')](_0xe36a('0x11'),auth[_0xe36a('0x7')](),controller['removeSmtp']);router[_0xe36a('0x23')](_0xe36a('0xb'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x27')]);router[_0xe36a('0x23')](_0xe36a('0x19'),auth[_0xe36a('0x7')](),controller[_0xe36a('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f76cbf9..b6713a6 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 _0xe14b=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','BOOLEAN','STRING','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}}'];(function(_0xce62e6,_0x4537d2){var _0x17e205=function(_0x4e860b){while(--_0x4e860b){_0xce62e6['push'](_0xce62e6['shift']());}};_0x17e205(++_0x4537d2);}(_0xe14b,0x93));var _0xbe14=function(_0x44ca46,_0x3c52a1){_0x44ca46=_0x44ca46-0x0;var _0x2a1b8d=_0xe14b[_0x44ca46];return _0x2a1b8d;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbe14('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xbe14('0x3')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbe14('0x3')],'allowNull':![],'defaultValue':_0xbe14('0x4')},'fontSize':{'type':Sequelize[_0xbe14('0x5')](0x2)[_0xbe14('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbe14('0x7')],'defaultValue':function(){return _0xbe14('0x8');}},'notificationSound':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe14('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe14('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe14('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbe14('0x9'),'set':function(_0x3f70cb){if(!_0x3f70cb)this['setDataValue'](_0xbe14('0xa'),null);this[_0xbe14('0xb')](_0xbe14('0xc'),_0x3f70cb);}}}; \ No newline at end of file +var _0x3e25=['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','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0xc49198,_0x2f728c){var _0x44ebe0=function(_0x57b017){while(--_0x57b017){_0xc49198['push'](_0xc49198['shift']());}};_0x44ebe0(++_0x2f728c);}(_0x3e25,0x14f));var _0x53e2=function(_0x2a6d6b,_0x565037){_0x2a6d6b=_0x2a6d6b-0x0;var _0xb985b1=_0x3e25[_0x2a6d6b];return _0xb985b1;};'use strict';var Sequelize=require(_0x53e2('0x0'));module[_0x53e2('0x1')]={'description':{'type':Sequelize[_0x53e2('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x53e2('0x4')]},'markAsUnread':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x53e2('0x2')],'allowNull':![],'defaultValue':_0x53e2('0x5')},'fontSize':{'type':Sequelize[_0x53e2('0x6')](0x2)[_0x53e2('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x53e2('0x4')],'defaultValue':function(){return _0x53e2('0x8');}},'notificationSound':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x53e2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x53e2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x53e2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x53e2('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x53e2('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x53e2('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x42bf3f){if(!_0x42bf3f)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x53e2('0xa'),_0x42bf3f);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e961707..62d7aac 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 _0x0070=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','ListId','messageId','attach','out','Interaction','Messages','VerifySmtp','Sequelize','addAgents','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','limit','count','set','apply','reject','destroy','get','MailAccounts','UserProfileResource','end','name','send','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','MailAccount','includeAll','findAll','show','find','catch','body','update','describe','params','MailAccountId','create','getDispositions','findOne','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','email','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId'];(function(_0x15d617,_0x36c71f){var _0x4f9fc6=function(_0x4e680d){while(--_0x4e680d){_0x15d617['push'](_0x15d617['shift']());}};_0x4f9fc6(++_0x36c71f);}(_0x0070,0x1c3));var _0x0007=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x0070[_0x2390bd];return _0x3a969d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0007('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0007('0x1'));var rp=require(_0x0007('0x2'));var moment=require('moment');var BPromise=require(_0x0007('0x3'));var Mustache=require(_0x0007('0x4'));var util=require(_0x0007('0x5'));var path=require(_0x0007('0x6'));var sox=require(_0x0007('0x7'));var csv=require(_0x0007('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0007('0x9'));var squel=require(_0x0007('0xa'));var crypto=require(_0x0007('0xb'));var jsforce=require(_0x0007('0xc'));var deskjs=require(_0x0007('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0007('0xe'));var htmlToText=require('html-to-text');var juice=require(_0x0007('0xf'));var Redis=require(_0x0007('0x10'));var authService=require(_0x0007('0x11'));var qs=require(_0x0007('0x12'));var as=require(_0x0007('0x13'));var hardwareService=require(_0x0007('0x14'));var logger=require(_0x0007('0x15'))(_0x0007('0x16'));var utils=require(_0x0007('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0007('0x18'));var db=require('../../mysqldb')['db'];config[_0x0007('0x19')]=_[_0x0007('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0007('0x19')]));require('./mailAccount.socket')[_0x0007('0x1b')](socket);var jayson=require(_0x0007('0x1c'));var client=jayson[_0x0007('0x1d')][_0x0007('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x4a5017,_0x8be8ed,_0x3441c9,_0x37c492){return new BPromise(function(_0x396d6c,_0x5aeb7f){var _0x1ff23f=_0x37c492||client;return _0x1ff23f[_0x0007('0x1f')](_0x4a5017,_0x3441c9)[_0x0007('0x20')](function(_0x60f0b5){logger['info'](_0x0007('0x21'),_0x8be8ed,_0x0007('0x22'));logger[_0x0007('0x23')](_0x0007('0x24'),_0x8be8ed,_0x0007('0x22'),JSON[_0x0007('0x25')](_0x60f0b5));if(_0x60f0b5['error']){if(_0x60f0b5[_0x0007('0x26')][_0x0007('0x27')]===0x1f4){logger[_0x0007('0x26')]('MailAccount,\x20%s,\x20%s',_0x8be8ed,_0x60f0b5[_0x0007('0x26')][_0x0007('0x28')]);return _0x5aeb7f(_0x60f0b5['error'][_0x0007('0x28')]);}logger[_0x0007('0x26')]('MailAccount,\x20%s,\x20%s',_0x8be8ed,_0x60f0b5[_0x0007('0x26')]['message']);return _0x396d6c(_0x60f0b5['error'][_0x0007('0x28')]);}else{logger[_0x0007('0x29')](_0x0007('0x21'),_0x8be8ed,_0x0007('0x22'));_0x396d6c(_0x60f0b5[_0x0007('0x2a')][_0x0007('0x28')]);}})['catch'](function(_0x1bd6c5){logger[_0x0007('0x26')](_0x0007('0x21'),_0x8be8ed,_0x1bd6c5);_0x5aeb7f(_0x1bd6c5);});});}function respondWithStatusCode(_0x32796a,_0x38f016){_0x38f016=_0x38f016||0xcc;return function(_0x26b659){if(_0x26b659){return _0x32796a[_0x0007('0x2b')](_0x38f016);}return _0x32796a[_0x0007('0x2c')](_0x38f016)['end']();};}function respondWithResult(_0x4e5ded,_0x4c3e57){_0x4c3e57=_0x4c3e57||0xc8;return function(_0x34d81c){if(_0x34d81c){return _0x4e5ded['status'](_0x4c3e57)['json'](_0x34d81c);}};}function respondWithFilteredResult(_0x23e9cb,_0x2e4ca5){return function(_0x34caa1){if(_0x34caa1){var _0x563e2f=typeof _0x2e4ca5[_0x0007('0x2d')]===_0x0007('0x2e')&&typeof _0x2e4ca5[_0x0007('0x2f')]===_0x0007('0x2e');var _0x4e7236=_0x34caa1[_0x0007('0x30')];var _0x28009c=_0x563e2f?0x0:_0x2e4ca5['offset'];var _0x1f6316=_0x563e2f?_0x34caa1[_0x0007('0x30')]:_0x2e4ca5[_0x0007('0x2d')]+_0x2e4ca5[_0x0007('0x2f')];var _0xab8490;if(_0x1f6316>=_0x4e7236){_0x1f6316=_0x4e7236;_0xab8490=0xc8;}else{_0xab8490=0xce;}_0x23e9cb[_0x0007('0x2c')](_0xab8490);return _0x23e9cb[_0x0007('0x31')]('Content-Range',_0x28009c+'-'+_0x1f6316+'/'+_0x4e7236)['json'](_0x34caa1);}return null;};}function patchUpdates(_0x3085d7){return function(_0x64fb6f){try{jsonpatch[_0x0007('0x32')](_0x64fb6f,_0x3085d7,!![]);}catch(_0x55686e){return BPromise[_0x0007('0x33')](_0x55686e);}return _0x64fb6f['save']();};}function saveUpdates(_0x2d811a,_0x4f9f91){return function(_0x59e2ff){if(_0x59e2ff){return _0x59e2ff['update'](_0x2d811a)[_0x0007('0x20')](function(_0x397174){return _0x397174;});}return null;};}function removeEntity(_0x16835d,_0x5ea1be){return function(_0x44c833){if(_0x44c833){return _0x44c833[_0x0007('0x34')]()['then'](function(){var _0xa6f5f7=_0x44c833[_0x0007('0x35')]({'plain':!![]});var _0x133229=_0x0007('0x36');return db[_0x0007('0x37')][_0x0007('0x34')]({'where':{'type':_0x133229,'resourceId':_0xa6f5f7['id']}})['then'](function(){return _0x44c833;});})[_0x0007('0x20')](function(){_0x16835d[_0x0007('0x2c')](0xcc)[_0x0007('0x38')]();});}};}function handleEntityNotFound(_0x250d32,_0x4e73f2){return function(_0x1bb058){if(!_0x1bb058){_0x250d32[_0x0007('0x2b')](0x194);}return _0x1bb058;};}function handleError(_0x48761a,_0x5720a4){_0x5720a4=_0x5720a4||0x1f4;return function(_0x14dc20){logger[_0x0007('0x26')](_0x14dc20['stack']);if(_0x14dc20[_0x0007('0x39')]){delete _0x14dc20['name'];}_0x48761a[_0x0007('0x2c')](_0x5720a4)[_0x0007('0x3a')](_0x14dc20);};}exports['index']=function(_0xb26fd7,_0x24e734){var _0x25ed77={'include':[{'model':db[_0x0007('0x3b')],'as':_0x0007('0x3c')},{'model':db[_0x0007('0x3d')],'as':_0x0007('0x3e')},{'model':db[_0x0007('0x3f')],'as':_0x0007('0x40')}]},_0x5499f2={},_0x295372={'count':0x0,'rows':[]};var _0x28f140=_[_0x0007('0x41')](db['MailAccount'][_0x0007('0x42')],function(_0x2822d1){return{'name':_0x2822d1[_0x0007('0x43')],'type':_0x2822d1[_0x0007('0x44')][_0x0007('0x45')]};});_0x5499f2[_0x0007('0x46')]=_[_0x0007('0x41')](_0x28f140,'name');_0x5499f2[_0x0007('0x47')]=_[_0x0007('0x48')](_0xb26fd7[_0x0007('0x47')]);_0x5499f2[_0x0007('0x49')]=_['intersection'](_0x5499f2[_0x0007('0x46')],_0x5499f2[_0x0007('0x47')]);_0x25ed77[_0x0007('0x4a')]=_[_0x0007('0x4b')](_0x5499f2['model'],qs[_0x0007('0x4c')](_0xb26fd7['query'][_0x0007('0x4c')]));_0x25ed77[_0x0007('0x4a')]=_0x25ed77['attributes'][_0x0007('0x4d')]?_0x25ed77[_0x0007('0x4a')]:_0x5499f2[_0x0007('0x46')];if(!_0xb26fd7['query'][_0x0007('0x4e')](_0x0007('0x4f'))){_0x25ed77[_0x0007('0x2f')]=qs[_0x0007('0x2f')](_0xb26fd7[_0x0007('0x47')][_0x0007('0x2f')]);_0x25ed77['offset']=qs['offset'](_0xb26fd7[_0x0007('0x47')][_0x0007('0x2d')]);}_0x25ed77[_0x0007('0x50')]=qs[_0x0007('0x51')](_0xb26fd7[_0x0007('0x47')][_0x0007('0x51')]);_0x25ed77[_0x0007('0x52')]=qs[_0x0007('0x49')](_[_0x0007('0x53')](_0xb26fd7[_0x0007('0x47')],_0x5499f2[_0x0007('0x49')]),_0x28f140);if(_0xb26fd7['query'][_0x0007('0x54')]){_0x25ed77[_0x0007('0x52')]=_['merge'](_0x25ed77[_0x0007('0x52')],{'$or':_[_0x0007('0x41')](_0x28f140,function(_0x1eeb35){if(_0x1eeb35[_0x0007('0x44')]!==_0x0007('0x55')){var _0x1cd16d={};_0x1cd16d[_0x1eeb35[_0x0007('0x39')]]={'$like':'%'+_0xb26fd7[_0x0007('0x47')][_0x0007('0x54')]+'%'};return _0x1cd16d;}})});}_0x25ed77=_[_0x0007('0x56')]({},_0x25ed77,_0xb26fd7[_0x0007('0x57')]);var _0x575929={'where':_0x25ed77['where']};return db[_0x0007('0x58')][_0x0007('0x30')](_0x575929)[_0x0007('0x20')](function(_0x177afe){_0x295372[_0x0007('0x30')]=_0x177afe;if(_0xb26fd7[_0x0007('0x47')][_0x0007('0x59')]){_0x25ed77['include']=[{'all':!![]}];}return db[_0x0007('0x58')][_0x0007('0x5a')](_0x25ed77);})[_0x0007('0x20')](function(_0xd8a992){_0x295372['rows']=_0xd8a992;return _0x295372;})[_0x0007('0x20')](respondWithFilteredResult(_0x24e734,_0x25ed77))['catch'](handleError(_0x24e734,null));};exports[_0x0007('0x5b')]=function(_0x10ae15,_0x144402){var _0x590c98={'raw':![],'where':{'id':_0x10ae15['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x0007('0x3c')},{'model':db[_0x0007('0x3d')],'as':'Smtp'},{'model':db[_0x0007('0x3f')],'as':_0x0007('0x40')}]},_0x5d9b77={};_0x5d9b77['model']=_[_0x0007('0x48')](db[_0x0007('0x58')]['rawAttributes']);_0x5d9b77[_0x0007('0x47')]=_['keys'](_0x10ae15[_0x0007('0x47')]);_0x5d9b77[_0x0007('0x49')]=_['intersection'](_0x5d9b77[_0x0007('0x46')],_0x5d9b77['query']);_0x590c98[_0x0007('0x4a')]=_[_0x0007('0x4b')](_0x5d9b77['model'],qs[_0x0007('0x4c')](_0x10ae15[_0x0007('0x47')]['fields']));_0x590c98['attributes']=_0x590c98[_0x0007('0x4a')][_0x0007('0x4d')]?_0x590c98[_0x0007('0x4a')]:_0x5d9b77[_0x0007('0x46')];if(_0x10ae15[_0x0007('0x47')][_0x0007('0x59')]){_0x590c98['include']=[{'all':!![]}];}_0x590c98=_[_0x0007('0x56')]({},_0x590c98,_0x10ae15[_0x0007('0x57')]);return db[_0x0007('0x58')][_0x0007('0x5c')](_0x590c98)[_0x0007('0x20')](handleEntityNotFound(_0x144402,null))['then'](respondWithResult(_0x144402,null))[_0x0007('0x5d')](handleError(_0x144402,null));};exports['update']=function(_0x51f2a9,_0x45b889){if(_0x51f2a9[_0x0007('0x5e')]['id']){delete _0x51f2a9[_0x0007('0x5e')]['id'];}return db[_0x0007('0x58')][_0x0007('0x5c')]({'where':{'id':_0x51f2a9['params']['id']},'include':[{'model':db[_0x0007('0x3b')],'as':'Imap'},{'model':db[_0x0007('0x3d')],'as':'Smtp'},{'model':db[_0x0007('0x3f')],'as':_0x0007('0x40')}]})[_0x0007('0x20')](handleEntityNotFound(_0x45b889,null))['then'](saveUpdates(_0x51f2a9['body'],null))[_0x0007('0x20')](function(_0x6f617){if(_0x6f617&&_0x51f2a9[_0x0007('0x5e')][_0x0007('0x3c')]){return db[_0x0007('0x3b')][_0x0007('0x5f')](_0x51f2a9[_0x0007('0x5e')][_0x0007('0x3c')],{'where':{'MailAccountId':_0x6f617['id']}})[_0x0007('0x20')](function(){return _0x6f617;});}return _0x6f617;})[_0x0007('0x20')](function(_0x435220){if(_0x435220&&_0x51f2a9[_0x0007('0x5e')]['Smtp']){return db[_0x0007('0x3d')]['update'](_0x51f2a9[_0x0007('0x5e')][_0x0007('0x3e')],{'where':{'MailAccountId':_0x435220['id']}})['then'](function(){return _0x435220;});}return _0x435220;})[_0x0007('0x20')](respondWithResult(_0x45b889,null))[_0x0007('0x5d')](handleError(_0x45b889,null));};exports[_0x0007('0x60')]=function(_0x59649a,_0x31ae25){return db[_0x0007('0x58')][_0x0007('0x60')]()[_0x0007('0x20')](respondWithResult(_0x31ae25,null))[_0x0007('0x5d')](handleError(_0x31ae25,null));};exports['addDisposition']=function(_0x1d259b,_0x6fb77c,_0x4a372f){if(_0x1d259b[_0x0007('0x5e')]['id']){delete _0x1d259b[_0x0007('0x5e')]['id'];}return db[_0x0007('0x58')][_0x0007('0x5c')]({'where':{'id':_0x1d259b[_0x0007('0x61')]['id']}})['then'](handleEntityNotFound(_0x6fb77c,null))['then'](function(_0x138f29){if(_0x138f29){_0x1d259b[_0x0007('0x5e')][_0x0007('0x62')]=_0x138f29['id'];return db['Disposition'][_0x0007('0x63')](_0x1d259b[_0x0007('0x5e')]);}})[_0x0007('0x20')](respondWithResult(_0x6fb77c,null))['catch'](handleError(_0x6fb77c,null));};exports[_0x0007('0x64')]=function(_0x35f546,_0x5d001c,_0x52be41){var _0xa4ded1={'raw':![],'where':{}};var _0x2452bc={};var _0x2428c0={'count':0x0,'rows':[]};return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x35f546[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x5d001c,null))[_0x0007('0x20')](function(_0x4e7a9f){if(_0x4e7a9f){_0x2452bc[_0x0007('0x46')]=_[_0x0007('0x48')](db['Disposition']['rawAttributes']);_0x2452bc[_0x0007('0x47')]=_[_0x0007('0x48')](_0x35f546[_0x0007('0x47')]);_0x2452bc['filters']=_[_0x0007('0x4b')](_0x2452bc[_0x0007('0x46')],_0x2452bc[_0x0007('0x47')]);_0xa4ded1[_0x0007('0x4a')]=_[_0x0007('0x4b')](_0x2452bc[_0x0007('0x46')],qs[_0x0007('0x4c')](_0x35f546[_0x0007('0x47')][_0x0007('0x4c')]));_0xa4ded1[_0x0007('0x4a')]=_0xa4ded1[_0x0007('0x4a')][_0x0007('0x4d')]?_0xa4ded1[_0x0007('0x4a')]:_0x2452bc[_0x0007('0x46')];if(!_0x35f546['query'][_0x0007('0x4e')](_0x0007('0x4f'))){_0xa4ded1[_0x0007('0x2f')]=qs[_0x0007('0x2f')](_0x35f546[_0x0007('0x47')][_0x0007('0x2f')]);_0xa4ded1['offset']=qs[_0x0007('0x2d')](_0x35f546['query']['offset']);}_0xa4ded1[_0x0007('0x50')]=qs[_0x0007('0x51')](_0x35f546[_0x0007('0x47')]['sort']);_0xa4ded1[_0x0007('0x52')]=qs['filters'](_[_0x0007('0x53')](_0x35f546[_0x0007('0x47')],_0x2452bc[_0x0007('0x49')]));_0xa4ded1[_0x0007('0x52')][_0x0007('0x62')]=_0x4e7a9f['id'];if(_0x35f546[_0x0007('0x47')][_0x0007('0x54')]){_0xa4ded1[_0x0007('0x52')]=_['merge'](_0xa4ded1[_0x0007('0x52')],{'$or':_[_0x0007('0x41')](_0xa4ded1[_0x0007('0x4a')],function(_0x5a9ec8){var _0x3bd600={};_0x3bd600[_0x5a9ec8]={'$like':'%'+_0x35f546[_0x0007('0x47')][_0x0007('0x54')]+'%'};return _0x3bd600;})});}_0xa4ded1=_[_0x0007('0x56')]({},_0xa4ded1,_0x35f546[_0x0007('0x57')]);return db[_0x0007('0x66')]['count']({'where':_0xa4ded1[_0x0007('0x52')]})[_0x0007('0x20')](function(_0x45e31d){_0x2428c0[_0x0007('0x30')]=_0x45e31d;if(_0x35f546['query']['includeAll']){_0xa4ded1['include']=[{'all':!![]}];}return db[_0x0007('0x66')][_0x0007('0x5a')](_0xa4ded1);})['then'](function(_0x204e15){_0x2428c0[_0x0007('0x67')]=_0x204e15;return _0x2428c0;});}})[_0x0007('0x20')](respondWithFilteredResult(_0x5d001c,_0xa4ded1))[_0x0007('0x5d')](handleError(_0x5d001c,null));};exports['removeDispositions']=function(_0x51028e,_0x3b24a9,_0x479733){return db[_0x0007('0x58')][_0x0007('0x5c')]({'where':{'id':_0x51028e[_0x0007('0x61')]['id']}})['then'](handleEntityNotFound(_0x3b24a9,null))[_0x0007('0x20')](function(_0x39f42e){if(_0x39f42e){return _0x39f42e[_0x0007('0x68')](_0x51028e[_0x0007('0x47')]['ids']);}})[_0x0007('0x20')](respondWithStatusCode(_0x3b24a9,null))[_0x0007('0x5d')](handleError(_0x3b24a9,null));};exports[_0x0007('0x69')]=function(_0x7cc6a3,_0x2b4d93,_0x3f32a9){if(_0x7cc6a3[_0x0007('0x5e')]['id']){delete _0x7cc6a3[_0x0007('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x7cc6a3['params']['id']}})['then'](handleEntityNotFound(_0x2b4d93,null))['then'](function(_0x1bdd59){if(_0x1bdd59){_0x7cc6a3[_0x0007('0x5e')][_0x0007('0x62')]=_0x1bdd59['id'];return db[_0x0007('0x6a')][_0x0007('0x63')](_0x7cc6a3['body']);}})['then'](respondWithResult(_0x2b4d93,null))['catch'](handleError(_0x2b4d93,null));};exports[_0x0007('0x6b')]=function(_0x1efa40,_0x2a43dd,_0x432cb9){var _0x5c208f={'raw':![],'where':{}};var _0xa572ce={};var _0x174520={'count':0x0,'rows':[]};return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x1efa40[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x2a43dd,null))[_0x0007('0x20')](function(_0x57241c){if(_0x57241c){_0xa572ce['model']=_[_0x0007('0x48')](db['CannedAnswer'][_0x0007('0x42')]);_0xa572ce[_0x0007('0x47')]=_[_0x0007('0x48')](_0x1efa40[_0x0007('0x47')]);_0xa572ce[_0x0007('0x49')]=_['intersection'](_0xa572ce['model'],_0xa572ce[_0x0007('0x47')]);_0x5c208f['attributes']=_[_0x0007('0x4b')](_0xa572ce[_0x0007('0x46')],qs[_0x0007('0x4c')](_0x1efa40[_0x0007('0x47')][_0x0007('0x4c')]));_0x5c208f[_0x0007('0x4a')]=_0x5c208f[_0x0007('0x4a')][_0x0007('0x4d')]?_0x5c208f[_0x0007('0x4a')]:_0xa572ce['model'];if(!_0x1efa40[_0x0007('0x47')][_0x0007('0x4e')](_0x0007('0x4f'))){_0x5c208f[_0x0007('0x2f')]=qs[_0x0007('0x2f')](_0x1efa40[_0x0007('0x47')][_0x0007('0x2f')]);_0x5c208f[_0x0007('0x2d')]=qs[_0x0007('0x2d')](_0x1efa40[_0x0007('0x47')][_0x0007('0x2d')]);}_0x5c208f['order']=qs[_0x0007('0x51')](_0x1efa40[_0x0007('0x47')]['sort']);_0x5c208f[_0x0007('0x52')]=qs['filters'](_[_0x0007('0x53')](_0x1efa40[_0x0007('0x47')],_0xa572ce[_0x0007('0x49')]));_0x5c208f[_0x0007('0x52')][_0x0007('0x62')]=_0x57241c['id'];if(_0x1efa40[_0x0007('0x47')]['filter']){_0x5c208f[_0x0007('0x52')]=_['merge'](_0x5c208f['where'],{'$or':_[_0x0007('0x41')](_0x5c208f[_0x0007('0x4a')],function(_0x45f33f){var _0x40f043={};_0x40f043[_0x45f33f]={'$like':'%'+_0x1efa40[_0x0007('0x47')][_0x0007('0x54')]+'%'};return _0x40f043;})});}_0x5c208f=_[_0x0007('0x56')]({},_0x5c208f,_0x1efa40[_0x0007('0x57')]);return db[_0x0007('0x6a')][_0x0007('0x30')]({'where':_0x5c208f[_0x0007('0x52')]})[_0x0007('0x20')](function(_0x2d70b6){_0x174520[_0x0007('0x30')]=_0x2d70b6;if(_0x1efa40[_0x0007('0x47')][_0x0007('0x59')]){_0x5c208f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0007('0x5a')](_0x5c208f);})[_0x0007('0x20')](function(_0x4a5ae0){_0x174520[_0x0007('0x67')]=_0x4a5ae0;return _0x174520;});}})[_0x0007('0x20')](respondWithFilteredResult(_0x2a43dd,_0x5c208f))[_0x0007('0x5d')](handleError(_0x2a43dd,null));};exports[_0x0007('0x6c')]=function(_0x25c75a,_0x5b7095,_0x50bf24){return db[_0x0007('0x58')]['find']({'where':{'id':_0x25c75a['params']['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x5b7095,null))[_0x0007('0x20')](function(_0x180172){if(_0x180172){return _0x180172['removeAnswers'](_0x25c75a[_0x0007('0x47')][_0x0007('0x6d')]);}})[_0x0007('0x20')](respondWithStatusCode(_0x5b7095,null))[_0x0007('0x5d')](handleError(_0x5b7095,null));};exports[_0x0007('0x63')]=function(_0x4c27f1,_0x23d050){var _0x4776ce={'name':_0x4c27f1[_0x0007('0x5e')][_0x0007('0x39')],'key':_0x4c27f1[_0x0007('0x5e')][_0x0007('0x45')],'email':_0x4c27f1[_0x0007('0x5e')][_0x0007('0x6e')],'ListId':_0x4c27f1[_0x0007('0x5e')]['ListId'],'active':!_['isNil'](_0x4c27f1[_0x0007('0x5e')][_0x0007('0x6f')])?_0x4c27f1[_0x0007('0x5e')][_0x0007('0x6f')]:!![],'description':_0x4c27f1[_0x0007('0x5e')][_0x0007('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0x0007('0x71')](_0x4c27f1[_0x0007('0x5e')][_0x0007('0x72')])){if(_0x4c27f1[_0x0007('0x5e')][_0x0007('0x73')]){_0x4776ce[_0x0007('0x3c')][_0x0007('0x74')]=_0x4776ce[_0x0007('0x3e')][_0x0007('0x74')]=_0x4c27f1['body'][_0x0007('0x75')];_0x4776ce[_0x0007('0x3c')][_0x0007('0x76')]=_0x4776ce[_0x0007('0x3e')][_0x0007('0x77')]=_0x4c27f1[_0x0007('0x5e')][_0x0007('0x78')];}else{_0x4776ce['Imap'][_0x0007('0x79')]=_0x4776ce['Smtp']['authentication']=![];}_0x4776ce['Imap'][_0x0007('0x7a')]=_0x4c27f1[_0x0007('0x5e')][_0x0007('0x3c')][_0x0007('0x7a')];_0x4776ce[_0x0007('0x3c')][_0x0007('0x7b')]=_0x4c27f1['body']['Imap']['port'];_0x4776ce[_0x0007('0x3e')][_0x0007('0x7a')]=_0x4c27f1[_0x0007('0x5e')]['Smtp']['host'];_0x4776ce[_0x0007('0x3e')][_0x0007('0x7b')]=_0x4c27f1[_0x0007('0x5e')][_0x0007('0x3e')][_0x0007('0x7b')];}else{_0x4776ce['Imap'][_0x0007('0x7c')]=_0x4776ce[_0x0007('0x3e')]['service']=_0x4c27f1[_0x0007('0x5e')][_0x0007('0x72')];_0x4776ce[_0x0007('0x3c')][_0x0007('0x74')]=_0x4776ce[_0x0007('0x3e')]['user']=_0x4c27f1[_0x0007('0x5e')]['cuser'];_0x4776ce[_0x0007('0x3c')][_0x0007('0x76')]=_0x4776ce[_0x0007('0x3e')]['pass']=_0x4c27f1[_0x0007('0x5e')][_0x0007('0x78')];}return db[_0x0007('0x58')][_0x0007('0x63')](_0x4776ce,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x0007('0x3c')}]})[_0x0007('0x20')](function(_0x144c2f){var _0x3eee76=_0x4c27f1[_0x0007('0x74')][_0x0007('0x35')]({'plain':!![]});if(!_0x3eee76)throw new Error(_0x0007('0x7d'));if(_0x3eee76[_0x0007('0x7e')]===_0x0007('0x74')){var _0xb8b2a=_0x144c2f['get']({'plain':!![]});return db['UserProfileSection'][_0x0007('0x5c')]({'where':{'name':_0x0007('0x36'),'userProfileId':_0x3eee76[_0x0007('0x7f')]},'raw':!![]})[_0x0007('0x20')](function(_0x48aca7){if(_0x48aca7&&_0x48aca7['autoAssociation']===0x0){return db[_0x0007('0x37')][_0x0007('0x63')]({'name':_0xb8b2a[_0x0007('0x39')],'resourceId':_0xb8b2a['id'],'type':_0x48aca7[_0x0007('0x39')],'sectionId':_0x48aca7['id']},{})[_0x0007('0x20')](function(){return _0x144c2f;});}else{return _0x144c2f;}})[_0x0007('0x5d')](function(_0x585b0d){logger[_0x0007('0x26')](_0x0007('0x80'),_0x585b0d);throw _0x585b0d;});}return _0x144c2f;})[_0x0007('0x20')](respondWithResult(_0x23d050,0xc9))[_0x0007('0x5d')](handleError(_0x23d050,null));};exports[_0x0007('0x81')]=function(_0x10976b,_0x573ab1,_0x46d70b){return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x10976b[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x573ab1,null))[_0x0007('0x20')](function(_0x841e92){if(_0x841e92){return _0x841e92[_0x0007('0x81')]();}return null;})[_0x0007('0x20')](respondWithResult(_0x573ab1,null))[_0x0007('0x5d')](handleError(_0x573ab1,null));};exports[_0x0007('0x82')]=function(_0x563f33,_0x3c507e,_0x254cdf){if(_0x563f33[_0x0007('0x5e')]['id']){delete _0x563f33['body']['id'];}return db[_0x0007('0x58')]['find']({'where':{'id':_0x563f33[_0x0007('0x61')]['id']}})['then'](handleEntityNotFound(_0x3c507e,null))[_0x0007('0x20')](function(_0x5ec38d){if(_0x5ec38d){_0x563f33[_0x0007('0x5e')]['MailAccountId']=_0x5ec38d['id'];return db[_0x0007('0x3b')][_0x0007('0x63')](_0x563f33[_0x0007('0x5e')]);}})[_0x0007('0x20')](respondWithResult(_0x3c507e,null))['catch'](handleError(_0x3c507e,null));};exports[_0x0007('0x83')]=function(_0x193eea,_0x1e7766,_0x54da28){return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x193eea[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x1e7766,null))[_0x0007('0x20')](function(_0x3cdac9){if(_0x3cdac9){return _0x3cdac9['setImap'](null);}return null;})[_0x0007('0x20')](respondWithStatusCode(_0x1e7766,null))[_0x0007('0x5d')](handleError(_0x1e7766,null));};exports[_0x0007('0x84')]=function(_0x351f9f,_0x464d10,_0x2db0bd){return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x351f9f[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x464d10,null))[_0x0007('0x20')](function(_0x5d3011){if(_0x5d3011){return _0x5d3011[_0x0007('0x84')]();}return null;})[_0x0007('0x20')](respondWithResult(_0x464d10,null))[_0x0007('0x5d')](handleError(_0x464d10,null));};exports['addSmtp']=function(_0x249730,_0x236689,_0x125007){if(_0x249730[_0x0007('0x5e')]['id']){delete _0x249730['body']['id'];}return db[_0x0007('0x58')][_0x0007('0x5c')]({'where':{'id':_0x249730['params']['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x236689,null))[_0x0007('0x20')](function(_0x1289be){if(_0x1289be){_0x249730[_0x0007('0x5e')]['MailAccountId']=_0x1289be['id'];return db[_0x0007('0x3d')][_0x0007('0x63')](_0x249730['body']);}})[_0x0007('0x20')](respondWithResult(_0x236689,null))[_0x0007('0x5d')](handleError(_0x236689,null));};exports[_0x0007('0x85')]=function(_0x503baf,_0x3b8333,_0x14e6e6){return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x503baf[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x3b8333,null))[_0x0007('0x20')](function(_0x2c6942){if(_0x2c6942){return _0x2c6942[_0x0007('0x86')](null);}return null;})[_0x0007('0x20')](respondWithStatusCode(_0x3b8333,null))[_0x0007('0x5d')](handleError(_0x3b8333,null));};exports['addInteraction']=function(_0x21536c,_0x4fa557,_0x262ee8){return db[_0x0007('0x87')][_0x0007('0x5c')]({'where':{'id':_0x21536c[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x4fa557,null))['then'](function(_0xe8c911){if(_0xe8c911){return _0xe8c911[_0x0007('0x88')](_0x21536c['body'][_0x0007('0x6d')],_[_0x0007('0x89')](_0x21536c['body'],[_0x0007('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x4fa557,null))[_0x0007('0x5d')](handleError(_0x4fa557,null));};exports[_0x0007('0x8a')]=function(_0x340829,_0x2c3825,_0x3f8720){var _0x545348={'raw':![],'where':{}};var _0x2e793b={};var _0x3e3322={'count':0x0,'rows':[]};return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x340829[_0x0007('0x61')]['id']}})['then'](handleEntityNotFound(_0x2c3825,null))['then'](function(_0x203b18){if(_0x203b18){_0x2e793b[_0x0007('0x46')]=_[_0x0007('0x48')](db['MailInteraction'][_0x0007('0x42')]);_0x2e793b['query']=_[_0x0007('0x48')](_0x340829[_0x0007('0x47')]);_0x2e793b['filters']=_['intersection'](_0x2e793b[_0x0007('0x46')],_0x2e793b['query']);_0x545348[_0x0007('0x4a')]=_[_0x0007('0x4b')](_0x2e793b[_0x0007('0x46')],qs['fields'](_0x340829[_0x0007('0x47')][_0x0007('0x4c')]));_0x545348[_0x0007('0x4a')]=_0x545348[_0x0007('0x4a')]['length']?_0x545348[_0x0007('0x4a')]:_0x2e793b[_0x0007('0x46')];if(!_0x340829[_0x0007('0x47')]['hasOwnProperty']('nolimit')){_0x545348[_0x0007('0x2f')]=qs[_0x0007('0x2f')](_0x340829[_0x0007('0x47')][_0x0007('0x2f')]);_0x545348[_0x0007('0x2d')]=qs[_0x0007('0x2d')](_0x340829['query'][_0x0007('0x2d')]);}_0x545348[_0x0007('0x50')]=qs[_0x0007('0x51')](_0x340829['query'][_0x0007('0x51')]);_0x545348[_0x0007('0x52')]=qs['filters'](_['pick'](_0x340829[_0x0007('0x47')],_0x2e793b[_0x0007('0x49')]));_0x545348[_0x0007('0x52')]['MailAccountId']=_0x203b18['id'];if(_0x340829['query']['filter']){_0x545348[_0x0007('0x52')]=_[_0x0007('0x56')](_0x545348['where'],{'$or':_[_0x0007('0x41')](_0x545348['attributes'],function(_0x293fde){var _0x563b83={};_0x563b83[_0x293fde]={'$like':'%'+_0x340829[_0x0007('0x47')][_0x0007('0x54')]+'%'};return _0x563b83;})});}_0x545348=_['merge']({},_0x545348,_0x340829['options']);return db[_0x0007('0x87')][_0x0007('0x30')]({'where':_0x545348['where']})['then'](function(_0x9d1038){_0x3e3322[_0x0007('0x30')]=_0x9d1038;if(_0x340829[_0x0007('0x47')][_0x0007('0x59')]){_0x545348['include']=[{'model':db[_0x0007('0x8b')],'as':'Contact','required':![]},{'model':db[_0x0007('0x8c')],'as':_0x0007('0x8d'),'attributes':[_0x0007('0x39'),_0x0007('0x8e'),_0x0007('0x8f')],'required':![]},{'model':db[_0x0007('0x90')],'as':_0x0007('0x91'),'attributes':['id',_0x0007('0x39'),_0x0007('0x92')],'where':_0x340829['query'][_0x0007('0x93')]?{'id':_0x340829[_0x0007('0x47')][_0x0007('0x93')]}:undefined,'required':_0x340829[_0x0007('0x47')][_0x0007('0x93')]?!![]:![]}];}return db[_0x0007('0x87')][_0x0007('0x5a')](_0x545348);})['then'](function(_0x4fa913){_0x3e3322[_0x0007('0x67')]=_0x4fa913;return _0x3e3322;});}})[_0x0007('0x20')](respondWithFilteredResult(_0x2c3825,_0x545348))[_0x0007('0x5d')](handleError(_0x2c3825,null));};exports[_0x0007('0x94')]=function(_0x149d5c,_0x3ecfaf,_0x179ce8){return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0x149d5c[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x3ecfaf,null))['then'](function(_0x3d0474){if(_0x3d0474){return db['sequelize']['transaction'](function(_0x1cf374){return db[_0x0007('0x95')]['destroy']({'where':{'MailAccountId':_0x149d5c['params']['id']},'transaction':_0x1cf374})[_0x0007('0x20')](function(_0x225a21){var _0x4c7e5f=_['map'](_0x149d5c[_0x0007('0x5e')],function(_0x4c9cbb){_0x4c9cbb[_0x0007('0x62')]=_0x149d5c[_0x0007('0x61')]['id'];return _0x4c9cbb;});return db[_0x0007('0x95')][_0x0007('0x96')](_0x4c7e5f,{'transaction':_0x1cf374});});})[_0x0007('0x20')](function(){return db['MailApplication'][_0x0007('0x97')]({'where':{'MailAccountId':_0x149d5c[_0x0007('0x61')]['id']},'order':_0x0007('0x98')});});}})[_0x0007('0x20')](respondWithResult(_0x3ecfaf,null))[_0x0007('0x5d')](handleError(_0x3ecfaf,null));};exports[_0x0007('0x99')]=function(_0xc685c1,_0x19d511,_0x2fb059){var _0x1cf513={};var _0x2ea6bc={};var _0x4557c0;var _0x1cf47a;return db[_0x0007('0x58')][_0x0007('0x65')]({'where':{'id':_0xc685c1['params']['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x19d511,null))['then'](function(_0x1beb7e){if(_0x1beb7e){_0x4557c0=_0x1beb7e;_0x2ea6bc[_0x0007('0x46')]=_[_0x0007('0x48')](db[_0x0007('0x95')][_0x0007('0x42')]);_0x2ea6bc[_0x0007('0x47')]=_[_0x0007('0x48')](_0xc685c1[_0x0007('0x47')]);_0x2ea6bc[_0x0007('0x49')]=_[_0x0007('0x4b')](_0x2ea6bc[_0x0007('0x46')],_0x2ea6bc[_0x0007('0x47')]);_0x1cf513[_0x0007('0x4a')]=_['intersection'](_0x2ea6bc[_0x0007('0x46')],qs[_0x0007('0x4c')](_0xc685c1[_0x0007('0x47')][_0x0007('0x4c')]));_0x1cf513[_0x0007('0x4a')]=_0x1cf513[_0x0007('0x4a')][_0x0007('0x4d')]?_0x1cf513[_0x0007('0x4a')]:_0x2ea6bc[_0x0007('0x46')];_0x1cf513[_0x0007('0x50')]=qs['sort'](_0xc685c1['query'][_0x0007('0x51')]);_0x1cf513[_0x0007('0x52')]=qs[_0x0007('0x49')](_['pick'](_0xc685c1['query'],_0x2ea6bc['filters']));if(_0xc685c1[_0x0007('0x47')]['filter']){_0x1cf513[_0x0007('0x52')]=_[_0x0007('0x56')](_0x1cf513[_0x0007('0x52')],{'$or':_['map'](_0x1cf513[_0x0007('0x4a')],function(_0x1a9ee9){var _0x4e72a4={};_0x4e72a4[_0x1a9ee9]={'$like':'%'+_0xc685c1[_0x0007('0x47')][_0x0007('0x54')]+'%'};return _0x4e72a4;})});}_0x1cf513=_['merge']({},_0x1cf513,_0xc685c1['options']);return _0x4557c0['getApplications'](_0x1cf513);}})[_0x0007('0x20')](function(_0x4602ec){if(_0x4602ec){_0x1cf47a=_0x4602ec['length'];if(!_0xc685c1[_0x0007('0x47')][_0x0007('0x4e')]('nolimit')){_0x1cf513[_0x0007('0x2f')]=qs[_0x0007('0x2f')](_0xc685c1[_0x0007('0x47')]['limit']);_0x1cf513[_0x0007('0x2d')]=qs[_0x0007('0x2d')](_0xc685c1['query']['offset']);}return _0x4557c0[_0x0007('0x99')](_0x1cf513);}})['then'](function(_0x16b100){if(_0x16b100){return _0x16b100?{'count':_0x1cf47a,'rows':_0x16b100}:null;}})['then'](respondWithResult(_0x19d511,null))['catch'](handleError(_0x19d511,null));};exports[_0x0007('0x9a')]=function(_0x33e5b9,_0x516f9b,_0x54714e){var _0x302fa2={'raw':!![],'where':{}};var _0x1a6e16={};var _0x420ce9={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x33e5b9[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x516f9b,null))[_0x0007('0x20')](function(_0x5a4c65){if(_0x5a4c65){_0x1a6e16['model']=_[_0x0007('0x48')](db[_0x0007('0x9b')][_0x0007('0x42')]);_0x1a6e16[_0x0007('0x47')]=_[_0x0007('0x48')](_0x33e5b9[_0x0007('0x47')]);_0x1a6e16[_0x0007('0x49')]=_[_0x0007('0x4b')](_0x1a6e16[_0x0007('0x46')],_0x1a6e16[_0x0007('0x47')]);_0x302fa2[_0x0007('0x4a')]=_[_0x0007('0x4b')](_0x1a6e16['model'],qs['fields'](_0x33e5b9['query']['fields']));_0x302fa2[_0x0007('0x4a')]=_0x302fa2['attributes'][_0x0007('0x4d')]?_0x302fa2[_0x0007('0x4a')]:_0x1a6e16[_0x0007('0x46')];if(!_0x33e5b9[_0x0007('0x47')][_0x0007('0x4e')]('nolimit')){_0x302fa2['limit']=qs[_0x0007('0x2f')](_0x33e5b9[_0x0007('0x47')][_0x0007('0x2f')]);_0x302fa2[_0x0007('0x2d')]=qs[_0x0007('0x2d')](_0x33e5b9[_0x0007('0x47')][_0x0007('0x2d')]);}_0x302fa2[_0x0007('0x50')]=qs['sort'](_0x33e5b9[_0x0007('0x47')][_0x0007('0x51')]);_0x302fa2[_0x0007('0x52')]=qs[_0x0007('0x49')](_[_0x0007('0x53')](_0x33e5b9[_0x0007('0x47')],_0x1a6e16[_0x0007('0x49')]));_0x302fa2[_0x0007('0x52')]['MailAccountId']=_0x5a4c65['id'];if(_0x33e5b9[_0x0007('0x47')]['filter']){_0x302fa2[_0x0007('0x52')]=_[_0x0007('0x56')](_0x302fa2[_0x0007('0x52')],{'$or':_['map'](_0x302fa2['attributes'],function(_0x371f17){var _0x44dbb4={};_0x44dbb4[_0x371f17]={'$like':'%'+_0x33e5b9[_0x0007('0x47')][_0x0007('0x54')]+'%'};return _0x44dbb4;})});}if(_0x33e5b9[_0x0007('0x47')][_0x0007('0x9c')]){var _0x1148f4=_0x33e5b9[_0x0007('0x47')][_0x0007('0x9c')]['split'](',');var _0x3fe260={};_0x3fe260[_0x1148f4[0x0]]={'$gte':moment(_0x1148f4[0x1])[_0x0007('0x9d')](_0x0007('0x9e'))};_0x302fa2[_0x0007('0x52')]=_[_0x0007('0x56')](_0x302fa2['where'],_0x3fe260);}_0x302fa2=_[_0x0007('0x56')]({},_0x302fa2,_0x33e5b9['options']);return db[_0x0007('0x9b')][_0x0007('0x30')]({'where':_0x302fa2[_0x0007('0x52')]})[_0x0007('0x20')](function(_0x52bc58){_0x420ce9[_0x0007('0x30')]=_0x52bc58;if(_0x33e5b9[_0x0007('0x47')][_0x0007('0x59')]){_0x302fa2[_0x0007('0x9f')]=[{'all':!![]}];}return db[_0x0007('0x9b')]['findAll'](_0x302fa2);})['then'](function(_0x1dc43a){if(_0x33e5b9[_0x0007('0x47')][_0x0007('0xa0')]===_0x0007('0xa1')){for(var _0x49ed76=0x0;_0x49ed76<_0x1dc43a[_0x0007('0x4d')];_0x49ed76++){_0x1dc43a[_0x49ed76][_0x0007('0x5e')]=juice(_0x1dc43a[_0x49ed76][_0x0007('0x5e')]);}}_0x420ce9['rows']=_0x1dc43a;return _0x420ce9;});}})[_0x0007('0x20')](respondWithFilteredResult(_0x516f9b,_0x302fa2))[_0x0007('0x5d')](handleError(_0x516f9b,null));};exports['send']=function(_0x121e1c,_0x11b2d7,_0x2bab70){var _0x2eb9be,_0x2d74f1={},_0x4c9289;if(_0x121e1c['body']['to']){_0x4c9289=_0x121e1c['body']['to']['split'](',')[0x0];}return db[_0x0007('0x58')]['find']({'where':{'id':_0x121e1c['params']['id']},'include':[{'model':db[_0x0007('0xa2')],'as':_0x0007('0xa3'),'include':[{'model':db[_0x0007('0x8b')],'as':_0x0007('0xa4'),'where':{'email':_0x4c9289},'limit':0x1,'order':[[_0x0007('0xa5'),_0x0007('0xa6')]]}]},{'model':db['MailServerOut'],'as':_0x0007('0x3e'),'raw':!![]}]})[_0x0007('0x20')](handleEntityNotFound(_0x11b2d7,null))['then'](function(_0x48b6be){if(_0x48b6be){_0x2eb9be=_0x48b6be;if(_0x48b6be[_0x0007('0x3e')]){if(_[_0x0007('0x71')](_0x121e1c[_0x0007('0x5e')]['from'])){_0x121e1c[_0x0007('0x5e')][_0x0007('0xa7')]=util[_0x0007('0x9d')](_0x0007('0xa8'),_0x48b6be[_0x0007('0x39')],_0x48b6be['email']||_0x48b6be[_0x0007('0x3e')][_0x0007('0x74')]);}if(_0x121e1c[_0x0007('0x5e')][_0x0007('0xa9')]&&_0x121e1c['body'][_0x0007('0xa9')][_0x0007('0x4d')]){for(var _0x5bf902=0x0;_0x5bf902<_0x121e1c[_0x0007('0x5e')][_0x0007('0xa9')][_0x0007('0x4d')];_0x5bf902+=0x1){_0x121e1c[_0x0007('0x5e')][_0x0007('0xa9')][_0x5bf902]={'filename':_0x121e1c['body'][_0x0007('0xa9')][_0x5bf902][_0x0007('0x39')],'path':path[_0x0007('0xaa')](config[_0x0007('0xab')],'server/files/attachments',_0x121e1c['body'][_0x0007('0xa9')][_0x5bf902][_0x0007('0xac')])};}}var _0x170bbb={'tls':{'rejectUnauthorized':![]}};if(_[_0x0007('0x71')](_0x48b6be['Smtp'][_0x0007('0x7c')])){if(_0x48b6be[_0x0007('0x3e')][_0x0007('0x79')]){_0x170bbb[_0x0007('0xad')]={'user':_0x48b6be[_0x0007('0x3e')]['user'],'pass':_0x48b6be[_0x0007('0x3e')][_0x0007('0x77')]};}_0x170bbb[_0x0007('0x7a')]=_0x48b6be['Smtp'][_0x0007('0x7a')];_0x170bbb[_0x0007('0x7b')]=_0x48b6be[_0x0007('0x3e')]['port'];_0x170bbb[_0x0007('0xae')]=_0x48b6be[_0x0007('0x3e')]['secure'];}else{_0x170bbb[_0x0007('0x7c')]=_0x48b6be[_0x0007('0x3e')]['service'];_0x170bbb[_0x0007('0xad')]={'user':_0x48b6be['Smtp'][_0x0007('0x74')],'pass':_0x48b6be['Smtp'][_0x0007('0x77')]};}return respondWithRpcPromise(_0x0007('0xaf'),_0x0007('0xb0'),{'account':_0x170bbb,'message':_0x121e1c['body']});}else{throw new Error(_0x0007('0xb1'));}}})[_0x0007('0x20')](function(_0x308b8c){if(_0x308b8c){_0x2d74f1=_0x308b8c;if(_0x2eb9be[_0x0007('0xa3')]){if(_0x2eb9be[_0x0007('0xa3')][_0x0007('0xa4')][_0x0007('0x4d')]){return _0x2eb9be['List'][_0x0007('0xa4')][0x0];}else{return db[_0x0007('0x8b')][_0x0007('0x63')](_[_0x0007('0x1a')](_0x121e1c[_0x0007('0x5e')],{'firstName':_0x121e1c[_0x0007('0x5e')]['to'],'email':_0x121e1c[_0x0007('0x5e')]['to'],'phone':_0x121e1c[_0x0007('0x5e')]['to'],'ListId':_0x2eb9be[_0x0007('0xb2')]}));}}else{throw new Error(_0x0007('0xb1'));}}})[_0x0007('0x20')](function(_0x1345b0){if(_0x1345b0){var _0x31358e={'UserId':_0x121e1c[_0x0007('0x74')]['id'],'ContactId':_0x1345b0['id'],'MailAccountId':_0x2eb9be['id'],'inReplyTo':_0x2d74f1[_0x0007('0xb3')],'to':_0x121e1c[_0x0007('0x5e')]['from'],'cc':_0x121e1c['body']['cc'],'subject':_0x121e1c['body']['subject'],'attach':_0x121e1c[_0x0007('0x5e')][_0x0007('0xb4')],'firstMsgDirection':_0x0007('0xb5'),'lastMsgAt':moment()[_0x0007('0x9d')](_0x0007('0x9e')),'lastMsgDirection':_0x0007('0xb5'),'Messages':[_[_0x0007('0x56')](_0x121e1c[_0x0007('0x5e')],{'messageId':_0x2d74f1[_0x0007('0xb3')],'sentAt':moment()[_0x0007('0x9d')](_0x0007('0x9e')),'read':!![],'MailAccountId':_0x2eb9be['id'],'UserId':_0x121e1c[_0x0007('0x74')]['id'],'ContactId':_0x1345b0['id']})]};if(_0x121e1c[_0x0007('0x5e')][_0x0007('0xb6')]){_0x31358e=_[_0x0007('0x56')](_0x31358e,_0x121e1c[_0x0007('0x5e')]['Interaction']);}return db[_0x0007('0x87')][_0x0007('0x63')](_0x31358e,{'include':[{'model':db['MailMessage'],'as':_0x0007('0xb7')}]});}})[_0x0007('0x20')](respondWithResult(_0x11b2d7,null))['catch'](handleError(_0x11b2d7,null));};exports['verifySmtp']=function(_0x2e2861,_0x415718,_0x1762be){return db[_0x0007('0x58')][_0x0007('0x5c')]({'where':{'id':_0x2e2861[_0x0007('0x61')]['id']},'include':[{'model':db[_0x0007('0x3d')],'as':_0x0007('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x415718,null))[_0x0007('0x20')](function(_0x63a542){if(_0x63a542&&_0x63a542['Smtp']){var _0x23defc={'id':_0x63a542['id'],'tls':{'rejectUnauthorized':![]}};if(_0x63a542[_0x0007('0x3e')][_0x0007('0x7c')]){_0x23defc[_0x0007('0x7c')]=_0x63a542[_0x0007('0x3e')][_0x0007('0x7c')];}else{_0x23defc[_0x0007('0x7a')]=_0x63a542['Smtp'][_0x0007('0x7a')];_0x23defc[_0x0007('0x7b')]=_0x63a542[_0x0007('0x3e')][_0x0007('0x7b')];_0x23defc[_0x0007('0xae')]=_0x63a542[_0x0007('0x3e')][_0x0007('0xae')];}if(_0x63a542[_0x0007('0x3e')][_0x0007('0x79')]){_0x23defc[_0x0007('0xad')]={'user':_0x63a542[_0x0007('0x3e')][_0x0007('0x74')],'pass':_0x63a542[_0x0007('0x3e')]['pass']};}return respondWithRpcPromise(_0x0007('0xb8'),'verifySmtp',{'account':_0x23defc});}})[_0x0007('0x20')](respondWithResult(_0x415718,null))[_0x0007('0x5d')](handleError(_0x415718,null));};exports[_0x0007('0x34')]=function(_0x1668da,_0xaeb8a8){return db[_0x0007('0x58')]['find']({'where':{'id':_0x1668da[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0xaeb8a8,null))['then'](function(_0x12eeaa){if(_0x12eeaa&&_0x12eeaa[_0x0007('0x7c')]){throw new db[(_0x0007('0xb9'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x12eeaa;})[_0x0007('0x20')](removeEntity(_0xaeb8a8,null))[_0x0007('0x5d')](handleError(_0xaeb8a8,null));};exports[_0x0007('0xba')]=function(_0x57cede,_0x3e1aa1,_0x17ce2b){return db['MailAccount']['find']({'where':{'id':_0x57cede[_0x0007('0x61')]['id']}})[_0x0007('0x20')](handleEntityNotFound(_0x3e1aa1,null))[_0x0007('0x20')](function(_0x41ad0f){if(_0x41ad0f){return _0x41ad0f['addAgents'](_0x57cede[_0x0007('0x5e')][_0x0007('0x6d')],_[_0x0007('0x89')](_0x57cede['body'],[_0x0007('0x6d'),'id'])||{})[_0x0007('0xbb')](function(_0x334e61){for(var _0x390c92=0x0;_0x390c92<_0x57cede[_0x0007('0x5e')][_0x0007('0x6d')][_0x0007('0x4d')];_0x390c92+=0x1){socket[_0x0007('0xbc')](_0x0007('0xbd'),{'UserId':Number(_0x57cede[_0x0007('0x5e')][_0x0007('0x6d')][_0x390c92]),'MailAccountId':Number(_0x57cede[_0x0007('0x61')]['id'])});}return _0x334e61;});}})[_0x0007('0x20')](respondWithResult(_0x3e1aa1,null))['catch'](handleError(_0x3e1aa1,null));};exports['removeAgents']=function(_0x176b4e,_0x2381ab,_0x5374ba){return db[_0x0007('0x58')][_0x0007('0x5c')]({'where':{'id':_0x176b4e[_0x0007('0x61')]['id']}})['then'](handleEntityNotFound(_0x2381ab,null))['then'](function(_0x16e8f0){if(_0x16e8f0){return _0x16e8f0['removeAgents'](_0x176b4e['query']['ids'])[_0x0007('0x20')](function(){if(_[_0x0007('0xbe')](_0x176b4e['query']['ids'])){for(var _0x3e4db1=0x0;_0x3e4db1<_0x176b4e['query'][_0x0007('0x6d')][_0x0007('0x4d')];_0x3e4db1+=0x1){socket['emit'](_0x0007('0xbf'),{'UserId':Number(_0x176b4e[_0x0007('0x47')][_0x0007('0x6d')][_0x3e4db1]),'MailAccountId':Number(_0x176b4e['params']['id'])});}}else{socket[_0x0007('0xbc')]('userMailAccount:remove',{'UserId':Number(_0x176b4e['query'][_0x0007('0x6d')]),'MailAccountId':Number(_0x176b4e[_0x0007('0x61')]['id'])});}});}})[_0x0007('0x20')](respondWithStatusCode(_0x2381ab,null))[_0x0007('0x5d')](handleError(_0x2381ab,null));};exports[_0x0007('0xc0')]=function(_0x235e4b,_0x421720,_0x23c2c4){var _0x4393ea={};var _0x5e0075={};var _0x2bbffe;var _0x955c98;return db[_0x0007('0x58')]['findOne']({'where':{'id':_0x235e4b['params']['id']}})['then'](handleEntityNotFound(_0x421720,null))[_0x0007('0x20')](function(_0x100c55){if(_0x100c55){_0x2bbffe=_0x100c55;_0x5e0075[_0x0007('0x46')]=_[_0x0007('0x48')](db[_0x0007('0x8c')][_0x0007('0x42')]);_0x5e0075[_0x0007('0x47')]=_['keys'](_0x235e4b['query']);_0x5e0075[_0x0007('0x49')]=_[_0x0007('0x4b')](_0x5e0075['model'],_0x5e0075[_0x0007('0x47')]);_0x4393ea[_0x0007('0x4a')]=_[_0x0007('0x4b')](_0x5e0075[_0x0007('0x46')],qs[_0x0007('0x4c')](_0x235e4b['query'][_0x0007('0x4c')]));_0x4393ea[_0x0007('0x4a')]=_0x4393ea[_0x0007('0x4a')]['length']?_0x4393ea[_0x0007('0x4a')]:_0x5e0075[_0x0007('0x46')];_0x4393ea[_0x0007('0x50')]=qs[_0x0007('0x51')](_0x235e4b['query'][_0x0007('0x51')]);_0x4393ea[_0x0007('0x52')]=qs[_0x0007('0x49')](_['pick'](_0x235e4b[_0x0007('0x47')],_0x5e0075['filters']));if(_0x235e4b[_0x0007('0x47')][_0x0007('0x54')]){_0x4393ea[_0x0007('0x52')]=_[_0x0007('0x56')](_0x4393ea[_0x0007('0x52')],{'$or':_[_0x0007('0x41')](_0x4393ea['attributes'],function(_0x4c5bf5){var _0x48ec49={};_0x48ec49[_0x4c5bf5]={'$like':'%'+_0x235e4b[_0x0007('0x47')]['filter']+'%'};return _0x48ec49;})});}_0x4393ea=_['merge']({},_0x4393ea,_0x235e4b['options']);return _0x2bbffe['getAgents'](_0x4393ea);}})[_0x0007('0x20')](function(_0x9e19cb){if(_0x9e19cb){_0x955c98=_0x9e19cb[_0x0007('0x4d')];if(!_0x235e4b[_0x0007('0x47')][_0x0007('0x4e')](_0x0007('0x4f'))){_0x4393ea[_0x0007('0x2f')]=qs[_0x0007('0x2f')](_0x235e4b[_0x0007('0x47')]['limit']);_0x4393ea[_0x0007('0x2d')]=qs['offset'](_0x235e4b[_0x0007('0x47')]['offset']);}return _0x2bbffe['getAgents'](_0x4393ea);}})[_0x0007('0x20')](function(_0x5a3ebd){if(_0x5a3ebd){return _0x5a3ebd?{'count':_0x955c98,'rows':_0x5a3ebd}:null;}})[_0x0007('0x20')](respondWithResult(_0x421720,null))[_0x0007('0x5d')](handleError(_0x421720,null));}; \ No newline at end of file +var _0x0152=['includeAll','include','rows','show','Smtp','Pause','keys','find','body','params','describe','addDisposition','MailAccountId','Disposition','create','findOne','rawAttributes','nolimit','order','filter','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','email','ListId','description','cservice','cauthentication','user','cuser','password','pass','cpassword','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','getInteractions','MailInteraction','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','CmContact','DESC','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','sendMail','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','index','MailServerIn','Imap','MailServerOut','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','merge','options'];(function(_0x3b999f,_0x4ee8e8){var _0x1b151e=function(_0xb778e){while(--_0xb778e){_0x3b999f['push'](_0x3b999f['shift']());}};_0x1b151e(++_0x4ee8e8);}(_0x0152,0x12e));var _0x2015=function(_0x150791,_0x30e243){_0x150791=_0x150791-0x0;var _0x304345=_0x0152[_0x150791];return _0x304345;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2015('0x0'));var rp=require(_0x2015('0x1'));var moment=require('moment');var BPromise=require(_0x2015('0x2'));var Mustache=require(_0x2015('0x3'));var util=require(_0x2015('0x4'));var path=require(_0x2015('0x5'));var sox=require(_0x2015('0x6'));var csv=require(_0x2015('0x7'));var ejs=require(_0x2015('0x8'));var fs=require('fs');var fs_extra=require(_0x2015('0x9'));var _=require(_0x2015('0xa'));var squel=require(_0x2015('0xb'));var crypto=require('crypto');var jsforce=require(_0x2015('0xc'));var deskjs=require(_0x2015('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2015('0xe'));var htmlToText=require('html-to-text');var juice=require(_0x2015('0xf'));var Redis=require(_0x2015('0x10'));var authService=require(_0x2015('0x11'));var qs=require(_0x2015('0x12'));var as=require(_0x2015('0x13'));var hardwareService=require(_0x2015('0x14'));var logger=require(_0x2015('0x15'))(_0x2015('0x16'));var utils=require('../../config/utils');var config=require(_0x2015('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2015('0x18'))['db'];config[_0x2015('0x19')]=_[_0x2015('0x1a')](config[_0x2015('0x19')],{'host':_0x2015('0x1b'),'port':0x18eb});var socket=require(_0x2015('0x1c'))(new Redis(config[_0x2015('0x19')]));require(_0x2015('0x1d'))[_0x2015('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2015('0x1f')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3a11df,_0x543970,_0x250994,_0x4f019d){return new BPromise(function(_0x5ebfca,_0x252173){var _0x2a468d=_0x4f019d||client;return _0x2a468d[_0x2015('0x20')](_0x3a11df,_0x250994)[_0x2015('0x21')](function(_0x568bc5){logger[_0x2015('0x22')](_0x2015('0x23'),_0x543970,_0x2015('0x24'));logger[_0x2015('0x25')](_0x2015('0x26'),_0x543970,_0x2015('0x24'),JSON[_0x2015('0x27')](_0x568bc5));if(_0x568bc5[_0x2015('0x28')]){if(_0x568bc5['error']['code']===0x1f4){logger[_0x2015('0x28')](_0x2015('0x23'),_0x543970,_0x568bc5[_0x2015('0x28')]['message']);return _0x252173(_0x568bc5[_0x2015('0x28')][_0x2015('0x29')]);}logger[_0x2015('0x28')](_0x2015('0x23'),_0x543970,_0x568bc5['error']['message']);return _0x5ebfca(_0x568bc5[_0x2015('0x28')][_0x2015('0x29')]);}else{logger[_0x2015('0x22')](_0x2015('0x23'),_0x543970,_0x2015('0x24'));_0x5ebfca(_0x568bc5['result'][_0x2015('0x29')]);}})[_0x2015('0x2a')](function(_0x443eed){logger['error'](_0x2015('0x23'),_0x543970,_0x443eed);_0x252173(_0x443eed);});});}function respondWithStatusCode(_0x1a8fbf,_0x16eee7){_0x16eee7=_0x16eee7||0xcc;return function(_0x26ff82){if(_0x26ff82){return _0x1a8fbf['sendStatus'](_0x16eee7);}return _0x1a8fbf[_0x2015('0x2b')](_0x16eee7)[_0x2015('0x2c')]();};}function respondWithResult(_0x1df614,_0x5917e8){_0x5917e8=_0x5917e8||0xc8;return function(_0x1fc299){if(_0x1fc299){return _0x1df614['status'](_0x5917e8)[_0x2015('0x2d')](_0x1fc299);}};}function respondWithFilteredResult(_0x178838,_0x26a9d8){return function(_0x8806c1){if(_0x8806c1){var _0xaa7c55=typeof _0x26a9d8[_0x2015('0x2e')]===_0x2015('0x2f')&&typeof _0x26a9d8[_0x2015('0x30')]===_0x2015('0x2f');var _0x315005=_0x8806c1[_0x2015('0x31')];var _0x5697d3=_0xaa7c55?0x0:_0x26a9d8[_0x2015('0x2e')];var _0x4a71e0=_0xaa7c55?_0x8806c1[_0x2015('0x31')]:_0x26a9d8['offset']+_0x26a9d8[_0x2015('0x30')];var _0x27e45f;if(_0x4a71e0>=_0x315005){_0x4a71e0=_0x315005;_0x27e45f=0xc8;}else{_0x27e45f=0xce;}_0x178838['status'](_0x27e45f);return _0x178838[_0x2015('0x32')](_0x2015('0x33'),_0x5697d3+'-'+_0x4a71e0+'/'+_0x315005)[_0x2015('0x2d')](_0x8806c1);}return null;};}function patchUpdates(_0x41fcda){return function(_0x1f52c1){try{jsonpatch[_0x2015('0x34')](_0x1f52c1,_0x41fcda,!![]);}catch(_0x3eb7c3){return BPromise['reject'](_0x3eb7c3);}return _0x1f52c1[_0x2015('0x35')]();};}function saveUpdates(_0x1a1222,_0x192ca2){return function(_0x10db05){if(_0x10db05){return _0x10db05[_0x2015('0x36')](_0x1a1222)['then'](function(_0x3e66cb){return _0x3e66cb;});}return null;};}function removeEntity(_0x28648b,_0x39f068){return function(_0x18634e){if(_0x18634e){return _0x18634e[_0x2015('0x37')]()[_0x2015('0x21')](function(){var _0x4c210e=_0x18634e[_0x2015('0x38')]({'plain':!![]});var _0x3c3f19=_0x2015('0x39');return db[_0x2015('0x3a')][_0x2015('0x37')]({'where':{'type':_0x3c3f19,'resourceId':_0x4c210e['id']}})[_0x2015('0x21')](function(){return _0x18634e;});})[_0x2015('0x21')](function(){_0x28648b['status'](0xcc)[_0x2015('0x2c')]();});}};}function handleEntityNotFound(_0x4caaa1,_0xac8091){return function(_0x4bce7d){if(!_0x4bce7d){_0x4caaa1['sendStatus'](0x194);}return _0x4bce7d;};}function handleError(_0x17a251,_0x5bb366){_0x5bb366=_0x5bb366||0x1f4;return function(_0x564c54){logger[_0x2015('0x28')](_0x564c54[_0x2015('0x3b')]);if(_0x564c54[_0x2015('0x3c')]){delete _0x564c54[_0x2015('0x3c')];}_0x17a251[_0x2015('0x2b')](_0x5bb366)['send'](_0x564c54);};}exports[_0x2015('0x3d')]=function(_0x309118,_0x811a65){var _0x23a94d={'include':[{'model':db[_0x2015('0x3e')],'as':_0x2015('0x3f')},{'model':db[_0x2015('0x40')],'as':'Smtp'},{'model':db['Pause'],'as':_0x2015('0x41')}]},_0x15cc03={},_0x54946a={'count':0x0,'rows':[]};var _0x549fd5=_[_0x2015('0x42')](db[_0x2015('0x43')]['rawAttributes'],function(_0x314d8c){return{'name':_0x314d8c[_0x2015('0x44')],'type':_0x314d8c[_0x2015('0x45')][_0x2015('0x46')]};});_0x15cc03['model']=_[_0x2015('0x42')](_0x549fd5,'name');_0x15cc03[_0x2015('0x47')]=_['keys'](_0x309118[_0x2015('0x47')]);_0x15cc03['filters']=_[_0x2015('0x48')](_0x15cc03[_0x2015('0x49')],_0x15cc03[_0x2015('0x47')]);_0x23a94d[_0x2015('0x4a')]=_['intersection'](_0x15cc03[_0x2015('0x49')],qs[_0x2015('0x4b')](_0x309118[_0x2015('0x47')][_0x2015('0x4b')]));_0x23a94d[_0x2015('0x4a')]=_0x23a94d['attributes'][_0x2015('0x4c')]?_0x23a94d['attributes']:_0x15cc03[_0x2015('0x49')];if(!_0x309118[_0x2015('0x47')][_0x2015('0x4d')]('nolimit')){_0x23a94d[_0x2015('0x30')]=qs['limit'](_0x309118[_0x2015('0x47')][_0x2015('0x30')]);_0x23a94d[_0x2015('0x2e')]=qs[_0x2015('0x2e')](_0x309118[_0x2015('0x47')][_0x2015('0x2e')]);}_0x23a94d['order']=qs['sort'](_0x309118['query'][_0x2015('0x4e')]);_0x23a94d[_0x2015('0x4f')]=qs['filters'](_[_0x2015('0x50')](_0x309118[_0x2015('0x47')],_0x15cc03[_0x2015('0x51')]),_0x549fd5);if(_0x309118[_0x2015('0x47')]['filter']){_0x23a94d[_0x2015('0x4f')]=_[_0x2015('0x52')](_0x23a94d[_0x2015('0x4f')],{'$or':_[_0x2015('0x42')](_0x549fd5,function(_0x58d901){if(_0x58d901['type']!=='VIRTUAL'){var _0x209393={};_0x209393[_0x58d901[_0x2015('0x3c')]]={'$like':'%'+_0x309118[_0x2015('0x47')]['filter']+'%'};return _0x209393;}})});}_0x23a94d=_[_0x2015('0x52')]({},_0x23a94d,_0x309118[_0x2015('0x53')]);var _0x6a4500={'where':_0x23a94d['where']};return db[_0x2015('0x43')][_0x2015('0x31')](_0x6a4500)[_0x2015('0x21')](function(_0x106f80){_0x54946a['count']=_0x106f80;if(_0x309118[_0x2015('0x47')][_0x2015('0x54')]){_0x23a94d[_0x2015('0x55')]=[{'all':!![]}];}return db[_0x2015('0x43')]['findAll'](_0x23a94d);})[_0x2015('0x21')](function(_0x36d6aa){_0x54946a[_0x2015('0x56')]=_0x36d6aa;return _0x54946a;})[_0x2015('0x21')](respondWithFilteredResult(_0x811a65,_0x23a94d))[_0x2015('0x2a')](handleError(_0x811a65,null));};exports[_0x2015('0x57')]=function(_0x4637a7,_0x1df61a){var _0x2f6653={'raw':![],'where':{'id':_0x4637a7['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x2015('0x3f')},{'model':db[_0x2015('0x40')],'as':_0x2015('0x58')},{'model':db[_0x2015('0x59')],'as':_0x2015('0x41')}]},_0xa6361c={};_0xa6361c[_0x2015('0x49')]=_[_0x2015('0x5a')](db[_0x2015('0x43')]['rawAttributes']);_0xa6361c['query']=_[_0x2015('0x5a')](_0x4637a7[_0x2015('0x47')]);_0xa6361c[_0x2015('0x51')]=_[_0x2015('0x48')](_0xa6361c[_0x2015('0x49')],_0xa6361c[_0x2015('0x47')]);_0x2f6653[_0x2015('0x4a')]=_[_0x2015('0x48')](_0xa6361c[_0x2015('0x49')],qs[_0x2015('0x4b')](_0x4637a7[_0x2015('0x47')][_0x2015('0x4b')]));_0x2f6653['attributes']=_0x2f6653[_0x2015('0x4a')][_0x2015('0x4c')]?_0x2f6653[_0x2015('0x4a')]:_0xa6361c[_0x2015('0x49')];if(_0x4637a7[_0x2015('0x47')][_0x2015('0x54')]){_0x2f6653[_0x2015('0x55')]=[{'all':!![]}];}_0x2f6653=_[_0x2015('0x52')]({},_0x2f6653,_0x4637a7[_0x2015('0x53')]);return db['MailAccount'][_0x2015('0x5b')](_0x2f6653)['then'](handleEntityNotFound(_0x1df61a,null))['then'](respondWithResult(_0x1df61a,null))[_0x2015('0x2a')](handleError(_0x1df61a,null));};exports[_0x2015('0x36')]=function(_0x57d9e9,_0x15603f){if(_0x57d9e9[_0x2015('0x5c')]['id']){delete _0x57d9e9['body']['id'];}return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0x57d9e9[_0x2015('0x5d')]['id']},'include':[{'model':db[_0x2015('0x3e')],'as':_0x2015('0x3f')},{'model':db['MailServerOut'],'as':_0x2015('0x58')},{'model':db[_0x2015('0x59')],'as':_0x2015('0x41')}]})[_0x2015('0x21')](handleEntityNotFound(_0x15603f,null))['then'](saveUpdates(_0x57d9e9[_0x2015('0x5c')],null))[_0x2015('0x21')](function(_0x43cfa0){if(_0x43cfa0&&_0x57d9e9[_0x2015('0x5c')][_0x2015('0x3f')]){return db[_0x2015('0x3e')]['update'](_0x57d9e9[_0x2015('0x5c')][_0x2015('0x3f')],{'where':{'MailAccountId':_0x43cfa0['id']}})[_0x2015('0x21')](function(){return _0x43cfa0;});}return _0x43cfa0;})[_0x2015('0x21')](function(_0x194059){if(_0x194059&&_0x57d9e9['body'][_0x2015('0x58')]){return db['MailServerOut'][_0x2015('0x36')](_0x57d9e9['body'][_0x2015('0x58')],{'where':{'MailAccountId':_0x194059['id']}})[_0x2015('0x21')](function(){return _0x194059;});}return _0x194059;})[_0x2015('0x21')](respondWithResult(_0x15603f,null))[_0x2015('0x2a')](handleError(_0x15603f,null));};exports[_0x2015('0x5e')]=function(_0x5b5853,_0x5074f4){return db[_0x2015('0x43')]['describe']()['then'](respondWithResult(_0x5074f4,null))[_0x2015('0x2a')](handleError(_0x5074f4,null));};exports[_0x2015('0x5f')]=function(_0x47b14d,_0x69f6b6,_0x236156){if(_0x47b14d[_0x2015('0x5c')]['id']){delete _0x47b14d[_0x2015('0x5c')]['id'];}return db[_0x2015('0x43')]['find']({'where':{'id':_0x47b14d[_0x2015('0x5d')]['id']}})['then'](handleEntityNotFound(_0x69f6b6,null))[_0x2015('0x21')](function(_0x52d197){if(_0x52d197){_0x47b14d[_0x2015('0x5c')][_0x2015('0x60')]=_0x52d197['id'];return db[_0x2015('0x61')][_0x2015('0x62')](_0x47b14d['body']);}})[_0x2015('0x21')](respondWithResult(_0x69f6b6,null))['catch'](handleError(_0x69f6b6,null));};exports['getDispositions']=function(_0x342a35,_0x4e4104,_0x313734){var _0x87fee3={'raw':![],'where':{}};var _0x3eb60c={};var _0x37187c={'count':0x0,'rows':[]};return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x342a35[_0x2015('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4e4104,null))['then'](function(_0x6cc676){if(_0x6cc676){_0x3eb60c[_0x2015('0x49')]=_['keys'](db[_0x2015('0x61')][_0x2015('0x64')]);_0x3eb60c[_0x2015('0x47')]=_[_0x2015('0x5a')](_0x342a35[_0x2015('0x47')]);_0x3eb60c[_0x2015('0x51')]=_[_0x2015('0x48')](_0x3eb60c[_0x2015('0x49')],_0x3eb60c[_0x2015('0x47')]);_0x87fee3['attributes']=_['intersection'](_0x3eb60c[_0x2015('0x49')],qs[_0x2015('0x4b')](_0x342a35[_0x2015('0x47')][_0x2015('0x4b')]));_0x87fee3[_0x2015('0x4a')]=_0x87fee3[_0x2015('0x4a')][_0x2015('0x4c')]?_0x87fee3['attributes']:_0x3eb60c[_0x2015('0x49')];if(!_0x342a35[_0x2015('0x47')]['hasOwnProperty'](_0x2015('0x65'))){_0x87fee3[_0x2015('0x30')]=qs[_0x2015('0x30')](_0x342a35[_0x2015('0x47')]['limit']);_0x87fee3[_0x2015('0x2e')]=qs[_0x2015('0x2e')](_0x342a35['query']['offset']);}_0x87fee3[_0x2015('0x66')]=qs['sort'](_0x342a35['query'][_0x2015('0x4e')]);_0x87fee3[_0x2015('0x4f')]=qs['filters'](_['pick'](_0x342a35[_0x2015('0x47')],_0x3eb60c[_0x2015('0x51')]));_0x87fee3[_0x2015('0x4f')][_0x2015('0x60')]=_0x6cc676['id'];if(_0x342a35['query']['filter']){_0x87fee3[_0x2015('0x4f')]=_['merge'](_0x87fee3['where'],{'$or':_[_0x2015('0x42')](_0x87fee3[_0x2015('0x4a')],function(_0x295317){var _0x50ea73={};_0x50ea73[_0x295317]={'$like':'%'+_0x342a35['query'][_0x2015('0x67')]+'%'};return _0x50ea73;})});}_0x87fee3=_[_0x2015('0x52')]({},_0x87fee3,_0x342a35[_0x2015('0x53')]);return db[_0x2015('0x61')][_0x2015('0x31')]({'where':_0x87fee3[_0x2015('0x4f')]})[_0x2015('0x21')](function(_0x4f09df){_0x37187c['count']=_0x4f09df;if(_0x342a35['query'][_0x2015('0x54')]){_0x87fee3['include']=[{'all':!![]}];}return db[_0x2015('0x61')][_0x2015('0x68')](_0x87fee3);})[_0x2015('0x21')](function(_0x165c28){_0x37187c[_0x2015('0x56')]=_0x165c28;return _0x37187c;});}})[_0x2015('0x21')](respondWithFilteredResult(_0x4e4104,_0x87fee3))[_0x2015('0x2a')](handleError(_0x4e4104,null));};exports[_0x2015('0x69')]=function(_0x746493,_0x3ac78b,_0x3ceb04){return db[_0x2015('0x43')]['find']({'where':{'id':_0x746493[_0x2015('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3ac78b,null))['then'](function(_0x36f4c2){if(_0x36f4c2){return _0x36f4c2[_0x2015('0x69')](_0x746493['query']['ids']);}})[_0x2015('0x21')](respondWithStatusCode(_0x3ac78b,null))[_0x2015('0x2a')](handleError(_0x3ac78b,null));};exports['addAnswer']=function(_0xff067f,_0x104f23,_0x498ad8){if(_0xff067f[_0x2015('0x5c')]['id']){delete _0xff067f['body']['id'];}return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0xff067f[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x104f23,null))[_0x2015('0x21')](function(_0x3aa54b){if(_0x3aa54b){_0xff067f[_0x2015('0x5c')][_0x2015('0x60')]=_0x3aa54b['id'];return db[_0x2015('0x6a')][_0x2015('0x62')](_0xff067f[_0x2015('0x5c')]);}})[_0x2015('0x21')](respondWithResult(_0x104f23,null))[_0x2015('0x2a')](handleError(_0x104f23,null));};exports[_0x2015('0x6b')]=function(_0x442aae,_0xc92ced,_0x14dadc){var _0x556280={'raw':![],'where':{}};var _0x5f4aab={};var _0x42ec38={'count':0x0,'rows':[]};return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x442aae[_0x2015('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc92ced,null))[_0x2015('0x21')](function(_0x3c608f){if(_0x3c608f){_0x5f4aab[_0x2015('0x49')]=_[_0x2015('0x5a')](db[_0x2015('0x6a')][_0x2015('0x64')]);_0x5f4aab['query']=_[_0x2015('0x5a')](_0x442aae[_0x2015('0x47')]);_0x5f4aab[_0x2015('0x51')]=_[_0x2015('0x48')](_0x5f4aab[_0x2015('0x49')],_0x5f4aab[_0x2015('0x47')]);_0x556280[_0x2015('0x4a')]=_[_0x2015('0x48')](_0x5f4aab[_0x2015('0x49')],qs[_0x2015('0x4b')](_0x442aae[_0x2015('0x47')][_0x2015('0x4b')]));_0x556280[_0x2015('0x4a')]=_0x556280[_0x2015('0x4a')][_0x2015('0x4c')]?_0x556280[_0x2015('0x4a')]:_0x5f4aab[_0x2015('0x49')];if(!_0x442aae['query'][_0x2015('0x4d')](_0x2015('0x65'))){_0x556280[_0x2015('0x30')]=qs[_0x2015('0x30')](_0x442aae[_0x2015('0x47')][_0x2015('0x30')]);_0x556280[_0x2015('0x2e')]=qs[_0x2015('0x2e')](_0x442aae[_0x2015('0x47')][_0x2015('0x2e')]);}_0x556280['order']=qs['sort'](_0x442aae[_0x2015('0x47')][_0x2015('0x4e')]);_0x556280[_0x2015('0x4f')]=qs[_0x2015('0x51')](_[_0x2015('0x50')](_0x442aae[_0x2015('0x47')],_0x5f4aab['filters']));_0x556280[_0x2015('0x4f')][_0x2015('0x60')]=_0x3c608f['id'];if(_0x442aae[_0x2015('0x47')][_0x2015('0x67')]){_0x556280[_0x2015('0x4f')]=_['merge'](_0x556280[_0x2015('0x4f')],{'$or':_[_0x2015('0x42')](_0x556280[_0x2015('0x4a')],function(_0x4db812){var _0x5b6c9e={};_0x5b6c9e[_0x4db812]={'$like':'%'+_0x442aae[_0x2015('0x47')]['filter']+'%'};return _0x5b6c9e;})});}_0x556280=_[_0x2015('0x52')]({},_0x556280,_0x442aae[_0x2015('0x53')]);return db[_0x2015('0x6a')][_0x2015('0x31')]({'where':_0x556280[_0x2015('0x4f')]})[_0x2015('0x21')](function(_0x17a52a){_0x42ec38[_0x2015('0x31')]=_0x17a52a;if(_0x442aae['query'][_0x2015('0x54')]){_0x556280[_0x2015('0x55')]=[{'all':!![]}];}return db[_0x2015('0x6a')][_0x2015('0x68')](_0x556280);})[_0x2015('0x21')](function(_0xc54bfd){_0x42ec38['rows']=_0xc54bfd;return _0x42ec38;});}})[_0x2015('0x21')](respondWithFilteredResult(_0xc92ced,_0x556280))[_0x2015('0x2a')](handleError(_0xc92ced,null));};exports[_0x2015('0x6c')]=function(_0x5d5730,_0x376894,_0x33f030){return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0x5d5730[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x376894,null))[_0x2015('0x21')](function(_0x326532){if(_0x326532){return _0x326532[_0x2015('0x6c')](_0x5d5730[_0x2015('0x47')][_0x2015('0x6d')]);}})[_0x2015('0x21')](respondWithStatusCode(_0x376894,null))['catch'](handleError(_0x376894,null));};exports[_0x2015('0x62')]=function(_0x5a9933,_0x36646f){var _0xe69aec={'name':_0x5a9933[_0x2015('0x5c')][_0x2015('0x3c')],'key':_0x5a9933[_0x2015('0x5c')]['key'],'email':_0x5a9933[_0x2015('0x5c')][_0x2015('0x6e')],'ListId':_0x5a9933['body'][_0x2015('0x6f')],'active':!_['isNil'](_0x5a9933['body']['active'])?_0x5a9933['body']['active']:!![],'description':_0x5a9933[_0x2015('0x5c')][_0x2015('0x70')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x5a9933[_0x2015('0x5c')][_0x2015('0x71')])){if(_0x5a9933['body'][_0x2015('0x72')]){_0xe69aec[_0x2015('0x3f')][_0x2015('0x73')]=_0xe69aec[_0x2015('0x58')]['user']=_0x5a9933['body'][_0x2015('0x74')];_0xe69aec['Imap'][_0x2015('0x75')]=_0xe69aec[_0x2015('0x58')][_0x2015('0x76')]=_0x5a9933[_0x2015('0x5c')][_0x2015('0x77')];}else{_0xe69aec['Imap']['authentication']=_0xe69aec[_0x2015('0x58')]['authentication']=![];}_0xe69aec[_0x2015('0x3f')]['host']=_0x5a9933[_0x2015('0x5c')][_0x2015('0x3f')][_0x2015('0x78')];_0xe69aec[_0x2015('0x3f')]['port']=_0x5a9933['body'][_0x2015('0x3f')][_0x2015('0x79')];_0xe69aec[_0x2015('0x58')]['host']=_0x5a9933['body']['Smtp'][_0x2015('0x78')];_0xe69aec[_0x2015('0x58')][_0x2015('0x79')]=_0x5a9933[_0x2015('0x5c')][_0x2015('0x58')][_0x2015('0x79')];}else{_0xe69aec['Imap'][_0x2015('0x7a')]=_0xe69aec[_0x2015('0x58')][_0x2015('0x7a')]=_0x5a9933['body']['cservice'];_0xe69aec[_0x2015('0x3f')][_0x2015('0x73')]=_0xe69aec[_0x2015('0x58')]['user']=_0x5a9933['body']['cuser'];_0xe69aec[_0x2015('0x3f')][_0x2015('0x75')]=_0xe69aec['Smtp'][_0x2015('0x76')]=_0x5a9933[_0x2015('0x5c')]['cpassword'];}return db[_0x2015('0x43')][_0x2015('0x62')](_0xe69aec,{'include':[{'model':db[_0x2015('0x40')],'as':'Smtp'},{'model':db[_0x2015('0x3e')],'as':_0x2015('0x3f')}]})[_0x2015('0x21')](function(_0x5b6a93){var _0x1040f3=_0x5a9933[_0x2015('0x73')][_0x2015('0x38')]({'plain':!![]});if(!_0x1040f3)throw new Error(_0x2015('0x7b'));if(_0x1040f3[_0x2015('0x7c')]===_0x2015('0x73')){var _0x23bd0d=_0x5b6a93[_0x2015('0x38')]({'plain':!![]});return db[_0x2015('0x7d')][_0x2015('0x5b')]({'where':{'name':'MailAccounts','userProfileId':_0x1040f3['userProfileId']},'raw':!![]})[_0x2015('0x21')](function(_0x245f39){if(_0x245f39&&_0x245f39[_0x2015('0x7e')]===0x0){return db[_0x2015('0x3a')][_0x2015('0x62')]({'name':_0x23bd0d[_0x2015('0x3c')],'resourceId':_0x23bd0d['id'],'type':_0x245f39['name'],'sectionId':_0x245f39['id']},{})[_0x2015('0x21')](function(){return _0x5b6a93;});}else{return _0x5b6a93;}})[_0x2015('0x2a')](function(_0x3db542){logger[_0x2015('0x28')](_0x2015('0x7f'),_0x3db542);throw _0x3db542;});}return _0x5b6a93;})['then'](respondWithResult(_0x36646f,0xc9))[_0x2015('0x2a')](handleError(_0x36646f,null));};exports[_0x2015('0x80')]=function(_0x58c3ea,_0x111ecc,_0x350b41){return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x58c3ea[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x111ecc,null))[_0x2015('0x21')](function(_0x47a80a){if(_0x47a80a){return _0x47a80a['getImap']();}return null;})[_0x2015('0x21')](respondWithResult(_0x111ecc,null))[_0x2015('0x2a')](handleError(_0x111ecc,null));};exports[_0x2015('0x81')]=function(_0x221fa7,_0x23dd81,_0x55f22a){if(_0x221fa7[_0x2015('0x5c')]['id']){delete _0x221fa7[_0x2015('0x5c')]['id'];}return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0x221fa7[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x23dd81,null))[_0x2015('0x21')](function(_0xe92093){if(_0xe92093){_0x221fa7['body']['MailAccountId']=_0xe92093['id'];return db[_0x2015('0x3e')][_0x2015('0x62')](_0x221fa7[_0x2015('0x5c')]);}})[_0x2015('0x21')](respondWithResult(_0x23dd81,null))['catch'](handleError(_0x23dd81,null));};exports[_0x2015('0x82')]=function(_0x20688d,_0x40e680,_0x11ccd2){return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x20688d[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x40e680,null))['then'](function(_0x468323){if(_0x468323){return _0x468323[_0x2015('0x83')](null);}return null;})[_0x2015('0x21')](respondWithStatusCode(_0x40e680,null))[_0x2015('0x2a')](handleError(_0x40e680,null));};exports[_0x2015('0x84')]=function(_0x303cdd,_0x19acb6,_0xb17abb){return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x303cdd[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x19acb6,null))['then'](function(_0x4c76a1){if(_0x4c76a1){return _0x4c76a1[_0x2015('0x84')]();}return null;})[_0x2015('0x21')](respondWithResult(_0x19acb6,null))[_0x2015('0x2a')](handleError(_0x19acb6,null));};exports[_0x2015('0x85')]=function(_0x18f642,_0x1a52b5,_0x3d4ec0){if(_0x18f642[_0x2015('0x5c')]['id']){delete _0x18f642[_0x2015('0x5c')]['id'];}return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0x18f642['params']['id']}})['then'](handleEntityNotFound(_0x1a52b5,null))[_0x2015('0x21')](function(_0x3678aa){if(_0x3678aa){_0x18f642[_0x2015('0x5c')][_0x2015('0x60')]=_0x3678aa['id'];return db['MailServerOut'][_0x2015('0x62')](_0x18f642['body']);}})[_0x2015('0x21')](respondWithResult(_0x1a52b5,null))[_0x2015('0x2a')](handleError(_0x1a52b5,null));};exports[_0x2015('0x86')]=function(_0x540772,_0x12586d,_0x5395fe){return db['MailAccount']['findOne']({'where':{'id':_0x540772['params']['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x12586d,null))[_0x2015('0x21')](function(_0x4e6b90){if(_0x4e6b90){return _0x4e6b90['setSmtp'](null);}return null;})[_0x2015('0x21')](respondWithStatusCode(_0x12586d,null))['catch'](handleError(_0x12586d,null));};exports[_0x2015('0x87')]=function(_0x19127f,_0x99c8ab,_0x5820da){return db['MailInteraction'][_0x2015('0x5b')]({'where':{'id':_0x19127f[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x99c8ab,null))[_0x2015('0x21')](function(_0x3c00b5){if(_0x3c00b5){return _0x3c00b5[_0x2015('0x87')](_0x19127f[_0x2015('0x5c')]['ids'],_['omit'](_0x19127f['body'],[_0x2015('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x99c8ab,null))['catch'](handleError(_0x99c8ab,null));};exports[_0x2015('0x88')]=function(_0x3d2bdd,_0x3139cc,_0x1611ed){var _0x284136={'raw':![],'where':{}};var _0x3c1940={};var _0x4b9900={'count':0x0,'rows':[]};return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x3d2bdd[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x3139cc,null))[_0x2015('0x21')](function(_0x5840d5){if(_0x5840d5){_0x3c1940['model']=_[_0x2015('0x5a')](db['MailInteraction'][_0x2015('0x64')]);_0x3c1940[_0x2015('0x47')]=_[_0x2015('0x5a')](_0x3d2bdd[_0x2015('0x47')]);_0x3c1940['filters']=_[_0x2015('0x48')](_0x3c1940[_0x2015('0x49')],_0x3c1940[_0x2015('0x47')]);_0x284136[_0x2015('0x4a')]=_['intersection'](_0x3c1940[_0x2015('0x49')],qs['fields'](_0x3d2bdd['query']['fields']));_0x284136['attributes']=_0x284136[_0x2015('0x4a')][_0x2015('0x4c')]?_0x284136[_0x2015('0x4a')]:_0x3c1940[_0x2015('0x49')];if(!_0x3d2bdd['query'][_0x2015('0x4d')](_0x2015('0x65'))){_0x284136[_0x2015('0x30')]=qs['limit'](_0x3d2bdd[_0x2015('0x47')][_0x2015('0x30')]);_0x284136['offset']=qs['offset'](_0x3d2bdd[_0x2015('0x47')]['offset']);}_0x284136[_0x2015('0x66')]=qs[_0x2015('0x4e')](_0x3d2bdd[_0x2015('0x47')][_0x2015('0x4e')]);_0x284136['where']=qs[_0x2015('0x51')](_[_0x2015('0x50')](_0x3d2bdd['query'],_0x3c1940['filters']));_0x284136[_0x2015('0x4f')][_0x2015('0x60')]=_0x5840d5['id'];if(_0x3d2bdd[_0x2015('0x47')]['filter']){_0x284136[_0x2015('0x4f')]=_['merge'](_0x284136[_0x2015('0x4f')],{'$or':_[_0x2015('0x42')](_0x284136['attributes'],function(_0x3d2cea){var _0x10fd03={};_0x10fd03[_0x3d2cea]={'$like':'%'+_0x3d2bdd[_0x2015('0x47')][_0x2015('0x67')]+'%'};return _0x10fd03;})});}_0x284136=_[_0x2015('0x52')]({},_0x284136,_0x3d2bdd[_0x2015('0x53')]);return db[_0x2015('0x89')][_0x2015('0x31')]({'where':_0x284136['where']})[_0x2015('0x21')](function(_0x437afa){_0x4b9900[_0x2015('0x31')]=_0x437afa;if(_0x3d2bdd['query'][_0x2015('0x54')]){_0x284136['include']=[{'model':db['CmContact'],'as':_0x2015('0x8a'),'required':![]},{'model':db['User'],'as':_0x2015('0x8b'),'attributes':[_0x2015('0x3c'),_0x2015('0x8c'),_0x2015('0x8d')],'required':![]},{'model':db[_0x2015('0x8e')],'as':_0x2015('0x8f'),'attributes':['id',_0x2015('0x3c'),'color'],'where':_0x3d2bdd['query'][_0x2015('0x90')]?{'id':_0x3d2bdd[_0x2015('0x47')][_0x2015('0x90')]}:undefined,'required':_0x3d2bdd[_0x2015('0x47')][_0x2015('0x90')]?!![]:![]}];}return db[_0x2015('0x89')]['findAll'](_0x284136);})[_0x2015('0x21')](function(_0x28eeb2){_0x4b9900[_0x2015('0x56')]=_0x28eeb2;return _0x4b9900;});}})[_0x2015('0x21')](respondWithFilteredResult(_0x3139cc,_0x284136))[_0x2015('0x2a')](handleError(_0x3139cc,null));};exports[_0x2015('0x91')]=function(_0x3bd450,_0x57cf21,_0x506c01){return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x3bd450['params']['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x57cf21,null))[_0x2015('0x21')](function(_0x56316e){if(_0x56316e){return db[_0x2015('0x92')][_0x2015('0x93')](function(_0x15cf03){return db[_0x2015('0x94')][_0x2015('0x37')]({'where':{'MailAccountId':_0x3bd450[_0x2015('0x5d')]['id']},'transaction':_0x15cf03})['then'](function(_0x27254a){var _0x1e338f=_['map'](_0x3bd450[_0x2015('0x5c')],function(_0x5df68c){_0x5df68c[_0x2015('0x60')]=_0x3bd450['params']['id'];return _0x5df68c;});return db[_0x2015('0x94')][_0x2015('0x95')](_0x1e338f,{'transaction':_0x15cf03});});})[_0x2015('0x21')](function(){return db['MailApplication'][_0x2015('0x96')]({'where':{'MailAccountId':_0x3bd450[_0x2015('0x5d')]['id']},'order':_0x2015('0x97')});});}})['then'](respondWithResult(_0x57cf21,null))['catch'](handleError(_0x57cf21,null));};exports[_0x2015('0x98')]=function(_0x2e4649,_0x5ed5aa,_0xa44af7){var _0x3816b7={};var _0x1aec98={};var _0x2e7bc8;var _0x1b78cc;return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x2e4649['params']['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x5ed5aa,null))[_0x2015('0x21')](function(_0x54a0b8){if(_0x54a0b8){_0x2e7bc8=_0x54a0b8;_0x1aec98[_0x2015('0x49')]=_[_0x2015('0x5a')](db[_0x2015('0x94')]['rawAttributes']);_0x1aec98[_0x2015('0x47')]=_['keys'](_0x2e4649[_0x2015('0x47')]);_0x1aec98[_0x2015('0x51')]=_['intersection'](_0x1aec98[_0x2015('0x49')],_0x1aec98[_0x2015('0x47')]);_0x3816b7[_0x2015('0x4a')]=_[_0x2015('0x48')](_0x1aec98[_0x2015('0x49')],qs['fields'](_0x2e4649['query'][_0x2015('0x4b')]));_0x3816b7['attributes']=_0x3816b7['attributes'][_0x2015('0x4c')]?_0x3816b7[_0x2015('0x4a')]:_0x1aec98[_0x2015('0x49')];_0x3816b7[_0x2015('0x66')]=qs[_0x2015('0x4e')](_0x2e4649[_0x2015('0x47')]['sort']);_0x3816b7[_0x2015('0x4f')]=qs[_0x2015('0x51')](_[_0x2015('0x50')](_0x2e4649[_0x2015('0x47')],_0x1aec98[_0x2015('0x51')]));if(_0x2e4649['query'][_0x2015('0x67')]){_0x3816b7[_0x2015('0x4f')]=_['merge'](_0x3816b7[_0x2015('0x4f')],{'$or':_['map'](_0x3816b7['attributes'],function(_0x1e855b){var _0x5695f3={};_0x5695f3[_0x1e855b]={'$like':'%'+_0x2e4649['query']['filter']+'%'};return _0x5695f3;})});}_0x3816b7=_[_0x2015('0x52')]({},_0x3816b7,_0x2e4649[_0x2015('0x53')]);return _0x2e7bc8['getApplications'](_0x3816b7);}})['then'](function(_0xd461c4){if(_0xd461c4){_0x1b78cc=_0xd461c4[_0x2015('0x4c')];if(!_0x2e4649[_0x2015('0x47')][_0x2015('0x4d')]('nolimit')){_0x3816b7[_0x2015('0x30')]=qs[_0x2015('0x30')](_0x2e4649['query'][_0x2015('0x30')]);_0x3816b7[_0x2015('0x2e')]=qs['offset'](_0x2e4649[_0x2015('0x47')]['offset']);}return _0x2e7bc8['getApplications'](_0x3816b7);}})[_0x2015('0x21')](function(_0x5a44f0){if(_0x5a44f0){return _0x5a44f0?{'count':_0x1b78cc,'rows':_0x5a44f0}:null;}})[_0x2015('0x21')](respondWithResult(_0x5ed5aa,null))['catch'](handleError(_0x5ed5aa,null));};exports[_0x2015('0x99')]=function(_0x2ce5d7,_0x29e7d2,_0x35a4bc){var _0x1f5f22={'raw':!![],'where':{}};var _0x1734dd={};var _0x4bc903={'count':0x0,'rows':[]};return db[_0x2015('0x43')][_0x2015('0x63')]({'where':{'id':_0x2ce5d7[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x29e7d2,null))[_0x2015('0x21')](function(_0x42b4d1){if(_0x42b4d1){_0x1734dd['model']=_['keys'](db[_0x2015('0x9a')][_0x2015('0x64')]);_0x1734dd[_0x2015('0x47')]=_['keys'](_0x2ce5d7[_0x2015('0x47')]);_0x1734dd[_0x2015('0x51')]=_['intersection'](_0x1734dd[_0x2015('0x49')],_0x1734dd[_0x2015('0x47')]);_0x1f5f22[_0x2015('0x4a')]=_['intersection'](_0x1734dd[_0x2015('0x49')],qs[_0x2015('0x4b')](_0x2ce5d7[_0x2015('0x47')][_0x2015('0x4b')]));_0x1f5f22[_0x2015('0x4a')]=_0x1f5f22[_0x2015('0x4a')][_0x2015('0x4c')]?_0x1f5f22[_0x2015('0x4a')]:_0x1734dd[_0x2015('0x49')];if(!_0x2ce5d7[_0x2015('0x47')][_0x2015('0x4d')](_0x2015('0x65'))){_0x1f5f22[_0x2015('0x30')]=qs[_0x2015('0x30')](_0x2ce5d7[_0x2015('0x47')]['limit']);_0x1f5f22[_0x2015('0x2e')]=qs[_0x2015('0x2e')](_0x2ce5d7[_0x2015('0x47')][_0x2015('0x2e')]);}_0x1f5f22[_0x2015('0x66')]=qs[_0x2015('0x4e')](_0x2ce5d7[_0x2015('0x47')][_0x2015('0x4e')]);_0x1f5f22[_0x2015('0x4f')]=qs[_0x2015('0x51')](_[_0x2015('0x50')](_0x2ce5d7[_0x2015('0x47')],_0x1734dd['filters']));_0x1f5f22[_0x2015('0x4f')][_0x2015('0x60')]=_0x42b4d1['id'];if(_0x2ce5d7['query'][_0x2015('0x67')]){_0x1f5f22[_0x2015('0x4f')]=_[_0x2015('0x52')](_0x1f5f22[_0x2015('0x4f')],{'$or':_[_0x2015('0x42')](_0x1f5f22[_0x2015('0x4a')],function(_0x3659aa){var _0x3b75c9={};_0x3b75c9[_0x3659aa]={'$like':'%'+_0x2ce5d7[_0x2015('0x47')][_0x2015('0x67')]+'%'};return _0x3b75c9;})});}if(_0x2ce5d7[_0x2015('0x47')][_0x2015('0x9b')]){var _0x22ac7d=_0x2ce5d7[_0x2015('0x47')][_0x2015('0x9b')]['split'](',');var _0x16af1c={};_0x16af1c[_0x22ac7d[0x0]]={'$gte':moment(_0x22ac7d[0x1])[_0x2015('0x9c')](_0x2015('0x9d'))};_0x1f5f22['where']=_[_0x2015('0x52')](_0x1f5f22[_0x2015('0x4f')],_0x16af1c);}_0x1f5f22=_[_0x2015('0x52')]({},_0x1f5f22,_0x2ce5d7[_0x2015('0x53')]);return db[_0x2015('0x9a')][_0x2015('0x31')]({'where':_0x1f5f22['where']})['then'](function(_0x3448ea){_0x4bc903[_0x2015('0x31')]=_0x3448ea;if(_0x2ce5d7[_0x2015('0x47')]['includeAll']){_0x1f5f22[_0x2015('0x55')]=[{'all':!![]}];}return db[_0x2015('0x9a')][_0x2015('0x68')](_0x1f5f22);})['then'](function(_0x54ba73){if(_0x2ce5d7[_0x2015('0x47')][_0x2015('0x9e')]===_0x2015('0x9f')){for(var _0x875d07=0x0;_0x875d07<_0x54ba73[_0x2015('0x4c')];_0x875d07++){_0x54ba73[_0x875d07]['body']=juice(_0x54ba73[_0x875d07]['body']);}}_0x4bc903[_0x2015('0x56')]=_0x54ba73;return _0x4bc903;});}})['then'](respondWithFilteredResult(_0x29e7d2,_0x1f5f22))['catch'](handleError(_0x29e7d2,null));};exports['send']=function(_0x26773c,_0x4bf014,_0x485c91){var _0x94c076,_0x41cc02={},_0x1add9b;if(_0x26773c[_0x2015('0x5c')]['to']){_0x1add9b=_0x26773c['body']['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x26773c[_0x2015('0x5d')]['id']},'include':[{'model':db[_0x2015('0xa0')],'as':_0x2015('0xa1'),'include':[{'model':db[_0x2015('0xa2')],'as':'Contacts','where':{'email':_0x1add9b},'limit':0x1,'order':[['updatedAt',_0x2015('0xa3')]]}]},{'model':db[_0x2015('0x40')],'as':_0x2015('0x58'),'raw':!![]}]})['then'](handleEntityNotFound(_0x4bf014,null))[_0x2015('0x21')](function(_0x2117db){if(_0x2117db){_0x94c076=_0x2117db;if(_0x2117db[_0x2015('0x58')]){if(_[_0x2015('0xa4')](_0x26773c[_0x2015('0x5c')][_0x2015('0xa5')])){_0x26773c[_0x2015('0x5c')][_0x2015('0xa5')]=util[_0x2015('0x9c')](_0x2015('0xa6'),_0x2117db[_0x2015('0x3c')],_0x2117db[_0x2015('0x6e')]||_0x2117db[_0x2015('0x58')][_0x2015('0x73')]);}if(_0x26773c[_0x2015('0x5c')]['attachments']&&_0x26773c[_0x2015('0x5c')][_0x2015('0xa7')][_0x2015('0x4c')]){for(var _0x173650=0x0;_0x173650<_0x26773c['body'][_0x2015('0xa7')]['length'];_0x173650+=0x1){_0x26773c[_0x2015('0x5c')][_0x2015('0xa7')][_0x173650]={'filename':_0x26773c[_0x2015('0x5c')][_0x2015('0xa7')][_0x173650][_0x2015('0x3c')],'path':path[_0x2015('0xa8')](config[_0x2015('0xa9')],_0x2015('0xaa'),_0x26773c[_0x2015('0x5c')][_0x2015('0xa7')][_0x173650]['basename'])};}}var _0xbafb28={'tls':{'rejectUnauthorized':![]}};if(_[_0x2015('0xa4')](_0x2117db[_0x2015('0x58')][_0x2015('0x7a')])){if(_0x2117db[_0x2015('0x58')]['authentication']){_0xbafb28[_0x2015('0xab')]={'user':_0x2117db[_0x2015('0x58')][_0x2015('0x73')],'pass':_0x2117db[_0x2015('0x58')][_0x2015('0x76')]};}_0xbafb28[_0x2015('0x78')]=_0x2117db[_0x2015('0x58')][_0x2015('0x78')];_0xbafb28[_0x2015('0x79')]=_0x2117db[_0x2015('0x58')][_0x2015('0x79')];_0xbafb28[_0x2015('0xac')]=_0x2117db[_0x2015('0x58')]['secure'];}else{_0xbafb28[_0x2015('0x7a')]=_0x2117db[_0x2015('0x58')]['service'];_0xbafb28['auth']={'user':_0x2117db[_0x2015('0x58')][_0x2015('0x73')],'pass':_0x2117db[_0x2015('0x58')]['pass']};}return respondWithRpcPromise('SendMail',_0x2015('0xad'),{'account':_0xbafb28,'message':_0x26773c[_0x2015('0x5c')]});}else{throw new Error('List\x20not\x20found');}}})[_0x2015('0x21')](function(_0x366dc4){if(_0x366dc4){_0x41cc02=_0x366dc4;if(_0x94c076[_0x2015('0xa1')]){if(_0x94c076[_0x2015('0xa1')][_0x2015('0xae')]['length']){return _0x94c076[_0x2015('0xa1')]['Contacts'][0x0];}else{return db[_0x2015('0xa2')]['create'](_[_0x2015('0x1a')](_0x26773c['body'],{'firstName':_0x26773c[_0x2015('0x5c')]['to'],'email':_0x26773c[_0x2015('0x5c')]['to'],'phone':_0x26773c[_0x2015('0x5c')]['to'],'ListId':_0x94c076[_0x2015('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x2015('0x21')](function(_0x49a5ef){if(_0x49a5ef){var _0x5120dd={'UserId':_0x26773c[_0x2015('0x73')]['id'],'ContactId':_0x49a5ef['id'],'MailAccountId':_0x94c076['id'],'inReplyTo':_0x41cc02[_0x2015('0xaf')],'to':_0x26773c[_0x2015('0x5c')]['from'],'cc':_0x26773c[_0x2015('0x5c')]['cc'],'subject':_0x26773c[_0x2015('0x5c')][_0x2015('0xb0')],'attach':_0x26773c[_0x2015('0x5c')][_0x2015('0xb1')],'firstMsgDirection':_0x2015('0xb2'),'lastMsgAt':moment()[_0x2015('0x9c')](_0x2015('0x9d')),'lastMsgDirection':_0x2015('0xb2'),'Messages':[_[_0x2015('0x52')](_0x26773c[_0x2015('0x5c')],{'messageId':_0x41cc02['messageId'],'sentAt':moment()[_0x2015('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x94c076['id'],'UserId':_0x26773c[_0x2015('0x73')]['id'],'ContactId':_0x49a5ef['id']})]};if(_0x26773c[_0x2015('0x5c')][_0x2015('0xb3')]){_0x5120dd=_[_0x2015('0x52')](_0x5120dd,_0x26773c['body'][_0x2015('0xb3')]);}return db[_0x2015('0x89')]['create'](_0x5120dd,{'include':[{'model':db[_0x2015('0x9a')],'as':_0x2015('0xb4')}]});}})[_0x2015('0x21')](respondWithResult(_0x4bf014,null))[_0x2015('0x2a')](handleError(_0x4bf014,null));};exports[_0x2015('0xb5')]=function(_0x2f2d86,_0x5a7899,_0x2fdfde){return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0x2f2d86[_0x2015('0x5d')]['id']},'include':[{'model':db[_0x2015('0x40')],'as':_0x2015('0x58'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5a7899,null))['then'](function(_0x3eea31){if(_0x3eea31&&_0x3eea31[_0x2015('0x58')]){var _0x45b033={'id':_0x3eea31['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3eea31[_0x2015('0x58')][_0x2015('0x7a')]){_0x45b033[_0x2015('0x7a')]=_0x3eea31[_0x2015('0x58')][_0x2015('0x7a')];}else{_0x45b033[_0x2015('0x78')]=_0x3eea31[_0x2015('0x58')][_0x2015('0x78')];_0x45b033[_0x2015('0x79')]=_0x3eea31['Smtp'][_0x2015('0x79')];_0x45b033[_0x2015('0xac')]=_0x3eea31[_0x2015('0x58')][_0x2015('0xac')];}if(_0x3eea31['Smtp']['authentication']){_0x45b033['auth']={'user':_0x3eea31[_0x2015('0x58')][_0x2015('0x73')],'pass':_0x3eea31[_0x2015('0x58')][_0x2015('0x76')]};}return respondWithRpcPromise(_0x2015('0xb6'),_0x2015('0xb5'),{'account':_0x45b033});}})[_0x2015('0x21')](respondWithResult(_0x5a7899,null))[_0x2015('0x2a')](handleError(_0x5a7899,null));};exports[_0x2015('0x37')]=function(_0x320f0c,_0x270d53){return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0x320f0c[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x270d53,null))[_0x2015('0x21')](function(_0xdb9d0d){if(_0xdb9d0d&&_0xdb9d0d[_0x2015('0x7a')]){throw new db[(_0x2015('0xb7'))]['ValidationError'](_0x2015('0xb8'));}return _0xdb9d0d;})[_0x2015('0x21')](removeEntity(_0x270d53,null))['catch'](handleError(_0x270d53,null));};exports[_0x2015('0xb9')]=function(_0x8bc0f7,_0x352104,_0x10a7a){return db['MailAccount'][_0x2015('0x5b')]({'where':{'id':_0x8bc0f7[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x352104,null))['then'](function(_0x1b1a3a){if(_0x1b1a3a){return _0x1b1a3a[_0x2015('0xb9')](_0x8bc0f7[_0x2015('0x5c')][_0x2015('0x6d')],_[_0x2015('0xba')](_0x8bc0f7[_0x2015('0x5c')],[_0x2015('0x6d'),'id'])||{})[_0x2015('0xbb')](function(_0x5bb231){for(var _0x2f5dd2=0x0;_0x2f5dd2<_0x8bc0f7[_0x2015('0x5c')][_0x2015('0x6d')]['length'];_0x2f5dd2+=0x1){socket[_0x2015('0xbc')](_0x2015('0xbd'),{'UserId':Number(_0x8bc0f7[_0x2015('0x5c')][_0x2015('0x6d')][_0x2f5dd2]),'MailAccountId':Number(_0x8bc0f7[_0x2015('0x5d')]['id'])});}return _0x5bb231;});}})[_0x2015('0x21')](respondWithResult(_0x352104,null))['catch'](handleError(_0x352104,null));};exports['removeAgents']=function(_0xdbdd42,_0x261580,_0x1d5308){return db[_0x2015('0x43')][_0x2015('0x5b')]({'where':{'id':_0xdbdd42['params']['id']}})[_0x2015('0x21')](handleEntityNotFound(_0x261580,null))[_0x2015('0x21')](function(_0x254658){if(_0x254658){return _0x254658['removeAgents'](_0xdbdd42[_0x2015('0x47')]['ids'])[_0x2015('0x21')](function(){if(_[_0x2015('0xbe')](_0xdbdd42[_0x2015('0x47')][_0x2015('0x6d')])){for(var _0x4b9947=0x0;_0x4b9947<_0xdbdd42[_0x2015('0x47')][_0x2015('0x6d')][_0x2015('0x4c')];_0x4b9947+=0x1){socket['emit'](_0x2015('0xbf'),{'UserId':Number(_0xdbdd42[_0x2015('0x47')][_0x2015('0x6d')][_0x4b9947]),'MailAccountId':Number(_0xdbdd42[_0x2015('0x5d')]['id'])});}}else{socket[_0x2015('0xbc')](_0x2015('0xbf'),{'UserId':Number(_0xdbdd42['query']['ids']),'MailAccountId':Number(_0xdbdd42[_0x2015('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x261580,null))['catch'](handleError(_0x261580,null));};exports[_0x2015('0xc0')]=function(_0x4a6d85,_0xdb1296,_0x2d61f5){var _0x43fc0e={};var _0x8693c3={};var _0x1718b7;var _0x4e5426;return db[_0x2015('0x43')]['findOne']({'where':{'id':_0x4a6d85[_0x2015('0x5d')]['id']}})[_0x2015('0x21')](handleEntityNotFound(_0xdb1296,null))['then'](function(_0x28437c){if(_0x28437c){_0x1718b7=_0x28437c;_0x8693c3[_0x2015('0x49')]=_[_0x2015('0x5a')](db['User']['rawAttributes']);_0x8693c3['query']=_['keys'](_0x4a6d85[_0x2015('0x47')]);_0x8693c3[_0x2015('0x51')]=_[_0x2015('0x48')](_0x8693c3[_0x2015('0x49')],_0x8693c3[_0x2015('0x47')]);_0x43fc0e[_0x2015('0x4a')]=_['intersection'](_0x8693c3[_0x2015('0x49')],qs[_0x2015('0x4b')](_0x4a6d85[_0x2015('0x47')]['fields']));_0x43fc0e[_0x2015('0x4a')]=_0x43fc0e[_0x2015('0x4a')]['length']?_0x43fc0e[_0x2015('0x4a')]:_0x8693c3[_0x2015('0x49')];_0x43fc0e[_0x2015('0x66')]=qs[_0x2015('0x4e')](_0x4a6d85[_0x2015('0x47')]['sort']);_0x43fc0e['where']=qs[_0x2015('0x51')](_[_0x2015('0x50')](_0x4a6d85['query'],_0x8693c3[_0x2015('0x51')]));if(_0x4a6d85[_0x2015('0x47')][_0x2015('0x67')]){_0x43fc0e[_0x2015('0x4f')]=_[_0x2015('0x52')](_0x43fc0e[_0x2015('0x4f')],{'$or':_[_0x2015('0x42')](_0x43fc0e[_0x2015('0x4a')],function(_0x27fda1){var _0x2387bf={};_0x2387bf[_0x27fda1]={'$like':'%'+_0x4a6d85[_0x2015('0x47')][_0x2015('0x67')]+'%'};return _0x2387bf;})});}_0x43fc0e=_[_0x2015('0x52')]({},_0x43fc0e,_0x4a6d85[_0x2015('0x53')]);return _0x1718b7[_0x2015('0xc0')](_0x43fc0e);}})['then'](function(_0x28c1c4){if(_0x28c1c4){_0x4e5426=_0x28c1c4[_0x2015('0x4c')];if(!_0x4a6d85[_0x2015('0x47')][_0x2015('0x4d')](_0x2015('0x65'))){_0x43fc0e[_0x2015('0x30')]=qs['limit'](_0x4a6d85[_0x2015('0x47')][_0x2015('0x30')]);_0x43fc0e[_0x2015('0x2e')]=qs[_0x2015('0x2e')](_0x4a6d85['query']['offset']);}return _0x1718b7[_0x2015('0xc0')](_0x43fc0e);}})[_0x2015('0x21')](function(_0x507292){if(_0x507292){return _0x507292?{'count':_0x4e5426,'rows':_0x507292}:null;}})[_0x2015('0x21')](respondWithResult(_0xdb1296,null))['catch'](handleError(_0xdb1296,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9bedb7b..8ea1656 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 _0x43a2=['setMaxListeners','update','emit','../../mysqldb','MailAccount'];(function(_0x52660e,_0x4bae6b){var _0x2fd1a3=function(_0x2caaaf){while(--_0x2caaaf){_0x52660e['push'](_0x52660e['shift']());}};_0x2fd1a3(++_0x4bae6b);}(_0x43a2,0xd0));var _0x243a=function(_0x35f62e,_0x4967b0){_0x35f62e=_0x35f62e-0x0;var _0x190fe0=_0x43a2[_0x35f62e];return _0x190fe0;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x243a('0x0'))['db'][_0x243a('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x243a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x243a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37dba9){return function(_0x29fb13,_0x3da3b5,_0xff53f9){MailAccountEvents['emit'](_0x37dba9+':'+_0x29fb13['id'],_0x29fb13);MailAccountEvents[_0x243a('0x4')](_0x37dba9,_0x29fb13);_0xff53f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xe1d7=['update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2825c5,_0x45a6d2){var _0x38017b=function(_0x4bb787){while(--_0x4bb787){_0x2825c5['push'](_0x2825c5['shift']());}};_0x38017b(++_0x45a6d2);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x189b1d,_0x1df005){_0x189b1d=_0x189b1d-0x0;var _0x3d8ab0=_0xe1d7[_0x189b1d];return _0x3d8ab0;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x7e1d('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e1d('0x1'),'afterDestroy':_0x7e1d('0x2')};function emitEvent(_0x416747){return function(_0x57e913,_0x347f78,_0x882bec){MailAccountEvents[_0x7e1d('0x3')](_0x416747+':'+_0x57e913['id'],_0x57e913);MailAccountEvents[_0x7e1d('0x3')](_0x416747,_0x57e913);_0x882bec(null);};}for(var e in events){if(events[_0x7e1d('0x4')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x7e1d('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index bf49972..09f0c42 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 _0x4d94=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4d94,0x144));var _0x44d9=function(_0x3d74c6,_0x1476fc){_0x3d74c6=_0x3d74c6-0x0;var _0x58c199=_0x4d94[_0x3d74c6];return _0x58c199;};'use strict';var _=require(_0x44d9('0x0'));var util=require(_0x44d9('0x1'));var logger=require('../../config/logger')(_0x44d9('0x2'));var moment=require(_0x44d9('0x3'));var BPromise=require(_0x44d9('0x4'));var rp=require(_0x44d9('0x5'));var fs=require('fs');var path=require(_0x44d9('0x6'));var rimraf=require('rimraf');var config=require(_0x44d9('0x7'));var attributes=require(_0x44d9('0x8'));module[_0x44d9('0x9')]=function(_0x39a103,_0x2175c0){return _0x39a103['define'](_0x44d9('0xa'),attributes,{'tableName':_0x44d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa602=['MailAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa602,0x187));var _0x2a60=function(_0x380809,_0x23ae79){_0x380809=_0x380809-0x0;var _0x288795=_0xa602[_0x380809];return _0x288795;};'use strict';var _=require(_0x2a60('0x0'));var util=require('util');var logger=require(_0x2a60('0x1'))('api');var moment=require(_0x2a60('0x2'));var BPromise=require(_0x2a60('0x3'));var rp=require(_0x2a60('0x4'));var fs=require('fs');var path=require(_0x2a60('0x5'));var rimraf=require(_0x2a60('0x6'));var config=require(_0x2a60('0x7'));var attributes=require('./mailAccount.attributes');module[_0x2a60('0x8')]=function(_0x182c27,_0x3a36b8){return _0x182c27['define'](_0x2a60('0x9'),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 3daafbd..b54308f 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 _0x5e11=['rawAttributes','updatedAt','CompanyId','ListId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','MailAccount','find','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','get','account','omit','Applications','applications','list','orderBy','priority','push','length','autoclose','*,*,*,*','defaults','List\x20not\x20found','contact','messageId','generate','subject','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailAccount','findAll','options','raw','where','attributes','limit','include','model','catch','ShowMailAccount','map','stringify','NotifyMailAccount','body','keys','CmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e11,0x1f3));var _0x15e1=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x5e11[_0xea35d1];return _0x1d7a7c;};'use strict';var _=require(_0x15e1('0x0'));var util=require(_0x15e1('0x1'));var moment=require(_0x15e1('0x2'));var BPromise=require(_0x15e1('0x3'));var rs=require(_0x15e1('0x4'));var fs=require('fs');var Redis=require(_0x15e1('0x5'));var db=require(_0x15e1('0x6'))['db'];var utils=require(_0x15e1('0x7'));var logger=require(_0x15e1('0x8'))(_0x15e1('0x9'));var config=require(_0x15e1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x15e1('0xb')][_0x15e1('0xc')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0x15e1('0xd'),'port':0x18eb});var socket=require(_0x15e1('0xe'))(new Redis(config[_0x15e1('0xf')]));require(_0x15e1('0x10'))[_0x15e1('0x11')](socket);function respondWithRpcPromise(_0x3dbc43,_0x543dad,_0x3c9680){return new BPromise(function(_0x5de1a4,_0x2dbc84){return client[_0x15e1('0x12')](_0x3dbc43,_0x3c9680)[_0x15e1('0x13')](function(_0x52b72a){logger[_0x15e1('0x14')](_0x15e1('0x15'),_0x543dad,_0x15e1('0x16'));logger[_0x15e1('0x17')](_0x15e1('0x18'),_0x543dad,_0x15e1('0x16'),JSON['stringify'](_0x52b72a));if(_0x52b72a['error']){if(_0x52b72a[_0x15e1('0x19')][_0x15e1('0x1a')]===0x1f4){logger[_0x15e1('0x19')](_0x15e1('0x15'),_0x543dad,_0x52b72a[_0x15e1('0x19')]['message']);return _0x2dbc84(_0x52b72a[_0x15e1('0x19')][_0x15e1('0x1b')]);}logger['error'](_0x15e1('0x15'),_0x543dad,_0x52b72a[_0x15e1('0x19')]['message']);return _0x5de1a4(_0x52b72a['error'][_0x15e1('0x1b')]);}else{logger[_0x15e1('0x14')](_0x15e1('0x15'),_0x543dad,_0x15e1('0x16'));_0x5de1a4(_0x52b72a[_0x15e1('0x1c')][_0x15e1('0x1b')]);}})['catch'](function(_0x4750b5){logger['error'](_0x15e1('0x15'),_0x543dad,_0x4750b5);_0x2dbc84(_0x4750b5);});});}exports[_0x15e1('0x1d')]=function(_0x4c697f){var _0x5795e9=this;return new Promise(function(_0x3c6d36,_0x4f0221){return db['MailAccount'][_0x15e1('0x1e')]({'raw':_0x4c697f[_0x15e1('0x1f')]?_0x4c697f['options'][_0x15e1('0x20')]===undefined?!![]:![]:!![],'where':_0x4c697f[_0x15e1('0x1f')]?_0x4c697f[_0x15e1('0x1f')][_0x15e1('0x21')]||null:null,'attributes':_0x4c697f[_0x15e1('0x1f')]?_0x4c697f[_0x15e1('0x1f')][_0x15e1('0x22')]||null:null,'limit':_0x4c697f[_0x15e1('0x1f')]?_0x4c697f[_0x15e1('0x1f')][_0x15e1('0x23')]||null:null,'include':_0x4c697f['options']?_0x4c697f[_0x15e1('0x1f')][_0x15e1('0x24')]?_['map'](_0x4c697f['options'][_0x15e1('0x24')],function(_0x3e2ab9){return{'model':db[_0x3e2ab9['model']],'as':_0x3e2ab9['as'],'attributes':_0x3e2ab9[_0x15e1('0x22')],'include':_0x3e2ab9[_0x15e1('0x24')]?_['map'](_0x3e2ab9[_0x15e1('0x24')],function(_0x510ea3){return{'model':db[_0x510ea3[_0x15e1('0x25')]],'as':_0x510ea3['as'],'attributes':_0x510ea3[_0x15e1('0x22')],'include':_0x510ea3[_0x15e1('0x24')]?_['map'](_0x510ea3['include'],function(_0xcfc910){return{'model':db[_0xcfc910[_0x15e1('0x25')]],'as':_0xcfc910['as'],'attributes':_0xcfc910['attributes']};}):[]};}):[]};}):[]:[]})[_0x15e1('0x13')](function(_0x16e0b2){logger['info']('GetMailAccount',_0x4c697f);logger[_0x15e1('0x17')]('GetMailAccount',_0x4c697f,JSON['stringify'](_0x16e0b2));_0x3c6d36(_0x16e0b2);})[_0x15e1('0x26')](function(_0x41a97d){logger[_0x15e1('0x19')]('GetMailAccount',_0x41a97d[_0x15e1('0x1b')],_0x4c697f);_0x4f0221(_0x5795e9['error'](0x1f4,_0x41a97d[_0x15e1('0x1b')]));});});};exports[_0x15e1('0x27')]=function(_0x47be42){var _0x344ced=this;return new Promise(function(_0x5dc47f,_0x49fa8a){return db['MailAccount']['find']({'raw':_0x47be42[_0x15e1('0x1f')]?_0x47be42['options']['raw']===undefined?!![]:![]:!![],'where':_0x47be42[_0x15e1('0x1f')]?_0x47be42[_0x15e1('0x1f')][_0x15e1('0x21')]||null:null,'attributes':_0x47be42[_0x15e1('0x1f')]?_0x47be42['options'][_0x15e1('0x22')]||null:null,'include':_0x47be42[_0x15e1('0x1f')]?_0x47be42[_0x15e1('0x1f')][_0x15e1('0x24')]?_[_0x15e1('0x28')](_0x47be42[_0x15e1('0x1f')][_0x15e1('0x24')],function(_0x524c93){return{'model':db[_0x524c93[_0x15e1('0x25')]],'as':_0x524c93['as'],'attributes':_0x524c93[_0x15e1('0x22')],'include':_0x524c93[_0x15e1('0x24')]?_[_0x15e1('0x28')](_0x524c93['include'],function(_0x24d5aa){return{'model':db[_0x24d5aa['model']],'as':_0x24d5aa['as'],'attributes':_0x24d5aa[_0x15e1('0x22')],'include':_0x24d5aa['include']?_[_0x15e1('0x28')](_0x24d5aa[_0x15e1('0x24')],function(_0x43cff8){return{'model':db[_0x43cff8[_0x15e1('0x25')]],'as':_0x43cff8['as'],'attributes':_0x43cff8['attributes']};}):[]};}):[]};}):[]:[]})[_0x15e1('0x13')](function(_0x4fad1d){logger[_0x15e1('0x14')](_0x15e1('0x27'),_0x47be42);logger[_0x15e1('0x17')](_0x15e1('0x27'),_0x47be42,JSON[_0x15e1('0x29')](_0x4fad1d));_0x5dc47f(_0x4fad1d);})[_0x15e1('0x26')](function(_0x4b5a38){logger['error']('ShowMailAccount',_0x4b5a38[_0x15e1('0x1b')],_0x47be42);_0x49fa8a(_0x344ced['error'](0x1f4,_0x4b5a38['message']));});});};exports[_0x15e1('0x2a')]=function(_0xc1cb70){var _0x1a039f=this;return new Promise(function(_0x459938,_0x4e8a23){var _0x2e76d0={'body':_0xc1cb70[_0x15e1('0x2b')],'channel':'mail'};var _0x3d3778=_['difference'](_[_0x15e1('0x2c')](db[_0x15e1('0x2d')][_0x15e1('0x2e')]),['createdAt',_0x15e1('0x2f'),_0x15e1('0x30'),_0x15e1('0x31')]);var _0x926e96=![];if(_0xc1cb70[_0x15e1('0x2b')]['id']){delete _0xc1cb70[_0x15e1('0x2b')]['id'];}if(_[_0x15e1('0x32')](_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x33')])){return _0x4e8a23(_0x1a039f[_0x15e1('0x19')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x15e1('0x32')](_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x2b')])||_0xc1cb70['body'][_0x15e1('0x2b')]===''){return _0x4e8a23(_0x1a039f[_0x15e1('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x15e1('0x32')](_0xc1cb70[_0x15e1('0x2b')]['mapKey'])){return _0x4e8a23(_0x1a039f['error'](0x1f4,_0x15e1('0x34')+_0x3d3778));}if(!_[_0x15e1('0x35')](_0x3d3778,_0xc1cb70[_0x15e1('0x2b')]['mapKey'])){return _0x4e8a23(_0x1a039f[_0x15e1('0x19')](0x1f4,_0x15e1('0x36')+_0x3d3778));}var _0x4cd4e5={};_0x4cd4e5[_0xc1cb70['body'][_0x15e1('0x37')]]=_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x33')];return db[_0x15e1('0x38')][_0x15e1('0x39')]({'where':{'id':_0xc1cb70['account']['id']},'include':[{'model':db[_0x15e1('0x3a')],'as':_0x15e1('0x3b'),'include':[{'model':db[_0x15e1('0x2d')],'as':_0x15e1('0x3c'),'where':_0x4cd4e5,'limit':0x1,'order':[[_0x15e1('0x2f'),_0x15e1('0x3d')]]}]},{'model':db[_0x15e1('0x3e')],'as':'Applications'},{'model':db[_0x15e1('0x3f')],'as':_0x15e1('0x40')}]})['then'](function(_0x366dcd){if(_0x366dcd&&_0x366dcd['List']){var _0x399153=_0x366dcd[_0x15e1('0x41')]({'plain':!![]});_0x2e76d0[_0x15e1('0x42')]=_[_0x15e1('0x43')](_0x399153,[_0x15e1('0x44'),_0x15e1('0x3b')]);_0x2e76d0[_0x15e1('0x45')]=_0x399153[_0x15e1('0x44')];_0x2e76d0[_0x15e1('0x46')]=_0x399153[_0x15e1('0x3b')];_0x2e76d0[_0x15e1('0x45')]=_[_0x15e1('0x47')](_0x2e76d0[_0x15e1('0x45')],[_0x15e1('0x48')],['asc']);if(_0x2e76d0['account']&&_0x2e76d0[_0x15e1('0x42')]['autoclose']){_0x2e76d0[_0x15e1('0x45')][_0x15e1('0x49')]({'id':0x0,'priority':_0x2e76d0[_0x15e1('0x45')][_0x15e1('0x4a')]+0x1,'app':'close','appdata':_0x15e1('0x4b'),'interval':_0x15e1('0x4c')});}if(_0x2e76d0[_0x15e1('0x42')][_0x15e1('0x44')]){delete _0x2e76d0[_0x15e1('0x42')][_0x15e1('0x44')];}if(_0x2e76d0[_0x15e1('0x42')][_0x15e1('0x3b')]){delete _0x2e76d0[_0x15e1('0x42')]['List'];}if(_0x399153[_0x15e1('0x3b')][_0x15e1('0x3c')][_0x15e1('0x4a')]){return _0x399153[_0x15e1('0x3b')][_0x15e1('0x3c')][0x0];}var _0x1d0b6d=_[_0x15e1('0x4d')](_0xc1cb70[_0x15e1('0x2b')],{'firstName':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x33')],'ListId':_0x399153[_0x15e1('0x31')]});_0x1d0b6d[_0xc1cb70['body']['mapKey']]=_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x33')];return db[_0x15e1('0x2d')]['create'](_0x1d0b6d);}else{throw new Error(_0x15e1('0x4e'));}})[_0x15e1('0x13')](function(_0x2e52c6){_0x2e76d0[_0x15e1('0x4f')]=_0x2e52c6;if(_0x2e52c6){if(!_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x50')]){_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x50')]=rs[_0x15e1('0x51')]()+'\x20'+_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x33')];}var _0x3790b8={'ContactId':_0x2e52c6['id'],'MailAccountId':_0xc1cb70[_0x15e1('0x42')]['id'],'inReplyTo':_0xc1cb70['body']['message'][_0x15e1('0x50')],'to':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x33')],'cc':_0xc1cb70[_0x15e1('0x2b')]['message']['cc'],'subject':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x52')],'attach':_0xc1cb70['body'][_0x15e1('0x1b')]['attach'],'lastMsgAt':moment()[_0x15e1('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x15e1('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0xc1cb70[_0x15e1('0x42')]['id']},'include':[{'model':db[_0x15e1('0x55')],'as':_0x15e1('0x56'),'attributes':[_0x15e1('0x50')],'where':{'messageId':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x57')]}}]})['then'](function(_0x5d33b2){if(_0x5d33b2){return[_0x5d33b2,![]];}return db['MailInteraction'][_0x15e1('0x58')](_0x3790b8)[_0x15e1('0x13')](function(_0xcfd483){return[_0xcfd483,!![]];});});}else{throw new Error(_0x15e1('0x59'));}})[_0x15e1('0x5a')](function(_0x10d070,_0x4a31e7){if(_0x10d070){_0x926e96=_0x4a31e7;if(!_0x4a31e7){return _0x10d070[_0x15e1('0x5b')]({'inReplyTo':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')]['messageId'],'to':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x33')],'cc':_0xc1cb70['body'][_0x15e1('0x1b')]['cc'],'subject':_0xc1cb70[_0x15e1('0x2b')]['message'][_0x15e1('0x52')],'attach':_0x10d070[_0x15e1('0x5c')]?_0x10d070[_0x15e1('0x5c')]:_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x5c')],'substatus':null,'substatusAt':moment()['format'](_0x15e1('0x5d')),'lastMsgAt':moment()['format'](_0x15e1('0x5d')),'lastMsgDirection':'in'});}else{return _0x10d070;}}})[_0x15e1('0x13')](function(_0x2761d8){_0x2e76d0[_0x15e1('0x5e')]=_0x2761d8[_0x15e1('0x41')]({'plain':!![]});_0x2e76d0[_0x15e1('0x5e')]['created']=_0x926e96;return db[_0x15e1('0x55')][_0x15e1('0x58')]({'body':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x2b')],'MailAccountId':_0xc1cb70[_0x15e1('0x42')]['id'],'MailInteractionId':_0x2761d8['id'],'direction':'in','ContactId':_0x2e76d0[_0x15e1('0x4f')]['id'],'messageId':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x50')],'from':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x33')],'to':_0xc1cb70[_0x15e1('0x2b')]['message']['to'],'cc':_0xc1cb70[_0x15e1('0x2b')]['message']['cc'],'subject':_0xc1cb70[_0x15e1('0x2b')]['message'][_0x15e1('0x52')],'attach':_0xc1cb70['body'][_0x15e1('0x1b')]['attach'],'Attachments':_0xc1cb70['body'][_0x15e1('0x1b')]['attachments'],'originTo':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x5f')],'originCc':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x60')],'bcc':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x61')],'ChatWebsiteId':_0xc1cb70[_0x15e1('0x2b')]['message']['ChatWebsiteId']||null,'originChannel':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x62')]||_0x15e1('0x63'),'ChatOfflineMessageId':_0xc1cb70[_0x15e1('0x2b')][_0x15e1('0x1b')][_0x15e1('0x64')]||null},{'include':[{'model':db['Attachment'],'as':_0x15e1('0x65')}]});})[_0x15e1('0x13')](function(_0x967c){_0x2e76d0['message']=_0x967c;if(_0x2e76d0[_0x15e1('0x5e')][_0x15e1('0x66')]){return db[_0x15e1('0x67')][_0x15e1('0x39')]({'attributes':['id',_0x15e1('0x68')],'where':{'id':_0x2e76d0[_0x15e1('0x5e')]['UserId']}})[_0x15e1('0x13')](function(_0x16cf44){if(_0x16cf44){_0x2e76d0[_0x15e1('0x45')][_0x15e1('0x69')]({'id':0x0,'priority':0x0,'app':_0x15e1('0x6a'),'appdata':_0x16cf44[_0x15e1('0x68')]+','+(_0x2e76d0[_0x15e1('0x42')]['waitForTheAssignedAgent']||0xa),'interval':_0x15e1('0x4c')});}return respondWithRpcPromise(_0x15e1('0x6b'),_0x15e1('0x6c'),_0x2e76d0);});}return respondWithRpcPromise(_0x15e1('0x6b'),_0x15e1('0x6c'),_0x2e76d0);})[_0x15e1('0x13')](function(_0x340b4f){_0x459938(_0x340b4f);})[_0x15e1('0x26')](function(_0x5a8f9a){_0x4e8a23(_0x1a039f['error'](0x1f4,_0x5a8f9a[_0x15e1('0x1b')]));});});}; \ No newline at end of file +var _0x62fe=['../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','GetMailAccount','debug','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','Applications','MailServerOut','Smtp','then','List','get','applications','list','orderBy','priority','asc','autoclose','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','interaction','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','../../config/utils'];(function(_0x3df0d2,_0x20c97b){var _0x1f1f79=function(_0x5671d8){while(--_0x5671d8){_0x3df0d2['push'](_0x3df0d2['shift']());}};_0x1f1f79(++_0x20c97b);}(_0x62fe,0x1a7));var _0xe62f=function(_0x54b16d,_0x290f88){_0x54b16d=_0x54b16d-0x0;var _0x5c7f41=_0x62fe[_0x54b16d];return _0x5c7f41;};'use strict';var _=require(_0xe62f('0x0'));var util=require(_0xe62f('0x1'));var moment=require(_0xe62f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe62f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe62f('0x4'));var logger=require(_0xe62f('0x5'))(_0xe62f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe62f('0x7'));var client=jayson[_0xe62f('0x8')][_0xe62f('0x9')]({'port':0x232c});config['redis']=_[_0xe62f('0xa')](config[_0xe62f('0xb')],{'host':_0xe62f('0xc'),'port':0x18eb});var socket=require(_0xe62f('0xd'))(new Redis(config[_0xe62f('0xb')]));require(_0xe62f('0xe'))[_0xe62f('0xf')](socket);function respondWithRpcPromise(_0x5ba20c,_0x463a87,_0x3963a6){return new BPromise(function(_0xba33eb,_0x54a012){return client[_0xe62f('0x10')](_0x5ba20c,_0x3963a6)['then'](function(_0x2a5781){logger['info'](_0xe62f('0x11'),_0x463a87,_0xe62f('0x12'));logger['debug'](_0xe62f('0x13'),_0x463a87,_0xe62f('0x12'),JSON[_0xe62f('0x14')](_0x2a5781));if(_0x2a5781[_0xe62f('0x15')]){if(_0x2a5781[_0xe62f('0x15')]['code']===0x1f4){logger[_0xe62f('0x15')](_0xe62f('0x11'),_0x463a87,_0x2a5781[_0xe62f('0x15')]['message']);return _0x54a012(_0x2a5781['error'][_0xe62f('0x16')]);}logger[_0xe62f('0x15')]('MailAccount,\x20%s,\x20%s',_0x463a87,_0x2a5781[_0xe62f('0x15')][_0xe62f('0x16')]);return _0xba33eb(_0x2a5781['error'][_0xe62f('0x16')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x463a87,_0xe62f('0x12'));_0xba33eb(_0x2a5781[_0xe62f('0x17')]['message']);}})[_0xe62f('0x18')](function(_0xf1e12b){logger['error'](_0xe62f('0x11'),_0x463a87,_0xf1e12b);_0x54a012(_0xf1e12b);});});}exports['GetMailAccount']=function(_0x1bd55d){var _0x192d3d=this;return new Promise(function(_0x99233a,_0x5e639a){return db[_0xe62f('0x19')][_0xe62f('0x1a')]({'raw':_0x1bd55d[_0xe62f('0x1b')]?_0x1bd55d[_0xe62f('0x1b')][_0xe62f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1bd55d[_0xe62f('0x1b')]?_0x1bd55d[_0xe62f('0x1b')][_0xe62f('0x1d')]||null:null,'attributes':_0x1bd55d[_0xe62f('0x1b')]?_0x1bd55d[_0xe62f('0x1b')][_0xe62f('0x1e')]||null:null,'limit':_0x1bd55d[_0xe62f('0x1b')]?_0x1bd55d[_0xe62f('0x1b')][_0xe62f('0x1f')]||null:null,'include':_0x1bd55d['options']?_0x1bd55d['options'][_0xe62f('0x20')]?_[_0xe62f('0x21')](_0x1bd55d[_0xe62f('0x1b')][_0xe62f('0x20')],function(_0x4bbd55){return{'model':db[_0x4bbd55['model']],'as':_0x4bbd55['as'],'attributes':_0x4bbd55[_0xe62f('0x1e')],'include':_0x4bbd55[_0xe62f('0x20')]?_[_0xe62f('0x21')](_0x4bbd55[_0xe62f('0x20')],function(_0x3c9e72){return{'model':db[_0x3c9e72[_0xe62f('0x22')]],'as':_0x3c9e72['as'],'attributes':_0x3c9e72[_0xe62f('0x1e')],'include':_0x3c9e72[_0xe62f('0x20')]?_[_0xe62f('0x21')](_0x3c9e72[_0xe62f('0x20')],function(_0x3fea9f){return{'model':db[_0x3fea9f[_0xe62f('0x22')]],'as':_0x3fea9f['as'],'attributes':_0x3fea9f[_0xe62f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d2608){logger[_0xe62f('0x23')](_0xe62f('0x24'),_0x1bd55d);logger[_0xe62f('0x25')]('GetMailAccount',_0x1bd55d,JSON[_0xe62f('0x14')](_0x4d2608));_0x99233a(_0x4d2608);})[_0xe62f('0x18')](function(_0x5fc41){logger[_0xe62f('0x15')](_0xe62f('0x24'),_0x5fc41[_0xe62f('0x16')],_0x1bd55d);_0x5e639a(_0x192d3d['error'](0x1f4,_0x5fc41[_0xe62f('0x16')]));});});};exports[_0xe62f('0x26')]=function(_0x2df428){var _0x5d5b16=this;return new Promise(function(_0x48a84c,_0x5460fb){return db[_0xe62f('0x19')][_0xe62f('0x27')]({'raw':_0x2df428[_0xe62f('0x1b')]?_0x2df428[_0xe62f('0x1b')][_0xe62f('0x1c')]===undefined?!![]:![]:!![],'where':_0x2df428['options']?_0x2df428[_0xe62f('0x1b')]['where']||null:null,'attributes':_0x2df428[_0xe62f('0x1b')]?_0x2df428[_0xe62f('0x1b')][_0xe62f('0x1e')]||null:null,'include':_0x2df428['options']?_0x2df428[_0xe62f('0x1b')][_0xe62f('0x20')]?_['map'](_0x2df428[_0xe62f('0x1b')][_0xe62f('0x20')],function(_0x5b66bb){return{'model':db[_0x5b66bb[_0xe62f('0x22')]],'as':_0x5b66bb['as'],'attributes':_0x5b66bb['attributes'],'include':_0x5b66bb[_0xe62f('0x20')]?_[_0xe62f('0x21')](_0x5b66bb[_0xe62f('0x20')],function(_0xb59999){return{'model':db[_0xb59999[_0xe62f('0x22')]],'as':_0xb59999['as'],'attributes':_0xb59999['attributes'],'include':_0xb59999[_0xe62f('0x20')]?_[_0xe62f('0x21')](_0xb59999[_0xe62f('0x20')],function(_0x1f6a19){return{'model':db[_0x1f6a19['model']],'as':_0x1f6a19['as'],'attributes':_0x1f6a19[_0xe62f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47a8a2){logger[_0xe62f('0x23')](_0xe62f('0x26'),_0x2df428);logger[_0xe62f('0x25')]('ShowMailAccount',_0x2df428,JSON['stringify'](_0x47a8a2));_0x48a84c(_0x47a8a2);})[_0xe62f('0x18')](function(_0xf41e4b){logger[_0xe62f('0x15')](_0xe62f('0x26'),_0xf41e4b[_0xe62f('0x16')],_0x2df428);_0x5460fb(_0x5d5b16[_0xe62f('0x15')](0x1f4,_0xf41e4b['message']));});});};exports[_0xe62f('0x28')]=function(_0x1e59d5){var _0x33155f=this;return new Promise(function(_0x4bc416,_0x4ef8a5){var _0x33ad38={'body':_0x1e59d5[_0xe62f('0x29')],'channel':_0xe62f('0x2a')};var _0x106820=_[_0xe62f('0x2b')](_['keys'](db[_0xe62f('0x2c')]['rawAttributes']),[_0xe62f('0x2d'),_0xe62f('0x2e'),_0xe62f('0x2f'),_0xe62f('0x30')]);var _0x11bb6b=![];if(_0x1e59d5[_0xe62f('0x29')]['id']){delete _0x1e59d5['body']['id'];}if(_[_0xe62f('0x31')](_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x32')])){return _0x4ef8a5(_0x33155f[_0xe62f('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe62f('0x31')](_0x1e59d5['body'][_0xe62f('0x29')])||_0x1e59d5[_0xe62f('0x29')]['body']===''){return _0x4ef8a5(_0x33155f[_0xe62f('0x15')](0x1f4,_0xe62f('0x33')));}if(_[_0xe62f('0x31')](_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x34')])){return _0x4ef8a5(_0x33155f[_0xe62f('0x15')](0x1f4,_0xe62f('0x35')+_0x106820));}if(!_[_0xe62f('0x36')](_0x106820,_0x1e59d5['body'][_0xe62f('0x34')])){return _0x4ef8a5(_0x33155f[_0xe62f('0x15')](0x1f4,_0xe62f('0x37')+_0x106820));}var _0x40f69d={};_0x40f69d[_0x1e59d5[_0xe62f('0x29')]['mapKey']]=_0x1e59d5['body'][_0xe62f('0x32')];return db[_0xe62f('0x19')][_0xe62f('0x27')]({'where':{'id':_0x1e59d5[_0xe62f('0x38')]['id']},'include':[{'model':db[_0xe62f('0x39')],'as':'List','include':[{'model':db[_0xe62f('0x2c')],'as':_0xe62f('0x3a'),'where':_0x40f69d,'limit':0x1,'order':[[_0xe62f('0x2e'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xe62f('0x3b')},{'model':db[_0xe62f('0x3c')],'as':_0xe62f('0x3d')}]})[_0xe62f('0x3e')](function(_0x2eca4c){if(_0x2eca4c&&_0x2eca4c[_0xe62f('0x3f')]){var _0x4ad281=_0x2eca4c[_0xe62f('0x40')]({'plain':!![]});_0x33ad38[_0xe62f('0x38')]=_['omit'](_0x4ad281,['Applications',_0xe62f('0x3f')]);_0x33ad38[_0xe62f('0x41')]=_0x4ad281['Applications'];_0x33ad38[_0xe62f('0x42')]=_0x4ad281['List'];_0x33ad38[_0xe62f('0x41')]=_[_0xe62f('0x43')](_0x33ad38[_0xe62f('0x41')],[_0xe62f('0x44')],[_0xe62f('0x45')]);if(_0x33ad38[_0xe62f('0x38')]&&_0x33ad38[_0xe62f('0x38')][_0xe62f('0x46')]){_0x33ad38['applications']['push']({'id':0x0,'priority':_0x33ad38[_0xe62f('0x41')][_0xe62f('0x47')]+0x1,'app':_0xe62f('0x48'),'appdata':'autoclose','interval':_0xe62f('0x49')});}if(_0x33ad38[_0xe62f('0x38')][_0xe62f('0x3b')]){delete _0x33ad38[_0xe62f('0x38')][_0xe62f('0x3b')];}if(_0x33ad38[_0xe62f('0x38')]['List']){delete _0x33ad38[_0xe62f('0x38')][_0xe62f('0x3f')];}if(_0x4ad281[_0xe62f('0x3f')][_0xe62f('0x3a')]['length']){return _0x4ad281['List']['Contacts'][0x0];}var _0x22eaed=_[_0xe62f('0xa')](_0x1e59d5['body'],{'firstName':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x32')],'ListId':_0x4ad281[_0xe62f('0x30')]});_0x22eaed[_0x1e59d5['body'][_0xe62f('0x34')]]=_0x1e59d5['body'][_0xe62f('0x32')];return db[_0xe62f('0x2c')][_0xe62f('0x4a')](_0x22eaed);}else{throw new Error(_0xe62f('0x4b'));}})['then'](function(_0x46f4e1){_0x33ad38[_0xe62f('0x4c')]=_0x46f4e1;if(_0x46f4e1){if(!_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x4d')]){_0x1e59d5[_0xe62f('0x29')]['message'][_0xe62f('0x4d')]=rs[_0xe62f('0x4e')]()+'\x20'+_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x32')];}var _0x5019a6={'ContactId':_0x46f4e1['id'],'MailAccountId':_0x1e59d5[_0xe62f('0x38')]['id'],'inReplyTo':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x4d')],'to':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')]['from'],'cc':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')]['cc'],'subject':_0x1e59d5['body'][_0xe62f('0x16')][_0xe62f('0x4f')],'attach':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')]['attach'],'lastMsgAt':moment()[_0xe62f('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xe62f('0x51')][_0xe62f('0x27')]({'where':{'closed':![],'MailAccountId':_0x1e59d5['account']['id']},'include':[{'model':db[_0xe62f('0x52')],'as':_0xe62f('0x53'),'attributes':[_0xe62f('0x4d')],'where':{'messageId':_0x1e59d5[_0xe62f('0x29')]['message'][_0xe62f('0x54')]}}]})[_0xe62f('0x3e')](function(_0x1ffb55){if(_0x1ffb55){return[_0x1ffb55,![]];}return db['MailInteraction'][_0xe62f('0x4a')](_0x5019a6)[_0xe62f('0x3e')](function(_0x196f48){return[_0x196f48,!![]];});});}else{throw new Error(_0xe62f('0x55'));}})[_0xe62f('0x56')](function(_0x346f5c,_0x3777ce){if(_0x346f5c){_0x11bb6b=_0x3777ce;if(!_0x3777ce){return _0x346f5c[_0xe62f('0x57')]({'inReplyTo':_0x1e59d5['body'][_0xe62f('0x16')]['messageId'],'to':_0x1e59d5[_0xe62f('0x29')]['message']['from'],'cc':_0x1e59d5[_0xe62f('0x29')]['message']['cc'],'subject':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x4f')],'attach':_0x346f5c[_0xe62f('0x58')]?_0x346f5c[_0xe62f('0x58')]:_0x1e59d5['body']['message'][_0xe62f('0x58')],'substatus':null,'substatusAt':moment()[_0xe62f('0x50')](_0xe62f('0x59')),'lastMsgAt':moment()[_0xe62f('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x346f5c;}}})[_0xe62f('0x3e')](function(_0x15838d){_0x33ad38['interaction']=_0x15838d[_0xe62f('0x40')]({'plain':!![]});_0x33ad38['interaction'][_0xe62f('0x5a')]=_0x11bb6b;return db[_0xe62f('0x52')][_0xe62f('0x4a')]({'body':_0x1e59d5[_0xe62f('0x29')]['body'],'MailAccountId':_0x1e59d5[_0xe62f('0x38')]['id'],'MailInteractionId':_0x15838d['id'],'direction':'in','ContactId':_0x33ad38['contact']['id'],'messageId':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x4d')],'from':_0x1e59d5[_0xe62f('0x29')]['message'][_0xe62f('0x32')],'to':_0x1e59d5['body'][_0xe62f('0x16')]['to'],'cc':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')]['cc'],'subject':_0x1e59d5['body'][_0xe62f('0x16')]['subject'],'attach':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x58')],'Attachments':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x5b')],'originTo':_0x1e59d5[_0xe62f('0x29')]['message'][_0xe62f('0x5c')],'originCc':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x5d')],'bcc':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')]['bcc'],'ChatWebsiteId':_0x1e59d5[_0xe62f('0x29')]['message'][_0xe62f('0x5e')]||null,'originChannel':_0x1e59d5['body'][_0xe62f('0x16')][_0xe62f('0x5f')]||_0xe62f('0x60'),'ChatOfflineMessageId':_0x1e59d5[_0xe62f('0x29')][_0xe62f('0x16')][_0xe62f('0x61')]||null},{'include':[{'model':db['Attachment'],'as':_0xe62f('0x62')}]});})[_0xe62f('0x3e')](function(_0x593f5f){_0x33ad38['message']=_0x593f5f;if(_0x33ad38['interaction'][_0xe62f('0x63')]){return db[_0xe62f('0x64')][_0xe62f('0x27')]({'attributes':['id',_0xe62f('0x65')],'where':{'id':_0x33ad38[_0xe62f('0x66')][_0xe62f('0x63')]}})[_0xe62f('0x3e')](function(_0xd1fab6){if(_0xd1fab6){_0x33ad38['applications'][_0xe62f('0x67')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd1fab6[_0xe62f('0x65')]+','+(_0x33ad38[_0xe62f('0x38')][_0xe62f('0x68')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe62f('0x69'),_0xe62f('0x6a'),_0x33ad38);});}return respondWithRpcPromise(_0xe62f('0x69'),_0xe62f('0x6a'),_0x33ad38);})['then'](function(_0x454acb){_0x4bc416(_0x454acb);})['catch'](function(_0x5d446a){_0x4ef8a5(_0x33155f[_0xe62f('0x15')](0x1f4,_0x5d446a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index d9c84bd..4ff1975 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 _0x6140=['update','removeListener','length','./mailAccount.events','remove'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x6140,0x125));var _0x0614=function(_0x2b4d26,_0x279b45){_0x2b4d26=_0x2b4d26-0x0;var _0x1b5a40=_0x6140[_0x2b4d26];return _0x1b5a40;};'use strict';var MailAccountEvents=require(_0x0614('0x0'));var events=['save',_0x0614('0x1'),_0x0614('0x2')];function createListener(_0x34982e,_0x29eee0){return function(_0x50a502){_0x29eee0['emit'](_0x34982e,_0x50a502);};}function removeListener(_0x2ea367,_0x249f3a){return function(){MailAccountEvents[_0x0614('0x3')](_0x2ea367,_0x249f3a);};}exports['register']=function(_0x4136f2){for(var _0x13c176=0x0,_0x4d6f71=events[_0x0614('0x4')];_0x13c176<_0x4d6f71;_0x13c176++){var _0x40a705=events[_0x13c176];var _0x4216ea=createListener('mailAccount:'+_0x40a705,_0x4136f2);MailAccountEvents['on'](_0x40a705,_0x4216ea);}}; \ No newline at end of file +var _0x5b25=['mailAccount:','./mailAccount.events','remove','update','emit','removeListener','register','length'];(function(_0x436d8b,_0x49215f){var _0x38e777=function(_0x4ddafc){while(--_0x4ddafc){_0x436d8b['push'](_0x436d8b['shift']());}};_0x38e777(++_0x49215f);}(_0x5b25,0xc9));var _0x55b2=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0x5b25[_0x412b2a];return _0x5872e3;};'use strict';var MailAccountEvents=require(_0x55b2('0x0'));var events=['save',_0x55b2('0x1'),_0x55b2('0x2')];function createListener(_0x170e2f,_0x185234){return function(_0x589ef9){_0x185234[_0x55b2('0x3')](_0x170e2f,_0x589ef9);};}function removeListener(_0x291c4c,_0x2215ad){return function(){MailAccountEvents[_0x55b2('0x4')](_0x291c4c,_0x2215ad);};}exports[_0x55b2('0x5')]=function(_0x4e20d4){for(var _0x4368ac=0x0,_0x32400e=events[_0x55b2('0x6')];_0x4368ac<_0x32400e;_0x4368ac++){var _0x3bd075=events[_0x4368ac];var _0x19123b=createListener(_0x55b2('0x7')+_0x3bd075,_0x4e20d4);MailAccountEvents['on'](_0x3bd075,_0x19123b);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b828f3f..7476716 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 _0xf2ad=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','update','delete','destroy'];(function(_0x527353,_0x28b9e1){var _0xacfb0a=function(_0x126337){while(--_0x126337){_0x527353['push'](_0x527353['shift']());}};_0xacfb0a(++_0x28b9e1);}(_0xf2ad,0xc5));var _0xdf2a=function(_0x3d9176,_0x399d6f){_0x3d9176=_0x3d9176-0x0;var _0x12adc5=_0xf2ad[_0x3d9176];return _0x12adc5;};'use strict';var multer=require('multer');var util=require(_0xdf2a('0x0'));var path=require(_0xdf2a('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf2a('0x2'));var router=express['Router']();var fs_extra=require(_0xdf2a('0x3'));var auth=require(_0xdf2a('0x4'));var interaction=require(_0xdf2a('0x5'));var config=require(_0xdf2a('0x6'));var controller=require(_0xdf2a('0x7'));router['get'](_0xdf2a('0x8'),auth['isAuthenticated'](),controller['show']);router['put'](_0xdf2a('0x8'),auth[_0xdf2a('0x9')](),controller[_0xdf2a('0xa')]);router[_0xdf2a('0xb')](_0xdf2a('0x8'),auth[_0xdf2a('0x9')](),controller[_0xdf2a('0xc')]);module[_0xdf2a('0xd')]=router; \ No newline at end of file +var _0x97f8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','delete','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x97f8,0x94));var _0x897f=function(_0x19370d,_0x1aff06){_0x19370d=_0x19370d-0x0;var _0x16b620=_0x97f8[_0x19370d];return _0x16b620;};'use strict';var multer=require(_0x897f('0x0'));var util=require(_0x897f('0x1'));var path=require(_0x897f('0x2'));var timeout=require(_0x897f('0x3'));var express=require(_0x897f('0x4'));var router=express[_0x897f('0x5')]();var fs_extra=require(_0x897f('0x6'));var auth=require(_0x897f('0x7'));var interaction=require(_0x897f('0x8'));var config=require('../../config/environment');var controller=require(_0x897f('0x9'));router['get'](_0x897f('0xa'),auth[_0x897f('0xb')](),controller['show']);router['put'](_0x897f('0xa'),auth[_0x897f('0xb')](),controller['update']);router[_0x897f('0xc')](_0x897f('0xa'),auth['isAuthenticated'](),controller[_0x897f('0xd')]);module[_0x897f('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 3d40995..331f499 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 _0x84c3=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84c3,0xdb));var _0x384c=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x84c3[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require('sequelize');module[_0x384c('0x0')]={'priority':{'type':Sequelize[_0x384c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x384c('0x2')],'allowNull':![],'defaultValue':_0x384c('0x3')},'appdata':{'type':Sequelize[_0x384c('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x384c('0x2')],'defaultValue':_0x384c('0x5')}}; \ No newline at end of file +var _0x5a61=['sequelize','exports','noop','TEXT','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5a61,0xeb));var _0x15a6=function(_0x78cf8f,_0x22e112){_0x78cf8f=_0x78cf8f-0x0;var _0x50fd09=_0x5a61[_0x78cf8f];return _0x50fd09;};'use strict';var Sequelize=require(_0x15a6('0x0'));module[_0x15a6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15a6('0x2')},'appdata':{'type':Sequelize[_0x15a6('0x3')]()},'description':{'type':Sequelize[_0x15a6('0x4')]},'interval':{'type':Sequelize[_0x15a6('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 56dc8a2..4d2bcac 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 _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x5c797b,_0x563068){var _0x134ca2=function(_0x5bfc88){while(--_0x5bfc88){_0x5c797b['push'](_0x5c797b['shift']());}};_0x134ca2(++_0x563068);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2154f6,_0x553144){var _0x2f4e53=function(_0x592c60){while(--_0x592c60){_0x2154f6['push'](_0x2154f6['shift']());}};_0x2f4e53(++_0x553144);}(_0x54ef,0x112));var _0xf54e=function(_0x36fc6d,_0x4ce1aa){_0x36fc6d=_0x36fc6d-0x0;var _0x351ee1=_0x54ef[_0x36fc6d];return _0x351ee1;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index e337397..3481548 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 _0x6b7e=['utf8mb4','util','api','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications'];(function(_0x20c996,_0x4ab8d3){var _0xe24140=function(_0x22e8a2){while(--_0x22e8a2){_0x20c996['push'](_0x20c996['shift']());}};_0xe24140(++_0x4ab8d3);}(_0x6b7e,0x1da));var _0xe6b7=function(_0x4d3e20,_0x1e100c){_0x4d3e20=_0x4d3e20-0x0;var _0x3f34c9=_0x6b7e[_0x4d3e20];return _0x3f34c9;};'use strict';var _=require('lodash');var util=require(_0xe6b7('0x0'));var logger=require('../../config/logger')(_0xe6b7('0x1'));var moment=require(_0xe6b7('0x2'));var BPromise=require(_0xe6b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6b7('0x4'));var rimraf=require(_0xe6b7('0x5'));var config=require(_0xe6b7('0x6'));var attributes=require(_0xe6b7('0x7'));module[_0xe6b7('0x8')]=function(_0x47953b,_0x200441){return _0x47953b['define']('MailApplication',attributes,{'tableName':_0xe6b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6b7('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaae7=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4_unicode_ci','lodash'];(function(_0x46cb6c,_0x234ea1){var _0x5ddd8e=function(_0x5bdce2){while(--_0x5bdce2){_0x46cb6c['push'](_0x46cb6c['shift']());}};_0x5ddd8e(++_0x234ea1);}(_0xaae7,0x11d));var _0x7aae=function(_0x22d756,_0x392912){_0x22d756=_0x22d756-0x0;var _0x572c10=_0xaae7[_0x22d756];return _0x572c10;};'use strict';var _=require(_0x7aae('0x0'));var util=require('util');var logger=require(_0x7aae('0x1'))(_0x7aae('0x2'));var moment=require(_0x7aae('0x3'));var BPromise=require(_0x7aae('0x4'));var rp=require(_0x7aae('0x5'));var fs=require('fs');var path=require(_0x7aae('0x6'));var rimraf=require('rimraf');var config=require(_0x7aae('0x7'));var attributes=require(_0x7aae('0x8'));module[_0x7aae('0x9')]=function(_0x1445dc,_0x1934ac){return _0x1445dc[_0x7aae('0xa')]('MailApplication',attributes,{'tableName':_0x7aae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7aae('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 06a6387..a532ceb 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 _0xeb46=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeb46,0x1f0));var _0x6eb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb46[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6eb4('0x0'));var util=require(_0x6eb4('0x1'));var moment=require(_0x6eb4('0x2'));var BPromise=require(_0x6eb4('0x3'));var rs=require(_0x6eb4('0x4'));var fs=require('fs');var Redis=require(_0x6eb4('0x5'));var db=require(_0x6eb4('0x6'))['db'];var utils=require(_0x6eb4('0x7'));var logger=require('../../config/logger')(_0x6eb4('0x8'));var config=require('../../config/environment');var jayson=require(_0x6eb4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2bae,_0x2b4e6f,_0x524b6a){return new BPromise(function(_0x160374,_0x5cbd86){return client['request'](_0x3a2bae,_0x524b6a)[_0x6eb4('0xa')](function(_0x2ddfdf){logger[_0x6eb4('0xb')](_0x6eb4('0xc'),_0x2b4e6f,_0x6eb4('0xd'));logger[_0x6eb4('0xe')](_0x6eb4('0xf'),_0x2b4e6f,'request\x20sent',JSON[_0x6eb4('0x10')](_0x2ddfdf));if(_0x2ddfdf[_0x6eb4('0x11')]){if(_0x2ddfdf[_0x6eb4('0x11')]['code']===0x1f4){logger[_0x6eb4('0x11')](_0x6eb4('0xc'),_0x2b4e6f,_0x2ddfdf['error'][_0x6eb4('0x12')]);return _0x5cbd86(_0x2ddfdf[_0x6eb4('0x11')][_0x6eb4('0x12')]);}logger[_0x6eb4('0x11')](_0x6eb4('0xc'),_0x2b4e6f,_0x2ddfdf['error']['message']);return _0x160374(_0x2ddfdf[_0x6eb4('0x11')]['message']);}else{logger[_0x6eb4('0xb')](_0x6eb4('0xc'),_0x2b4e6f,'request\x20sent');_0x160374(_0x2ddfdf[_0x6eb4('0x13')][_0x6eb4('0x12')]);}})[_0x6eb4('0x14')](function(_0x5974ed){logger[_0x6eb4('0x11')](_0x6eb4('0xc'),_0x2b4e6f,_0x5974ed);_0x5cbd86(_0x5974ed);});});}exports[_0x6eb4('0x15')]=function(_0x57cc4a){var _0x4a1708=this;return new Promise(function(_0x5cab52,_0x5e9e94){return db[_0x6eb4('0x16')][_0x6eb4('0x17')](_0x57cc4a[_0x6eb4('0x18')],{'raw':_0x57cc4a[_0x6eb4('0x19')]?_0x57cc4a['options'][_0x6eb4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57cc4a['options']?_0x57cc4a['options'][_0x6eb4('0x1b')]||null:null,'attributes':_0x57cc4a[_0x6eb4('0x19')]?_0x57cc4a[_0x6eb4('0x19')][_0x6eb4('0x1c')]||null:null,'limit':_0x57cc4a[_0x6eb4('0x19')]?_0x57cc4a[_0x6eb4('0x19')][_0x6eb4('0x1d')]||null:null})['then'](function(_0x54a940){logger['info'](_0x6eb4('0x15'),_0x57cc4a);logger[_0x6eb4('0xe')](_0x6eb4('0x15'),_0x57cc4a,JSON['stringify'](_0x54a940));_0x5cab52(_0x54a940);})[_0x6eb4('0x14')](function(_0x3579d4){logger[_0x6eb4('0x11')](_0x6eb4('0x15'),_0x3579d4[_0x6eb4('0x12')],_0x57cc4a);_0x5e9e94(_0x4a1708['error'](0x1f4,_0x3579d4['message']));});});}; \ No newline at end of file +var _0x7f81=['debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','MailApplication,\x20%s,\x20%s'];(function(_0x8a7e38,_0x473a5d){var _0x228609=function(_0x5dcb5c){while(--_0x5dcb5c){_0x8a7e38['push'](_0x8a7e38['shift']());}};_0x228609(++_0x473a5d);}(_0x7f81,0x13c));var _0x17f8=function(_0xa765ce,_0x16db6b){_0xa765ce=_0xa765ce-0x0;var _0x5d6278=_0x7f81[_0xa765ce];return _0x5d6278;};'use strict';var _=require(_0x17f8('0x0'));var util=require(_0x17f8('0x1'));var moment=require('moment');var BPromise=require(_0x17f8('0x2'));var rs=require(_0x17f8('0x3'));var fs=require('fs');var Redis=require(_0x17f8('0x4'));var db=require(_0x17f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x17f8('0x6'))(_0x17f8('0x7'));var config=require(_0x17f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x17f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe10192,_0x159c92,_0x54776d){return new BPromise(function(_0x47fc7a,_0x3f63cc){return client[_0x17f8('0xa')](_0xe10192,_0x54776d)[_0x17f8('0xb')](function(_0x2b61f3){logger[_0x17f8('0xc')](_0x17f8('0xd'),_0x159c92,'request\x20sent');logger[_0x17f8('0xe')](_0x17f8('0xf'),_0x159c92,_0x17f8('0x10'),JSON[_0x17f8('0x11')](_0x2b61f3));if(_0x2b61f3[_0x17f8('0x12')]){if(_0x2b61f3['error'][_0x17f8('0x13')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x159c92,_0x2b61f3[_0x17f8('0x12')]['message']);return _0x3f63cc(_0x2b61f3[_0x17f8('0x12')][_0x17f8('0x14')]);}logger[_0x17f8('0x12')](_0x17f8('0xd'),_0x159c92,_0x2b61f3['error'][_0x17f8('0x14')]);return _0x47fc7a(_0x2b61f3[_0x17f8('0x12')][_0x17f8('0x14')]);}else{logger[_0x17f8('0xc')](_0x17f8('0xd'),_0x159c92,_0x17f8('0x10'));_0x47fc7a(_0x2b61f3['result'][_0x17f8('0x14')]);}})[_0x17f8('0x15')](function(_0x522ca8){logger[_0x17f8('0x12')](_0x17f8('0xd'),_0x159c92,_0x522ca8);_0x3f63cc(_0x522ca8);});});}exports[_0x17f8('0x16')]=function(_0x37ae55){var _0x5e1b76=this;return new Promise(function(_0x3cf49d,_0x3e248c){return db[_0x17f8('0x17')][_0x17f8('0x18')](_0x37ae55[_0x17f8('0x19')],{'raw':_0x37ae55[_0x17f8('0x1a')]?_0x37ae55[_0x17f8('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37ae55[_0x17f8('0x1a')]?_0x37ae55[_0x17f8('0x1a')][_0x17f8('0x1b')]||null:null,'attributes':_0x37ae55[_0x17f8('0x1a')]?_0x37ae55['options'][_0x17f8('0x1c')]||null:null,'limit':_0x37ae55['options']?_0x37ae55[_0x17f8('0x1a')][_0x17f8('0x1d')]||null:null})[_0x17f8('0xb')](function(_0x14ecec){logger['info']('UpdateMailApplication',_0x37ae55);logger[_0x17f8('0xe')](_0x17f8('0x16'),_0x37ae55,JSON['stringify'](_0x14ecec));_0x3cf49d(_0x14ecec);})[_0x17f8('0x15')](function(_0x1d150d){logger[_0x17f8('0x12')](_0x17f8('0x16'),_0x1d150d[_0x17f8('0x14')],_0x37ae55);_0x3e248c(_0x5e1b76[_0x17f8('0x12')](0x1f4,_0x1d150d[_0x17f8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 634a329..b8f4fc2 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 _0x4cbc=['post','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','Router','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/messages','getMessages','/:id/download','download'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x4cbc,0x127));var _0xc4cb=function(_0x108aeb,_0x562f5a){_0x108aeb=_0x108aeb-0x0;var _0x59ab2c=_0x4cbc[_0x108aeb];return _0x59ab2c;};'use strict';var express=require('express');var router=express[_0xc4cb('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4cb('0x1'));var controller=require(_0xc4cb('0x2'));router[_0xc4cb('0x3')]('/',auth['isAuthenticated'](),controller[_0xc4cb('0x4')]);router[_0xc4cb('0x3')](_0xc4cb('0x5'),auth['isAuthenticated'](),controller[_0xc4cb('0x6')]);router['get'](_0xc4cb('0x7'),auth[_0xc4cb('0x8')](),controller['show']);router['get'](_0xc4cb('0x9'),auth[_0xc4cb('0x8')](),controller[_0xc4cb('0xa')]);router[_0xc4cb('0x3')](_0xc4cb('0xb'),auth[_0xc4cb('0x8')](),controller[_0xc4cb('0xc')]);router['post']('/',auth[_0xc4cb('0x8')](),controller['create']);router[_0xc4cb('0xd')](_0xc4cb('0x9'),auth[_0xc4cb('0x8')](),controller[_0xc4cb('0xe')]);router[_0xc4cb('0xd')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xc4cb('0xf')](_0xc4cb('0x10'),_0xc4cb('0x11')),controller[_0xc4cb('0x12')]);router[_0xc4cb('0x13')]('/:id',auth[_0xc4cb('0x8')](),interaction['tracked'](_0xc4cb('0x10'),_0xc4cb('0x14')),controller[_0xc4cb('0x15')]);router[_0xc4cb('0x16')](_0xc4cb('0x7'),auth[_0xc4cb('0x8')](),interaction['tracked'](_0xc4cb('0x10'),_0xc4cb('0x17')),controller[_0xc4cb('0x18')]);router[_0xc4cb('0x16')](_0xc4cb('0x19'),auth[_0xc4cb('0x8')](),controller[_0xc4cb('0x1a')]);module[_0xc4cb('0x1b')]=router; \ No newline at end of file +var _0x8347=['tracked','mail','mailinteraction:addtags','put','update','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x8347,0x1ad));var _0x7834=function(_0x4a3385,_0x3ec2b3){_0x4a3385=_0x4a3385-0x0;var _0xc5cc7c=_0x8347[_0x4a3385];return _0xc5cc7c;};'use strict';var express=require(_0x7834('0x0'));var router=express[_0x7834('0x1')]();var auth=require(_0x7834('0x2'));var interaction=require(_0x7834('0x3'));var controller=require(_0x7834('0x4'));router[_0x7834('0x5')]('/',auth[_0x7834('0x6')](),controller[_0x7834('0x7')]);router[_0x7834('0x5')](_0x7834('0x8'),auth['isAuthenticated'](),controller[_0x7834('0x9')]);router[_0x7834('0x5')](_0x7834('0xa'),auth[_0x7834('0x6')](),controller[_0x7834('0xb')]);router[_0x7834('0x5')](_0x7834('0xc'),auth[_0x7834('0x6')](),controller['getMessages']);router[_0x7834('0x5')](_0x7834('0xd'),auth[_0x7834('0x6')](),controller[_0x7834('0xe')]);router[_0x7834('0xf')]('/',auth[_0x7834('0x6')](),controller[_0x7834('0x10')]);router[_0x7834('0xf')]('/:id/messages',auth[_0x7834('0x6')](),controller[_0x7834('0x11')]);router[_0x7834('0xf')](_0x7834('0x12'),auth['isAuthenticated'](),interaction[_0x7834('0x13')](_0x7834('0x14'),_0x7834('0x15')),controller['addTags']);router[_0x7834('0x16')]('/:id',auth[_0x7834('0x6')](),interaction[_0x7834('0x13')](_0x7834('0x14'),'mailinteraction:update'),controller[_0x7834('0x17')]);router[_0x7834('0x18')](_0x7834('0xa'),auth['isAuthenticated'](),interaction[_0x7834('0x13')](_0x7834('0x14'),_0x7834('0x19')),controller['destroy']);router[_0x7834('0x18')](_0x7834('0x12'),auth[_0x7834('0x6')](),controller[_0x7834('0x1a')]);module[_0x7834('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index dd32f01..69bc439 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 _0xe083=['ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long','DATE'];(function(_0x599583,_0x7b3366){var _0x3e91c3=function(_0x55119e){while(--_0x55119e){_0x599583['push'](_0x599583['shift']());}};_0x3e91c3(++_0x7b3366);}(_0xe083,0x1a6));var _0x3e08=function(_0x22f4d5,_0x28decb){_0x22f4d5=_0x22f4d5-0x0;var _0x4cd45e=_0xe083[_0x22f4d5];return _0x4cd45e;};'use strict';var Sequelize=require(_0x3e08('0x0'));var iconv=require(_0x3e08('0x1'));module[_0x3e08('0x2')]={'closed':{'type':Sequelize[_0x3e08('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3e08('0x4')]},'secondDisposition':{'type':Sequelize[_0x3e08('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3e08('0x4')]},'note':{'type':Sequelize[_0x3e08('0x4')]},'inReplyTo':{'type':Sequelize[_0x3e08('0x4')](0x1fe)},'to':{'type':Sequelize[_0x3e08('0x4')]},'cc':{'type':Sequelize[_0x3e08('0x5')](_0x3e08('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x3e08('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3e08('0x7')]},'substatus':{'type':Sequelize[_0x3e08('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x3e08('0x7')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3e08('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3e08('0x8')]('in',_0x3e08('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7c1f=['TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x2fe581,_0x269cb6){var _0x37d758=function(_0x2de51a){while(--_0x2de51a){_0x2fe581['push'](_0x2fe581['shift']());}};_0x37d758(++_0x269cb6);}(_0x7c1f,0x194));var _0xf7c1=function(_0x1f2988,_0x35d0e2){_0x1f2988=_0x1f2988-0x0;var _0x54902c=_0x7c1f[_0x1f2988];return _0x54902c;};'use strict';var Sequelize=require(_0xf7c1('0x0'));var iconv=require(_0xf7c1('0x1'));module[_0xf7c1('0x2')]={'closed':{'type':Sequelize[_0xf7c1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf7c1('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf7c1('0x5')]},'thirdDisposition':{'type':Sequelize[_0xf7c1('0x5')]},'note':{'type':Sequelize[_0xf7c1('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf7c1('0x5')]},'cc':{'type':Sequelize[_0xf7c1('0x6')](_0xf7c1('0x7'))},'subject':{'type':Sequelize[_0xf7c1('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf7c1('0x4')]},'substatus':{'type':Sequelize[_0xf7c1('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xf7c1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf7c1('0x8')]('in',_0xf7c1('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf7c1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf7c1('0x8')]('in',_0xf7c1('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf7c1('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 91617de..90ad2f3 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 _0x85ef=['Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','Users','fullname','Tags','TagIds','forEach','MailMessage','findOne','out','plainBody','-id','catch','index','map','MailInteraction','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_mail_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','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','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?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','push','rows','show','params','includeAll','include','options','create','body','describe','addMessage','omit','ids','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','Tag','emit','mailInteractionTags:save','removeTags','download','join','server','files','tmp','attachments','Attachment'];(function(_0x5600ba,_0xe51f7c){var _0x2db0f1=function(_0x4a5896){while(--_0x4a5896){_0x5600ba['push'](_0x5600ba['shift']());}};_0x2db0f1(++_0xe51f7c);}(_0x85ef,0x1e6));var _0xf85e=function(_0x3f1e31,_0x49768a){_0x3f1e31=_0x3f1e31-0x0;var _0x1bb81b=_0x85ef[_0x3f1e31];return _0x1bb81b;};'use strict';var emlformat=require(_0xf85e('0x0'));var rimraf=require(_0xf85e('0x1'));var zipdir=require(_0xf85e('0x2'));var moment=require(_0xf85e('0x3'));var BPromise=require(_0xf85e('0x4'));var util=require('util');var path=require(_0xf85e('0x5'));var fs=require('fs');var _=require(_0xf85e('0x6'));var squel=require('squel');var juice=require(_0xf85e('0x7'));var Redis=require(_0xf85e('0x8'));var qs=require(_0xf85e('0x9'));var as=require(_0xf85e('0xa'));var logger=require(_0xf85e('0xb'))(_0xf85e('0xc'));var config=require(_0xf85e('0xd'));var db=require(_0xf85e('0xe'))['db'];var htmlEntities=require(_0xf85e('0xf'));config[_0xf85e('0x10')]=_[_0xf85e('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf85e('0x12'))(new Redis(config[_0xf85e('0x10')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2abfe4,_0x1df6ac){_0x1df6ac=_0x1df6ac||0xcc;return function(_0x255fba){if(_0x255fba){return _0x2abfe4[_0xf85e('0x13')](_0x1df6ac);}return _0x2abfe4[_0xf85e('0x14')](_0x1df6ac)[_0xf85e('0x15')]();};}function respondWithResult(_0x31d578,_0x399181){_0x399181=_0x399181||0xc8;return function(_0x174724){if(_0x174724){return _0x31d578[_0xf85e('0x14')](_0x399181)[_0xf85e('0x16')](_0x174724);}};}function respondWithFilteredResult(_0x5a8759,_0x3fa391){return function(_0xf8c57){if(_0xf8c57){var _0x5a0f2f=typeof _0x3fa391[_0xf85e('0x17')]===_0xf85e('0x18')&&typeof _0x3fa391[_0xf85e('0x19')]===_0xf85e('0x18');var _0x42766c=_0xf8c57[_0xf85e('0x1a')];var _0x21b415=_0x5a0f2f?0x0:_0x3fa391[_0xf85e('0x17')];var _0x7abd7=_0x5a0f2f?_0xf8c57[_0xf85e('0x1a')]:_0x3fa391['offset']+_0x3fa391[_0xf85e('0x19')];var _0x1f0201;if(_0x7abd7>=_0x42766c){_0x7abd7=_0x42766c;_0x1f0201=0xc8;}else{_0x1f0201=0xce;}_0x5a8759[_0xf85e('0x14')](_0x1f0201);return _0x5a8759['set'](_0xf85e('0x1b'),_0x21b415+'-'+_0x7abd7+'/'+_0x42766c)[_0xf85e('0x16')](_0xf8c57);}return null;};}function saveUpdates(_0x2da06d){return function(_0x15517d){if(_0x15517d){return _0x15517d[_0xf85e('0x1c')](_0x2da06d)[_0xf85e('0x1d')](function(_0x34eba4){return _0x34eba4;});}return null;};}function removeEntity(_0x461103){return function(_0x50ba42){if(_0x50ba42){return _0x50ba42['destroy']()[_0xf85e('0x1d')](function(){_0x461103[_0xf85e('0x14')](0xcc)[_0xf85e('0x15')]();});}};}function handleEntityNotFound(_0xfa62ec){return function(_0x2a2230){if(!_0x2a2230){_0xfa62ec['sendStatus'](0x194);}return _0x2a2230;};}function handleError(_0x16dd8a,_0x2bba1e){_0x2bba1e=_0x2bba1e||0x1f4;return function(_0x4fd8bb){logger[_0xf85e('0x1e')](_0x4fd8bb[_0xf85e('0x1f')]);if(_0x4fd8bb['name']){delete _0x4fd8bb[_0xf85e('0x20')];}_0x16dd8a['status'](_0x2bba1e)[_0xf85e('0x21')](_0x4fd8bb);};}function getInteractionUsers(_0x42462e,_0x39c1c4){return new BPromise(function(_0x4e13af,_0x388068){try{if(_0x39c1c4[_0x42462e['id']]){_0x42462e[_0xf85e('0x22')]=_['map'](_0x39c1c4[_0x42462e['id']],function(_0xd2932c){return{'id':_0xd2932c['id'],'fullname':_0xd2932c[_0xf85e('0x23')]};});}}catch(_0x1c8df4){_0x388068(_0x1c8df4);}_0x4e13af(_0x42462e);});}function getInteractionTags(_0x272274,_0x241b27){return new BPromise(function(_0x252d77,_0x42d1c1){try{if(_0x272274['TagIds']){_0x272274[_0xf85e('0x24')]=[];_0x272274[_0xf85e('0x25')]['split'](',')[_0xf85e('0x26')](function(_0x571117){_0x272274[_0xf85e('0x24')]['push'](_0x241b27[_0x571117]);});}delete _0x272274[_0xf85e('0x25')];}catch(_0x4b59b9){_0x42d1c1(_0x4b59b9);}_0x252d77(_0x272274);});}function getLastMessageText(_0x2d760b){return new BPromise(function(_0x3ba37e,_0x216ada){return db[_0xf85e('0x27')][_0xf85e('0x28')]({'where':{'$and':[{'MailInteractionId':_0x2d760b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf85e('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf85e('0x2a')],'order':_0xf85e('0x2b'),'raw':!![]})[_0xf85e('0x1d')](function(_0x4d7a34){if(_0x4d7a34&&_0x4d7a34[_0xf85e('0x2a')]){_0x2d760b['lastMsgText']=_['trimStart'](_0x4d7a34['plainBody']);}_0x3ba37e(_0x2d760b);})[_0xf85e('0x2c')](function(_0x7b544a){_0x216ada(_0x7b544a);});});}function updateMailInteraction(_0x59254a,_0x5097ed,_0x393930,_0x1a5804){return new BPromise(function(_0x5e26bc,_0x164659){return getInteractionUsers(_0x59254a,_0x393930)[_0xf85e('0x1d')](function(_0x15cd6c){return getInteractionTags(_0x15cd6c,_0x5097ed);})['then'](function(_0x35d94a){if(_0x1a5804){_0x5e26bc(getLastMessageText(_0x35d94a));}else{_0x5e26bc(_0x35d94a);}})[_0xf85e('0x2c')](function(_0x127892){_0x164659(_0x127892);});});}exports[_0xf85e('0x2d')]=function(_0x12bb40,_0x3bb426){var _0x2b4537={},_0x4e1303={},_0xd30243={'count':0x0,'rows':[]};var _0x4c9cea=_[_0xf85e('0x2e')](db[_0xf85e('0x2f')][_0xf85e('0x30')],function(_0x56d318){return{'name':_0x56d318[_0xf85e('0x31')],'type':_0x56d318[_0xf85e('0x32')][_0xf85e('0x33')]};});_0x4e1303['model']=_[_0xf85e('0x2e')](_0x4c9cea,_0xf85e('0x20'));_0x4e1303[_0xf85e('0x34')]=_[_0xf85e('0x35')](_0x12bb40['query']);_0x4e1303['filters']=_['intersection'](_0x4e1303[_0xf85e('0x36')],_0x4e1303['query']);_0x2b4537[_0xf85e('0x37')]=_[_0xf85e('0x38')](_0x4e1303[_0xf85e('0x36')],qs[_0xf85e('0x39')](_0x12bb40['query']['fields']));_0x2b4537[_0xf85e('0x37')]=_0x2b4537[_0xf85e('0x37')][_0xf85e('0x3a')]?_0x2b4537[_0xf85e('0x37')]:_0x4e1303[_0xf85e('0x36')];if(!_0x12bb40[_0xf85e('0x34')][_0xf85e('0x3b')](_0xf85e('0x3c'))){_0x2b4537[_0xf85e('0x19')]=qs['limit'](_0x12bb40['query']['limit']);_0x2b4537[_0xf85e('0x17')]=qs['offset'](_0x12bb40[_0xf85e('0x34')][_0xf85e('0x17')]);}_0x2b4537['order']=qs[_0xf85e('0x3d')](_0x12bb40[_0xf85e('0x34')][_0xf85e('0x3d')]);_0x2b4537[_0xf85e('0x3e')]=qs[_0xf85e('0x3f')](_[_0xf85e('0x40')](_0x12bb40[_0xf85e('0x34')],_0x4e1303[_0xf85e('0x3f')]),_0x4c9cea);var _0x3f5d0a=[];var _0x5c3117=squel['select']()[_0xf85e('0x41')]('id')[_0xf85e('0x41')](_0xf85e('0x20'))[_0xf85e('0x41')](_0xf85e('0x42'))[_0xf85e('0x43')](_0xf85e('0x44'));var _0x4cee49=squel[_0xf85e('0x45')]()[_0xf85e('0x41')](_0xf85e('0x46'))[_0xf85e('0x41')](_0xf85e('0x47'))[_0xf85e('0x41')]('ui.MailInteractionId')['from'](_0xf85e('0x48'),'ui')[_0xf85e('0x49')](_0xf85e('0x4a'),'u',_0xf85e('0x4b'));var _0x59e9f6=squel[_0xf85e('0x45')]()['from']('mail_interactions','i')[_0xf85e('0x49')](_0xf85e('0x4c'),'c',_0xf85e('0x4d'))['left_join']('users','o',_0xf85e('0x4e'))[_0xf85e('0x49')](_0xf85e('0x4f'),'a',_0xf85e('0x50'))[_0xf85e('0x49')](_0xf85e('0x51'),'me',_0xf85e('0x52'))['left_join'](_0xf85e('0x53'),'it',_0xf85e('0x54'))['left_join'](_0xf85e('0x44'),'t',_0xf85e('0x55'));var _0xa786d3=squel[_0xf85e('0x56')]();var _0x40d7f4=[];var _0x1bf133=squel[_0xf85e('0x56')]();var _0x311dae;if(_0x12bb40[_0xf85e('0x34')][_0xf85e('0x57')]){_0x311dae=as[_0xf85e('0x58')](_0x12bb40[_0xf85e('0x34')]['search']);var _0x46eefc=_0x311dae[_0xf85e('0x59')];for(var _0x289950=0x0;_0x289950<_0x311dae[_0xf85e('0x5a')][_0xf85e('0x3a')];_0x289950++){var _0x1a4b69=_0x311dae['conditions'][_0x289950];var _0x5f1072='i';var _0x1e7f13=_[_0xf85e('0x5b')](_0x4c9cea,[_0xf85e('0x20'),_0x1a4b69[_0xf85e('0x41')]]);if(!_0x1e7f13){switch(_0x1a4b69[_0xf85e('0x41')]){case _0xf85e('0x5c'):if(_0x1a4b69[_0xf85e('0x5d')]==0x1){_0x59e9f6[_0xf85e('0x5e')]('`'+_0x1a4b69['field']+_0xf85e('0x5f'));}else{_0x59e9f6[_0xf85e('0x5e')]('`'+_0x1a4b69[_0xf85e('0x41')]+_0xf85e('0x60'));}break;case _0xf85e('0x61'):if(_0x1a4b69[_0xf85e('0x62')]===_0xf85e('0x63')){if(_0x1a4b69[_0xf85e('0x5d')][_0xf85e('0x64')]('\x20')[_0xf85e('0x3a')]>0x1){_0xa786d3[_0x46eefc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf85e('0x65')](_0x1a4b69[_0xf85e('0x5d')]),null);}else{var _0x4780a7='%'+_0x1a4b69[_0xf85e('0x5d')]+'%';_0xa786d3[_0x46eefc](_0xf85e('0x66'),_0x4780a7,_0x4780a7,_0x4780a7);}}else{_0x1e7f13=_[_0xf85e('0x5b')](_0x4c9cea,[_0xf85e('0x20'),_0xf85e('0x67')]);_0x1a4b69['field']=_0xf85e('0x67');_0x480dba=as[_0xf85e('0x68')](_0x5f1072,_0x1e7f13[_0xf85e('0x32')],_0x1a4b69);_0xa786d3[_0x46eefc](_0x480dba[_0xf85e('0x69')],_0x480dba[_0xf85e('0x5d')][_0xf85e('0x6a')],_0x480dba[_0xf85e('0x5d')][_0xf85e('0x15')]);}break;case'Tag':var _0x1b3abf=_0x1a4b69[_0xf85e('0x5d')][_0xf85e('0x64')](',')[_0xf85e('0x2e')](function(_0x1da427){return Number(_0x1da427);});_0x1b3abf['forEach'](function(_0x508614){_0x1bf133['or'](_0xf85e('0x6b'),'%,'+_0x508614+',%');});_0x40d7f4=_[_0xf85e('0x6c')](_0x40d7f4,_0x1b3abf);break;case _0xf85e('0x6d'):if(_0x1a4b69[_0xf85e('0x62')]===_0xf85e('0x63')){_0xa786d3[_0x46eefc](_0xf85e('0x6e'),'%'+_0x1a4b69['value']+'%',null);}else{_0x1e7f13=_['find'](_0x4c9cea,['name',_0xf85e('0x6f')]);_0x1a4b69[_0xf85e('0x41')]=_0xf85e('0x6f');_0x480dba=as['buildExpression'](_0x5f1072,_0x1e7f13[_0xf85e('0x32')],_0x1a4b69);_0xa786d3[_0x46eefc](_0x480dba[_0xf85e('0x69')],_0x480dba[_0xf85e('0x5d')][_0xf85e('0x6a')],_0x480dba['value'][_0xf85e('0x15')]);}break;case _0xf85e('0x2a'):_0x480dba=as[_0xf85e('0x68')]('me',null,_0x1a4b69);_0xa786d3[_0x46eefc](_0x480dba[_0xf85e('0x69')],_0x480dba[_0xf85e('0x5d')]['start'],_0x480dba[_0xf85e('0x5d')]['end']);break;}}else{var _0x480dba=as[_0xf85e('0x68')](_0x5f1072,_0x1e7f13[_0xf85e('0x32')],_0x1a4b69);_0xa786d3[_0x46eefc](_0x480dba[_0xf85e('0x69')],_0x480dba['value'][_0xf85e('0x6a')],_0x480dba[_0xf85e('0x5d')][_0xf85e('0x15')]);}}}else{var _0x3371e1=_(_0x12bb40[_0xf85e('0x34')])[_0xf85e('0x35')]()[_0xf85e('0x2e')](function(_0x5766b9){return _[_0xf85e('0x70')](_0x4c9cea,[_0xf85e('0x20'),_0x5766b9])?_0x5766b9:undefined;})[_0xf85e('0x71')]()[_0xf85e('0x5d')]();if(!_[_0xf85e('0x72')](_0x3371e1)){_0x3371e1[_0xf85e('0x26')](function(_0x32701d){if(_0x32701d==='MailAccountId'){_0x59e9f6['where'](_0xf85e('0x73'),[]['concat'](_0x12bb40[_0xf85e('0x34')][_0x32701d]));}else if(_0x32701d===_0xf85e('0x74')){var _0x167e27=JSON[_0xf85e('0x75')](_0x12bb40['query'][_0x32701d])[_0xf85e('0x76')];var _0x10615e=JSON[_0xf85e('0x75')](_0x12bb40['query'][_0x32701d])[_0xf85e('0x77')];_0x59e9f6[_0xf85e('0x3e')](_0xf85e('0x78'),_0x167e27,_0x10615e);}else{if(_0x12bb40[_0xf85e('0x34')][_0x32701d]===_0xf85e('0x79')){_0x59e9f6[_0xf85e('0x3e')]('i.'+_0x32701d+_0xf85e('0x7a'));}else{_0x59e9f6[_0xf85e('0x3e')]('i.'+_0x32701d+_0xf85e('0x7b'),_0x12bb40[_0xf85e('0x34')][_0x32701d]);}}});}if(_0x12bb40[_0xf85e('0x34')][_0xf85e('0x7c')]){if(_0x12bb40[_0xf85e('0x34')]['read']==0x1){_0x59e9f6[_0xf85e('0x5e')](_0xf85e('0x7d'));}else{_0x59e9f6[_0xf85e('0x5e')](_0xf85e('0x7e'));}}if(_0x12bb40[_0xf85e('0x34')][_0xf85e('0x7f')]){_0x40d7f4=_[_0xf85e('0x80')](_0x12bb40['query'][_0xf85e('0x7f')])?_0x12bb40[_0xf85e('0x34')][_0xf85e('0x7f')]:new Array(_0x12bb40[_0xf85e('0x34')]['tag']);_0x40d7f4[_0xf85e('0x26')](function(_0x13db2c){_0x1bf133['or'](_0xf85e('0x6b'),'%,'+_0x13db2c+',%');});}if(_0x12bb40['query'][_0xf85e('0x81')]){var _0x222b42=_0x12bb40['query'][_0xf85e('0x81')]['replace']('\x5c','\x5c\x5c')[_0xf85e('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x222b42)){_0xa786d3['or'](_0xf85e('0x83'),_0x222b42+'%');}else if(qs[_0xf85e('0x84')](_0x222b42)){_0xa786d3['or'](_0xf85e('0x85'),_0x222b42+'%');}else{_0xa786d3['or'](_0xf85e('0x86'),qs[_0xf85e('0x65')](_0x222b42))['or'](_0xf85e('0x87'),qs[_0xf85e('0x65')](_0x222b42));}}}_0x59e9f6[_0xf85e('0x3e')](_0xa786d3);_0x59e9f6[_0xf85e('0x88')]('i.id');var _0x52aebf={'type':db[_0xf85e('0x89')]['QueryTypes']['SELECT'],'raw':!![]};var _0x435d7f=_0x59e9f6['clone']();_0x435d7f[_0xf85e('0x41')](_0xf85e('0x8a'));_0x435d7f[_0xf85e('0x41')](_0xf85e('0x8b'),'unreadMessages');if(_0x2b4537[_0xf85e('0x8c')]){_0x2b4537[_0xf85e('0x8c')][_0xf85e('0x26')](function(_0x4a20c5){var _0x2395fe=_0x4a20c5[0x0]===_0xf85e('0x8d')?_0x4a20c5[0x0]:'i.'+_0x4a20c5[0x0];_0x59e9f6[_0xf85e('0x8c')](_0x2395fe,_0x4a20c5[0x1]==='DESC'?![]:!![]);});}if(!_[_0xf85e('0x72')](_0x40d7f4)){_0x59e9f6[_0xf85e('0x5e')](_0x1bf133);_0x435d7f[_0xf85e('0x3e')](_0xf85e('0x8e'),_0x40d7f4);}BPromise[_0xf85e('0x8f')]()[_0xf85e('0x1d')](function(){if(!_0x311dae){if(_0x12bb40[_0xf85e('0x34')][_0xf85e('0x90')])return;_0x435d7f['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x59e9f6[_0xf85e('0x3e')](_0xf85e('0x91'));return;}if(_0x12bb40[_0xf85e('0x92')][_0xf85e('0x93')]!==_0xf85e('0x94'))return;return _0x12bb40[_0xf85e('0x92')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xf85e('0x1d')](function(_0x25c5be){if(_[_0xf85e('0x72')](_0x25c5be)){_0x435d7f['where'](_0xf85e('0x95'));_0x59e9f6[_0xf85e('0x3e')](_0xf85e('0x95'));}else{_0x435d7f[_0xf85e('0x3e')](_0xf85e('0x73'),_[_0xf85e('0x2e')](_0x25c5be,'id'));_0x59e9f6[_0xf85e('0x3e')](_0xf85e('0x73'),_['map'](_0x25c5be,'id'));}});})[_0xf85e('0x1d')](function(){if(_0x12bb40['user']['role']==='agent'&&!_0x311dae&&!_0x12bb40[_0xf85e('0x34')][_0xf85e('0x90')])return[];return db[_0xf85e('0x96')]['query'](_0x435d7f['toString'](),_0x52aebf);})['then'](function(_0x2eda70){_0xd30243[_0xf85e('0x1a')]=_0x2eda70[_0xf85e('0x3a')];if(_0xd30243[_0xf85e('0x1a')]===0x0)return[];return db[_0xf85e('0x96')]['query'](_0x5c3117[_0xf85e('0x97')](),_0x52aebf)['then'](function(_0x105af3){_0x3f5d0a=_[_0xf85e('0x98')](_0x105af3,'id');_0x52aebf=_[_0xf85e('0x99')](_0x52aebf,{'model':db[_0xf85e('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x12bb40[_0xf85e('0x34')][_0xf85e('0x39')]){_0x2b4537[_0xf85e('0x37')]['forEach'](function(_0xf0cbf){_0x59e9f6[_0xf85e('0x41')]('i.'+_0xf0cbf);});}else{_0x59e9f6[_0xf85e('0x41')](_0xf85e('0x8b'),_0xf85e('0x5c'));_0x59e9f6[_0xf85e('0x41')]('a.key',_0xf85e('0x9a'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0x9b'),'Account.mandatoryDisposition');_0x59e9f6[_0xf85e('0x41')](_0xf85e('0x9c'),_0xf85e('0x8d'));_0x59e9f6['field']('i.id');_0x59e9f6[_0xf85e('0x41')](_0xf85e('0x9d'));_0x59e9f6['field'](_0xf85e('0x9e'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0x9f'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa0'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa1'));_0x59e9f6['field']('i.lastMsgAt');_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa2'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa3'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa4'));_0x59e9f6[_0xf85e('0x41')]('i.secondDisposition');_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa5'));_0x59e9f6['field'](_0xf85e('0xa6'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa7'));_0x59e9f6['field'](_0xf85e('0xa8'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xa9'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xaa'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xab'),_0xf85e('0xac'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xad'),_0xf85e('0xae'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xaf'),_0xf85e('0xb0'));_0x59e9f6['field'](_0xf85e('0xb1'),_0xf85e('0xb2'));_0x59e9f6[_0xf85e('0x41')]('c.mobile',_0xf85e('0xb3'));_0x59e9f6[_0xf85e('0x41')]('c.fax',_0xf85e('0xb4'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xb5'),_0xf85e('0xb6'));_0x59e9f6['field']('o.internal',_0xf85e('0xb7'));_0x59e9f6[_0xf85e('0x41')](_0xf85e('0xb8'),_0xf85e('0x25'));}if(_0x2b4537[_0xf85e('0x19')])_0x59e9f6[_0xf85e('0x19')](_0x2b4537['limit']);if(_0x2b4537[_0xf85e('0x17')])_0x59e9f6[_0xf85e('0x17')](_0x2b4537['offset']);return db[_0xf85e('0x96')]['query'](_0x59e9f6[_0xf85e('0x97')](),_0x52aebf);})[_0xf85e('0x1d')](function(_0x26ceed){if(_0x26ceed[_0xf85e('0x3a')]>0x0)_0x4cee49[_0xf85e('0x3e')](_0xf85e('0xb9'),_[_0xf85e('0x2e')](_0x26ceed,'id'));return db[_0xf85e('0x96')][_0xf85e('0x34')](_0x4cee49['toString'](),_0x52aebf)[_0xf85e('0x1d')](function(_0x3fa01a){var _0x1a4d8a=_[_0xf85e('0xba')](_0x3fa01a,'MailInteractionId');var _0x1f6c19=[];return db[_0xf85e('0xbb')][_0xf85e('0x28')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xf85e('0x1d')](function(_0x2f69c6){var _0x5849e3=_0x2f69c6[_0xf85e('0xbc')];_0x26ceed[_0xf85e('0x26')](function(_0xd181c){_0x1f6c19[_0xf85e('0xbd')](updateMailInteraction(_0xd181c,_0x3f5d0a,_0x1a4d8a,_0x5849e3));});return BPromise['all'](_0x1f6c19);});});});})['then'](function(_0x2ff3bb){_0xd30243[_0xf85e('0xbe')]=_0x2ff3bb;return _0xd30243;})[_0xf85e('0x1d')](respondWithFilteredResult(_0x3bb426,_0x2b4537))[_0xf85e('0x2c')](handleError(_0x3bb426,null));};exports[_0xf85e('0xbf')]=function(_0x9ca46c,_0x342976){var _0x1fdb78={'raw':![],'where':{'id':_0x9ca46c[_0xf85e('0xc0')]['id']}},_0x4cd8c3={};_0x4cd8c3[_0xf85e('0x36')]=_[_0xf85e('0x35')](db[_0xf85e('0x2f')][_0xf85e('0x30')]);_0x4cd8c3[_0xf85e('0x34')]=_['keys'](_0x9ca46c['query']);_0x4cd8c3['filters']=_[_0xf85e('0x38')](_0x4cd8c3[_0xf85e('0x36')],_0x4cd8c3[_0xf85e('0x34')]);_0x1fdb78[_0xf85e('0x37')]=_['intersection'](_0x4cd8c3[_0xf85e('0x36')],qs[_0xf85e('0x39')](_0x9ca46c['query'][_0xf85e('0x39')]));_0x1fdb78[_0xf85e('0x37')]=_0x1fdb78[_0xf85e('0x37')][_0xf85e('0x3a')]?_0x1fdb78[_0xf85e('0x37')]:_0x4cd8c3['model'];if(_0x9ca46c[_0xf85e('0x34')][_0xf85e('0xc1')]){_0x1fdb78[_0xf85e('0xc2')]=[{'all':!![]}];}_0x1fdb78=_[_0xf85e('0x99')]({},_0x1fdb78,_0x9ca46c[_0xf85e('0xc3')]);return db['MailInteraction'][_0xf85e('0x5b')](_0x1fdb78)[_0xf85e('0x1d')](handleEntityNotFound(_0x342976,null))['then'](respondWithResult(_0x342976,null))['catch'](handleError(_0x342976,null));};exports[_0xf85e('0xc4')]=function(_0x5e9067,_0x4d6ac7){return db[_0xf85e('0x2f')]['create'](_0x5e9067['body'],{})[_0xf85e('0x1d')](respondWithResult(_0x4d6ac7,0xc9))['catch'](handleError(_0x4d6ac7,null));};exports[_0xf85e('0x1c')]=function(_0x5ddf18,_0x1e588a){if(_0x5ddf18['body']['id']){delete _0x5ddf18[_0xf85e('0xc5')]['id'];}return db[_0xf85e('0x2f')][_0xf85e('0x5b')]({'where':{'id':_0x5ddf18[_0xf85e('0xc0')]['id']}})['then'](handleEntityNotFound(_0x1e588a,null))[_0xf85e('0x1d')](saveUpdates(_0x5ddf18['body'],null))[_0xf85e('0x1d')](respondWithResult(_0x1e588a,null))['catch'](handleError(_0x1e588a,null));};exports['destroy']=function(_0xdda3b3,_0x4cb5ca){return db[_0xf85e('0x2f')][_0xf85e('0x5b')]({'where':{'id':_0xdda3b3[_0xf85e('0xc0')]['id']}})[_0xf85e('0x1d')](handleEntityNotFound(_0x4cb5ca,null))[_0xf85e('0x1d')](removeEntity(_0x4cb5ca,null))['catch'](handleError(_0x4cb5ca,null));};exports[_0xf85e('0xc6')]=function(_0x188617,_0x39e2b3){return db[_0xf85e('0x2f')][_0xf85e('0xc6')]()[_0xf85e('0x1d')](respondWithResult(_0x39e2b3,null))[_0xf85e('0x2c')](handleError(_0x39e2b3,null));};exports[_0xf85e('0xc7')]=function(_0x2b5620,_0x4f29ea){return db['MailMessage'][_0xf85e('0x5b')]({'where':{'id':_0x2b5620[_0xf85e('0xc0')]['id']}})[_0xf85e('0x1d')](handleEntityNotFound(_0x4f29ea,null))[_0xf85e('0x1d')](function(_0x18c5a0){if(_0x18c5a0){return _0x18c5a0[_0xf85e('0xc7')](_0x2b5620[_0xf85e('0xc5')]['ids'],_[_0xf85e('0xc8')](_0x2b5620[_0xf85e('0xc5')],[_0xf85e('0xc9'),'id'])||{});}})['then'](respondWithResult(_0x4f29ea,null))['catch'](handleError(_0x4f29ea,null));};exports['getMessages']=function(_0x25ec72,_0x1c0252){var _0x2a2016={'raw':![],'where':{}};var _0x5eb1cc={};var _0x3388be={'count':0x0,'rows':[]};return db['MailInteraction'][_0xf85e('0x28')]({'where':{'id':_0x25ec72[_0xf85e('0xc0')]['id']}})['then'](handleEntityNotFound(_0x1c0252,null))[_0xf85e('0x1d')](function(_0x54f8cd){if(_0x54f8cd){_0x5eb1cc[_0xf85e('0x36')]=_['keys'](db[_0xf85e('0x27')][_0xf85e('0x30')]);_0x5eb1cc[_0xf85e('0x34')]=_[_0xf85e('0x35')](_0x25ec72['query']);_0x5eb1cc['filters']=_[_0xf85e('0x38')](_0x5eb1cc[_0xf85e('0x36')],_0x5eb1cc[_0xf85e('0x34')]);_0x2a2016[_0xf85e('0x37')]=_[_0xf85e('0x38')](_0x5eb1cc['model'],qs[_0xf85e('0x39')](_0x25ec72[_0xf85e('0x34')][_0xf85e('0x39')]));_0x2a2016[_0xf85e('0x37')]=_0x2a2016['attributes'][_0xf85e('0x3a')]?_0x2a2016['attributes']:_0x5eb1cc['model'];if(!_0x25ec72[_0xf85e('0x34')][_0xf85e('0x3b')]('nolimit')){_0x2a2016[_0xf85e('0x19')]=qs['limit'](_0x25ec72['query'][_0xf85e('0x19')]);_0x2a2016[_0xf85e('0x17')]=qs[_0xf85e('0x17')](_0x25ec72[_0xf85e('0x34')]['offset']);}_0x2a2016[_0xf85e('0x8c')]=qs[_0xf85e('0x3d')](_0x25ec72[_0xf85e('0x34')]['sort']);_0x2a2016['where']=qs['filters'](_[_0xf85e('0x40')](_0x25ec72[_0xf85e('0x34')],_0x5eb1cc['filters']));_0x2a2016['where'][_0xf85e('0xca')]=_0x54f8cd['id'];if(_0x25ec72['query'][_0xf85e('0x81')]){_0x2a2016[_0xf85e('0x3e')]=_[_0xf85e('0x99')](_0x2a2016[_0xf85e('0x3e')],{'$or':_[_0xf85e('0x2e')](_0x2a2016['attributes'],function(_0xce8aab){var _0x2a96b5={};_0x2a96b5[_0xce8aab]={'$like':'%'+_0x25ec72[_0xf85e('0x34')]['filter']+'%'};return _0x2a96b5;})});}if(_0x25ec72['query'][_0xf85e('0x76')]){var _0x57428c=_0x25ec72['query']['$gte'][_0xf85e('0x64')](',');var _0x3e093f={};_0x3e093f[_0x57428c[0x0]]={'$gte':moment(_0x57428c[0x1])[_0xf85e('0xcb')](_0xf85e('0xcc'))};_0x2a2016[_0xf85e('0x3e')]=_[_0xf85e('0x99')](_0x2a2016[_0xf85e('0x3e')],_0x3e093f);}_0x2a2016=_[_0xf85e('0x99')]({},_0x2a2016,_0x25ec72['options']);return db[_0xf85e('0x27')][_0xf85e('0x1a')]({'where':_0x2a2016[_0xf85e('0x3e')]})[_0xf85e('0x1d')](function(_0x5a831b){_0x3388be[_0xf85e('0x1a')]=_0x5a831b;if(_0x25ec72['query'][_0xf85e('0xc1')]){_0x2a2016[_0xf85e('0xc2')]=[{'all':!![]}];}return db[_0xf85e('0x27')][_0xf85e('0xcd')](_0x2a2016);})[_0xf85e('0x1d')](function(_0x3977ed){if(_0x25ec72[_0xf85e('0x34')][_0xf85e('0xce')]===_0xf85e('0xcf')){for(var _0x39dea3=0x0;_0x39dea3<_0x3977ed[_0xf85e('0x3a')];_0x39dea3++){_0x3977ed[_0x39dea3][_0xf85e('0xc5')]=juice(_0x3977ed[_0x39dea3]['body']);}}_0x3388be[_0xf85e('0xbe')]=_0x3977ed;return _0x3388be;});}})[_0xf85e('0x1d')](respondWithFilteredResult(_0x1c0252,_0x2a2016))[_0xf85e('0x2c')](handleError(_0x1c0252,null));};exports['addTags']=function(_0x32610a,_0x1cc901){return db[_0xf85e('0x2f')]['find']({'where':{'id':_0x32610a[_0xf85e('0xc0')]['id']}})[_0xf85e('0x1d')](handleEntityNotFound(_0x1cc901,null))[_0xf85e('0x1d')](function(_0x2b67c5){if(_0x2b67c5){return _0x2b67c5['setTags'](_0x32610a[_0xf85e('0xc5')]['ids'],_[_0xf85e('0xc8')](_0x32610a[_0xf85e('0xc5')],[_0xf85e('0xc9'),'id'])||{})['spread'](function(){return db[_0xf85e('0xd0')]['findAll']({'attributes':['id',_0xf85e('0x20'),'color'],'where':{'id':_0x32610a[_0xf85e('0xc5')][_0xf85e('0xc9')]}});})[_0xf85e('0x1d')](function(_0x3cedf8){socket[_0xf85e('0xd1')](_0xf85e('0xd2'),{'id':Number(_0x32610a[_0xf85e('0xc0')]['id']),'tags':_0x3cedf8||[]});return{'id':Number(_0x32610a[_0xf85e('0xc0')]['id']),'tags':_0x3cedf8||[]};});}})['then'](respondWithResult(_0x1cc901,null))[_0xf85e('0x2c')](handleError(_0x1cc901,null));};exports['removeTags']=function(_0x169c29,_0x1a7a40){return db[_0xf85e('0x2f')][_0xf85e('0x5b')]({'where':{'id':_0x169c29[_0xf85e('0xc0')]['id']}})[_0xf85e('0x1d')](handleEntityNotFound(_0x1a7a40,null))[_0xf85e('0x1d')](function(_0xbd6a9){if(_0xbd6a9){return _0xbd6a9[_0xf85e('0xd3')](_0x169c29[_0xf85e('0x34')]['ids']);}})[_0xf85e('0x1d')](respondWithStatusCode(_0x1a7a40,null))[_0xf85e('0x2c')](handleError(_0x1a7a40,null));};exports[_0xf85e('0xd4')]=function(_0x42e962,_0x1a5393){var _0x162cfa=moment()['unix']()[_0xf85e('0x97')]();var _0x5ac04d=path[_0xf85e('0xd5')](config['root'],_0xf85e('0xd6'),_0xf85e('0xd7'),_0xf85e('0xd8'));var _0x1d0074=path[_0xf85e('0xd5')](config['root'],_0xf85e('0xd6'),_0xf85e('0xd7'),_0xf85e('0xd9'));var _0x1d2c00=path[_0xf85e('0xd5')](_0x5ac04d,_0x162cfa);var _0x5b8f53=util[_0xf85e('0xcb')]('transcript-%d-%s.zip',_0x42e962[_0xf85e('0xc0')]['id'],_0x162cfa);var _0x3ac9c2=path[_0xf85e('0xd5')](_0x5ac04d,_0x5b8f53);var _0x5ccd2a=[];if(_0x42e962['query'][_0xf85e('0xd9')]){_0x5ccd2a[_0xf85e('0xbd')]({'model':db[_0xf85e('0xda')],'as':_0xf85e('0xdb'),'raw':!![]});}var _0xbf1df2=[{'model':db[_0xf85e('0x27')],'as':_0xf85e('0xdc'),'attributes':['id',_0xf85e('0xc5'),_0xf85e('0x43'),'to','cc',_0xf85e('0xdd'),_0xf85e('0xde'),_0xf85e('0x74')],'where':{'secret':![]},'order':qs[_0xf85e('0x3d')]('id'),'include':_0x5ccd2a}];return db['MailInteraction'][_0xf85e('0x5b')]({'where':{'id':_0x42e962['params']['id']},'include':_0xbf1df2})[_0xf85e('0x1d')](handleEntityNotFound(_0x1a5393,null))['then'](function(_0x31789c){if(_0x31789c&&_0x31789c[_0xf85e('0xdc')]){var _0xb7eed2=_0x31789c[_0xf85e('0xdf')]({'plain':!![]});fs[_0xf85e('0xe0')](_0x1d2c00);return BPromise[_0xf85e('0xe1')](_0xb7eed2[_0xf85e('0xdc')],function(_0x191f69,_0x2de7a4){var _0x2b3e95={'from':_0x191f69[_0xf85e('0x43')],'to':_0x191f69['to'],'subject':_0x191f69['subject'],'html':htmlEntities[_0xf85e('0xe2')](_0x191f69[_0xf85e('0xc5')]),'headers':{'Date':moment(_0x191f69[_0xf85e('0x74')])[_0xf85e('0xcb')](_0xf85e('0xe3'))},'attachments':[]};if(_0x191f69['cc']){_0x2b3e95[_0xf85e('0xe4')]['Cc']=_0x191f69['cc'];}if(_0x191f69['bcc']){_0x2b3e95['headers']['Bcc']=_0x191f69[_0xf85e('0xdd')];}return new BPromise(function(_0x2b5b74,_0x14506a){if(_0x191f69[_0xf85e('0xdb')]){for(var _0x4b7ae9=0x0;_0x4b7ae9<_0x191f69['Attachments']['length'];_0x4b7ae9++){var _0x3b1f26=_0x191f69['Attachments'][_0x4b7ae9];var _0x3940a4=path[_0xf85e('0xd5')](_0x1d0074,_0x3b1f26[_0xf85e('0xe5')]);if(fs[_0xf85e('0xe6')](_0x3940a4)){_0x2b3e95[_0xf85e('0xd9')]['push']({'name':_0x3b1f26[_0xf85e('0x20')],'contentType':_0x3b1f26[_0xf85e('0x32')],'data':fs[_0xf85e('0xe7')](_0x3940a4)});}}}emlformat[_0xf85e('0xe8')](_0x2b3e95,function(_0x3851a1,_0x196fde){if(_0x3851a1)return _0x14506a(_0x3851a1);fs['writeFileSync'](path[_0xf85e('0xd5')](_0x1d2c00,util[_0xf85e('0xcb')](_0xf85e('0xe9'),_0x2de7a4)),_0x196fde);return _0x2b5b74(_0x196fde);});});})[_0xf85e('0x1d')](function(){return new BPromise(function(_0x24fcac,_0x696fe5){zipdir(_0x1d2c00,{'saveTo':_0x3ac9c2},function(_0x4c6db5,_0x24e7e9){if(_0x4c6db5)return _0x696fe5(_0x4c6db5);return _0x24fcac(_0x24e7e9);});})[_0xf85e('0x1d')](function(){return new BPromise(function(_0x5138d8,_0x33ca72){rimraf(_0x1d2c00,function(_0x323f40){if(_0x323f40)_0x33ca72(_0x323f40);return _0x5138d8();});});})[_0xf85e('0x1d')](function(){return _0x1a5393[_0xf85e('0xd4')](_0x3ac9c2,_0x5b8f53,function(_0x38a22b){if(!_0x38a22b)fs[_0xf85e('0xea')](_0x3ac9c2);});});});}else{return _0x1a5393[_0xf85e('0x13')](0xc8);}})[_0xf85e('0x2c')](handleError(_0x1a5393,null));}; \ No newline at end of file +var _0xbe4e=['split','forEach','push','MailMessage','findOne','out','plainBody','trimStart','catch','MailInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','user_has_mail_interactions','left_join','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','show','includeAll','merge','options','create','body','update','params','describe','addMessage','ids','MailInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','true','addTags','setTags','spread','emit','unix','root','server','tmp','join','files','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','message%d.eml','download','unlinkSync','rimraf','moment','util','lodash','juice','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','stack','name','send','Users','map','fullname','TagIds','Tags'];(function(_0x2c0a05,_0x4ddbbe){var _0xc473cb=function(_0x5f0674){while(--_0x5f0674){_0x2c0a05['push'](_0x2c0a05['shift']());}};_0xc473cb(++_0x4ddbbe);}(_0xbe4e,0x1a9));var _0xebe4=function(_0x3e1555,_0xd901c2){_0x3e1555=_0x3e1555-0x0;var _0x14824b=_0xbe4e[_0x3e1555];return _0x14824b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebe4('0x0'));var zipdir=require('zip-dir');var moment=require(_0xebe4('0x1'));var BPromise=require('bluebird');var util=require(_0xebe4('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xebe4('0x3'));var squel=require('squel');var juice=require(_0xebe4('0x4'));var Redis=require('ioredis');var qs=require(_0xebe4('0x5'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xebe4('0x6'))('api');var config=require(_0xebe4('0x7'));var db=require(_0xebe4('0x8'))['db'];var htmlEntities=require('html-entities');config[_0xebe4('0x9')]=_[_0xebe4('0xa')](config['redis'],{'host':_0xebe4('0xb'),'port':0x18eb});var socket=require(_0xebe4('0xc'))(new Redis(config[_0xebe4('0x9')]));require(_0xebe4('0xd'))[_0xebe4('0xe')](socket);function respondWithStatusCode(_0x3fa5b1,_0x4cf4df){_0x4cf4df=_0x4cf4df||0xcc;return function(_0x497034){if(_0x497034){return _0x3fa5b1[_0xebe4('0xf')](_0x4cf4df);}return _0x3fa5b1[_0xebe4('0x10')](_0x4cf4df)[_0xebe4('0x11')]();};}function respondWithResult(_0x3f97e3,_0x3f2c9d){_0x3f2c9d=_0x3f2c9d||0xc8;return function(_0x42d2f0){if(_0x42d2f0){return _0x3f97e3[_0xebe4('0x10')](_0x3f2c9d)[_0xebe4('0x12')](_0x42d2f0);}};}function respondWithFilteredResult(_0x3f39c8,_0x540d8a){return function(_0xb14d31){if(_0xb14d31){var _0x160907=typeof _0x540d8a[_0xebe4('0x13')]===_0xebe4('0x14')&&typeof _0x540d8a[_0xebe4('0x15')]==='undefined';var _0xa056e9=_0xb14d31[_0xebe4('0x16')];var _0x3a1afa=_0x160907?0x0:_0x540d8a[_0xebe4('0x13')];var _0x47d76b=_0x160907?_0xb14d31[_0xebe4('0x16')]:_0x540d8a[_0xebe4('0x13')]+_0x540d8a['limit'];var _0x25f8d7;if(_0x47d76b>=_0xa056e9){_0x47d76b=_0xa056e9;_0x25f8d7=0xc8;}else{_0x25f8d7=0xce;}_0x3f39c8[_0xebe4('0x10')](_0x25f8d7);return _0x3f39c8[_0xebe4('0x17')](_0xebe4('0x18'),_0x3a1afa+'-'+_0x47d76b+'/'+_0xa056e9)['json'](_0xb14d31);}return null;};}function saveUpdates(_0x160504){return function(_0x3996ff){if(_0x3996ff){return _0x3996ff['update'](_0x160504)['then'](function(_0x5c2859){return _0x5c2859;});}return null;};}function removeEntity(_0xfd1601){return function(_0x106c27){if(_0x106c27){return _0x106c27[_0xebe4('0x19')]()[_0xebe4('0x1a')](function(){_0xfd1601[_0xebe4('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x534e52){return function(_0x3285a8){if(!_0x3285a8){_0x534e52[_0xebe4('0xf')](0x194);}return _0x3285a8;};}function handleError(_0x28cb2b,_0x573655){_0x573655=_0x573655||0x1f4;return function(_0x2f6db8){logger['error'](_0x2f6db8[_0xebe4('0x1b')]);if(_0x2f6db8[_0xebe4('0x1c')]){delete _0x2f6db8[_0xebe4('0x1c')];}_0x28cb2b[_0xebe4('0x10')](_0x573655)[_0xebe4('0x1d')](_0x2f6db8);};}function getInteractionUsers(_0x214f00,_0x1b9216){return new BPromise(function(_0x49f526,_0x2081af){try{if(_0x1b9216[_0x214f00['id']]){_0x214f00[_0xebe4('0x1e')]=_[_0xebe4('0x1f')](_0x1b9216[_0x214f00['id']],function(_0x225f12){return{'id':_0x225f12['id'],'fullname':_0x225f12[_0xebe4('0x20')]};});}}catch(_0x2d191d){_0x2081af(_0x2d191d);}_0x49f526(_0x214f00);});}function getInteractionTags(_0xf45745,_0x34c84f){return new BPromise(function(_0x273c96,_0x35afd1){try{if(_0xf45745[_0xebe4('0x21')]){_0xf45745[_0xebe4('0x22')]=[];_0xf45745[_0xebe4('0x21')][_0xebe4('0x23')](',')[_0xebe4('0x24')](function(_0x4a51cb){_0xf45745['Tags'][_0xebe4('0x25')](_0x34c84f[_0x4a51cb]);});}delete _0xf45745[_0xebe4('0x21')];}catch(_0x5761b5){_0x35afd1(_0x5761b5);}_0x273c96(_0xf45745);});}function getLastMessageText(_0x178ecf){return new BPromise(function(_0x7ca9c4,_0xa9c840){return db[_0xebe4('0x26')][_0xebe4('0x27')]({'where':{'$and':[{'MailInteractionId':_0x178ecf['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xebe4('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})['then'](function(_0x18cf0a){if(_0x18cf0a&&_0x18cf0a[_0xebe4('0x29')]){_0x178ecf['lastMsgText']=_[_0xebe4('0x2a')](_0x18cf0a['plainBody']);}_0x7ca9c4(_0x178ecf);})[_0xebe4('0x2b')](function(_0x52f89e){_0xa9c840(_0x52f89e);});});}function updateMailInteraction(_0x51f272,_0x4484b3,_0x11ee71,_0x2a525a){return new BPromise(function(_0x2e9071,_0x46a549){return getInteractionUsers(_0x51f272,_0x11ee71)[_0xebe4('0x1a')](function(_0x1e3130){return getInteractionTags(_0x1e3130,_0x4484b3);})[_0xebe4('0x1a')](function(_0x25f99d){if(_0x2a525a){_0x2e9071(getLastMessageText(_0x25f99d));}else{_0x2e9071(_0x25f99d);}})[_0xebe4('0x2b')](function(_0x4273cf){_0x46a549(_0x4273cf);});});}exports['index']=function(_0x15eee3,_0x3da523){var _0x2bc157={},_0x38a8ba={},_0xea4ed1={'count':0x0,'rows':[]};var _0xc2a2e3=_['map'](db[_0xebe4('0x2c')][_0xebe4('0x2d')],function(_0x3993f2){return{'name':_0x3993f2[_0xebe4('0x2e')],'type':_0x3993f2[_0xebe4('0x2f')][_0xebe4('0x30')]};});_0x38a8ba[_0xebe4('0x31')]=_['map'](_0xc2a2e3,_0xebe4('0x1c'));_0x38a8ba[_0xebe4('0x32')]=_[_0xebe4('0x33')](_0x15eee3[_0xebe4('0x32')]);_0x38a8ba[_0xebe4('0x34')]=_[_0xebe4('0x35')](_0x38a8ba[_0xebe4('0x31')],_0x38a8ba[_0xebe4('0x32')]);_0x2bc157[_0xebe4('0x36')]=_[_0xebe4('0x35')](_0x38a8ba['model'],qs[_0xebe4('0x37')](_0x15eee3[_0xebe4('0x32')][_0xebe4('0x37')]));_0x2bc157['attributes']=_0x2bc157[_0xebe4('0x36')][_0xebe4('0x38')]?_0x2bc157[_0xebe4('0x36')]:_0x38a8ba[_0xebe4('0x31')];if(!_0x15eee3[_0xebe4('0x32')][_0xebe4('0x39')](_0xebe4('0x3a'))){_0x2bc157['limit']=qs[_0xebe4('0x15')](_0x15eee3[_0xebe4('0x32')][_0xebe4('0x15')]);_0x2bc157[_0xebe4('0x13')]=qs[_0xebe4('0x13')](_0x15eee3[_0xebe4('0x32')][_0xebe4('0x13')]);}_0x2bc157[_0xebe4('0x3b')]=qs['sort'](_0x15eee3[_0xebe4('0x32')][_0xebe4('0x3c')]);_0x2bc157[_0xebe4('0x3d')]=qs[_0xebe4('0x34')](_[_0xebe4('0x3e')](_0x15eee3['query'],_0x38a8ba[_0xebe4('0x34')]),_0xc2a2e3);var _0x2e52f1=[];var _0x5ef4c9=squel[_0xebe4('0x3f')]()[_0xebe4('0x40')]('id')[_0xebe4('0x40')](_0xebe4('0x1c'))[_0xebe4('0x40')](_0xebe4('0x41'))[_0xebe4('0x42')](_0xebe4('0x43'));var _0x2df707=squel[_0xebe4('0x3f')]()[_0xebe4('0x40')]('u.id')[_0xebe4('0x40')](_0xebe4('0x44'))[_0xebe4('0x40')]('ui.MailInteractionId')[_0xebe4('0x42')](_0xebe4('0x45'),'ui')[_0xebe4('0x46')]('users','u','u.id\x20=\x20ui.UserId');var _0x463875=squel[_0xebe4('0x3f')]()[_0xebe4('0x42')](_0xebe4('0x47'),'i')['left_join']('cm_contacts','c',_0xebe4('0x48'))[_0xebe4('0x46')](_0xebe4('0x49'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xebe4('0x4a'),'a',_0xebe4('0x4b'))[_0xebe4('0x46')](_0xebe4('0x4c'),'me',_0xebe4('0x4d'))[_0xebe4('0x46')](_0xebe4('0x4e'),'it','it.MailInteractionId\x20=\x20i.id')[_0xebe4('0x46')](_0xebe4('0x43'),'t',_0xebe4('0x4f'));var _0x4ebeeb=squel[_0xebe4('0x50')]();var _0x4d19cc=[];var _0x1f875a=squel[_0xebe4('0x50')]();var _0x1562a5;if(_0x15eee3[_0xebe4('0x32')][_0xebe4('0x51')]){_0x1562a5=as[_0xebe4('0x52')](_0x15eee3[_0xebe4('0x32')][_0xebe4('0x51')]);var _0xea97b=_0x1562a5[_0xebe4('0x53')];for(var _0x579e12=0x0;_0x579e12<_0x1562a5[_0xebe4('0x54')][_0xebe4('0x38')];_0x579e12++){var _0x339a63=_0x1562a5[_0xebe4('0x54')][_0x579e12];var _0xecbe54='i';var _0x485f6f=_[_0xebe4('0x55')](_0xc2a2e3,[_0xebe4('0x1c'),_0x339a63[_0xebe4('0x40')]]);if(!_0x485f6f){switch(_0x339a63[_0xebe4('0x40')]){case _0xebe4('0x56'):if(_0x339a63['value']==0x1){_0x463875[_0xebe4('0x57')]('`'+_0x339a63[_0xebe4('0x40')]+'`\x20=\x200');}else{_0x463875[_0xebe4('0x57')]('`'+_0x339a63[_0xebe4('0x40')]+_0xebe4('0x58'));}break;case'Contact':if(_0x339a63[_0xebe4('0x59')]===_0xebe4('0x5a')){if(_0x339a63[_0xebe4('0x5b')][_0xebe4('0x23')]('\x20')[_0xebe4('0x38')]>0x1){_0x4ebeeb[_0xea97b](_0xebe4('0x5c'),qs[_0xebe4('0x5d')](_0x339a63['value']),null);}else{var _0x22cb5f='%'+_0x339a63[_0xebe4('0x5b')]+'%';_0x4ebeeb[_0xea97b](_0xebe4('0x5e'),_0x22cb5f,_0x22cb5f,_0x22cb5f);}}else{_0x485f6f=_[_0xebe4('0x55')](_0xc2a2e3,[_0xebe4('0x1c'),'ContactId']);_0x339a63['field']=_0xebe4('0x5f');_0x428659=as[_0xebe4('0x60')](_0xecbe54,_0x485f6f[_0xebe4('0x2f')],_0x339a63);_0x4ebeeb[_0xea97b](_0x428659['text'],_0x428659[_0xebe4('0x5b')][_0xebe4('0x61')],_0x428659[_0xebe4('0x5b')]['end']);}break;case _0xebe4('0x62'):var _0x11cbbf=_0x339a63['value'][_0xebe4('0x23')](',')[_0xebe4('0x1f')](function(_0x365a99){return Number(_0x365a99);});_0x11cbbf['forEach'](function(_0x297a77){_0x1f875a['or'](_0xebe4('0x63'),'%,'+_0x297a77+',%');});_0x4d19cc=_[_0xebe4('0x64')](_0x4d19cc,_0x11cbbf);break;case _0xebe4('0x65'):if(_0x339a63[_0xebe4('0x59')]===_0xebe4('0x5a')){_0x4ebeeb[_0xea97b](_0xebe4('0x66'),'%'+_0x339a63['value']+'%',null);}else{_0x485f6f=_[_0xebe4('0x55')](_0xc2a2e3,[_0xebe4('0x1c'),_0xebe4('0x67')]);_0x339a63[_0xebe4('0x40')]=_0xebe4('0x67');_0x428659=as[_0xebe4('0x60')](_0xecbe54,_0x485f6f[_0xebe4('0x2f')],_0x339a63);_0x4ebeeb[_0xea97b](_0x428659[_0xebe4('0x68')],_0x428659[_0xebe4('0x5b')][_0xebe4('0x61')],_0x428659[_0xebe4('0x5b')][_0xebe4('0x11')]);}break;case _0xebe4('0x29'):_0x428659=as[_0xebe4('0x60')]('me',null,_0x339a63);_0x4ebeeb[_0xea97b](_0x428659[_0xebe4('0x68')],_0x428659[_0xebe4('0x5b')][_0xebe4('0x61')],_0x428659[_0xebe4('0x5b')][_0xebe4('0x11')]);break;}}else{var _0x428659=as[_0xebe4('0x60')](_0xecbe54,_0x485f6f['type'],_0x339a63);_0x4ebeeb[_0xea97b](_0x428659['text'],_0x428659[_0xebe4('0x5b')]['start'],_0x428659['value'][_0xebe4('0x11')]);}}}else{var _0x238663=_(_0x15eee3[_0xebe4('0x32')])[_0xebe4('0x33')]()[_0xebe4('0x1f')](function(_0x4003a9){return _[_0xebe4('0x69')](_0xc2a2e3,[_0xebe4('0x1c'),_0x4003a9])?_0x4003a9:undefined;})[_0xebe4('0x6a')]()[_0xebe4('0x5b')]();if(!_[_0xebe4('0x6b')](_0x238663)){_0x238663['forEach'](function(_0x34929c){if(_0x34929c==='MailAccountId'){_0x463875[_0xebe4('0x3d')](_0xebe4('0x6c'),[]['concat'](_0x15eee3['query'][_0x34929c]));}else if(_0x34929c===_0xebe4('0x6d')){var _0xce12de=JSON[_0xebe4('0x6e')](_0x15eee3[_0xebe4('0x32')][_0x34929c])['$gte'];var _0x253362=JSON[_0xebe4('0x6e')](_0x15eee3['query'][_0x34929c])[_0xebe4('0x6f')];_0x463875[_0xebe4('0x3d')](_0xebe4('0x70'),_0xce12de,_0x253362);}else{if(_0x15eee3[_0xebe4('0x32')][_0x34929c]===_0xebe4('0x71')){_0x463875[_0xebe4('0x3d')]('i.'+_0x34929c+_0xebe4('0x72'));}else{_0x463875['where']('i.'+_0x34929c+_0xebe4('0x73'),_0x15eee3[_0xebe4('0x32')][_0x34929c]);}}});}if(_0x15eee3[_0xebe4('0x32')][_0xebe4('0x74')]){if(_0x15eee3[_0xebe4('0x32')][_0xebe4('0x74')]==0x1){_0x463875['having'](_0xebe4('0x75'));}else{_0x463875[_0xebe4('0x57')](_0xebe4('0x76'));}}if(_0x15eee3['query'][_0xebe4('0x77')]){_0x4d19cc=_[_0xebe4('0x78')](_0x15eee3[_0xebe4('0x32')]['tag'])?_0x15eee3[_0xebe4('0x32')]['tag']:new Array(_0x15eee3['query'][_0xebe4('0x77')]);_0x4d19cc[_0xebe4('0x24')](function(_0x543d80){_0x1f875a['or'](_0xebe4('0x63'),'%,'+_0x543d80+',%');});}if(_0x15eee3['query'][_0xebe4('0x79')]){var _0x343b77=_0x15eee3[_0xebe4('0x32')][_0xebe4('0x79')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xebe4('0x7a')](_0x343b77)){_0x4ebeeb['or']('i.id\x20LIKE\x20?',_0x343b77+'%');}else if(qs[_0xebe4('0x7b')](_0x343b77)){_0x4ebeeb['or']('c.email\x20LIKE\x20?',_0x343b77+'%');}else{_0x4ebeeb['or'](_0xebe4('0x7c'),qs[_0xebe4('0x5d')](_0x343b77))['or'](_0xebe4('0x7d'),qs[_0xebe4('0x5d')](_0x343b77));}}}_0x463875[_0xebe4('0x3d')](_0x4ebeeb);_0x463875[_0xebe4('0x7e')](_0xebe4('0x7f'));var _0x24d5c4={'type':db[_0xebe4('0x80')][_0xebe4('0x81')][_0xebe4('0x82')],'raw':!![]};var _0x47005d=_0x463875[_0xebe4('0x83')]();_0x47005d[_0xebe4('0x40')](_0xebe4('0x7f'));_0x47005d[_0xebe4('0x40')](_0xebe4('0x84'),_0xebe4('0x56'));if(_0x2bc157[_0xebe4('0x3b')]){_0x2bc157[_0xebe4('0x3b')][_0xebe4('0x24')](function(_0x17cf3d){var _0x5364a3=_0x17cf3d[0x0]===_0xebe4('0x85')?_0x17cf3d[0x0]:'i.'+_0x17cf3d[0x0];_0x463875[_0xebe4('0x3b')](_0x5364a3,_0x17cf3d[0x1]===_0xebe4('0x86')?![]:!![]);});}if(!_[_0xebe4('0x6b')](_0x4d19cc)){_0x463875[_0xebe4('0x57')](_0x1f875a);_0x47005d['where'](_0xebe4('0x87'),_0x4d19cc);}BPromise['resolve']()[_0xebe4('0x1a')](function(){if(!_0x1562a5){if(_0x15eee3[_0xebe4('0x32')][_0xebe4('0x88')])return;_0x47005d[_0xebe4('0x3d')](_0xebe4('0x89'));_0x463875[_0xebe4('0x3d')](_0xebe4('0x89'));return;}if(_0x15eee3[_0xebe4('0x8a')][_0xebe4('0x8b')]!==_0xebe4('0x8c'))return;return _0x15eee3[_0xebe4('0x8a')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xebe4('0x1a')](function(_0x4c4332){if(_['isEmpty'](_0x4c4332)){_0x47005d[_0xebe4('0x3d')]('i.MailAccountId\x20IS\x20NULL');_0x463875['where'](_0xebe4('0x8d'));}else{_0x47005d[_0xebe4('0x3d')](_0xebe4('0x6c'),_['map'](_0x4c4332,'id'));_0x463875['where'](_0xebe4('0x6c'),_[_0xebe4('0x1f')](_0x4c4332,'id'));}});})[_0xebe4('0x1a')](function(){if(_0x15eee3['user']['role']===_0xebe4('0x8c')&&!_0x1562a5&&!_0x15eee3[_0xebe4('0x32')][_0xebe4('0x88')])return[];return db[_0xebe4('0x8e')][_0xebe4('0x32')](_0x47005d[_0xebe4('0x8f')](),_0x24d5c4);})[_0xebe4('0x1a')](function(_0x16217d){_0xea4ed1[_0xebe4('0x16')]=_0x16217d[_0xebe4('0x38')];if(_0xea4ed1[_0xebe4('0x16')]===0x0)return[];return db[_0xebe4('0x8e')]['query'](_0x5ef4c9[_0xebe4('0x8f')](),_0x24d5c4)['then'](function(_0x43af6f){_0x2e52f1=_[_0xebe4('0x90')](_0x43af6f,'id');_0x24d5c4=_['merge'](_0x24d5c4,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15eee3[_0xebe4('0x32')][_0xebe4('0x37')]){_0x2bc157['attributes'][_0xebe4('0x24')](function(_0x42b589){_0x463875[_0xebe4('0x40')]('i.'+_0x42b589);});}else{_0x463875[_0xebe4('0x40')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xebe4('0x56'));_0x463875[_0xebe4('0x40')](_0xebe4('0x91'),_0xebe4('0x92'));_0x463875['field'](_0xebe4('0x93'),'Account.mandatoryDisposition');_0x463875[_0xebe4('0x40')](_0xebe4('0x94'),_0xebe4('0x85'));_0x463875[_0xebe4('0x40')](_0xebe4('0x7f'));_0x463875[_0xebe4('0x40')](_0xebe4('0x95'));_0x463875['field'](_0xebe4('0x96'));_0x463875[_0xebe4('0x40')](_0xebe4('0x97'));_0x463875[_0xebe4('0x40')](_0xebe4('0x98'));_0x463875[_0xebe4('0x40')](_0xebe4('0x99'));_0x463875[_0xebe4('0x40')](_0xebe4('0x9a'));_0x463875['field'](_0xebe4('0x9b'));_0x463875['field'](_0xebe4('0x9c'));_0x463875['field'](_0xebe4('0x9d'));_0x463875[_0xebe4('0x40')](_0xebe4('0x9e'));_0x463875[_0xebe4('0x40')](_0xebe4('0x9f'));_0x463875['field']('i.substatus');_0x463875[_0xebe4('0x40')](_0xebe4('0xa0'));_0x463875[_0xebe4('0x40')]('i.ContactId');_0x463875[_0xebe4('0x40')](_0xebe4('0xa1'));_0x463875['field'](_0xebe4('0xa2'));_0x463875[_0xebe4('0x40')](_0xebe4('0xa3'),_0xebe4('0xa4'));_0x463875[_0xebe4('0x40')]('c.lastName',_0xebe4('0xa5'));_0x463875[_0xebe4('0x40')](_0xebe4('0xa6'),_0xebe4('0xa7'));_0x463875[_0xebe4('0x40')](_0xebe4('0xa8'),'Contact.phone');_0x463875[_0xebe4('0x40')](_0xebe4('0xa9'),_0xebe4('0xaa'));_0x463875[_0xebe4('0x40')](_0xebe4('0xab'),_0xebe4('0xac'));_0x463875[_0xebe4('0x40')](_0xebe4('0xad'),'Owner.fullname');_0x463875['field']('o.internal',_0xebe4('0xae'));_0x463875[_0xebe4('0x40')](_0xebe4('0xaf'),'TagIds');}if(_0x2bc157[_0xebe4('0x15')])_0x463875[_0xebe4('0x15')](_0x2bc157[_0xebe4('0x15')]);if(_0x2bc157[_0xebe4('0x13')])_0x463875[_0xebe4('0x13')](_0x2bc157['offset']);return db[_0xebe4('0x8e')][_0xebe4('0x32')](_0x463875[_0xebe4('0x8f')](),_0x24d5c4);})[_0xebe4('0x1a')](function(_0x497489){if(_0x497489[_0xebe4('0x38')]>0x0)_0x2df707[_0xebe4('0x3d')](_0xebe4('0xb0'),_[_0xebe4('0x1f')](_0x497489,'id'));return db[_0xebe4('0x8e')][_0xebe4('0x32')](_0x2df707[_0xebe4('0x8f')](),_0x24d5c4)['then'](function(_0x43d869){var _0x1ce54a=_[_0xebe4('0xb1')](_0x43d869,'MailInteractionId');var _0x2be090=[];return db[_0xebe4('0xb2')][_0xebe4('0x27')]({'attributes':[_0xebe4('0xb3')],'raw':!![]})['then'](function(_0x1555b6){var _0x3da0ed=_0x1555b6['enableEmailPreview'];_0x497489[_0xebe4('0x24')](function(_0x4fa352){_0x2be090['push'](updateMailInteraction(_0x4fa352,_0x2e52f1,_0x1ce54a,_0x3da0ed));});return BPromise[_0xebe4('0xb4')](_0x2be090);});});});})['then'](function(_0x2537f4){_0xea4ed1[_0xebe4('0xb5')]=_0x2537f4;return _0xea4ed1;})[_0xebe4('0x1a')](respondWithFilteredResult(_0x3da523,_0x2bc157))[_0xebe4('0x2b')](handleError(_0x3da523,null));};exports[_0xebe4('0xb6')]=function(_0x337449,_0x99778d){var _0x1b7aba={'raw':![],'where':{'id':_0x337449['params']['id']}},_0xc67b24={};_0xc67b24[_0xebe4('0x31')]=_[_0xebe4('0x33')](db[_0xebe4('0x2c')][_0xebe4('0x2d')]);_0xc67b24[_0xebe4('0x32')]=_[_0xebe4('0x33')](_0x337449['query']);_0xc67b24[_0xebe4('0x34')]=_[_0xebe4('0x35')](_0xc67b24[_0xebe4('0x31')],_0xc67b24[_0xebe4('0x32')]);_0x1b7aba[_0xebe4('0x36')]=_[_0xebe4('0x35')](_0xc67b24[_0xebe4('0x31')],qs[_0xebe4('0x37')](_0x337449['query'][_0xebe4('0x37')]));_0x1b7aba[_0xebe4('0x36')]=_0x1b7aba['attributes'][_0xebe4('0x38')]?_0x1b7aba[_0xebe4('0x36')]:_0xc67b24[_0xebe4('0x31')];if(_0x337449[_0xebe4('0x32')][_0xebe4('0xb7')]){_0x1b7aba['include']=[{'all':!![]}];}_0x1b7aba=_[_0xebe4('0xb8')]({},_0x1b7aba,_0x337449[_0xebe4('0xb9')]);return db[_0xebe4('0x2c')][_0xebe4('0x55')](_0x1b7aba)[_0xebe4('0x1a')](handleEntityNotFound(_0x99778d,null))[_0xebe4('0x1a')](respondWithResult(_0x99778d,null))['catch'](handleError(_0x99778d,null));};exports[_0xebe4('0xba')]=function(_0x482545,_0x29028e){return db['MailInteraction'][_0xebe4('0xba')](_0x482545[_0xebe4('0xbb')],{})[_0xebe4('0x1a')](respondWithResult(_0x29028e,0xc9))[_0xebe4('0x2b')](handleError(_0x29028e,null));};exports[_0xebe4('0xbc')]=function(_0x41221e,_0x5c8d9a){if(_0x41221e['body']['id']){delete _0x41221e[_0xebe4('0xbb')]['id'];}return db[_0xebe4('0x2c')]['find']({'where':{'id':_0x41221e['params']['id']}})[_0xebe4('0x1a')](handleEntityNotFound(_0x5c8d9a,null))[_0xebe4('0x1a')](saveUpdates(_0x41221e[_0xebe4('0xbb')],null))[_0xebe4('0x1a')](respondWithResult(_0x5c8d9a,null))[_0xebe4('0x2b')](handleError(_0x5c8d9a,null));};exports[_0xebe4('0x19')]=function(_0x12dbc4,_0x2038c8){return db[_0xebe4('0x2c')][_0xebe4('0x55')]({'where':{'id':_0x12dbc4[_0xebe4('0xbd')]['id']}})[_0xebe4('0x1a')](handleEntityNotFound(_0x2038c8,null))[_0xebe4('0x1a')](removeEntity(_0x2038c8,null))[_0xebe4('0x2b')](handleError(_0x2038c8,null));};exports[_0xebe4('0xbe')]=function(_0x304231,_0x343d88){return db['MailInteraction'][_0xebe4('0xbe')]()[_0xebe4('0x1a')](respondWithResult(_0x343d88,null))[_0xebe4('0x2b')](handleError(_0x343d88,null));};exports[_0xebe4('0xbf')]=function(_0x130b7c,_0x2d1f76){return db[_0xebe4('0x26')][_0xebe4('0x55')]({'where':{'id':_0x130b7c[_0xebe4('0xbd')]['id']}})[_0xebe4('0x1a')](handleEntityNotFound(_0x2d1f76,null))[_0xebe4('0x1a')](function(_0x5dcd8e){if(_0x5dcd8e){return _0x5dcd8e[_0xebe4('0xbf')](_0x130b7c[_0xebe4('0xbb')][_0xebe4('0xc0')],_['omit'](_0x130b7c['body'],[_0xebe4('0xc0'),'id'])||{});}})[_0xebe4('0x1a')](respondWithResult(_0x2d1f76,null))['catch'](handleError(_0x2d1f76,null));};exports['getMessages']=function(_0x56d03e,_0x25e08a){var _0x30cd55={'raw':![],'where':{}};var _0x2e6838={};var _0x31a838={'count':0x0,'rows':[]};return db[_0xebe4('0x2c')]['findOne']({'where':{'id':_0x56d03e[_0xebe4('0xbd')]['id']}})[_0xebe4('0x1a')](handleEntityNotFound(_0x25e08a,null))[_0xebe4('0x1a')](function(_0x3687ab){if(_0x3687ab){_0x2e6838[_0xebe4('0x31')]=_[_0xebe4('0x33')](db[_0xebe4('0x26')][_0xebe4('0x2d')]);_0x2e6838[_0xebe4('0x32')]=_['keys'](_0x56d03e[_0xebe4('0x32')]);_0x2e6838['filters']=_['intersection'](_0x2e6838[_0xebe4('0x31')],_0x2e6838[_0xebe4('0x32')]);_0x30cd55['attributes']=_[_0xebe4('0x35')](_0x2e6838[_0xebe4('0x31')],qs[_0xebe4('0x37')](_0x56d03e[_0xebe4('0x32')][_0xebe4('0x37')]));_0x30cd55[_0xebe4('0x36')]=_0x30cd55['attributes'][_0xebe4('0x38')]?_0x30cd55[_0xebe4('0x36')]:_0x2e6838[_0xebe4('0x31')];if(!_0x56d03e[_0xebe4('0x32')]['hasOwnProperty'](_0xebe4('0x3a'))){_0x30cd55[_0xebe4('0x15')]=qs[_0xebe4('0x15')](_0x56d03e[_0xebe4('0x32')][_0xebe4('0x15')]);_0x30cd55[_0xebe4('0x13')]=qs[_0xebe4('0x13')](_0x56d03e[_0xebe4('0x32')][_0xebe4('0x13')]);}_0x30cd55[_0xebe4('0x3b')]=qs[_0xebe4('0x3c')](_0x56d03e['query'][_0xebe4('0x3c')]);_0x30cd55['where']=qs['filters'](_[_0xebe4('0x3e')](_0x56d03e[_0xebe4('0x32')],_0x2e6838[_0xebe4('0x34')]));_0x30cd55[_0xebe4('0x3d')][_0xebe4('0xc1')]=_0x3687ab['id'];if(_0x56d03e[_0xebe4('0x32')][_0xebe4('0x79')]){_0x30cd55[_0xebe4('0x3d')]=_[_0xebe4('0xb8')](_0x30cd55[_0xebe4('0x3d')],{'$or':_[_0xebe4('0x1f')](_0x30cd55[_0xebe4('0x36')],function(_0x430be9){var _0x16b7c9={};_0x16b7c9[_0x430be9]={'$like':'%'+_0x56d03e[_0xebe4('0x32')]['filter']+'%'};return _0x16b7c9;})});}if(_0x56d03e[_0xebe4('0x32')]['$gte']){var _0x1ef6d4=_0x56d03e[_0xebe4('0x32')][_0xebe4('0xc2')][_0xebe4('0x23')](',');var _0x2312c1={};_0x2312c1[_0x1ef6d4[0x0]]={'$gte':moment(_0x1ef6d4[0x1])['format'](_0xebe4('0xc3'))};_0x30cd55[_0xebe4('0x3d')]=_[_0xebe4('0xb8')](_0x30cd55[_0xebe4('0x3d')],_0x2312c1);}_0x30cd55=_[_0xebe4('0xb8')]({},_0x30cd55,_0x56d03e[_0xebe4('0xb9')]);return db['MailMessage'][_0xebe4('0x16')]({'where':_0x30cd55[_0xebe4('0x3d')]})[_0xebe4('0x1a')](function(_0x272388){_0x31a838[_0xebe4('0x16')]=_0x272388;if(_0x56d03e[_0xebe4('0x32')]['includeAll']){_0x30cd55[_0xebe4('0xc4')]=[{'all':!![]}];}return db['MailMessage'][_0xebe4('0xc5')](_0x30cd55);})['then'](function(_0x27026f){if(_0x56d03e[_0xebe4('0x32')][_0xebe4('0xc6')]===_0xebe4('0xc7')){for(var _0x370c8f=0x0;_0x370c8f<_0x27026f[_0xebe4('0x38')];_0x370c8f++){_0x27026f[_0x370c8f]['body']=juice(_0x27026f[_0x370c8f]['body']);}}_0x31a838[_0xebe4('0xb5')]=_0x27026f;return _0x31a838;});}})[_0xebe4('0x1a')](respondWithFilteredResult(_0x25e08a,_0x30cd55))[_0xebe4('0x2b')](handleError(_0x25e08a,null));};exports[_0xebe4('0xc8')]=function(_0x2bd58f,_0x4da4ef){return db[_0xebe4('0x2c')][_0xebe4('0x55')]({'where':{'id':_0x2bd58f['params']['id']}})['then'](handleEntityNotFound(_0x4da4ef,null))[_0xebe4('0x1a')](function(_0xebd63d){if(_0xebd63d){return _0xebd63d[_0xebe4('0xc9')](_0x2bd58f[_0xebe4('0xbb')][_0xebe4('0xc0')],_['omit'](_0x2bd58f[_0xebe4('0xbb')],[_0xebe4('0xc0'),'id'])||{})[_0xebe4('0xca')](function(){return db[_0xebe4('0x62')]['findAll']({'attributes':['id',_0xebe4('0x1c'),_0xebe4('0x41')],'where':{'id':_0x2bd58f[_0xebe4('0xbb')][_0xebe4('0xc0')]}});})[_0xebe4('0x1a')](function(_0x3d940a){socket[_0xebe4('0xcb')]('mailInteractionTags:save',{'id':Number(_0x2bd58f[_0xebe4('0xbd')]['id']),'tags':_0x3d940a||[]});return{'id':Number(_0x2bd58f[_0xebe4('0xbd')]['id']),'tags':_0x3d940a||[]};});}})[_0xebe4('0x1a')](respondWithResult(_0x4da4ef,null))[_0xebe4('0x2b')](handleError(_0x4da4ef,null));};exports['removeTags']=function(_0x386423,_0x145825){return db[_0xebe4('0x2c')][_0xebe4('0x55')]({'where':{'id':_0x386423[_0xebe4('0xbd')]['id']}})[_0xebe4('0x1a')](handleEntityNotFound(_0x145825,null))[_0xebe4('0x1a')](function(_0x229bcc){if(_0x229bcc){return _0x229bcc['removeTags'](_0x386423[_0xebe4('0x32')][_0xebe4('0xc0')]);}})['then'](respondWithStatusCode(_0x145825,null))['catch'](handleError(_0x145825,null));};exports['download']=function(_0x4b7b9a,_0x592ec4){var _0x38701b=moment()[_0xebe4('0xcc')]()[_0xebe4('0x8f')]();var _0x158bca=path['join'](config[_0xebe4('0xcd')],_0xebe4('0xce'),'files',_0xebe4('0xcf'));var _0x1cc2ec=path[_0xebe4('0xd0')](config[_0xebe4('0xcd')],_0xebe4('0xce'),_0xebe4('0xd1'),_0xebe4('0xd2'));var _0x20166d=path[_0xebe4('0xd0')](_0x158bca,_0x38701b);var _0x5db20a=util[_0xebe4('0xd3')](_0xebe4('0xd4'),_0x4b7b9a[_0xebe4('0xbd')]['id'],_0x38701b);var _0x268c40=path[_0xebe4('0xd0')](_0x158bca,_0x5db20a);var _0x314254=[];if(_0x4b7b9a[_0xebe4('0x32')][_0xebe4('0xd2')]){_0x314254[_0xebe4('0x25')]({'model':db[_0xebe4('0xd5')],'as':_0xebe4('0xd6'),'raw':!![]});}var _0x1f3ece=[{'model':db[_0xebe4('0x26')],'as':_0xebe4('0xd7'),'attributes':['id',_0xebe4('0xbb'),_0xebe4('0x42'),'to','cc',_0xebe4('0xd8'),'subject',_0xebe4('0x6d')],'where':{'secret':![]},'order':qs[_0xebe4('0x3c')]('id'),'include':_0x314254}];return db[_0xebe4('0x2c')][_0xebe4('0x55')]({'where':{'id':_0x4b7b9a['params']['id']},'include':_0x1f3ece})['then'](handleEntityNotFound(_0x592ec4,null))['then'](function(_0x220719){if(_0x220719&&_0x220719[_0xebe4('0xd7')]){var _0x34d52f=_0x220719[_0xebe4('0xd9')]({'plain':!![]});fs[_0xebe4('0xda')](_0x20166d);return BPromise[_0xebe4('0xdb')](_0x34d52f['Messages'],function(_0x59b48f,_0x543d8c){var _0x5e9610={'from':_0x59b48f[_0xebe4('0x42')],'to':_0x59b48f['to'],'subject':_0x59b48f[_0xebe4('0xdc')],'html':htmlEntities[_0xebe4('0xdd')](_0x59b48f[_0xebe4('0xbb')]),'headers':{'Date':moment(_0x59b48f[_0xebe4('0x6d')])[_0xebe4('0xd3')](_0xebe4('0xde'))},'attachments':[]};if(_0x59b48f['cc']){_0x5e9610['headers']['Cc']=_0x59b48f['cc'];}if(_0x59b48f[_0xebe4('0xd8')]){_0x5e9610[_0xebe4('0xdf')][_0xebe4('0xe0')]=_0x59b48f[_0xebe4('0xd8')];}return new BPromise(function(_0xabc929,_0x205ab8){if(_0x59b48f[_0xebe4('0xd6')]){for(var _0x930871=0x0;_0x930871<_0x59b48f[_0xebe4('0xd6')][_0xebe4('0x38')];_0x930871++){var _0x4f2ccd=_0x59b48f[_0xebe4('0xd6')][_0x930871];var _0x42dca0=path[_0xebe4('0xd0')](_0x1cc2ec,_0x4f2ccd[_0xebe4('0xe1')]);if(fs[_0xebe4('0xe2')](_0x42dca0)){_0x5e9610[_0xebe4('0xd2')]['push']({'name':_0x4f2ccd['name'],'contentType':_0x4f2ccd[_0xebe4('0x2f')],'data':fs['readFileSync'](_0x42dca0)});}}}emlformat['build'](_0x5e9610,function(_0x15613d,_0x2c24ea){if(_0x15613d)return _0x205ab8(_0x15613d);fs['writeFileSync'](path[_0xebe4('0xd0')](_0x20166d,util[_0xebe4('0xd3')](_0xebe4('0xe3'),_0x543d8c)),_0x2c24ea);return _0xabc929(_0x2c24ea);});});})['then'](function(){return new BPromise(function(_0x2496a8,_0x30bf27){zipdir(_0x20166d,{'saveTo':_0x268c40},function(_0x3c964f,_0x16aa51){if(_0x3c964f)return _0x30bf27(_0x3c964f);return _0x2496a8(_0x16aa51);});})['then'](function(){return new BPromise(function(_0x10ecda,_0x3b48c0){rimraf(_0x20166d,function(_0x362073){if(_0x362073)_0x3b48c0(_0x362073);return _0x10ecda();});});})[_0xebe4('0x1a')](function(){return _0x592ec4[_0xebe4('0xe4')](_0x268c40,_0x5db20a,function(_0x489a57){if(!_0x489a57)fs[_0xebe4('0xe5')](_0x268c40);});});});}else{return _0x592ec4[_0xebe4('0xf')](0xc8);}})[_0xebe4('0x2b')](handleError(_0x592ec4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d84d514..72befde 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 _0xfe6c=['MailMessage','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb'];(function(_0x5dfed0,_0x53c5eb){var _0x4e3a22=function(_0x472257){while(--_0x472257){_0x5dfed0['push'](_0x5dfed0['shift']());}};_0x4e3a22(++_0x53c5eb);}(_0xfe6c,0x1eb));var _0xcfe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe6c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xcfe6('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xcfe6('0x1')];var MailMessage=require(_0xcfe6('0x2'))['db'][_0xcfe6('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcfe6('0x4'),'afterUpdate':_0xcfe6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x519f8d){return function(_0x260c0e,_0x26ecad,_0x3e2d54){_0x260c0e[_0xcfe6('0x6')]({'attributes':['id'],'raw':!![]})[_0xcfe6('0x7')](function(_0x51624c){_0x260c0e[_0xcfe6('0x8')](_0xcfe6('0x9'),_0x51624c[_0xcfe6('0xa')](function(_0x513523){return{'id':_0x513523['id']};}));return MailMessage[_0xcfe6('0xb')]({'where':{'MailInteractionId':_0x260c0e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcfe6('0x7')](function(_0x418961){_0x260c0e[_0xcfe6('0x8')](_0xcfe6('0xc'),_0x418961[_0xcfe6('0xd')]);MailInteractionEvents[_0xcfe6('0xe')](_0x519f8d+':'+_0x260c0e['id'],_0x260c0e);MailInteractionEvents[_0xcfe6('0xe')](_0x519f8d,_0x260c0e);_0x3e2d54(null);})[_0xcfe6('0xf')](_0x3e2d54(null));};}for(var e in events){if(events[_0xcfe6('0x10')](e)){var event=events[e];MailInteraction[_0xcfe6('0x11')](e,emitEvent(event));}}module[_0xcfe6('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x8c71=['setDataValue','length','emit','hasOwnProperty','events','../../mysqldb','MailInteraction','MailMessage','update','remove','then','Users','map','findAll'];(function(_0x4aa9a1,_0x22699f){var _0x37eae7=function(_0x69b0b4){while(--_0x69b0b4){_0x4aa9a1['push'](_0x4aa9a1['shift']());}};_0x37eae7(++_0x22699f);}(_0x8c71,0xf2));var _0x18c7=function(_0x232d09,_0x30a518){_0x232d09=_0x232d09-0x0;var _0x454385=_0x8c71[_0x232d09];return _0x454385;};'use strict';var EventEmitter=require(_0x18c7('0x0'));var MailInteraction=require(_0x18c7('0x1'))['db'][_0x18c7('0x2')];var MailMessage=require(_0x18c7('0x1'))['db'][_0x18c7('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x18c7('0x4'),'afterDestroy':_0x18c7('0x5')};function emitEvent(_0x232aed){return function(_0x28a34f,_0x4a9484,_0x200259){_0x28a34f['getUsers']({'attributes':['id'],'raw':!![]})[_0x18c7('0x6')](function(_0x5e4f4d){_0x28a34f['setDataValue'](_0x18c7('0x7'),_0x5e4f4d[_0x18c7('0x8')](function(_0x49a31f){return{'id':_0x49a31f['id']};}));return MailMessage[_0x18c7('0x9')]({'where':{'MailInteractionId':_0x28a34f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x18c7('0x6')](function(_0x5817e5){_0x28a34f[_0x18c7('0xa')]('unreadMessages',_0x5817e5[_0x18c7('0xb')]);MailInteractionEvents[_0x18c7('0xc')](_0x232aed+':'+_0x28a34f['id'],_0x28a34f);MailInteractionEvents['emit'](_0x232aed,_0x28a34f);_0x200259(null);})['catch'](_0x200259(null));};}for(var e in events){if(events[_0x18c7('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2dcc5c1..0a5dfb1 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 _0x91de=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatusAt','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x91de,0x6b));var _0xe91d=function(_0x23fe22,_0x333f4a){_0x23fe22=_0x23fe22-0x0;var _0x4bcdbb=_0x91de[_0x23fe22];return _0x4bcdbb;};'use strict';var _=require(_0xe91d('0x0'));var util=require(_0xe91d('0x1'));var logger=require(_0xe91d('0x2'))(_0xe91d('0x3'));var moment=require(_0xe91d('0x4'));var BPromise=require(_0xe91d('0x5'));var rp=require(_0xe91d('0x6'));var fs=require('fs');var path=require(_0xe91d('0x7'));var rimraf=require(_0xe91d('0x8'));var config=require(_0xe91d('0x9'));var attributes=require(_0xe91d('0xa'));module['exports']=function(_0x2794ed,_0x363f12){return _0x2794ed['define']('MailInteraction',attributes,{'tableName':_0xe91d('0xb'),'paranoid':![],'indexes':[{'name':_0xe91d('0xc'),'fields':[_0xe91d('0xd'),'to'],'type':_0xe91d('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c6971,_0x5c5a6f,_0x4a19b8){if(_0x1c6971[_0xe91d('0xf')]){_0x1c6971['substatusAt']=moment()[_0xe91d('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1c6971[_0xe91d('0x11')]){_0x1c6971[_0xe91d('0x12')]=moment()[_0xe91d('0x10')](_0xe91d('0x13'));}_0x4a19b8(null,_0x5c5a6f);},'beforeUpdate':function(_0x2b4c77,_0xc0e914,_0x492837){if(_0x2b4c77[_0xe91d('0x14')]('substatus')){_0x2b4c77[_0xe91d('0x15')]=_0x2b4c77[_0xe91d('0xf')]?moment()[_0xe91d('0x10')](_0xe91d('0x13')):null;}if(_0x2b4c77[_0xe91d('0x14')]('closed')){_0x2b4c77[_0xe91d('0x12')]=moment()[_0xe91d('0x10')](_0xe91d('0x13'));_0x2b4c77[_0xe91d('0xf')]=null;_0x2b4c77['substatusAt']=null;}_0x492837(null,_0x2b4c77);},'afterUpdate':function(_0x37ae58,_0x3d9cfa,_0x400160){var _0x8fc64a=_0x2794ed['models'];var _0x356845=_0x37ae58['get']({'plain':!![]});if(_0x356845[_0xe91d('0x11')]){return _0x8fc64a['MailMessage'][_0xe91d('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x356845['id']}})[_0xe91d('0x17')](function(){_0x400160();})[_0xe91d('0x18')](function(_0x27c3f3){_0x400160(_0x27c3f3);});}else{_0x400160();}}},'charset':_0xe91d('0x19'),'collate':_0xe91d('0x1a')});}; \ No newline at end of file +var _0x6285=['format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT','substatus','substatusAt'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x6285,0x7d));var _0x5628=function(_0x2005bd,_0x51fe31){_0x2005bd=_0x2005bd-0x0;var _0xc7fcdf=_0x6285[_0x2005bd];return _0xc7fcdf;};'use strict';var _=require(_0x5628('0x0'));var util=require(_0x5628('0x1'));var logger=require(_0x5628('0x2'))(_0x5628('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5628('0x4'));var rimraf=require(_0x5628('0x5'));var config=require(_0x5628('0x6'));var attributes=require(_0x5628('0x7'));module[_0x5628('0x8')]=function(_0x61fe6f,_0x2a4493){return _0x61fe6f[_0x5628('0x9')](_0x5628('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x5628('0xb'),'fields':['subject','to'],'type':_0x5628('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b0407,_0x310528,_0x436e8a){if(_0x4b0407[_0x5628('0xd')]){_0x4b0407[_0x5628('0xe')]=moment()[_0x5628('0xf')](_0x5628('0x10'));}if(_0x4b0407[_0x5628('0x11')]){_0x4b0407[_0x5628('0x12')]=moment()[_0x5628('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x436e8a(null,_0x310528);},'beforeUpdate':function(_0x459d1d,_0x1065df,_0x28f801){if(_0x459d1d['changed'](_0x5628('0xd'))){_0x459d1d[_0x5628('0xe')]=_0x459d1d['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x459d1d[_0x5628('0x13')]('closed')){_0x459d1d[_0x5628('0x12')]=moment()[_0x5628('0xf')](_0x5628('0x10'));_0x459d1d[_0x5628('0xd')]=null;_0x459d1d[_0x5628('0xe')]=null;}_0x28f801(null,_0x459d1d);},'afterUpdate':function(_0x56b9b4,_0x589b85,_0xda557a){var _0x17d20b=_0x61fe6f[_0x5628('0x14')];var _0x28f0fc=_0x56b9b4[_0x5628('0x15')]({'plain':!![]});if(_0x28f0fc[_0x5628('0x11')]){return _0x17d20b[_0x5628('0x16')][_0x5628('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x28f0fc['id']}})[_0x5628('0x18')](function(){_0xda557a();})[_0x5628('0x19')](function(_0x3fe419){_0xda557a(_0x3fe419);});}else{_0xda557a();}}},'charset':_0x5628('0x1a'),'collate':_0x5628('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index cb1ad14..a673119 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 _0x6a9a=['info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then'];(function(_0x227127,_0x25552c){var _0x38d7df=function(_0x2dac36){while(--_0x2dac36){_0x227127['push'](_0x227127['shift']());}};_0x38d7df(++_0x25552c);}(_0x6a9a,0x1bd));var _0xa6a9=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x6a9a[_0x1ae4a9];return _0x54d0b0;};'use strict';var _=require(_0xa6a9('0x0'));var util=require(_0xa6a9('0x1'));var moment=require('moment');var BPromise=require(_0xa6a9('0x2'));var rs=require(_0xa6a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6a9('0x5'))(_0xa6a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa6a9('0x7'));var client=jayson[_0xa6a9('0x8')][_0xa6a9('0x9')]({'port':0x232a});config[_0xa6a9('0xa')]=_[_0xa6a9('0xb')](config[_0xa6a9('0xa')],{'host':_0xa6a9('0xc'),'port':0x18eb});var socket=require(_0xa6a9('0xd'))(new Redis(config[_0xa6a9('0xa')]));require(_0xa6a9('0xe'))['register'](socket);function respondWithRpcPromise(_0x4eb380,_0x2c140c,_0xf898cb){return new BPromise(function(_0x32afce,_0x4216fb){return client[_0xa6a9('0xf')](_0x4eb380,_0xf898cb)[_0xa6a9('0x10')](function(_0x2974a5){logger[_0xa6a9('0x11')](_0xa6a9('0x12'),_0x2c140c,_0xa6a9('0x13'));logger[_0xa6a9('0x14')](_0xa6a9('0x15'),_0x2c140c,_0xa6a9('0x13'),JSON[_0xa6a9('0x16')](_0x2974a5));if(_0x2974a5[_0xa6a9('0x17')]){if(_0x2974a5[_0xa6a9('0x17')][_0xa6a9('0x18')]===0x1f4){logger[_0xa6a9('0x17')](_0xa6a9('0x12'),_0x2c140c,_0x2974a5[_0xa6a9('0x17')][_0xa6a9('0x19')]);return _0x4216fb(_0x2974a5[_0xa6a9('0x17')]['message']);}logger['error'](_0xa6a9('0x12'),_0x2c140c,_0x2974a5[_0xa6a9('0x17')][_0xa6a9('0x19')]);return _0x32afce(_0x2974a5[_0xa6a9('0x17')]['message']);}else{logger[_0xa6a9('0x11')]('MailInteraction,\x20%s,\x20%s',_0x2c140c,'request\x20sent');_0x32afce(_0x2974a5[_0xa6a9('0x1a')][_0xa6a9('0x19')]);}})[_0xa6a9('0x1b')](function(_0x4538fa){logger[_0xa6a9('0x17')](_0xa6a9('0x12'),_0x2c140c,_0x4538fa);_0x4216fb(_0x4538fa);});});}exports['UpdateMailInteraction']=function(_0x2a1f5f){var _0x21aa36=this;return new Promise(function(_0x52175e,_0x4a4cc7){return db['MailInteraction'][_0xa6a9('0x1c')](_0x2a1f5f[_0xa6a9('0x1d')],{'raw':_0x2a1f5f['options']?_0x2a1f5f[_0xa6a9('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1f5f['options']?_0x2a1f5f[_0xa6a9('0x1e')][_0xa6a9('0x1f')]||null:null,'attributes':_0x2a1f5f['options']?_0x2a1f5f[_0xa6a9('0x1e')][_0xa6a9('0x20')]||null:null,'limit':_0x2a1f5f[_0xa6a9('0x1e')]?_0x2a1f5f[_0xa6a9('0x1e')][_0xa6a9('0x21')]||null:null})[_0xa6a9('0x10')](function(_0x54669c){logger[_0xa6a9('0x11')]('UpdateMailInteraction',_0x2a1f5f);logger['debug'](_0xa6a9('0x22'),_0x2a1f5f,JSON['stringify'](_0x54669c));_0x52175e(_0x54669c);})[_0xa6a9('0x1b')](function(_0x40bb9e){logger[_0xa6a9('0x17')](_0xa6a9('0x22'),_0x40bb9e[_0xa6a9('0x19')],_0x2a1f5f);_0x4a4cc7(_0x21aa36[_0xa6a9('0x17')](0x1f4,_0x40bb9e[_0xa6a9('0x19')]));});});};exports[_0xa6a9('0x23')]=function(_0x474f35){return new Promise(function(_0x304ef6,_0x568ad8){return db[_0xa6a9('0x24')]['find']({'where':_0x474f35[_0xa6a9('0x1e')]?_0x474f35[_0xa6a9('0x1e')][_0xa6a9('0x1f')]||null:null})[_0xa6a9('0x10')](function(_0x56b31b){if(_0x56b31b){return _0x56b31b[_0xa6a9('0x25')](_0x474f35[_0xa6a9('0x1d')][_0xa6a9('0x26')],_[_0xa6a9('0x27')](_0x474f35[_0xa6a9('0x1d')],['ids','id'])||{});}})[_0xa6a9('0x28')](function(_0x1ec698){logger['info']('AddTags',_0x474f35);logger[_0xa6a9('0x14')](_0xa6a9('0x29'),_0x474f35,JSON[_0xa6a9('0x16')](_0x1ec698));_0x304ef6(_0x1ec698);})[_0xa6a9('0x1b')](function(_0x3f918e){logger['error'](_0xa6a9('0x29'),_0x3f918e['message'],_0x474f35);_0x568ad8(_this['error'](0x1f4,_0x3f918e[_0xa6a9('0x19')]));});});}; \ No newline at end of file +var _0xa786=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailInteraction','body','options','attributes','limit','debug','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5423fb,_0x368e9a){var _0x240fe0=function(_0x3cabda){while(--_0x3cabda){_0x5423fb['push'](_0x5423fb['shift']());}};_0x240fe0(++_0x368e9a);}(_0xa786,0x1d2));var _0x6a78=function(_0x3d98c1,_0x4ce697){_0x3d98c1=_0x3d98c1-0x0;var _0x1adad7=_0xa786[_0x3d98c1];return _0x1adad7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a78('0x0'));var BPromise=require(_0x6a78('0x1'));var rs=require(_0x6a78('0x2'));var fs=require('fs');var Redis=require(_0x6a78('0x3'));var db=require(_0x6a78('0x4'))['db'];var utils=require(_0x6a78('0x5'));var logger=require(_0x6a78('0x6'))('rpc');var config=require(_0x6a78('0x7'));var jayson=require(_0x6a78('0x8'));var client=jayson[_0x6a78('0x9')][_0x6a78('0xa')]({'port':0x232a});config[_0x6a78('0xb')]=_[_0x6a78('0xc')](config[_0x6a78('0xb')],{'host':_0x6a78('0xd'),'port':0x18eb});var socket=require(_0x6a78('0xe'))(new Redis(config[_0x6a78('0xb')]));require(_0x6a78('0xf'))[_0x6a78('0x10')](socket);function respondWithRpcPromise(_0x306116,_0x2fb93e,_0x2ff853){return new BPromise(function(_0x2641ed,_0x3c414c){return client[_0x6a78('0x11')](_0x306116,_0x2ff853)[_0x6a78('0x12')](function(_0x595e3e){logger['info'](_0x6a78('0x13'),_0x2fb93e,_0x6a78('0x14'));logger['debug'](_0x6a78('0x15'),_0x2fb93e,_0x6a78('0x14'),JSON[_0x6a78('0x16')](_0x595e3e));if(_0x595e3e[_0x6a78('0x17')]){if(_0x595e3e[_0x6a78('0x17')][_0x6a78('0x18')]===0x1f4){logger[_0x6a78('0x17')]('MailInteraction,\x20%s,\x20%s',_0x2fb93e,_0x595e3e['error']['message']);return _0x3c414c(_0x595e3e[_0x6a78('0x17')][_0x6a78('0x19')]);}logger[_0x6a78('0x17')]('MailInteraction,\x20%s,\x20%s',_0x2fb93e,_0x595e3e[_0x6a78('0x17')][_0x6a78('0x19')]);return _0x2641ed(_0x595e3e['error'][_0x6a78('0x19')]);}else{logger[_0x6a78('0x1a')](_0x6a78('0x13'),_0x2fb93e,_0x6a78('0x14'));_0x2641ed(_0x595e3e[_0x6a78('0x1b')][_0x6a78('0x19')]);}})[_0x6a78('0x1c')](function(_0x3c3e5d){logger['error'](_0x6a78('0x13'),_0x2fb93e,_0x3c3e5d);_0x3c414c(_0x3c3e5d);});});}exports['UpdateMailInteraction']=function(_0x216365){var _0xee82ac=this;return new Promise(function(_0x2ae9c5,_0x5d135e){return db[_0x6a78('0x1d')]['update'](_0x216365[_0x6a78('0x1e')],{'raw':_0x216365['options']?_0x216365[_0x6a78('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x216365[_0x6a78('0x1f')]?_0x216365['options']['where']||null:null,'attributes':_0x216365['options']?_0x216365[_0x6a78('0x1f')][_0x6a78('0x20')]||null:null,'limit':_0x216365[_0x6a78('0x1f')]?_0x216365['options'][_0x6a78('0x21')]||null:null})[_0x6a78('0x12')](function(_0x130491){logger[_0x6a78('0x1a')]('UpdateMailInteraction',_0x216365);logger[_0x6a78('0x22')]('UpdateMailInteraction',_0x216365,JSON[_0x6a78('0x16')](_0x130491));_0x2ae9c5(_0x130491);})[_0x6a78('0x1c')](function(_0x8e8513){logger[_0x6a78('0x17')]('UpdateMailInteraction',_0x8e8513[_0x6a78('0x19')],_0x216365);_0x5d135e(_0xee82ac[_0x6a78('0x17')](0x1f4,_0x8e8513['message']));});});};exports[_0x6a78('0x23')]=function(_0x526a94){return new Promise(function(_0x297708,_0x48c692){return db[_0x6a78('0x1d')][_0x6a78('0x24')]({'where':_0x526a94['options']?_0x526a94[_0x6a78('0x1f')][_0x6a78('0x25')]||null:null})['then'](function(_0x1d235d){if(_0x1d235d){return _0x1d235d[_0x6a78('0x26')](_0x526a94['body'][_0x6a78('0x27')],_[_0x6a78('0x28')](_0x526a94[_0x6a78('0x1e')],[_0x6a78('0x27'),'id'])||{});}})[_0x6a78('0x29')](function(_0x2c8074){logger[_0x6a78('0x1a')]('AddTags',_0x526a94);logger[_0x6a78('0x22')](_0x6a78('0x2a'),_0x526a94,JSON['stringify'](_0x2c8074));_0x297708(_0x2c8074);})[_0x6a78('0x1c')](function(_0x4a2095){logger[_0x6a78('0x17')](_0x6a78('0x2a'),_0x4a2095['message'],_0x526a94);_0x48c692(_this[_0x6a78('0x17')](0x1f4,_0x4a2095[_0x6a78('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d2dd3a7..7e9a0af 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 _0x6baa=['length','remove','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6baa,0x10f));var _0xa6ba=function(_0x83bd7a,_0x35e2d9){_0x83bd7a=_0x83bd7a-0x0;var _0x17db19=_0x6baa[_0x83bd7a];return _0x17db19;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xa6ba('0x0'),_0xa6ba('0x1')];function createListener(_0x484a29,_0x518034){return function(_0x1eff9){_0x518034[_0xa6ba('0x2')](_0x484a29,_0x1eff9);};}function removeListener(_0x50d3c0,_0x35f7b8){return function(){MailInteractionEvents[_0xa6ba('0x3')](_0x50d3c0,_0x35f7b8);};}exports['register']=function(_0x1a9277){for(var _0x500c8c=0x0,_0x5ca1bc=events[_0xa6ba('0x4')];_0x500c8c<_0x5ca1bc;_0x500c8c++){var _0x20f17a=events[_0x500c8c];var _0x32a8a6=createListener('mailInteraction:'+_0x20f17a,_0x1a9277);MailInteractionEvents['on'](_0x20f17a,_0x32a8a6);}}; \ No newline at end of file +var _0x6692=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x6692,0xb8));var _0x2669=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0x6692[_0x41d02a];return _0x4c3983;};'use strict';var MailInteractionEvents=require(_0x2669('0x0'));var events=[_0x2669('0x1'),_0x2669('0x2'),_0x2669('0x3')];function createListener(_0x340fc9,_0x7124f9){return function(_0x1b77e9){_0x7124f9[_0x2669('0x4')](_0x340fc9,_0x1b77e9);};}function removeListener(_0x57198f,_0x2e40a9){return function(){MailInteractionEvents[_0x2669('0x5')](_0x57198f,_0x2e40a9);};}exports[_0x2669('0x6')]=function(_0x4c089e){for(var _0xdf9c21=0x0,_0x347a63=events[_0x2669('0x7')];_0xdf9c21<_0x347a63;_0xdf9c21++){var _0x4002ce=events[_0xdf9c21];var _0xbcd873=createListener(_0x2669('0x8')+_0x4002ce,_0x4c089e);MailInteractionEvents['on'](_0x4002ce,_0xbcd873);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c7e8bd1..3a1752e 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 _0xc2af=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','post','tracked','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c6aeb,_0x1a3eda){var _0x518281=function(_0x5bcb78){while(--_0x5bcb78){_0x5c6aeb['push'](_0x5c6aeb['shift']());}};_0x518281(++_0x1a3eda);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x79a733,_0x222c20){_0x79a733=_0x79a733-0x0;var _0x175c0a=_0xc2af[_0x79a733];return _0x175c0a;};'use strict';var multer=require(_0xfc2a('0x0'));var util=require('util');var path=require(_0xfc2a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc2a('0x2'));var router=express[_0xfc2a('0x3')]();var fs_extra=require(_0xfc2a('0x4'));var auth=require(_0xfc2a('0x5'));var interaction=require(_0xfc2a('0x6'));var config=require(_0xfc2a('0x7'));var controller=require(_0xfc2a('0x8'));router[_0xfc2a('0x9')]('/',auth['isAuthenticated'](),controller[_0xfc2a('0xa')]);router['get'](_0xfc2a('0xb'),auth['isAuthenticated'](),controller[_0xfc2a('0xc')]);router[_0xfc2a('0x9')](_0xfc2a('0xd'),auth[_0xfc2a('0xe')](),controller['show']);router[_0xfc2a('0x9')]('/:id/download',auth[_0xfc2a('0xe')](),controller['download']);router[_0xfc2a('0xf')]('/',auth[_0xfc2a('0xe')](),interaction[_0xfc2a('0x10')]('mail','mailmessage:create'),controller[_0xfc2a('0x11')]);router[_0xfc2a('0x12')](_0xfc2a('0xd'),auth[_0xfc2a('0xe')](),controller[_0xfc2a('0x13')]);router[_0xfc2a('0x12')](_0xfc2a('0x14'),auth[_0xfc2a('0xe')](),controller[_0xfc2a('0x15')]);router['put']('/:id/reject',auth[_0xfc2a('0xe')](),controller[_0xfc2a('0x16')]);router['delete'](_0xfc2a('0xd'),auth[_0xfc2a('0xe')](),controller[_0xfc2a('0x17')]);module[_0xfc2a('0x18')]=router; \ No newline at end of file +var _0x688a=['get','isAuthenticated','index','describe','/:id','download','post','tracked','mail','mailmessage:create','update','/:id/accept','accept','put','reject','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x688a,0x124));var _0xa688=function(_0x41c4e5,_0x297215){_0x41c4e5=_0x41c4e5-0x0;var _0x3c1b75=_0x688a[_0x41c4e5];return _0x3c1b75;};'use strict';var multer=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var path=require(_0xa688('0x2'));var timeout=require('connect-timeout');var express=require(_0xa688('0x3'));var router=express['Router']();var fs_extra=require(_0xa688('0x4'));var auth=require(_0xa688('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa688('0x6'));var controller=require(_0xa688('0x7'));router[_0xa688('0x8')]('/',auth[_0xa688('0x9')](),controller[_0xa688('0xa')]);router[_0xa688('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa688('0xb')]);router[_0xa688('0x8')](_0xa688('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa688('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xa688('0xd')]);router[_0xa688('0xe')]('/',auth[_0xa688('0x9')](),interaction[_0xa688('0xf')](_0xa688('0x10'),_0xa688('0x11')),controller['create']);router['put']('/:id',auth[_0xa688('0x9')](),controller[_0xa688('0x12')]);router['put'](_0xa688('0x13'),auth['isAuthenticated'](),controller[_0xa688('0x14')]);router[_0xa688('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xa688('0x16')]);router['delete'](_0xa688('0xc'),auth['isAuthenticated'](),controller[_0xa688('0x17')]);module[_0xa688('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7ee9559..41e606f 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 _0x6d24=['medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','sequelize','lodash','exports','TEXT','long'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x6d24,0x1a8));var _0x46d2=function(_0x326038,_0x7bdb1b){_0x326038=_0x326038-0x0;var _0x4b744a=_0x6d24[_0x326038];return _0x4b744a;};'use strict';var Sequelize=require(_0x46d2('0x0'));var _=require(_0x46d2('0x1'));module[_0x46d2('0x2')]={'body':{'type':Sequelize[_0x46d2('0x3')](_0x46d2('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x46d2('0x5'))},'read':{'type':Sequelize[_0x46d2('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x46d2('0x7')]('in',_0x46d2('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x46d2('0x9')](0x1fe)},'from':{'type':Sequelize[_0x46d2('0x9')]},'to':{'type':Sequelize['TEXT'](_0x46d2('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x46d2('0x4'))},'bcc':{'type':Sequelize[_0x46d2('0x3')](_0x46d2('0x4'))},'subject':{'type':Sequelize[_0x46d2('0x3')]},'sentAt':{'type':Sequelize[_0x46d2('0xa')]},'attach':{'type':Sequelize[_0x46d2('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x46d2('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x46d2('0xa')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x46d2('0x3')](_0x46d2('0x4'))},'originChannel':{'type':Sequelize[_0x46d2('0x7')](_0x46d2('0xc'),'Chat'),'defaultValue':_0x46d2('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0xe348=['BOOLEAN','Email','Chat','sequelize','TEXT','medium','ENUM','out','STRING','long','DATE','INTEGER'];(function(_0x5bffbf,_0x30347c){var _0x633774=function(_0x82bcb4){while(--_0x82bcb4){_0x5bffbf['push'](_0x5bffbf['shift']());}};_0x633774(++_0x30347c);}(_0xe348,0x10b));var _0x8e34=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xe348[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x8e34('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x8e34('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8e34('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8e34('0x3')]('in',_0x8e34('0x4')),'defaultValue':_0x8e34('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x8e34('0x5')]},'to':{'type':Sequelize['TEXT'](_0x8e34('0x6'))},'cc':{'type':Sequelize[_0x8e34('0x1')](_0x8e34('0x6'))},'bcc':{'type':Sequelize[_0x8e34('0x1')](_0x8e34('0x6'))},'subject':{'type':Sequelize[_0x8e34('0x1')]},'sentAt':{'type':Sequelize[_0x8e34('0x7')]},'attach':{'type':Sequelize[_0x8e34('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8e34('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8e34('0x7')]},'originTo':{'type':Sequelize[_0x8e34('0x1')](_0x8e34('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x8e34('0x6'))},'originChannel':{'type':Sequelize['ENUM'](_0x8e34('0xa'),_0x8e34('0xb')),'defaultValue':_0x8e34('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 93514fa..885d501 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 _0x5e49=['SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','agent','SIP/%s','event','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','status','json','undefined','offset','count','limit','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','filters','includeAll','find','body','describe','create','direction','out','split','MailAccountId','CmList','List','CmContact','updatedAt','MailServerOut','isNil','Smtp','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','List\x20not\x20found'];(function(_0x180ff0,_0x3758a3){var _0x24ca0d=function(_0x53d3c5){while(--_0x53d3c5){_0x180ff0['push'](_0x180ff0['shift']());}};_0x24ca0d(++_0x3758a3);}(_0x5e49,0x18f));var _0x95e4=function(_0x261df1,_0x36c808){_0x261df1=_0x261df1-0x0;var _0x47482f=_0x5e49[_0x261df1];return _0x47482f;};'use strict';var emlformat=require(_0x95e4('0x0'));var moment=require('moment');var BPromise=require(_0x95e4('0x1'));var util=require(_0x95e4('0x2'));var path=require(_0x95e4('0x3'));var fs=require('fs');var _=require(_0x95e4('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x95e4('0x5'));var qs=require(_0x95e4('0x6'));var logger=require(_0x95e4('0x7'))(_0x95e4('0x8'));var interaction_log=require('../../config/logger')(_0x95e4('0x9'));var config=require(_0x95e4('0xa'));var db=require(_0x95e4('0xb'))['db'];config['redis']=_[_0x95e4('0xc')](config[_0x95e4('0xd')],{'host':_0x95e4('0xe'),'port':0x18eb});var socket=require(_0x95e4('0xf'))(new Redis(config[_0x95e4('0xd')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x95e4('0x10')](socket);var jayson=require(_0x95e4('0x11'));var client=jayson['client'][_0x95e4('0x12')]({'port':0x232c});var client9003=jayson[_0x95e4('0x13')][_0x95e4('0x12')]({'port':0x232b});var client9002=jayson[_0x95e4('0x13')][_0x95e4('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x1b125c,_0x5bb7f2,_0x55074f,_0x459ee6){return new BPromise(function(_0x34be69,_0xa18f2){var _0xdb208e=_0x459ee6||client;return _0xdb208e[_0x95e4('0x14')](_0x1b125c,_0x55074f)[_0x95e4('0x15')](function(_0x5e0d74){logger['info']('MailMessage,\x20%s,\x20%s',_0x5bb7f2,_0x95e4('0x16'));logger[_0x95e4('0x17')](_0x95e4('0x18'),_0x5bb7f2,'request\x20sent',JSON[_0x95e4('0x19')](_0x5e0d74));if(_0x5e0d74[_0x95e4('0x1a')]){if(_0x5e0d74['error'][_0x95e4('0x1b')]===0x1f4){logger[_0x95e4('0x1a')](_0x95e4('0x1c'),_0x5bb7f2,_0x5e0d74[_0x95e4('0x1a')][_0x95e4('0x1d')]);return _0xa18f2(_0x5e0d74[_0x95e4('0x1a')][_0x95e4('0x1d')]);}logger['error'](_0x95e4('0x1c'),_0x5bb7f2,_0x5e0d74['error'][_0x95e4('0x1d')]);return _0x34be69(_0x5e0d74[_0x95e4('0x1a')]['message']);}else{logger[_0x95e4('0x1e')](_0x95e4('0x1c'),_0x5bb7f2,_0x95e4('0x16'));_0x34be69(_0x5e0d74[_0x95e4('0x1f')][_0x95e4('0x1d')]);}})['catch'](function(_0x71cbd0){logger[_0x95e4('0x1a')](_0x95e4('0x1c'),_0x5bb7f2,_0x71cbd0);_0xa18f2(_0x71cbd0);});});}function respondWithResult(_0x1eb46d,_0x4972d5){_0x4972d5=_0x4972d5||0xc8;return function(_0x1484f1){if(_0x1484f1){return _0x1eb46d[_0x95e4('0x20')](_0x4972d5)[_0x95e4('0x21')](_0x1484f1);}};}function respondWithFilteredResult(_0x3bec4d,_0x1bdc56){return function(_0x4dc752){if(_0x4dc752){var _0xfdcef=typeof _0x1bdc56['offset']===_0x95e4('0x22')&&typeof _0x1bdc56['limit']===_0x95e4('0x22');var _0xc5a53=_0x4dc752['count'];var _0x3eabe6=_0xfdcef?0x0:_0x1bdc56[_0x95e4('0x23')];var _0x4db08c=_0xfdcef?_0x4dc752[_0x95e4('0x24')]:_0x1bdc56[_0x95e4('0x23')]+_0x1bdc56[_0x95e4('0x25')];var _0x324a76;if(_0x4db08c>=_0xc5a53){_0x4db08c=_0xc5a53;_0x324a76=0xc8;}else{_0x324a76=0xce;}_0x3bec4d[_0x95e4('0x20')](_0x324a76);return _0x3bec4d[_0x95e4('0x26')](_0x95e4('0x27'),_0x3eabe6+'-'+_0x4db08c+'/'+_0xc5a53)[_0x95e4('0x21')](_0x4dc752);}return null;};}function saveUpdates(_0x55cfa3){return function(_0x296344){if(_0x296344){return _0x296344[_0x95e4('0x28')](_0x55cfa3)[_0x95e4('0x15')](function(_0x28f7fc){return _0x28f7fc;});}return null;};}function removeEntity(_0x2ab587){return function(_0x16f177){if(_0x16f177){return _0x16f177[_0x95e4('0x29')]()['then'](function(){_0x2ab587[_0x95e4('0x20')](0xcc)[_0x95e4('0x2a')]();});}};}function handleEntityNotFound(_0x1fbfe3){return function(_0x39ef7e){if(!_0x39ef7e){_0x1fbfe3[_0x95e4('0x2b')](0x194);}return _0x39ef7e;};}function handleError(_0x397370,_0x36a465){_0x36a465=_0x36a465||0x1f4;return function(_0x6b7b79){logger[_0x95e4('0x1a')](_0x6b7b79[_0x95e4('0x2c')]);if(_0x6b7b79[_0x95e4('0x2d')]){delete _0x6b7b79[_0x95e4('0x2d')];}_0x397370[_0x95e4('0x20')](_0x36a465)[_0x95e4('0x2e')](_0x6b7b79);};}exports[_0x95e4('0x2f')]=function(_0x4515e2,_0x4adc5a){var _0x16c660={},_0x10f92b={},_0x1d0a62={'count':0x0,'rows':[]};var _0x58ee7c=_[_0x95e4('0x30')](db[_0x95e4('0x31')][_0x95e4('0x32')],function(_0x231810){return{'name':_0x231810['fieldName'],'type':_0x231810[_0x95e4('0x33')][_0x95e4('0x34')]};});_0x10f92b['model']=_[_0x95e4('0x30')](_0x58ee7c,_0x95e4('0x2d'));_0x10f92b['query']=_['keys'](_0x4515e2[_0x95e4('0x35')]);_0x10f92b['filters']=_[_0x95e4('0x36')](_0x10f92b[_0x95e4('0x37')],_0x10f92b['query']);_0x16c660['attributes']=_['intersection'](_0x10f92b[_0x95e4('0x37')],qs[_0x95e4('0x38')](_0x4515e2[_0x95e4('0x35')][_0x95e4('0x38')]));_0x16c660[_0x95e4('0x39')]=_0x16c660['attributes'][_0x95e4('0x3a')]?_0x16c660[_0x95e4('0x39')]:_0x10f92b['model'];if(!_0x4515e2[_0x95e4('0x35')]['hasOwnProperty'](_0x95e4('0x3b'))){_0x16c660[_0x95e4('0x25')]=qs[_0x95e4('0x25')](_0x4515e2[_0x95e4('0x35')]['limit']);_0x16c660[_0x95e4('0x23')]=qs['offset'](_0x4515e2[_0x95e4('0x35')]['offset']);}_0x16c660[_0x95e4('0x3c')]=qs[_0x95e4('0x3d')](_0x4515e2[_0x95e4('0x35')][_0x95e4('0x3d')]);_0x16c660[_0x95e4('0x3e')]=qs['filters'](_[_0x95e4('0x3f')](_0x4515e2[_0x95e4('0x35')],_0x10f92b['filters']),_0x58ee7c);if(_0x4515e2['query'][_0x95e4('0x40')]){_0x16c660[_0x95e4('0x3e')]=_[_0x95e4('0x41')](_0x16c660[_0x95e4('0x3e')],{'$or':_['map'](_0x58ee7c,function(_0x312e91){if(_0x312e91[_0x95e4('0x33')]!==_0x95e4('0x42')){var _0x21cd55={};_0x21cd55[_0x312e91['name']]={'$like':'%'+_0x4515e2[_0x95e4('0x35')]['filter']+'%'};return _0x21cd55;}})});}_0x16c660=_[_0x95e4('0x41')]({},_0x16c660,_0x4515e2[_0x95e4('0x43')]);var _0x573244={'where':_0x16c660[_0x95e4('0x3e')]};return db[_0x95e4('0x31')][_0x95e4('0x24')](_0x573244)[_0x95e4('0x15')](function(_0x7f59ea){_0x1d0a62['count']=_0x7f59ea;if(_0x4515e2['query']['includeAll']){_0x16c660[_0x95e4('0x44')]=[{'all':!![]}];}return db[_0x95e4('0x31')]['findAll'](_0x16c660);})['then'](function(_0x113ba4){_0x1d0a62[_0x95e4('0x45')]=_0x113ba4;return _0x1d0a62;})[_0x95e4('0x15')](respondWithFilteredResult(_0x4adc5a,_0x16c660))[_0x95e4('0x46')](handleError(_0x4adc5a,null));};exports[_0x95e4('0x47')]=function(_0x1eeea6,_0x2082c1){var _0x13131b={'raw':!![],'where':{'id':_0x1eeea6[_0x95e4('0x48')]['id']}},_0x22e025={};_0x22e025[_0x95e4('0x37')]=_[_0x95e4('0x49')](db['MailMessage'][_0x95e4('0x32')]);_0x22e025[_0x95e4('0x35')]=_[_0x95e4('0x49')](_0x1eeea6[_0x95e4('0x35')]);_0x22e025[_0x95e4('0x4a')]=_[_0x95e4('0x36')](_0x22e025[_0x95e4('0x37')],_0x22e025[_0x95e4('0x35')]);_0x13131b[_0x95e4('0x39')]=_[_0x95e4('0x36')](_0x22e025[_0x95e4('0x37')],qs['fields'](_0x1eeea6[_0x95e4('0x35')][_0x95e4('0x38')]));_0x13131b['attributes']=_0x13131b[_0x95e4('0x39')][_0x95e4('0x3a')]?_0x13131b['attributes']:_0x22e025[_0x95e4('0x37')];if(_0x1eeea6[_0x95e4('0x35')][_0x95e4('0x4b')]){_0x13131b[_0x95e4('0x44')]=[{'all':!![]}];}_0x13131b=_[_0x95e4('0x41')]({},_0x13131b,_0x1eeea6[_0x95e4('0x43')]);return db[_0x95e4('0x31')][_0x95e4('0x4c')](_0x13131b)[_0x95e4('0x15')](handleEntityNotFound(_0x2082c1,null))[_0x95e4('0x15')](respondWithResult(_0x2082c1,null))['catch'](handleError(_0x2082c1,null));};exports[_0x95e4('0x28')]=function(_0x56f51e,_0x397560){if(_0x56f51e[_0x95e4('0x4d')]['id']){delete _0x56f51e[_0x95e4('0x4d')]['id'];}return db[_0x95e4('0x31')][_0x95e4('0x4c')]({'where':{'id':_0x56f51e[_0x95e4('0x48')]['id']}})[_0x95e4('0x15')](handleEntityNotFound(_0x397560,null))[_0x95e4('0x15')](saveUpdates(_0x56f51e[_0x95e4('0x4d')],null))[_0x95e4('0x15')](respondWithResult(_0x397560,null))[_0x95e4('0x46')](handleError(_0x397560,null));};exports[_0x95e4('0x29')]=function(_0x44192f,_0x14c8d8){return db[_0x95e4('0x31')]['find']({'where':{'id':_0x44192f[_0x95e4('0x48')]['id']}})['then'](handleEntityNotFound(_0x14c8d8,null))[_0x95e4('0x15')](removeEntity(_0x14c8d8,null))['catch'](handleError(_0x14c8d8,null));};exports[_0x95e4('0x4e')]=function(_0x54ad2e,_0x40dcd8){return db[_0x95e4('0x31')][_0x95e4('0x4e')]()[_0x95e4('0x15')](respondWithResult(_0x40dcd8,null))[_0x95e4('0x46')](handleError(_0x40dcd8,null));};exports[_0x95e4('0x4f')]=function(_0x1ab811,_0x346b15){return db[_0x95e4('0x31')][_0x95e4('0x4f')](_0x1ab811[_0x95e4('0x4d')])[_0x95e4('0x15')](function(_0x2b0119){if(_0x2b0119){if(_0x2b0119[_0x95e4('0x50')]===_0x95e4('0x51')&&!_0x2b0119['secret']){var _0x5a91e7,_0x30afcc,_0x323b05;if(_0x1ab811[_0x95e4('0x4d')]['to']){_0x30afcc=_0x1ab811[_0x95e4('0x4d')]['to'][_0x95e4('0x52')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x2b0119[_0x95e4('0x53')]},'include':[{'model':db[_0x95e4('0x54')],'as':_0x95e4('0x55'),'include':[{'model':db[_0x95e4('0x56')],'as':'Contacts','where':{'email':_0x30afcc},'limit':0x1,'order':[[_0x95e4('0x57'),'DESC']]}]},{'model':db[_0x95e4('0x58')],'as':'Smtp','raw':!![]}]})[_0x95e4('0x15')](function(_0x15884){_0x5a91e7=_0x15884;if(_0x5a91e7&&_0x5a91e7['Smtp']){var _0x3fdbba={'tls':{'rejectUnauthorized':![]}};if(_[_0x95e4('0x59')](_0x5a91e7[_0x95e4('0x5a')][_0x95e4('0x5b')])){_0x3fdbba['host']=_0x5a91e7[_0x95e4('0x5a')][_0x95e4('0x5c')];_0x3fdbba[_0x95e4('0x5d')]=_0x5a91e7[_0x95e4('0x5a')][_0x95e4('0x5d')];_0x3fdbba[_0x95e4('0x5e')]=_0x5a91e7['Smtp']['secure'];if(_0x5a91e7['Smtp']['authentication']){_0x3fdbba[_0x95e4('0x5f')]={'user':_0x5a91e7[_0x95e4('0x5a')]['user'],'pass':_0x5a91e7['Smtp']['pass']};}}else{_0x3fdbba['service']=_0x5a91e7[_0x95e4('0x5a')][_0x95e4('0x5b')];_0x3fdbba['auth']={'user':_0x5a91e7[_0x95e4('0x5a')][_0x95e4('0x60')],'pass':_0x5a91e7[_0x95e4('0x5a')][_0x95e4('0x61')]};_0x3fdbba[_0x95e4('0x5e')]=_0x5a91e7['Smtp'][_0x95e4('0x5e')];}if(_0x1ab811[_0x95e4('0x4d')]['attachments']&&_0x1ab811['body'][_0x95e4('0x62')][_0x95e4('0x3a')]){for(var _0x40c858=0x0;_0x40c858<_0x1ab811[_0x95e4('0x4d')][_0x95e4('0x62')][_0x95e4('0x3a')];_0x40c858+=0x1){_0x1ab811[_0x95e4('0x4d')][_0x95e4('0x62')][_0x40c858]={'filename':_0x1ab811[_0x95e4('0x4d')]['attachments'][_0x40c858]['name'],'path':path[_0x95e4('0x63')](config[_0x95e4('0x64')],_0x95e4('0x65'),_0x1ab811[_0x95e4('0x4d')][_0x95e4('0x62')][_0x40c858][_0x95e4('0x66')])};}}_0x323b05={'account':_0x3fdbba,'message':_0x1ab811[_0x95e4('0x4d')]};return;}})[_0x95e4('0x15')](function(){if(_0x5a91e7['List']){if(_0x5a91e7[_0x95e4('0x55')][_0x95e4('0x67')][_0x95e4('0x3a')]){return _0x5a91e7['List'][_0x95e4('0x67')][0x0];}else{return db[_0x95e4('0x56')]['create'](_['defaults'](_0x1ab811[_0x95e4('0x4d')],{'firstName':_0x1ab811[_0x95e4('0x4d')]['to'],'email':_0x1ab811[_0x95e4('0x4d')]['to'],'phone':_0x1ab811[_0x95e4('0x4d')]['to'],'ListId':_0x5a91e7['ListId']}));}}else{throw new Error(_0x95e4('0x68'));}})[_0x95e4('0x15')](function(){if(_0x323b05){return respondWithRpcPromise(_0x95e4('0x69'),_0x95e4('0x6a'),_0x323b05,client9003)['then'](function(_0x5eadcc){return _0x2b0119[_0x95e4('0x28')]({'read':!![],'messageId':_0x5eadcc[_0x95e4('0x6b')],'sentAt':moment()[_0x95e4('0x6c')](_0x95e4('0x6d'))});})[_0x95e4('0x46')](function(_0x36a273){logger[_0x95e4('0x1a')]('%s',JSON[_0x95e4('0x19')](_0x36a273));return _0x2b0119;});}return _0x2b0119;});}return _0x2b0119;}})[_0x95e4('0x15')](respondWithResult(_0x346b15,0xc9))[_0x95e4('0x46')](handleError(_0x346b15,null));};exports['accept']=function(_0x165be4,_0x43ce7b){var _0x483778={'agent':{},'channel':_0x95e4('0x6e')};if(_0x165be4['body']['id']){delete _0x165be4[_0x95e4('0x4d')]['id'];}_0x165be4[_0x95e4('0x4d')][_0x95e4('0x6f')]=!![];_0x165be4[_0x95e4('0x4d')][_0x95e4('0x70')]=moment()[_0x95e4('0x6c')](_0x95e4('0x6d'));_0x165be4[_0x95e4('0x4d')][_0x95e4('0x71')]=_0x165be4[_0x95e4('0x4d')][_0x95e4('0x71')]||_0x165be4[_0x95e4('0x60')]['id'];_0x483778['agent']['id']=_0x165be4['body'][_0x95e4('0x71')];return db[_0x95e4('0x31')][_0x95e4('0x4c')]({'where':{'id':_0x165be4[_0x95e4('0x48')]['id'],'UserId':null}})[_0x95e4('0x15')](handleEntityNotFound(_0x43ce7b,null))[_0x95e4('0x15')](saveUpdates(_0x165be4[_0x95e4('0x4d')],null))['then'](function(_0x403487){if(_0x403487){_0x483778[_0x95e4('0x1d')]=_0x403487[_0x95e4('0x72')]({'plain':!![]});return db[_0x95e4('0x73')][_0x95e4('0x4c')]({'where':{'id':_0x403487[_0x95e4('0x74')]}});}return null;})[_0x95e4('0x15')](handleEntityNotFound(_0x43ce7b,null))[_0x95e4('0x15')](function(_0x28c17b){if(_0x28c17b){return _0x28c17b[_0x95e4('0x28')]({'UserId':_0x165be4[_0x95e4('0x4d')][_0x95e4('0x71')],'read1stAt':_[_0x95e4('0x59')](_0x28c17b[_0x95e4('0x75')])?moment()[_0x95e4('0x6c')](_0x95e4('0x6d')):undefined});}return null;})[_0x95e4('0x15')](function(_0x2fa0e3){if(_0x2fa0e3){_0x483778[_0x95e4('0x76')]=_0x2fa0e3['get']({'plain':!![]});interaction_log[_0x95e4('0x1e')](_0x95e4('0x77'),_0x165be4[_0x95e4('0x60')]['id'],_0x165be4[_0x95e4('0x60')]['name'],_0x165be4[_0x95e4('0x60')][_0x95e4('0x78')],_0x483778[_0x95e4('0x76')]['id'],_0x165be4[_0x95e4('0x4d')]?JSON['stringify'](_0x165be4['body']):_0x95e4('0x79'));return respondWithRpcPromise(_0x95e4('0x7a'),_0x95e4('0x7b'),_0x483778);}return null;})['then'](function(_0x129f65){var _0x59069b=_0x95e4('0x7c')+_0x129f65[_0x95e4('0x1d')][_0x95e4('0x7d')];return db[_0x95e4('0x7e')][_0x95e4('0x35')](_0x59069b,{'type':db[_0x95e4('0x7f')][_0x95e4('0x80')][_0x95e4('0x81')],'raw':!![]})['then'](function(_0x5db78d){return _0x5db78d;});})[_0x95e4('0x15')](function(_0xfd487e){if(_0xfd487e){_0x483778[_0x95e4('0x1d')][_0x95e4('0x82')]=_0xfd487e[0x0];if(!_0x165be4[_0x95e4('0x4d')][_0x95e4('0x71')])return;return db[_0x95e4('0x83')][_0x95e4('0x4c')]({'where':{'id':_0x165be4[_0x95e4('0x4d')]['UserId'],'role':'agent'},'attributes':['id',_0x95e4('0x2d'),_0x95e4('0x84'),_0x95e4('0x85'),_0x95e4('0x86')],'raw':!![]});}return null;})[_0x95e4('0x15')](function(_0x1335f6){if(!_0x1335f6)return null;_0x483778[_0x95e4('0x1d')]['agent']=_0x1335f6;return _0x483778;})[_0x95e4('0x15')](function(_0x4a2506){if(_0x4a2506){if(_0x165be4[_0x95e4('0x4d')][_0x95e4('0x87')]){_0x483778[_0x95e4('0x1d')][_0x95e4('0x88')]=util['format']('SIP/%s',_0x165be4[_0x95e4('0x60')]['name']);_0x483778[_0x95e4('0x1d')][_0x95e4('0x89')]=_0x483778['channel'];_0x483778['message'][_0x95e4('0x8a')]=_0x483778[_0x95e4('0x89')];_0x483778[_0x95e4('0x1d')]['event']=_0x95e4('0x8b');_0x483778['message'][_0x95e4('0x4d')]=htmlToText[_0x95e4('0x8c')](_0x483778[_0x95e4('0x1d')]['body']);return respondWithRpcPromise(_0x95e4('0x8d'),_0x95e4('0x8d'),{'event':_0x95e4('0x8e'),'message':_0x483778[_0x95e4('0x1d')]},client9002)[_0x95e4('0x15')](function(){return _0x483778;});}return _0x483778;}return null;})[_0x95e4('0x15')](respondWithResult(_0x43ce7b,null))[_0x95e4('0x46')](handleError(_0x43ce7b,null));};exports[_0x95e4('0x8f')]=function(_0xd56c7b,_0x3024f2){var _0x359bfd={'agent':{},'channel':_0x95e4('0x6e')};if(_0xd56c7b[_0x95e4('0x4d')]['id']){delete _0xd56c7b[_0x95e4('0x4d')]['id'];}_0xd56c7b['body'][_0x95e4('0x71')]=_0xd56c7b['body'][_0x95e4('0x71')]||_0xd56c7b[_0x95e4('0x60')]['id'];_0x359bfd[_0x95e4('0x90')]['id']=_0xd56c7b[_0x95e4('0x4d')][_0x95e4('0x71')];return db[_0x95e4('0x31')]['find']({'where':{'id':_0xd56c7b[_0x95e4('0x48')]['id'],'UserId':null}})[_0x95e4('0x15')](handleEntityNotFound(_0x3024f2,null))[_0x95e4('0x15')](function(_0x325acf){if(_0x325acf){_0x359bfd[_0x95e4('0x1d')]=_0x325acf[_0x95e4('0x72')]({'plain':!![]});return db[_0x95e4('0x73')][_0x95e4('0x4c')]({'where':{'id':_0x325acf[_0x95e4('0x74')]}});}return null;})[_0x95e4('0x15')](handleEntityNotFound(_0x3024f2,null))['then'](function(_0x3c33dd){if(_0x3c33dd){_0x359bfd[_0x95e4('0x76')]=_0x3c33dd['get']({'plain':!![]});interaction_log[_0x95e4('0x1e')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd56c7b['user']['id'],_0xd56c7b['user']['name'],_0xd56c7b['user'][_0x95e4('0x78')],_0x359bfd[_0x95e4('0x76')]['id'],_0xd56c7b['body']?JSON[_0x95e4('0x19')](_0xd56c7b[_0x95e4('0x4d')]):_0x95e4('0x79'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x359bfd);}return null;})[_0x95e4('0x15')](function(_0x2e20a4){var _0x1d53c5=_0x95e4('0x7c')+_0x2e20a4['message'][_0x95e4('0x7d')];return db[_0x95e4('0x7e')][_0x95e4('0x35')](_0x1d53c5,{'type':db[_0x95e4('0x7f')][_0x95e4('0x80')][_0x95e4('0x81')],'raw':!![]})[_0x95e4('0x15')](function(_0xd797a8){return _0xd797a8;});})[_0x95e4('0x15')](function(_0x7e24f2){if(_0x7e24f2){_0x359bfd['message']['contact']=_0x7e24f2[0x0];if(!_0xd56c7b['body'][_0x95e4('0x71')])return;return db[_0x95e4('0x83')][_0x95e4('0x4c')]({'where':{'id':_0xd56c7b[_0x95e4('0x4d')][_0x95e4('0x71')],'role':_0x95e4('0x90')},'attributes':['id',_0x95e4('0x2d'),_0x95e4('0x84'),_0x95e4('0x85'),_0x95e4('0x86')],'raw':!![]});}return null;})[_0x95e4('0x15')](function(_0x4edb42){if(!_0x4edb42)return null;_0x359bfd['message'][_0x95e4('0x90')]=_0x4edb42;return _0x359bfd;})[_0x95e4('0x15')](function(_0x3f7fc8){if(_0x3f7fc8){_0x3f7fc8[_0x95e4('0x1d')][_0x95e4('0x88')]=util['format'](_0x95e4('0x91'),_0xd56c7b['user']['name']);_0x3f7fc8['message']['channel']=_0x359bfd['channel'];_0x3f7fc8[_0x95e4('0x1d')][_0x95e4('0x8a')]=_0x359bfd[_0x95e4('0x89')];_0x3f7fc8[_0x95e4('0x1d')][_0x95e4('0x92')]='reject';_0x3f7fc8[_0x95e4('0x1d')][_0x95e4('0x4d')]=htmlToText[_0x95e4('0x8c')](_0x359bfd[_0x95e4('0x1d')][_0x95e4('0x4d')]);respondWithRpcPromise(_0x95e4('0x8d'),_0x95e4('0x8d'),{'event':_0x95e4('0x93'),'message':_0x3f7fc8[_0x95e4('0x1d')]},client9002);return _0x359bfd;}return null;})[_0x95e4('0x15')](respondWithResult(_0x3024f2,null))[_0x95e4('0x46')](handleError(_0x3024f2,null));};exports[_0x95e4('0x94')]=function(_0x41fac1,_0x1b615f){var _0x1af48c=moment()[_0x95e4('0x95')]()[_0x95e4('0x96')]();var _0x3dcd2e=path[_0x95e4('0x63')](config[_0x95e4('0x64')],_0x95e4('0x97'),_0x95e4('0x98'),_0x95e4('0x99'));var _0x37ad9f=path['join'](config[_0x95e4('0x64')],_0x95e4('0x97'),_0x95e4('0x98'),'attachments');var _0x2ef88c=util[_0x95e4('0x6c')](_0x95e4('0x9a'),_0x1af48c);return db['MailMessage'][_0x95e4('0x4c')]({'where':{'id':_0x41fac1[_0x95e4('0x48')]['id']},'attributes':['id','body',_0x95e4('0x9b'),'to','cc','bcc',_0x95e4('0x9c'),_0x95e4('0x9d')],'include':_0x41fac1[_0x95e4('0x35')][_0x95e4('0x62')]?[{'model':db['Attachment'],'as':_0x95e4('0x9e')}]:undefined})['then'](handleEntityNotFound(_0x1b615f,null))[_0x95e4('0x15')](function(_0x4d41ae){if(_0x4d41ae){var _0x160fce=_0x4d41ae;var _0x10faa7={'from':_0x160fce[_0x95e4('0x9b')],'to':_0x160fce['to'],'subject':_0x160fce['subject'],'html':htmlEntities[_0x95e4('0x9f')](_0x160fce[_0x95e4('0x4d')]),'headers':{'Date':moment(_0x160fce['createdAt'])[_0x95e4('0x6c')](_0x95e4('0xa0'))},'attachments':[]};if(_0x4d41ae['cc']){_0x10faa7[_0x95e4('0xa1')]['Cc']=_0x4d41ae['cc'];}if(_0x4d41ae['bcc']){_0x10faa7[_0x95e4('0xa1')]['Bcc']=_0x4d41ae[_0x95e4('0xa2')];}return new BPromise(function(_0x5cc677,_0x2743e3){if(_0x4d41ae[_0x95e4('0x9e')]){for(var _0x27399e=0x0;_0x27399e<_0x4d41ae[_0x95e4('0x9e')][_0x95e4('0x3a')];_0x27399e++){var _0x112a52=_0x4d41ae[_0x95e4('0x9e')][_0x27399e];var _0x131b5f=path[_0x95e4('0x63')](_0x37ad9f,_0x112a52[_0x95e4('0x66')]);if(fs[_0x95e4('0xa3')](_0x131b5f)){_0x10faa7[_0x95e4('0x62')]['push']({'name':_0x112a52['name'],'contentType':_0x112a52[_0x95e4('0x33')],'data':fs[_0x95e4('0xa4')](_0x131b5f)});}}}emlformat[_0x95e4('0xa5')](_0x10faa7,function(_0x333aee,_0x405351){if(_0x333aee)return _0x2743e3(_0x333aee);fs[_0x95e4('0xa6')](path[_0x95e4('0x63')](_0x3dcd2e,_0x2ef88c),_0x405351);return _0x5cc677(_0x405351);});});}})[_0x95e4('0x15')](function(_0x14df90){if(_0x14df90){return _0x1b615f[_0x95e4('0x94')](path[_0x95e4('0x63')](_0x3dcd2e,_0x2ef88c),_0x2ef88c,function(_0x850bb4){if(!_0x850bb4)fs[_0x95e4('0xa7')](path[_0x95e4('0x63')](_0x3dcd2e,_0x2ef88c));});}})[_0x95e4('0x46')](handleError(_0x1b615f,null));}; \ No newline at end of file +var _0x2acb=['defaults','localhost','socket.io-emitter','html-entities','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','status','offset','undefined','limit','set','Content-Range','json','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','MailMessage','findAll','rows','show','find','body','params','describe','create','direction','out','secret','split','findOne','MailAccountId','CmContact','DESC','MailServerOut','Smtp','service','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','SIP/%s','rejectmessage','download','join','server','files','tmp','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','build','eml-format','moment','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','redis'];(function(_0x168ad0,_0x45e98b){var _0x3596fc=function(_0x388510){while(--_0x388510){_0x168ad0['push'](_0x168ad0['shift']());}};_0x3596fc(++_0x45e98b);}(_0x2acb,0x13c));var _0xb2ac=function(_0x2015e2,_0x3bc9b1){_0x2015e2=_0x2015e2-0x0;var _0x428638=_0x2acb[_0x2015e2];return _0x428638;};'use strict';var emlformat=require(_0xb2ac('0x0'));var moment=require(_0xb2ac('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xb2ac('0x2'));var fs=require('fs');var _=require(_0xb2ac('0x3'));var Redis=require(_0xb2ac('0x4'));var htmlToText=require(_0xb2ac('0x5'));var qs=require(_0xb2ac('0x6'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xb2ac('0x7'))(_0xb2ac('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb2ac('0x9')]=_[_0xb2ac('0xa')](config[_0xb2ac('0x9')],{'host':_0xb2ac('0xb'),'port':0x18eb});var socket=require(_0xb2ac('0xc'))(new Redis(config['redis']));var htmlEntities=require(_0xb2ac('0xd'));require('./mailMessage.socket')[_0xb2ac('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb2ac('0xf')][_0xb2ac('0x10')]({'port':0x232c});var client9003=jayson['client'][_0xb2ac('0x10')]({'port':0x232b});var client9002=jayson[_0xb2ac('0xf')][_0xb2ac('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x3db963,_0x414b84,_0x574679,_0x15181a){return new BPromise(function(_0x39eeb6,_0x2fb1d2){var _0x57ad71=_0x15181a||client;return _0x57ad71[_0xb2ac('0x11')](_0x3db963,_0x574679)[_0xb2ac('0x12')](function(_0x535149){logger[_0xb2ac('0x13')](_0xb2ac('0x14'),_0x414b84,'request\x20sent');logger[_0xb2ac('0x15')](_0xb2ac('0x16'),_0x414b84,'request\x20sent',JSON[_0xb2ac('0x17')](_0x535149));if(_0x535149[_0xb2ac('0x18')]){if(_0x535149[_0xb2ac('0x18')]['code']===0x1f4){logger[_0xb2ac('0x18')](_0xb2ac('0x14'),_0x414b84,_0x535149[_0xb2ac('0x18')][_0xb2ac('0x19')]);return _0x2fb1d2(_0x535149[_0xb2ac('0x18')][_0xb2ac('0x19')]);}logger[_0xb2ac('0x18')](_0xb2ac('0x14'),_0x414b84,_0x535149[_0xb2ac('0x18')][_0xb2ac('0x19')]);return _0x39eeb6(_0x535149[_0xb2ac('0x18')][_0xb2ac('0x19')]);}else{logger[_0xb2ac('0x13')](_0xb2ac('0x14'),_0x414b84,_0xb2ac('0x1a'));_0x39eeb6(_0x535149[_0xb2ac('0x1b')]['message']);}})[_0xb2ac('0x1c')](function(_0x4af4cc){logger[_0xb2ac('0x18')]('MailMessage,\x20%s,\x20%s',_0x414b84,_0x4af4cc);_0x2fb1d2(_0x4af4cc);});});}function respondWithResult(_0x44a321,_0x93422d){_0x93422d=_0x93422d||0xc8;return function(_0x2272b6){if(_0x2272b6){return _0x44a321[_0xb2ac('0x1d')](_0x93422d)['json'](_0x2272b6);}};}function respondWithFilteredResult(_0x53a971,_0x1d8f58){return function(_0x2d1e46){if(_0x2d1e46){var _0x4fdea5=typeof _0x1d8f58[_0xb2ac('0x1e')]===_0xb2ac('0x1f')&&typeof _0x1d8f58[_0xb2ac('0x20')]==='undefined';var _0x1c0ece=_0x2d1e46['count'];var _0x2c748f=_0x4fdea5?0x0:_0x1d8f58['offset'];var _0x42f0a1=_0x4fdea5?_0x2d1e46['count']:_0x1d8f58['offset']+_0x1d8f58[_0xb2ac('0x20')];var _0x5dedab;if(_0x42f0a1>=_0x1c0ece){_0x42f0a1=_0x1c0ece;_0x5dedab=0xc8;}else{_0x5dedab=0xce;}_0x53a971[_0xb2ac('0x1d')](_0x5dedab);return _0x53a971[_0xb2ac('0x21')](_0xb2ac('0x22'),_0x2c748f+'-'+_0x42f0a1+'/'+_0x1c0ece)[_0xb2ac('0x23')](_0x2d1e46);}return null;};}function saveUpdates(_0x1cec35){return function(_0x4ab072){if(_0x4ab072){return _0x4ab072[_0xb2ac('0x24')](_0x1cec35)[_0xb2ac('0x12')](function(_0x46c8b4){return _0x46c8b4;});}return null;};}function removeEntity(_0x14cd78){return function(_0x675f43){if(_0x675f43){return _0x675f43[_0xb2ac('0x25')]()['then'](function(){_0x14cd78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x366acb){return function(_0xe52340){if(!_0xe52340){_0x366acb[_0xb2ac('0x26')](0x194);}return _0xe52340;};}function handleError(_0x381dcb,_0x4ce83f){_0x4ce83f=_0x4ce83f||0x1f4;return function(_0x4473c9){logger['error'](_0x4473c9[_0xb2ac('0x27')]);if(_0x4473c9['name']){delete _0x4473c9[_0xb2ac('0x28')];}_0x381dcb['status'](_0x4ce83f)[_0xb2ac('0x29')](_0x4473c9);};}exports[_0xb2ac('0x2a')]=function(_0x3f4fa2,_0x393f81){var _0x2f090d={},_0x364332={},_0x75ae18={'count':0x0,'rows':[]};var _0x2292cb=_[_0xb2ac('0x2b')](db['MailMessage'][_0xb2ac('0x2c')],function(_0x18c6a7){return{'name':_0x18c6a7['fieldName'],'type':_0x18c6a7[_0xb2ac('0x2d')][_0xb2ac('0x2e')]};});_0x364332[_0xb2ac('0x2f')]=_['map'](_0x2292cb,_0xb2ac('0x28'));_0x364332['query']=_[_0xb2ac('0x30')](_0x3f4fa2[_0xb2ac('0x31')]);_0x364332[_0xb2ac('0x32')]=_[_0xb2ac('0x33')](_0x364332[_0xb2ac('0x2f')],_0x364332['query']);_0x2f090d[_0xb2ac('0x34')]=_['intersection'](_0x364332[_0xb2ac('0x2f')],qs[_0xb2ac('0x35')](_0x3f4fa2[_0xb2ac('0x31')][_0xb2ac('0x35')]));_0x2f090d[_0xb2ac('0x34')]=_0x2f090d[_0xb2ac('0x34')][_0xb2ac('0x36')]?_0x2f090d[_0xb2ac('0x34')]:_0x364332[_0xb2ac('0x2f')];if(!_0x3f4fa2['query'][_0xb2ac('0x37')](_0xb2ac('0x38'))){_0x2f090d[_0xb2ac('0x20')]=qs['limit'](_0x3f4fa2[_0xb2ac('0x31')][_0xb2ac('0x20')]);_0x2f090d[_0xb2ac('0x1e')]=qs['offset'](_0x3f4fa2[_0xb2ac('0x31')][_0xb2ac('0x1e')]);}_0x2f090d['order']=qs[_0xb2ac('0x39')](_0x3f4fa2[_0xb2ac('0x31')][_0xb2ac('0x39')]);_0x2f090d[_0xb2ac('0x3a')]=qs['filters'](_[_0xb2ac('0x3b')](_0x3f4fa2['query'],_0x364332['filters']),_0x2292cb);if(_0x3f4fa2['query'][_0xb2ac('0x3c')]){_0x2f090d['where']=_[_0xb2ac('0x3d')](_0x2f090d[_0xb2ac('0x3a')],{'$or':_[_0xb2ac('0x2b')](_0x2292cb,function(_0x970e26){if(_0x970e26[_0xb2ac('0x2d')]!==_0xb2ac('0x3e')){var _0x5bb5bb={};_0x5bb5bb[_0x970e26[_0xb2ac('0x28')]]={'$like':'%'+_0x3f4fa2[_0xb2ac('0x31')][_0xb2ac('0x3c')]+'%'};return _0x5bb5bb;}})});}_0x2f090d=_['merge']({},_0x2f090d,_0x3f4fa2[_0xb2ac('0x3f')]);var _0x14311a={'where':_0x2f090d[_0xb2ac('0x3a')]};return db['MailMessage'][_0xb2ac('0x40')](_0x14311a)['then'](function(_0x2649f4){_0x75ae18['count']=_0x2649f4;if(_0x3f4fa2[_0xb2ac('0x31')][_0xb2ac('0x41')]){_0x2f090d[_0xb2ac('0x42')]=[{'all':!![]}];}return db[_0xb2ac('0x43')][_0xb2ac('0x44')](_0x2f090d);})[_0xb2ac('0x12')](function(_0x113ff4){_0x75ae18[_0xb2ac('0x45')]=_0x113ff4;return _0x75ae18;})['then'](respondWithFilteredResult(_0x393f81,_0x2f090d))['catch'](handleError(_0x393f81,null));};exports[_0xb2ac('0x46')]=function(_0x4feb32,_0x3d390d){var _0x3ea279={'raw':!![],'where':{'id':_0x4feb32['params']['id']}},_0x313d23={};_0x313d23[_0xb2ac('0x2f')]=_[_0xb2ac('0x30')](db['MailMessage'][_0xb2ac('0x2c')]);_0x313d23[_0xb2ac('0x31')]=_['keys'](_0x4feb32[_0xb2ac('0x31')]);_0x313d23[_0xb2ac('0x32')]=_[_0xb2ac('0x33')](_0x313d23[_0xb2ac('0x2f')],_0x313d23[_0xb2ac('0x31')]);_0x3ea279[_0xb2ac('0x34')]=_[_0xb2ac('0x33')](_0x313d23[_0xb2ac('0x2f')],qs['fields'](_0x4feb32[_0xb2ac('0x31')][_0xb2ac('0x35')]));_0x3ea279[_0xb2ac('0x34')]=_0x3ea279[_0xb2ac('0x34')][_0xb2ac('0x36')]?_0x3ea279[_0xb2ac('0x34')]:_0x313d23[_0xb2ac('0x2f')];if(_0x4feb32[_0xb2ac('0x31')][_0xb2ac('0x41')]){_0x3ea279['include']=[{'all':!![]}];}_0x3ea279=_[_0xb2ac('0x3d')]({},_0x3ea279,_0x4feb32[_0xb2ac('0x3f')]);return db[_0xb2ac('0x43')][_0xb2ac('0x47')](_0x3ea279)[_0xb2ac('0x12')](handleEntityNotFound(_0x3d390d,null))[_0xb2ac('0x12')](respondWithResult(_0x3d390d,null))[_0xb2ac('0x1c')](handleError(_0x3d390d,null));};exports[_0xb2ac('0x24')]=function(_0x3de777,_0x2aa5ad){if(_0x3de777[_0xb2ac('0x48')]['id']){delete _0x3de777['body']['id'];}return db['MailMessage'][_0xb2ac('0x47')]({'where':{'id':_0x3de777[_0xb2ac('0x49')]['id']}})['then'](handleEntityNotFound(_0x2aa5ad,null))[_0xb2ac('0x12')](saveUpdates(_0x3de777[_0xb2ac('0x48')],null))[_0xb2ac('0x12')](respondWithResult(_0x2aa5ad,null))[_0xb2ac('0x1c')](handleError(_0x2aa5ad,null));};exports[_0xb2ac('0x25')]=function(_0x3ccc91,_0xed41aa){return db[_0xb2ac('0x43')][_0xb2ac('0x47')]({'where':{'id':_0x3ccc91[_0xb2ac('0x49')]['id']}})[_0xb2ac('0x12')](handleEntityNotFound(_0xed41aa,null))[_0xb2ac('0x12')](removeEntity(_0xed41aa,null))[_0xb2ac('0x1c')](handleError(_0xed41aa,null));};exports[_0xb2ac('0x4a')]=function(_0x49cc61,_0x1ea76c){return db[_0xb2ac('0x43')]['describe']()[_0xb2ac('0x12')](respondWithResult(_0x1ea76c,null))[_0xb2ac('0x1c')](handleError(_0x1ea76c,null));};exports[_0xb2ac('0x4b')]=function(_0x4a2a83,_0x1d70f3){return db[_0xb2ac('0x43')]['create'](_0x4a2a83[_0xb2ac('0x48')])[_0xb2ac('0x12')](function(_0x1e9fbd){if(_0x1e9fbd){if(_0x1e9fbd[_0xb2ac('0x4c')]===_0xb2ac('0x4d')&&!_0x1e9fbd[_0xb2ac('0x4e')]){var _0x923c29,_0x197331,_0x46d7fb;if(_0x4a2a83[_0xb2ac('0x48')]['to']){_0x197331=_0x4a2a83[_0xb2ac('0x48')]['to'][_0xb2ac('0x4f')](',')[0x0];}return db['MailAccount'][_0xb2ac('0x50')]({'where':{'id':_0x1e9fbd[_0xb2ac('0x51')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb2ac('0x52')],'as':'Contacts','where':{'email':_0x197331},'limit':0x1,'order':[['updatedAt',_0xb2ac('0x53')]]}]},{'model':db[_0xb2ac('0x54')],'as':_0xb2ac('0x55'),'raw':!![]}]})[_0xb2ac('0x12')](function(_0x500df){_0x923c29=_0x500df;if(_0x923c29&&_0x923c29[_0xb2ac('0x55')]){var _0x3582ff={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x923c29[_0xb2ac('0x55')][_0xb2ac('0x56')])){_0x3582ff['host']=_0x923c29[_0xb2ac('0x55')]['host'];_0x3582ff[_0xb2ac('0x57')]=_0x923c29[_0xb2ac('0x55')][_0xb2ac('0x57')];_0x3582ff[_0xb2ac('0x58')]=_0x923c29['Smtp']['secure'];if(_0x923c29[_0xb2ac('0x55')][_0xb2ac('0x59')]){_0x3582ff[_0xb2ac('0x5a')]={'user':_0x923c29[_0xb2ac('0x55')][_0xb2ac('0x5b')],'pass':_0x923c29[_0xb2ac('0x55')][_0xb2ac('0x5c')]};}}else{_0x3582ff['service']=_0x923c29[_0xb2ac('0x55')]['service'];_0x3582ff[_0xb2ac('0x5a')]={'user':_0x923c29['Smtp'][_0xb2ac('0x5b')],'pass':_0x923c29[_0xb2ac('0x55')][_0xb2ac('0x5c')]};_0x3582ff['secure']=_0x923c29[_0xb2ac('0x55')]['secure'];}if(_0x4a2a83[_0xb2ac('0x48')][_0xb2ac('0x5d')]&&_0x4a2a83[_0xb2ac('0x48')][_0xb2ac('0x5d')][_0xb2ac('0x36')]){for(var _0x262689=0x0;_0x262689<_0x4a2a83[_0xb2ac('0x48')][_0xb2ac('0x5d')][_0xb2ac('0x36')];_0x262689+=0x1){_0x4a2a83[_0xb2ac('0x48')][_0xb2ac('0x5d')][_0x262689]={'filename':_0x4a2a83['body'][_0xb2ac('0x5d')][_0x262689][_0xb2ac('0x28')],'path':path['join'](config[_0xb2ac('0x5e')],_0xb2ac('0x5f'),_0x4a2a83[_0xb2ac('0x48')][_0xb2ac('0x5d')][_0x262689][_0xb2ac('0x60')])};}}_0x46d7fb={'account':_0x3582ff,'message':_0x4a2a83[_0xb2ac('0x48')]};return;}})[_0xb2ac('0x12')](function(){if(_0x923c29[_0xb2ac('0x61')]){if(_0x923c29[_0xb2ac('0x61')]['Contacts'][_0xb2ac('0x36')]){return _0x923c29[_0xb2ac('0x61')][_0xb2ac('0x62')][0x0];}else{return db[_0xb2ac('0x52')][_0xb2ac('0x4b')](_[_0xb2ac('0xa')](_0x4a2a83[_0xb2ac('0x48')],{'firstName':_0x4a2a83[_0xb2ac('0x48')]['to'],'email':_0x4a2a83[_0xb2ac('0x48')]['to'],'phone':_0x4a2a83[_0xb2ac('0x48')]['to'],'ListId':_0x923c29[_0xb2ac('0x63')]}));}}else{throw new Error(_0xb2ac('0x64'));}})[_0xb2ac('0x12')](function(){if(_0x46d7fb){return respondWithRpcPromise(_0xb2ac('0x65'),_0xb2ac('0x66'),_0x46d7fb,client9003)[_0xb2ac('0x12')](function(_0x54faa4){return _0x1e9fbd[_0xb2ac('0x24')]({'read':!![],'messageId':_0x54faa4[_0xb2ac('0x67')],'sentAt':moment()['format'](_0xb2ac('0x68'))});})[_0xb2ac('0x1c')](function(_0x5e0879){logger[_0xb2ac('0x18')]('%s',JSON[_0xb2ac('0x17')](_0x5e0879));return _0x1e9fbd;});}return _0x1e9fbd;});}return _0x1e9fbd;}})['then'](respondWithResult(_0x1d70f3,0xc9))[_0xb2ac('0x1c')](handleError(_0x1d70f3,null));};exports[_0xb2ac('0x69')]=function(_0x393dc3,_0xe8316e){var _0x3f7da3={'agent':{},'channel':_0xb2ac('0x6a')};if(_0x393dc3['body']['id']){delete _0x393dc3[_0xb2ac('0x48')]['id'];}_0x393dc3['body'][_0xb2ac('0x6b')]=!![];_0x393dc3['body'][_0xb2ac('0x6c')]=moment()[_0xb2ac('0x6d')](_0xb2ac('0x68'));_0x393dc3['body']['UserId']=_0x393dc3[_0xb2ac('0x48')][_0xb2ac('0x6e')]||_0x393dc3[_0xb2ac('0x5b')]['id'];_0x3f7da3[_0xb2ac('0x6f')]['id']=_0x393dc3[_0xb2ac('0x48')][_0xb2ac('0x6e')];return db[_0xb2ac('0x43')]['find']({'where':{'id':_0x393dc3[_0xb2ac('0x49')]['id'],'UserId':null}})[_0xb2ac('0x12')](handleEntityNotFound(_0xe8316e,null))['then'](saveUpdates(_0x393dc3[_0xb2ac('0x48')],null))[_0xb2ac('0x12')](function(_0x563c05){if(_0x563c05){_0x3f7da3[_0xb2ac('0x19')]=_0x563c05[_0xb2ac('0x70')]({'plain':!![]});return db[_0xb2ac('0x71')][_0xb2ac('0x47')]({'where':{'id':_0x563c05[_0xb2ac('0x72')]}});}return null;})[_0xb2ac('0x12')](handleEntityNotFound(_0xe8316e,null))[_0xb2ac('0x12')](function(_0x391486){if(_0x391486){return _0x391486['update']({'UserId':_0x393dc3[_0xb2ac('0x48')]['UserId'],'read1stAt':_[_0xb2ac('0x73')](_0x391486[_0xb2ac('0x74')])?moment()['format'](_0xb2ac('0x68')):undefined});}return null;})['then'](function(_0x47f4f6){if(_0x47f4f6){_0x3f7da3[_0xb2ac('0x75')]=_0x47f4f6[_0xb2ac('0x70')]({'plain':!![]});interaction_log[_0xb2ac('0x13')](_0xb2ac('0x76'),_0x393dc3[_0xb2ac('0x5b')]['id'],_0x393dc3['user'][_0xb2ac('0x28')],_0x393dc3[_0xb2ac('0x5b')]['role'],_0x3f7da3[_0xb2ac('0x75')]['id'],_0x393dc3[_0xb2ac('0x48')]?JSON[_0xb2ac('0x17')](_0x393dc3[_0xb2ac('0x48')]):_0xb2ac('0x77'));return respondWithRpcPromise(_0xb2ac('0x78'),_0xb2ac('0x79'),_0x3f7da3);}return null;})[_0xb2ac('0x12')](function(_0xc6af95){var _0x3eb420=_0xb2ac('0x7a')+_0xc6af95[_0xb2ac('0x19')]['ContactId'];return db['sequelize'][_0xb2ac('0x31')](_0x3eb420,{'type':db[_0xb2ac('0x7b')][_0xb2ac('0x7c')][_0xb2ac('0x7d')],'raw':!![]})[_0xb2ac('0x12')](function(_0x537eec){return _0x537eec;});})[_0xb2ac('0x12')](function(_0x1b47c3){if(_0x1b47c3){_0x3f7da3[_0xb2ac('0x19')][_0xb2ac('0x7e')]=_0x1b47c3[0x0];if(!_0x393dc3[_0xb2ac('0x48')][_0xb2ac('0x6e')])return;return db[_0xb2ac('0x7f')]['find']({'where':{'id':_0x393dc3[_0xb2ac('0x48')][_0xb2ac('0x6e')],'role':_0xb2ac('0x6f')},'attributes':['id',_0xb2ac('0x28'),_0xb2ac('0x80'),'email',_0xb2ac('0x81')],'raw':!![]});}return null;})[_0xb2ac('0x12')](function(_0x502e5a){if(!_0x502e5a)return null;_0x3f7da3['message'][_0xb2ac('0x6f')]=_0x502e5a;return _0x3f7da3;})[_0xb2ac('0x12')](function(_0x4f6732){if(_0x4f6732){if(_0x393dc3[_0xb2ac('0x48')][_0xb2ac('0x82')]){_0x3f7da3['message'][_0xb2ac('0x83')]=util[_0xb2ac('0x6d')]('SIP/%s',_0x393dc3[_0xb2ac('0x5b')][_0xb2ac('0x28')]);_0x3f7da3[_0xb2ac('0x19')][_0xb2ac('0x84')]=_0x3f7da3['channel'];_0x3f7da3[_0xb2ac('0x19')][_0xb2ac('0x85')]=_0x3f7da3['channel'];_0x3f7da3[_0xb2ac('0x19')][_0xb2ac('0x86')]=_0xb2ac('0x69');_0x3f7da3['message']['body']=htmlToText[_0xb2ac('0x87')](_0x3f7da3[_0xb2ac('0x19')][_0xb2ac('0x48')]);return respondWithRpcPromise(_0xb2ac('0x88'),_0xb2ac('0x88'),{'event':_0xb2ac('0x89'),'message':_0x3f7da3[_0xb2ac('0x19')]},client9002)[_0xb2ac('0x12')](function(){return _0x3f7da3;});}return _0x3f7da3;}return null;})[_0xb2ac('0x12')](respondWithResult(_0xe8316e,null))[_0xb2ac('0x1c')](handleError(_0xe8316e,null));};exports[_0xb2ac('0x8a')]=function(_0x2c9737,_0x27d8a){var _0x5ed4c1={'agent':{},'channel':_0xb2ac('0x6a')};if(_0x2c9737[_0xb2ac('0x48')]['id']){delete _0x2c9737[_0xb2ac('0x48')]['id'];}_0x2c9737['body'][_0xb2ac('0x6e')]=_0x2c9737['body'][_0xb2ac('0x6e')]||_0x2c9737[_0xb2ac('0x5b')]['id'];_0x5ed4c1[_0xb2ac('0x6f')]['id']=_0x2c9737[_0xb2ac('0x48')][_0xb2ac('0x6e')];return db[_0xb2ac('0x43')][_0xb2ac('0x47')]({'where':{'id':_0x2c9737['params']['id'],'UserId':null}})[_0xb2ac('0x12')](handleEntityNotFound(_0x27d8a,null))[_0xb2ac('0x12')](function(_0x1543af){if(_0x1543af){_0x5ed4c1[_0xb2ac('0x19')]=_0x1543af[_0xb2ac('0x70')]({'plain':!![]});return db[_0xb2ac('0x71')][_0xb2ac('0x47')]({'where':{'id':_0x1543af[_0xb2ac('0x72')]}});}return null;})[_0xb2ac('0x12')](handleEntityNotFound(_0x27d8a,null))['then'](function(_0xfbe58c){if(_0xfbe58c){_0x5ed4c1[_0xb2ac('0x75')]=_0xfbe58c['get']({'plain':!![]});interaction_log[_0xb2ac('0x13')](_0xb2ac('0x8b'),_0x2c9737[_0xb2ac('0x5b')]['id'],_0x2c9737[_0xb2ac('0x5b')][_0xb2ac('0x28')],_0x2c9737['user'][_0xb2ac('0x8c')],_0x5ed4c1['interaction']['id'],_0x2c9737[_0xb2ac('0x48')]?JSON[_0xb2ac('0x17')](_0x2c9737[_0xb2ac('0x48')]):_0xb2ac('0x77'));return respondWithRpcPromise(_0xb2ac('0x8d'),_0xb2ac('0x8e'),_0x5ed4c1);}return null;})[_0xb2ac('0x12')](function(_0x4d1fb6){var _0x19af47=_0xb2ac('0x7a')+_0x4d1fb6[_0xb2ac('0x19')][_0xb2ac('0x8f')];return db[_0xb2ac('0x90')][_0xb2ac('0x31')](_0x19af47,{'type':db[_0xb2ac('0x7b')][_0xb2ac('0x7c')][_0xb2ac('0x7d')],'raw':!![]})[_0xb2ac('0x12')](function(_0x5dc71a){return _0x5dc71a;});})['then'](function(_0x3ebb78){if(_0x3ebb78){_0x5ed4c1[_0xb2ac('0x19')]['contact']=_0x3ebb78[0x0];if(!_0x2c9737[_0xb2ac('0x48')][_0xb2ac('0x6e')])return;return db['User'][_0xb2ac('0x47')]({'where':{'id':_0x2c9737['body'][_0xb2ac('0x6e')],'role':_0xb2ac('0x6f')},'attributes':['id',_0xb2ac('0x28'),_0xb2ac('0x80'),'email',_0xb2ac('0x81')],'raw':!![]});}return null;})[_0xb2ac('0x12')](function(_0x1a324d){if(!_0x1a324d)return null;_0x5ed4c1[_0xb2ac('0x19')]['agent']=_0x1a324d;return _0x5ed4c1;})[_0xb2ac('0x12')](function(_0x1d118e){if(_0x1d118e){_0x1d118e[_0xb2ac('0x19')]['interface']=util[_0xb2ac('0x6d')](_0xb2ac('0x91'),_0x2c9737[_0xb2ac('0x5b')]['name']);_0x1d118e[_0xb2ac('0x19')][_0xb2ac('0x84')]=_0x5ed4c1['channel'];_0x1d118e[_0xb2ac('0x19')][_0xb2ac('0x85')]=_0x5ed4c1[_0xb2ac('0x84')];_0x1d118e['message'][_0xb2ac('0x86')]='reject';_0x1d118e[_0xb2ac('0x19')][_0xb2ac('0x48')]=htmlToText[_0xb2ac('0x87')](_0x5ed4c1[_0xb2ac('0x19')]['body']);respondWithRpcPromise(_0xb2ac('0x88'),_0xb2ac('0x88'),{'event':_0xb2ac('0x92'),'message':_0x1d118e[_0xb2ac('0x19')]},client9002);return _0x5ed4c1;}return null;})[_0xb2ac('0x12')](respondWithResult(_0x27d8a,null))[_0xb2ac('0x1c')](handleError(_0x27d8a,null));};exports[_0xb2ac('0x93')]=function(_0x4bd2a0,_0x623d79){var _0x1a2ef7=moment()['unix']()['toString']();var _0x2f2f90=path[_0xb2ac('0x94')](config['root'],_0xb2ac('0x95'),_0xb2ac('0x96'),_0xb2ac('0x97'));var _0x401df2=path[_0xb2ac('0x94')](config[_0xb2ac('0x5e')],'server',_0xb2ac('0x96'),_0xb2ac('0x5d'));var _0x1fb6f4=util['format']('message-%s.eml',_0x1a2ef7);return db['MailMessage'][_0xb2ac('0x47')]({'where':{'id':_0x4bd2a0[_0xb2ac('0x49')]['id']},'attributes':['id',_0xb2ac('0x48'),_0xb2ac('0x98'),'to','cc','bcc',_0xb2ac('0x99'),_0xb2ac('0x9a')],'include':_0x4bd2a0['query'][_0xb2ac('0x5d')]?[{'model':db[_0xb2ac('0x9b')],'as':_0xb2ac('0x9c')}]:undefined})[_0xb2ac('0x12')](handleEntityNotFound(_0x623d79,null))[_0xb2ac('0x12')](function(_0x4736c8){if(_0x4736c8){var _0x42864b=_0x4736c8;var _0x27060a={'from':_0x42864b[_0xb2ac('0x98')],'to':_0x42864b['to'],'subject':_0x42864b[_0xb2ac('0x99')],'html':htmlEntities[_0xb2ac('0x9d')](_0x42864b[_0xb2ac('0x48')]),'headers':{'Date':moment(_0x42864b[_0xb2ac('0x9a')])['format'](_0xb2ac('0x9e'))},'attachments':[]};if(_0x4736c8['cc']){_0x27060a[_0xb2ac('0x9f')]['Cc']=_0x4736c8['cc'];}if(_0x4736c8[_0xb2ac('0xa0')]){_0x27060a[_0xb2ac('0x9f')][_0xb2ac('0xa1')]=_0x4736c8['bcc'];}return new BPromise(function(_0x3dfa4c,_0x4de580){if(_0x4736c8[_0xb2ac('0x9c')]){for(var _0x49645d=0x0;_0x49645d<_0x4736c8[_0xb2ac('0x9c')]['length'];_0x49645d++){var _0x457331=_0x4736c8[_0xb2ac('0x9c')][_0x49645d];var _0x585de6=path[_0xb2ac('0x94')](_0x401df2,_0x457331[_0xb2ac('0x60')]);if(fs['existsSync'](_0x585de6)){_0x27060a[_0xb2ac('0x5d')]['push']({'name':_0x457331['name'],'contentType':_0x457331[_0xb2ac('0x2d')],'data':fs['readFileSync'](_0x585de6)});}}}emlformat[_0xb2ac('0xa2')](_0x27060a,function(_0x385d9b,_0x43d666){if(_0x385d9b)return _0x4de580(_0x385d9b);fs['writeFileSync'](path[_0xb2ac('0x94')](_0x2f2f90,_0x1fb6f4),_0x43d666);return _0x3dfa4c(_0x43d666);});});}})[_0xb2ac('0x12')](function(_0x5944fa){if(_0x5944fa){return _0x623d79[_0xb2ac('0x93')](path['join'](_0x2f2f90,_0x1fb6f4),_0x1fb6f4,function(_0x5b0208){if(!_0x5b0208)fs['unlinkSync'](path['join'](_0x2f2f90,_0x1fb6f4));});}})[_0xb2ac('0x1c')](handleError(_0x623d79,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d55badb..0562772 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 _0xea67=['MailMessage','setMaxListeners','save','remove','emit','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea67,0x173));var _0x7ea6=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xea67[_0x1b8f5a];return _0x594189;};'use strict';var EventEmitter=require(_0x7ea6('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x7ea6('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7ea6('0x2')](0x0);var events={'afterCreate':_0x7ea6('0x3'),'afterUpdate':'update','afterDestroy':_0x7ea6('0x4')};function emitEvent(_0x24d59c){return function(_0x139685,_0x37d346,_0x241819){MailMessageEvents[_0x7ea6('0x5')](_0x24d59c+':'+_0x139685['id'],_0x139685);MailMessageEvents[_0x7ea6('0x5')](_0x24d59c,_0x139685);_0x241819(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xdf78=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x37ea4a,_0x12474f){var _0x2b923d=function(_0x2de369){while(--_0x2de369){_0x37ea4a['push'](_0x37ea4a['shift']());}};_0x2b923d(++_0x12474f);}(_0xdf78,0x1a0));var _0x8df7=function(_0x467f2c,_0x421206){_0x467f2c=_0x467f2c-0x0;var _0x4ec816=_0xdf78[_0x467f2c];return _0x4ec816;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x8df7('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8df7('0x1')](0x0);var events={'afterCreate':_0x8df7('0x2'),'afterUpdate':_0x8df7('0x3'),'afterDestroy':_0x8df7('0x4')};function emitEvent(_0x53723a){return function(_0x563c9a,_0x1a63d8,_0x262ce1){MailMessageEvents['emit'](_0x53723a+':'+_0x563c9a['id'],_0x563c9a);MailMessageEvents[_0x8df7('0x5')](_0x53723a,_0x563c9a);_0x262ce1(null);};}for(var e in events){if(events[_0x8df7('0x6')](e)){var event=events[e];MailMessage[_0x8df7('0x7')](e,emitEvent(event));}}module[_0x8df7('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 56f80fb..4a7abbf 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 _0x39f5=['get','direction','toLowerCase','out','isNil','MailInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models'];(function(_0x2818d5,_0x5eea29){var _0xf68add=function(_0x235c2c){while(--_0x235c2c){_0x2818d5['push'](_0x2818d5['shift']());}};_0xf68add(++_0x5eea29);}(_0x39f5,0x142));var _0x539f=function(_0x10cece,_0x841a33){_0x10cece=_0x10cece-0x0;var _0x5101ac=_0x39f5[_0x10cece];return _0x5101ac;};'use strict';var _=require(_0x539f('0x0'));var util=require(_0x539f('0x1'));var logger=require(_0x539f('0x2'))('api');var moment=require(_0x539f('0x3'));var BPromise=require(_0x539f('0x4'));var rp=require('request-promise');var htmlToText=require(_0x539f('0x5'));var fs=require('fs');var path=require(_0x539f('0x6'));var rimraf=require(_0x539f('0x7'));var config=require(_0x539f('0x8'));var attributes=require(_0x539f('0x9'));module[_0x539f('0xa')]=function(_0x13aa96,_0x2ad09a){return _0x13aa96['define'](_0x539f('0xb'),attributes,{'tableName':_0x539f('0xc'),'paranoid':![],'indexes':[{'name':_0x539f('0xd'),'fields':[_0x539f('0xd')]},{'name':_0x539f('0xe'),'fields':[_0x539f('0xf'),'subject'],'type':_0x539f('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b62f5,_0x3723de,_0x429eae){if(_0x5b62f5[_0x539f('0x11')]){_0x5b62f5[_0x539f('0xf')]=htmlToText['fromString'](_0x5b62f5[_0x539f('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x429eae(null,_0x3723de);},'afterCreate':function(_0x4f3fe9,_0x5391ae,_0x6e94f3){var _0x52e14c=_0x13aa96[_0x539f('0x12')];var _0x4a312a=_0x4f3fe9[_0x539f('0x13')]({'plain':!![]});if(_0x4a312a['direction']['toLowerCase']()==='in'||_0x4a312a[_0x539f('0x14')][_0x539f('0x15')]()===_0x539f('0x16')&&!_0x4a312a['secret']&&!_[_0x539f('0x17')](_0x4a312a['UserId'])){_0x52e14c[_0x539f('0x18')][_0x539f('0x19')]({'where':{'id':_0x4a312a['MailInteractionId']}})['then'](function(_0x1e8f44){if(_0x1e8f44){_0x1e8f44['update']({'lastMsgAt':_0x4a312a[_0x539f('0x1a')],'lastMsgDirection':_0x4a312a[_0x539f('0x14')][_0x539f('0x15')]()});}})[_0x539f('0x1b')](function(_0x1878cc){console[_0x539f('0x1c')](_0x1878cc);});}_0x6e94f3();}},'charset':_0x539f('0x1d'),'collate':_0x539f('0x1e')});}; \ No newline at end of file +var _0x5e35=['models','get','direction','toLowerCase','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','exports','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5e35,0x1dd));var _0x55e3=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x5e35[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x55e3('0x0'));var util=require(_0x55e3('0x1'));var logger=require(_0x55e3('0x2'))(_0x55e3('0x3'));var moment=require(_0x55e3('0x4'));var BPromise=require('bluebird');var rp=require(_0x55e3('0x5'));var htmlToText=require(_0x55e3('0x6'));var fs=require('fs');var path=require(_0x55e3('0x7'));var rimraf=require(_0x55e3('0x8'));var config=require(_0x55e3('0x9'));var attributes=require('./mailMessage.attributes');module[_0x55e3('0xa')]=function(_0xc9546d,_0x56ebca){return _0xc9546d['define']('MailMessage',attributes,{'tableName':_0x55e3('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x55e3('0xc'),'fields':[_0x55e3('0xd'),_0x55e3('0xe')],'type':_0x55e3('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x530c41,_0xed78bb,_0x1a4db4){if(_0x530c41[_0x55e3('0x10')]){_0x530c41[_0x55e3('0xd')]=htmlToText[_0x55e3('0x11')](_0x530c41[_0x55e3('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1a4db4(null,_0xed78bb);},'afterCreate':function(_0x521b0c,_0x467552,_0x1ca2aa){var _0x3153d4=_0xc9546d[_0x55e3('0x12')];var _0x24691f=_0x521b0c[_0x55e3('0x13')]({'plain':!![]});if(_0x24691f[_0x55e3('0x14')][_0x55e3('0x15')]()==='in'||_0x24691f[_0x55e3('0x14')][_0x55e3('0x15')]()==='out'&&!_0x24691f['secret']&&!_[_0x55e3('0x16')](_0x24691f[_0x55e3('0x17')])){_0x3153d4[_0x55e3('0x18')][_0x55e3('0x19')]({'where':{'id':_0x24691f[_0x55e3('0x1a')]}})[_0x55e3('0x1b')](function(_0x5ec486){if(_0x5ec486){_0x5ec486[_0x55e3('0x1c')]({'lastMsgAt':_0x24691f[_0x55e3('0x1d')],'lastMsgDirection':_0x24691f[_0x55e3('0x14')][_0x55e3('0x15')]()});}})['catch'](function(_0x44e964){console[_0x55e3('0x1e')](_0x44e964);});}_0x1ca2aa();}},'charset':_0x55e3('0x1f'),'collate':_0x55e3('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index dde767b..962763a 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 _0xeb3b=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','body','options','then','CreateMailMessage','stringify','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3fa41f,_0x5a6b7a){var _0x132a9b=function(_0x489e6b){while(--_0x489e6b){_0x3fa41f['push'](_0x3fa41f['shift']());}};_0x132a9b(++_0x5a6b7a);}(_0xeb3b,0x19e));var _0xbeb3=function(_0xd307d9,_0x50e8e0){_0xd307d9=_0xd307d9-0x0;var _0x209bf8=_0xeb3b[_0xd307d9];return _0x209bf8;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});config[_0xbeb3('0xa')]=_[_0xbeb3('0xb')](config[_0xbeb3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbeb3('0xc'))(new Redis(config[_0xbeb3('0xa')]));require(_0xbeb3('0xd'))[_0xbeb3('0xe')](socket);function respondWithRpcPromise(_0x443396,_0x550805,_0x10161e){return new BPromise(function(_0x567333,_0x2d1e06){return client[_0xbeb3('0xf')](_0x443396,_0x10161e)['then'](function(_0x1dfff3){logger[_0xbeb3('0x10')](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));logger[_0xbeb3('0x13')](_0xbeb3('0x14'),_0x550805,'request\x20sent',JSON['stringify'](_0x1dfff3));if(_0x1dfff3[_0xbeb3('0x15')]){if(_0x1dfff3[_0xbeb3('0x15')]['code']===0x1f4){logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);return _0x2d1e06(_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);}logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3['error'][_0xbeb3('0x16')]);return _0x567333(_0x1dfff3['error']['message']);}else{logger['info'](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));_0x567333(_0x1dfff3[_0xbeb3('0x17')][_0xbeb3('0x16')]);}})['catch'](function(_0x233a62){logger[_0xbeb3('0x15')](_0xbeb3('0x11'),_0x550805,_0x233a62);_0x2d1e06(_0x233a62);});});}exports['CreateMailMessage']=function(_0x4af96f){var _0x31c1bf=this;return new Promise(function(_0x57e8b6,_0x1d917b){return db['MailMessage']['create'](_0x4af96f[_0xbeb3('0x18')],{'raw':_0x4af96f[_0xbeb3('0x19')]?_0x4af96f[_0xbeb3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbeb3('0x1a')](function(_0x18ea0f){logger['info'](_0xbeb3('0x1b'),_0x4af96f);logger[_0xbeb3('0x13')]('CreateMailMessage',_0x4af96f,JSON[_0xbeb3('0x1c')](_0x18ea0f));_0x57e8b6(_0x18ea0f);})[_0xbeb3('0x1d')](function(_0x16b079){logger[_0xbeb3('0x15')](_0xbeb3('0x1b'),_0x16b079[_0xbeb3('0x16')],_0x4af96f);_0x1d917b(_0x31c1bf[_0xbeb3('0x15')](0x1f4,_0x16b079[_0xbeb3('0x16')]));});});}; \ No newline at end of file +var _0x58a4=['create','body','options','raw','CreateMailMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x58a4,0xbf));var _0x458a=function(_0x5da01c,_0x53bf77){_0x5da01c=_0x5da01c-0x0;var _0x1216c2=_0x58a4[_0x5da01c];return _0x1216c2;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var moment=require(_0x458a('0x2'));var BPromise=require(_0x458a('0x3'));var rs=require(_0x458a('0x4'));var fs=require('fs');var Redis=require(_0x458a('0x5'));var db=require(_0x458a('0x6'))['db'];var utils=require(_0x458a('0x7'));var logger=require(_0x458a('0x8'))(_0x458a('0x9'));var config=require(_0x458a('0xa'));var jayson=require(_0x458a('0xb'));var client=jayson[_0x458a('0xc')]['http']({'port':0x232a});config['redis']=_[_0x458a('0xd')](config[_0x458a('0xe')],{'host':_0x458a('0xf'),'port':0x18eb});var socket=require(_0x458a('0x10'))(new Redis(config[_0x458a('0xe')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x185c5f,_0x45b79b,_0xaad5bf){return new BPromise(function(_0x2e1d67,_0x1ff87d){return client['request'](_0x185c5f,_0xaad5bf)[_0x458a('0x11')](function(_0x804e01){logger['info'](_0x458a('0x12'),_0x45b79b,_0x458a('0x13'));logger[_0x458a('0x14')](_0x458a('0x15'),_0x45b79b,_0x458a('0x13'),JSON['stringify'](_0x804e01));if(_0x804e01['error']){if(_0x804e01[_0x458a('0x16')]['code']===0x1f4){logger[_0x458a('0x16')](_0x458a('0x12'),_0x45b79b,_0x804e01[_0x458a('0x16')][_0x458a('0x17')]);return _0x1ff87d(_0x804e01[_0x458a('0x16')][_0x458a('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x45b79b,_0x804e01['error'][_0x458a('0x17')]);return _0x2e1d67(_0x804e01[_0x458a('0x16')][_0x458a('0x17')]);}else{logger['info'](_0x458a('0x12'),_0x45b79b,_0x458a('0x13'));_0x2e1d67(_0x804e01[_0x458a('0x18')][_0x458a('0x17')]);}})[_0x458a('0x19')](function(_0x4df9ef){logger['error'](_0x458a('0x12'),_0x45b79b,_0x4df9ef);_0x1ff87d(_0x4df9ef);});});}exports['CreateMailMessage']=function(_0x3302b7){var _0x398ff2=this;return new Promise(function(_0x47a202,_0x468416){return db['MailMessage'][_0x458a('0x1a')](_0x3302b7[_0x458a('0x1b')],{'raw':_0x3302b7['options']?_0x3302b7[_0x458a('0x1c')][_0x458a('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xa6b8ff){logger['info'](_0x458a('0x1e'),_0x3302b7);logger['debug'](_0x458a('0x1e'),_0x3302b7,JSON['stringify'](_0xa6b8ff));_0x47a202(_0xa6b8ff);})[_0x458a('0x19')](function(_0x911eaf){logger[_0x458a('0x16')](_0x458a('0x1e'),_0x911eaf[_0x458a('0x17')],_0x3302b7);_0x468416(_0x398ff2[_0x458a('0x16')](0x1f4,_0x911eaf[_0x458a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b679f5b..24ee32c 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 _0xbde8=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','update'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xbde8,0x155));var _0x8bde=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0xbde8[_0xf9a6cf];return _0x59e2bc;};'use strict';var MailMessageEvents=require(_0x8bde('0x0'));var events=[_0x8bde('0x1'),'remove',_0x8bde('0x2')];function createListener(_0x298116,_0x1480d1){return function(_0x5de776){_0x1480d1[_0x8bde('0x3')](_0x298116,_0x5de776);};}function removeListener(_0x235330,_0x1e3137){return function(){MailMessageEvents[_0x8bde('0x4')](_0x235330,_0x1e3137);};}exports[_0x8bde('0x5')]=function(_0x26e75c){for(var _0x2a3965=0x0,_0x2fa161=events[_0x8bde('0x6')];_0x2a3965<_0x2fa161;_0x2a3965++){var _0x54050c=events[_0x2a3965];var _0x9812c9=createListener(_0x8bde('0x7')+_0x54050c,_0x26e75c);MailMessageEvents['on'](_0x54050c,_0x9812c9);}}; \ No newline at end of file +var _0xcdc9=['update','emit','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0xcdc9,0x1a9));var _0x9cdc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xcdc9[_0x3bf83f];return _0x22c4a9;};'use strict';var MailMessageEvents=require(_0x9cdc('0x0'));var events=[_0x9cdc('0x1'),'remove',_0x9cdc('0x2')];function createListener(_0x37a6ff,_0x47eadb){return function(_0x50914f){_0x47eadb[_0x9cdc('0x3')](_0x37a6ff,_0x50914f);};}function removeListener(_0x3abe26,_0x395935){return function(){MailMessageEvents['removeListener'](_0x3abe26,_0x395935);};}exports[_0x9cdc('0x4')]=function(_0x27a164){for(var _0x26f3c0=0x0,_0x4110ea=events[_0x9cdc('0x5')];_0x26f3c0<_0x4110ea;_0x26f3c0++){var _0x1d4177=events[_0x26f3c0];var _0xa3d21c=createListener(_0x9cdc('0x6')+_0x1d4177,_0x27a164);MailMessageEvents['on'](_0x1d4177,_0xa3d21c);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 5845b54..1a7c319 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 _0xbbb9=['isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','put','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe'];(function(_0x22608f,_0x1ce6dd){var _0x3439b2=function(_0xaab1d7){while(--_0xaab1d7){_0x22608f['push'](_0x22608f['shift']());}};_0x3439b2(++_0x1ce6dd);}(_0xbbb9,0x108));var _0x9bbb=function(_0x2bb16a,_0x2e5c10){_0x2bb16a=_0x2bb16a-0x0;var _0x4ad74a=_0xbbb9[_0x2bb16a];return _0x4ad74a;};'use strict';var multer=require(_0x9bbb('0x0'));var util=require('util');var path=require(_0x9bbb('0x1'));var timeout=require(_0x9bbb('0x2'));var express=require(_0x9bbb('0x3'));var router=express['Router']();var fs_extra=require(_0x9bbb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9bbb('0x5'));var config=require(_0x9bbb('0x6'));var controller=require(_0x9bbb('0x7'));router[_0x9bbb('0x8')]('/',auth['isAuthenticated'](),controller[_0x9bbb('0x9')]);router[_0x9bbb('0x8')](_0x9bbb('0xa'),auth[_0x9bbb('0xb')](),controller[_0x9bbb('0xc')]);router['get'](_0x9bbb('0xd'),auth[_0x9bbb('0xb')](),controller[_0x9bbb('0xe')]);router['get'](_0x9bbb('0xf'),auth[_0x9bbb('0xb')](),controller[_0x9bbb('0x10')]);router[_0x9bbb('0x8')](_0x9bbb('0x11'),auth[_0x9bbb('0xb')](),controller[_0x9bbb('0x12')]);router[_0x9bbb('0x8')](_0x9bbb('0x13'),auth[_0x9bbb('0xb')](),controller['getAgents']);router[_0x9bbb('0x14')]('/',auth[_0x9bbb('0xb')](),controller['create']);router[_0x9bbb('0x14')](_0x9bbb('0x11'),auth[_0x9bbb('0xb')](),controller['addTeams']);router['post'](_0x9bbb('0x13'),auth[_0x9bbb('0xb')](),controller['addAgents']);router[_0x9bbb('0x15')](_0x9bbb('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9bbb('0x16')](_0x9bbb('0xd'),auth[_0x9bbb('0xb')](),controller['destroy']);router[_0x9bbb('0x16')](_0x9bbb('0x11'),auth[_0x9bbb('0xb')](),controller[_0x9bbb('0x17')]);router[_0x9bbb('0x16')]('/:id/users',auth[_0x9bbb('0xb')](),controller[_0x9bbb('0x18')]);module['exports']=router; \ No newline at end of file +var _0xd088=['isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','destroy','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','../../config/environment','./mailQueue.controller'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd088,0xec));var _0x8d08=function(_0x52f389,_0x2f2ace){_0x52f389=_0x52f389-0x0;var _0x5aba9e=_0xd088[_0x52f389];return _0x5aba9e;};'use strict';var multer=require(_0x8d08('0x0'));var util=require(_0x8d08('0x1'));var path=require('path');var timeout=require(_0x8d08('0x2'));var express=require(_0x8d08('0x3'));var router=express[_0x8d08('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d08('0x5'));var controller=require(_0x8d08('0x6'));router['get']('/',auth[_0x8d08('0x7')](),controller[_0x8d08('0x8')]);router[_0x8d08('0x9')](_0x8d08('0xa'),auth[_0x8d08('0x7')](),controller[_0x8d08('0xb')]);router[_0x8d08('0x9')](_0x8d08('0xc'),auth['isAuthenticated'](),controller[_0x8d08('0xd')]);router[_0x8d08('0x9')]('/:id/members',auth[_0x8d08('0x7')](),controller[_0x8d08('0xe')]);router[_0x8d08('0x9')](_0x8d08('0xf'),auth[_0x8d08('0x7')](),controller[_0x8d08('0x10')]);router[_0x8d08('0x9')](_0x8d08('0x11'),auth['isAuthenticated'](),controller[_0x8d08('0x12')]);router[_0x8d08('0x13')]('/',auth[_0x8d08('0x7')](),controller[_0x8d08('0x14')]);router[_0x8d08('0x13')]('/:id/teams',auth[_0x8d08('0x7')](),controller['addTeams']);router['post']('/:id/users',auth[_0x8d08('0x7')](),controller['addAgents']);router[_0x8d08('0x15')](_0x8d08('0xc'),auth[_0x8d08('0x7')](),controller[_0x8d08('0x16')]);router['delete'](_0x8d08('0xc'),auth[_0x8d08('0x7')](),controller[_0x8d08('0x17')]);router[_0x8d08('0x18')](_0x8d08('0xf'),auth[_0x8d08('0x7')](),controller['removeTeams']);router[_0x8d08('0x18')](_0x8d08('0x11'),auth[_0x8d08('0x7')](),controller[_0x8d08('0x19')]);module[_0x8d08('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index d075c53..38e95f8 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 _0x4e35=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4e35,0xde));var _0x54e3=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x4e35[_0x5834bc];return _0x3e183a;};'use strict';var Sequelize=require(_0x54e3('0x0'));module[_0x54e3('0x1')]={'name':{'type':Sequelize[_0x54e3('0x2')],'unique':_0x54e3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x54e3('0x2')]},'timeout':{'type':Sequelize[_0x54e3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x54e3('0x5')](_0x54e3('0x6'),_0x54e3('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xce9a=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x34d08f,_0x1afbc5){var _0x401cb2=function(_0x3eae0e){while(--_0x3eae0e){_0x34d08f['push'](_0x34d08f['shift']());}};_0x401cb2(++_0x1afbc5);}(_0xce9a,0x168));var _0xace9=function(_0x590691,_0x2d621d){_0x590691=_0x590691-0x0;var _0x11adbb=_0xce9a[_0x590691];return _0x11adbb;};'use strict';var Sequelize=require(_0xace9('0x0'));module[_0xace9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xace9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xace9('0x3')]},'timeout':{'type':Sequelize[_0xace9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xace9('0x5')](_0xace9('0x6'),'beepall',_0xace9('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index adaa546..71cffe6 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 _0x75be=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','destroy','then','get','MailQueues','UserProfileResource','error','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','MailQueue','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','describe','getMembers','findOne','UserMailQueue','nolimit','sort','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','value','transaction','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0xf7a9cf,_0x2cfa33){var _0x7fdc45=function(_0x44b354){while(--_0x44b354){_0xf7a9cf['push'](_0xf7a9cf['shift']());}};_0x7fdc45(++_0x2cfa33);}(_0x75be,0x197));var _0xe75b=function(_0x275226,_0x1e91f2){_0x275226=_0x275226-0x0;var _0x180739=_0x75be[_0x275226];return _0x180739;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe75b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe75b('0x1'));var BPromise=require(_0xe75b('0x2'));var Mustache=require(_0xe75b('0x3'));var util=require(_0xe75b('0x4'));var path=require(_0xe75b('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe75b('0x6'));var _=require(_0xe75b('0x7'));var squel=require(_0xe75b('0x8'));var crypto=require(_0xe75b('0x9'));var jsforce=require(_0xe75b('0xa'));var deskjs=require(_0xe75b('0xb'));var toCsv=require(_0xe75b('0xc'));var querystring=require(_0xe75b('0xd'));var Papa=require(_0xe75b('0xe'));var Redis=require(_0xe75b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe75b('0x10'));var hardwareService=require(_0xe75b('0x11'));var logger=require(_0xe75b('0x12'))(_0xe75b('0x13'));var utils=require(_0xe75b('0x14'));var config=require(_0xe75b('0x15'));var licenseUtil=require(_0xe75b('0x16'));var db=require(_0xe75b('0x17'))['db'];config[_0xe75b('0x18')]=_[_0xe75b('0x19')](config['redis'],{'host':_0xe75b('0x1a'),'port':0x18eb});var socket=require(_0xe75b('0x1b'))(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x141f44,_0x1c5851){_0x1c5851=_0x1c5851||0xcc;return function(_0x5cac09){if(_0x5cac09){return _0x141f44['sendStatus'](_0x1c5851);}return _0x141f44['status'](_0x1c5851)[_0xe75b('0x1c')]();};}function respondWithResult(_0x1cead6,_0x1a2ab6){_0x1a2ab6=_0x1a2ab6||0xc8;return function(_0x483d28){if(_0x483d28){return _0x1cead6[_0xe75b('0x1d')](_0x1a2ab6)['json'](_0x483d28);}};}function respondWithFilteredResult(_0x54a419,_0x4c02e0){return function(_0x581c70){if(_0x581c70){var _0x1abc9e=typeof _0x4c02e0['offset']===_0xe75b('0x1e')&&typeof _0x4c02e0['limit']==='undefined';var _0x2f8d4e=_0x581c70[_0xe75b('0x1f')];var _0x5023ba=_0x1abc9e?0x0:_0x4c02e0[_0xe75b('0x20')];var _0x3c7154=_0x1abc9e?_0x581c70[_0xe75b('0x1f')]:_0x4c02e0[_0xe75b('0x20')]+_0x4c02e0[_0xe75b('0x21')];var _0x50fa13;if(_0x3c7154>=_0x2f8d4e){_0x3c7154=_0x2f8d4e;_0x50fa13=0xc8;}else{_0x50fa13=0xce;}_0x54a419['status'](_0x50fa13);return _0x54a419['set'](_0xe75b('0x22'),_0x5023ba+'-'+_0x3c7154+'/'+_0x2f8d4e)[_0xe75b('0x23')](_0x581c70);}return null;};}function patchUpdates(_0x2fcfb7){return function(_0x723f57){try{jsonpatch[_0xe75b('0x24')](_0x723f57,_0x2fcfb7,!![]);}catch(_0x573387){return BPromise[_0xe75b('0x25')](_0x573387);}return _0x723f57[_0xe75b('0x26')]();};}function saveUpdates(_0x3e8142,_0x185776){return function(_0x445a26){if(_0x445a26){return _0x445a26['update'](_0x3e8142)['then'](function(_0x2ba225){return _0x2ba225;});}return null;};}function removeEntity(_0x19d62c,_0x2e7020){return function(_0x1272e7){if(_0x1272e7){return _0x1272e7[_0xe75b('0x27')]()[_0xe75b('0x28')](function(){var _0x44b083=_0x1272e7[_0xe75b('0x29')]({'plain':!![]});var _0x4f6390=_0xe75b('0x2a');return db[_0xe75b('0x2b')][_0xe75b('0x27')]({'where':{'type':_0x4f6390,'resourceId':_0x44b083['id']}})[_0xe75b('0x28')](function(){return _0x1272e7;});})[_0xe75b('0x28')](function(){_0x19d62c[_0xe75b('0x1d')](0xcc)[_0xe75b('0x1c')]();});}};}function handleEntityNotFound(_0x2e636f,_0x32db0c){return function(_0x16854e){if(!_0x16854e){_0x2e636f['sendStatus'](0x194);}return _0x16854e;};}function handleError(_0x4ae09f,_0xf89b9e){_0xf89b9e=_0xf89b9e||0x1f4;return function(_0x26bd61){logger[_0xe75b('0x2c')](_0x26bd61['stack']);if(_0x26bd61[_0xe75b('0x2d')]){delete _0x26bd61[_0xe75b('0x2d')];}_0x4ae09f[_0xe75b('0x1d')](_0xf89b9e)[_0xe75b('0x2e')](_0x26bd61);};}exports[_0xe75b('0x2f')]=function(_0x3dd110,_0x1fcd51){var _0x308002={},_0x58af50={},_0x537f34={'count':0x0,'rows':[]};var _0x553ae2=_['map'](db['MailQueue'][_0xe75b('0x30')],function(_0x399fa4){return{'name':_0x399fa4['fieldName'],'type':_0x399fa4[_0xe75b('0x31')]['key']};});_0x58af50[_0xe75b('0x32')]=_[_0xe75b('0x33')](_0x553ae2,_0xe75b('0x2d'));_0x58af50[_0xe75b('0x34')]=_[_0xe75b('0x35')](_0x3dd110[_0xe75b('0x34')]);_0x58af50[_0xe75b('0x36')]=_[_0xe75b('0x37')](_0x58af50[_0xe75b('0x32')],_0x58af50['query']);_0x308002[_0xe75b('0x38')]=_[_0xe75b('0x37')](_0x58af50[_0xe75b('0x32')],qs[_0xe75b('0x39')](_0x3dd110['query'][_0xe75b('0x39')]));_0x308002[_0xe75b('0x38')]=_0x308002['attributes']['length']?_0x308002[_0xe75b('0x38')]:_0x58af50[_0xe75b('0x32')];if(!_0x3dd110[_0xe75b('0x34')][_0xe75b('0x3a')]('nolimit')){_0x308002[_0xe75b('0x21')]=qs[_0xe75b('0x21')](_0x3dd110['query']['limit']);_0x308002[_0xe75b('0x20')]=qs[_0xe75b('0x20')](_0x3dd110[_0xe75b('0x34')][_0xe75b('0x20')]);}_0x308002['order']=qs['sort'](_0x3dd110[_0xe75b('0x34')]['sort']);_0x308002[_0xe75b('0x3b')]=qs[_0xe75b('0x36')](_[_0xe75b('0x3c')](_0x3dd110[_0xe75b('0x34')],_0x58af50[_0xe75b('0x36')]),_0x553ae2);if(_0x3dd110[_0xe75b('0x34')][_0xe75b('0x3d')]){_0x308002['where']=_[_0xe75b('0x3e')](_0x308002['where'],{'$or':_[_0xe75b('0x33')](_0x553ae2,function(_0x2a5b10){if(_0x2a5b10[_0xe75b('0x31')]!==_0xe75b('0x3f')){var _0x17a9ac={};_0x17a9ac[_0x2a5b10[_0xe75b('0x2d')]]={'$like':'%'+_0x3dd110['query'][_0xe75b('0x3d')]+'%'};return _0x17a9ac;}})});}_0x308002=_[_0xe75b('0x3e')]({},_0x308002,_0x3dd110[_0xe75b('0x40')]);var _0x1e5dda={'where':_0x308002[_0xe75b('0x3b')]};return db[_0xe75b('0x41')]['count'](_0x1e5dda)['then'](function(_0xc5c79d){_0x537f34['count']=_0xc5c79d;if(_0x3dd110[_0xe75b('0x34')][_0xe75b('0x42')]){_0x308002[_0xe75b('0x43')]=[{'all':!![]}];}return db[_0xe75b('0x41')][_0xe75b('0x44')](_0x308002);})[_0xe75b('0x28')](function(_0x9d3fe6){_0x537f34['rows']=_0x9d3fe6;return _0x537f34;})[_0xe75b('0x28')](respondWithFilteredResult(_0x1fcd51,_0x308002))[_0xe75b('0x45')](handleError(_0x1fcd51,null));};exports[_0xe75b('0x46')]=function(_0x344672,_0x43bd99){var _0x311d98={'raw':!![],'where':{'id':_0x344672[_0xe75b('0x47')]['id']}},_0x2ce7dc={};_0x2ce7dc[_0xe75b('0x32')]=_[_0xe75b('0x35')](db[_0xe75b('0x41')]['rawAttributes']);_0x2ce7dc[_0xe75b('0x34')]=_[_0xe75b('0x35')](_0x344672['query']);_0x2ce7dc[_0xe75b('0x36')]=_[_0xe75b('0x37')](_0x2ce7dc[_0xe75b('0x32')],_0x2ce7dc[_0xe75b('0x34')]);_0x311d98['attributes']=_[_0xe75b('0x37')](_0x2ce7dc[_0xe75b('0x32')],qs['fields'](_0x344672[_0xe75b('0x34')][_0xe75b('0x39')]));_0x311d98[_0xe75b('0x38')]=_0x311d98[_0xe75b('0x38')][_0xe75b('0x48')]?_0x311d98[_0xe75b('0x38')]:_0x2ce7dc[_0xe75b('0x32')];if(_0x344672[_0xe75b('0x34')][_0xe75b('0x42')]){_0x311d98['include']=[{'all':!![]}];}_0x311d98=_[_0xe75b('0x3e')]({},_0x311d98,_0x344672[_0xe75b('0x40')]);return db[_0xe75b('0x41')][_0xe75b('0x49')](_0x311d98)[_0xe75b('0x28')](handleEntityNotFound(_0x43bd99,null))[_0xe75b('0x28')](respondWithResult(_0x43bd99,null))[_0xe75b('0x45')](handleError(_0x43bd99,null));};exports[_0xe75b('0x4a')]=function(_0x5103c2,_0x2115ba){return db[_0xe75b('0x41')][_0xe75b('0x4a')](_0x5103c2[_0xe75b('0x4b')],{})[_0xe75b('0x28')](function(_0x9fd5e1){var _0xa25aa4=_0x5103c2[_0xe75b('0x4c')]['get']({'plain':!![]});if(!_0xa25aa4)throw new Error(_0xe75b('0x4d'));if(_0xa25aa4[_0xe75b('0x4e')]===_0xe75b('0x4c')){var _0x172b2b=_0x9fd5e1[_0xe75b('0x29')]({'plain':!![]});var _0x3ba14a='MailQueues';return db[_0xe75b('0x4f')]['find']({'where':{'name':_0x3ba14a,'userProfileId':_0xa25aa4['userProfileId']},'raw':!![]})[_0xe75b('0x28')](function(_0x55c455){if(_0x55c455&&_0x55c455[_0xe75b('0x50')]===0x0){return db[_0xe75b('0x2b')][_0xe75b('0x4a')]({'name':_0x172b2b[_0xe75b('0x2d')],'resourceId':_0x172b2b['id'],'type':_0x55c455[_0xe75b('0x2d')],'sectionId':_0x55c455['id']},{})['then'](function(){return _0x9fd5e1;});}else{return _0x9fd5e1;}})[_0xe75b('0x45')](function(_0x3441a6){logger[_0xe75b('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3441a6);throw _0x3441a6;});}return _0x9fd5e1;})[_0xe75b('0x28')](respondWithResult(_0x2115ba,0xc9))['catch'](handleError(_0x2115ba,null));};exports[_0xe75b('0x51')]=function(_0x35c445,_0x50b2aa){if(_0x35c445[_0xe75b('0x4b')]['id']){delete _0x35c445[_0xe75b('0x4b')]['id'];}return db[_0xe75b('0x41')][_0xe75b('0x49')]({'where':{'id':_0x35c445[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](handleEntityNotFound(_0x50b2aa,null))[_0xe75b('0x28')](saveUpdates(_0x35c445['body'],null))['then'](respondWithResult(_0x50b2aa,null))[_0xe75b('0x45')](handleError(_0x50b2aa,null));};exports['destroy']=function(_0x287505,_0x8a19e3){return db['MailQueue'][_0xe75b('0x49')]({'where':{'id':_0x287505[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](handleEntityNotFound(_0x8a19e3,null))[_0xe75b('0x28')](removeEntity(_0x8a19e3,null))[_0xe75b('0x45')](handleError(_0x8a19e3,null));};exports[_0xe75b('0x52')]=function(_0x4582fc,_0x4caf35){return db[_0xe75b('0x41')][_0xe75b('0x52')]()[_0xe75b('0x28')](respondWithResult(_0x4caf35,null))['catch'](handleError(_0x4caf35,null));};exports[_0xe75b('0x53')]=function(_0x2966b8,_0x4324f0,_0x4f3516){var _0x307ccc={'raw':!![],'where':{}},_0x5ac613={},_0x6b87c1;return db[_0xe75b('0x41')][_0xe75b('0x54')]({'where':{'id':_0x2966b8[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](handleEntityNotFound(_0x4324f0,null))[_0xe75b('0x28')](function(_0x141d83){if(_0x141d83){_0x6b87c1=_0x141d83[_0xe75b('0x29')]({'plain':!![]});_0x5ac613[_0xe75b('0x32')]=_['keys'](db[_0xe75b('0x55')][_0xe75b('0x30')]);_0x5ac613['query']=_[_0xe75b('0x35')](_0x2966b8['query']);_0x5ac613['filters']=_['intersection'](_0x5ac613[_0xe75b('0x32')],_0x5ac613['query']);_0x307ccc['attributes']=_[_0xe75b('0x37')](_0x5ac613[_0xe75b('0x32')],qs[_0xe75b('0x39')](_0x2966b8[_0xe75b('0x34')][_0xe75b('0x39')]));_0x307ccc[_0xe75b('0x38')]=_0x307ccc[_0xe75b('0x38')]['length']?_0x307ccc[_0xe75b('0x38')]:_0x5ac613[_0xe75b('0x32')];if(!_0x2966b8[_0xe75b('0x34')][_0xe75b('0x3a')](_0xe75b('0x56'))){_0x307ccc[_0xe75b('0x21')]=qs[_0xe75b('0x21')](_0x2966b8[_0xe75b('0x34')][_0xe75b('0x21')]);_0x307ccc[_0xe75b('0x20')]=qs[_0xe75b('0x20')](_0x2966b8[_0xe75b('0x34')][_0xe75b('0x20')]);}_0x307ccc['order']=qs[_0xe75b('0x57')](_0x2966b8[_0xe75b('0x34')][_0xe75b('0x57')]);_0x307ccc[_0xe75b('0x3b')]=qs[_0xe75b('0x36')](_[_0xe75b('0x3c')](_0x2966b8[_0xe75b('0x34')],_0x5ac613['filters']));_0x307ccc[_0xe75b('0x3b')][_0xe75b('0x58')]=_0x141d83['id'];if(_0x2966b8[_0xe75b('0x34')][_0xe75b('0x3d')]){_0x307ccc[_0xe75b('0x3b')]=_['merge'](_0x307ccc[_0xe75b('0x3b')],{'$or':_['map'](_0x307ccc[_0xe75b('0x38')],function(_0x1d5e07){var _0x367d73={};_0x367d73[_0x1d5e07]={'$like':'%'+_0x2966b8['query'][_0xe75b('0x3d')]+'%'};return _0x367d73;})});}_0x307ccc=_[_0xe75b('0x3e')]({},_0x307ccc,_0x2966b8[_0xe75b('0x40')]);return db[_0xe75b('0x55')][_0xe75b('0x44')](_0x307ccc);}})[_0xe75b('0x28')](function(_0x13f7a8){if(_0x13f7a8){return db[_0xe75b('0x59')][_0xe75b('0x5a')]({'where':{'id':_[_0xe75b('0x33')](_0x13f7a8,_0xe75b('0x5b')),'role':_0xe75b('0x5c')},'attributes':['id',_0xe75b('0x2d'),_0xe75b('0x5d'),_0xe75b('0x5e'),_0xe75b('0x5f')]});}})[_0xe75b('0x28')](function(_0x460524){if(_0x460524){return{'count':_0x460524[_0xe75b('0x1f')],'rows':_['map'](_0x460524['rows'],function(_0x3af270){return{'membername':_0x3af270[_0xe75b('0x2d')],'UserId':_0x3af270['id'],'queue_name':_0x6b87c1[_0xe75b('0x2d')],'MailQueueId':_0x6b87c1['id'],'interface':util[_0xe75b('0x60')](_0xe75b('0x61'),_0xe75b('0x62'),_0x3af270[_0xe75b('0x2d')]),'penalty':0x0,'paused':_0x3af270[_0xe75b('0x5d')],'createdAt':_0x3af270[_0xe75b('0x5f')],'updatedAt':_0x3af270[_0xe75b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe75b('0x28')](respondWithFilteredResult(_0x4324f0,_0x307ccc))['catch'](handleError(_0x4324f0,null));};exports[_0xe75b('0x63')]=function(_0x5d4be2,_0x3822bd,_0x170cc3){var _0x271d4f={};var _0x2519c4={};var _0x543b35;var _0x54800c;return db[_0xe75b('0x41')][_0xe75b('0x54')]({'where':{'id':_0x5d4be2[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](handleEntityNotFound(_0x3822bd,null))[_0xe75b('0x28')](function(_0x33d866){if(_0x33d866){_0x543b35=_0x33d866;_0x2519c4['model']=_[_0xe75b('0x35')](db[_0xe75b('0x64')][_0xe75b('0x30')]);_0x2519c4[_0xe75b('0x34')]=_['keys'](_0x5d4be2['query']);_0x2519c4[_0xe75b('0x36')]=_['intersection'](_0x2519c4[_0xe75b('0x32')],_0x2519c4[_0xe75b('0x34')]);_0x271d4f[_0xe75b('0x38')]=_[_0xe75b('0x37')](_0x2519c4[_0xe75b('0x32')],qs[_0xe75b('0x39')](_0x5d4be2[_0xe75b('0x34')][_0xe75b('0x39')]));_0x271d4f[_0xe75b('0x38')]=_0x271d4f[_0xe75b('0x38')][_0xe75b('0x48')]?_0x271d4f[_0xe75b('0x38')]:_0x2519c4[_0xe75b('0x32')];_0x271d4f[_0xe75b('0x65')]=qs[_0xe75b('0x57')](_0x5d4be2['query'][_0xe75b('0x57')]);_0x271d4f['where']=qs[_0xe75b('0x36')](_[_0xe75b('0x3c')](_0x5d4be2['query'],_0x2519c4[_0xe75b('0x36')]));if(_0x5d4be2[_0xe75b('0x34')][_0xe75b('0x3d')]){_0x271d4f[_0xe75b('0x3b')]=_[_0xe75b('0x3e')](_0x271d4f[_0xe75b('0x3b')],{'$or':_[_0xe75b('0x33')](_0x271d4f[_0xe75b('0x38')],function(_0x506066){var _0x2177d2={};_0x2177d2[_0x506066]={'$like':'%'+_0x5d4be2[_0xe75b('0x34')][_0xe75b('0x3d')]+'%'};return _0x2177d2;})});}_0x271d4f=_[_0xe75b('0x3e')]({},_0x271d4f,_0x5d4be2[_0xe75b('0x40')]);return _0x543b35[_0xe75b('0x63')](_0x271d4f);}})[_0xe75b('0x28')](function(_0x2a8c0a){if(_0x2a8c0a){_0x54800c=_0x2a8c0a[_0xe75b('0x48')];if(!_0x5d4be2[_0xe75b('0x34')]['hasOwnProperty'](_0xe75b('0x56'))){_0x271d4f[_0xe75b('0x21')]=qs[_0xe75b('0x21')](_0x5d4be2[_0xe75b('0x34')][_0xe75b('0x21')]);_0x271d4f[_0xe75b('0x20')]=qs['offset'](_0x5d4be2[_0xe75b('0x34')][_0xe75b('0x20')]);}return _0x543b35[_0xe75b('0x63')](_0x271d4f);}})[_0xe75b('0x28')](function(_0x3715e7){if(_0x3715e7){return _0x3715e7?{'count':_0x54800c,'rows':_0x3715e7}:null;}})[_0xe75b('0x28')](respondWithResult(_0x3822bd,null))[_0xe75b('0x45')](handleError(_0x3822bd,null));};exports[_0xe75b('0x66')]=function(_0xc6101a,_0x31c27a,_0x476f78){var _0x2869ab=_0xc6101a['body'][_0xe75b('0x67')];return db[_0xe75b('0x64')][_0xe75b('0x44')]({'where':{'id':_0x2869ab},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe75b('0x68'),'attributes':['id','name',_0xe75b('0x69'),_0xe75b('0x6a'),_0xe75b('0x6b')],'raw':!![]}]})['then'](function(_0x386603){if(_0x386603){var _0x4ae5bb=_[_0xe75b('0x6c')](_0x386603,function(_0x30c828){var _0x316b0c=_0x30c828['get']({'plain':!![]});return _0x316b0c[_0xe75b('0x68')];});return db[_0xe75b('0x41')][_0xe75b('0x49')]({'where':{'id':_0xc6101a['params']['id']}})[_0xe75b('0x28')](function(_0x39d201){return db[_0xe75b('0x6d')]['transaction'](function(_0x3f8b8e){return _0x39d201['addTeams'](_0x2869ab,{'transaction':_0x3f8b8e})['then'](function(){return BPromise[_0xe75b('0x6e')](_0x4ae5bb,function(_0x492ad3){return db[_0xe75b('0x55')]['findOrCreate']({'where':{'UserId':_0x492ad3['id'],'MailQueueId':_0xc6101a[_0xe75b('0x47')]['id']},'transaction':_0x3f8b8e});});})[_0xe75b('0x28')](function(){_0x4ae5bb[_0xe75b('0x6f')](function(_0x4f91d8){socket[_0xe75b('0x70')]('userMailQueue:save',{'UserId':_0x4f91d8['id'],'MailQueueId':_0x39d201['id']});});});});});}})[_0xe75b('0x28')](respondWithStatusCode(_0x31c27a,null))[_0xe75b('0x45')](handleError(_0x31c27a,null));};exports[_0xe75b('0x71')]=function(_0x1755bd,_0x2f3201,_0x48adb4){return db['Team'][_0xe75b('0x44')]({'where':{'id':_0x1755bd['query'][_0xe75b('0x67')]},'attributes':['id'],'include':[{'model':db[_0xe75b('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe75b('0x28')](handleEntityNotFound(_0x2f3201,null))[_0xe75b('0x28')](function(_0x4d20b3){var _0x2d2d84=_['map'](_0x4d20b3,'id');var _0x1fd6ad=[];var _0x5a482e=[];var _0x39857f=squel[_0xe75b('0x72')]();_0x39857f[_0xe75b('0x73')](_0xe75b('0x74'))[_0xe75b('0x75')](_0xe75b('0x76'),'tq')[_0xe75b('0x77')](_0xe75b('0x78'),'ut',_0xe75b('0x79'))[_0xe75b('0x3b')](_0xe75b('0x7a'),_0x1755bd['params']['id']);for(var _0x37be1c=0x0;_0x37be1c<_0x4d20b3[_0xe75b('0x48')];_0x37be1c+=0x1){let _0x1dad9d=_0x4d20b3[_0x37be1c];for(var _0x589e35=0x0;_0x589e35<_0x1dad9d[_0xe75b('0x68')][_0xe75b('0x48')];_0x589e35+=0x1){let _0x1b3e36=_0x1dad9d[_0xe75b('0x68')][_0x589e35];var _0x1919d3=_0x39857f[_0xe75b('0x7b')]();_0x1919d3['where']('ut.UserId\x20=\x20?',_0x1b3e36['id']);_0x5a482e[_0xe75b('0x7c')](db[_0xe75b('0x6d')]['query'](_0x1919d3[_0xe75b('0x7d')](),{'type':db[_0xe75b('0x6d')]['QueryTypes'][_0xe75b('0x7e')]})['then'](function(_0x57041e){if(_0x57041e[_0xe75b('0x48')]===0x1){return _0x1b3e36['id'];}else{var _0x47e788=_[_0xe75b('0x7f')](_[_0xe75b('0x33')](_0x57041e,_0xe75b('0x80')),function(_0x111950){return _[_0xe75b('0x81')](_0x2d2d84,_0x111950);});if(_0x47e788){return _0x1b3e36['id'];}}}));}}return BPromise['all'](_0x5a482e)['then'](function(_0x48c337){_0x1fd6ad=_(_0x1fd6ad)[_0xe75b('0x82')](_0x48c337)['compact']()[_0xe75b('0x83')]();return db[_0xe75b('0x41')][_0xe75b('0x49')]({'where':{'id':_0x1755bd[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](function(_0x3be200){return db['sequelize'][_0xe75b('0x84')](function(_0x292bcb){return _0x3be200[_0xe75b('0x71')](_0x1755bd[_0xe75b('0x34')][_0xe75b('0x67')],{'transaction':_0x292bcb})['then'](function(){if(!_['isEmpty'](_0x1fd6ad)){return _0x3be200['removeAgents'](_0x1fd6ad,{'transaction':_0x292bcb});}})[_0xe75b('0x28')](function(){_0x1fd6ad[_0xe75b('0x6f')](function(_0x9031f4){socket[_0xe75b('0x70')](_0xe75b('0x85'),{'UserId':_0x9031f4,'MailQueueId':_0x3be200['id']});});});});});});})[_0xe75b('0x28')](respondWithStatusCode(_0x2f3201,null))[_0xe75b('0x45')](handleError(_0x2f3201,null));};exports[_0xe75b('0x86')]=function(_0x16cca9,_0x1fff58,_0x21ce80){return db[_0xe75b('0x41')][_0xe75b('0x49')]({'where':{'id':_0x16cca9[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](handleEntityNotFound(_0x1fff58,null))[_0xe75b('0x28')](function(_0x58e394){if(_0x58e394){return _0x58e394[_0xe75b('0x86')](_0x16cca9['body'][_0xe75b('0x67')],_[_0xe75b('0x87')](_0x16cca9['body'],[_0xe75b('0x67'),'id'])||{})[_0xe75b('0x88')](function(_0x17d3f3){for(var _0x758cc7=0x0;_0x758cc7<_0x16cca9[_0xe75b('0x4b')]['ids'][_0xe75b('0x48')];_0x758cc7+=0x1){socket[_0xe75b('0x70')]('userMailQueue:save',{'UserId':Number(_0x16cca9['body'][_0xe75b('0x67')][_0x758cc7]),'MailQueueId':Number(_0x16cca9[_0xe75b('0x47')]['id'])});}return _0x17d3f3;});}})[_0xe75b('0x28')](respondWithResult(_0x1fff58,null))['catch'](handleError(_0x1fff58,null));};exports[_0xe75b('0x89')]=function(_0x202126,_0x1aa48e,_0x5c94ec){return db['MailQueue']['find']({'where':{'id':_0x202126[_0xe75b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1aa48e,null))[_0xe75b('0x28')](function(_0x3ee7de){if(_0x3ee7de){return _0x3ee7de['removeAgents'](_0x202126[_0xe75b('0x34')][_0xe75b('0x67')])['then'](function(){if(_[_0xe75b('0x8a')](_0x202126[_0xe75b('0x34')][_0xe75b('0x67')])){for(var _0x139559=0x0;_0x139559<_0x202126['query'][_0xe75b('0x67')][_0xe75b('0x48')];_0x139559+=0x1){socket['emit'](_0xe75b('0x85'),{'UserId':Number(_0x202126['query'][_0xe75b('0x67')][_0x139559]),'MailQueueId':Number(_0x202126[_0xe75b('0x47')]['id'])});}}else{socket['emit'](_0xe75b('0x85'),{'UserId':Number(_0x202126['query'][_0xe75b('0x67')]),'MailQueueId':Number(_0x202126[_0xe75b('0x47')]['id'])});}});}})[_0xe75b('0x28')](respondWithStatusCode(_0x1aa48e,null))[_0xe75b('0x45')](handleError(_0x1aa48e,null));};exports[_0xe75b('0x8b')]=function(_0x2b5fb2,_0x2f7e79,_0x55ac55){var _0x43e9f8={};var _0x29cad9={};var _0x1cc39e;var _0x526cf8;return db[_0xe75b('0x41')][_0xe75b('0x54')]({'where':{'id':_0x2b5fb2[_0xe75b('0x47')]['id']}})[_0xe75b('0x28')](handleEntityNotFound(_0x2f7e79,null))['then'](function(_0x1ffa96){if(_0x1ffa96){_0x1cc39e=_0x1ffa96;_0x29cad9['model']=_['keys'](db[_0xe75b('0x59')][_0xe75b('0x30')]);_0x29cad9['query']=_[_0xe75b('0x35')](_0x2b5fb2[_0xe75b('0x34')]);_0x29cad9[_0xe75b('0x36')]=_['intersection'](_0x29cad9[_0xe75b('0x32')],_0x29cad9[_0xe75b('0x34')]);_0x43e9f8[_0xe75b('0x38')]=_[_0xe75b('0x37')](_0x29cad9[_0xe75b('0x32')],qs[_0xe75b('0x39')](_0x2b5fb2[_0xe75b('0x34')][_0xe75b('0x39')]));_0x43e9f8['attributes']=_0x43e9f8[_0xe75b('0x38')][_0xe75b('0x48')]?_0x43e9f8[_0xe75b('0x38')]:_0x29cad9[_0xe75b('0x32')];_0x43e9f8['order']=qs[_0xe75b('0x57')](_0x2b5fb2[_0xe75b('0x34')][_0xe75b('0x57')]);_0x43e9f8[_0xe75b('0x3b')]=qs['filters'](_[_0xe75b('0x3c')](_0x2b5fb2[_0xe75b('0x34')],_0x29cad9[_0xe75b('0x36')]));if(_0x2b5fb2[_0xe75b('0x34')][_0xe75b('0x3d')]){_0x43e9f8[_0xe75b('0x3b')]=_[_0xe75b('0x3e')](_0x43e9f8[_0xe75b('0x3b')],{'$or':_['map'](_0x43e9f8[_0xe75b('0x38')],function(_0x4e3f6b){var _0x31ca81={};_0x31ca81[_0x4e3f6b]={'$like':'%'+_0x2b5fb2[_0xe75b('0x34')][_0xe75b('0x3d')]+'%'};return _0x31ca81;})});}_0x43e9f8=_['merge']({},_0x43e9f8,_0x2b5fb2['options']);return _0x1cc39e[_0xe75b('0x8b')](_0x43e9f8);}})[_0xe75b('0x28')](function(_0x43b5d6){if(_0x43b5d6){_0x526cf8=_0x43b5d6[_0xe75b('0x48')];if(!_0x2b5fb2['query'][_0xe75b('0x3a')]('nolimit')){_0x43e9f8['limit']=qs[_0xe75b('0x21')](_0x2b5fb2[_0xe75b('0x34')]['limit']);_0x43e9f8[_0xe75b('0x20')]=qs['offset'](_0x2b5fb2['query'][_0xe75b('0x20')]);}return _0x1cc39e['getAgents'](_0x43e9f8);}})[_0xe75b('0x28')](function(_0x352781){if(_0x352781){return _0x352781?{'count':_0x526cf8,'rows':_0x352781}:null;}})[_0xe75b('0x28')](respondWithResult(_0x2f7e79,null))[_0xe75b('0x45')](handleError(_0x2f7e79,null));}; \ No newline at end of file +var _0x4242=['SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','userMailQueue:save','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserMailQueue','MailQueueId','findAll','User','UserId','createdAt','format','%s/%s'];(function(_0x5eac86,_0x4562db){var _0x3430e4=function(_0x3fbf1c){while(--_0x3fbf1c){_0x5eac86['push'](_0x5eac86['shift']());}};_0x3430e4(++_0x4562db);}(_0x4242,0xb5));var _0x2424=function(_0x697f7f,_0x5c0381){_0x697f7f=_0x697f7f-0x0;var _0x459cda=_0x4242[_0x697f7f];return _0x459cda;};'use strict';var emlformat=require(_0x2424('0x0'));var rimraf=require(_0x2424('0x1'));var zipdir=require(_0x2424('0x2'));var jsonpatch=require(_0x2424('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2424('0x4'));var Mustache=require(_0x2424('0x5'));var util=require(_0x2424('0x6'));var path=require('path');var sox=require(_0x2424('0x7'));var csv=require(_0x2424('0x8'));var ejs=require(_0x2424('0x9'));var fs=require('fs');var fs_extra=require(_0x2424('0xa'));var _=require(_0x2424('0xb'));var squel=require('squel');var crypto=require(_0x2424('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2424('0x8'));var querystring=require(_0x2424('0xd'));var Papa=require(_0x2424('0xe'));var Redis=require('ioredis');var authService=require(_0x2424('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2424('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2424('0x11'))(_0x2424('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2424('0x13'));var db=require('../../mysqldb')['db'];config[_0x2424('0x14')]=_[_0x2424('0x15')](config['redis'],{'host':_0x2424('0x16'),'port':0x18eb});var socket=require(_0x2424('0x17'))(new Redis(config[_0x2424('0x14')]));require(_0x2424('0x18'))[_0x2424('0x19')](socket);function respondWithStatusCode(_0x28d9eb,_0x4ac440){_0x4ac440=_0x4ac440||0xcc;return function(_0x8a5c73){if(_0x8a5c73){return _0x28d9eb['sendStatus'](_0x4ac440);}return _0x28d9eb['status'](_0x4ac440)['end']();};}function respondWithResult(_0x9798ad,_0x55d57f){_0x55d57f=_0x55d57f||0xc8;return function(_0x1065a0){if(_0x1065a0){return _0x9798ad[_0x2424('0x1a')](_0x55d57f)[_0x2424('0x1b')](_0x1065a0);}};}function respondWithFilteredResult(_0x363a15,_0x153d7b){return function(_0x26a9ce){if(_0x26a9ce){var _0x540c7a=typeof _0x153d7b[_0x2424('0x1c')]==='undefined'&&typeof _0x153d7b['limit']===_0x2424('0x1d');var _0x390b4c=_0x26a9ce[_0x2424('0x1e')];var _0x18b8c3=_0x540c7a?0x0:_0x153d7b['offset'];var _0x51a8a5=_0x540c7a?_0x26a9ce[_0x2424('0x1e')]:_0x153d7b['offset']+_0x153d7b[_0x2424('0x1f')];var _0x14e96b;if(_0x51a8a5>=_0x390b4c){_0x51a8a5=_0x390b4c;_0x14e96b=0xc8;}else{_0x14e96b=0xce;}_0x363a15[_0x2424('0x1a')](_0x14e96b);return _0x363a15[_0x2424('0x20')](_0x2424('0x21'),_0x18b8c3+'-'+_0x51a8a5+'/'+_0x390b4c)[_0x2424('0x1b')](_0x26a9ce);}return null;};}function patchUpdates(_0x4e7f2d){return function(_0x2b14fb){try{jsonpatch[_0x2424('0x22')](_0x2b14fb,_0x4e7f2d,!![]);}catch(_0xf2352f){return BPromise[_0x2424('0x23')](_0xf2352f);}return _0x2b14fb[_0x2424('0x24')]();};}function saveUpdates(_0x4787cc,_0x4ff014){return function(_0x1c3f42){if(_0x1c3f42){return _0x1c3f42[_0x2424('0x25')](_0x4787cc)[_0x2424('0x26')](function(_0x346576){return _0x346576;});}return null;};}function removeEntity(_0x45470e,_0x2d955a){return function(_0x94be60){if(_0x94be60){return _0x94be60[_0x2424('0x27')]()[_0x2424('0x26')](function(){var _0x1f9e84=_0x94be60[_0x2424('0x28')]({'plain':!![]});var _0x1e9f18=_0x2424('0x29');return db[_0x2424('0x2a')][_0x2424('0x27')]({'where':{'type':_0x1e9f18,'resourceId':_0x1f9e84['id']}})[_0x2424('0x26')](function(){return _0x94be60;});})[_0x2424('0x26')](function(){_0x45470e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf97848,_0x2cef02){return function(_0x6e5406){if(!_0x6e5406){_0xf97848['sendStatus'](0x194);}return _0x6e5406;};}function handleError(_0x3436d3,_0x25e0fa){_0x25e0fa=_0x25e0fa||0x1f4;return function(_0x359d0b){logger[_0x2424('0x2b')](_0x359d0b[_0x2424('0x2c')]);if(_0x359d0b[_0x2424('0x2d')]){delete _0x359d0b['name'];}_0x3436d3[_0x2424('0x1a')](_0x25e0fa)[_0x2424('0x2e')](_0x359d0b);};}exports[_0x2424('0x2f')]=function(_0x47236d,_0x3a5fff){var _0x2e685a={},_0x49c1ce={},_0x1e475a={'count':0x0,'rows':[]};var _0x21b68f=_[_0x2424('0x30')](db[_0x2424('0x31')][_0x2424('0x32')],function(_0x139eb6){return{'name':_0x139eb6[_0x2424('0x33')],'type':_0x139eb6[_0x2424('0x34')][_0x2424('0x35')]};});_0x49c1ce[_0x2424('0x36')]=_[_0x2424('0x30')](_0x21b68f,_0x2424('0x2d'));_0x49c1ce[_0x2424('0x37')]=_[_0x2424('0x38')](_0x47236d[_0x2424('0x37')]);_0x49c1ce[_0x2424('0x39')]=_[_0x2424('0x3a')](_0x49c1ce[_0x2424('0x36')],_0x49c1ce[_0x2424('0x37')]);_0x2e685a['attributes']=_[_0x2424('0x3a')](_0x49c1ce[_0x2424('0x36')],qs[_0x2424('0x3b')](_0x47236d[_0x2424('0x37')][_0x2424('0x3b')]));_0x2e685a[_0x2424('0x3c')]=_0x2e685a[_0x2424('0x3c')]['length']?_0x2e685a[_0x2424('0x3c')]:_0x49c1ce[_0x2424('0x36')];if(!_0x47236d[_0x2424('0x37')][_0x2424('0x3d')](_0x2424('0x3e'))){_0x2e685a[_0x2424('0x1f')]=qs[_0x2424('0x1f')](_0x47236d[_0x2424('0x37')]['limit']);_0x2e685a[_0x2424('0x1c')]=qs[_0x2424('0x1c')](_0x47236d[_0x2424('0x37')][_0x2424('0x1c')]);}_0x2e685a[_0x2424('0x3f')]=qs['sort'](_0x47236d[_0x2424('0x37')][_0x2424('0x40')]);_0x2e685a['where']=qs[_0x2424('0x39')](_[_0x2424('0x41')](_0x47236d[_0x2424('0x37')],_0x49c1ce[_0x2424('0x39')]),_0x21b68f);if(_0x47236d[_0x2424('0x37')][_0x2424('0x42')]){_0x2e685a[_0x2424('0x43')]=_['merge'](_0x2e685a[_0x2424('0x43')],{'$or':_[_0x2424('0x30')](_0x21b68f,function(_0x48dfd6){if(_0x48dfd6[_0x2424('0x34')]!==_0x2424('0x44')){var _0x492c68={};_0x492c68[_0x48dfd6[_0x2424('0x2d')]]={'$like':'%'+_0x47236d[_0x2424('0x37')][_0x2424('0x42')]+'%'};return _0x492c68;}})});}_0x2e685a=_[_0x2424('0x45')]({},_0x2e685a,_0x47236d['options']);var _0x29087a={'where':_0x2e685a['where']};return db['MailQueue'][_0x2424('0x1e')](_0x29087a)['then'](function(_0x2eb008){_0x1e475a['count']=_0x2eb008;if(_0x47236d[_0x2424('0x37')][_0x2424('0x46')]){_0x2e685a[_0x2424('0x47')]=[{'all':!![]}];}return db[_0x2424('0x31')]['findAll'](_0x2e685a);})['then'](function(_0xe497e9){_0x1e475a[_0x2424('0x48')]=_0xe497e9;return _0x1e475a;})[_0x2424('0x26')](respondWithFilteredResult(_0x3a5fff,_0x2e685a))[_0x2424('0x49')](handleError(_0x3a5fff,null));};exports[_0x2424('0x4a')]=function(_0x301716,_0x2de0f2){var _0x284fe8={'raw':!![],'where':{'id':_0x301716[_0x2424('0x4b')]['id']}},_0x2c56d6={};_0x2c56d6['model']=_[_0x2424('0x38')](db[_0x2424('0x31')][_0x2424('0x32')]);_0x2c56d6[_0x2424('0x37')]=_[_0x2424('0x38')](_0x301716[_0x2424('0x37')]);_0x2c56d6['filters']=_[_0x2424('0x3a')](_0x2c56d6[_0x2424('0x36')],_0x2c56d6[_0x2424('0x37')]);_0x284fe8[_0x2424('0x3c')]=_[_0x2424('0x3a')](_0x2c56d6['model'],qs[_0x2424('0x3b')](_0x301716[_0x2424('0x37')][_0x2424('0x3b')]));_0x284fe8[_0x2424('0x3c')]=_0x284fe8[_0x2424('0x3c')][_0x2424('0x4c')]?_0x284fe8['attributes']:_0x2c56d6[_0x2424('0x36')];if(_0x301716['query']['includeAll']){_0x284fe8[_0x2424('0x47')]=[{'all':!![]}];}_0x284fe8=_[_0x2424('0x45')]({},_0x284fe8,_0x301716[_0x2424('0x4d')]);return db[_0x2424('0x31')][_0x2424('0x4e')](_0x284fe8)['then'](handleEntityNotFound(_0x2de0f2,null))[_0x2424('0x26')](respondWithResult(_0x2de0f2,null))[_0x2424('0x49')](handleError(_0x2de0f2,null));};exports[_0x2424('0x4f')]=function(_0x16efe3,_0x1c3e9d){return db[_0x2424('0x31')][_0x2424('0x4f')](_0x16efe3[_0x2424('0x50')],{})[_0x2424('0x26')](function(_0x8c09c){var _0x103ce7=_0x16efe3[_0x2424('0x51')]['get']({'plain':!![]});if(!_0x103ce7)throw new Error(_0x2424('0x52'));if(_0x103ce7['role']===_0x2424('0x51')){var _0x41e97b=_0x8c09c['get']({'plain':!![]});var _0x12c8d0=_0x2424('0x29');return db[_0x2424('0x53')][_0x2424('0x4e')]({'where':{'name':_0x12c8d0,'userProfileId':_0x103ce7[_0x2424('0x54')]},'raw':!![]})[_0x2424('0x26')](function(_0x25ed24){if(_0x25ed24&&_0x25ed24[_0x2424('0x55')]===0x0){return db[_0x2424('0x2a')][_0x2424('0x4f')]({'name':_0x41e97b['name'],'resourceId':_0x41e97b['id'],'type':_0x25ed24['name'],'sectionId':_0x25ed24['id']},{})[_0x2424('0x26')](function(){return _0x8c09c;});}else{return _0x8c09c;}})[_0x2424('0x49')](function(_0x22b37e){logger[_0x2424('0x2b')](_0x2424('0x56'),_0x22b37e);throw _0x22b37e;});}return _0x8c09c;})[_0x2424('0x26')](respondWithResult(_0x1c3e9d,0xc9))[_0x2424('0x49')](handleError(_0x1c3e9d,null));};exports[_0x2424('0x25')]=function(_0x3735bf,_0x1bc8bd){if(_0x3735bf[_0x2424('0x50')]['id']){delete _0x3735bf[_0x2424('0x50')]['id'];}return db[_0x2424('0x31')][_0x2424('0x4e')]({'where':{'id':_0x3735bf[_0x2424('0x4b')]['id']}})[_0x2424('0x26')](handleEntityNotFound(_0x1bc8bd,null))[_0x2424('0x26')](saveUpdates(_0x3735bf['body'],null))[_0x2424('0x26')](respondWithResult(_0x1bc8bd,null))[_0x2424('0x49')](handleError(_0x1bc8bd,null));};exports['destroy']=function(_0x6d9b48,_0x491ce4){return db[_0x2424('0x31')][_0x2424('0x4e')]({'where':{'id':_0x6d9b48['params']['id']}})['then'](handleEntityNotFound(_0x491ce4,null))[_0x2424('0x26')](removeEntity(_0x491ce4,null))['catch'](handleError(_0x491ce4,null));};exports['describe']=function(_0x47e1ec,_0x4201b6){return db[_0x2424('0x31')]['describe']()[_0x2424('0x26')](respondWithResult(_0x4201b6,null))[_0x2424('0x49')](handleError(_0x4201b6,null));};exports[_0x2424('0x57')]=function(_0x48602f,_0x9fc6fb,_0x17a334){var _0x36c772={'raw':!![],'where':{}},_0x4cd53b={},_0x133e46;return db['MailQueue'][_0x2424('0x58')]({'where':{'id':_0x48602f[_0x2424('0x4b')]['id']}})[_0x2424('0x26')](handleEntityNotFound(_0x9fc6fb,null))[_0x2424('0x26')](function(_0x49b040){if(_0x49b040){_0x133e46=_0x49b040['get']({'plain':!![]});_0x4cd53b[_0x2424('0x36')]=_['keys'](db[_0x2424('0x59')][_0x2424('0x32')]);_0x4cd53b['query']=_['keys'](_0x48602f[_0x2424('0x37')]);_0x4cd53b[_0x2424('0x39')]=_[_0x2424('0x3a')](_0x4cd53b[_0x2424('0x36')],_0x4cd53b[_0x2424('0x37')]);_0x36c772[_0x2424('0x3c')]=_[_0x2424('0x3a')](_0x4cd53b[_0x2424('0x36')],qs[_0x2424('0x3b')](_0x48602f['query'][_0x2424('0x3b')]));_0x36c772[_0x2424('0x3c')]=_0x36c772[_0x2424('0x3c')]['length']?_0x36c772[_0x2424('0x3c')]:_0x4cd53b[_0x2424('0x36')];if(!_0x48602f[_0x2424('0x37')][_0x2424('0x3d')]('nolimit')){_0x36c772[_0x2424('0x1f')]=qs[_0x2424('0x1f')](_0x48602f['query']['limit']);_0x36c772['offset']=qs[_0x2424('0x1c')](_0x48602f[_0x2424('0x37')][_0x2424('0x1c')]);}_0x36c772[_0x2424('0x3f')]=qs[_0x2424('0x40')](_0x48602f[_0x2424('0x37')][_0x2424('0x40')]);_0x36c772['where']=qs[_0x2424('0x39')](_[_0x2424('0x41')](_0x48602f[_0x2424('0x37')],_0x4cd53b[_0x2424('0x39')]));_0x36c772[_0x2424('0x43')][_0x2424('0x5a')]=_0x49b040['id'];if(_0x48602f[_0x2424('0x37')]['filter']){_0x36c772[_0x2424('0x43')]=_[_0x2424('0x45')](_0x36c772[_0x2424('0x43')],{'$or':_[_0x2424('0x30')](_0x36c772['attributes'],function(_0xc0c2ee){var _0x3a3b76={};_0x3a3b76[_0xc0c2ee]={'$like':'%'+_0x48602f[_0x2424('0x37')][_0x2424('0x42')]+'%'};return _0x3a3b76;})});}_0x36c772=_[_0x2424('0x45')]({},_0x36c772,_0x48602f['options']);return db[_0x2424('0x59')][_0x2424('0x5b')](_0x36c772);}})[_0x2424('0x26')](function(_0x5f52f1){if(_0x5f52f1){return db[_0x2424('0x5c')]['findAndCountAll']({'where':{'id':_[_0x2424('0x30')](_0x5f52f1,_0x2424('0x5d')),'role':'agent'},'attributes':['id','name','mailPause','updatedAt',_0x2424('0x5e')]});}})[_0x2424('0x26')](function(_0x787be6){if(_0x787be6){return{'count':_0x787be6[_0x2424('0x1e')],'rows':_[_0x2424('0x30')](_0x787be6['rows'],function(_0x220799){return{'membername':_0x220799['name'],'UserId':_0x220799['id'],'queue_name':_0x133e46[_0x2424('0x2d')],'MailQueueId':_0x133e46['id'],'interface':util[_0x2424('0x5f')](_0x2424('0x60'),_0x2424('0x61'),_0x220799['name']),'penalty':0x0,'paused':_0x220799['mailPause'],'createdAt':_0x220799[_0x2424('0x5e')],'updatedAt':_0x220799[_0x2424('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2424('0x26')](respondWithFilteredResult(_0x9fc6fb,_0x36c772))[_0x2424('0x49')](handleError(_0x9fc6fb,null));};exports[_0x2424('0x63')]=function(_0x51f87c,_0x57baf3,_0x570465){var _0x37027f={};var _0x44d45a={};var _0x35ec9a;var _0x153620;return db[_0x2424('0x31')][_0x2424('0x58')]({'where':{'id':_0x51f87c['params']['id']}})['then'](handleEntityNotFound(_0x57baf3,null))['then'](function(_0x1ae0bb){if(_0x1ae0bb){_0x35ec9a=_0x1ae0bb;_0x44d45a[_0x2424('0x36')]=_['keys'](db[_0x2424('0x64')][_0x2424('0x32')]);_0x44d45a[_0x2424('0x37')]=_[_0x2424('0x38')](_0x51f87c[_0x2424('0x37')]);_0x44d45a[_0x2424('0x39')]=_['intersection'](_0x44d45a[_0x2424('0x36')],_0x44d45a['query']);_0x37027f[_0x2424('0x3c')]=_[_0x2424('0x3a')](_0x44d45a[_0x2424('0x36')],qs['fields'](_0x51f87c['query']['fields']));_0x37027f[_0x2424('0x3c')]=_0x37027f[_0x2424('0x3c')]['length']?_0x37027f['attributes']:_0x44d45a['model'];_0x37027f[_0x2424('0x3f')]=qs[_0x2424('0x40')](_0x51f87c['query'][_0x2424('0x40')]);_0x37027f[_0x2424('0x43')]=qs[_0x2424('0x39')](_[_0x2424('0x41')](_0x51f87c[_0x2424('0x37')],_0x44d45a['filters']));if(_0x51f87c[_0x2424('0x37')][_0x2424('0x42')]){_0x37027f[_0x2424('0x43')]=_[_0x2424('0x45')](_0x37027f[_0x2424('0x43')],{'$or':_[_0x2424('0x30')](_0x37027f[_0x2424('0x3c')],function(_0x234d6f){var _0x1fdae9={};_0x1fdae9[_0x234d6f]={'$like':'%'+_0x51f87c['query'][_0x2424('0x42')]+'%'};return _0x1fdae9;})});}_0x37027f=_[_0x2424('0x45')]({},_0x37027f,_0x51f87c['options']);return _0x35ec9a['getTeams'](_0x37027f);}})['then'](function(_0xc43955){if(_0xc43955){_0x153620=_0xc43955['length'];if(!_0x51f87c[_0x2424('0x37')][_0x2424('0x3d')]('nolimit')){_0x37027f['limit']=qs[_0x2424('0x1f')](_0x51f87c[_0x2424('0x37')][_0x2424('0x1f')]);_0x37027f[_0x2424('0x1c')]=qs[_0x2424('0x1c')](_0x51f87c[_0x2424('0x37')][_0x2424('0x1c')]);}return _0x35ec9a['getTeams'](_0x37027f);}})['then'](function(_0xe37659){if(_0xe37659){return _0xe37659?{'count':_0x153620,'rows':_0xe37659}:null;}})[_0x2424('0x26')](respondWithResult(_0x57baf3,null))['catch'](handleError(_0x57baf3,null));};exports['addTeams']=function(_0x37a08c,_0x2b0f22,_0x9cde8a){var _0x1a2b63=_0x37a08c[_0x2424('0x50')][_0x2424('0x65')];return db['Team'][_0x2424('0x5b')]({'where':{'id':_0x1a2b63},'attributes':['id'],'include':[{'model':db[_0x2424('0x5c')],'as':_0x2424('0x66'),'attributes':['id','name',_0x2424('0x67'),_0x2424('0x68'),_0x2424('0x69')],'raw':!![]}]})[_0x2424('0x26')](function(_0x4864fe){if(_0x4864fe){var _0x4f4891=_['flatMap'](_0x4864fe,function(_0x2bde68){var _0x3a6035=_0x2bde68[_0x2424('0x28')]({'plain':!![]});return _0x3a6035[_0x2424('0x66')];});return db['MailQueue']['find']({'where':{'id':_0x37a08c['params']['id']}})[_0x2424('0x26')](function(_0x284b26){return db[_0x2424('0x6a')][_0x2424('0x6b')](function(_0x113e57){return _0x284b26[_0x2424('0x6c')](_0x1a2b63,{'transaction':_0x113e57})[_0x2424('0x26')](function(){return BPromise[_0x2424('0x6d')](_0x4f4891,function(_0x3f733d){return db[_0x2424('0x59')][_0x2424('0x6e')]({'where':{'UserId':_0x3f733d['id'],'MailQueueId':_0x37a08c['params']['id']},'transaction':_0x113e57});});})[_0x2424('0x26')](function(){_0x4f4891[_0x2424('0x6f')](function(_0x2748c2){socket['emit'](_0x2424('0x70'),{'UserId':_0x2748c2['id'],'MailQueueId':_0x284b26['id']});});});});});}})[_0x2424('0x26')](respondWithStatusCode(_0x2b0f22,null))['catch'](handleError(_0x2b0f22,null));};exports['removeTeams']=function(_0x317f34,_0x533024,_0x5a07e3){return db[_0x2424('0x64')]['findAll']({'where':{'id':_0x317f34[_0x2424('0x37')][_0x2424('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2424('0x66'),'attributes':['id'],'raw':!![]}]})[_0x2424('0x26')](handleEntityNotFound(_0x533024,null))[_0x2424('0x26')](function(_0x216df9){var _0x3caa67=_[_0x2424('0x30')](_0x216df9,'id');var _0x4ceeac=[];var _0x293db9=[];var _0x44c79f=squel[_0x2424('0x71')]();_0x44c79f['field'](_0x2424('0x72'))[_0x2424('0x73')](_0x2424('0x74'),'tq')[_0x2424('0x75')](_0x2424('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2424('0x43')](_0x2424('0x77'),_0x317f34[_0x2424('0x4b')]['id']);for(var _0x1e96e7=0x0;_0x1e96e7<_0x216df9[_0x2424('0x4c')];_0x1e96e7+=0x1){let _0x5c7172=_0x216df9[_0x1e96e7];for(var _0x4140eb=0x0;_0x4140eb<_0x5c7172[_0x2424('0x66')][_0x2424('0x4c')];_0x4140eb+=0x1){let _0x3e8a89=_0x5c7172[_0x2424('0x66')][_0x4140eb];var _0x1ceb41=_0x44c79f['clone']();_0x1ceb41[_0x2424('0x43')]('ut.UserId\x20=\x20?',_0x3e8a89['id']);_0x293db9['push'](db['sequelize'][_0x2424('0x37')](_0x1ceb41[_0x2424('0x78')](),{'type':db[_0x2424('0x6a')][_0x2424('0x79')][_0x2424('0x7a')]})['then'](function(_0x40eb46){if(_0x40eb46['length']===0x1){return _0x3e8a89['id'];}else{var _0x58dea0=_[_0x2424('0x7b')](_['map'](_0x40eb46,_0x2424('0x7c')),function(_0x7d82eb){return _[_0x2424('0x7d')](_0x3caa67,_0x7d82eb);});if(_0x58dea0){return _0x3e8a89['id'];}}}));}}return BPromise[_0x2424('0x7e')](_0x293db9)[_0x2424('0x26')](function(_0x13e309){_0x4ceeac=_(_0x4ceeac)[_0x2424('0x7f')](_0x13e309)[_0x2424('0x80')]()[_0x2424('0x81')]();return db[_0x2424('0x31')][_0x2424('0x4e')]({'where':{'id':_0x317f34[_0x2424('0x4b')]['id']}})[_0x2424('0x26')](function(_0x51c180){return db[_0x2424('0x6a')][_0x2424('0x6b')](function(_0x499a50){return _0x51c180['removeTeams'](_0x317f34['query'][_0x2424('0x65')],{'transaction':_0x499a50})[_0x2424('0x26')](function(){if(!_[_0x2424('0x82')](_0x4ceeac)){return _0x51c180[_0x2424('0x83')](_0x4ceeac,{'transaction':_0x499a50});}})['then'](function(){_0x4ceeac[_0x2424('0x6f')](function(_0x1ff3e5){socket['emit'](_0x2424('0x84'),{'UserId':_0x1ff3e5,'MailQueueId':_0x51c180['id']});});});});});});})[_0x2424('0x26')](respondWithStatusCode(_0x533024,null))[_0x2424('0x49')](handleError(_0x533024,null));};exports[_0x2424('0x85')]=function(_0x417dd6,_0xc9bc1c,_0x40a847){return db[_0x2424('0x31')][_0x2424('0x4e')]({'where':{'id':_0x417dd6[_0x2424('0x4b')]['id']}})[_0x2424('0x26')](handleEntityNotFound(_0xc9bc1c,null))[_0x2424('0x26')](function(_0x52f55f){if(_0x52f55f){return _0x52f55f[_0x2424('0x85')](_0x417dd6[_0x2424('0x50')][_0x2424('0x65')],_[_0x2424('0x86')](_0x417dd6[_0x2424('0x50')],[_0x2424('0x65'),'id'])||{})[_0x2424('0x87')](function(_0x156d08){for(var _0x35f0ae=0x0;_0x35f0ae<_0x417dd6[_0x2424('0x50')]['ids']['length'];_0x35f0ae+=0x1){socket[_0x2424('0x88')](_0x2424('0x70'),{'UserId':Number(_0x417dd6[_0x2424('0x50')][_0x2424('0x65')][_0x35f0ae]),'MailQueueId':Number(_0x417dd6[_0x2424('0x4b')]['id'])});}return _0x156d08;});}})[_0x2424('0x26')](respondWithResult(_0xc9bc1c,null))[_0x2424('0x49')](handleError(_0xc9bc1c,null));};exports['removeAgents']=function(_0x14b30a,_0x5318ff,_0x36b8c6){return db[_0x2424('0x31')][_0x2424('0x4e')]({'where':{'id':_0x14b30a[_0x2424('0x4b')]['id']}})[_0x2424('0x26')](handleEntityNotFound(_0x5318ff,null))['then'](function(_0x55dbd){if(_0x55dbd){return _0x55dbd[_0x2424('0x83')](_0x14b30a[_0x2424('0x37')][_0x2424('0x65')])[_0x2424('0x26')](function(){if(_[_0x2424('0x89')](_0x14b30a['query'][_0x2424('0x65')])){for(var _0x50e188=0x0;_0x50e188<_0x14b30a[_0x2424('0x37')]['ids'][_0x2424('0x4c')];_0x50e188+=0x1){socket['emit'](_0x2424('0x84'),{'UserId':Number(_0x14b30a[_0x2424('0x37')][_0x2424('0x65')][_0x50e188]),'MailQueueId':Number(_0x14b30a['params']['id'])});}}else{socket[_0x2424('0x88')](_0x2424('0x84'),{'UserId':Number(_0x14b30a[_0x2424('0x37')][_0x2424('0x65')]),'MailQueueId':Number(_0x14b30a[_0x2424('0x4b')]['id'])});}});}})[_0x2424('0x26')](respondWithStatusCode(_0x5318ff,null))[_0x2424('0x49')](handleError(_0x5318ff,null));};exports[_0x2424('0x8a')]=function(_0x4c256d,_0x720450,_0x54b69d){var _0x28af85={};var _0x4524f3={};var _0x8307e7;var _0x33c2bb;return db[_0x2424('0x31')]['findOne']({'where':{'id':_0x4c256d[_0x2424('0x4b')]['id']}})[_0x2424('0x26')](handleEntityNotFound(_0x720450,null))['then'](function(_0x44ecbf){if(_0x44ecbf){_0x8307e7=_0x44ecbf;_0x4524f3[_0x2424('0x36')]=_[_0x2424('0x38')](db[_0x2424('0x5c')][_0x2424('0x32')]);_0x4524f3[_0x2424('0x37')]=_['keys'](_0x4c256d['query']);_0x4524f3[_0x2424('0x39')]=_[_0x2424('0x3a')](_0x4524f3[_0x2424('0x36')],_0x4524f3[_0x2424('0x37')]);_0x28af85[_0x2424('0x3c')]=_[_0x2424('0x3a')](_0x4524f3[_0x2424('0x36')],qs[_0x2424('0x3b')](_0x4c256d['query'][_0x2424('0x3b')]));_0x28af85[_0x2424('0x3c')]=_0x28af85[_0x2424('0x3c')]['length']?_0x28af85[_0x2424('0x3c')]:_0x4524f3['model'];_0x28af85[_0x2424('0x3f')]=qs[_0x2424('0x40')](_0x4c256d[_0x2424('0x37')][_0x2424('0x40')]);_0x28af85[_0x2424('0x43')]=qs[_0x2424('0x39')](_[_0x2424('0x41')](_0x4c256d[_0x2424('0x37')],_0x4524f3[_0x2424('0x39')]));if(_0x4c256d['query'][_0x2424('0x42')]){_0x28af85[_0x2424('0x43')]=_['merge'](_0x28af85[_0x2424('0x43')],{'$or':_[_0x2424('0x30')](_0x28af85['attributes'],function(_0x3109be){var _0xa7b854={};_0xa7b854[_0x3109be]={'$like':'%'+_0x4c256d['query'][_0x2424('0x42')]+'%'};return _0xa7b854;})});}_0x28af85=_['merge']({},_0x28af85,_0x4c256d[_0x2424('0x4d')]);return _0x8307e7[_0x2424('0x8a')](_0x28af85);}})[_0x2424('0x26')](function(_0x23a49b){if(_0x23a49b){_0x33c2bb=_0x23a49b[_0x2424('0x4c')];if(!_0x4c256d[_0x2424('0x37')][_0x2424('0x3d')](_0x2424('0x3e'))){_0x28af85[_0x2424('0x1f')]=qs['limit'](_0x4c256d[_0x2424('0x37')][_0x2424('0x1f')]);_0x28af85[_0x2424('0x1c')]=qs[_0x2424('0x1c')](_0x4c256d[_0x2424('0x37')]['offset']);}return _0x8307e7['getAgents'](_0x28af85);}})['then'](function(_0x4389c5){if(_0x4389c5){return _0x4389c5?{'count':_0x33c2bb,'rows':_0x4389c5}:null;}})[_0x2424('0x26')](respondWithResult(_0x720450,null))['catch'](handleError(_0x720450,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 7d746f6..55f92e4 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 _0x2ad1=['MailQueue','setMaxListeners','emit','exports','events','../../mysqldb'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x2ad1,0x16c));var _0x12ad=function(_0x626eca,_0x46bcc0){_0x626eca=_0x626eca-0x0;var _0x14d464=_0x2ad1[_0x626eca];return _0x14d464;};'use strict';var EventEmitter=require(_0x12ad('0x0'));var MailQueue=require(_0x12ad('0x1'))['db'][_0x12ad('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x12ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3fb3cf){return function(_0x3a0e93,_0x49a7d4,_0x168fd0){MailQueueEvents[_0x12ad('0x4')](_0x3fb3cf+':'+_0x3a0e93['id'],_0x3a0e93);MailQueueEvents[_0x12ad('0x4')](_0x3fb3cf,_0x3a0e93);_0x168fd0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x12ad('0x5')]=MailQueueEvents; \ No newline at end of file +var _0xb48b=['../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x195f54,_0x2f1ba2){var _0x40930a=function(_0x342ad7){while(--_0x342ad7){_0x195f54['push'](_0x195f54['shift']());}};_0x40930a(++_0x2f1ba2);}(_0xb48b,0x149));var _0xbb48=function(_0x4d729f,_0x52bf8b){_0x4d729f=_0x4d729f-0x0;var _0x5ce12a=_0xb48b[_0x4d729f];return _0x5ce12a;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xbb48('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb48('0x1'),'afterUpdate':_0xbb48('0x2'),'afterDestroy':_0xbb48('0x3')};function emitEvent(_0x2a7d3e){return function(_0x298208,_0x27e8c2,_0x1a233f){MailQueueEvents['emit'](_0x2a7d3e+':'+_0x298208['id'],_0x298208);MailQueueEvents[_0xbb48('0x4')](_0x2a7d3e,_0x298208);_0x1a233f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xbb48('0x5')](e,emitEvent(event));}}module[_0xbb48('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 65cc0af..c2bfab3 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 _0xd437=['./mailQueue.attributes','define','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x4af93f,_0x5c2ed0){var _0x377cca=function(_0x4ca7dd){while(--_0x4ca7dd){_0x4af93f['push'](_0x4af93f['shift']());}};_0x377cca(++_0x5c2ed0);}(_0xd437,0x93));var _0x7d43=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0xd437[_0x121886];return _0x20ca01;};'use strict';var _=require('lodash');var util=require(_0x7d43('0x0'));var logger=require(_0x7d43('0x1'))(_0x7d43('0x2'));var moment=require(_0x7d43('0x3'));var BPromise=require(_0x7d43('0x4'));var rp=require(_0x7d43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d43('0x6'));var attributes=require(_0x7d43('0x7'));module['exports']=function(_0x1dd749,_0x3ed15b){return _0x1dd749[_0x7d43('0x8')](_0x7d43('0x9'),attributes,{'tableName':_0x7d43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa693=['lodash','../../config/logger','request-promise','path','./mailQueue.attributes','exports','mail_queues'];(function(_0x31e9a1,_0x21c0cb){var _0x34c438=function(_0x2222fd){while(--_0x2222fd){_0x31e9a1['push'](_0x31e9a1['shift']());}};_0x34c438(++_0x21c0cb);}(_0xa693,0xbd));var _0x3a69=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xa693[_0x16539a];return _0x200796;};'use strict';var _=require(_0x3a69('0x0'));var util=require('util');var logger=require(_0x3a69('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3a69('0x2'));var fs=require('fs');var path=require(_0x3a69('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3a69('0x4'));module[_0x3a69('0x5')]=function(_0x3c9635,_0x516522){return _0x3c9635['define']('MailQueue',attributes,{'tableName':_0x3a69('0x6'),'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 476746f..59814d2 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 _0x17ae=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','map','model','attributes','ShowMailQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x46674c,_0x487cda){var _0x58b5ce=function(_0x47eb71){while(--_0x47eb71){_0x46674c['push'](_0x46674c['shift']());}};_0x58b5ce(++_0x487cda);}(_0x17ae,0x1c5));var _0xe17a=function(_0x1cad10,_0x1241b8){_0x1cad10=_0x1cad10-0x0;var _0x51fffc=_0x17ae[_0x1cad10];return _0x51fffc;};'use strict';var _=require(_0xe17a('0x0'));var util=require('util');var moment=require(_0xe17a('0x1'));var BPromise=require(_0xe17a('0x2'));var rs=require(_0xe17a('0x3'));var fs=require('fs');var Redis=require(_0xe17a('0x4'));var db=require(_0xe17a('0x5'))['db'];var utils=require(_0xe17a('0x6'));var logger=require('../../config/logger')(_0xe17a('0x7'));var config=require(_0xe17a('0x8'));var jayson=require(_0xe17a('0x9'));var client=jayson[_0xe17a('0xa')][_0xe17a('0xb')]({'port':0x232a});config[_0xe17a('0xc')]=_[_0xe17a('0xd')](config[_0xe17a('0xc')],{'host':_0xe17a('0xe'),'port':0x18eb});var socket=require(_0xe17a('0xf'))(new Redis(config['redis']));require('./mailQueue.socket')[_0xe17a('0x10')](socket);function respondWithRpcPromise(_0x2efc09,_0x14bac4,_0x239441){return new BPromise(function(_0x208f71,_0x660a8a){return client[_0xe17a('0x11')](_0x2efc09,_0x239441)[_0xe17a('0x12')](function(_0x2ac29a){logger[_0xe17a('0x13')](_0xe17a('0x14'),_0x14bac4,_0xe17a('0x15'));logger[_0xe17a('0x16')](_0xe17a('0x17'),_0x14bac4,_0xe17a('0x15'),JSON[_0xe17a('0x18')](_0x2ac29a));if(_0x2ac29a[_0xe17a('0x19')]){if(_0x2ac29a['error'][_0xe17a('0x1a')]===0x1f4){logger[_0xe17a('0x19')](_0xe17a('0x14'),_0x14bac4,_0x2ac29a[_0xe17a('0x19')][_0xe17a('0x1b')]);return _0x660a8a(_0x2ac29a['error'][_0xe17a('0x1b')]);}logger[_0xe17a('0x19')](_0xe17a('0x14'),_0x14bac4,_0x2ac29a[_0xe17a('0x19')]['message']);return _0x208f71(_0x2ac29a[_0xe17a('0x19')]['message']);}else{logger[_0xe17a('0x13')]('MailQueue,\x20%s,\x20%s',_0x14bac4,_0xe17a('0x15'));_0x208f71(_0x2ac29a[_0xe17a('0x1c')][_0xe17a('0x1b')]);}})[_0xe17a('0x1d')](function(_0x862c76){logger[_0xe17a('0x19')](_0xe17a('0x14'),_0x14bac4,_0x862c76);_0x660a8a(_0x862c76);});});}exports[_0xe17a('0x1e')]=function(_0x28c967){var _0x26bacc=this;return new Promise(function(_0x467274,_0x2f8993){return db[_0xe17a('0x1f')]['findAll']({'raw':_0x28c967[_0xe17a('0x20')]?_0x28c967[_0xe17a('0x20')][_0xe17a('0x21')]===undefined?!![]:![]:!![],'where':_0x28c967[_0xe17a('0x20')]?_0x28c967['options'][_0xe17a('0x22')]||null:null,'attributes':_0x28c967[_0xe17a('0x20')]?_0x28c967[_0xe17a('0x20')]['attributes']||null:null,'limit':_0x28c967[_0xe17a('0x20')]?_0x28c967[_0xe17a('0x20')][_0xe17a('0x23')]||null:null,'include':_0x28c967['options']?_0x28c967[_0xe17a('0x20')][_0xe17a('0x24')]?_[_0xe17a('0x25')](_0x28c967[_0xe17a('0x20')][_0xe17a('0x24')],function(_0x2d3500){return{'model':db[_0x2d3500[_0xe17a('0x26')]],'as':_0x2d3500['as'],'attributes':_0x2d3500['attributes'],'include':_0x2d3500['include']?_[_0xe17a('0x25')](_0x2d3500['include'],function(_0x841cc){return{'model':db[_0x841cc[_0xe17a('0x26')]],'as':_0x841cc['as'],'attributes':_0x841cc[_0xe17a('0x27')],'include':_0x841cc[_0xe17a('0x24')]?_[_0xe17a('0x25')](_0x841cc[_0xe17a('0x24')],function(_0x5ea514){return{'model':db[_0x5ea514[_0xe17a('0x26')]],'as':_0x5ea514['as'],'attributes':_0x5ea514['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x6dca8){logger[_0xe17a('0x13')](_0xe17a('0x1e'),_0x28c967);logger['debug'](_0xe17a('0x1e'),_0x28c967,JSON[_0xe17a('0x18')](_0x6dca8));_0x467274(_0x6dca8);})[_0xe17a('0x1d')](function(_0xade179){logger[_0xe17a('0x19')](_0xe17a('0x1e'),_0xade179[_0xe17a('0x1b')],_0x28c967);_0x2f8993(_0x26bacc['error'](0x1f4,_0xade179[_0xe17a('0x1b')]));});});};exports[_0xe17a('0x28')]=function(_0x114a0d){var _0x5b88f2=this;return new Promise(function(_0x333047,_0xecb049){return db[_0xe17a('0x1f')][_0xe17a('0x29')]({'raw':_0x114a0d['options']?_0x114a0d['options'][_0xe17a('0x21')]===undefined?!![]:![]:!![],'where':_0x114a0d[_0xe17a('0x20')]?_0x114a0d[_0xe17a('0x20')]['where']||null:null,'attributes':_0x114a0d['options']?_0x114a0d[_0xe17a('0x20')][_0xe17a('0x27')]||null:null,'include':_0x114a0d[_0xe17a('0x20')]?_0x114a0d['options'][_0xe17a('0x24')]?_[_0xe17a('0x25')](_0x114a0d[_0xe17a('0x20')][_0xe17a('0x24')],function(_0x38d0fd){return{'model':db[_0x38d0fd['model']],'as':_0x38d0fd['as'],'attributes':_0x38d0fd[_0xe17a('0x27')],'include':_0x38d0fd[_0xe17a('0x24')]?_[_0xe17a('0x25')](_0x38d0fd[_0xe17a('0x24')],function(_0x2f6102){return{'model':db[_0x2f6102[_0xe17a('0x26')]],'as':_0x2f6102['as'],'attributes':_0x2f6102[_0xe17a('0x27')],'include':_0x2f6102[_0xe17a('0x24')]?_[_0xe17a('0x25')](_0x2f6102['include'],function(_0x4d7254){return{'model':db[_0x4d7254['model']],'as':_0x4d7254['as'],'attributes':_0x4d7254[_0xe17a('0x27')]};}):[]};}):[]};}):[]:[]})[_0xe17a('0x12')](function(_0x230ae5){logger['info'](_0xe17a('0x28'),_0x114a0d);logger[_0xe17a('0x16')](_0xe17a('0x28'),_0x114a0d,JSON['stringify'](_0x230ae5));_0x333047(_0x230ae5);})[_0xe17a('0x1d')](function(_0x15e11f){logger['error'](_0xe17a('0x28'),_0x15e11f[_0xe17a('0x1b')],_0x114a0d);_0xecb049(_0x5b88f2[_0xe17a('0x19')](0x1f4,_0x15e11f[_0xe17a('0x1b')]));});});}; \ No newline at end of file +var _0x4793=['message','info','result','catch','GetMailQueue','findAll','options','attributes','include','map','model','ShowMailQueue','MailQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','register','request','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s'];(function(_0x370b00,_0x40e213){var _0x3585b6=function(_0x9327d){while(--_0x9327d){_0x370b00['push'](_0x370b00['shift']());}};_0x3585b6(++_0x40e213);}(_0x4793,0xb3));var _0x3479=function(_0x14d0db,_0x29972c){_0x14d0db=_0x14d0db-0x0;var _0x24e5d0=_0x4793[_0x14d0db];return _0x24e5d0;};'use strict';var _=require(_0x3479('0x0'));var util=require(_0x3479('0x1'));var moment=require(_0x3479('0x2'));var BPromise=require(_0x3479('0x3'));var rs=require(_0x3479('0x4'));var fs=require('fs');var Redis=require(_0x3479('0x5'));var db=require(_0x3479('0x6'))['db'];var utils=require(_0x3479('0x7'));var logger=require(_0x3479('0x8'))(_0x3479('0x9'));var config=require(_0x3479('0xa'));var jayson=require(_0x3479('0xb'));var client=jayson[_0x3479('0xc')][_0x3479('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3479('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x3479('0xf'))(new Redis(config[_0x3479('0xe')]));require(_0x3479('0x10'))[_0x3479('0x11')](socket);function respondWithRpcPromise(_0x84421f,_0x43b18a,_0x187e56){return new BPromise(function(_0xbbd21,_0x437e19){return client[_0x3479('0x12')](_0x84421f,_0x187e56)[_0x3479('0x13')](function(_0x3c850e){logger['info']('MailQueue,\x20%s,\x20%s',_0x43b18a,_0x3479('0x14'));logger[_0x3479('0x15')](_0x3479('0x16'),_0x43b18a,_0x3479('0x14'),JSON[_0x3479('0x17')](_0x3c850e));if(_0x3c850e['error']){if(_0x3c850e['error']['code']===0x1f4){logger[_0x3479('0x18')](_0x3479('0x19'),_0x43b18a,_0x3c850e['error'][_0x3479('0x1a')]);return _0x437e19(_0x3c850e[_0x3479('0x18')][_0x3479('0x1a')]);}logger[_0x3479('0x18')](_0x3479('0x19'),_0x43b18a,_0x3c850e[_0x3479('0x18')][_0x3479('0x1a')]);return _0xbbd21(_0x3c850e[_0x3479('0x18')][_0x3479('0x1a')]);}else{logger[_0x3479('0x1b')](_0x3479('0x19'),_0x43b18a,_0x3479('0x14'));_0xbbd21(_0x3c850e[_0x3479('0x1c')][_0x3479('0x1a')]);}})[_0x3479('0x1d')](function(_0x3d3fb1){logger[_0x3479('0x18')](_0x3479('0x19'),_0x43b18a,_0x3d3fb1);_0x437e19(_0x3d3fb1);});});}exports[_0x3479('0x1e')]=function(_0x4dfd18){var _0x294b44=this;return new Promise(function(_0x991582,_0x313800){return db['MailQueue'][_0x3479('0x1f')]({'raw':_0x4dfd18[_0x3479('0x20')]?_0x4dfd18['options']['raw']===undefined?!![]:![]:!![],'where':_0x4dfd18[_0x3479('0x20')]?_0x4dfd18[_0x3479('0x20')]['where']||null:null,'attributes':_0x4dfd18[_0x3479('0x20')]?_0x4dfd18['options'][_0x3479('0x21')]||null:null,'limit':_0x4dfd18[_0x3479('0x20')]?_0x4dfd18[_0x3479('0x20')]['limit']||null:null,'include':_0x4dfd18[_0x3479('0x20')]?_0x4dfd18[_0x3479('0x20')][_0x3479('0x22')]?_[_0x3479('0x23')](_0x4dfd18['options']['include'],function(_0x50856e){return{'model':db[_0x50856e['model']],'as':_0x50856e['as'],'attributes':_0x50856e[_0x3479('0x21')],'include':_0x50856e[_0x3479('0x22')]?_[_0x3479('0x23')](_0x50856e[_0x3479('0x22')],function(_0xbf4548){return{'model':db[_0xbf4548[_0x3479('0x24')]],'as':_0xbf4548['as'],'attributes':_0xbf4548['attributes'],'include':_0xbf4548[_0x3479('0x22')]?_[_0x3479('0x23')](_0xbf4548[_0x3479('0x22')],function(_0x32cc17){return{'model':db[_0x32cc17[_0x3479('0x24')]],'as':_0x32cc17['as'],'attributes':_0x32cc17[_0x3479('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3479('0x13')](function(_0x57526f){logger[_0x3479('0x1b')](_0x3479('0x1e'),_0x4dfd18);logger[_0x3479('0x15')](_0x3479('0x1e'),_0x4dfd18,JSON[_0x3479('0x17')](_0x57526f));_0x991582(_0x57526f);})[_0x3479('0x1d')](function(_0x5815f0){logger[_0x3479('0x18')](_0x3479('0x1e'),_0x5815f0[_0x3479('0x1a')],_0x4dfd18);_0x313800(_0x294b44[_0x3479('0x18')](0x1f4,_0x5815f0[_0x3479('0x1a')]));});});};exports[_0x3479('0x25')]=function(_0x40fbbd){var _0x32fd0b=this;return new Promise(function(_0x468fbc,_0x1e10a8){return db[_0x3479('0x26')][_0x3479('0x27')]({'raw':_0x40fbbd[_0x3479('0x20')]?_0x40fbbd[_0x3479('0x20')][_0x3479('0x28')]===undefined?!![]:![]:!![],'where':_0x40fbbd[_0x3479('0x20')]?_0x40fbbd[_0x3479('0x20')]['where']||null:null,'attributes':_0x40fbbd[_0x3479('0x20')]?_0x40fbbd[_0x3479('0x20')]['attributes']||null:null,'include':_0x40fbbd[_0x3479('0x20')]?_0x40fbbd['options']['include']?_[_0x3479('0x23')](_0x40fbbd[_0x3479('0x20')]['include'],function(_0x5d4b59){return{'model':db[_0x5d4b59[_0x3479('0x24')]],'as':_0x5d4b59['as'],'attributes':_0x5d4b59['attributes'],'include':_0x5d4b59['include']?_[_0x3479('0x23')](_0x5d4b59[_0x3479('0x22')],function(_0x2e795a){return{'model':db[_0x2e795a[_0x3479('0x24')]],'as':_0x2e795a['as'],'attributes':_0x2e795a[_0x3479('0x21')],'include':_0x2e795a[_0x3479('0x22')]?_[_0x3479('0x23')](_0x2e795a[_0x3479('0x22')],function(_0x46e5eb){return{'model':db[_0x46e5eb[_0x3479('0x24')]],'as':_0x46e5eb['as'],'attributes':_0x46e5eb[_0x3479('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58fe8b){logger[_0x3479('0x1b')]('ShowMailQueue',_0x40fbbd);logger[_0x3479('0x15')](_0x3479('0x25'),_0x40fbbd,JSON[_0x3479('0x17')](_0x58fe8b));_0x468fbc(_0x58fe8b);})[_0x3479('0x1d')](function(_0x5b581b){logger[_0x3479('0x18')](_0x3479('0x25'),_0x5b581b['message'],_0x40fbbd);_0x1e10a8(_0x32fd0b['error'](0x1f4,_0x5b581b[_0x3479('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b087a54..18290b2 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 _0x3859=['emit','removeListener','./mailQueue.events','update'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x3859,0xf2));var _0x9385=function(_0x5762c6,_0x46b21c){_0x5762c6=_0x5762c6-0x0;var _0x12d518=_0x3859[_0x5762c6];return _0x12d518;};'use strict';var MailQueueEvents=require(_0x9385('0x0'));var events=['save','remove',_0x9385('0x1')];function createListener(_0x3bfdc5,_0x401ec5){return function(_0x27715d){_0x401ec5[_0x9385('0x2')](_0x3bfdc5,_0x27715d);};}function removeListener(_0x1f8063,_0x26ee66){return function(){MailQueueEvents[_0x9385('0x3')](_0x1f8063,_0x26ee66);};}exports['register']=function(_0x641543){for(var _0x36dc34=0x0,_0x255fc0=events['length'];_0x36dc34<_0x255fc0;_0x36dc34++){var _0x35fbf7=events[_0x36dc34];var _0xee2649=createListener('mailQueue:'+_0x35fbf7,_0x641543);MailQueueEvents['on'](_0x35fbf7,_0xee2649);}}; \ No newline at end of file +var _0x57df=['length','mailQueue:','./mailQueue.events','remove','emit','removeListener','register'];(function(_0x3c2666,_0x15fd23){var _0x10c814=function(_0x4660c0){while(--_0x4660c0){_0x3c2666['push'](_0x3c2666['shift']());}};_0x10c814(++_0x15fd23);}(_0x57df,0xd4));var _0xf57d=function(_0x4d5a74,_0x5f19ea){_0x4d5a74=_0x4d5a74-0x0;var _0x5dbb98=_0x57df[_0x4d5a74];return _0x5dbb98;};'use strict';var MailQueueEvents=require(_0xf57d('0x0'));var events=['save',_0xf57d('0x1'),'update'];function createListener(_0x96e416,_0x2b12f3){return function(_0x4171d4){_0x2b12f3[_0xf57d('0x2')](_0x96e416,_0x4171d4);};}function removeListener(_0x5f0b71,_0x5161a0){return function(){MailQueueEvents[_0xf57d('0x3')](_0x5f0b71,_0x5161a0);};}exports[_0xf57d('0x4')]=function(_0x42eaa2){for(var _0xeef9f1=0x0,_0x2c5f7b=events[_0xf57d('0x5')];_0xeef9f1<_0x2c5f7b;_0xeef9f1++){var _0x12cf71=events[_0xeef9f1];var _0x59979e=createListener(_0xf57d('0x6')+_0x12cf71,_0x42eaa2);MailQueueEvents['on'](_0x12cf71,_0x59979e);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4796a5b..43067ec 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 _0xcb47=['get','/describe','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','index'];(function(_0x35b935,_0x34e12c){var _0x2ad760=function(_0xcc8aa1){while(--_0xcc8aa1){_0x35b935['push'](_0x35b935['shift']());}};_0x2ad760(++_0x34e12c);}(_0xcb47,0x1ac));var _0x7cb4=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xcb47[_0x36909d];return _0x1fd29d;};'use strict';var multer=require(_0x7cb4('0x0'));var util=require(_0x7cb4('0x1'));var path=require(_0x7cb4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7cb4('0x3')]();var fs_extra=require(_0x7cb4('0x4'));var auth=require(_0x7cb4('0x5'));var interaction=require(_0x7cb4('0x6'));var config=require('../../config/environment');var controller=require(_0x7cb4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7cb4('0x8')]);router[_0x7cb4('0x9')](_0x7cb4('0xa'),auth[_0x7cb4('0xb')](),controller['describe']);router[_0x7cb4('0x9')](_0x7cb4('0xc'),auth[_0x7cb4('0xb')](),controller[_0x7cb4('0xd')]);router[_0x7cb4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7cb4('0xf')]('/:id',auth[_0x7cb4('0xb')](),controller[_0x7cb4('0x10')]);router[_0x7cb4('0x11')](_0x7cb4('0xc'),auth[_0x7cb4('0xb')](),controller['destroy']);module[_0x7cb4('0x12')]=router; \ No newline at end of file +var _0x502a=['/:id','show','post','create','put','update','delete','destroy','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x502a,0x81));var _0xa502=function(_0x3c05f2,_0x329220){_0x3c05f2=_0x3c05f2-0x0;var _0x3573c6=_0x502a[_0x3c05f2];return _0x3573c6;};'use strict';var multer=require('multer');var util=require(_0xa502('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa502('0x1'));var auth=require(_0xa502('0x2'));var interaction=require(_0xa502('0x3'));var config=require(_0xa502('0x4'));var controller=require(_0xa502('0x5'));router[_0xa502('0x6')]('/',auth[_0xa502('0x7')](),controller[_0xa502('0x8')]);router[_0xa502('0x6')](_0xa502('0x9'),auth[_0xa502('0x7')](),controller[_0xa502('0xa')]);router[_0xa502('0x6')](_0xa502('0xb'),auth[_0xa502('0x7')](),controller[_0xa502('0xc')]);router[_0xa502('0xd')]('/',auth['isAuthenticated'](),controller[_0xa502('0xe')]);router[_0xa502('0xf')](_0xa502('0xb'),auth[_0xa502('0x7')](),controller[_0xa502('0x10')]);router[_0xa502('0x11')](_0xa502('0xb'),auth[_0xa502('0x7')](),controller[_0xa502('0x12')]);module[_0xa502('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ae365a9..cfbe9bb 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 _0x2f6c=['exports','STRING','DATE','moment','sequelize'];(function(_0x176bcd,_0x1a4b8f){var _0x37ff30=function(_0x4666fd){while(--_0x4666fd){_0x176bcd['push'](_0x176bcd['shift']());}};_0x37ff30(++_0x1a4b8f);}(_0x2f6c,0x6c));var _0xc2f6=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x2f6c[_0x3238ea];return _0x4aaac2;};'use strict';var moment=require(_0xc2f6('0x0'));var Sequelize=require(_0xc2f6('0x1'));module[_0xc2f6('0x2')]={'uniqueid':{'type':Sequelize[_0xc2f6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc2f6('0x4')]},'acceptAt':{'type':Sequelize[_0xc2f6('0x4')]},'exitAt':{'type':Sequelize[_0xc2f6('0x4')]},'reason':{'type':Sequelize[_0xc2f6('0x3')]}}; \ No newline at end of file +var _0xe2cd=['moment','sequelize','exports','STRING','DATE'];(function(_0x20f47c,_0x15a41c){var _0x59e896=function(_0x564466){while(--_0x564466){_0x20f47c['push'](_0x20f47c['shift']());}};_0x59e896(++_0x15a41c);}(_0xe2cd,0x64));var _0xde2c=function(_0x3431bd,_0x1b25ec){_0x3431bd=_0x3431bd-0x0;var _0x4476bc=_0xe2cd[_0x3431bd];return _0x4476bc;};'use strict';var moment=require(_0xde2c('0x0'));var Sequelize=require(_0xde2c('0x1'));module[_0xde2c('0x2')]={'uniqueid':{'type':Sequelize[_0xde2c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xde2c('0x3')]},'joinAt':{'type':Sequelize[_0xde2c('0x4')]},'leaveAt':{'type':Sequelize[_0xde2c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xde2c('0x4')]},'reason':{'type':Sequelize[_0xde2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 4818693..02abfd0 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 _0x2a07=['index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a07,0x74));var _0x72a0=function(_0x2e9c6d,_0xbecdb4){_0x2e9c6d=_0x2e9c6d-0x0;var _0x139a4f=_0x2a07[_0x2e9c6d];return _0x139a4f;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['MailQueueReport'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['MailQueueReport']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file +var _0x627e=['limit','count','set','reject','save','then','destroy','error','stack','name','index','MailQueueReport','fieldName','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','rows','catch','params','fields','length','includeAll','include','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x6277e1,_0x34d916){var _0x4cdd13=function(_0xc6b745){while(--_0xc6b745){_0x6277e1['push'](_0x6277e1['shift']());}};_0x4cdd13(++_0x34d916);}(_0x627e,0x14a));var _0xe627=function(_0xfe1c34,_0x2533ce){_0xfe1c34=_0xfe1c34-0x0;var _0x2478a9=_0x627e[_0xfe1c34];return _0x2478a9;};'use strict';var emlformat=require(_0xe627('0x0'));var rimraf=require(_0xe627('0x1'));var zipdir=require(_0xe627('0x2'));var jsonpatch=require(_0xe627('0x3'));var rp=require(_0xe627('0x4'));var moment=require('moment');var BPromise=require(_0xe627('0x5'));var Mustache=require(_0xe627('0x6'));var util=require(_0xe627('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe627('0x8'));var fs=require('fs');var fs_extra=require(_0xe627('0x9'));var _=require(_0xe627('0xa'));var squel=require(_0xe627('0xb'));var crypto=require(_0xe627('0xc'));var jsforce=require(_0xe627('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe627('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe627('0xf'));var authService=require(_0xe627('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe627('0x11'));var logger=require(_0xe627('0x12'))(_0xe627('0x13'));var utils=require(_0xe627('0x14'));var config=require(_0xe627('0x15'));var licenseUtil=require(_0xe627('0x16'));var db=require(_0xe627('0x17'))['db'];function respondWithStatusCode(_0x3919be,_0x1922f5){_0x1922f5=_0x1922f5||0xcc;return function(_0x582190){if(_0x582190){return _0x3919be[_0xe627('0x18')](_0x1922f5);}return _0x3919be[_0xe627('0x19')](_0x1922f5)[_0xe627('0x1a')]();};}function respondWithResult(_0x4be370,_0x42dd1c){_0x42dd1c=_0x42dd1c||0xc8;return function(_0x1e2e62){if(_0x1e2e62){return _0x4be370[_0xe627('0x19')](_0x42dd1c)[_0xe627('0x1b')](_0x1e2e62);}};}function respondWithFilteredResult(_0x62896f,_0x6a9a15){return function(_0x271325){if(_0x271325){var _0x54720a=typeof _0x6a9a15[_0xe627('0x1c')]===_0xe627('0x1d')&&typeof _0x6a9a15[_0xe627('0x1e')]===_0xe627('0x1d');var _0x403982=_0x271325[_0xe627('0x1f')];var _0x56559b=_0x54720a?0x0:_0x6a9a15[_0xe627('0x1c')];var _0x538b22=_0x54720a?_0x271325[_0xe627('0x1f')]:_0x6a9a15['offset']+_0x6a9a15[_0xe627('0x1e')];var _0x565213;if(_0x538b22>=_0x403982){_0x538b22=_0x403982;_0x565213=0xc8;}else{_0x565213=0xce;}_0x62896f['status'](_0x565213);return _0x62896f[_0xe627('0x20')]('Content-Range',_0x56559b+'-'+_0x538b22+'/'+_0x403982)[_0xe627('0x1b')](_0x271325);}return null;};}function patchUpdates(_0x3391ce){return function(_0x4adde7){try{jsonpatch['apply'](_0x4adde7,_0x3391ce,!![]);}catch(_0x4ecfa6){return BPromise[_0xe627('0x21')](_0x4ecfa6);}return _0x4adde7[_0xe627('0x22')]();};}function saveUpdates(_0x4e3338,_0x708a8a){return function(_0x33cb27){if(_0x33cb27){return _0x33cb27['update'](_0x4e3338)[_0xe627('0x23')](function(_0x29221b){return _0x29221b;});}return null;};}function removeEntity(_0x52d492,_0x42f3d1){return function(_0x19adbc){if(_0x19adbc){return _0x19adbc[_0xe627('0x24')]()['then'](function(){_0x52d492[_0xe627('0x19')](0xcc)[_0xe627('0x1a')]();});}};}function handleEntityNotFound(_0x1a5081,_0x3ddd8d){return function(_0x4b9ff9){if(!_0x4b9ff9){_0x1a5081[_0xe627('0x18')](0x194);}return _0x4b9ff9;};}function handleError(_0x1fe192,_0x1635a0){_0x1635a0=_0x1635a0||0x1f4;return function(_0x29eb8e){logger[_0xe627('0x25')](_0x29eb8e[_0xe627('0x26')]);if(_0x29eb8e[_0xe627('0x27')]){delete _0x29eb8e[_0xe627('0x27')];}_0x1fe192[_0xe627('0x19')](_0x1635a0)['send'](_0x29eb8e);};}exports[_0xe627('0x28')]=function(_0x5aeba1,_0x5cd7c8){var _0x1e0bd7={},_0xdf63c8={},_0x5799a3={'count':0x0,'rows':[]};var _0x39c23f=_['map'](db[_0xe627('0x29')]['rawAttributes'],function(_0x262253){return{'name':_0x262253[_0xe627('0x2a')],'type':_0x262253['type'][_0xe627('0x2b')]};});_0xdf63c8['model']=_[_0xe627('0x2c')](_0x39c23f,_0xe627('0x27'));_0xdf63c8[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x5aeba1[_0xe627('0x2d')]);_0xdf63c8[_0xe627('0x2f')]=_[_0xe627('0x30')](_0xdf63c8[_0xe627('0x31')],_0xdf63c8[_0xe627('0x2d')]);_0x1e0bd7[_0xe627('0x32')]=_[_0xe627('0x30')](_0xdf63c8['model'],qs['fields'](_0x5aeba1[_0xe627('0x2d')]['fields']));_0x1e0bd7[_0xe627('0x32')]=_0x1e0bd7['attributes']['length']?_0x1e0bd7[_0xe627('0x32')]:_0xdf63c8['model'];if(!_0x5aeba1['query'][_0xe627('0x33')](_0xe627('0x34'))){_0x1e0bd7[_0xe627('0x1e')]=qs['limit'](_0x5aeba1['query']['limit']);_0x1e0bd7[_0xe627('0x1c')]=qs['offset'](_0x5aeba1[_0xe627('0x2d')][_0xe627('0x1c')]);}_0x1e0bd7['order']=qs[_0xe627('0x35')](_0x5aeba1[_0xe627('0x2d')]['sort']);_0x1e0bd7[_0xe627('0x36')]=qs[_0xe627('0x2f')](_[_0xe627('0x37')](_0x5aeba1[_0xe627('0x2d')],_0xdf63c8[_0xe627('0x2f')]),_0x39c23f);if(_0x5aeba1[_0xe627('0x2d')]['filter']){_0x1e0bd7[_0xe627('0x36')]=_['merge'](_0x1e0bd7[_0xe627('0x36')],{'$or':_['map'](_0x39c23f,function(_0xe90eda){if(_0xe90eda[_0xe627('0x38')]!==_0xe627('0x39')){var _0x21a533={};_0x21a533[_0xe90eda[_0xe627('0x27')]]={'$like':'%'+_0x5aeba1[_0xe627('0x2d')][_0xe627('0x3a')]+'%'};return _0x21a533;}})});}_0x1e0bd7=_[_0xe627('0x3b')]({},_0x1e0bd7,_0x5aeba1[_0xe627('0x3c')]);var _0x415a25={'where':_0x1e0bd7[_0xe627('0x36')]};return db[_0xe627('0x29')][_0xe627('0x1f')](_0x415a25)['then'](function(_0x4ddff5){_0x5799a3['count']=_0x4ddff5;if(_0x5aeba1['query']['includeAll']){_0x1e0bd7['include']=[{'all':!![]}];}return db[_0xe627('0x29')]['findAll'](_0x1e0bd7);})[_0xe627('0x23')](function(_0x59cd6a){_0x5799a3[_0xe627('0x3d')]=_0x59cd6a;return _0x5799a3;})[_0xe627('0x23')](respondWithFilteredResult(_0x5cd7c8,_0x1e0bd7))[_0xe627('0x3e')](handleError(_0x5cd7c8,null));};exports['show']=function(_0x58e110,_0x26064c){var _0x5f3374={'raw':!![],'where':{'id':_0x58e110[_0xe627('0x3f')]['id']}},_0x5e352e={};_0x5e352e['model']=_[_0xe627('0x2e')](db['MailQueueReport']['rawAttributes']);_0x5e352e[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x58e110[_0xe627('0x2d')]);_0x5e352e['filters']=_['intersection'](_0x5e352e[_0xe627('0x31')],_0x5e352e['query']);_0x5f3374['attributes']=_[_0xe627('0x30')](_0x5e352e[_0xe627('0x31')],qs[_0xe627('0x40')](_0x58e110[_0xe627('0x2d')][_0xe627('0x40')]));_0x5f3374[_0xe627('0x32')]=_0x5f3374['attributes'][_0xe627('0x41')]?_0x5f3374[_0xe627('0x32')]:_0x5e352e['model'];if(_0x58e110['query'][_0xe627('0x42')]){_0x5f3374[_0xe627('0x43')]=[{'all':!![]}];}_0x5f3374=_[_0xe627('0x3b')]({},_0x5f3374,_0x58e110[_0xe627('0x3c')]);return db[_0xe627('0x29')][_0xe627('0x44')](_0x5f3374)[_0xe627('0x23')](handleEntityNotFound(_0x26064c,null))['then'](respondWithResult(_0x26064c,null))[_0xe627('0x3e')](handleError(_0x26064c,null));};exports['create']=function(_0x648456,_0xcd19f5){return db[_0xe627('0x29')]['create'](_0x648456[_0xe627('0x45')],{})['then'](respondWithResult(_0xcd19f5,0xc9))[_0xe627('0x3e')](handleError(_0xcd19f5,null));};exports[_0xe627('0x46')]=function(_0x375e05,_0x30e057){if(_0x375e05[_0xe627('0x45')]['id']){delete _0x375e05['body']['id'];}return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x375e05[_0xe627('0x3f')]['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x30e057,null))[_0xe627('0x23')](saveUpdates(_0x375e05[_0xe627('0x45')],null))[_0xe627('0x23')](respondWithResult(_0x30e057,null))[_0xe627('0x3e')](handleError(_0x30e057,null));};exports[_0xe627('0x24')]=function(_0x3824da,_0x550b74){return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x3824da['params']['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x550b74,null))[_0xe627('0x23')](removeEntity(_0x550b74,null))['catch'](handleError(_0x550b74,null));};exports[_0xe627('0x47')]=function(_0x3a827e,_0x542a4c){return db[_0xe627('0x29')][_0xe627('0x47')]()['then'](respondWithResult(_0x542a4c,null))[_0xe627('0x3e')](handleError(_0x542a4c,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 2cb35c4..ea62499 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 _0x58df=['rimraf','../../config/environment','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x58df,0x1cd));var _0xf58d=function(_0x1b3abc,_0x11302c){_0x1b3abc=_0x1b3abc-0x0;var _0x5e432f=_0x58df[_0x1b3abc];return _0x5e432f;};'use strict';var _=require(_0xf58d('0x0'));var util=require(_0xf58d('0x1'));var logger=require(_0xf58d('0x2'))(_0xf58d('0x3'));var moment=require('moment');var BPromise=require(_0xf58d('0x4'));var rp=require(_0xf58d('0x5'));var fs=require('fs');var path=require(_0xf58d('0x6'));var rimraf=require(_0xf58d('0x7'));var config=require(_0xf58d('0x8'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0xa8cf9a,_0x545a60){return _0xa8cf9a[_0xf58d('0x9')](_0xf58d('0xa'),attributes,{'tableName':_0xf58d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf58d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd4a=['../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3f6fe1,_0xb63339){var _0x5d40ff=function(_0xff1b95){while(--_0xff1b95){_0x3f6fe1['push'](_0x3f6fe1['shift']());}};_0x5d40ff(++_0xb63339);}(_0xfd4a,0x115));var _0xafd4=function(_0x56f1f7,_0xe8520a){_0x56f1f7=_0x56f1f7-0x0;var _0x1c8535=_0xfd4a[_0x56f1f7];return _0x1c8535;};'use strict';var _=require(_0xafd4('0x0'));var util=require(_0xafd4('0x1'));var logger=require(_0xafd4('0x2'))(_0xafd4('0x3'));var moment=require(_0xafd4('0x4'));var BPromise=require('bluebird');var rp=require(_0xafd4('0x5'));var fs=require('fs');var path=require(_0xafd4('0x6'));var rimraf=require(_0xafd4('0x7'));var config=require(_0xafd4('0x8'));var attributes=require(_0xafd4('0x9'));module[_0xafd4('0xa')]=function(_0x448d92,_0x5b2783){return _0x448d92[_0xafd4('0xb')](_0xafd4('0xc'),attributes,{'tableName':_0xafd4('0xd'),'paranoid':![],'indexes':[{'name':_0xafd4('0xe'),'fields':[_0xafd4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 708b264..c7f10a4 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x3bf96b,_0x241008){var _0x431ced=function(_0x2fa96e){while(--_0x2fa96e){_0x3bf96b['push'](_0x3bf96b['shift']());}};_0x431ced(++_0x241008);}(_0xdb28,0x106));var _0x8db2=function(_0x5d0acc,_0x2612ea){_0x5d0acc=_0x5d0acc-0x0;var _0x2ae629=_0xdb28[_0x5d0acc];return _0x2ae629;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x5ea891,_0x58c108){var _0x329509=function(_0x5ee852){while(--_0x5ee852){_0x5ea891['push'](_0x5ea891['shift']());}};_0x329509(++_0x58c108);}(_0xadb5,0xad));var _0x5adb=function(_0x2c80c1,_0x25b248){_0x2c80c1=_0x2c80c1-0x0;var _0x2ebff4=_0xadb5[_0x2c80c1];return _0x2ebff4;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index bc361f4..de61021 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2378f4,_0x24684a){var _0x31a888=function(_0x35f42e){while(--_0x35f42e){_0x2378f4['push'](_0x2378f4['shift']());}};_0x31a888(++_0x24684a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xcb91[_0x1acc2d];return _0xabfa6d;};'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(_0x304681,_0x392e88){var _0x3a4053=function(_0x5dffdf){while(--_0x5dffdf){_0x304681['push'](_0x304681['shift']());}};_0x3a4053(++_0x392e88);}(_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 371ff96..02fe00d 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 _0xc788=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xc788,0xc4));var _0x8c78=function(_0x164ef5,_0xba6238){_0x164ef5=_0x164ef5-0x0;var _0x2d60c5=_0xc788[_0x164ef5];return _0x2d60c5;};'use strict';var Sequelize=require(_0x8c78('0x0'));module[_0x8c78('0x1')]={'description':{'type':Sequelize[_0x8c78('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x8c78('0x2')]},'password':{'type':Sequelize[_0x8c78('0x2')]},'port':{'type':Sequelize[_0x8c78('0x3')]},'tls':{'type':Sequelize[_0x8c78('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8c78('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8c78('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8c78('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8c78('0x2')]}}; \ No newline at end of file +var _0x4058=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4058,0x129));var _0x8405=function(_0x5757cc,_0x828f44){_0x5757cc=_0x5757cc-0x0;var _0x25721c=_0x4058[_0x5757cc];return _0x25721c;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'description':{'type':Sequelize[_0x8405('0x2')]},'host':{'type':Sequelize[_0x8405('0x2')]},'authentication':{'type':Sequelize[_0x8405('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8405('0x2')]},'password':{'type':Sequelize[_0x8405('0x2')]},'port':{'type':Sequelize[_0x8405('0x4')]},'tls':{'type':Sequelize[_0x8405('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8405('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8405('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 19640ff..df64cc0 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 _0x8c62=['path','rimraf','./mailServerIn.attributes','exports','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0x8c62,0x1bd));var _0x28c6=function(_0x45e44c,_0x363a23){_0x45e44c=_0x45e44c-0x0;var _0x40b47e=_0x8c62[_0x45e44c];return _0x40b47e;};'use strict';var _=require(_0x28c6('0x0'));var util=require('util');var logger=require(_0x28c6('0x1'))(_0x28c6('0x2'));var moment=require(_0x28c6('0x3'));var BPromise=require(_0x28c6('0x4'));var rp=require(_0x28c6('0x5'));var fs=require('fs');var path=require(_0x28c6('0x6'));var rimraf=require(_0x28c6('0x7'));var config=require('../../config/environment');var attributes=require(_0x28c6('0x8'));module[_0x28c6('0x9')]=function(_0x37efa1,_0x151a57){return _0x37efa1['define']('MailServerIn',attributes,{'tableName':_0x28c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6560=['api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','MailServerIn','lodash'];(function(_0xe13246,_0xff1d8e){var _0x338661=function(_0x108b57){while(--_0x108b57){_0xe13246['push'](_0xe13246['shift']());}};_0x338661(++_0xff1d8e);}(_0x6560,0x14c));var _0x0656=function(_0x72fa03,_0x376453){_0x72fa03=_0x72fa03-0x0;var _0x489fe5=_0x6560[_0x72fa03];return _0x489fe5;};'use strict';var _=require(_0x0656('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0656('0x1'));var moment=require(_0x0656('0x2'));var BPromise=require(_0x0656('0x3'));var rp=require(_0x0656('0x4'));var fs=require('fs');var path=require(_0x0656('0x5'));var rimraf=require('rimraf');var config=require(_0x0656('0x6'));var attributes=require(_0x0656('0x7'));module['exports']=function(_0x342f4d,_0x5aa962){return _0x342f4d['define'](_0x0656('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index fa511f1..9f7448f 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 _0x195e=['map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailServerIn','findAll','options','raw','attributes','include'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x195e,0xfb));var _0xe195=function(_0x194d85,_0x58631c){_0x194d85=_0x194d85-0x0;var _0x4f98ed=_0x195e[_0x194d85];return _0x4f98ed;};'use strict';var _=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rs=require(_0xe195('0x4'));var fs=require('fs');var Redis=require(_0xe195('0x5'));var db=require(_0xe195('0x6'))['db'];var utils=require(_0xe195('0x7'));var logger=require(_0xe195('0x8'))(_0xe195('0x9'));var config=require(_0xe195('0xa'));var jayson=require(_0xe195('0xb'));var client=jayson[_0xe195('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1acc,_0x663106,_0x2ead59){return new BPromise(function(_0x28c1a9,_0x3164c3){return client['request'](_0x2a1acc,_0x2ead59)['then'](function(_0x5f333b){logger[_0xe195('0xd')](_0xe195('0xe'),_0x663106,_0xe195('0xf'));logger[_0xe195('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x663106,_0xe195('0xf'),JSON[_0xe195('0x11')](_0x5f333b));if(_0x5f333b[_0xe195('0x12')]){if(_0x5f333b['error'][_0xe195('0x13')]===0x1f4){logger[_0xe195('0x12')]('MailServerIn,\x20%s,\x20%s',_0x663106,_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);return _0x3164c3(_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);}logger['error'](_0xe195('0xe'),_0x663106,_0x5f333b[_0xe195('0x12')]['message']);return _0x28c1a9(_0x5f333b['error'][_0xe195('0x14')]);}else{logger['info'](_0xe195('0xe'),_0x663106,'request\x20sent');_0x28c1a9(_0x5f333b['result'][_0xe195('0x14')]);}})[_0xe195('0x15')](function(_0x277362){logger[_0xe195('0x12')](_0xe195('0xe'),_0x663106,_0x277362);_0x3164c3(_0x277362);});});}exports[_0xe195('0x16')]=function(_0x4784b1){var _0x41265d=this;return new Promise(function(_0x9c8ba5,_0x25818c){return db['MailServerIn'][_0xe195('0x17')]({'raw':_0x4784b1[_0xe195('0x18')]?_0x4784b1[_0xe195('0x18')][_0xe195('0x19')]===undefined?!![]:![]:!![],'where':_0x4784b1[_0xe195('0x18')]?_0x4784b1[_0xe195('0x18')]['where']||null:null,'attributes':_0x4784b1[_0xe195('0x18')]?_0x4784b1[_0xe195('0x18')][_0xe195('0x1a')]||null:null,'limit':_0x4784b1[_0xe195('0x18')]?_0x4784b1['options']['limit']||null:null,'include':_0x4784b1['options']?_0x4784b1[_0xe195('0x18')][_0xe195('0x1b')]?_[_0xe195('0x1c')](_0x4784b1[_0xe195('0x18')][_0xe195('0x1b')],function(_0x46b15b){return{'model':db[_0x46b15b[_0xe195('0x1d')]],'as':_0x46b15b['as'],'attributes':_0x46b15b[_0xe195('0x1a')],'include':_0x46b15b[_0xe195('0x1b')]?_[_0xe195('0x1c')](_0x46b15b[_0xe195('0x1b')],function(_0x55be2d){return{'model':db[_0x55be2d[_0xe195('0x1d')]],'as':_0x55be2d['as'],'attributes':_0x55be2d['attributes'],'include':_0x55be2d[_0xe195('0x1b')]?_[_0xe195('0x1c')](_0x55be2d[_0xe195('0x1b')],function(_0x2a0504){return{'model':db[_0x2a0504[_0xe195('0x1d')]],'as':_0x2a0504['as'],'attributes':_0x2a0504[_0xe195('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe195('0x1e')](function(_0x401808){logger[_0xe195('0xd')](_0xe195('0x16'),_0x4784b1);logger['debug'](_0xe195('0x16'),_0x4784b1,JSON[_0xe195('0x11')](_0x401808));_0x9c8ba5(_0x401808);})[_0xe195('0x15')](function(_0x1f72a2){logger[_0xe195('0x12')]('GetMailServerIn',_0x1f72a2['message'],_0x4784b1);_0x25818c(_0x41265d[_0xe195('0x12')](0x1f4,_0x1f72a2[_0xe195('0x14')]));});});}; \ No newline at end of file +var _0x2180=['include','attributes','map','model','info','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit'];(function(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_0x2180,0xa0));var _0x0218=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0x2180[_0xfb0cfd];return _0x2fd8aa;};'use strict';var _=require('lodash');var util=require(_0x0218('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0218('0x1'));var fs=require('fs');var Redis=require(_0x0218('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0218('0x3'))(_0x0218('0x4'));var config=require(_0x0218('0x5'));var jayson=require(_0x0218('0x6'));var client=jayson[_0x0218('0x7')][_0x0218('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bd970,_0x500ac9,_0x3b449e){return new BPromise(function(_0x1b2c6e,_0x36a27e){return client[_0x0218('0x9')](_0x5bd970,_0x3b449e)[_0x0218('0xa')](function(_0x4ef446){logger['info'](_0x0218('0xb'),_0x500ac9,_0x0218('0xc'));logger[_0x0218('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x500ac9,_0x0218('0xc'),JSON[_0x0218('0xe')](_0x4ef446));if(_0x4ef446[_0x0218('0xf')]){if(_0x4ef446[_0x0218('0xf')][_0x0218('0x10')]===0x1f4){logger[_0x0218('0xf')](_0x0218('0xb'),_0x500ac9,_0x4ef446[_0x0218('0xf')]['message']);return _0x36a27e(_0x4ef446[_0x0218('0xf')]['message']);}logger[_0x0218('0xf')](_0x0218('0xb'),_0x500ac9,_0x4ef446['error'][_0x0218('0x11')]);return _0x1b2c6e(_0x4ef446[_0x0218('0xf')][_0x0218('0x11')]);}else{logger['info'](_0x0218('0xb'),_0x500ac9,_0x0218('0xc'));_0x1b2c6e(_0x4ef446[_0x0218('0x12')][_0x0218('0x11')]);}})[_0x0218('0x13')](function(_0x1436d4){logger[_0x0218('0xf')]('MailServerIn,\x20%s,\x20%s',_0x500ac9,_0x1436d4);_0x36a27e(_0x1436d4);});});}exports[_0x0218('0x14')]=function(_0x4fa1a5){var _0x2965f8=this;return new Promise(function(_0x293644,_0x4151fd){return db[_0x0218('0x15')][_0x0218('0x16')]({'raw':_0x4fa1a5[_0x0218('0x17')]?_0x4fa1a5['options'][_0x0218('0x18')]===undefined?!![]:![]:!![],'where':_0x4fa1a5[_0x0218('0x17')]?_0x4fa1a5['options']['where']||null:null,'attributes':_0x4fa1a5[_0x0218('0x17')]?_0x4fa1a5['options']['attributes']||null:null,'limit':_0x4fa1a5['options']?_0x4fa1a5['options'][_0x0218('0x19')]||null:null,'include':_0x4fa1a5[_0x0218('0x17')]?_0x4fa1a5['options'][_0x0218('0x1a')]?_['map'](_0x4fa1a5[_0x0218('0x17')]['include'],function(_0x486cd4){return{'model':db[_0x486cd4['model']],'as':_0x486cd4['as'],'attributes':_0x486cd4[_0x0218('0x1b')],'include':_0x486cd4[_0x0218('0x1a')]?_[_0x0218('0x1c')](_0x486cd4[_0x0218('0x1a')],function(_0x11b5c0){return{'model':db[_0x11b5c0[_0x0218('0x1d')]],'as':_0x11b5c0['as'],'attributes':_0x11b5c0[_0x0218('0x1b')],'include':_0x11b5c0[_0x0218('0x1a')]?_[_0x0218('0x1c')](_0x11b5c0['include'],function(_0x206f91){return{'model':db[_0x206f91['model']],'as':_0x206f91['as'],'attributes':_0x206f91[_0x0218('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0218('0xa')](function(_0x1a7c90){logger[_0x0218('0x1e')](_0x0218('0x14'),_0x4fa1a5);logger['debug'](_0x0218('0x14'),_0x4fa1a5,JSON[_0x0218('0xe')](_0x1a7c90));_0x293644(_0x1a7c90);})[_0x0218('0x13')](function(_0x4c7960){logger['error']('GetMailServerIn',_0x4c7960[_0x0218('0x11')],_0x4fa1a5);_0x4151fd(_0x2965f8[_0x0218('0xf')](0x1f4,_0x4c7960['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4dd79f4..bb22299 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x7a54,0x106));var _0x47a5=function(_0x267d07,_0x59c1af){_0x267d07=_0x267d07-0x0;var _0x26ce21=_0x7a54[_0x267d07];return _0x26ce21;};'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 9963de4..0d9eaa3 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 _0x3d5d=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x2e9d76,_0x26845d){var _0x4d31bd=function(_0x3f192c){while(--_0x3f192c){_0x2e9d76['push'](_0x2e9d76['shift']());}};_0x4d31bd(++_0x26845d);}(_0x3d5d,0x102));var _0xd3d5=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0x3d5d[_0x5f12fd];return _0x58bd80;};'use strict';var Sequelize=require(_0xd3d5('0x0'));module[_0xd3d5('0x1')]={'description':{'type':Sequelize[_0xd3d5('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xd3d5('0x2')]},'pass':{'type':Sequelize[_0xd3d5('0x2')]},'port':{'type':Sequelize[_0xd3d5('0x3')]},'secure':{'type':Sequelize[_0xd3d5('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xd3d5('0x2')]},'authentication':{'type':Sequelize[_0xd3d5('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0b29=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3149bf,_0x1a3976){var _0x190bf6=function(_0xa30d93){while(--_0xa30d93){_0x3149bf['push'](_0x3149bf['shift']());}};_0x190bf6(++_0x1a3976);}(_0x0b29,0x11b));var _0x90b2=function(_0x3979d4,_0x2f816f){_0x3979d4=_0x3979d4-0x0;var _0x381f3c=_0x0b29[_0x3979d4];return _0x381f3c;};'use strict';var Sequelize=require(_0x90b2('0x0'));module[_0x90b2('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x90b2('0x2')]},'pass':{'type':Sequelize[_0x90b2('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x90b2('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 1ca09b6..a2a7eb5 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 _0x4566=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','sendStatus','stack','name','send','index','map','MailServerOut','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x1db223,_0x58b55d){var _0x33e4bf=function(_0x565291){while(--_0x565291){_0x1db223['push'](_0x1db223['shift']());}};_0x33e4bf(++_0x58b55d);}(_0x4566,0x86));var _0x6456=function(_0x20b9fd,_0x713343){_0x20b9fd=_0x20b9fd-0x0;var _0x1835a1=_0x4566[_0x20b9fd];return _0x1835a1;};'use strict';var emlformat=require(_0x6456('0x0'));var rimraf=require(_0x6456('0x1'));var zipdir=require(_0x6456('0x2'));var jsonpatch=require(_0x6456('0x3'));var rp=require('request-promise');var moment=require(_0x6456('0x4'));var BPromise=require(_0x6456('0x5'));var Mustache=require(_0x6456('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6456('0x7'));var csv=require(_0x6456('0x8'));var ejs=require(_0x6456('0x9'));var fs=require('fs');var fs_extra=require(_0x6456('0xa'));var _=require(_0x6456('0xb'));var squel=require('squel');var crypto=require(_0x6456('0xc'));var jsforce=require(_0x6456('0xd'));var deskjs=require(_0x6456('0xe'));var toCsv=require(_0x6456('0x8'));var querystring=require(_0x6456('0xf'));var Papa=require(_0x6456('0x10'));var Redis=require('ioredis');var authService=require(_0x6456('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6456('0x12'));var hardwareService=require(_0x6456('0x13'));var logger=require('../../config/logger')(_0x6456('0x14'));var utils=require('../../config/utils');var config=require(_0x6456('0x15'));var licenseUtil=require(_0x6456('0x16'));var db=require(_0x6456('0x17'))['db'];function respondWithStatusCode(_0x1c82f9,_0x184f42){_0x184f42=_0x184f42||0xcc;return function(_0x17bfe3){if(_0x17bfe3){return _0x1c82f9['sendStatus'](_0x184f42);}return _0x1c82f9['status'](_0x184f42)[_0x6456('0x18')]();};}function respondWithResult(_0x339919,_0x141480){_0x141480=_0x141480||0xc8;return function(_0x1656d9){if(_0x1656d9){return _0x339919[_0x6456('0x19')](_0x141480)[_0x6456('0x1a')](_0x1656d9);}};}function respondWithFilteredResult(_0x524c2c,_0x21a371){return function(_0x379d22){if(_0x379d22){var _0x4088be=typeof _0x21a371[_0x6456('0x1b')]==='undefined'&&typeof _0x21a371['limit']===_0x6456('0x1c');var _0x4b9182=_0x379d22[_0x6456('0x1d')];var _0x44763e=_0x4088be?0x0:_0x21a371['offset'];var _0x9c0ce7=_0x4088be?_0x379d22[_0x6456('0x1d')]:_0x21a371['offset']+_0x21a371[_0x6456('0x1e')];var _0x5b15e0;if(_0x9c0ce7>=_0x4b9182){_0x9c0ce7=_0x4b9182;_0x5b15e0=0xc8;}else{_0x5b15e0=0xce;}_0x524c2c[_0x6456('0x19')](_0x5b15e0);return _0x524c2c['set'](_0x6456('0x1f'),_0x44763e+'-'+_0x9c0ce7+'/'+_0x4b9182)[_0x6456('0x1a')](_0x379d22);}return null;};}function patchUpdates(_0x3f7243){return function(_0x231c9c){try{jsonpatch[_0x6456('0x20')](_0x231c9c,_0x3f7243,!![]);}catch(_0xcda2b0){return BPromise['reject'](_0xcda2b0);}return _0x231c9c[_0x6456('0x21')]();};}function saveUpdates(_0x285385,_0x28c83c){return function(_0xf25afd){if(_0xf25afd){return _0xf25afd[_0x6456('0x22')](_0x285385)[_0x6456('0x23')](function(_0x241455){return _0x241455;});}return null;};}function removeEntity(_0x2a5e7f,_0x2c4645){return function(_0x2bf988){if(_0x2bf988){return _0x2bf988['destroy']()[_0x6456('0x23')](function(){_0x2a5e7f[_0x6456('0x19')](0xcc)[_0x6456('0x18')]();});}};}function handleEntityNotFound(_0x49dc8d,_0x3ee5c1){return function(_0x5de82e){if(!_0x5de82e){_0x49dc8d[_0x6456('0x24')](0x194);}return _0x5de82e;};}function handleError(_0xa9186d,_0x986e1f){_0x986e1f=_0x986e1f||0x1f4;return function(_0x5b9d5c){logger['error'](_0x5b9d5c[_0x6456('0x25')]);if(_0x5b9d5c[_0x6456('0x26')]){delete _0x5b9d5c[_0x6456('0x26')];}_0xa9186d[_0x6456('0x19')](_0x986e1f)[_0x6456('0x27')](_0x5b9d5c);};}exports[_0x6456('0x28')]=function(_0x337db7,_0x2f9a43){var _0x39c8ed={},_0x12bc69={},_0x424e9f={'count':0x0,'rows':[]};var _0x48a20d=_[_0x6456('0x29')](db[_0x6456('0x2a')]['rawAttributes'],function(_0x43a939){return{'name':_0x43a939['fieldName'],'type':_0x43a939['type']['key']};});_0x12bc69[_0x6456('0x2b')]=_[_0x6456('0x29')](_0x48a20d,_0x6456('0x26'));_0x12bc69[_0x6456('0x2c')]=_[_0x6456('0x2d')](_0x337db7[_0x6456('0x2c')]);_0x12bc69[_0x6456('0x2e')]=_[_0x6456('0x2f')](_0x12bc69[_0x6456('0x2b')],_0x12bc69['query']);_0x39c8ed[_0x6456('0x30')]=_[_0x6456('0x2f')](_0x12bc69[_0x6456('0x2b')],qs[_0x6456('0x31')](_0x337db7[_0x6456('0x2c')]['fields']));_0x39c8ed[_0x6456('0x30')]=_0x39c8ed['attributes'][_0x6456('0x32')]?_0x39c8ed['attributes']:_0x12bc69[_0x6456('0x2b')];if(!_0x337db7[_0x6456('0x2c')][_0x6456('0x33')]('nolimit')){_0x39c8ed[_0x6456('0x1e')]=qs['limit'](_0x337db7[_0x6456('0x2c')][_0x6456('0x1e')]);_0x39c8ed[_0x6456('0x1b')]=qs[_0x6456('0x1b')](_0x337db7[_0x6456('0x2c')][_0x6456('0x1b')]);}_0x39c8ed[_0x6456('0x34')]=qs['sort'](_0x337db7[_0x6456('0x2c')][_0x6456('0x35')]);_0x39c8ed[_0x6456('0x36')]=qs[_0x6456('0x2e')](_[_0x6456('0x37')](_0x337db7[_0x6456('0x2c')],_0x12bc69['filters']),_0x48a20d);if(_0x337db7[_0x6456('0x2c')]['filter']){_0x39c8ed[_0x6456('0x36')]=_[_0x6456('0x38')](_0x39c8ed[_0x6456('0x36')],{'$or':_['map'](_0x48a20d,function(_0x19038e){if(_0x19038e[_0x6456('0x39')]!==_0x6456('0x3a')){var _0x2f2358={};_0x2f2358[_0x19038e[_0x6456('0x26')]]={'$like':'%'+_0x337db7['query'][_0x6456('0x3b')]+'%'};return _0x2f2358;}})});}_0x39c8ed=_[_0x6456('0x38')]({},_0x39c8ed,_0x337db7[_0x6456('0x3c')]);var _0xa26534={'where':_0x39c8ed[_0x6456('0x36')]};return db['MailServerOut'][_0x6456('0x1d')](_0xa26534)[_0x6456('0x23')](function(_0x323755){_0x424e9f[_0x6456('0x1d')]=_0x323755;if(_0x337db7['query']['includeAll']){_0x39c8ed[_0x6456('0x3d')]=[{'all':!![]}];}return db[_0x6456('0x2a')][_0x6456('0x3e')](_0x39c8ed);})[_0x6456('0x23')](function(_0x1de408){_0x424e9f[_0x6456('0x3f')]=_0x1de408;return _0x424e9f;})[_0x6456('0x23')](respondWithFilteredResult(_0x2f9a43,_0x39c8ed))[_0x6456('0x40')](handleError(_0x2f9a43,null));};exports[_0x6456('0x41')]=function(_0x237325,_0x17e5b0){var _0x54c193={'raw':!![],'where':{'id':_0x237325[_0x6456('0x42')]['id']}},_0x360f64={};_0x360f64['model']=_['keys'](db[_0x6456('0x2a')]['rawAttributes']);_0x360f64[_0x6456('0x2c')]=_['keys'](_0x237325[_0x6456('0x2c')]);_0x360f64[_0x6456('0x2e')]=_['intersection'](_0x360f64[_0x6456('0x2b')],_0x360f64[_0x6456('0x2c')]);_0x54c193[_0x6456('0x30')]=_['intersection'](_0x360f64[_0x6456('0x2b')],qs['fields'](_0x237325[_0x6456('0x2c')]['fields']));_0x54c193[_0x6456('0x30')]=_0x54c193['attributes'][_0x6456('0x32')]?_0x54c193[_0x6456('0x30')]:_0x360f64[_0x6456('0x2b')];if(_0x237325[_0x6456('0x2c')][_0x6456('0x43')]){_0x54c193[_0x6456('0x3d')]=[{'all':!![]}];}_0x54c193=_['merge']({},_0x54c193,_0x237325[_0x6456('0x3c')]);return db[_0x6456('0x2a')][_0x6456('0x44')](_0x54c193)[_0x6456('0x23')](handleEntityNotFound(_0x17e5b0,null))[_0x6456('0x23')](respondWithResult(_0x17e5b0,null))[_0x6456('0x40')](handleError(_0x17e5b0,null));};exports[_0x6456('0x45')]=function(_0x367563,_0x48e7a0){return db[_0x6456('0x2a')][_0x6456('0x45')](_0x367563[_0x6456('0x46')],{})[_0x6456('0x23')](respondWithResult(_0x48e7a0,0xc9))['catch'](handleError(_0x48e7a0,null));};exports[_0x6456('0x22')]=function(_0x1da884,_0x3cd545){if(_0x1da884[_0x6456('0x46')]['id']){delete _0x1da884[_0x6456('0x46')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x1da884['params']['id']}})[_0x6456('0x23')](handleEntityNotFound(_0x3cd545,null))[_0x6456('0x23')](saveUpdates(_0x1da884[_0x6456('0x46')],null))[_0x6456('0x23')](respondWithResult(_0x3cd545,null))[_0x6456('0x40')](handleError(_0x3cd545,null));};exports[_0x6456('0x47')]=function(_0x22b8bc,_0x1bd2f2){return db[_0x6456('0x2a')][_0x6456('0x44')]({'where':{'id':_0x22b8bc[_0x6456('0x42')]['id']}})[_0x6456('0x23')](handleEntityNotFound(_0x1bd2f2,null))[_0x6456('0x23')](removeEntity(_0x1bd2f2,null))[_0x6456('0x40')](handleError(_0x1bd2f2,null));}; \ No newline at end of file +var _0x9375=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','reject','save','then','stack','name','send','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','show','params','includeAll','options','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xdb1f92,_0x4fefc1){var _0x22dff5=function(_0xd5826e){while(--_0xd5826e){_0xdb1f92['push'](_0xdb1f92['shift']());}};_0x22dff5(++_0x4fefc1);}(_0x9375,0x1ae));var _0x5937=function(_0xc2917b,_0x5bb25c){_0xc2917b=_0xc2917b-0x0;var _0x425430=_0x9375[_0xc2917b];return _0x425430;};'use strict';var emlformat=require(_0x5937('0x0'));var rimraf=require(_0x5937('0x1'));var zipdir=require(_0x5937('0x2'));var jsonpatch=require(_0x5937('0x3'));var rp=require('request-promise');var moment=require(_0x5937('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5937('0x5'));var util=require(_0x5937('0x6'));var path=require(_0x5937('0x7'));var sox=require('sox');var csv=require(_0x5937('0x8'));var ejs=require(_0x5937('0x9'));var fs=require('fs');var fs_extra=require(_0x5937('0xa'));var _=require(_0x5937('0xb'));var squel=require(_0x5937('0xc'));var crypto=require(_0x5937('0xd'));var jsforce=require(_0x5937('0xe'));var deskjs=require(_0x5937('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5937('0x10'));var Redis=require(_0x5937('0x11'));var authService=require(_0x5937('0x12'));var qs=require(_0x5937('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5937('0x14'))(_0x5937('0x15'));var utils=require(_0x5937('0x16'));var config=require(_0x5937('0x17'));var licenseUtil=require(_0x5937('0x18'));var db=require(_0x5937('0x19'))['db'];function respondWithStatusCode(_0xc75c0c,_0x5e3c22){_0x5e3c22=_0x5e3c22||0xcc;return function(_0x32e9f0){if(_0x32e9f0){return _0xc75c0c['sendStatus'](_0x5e3c22);}return _0xc75c0c[_0x5937('0x1a')](_0x5e3c22)['end']();};}function respondWithResult(_0x493743,_0x5ac6bc){_0x5ac6bc=_0x5ac6bc||0xc8;return function(_0x28f8ec){if(_0x28f8ec){return _0x493743[_0x5937('0x1a')](_0x5ac6bc)['json'](_0x28f8ec);}};}function respondWithFilteredResult(_0xae6289,_0x539cab){return function(_0x798202){if(_0x798202){var _0x5edd36=typeof _0x539cab['offset']===_0x5937('0x1b')&&typeof _0x539cab[_0x5937('0x1c')]==='undefined';var _0x3893ac=_0x798202[_0x5937('0x1d')];var _0x286b96=_0x5edd36?0x0:_0x539cab[_0x5937('0x1e')];var _0x45f9d5=_0x5edd36?_0x798202[_0x5937('0x1d')]:_0x539cab[_0x5937('0x1e')]+_0x539cab[_0x5937('0x1c')];var _0x42df09;if(_0x45f9d5>=_0x3893ac){_0x45f9d5=_0x3893ac;_0x42df09=0xc8;}else{_0x42df09=0xce;}_0xae6289[_0x5937('0x1a')](_0x42df09);return _0xae6289[_0x5937('0x1f')](_0x5937('0x20'),_0x286b96+'-'+_0x45f9d5+'/'+_0x3893ac)['json'](_0x798202);}return null;};}function patchUpdates(_0x49d7ea){return function(_0x3486ff){try{jsonpatch['apply'](_0x3486ff,_0x49d7ea,!![]);}catch(_0x1b1404){return BPromise[_0x5937('0x21')](_0x1b1404);}return _0x3486ff[_0x5937('0x22')]();};}function saveUpdates(_0x4d1480,_0x3b38ec){return function(_0x4e0e7d){if(_0x4e0e7d){return _0x4e0e7d['update'](_0x4d1480)[_0x5937('0x23')](function(_0x4e2751){return _0x4e2751;});}return null;};}function removeEntity(_0x547d50,_0x53c0ee){return function(_0x16dc52){if(_0x16dc52){return _0x16dc52['destroy']()[_0x5937('0x23')](function(){_0x547d50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23913c,_0x2bc9eb){return function(_0x5e1639){if(!_0x5e1639){_0x23913c['sendStatus'](0x194);}return _0x5e1639;};}function handleError(_0x27e65c,_0x25d2d7){_0x25d2d7=_0x25d2d7||0x1f4;return function(_0x237d19){logger['error'](_0x237d19[_0x5937('0x24')]);if(_0x237d19[_0x5937('0x25')]){delete _0x237d19[_0x5937('0x25')];}_0x27e65c[_0x5937('0x1a')](_0x25d2d7)[_0x5937('0x26')](_0x237d19);};}exports['index']=function(_0x59d611,_0x1c32f4){var _0x33a0c3={},_0x1b1ee0={},_0x395080={'count':0x0,'rows':[]};var _0x1a0271=_['map'](db[_0x5937('0x27')][_0x5937('0x28')],function(_0x347a93){return{'name':_0x347a93[_0x5937('0x29')],'type':_0x347a93[_0x5937('0x2a')][_0x5937('0x2b')]};});_0x1b1ee0[_0x5937('0x2c')]=_['map'](_0x1a0271,_0x5937('0x25'));_0x1b1ee0[_0x5937('0x2d')]=_[_0x5937('0x2e')](_0x59d611[_0x5937('0x2d')]);_0x1b1ee0[_0x5937('0x2f')]=_[_0x5937('0x30')](_0x1b1ee0[_0x5937('0x2c')],_0x1b1ee0[_0x5937('0x2d')]);_0x33a0c3[_0x5937('0x31')]=_['intersection'](_0x1b1ee0[_0x5937('0x2c')],qs[_0x5937('0x32')](_0x59d611[_0x5937('0x2d')][_0x5937('0x32')]));_0x33a0c3[_0x5937('0x31')]=_0x33a0c3[_0x5937('0x31')][_0x5937('0x33')]?_0x33a0c3[_0x5937('0x31')]:_0x1b1ee0[_0x5937('0x2c')];if(!_0x59d611[_0x5937('0x2d')][_0x5937('0x34')](_0x5937('0x35'))){_0x33a0c3[_0x5937('0x1c')]=qs[_0x5937('0x1c')](_0x59d611['query'][_0x5937('0x1c')]);_0x33a0c3[_0x5937('0x1e')]=qs[_0x5937('0x1e')](_0x59d611[_0x5937('0x2d')]['offset']);}_0x33a0c3[_0x5937('0x36')]=qs[_0x5937('0x37')](_0x59d611['query'][_0x5937('0x37')]);_0x33a0c3[_0x5937('0x38')]=qs[_0x5937('0x2f')](_[_0x5937('0x39')](_0x59d611[_0x5937('0x2d')],_0x1b1ee0[_0x5937('0x2f')]),_0x1a0271);if(_0x59d611[_0x5937('0x2d')][_0x5937('0x3a')]){_0x33a0c3[_0x5937('0x38')]=_[_0x5937('0x3b')](_0x33a0c3[_0x5937('0x38')],{'$or':_[_0x5937('0x3c')](_0x1a0271,function(_0xd49a3d){if(_0xd49a3d[_0x5937('0x2a')]!==_0x5937('0x3d')){var _0xd90b1d={};_0xd90b1d[_0xd49a3d[_0x5937('0x25')]]={'$like':'%'+_0x59d611[_0x5937('0x2d')][_0x5937('0x3a')]+'%'};return _0xd90b1d;}})});}_0x33a0c3=_[_0x5937('0x3b')]({},_0x33a0c3,_0x59d611['options']);var _0x39f403={'where':_0x33a0c3['where']};return db['MailServerOut']['count'](_0x39f403)[_0x5937('0x23')](function(_0x2b1c20){_0x395080['count']=_0x2b1c20;if(_0x59d611[_0x5937('0x2d')]['includeAll']){_0x33a0c3[_0x5937('0x3e')]=[{'all':!![]}];}return db[_0x5937('0x27')][_0x5937('0x3f')](_0x33a0c3);})[_0x5937('0x23')](function(_0x1ee68b){_0x395080[_0x5937('0x40')]=_0x1ee68b;return _0x395080;})['then'](respondWithFilteredResult(_0x1c32f4,_0x33a0c3))['catch'](handleError(_0x1c32f4,null));};exports[_0x5937('0x41')]=function(_0x38443e,_0x1e3bd3){var _0x26be95={'raw':!![],'where':{'id':_0x38443e[_0x5937('0x42')]['id']}},_0x183422={};_0x183422['model']=_['keys'](db['MailServerOut'][_0x5937('0x28')]);_0x183422[_0x5937('0x2d')]=_[_0x5937('0x2e')](_0x38443e[_0x5937('0x2d')]);_0x183422['filters']=_[_0x5937('0x30')](_0x183422[_0x5937('0x2c')],_0x183422[_0x5937('0x2d')]);_0x26be95[_0x5937('0x31')]=_['intersection'](_0x183422[_0x5937('0x2c')],qs[_0x5937('0x32')](_0x38443e[_0x5937('0x2d')]['fields']));_0x26be95['attributes']=_0x26be95['attributes'][_0x5937('0x33')]?_0x26be95['attributes']:_0x183422[_0x5937('0x2c')];if(_0x38443e[_0x5937('0x2d')][_0x5937('0x43')]){_0x26be95[_0x5937('0x3e')]=[{'all':!![]}];}_0x26be95=_[_0x5937('0x3b')]({},_0x26be95,_0x38443e[_0x5937('0x44')]);return db[_0x5937('0x27')]['find'](_0x26be95)[_0x5937('0x23')](handleEntityNotFound(_0x1e3bd3,null))[_0x5937('0x23')](respondWithResult(_0x1e3bd3,null))[_0x5937('0x45')](handleError(_0x1e3bd3,null));};exports[_0x5937('0x46')]=function(_0x4e1776,_0x50eb63){return db[_0x5937('0x27')]['create'](_0x4e1776[_0x5937('0x47')],{})[_0x5937('0x23')](respondWithResult(_0x50eb63,0xc9))['catch'](handleError(_0x50eb63,null));};exports[_0x5937('0x48')]=function(_0x14ba32,_0x313821){if(_0x14ba32['body']['id']){delete _0x14ba32['body']['id'];}return db[_0x5937('0x27')]['find']({'where':{'id':_0x14ba32['params']['id']}})[_0x5937('0x23')](handleEntityNotFound(_0x313821,null))['then'](saveUpdates(_0x14ba32['body'],null))[_0x5937('0x23')](respondWithResult(_0x313821,null))[_0x5937('0x45')](handleError(_0x313821,null));};exports['destroy']=function(_0x137cc3,_0xa46573){return db[_0x5937('0x27')][_0x5937('0x49')]({'where':{'id':_0x137cc3[_0x5937('0x42')]['id']}})[_0x5937('0x23')](handleEntityNotFound(_0xa46573,null))[_0x5937('0x23')](removeEntity(_0xa46573,null))['catch'](handleError(_0xa46573,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3b42d87..481acc4 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 _0x18ca=['define','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x42c341,_0x31d467){var _0x43621b=function(_0x54be74){while(--_0x54be74){_0x42c341['push'](_0x42c341['shift']());}};_0x43621b(++_0x31d467);}(_0x18ca,0x146));var _0xa18c=function(_0x3f0ddd,_0x2045bd){_0x3f0ddd=_0x3f0ddd-0x0;var _0x2780fb=_0x18ca[_0x3f0ddd];return _0x2780fb;};'use strict';var _=require(_0xa18c('0x0'));var util=require('util');var logger=require(_0xa18c('0x1'))(_0xa18c('0x2'));var moment=require(_0xa18c('0x3'));var BPromise=require(_0xa18c('0x4'));var rp=require(_0xa18c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa18c('0x6'));var config=require(_0xa18c('0x7'));var attributes=require(_0xa18c('0x8'));module[_0xa18c('0x9')]=function(_0xccbeac,_0x5d0ef9){return _0xccbeac[_0xa18c('0xa')]('MailServerOut',attributes,{'tableName':_0xa18c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc30f=['define','MailServerOut','util','api','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x2fd5f8,_0x27edf1){var _0x558ce1=function(_0x4739f8){while(--_0x4739f8){_0x2fd5f8['push'](_0x2fd5f8['shift']());}};_0x558ce1(++_0x27edf1);}(_0xc30f,0x66));var _0xfc30=function(_0x24e970,_0x12265c){_0x24e970=_0x24e970-0x0;var _0x4b5a75=_0xc30f[_0x24e970];return _0x4b5a75;};'use strict';var _=require('lodash');var util=require(_0xfc30('0x0'));var logger=require('../../config/logger')(_0xfc30('0x1'));var moment=require('moment');var BPromise=require(_0xfc30('0x2'));var rp=require(_0xfc30('0x3'));var fs=require('fs');var path=require(_0xfc30('0x4'));var rimraf=require('rimraf');var config=require(_0xfc30('0x5'));var attributes=require(_0xfc30('0x6'));module[_0xfc30('0x7')]=function(_0x212a35,_0xddd1cb){return _0x212a35[_0xfc30('0x8')](_0xfc30('0x9'),attributes,{'tableName':'mail_servers_out','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 b081072..0a6149d 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2e9555,_0x4c4f54){var _0x1f2d58=function(_0x207990){while(--_0x207990){_0x2e9555['push'](_0x2e9555['shift']());}};_0x1f2d58(++_0x4c4f54);}(_0x1261,0x144));var _0x1126=function(_0x9a825b,_0x35c63e){_0x9a825b=_0x9a825b-0x0;var _0x4e5706=_0x1261[_0x9a825b];return _0x4e5706;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2a7fa8,_0x413c0e){var _0xf7e306=function(_0x9af322){while(--_0x9af322){_0x2a7fa8['push'](_0x2a7fa8['shift']());}};_0xf7e306(++_0x413c0e);}(_0xadb5,0xad));var _0x5adb=function(_0x30b0a0,_0xae90de){_0x30b0a0=_0x30b0a0-0x0;var _0x263f88=_0xadb5[_0x30b0a0];return _0x263f88;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a19505d..fd414f1 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 _0x409a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','post','create','put','update','/:id','destroy','multer','path','connect-timeout','express'];(function(_0x32da82,_0x339097){var _0x1876f2=function(_0x33b8f6){while(--_0x33b8f6){_0x32da82['push'](_0x32da82['shift']());}};_0x1876f2(++_0x339097);}(_0x409a,0x119));var _0xa409=function(_0x34bb09,_0xb6ea07){_0x34bb09=_0x34bb09-0x0;var _0x40e837=_0x409a[_0x34bb09];return _0x40e837;};'use strict';var multer=require(_0xa409('0x0'));var util=require('util');var path=require(_0xa409('0x1'));var timeout=require(_0xa409('0x2'));var express=require(_0xa409('0x3'));var router=express['Router']();var fs_extra=require(_0xa409('0x4'));var auth=require(_0xa409('0x5'));var interaction=require(_0xa409('0x6'));var config=require(_0xa409('0x7'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0xa409('0x8')](),controller[_0xa409('0x9')]);router[_0xa409('0xa')](_0xa409('0xb'),auth['isAuthenticated'](),controller[_0xa409('0xc')]);router[_0xa409('0xa')]('/:id',auth[_0xa409('0x8')](),controller['show']);router[_0xa409('0xd')]('/',auth[_0xa409('0x8')](),controller[_0xa409('0xe')]);router[_0xa409('0xf')]('/:id',auth[_0xa409('0x8')](),controller[_0xa409('0x10')]);router['delete'](_0xa409('0x11'),auth[_0xa409('0x8')](),controller[_0xa409('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb217=['put','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','describe','/:id','post','create'];(function(_0x316ad3,_0x24e897){var _0x1d81e0=function(_0x218f04){while(--_0x218f04){_0x316ad3['push'](_0x316ad3['shift']());}};_0x1d81e0(++_0x24e897);}(_0xb217,0x101));var _0x7b21=function(_0x273fcf,_0x5450f9){_0x273fcf=_0x273fcf-0x0;var _0x340b78=_0xb217[_0x273fcf];return _0x340b78;};'use strict';var multer=require('multer');var util=require(_0x7b21('0x0'));var path=require(_0x7b21('0x1'));var timeout=require(_0x7b21('0x2'));var express=require(_0x7b21('0x3'));var router=express['Router']();var fs_extra=require(_0x7b21('0x4'));var auth=require(_0x7b21('0x5'));var interaction=require(_0x7b21('0x6'));var config=require(_0x7b21('0x7'));var controller=require(_0x7b21('0x8'));router[_0x7b21('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b21('0xa')]);router[_0x7b21('0x9')](_0x7b21('0xb'),auth['isAuthenticated'](),controller[_0x7b21('0xc')]);router[_0x7b21('0x9')](_0x7b21('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7b21('0xe')]('/',auth['isAuthenticated'](),controller[_0x7b21('0xf')]);router[_0x7b21('0x10')](_0x7b21('0xd'),auth[_0x7b21('0x11')](),controller['update']);router[_0x7b21('0x12')](_0x7b21('0xd'),auth[_0x7b21('0x11')](),controller[_0x7b21('0x13')]);module[_0x7b21('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 64b225f..b195a5d 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 _0x5e0e=['STRING','sequelize','exports','name'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5e0e,0x89));var _0xe5e0=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0x5e0e[_0x219fa0];return _0xc603fb;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe5e0('0x3')]}}; \ No newline at end of file +var _0x0e4b=['STRING','sequelize','exports'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x260085,_0x5649d5){_0x260085=_0x260085-0x0;var _0x329942=_0x0e4b[_0x260085];return _0x329942;};'use strict';var Sequelize=require(_0xb0e4('0x0'));module[_0xb0e4('0x1')]={'name':{'type':Sequelize[_0xb0e4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb0e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d2421d9..7b7fd42 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 _0x3a61=['../../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','reject','save','then','destroy','error','stack','name','index','map','MailSubstatus','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','describe','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'];(function(_0x2f9021,_0x300991){var _0x405586=function(_0xe6c8e6){while(--_0xe6c8e6){_0x2f9021['push'](_0x2f9021['shift']());}};_0x405586(++_0x300991);}(_0x3a61,0xd4));var _0x13a6=function(_0x2391ab,_0x10b86d){_0x2391ab=_0x2391ab-0x0;var _0x598a88=_0x3a61[_0x2391ab];return _0x598a88;};'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['MailSubstatus'][_0x13a6('0x20')](_0x363635)['then'](function(_0x257530){_0xc1dd82['count']=_0x257530;if(_0xc22b67[_0x13a6('0x34')]['includeAll']){_0x28b99c[_0x13a6('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_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['MailSubstatus'][_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['MailSubstatus'][_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['MailSubstatus'][_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['MailSubstatus'][_0x13a6('0x48')]({'where':{'id':_0x17f9aa[_0x13a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a2559,null))[_0x13a6('0x27')](removeEntity(_0x2a2559,null))[_0x13a6('0x44')](handleError(_0x2a2559,null));};exports['describe']=function(_0x298755,_0x2d7fe9){return db[_0x13a6('0x2e')][_0x13a6('0x4c')]()[_0x13a6('0x27')](respondWithResult(_0x2d7fe9,null))[_0x13a6('0x44')](handleError(_0x2d7fe9,null));}; \ No newline at end of file +var _0x72b3=['limit','count','set','Content-Range','update','then','destroy','end','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x26b254,_0x167bf8){var _0x55a821=function(_0x142b9e){while(--_0x142b9e){_0x26b254['push'](_0x26b254['shift']());}};_0x55a821(++_0x167bf8);}(_0x72b3,0x1a3));var _0x372b=function(_0x1aa3fe,_0x27c5fa){_0x1aa3fe=_0x1aa3fe-0x0;var _0x163cee=_0x72b3[_0x1aa3fe];return _0x163cee;};'use strict';var emlformat=require(_0x372b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x372b('0x1'));var jsonpatch=require(_0x372b('0x2'));var rp=require(_0x372b('0x3'));var moment=require('moment');var BPromise=require(_0x372b('0x4'));var Mustache=require(_0x372b('0x5'));var util=require('util');var path=require(_0x372b('0x6'));var sox=require(_0x372b('0x7'));var csv=require('to-csv');var ejs=require(_0x372b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x372b('0x9'));var squel=require(_0x372b('0xa'));var crypto=require(_0x372b('0xb'));var jsforce=require(_0x372b('0xc'));var deskjs=require(_0x372b('0xd'));var toCsv=require(_0x372b('0xe'));var querystring=require(_0x372b('0xf'));var Papa=require(_0x372b('0x10'));var Redis=require(_0x372b('0x11'));var authService=require(_0x372b('0x12'));var qs=require(_0x372b('0x13'));var as=require(_0x372b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x372b('0x15'))(_0x372b('0x16'));var utils=require(_0x372b('0x17'));var config=require(_0x372b('0x18'));var licenseUtil=require(_0x372b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x516c50,_0x2d21f8){_0x2d21f8=_0x2d21f8||0xcc;return function(_0x1ba397){if(_0x1ba397){return _0x516c50[_0x372b('0x1a')](_0x2d21f8);}return _0x516c50[_0x372b('0x1b')](_0x2d21f8)['end']();};}function respondWithResult(_0x5cfb53,_0x54434d){_0x54434d=_0x54434d||0xc8;return function(_0x3fe82a){if(_0x3fe82a){return _0x5cfb53[_0x372b('0x1b')](_0x54434d)[_0x372b('0x1c')](_0x3fe82a);}};}function respondWithFilteredResult(_0x4479de,_0x2b2369){return function(_0x48fceb){if(_0x48fceb){var _0x508385=typeof _0x2b2369[_0x372b('0x1d')]===_0x372b('0x1e')&&typeof _0x2b2369[_0x372b('0x1f')]==='undefined';var _0x2294f4=_0x48fceb['count'];var _0x295f06=_0x508385?0x0:_0x2b2369[_0x372b('0x1d')];var _0x5bdd1f=_0x508385?_0x48fceb[_0x372b('0x20')]:_0x2b2369['offset']+_0x2b2369[_0x372b('0x1f')];var _0x2e7237;if(_0x5bdd1f>=_0x2294f4){_0x5bdd1f=_0x2294f4;_0x2e7237=0xc8;}else{_0x2e7237=0xce;}_0x4479de[_0x372b('0x1b')](_0x2e7237);return _0x4479de[_0x372b('0x21')](_0x372b('0x22'),_0x295f06+'-'+_0x5bdd1f+'/'+_0x2294f4)[_0x372b('0x1c')](_0x48fceb);}return null;};}function patchUpdates(_0x5e840d){return function(_0x5385a2){try{jsonpatch['apply'](_0x5385a2,_0x5e840d,!![]);}catch(_0x10fe60){return BPromise['reject'](_0x10fe60);}return _0x5385a2['save']();};}function saveUpdates(_0x453507,_0x385efd){return function(_0x282649){if(_0x282649){return _0x282649[_0x372b('0x23')](_0x453507)[_0x372b('0x24')](function(_0x3398c1){return _0x3398c1;});}return null;};}function removeEntity(_0x1081e2,_0x5ef2d0){return function(_0x3f76d6){if(_0x3f76d6){return _0x3f76d6[_0x372b('0x25')]()[_0x372b('0x24')](function(){_0x1081e2['status'](0xcc)[_0x372b('0x26')]();});}};}function handleEntityNotFound(_0x419ef7,_0x377580){return function(_0x1959e2){if(!_0x1959e2){_0x419ef7[_0x372b('0x1a')](0x194);}return _0x1959e2;};}function handleError(_0x239d4b,_0xf25479){_0xf25479=_0xf25479||0x1f4;return function(_0x1c56b2){logger['error'](_0x1c56b2[_0x372b('0x27')]);if(_0x1c56b2[_0x372b('0x28')]){delete _0x1c56b2[_0x372b('0x28')];}_0x239d4b[_0x372b('0x1b')](_0xf25479)['send'](_0x1c56b2);};}exports[_0x372b('0x29')]=function(_0x16f093,_0x1c83ea){var _0x5e254b={},_0x358c3a={},_0x19b7d1={'count':0x0,'rows':[]};var _0x21022b=_[_0x372b('0x2a')](db[_0x372b('0x2b')][_0x372b('0x2c')],function(_0x209cd9){return{'name':_0x209cd9[_0x372b('0x2d')],'type':_0x209cd9[_0x372b('0x2e')][_0x372b('0x2f')]};});_0x358c3a['model']=_['map'](_0x21022b,'name');_0x358c3a['query']=_['keys'](_0x16f093[_0x372b('0x30')]);_0x358c3a[_0x372b('0x31')]=_[_0x372b('0x32')](_0x358c3a['model'],_0x358c3a['query']);_0x5e254b[_0x372b('0x33')]=_[_0x372b('0x32')](_0x358c3a[_0x372b('0x34')],qs[_0x372b('0x35')](_0x16f093['query'][_0x372b('0x35')]));_0x5e254b['attributes']=_0x5e254b[_0x372b('0x33')][_0x372b('0x36')]?_0x5e254b['attributes']:_0x358c3a[_0x372b('0x34')];if(!_0x16f093['query'][_0x372b('0x37')](_0x372b('0x38'))){_0x5e254b[_0x372b('0x1f')]=qs['limit'](_0x16f093[_0x372b('0x30')][_0x372b('0x1f')]);_0x5e254b[_0x372b('0x1d')]=qs['offset'](_0x16f093[_0x372b('0x30')][_0x372b('0x1d')]);}_0x5e254b[_0x372b('0x39')]=qs[_0x372b('0x3a')](_0x16f093[_0x372b('0x30')]['sort']);_0x5e254b[_0x372b('0x3b')]=qs[_0x372b('0x31')](_[_0x372b('0x3c')](_0x16f093[_0x372b('0x30')],_0x358c3a['filters']),_0x21022b);if(_0x16f093[_0x372b('0x30')][_0x372b('0x3d')]){_0x5e254b['where']=_[_0x372b('0x3e')](_0x5e254b[_0x372b('0x3b')],{'$or':_['map'](_0x21022b,function(_0xde2a14){if(_0xde2a14[_0x372b('0x2e')]!=='VIRTUAL'){var _0x403b7e={};_0x403b7e[_0xde2a14['name']]={'$like':'%'+_0x16f093[_0x372b('0x30')][_0x372b('0x3d')]+'%'};return _0x403b7e;}})});}_0x5e254b=_['merge']({},_0x5e254b,_0x16f093[_0x372b('0x3f')]);var _0x2a6308={'where':_0x5e254b[_0x372b('0x3b')]};return db[_0x372b('0x2b')][_0x372b('0x20')](_0x2a6308)[_0x372b('0x24')](function(_0x10f169){_0x19b7d1[_0x372b('0x20')]=_0x10f169;if(_0x16f093[_0x372b('0x30')]['includeAll']){_0x5e254b[_0x372b('0x40')]=[{'all':!![]}];}return db['MailSubstatus'][_0x372b('0x41')](_0x5e254b);})[_0x372b('0x24')](function(_0x1d0d88){_0x19b7d1['rows']=_0x1d0d88;return _0x19b7d1;})[_0x372b('0x24')](respondWithFilteredResult(_0x1c83ea,_0x5e254b))[_0x372b('0x42')](handleError(_0x1c83ea,null));};exports[_0x372b('0x43')]=function(_0x1f71e8,_0x245065){var _0x485bf4={'raw':!![],'where':{'id':_0x1f71e8[_0x372b('0x44')]['id']}},_0x1f9ffb={};_0x1f9ffb[_0x372b('0x34')]=_[_0x372b('0x45')](db[_0x372b('0x2b')][_0x372b('0x2c')]);_0x1f9ffb[_0x372b('0x30')]=_[_0x372b('0x45')](_0x1f71e8[_0x372b('0x30')]);_0x1f9ffb[_0x372b('0x31')]=_[_0x372b('0x32')](_0x1f9ffb[_0x372b('0x34')],_0x1f9ffb[_0x372b('0x30')]);_0x485bf4[_0x372b('0x33')]=_[_0x372b('0x32')](_0x1f9ffb[_0x372b('0x34')],qs[_0x372b('0x35')](_0x1f71e8[_0x372b('0x30')]['fields']));_0x485bf4['attributes']=_0x485bf4[_0x372b('0x33')][_0x372b('0x36')]?_0x485bf4[_0x372b('0x33')]:_0x1f9ffb[_0x372b('0x34')];if(_0x1f71e8[_0x372b('0x30')][_0x372b('0x46')]){_0x485bf4[_0x372b('0x40')]=[{'all':!![]}];}_0x485bf4=_['merge']({},_0x485bf4,_0x1f71e8[_0x372b('0x3f')]);return db[_0x372b('0x2b')][_0x372b('0x47')](_0x485bf4)[_0x372b('0x24')](handleEntityNotFound(_0x245065,null))[_0x372b('0x24')](respondWithResult(_0x245065,null))[_0x372b('0x42')](handleError(_0x245065,null));};exports[_0x372b('0x48')]=function(_0x245264,_0xd79540){return db[_0x372b('0x2b')]['create'](_0x245264[_0x372b('0x49')],{})[_0x372b('0x24')](respondWithResult(_0xd79540,0xc9))[_0x372b('0x42')](handleError(_0xd79540,null));};exports[_0x372b('0x23')]=function(_0x4ecacf,_0x10152d){if(_0x4ecacf['body']['id']){delete _0x4ecacf[_0x372b('0x49')]['id'];}return db[_0x372b('0x2b')][_0x372b('0x47')]({'where':{'id':_0x4ecacf[_0x372b('0x44')]['id']}})[_0x372b('0x24')](handleEntityNotFound(_0x10152d,null))[_0x372b('0x24')](saveUpdates(_0x4ecacf[_0x372b('0x49')],null))['then'](respondWithResult(_0x10152d,null))['catch'](handleError(_0x10152d,null));};exports['destroy']=function(_0x48e70d,_0x27f2f6){return db[_0x372b('0x2b')]['find']({'where':{'id':_0x48e70d[_0x372b('0x44')]['id']}})['then'](handleEntityNotFound(_0x27f2f6,null))[_0x372b('0x24')](removeEntity(_0x27f2f6,null))[_0x372b('0x42')](handleError(_0x27f2f6,null));};exports[_0x372b('0x4a')]=function(_0x4396c8,_0x40bef5){return db['MailSubstatus'][_0x372b('0x4a')]()[_0x372b('0x24')](respondWithResult(_0x40bef5,null))[_0x372b('0x42')](handleError(_0x40bef5,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5f66e36..8d6f856 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 _0x7e3d=['moment','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','../../config/logger','api'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x7e3d,0xf9));var _0xd7e3=function(_0x5c280f,_0x17a685){_0x5c280f=_0x5c280f-0x0;var _0x2f68e1=_0x7e3d[_0x5c280f];return _0x2f68e1;};'use strict';var _=require(_0xd7e3('0x0'));var util=require('util');var logger=require(_0xd7e3('0x1'))(_0xd7e3('0x2'));var moment=require(_0xd7e3('0x3'));var BPromise=require(_0xd7e3('0x4'));var rp=require(_0xd7e3('0x5'));var fs=require('fs');var path=require(_0xd7e3('0x6'));var rimraf=require(_0xd7e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xd7e3('0x8'));module['exports']=function(_0x51368e,_0xf7667e){return _0x51368e[_0xd7e3('0x9')](_0xd7e3('0xa'),attributes,{'tableName':_0xd7e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8405=['request-promise','path','rimraf','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','bluebird'];(function(_0x3f29b4,_0x6fc359){var _0xec4178=function(_0x412ae9){while(--_0x412ae9){_0x3f29b4['push'](_0x3f29b4['shift']());}};_0xec4178(++_0x6fc359);}(_0x8405,0x167));var _0x5840=function(_0x37438d,_0x35078b){_0x37438d=_0x37438d-0x0;var _0x13487b=_0x8405[_0x37438d];return _0x13487b;};'use strict';var _=require(_0x5840('0x0'));var util=require(_0x5840('0x1'));var logger=require(_0x5840('0x2'))(_0x5840('0x3'));var moment=require('moment');var BPromise=require(_0x5840('0x4'));var rp=require(_0x5840('0x5'));var fs=require('fs');var path=require(_0x5840('0x6'));var rimraf=require(_0x5840('0x7'));var config=require('../../config/environment');var attributes=require(_0x5840('0x8'));module[_0x5840('0x9')]=function(_0x3ad3fd,_0x4b29ec){return _0x3ad3fd[_0x5840('0xa')](_0x5840('0xb'),attributes,{'tableName':_0x5840('0xc'),'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 89a5137..ab14045 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 _0x39a3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info'];(function(_0x1f21b2,_0x114ccc){var _0x279ad2=function(_0xd4d17f){while(--_0xd4d17f){_0x1f21b2['push'](_0x1f21b2['shift']());}};_0x279ad2(++_0x114ccc);}(_0x39a3,0x1ce));var _0x339a=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x39a3[_0x43de22];return _0x4b15ee;};'use strict';var _=require(_0x339a('0x0'));var util=require(_0x339a('0x1'));var moment=require(_0x339a('0x2'));var BPromise=require(_0x339a('0x3'));var rs=require(_0x339a('0x4'));var fs=require('fs');var Redis=require(_0x339a('0x5'));var db=require(_0x339a('0x6'))['db'];var utils=require(_0x339a('0x7'));var logger=require(_0x339a('0x8'))(_0x339a('0x9'));var config=require(_0x339a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x339a('0xb')][_0x339a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b50ff,_0x2ee8ef,_0x575e16){return new BPromise(function(_0x593709,_0x24bdce){return client['request'](_0x5b50ff,_0x575e16)[_0x339a('0xd')](function(_0x20518b){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2ee8ef,_0x339a('0xe'));logger[_0x339a('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2ee8ef,_0x339a('0xe'),JSON[_0x339a('0x10')](_0x20518b));if(_0x20518b[_0x339a('0x11')]){if(_0x20518b['error'][_0x339a('0x12')]===0x1f4){logger[_0x339a('0x11')](_0x339a('0x13'),_0x2ee8ef,_0x20518b[_0x339a('0x11')][_0x339a('0x14')]);return _0x24bdce(_0x20518b[_0x339a('0x11')][_0x339a('0x14')]);}logger[_0x339a('0x11')](_0x339a('0x13'),_0x2ee8ef,_0x20518b[_0x339a('0x11')][_0x339a('0x14')]);return _0x593709(_0x20518b[_0x339a('0x11')]['message']);}else{logger[_0x339a('0x15')]('MailSubstatus,\x20%s,\x20%s',_0x2ee8ef,_0x339a('0xe'));_0x593709(_0x20518b['result']['message']);}})['catch'](function(_0x5339bd){logger['error'](_0x339a('0x13'),_0x2ee8ef,_0x5339bd);_0x24bdce(_0x5339bd);});});} \ No newline at end of file +var _0xafea=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x2f2fd8,_0x421132){var _0x4916ff=function(_0x6331ff){while(--_0x6331ff){_0x2f2fd8['push'](_0x2f2fd8['shift']());}};_0x4916ff(++_0x421132);}(_0xafea,0x1e0));var _0xaafe=function(_0x47cf04,_0x5c3fb6){_0x47cf04=_0x47cf04-0x0;var _0x119628=_0xafea[_0x47cf04];return _0x119628;};'use strict';var _=require('lodash');var util=require(_0xaafe('0x0'));var moment=require(_0xaafe('0x1'));var BPromise=require(_0xaafe('0x2'));var rs=require(_0xaafe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaafe('0x4'))['db'];var utils=require(_0xaafe('0x5'));var logger=require('../../config/logger')(_0xaafe('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaafe('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d1ae,_0x475007,_0x5b2f96){return new BPromise(function(_0x7988f0,_0x529d90){return client[_0xaafe('0x8')](_0x53d1ae,_0x5b2f96)[_0xaafe('0x9')](function(_0x49d9ca){logger['info'](_0xaafe('0xa'),_0x475007,'request\x20sent');logger[_0xaafe('0xb')](_0xaafe('0xc'),_0x475007,_0xaafe('0xd'),JSON['stringify'](_0x49d9ca));if(_0x49d9ca[_0xaafe('0xe')]){if(_0x49d9ca[_0xaafe('0xe')][_0xaafe('0xf')]===0x1f4){logger[_0xaafe('0xe')](_0xaafe('0xa'),_0x475007,_0x49d9ca[_0xaafe('0xe')]['message']);return _0x529d90(_0x49d9ca[_0xaafe('0xe')][_0xaafe('0x10')]);}logger[_0xaafe('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x475007,_0x49d9ca[_0xaafe('0xe')][_0xaafe('0x10')]);return _0x7988f0(_0x49d9ca[_0xaafe('0xe')][_0xaafe('0x10')]);}else{logger[_0xaafe('0x11')](_0xaafe('0xa'),_0x475007,_0xaafe('0xd'));_0x7988f0(_0x49d9ca[_0xaafe('0x12')][_0xaafe('0x10')]);}})[_0xaafe('0x13')](function(_0x25c691){logger['error'](_0xaafe('0xa'),_0x475007,_0x25c691);_0x529d90(_0x25c691);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index a2329d8..6e2d73c 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 _0x19d6=['get','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe'];(function(_0x4b54bf,_0xefb6c1){var _0x955030=function(_0x132ae9){while(--_0x132ae9){_0x4b54bf['push'](_0x4b54bf['shift']());}};_0x955030(++_0xefb6c1);}(_0x19d6,0x197));var _0x619d=function(_0x346b4e,_0x52947d){_0x346b4e=_0x346b4e-0x0;var _0x2a283b=_0x19d6[_0x346b4e];return _0x2a283b;};'use strict';var multer=require(_0x619d('0x0'));var util=require(_0x619d('0x1'));var path=require(_0x619d('0x2'));var timeout=require(_0x619d('0x3'));var express=require('express');var router=express[_0x619d('0x4')]();var fs_extra=require(_0x619d('0x5'));var auth=require(_0x619d('0x6'));var interaction=require(_0x619d('0x7'));var config=require(_0x619d('0x8'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x619d('0x9')](),controller[_0x619d('0xa')]);router['get'](_0x619d('0xb'),auth[_0x619d('0x9')](),controller[_0x619d('0xc')]);router[_0x619d('0xd')](_0x619d('0xe'),auth['isAuthenticated'](),controller[_0x619d('0xf')]);router[_0x619d('0x10')]('/',auth[_0x619d('0x9')](),controller[_0x619d('0x11')]);router['put'](_0x619d('0xe'),auth[_0x619d('0x9')](),controller[_0x619d('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x619d('0x13')]);module[_0x619d('0x14')]=router; \ No newline at end of file +var _0x612f=['create','put','update','delete','/:id','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','post'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x612f,0x8b));var _0xf612=function(_0x4f9671,_0x4fb290){_0x4f9671=_0x4f9671-0x0;var _0x58c2dd=_0x612f[_0x4f9671];return _0x58c2dd;};'use strict';var multer=require(_0xf612('0x0'));var util=require(_0xf612('0x1'));var path=require(_0xf612('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf612('0x3')]();var fs_extra=require(_0xf612('0x4'));var auth=require(_0xf612('0x5'));var interaction=require(_0xf612('0x6'));var config=require(_0xf612('0x7'));var controller=require(_0xf612('0x8'));router[_0xf612('0x9')]('/',auth[_0xf612('0xa')](),controller['index']);router['get']('/describe',auth[_0xf612('0xa')](),controller[_0xf612('0xb')]);router[_0xf612('0x9')]('/:id',auth[_0xf612('0xa')](),controller['show']);router[_0xf612('0xc')]('/',auth[_0xf612('0xa')](),controller[_0xf612('0xd')]);router[_0xf612('0xe')]('/:id',auth[_0xf612('0xa')](),controller[_0xf612('0xf')]);router[_0xf612('0x10')](_0xf612('0x11'),auth['isAuthenticated'](),controller[_0xf612('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index df29ef6..2f373b1 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x589bf8,_0x2e47ad){var _0x2d37e7=function(_0x302794){while(--_0x302794){_0x589bf8['push'](_0x589bf8['shift']());}};_0x2d37e7(++_0x2e47ad);}(_0xedd9,0xfc));var _0x9edd=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0xedd9[_0x5da048];return _0x13dfc5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x27e99f,_0xf22967){var _0xa0fc3f=function(_0x276503){while(--_0x276503){_0x27e99f['push'](_0x27e99f['shift']());}};_0xa0fc3f(++_0xf22967);}(_0xaa88,0x137));var _0x8aa8=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xaa88[_0x18abd2];return _0x1dcad6;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b34cf84..a90dec9 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 _0x5c9e=['type','key','model','name','keys','query','filters','intersection','fields','attributes','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','MailTransferReport','rawAttributes','fieldName'];(function(_0x5a3af1,_0x397a79){var _0xbaa54c=function(_0x589b72){while(--_0x589b72){_0x5a3af1['push'](_0x5a3af1['shift']());}};_0xbaa54c(++_0x397a79);}(_0x5c9e,0x1e5));var _0xe5c9=function(_0x14dc4c,_0x2516a7){_0x14dc4c=_0x14dc4c-0x0;var _0x486b53=_0x5c9e[_0x14dc4c];return _0x486b53;};'use strict';var emlformat=require(_0xe5c9('0x0'));var rimraf=require(_0xe5c9('0x1'));var zipdir=require(_0xe5c9('0x2'));var jsonpatch=require(_0xe5c9('0x3'));var rp=require(_0xe5c9('0x4'));var moment=require(_0xe5c9('0x5'));var BPromise=require(_0xe5c9('0x6'));var Mustache=require(_0xe5c9('0x7'));var util=require(_0xe5c9('0x8'));var path=require('path');var sox=require(_0xe5c9('0x9'));var csv=require(_0xe5c9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5c9('0xb'));var squel=require('squel');var crypto=require(_0xe5c9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe5c9('0xd'));var toCsv=require(_0xe5c9('0xa'));var querystring=require('querystring');var Papa=require(_0xe5c9('0xe'));var Redis=require(_0xe5c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe5c9('0x10'));var as=require(_0xe5c9('0x11'));var hardwareService=require(_0xe5c9('0x12'));var logger=require(_0xe5c9('0x13'))(_0xe5c9('0x14'));var utils=require('../../config/utils');var config=require(_0xe5c9('0x15'));var licenseUtil=require(_0xe5c9('0x16'));var db=require(_0xe5c9('0x17'))['db'];function respondWithStatusCode(_0xa84d43,_0x5c0360){_0x5c0360=_0x5c0360||0xcc;return function(_0x30ba26){if(_0x30ba26){return _0xa84d43['sendStatus'](_0x5c0360);}return _0xa84d43[_0xe5c9('0x18')](_0x5c0360)[_0xe5c9('0x19')]();};}function respondWithResult(_0x4b93c0,_0x19e012){_0x19e012=_0x19e012||0xc8;return function(_0x329e7b){if(_0x329e7b){return _0x4b93c0['status'](_0x19e012)[_0xe5c9('0x1a')](_0x329e7b);}};}function respondWithFilteredResult(_0xc73887,_0xd35afb){return function(_0x218909){if(_0x218909){var _0x23b92e=typeof _0xd35afb['offset']==='undefined'&&typeof _0xd35afb[_0xe5c9('0x1b')]===_0xe5c9('0x1c');var _0x4183e3=_0x218909[_0xe5c9('0x1d')];var _0x55223e=_0x23b92e?0x0:_0xd35afb[_0xe5c9('0x1e')];var _0xc47341=_0x23b92e?_0x218909['count']:_0xd35afb[_0xe5c9('0x1e')]+_0xd35afb[_0xe5c9('0x1b')];var _0x439559;if(_0xc47341>=_0x4183e3){_0xc47341=_0x4183e3;_0x439559=0xc8;}else{_0x439559=0xce;}_0xc73887['status'](_0x439559);return _0xc73887[_0xe5c9('0x1f')](_0xe5c9('0x20'),_0x55223e+'-'+_0xc47341+'/'+_0x4183e3)[_0xe5c9('0x1a')](_0x218909);}return null;};}function patchUpdates(_0x50a795){return function(_0x101b7a){try{jsonpatch['apply'](_0x101b7a,_0x50a795,!![]);}catch(_0x5976d5){return BPromise[_0xe5c9('0x21')](_0x5976d5);}return _0x101b7a[_0xe5c9('0x22')]();};}function saveUpdates(_0x36e81f,_0x569bb2){return function(_0x10856e){if(_0x10856e){return _0x10856e[_0xe5c9('0x23')](_0x36e81f)[_0xe5c9('0x24')](function(_0xc9355b){return _0xc9355b;});}return null;};}function removeEntity(_0x2fd3cc,_0xc5efef){return function(_0x3c2662){if(_0x3c2662){return _0x3c2662[_0xe5c9('0x25')]()[_0xe5c9('0x24')](function(){_0x2fd3cc[_0xe5c9('0x18')](0xcc)[_0xe5c9('0x19')]();});}};}function handleEntityNotFound(_0x42398d,_0x578dc1){return function(_0x1d9098){if(!_0x1d9098){_0x42398d[_0xe5c9('0x26')](0x194);}return _0x1d9098;};}function handleError(_0x5912cc,_0x3ea6c7){_0x3ea6c7=_0x3ea6c7||0x1f4;return function(_0x2f8f3d){logger[_0xe5c9('0x27')](_0x2f8f3d[_0xe5c9('0x28')]);if(_0x2f8f3d['name']){delete _0x2f8f3d['name'];}_0x5912cc[_0xe5c9('0x18')](_0x3ea6c7)[_0xe5c9('0x29')](_0x2f8f3d);};}exports[_0xe5c9('0x2a')]=function(_0x222cd3,_0x23ec44){var _0x1ba8b6={},_0x2a6b74={},_0x48dfb0={'count':0x0,'rows':[]};var _0x19caa5=_[_0xe5c9('0x2b')](db[_0xe5c9('0x2c')][_0xe5c9('0x2d')],function(_0x134a4e){return{'name':_0x134a4e[_0xe5c9('0x2e')],'type':_0x134a4e[_0xe5c9('0x2f')][_0xe5c9('0x30')]};});_0x2a6b74[_0xe5c9('0x31')]=_[_0xe5c9('0x2b')](_0x19caa5,_0xe5c9('0x32'));_0x2a6b74['query']=_[_0xe5c9('0x33')](_0x222cd3[_0xe5c9('0x34')]);_0x2a6b74[_0xe5c9('0x35')]=_[_0xe5c9('0x36')](_0x2a6b74[_0xe5c9('0x31')],_0x2a6b74['query']);_0x1ba8b6['attributes']=_['intersection'](_0x2a6b74[_0xe5c9('0x31')],qs[_0xe5c9('0x37')](_0x222cd3[_0xe5c9('0x34')][_0xe5c9('0x37')]));_0x1ba8b6['attributes']=_0x1ba8b6[_0xe5c9('0x38')]['length']?_0x1ba8b6[_0xe5c9('0x38')]:_0x2a6b74['model'];if(!_0x222cd3[_0xe5c9('0x34')]['hasOwnProperty']('nolimit')){_0x1ba8b6[_0xe5c9('0x1b')]=qs[_0xe5c9('0x1b')](_0x222cd3[_0xe5c9('0x34')][_0xe5c9('0x1b')]);_0x1ba8b6[_0xe5c9('0x1e')]=qs[_0xe5c9('0x1e')](_0x222cd3[_0xe5c9('0x34')][_0xe5c9('0x1e')]);}_0x1ba8b6[_0xe5c9('0x39')]=qs[_0xe5c9('0x3a')](_0x222cd3['query']['sort']);_0x1ba8b6[_0xe5c9('0x3b')]=qs[_0xe5c9('0x35')](_['pick'](_0x222cd3['query'],_0x2a6b74[_0xe5c9('0x35')]),_0x19caa5);if(_0x222cd3[_0xe5c9('0x34')][_0xe5c9('0x3c')]){_0x1ba8b6[_0xe5c9('0x3b')]=_[_0xe5c9('0x3d')](_0x1ba8b6[_0xe5c9('0x3b')],{'$or':_[_0xe5c9('0x2b')](_0x19caa5,function(_0x3b6c72){if(_0x3b6c72[_0xe5c9('0x2f')]!==_0xe5c9('0x3e')){var _0x4a5f6c={};_0x4a5f6c[_0x3b6c72[_0xe5c9('0x32')]]={'$like':'%'+_0x222cd3[_0xe5c9('0x34')]['filter']+'%'};return _0x4a5f6c;}})});}_0x1ba8b6=_[_0xe5c9('0x3d')]({},_0x1ba8b6,_0x222cd3[_0xe5c9('0x3f')]);var _0x29d458={'where':_0x1ba8b6['where']};return db[_0xe5c9('0x2c')][_0xe5c9('0x1d')](_0x29d458)[_0xe5c9('0x24')](function(_0x9dcc96){_0x48dfb0['count']=_0x9dcc96;if(_0x222cd3[_0xe5c9('0x34')]['includeAll']){_0x1ba8b6[_0xe5c9('0x40')]=[{'all':!![]}];}return db[_0xe5c9('0x2c')][_0xe5c9('0x41')](_0x1ba8b6);})[_0xe5c9('0x24')](function(_0x2c6235){_0x48dfb0[_0xe5c9('0x42')]=_0x2c6235;return _0x48dfb0;})['then'](respondWithFilteredResult(_0x23ec44,_0x1ba8b6))[_0xe5c9('0x43')](handleError(_0x23ec44,null));};exports[_0xe5c9('0x44')]=function(_0x389b4a,_0x3f4627){var _0x15de2b={'raw':!![],'where':{'id':_0x389b4a['params']['id']}},_0x4dabb9={};_0x4dabb9[_0xe5c9('0x31')]=_[_0xe5c9('0x33')](db[_0xe5c9('0x2c')][_0xe5c9('0x2d')]);_0x4dabb9['query']=_[_0xe5c9('0x33')](_0x389b4a[_0xe5c9('0x34')]);_0x4dabb9['filters']=_[_0xe5c9('0x36')](_0x4dabb9[_0xe5c9('0x31')],_0x4dabb9[_0xe5c9('0x34')]);_0x15de2b[_0xe5c9('0x38')]=_[_0xe5c9('0x36')](_0x4dabb9[_0xe5c9('0x31')],qs[_0xe5c9('0x37')](_0x389b4a[_0xe5c9('0x34')][_0xe5c9('0x37')]));_0x15de2b[_0xe5c9('0x38')]=_0x15de2b['attributes'][_0xe5c9('0x45')]?_0x15de2b[_0xe5c9('0x38')]:_0x4dabb9[_0xe5c9('0x31')];if(_0x389b4a['query'][_0xe5c9('0x46')]){_0x15de2b[_0xe5c9('0x40')]=[{'all':!![]}];}_0x15de2b=_[_0xe5c9('0x3d')]({},_0x15de2b,_0x389b4a[_0xe5c9('0x3f')]);return db[_0xe5c9('0x2c')][_0xe5c9('0x47')](_0x15de2b)['then'](handleEntityNotFound(_0x3f4627,null))[_0xe5c9('0x24')](respondWithResult(_0x3f4627,null))['catch'](handleError(_0x3f4627,null));};exports[_0xe5c9('0x48')]=function(_0x3bff1d,_0x1f1b9a){return db[_0xe5c9('0x2c')][_0xe5c9('0x48')](_0x3bff1d[_0xe5c9('0x49')],{})['then'](respondWithResult(_0x1f1b9a,0xc9))[_0xe5c9('0x43')](handleError(_0x1f1b9a,null));};exports[_0xe5c9('0x23')]=function(_0x894dd6,_0x5a73a0){if(_0x894dd6['body']['id']){delete _0x894dd6[_0xe5c9('0x49')]['id'];}return db['MailTransferReport'][_0xe5c9('0x47')]({'where':{'id':_0x894dd6[_0xe5c9('0x4a')]['id']}})[_0xe5c9('0x24')](handleEntityNotFound(_0x5a73a0,null))[_0xe5c9('0x24')](saveUpdates(_0x894dd6['body'],null))[_0xe5c9('0x24')](respondWithResult(_0x5a73a0,null))[_0xe5c9('0x43')](handleError(_0x5a73a0,null));};exports['destroy']=function(_0x253810,_0x34e2f3){return db[_0xe5c9('0x2c')][_0xe5c9('0x47')]({'where':{'id':_0x253810['params']['id']}})[_0xe5c9('0x24')](handleEntityNotFound(_0x34e2f3,null))[_0xe5c9('0x24')](removeEntity(_0x34e2f3,null))[_0xe5c9('0x43')](handleError(_0x34e2f3,null));};exports['describe']=function(_0x1e0d58,_0xdc2275){return db['MailTransferReport'][_0xe5c9('0x4b')]()['then'](respondWithResult(_0xdc2275,null))[_0xe5c9('0x43')](handleError(_0xdc2275,null));}; \ No newline at end of file +var _0x4ba4=['filters','intersection','model','query','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','params','find','body','catch','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','then','destroy','end','error','stack','send','index','MailTransferReport','type','map','keys'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x4ba4,0xa3));var _0x44ba=function(_0x1ac910,_0x1ea57f){_0x1ac910=_0x1ac910-0x0;var _0x2361ad=_0x4ba4[_0x1ac910];return _0x2361ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x44ba('0x0'));var zipdir=require(_0x44ba('0x1'));var jsonpatch=require(_0x44ba('0x2'));var rp=require(_0x44ba('0x3'));var moment=require(_0x44ba('0x4'));var BPromise=require(_0x44ba('0x5'));var Mustache=require(_0x44ba('0x6'));var util=require('util');var path=require(_0x44ba('0x7'));var sox=require('sox');var csv=require(_0x44ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44ba('0x9'));var _=require(_0x44ba('0xa'));var squel=require(_0x44ba('0xb'));var crypto=require(_0x44ba('0xc'));var jsforce=require(_0x44ba('0xd'));var deskjs=require(_0x44ba('0xe'));var toCsv=require(_0x44ba('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44ba('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x44ba('0x10'));var as=require(_0x44ba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44ba('0x12'))(_0x44ba('0x13'));var utils=require('../../config/utils');var config=require(_0x44ba('0x14'));var licenseUtil=require(_0x44ba('0x15'));var db=require(_0x44ba('0x16'))['db'];function respondWithStatusCode(_0x3c44e1,_0x530bcc){_0x530bcc=_0x530bcc||0xcc;return function(_0x3906c3){if(_0x3906c3){return _0x3c44e1[_0x44ba('0x17')](_0x530bcc);}return _0x3c44e1[_0x44ba('0x18')](_0x530bcc)['end']();};}function respondWithResult(_0x3faa3f,_0x554bf6){_0x554bf6=_0x554bf6||0xc8;return function(_0x134c53){if(_0x134c53){return _0x3faa3f[_0x44ba('0x18')](_0x554bf6)[_0x44ba('0x19')](_0x134c53);}};}function respondWithFilteredResult(_0x5d0c4f,_0x3d2bb8){return function(_0x549cb9){if(_0x549cb9){var _0x1f4904=typeof _0x3d2bb8[_0x44ba('0x1a')]===_0x44ba('0x1b')&&typeof _0x3d2bb8['limit']===_0x44ba('0x1b');var _0x5d419d=_0x549cb9[_0x44ba('0x1c')];var _0x4c5161=_0x1f4904?0x0:_0x3d2bb8['offset'];var _0x3199ae=_0x1f4904?_0x549cb9[_0x44ba('0x1c')]:_0x3d2bb8[_0x44ba('0x1a')]+_0x3d2bb8[_0x44ba('0x1d')];var _0x110dc5;if(_0x3199ae>=_0x5d419d){_0x3199ae=_0x5d419d;_0x110dc5=0xc8;}else{_0x110dc5=0xce;}_0x5d0c4f[_0x44ba('0x18')](_0x110dc5);return _0x5d0c4f[_0x44ba('0x1e')]('Content-Range',_0x4c5161+'-'+_0x3199ae+'/'+_0x5d419d)[_0x44ba('0x19')](_0x549cb9);}return null;};}function patchUpdates(_0x769885){return function(_0xad10ca){try{jsonpatch[_0x44ba('0x1f')](_0xad10ca,_0x769885,!![]);}catch(_0x4e7d6e){return BPromise['reject'](_0x4e7d6e);}return _0xad10ca[_0x44ba('0x20')]();};}function saveUpdates(_0x132529,_0x202126){return function(_0x412e5f){if(_0x412e5f){return _0x412e5f['update'](_0x132529)[_0x44ba('0x21')](function(_0x22c1dd){return _0x22c1dd;});}return null;};}function removeEntity(_0x5d719b,_0x2512c4){return function(_0x355f46){if(_0x355f46){return _0x355f46[_0x44ba('0x22')]()['then'](function(){_0x5d719b[_0x44ba('0x18')](0xcc)[_0x44ba('0x23')]();});}};}function handleEntityNotFound(_0x3a15d5,_0x4194c5){return function(_0x4d4bfa){if(!_0x4d4bfa){_0x3a15d5[_0x44ba('0x17')](0x194);}return _0x4d4bfa;};}function handleError(_0x128204,_0x150bb4){_0x150bb4=_0x150bb4||0x1f4;return function(_0x4d1117){logger[_0x44ba('0x24')](_0x4d1117[_0x44ba('0x25')]);if(_0x4d1117['name']){delete _0x4d1117['name'];}_0x128204[_0x44ba('0x18')](_0x150bb4)[_0x44ba('0x26')](_0x4d1117);};}exports[_0x44ba('0x27')]=function(_0x4b3fd7,_0x3ba320){var _0x36a7df={},_0xe4606={},_0x5ee972={'count':0x0,'rows':[]};var _0x2c76ee=_['map'](db[_0x44ba('0x28')]['rawAttributes'],function(_0x27d036){return{'name':_0x27d036['fieldName'],'type':_0x27d036[_0x44ba('0x29')]['key']};});_0xe4606['model']=_[_0x44ba('0x2a')](_0x2c76ee,'name');_0xe4606['query']=_[_0x44ba('0x2b')](_0x4b3fd7['query']);_0xe4606[_0x44ba('0x2c')]=_[_0x44ba('0x2d')](_0xe4606[_0x44ba('0x2e')],_0xe4606[_0x44ba('0x2f')]);_0x36a7df[_0x44ba('0x30')]=_['intersection'](_0xe4606[_0x44ba('0x2e')],qs[_0x44ba('0x31')](_0x4b3fd7[_0x44ba('0x2f')][_0x44ba('0x31')]));_0x36a7df[_0x44ba('0x30')]=_0x36a7df[_0x44ba('0x30')][_0x44ba('0x32')]?_0x36a7df[_0x44ba('0x30')]:_0xe4606[_0x44ba('0x2e')];if(!_0x4b3fd7[_0x44ba('0x2f')]['hasOwnProperty'](_0x44ba('0x33'))){_0x36a7df['limit']=qs['limit'](_0x4b3fd7['query'][_0x44ba('0x1d')]);_0x36a7df[_0x44ba('0x1a')]=qs[_0x44ba('0x1a')](_0x4b3fd7[_0x44ba('0x2f')][_0x44ba('0x1a')]);}_0x36a7df[_0x44ba('0x34')]=qs['sort'](_0x4b3fd7[_0x44ba('0x2f')]['sort']);_0x36a7df[_0x44ba('0x35')]=qs[_0x44ba('0x2c')](_[_0x44ba('0x36')](_0x4b3fd7['query'],_0xe4606[_0x44ba('0x2c')]),_0x2c76ee);if(_0x4b3fd7[_0x44ba('0x2f')][_0x44ba('0x37')]){_0x36a7df['where']=_[_0x44ba('0x38')](_0x36a7df['where'],{'$or':_[_0x44ba('0x2a')](_0x2c76ee,function(_0x39ef42){if(_0x39ef42[_0x44ba('0x29')]!==_0x44ba('0x39')){var _0x47700f={};_0x47700f[_0x39ef42[_0x44ba('0x3a')]]={'$like':'%'+_0x4b3fd7[_0x44ba('0x2f')][_0x44ba('0x37')]+'%'};return _0x47700f;}})});}_0x36a7df=_['merge']({},_0x36a7df,_0x4b3fd7['options']);var _0x54ac27={'where':_0x36a7df[_0x44ba('0x35')]};return db[_0x44ba('0x28')]['count'](_0x54ac27)[_0x44ba('0x21')](function(_0xf07486){_0x5ee972['count']=_0xf07486;if(_0x4b3fd7[_0x44ba('0x2f')][_0x44ba('0x3b')]){_0x36a7df[_0x44ba('0x3c')]=[{'all':!![]}];}return db[_0x44ba('0x28')][_0x44ba('0x3d')](_0x36a7df);})[_0x44ba('0x21')](function(_0x2d4fad){_0x5ee972[_0x44ba('0x3e')]=_0x2d4fad;return _0x5ee972;})[_0x44ba('0x21')](respondWithFilteredResult(_0x3ba320,_0x36a7df))['catch'](handleError(_0x3ba320,null));};exports['show']=function(_0x4ed53d,_0x5061c9){var _0x285c07={'raw':!![],'where':{'id':_0x4ed53d[_0x44ba('0x3f')]['id']}},_0x1af5f0={};_0x1af5f0[_0x44ba('0x2e')]=_[_0x44ba('0x2b')](db[_0x44ba('0x28')]['rawAttributes']);_0x1af5f0[_0x44ba('0x2f')]=_['keys'](_0x4ed53d[_0x44ba('0x2f')]);_0x1af5f0[_0x44ba('0x2c')]=_[_0x44ba('0x2d')](_0x1af5f0[_0x44ba('0x2e')],_0x1af5f0[_0x44ba('0x2f')]);_0x285c07[_0x44ba('0x30')]=_[_0x44ba('0x2d')](_0x1af5f0[_0x44ba('0x2e')],qs['fields'](_0x4ed53d[_0x44ba('0x2f')][_0x44ba('0x31')]));_0x285c07[_0x44ba('0x30')]=_0x285c07[_0x44ba('0x30')][_0x44ba('0x32')]?_0x285c07[_0x44ba('0x30')]:_0x1af5f0[_0x44ba('0x2e')];if(_0x4ed53d[_0x44ba('0x2f')][_0x44ba('0x3b')]){_0x285c07[_0x44ba('0x3c')]=[{'all':!![]}];}_0x285c07=_['merge']({},_0x285c07,_0x4ed53d['options']);return db[_0x44ba('0x28')][_0x44ba('0x40')](_0x285c07)['then'](handleEntityNotFound(_0x5061c9,null))[_0x44ba('0x21')](respondWithResult(_0x5061c9,null))['catch'](handleError(_0x5061c9,null));};exports['create']=function(_0x1d3e56,_0x469171){return db[_0x44ba('0x28')]['create'](_0x1d3e56[_0x44ba('0x41')],{})[_0x44ba('0x21')](respondWithResult(_0x469171,0xc9))[_0x44ba('0x42')](handleError(_0x469171,null));};exports[_0x44ba('0x43')]=function(_0x376386,_0x486234){if(_0x376386[_0x44ba('0x41')]['id']){delete _0x376386['body']['id'];}return db[_0x44ba('0x28')]['find']({'where':{'id':_0x376386[_0x44ba('0x3f')]['id']}})[_0x44ba('0x21')](handleEntityNotFound(_0x486234,null))[_0x44ba('0x21')](saveUpdates(_0x376386['body'],null))['then'](respondWithResult(_0x486234,null))['catch'](handleError(_0x486234,null));};exports[_0x44ba('0x22')]=function(_0x3b8143,_0x2b76c1){return db[_0x44ba('0x28')]['find']({'where':{'id':_0x3b8143[_0x44ba('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2b76c1,null))[_0x44ba('0x21')](removeEntity(_0x2b76c1,null))['catch'](handleError(_0x2b76c1,null));};exports[_0x44ba('0x44')]=function(_0x412c5e,_0x2ea82b){return db[_0x44ba('0x28')][_0x44ba('0x44')]()[_0x44ba('0x21')](respondWithResult(_0x2ea82b,null))['catch'](handleError(_0x2ea82b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 8d137fe..28cc366 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 _0x3c94=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x22facf,_0x59ede2){var _0x5a18f2=function(_0x1defb5){while(--_0x1defb5){_0x22facf['push'](_0x22facf['shift']());}};_0x5a18f2(++_0x59ede2);}(_0x3c94,0xcd));var _0x43c9=function(_0x5bf35e,_0x4ccc17){_0x5bf35e=_0x5bf35e-0x0;var _0x35b3d7=_0x3c94[_0x5bf35e];return _0x35b3d7;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'paranoid':![],'indexes':[{'name':_0x43c9('0xf'),'fields':[_0x43c9('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63be=['../../config/environment','exports','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x63be,0xd7));var _0xe63b=function(_0x46750f,_0x1be01e){_0x46750f=_0x46750f-0x0;var _0x1dde5c=_0x63be[_0x46750f];return _0x1dde5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe63b('0x0'))(_0xe63b('0x1'));var moment=require('moment');var BPromise=require(_0xe63b('0x2'));var rp=require(_0xe63b('0x3'));var fs=require('fs');var path=require(_0xe63b('0x4'));var rimraf=require('rimraf');var config=require(_0xe63b('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0xe63b('0x6')]=function(_0x19cf80,_0x3cc298){return _0x19cf80['define'](_0xe63b('0x7'),attributes,{'tableName':_0xe63b('0x8'),'paranoid':![],'indexes':[{'name':_0xe63b('0x9'),'fields':[_0xe63b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index bccc99e..3630ddb 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 _0xd0d1=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd0d1,0x6e));var _0x1d0d=function(_0x230b54,_0x54248c){_0x230b54=_0x230b54-0x0;var _0x180b09=_0xd0d1[_0x230b54];return _0x180b09;};'use strict';var _=require(_0x1d0d('0x0'));var util=require(_0x1d0d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d0d('0x2'));var fs=require('fs');var Redis=require(_0x1d0d('0x3'));var db=require(_0x1d0d('0x4'))['db'];var utils=require(_0x1d0d('0x5'));var logger=require('../../config/logger')(_0x1d0d('0x6'));var config=require(_0x1d0d('0x7'));var jayson=require(_0x1d0d('0x8'));var client=jayson[_0x1d0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x154159,_0x326a0f,_0x145115){return new BPromise(function(_0x426b5e,_0x10fc8b){return client[_0x1d0d('0xa')](_0x154159,_0x145115)[_0x1d0d('0xb')](function(_0x42f0f6){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x326a0f,_0x1d0d('0xc'));logger[_0x1d0d('0xd')](_0x1d0d('0xe'),_0x326a0f,'request\x20sent',JSON[_0x1d0d('0xf')](_0x42f0f6));if(_0x42f0f6['error']){if(_0x42f0f6['error']['code']===0x1f4){logger[_0x1d0d('0x10')](_0x1d0d('0x11'),_0x326a0f,_0x42f0f6[_0x1d0d('0x10')][_0x1d0d('0x12')]);return _0x10fc8b(_0x42f0f6[_0x1d0d('0x10')][_0x1d0d('0x12')]);}logger[_0x1d0d('0x10')](_0x1d0d('0x11'),_0x326a0f,_0x42f0f6['error'][_0x1d0d('0x12')]);return _0x426b5e(_0x42f0f6[_0x1d0d('0x10')]['message']);}else{logger[_0x1d0d('0x13')](_0x1d0d('0x11'),_0x326a0f,'request\x20sent');_0x426b5e(_0x42f0f6[_0x1d0d('0x14')]['message']);}})[_0x1d0d('0x15')](function(_0x5a25b2){logger[_0x1d0d('0x10')](_0x1d0d('0x11'),_0x326a0f,_0x5a25b2);_0x10fc8b(_0x5a25b2);});});} \ No newline at end of file +var _0xf7e5=['rpc','client','http','then','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4e0136,_0x41ad44){var _0x17c771=function(_0x12d73c){while(--_0x12d73c){_0x4e0136['push'](_0x4e0136['shift']());}};_0x17c771(++_0x41ad44);}(_0xf7e5,0x1f2));var _0x5f7e=function(_0xff0642,_0x4b2e82){_0xff0642=_0xff0642-0x0;var _0x1f8de7=_0xf7e5[_0xff0642];return _0x1f8de7;};'use strict';var _=require('lodash');var util=require(_0x5f7e('0x0'));var moment=require('moment');var BPromise=require(_0x5f7e('0x1'));var rs=require(_0x5f7e('0x2'));var fs=require('fs');var Redis=require(_0x5f7e('0x3'));var db=require(_0x5f7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f7e('0x5'))(_0x5f7e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5f7e('0x7')][_0x5f7e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9943ac,_0x326fcd,_0x565a1c){return new BPromise(function(_0x272383,_0x445b21){return client['request'](_0x9943ac,_0x565a1c)[_0x5f7e('0x9')](function(_0x449799){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x326fcd,_0x5f7e('0xa'));logger['debug'](_0x5f7e('0xb'),_0x326fcd,_0x5f7e('0xa'),JSON['stringify'](_0x449799));if(_0x449799[_0x5f7e('0xc')]){if(_0x449799[_0x5f7e('0xc')][_0x5f7e('0xd')]===0x1f4){logger[_0x5f7e('0xc')](_0x5f7e('0xe'),_0x326fcd,_0x449799[_0x5f7e('0xc')][_0x5f7e('0xf')]);return _0x445b21(_0x449799[_0x5f7e('0xc')][_0x5f7e('0xf')]);}logger[_0x5f7e('0xc')](_0x5f7e('0xe'),_0x326fcd,_0x449799[_0x5f7e('0xc')][_0x5f7e('0xf')]);return _0x272383(_0x449799[_0x5f7e('0xc')][_0x5f7e('0xf')]);}else{logger[_0x5f7e('0x10')](_0x5f7e('0xe'),_0x326fcd,_0x5f7e('0xa'));_0x272383(_0x449799[_0x5f7e('0x11')]['message']);}})['catch'](function(_0x5ecd1c){logger[_0x5f7e('0xc')](_0x5f7e('0xe'),_0x326fcd,_0x5ecd1c);_0x445b21(_0x5ecd1c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f3d04e6..56d2e81 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 _0x14ed=['index','get','/describe','describe','isAuthenticated','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./memberReport.controller'];(function(_0x173c3a,_0x229ad0){var _0xfb15d9=function(_0x1599de){while(--_0x1599de){_0x173c3a['push'](_0x173c3a['shift']());}};_0xfb15d9(++_0x229ad0);}(_0x14ed,0x13d));var _0xd14e=function(_0x568f32,_0x29f9e8){_0x568f32=_0x568f32-0x0;var _0xe0cb6c=_0x14ed[_0x568f32];return _0xe0cb6c;};'use strict';var multer=require(_0xd14e('0x0'));var util=require('util');var path=require(_0xd14e('0x1'));var timeout=require(_0xd14e('0x2'));var express=require(_0xd14e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd14e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd14e('0x5'));var controller=require(_0xd14e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd14e('0x7')]);router[_0xd14e('0x8')](_0xd14e('0x9'),auth['isAuthenticated'](),controller[_0xd14e('0xa')]);router[_0xd14e('0x8')]('/:id',auth[_0xd14e('0xb')](),controller[_0xd14e('0xc')]);router[_0xd14e('0xd')]('/',auth[_0xd14e('0xb')](),controller[_0xd14e('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd14e('0xf')]);router['delete']('/:id',auth[_0xd14e('0xb')](),controller[_0xd14e('0x10')]);module[_0xd14e('0x11')]=router; \ No newline at end of file +var _0x39c7=['/:id','isAuthenticated','show','post','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get'];(function(_0x50d368,_0x28015e){var _0x48bd40=function(_0x4c5822){while(--_0x4c5822){_0x50d368['push'](_0x50d368['shift']());}};_0x48bd40(++_0x28015e);}(_0x39c7,0x106));var _0x739c=function(_0x1bfe5d,_0x1c299c){_0x1bfe5d=_0x1bfe5d-0x0;var _0x1cc14b=_0x39c7[_0x1bfe5d];return _0x1cc14b;};'use strict';var multer=require('multer');var util=require(_0x739c('0x0'));var path=require(_0x739c('0x1'));var timeout=require(_0x739c('0x2'));var express=require(_0x739c('0x3'));var router=express[_0x739c('0x4')]();var fs_extra=require(_0x739c('0x5'));var auth=require(_0x739c('0x6'));var interaction=require(_0x739c('0x7'));var config=require('../../config/environment');var controller=require(_0x739c('0x8'));router[_0x739c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x739c('0xa'),auth[_0x739c('0xb')](),controller[_0x739c('0xc')]);router[_0x739c('0xd')]('/',auth[_0x739c('0xb')](),controller['create']);router[_0x739c('0xe')](_0x739c('0xa'),auth[_0x739c('0xb')](),controller[_0x739c('0xf')]);router[_0x739c('0x10')](_0x739c('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 0ad3f69..0c47074 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 _0x2917=['moment','exports','STRING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize'];(function(_0x4eede2,_0x3d3680){var _0x2ae235=function(_0x3e4c64){while(--_0x3e4c64){_0x4eede2['push'](_0x4eede2['shift']());}};_0x2ae235(++_0x3d3680);}(_0x2917,0x142));var _0x7291=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x2917[_0x25e109];return _0xc0f7d6;};'use strict';var Sequelize=require(_0x7291('0x0'));var moment=require(_0x7291('0x1'));module[_0x7291('0x2')]={'channel':{'type':Sequelize[_0x7291('0x3')]},'membername':{'type':Sequelize[_0x7291('0x3')]},'interface':{'type':Sequelize[_0x7291('0x3')]},'type':{'type':Sequelize[_0x7291('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x7291('0x4')]},'enterAt':{'type':Sequelize[_0x7291('0x5')]},'exitAt':{'type':Sequelize[_0x7291('0x5')],'set':function(_0x6aac19){var _0x1ee790=moment(_0x6aac19);var _0x237997=moment(this[_0x7291('0x6')](_0x7291('0x7')));var _0x452fc5=_0x1ee790[_0x7291('0x8')](_0x237997,_0x7291('0x9'));this[_0x7291('0xa')](_0x7291('0xb'),_0x6aac19);this[_0x7291('0xa')](_0x7291('0xc'),_0x452fc5||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7291('0xd')},'data2':{'type':Sequelize[_0x7291('0x3')],'comment':_0x7291('0xe')},'data3':{'type':Sequelize[_0x7291('0x3')],'comment':_0x7291('0xf')},'data4':{'type':Sequelize[_0x7291('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x7291('0x10')},'role':{'type':Sequelize[_0x7291('0x3')]},'internal':{'type':Sequelize[_0x7291('0x4')]},'uniqueid':{'type':Sequelize[_0x7291('0x3')]}}; \ No newline at end of file +var _0x2209=['duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue'];(function(_0x53e55c,_0x40898b){var _0x451802=function(_0x83076b){while(--_0x83076b){_0x53e55c['push'](_0x53e55c['shift']());}};_0x451802(++_0x40898b);}(_0x2209,0x95));var _0x9220=function(_0x2ae1f9,_0x114980){_0x2ae1f9=_0x2ae1f9-0x0;var _0x1ec257=_0x2209[_0x2ae1f9];return _0x1ec257;};'use strict';var Sequelize=require(_0x9220('0x0'));var moment=require(_0x9220('0x1'));module[_0x9220('0x2')]={'channel':{'type':Sequelize[_0x9220('0x3')]},'membername':{'type':Sequelize[_0x9220('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9220('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x9220('0x4')},'duration':{'type':Sequelize[_0x9220('0x5')]},'enterAt':{'type':Sequelize[_0x9220('0x6')]},'exitAt':{'type':Sequelize[_0x9220('0x6')],'set':function(_0x45bd2d){var _0x300ed6=moment(_0x45bd2d);var _0x463d59=moment(this[_0x9220('0x7')](_0x9220('0x8')));var _0x58e7f5=_0x300ed6[_0x9220('0x9')](_0x463d59,_0x9220('0xa'));this['setDataValue'](_0x9220('0xb'),_0x45bd2d);this[_0x9220('0xc')](_0x9220('0xd'),_0x58e7f5||null);}},'data1':{'type':Sequelize[_0x9220('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9220('0x3')],'comment':_0x9220('0xe')},'data3':{'type':Sequelize[_0x9220('0x3')],'comment':_0x9220('0xf')},'data4':{'type':Sequelize[_0x9220('0x3')],'comment':_0x9220('0x10')},'data5':{'type':Sequelize[_0x9220('0x3')],'comment':_0x9220('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x9220('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 b58efe3..c74db11 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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x5ce4e3,_0x42cb9a){var _0x42248f=function(_0x22ab0f){while(--_0x22ab0f){_0x5ce4e3['push'](_0x5ce4e3['shift']());}};_0x42248f(++_0x42cb9a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x3978fa,_0x552b50){var _0x4386ff=function(_0x339007){while(--_0x339007){_0x3978fa['push'](_0x3978fa['shift']());}};_0x4386ff(++_0x552b50);}(_0x008c,0x188));var _0xc008=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x008c[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 0e74bca..75a5067 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 _0x1b7a=['request-promise','path','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util','api','moment','bluebird'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x1b7a,0x15a));var _0xa1b7=function(_0x576e6c,_0x26e6ea){_0x576e6c=_0x576e6c-0x0;var _0x23e3f7=_0x1b7a[_0x576e6c];return _0x23e3f7;};'use strict';var _=require('lodash');var util=require(_0xa1b7('0x0'));var logger=require('../../config/logger')(_0xa1b7('0x1'));var moment=require(_0xa1b7('0x2'));var BPromise=require(_0xa1b7('0x3'));var rp=require(_0xa1b7('0x4'));var fs=require('fs');var path=require(_0xa1b7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa1b7('0x6'));module[_0xa1b7('0x7')]=function(_0x1dad67,_0x519c23){return _0x1dad67[_0xa1b7('0x8')](_0xa1b7('0x9'),attributes,{'tableName':_0xa1b7('0xa'),'paranoid':![],'indexes':[{'name':_0xa1b7('0xb'),'fields':[_0xa1b7('0xc'),_0xa1b7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2fa9=['bluebird','request-promise','path','rimraf','../../config/environment','exports','MemberReport','report_member','interface','lodash','util','moment'];(function(_0x5759e8,_0x44f30a){var _0x2ecf05=function(_0x5b484b){while(--_0x5b484b){_0x5759e8['push'](_0x5759e8['shift']());}};_0x2ecf05(++_0x44f30a);}(_0x2fa9,0x1e9));var _0x92fa=function(_0x35a8d4,_0x1dc025){_0x35a8d4=_0x35a8d4-0x0;var _0x2e5fe0=_0x2fa9[_0x35a8d4];return _0x2e5fe0;};'use strict';var _=require(_0x92fa('0x0'));var util=require(_0x92fa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x92fa('0x2'));var BPromise=require(_0x92fa('0x3'));var rp=require(_0x92fa('0x4'));var fs=require('fs');var path=require(_0x92fa('0x5'));var rimraf=require(_0x92fa('0x6'));var config=require(_0x92fa('0x7'));var attributes=require('./memberReport.attributes');module[_0x92fa('0x8')]=function(_0x58e34e,_0x15c898){return _0x58e34e['define'](_0x92fa('0x9'),attributes,{'tableName':_0x92fa('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x92fa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 77946c7..56dc12d 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 _0x2bd8=['../../config/environment','jayson/promise','client','request','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','GetMemberReport','MemberReport','findAll','raw','options','where','attributes','limit','include','map','model','debug','stringify','CreateMemberReport','create','body','then','UpdateMemberReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2b0675,_0x772fef){var _0x516ce6=function(_0xad2c85){while(--_0xad2c85){_0x2b0675['push'](_0x2b0675['shift']());}};_0x516ce6(++_0x772fef);}(_0x2bd8,0x130));var _0x82bd=function(_0x5010d2,_0x488fb9){_0x5010d2=_0x5010d2-0x0;var _0x50f20e=_0x2bd8[_0x5010d2];return _0x50f20e;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('MemberReport,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('MemberReport,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});}exports[_0x82bd('0x14')]=function(_0x31a350){var _0xf180aa=this;return new Promise(function(_0x390107,_0x29b689){return db[_0x82bd('0x15')][_0x82bd('0x16')]({'raw':_0x31a350['options']?_0x31a350['options'][_0x82bd('0x17')]===undefined?!![]:![]:!![],'where':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x19')]||null:null,'attributes':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x1a')]||null:null,'limit':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x1b')]||null:null,'include':_0x31a350[_0x82bd('0x18')]?_0x31a350[_0x82bd('0x18')][_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0x31a350[_0x82bd('0x18')][_0x82bd('0x1c')],function(_0x13a42a){return{'model':db[_0x13a42a[_0x82bd('0x1e')]],'as':_0x13a42a['as'],'attributes':_0x13a42a[_0x82bd('0x1a')],'include':_0x13a42a['include']?_['map'](_0x13a42a[_0x82bd('0x1c')],function(_0x436ecd){return{'model':db[_0x436ecd[_0x82bd('0x1e')]],'as':_0x436ecd['as'],'attributes':_0x436ecd[_0x82bd('0x1a')],'include':_0x436ecd[_0x82bd('0x1c')]?_[_0x82bd('0x1d')](_0x436ecd[_0x82bd('0x1c')],function(_0xbef23b){return{'model':db[_0xbef23b[_0x82bd('0x1e')]],'as':_0xbef23b['as'],'attributes':_0xbef23b[_0x82bd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bd22f){logger['info']('GetMemberReport',_0x31a350);logger[_0x82bd('0x1f')](_0x82bd('0x14'),_0x31a350,JSON[_0x82bd('0x20')](_0x5bd22f));_0x390107(_0x5bd22f);})[_0x82bd('0x13')](function(_0x363ef9){logger['error']('GetMemberReport',_0x363ef9['message'],_0x31a350);_0x29b689(_0xf180aa[_0x82bd('0xe')](0x1f4,_0x363ef9[_0x82bd('0xf')]));});});};exports[_0x82bd('0x21')]=function(_0x580ba8){var _0x166c46=this;return new Promise(function(_0x4f209e,_0x9cc69b){return db[_0x82bd('0x15')][_0x82bd('0x22')](_0x580ba8[_0x82bd('0x23')],{'raw':_0x580ba8[_0x82bd('0x18')]?_0x580ba8[_0x82bd('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x82bd('0x24')](function(_0x406c96){logger[_0x82bd('0x10')]('CreateMemberReport',_0x580ba8);logger[_0x82bd('0x1f')]('CreateMemberReport',_0x580ba8,JSON['stringify'](_0x406c96));_0x4f209e(_0x406c96);})[_0x82bd('0x13')](function(_0x3eb00d){logger[_0x82bd('0xe')](_0x82bd('0x21'),_0x3eb00d[_0x82bd('0xf')],_0x580ba8);_0x9cc69b(_0x166c46[_0x82bd('0xe')](0x1f4,_0x3eb00d[_0x82bd('0xf')]));});});};exports[_0x82bd('0x25')]=function(_0x42dc7f){var _0xefc6e4=this;return new Promise(function(_0x1ebf6f,_0xe666bd){return db[_0x82bd('0x15')][_0x82bd('0x26')](_0x42dc7f[_0x82bd('0x23')],{'raw':_0x42dc7f[_0x82bd('0x18')]?_0x42dc7f[_0x82bd('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42dc7f['options']?_0x42dc7f['options'][_0x82bd('0x19')]||null:null,'attributes':_0x42dc7f[_0x82bd('0x18')]?_0x42dc7f['options'][_0x82bd('0x1a')]||null:null,'limit':_0x42dc7f['options']?_0x42dc7f['options']['limit']||null:null})[_0x82bd('0x24')](function(_0x293116){logger[_0x82bd('0x10')](_0x82bd('0x25'),_0x42dc7f);logger[_0x82bd('0x1f')]('UpdateMemberReport',_0x42dc7f,JSON['stringify'](_0x293116));_0x1ebf6f(_0x293116);})['catch'](function(_0x64bc54){logger['error']('UpdateMemberReport',_0x64bc54[_0x82bd('0xf')],_0x42dc7f);_0xe666bd(_0xefc6e4[_0x82bd('0xe')](0x1f4,_0x64bc54[_0x82bd('0xf')]));});});}; \ No newline at end of file +var _0x1a44=['where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','model','map','catch','CreateMemberReport','body','UpdateMemberReport','update'];(function(_0x1a3147,_0x1cee3e){var _0x341fb3=function(_0x17773e){while(--_0x17773e){_0x1a3147['push'](_0x1a3147['shift']());}};_0x341fb3(++_0x1cee3e);}(_0x1a44,0xc4));var _0x41a4=function(_0x4c59b6,_0x5dca30){_0x4c59b6=_0x4c59b6-0x0;var _0x47f50d=_0x1a44[_0x4c59b6];return _0x47f50d;};'use strict';var _=require(_0x41a4('0x0'));var util=require('util');var moment=require(_0x41a4('0x1'));var BPromise=require(_0x41a4('0x2'));var rs=require(_0x41a4('0x3'));var fs=require('fs');var Redis=require(_0x41a4('0x4'));var db=require(_0x41a4('0x5'))['db'];var utils=require(_0x41a4('0x6'));var logger=require(_0x41a4('0x7'))('rpc');var config=require(_0x41a4('0x8'));var jayson=require(_0x41a4('0x9'));var client=jayson[_0x41a4('0xa')][_0x41a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x599ccc,_0x5f57e7,_0x2e523b){return new BPromise(function(_0x141ae3,_0x3edb3d){return client[_0x41a4('0xc')](_0x599ccc,_0x2e523b)[_0x41a4('0xd')](function(_0x5a6e4b){logger['info'](_0x41a4('0xe'),_0x5f57e7,_0x41a4('0xf'));logger[_0x41a4('0x10')](_0x41a4('0x11'),_0x5f57e7,_0x41a4('0xf'),JSON[_0x41a4('0x12')](_0x5a6e4b));if(_0x5a6e4b['error']){if(_0x5a6e4b[_0x41a4('0x13')][_0x41a4('0x14')]===0x1f4){logger[_0x41a4('0x13')](_0x41a4('0xe'),_0x5f57e7,_0x5a6e4b['error'][_0x41a4('0x15')]);return _0x3edb3d(_0x5a6e4b[_0x41a4('0x13')]['message']);}logger[_0x41a4('0x13')](_0x41a4('0xe'),_0x5f57e7,_0x5a6e4b['error']['message']);return _0x141ae3(_0x5a6e4b[_0x41a4('0x13')][_0x41a4('0x15')]);}else{logger[_0x41a4('0x16')](_0x41a4('0xe'),_0x5f57e7,_0x41a4('0xf'));_0x141ae3(_0x5a6e4b['result'][_0x41a4('0x15')]);}})['catch'](function(_0x83140c){logger[_0x41a4('0x13')](_0x41a4('0xe'),_0x5f57e7,_0x83140c);_0x3edb3d(_0x83140c);});});}exports[_0x41a4('0x17')]=function(_0x239912){var _0x1b5788=this;return new Promise(function(_0x43c0f9,_0x372868){return db[_0x41a4('0x18')][_0x41a4('0x19')]({'raw':_0x239912[_0x41a4('0x1a')]?_0x239912['options'][_0x41a4('0x1b')]===undefined?!![]:![]:!![],'where':_0x239912[_0x41a4('0x1a')]?_0x239912[_0x41a4('0x1a')]['where']||null:null,'attributes':_0x239912[_0x41a4('0x1a')]?_0x239912[_0x41a4('0x1a')][_0x41a4('0x1c')]||null:null,'limit':_0x239912[_0x41a4('0x1a')]?_0x239912['options'][_0x41a4('0x1d')]||null:null,'include':_0x239912[_0x41a4('0x1a')]?_0x239912['options'][_0x41a4('0x1e')]?_['map'](_0x239912[_0x41a4('0x1a')][_0x41a4('0x1e')],function(_0x42a31f){return{'model':db[_0x42a31f[_0x41a4('0x1f')]],'as':_0x42a31f['as'],'attributes':_0x42a31f[_0x41a4('0x1c')],'include':_0x42a31f[_0x41a4('0x1e')]?_[_0x41a4('0x20')](_0x42a31f[_0x41a4('0x1e')],function(_0x263639){return{'model':db[_0x263639[_0x41a4('0x1f')]],'as':_0x263639['as'],'attributes':_0x263639[_0x41a4('0x1c')],'include':_0x263639[_0x41a4('0x1e')]?_['map'](_0x263639[_0x41a4('0x1e')],function(_0xac9279){return{'model':db[_0xac9279[_0x41a4('0x1f')]],'as':_0xac9279['as'],'attributes':_0xac9279['attributes']};}):[]};}):[]};}):[]:[]})[_0x41a4('0xd')](function(_0x99bcec){logger[_0x41a4('0x16')](_0x41a4('0x17'),_0x239912);logger['debug'](_0x41a4('0x17'),_0x239912,JSON['stringify'](_0x99bcec));_0x43c0f9(_0x99bcec);})[_0x41a4('0x21')](function(_0x309fec){logger[_0x41a4('0x13')]('GetMemberReport',_0x309fec[_0x41a4('0x15')],_0x239912);_0x372868(_0x1b5788[_0x41a4('0x13')](0x1f4,_0x309fec[_0x41a4('0x15')]));});});};exports[_0x41a4('0x22')]=function(_0x2cfe57){var _0x3ad2fa=this;return new Promise(function(_0x1d21d6,_0x2b9f5b){return db[_0x41a4('0x18')]['create'](_0x2cfe57[_0x41a4('0x23')],{'raw':_0x2cfe57[_0x41a4('0x1a')]?_0x2cfe57['options']['raw']===undefined?!![]:![]:!![]})[_0x41a4('0xd')](function(_0x959f80){logger['info'](_0x41a4('0x22'),_0x2cfe57);logger[_0x41a4('0x10')](_0x41a4('0x22'),_0x2cfe57,JSON[_0x41a4('0x12')](_0x959f80));_0x1d21d6(_0x959f80);})[_0x41a4('0x21')](function(_0x3ef496){logger[_0x41a4('0x13')](_0x41a4('0x22'),_0x3ef496[_0x41a4('0x15')],_0x2cfe57);_0x2b9f5b(_0x3ad2fa[_0x41a4('0x13')](0x1f4,_0x3ef496['message']));});});};exports[_0x41a4('0x24')]=function(_0x2aa62d){var _0x35bfaf=this;return new Promise(function(_0xfc228c,_0x153f70){return db[_0x41a4('0x18')][_0x41a4('0x25')](_0x2aa62d[_0x41a4('0x23')],{'raw':_0x2aa62d[_0x41a4('0x1a')]?_0x2aa62d['options'][_0x41a4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2aa62d['options']?_0x2aa62d[_0x41a4('0x1a')][_0x41a4('0x26')]||null:null,'attributes':_0x2aa62d[_0x41a4('0x1a')]?_0x2aa62d[_0x41a4('0x1a')][_0x41a4('0x1c')]||null:null,'limit':_0x2aa62d[_0x41a4('0x1a')]?_0x2aa62d[_0x41a4('0x1a')]['limit']||null:null})['then'](function(_0x543d2b){logger['info'](_0x41a4('0x24'),_0x2aa62d);logger[_0x41a4('0x10')](_0x41a4('0x24'),_0x2aa62d,JSON[_0x41a4('0x12')](_0x543d2b));_0xfc228c(_0x543d2b);})['catch'](function(_0x1a33df){logger[_0x41a4('0x13')](_0x41a4('0x24'),_0x1a33df[_0x41a4('0x15')],_0x2aa62d);_0x153f70(_0x35bfaf[_0x41a4('0x13')](0x1f4,_0x1a33df[_0x41a4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index feb6c87..ccb009d 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 _0x12be=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x5ded66,_0x3627ae){var _0x493ea0=function(_0x12342d){while(--_0x12342d){_0x5ded66['push'](_0x5ded66['shift']());}};_0x493ea0(++_0x3627ae);}(_0x12be,0x169));var _0xe12b=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x12be[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xe12b('0x0'));var util=require(_0xe12b('0x1'));var path=require('path');var timeout=require(_0xe12b('0x2'));var express=require('express');var router=express[_0xe12b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe12b('0x4'));var interaction=require(_0xe12b('0x5'));var config=require(_0xe12b('0x6'));var controller=require(_0xe12b('0x7'));router['get']('/',controller['index']);module[_0xe12b('0x8')]=router; \ No newline at end of file +var _0xff39=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','util','path','connect-timeout','express'];(function(_0x5401ae,_0x5e58ac){var _0x286068=function(_0x2cac88){while(--_0x2cac88){_0x5401ae['push'](_0x5401ae['shift']());}};_0x286068(++_0x5e58ac);}(_0xff39,0xba));var _0x9ff3=function(_0x30b710,_0x4477d1){_0x30b710=_0x30b710-0x0;var _0x205edf=_0xff39[_0x30b710];return _0x205edf;};'use strict';var multer=require('multer');var util=require(_0x9ff3('0x0'));var path=require(_0x9ff3('0x1'));var timeout=require(_0x9ff3('0x2'));var express=require(_0x9ff3('0x3'));var router=express[_0x9ff3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ff3('0x5'));var interaction=require(_0x9ff3('0x6'));var config=require(_0x9ff3('0x7'));var controller=require(_0x9ff3('0x8'));router[_0x9ff3('0x9')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index e331bfe..ecd4b5f 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 _0xff07=['sequelize','STRING','version'];(function(_0x2fb68e,_0x179697){var _0x4b33ef=function(_0x421103){while(--_0x421103){_0x2fb68e['push'](_0x2fb68e['shift']());}};_0x4b33ef(++_0x179697);}(_0xff07,0xe7));var _0x7ff0=function(_0x16b13d,_0x2faf09){_0x16b13d=_0x16b13d-0x0;var _0x1f1e77=_0xff07[_0x16b13d];return _0x1f1e77;};'use strict';var Sequelize=require(_0x7ff0('0x0'));module['exports']={'version':{'type':Sequelize[_0x7ff0('0x1')],'unique':_0x7ff0('0x2')}}; \ No newline at end of file +var _0xf128=['sequelize','exports','version'];(function(_0x5cfedb,_0x48d81c){var _0x142160=function(_0xd332d5){while(--_0xd332d5){_0x5cfedb['push'](_0x5cfedb['shift']());}};_0x142160(++_0x48d81c);}(_0xf128,0x186));var _0x8f12=function(_0x5654ef,_0x1ddf03){_0x5654ef=_0x5654ef-0x0;var _0x40fee1=_0xf128[_0x5654ef];return _0x40fee1;};'use strict';var Sequelize=require(_0x8f12('0x0'));module[_0x8f12('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x8f12('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index cae1557..6f95f55 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 _0x5870=['Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','merge','where','type','VIRTUAL','filter','options','then','includeAll','include','Migration','findAll','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x5870,0xf7));var _0x0587=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x5870[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0x0587('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0587('0x1'));var jsonpatch=require(_0x0587('0x2'));var rp=require(_0x0587('0x3'));var moment=require(_0x0587('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0587('0x5'));var path=require(_0x0587('0x6'));var sox=require(_0x0587('0x7'));var csv=require(_0x0587('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0587('0x9'));var _=require(_0x0587('0xa'));var squel=require(_0x0587('0xb'));var crypto=require(_0x0587('0xc'));var jsforce=require(_0x0587('0xd'));var deskjs=require(_0x0587('0xe'));var toCsv=require(_0x0587('0x8'));var querystring=require(_0x0587('0xf'));var Papa=require('papaparse');var Redis=require(_0x0587('0x10'));var authService=require(_0x0587('0x11'));var qs=require(_0x0587('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0587('0x13'));var logger=require(_0x0587('0x14'))(_0x0587('0x15'));var utils=require(_0x0587('0x16'));var config=require(_0x0587('0x17'));var licenseUtil=require(_0x0587('0x18'));var db=require(_0x0587('0x19'))['db'];function respondWithStatusCode(_0x7bfdf9,_0x274fd1){_0x274fd1=_0x274fd1||0xcc;return function(_0x19f723){if(_0x19f723){return _0x7bfdf9['sendStatus'](_0x274fd1);}return _0x7bfdf9[_0x0587('0x1a')](_0x274fd1)[_0x0587('0x1b')]();};}function respondWithResult(_0x5a4970,_0x448101){_0x448101=_0x448101||0xc8;return function(_0x39c745){if(_0x39c745){return _0x5a4970[_0x0587('0x1a')](_0x448101)[_0x0587('0x1c')](_0x39c745);}};}function respondWithFilteredResult(_0x1ccd5d,_0x19e471){return function(_0x47035e){if(_0x47035e){var _0x9e205a=typeof _0x19e471[_0x0587('0x1d')]===_0x0587('0x1e')&&typeof _0x19e471['limit']==='undefined';var _0x484437=_0x47035e[_0x0587('0x1f')];var _0x2b3c1c=_0x9e205a?0x0:_0x19e471['offset'];var _0x5d2e97=_0x9e205a?_0x47035e[_0x0587('0x1f')]:_0x19e471[_0x0587('0x1d')]+_0x19e471['limit'];var _0x44490e;if(_0x5d2e97>=_0x484437){_0x5d2e97=_0x484437;_0x44490e=0xc8;}else{_0x44490e=0xce;}_0x1ccd5d['status'](_0x44490e);return _0x1ccd5d[_0x0587('0x20')](_0x0587('0x21'),_0x2b3c1c+'-'+_0x5d2e97+'/'+_0x484437)['json'](_0x47035e);}return null;};}function patchUpdates(_0x3f3ddb){return function(_0x41e5e1){try{jsonpatch[_0x0587('0x22')](_0x41e5e1,_0x3f3ddb,!![]);}catch(_0x535ad4){return BPromise[_0x0587('0x23')](_0x535ad4);}return _0x41e5e1['save']();};}function saveUpdates(_0x42027c,_0xb8ff52){return function(_0x3280ee){if(_0x3280ee){return _0x3280ee[_0x0587('0x24')](_0x42027c)['then'](function(_0x47324e){return _0x47324e;});}return null;};}function removeEntity(_0x2d2595,_0x18b2df){return function(_0x4b2044){if(_0x4b2044){return _0x4b2044[_0x0587('0x25')]()['then'](function(){_0x2d2595[_0x0587('0x1a')](0xcc)[_0x0587('0x1b')]();});}};}function handleEntityNotFound(_0x3409a9,_0x77bb0d){return function(_0x4139e6){if(!_0x4139e6){_0x3409a9['sendStatus'](0x194);}return _0x4139e6;};}function handleError(_0x3d0f3c,_0x3a3089){_0x3a3089=_0x3a3089||0x1f4;return function(_0x3c1c75){logger[_0x0587('0x26')](_0x3c1c75[_0x0587('0x27')]);if(_0x3c1c75[_0x0587('0x28')]){delete _0x3c1c75[_0x0587('0x28')];}_0x3d0f3c[_0x0587('0x1a')](_0x3a3089)[_0x0587('0x29')](_0x3c1c75);};}exports[_0x0587('0x2a')]=function(_0x296ba0,_0x176357){var _0x4ba387={},_0x2eba2b={},_0x1312b9={'count':0x0,'rows':[]};var _0x26af4e=_[_0x0587('0x2b')](db['Migration']['rawAttributes'],function(_0x132c50){return{'name':_0x132c50[_0x0587('0x2c')],'type':_0x132c50['type'][_0x0587('0x2d')]};});_0x2eba2b[_0x0587('0x2e')]=_[_0x0587('0x2b')](_0x26af4e,_0x0587('0x28'));_0x2eba2b[_0x0587('0x2f')]=_[_0x0587('0x30')](_0x296ba0[_0x0587('0x2f')]);_0x2eba2b['filters']=_['intersection'](_0x2eba2b[_0x0587('0x2e')],_0x2eba2b[_0x0587('0x2f')]);_0x4ba387['attributes']=_[_0x0587('0x31')](_0x2eba2b[_0x0587('0x2e')],qs['fields'](_0x296ba0[_0x0587('0x2f')]['fields']));_0x4ba387[_0x0587('0x32')]=_0x4ba387[_0x0587('0x32')][_0x0587('0x33')]?_0x4ba387[_0x0587('0x32')]:_0x2eba2b['model'];if(!_0x296ba0[_0x0587('0x2f')][_0x0587('0x34')](_0x0587('0x35'))){_0x4ba387[_0x0587('0x36')]=qs[_0x0587('0x36')](_0x296ba0[_0x0587('0x2f')][_0x0587('0x36')]);_0x4ba387[_0x0587('0x1d')]=qs[_0x0587('0x1d')](_0x296ba0['query'][_0x0587('0x1d')]);}_0x4ba387[_0x0587('0x37')]=qs[_0x0587('0x38')](_0x296ba0[_0x0587('0x2f')][_0x0587('0x38')]);_0x4ba387['where']=qs[_0x0587('0x39')](_['pick'](_0x296ba0['query'],_0x2eba2b[_0x0587('0x39')]),_0x26af4e);if(_0x296ba0[_0x0587('0x2f')]['filter']){_0x4ba387['where']=_[_0x0587('0x3a')](_0x4ba387[_0x0587('0x3b')],{'$or':_[_0x0587('0x2b')](_0x26af4e,function(_0x141613){if(_0x141613[_0x0587('0x3c')]!==_0x0587('0x3d')){var _0x1a41a6={};_0x1a41a6[_0x141613[_0x0587('0x28')]]={'$like':'%'+_0x296ba0[_0x0587('0x2f')][_0x0587('0x3e')]+'%'};return _0x1a41a6;}})});}_0x4ba387=_['merge']({},_0x4ba387,_0x296ba0[_0x0587('0x3f')]);var _0x5a6bc9={'where':_0x4ba387[_0x0587('0x3b')]};return db['Migration']['count'](_0x5a6bc9)[_0x0587('0x40')](function(_0x4b539b){_0x1312b9[_0x0587('0x1f')]=_0x4b539b;if(_0x296ba0[_0x0587('0x2f')][_0x0587('0x41')]){_0x4ba387[_0x0587('0x42')]=[{'all':!![]}];}return db[_0x0587('0x43')][_0x0587('0x44')](_0x4ba387);})[_0x0587('0x40')](function(_0x2a343c){_0x1312b9['rows']=_0x2a343c;return _0x1312b9;})['then'](respondWithFilteredResult(_0x176357,_0x4ba387))[_0x0587('0x45')](handleError(_0x176357,null));}; \ No newline at end of file +var _0x9406=['query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Migration','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model'];(function(_0x54cd8b,_0x398b3e){var _0x28a355=function(_0x453644){while(--_0x453644){_0x54cd8b['push'](_0x54cd8b['shift']());}};_0x28a355(++_0x398b3e);}(_0x9406,0x127));var _0x6940=function(_0x6fbdd9,_0x31ce31){_0x6fbdd9=_0x6fbdd9-0x0;var _0x3c4719=_0x9406[_0x6fbdd9];return _0x3c4719;};'use strict';var emlformat=require(_0x6940('0x0'));var rimraf=require(_0x6940('0x1'));var zipdir=require(_0x6940('0x2'));var jsonpatch=require(_0x6940('0x3'));var rp=require(_0x6940('0x4'));var moment=require('moment');var BPromise=require(_0x6940('0x5'));var Mustache=require(_0x6940('0x6'));var util=require('util');var path=require(_0x6940('0x7'));var sox=require(_0x6940('0x8'));var csv=require(_0x6940('0x9'));var ejs=require(_0x6940('0xa'));var fs=require('fs');var fs_extra=require(_0x6940('0xb'));var _=require(_0x6940('0xc'));var squel=require(_0x6940('0xd'));var crypto=require(_0x6940('0xe'));var jsforce=require(_0x6940('0xf'));var deskjs=require(_0x6940('0x10'));var toCsv=require(_0x6940('0x9'));var querystring=require(_0x6940('0x11'));var Papa=require(_0x6940('0x12'));var Redis=require(_0x6940('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6940('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6940('0x15'));var logger=require(_0x6940('0x16'))(_0x6940('0x17'));var utils=require(_0x6940('0x18'));var config=require(_0x6940('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6940('0x1a'))['db'];function respondWithStatusCode(_0x4fcc4e,_0x4ecc26){_0x4ecc26=_0x4ecc26||0xcc;return function(_0x18f0ee){if(_0x18f0ee){return _0x4fcc4e[_0x6940('0x1b')](_0x4ecc26);}return _0x4fcc4e[_0x6940('0x1c')](_0x4ecc26)['end']();};}function respondWithResult(_0x163235,_0x427552){_0x427552=_0x427552||0xc8;return function(_0x9c8eef){if(_0x9c8eef){return _0x163235[_0x6940('0x1c')](_0x427552)['json'](_0x9c8eef);}};}function respondWithFilteredResult(_0x13cb77,_0xcb291a){return function(_0x13dad4){if(_0x13dad4){var _0x475f69=typeof _0xcb291a[_0x6940('0x1d')]===_0x6940('0x1e')&&typeof _0xcb291a[_0x6940('0x1f')]==='undefined';var _0xc87141=_0x13dad4[_0x6940('0x20')];var _0x14dac8=_0x475f69?0x0:_0xcb291a[_0x6940('0x1d')];var _0x25a7ac=_0x475f69?_0x13dad4[_0x6940('0x20')]:_0xcb291a[_0x6940('0x1d')]+_0xcb291a[_0x6940('0x1f')];var _0x148b8b;if(_0x25a7ac>=_0xc87141){_0x25a7ac=_0xc87141;_0x148b8b=0xc8;}else{_0x148b8b=0xce;}_0x13cb77['status'](_0x148b8b);return _0x13cb77['set'](_0x6940('0x21'),_0x14dac8+'-'+_0x25a7ac+'/'+_0xc87141)[_0x6940('0x22')](_0x13dad4);}return null;};}function patchUpdates(_0x1bedc7){return function(_0x228434){try{jsonpatch[_0x6940('0x23')](_0x228434,_0x1bedc7,!![]);}catch(_0x8b5be){return BPromise[_0x6940('0x24')](_0x8b5be);}return _0x228434['save']();};}function saveUpdates(_0x2aa160,_0x1d1ba7){return function(_0x46bbdc){if(_0x46bbdc){return _0x46bbdc[_0x6940('0x25')](_0x2aa160)['then'](function(_0x300c71){return _0x300c71;});}return null;};}function removeEntity(_0x3789ca,_0x7aeae8){return function(_0x10cbe9){if(_0x10cbe9){return _0x10cbe9[_0x6940('0x26')]()[_0x6940('0x27')](function(){_0x3789ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x243c83,_0x1e13a8){return function(_0x5794e4){if(!_0x5794e4){_0x243c83[_0x6940('0x1b')](0x194);}return _0x5794e4;};}function handleError(_0x8c838a,_0x4e8fc7){_0x4e8fc7=_0x4e8fc7||0x1f4;return function(_0x173408){logger[_0x6940('0x28')](_0x173408[_0x6940('0x29')]);if(_0x173408[_0x6940('0x2a')]){delete _0x173408['name'];}_0x8c838a['status'](_0x4e8fc7)[_0x6940('0x2b')](_0x173408);};}exports[_0x6940('0x2c')]=function(_0x6b0fae,_0x38588b){var _0x12d602={},_0x4dc4a3={},_0x2fbc48={'count':0x0,'rows':[]};var _0x4f3192=_[_0x6940('0x2d')](db['Migration'][_0x6940('0x2e')],function(_0x19fa57){return{'name':_0x19fa57['fieldName'],'type':_0x19fa57[_0x6940('0x2f')][_0x6940('0x30')]};});_0x4dc4a3[_0x6940('0x31')]=_[_0x6940('0x2d')](_0x4f3192,_0x6940('0x2a'));_0x4dc4a3[_0x6940('0x32')]=_['keys'](_0x6b0fae['query']);_0x4dc4a3[_0x6940('0x33')]=_['intersection'](_0x4dc4a3[_0x6940('0x31')],_0x4dc4a3['query']);_0x12d602[_0x6940('0x34')]=_[_0x6940('0x35')](_0x4dc4a3['model'],qs['fields'](_0x6b0fae[_0x6940('0x32')][_0x6940('0x36')]));_0x12d602['attributes']=_0x12d602[_0x6940('0x34')]['length']?_0x12d602[_0x6940('0x34')]:_0x4dc4a3['model'];if(!_0x6b0fae[_0x6940('0x32')][_0x6940('0x37')](_0x6940('0x38'))){_0x12d602[_0x6940('0x1f')]=qs['limit'](_0x6b0fae[_0x6940('0x32')][_0x6940('0x1f')]);_0x12d602[_0x6940('0x1d')]=qs[_0x6940('0x1d')](_0x6b0fae['query']['offset']);}_0x12d602[_0x6940('0x39')]=qs[_0x6940('0x3a')](_0x6b0fae[_0x6940('0x32')]['sort']);_0x12d602[_0x6940('0x3b')]=qs[_0x6940('0x33')](_[_0x6940('0x3c')](_0x6b0fae[_0x6940('0x32')],_0x4dc4a3[_0x6940('0x33')]),_0x4f3192);if(_0x6b0fae[_0x6940('0x32')][_0x6940('0x3d')]){_0x12d602[_0x6940('0x3b')]=_[_0x6940('0x3e')](_0x12d602[_0x6940('0x3b')],{'$or':_[_0x6940('0x2d')](_0x4f3192,function(_0x258016){if(_0x258016['type']!==_0x6940('0x3f')){var _0x260277={};_0x260277[_0x258016['name']]={'$like':'%'+_0x6b0fae[_0x6940('0x32')]['filter']+'%'};return _0x260277;}})});}_0x12d602=_['merge']({},_0x12d602,_0x6b0fae[_0x6940('0x40')]);var _0x121b1f={'where':_0x12d602[_0x6940('0x3b')]};return db[_0x6940('0x41')][_0x6940('0x20')](_0x121b1f)['then'](function(_0x1a40e9){_0x2fbc48[_0x6940('0x20')]=_0x1a40e9;if(_0x6b0fae[_0x6940('0x32')]['includeAll']){_0x12d602[_0x6940('0x42')]=[{'all':!![]}];}return db[_0x6940('0x41')]['findAll'](_0x12d602);})[_0x6940('0x27')](function(_0x3bcfeb){_0x2fbc48[_0x6940('0x43')]=_0x3bcfeb;return _0x2fbc48;})['then'](respondWithFilteredResult(_0x38588b,_0x12d602))[_0x6940('0x44')](handleError(_0x38588b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7a3f023..038fbf9 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 _0x6aa3=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Migration','migrations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6aa3,0x16c));var _0x36aa=function(_0x57d0dc,_0x387f3e){_0x57d0dc=_0x57d0dc-0x0;var _0x177765=_0x6aa3[_0x57d0dc];return _0x177765;};'use strict';var _=require(_0x36aa('0x0'));var util=require(_0x36aa('0x1'));var logger=require(_0x36aa('0x2'))(_0x36aa('0x3'));var moment=require('moment');var BPromise=require(_0x36aa('0x4'));var rp=require(_0x36aa('0x5'));var fs=require('fs');var path=require(_0x36aa('0x6'));var rimraf=require(_0x36aa('0x7'));var config=require(_0x36aa('0x8'));var attributes=require('./migration.attributes');module[_0x36aa('0x9')]=function(_0x209cc7,_0x2299bb){return _0x209cc7[_0x36aa('0xa')](_0x36aa('0xb'),attributes,{'tableName':_0x36aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b24=['../../config/environment','./migration.attributes','exports','Migration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x140620,_0x18788e){var _0x2f616a=function(_0x4f8414){while(--_0x4f8414){_0x140620['push'](_0x140620['shift']());}};_0x2f616a(++_0x18788e);}(_0x1b24,0x17d));var _0x41b2=function(_0x588340,_0x55db63){_0x588340=_0x588340-0x0;var _0x35c409=_0x1b24[_0x588340];return _0x35c409;};'use strict';var _=require(_0x41b2('0x0'));var util=require(_0x41b2('0x1'));var logger=require(_0x41b2('0x2'))(_0x41b2('0x3'));var moment=require(_0x41b2('0x4'));var BPromise=require(_0x41b2('0x5'));var rp=require(_0x41b2('0x6'));var fs=require('fs');var path=require(_0x41b2('0x7'));var rimraf=require(_0x41b2('0x8'));var config=require(_0x41b2('0x9'));var attributes=require(_0x41b2('0xa'));module[_0x41b2('0xb')]=function(_0x5ca738,_0x597cbd){return _0x5ca738['define'](_0x41b2('0xc'),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 0e53cc9..2e9a948 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 _0x65d2=['request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s'];(function(_0x581b09,_0x39398c){var _0x460f77=function(_0x344eaa){while(--_0x344eaa){_0x581b09['push'](_0x581b09['shift']());}};_0x460f77(++_0x39398c);}(_0x65d2,0xb8));var _0x265d=function(_0x5a5a92,_0xc9d49c){_0x5a5a92=_0x5a5a92-0x0;var _0x15d7cd=_0x65d2[_0x5a5a92];return _0x15d7cd;};'use strict';var _=require(_0x265d('0x0'));var util=require(_0x265d('0x1'));var moment=require('moment');var BPromise=require(_0x265d('0x2'));var rs=require(_0x265d('0x3'));var fs=require('fs');var Redis=require(_0x265d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x265d('0x5'));var logger=require(_0x265d('0x6'))(_0x265d('0x7'));var config=require('../../config/environment');var jayson=require(_0x265d('0x8'));var client=jayson[_0x265d('0x9')][_0x265d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1020fa,_0x96e943,_0x5ca577){return new BPromise(function(_0x36bf91,_0x18133e){return client[_0x265d('0xb')](_0x1020fa,_0x5ca577)[_0x265d('0xc')](function(_0x422a08){logger['info'](_0x265d('0xd'),_0x96e943,_0x265d('0xe'));logger['debug'](_0x265d('0xf'),_0x96e943,_0x265d('0xe'),JSON[_0x265d('0x10')](_0x422a08));if(_0x422a08[_0x265d('0x11')]){if(_0x422a08[_0x265d('0x11')]['code']===0x1f4){logger[_0x265d('0x11')]('Migration,\x20%s,\x20%s',_0x96e943,_0x422a08['error'][_0x265d('0x12')]);return _0x18133e(_0x422a08[_0x265d('0x11')][_0x265d('0x12')]);}logger[_0x265d('0x11')](_0x265d('0xd'),_0x96e943,_0x422a08['error'][_0x265d('0x12')]);return _0x36bf91(_0x422a08[_0x265d('0x11')][_0x265d('0x12')]);}else{logger[_0x265d('0x13')](_0x265d('0xd'),_0x96e943,_0x265d('0xe'));_0x36bf91(_0x422a08[_0x265d('0x14')][_0x265d('0x12')]);}})[_0x265d('0x15')](function(_0x1cac5a){logger[_0x265d('0x11')](_0x265d('0xd'),_0x96e943,_0x1cac5a);_0x18133e(_0x1cac5a);});});} \ No newline at end of file +var _0x92d7=['request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2e4b94,_0x3a6f69){var _0xe55bf7=function(_0x3c61d2){while(--_0x3c61d2){_0x2e4b94['push'](_0x2e4b94['shift']());}};_0xe55bf7(++_0x3a6f69);}(_0x92d7,0x17b));var _0x792d=function(_0x2c32b1,_0x2b0b33){_0x2c32b1=_0x2c32b1-0x0;var _0x16b2da=_0x92d7[_0x2c32b1];return _0x16b2da;};'use strict';var _=require(_0x792d('0x0'));var util=require('util');var moment=require(_0x792d('0x1'));var BPromise=require(_0x792d('0x2'));var rs=require(_0x792d('0x3'));var fs=require('fs');var Redis=require(_0x792d('0x4'));var db=require(_0x792d('0x5'))['db'];var utils=require(_0x792d('0x6'));var logger=require(_0x792d('0x7'))(_0x792d('0x8'));var config=require(_0x792d('0x9'));var jayson=require(_0x792d('0xa'));var client=jayson['client'][_0x792d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238cab,_0x7cfc16,_0x11240a){return new BPromise(function(_0x56f730,_0x309f0e){return client[_0x792d('0xc')](_0x238cab,_0x11240a)[_0x792d('0xd')](function(_0xe14801){logger[_0x792d('0xe')](_0x792d('0xf'),_0x7cfc16,_0x792d('0x10'));logger['debug'](_0x792d('0x11'),_0x7cfc16,'request\x20sent',JSON[_0x792d('0x12')](_0xe14801));if(_0xe14801[_0x792d('0x13')]){if(_0xe14801['error']['code']===0x1f4){logger[_0x792d('0x13')](_0x792d('0xf'),_0x7cfc16,_0xe14801[_0x792d('0x13')]['message']);return _0x309f0e(_0xe14801[_0x792d('0x13')][_0x792d('0x14')]);}logger[_0x792d('0x13')](_0x792d('0xf'),_0x7cfc16,_0xe14801[_0x792d('0x13')][_0x792d('0x14')]);return _0x56f730(_0xe14801[_0x792d('0x13')][_0x792d('0x14')]);}else{logger[_0x792d('0xe')](_0x792d('0xf'),_0x7cfc16,_0x792d('0x10'));_0x56f730(_0xe14801[_0x792d('0x15')][_0x792d('0x14')]);}})[_0x792d('0x16')](function(_0x45b458){logger['error'](_0x792d('0xf'),_0x7cfc16,_0x45b458);_0x309f0e(_0x45b458);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3c6e2ee..3dfa46f 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 _0x5fa9=['isAuthenticated','show','create','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','./network.controller','index','/:id'];(function(_0x4ae3d4,_0x5f2047){var _0x1d3a52=function(_0x4f2af4){while(--_0x4f2af4){_0x4ae3d4['push'](_0x4ae3d4['shift']());}};_0x1d3a52(++_0x5f2047);}(_0x5fa9,0x150));var _0x95fa=function(_0x85fbb2,_0x55d447){_0x85fbb2=_0x85fbb2-0x0;var _0x2c94e5=_0x5fa9[_0x85fbb2];return _0x2c94e5;};'use strict';var multer=require(_0x95fa('0x0'));var util=require(_0x95fa('0x1'));var path=require(_0x95fa('0x2'));var timeout=require('connect-timeout');var express=require(_0x95fa('0x3'));var router=express[_0x95fa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x95fa('0x5'));var config=require('../../config/environment');var controller=require(_0x95fa('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x95fa('0x7')]);router['get'](_0x95fa('0x8'),auth[_0x95fa('0x9')](),controller[_0x95fa('0xa')]);router['post']('/',auth[_0x95fa('0x9')](),controller[_0x95fa('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x95fa('0xc')]);router[_0x95fa('0xd')](_0x95fa('0x8'),auth[_0x95fa('0x9')](),controller[_0x95fa('0xe')]);module['exports']=router; \ No newline at end of file +var _0x5b47=['multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports'];(function(_0x4132d1,_0x41fbbd){var _0x27d9cb=function(_0x121a69){while(--_0x121a69){_0x4132d1['push'](_0x4132d1['shift']());}};_0x27d9cb(++_0x41fbbd);}(_0x5b47,0x120));var _0x75b4=function(_0xe59855,_0x4e968e){_0xe59855=_0xe59855-0x0;var _0x5c769b=_0x5b47[_0xe59855];return _0x5c769b;};'use strict';var multer=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75b4('0x2'));var interaction=require(_0x75b4('0x3'));var config=require(_0x75b4('0x4'));var controller=require(_0x75b4('0x5'));router[_0x75b4('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x75b4('0x7'),auth['isAuthenticated'](),controller[_0x75b4('0x8')]);router[_0x75b4('0x9')]('/',auth[_0x75b4('0xa')](),controller[_0x75b4('0xb')]);router[_0x75b4('0xc')](_0x75b4('0x7'),auth[_0x75b4('0xa')](),controller[_0x75b4('0xd')]);router[_0x75b4('0xe')]('/:id',auth[_0x75b4('0xa')](),controller['destroy']);module[_0x75b4('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index bb403dd..ffaeb9d 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 _0xb9bc=['turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xb9bc,0x95));var _0xcb9b=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xb9bc[_0x4d35f3];return _0x382fea;};'use strict';var Sequelize=require(_0xcb9b('0x0'));module[_0xcb9b('0x1')]={'type':{'type':Sequelize[_0xcb9b('0x2')](_0xcb9b('0x3'),_0xcb9b('0x4'),'stun',_0xcb9b('0x5'))},'value':{'type':Sequelize[_0xcb9b('0x6')]},'username':{'type':Sequelize[_0xcb9b('0x6')]},'password':{'type':Sequelize[_0xcb9b('0x6')]}}; \ No newline at end of file +var _0xbb01=['ENUM','localnet','stun','turn','STRING','sequelize','exports'];(function(_0x5c2e37,_0x4cd68e){var _0x167184=function(_0x3ad72a){while(--_0x3ad72a){_0x5c2e37['push'](_0x5c2e37['shift']());}};_0x167184(++_0x4cd68e);}(_0xbb01,0x1d3));var _0x1bb0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbb01[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x1bb0('0x0'));module[_0x1bb0('0x1')]={'type':{'type':Sequelize[_0x1bb0('0x2')](_0x1bb0('0x3'),'externip',_0x1bb0('0x4'),_0x1bb0('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1bb0('0x6')]},'password':{'type':Sequelize[_0x1bb0('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f1d6901..57879e5 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 _0xd3fe=['limit','count','set','apply','save','sendStatus','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','server/files/templates/turn_multiple.ejs','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/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','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','end','json','offset','undefined'];(function(_0x888ad3,_0x666efd){var _0x451f7c=function(_0x1b749b){while(--_0x1b749b){_0x888ad3['push'](_0x888ad3['shift']());}};_0x451f7c(++_0x666efd);}(_0xd3fe,0xb2));var _0xed3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed3f('0x0'));var zipdir=require(_0xed3f('0x1'));var jsonpatch=require(_0xed3f('0x2'));var rp=require(_0xed3f('0x3'));var moment=require(_0xed3f('0x4'));var BPromise=require(_0xed3f('0x5'));var Mustache=require(_0xed3f('0x6'));var util=require(_0xed3f('0x7'));var path=require(_0xed3f('0x8'));var sox=require(_0xed3f('0x9'));var csv=require(_0xed3f('0xa'));var ejs=require(_0xed3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed3f('0xc'));var squel=require(_0xed3f('0xd'));var crypto=require(_0xed3f('0xe'));var jsforce=require(_0xed3f('0xf'));var deskjs=require(_0xed3f('0x10'));var toCsv=require(_0xed3f('0xa'));var querystring=require(_0xed3f('0x11'));var Papa=require(_0xed3f('0x12'));var Redis=require(_0xed3f('0x13'));var authService=require(_0xed3f('0x14'));var qs=require(_0xed3f('0x15'));var as=require(_0xed3f('0x16'));var hardwareService=require(_0xed3f('0x17'));var logger=require(_0xed3f('0x18'))(_0xed3f('0x19'));var utils=require(_0xed3f('0x1a'));var config=require(_0xed3f('0x1b'));var licenseUtil=require(_0xed3f('0x1c'));var db=require(_0xed3f('0x1d'))['db'];var jayson=require(_0xed3f('0x1e'));var client=jayson[_0xed3f('0x1f')][_0xed3f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x14c73e,_0x3911ac,_0x16373e,_0x3fbe29){return new BPromise(function(_0x51e048,_0x42f619){var _0x20ce88=_0x3fbe29||client;return _0x20ce88[_0xed3f('0x21')](_0x14c73e,_0x16373e)[_0xed3f('0x22')](function(_0xa2ec97){logger[_0xed3f('0x23')](_0xed3f('0x24'),_0x3911ac,_0xed3f('0x25'));logger[_0xed3f('0x26')]('Network,\x20%s,\x20%s,\x20%s',_0x3911ac,_0xed3f('0x25'),JSON['stringify'](_0xa2ec97));if(_0xa2ec97[_0xed3f('0x27')]){if(_0xa2ec97[_0xed3f('0x27')]['code']===0x1f4){logger[_0xed3f('0x27')](_0xed3f('0x24'),_0x3911ac,_0xa2ec97[_0xed3f('0x27')][_0xed3f('0x28')]);return _0x42f619(_0xa2ec97[_0xed3f('0x27')][_0xed3f('0x28')]);}logger[_0xed3f('0x27')](_0xed3f('0x24'),_0x3911ac,_0xa2ec97['error'][_0xed3f('0x28')]);return _0x51e048(_0xa2ec97[_0xed3f('0x27')][_0xed3f('0x28')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x3911ac,_0xed3f('0x25'));_0x51e048(_0xa2ec97[_0xed3f('0x29')][_0xed3f('0x28')]);}})[_0xed3f('0x2a')](function(_0x26515d){logger[_0xed3f('0x27')](_0xed3f('0x24'),_0x3911ac,_0x26515d);_0x42f619(_0x26515d);});});}function respondWithStatusCode(_0x2d05dc,_0x1b87de){_0x1b87de=_0x1b87de||0xcc;return function(_0x2ff601){if(_0x2ff601){return _0x2d05dc['sendStatus'](_0x1b87de);}return _0x2d05dc[_0xed3f('0x2b')](_0x1b87de)[_0xed3f('0x2c')]();};}function respondWithResult(_0x4d3266,_0x3b1a3e){_0x3b1a3e=_0x3b1a3e||0xc8;return function(_0x45df0f){if(_0x45df0f){return _0x4d3266[_0xed3f('0x2b')](_0x3b1a3e)[_0xed3f('0x2d')](_0x45df0f);}};}function respondWithFilteredResult(_0x405175,_0x25cfe7){return function(_0x3232e8){if(_0x3232e8){var _0x381559=typeof _0x25cfe7[_0xed3f('0x2e')]===_0xed3f('0x2f')&&typeof _0x25cfe7[_0xed3f('0x30')]===_0xed3f('0x2f');var _0x407d67=_0x3232e8[_0xed3f('0x31')];var _0x5ae9e5=_0x381559?0x0:_0x25cfe7[_0xed3f('0x2e')];var _0x47d7a=_0x381559?_0x3232e8[_0xed3f('0x31')]:_0x25cfe7[_0xed3f('0x2e')]+_0x25cfe7[_0xed3f('0x30')];var _0x10b471;if(_0x47d7a>=_0x407d67){_0x47d7a=_0x407d67;_0x10b471=0xc8;}else{_0x10b471=0xce;}_0x405175[_0xed3f('0x2b')](_0x10b471);return _0x405175[_0xed3f('0x32')]('Content-Range',_0x5ae9e5+'-'+_0x47d7a+'/'+_0x407d67)['json'](_0x3232e8);}return null;};}function patchUpdates(_0x461d06){return function(_0x588b9f){try{jsonpatch[_0xed3f('0x33')](_0x588b9f,_0x461d06,!![]);}catch(_0x5b2ba1){return BPromise['reject'](_0x5b2ba1);}return _0x588b9f[_0xed3f('0x34')]();};}function saveUpdates(_0x4a18d0,_0x10c568){return function(_0x3bda01){if(_0x3bda01){return _0x3bda01['update'](_0x4a18d0)['then'](function(_0x884184){return _0x884184;});}return null;};}function removeEntity(_0x1f80bf,_0xe3394d){return function(_0x57d448){if(_0x57d448){return _0x57d448['destroy']()[_0xed3f('0x22')](function(){_0x1f80bf[_0xed3f('0x2b')](0xcc)[_0xed3f('0x2c')]();});}};}function handleEntityNotFound(_0x2fde10,_0x522246){return function(_0x42b80f){if(!_0x42b80f){_0x2fde10[_0xed3f('0x35')](0x194);}return _0x42b80f;};}function handleError(_0x42e004,_0x733674){_0x733674=_0x733674||0x1f4;return function(_0x5988d7){logger['error'](_0x5988d7['stack']);if(_0x5988d7[_0xed3f('0x36')]){delete _0x5988d7[_0xed3f('0x36')];}_0x42e004[_0xed3f('0x2b')](_0x733674)[_0xed3f('0x37')](_0x5988d7);};}exports[_0xed3f('0x38')]=function(_0x7e0212,_0xf5842b){var _0x7cdcb7={},_0x246864={},_0x1e8136={'count':0x0,'rows':[]};var _0x53ec08=_[_0xed3f('0x39')](db[_0xed3f('0x3a')][_0xed3f('0x3b')],function(_0x37b910){return{'name':_0x37b910[_0xed3f('0x3c')],'type':_0x37b910[_0xed3f('0x3d')][_0xed3f('0x3e')]};});_0x246864[_0xed3f('0x3f')]=_[_0xed3f('0x39')](_0x53ec08,_0xed3f('0x36'));_0x246864[_0xed3f('0x40')]=_[_0xed3f('0x41')](_0x7e0212['query']);_0x246864[_0xed3f('0x42')]=_[_0xed3f('0x43')](_0x246864['model'],_0x246864['query']);_0x7cdcb7[_0xed3f('0x44')]=_['intersection'](_0x246864['model'],qs[_0xed3f('0x45')](_0x7e0212[_0xed3f('0x40')][_0xed3f('0x45')]));_0x7cdcb7[_0xed3f('0x44')]=_0x7cdcb7['attributes'][_0xed3f('0x46')]?_0x7cdcb7[_0xed3f('0x44')]:_0x246864['model'];if(!_0x7e0212[_0xed3f('0x40')][_0xed3f('0x47')](_0xed3f('0x48'))){_0x7cdcb7['limit']=qs[_0xed3f('0x30')](_0x7e0212[_0xed3f('0x40')]['limit']);_0x7cdcb7[_0xed3f('0x2e')]=qs[_0xed3f('0x2e')](_0x7e0212[_0xed3f('0x40')][_0xed3f('0x2e')]);}_0x7cdcb7[_0xed3f('0x49')]=qs['sort'](_0x7e0212[_0xed3f('0x40')]['sort']);_0x7cdcb7[_0xed3f('0x4a')]=qs[_0xed3f('0x42')](_[_0xed3f('0x4b')](_0x7e0212[_0xed3f('0x40')],_0x246864[_0xed3f('0x42')]),_0x53ec08);if(_0x7e0212[_0xed3f('0x40')][_0xed3f('0x4c')]){_0x7cdcb7[_0xed3f('0x4a')]=_[_0xed3f('0x4d')](_0x7cdcb7[_0xed3f('0x4a')],{'$or':_[_0xed3f('0x39')](_0x53ec08,function(_0x252cfd){if(_0x252cfd[_0xed3f('0x3d')]!==_0xed3f('0x4e')){var _0x4d2a0f={};_0x4d2a0f[_0x252cfd[_0xed3f('0x36')]]={'$like':'%'+_0x7e0212[_0xed3f('0x40')][_0xed3f('0x4c')]+'%'};return _0x4d2a0f;}})});}_0x7cdcb7=_[_0xed3f('0x4d')]({},_0x7cdcb7,_0x7e0212['options']);var _0x1f4de9={'where':_0x7cdcb7[_0xed3f('0x4a')]};return db[_0xed3f('0x3a')][_0xed3f('0x31')](_0x1f4de9)['then'](function(_0x25c4ac){_0x1e8136[_0xed3f('0x31')]=_0x25c4ac;if(_0x7e0212[_0xed3f('0x40')][_0xed3f('0x4f')]){_0x7cdcb7[_0xed3f('0x50')]=[{'all':!![]}];}return db[_0xed3f('0x3a')][_0xed3f('0x51')](_0x7cdcb7);})['then'](function(_0x3d466a){_0x1e8136[_0xed3f('0x52')]=_0x3d466a;return _0x1e8136;})[_0xed3f('0x22')](respondWithFilteredResult(_0xf5842b,_0x7cdcb7))[_0xed3f('0x2a')](handleError(_0xf5842b,null));};exports[_0xed3f('0x53')]=function(_0x42906f,_0x25bf96){var _0x4bd178={'raw':!![],'where':{'id':_0x42906f[_0xed3f('0x54')]['id']}},_0x4d70d4={};_0x4d70d4[_0xed3f('0x3f')]=_[_0xed3f('0x41')](db[_0xed3f('0x3a')][_0xed3f('0x3b')]);_0x4d70d4[_0xed3f('0x40')]=_[_0xed3f('0x41')](_0x42906f[_0xed3f('0x40')]);_0x4d70d4['filters']=_[_0xed3f('0x43')](_0x4d70d4[_0xed3f('0x3f')],_0x4d70d4[_0xed3f('0x40')]);_0x4bd178[_0xed3f('0x44')]=_['intersection'](_0x4d70d4['model'],qs[_0xed3f('0x45')](_0x42906f['query'][_0xed3f('0x45')]));_0x4bd178['attributes']=_0x4bd178['attributes']['length']?_0x4bd178[_0xed3f('0x44')]:_0x4d70d4[_0xed3f('0x3f')];if(_0x42906f[_0xed3f('0x40')][_0xed3f('0x4f')]){_0x4bd178[_0xed3f('0x50')]=[{'all':!![]}];}_0x4bd178=_['merge']({},_0x4bd178,_0x42906f[_0xed3f('0x55')]);return db[_0xed3f('0x3a')][_0xed3f('0x56')](_0x4bd178)[_0xed3f('0x22')](handleEntityNotFound(_0x25bf96,null))['then'](respondWithResult(_0x25bf96,null))[_0xed3f('0x2a')](handleError(_0x25bf96,null));};exports[_0xed3f('0x57')]=function(_0x2c424d,_0xb9ad34,_0x15e6d9){var _0x3eecf0;return db[_0xed3f('0x58')][_0xed3f('0x59')](function(_0x4634cb){return db[_0xed3f('0x3a')][_0xed3f('0x57')](_0x2c424d[_0xed3f('0x5a')],{'raw':!![]})[_0xed3f('0x22')](function(_0x4836f4){_0x3eecf0=_0x4836f4;return db[_0xed3f('0x3a')][_0xed3f('0x51')]({'where':{'type':_0x2c424d[_0xed3f('0x5a')][_0xed3f('0x3d')]},'raw':!![]});})['then'](function(_0x2526b4){if(_0x3eecf0[_0xed3f('0x3d')][_0xed3f('0x5b')]()==_0xed3f('0x5c')){var _0x307000=fs[_0xed3f('0x5d')](path[_0xed3f('0x5e')](config[_0xed3f('0x5f')],_0xed3f('0x60')),_0xed3f('0x61'));var _0x24ab57=ejs[_0xed3f('0x62')](_0x307000,{'networks':_0x2526b4||[]});fs[_0xed3f('0x63')](_0xed3f('0x64'),_0x24ab57);return respondWithRpcPromise(_0xed3f('0x65'),'create',{'module':'res_stun_monitor.so'});}else if(_0x3eecf0[_0xed3f('0x3d')][_0xed3f('0x5b')]()==_0xed3f('0x66')){var _0x487cf1=fs[_0xed3f('0x5d')](path['join'](config[_0xed3f('0x5f')],'server/files/templates/turn_multiple.ejs'),_0xed3f('0x61'));var _0x268b08=ejs[_0xed3f('0x62')](_0x487cf1,{'networks':_0x2526b4||[]});fs[_0xed3f('0x63')](_0xed3f('0x67'),_0x268b08);return respondWithRpcPromise(_0xed3f('0x65'),_0xed3f('0x57'),{'module':_0xed3f('0x68')});}else{var _0x3a796b=fs[_0xed3f('0x5d')](path['join'](config['root'],_0xed3f('0x69')),_0xed3f('0x61'));var _0x4c2455=ejs[_0xed3f('0x62')](_0x3a796b,{'networks':_0x2526b4||[]});fs[_0xed3f('0x63')](util[_0xed3f('0x6a')](_0xed3f('0x6b'),_0x2c424d[_0xed3f('0x5a')]['type'][_0xed3f('0x6c')]()),_0x4c2455);return respondWithRpcPromise(_0xed3f('0x65'),_0xed3f('0x57'),{'module':_0xed3f('0x6d')});}return null;})[_0xed3f('0x22')](function(){return _0x3eecf0;});})[_0xed3f('0x22')](respondWithResult(_0xb9ad34,0xc9))['catch'](handleError(_0xb9ad34,null));};exports[_0xed3f('0x6e')]=function(_0x905710,_0x292c56,_0x56a3ff){var _0x1382d3;return db[_0xed3f('0x58')]['transaction'](function(_0x238818){return db[_0xed3f('0x3a')][_0xed3f('0x56')]({'where':{'id':_0x905710[_0xed3f('0x54')]['id']}})[_0xed3f('0x22')](handleEntityNotFound(_0x292c56,null))['then'](saveUpdates(_0x905710['body'],null))[_0xed3f('0x22')](function(_0x45d8f1){if(_0x45d8f1){_0x1382d3=_0x45d8f1;return db['Network'][_0xed3f('0x51')]({'where':{'type':_0x1382d3[_0xed3f('0x3d')]},'raw':!![]});}return null;})[_0xed3f('0x22')](function(_0x30614a){if(_0x1382d3[_0xed3f('0x3d')]['toUpperCase']()==_0xed3f('0x5c')){var _0x38b472=fs[_0xed3f('0x5d')](path['join'](config[_0xed3f('0x5f')],_0xed3f('0x60')),'utf8');var _0x2f3d2b=ejs[_0xed3f('0x62')](_0x38b472,{'networks':_0x30614a||[]});fs[_0xed3f('0x63')]('/etc/asterisk/stun_xcally.conf',_0x2f3d2b);return respondWithRpcPromise(_0xed3f('0x65'),'update',{'module':'res_stun_monitor.so'});}else if(_0x1382d3[_0xed3f('0x3d')]['toUpperCase']()==_0xed3f('0x66')){var _0x2e1829=fs['readFileSync'](path[_0xed3f('0x5e')](config[_0xed3f('0x5f')],_0xed3f('0x6f')),_0xed3f('0x61'));var _0x2ed04f=ejs[_0xed3f('0x62')](_0x2e1829,{'networks':_0x30614a||[]});fs[_0xed3f('0x63')](_0xed3f('0x67'),_0x2ed04f);return respondWithRpcPromise(_0xed3f('0x65'),'update',{'module':_0xed3f('0x68')});}else{var _0x1d5c59=fs[_0xed3f('0x5d')](path[_0xed3f('0x5e')](config[_0xed3f('0x5f')],_0xed3f('0x69')),'utf8');var _0x15a485=ejs['render'](_0x1d5c59,{'networks':_0x30614a||[]});fs[_0xed3f('0x63')](util[_0xed3f('0x6a')]('/etc/asterisk/sip_xcally_%s.conf',_0x905710[_0xed3f('0x5a')][_0xed3f('0x3d')][_0xed3f('0x6c')]()),_0x15a485);return respondWithRpcPromise(_0xed3f('0x65'),_0xed3f('0x6e'),{'module':_0xed3f('0x6d')});}return null;})['then'](function(_0x6c9167){if(_0x6c9167){return _0x1382d3;}return null;});})[_0xed3f('0x22')](respondWithResult(_0x292c56,null))['catch'](handleError(_0x292c56,null));};exports[_0xed3f('0x70')]=function(_0x5842e3,_0x7743db,_0x8d6fa){var _0x5e048a;return db[_0xed3f('0x3a')][_0xed3f('0x56')]({'where':{'id':_0x5842e3[_0xed3f('0x54')]['id']}})[_0xed3f('0x22')](function(_0x3a623d){_0x5e048a=_0x3a623d;return _0x3a623d;})[_0xed3f('0x22')](handleEntityNotFound(_0x7743db,null))[_0xed3f('0x22')](removeEntity(_0x7743db,null))[_0xed3f('0x22')](function(){if(_0x5e048a){return db[_0xed3f('0x3a')][_0xed3f('0x51')]({'where':{'type':_0x5e048a[_0xed3f('0x3d')]},'raw':!![]});}})[_0xed3f('0x22')](function(_0x4cc02f){if(_0x5e048a[_0xed3f('0x3d')][_0xed3f('0x5b')]()==_0xed3f('0x5c')){var _0x4b296c=fs['readFileSync'](path[_0xed3f('0x5e')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xed3f('0x61'));var _0x1baa7b=ejs[_0xed3f('0x62')](_0x4b296c,{'networks':_0x4cc02f||[]});fs[_0xed3f('0x63')](_0xed3f('0x64'),_0x1baa7b);return respondWithRpcPromise(_0xed3f('0x65'),_0xed3f('0x70'),{'module':_0xed3f('0x68')});}else if(_0x5e048a[_0xed3f('0x3d')][_0xed3f('0x5b')]()==_0xed3f('0x66')){var _0x3a76cf=fs['readFileSync'](path[_0xed3f('0x5e')](config[_0xed3f('0x5f')],'server/files/templates/turn_multiple.ejs'),_0xed3f('0x61'));var _0x48b946=ejs['render'](_0x3a76cf,{'networks':_0x4cc02f||[]});fs[_0xed3f('0x63')](_0xed3f('0x67'),_0x48b946);return respondWithRpcPromise(_0xed3f('0x65'),_0xed3f('0x70'),{'module':_0xed3f('0x68')});}else{var _0x46e280=fs[_0xed3f('0x5d')](path[_0xed3f('0x5e')](config[_0xed3f('0x5f')],'server/files/templates/network.ejs'),_0xed3f('0x61'));var _0x5311b3=ejs[_0xed3f('0x62')](_0x46e280,{'networks':_0x4cc02f||[]});fs['writeFileSync'](util[_0xed3f('0x6a')]('/etc/asterisk/sip_xcally_%s.conf',_0x5842e3[_0xed3f('0x5a')][_0xed3f('0x3d')][_0xed3f('0x6c')]()),_0x5311b3);return respondWithRpcPromise(_0xed3f('0x65'),_0xed3f('0x70'),{'module':_0xed3f('0x6d')});}return null;})[_0xed3f('0x2a')](handleError(_0x7743db,null));}; \ No newline at end of file +var _0x34f8=['readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','root','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','STUN','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','send','index','map','Network','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','merge','find','sequelize','transaction','create','body','toUpperCase'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x34f8,0x80));var _0x834f=function(_0x1e904e,_0x36ed48){_0x1e904e=_0x1e904e-0x0;var _0x581c1b=_0x34f8[_0x1e904e];return _0x581c1b;};'use strict';var emlformat=require(_0x834f('0x0'));var rimraf=require(_0x834f('0x1'));var zipdir=require(_0x834f('0x2'));var jsonpatch=require(_0x834f('0x3'));var rp=require(_0x834f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x834f('0x5'));var util=require(_0x834f('0x6'));var path=require('path');var sox=require(_0x834f('0x7'));var csv=require(_0x834f('0x8'));var ejs=require(_0x834f('0x9'));var fs=require('fs');var fs_extra=require(_0x834f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x834f('0xb'));var jsforce=require(_0x834f('0xc'));var deskjs=require(_0x834f('0xd'));var toCsv=require(_0x834f('0x8'));var querystring=require('querystring');var Papa=require(_0x834f('0xe'));var Redis=require(_0x834f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x834f('0x10'));var as=require(_0x834f('0x11'));var hardwareService=require(_0x834f('0x12'));var logger=require(_0x834f('0x13'))(_0x834f('0x14'));var utils=require(_0x834f('0x15'));var config=require(_0x834f('0x16'));var licenseUtil=require(_0x834f('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x834f('0x18'));var client=jayson[_0x834f('0x19')][_0x834f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xda9f2d,_0x467a45,_0x57e0d9,_0x1757ae){return new BPromise(function(_0x2f8592,_0x5bfea4){var _0x34348c=_0x1757ae||client;return _0x34348c[_0x834f('0x1b')](_0xda9f2d,_0x57e0d9)['then'](function(_0x2b9a0c){logger['info'](_0x834f('0x1c'),_0x467a45,_0x834f('0x1d'));logger[_0x834f('0x1e')](_0x834f('0x1f'),_0x467a45,'request\x20sent',JSON['stringify'](_0x2b9a0c));if(_0x2b9a0c[_0x834f('0x20')]){if(_0x2b9a0c[_0x834f('0x20')][_0x834f('0x21')]===0x1f4){logger[_0x834f('0x20')]('Network,\x20%s,\x20%s',_0x467a45,_0x2b9a0c[_0x834f('0x20')][_0x834f('0x22')]);return _0x5bfea4(_0x2b9a0c[_0x834f('0x20')]['message']);}logger['error'](_0x834f('0x1c'),_0x467a45,_0x2b9a0c['error'][_0x834f('0x22')]);return _0x2f8592(_0x2b9a0c[_0x834f('0x20')]['message']);}else{logger[_0x834f('0x23')]('Network,\x20%s,\x20%s',_0x467a45,_0x834f('0x1d'));_0x2f8592(_0x2b9a0c[_0x834f('0x24')][_0x834f('0x22')]);}})[_0x834f('0x25')](function(_0x5e5576){logger[_0x834f('0x20')]('Network,\x20%s,\x20%s',_0x467a45,_0x5e5576);_0x5bfea4(_0x5e5576);});});}function respondWithStatusCode(_0x3ec8dc,_0x59af4e){_0x59af4e=_0x59af4e||0xcc;return function(_0x536907){if(_0x536907){return _0x3ec8dc[_0x834f('0x26')](_0x59af4e);}return _0x3ec8dc['status'](_0x59af4e)['end']();};}function respondWithResult(_0x57346b,_0x45e1ef){_0x45e1ef=_0x45e1ef||0xc8;return function(_0x2268a1){if(_0x2268a1){return _0x57346b[_0x834f('0x27')](_0x45e1ef)[_0x834f('0x28')](_0x2268a1);}};}function respondWithFilteredResult(_0x44355b,_0x2d852b){return function(_0x2cace0){if(_0x2cace0){var _0x139495=typeof _0x2d852b[_0x834f('0x29')]===_0x834f('0x2a')&&typeof _0x2d852b[_0x834f('0x2b')]==='undefined';var _0x38a43c=_0x2cace0[_0x834f('0x2c')];var _0xcd12fe=_0x139495?0x0:_0x2d852b['offset'];var _0x1136b9=_0x139495?_0x2cace0[_0x834f('0x2c')]:_0x2d852b[_0x834f('0x29')]+_0x2d852b[_0x834f('0x2b')];var _0x51cc8f;if(_0x1136b9>=_0x38a43c){_0x1136b9=_0x38a43c;_0x51cc8f=0xc8;}else{_0x51cc8f=0xce;}_0x44355b[_0x834f('0x27')](_0x51cc8f);return _0x44355b[_0x834f('0x2d')](_0x834f('0x2e'),_0xcd12fe+'-'+_0x1136b9+'/'+_0x38a43c)[_0x834f('0x28')](_0x2cace0);}return null;};}function patchUpdates(_0x5c3d6b){return function(_0x3fc0ef){try{jsonpatch[_0x834f('0x2f')](_0x3fc0ef,_0x5c3d6b,!![]);}catch(_0x55d4af){return BPromise[_0x834f('0x30')](_0x55d4af);}return _0x3fc0ef['save']();};}function saveUpdates(_0x38f165,_0x1ec011){return function(_0x569162){if(_0x569162){return _0x569162[_0x834f('0x31')](_0x38f165)[_0x834f('0x32')](function(_0x4913b7){return _0x4913b7;});}return null;};}function removeEntity(_0x252bd8,_0x3342f6){return function(_0x263df1){if(_0x263df1){return _0x263df1[_0x834f('0x33')]()[_0x834f('0x32')](function(){_0x252bd8['status'](0xcc)[_0x834f('0x34')]();});}};}function handleEntityNotFound(_0x499ebf,_0x5ec3a4){return function(_0x212ef2){if(!_0x212ef2){_0x499ebf['sendStatus'](0x194);}return _0x212ef2;};}function handleError(_0xc68c8d,_0x1ae302){_0x1ae302=_0x1ae302||0x1f4;return function(_0x3f3c4c){logger[_0x834f('0x20')](_0x3f3c4c['stack']);if(_0x3f3c4c['name']){delete _0x3f3c4c['name'];}_0xc68c8d[_0x834f('0x27')](_0x1ae302)[_0x834f('0x35')](_0x3f3c4c);};}exports[_0x834f('0x36')]=function(_0x43df54,_0x12cfe3){var _0x48b0cf={},_0xf8cff8={},_0x6ec56d={'count':0x0,'rows':[]};var _0x2494e0=_[_0x834f('0x37')](db[_0x834f('0x38')][_0x834f('0x39')],function(_0x46929f){return{'name':_0x46929f[_0x834f('0x3a')],'type':_0x46929f[_0x834f('0x3b')][_0x834f('0x3c')]};});_0xf8cff8[_0x834f('0x3d')]=_[_0x834f('0x37')](_0x2494e0,_0x834f('0x3e'));_0xf8cff8['query']=_['keys'](_0x43df54['query']);_0xf8cff8[_0x834f('0x3f')]=_['intersection'](_0xf8cff8['model'],_0xf8cff8[_0x834f('0x40')]);_0x48b0cf[_0x834f('0x41')]=_[_0x834f('0x42')](_0xf8cff8[_0x834f('0x3d')],qs[_0x834f('0x43')](_0x43df54['query'][_0x834f('0x43')]));_0x48b0cf[_0x834f('0x41')]=_0x48b0cf[_0x834f('0x41')][_0x834f('0x44')]?_0x48b0cf[_0x834f('0x41')]:_0xf8cff8['model'];if(!_0x43df54[_0x834f('0x40')][_0x834f('0x45')]('nolimit')){_0x48b0cf[_0x834f('0x2b')]=qs[_0x834f('0x2b')](_0x43df54[_0x834f('0x40')]['limit']);_0x48b0cf['offset']=qs[_0x834f('0x29')](_0x43df54['query']['offset']);}_0x48b0cf[_0x834f('0x46')]=qs[_0x834f('0x47')](_0x43df54[_0x834f('0x40')]['sort']);_0x48b0cf['where']=qs['filters'](_['pick'](_0x43df54[_0x834f('0x40')],_0xf8cff8['filters']),_0x2494e0);if(_0x43df54[_0x834f('0x40')][_0x834f('0x48')]){_0x48b0cf[_0x834f('0x49')]=_['merge'](_0x48b0cf[_0x834f('0x49')],{'$or':_[_0x834f('0x37')](_0x2494e0,function(_0x2a77ee){if(_0x2a77ee[_0x834f('0x3b')]!==_0x834f('0x4a')){var _0x128888={};_0x128888[_0x2a77ee[_0x834f('0x3e')]]={'$like':'%'+_0x43df54[_0x834f('0x40')]['filter']+'%'};return _0x128888;}})});}_0x48b0cf=_['merge']({},_0x48b0cf,_0x43df54[_0x834f('0x4b')]);var _0xa97440={'where':_0x48b0cf[_0x834f('0x49')]};return db[_0x834f('0x38')]['count'](_0xa97440)['then'](function(_0x529554){_0x6ec56d['count']=_0x529554;if(_0x43df54[_0x834f('0x40')][_0x834f('0x4c')]){_0x48b0cf[_0x834f('0x4d')]=[{'all':!![]}];}return db[_0x834f('0x38')][_0x834f('0x4e')](_0x48b0cf);})[_0x834f('0x32')](function(_0x5db5d5){_0x6ec56d[_0x834f('0x4f')]=_0x5db5d5;return _0x6ec56d;})[_0x834f('0x32')](respondWithFilteredResult(_0x12cfe3,_0x48b0cf))[_0x834f('0x25')](handleError(_0x12cfe3,null));};exports[_0x834f('0x50')]=function(_0x19725a,_0x1ba752){var _0x2203af={'raw':!![],'where':{'id':_0x19725a[_0x834f('0x51')]['id']}},_0x28a8eb={};_0x28a8eb['model']=_[_0x834f('0x52')](db[_0x834f('0x38')][_0x834f('0x39')]);_0x28a8eb['query']=_[_0x834f('0x52')](_0x19725a[_0x834f('0x40')]);_0x28a8eb[_0x834f('0x3f')]=_[_0x834f('0x42')](_0x28a8eb['model'],_0x28a8eb[_0x834f('0x40')]);_0x2203af[_0x834f('0x41')]=_[_0x834f('0x42')](_0x28a8eb[_0x834f('0x3d')],qs['fields'](_0x19725a[_0x834f('0x40')][_0x834f('0x43')]));_0x2203af['attributes']=_0x2203af[_0x834f('0x41')]['length']?_0x2203af[_0x834f('0x41')]:_0x28a8eb['model'];if(_0x19725a[_0x834f('0x40')]['includeAll']){_0x2203af[_0x834f('0x4d')]=[{'all':!![]}];}_0x2203af=_[_0x834f('0x53')]({},_0x2203af,_0x19725a[_0x834f('0x4b')]);return db[_0x834f('0x38')][_0x834f('0x54')](_0x2203af)['then'](handleEntityNotFound(_0x1ba752,null))[_0x834f('0x32')](respondWithResult(_0x1ba752,null))[_0x834f('0x25')](handleError(_0x1ba752,null));};exports['create']=function(_0x5a0853,_0x5ca9bb,_0x41ec25){var _0x2b02ea;return db[_0x834f('0x55')][_0x834f('0x56')](function(_0x4fc9bc){return db[_0x834f('0x38')][_0x834f('0x57')](_0x5a0853['body'],{'raw':!![]})[_0x834f('0x32')](function(_0x59b618){_0x2b02ea=_0x59b618;return db[_0x834f('0x38')][_0x834f('0x4e')]({'where':{'type':_0x5a0853[_0x834f('0x58')]['type']},'raw':!![]});})[_0x834f('0x32')](function(_0x35da58){if(_0x2b02ea[_0x834f('0x3b')][_0x834f('0x59')]()=='STUN'){var _0x2e40ae=fs[_0x834f('0x5a')](path[_0x834f('0x5b')](config['root'],_0x834f('0x5c')),_0x834f('0x5d'));var _0x945798=ejs[_0x834f('0x5e')](_0x2e40ae,{'networks':_0x35da58||[]});fs[_0x834f('0x5f')](_0x834f('0x60'),_0x945798);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x57'),{'module':_0x834f('0x62')});}else if(_0x2b02ea[_0x834f('0x3b')]['toUpperCase']()==_0x834f('0x63')){var _0x112cd9=fs['readFileSync'](path[_0x834f('0x5b')](config['root'],_0x834f('0x64')),_0x834f('0x5d'));var _0xa7ea0c=ejs['render'](_0x112cd9,{'networks':_0x35da58||[]});fs['writeFileSync'](_0x834f('0x65'),_0xa7ea0c);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x57'),{'module':'res_stun_monitor.so'});}else{var _0x59e1b3=fs[_0x834f('0x5a')](path[_0x834f('0x5b')](config[_0x834f('0x66')],_0x834f('0x67')),_0x834f('0x5d'));var _0x1d92d1=ejs[_0x834f('0x5e')](_0x59e1b3,{'networks':_0x35da58||[]});fs['writeFileSync'](util[_0x834f('0x68')](_0x834f('0x69'),_0x5a0853[_0x834f('0x58')][_0x834f('0x3b')][_0x834f('0x6a')]()),_0x1d92d1);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x57'),{'module':_0x834f('0x6b')});}return null;})[_0x834f('0x32')](function(){return _0x2b02ea;});})['then'](respondWithResult(_0x5ca9bb,0xc9))[_0x834f('0x25')](handleError(_0x5ca9bb,null));};exports[_0x834f('0x31')]=function(_0x975de8,_0x2849a5,_0x2499e9){var _0x42eaa0;return db[_0x834f('0x55')][_0x834f('0x56')](function(_0x5dd982){return db[_0x834f('0x38')][_0x834f('0x54')]({'where':{'id':_0x975de8['params']['id']}})[_0x834f('0x32')](handleEntityNotFound(_0x2849a5,null))[_0x834f('0x32')](saveUpdates(_0x975de8[_0x834f('0x58')],null))['then'](function(_0x3b3333){if(_0x3b3333){_0x42eaa0=_0x3b3333;return db[_0x834f('0x38')][_0x834f('0x4e')]({'where':{'type':_0x42eaa0[_0x834f('0x3b')]},'raw':!![]});}return null;})[_0x834f('0x32')](function(_0x269cdc){if(_0x42eaa0['type'][_0x834f('0x59')]()==_0x834f('0x6c')){var _0x34ffe1=fs['readFileSync'](path[_0x834f('0x5b')](config[_0x834f('0x66')],_0x834f('0x5c')),_0x834f('0x5d'));var _0x1273e7=ejs[_0x834f('0x5e')](_0x34ffe1,{'networks':_0x269cdc||[]});fs[_0x834f('0x5f')](_0x834f('0x60'),_0x1273e7);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x31'),{'module':_0x834f('0x62')});}else if(_0x42eaa0[_0x834f('0x3b')][_0x834f('0x59')]()==_0x834f('0x63')){var _0x2baee8=fs[_0x834f('0x5a')](path['join'](config[_0x834f('0x66')],_0x834f('0x64')),_0x834f('0x5d'));var _0x33b0ad=ejs[_0x834f('0x5e')](_0x2baee8,{'networks':_0x269cdc||[]});fs[_0x834f('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x33b0ad);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x44e564=fs[_0x834f('0x5a')](path['join'](config[_0x834f('0x66')],_0x834f('0x67')),_0x834f('0x5d'));var _0x4087ca=ejs[_0x834f('0x5e')](_0x44e564,{'networks':_0x269cdc||[]});fs['writeFileSync'](util['format'](_0x834f('0x69'),_0x975de8[_0x834f('0x58')][_0x834f('0x3b')][_0x834f('0x6a')]()),_0x4087ca);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x31'),{'module':_0x834f('0x6b')});}return null;})[_0x834f('0x32')](function(_0x37928b){if(_0x37928b){return _0x42eaa0;}return null;});})['then'](respondWithResult(_0x2849a5,null))[_0x834f('0x25')](handleError(_0x2849a5,null));};exports[_0x834f('0x33')]=function(_0x5697da,_0xd85df6,_0xe79f6a){var _0x515398;return db[_0x834f('0x38')][_0x834f('0x54')]({'where':{'id':_0x5697da[_0x834f('0x51')]['id']}})['then'](function(_0x298dc9){_0x515398=_0x298dc9;return _0x298dc9;})['then'](handleEntityNotFound(_0xd85df6,null))['then'](removeEntity(_0xd85df6,null))[_0x834f('0x32')](function(){if(_0x515398){return db[_0x834f('0x38')][_0x834f('0x4e')]({'where':{'type':_0x515398[_0x834f('0x3b')]},'raw':!![]});}})[_0x834f('0x32')](function(_0x6b62c2){if(_0x515398['type'][_0x834f('0x59')]()==_0x834f('0x6c')){var _0x569293=fs[_0x834f('0x5a')](path[_0x834f('0x5b')](config['root'],_0x834f('0x5c')),_0x834f('0x5d'));var _0x325012=ejs[_0x834f('0x5e')](_0x569293,{'networks':_0x6b62c2||[]});fs[_0x834f('0x5f')](_0x834f('0x60'),_0x325012);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x515398[_0x834f('0x3b')][_0x834f('0x59')]()==_0x834f('0x63')){var _0x56957a=fs[_0x834f('0x5a')](path[_0x834f('0x5b')](config['root'],_0x834f('0x64')),_0x834f('0x5d'));var _0x4cfd68=ejs['render'](_0x56957a,{'networks':_0x6b62c2||[]});fs['writeFileSync'](_0x834f('0x65'),_0x4cfd68);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x33'),{'module':_0x834f('0x62')});}else{var _0x1793f1=fs[_0x834f('0x5a')](path[_0x834f('0x5b')](config[_0x834f('0x66')],_0x834f('0x67')),_0x834f('0x5d'));var _0x118478=ejs[_0x834f('0x5e')](_0x1793f1,{'networks':_0x6b62c2||[]});fs[_0x834f('0x5f')](util[_0x834f('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0x5697da['body']['type'][_0x834f('0x6a')]()),_0x118478);return respondWithRpcPromise(_0x834f('0x61'),_0x834f('0x33'),{'module':'chan_sip.so'});}return null;})[_0x834f('0x25')](handleError(_0xd85df6,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index ff3a8e7..0a01845 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 _0x049e=['Network','network','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4d79a6,_0x19ce01){var _0x37c276=function(_0x2dd2f2){while(--_0x2dd2f2){_0x4d79a6['push'](_0x4d79a6['shift']());}};_0x37c276(++_0x19ce01);}(_0x049e,0x16a));var _0xe049=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x049e[_0x187d80];return _0x498a77;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var logger=require('../../config/logger')(_0xe049('0x2'));var moment=require('moment');var BPromise=require(_0xe049('0x3'));var rp=require(_0xe049('0x4'));var fs=require('fs');var path=require(_0xe049('0x5'));var rimraf=require(_0xe049('0x6'));var config=require(_0xe049('0x7'));var attributes=require('./network.attributes');module[_0xe049('0x8')]=function(_0x196af2,_0x22e8f5){return _0x196af2[_0xe049('0x9')](_0xe049('0xa'),attributes,{'tableName':_0xe049('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1306=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports'];(function(_0x5de177,_0xca7264){var _0x47ebe3=function(_0x59df68){while(--_0x59df68){_0x5de177['push'](_0x5de177['shift']());}};_0x47ebe3(++_0xca7264);}(_0x1306,0x17a));var _0x6130=function(_0x1e2725,_0xc49131){_0x1e2725=_0x1e2725-0x0;var _0x198fca=_0x1306[_0x1e2725];return _0x198fca;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var logger=require(_0x6130('0x2'))(_0x6130('0x3'));var moment=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var rp=require(_0x6130('0x6'));var fs=require('fs');var path=require(_0x6130('0x7'));var rimraf=require(_0x6130('0x8'));var config=require(_0x6130('0x9'));var attributes=require(_0x6130('0xa'));module[_0x6130('0xb')]=function(_0x213e6a,_0x2b965d){return _0x213e6a[_0x6130('0xc')](_0x6130('0xd'),attributes,{'tableName':_0x6130('0xe'),'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 770afed..06b3b0c 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x493515,_0x27a345){_0x493515=_0x493515-0x0;var _0x3e93eb=_0x7a54[_0x493515];return _0x3e93eb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x5bd9e2,_0x492098){_0x5bd9e2=_0x5bd9e2-0x0;var _0xc62db7=_0x7a54[_0x5bd9e2];return _0xc62db7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index a58b39c..2a56ae1 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 _0x8ddf=['./openchannelAccount.controller','index','/describe','describe','get','/:id','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/users','addAgents','/:id/send','send','put','delete','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x8ddf,0x13c));var _0xf8dd=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x8ddf[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0xf8dd('0x0'));var util=require(_0xf8dd('0x1'));var path=require('path');var timeout=require(_0xf8dd('0x2'));var express=require('express');var router=express[_0xf8dd('0x3')]();var fs_extra=require(_0xf8dd('0x4'));var auth=require(_0xf8dd('0x5'));var interaction=require(_0xf8dd('0x6'));var config=require(_0xf8dd('0x7'));var controller=require(_0xf8dd('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf8dd('0x9')]);router['get'](_0xf8dd('0xa'),auth['isAuthenticated'](),controller[_0xf8dd('0xb')]);router[_0xf8dd('0xc')](_0xf8dd('0xd'),auth[_0xf8dd('0xe')](),controller[_0xf8dd('0xf')]);router[_0xf8dd('0xc')](_0xf8dd('0x10'),auth[_0xf8dd('0xe')](),controller['getDispositions']);router[_0xf8dd('0xc')](_0xf8dd('0x11'),auth['isAuthenticated'](),controller[_0xf8dd('0x12')]);router[_0xf8dd('0xc')](_0xf8dd('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf8dd('0xc')]('/:id/interactions',auth[_0xf8dd('0xe')](),controller['getInteractions']);router[_0xf8dd('0xc')]('/:id/users',auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x14')]);router[_0xf8dd('0x15')]('/',auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x16')]);router[_0xf8dd('0x15')]('/:id/dispositions',auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x17')]);router[_0xf8dd('0x15')](_0xf8dd('0x11'),auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x18')]);router['post'](_0xf8dd('0x19'),controller[_0xf8dd('0x1a')]);router['post'](_0xf8dd('0x13'),auth[_0xf8dd('0xe')](),controller['addApplications']);router[_0xf8dd('0x15')](_0xf8dd('0x1b'),auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x1c')]);router[_0xf8dd('0x15')](_0xf8dd('0x1d'),auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x1e')]);router[_0xf8dd('0x1f')](_0xf8dd('0xd'),auth[_0xf8dd('0xe')](),controller['update']);router[_0xf8dd('0x20')](_0xf8dd('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xf8dd('0x20')](_0xf8dd('0x10'),auth[_0xf8dd('0xe')](),controller['removeDispositions']);router[_0xf8dd('0x20')](_0xf8dd('0x11'),auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x21')]);router[_0xf8dd('0x20')](_0xf8dd('0x1b'),auth[_0xf8dd('0xe')](),controller[_0xf8dd('0x22')]);module[_0xf8dd('0x23')]=router; \ No newline at end of file +var _0x6eda=['../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/users','getAgents','post','addDisposition','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x142c57,_0x5ab133){var _0x32ddef=function(_0x5a099a){while(--_0x5a099a){_0x142c57['push'](_0x142c57['shift']());}};_0x32ddef(++_0x5ab133);}(_0x6eda,0x191));var _0xa6ed=function(_0x558fc2,_0x7b702d){_0x558fc2=_0x558fc2-0x0;var _0x15a8a3=_0x6eda[_0x558fc2];return _0x15a8a3;};'use strict';var multer=require(_0xa6ed('0x0'));var util=require('util');var path=require(_0xa6ed('0x1'));var timeout=require(_0xa6ed('0x2'));var express=require(_0xa6ed('0x3'));var router=express[_0xa6ed('0x4')]();var fs_extra=require(_0xa6ed('0x5'));var auth=require(_0xa6ed('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa6ed('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa6ed('0x8')]);router[_0xa6ed('0x9')](_0xa6ed('0xa'),auth[_0xa6ed('0xb')](),controller['describe']);router[_0xa6ed('0x9')](_0xa6ed('0xc'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0xd')]);router[_0xa6ed('0x9')](_0xa6ed('0xe'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0xf')]);router[_0xa6ed('0x9')](_0xa6ed('0x10'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x11')]);router[_0xa6ed('0x9')]('/:id/applications',auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x12')]);router[_0xa6ed('0x9')]('/:id/interactions',auth[_0xa6ed('0xb')](),controller['getInteractions']);router[_0xa6ed('0x9')](_0xa6ed('0x13'),auth['isAuthenticated'](),controller[_0xa6ed('0x14')]);router[_0xa6ed('0x15')]('/',auth[_0xa6ed('0xb')](),controller['create']);router['post'](_0xa6ed('0xe'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x16')]);router[_0xa6ed('0x15')](_0xa6ed('0x10'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x17')]);router[_0xa6ed('0x15')]('/:id/notify',controller[_0xa6ed('0x18')]);router[_0xa6ed('0x15')](_0xa6ed('0x19'),auth['isAuthenticated'](),controller[_0xa6ed('0x1a')]);router[_0xa6ed('0x15')](_0xa6ed('0x13'),auth['isAuthenticated'](),controller[_0xa6ed('0x1b')]);router[_0xa6ed('0x15')](_0xa6ed('0x1c'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x1d')]);router[_0xa6ed('0x1e')](_0xa6ed('0xc'),auth[_0xa6ed('0xb')](),controller['update']);router[_0xa6ed('0x1f')](_0xa6ed('0xc'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x20')]);router[_0xa6ed('0x1f')]('/:id/dispositions',auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x21')]);router[_0xa6ed('0x1f')](_0xa6ed('0x10'),auth[_0xa6ed('0xb')](),controller[_0xa6ed('0x22')]);router[_0xa6ed('0x1f')](_0xa6ed('0x13'),auth['isAuthenticated'](),controller[_0xa6ed('0x23')]);module[_0xa6ed('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d23b3c9..62fd04c 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 _0xe399=['exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x2d59a8,_0x2d5eb2){var _0x21f529=function(_0x4a45b7){while(--_0x4a45b7){_0x2d59a8['push'](_0x2d59a8['shift']());}};_0x21f529(++_0x2d5eb2);}(_0xe399,0xfa));var _0x9e39=function(_0xda17e4,_0x29e7d9){_0xda17e4=_0xda17e4-0x0;var _0x13219a=_0xe399[_0xda17e4];return _0x13219a;};'use strict';var Sequelize=require(_0x9e39('0x0'));var rs=require(_0x9e39('0x1'));module[_0x9e39('0x2')]={'name':{'type':Sequelize[_0x9e39('0x3')],'unique':_0x9e39('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9e39('0x3')],'defaultValue':function(){return rs[_0x9e39('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9e39('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x9e39('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9e39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e39('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9e39('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9e39('0x8')],'defaultValue':![],'comment':_0x9e39('0xa'),'set':function(_0xa29d53){if(!_0xa29d53)this[_0x9e39('0xb')](_0x9e39('0xc'),null);this['setDataValue'](_0x9e39('0xd'),_0xa29d53);}}}; \ No newline at end of file +var _0x16a3=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x16a3,0x9d));var _0x316a=function(_0x42bf25,_0x231bf1){_0x42bf25=_0x42bf25-0x0;var _0x2b4a26=_0x16a3[_0x42bf25];return _0x2b4a26;};'use strict';var Sequelize=require(_0x316a('0x0'));var rs=require(_0x316a('0x1'));module['exports']={'name':{'type':Sequelize[_0x316a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x316a('0x2')]},'token':{'type':Sequelize[_0x316a('0x2')],'defaultValue':function(){return rs[_0x316a('0x3')]();}},'replyUri':{'type':Sequelize[_0x316a('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x316a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x316a('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x316a('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x316a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x316a('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x316a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x316a('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x316a('0x5')],'defaultValue':![],'comment':_0x316a('0x7'),'set':function(_0x32af26){if(!_0x32af26)this[_0x316a('0x8')](_0x316a('0x9'),null);this[_0x316a('0x8')](_0x316a('0xa'),_0x32af26);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index cb3e2db..7ee6f07 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 _0x378a=['orderBy','priority','asc','account','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','forcedOwnership','startRouting','Start','EventManager','notify','addApplications','sequelize','transaction','getApplications','getInteractions','Owner','internal','Tag','color','tag','addAgents','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','pick','findAll','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list'];(function(_0x399338,_0x11496b){var _0x3c4485=function(_0x17e385){while(--_0x17e385){_0x399338['push'](_0x399338['shift']());}};_0x3c4485(++_0x11496b);}(_0x378a,0x1a8));var _0xa378=function(_0xe0d10c,_0x106a00){_0xe0d10c=_0xe0d10c-0x0;var _0x249f9b=_0x378a[_0xe0d10c];return _0x249f9b;};'use strict';var emlformat=require(_0xa378('0x0'));var rimraf=require(_0xa378('0x1'));var zipdir=require(_0xa378('0x2'));var jsonpatch=require(_0xa378('0x3'));var rp=require(_0xa378('0x4'));var moment=require(_0xa378('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa378('0x6'));var util=require(_0xa378('0x7'));var path=require(_0xa378('0x8'));var sox=require(_0xa378('0x9'));var csv=require('to-csv');var ejs=require(_0xa378('0xa'));var fs=require('fs');var fs_extra=require(_0xa378('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa378('0xc'));var jsforce=require(_0xa378('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa378('0xe'));var querystring=require(_0xa378('0xf'));var Papa=require('papaparse');var Redis=require(_0xa378('0x10'));var authService=require(_0xa378('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa378('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa378('0x13'))('api');var utils=require(_0xa378('0x14'));var config=require(_0xa378('0x15'));var licenseUtil=require(_0xa378('0x16'));var db=require(_0xa378('0x17'))['db'];config[_0xa378('0x18')]=_[_0xa378('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa378('0x1a'))(new Redis(config[_0xa378('0x18')]));require('./openchannelAccount.socket')[_0xa378('0x1b')](socket);var jayson=require(_0xa378('0x1c'));var client=jayson[_0xa378('0x1d')][_0xa378('0x1e')]({'port':0x232c});var client9002=jayson[_0xa378('0x1d')][_0xa378('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x24593b,_0x192e39,_0x24d809,_0x26acdf){return new BPromise(function(_0x4556f8,_0x57fde8){var _0x2e32b1=_0x26acdf||client;return _0x2e32b1[_0xa378('0x1f')](_0x24593b,_0x24d809)[_0xa378('0x20')](function(_0x504480){logger[_0xa378('0x21')](_0xa378('0x22'),_0x192e39,_0xa378('0x23'));logger['debug'](_0xa378('0x24'),_0x192e39,_0xa378('0x23'),JSON[_0xa378('0x25')](_0x504480));if(_0x504480[_0xa378('0x26')]){if(_0x504480[_0xa378('0x26')][_0xa378('0x27')]===0x1f4){logger[_0xa378('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x192e39,_0x504480['error']['message']);return _0x57fde8(_0x504480['error']['message']);}logger[_0xa378('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x192e39,_0x504480[_0xa378('0x26')][_0xa378('0x28')]);return _0x4556f8(_0x504480['error'][_0xa378('0x28')]);}else{logger[_0xa378('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x192e39,'request\x20sent');_0x4556f8(_0x504480[_0xa378('0x29')][_0xa378('0x28')]);}})[_0xa378('0x2a')](function(_0x3211be){logger[_0xa378('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x192e39,_0x3211be);_0x57fde8(_0x3211be);});});}function respondWithStatusCode(_0x502941,_0x56d393){_0x56d393=_0x56d393||0xcc;return function(_0x122460){if(_0x122460){return _0x502941['sendStatus'](_0x56d393);}return _0x502941[_0xa378('0x2b')](_0x56d393)[_0xa378('0x2c')]();};}function respondWithResult(_0xe6da4d,_0x14e093){_0x14e093=_0x14e093||0xc8;return function(_0xe80d67){if(_0xe80d67){return _0xe6da4d['status'](_0x14e093)['json'](_0xe80d67);}};}function respondWithFilteredResult(_0x68b02c,_0x3b00bd){return function(_0x5b4ef5){if(_0x5b4ef5){var _0x53f58c=typeof _0x3b00bd[_0xa378('0x2d')]===_0xa378('0x2e')&&typeof _0x3b00bd['limit']===_0xa378('0x2e');var _0x434d5f=_0x5b4ef5[_0xa378('0x2f')];var _0x208e5b=_0x53f58c?0x0:_0x3b00bd[_0xa378('0x2d')];var _0x3a6c53=_0x53f58c?_0x5b4ef5[_0xa378('0x2f')]:_0x3b00bd[_0xa378('0x2d')]+_0x3b00bd[_0xa378('0x30')];var _0x292613;if(_0x3a6c53>=_0x434d5f){_0x3a6c53=_0x434d5f;_0x292613=0xc8;}else{_0x292613=0xce;}_0x68b02c[_0xa378('0x2b')](_0x292613);return _0x68b02c[_0xa378('0x31')](_0xa378('0x32'),_0x208e5b+'-'+_0x3a6c53+'/'+_0x434d5f)[_0xa378('0x33')](_0x5b4ef5);}return null;};}function patchUpdates(_0xf2def9){return function(_0x467420){try{jsonpatch[_0xa378('0x34')](_0x467420,_0xf2def9,!![]);}catch(_0x5e960f){return BPromise[_0xa378('0x35')](_0x5e960f);}return _0x467420[_0xa378('0x36')]();};}function saveUpdates(_0x3e2090,_0x515d3c){return function(_0x58dbb3){if(_0x58dbb3){return _0x58dbb3[_0xa378('0x37')](_0x3e2090)[_0xa378('0x20')](function(_0x2283e1){return _0x2283e1;});}return null;};}function removeEntity(_0x566900,_0x3c6394){return function(_0x5812c9){if(_0x5812c9){return _0x5812c9[_0xa378('0x38')]()['then'](function(){var _0x5279ae=_0x5812c9['get']({'plain':!![]});var _0x40df22=_0xa378('0x39');return db[_0xa378('0x3a')]['destroy']({'where':{'type':_0x40df22,'resourceId':_0x5279ae['id']}})[_0xa378('0x20')](function(){return _0x5812c9;});})[_0xa378('0x20')](function(){_0x566900['status'](0xcc)[_0xa378('0x2c')]();});}};}function handleEntityNotFound(_0x4961cb,_0x3bfcef){return function(_0x4e9f2d){if(!_0x4e9f2d){_0x4961cb['sendStatus'](0x194);}return _0x4e9f2d;};}function handleError(_0xcffbd9,_0x297760){_0x297760=_0x297760||0x1f4;return function(_0x92102){logger[_0xa378('0x26')](_0x92102[_0xa378('0x3b')]);if(_0x92102['name']){delete _0x92102[_0xa378('0x3c')];}_0xcffbd9['status'](_0x297760)[_0xa378('0x3d')](_0x92102);};}exports[_0xa378('0x3e')]=function(_0x2b882f,_0x410be6){var _0x4a122b={'include':[{'model':db[_0xa378('0x3f')],'as':_0xa378('0x40')}]},_0x33e893={},_0x3590c6={'count':0x0,'rows':[]};var _0x15bc1e=_[_0xa378('0x41')](db[_0xa378('0x42')][_0xa378('0x43')],function(_0x12f6bc){return{'name':_0x12f6bc[_0xa378('0x44')],'type':_0x12f6bc[_0xa378('0x45')][_0xa378('0x46')]};});_0x33e893[_0xa378('0x47')]=_['map'](_0x15bc1e,_0xa378('0x3c'));_0x33e893[_0xa378('0x48')]=_[_0xa378('0x49')](_0x2b882f[_0xa378('0x48')]);_0x33e893['filters']=_[_0xa378('0x4a')](_0x33e893[_0xa378('0x47')],_0x33e893['query']);_0x4a122b[_0xa378('0x4b')]=_[_0xa378('0x4a')](_0x33e893['model'],qs[_0xa378('0x4c')](_0x2b882f[_0xa378('0x48')][_0xa378('0x4c')]));_0x4a122b[_0xa378('0x4b')]=_0x4a122b['attributes'][_0xa378('0x4d')]?_0x4a122b[_0xa378('0x4b')]:_0x33e893['model'];if(!_0x2b882f[_0xa378('0x48')]['hasOwnProperty'](_0xa378('0x4e'))){_0x4a122b['limit']=qs['limit'](_0x2b882f[_0xa378('0x48')][_0xa378('0x30')]);_0x4a122b[_0xa378('0x2d')]=qs['offset'](_0x2b882f['query'][_0xa378('0x2d')]);}_0x4a122b[_0xa378('0x4f')]=qs[_0xa378('0x50')](_0x2b882f[_0xa378('0x48')][_0xa378('0x50')]);_0x4a122b[_0xa378('0x51')]=qs['filters'](_['pick'](_0x2b882f['query'],_0x33e893[_0xa378('0x52')]),_0x15bc1e);if(_0x2b882f['query'][_0xa378('0x53')]){_0x4a122b[_0xa378('0x51')]=_[_0xa378('0x54')](_0x4a122b[_0xa378('0x51')],{'$or':_[_0xa378('0x41')](_0x15bc1e,function(_0x259328){if(_0x259328[_0xa378('0x45')]!==_0xa378('0x55')){var _0x172bfd={};_0x172bfd[_0x259328[_0xa378('0x3c')]]={'$like':'%'+_0x2b882f[_0xa378('0x48')][_0xa378('0x53')]+'%'};return _0x172bfd;}})});}_0x4a122b=_[_0xa378('0x54')]({},_0x4a122b,_0x2b882f[_0xa378('0x56')]);var _0x414e99={'where':_0x4a122b[_0xa378('0x51')]};return db[_0xa378('0x42')][_0xa378('0x2f')](_0x414e99)[_0xa378('0x20')](function(_0x39366f){_0x3590c6[_0xa378('0x2f')]=_0x39366f;if(_0x2b882f[_0xa378('0x48')][_0xa378('0x57')]){_0x4a122b[_0xa378('0x58')]=[{'all':!![]}];}return db[_0xa378('0x42')]['findAll'](_0x4a122b);})[_0xa378('0x20')](function(_0x14efa0){_0x3590c6[_0xa378('0x59')]=_0x14efa0;return _0x3590c6;})[_0xa378('0x20')](respondWithFilteredResult(_0x410be6,_0x4a122b))[_0xa378('0x2a')](handleError(_0x410be6,null));};exports['show']=function(_0x2c7be1,_0x347fe0){var _0x41f623={'raw':![],'where':{'id':_0x2c7be1['params']['id']},'include':[{'model':db[_0xa378('0x3f')],'as':_0xa378('0x40')}]},_0x3bf8d6={};_0x3bf8d6[_0xa378('0x47')]=_[_0xa378('0x49')](db[_0xa378('0x42')][_0xa378('0x43')]);_0x3bf8d6[_0xa378('0x48')]=_[_0xa378('0x49')](_0x2c7be1[_0xa378('0x48')]);_0x3bf8d6[_0xa378('0x52')]=_[_0xa378('0x4a')](_0x3bf8d6['model'],_0x3bf8d6['query']);_0x41f623[_0xa378('0x4b')]=_[_0xa378('0x4a')](_0x3bf8d6['model'],qs[_0xa378('0x4c')](_0x2c7be1[_0xa378('0x48')][_0xa378('0x4c')]));_0x41f623['attributes']=_0x41f623[_0xa378('0x4b')][_0xa378('0x4d')]?_0x41f623[_0xa378('0x4b')]:_0x3bf8d6['model'];if(_0x2c7be1[_0xa378('0x48')][_0xa378('0x57')]){_0x41f623[_0xa378('0x58')]=[{'all':!![]}];}_0x41f623=_[_0xa378('0x54')]({},_0x41f623,_0x2c7be1[_0xa378('0x56')]);return db[_0xa378('0x42')][_0xa378('0x5a')](_0x41f623)['then'](handleEntityNotFound(_0x347fe0,null))[_0xa378('0x20')](respondWithResult(_0x347fe0,null))['catch'](handleError(_0x347fe0,null));};exports[_0xa378('0x5b')]=function(_0xd92cee,_0x344bc9){return db['OpenchannelAccount'][_0xa378('0x5b')](_0xd92cee['body'],{})[_0xa378('0x20')](function(_0xe20f43){var _0x12e5b1=_0xd92cee[_0xa378('0x5c')][_0xa378('0x5d')]({'plain':!![]});if(!_0x12e5b1)throw new Error(_0xa378('0x5e'));if(_0x12e5b1['role']===_0xa378('0x5c')){var _0x406a1a=_0xe20f43['get']({'plain':!![]});var _0x52352e='OpenchannelAccounts';return db[_0xa378('0x5f')]['find']({'where':{'name':_0x52352e,'userProfileId':_0x12e5b1[_0xa378('0x60')]},'raw':!![]})[_0xa378('0x20')](function(_0x2970c6){if(_0x2970c6&&_0x2970c6[_0xa378('0x61')]===0x0){return db[_0xa378('0x3a')][_0xa378('0x5b')]({'name':_0x406a1a[_0xa378('0x3c')],'resourceId':_0x406a1a['id'],'type':_0x2970c6['name'],'sectionId':_0x2970c6['id']},{})['then'](function(){return _0xe20f43;});}else{return _0xe20f43;}})['catch'](function(_0x47d4bd){logger[_0xa378('0x26')](_0xa378('0x62'),_0x47d4bd);throw _0x47d4bd;});}return _0xe20f43;})[_0xa378('0x20')](respondWithResult(_0x344bc9,0xc9))[_0xa378('0x2a')](handleError(_0x344bc9,null));};exports[_0xa378('0x37')]=function(_0x2309a1,_0x16abc6){if(_0x2309a1[_0xa378('0x63')]['id']){delete _0x2309a1[_0xa378('0x63')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x2309a1[_0xa378('0x64')]['id']},'include':[{'model':db[_0xa378('0x3f')],'as':_0xa378('0x40')}]})[_0xa378('0x20')](handleEntityNotFound(_0x16abc6,null))['then'](saveUpdates(_0x2309a1['body'],null))['then'](respondWithResult(_0x16abc6,null))['catch'](handleError(_0x16abc6,null));};exports['destroy']=function(_0x235c3b,_0x7edf6b){return db[_0xa378('0x42')][_0xa378('0x5a')]({'where':{'id':_0x235c3b[_0xa378('0x64')]['id']}})['then'](handleEntityNotFound(_0x7edf6b,null))[_0xa378('0x20')](removeEntity(_0x7edf6b,null))[_0xa378('0x2a')](handleError(_0x7edf6b,null));};exports['describe']=function(_0x1ea8b3,_0x3b6d15){return db['OpenchannelAccount'][_0xa378('0x65')]()['then'](respondWithResult(_0x3b6d15,null))[_0xa378('0x2a')](handleError(_0x3b6d15,null));};exports[_0xa378('0x66')]=function(_0x518837,_0x2ac421,_0x41c9ed){if(_0x518837[_0xa378('0x63')]['id']){delete _0x518837['body']['id'];}return db[_0xa378('0x42')][_0xa378('0x5a')]({'where':{'id':_0x518837[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x2ac421,null))[_0xa378('0x20')](function(_0x210949){if(_0x210949){_0x518837['body'][_0xa378('0x67')]=_0x210949['id'];return db[_0xa378('0x68')]['create'](_0x518837[_0xa378('0x63')]);}})[_0xa378('0x20')](respondWithResult(_0x2ac421,null))[_0xa378('0x2a')](handleError(_0x2ac421,null));};exports['getDispositions']=function(_0x49a6fb,_0x244d2a,_0x26564a){var _0x27753f={'raw':![],'where':{}};var _0x2d4681={};var _0x594d22={'count':0x0,'rows':[]};return db[_0xa378('0x42')][_0xa378('0x69')]({'where':{'id':_0x49a6fb[_0xa378('0x64')]['id']}})['then'](handleEntityNotFound(_0x244d2a,null))['then'](function(_0x33fdfd){if(_0x33fdfd){_0x2d4681[_0xa378('0x47')]=_[_0xa378('0x49')](db['Disposition'][_0xa378('0x43')]);_0x2d4681[_0xa378('0x48')]=_[_0xa378('0x49')](_0x49a6fb[_0xa378('0x48')]);_0x2d4681[_0xa378('0x52')]=_[_0xa378('0x4a')](_0x2d4681[_0xa378('0x47')],_0x2d4681[_0xa378('0x48')]);_0x27753f['attributes']=_['intersection'](_0x2d4681[_0xa378('0x47')],qs['fields'](_0x49a6fb[_0xa378('0x48')][_0xa378('0x4c')]));_0x27753f[_0xa378('0x4b')]=_0x27753f[_0xa378('0x4b')]['length']?_0x27753f[_0xa378('0x4b')]:_0x2d4681[_0xa378('0x47')];if(!_0x49a6fb[_0xa378('0x48')]['hasOwnProperty']('nolimit')){_0x27753f[_0xa378('0x30')]=qs['limit'](_0x49a6fb[_0xa378('0x48')][_0xa378('0x30')]);_0x27753f['offset']=qs['offset'](_0x49a6fb[_0xa378('0x48')][_0xa378('0x2d')]);}_0x27753f[_0xa378('0x4f')]=qs[_0xa378('0x50')](_0x49a6fb['query'][_0xa378('0x50')]);_0x27753f[_0xa378('0x51')]=qs[_0xa378('0x52')](_[_0xa378('0x6a')](_0x49a6fb['query'],_0x2d4681[_0xa378('0x52')]));_0x27753f['where']['OpenchannelAccountId']=_0x33fdfd['id'];if(_0x49a6fb[_0xa378('0x48')]['filter']){_0x27753f[_0xa378('0x51')]=_[_0xa378('0x54')](_0x27753f[_0xa378('0x51')],{'$or':_[_0xa378('0x41')](_0x27753f[_0xa378('0x4b')],function(_0x4aaec1){var _0x4d3fb7={};_0x4d3fb7[_0x4aaec1]={'$like':'%'+_0x49a6fb['query'][_0xa378('0x53')]+'%'};return _0x4d3fb7;})});}_0x27753f=_[_0xa378('0x54')]({},_0x27753f,_0x49a6fb['options']);return db[_0xa378('0x68')][_0xa378('0x2f')]({'where':_0x27753f['where']})['then'](function(_0x3c4fa8){_0x594d22[_0xa378('0x2f')]=_0x3c4fa8;if(_0x49a6fb['query']['includeAll']){_0x27753f['include']=[{'all':!![]}];}return db['Disposition'][_0xa378('0x6b')](_0x27753f);})[_0xa378('0x20')](function(_0x20e88e){_0x594d22['rows']=_0x20e88e;return _0x594d22;});}})[_0xa378('0x20')](respondWithFilteredResult(_0x244d2a,_0x27753f))[_0xa378('0x2a')](handleError(_0x244d2a,null));};exports[_0xa378('0x6c')]=function(_0x5320b0,_0x4d97d1,_0x502f3b){return db['OpenchannelAccount'][_0xa378('0x5a')]({'where':{'id':_0x5320b0['params']['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x4d97d1,null))[_0xa378('0x20')](function(_0x144121){if(_0x144121){return _0x144121[_0xa378('0x6c')](_0x5320b0[_0xa378('0x48')][_0xa378('0x6d')]);}})['then'](respondWithStatusCode(_0x4d97d1,null))['catch'](handleError(_0x4d97d1,null));};exports['addAnswer']=function(_0x3d693a,_0x56b436,_0x25f42d){if(_0x3d693a[_0xa378('0x63')]['id']){delete _0x3d693a[_0xa378('0x63')]['id'];}return db[_0xa378('0x42')][_0xa378('0x5a')]({'where':{'id':_0x3d693a[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x56b436,null))['then'](function(_0x43e61e){if(_0x43e61e){_0x3d693a[_0xa378('0x63')]['OpenchannelAccountId']=_0x43e61e['id'];return db[_0xa378('0x6e')][_0xa378('0x5b')](_0x3d693a[_0xa378('0x63')]);}})[_0xa378('0x20')](respondWithResult(_0x56b436,null))[_0xa378('0x2a')](handleError(_0x56b436,null));};exports[_0xa378('0x6f')]=function(_0x300337,_0x373f7b,_0x46e87f){var _0x49227c={'raw':![],'where':{}};var _0x8ea62d={};var _0x2b1816={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa378('0x69')]({'where':{'id':_0x300337[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x373f7b,null))[_0xa378('0x20')](function(_0x13e0c7){if(_0x13e0c7){_0x8ea62d[_0xa378('0x47')]=_[_0xa378('0x49')](db[_0xa378('0x6e')][_0xa378('0x43')]);_0x8ea62d[_0xa378('0x48')]=_[_0xa378('0x49')](_0x300337[_0xa378('0x48')]);_0x8ea62d[_0xa378('0x52')]=_['intersection'](_0x8ea62d[_0xa378('0x47')],_0x8ea62d[_0xa378('0x48')]);_0x49227c[_0xa378('0x4b')]=_['intersection'](_0x8ea62d[_0xa378('0x47')],qs['fields'](_0x300337[_0xa378('0x48')][_0xa378('0x4c')]));_0x49227c[_0xa378('0x4b')]=_0x49227c[_0xa378('0x4b')]['length']?_0x49227c[_0xa378('0x4b')]:_0x8ea62d[_0xa378('0x47')];if(!_0x300337[_0xa378('0x48')][_0xa378('0x70')](_0xa378('0x4e'))){_0x49227c['limit']=qs[_0xa378('0x30')](_0x300337[_0xa378('0x48')]['limit']);_0x49227c[_0xa378('0x2d')]=qs[_0xa378('0x2d')](_0x300337[_0xa378('0x48')]['offset']);}_0x49227c[_0xa378('0x4f')]=qs[_0xa378('0x50')](_0x300337[_0xa378('0x48')][_0xa378('0x50')]);_0x49227c['where']=qs[_0xa378('0x52')](_['pick'](_0x300337[_0xa378('0x48')],_0x8ea62d[_0xa378('0x52')]));_0x49227c[_0xa378('0x51')][_0xa378('0x67')]=_0x13e0c7['id'];if(_0x300337[_0xa378('0x48')][_0xa378('0x53')]){_0x49227c['where']=_[_0xa378('0x54')](_0x49227c[_0xa378('0x51')],{'$or':_[_0xa378('0x41')](_0x49227c[_0xa378('0x4b')],function(_0x1ab588){var _0x320237={};_0x320237[_0x1ab588]={'$like':'%'+_0x300337['query'][_0xa378('0x53')]+'%'};return _0x320237;})});}_0x49227c=_['merge']({},_0x49227c,_0x300337['options']);return db['CannedAnswer'][_0xa378('0x2f')]({'where':_0x49227c[_0xa378('0x51')]})[_0xa378('0x20')](function(_0x1a8e0d){_0x2b1816[_0xa378('0x2f')]=_0x1a8e0d;if(_0x300337[_0xa378('0x48')][_0xa378('0x57')]){_0x49227c[_0xa378('0x58')]=[{'all':!![]}];}return db[_0xa378('0x6e')]['findAll'](_0x49227c);})[_0xa378('0x20')](function(_0xc9f435){_0x2b1816[_0xa378('0x59')]=_0xc9f435;return _0x2b1816;});}})[_0xa378('0x20')](respondWithFilteredResult(_0x373f7b,_0x49227c))[_0xa378('0x2a')](handleError(_0x373f7b,null));};exports['removeAnswers']=function(_0x38501f,_0x10ed9a,_0x38ef40){return db['OpenchannelAccount'][_0xa378('0x5a')]({'where':{'id':_0x38501f[_0xa378('0x64')]['id']}})['then'](handleEntityNotFound(_0x10ed9a,null))['then'](function(_0x424376){if(_0x424376){return _0x424376[_0xa378('0x71')](_0x38501f[_0xa378('0x48')][_0xa378('0x6d')]);}})[_0xa378('0x20')](respondWithStatusCode(_0x10ed9a,null))[_0xa378('0x2a')](handleError(_0x10ed9a,null));};exports['notify']=function(_0x163cbc,_0x240edb,_0x417900){var _0x323494={'body':_0x163cbc[_0xa378('0x63')],'channel':'openchannel'};var _0x5d87e1=[];var _0x5ceff5=[];var _0x399379={};var _0x5c7b74=![];return db[_0xa378('0x72')][_0xa378('0x65')]()[_0xa378('0x20')](function(_0x41f3d1){if(!_0x41f3d1){throw new db[(_0xa378('0x73'))]['ValidationError'](_0xa378('0x74'));}_0x5d87e1=_[_0xa378('0x75')](_[_0xa378('0x49')](_0x41f3d1),[_0xa378('0x76'),_0xa378('0x77')]);_0x5ceff5=_[_0xa378('0x75')](_[_0xa378('0x49')](_0x41f3d1),[_0xa378('0x76'),_0xa378('0x77'),_0xa378('0x78'),_0xa378('0x79')]);if(_0x163cbc[_0xa378('0x63')]['id']){delete _0x163cbc[_0xa378('0x63')]['id'];}if(_[_0xa378('0x7a')](_0x163cbc['body']['from'])){throw new db[(_0xa378('0x73'))][(_0xa378('0x7b'))](_0xa378('0x7c'));}if(_[_0xa378('0x7a')](_0x163cbc[_0xa378('0x63')][_0xa378('0x63')])||_0x163cbc[_0xa378('0x63')][_0xa378('0x63')]===''){throw new db[(_0xa378('0x73'))][(_0xa378('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa378('0x7a')](_0x163cbc[_0xa378('0x63')][_0xa378('0x7d')])){throw new db[(_0xa378('0x73'))][(_0xa378('0x7b'))](_0xa378('0x7e')+_0x5ceff5);}if(!_['includes'](_0x5ceff5,_0x163cbc[_0xa378('0x63')][_0xa378('0x7d')])){throw new db[(_0xa378('0x73'))][(_0xa378('0x7b'))](_0xa378('0x7f')+_0x5ceff5);}_0x399379[_0x163cbc[_0xa378('0x63')][_0xa378('0x7d')]]=_0x163cbc[_0xa378('0x63')][_0xa378('0x80')];})[_0xa378('0x20')](function(){return db['OpenchannelAccount'][_0xa378('0x5a')]({'where':{'id':_0x163cbc[_0xa378('0x64')]['id']},'include':[{'model':db[_0xa378('0x81')],'as':_0xa378('0x82'),'include':[{'model':db[_0xa378('0x72')],'as':_0xa378('0x83'),'where':_0x399379,'limit':0x1,'order':[['updatedAt',_0xa378('0x84')]]}]},{'model':db[_0xa378('0x85')],'as':_0xa378('0x86')}]});})[_0xa378('0x20')](handleEntityNotFound(_0x240edb,null))[_0xa378('0x20')](function(_0x2de68e){if(_0x2de68e&&_0x2de68e['List']){_0x323494['account']=_0x2de68e;_0x323494[_0xa378('0x87')]=_0x2de68e[_0xa378('0x86')];_0x323494[_0xa378('0x88')]=_0x2de68e[_0xa378('0x82')];_0x323494[_0xa378('0x87')]=_[_0xa378('0x89')](_0x323494['applications'],[_0xa378('0x8a')],[_0xa378('0x8b')]);if(_0x323494['account'][_0xa378('0x86')]){delete _0x323494[_0xa378('0x8c')]['Applications'];}if(_0x323494[_0xa378('0x8c')][_0xa378('0x82')]&&_0x323494[_0xa378('0x8c')]['List'][_0xa378('0x83')]['length']){return _0x323494['account'][_0xa378('0x82')]['Contacts'][0x0];}var _0x532a6a=_[_0xa378('0x19')](_0x163cbc[_0xa378('0x63')],{'firstName':_0x163cbc[_0xa378('0x63')][_0xa378('0x80')],'ListId':_0x2de68e[_0xa378('0x79')]});_0x532a6a[_0x163cbc[_0xa378('0x63')][_0xa378('0x7d')]]=_0x163cbc[_0xa378('0x63')]['from'];return db[_0xa378('0x72')]['create'](_0x532a6a,{'fields':_0x5d87e1,'raw':!![]});}})[_0xa378('0x20')](handleEntityNotFound(_0x240edb,null))['then'](function(_0x30677e){_0x323494['contact']=_0x30677e;if(_0x30677e){var _0x13f5fe={'ContactId':_0x30677e['id'],'OpenchannelAccountId':_0x163cbc[_0xa378('0x64')]['id'],'from':(_0x30677e[_0xa378('0x8d')]||'')+'\x20'+(_0x30677e[_0xa378('0x8e')]||'')};var _0x41feef={'OpenchannelAccountId':_0x163cbc['params']['id'],'closed':![]};if(_0x163cbc[_0xa378('0x63')][_0xa378('0x8f')]){_0x41feef[_0xa378('0x8f')]=_0x163cbc[_0xa378('0x63')]['threadId'];return db[_0xa378('0x90')][_0xa378('0x5a')]({'where':_0x41feef})[_0xa378('0x20')](function(_0x2c7460){if(_0x2c7460){return[_0x2c7460,![]];}_0x13f5fe[_0xa378('0x8f')]=_0x163cbc[_0xa378('0x63')][_0xa378('0x8f')];_0x13f5fe[_0xa378('0x91')]=_0x163cbc[_0xa378('0x63')][_0xa378('0x91')];return db[_0xa378('0x90')]['create'](_0x13f5fe)['then'](function(_0x7e3422){return[_0x7e3422,!![]];});});}else{_0x41feef[_0xa378('0x8f')]=null;}_0x41feef[_0xa378('0x92')]=_0x30677e['id'];return db[_0xa378('0x90')][_0xa378('0x5a')]({'where':_0x41feef})[_0xa378('0x20')](function(_0x118e00){if(_0x118e00){return[_0x118e00,![]];}return db[_0xa378('0x90')][_0xa378('0x5b')](_0x13f5fe)['then'](function(_0x2632a8){return[_0x2632a8,!![]];});});}})[_0xa378('0x93')](function(_0x6b3457,_0x510d70){if(_0x6b3457){_0x5c7b74=_0x510d70;if(!_0x510d70){var _0xe0b0c2={'from':(_0x323494[_0xa378('0x94')]['firstName']||'')+'\x20'+(_0x323494['contact'][_0xa378('0x8e')]||'')};if(_0x163cbc[_0xa378('0x63')][_0xa378('0x8f')]&&_0x163cbc[_0xa378('0x63')][_0xa378('0x95')]&&_0x163cbc[_0xa378('0x63')][_0xa378('0x8f')]!=_0x163cbc['body'][_0xa378('0x95')]){_0xe0b0c2[_0xa378('0x8f')]=_0x163cbc[_0xa378('0x63')][_0xa378('0x95')];}return _0x6b3457[_0xa378('0x37')](_0xe0b0c2);}else{return _0x6b3457;}}})[_0xa378('0x20')](function(_0x4b43d5){_0x323494[_0xa378('0x96')]=_0x4b43d5[_0xa378('0x5d')]({'plain':!![]});_0x323494['interaction'][_0xa378('0x97')]=_0x5c7b74;if(_0x323494[_0xa378('0x96')][_0xa378('0x97')]){if(_0x323494['account'][_0xa378('0x98')]){_0x323494['applications'][_0xa378('0x99')]({'id':0x0,'priority':_0x323494[_0xa378('0x87')][_0xa378('0x4d')]+0x1,'app':'close','appdata':_0xa378('0x9a'),'interval':_0xa378('0x9b')});}}return db['OpenchannelMessage']['create']({'body':_0x163cbc[_0xa378('0x63')]['body'],'OpenchannelAccountId':_0x163cbc[_0xa378('0x64')]['id'],'OpenchannelInteractionId':_0x4b43d5['id'],'direction':'in','ContactId':_0x323494['contact']['id'],'AttachmentId':_0x163cbc[_0xa378('0x63')][_0xa378('0x9c')]});})[_0xa378('0x20')](function(_0x350ada){_0x323494[_0xa378('0x28')]=_0x350ada;if(_0x323494['interaction'][_0xa378('0x9d')]){return db[_0xa378('0x9e')]['find']({'attributes':['id','name'],'where':{'id':_0x323494[_0xa378('0x96')][_0xa378('0x9d')]}})['then'](function(_0x5ac92e){if(_0x5ac92e){_0x323494[_0xa378('0x87')][_0xa378('0x9f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ac92e[_0xa378('0x3c')]+','+(_0x323494[_0xa378('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':_0xa378('0x9b')});_0x323494[_0xa378('0xa0')]=![];}return respondWithRpcPromise('Start',_0xa378('0xa1'),_0x323494);});}return respondWithRpcPromise(_0xa378('0xa2'),_0xa378('0xa1'),_0x323494);})[_0xa378('0x20')](function(_0x36fd27){respondWithRpcPromise(_0xa378('0xa3'),'EventManager',{'event':_0xa378('0xa4'),'message':_0x36fd27},client9002);return _0x36fd27;})[_0xa378('0x20')](respondWithResult(_0x240edb,null))[_0xa378('0x2a')](handleError(_0x240edb,null));};exports[_0xa378('0xa5')]=function(_0x2aa573,_0x1ee4c1,_0x506317){return db[_0xa378('0x42')][_0xa378('0x69')]({'where':{'id':_0x2aa573[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x1ee4c1,null))[_0xa378('0x20')](function(_0x50f045){if(_0x50f045){return db[_0xa378('0xa6')][_0xa378('0xa7')](function(_0x3d188b){return db[_0xa378('0x85')][_0xa378('0x38')]({'where':{'OpenchannelAccountId':_0x2aa573[_0xa378('0x64')]['id']},'transaction':_0x3d188b})[_0xa378('0x20')](function(_0x565971){var _0x1d9575=_[_0xa378('0x41')](_0x2aa573['body'],function(_0x519c3a){_0x519c3a[_0xa378('0x67')]=_0x2aa573[_0xa378('0x64')]['id'];return _0x519c3a;});return db[_0xa378('0x85')]['bulkCreate'](_0x1d9575,{'transaction':_0x3d188b});});})[_0xa378('0x20')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2aa573[_0xa378('0x64')]['id']},'order':_0xa378('0x8a')});});}})[_0xa378('0x20')](respondWithResult(_0x1ee4c1,null))[_0xa378('0x2a')](handleError(_0x1ee4c1,null));};exports['getApplications']=function(_0x243541,_0xf0a980,_0x4d2501){var _0x51146b={};var _0x5e6ea6={};var _0x29efcc;var _0x4d32e6;return db[_0xa378('0x42')][_0xa378('0x69')]({'where':{'id':_0x243541[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0xf0a980,null))[_0xa378('0x20')](function(_0x4450db){if(_0x4450db){_0x29efcc=_0x4450db;_0x5e6ea6[_0xa378('0x47')]=_['keys'](db[_0xa378('0x85')][_0xa378('0x43')]);_0x5e6ea6[_0xa378('0x48')]=_[_0xa378('0x49')](_0x243541[_0xa378('0x48')]);_0x5e6ea6['filters']=_[_0xa378('0x4a')](_0x5e6ea6[_0xa378('0x47')],_0x5e6ea6[_0xa378('0x48')]);_0x51146b[_0xa378('0x4b')]=_[_0xa378('0x4a')](_0x5e6ea6[_0xa378('0x47')],qs[_0xa378('0x4c')](_0x243541['query']['fields']));_0x51146b['attributes']=_0x51146b['attributes'][_0xa378('0x4d')]?_0x51146b[_0xa378('0x4b')]:_0x5e6ea6[_0xa378('0x47')];_0x51146b[_0xa378('0x4f')]=qs[_0xa378('0x50')](_0x243541['query']['sort']);_0x51146b[_0xa378('0x51')]=qs[_0xa378('0x52')](_['pick'](_0x243541[_0xa378('0x48')],_0x5e6ea6[_0xa378('0x52')]));if(_0x243541[_0xa378('0x48')][_0xa378('0x53')]){_0x51146b[_0xa378('0x51')]=_[_0xa378('0x54')](_0x51146b[_0xa378('0x51')],{'$or':_[_0xa378('0x41')](_0x51146b['attributes'],function(_0x3d7c25){var _0x4039f8={};_0x4039f8[_0x3d7c25]={'$like':'%'+_0x243541['query'][_0xa378('0x53')]+'%'};return _0x4039f8;})});}_0x51146b=_[_0xa378('0x54')]({},_0x51146b,_0x243541[_0xa378('0x56')]);return _0x29efcc['getApplications'](_0x51146b);}})[_0xa378('0x20')](function(_0x5f80a3){if(_0x5f80a3){_0x4d32e6=_0x5f80a3['length'];if(!_0x243541[_0xa378('0x48')]['hasOwnProperty']('nolimit')){_0x51146b[_0xa378('0x30')]=qs[_0xa378('0x30')](_0x243541['query']['limit']);_0x51146b[_0xa378('0x2d')]=qs[_0xa378('0x2d')](_0x243541['query'][_0xa378('0x2d')]);}return _0x29efcc[_0xa378('0xa8')](_0x51146b);}})['then'](function(_0x42e56a){if(_0x42e56a){return _0x42e56a?{'count':_0x4d32e6,'rows':_0x42e56a}:null;}})[_0xa378('0x20')](respondWithResult(_0xf0a980,null))['catch'](handleError(_0xf0a980,null));};exports[_0xa378('0xa9')]=function(_0x52e6c8,_0x5307a8,_0x14500c){var _0x389b44={'raw':![],'where':{}};var _0x35a52b={};var _0x319466={'count':0x0,'rows':[]};return db[_0xa378('0x42')][_0xa378('0x69')]({'where':{'id':_0x52e6c8[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x5307a8,null))[_0xa378('0x20')](function(_0x3bcad4){if(_0x3bcad4){_0x35a52b['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x35a52b['query']=_[_0xa378('0x49')](_0x52e6c8['query']);_0x35a52b[_0xa378('0x52')]=_[_0xa378('0x4a')](_0x35a52b[_0xa378('0x47')],_0x35a52b['query']);_0x389b44[_0xa378('0x4b')]=_[_0xa378('0x4a')](_0x35a52b[_0xa378('0x47')],qs['fields'](_0x52e6c8[_0xa378('0x48')][_0xa378('0x4c')]));_0x389b44[_0xa378('0x4b')]=_0x389b44['attributes']['length']?_0x389b44['attributes']:_0x35a52b[_0xa378('0x47')];if(!_0x52e6c8['query'][_0xa378('0x70')](_0xa378('0x4e'))){_0x389b44['limit']=qs[_0xa378('0x30')](_0x52e6c8[_0xa378('0x48')][_0xa378('0x30')]);_0x389b44['offset']=qs[_0xa378('0x2d')](_0x52e6c8[_0xa378('0x48')][_0xa378('0x2d')]);}_0x389b44[_0xa378('0x4f')]=qs['sort'](_0x52e6c8[_0xa378('0x48')]['sort']);_0x389b44[_0xa378('0x51')]=qs[_0xa378('0x52')](_[_0xa378('0x6a')](_0x52e6c8[_0xa378('0x48')],_0x35a52b[_0xa378('0x52')]));_0x389b44[_0xa378('0x51')][_0xa378('0x67')]=_0x3bcad4['id'];if(_0x52e6c8[_0xa378('0x48')][_0xa378('0x53')]){_0x389b44[_0xa378('0x51')]=_[_0xa378('0x54')](_0x389b44[_0xa378('0x51')],{'$or':_['map'](_0x389b44[_0xa378('0x4b')],function(_0x3bbd5f){var _0x3f71f3={};_0x3f71f3[_0x3bbd5f]={'$like':'%'+_0x52e6c8[_0xa378('0x48')][_0xa378('0x53')]+'%'};return _0x3f71f3;})});}_0x389b44=_[_0xa378('0x54')]({},_0x389b44,_0x52e6c8['options']);return db[_0xa378('0x90')]['count']({'where':_0x389b44['where']})[_0xa378('0x20')](function(_0x28de5f){_0x319466['count']=_0x28de5f;if(_0x52e6c8[_0xa378('0x48')][_0xa378('0x57')]){_0x389b44[_0xa378('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa378('0x9e')],'as':_0xa378('0xaa'),'attributes':[_0xa378('0x3c'),'fullname',_0xa378('0xab')],'required':![]},{'model':db[_0xa378('0xac')],'as':'Tags','attributes':['id','name',_0xa378('0xad')],'where':_0x52e6c8[_0xa378('0x48')][_0xa378('0xae')]?{'id':_0x52e6c8['query'][_0xa378('0xae')]}:undefined,'required':_0x52e6c8[_0xa378('0x48')][_0xa378('0xae')]?!![]:![]}];}return db[_0xa378('0x90')][_0xa378('0x6b')](_0x389b44);})[_0xa378('0x20')](function(_0x125a02){_0x319466[_0xa378('0x59')]=_0x125a02;return _0x319466;});}})[_0xa378('0x20')](respondWithFilteredResult(_0x5307a8,_0x389b44))[_0xa378('0x2a')](handleError(_0x5307a8,null));};exports[_0xa378('0xaf')]=function(_0x965e52,_0x20e867,_0x3adec9){return db[_0xa378('0x42')][_0xa378('0x5a')]({'where':{'id':_0x965e52[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x20e867,null))[_0xa378('0x20')](function(_0x13973c){if(_0x13973c){return _0x13973c[_0xa378('0xaf')](_0x965e52[_0xa378('0x63')][_0xa378('0x6d')],_['omit'](_0x965e52[_0xa378('0x63')],[_0xa378('0x6d'),'id'])||{})['spread'](function(_0x45784b){for(var _0x5cd076=0x0;_0x5cd076<_0x965e52[_0xa378('0x63')][_0xa378('0x6d')]['length'];_0x5cd076+=0x1){socket['emit'](_0xa378('0xb0'),{'UserId':Number(_0x965e52[_0xa378('0x63')][_0xa378('0x6d')][_0x5cd076]),'OpenchannelAccountId':Number(_0x965e52[_0xa378('0x64')]['id'])});}return _0x45784b;});}})['then'](respondWithResult(_0x20e867,null))[_0xa378('0x2a')](handleError(_0x20e867,null));};exports[_0xa378('0xb1')]=function(_0x27dc2c,_0x4dcfe0,_0x5e3e56){return db['OpenchannelAccount']['find']({'where':{'id':_0x27dc2c[_0xa378('0x64')]['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x4dcfe0,null))[_0xa378('0x20')](function(_0x2a22a2){if(_0x2a22a2){return _0x2a22a2[_0xa378('0xb1')](_0x27dc2c[_0xa378('0x48')][_0xa378('0x6d')])[_0xa378('0x20')](function(){if(_[_0xa378('0xb2')](_0x27dc2c['query'][_0xa378('0x6d')])){for(var _0x5e4cc4=0x0;_0x5e4cc4<_0x27dc2c[_0xa378('0x48')]['ids'][_0xa378('0x4d')];_0x5e4cc4+=0x1){socket[_0xa378('0xb3')](_0xa378('0xb4'),{'UserId':Number(_0x27dc2c['query'][_0xa378('0x6d')][_0x5e4cc4]),'OpenchannelAccountId':Number(_0x27dc2c[_0xa378('0x64')]['id'])});}}else{socket[_0xa378('0xb3')](_0xa378('0xb4'),{'UserId':Number(_0x27dc2c[_0xa378('0x48')]['ids']),'OpenchannelAccountId':Number(_0x27dc2c[_0xa378('0x64')]['id'])});}});}})[_0xa378('0x20')](respondWithStatusCode(_0x4dcfe0,null))['catch'](handleError(_0x4dcfe0,null));};exports[_0xa378('0xb5')]=function(_0x2029cd,_0xdbde9e,_0x431078){var _0x932cf={};var _0x5bb7e3={};var _0x1969d9;var _0x42e654;return db[_0xa378('0x42')][_0xa378('0x69')]({'where':{'id':_0x2029cd[_0xa378('0x64')]['id']}})['then'](handleEntityNotFound(_0xdbde9e,null))[_0xa378('0x20')](function(_0x2bebc8){if(_0x2bebc8){_0x1969d9=_0x2bebc8;_0x5bb7e3['model']=_[_0xa378('0x49')](db[_0xa378('0x9e')]['rawAttributes']);_0x5bb7e3[_0xa378('0x48')]=_[_0xa378('0x49')](_0x2029cd['query']);_0x5bb7e3[_0xa378('0x52')]=_[_0xa378('0x4a')](_0x5bb7e3[_0xa378('0x47')],_0x5bb7e3[_0xa378('0x48')]);_0x932cf[_0xa378('0x4b')]=_[_0xa378('0x4a')](_0x5bb7e3[_0xa378('0x47')],qs[_0xa378('0x4c')](_0x2029cd[_0xa378('0x48')][_0xa378('0x4c')]));_0x932cf[_0xa378('0x4b')]=_0x932cf[_0xa378('0x4b')][_0xa378('0x4d')]?_0x932cf[_0xa378('0x4b')]:_0x5bb7e3[_0xa378('0x47')];_0x932cf[_0xa378('0x4f')]=qs['sort'](_0x2029cd[_0xa378('0x48')][_0xa378('0x50')]);_0x932cf[_0xa378('0x51')]=qs[_0xa378('0x52')](_['pick'](_0x2029cd[_0xa378('0x48')],_0x5bb7e3[_0xa378('0x52')]));if(_0x2029cd[_0xa378('0x48')]['filter']){_0x932cf[_0xa378('0x51')]=_[_0xa378('0x54')](_0x932cf[_0xa378('0x51')],{'$or':_[_0xa378('0x41')](_0x932cf[_0xa378('0x4b')],function(_0x5be411){var _0x3b08b7={};_0x3b08b7[_0x5be411]={'$like':'%'+_0x2029cd['query'][_0xa378('0x53')]+'%'};return _0x3b08b7;})});}_0x932cf=_[_0xa378('0x54')]({},_0x932cf,_0x2029cd['options']);return _0x1969d9['getAgents'](_0x932cf);}})[_0xa378('0x20')](function(_0x255684){if(_0x255684){_0x42e654=_0x255684['length'];if(!_0x2029cd[_0xa378('0x48')][_0xa378('0x70')](_0xa378('0x4e'))){_0x932cf[_0xa378('0x30')]=qs['limit'](_0x2029cd[_0xa378('0x48')][_0xa378('0x30')]);_0x932cf['offset']=qs[_0xa378('0x2d')](_0x2029cd[_0xa378('0x48')][_0xa378('0x2d')]);}return _0x1969d9[_0xa378('0xb5')](_0x932cf);}})['then'](function(_0x20aeb8){if(_0x20aeb8){return _0x20aeb8?{'count':_0x42e654,'rows':_0x20aeb8}:null;}})[_0xa378('0x20')](respondWithResult(_0xdbde9e,null))[_0xa378('0x2a')](handleError(_0xdbde9e,null));};exports[_0xa378('0x3d')]=function(_0x248187,_0x79722a,_0x1f6f5e){var _0x21e663,_0x3f608a,_0x58de19;if(_[_0xa378('0x7a')](_0x248187[_0xa378('0x63')][_0xa378('0x63')])||_0x248187['body'][_0xa378('0x63')]===''){throw new db['Sequelize'][(_0xa378('0x7b'))](_0xa378('0xb6'));}if(_[_0xa378('0x7a')](_0x248187[_0xa378('0x63')]['to'])){}_0x21e663=_0x248187['body']['to'];return db[_0xa378('0x42')]['findOne']({'where':{'id':_0x248187['params']['id']}})[_0xa378('0x20')](handleEntityNotFound(_0x79722a,null))[_0xa378('0x20')](function(_0x4c9fc6){if(_0x4c9fc6){return db['OpenchannelAccount'][_0xa378('0x5a')]({'where':{'id':_0x4c9fc6['id']},'include':[{'model':db[_0xa378('0x81')],'as':_0xa378('0x82'),'include':[{'model':db['CmContact'],'as':_0xa378('0x83'),'where':{[_0x4c9fc6[_0xa378('0x7d')]]:_0x21e663},'limit':0x1,'order':[[_0xa378('0x77'),_0xa378('0x84')]]}]}]})['then'](handleEntityNotFound(_0x79722a,null))[_0xa378('0x20')](function(_0x8bbc19){if(_0x8bbc19&&_0x8bbc19[_0xa378('0x82')]){_0x3f608a=_0x8bbc19['get']({'plain':!![]});if(_0x3f608a[_0xa378('0x82')]&&_0x3f608a['List'][_0xa378('0x83')]['length']){return _0x3f608a[_0xa378('0x82')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0xa378('0x19')](_0x248187[_0xa378('0x63')],{'firstName':_0x21e663,[_0x8bbc19[_0xa378('0x7d')]]:_0x21e663,'phone':_0x21e663,'ListId':_0x3f608a['ListId']}));}})[_0xa378('0x20')](handleEntityNotFound(_0x79722a,null))[_0xa378('0x20')](function(_0x3471e3){if(_0x3471e3){_0x58de19=_0x3471e3;return db[_0xa378('0x90')]['find']({'where':{'ContactId':_0x58de19['id'],'closed':![],'OpenchannelAccountId':_0x3f608a['id']}})['then'](function(_0x5973e1){if(_0x5973e1){return[_0x5973e1,![]];}return db[_0xa378('0x90')][_0xa378('0x5b')]({'UserId':_0x248187[_0xa378('0x5c')]['id'],'ContactId':_0x58de19['id'],'OpenchannelAccountId':_0x3f608a['id'],'lastMsgDirection':_0xa378('0xb7'),'Messages':[_[_0xa378('0x54')](_0x248187['body'],{'read':![],'body':_0x248187[_0xa378('0x63')][_0xa378('0x63')],'OpenchannelAccountId':_0x3f608a['id'],'UserId':_0x248187[_0xa378('0x5c')]['id'],'ContactId':_0x58de19['id']})]},{'include':[{'model':db[_0xa378('0xb8')],'as':_0xa378('0xb9')}]})['then'](function(_0x5f1209){return[_0x5f1209,!![]];});});}})['spread'](function(_0x42a8c0,_0x537d51){if(_0x537d51){return _0x42a8c0;}return db['OpenchannelMessage'][_0xa378('0x5b')](_[_0xa378('0x54')](_0x248187[_0xa378('0x63')],{'read':![],'body':_0x248187[_0xa378('0x63')][_0xa378('0x63')],'OpenchannelAccountId':_0x3f608a['id'],'OpenchannelInteractionId':_0x42a8c0['id'],'UserId':_0x248187[_0xa378('0x5c')]['id'],'ContactId':_0x58de19['id']}))[_0xa378('0x20')](function(_0x205191){_0x42a8c0[_0xa378('0xba')][_0xa378('0xb9')]=[];_0x42a8c0['dataValues'][_0xa378('0xb9')][_0xa378('0x99')](_0x205191[_0xa378('0xba')]);return _0x42a8c0;});});}})[_0xa378('0x20')](respondWithResult(_0x79722a,null))['catch'](handleError(_0x79722a,null));}; \ No newline at end of file +var _0x7e28=['mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','account','applications','Applications','orderBy','priority','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','OpenchannelApplication','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x7e28,0x1c3));var _0x87e2=function(_0x1919ef,_0x4d7689){_0x1919ef=_0x1919ef-0x0;var _0x50217e=_0x7e28[_0x1919ef];return _0x50217e;};'use strict';var emlformat=require(_0x87e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87e2('0x1'));var jsonpatch=require(_0x87e2('0x2'));var rp=require(_0x87e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87e2('0x4'));var util=require(_0x87e2('0x5'));var path=require(_0x87e2('0x6'));var sox=require('sox');var csv=require(_0x87e2('0x7'));var ejs=require(_0x87e2('0x8'));var fs=require('fs');var fs_extra=require(_0x87e2('0x9'));var _=require(_0x87e2('0xa'));var squel=require(_0x87e2('0xb'));var crypto=require(_0x87e2('0xc'));var jsforce=require(_0x87e2('0xd'));var deskjs=require(_0x87e2('0xe'));var toCsv=require(_0x87e2('0x7'));var querystring=require(_0x87e2('0xf'));var Papa=require(_0x87e2('0x10'));var Redis=require(_0x87e2('0x11'));var authService=require(_0x87e2('0x12'));var qs=require(_0x87e2('0x13'));var as=require(_0x87e2('0x14'));var hardwareService=require(_0x87e2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x87e2('0x16'));var config=require(_0x87e2('0x17'));var licenseUtil=require(_0x87e2('0x18'));var db=require(_0x87e2('0x19'))['db'];config[_0x87e2('0x1a')]=_[_0x87e2('0x1b')](config[_0x87e2('0x1a')],{'host':_0x87e2('0x1c'),'port':0x18eb});var socket=require(_0x87e2('0x1d'))(new Redis(config[_0x87e2('0x1a')]));require(_0x87e2('0x1e'))['register'](socket);var jayson=require(_0x87e2('0x1f'));var client=jayson[_0x87e2('0x20')][_0x87e2('0x21')]({'port':0x232c});var client9002=jayson[_0x87e2('0x20')][_0x87e2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x36bd39,_0xeea76c,_0x15d96c,_0x1e3bf8){return new BPromise(function(_0x4785e9,_0x1929cb){var _0x3e4f51=_0x1e3bf8||client;return _0x3e4f51[_0x87e2('0x22')](_0x36bd39,_0x15d96c)[_0x87e2('0x23')](function(_0x4a0fbc){logger[_0x87e2('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0xeea76c,_0x87e2('0x25'));logger[_0x87e2('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xeea76c,'request\x20sent',JSON['stringify'](_0x4a0fbc));if(_0x4a0fbc[_0x87e2('0x27')]){if(_0x4a0fbc[_0x87e2('0x27')]['code']===0x1f4){logger[_0x87e2('0x27')](_0x87e2('0x28'),_0xeea76c,_0x4a0fbc[_0x87e2('0x27')][_0x87e2('0x29')]);return _0x1929cb(_0x4a0fbc[_0x87e2('0x27')]['message']);}logger['error'](_0x87e2('0x28'),_0xeea76c,_0x4a0fbc[_0x87e2('0x27')][_0x87e2('0x29')]);return _0x4785e9(_0x4a0fbc['error'][_0x87e2('0x29')]);}else{logger[_0x87e2('0x24')](_0x87e2('0x28'),_0xeea76c,_0x87e2('0x25'));_0x4785e9(_0x4a0fbc[_0x87e2('0x2a')]['message']);}})[_0x87e2('0x2b')](function(_0x5d6c1c){logger[_0x87e2('0x27')](_0x87e2('0x28'),_0xeea76c,_0x5d6c1c);_0x1929cb(_0x5d6c1c);});});}function respondWithStatusCode(_0x11f783,_0x59594e){_0x59594e=_0x59594e||0xcc;return function(_0x192609){if(_0x192609){return _0x11f783[_0x87e2('0x2c')](_0x59594e);}return _0x11f783[_0x87e2('0x2d')](_0x59594e)[_0x87e2('0x2e')]();};}function respondWithResult(_0x37347a,_0x2328b8){_0x2328b8=_0x2328b8||0xc8;return function(_0x2933af){if(_0x2933af){return _0x37347a[_0x87e2('0x2d')](_0x2328b8)[_0x87e2('0x2f')](_0x2933af);}};}function respondWithFilteredResult(_0x135f98,_0x1cb4c6){return function(_0xc56b0b){if(_0xc56b0b){var _0x14ae12=typeof _0x1cb4c6[_0x87e2('0x30')]===_0x87e2('0x31')&&typeof _0x1cb4c6[_0x87e2('0x32')]==='undefined';var _0x1ffcc2=_0xc56b0b['count'];var _0xab6970=_0x14ae12?0x0:_0x1cb4c6[_0x87e2('0x30')];var _0x1be37d=_0x14ae12?_0xc56b0b['count']:_0x1cb4c6['offset']+_0x1cb4c6[_0x87e2('0x32')];var _0x419c44;if(_0x1be37d>=_0x1ffcc2){_0x1be37d=_0x1ffcc2;_0x419c44=0xc8;}else{_0x419c44=0xce;}_0x135f98['status'](_0x419c44);return _0x135f98[_0x87e2('0x33')](_0x87e2('0x34'),_0xab6970+'-'+_0x1be37d+'/'+_0x1ffcc2)['json'](_0xc56b0b);}return null;};}function patchUpdates(_0x5e77b5){return function(_0x41c988){try{jsonpatch[_0x87e2('0x35')](_0x41c988,_0x5e77b5,!![]);}catch(_0x45c5bb){return BPromise[_0x87e2('0x36')](_0x45c5bb);}return _0x41c988[_0x87e2('0x37')]();};}function saveUpdates(_0x5122f6,_0x5ef48d){return function(_0xe9fcc5){if(_0xe9fcc5){return _0xe9fcc5['update'](_0x5122f6)[_0x87e2('0x23')](function(_0x4cc88a){return _0x4cc88a;});}return null;};}function removeEntity(_0x3f107f,_0x3c59c2){return function(_0x412d04){if(_0x412d04){return _0x412d04[_0x87e2('0x38')]()['then'](function(){var _0x4c94f6=_0x412d04[_0x87e2('0x39')]({'plain':!![]});var _0x21a487='OpenchannelAccounts';return db[_0x87e2('0x3a')]['destroy']({'where':{'type':_0x21a487,'resourceId':_0x4c94f6['id']}})[_0x87e2('0x23')](function(){return _0x412d04;});})[_0x87e2('0x23')](function(){_0x3f107f[_0x87e2('0x2d')](0xcc)[_0x87e2('0x2e')]();});}};}function handleEntityNotFound(_0x1cda88,_0x3fde39){return function(_0x594d07){if(!_0x594d07){_0x1cda88[_0x87e2('0x2c')](0x194);}return _0x594d07;};}function handleError(_0x939439,_0x3a8de5){_0x3a8de5=_0x3a8de5||0x1f4;return function(_0xa18549){logger[_0x87e2('0x27')](_0xa18549[_0x87e2('0x3b')]);if(_0xa18549['name']){delete _0xa18549[_0x87e2('0x3c')];}_0x939439[_0x87e2('0x2d')](_0x3a8de5)[_0x87e2('0x3d')](_0xa18549);};}exports[_0x87e2('0x3e')]=function(_0x5eeeae,_0x117a5c){var _0x32f92e={'include':[{'model':db[_0x87e2('0x3f')],'as':_0x87e2('0x40')}]},_0x51e57a={},_0x2c666f={'count':0x0,'rows':[]};var _0x549f1b=_[_0x87e2('0x41')](db[_0x87e2('0x42')]['rawAttributes'],function(_0x2b1500){return{'name':_0x2b1500[_0x87e2('0x43')],'type':_0x2b1500[_0x87e2('0x44')][_0x87e2('0x45')]};});_0x51e57a[_0x87e2('0x46')]=_[_0x87e2('0x41')](_0x549f1b,'name');_0x51e57a[_0x87e2('0x47')]=_[_0x87e2('0x48')](_0x5eeeae[_0x87e2('0x47')]);_0x51e57a[_0x87e2('0x49')]=_[_0x87e2('0x4a')](_0x51e57a['model'],_0x51e57a[_0x87e2('0x47')]);_0x32f92e[_0x87e2('0x4b')]=_['intersection'](_0x51e57a['model'],qs[_0x87e2('0x4c')](_0x5eeeae[_0x87e2('0x47')][_0x87e2('0x4c')]));_0x32f92e[_0x87e2('0x4b')]=_0x32f92e[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x32f92e[_0x87e2('0x4b')]:_0x51e57a[_0x87e2('0x46')];if(!_0x5eeeae[_0x87e2('0x47')][_0x87e2('0x4e')](_0x87e2('0x4f'))){_0x32f92e[_0x87e2('0x32')]=qs[_0x87e2('0x32')](_0x5eeeae[_0x87e2('0x47')][_0x87e2('0x32')]);_0x32f92e[_0x87e2('0x30')]=qs[_0x87e2('0x30')](_0x5eeeae['query'][_0x87e2('0x30')]);}_0x32f92e[_0x87e2('0x50')]=qs[_0x87e2('0x51')](_0x5eeeae[_0x87e2('0x47')][_0x87e2('0x51')]);_0x32f92e[_0x87e2('0x52')]=qs[_0x87e2('0x49')](_[_0x87e2('0x53')](_0x5eeeae[_0x87e2('0x47')],_0x51e57a['filters']),_0x549f1b);if(_0x5eeeae[_0x87e2('0x47')]['filter']){_0x32f92e[_0x87e2('0x52')]=_[_0x87e2('0x54')](_0x32f92e[_0x87e2('0x52')],{'$or':_[_0x87e2('0x41')](_0x549f1b,function(_0x3a57dd){if(_0x3a57dd['type']!==_0x87e2('0x55')){var _0x42cd03={};_0x42cd03[_0x3a57dd[_0x87e2('0x3c')]]={'$like':'%'+_0x5eeeae['query'][_0x87e2('0x56')]+'%'};return _0x42cd03;}})});}_0x32f92e=_['merge']({},_0x32f92e,_0x5eeeae[_0x87e2('0x57')]);var _0x4e462a={'where':_0x32f92e['where']};return db['OpenchannelAccount'][_0x87e2('0x58')](_0x4e462a)[_0x87e2('0x23')](function(_0x45448c){_0x2c666f['count']=_0x45448c;if(_0x5eeeae[_0x87e2('0x47')]['includeAll']){_0x32f92e[_0x87e2('0x59')]=[{'all':!![]}];}return db[_0x87e2('0x42')][_0x87e2('0x5a')](_0x32f92e);})[_0x87e2('0x23')](function(_0x57af74){_0x2c666f['rows']=_0x57af74;return _0x2c666f;})['then'](respondWithFilteredResult(_0x117a5c,_0x32f92e))['catch'](handleError(_0x117a5c,null));};exports[_0x87e2('0x5b')]=function(_0x36ec8c,_0x770d75){var _0x179ff={'raw':![],'where':{'id':_0x36ec8c['params']['id']},'include':[{'model':db[_0x87e2('0x3f')],'as':_0x87e2('0x40')}]},_0x2453fb={};_0x2453fb[_0x87e2('0x46')]=_[_0x87e2('0x48')](db[_0x87e2('0x42')][_0x87e2('0x5c')]);_0x2453fb[_0x87e2('0x47')]=_[_0x87e2('0x48')](_0x36ec8c[_0x87e2('0x47')]);_0x2453fb[_0x87e2('0x49')]=_[_0x87e2('0x4a')](_0x2453fb[_0x87e2('0x46')],_0x2453fb['query']);_0x179ff['attributes']=_[_0x87e2('0x4a')](_0x2453fb[_0x87e2('0x46')],qs[_0x87e2('0x4c')](_0x36ec8c['query']['fields']));_0x179ff[_0x87e2('0x4b')]=_0x179ff[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x179ff[_0x87e2('0x4b')]:_0x2453fb['model'];if(_0x36ec8c['query'][_0x87e2('0x5d')]){_0x179ff[_0x87e2('0x59')]=[{'all':!![]}];}_0x179ff=_['merge']({},_0x179ff,_0x36ec8c['options']);return db[_0x87e2('0x42')][_0x87e2('0x5e')](_0x179ff)[_0x87e2('0x23')](handleEntityNotFound(_0x770d75,null))[_0x87e2('0x23')](respondWithResult(_0x770d75,null))[_0x87e2('0x2b')](handleError(_0x770d75,null));};exports[_0x87e2('0x5f')]=function(_0x5e941b,_0xba6df3){return db[_0x87e2('0x42')]['create'](_0x5e941b[_0x87e2('0x60')],{})['then'](function(_0x4b8fa8){var _0x38f17f=_0x5e941b[_0x87e2('0x61')][_0x87e2('0x39')]({'plain':!![]});if(!_0x38f17f)throw new Error(_0x87e2('0x62'));if(_0x38f17f[_0x87e2('0x63')]===_0x87e2('0x61')){var _0x514cd4=_0x4b8fa8[_0x87e2('0x39')]({'plain':!![]});var _0x36ec9b=_0x87e2('0x64');return db[_0x87e2('0x65')][_0x87e2('0x5e')]({'where':{'name':_0x36ec9b,'userProfileId':_0x38f17f[_0x87e2('0x66')]},'raw':!![]})[_0x87e2('0x23')](function(_0x59a2ba){if(_0x59a2ba&&_0x59a2ba[_0x87e2('0x67')]===0x0){return db['UserProfileResource']['create']({'name':_0x514cd4['name'],'resourceId':_0x514cd4['id'],'type':_0x59a2ba[_0x87e2('0x3c')],'sectionId':_0x59a2ba['id']},{})[_0x87e2('0x23')](function(){return _0x4b8fa8;});}else{return _0x4b8fa8;}})[_0x87e2('0x2b')](function(_0x3cdd0b){logger[_0x87e2('0x27')](_0x87e2('0x68'),_0x3cdd0b);throw _0x3cdd0b;});}return _0x4b8fa8;})[_0x87e2('0x23')](respondWithResult(_0xba6df3,0xc9))[_0x87e2('0x2b')](handleError(_0xba6df3,null));};exports[_0x87e2('0x69')]=function(_0x10234d,_0x2939cc){if(_0x10234d[_0x87e2('0x60')]['id']){delete _0x10234d[_0x87e2('0x60')]['id'];}return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x10234d['params']['id']},'include':[{'model':db[_0x87e2('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x87e2('0x23')](handleEntityNotFound(_0x2939cc,null))[_0x87e2('0x23')](saveUpdates(_0x10234d[_0x87e2('0x60')],null))['then'](respondWithResult(_0x2939cc,null))['catch'](handleError(_0x2939cc,null));};exports[_0x87e2('0x38')]=function(_0x5794ec,_0x2a0dca){return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x5794ec[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x2a0dca,null))['then'](removeEntity(_0x2a0dca,null))['catch'](handleError(_0x2a0dca,null));};exports[_0x87e2('0x6b')]=function(_0x56ed42,_0x4beea1){return db[_0x87e2('0x42')][_0x87e2('0x6b')]()[_0x87e2('0x23')](respondWithResult(_0x4beea1,null))[_0x87e2('0x2b')](handleError(_0x4beea1,null));};exports['addDisposition']=function(_0x287c3d,_0x1401d1,_0x3a5c96){if(_0x287c3d[_0x87e2('0x60')]['id']){delete _0x287c3d['body']['id'];}return db['OpenchannelAccount'][_0x87e2('0x5e')]({'where':{'id':_0x287c3d[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x1401d1,null))[_0x87e2('0x23')](function(_0x550a94){if(_0x550a94){_0x287c3d[_0x87e2('0x60')][_0x87e2('0x6c')]=_0x550a94['id'];return db[_0x87e2('0x6d')][_0x87e2('0x5f')](_0x287c3d[_0x87e2('0x60')]);}})[_0x87e2('0x23')](respondWithResult(_0x1401d1,null))['catch'](handleError(_0x1401d1,null));};exports[_0x87e2('0x6e')]=function(_0x256b9c,_0x57e5e7,_0x119502){var _0x10c317={'raw':![],'where':{}};var _0x2d4908={};var _0x2a6cce={'count':0x0,'rows':[]};return db[_0x87e2('0x42')][_0x87e2('0x6f')]({'where':{'id':_0x256b9c[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x57e5e7,null))[_0x87e2('0x23')](function(_0x435a56){if(_0x435a56){_0x2d4908[_0x87e2('0x46')]=_[_0x87e2('0x48')](db[_0x87e2('0x6d')][_0x87e2('0x5c')]);_0x2d4908[_0x87e2('0x47')]=_['keys'](_0x256b9c[_0x87e2('0x47')]);_0x2d4908[_0x87e2('0x49')]=_[_0x87e2('0x4a')](_0x2d4908['model'],_0x2d4908[_0x87e2('0x47')]);_0x10c317[_0x87e2('0x4b')]=_[_0x87e2('0x4a')](_0x2d4908[_0x87e2('0x46')],qs[_0x87e2('0x4c')](_0x256b9c['query'][_0x87e2('0x4c')]));_0x10c317['attributes']=_0x10c317[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x10c317[_0x87e2('0x4b')]:_0x2d4908[_0x87e2('0x46')];if(!_0x256b9c[_0x87e2('0x47')][_0x87e2('0x4e')](_0x87e2('0x4f'))){_0x10c317[_0x87e2('0x32')]=qs['limit'](_0x256b9c[_0x87e2('0x47')][_0x87e2('0x32')]);_0x10c317[_0x87e2('0x30')]=qs['offset'](_0x256b9c[_0x87e2('0x47')][_0x87e2('0x30')]);}_0x10c317[_0x87e2('0x50')]=qs[_0x87e2('0x51')](_0x256b9c[_0x87e2('0x47')][_0x87e2('0x51')]);_0x10c317[_0x87e2('0x52')]=qs[_0x87e2('0x49')](_[_0x87e2('0x53')](_0x256b9c[_0x87e2('0x47')],_0x2d4908[_0x87e2('0x49')]));_0x10c317[_0x87e2('0x52')][_0x87e2('0x6c')]=_0x435a56['id'];if(_0x256b9c['query'][_0x87e2('0x56')]){_0x10c317[_0x87e2('0x52')]=_[_0x87e2('0x54')](_0x10c317[_0x87e2('0x52')],{'$or':_[_0x87e2('0x41')](_0x10c317[_0x87e2('0x4b')],function(_0x551fab){var _0x5bab92={};_0x5bab92[_0x551fab]={'$like':'%'+_0x256b9c['query'][_0x87e2('0x56')]+'%'};return _0x5bab92;})});}_0x10c317=_[_0x87e2('0x54')]({},_0x10c317,_0x256b9c[_0x87e2('0x57')]);return db[_0x87e2('0x6d')][_0x87e2('0x58')]({'where':_0x10c317[_0x87e2('0x52')]})[_0x87e2('0x23')](function(_0x518a95){_0x2a6cce[_0x87e2('0x58')]=_0x518a95;if(_0x256b9c[_0x87e2('0x47')][_0x87e2('0x5d')]){_0x10c317[_0x87e2('0x59')]=[{'all':!![]}];}return db[_0x87e2('0x6d')]['findAll'](_0x10c317);})[_0x87e2('0x23')](function(_0x48de84){_0x2a6cce[_0x87e2('0x70')]=_0x48de84;return _0x2a6cce;});}})[_0x87e2('0x23')](respondWithFilteredResult(_0x57e5e7,_0x10c317))[_0x87e2('0x2b')](handleError(_0x57e5e7,null));};exports[_0x87e2('0x71')]=function(_0x40caa4,_0x2491d1,_0x2d4a11){return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x40caa4['params']['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x2491d1,null))['then'](function(_0x187ebd){if(_0x187ebd){return _0x187ebd[_0x87e2('0x71')](_0x40caa4[_0x87e2('0x47')][_0x87e2('0x72')]);}})['then'](respondWithStatusCode(_0x2491d1,null))[_0x87e2('0x2b')](handleError(_0x2491d1,null));};exports[_0x87e2('0x73')]=function(_0x29d6c0,_0x2ba803,_0x362b04){if(_0x29d6c0[_0x87e2('0x60')]['id']){delete _0x29d6c0['body']['id'];}return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x29d6c0['params']['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x2ba803,null))[_0x87e2('0x23')](function(_0x2469ac){if(_0x2469ac){_0x29d6c0[_0x87e2('0x60')][_0x87e2('0x6c')]=_0x2469ac['id'];return db['CannedAnswer'][_0x87e2('0x5f')](_0x29d6c0['body']);}})['then'](respondWithResult(_0x2ba803,null))['catch'](handleError(_0x2ba803,null));};exports[_0x87e2('0x74')]=function(_0x4b7709,_0x41a83d,_0x4f051b){var _0x184a6f={'raw':![],'where':{}};var _0x1bb228={};var _0x2d4985={'count':0x0,'rows':[]};return db[_0x87e2('0x42')][_0x87e2('0x6f')]({'where':{'id':_0x4b7709[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x41a83d,null))[_0x87e2('0x23')](function(_0x45d5a4){if(_0x45d5a4){_0x1bb228['model']=_['keys'](db[_0x87e2('0x75')][_0x87e2('0x5c')]);_0x1bb228[_0x87e2('0x47')]=_[_0x87e2('0x48')](_0x4b7709[_0x87e2('0x47')]);_0x1bb228['filters']=_[_0x87e2('0x4a')](_0x1bb228[_0x87e2('0x46')],_0x1bb228['query']);_0x184a6f['attributes']=_[_0x87e2('0x4a')](_0x1bb228[_0x87e2('0x46')],qs[_0x87e2('0x4c')](_0x4b7709['query']['fields']));_0x184a6f[_0x87e2('0x4b')]=_0x184a6f[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x184a6f[_0x87e2('0x4b')]:_0x1bb228['model'];if(!_0x4b7709[_0x87e2('0x47')]['hasOwnProperty'](_0x87e2('0x4f'))){_0x184a6f[_0x87e2('0x32')]=qs['limit'](_0x4b7709['query']['limit']);_0x184a6f[_0x87e2('0x30')]=qs[_0x87e2('0x30')](_0x4b7709[_0x87e2('0x47')][_0x87e2('0x30')]);}_0x184a6f[_0x87e2('0x50')]=qs[_0x87e2('0x51')](_0x4b7709['query'][_0x87e2('0x51')]);_0x184a6f[_0x87e2('0x52')]=qs[_0x87e2('0x49')](_[_0x87e2('0x53')](_0x4b7709[_0x87e2('0x47')],_0x1bb228[_0x87e2('0x49')]));_0x184a6f[_0x87e2('0x52')]['OpenchannelAccountId']=_0x45d5a4['id'];if(_0x4b7709[_0x87e2('0x47')][_0x87e2('0x56')]){_0x184a6f[_0x87e2('0x52')]=_[_0x87e2('0x54')](_0x184a6f['where'],{'$or':_[_0x87e2('0x41')](_0x184a6f[_0x87e2('0x4b')],function(_0x3534d5){var _0x776865={};_0x776865[_0x3534d5]={'$like':'%'+_0x4b7709[_0x87e2('0x47')][_0x87e2('0x56')]+'%'};return _0x776865;})});}_0x184a6f=_['merge']({},_0x184a6f,_0x4b7709[_0x87e2('0x57')]);return db[_0x87e2('0x75')][_0x87e2('0x58')]({'where':_0x184a6f[_0x87e2('0x52')]})[_0x87e2('0x23')](function(_0x32b82f){_0x2d4985[_0x87e2('0x58')]=_0x32b82f;if(_0x4b7709[_0x87e2('0x47')]['includeAll']){_0x184a6f[_0x87e2('0x59')]=[{'all':!![]}];}return db[_0x87e2('0x75')]['findAll'](_0x184a6f);})[_0x87e2('0x23')](function(_0x439818){_0x2d4985[_0x87e2('0x70')]=_0x439818;return _0x2d4985;});}})[_0x87e2('0x23')](respondWithFilteredResult(_0x41a83d,_0x184a6f))[_0x87e2('0x2b')](handleError(_0x41a83d,null));};exports[_0x87e2('0x76')]=function(_0x4b548f,_0x2457e2,_0x470a03){return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x4b548f[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x2457e2,null))['then'](function(_0x311c99){if(_0x311c99){return _0x311c99[_0x87e2('0x76')](_0x4b548f[_0x87e2('0x47')][_0x87e2('0x72')]);}})[_0x87e2('0x23')](respondWithStatusCode(_0x2457e2,null))['catch'](handleError(_0x2457e2,null));};exports[_0x87e2('0x77')]=function(_0x1111c0,_0x305672,_0x434cf5){var _0x921db1={'body':_0x1111c0['body'],'channel':_0x87e2('0x78')};var _0x243bbd=[];var _0x287c7a=[];var _0x576e9f={};var _0x53b7eb=![];return db[_0x87e2('0x79')][_0x87e2('0x6b')]()['then'](function(_0x39dc15){if(!_0x39dc15){throw new db[(_0x87e2('0x7a'))][(_0x87e2('0x7b'))](_0x87e2('0x7c'));}_0x243bbd=_['difference'](_[_0x87e2('0x48')](_0x39dc15),[_0x87e2('0x7d'),_0x87e2('0x7e')]);_0x287c7a=_['difference'](_['keys'](_0x39dc15),[_0x87e2('0x7d'),_0x87e2('0x7e'),_0x87e2('0x7f'),_0x87e2('0x80')]);if(_0x1111c0['body']['id']){delete _0x1111c0[_0x87e2('0x60')]['id'];}if(_[_0x87e2('0x81')](_0x1111c0[_0x87e2('0x60')][_0x87e2('0x82')])){throw new db[(_0x87e2('0x7a'))][(_0x87e2('0x7b'))]('from\x20is\x20mandatory');}if(_[_0x87e2('0x81')](_0x1111c0[_0x87e2('0x60')][_0x87e2('0x60')])||_0x1111c0['body'][_0x87e2('0x60')]===''){throw new db[(_0x87e2('0x7a'))]['ValidationError'](_0x87e2('0x83'));}if(_[_0x87e2('0x81')](_0x1111c0[_0x87e2('0x60')]['mapKey'])){throw new db[(_0x87e2('0x7a'))][(_0x87e2('0x7b'))](_0x87e2('0x84')+_0x287c7a);}if(!_[_0x87e2('0x85')](_0x287c7a,_0x1111c0[_0x87e2('0x60')][_0x87e2('0x86')])){throw new db[(_0x87e2('0x7a'))][(_0x87e2('0x7b'))](_0x87e2('0x87')+_0x287c7a);}_0x576e9f[_0x1111c0[_0x87e2('0x60')][_0x87e2('0x86')]]=_0x1111c0[_0x87e2('0x60')]['from'];})['then'](function(){return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x1111c0[_0x87e2('0x6a')]['id']},'include':[{'model':db[_0x87e2('0x88')],'as':_0x87e2('0x89'),'include':[{'model':db[_0x87e2('0x79')],'as':_0x87e2('0x8a'),'where':_0x576e9f,'limit':0x1,'order':[[_0x87e2('0x7e'),_0x87e2('0x8b')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x305672,null))[_0x87e2('0x23')](function(_0x4c57b6){if(_0x4c57b6&&_0x4c57b6[_0x87e2('0x89')]){_0x921db1[_0x87e2('0x8c')]=_0x4c57b6;_0x921db1[_0x87e2('0x8d')]=_0x4c57b6[_0x87e2('0x8e')];_0x921db1['list']=_0x4c57b6[_0x87e2('0x89')];_0x921db1['applications']=_[_0x87e2('0x8f')](_0x921db1[_0x87e2('0x8d')],[_0x87e2('0x90')],['asc']);if(_0x921db1['account'][_0x87e2('0x8e')]){delete _0x921db1[_0x87e2('0x8c')]['Applications'];}if(_0x921db1[_0x87e2('0x8c')][_0x87e2('0x89')]&&_0x921db1[_0x87e2('0x8c')][_0x87e2('0x89')][_0x87e2('0x8a')][_0x87e2('0x4d')]){return _0x921db1['account'][_0x87e2('0x89')][_0x87e2('0x8a')][0x0];}var _0x1e022a=_[_0x87e2('0x1b')](_0x1111c0[_0x87e2('0x60')],{'firstName':_0x1111c0[_0x87e2('0x60')][_0x87e2('0x82')],'ListId':_0x4c57b6[_0x87e2('0x80')]});_0x1e022a[_0x1111c0[_0x87e2('0x60')]['mapKey']]=_0x1111c0[_0x87e2('0x60')][_0x87e2('0x82')];return db[_0x87e2('0x79')]['create'](_0x1e022a,{'fields':_0x243bbd,'raw':!![]});}})[_0x87e2('0x23')](handleEntityNotFound(_0x305672,null))['then'](function(_0x5a3f7c){_0x921db1[_0x87e2('0x91')]=_0x5a3f7c;if(_0x5a3f7c){var _0x554698={'ContactId':_0x5a3f7c['id'],'OpenchannelAccountId':_0x1111c0['params']['id'],'from':(_0x5a3f7c[_0x87e2('0x92')]||'')+'\x20'+(_0x5a3f7c[_0x87e2('0x93')]||'')};var _0x9232e={'OpenchannelAccountId':_0x1111c0[_0x87e2('0x6a')]['id'],'closed':![]};if(_0x1111c0[_0x87e2('0x60')][_0x87e2('0x94')]){_0x9232e[_0x87e2('0x94')]=_0x1111c0[_0x87e2('0x60')][_0x87e2('0x94')];return db['OpenchannelInteraction'][_0x87e2('0x5e')]({'where':_0x9232e})[_0x87e2('0x23')](function(_0x2a43e1){if(_0x2a43e1){return[_0x2a43e1,![]];}_0x554698[_0x87e2('0x94')]=_0x1111c0[_0x87e2('0x60')][_0x87e2('0x94')];_0x554698[_0x87e2('0x95')]=_0x1111c0[_0x87e2('0x60')][_0x87e2('0x95')];return db['OpenchannelInteraction'][_0x87e2('0x5f')](_0x554698)[_0x87e2('0x23')](function(_0x26e8a7){return[_0x26e8a7,!![]];});});}else{_0x9232e[_0x87e2('0x94')]=null;}_0x9232e[_0x87e2('0x96')]=_0x5a3f7c['id'];return db[_0x87e2('0x97')]['find']({'where':_0x9232e})[_0x87e2('0x23')](function(_0x1a7595){if(_0x1a7595){return[_0x1a7595,![]];}return db['OpenchannelInteraction'][_0x87e2('0x5f')](_0x554698)[_0x87e2('0x23')](function(_0x43a856){return[_0x43a856,!![]];});});}})[_0x87e2('0x98')](function(_0x4371d6,_0x85bc30){if(_0x4371d6){_0x53b7eb=_0x85bc30;if(!_0x85bc30){var _0xa80c78={'from':(_0x921db1['contact'][_0x87e2('0x92')]||'')+'\x20'+(_0x921db1[_0x87e2('0x91')][_0x87e2('0x93')]||'')};if(_0x1111c0[_0x87e2('0x60')][_0x87e2('0x94')]&&_0x1111c0['body']['messageId']&&_0x1111c0[_0x87e2('0x60')]['threadId']!=_0x1111c0[_0x87e2('0x60')][_0x87e2('0x99')]){_0xa80c78[_0x87e2('0x94')]=_0x1111c0['body'][_0x87e2('0x99')];}return _0x4371d6[_0x87e2('0x69')](_0xa80c78);}else{return _0x4371d6;}}})[_0x87e2('0x23')](function(_0x1ac077){_0x921db1[_0x87e2('0x9a')]=_0x1ac077['get']({'plain':!![]});_0x921db1[_0x87e2('0x9a')][_0x87e2('0x9b')]=_0x53b7eb;if(_0x921db1[_0x87e2('0x9a')][_0x87e2('0x9b')]){if(_0x921db1[_0x87e2('0x8c')][_0x87e2('0x9c')]){_0x921db1['applications'][_0x87e2('0x9d')]({'id':0x0,'priority':_0x921db1[_0x87e2('0x8d')][_0x87e2('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x87e2('0x9e')});}}return db['OpenchannelMessage'][_0x87e2('0x5f')]({'body':_0x1111c0[_0x87e2('0x60')][_0x87e2('0x60')],'OpenchannelAccountId':_0x1111c0[_0x87e2('0x6a')]['id'],'OpenchannelInteractionId':_0x1ac077['id'],'direction':'in','ContactId':_0x921db1[_0x87e2('0x91')]['id'],'AttachmentId':_0x1111c0[_0x87e2('0x60')]['AttachmentId']});})[_0x87e2('0x23')](function(_0x3fc35c){_0x921db1[_0x87e2('0x29')]=_0x3fc35c;if(_0x921db1['interaction'][_0x87e2('0x9f')]){return db[_0x87e2('0xa0')][_0x87e2('0x5e')]({'attributes':['id',_0x87e2('0x3c')],'where':{'id':_0x921db1['interaction']['UserId']}})[_0x87e2('0x23')](function(_0x37ce6a){if(_0x37ce6a){_0x921db1['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x87e2('0xa1'),'appdata':_0x37ce6a[_0x87e2('0x3c')]+','+(_0x921db1[_0x87e2('0x8c')][_0x87e2('0xa2')]||0xa),'interval':'*,*,*,*'});_0x921db1[_0x87e2('0xa3')]=![];}return respondWithRpcPromise(_0x87e2('0xa4'),_0x87e2('0xa5'),_0x921db1);});}return respondWithRpcPromise(_0x87e2('0xa4'),_0x87e2('0xa5'),_0x921db1);})[_0x87e2('0x23')](function(_0x1aca93){respondWithRpcPromise(_0x87e2('0xa6'),_0x87e2('0xa6'),{'event':_0x87e2('0x77'),'message':_0x1aca93},client9002);return _0x1aca93;})['then'](respondWithResult(_0x305672,null))['catch'](handleError(_0x305672,null));};exports[_0x87e2('0xa7')]=function(_0x46939d,_0x124de6,_0x72dd18){return db['OpenchannelAccount'][_0x87e2('0x6f')]({'where':{'id':_0x46939d['params']['id']}})['then'](handleEntityNotFound(_0x124de6,null))[_0x87e2('0x23')](function(_0x82fb4a){if(_0x82fb4a){return db[_0x87e2('0xa8')][_0x87e2('0xa9')](function(_0x124537){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x46939d[_0x87e2('0x6a')]['id']},'transaction':_0x124537})[_0x87e2('0x23')](function(_0x5a4161){var _0xab6daa=_['map'](_0x46939d[_0x87e2('0x60')],function(_0x1743f4){_0x1743f4[_0x87e2('0x6c')]=_0x46939d['params']['id'];return _0x1743f4;});return db['OpenchannelApplication'][_0x87e2('0xaa')](_0xab6daa,{'transaction':_0x124537});});})[_0x87e2('0x23')](function(){return db['OpenchannelApplication'][_0x87e2('0xab')]({'where':{'OpenchannelAccountId':_0x46939d[_0x87e2('0x6a')]['id']},'order':_0x87e2('0x90')});});}})[_0x87e2('0x23')](respondWithResult(_0x124de6,null))['catch'](handleError(_0x124de6,null));};exports[_0x87e2('0xac')]=function(_0x484fd6,_0x55a48e,_0x126cf9){var _0x457a0c={};var _0x4ae894={};var _0x39bb74;var _0x48d0dd;return db[_0x87e2('0x42')][_0x87e2('0x6f')]({'where':{'id':_0x484fd6['params']['id']}})['then'](handleEntityNotFound(_0x55a48e,null))[_0x87e2('0x23')](function(_0x4a6772){if(_0x4a6772){_0x39bb74=_0x4a6772;_0x4ae894[_0x87e2('0x46')]=_[_0x87e2('0x48')](db[_0x87e2('0xad')][_0x87e2('0x5c')]);_0x4ae894[_0x87e2('0x47')]=_['keys'](_0x484fd6[_0x87e2('0x47')]);_0x4ae894[_0x87e2('0x49')]=_[_0x87e2('0x4a')](_0x4ae894[_0x87e2('0x46')],_0x4ae894['query']);_0x457a0c[_0x87e2('0x4b')]=_[_0x87e2('0x4a')](_0x4ae894['model'],qs[_0x87e2('0x4c')](_0x484fd6['query']['fields']));_0x457a0c[_0x87e2('0x4b')]=_0x457a0c[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x457a0c[_0x87e2('0x4b')]:_0x4ae894[_0x87e2('0x46')];_0x457a0c[_0x87e2('0x50')]=qs[_0x87e2('0x51')](_0x484fd6[_0x87e2('0x47')][_0x87e2('0x51')]);_0x457a0c[_0x87e2('0x52')]=qs['filters'](_[_0x87e2('0x53')](_0x484fd6['query'],_0x4ae894['filters']));if(_0x484fd6[_0x87e2('0x47')][_0x87e2('0x56')]){_0x457a0c[_0x87e2('0x52')]=_['merge'](_0x457a0c[_0x87e2('0x52')],{'$or':_[_0x87e2('0x41')](_0x457a0c[_0x87e2('0x4b')],function(_0x3f94d0){var _0x3250ed={};_0x3250ed[_0x3f94d0]={'$like':'%'+_0x484fd6['query'][_0x87e2('0x56')]+'%'};return _0x3250ed;})});}_0x457a0c=_[_0x87e2('0x54')]({},_0x457a0c,_0x484fd6[_0x87e2('0x57')]);return _0x39bb74[_0x87e2('0xac')](_0x457a0c);}})[_0x87e2('0x23')](function(_0x4c97f5){if(_0x4c97f5){_0x48d0dd=_0x4c97f5['length'];if(!_0x484fd6[_0x87e2('0x47')][_0x87e2('0x4e')]('nolimit')){_0x457a0c['limit']=qs[_0x87e2('0x32')](_0x484fd6[_0x87e2('0x47')][_0x87e2('0x32')]);_0x457a0c[_0x87e2('0x30')]=qs[_0x87e2('0x30')](_0x484fd6[_0x87e2('0x47')][_0x87e2('0x30')]);}return _0x39bb74[_0x87e2('0xac')](_0x457a0c);}})[_0x87e2('0x23')](function(_0x580cd3){if(_0x580cd3){return _0x580cd3?{'count':_0x48d0dd,'rows':_0x580cd3}:null;}})[_0x87e2('0x23')](respondWithResult(_0x55a48e,null))[_0x87e2('0x2b')](handleError(_0x55a48e,null));};exports[_0x87e2('0xae')]=function(_0xf41b17,_0x5d40c1,_0x4a77d9){var _0x129cd4={'raw':![],'where':{}};var _0x21fb61={};var _0x3bfad4={'count':0x0,'rows':[]};return db[_0x87e2('0x42')][_0x87e2('0x6f')]({'where':{'id':_0xf41b17[_0x87e2('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5d40c1,null))[_0x87e2('0x23')](function(_0x48127e){if(_0x48127e){_0x21fb61['model']=_[_0x87e2('0x48')](db[_0x87e2('0x97')][_0x87e2('0x5c')]);_0x21fb61[_0x87e2('0x47')]=_[_0x87e2('0x48')](_0xf41b17[_0x87e2('0x47')]);_0x21fb61[_0x87e2('0x49')]=_[_0x87e2('0x4a')](_0x21fb61[_0x87e2('0x46')],_0x21fb61[_0x87e2('0x47')]);_0x129cd4[_0x87e2('0x4b')]=_['intersection'](_0x21fb61[_0x87e2('0x46')],qs[_0x87e2('0x4c')](_0xf41b17[_0x87e2('0x47')][_0x87e2('0x4c')]));_0x129cd4[_0x87e2('0x4b')]=_0x129cd4[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x129cd4['attributes']:_0x21fb61[_0x87e2('0x46')];if(!_0xf41b17[_0x87e2('0x47')][_0x87e2('0x4e')](_0x87e2('0x4f'))){_0x129cd4[_0x87e2('0x32')]=qs[_0x87e2('0x32')](_0xf41b17[_0x87e2('0x47')][_0x87e2('0x32')]);_0x129cd4[_0x87e2('0x30')]=qs[_0x87e2('0x30')](_0xf41b17[_0x87e2('0x47')][_0x87e2('0x30')]);}_0x129cd4[_0x87e2('0x50')]=qs[_0x87e2('0x51')](_0xf41b17[_0x87e2('0x47')][_0x87e2('0x51')]);_0x129cd4[_0x87e2('0x52')]=qs[_0x87e2('0x49')](_[_0x87e2('0x53')](_0xf41b17['query'],_0x21fb61[_0x87e2('0x49')]));_0x129cd4[_0x87e2('0x52')][_0x87e2('0x6c')]=_0x48127e['id'];if(_0xf41b17[_0x87e2('0x47')][_0x87e2('0x56')]){_0x129cd4[_0x87e2('0x52')]=_['merge'](_0x129cd4[_0x87e2('0x52')],{'$or':_['map'](_0x129cd4['attributes'],function(_0x53bc47){var _0x4978e3={};_0x4978e3[_0x53bc47]={'$like':'%'+_0xf41b17['query'][_0x87e2('0x56')]+'%'};return _0x4978e3;})});}_0x129cd4=_[_0x87e2('0x54')]({},_0x129cd4,_0xf41b17[_0x87e2('0x57')]);return db[_0x87e2('0x97')]['count']({'where':_0x129cd4['where']})['then'](function(_0x3aa778){_0x3bfad4[_0x87e2('0x58')]=_0x3aa778;if(_0xf41b17['query'][_0x87e2('0x5d')]){_0x129cd4[_0x87e2('0x59')]=[{'model':db[_0x87e2('0x79')],'as':_0x87e2('0xaf'),'required':![]},{'model':db[_0x87e2('0xa0')],'as':_0x87e2('0xb0'),'attributes':[_0x87e2('0x3c'),_0x87e2('0xb1'),_0x87e2('0xb2')],'required':![]},{'model':db[_0x87e2('0xb3')],'as':_0x87e2('0xb4'),'attributes':['id',_0x87e2('0x3c'),_0x87e2('0xb5')],'where':_0xf41b17['query']['tag']?{'id':_0xf41b17[_0x87e2('0x47')][_0x87e2('0xb6')]}:undefined,'required':_0xf41b17[_0x87e2('0x47')][_0x87e2('0xb6')]?!![]:![]}];}return db[_0x87e2('0x97')][_0x87e2('0x5a')](_0x129cd4);})['then'](function(_0x404e73){_0x3bfad4['rows']=_0x404e73;return _0x3bfad4;});}})[_0x87e2('0x23')](respondWithFilteredResult(_0x5d40c1,_0x129cd4))[_0x87e2('0x2b')](handleError(_0x5d40c1,null));};exports[_0x87e2('0xb7')]=function(_0x29a9b7,_0x52fd14,_0x34dad2){return db[_0x87e2('0x42')][_0x87e2('0x5e')]({'where':{'id':_0x29a9b7['params']['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x52fd14,null))[_0x87e2('0x23')](function(_0x29a6cb){if(_0x29a6cb){return _0x29a6cb[_0x87e2('0xb7')](_0x29a9b7['body'][_0x87e2('0x72')],_[_0x87e2('0xb8')](_0x29a9b7[_0x87e2('0x60')],['ids','id'])||{})[_0x87e2('0x98')](function(_0x18794e){for(var _0x11ea28=0x0;_0x11ea28<_0x29a9b7[_0x87e2('0x60')]['ids'][_0x87e2('0x4d')];_0x11ea28+=0x1){socket[_0x87e2('0xb9')](_0x87e2('0xba'),{'UserId':Number(_0x29a9b7[_0x87e2('0x60')][_0x87e2('0x72')][_0x11ea28]),'OpenchannelAccountId':Number(_0x29a9b7[_0x87e2('0x6a')]['id'])});}return _0x18794e;});}})[_0x87e2('0x23')](respondWithResult(_0x52fd14,null))[_0x87e2('0x2b')](handleError(_0x52fd14,null));};exports[_0x87e2('0xbb')]=function(_0x53ba1a,_0x46b7b1,_0x59e523){return db['OpenchannelAccount'][_0x87e2('0x5e')]({'where':{'id':_0x53ba1a[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x46b7b1,null))['then'](function(_0x32d023){if(_0x32d023){return _0x32d023[_0x87e2('0xbb')](_0x53ba1a[_0x87e2('0x47')][_0x87e2('0x72')])[_0x87e2('0x23')](function(){if(_[_0x87e2('0xbc')](_0x53ba1a[_0x87e2('0x47')][_0x87e2('0x72')])){for(var _0x58c171=0x0;_0x58c171<_0x53ba1a[_0x87e2('0x47')]['ids'][_0x87e2('0x4d')];_0x58c171+=0x1){socket[_0x87e2('0xb9')](_0x87e2('0xbd'),{'UserId':Number(_0x53ba1a[_0x87e2('0x47')][_0x87e2('0x72')][_0x58c171]),'OpenchannelAccountId':Number(_0x53ba1a[_0x87e2('0x6a')]['id'])});}}else{socket[_0x87e2('0xb9')](_0x87e2('0xbd'),{'UserId':Number(_0x53ba1a[_0x87e2('0x47')][_0x87e2('0x72')]),'OpenchannelAccountId':Number(_0x53ba1a['params']['id'])});}});}})[_0x87e2('0x23')](respondWithStatusCode(_0x46b7b1,null))[_0x87e2('0x2b')](handleError(_0x46b7b1,null));};exports['getAgents']=function(_0x59df7f,_0x21e59b,_0x2a6539){var _0x901d30={};var _0x1f7934={};var _0x46acdb;var _0x5528b1;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x59df7f[_0x87e2('0x6a')]['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x21e59b,null))['then'](function(_0x29a1d1){if(_0x29a1d1){_0x46acdb=_0x29a1d1;_0x1f7934['model']=_[_0x87e2('0x48')](db[_0x87e2('0xa0')][_0x87e2('0x5c')]);_0x1f7934['query']=_['keys'](_0x59df7f['query']);_0x1f7934[_0x87e2('0x49')]=_[_0x87e2('0x4a')](_0x1f7934[_0x87e2('0x46')],_0x1f7934[_0x87e2('0x47')]);_0x901d30[_0x87e2('0x4b')]=_[_0x87e2('0x4a')](_0x1f7934[_0x87e2('0x46')],qs['fields'](_0x59df7f[_0x87e2('0x47')][_0x87e2('0x4c')]));_0x901d30[_0x87e2('0x4b')]=_0x901d30[_0x87e2('0x4b')][_0x87e2('0x4d')]?_0x901d30[_0x87e2('0x4b')]:_0x1f7934['model'];_0x901d30[_0x87e2('0x50')]=qs[_0x87e2('0x51')](_0x59df7f[_0x87e2('0x47')][_0x87e2('0x51')]);_0x901d30[_0x87e2('0x52')]=qs[_0x87e2('0x49')](_[_0x87e2('0x53')](_0x59df7f[_0x87e2('0x47')],_0x1f7934[_0x87e2('0x49')]));if(_0x59df7f[_0x87e2('0x47')][_0x87e2('0x56')]){_0x901d30[_0x87e2('0x52')]=_[_0x87e2('0x54')](_0x901d30[_0x87e2('0x52')],{'$or':_[_0x87e2('0x41')](_0x901d30[_0x87e2('0x4b')],function(_0x3510ad){var _0x52dd8f={};_0x52dd8f[_0x3510ad]={'$like':'%'+_0x59df7f[_0x87e2('0x47')][_0x87e2('0x56')]+'%'};return _0x52dd8f;})});}_0x901d30=_[_0x87e2('0x54')]({},_0x901d30,_0x59df7f[_0x87e2('0x57')]);return _0x46acdb[_0x87e2('0xbe')](_0x901d30);}})[_0x87e2('0x23')](function(_0x4db7b3){if(_0x4db7b3){_0x5528b1=_0x4db7b3[_0x87e2('0x4d')];if(!_0x59df7f[_0x87e2('0x47')][_0x87e2('0x4e')](_0x87e2('0x4f'))){_0x901d30[_0x87e2('0x32')]=qs[_0x87e2('0x32')](_0x59df7f[_0x87e2('0x47')][_0x87e2('0x32')]);_0x901d30[_0x87e2('0x30')]=qs[_0x87e2('0x30')](_0x59df7f['query'][_0x87e2('0x30')]);}return _0x46acdb[_0x87e2('0xbe')](_0x901d30);}})[_0x87e2('0x23')](function(_0x3f3602){if(_0x3f3602){return _0x3f3602?{'count':_0x5528b1,'rows':_0x3f3602}:null;}})[_0x87e2('0x23')](respondWithResult(_0x21e59b,null))[_0x87e2('0x2b')](handleError(_0x21e59b,null));};exports[_0x87e2('0x3d')]=function(_0x476485,_0x546e68,_0x4b8292){var _0x49a366,_0x9f67b8,_0x5ab5f1;if(_['isNil'](_0x476485['body'][_0x87e2('0x60')])||_0x476485['body'][_0x87e2('0x60')]===''){throw new db[(_0x87e2('0x7a'))][(_0x87e2('0x7b'))](_0x87e2('0x83'));}if(_[_0x87e2('0x81')](_0x476485[_0x87e2('0x60')]['to'])){}_0x49a366=_0x476485[_0x87e2('0x60')]['to'];return db['OpenchannelAccount'][_0x87e2('0x6f')]({'where':{'id':_0x476485['params']['id']}})[_0x87e2('0x23')](handleEntityNotFound(_0x546e68,null))[_0x87e2('0x23')](function(_0x28ff4b){if(_0x28ff4b){return db['OpenchannelAccount'][_0x87e2('0x5e')]({'where':{'id':_0x28ff4b['id']},'include':[{'model':db[_0x87e2('0x88')],'as':'List','include':[{'model':db[_0x87e2('0x79')],'as':_0x87e2('0x8a'),'where':{[_0x28ff4b['mapKey']]:_0x49a366},'limit':0x1,'order':[[_0x87e2('0x7e'),_0x87e2('0x8b')]]}]}]})['then'](handleEntityNotFound(_0x546e68,null))[_0x87e2('0x23')](function(_0x274fbe){if(_0x274fbe&&_0x274fbe[_0x87e2('0x89')]){_0x9f67b8=_0x274fbe[_0x87e2('0x39')]({'plain':!![]});if(_0x9f67b8['List']&&_0x9f67b8[_0x87e2('0x89')][_0x87e2('0x8a')][_0x87e2('0x4d')]){return _0x9f67b8['List']['Contacts'][0x0];}return db[_0x87e2('0x79')][_0x87e2('0x5f')](_[_0x87e2('0x1b')](_0x476485[_0x87e2('0x60')],{'firstName':_0x49a366,[_0x274fbe[_0x87e2('0x86')]]:_0x49a366,'phone':_0x49a366,'ListId':_0x9f67b8['ListId']}));}})[_0x87e2('0x23')](handleEntityNotFound(_0x546e68,null))[_0x87e2('0x23')](function(_0x3b047c){if(_0x3b047c){_0x5ab5f1=_0x3b047c;return db[_0x87e2('0x97')][_0x87e2('0x5e')]({'where':{'ContactId':_0x5ab5f1['id'],'closed':![],'OpenchannelAccountId':_0x9f67b8['id']}})['then'](function(_0x1f63c8){if(_0x1f63c8){return[_0x1f63c8,![]];}return db[_0x87e2('0x97')]['create']({'UserId':_0x476485[_0x87e2('0x61')]['id'],'ContactId':_0x5ab5f1['id'],'OpenchannelAccountId':_0x9f67b8['id'],'lastMsgDirection':_0x87e2('0xbf'),'Messages':[_[_0x87e2('0x54')](_0x476485['body'],{'read':![],'body':_0x476485['body'][_0x87e2('0x60')],'OpenchannelAccountId':_0x9f67b8['id'],'UserId':_0x476485[_0x87e2('0x61')]['id'],'ContactId':_0x5ab5f1['id']})]},{'include':[{'model':db[_0x87e2('0xc0')],'as':_0x87e2('0xc1')}]})[_0x87e2('0x23')](function(_0x45105e){return[_0x45105e,!![]];});});}})[_0x87e2('0x98')](function(_0x54a01b,_0x58d5b9){if(_0x58d5b9){return _0x54a01b;}return db[_0x87e2('0xc0')][_0x87e2('0x5f')](_[_0x87e2('0x54')](_0x476485['body'],{'read':![],'body':_0x476485[_0x87e2('0x60')][_0x87e2('0x60')],'OpenchannelAccountId':_0x9f67b8['id'],'OpenchannelInteractionId':_0x54a01b['id'],'UserId':_0x476485['user']['id'],'ContactId':_0x5ab5f1['id']}))[_0x87e2('0x23')](function(_0x55de44){_0x54a01b[_0x87e2('0xc2')][_0x87e2('0xc1')]=[];_0x54a01b['dataValues']['Messages'][_0x87e2('0x9d')](_0x55de44[_0x87e2('0xc2')]);return _0x54a01b;});});}})[_0x87e2('0x23')](respondWithResult(_0x546e68,null))[_0x87e2('0x2b')](handleError(_0x546e68,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 530af4b..f6a1b53 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 _0xda3f=['exports','../../mysqldb','OpenchannelAccount','remove','emit'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xda3f,0xec));var _0xfda3=function(_0x3c711e,_0x190cec){_0x3c711e=_0x3c711e-0x0;var _0x4e7105=_0xda3f[_0x3c711e];return _0x4e7105;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x55e0=['remove','emit','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x56fbb6,_0x570f05){var _0x4e9a77=function(_0x320be4){while(--_0x320be4){_0x56fbb6['push'](_0x56fbb6['shift']());}};_0x4e9a77(++_0x570f05);}(_0x55e0,0xdc));var _0x055e=function(_0x233ea5,_0x3883a7){_0x233ea5=_0x233ea5-0x0;var _0x558f56=_0x55e0[_0x233ea5];return _0x558f56;};'use strict';var EventEmitter=require(_0x055e('0x0'));var OpenchannelAccount=require(_0x055e('0x1'))['db'][_0x055e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x055e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x055e('0x4')};function emitEvent(_0x2d9bd5){return function(_0x33cd7b,_0x2773e4,_0x157473){OpenchannelAccountEvents[_0x055e('0x5')](_0x2d9bd5+':'+_0x33cd7b['id'],_0x33cd7b);OpenchannelAccountEvents['emit'](_0x2d9bd5,_0x33cd7b);_0x157473(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x055e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8f83821..d783367 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(_0x1cf6c1,_0x10298d){var _0x2ec065=function(_0x320d91){while(--_0x320d91){_0x1cf6c1['push'](_0x1cf6c1['shift']());}};_0x2ec065(++_0x10298d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x30ce49,_0x47524d){var _0x52fc6b=function(_0x4a698f){while(--_0x4a698f){_0x30ce49['push'](_0x30ce49['shift']());}};_0x52fc6b(++_0x47524d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 566e3e4..5e233b7 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 _0x282b=['request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x13195f,_0x313b7d){var _0x200ee6=function(_0x10ccd){while(--_0x10ccd){_0x13195f['push'](_0x13195f['shift']());}};_0x200ee6(++_0x313b7d);}(_0x282b,0xec));var _0xb282=function(_0x37d3d1,_0x5873b6){_0x37d3d1=_0x37d3d1-0x0;var _0x10503b=_0x282b[_0x37d3d1];return _0x10503b;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});config[_0xb282('0xb')]=_['defaults'](config['redis'],{'host':_0xb282('0xc'),'port':0x18eb});var socket=require(_0xb282('0xd'))(new Redis(config['redis']));require(_0xb282('0xe'))[_0xb282('0xf')](socket);function respondWithRpcPromise(_0x3435fc,_0x2d86ba,_0x56caf2){return new BPromise(function(_0x47e62e,_0x36b984){return client[_0xb282('0x10')](_0x3435fc,_0x56caf2)[_0xb282('0x11')](function(_0x1cbe28){logger[_0xb282('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x2d86ba,'request\x20sent');logger[_0xb282('0x13')](_0xb282('0x14'),_0x2d86ba,_0xb282('0x15'),JSON[_0xb282('0x16')](_0x1cbe28));if(_0x1cbe28[_0xb282('0x17')]){if(_0x1cbe28['error'][_0xb282('0x18')]===0x1f4){logger['error'](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')]['message']);return _0x36b984(_0x1cbe28['error']['message']);}logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')][_0xb282('0x1a')]);return _0x47e62e(_0x1cbe28[_0xb282('0x17')]['message']);}else{logger[_0xb282('0x12')](_0xb282('0x19'),_0x2d86ba,_0xb282('0x15'));_0x47e62e(_0x1cbe28[_0xb282('0x1b')][_0xb282('0x1a')]);}})['catch'](function(_0x52e305){logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x52e305);_0x36b984(_0x52e305);});});} \ No newline at end of file +var _0xcecc=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x2b441f,_0x249bac){var _0x1cc771=function(_0x33b705){while(--_0x33b705){_0x2b441f['push'](_0x2b441f['shift']());}};_0x1cc771(++_0x249bac);}(_0xcecc,0x186));var _0xccec=function(_0x2ebbc0,_0x1e4514){_0x2ebbc0=_0x2ebbc0-0x0;var _0x49a731=_0xcecc[_0x2ebbc0];return _0x49a731;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var utils=require(_0xccec('0x4'));var logger=require(_0xccec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccec('0x6'));var client=jayson['client'][_0xccec('0x7')]({'port':0x232a});config[_0xccec('0x8')]=_[_0xccec('0x9')](config['redis'],{'host':_0xccec('0xa'),'port':0x18eb});var socket=require(_0xccec('0xb'))(new Redis(config['redis']));require(_0xccec('0xc'))[_0xccec('0xd')](socket);function respondWithRpcPromise(_0x45ba32,_0x108788,_0x4a936c){return new BPromise(function(_0x49ad58,_0x5d94a5){return client[_0xccec('0xe')](_0x45ba32,_0x4a936c)[_0xccec('0xf')](function(_0x547e6e){logger[_0xccec('0x10')](_0xccec('0x11'),_0x108788,_0xccec('0x12'));logger['debug'](_0xccec('0x13'),_0x108788,_0xccec('0x12'),JSON[_0xccec('0x14')](_0x547e6e));if(_0x547e6e[_0xccec('0x15')]){if(_0x547e6e[_0xccec('0x15')]['code']===0x1f4){logger[_0xccec('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,_0x547e6e['error']['message']);return _0x5d94a5(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);return _0x49ad58(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}else{logger[_0xccec('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,'request\x20sent');_0x49ad58(_0x547e6e['result'][_0xccec('0x16')]);}})['catch'](function(_0x76b9fd){logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x76b9fd);_0x5d94a5(_0x76b9fd);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 578e9b4..77e11bc 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 _0x4b07=['remove','emit','save'];(function(_0x42e98c,_0x1c6bb9){var _0x59803e=function(_0x3a587e){while(--_0x3a587e){_0x42e98c['push'](_0x42e98c['shift']());}};_0x59803e(++_0x1c6bb9);}(_0x4b07,0x1d6));var _0x74b0=function(_0x50b6cd,_0x428332){_0x50b6cd=_0x50b6cd-0x0;var _0x289d3d=_0x4b07[_0x50b6cd];return _0x289d3d;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x74b0('0x0'),_0x74b0('0x1'),'update'];function createListener(_0x19ddd4,_0x273cce){return function(_0x3d0aaf){_0x273cce[_0x74b0('0x2')](_0x19ddd4,_0x3d0aaf);};}function removeListener(_0x5ed154,_0x397b2a){return function(){OpenchannelAccountEvents['removeListener'](_0x5ed154,_0x397b2a);};}exports['register']=function(_0x49713c){for(var _0x42e551=0x0,_0x459c2d=events['length'];_0x42e551<_0x459c2d;_0x42e551++){var _0x5ea430=events[_0x42e551];var _0x45183d=createListener('openchannelAccount:'+_0x5ea430,_0x49713c);OpenchannelAccountEvents['on'](_0x5ea430,_0x45183d);}}; \ No newline at end of file +var _0x57f8=['save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x54fbbf,_0x33252d){var _0x4da9bf=function(_0x17521b){while(--_0x17521b){_0x54fbbf['push'](_0x54fbbf['shift']());}};_0x4da9bf(++_0x33252d);}(_0x57f8,0x198));var _0x857f=function(_0x56092a,_0x291ce5){_0x56092a=_0x56092a-0x0;var _0x1c9558=_0x57f8[_0x56092a];return _0x1c9558;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x857f('0x0'),_0x857f('0x1'),_0x857f('0x2')];function createListener(_0x3c0125,_0x238445){return function(_0x27b98d){_0x238445[_0x857f('0x3')](_0x3c0125,_0x27b98d);};}function removeListener(_0x6f054b,_0x318050){return function(){OpenchannelAccountEvents[_0x857f('0x4')](_0x6f054b,_0x318050);};}exports[_0x857f('0x5')]=function(_0x369c40){for(var _0x5d22e4=0x0,_0x8380e8=events[_0x857f('0x6')];_0x5d22e4<_0x8380e8;_0x5d22e4++){var _0x1aaeea=events[_0x5d22e4];var _0x577fc3=createListener(_0x857f('0x7')+_0x1aaeea,_0x369c40);OpenchannelAccountEvents['on'](_0x1aaeea,_0x577fc3);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index f2ab742..394bb08 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 _0x595e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x595e,0x189));var _0xe595=function(_0x19ef66,_0x2b2cf6){_0x19ef66=_0x19ef66-0x0;var _0x3c18db=_0x595e[_0x19ef66];return _0x3c18db;};'use strict';var multer=require(_0xe595('0x0'));var util=require(_0xe595('0x1'));var path=require(_0xe595('0x2'));var timeout=require(_0xe595('0x3'));var express=require(_0xe595('0x4'));var router=express[_0xe595('0x5')]();var fs_extra=require(_0xe595('0x6'));var auth=require(_0xe595('0x7'));var interaction=require(_0xe595('0x8'));var config=require(_0xe595('0x9'));var controller=require(_0xe595('0xa'));router[_0xe595('0xb')]('/',auth[_0xe595('0xc')](),controller[_0xe595('0xd')]);router[_0xe595('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe595('0xe')]);router[_0xe595('0xf')]('/',auth[_0xe595('0xc')](),controller['create']);router['put']('/:id',auth[_0xe595('0xc')](),controller[_0xe595('0x10')]);router[_0xe595('0x11')](_0xe595('0x12'),auth['isAuthenticated'](),controller[_0xe595('0x13')]);module[_0xe595('0x14')]=router; \ No newline at end of file +var _0xd423=['./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f1d9e,_0x558388){var _0x1e8af6=function(_0x25d873){while(--_0x25d873){_0x2f1d9e['push'](_0x2f1d9e['shift']());}};_0x1e8af6(++_0x558388);}(_0xd423,0xca));var _0x3d42=function(_0x4e9559,_0x324346){_0x4e9559=_0x4e9559-0x0;var _0x13d630=_0xd423[_0x4e9559];return _0x13d630;};'use strict';var multer=require('multer');var util=require(_0x3d42('0x0'));var path=require('path');var timeout=require(_0x3d42('0x1'));var express=require(_0x3d42('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d42('0x3'));var interaction=require(_0x3d42('0x4'));var config=require(_0x3d42('0x5'));var controller=require(_0x3d42('0x6'));router[_0x3d42('0x7')]('/',auth[_0x3d42('0x8')](),controller[_0x3d42('0x9')]);router[_0x3d42('0x7')](_0x3d42('0xa'),auth[_0x3d42('0x8')](),controller[_0x3d42('0xb')]);router[_0x3d42('0xc')]('/',auth[_0x3d42('0x8')](),controller[_0x3d42('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3d42('0xe')](_0x3d42('0xa'),auth[_0x3d42('0x8')](),controller[_0x3d42('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index f49c45f..bc6cb0f 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 _0x14cf=['exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x14cf,0x163));var _0xf14c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x14cf[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0xf14c('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf14c('0x1')],'allowNull':![],'defaultValue':_0xf14c('0x2')},'appdata':{'type':Sequelize[_0xf14c('0x3')]()},'description':{'type':Sequelize[_0xf14c('0x1')]},'interval':{'type':Sequelize[_0xf14c('0x1')],'defaultValue':_0xf14c('0x4')}}; \ No newline at end of file +var _0x937c=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x369552,_0x54a599){var _0x3eb52c=function(_0x300597){while(--_0x300597){_0x369552['push'](_0x369552['shift']());}};_0x3eb52c(++_0x54a599);}(_0x937c,0x114));var _0xc937=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x937c[_0xbebf50];return _0xce1496;};'use strict';var Sequelize=require('sequelize');module[_0xc937('0x0')]={'priority':{'type':Sequelize[_0xc937('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc937('0x2')],'allowNull':![],'defaultValue':_0xc937('0x3')},'appdata':{'type':Sequelize[_0xc937('0x4')]()},'description':{'type':Sequelize[_0xc937('0x2')]},'interval':{'type':Sequelize[_0xc937('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0d618fe..4a048c9 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 _0x1f12=['to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','destroy','then','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','OpenchannelApplication','includeAll','include','findAll','catch','params','fields','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x1e7ed7,_0x410a9b){var _0x5f44b3=function(_0x53feec){while(--_0x53feec){_0x1e7ed7['push'](_0x1e7ed7['shift']());}};_0x5f44b3(++_0x410a9b);}(_0x1f12,0x10b));var _0x21f1=function(_0x113076,_0x10b81e){_0x113076=_0x113076-0x0;var _0x51235b=_0x1f12[_0x113076];return _0x51235b;};'use strict';var emlformat=require(_0x21f1('0x0'));var rimraf=require(_0x21f1('0x1'));var zipdir=require(_0x21f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21f1('0x3'));var moment=require(_0x21f1('0x4'));var BPromise=require(_0x21f1('0x5'));var Mustache=require(_0x21f1('0x6'));var util=require(_0x21f1('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x21f1('0x8'));var fs=require('fs');var fs_extra=require(_0x21f1('0x9'));var _=require(_0x21f1('0xa'));var squel=require('squel');var crypto=require(_0x21f1('0xb'));var jsforce=require(_0x21f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x21f1('0xd'));var querystring=require('querystring');var Papa=require(_0x21f1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x21f1('0xf'));var as=require(_0x21f1('0x10'));var hardwareService=require(_0x21f1('0x11'));var logger=require(_0x21f1('0x12'))(_0x21f1('0x13'));var utils=require(_0x21f1('0x14'));var config=require(_0x21f1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x21f1('0x16'))['db'];function respondWithStatusCode(_0x4ae36c,_0x37fe0b){_0x37fe0b=_0x37fe0b||0xcc;return function(_0x22806b){if(_0x22806b){return _0x4ae36c[_0x21f1('0x17')](_0x37fe0b);}return _0x4ae36c['status'](_0x37fe0b)[_0x21f1('0x18')]();};}function respondWithResult(_0x55f0d6,_0x6bdf34){_0x6bdf34=_0x6bdf34||0xc8;return function(_0x1a70fc){if(_0x1a70fc){return _0x55f0d6['status'](_0x6bdf34)[_0x21f1('0x19')](_0x1a70fc);}};}function respondWithFilteredResult(_0x5e47db,_0x54b811){return function(_0x1a41c2){if(_0x1a41c2){var _0x28219f=typeof _0x54b811[_0x21f1('0x1a')]===_0x21f1('0x1b')&&typeof _0x54b811[_0x21f1('0x1c')]===_0x21f1('0x1b');var _0x4fea68=_0x1a41c2[_0x21f1('0x1d')];var _0x3d53ed=_0x28219f?0x0:_0x54b811['offset'];var _0x3e0b02=_0x28219f?_0x1a41c2['count']:_0x54b811[_0x21f1('0x1a')]+_0x54b811['limit'];var _0x36af30;if(_0x3e0b02>=_0x4fea68){_0x3e0b02=_0x4fea68;_0x36af30=0xc8;}else{_0x36af30=0xce;}_0x5e47db[_0x21f1('0x1e')](_0x36af30);return _0x5e47db[_0x21f1('0x1f')](_0x21f1('0x20'),_0x3d53ed+'-'+_0x3e0b02+'/'+_0x4fea68)['json'](_0x1a41c2);}return null;};}function patchUpdates(_0x3cb9d2){return function(_0xe5fac8){try{jsonpatch['apply'](_0xe5fac8,_0x3cb9d2,!![]);}catch(_0x2afb01){return BPromise['reject'](_0x2afb01);}return _0xe5fac8[_0x21f1('0x21')]();};}function saveUpdates(_0x4b300f,_0x4cdd07){return function(_0x293b90){if(_0x293b90){return _0x293b90[_0x21f1('0x22')](_0x4b300f)['then'](function(_0x5d0b8e){return _0x5d0b8e;});}return null;};}function removeEntity(_0x511508,_0x2281d9){return function(_0x3a44d9){if(_0x3a44d9){return _0x3a44d9[_0x21f1('0x23')]()[_0x21f1('0x24')](function(){_0x511508[_0x21f1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17c33f,_0x5cc46a){return function(_0x571f12){if(!_0x571f12){_0x17c33f[_0x21f1('0x17')](0x194);}return _0x571f12;};}function handleError(_0x22e62a,_0x30b4c8){_0x30b4c8=_0x30b4c8||0x1f4;return function(_0x1f74f8){logger['error'](_0x1f74f8[_0x21f1('0x25')]);if(_0x1f74f8[_0x21f1('0x26')]){delete _0x1f74f8[_0x21f1('0x26')];}_0x22e62a[_0x21f1('0x1e')](_0x30b4c8)['send'](_0x1f74f8);};}exports['index']=function(_0x330780,_0x474577){var _0x4b4186={},_0x534c61={},_0x27139b={'count':0x0,'rows':[]};var _0x3e2699=_[_0x21f1('0x27')](db['OpenchannelApplication'][_0x21f1('0x28')],function(_0x489e03){return{'name':_0x489e03[_0x21f1('0x29')],'type':_0x489e03[_0x21f1('0x2a')][_0x21f1('0x2b')]};});_0x534c61[_0x21f1('0x2c')]=_[_0x21f1('0x27')](_0x3e2699,_0x21f1('0x26'));_0x534c61[_0x21f1('0x2d')]=_[_0x21f1('0x2e')](_0x330780[_0x21f1('0x2d')]);_0x534c61['filters']=_[_0x21f1('0x2f')](_0x534c61['model'],_0x534c61[_0x21f1('0x2d')]);_0x4b4186[_0x21f1('0x30')]=_['intersection'](_0x534c61[_0x21f1('0x2c')],qs['fields'](_0x330780[_0x21f1('0x2d')]['fields']));_0x4b4186[_0x21f1('0x30')]=_0x4b4186['attributes'][_0x21f1('0x31')]?_0x4b4186[_0x21f1('0x30')]:_0x534c61[_0x21f1('0x2c')];if(!_0x330780[_0x21f1('0x2d')][_0x21f1('0x32')](_0x21f1('0x33'))){_0x4b4186[_0x21f1('0x1c')]=qs['limit'](_0x330780[_0x21f1('0x2d')][_0x21f1('0x1c')]);_0x4b4186[_0x21f1('0x1a')]=qs[_0x21f1('0x1a')](_0x330780['query'][_0x21f1('0x1a')]);}_0x4b4186['order']=qs[_0x21f1('0x34')](_0x330780[_0x21f1('0x2d')][_0x21f1('0x34')]);_0x4b4186[_0x21f1('0x35')]=qs['filters'](_[_0x21f1('0x36')](_0x330780[_0x21f1('0x2d')],_0x534c61[_0x21f1('0x37')]),_0x3e2699);if(_0x330780[_0x21f1('0x2d')][_0x21f1('0x38')]){_0x4b4186['where']=_[_0x21f1('0x39')](_0x4b4186[_0x21f1('0x35')],{'$or':_[_0x21f1('0x27')](_0x3e2699,function(_0x38d0fc){if(_0x38d0fc[_0x21f1('0x2a')]!==_0x21f1('0x3a')){var _0x2ba8b2={};_0x2ba8b2[_0x38d0fc['name']]={'$like':'%'+_0x330780[_0x21f1('0x2d')][_0x21f1('0x38')]+'%'};return _0x2ba8b2;}})});}_0x4b4186=_[_0x21f1('0x39')]({},_0x4b4186,_0x330780['options']);var _0x5bf271={'where':_0x4b4186[_0x21f1('0x35')]};return db[_0x21f1('0x3b')][_0x21f1('0x1d')](_0x5bf271)['then'](function(_0x5c1535){_0x27139b['count']=_0x5c1535;if(_0x330780[_0x21f1('0x2d')][_0x21f1('0x3c')]){_0x4b4186[_0x21f1('0x3d')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x21f1('0x3e')](_0x4b4186);})[_0x21f1('0x24')](function(_0x18ad3e){_0x27139b['rows']=_0x18ad3e;return _0x27139b;})[_0x21f1('0x24')](respondWithFilteredResult(_0x474577,_0x4b4186))[_0x21f1('0x3f')](handleError(_0x474577,null));};exports['show']=function(_0x3ab016,_0x35278d){var _0xd63370={'raw':!![],'where':{'id':_0x3ab016[_0x21f1('0x40')]['id']}},_0x539ad8={};_0x539ad8[_0x21f1('0x2c')]=_[_0x21f1('0x2e')](db['OpenchannelApplication']['rawAttributes']);_0x539ad8[_0x21f1('0x2d')]=_['keys'](_0x3ab016[_0x21f1('0x2d')]);_0x539ad8[_0x21f1('0x37')]=_[_0x21f1('0x2f')](_0x539ad8[_0x21f1('0x2c')],_0x539ad8[_0x21f1('0x2d')]);_0xd63370['attributes']=_[_0x21f1('0x2f')](_0x539ad8[_0x21f1('0x2c')],qs[_0x21f1('0x41')](_0x3ab016[_0x21f1('0x2d')][_0x21f1('0x41')]));_0xd63370[_0x21f1('0x30')]=_0xd63370[_0x21f1('0x30')]['length']?_0xd63370[_0x21f1('0x30')]:_0x539ad8[_0x21f1('0x2c')];if(_0x3ab016[_0x21f1('0x2d')]['includeAll']){_0xd63370[_0x21f1('0x3d')]=[{'all':!![]}];}_0xd63370=_[_0x21f1('0x39')]({},_0xd63370,_0x3ab016[_0x21f1('0x42')]);return db[_0x21f1('0x3b')]['find'](_0xd63370)[_0x21f1('0x24')](handleEntityNotFound(_0x35278d,null))[_0x21f1('0x24')](respondWithResult(_0x35278d,null))['catch'](handleError(_0x35278d,null));};exports[_0x21f1('0x43')]=function(_0x584ff2,_0x4a6106){return db['OpenchannelApplication'][_0x21f1('0x43')](_0x584ff2[_0x21f1('0x44')],{})[_0x21f1('0x24')](respondWithResult(_0x4a6106,0xc9))[_0x21f1('0x3f')](handleError(_0x4a6106,null));};exports[_0x21f1('0x22')]=function(_0x544731,_0x94863a){if(_0x544731[_0x21f1('0x44')]['id']){delete _0x544731['body']['id'];}return db[_0x21f1('0x3b')][_0x21f1('0x45')]({'where':{'id':_0x544731[_0x21f1('0x40')]['id']}})['then'](handleEntityNotFound(_0x94863a,null))[_0x21f1('0x24')](saveUpdates(_0x544731['body'],null))[_0x21f1('0x24')](respondWithResult(_0x94863a,null))[_0x21f1('0x3f')](handleError(_0x94863a,null));};exports['destroy']=function(_0x5a9103,_0x264985){return db[_0x21f1('0x3b')][_0x21f1('0x45')]({'where':{'id':_0x5a9103[_0x21f1('0x40')]['id']}})['then'](handleEntityNotFound(_0x264985,null))['then'](removeEntity(_0x264985,null))[_0x21f1('0x3f')](handleError(_0x264985,null));}; \ No newline at end of file +var _0x6d9f=['path','sox','to-csv','fs-extra','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','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','include','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x1d37c0,_0x3d5447){var _0x29dbc6=function(_0x51aae7){while(--_0x51aae7){_0x1d37c0['push'](_0x1d37c0['shift']());}};_0x29dbc6(++_0x3d5447);}(_0x6d9f,0x135));var _0xf6d9=function(_0x4fead8,_0x1e7b8a){_0x4fead8=_0x4fead8-0x0;var _0x12ae65=_0x6d9f[_0x4fead8];return _0x12ae65;};'use strict';var emlformat=require(_0xf6d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6d9('0x1'));var jsonpatch=require(_0xf6d9('0x2'));var rp=require('request-promise');var moment=require(_0xf6d9('0x3'));var BPromise=require(_0xf6d9('0x4'));var Mustache=require(_0xf6d9('0x5'));var util=require(_0xf6d9('0x6'));var path=require(_0xf6d9('0x7'));var sox=require(_0xf6d9('0x8'));var csv=require(_0xf6d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6d9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf6d9('0xb'));var jsforce=require(_0xf6d9('0xc'));var deskjs=require(_0xf6d9('0xd'));var toCsv=require(_0xf6d9('0x9'));var querystring=require(_0xf6d9('0xe'));var Papa=require(_0xf6d9('0xf'));var Redis=require(_0xf6d9('0x10'));var authService=require(_0xf6d9('0x11'));var qs=require(_0xf6d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6d9('0x13'));var logger=require(_0xf6d9('0x14'))(_0xf6d9('0x15'));var utils=require(_0xf6d9('0x16'));var config=require(_0xf6d9('0x17'));var licenseUtil=require(_0xf6d9('0x18'));var db=require(_0xf6d9('0x19'))['db'];function respondWithStatusCode(_0x4076c2,_0x1ecade){_0x1ecade=_0x1ecade||0xcc;return function(_0x508358){if(_0x508358){return _0x4076c2[_0xf6d9('0x1a')](_0x1ecade);}return _0x4076c2['status'](_0x1ecade)[_0xf6d9('0x1b')]();};}function respondWithResult(_0x1a2b89,_0x157f9f){_0x157f9f=_0x157f9f||0xc8;return function(_0x5b1d73){if(_0x5b1d73){return _0x1a2b89['status'](_0x157f9f)[_0xf6d9('0x1c')](_0x5b1d73);}};}function respondWithFilteredResult(_0x366fd1,_0x588839){return function(_0xc924c1){if(_0xc924c1){var _0x324cbe=typeof _0x588839[_0xf6d9('0x1d')]===_0xf6d9('0x1e')&&typeof _0x588839[_0xf6d9('0x1f')]===_0xf6d9('0x1e');var _0x45fd33=_0xc924c1['count'];var _0x18c148=_0x324cbe?0x0:_0x588839['offset'];var _0x495e88=_0x324cbe?_0xc924c1[_0xf6d9('0x20')]:_0x588839[_0xf6d9('0x1d')]+_0x588839['limit'];var _0xcc6b8f;if(_0x495e88>=_0x45fd33){_0x495e88=_0x45fd33;_0xcc6b8f=0xc8;}else{_0xcc6b8f=0xce;}_0x366fd1[_0xf6d9('0x21')](_0xcc6b8f);return _0x366fd1['set'](_0xf6d9('0x22'),_0x18c148+'-'+_0x495e88+'/'+_0x45fd33)[_0xf6d9('0x1c')](_0xc924c1);}return null;};}function patchUpdates(_0x38adff){return function(_0x3dfbde){try{jsonpatch[_0xf6d9('0x23')](_0x3dfbde,_0x38adff,!![]);}catch(_0x12a5cf){return BPromise[_0xf6d9('0x24')](_0x12a5cf);}return _0x3dfbde[_0xf6d9('0x25')]();};}function saveUpdates(_0x5bc6e3,_0x1670df){return function(_0x7abbc6){if(_0x7abbc6){return _0x7abbc6[_0xf6d9('0x26')](_0x5bc6e3)[_0xf6d9('0x27')](function(_0x243c94){return _0x243c94;});}return null;};}function removeEntity(_0x45c112,_0x2608ea){return function(_0x54e4ae){if(_0x54e4ae){return _0x54e4ae[_0xf6d9('0x28')]()[_0xf6d9('0x27')](function(){_0x45c112['status'](0xcc)[_0xf6d9('0x1b')]();});}};}function handleEntityNotFound(_0x5f985,_0x2fdd46){return function(_0x1f0982){if(!_0x1f0982){_0x5f985[_0xf6d9('0x1a')](0x194);}return _0x1f0982;};}function handleError(_0x41425f,_0x1f6981){_0x1f6981=_0x1f6981||0x1f4;return function(_0x5f5b1f){logger[_0xf6d9('0x29')](_0x5f5b1f[_0xf6d9('0x2a')]);if(_0x5f5b1f[_0xf6d9('0x2b')]){delete _0x5f5b1f[_0xf6d9('0x2b')];}_0x41425f[_0xf6d9('0x21')](_0x1f6981)[_0xf6d9('0x2c')](_0x5f5b1f);};}exports[_0xf6d9('0x2d')]=function(_0x37f0bc,_0x378514){var _0x129a41={},_0x579af4={},_0x196143={'count':0x0,'rows':[]};var _0x4a5eb0=_[_0xf6d9('0x2e')](db[_0xf6d9('0x2f')][_0xf6d9('0x30')],function(_0x1eb796){return{'name':_0x1eb796[_0xf6d9('0x31')],'type':_0x1eb796[_0xf6d9('0x32')][_0xf6d9('0x33')]};});_0x579af4[_0xf6d9('0x34')]=_[_0xf6d9('0x2e')](_0x4a5eb0,'name');_0x579af4['query']=_[_0xf6d9('0x35')](_0x37f0bc[_0xf6d9('0x36')]);_0x579af4[_0xf6d9('0x37')]=_[_0xf6d9('0x38')](_0x579af4[_0xf6d9('0x34')],_0x579af4[_0xf6d9('0x36')]);_0x129a41['attributes']=_[_0xf6d9('0x38')](_0x579af4[_0xf6d9('0x34')],qs[_0xf6d9('0x39')](_0x37f0bc['query'][_0xf6d9('0x39')]));_0x129a41[_0xf6d9('0x3a')]=_0x129a41[_0xf6d9('0x3a')]['length']?_0x129a41[_0xf6d9('0x3a')]:_0x579af4[_0xf6d9('0x34')];if(!_0x37f0bc[_0xf6d9('0x36')][_0xf6d9('0x3b')](_0xf6d9('0x3c'))){_0x129a41[_0xf6d9('0x1f')]=qs['limit'](_0x37f0bc['query'][_0xf6d9('0x1f')]);_0x129a41[_0xf6d9('0x1d')]=qs[_0xf6d9('0x1d')](_0x37f0bc[_0xf6d9('0x36')][_0xf6d9('0x1d')]);}_0x129a41[_0xf6d9('0x3d')]=qs['sort'](_0x37f0bc[_0xf6d9('0x36')][_0xf6d9('0x3e')]);_0x129a41['where']=qs[_0xf6d9('0x37')](_[_0xf6d9('0x3f')](_0x37f0bc['query'],_0x579af4['filters']),_0x4a5eb0);if(_0x37f0bc[_0xf6d9('0x36')][_0xf6d9('0x40')]){_0x129a41[_0xf6d9('0x41')]=_['merge'](_0x129a41[_0xf6d9('0x41')],{'$or':_[_0xf6d9('0x2e')](_0x4a5eb0,function(_0x442651){if(_0x442651[_0xf6d9('0x32')]!==_0xf6d9('0x42')){var _0x13d24e={};_0x13d24e[_0x442651['name']]={'$like':'%'+_0x37f0bc['query'][_0xf6d9('0x40')]+'%'};return _0x13d24e;}})});}_0x129a41=_[_0xf6d9('0x43')]({},_0x129a41,_0x37f0bc[_0xf6d9('0x44')]);var _0x5db5d5={'where':_0x129a41[_0xf6d9('0x41')]};return db[_0xf6d9('0x2f')][_0xf6d9('0x20')](_0x5db5d5)[_0xf6d9('0x27')](function(_0x12feaa){_0x196143['count']=_0x12feaa;if(_0x37f0bc[_0xf6d9('0x36')][_0xf6d9('0x45')]){_0x129a41['include']=[{'all':!![]}];}return db[_0xf6d9('0x2f')][_0xf6d9('0x46')](_0x129a41);})[_0xf6d9('0x27')](function(_0x28f9c9){_0x196143[_0xf6d9('0x47')]=_0x28f9c9;return _0x196143;})[_0xf6d9('0x27')](respondWithFilteredResult(_0x378514,_0x129a41))['catch'](handleError(_0x378514,null));};exports[_0xf6d9('0x48')]=function(_0x3361e,_0x179328){var _0x20aa1b={'raw':!![],'where':{'id':_0x3361e['params']['id']}},_0x4d1060={};_0x4d1060[_0xf6d9('0x34')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x4d1060[_0xf6d9('0x36')]=_['keys'](_0x3361e[_0xf6d9('0x36')]);_0x4d1060[_0xf6d9('0x37')]=_[_0xf6d9('0x38')](_0x4d1060[_0xf6d9('0x34')],_0x4d1060['query']);_0x20aa1b[_0xf6d9('0x3a')]=_[_0xf6d9('0x38')](_0x4d1060['model'],qs['fields'](_0x3361e[_0xf6d9('0x36')][_0xf6d9('0x39')]));_0x20aa1b[_0xf6d9('0x3a')]=_0x20aa1b['attributes']['length']?_0x20aa1b[_0xf6d9('0x3a')]:_0x4d1060[_0xf6d9('0x34')];if(_0x3361e[_0xf6d9('0x36')][_0xf6d9('0x45')]){_0x20aa1b[_0xf6d9('0x49')]=[{'all':!![]}];}_0x20aa1b=_[_0xf6d9('0x43')]({},_0x20aa1b,_0x3361e[_0xf6d9('0x44')]);return db[_0xf6d9('0x2f')][_0xf6d9('0x4a')](_0x20aa1b)[_0xf6d9('0x27')](handleEntityNotFound(_0x179328,null))[_0xf6d9('0x27')](respondWithResult(_0x179328,null))[_0xf6d9('0x4b')](handleError(_0x179328,null));};exports[_0xf6d9('0x4c')]=function(_0x2fb152,_0xfe6e76){return db[_0xf6d9('0x2f')][_0xf6d9('0x4c')](_0x2fb152['body'],{})[_0xf6d9('0x27')](respondWithResult(_0xfe6e76,0xc9))[_0xf6d9('0x4b')](handleError(_0xfe6e76,null));};exports[_0xf6d9('0x26')]=function(_0x4e29a1,_0x215d03){if(_0x4e29a1['body']['id']){delete _0x4e29a1[_0xf6d9('0x4d')]['id'];}return db[_0xf6d9('0x2f')]['find']({'where':{'id':_0x4e29a1[_0xf6d9('0x4e')]['id']}})[_0xf6d9('0x27')](handleEntityNotFound(_0x215d03,null))[_0xf6d9('0x27')](saveUpdates(_0x4e29a1[_0xf6d9('0x4d')],null))[_0xf6d9('0x27')](respondWithResult(_0x215d03,null))['catch'](handleError(_0x215d03,null));};exports[_0xf6d9('0x28')]=function(_0x9b120,_0x402a6a){return db[_0xf6d9('0x2f')][_0xf6d9('0x4a')]({'where':{'id':_0x9b120[_0xf6d9('0x4e')]['id']}})[_0xf6d9('0x27')](handleEntityNotFound(_0x402a6a,null))[_0xf6d9('0x27')](removeEntity(_0x402a6a,null))['catch'](handleError(_0x402a6a,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 0be9c10..31f23e3 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 _0x72f8=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','./openchannelApplication.attributes','OpenchannelApplication'];(function(_0xb8d37c,_0x10a6a4){var _0x400f4b=function(_0x479ae1){while(--_0x479ae1){_0xb8d37c['push'](_0xb8d37c['shift']());}};_0x400f4b(++_0x10a6a4);}(_0x72f8,0x7c));var _0x872f=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x72f8[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x872f('0x0'));var util=require(_0x872f('0x1'));var logger=require(_0x872f('0x2'))(_0x872f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x872f('0x4'));var fs=require('fs');var path=require(_0x872f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x872f('0x6'));module['exports']=function(_0x42a08d,_0x1bf963){return _0x42a08d['define'](_0x872f('0x7'),attributes,{'tableName':_0x872f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x872f('0x9'),'collate':_0x872f('0xa')});}; \ No newline at end of file +var _0xf89a=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2ce899,_0x4688d9){var _0x68dae1=function(_0x59433e){while(--_0x59433e){_0x2ce899['push'](_0x2ce899['shift']());}};_0x68dae1(++_0x4688d9);}(_0xf89a,0x6e));var _0xaf89=function(_0x2f1c94,_0x1b1f92){_0x2f1c94=_0x2f1c94-0x0;var _0x1407c8=_0xf89a[_0x2f1c94];return _0x1407c8;};'use strict';var _=require(_0xaf89('0x0'));var util=require(_0xaf89('0x1'));var logger=require('../../config/logger')(_0xaf89('0x2'));var moment=require(_0xaf89('0x3'));var BPromise=require(_0xaf89('0x4'));var rp=require(_0xaf89('0x5'));var fs=require('fs');var path=require(_0xaf89('0x6'));var rimraf=require(_0xaf89('0x7'));var config=require(_0xaf89('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0xaf89('0x9')]=function(_0x48b3a6,_0x152653){return _0x48b3a6[_0xaf89('0xa')](_0xaf89('0xb'),attributes,{'tableName':_0xaf89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf89('0xd'),'collate':_0xaf89('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 3c8093c..87f8ae8 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 _0xb502=['attributes','limit','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where'];(function(_0xe2070e,_0x3a8903){var _0x377eee=function(_0x1661bb){while(--_0x1661bb){_0xe2070e['push'](_0xe2070e['shift']());}};_0x377eee(++_0x3a8903);}(_0xb502,0xa3));var _0x2b50=function(_0x457d56,_0x41e754){_0x457d56=_0x457d56-0x0;var _0x445b57=_0xb502[_0x457d56];return _0x445b57;};'use strict';var _=require(_0x2b50('0x0'));var util=require('util');var moment=require(_0x2b50('0x1'));var BPromise=require(_0x2b50('0x2'));var rs=require(_0x2b50('0x3'));var fs=require('fs');var Redis=require(_0x2b50('0x4'));var db=require(_0x2b50('0x5'))['db'];var utils=require(_0x2b50('0x6'));var logger=require(_0x2b50('0x7'))(_0x2b50('0x8'));var config=require(_0x2b50('0x9'));var jayson=require(_0x2b50('0xa'));var client=jayson['client'][_0x2b50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30da27,_0xaa681e,_0x226bf1){return new BPromise(function(_0x48aa4c,_0x365ad4){return client[_0x2b50('0xc')](_0x30da27,_0x226bf1)[_0x2b50('0xd')](function(_0x579df3){logger['info'](_0x2b50('0xe'),_0xaa681e,_0x2b50('0xf'));logger[_0x2b50('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xaa681e,_0x2b50('0xf'),JSON[_0x2b50('0x11')](_0x579df3));if(_0x579df3['error']){if(_0x579df3[_0x2b50('0x12')][_0x2b50('0x13')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0xaa681e,_0x579df3[_0x2b50('0x12')][_0x2b50('0x14')]);return _0x365ad4(_0x579df3['error'][_0x2b50('0x14')]);}logger['error'](_0x2b50('0xe'),_0xaa681e,_0x579df3[_0x2b50('0x12')]['message']);return _0x48aa4c(_0x579df3[_0x2b50('0x12')][_0x2b50('0x14')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0xaa681e,'request\x20sent');_0x48aa4c(_0x579df3[_0x2b50('0x15')][_0x2b50('0x14')]);}})[_0x2b50('0x16')](function(_0x5dfad7){logger[_0x2b50('0x12')](_0x2b50('0xe'),_0xaa681e,_0x5dfad7);_0x365ad4(_0x5dfad7);});});}exports[_0x2b50('0x17')]=function(_0x5844d2){var _0x212993=this;return new Promise(function(_0x44cd61,_0x1fd8f5){return db[_0x2b50('0x18')]['update'](_0x5844d2[_0x2b50('0x19')],{'raw':_0x5844d2[_0x2b50('0x1a')]?_0x5844d2[_0x2b50('0x1a')][_0x2b50('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5844d2['options']?_0x5844d2['options'][_0x2b50('0x1c')]||null:null,'attributes':_0x5844d2['options']?_0x5844d2[_0x2b50('0x1a')][_0x2b50('0x1d')]||null:null,'limit':_0x5844d2[_0x2b50('0x1a')]?_0x5844d2[_0x2b50('0x1a')][_0x2b50('0x1e')]||null:null})[_0x2b50('0xd')](function(_0x168e57){logger[_0x2b50('0x1f')](_0x2b50('0x17'),_0x5844d2);logger[_0x2b50('0x10')]('UpdateOpenchannelApplication',_0x5844d2,JSON['stringify'](_0x168e57));_0x44cd61(_0x168e57);})[_0x2b50('0x16')](function(_0x122b92){logger[_0x2b50('0x12')](_0x2b50('0x17'),_0x122b92[_0x2b50('0x14')],_0x5844d2);_0x1fd8f5(_0x212993[_0x2b50('0x12')](0x1f4,_0x122b92['message']));});});}; \ No newline at end of file +var _0x694f=['message','result','catch','OpenchannelApplication','body','options','attributes','debug','UpdateOpenchannelApplication','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','http','then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x58696a,_0x2aed89){var _0x32393a=function(_0x1e38c9){while(--_0x1e38c9){_0x58696a['push'](_0x58696a['shift']());}};_0x32393a(++_0x2aed89);}(_0x694f,0x1d5));var _0xf694=function(_0x51724c,_0x2a9fdf){_0x51724c=_0x51724c-0x0;var _0x80c32c=_0x694f[_0x51724c];return _0x80c32c;};'use strict';var _=require('lodash');var util=require(_0xf694('0x0'));var moment=require('moment');var BPromise=require(_0xf694('0x1'));var rs=require(_0xf694('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf694('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf694('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf694('0x5'));var client=jayson['client'][_0xf694('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1e0f02,_0x5107f2,_0x2540fa){return new BPromise(function(_0x1eee52,_0x20f2aa){return client['request'](_0x1e0f02,_0x2540fa)[_0xf694('0x7')](function(_0x461d81){logger[_0xf694('0x8')](_0xf694('0x9'),_0x5107f2,'request\x20sent');logger['debug'](_0xf694('0xa'),_0x5107f2,_0xf694('0xb'),JSON[_0xf694('0xc')](_0x461d81));if(_0x461d81[_0xf694('0xd')]){if(_0x461d81[_0xf694('0xd')]['code']===0x1f4){logger[_0xf694('0xd')](_0xf694('0x9'),_0x5107f2,_0x461d81[_0xf694('0xd')][_0xf694('0xe')]);return _0x20f2aa(_0x461d81[_0xf694('0xd')][_0xf694('0xe')]);}logger['error'](_0xf694('0x9'),_0x5107f2,_0x461d81[_0xf694('0xd')]['message']);return _0x1eee52(_0x461d81[_0xf694('0xd')][_0xf694('0xe')]);}else{logger[_0xf694('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x5107f2,_0xf694('0xb'));_0x1eee52(_0x461d81[_0xf694('0xf')]['message']);}})[_0xf694('0x10')](function(_0x3058e8){logger['error'](_0xf694('0x9'),_0x5107f2,_0x3058e8);_0x20f2aa(_0x3058e8);});});}exports['UpdateOpenchannelApplication']=function(_0x43af7a){var _0x136394=this;return new Promise(function(_0x5dff54,_0x4700fc){return db[_0xf694('0x11')]['update'](_0x43af7a[_0xf694('0x12')],{'raw':_0x43af7a[_0xf694('0x13')]?_0x43af7a[_0xf694('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43af7a[_0xf694('0x13')]?_0x43af7a[_0xf694('0x13')]['where']||null:null,'attributes':_0x43af7a[_0xf694('0x13')]?_0x43af7a[_0xf694('0x13')][_0xf694('0x14')]||null:null,'limit':_0x43af7a['options']?_0x43af7a[_0xf694('0x13')]['limit']||null:null})[_0xf694('0x7')](function(_0x53d482){logger[_0xf694('0x8')]('UpdateOpenchannelApplication',_0x43af7a);logger[_0xf694('0x15')](_0xf694('0x16'),_0x43af7a,JSON[_0xf694('0xc')](_0x53d482));_0x5dff54(_0x53d482);})[_0xf694('0x10')](function(_0x512711){logger[_0xf694('0xd')](_0xf694('0x16'),_0x512711['message'],_0x43af7a);_0x4700fc(_0x136394['error'](0x1f4,_0x512711[_0xf694('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ae4012e..c25b383 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 _0x0327=['getMessages','/:id/download','post','addMessage','openchannel','openchannelinteraction:addtags','put','/:id','delete','tracked','openchannelinteraction:destroy','/:id/tags','removeTags','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','get','show','/:id/messages'];(function(_0x31fb3f,_0x3347fa){var _0x40f741=function(_0x14dba9){while(--_0x14dba9){_0x31fb3f['push'](_0x31fb3f['shift']());}};_0x40f741(++_0x3347fa);}(_0x0327,0x19d));var _0x7032=function(_0x4d12bf,_0x3d32a3){_0x4d12bf=_0x4d12bf-0x0;var _0x28e482=_0x0327[_0x4d12bf];return _0x28e482;};'use strict';var multer=require(_0x7032('0x0'));var util=require('util');var path=require(_0x7032('0x1'));var timeout=require(_0x7032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7032('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7032('0x4'));var config=require(_0x7032('0x5'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x7032('0x6')](),controller[_0x7032('0x7')]);router['get']('/describe',auth[_0x7032('0x6')](),controller[_0x7032('0x8')]);router[_0x7032('0x9')]('/:id',auth[_0x7032('0x6')](),controller[_0x7032('0xa')]);router[_0x7032('0x9')](_0x7032('0xb'),auth['isAuthenticated'](),controller[_0x7032('0xc')]);router[_0x7032('0x9')](_0x7032('0xd'),auth[_0x7032('0x6')](),controller['download']);router[_0x7032('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7032('0xe')](_0x7032('0xb'),auth[_0x7032('0x6')](),controller[_0x7032('0xf')]);router[_0x7032('0xe')]('/:id/tags',auth[_0x7032('0x6')](),interaction['tracked'](_0x7032('0x10'),_0x7032('0x11')),controller['addTags']);router[_0x7032('0x12')](_0x7032('0x13'),auth[_0x7032('0x6')](),interaction['tracked'](_0x7032('0x10'),'openchannelinteraction:update'),controller['update']);router[_0x7032('0x14')]('/:id',auth[_0x7032('0x6')](),interaction[_0x7032('0x15')](_0x7032('0x10'),_0x7032('0x16')),controller['destroy']);router[_0x7032('0x14')](_0x7032('0x17'),auth['isAuthenticated'](),controller[_0x7032('0x18')]);module['exports']=router; \ No newline at end of file +var _0x612d=['../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b0e90,_0x4cc25a){var _0x1569b7=function(_0x4b1bcc){while(--_0x4b1bcc){_0x3b0e90['push'](_0x3b0e90['shift']());}};_0x1569b7(++_0x4cc25a);}(_0x612d,0xbf));var _0xd612=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x612d[_0x40e854];return _0x1463b3;};'use strict';var multer=require(_0xd612('0x0'));var util=require(_0xd612('0x1'));var path=require('path');var timeout=require(_0xd612('0x2'));var express=require(_0xd612('0x3'));var router=express[_0xd612('0x4')]();var fs_extra=require(_0xd612('0x5'));var auth=require(_0xd612('0x6'));var interaction=require(_0xd612('0x7'));var config=require('../../config/environment');var controller=require(_0xd612('0x8'));router[_0xd612('0x9')]('/',auth[_0xd612('0xa')](),controller[_0xd612('0xb')]);router[_0xd612('0x9')](_0xd612('0xc'),auth[_0xd612('0xa')](),controller[_0xd612('0xd')]);router[_0xd612('0x9')](_0xd612('0xe'),auth[_0xd612('0xa')](),controller[_0xd612('0xf')]);router[_0xd612('0x9')](_0xd612('0x10'),auth[_0xd612('0xa')](),controller[_0xd612('0x11')]);router[_0xd612('0x9')](_0xd612('0x12'),auth[_0xd612('0xa')](),controller['download']);router[_0xd612('0x13')]('/',auth[_0xd612('0xa')](),controller[_0xd612('0x14')]);router[_0xd612('0x13')](_0xd612('0x10'),auth[_0xd612('0xa')](),controller[_0xd612('0x15')]);router['post'](_0xd612('0x16'),auth[_0xd612('0xa')](),interaction[_0xd612('0x17')](_0xd612('0x18'),_0xd612('0x19')),controller[_0xd612('0x1a')]);router[_0xd612('0x1b')](_0xd612('0xe'),auth[_0xd612('0xa')](),interaction['tracked'](_0xd612('0x18'),_0xd612('0x1c')),controller['update']);router[_0xd612('0x1d')]('/:id',auth[_0xd612('0xa')](),interaction[_0xd612('0x17')](_0xd612('0x18'),_0xd612('0x1e')),controller['destroy']);router[_0xd612('0x1d')](_0xd612('0x16'),auth[_0xd612('0xa')](),controller[_0xd612('0x1f')]);module[_0xd612('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 897911f..68572a3 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 _0x51f8=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x5cf6d6,_0x225cbc){var _0x79165=function(_0x15a754){while(--_0x15a754){_0x5cf6d6['push'](_0x5cf6d6['shift']());}};_0x79165(++_0x225cbc);}(_0x51f8,0x15f));var _0x851f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x51f8[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x851f('0x0'));module[_0x851f('0x1')]={'closed':{'type':Sequelize[_0x851f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x851f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x851f('0x3')]},'note':{'type':Sequelize[_0x851f('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x851f('0x3')]},'externalUrl':{'type':Sequelize[_0x851f('0x3')]},'lastMsgAt':{'type':Sequelize[_0x851f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x851f('0x5')]('in',_0x851f('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x851f('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xea03=['DATE','STRING','ENUM','out','sequelize','BOOLEAN'];(function(_0x3eb1ac,_0x3c4441){var _0x6b616f=function(_0xd949b1){while(--_0xd949b1){_0x3eb1ac['push'](_0x3eb1ac['shift']());}};_0x6b616f(++_0x3c4441);}(_0xea03,0x1ba));var _0x3ea0=function(_0x307296,_0x49b881){_0x307296=_0x307296-0x0;var _0x32f975=_0xea03[_0x307296];return _0x32f975;};'use strict';var Sequelize=require(_0x3ea0('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3ea0('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3ea0('0x2')]},'disposition':{'type':Sequelize[_0x3ea0('0x3')]},'secondDisposition':{'type':Sequelize[_0x3ea0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3ea0('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x3ea0('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3ea0('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3ea0('0x4')]('in',_0x3ea0('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3ea0('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 d6ffba8..bf3476e 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 _0xc93d=['search','sqlOperator','conditions','length','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','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','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','params','includeAll','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','Tag','emit','removeTags','unix','root','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','direction','secret','Account','get','mkdirSync','Openchannel','Owner','closed','closedAt','format','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../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','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','pick','field','color','tools_tags','select','u.id','ui.OpenchannelInteractionId','from','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xc93d,0x18c));var _0xdc93=function(_0x3b5377,_0x1cf47a){_0x3b5377=_0x3b5377-0x0;var _0x40ffde=_0xc93d[_0x3b5377];return _0x40ffde;};'use strict';var emlformat=require(_0xdc93('0x0'));var rimraf=require(_0xdc93('0x1'));var zipdir=require(_0xdc93('0x2'));var jsonpatch=require(_0xdc93('0x3'));var rp=require(_0xdc93('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdc93('0x5'));var util=require(_0xdc93('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdc93('0x7'));var ejs=require(_0xdc93('0x8'));var fs=require('fs');var fs_extra=require(_0xdc93('0x9'));var _=require('lodash');var squel=require(_0xdc93('0xa'));var crypto=require(_0xdc93('0xb'));var jsforce=require(_0xdc93('0xc'));var deskjs=require(_0xdc93('0xd'));var toCsv=require(_0xdc93('0x7'));var querystring=require('querystring');var Papa=require(_0xdc93('0xe'));var Redis=require(_0xdc93('0xf'));var authService=require(_0xdc93('0x10'));var qs=require(_0xdc93('0x11'));var as=require(_0xdc93('0x12'));var pdf=require(_0xdc93('0x13'));var hardwareService=require(_0xdc93('0x14'));var logger=require(_0xdc93('0x15'))(_0xdc93('0x16'));var utils=require(_0xdc93('0x17'));var config=require(_0xdc93('0x18'));var licenseUtil=require(_0xdc93('0x19'));var db=require('../../mysqldb')['db'];config[_0xdc93('0x1a')]=_[_0xdc93('0x1b')](config[_0xdc93('0x1a')],{'host':_0xdc93('0x1c'),'port':0x18eb});var socket=require(_0xdc93('0x1d'))(new Redis(config['redis']));require(_0xdc93('0x1e'))[_0xdc93('0x1f')](socket);function respondWithStatusCode(_0x1279b6,_0x1fa45f){_0x1fa45f=_0x1fa45f||0xcc;return function(_0x365de8){if(_0x365de8){return _0x1279b6[_0xdc93('0x20')](_0x1fa45f);}return _0x1279b6['status'](_0x1fa45f)[_0xdc93('0x21')]();};}function respondWithResult(_0x5938a3,_0x3670f1){_0x3670f1=_0x3670f1||0xc8;return function(_0x4e23fb){if(_0x4e23fb){return _0x5938a3[_0xdc93('0x22')](_0x3670f1)[_0xdc93('0x23')](_0x4e23fb);}};}function respondWithFilteredResult(_0x23fc85,_0x3affff){return function(_0x12cfbd){if(_0x12cfbd){var _0x18a34a=typeof _0x3affff[_0xdc93('0x24')]===_0xdc93('0x25')&&typeof _0x3affff['limit']===_0xdc93('0x25');var _0x4ea563=_0x12cfbd[_0xdc93('0x26')];var _0x4c12fe=_0x18a34a?0x0:_0x3affff[_0xdc93('0x24')];var _0x137bd2=_0x18a34a?_0x12cfbd[_0xdc93('0x26')]:_0x3affff[_0xdc93('0x24')]+_0x3affff['limit'];var _0x39b2c4;if(_0x137bd2>=_0x4ea563){_0x137bd2=_0x4ea563;_0x39b2c4=0xc8;}else{_0x39b2c4=0xce;}_0x23fc85[_0xdc93('0x22')](_0x39b2c4);return _0x23fc85[_0xdc93('0x27')](_0xdc93('0x28'),_0x4c12fe+'-'+_0x137bd2+'/'+_0x4ea563)[_0xdc93('0x23')](_0x12cfbd);}return null;};}function patchUpdates(_0x38143b){return function(_0x931765){try{jsonpatch['apply'](_0x931765,_0x38143b,!![]);}catch(_0x2ac147){return BPromise[_0xdc93('0x29')](_0x2ac147);}return _0x931765[_0xdc93('0x2a')]();};}function saveUpdates(_0x2ce0b9,_0x5d6091){return function(_0x29e926){if(_0x29e926){return _0x29e926[_0xdc93('0x2b')](_0x2ce0b9)['then'](function(_0x1e9413){return _0x1e9413;});}return null;};}function removeEntity(_0x4b9cb7,_0xf12e4e){return function(_0x3fcbd1){if(_0x3fcbd1){return _0x3fcbd1[_0xdc93('0x2c')]()[_0xdc93('0x2d')](function(){_0x4b9cb7[_0xdc93('0x22')](0xcc)[_0xdc93('0x21')]();});}};}function handleEntityNotFound(_0x1de30d,_0x27bdf2){return function(_0x46f417){if(!_0x46f417){_0x1de30d[_0xdc93('0x20')](0x194);}return _0x46f417;};}function handleError(_0x31cf11,_0x26d614){_0x26d614=_0x26d614||0x1f4;return function(_0x5d2e05){logger['error'](_0x5d2e05[_0xdc93('0x2e')]);if(_0x5d2e05[_0xdc93('0x2f')]){delete _0x5d2e05[_0xdc93('0x2f')];}_0x31cf11['status'](_0x26d614)[_0xdc93('0x30')](_0x5d2e05);};}function getInteractionUsers(_0x44467c,_0x376d16){return new BPromise(function(_0x18913f,_0x455cc7){try{if(_0x376d16[_0x44467c['id']]){_0x44467c[_0xdc93('0x31')]=_[_0xdc93('0x32')](_0x376d16[_0x44467c['id']],function(_0x285887){return{'id':_0x285887['id'],'fullname':_0x285887[_0xdc93('0x33')]};});}}catch(_0x3a42f7){_0x455cc7(_0x3a42f7);}_0x18913f(_0x44467c);});}function getInteractionTags(_0x4e0a33,_0x2096bf){return new BPromise(function(_0x1dc550,_0xf7ef8){try{if(_0x4e0a33[_0xdc93('0x34')]){_0x4e0a33[_0xdc93('0x35')]=[];_0x4e0a33['TagIds']['split'](',')[_0xdc93('0x36')](function(_0x472de9){_0x4e0a33[_0xdc93('0x35')][_0xdc93('0x37')](_0x2096bf[_0x472de9]);});}delete _0x4e0a33[_0xdc93('0x34')];}catch(_0xa034b){_0xf7ef8(_0xa034b);}_0x1dc550(_0x4e0a33);});}function updateOpenchannelInteraction(_0x475248,_0x4eb538,_0xd7477e){return new BPromise(function(_0x1f6ee8,_0x5bf51c){return getInteractionUsers(_0x475248,_0xd7477e)[_0xdc93('0x2d')](function(_0x140fae){return getInteractionTags(_0x140fae,_0x4eb538);})[_0xdc93('0x2d')](function(_0x3eb7c5){_0x1f6ee8(_0x3eb7c5);})[_0xdc93('0x38')](function(_0x5e4afc){_0x5bf51c(_0x5e4afc);});});}exports['index']=function(_0x5ca3e5,_0x4062ab){var _0x2d4584={},_0x393bb3={},_0x3ceb7d={'count':0x0,'rows':[]};var _0x17000c=_[_0xdc93('0x32')](db['OpenchannelInteraction'][_0xdc93('0x39')],function(_0x4d8157){return{'name':_0x4d8157[_0xdc93('0x3a')],'type':_0x4d8157[_0xdc93('0x3b')][_0xdc93('0x3c')]};});_0x393bb3[_0xdc93('0x3d')]=_[_0xdc93('0x32')](_0x17000c,_0xdc93('0x2f'));_0x393bb3[_0xdc93('0x3e')]=_[_0xdc93('0x3f')](_0x5ca3e5['query']);_0x393bb3['filters']=_[_0xdc93('0x40')](_0x393bb3['model'],_0x393bb3['query']);_0x2d4584[_0xdc93('0x41')]=_[_0xdc93('0x40')](_0x393bb3[_0xdc93('0x3d')],qs['fields'](_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x42')]));_0x2d4584['attributes']=_0x2d4584[_0xdc93('0x41')]['length']?_0x2d4584[_0xdc93('0x41')]:_0x393bb3[_0xdc93('0x3d')];if(!_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x43')]('nolimit')){_0x2d4584['limit']=qs[_0xdc93('0x44')](_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x44')]);_0x2d4584[_0xdc93('0x24')]=qs[_0xdc93('0x24')](_0x5ca3e5[_0xdc93('0x3e')]['offset']);}_0x2d4584['order']=qs[_0xdc93('0x45')](_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x45')]);_0x2d4584[_0xdc93('0x46')]=qs[_0xdc93('0x47')](_[_0xdc93('0x48')](_0x5ca3e5[_0xdc93('0x3e')],_0x393bb3['filters']),_0x17000c);var _0x20a60c=[];var _0xc9c086=squel['select']()[_0xdc93('0x49')]('id')[_0xdc93('0x49')](_0xdc93('0x2f'))[_0xdc93('0x49')](_0xdc93('0x4a'))['from'](_0xdc93('0x4b'));var _0x42100f=squel[_0xdc93('0x4c')]()[_0xdc93('0x49')](_0xdc93('0x4d'))['field']('u.fullname')[_0xdc93('0x49')](_0xdc93('0x4e'))[_0xdc93('0x4f')]('user_has_openchannel_interactions','ui')['left_join'](_0xdc93('0x50'),'u',_0xdc93('0x51'));var _0x3797af=squel[_0xdc93('0x4c')]()['from']('openchannel_interactions','i')[_0xdc93('0x52')](_0xdc93('0x53'),'c',_0xdc93('0x54'))[_0xdc93('0x52')](_0xdc93('0x50'),'o',_0xdc93('0x55'))['left_join']('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xdc93('0x52')](_0xdc93('0x56'),'me',_0xdc93('0x57'))['left_join'](_0xdc93('0x58'),'it',_0xdc93('0x59'))[_0xdc93('0x52')](_0xdc93('0x4b'),'t',_0xdc93('0x5a'));var _0xefe1f8=squel[_0xdc93('0x5b')]();var _0x4e815a=[];var _0x2a3b67=squel[_0xdc93('0x5b')]();var _0x11070d;if(_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x5c')]){_0x11070d=as['parseSearch'](_0x5ca3e5['query'][_0xdc93('0x5c')]);var _0x6f2da6=_0x11070d[_0xdc93('0x5d')];for(var _0x53c9ae=0x0;_0x53c9ae<_0x11070d[_0xdc93('0x5e')][_0xdc93('0x5f')];_0x53c9ae++){var _0x174b2b=_0x11070d[_0xdc93('0x5e')][_0x53c9ae];var _0x5985c5='i';var _0x2813da=_[_0xdc93('0x60')](_0x17000c,[_0xdc93('0x2f'),_0x174b2b[_0xdc93('0x49')]]);if(!_0x2813da){switch(_0x174b2b['field']){case _0xdc93('0x61'):if(_0x174b2b[_0xdc93('0x62')]==0x1){_0x3797af['having']('`'+_0x174b2b['field']+_0xdc93('0x63'));}else{_0x3797af[_0xdc93('0x64')]('`'+_0x174b2b[_0xdc93('0x49')]+_0xdc93('0x65'));}break;case _0xdc93('0x66'):if(_0x174b2b[_0xdc93('0x67')]==='$substring'){if(_0x174b2b[_0xdc93('0x62')][_0xdc93('0x68')]('\x20')[_0xdc93('0x5f')]>0x1){_0xefe1f8[_0x6f2da6](_0xdc93('0x69'),qs[_0xdc93('0x6a')](_0x174b2b['value']),null);}else{var _0x1af7d8='%'+_0x174b2b['value']+'%';_0xefe1f8[_0x6f2da6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1af7d8,_0x1af7d8,_0x1af7d8);}}else{_0x2813da=_[_0xdc93('0x60')](_0x17000c,['name',_0xdc93('0x6b')]);_0x174b2b[_0xdc93('0x49')]=_0xdc93('0x6b');_0x16d677=as[_0xdc93('0x6c')](_0x5985c5,_0x2813da[_0xdc93('0x3b')],_0x174b2b);_0xefe1f8[_0x6f2da6](_0x16d677[_0xdc93('0x6d')],_0x16d677[_0xdc93('0x62')][_0xdc93('0x6e')],_0x16d677[_0xdc93('0x62')][_0xdc93('0x21')]);}break;case'Tag':var _0x2afbe=_0x174b2b[_0xdc93('0x62')][_0xdc93('0x68')](',')[_0xdc93('0x32')](function(_0x1dcf7e){return Number(_0x1dcf7e);});_0x2afbe[_0xdc93('0x36')](function(_0x9243c1){_0x2a3b67['or'](_0xdc93('0x6f'),'%,'+_0x9243c1+',%');});_0x4e815a=_[_0xdc93('0x70')](_0x4e815a,_0x2afbe);break;case _0xdc93('0x71'):if(_0x174b2b['operator']===_0xdc93('0x72')){_0xefe1f8[_0x6f2da6](_0xdc93('0x73'),'%'+_0x174b2b['value']+'%',null);}else{_0x2813da=_[_0xdc93('0x60')](_0x17000c,[_0xdc93('0x2f'),_0xdc93('0x74')]);_0x174b2b['field']=_0xdc93('0x74');_0x16d677=as['buildExpression'](_0x5985c5,_0x2813da[_0xdc93('0x3b')],_0x174b2b);_0xefe1f8[_0x6f2da6](_0x16d677[_0xdc93('0x6d')],_0x16d677[_0xdc93('0x62')][_0xdc93('0x6e')],_0x16d677[_0xdc93('0x62')][_0xdc93('0x21')]);}break;case'body':_0x16d677=as[_0xdc93('0x6c')]('me',null,_0x174b2b);_0xefe1f8[_0x6f2da6](_0x16d677[_0xdc93('0x6d')],_0x16d677['value'][_0xdc93('0x6e')],_0x16d677[_0xdc93('0x62')][_0xdc93('0x21')]);break;}}else{var _0x16d677=as['buildExpression'](_0x5985c5,_0x2813da[_0xdc93('0x3b')],_0x174b2b);_0xefe1f8[_0x6f2da6](_0x16d677[_0xdc93('0x6d')],_0x16d677['value']['start'],_0x16d677[_0xdc93('0x62')]['end']);}}}else{var _0x531eb4=_(_0x5ca3e5['query'])[_0xdc93('0x3f')]()[_0xdc93('0x32')](function(_0x2d4c90){return _[_0xdc93('0x75')](_0x17000c,['name',_0x2d4c90])?_0x2d4c90:undefined;})[_0xdc93('0x76')]()[_0xdc93('0x62')]();if(!_[_0xdc93('0x77')](_0x531eb4)){_0x531eb4[_0xdc93('0x36')](function(_0x36adef){if(_0x36adef===_0xdc93('0x78')){_0x3797af['where'](_0xdc93('0x79'),[][_0xdc93('0x7a')](_0x5ca3e5['query'][_0x36adef]));}else if(_0x36adef===_0xdc93('0x7b')){var _0x22c974=JSON[_0xdc93('0x7c')](_0x5ca3e5[_0xdc93('0x3e')][_0x36adef])['$gte'];var _0x5384ea=JSON['parse'](_0x5ca3e5['query'][_0x36adef])[_0xdc93('0x7d')];_0x3797af[_0xdc93('0x46')](_0xdc93('0x7e'),_0x22c974,_0x5384ea);}else{if(_0x5ca3e5['query'][_0x36adef]===_0xdc93('0x7f')){_0x3797af[_0xdc93('0x46')]('i.'+_0x36adef+_0xdc93('0x80'));}else{_0x3797af['where']('i.'+_0x36adef+'\x20=\x20?',_0x5ca3e5['query'][_0x36adef]);}}});}if(_0x5ca3e5['query'][_0xdc93('0x81')]){if(_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x81')]==0x1){_0x3797af[_0xdc93('0x64')](_0xdc93('0x82'));}else{_0x3797af[_0xdc93('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x83')]){_0x4e815a=_[_0xdc93('0x84')](_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x83')])?_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x83')]:new Array(_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x83')]);_0x4e815a[_0xdc93('0x36')](function(_0x274635){_0x2a3b67['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x274635+',%');});}if(_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x85')]){var _0x39bc8b=_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x85')][_0xdc93('0x86')]('\x5c','\x5c\x5c')[_0xdc93('0x86')](/'/g,'\x27\x27');if(qs[_0xdc93('0x87')](_0x39bc8b)){_0xefe1f8['or'](_0xdc93('0x88'),_0x39bc8b+'%');}else{_0xefe1f8['or'](_0xdc93('0x89'),qs['getFullTextValue'](_0x39bc8b))['or'](_0xdc93('0x8a'),_0x39bc8b+'%')['or'](_0xdc93('0x8b'),_0x39bc8b+'%');}}}_0x3797af[_0xdc93('0x46')](_0xefe1f8);_0x3797af[_0xdc93('0x8c')]('i.id');var _0x6a17ce={'type':db['Sequelize'][_0xdc93('0x8d')][_0xdc93('0x8e')],'raw':!![]};var _0x353064=_0x3797af[_0xdc93('0x8f')]();_0x353064[_0xdc93('0x49')](_0xdc93('0x90'));_0x353064[_0xdc93('0x49')](_0xdc93('0x91'),_0xdc93('0x61'));if(_0x2d4584[_0xdc93('0x92')]){_0x2d4584['order'][_0xdc93('0x36')](function(_0x5b1b7a){var _0x4d7c5e=_0x5b1b7a[0x0]===_0xdc93('0x93')?_0x5b1b7a[0x0]:'i.'+_0x5b1b7a[0x0];_0x3797af[_0xdc93('0x92')](_0x4d7c5e,_0x5b1b7a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xdc93('0x77')](_0x4e815a)){_0x3797af[_0xdc93('0x64')](_0x2a3b67);_0x353064[_0xdc93('0x46')]('t.id\x20IN\x20?',_0x4e815a);}BPromise[_0xdc93('0x94')]()[_0xdc93('0x2d')](function(){if(!_0x11070d){if(_0x5ca3e5[_0xdc93('0x3e')][_0xdc93('0x78')])return;_0x353064['where'](_0xdc93('0x95'));_0x3797af['where'](_0xdc93('0x95'));return;}if(_0x5ca3e5[_0xdc93('0x96')][_0xdc93('0x97')]!==_0xdc93('0x98'))return;return _0x5ca3e5['user'][_0xdc93('0x99')]({'attributes':['id'],'raw':!![]})[_0xdc93('0x2d')](function(_0x4f7246){if(_['isEmpty'](_0x4f7246)){_0x353064[_0xdc93('0x46')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3797af[_0xdc93('0x46')](_0xdc93('0x9a'));}else{_0x353064['where'](_0xdc93('0x79'),_[_0xdc93('0x32')](_0x4f7246,'id'));_0x3797af['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0xdc93('0x32')](_0x4f7246,'id'));}});})['then'](function(){if(_0x5ca3e5[_0xdc93('0x96')][_0xdc93('0x97')]===_0xdc93('0x98')&&!_0x11070d&&!_0x5ca3e5['query'][_0xdc93('0x78')])return[];return db[_0xdc93('0x9b')][_0xdc93('0x3e')](_0x353064[_0xdc93('0x9c')](),_0x6a17ce);})[_0xdc93('0x2d')](function(_0xd7d56e){_0x3ceb7d[_0xdc93('0x26')]=_0xd7d56e[_0xdc93('0x5f')];if(_0x3ceb7d[_0xdc93('0x26')]===0x0)return[];return db[_0xdc93('0x9b')][_0xdc93('0x3e')](_0xc9c086[_0xdc93('0x9c')](),_0x6a17ce)['then'](function(_0x3f59f8){_0x20a60c=_[_0xdc93('0x9d')](_0x3f59f8,'id');_0x6a17ce=_[_0xdc93('0x9e')](_0x6a17ce,{'model':db[_0xdc93('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ca3e5['query'][_0xdc93('0x42')]){_0x2d4584[_0xdc93('0x41')][_0xdc93('0x36')](function(_0xf1f069){_0x3797af['field']('i.'+_0xf1f069);});}else{_0x3797af['field'](_0xdc93('0x91'),'unreadMessages');_0x3797af[_0xdc93('0x49')](_0xdc93('0xa0'),'Account.key');_0x3797af[_0xdc93('0x49')]('a.mandatoryDisposition',_0xdc93('0xa1'));_0x3797af['field'](_0xdc93('0xa2'),_0xdc93('0x93'));_0x3797af[_0xdc93('0x49')](_0xdc93('0xa3'));_0x3797af['field'](_0xdc93('0xa4'),'Contact.firstName');_0x3797af[_0xdc93('0x49')](_0xdc93('0xa5'),'Contact.lastName');_0x3797af[_0xdc93('0x49')]('c.email',_0xdc93('0xa6'));_0x3797af[_0xdc93('0x49')](_0xdc93('0xa7'),_0xdc93('0xa8'));_0x3797af[_0xdc93('0x49')](_0xdc93('0xa9'),'Contact.mobile');_0x3797af[_0xdc93('0x49')](_0xdc93('0xaa'),_0xdc93('0xab'));_0x3797af[_0xdc93('0x49')](_0xdc93('0xac'),_0xdc93('0xad'));_0x3797af[_0xdc93('0x49')](_0xdc93('0xae'),_0xdc93('0xaf'));_0x3797af[_0xdc93('0x49')](_0xdc93('0xb0'),_0xdc93('0x34'));}if(_0x2d4584[_0xdc93('0x44')])_0x3797af[_0xdc93('0x44')](_0x2d4584['limit']);if(_0x2d4584[_0xdc93('0x24')])_0x3797af[_0xdc93('0x24')](_0x2d4584['offset']);return db[_0xdc93('0x9b')][_0xdc93('0x3e')](_0x3797af[_0xdc93('0x9c')](),_0x6a17ce);})[_0xdc93('0x2d')](function(_0x1f0ef0){if(_0x1f0ef0[_0xdc93('0x5f')]>0x0)_0x42100f['where'](_0xdc93('0xb1'),_[_0xdc93('0x32')](_0x1f0ef0,'id'));return db['sequelize']['query'](_0x42100f[_0xdc93('0x9c')](),_0x6a17ce)[_0xdc93('0x2d')](function(_0x7dd48f){var _0x3d5d59=_[_0xdc93('0xb2')](_0x7dd48f,_0xdc93('0xb3'));var _0x2401fc=[];_0x1f0ef0['forEach'](function(_0x16a745){_0x2401fc[_0xdc93('0x37')](updateOpenchannelInteraction(_0x16a745,_0x20a60c,_0x3d5d59));});return BPromise['all'](_0x2401fc);});});})['then'](function(_0x5961ad){_0x3ceb7d[_0xdc93('0xb4')]=_0x5961ad;return _0x3ceb7d;})[_0xdc93('0x2d')](respondWithFilteredResult(_0x4062ab,_0x2d4584))[_0xdc93('0x38')](handleError(_0x4062ab,null));};exports[_0xdc93('0xb5')]=function(_0x3ca6f0,_0x444dd0){var _0x5872af={};if(_0x3ca6f0[_0xdc93('0x3e')][_0xdc93('0x3b')]&&_0x3ca6f0[_0xdc93('0x3e')][_0xdc93('0x3b')]==='from'){_0x5872af[_0xdc93('0x4f')]=_0x3ca6f0['params']['id'];}else{_0x5872af['id']=_0x3ca6f0[_0xdc93('0xb6')]['id'];}var _0x292acf={'raw':![],'where':_0x5872af},_0x966580={};_0x966580[_0xdc93('0x3d')]=_[_0xdc93('0x3f')](db[_0xdc93('0x9f')][_0xdc93('0x39')]);_0x966580['query']=_[_0xdc93('0x3f')](_0x3ca6f0[_0xdc93('0x3e')]);_0x966580[_0xdc93('0x47')]=_[_0xdc93('0x40')](_0x966580[_0xdc93('0x3d')],_0x966580[_0xdc93('0x3e')]);_0x292acf[_0xdc93('0x41')]=_[_0xdc93('0x40')](_0x966580[_0xdc93('0x3d')],qs['fields'](_0x3ca6f0['query'][_0xdc93('0x42')]));_0x292acf[_0xdc93('0x41')]=_0x292acf[_0xdc93('0x41')][_0xdc93('0x5f')]?_0x292acf[_0xdc93('0x41')]:_0x966580[_0xdc93('0x3d')];if(_0x3ca6f0[_0xdc93('0x3e')][_0xdc93('0xb7')]){_0x292acf['include']=[{'all':!![]}];}_0x292acf=_[_0xdc93('0x9e')]({},_0x292acf,_0x3ca6f0['options']);return db['OpenchannelInteraction'][_0xdc93('0x60')](_0x292acf)[_0xdc93('0x2d')](handleEntityNotFound(_0x444dd0,null))[_0xdc93('0x2d')](respondWithResult(_0x444dd0,null))[_0xdc93('0x38')](handleError(_0x444dd0,null));};exports['create']=function(_0xf81d90,_0x23e81f){return db['OpenchannelInteraction']['create'](_0xf81d90[_0xdc93('0xb8')],{})['then'](respondWithResult(_0x23e81f,0xc9))[_0xdc93('0x38')](handleError(_0x23e81f,null));};exports[_0xdc93('0x2b')]=function(_0x1ba995,_0x1b5858){if(_0x1ba995[_0xdc93('0xb8')]['id']){delete _0x1ba995[_0xdc93('0xb8')]['id'];}return db[_0xdc93('0x9f')][_0xdc93('0x60')]({'where':{'id':_0x1ba995[_0xdc93('0xb6')]['id']}})[_0xdc93('0x2d')](handleEntityNotFound(_0x1b5858,null))[_0xdc93('0x2d')](saveUpdates(_0x1ba995[_0xdc93('0xb8')],null))[_0xdc93('0x2d')](respondWithResult(_0x1b5858,null))[_0xdc93('0x38')](handleError(_0x1b5858,null));};exports[_0xdc93('0x2c')]=function(_0x4d8652,_0x2befa2){return db[_0xdc93('0x9f')][_0xdc93('0x60')]({'where':{'id':_0x4d8652['params']['id']}})[_0xdc93('0x2d')](handleEntityNotFound(_0x2befa2,null))['then'](removeEntity(_0x2befa2,null))[_0xdc93('0x38')](handleError(_0x2befa2,null));};exports[_0xdc93('0xb9')]=function(_0x4bd645,_0x58a99f){return db[_0xdc93('0x9f')][_0xdc93('0xb9')]()['then'](respondWithResult(_0x58a99f,null))['catch'](handleError(_0x58a99f,null));};exports['addMessage']=function(_0xccf29f,_0x5910f9,_0x1ad440){return db['OpenchannelMessage'][_0xdc93('0x60')]({'where':{'id':_0xccf29f[_0xdc93('0xb6')]['id']}})[_0xdc93('0x2d')](handleEntityNotFound(_0x5910f9,null))[_0xdc93('0x2d')](function(_0x423cbf){if(_0x423cbf){return _0x423cbf[_0xdc93('0xba')](_0xccf29f[_0xdc93('0xb8')][_0xdc93('0xbb')],_[_0xdc93('0xbc')](_0xccf29f[_0xdc93('0xb8')],[_0xdc93('0xbb'),'id'])||{});}})[_0xdc93('0x2d')](respondWithResult(_0x5910f9,null))[_0xdc93('0x38')](handleError(_0x5910f9,null));};exports[_0xdc93('0xbd')]=function(_0x23aba7,_0x486f99,_0xa6d6a2){var _0x592cc={'raw':![],'where':{}};var _0x4cf51a={};var _0x3c42c1={'count':0x0,'rows':[]};return db[_0xdc93('0x9f')][_0xdc93('0xbe')]({'where':{'id':_0x23aba7[_0xdc93('0xb6')]['id']}})[_0xdc93('0x2d')](handleEntityNotFound(_0x486f99,null))['then'](function(_0x2f4997){if(_0x2f4997){_0x4cf51a[_0xdc93('0x3d')]=_[_0xdc93('0x3f')](db[_0xdc93('0xbf')][_0xdc93('0x39')]);_0x4cf51a['query']=_[_0xdc93('0x3f')](_0x23aba7[_0xdc93('0x3e')]);_0x4cf51a['filters']=_[_0xdc93('0x40')](_0x4cf51a['model'],_0x4cf51a[_0xdc93('0x3e')]);_0x592cc['attributes']=_[_0xdc93('0x40')](_0x4cf51a['model'],qs[_0xdc93('0x42')](_0x23aba7[_0xdc93('0x3e')][_0xdc93('0x42')]));_0x592cc[_0xdc93('0x41')]=_0x592cc[_0xdc93('0x41')][_0xdc93('0x5f')]?_0x592cc[_0xdc93('0x41')]:_0x4cf51a[_0xdc93('0x3d')];if(!_0x23aba7[_0xdc93('0x3e')][_0xdc93('0x43')](_0xdc93('0xc0'))){_0x592cc[_0xdc93('0x44')]=qs[_0xdc93('0x44')](_0x23aba7[_0xdc93('0x3e')][_0xdc93('0x44')]);_0x592cc['offset']=qs[_0xdc93('0x24')](_0x23aba7[_0xdc93('0x3e')][_0xdc93('0x24')]);}_0x592cc[_0xdc93('0x92')]=qs[_0xdc93('0x45')](_0x23aba7[_0xdc93('0x3e')][_0xdc93('0x45')]);_0x592cc[_0xdc93('0x46')]=qs['filters'](_[_0xdc93('0x48')](_0x23aba7[_0xdc93('0x3e')],_0x4cf51a['filters']));_0x592cc[_0xdc93('0x46')][_0xdc93('0xb3')]=_0x2f4997['id'];if(_0x23aba7[_0xdc93('0x3e')][_0xdc93('0x85')]){_0x592cc[_0xdc93('0x46')]=_[_0xdc93('0x9e')](_0x592cc['where'],{'$or':_[_0xdc93('0x32')](_0x592cc[_0xdc93('0x41')],function(_0x3d495f){var _0x4e237d={};_0x4e237d[_0x3d495f]={'$like':'%'+_0x23aba7[_0xdc93('0x3e')]['filter']+'%'};return _0x4e237d;})});}if(_0x23aba7[_0xdc93('0x3e')][_0xdc93('0xc1')]){var _0xefe884=_0x23aba7[_0xdc93('0x3e')][_0xdc93('0xc1')][_0xdc93('0x68')](',');var _0x256f02={};_0x256f02[_0xefe884[0x0]]={'$gte':moment(_0xefe884[0x1])['format'](_0xdc93('0xc2'))};_0x592cc[_0xdc93('0x46')]=_[_0xdc93('0x9e')](_0x592cc['where'],_0x256f02);}_0x592cc=_['merge']({},_0x592cc,_0x23aba7['options']);return db['OpenchannelMessage']['count']({'where':_0x592cc[_0xdc93('0x46')]})[_0xdc93('0x2d')](function(_0x2c2c65){_0x3c42c1['count']=_0x2c2c65;if(_0x23aba7[_0xdc93('0x3e')][_0xdc93('0xb7')]){_0x592cc[_0xdc93('0xc3')]=[{'all':!![]}];}return db[_0xdc93('0xbf')][_0xdc93('0xc4')](_0x592cc);})['then'](function(_0x3a42e9){_0x3c42c1[_0xdc93('0xb4')]=_0x3a42e9;return _0x3c42c1;});}})[_0xdc93('0x2d')](respondWithFilteredResult(_0x486f99,_0x592cc))[_0xdc93('0x38')](handleError(_0x486f99,null));};exports[_0xdc93('0xc5')]=function(_0x36f7b0,_0x239bbf,_0x12849d){return db[_0xdc93('0x9f')][_0xdc93('0x60')]({'where':{'id':_0x36f7b0[_0xdc93('0xb6')]['id']}})['then'](handleEntityNotFound(_0x239bbf,null))['then'](function(_0x510f48){if(_0x510f48){return _0x510f48[_0xdc93('0xc6')](_0x36f7b0[_0xdc93('0xb8')][_0xdc93('0xbb')],_[_0xdc93('0xbc')](_0x36f7b0[_0xdc93('0xb8')],['ids','id'])||{})['spread'](function(){return db[_0xdc93('0xc7')][_0xdc93('0xc4')]({'attributes':['id',_0xdc93('0x2f'),_0xdc93('0x4a')],'where':{'id':_0x36f7b0[_0xdc93('0xb8')][_0xdc93('0xbb')]}});})[_0xdc93('0x2d')](function(_0x176f4d){socket[_0xdc93('0xc8')]('openchannelInteractionTags:save',{'id':Number(_0x36f7b0[_0xdc93('0xb6')]['id']),'tags':_0x176f4d||[]});return{'id':Number(_0x36f7b0[_0xdc93('0xb6')]['id']),'tags':_0x176f4d||[]};});}})['then'](respondWithResult(_0x239bbf,null))[_0xdc93('0x38')](handleError(_0x239bbf,null));};exports[_0xdc93('0xc9')]=function(_0x1e8102,_0x3b7ff6,_0x3ebfd9){return db[_0xdc93('0x9f')][_0xdc93('0x60')]({'where':{'id':_0x1e8102[_0xdc93('0xb6')]['id']}})[_0xdc93('0x2d')](handleEntityNotFound(_0x3b7ff6,null))['then'](function(_0x2f52e9){if(_0x2f52e9){return _0x2f52e9['removeTags'](_0x1e8102[_0xdc93('0x3e')]['ids']);}})[_0xdc93('0x2d')](respondWithStatusCode(_0x3b7ff6,null))[_0xdc93('0x38')](handleError(_0x3b7ff6,null));};exports['download']=function(_0xa9ee64,_0x338b81){var _0x567c9d=moment()[_0xdc93('0xca')]()['toString']();var _0x24bb7d=path['join'](config[_0xdc93('0xcb')],'server',_0xdc93('0xcc'),_0xdc93('0xcd'));var _0x401dbb=path[_0xdc93('0xce')](config[_0xdc93('0xcb')],'server',_0xdc93('0xcc'),_0xdc93('0xcf'));var _0x5dc02f=path[_0xdc93('0xce')](_0x24bb7d,_0x567c9d);var _0x220d6e=util['format'](_0xdc93('0xd0'),_0xa9ee64[_0xdc93('0xb6')]['id'],_0x567c9d);var _0x2bf9d4=path[_0xdc93('0xce')](_0x24bb7d,_0x220d6e);var _0x4f59b2=[];_0x4f59b2[_0xdc93('0x37')]({'model':db[_0xdc93('0x71')],'as':'User','attributes':['id',_0xdc93('0x33')],'raw':!![]});_0x4f59b2['push']({'model':db[_0xdc93('0xd1')],'as':'Contact','attributes':['id',_0xdc93('0xd2'),_0xdc93('0xd3')],'raw':!![]});if(_0xa9ee64[_0xdc93('0x3e')][_0xdc93('0xcf')]){_0x4f59b2[_0xdc93('0x37')]({'model':db[_0xdc93('0xd4')],'as':'Attachment','raw':!![]});}var _0x57be3e=[{'model':db[_0xdc93('0xbf')],'as':'Messages','attributes':['id',_0xdc93('0xb8'),_0xdc93('0x7b'),_0xdc93('0xd5'),_0xdc93('0xd6'),_0xdc93('0x81')],'include':_0x4f59b2}];_0x57be3e['push']({'model':db['OpenchannelAccount'],'as':_0xdc93('0xd7'),'attributes':['id',_0xdc93('0x2f')]});_0x57be3e[_0xdc93('0x37')]({'model':db[_0xdc93('0x71')],'as':'Owner','attributes':['id',_0xdc93('0x33')]});return db[_0xdc93('0x9f')][_0xdc93('0x60')]({'where':{'id':_0xa9ee64['params']['id']},'include':_0x57be3e})[_0xdc93('0x2d')](handleEntityNotFound(_0x338b81,null))[_0xdc93('0x2d')](function(_0x3a655a){if(_0x3a655a){var _0x5be5c2=_0x3a655a[_0xdc93('0xd8')]({'plain':!![]});fs[_0xdc93('0xd9')](_0x5dc02f);var _0x7e5d6e={'channel':_0xdc93('0xda'),'account':_0x5be5c2['Account'][_0xdc93('0x2f')],'agent':_0x5be5c2['Owner']?_0x5be5c2[_0xdc93('0xdb')][_0xdc93('0x33')]:'N.A.','createdAt':moment(_0x5be5c2['createdAt'])['format'](_0xdc93('0xc2'))[_0xdc93('0x9c')](),'closedAt':_0x5be5c2[_0xdc93('0xdc')]?moment(_0x5be5c2[_0xdc93('0xdd')])[_0xdc93('0xde')](_0xdc93('0xc2'))[_0xdc93('0x9c')]():'','disposition':_0x5be5c2[_0xdc93('0xdf')],'visibility':_0x5be5c2[_0xdc93('0xe0')]?_0xdc93('0xe1'):_0xdc93('0xe2'),'messages':_(_0x5be5c2[_0xdc93('0xe3')])[_0xdc93('0x85')]({'secret':![]})[_0xdc93('0x32')](function(_0x2b0601){if(_0x2b0601['Attachment']){var _0x2e8438=path[_0xdc93('0xce')](_0x401dbb,_0x2b0601[_0xdc93('0xd4')][_0xdc93('0xe4')]);if(fs[_0xdc93('0xe5')](_0x2e8438)){fs[_0xdc93('0xe6')](_0x2e8438)[_0xdc93('0xe7')](fs[_0xdc93('0xe8')](path['join'](_0x5dc02f,_0x2b0601[_0xdc93('0xd4')][_0xdc93('0xe4')])));}}return{'date':moment(_0x2b0601[_0xdc93('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xdc93('0x9c')](),'sender':_0x2b0601[_0xdc93('0xd5')]==='out'?_0x2b0601['User']?_0x2b0601[_0xdc93('0x71')][_0xdc93('0x33')]:_0xdc93('0xe9'):_0x2b0601[_0xdc93('0x66')][_0xdc93('0xd2')]+(_0x2b0601['Contact']['lastName']?'\x20'+_0x2b0601['Contact'][_0xdc93('0xd3')]:''),'body':_0x2b0601['Attachment']?_0x2b0601['Attachment'][_0xdc93('0xe4')]:_0x2b0601[_0xdc93('0xb8')],'direction':_0x2b0601[_0xdc93('0xd5')]===_0xdc93('0xea')?'A':'C','secret':_0x2b0601[_0xdc93('0xd6')],'read':_0x2b0601[_0xdc93('0x81')],'attachment':_0x2b0601['Attachment']};})['value']()};return ejs[_0xdc93('0xeb')](path[_0xdc93('0xce')](config[_0xdc93('0xcb')],_0xdc93('0xec'),_0xdc93('0xed'),_0xdc93('0xee')),{'interaction':_0x7e5d6e})[_0xdc93('0x2d')](function(_0x18aff4){var _0x377771=path[_0xdc93('0xce')](_0x5dc02f,_0xdc93('0xef')+_0x5be5c2['id']+'-'+_0x567c9d+_0xdc93('0xf0'));var _0x246854={'path':_0x377771,'channel':_0xdc93('0xda'),'interactionId':_0x5be5c2['id']};return pdf[_0xdc93('0xf1')](_0x18aff4,_0x246854);})[_0xdc93('0x2d')](function(){return new BPromise(function(_0x561cbb,_0x502488){zipdir(_0x5dc02f,{'saveTo':_0x2bf9d4},function(_0x5a5a79,_0x2e6ab5){if(_0x5a5a79)return _0x502488(_0x5a5a79);return _0x561cbb(_0x2e6ab5);});})['then'](function(){return new BPromise(function(_0x2e2a93,_0x30fb43){rimraf(_0x5dc02f,function(_0x53a1a9){if(_0x53a1a9)_0x30fb43(_0x53a1a9);return _0x2e2a93();});});})[_0xdc93('0x2d')](function(){return _0x338b81['download'](_0x2bf9d4,_0x220d6e,function(_0x309b8c){if(_0x309b8c){console[_0xdc93('0xf2')]('err',_0x309b8c);}else{fs[_0xdc93('0xf3')](_0x2bf9d4);}});});});}else{return _0x338b81['sendStatus'](0xc8);}})[_0xdc93('0x38')](handleError(_0x338b81,null));}; \ No newline at end of file +var _0xfe61=['CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','params','options','create','update','destroy','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','spread','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','direction','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','then','sendStatus','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','having','`\x20=\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','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)','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfe61,0x147));var _0x1fe6=function(_0x45a0ed,_0x1f2d3a){_0x45a0ed=_0x45a0ed-0x0;var _0x279483=_0xfe61[_0x45a0ed];return _0x279483;};'use strict';var emlformat=require(_0x1fe6('0x0'));var rimraf=require(_0x1fe6('0x1'));var zipdir=require(_0x1fe6('0x2'));var jsonpatch=require(_0x1fe6('0x3'));var rp=require(_0x1fe6('0x4'));var moment=require(_0x1fe6('0x5'));var BPromise=require(_0x1fe6('0x6'));var Mustache=require('mustache');var util=require(_0x1fe6('0x7'));var path=require(_0x1fe6('0x8'));var sox=require('sox');var csv=require(_0x1fe6('0x9'));var ejs=require(_0x1fe6('0xa'));var fs=require('fs');var fs_extra=require(_0x1fe6('0xb'));var _=require(_0x1fe6('0xc'));var squel=require('squel');var crypto=require(_0x1fe6('0xd'));var jsforce=require(_0x1fe6('0xe'));var deskjs=require(_0x1fe6('0xf'));var toCsv=require(_0x1fe6('0x9'));var querystring=require(_0x1fe6('0x10'));var Papa=require(_0x1fe6('0x11'));var Redis=require(_0x1fe6('0x12'));var authService=require(_0x1fe6('0x13'));var qs=require(_0x1fe6('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1fe6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fe6('0x16'));var utils=require('../../config/utils');var config=require(_0x1fe6('0x17'));var licenseUtil=require(_0x1fe6('0x18'));var db=require(_0x1fe6('0x19'))['db'];config['redis']=_[_0x1fe6('0x1a')](config[_0x1fe6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1fe6('0x1c'))(new Redis(config[_0x1fe6('0x1b')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x72a948,_0x59371a){_0x59371a=_0x59371a||0xcc;return function(_0x55c37a){if(_0x55c37a){return _0x72a948['sendStatus'](_0x59371a);}return _0x72a948[_0x1fe6('0x1d')](_0x59371a)[_0x1fe6('0x1e')]();};}function respondWithResult(_0xb314ee,_0x44a0d2){_0x44a0d2=_0x44a0d2||0xc8;return function(_0x46c64e){if(_0x46c64e){return _0xb314ee[_0x1fe6('0x1d')](_0x44a0d2)[_0x1fe6('0x1f')](_0x46c64e);}};}function respondWithFilteredResult(_0x12bb1d,_0x70962d){return function(_0x300fba){if(_0x300fba){var _0x204863=typeof _0x70962d['offset']===_0x1fe6('0x20')&&typeof _0x70962d['limit']===_0x1fe6('0x20');var _0x13406f=_0x300fba[_0x1fe6('0x21')];var _0x3aa331=_0x204863?0x0:_0x70962d[_0x1fe6('0x22')];var _0x4882f8=_0x204863?_0x300fba[_0x1fe6('0x21')]:_0x70962d[_0x1fe6('0x22')]+_0x70962d['limit'];var _0x4ce190;if(_0x4882f8>=_0x13406f){_0x4882f8=_0x13406f;_0x4ce190=0xc8;}else{_0x4ce190=0xce;}_0x12bb1d[_0x1fe6('0x1d')](_0x4ce190);return _0x12bb1d['set'](_0x1fe6('0x23'),_0x3aa331+'-'+_0x4882f8+'/'+_0x13406f)['json'](_0x300fba);}return null;};}function patchUpdates(_0x57f30e){return function(_0x57472a){try{jsonpatch[_0x1fe6('0x24')](_0x57472a,_0x57f30e,!![]);}catch(_0x1d2677){return BPromise[_0x1fe6('0x25')](_0x1d2677);}return _0x57472a[_0x1fe6('0x26')]();};}function saveUpdates(_0x58221e,_0x455fd9){return function(_0x45cf93){if(_0x45cf93){return _0x45cf93['update'](_0x58221e)[_0x1fe6('0x27')](function(_0x471a0a){return _0x471a0a;});}return null;};}function removeEntity(_0x154f82,_0x142c77){return function(_0x35e7a2){if(_0x35e7a2){return _0x35e7a2['destroy']()[_0x1fe6('0x27')](function(){_0x154f82['status'](0xcc)[_0x1fe6('0x1e')]();});}};}function handleEntityNotFound(_0x2513b4,_0x5d8b3f){return function(_0x10ce74){if(!_0x10ce74){_0x2513b4[_0x1fe6('0x28')](0x194);}return _0x10ce74;};}function handleError(_0x448d52,_0x5d30bf){_0x5d30bf=_0x5d30bf||0x1f4;return function(_0x5bb4ab){logger['error'](_0x5bb4ab[_0x1fe6('0x29')]);if(_0x5bb4ab[_0x1fe6('0x2a')]){delete _0x5bb4ab[_0x1fe6('0x2a')];}_0x448d52[_0x1fe6('0x1d')](_0x5d30bf)['send'](_0x5bb4ab);};}function getInteractionUsers(_0x444435,_0xb8e623){return new BPromise(function(_0xef95b0,_0xfe76f1){try{if(_0xb8e623[_0x444435['id']]){_0x444435[_0x1fe6('0x2b')]=_[_0x1fe6('0x2c')](_0xb8e623[_0x444435['id']],function(_0x2b7a28){return{'id':_0x2b7a28['id'],'fullname':_0x2b7a28[_0x1fe6('0x2d')]};});}}catch(_0x64fc5){_0xfe76f1(_0x64fc5);}_0xef95b0(_0x444435);});}function getInteractionTags(_0x4dd9d7,_0x296804){return new BPromise(function(_0x198620,_0x326676){try{if(_0x4dd9d7['TagIds']){_0x4dd9d7[_0x1fe6('0x2e')]=[];_0x4dd9d7[_0x1fe6('0x2f')][_0x1fe6('0x30')](',')[_0x1fe6('0x31')](function(_0x3069bd){_0x4dd9d7[_0x1fe6('0x2e')][_0x1fe6('0x32')](_0x296804[_0x3069bd]);});}delete _0x4dd9d7[_0x1fe6('0x2f')];}catch(_0x46ba15){_0x326676(_0x46ba15);}_0x198620(_0x4dd9d7);});}function updateOpenchannelInteraction(_0x55a25e,_0x1acf9d,_0x6b884b){return new BPromise(function(_0x5f12c1,_0x3a44d1){return getInteractionUsers(_0x55a25e,_0x6b884b)['then'](function(_0x4ffeb1){return getInteractionTags(_0x4ffeb1,_0x1acf9d);})[_0x1fe6('0x27')](function(_0x565466){_0x5f12c1(_0x565466);})[_0x1fe6('0x33')](function(_0x22bbac){_0x3a44d1(_0x22bbac);});});}exports[_0x1fe6('0x34')]=function(_0xa0fa14,_0x12e153){var _0x3ad222={},_0x39ea1b={},_0x58e2c5={'count':0x0,'rows':[]};var _0x1d32f4=_['map'](db[_0x1fe6('0x35')][_0x1fe6('0x36')],function(_0x3c3dad){return{'name':_0x3c3dad[_0x1fe6('0x37')],'type':_0x3c3dad['type'][_0x1fe6('0x38')]};});_0x39ea1b['model']=_[_0x1fe6('0x2c')](_0x1d32f4,_0x1fe6('0x2a'));_0x39ea1b[_0x1fe6('0x39')]=_[_0x1fe6('0x3a')](_0xa0fa14[_0x1fe6('0x39')]);_0x39ea1b[_0x1fe6('0x3b')]=_[_0x1fe6('0x3c')](_0x39ea1b[_0x1fe6('0x3d')],_0x39ea1b[_0x1fe6('0x39')]);_0x3ad222[_0x1fe6('0x3e')]=_[_0x1fe6('0x3c')](_0x39ea1b[_0x1fe6('0x3d')],qs[_0x1fe6('0x3f')](_0xa0fa14[_0x1fe6('0x39')]['fields']));_0x3ad222[_0x1fe6('0x3e')]=_0x3ad222[_0x1fe6('0x3e')][_0x1fe6('0x40')]?_0x3ad222[_0x1fe6('0x3e')]:_0x39ea1b[_0x1fe6('0x3d')];if(!_0xa0fa14['query']['hasOwnProperty'](_0x1fe6('0x41'))){_0x3ad222[_0x1fe6('0x42')]=qs[_0x1fe6('0x42')](_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x42')]);_0x3ad222[_0x1fe6('0x22')]=qs[_0x1fe6('0x22')](_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x22')]);}_0x3ad222[_0x1fe6('0x43')]=qs[_0x1fe6('0x44')](_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x44')]);_0x3ad222[_0x1fe6('0x45')]=qs[_0x1fe6('0x3b')](_[_0x1fe6('0x46')](_0xa0fa14[_0x1fe6('0x39')],_0x39ea1b[_0x1fe6('0x3b')]),_0x1d32f4);var _0x19fffe=[];var _0x3c819f=squel[_0x1fe6('0x47')]()[_0x1fe6('0x48')]('id')['field'](_0x1fe6('0x2a'))[_0x1fe6('0x48')](_0x1fe6('0x49'))[_0x1fe6('0x4a')](_0x1fe6('0x4b'));var _0x12e6ab=squel[_0x1fe6('0x47')]()[_0x1fe6('0x48')](_0x1fe6('0x4c'))['field'](_0x1fe6('0x4d'))[_0x1fe6('0x48')](_0x1fe6('0x4e'))[_0x1fe6('0x4a')](_0x1fe6('0x4f'),'ui')[_0x1fe6('0x50')]('users','u',_0x1fe6('0x51'));var _0x3c798a=squel[_0x1fe6('0x47')]()[_0x1fe6('0x4a')]('openchannel_interactions','i')['left_join'](_0x1fe6('0x52'),'c',_0x1fe6('0x53'))[_0x1fe6('0x50')](_0x1fe6('0x54'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1fe6('0x55'),'a',_0x1fe6('0x56'))[_0x1fe6('0x50')](_0x1fe6('0x57'),'me',_0x1fe6('0x58'))[_0x1fe6('0x50')](_0x1fe6('0x59'),'it',_0x1fe6('0x5a'))[_0x1fe6('0x50')](_0x1fe6('0x4b'),'t',_0x1fe6('0x5b'));var _0x54f93f=squel[_0x1fe6('0x5c')]();var _0x3dabf3=[];var _0x3bbf0b=squel[_0x1fe6('0x5c')]();var _0x5e8bd6;if(_0xa0fa14[_0x1fe6('0x39')]['search']){_0x5e8bd6=as['parseSearch'](_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x5d')]);var _0x4e8124=_0x5e8bd6['sqlOperator'];for(var _0x4d8d81=0x0;_0x4d8d81<_0x5e8bd6[_0x1fe6('0x5e')]['length'];_0x4d8d81++){var _0x1567ec=_0x5e8bd6[_0x1fe6('0x5e')][_0x4d8d81];var _0x596d53='i';var _0x4322b3=_[_0x1fe6('0x5f')](_0x1d32f4,[_0x1fe6('0x2a'),_0x1567ec['field']]);if(!_0x4322b3){switch(_0x1567ec['field']){case _0x1fe6('0x60'):if(_0x1567ec['value']==0x1){_0x3c798a[_0x1fe6('0x61')]('`'+_0x1567ec[_0x1fe6('0x48')]+_0x1fe6('0x62'));}else{_0x3c798a[_0x1fe6('0x61')]('`'+_0x1567ec['field']+'`\x20>\x200');}break;case'Contact':if(_0x1567ec[_0x1fe6('0x63')]===_0x1fe6('0x64')){if(_0x1567ec[_0x1fe6('0x65')][_0x1fe6('0x30')]('\x20')['length']>0x1){_0x54f93f[_0x4e8124](_0x1fe6('0x66'),qs[_0x1fe6('0x67')](_0x1567ec[_0x1fe6('0x65')]),null);}else{var _0xe1116f='%'+_0x1567ec['value']+'%';_0x54f93f[_0x4e8124]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xe1116f,_0xe1116f,_0xe1116f);}}else{_0x4322b3=_[_0x1fe6('0x5f')](_0x1d32f4,[_0x1fe6('0x2a'),_0x1fe6('0x68')]);_0x1567ec['field']='ContactId';_0x23eb28=as[_0x1fe6('0x69')](_0x596d53,_0x4322b3['type'],_0x1567ec);_0x54f93f[_0x4e8124](_0x23eb28[_0x1fe6('0x6a')],_0x23eb28['value'][_0x1fe6('0x6b')],_0x23eb28[_0x1fe6('0x65')][_0x1fe6('0x1e')]);}break;case _0x1fe6('0x6c'):var _0x4ce051=_0x1567ec['value']['split'](',')[_0x1fe6('0x2c')](function(_0x465146){return Number(_0x465146);});_0x4ce051[_0x1fe6('0x31')](function(_0x180589){_0x3bbf0b['or'](_0x1fe6('0x6d'),'%,'+_0x180589+',%');});_0x3dabf3=_[_0x1fe6('0x6e')](_0x3dabf3,_0x4ce051);break;case _0x1fe6('0x6f'):if(_0x1567ec[_0x1fe6('0x63')]==='$substring'){_0x54f93f[_0x4e8124](_0x1fe6('0x70'),'%'+_0x1567ec['value']+'%',null);}else{_0x4322b3=_['find'](_0x1d32f4,[_0x1fe6('0x2a'),_0x1fe6('0x71')]);_0x1567ec[_0x1fe6('0x48')]=_0x1fe6('0x71');_0x23eb28=as['buildExpression'](_0x596d53,_0x4322b3[_0x1fe6('0x72')],_0x1567ec);_0x54f93f[_0x4e8124](_0x23eb28[_0x1fe6('0x6a')],_0x23eb28[_0x1fe6('0x65')][_0x1fe6('0x6b')],_0x23eb28[_0x1fe6('0x65')][_0x1fe6('0x1e')]);}break;case _0x1fe6('0x73'):_0x23eb28=as[_0x1fe6('0x69')]('me',null,_0x1567ec);_0x54f93f[_0x4e8124](_0x23eb28[_0x1fe6('0x6a')],_0x23eb28[_0x1fe6('0x65')][_0x1fe6('0x6b')],_0x23eb28[_0x1fe6('0x65')][_0x1fe6('0x1e')]);break;}}else{var _0x23eb28=as['buildExpression'](_0x596d53,_0x4322b3[_0x1fe6('0x72')],_0x1567ec);_0x54f93f[_0x4e8124](_0x23eb28[_0x1fe6('0x6a')],_0x23eb28[_0x1fe6('0x65')][_0x1fe6('0x6b')],_0x23eb28[_0x1fe6('0x65')]['end']);}}}else{var _0x8f7a06=_(_0xa0fa14[_0x1fe6('0x39')])[_0x1fe6('0x3a')]()[_0x1fe6('0x2c')](function(_0x3499aa){return _[_0x1fe6('0x74')](_0x1d32f4,[_0x1fe6('0x2a'),_0x3499aa])?_0x3499aa:undefined;})[_0x1fe6('0x75')]()[_0x1fe6('0x65')]();if(!_[_0x1fe6('0x76')](_0x8f7a06)){_0x8f7a06['forEach'](function(_0xc8ee3){if(_0xc8ee3===_0x1fe6('0x77')){_0x3c798a[_0x1fe6('0x45')](_0x1fe6('0x78'),[]['concat'](_0xa0fa14[_0x1fe6('0x39')][_0xc8ee3]));}else if(_0xc8ee3===_0x1fe6('0x79')){var _0x3d9e23=JSON[_0x1fe6('0x7a')](_0xa0fa14[_0x1fe6('0x39')][_0xc8ee3])[_0x1fe6('0x7b')];var _0x129b90=JSON['parse'](_0xa0fa14[_0x1fe6('0x39')][_0xc8ee3])[_0x1fe6('0x7c')];_0x3c798a[_0x1fe6('0x45')](_0x1fe6('0x7d'),_0x3d9e23,_0x129b90);}else{if(_0xa0fa14['query'][_0xc8ee3]==='null'){_0x3c798a[_0x1fe6('0x45')]('i.'+_0xc8ee3+_0x1fe6('0x7e'));}else{_0x3c798a[_0x1fe6('0x45')]('i.'+_0xc8ee3+_0x1fe6('0x7f'),_0xa0fa14[_0x1fe6('0x39')][_0xc8ee3]);}}});}if(_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x80')]){if(_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x80')]==0x1){_0x3c798a[_0x1fe6('0x61')](_0x1fe6('0x81'));}else{_0x3c798a['having'](_0x1fe6('0x82'));}}if(_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x83')]){_0x3dabf3=_[_0x1fe6('0x84')](_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x83')])?_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x83')]:new Array(_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x83')]);_0x3dabf3['forEach'](function(_0x318379){_0x3bbf0b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x318379+',%');});}if(_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x85')]){var _0x16fea7=_0xa0fa14['query']['filter'][_0x1fe6('0x86')]('\x5c','\x5c\x5c')[_0x1fe6('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x16fea7)){_0x54f93f['or']('i.id\x20LIKE\x20?',_0x16fea7+'%');}else{_0x54f93f['or'](_0x1fe6('0x87'),qs['getFullTextValue'](_0x16fea7))['or']('i.from\x20LIKE\x20?',_0x16fea7+'%')['or'](_0x1fe6('0x88'),_0x16fea7+'%');}}}_0x3c798a['where'](_0x54f93f);_0x3c798a[_0x1fe6('0x89')](_0x1fe6('0x8a'));var _0x27276c={'type':db['Sequelize']['QueryTypes'][_0x1fe6('0x8b')],'raw':!![]};var _0x1da5f0=_0x3c798a[_0x1fe6('0x8c')]();_0x1da5f0[_0x1fe6('0x48')](_0x1fe6('0x8a'));_0x1da5f0['field'](_0x1fe6('0x8d'),'unreadMessages');if(_0x3ad222['order']){_0x3ad222[_0x1fe6('0x43')][_0x1fe6('0x31')](function(_0x6e5cf5){var _0x24d0d2=_0x6e5cf5[0x0]===_0x1fe6('0x8e')?_0x6e5cf5[0x0]:'i.'+_0x6e5cf5[0x0];_0x3c798a[_0x1fe6('0x43')](_0x24d0d2,_0x6e5cf5[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3dabf3)){_0x3c798a[_0x1fe6('0x61')](_0x3bbf0b);_0x1da5f0['where'](_0x1fe6('0x8f'),_0x3dabf3);}BPromise[_0x1fe6('0x90')]()['then'](function(){if(!_0x5e8bd6){if(_0xa0fa14[_0x1fe6('0x39')][_0x1fe6('0x77')])return;_0x1da5f0[_0x1fe6('0x45')](_0x1fe6('0x91'));_0x3c798a[_0x1fe6('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xa0fa14['user'][_0x1fe6('0x92')]!==_0x1fe6('0x93'))return;return _0xa0fa14[_0x1fe6('0x94')][_0x1fe6('0x95')]({'attributes':['id'],'raw':!![]})[_0x1fe6('0x27')](function(_0x5b57d1){if(_[_0x1fe6('0x76')](_0x5b57d1)){_0x1da5f0[_0x1fe6('0x45')](_0x1fe6('0x96'));_0x3c798a[_0x1fe6('0x45')](_0x1fe6('0x96'));}else{_0x1da5f0['where'](_0x1fe6('0x78'),_['map'](_0x5b57d1,'id'));_0x3c798a['where'](_0x1fe6('0x78'),_['map'](_0x5b57d1,'id'));}});})[_0x1fe6('0x27')](function(){if(_0xa0fa14['user'][_0x1fe6('0x92')]===_0x1fe6('0x93')&&!_0x5e8bd6&&!_0xa0fa14[_0x1fe6('0x39')]['OpenchannelAccountId'])return[];return db[_0x1fe6('0x97')][_0x1fe6('0x39')](_0x1da5f0[_0x1fe6('0x98')](),_0x27276c);})['then'](function(_0x1742e5){_0x58e2c5[_0x1fe6('0x21')]=_0x1742e5[_0x1fe6('0x40')];if(_0x58e2c5[_0x1fe6('0x21')]===0x0)return[];return db[_0x1fe6('0x97')][_0x1fe6('0x39')](_0x3c819f[_0x1fe6('0x98')](),_0x27276c)[_0x1fe6('0x27')](function(_0xaf2603){_0x19fffe=_[_0x1fe6('0x99')](_0xaf2603,'id');_0x27276c=_[_0x1fe6('0x9a')](_0x27276c,{'model':db[_0x1fe6('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa0fa14[_0x1fe6('0x39')]['fields']){_0x3ad222['attributes'][_0x1fe6('0x31')](function(_0x425a11){_0x3c798a['field']('i.'+_0x425a11);});}else{_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0x8d'),_0x1fe6('0x60'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0x9b'),_0x1fe6('0x9c'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0x9d'),_0x1fe6('0x9e'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0x9f'),_0x1fe6('0x8e'));_0x3c798a['field'](_0x1fe6('0xa0'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xa1'),'Contact.firstName');_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xa2'),_0x1fe6('0xa3'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xa4'),'Contact.email');_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xa5'),_0x1fe6('0xa6'));_0x3c798a[_0x1fe6('0x48')]('c.mobile',_0x1fe6('0xa7'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xa8'),_0x1fe6('0xa9'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xaa'),'Owner.fullname');_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xab'),_0x1fe6('0xac'));_0x3c798a[_0x1fe6('0x48')](_0x1fe6('0xad'),_0x1fe6('0x2f'));}if(_0x3ad222[_0x1fe6('0x42')])_0x3c798a[_0x1fe6('0x42')](_0x3ad222[_0x1fe6('0x42')]);if(_0x3ad222[_0x1fe6('0x22')])_0x3c798a[_0x1fe6('0x22')](_0x3ad222['offset']);return db[_0x1fe6('0x97')]['query'](_0x3c798a['toString'](),_0x27276c);})[_0x1fe6('0x27')](function(_0x4bcfd9){if(_0x4bcfd9['length']>0x0)_0x12e6ab[_0x1fe6('0x45')](_0x1fe6('0xae'),_['map'](_0x4bcfd9,'id'));return db[_0x1fe6('0x97')]['query'](_0x12e6ab[_0x1fe6('0x98')](),_0x27276c)[_0x1fe6('0x27')](function(_0x20ef77){var _0x33ddec=_[_0x1fe6('0xaf')](_0x20ef77,'OpenchannelInteractionId');var _0x2cab66=[];_0x4bcfd9[_0x1fe6('0x31')](function(_0x13828e){_0x2cab66[_0x1fe6('0x32')](updateOpenchannelInteraction(_0x13828e,_0x19fffe,_0x33ddec));});return BPromise[_0x1fe6('0xb0')](_0x2cab66);});});})[_0x1fe6('0x27')](function(_0x17aed5){_0x58e2c5[_0x1fe6('0xb1')]=_0x17aed5;return _0x58e2c5;})['then'](respondWithFilteredResult(_0x12e153,_0x3ad222))[_0x1fe6('0x33')](handleError(_0x12e153,null));};exports['show']=function(_0x47a552,_0x59ad3d){var _0x3d95d3={};if(_0x47a552[_0x1fe6('0x39')][_0x1fe6('0x72')]&&_0x47a552[_0x1fe6('0x39')][_0x1fe6('0x72')]===_0x1fe6('0x4a')){_0x3d95d3[_0x1fe6('0x4a')]=_0x47a552[_0x1fe6('0xb2')]['id'];}else{_0x3d95d3['id']=_0x47a552[_0x1fe6('0xb2')]['id'];}var _0x300140={'raw':![],'where':_0x3d95d3},_0xe2a79={};_0xe2a79[_0x1fe6('0x3d')]=_['keys'](db[_0x1fe6('0x35')]['rawAttributes']);_0xe2a79[_0x1fe6('0x39')]=_[_0x1fe6('0x3a')](_0x47a552[_0x1fe6('0x39')]);_0xe2a79[_0x1fe6('0x3b')]=_[_0x1fe6('0x3c')](_0xe2a79[_0x1fe6('0x3d')],_0xe2a79[_0x1fe6('0x39')]);_0x300140['attributes']=_['intersection'](_0xe2a79[_0x1fe6('0x3d')],qs[_0x1fe6('0x3f')](_0x47a552['query'][_0x1fe6('0x3f')]));_0x300140[_0x1fe6('0x3e')]=_0x300140[_0x1fe6('0x3e')][_0x1fe6('0x40')]?_0x300140[_0x1fe6('0x3e')]:_0xe2a79[_0x1fe6('0x3d')];if(_0x47a552[_0x1fe6('0x39')]['includeAll']){_0x300140['include']=[{'all':!![]}];}_0x300140=_['merge']({},_0x300140,_0x47a552[_0x1fe6('0xb3')]);return db[_0x1fe6('0x35')][_0x1fe6('0x5f')](_0x300140)[_0x1fe6('0x27')](handleEntityNotFound(_0x59ad3d,null))['then'](respondWithResult(_0x59ad3d,null))[_0x1fe6('0x33')](handleError(_0x59ad3d,null));};exports['create']=function(_0x1fbec6,_0x43afe1){return db[_0x1fe6('0x35')][_0x1fe6('0xb4')](_0x1fbec6['body'],{})[_0x1fe6('0x27')](respondWithResult(_0x43afe1,0xc9))['catch'](handleError(_0x43afe1,null));};exports[_0x1fe6('0xb5')]=function(_0xdf001,_0x3bfed8){if(_0xdf001[_0x1fe6('0x73')]['id']){delete _0xdf001[_0x1fe6('0x73')]['id'];}return db['OpenchannelInteraction'][_0x1fe6('0x5f')]({'where':{'id':_0xdf001[_0x1fe6('0xb2')]['id']}})[_0x1fe6('0x27')](handleEntityNotFound(_0x3bfed8,null))[_0x1fe6('0x27')](saveUpdates(_0xdf001['body'],null))[_0x1fe6('0x27')](respondWithResult(_0x3bfed8,null))[_0x1fe6('0x33')](handleError(_0x3bfed8,null));};exports[_0x1fe6('0xb6')]=function(_0x35792d,_0xaff00f){return db[_0x1fe6('0x35')]['find']({'where':{'id':_0x35792d['params']['id']}})['then'](handleEntityNotFound(_0xaff00f,null))[_0x1fe6('0x27')](removeEntity(_0xaff00f,null))[_0x1fe6('0x33')](handleError(_0xaff00f,null));};exports[_0x1fe6('0xb7')]=function(_0x598ec0,_0x1fccf8){return db[_0x1fe6('0x35')]['describe']()[_0x1fe6('0x27')](respondWithResult(_0x1fccf8,null))[_0x1fe6('0x33')](handleError(_0x1fccf8,null));};exports[_0x1fe6('0xb8')]=function(_0x2d0cd4,_0x30e6d0,_0x378173){return db[_0x1fe6('0xb9')]['find']({'where':{'id':_0x2d0cd4[_0x1fe6('0xb2')]['id']}})[_0x1fe6('0x27')](handleEntityNotFound(_0x30e6d0,null))[_0x1fe6('0x27')](function(_0x416b17){if(_0x416b17){return _0x416b17['addMessage'](_0x2d0cd4['body']['ids'],_[_0x1fe6('0xba')](_0x2d0cd4[_0x1fe6('0x73')],[_0x1fe6('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x30e6d0,null))[_0x1fe6('0x33')](handleError(_0x30e6d0,null));};exports[_0x1fe6('0xbc')]=function(_0x5ba37a,_0x2fe860,_0x304a35){var _0x67b1ef={'raw':![],'where':{}};var _0x52df65={};var _0x36995d={'count':0x0,'rows':[]};return db[_0x1fe6('0x35')][_0x1fe6('0xbd')]({'where':{'id':_0x5ba37a[_0x1fe6('0xb2')]['id']}})['then'](handleEntityNotFound(_0x2fe860,null))[_0x1fe6('0x27')](function(_0x3d7506){if(_0x3d7506){_0x52df65[_0x1fe6('0x3d')]=_['keys'](db['OpenchannelMessage'][_0x1fe6('0x36')]);_0x52df65['query']=_[_0x1fe6('0x3a')](_0x5ba37a['query']);_0x52df65['filters']=_[_0x1fe6('0x3c')](_0x52df65[_0x1fe6('0x3d')],_0x52df65[_0x1fe6('0x39')]);_0x67b1ef[_0x1fe6('0x3e')]=_[_0x1fe6('0x3c')](_0x52df65[_0x1fe6('0x3d')],qs[_0x1fe6('0x3f')](_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x3f')]));_0x67b1ef['attributes']=_0x67b1ef['attributes'][_0x1fe6('0x40')]?_0x67b1ef[_0x1fe6('0x3e')]:_0x52df65[_0x1fe6('0x3d')];if(!_0x5ba37a['query']['hasOwnProperty']('nolimit')){_0x67b1ef[_0x1fe6('0x42')]=qs['limit'](_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x42')]);_0x67b1ef[_0x1fe6('0x22')]=qs[_0x1fe6('0x22')](_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x22')]);}_0x67b1ef[_0x1fe6('0x43')]=qs[_0x1fe6('0x44')](_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x44')]);_0x67b1ef['where']=qs[_0x1fe6('0x3b')](_[_0x1fe6('0x46')](_0x5ba37a['query'],_0x52df65[_0x1fe6('0x3b')]));_0x67b1ef[_0x1fe6('0x45')][_0x1fe6('0xbe')]=_0x3d7506['id'];if(_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x85')]){_0x67b1ef[_0x1fe6('0x45')]=_[_0x1fe6('0x9a')](_0x67b1ef[_0x1fe6('0x45')],{'$or':_['map'](_0x67b1ef[_0x1fe6('0x3e')],function(_0x36d314){var _0x3411e9={};_0x3411e9[_0x36d314]={'$like':'%'+_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x85')]+'%'};return _0x3411e9;})});}if(_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x7b')]){var _0x19f5cc=_0x5ba37a[_0x1fe6('0x39')][_0x1fe6('0x7b')][_0x1fe6('0x30')](',');var _0x56e1b1={};_0x56e1b1[_0x19f5cc[0x0]]={'$gte':moment(_0x19f5cc[0x1])['format'](_0x1fe6('0xbf'))};_0x67b1ef[_0x1fe6('0x45')]=_[_0x1fe6('0x9a')](_0x67b1ef[_0x1fe6('0x45')],_0x56e1b1);}_0x67b1ef=_[_0x1fe6('0x9a')]({},_0x67b1ef,_0x5ba37a[_0x1fe6('0xb3')]);return db[_0x1fe6('0xb9')]['count']({'where':_0x67b1ef['where']})[_0x1fe6('0x27')](function(_0xf722c8){_0x36995d[_0x1fe6('0x21')]=_0xf722c8;if(_0x5ba37a[_0x1fe6('0x39')]['includeAll']){_0x67b1ef[_0x1fe6('0xc0')]=[{'all':!![]}];}return db[_0x1fe6('0xb9')]['findAll'](_0x67b1ef);})[_0x1fe6('0x27')](function(_0x20e17d){_0x36995d[_0x1fe6('0xb1')]=_0x20e17d;return _0x36995d;});}})['then'](respondWithFilteredResult(_0x2fe860,_0x67b1ef))[_0x1fe6('0x33')](handleError(_0x2fe860,null));};exports[_0x1fe6('0xc1')]=function(_0x25bcb9,_0x5ea122,_0x22880e){return db['OpenchannelInteraction'][_0x1fe6('0x5f')]({'where':{'id':_0x25bcb9['params']['id']}})[_0x1fe6('0x27')](handleEntityNotFound(_0x5ea122,null))[_0x1fe6('0x27')](function(_0x3c09f0){if(_0x3c09f0){return _0x3c09f0[_0x1fe6('0xc2')](_0x25bcb9['body']['ids'],_[_0x1fe6('0xba')](_0x25bcb9['body'],[_0x1fe6('0xbb'),'id'])||{})[_0x1fe6('0xc3')](function(){return db['Tag'][_0x1fe6('0xc4')]({'attributes':['id',_0x1fe6('0x2a'),_0x1fe6('0x49')],'where':{'id':_0x25bcb9['body'][_0x1fe6('0xbb')]}});})[_0x1fe6('0x27')](function(_0x3ea6c6){socket[_0x1fe6('0xc5')](_0x1fe6('0xc6'),{'id':Number(_0x25bcb9[_0x1fe6('0xb2')]['id']),'tags':_0x3ea6c6||[]});return{'id':Number(_0x25bcb9[_0x1fe6('0xb2')]['id']),'tags':_0x3ea6c6||[]};});}})['then'](respondWithResult(_0x5ea122,null))[_0x1fe6('0x33')](handleError(_0x5ea122,null));};exports[_0x1fe6('0xc7')]=function(_0x33854c,_0x4d874f,_0x166cac){return db[_0x1fe6('0x35')]['find']({'where':{'id':_0x33854c[_0x1fe6('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4d874f,null))[_0x1fe6('0x27')](function(_0x2db663){if(_0x2db663){return _0x2db663['removeTags'](_0x33854c[_0x1fe6('0x39')][_0x1fe6('0xbb')]);}})[_0x1fe6('0x27')](respondWithStatusCode(_0x4d874f,null))['catch'](handleError(_0x4d874f,null));};exports[_0x1fe6('0xc8')]=function(_0x2dbb08,_0x15c55a){var _0x5bbb31=moment()[_0x1fe6('0xc9')]()[_0x1fe6('0x98')]();var _0x35bb3f=path[_0x1fe6('0xca')](config[_0x1fe6('0xcb')],_0x1fe6('0xcc'),_0x1fe6('0xcd'),'tmp');var _0x308ae7=path[_0x1fe6('0xca')](config[_0x1fe6('0xcb')],_0x1fe6('0xcc'),_0x1fe6('0xcd'),_0x1fe6('0xce'));var _0x4802cf=path[_0x1fe6('0xca')](_0x35bb3f,_0x5bbb31);var _0x41ebc3=util[_0x1fe6('0xcf')](_0x1fe6('0xd0'),_0x2dbb08[_0x1fe6('0xb2')]['id'],_0x5bbb31);var _0x4055d4=path[_0x1fe6('0xca')](_0x35bb3f,_0x41ebc3);var _0x2dc9d8=[];_0x2dc9d8['push']({'model':db[_0x1fe6('0x6f')],'as':_0x1fe6('0x6f'),'attributes':['id',_0x1fe6('0x2d')],'raw':!![]});_0x2dc9d8['push']({'model':db[_0x1fe6('0xd1')],'as':_0x1fe6('0xd2'),'attributes':['id',_0x1fe6('0xd3'),_0x1fe6('0xd4')],'raw':!![]});if(_0x2dbb08[_0x1fe6('0x39')]['attachments']){_0x2dc9d8[_0x1fe6('0x32')]({'model':db[_0x1fe6('0xd5')],'as':_0x1fe6('0xd5'),'raw':!![]});}var _0x1a6ecf=[{'model':db['OpenchannelMessage'],'as':_0x1fe6('0xd6'),'attributes':['id',_0x1fe6('0x73'),_0x1fe6('0x79'),'direction',_0x1fe6('0xd7'),'read'],'include':_0x2dc9d8}];_0x1a6ecf['push']({'model':db[_0x1fe6('0xd8')],'as':_0x1fe6('0xd9'),'attributes':['id',_0x1fe6('0x2a')]});_0x1a6ecf['push']({'model':db[_0x1fe6('0x6f')],'as':'Owner','attributes':['id',_0x1fe6('0x2d')]});return db[_0x1fe6('0x35')][_0x1fe6('0x5f')]({'where':{'id':_0x2dbb08[_0x1fe6('0xb2')]['id']},'include':_0x1a6ecf})[_0x1fe6('0x27')](handleEntityNotFound(_0x15c55a,null))['then'](function(_0x1e69e4){if(_0x1e69e4){var _0x3d68fa=_0x1e69e4[_0x1fe6('0xda')]({'plain':!![]});fs[_0x1fe6('0xdb')](_0x4802cf);var _0x3c8c6b={'channel':_0x1fe6('0xdc'),'account':_0x3d68fa[_0x1fe6('0xd9')][_0x1fe6('0x2a')],'agent':_0x3d68fa['Owner']?_0x3d68fa[_0x1fe6('0xdd')][_0x1fe6('0x2d')]:_0x1fe6('0xde'),'createdAt':moment(_0x3d68fa[_0x1fe6('0x79')])[_0x1fe6('0xcf')](_0x1fe6('0xbf'))[_0x1fe6('0x98')](),'closedAt':_0x3d68fa[_0x1fe6('0xdf')]?moment(_0x3d68fa[_0x1fe6('0xe0')])[_0x1fe6('0xcf')](_0x1fe6('0xbf'))[_0x1fe6('0x98')]():'','disposition':_0x3d68fa[_0x1fe6('0xe1')],'visibility':_0x3d68fa[_0x1fe6('0xe2')]?'Public':_0x1fe6('0xe3'),'messages':_(_0x3d68fa['Messages'])[_0x1fe6('0x85')]({'secret':![]})[_0x1fe6('0x2c')](function(_0x59a604){if(_0x59a604[_0x1fe6('0xd5')]){var _0x48a966=path['join'](_0x308ae7,_0x59a604[_0x1fe6('0xd5')][_0x1fe6('0xe4')]);if(fs[_0x1fe6('0xe5')](_0x48a966)){fs[_0x1fe6('0xe6')](_0x48a966)[_0x1fe6('0xe7')](fs['createWriteStream'](path['join'](_0x4802cf,_0x59a604[_0x1fe6('0xd5')][_0x1fe6('0xe4')])));}}return{'date':moment(_0x59a604[_0x1fe6('0x79')])['format'](_0x1fe6('0xbf'))[_0x1fe6('0x98')](),'sender':_0x59a604[_0x1fe6('0xe8')]===_0x1fe6('0xe9')?_0x59a604['User']?_0x59a604[_0x1fe6('0x6f')]['fullname']:_0x1fe6('0xea'):_0x59a604[_0x1fe6('0xd2')]['firstName']+(_0x59a604[_0x1fe6('0xd2')][_0x1fe6('0xd4')]?'\x20'+_0x59a604[_0x1fe6('0xd2')][_0x1fe6('0xd4')]:''),'body':_0x59a604[_0x1fe6('0xd5')]?_0x59a604['Attachment'][_0x1fe6('0xe4')]:_0x59a604[_0x1fe6('0x73')],'direction':_0x59a604[_0x1fe6('0xe8')]===_0x1fe6('0xe9')?'A':'C','secret':_0x59a604['secret'],'read':_0x59a604[_0x1fe6('0x80')],'attachment':_0x59a604[_0x1fe6('0xd5')]};})[_0x1fe6('0x65')]()};return ejs[_0x1fe6('0xeb')](path['join'](config['root'],_0x1fe6('0xcc'),_0x1fe6('0xec'),'downloadInteraction.ejs'),{'interaction':_0x3c8c6b})['then'](function(_0x546276){var _0x5a8730=path[_0x1fe6('0xca')](_0x4802cf,_0x1fe6('0xed')+_0x3d68fa['id']+'-'+_0x5bbb31+_0x1fe6('0xee'));var _0x268636={'path':_0x5a8730,'channel':_0x1fe6('0xdc'),'interactionId':_0x3d68fa['id']};return pdf[_0x1fe6('0xef')](_0x546276,_0x268636);})[_0x1fe6('0x27')](function(){return new BPromise(function(_0x4c8613,_0x40a43b){zipdir(_0x4802cf,{'saveTo':_0x4055d4},function(_0x4d7d5c,_0x37a27f){if(_0x4d7d5c)return _0x40a43b(_0x4d7d5c);return _0x4c8613(_0x37a27f);});})[_0x1fe6('0x27')](function(){return new BPromise(function(_0x5b742d,_0x24e332){rimraf(_0x4802cf,function(_0x4e3b12){if(_0x4e3b12)_0x24e332(_0x4e3b12);return _0x5b742d();});});})[_0x1fe6('0x27')](function(){return _0x15c55a['download'](_0x4055d4,_0x41ebc3,function(_0x3ef332){if(_0x3ef332){console[_0x1fe6('0xf0')](_0x1fe6('0xf1'),_0x3ef332);}else{fs[_0x1fe6('0xf2')](_0x4055d4);}});});});}else{return _0x15c55a['sendStatus'](0xc8);}})[_0x1fe6('0x33')](handleError(_0x15c55a,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index dadcbdf..2fa9a5f 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 _0x527e=['remove','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','update'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x527e,0xd2));var _0xe527=function(_0x2d10b2,_0x3b3f12){_0x2d10b2=_0x2d10b2-0x0;var _0x130ba1=_0x527e[_0x2d10b2];return _0x130ba1;};'use strict';var EventEmitter=require(_0xe527('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe527('0x1')];var OpenchannelMessage=require(_0xe527('0x2'))['db'][_0xe527('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe527('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe527('0x5'),'afterDestroy':_0xe527('0x6')};function emitEvent(_0x561414){return function(_0x5f55ab,_0x5cd56e,_0x16eff7){_0x5f55ab['getUsers']({'attributes':['id'],'raw':!![]})[_0xe527('0x7')](function(_0x5d7a38){_0x5f55ab[_0xe527('0x8')](_0xe527('0x9'),_0x5d7a38[_0xe527('0xa')](function(_0x4f8ae3){return{'id':_0x4f8ae3['id']};}));return OpenchannelMessage[_0xe527('0xb')]({'where':{'OpenchannelInteractionId':_0x5f55ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe527('0x7')](function(_0x19abd8){_0x5f55ab[_0xe527('0x8')]('unreadMessages',_0x19abd8[_0xe527('0xc')]);OpenchannelInteractionEvents[_0xe527('0xd')](_0x561414+':'+_0x5f55ab['id'],_0x5f55ab);OpenchannelInteractionEvents[_0xe527('0xd')](_0x561414,_0x5f55ab);_0x16eff7(null);})[_0xe527('0xe')](_0x16eff7(null));};}for(var e in events){if(events[_0xe527('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xe527('0x10')](e,emitEvent(event));}}module[_0xe527('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x10ff=['Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','OpenchannelInteraction','save','update','remove','getUsers','then','setDataValue'];(function(_0x4f0c78,_0x2fdf81){var _0x2d693b=function(_0x16ad6){while(--_0x16ad6){_0x4f0c78['push'](_0x4f0c78['shift']());}};_0x2d693b(++_0x2fdf81);}(_0x10ff,0x169));var _0xf10f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x10ff[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0xf10f('0x0')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf10f('0x1'),'afterUpdate':_0xf10f('0x2'),'afterDestroy':_0xf10f('0x3')};function emitEvent(_0x4a59f5){return function(_0x4108c0,_0x2b9f78,_0xeb4f38){_0x4108c0[_0xf10f('0x4')]({'attributes':['id'],'raw':!![]})[_0xf10f('0x5')](function(_0x4636f2){_0x4108c0[_0xf10f('0x6')](_0xf10f('0x7'),_0x4636f2[_0xf10f('0x8')](function(_0x90d84f){return{'id':_0x90d84f['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4108c0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xe0246f){_0x4108c0[_0xf10f('0x6')](_0xf10f('0x9'),_0xe0246f[_0xf10f('0xa')]);OpenchannelInteractionEvents[_0xf10f('0xb')](_0x4a59f5+':'+_0x4108c0['id'],_0x4108c0);OpenchannelInteractionEvents[_0xf10f('0xb')](_0x4a59f5,_0x4108c0);_0xeb4f38(null);})[_0xf10f('0xc')](_0xeb4f38(null));};}for(var e in events){if(events[_0xf10f('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xf10f('0xe')](e,emitEvent(event));}}module[_0xf10f('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index fabec55..88ccef0 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 _0x7fef=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed','closedAt'];(function(_0x29aa5c,_0x16a81e){var _0x8992b6=function(_0x4ed59){while(--_0x4ed59){_0x29aa5c['push'](_0x29aa5c['shift']());}};_0x8992b6(++_0x16a81e);}(_0x7fef,0x110));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf7fe('0x0'));var util=require('util');var logger=require(_0xf7fe('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7fe('0x2'));var fs=require('fs');var path=require(_0xf7fe('0x3'));var rimraf=require('rimraf');var config=require(_0xf7fe('0x4'));var attributes=require(_0xf7fe('0x5'));module[_0xf7fe('0x6')]=function(_0x31ec15,_0x5ad22b){return _0x31ec15[_0xf7fe('0x7')](_0xf7fe('0x8'),attributes,{'tableName':_0xf7fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf7fe('0xa'),'hooks':{'beforeUpdate':function(_0x2bc293,_0x4f34c3,_0x5aad20){if(_0x2bc293['changed'](_0xf7fe('0xb'))){_0x2bc293[_0xf7fe('0xc')]=moment()[_0xf7fe('0xd')](_0xf7fe('0xe'));}_0x5aad20(null,_0x2bc293);}}});}; \ No newline at end of file +var _0xcc4c=['utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x49eac1,_0x7c80c6){var _0x4d178c=function(_0x5ac58f){while(--_0x5ac58f){_0x49eac1['push'](_0x49eac1['shift']());}};_0x4d178c(++_0x7c80c6);}(_0xcc4c,0x149));var _0xccc4=function(_0x3ddd94,_0x52aff5){_0x3ddd94=_0x3ddd94-0x0;var _0x2a091c=_0xcc4c[_0x3ddd94];return _0x2a091c;};'use strict';var _=require(_0xccc4('0x0'));var util=require(_0xccc4('0x1'));var logger=require(_0xccc4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xccc4('0x3'));var rp=require(_0xccc4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccc4('0x5'));var config=require(_0xccc4('0x6'));var attributes=require(_0xccc4('0x7'));module[_0xccc4('0x8')]=function(_0x4032d6,_0x5c097c){return _0x4032d6[_0xccc4('0x9')](_0xccc4('0xa'),attributes,{'tableName':_0xccc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xccc4('0xc'),'collate':_0xccc4('0xd'),'hooks':{'beforeUpdate':function(_0xf19ef0,_0x2fe3e5,_0x365a85){if(_0xf19ef0[_0xccc4('0xe')](_0xccc4('0xf'))){_0xf19ef0['closedAt']=moment()[_0xccc4('0x10')](_0xccc4('0x11'));}_0x365a85(null,_0xf19ef0);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 33818a8..9173251 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 _0xe577=['code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe577,0x162));var _0x7e57=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe577[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x7e57('0x0'));var util=require(_0x7e57('0x1'));var moment=require(_0x7e57('0x2'));var BPromise=require(_0x7e57('0x3'));var rs=require(_0x7e57('0x4'));var fs=require('fs');var Redis=require(_0x7e57('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e57('0x6'));var logger=require(_0x7e57('0x7'))('rpc');var config=require(_0x7e57('0x8'));var jayson=require(_0x7e57('0x9'));var client=jayson[_0x7e57('0xa')]['http']({'port':0x232a});config[_0x7e57('0xb')]=_[_0x7e57('0xc')](config[_0x7e57('0xb')],{'host':_0x7e57('0xd'),'port':0x18eb});var socket=require(_0x7e57('0xe'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x7e57('0xf')](socket);function respondWithRpcPromise(_0x1e8ee0,_0x21b668,_0x596154){return new BPromise(function(_0x5c1ce5,_0x58e53c){return client[_0x7e57('0x10')](_0x1e8ee0,_0x596154)[_0x7e57('0x11')](function(_0x12068c){logger['info'](_0x7e57('0x12'),_0x21b668,_0x7e57('0x13'));logger[_0x7e57('0x14')](_0x7e57('0x15'),_0x21b668,_0x7e57('0x13'),JSON[_0x7e57('0x16')](_0x12068c));if(_0x12068c['error']){if(_0x12068c[_0x7e57('0x17')][_0x7e57('0x18')]===0x1f4){logger[_0x7e57('0x17')](_0x7e57('0x12'),_0x21b668,_0x12068c['error']['message']);return _0x58e53c(_0x12068c['error']['message']);}logger[_0x7e57('0x17')](_0x7e57('0x12'),_0x21b668,_0x12068c[_0x7e57('0x17')][_0x7e57('0x19')]);return _0x5c1ce5(_0x12068c[_0x7e57('0x17')][_0x7e57('0x19')]);}else{logger[_0x7e57('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x21b668,_0x7e57('0x13'));_0x5c1ce5(_0x12068c[_0x7e57('0x1b')][_0x7e57('0x19')]);}})['catch'](function(_0x53767b){logger[_0x7e57('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x21b668,_0x53767b);_0x58e53c(_0x53767b);});});}exports[_0x7e57('0x1c')]=function(_0x66a56f){var _0x584cf5=this;return new Promise(function(_0xb65d0e,_0x27a508){return db[_0x7e57('0x1d')]['update'](_0x66a56f['body'],{'raw':_0x66a56f[_0x7e57('0x1e')]?_0x66a56f['options'][_0x7e57('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66a56f['options']?_0x66a56f['options'][_0x7e57('0x20')]||null:null,'attributes':_0x66a56f['options']?_0x66a56f[_0x7e57('0x1e')][_0x7e57('0x21')]||null:null,'limit':_0x66a56f[_0x7e57('0x1e')]?_0x66a56f['options'][_0x7e57('0x22')]||null:null})[_0x7e57('0x11')](function(_0x57df99){logger[_0x7e57('0x1a')](_0x7e57('0x1c'),_0x66a56f);logger[_0x7e57('0x14')](_0x7e57('0x1c'),_0x66a56f,JSON[_0x7e57('0x16')](_0x57df99));_0xb65d0e(_0x57df99);})['catch'](function(_0x60f516){logger[_0x7e57('0x17')](_0x7e57('0x1c'),_0x60f516[_0x7e57('0x19')],_0x66a56f);_0x27a508(_0x584cf5['error'](0x1f4,_0x60f516[_0x7e57('0x19')]));});});};exports[_0x7e57('0x23')]=function(_0x341dae){return new Promise(function(_0x21d50f,_0x4bc248){return db[_0x7e57('0x1d')]['find']({'where':_0x341dae[_0x7e57('0x1e')]?_0x341dae[_0x7e57('0x1e')]['where']||null:null})[_0x7e57('0x11')](function(_0x419573){if(_0x419573){return _0x419573[_0x7e57('0x24')](_0x341dae['body'][_0x7e57('0x25')],_[_0x7e57('0x26')](_0x341dae['body'],[_0x7e57('0x25'),'id'])||{});}})[_0x7e57('0x27')](function(_0x17fd58){logger[_0x7e57('0x1a')](_0x7e57('0x28'),_0x341dae);logger[_0x7e57('0x14')](_0x7e57('0x28'),_0x341dae,JSON[_0x7e57('0x16')](_0x17fd58));_0x21d50f(_0x17fd58);})[_0x7e57('0x29')](function(_0x23f313){logger[_0x7e57('0x17')](_0x7e57('0x28'),_0x23f313[_0x7e57('0x19')],_0x341dae);_0x4bc248(_this[_0x7e57('0x17')](0x1f4,_0x23f313['message']));});});}; \ No newline at end of file +var _0x06ae=['localhost','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x2a5b76,_0x4d7072){var _0x2f98f2=function(_0x363aae){while(--_0x363aae){_0x2a5b76['push'](_0x2a5b76['shift']());}};_0x2f98f2(++_0x4d7072);}(_0x06ae,0x17c));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe06a('0x0'));var util=require(_0xe06a('0x1'));var moment=require(_0xe06a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe06a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe06a('0x4'));var logger=require('../../config/logger')(_0xe06a('0x5'));var config=require(_0xe06a('0x6'));var jayson=require(_0xe06a('0x7'));var client=jayson[_0xe06a('0x8')]['http']({'port':0x232a});config[_0xe06a('0x9')]=_['defaults'](config[_0xe06a('0x9')],{'host':_0xe06a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe06a('0x9')]));require('./openchannelInteraction.socket')[_0xe06a('0xb')](socket);function respondWithRpcPromise(_0x2b85ff,_0x3b9bd8,_0x2a9849){return new BPromise(function(_0x495c53,_0x2e26ea){return client['request'](_0x2b85ff,_0x2a9849)[_0xe06a('0xc')](function(_0x1afaa6){logger[_0xe06a('0xd')](_0xe06a('0xe'),_0x3b9bd8,_0xe06a('0xf'));logger[_0xe06a('0x10')](_0xe06a('0x11'),_0x3b9bd8,_0xe06a('0xf'),JSON[_0xe06a('0x12')](_0x1afaa6));if(_0x1afaa6[_0xe06a('0x13')]){if(_0x1afaa6[_0xe06a('0x13')][_0xe06a('0x14')]===0x1f4){logger[_0xe06a('0x13')](_0xe06a('0xe'),_0x3b9bd8,_0x1afaa6[_0xe06a('0x13')]['message']);return _0x2e26ea(_0x1afaa6['error']['message']);}logger['error'](_0xe06a('0xe'),_0x3b9bd8,_0x1afaa6['error']['message']);return _0x495c53(_0x1afaa6['error'][_0xe06a('0x15')]);}else{logger[_0xe06a('0xd')](_0xe06a('0xe'),_0x3b9bd8,_0xe06a('0xf'));_0x495c53(_0x1afaa6[_0xe06a('0x16')][_0xe06a('0x15')]);}})[_0xe06a('0x17')](function(_0x1f4d78){logger[_0xe06a('0x13')](_0xe06a('0xe'),_0x3b9bd8,_0x1f4d78);_0x2e26ea(_0x1f4d78);});});}exports[_0xe06a('0x18')]=function(_0x4d8881){var _0x2af224=this;return new Promise(function(_0xb03386,_0xd75911){return db[_0xe06a('0x19')][_0xe06a('0x1a')](_0x4d8881[_0xe06a('0x1b')],{'raw':_0x4d8881['options']?_0x4d8881[_0xe06a('0x1c')][_0xe06a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d8881['options']?_0x4d8881[_0xe06a('0x1c')][_0xe06a('0x1e')]||null:null,'attributes':_0x4d8881[_0xe06a('0x1c')]?_0x4d8881[_0xe06a('0x1c')][_0xe06a('0x1f')]||null:null,'limit':_0x4d8881[_0xe06a('0x1c')]?_0x4d8881[_0xe06a('0x1c')][_0xe06a('0x20')]||null:null})[_0xe06a('0xc')](function(_0x44f5bd){logger[_0xe06a('0xd')](_0xe06a('0x18'),_0x4d8881);logger[_0xe06a('0x10')](_0xe06a('0x18'),_0x4d8881,JSON['stringify'](_0x44f5bd));_0xb03386(_0x44f5bd);})['catch'](function(_0x4684e4){logger[_0xe06a('0x13')](_0xe06a('0x18'),_0x4684e4[_0xe06a('0x15')],_0x4d8881);_0xd75911(_0x2af224[_0xe06a('0x13')](0x1f4,_0x4684e4[_0xe06a('0x15')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0xe622f7){return new Promise(function(_0x531247,_0x5b0ae8){return db[_0xe06a('0x19')][_0xe06a('0x21')]({'where':_0xe622f7[_0xe06a('0x1c')]?_0xe622f7['options']['where']||null:null})[_0xe06a('0xc')](function(_0x2a2644){if(_0x2a2644){return _0x2a2644[_0xe06a('0x22')](_0xe622f7['body']['ids'],_[_0xe06a('0x23')](_0xe622f7[_0xe06a('0x1b')],[_0xe06a('0x24'),'id'])||{});}})[_0xe06a('0x25')](function(_0x4683d3){logger['info'](_0xe06a('0x26'),_0xe622f7);logger[_0xe06a('0x10')](_0xe06a('0x26'),_0xe622f7,JSON[_0xe06a('0x12')](_0x4683d3));_0x531247(_0x4683d3);})[_0xe06a('0x17')](function(_0x584d78){logger[_0xe06a('0x13')](_0xe06a('0x26'),_0x584d78[_0xe06a('0x15')],_0xe622f7);_0x5b0ae8(_this[_0xe06a('0x13')](0x1f4,_0x584d78['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 257d43e..c012558 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 _0x1783=['length','./openchannelInteraction.events','update','removeListener'];(function(_0x36b532,_0x4d8e0b){var _0x380b7a=function(_0x5e8752){while(--_0x5e8752){_0x36b532['push'](_0x36b532['shift']());}};_0x380b7a(++_0x4d8e0b);}(_0x1783,0xbd));var _0x3178=function(_0xf71005,_0x50e459){_0xf71005=_0xf71005-0x0;var _0xc2977a=_0x1783[_0xf71005];return _0xc2977a;};'use strict';var OpenchannelInteractionEvents=require(_0x3178('0x0'));var events=['save','remove',_0x3178('0x1')];function createListener(_0x33e3e8,_0x3984fc){return function(_0x2042a2){_0x3984fc['emit'](_0x33e3e8,_0x2042a2);};}function removeListener(_0x3686de,_0x28d878){return function(){OpenchannelInteractionEvents[_0x3178('0x2')](_0x3686de,_0x28d878);};}exports['register']=function(_0x2d69d0){for(var _0x1853c7=0x0,_0x92bc3b=events[_0x3178('0x3')];_0x1853c7<_0x92bc3b;_0x1853c7++){var _0x74e6b6=events[_0x1853c7];var _0x2065b4=createListener('openchannelInteraction:'+_0x74e6b6,_0x2d69d0);OpenchannelInteractionEvents['on'](_0x74e6b6,_0x2065b4);}}; \ No newline at end of file +var _0x73ba=['./openchannelInteraction.events','save','update','emit','register','openchannelInteraction:'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x73ba,0xd8));var _0xa73b=function(_0x36c9b6,_0x150d9d){_0x36c9b6=_0x36c9b6-0x0;var _0x3d3278=_0x73ba[_0x36c9b6];return _0x3d3278;};'use strict';var OpenchannelInteractionEvents=require(_0xa73b('0x0'));var events=[_0xa73b('0x1'),'remove',_0xa73b('0x2')];function createListener(_0x539b5a,_0x172156){return function(_0x5efd0b){_0x172156[_0xa73b('0x3')](_0x539b5a,_0x5efd0b);};}function removeListener(_0x16f6c8,_0x4c772e){return function(){OpenchannelInteractionEvents['removeListener'](_0x16f6c8,_0x4c772e);};}exports[_0xa73b('0x4')]=function(_0x349534){for(var _0x45780f=0x0,_0x4a3af1=events['length'];_0x45780f<_0x4a3af1;_0x45780f++){var _0x505d83=events[_0x45780f];var _0x2aeec6=createListener(_0xa73b('0x5')+_0x505d83,_0x349534);OpenchannelInteractionEvents['on'](_0x505d83,_0x2aeec6);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3b05859..d365e5c 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 6e328fa..e532ea8 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0447=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x4af42d,_0x226c6d){var _0x14b54f=function(_0x107076){while(--_0x107076){_0x4af42d['push'](_0x4af42d['shift']());}};_0x14b54f(++_0x226c6d);}(_0x0447,0x8b));var _0x7044=function(_0x6b888e,_0x420fed){_0x6b888e=_0x6b888e-0x0;var _0x17d0f6=_0x0447[_0x6b888e];return _0x17d0f6;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'body':{'type':Sequelize[_0x7044('0x2')](_0x7044('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7044('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7044('0x5')]('in',_0x7044('0x6')),'defaultValue':_0x7044('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7044('0x7')]},'providerName':{'type':Sequelize[_0x7044('0x8')]},'providerResponse':{'type':Sequelize[_0x7044('0x2')]}}; \ No newline at end of file +var _0x0647=['medium','BOOLEAN','ENUM','DATE','STRING','sequelize','TEXT'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0647,0xd0));var _0x7064=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x0647[_0xf34109];return _0x570bfc;};'use strict';var Sequelize=require(_0x7064('0x0'));module['exports']={'body':{'type':Sequelize[_0x7064('0x1')](_0x7064('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7064('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7064('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7064('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7064('0x5')]},'providerName':{'type':Sequelize[_0x7064('0x6')]},'providerResponse':{'type':Sequelize[_0x7064('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 43106a2..e10f849 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 _0x0eee=['User','email','internal','manual','interface','channel','event','accept','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','fullname','SIP/%s','motionChannel','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','then','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','keys','find','create','body','params','describe','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0eee,0x96));var _0xe0ee=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x0eee[_0x3b96cf];return _0x2e315a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0ee('0x0'));var zipdir=require(_0xe0ee('0x1'));var jsonpatch=require(_0xe0ee('0x2'));var rp=require(_0xe0ee('0x3'));var moment=require('moment');var BPromise=require(_0xe0ee('0x4'));var Mustache=require(_0xe0ee('0x5'));var util=require(_0xe0ee('0x6'));var path=require(_0xe0ee('0x7'));var sox=require(_0xe0ee('0x8'));var csv=require('to-csv');var ejs=require(_0xe0ee('0x9'));var fs=require('fs');var fs_extra=require(_0xe0ee('0xa'));var _=require('lodash');var squel=require(_0xe0ee('0xb'));var crypto=require(_0xe0ee('0xc'));var jsforce=require(_0xe0ee('0xd'));var deskjs=require(_0xe0ee('0xe'));var toCsv=require(_0xe0ee('0xf'));var querystring=require(_0xe0ee('0x10'));var Papa=require(_0xe0ee('0x11'));var Redis=require('ioredis');var authService=require(_0xe0ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe0ee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0ee('0x14'))(_0xe0ee('0x15'));var utils=require('../../config/utils');var config=require(_0xe0ee('0x16'));var licenseUtil=require(_0xe0ee('0x17'));var db=require(_0xe0ee('0x18'))['db'];config[_0xe0ee('0x19')]=_[_0xe0ee('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe0ee('0x1b'))(new Redis(config[_0xe0ee('0x19')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0xe0ee('0x1c'));var client=jayson[_0xe0ee('0x1d')][_0xe0ee('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xe0ee('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x570bdc,_0x288338,_0x27bdea,_0x15eec6){return new BPromise(function(_0x4dd4da,_0x9ddd53){var _0x137114=_0x15eec6||client;return _0x137114['request'](_0x570bdc,_0x27bdea)[_0xe0ee('0x1f')](function(_0x52c0e3){logger['info'](_0xe0ee('0x20'),_0x288338,'request\x20sent');logger['debug'](_0xe0ee('0x21'),_0x288338,_0xe0ee('0x22'),JSON[_0xe0ee('0x23')](_0x52c0e3));if(_0x52c0e3[_0xe0ee('0x24')]){if(_0x52c0e3[_0xe0ee('0x24')]['code']===0x1f4){logger[_0xe0ee('0x24')](_0xe0ee('0x20'),_0x288338,_0x52c0e3[_0xe0ee('0x24')]['message']);return _0x9ddd53(_0x52c0e3[_0xe0ee('0x24')]['message']);}logger[_0xe0ee('0x24')](_0xe0ee('0x20'),_0x288338,_0x52c0e3['error'][_0xe0ee('0x25')]);return _0x4dd4da(_0x52c0e3[_0xe0ee('0x24')]['message']);}else{logger[_0xe0ee('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x288338,_0xe0ee('0x22'));_0x4dd4da(_0x52c0e3[_0xe0ee('0x27')][_0xe0ee('0x25')]);}})[_0xe0ee('0x28')](function(_0x58f3c9){logger['error'](_0xe0ee('0x20'),_0x288338,_0x58f3c9);_0x9ddd53(_0x58f3c9);});});}function respondWithStatusCode(_0x35cd93,_0x21c3b5){_0x21c3b5=_0x21c3b5||0xcc;return function(_0x7322a2){if(_0x7322a2){return _0x35cd93[_0xe0ee('0x29')](_0x21c3b5);}return _0x35cd93[_0xe0ee('0x2a')](_0x21c3b5)[_0xe0ee('0x2b')]();};}function respondWithResult(_0x12b1c5,_0x2d6c63){_0x2d6c63=_0x2d6c63||0xc8;return function(_0x2d7fd6){if(_0x2d7fd6){return _0x12b1c5[_0xe0ee('0x2a')](_0x2d6c63)[_0xe0ee('0x2c')](_0x2d7fd6);}};}function respondWithFilteredResult(_0x47fc7e,_0x56bbcf){return function(_0x3063c6){if(_0x3063c6){var _0x3fbffa=typeof _0x56bbcf[_0xe0ee('0x2d')]===_0xe0ee('0x2e')&&typeof _0x56bbcf[_0xe0ee('0x2f')]===_0xe0ee('0x2e');var _0xfa9d9a=_0x3063c6['count'];var _0x1e49fa=_0x3fbffa?0x0:_0x56bbcf[_0xe0ee('0x2d')];var _0x3d9580=_0x3fbffa?_0x3063c6[_0xe0ee('0x30')]:_0x56bbcf['offset']+_0x56bbcf[_0xe0ee('0x2f')];var _0x254b81;if(_0x3d9580>=_0xfa9d9a){_0x3d9580=_0xfa9d9a;_0x254b81=0xc8;}else{_0x254b81=0xce;}_0x47fc7e['status'](_0x254b81);return _0x47fc7e[_0xe0ee('0x31')](_0xe0ee('0x32'),_0x1e49fa+'-'+_0x3d9580+'/'+_0xfa9d9a)['json'](_0x3063c6);}return null;};}function patchUpdates(_0x50c2df){return function(_0x324bac){try{jsonpatch[_0xe0ee('0x33')](_0x324bac,_0x50c2df,!![]);}catch(_0x21aaf7){return BPromise[_0xe0ee('0x34')](_0x21aaf7);}return _0x324bac[_0xe0ee('0x35')]();};}function saveUpdates(_0x193831,_0xe2eca8){return function(_0x3558b1){if(_0x3558b1){return _0x3558b1[_0xe0ee('0x36')](_0x193831)['then'](function(_0x59902e){return _0x59902e;});}return null;};}function removeEntity(_0x3fd696,_0x49e33d){return function(_0x36cb2c){if(_0x36cb2c){return _0x36cb2c[_0xe0ee('0x37')]()[_0xe0ee('0x1f')](function(){_0x3fd696['status'](0xcc)[_0xe0ee('0x2b')]();});}};}function handleEntityNotFound(_0x3a19d7,_0x2288b9){return function(_0x548830){if(!_0x548830){_0x3a19d7['sendStatus'](0x194);}return _0x548830;};}function handleError(_0x4eba95,_0x374002){_0x374002=_0x374002||0x1f4;return function(_0x382727){logger[_0xe0ee('0x24')](_0x382727[_0xe0ee('0x38')]);if(_0x382727[_0xe0ee('0x39')]){delete _0x382727[_0xe0ee('0x39')];}_0x4eba95[_0xe0ee('0x2a')](_0x374002)[_0xe0ee('0x3a')](_0x382727);};}exports['index']=function(_0x2b653f,_0x524a2e){var _0x4b6834={},_0x35a47f={},_0xbc1778={'count':0x0,'rows':[]};var _0x336112=_[_0xe0ee('0x3b')](db[_0xe0ee('0x3c')][_0xe0ee('0x3d')],function(_0x470ca3){return{'name':_0x470ca3[_0xe0ee('0x3e')],'type':_0x470ca3['type']['key']};});_0x35a47f[_0xe0ee('0x3f')]=_[_0xe0ee('0x3b')](_0x336112,_0xe0ee('0x39'));_0x35a47f['query']=_['keys'](_0x2b653f[_0xe0ee('0x40')]);_0x35a47f['filters']=_[_0xe0ee('0x41')](_0x35a47f[_0xe0ee('0x3f')],_0x35a47f['query']);_0x4b6834[_0xe0ee('0x42')]=_[_0xe0ee('0x41')](_0x35a47f[_0xe0ee('0x3f')],qs[_0xe0ee('0x43')](_0x2b653f['query'][_0xe0ee('0x43')]));_0x4b6834[_0xe0ee('0x42')]=_0x4b6834[_0xe0ee('0x42')][_0xe0ee('0x44')]?_0x4b6834[_0xe0ee('0x42')]:_0x35a47f['model'];if(!_0x2b653f[_0xe0ee('0x40')][_0xe0ee('0x45')]('nolimit')){_0x4b6834[_0xe0ee('0x2f')]=qs['limit'](_0x2b653f[_0xe0ee('0x40')][_0xe0ee('0x2f')]);_0x4b6834['offset']=qs[_0xe0ee('0x2d')](_0x2b653f[_0xe0ee('0x40')][_0xe0ee('0x2d')]);}_0x4b6834[_0xe0ee('0x46')]=qs[_0xe0ee('0x47')](_0x2b653f[_0xe0ee('0x40')]['sort']);_0x4b6834[_0xe0ee('0x48')]=qs[_0xe0ee('0x49')](_[_0xe0ee('0x4a')](_0x2b653f['query'],_0x35a47f[_0xe0ee('0x49')]),_0x336112);if(_0x2b653f[_0xe0ee('0x40')][_0xe0ee('0x4b')]){_0x4b6834[_0xe0ee('0x48')]=_[_0xe0ee('0x4c')](_0x4b6834[_0xe0ee('0x48')],{'$or':_[_0xe0ee('0x3b')](_0x336112,function(_0x1bb78b){if(_0x1bb78b[_0xe0ee('0x4d')]!==_0xe0ee('0x4e')){var _0x296182={};_0x296182[_0x1bb78b[_0xe0ee('0x39')]]={'$like':'%'+_0x2b653f[_0xe0ee('0x40')][_0xe0ee('0x4b')]+'%'};return _0x296182;}})});}_0x4b6834=_[_0xe0ee('0x4c')]({},_0x4b6834,_0x2b653f[_0xe0ee('0x4f')]);var _0x58443b={'where':_0x4b6834[_0xe0ee('0x48')]};return db['OpenchannelMessage'][_0xe0ee('0x30')](_0x58443b)['then'](function(_0x10fd2f){_0xbc1778[_0xe0ee('0x30')]=_0x10fd2f;if(_0x2b653f[_0xe0ee('0x40')][_0xe0ee('0x50')]){_0x4b6834[_0xe0ee('0x51')]=[{'all':!![]}];}return db[_0xe0ee('0x3c')]['findAll'](_0x4b6834);})[_0xe0ee('0x1f')](function(_0x3cbcbb){_0xbc1778[_0xe0ee('0x52')]=_0x3cbcbb;return _0xbc1778;})[_0xe0ee('0x1f')](respondWithFilteredResult(_0x524a2e,_0x4b6834))[_0xe0ee('0x28')](handleError(_0x524a2e,null));};exports['show']=function(_0x4af8b2,_0x3b709a){var _0x58c228={'raw':!![],'where':{'id':_0x4af8b2['params']['id']}},_0x159159={};_0x159159[_0xe0ee('0x3f')]=_[_0xe0ee('0x53')](db['OpenchannelMessage']['rawAttributes']);_0x159159['query']=_[_0xe0ee('0x53')](_0x4af8b2[_0xe0ee('0x40')]);_0x159159['filters']=_[_0xe0ee('0x41')](_0x159159[_0xe0ee('0x3f')],_0x159159[_0xe0ee('0x40')]);_0x58c228['attributes']=_['intersection'](_0x159159[_0xe0ee('0x3f')],qs[_0xe0ee('0x43')](_0x4af8b2[_0xe0ee('0x40')][_0xe0ee('0x43')]));_0x58c228[_0xe0ee('0x42')]=_0x58c228['attributes'][_0xe0ee('0x44')]?_0x58c228[_0xe0ee('0x42')]:_0x159159[_0xe0ee('0x3f')];if(_0x4af8b2[_0xe0ee('0x40')][_0xe0ee('0x50')]){_0x58c228[_0xe0ee('0x51')]=[{'all':!![]}];}_0x58c228=_[_0xe0ee('0x4c')]({},_0x58c228,_0x4af8b2[_0xe0ee('0x4f')]);return db[_0xe0ee('0x3c')][_0xe0ee('0x54')](_0x58c228)[_0xe0ee('0x1f')](handleEntityNotFound(_0x3b709a,null))['then'](respondWithResult(_0x3b709a,null))[_0xe0ee('0x28')](handleError(_0x3b709a,null));};exports['create']=function(_0x2f4e7c,_0x4a8a06){return db[_0xe0ee('0x3c')][_0xe0ee('0x55')](_0x2f4e7c[_0xe0ee('0x56')],{})[_0xe0ee('0x1f')](respondWithResult(_0x4a8a06,0xc9))[_0xe0ee('0x28')](handleError(_0x4a8a06,null));};exports[_0xe0ee('0x36')]=function(_0x3a430d,_0x25c46f){if(_0x3a430d[_0xe0ee('0x56')]['id']){delete _0x3a430d[_0xe0ee('0x56')]['id'];}return db[_0xe0ee('0x3c')]['find']({'where':{'id':_0x3a430d[_0xe0ee('0x57')]['id']}})[_0xe0ee('0x1f')](handleEntityNotFound(_0x25c46f,null))[_0xe0ee('0x1f')](saveUpdates(_0x3a430d[_0xe0ee('0x56')],null))[_0xe0ee('0x1f')](respondWithResult(_0x25c46f,null))[_0xe0ee('0x28')](handleError(_0x25c46f,null));};exports[_0xe0ee('0x37')]=function(_0x4e58ee,_0x2ae623){return db[_0xe0ee('0x3c')][_0xe0ee('0x54')]({'where':{'id':_0x4e58ee['params']['id']}})[_0xe0ee('0x1f')](handleEntityNotFound(_0x2ae623,null))[_0xe0ee('0x1f')](removeEntity(_0x2ae623,null))['catch'](handleError(_0x2ae623,null));};exports[_0xe0ee('0x58')]=function(_0x3e6a18,_0x314bc3){return db[_0xe0ee('0x3c')]['describe']()['then'](respondWithResult(_0x314bc3,null))['catch'](handleError(_0x314bc3,null));};var interaction_log=require(_0xe0ee('0x14'))(_0xe0ee('0x59'));exports['accept']=function(_0x47ecfa,_0x3344df,_0x1e1427){var _0x569d59={'agent':{},'channel':_0xe0ee('0x5a')};if(_0x47ecfa[_0xe0ee('0x56')]['id']){delete _0x47ecfa['body']['id'];}_0x47ecfa[_0xe0ee('0x56')][_0xe0ee('0x5b')]=!![];_0x47ecfa['body'][_0xe0ee('0x5c')]=moment()['format'](_0xe0ee('0x5d'));_0x47ecfa[_0xe0ee('0x56')][_0xe0ee('0x5e')]=_0x47ecfa[_0xe0ee('0x56')][_0xe0ee('0x5e')]||_0x47ecfa[_0xe0ee('0x5f')]['id'];_0x569d59[_0xe0ee('0x60')]['id']=_0x47ecfa[_0xe0ee('0x56')]['UserId'];return db[_0xe0ee('0x3c')][_0xe0ee('0x54')]({'where':{'id':_0x47ecfa[_0xe0ee('0x57')]['id'],'UserId':null}})[_0xe0ee('0x1f')](handleEntityNotFound(_0x3344df,null))['then'](saveUpdates(_0x47ecfa[_0xe0ee('0x56')],null))[_0xe0ee('0x1f')](function(_0x42fce2){if(_0x42fce2){_0x569d59[_0xe0ee('0x25')]=_0x42fce2[_0xe0ee('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe0ee('0x54')]({'where':{'id':_0x42fce2['OpenchannelInteractionId']}});}return null;})[_0xe0ee('0x1f')](handleEntityNotFound(_0x3344df,null))[_0xe0ee('0x1f')](function(_0x57bec5){if(_0x57bec5){return _0x57bec5[_0xe0ee('0x36')]({'UserId':_0x47ecfa['body'][_0xe0ee('0x5e')],'read1stAt':_['isNil'](_0x57bec5[_0xe0ee('0x62')])?moment()[_0xe0ee('0x63')](_0xe0ee('0x5d')):undefined});}return null;})[_0xe0ee('0x1f')](function(_0x33f695){if(_0x33f695){_0x569d59[_0xe0ee('0x64')]=_0x33f695[_0xe0ee('0x61')]({'plain':!![]});interaction_log[_0xe0ee('0x26')](_0xe0ee('0x65'),_0x47ecfa[_0xe0ee('0x5f')]['id'],_0x47ecfa[_0xe0ee('0x5f')][_0xe0ee('0x39')],_0x47ecfa['user'][_0xe0ee('0x66')],_0x569d59[_0xe0ee('0x64')]['id'],_0x47ecfa[_0xe0ee('0x56')]?JSON['stringify'](_0x47ecfa[_0xe0ee('0x56')]):_0xe0ee('0x67'));return respondWithRpcPromise(_0xe0ee('0x68'),_0xe0ee('0x69'),_0x569d59);}return null;})[_0xe0ee('0x1f')](function(_0x2f912b){var _0x1accba=_0xe0ee('0x6a')+_0x2f912b[_0xe0ee('0x25')][_0xe0ee('0x6b')];return db[_0xe0ee('0x6c')][_0xe0ee('0x40')](_0x1accba,{'type':db['Sequelize'][_0xe0ee('0x6d')][_0xe0ee('0x6e')],'raw':!![]})['then'](function(_0x2dceeb){return _0x2dceeb;});})['then'](function(_0x44aa06){if(_0x44aa06){_0x569d59['message'][_0xe0ee('0x6f')]=_0x44aa06[0x0];if(!_0x47ecfa[_0xe0ee('0x56')][_0xe0ee('0x5e')])return;return db[_0xe0ee('0x70')][_0xe0ee('0x54')]({'where':{'id':_0x47ecfa[_0xe0ee('0x56')]['UserId'],'role':_0xe0ee('0x60')},'attributes':['id','name','fullname',_0xe0ee('0x71'),_0xe0ee('0x72')],'raw':!![]});}return null;})[_0xe0ee('0x1f')](function(_0x49a6d1){if(!_0x49a6d1)return null;_0x569d59['message']['agent']=_0x49a6d1;return _0x569d59;})[_0xe0ee('0x1f')](function(_0x3d5596){if(_0x3d5596){if(_0x47ecfa[_0xe0ee('0x56')][_0xe0ee('0x73')]){_0x569d59[_0xe0ee('0x25')][_0xe0ee('0x74')]=util[_0xe0ee('0x63')]('SIP/%s',_0x47ecfa[_0xe0ee('0x5f')][_0xe0ee('0x39')]);_0x569d59['message'][_0xe0ee('0x75')]=_0x569d59['channel'];_0x569d59['message']['motionChannel']=_0x569d59[_0xe0ee('0x75')];_0x569d59[_0xe0ee('0x25')][_0xe0ee('0x76')]=_0xe0ee('0x77');return respondWithRpcPromise(_0xe0ee('0x78'),_0xe0ee('0x78'),{'event':_0xe0ee('0x79'),'message':_0x569d59['message']},client9002)[_0xe0ee('0x1f')](function(){return _0x569d59;});}return _0x569d59;}return null;})[_0xe0ee('0x1f')](respondWithResult(_0x3344df,null))[_0xe0ee('0x28')](handleError(_0x3344df,null));};var interaction_log=require(_0xe0ee('0x14'))('openchannel-interactions');exports[_0xe0ee('0x34')]=function(_0x388495,_0x493bf6,_0x162d94){var _0x1fde10={'agent':{},'channel':'openchannel'};if(_0x388495['body']['id']){delete _0x388495[_0xe0ee('0x56')]['id'];}_0x388495[_0xe0ee('0x56')]['UserId']=_0x388495[_0xe0ee('0x56')][_0xe0ee('0x5e')]||_0x388495[_0xe0ee('0x5f')]['id'];_0x1fde10[_0xe0ee('0x60')]['id']=_0x388495[_0xe0ee('0x56')][_0xe0ee('0x5e')];return db[_0xe0ee('0x3c')][_0xe0ee('0x54')]({'where':{'id':_0x388495[_0xe0ee('0x57')]['id'],'UserId':null}})[_0xe0ee('0x1f')](handleEntityNotFound(_0x493bf6,null))[_0xe0ee('0x1f')](function(_0x4aaab2){if(_0x4aaab2){_0x1fde10[_0xe0ee('0x25')]=_0x4aaab2['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xe0ee('0x54')]({'where':{'id':_0x4aaab2[_0xe0ee('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x493bf6,null))['then'](function(_0x3b26cf){if(_0x3b26cf){_0x1fde10['interaction']=_0x3b26cf[_0xe0ee('0x61')]({'plain':!![]});interaction_log[_0xe0ee('0x26')](_0xe0ee('0x7b'),_0x388495[_0xe0ee('0x5f')]['id'],_0x388495[_0xe0ee('0x5f')]['name'],_0x388495['user'][_0xe0ee('0x66')],_0x1fde10[_0xe0ee('0x64')]['id'],_0x388495['body']?JSON['stringify'](_0x388495['body']):_0xe0ee('0x67'));return respondWithRpcPromise(_0xe0ee('0x7c'),_0xe0ee('0x7d'),_0x1fde10);}return null;})[_0xe0ee('0x1f')](function(_0xd53e41){var _0x3f9211='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd53e41[_0xe0ee('0x25')]['ContactId'];return db['sequelize'][_0xe0ee('0x40')](_0x3f9211,{'type':db[_0xe0ee('0x7e')][_0xe0ee('0x6d')][_0xe0ee('0x6e')],'raw':!![]})[_0xe0ee('0x1f')](function(_0x386972){return _0x386972;});})[_0xe0ee('0x1f')](function(_0x1e0561){if(_0x1e0561){_0x1fde10[_0xe0ee('0x25')][_0xe0ee('0x6f')]=_0x1e0561[0x0];if(!_0x388495['body'][_0xe0ee('0x5e')])return;return db['User']['find']({'where':{'id':_0x388495[_0xe0ee('0x56')][_0xe0ee('0x5e')],'role':'agent'},'attributes':['id',_0xe0ee('0x39'),_0xe0ee('0x7f'),_0xe0ee('0x71'),_0xe0ee('0x72')],'raw':!![]});}return null;})[_0xe0ee('0x1f')](function(_0x350ec0){if(!_0x350ec0)return null;_0x1fde10[_0xe0ee('0x25')]['agent']=_0x350ec0;return _0x1fde10;})['then'](function(_0x18e7b5){if(_0x18e7b5){_0x18e7b5[_0xe0ee('0x25')][_0xe0ee('0x74')]=util[_0xe0ee('0x63')](_0xe0ee('0x80'),_0x388495[_0xe0ee('0x5f')][_0xe0ee('0x39')]);_0x18e7b5['message'][_0xe0ee('0x75')]=_0x1fde10[_0xe0ee('0x75')];_0x18e7b5['message'][_0xe0ee('0x81')]=_0x1fde10[_0xe0ee('0x75')];_0x18e7b5[_0xe0ee('0x25')]['event']=_0xe0ee('0x34');respondWithRpcPromise(_0xe0ee('0x78'),_0xe0ee('0x78'),{'event':_0xe0ee('0x82'),'message':_0x18e7b5[_0xe0ee('0x25')]},client9002);return _0x1fde10;}return null;})['then'](respondWithResult(_0x493bf6,null))[_0xe0ee('0x28')](handleError(_0x493bf6,null));}; \ No newline at end of file +var _0xb83d=['sort','where','filters','merge','type','VIRTUAL','options','OpenchannelMessage','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','../../config/logger','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','contact','User','motionChannel','event','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','update','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0xb83d,0x1d0));var _0xdb83=function(_0x270644,_0x42cb15){_0x270644=_0x270644-0x0;var _0x1f20ce=_0xb83d[_0x270644];return _0x1f20ce;};'use strict';var emlformat=require(_0xdb83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb83('0x1'));var jsonpatch=require(_0xdb83('0x2'));var rp=require('request-promise');var moment=require(_0xdb83('0x3'));var BPromise=require(_0xdb83('0x4'));var Mustache=require(_0xdb83('0x5'));var util=require('util');var path=require(_0xdb83('0x6'));var sox=require(_0xdb83('0x7'));var csv=require(_0xdb83('0x8'));var ejs=require(_0xdb83('0x9'));var fs=require('fs');var fs_extra=require(_0xdb83('0xa'));var _=require(_0xdb83('0xb'));var squel=require(_0xdb83('0xc'));var crypto=require(_0xdb83('0xd'));var jsforce=require(_0xdb83('0xe'));var deskjs=require(_0xdb83('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdb83('0x10'));var Papa=require(_0xdb83('0x11'));var Redis=require(_0xdb83('0x12'));var authService=require(_0xdb83('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdb83('0x14'));var hardwareService=require(_0xdb83('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdb83('0x16'));var licenseUtil=require(_0xdb83('0x17'));var db=require(_0xdb83('0x18'))['db'];config[_0xdb83('0x19')]=_[_0xdb83('0x1a')](config[_0xdb83('0x19')],{'host':_0xdb83('0x1b'),'port':0x18eb});var socket=require(_0xdb83('0x1c'))(new Redis(config[_0xdb83('0x19')]));require(_0xdb83('0x1d'))['register'](socket);var jayson=require(_0xdb83('0x1e'));var client=jayson[_0xdb83('0x1f')][_0xdb83('0x20')]({'port':0x232c});var client9002=jayson[_0xdb83('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x591914,_0x5342e0,_0x4f901b,_0x2d100a){return new BPromise(function(_0x55d1ac,_0x309dd3){var _0x727679=_0x2d100a||client;return _0x727679[_0xdb83('0x21')](_0x591914,_0x4f901b)[_0xdb83('0x22')](function(_0x3601e3){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x5342e0,_0xdb83('0x23'));logger[_0xdb83('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x5342e0,_0xdb83('0x23'),JSON[_0xdb83('0x25')](_0x3601e3));if(_0x3601e3[_0xdb83('0x26')]){if(_0x3601e3[_0xdb83('0x26')]['code']===0x1f4){logger[_0xdb83('0x26')](_0xdb83('0x27'),_0x5342e0,_0x3601e3[_0xdb83('0x26')][_0xdb83('0x28')]);return _0x309dd3(_0x3601e3['error'][_0xdb83('0x28')]);}logger[_0xdb83('0x26')](_0xdb83('0x27'),_0x5342e0,_0x3601e3[_0xdb83('0x26')]['message']);return _0x55d1ac(_0x3601e3['error']['message']);}else{logger[_0xdb83('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x5342e0,_0xdb83('0x23'));_0x55d1ac(_0x3601e3[_0xdb83('0x2a')]['message']);}})['catch'](function(_0x165e5a){logger[_0xdb83('0x26')](_0xdb83('0x27'),_0x5342e0,_0x165e5a);_0x309dd3(_0x165e5a);});});}function respondWithStatusCode(_0x968030,_0x597d43){_0x597d43=_0x597d43||0xcc;return function(_0x40a8fd){if(_0x40a8fd){return _0x968030[_0xdb83('0x2b')](_0x597d43);}return _0x968030[_0xdb83('0x2c')](_0x597d43)[_0xdb83('0x2d')]();};}function respondWithResult(_0x4c9a5c,_0x3ffb5a){_0x3ffb5a=_0x3ffb5a||0xc8;return function(_0x3292dc){if(_0x3292dc){return _0x4c9a5c[_0xdb83('0x2c')](_0x3ffb5a)['json'](_0x3292dc);}};}function respondWithFilteredResult(_0x248d29,_0x56df30){return function(_0x3912c6){if(_0x3912c6){var _0x1f54b0=typeof _0x56df30[_0xdb83('0x2e')]==='undefined'&&typeof _0x56df30['limit']===_0xdb83('0x2f');var _0x15b4bb=_0x3912c6[_0xdb83('0x30')];var _0x11c861=_0x1f54b0?0x0:_0x56df30[_0xdb83('0x2e')];var _0x389c7c=_0x1f54b0?_0x3912c6[_0xdb83('0x30')]:_0x56df30[_0xdb83('0x2e')]+_0x56df30[_0xdb83('0x31')];var _0x3a5070;if(_0x389c7c>=_0x15b4bb){_0x389c7c=_0x15b4bb;_0x3a5070=0xc8;}else{_0x3a5070=0xce;}_0x248d29[_0xdb83('0x2c')](_0x3a5070);return _0x248d29['set'](_0xdb83('0x32'),_0x11c861+'-'+_0x389c7c+'/'+_0x15b4bb)[_0xdb83('0x33')](_0x3912c6);}return null;};}function patchUpdates(_0x1f5250){return function(_0x1cfdcb){try{jsonpatch['apply'](_0x1cfdcb,_0x1f5250,!![]);}catch(_0x27a7a0){return BPromise[_0xdb83('0x34')](_0x27a7a0);}return _0x1cfdcb['save']();};}function saveUpdates(_0x49de10,_0x81021a){return function(_0x37c944){if(_0x37c944){return _0x37c944[_0xdb83('0x35')](_0x49de10)[_0xdb83('0x22')](function(_0x1c4c0b){return _0x1c4c0b;});}return null;};}function removeEntity(_0x516d14,_0x14ab64){return function(_0x2b4fe6){if(_0x2b4fe6){return _0x2b4fe6['destroy']()['then'](function(){_0x516d14[_0xdb83('0x2c')](0xcc)[_0xdb83('0x2d')]();});}};}function handleEntityNotFound(_0x41bcb8,_0x2257c5){return function(_0x53c4d1){if(!_0x53c4d1){_0x41bcb8[_0xdb83('0x2b')](0x194);}return _0x53c4d1;};}function handleError(_0x594a54,_0x5f5417){_0x5f5417=_0x5f5417||0x1f4;return function(_0x1021f5){logger[_0xdb83('0x26')](_0x1021f5['stack']);if(_0x1021f5[_0xdb83('0x36')]){delete _0x1021f5[_0xdb83('0x36')];}_0x594a54['status'](_0x5f5417)[_0xdb83('0x37')](_0x1021f5);};}exports[_0xdb83('0x38')]=function(_0x3e58f5,_0x5574be){var _0x476463={},_0x52b18c={},_0x5ac7df={'count':0x0,'rows':[]};var _0x3f7350=_[_0xdb83('0x39')](db['OpenchannelMessage']['rawAttributes'],function(_0x54bb49){return{'name':_0x54bb49[_0xdb83('0x3a')],'type':_0x54bb49['type'][_0xdb83('0x3b')]};});_0x52b18c[_0xdb83('0x3c')]=_[_0xdb83('0x39')](_0x3f7350,'name');_0x52b18c[_0xdb83('0x3d')]=_[_0xdb83('0x3e')](_0x3e58f5[_0xdb83('0x3d')]);_0x52b18c['filters']=_[_0xdb83('0x3f')](_0x52b18c[_0xdb83('0x3c')],_0x52b18c[_0xdb83('0x3d')]);_0x476463[_0xdb83('0x40')]=_[_0xdb83('0x3f')](_0x52b18c[_0xdb83('0x3c')],qs[_0xdb83('0x41')](_0x3e58f5['query'][_0xdb83('0x41')]));_0x476463['attributes']=_0x476463['attributes']['length']?_0x476463[_0xdb83('0x40')]:_0x52b18c[_0xdb83('0x3c')];if(!_0x3e58f5[_0xdb83('0x3d')]['hasOwnProperty'](_0xdb83('0x42'))){_0x476463[_0xdb83('0x31')]=qs[_0xdb83('0x31')](_0x3e58f5[_0xdb83('0x3d')][_0xdb83('0x31')]);_0x476463[_0xdb83('0x2e')]=qs['offset'](_0x3e58f5[_0xdb83('0x3d')]['offset']);}_0x476463[_0xdb83('0x43')]=qs[_0xdb83('0x44')](_0x3e58f5[_0xdb83('0x3d')]['sort']);_0x476463[_0xdb83('0x45')]=qs[_0xdb83('0x46')](_['pick'](_0x3e58f5['query'],_0x52b18c['filters']),_0x3f7350);if(_0x3e58f5[_0xdb83('0x3d')]['filter']){_0x476463['where']=_[_0xdb83('0x47')](_0x476463[_0xdb83('0x45')],{'$or':_[_0xdb83('0x39')](_0x3f7350,function(_0x2c711e){if(_0x2c711e[_0xdb83('0x48')]!==_0xdb83('0x49')){var _0x479d8d={};_0x479d8d[_0x2c711e['name']]={'$like':'%'+_0x3e58f5[_0xdb83('0x3d')]['filter']+'%'};return _0x479d8d;}})});}_0x476463=_['merge']({},_0x476463,_0x3e58f5[_0xdb83('0x4a')]);var _0x2c66ad={'where':_0x476463[_0xdb83('0x45')]};return db[_0xdb83('0x4b')][_0xdb83('0x30')](_0x2c66ad)[_0xdb83('0x22')](function(_0x5a123f){_0x5ac7df[_0xdb83('0x30')]=_0x5a123f;if(_0x3e58f5[_0xdb83('0x3d')]['includeAll']){_0x476463[_0xdb83('0x4c')]=[{'all':!![]}];}return db[_0xdb83('0x4b')][_0xdb83('0x4d')](_0x476463);})[_0xdb83('0x22')](function(_0x8026fe){_0x5ac7df[_0xdb83('0x4e')]=_0x8026fe;return _0x5ac7df;})[_0xdb83('0x22')](respondWithFilteredResult(_0x5574be,_0x476463))[_0xdb83('0x4f')](handleError(_0x5574be,null));};exports[_0xdb83('0x50')]=function(_0x1525bd,_0x48e341){var _0x599f87={'raw':!![],'where':{'id':_0x1525bd[_0xdb83('0x51')]['id']}},_0x5ddbfe={};_0x5ddbfe[_0xdb83('0x3c')]=_[_0xdb83('0x3e')](db['OpenchannelMessage'][_0xdb83('0x52')]);_0x5ddbfe[_0xdb83('0x3d')]=_[_0xdb83('0x3e')](_0x1525bd[_0xdb83('0x3d')]);_0x5ddbfe[_0xdb83('0x46')]=_['intersection'](_0x5ddbfe[_0xdb83('0x3c')],_0x5ddbfe[_0xdb83('0x3d')]);_0x599f87[_0xdb83('0x40')]=_[_0xdb83('0x3f')](_0x5ddbfe['model'],qs['fields'](_0x1525bd[_0xdb83('0x3d')][_0xdb83('0x41')]));_0x599f87[_0xdb83('0x40')]=_0x599f87[_0xdb83('0x40')][_0xdb83('0x53')]?_0x599f87[_0xdb83('0x40')]:_0x5ddbfe[_0xdb83('0x3c')];if(_0x1525bd[_0xdb83('0x3d')][_0xdb83('0x54')]){_0x599f87['include']=[{'all':!![]}];}_0x599f87=_[_0xdb83('0x47')]({},_0x599f87,_0x1525bd[_0xdb83('0x4a')]);return db[_0xdb83('0x4b')][_0xdb83('0x55')](_0x599f87)[_0xdb83('0x22')](handleEntityNotFound(_0x48e341,null))[_0xdb83('0x22')](respondWithResult(_0x48e341,null))[_0xdb83('0x4f')](handleError(_0x48e341,null));};exports['create']=function(_0x255a5a,_0x24dc7d){return db[_0xdb83('0x4b')]['create'](_0x255a5a[_0xdb83('0x56')],{})[_0xdb83('0x22')](respondWithResult(_0x24dc7d,0xc9))[_0xdb83('0x4f')](handleError(_0x24dc7d,null));};exports[_0xdb83('0x35')]=function(_0x17991b,_0x4c9d0b){if(_0x17991b[_0xdb83('0x56')]['id']){delete _0x17991b[_0xdb83('0x56')]['id'];}return db[_0xdb83('0x4b')][_0xdb83('0x55')]({'where':{'id':_0x17991b['params']['id']}})[_0xdb83('0x22')](handleEntityNotFound(_0x4c9d0b,null))['then'](saveUpdates(_0x17991b[_0xdb83('0x56')],null))[_0xdb83('0x22')](respondWithResult(_0x4c9d0b,null))[_0xdb83('0x4f')](handleError(_0x4c9d0b,null));};exports[_0xdb83('0x57')]=function(_0xa87b71,_0x38c163){return db[_0xdb83('0x4b')]['find']({'where':{'id':_0xa87b71[_0xdb83('0x51')]['id']}})[_0xdb83('0x22')](handleEntityNotFound(_0x38c163,null))['then'](removeEntity(_0x38c163,null))[_0xdb83('0x4f')](handleError(_0x38c163,null));};exports['describe']=function(_0x233363,_0x3d07d9){return db['OpenchannelMessage'][_0xdb83('0x58')]()[_0xdb83('0x22')](respondWithResult(_0x3d07d9,null))[_0xdb83('0x4f')](handleError(_0x3d07d9,null));};var interaction_log=require('../../config/logger')(_0xdb83('0x59'));exports[_0xdb83('0x5a')]=function(_0x514caa,_0x292453,_0x7ef92a){var _0x345c1d={'agent':{},'channel':_0xdb83('0x5b')};if(_0x514caa[_0xdb83('0x56')]['id']){delete _0x514caa[_0xdb83('0x56')]['id'];}_0x514caa['body'][_0xdb83('0x5c')]=!![];_0x514caa['body'][_0xdb83('0x5d')]=moment()[_0xdb83('0x5e')](_0xdb83('0x5f'));_0x514caa[_0xdb83('0x56')][_0xdb83('0x60')]=_0x514caa[_0xdb83('0x56')][_0xdb83('0x60')]||_0x514caa[_0xdb83('0x61')]['id'];_0x345c1d[_0xdb83('0x62')]['id']=_0x514caa[_0xdb83('0x56')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x514caa[_0xdb83('0x51')]['id'],'UserId':null}})[_0xdb83('0x22')](handleEntityNotFound(_0x292453,null))[_0xdb83('0x22')](saveUpdates(_0x514caa['body'],null))[_0xdb83('0x22')](function(_0x451ef6){if(_0x451ef6){_0x345c1d[_0xdb83('0x28')]=_0x451ef6[_0xdb83('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0xdb83('0x55')]({'where':{'id':_0x451ef6['OpenchannelInteractionId']}});}return null;})[_0xdb83('0x22')](handleEntityNotFound(_0x292453,null))[_0xdb83('0x22')](function(_0x89c1cf){if(_0x89c1cf){return _0x89c1cf[_0xdb83('0x35')]({'UserId':_0x514caa[_0xdb83('0x56')][_0xdb83('0x60')],'read1stAt':_[_0xdb83('0x64')](_0x89c1cf['read1stAt'])?moment()[_0xdb83('0x5e')](_0xdb83('0x5f')):undefined});}return null;})[_0xdb83('0x22')](function(_0x105a4e){if(_0x105a4e){_0x345c1d[_0xdb83('0x65')]=_0x105a4e[_0xdb83('0x63')]({'plain':!![]});interaction_log[_0xdb83('0x29')](_0xdb83('0x66'),_0x514caa[_0xdb83('0x61')]['id'],_0x514caa['user'][_0xdb83('0x36')],_0x514caa[_0xdb83('0x61')]['role'],_0x345c1d[_0xdb83('0x65')]['id'],_0x514caa[_0xdb83('0x56')]?JSON[_0xdb83('0x25')](_0x514caa[_0xdb83('0x56')]):_0xdb83('0x67'));return respondWithRpcPromise(_0xdb83('0x68'),_0xdb83('0x69'),_0x345c1d);}return null;})[_0xdb83('0x22')](function(_0x2f13d7){var _0x1abc85=_0xdb83('0x6a')+_0x2f13d7['message'][_0xdb83('0x6b')];return db[_0xdb83('0x6c')][_0xdb83('0x3d')](_0x1abc85,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xdb83('0x22')](function(_0x2a2c6f){return _0x2a2c6f;});})[_0xdb83('0x22')](function(_0xd8b3aa){if(_0xd8b3aa){_0x345c1d[_0xdb83('0x28')]['contact']=_0xd8b3aa[0x0];if(!_0x514caa[_0xdb83('0x56')][_0xdb83('0x60')])return;return db['User'][_0xdb83('0x55')]({'where':{'id':_0x514caa[_0xdb83('0x56')][_0xdb83('0x60')],'role':'agent'},'attributes':['id',_0xdb83('0x36'),_0xdb83('0x6d'),_0xdb83('0x6e'),_0xdb83('0x6f')],'raw':!![]});}return null;})[_0xdb83('0x22')](function(_0x4d8642){if(!_0x4d8642)return null;_0x345c1d['message'][_0xdb83('0x62')]=_0x4d8642;return _0x345c1d;})[_0xdb83('0x22')](function(_0x47d63c){if(_0x47d63c){if(_0x514caa[_0xdb83('0x56')][_0xdb83('0x70')]){_0x345c1d[_0xdb83('0x28')][_0xdb83('0x71')]=util[_0xdb83('0x5e')](_0xdb83('0x72'),_0x514caa[_0xdb83('0x61')][_0xdb83('0x36')]);_0x345c1d['message'][_0xdb83('0x73')]=_0x345c1d[_0xdb83('0x73')];_0x345c1d['message']['motionChannel']=_0x345c1d[_0xdb83('0x73')];_0x345c1d['message']['event']='accept';return respondWithRpcPromise(_0xdb83('0x74'),_0xdb83('0x74'),{'event':_0xdb83('0x75'),'message':_0x345c1d[_0xdb83('0x28')]},client9002)[_0xdb83('0x22')](function(){return _0x345c1d;});}return _0x345c1d;}return null;})[_0xdb83('0x22')](respondWithResult(_0x292453,null))[_0xdb83('0x4f')](handleError(_0x292453,null));};var interaction_log=require(_0xdb83('0x76'))(_0xdb83('0x59'));exports[_0xdb83('0x34')]=function(_0x2e8028,_0x15f4aa,_0x14d240){var _0x40190c={'agent':{},'channel':'openchannel'};if(_0x2e8028[_0xdb83('0x56')]['id']){delete _0x2e8028['body']['id'];}_0x2e8028[_0xdb83('0x56')][_0xdb83('0x60')]=_0x2e8028[_0xdb83('0x56')][_0xdb83('0x60')]||_0x2e8028[_0xdb83('0x61')]['id'];_0x40190c[_0xdb83('0x62')]['id']=_0x2e8028[_0xdb83('0x56')][_0xdb83('0x60')];return db[_0xdb83('0x4b')][_0xdb83('0x55')]({'where':{'id':_0x2e8028[_0xdb83('0x51')]['id'],'UserId':null}})[_0xdb83('0x22')](handleEntityNotFound(_0x15f4aa,null))[_0xdb83('0x22')](function(_0x4a34c8){if(_0x4a34c8){_0x40190c[_0xdb83('0x28')]=_0x4a34c8[_0xdb83('0x63')]({'plain':!![]});return db[_0xdb83('0x77')][_0xdb83('0x55')]({'where':{'id':_0x4a34c8[_0xdb83('0x78')]}});}return null;})[_0xdb83('0x22')](handleEntityNotFound(_0x15f4aa,null))[_0xdb83('0x22')](function(_0x13a91f){if(_0x13a91f){_0x40190c[_0xdb83('0x65')]=_0x13a91f[_0xdb83('0x63')]({'plain':!![]});interaction_log[_0xdb83('0x29')](_0xdb83('0x79'),_0x2e8028[_0xdb83('0x61')]['id'],_0x2e8028[_0xdb83('0x61')]['name'],_0x2e8028['user'][_0xdb83('0x7a')],_0x40190c[_0xdb83('0x65')]['id'],_0x2e8028['body']?JSON['stringify'](_0x2e8028[_0xdb83('0x56')]):'null');return respondWithRpcPromise(_0xdb83('0x7b'),_0xdb83('0x7c'),_0x40190c);}return null;})['then'](function(_0x364a34){var _0x5256d6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x364a34[_0xdb83('0x28')][_0xdb83('0x6b')];return db[_0xdb83('0x6c')][_0xdb83('0x3d')](_0x5256d6,{'type':db[_0xdb83('0x7d')][_0xdb83('0x7e')][_0xdb83('0x7f')],'raw':!![]})[_0xdb83('0x22')](function(_0x2a120a){return _0x2a120a;});})[_0xdb83('0x22')](function(_0x1e82fb){if(_0x1e82fb){_0x40190c[_0xdb83('0x28')][_0xdb83('0x80')]=_0x1e82fb[0x0];if(!_0x2e8028['body'][_0xdb83('0x60')])return;return db[_0xdb83('0x81')][_0xdb83('0x55')]({'where':{'id':_0x2e8028[_0xdb83('0x56')]['UserId'],'role':_0xdb83('0x62')},'attributes':['id',_0xdb83('0x36'),_0xdb83('0x6d'),_0xdb83('0x6e'),_0xdb83('0x6f')],'raw':!![]});}return null;})['then'](function(_0x1d3602){if(!_0x1d3602)return null;_0x40190c[_0xdb83('0x28')]['agent']=_0x1d3602;return _0x40190c;})[_0xdb83('0x22')](function(_0x3b5b4a){if(_0x3b5b4a){_0x3b5b4a['message'][_0xdb83('0x71')]=util[_0xdb83('0x5e')](_0xdb83('0x72'),_0x2e8028[_0xdb83('0x61')][_0xdb83('0x36')]);_0x3b5b4a[_0xdb83('0x28')][_0xdb83('0x73')]=_0x40190c[_0xdb83('0x73')];_0x3b5b4a[_0xdb83('0x28')][_0xdb83('0x82')]=_0x40190c[_0xdb83('0x73')];_0x3b5b4a[_0xdb83('0x28')][_0xdb83('0x83')]=_0xdb83('0x34');respondWithRpcPromise(_0xdb83('0x74'),_0xdb83('0x74'),{'event':_0xdb83('0x84'),'message':_0x3b5b4a[_0xdb83('0x28')]},client9002);return _0x40190c;}return null;})[_0xdb83('0x22')](respondWithResult(_0x15f4aa,null))['catch'](handleError(_0x15f4aa,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index cd3db88..6783a27 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 _0x59f5=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x27b4f0,_0x13d1f1){var _0x17b73c=function(_0x54fc72){while(--_0x54fc72){_0x27b4f0['push'](_0x27b4f0['shift']());}};_0x17b73c(++_0x13d1f1);}(_0x59f5,0x1a4));var _0x559f=function(_0x2de362,_0x3981ae){_0x2de362=_0x2de362-0x0;var _0x29a113=_0x59f5[_0x2de362];return _0x29a113;};'use strict';var EventEmitter=require(_0x559f('0x0'));var OpenchannelMessage=require(_0x559f('0x1'))['db'][_0x559f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x559f('0x3')](0x0);var events={'afterCreate':_0x559f('0x4'),'afterUpdate':_0x559f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x342c35){return function(_0xde927b,_0x445ec6,_0x119b96){OpenchannelMessageEvents[_0x559f('0x6')](_0x342c35+':'+_0xde927b['id'],_0xde927b);OpenchannelMessageEvents[_0x559f('0x6')](_0x342c35,_0xde927b);_0x119b96(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x559f('0x7')](e,emitEvent(event));}}module[_0x559f('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xf6e8=['emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','save','update','remove'];(function(_0x4c2d32,_0xd434cf){var _0x780118=function(_0x4ec384){while(--_0x4ec384){_0x4c2d32['push'](_0x4c2d32['shift']());}};_0x780118(++_0xd434cf);}(_0xf6e8,0x148));var _0x8f6e=function(_0x415868,_0x2e8959){_0x415868=_0x415868-0x0;var _0xc9333a=_0xf6e8[_0x415868];return _0xc9333a;};'use strict';var EventEmitter=require(_0x8f6e('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x8f6e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8f6e('0x2'),'afterUpdate':_0x8f6e('0x3'),'afterDestroy':_0x8f6e('0x4')};function emitEvent(_0x1f32fa){return function(_0x4267d0,_0x7a9413,_0x4e4636){OpenchannelMessageEvents['emit'](_0x1f32fa+':'+_0x4267d0['id'],_0x4267d0);OpenchannelMessageEvents[_0x8f6e('0x5')](_0x1f32fa,_0x4267d0);_0x4e4636(null);};}for(var e in events){if(events[_0x8f6e('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8f6e('0x7')](e,emitEvent(event));}}module[_0x8f6e('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 820f0e4..aed13bf 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 _0x9354=['threadId','inspect','finally','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','Contact','POST','method','GET','body'];(function(_0x483b71,_0x1ecb58){var _0x2296f8=function(_0x55787e){while(--_0x55787e){_0x483b71['push'](_0x483b71['shift']());}};_0x2296f8(++_0x1ecb58);}(_0x9354,0x96));var _0x4935=function(_0x411b68,_0x52e768){_0x411b68=_0x411b68-0x0;var _0x41ff90=_0x9354[_0x411b68];return _0x41ff90;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[{'name':_0x4935('0xc'),'fields':['body'],'type':_0x4935('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47a44f,_0x2aac9a,_0x38de96){var _0xd5b117=_0x2d518a[_0x4935('0xe')];var _0x261462=_0x47a44f[_0x4935('0xf')]({'plain':!![]});if(_0x261462['direction']['toLowerCase']()==='in'||_0x261462[_0x4935('0x10')]['toLowerCase']()==='out'&&!_0x261462[_0x4935('0x11')]&&!_[_0x4935('0x12')](_0x261462[_0x4935('0x13')])){_0xd5b117[_0x4935('0x14')][_0x4935('0x15')]({'where':{'id':_0x261462[_0x4935('0x16')]}})[_0x4935('0x17')](function(_0x3a7c30){if(_0x3a7c30){_0x3a7c30[_0x4935('0x18')]({'lastMsgAt':_0x261462[_0x4935('0x19')],'lastMsgDirection':_0x261462[_0x4935('0x10')][_0x4935('0x1a')]()});}})[_0x4935('0x1b')](function(_0x3652c4){console[_0x4935('0x1c')](_0x3652c4);});}if(_0x261462[_0x4935('0x10')]==='out'&&!_0x261462[_0x4935('0x11')]){var _0x46526a;_0xd5b117[_0x4935('0x1d')][_0x4935('0x1e')]()[_0x4935('0x17')](function(_0x429ef3){return _0xd5b117['OpenchannelAccount'][_0x4935('0x1f')]({'where':{'id':_0x261462[_0x4935('0x20')]},'include':[{'model':_0xd5b117['OpenchannelInteraction'],'as':_0x4935('0x21'),'where':{'id':_0x261462[_0x4935('0x16')]},'limit':0x1,'include':[{'model':_0xd5b117[_0x4935('0x1d')],'as':'Contact','attributes':_['keys'](_0x429ef3)}]}]});})[_0x4935('0x17')](function(_0x6b849f){_0x46526a=_0x6b849f[_0x4935('0xf')]({'plain':!![]});if(_0x46526a&&_0x46526a[_0x4935('0x22')]){logger[_0x4935('0x23')](_0x4935('0x24'),_0x4935('0x25'),util[_0x4935('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x46526a[_0x4935('0x21')]&&_0x46526a[_0x4935('0x21')][_0x4935('0x27')]){_0x261462[_0x4935('0x28')]=_['omit'](_0x46526a['Interactions'][0x0],_0x4935('0x29'));_0x261462[_0x4935('0x29')]=_0x46526a[_0x4935('0x21')][0x0][_0x4935('0x29')];}var _0x2aac9a={'method':_0x4935('0x2a'),'uri':encodeURI(_0x46526a[_0x4935('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2aac9a[_0x4935('0x2b')]){case _0x4935('0x2c'):_0x2aac9a['qs']=_0x261462;break;case _0x4935('0x2a'):_0x2aac9a[_0x4935('0x2d')]=_0x261462;break;}return rp(_0x2aac9a)[_0x4935('0x17')](function(_0x2c47ab){logger[_0x4935('0x23')](_0x4935('0x24'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x2c47ab[_0x4935('0x2d')]['threadId']&&_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]!=_0x261462[_0x4935('0x28')][_0x4935('0x2e')]){return _0xd5b117[_0x4935('0x14')][_0x4935('0x18')]({'threadId':_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]},{'logging':!![],'where':{'id':_0x261462['Interaction']['id']}});}else{return;}})[_0x4935('0x17')](function(){return _0x47a44f[_0x4935('0x18')]({'read':!![]});})['catch'](function(_0x48a289){logger[_0x4935('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x4935('0x25'),util[_0x4935('0x2f')](_0x48a289,{'showHidden':![],'depth':null}));_0x38de96();});}else{_0x38de96();}})[_0x4935('0x30')](function(){_0x38de96();});}else{_0x38de96();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','direction','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4_unicode_ci'];(function(_0x31dc61,_0x4adbf3){var _0x312587=function(_0x1bd210){while(--_0x1bd210){_0x31dc61['push'](_0x31dc61['shift']());}};_0x312587(++_0x4adbf3);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5997d9,_0x1aa8a4){_0x5997d9=_0x5997d9-0x0;var _0x2eb07=_0x8f4c[_0x5997d9];return _0x2eb07;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xc')],'type':_0xc8f4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39ed63,_0x34f05f,_0x599de3){var _0x38c41b=_0x5208da[_0xc8f4('0xe')];var _0x2fba62=_0x39ed63[_0xc8f4('0xf')]({'plain':!![]});if(_0x2fba62['direction'][_0xc8f4('0x10')]()==='in'||_0x2fba62['direction'][_0xc8f4('0x10')]()===_0xc8f4('0x11')&&!_0x2fba62[_0xc8f4('0x12')]&&!_[_0xc8f4('0x13')](_0x2fba62[_0xc8f4('0x14')])){_0x38c41b['OpenchannelInteraction'][_0xc8f4('0x15')]({'where':{'id':_0x2fba62[_0xc8f4('0x16')]}})[_0xc8f4('0x17')](function(_0x14bc11){if(_0x14bc11){_0x14bc11[_0xc8f4('0x18')]({'lastMsgAt':_0x2fba62[_0xc8f4('0x19')],'lastMsgDirection':_0x2fba62['direction'][_0xc8f4('0x10')]()});}})[_0xc8f4('0x1a')](function(_0x1518a6){console[_0xc8f4('0x1b')](_0x1518a6);});}if(_0x2fba62[_0xc8f4('0x1c')]==='out'&&!_0x2fba62[_0xc8f4('0x12')]){var _0x4d2b77;_0x38c41b['CmContact'][_0xc8f4('0x1d')]()[_0xc8f4('0x17')](function(_0x108076){return _0x38c41b[_0xc8f4('0x1e')][_0xc8f4('0x1f')]({'where':{'id':_0x2fba62[_0xc8f4('0x20')]},'include':[{'model':_0x38c41b[_0xc8f4('0x21')],'as':_0xc8f4('0x22'),'where':{'id':_0x2fba62[_0xc8f4('0x16')]},'limit':0x1,'include':[{'model':_0x38c41b[_0xc8f4('0x23')],'as':_0xc8f4('0x24'),'attributes':_[_0xc8f4('0x25')](_0x108076)}]}]});})[_0xc8f4('0x17')](function(_0x5f3264){_0x4d2b77=_0x5f3264[_0xc8f4('0xf')]({'plain':!![]});if(_0x4d2b77&&_0x4d2b77[_0xc8f4('0x26')]){logger[_0xc8f4('0x27')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x2b'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x4d2b77['Interactions']&&_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x2c')]){_0x2fba62[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x4d2b77['Interactions'][0x0],_0xc8f4('0x24'));_0x2fba62['Contact']=_0x4d2b77[_0xc8f4('0x22')][0x0]['Contact'];}var _0x34f05f={'method':_0xc8f4('0x2f'),'uri':encodeURI(_0x4d2b77['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34f05f[_0xc8f4('0x30')]){case _0xc8f4('0x31'):_0x34f05f['qs']=_0x2fba62;break;case _0xc8f4('0x2f'):_0x34f05f[_0xc8f4('0xc')]=_0x2fba62;break;}return rp(_0x34f05f)['then'](function(_0x3db490){logger[_0xc8f4('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x32'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x3db490[_0xc8f4('0xc')][_0xc8f4('0x33')]&&_0x3db490['body'][_0xc8f4('0x33')]!=_0x2fba62[_0xc8f4('0x2d')][_0xc8f4('0x33')]){return _0x38c41b['OpenchannelInteraction'][_0xc8f4('0x18')]({'threadId':_0x3db490[_0xc8f4('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x2fba62['Interaction']['id']}});}else{return;}})['then'](function(){return _0x39ed63[_0xc8f4('0x18')]({'read':!![]});})[_0xc8f4('0x1a')](function(_0x2e9a2a){logger[_0xc8f4('0x1b')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x34')](_0x2e9a2a,{'showHidden':![],'depth':null}));_0x599de3();});}else{_0x599de3();}})[_0xc8f4('0x35')](function(){_0x599de3();});}else{_0x599de3();}}},'charset':'utf8mb4','collate':_0xc8f4('0x36')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index bcb2948..763de0a 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19a9a9,_0x33095d){var _0x2eca23=function(_0x79c297){while(--_0x79c297){_0x19a9a9['push'](_0x19a9a9['shift']());}};_0x2eca23(++_0x33095d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x861151,_0x2bdfa1){_0x861151=_0x861151-0x0;var _0x30d385=_0x5f2f[_0x861151];return _0x30d385;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x6c8e28,_0x4969b0){var _0x41189b=function(_0x38d2c6){while(--_0x38d2c6){_0x6c8e28['push'](_0x6c8e28['shift']());}};_0x41189b(++_0x4969b0);}(_0xadb5,0xad));var _0x5adb=function(_0x1ea32b,_0x27a3e3){_0x1ea32b=_0x1ea32b-0x0;var _0x2bae39=_0xadb5[_0x1ea32b];return _0x2bae39;};'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 43f3fe6..bf0cc0b 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 _0x9cb3=['removeListener','register','length','openchannelMessage:','save','remove','update'];(function(_0x18bcc4,_0x51f25b){var _0x1440e3=function(_0x1e203d){while(--_0x1e203d){_0x18bcc4['push'](_0x18bcc4['shift']());}};_0x1440e3(++_0x51f25b);}(_0x9cb3,0x13f));var _0x39cb=function(_0x567ce7,_0x1e52e6){_0x567ce7=_0x567ce7-0x0;var _0x243d76=_0x9cb3[_0x567ce7];return _0x243d76;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x39cb('0x0'),_0x39cb('0x1'),_0x39cb('0x2')];function createListener(_0xe74bf8,_0x11b627){return function(_0x1de8f6){_0x11b627['emit'](_0xe74bf8,_0x1de8f6);};}function removeListener(_0x4bc90c,_0x1c6d00){return function(){OpenchannelMessageEvents[_0x39cb('0x3')](_0x4bc90c,_0x1c6d00);};}exports[_0x39cb('0x4')]=function(_0x2b5b0a){for(var _0x1b8c5d=0x0,_0x29285c=events[_0x39cb('0x5')];_0x1b8c5d<_0x29285c;_0x1b8c5d++){var _0x448d3b=events[_0x1b8c5d];var _0x41953=createListener(_0x39cb('0x6')+_0x448d3b,_0x2b5b0a);OpenchannelMessageEvents['on'](_0x448d3b,_0x41953);}}; \ No newline at end of file +var _0xef1a=['remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0xef1a,0xaf));var _0xaef1=function(_0x3756da,_0x4b2f18){_0x3756da=_0x3756da-0x0;var _0x25f412=_0xef1a[_0x3756da];return _0x25f412;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xaef1('0x0'),_0xaef1('0x1')];function createListener(_0x208488,_0x5669c3){return function(_0x5ef564){_0x5669c3[_0xaef1('0x2')](_0x208488,_0x5ef564);};}function removeListener(_0x520a0d,_0x4de826){return function(){OpenchannelMessageEvents[_0xaef1('0x3')](_0x520a0d,_0x4de826);};}exports[_0xaef1('0x4')]=function(_0x5a079b){for(var _0x3b4cf8=0x0,_0xd5ee9=events[_0xaef1('0x5')];_0x3b4cf8<_0xd5ee9;_0x3b4cf8++){var _0x19256b=events[_0x3b4cf8];var _0x437f88=createListener(_0xaef1('0x6')+_0x19256b,_0x5a079b);OpenchannelMessageEvents['on'](_0x19256b,_0x437f88);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f77d587..e107d6e 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 _0xa65a=['getTeams','getAgents','post','addTeams','/:id/users','put','update','delete','removeTeams','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','describe','/:id','isAuthenticated','getMembers','/:id/teams'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xa65a,0x14f));var _0xaa65=function(_0x3dd606,_0x3e83dd){_0x3dd606=_0x3dd606-0x0;var _0x13c325=_0xa65a[_0x3dd606];return _0x13c325;};'use strict';var multer=require(_0xaa65('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa65('0x1'));var express=require(_0xaa65('0x2'));var router=express[_0xaa65('0x3')]();var fs_extra=require(_0xaa65('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaa65('0x5'));var config=require(_0xaa65('0x6'));var controller=require(_0xaa65('0x7'));router[_0xaa65('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaa65('0x9'),auth['isAuthenticated'](),controller[_0xaa65('0xa')]);router['get'](_0xaa65('0xb'),auth[_0xaa65('0xc')](),controller['show']);router[_0xaa65('0x8')]('/:id/members',auth[_0xaa65('0xc')](),controller[_0xaa65('0xd')]);router['get'](_0xaa65('0xe'),auth[_0xaa65('0xc')](),controller[_0xaa65('0xf')]);router['get']('/:id/users',auth[_0xaa65('0xc')](),controller[_0xaa65('0x10')]);router[_0xaa65('0x11')]('/',auth[_0xaa65('0xc')](),controller['create']);router[_0xaa65('0x11')](_0xaa65('0xe'),auth[_0xaa65('0xc')](),controller[_0xaa65('0x12')]);router[_0xaa65('0x11')](_0xaa65('0x13'),auth[_0xaa65('0xc')](),controller['addAgents']);router[_0xaa65('0x14')](_0xaa65('0xb'),auth[_0xaa65('0xc')](),controller[_0xaa65('0x15')]);router[_0xaa65('0x16')](_0xaa65('0xb'),auth[_0xaa65('0xc')](),controller['destroy']);router[_0xaa65('0x16')](_0xaa65('0xe'),auth[_0xaa65('0xc')](),controller[_0xaa65('0x17')]);router[_0xaa65('0x16')](_0xaa65('0x13'),auth[_0xaa65('0xc')](),controller[_0xaa65('0x18')]);module['exports']=router; \ No newline at end of file +var _0xdd4f=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','destroy','delete','removeTeams','exports','multer'];(function(_0x53282b,_0x115027){var _0x7ac4c5=function(_0x3470b3){while(--_0x3470b3){_0x53282b['push'](_0x53282b['shift']());}};_0x7ac4c5(++_0x115027);}(_0xdd4f,0x1a3));var _0xfdd4=function(_0x2d664a,_0xefb007){_0x2d664a=_0x2d664a-0x0;var _0x141683=_0xdd4f[_0x2d664a];return _0x141683;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require(_0xfdd4('0x1'));var path=require(_0xfdd4('0x2'));var timeout=require('connect-timeout');var express=require(_0xfdd4('0x3'));var router=express['Router']();var fs_extra=require(_0xfdd4('0x4'));var auth=require(_0xfdd4('0x5'));var interaction=require(_0xfdd4('0x6'));var config=require(_0xfdd4('0x7'));var controller=require(_0xfdd4('0x8'));router[_0xfdd4('0x9')]('/',auth[_0xfdd4('0xa')](),controller[_0xfdd4('0xb')]);router['get'](_0xfdd4('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfdd4('0xd'),auth[_0xfdd4('0xa')](),controller['show']);router[_0xfdd4('0x9')](_0xfdd4('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xfdd4('0x9')](_0xfdd4('0xf'),auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x10')]);router[_0xfdd4('0x9')]('/:id/users',auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x11')]);router[_0xfdd4('0x12')]('/',auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x13')]);router['post'](_0xfdd4('0xf'),auth[_0xfdd4('0xa')](),controller['addTeams']);router[_0xfdd4('0x12')](_0xfdd4('0x14'),auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x15')]);router[_0xfdd4('0x16')](_0xfdd4('0xd'),auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x17')]);router['delete'](_0xfdd4('0xd'),auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x18')]);router[_0xfdd4('0x19')]('/:id/teams',auth[_0xfdd4('0xa')](),controller[_0xfdd4('0x1a')]);router[_0xfdd4('0x19')](_0xfdd4('0x14'),auth[_0xfdd4('0xa')](),controller['removeAgents']);module[_0xfdd4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 9cc6021..075b33d 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 _0xa5af=['INTEGER','ENUM','rrmemory','beepall','sequelize','STRING','name'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xa5af,0x138));var _0xfa5a=function(_0x43db9a,_0x4b9236){_0x43db9a=_0x43db9a-0x0;var _0x4f17d6=_0xa5af[_0x43db9a];return _0x4f17d6;};'use strict';var Sequelize=require(_0xfa5a('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa5a('0x1')],'unique':_0xfa5a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa5a('0x1')]},'timeout':{'type':Sequelize[_0xfa5a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa5a('0x4')](_0xfa5a('0x5'),_0xfa5a('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xac8d=['ENUM','rrmemory','sequelize','exports','STRING','INTEGER'];(function(_0x39dcaa,_0x2c0baf){var _0x4baa04=function(_0xe5eb6c){while(--_0xe5eb6c){_0x39dcaa['push'](_0x39dcaa['shift']());}};_0x4baa04(++_0x2c0baf);}(_0xac8d,0xf2));var _0xdac8=function(_0x5c463b,_0x5e3387){_0x5c463b=_0x5c463b-0x0;var _0x3c696b=_0xac8d[_0x5c463b];return _0x3c696b;};'use strict';var Sequelize=require(_0xdac8('0x0'));module[_0xdac8('0x1')]={'name':{'type':Sequelize[_0xdac8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdac8('0x2')]},'timeout':{'type':Sequelize[_0xdac8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdac8('0x4')](_0xdac8('0x5'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index ba6dbf2..eccc90d 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 _0x5985=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','get','UserProfileResource','error','stack','name','send','map','OpenchannelQueue','rawAttributes','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','merge','where','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','order','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x5985,0x77));var _0x5598=function(_0x34ab6e,_0x138731){_0x34ab6e=_0x34ab6e-0x0;var _0x35f23a=_0x5985[_0x34ab6e];return _0x35f23a;};'use strict';var emlformat=require(_0x5598('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5598('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5598('0x2'));var moment=require(_0x5598('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5598('0x4'));var util=require(_0x5598('0x5'));var path=require(_0x5598('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5598('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5598('0x8'));var squel=require(_0x5598('0x9'));var crypto=require(_0x5598('0xa'));var jsforce=require(_0x5598('0xb'));var deskjs=require(_0x5598('0xc'));var toCsv=require(_0x5598('0xd'));var querystring=require(_0x5598('0xe'));var Papa=require(_0x5598('0xf'));var Redis=require('ioredis');var authService=require(_0x5598('0x10'));var qs=require(_0x5598('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5598('0x12'));var utils=require(_0x5598('0x13'));var config=require(_0x5598('0x14'));var licenseUtil=require(_0x5598('0x15'));var db=require(_0x5598('0x16'))['db'];config[_0x5598('0x17')]=_[_0x5598('0x18')](config[_0x5598('0x17')],{'host':_0x5598('0x19'),'port':0x18eb});var socket=require(_0x5598('0x1a'))(new Redis(config[_0x5598('0x17')]));require(_0x5598('0x1b'))[_0x5598('0x1c')](socket);function respondWithStatusCode(_0x39690e,_0x5882d8){_0x5882d8=_0x5882d8||0xcc;return function(_0x1b3b7d){if(_0x1b3b7d){return _0x39690e[_0x5598('0x1d')](_0x5882d8);}return _0x39690e['status'](_0x5882d8)[_0x5598('0x1e')]();};}function respondWithResult(_0x183c30,_0x34963e){_0x34963e=_0x34963e||0xc8;return function(_0x1559ee){if(_0x1559ee){return _0x183c30['status'](_0x34963e)[_0x5598('0x1f')](_0x1559ee);}};}function respondWithFilteredResult(_0x5d65b2,_0x4d1e1e){return function(_0x294a5a){if(_0x294a5a){var _0x7e412b=typeof _0x4d1e1e[_0x5598('0x20')]==='undefined'&&typeof _0x4d1e1e[_0x5598('0x21')]===_0x5598('0x22');var _0x115471=_0x294a5a[_0x5598('0x23')];var _0x11c758=_0x7e412b?0x0:_0x4d1e1e[_0x5598('0x20')];var _0x3335f4=_0x7e412b?_0x294a5a['count']:_0x4d1e1e['offset']+_0x4d1e1e[_0x5598('0x21')];var _0x43ea93;if(_0x3335f4>=_0x115471){_0x3335f4=_0x115471;_0x43ea93=0xc8;}else{_0x43ea93=0xce;}_0x5d65b2[_0x5598('0x24')](_0x43ea93);return _0x5d65b2[_0x5598('0x25')](_0x5598('0x26'),_0x11c758+'-'+_0x3335f4+'/'+_0x115471)[_0x5598('0x1f')](_0x294a5a);}return null;};}function patchUpdates(_0x11903d){return function(_0x5ebe38){try{jsonpatch[_0x5598('0x27')](_0x5ebe38,_0x11903d,!![]);}catch(_0x41c31d){return BPromise['reject'](_0x41c31d);}return _0x5ebe38[_0x5598('0x28')]();};}function saveUpdates(_0x26acf2,_0x2f897c){return function(_0x1ffa80){if(_0x1ffa80){return _0x1ffa80[_0x5598('0x29')](_0x26acf2)[_0x5598('0x2a')](function(_0x4f837){return _0x4f837;});}return null;};}function removeEntity(_0x4ccad4,_0x2ebbef){return function(_0x25e620){if(_0x25e620){return _0x25e620['destroy']()['then'](function(){var _0x15978d=_0x25e620[_0x5598('0x2b')]({'plain':!![]});var _0x5432f2='OpenchannelQueues';return db[_0x5598('0x2c')]['destroy']({'where':{'type':_0x5432f2,'resourceId':_0x15978d['id']}})['then'](function(){return _0x25e620;});})[_0x5598('0x2a')](function(){_0x4ccad4[_0x5598('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9413,_0x3ba3da){return function(_0x5bbc55){if(!_0x5bbc55){_0x2f9413[_0x5598('0x1d')](0x194);}return _0x5bbc55;};}function handleError(_0x30bbe3,_0x1d29dd){_0x1d29dd=_0x1d29dd||0x1f4;return function(_0x34b61a){logger[_0x5598('0x2d')](_0x34b61a[_0x5598('0x2e')]);if(_0x34b61a[_0x5598('0x2f')]){delete _0x34b61a[_0x5598('0x2f')];}_0x30bbe3['status'](_0x1d29dd)[_0x5598('0x30')](_0x34b61a);};}exports['index']=function(_0x45f5ed,_0x23db64){var _0x4180e3={},_0x5a12b9={},_0x39a2c8={'count':0x0,'rows':[]};var _0x422df7=_[_0x5598('0x31')](db[_0x5598('0x32')][_0x5598('0x33')],function(_0x1310cd){return{'name':_0x1310cd['fieldName'],'type':_0x1310cd[_0x5598('0x34')]['key']};});_0x5a12b9[_0x5598('0x35')]=_[_0x5598('0x31')](_0x422df7,_0x5598('0x2f'));_0x5a12b9[_0x5598('0x36')]=_['keys'](_0x45f5ed[_0x5598('0x36')]);_0x5a12b9['filters']=_[_0x5598('0x37')](_0x5a12b9[_0x5598('0x35')],_0x5a12b9[_0x5598('0x36')]);_0x4180e3['attributes']=_[_0x5598('0x37')](_0x5a12b9[_0x5598('0x35')],qs[_0x5598('0x38')](_0x45f5ed[_0x5598('0x36')][_0x5598('0x38')]));_0x4180e3[_0x5598('0x39')]=_0x4180e3[_0x5598('0x39')][_0x5598('0x3a')]?_0x4180e3[_0x5598('0x39')]:_0x5a12b9[_0x5598('0x35')];if(!_0x45f5ed[_0x5598('0x36')][_0x5598('0x3b')](_0x5598('0x3c'))){_0x4180e3[_0x5598('0x21')]=qs[_0x5598('0x21')](_0x45f5ed['query']['limit']);_0x4180e3[_0x5598('0x20')]=qs['offset'](_0x45f5ed[_0x5598('0x36')][_0x5598('0x20')]);}_0x4180e3['order']=qs[_0x5598('0x3d')](_0x45f5ed[_0x5598('0x36')][_0x5598('0x3d')]);_0x4180e3['where']=qs['filters'](_[_0x5598('0x3e')](_0x45f5ed['query'],_0x5a12b9[_0x5598('0x3f')]),_0x422df7);if(_0x45f5ed[_0x5598('0x36')]['filter']){_0x4180e3['where']=_[_0x5598('0x40')](_0x4180e3[_0x5598('0x41')],{'$or':_[_0x5598('0x31')](_0x422df7,function(_0x443fc3){if(_0x443fc3['type']!==_0x5598('0x42')){var _0x45b358={};_0x45b358[_0x443fc3[_0x5598('0x2f')]]={'$like':'%'+_0x45f5ed['query'][_0x5598('0x43')]+'%'};return _0x45b358;}})});}_0x4180e3=_['merge']({},_0x4180e3,_0x45f5ed['options']);var _0x2939cc={'where':_0x4180e3[_0x5598('0x41')]};return db[_0x5598('0x32')][_0x5598('0x23')](_0x2939cc)[_0x5598('0x2a')](function(_0x31bacf){_0x39a2c8[_0x5598('0x23')]=_0x31bacf;if(_0x45f5ed[_0x5598('0x36')]['includeAll']){_0x4180e3[_0x5598('0x44')]=[{'all':!![]}];}return db[_0x5598('0x32')][_0x5598('0x45')](_0x4180e3);})[_0x5598('0x2a')](function(_0x232b75){_0x39a2c8[_0x5598('0x46')]=_0x232b75;return _0x39a2c8;})[_0x5598('0x2a')](respondWithFilteredResult(_0x23db64,_0x4180e3))[_0x5598('0x47')](handleError(_0x23db64,null));};exports[_0x5598('0x48')]=function(_0x988a78,_0x1e6c09){var _0x2a1d3c={'raw':!![],'where':{'id':_0x988a78[_0x5598('0x49')]['id']}},_0x3ec70b={};_0x3ec70b[_0x5598('0x35')]=_[_0x5598('0x4a')](db[_0x5598('0x32')][_0x5598('0x33')]);_0x3ec70b[_0x5598('0x36')]=_[_0x5598('0x4a')](_0x988a78[_0x5598('0x36')]);_0x3ec70b[_0x5598('0x3f')]=_['intersection'](_0x3ec70b[_0x5598('0x35')],_0x3ec70b['query']);_0x2a1d3c[_0x5598('0x39')]=_[_0x5598('0x37')](_0x3ec70b[_0x5598('0x35')],qs[_0x5598('0x38')](_0x988a78['query']['fields']));_0x2a1d3c['attributes']=_0x2a1d3c[_0x5598('0x39')]['length']?_0x2a1d3c[_0x5598('0x39')]:_0x3ec70b[_0x5598('0x35')];if(_0x988a78[_0x5598('0x36')][_0x5598('0x4b')]){_0x2a1d3c[_0x5598('0x44')]=[{'all':!![]}];}_0x2a1d3c=_[_0x5598('0x40')]({},_0x2a1d3c,_0x988a78[_0x5598('0x4c')]);return db[_0x5598('0x32')][_0x5598('0x4d')](_0x2a1d3c)[_0x5598('0x2a')](handleEntityNotFound(_0x1e6c09,null))[_0x5598('0x2a')](respondWithResult(_0x1e6c09,null))[_0x5598('0x47')](handleError(_0x1e6c09,null));};exports[_0x5598('0x4e')]=function(_0x5f38fd,_0x569539){return db[_0x5598('0x32')][_0x5598('0x4e')](_0x5f38fd[_0x5598('0x4f')],{})[_0x5598('0x2a')](function(_0xc8eaca){var _0x48731d=_0x5f38fd[_0x5598('0x50')][_0x5598('0x2b')]({'plain':!![]});if(!_0x48731d)throw new Error(_0x5598('0x51'));if(_0x48731d[_0x5598('0x52')]==='user'){var _0x5b3769=_0xc8eaca['get']({'plain':!![]});var _0x2c9a1b='OpenchannelQueues';return db[_0x5598('0x53')][_0x5598('0x4d')]({'where':{'name':_0x2c9a1b,'userProfileId':_0x48731d[_0x5598('0x54')]},'raw':!![]})['then'](function(_0x2f4c16){if(_0x2f4c16&&_0x2f4c16[_0x5598('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b3769[_0x5598('0x2f')],'resourceId':_0x5b3769['id'],'type':_0x2f4c16[_0x5598('0x2f')],'sectionId':_0x2f4c16['id']},{})[_0x5598('0x2a')](function(){return _0xc8eaca;});}else{return _0xc8eaca;}})[_0x5598('0x47')](function(_0x5ed893){logger[_0x5598('0x2d')](_0x5598('0x56'),_0x5ed893);throw _0x5ed893;});}return _0xc8eaca;})[_0x5598('0x2a')](respondWithResult(_0x569539,0xc9))[_0x5598('0x47')](handleError(_0x569539,null));};exports[_0x5598('0x29')]=function(_0x39a817,_0x291187){if(_0x39a817[_0x5598('0x4f')]['id']){delete _0x39a817[_0x5598('0x4f')]['id'];}return db['OpenchannelQueue'][_0x5598('0x4d')]({'where':{'id':_0x39a817[_0x5598('0x49')]['id']}})[_0x5598('0x2a')](handleEntityNotFound(_0x291187,null))['then'](saveUpdates(_0x39a817['body'],null))[_0x5598('0x2a')](respondWithResult(_0x291187,null))[_0x5598('0x47')](handleError(_0x291187,null));};exports['destroy']=function(_0x42efa6,_0x29a675){return db[_0x5598('0x32')][_0x5598('0x4d')]({'where':{'id':_0x42efa6[_0x5598('0x49')]['id']}})['then'](handleEntityNotFound(_0x29a675,null))[_0x5598('0x2a')](removeEntity(_0x29a675,null))[_0x5598('0x47')](handleError(_0x29a675,null));};exports[_0x5598('0x57')]=function(_0x2ccde2,_0x37e36e){return db['OpenchannelQueue'][_0x5598('0x57')]()[_0x5598('0x2a')](respondWithResult(_0x37e36e,null))[_0x5598('0x47')](handleError(_0x37e36e,null));};exports[_0x5598('0x58')]=function(_0x2ce9ab,_0x53c443,_0x3951c3){var _0x1ceba9={'raw':!![],'where':{}},_0x2a21de={},_0x5c295f;return db[_0x5598('0x32')][_0x5598('0x59')]({'where':{'id':_0x2ce9ab[_0x5598('0x49')]['id']}})[_0x5598('0x2a')](handleEntityNotFound(_0x53c443,null))['then'](function(_0x1f3701){if(_0x1f3701){_0x5c295f=_0x1f3701[_0x5598('0x2b')]({'plain':!![]});_0x2a21de[_0x5598('0x35')]=_[_0x5598('0x4a')](db[_0x5598('0x5a')][_0x5598('0x33')]);_0x2a21de['query']=_[_0x5598('0x4a')](_0x2ce9ab[_0x5598('0x36')]);_0x2a21de[_0x5598('0x3f')]=_[_0x5598('0x37')](_0x2a21de[_0x5598('0x35')],_0x2a21de['query']);_0x1ceba9[_0x5598('0x39')]=_[_0x5598('0x37')](_0x2a21de[_0x5598('0x35')],qs[_0x5598('0x38')](_0x2ce9ab[_0x5598('0x36')][_0x5598('0x38')]));_0x1ceba9[_0x5598('0x39')]=_0x1ceba9[_0x5598('0x39')][_0x5598('0x3a')]?_0x1ceba9[_0x5598('0x39')]:_0x2a21de[_0x5598('0x35')];if(!_0x2ce9ab[_0x5598('0x36')][_0x5598('0x3b')](_0x5598('0x3c'))){_0x1ceba9['limit']=qs[_0x5598('0x21')](_0x2ce9ab[_0x5598('0x36')][_0x5598('0x21')]);_0x1ceba9[_0x5598('0x20')]=qs[_0x5598('0x20')](_0x2ce9ab['query'][_0x5598('0x20')]);}_0x1ceba9[_0x5598('0x5b')]=qs[_0x5598('0x3d')](_0x2ce9ab['query'][_0x5598('0x3d')]);_0x1ceba9[_0x5598('0x41')]=qs[_0x5598('0x3f')](_[_0x5598('0x3e')](_0x2ce9ab['query'],_0x2a21de['filters']));_0x1ceba9[_0x5598('0x41')]['OpenchannelQueueId']=_0x1f3701['id'];if(_0x2ce9ab[_0x5598('0x36')][_0x5598('0x43')]){_0x1ceba9[_0x5598('0x41')]=_[_0x5598('0x40')](_0x1ceba9['where'],{'$or':_[_0x5598('0x31')](_0x1ceba9[_0x5598('0x39')],function(_0x2836ef){var _0x4cedfe={};_0x4cedfe[_0x2836ef]={'$like':'%'+_0x2ce9ab[_0x5598('0x36')][_0x5598('0x43')]+'%'};return _0x4cedfe;})});}_0x1ceba9=_['merge']({},_0x1ceba9,_0x2ce9ab[_0x5598('0x4c')]);return db[_0x5598('0x5a')][_0x5598('0x45')](_0x1ceba9);}})[_0x5598('0x2a')](function(_0x372b79){if(_0x372b79){return db[_0x5598('0x5c')][_0x5598('0x5d')]({'where':{'id':_[_0x5598('0x31')](_0x372b79,_0x5598('0x5e')),'role':_0x5598('0x5f')},'attributes':['id',_0x5598('0x2f'),_0x5598('0x60'),_0x5598('0x61'),_0x5598('0x62')]});}})[_0x5598('0x2a')](function(_0x20cd9b){if(_0x20cd9b){return{'count':_0x20cd9b[_0x5598('0x23')],'rows':_['map'](_0x20cd9b[_0x5598('0x46')],function(_0xa240c9){return{'membername':_0xa240c9['name'],'UserId':_0xa240c9['id'],'queue_name':_0x5c295f[_0x5598('0x2f')],'OpenchannelQueueId':_0x5c295f['id'],'interface':util['format']('%s/%s',_0x5598('0x63'),_0xa240c9[_0x5598('0x2f')]),'penalty':0x0,'paused':_0xa240c9[_0x5598('0x60')],'createdAt':_0xa240c9['createdAt'],'updatedAt':_0xa240c9[_0x5598('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5598('0x2a')](respondWithFilteredResult(_0x53c443,_0x1ceba9))[_0x5598('0x47')](handleError(_0x53c443,null));};exports[_0x5598('0x64')]=function(_0x34788d,_0x7c364b,_0x22a98a){var _0x422ea3={};var _0x3b38a3={};var _0x1d067e;var _0x461ba5;return db[_0x5598('0x32')][_0x5598('0x59')]({'where':{'id':_0x34788d['params']['id']}})['then'](handleEntityNotFound(_0x7c364b,null))[_0x5598('0x2a')](function(_0x39de17){if(_0x39de17){_0x1d067e=_0x39de17;_0x3b38a3[_0x5598('0x35')]=_[_0x5598('0x4a')](db[_0x5598('0x65')][_0x5598('0x33')]);_0x3b38a3[_0x5598('0x36')]=_['keys'](_0x34788d[_0x5598('0x36')]);_0x3b38a3['filters']=_['intersection'](_0x3b38a3[_0x5598('0x35')],_0x3b38a3[_0x5598('0x36')]);_0x422ea3[_0x5598('0x39')]=_['intersection'](_0x3b38a3[_0x5598('0x35')],qs[_0x5598('0x38')](_0x34788d[_0x5598('0x36')][_0x5598('0x38')]));_0x422ea3[_0x5598('0x39')]=_0x422ea3[_0x5598('0x39')][_0x5598('0x3a')]?_0x422ea3['attributes']:_0x3b38a3[_0x5598('0x35')];_0x422ea3['order']=qs[_0x5598('0x3d')](_0x34788d[_0x5598('0x36')][_0x5598('0x3d')]);_0x422ea3[_0x5598('0x41')]=qs['filters'](_[_0x5598('0x3e')](_0x34788d['query'],_0x3b38a3[_0x5598('0x3f')]));if(_0x34788d[_0x5598('0x36')][_0x5598('0x43')]){_0x422ea3[_0x5598('0x41')]=_[_0x5598('0x40')](_0x422ea3[_0x5598('0x41')],{'$or':_[_0x5598('0x31')](_0x422ea3[_0x5598('0x39')],function(_0x3a0125){var _0x1ee227={};_0x1ee227[_0x3a0125]={'$like':'%'+_0x34788d['query']['filter']+'%'};return _0x1ee227;})});}_0x422ea3=_[_0x5598('0x40')]({},_0x422ea3,_0x34788d['options']);return _0x1d067e['getTeams'](_0x422ea3);}})[_0x5598('0x2a')](function(_0x21945e){if(_0x21945e){_0x461ba5=_0x21945e['length'];if(!_0x34788d[_0x5598('0x36')][_0x5598('0x3b')](_0x5598('0x3c'))){_0x422ea3[_0x5598('0x21')]=qs['limit'](_0x34788d[_0x5598('0x36')][_0x5598('0x21')]);_0x422ea3['offset']=qs[_0x5598('0x20')](_0x34788d['query'][_0x5598('0x20')]);}return _0x1d067e['getTeams'](_0x422ea3);}})[_0x5598('0x2a')](function(_0x19d868){if(_0x19d868){return _0x19d868?{'count':_0x461ba5,'rows':_0x19d868}:null;}})[_0x5598('0x2a')](respondWithResult(_0x7c364b,null))[_0x5598('0x47')](handleError(_0x7c364b,null));};exports[_0x5598('0x66')]=function(_0xbff9b5,_0x25b6ea,_0x4b1c2f){var _0x9a22f=_0xbff9b5['body'][_0x5598('0x67')];return db['Team'][_0x5598('0x45')]({'where':{'id':_0x9a22f},'attributes':['id'],'include':[{'model':db[_0x5598('0x5c')],'as':_0x5598('0x68'),'attributes':['id',_0x5598('0x2f'),_0x5598('0x69'),'voicePause',_0x5598('0x6a')],'raw':!![]}]})[_0x5598('0x2a')](function(_0x599907){if(_0x599907){var _0x4b971f=_[_0x5598('0x6b')](_0x599907,function(_0x5dd6c7){var _0x3a0d84=_0x5dd6c7[_0x5598('0x2b')]({'plain':!![]});return _0x3a0d84['Agents'];});return db[_0x5598('0x32')]['find']({'where':{'id':_0xbff9b5[_0x5598('0x49')]['id']}})[_0x5598('0x2a')](function(_0x4d5e70){return db[_0x5598('0x6c')][_0x5598('0x6d')](function(_0x5990a7){return _0x4d5e70[_0x5598('0x66')](_0x9a22f,{'transaction':_0x5990a7})[_0x5598('0x2a')](function(){return BPromise[_0x5598('0x6e')](_0x4b971f,function(_0x363655){return db[_0x5598('0x5a')][_0x5598('0x6f')]({'where':{'UserId':_0x363655['id'],'OpenchannelQueueId':_0xbff9b5[_0x5598('0x49')]['id']},'transaction':_0x5990a7});});})[_0x5598('0x2a')](function(){_0x4b971f[_0x5598('0x70')](function(_0x140233){socket[_0x5598('0x71')](_0x5598('0x72'),{'UserId':_0x140233['id'],'OpenchannelQueueId':_0x4d5e70['id']});});});});});}})[_0x5598('0x2a')](respondWithStatusCode(_0x25b6ea,null))[_0x5598('0x47')](handleError(_0x25b6ea,null));};exports[_0x5598('0x73')]=function(_0x3d44da,_0x5bdad8,_0x393ce8){return db[_0x5598('0x65')]['findAll']({'where':{'id':_0x3d44da[_0x5598('0x36')][_0x5598('0x67')]},'attributes':['id'],'include':[{'model':db[_0x5598('0x5c')],'as':_0x5598('0x68'),'attributes':['id'],'raw':!![]}]})[_0x5598('0x2a')](handleEntityNotFound(_0x5bdad8,null))['then'](function(_0x52a34c){var _0x5b8c5c=_[_0x5598('0x31')](_0x52a34c,'id');var _0x56aec3=[];var _0x5837fd=[];var _0x5530b1=squel[_0x5598('0x74')]();_0x5530b1['field'](_0x5598('0x75'))['from'](_0x5598('0x76'),'tq')['join'](_0x5598('0x77'),'ut',_0x5598('0x78'))[_0x5598('0x41')](_0x5598('0x79'),_0x3d44da[_0x5598('0x49')]['id']);for(var _0x307cd0=0x0;_0x307cd0<_0x52a34c[_0x5598('0x3a')];_0x307cd0+=0x1){let _0x5c343c=_0x52a34c[_0x307cd0];for(var _0x5edb0b=0x0;_0x5edb0b<_0x5c343c[_0x5598('0x68')][_0x5598('0x3a')];_0x5edb0b+=0x1){let _0x165227=_0x5c343c[_0x5598('0x68')][_0x5edb0b];var _0x9fe99e=_0x5530b1[_0x5598('0x7a')]();_0x9fe99e[_0x5598('0x41')](_0x5598('0x7b'),_0x165227['id']);_0x5837fd['push'](db[_0x5598('0x6c')]['query'](_0x9fe99e[_0x5598('0x7c')](),{'type':db['sequelize'][_0x5598('0x7d')][_0x5598('0x7e')]})[_0x5598('0x2a')](function(_0x3ce2f9){if(_0x3ce2f9['length']===0x1){return _0x165227['id'];}else{var _0xf500c0=_[_0x5598('0x7f')](_[_0x5598('0x31')](_0x3ce2f9,_0x5598('0x80')),function(_0x309cb1){return _[_0x5598('0x81')](_0x5b8c5c,_0x309cb1);});if(_0xf500c0){return _0x165227['id'];}}}));}}return BPromise['all'](_0x5837fd)[_0x5598('0x2a')](function(_0x153b35){_0x56aec3=_(_0x56aec3)[_0x5598('0x82')](_0x153b35)[_0x5598('0x83')]()[_0x5598('0x84')]();return db['OpenchannelQueue'][_0x5598('0x4d')]({'where':{'id':_0x3d44da[_0x5598('0x49')]['id']}})[_0x5598('0x2a')](function(_0x92c6c5){return db['sequelize'][_0x5598('0x6d')](function(_0x2d023f){return _0x92c6c5[_0x5598('0x73')](_0x3d44da[_0x5598('0x36')][_0x5598('0x67')],{'transaction':_0x2d023f})['then'](function(){if(!_['isEmpty'](_0x56aec3)){return _0x92c6c5[_0x5598('0x85')](_0x56aec3,{'transaction':_0x2d023f});}})['then'](function(){_0x56aec3['forEach'](function(_0x3f85c0){socket[_0x5598('0x71')](_0x5598('0x86'),{'UserId':_0x3f85c0,'OpenchannelQueueId':_0x92c6c5['id']});});});});});});})[_0x5598('0x2a')](respondWithStatusCode(_0x5bdad8,null))[_0x5598('0x47')](handleError(_0x5bdad8,null));};exports[_0x5598('0x87')]=function(_0xa1a2c3,_0xcdf000,_0x2d5efc){return db['OpenchannelQueue'][_0x5598('0x4d')]({'where':{'id':_0xa1a2c3['params']['id']}})[_0x5598('0x2a')](handleEntityNotFound(_0xcdf000,null))[_0x5598('0x2a')](function(_0x2e406f){if(_0x2e406f){return _0x2e406f[_0x5598('0x87')](_0xa1a2c3[_0x5598('0x4f')][_0x5598('0x67')],_[_0x5598('0x88')](_0xa1a2c3[_0x5598('0x4f')],['ids','id'])||{})[_0x5598('0x89')](function(_0x2ddcb4){for(var _0x1dc8d8=0x0;_0x1dc8d8<_0xa1a2c3[_0x5598('0x4f')][_0x5598('0x67')][_0x5598('0x3a')];_0x1dc8d8+=0x1){socket[_0x5598('0x71')](_0x5598('0x72'),{'UserId':Number(_0xa1a2c3['body'][_0x5598('0x67')][_0x1dc8d8]),'OpenchannelQueueId':Number(_0xa1a2c3[_0x5598('0x49')]['id'])});}return _0x2ddcb4;});}})[_0x5598('0x2a')](respondWithResult(_0xcdf000,null))[_0x5598('0x47')](handleError(_0xcdf000,null));};exports[_0x5598('0x85')]=function(_0x4b874c,_0x157e02,_0x8f8681){return db[_0x5598('0x32')][_0x5598('0x4d')]({'where':{'id':_0x4b874c[_0x5598('0x49')]['id']}})[_0x5598('0x2a')](handleEntityNotFound(_0x157e02,null))['then'](function(_0x171683){if(_0x171683){return _0x171683[_0x5598('0x85')](_0x4b874c[_0x5598('0x36')][_0x5598('0x67')])[_0x5598('0x2a')](function(){if(_[_0x5598('0x8a')](_0x4b874c['query']['ids'])){for(var _0x489bf8=0x0;_0x489bf8<_0x4b874c[_0x5598('0x36')]['ids'][_0x5598('0x3a')];_0x489bf8+=0x1){socket[_0x5598('0x71')](_0x5598('0x86'),{'UserId':Number(_0x4b874c['query']['ids'][_0x489bf8]),'OpenchannelQueueId':Number(_0x4b874c[_0x5598('0x49')]['id'])});}}else{socket[_0x5598('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4b874c['query'][_0x5598('0x67')]),'OpenchannelQueueId':Number(_0x4b874c[_0x5598('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x157e02,null))['catch'](handleError(_0x157e02,null));};exports[_0x5598('0x8b')]=function(_0x4ad192,_0x30f31e,_0x52f23b){var _0x53278b={};var _0x5a2b03={};var _0x59e42c;var _0x632e26;return db['OpenchannelQueue'][_0x5598('0x59')]({'where':{'id':_0x4ad192[_0x5598('0x49')]['id']}})[_0x5598('0x2a')](handleEntityNotFound(_0x30f31e,null))[_0x5598('0x2a')](function(_0x270224){if(_0x270224){_0x59e42c=_0x270224;_0x5a2b03[_0x5598('0x35')]=_[_0x5598('0x4a')](db[_0x5598('0x5c')]['rawAttributes']);_0x5a2b03[_0x5598('0x36')]=_[_0x5598('0x4a')](_0x4ad192[_0x5598('0x36')]);_0x5a2b03[_0x5598('0x3f')]=_[_0x5598('0x37')](_0x5a2b03[_0x5598('0x35')],_0x5a2b03[_0x5598('0x36')]);_0x53278b[_0x5598('0x39')]=_['intersection'](_0x5a2b03[_0x5598('0x35')],qs[_0x5598('0x38')](_0x4ad192['query'][_0x5598('0x38')]));_0x53278b[_0x5598('0x39')]=_0x53278b[_0x5598('0x39')][_0x5598('0x3a')]?_0x53278b[_0x5598('0x39')]:_0x5a2b03[_0x5598('0x35')];_0x53278b[_0x5598('0x5b')]=qs[_0x5598('0x3d')](_0x4ad192['query'][_0x5598('0x3d')]);_0x53278b[_0x5598('0x41')]=qs[_0x5598('0x3f')](_['pick'](_0x4ad192[_0x5598('0x36')],_0x5a2b03['filters']));if(_0x4ad192[_0x5598('0x36')][_0x5598('0x43')]){_0x53278b[_0x5598('0x41')]=_[_0x5598('0x40')](_0x53278b[_0x5598('0x41')],{'$or':_['map'](_0x53278b[_0x5598('0x39')],function(_0x78f8c5){var _0x13211f={};_0x13211f[_0x78f8c5]={'$like':'%'+_0x4ad192[_0x5598('0x36')][_0x5598('0x43')]+'%'};return _0x13211f;})});}_0x53278b=_[_0x5598('0x40')]({},_0x53278b,_0x4ad192[_0x5598('0x4c')]);return _0x59e42c['getAgents'](_0x53278b);}})[_0x5598('0x2a')](function(_0x12543b){if(_0x12543b){_0x632e26=_0x12543b['length'];if(!_0x4ad192[_0x5598('0x36')]['hasOwnProperty'](_0x5598('0x3c'))){_0x53278b[_0x5598('0x21')]=qs['limit'](_0x4ad192[_0x5598('0x36')][_0x5598('0x21')]);_0x53278b[_0x5598('0x20')]=qs[_0x5598('0x20')](_0x4ad192['query'][_0x5598('0x20')]);}return _0x59e42c[_0x5598('0x8b')](_0x53278b);}})[_0x5598('0x2a')](function(_0x25e545){if(_0x25e545){return _0x25e545?{'count':_0x632e26,'rows':_0x25e545}:null;}})[_0x5598('0x2a')](respondWithResult(_0x30f31e,null))[_0x5598('0x47')](handleError(_0x30f31e,null));}; \ No newline at end of file +var _0x3b11=['online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','name','send','index','map','OpenchannelQueue','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','hasOwnProperty','pick','findAll','User','agent','openchannelPause','updatedAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0x3b11,0xa5));var _0x13b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b11[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x13b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13b1('0x1'));var jsonpatch=require(_0x13b1('0x2'));var rp=require(_0x13b1('0x3'));var moment=require('moment');var BPromise=require(_0x13b1('0x4'));var Mustache=require(_0x13b1('0x5'));var util=require(_0x13b1('0x6'));var path=require(_0x13b1('0x7'));var sox=require(_0x13b1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13b1('0x9'));var squel=require(_0x13b1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x13b1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x13b1('0xc'));var Papa=require('papaparse');var Redis=require(_0x13b1('0xd'));var authService=require(_0x13b1('0xe'));var qs=require(_0x13b1('0xf'));var as=require(_0x13b1('0x10'));var hardwareService=require(_0x13b1('0x11'));var logger=require('../../config/logger')(_0x13b1('0x12'));var utils=require('../../config/utils');var config=require(_0x13b1('0x13'));var licenseUtil=require(_0x13b1('0x14'));var db=require('../../mysqldb')['db'];config[_0x13b1('0x15')]=_[_0x13b1('0x16')](config['redis'],{'host':_0x13b1('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13b1('0x15')]));require(_0x13b1('0x18'))['register'](socket);function respondWithStatusCode(_0x10c479,_0x5b6b92){_0x5b6b92=_0x5b6b92||0xcc;return function(_0x1f9166){if(_0x1f9166){return _0x10c479[_0x13b1('0x19')](_0x5b6b92);}return _0x10c479[_0x13b1('0x1a')](_0x5b6b92)[_0x13b1('0x1b')]();};}function respondWithResult(_0x186022,_0x429ab0){_0x429ab0=_0x429ab0||0xc8;return function(_0x3f307c){if(_0x3f307c){return _0x186022[_0x13b1('0x1a')](_0x429ab0)[_0x13b1('0x1c')](_0x3f307c);}};}function respondWithFilteredResult(_0x12fd3c,_0x173221){return function(_0x431edd){if(_0x431edd){var _0x3987e1=typeof _0x173221[_0x13b1('0x1d')]===_0x13b1('0x1e')&&typeof _0x173221[_0x13b1('0x1f')]===_0x13b1('0x1e');var _0x541472=_0x431edd['count'];var _0x4078ee=_0x3987e1?0x0:_0x173221[_0x13b1('0x1d')];var _0x53e06e=_0x3987e1?_0x431edd[_0x13b1('0x20')]:_0x173221[_0x13b1('0x1d')]+_0x173221[_0x13b1('0x1f')];var _0x35b5c7;if(_0x53e06e>=_0x541472){_0x53e06e=_0x541472;_0x35b5c7=0xc8;}else{_0x35b5c7=0xce;}_0x12fd3c['status'](_0x35b5c7);return _0x12fd3c[_0x13b1('0x21')](_0x13b1('0x22'),_0x4078ee+'-'+_0x53e06e+'/'+_0x541472)[_0x13b1('0x1c')](_0x431edd);}return null;};}function patchUpdates(_0x329322){return function(_0x551fcf){try{jsonpatch[_0x13b1('0x23')](_0x551fcf,_0x329322,!![]);}catch(_0x2c685c){return BPromise[_0x13b1('0x24')](_0x2c685c);}return _0x551fcf['save']();};}function saveUpdates(_0x20f350,_0x4de1bf){return function(_0x4c8c5b){if(_0x4c8c5b){return _0x4c8c5b['update'](_0x20f350)[_0x13b1('0x25')](function(_0x3cd791){return _0x3cd791;});}return null;};}function removeEntity(_0x38701e,_0x927296){return function(_0x43fae2){if(_0x43fae2){return _0x43fae2[_0x13b1('0x26')]()[_0x13b1('0x25')](function(){var _0x5830b9=_0x43fae2[_0x13b1('0x27')]({'plain':!![]});var _0x52bfb8='OpenchannelQueues';return db[_0x13b1('0x28')][_0x13b1('0x26')]({'where':{'type':_0x52bfb8,'resourceId':_0x5830b9['id']}})[_0x13b1('0x25')](function(){return _0x43fae2;});})[_0x13b1('0x25')](function(){_0x38701e[_0x13b1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10614e,_0xb9d083){return function(_0x58a33a){if(!_0x58a33a){_0x10614e[_0x13b1('0x19')](0x194);}return _0x58a33a;};}function handleError(_0x875bc3,_0x15bfe1){_0x15bfe1=_0x15bfe1||0x1f4;return function(_0x53efca){logger[_0x13b1('0x29')](_0x53efca['stack']);if(_0x53efca[_0x13b1('0x2a')]){delete _0x53efca[_0x13b1('0x2a')];}_0x875bc3['status'](_0x15bfe1)[_0x13b1('0x2b')](_0x53efca);};}exports[_0x13b1('0x2c')]=function(_0x2b146b,_0x47fbbc){var _0x2b4b91={},_0x21c376={},_0x1b70a7={'count':0x0,'rows':[]};var _0x1f90f5=_[_0x13b1('0x2d')](db[_0x13b1('0x2e')]['rawAttributes'],function(_0x44c56e){return{'name':_0x44c56e[_0x13b1('0x2f')],'type':_0x44c56e[_0x13b1('0x30')][_0x13b1('0x31')]};});_0x21c376['model']=_[_0x13b1('0x2d')](_0x1f90f5,_0x13b1('0x2a'));_0x21c376[_0x13b1('0x32')]=_[_0x13b1('0x33')](_0x2b146b[_0x13b1('0x32')]);_0x21c376['filters']=_[_0x13b1('0x34')](_0x21c376['model'],_0x21c376[_0x13b1('0x32')]);_0x2b4b91[_0x13b1('0x35')]=_[_0x13b1('0x34')](_0x21c376[_0x13b1('0x36')],qs[_0x13b1('0x37')](_0x2b146b[_0x13b1('0x32')][_0x13b1('0x37')]));_0x2b4b91[_0x13b1('0x35')]=_0x2b4b91[_0x13b1('0x35')][_0x13b1('0x38')]?_0x2b4b91[_0x13b1('0x35')]:_0x21c376[_0x13b1('0x36')];if(!_0x2b146b[_0x13b1('0x32')]['hasOwnProperty'](_0x13b1('0x39'))){_0x2b4b91['limit']=qs['limit'](_0x2b146b[_0x13b1('0x32')][_0x13b1('0x1f')]);_0x2b4b91[_0x13b1('0x1d')]=qs[_0x13b1('0x1d')](_0x2b146b[_0x13b1('0x32')][_0x13b1('0x1d')]);}_0x2b4b91[_0x13b1('0x3a')]=qs[_0x13b1('0x3b')](_0x2b146b['query']['sort']);_0x2b4b91['where']=qs['filters'](_['pick'](_0x2b146b[_0x13b1('0x32')],_0x21c376[_0x13b1('0x3c')]),_0x1f90f5);if(_0x2b146b[_0x13b1('0x32')]['filter']){_0x2b4b91[_0x13b1('0x3d')]=_[_0x13b1('0x3e')](_0x2b4b91[_0x13b1('0x3d')],{'$or':_[_0x13b1('0x2d')](_0x1f90f5,function(_0x4f5f28){if(_0x4f5f28[_0x13b1('0x30')]!==_0x13b1('0x3f')){var _0x451d50={};_0x451d50[_0x4f5f28[_0x13b1('0x2a')]]={'$like':'%'+_0x2b146b[_0x13b1('0x32')][_0x13b1('0x40')]+'%'};return _0x451d50;}})});}_0x2b4b91=_[_0x13b1('0x3e')]({},_0x2b4b91,_0x2b146b['options']);var _0x1a85ae={'where':_0x2b4b91[_0x13b1('0x3d')]};return db['OpenchannelQueue'][_0x13b1('0x20')](_0x1a85ae)['then'](function(_0x444144){_0x1b70a7[_0x13b1('0x20')]=_0x444144;if(_0x2b146b[_0x13b1('0x32')][_0x13b1('0x41')]){_0x2b4b91[_0x13b1('0x42')]=[{'all':!![]}];}return db[_0x13b1('0x2e')]['findAll'](_0x2b4b91);})[_0x13b1('0x25')](function(_0x54c43e){_0x1b70a7[_0x13b1('0x43')]=_0x54c43e;return _0x1b70a7;})['then'](respondWithFilteredResult(_0x47fbbc,_0x2b4b91))[_0x13b1('0x44')](handleError(_0x47fbbc,null));};exports[_0x13b1('0x45')]=function(_0x442fee,_0x3f3a11){var _0x33429f={'raw':!![],'where':{'id':_0x442fee[_0x13b1('0x46')]['id']}},_0x5911a5={};_0x5911a5[_0x13b1('0x36')]=_['keys'](db['OpenchannelQueue'][_0x13b1('0x47')]);_0x5911a5[_0x13b1('0x32')]=_['keys'](_0x442fee['query']);_0x5911a5[_0x13b1('0x3c')]=_[_0x13b1('0x34')](_0x5911a5[_0x13b1('0x36')],_0x5911a5[_0x13b1('0x32')]);_0x33429f[_0x13b1('0x35')]=_[_0x13b1('0x34')](_0x5911a5[_0x13b1('0x36')],qs[_0x13b1('0x37')](_0x442fee['query'][_0x13b1('0x37')]));_0x33429f[_0x13b1('0x35')]=_0x33429f[_0x13b1('0x35')][_0x13b1('0x38')]?_0x33429f['attributes']:_0x5911a5[_0x13b1('0x36')];if(_0x442fee[_0x13b1('0x32')][_0x13b1('0x41')]){_0x33429f[_0x13b1('0x42')]=[{'all':!![]}];}_0x33429f=_[_0x13b1('0x3e')]({},_0x33429f,_0x442fee[_0x13b1('0x48')]);return db['OpenchannelQueue'][_0x13b1('0x49')](_0x33429f)[_0x13b1('0x25')](handleEntityNotFound(_0x3f3a11,null))[_0x13b1('0x25')](respondWithResult(_0x3f3a11,null))[_0x13b1('0x44')](handleError(_0x3f3a11,null));};exports[_0x13b1('0x4a')]=function(_0x3e9241,_0x1de6d3){return db[_0x13b1('0x2e')][_0x13b1('0x4a')](_0x3e9241['body'],{})['then'](function(_0x501ac7){var _0x2b38c5=_0x3e9241[_0x13b1('0x4b')][_0x13b1('0x27')]({'plain':!![]});if(!_0x2b38c5)throw new Error(_0x13b1('0x4c'));if(_0x2b38c5[_0x13b1('0x4d')]==='user'){var _0x549c7d=_0x501ac7[_0x13b1('0x27')]({'plain':!![]});var _0x21f6ed=_0x13b1('0x4e');return db[_0x13b1('0x4f')][_0x13b1('0x49')]({'where':{'name':_0x21f6ed,'userProfileId':_0x2b38c5[_0x13b1('0x50')]},'raw':!![]})[_0x13b1('0x25')](function(_0x6e489a){if(_0x6e489a&&_0x6e489a[_0x13b1('0x51')]===0x0){return db[_0x13b1('0x28')][_0x13b1('0x4a')]({'name':_0x549c7d[_0x13b1('0x2a')],'resourceId':_0x549c7d['id'],'type':_0x6e489a[_0x13b1('0x2a')],'sectionId':_0x6e489a['id']},{})[_0x13b1('0x25')](function(){return _0x501ac7;});}else{return _0x501ac7;}})['catch'](function(_0x3444be){logger[_0x13b1('0x29')](_0x13b1('0x52'),_0x3444be);throw _0x3444be;});}return _0x501ac7;})['then'](respondWithResult(_0x1de6d3,0xc9))['catch'](handleError(_0x1de6d3,null));};exports['update']=function(_0x4de541,_0xdba219){if(_0x4de541[_0x13b1('0x53')]['id']){delete _0x4de541[_0x13b1('0x53')]['id'];}return db[_0x13b1('0x2e')][_0x13b1('0x49')]({'where':{'id':_0x4de541[_0x13b1('0x46')]['id']}})['then'](handleEntityNotFound(_0xdba219,null))[_0x13b1('0x25')](saveUpdates(_0x4de541['body'],null))[_0x13b1('0x25')](respondWithResult(_0xdba219,null))[_0x13b1('0x44')](handleError(_0xdba219,null));};exports['destroy']=function(_0x46c544,_0x243b48){return db['OpenchannelQueue'][_0x13b1('0x49')]({'where':{'id':_0x46c544['params']['id']}})[_0x13b1('0x25')](handleEntityNotFound(_0x243b48,null))['then'](removeEntity(_0x243b48,null))[_0x13b1('0x44')](handleError(_0x243b48,null));};exports['describe']=function(_0x315ae0,_0x695b0a){return db[_0x13b1('0x2e')]['describe']()['then'](respondWithResult(_0x695b0a,null))[_0x13b1('0x44')](handleError(_0x695b0a,null));};exports[_0x13b1('0x54')]=function(_0x2d5ffb,_0x227f44,_0x45142e){var _0x27e31c={'raw':!![],'where':{}},_0x5f52c0={},_0x3e1432;return db['OpenchannelQueue'][_0x13b1('0x55')]({'where':{'id':_0x2d5ffb[_0x13b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x227f44,null))[_0x13b1('0x25')](function(_0x18c342){if(_0x18c342){_0x3e1432=_0x18c342[_0x13b1('0x27')]({'plain':!![]});_0x5f52c0[_0x13b1('0x36')]=_[_0x13b1('0x33')](db['UserOpenchannelQueue'][_0x13b1('0x47')]);_0x5f52c0[_0x13b1('0x32')]=_[_0x13b1('0x33')](_0x2d5ffb[_0x13b1('0x32')]);_0x5f52c0[_0x13b1('0x3c')]=_[_0x13b1('0x34')](_0x5f52c0[_0x13b1('0x36')],_0x5f52c0['query']);_0x27e31c[_0x13b1('0x35')]=_[_0x13b1('0x34')](_0x5f52c0[_0x13b1('0x36')],qs[_0x13b1('0x37')](_0x2d5ffb[_0x13b1('0x32')][_0x13b1('0x37')]));_0x27e31c[_0x13b1('0x35')]=_0x27e31c[_0x13b1('0x35')]['length']?_0x27e31c[_0x13b1('0x35')]:_0x5f52c0['model'];if(!_0x2d5ffb['query'][_0x13b1('0x56')]('nolimit')){_0x27e31c[_0x13b1('0x1f')]=qs['limit'](_0x2d5ffb[_0x13b1('0x32')][_0x13b1('0x1f')]);_0x27e31c[_0x13b1('0x1d')]=qs[_0x13b1('0x1d')](_0x2d5ffb[_0x13b1('0x32')]['offset']);}_0x27e31c['order']=qs[_0x13b1('0x3b')](_0x2d5ffb[_0x13b1('0x32')][_0x13b1('0x3b')]);_0x27e31c[_0x13b1('0x3d')]=qs['filters'](_[_0x13b1('0x57')](_0x2d5ffb['query'],_0x5f52c0['filters']));_0x27e31c['where']['OpenchannelQueueId']=_0x18c342['id'];if(_0x2d5ffb[_0x13b1('0x32')][_0x13b1('0x40')]){_0x27e31c[_0x13b1('0x3d')]=_[_0x13b1('0x3e')](_0x27e31c[_0x13b1('0x3d')],{'$or':_['map'](_0x27e31c[_0x13b1('0x35')],function(_0x35b5df){var _0x1caaf6={};_0x1caaf6[_0x35b5df]={'$like':'%'+_0x2d5ffb['query']['filter']+'%'};return _0x1caaf6;})});}_0x27e31c=_[_0x13b1('0x3e')]({},_0x27e31c,_0x2d5ffb[_0x13b1('0x48')]);return db['UserOpenchannelQueue'][_0x13b1('0x58')](_0x27e31c);}})[_0x13b1('0x25')](function(_0xbe8f0f){if(_0xbe8f0f){return db[_0x13b1('0x59')]['findAndCountAll']({'where':{'id':_[_0x13b1('0x2d')](_0xbe8f0f,'UserId'),'role':_0x13b1('0x5a')},'attributes':['id',_0x13b1('0x2a'),_0x13b1('0x5b'),_0x13b1('0x5c'),'createdAt']});}})[_0x13b1('0x25')](function(_0x34dfc0){if(_0x34dfc0){return{'count':_0x34dfc0['count'],'rows':_['map'](_0x34dfc0[_0x13b1('0x43')],function(_0x4754a3){return{'membername':_0x4754a3[_0x13b1('0x2a')],'UserId':_0x4754a3['id'],'queue_name':_0x3e1432['name'],'OpenchannelQueueId':_0x3e1432['id'],'interface':util[_0x13b1('0x5d')](_0x13b1('0x5e'),_0x13b1('0x5f'),_0x4754a3[_0x13b1('0x2a')]),'penalty':0x0,'paused':_0x4754a3['openchannelPause'],'createdAt':_0x4754a3['createdAt'],'updatedAt':_0x4754a3[_0x13b1('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x13b1('0x25')](respondWithFilteredResult(_0x227f44,_0x27e31c))['catch'](handleError(_0x227f44,null));};exports['getTeams']=function(_0x179113,_0x41efa4,_0x536c4d){var _0xb760d6={};var _0x373ca6={};var _0x197a08;var _0x219d5d;return db[_0x13b1('0x2e')]['findOne']({'where':{'id':_0x179113[_0x13b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x41efa4,null))[_0x13b1('0x25')](function(_0x5bfb64){if(_0x5bfb64){_0x197a08=_0x5bfb64;_0x373ca6['model']=_['keys'](db[_0x13b1('0x60')][_0x13b1('0x47')]);_0x373ca6[_0x13b1('0x32')]=_['keys'](_0x179113[_0x13b1('0x32')]);_0x373ca6[_0x13b1('0x3c')]=_[_0x13b1('0x34')](_0x373ca6[_0x13b1('0x36')],_0x373ca6['query']);_0xb760d6['attributes']=_[_0x13b1('0x34')](_0x373ca6[_0x13b1('0x36')],qs['fields'](_0x179113[_0x13b1('0x32')][_0x13b1('0x37')]));_0xb760d6[_0x13b1('0x35')]=_0xb760d6[_0x13b1('0x35')][_0x13b1('0x38')]?_0xb760d6['attributes']:_0x373ca6[_0x13b1('0x36')];_0xb760d6[_0x13b1('0x3a')]=qs[_0x13b1('0x3b')](_0x179113['query'][_0x13b1('0x3b')]);_0xb760d6[_0x13b1('0x3d')]=qs[_0x13b1('0x3c')](_[_0x13b1('0x57')](_0x179113[_0x13b1('0x32')],_0x373ca6[_0x13b1('0x3c')]));if(_0x179113['query'][_0x13b1('0x40')]){_0xb760d6[_0x13b1('0x3d')]=_[_0x13b1('0x3e')](_0xb760d6['where'],{'$or':_['map'](_0xb760d6[_0x13b1('0x35')],function(_0x3c11df){var _0x5d9c17={};_0x5d9c17[_0x3c11df]={'$like':'%'+_0x179113[_0x13b1('0x32')][_0x13b1('0x40')]+'%'};return _0x5d9c17;})});}_0xb760d6=_[_0x13b1('0x3e')]({},_0xb760d6,_0x179113[_0x13b1('0x48')]);return _0x197a08[_0x13b1('0x61')](_0xb760d6);}})[_0x13b1('0x25')](function(_0x434896){if(_0x434896){_0x219d5d=_0x434896[_0x13b1('0x38')];if(!_0x179113[_0x13b1('0x32')][_0x13b1('0x56')](_0x13b1('0x39'))){_0xb760d6[_0x13b1('0x1f')]=qs[_0x13b1('0x1f')](_0x179113[_0x13b1('0x32')][_0x13b1('0x1f')]);_0xb760d6[_0x13b1('0x1d')]=qs[_0x13b1('0x1d')](_0x179113['query'][_0x13b1('0x1d')]);}return _0x197a08['getTeams'](_0xb760d6);}})[_0x13b1('0x25')](function(_0x50bd7b){if(_0x50bd7b){return _0x50bd7b?{'count':_0x219d5d,'rows':_0x50bd7b}:null;}})[_0x13b1('0x25')](respondWithResult(_0x41efa4,null))[_0x13b1('0x44')](handleError(_0x41efa4,null));};exports[_0x13b1('0x62')]=function(_0x1d682f,_0xf43692,_0x2d66c3){var _0x1e85fe=_0x1d682f[_0x13b1('0x53')][_0x13b1('0x63')];return db[_0x13b1('0x60')][_0x13b1('0x58')]({'where':{'id':_0x1e85fe},'attributes':['id'],'include':[{'model':db[_0x13b1('0x59')],'as':_0x13b1('0x64'),'attributes':['id',_0x13b1('0x2a'),_0x13b1('0x65'),_0x13b1('0x66'),_0x13b1('0x67')],'raw':!![]}]})[_0x13b1('0x25')](function(_0x5911ab){if(_0x5911ab){var _0x339e5d=_[_0x13b1('0x68')](_0x5911ab,function(_0xa1fef4){var _0x39d635=_0xa1fef4[_0x13b1('0x27')]({'plain':!![]});return _0x39d635[_0x13b1('0x64')];});return db[_0x13b1('0x2e')][_0x13b1('0x49')]({'where':{'id':_0x1d682f[_0x13b1('0x46')]['id']}})['then'](function(_0x220ca5){return db[_0x13b1('0x69')][_0x13b1('0x6a')](function(_0x113ea2){return _0x220ca5[_0x13b1('0x62')](_0x1e85fe,{'transaction':_0x113ea2})[_0x13b1('0x25')](function(){return BPromise['each'](_0x339e5d,function(_0x2c095a){return db['UserOpenchannelQueue'][_0x13b1('0x6b')]({'where':{'UserId':_0x2c095a['id'],'OpenchannelQueueId':_0x1d682f[_0x13b1('0x46')]['id']},'transaction':_0x113ea2});});})['then'](function(){_0x339e5d[_0x13b1('0x6c')](function(_0x4a8060){socket[_0x13b1('0x6d')](_0x13b1('0x6e'),{'UserId':_0x4a8060['id'],'OpenchannelQueueId':_0x220ca5['id']});});});});});}})['then'](respondWithStatusCode(_0xf43692,null))[_0x13b1('0x44')](handleError(_0xf43692,null));};exports[_0x13b1('0x6f')]=function(_0x13a527,_0x3303f1,_0x478405){return db[_0x13b1('0x60')][_0x13b1('0x58')]({'where':{'id':_0x13a527[_0x13b1('0x32')][_0x13b1('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x13b1('0x64'),'attributes':['id'],'raw':!![]}]})[_0x13b1('0x25')](handleEntityNotFound(_0x3303f1,null))['then'](function(_0x3dc0bd){var _0x24d8c7=_[_0x13b1('0x2d')](_0x3dc0bd,'id');var _0x4a2956=[];var _0x43ee4=[];var _0x1d61fe=squel[_0x13b1('0x70')]();_0x1d61fe[_0x13b1('0x71')](_0x13b1('0x72'))[_0x13b1('0x73')]('team_has_openchannel_queues','tq')['join'](_0x13b1('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x13b1('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x13a527[_0x13b1('0x46')]['id']);for(var _0x2cb7e9=0x0;_0x2cb7e9<_0x3dc0bd['length'];_0x2cb7e9+=0x1){let _0x5a30bd=_0x3dc0bd[_0x2cb7e9];for(var _0x333339=0x0;_0x333339<_0x5a30bd[_0x13b1('0x64')]['length'];_0x333339+=0x1){let _0x5ce321=_0x5a30bd['Agents'][_0x333339];var _0x1b8757=_0x1d61fe[_0x13b1('0x75')]();_0x1b8757[_0x13b1('0x3d')](_0x13b1('0x76'),_0x5ce321['id']);_0x43ee4[_0x13b1('0x77')](db[_0x13b1('0x69')][_0x13b1('0x32')](_0x1b8757['toString'](),{'type':db[_0x13b1('0x69')]['QueryTypes'][_0x13b1('0x78')]})['then'](function(_0x5e383d){if(_0x5e383d[_0x13b1('0x38')]===0x1){return _0x5ce321['id'];}else{var _0x1adda3=_[_0x13b1('0x79')](_[_0x13b1('0x2d')](_0x5e383d,_0x13b1('0x7a')),function(_0x4647ae){return _['includes'](_0x24d8c7,_0x4647ae);});if(_0x1adda3){return _0x5ce321['id'];}}}));}}return BPromise['all'](_0x43ee4)[_0x13b1('0x25')](function(_0x3433d9){_0x4a2956=_(_0x4a2956)[_0x13b1('0x7b')](_0x3433d9)[_0x13b1('0x7c')]()[_0x13b1('0x7d')]();return db['OpenchannelQueue'][_0x13b1('0x49')]({'where':{'id':_0x13a527[_0x13b1('0x46')]['id']}})[_0x13b1('0x25')](function(_0x1532be){return db[_0x13b1('0x69')]['transaction'](function(_0x56a524){return _0x1532be[_0x13b1('0x6f')](_0x13a527[_0x13b1('0x32')][_0x13b1('0x63')],{'transaction':_0x56a524})[_0x13b1('0x25')](function(){if(!_['isEmpty'](_0x4a2956)){return _0x1532be[_0x13b1('0x7e')](_0x4a2956,{'transaction':_0x56a524});}})['then'](function(){_0x4a2956[_0x13b1('0x6c')](function(_0xc1ec41){socket[_0x13b1('0x6d')](_0x13b1('0x7f'),{'UserId':_0xc1ec41,'OpenchannelQueueId':_0x1532be['id']});});});});});});})[_0x13b1('0x25')](respondWithStatusCode(_0x3303f1,null))[_0x13b1('0x44')](handleError(_0x3303f1,null));};exports[_0x13b1('0x80')]=function(_0x1ed3eb,_0x5714fb,_0xd82162){return db[_0x13b1('0x2e')]['find']({'where':{'id':_0x1ed3eb[_0x13b1('0x46')]['id']}})[_0x13b1('0x25')](handleEntityNotFound(_0x5714fb,null))[_0x13b1('0x25')](function(_0x5ba71c){if(_0x5ba71c){return _0x5ba71c[_0x13b1('0x80')](_0x1ed3eb['body'][_0x13b1('0x63')],_[_0x13b1('0x81')](_0x1ed3eb['body'],[_0x13b1('0x63'),'id'])||{})[_0x13b1('0x82')](function(_0x12e18b){for(var _0x15d958=0x0;_0x15d958<_0x1ed3eb[_0x13b1('0x53')][_0x13b1('0x63')][_0x13b1('0x38')];_0x15d958+=0x1){socket[_0x13b1('0x6d')](_0x13b1('0x6e'),{'UserId':Number(_0x1ed3eb[_0x13b1('0x53')][_0x13b1('0x63')][_0x15d958]),'OpenchannelQueueId':Number(_0x1ed3eb['params']['id'])});}return _0x12e18b;});}})['then'](respondWithResult(_0x5714fb,null))[_0x13b1('0x44')](handleError(_0x5714fb,null));};exports[_0x13b1('0x7e')]=function(_0x508990,_0x391baa,_0x2dd1b5){return db['OpenchannelQueue'][_0x13b1('0x49')]({'where':{'id':_0x508990[_0x13b1('0x46')]['id']}})[_0x13b1('0x25')](handleEntityNotFound(_0x391baa,null))[_0x13b1('0x25')](function(_0x56bc6d){if(_0x56bc6d){return _0x56bc6d['removeAgents'](_0x508990[_0x13b1('0x32')]['ids'])[_0x13b1('0x25')](function(){if(_[_0x13b1('0x83')](_0x508990[_0x13b1('0x32')][_0x13b1('0x63')])){for(var _0x13b1bd=0x0;_0x13b1bd<_0x508990['query'][_0x13b1('0x63')][_0x13b1('0x38')];_0x13b1bd+=0x1){socket['emit'](_0x13b1('0x7f'),{'UserId':Number(_0x508990[_0x13b1('0x32')][_0x13b1('0x63')][_0x13b1bd]),'OpenchannelQueueId':Number(_0x508990[_0x13b1('0x46')]['id'])});}}else{socket['emit'](_0x13b1('0x7f'),{'UserId':Number(_0x508990[_0x13b1('0x32')][_0x13b1('0x63')]),'OpenchannelQueueId':Number(_0x508990[_0x13b1('0x46')]['id'])});}});}})[_0x13b1('0x25')](respondWithStatusCode(_0x391baa,null))['catch'](handleError(_0x391baa,null));};exports['getAgents']=function(_0x29560b,_0x6e2050,_0x2aee07){var _0x4c966c={};var _0x33715c={};var _0x1fecf5;var _0x687fc9;return db['OpenchannelQueue'][_0x13b1('0x55')]({'where':{'id':_0x29560b[_0x13b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x6e2050,null))[_0x13b1('0x25')](function(_0x48287a){if(_0x48287a){_0x1fecf5=_0x48287a;_0x33715c[_0x13b1('0x36')]=_['keys'](db[_0x13b1('0x59')][_0x13b1('0x47')]);_0x33715c[_0x13b1('0x32')]=_['keys'](_0x29560b[_0x13b1('0x32')]);_0x33715c[_0x13b1('0x3c')]=_['intersection'](_0x33715c[_0x13b1('0x36')],_0x33715c[_0x13b1('0x32')]);_0x4c966c[_0x13b1('0x35')]=_[_0x13b1('0x34')](_0x33715c['model'],qs[_0x13b1('0x37')](_0x29560b[_0x13b1('0x32')][_0x13b1('0x37')]));_0x4c966c['attributes']=_0x4c966c['attributes'][_0x13b1('0x38')]?_0x4c966c[_0x13b1('0x35')]:_0x33715c[_0x13b1('0x36')];_0x4c966c[_0x13b1('0x3a')]=qs['sort'](_0x29560b['query'][_0x13b1('0x3b')]);_0x4c966c[_0x13b1('0x3d')]=qs['filters'](_['pick'](_0x29560b['query'],_0x33715c[_0x13b1('0x3c')]));if(_0x29560b[_0x13b1('0x32')][_0x13b1('0x40')]){_0x4c966c[_0x13b1('0x3d')]=_['merge'](_0x4c966c['where'],{'$or':_[_0x13b1('0x2d')](_0x4c966c[_0x13b1('0x35')],function(_0x570a87){var _0x51ba8d={};_0x51ba8d[_0x570a87]={'$like':'%'+_0x29560b[_0x13b1('0x32')]['filter']+'%'};return _0x51ba8d;})});}_0x4c966c=_[_0x13b1('0x3e')]({},_0x4c966c,_0x29560b[_0x13b1('0x48')]);return _0x1fecf5[_0x13b1('0x84')](_0x4c966c);}})[_0x13b1('0x25')](function(_0x531b96){if(_0x531b96){_0x687fc9=_0x531b96['length'];if(!_0x29560b[_0x13b1('0x32')][_0x13b1('0x56')](_0x13b1('0x39'))){_0x4c966c['limit']=qs[_0x13b1('0x1f')](_0x29560b[_0x13b1('0x32')][_0x13b1('0x1f')]);_0x4c966c[_0x13b1('0x1d')]=qs[_0x13b1('0x1d')](_0x29560b[_0x13b1('0x32')][_0x13b1('0x1d')]);}return _0x1fecf5[_0x13b1('0x84')](_0x4c966c);}})['then'](function(_0x4d841d){if(_0x4d841d){return _0x4d841d?{'count':_0x687fc9,'rows':_0x4d841d}:null;}})[_0x13b1('0x25')](respondWithResult(_0x6e2050,null))[_0x13b1('0x44')](handleError(_0x6e2050,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 26ea015..c85e5f1 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 _0x5dad=['save','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x302ef1,_0x27511c){var _0x47a9d2=function(_0x116bec){while(--_0x116bec){_0x302ef1['push'](_0x302ef1['shift']());}};_0x47a9d2(++_0x27511c);}(_0x5dad,0x9f));var _0xd5da=function(_0x940939,_0xf51b86){_0x940939=_0x940939-0x0;var _0x5b308c=_0x5dad[_0x940939];return _0x5b308c;};'use strict';var EventEmitter=require(_0xd5da('0x0'));var OpenchannelQueue=require(_0xd5da('0x1'))['db'][_0xd5da('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5da('0x3'),'afterUpdate':_0xd5da('0x4'),'afterDestroy':_0xd5da('0x5')};function emitEvent(_0x68974c){return function(_0x11b913,_0x5b9750,_0x5d609c){OpenchannelQueueEvents['emit'](_0x68974c+':'+_0x11b913['id'],_0x11b913);OpenchannelQueueEvents[_0xd5da('0x6')](_0x68974c,_0x11b913);_0x5d609c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xd5da('0x7')](e,emitEvent(event));}}module[_0xd5da('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x02f6=['exports','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5875c7,_0x2a356c){var _0x385d88=function(_0x5d5e96){while(--_0x5d5e96){_0x5875c7['push'](_0x5875c7['shift']());}};_0x385d88(++_0x2a356c);}(_0x02f6,0xac));var _0x602f=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x02f6[_0x101e7b];return _0x4995c0;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x602f('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x602f('0x1')](0x0);var events={'afterCreate':_0x602f('0x2'),'afterUpdate':_0x602f('0x3'),'afterDestroy':_0x602f('0x4')};function emitEvent(_0x3ac346){return function(_0x313db7,_0x2862a8,_0x5a0c80){OpenchannelQueueEvents[_0x602f('0x5')](_0x3ac346+':'+_0x313db7['id'],_0x313db7);OpenchannelQueueEvents[_0x602f('0x5')](_0x3ac346,_0x313db7);_0x5a0c80(null);};}for(var e in events){if(events[_0x602f('0x6')](e)){var event=events[e];OpenchannelQueue[_0x602f('0x7')](e,emitEvent(event));}}module[_0x602f('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 2acf541..faab6d3 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 _0xa85b=['./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xa85b,0xdc));var _0xba85=function(_0xe78d12,_0x5e62ec){_0xe78d12=_0xe78d12-0x0;var _0x3b2363=_0xa85b[_0xe78d12];return _0x3b2363;};'use strict';var _=require(_0xba85('0x0'));var util=require(_0xba85('0x1'));var logger=require(_0xba85('0x2'))(_0xba85('0x3'));var moment=require(_0xba85('0x4'));var BPromise=require('bluebird');var rp=require(_0xba85('0x5'));var fs=require('fs');var path=require(_0xba85('0x6'));var rimraf=require(_0xba85('0x7'));var config=require('../../config/environment');var attributes=require(_0xba85('0x8'));module['exports']=function(_0x4b9b53,_0x215335){return _0x4b9b53[_0xba85('0x9')](_0xba85('0xa'),attributes,{'tableName':_0xba85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fcd=['./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9fcd,0x10e));var _0xd9fc=function(_0x124783,_0x57ab2f){_0x124783=_0x124783-0x0;var _0x1f2230=_0x9fcd[_0x124783];return _0x1f2230;};'use strict';var _=require(_0xd9fc('0x0'));var util=require(_0xd9fc('0x1'));var logger=require(_0xd9fc('0x2'))(_0xd9fc('0x3'));var moment=require(_0xd9fc('0x4'));var BPromise=require(_0xd9fc('0x5'));var rp=require(_0xd9fc('0x6'));var fs=require('fs');var path=require(_0xd9fc('0x7'));var rimraf=require(_0xd9fc('0x8'));var config=require(_0xd9fc('0x9'));var attributes=require(_0xd9fc('0xa'));module[_0xd9fc('0xb')]=function(_0x28c8eb,_0x4d7944){return _0x28c8eb[_0xd9fc('0xc')]('OpenchannelQueue',attributes,{'tableName':_0xd9fc('0xd'),'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 c024c6f..57cb5c9 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 _0x91ad=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','ShowOpenchannelQueue','find','where','util','moment','randomstring'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x91ad,0x1aa));var _0xd91a=function(_0x3fc6e6,_0x5a6c91){_0x3fc6e6=_0x3fc6e6-0x0;var _0x1733e8=_0x91ad[_0x3fc6e6];return _0x1733e8;};'use strict';var _=require('lodash');var util=require(_0xd91a('0x0'));var moment=require(_0xd91a('0x1'));var BPromise=require('bluebird');var rs=require(_0xd91a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd91a('0x3'))('rpc');var config=require(_0xd91a('0x4'));var jayson=require(_0xd91a('0x5'));var client=jayson[_0xd91a('0x6')][_0xd91a('0x7')]({'port':0x232a});config['redis']=_[_0xd91a('0x8')](config[_0xd91a('0x9')],{'host':_0xd91a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd91a('0xb'))[_0xd91a('0xc')](socket);function respondWithRpcPromise(_0x49e439,_0x376bd7,_0x28e572){return new BPromise(function(_0x58613c,_0x3e516c){return client[_0xd91a('0xd')](_0x49e439,_0x28e572)[_0xd91a('0xe')](function(_0x4c419d){logger[_0xd91a('0xf')](_0xd91a('0x10'),_0x376bd7,_0xd91a('0x11'));logger[_0xd91a('0x12')](_0xd91a('0x13'),_0x376bd7,_0xd91a('0x11'),JSON[_0xd91a('0x14')](_0x4c419d));if(_0x4c419d['error']){if(_0x4c419d[_0xd91a('0x15')][_0xd91a('0x16')]===0x1f4){logger[_0xd91a('0x15')](_0xd91a('0x10'),_0x376bd7,_0x4c419d[_0xd91a('0x15')][_0xd91a('0x17')]);return _0x3e516c(_0x4c419d['error'][_0xd91a('0x17')]);}logger[_0xd91a('0x15')](_0xd91a('0x10'),_0x376bd7,_0x4c419d[_0xd91a('0x15')][_0xd91a('0x17')]);return _0x58613c(_0x4c419d[_0xd91a('0x15')][_0xd91a('0x17')]);}else{logger[_0xd91a('0xf')](_0xd91a('0x10'),_0x376bd7,'request\x20sent');_0x58613c(_0x4c419d[_0xd91a('0x18')][_0xd91a('0x17')]);}})[_0xd91a('0x19')](function(_0x143706){logger[_0xd91a('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x376bd7,_0x143706);_0x3e516c(_0x143706);});});}exports[_0xd91a('0x1a')]=function(_0x2a5c3c){var _0x5002a7=this;return new Promise(function(_0x267dad,_0x1a7264){return db[_0xd91a('0x1b')][_0xd91a('0x1c')]({'raw':_0x2a5c3c['options']?_0x2a5c3c[_0xd91a('0x1d')][_0xd91a('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a5c3c[_0xd91a('0x1d')]?_0x2a5c3c[_0xd91a('0x1d')]['where']||null:null,'attributes':_0x2a5c3c[_0xd91a('0x1d')]?_0x2a5c3c['options'][_0xd91a('0x1f')]||null:null,'limit':_0x2a5c3c[_0xd91a('0x1d')]?_0x2a5c3c[_0xd91a('0x1d')][_0xd91a('0x20')]||null:null,'include':_0x2a5c3c['options']?_0x2a5c3c[_0xd91a('0x1d')][_0xd91a('0x21')]?_[_0xd91a('0x22')](_0x2a5c3c[_0xd91a('0x1d')][_0xd91a('0x21')],function(_0x2f0c1e){return{'model':db[_0x2f0c1e['model']],'as':_0x2f0c1e['as'],'attributes':_0x2f0c1e[_0xd91a('0x1f')],'include':_0x2f0c1e[_0xd91a('0x21')]?_[_0xd91a('0x22')](_0x2f0c1e[_0xd91a('0x21')],function(_0x3774ae){return{'model':db[_0x3774ae['model']],'as':_0x3774ae['as'],'attributes':_0x3774ae[_0xd91a('0x1f')],'include':_0x3774ae[_0xd91a('0x21')]?_[_0xd91a('0x22')](_0x3774ae[_0xd91a('0x21')],function(_0x5473f8){return{'model':db[_0x5473f8[_0xd91a('0x23')]],'as':_0x5473f8['as'],'attributes':_0x5473f8[_0xd91a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd91a('0xe')](function(_0xc93d2b){logger[_0xd91a('0xf')](_0xd91a('0x1a'),_0x2a5c3c);logger['debug']('GetOpenchannelQueue',_0x2a5c3c,JSON[_0xd91a('0x14')](_0xc93d2b));_0x267dad(_0xc93d2b);})['catch'](function(_0x42e199){logger[_0xd91a('0x15')]('GetOpenchannelQueue',_0x42e199['message'],_0x2a5c3c);_0x1a7264(_0x5002a7[_0xd91a('0x15')](0x1f4,_0x42e199[_0xd91a('0x17')]));});});};exports[_0xd91a('0x24')]=function(_0x2931db){var _0x3b5abe=this;return new Promise(function(_0x5afa04,_0x592191){return db['OpenchannelQueue'][_0xd91a('0x25')]({'raw':_0x2931db['options']?_0x2931db[_0xd91a('0x1d')][_0xd91a('0x1e')]===undefined?!![]:![]:!![],'where':_0x2931db[_0xd91a('0x1d')]?_0x2931db[_0xd91a('0x1d')][_0xd91a('0x26')]||null:null,'attributes':_0x2931db[_0xd91a('0x1d')]?_0x2931db[_0xd91a('0x1d')]['attributes']||null:null,'include':_0x2931db[_0xd91a('0x1d')]?_0x2931db['options'][_0xd91a('0x21')]?_['map'](_0x2931db['options'][_0xd91a('0x21')],function(_0x5cb313){return{'model':db[_0x5cb313['model']],'as':_0x5cb313['as'],'attributes':_0x5cb313[_0xd91a('0x1f')],'include':_0x5cb313[_0xd91a('0x21')]?_[_0xd91a('0x22')](_0x5cb313[_0xd91a('0x21')],function(_0x5576ed){return{'model':db[_0x5576ed[_0xd91a('0x23')]],'as':_0x5576ed['as'],'attributes':_0x5576ed[_0xd91a('0x1f')],'include':_0x5576ed[_0xd91a('0x21')]?_[_0xd91a('0x22')](_0x5576ed['include'],function(_0x258085){return{'model':db[_0x258085[_0xd91a('0x23')]],'as':_0x258085['as'],'attributes':_0x258085[_0xd91a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd91a('0xe')](function(_0x5a47fa){logger['info']('ShowOpenchannelQueue',_0x2931db);logger['debug'](_0xd91a('0x24'),_0x2931db,JSON['stringify'](_0x5a47fa));_0x5afa04(_0x5a47fa);})[_0xd91a('0x19')](function(_0x285642){logger[_0xd91a('0x15')](_0xd91a('0x24'),_0x285642['message'],_0x2931db);_0x592191(_0x3b5abe[_0xd91a('0x15')](0x1f4,_0x285642['message']));});});}; \ No newline at end of file +var _0x0e09=['catch','findAll','options','raw','where','attributes','include','map','model','then','debug','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x39c0ea,_0x169bff){var _0x34e5f2=function(_0x592ab6){while(--_0x592ab6){_0x39c0ea['push'](_0x39c0ea['shift']());}};_0x34e5f2(++_0x169bff);}(_0x0e09,0xac));var _0x90e0=function(_0xe73bcb,_0x3308a4){_0xe73bcb=_0xe73bcb-0x0;var _0x331e57=_0x0e09[_0xe73bcb];return _0x331e57;};'use strict';var _=require(_0x90e0('0x0'));var util=require(_0x90e0('0x1'));var moment=require(_0x90e0('0x2'));var BPromise=require(_0x90e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90e0('0x4'));var db=require(_0x90e0('0x5'))['db'];var utils=require(_0x90e0('0x6'));var logger=require(_0x90e0('0x7'))(_0x90e0('0x8'));var config=require(_0x90e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x90e0('0xa')](config[_0x90e0('0xb')],{'host':_0x90e0('0xc'),'port':0x18eb});var socket=require(_0x90e0('0xd'))(new Redis(config[_0x90e0('0xb')]));require('./openchannelQueue.socket')[_0x90e0('0xe')](socket);function respondWithRpcPromise(_0x4b412d,_0x2ae242,_0x4f2022){return new BPromise(function(_0x462082,_0x52099e){return client[_0x90e0('0xf')](_0x4b412d,_0x4f2022)['then'](function(_0x28e967){logger[_0x90e0('0x10')](_0x90e0('0x11'),_0x2ae242,_0x90e0('0x12'));logger['debug'](_0x90e0('0x13'),_0x2ae242,_0x90e0('0x12'),JSON['stringify'](_0x28e967));if(_0x28e967['error']){if(_0x28e967[_0x90e0('0x14')]['code']===0x1f4){logger['error'](_0x90e0('0x11'),_0x2ae242,_0x28e967[_0x90e0('0x14')]['message']);return _0x52099e(_0x28e967[_0x90e0('0x14')][_0x90e0('0x15')]);}logger[_0x90e0('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x2ae242,_0x28e967[_0x90e0('0x14')][_0x90e0('0x15')]);return _0x462082(_0x28e967[_0x90e0('0x14')][_0x90e0('0x15')]);}else{logger[_0x90e0('0x10')](_0x90e0('0x11'),_0x2ae242,_0x90e0('0x12'));_0x462082(_0x28e967[_0x90e0('0x16')][_0x90e0('0x15')]);}})[_0x90e0('0x17')](function(_0x3c4f0e){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2ae242,_0x3c4f0e);_0x52099e(_0x3c4f0e);});});}exports['GetOpenchannelQueue']=function(_0x3d2def){var _0x1c799b=this;return new Promise(function(_0x3bf366,_0x4f0f2e){return db['OpenchannelQueue'][_0x90e0('0x18')]({'raw':_0x3d2def[_0x90e0('0x19')]?_0x3d2def[_0x90e0('0x19')][_0x90e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d2def[_0x90e0('0x19')]?_0x3d2def[_0x90e0('0x19')][_0x90e0('0x1b')]||null:null,'attributes':_0x3d2def[_0x90e0('0x19')]?_0x3d2def['options'][_0x90e0('0x1c')]||null:null,'limit':_0x3d2def['options']?_0x3d2def['options']['limit']||null:null,'include':_0x3d2def[_0x90e0('0x19')]?_0x3d2def[_0x90e0('0x19')][_0x90e0('0x1d')]?_[_0x90e0('0x1e')](_0x3d2def[_0x90e0('0x19')]['include'],function(_0x3d5cfb){return{'model':db[_0x3d5cfb[_0x90e0('0x1f')]],'as':_0x3d5cfb['as'],'attributes':_0x3d5cfb[_0x90e0('0x1c')],'include':_0x3d5cfb[_0x90e0('0x1d')]?_[_0x90e0('0x1e')](_0x3d5cfb['include'],function(_0x2ac4fb){return{'model':db[_0x2ac4fb[_0x90e0('0x1f')]],'as':_0x2ac4fb['as'],'attributes':_0x2ac4fb[_0x90e0('0x1c')],'include':_0x2ac4fb[_0x90e0('0x1d')]?_[_0x90e0('0x1e')](_0x2ac4fb[_0x90e0('0x1d')],function(_0x2c4590){return{'model':db[_0x2c4590[_0x90e0('0x1f')]],'as':_0x2c4590['as'],'attributes':_0x2c4590[_0x90e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90e0('0x20')](function(_0x18b0a6){logger['info']('GetOpenchannelQueue',_0x3d2def);logger[_0x90e0('0x21')](_0x90e0('0x22'),_0x3d2def,JSON[_0x90e0('0x23')](_0x18b0a6));_0x3bf366(_0x18b0a6);})[_0x90e0('0x17')](function(_0x1171e0){logger[_0x90e0('0x14')](_0x90e0('0x22'),_0x1171e0[_0x90e0('0x15')],_0x3d2def);_0x4f0f2e(_0x1c799b[_0x90e0('0x14')](0x1f4,_0x1171e0['message']));});});};exports[_0x90e0('0x24')]=function(_0x5143d5){var _0x1b95c6=this;return new Promise(function(_0xfeba44,_0x9a2fc9){return db[_0x90e0('0x25')][_0x90e0('0x26')]({'raw':_0x5143d5[_0x90e0('0x19')]?_0x5143d5[_0x90e0('0x19')][_0x90e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5143d5[_0x90e0('0x19')]?_0x5143d5[_0x90e0('0x19')][_0x90e0('0x1b')]||null:null,'attributes':_0x5143d5[_0x90e0('0x19')]?_0x5143d5[_0x90e0('0x19')][_0x90e0('0x1c')]||null:null,'include':_0x5143d5[_0x90e0('0x19')]?_0x5143d5['options'][_0x90e0('0x1d')]?_['map'](_0x5143d5[_0x90e0('0x19')]['include'],function(_0x42de58){return{'model':db[_0x42de58[_0x90e0('0x1f')]],'as':_0x42de58['as'],'attributes':_0x42de58[_0x90e0('0x1c')],'include':_0x42de58[_0x90e0('0x1d')]?_[_0x90e0('0x1e')](_0x42de58[_0x90e0('0x1d')],function(_0x177f26){return{'model':db[_0x177f26[_0x90e0('0x1f')]],'as':_0x177f26['as'],'attributes':_0x177f26[_0x90e0('0x1c')],'include':_0x177f26['include']?_[_0x90e0('0x1e')](_0x177f26['include'],function(_0x24d1fc){return{'model':db[_0x24d1fc['model']],'as':_0x24d1fc['as'],'attributes':_0x24d1fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x90e0('0x20')](function(_0x3713ee){logger[_0x90e0('0x10')](_0x90e0('0x24'),_0x5143d5);logger[_0x90e0('0x21')](_0x90e0('0x24'),_0x5143d5,JSON[_0x90e0('0x23')](_0x3713ee));_0xfeba44(_0x3713ee);})[_0x90e0('0x17')](function(_0x226f45){logger[_0x90e0('0x14')]('ShowOpenchannelQueue',_0x226f45[_0x90e0('0x15')],_0x5143d5);_0x9a2fc9(_0x1b95c6[_0x90e0('0x14')](0x1f4,_0x226f45[_0x90e0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index db8307c..ef0a154 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 _0xab14=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x5cf99f,_0x450e05){var _0xeedf3a=function(_0x21f600){while(--_0x21f600){_0x5cf99f['push'](_0x5cf99f['shift']());}};_0xeedf3a(++_0x450e05);}(_0xab14,0x1bc));var _0x4ab1=function(_0x10fa79,_0x874362){_0x10fa79=_0x10fa79-0x0;var _0x35306e=_0xab14[_0x10fa79];return _0x35306e;};'use strict';var OpenchannelQueueEvents=require(_0x4ab1('0x0'));var events=[_0x4ab1('0x1'),_0x4ab1('0x2'),_0x4ab1('0x3')];function createListener(_0x5c273c,_0x4e7e2b){return function(_0x1e369b){_0x4e7e2b[_0x4ab1('0x4')](_0x5c273c,_0x1e369b);};}function removeListener(_0x5f09a9,_0x396302){return function(){OpenchannelQueueEvents[_0x4ab1('0x5')](_0x5f09a9,_0x396302);};}exports[_0x4ab1('0x6')]=function(_0x12ca56){for(var _0x116440=0x0,_0x480c83=events[_0x4ab1('0x7')];_0x116440<_0x480c83;_0x116440++){var _0x39d9ba=events[_0x116440];var _0xd6a509=createListener(_0x4ab1('0x8')+_0x39d9ba,_0x12ca56);OpenchannelQueueEvents['on'](_0x39d9ba,_0xd6a509);}}; \ No newline at end of file +var _0xa97c=['update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0xa97c,0xb6));var _0xca97=function(_0x11a741,_0x2b1699){_0x11a741=_0x11a741-0x0;var _0x4e43e3=_0xa97c[_0x11a741];return _0x4e43e3;};'use strict';var OpenchannelQueueEvents=require(_0xca97('0x0'));var events=[_0xca97('0x1'),'remove',_0xca97('0x2')];function createListener(_0x4090fd,_0xa702da){return function(_0x1a38bb){_0xa702da[_0xca97('0x3')](_0x4090fd,_0x1a38bb);};}function removeListener(_0x1d237d,_0x591749){return function(){OpenchannelQueueEvents[_0xca97('0x4')](_0x1d237d,_0x591749);};}exports[_0xca97('0x5')]=function(_0x4b556c){for(var _0xa61022=0x0,_0x1b6949=events[_0xca97('0x6')];_0xa61022<_0x1b6949;_0xa61022++){var _0x258fae=events[_0xa61022];var _0x1caf1c=createListener(_0xca97('0x7')+_0x258fae,_0x4b556c);OpenchannelQueueEvents['on'](_0x258fae,_0x1caf1c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 96d8d5a..a15eb71 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 _0x6793=['isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0x6793,0x1ec));var _0x3679=function(_0x32b20c,_0x138680){_0x32b20c=_0x32b20c-0x0;var _0x4b87eb=_0x6793[_0x32b20c];return _0x4b87eb;};'use strict';var multer=require(_0x3679('0x0'));var util=require('util');var path=require(_0x3679('0x1'));var timeout=require(_0x3679('0x2'));var express=require('express');var router=express[_0x3679('0x3')]();var fs_extra=require(_0x3679('0x4'));var auth=require(_0x3679('0x5'));var interaction=require(_0x3679('0x6'));var config=require(_0x3679('0x7'));var controller=require(_0x3679('0x8'));router[_0x3679('0x9')]('/',auth['isAuthenticated'](),controller[_0x3679('0xa')]);router['get'](_0x3679('0xb'),auth[_0x3679('0xc')](),controller[_0x3679('0xd')]);router['get'](_0x3679('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3679('0xf')]('/',auth[_0x3679('0xc')](),controller[_0x3679('0x10')]);router[_0x3679('0x11')](_0x3679('0xe'),auth[_0x3679('0xc')](),controller[_0x3679('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3679('0x13')]);module[_0x3679('0x14')]=router; \ No newline at end of file +var _0x61ce=['get','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index'];(function(_0x477f1a,_0x4999d3){var _0x1cf352=function(_0x1253ce){while(--_0x1253ce){_0x477f1a['push'](_0x477f1a['shift']());}};_0x1cf352(++_0x4999d3);}(_0x61ce,0xdc));var _0xe61c=function(_0x4348b8,_0x1bcced){_0x4348b8=_0x4348b8-0x0;var _0x3d12d=_0x61ce[_0x4348b8];return _0x3d12d;};'use strict';var multer=require(_0xe61c('0x0'));var util=require(_0xe61c('0x1'));var path=require(_0xe61c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe61c('0x3'));var router=express[_0xe61c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe61c('0x5'));var interaction=require(_0xe61c('0x6'));var config=require(_0xe61c('0x7'));var controller=require(_0xe61c('0x8'));router['get']('/',auth[_0xe61c('0x9')](),controller[_0xe61c('0xa')]);router[_0xe61c('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xe61c('0xc')]);router[_0xe61c('0xb')](_0xe61c('0xd'),auth[_0xe61c('0x9')](),controller[_0xe61c('0xe')]);router[_0xe61c('0xf')]('/',auth[_0xe61c('0x9')](),controller[_0xe61c('0x10')]);router[_0xe61c('0x11')](_0xe61c('0xd'),auth[_0xe61c('0x9')](),controller[_0xe61c('0x12')]);router['delete'](_0xe61c('0xd'),auth['isAuthenticated'](),controller[_0xe61c('0x13')]);module[_0xe61c('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 1e118e5..dd9a630 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 _0x3c0c=['moment','exports','STRING','DATE'];(function(_0x4ba1ce,_0x3cb38d){var _0x2dda46=function(_0x3a33bb){while(--_0x3a33bb){_0x4ba1ce['push'](_0x4ba1ce['shift']());}};_0x2dda46(++_0x3cb38d);}(_0x3c0c,0x94));var _0xc3c0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3c0c[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0xc3c0('0x0'));var Sequelize=require('sequelize');module[_0xc3c0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc3c0('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc3c0('0x3')]},'acceptAt':{'type':Sequelize[_0xc3c0('0x3')]},'exitAt':{'type':Sequelize[_0xc3c0('0x3')]},'reason':{'type':Sequelize[_0xc3c0('0x2')]}}; \ No newline at end of file +var _0x528f=['sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x528f,0x140));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xf528('0x0'));module[_0xf528('0x1')]={'uniqueid':{'type':Sequelize[_0xf528('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf528('0x2')]},'joinAt':{'type':Sequelize[_0xf528('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf528('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index f536bce..2b81ca6 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 _0x95cd=['rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','map','VIRTUAL','filter','OpenchannelQueueReport','then','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','stack','name','send','index'];(function(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0x95cd,0x17f));var _0xd95c=function(_0x4f752e,_0x1c9e98){_0x4f752e=_0x4f752e-0x0;var _0xe0bfd6=_0x95cd[_0x4f752e];return _0xe0bfd6;};'use strict';var emlformat=require(_0xd95c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd95c('0x1'));var rp=require(_0xd95c('0x2'));var moment=require('moment');var BPromise=require(_0xd95c('0x3'));var Mustache=require(_0xd95c('0x4'));var util=require(_0xd95c('0x5'));var path=require('path');var sox=require(_0xd95c('0x6'));var csv=require('to-csv');var ejs=require(_0xd95c('0x7'));var fs=require('fs');var fs_extra=require(_0xd95c('0x8'));var _=require(_0xd95c('0x9'));var squel=require(_0xd95c('0xa'));var crypto=require(_0xd95c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd95c('0xc'));var Papa=require('papaparse');var Redis=require(_0xd95c('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd95c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd95c('0xf'))(_0xd95c('0x10'));var utils=require(_0xd95c('0x11'));var config=require(_0xd95c('0x12'));var licenseUtil=require(_0xd95c('0x13'));var db=require(_0xd95c('0x14'))['db'];function respondWithStatusCode(_0x50a49e,_0x429b0e){_0x429b0e=_0x429b0e||0xcc;return function(_0x25fa81){if(_0x25fa81){return _0x50a49e[_0xd95c('0x15')](_0x429b0e);}return _0x50a49e[_0xd95c('0x16')](_0x429b0e)[_0xd95c('0x17')]();};}function respondWithResult(_0x57804c,_0x4c0a55){_0x4c0a55=_0x4c0a55||0xc8;return function(_0x11976a){if(_0x11976a){return _0x57804c['status'](_0x4c0a55)['json'](_0x11976a);}};}function respondWithFilteredResult(_0x5c6dcd,_0x4b2bf9){return function(_0x3fa8fd){if(_0x3fa8fd){var _0x244254=typeof _0x4b2bf9[_0xd95c('0x18')]===_0xd95c('0x19')&&typeof _0x4b2bf9['limit']==='undefined';var _0x21b760=_0x3fa8fd[_0xd95c('0x1a')];var _0x37591a=_0x244254?0x0:_0x4b2bf9[_0xd95c('0x18')];var _0x3d8436=_0x244254?_0x3fa8fd[_0xd95c('0x1a')]:_0x4b2bf9[_0xd95c('0x18')]+_0x4b2bf9[_0xd95c('0x1b')];var _0x59ecc3;if(_0x3d8436>=_0x21b760){_0x3d8436=_0x21b760;_0x59ecc3=0xc8;}else{_0x59ecc3=0xce;}_0x5c6dcd[_0xd95c('0x16')](_0x59ecc3);return _0x5c6dcd[_0xd95c('0x1c')](_0xd95c('0x1d'),_0x37591a+'-'+_0x3d8436+'/'+_0x21b760)[_0xd95c('0x1e')](_0x3fa8fd);}return null;};}function patchUpdates(_0x4a4dc6){return function(_0x124b8f){try{jsonpatch[_0xd95c('0x1f')](_0x124b8f,_0x4a4dc6,!![]);}catch(_0x59b8bb){return BPromise['reject'](_0x59b8bb);}return _0x124b8f[_0xd95c('0x20')]();};}function saveUpdates(_0x4d423f,_0x398503){return function(_0x113371){if(_0x113371){return _0x113371['update'](_0x4d423f)['then'](function(_0x1e2f8e){return _0x1e2f8e;});}return null;};}function removeEntity(_0x20a8ad,_0x5f555f){return function(_0x4671fe){if(_0x4671fe){return _0x4671fe['destroy']()['then'](function(){_0x20a8ad['status'](0xcc)[_0xd95c('0x17')]();});}};}function handleEntityNotFound(_0x470718,_0x447378){return function(_0x4dd28e){if(!_0x4dd28e){_0x470718['sendStatus'](0x194);}return _0x4dd28e;};}function handleError(_0x1b0f30,_0x3ac9fb){_0x3ac9fb=_0x3ac9fb||0x1f4;return function(_0x2bcd77){logger['error'](_0x2bcd77[_0xd95c('0x21')]);if(_0x2bcd77[_0xd95c('0x22')]){delete _0x2bcd77[_0xd95c('0x22')];}_0x1b0f30[_0xd95c('0x16')](_0x3ac9fb)[_0xd95c('0x23')](_0x2bcd77);};}exports[_0xd95c('0x24')]=function(_0x21546a,_0x36acd3){var _0x26ebd7={},_0x100060={},_0x417003={'count':0x0,'rows':[]};var _0x4dd5da=_['map'](db['OpenchannelQueueReport'][_0xd95c('0x25')],function(_0x4a9f25){return{'name':_0x4a9f25[_0xd95c('0x26')],'type':_0x4a9f25[_0xd95c('0x27')][_0xd95c('0x28')]};});_0x100060['model']=_['map'](_0x4dd5da,_0xd95c('0x22'));_0x100060[_0xd95c('0x29')]=_['keys'](_0x21546a[_0xd95c('0x29')]);_0x100060[_0xd95c('0x2a')]=_[_0xd95c('0x2b')](_0x100060[_0xd95c('0x2c')],_0x100060['query']);_0x26ebd7['attributes']=_['intersection'](_0x100060[_0xd95c('0x2c')],qs[_0xd95c('0x2d')](_0x21546a[_0xd95c('0x29')]['fields']));_0x26ebd7[_0xd95c('0x2e')]=_0x26ebd7['attributes'][_0xd95c('0x2f')]?_0x26ebd7[_0xd95c('0x2e')]:_0x100060['model'];if(!_0x21546a[_0xd95c('0x29')][_0xd95c('0x30')]('nolimit')){_0x26ebd7[_0xd95c('0x1b')]=qs[_0xd95c('0x1b')](_0x21546a[_0xd95c('0x29')][_0xd95c('0x1b')]);_0x26ebd7[_0xd95c('0x18')]=qs[_0xd95c('0x18')](_0x21546a['query'][_0xd95c('0x18')]);}_0x26ebd7[_0xd95c('0x31')]=qs['sort'](_0x21546a[_0xd95c('0x29')][_0xd95c('0x32')]);_0x26ebd7['where']=qs['filters'](_[_0xd95c('0x33')](_0x21546a[_0xd95c('0x29')],_0x100060['filters']),_0x4dd5da);if(_0x21546a[_0xd95c('0x29')]['filter']){_0x26ebd7[_0xd95c('0x34')]=_[_0xd95c('0x35')](_0x26ebd7[_0xd95c('0x34')],{'$or':_[_0xd95c('0x36')](_0x4dd5da,function(_0x4ad075){if(_0x4ad075['type']!==_0xd95c('0x37')){var _0x341c27={};_0x341c27[_0x4ad075[_0xd95c('0x22')]]={'$like':'%'+_0x21546a[_0xd95c('0x29')][_0xd95c('0x38')]+'%'};return _0x341c27;}})});}_0x26ebd7=_[_0xd95c('0x35')]({},_0x26ebd7,_0x21546a['options']);var _0x35050e={'where':_0x26ebd7[_0xd95c('0x34')]};return db[_0xd95c('0x39')][_0xd95c('0x1a')](_0x35050e)[_0xd95c('0x3a')](function(_0x528848){_0x417003[_0xd95c('0x1a')]=_0x528848;if(_0x21546a['query'][_0xd95c('0x3b')]){_0x26ebd7[_0xd95c('0x3c')]=[{'all':!![]}];}return db[_0xd95c('0x39')]['findAll'](_0x26ebd7);})[_0xd95c('0x3a')](function(_0x2e3646){_0x417003[_0xd95c('0x3d')]=_0x2e3646;return _0x417003;})['then'](respondWithFilteredResult(_0x36acd3,_0x26ebd7))[_0xd95c('0x3e')](handleError(_0x36acd3,null));};exports[_0xd95c('0x3f')]=function(_0x1eefd6,_0x1a78c4){var _0x4eba51={'raw':!![],'where':{'id':_0x1eefd6[_0xd95c('0x40')]['id']}},_0x34ef99={};_0x34ef99[_0xd95c('0x2c')]=_[_0xd95c('0x41')](db[_0xd95c('0x39')][_0xd95c('0x25')]);_0x34ef99[_0xd95c('0x29')]=_['keys'](_0x1eefd6[_0xd95c('0x29')]);_0x34ef99[_0xd95c('0x2a')]=_[_0xd95c('0x2b')](_0x34ef99[_0xd95c('0x2c')],_0x34ef99[_0xd95c('0x29')]);_0x4eba51[_0xd95c('0x2e')]=_['intersection'](_0x34ef99['model'],qs[_0xd95c('0x2d')](_0x1eefd6[_0xd95c('0x29')][_0xd95c('0x2d')]));_0x4eba51[_0xd95c('0x2e')]=_0x4eba51['attributes']['length']?_0x4eba51['attributes']:_0x34ef99['model'];if(_0x1eefd6['query'][_0xd95c('0x3b')]){_0x4eba51[_0xd95c('0x3c')]=[{'all':!![]}];}_0x4eba51=_['merge']({},_0x4eba51,_0x1eefd6['options']);return db[_0xd95c('0x39')]['find'](_0x4eba51)[_0xd95c('0x3a')](handleEntityNotFound(_0x1a78c4,null))[_0xd95c('0x3a')](respondWithResult(_0x1a78c4,null))[_0xd95c('0x3e')](handleError(_0x1a78c4,null));};exports[_0xd95c('0x42')]=function(_0x51266c,_0x3dee53){return db[_0xd95c('0x39')]['create'](_0x51266c[_0xd95c('0x43')],{})[_0xd95c('0x3a')](respondWithResult(_0x3dee53,0xc9))[_0xd95c('0x3e')](handleError(_0x3dee53,null));};exports['update']=function(_0x2fa614,_0x78f5b7){if(_0x2fa614[_0xd95c('0x43')]['id']){delete _0x2fa614[_0xd95c('0x43')]['id'];}return db[_0xd95c('0x39')][_0xd95c('0x44')]({'where':{'id':_0x2fa614['params']['id']}})['then'](handleEntityNotFound(_0x78f5b7,null))[_0xd95c('0x3a')](saveUpdates(_0x2fa614[_0xd95c('0x43')],null))[_0xd95c('0x3a')](respondWithResult(_0x78f5b7,null))[_0xd95c('0x3e')](handleError(_0x78f5b7,null));};exports['destroy']=function(_0x1da59d,_0x5b7de3){return db[_0xd95c('0x39')][_0xd95c('0x44')]({'where':{'id':_0x1da59d[_0xd95c('0x40')]['id']}})[_0xd95c('0x3a')](handleEntityNotFound(_0x5b7de3,null))[_0xd95c('0x3a')](removeEntity(_0x5b7de3,null))[_0xd95c('0x3e')](handleError(_0x5b7de3,null));};exports[_0xd95c('0x45')]=function(_0x2e9b69,_0x1d0888){return db[_0xd95c('0x39')][_0xd95c('0x45')]()['then'](respondWithResult(_0x1d0888,null))[_0xd95c('0x3e')](handleError(_0x1d0888,null));}; \ No newline at end of file +var _0x4d8b=['status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','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'];(function(_0x12793a,_0x347cfd){var _0x288d76=function(_0x4057e1){while(--_0x4057e1){_0x12793a['push'](_0x12793a['shift']());}};_0x288d76(++_0x347cfd);}(_0x4d8b,0x7b));var _0xb4d8=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x4d8b[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0xb4d8('0x0'));var rimraf=require(_0xb4d8('0x1'));var zipdir=require(_0xb4d8('0x2'));var jsonpatch=require(_0xb4d8('0x3'));var rp=require('request-promise');var moment=require(_0xb4d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4d8('0x5'));var util=require(_0xb4d8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb4d8('0x7'));var ejs=require(_0xb4d8('0x8'));var fs=require('fs');var fs_extra=require(_0xb4d8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb4d8('0xa'));var jsforce=require(_0xb4d8('0xb'));var deskjs=require(_0xb4d8('0xc'));var toCsv=require(_0xb4d8('0x7'));var querystring=require(_0xb4d8('0xd'));var Papa=require(_0xb4d8('0xe'));var Redis=require('ioredis');var authService=require(_0xb4d8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb4d8('0x10'));var hardwareService=require(_0xb4d8('0x11'));var logger=require(_0xb4d8('0x12'))(_0xb4d8('0x13'));var utils=require(_0xb4d8('0x14'));var config=require(_0xb4d8('0x15'));var licenseUtil=require(_0xb4d8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42f678,_0x12e93f){_0x12e93f=_0x12e93f||0xcc;return function(_0x4969f7){if(_0x4969f7){return _0x42f678['sendStatus'](_0x12e93f);}return _0x42f678[_0xb4d8('0x17')](_0x12e93f)[_0xb4d8('0x18')]();};}function respondWithResult(_0x3f793e,_0x1e3988){_0x1e3988=_0x1e3988||0xc8;return function(_0x3d7f8e){if(_0x3d7f8e){return _0x3f793e[_0xb4d8('0x17')](_0x1e3988)[_0xb4d8('0x19')](_0x3d7f8e);}};}function respondWithFilteredResult(_0x5aae69,_0xdba8a9){return function(_0x320253){if(_0x320253){var _0x13b787=typeof _0xdba8a9['offset']==='undefined'&&typeof _0xdba8a9['limit']===_0xb4d8('0x1a');var _0x3511e4=_0x320253[_0xb4d8('0x1b')];var _0x1880b7=_0x13b787?0x0:_0xdba8a9[_0xb4d8('0x1c')];var _0x1ba947=_0x13b787?_0x320253[_0xb4d8('0x1b')]:_0xdba8a9[_0xb4d8('0x1c')]+_0xdba8a9['limit'];var _0x365251;if(_0x1ba947>=_0x3511e4){_0x1ba947=_0x3511e4;_0x365251=0xc8;}else{_0x365251=0xce;}_0x5aae69[_0xb4d8('0x17')](_0x365251);return _0x5aae69[_0xb4d8('0x1d')](_0xb4d8('0x1e'),_0x1880b7+'-'+_0x1ba947+'/'+_0x3511e4)['json'](_0x320253);}return null;};}function patchUpdates(_0x3501e1){return function(_0x470ed1){try{jsonpatch[_0xb4d8('0x1f')](_0x470ed1,_0x3501e1,!![]);}catch(_0x20e5f6){return BPromise[_0xb4d8('0x20')](_0x20e5f6);}return _0x470ed1[_0xb4d8('0x21')]();};}function saveUpdates(_0x3d23cb,_0x1807f4){return function(_0x18bfe3){if(_0x18bfe3){return _0x18bfe3['update'](_0x3d23cb)['then'](function(_0x481264){return _0x481264;});}return null;};}function removeEntity(_0x4ce865,_0x57b472){return function(_0x38c848){if(_0x38c848){return _0x38c848[_0xb4d8('0x22')]()[_0xb4d8('0x23')](function(){_0x4ce865[_0xb4d8('0x17')](0xcc)[_0xb4d8('0x18')]();});}};}function handleEntityNotFound(_0x462109,_0x32108d){return function(_0x590319){if(!_0x590319){_0x462109['sendStatus'](0x194);}return _0x590319;};}function handleError(_0x546dcd,_0x5cf7d9){_0x5cf7d9=_0x5cf7d9||0x1f4;return function(_0x3e40d1){logger[_0xb4d8('0x24')](_0x3e40d1[_0xb4d8('0x25')]);if(_0x3e40d1[_0xb4d8('0x26')]){delete _0x3e40d1['name'];}_0x546dcd[_0xb4d8('0x17')](_0x5cf7d9)[_0xb4d8('0x27')](_0x3e40d1);};}exports[_0xb4d8('0x28')]=function(_0x33ac96,_0x2978c1){var _0x2d6990={},_0xe223b2={},_0x1c3c41={'count':0x0,'rows':[]};var _0x130809=_[_0xb4d8('0x29')](db[_0xb4d8('0x2a')][_0xb4d8('0x2b')],function(_0x590736){return{'name':_0x590736[_0xb4d8('0x2c')],'type':_0x590736[_0xb4d8('0x2d')][_0xb4d8('0x2e')]};});_0xe223b2[_0xb4d8('0x2f')]=_[_0xb4d8('0x29')](_0x130809,_0xb4d8('0x26'));_0xe223b2['query']=_[_0xb4d8('0x30')](_0x33ac96[_0xb4d8('0x31')]);_0xe223b2[_0xb4d8('0x32')]=_[_0xb4d8('0x33')](_0xe223b2['model'],_0xe223b2[_0xb4d8('0x31')]);_0x2d6990[_0xb4d8('0x34')]=_[_0xb4d8('0x33')](_0xe223b2[_0xb4d8('0x2f')],qs[_0xb4d8('0x35')](_0x33ac96[_0xb4d8('0x31')]['fields']));_0x2d6990[_0xb4d8('0x34')]=_0x2d6990['attributes'][_0xb4d8('0x36')]?_0x2d6990['attributes']:_0xe223b2['model'];if(!_0x33ac96[_0xb4d8('0x31')]['hasOwnProperty'](_0xb4d8('0x37'))){_0x2d6990[_0xb4d8('0x38')]=qs['limit'](_0x33ac96['query'][_0xb4d8('0x38')]);_0x2d6990[_0xb4d8('0x1c')]=qs[_0xb4d8('0x1c')](_0x33ac96[_0xb4d8('0x31')]['offset']);}_0x2d6990[_0xb4d8('0x39')]=qs['sort'](_0x33ac96[_0xb4d8('0x31')][_0xb4d8('0x3a')]);_0x2d6990['where']=qs[_0xb4d8('0x32')](_['pick'](_0x33ac96[_0xb4d8('0x31')],_0xe223b2['filters']),_0x130809);if(_0x33ac96['query'][_0xb4d8('0x3b')]){_0x2d6990[_0xb4d8('0x3c')]=_[_0xb4d8('0x3d')](_0x2d6990[_0xb4d8('0x3c')],{'$or':_[_0xb4d8('0x29')](_0x130809,function(_0x11a46b){if(_0x11a46b[_0xb4d8('0x2d')]!==_0xb4d8('0x3e')){var _0x1c5b99={};_0x1c5b99[_0x11a46b[_0xb4d8('0x26')]]={'$like':'%'+_0x33ac96[_0xb4d8('0x31')]['filter']+'%'};return _0x1c5b99;}})});}_0x2d6990=_[_0xb4d8('0x3d')]({},_0x2d6990,_0x33ac96[_0xb4d8('0x3f')]);var _0x1087db={'where':_0x2d6990['where']};return db['OpenchannelQueueReport'][_0xb4d8('0x1b')](_0x1087db)[_0xb4d8('0x23')](function(_0x4b7c62){_0x1c3c41[_0xb4d8('0x1b')]=_0x4b7c62;if(_0x33ac96[_0xb4d8('0x31')][_0xb4d8('0x40')]){_0x2d6990[_0xb4d8('0x41')]=[{'all':!![]}];}return db[_0xb4d8('0x2a')][_0xb4d8('0x42')](_0x2d6990);})['then'](function(_0x40df5b){_0x1c3c41['rows']=_0x40df5b;return _0x1c3c41;})[_0xb4d8('0x23')](respondWithFilteredResult(_0x2978c1,_0x2d6990))[_0xb4d8('0x43')](handleError(_0x2978c1,null));};exports['show']=function(_0x41f1cf,_0x16b09e){var _0x1945d5={'raw':!![],'where':{'id':_0x41f1cf[_0xb4d8('0x44')]['id']}},_0x40405e={};_0x40405e['model']=_[_0xb4d8('0x30')](db[_0xb4d8('0x2a')][_0xb4d8('0x2b')]);_0x40405e[_0xb4d8('0x31')]=_['keys'](_0x41f1cf[_0xb4d8('0x31')]);_0x40405e[_0xb4d8('0x32')]=_[_0xb4d8('0x33')](_0x40405e[_0xb4d8('0x2f')],_0x40405e[_0xb4d8('0x31')]);_0x1945d5[_0xb4d8('0x34')]=_[_0xb4d8('0x33')](_0x40405e[_0xb4d8('0x2f')],qs[_0xb4d8('0x35')](_0x41f1cf[_0xb4d8('0x31')][_0xb4d8('0x35')]));_0x1945d5[_0xb4d8('0x34')]=_0x1945d5[_0xb4d8('0x34')][_0xb4d8('0x36')]?_0x1945d5[_0xb4d8('0x34')]:_0x40405e[_0xb4d8('0x2f')];if(_0x41f1cf[_0xb4d8('0x31')]['includeAll']){_0x1945d5[_0xb4d8('0x41')]=[{'all':!![]}];}_0x1945d5=_[_0xb4d8('0x3d')]({},_0x1945d5,_0x41f1cf['options']);return db['OpenchannelQueueReport'][_0xb4d8('0x45')](_0x1945d5)[_0xb4d8('0x23')](handleEntityNotFound(_0x16b09e,null))[_0xb4d8('0x23')](respondWithResult(_0x16b09e,null))[_0xb4d8('0x43')](handleError(_0x16b09e,null));};exports[_0xb4d8('0x46')]=function(_0x16be4d,_0x447142){return db['OpenchannelQueueReport'][_0xb4d8('0x46')](_0x16be4d[_0xb4d8('0x47')],{})[_0xb4d8('0x23')](respondWithResult(_0x447142,0xc9))['catch'](handleError(_0x447142,null));};exports[_0xb4d8('0x48')]=function(_0x42fc4a,_0x2de076){if(_0x42fc4a[_0xb4d8('0x47')]['id']){delete _0x42fc4a[_0xb4d8('0x47')]['id'];}return db[_0xb4d8('0x2a')]['find']({'where':{'id':_0x42fc4a[_0xb4d8('0x44')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x2de076,null))[_0xb4d8('0x23')](saveUpdates(_0x42fc4a['body'],null))['then'](respondWithResult(_0x2de076,null))[_0xb4d8('0x43')](handleError(_0x2de076,null));};exports['destroy']=function(_0x47fd99,_0x1f208e){return db[_0xb4d8('0x2a')][_0xb4d8('0x45')]({'where':{'id':_0x47fd99[_0xb4d8('0x44')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x1f208e,null))['then'](removeEntity(_0x1f208e,null))[_0xb4d8('0x43')](handleError(_0x1f208e,null));};exports['describe']=function(_0x124584,_0x10c2b7){return db[_0xb4d8('0x2a')]['describe']()['then'](respondWithResult(_0x10c2b7,null))['catch'](handleError(_0x10c2b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 47a212c..a5f4687 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x3e3cf6,_0x211b69){var _0x23d373=function(_0x552444){while(--_0x552444){_0x3e3cf6['push'](_0x3e3cf6['shift']());}};_0x23d373(++_0x211b69);}(_0x2ef3,0xba));var _0x32ef=function(_0x5384f2,_0x2df875){_0x5384f2=_0x5384f2-0x0;var _0x22716b=_0x2ef3[_0x5384f2];return _0x22716b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x2e9f28,_0x47e550){var _0x55c866=function(_0xd2d399){while(--_0xd2d399){_0x2e9f28['push'](_0x2e9f28['shift']());}};_0x55c866(++_0x47e550);}(_0x1261,0x144));var _0x1126=function(_0x5ce34a,_0x57887e){_0x5ce34a=_0x5ce34a-0x0;var _0x309350=_0x1261[_0x5ce34a];return _0x309350;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 1f759e0..79c56c8 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 _0x02a7=['raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','create','body','options'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x02a7,0x1a6));var _0x702a=function(_0x377ffc,_0x11b7e0){_0x377ffc=_0x377ffc-0x0;var _0x3daef0=_0x02a7[_0x377ffc];return _0x3daef0;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}exports[_0x702a('0x16')]=function(_0x340dc2){var _0x2071ad=this;return new Promise(function(_0x3d1550,_0x1885eb){return db['OpenchannelQueueReport'][_0x702a('0x17')](_0x340dc2[_0x702a('0x18')],{'raw':_0x340dc2[_0x702a('0x19')]?_0x340dc2[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5b2998){logger['info'](_0x702a('0x16'),_0x340dc2);logger['debug'](_0x702a('0x16'),_0x340dc2,JSON[_0x702a('0xf')](_0x5b2998));_0x3d1550(_0x5b2998);})['catch'](function(_0x2ca064){logger[_0x702a('0x10')](_0x702a('0x16'),_0x2ca064[_0x702a('0x13')],_0x340dc2);_0x1885eb(_0x2071ad[_0x702a('0x10')](0x1f4,_0x2ca064['message']));});});};exports[_0x702a('0x1b')]=function(_0x544be5){var _0x5e6cce=this;return new Promise(function(_0x57d897,_0xa2be1d){return db[_0x702a('0x1c')]['update'](_0x544be5[_0x702a('0x18')],{'raw':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1d')]||null:null,'attributes':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1e')]||null:null,'limit':_0x544be5['options']?_0x544be5[_0x702a('0x19')]['limit']||null:null})[_0x702a('0x1f')](function(_0x51867d){logger[_0x702a('0xb')](_0x702a('0x1b'),_0x544be5);logger[_0x702a('0xd')]('UpdateOpenchannelQueueReport',_0x544be5,JSON[_0x702a('0xf')](_0x51867d));_0x57d897(_0x51867d);})[_0x702a('0x15')](function(_0x26e1d1){logger['error'](_0x702a('0x1b'),_0x26e1d1['message'],_0x544be5);_0xa2be1d(_0x5e6cce[_0x702a('0x10')](0x1f4,_0x26e1d1[_0x702a('0x13')]));});});}; \ No newline at end of file +var _0xa149=['result','catch','CreateOpenchannelQueueReport','create','options','stringify','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x13970a,_0x3c10bf){var _0x57eebc=function(_0x102e16){while(--_0x102e16){_0x13970a['push'](_0x13970a['shift']());}};_0x57eebc(++_0x3c10bf);}(_0xa149,0x18c));var _0x9a14=function(_0x5c4b81,_0x429a43){_0x5c4b81=_0x5c4b81-0x0;var _0x453e2b=_0xa149[_0x5c4b81];return _0x453e2b;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var moment=require(_0x9a14('0x2'));var BPromise=require(_0x9a14('0x3'));var rs=require(_0x9a14('0x4'));var fs=require('fs');var Redis=require(_0x9a14('0x5'));var db=require(_0x9a14('0x6'))['db'];var utils=require(_0x9a14('0x7'));var logger=require(_0x9a14('0x8'))('rpc');var config=require(_0x9a14('0x9'));var jayson=require(_0x9a14('0xa'));var client=jayson['client'][_0x9a14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3beb93,_0x286760,_0x17d2e5){return new BPromise(function(_0x109f69,_0x26efc5){return client['request'](_0x3beb93,_0x17d2e5)[_0x9a14('0xc')](function(_0x4bdd6c){logger[_0x9a14('0xd')](_0x9a14('0xe'),_0x286760,_0x9a14('0xf'));logger[_0x9a14('0x10')](_0x9a14('0x11'),_0x286760,_0x9a14('0xf'),JSON['stringify'](_0x4bdd6c));if(_0x4bdd6c['error']){if(_0x4bdd6c['error']['code']===0x1f4){logger[_0x9a14('0x12')](_0x9a14('0xe'),_0x286760,_0x4bdd6c['error'][_0x9a14('0x13')]);return _0x26efc5(_0x4bdd6c['error'][_0x9a14('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x286760,_0x4bdd6c[_0x9a14('0x12')][_0x9a14('0x13')]);return _0x109f69(_0x4bdd6c[_0x9a14('0x12')][_0x9a14('0x13')]);}else{logger['info'](_0x9a14('0xe'),_0x286760,_0x9a14('0xf'));_0x109f69(_0x4bdd6c[_0x9a14('0x14')][_0x9a14('0x13')]);}})[_0x9a14('0x15')](function(_0x5b3a7a){logger[_0x9a14('0x12')](_0x9a14('0xe'),_0x286760,_0x5b3a7a);_0x26efc5(_0x5b3a7a);});});}exports[_0x9a14('0x16')]=function(_0x3aa654){var _0x38be44=this;return new Promise(function(_0x55a283,_0x5287e6){return db['OpenchannelQueueReport'][_0x9a14('0x17')](_0x3aa654['body'],{'raw':_0x3aa654[_0x9a14('0x18')]?_0x3aa654[_0x9a14('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53e151){logger['info'](_0x9a14('0x16'),_0x3aa654);logger[_0x9a14('0x10')](_0x9a14('0x16'),_0x3aa654,JSON[_0x9a14('0x19')](_0x53e151));_0x55a283(_0x53e151);})[_0x9a14('0x15')](function(_0xc78dd7){logger[_0x9a14('0x12')]('CreateOpenchannelQueueReport',_0xc78dd7['message'],_0x3aa654);_0x5287e6(_0x38be44[_0x9a14('0x12')](0x1f4,_0xc78dd7[_0x9a14('0x13')]));});});};exports[_0x9a14('0x1a')]=function(_0x53aab4){var _0x3be9da=this;return new Promise(function(_0x1c8ae3,_0x1e477f){return db[_0x9a14('0x1b')][_0x9a14('0x1c')](_0x53aab4[_0x9a14('0x1d')],{'raw':_0x53aab4[_0x9a14('0x18')]?_0x53aab4[_0x9a14('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53aab4['options']?_0x53aab4[_0x9a14('0x18')][_0x9a14('0x1e')]||null:null,'attributes':_0x53aab4[_0x9a14('0x18')]?_0x53aab4['options']['attributes']||null:null,'limit':_0x53aab4[_0x9a14('0x18')]?_0x53aab4[_0x9a14('0x18')][_0x9a14('0x1f')]||null:null})[_0x9a14('0xc')](function(_0x47755e){logger['info'](_0x9a14('0x1a'),_0x53aab4);logger[_0x9a14('0x10')]('UpdateOpenchannelQueueReport',_0x53aab4,JSON[_0x9a14('0x19')](_0x47755e));_0x1c8ae3(_0x47755e);})[_0x9a14('0x15')](function(_0x4cc000){logger[_0x9a14('0x12')]('UpdateOpenchannelQueueReport',_0x4cc000[_0x9a14('0x13')],_0x53aab4);_0x1e477f(_0x3be9da[_0x9a14('0x12')](0x1f4,_0x4cc000[_0x9a14('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index dc0bd97..98ae998 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 _0x7423=['create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','post'];(function(_0x24e364,_0x22c22c){var _0x3921b0=function(_0x4f15d9){while(--_0x4f15d9){_0x24e364['push'](_0x24e364['shift']());}};_0x3921b0(++_0x22c22c);}(_0x7423,0x16f));var _0x3742=function(_0x58bb95,_0x170b36){_0x58bb95=_0x58bb95-0x0;var _0x4b74d6=_0x7423[_0x58bb95];return _0x4b74d6;};'use strict';var multer=require(_0x3742('0x0'));var util=require(_0x3742('0x1'));var path=require('path');var timeout=require(_0x3742('0x2'));var express=require(_0x3742('0x3'));var router=express[_0x3742('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3742('0x5'));var interaction=require(_0x3742('0x6'));var config=require(_0x3742('0x7'));var controller=require(_0x3742('0x8'));router[_0x3742('0x9')]('/',auth[_0x3742('0xa')](),controller[_0x3742('0xb')]);router[_0x3742('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3742('0x9')]('/:id',auth[_0x3742('0xa')](),controller['show']);router[_0x3742('0xc')]('/',auth[_0x3742('0xa')](),controller[_0x3742('0xd')]);router[_0x3742('0xe')]('/:id',auth[_0x3742('0xa')](),controller[_0x3742('0xf')]);router[_0x3742('0x10')](_0x3742('0x11'),auth[_0x3742('0xa')](),controller[_0x3742('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf35a=['describe','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x7b2aa9,_0x4103f7){var _0x5b387=function(_0x39cf6c){while(--_0x39cf6c){_0x7b2aa9['push'](_0x7b2aa9['shift']());}};_0x5b387(++_0x4103f7);}(_0xf35a,0x107));var _0xaf35=function(_0x4aefc7,_0x28fc4a){_0x4aefc7=_0x4aefc7-0x0;var _0x3471b3=_0xf35a[_0x4aefc7];return _0x3471b3;};'use strict';var multer=require(_0xaf35('0x0'));var util=require(_0xaf35('0x1'));var path=require('path');var timeout=require(_0xaf35('0x2'));var express=require('express');var router=express[_0xaf35('0x3')]();var fs_extra=require(_0xaf35('0x4'));var auth=require(_0xaf35('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf35('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0xaf35('0x7')]('/',auth[_0xaf35('0x8')](),controller['index']);router[_0xaf35('0x7')]('/describe',auth[_0xaf35('0x8')](),controller[_0xaf35('0x9')]);router[_0xaf35('0x7')]('/:id',auth[_0xaf35('0x8')](),controller[_0xaf35('0xa')]);router[_0xaf35('0xb')]('/',auth[_0xaf35('0x8')](),controller[_0xaf35('0xc')]);router['put']('/:id',auth[_0xaf35('0x8')](),controller[_0xaf35('0xd')]);router[_0xaf35('0xe')]('/:id',auth[_0xaf35('0x8')](),controller[_0xaf35('0xf')]);module[_0xaf35('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 564bf7e..f32b07c 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x58dee8,_0x8978f3){var _0x715e30=function(_0x530dd3){while(--_0x530dd3){_0x58dee8['push'](_0x58dee8['shift']());}};_0x715e30(++_0x8978f3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0xf3cd[_0x3e618a];return _0x1f3d61;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x228d34,_0x24025c){_0x228d34=_0x228d34-0x0;var _0x5c2ca1=_0xb43b[_0x228d34];return _0x5c2ca1;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 823e08f..39146d9 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 _0x1050=['count','offset','limit','set','Content-Range','json','reject','update','then','destroy','name','send','index','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1050,0x1ef));var _0x0105=function(_0x38c8d1,_0x329c8b){_0x38c8d1=_0x38c8d1-0x0;var _0x4922ee=_0x1050[_0x38c8d1];return _0x4922ee;};'use strict';var emlformat=require(_0x0105('0x0'));var rimraf=require(_0x0105('0x1'));var zipdir=require(_0x0105('0x2'));var jsonpatch=require(_0x0105('0x3'));var rp=require('request-promise');var moment=require(_0x0105('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0105('0x5'));var util=require(_0x0105('0x6'));var path=require(_0x0105('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0105('0x8'));var fs=require('fs');var fs_extra=require(_0x0105('0x9'));var _=require(_0x0105('0xa'));var squel=require(_0x0105('0xb'));var crypto=require(_0x0105('0xc'));var jsforce=require(_0x0105('0xd'));var deskjs=require(_0x0105('0xe'));var toCsv=require(_0x0105('0xf'));var querystring=require('querystring');var Papa=require(_0x0105('0x10'));var Redis=require('ioredis');var authService=require(_0x0105('0x11'));var qs=require(_0x0105('0x12'));var as=require(_0x0105('0x13'));var hardwareService=require(_0x0105('0x14'));var logger=require(_0x0105('0x15'))(_0x0105('0x16'));var utils=require(_0x0105('0x17'));var config=require(_0x0105('0x18'));var licenseUtil=require(_0x0105('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x379122,_0x21db08){_0x21db08=_0x21db08||0xcc;return function(_0x59607e){if(_0x59607e){return _0x379122[_0x0105('0x1a')](_0x21db08);}return _0x379122[_0x0105('0x1b')](_0x21db08)[_0x0105('0x1c')]();};}function respondWithResult(_0x844dcf,_0x263ceb){_0x263ceb=_0x263ceb||0xc8;return function(_0x1fb675){if(_0x1fb675){return _0x844dcf['status'](_0x263ceb)['json'](_0x1fb675);}};}function respondWithFilteredResult(_0x3cd2d4,_0x22e3aa){return function(_0x3eca96){if(_0x3eca96){var _0x254f06=typeof _0x22e3aa['offset']==='undefined'&&typeof _0x22e3aa['limit']===_0x0105('0x1d');var _0x20fde3=_0x3eca96[_0x0105('0x1e')];var _0x274505=_0x254f06?0x0:_0x22e3aa[_0x0105('0x1f')];var _0x22cceb=_0x254f06?_0x3eca96['count']:_0x22e3aa[_0x0105('0x1f')]+_0x22e3aa[_0x0105('0x20')];var _0x46889e;if(_0x22cceb>=_0x20fde3){_0x22cceb=_0x20fde3;_0x46889e=0xc8;}else{_0x46889e=0xce;}_0x3cd2d4[_0x0105('0x1b')](_0x46889e);return _0x3cd2d4[_0x0105('0x21')](_0x0105('0x22'),_0x274505+'-'+_0x22cceb+'/'+_0x20fde3)[_0x0105('0x23')](_0x3eca96);}return null;};}function patchUpdates(_0x4273ce){return function(_0x24063b){try{jsonpatch['apply'](_0x24063b,_0x4273ce,!![]);}catch(_0x453087){return BPromise[_0x0105('0x24')](_0x453087);}return _0x24063b['save']();};}function saveUpdates(_0x43ae10,_0x4e4e19){return function(_0x423a3c){if(_0x423a3c){return _0x423a3c[_0x0105('0x25')](_0x43ae10)[_0x0105('0x26')](function(_0x58b7a2){return _0x58b7a2;});}return null;};}function removeEntity(_0x16f3f8,_0x423c9c){return function(_0x3996c8){if(_0x3996c8){return _0x3996c8[_0x0105('0x27')]()['then'](function(){_0x16f3f8[_0x0105('0x1b')](0xcc)[_0x0105('0x1c')]();});}};}function handleEntityNotFound(_0x1be626,_0x2ab695){return function(_0xebc338){if(!_0xebc338){_0x1be626[_0x0105('0x1a')](0x194);}return _0xebc338;};}function handleError(_0x5af7d2,_0x59018f){_0x59018f=_0x59018f||0x1f4;return function(_0x532cea){logger['error'](_0x532cea['stack']);if(_0x532cea[_0x0105('0x28')]){delete _0x532cea[_0x0105('0x28')];}_0x5af7d2['status'](_0x59018f)[_0x0105('0x29')](_0x532cea);};}exports[_0x0105('0x2a')]=function(_0xfdc481,_0x42be53){var _0x57bf7c={},_0x1569a9={},_0x3c2c7c={'count':0x0,'rows':[]};var _0x592109=_['map'](db['OpenchannelTransferReport'][_0x0105('0x2b')],function(_0x57193c){return{'name':_0x57193c['fieldName'],'type':_0x57193c[_0x0105('0x2c')]['key']};});_0x1569a9[_0x0105('0x2d')]=_[_0x0105('0x2e')](_0x592109,_0x0105('0x28'));_0x1569a9[_0x0105('0x2f')]=_['keys'](_0xfdc481[_0x0105('0x2f')]);_0x1569a9[_0x0105('0x30')]=_['intersection'](_0x1569a9[_0x0105('0x2d')],_0x1569a9[_0x0105('0x2f')]);_0x57bf7c['attributes']=_[_0x0105('0x31')](_0x1569a9['model'],qs[_0x0105('0x32')](_0xfdc481[_0x0105('0x2f')][_0x0105('0x32')]));_0x57bf7c[_0x0105('0x33')]=_0x57bf7c['attributes'][_0x0105('0x34')]?_0x57bf7c[_0x0105('0x33')]:_0x1569a9[_0x0105('0x2d')];if(!_0xfdc481[_0x0105('0x2f')][_0x0105('0x35')]('nolimit')){_0x57bf7c[_0x0105('0x20')]=qs[_0x0105('0x20')](_0xfdc481['query'][_0x0105('0x20')]);_0x57bf7c[_0x0105('0x1f')]=qs[_0x0105('0x1f')](_0xfdc481[_0x0105('0x2f')][_0x0105('0x1f')]);}_0x57bf7c[_0x0105('0x36')]=qs[_0x0105('0x37')](_0xfdc481['query'][_0x0105('0x37')]);_0x57bf7c[_0x0105('0x38')]=qs[_0x0105('0x30')](_[_0x0105('0x39')](_0xfdc481['query'],_0x1569a9[_0x0105('0x30')]),_0x592109);if(_0xfdc481[_0x0105('0x2f')][_0x0105('0x3a')]){_0x57bf7c[_0x0105('0x38')]=_[_0x0105('0x3b')](_0x57bf7c[_0x0105('0x38')],{'$or':_['map'](_0x592109,function(_0x3c696f){if(_0x3c696f[_0x0105('0x2c')]!==_0x0105('0x3c')){var _0x31566e={};_0x31566e[_0x3c696f[_0x0105('0x28')]]={'$like':'%'+_0xfdc481[_0x0105('0x2f')][_0x0105('0x3a')]+'%'};return _0x31566e;}})});}_0x57bf7c=_[_0x0105('0x3b')]({},_0x57bf7c,_0xfdc481[_0x0105('0x3d')]);var _0x2e4100={'where':_0x57bf7c[_0x0105('0x38')]};return db[_0x0105('0x3e')]['count'](_0x2e4100)['then'](function(_0x254a9a){_0x3c2c7c['count']=_0x254a9a;if(_0xfdc481[_0x0105('0x2f')][_0x0105('0x3f')]){_0x57bf7c[_0x0105('0x40')]=[{'all':!![]}];}return db[_0x0105('0x3e')][_0x0105('0x41')](_0x57bf7c);})[_0x0105('0x26')](function(_0x1c658d){_0x3c2c7c[_0x0105('0x42')]=_0x1c658d;return _0x3c2c7c;})[_0x0105('0x26')](respondWithFilteredResult(_0x42be53,_0x57bf7c))[_0x0105('0x43')](handleError(_0x42be53,null));};exports[_0x0105('0x44')]=function(_0x5a2eca,_0xd8554){var _0x5162fa={'raw':!![],'where':{'id':_0x5a2eca[_0x0105('0x45')]['id']}},_0x47c23b={};_0x47c23b[_0x0105('0x2d')]=_[_0x0105('0x46')](db[_0x0105('0x3e')][_0x0105('0x2b')]);_0x47c23b[_0x0105('0x2f')]=_[_0x0105('0x46')](_0x5a2eca[_0x0105('0x2f')]);_0x47c23b[_0x0105('0x30')]=_[_0x0105('0x31')](_0x47c23b[_0x0105('0x2d')],_0x47c23b[_0x0105('0x2f')]);_0x5162fa['attributes']=_[_0x0105('0x31')](_0x47c23b['model'],qs[_0x0105('0x32')](_0x5a2eca['query'][_0x0105('0x32')]));_0x5162fa[_0x0105('0x33')]=_0x5162fa['attributes']['length']?_0x5162fa[_0x0105('0x33')]:_0x47c23b[_0x0105('0x2d')];if(_0x5a2eca['query'][_0x0105('0x3f')]){_0x5162fa['include']=[{'all':!![]}];}_0x5162fa=_['merge']({},_0x5162fa,_0x5a2eca[_0x0105('0x3d')]);return db['OpenchannelTransferReport'][_0x0105('0x47')](_0x5162fa)[_0x0105('0x26')](handleEntityNotFound(_0xd8554,null))[_0x0105('0x26')](respondWithResult(_0xd8554,null))[_0x0105('0x43')](handleError(_0xd8554,null));};exports['create']=function(_0x35650e,_0x1bc1b1){return db['OpenchannelTransferReport'][_0x0105('0x48')](_0x35650e[_0x0105('0x49')],{})['then'](respondWithResult(_0x1bc1b1,0xc9))[_0x0105('0x43')](handleError(_0x1bc1b1,null));};exports[_0x0105('0x25')]=function(_0x3a0729,_0x526e69){if(_0x3a0729[_0x0105('0x49')]['id']){delete _0x3a0729[_0x0105('0x49')]['id'];}return db[_0x0105('0x3e')][_0x0105('0x47')]({'where':{'id':_0x3a0729[_0x0105('0x45')]['id']}})[_0x0105('0x26')](handleEntityNotFound(_0x526e69,null))[_0x0105('0x26')](saveUpdates(_0x3a0729[_0x0105('0x49')],null))[_0x0105('0x26')](respondWithResult(_0x526e69,null))[_0x0105('0x43')](handleError(_0x526e69,null));};exports['destroy']=function(_0x4482d0,_0x39a106){return db[_0x0105('0x3e')]['find']({'where':{'id':_0x4482d0[_0x0105('0x45')]['id']}})[_0x0105('0x26')](handleEntityNotFound(_0x39a106,null))[_0x0105('0x26')](removeEntity(_0x39a106,null))['catch'](handleError(_0x39a106,null));};exports[_0x0105('0x4a')]=function(_0x6c3868,_0x3f75b3){return db[_0x0105('0x3e')][_0x0105('0x4a')]()[_0x0105('0x26')](respondWithResult(_0x3f75b3,null))[_0x0105('0x43')](handleError(_0x3f75b3,null));}; \ No newline at end of file +var _0x0239=['bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','includeAll','include','rows','show','params','length','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4fd2ff,_0x52777c){var _0x24de7e=function(_0x515810){while(--_0x515810){_0x4fd2ff['push'](_0x4fd2ff['shift']());}};_0x24de7e(++_0x52777c);}(_0x0239,0x92));var _0x9023=function(_0x4a1412,_0x2b6ee8){_0x4a1412=_0x4a1412-0x0;var _0x2cc456=_0x0239[_0x4a1412];return _0x2cc456;};'use strict';var emlformat=require(_0x9023('0x0'));var rimraf=require(_0x9023('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9023('0x2'));var rp=require(_0x9023('0x3'));var moment=require('moment');var BPromise=require(_0x9023('0x4'));var Mustache=require(_0x9023('0x5'));var util=require(_0x9023('0x6'));var path=require(_0x9023('0x7'));var sox=require(_0x9023('0x8'));var csv=require(_0x9023('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9023('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9023('0xb'));var jsforce=require(_0x9023('0xc'));var deskjs=require(_0x9023('0xd'));var toCsv=require(_0x9023('0x9'));var querystring=require(_0x9023('0xe'));var Papa=require(_0x9023('0xf'));var Redis=require(_0x9023('0x10'));var authService=require(_0x9023('0x11'));var qs=require(_0x9023('0x12'));var as=require(_0x9023('0x13'));var hardwareService=require(_0x9023('0x14'));var logger=require(_0x9023('0x15'))(_0x9023('0x16'));var utils=require(_0x9023('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9023('0x18'));var db=require(_0x9023('0x19'))['db'];function respondWithStatusCode(_0xfa3ed6,_0x40bd39){_0x40bd39=_0x40bd39||0xcc;return function(_0x44c46c){if(_0x44c46c){return _0xfa3ed6['sendStatus'](_0x40bd39);}return _0xfa3ed6[_0x9023('0x1a')](_0x40bd39)['end']();};}function respondWithResult(_0x485771,_0x19df2e){_0x19df2e=_0x19df2e||0xc8;return function(_0x56027e){if(_0x56027e){return _0x485771[_0x9023('0x1a')](_0x19df2e)['json'](_0x56027e);}};}function respondWithFilteredResult(_0x25fdfb,_0x2a2f71){return function(_0xdc996a){if(_0xdc996a){var _0x3bcb84=typeof _0x2a2f71[_0x9023('0x1b')]===_0x9023('0x1c')&&typeof _0x2a2f71[_0x9023('0x1d')]===_0x9023('0x1c');var _0x2bd72b=_0xdc996a[_0x9023('0x1e')];var _0x2f22c6=_0x3bcb84?0x0:_0x2a2f71[_0x9023('0x1b')];var _0xf183aa=_0x3bcb84?_0xdc996a[_0x9023('0x1e')]:_0x2a2f71[_0x9023('0x1b')]+_0x2a2f71[_0x9023('0x1d')];var _0x3ac503;if(_0xf183aa>=_0x2bd72b){_0xf183aa=_0x2bd72b;_0x3ac503=0xc8;}else{_0x3ac503=0xce;}_0x25fdfb[_0x9023('0x1a')](_0x3ac503);return _0x25fdfb['set']('Content-Range',_0x2f22c6+'-'+_0xf183aa+'/'+_0x2bd72b)['json'](_0xdc996a);}return null;};}function patchUpdates(_0xd19258){return function(_0x33aee7){try{jsonpatch[_0x9023('0x1f')](_0x33aee7,_0xd19258,!![]);}catch(_0xb11817){return BPromise[_0x9023('0x20')](_0xb11817);}return _0x33aee7['save']();};}function saveUpdates(_0x291f40,_0x2dc3aa){return function(_0x28df57){if(_0x28df57){return _0x28df57[_0x9023('0x21')](_0x291f40)[_0x9023('0x22')](function(_0xb33ad){return _0xb33ad;});}return null;};}function removeEntity(_0x7c73d,_0x2c3c06){return function(_0x55eaf7){if(_0x55eaf7){return _0x55eaf7[_0x9023('0x23')]()[_0x9023('0x22')](function(){_0x7c73d[_0x9023('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0c3f,_0x46e489){return function(_0x2e32eb){if(!_0x2e32eb){_0x4c0c3f[_0x9023('0x24')](0x194);}return _0x2e32eb;};}function handleError(_0xe445d5,_0x563bae){_0x563bae=_0x563bae||0x1f4;return function(_0x3cb80a){logger[_0x9023('0x25')](_0x3cb80a[_0x9023('0x26')]);if(_0x3cb80a['name']){delete _0x3cb80a[_0x9023('0x27')];}_0xe445d5[_0x9023('0x1a')](_0x563bae)[_0x9023('0x28')](_0x3cb80a);};}exports[_0x9023('0x29')]=function(_0x283a35,_0x206a10){var _0x5372dd={},_0x1f5ad6={},_0x3b422e={'count':0x0,'rows':[]};var _0x730f9b=_['map'](db[_0x9023('0x2a')][_0x9023('0x2b')],function(_0x159acd){return{'name':_0x159acd[_0x9023('0x2c')],'type':_0x159acd[_0x9023('0x2d')][_0x9023('0x2e')]};});_0x1f5ad6[_0x9023('0x2f')]=_[_0x9023('0x30')](_0x730f9b,_0x9023('0x27'));_0x1f5ad6['query']=_[_0x9023('0x31')](_0x283a35[_0x9023('0x32')]);_0x1f5ad6['filters']=_[_0x9023('0x33')](_0x1f5ad6[_0x9023('0x2f')],_0x1f5ad6[_0x9023('0x32')]);_0x5372dd[_0x9023('0x34')]=_['intersection'](_0x1f5ad6['model'],qs[_0x9023('0x35')](_0x283a35['query'][_0x9023('0x35')]));_0x5372dd[_0x9023('0x34')]=_0x5372dd['attributes']['length']?_0x5372dd['attributes']:_0x1f5ad6[_0x9023('0x2f')];if(!_0x283a35[_0x9023('0x32')][_0x9023('0x36')](_0x9023('0x37'))){_0x5372dd[_0x9023('0x1d')]=qs['limit'](_0x283a35[_0x9023('0x32')][_0x9023('0x1d')]);_0x5372dd[_0x9023('0x1b')]=qs['offset'](_0x283a35[_0x9023('0x32')][_0x9023('0x1b')]);}_0x5372dd[_0x9023('0x38')]=qs[_0x9023('0x39')](_0x283a35[_0x9023('0x32')][_0x9023('0x39')]);_0x5372dd[_0x9023('0x3a')]=qs[_0x9023('0x3b')](_['pick'](_0x283a35[_0x9023('0x32')],_0x1f5ad6[_0x9023('0x3b')]),_0x730f9b);if(_0x283a35[_0x9023('0x32')]['filter']){_0x5372dd['where']=_['merge'](_0x5372dd['where'],{'$or':_['map'](_0x730f9b,function(_0x12f379){if(_0x12f379['type']!==_0x9023('0x3c')){var _0x5c1e75={};_0x5c1e75[_0x12f379[_0x9023('0x27')]]={'$like':'%'+_0x283a35[_0x9023('0x32')][_0x9023('0x3d')]+'%'};return _0x5c1e75;}})});}_0x5372dd=_[_0x9023('0x3e')]({},_0x5372dd,_0x283a35['options']);var _0x24c23f={'where':_0x5372dd[_0x9023('0x3a')]};return db[_0x9023('0x2a')][_0x9023('0x1e')](_0x24c23f)[_0x9023('0x22')](function(_0x15d7c4){_0x3b422e['count']=_0x15d7c4;if(_0x283a35['query'][_0x9023('0x3f')]){_0x5372dd[_0x9023('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x5372dd);})[_0x9023('0x22')](function(_0x3a6c48){_0x3b422e[_0x9023('0x41')]=_0x3a6c48;return _0x3b422e;})[_0x9023('0x22')](respondWithFilteredResult(_0x206a10,_0x5372dd))['catch'](handleError(_0x206a10,null));};exports[_0x9023('0x42')]=function(_0x18f665,_0x36fbb){var _0x525654={'raw':!![],'where':{'id':_0x18f665[_0x9023('0x43')]['id']}},_0x3eafe8={};_0x3eafe8[_0x9023('0x2f')]=_[_0x9023('0x31')](db[_0x9023('0x2a')][_0x9023('0x2b')]);_0x3eafe8[_0x9023('0x32')]=_[_0x9023('0x31')](_0x18f665[_0x9023('0x32')]);_0x3eafe8['filters']=_['intersection'](_0x3eafe8[_0x9023('0x2f')],_0x3eafe8['query']);_0x525654[_0x9023('0x34')]=_[_0x9023('0x33')](_0x3eafe8[_0x9023('0x2f')],qs[_0x9023('0x35')](_0x18f665[_0x9023('0x32')][_0x9023('0x35')]));_0x525654[_0x9023('0x34')]=_0x525654[_0x9023('0x34')][_0x9023('0x44')]?_0x525654['attributes']:_0x3eafe8[_0x9023('0x2f')];if(_0x18f665[_0x9023('0x32')][_0x9023('0x3f')]){_0x525654[_0x9023('0x40')]=[{'all':!![]}];}_0x525654=_[_0x9023('0x3e')]({},_0x525654,_0x18f665[_0x9023('0x45')]);return db[_0x9023('0x2a')][_0x9023('0x46')](_0x525654)['then'](handleEntityNotFound(_0x36fbb,null))[_0x9023('0x22')](respondWithResult(_0x36fbb,null))[_0x9023('0x47')](handleError(_0x36fbb,null));};exports[_0x9023('0x48')]=function(_0x3b4831,_0x839c69){return db[_0x9023('0x2a')][_0x9023('0x48')](_0x3b4831[_0x9023('0x49')],{})[_0x9023('0x22')](respondWithResult(_0x839c69,0xc9))['catch'](handleError(_0x839c69,null));};exports[_0x9023('0x21')]=function(_0x560b55,_0x51129d){if(_0x560b55[_0x9023('0x49')]['id']){delete _0x560b55[_0x9023('0x49')]['id'];}return db[_0x9023('0x2a')][_0x9023('0x46')]({'where':{'id':_0x560b55['params']['id']}})['then'](handleEntityNotFound(_0x51129d,null))[_0x9023('0x22')](saveUpdates(_0x560b55[_0x9023('0x49')],null))['then'](respondWithResult(_0x51129d,null))[_0x9023('0x47')](handleError(_0x51129d,null));};exports[_0x9023('0x23')]=function(_0x336d6a,_0x4902b0){return db[_0x9023('0x2a')][_0x9023('0x46')]({'where':{'id':_0x336d6a[_0x9023('0x43')]['id']}})[_0x9023('0x22')](handleEntityNotFound(_0x4902b0,null))[_0x9023('0x22')](removeEntity(_0x4902b0,null))[_0x9023('0x47')](handleError(_0x4902b0,null));};exports[_0x9023('0x4a')]=function(_0x5c4806,_0x5c5863){return db[_0x9023('0x2a')][_0x9023('0x4a')]()[_0x9023('0x22')](respondWithResult(_0x5c5863,null))[_0x9023('0x47')](handleError(_0x5c5863,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6152dd9..1e14397 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 _0xe857=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe857,0xdd));var _0x7e85=function(_0x5d417a,_0x3308dd){_0x5d417a=_0x5d417a-0x0;var _0x5bae09=_0xe857[_0x5d417a];return _0x5bae09;};'use strict';var _=require(_0x7e85('0x0'));var util=require(_0x7e85('0x1'));var logger=require(_0x7e85('0x2'))(_0x7e85('0x3'));var moment=require(_0x7e85('0x4'));var BPromise=require(_0x7e85('0x5'));var rp=require(_0x7e85('0x6'));var fs=require('fs');var path=require(_0x7e85('0x7'));var rimraf=require(_0x7e85('0x8'));var config=require(_0x7e85('0x9'));var attributes=require(_0x7e85('0xa'));module[_0x7e85('0xb')]=function(_0x33c096,_0x1a5e8b){return _0x33c096[_0x7e85('0xc')](_0x7e85('0xd'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x7e85('0xe'),'fields':[_0x7e85('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9038=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9038,0xf1));var _0x8903=function(_0x2db2c8,_0x4218c7){_0x2db2c8=_0x2db2c8-0x0;var _0xb90c56=_0x9038[_0x2db2c8];return _0xb90c56;};'use strict';var _=require(_0x8903('0x0'));var util=require(_0x8903('0x1'));var logger=require(_0x8903('0x2'))(_0x8903('0x3'));var moment=require(_0x8903('0x4'));var BPromise=require(_0x8903('0x5'));var rp=require(_0x8903('0x6'));var fs=require('fs');var path=require(_0x8903('0x7'));var rimraf=require(_0x8903('0x8'));var config=require('../../config/environment');var attributes=require(_0x8903('0x9'));module[_0x8903('0xa')]=function(_0x819c2b,_0x170789){return _0x819c2b['define'](_0x8903('0xb'),attributes,{'tableName':_0x8903('0xc'),'paranoid':![],'indexes':[{'name':_0x8903('0xd'),'fields':[_0x8903('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 aee635f..e4b55f8 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 _0x4074=['jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4074,0xf0));var _0x4407=function(_0x228931,_0x5e558e){_0x228931=_0x228931-0x0;var _0x3085d6=_0x4074[_0x228931];return _0x3085d6;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var moment=require(_0x4407('0x2'));var BPromise=require('bluebird');var rs=require(_0x4407('0x3'));var fs=require('fs');var Redis=require(_0x4407('0x4'));var db=require(_0x4407('0x5'))['db'];var utils=require(_0x4407('0x6'));var logger=require(_0x4407('0x7'))(_0x4407('0x8'));var config=require(_0x4407('0x9'));var jayson=require(_0x4407('0xa'));var client=jayson[_0x4407('0xb')][_0x4407('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4933cf,_0x988538,_0x5f0699){return new BPromise(function(_0x414f0a,_0x3c1aee){return client[_0x4407('0xd')](_0x4933cf,_0x5f0699)['then'](function(_0x5e70a5){logger['info'](_0x4407('0xe'),_0x988538,_0x4407('0xf'));logger[_0x4407('0x10')](_0x4407('0x11'),_0x988538,_0x4407('0xf'),JSON[_0x4407('0x12')](_0x5e70a5));if(_0x5e70a5[_0x4407('0x13')]){if(_0x5e70a5[_0x4407('0x13')][_0x4407('0x14')]===0x1f4){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x5e70a5['error'][_0x4407('0x15')]);return _0x3c1aee(_0x5e70a5[_0x4407('0x13')]['message']);}logger[_0x4407('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x988538,_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);return _0x414f0a(_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);}else{logger[_0x4407('0x16')](_0x4407('0xe'),_0x988538,_0x4407('0xf'));_0x414f0a(_0x5e70a5[_0x4407('0x17')]['message']);}})[_0x4407('0x18')](function(_0x65b20b){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x65b20b);_0x3c1aee(_0x65b20b);});});} \ No newline at end of file +var _0x2e8a=['client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x5e909d,_0xcb0787){_0x5e909d=_0x5e909d-0x0;var _0x4cf7b5=_0x2e8a[_0x5e909d];return _0x4cf7b5;};'use strict';var _=require('lodash');var util=require(_0xa2e8('0x0'));var moment=require(_0xa2e8('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2e8('0x2'));var fs=require('fs');var Redis=require(_0xa2e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2e8('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa2e8('0x5')][_0xa2e8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4d31a8,_0x5dffa2,_0x99f433){return new BPromise(function(_0x3b6834,_0x314adf){return client[_0xa2e8('0x7')](_0x4d31a8,_0x99f433)['then'](function(_0x22e15e){logger['info'](_0xa2e8('0x8'),_0x5dffa2,_0xa2e8('0x9'));logger[_0xa2e8('0xa')](_0xa2e8('0xb'),_0x5dffa2,_0xa2e8('0x9'),JSON['stringify'](_0x22e15e));if(_0x22e15e[_0xa2e8('0xc')]){if(_0x22e15e[_0xa2e8('0xc')]['code']===0x1f4){logger[_0xa2e8('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5dffa2,_0x22e15e[_0xa2e8('0xc')][_0xa2e8('0xd')]);return _0x314adf(_0x22e15e[_0xa2e8('0xc')]['message']);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5dffa2,_0x22e15e[_0xa2e8('0xc')]['message']);return _0x3b6834(_0x22e15e[_0xa2e8('0xc')]['message']);}else{logger[_0xa2e8('0xe')](_0xa2e8('0x8'),_0x5dffa2,_0xa2e8('0x9'));_0x3b6834(_0x22e15e[_0xa2e8('0xf')][_0xa2e8('0xd')]);}})[_0xa2e8('0x10')](function(_0x4c216b){logger[_0xa2e8('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5dffa2,_0x4c216b);_0x314adf(_0x4c216b);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 8c2acee..5218024 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 _0x4034=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x4034,0x166));var _0x4403=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x4034[_0x56b138];return _0x3df878;};'use strict';var multer=require('multer');var util=require(_0x4403('0x0'));var path=require(_0x4403('0x1'));var timeout=require(_0x4403('0x2'));var express=require('express');var router=express[_0x4403('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4403('0x4'));var interaction=require(_0x4403('0x5'));var config=require('../../config/environment');var controller=require(_0x4403('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4403('0x7')]('/:id',auth[_0x4403('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4403('0x9')](_0x4403('0xa'),auth[_0x4403('0x8')](),controller[_0x4403('0xb')]);router[_0x4403('0xc')]('/:id',auth[_0x4403('0x8')](),controller[_0x4403('0xd')]);module[_0x4403('0xe')]=router; \ No newline at end of file +var _0xc849=['delete','exports','multer','path','express','Router','../../components/auth/service','./pause.controller','get','isAuthenticated','index','create','put','/:id','update'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xc849,0x12e));var _0x9c84=function(_0x2c717c,_0x58bfaa){_0x2c717c=_0x2c717c-0x0;var _0x5e0497=_0xc849[_0x2c717c];return _0x5e0497;};'use strict';var multer=require(_0x9c84('0x0'));var util=require('util');var path=require(_0x9c84('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c84('0x2'));var router=express[_0x9c84('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c84('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c84('0x5'));router[_0x9c84('0x6')]('/',auth[_0x9c84('0x7')](),controller[_0x9c84('0x8')]);router[_0x9c84('0x6')]('/:id',auth[_0x9c84('0x7')](),controller['show']);router['post']('/',auth[_0x9c84('0x7')](),controller[_0x9c84('0x9')]);router[_0x9c84('0xa')](_0x9c84('0xb'),auth[_0x9c84('0x7')](),controller[_0x9c84('0xc')]);router[_0x9c84('0xd')](_0x9c84('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9c84('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9cbee2f..06fce3e 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 _0xeede=['STRING','name','sequelize','exports'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0xeede,0x1f2));var _0xeeed=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0xeede[_0xcf581b];return _0x4f454d;};'use strict';var Sequelize=require(_0xeeed('0x0'));module[_0xeeed('0x1')]={'name':{'type':Sequelize[_0xeeed('0x2')],'unique':_0xeeed('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf0e9=['STRING','name','sequelize','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xf0e9,0x1be));var _0x9f0e=function(_0x790854,_0x5b3499){_0x790854=_0x790854-0x0;var _0x2449f7=_0xf0e9[_0x790854];return _0x2449f7;};'use strict';var Sequelize=require(_0x9f0e('0x0'));module[_0x9f0e('0x1')]={'name':{'type':Sequelize[_0x9f0e('0x2')],'unique':_0x9f0e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9f0e('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 611e8c6..e4907bc 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 _0x8f3d=['options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','Pauses','UserProfileResource','then','end','error','stack','name','index','Pause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','length'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x8f3d,0xad));var _0xd8f3=function(_0x36cf2b,_0x519051){_0x36cf2b=_0x36cf2b-0x0;var _0x5e7161=_0x8f3d[_0x36cf2b];return _0x5e7161;};'use strict';var emlformat=require(_0xd8f3('0x0'));var rimraf=require(_0xd8f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f3('0x2'));var rp=require(_0xd8f3('0x3'));var moment=require(_0xd8f3('0x4'));var BPromise=require(_0xd8f3('0x5'));var Mustache=require(_0xd8f3('0x6'));var util=require(_0xd8f3('0x7'));var path=require(_0xd8f3('0x8'));var sox=require(_0xd8f3('0x9'));var csv=require(_0xd8f3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8f3('0xb'));var squel=require(_0xd8f3('0xc'));var crypto=require(_0xd8f3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd8f3('0xa'));var querystring=require(_0xd8f3('0xe'));var Papa=require(_0xd8f3('0xf'));var Redis=require(_0xd8f3('0x10'));var authService=require(_0xd8f3('0x11'));var qs=require(_0xd8f3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8f3('0x13'));var logger=require(_0xd8f3('0x14'))(_0xd8f3('0x15'));var utils=require(_0xd8f3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd8f3('0x17'));var db=require(_0xd8f3('0x18'))['db'];function respondWithStatusCode(_0xe23806,_0x173a77){_0x173a77=_0x173a77||0xcc;return function(_0x10ae12){if(_0x10ae12){return _0xe23806[_0xd8f3('0x19')](_0x173a77);}return _0xe23806[_0xd8f3('0x1a')](_0x173a77)['end']();};}function respondWithResult(_0x535e5c,_0x371f1c){_0x371f1c=_0x371f1c||0xc8;return function(_0x3d4090){if(_0x3d4090){return _0x535e5c[_0xd8f3('0x1a')](_0x371f1c)[_0xd8f3('0x1b')](_0x3d4090);}};}function respondWithFilteredResult(_0x4ef95d,_0x5bb74e){return function(_0x2b1e38){if(_0x2b1e38){var _0xbc1dda=typeof _0x5bb74e[_0xd8f3('0x1c')]==='undefined'&&typeof _0x5bb74e[_0xd8f3('0x1d')]===_0xd8f3('0x1e');var _0xf2b2fa=_0x2b1e38[_0xd8f3('0x1f')];var _0x4b2e79=_0xbc1dda?0x0:_0x5bb74e[_0xd8f3('0x1c')];var _0x3cc86c=_0xbc1dda?_0x2b1e38['count']:_0x5bb74e[_0xd8f3('0x1c')]+_0x5bb74e[_0xd8f3('0x1d')];var _0x1f2278;if(_0x3cc86c>=_0xf2b2fa){_0x3cc86c=_0xf2b2fa;_0x1f2278=0xc8;}else{_0x1f2278=0xce;}_0x4ef95d[_0xd8f3('0x1a')](_0x1f2278);return _0x4ef95d[_0xd8f3('0x20')](_0xd8f3('0x21'),_0x4b2e79+'-'+_0x3cc86c+'/'+_0xf2b2fa)['json'](_0x2b1e38);}return null;};}function patchUpdates(_0x413b96){return function(_0x3cb7e6){try{jsonpatch[_0xd8f3('0x22')](_0x3cb7e6,_0x413b96,!![]);}catch(_0x29697f){return BPromise[_0xd8f3('0x23')](_0x29697f);}return _0x3cb7e6[_0xd8f3('0x24')]();};}function saveUpdates(_0x26e7c7,_0x4154a4){return function(_0x4e4c9a){if(_0x4e4c9a){return _0x4e4c9a[_0xd8f3('0x25')](_0x26e7c7)['then'](function(_0x75599b){return _0x75599b;});}return null;};}function removeEntity(_0x289af8,_0x15c16d){return function(_0x43ffc8){if(_0x43ffc8){return _0x43ffc8[_0xd8f3('0x26')]()['then'](function(){var _0x5d35a6=_0x43ffc8['get']({'plain':!![]});var _0xfd187a=_0xd8f3('0x27');return db[_0xd8f3('0x28')]['destroy']({'where':{'type':_0xfd187a,'resourceId':_0x5d35a6['id']}})['then'](function(){return _0x43ffc8;});})[_0xd8f3('0x29')](function(){_0x289af8['status'](0xcc)[_0xd8f3('0x2a')]();});}};}function handleEntityNotFound(_0x1d7158,_0x29a6de){return function(_0x478b0c){if(!_0x478b0c){_0x1d7158[_0xd8f3('0x19')](0x194);}return _0x478b0c;};}function handleError(_0x298bc2,_0x5124b4){_0x5124b4=_0x5124b4||0x1f4;return function(_0x285272){logger[_0xd8f3('0x2b')](_0x285272[_0xd8f3('0x2c')]);if(_0x285272[_0xd8f3('0x2d')]){delete _0x285272[_0xd8f3('0x2d')];}_0x298bc2[_0xd8f3('0x1a')](_0x5124b4)['send'](_0x285272);};}exports[_0xd8f3('0x2e')]=function(_0x5f5d97,_0x1c0d97){var _0x48659a={},_0x25fc2f={},_0x283299={'count':0x0,'rows':[]};var _0x4b879a=_['map'](db[_0xd8f3('0x2f')][_0xd8f3('0x30')],function(_0x5617d5){return{'name':_0x5617d5[_0xd8f3('0x31')],'type':_0x5617d5['type'][_0xd8f3('0x32')]};});_0x25fc2f[_0xd8f3('0x33')]=_['map'](_0x4b879a,_0xd8f3('0x2d'));_0x25fc2f[_0xd8f3('0x34')]=_[_0xd8f3('0x35')](_0x5f5d97['query']);_0x25fc2f[_0xd8f3('0x36')]=_[_0xd8f3('0x37')](_0x25fc2f[_0xd8f3('0x33')],_0x25fc2f[_0xd8f3('0x34')]);_0x48659a[_0xd8f3('0x38')]=_[_0xd8f3('0x37')](_0x25fc2f[_0xd8f3('0x33')],qs['fields'](_0x5f5d97['query'][_0xd8f3('0x39')]));_0x48659a[_0xd8f3('0x38')]=_0x48659a[_0xd8f3('0x38')]['length']?_0x48659a[_0xd8f3('0x38')]:_0x25fc2f[_0xd8f3('0x33')];if(!_0x5f5d97['query'][_0xd8f3('0x3a')](_0xd8f3('0x3b'))){_0x48659a[_0xd8f3('0x1d')]=qs[_0xd8f3('0x1d')](_0x5f5d97[_0xd8f3('0x34')]['limit']);_0x48659a[_0xd8f3('0x1c')]=qs[_0xd8f3('0x1c')](_0x5f5d97['query']['offset']);}_0x48659a[_0xd8f3('0x3c')]=qs[_0xd8f3('0x3d')](_0x5f5d97[_0xd8f3('0x34')][_0xd8f3('0x3d')]);_0x48659a[_0xd8f3('0x3e')]=qs['filters'](_[_0xd8f3('0x3f')](_0x5f5d97['query'],_0x25fc2f[_0xd8f3('0x36')]),_0x4b879a);if(_0x5f5d97[_0xd8f3('0x34')][_0xd8f3('0x40')]){_0x48659a[_0xd8f3('0x3e')]=_[_0xd8f3('0x41')](_0x48659a[_0xd8f3('0x3e')],{'$or':_['map'](_0x4b879a,function(_0x43a24d){if(_0x43a24d['type']!==_0xd8f3('0x42')){var _0x5f3631={};_0x5f3631[_0x43a24d[_0xd8f3('0x2d')]]={'$like':'%'+_0x5f5d97[_0xd8f3('0x34')][_0xd8f3('0x40')]+'%'};return _0x5f3631;}})});}_0x48659a=_['merge']({},_0x48659a,_0x5f5d97['options']);var _0xdd5d18={'where':_0x48659a[_0xd8f3('0x3e')]};return db['Pause'][_0xd8f3('0x1f')](_0xdd5d18)[_0xd8f3('0x29')](function(_0x14c31e){_0x283299['count']=_0x14c31e;if(_0x5f5d97[_0xd8f3('0x34')][_0xd8f3('0x43')]){_0x48659a[_0xd8f3('0x44')]=[{'all':!![]}];}return db[_0xd8f3('0x2f')]['findAll'](_0x48659a);})['then'](function(_0x1cd108){_0x283299[_0xd8f3('0x45')]=_0x1cd108;return _0x283299;})[_0xd8f3('0x29')](respondWithFilteredResult(_0x1c0d97,_0x48659a))[_0xd8f3('0x46')](handleError(_0x1c0d97,null));};exports['show']=function(_0x3b5cb6,_0x566406){var _0x12b330={'raw':!![],'where':{'id':_0x3b5cb6[_0xd8f3('0x47')]['id']}},_0x285e5d={};_0x285e5d['model']=_[_0xd8f3('0x35')](db[_0xd8f3('0x2f')][_0xd8f3('0x30')]);_0x285e5d['query']=_[_0xd8f3('0x35')](_0x3b5cb6['query']);_0x285e5d[_0xd8f3('0x36')]=_[_0xd8f3('0x37')](_0x285e5d['model'],_0x285e5d[_0xd8f3('0x34')]);_0x12b330[_0xd8f3('0x38')]=_[_0xd8f3('0x37')](_0x285e5d[_0xd8f3('0x33')],qs[_0xd8f3('0x39')](_0x3b5cb6['query'][_0xd8f3('0x39')]));_0x12b330[_0xd8f3('0x38')]=_0x12b330[_0xd8f3('0x38')][_0xd8f3('0x48')]?_0x12b330['attributes']:_0x285e5d[_0xd8f3('0x33')];if(_0x3b5cb6[_0xd8f3('0x34')][_0xd8f3('0x43')]){_0x12b330[_0xd8f3('0x44')]=[{'all':!![]}];}_0x12b330=_['merge']({},_0x12b330,_0x3b5cb6[_0xd8f3('0x49')]);return db['Pause']['find'](_0x12b330)['then'](handleEntityNotFound(_0x566406,null))['then'](respondWithResult(_0x566406,null))[_0xd8f3('0x46')](handleError(_0x566406,null));};exports[_0xd8f3('0x4a')]=function(_0x216f86,_0x3a2006){return db[_0xd8f3('0x2f')][_0xd8f3('0x4a')](_0x216f86[_0xd8f3('0x4b')],{})[_0xd8f3('0x29')](function(_0x23991b){var _0x447cb3=_0x216f86['user']['get']({'plain':!![]});if(!_0x447cb3)throw new Error(_0xd8f3('0x4c'));if(_0x447cb3[_0xd8f3('0x4d')]===_0xd8f3('0x4e')){var _0x354082=_0x23991b['get']({'plain':!![]});var _0x199fea=_0xd8f3('0x27');return db[_0xd8f3('0x4f')][_0xd8f3('0x50')]({'where':{'name':_0x199fea,'userProfileId':_0x447cb3['userProfileId']},'raw':!![]})[_0xd8f3('0x29')](function(_0x2104ae){if(_0x2104ae&&_0x2104ae['autoAssociation']===0x0){return db[_0xd8f3('0x28')][_0xd8f3('0x4a')]({'name':_0x354082['name'],'resourceId':_0x354082['id'],'type':_0x2104ae[_0xd8f3('0x2d')],'sectionId':_0x2104ae['id']},{})[_0xd8f3('0x29')](function(){return _0x23991b;});}else{return _0x23991b;}})[_0xd8f3('0x46')](function(_0x136582){logger[_0xd8f3('0x2b')](_0xd8f3('0x51'),_0x136582);throw _0x136582;});}return _0x23991b;})[_0xd8f3('0x29')](respondWithResult(_0x3a2006,0xc9))[_0xd8f3('0x46')](handleError(_0x3a2006,null));};exports[_0xd8f3('0x25')]=function(_0xda6b00,_0x11fce5){if(_0xda6b00[_0xd8f3('0x4b')]['id']){delete _0xda6b00[_0xd8f3('0x4b')]['id'];}return db[_0xd8f3('0x2f')][_0xd8f3('0x50')]({'where':{'id':_0xda6b00[_0xd8f3('0x47')]['id']}})[_0xd8f3('0x29')](handleEntityNotFound(_0x11fce5,null))[_0xd8f3('0x29')](saveUpdates(_0xda6b00[_0xd8f3('0x4b')],null))['then'](respondWithResult(_0x11fce5,null))[_0xd8f3('0x46')](handleError(_0x11fce5,null));};exports[_0xd8f3('0x26')]=function(_0x2034bf,_0x210512){return db[_0xd8f3('0x2f')]['find']({'where':{'id':_0x2034bf[_0xd8f3('0x47')]['id']}})[_0xd8f3('0x29')](handleEntityNotFound(_0x210512,null))[_0xd8f3('0x29')](removeEntity(_0x210512,null))[_0xd8f3('0x46')](handleError(_0x210512,null));}; \ No newline at end of file +var _0x444c=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','Pause','includeAll','findAll','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','Pauses','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x444c,0x11a));var _0xc444=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x444c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc444('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc444('0x1'));var jsonpatch=require(_0xc444('0x2'));var rp=require(_0xc444('0x3'));var moment=require(_0xc444('0x4'));var BPromise=require(_0xc444('0x5'));var Mustache=require(_0xc444('0x6'));var util=require(_0xc444('0x7'));var path=require(_0xc444('0x8'));var sox=require('sox');var csv=require(_0xc444('0x9'));var ejs=require(_0xc444('0xa'));var fs=require('fs');var fs_extra=require(_0xc444('0xb'));var _=require(_0xc444('0xc'));var squel=require(_0xc444('0xd'));var crypto=require(_0xc444('0xe'));var jsforce=require(_0xc444('0xf'));var deskjs=require(_0xc444('0x10'));var toCsv=require(_0xc444('0x9'));var querystring=require(_0xc444('0x11'));var Papa=require(_0xc444('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc444('0x13'));var as=require(_0xc444('0x14'));var hardwareService=require(_0xc444('0x15'));var logger=require(_0xc444('0x16'))('api');var utils=require(_0xc444('0x17'));var config=require(_0xc444('0x18'));var licenseUtil=require(_0xc444('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f28c4,_0x34fdfe){_0x34fdfe=_0x34fdfe||0xcc;return function(_0x1e91fc){if(_0x1e91fc){return _0x4f28c4[_0xc444('0x1a')](_0x34fdfe);}return _0x4f28c4['status'](_0x34fdfe)[_0xc444('0x1b')]();};}function respondWithResult(_0x46cdc2,_0x5dacec){_0x5dacec=_0x5dacec||0xc8;return function(_0xbcd7ac){if(_0xbcd7ac){return _0x46cdc2[_0xc444('0x1c')](_0x5dacec)[_0xc444('0x1d')](_0xbcd7ac);}};}function respondWithFilteredResult(_0xe24860,_0x519d87){return function(_0x12c350){if(_0x12c350){var _0x480553=typeof _0x519d87[_0xc444('0x1e')]==='undefined'&&typeof _0x519d87['limit']===_0xc444('0x1f');var _0x45fdd6=_0x12c350[_0xc444('0x20')];var _0x432ab5=_0x480553?0x0:_0x519d87[_0xc444('0x1e')];var _0x32e871=_0x480553?_0x12c350[_0xc444('0x20')]:_0x519d87[_0xc444('0x1e')]+_0x519d87[_0xc444('0x21')];var _0xad72c7;if(_0x32e871>=_0x45fdd6){_0x32e871=_0x45fdd6;_0xad72c7=0xc8;}else{_0xad72c7=0xce;}_0xe24860['status'](_0xad72c7);return _0xe24860[_0xc444('0x22')](_0xc444('0x23'),_0x432ab5+'-'+_0x32e871+'/'+_0x45fdd6)[_0xc444('0x1d')](_0x12c350);}return null;};}function patchUpdates(_0x489c7e){return function(_0x424f04){try{jsonpatch['apply'](_0x424f04,_0x489c7e,!![]);}catch(_0x11189b){return BPromise[_0xc444('0x24')](_0x11189b);}return _0x424f04[_0xc444('0x25')]();};}function saveUpdates(_0x6594e8,_0xf2f426){return function(_0x1a6c30){if(_0x1a6c30){return _0x1a6c30[_0xc444('0x26')](_0x6594e8)[_0xc444('0x27')](function(_0x68dbb2){return _0x68dbb2;});}return null;};}function removeEntity(_0x3a1ae4,_0x4ee219){return function(_0x54b2cb){if(_0x54b2cb){return _0x54b2cb[_0xc444('0x28')]()['then'](function(){var _0x23b8b1=_0x54b2cb['get']({'plain':!![]});var _0x2415f=_0xc444('0x29');return db['UserProfileResource'][_0xc444('0x28')]({'where':{'type':_0x2415f,'resourceId':_0x23b8b1['id']}})[_0xc444('0x27')](function(){return _0x54b2cb;});})[_0xc444('0x27')](function(){_0x3a1ae4['status'](0xcc)[_0xc444('0x1b')]();});}};}function handleEntityNotFound(_0x24cb0c,_0x58cca7){return function(_0x16b855){if(!_0x16b855){_0x24cb0c[_0xc444('0x1a')](0x194);}return _0x16b855;};}function handleError(_0x29bc8d,_0x558b9c){_0x558b9c=_0x558b9c||0x1f4;return function(_0xcfba8d){logger[_0xc444('0x2a')](_0xcfba8d[_0xc444('0x2b')]);if(_0xcfba8d[_0xc444('0x2c')]){delete _0xcfba8d[_0xc444('0x2c')];}_0x29bc8d[_0xc444('0x1c')](_0x558b9c)[_0xc444('0x2d')](_0xcfba8d);};}exports[_0xc444('0x2e')]=function(_0x3d7a40,_0x4c5b69){var _0x58d360={},_0x16375c={},_0x1f160b={'count':0x0,'rows':[]};var _0x5b3a37=_[_0xc444('0x2f')](db['Pause'][_0xc444('0x30')],function(_0x416474){return{'name':_0x416474[_0xc444('0x31')],'type':_0x416474[_0xc444('0x32')][_0xc444('0x33')]};});_0x16375c[_0xc444('0x34')]=_[_0xc444('0x2f')](_0x5b3a37,'name');_0x16375c[_0xc444('0x35')]=_[_0xc444('0x36')](_0x3d7a40[_0xc444('0x35')]);_0x16375c[_0xc444('0x37')]=_[_0xc444('0x38')](_0x16375c[_0xc444('0x34')],_0x16375c[_0xc444('0x35')]);_0x58d360[_0xc444('0x39')]=_[_0xc444('0x38')](_0x16375c[_0xc444('0x34')],qs[_0xc444('0x3a')](_0x3d7a40[_0xc444('0x35')][_0xc444('0x3a')]));_0x58d360[_0xc444('0x39')]=_0x58d360[_0xc444('0x39')][_0xc444('0x3b')]?_0x58d360[_0xc444('0x39')]:_0x16375c['model'];if(!_0x3d7a40[_0xc444('0x35')][_0xc444('0x3c')](_0xc444('0x3d'))){_0x58d360[_0xc444('0x21')]=qs['limit'](_0x3d7a40[_0xc444('0x35')][_0xc444('0x21')]);_0x58d360[_0xc444('0x1e')]=qs[_0xc444('0x1e')](_0x3d7a40[_0xc444('0x35')]['offset']);}_0x58d360['order']=qs[_0xc444('0x3e')](_0x3d7a40[_0xc444('0x35')][_0xc444('0x3e')]);_0x58d360[_0xc444('0x3f')]=qs[_0xc444('0x37')](_['pick'](_0x3d7a40[_0xc444('0x35')],_0x16375c[_0xc444('0x37')]),_0x5b3a37);if(_0x3d7a40[_0xc444('0x35')][_0xc444('0x40')]){_0x58d360['where']=_['merge'](_0x58d360[_0xc444('0x3f')],{'$or':_[_0xc444('0x2f')](_0x5b3a37,function(_0xf5eba3){if(_0xf5eba3[_0xc444('0x32')]!==_0xc444('0x41')){var _0x308612={};_0x308612[_0xf5eba3[_0xc444('0x2c')]]={'$like':'%'+_0x3d7a40[_0xc444('0x35')][_0xc444('0x40')]+'%'};return _0x308612;}})});}_0x58d360=_[_0xc444('0x42')]({},_0x58d360,_0x3d7a40[_0xc444('0x43')]);var _0x1faf1e={'where':_0x58d360['where']};return db[_0xc444('0x44')][_0xc444('0x20')](_0x1faf1e)['then'](function(_0x17d2f1){_0x1f160b[_0xc444('0x20')]=_0x17d2f1;if(_0x3d7a40[_0xc444('0x35')][_0xc444('0x45')]){_0x58d360['include']=[{'all':!![]}];}return db[_0xc444('0x44')][_0xc444('0x46')](_0x58d360);})['then'](function(_0x9d557c){_0x1f160b['rows']=_0x9d557c;return _0x1f160b;})[_0xc444('0x27')](respondWithFilteredResult(_0x4c5b69,_0x58d360))[_0xc444('0x47')](handleError(_0x4c5b69,null));};exports[_0xc444('0x48')]=function(_0x19689b,_0x48ff1b){var _0x3c50a8={'raw':!![],'where':{'id':_0x19689b[_0xc444('0x49')]['id']}},_0x4d939b={};_0x4d939b[_0xc444('0x34')]=_['keys'](db['Pause'][_0xc444('0x30')]);_0x4d939b[_0xc444('0x35')]=_['keys'](_0x19689b['query']);_0x4d939b['filters']=_['intersection'](_0x4d939b['model'],_0x4d939b[_0xc444('0x35')]);_0x3c50a8['attributes']=_[_0xc444('0x38')](_0x4d939b['model'],qs[_0xc444('0x3a')](_0x19689b['query'][_0xc444('0x3a')]));_0x3c50a8['attributes']=_0x3c50a8['attributes'][_0xc444('0x3b')]?_0x3c50a8[_0xc444('0x39')]:_0x4d939b['model'];if(_0x19689b['query'][_0xc444('0x45')]){_0x3c50a8[_0xc444('0x4a')]=[{'all':!![]}];}_0x3c50a8=_[_0xc444('0x42')]({},_0x3c50a8,_0x19689b[_0xc444('0x43')]);return db[_0xc444('0x44')][_0xc444('0x4b')](_0x3c50a8)[_0xc444('0x27')](handleEntityNotFound(_0x48ff1b,null))['then'](respondWithResult(_0x48ff1b,null))[_0xc444('0x47')](handleError(_0x48ff1b,null));};exports[_0xc444('0x4c')]=function(_0x492a4b,_0x676377){return db['Pause']['create'](_0x492a4b[_0xc444('0x4d')],{})[_0xc444('0x27')](function(_0x2bca10){var _0x41858f=_0x492a4b[_0xc444('0x4e')][_0xc444('0x4f')]({'plain':!![]});if(!_0x41858f)throw new Error(_0xc444('0x50'));if(_0x41858f['role']==='user'){var _0x4a66d4=_0x2bca10[_0xc444('0x4f')]({'plain':!![]});var _0x2e7912=_0xc444('0x29');return db[_0xc444('0x51')]['find']({'where':{'name':_0x2e7912,'userProfileId':_0x41858f['userProfileId']},'raw':!![]})[_0xc444('0x27')](function(_0x3cff15){if(_0x3cff15&&_0x3cff15['autoAssociation']===0x0){return db[_0xc444('0x52')][_0xc444('0x4c')]({'name':_0x4a66d4[_0xc444('0x2c')],'resourceId':_0x4a66d4['id'],'type':_0x3cff15[_0xc444('0x2c')],'sectionId':_0x3cff15['id']},{})[_0xc444('0x27')](function(){return _0x2bca10;});}else{return _0x2bca10;}})[_0xc444('0x47')](function(_0x453053){logger[_0xc444('0x2a')](_0xc444('0x53'),_0x453053);throw _0x453053;});}return _0x2bca10;})['then'](respondWithResult(_0x676377,0xc9))['catch'](handleError(_0x676377,null));};exports[_0xc444('0x26')]=function(_0x4079c3,_0x3a6d3f){if(_0x4079c3[_0xc444('0x4d')]['id']){delete _0x4079c3[_0xc444('0x4d')]['id'];}return db[_0xc444('0x44')][_0xc444('0x4b')]({'where':{'id':_0x4079c3[_0xc444('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a6d3f,null))[_0xc444('0x27')](saveUpdates(_0x4079c3[_0xc444('0x4d')],null))['then'](respondWithResult(_0x3a6d3f,null))[_0xc444('0x47')](handleError(_0x3a6d3f,null));};exports[_0xc444('0x28')]=function(_0x90f57e,_0x137e3d){return db[_0xc444('0x44')][_0xc444('0x4b')]({'where':{'id':_0x90f57e[_0xc444('0x49')]['id']}})[_0xc444('0x27')](handleEntityNotFound(_0x137e3d,null))['then'](removeEntity(_0x137e3d,null))[_0xc444('0x47')](handleError(_0x137e3d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index cdcb02c..66d0444 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x57ede0,_0x2c5e8c){_0x57ede0=_0x57ede0-0x0;var _0x60056=_0x7fbe[_0x57ede0];return _0x60056;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x7217,0x19e));var _0x7721=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7217[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 6b339e3..892217a 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(_0x3b19c8,_0x881b85){var _0x35fda3=function(_0xd81e9c){while(--_0xd81e9c){_0x3b19c8['push'](_0x3b19c8['shift']());}};_0x35fda3(++_0x881b85);}(_0xb10b,0x12a));var _0xbb10=function(_0x402282,_0x615de3){_0x402282=_0x402282-0x0;var _0x4f65af=_0xb10b[_0x402282];return _0x4f65af;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x20c5c5,_0xd3fbc2){var _0x53528=function(_0x9a4aa5){while(--_0x9a4aa5){_0x20c5c5['push'](_0x20c5c5['shift']());}};_0x53528(++_0xd3fbc2);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e954d,_0x4cc3a0){_0x3e954d=_0x3e954d-0x0;var _0x59649b=_0xb10b[_0x3e954d];return _0x59649b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index d849ff8..9cd24e1 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 _0x3667=['download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download'];(function(_0x2432d9,_0x26e92e){var _0x53609a=function(_0x477189){while(--_0x477189){_0x2432d9['push'](_0x2432d9['shift']());}};_0x53609a(++_0x26e92e);}(_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'),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')]);var upload=multer({'storage':multer[_0x7366('0x12')]({'destination':function(_0x2d7e38,_0x57ea7f,_0x425ee4){_0x425ee4(null,path[_0x7366('0x13')](config[_0x7366('0x14')],_0x7366('0x15')));},'filename':function(_0x25a565,_0xd5bac8,_0x3e3a73){_0xd5bac8[_0x7366('0x16')]=_0xd5bac8[_0x7366('0x16')][_0x7366('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3e3a73(null,util[_0x7366('0x18')](_0x7366('0x19'),path[_0x7366('0x1a')](_0xd5bac8[_0x7366('0x16')],path[_0x7366('0x1b')](_0xd5bac8['originalname'])),Date[_0x7366('0x1c')](),path[_0x7366('0x1b')](_0xd5bac8[_0x7366('0x16')])));}})});router[_0x7366('0x1d')]('/',upload[_0x7366('0x1e')](_0x7366('0x1f')),controller[_0x7366('0x20')]);router[_0x7366('0x1d')](_0x7366('0xc'),controller[_0x7366('0x21')]);router[_0x7366('0x22')]('/:id',auth[_0x7366('0xa')](),controller['update']);router[_0x7366('0x23')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller['delete']);module[_0x7366('0x24')]=router; \ No newline at end of file +var _0x17ba=['single','upload','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','post'];(function(_0xe540d2,_0x50e5f9){var _0x1afbd9=function(_0x284027){while(--_0x284027){_0xe540d2['push'](_0xe540d2['shift']());}};_0x1afbd9(++_0x50e5f9);}(_0x17ba,0xab));var _0xa17b=function(_0x2603d6,_0x2e00fc){_0x2603d6=_0x2603d6-0x0;var _0x174573=_0x17ba[_0x2603d6];return _0x174573;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0xa')]('/:id/download',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);var upload=multer({'storage':multer[_0xa17b('0x12')]({'destination':function(_0x1e799a,_0x140943,_0x4382df){_0x4382df(null,path[_0xa17b('0x13')](config['root'],_0xa17b('0x14')));},'filename':function(_0x3e92e4,_0x3c3a8a,_0x52b7aa){_0x3c3a8a[_0xa17b('0x15')]=_0x3c3a8a[_0xa17b('0x15')][_0xa17b('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7aa(null,util[_0xa17b('0x17')]('%s-%s%s',path[_0xa17b('0x18')](_0x3c3a8a['originalname'],path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])),Date['now'](),path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])));}})});router[_0xa17b('0x1a')]('/',upload[_0xa17b('0x1b')]('file'),controller[_0xa17b('0x1c')]);router['post']('/webhook',controller['webhookPost']);router[_0xa17b('0x1d')](_0xa17b('0xf'),auth['isAuthenticated'](),controller[_0xa17b('0x1e')]);router[_0xa17b('0x1f')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x1f')]);module[_0xa17b('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index b90ad0f..90005f7 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 _0xf2d0=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly'];(function(_0x20d93a,_0x422a10){var _0x4e5cec=function(_0x56089c){while(--_0x56089c){_0x20d93a['push'](_0x20d93a['shift']());}};_0x4e5cec(++_0x422a10);}(_0xf2d0,0x15e));var _0x0f2d=function(_0x3b7360,_0xf05050){_0x3b7360=_0x3b7360-0x0;var _0x2ff27c=_0xf2d0[_0x3b7360];return _0x2ff27c;};'use strict';var Sequelize=require(_0x0f2d('0x0'));module[_0x0f2d('0x1')]={'name':{'type':Sequelize[_0x0f2d('0x2')]},'type':{'type':Sequelize['ENUM'](_0x0f2d('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x0f2d('0x4')]},'path':{'type':Sequelize[_0x0f2d('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x0f2d('0x5')],'defaultValue':0x0,'comment':_0x0f2d('0x6')},'sidebar':{'type':Sequelize[_0x0f2d('0x7')](_0x0f2d('0x8'),_0x0f2d('0x9'),_0x0f2d('0xa'),'never'),'defaultValue':_0x0f2d('0xa'),'comment':_0x0f2d('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x0f2d('0x2')]},'scriptPath':{'type':Sequelize[_0x0f2d('0x2')]}}; \ No newline at end of file +var _0x9e60=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','adminOnly','agentOnly','always','never'];(function(_0x3909fc,_0xe12bde){var _0x2226d8=function(_0x54db37){while(--_0x54db37){_0x3909fc['push'](_0x3909fc['shift']());}};_0x2226d8(++_0xe12bde);}(_0x9e60,0x1da));var _0x09e6=function(_0x174aa4,_0x1b2daa){_0x174aa4=_0x174aa4-0x0;var _0x3ff47a=_0x9e60[_0x174aa4];return _0x3ff47a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x09e6('0x0')]},'type':{'type':Sequelize[_0x09e6('0x1')](_0x09e6('0x2'),_0x09e6('0x3'))},'description':{'type':Sequelize[_0x09e6('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x09e6('0x0')],'comment':_0x09e6('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x09e6('0x6'),_0x09e6('0x7'),_0x09e6('0x8'),_0x09e6('0x9')),'defaultValue':_0x09e6('0x8'),'comment':_0x09e6('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x09e6('0x0')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x09e6('0x0')]},'scriptPath':{'type':Sequelize[_0x09e6('0x0')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 545aec3..73f3831 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 _0xab20=['json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','Plugins','UserProfileResource','end','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','Plugin','rows','show','catch','download','find','params','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','Error','pipe','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','agent','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xab20,0x1cd));var _0x0ab2=function(_0x5d2465,_0x3e2916){_0x5d2465=_0x5d2465-0x0;var _0x11c10c=_0xab20[_0x5d2465];return _0x11c10c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ab2('0x0'));var zipdir=require(_0x0ab2('0x1'));var jsonpatch=require(_0x0ab2('0x2'));var rp=require(_0x0ab2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0ab2('0x4'));var util=require('util');var path=require(_0x0ab2('0x5'));var sox=require(_0x0ab2('0x6'));var csv=require(_0x0ab2('0x7'));var ejs=require(_0x0ab2('0x8'));var fs=require('fs');var fs_extra=require(_0x0ab2('0x9'));var _=require(_0x0ab2('0xa'));var squel=require(_0x0ab2('0xb'));var crypto=require(_0x0ab2('0xc'));var jsforce=require(_0x0ab2('0xd'));var deskjs=require(_0x0ab2('0xe'));var toCsv=require(_0x0ab2('0x7'));var querystring=require(_0x0ab2('0xf'));var Papa=require('papaparse');var extract=require(_0x0ab2('0x10'));var rimraf=require(_0x0ab2('0x0'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0ab2('0x11'));var as=require(_0x0ab2('0x12'));var hardwareService=require(_0x0ab2('0x13'));var logger=require(_0x0ab2('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab2('0x15'));var db=require('../../mysqldb')['db'];config[_0x0ab2('0x16')]=_['defaults'](config['redis'],{'host':_0x0ab2('0x17'),'port':0x18eb});var socket=require(_0x0ab2('0x18'))(new Redis(config[_0x0ab2('0x16')]));require('./plugin.socket')[_0x0ab2('0x19')](socket);function respondWithStatusCode(_0x588388,_0x3e949e){_0x3e949e=_0x3e949e||0xcc;return function(_0x2d837d){if(_0x2d837d){return _0x588388[_0x0ab2('0x1a')](_0x3e949e);}return _0x588388[_0x0ab2('0x1b')](_0x3e949e)['end']();};}function respondWithResult(_0x5c5c36,_0x131b40){_0x131b40=_0x131b40||0xc8;return function(_0xbc8d43){if(_0xbc8d43){return _0x5c5c36[_0x0ab2('0x1b')](_0x131b40)[_0x0ab2('0x1c')](_0xbc8d43);}};}function respondWithFilteredResult(_0x1cc04c,_0x51a62e){return function(_0xc18d72){if(_0xc18d72){var _0x5e8df1=typeof _0x51a62e[_0x0ab2('0x1d')]==='undefined'&&typeof _0x51a62e['limit']===_0x0ab2('0x1e');var _0x163283=_0xc18d72[_0x0ab2('0x1f')];var _0x341f11=_0x5e8df1?0x0:_0x51a62e[_0x0ab2('0x1d')];var _0x51a6c8=_0x5e8df1?_0xc18d72['count']:_0x51a62e[_0x0ab2('0x1d')]+_0x51a62e[_0x0ab2('0x20')];var _0x43ad46;if(_0x51a6c8>=_0x163283){_0x51a6c8=_0x163283;_0x43ad46=0xc8;}else{_0x43ad46=0xce;}_0x1cc04c[_0x0ab2('0x1b')](_0x43ad46);return _0x1cc04c[_0x0ab2('0x21')](_0x0ab2('0x22'),_0x341f11+'-'+_0x51a6c8+'/'+_0x163283)[_0x0ab2('0x1c')](_0xc18d72);}return null;};}function patchUpdates(_0x5812a6){return function(_0x236c13){try{jsonpatch['apply'](_0x236c13,_0x5812a6,!![]);}catch(_0x11cdbb){return BPromise['reject'](_0x11cdbb);}return _0x236c13['save']();};}function saveUpdates(_0x109892,_0x15936c){return function(_0xa56909){if(_0xa56909){return _0xa56909[_0x0ab2('0x23')](_0x109892)[_0x0ab2('0x24')](function(_0x4cf129){return _0x4cf129;});}return null;};}function removeEntity(_0x2b7fd1,_0x390f00){return function(_0x211e54){if(_0x211e54){return _0x211e54[_0x0ab2('0x25')]()[_0x0ab2('0x24')](function(){var _0x53fa35=_0x211e54[_0x0ab2('0x26')]({'plain':!![]});var _0x34d35f=_0x0ab2('0x27');return db[_0x0ab2('0x28')]['destroy']({'where':{'type':_0x34d35f,'resourceId':_0x53fa35['id']}})['then'](function(){return _0x211e54;});})[_0x0ab2('0x24')](function(){_0x2b7fd1[_0x0ab2('0x1b')](0xcc)[_0x0ab2('0x29')]();});}};}function handleEntityNotFound(_0x55f54c,_0x385cbf){return function(_0x28bebe){if(!_0x28bebe){_0x55f54c[_0x0ab2('0x1a')](0x194);}return _0x28bebe;};}function handleError(_0x2eba3c,_0x364710){_0x364710=_0x364710||0x1f4;return function(_0x1aa36b){logger['error'](_0x1aa36b['stack']);if(_0x1aa36b[_0x0ab2('0x2a')]){delete _0x1aa36b['name'];}_0x2eba3c[_0x0ab2('0x1b')](_0x364710)[_0x0ab2('0x2b')](_0x1aa36b);};}exports[_0x0ab2('0x2c')]=function(_0x10b375,_0x136a01){var _0x587338={},_0x5bf8af={},_0x304ec9={'count':0x0,'rows':[]};var _0x4f40f2=_[_0x0ab2('0x2d')](db['Plugin']['rawAttributes'],function(_0x499b8f){return{'name':_0x499b8f[_0x0ab2('0x2e')],'type':_0x499b8f[_0x0ab2('0x2f')][_0x0ab2('0x30')]};});_0x5bf8af['model']=_[_0x0ab2('0x2d')](_0x4f40f2,_0x0ab2('0x2a'));_0x5bf8af[_0x0ab2('0x31')]=_[_0x0ab2('0x32')](_0x10b375[_0x0ab2('0x31')]);_0x5bf8af[_0x0ab2('0x33')]=_[_0x0ab2('0x34')](_0x5bf8af[_0x0ab2('0x35')],_0x5bf8af['query']);_0x587338[_0x0ab2('0x36')]=_[_0x0ab2('0x34')](_0x5bf8af[_0x0ab2('0x35')],qs['fields'](_0x10b375['query'][_0x0ab2('0x37')]));_0x587338[_0x0ab2('0x36')]=_0x587338[_0x0ab2('0x36')][_0x0ab2('0x38')]?_0x587338['attributes']:_0x5bf8af[_0x0ab2('0x35')];if(!_0x10b375[_0x0ab2('0x31')][_0x0ab2('0x39')](_0x0ab2('0x3a'))){_0x587338[_0x0ab2('0x20')]=qs[_0x0ab2('0x20')](_0x10b375[_0x0ab2('0x31')]['limit']);_0x587338[_0x0ab2('0x1d')]=qs['offset'](_0x10b375['query'][_0x0ab2('0x1d')]);}_0x587338[_0x0ab2('0x3b')]=qs['sort'](_0x10b375[_0x0ab2('0x31')][_0x0ab2('0x3c')]);_0x587338[_0x0ab2('0x3d')]=qs[_0x0ab2('0x33')](_[_0x0ab2('0x3e')](_0x10b375['query'],_0x5bf8af[_0x0ab2('0x33')]),_0x4f40f2);if(_0x10b375[_0x0ab2('0x31')][_0x0ab2('0x3f')]){_0x587338[_0x0ab2('0x3d')]=_['merge'](_0x587338['where'],{'$or':_['map'](_0x4f40f2,function(_0x4e1689){if(_0x4e1689[_0x0ab2('0x2f')]!==_0x0ab2('0x40')){var _0x2c21bb={};_0x2c21bb[_0x4e1689[_0x0ab2('0x2a')]]={'$like':'%'+_0x10b375['query'][_0x0ab2('0x3f')]+'%'};return _0x2c21bb;}})});}_0x587338=_[_0x0ab2('0x41')]({},_0x587338,_0x10b375[_0x0ab2('0x42')]);var _0x36549e={'where':_0x587338[_0x0ab2('0x3d')]};return db['Plugin'][_0x0ab2('0x1f')](_0x36549e)['then'](function(_0x15e7a1){_0x304ec9['count']=_0x15e7a1;if(_0x10b375[_0x0ab2('0x31')][_0x0ab2('0x43')]){_0x587338[_0x0ab2('0x44')]=[{'all':!![]}];}return db[_0x0ab2('0x45')]['findAll'](_0x587338);})[_0x0ab2('0x24')](function(_0x4e8263){_0x304ec9[_0x0ab2('0x46')]=_0x4e8263;return _0x304ec9;})[_0x0ab2('0x24')](respondWithFilteredResult(_0x136a01,_0x587338))['catch'](handleError(_0x136a01,null));};exports[_0x0ab2('0x47')]=function(_0x26cf47,_0x5a3803){var _0x4eae4={'raw':!![],'where':{'id':_0x26cf47['params']['id']}},_0x1e9e29={};_0x1e9e29['model']=_[_0x0ab2('0x32')](db[_0x0ab2('0x45')]['rawAttributes']);_0x1e9e29['query']=_[_0x0ab2('0x32')](_0x26cf47[_0x0ab2('0x31')]);_0x1e9e29[_0x0ab2('0x33')]=_['intersection'](_0x1e9e29['model'],_0x1e9e29[_0x0ab2('0x31')]);_0x4eae4[_0x0ab2('0x36')]=_['intersection'](_0x1e9e29[_0x0ab2('0x35')],qs[_0x0ab2('0x37')](_0x26cf47[_0x0ab2('0x31')][_0x0ab2('0x37')]));_0x4eae4[_0x0ab2('0x36')]=_0x4eae4[_0x0ab2('0x36')]['length']?_0x4eae4[_0x0ab2('0x36')]:_0x1e9e29[_0x0ab2('0x35')];if(_0x26cf47[_0x0ab2('0x31')][_0x0ab2('0x43')]){_0x4eae4['include']=[{'all':!![]}];}_0x4eae4=_['merge']({},_0x4eae4,_0x26cf47[_0x0ab2('0x42')]);return db['Plugin']['find'](_0x4eae4)[_0x0ab2('0x24')](handleEntityNotFound(_0x5a3803,null))[_0x0ab2('0x24')](respondWithResult(_0x5a3803,null))[_0x0ab2('0x48')](handleError(_0x5a3803,null));};exports[_0x0ab2('0x49')]=function(_0x15bae,_0x3bce81,_0x20fd12){return db[_0x0ab2('0x45')][_0x0ab2('0x4a')]({'where':{'id':_0x15bae[_0x0ab2('0x4b')]['id']},'attributes':[_0x0ab2('0x2a'),'path'],'raw':!![]})[_0x0ab2('0x24')](handleEntityNotFound(_0x3bce81,null))[_0x0ab2('0x24')](function(_0x4273fd){if(_0x4273fd){var _0x3ba163=path[_0x0ab2('0x4c')](config[_0x0ab2('0x4d')],_0x0ab2('0x4e'),util[_0x0ab2('0x4f')](_0x0ab2('0x50'),path[_0x0ab2('0x51')](_0x4273fd[_0x0ab2('0x5')])));var _0x52135b=fs['createWriteStream'](_0x3ba163);var _0x38d4d=archiver(_0x0ab2('0x52'),{'zlib':{'level':0x9}});_0x38d4d['on'](_0x0ab2('0x53'),function(_0x58fbb0){if(_0x58fbb0[_0x0ab2('0x54')]===_0x0ab2('0x55')){logger[_0x0ab2('0x56')](_0x58fbb0);}else{throw new db['Sequelize']['Error'](_0x0ab2('0x57'));}});_0x38d4d['on'](_0x0ab2('0x56'),function(_0x302bb0){throw new db[(_0x0ab2('0x58'))][(_0x0ab2('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x38d4d[_0x0ab2('0x5a')](_0x52135b);_0x38d4d['glob'](_0x0ab2('0x5b'),{'cwd':path[_0x0ab2('0x4c')](config[_0x0ab2('0x4d')],_0x0ab2('0x4e'),path['dirname'](_0x4273fd[_0x0ab2('0x5')])),'ignore':[path[_0x0ab2('0x4c')](path['basename'](_0x4273fd[_0x0ab2('0x5')]),_0x0ab2('0x5c')),path[_0x0ab2('0x4c')](path[_0x0ab2('0x51')](_0x4273fd[_0x0ab2('0x5')]),_0x0ab2('0x5d'))],'nodir':!![]})[_0x0ab2('0x5e')]();_0x52135b['on'](_0x0ab2('0x5f'),function(){if(!fs[_0x0ab2('0x60')](_0x3ba163)){throw new db[(_0x0ab2('0x58'))][(_0x0ab2('0x59'))](_0x0ab2('0x61'));}return _0x3bce81[_0x0ab2('0x49')](_0x3ba163,util[_0x0ab2('0x4f')](_0x0ab2('0x50'),path[_0x0ab2('0x51')](_0x4273fd[_0x0ab2('0x5')])),function(_0x564e4a){if(_0x564e4a){throw new db[(_0x0ab2('0x58'))][(_0x0ab2('0x59'))](_0x0ab2('0x62'));}fs[_0x0ab2('0x63')](_0x3ba163);logger[_0x0ab2('0x64')](_0x0ab2('0x65'));logger[_0x0ab2('0x64')](_0x0ab2('0x66'));});});}return null;})[_0x0ab2('0x48')](handleError(_0x3bce81,null));};exports[_0x0ab2('0x67')]=function(_0x56aebb,_0x48b706,_0x2dd55d){var _0x2289f3=path[_0x0ab2('0x51')](_0x56aebb[_0x0ab2('0x68')]['filename'],path['extname'](_0x56aebb['file'][_0x0ab2('0x69')]));var _0x54163d=path[_0x0ab2('0x4c')](config[_0x0ab2('0x4d')],_0x0ab2('0x4e'),_0x56aebb[_0x0ab2('0x68')][_0x0ab2('0x69')]);var _0x1a3fe0=path[_0x0ab2('0x4c')](config[_0x0ab2('0x4d')],_0x0ab2('0x4e'),_0x2289f3);logger[_0x0ab2('0x64')](_0x0ab2('0x6a'),_0x54163d);logger['info'](_0x0ab2('0x6b'),_0x1a3fe0);try{fs[_0x0ab2('0x6c')](_0x54163d,parseInt(_0x0ab2('0x6d'),0x8));extract(_0x54163d,{'dir':_0x1a3fe0},function(_0x3d6909){if(_0x3d6909){logger[_0x0ab2('0x56')](_0x3d6909);handleError(_0x3d6909,!![]);};var _0x5f4803=fs[_0x0ab2('0x6e')](_0x1a3fe0);if(_0x5f4803[_0x0ab2('0x38')]>0x1){removeReferences(_0x54163d,_0x1a3fe0);logger['error']('Invalid\x20plugin\x20structure');return _0x2dd55d(new Error('Invalid\x20plugin\x20structure'));}var _0x1964f9=fs[_0x0ab2('0x6f')](path[_0x0ab2('0x4c')](_0x1a3fe0,_0x5f4803[0x0]));if(_0x1964f9[_0x0ab2('0x70')]()){removeReferences(_0x54163d,_0x1a3fe0);logger[_0x0ab2('0x56')](_0x0ab2('0x71'));return _0x2dd55d(new Error(_0x0ab2('0x71')));}if(_0x1964f9[_0x0ab2('0x72')]()){var _0x3dcb46=fs[_0x0ab2('0x6e')](path[_0x0ab2('0x4c')](_0x1a3fe0,_0x5f4803[0x0]));if(_0x3dcb46['length']===0x0){removeReferences(_0x54163d,_0x1a3fe0);logger['error'](_0x0ab2('0x71'));return _0x2dd55d(new Error(_0x0ab2('0x71')));}var _0xb5f1b7=_0x3dcb46['some'](function(_0x116490){return _0x116490==='manifest.json';});if(!_0xb5f1b7){return _0x2dd55d(new Error('Plugin\x20manifest\x20missing'));}var _0x91809f=fs[_0x0ab2('0x73')](path[_0x0ab2('0x4c')](_0x1a3fe0,_0x5f4803[0x0],'manifest.json'));var _0x2e32c5=JSON[_0x0ab2('0x74')](_0x91809f);if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x2a')]){return _0x2dd55d(new Error(_0x0ab2('0x75')));}if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x2f')]){return _0x2dd55d(new Error(_0x0ab2('0x76')));}if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x77')]){return _0x2dd55d(new Error(_0x0ab2('0x78')));}if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x79')]){return _0x2dd55d(new Error(_0x0ab2('0x7a')));}if(_0x2e32c5[_0x0ab2('0x2f')]===_0x0ab2('0x7b')){if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x7c')]){return _0x2dd55d(new Error(_0x0ab2('0x7d')));}if(_0x0ab2('0x1e')==typeof _0x2e32c5['parameters'][_0x0ab2('0x7c')][_0x0ab2('0x7e')]&&_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x7c')]['agent']){return _0x2dd55d(new Error(_0x0ab2('0x7f')));}}else if(_0x2e32c5[_0x0ab2('0x2f')]==='script'){if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x80')]){return _0x2dd55d(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x0ab2('0x1e')==typeof _0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x81')]){return _0x2dd55d(new Error(_0x0ab2('0x82')));}}else{return _0x2dd55d(new Error(_0x0ab2('0x83')));}var _0x16ceb1=_0x2e32c5[_0x0ab2('0x2a')];var _0x25a14d=_0x2e32c5['description'];var _0x445fa7=_0x2e32c5[_0x0ab2('0x2f')];var _0x3d9886=_0x2e32c5[_0x0ab2('0x84')]?_0x2e32c5[_0x0ab2('0x84')]:_0x0ab2('0x85');var _0x2f55b1=_0x2e32c5['icon']?_0x2e32c5[_0x0ab2('0x86')]:_0x0ab2('0x87');var _0x5d56e2='';var _0x98b2c9='';var _0x1566d1='';var _0x40aa52='';var _0x2c1099=_0x2e32c5[_0x0ab2('0x77')];if(_0x445fa7===_0x0ab2('0x7b')){if(_0x0ab2('0x1e')!=typeof _0x2e32c5[_0x0ab2('0x79')]['views'][_0x0ab2('0x7e')]){var _0xd1332b=_0x2e32c5[_0x0ab2('0x79')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x0ab2('0x88')](_0xd1332b)){_0x5d56e2=path['join'](_0x0ab2('0x89'),_0x2289f3,_0x5f4803[0x0],_0xd1332b);}else{_0x5d56e2=_0xd1332b;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x2e32c5['parameters'][_0x0ab2('0x7c')][_0x0ab2('0x8a')]){var _0x351d32=_0x2e32c5[_0x0ab2('0x79')]['views'][_0x0ab2('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x0ab2('0x88')](_0x351d32)){_0x98b2c9=path[_0x0ab2('0x4c')](_0x0ab2('0x89'),_0x2289f3,_0x5f4803[0x0],_0x351d32);}else{_0x98b2c9=_0x351d32;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x445fa7==='script'){_0x1566d1=_0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x80')];_0x40aa52=_0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x81')];if(_0x0ab2('0x1e')!=typeof _0x2e32c5['parameters'][_0x0ab2('0x7c')]){if(_0x0ab2('0x1e')!=typeof _0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x7c')][_0x0ab2('0x7e')]){var _0xd1332b=_0x2e32c5[_0x0ab2('0x79')][_0x0ab2('0x7c')][_0x0ab2('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x0ab2('0x88')](_0xd1332b)){_0x5d56e2=path[_0x0ab2('0x4c')](_0x0ab2('0x89'),_0x2289f3,_0x5f4803[0x0],_0xd1332b);}else{_0x5d56e2=_0xd1332b;}}if(_0x0ab2('0x1e')!=typeof _0x2e32c5[_0x0ab2('0x79')]['views'][_0x0ab2('0x8a')]){var _0x351d32=_0x2e32c5['parameters']['views'][_0x0ab2('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x0ab2('0x88')](_0x351d32)){_0x98b2c9=path['join'](_0x0ab2('0x89'),_0x2289f3,_0x5f4803[0x0],_0x351d32);}else{_0x98b2c9=_0x351d32;}}}}var _0x112e4d={'name':_0x16ceb1,'description':_0x25a14d,'path':path['join'](_0x2289f3,_0x5f4803[0x0]),'type':_0x445fa7,'sidebar':_0x3d9886,'icon':_0x2f55b1,'adminUrl':_0x5d56e2,'agentUrl':_0x98b2c9,'scriptName':_0x1566d1,'scriptPath':_0x40aa52,'version':_0x2c1099};removeReferences(_0x54163d,null);return db[_0x0ab2('0x45')][_0x0ab2('0x8b')](_0x112e4d)[_0x0ab2('0x24')](function(_0xf03fcb){var _0x139485={'role':_0x56aebb[_0x0ab2('0x8c')][_0x0ab2('0x8d')],'userProfileId':_0x56aebb[_0x0ab2('0x8c')][_0x0ab2('0x8e')]};if(!_0x139485)throw new Error(_0x0ab2('0x8f'));if(_0x139485['role']==='user'){var _0x224352=_0xf03fcb['get']({'plain':!![]});return db['UserProfileSection'][_0x0ab2('0x4a')]({'where':{'name':'Plugins','userProfileId':_0x139485[_0x0ab2('0x8e')]},'raw':!![]})['then'](function(_0x200ddb){if(_0x200ddb&&_0x200ddb[_0x0ab2('0x90')]===0x0){return db[_0x0ab2('0x28')][_0x0ab2('0x8b')]({'name':_0x224352[_0x0ab2('0x2a')],'resourceId':_0x224352['id'],'type':_0x200ddb['name'],'sectionId':_0x200ddb['id']},{})[_0x0ab2('0x24')](function(){return _0xf03fcb;});}else{return _0xf03fcb;}})[_0x0ab2('0x48')](function(_0x8db87){logger['error'](_0x0ab2('0x91'),_0x8db87);throw _0x8db87;});}return _0xf03fcb;})[_0x0ab2('0x24')](respondWithResult(_0x48b706,null))[_0x0ab2('0x48')](handleError(_0x48b706,null));}});}catch(_0x41b5fe){_0x48b706[_0x0ab2('0x1b')](0x1f4)[_0x0ab2('0x2b')](_0x41b5fe);}};function removeReferences(_0x3a22dc,_0x30d475){try{if(_0x3a22dc){fs[_0x0ab2('0x63')](_0x3a22dc);logger[_0x0ab2('0x64')]('Zip\x20archive\x20removed');}if(_0x30d475){rimraf(_0x30d475,function(){});logger[_0x0ab2('0x64')](_0x0ab2('0x92'));}}catch(_0x417855){logger[_0x0ab2('0x56')](_0x417855);}}exports[_0x0ab2('0x23')]=function(_0x22e3ca,_0xb17892,_0x1f0b5b){return db[_0x0ab2('0x45')][_0x0ab2('0x4a')]({'where':{'id':_0x22e3ca[_0x0ab2('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb17892,null))[_0x0ab2('0x24')](saveUpdates(_0x22e3ca[_0x0ab2('0x8c')],null))[_0x0ab2('0x24')](respondWithResult(_0xb17892,null))[_0x0ab2('0x48')](handleError(_0xb17892,null));};exports['delete']=function(_0x5b538b,_0x58fe65,_0x4296b7){return db[_0x0ab2('0x45')][_0x0ab2('0x4a')]({'where':{'id':_0x5b538b[_0x0ab2('0x4b')]['id']}})[_0x0ab2('0x24')](function(_0x11631d){if(_0x11631d){return _0x11631d[_0x0ab2('0x25')]();}})[_0x0ab2('0x24')](function(_0x505029){rimraf(path[_0x0ab2('0x4c')](config[_0x0ab2('0x4d')],_0x0ab2('0x4e'),path[_0x0ab2('0x93')](_0x505029[_0x0ab2('0x5')])),function(){});return _0x505029;})[_0x0ab2('0x24')](handleEntityNotFound(_0x58fe65,null))[_0x0ab2('0x24')](respondWithStatusCode(_0x58fe65,null))[_0x0ab2('0x48')](handleError(_0x58fe65,null));};exports[_0x0ab2('0x94')]=function(_0x277ebb,_0xd8bd16,_0x445cf1){return BPromise[_0x0ab2('0x95')]()[_0x0ab2('0x24')](function(){if(!_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x5')]){throw new Error(_0x0ab2('0x96'));}if(!_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x97')]){throw new Error(_0x0ab2('0x98'));}var _0x1bf1ca=_0x277ebb[_0x0ab2('0x31')]['hostname']?_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x99')]+':'+_0x277ebb['query'][_0x0ab2('0x97')]:_0x0ab2('0x9a')+_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x97')];var _0x2a0092=_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x1c')]?_0x277ebb[_0x0ab2('0x31')]['json']:!![];var _0x3b3a00=_0x277ebb['query'][_0x0ab2('0x9b')]?_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x9b')]:null;var _0x5579d1={'method':_0x277ebb[_0x0ab2('0x9c')],'uri':util[_0x0ab2('0x4f')](_0x0ab2('0x9d'),_0x1bf1ca,_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x5')]),'json':_0x2a0092,'resolveWithFullResponse':!![],'encoding':_0x3b3a00,'qs':_0x277ebb[_0x0ab2('0x31')]};if(_0x277ebb[_0x0ab2('0x9e')]){_0x5579d1[_0x0ab2('0x9e')]=_0x277ebb[_0x0ab2('0x9e')];if(_0x5579d1[_0x0ab2('0x9e')][_0x0ab2('0x9f')]){delete _0x5579d1['headers']['content-length'];}}if(_0x5579d1[_0x0ab2('0x9e')][_0x0ab2('0xa0')]){delete _0x5579d1[_0x0ab2('0x9e')]['content-type'];}return rp(_0x5579d1);})[_0x0ab2('0x24')](function(_0x4b2a09){if(_0x4b2a09){_0xd8bd16[_0x0ab2('0x21')](_0x4b2a09[_0x0ab2('0x9e')]);logger[_0x0ab2('0x64')](_0x4b2a09[_0x0ab2('0x8c')]);if(_[_0x0ab2('0xa1')](_0x277ebb[_0x0ab2('0x31')][_0x0ab2('0x5')],_0x0ab2('0x49'))&&_0x4b2a09[_0x0ab2('0xa2')]==0x1f4){return _0xd8bd16['sendStatus'](_0x4b2a09[_0x0ab2('0xa2')]);}else{return _0xd8bd16[_0x0ab2('0x1b')](_0x4b2a09['statusCode'])[_0x0ab2('0x2b')](_0x4b2a09[_0x0ab2('0x8c')]);}}else{return _0xd8bd16[_0x0ab2('0x1a')](0xc8);}})[_0x0ab2('0x48')](handleError(_0xd8bd16,null));};exports['webhookPost']=function(_0x173fde,_0x552ab0,_0x3eee3a){return BPromise[_0x0ab2('0x95')]()[_0x0ab2('0x24')](function(){if(!_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x5')]){throw new Error(_0x0ab2('0x96'));}if(!_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x97')]){throw new Error(_0x0ab2('0x98'));}var _0x4e93eb=_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x99')]?_0x173fde[_0x0ab2('0x31')]['hostname']+':'+_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x97')]:_0x0ab2('0x9a')+_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x97')];var _0x114fe8=_0x173fde[_0x0ab2('0x31')]['json']?_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x1c')]:!![];var _0x699302=_0x173fde['query']['encoding']?_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x9b')]:null;var _0x41520e={'method':_0x173fde[_0x0ab2('0x9c')],'uri':util['format'](_0x0ab2('0x9d'),_0x4e93eb,_0x173fde[_0x0ab2('0x31')][_0x0ab2('0x5')]),'json':_0x114fe8,'resolveWithFullResponse':!![],'encoding':_0x699302,'body':_0x173fde[_0x0ab2('0x8c')]};if(_0x173fde['headers']){_0x41520e[_0x0ab2('0x9e')]=_0x173fde[_0x0ab2('0x9e')];if(_0x41520e[_0x0ab2('0x9e')][_0x0ab2('0x9f')]){delete _0x41520e[_0x0ab2('0x9e')][_0x0ab2('0x9f')];}}if(_0x41520e[_0x0ab2('0x9e')][_0x0ab2('0xa0')]){delete _0x41520e[_0x0ab2('0x9e')]['content-type'];}return rp(_0x41520e);})[_0x0ab2('0x24')](function(_0x513733){if(_0x513733){_0x552ab0['set'](_0x513733['headers']);logger[_0x0ab2('0x64')](_0x513733[_0x0ab2('0x8c')]);return _0x552ab0[_0x0ab2('0x1b')](_0x513733[_0x0ab2('0xa2')])['send'](_0x513733[_0x0ab2('0x8c')]);}else{return _0x552ab0[_0x0ab2('0x1a')](0xc8);}})[_0x0ab2('0x48')](handleError(_0x552ab0,null));}; \ No newline at end of file +var _0x52f9=['Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','role','UserProfileSection','find','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','endsWith','statusCode','send','webhookPost','method','%s%s','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Plugins','error','stack','name','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys','include','catch','download','path','join','format','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','root','server/files/plugins','dirname','node_modules/**/*','basename','attachments/**/*','close','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','version'];(function(_0x46c311,_0xe0d35a){var _0x1e6326=function(_0x2d01ad){while(--_0x2d01ad){_0x46c311['push'](_0x46c311['shift']());}};_0x1e6326(++_0xe0d35a);}(_0x52f9,0xd8));var _0x952f=function(_0x347233,_0x41caed){_0x347233=_0x347233-0x0;var _0x39e06c=_0x52f9[_0x347233];return _0x39e06c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x952f('0x0'));var zipdir=require(_0x952f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x952f('0x2'));var moment=require(_0x952f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x952f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x952f('0x5'));var csv=require(_0x952f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x952f('0x7'));var _=require(_0x952f('0x8'));var squel=require(_0x952f('0x9'));var crypto=require(_0x952f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x952f('0xb'));var toCsv=require(_0x952f('0x6'));var querystring=require(_0x952f('0xc'));var Papa=require('papaparse');var extract=require(_0x952f('0xd'));var rimraf=require(_0x952f('0x0'));var archiver=require(_0x952f('0xe'));var Redis=require(_0x952f('0xf'));var authService=require(_0x952f('0x10'));var qs=require(_0x952f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x952f('0x12'));var logger=require(_0x952f('0x13'))(_0x952f('0x14'));var utils=require('../../config/utils');var config=require(_0x952f('0x15'));var licenseUtil=require(_0x952f('0x16'));var db=require(_0x952f('0x17'))['db'];config['redis']=_[_0x952f('0x18')](config[_0x952f('0x19')],{'host':_0x952f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x952f('0x1b'))[_0x952f('0x1c')](socket);function respondWithStatusCode(_0x1cccc5,_0x55104c){_0x55104c=_0x55104c||0xcc;return function(_0x1cea0b){if(_0x1cea0b){return _0x1cccc5[_0x952f('0x1d')](_0x55104c);}return _0x1cccc5['status'](_0x55104c)[_0x952f('0x1e')]();};}function respondWithResult(_0x273559,_0x23280b){_0x23280b=_0x23280b||0xc8;return function(_0x5c4ac5){if(_0x5c4ac5){return _0x273559[_0x952f('0x1f')](_0x23280b)[_0x952f('0x20')](_0x5c4ac5);}};}function respondWithFilteredResult(_0x31d756,_0x30c04c){return function(_0x429170){if(_0x429170){var _0x5e9e7d=typeof _0x30c04c[_0x952f('0x21')]===_0x952f('0x22')&&typeof _0x30c04c[_0x952f('0x23')]===_0x952f('0x22');var _0x2ae0a4=_0x429170['count'];var _0x423e1b=_0x5e9e7d?0x0:_0x30c04c[_0x952f('0x21')];var _0x4bae36=_0x5e9e7d?_0x429170[_0x952f('0x24')]:_0x30c04c[_0x952f('0x21')]+_0x30c04c[_0x952f('0x23')];var _0x52eaad;if(_0x4bae36>=_0x2ae0a4){_0x4bae36=_0x2ae0a4;_0x52eaad=0xc8;}else{_0x52eaad=0xce;}_0x31d756['status'](_0x52eaad);return _0x31d756[_0x952f('0x25')](_0x952f('0x26'),_0x423e1b+'-'+_0x4bae36+'/'+_0x2ae0a4)[_0x952f('0x20')](_0x429170);}return null;};}function patchUpdates(_0x432216){return function(_0x79aef2){try{jsonpatch['apply'](_0x79aef2,_0x432216,!![]);}catch(_0x4ff79d){return BPromise[_0x952f('0x27')](_0x4ff79d);}return _0x79aef2[_0x952f('0x28')]();};}function saveUpdates(_0x34ad51,_0x4de91f){return function(_0x29e517){if(_0x29e517){return _0x29e517[_0x952f('0x29')](_0x34ad51)['then'](function(_0x46720b){return _0x46720b;});}return null;};}function removeEntity(_0x46c9e6,_0x399fe3){return function(_0x3f7026){if(_0x3f7026){return _0x3f7026[_0x952f('0x2a')]()[_0x952f('0x2b')](function(){var _0xae97ea=_0x3f7026[_0x952f('0x2c')]({'plain':!![]});var _0x1c535c=_0x952f('0x2d');return db['UserProfileResource'][_0x952f('0x2a')]({'where':{'type':_0x1c535c,'resourceId':_0xae97ea['id']}})[_0x952f('0x2b')](function(){return _0x3f7026;});})[_0x952f('0x2b')](function(){_0x46c9e6[_0x952f('0x1f')](0xcc)[_0x952f('0x1e')]();});}};}function handleEntityNotFound(_0x6e6079,_0x28b548){return function(_0x9a48ac){if(!_0x9a48ac){_0x6e6079[_0x952f('0x1d')](0x194);}return _0x9a48ac;};}function handleError(_0x13fe4f,_0x4bd08d){_0x4bd08d=_0x4bd08d||0x1f4;return function(_0x30cf07){logger[_0x952f('0x2e')](_0x30cf07[_0x952f('0x2f')]);if(_0x30cf07[_0x952f('0x30')]){delete _0x30cf07[_0x952f('0x30')];}_0x13fe4f[_0x952f('0x1f')](_0x4bd08d)['send'](_0x30cf07);};}exports['index']=function(_0x5952db,_0x1d03fb){var _0x5b592b={},_0xf43f={},_0x1c4691={'count':0x0,'rows':[]};var _0x3df04f=_[_0x952f('0x31')](db[_0x952f('0x32')][_0x952f('0x33')],function(_0x56218e){return{'name':_0x56218e[_0x952f('0x34')],'type':_0x56218e[_0x952f('0x35')][_0x952f('0x36')]};});_0xf43f[_0x952f('0x37')]=_['map'](_0x3df04f,_0x952f('0x30'));_0xf43f[_0x952f('0x38')]=_['keys'](_0x5952db[_0x952f('0x38')]);_0xf43f[_0x952f('0x39')]=_[_0x952f('0x3a')](_0xf43f[_0x952f('0x37')],_0xf43f[_0x952f('0x38')]);_0x5b592b[_0x952f('0x3b')]=_[_0x952f('0x3a')](_0xf43f['model'],qs[_0x952f('0x3c')](_0x5952db['query'][_0x952f('0x3c')]));_0x5b592b[_0x952f('0x3b')]=_0x5b592b[_0x952f('0x3b')][_0x952f('0x3d')]?_0x5b592b[_0x952f('0x3b')]:_0xf43f[_0x952f('0x37')];if(!_0x5952db[_0x952f('0x38')]['hasOwnProperty'](_0x952f('0x3e'))){_0x5b592b[_0x952f('0x23')]=qs['limit'](_0x5952db[_0x952f('0x38')]['limit']);_0x5b592b[_0x952f('0x21')]=qs[_0x952f('0x21')](_0x5952db[_0x952f('0x38')][_0x952f('0x21')]);}_0x5b592b[_0x952f('0x3f')]=qs[_0x952f('0x40')](_0x5952db[_0x952f('0x38')][_0x952f('0x40')]);_0x5b592b[_0x952f('0x41')]=qs[_0x952f('0x39')](_[_0x952f('0x42')](_0x5952db[_0x952f('0x38')],_0xf43f[_0x952f('0x39')]),_0x3df04f);if(_0x5952db['query']['filter']){_0x5b592b[_0x952f('0x41')]=_[_0x952f('0x43')](_0x5b592b[_0x952f('0x41')],{'$or':_[_0x952f('0x31')](_0x3df04f,function(_0x1f519f){if(_0x1f519f[_0x952f('0x35')]!==_0x952f('0x44')){var _0x5eba87={};_0x5eba87[_0x1f519f['name']]={'$like':'%'+_0x5952db[_0x952f('0x38')][_0x952f('0x45')]+'%'};return _0x5eba87;}})});}_0x5b592b=_[_0x952f('0x43')]({},_0x5b592b,_0x5952db[_0x952f('0x46')]);var _0xcd411e={'where':_0x5b592b[_0x952f('0x41')]};return db['Plugin'][_0x952f('0x24')](_0xcd411e)[_0x952f('0x2b')](function(_0x4d973f){_0x1c4691[_0x952f('0x24')]=_0x4d973f;if(_0x5952db['query'][_0x952f('0x47')]){_0x5b592b['include']=[{'all':!![]}];}return db['Plugin'][_0x952f('0x48')](_0x5b592b);})[_0x952f('0x2b')](function(_0x3adb0c){_0x1c4691[_0x952f('0x49')]=_0x3adb0c;return _0x1c4691;})[_0x952f('0x2b')](respondWithFilteredResult(_0x1d03fb,_0x5b592b))['catch'](handleError(_0x1d03fb,null));};exports[_0x952f('0x4a')]=function(_0x14010e,_0x24341f){var _0x5c4b0a={'raw':!![],'where':{'id':_0x14010e[_0x952f('0x4b')]['id']}},_0x2beb49={};_0x2beb49[_0x952f('0x37')]=_[_0x952f('0x4c')](db[_0x952f('0x32')][_0x952f('0x33')]);_0x2beb49[_0x952f('0x38')]=_['keys'](_0x14010e[_0x952f('0x38')]);_0x2beb49[_0x952f('0x39')]=_[_0x952f('0x3a')](_0x2beb49[_0x952f('0x37')],_0x2beb49['query']);_0x5c4b0a['attributes']=_[_0x952f('0x3a')](_0x2beb49[_0x952f('0x37')],qs['fields'](_0x14010e[_0x952f('0x38')][_0x952f('0x3c')]));_0x5c4b0a[_0x952f('0x3b')]=_0x5c4b0a[_0x952f('0x3b')][_0x952f('0x3d')]?_0x5c4b0a[_0x952f('0x3b')]:_0x2beb49[_0x952f('0x37')];if(_0x14010e[_0x952f('0x38')][_0x952f('0x47')]){_0x5c4b0a[_0x952f('0x4d')]=[{'all':!![]}];}_0x5c4b0a=_['merge']({},_0x5c4b0a,_0x14010e[_0x952f('0x46')]);return db[_0x952f('0x32')]['find'](_0x5c4b0a)[_0x952f('0x2b')](handleEntityNotFound(_0x24341f,null))[_0x952f('0x2b')](respondWithResult(_0x24341f,null))[_0x952f('0x4e')](handleError(_0x24341f,null));};exports[_0x952f('0x4f')]=function(_0x216c0c,_0x107117,_0x568512){return db['Plugin']['find']({'where':{'id':_0x216c0c[_0x952f('0x4b')]['id']},'attributes':[_0x952f('0x30'),_0x952f('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x107117,null))[_0x952f('0x2b')](function(_0x4218af){if(_0x4218af){var _0x591858=path[_0x952f('0x51')](config['root'],'server/files/plugins',util[_0x952f('0x52')]('%s.zip',path['basename'](_0x4218af['path'])));var _0x4d02f6=fs[_0x952f('0x53')](_0x591858);var _0xf89783=archiver(_0x952f('0x54'),{'zlib':{'level':0x9}});_0xf89783['on'](_0x952f('0x55'),function(_0x50bdfe){if(_0x50bdfe[_0x952f('0x56')]===_0x952f('0x57')){logger[_0x952f('0x2e')](_0x50bdfe);}else{throw new db[(_0x952f('0x58'))]['Error'](_0x952f('0x59'));}});_0xf89783['on'](_0x952f('0x2e'),function(_0x3a4ecf){throw new db['Sequelize'][(_0x952f('0x5a'))](_0x952f('0x59'));});_0xf89783[_0x952f('0x5b')](_0x4d02f6);_0xf89783[_0x952f('0x5c')]('**/*',{'cwd':path[_0x952f('0x51')](config[_0x952f('0x5d')],_0x952f('0x5e'),path[_0x952f('0x5f')](_0x4218af[_0x952f('0x50')])),'ignore':[path[_0x952f('0x51')](path['basename'](_0x4218af[_0x952f('0x50')]),_0x952f('0x60')),path[_0x952f('0x51')](path[_0x952f('0x61')](_0x4218af[_0x952f('0x50')]),_0x952f('0x62'))],'nodir':!![]})['finalize']();_0x4d02f6['on'](_0x952f('0x63'),function(){if(!fs['existsSync'](_0x591858)){throw new db[(_0x952f('0x58'))][(_0x952f('0x5a'))](_0x952f('0x64'));}return _0x107117[_0x952f('0x4f')](_0x591858,util[_0x952f('0x52')](_0x952f('0x65'),path['basename'](_0x4218af['path'])),function(_0x492d15){if(_0x492d15){throw new db[(_0x952f('0x58'))][(_0x952f('0x5a'))](_0x952f('0x66'));}fs['unlinkSync'](_0x591858);logger[_0x952f('0x67')](_0x952f('0x68'));logger[_0x952f('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0x952f('0x4e')](handleError(_0x107117,null));};exports['upload']=function(_0x15ce97,_0x5e2b9b,_0x370ee2){var _0x4bff7e=path[_0x952f('0x61')](_0x15ce97[_0x952f('0x69')][_0x952f('0x6a')],path[_0x952f('0x6b')](_0x15ce97[_0x952f('0x69')]['filename']));var _0x5b2b81=path[_0x952f('0x51')](config[_0x952f('0x5d')],_0x952f('0x5e'),_0x15ce97[_0x952f('0x69')][_0x952f('0x6a')]);var _0x47d585=path['join'](config[_0x952f('0x5d')],_0x952f('0x5e'),_0x4bff7e);logger[_0x952f('0x67')](_0x952f('0x6c'),_0x5b2b81);logger[_0x952f('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x47d585);try{fs[_0x952f('0x6d')](_0x5b2b81,parseInt(_0x952f('0x6e'),0x8));extract(_0x5b2b81,{'dir':_0x47d585},function(_0x5eb44f){if(_0x5eb44f){logger['error'](_0x5eb44f);handleError(_0x5eb44f,!![]);};var _0x58190b=fs[_0x952f('0x6f')](_0x47d585);if(_0x58190b['length']>0x1){removeReferences(_0x5b2b81,_0x47d585);logger[_0x952f('0x2e')](_0x952f('0x70'));return _0x370ee2(new Error(_0x952f('0x70')));}var _0x545349=fs[_0x952f('0x71')](path[_0x952f('0x51')](_0x47d585,_0x58190b[0x0]));if(_0x545349['isFile']()){removeReferences(_0x5b2b81,_0x47d585);logger[_0x952f('0x2e')](_0x952f('0x70'));return _0x370ee2(new Error(_0x952f('0x70')));}if(_0x545349[_0x952f('0x72')]()){var _0x33d845=fs[_0x952f('0x6f')](path[_0x952f('0x51')](_0x47d585,_0x58190b[0x0]));if(_0x33d845[_0x952f('0x3d')]===0x0){removeReferences(_0x5b2b81,_0x47d585);logger[_0x952f('0x2e')]('Invalid\x20plugin\x20structure');return _0x370ee2(new Error('Invalid\x20plugin\x20structure'));}var _0x4573ae=_0x33d845[_0x952f('0x73')](function(_0x33f4df){return _0x33f4df==='manifest.json';});if(!_0x4573ae){return _0x370ee2(new Error(_0x952f('0x74')));}var _0x2aafe5=fs['readFileSync'](path['join'](_0x47d585,_0x58190b[0x0],_0x952f('0x75')));var _0x2508bc=JSON[_0x952f('0x76')](_0x2aafe5);if(_0x952f('0x22')==typeof _0x2508bc[_0x952f('0x30')]){return _0x370ee2(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x952f('0x22')==typeof _0x2508bc[_0x952f('0x35')]){return _0x370ee2(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x952f('0x22')==typeof _0x2508bc[_0x952f('0x77')]){return _0x370ee2(new Error(_0x952f('0x78')));}if(_0x952f('0x22')==typeof _0x2508bc[_0x952f('0x79')]){return _0x370ee2(new Error(_0x952f('0x7a')));}if(_0x2508bc[_0x952f('0x35')]==='html'){if(_0x952f('0x22')==typeof _0x2508bc['parameters'][_0x952f('0x7b')]){return _0x370ee2(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x7b')][_0x952f('0x7c')]&&'undefined'==typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x7b')]['agent']){return _0x370ee2(new Error(_0x952f('0x7d')));}}else if(_0x2508bc['type']===_0x952f('0x7e')){if(_0x952f('0x22')==typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x7f')]){return _0x370ee2(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x80')]){return _0x370ee2(new Error(_0x952f('0x81')));}}else{return _0x370ee2(new Error(_0x952f('0x82')));}var _0x37aeaa=_0x2508bc[_0x952f('0x30')];var _0x244452=_0x2508bc[_0x952f('0x83')];var _0xa06ceb=_0x2508bc[_0x952f('0x35')];var _0x321597=_0x2508bc[_0x952f('0x84')]?_0x2508bc[_0x952f('0x84')]:_0x952f('0x85');var _0x4d7257=_0x2508bc[_0x952f('0x86')]?_0x2508bc['icon']:_0x952f('0x87');var _0x1707d9='';var _0x33634c='';var _0xae5e03='';var _0x44729e='';var _0x2bcaa7=_0x2508bc[_0x952f('0x77')];if(_0xa06ceb===_0x952f('0x88')){if(_0x952f('0x22')!=typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x7b')]['admin']){var _0x5ef414=_0x2508bc[_0x952f('0x79')][_0x952f('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x952f('0x89')](_0x5ef414)){_0x1707d9=path['join']('plugins',_0x4bff7e,_0x58190b[0x0],_0x5ef414);}else{_0x1707d9=_0x5ef414;}}else{logger[_0x952f('0x67')](_0x952f('0x8a'));}if(_0x952f('0x22')!=typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x7b')]['agent']){var _0x2e7273=_0x2508bc['parameters'][_0x952f('0x7b')][_0x952f('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2e7273)){_0x33634c=path[_0x952f('0x51')](_0x952f('0x8c'),_0x4bff7e,_0x58190b[0x0],_0x2e7273);}else{_0x33634c=_0x2e7273;}}else{logger[_0x952f('0x67')](_0x952f('0x8d'));}}else if(_0xa06ceb===_0x952f('0x7e')){_0xae5e03=_0x2508bc[_0x952f('0x79')][_0x952f('0x7f')];_0x44729e=_0x2508bc['parameters'][_0x952f('0x80')];if(_0x952f('0x22')!=typeof _0x2508bc[_0x952f('0x79')]['views']){if(_0x952f('0x22')!=typeof _0x2508bc['parameters'][_0x952f('0x7b')][_0x952f('0x7c')]){var _0x5ef414=_0x2508bc['parameters']['views'][_0x952f('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x952f('0x89')](_0x5ef414)){_0x1707d9=path[_0x952f('0x51')](_0x952f('0x8c'),_0x4bff7e,_0x58190b[0x0],_0x5ef414);}else{_0x1707d9=_0x5ef414;}}if('undefined'!=typeof _0x2508bc[_0x952f('0x79')][_0x952f('0x7b')][_0x952f('0x8b')]){var _0x2e7273=_0x2508bc[_0x952f('0x79')][_0x952f('0x7b')][_0x952f('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2e7273)){_0x33634c=path[_0x952f('0x51')]('plugins',_0x4bff7e,_0x58190b[0x0],_0x2e7273);}else{_0x33634c=_0x2e7273;}}}}var _0x4b939c={'name':_0x37aeaa,'description':_0x244452,'path':path['join'](_0x4bff7e,_0x58190b[0x0]),'type':_0xa06ceb,'sidebar':_0x321597,'icon':_0x4d7257,'adminUrl':_0x1707d9,'agentUrl':_0x33634c,'scriptName':_0xae5e03,'scriptPath':_0x44729e,'version':_0x2bcaa7};removeReferences(_0x5b2b81,null);return db[_0x952f('0x32')]['create'](_0x4b939c)[_0x952f('0x2b')](function(_0x4fdcbe){var _0x45bda5={'role':_0x15ce97[_0x952f('0x8e')]['role'],'userProfileId':_0x15ce97[_0x952f('0x8e')][_0x952f('0x8f')]};if(!_0x45bda5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45bda5[_0x952f('0x90')]==='user'){var _0x51f7fa=_0x4fdcbe['get']({'plain':!![]});return db[_0x952f('0x91')][_0x952f('0x92')]({'where':{'name':_0x952f('0x2d'),'userProfileId':_0x45bda5['userProfileId']},'raw':!![]})[_0x952f('0x2b')](function(_0x44da95){if(_0x44da95&&_0x44da95['autoAssociation']===0x0){return db['UserProfileResource'][_0x952f('0x93')]({'name':_0x51f7fa[_0x952f('0x30')],'resourceId':_0x51f7fa['id'],'type':_0x44da95['name'],'sectionId':_0x44da95['id']},{})[_0x952f('0x2b')](function(){return _0x4fdcbe;});}else{return _0x4fdcbe;}})[_0x952f('0x4e')](function(_0x5710e1){logger[_0x952f('0x2e')](_0x952f('0x94'),_0x5710e1);throw _0x5710e1;});}return _0x4fdcbe;})[_0x952f('0x2b')](respondWithResult(_0x5e2b9b,null))[_0x952f('0x4e')](handleError(_0x5e2b9b,null));}});}catch(_0x4f8a41){_0x5e2b9b[_0x952f('0x1f')](0x1f4)['send'](_0x4f8a41);}};function removeReferences(_0x4c887a,_0x4a2766){try{if(_0x4c887a){fs['unlinkSync'](_0x4c887a);logger[_0x952f('0x67')](_0x952f('0x95'));}if(_0x4a2766){rimraf(_0x4a2766,function(){});logger[_0x952f('0x67')](_0x952f('0x96'));}}catch(_0x59361f){logger[_0x952f('0x2e')](_0x59361f);}}exports[_0x952f('0x29')]=function(_0x248919,_0x2ec16d,_0x245691){return db[_0x952f('0x32')][_0x952f('0x92')]({'where':{'id':_0x248919[_0x952f('0x4b')]['id']}})[_0x952f('0x2b')](handleEntityNotFound(_0x2ec16d,null))[_0x952f('0x2b')](saveUpdates(_0x248919[_0x952f('0x8e')],null))[_0x952f('0x2b')](respondWithResult(_0x2ec16d,null))[_0x952f('0x4e')](handleError(_0x2ec16d,null));};exports[_0x952f('0x97')]=function(_0x3a36b1,_0xa727f2,_0x534426){return db[_0x952f('0x32')][_0x952f('0x92')]({'where':{'id':_0x3a36b1[_0x952f('0x4b')]['id']}})[_0x952f('0x2b')](function(_0x644bdb){if(_0x644bdb){return _0x644bdb[_0x952f('0x2a')]();}})[_0x952f('0x2b')](function(_0xb0817d){rimraf(path[_0x952f('0x51')](config['root'],_0x952f('0x5e'),path[_0x952f('0x5f')](_0xb0817d['path'])),function(){});return _0xb0817d;})[_0x952f('0x2b')](handleEntityNotFound(_0xa727f2,null))[_0x952f('0x2b')](respondWithStatusCode(_0xa727f2,null))[_0x952f('0x4e')](handleError(_0xa727f2,null));};exports['webhookGet']=function(_0x3ef1b7,_0x544149,_0x3241d9){return BPromise[_0x952f('0x98')]()['then'](function(){if(!_0x3ef1b7[_0x952f('0x38')][_0x952f('0x50')]){throw new Error(_0x952f('0x99'));}if(!_0x3ef1b7['query'][_0x952f('0x9a')]){throw new Error(_0x952f('0x9b'));}var _0x3b2141=_0x3ef1b7[_0x952f('0x38')][_0x952f('0x9c')]?_0x3ef1b7[_0x952f('0x38')][_0x952f('0x9c')]+':'+_0x3ef1b7[_0x952f('0x38')][_0x952f('0x9a')]:_0x952f('0x9d')+_0x3ef1b7[_0x952f('0x38')]['port'];var _0x2b8c9e=_0x3ef1b7[_0x952f('0x38')]['json']?_0x3ef1b7[_0x952f('0x38')][_0x952f('0x20')]:!![];var _0x6b0b3e=_0x3ef1b7[_0x952f('0x38')][_0x952f('0x9e')]?_0x3ef1b7[_0x952f('0x38')][_0x952f('0x9e')]:null;var _0xe5360a={'method':_0x3ef1b7['method'],'uri':util[_0x952f('0x52')]('%s%s',_0x3b2141,_0x3ef1b7[_0x952f('0x38')][_0x952f('0x50')]),'json':_0x2b8c9e,'resolveWithFullResponse':!![],'encoding':_0x6b0b3e,'qs':_0x3ef1b7[_0x952f('0x38')]};if(_0x3ef1b7[_0x952f('0x9f')]){_0xe5360a['headers']=_0x3ef1b7[_0x952f('0x9f')];if(_0xe5360a[_0x952f('0x9f')][_0x952f('0xa0')]){delete _0xe5360a['headers'][_0x952f('0xa0')];}}if(_0xe5360a[_0x952f('0x9f')][_0x952f('0xa1')]){delete _0xe5360a[_0x952f('0x9f')][_0x952f('0xa1')];}return rp(_0xe5360a);})[_0x952f('0x2b')](function(_0x359b36){if(_0x359b36){_0x544149['set'](_0x359b36[_0x952f('0x9f')]);logger['info'](_0x359b36['body']);if(_[_0x952f('0xa2')](_0x3ef1b7[_0x952f('0x38')][_0x952f('0x50')],_0x952f('0x4f'))&&_0x359b36[_0x952f('0xa3')]==0x1f4){return _0x544149['sendStatus'](_0x359b36[_0x952f('0xa3')]);}else{return _0x544149[_0x952f('0x1f')](_0x359b36['statusCode'])[_0x952f('0xa4')](_0x359b36[_0x952f('0x8e')]);}}else{return _0x544149['sendStatus'](0xc8);}})['catch'](handleError(_0x544149,null));};exports[_0x952f('0xa5')]=function(_0x392592,_0x27eb8f,_0x35a9de){return BPromise[_0x952f('0x98')]()['then'](function(){if(!_0x392592[_0x952f('0x38')][_0x952f('0x50')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x392592[_0x952f('0x38')][_0x952f('0x9a')]){throw new Error(_0x952f('0x9b'));}var _0x2c3cc3=_0x392592['query'][_0x952f('0x9c')]?_0x392592[_0x952f('0x38')][_0x952f('0x9c')]+':'+_0x392592['query'][_0x952f('0x9a')]:'http://localhost:'+_0x392592[_0x952f('0x38')][_0x952f('0x9a')];var _0xe9d7b=_0x392592[_0x952f('0x38')][_0x952f('0x20')]?_0x392592['query'][_0x952f('0x20')]:!![];var _0x573b31=_0x392592[_0x952f('0x38')]['encoding']?_0x392592[_0x952f('0x38')][_0x952f('0x9e')]:null;var _0x1b8251={'method':_0x392592[_0x952f('0xa6')],'uri':util['format'](_0x952f('0xa7'),_0x2c3cc3,_0x392592[_0x952f('0x38')]['path']),'json':_0xe9d7b,'resolveWithFullResponse':!![],'encoding':_0x573b31,'body':_0x392592['body']};if(_0x392592[_0x952f('0x9f')]){_0x1b8251[_0x952f('0x9f')]=_0x392592['headers'];if(_0x1b8251[_0x952f('0x9f')]['content-length']){delete _0x1b8251[_0x952f('0x9f')][_0x952f('0xa0')];}}if(_0x1b8251['headers']['content-type']){delete _0x1b8251[_0x952f('0x9f')][_0x952f('0xa1')];}return rp(_0x1b8251);})[_0x952f('0x2b')](function(_0x41834f){if(_0x41834f){_0x27eb8f[_0x952f('0x25')](_0x41834f[_0x952f('0x9f')]);logger[_0x952f('0x67')](_0x41834f[_0x952f('0x8e')]);return _0x27eb8f[_0x952f('0x1f')](_0x41834f[_0x952f('0xa3')])[_0x952f('0xa4')](_0x41834f[_0x952f('0x8e')]);}else{return _0x27eb8f[_0x952f('0x1d')](0xc8);}})[_0x952f('0x4e')](handleError(_0x27eb8f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b48abc9..0f01007 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 _0x095b=['events','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f5ab9,_0x201bde){var _0x62d55d=function(_0x58cbe3){while(--_0x58cbe3){_0x4f5ab9['push'](_0x4f5ab9['shift']());}};_0x62d55d(++_0x201bde);}(_0x095b,0x6e));var _0xb095=function(_0x3c7c7e,_0x18d544){_0x3c7c7e=_0x3c7c7e-0x0;var _0x1051b9=_0x095b[_0x3c7c7e];return _0x1051b9;};'use strict';var EventEmitter=require(_0xb095('0x0'));var Plugin=require('../../mysqldb')['db'][_0xb095('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb095('0x2')](0x0);var events={'afterCreate':_0xb095('0x3'),'afterUpdate':_0xb095('0x4'),'afterDestroy':_0xb095('0x5')};function emitEvent(_0x48b909){return function(_0x1a42a5,_0x25f040,_0x12979f){PluginEvents[_0xb095('0x6')](_0x48b909+':'+_0x1a42a5['id'],_0x1a42a5);PluginEvents[_0xb095('0x6')](_0x48b909,_0x1a42a5);_0x12979f(null);};}for(var e in events){if(events[_0xb095('0x7')](e)){var event=events[e];Plugin[_0xb095('0x8')](e,emitEvent(event));}}module[_0xb095('0x9')]=PluginEvents; \ No newline at end of file +var _0xbecd=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','Plugin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xdbec('0x0'));var Plugin=require('../../mysqldb')['db'][_0xdbec('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xdbec('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbec('0x3'),'afterDestroy':_0xdbec('0x4')};function emitEvent(_0x343f68){return function(_0x31d770,_0x4586e7,_0x47313b){PluginEvents[_0xdbec('0x5')](_0x343f68+':'+_0x31d770['id'],_0x31d770);PluginEvents[_0xdbec('0x5')](_0x343f68,_0x31d770);_0x47313b(null);};}for(var e in events){if(events[_0xdbec('0x6')](e)){var event=events[e];Plugin[_0xdbec('0x7')](e,emitEvent(event));}}module[_0xdbec('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9743d86..2c8c945 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 _0x1358=['request-promise','path','rimraf','exports','Plugin','lodash','api','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1358,0x16d));var _0x8135=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1358[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8135('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8135('0x1'));var moment=require(_0x8135('0x2'));var BPromise=require(_0x8135('0x3'));var rp=require(_0x8135('0x4'));var fs=require('fs');var path=require(_0x8135('0x5'));var rimraf=require(_0x8135('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x8135('0x7')]=function(_0x135f71,_0x9203c2){return _0x135f71['define'](_0x8135('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b51=['path','rimraf','../../config/environment','./plugin.attributes','lodash','util','../../config/logger','api','bluebird'];(function(_0x27ffa8,_0x339d9f){var _0x5b504b=function(_0x56eddf){while(--_0x56eddf){_0x27ffa8['push'](_0x27ffa8['shift']());}};_0x5b504b(++_0x339d9f);}(_0x7b51,0x1bd));var _0x17b5=function(_0x21a173,_0x1f6b9a){_0x21a173=_0x21a173-0x0;var _0x244d96=_0x7b51[_0x21a173];return _0x244d96;};'use strict';var _=require(_0x17b5('0x0'));var util=require(_0x17b5('0x1'));var logger=require(_0x17b5('0x2'))(_0x17b5('0x3'));var moment=require('moment');var BPromise=require(_0x17b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17b5('0x5'));var rimraf=require(_0x17b5('0x6'));var config=require(_0x17b5('0x7'));var attributes=require(_0x17b5('0x8'));module['exports']=function(_0x3e7b8b,_0x252a1b){return _0x3e7b8b['define']('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 1037f83..f54c54d 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 _0xa25d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','bluebird'];(function(_0x32de41,_0x2a3fd1){var _0x594e75=function(_0x40f620){while(--_0x40f620){_0x32de41['push'](_0x32de41['shift']());}};_0x594e75(++_0x2a3fd1);}(_0xa25d,0x194));var _0xda25=function(_0x69b0bf,_0x248a70){_0x69b0bf=_0x69b0bf-0x0;var _0x53a201=_0xa25d[_0x69b0bf];return _0x53a201;};'use strict';var _=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var moment=require(_0xda25('0x2'));var BPromise=require(_0xda25('0x3'));var rs=require(_0xda25('0x4'));var fs=require('fs');var Redis=require(_0xda25('0x5'));var db=require(_0xda25('0x6'))['db'];var utils=require(_0xda25('0x7'));var logger=require(_0xda25('0x8'))(_0xda25('0x9'));var config=require(_0xda25('0xa'));var jayson=require(_0xda25('0xb'));var client=jayson[_0xda25('0xc')][_0xda25('0xd')]({'port':0x232a});config[_0xda25('0xe')]=_[_0xda25('0xf')](config[_0xda25('0xe')],{'host':_0xda25('0x10'),'port':0x18eb});var socket=require(_0xda25('0x11'))(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x476573,_0x4c382a,_0x258f8b){return new BPromise(function(_0x2671a6,_0x41de2f){return client[_0xda25('0x12')](_0x476573,_0x258f8b)[_0xda25('0x13')](function(_0x32af5d){logger[_0xda25('0x14')](_0xda25('0x15'),_0x4c382a,_0xda25('0x16'));logger[_0xda25('0x17')]('Plugin,\x20%s,\x20%s,\x20%s',_0x4c382a,_0xda25('0x16'),JSON[_0xda25('0x18')](_0x32af5d));if(_0x32af5d[_0xda25('0x19')]){if(_0x32af5d[_0xda25('0x19')][_0xda25('0x1a')]===0x1f4){logger['error'](_0xda25('0x15'),_0x4c382a,_0x32af5d[_0xda25('0x19')][_0xda25('0x1b')]);return _0x41de2f(_0x32af5d[_0xda25('0x19')]['message']);}logger[_0xda25('0x19')](_0xda25('0x15'),_0x4c382a,_0x32af5d['error'][_0xda25('0x1b')]);return _0x2671a6(_0x32af5d['error'][_0xda25('0x1b')]);}else{logger[_0xda25('0x14')](_0xda25('0x15'),_0x4c382a,_0xda25('0x16'));_0x2671a6(_0x32af5d['result'][_0xda25('0x1b')]);}})[_0xda25('0x1c')](function(_0x522a19){logger[_0xda25('0x19')]('Plugin,\x20%s,\x20%s',_0x4c382a,_0x522a19);_0x41de2f(_0x522a19);});});}exports[_0xda25('0x1d')]=function(_0x7fc809){var _0x4e41ff=this;return new Promise(function(_0x2d6e0b,_0x1129cb){return db['Plugin'][_0xda25('0x1e')](_0x7fc809[_0xda25('0x1f')],{'raw':_0x7fc809[_0xda25('0x20')]?_0x7fc809[_0xda25('0x20')][_0xda25('0x21')]===undefined?!![]:![]:!![]})[_0xda25('0x13')](function(_0x5bdd98){logger['info'](_0xda25('0x1d'),_0x7fc809);logger[_0xda25('0x17')](_0xda25('0x1d'),_0x7fc809,JSON['stringify'](_0x5bdd98));_0x2d6e0b(_0x5bdd98);})['catch'](function(_0x45bfb8){logger[_0xda25('0x19')](_0xda25('0x1d'),_0x45bfb8[_0xda25('0x1b')],_0x7fc809);_0x1129cb(_0x4e41ff[_0xda25('0x19')](0x1f4,_0x45bfb8['message']));});});}; \ No newline at end of file +var _0xaf5c=['jayson/promise','client','http','redis','defaults','register','request','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xaf5c,0x161));var _0xcaf5=function(_0xec26a1,_0x9b9df9){_0xec26a1=_0xec26a1-0x0;var _0x3cd59d=_0xaf5c[_0xec26a1];return _0x3cd59d;};'use strict';var _=require('lodash');var util=require(_0xcaf5('0x0'));var moment=require(_0xcaf5('0x1'));var BPromise=require(_0xcaf5('0x2'));var rs=require(_0xcaf5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcaf5('0x4'))['db'];var utils=require(_0xcaf5('0x5'));var logger=require('../../config/logger')(_0xcaf5('0x6'));var config=require('../../config/environment');var jayson=require(_0xcaf5('0x7'));var client=jayson[_0xcaf5('0x8')][_0xcaf5('0x9')]({'port':0x232a});config[_0xcaf5('0xa')]=_[_0xcaf5('0xb')](config[_0xcaf5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xcaf5('0xc')](socket);function respondWithRpcPromise(_0x3e81ea,_0x3130db,_0x5992bf){return new BPromise(function(_0x4035ee,_0x369ceb){return client[_0xcaf5('0xd')](_0x3e81ea,_0x5992bf)['then'](function(_0x577096){logger['info'](_0xcaf5('0xe'),_0x3130db,_0xcaf5('0xf'));logger['debug'](_0xcaf5('0x10'),_0x3130db,_0xcaf5('0xf'),JSON[_0xcaf5('0x11')](_0x577096));if(_0x577096['error']){if(_0x577096[_0xcaf5('0x12')]['code']===0x1f4){logger[_0xcaf5('0x12')](_0xcaf5('0xe'),_0x3130db,_0x577096[_0xcaf5('0x12')][_0xcaf5('0x13')]);return _0x369ceb(_0x577096[_0xcaf5('0x12')][_0xcaf5('0x13')]);}logger[_0xcaf5('0x12')](_0xcaf5('0xe'),_0x3130db,_0x577096[_0xcaf5('0x12')][_0xcaf5('0x13')]);return _0x4035ee(_0x577096[_0xcaf5('0x12')][_0xcaf5('0x13')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x3130db,_0xcaf5('0xf'));_0x4035ee(_0x577096[_0xcaf5('0x14')][_0xcaf5('0x13')]);}})[_0xcaf5('0x15')](function(_0x541c3a){logger[_0xcaf5('0x12')](_0xcaf5('0xe'),_0x3130db,_0x541c3a);_0x369ceb(_0x541c3a);});});}exports[_0xcaf5('0x16')]=function(_0x50e456){var _0x3017f1=this;return new Promise(function(_0x164b9f,_0x358a70){return db[_0xcaf5('0x17')][_0xcaf5('0x18')](_0x50e456[_0xcaf5('0x19')],{'raw':_0x50e456[_0xcaf5('0x1a')]?_0x50e456[_0xcaf5('0x1a')][_0xcaf5('0x1b')]===undefined?!![]:![]:!![]})[_0xcaf5('0x1c')](function(_0x169266){logger['info'](_0xcaf5('0x16'),_0x50e456);logger[_0xcaf5('0x1d')]('CreatePlugin',_0x50e456,JSON[_0xcaf5('0x11')](_0x169266));_0x164b9f(_0x169266);})['catch'](function(_0x24fd88){logger[_0xcaf5('0x12')]('CreatePlugin',_0x24fd88[_0xcaf5('0x13')],_0x50e456);_0x358a70(_0x3017f1['error'](0x1f4,_0x24fd88[_0xcaf5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4b95618..e65d67e 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 _0x421a=['save','emit','length'];(function(_0x2b481b,_0x17940e){var _0x322936=function(_0x18b561){while(--_0x18b561){_0x2b481b['push'](_0x2b481b['shift']());}};_0x322936(++_0x17940e);}(_0x421a,0xc6));var _0xa421=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x421a[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xa421('0x0'),'remove','update'];function createListener(_0x308b0b,_0x2cb6dc){return function(_0x278f80){_0x2cb6dc[_0xa421('0x1')](_0x308b0b,_0x278f80);};}function removeListener(_0x542e22,_0x32a09a){return function(){PluginEvents['removeListener'](_0x542e22,_0x32a09a);};}exports['register']=function(_0xab68cb){for(var _0x51d8d0=0x0,_0x30ff5a=events[_0xa421('0x2')];_0x51d8d0<_0x30ff5a;_0x51d8d0++){var _0x3019da=events[_0x51d8d0];var _0x24fb29=createListener('plugin:'+_0x3019da,_0xab68cb);PluginEvents['on'](_0x3019da,_0x24fb29);}}; \ No newline at end of file +var _0xb034=['plugin:','./plugin.events','save','remove','update','removeListener','register','length'];(function(_0x2ee56a,_0x4b443c){var _0x4013cf=function(_0x1af91e){while(--_0x1af91e){_0x2ee56a['push'](_0x2ee56a['shift']());}};_0x4013cf(++_0x4b443c);}(_0xb034,0x1d9));var _0x4b03=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xb034[_0x349367];return _0x14179b;};'use strict';var PluginEvents=require(_0x4b03('0x0'));var events=[_0x4b03('0x1'),_0x4b03('0x2'),_0x4b03('0x3')];function createListener(_0x33100a,_0x2d8b34){return function(_0x284b6f){_0x2d8b34['emit'](_0x33100a,_0x284b6f);};}function removeListener(_0x550969,_0x1d8a09){return function(){PluginEvents[_0x4b03('0x4')](_0x550969,_0x1d8a09);};}exports[_0x4b03('0x5')]=function(_0x547a0e){for(var _0x37e83c=0x0,_0x33e7c4=events[_0x4b03('0x6')];_0x37e83c<_0x33e7c4;_0x37e83c++){var _0x1fc6bd=events[_0x37e83c];var _0x492a6a=createListener(_0x4b03('0x7')+_0x1fc6bd,_0x547a0e);PluginEvents['on'](_0x1fc6bd,_0x492a6a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 9f965e8..c094242 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(_0x4b1be9,_0x42a5af){var _0x1cecce=function(_0x381001){while(--_0x381001){_0x4b1be9['push'](_0x4b1be9['shift']());}};_0x1cecce(++_0x42a5af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x3e13be,_0x26ec39){var _0x35b946=function(_0x21f577){while(--_0x21f577){_0x3e13be['push'](_0x3e13be['shift']());}};_0x35b946(++_0x26ec39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 3d973ab..03c3947 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 _0x9bde=['describe','params','body','script','join','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','delete','../../config/pm2','api','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','list','reject','express','motion2','then','catch','show'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x9bde,0xe1));var _0xe9bd=function(_0x57cfdc,_0x5cbeca){_0x57cfdc=_0x57cfdc-0x0;var _0x559b26=_0x9bde[_0x57cfdc];return _0x559b26;};'use strict';var _=require('lodash');var pm2=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var path=require('path');var exec=require(_0xe9bd('0x2'))[_0xe9bd('0x3')];var BPromise=require(_0xe9bd('0x4'));function handleEntityNotFound(_0x1c1b34,_0x10822d){return function(_0x1a4d14){if(!_0x1a4d14){_0x1c1b34[_0xe9bd('0x5')](0x194);;}return _0x1a4d14;};}function respondWithResult(_0x4fd7b8,_0x4763e9){_0x4763e9=_0x4763e9||0xc8;return function(_0x5f18fe){if(_0x5f18fe){return _0x4fd7b8[_0xe9bd('0x6')](_0x4763e9)[_0xe9bd('0x7')](_0x5f18fe);}return null;};}function handleError(_0x2d5c75,_0x3ef9e3){_0x3ef9e3=_0x3ef9e3||0x1f4;return function(_0x29bc2b){logger[_0xe9bd('0x8')](_0x29bc2b[_0xe9bd('0x9')]);if(_0x29bc2b[_0xe9bd('0xa')]){delete _0x29bc2b['name'];}_0x2d5c75['status'](_0x3ef9e3)[_0xe9bd('0xb')](_0x29bc2b);};}function execChildProcess(){return new BPromise(function(_0x145521,_0x2601ac){exec('npm\x20install',function(_0x12c96e,_0x9eca50,_0x3339f9){logger[_0xe9bd('0xc')](_0x9eca50);logger['info'](_0x3339f9);if(_0x12c96e){logger[_0xe9bd('0x8')](_0x12c96e);return _0x2601ac(_0x12c96e);}return _0x145521(_0x9eca50);});});}exports['index']=function(_0x220d07,_0x429e88){return pm2[_0xe9bd('0xd')]()['then'](function(_0x47ba5e){if(_0x47ba5e){var _0x46a95e=_[_0xe9bd('0xe')](_0x47ba5e,function(_0x3a9e5f){return _0x3a9e5f[_0xe9bd('0xa')]===_0xe9bd('0xf')||_0x3a9e5f[_0xe9bd('0xa')]===_0xe9bd('0x10');});return{'rows':_0x46a95e,'count':_0x46a95e['length']};}return null;})[_0xe9bd('0x11')](respondWithResult(_0x429e88,null))[_0xe9bd('0x12')](handleError(_0x429e88,null));};exports[_0xe9bd('0x13')]=function(_0x494b27,_0x36f03d){return pm2[_0xe9bd('0x14')](_0x494b27[_0xe9bd('0x15')]['id'])[_0xe9bd('0x11')](respondWithResult(_0x36f03d,null))['then'](handleEntityNotFound(_0x36f03d,null))[_0xe9bd('0x12')](handleError(_0x36f03d,null));};exports['create']=function(_0xc6b661,_0x55b869){if(_0xc6b661[_0xe9bd('0x16')][_0xe9bd('0xa')]&&_0xc6b661[_0xe9bd('0x16')][_0xe9bd('0x17')]){var _0x1acb82=path[_0xe9bd('0x18')](__dirname,_0xe9bd('0x19'),_0xc6b661['body'][_0xe9bd('0x17')]);var _0x28cd17=process['cwd']();process[_0xe9bd('0x1a')](path['dirname'](_0x1acb82));return execChildProcess()[_0xe9bd('0x11')](function(_0x1b9cc9){process[_0xe9bd('0x1a')](_0x28cd17);return pm2[_0xe9bd('0x1b')]({'name':_0xc6b661['body'][_0xe9bd('0xa')],'script':_0x1acb82});})[_0xe9bd('0x11')](function(_0x2c9a57){pm2[_0xe9bd('0x1c')]();return _0x2c9a57[0x0];})[_0xe9bd('0x11')](respondWithResult(_0x55b869,0xc9))[_0xe9bd('0x12')](handleError(_0x55b869,null));}else{return _0x55b869[_0xe9bd('0x6')](0x1f4)[_0xe9bd('0xb')]({'message':_0xe9bd('0x1d')});}};exports['update']=function(_0x3c211a,_0x38fdfa){if(_0x3c211a['body']['id']){delete _0x3c211a[_0xe9bd('0x16')]['id'];}var _0xc25248={'online':_0xe9bd('0x1e'),'stopped':_0xe9bd('0x1f')};if(_0xc25248[_0xe9bd('0x20')](_0x3c211a[_0xe9bd('0x16')]['status'])){return pm2[_0xc25248[_0x3c211a['body'][_0xe9bd('0x6')]]](_0x3c211a['params']['id'])[_0xe9bd('0x11')](respondWithResult(_0x38fdfa,0xc8))[_0xe9bd('0x12')](handleError(_0x38fdfa,null));}else{return _0x38fdfa[_0xe9bd('0x6')](0x1f4)[_0xe9bd('0xb')]({'message':_0xe9bd('0x21')});}};exports['destroy']=function(_0x4b7bc2,_0x7f2c5){if(_0x4b7bc2[_0xe9bd('0x16')]['id']){delete _0x4b7bc2[_0xe9bd('0x16')]['id'];}if(_0x4b7bc2[_0xe9bd('0x15')]['id']){return pm2[_0xe9bd('0x22')](_0x4b7bc2[_0xe9bd('0x15')]['id'])[_0xe9bd('0x11')](function(_0x66213a){pm2[_0xe9bd('0x1c')]();return _0x66213a[0x0];})['then'](respondWithResult(_0x7f2c5,null))[_0xe9bd('0x12')](handleError(_0x7f2c5,null));}else{return _0x7f2c5[_0xe9bd('0x6')](0x1f4)[_0xe9bd('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xe5b5=['../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','show','describe','catch','body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2'];(function(_0x12c006,_0x4753e9){var _0x20b451=function(_0x36214a){while(--_0x36214a){_0x12c006['push'](_0x12c006['shift']());}};_0x20b451(++_0x4753e9);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xe5b5[_0x2b0a86];return _0x955940;};'use strict';var _=require(_0x5e5b('0x0'));var pm2=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var path=require(_0x5e5b('0x4'));var exec=require(_0x5e5b('0x5'))[_0x5e5b('0x6')];var BPromise=require(_0x5e5b('0x7'));function handleEntityNotFound(_0xf20c6a,_0x20a50c){return function(_0xdc6616){if(!_0xdc6616){_0xf20c6a[_0x5e5b('0x8')](0x194);;}return _0xdc6616;};}function respondWithResult(_0xf1fbe2,_0x11e0e0){_0x11e0e0=_0x11e0e0||0xc8;return function(_0x545eb3){if(_0x545eb3){return _0xf1fbe2[_0x5e5b('0x9')](_0x11e0e0)[_0x5e5b('0xa')](_0x545eb3);}return null;};}function handleError(_0xcbd478,_0x258414){_0x258414=_0x258414||0x1f4;return function(_0xb9d72b){logger[_0x5e5b('0xb')](_0xb9d72b[_0x5e5b('0xc')]);if(_0xb9d72b[_0x5e5b('0xd')]){delete _0xb9d72b['name'];}_0xcbd478[_0x5e5b('0x9')](_0x258414)['send'](_0xb9d72b);};}function execChildProcess(){return new BPromise(function(_0x108c34,_0x58185){exec(_0x5e5b('0xe'),function(_0x3f64b6,_0x55c974,_0x4a1424){logger['info'](_0x55c974);logger[_0x5e5b('0xf')](_0x4a1424);if(_0x3f64b6){logger[_0x5e5b('0xb')](_0x3f64b6);return _0x58185(_0x3f64b6);}return _0x108c34(_0x55c974);});});}exports[_0x5e5b('0x10')]=function(_0x1694ff,_0x13a01e){return pm2[_0x5e5b('0x11')]()[_0x5e5b('0x12')](function(_0x49edd0){if(_0x49edd0){var _0x2b37fa=_[_0x5e5b('0x13')](_0x49edd0,function(_0x4ff37b){return _0x4ff37b[_0x5e5b('0xd')]==='express'||_0x4ff37b['name']===_0x5e5b('0x14');});return{'rows':_0x2b37fa,'count':_0x2b37fa[_0x5e5b('0x15')]};}return null;})[_0x5e5b('0x12')](respondWithResult(_0x13a01e,null))['catch'](handleError(_0x13a01e,null));};exports[_0x5e5b('0x16')]=function(_0x4d490c,_0x1796af){return pm2[_0x5e5b('0x17')](_0x4d490c['params']['id'])[_0x5e5b('0x12')](respondWithResult(_0x1796af,null))[_0x5e5b('0x12')](handleEntityNotFound(_0x1796af,null))[_0x5e5b('0x18')](handleError(_0x1796af,null));};exports['create']=function(_0x2bf0b7,_0x3f1103){if(_0x2bf0b7['body'][_0x5e5b('0xd')]&&_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]){var _0x2d8252=path[_0x5e5b('0x1b')](__dirname,_0x5e5b('0x1c'),_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]);var _0x4a78e3=process['cwd']();process[_0x5e5b('0x1d')](path[_0x5e5b('0x1e')](_0x2d8252));return execChildProcess()[_0x5e5b('0x12')](function(_0xe1c268){process[_0x5e5b('0x1d')](_0x4a78e3);return pm2[_0x5e5b('0x1f')]({'name':_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0xd')],'script':_0x2d8252});})[_0x5e5b('0x12')](function(_0x26bc02){pm2[_0x5e5b('0x20')]();return _0x26bc02[0x0];})['then'](respondWithResult(_0x3f1103,0xc9))[_0x5e5b('0x18')](handleError(_0x3f1103,null));}else{return _0x3f1103[_0x5e5b('0x9')](0x1f4)[_0x5e5b('0x21')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5e5b('0x22')]=function(_0xdb2863,_0x5ee866){if(_0xdb2863[_0x5e5b('0x19')]['id']){delete _0xdb2863[_0x5e5b('0x19')]['id'];}var _0x39ce16={'online':_0x5e5b('0x23'),'stopped':_0x5e5b('0x24')};if(_0x39ce16[_0x5e5b('0x25')](_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')])){return pm2[_0x39ce16[_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')]]](_0xdb2863[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](respondWithResult(_0x5ee866,0xc8))['catch'](handleError(_0x5ee866,null));}else{return _0x5ee866['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x27')});}};exports[_0x5e5b('0x28')]=function(_0x3dcdab,_0x12f1ee){if(_0x3dcdab['body']['id']){delete _0x3dcdab[_0x5e5b('0x19')]['id'];}if(_0x3dcdab['params']['id']){return pm2[_0x5e5b('0x29')](_0x3dcdab[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](function(_0xc2bc09){pm2['dump']();return _0xc2bc09[0x0];})[_0x5e5b('0x12')](respondWithResult(_0x12f1ee,null))[_0x5e5b('0x18')](handleError(_0x12f1ee,null));}else{return _0x12f1ee['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x2a')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 214c627..93a3931 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 _0x5f7b=['getQueues','exports','express','Router','./realtime.controller','get','/queues','isAuthenticated'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x5f7b[_0x4a53d];return _0x27410e;};'use strict';var express=require(_0xb5f7('0x0'));var router=express[_0xb5f7('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xb5f7('0x2'));router[_0xb5f7('0x3')](_0xb5f7('0x4'),auth[_0xb5f7('0x5')](),controller[_0xb5f7('0x6')]);module[_0xb5f7('0x7')]=router; \ No newline at end of file +var _0xc6c0=['./realtime.controller','get','/queues','isAuthenticated','getQueues','exports','express','../../components/auth/service'];(function(_0x552c9e,_0x221cf5){var _0x4c8401=function(_0x1a28e3){while(--_0x1a28e3){_0x552c9e['push'](_0x552c9e['shift']());}};_0x4c8401(++_0x221cf5);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0xc6c0[_0x14a862];return _0x245eb5;};'use strict';var express=require(_0x0c6c('0x0'));var router=express['Router']();var auth=require(_0x0c6c('0x1'));var controller=require(_0x0c6c('0x2'));router[_0x0c6c('0x3')](_0x0c6c('0x4'),auth[_0x0c6c('0x5')](),controller[_0x0c6c('0x6')]);module[_0x0c6c('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 1df9066..08bf0f0 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 _0x3a6d=['outbound','QueueCampaigns','Queues','type','filter','UserProfile','getResources','findAndCountAll','request','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','rows','get','paused','talking','agents','find','merge','pick','getAgents','getMembers','length','online','loggedInDb','User','Queue','Pause','findAll','QueueId','UserId','catch','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','status','set','Content-Range','error','stack','name','send','chat','sms','openchannel','whatsapp','resolve','then','query','channel','includes','Invalid\x20channel','toLowerCase','startCase','map','getOptions','user','role','userProfileId','voice'];(function(_0xfa2224,_0x4cf3e7){var _0x322db3=function(_0x5be62c){while(--_0x5be62c){_0xfa2224['push'](_0xfa2224['shift']());}};_0x322db3(++_0x4cf3e7);}(_0x3a6d,0x143));var _0xd3a6=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x3a6d[_0x11005e];return _0x29338f;};'use strict';var util=require(_0xd3a6('0x0'));var _=require(_0xd3a6('0x1'));var jayson=require('jayson/promise');var qs=require(_0xd3a6('0x2'));var logger=require(_0xd3a6('0x3'))(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var client=jayson[_0xd3a6('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0xd3a6('0x6')][_0xd3a6('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x1e44bd,_0x1fc450){return function(_0x25b042){if(_0x25b042){var _0x282cb1=typeof _0x1fc450['offset']===_0xd3a6('0x8')&&typeof _0x1fc450[_0xd3a6('0x9')]===_0xd3a6('0x8');var _0x410dac=_0x25b042[_0xd3a6('0xa')];var _0xa67661=_0x282cb1?0x0:_0x1fc450[_0xd3a6('0xb')];var _0x4094a2=_0x282cb1?_0x25b042[_0xd3a6('0xa')]:_0x1fc450['offset']+_0x1fc450[_0xd3a6('0x9')];var _0x1a00f7;if(_0x4094a2>=_0x410dac){_0x4094a2=_0x410dac;_0x1a00f7=0xc8;}else{_0x1a00f7=0xce;}_0x1e44bd[_0xd3a6('0xc')](_0x1a00f7);return _0x1e44bd[_0xd3a6('0xd')](_0xd3a6('0xe'),_0xa67661+'-'+_0x4094a2+'/'+_0x410dac)['json'](_0x25b042);}return null;};}function handleError(_0x5430c0,_0x4b0467){_0x4b0467=_0x4b0467||0x1f4;return function(_0x1c6ad7){logger[_0xd3a6('0xf')](_0x1c6ad7[_0xd3a6('0x10')]);if(_0x1c6ad7[_0xd3a6('0x11')]){delete _0x1c6ad7[_0xd3a6('0x11')];}_0x5430c0[_0xd3a6('0xc')](_0x4b0467)[_0xd3a6('0x12')](_0x1c6ad7);};}exports['getQueues']=function(_0x473a97,_0xf5ace5){var _0x171a8f=['mail',_0xd3a6('0x13'),_0xd3a6('0x14'),_0xd3a6('0x15'),'fax',_0xd3a6('0x16'),'voice'];var _0x518b6d={'count':0x0,'rows':[]},_0x28b63c={},_0x8d1286;Promise[_0xd3a6('0x17')]()[_0xd3a6('0x18')](function(){if(_0x473a97[_0xd3a6('0x19')][_0xd3a6('0x1a')]){if(!_[_0xd3a6('0x1b')](_0x171a8f,_0x473a97['query'][_0xd3a6('0x1a')]['toLowerCase']()))throw new Error(_0xd3a6('0x1c'));_0x8d1286=_0x473a97[_0xd3a6('0x19')][_0xd3a6('0x1a')][_0xd3a6('0x1d')]();}var _0x465d25=_[_0xd3a6('0x1e')](_0x8d1286)+'Queue';var _0xe7d595=_[_0xd3a6('0x1f')](db[_0x465d25]['rawAttributes'],function(_0x543a6a){return{'name':_0x543a6a['fieldName'],'type':_0x543a6a['type']['key']};});_0x28b63c=qs[_0xd3a6('0x20')](_0xe7d595,_0x473a97);if(_0x473a97[_0xd3a6('0x21')][_0xd3a6('0x22')]==='user'){var _0x456541={'params':{'id':_0x473a97['user'][_0xd3a6('0x23')]},'query':{'section':_0x8d1286===_0xd3a6('0x24')&&_0x473a97[_0xd3a6('0x19')]['type']===_0xd3a6('0x25')?_0xd3a6('0x26'):_[_0xd3a6('0x1e')](_0x8d1286)+_0xd3a6('0x27'),'type':_0x473a97[_0xd3a6('0x19')][_0xd3a6('0x28')],'nolimit':!![],'sort':'name','filter':_0x473a97[_0xd3a6('0x19')][_0xd3a6('0x29')]}};return db[_0xd3a6('0x2a')][_0xd3a6('0x2b')](_0x456541);}return db[_0x465d25][_0xd3a6('0x2c')](_0x28b63c);})[_0xd3a6('0x18')](function(_0x5c2186){_0x518b6d['count']=_0x5c2186[_0xd3a6('0xa')];var _0x210aa1=_0x8d1286===_0xd3a6('0x24')?client:routingClient;return _0x210aa1[_0xd3a6('0x2d')](_['startCase'](_0x8d1286)+_0xd3a6('0x27'),_0x473a97)[_0xd3a6('0x18')](function(_0x4d322a){if(_0x4d322a[_0xd3a6('0xf')])throw new Error(util['format'](_0xd3a6('0x2e'),_0x8d1286));var _0x7f636e=_0x4d322a[_0xd3a6('0x2f')];var _0x87b75a=[_0xd3a6('0x30'),_0xd3a6('0x31'),_0xd3a6('0x32'),'talking','paused'];if(_0x8d1286===_0xd3a6('0x24')&&_0x473a97[_0xd3a6('0x19')][_0xd3a6('0x28')]==='outbound'){_0x87b75a[_0xd3a6('0x33')](_0xd3a6('0x34'),_0xd3a6('0x35'),_0xd3a6('0x36'),_0xd3a6('0x37'),_0xd3a6('0x38'),_0xd3a6('0x39'),_0xd3a6('0x3a'),'startProgressive',_0xd3a6('0x3b'),_0xd3a6('0x3c'),_0xd3a6('0x3d'),_0xd3a6('0x3e'),_0xd3a6('0x3f'),_0xd3a6('0x40'),'dialPredictiveIntervalMinThreshold',_0xd3a6('0x41'),'predictiveIntervalTotalCalls',_0xd3a6('0x42'),_0xd3a6('0x43'),_0xd3a6('0x44'),_0xd3a6('0x45'),'predictiveIntervalAvgTalktime');}var _0x592b5f=_0x5c2186[_0xd3a6('0x46')][_0xd3a6('0x1f')](function(_0x2e7940){var _0x5188e1=_0x2e7940[_0xd3a6('0x47')]({'plain':!![]});_0x5188e1[_0xd3a6('0x48')]=0x0;_0x5188e1['loggedInDb']=0x0;_0x5188e1[_0xd3a6('0x30')]=0x0;_0x5188e1['available']=0x0;_0x5188e1[_0xd3a6('0x48')]=0x0;_0x5188e1[_0xd3a6('0x32')]=0x0;if(_0x8d1286==='voice'){_0x5188e1[_0xd3a6('0x49')]=0x0;if(_0x473a97['query'][_0xd3a6('0x28')]===_0xd3a6('0x25')){_0x5188e1['pTalking']=0x0;_0x5188e1[_0xd3a6('0x35')]=0x0;}}_0x5188e1[_0xd3a6('0x4a')]=[];var _0x965402=_[_0xd3a6('0x4b')](_0x7f636e['rows'],['id',_0x5188e1['id']]);if(_0x965402)_[_0xd3a6('0x4c')](_0x5188e1,_[_0xd3a6('0x4d')](_0x965402,_0x87b75a));if(_0x8d1286===_0xd3a6('0x24')){return _0x2e7940[_0xd3a6('0x4e')]({'attributes':['id',_0xd3a6('0x11'),'online'],'joinTableAttributes':[],'raw':!![]})[_0xd3a6('0x18')](function(_0x5bd74a){return _0x2e7940[_0xd3a6('0x4f')]({'raw':!![]})[_0xd3a6('0x18')](function(_0x16764c){for(var _0x5469cc=0x0;_0x5469cc<_0x5bd74a[_0xd3a6('0x50')];_0x5469cc++){var _0x598329=_[_0xd3a6('0x4b')](_0x16764c,['UserId',_0x5bd74a[_0x5469cc]['id']]);var _0x448213={'id':_0x5bd74a[_0x5469cc]['id'],'name':_0x5bd74a[_0x5469cc][_0xd3a6('0x11')],'online':Boolean(_0x5bd74a[_0x5469cc][_0xd3a6('0x51')]),'paused':_0x598329?Boolean(_0x598329[_0xd3a6('0x48')]):![]};if(_0x448213[_0xd3a6('0x51')])_0x5188e1[_0xd3a6('0x52')]++;if(_0x448213[_0xd3a6('0x48')])_0x5188e1['paused']++;_0x5188e1[_0xd3a6('0x4a')][_0xd3a6('0x33')](_0x448213);}return _0x5188e1;});});}else{var _0x55a88=_0xd3a6('0x53')+_['startCase'](_0x8d1286)+_0xd3a6('0x54');var _0xf2589a=_0x8d1286+_0xd3a6('0x55');return db[_0x55a88][_0xd3a6('0x56')]({'where':{[_[_0xd3a6('0x1e')](_0x8d1286)+_0xd3a6('0x57')]:_0x2e7940['id']},'raw':!![]})[_0xd3a6('0x18')](function(_0x237cd4){return db['User'][_0xd3a6('0x56')]({'attributes':['id',_0xd3a6('0x11'),_0xd3a6('0x51'),_0xf2589a],'where':{'id':_[_0xd3a6('0x1f')](_0x237cd4,_0xd3a6('0x58')),'role':'agent'},'raw':!![]});})[_0xd3a6('0x18')](function(_0x7a7f23){for(var _0x11f28b=0x0;_0x11f28b<_0x7a7f23[_0xd3a6('0x50')];_0x11f28b++){var _0x36b324={'id':_0x7a7f23[_0x11f28b]['id'],'name':_0x7a7f23[_0x11f28b][_0xd3a6('0x11')],'online':Boolean(_0x7a7f23[_0x11f28b][_0xd3a6('0x51')]),'paused':Boolean(_0x7a7f23[_0x11f28b][_0xf2589a])};if(_0x36b324[_0xd3a6('0x51')])_0x5188e1['loggedInDb']++;if(_0x36b324[_0xd3a6('0x48')])_0x5188e1['paused']++;_0x5188e1[_0xd3a6('0x4a')][_0xd3a6('0x33')](_0x36b324);}return _0x5188e1;});}});return Promise['all'](_0x592b5f);});})[_0xd3a6('0x18')](function(_0x1ede75){_0x518b6d[_0xd3a6('0x46')]=_0x1ede75;return _0x518b6d;})[_0xd3a6('0x18')](respondWithFilteredResult(_0xf5ace5,_0x28b63c))[_0xd3a6('0x59')](handleError(_0xf5ace5,null));}; \ No newline at end of file +var _0x6455=['resolve','then','query','includes','toLowerCase','Invalid\x20channel','startCase','map','fieldName','key','getOptions','user','userProfileId','QueueCampaigns','type','filter','UserProfile','getResources','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','dialActive','Trunk','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','originated','agents','find','merge','pick','getAgents','online','getMembers','length','UserId','User','Queue','Pause','findAll','QueueId','agent','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','json','error','stack','name','send','sms','openchannel','whatsapp','voice'];(function(_0x44b538,_0x51c6f9){var _0x353d7e=function(_0x34f9f2){while(--_0x34f9f2){_0x44b538['push'](_0x44b538['shift']());}};_0x353d7e(++_0x51c6f9);}(_0x6455,0x97));var _0x5645=function(_0x1f9e6c,_0x5d86e3){_0x1f9e6c=_0x1f9e6c-0x0;var _0x9adc6d=_0x6455[_0x1f9e6c];return _0x9adc6d;};'use strict';var util=require(_0x5645('0x0'));var _=require('lodash');var jayson=require(_0x5645('0x1'));var qs=require(_0x5645('0x2'));var logger=require(_0x5645('0x3'))(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var client=jayson[_0x5645('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x5645('0x6')][_0x5645('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x282ef3,_0x9400a8){return function(_0x3a635d){if(_0x3a635d){var _0x37d672=typeof _0x9400a8[_0x5645('0x8')]===_0x5645('0x9')&&typeof _0x9400a8['limit']==='undefined';var _0x20efde=_0x3a635d[_0x5645('0xa')];var _0x38c07a=_0x37d672?0x0:_0x9400a8[_0x5645('0x8')];var _0x7f9893=_0x37d672?_0x3a635d[_0x5645('0xa')]:_0x9400a8['offset']+_0x9400a8[_0x5645('0xb')];var _0x6021da;if(_0x7f9893>=_0x20efde){_0x7f9893=_0x20efde;_0x6021da=0xc8;}else{_0x6021da=0xce;}_0x282ef3[_0x5645('0xc')](_0x6021da);return _0x282ef3[_0x5645('0xd')]('Content-Range',_0x38c07a+'-'+_0x7f9893+'/'+_0x20efde)[_0x5645('0xe')](_0x3a635d);}return null;};}function handleError(_0x5ecb2a,_0x42f5cd){_0x42f5cd=_0x42f5cd||0x1f4;return function(_0x4014c5){logger[_0x5645('0xf')](_0x4014c5[_0x5645('0x10')]);if(_0x4014c5[_0x5645('0x11')]){delete _0x4014c5[_0x5645('0x11')];}_0x5ecb2a[_0x5645('0xc')](_0x42f5cd)[_0x5645('0x12')](_0x4014c5);};}exports['getQueues']=function(_0x2da9c5,_0x3e0ec6){var _0x25863f=['mail','chat',_0x5645('0x13'),_0x5645('0x14'),'fax',_0x5645('0x15'),_0x5645('0x16')];var _0x3911ea={'count':0x0,'rows':[]},_0x5179fd={},_0x35bc6f;Promise[_0x5645('0x17')]()[_0x5645('0x18')](function(){if(_0x2da9c5[_0x5645('0x19')]['channel']){if(!_[_0x5645('0x1a')](_0x25863f,_0x2da9c5['query']['channel'][_0x5645('0x1b')]()))throw new Error(_0x5645('0x1c'));_0x35bc6f=_0x2da9c5[_0x5645('0x19')]['channel'][_0x5645('0x1b')]();}var _0x50ed38=_[_0x5645('0x1d')](_0x35bc6f)+'Queue';var _0x4f82d0=_[_0x5645('0x1e')](db[_0x50ed38]['rawAttributes'],function(_0x465a01){return{'name':_0x465a01[_0x5645('0x1f')],'type':_0x465a01['type'][_0x5645('0x20')]};});_0x5179fd=qs[_0x5645('0x21')](_0x4f82d0,_0x2da9c5);if(_0x2da9c5[_0x5645('0x22')]['role']===_0x5645('0x22')){var _0xc38038={'params':{'id':_0x2da9c5[_0x5645('0x22')][_0x5645('0x23')]},'query':{'section':_0x35bc6f==='voice'&&_0x2da9c5['query']['type']==='outbound'?_0x5645('0x24'):_['startCase'](_0x35bc6f)+'Queues','type':_0x2da9c5[_0x5645('0x19')][_0x5645('0x25')],'nolimit':!![],'sort':_0x5645('0x11'),'filter':_0x2da9c5[_0x5645('0x19')][_0x5645('0x26')]}};return db[_0x5645('0x27')][_0x5645('0x28')](_0xc38038);}return db[_0x50ed38][_0x5645('0x29')](_0x5179fd);})[_0x5645('0x18')](function(_0x30a5d0){_0x3911ea[_0x5645('0xa')]=_0x30a5d0[_0x5645('0xa')];var _0x406782=_0x35bc6f===_0x5645('0x16')?client:routingClient;return _0x406782['request'](_[_0x5645('0x1d')](_0x35bc6f)+'Queues',_0x2da9c5)[_0x5645('0x18')](function(_0x31c31b){if(_0x31c31b[_0x5645('0xf')])throw new Error(util[_0x5645('0x2a')](_0x5645('0x2b'),_0x35bc6f));var _0xc90d52=_0x31c31b['result'];var _0x596363=[_0x5645('0x2c'),_0x5645('0x2d'),_0x5645('0x2e'),_0x5645('0x2f'),_0x5645('0x30')];if(_0x35bc6f===_0x5645('0x16')&&_0x2da9c5[_0x5645('0x19')][_0x5645('0x25')]===_0x5645('0x31')){_0x596363[_0x5645('0x32')](_0x5645('0x33'),'originated','message',_0x5645('0x34'),'dialMethod',_0x5645('0x35'),'startPredictive',_0x5645('0x36'),'erlangCalls',_0x5645('0x37'),_0x5645('0x38'),_0x5645('0x39'),_0x5645('0x3a'),_0x5645('0x3b'),_0x5645('0x3c'),'predictiveIntervalAvailable',_0x5645('0x3d'),_0x5645('0x3e'),_0x5645('0x3f'),_0x5645('0x40'),_0x5645('0x41'),_0x5645('0x42'));}var _0x281f65=_0x30a5d0[_0x5645('0x43')]['map'](function(_0x178f6b){var _0x48844f=_0x178f6b[_0x5645('0x44')]({'plain':!![]});_0x48844f[_0x5645('0x30')]=0x0;_0x48844f[_0x5645('0x45')]=0x0;_0x48844f[_0x5645('0x2c')]=0x0;_0x48844f[_0x5645('0x2d')]=0x0;_0x48844f['paused']=0x0;_0x48844f[_0x5645('0x2e')]=0x0;if(_0x35bc6f===_0x5645('0x16')){_0x48844f[_0x5645('0x2f')]=0x0;if(_0x2da9c5[_0x5645('0x19')][_0x5645('0x25')]===_0x5645('0x31')){_0x48844f[_0x5645('0x33')]=0x0;_0x48844f[_0x5645('0x46')]=0x0;}}_0x48844f[_0x5645('0x47')]=[];var _0xfa8632=_[_0x5645('0x48')](_0xc90d52[_0x5645('0x43')],['id',_0x48844f['id']]);if(_0xfa8632)_[_0x5645('0x49')](_0x48844f,_[_0x5645('0x4a')](_0xfa8632,_0x596363));if(_0x35bc6f===_0x5645('0x16')){return _0x178f6b[_0x5645('0x4b')]({'attributes':['id','name',_0x5645('0x4c')],'joinTableAttributes':[],'raw':!![]})[_0x5645('0x18')](function(_0x488a72){return _0x178f6b[_0x5645('0x4d')]({'raw':!![]})[_0x5645('0x18')](function(_0x5e841a){for(var _0x11245e=0x0;_0x11245e<_0x488a72[_0x5645('0x4e')];_0x11245e++){var _0x36074a=_[_0x5645('0x48')](_0x5e841a,[_0x5645('0x4f'),_0x488a72[_0x11245e]['id']]);var _0x2a72c8={'id':_0x488a72[_0x11245e]['id'],'name':_0x488a72[_0x11245e][_0x5645('0x11')],'online':Boolean(_0x488a72[_0x11245e]['online']),'paused':_0x36074a?Boolean(_0x36074a['paused']):![]};if(_0x2a72c8[_0x5645('0x4c')])_0x48844f[_0x5645('0x45')]++;if(_0x2a72c8[_0x5645('0x30')])_0x48844f[_0x5645('0x30')]++;_0x48844f[_0x5645('0x47')][_0x5645('0x32')](_0x2a72c8);}return _0x48844f;});});}else{var _0x1241d8=_0x5645('0x50')+_[_0x5645('0x1d')](_0x35bc6f)+_0x5645('0x51');var _0x194a9f=_0x35bc6f+_0x5645('0x52');return db[_0x1241d8][_0x5645('0x53')]({'where':{[_[_0x5645('0x1d')](_0x35bc6f)+_0x5645('0x54')]:_0x178f6b['id']},'raw':!![]})[_0x5645('0x18')](function(_0x3c83cf){return db['User']['findAll']({'attributes':['id','name','online',_0x194a9f],'where':{'id':_[_0x5645('0x1e')](_0x3c83cf,_0x5645('0x4f')),'role':_0x5645('0x55')},'raw':!![]});})[_0x5645('0x18')](function(_0x12ca73){for(var _0x5b9b00=0x0;_0x5b9b00<_0x12ca73[_0x5645('0x4e')];_0x5b9b00++){var _0x2f6552={'id':_0x12ca73[_0x5b9b00]['id'],'name':_0x12ca73[_0x5b9b00][_0x5645('0x11')],'online':Boolean(_0x12ca73[_0x5b9b00][_0x5645('0x4c')]),'paused':Boolean(_0x12ca73[_0x5b9b00][_0x194a9f])};if(_0x2f6552[_0x5645('0x4c')])_0x48844f['loggedInDb']++;if(_0x2f6552[_0x5645('0x30')])_0x48844f[_0x5645('0x30')]++;_0x48844f[_0x5645('0x47')][_0x5645('0x32')](_0x2f6552);}return _0x48844f;});}});return Promise[_0x5645('0x56')](_0x281f65);});})[_0x5645('0x18')](function(_0x8bb279){_0x3911ea[_0x5645('0x43')]=_0x8bb279;return _0x3911ea;})['then'](respondWithFilteredResult(_0x3e0ec6,_0x5179fd))['catch'](handleError(_0x3e0ec6,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 9dc2324..a3d5c09 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1b5838,_0x25ec5b){var _0x213065=function(_0xde01bf){while(--_0xde01bf){_0x1b5838['push'](_0x1b5838['shift']());}};_0x213065(++_0x25ec5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x488c9d,_0x3bf46e){var _0x23e626=function(_0x5c4584){while(--_0x5c4584){_0x488c9d['push'](_0x488c9d['shift']());}};_0x23e626(++_0x3bf46e);}(_0xe706,0xa3));var _0x6e70=function(_0x4aa350,_0x12a9eb){_0x4aa350=_0x4aa350-0x0;var _0x32a16f=_0xe706[_0x4aa350];return _0x32a16f;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 563dbb0..713075d 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 _0x16cc=['exports','INTEGER','STRING','DATE'];(function(_0x475658,_0x2c8ecb){var _0x531ac8=function(_0x2891f3){while(--_0x2891f3){_0x475658['push'](_0x475658['shift']());}};_0x531ac8(++_0x2c8ecb);}(_0x16cc,0x120));var _0xc16c=function(_0x447675,_0x4e582a){_0x447675=_0x447675-0x0;var _0x3cf5e3=_0x16cc[_0x447675];return _0x3cf5e3;};'use strict';var Sequelize=require('sequelize');module[_0xc16c('0x0')]={'state':{'type':Sequelize[_0xc16c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc16c('0x2')]},'scheduledat':{'type':Sequelize[_0xc16c('0x3')]},'uniqueid':{'type':Sequelize[_0xc16c('0x2')]},'starttime':{'type':Sequelize[_0xc16c('0x3')]},'responsetime':{'type':Sequelize[_0xc16c('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc16c('0x2')]},'campaigntype':{'type':Sequelize[_0xc16c('0x2')]},'membername':{'type':Sequelize[_0xc16c('0x2')]}}; \ No newline at end of file +var _0x86b8=['exports','INTEGER','DATE','STRING','sequelize'];(function(_0x3b2449,_0x4ec3c1){var _0x438227=function(_0x5bf980){while(--_0x5bf980){_0x3b2449['push'](_0x3b2449['shift']());}};_0x438227(++_0x4ec3c1);}(_0x86b8,0x15d));var _0x886b=function(_0x546994,_0xb7ff1f){_0x546994=_0x546994-0x0;var _0x39e543=_0x86b8[_0x546994];return _0x39e543;};'use strict';var Sequelize=require(_0x886b('0x0'));module[_0x886b('0x1')]={'state':{'type':Sequelize[_0x886b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x886b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x886b('0x3')]},'responsetime':{'type':Sequelize[_0x886b('0x3')]},'ringtime':{'type':Sequelize[_0x886b('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x886b('0x4')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ec9ab1e..be39d27 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 _0xbb22=['util','api','moment','bluebird','request-promise','path','exports','ReportAgentPreview','lodash'];(function(_0x1c99f5,_0x277d24){var _0x5dcba1=function(_0x48203b){while(--_0x48203b){_0x1c99f5['push'](_0x1c99f5['shift']());}};_0x5dcba1(++_0x277d24);}(_0xbb22,0xb3));var _0x2bb2=function(_0x4374f1,_0x3fb8ed){_0x4374f1=_0x4374f1-0x0;var _0x4c93c6=_0xbb22[_0x4374f1];return _0x4c93c6;};'use strict';var _=require(_0x2bb2('0x0'));var util=require(_0x2bb2('0x1'));var logger=require('../../config/logger')(_0x2bb2('0x2'));var moment=require(_0x2bb2('0x3'));var BPromise=require(_0x2bb2('0x4'));var rp=require(_0x2bb2('0x5'));var fs=require('fs');var path=require(_0x2bb2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x2bb2('0x7')]=function(_0x96d4a3,_0x45b808){return _0x96d4a3['define'](_0x2bb2('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2320=['./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3881b4,_0x26fe3c){var _0x26145c=function(_0x2b1d10){while(--_0x2b1d10){_0x3881b4['push'](_0x3881b4['shift']());}};_0x26145c(++_0x26fe3c);}(_0x2320,0x13b));var _0x0232=function(_0x8b4b58,_0x583504){_0x8b4b58=_0x8b4b58-0x0;var _0xb3982a=_0x2320[_0x8b4b58];return _0xb3982a;};'use strict';var _=require(_0x0232('0x0'));var util=require(_0x0232('0x1'));var logger=require(_0x0232('0x2'))(_0x0232('0x3'));var moment=require(_0x0232('0x4'));var BPromise=require(_0x0232('0x5'));var rp=require(_0x0232('0x6'));var fs=require('fs');var path=require(_0x0232('0x7'));var rimraf=require(_0x0232('0x8'));var config=require(_0x0232('0x9'));var attributes=require(_0x0232('0xa'));module['exports']=function(_0x2fb1a5,_0x49ec60){return _0x2fb1a5['define'](_0x0232('0xb'),attributes,{'tableName':_0x0232('0xc'),'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 e9a57ff..b993c09 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 _0x5ed1=['request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','body','options','raw','then','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x4c807c,_0x3e41c5){var _0xad2435=function(_0x1e7b31){while(--_0x1e7b31){_0x4c807c['push'](_0x4c807c['shift']());}};_0xad2435(++_0x3e41c5);}(_0x5ed1,0xe6));var _0x15ed=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x5ed1[_0x18b5e8];return _0x25baed;};'use strict';var _=require(_0x15ed('0x0'));var util=require(_0x15ed('0x1'));var moment=require(_0x15ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15ed('0x3'));var db=require(_0x15ed('0x4'))['db'];var utils=require(_0x15ed('0x5'));var logger=require(_0x15ed('0x6'))(_0x15ed('0x7'));var config=require(_0x15ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x15ed('0x9')][_0x15ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f8feb,_0xcbbb5a,_0x2f3752){return new BPromise(function(_0x53e2d1,_0x25fe9d){return client['request'](_0x1f8feb,_0x2f3752)['then'](function(_0x250592){logger[_0x15ed('0xb')](_0x15ed('0xc'),_0xcbbb5a,_0x15ed('0xd'));logger[_0x15ed('0xe')](_0x15ed('0xf'),_0xcbbb5a,'request\x20sent',JSON['stringify'](_0x250592));if(_0x250592[_0x15ed('0x10')]){if(_0x250592[_0x15ed('0x10')][_0x15ed('0x11')]===0x1f4){logger[_0x15ed('0x10')](_0x15ed('0xc'),_0xcbbb5a,_0x250592['error'][_0x15ed('0x12')]);return _0x25fe9d(_0x250592[_0x15ed('0x10')][_0x15ed('0x12')]);}logger['error'](_0x15ed('0xc'),_0xcbbb5a,_0x250592['error'][_0x15ed('0x12')]);return _0x53e2d1(_0x250592['error'][_0x15ed('0x12')]);}else{logger['info'](_0x15ed('0xc'),_0xcbbb5a,_0x15ed('0xd'));_0x53e2d1(_0x250592[_0x15ed('0x13')][_0x15ed('0x12')]);}})[_0x15ed('0x14')](function(_0x16acb0){logger['error'](_0x15ed('0xc'),_0xcbbb5a,_0x16acb0);_0x25fe9d(_0x16acb0);});});}exports[_0x15ed('0x15')]=function(_0x5cba52){var _0x59871f=this;return new Promise(function(_0x4d46e2,_0x271fbf){return db['ReportAgentPreview']['create'](_0x5cba52[_0x15ed('0x16')],{'raw':_0x5cba52['options']?_0x5cba52[_0x15ed('0x17')][_0x15ed('0x18')]===undefined?!![]:![]:!![]})[_0x15ed('0x19')](function(_0x3477a9){logger[_0x15ed('0xb')](_0x15ed('0x15'),_0x5cba52);logger[_0x15ed('0xe')](_0x15ed('0x15'),_0x5cba52,JSON[_0x15ed('0x1a')](_0x3477a9));_0x4d46e2(_0x3477a9);})['catch'](function(_0x372d06){logger[_0x15ed('0x10')](_0x15ed('0x15'),_0x372d06[_0x15ed('0x12')],_0x5cba52);_0x271fbf(_0x59871f[_0x15ed('0x10')](0x1f4,_0x372d06[_0x15ed('0x12')]));});});}; \ No newline at end of file +var _0xb180=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateReportAgentPreview','create','body','raw','debug','lodash','moment','bluebird'];(function(_0x38f6ee,_0xf06a6c){var _0x49aeef=function(_0x1f1262){while(--_0x1f1262){_0x38f6ee['push'](_0x38f6ee['shift']());}};_0x49aeef(++_0xf06a6c);}(_0xb180,0xb3));var _0x0b18=function(_0x5b5ccc,_0x179e0b){_0x5b5ccc=_0x5b5ccc-0x0;var _0x81652a=_0xb180[_0x5b5ccc];return _0x81652a;};'use strict';var _=require(_0x0b18('0x0'));var util=require('util');var moment=require(_0x0b18('0x1'));var BPromise=require(_0x0b18('0x2'));var rs=require(_0x0b18('0x3'));var fs=require('fs');var Redis=require(_0x0b18('0x4'));var db=require(_0x0b18('0x5'))['db'];var utils=require(_0x0b18('0x6'));var logger=require(_0x0b18('0x7'))(_0x0b18('0x8'));var config=require(_0x0b18('0x9'));var jayson=require(_0x0b18('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5eefbc,_0x9a0e0c,_0x2d38ba){return new BPromise(function(_0x51d250,_0x446a98){return client['request'](_0x5eefbc,_0x2d38ba)['then'](function(_0x361d41){logger[_0x0b18('0xb')](_0x0b18('0xc'),_0x9a0e0c,'request\x20sent');logger['debug'](_0x0b18('0xd'),_0x9a0e0c,_0x0b18('0xe'),JSON[_0x0b18('0xf')](_0x361d41));if(_0x361d41['error']){if(_0x361d41[_0x0b18('0x10')][_0x0b18('0x11')]===0x1f4){logger[_0x0b18('0x10')](_0x0b18('0xc'),_0x9a0e0c,_0x361d41[_0x0b18('0x10')]['message']);return _0x446a98(_0x361d41[_0x0b18('0x10')][_0x0b18('0x12')]);}logger[_0x0b18('0x10')](_0x0b18('0xc'),_0x9a0e0c,_0x361d41[_0x0b18('0x10')][_0x0b18('0x12')]);return _0x51d250(_0x361d41[_0x0b18('0x10')]['message']);}else{logger[_0x0b18('0xb')](_0x0b18('0xc'),_0x9a0e0c,_0x0b18('0xe'));_0x51d250(_0x361d41[_0x0b18('0x13')][_0x0b18('0x12')]);}})[_0x0b18('0x14')](function(_0x2946e6){logger[_0x0b18('0x10')](_0x0b18('0xc'),_0x9a0e0c,_0x2946e6);_0x446a98(_0x2946e6);});});}exports[_0x0b18('0x15')]=function(_0x3bf93d){var _0x2074d0=this;return new Promise(function(_0x59a471,_0x1ad25a){return db['ReportAgentPreview'][_0x0b18('0x16')](_0x3bf93d[_0x0b18('0x17')],{'raw':_0x3bf93d['options']?_0x3bf93d['options'][_0x0b18('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x36f6b9){logger[_0x0b18('0xb')](_0x0b18('0x15'),_0x3bf93d);logger[_0x0b18('0x19')](_0x0b18('0x15'),_0x3bf93d,JSON[_0x0b18('0xf')](_0x36f6b9));_0x59a471(_0x36f6b9);})[_0x0b18('0x14')](function(_0x15c290){logger[_0x0b18('0x10')](_0x0b18('0x15'),_0x15c290['message'],_0x3bf93d);_0x1ad25a(_0x2074d0['error'](0x1f4,_0x15c290[_0x0b18('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 3aec5f4..4b46686 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 _0x5af0=['voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x5af0,0x89));var _0x05af=function(_0x463b56,_0x38026e){_0x463b56=_0x463b56-0x0;var _0x1b47d6=_0x5af0[_0x463b56];return _0x1b47d6;};'use strict';var multer=require(_0x05af('0x0'));var util=require('util');var path=require(_0x05af('0x1'));var express=require(_0x05af('0x2'));var router=express[_0x05af('0x3')]();var auth=require(_0x05af('0x4'));var controller=require(_0x05af('0x5'));router[_0x05af('0x6')](_0x05af('0x7'),auth[_0x05af('0x8')](),controller['voiceChannels']);router['get'](_0x05af('0x9'),auth[_0x05af('0x8')](),controller[_0x05af('0xa')]);router[_0x05af('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x05af('0x8')](),controller[_0x05af('0xb')]);router[_0x05af('0x6')](_0x05af('0xc'),auth[_0x05af('0x8')](),controller['voiceQueues']);router['get'](_0x05af('0xd'),auth[_0x05af('0x8')](),controller[_0x05af('0xe')]);router[_0x05af('0x6')](_0x05af('0xf'),auth[_0x05af('0x8')](),controller['mailQueues']);router[_0x05af('0x6')](_0x05af('0x10'),auth[_0x05af('0x8')](),controller[_0x05af('0x11')]);router[_0x05af('0x6')](_0x05af('0x12'),auth['isAuthenticated'](),controller[_0x05af('0x13')]);router[_0x05af('0x6')]('/sms/queues',auth[_0x05af('0x8')](),controller[_0x05af('0x14')]);router[_0x05af('0x6')](_0x05af('0x15'),auth['isAuthenticated'](),controller[_0x05af('0x16')]);router[_0x05af('0x6')](_0x05af('0x17'),auth[_0x05af('0x8')](),controller['faxQueues']);router['get'](_0x05af('0x18'),auth['isAuthenticated'](),controller[_0x05af('0x19')]);router[_0x05af('0x6')](_0x05af('0x1a'),auth[_0x05af('0x8')](),controller['voiceQueuesChannels']);router[_0x05af('0x6')](_0x05af('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router['get'](_0x05af('0x1c'),auth[_0x05af('0x8')](),controller[_0x05af('0x1d')]);router[_0x05af('0x6')](_0x05af('0x1e'),auth['isAuthenticated'](),controller[_0x05af('0x1f')]);router['get']('/voice/queues/:id',auth[_0x05af('0x8')](),controller['showVoiceQueues']);router[_0x05af('0x20')](_0x05af('0x21'),auth[_0x05af('0x8')](),controller[_0x05af('0x22')]);router['get'](_0x05af('0x23'),auth['isAuthenticated'](),controller[_0x05af('0x24')]);router[_0x05af('0x6')](_0x05af('0x25'),auth['isAuthenticated'](),controller[_0x05af('0x26')]);router[_0x05af('0x6')](_0x05af('0x27'),auth[_0x05af('0x8')](),controller[_0x05af('0x28')]);router[_0x05af('0x20')]('/agents/:id/capacity',auth[_0x05af('0x8')](),controller['agentCapacity']);router[_0x05af('0x6')](_0x05af('0x29'),auth[_0x05af('0x8')](),controller['telephones']);router[_0x05af('0x6')](_0x05af('0x2a'),auth[_0x05af('0x8')](),controller[_0x05af('0x2b')]);router[_0x05af('0x6')](_0x05af('0x2c'),auth[_0x05af('0x8')](),controller[_0x05af('0x2d')]);router[_0x05af('0x6')](_0x05af('0x2e'),auth[_0x05af('0x8')](),controller[_0x05af('0x2f')]);router[_0x05af('0x6')](_0x05af('0x30'),auth[_0x05af('0x8')](),controller[_0x05af('0x31')]);router['get'](_0x05af('0x32'),auth[_0x05af('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x05af('0x6')](_0x05af('0x33'),auth[_0x05af('0x8')](),controller[_0x05af('0x34')]);router[_0x05af('0x6')](_0x05af('0x35'),auth[_0x05af('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x05af('0x6')](_0x05af('0x36'),auth[_0x05af('0x8')](),controller[_0x05af('0x37')]);router[_0x05af('0x6')](_0x05af('0x38'),auth[_0x05af('0x8')](),controller[_0x05af('0x39')]);router['get'](_0x05af('0x3a'),auth[_0x05af('0x8')](),controller[_0x05af('0x3b')]);router[_0x05af('0x3c')](_0x05af('0x3d'),auth['isAuthenticated'](),controller[_0x05af('0x3e')](_0x05af('0x3f')));router[_0x05af('0x6')](_0x05af('0x40'),auth[_0x05af('0x8')](),controller['showMailQueues']);router[_0x05af('0x3c')]('/chat/queues/:id/notify',auth[_0x05af('0x8')](),controller[_0x05af('0x3e')](_0x05af('0x41')));router[_0x05af('0x6')]('/chat/queues/:id',auth[_0x05af('0x8')](),controller[_0x05af('0x42')]);router[_0x05af('0x3c')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x05af('0x3e')](_0x05af('0x43')));router[_0x05af('0x6')](_0x05af('0x44'),auth[_0x05af('0x8')](),controller[_0x05af('0x45')]);router[_0x05af('0x3c')](_0x05af('0x46'),auth[_0x05af('0x8')](),controller[_0x05af('0x3e')](_0x05af('0x47')));router[_0x05af('0x6')]('/openchannel/queues/:id',auth[_0x05af('0x8')](),controller['showOpenchannelQueues']);router[_0x05af('0x3c')](_0x05af('0x48'),auth[_0x05af('0x8')](),controller[_0x05af('0x3e')](_0x05af('0x49')));router[_0x05af('0x3c')]('/whatsapp/queues/:id/notify',auth[_0x05af('0x8')](),controller['queueNotify'](_0x05af('0x4a')));router[_0x05af('0x6')](_0x05af('0x4b'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x05af('0x6')](_0x05af('0x4c'),auth[_0x05af('0x8')](),controller[_0x05af('0x4d')]);router[_0x05af('0x3c')](_0x05af('0x4e'),auth[_0x05af('0x8')](),controller[_0x05af('0x4f')]);module[_0x05af('0x50')]=router; \ No newline at end of file +var _0xff01=['voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','/agents/:id/capacity','/telephones','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated'];(function(_0x324f55,_0x2e6ca4){var _0x284952=function(_0x36ceae){while(--_0x36ceae){_0x324f55['push'](_0x324f55['shift']());}};_0x284952(++_0x2e6ca4);}(_0xff01,0x130));var _0x1ff0=function(_0x552b0b,_0x49e6be){_0x552b0b=_0x552b0b-0x0;var _0x3a9ce6=_0xff01[_0x552b0b];return _0x3a9ce6;};'use strict';var multer=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var path=require(_0x1ff0('0x2'));var express=require(_0x1ff0('0x3'));var router=express[_0x1ff0('0x4')]();var auth=require(_0x1ff0('0x5'));var controller=require(_0x1ff0('0x6'));router[_0x1ff0('0x7')](_0x1ff0('0x8'),auth['isAuthenticated'](),controller[_0x1ff0('0x9')]);router['get'](_0x1ff0('0xa'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0xc')]);router[_0x1ff0('0x7')](_0x1ff0('0xd'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0xe')]);router[_0x1ff0('0x7')](_0x1ff0('0xf'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x10')]);router[_0x1ff0('0x7')](_0x1ff0('0x11'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x12')]);router['get'](_0x1ff0('0x13'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x14')]);router[_0x1ff0('0x7')](_0x1ff0('0x15'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x16')]);router[_0x1ff0('0x7')]('/openchannel/queues',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x17')]);router['get'](_0x1ff0('0x18'),auth[_0x1ff0('0xb')](),controller['smsQueues']);router[_0x1ff0('0x7')](_0x1ff0('0x19'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x1a')]);router[_0x1ff0('0x7')]('/fax/queues',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x1b')]);router[_0x1ff0('0x7')]('/voice/queues/preview/:id',auth[_0x1ff0('0xb')](),controller['voiceQueuesPreview']);router['get'](_0x1ff0('0x1c'),auth[_0x1ff0('0xb')](),controller['voiceQueuesChannels']);router[_0x1ff0('0x7')](_0x1ff0('0x1d'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x1e')]);router[_0x1ff0('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x1f')]);router[_0x1ff0('0x7')](_0x1ff0('0x20'),auth[_0x1ff0('0xb')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x1ff0('0x21'),auth['isAuthenticated'](),controller[_0x1ff0('0x22')]);router[_0x1ff0('0x23')]('/voice/queues/:id',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x24')]);router[_0x1ff0('0x7')](_0x1ff0('0x25'),auth[_0x1ff0('0xb')](),controller['outbound']);router['get'](_0x1ff0('0x26'),auth[_0x1ff0('0xb')](),controller['outboundChannels']);router[_0x1ff0('0x7')](_0x1ff0('0x27'),auth[_0x1ff0('0xb')](),controller['agents']);router['put'](_0x1ff0('0x28'),auth[_0x1ff0('0xb')](),controller['agentCapacity']);router['get'](_0x1ff0('0x29'),auth[_0x1ff0('0xb')](),controller['telephones']);router[_0x1ff0('0x7')]('/trunks',auth[_0x1ff0('0xb')](),controller['trunks']);router[_0x1ff0('0x7')](_0x1ff0('0x2a'),auth['isAuthenticated'](),controller[_0x1ff0('0x2b')]);router[_0x1ff0('0x7')]('/fax/accounts',auth[_0x1ff0('0xb')](),controller['faxAccounts']);router['get'](_0x1ff0('0x2c'),auth['isAuthenticated'](),controller[_0x1ff0('0x2d')]);router[_0x1ff0('0x7')](_0x1ff0('0x2e'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x2f')]);router[_0x1ff0('0x7')](_0x1ff0('0x30'),auth[_0x1ff0('0xb')](),controller['openchannelQueuesWaitingInteractions']);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x31')]);router[_0x1ff0('0x7')](_0x1ff0('0x32'),auth[_0x1ff0('0xb')](),controller['smsQueuesWaitingInteractions']);router['get'](_0x1ff0('0x33'),auth[_0x1ff0('0xb')](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x34')]);router[_0x1ff0('0x35')](_0x1ff0('0x36'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x37')](_0x1ff0('0x38')));router['get'](_0x1ff0('0x39'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x3a')]);router['post'](_0x1ff0('0x3b'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x37')](_0x1ff0('0x3c')));router['get'](_0x1ff0('0x3d'),auth['isAuthenticated'](),controller[_0x1ff0('0x3e')]);router[_0x1ff0('0x35')]('/fax/queues/:id/notify',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x37')](_0x1ff0('0x3f')));router[_0x1ff0('0x7')](_0x1ff0('0x40'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x41')]);router['post'](_0x1ff0('0x42'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x37')](_0x1ff0('0x43')));router[_0x1ff0('0x7')](_0x1ff0('0x44'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x45')]);router[_0x1ff0('0x35')]('/sms/queues/:id/notify',auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x37')]('sms'));router[_0x1ff0('0x35')](_0x1ff0('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0x1ff0('0x47')));router['get'](_0x1ff0('0x48'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x49')]);router[_0x1ff0('0x7')](_0x1ff0('0x4a'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x4b')]);router[_0x1ff0('0x35')](_0x1ff0('0x4c'),auth[_0x1ff0('0xb')](),controller[_0x1ff0('0x4d')]);module[_0x1ff0('0x4e')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 7d55482..c87e761 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 _0xae24=['InteractionId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','bluebird','lodash','../../mysqldb','../../config/logger','client','http','then','error','code','message','result','catch','status','json','sendStatus','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','voiceQueuesPreview','VoiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','length','updateAttributes','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','OpenchannelQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId'];(function(_0x2ef863,_0x77953d){var _0x2e0cee=function(_0x249a0a){while(--_0x249a0a){_0x2ef863['push'](_0x2ef863['shift']());}};_0x2e0cee(++_0x77953d);}(_0xae24,0x182));var _0x4ae2=function(_0x282afd,_0x2d96ba){_0x282afd=_0x282afd-0x0;var _0x1d0943=_0xae24[_0x282afd];return _0x1d0943;};'use strict';var BPromise=require(_0x4ae2('0x0'));var moment=require('moment');var _=require(_0x4ae2('0x1'));var util=require('util');var db=require(_0x4ae2('0x2'))['db'];var logger=require(_0x4ae2('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0x4ae2('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232b});var routingClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x428054,_0x307247,_0x4f2e84){return new BPromise(function(_0x5f589a,_0x41cdf1){var _0x4d3d8a=_0x4f2e84?_0x4f2e84:amiClient;return _0x4d3d8a['request'](_0x428054,_0x307247)[_0x4ae2('0x6')](function(_0xb01e8e){if(_0xb01e8e['error']){if(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x8')]===0x1f4){return _0x41cdf1(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x9')]);}return _0x5f589a(_0xb01e8e['error'][_0x4ae2('0x9')]);}else{_0x5f589a(_0xb01e8e[_0x4ae2('0xa')]);}})[_0x4ae2('0xb')](function(_0x4d7dc3){_0x41cdf1(_0x4d7dc3);});});}function respondWithResult(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xc8;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0xc')](_0x22ac1e)[_0x4ae2('0xd')](_0x30d6c4);}return _0x25d2b4[_0x4ae2('0xe')](0x194);};}function handleError(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0x1f4;return function(_0xd527a0){logger['error'](_0xd527a0['stack']);if(_0xd527a0['name']){delete _0xd527a0[_0x4ae2('0xf')];}_0x145287[_0x4ae2('0xc')](_0x3cabc9)['send'](_0xd527a0);};}function findById(_0x463765){return function(_0x9fb8db){if(!_[_0x4ae2('0x10')](_0x463765)&&!_[_0x4ae2('0x10')](_0x9fb8db)&&!_[_0x4ae2('0x10')](_0x9fb8db[_0x4ae2('0x11')])){return _[_0x4ae2('0x12')](_0x9fb8db[_0x4ae2('0x11')],function(_0x41b672){return _0x41b672['id']==_0x463765;});}return null;};}exports[_0x4ae2('0x13')]=function(_0x4d5071,_0x4a97af){return respondWithRpcPromise(_0x4ae2('0x14'),_0x4d5071[_0x4ae2('0x15')])['then'](respondWithResult(_0x4a97af,null))[_0x4ae2('0xb')](handleError(_0x4a97af,null));};exports[_0x4ae2('0x16')]=function(_0xccb3b,_0x2ad222){return respondWithRpcPromise(_0x4ae2('0x17'),_['merge'](_0xccb3b[_0x4ae2('0x15')],_0xccb3b['params']))['then'](respondWithResult(_0x2ad222,null))[_0x4ae2('0xb')](handleError(_0x2ad222,null));};exports[_0x4ae2('0x18')]=function(_0x802bf0,_0x17041e){return respondWithRpcPromise(_0x4ae2('0x19'),_['merge'](_0x802bf0[_0x4ae2('0x15')],_0x802bf0['params']))[_0x4ae2('0x6')](respondWithResult(_0x17041e,null))[_0x4ae2('0xb')](handleError(_0x17041e,null));};exports[_0x4ae2('0x1a')]=function(_0x57933b,_0x43f112){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x57933b[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x43f112,null))[_0x4ae2('0xb')](handleError(_0x43f112,null));};exports[_0x4ae2('0x1c')]=function(_0x5b2e65,_0x5962b0){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x5b2e65[_0x4ae2('0x15')])[_0x4ae2('0x6')](findById(_0x5b2e65[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x5962b0,null))[_0x4ae2('0xb')](handleError(_0x5962b0,null));};exports['updateVoiceQueue']=function(_0x5ec1fd,_0x3e2666){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x5ec1fd['body'],_0x5ec1fd[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3e2666,null))['catch'](handleError(_0x3e2666,null));};exports[_0x4ae2('0x1e')]=function(_0x37e3e5,_0x3d56ea){return respondWithRpcPromise(_0x4ae2('0x1f'),_[_0x4ae2('0x20')](_0x37e3e5[_0x4ae2('0x15')],_0x37e3e5[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3d56ea,null))[_0x4ae2('0xb')](handleError(_0x3d56ea,null));};exports[_0x4ae2('0x21')]=function(_0x386687,_0x12815f){return respondWithRpcPromise(_0x4ae2('0x22'),_0x386687[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x12815f,null))[_0x4ae2('0xb')](handleError(_0x12815f,null));};exports[_0x4ae2('0x23')]=function(_0x4bd47f,_0xdcd11e){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x4ae2('0x20')](_0x4bd47f[_0x4ae2('0x15')],_0x4bd47f['params']))[_0x4ae2('0x6')](respondWithResult(_0xdcd11e,null))[_0x4ae2('0xb')](handleError(_0xdcd11e,null));};exports[_0x4ae2('0x24')]=function(_0x2dde26,_0x5256d3){return respondWithRpcPromise(_0x4ae2('0x25'),_[_0x4ae2('0x20')](_0x2dde26[_0x4ae2('0x15')],_0x2dde26[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x5256d3,null))[_0x4ae2('0xb')](handleError(_0x5256d3,null));};exports[_0x4ae2('0x26')]=function(_0x46f3a2,_0xe99f9d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ae2('0x20')](_0x46f3a2['query'],_0x46f3a2[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0xe99f9d,null))[_0x4ae2('0xb')](handleError(_0xe99f9d,null));};exports[_0x4ae2('0x27')]=function(_0x771c14,_0x129adf){return respondWithRpcPromise('Outbound',_0x771c14[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x129adf,null))[_0x4ae2('0xb')](handleError(_0x129adf,null));};exports[_0x4ae2('0x28')]=function(_0x49baf9,_0x2d4737){return respondWithRpcPromise(_0x4ae2('0x29'),_0x49baf9[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x2d4737,null))[_0x4ae2('0xb')](handleError(_0x2d4737,null));};exports[_0x4ae2('0x2a')]=function(_0x1fdc61,_0x1b04ee){var _0x1d5888;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')])['then'](function(_0x2c3676){_0x1d5888=_0x2c3676;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')],routingClient);})[_0x4ae2('0x6')](function(_0x5bade3){return _['merge']({},_0x5bade3,_0x1d5888);})[_0x4ae2('0x6')](respondWithResult(_0x1b04ee,null))[_0x4ae2('0xb')](handleError(_0x1b04ee,null));};exports[_0x4ae2('0x2c')]=function(_0x3cdf23,_0x567371){if(_0x3cdf23[_0x4ae2('0x2d')]&&_0x3cdf23[_0x4ae2('0x2d')]['interaction']&&_0x3cdf23[_0x4ae2('0x2e')]&&_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]){for(var _0x5a9126 in _0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')]){if(_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x4ae2('0x30')](_0x5a9126)){db[_0x4ae2('0x31')][_0x4ae2('0x32')]({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')]['name'],'type':_0x4ae2('0x33'),'exitAt':null,'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126]&&_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]['length']?{'$notIn':_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]}:{'$ne':null}}})['then'](function(_0x21baf4){var _0x2ab00f=moment()[_0x4ae2('0x34')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4fc82f=0x0,_0x26681b=_0x21baf4[_0x4ae2('0x35')];_0x4fc82f<_0x26681b;_0x4fc82f+=0x1){_0x21baf4[_0x4fc82f][_0x4ae2('0x36')]({'exitAt':_0x2ab00f});}});for(var _0x8a17a4=0x0;_0x8a17a4<_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x4ae2('0x35')];_0x8a17a4+=0x1){db[_0x4ae2('0x31')]['findOrCreate']({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'type':_0x4ae2('0x33'),'uniqueid':_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x8a17a4],'exitAt':null},'defaults':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'interface':_[_0x4ae2('0x10')](_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x37')])?util[_0x4ae2('0x34')](_0x4ae2('0x38'),_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]):_0x3cdf23['user'][_0x4ae2('0x37')],'type':_0x4ae2('0x33'),'enterAt':moment()[_0x4ae2('0x34')](_0x4ae2('0x39')),'role':_0x4ae2('0x3a'),'internal':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x3b')],'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126][_0x8a17a4]}});}}}}return respondWithRpcPromise(_0x4ae2('0x3c'),{'id':_0x3cdf23[_0x4ae2('0x1d')]['id'],'capacity':_0x3cdf23['body'][_0x4ae2('0x3d')]},routingClient)[_0x4ae2('0x6')](respondWithResult(_0x567371,null))['catch'](handleError(_0x567371,null));};exports[_0x4ae2('0x3e')]=function(_0x4d6560,_0x426d29){return respondWithRpcPromise('Telephones',_0x4d6560[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x426d29,null))[_0x4ae2('0xb')](handleError(_0x426d29,null));};exports[_0x4ae2('0x3f')]=function(_0x8525c4,_0x153673){return respondWithRpcPromise(_0x4ae2('0x40'),_0x8525c4[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x153673,null))['catch'](handleError(_0x153673,null));};exports[_0x4ae2('0x41')]=function(_0x4284b4,_0x825c3a){return respondWithRpcPromise(_0x4ae2('0x42'),_0x4284b4['query'])[_0x4ae2('0x6')](respondWithResult(_0x825c3a,null))[_0x4ae2('0xb')](handleError(_0x825c3a,null));};exports[_0x4ae2('0x43')]=function(_0x49029e,_0x51f845){return respondWithRpcPromise(_0x4ae2('0x44'),_0x49029e[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51f845,null))[_0x4ae2('0xb')](handleError(_0x51f845,null));};exports[_0x4ae2('0x45')]=function(_0x28d68e,_0x18a8e6){return respondWithRpcPromise(_0x4ae2('0x44'),_0x28d68e[_0x4ae2('0x15')],routingClient)['then'](findById(_0x28d68e[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x18a8e6,null))[_0x4ae2('0xb')](handleError(_0x18a8e6,null));};exports[_0x4ae2('0x46')]=function(_0x28e7a8,_0x2143fe){return respondWithRpcPromise(_0x4ae2('0x47'),_0x28e7a8[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x2143fe,null))[_0x4ae2('0xb')](handleError(_0x2143fe,null));};exports['showMailQueues']=function(_0x496f98,_0x33fb77){return respondWithRpcPromise(_0x4ae2('0x47'),_0x496f98[_0x4ae2('0x15')],routingClient)['then'](findById(_0x496f98['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x33fb77,null))[_0x4ae2('0xb')](handleError(_0x33fb77,null));};exports[_0x4ae2('0x48')]=function(_0x201b25,_0x41601d){return respondWithRpcPromise('MailAccounts',_0x201b25['query'],mailClient)['then'](respondWithResult(_0x41601d,null))[_0x4ae2('0xb')](handleError(_0x41601d,null));};exports['openchannelQueues']=function(_0x4e54d1,_0x17f023){return respondWithRpcPromise('OpenchannelQueues',_0x4e54d1[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x17f023,null))[_0x4ae2('0xb')](handleError(_0x17f023,null));};exports['showOpenchannelQueues']=function(_0xf417c0,_0x51141d){return respondWithRpcPromise(_0x4ae2('0x49'),_0xf417c0[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xf417c0[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x51141d,null))['catch'](handleError(_0x51141d,null));};exports['smsQueues']=function(_0x344963,_0x256d2f){return respondWithRpcPromise('SmsQueues',_0x344963[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x256d2f,null))['catch'](handleError(_0x256d2f,null));};exports[_0x4ae2('0x4a')]=function(_0xefd494,_0x49c58c){return respondWithRpcPromise('SmsQueues',_0xefd494[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xefd494['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x49c58c,null))[_0x4ae2('0xb')](handleError(_0x49c58c,null));};exports[_0x4ae2('0x4b')]=function(_0x30003b,_0x5af418){return respondWithRpcPromise(_0x4ae2('0x4c'),_0x30003b[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x5af418,null))[_0x4ae2('0xb')](handleError(_0x5af418,null));};exports[_0x4ae2('0x4d')]=function(_0x3412a1,_0x525cc5){return respondWithRpcPromise('WhatsappQueues',_0x3412a1[_0x4ae2('0x15')],routingClient)['then'](findById(_0x3412a1[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x525cc5,null))[_0x4ae2('0xb')](handleError(_0x525cc5,null));};exports['faxQueues']=function(_0x2758c0,_0x519763){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x2758c0['query'],routingClient)['then'](respondWithResult(_0x519763,null))[_0x4ae2('0xb')](handleError(_0x519763,null));};exports[_0x4ae2('0x4f')]=function(_0x1a603b,_0xde3aac){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x1a603b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0x1a603b[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0xde3aac,null))[_0x4ae2('0xb')](handleError(_0xde3aac,null));};exports[_0x4ae2('0x50')]=function(_0x4403ed,_0x55f1fe){return respondWithRpcPromise(_0x4ae2('0x51'),_0x4403ed[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x55f1fe,null))[_0x4ae2('0xb')](handleError(_0x55f1fe,null));};exports['chatQueuesWaitingInteractions']=function(_0x18f568,_0x5add54){return respondWithRpcPromise(_0x4ae2('0x52'),_0x18f568[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x5add54,null))[_0x4ae2('0xb')](handleError(_0x5add54,null));};exports[_0x4ae2('0x53')]=function(_0x318b4a,_0x4ed285){return respondWithRpcPromise(_0x4ae2('0x54'),_0x318b4a[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4ed285,null))['catch'](handleError(_0x4ed285,null));};exports[_0x4ae2('0x55')]=function(_0x36f5c4,_0x4082d4){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x36f5c4[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4082d4,null))[_0x4ae2('0xb')](handleError(_0x4082d4,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2bb165,_0x278c5e){return respondWithRpcPromise(_0x4ae2('0x56'),_0x2bb165[_0x4ae2('0x15')],routingClient)['then'](function(_0x390c71){if(_0x2bb165[_0x4ae2('0x15')][_0x4ae2('0x57')]!==undefined){var _0x98272b=_(_0x390c71[_0x4ae2('0x11')])[_0x4ae2('0x58')]([_0x2bb165[_0x4ae2('0x15')]['type'],_0x2bb165['params']['id']])[_0x4ae2('0x59')](_0x4ae2('0x5a'))[_0x4ae2('0x5b')]()[_0x4ae2('0x5c')]();return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x4b0606){return _0x98272b[_0x4ae2('0x5d')](_0x4b0606[_0x4ae2('0x5a')])>-0x1;});}else{return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x22a880){return _0x22a880[_0x4ae2('0x5a')]===parseInt(_0x2bb165['params']['id']);});}})[_0x4ae2('0x6')](respondWithResult(_0x278c5e,null))[_0x4ae2('0xb')](handleError(_0x278c5e,null));};exports[_0x4ae2('0x5e')]=function(_0x3a84d7,_0x1bf2a4){return respondWithRpcPromise(_0x4ae2('0x5f'),_0x3a84d7['query'],routingClient)['then'](respondWithResult(_0x1bf2a4,null))[_0x4ae2('0xb')](handleError(_0x1bf2a4,null));};exports[_0x4ae2('0x60')]=function(_0x517ecb,_0x9320c1){return respondWithRpcPromise(_0x4ae2('0x61'),_0x517ecb[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x9320c1,null))[_0x4ae2('0xb')](handleError(_0x9320c1,null));};exports[_0x4ae2('0x62')]=function(_0xc4748b,_0x51cbf9){return respondWithRpcPromise(_0x4ae2('0x63'),_0xc4748b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51cbf9,null))[_0x4ae2('0xb')](handleError(_0x51cbf9,null));};exports[_0x4ae2('0x64')]=function(_0x29b0d0){return function(_0x555d17,_0x2cba96){var _0x417774,_0x17f398;var _0x58474e=_[_0x4ae2('0x65')](_0x29b0d0);var _0x49da03=_0x29b0d0===_0x4ae2('0x66')?_0x4ae2('0x67'):_0x4ae2('0x68');return db[_0x58474e+_0x4ae2('0x69')][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0x555d17['params']['id']}})[_0x4ae2('0x6')](function(_0x384c7e){if(_[_0x4ae2('0x10')](_0x384c7e)){throw new Error(_0x58474e+_0x4ae2('0x6b'));}_0x417774=_0x384c7e;return db[_0x58474e+'Message'][_0x4ae2('0x6a')]({'where':{'id':_0x555d17['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x58474e+_0x4ae2('0x6d')],'as':'Interaction'},{'model':db[_0x58474e+_0x49da03],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x29eaf4){if(_[_0x4ae2('0x10')](_0x29eaf4)){throw new Error(_0x58474e+_0x4ae2('0x6e'));}_0x17f398=_0x29eaf4;return _0x29eaf4[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2f97d7={'uniqueid':_0x29b0d0+'.'+_0x17f398['id']+'.'+_0x17f398['Interaction']['id'],'FromUserId':_0x555d17[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70')};_0x2f97d7[_0x58474e+_0x4ae2('0x71')]=_0x17f398['id'];_0x2f97d7[_0x58474e+_0x4ae2('0x72')]=_0x17f398[_0x4ae2('0x6d')]['id'];_0x2f97d7[_0x4ae2('0x73')+_0x58474e+_0x49da03+'Id']=_0x17f398['Account']['id'];_0x2f97d7['To'+_0x58474e+'QueueId']=_0x417774['id'];return db[_0x58474e+_0x4ae2('0x74')][_0x4ae2('0x75')](_0x2f97d7);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x29b0d0,'interaction':_0x17f398[_0x4ae2('0x6d')],'message':_0x17f398,'account':_0x17f398[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x70'),'appdata':_0x417774[_0x4ae2('0xf')]+','+(_0x17f398['Account'][_0x4ae2('0x77')]||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0x2cba96,null))[_0x4ae2('0xb')](handleError(_0x2cba96,null));};};exports[_0x4ae2('0x79')]=function(_0xa79171,_0xa42e4d){var _0x1deb7d,_0x8d0217;if(_[_0x4ae2('0x10')](_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')])){throw new Error(_0x4ae2('0x7b'));}var _0x310f93=_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')];var _0x31c1f7=_['capitalize'](_0x310f93);var _0x3de590=_0x310f93===_0x4ae2('0x66')?_0x4ae2('0x67'):'Account';return db['User'][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0xa79171[_0x4ae2('0x1d')]['id'],'role':'agent'}})[_0x4ae2('0x6')](function(_0x21c4ec){if(_['isNil'](_0x21c4ec)){throw new Error(_0x4ae2('0x7c'));}_0x1deb7d=_0x21c4ec;return db[_0x31c1f7+'Message']['findOne']({'where':{'id':_0xa79171['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x31c1f7+'Interaction'],'as':_0x4ae2('0x6d')},{'model':db[_0x31c1f7+_0x3de590],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x232e64){if(_[_0x4ae2('0x10')](_0x232e64)){throw new Error(_0x31c1f7+_0x4ae2('0x6e'));}_0x8d0217=_0x232e64;return _0x232e64[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ae2('0x6')](function(){var _0x386c80={'uniqueid':_0x310f93+'.'+_0x8d0217['id']+'.'+_0x8d0217['Interaction']['id'],'FromUserId':_0xa79171[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70'),'ToUserId':_0x1deb7d['id']};_0x386c80[_0x31c1f7+_0x4ae2('0x71')]=_0x8d0217['id'];_0x386c80[_0x31c1f7+_0x4ae2('0x72')]=_0x8d0217['Interaction']['id'];_0x386c80[_0x4ae2('0x73')+_0x31c1f7+_0x3de590+'Id']=_0x8d0217[_0x4ae2('0x68')]['id'];return db[_0x31c1f7+_0x4ae2('0x74')]['create'](_0x386c80);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x310f93,'interaction':_0x8d0217[_0x4ae2('0x6d')],'message':_0x8d0217,'account':_0x8d0217[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x3a'),'appdata':_0x1deb7d[_0x4ae2('0xf')]+','+(_0x8d0217[_0x4ae2('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0xa42e4d,null))[_0x4ae2('0xb')](handleError(_0xa42e4d,null));}; \ No newline at end of file +var _0x24ca=['telephones','Telephones','trunks','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','queue','MessageId','InteractionId','From','QueueId','Start','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','error','code','message','result','json','sendStatus','stack','status','send','isNil','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','catch','VoiceQueues','showVoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity'];(function(_0x1ece1a,_0xd70db1){var _0x45648a=function(_0x4445df){while(--_0x4445df){_0x1ece1a['push'](_0x1ece1a['shift']());}};_0x45648a(++_0xd70db1);}(_0x24ca,0x1bc));var _0xa24c=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x24ca[_0x21af3a];return _0x268a49;};'use strict';var BPromise=require(_0xa24c('0x0'));var moment=require('moment');var _=require(_0xa24c('0x1'));var util=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var logger=require('../../config/logger')(_0xa24c('0x4'));var jayson=require(_0xa24c('0x5'));var amiClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232a});var mailClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232b});var routingClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){var _0x3a5727=_0x9a5013?_0x9a5013:amiClient;return _0x3a5727[_0xa24c('0x8')](_0x2dd348,_0x257264)['then'](function(_0x399f32){if(_0x399f32[_0xa24c('0x9')]){if(_0x399f32[_0xa24c('0x9')][_0xa24c('0xa')]===0x1f4){return _0x42d89c(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}return _0x481196(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}else{_0x481196(_0x399f32[_0xa24c('0xc')]);}})['catch'](function(_0x43bcd3){_0x42d89c(_0x43bcd3);});});}function respondWithResult(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xc8;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['status'](_0xcee4fe)[_0xa24c('0xd')](_0x2c2af8);}return _0x11090c[_0xa24c('0xe')](0x194);};}function handleError(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0x1f4;return function(_0x1cb08e){logger[_0xa24c('0x9')](_0x1cb08e[_0xa24c('0xf')]);if(_0x1cb08e['name']){delete _0x1cb08e['name'];}_0x26ff28[_0xa24c('0x10')](_0x2fcd8b)[_0xa24c('0x11')](_0x1cb08e);};}function findById(_0x49ce53){return function(_0x5babb5){if(!_[_0xa24c('0x12')](_0x49ce53)&&!_[_0xa24c('0x12')](_0x5babb5)&&!_['isNil'](_0x5babb5[_0xa24c('0x13')])){return _['find'](_0x5babb5[_0xa24c('0x13')],function(_0x2a610a){return _0x2a610a['id']==_0x49ce53;});}return null;};}exports[_0xa24c('0x14')]=function(_0xefdbd9,_0x4ff97c){return respondWithRpcPromise(_0xa24c('0x15'),_0xefdbd9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x4ff97c,null))['catch'](handleError(_0x4ff97c,null));};exports['voiceChannelMixMonitor']=function(_0x506424,_0x4cd77e){return respondWithRpcPromise(_0xa24c('0x18'),_[_0xa24c('0x19')](_0x506424[_0xa24c('0x16')],_0x506424[_0xa24c('0x1a')]))['then'](respondWithResult(_0x4cd77e,null))[_0xa24c('0x1b')](handleError(_0x4cd77e,null));};exports['voiceChannelStopMixMonitor']=function(_0x224bca,_0xb81d97){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa24c('0x19')](_0x224bca[_0xa24c('0x16')],_0x224bca[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0xb81d97,null))[_0xa24c('0x1b')](handleError(_0xb81d97,null));};exports['voiceQueues']=function(_0xec9167,_0x5cc9cb){return respondWithRpcPromise(_0xa24c('0x1c'),_0xec9167[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x5cc9cb,null))['catch'](handleError(_0x5cc9cb,null));};exports[_0xa24c('0x1d')]=function(_0x31c4d9,_0x14fd5a){return respondWithRpcPromise(_0xa24c('0x1c'),_0x31c4d9[_0xa24c('0x16')])[_0xa24c('0x17')](findById(_0x31c4d9[_0xa24c('0x1a')]['id']))['then'](respondWithResult(_0x14fd5a,null))[_0xa24c('0x1b')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x1e')]=function(_0x152120,_0x12dbdc){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xa24c('0x19')](_0x152120[_0xa24c('0x1f')],_0x152120[_0xa24c('0x1a')]))['then'](respondWithResult(_0x12dbdc,null))[_0xa24c('0x1b')](handleError(_0x12dbdc,null));};exports[_0xa24c('0x20')]=function(_0x253d83,_0x4ae35c){return respondWithRpcPromise(_0xa24c('0x21'),_['merge'](_0x253d83[_0xa24c('0x16')],_0x253d83[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x4ae35c,null))['catch'](handleError(_0x4ae35c,null));};exports[_0xa24c('0x22')]=function(_0x53f90,_0x1d0379){return respondWithRpcPromise('VoiceQueuesChannels',_0x53f90[_0xa24c('0x16')])['then'](respondWithResult(_0x1d0379,null))[_0xa24c('0x1b')](handleError(_0x1d0379,null));};exports[_0xa24c('0x23')]=function(_0x592198,_0x5680f5){return respondWithRpcPromise(_0xa24c('0x24'),_[_0xa24c('0x19')](_0x592198[_0xa24c('0x16')],_0x592198[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x5680f5,null))[_0xa24c('0x1b')](handleError(_0x5680f5,null));};exports[_0xa24c('0x25')]=function(_0x4b4dc2,_0x39f146){return respondWithRpcPromise(_0xa24c('0x26'),_[_0xa24c('0x19')](_0x4b4dc2[_0xa24c('0x16')],_0x4b4dc2[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x39f146,null))[_0xa24c('0x1b')](handleError(_0x39f146,null));};exports[_0xa24c('0x27')]=function(_0x1ea166,_0x129bb9){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xa24c('0x19')](_0x1ea166[_0xa24c('0x16')],_0x1ea166[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x129bb9,null))['catch'](handleError(_0x129bb9,null));};exports['outbound']=function(_0x19a65f,_0x56ef4d){return respondWithRpcPromise(_0xa24c('0x28'),_0x19a65f[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x56ef4d,null))[_0xa24c('0x1b')](handleError(_0x56ef4d,null));};exports[_0xa24c('0x29')]=function(_0x4c0fb9,_0x532875){return respondWithRpcPromise(_0xa24c('0x2a'),_0x4c0fb9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x532875,null))[_0xa24c('0x1b')](handleError(_0x532875,null));};exports[_0xa24c('0x2b')]=function(_0x472912,_0x5080d0){var _0x56f392;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912[_0xa24c('0x16')])[_0xa24c('0x17')](function(_0x2101f8){_0x56f392=_0x2101f8;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912['query'],routingClient);})[_0xa24c('0x17')](function(_0x7895e){return _['merge']({},_0x7895e,_0x56f392);})['then'](respondWithResult(_0x5080d0,null))[_0xa24c('0x1b')](handleError(_0x5080d0,null));};exports[_0xa24c('0x2d')]=function(_0x231eea,_0x537849){if(_0x231eea['body']&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]&&_0x231eea[_0xa24c('0x2f')]&&_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')]){for(var _0x1b7faf in _0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]){if(_0x231eea['body']['interaction'][_0xa24c('0x31')](_0x1b7faf)){db[_0xa24c('0x32')][_0xa24c('0x33')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea['user'][_0xa24c('0x30')],'type':_0xa24c('0x34'),'exitAt':null,'uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')]?{'$notIn':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]}:{'$ne':null}}})[_0xa24c('0x17')](function(_0x4bbf93){var _0xb8c7a5=moment()[_0xa24c('0x36')](_0xa24c('0x37'));for(var _0x5aa2b2=0x0,_0x3a85cb=_0x4bbf93[_0xa24c('0x35')];_0x5aa2b2<_0x3a85cb;_0x5aa2b2+=0x1){_0x4bbf93[_0x5aa2b2][_0xa24c('0x38')]({'exitAt':_0xb8c7a5});}});for(var _0x31f05b=0x0;_0x31f05b<_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')];_0x31f05b+=0x1){db[_0xa24c('0x32')][_0xa24c('0x39')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'type':'INTERACTION','uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0x31f05b],'exitAt':null},'defaults':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'interface':_[_0xa24c('0x12')](_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3a')])?util[_0xa24c('0x36')](_0xa24c('0x3b'),_0x231eea['user']['name']):_0x231eea[_0xa24c('0x2f')]['interface'],'type':_0xa24c('0x34'),'enterAt':moment()[_0xa24c('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa24c('0x3c'),'internal':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3d')],'uniqueid':_0x231eea['body']['interaction'][_0x1b7faf][_0x31f05b]}});}}}}return respondWithRpcPromise(_0xa24c('0x3e'),{'id':_0x231eea['params']['id'],'capacity':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x3f')]},routingClient)[_0xa24c('0x17')](respondWithResult(_0x537849,null))[_0xa24c('0x1b')](handleError(_0x537849,null));};exports[_0xa24c('0x40')]=function(_0x1fa739,_0x3f3ce6){return respondWithRpcPromise(_0xa24c('0x41'),_0x1fa739[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x3f3ce6,null))['catch'](handleError(_0x3f3ce6,null));};exports[_0xa24c('0x42')]=function(_0x2759c1,_0x233f8e){return respondWithRpcPromise('Trunks',_0x2759c1['query'])['then'](respondWithResult(_0x233f8e,null))[_0xa24c('0x1b')](handleError(_0x233f8e,null));};exports['campaigns']=function(_0x4757ff,_0x21d0fc){return respondWithRpcPromise('Campaigns',_0x4757ff[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x21d0fc,null))[_0xa24c('0x1b')](handleError(_0x21d0fc,null));};exports[_0xa24c('0x43')]=function(_0x162a11,_0x3a72e3){return respondWithRpcPromise(_0xa24c('0x44'),_0x162a11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x3a72e3,null))[_0xa24c('0x1b')](handleError(_0x3a72e3,null));};exports['showChatQueues']=function(_0x5abd45,_0x565f0a){return respondWithRpcPromise('ChatQueues',_0x5abd45['query'],routingClient)[_0xa24c('0x17')](findById(_0x5abd45['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x565f0a,null))[_0xa24c('0x1b')](handleError(_0x565f0a,null));};exports[_0xa24c('0x45')]=function(_0x1a5f17,_0xa371d2){return respondWithRpcPromise(_0xa24c('0x46'),_0x1a5f17[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0xa371d2,null))[_0xa24c('0x1b')](handleError(_0xa371d2,null));};exports[_0xa24c('0x47')]=function(_0x303b7d,_0x37dbbd){return respondWithRpcPromise(_0xa24c('0x46'),_0x303b7d[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0x303b7d['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x37dbbd,null))[_0xa24c('0x1b')](handleError(_0x37dbbd,null));};exports['mailAccounts']=function(_0x1e08bb,_0x179ae1){return respondWithRpcPromise(_0xa24c('0x48'),_0x1e08bb[_0xa24c('0x16')],mailClient)['then'](respondWithResult(_0x179ae1,null))['catch'](handleError(_0x179ae1,null));};exports[_0xa24c('0x49')]=function(_0x5e9631,_0x486040){return respondWithRpcPromise(_0xa24c('0x4a'),_0x5e9631[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x486040,null))[_0xa24c('0x1b')](handleError(_0x486040,null));};exports['showOpenchannelQueues']=function(_0x48a7b2,_0x29b836){return respondWithRpcPromise('OpenchannelQueues',_0x48a7b2['query'],routingClient)[_0xa24c('0x17')](findById(_0x48a7b2[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x29b836,null))['catch'](handleError(_0x29b836,null));};exports[_0xa24c('0x4b')]=function(_0x128e5b,_0x5c3285){return respondWithRpcPromise(_0xa24c('0x4c'),_0x128e5b[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x5c3285,null))['catch'](handleError(_0x5c3285,null));};exports[_0xa24c('0x4d')]=function(_0x34e261,_0x21439a){return respondWithRpcPromise(_0xa24c('0x4c'),_0x34e261[_0xa24c('0x16')],routingClient)['then'](findById(_0x34e261[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x21439a,null))[_0xa24c('0x1b')](handleError(_0x21439a,null));};exports[_0xa24c('0x4e')]=function(_0xab5260,_0x2ca3fa){return respondWithRpcPromise(_0xa24c('0x4f'),_0xab5260['query'],routingClient)[_0xa24c('0x17')](respondWithResult(_0x2ca3fa,null))[_0xa24c('0x1b')](handleError(_0x2ca3fa,null));};exports['showWhatsappQueues']=function(_0xb1048a,_0x3e455b){return respondWithRpcPromise(_0xa24c('0x4f'),_0xb1048a[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xb1048a[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x3e455b,null))[_0xa24c('0x1b')](handleError(_0x3e455b,null));};exports[_0xa24c('0x50')]=function(_0x32ddc3,_0x50141e){return respondWithRpcPromise(_0xa24c('0x51'),_0x32ddc3[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x50141e,null))['catch'](handleError(_0x50141e,null));};exports[_0xa24c('0x52')]=function(_0xfd57fb,_0x2cc592){return respondWithRpcPromise('FaxQueues',_0xfd57fb[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xfd57fb[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x2cc592,null))[_0xa24c('0x1b')](handleError(_0x2cc592,null));};exports[_0xa24c('0x53')]=function(_0x4f9b56,_0x4c374d){return respondWithRpcPromise(_0xa24c('0x54'),_0x4f9b56['query'])[_0xa24c('0x17')](respondWithResult(_0x4c374d,null))[_0xa24c('0x1b')](handleError(_0x4c374d,null));};exports[_0xa24c('0x55')]=function(_0x4073c5,_0x12d715){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4073c5[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x12d715,null))[_0xa24c('0x1b')](handleError(_0x12d715,null));};exports[_0xa24c('0x56')]=function(_0x987aca,_0x389c08){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x987aca[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x389c08,null))[_0xa24c('0x1b')](handleError(_0x389c08,null));};exports[_0xa24c('0x57')]=function(_0x5ebdd1,_0x403bf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ebdd1[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x403bf1,null))[_0xa24c('0x1b')](handleError(_0x403bf1,null));};exports[_0xa24c('0x58')]=function(_0x5726e1,_0x2e612d){return respondWithRpcPromise(_0xa24c('0x59'),_0x5726e1['query'],routingClient)[_0xa24c('0x17')](function(_0x168a8b){if(_0x5726e1[_0xa24c('0x16')][_0xa24c('0x5a')]!==undefined){var _0x8bd3fb=_(_0x168a8b[_0xa24c('0x13')])[_0xa24c('0x5b')]([_0x5726e1[_0xa24c('0x16')]['type'],_0x5726e1[_0xa24c('0x1a')]['id']])[_0xa24c('0x5c')](_0xa24c('0x5d'))[_0xa24c('0x5e')]()[_0xa24c('0x5f')]();return _0x168a8b[_0xa24c('0x13')][_0xa24c('0x5b')](function(_0x13dbef){return _0x8bd3fb[_0xa24c('0x60')](_0x13dbef[_0xa24c('0x5d')])>-0x1;});}else{return _0x168a8b[_0xa24c('0x13')]['filter'](function(_0x283c5b){return _0x283c5b[_0xa24c('0x5d')]===parseInt(_0x5726e1['params']['id']);});}})[_0xa24c('0x17')](respondWithResult(_0x2e612d,null))[_0xa24c('0x1b')](handleError(_0x2e612d,null));};exports[_0xa24c('0x61')]=function(_0x4f0f11,_0x5b4468){return respondWithRpcPromise(_0xa24c('0x62'),_0x4f0f11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x5b4468,null))[_0xa24c('0x1b')](handleError(_0x5b4468,null));};exports[_0xa24c('0x63')]=function(_0x106178,_0x27a666){return respondWithRpcPromise(_0xa24c('0x64'),_0x106178[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x27a666,null))['catch'](handleError(_0x27a666,null));};exports['faxQueuesWaitingInteractions']=function(_0x263dab,_0x521894){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x263dab[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x521894,null))[_0xa24c('0x1b')](handleError(_0x521894,null));};exports[_0xa24c('0x65')]=function(_0x84ddcc){return function(_0x45b2fe,_0x16f93a){var _0x170b65,_0x2544fc;var _0x4ee10d=_[_0xa24c('0x66')](_0x84ddcc);var _0xa077c8=_0x84ddcc===_0xa24c('0x67')?_0xa24c('0x68'):_0xa24c('0x69');return db[_0x4ee10d+_0xa24c('0x6a')][_0xa24c('0x6b')]({'raw':!![],'where':{'id':_0x45b2fe[_0xa24c('0x1a')]['id']}})[_0xa24c('0x17')](function(_0x3c5495){if(_[_0xa24c('0x12')](_0x3c5495)){throw new Error(_0x4ee10d+_0xa24c('0x6c'));}_0x170b65=_0x3c5495;return db[_0x4ee10d+'Message'][_0xa24c('0x6b')]({'where':{'id':_0x45b2fe[_0xa24c('0x1f')]['messageId']},'include':[{'model':db[_0x4ee10d+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x4ee10d+_0xa077c8],'as':_0xa24c('0x69')}]});})['then'](function(_0x549e07){if(_[_0xa24c('0x12')](_0x549e07)){throw new Error(_0x4ee10d+'\x20Message\x20not\x20found');}_0x2544fc=_0x549e07;return _0x549e07[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4c108f={'uniqueid':_0x84ddcc+'.'+_0x2544fc['id']+'.'+_0x2544fc['Interaction']['id'],'FromUserId':_0x45b2fe[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f')};_0x4c108f[_0x4ee10d+_0xa24c('0x70')]=_0x2544fc['id'];_0x4c108f[_0x4ee10d+_0xa24c('0x71')]=_0x2544fc['Interaction']['id'];_0x4c108f[_0xa24c('0x72')+_0x4ee10d+_0xa077c8+'Id']=_0x2544fc[_0xa24c('0x69')]['id'];_0x4c108f['To'+_0x4ee10d+_0xa24c('0x73')]=_0x170b65['id'];return db[_0x4ee10d+'TransferReport']['create'](_0x4c108f);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x84ddcc,'interaction':_0x2544fc[_0xa24c('0x6d')],'message':_0x2544fc,'account':_0x2544fc['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x170b65[_0xa24c('0x30')]+','+(_0x2544fc['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x16f93a,null))[_0xa24c('0x1b')](handleError(_0x16f93a,null));};};exports[_0xa24c('0x75')]=function(_0xd23eb3,_0x890e15){var _0x12836d,_0x280fa2;if(_[_0xa24c('0x12')](_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x76')])){throw new Error(_0xa24c('0x77'));}var _0x24b28c=_0xd23eb3['body'][_0xa24c('0x76')];var _0x292c22=_['capitalize'](_0x24b28c);var _0x2fd4a2=_0x24b28c==='chat'?'Website':'Account';return db[_0xa24c('0x78')]['findOne']({'raw':!![],'where':{'id':_0xd23eb3[_0xa24c('0x1a')]['id'],'role':'agent'}})[_0xa24c('0x17')](function(_0x144c3b){if(_['isNil'](_0x144c3b)){throw new Error(_0xa24c('0x79'));}_0x12836d=_0x144c3b;return db[_0x292c22+'Message'][_0xa24c('0x6b')]({'where':{'id':_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x7a')]},'include':[{'model':db[_0x292c22+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x292c22+_0x2fd4a2],'as':'Account'}]});})[_0xa24c('0x17')](function(_0x5774d2){if(_[_0xa24c('0x12')](_0x5774d2)){throw new Error(_0x292c22+_0xa24c('0x7b'));}_0x280fa2=_0x5774d2;return _0x5774d2[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4b848d={'uniqueid':_0x24b28c+'.'+_0x280fa2['id']+'.'+_0x280fa2[_0xa24c('0x6d')]['id'],'FromUserId':_0xd23eb3[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f'),'ToUserId':_0x12836d['id']};_0x4b848d[_0x292c22+_0xa24c('0x70')]=_0x280fa2['id'];_0x4b848d[_0x292c22+'InteractionId']=_0x280fa2[_0xa24c('0x6d')]['id'];_0x4b848d[_0xa24c('0x72')+_0x292c22+_0x2fd4a2+'Id']=_0x280fa2[_0xa24c('0x69')]['id'];return db[_0x292c22+_0xa24c('0x7c')][_0xa24c('0x7d')](_0x4b848d);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x24b28c,'interaction':_0x280fa2[_0xa24c('0x6d')],'message':_0x280fa2,'account':_0x280fa2[_0xa24c('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa24c('0x3c'),'appdata':_0x12836d[_0xa24c('0x30')]+','+(_0x280fa2[_0xa24c('0x69')][_0xa24c('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x890e15,null))[_0xa24c('0x1b')](handleError(_0x890e15,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 48782f3..9c75b3e 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 _0x01ac=['/:id/run','run','post','create','put','/:id','update','destroy','util','express','Router','fs-extra','./schedule.controller','isAuthenticated','index','get','show'];(function(_0xaea47b,_0xa8f9ef){var _0x29a716=function(_0x26b57c){while(--_0x26b57c){_0xaea47b['push'](_0xaea47b['shift']());}};_0x29a716(++_0xa8f9ef);}(_0x01ac,0x15c));var _0xc01a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x01ac[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0xc01a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc01a('0x1'));var router=express[_0xc01a('0x2')]();var fs_extra=require(_0xc01a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc01a('0x4'));router['get']('/',auth[_0xc01a('0x5')](),controller[_0xc01a('0x6')]);router[_0xc01a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc01a('0x8')]);router[_0xc01a('0x7')](_0xc01a('0x9'),auth[_0xc01a('0x5')](),controller[_0xc01a('0xa')]);router[_0xc01a('0xb')]('/',auth[_0xc01a('0x5')](),controller[_0xc01a('0xc')]);router[_0xc01a('0xd')](_0xc01a('0xe'),auth[_0xc01a('0x5')](),controller[_0xc01a('0xf')]);router['delete'](_0xc01a('0xe'),auth[_0xc01a('0x5')](),controller[_0xc01a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x15ee=['express','Router','../../components/auth/service','../../config/environment','./schedule.controller','index','get','isAuthenticated','/:id/run','post','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3cfdd2,_0xab32f9){var _0x3dff6a=function(_0x5473be){while(--_0x5473be){_0x3cfdd2['push'](_0x3cfdd2['shift']());}};_0x3dff6a(++_0xab32f9);}(_0x15ee,0xd4));var _0xe15e=function(_0xa06e0b,_0x6c2305){_0xa06e0b=_0xa06e0b-0x0;var _0x14142f=_0x15ee[_0xa06e0b];return _0x14142f;};'use strict';var multer=require(_0xe15e('0x0'));var util=require(_0xe15e('0x1'));var path=require(_0xe15e('0x2'));var timeout=require(_0xe15e('0x3'));var express=require(_0xe15e('0x4'));var router=express[_0xe15e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe15e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe15e('0x7'));var controller=require(_0xe15e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe15e('0x9')]);router[_0xe15e('0xa')]('/:id',auth[_0xe15e('0xb')](),controller['show']);router[_0xe15e('0xa')](_0xe15e('0xc'),auth[_0xe15e('0xb')](),controller['run']);router[_0xe15e('0xd')]('/',auth[_0xe15e('0xb')](),controller['create']);router['put'](_0xe15e('0xe'),auth[_0xe15e('0xb')](),controller['update']);router[_0xe15e('0xf')](_0xe15e('0xe'),auth[_0xe15e('0xb')](),controller[_0xe15e('0x10')]);module[_0xe15e('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 0f99c87..b040c68 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 _0x7993=['months','weeks','days','hours','minutes','pdf','csv','ENUM','custom','default','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','years'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x7993,0x1d7));var _0x3799=function(_0x5af9b3,_0x516c90){_0x5af9b3=_0x5af9b3-0x0;var _0x129f28=_0x7993[_0x5af9b3];return _0x129f28;};'use strict';var Sequelize=require('sequelize');module[_0x3799('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3799('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3799('0x1')],'allowNull':![],'defaultValue':_0x3799('0x2')},'startAt':{'type':Sequelize[_0x3799('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3799('0x4'),'quarters',_0x3799('0x5'),_0x3799('0x6'),_0x3799('0x7'),_0x3799('0x8'),_0x3799('0x9')),'allowNull':![],'defaultValue':_0x3799('0x7')},'output':{'type':Sequelize['ENUM']('csv',_0x3799('0xa'),'xlsx'),'allowNull':![],'defaultValue':_0x3799('0xb')},'type':{'type':Sequelize[_0x3799('0xc')](_0x3799('0xd'),_0x3799('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x3799('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0x3799('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x3799('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x3799('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4ea5=['csv','xlsx','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','days','minutes'];(function(_0x3ebff4,_0x5efe9a){var _0x6331b7=function(_0x4860d6){while(--_0x4860d6){_0x3ebff4['push'](_0x3ebff4['shift']());}};_0x6331b7(++_0x5efe9a);}(_0x4ea5,0x1b7));var _0x54ea=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x4ea5[_0x23c6f2];return _0x4c270b;};'use strict';var Sequelize=require(_0x54ea('0x0'));module['exports']={'name':{'type':Sequelize[_0x54ea('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x54ea('0x1')]},'active':{'type':Sequelize[_0x54ea('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x54ea('0x1')],'allowNull':![],'defaultValue':_0x54ea('0x3')},'startAt':{'type':Sequelize[_0x54ea('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x54ea('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x54ea('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x54ea('0x6')](_0x54ea('0x7'),'quarters',_0x54ea('0x8'),'weeks',_0x54ea('0x9'),'hours',_0x54ea('0xa')),'allowNull':![],'defaultValue':_0x54ea('0x9')},'output':{'type':Sequelize[_0x54ea('0x6')](_0x54ea('0xb'),'pdf',_0x54ea('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x54ea('0x6')]('custom',_0x54ea('0xd')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x54ea('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x54ea('0xe')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x54ea('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index f26c1e0..79171b3 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 _0x8774=['body','role','user','autoAssociation','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Scheduler','UserProfileResource','name','index','Schedule','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rawAttributes','intersection','options','find','catch','create'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x8774,0x1ed));var _0x4877=function(_0x2d835d,_0x49adf2){_0x2d835d=_0x2d835d-0x0;var _0x4f74bc=_0x8774[_0x2d835d];return _0x4f74bc;};'use strict';var emlformat=require(_0x4877('0x0'));var rimraf=require(_0x4877('0x1'));var zipdir=require(_0x4877('0x2'));var jsonpatch=require(_0x4877('0x3'));var rp=require(_0x4877('0x4'));var moment=require(_0x4877('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4877('0x6'));var util=require(_0x4877('0x7'));var path=require('path');var sox=require(_0x4877('0x8'));var csv=require(_0x4877('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4877('0xa'));var _=require(_0x4877('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4877('0xc'));var deskjs=require(_0x4877('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4877('0xe'));var Papa=require(_0x4877('0xf'));var Redis=require('ioredis');var authService=require(_0x4877('0x10'));var qs=require(_0x4877('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4877('0x12'));var logger=require(_0x4877('0x13'))(_0x4877('0x14'));var utils=require(_0x4877('0x15'));var config=require(_0x4877('0x16'));var licenseUtil=require(_0x4877('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41cb53,_0x5269f9){_0x5269f9=_0x5269f9||0xcc;return function(_0x752fc){if(_0x752fc){return _0x41cb53[_0x4877('0x18')](_0x5269f9);}return _0x41cb53[_0x4877('0x19')](_0x5269f9)[_0x4877('0x1a')]();};}function respondWithResult(_0x15501f,_0x3e76cb){_0x3e76cb=_0x3e76cb||0xc8;return function(_0x1f42a2){if(_0x1f42a2){return _0x15501f[_0x4877('0x19')](_0x3e76cb)[_0x4877('0x1b')](_0x1f42a2);}};}function respondWithFilteredResult(_0x38d056,_0x5b732a){return function(_0x2cfe57){if(_0x2cfe57){var _0x663983=typeof _0x5b732a[_0x4877('0x1c')]===_0x4877('0x1d')&&typeof _0x5b732a[_0x4877('0x1e')]===_0x4877('0x1d');var _0x14a728=_0x2cfe57['count'];var _0x2994cb=_0x663983?0x0:_0x5b732a[_0x4877('0x1c')];var _0x5ef238=_0x663983?_0x2cfe57[_0x4877('0x1f')]:_0x5b732a[_0x4877('0x1c')]+_0x5b732a['limit'];var _0x10556b;if(_0x5ef238>=_0x14a728){_0x5ef238=_0x14a728;_0x10556b=0xc8;}else{_0x10556b=0xce;}_0x38d056['status'](_0x10556b);return _0x38d056[_0x4877('0x20')](_0x4877('0x21'),_0x2994cb+'-'+_0x5ef238+'/'+_0x14a728)['json'](_0x2cfe57);}return null;};}function patchUpdates(_0x5879cd){return function(_0x5966a4){try{jsonpatch[_0x4877('0x22')](_0x5966a4,_0x5879cd,!![]);}catch(_0x44b8a4){return BPromise['reject'](_0x44b8a4);}return _0x5966a4[_0x4877('0x23')]();};}function saveUpdates(_0x37a3c0,_0x3368f7){return function(_0x11fc4d){if(_0x11fc4d){return _0x11fc4d[_0x4877('0x24')](_0x37a3c0)['then'](function(_0x31ab78){return _0x31ab78;});}return null;};}function removeEntity(_0x4dfcfc,_0x4e3c8c){return function(_0x461d5e){if(_0x461d5e){return _0x461d5e[_0x4877('0x25')]()[_0x4877('0x26')](function(){var _0x2ae061=_0x461d5e[_0x4877('0x27')]({'plain':!![]});var _0x1c8bde=_0x4877('0x28');return db[_0x4877('0x29')]['destroy']({'where':{'type':_0x1c8bde,'resourceId':_0x2ae061['id']}})[_0x4877('0x26')](function(){return _0x461d5e;});})[_0x4877('0x26')](function(){_0x4dfcfc['status'](0xcc)[_0x4877('0x1a')]();});}};}function handleEntityNotFound(_0xe881a3,_0x314e7b){return function(_0xc86c0){if(!_0xc86c0){_0xe881a3[_0x4877('0x18')](0x194);}return _0xc86c0;};}function handleError(_0x878879,_0x44d56a){_0x44d56a=_0x44d56a||0x1f4;return function(_0x278250){logger['error'](_0x278250['stack']);if(_0x278250[_0x4877('0x2a')]){delete _0x278250[_0x4877('0x2a')];}_0x878879[_0x4877('0x19')](_0x44d56a)['send'](_0x278250);};}exports[_0x4877('0x2b')]=function(_0x1af7ef,_0x1906c7){var _0x27220d={},_0x544264={},_0x303932={'count':0x0,'rows':[]};var _0x2a8435=_['map'](db[_0x4877('0x2c')]['rawAttributes'],function(_0x49d4f3){return{'name':_0x49d4f3[_0x4877('0x2d')],'type':_0x49d4f3[_0x4877('0x2e')][_0x4877('0x2f')]};});_0x544264[_0x4877('0x30')]=_[_0x4877('0x31')](_0x2a8435,_0x4877('0x2a'));_0x544264[_0x4877('0x32')]=_[_0x4877('0x33')](_0x1af7ef[_0x4877('0x32')]);_0x544264[_0x4877('0x34')]=_['intersection'](_0x544264[_0x4877('0x30')],_0x544264['query']);_0x27220d[_0x4877('0x35')]=_['intersection'](_0x544264[_0x4877('0x30')],qs[_0x4877('0x36')](_0x1af7ef[_0x4877('0x32')][_0x4877('0x36')]));_0x27220d['attributes']=_0x27220d['attributes'][_0x4877('0x37')]?_0x27220d['attributes']:_0x544264['model'];if(!_0x1af7ef[_0x4877('0x32')][_0x4877('0x38')](_0x4877('0x39'))){_0x27220d['limit']=qs[_0x4877('0x1e')](_0x1af7ef[_0x4877('0x32')][_0x4877('0x1e')]);_0x27220d['offset']=qs[_0x4877('0x1c')](_0x1af7ef[_0x4877('0x32')][_0x4877('0x1c')]);}_0x27220d[_0x4877('0x3a')]=qs[_0x4877('0x3b')](_0x1af7ef[_0x4877('0x32')]['sort']);_0x27220d[_0x4877('0x3c')]=qs[_0x4877('0x34')](_[_0x4877('0x3d')](_0x1af7ef[_0x4877('0x32')],_0x544264[_0x4877('0x34')]),_0x2a8435);if(_0x1af7ef[_0x4877('0x32')][_0x4877('0x3e')]){_0x27220d[_0x4877('0x3c')]=_[_0x4877('0x3f')](_0x27220d[_0x4877('0x3c')],{'$or':_[_0x4877('0x31')](_0x2a8435,function(_0x3f5f73){if(_0x3f5f73[_0x4877('0x2e')]!==_0x4877('0x40')){var _0x2a7a51={};_0x2a7a51[_0x3f5f73['name']]={'$like':'%'+_0x1af7ef[_0x4877('0x32')][_0x4877('0x3e')]+'%'};return _0x2a7a51;}})});}_0x27220d=_[_0x4877('0x3f')]({},_0x27220d,_0x1af7ef['options']);var _0x36576a={'where':_0x27220d[_0x4877('0x3c')]};return db[_0x4877('0x2c')][_0x4877('0x1f')](_0x36576a)[_0x4877('0x26')](function(_0x3d812c){_0x303932[_0x4877('0x1f')]=_0x3d812c;if(_0x1af7ef[_0x4877('0x32')][_0x4877('0x41')]){_0x27220d[_0x4877('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x4877('0x43')](_0x27220d);})[_0x4877('0x26')](function(_0x104c3d){_0x303932['rows']=_0x104c3d;return _0x303932;})[_0x4877('0x26')](respondWithFilteredResult(_0x1906c7,_0x27220d))['catch'](handleError(_0x1906c7,null));};exports['show']=function(_0x36b7a0,_0x2de9e5){var _0x874039={'raw':![],'where':{'id':_0x36b7a0['params']['id']}},_0x24b1c2={};_0x24b1c2[_0x4877('0x30')]=_[_0x4877('0x33')](db['Schedule'][_0x4877('0x44')]);_0x24b1c2[_0x4877('0x32')]=_[_0x4877('0x33')](_0x36b7a0[_0x4877('0x32')]);_0x24b1c2[_0x4877('0x34')]=_['intersection'](_0x24b1c2[_0x4877('0x30')],_0x24b1c2[_0x4877('0x32')]);_0x874039['attributes']=_[_0x4877('0x45')](_0x24b1c2[_0x4877('0x30')],qs[_0x4877('0x36')](_0x36b7a0['query'][_0x4877('0x36')]));_0x874039[_0x4877('0x35')]=_0x874039['attributes']['length']?_0x874039[_0x4877('0x35')]:_0x24b1c2[_0x4877('0x30')];if(_0x36b7a0['query'][_0x4877('0x41')]){_0x874039['include']=[{'all':!![]}];}_0x874039=_[_0x4877('0x3f')]({},_0x874039,_0x36b7a0[_0x4877('0x46')]);return db[_0x4877('0x2c')][_0x4877('0x47')](_0x874039)[_0x4877('0x26')](handleEntityNotFound(_0x2de9e5,null))[_0x4877('0x26')](respondWithResult(_0x2de9e5,null))[_0x4877('0x48')](handleError(_0x2de9e5,null));};exports[_0x4877('0x49')]=function(_0x486456,_0x19cf2f){return db[_0x4877('0x2c')][_0x4877('0x49')](_0x486456[_0x4877('0x4a')],{})['then'](function(_0x331b83){var _0x3786b1=_0x486456['user'][_0x4877('0x27')]({'plain':!![]});if(!_0x3786b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3786b1[_0x4877('0x4b')]===_0x4877('0x4c')){var _0x45f63a=_0x331b83[_0x4877('0x27')]({'plain':!![]});var _0x2e27c4=_0x4877('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x2e27c4,'userProfileId':_0x3786b1['userProfileId']},'raw':!![]})[_0x4877('0x26')](function(_0x22a45b){if(_0x22a45b&&_0x22a45b[_0x4877('0x4d')]===0x0){return db[_0x4877('0x29')]['create']({'name':_0x45f63a[_0x4877('0x2a')],'resourceId':_0x45f63a['id'],'type':_0x22a45b['name'],'sectionId':_0x22a45b['id']},{})['then'](function(){return _0x331b83;});}else{return _0x331b83;}})[_0x4877('0x48')](function(_0xe5a038){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe5a038);throw _0xe5a038;});}return _0x331b83;})[_0x4877('0x26')](respondWithResult(_0x19cf2f,0xc9))[_0x4877('0x48')](handleError(_0x19cf2f,null));};exports[_0x4877('0x24')]=function(_0x564020,_0x1cb3db){if(_0x564020['body']['id']){delete _0x564020[_0x4877('0x4a')]['id'];}return db['Schedule'][_0x4877('0x47')]({'where':{'id':_0x564020[_0x4877('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1cb3db,null))[_0x4877('0x26')](saveUpdates(_0x564020['body'],null))[_0x4877('0x26')](respondWithResult(_0x1cb3db,null))[_0x4877('0x48')](handleError(_0x1cb3db,null));};exports[_0x4877('0x25')]=function(_0x368fca,_0x137115){return db[_0x4877('0x2c')][_0x4877('0x47')]({'where':{'id':_0x368fca['params']['id']}})[_0x4877('0x26')](handleEntityNotFound(_0x137115,null))[_0x4877('0x26')](removeEntity(_0x137115,null))[_0x4877('0x48')](handleError(_0x137115,null));};exports[_0x4877('0x4f')]=function(_0x423588,_0x4c39a6,_0x58129c){var _0x431741=require(_0x4877('0x50'));return db['Schedule']['find']({'where':{'id':_0x423588[_0x4877('0x4e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4c39a6,null))[_0x4877('0x26')](function(){_0x431741[_0x4877('0x4f')](_0x423588[_0x4877('0x4e')]['id']);})[_0x4877('0x26')](respondWithStatusCode(_0x4c39a6,null))['catch'](handleError(_0x4c39a6,null));}; \ No newline at end of file +var _0x9cdf=['merge','options','includeAll','rows','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','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','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x54bd29,_0x135fac){var _0x2ea971=function(_0x53e9e9){while(--_0x53e9e9){_0x54bd29['push'](_0x54bd29['shift']());}};_0x2ea971(++_0x135fac);}(_0x9cdf,0x15c));var _0xf9cd=function(_0x113d2f,_0x3fe5cc){_0x113d2f=_0x113d2f-0x0;var _0x47e60e=_0x9cdf[_0x113d2f];return _0x47e60e;};'use strict';var emlformat=require(_0xf9cd('0x0'));var rimraf=require(_0xf9cd('0x1'));var zipdir=require(_0xf9cd('0x2'));var jsonpatch=require(_0xf9cd('0x3'));var rp=require(_0xf9cd('0x4'));var moment=require(_0xf9cd('0x5'));var BPromise=require(_0xf9cd('0x6'));var Mustache=require(_0xf9cd('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf9cd('0x8'));var ejs=require(_0xf9cd('0x9'));var fs=require('fs');var fs_extra=require(_0xf9cd('0xa'));var _=require(_0xf9cd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf9cd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf9cd('0xd'));var Papa=require(_0xf9cd('0xe'));var Redis=require('ioredis');var authService=require(_0xf9cd('0xf'));var qs=require(_0xf9cd('0x10'));var as=require(_0xf9cd('0x11'));var hardwareService=require(_0xf9cd('0x12'));var logger=require(_0xf9cd('0x13'))(_0xf9cd('0x14'));var utils=require(_0xf9cd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf9cd('0x16'));var db=require(_0xf9cd('0x17'))['db'];function respondWithStatusCode(_0x5bdbcf,_0x3b0506){_0x3b0506=_0x3b0506||0xcc;return function(_0x79d218){if(_0x79d218){return _0x5bdbcf[_0xf9cd('0x18')](_0x3b0506);}return _0x5bdbcf[_0xf9cd('0x19')](_0x3b0506)[_0xf9cd('0x1a')]();};}function respondWithResult(_0x5dbcb3,_0x556030){_0x556030=_0x556030||0xc8;return function(_0x50c009){if(_0x50c009){return _0x5dbcb3[_0xf9cd('0x19')](_0x556030)['json'](_0x50c009);}};}function respondWithFilteredResult(_0x339e89,_0x565963){return function(_0x4034b6){if(_0x4034b6){var _0x2a6095=typeof _0x565963[_0xf9cd('0x1b')]===_0xf9cd('0x1c')&&typeof _0x565963['limit']===_0xf9cd('0x1c');var _0x11812f=_0x4034b6[_0xf9cd('0x1d')];var _0xcc0384=_0x2a6095?0x0:_0x565963[_0xf9cd('0x1b')];var _0x613df0=_0x2a6095?_0x4034b6[_0xf9cd('0x1d')]:_0x565963[_0xf9cd('0x1b')]+_0x565963[_0xf9cd('0x1e')];var _0x489771;if(_0x613df0>=_0x11812f){_0x613df0=_0x11812f;_0x489771=0xc8;}else{_0x489771=0xce;}_0x339e89[_0xf9cd('0x19')](_0x489771);return _0x339e89[_0xf9cd('0x1f')](_0xf9cd('0x20'),_0xcc0384+'-'+_0x613df0+'/'+_0x11812f)['json'](_0x4034b6);}return null;};}function patchUpdates(_0x2b14ba){return function(_0x5265b8){try{jsonpatch[_0xf9cd('0x21')](_0x5265b8,_0x2b14ba,!![]);}catch(_0x2fefd1){return BPromise[_0xf9cd('0x22')](_0x2fefd1);}return _0x5265b8[_0xf9cd('0x23')]();};}function saveUpdates(_0x5c5595,_0x4caecc){return function(_0xd4e4c9){if(_0xd4e4c9){return _0xd4e4c9[_0xf9cd('0x24')](_0x5c5595)[_0xf9cd('0x25')](function(_0x53eedd){return _0x53eedd;});}return null;};}function removeEntity(_0x56897b,_0xc83dd6){return function(_0x365f6e){if(_0x365f6e){return _0x365f6e[_0xf9cd('0x26')]()[_0xf9cd('0x25')](function(){var _0x52cb4b=_0x365f6e[_0xf9cd('0x27')]({'plain':!![]});var _0x3fb8b6=_0xf9cd('0x28');return db[_0xf9cd('0x29')][_0xf9cd('0x26')]({'where':{'type':_0x3fb8b6,'resourceId':_0x52cb4b['id']}})[_0xf9cd('0x25')](function(){return _0x365f6e;});})[_0xf9cd('0x25')](function(){_0x56897b[_0xf9cd('0x19')](0xcc)[_0xf9cd('0x1a')]();});}};}function handleEntityNotFound(_0x381e3e,_0x4bd4fb){return function(_0x18bfaa){if(!_0x18bfaa){_0x381e3e['sendStatus'](0x194);}return _0x18bfaa;};}function handleError(_0x5de829,_0x2422e6){_0x2422e6=_0x2422e6||0x1f4;return function(_0xbbd70a){logger[_0xf9cd('0x2a')](_0xbbd70a[_0xf9cd('0x2b')]);if(_0xbbd70a['name']){delete _0xbbd70a[_0xf9cd('0x2c')];}_0x5de829[_0xf9cd('0x19')](_0x2422e6)[_0xf9cd('0x2d')](_0xbbd70a);};}exports[_0xf9cd('0x2e')]=function(_0x14c63c,_0x26724f){var _0x4b2f9f={},_0xc86609={},_0x5336b6={'count':0x0,'rows':[]};var _0xbefea0=_['map'](db[_0xf9cd('0x2f')][_0xf9cd('0x30')],function(_0x1761ab){return{'name':_0x1761ab[_0xf9cd('0x31')],'type':_0x1761ab[_0xf9cd('0x32')][_0xf9cd('0x33')]};});_0xc86609[_0xf9cd('0x34')]=_[_0xf9cd('0x35')](_0xbefea0,'name');_0xc86609[_0xf9cd('0x36')]=_[_0xf9cd('0x37')](_0x14c63c['query']);_0xc86609[_0xf9cd('0x38')]=_[_0xf9cd('0x39')](_0xc86609['model'],_0xc86609[_0xf9cd('0x36')]);_0x4b2f9f['attributes']=_[_0xf9cd('0x39')](_0xc86609[_0xf9cd('0x34')],qs['fields'](_0x14c63c['query'][_0xf9cd('0x3a')]));_0x4b2f9f['attributes']=_0x4b2f9f[_0xf9cd('0x3b')][_0xf9cd('0x3c')]?_0x4b2f9f[_0xf9cd('0x3b')]:_0xc86609[_0xf9cd('0x34')];if(!_0x14c63c[_0xf9cd('0x36')][_0xf9cd('0x3d')](_0xf9cd('0x3e'))){_0x4b2f9f[_0xf9cd('0x1e')]=qs[_0xf9cd('0x1e')](_0x14c63c[_0xf9cd('0x36')][_0xf9cd('0x1e')]);_0x4b2f9f['offset']=qs[_0xf9cd('0x1b')](_0x14c63c[_0xf9cd('0x36')][_0xf9cd('0x1b')]);}_0x4b2f9f['order']=qs[_0xf9cd('0x3f')](_0x14c63c[_0xf9cd('0x36')][_0xf9cd('0x3f')]);_0x4b2f9f[_0xf9cd('0x40')]=qs[_0xf9cd('0x38')](_[_0xf9cd('0x41')](_0x14c63c['query'],_0xc86609[_0xf9cd('0x38')]),_0xbefea0);if(_0x14c63c[_0xf9cd('0x36')][_0xf9cd('0x42')]){_0x4b2f9f[_0xf9cd('0x40')]=_['merge'](_0x4b2f9f['where'],{'$or':_[_0xf9cd('0x35')](_0xbefea0,function(_0x1b5671){if(_0x1b5671['type']!=='VIRTUAL'){var _0xcbb8c8={};_0xcbb8c8[_0x1b5671[_0xf9cd('0x2c')]]={'$like':'%'+_0x14c63c[_0xf9cd('0x36')]['filter']+'%'};return _0xcbb8c8;}})});}_0x4b2f9f=_[_0xf9cd('0x43')]({},_0x4b2f9f,_0x14c63c[_0xf9cd('0x44')]);var _0x358f9={'where':_0x4b2f9f[_0xf9cd('0x40')]};return db['Schedule'][_0xf9cd('0x1d')](_0x358f9)['then'](function(_0x9ab2c1){_0x5336b6[_0xf9cd('0x1d')]=_0x9ab2c1;if(_0x14c63c[_0xf9cd('0x36')][_0xf9cd('0x45')]){_0x4b2f9f['include']=[{'all':!![]}];}return db[_0xf9cd('0x2f')]['findAll'](_0x4b2f9f);})[_0xf9cd('0x25')](function(_0xe7b0fd){_0x5336b6[_0xf9cd('0x46')]=_0xe7b0fd;return _0x5336b6;})[_0xf9cd('0x25')](respondWithFilteredResult(_0x26724f,_0x4b2f9f))['catch'](handleError(_0x26724f,null));};exports[_0xf9cd('0x47')]=function(_0x27b38a,_0x5f260e){var _0x9cadf1={'raw':![],'where':{'id':_0x27b38a[_0xf9cd('0x48')]['id']}},_0x35fc5a={};_0x35fc5a[_0xf9cd('0x34')]=_['keys'](db[_0xf9cd('0x2f')][_0xf9cd('0x30')]);_0x35fc5a['query']=_[_0xf9cd('0x37')](_0x27b38a[_0xf9cd('0x36')]);_0x35fc5a[_0xf9cd('0x38')]=_[_0xf9cd('0x39')](_0x35fc5a['model'],_0x35fc5a[_0xf9cd('0x36')]);_0x9cadf1[_0xf9cd('0x3b')]=_[_0xf9cd('0x39')](_0x35fc5a[_0xf9cd('0x34')],qs[_0xf9cd('0x3a')](_0x27b38a[_0xf9cd('0x36')][_0xf9cd('0x3a')]));_0x9cadf1[_0xf9cd('0x3b')]=_0x9cadf1[_0xf9cd('0x3b')][_0xf9cd('0x3c')]?_0x9cadf1[_0xf9cd('0x3b')]:_0x35fc5a['model'];if(_0x27b38a[_0xf9cd('0x36')]['includeAll']){_0x9cadf1['include']=[{'all':!![]}];}_0x9cadf1=_[_0xf9cd('0x43')]({},_0x9cadf1,_0x27b38a[_0xf9cd('0x44')]);return db['Schedule'][_0xf9cd('0x49')](_0x9cadf1)['then'](handleEntityNotFound(_0x5f260e,null))['then'](respondWithResult(_0x5f260e,null))[_0xf9cd('0x4a')](handleError(_0x5f260e,null));};exports[_0xf9cd('0x4b')]=function(_0x561372,_0x5871af){return db['Schedule']['create'](_0x561372['body'],{})['then'](function(_0x54d7f6){var _0x1881c3=_0x561372['user'][_0xf9cd('0x27')]({'plain':!![]});if(!_0x1881c3)throw new Error(_0xf9cd('0x4c'));if(_0x1881c3[_0xf9cd('0x4d')]===_0xf9cd('0x4e')){var _0x32918c=_0x54d7f6[_0xf9cd('0x27')]({'plain':!![]});var _0x288fc3='Scheduler';return db['UserProfileSection'][_0xf9cd('0x49')]({'where':{'name':_0x288fc3,'userProfileId':_0x1881c3['userProfileId']},'raw':!![]})[_0xf9cd('0x25')](function(_0x92a18e){if(_0x92a18e&&_0x92a18e['autoAssociation']===0x0){return db[_0xf9cd('0x29')][_0xf9cd('0x4b')]({'name':_0x32918c['name'],'resourceId':_0x32918c['id'],'type':_0x92a18e['name'],'sectionId':_0x92a18e['id']},{})[_0xf9cd('0x25')](function(){return _0x54d7f6;});}else{return _0x54d7f6;}})[_0xf9cd('0x4a')](function(_0x3ba122){logger[_0xf9cd('0x2a')](_0xf9cd('0x4f'),_0x3ba122);throw _0x3ba122;});}return _0x54d7f6;})[_0xf9cd('0x25')](respondWithResult(_0x5871af,0xc9))[_0xf9cd('0x4a')](handleError(_0x5871af,null));};exports[_0xf9cd('0x24')]=function(_0x48826d,_0x3f5519){if(_0x48826d[_0xf9cd('0x50')]['id']){delete _0x48826d[_0xf9cd('0x50')]['id'];}return db['Schedule'][_0xf9cd('0x49')]({'where':{'id':_0x48826d[_0xf9cd('0x48')]['id']}})[_0xf9cd('0x25')](handleEntityNotFound(_0x3f5519,null))['then'](saveUpdates(_0x48826d[_0xf9cd('0x50')],null))['then'](respondWithResult(_0x3f5519,null))['catch'](handleError(_0x3f5519,null));};exports[_0xf9cd('0x26')]=function(_0x5128a0,_0xed1fbc){return db['Schedule'][_0xf9cd('0x49')]({'where':{'id':_0x5128a0['params']['id']}})[_0xf9cd('0x25')](handleEntityNotFound(_0xed1fbc,null))['then'](removeEntity(_0xed1fbc,null))[_0xf9cd('0x4a')](handleError(_0xed1fbc,null));};exports[_0xf9cd('0x51')]=function(_0x38b3d9,_0x5bbd69,_0x75b11d){var _0x287e42=require(_0xf9cd('0x52'));return db[_0xf9cd('0x2f')]['find']({'where':{'id':_0x38b3d9[_0xf9cd('0x48')]['id']},'raw':!![]})[_0xf9cd('0x25')](handleEntityNotFound(_0x5bbd69,null))[_0xf9cd('0x25')](function(){_0x287e42[_0xf9cd('0x51')](_0x38b3d9['params']['id']);})[_0xf9cd('0x25')](respondWithStatusCode(_0x5bbd69,null))[_0xf9cd('0x4a')](handleError(_0x5bbd69,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 223925b..ddf44d0 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 _0x93dc=['moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','util'];(function(_0x1d5a2f,_0x42f279){var _0x565cf9=function(_0x4c0106){while(--_0x4c0106){_0x1d5a2f['push'](_0x1d5a2f['shift']());}};_0x565cf9(++_0x42f279);}(_0x93dc,0x17f));var _0xc93d=function(_0x2dc943,_0x39b03f){_0x2dc943=_0x2dc943-0x0;var _0x345181=_0x93dc[_0x2dc943];return _0x345181;};'use strict';var _=require(_0xc93d('0x0'));var util=require(_0xc93d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc93d('0x2'));var BPromise=require(_0xc93d('0x3'));var rp=require(_0xc93d('0x4'));var fs=require('fs');var path=require(_0xc93d('0x5'));var rimraf=require('rimraf');var config=require(_0xc93d('0x6'));var attributes=require(_0xc93d('0x7'));module[_0xc93d('0x8')]=function(_0x80e098,_0x19a5be){return _0x80e098[_0xc93d('0x9')]('Schedule',attributes,{'tableName':_0xc93d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2834=['path','rimraf','./schedule.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x212dad,_0xb862ef){var _0x4fea3f=function(_0x31664b){while(--_0x31664b){_0x212dad['push'](_0x212dad['shift']());}};_0x4fea3f(++_0xb862ef);}(_0x2834,0x144));var _0x4283=function(_0x60ef8b,_0x12c2c4){_0x60ef8b=_0x60ef8b-0x0;var _0x200b7c=_0x2834[_0x60ef8b];return _0x200b7c;};'use strict';var _=require(_0x4283('0x0'));var util=require(_0x4283('0x1'));var logger=require(_0x4283('0x2'))(_0x4283('0x3'));var moment=require('moment');var BPromise=require(_0x4283('0x4'));var rp=require(_0x4283('0x5'));var fs=require('fs');var path=require(_0x4283('0x6'));var rimraf=require(_0x4283('0x7'));var config=require('../../config/environment');var attributes=require(_0x4283('0x8'));module[_0x4283('0x9')]=function(_0x4ccdd7,_0x656178){return _0x4ccdd7[_0x4283('0xa')]('Schedule',attributes,{'tableName':'tools_schedules','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 d288d32..3846663 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 _0x2d7e=['jayson/promise','http','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ce462,_0x2bc522){var _0x41783d=function(_0x1027e8){while(--_0x1027e8){_0x4ce462['push'](_0x4ce462['shift']());}};_0x41783d(++_0x2bc522);}(_0x2d7e,0xbe));var _0xe2d7=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x2d7e[_0xcd0918];return _0x250704;};'use strict';var _=require(_0xe2d7('0x0'));var util=require(_0xe2d7('0x1'));var moment=require(_0xe2d7('0x2'));var BPromise=require(_0xe2d7('0x3'));var rs=require(_0xe2d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2d7('0x5'))['db'];var utils=require(_0xe2d7('0x6'));var logger=require(_0xe2d7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe2d7('0x8'));var client=jayson['client'][_0xe2d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cdaad,_0x41eb20,_0x5aa37f){return new BPromise(function(_0x255e6a,_0x357f0b){return client['request'](_0x5cdaad,_0x5aa37f)['then'](function(_0x5899f6){logger[_0xe2d7('0xa')](_0xe2d7('0xb'),_0x41eb20,'request\x20sent');logger[_0xe2d7('0xc')](_0xe2d7('0xd'),_0x41eb20,_0xe2d7('0xe'),JSON[_0xe2d7('0xf')](_0x5899f6));if(_0x5899f6[_0xe2d7('0x10')]){if(_0x5899f6[_0xe2d7('0x10')]['code']===0x1f4){logger[_0xe2d7('0x10')](_0xe2d7('0xb'),_0x41eb20,_0x5899f6[_0xe2d7('0x10')]['message']);return _0x357f0b(_0x5899f6[_0xe2d7('0x10')][_0xe2d7('0x11')]);}logger[_0xe2d7('0x10')](_0xe2d7('0xb'),_0x41eb20,_0x5899f6[_0xe2d7('0x10')][_0xe2d7('0x11')]);return _0x255e6a(_0x5899f6[_0xe2d7('0x10')][_0xe2d7('0x11')]);}else{logger[_0xe2d7('0xa')]('Schedule,\x20%s,\x20%s',_0x41eb20,_0xe2d7('0xe'));_0x255e6a(_0x5899f6['result'][_0xe2d7('0x11')]);}})['catch'](function(_0x55ff4f){logger[_0xe2d7('0x10')](_0xe2d7('0xb'),_0x41eb20,_0x55ff4f);_0x357f0b(_0x55ff4f);});});} \ No newline at end of file +var _0xff84=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x21f5a4,_0x36b808){var _0x138349=function(_0x196105){while(--_0x196105){_0x21f5a4['push'](_0x21f5a4['shift']());}};_0x138349(++_0x36b808);}(_0xff84,0x15f));var _0x4ff8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xff84[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x4ff8('0x0'));var util=require(_0x4ff8('0x1'));var moment=require(_0x4ff8('0x2'));var BPromise=require(_0x4ff8('0x3'));var rs=require(_0x4ff8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ff8('0x5'))['db'];var utils=require(_0x4ff8('0x6'));var logger=require(_0x4ff8('0x7'))(_0x4ff8('0x8'));var config=require(_0x4ff8('0x9'));var jayson=require(_0x4ff8('0xa'));var client=jayson[_0x4ff8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x455eaa,_0x479fc8,_0x335220){return new BPromise(function(_0x175b7f,_0x4e90d5){return client['request'](_0x455eaa,_0x335220)[_0x4ff8('0xc')](function(_0x275090){logger['info'](_0x4ff8('0xd'),_0x479fc8,'request\x20sent');logger[_0x4ff8('0xe')](_0x4ff8('0xf'),_0x479fc8,_0x4ff8('0x10'),JSON[_0x4ff8('0x11')](_0x275090));if(_0x275090[_0x4ff8('0x12')]){if(_0x275090[_0x4ff8('0x12')][_0x4ff8('0x13')]===0x1f4){logger[_0x4ff8('0x12')]('Schedule,\x20%s,\x20%s',_0x479fc8,_0x275090[_0x4ff8('0x12')]['message']);return _0x4e90d5(_0x275090[_0x4ff8('0x12')][_0x4ff8('0x14')]);}logger[_0x4ff8('0x12')]('Schedule,\x20%s,\x20%s',_0x479fc8,_0x275090[_0x4ff8('0x12')][_0x4ff8('0x14')]);return _0x175b7f(_0x275090['error'][_0x4ff8('0x14')]);}else{logger[_0x4ff8('0x15')](_0x4ff8('0xd'),_0x479fc8,_0x4ff8('0x10'));_0x175b7f(_0x275090[_0x4ff8('0x16')][_0x4ff8('0x14')]);}})['catch'](function(_0x1152a9){logger[_0x4ff8('0x12')](_0x4ff8('0xd'),_0x479fc8,_0x1152a9);_0x4e90d5(_0x1152a9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ae8fb2e..a2e1fbd 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 _0x70fa=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put'];(function(_0x572c04,_0x1ee4ee){var _0x1a2f34=function(_0x4c5fd0){while(--_0x4c5fd0){_0x572c04['push'](_0x572c04['shift']());}};_0x1a2f34(++_0x1ee4ee);}(_0x70fa,0x153));var _0xa70f=function(_0x21eacf,_0x1d1f5b){_0x21eacf=_0x21eacf-0x0;var _0xbae3e=_0x70fa[_0x21eacf];return _0xbae3e;};'use strict';var multer=require(_0xa70f('0x0'));var util=require(_0xa70f('0x1'));var path=require(_0xa70f('0x2'));var timeout=require(_0xa70f('0x3'));var express=require(_0xa70f('0x4'));var router=express['Router']();var fs_extra=require(_0xa70f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa70f('0x6'));var config=require(_0xa70f('0x7'));var controller=require(_0xa70f('0x8'));router[_0xa70f('0x9')]('/',auth[_0xa70f('0xa')](),controller[_0xa70f('0xb')]);router[_0xa70f('0x9')](_0xa70f('0xc'),auth['isAuthenticated'](),controller[_0xa70f('0xd')]);router[_0xa70f('0x9')](_0xa70f('0xe'),auth[_0xa70f('0xa')](),controller[_0xa70f('0xf')]);router[_0xa70f('0x9')](_0xa70f('0x10'),auth[_0xa70f('0xa')](),controller[_0xa70f('0x11')]);router[_0xa70f('0x12')]('/',auth[_0xa70f('0xa')](),controller[_0xa70f('0x13')]);router[_0xa70f('0x14')]('/:id',auth[_0xa70f('0xa')](),controller[_0xa70f('0x15')]);router['delete'](_0xa70f('0xe'),auth['isAuthenticated'](),controller[_0xa70f('0x16')]);module[_0xa70f('0x17')]=router; \ No newline at end of file +var _0x06bf=['./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x06bf,0xca));var _0xf06b=function(_0xd45770,_0x1d9d77){_0xd45770=_0xd45770-0x0;var _0x3eb496=_0x06bf[_0xd45770];return _0x3eb496;};'use strict';var multer=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var path=require('path');var timeout=require(_0xf06b('0x2'));var express=require(_0xf06b('0x3'));var router=express['Router']();var fs_extra=require(_0xf06b('0x4'));var auth=require(_0xf06b('0x5'));var interaction=require(_0xf06b('0x6'));var config=require('../../config/environment');var controller=require(_0xf06b('0x7'));router[_0xf06b('0x8')]('/',auth[_0xf06b('0x9')](),controller[_0xf06b('0xa')]);router[_0xf06b('0x8')](_0xf06b('0xb'),auth[_0xf06b('0x9')](),controller[_0xf06b('0xc')]);router['get'](_0xf06b('0xd'),auth[_0xf06b('0x9')](),controller['show']);router[_0xf06b('0x8')](_0xf06b('0xe'),auth['isAuthenticated'](),controller[_0xf06b('0xf')]);router[_0xf06b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf06b('0xd'),auth[_0xf06b('0x9')](),controller['update']);router[_0xf06b('0x11')](_0xf06b('0xd'),auth[_0xf06b('0x9')](),controller[_0xf06b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 493a581..46040a2 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 _0xbdc2=['format','toString','MM-DD-YYYY\x20HH:mm','DATE','sequelize','moment','path','../../config/environment','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration'];(function(_0x3e0652,_0xbfa81c){var _0x134b90=function(_0x5306e9){while(--_0x5306e9){_0x3e0652['push'](_0x3e0652['shift']());}};_0x134b90(++_0xbfa81c);}(_0xbdc2,0x148));var _0x2bdc=function(_0x3a93b5,_0x2145bc){_0x3a93b5=_0x3a93b5-0x0;var _0x10cded=_0xbdc2[_0x3a93b5];return _0x10cded;};'use strict';var Sequelize=require(_0x2bdc('0x0'));var moment=require(_0x2bdc('0x1'));var path=require(_0x2bdc('0x2'));var config=require(_0x2bdc('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2bdc('0x4')](_0x2bdc('0x5'))?path['extname'](this[_0x2bdc('0x4')](_0x2bdc('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2bdc('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x29bed6){var _0x9e129f=_0x29bed6[_0x2bdc('0x7')](/\\/g,'/');this[_0x2bdc('0x8')](_0x2bdc('0x5'),_0x9e129f);}},'rating':{'type':Sequelize[_0x2bdc('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2bdc('0x9')],'set':function(_0x1dd7c9){this[_0x2bdc('0x8')](_0x2bdc('0xa'),moment()[_0x2bdc('0xb')](_0x1dd7c9,'ms'));this[_0x2bdc('0x8')](_0x2bdc('0xc'),moment());this['setDataValue'](_0x2bdc('0xd'),_0x1dd7c9);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2bdc('0x4')](_0x2bdc('0xa')))[_0x2bdc('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x2bdc('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2bdc('0x4')](_0x2bdc('0xc')))[_0x2bdc('0xe')](_0x2bdc('0x10'))[_0x2bdc('0xf')]();}},'createdAt':{'type':Sequelize[_0x2bdc('0x11')],'get':function(){return moment(this[_0x2bdc('0x4')]('createdAt'))[_0x2bdc('0xe')](_0x2bdc('0x10'))[_0x2bdc('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2bdc('0x4')]('updatedAt'))[_0x2bdc('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x2bdc('0xf')]();}}}; \ No newline at end of file +var _0x3024=['toString','DATE','closedAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','../../config/environment','exports','value','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','format'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3024,0x64));var _0x4302=function(_0x5416b3,_0x1df665){_0x5416b3=_0x5416b3-0x0;var _0x21925c=_0x3024[_0x5416b3];return _0x21925c;};'use strict';var Sequelize=require(_0x4302('0x0'));var moment=require(_0x4302('0x1'));var path=require('path');var config=require(_0x4302('0x2'));module[_0x4302('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x4302('0x4'))?path['extname'](this[_0x4302('0x5')](_0x4302('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4302('0x6')]},'value':{'type':Sequelize[_0x4302('0x6')],'set':function(_0x4c3983){var _0xced9fc=_0x4c3983[_0x4302('0x7')](/\\/g,'/');this[_0x4302('0x8')](_0x4302('0x4'),_0xced9fc);}},'rating':{'type':Sequelize[_0x4302('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4302('0x9')],'set':function(_0x41580c){this['setDataValue'](_0x4302('0xa'),moment()[_0x4302('0xb')](_0x41580c,'ms'));this[_0x4302('0x8')]('closedAt',moment());this[_0x4302('0x8')](_0x4302('0xc'),_0x41580c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4302('0x5')](_0x4302('0xa')))[_0x4302('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x4302('0xe')]();}},'closedAt':{'type':Sequelize[_0x4302('0xf')],'get':function(){return moment(this['getDataValue'](_0x4302('0x10')))[_0x4302('0xd')](_0x4302('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x4302('0xf')],'get':function(){return moment(this[_0x4302('0x5')]('createdAt'))[_0x4302('0xd')](_0x4302('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x4302('0xf')],'get':function(){return moment(this[_0x4302('0x5')](_0x4302('0x12')))[_0x4302('0xd')](_0x4302('0x11'))[_0x4302('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index fb411ae..33dd885 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 _0x24ca=['server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','ScreenRecording','include','findAll','rows','catch','show','model','includeAll','find','create','body','duration','createdAt','closedAt','params','describe','download','uniqueid','value','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','join'];(function(_0x2430d5,_0x280dd1){var _0x2f147c=function(_0x1e6264){while(--_0x1e6264){_0x2430d5['push'](_0x2430d5['shift']());}};_0x2f147c(++_0x280dd1);}(_0x24ca,0x1bc));var _0xa24c=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x24ca[_0x13c70c];return _0x50f0f2;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['ScreenRecording'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x32')](_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c')),['format']);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x28675f[_0xa24c('0x33')]);_0x5e491e['filters']=_[_0xa24c('0x35')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x33')]);_0x12dbdc[_0xa24c('0x36')]=_['intersection'](_0x5e491e['model'],qs[_0xa24c('0x37')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x37')]));_0x12dbdc[_0xa24c('0x36')]=_0x12dbdc[_0xa24c('0x36')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x36')]:_0x5e491e['model'];if(!_0x28675f[_0xa24c('0x33')][_0xa24c('0x39')](_0xa24c('0x3a'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x33')]['offset']);}_0x12dbdc[_0xa24c('0x3b')]=qs[_0xa24c('0x3c')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x3c')]);_0x12dbdc['where']=qs['filters'](_[_0xa24c('0x3d')](_0x28675f['query'],_0x5e491e[_0xa24c('0x3e')]),_0xc96ce7);if(_0x28675f[_0xa24c('0x33')][_0xa24c('0x3f')]){_0x12dbdc[_0xa24c('0x40')]=_[_0xa24c('0x41')](_0x12dbdc['where'],{'$or':_['map'](_0xc96ce7,function(_0x3121e){if(_0x3121e[_0xa24c('0x42')]!==_0xa24c('0x43')){var _0x213dc3={};_0x213dc3[_0x3121e[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x33')]['filter']+'%'};return _0x213dc3;}})});}_0x12dbdc=_['merge']({},_0x12dbdc,_0x28675f[_0xa24c('0x44')]);var _0x1ce83e={'where':_0x12dbdc[_0xa24c('0x40')]};return db[_0xa24c('0x45')][_0xa24c('0x20')](_0x1ce83e)['then'](function(_0x171c51){_0x21d2a8[_0xa24c('0x20')]=_0x171c51;if(_0x28675f['query']['includeAll']){_0x12dbdc[_0xa24c('0x46')]=[{'all':!![]}];}return db[_0xa24c('0x45')][_0xa24c('0x47')](_0x12dbdc);})['then'](function(_0x58ac8b){_0x21d2a8[_0xa24c('0x48')]=_0x58ac8b;return _0x21d2a8;})[_0xa24c('0x27')](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x49')](handleError(_0x152120,null));};exports[_0xa24c('0x4a')]=function(_0x3f640e,_0x1b7faf){var _0x23d1e0={'raw':![],'where':{'id':_0x3f640e['params']['id']}},_0x394d19={};_0x394d19['model']=_[_0xa24c('0x34')](db[_0xa24c('0x45')][_0xa24c('0x2f')]);_0x394d19['query']=_[_0xa24c('0x34')](_0x3f640e[_0xa24c('0x33')]);_0x394d19[_0xa24c('0x3e')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],_0x394d19[_0xa24c('0x33')]);_0x23d1e0[_0xa24c('0x36')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],qs[_0xa24c('0x37')](_0x3f640e['query'][_0xa24c('0x37')]));_0x23d1e0[_0xa24c('0x36')]=_0x23d1e0[_0xa24c('0x36')]['length']?_0x23d1e0[_0xa24c('0x36')]:_0x394d19[_0xa24c('0x4b')];if(_0x3f640e[_0xa24c('0x33')][_0xa24c('0x4c')]){_0x23d1e0[_0xa24c('0x46')]=[{'all':!![]}];}_0x23d1e0=_[_0xa24c('0x41')]({},_0x23d1e0,_0x3f640e[_0xa24c('0x44')]);return db[_0xa24c('0x45')][_0xa24c('0x4d')](_0x23d1e0)[_0xa24c('0x27')](handleEntityNotFound(_0x1b7faf,null))[_0xa24c('0x27')](respondWithResult(_0x1b7faf,null))['catch'](handleError(_0x1b7faf,null));};exports[_0xa24c('0x4e')]=function(_0x96b977,_0x42028b){return db[_0xa24c('0x45')][_0xa24c('0x4e')](_0x96b977[_0xa24c('0x4f')],{})[_0xa24c('0x27')](respondWithResult(_0x42028b,0xc9))[_0xa24c('0x49')](handleError(_0x42028b,null));};exports[_0xa24c('0x26')]=function(_0x4f56ae,_0x540da8){if(_0x4f56ae[_0xa24c('0x4f')]['id']){delete _0x4f56ae['body']['id'];}delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x50')];delete _0x4f56ae['body'][_0xa24c('0x51')];delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x52')];delete _0x4f56ae['body']['value'];return db[_0xa24c('0x45')]['find']({'where':{'id':_0x4f56ae[_0xa24c('0x53')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x540da8,null))[_0xa24c('0x27')](saveUpdates(_0x4f56ae[_0xa24c('0x4f')],null))[_0xa24c('0x27')](respondWithResult(_0x540da8,null))[_0xa24c('0x49')](handleError(_0x540da8,null));};exports[_0xa24c('0x54')]=function(_0x286d57,_0x22a0db){return db[_0xa24c('0x45')]['describe']()[_0xa24c('0x27')](respondWithResult(_0x22a0db,null))[_0xa24c('0x49')](handleError(_0x22a0db,null));};exports[_0xa24c('0x55')]=function(_0x513271,_0x5bde94,_0x487cc9){var _0x2da4f0=require('../../components/encryptor');var _0x4757ff=![];var _0x21d0fc={};if(_0x513271['query'][_0xa24c('0x42')]&&_0x513271[_0xa24c('0x33')][_0xa24c('0x42')]===_0xa24c('0x56')){_0x21d0fc[_0xa24c('0x56')]=_0x513271[_0xa24c('0x53')]['id'];}else{_0x21d0fc['id']=_0x513271[_0xa24c('0x53')]['id'];}return db[_0xa24c('0x45')]['find']({'where':_0x21d0fc,'attributes':['id',_0xa24c('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x5bde94,null))['then'](function(_0x565f0a){if(_0x565f0a){var _0x5bd2af=path['join'](config[_0xa24c('0x58')],'server/files/screen_recordings',_0x565f0a[_0xa24c('0x57')]);var _0x3fd3f9=util[_0xa24c('0x59')](_0xa24c('0x5a'),_0x5bd2af);if(fs[_0xa24c('0x5b')](_0x3fd3f9)){_0x4757ff=!![];return _0x2da4f0[_0xa24c('0x5c')](_0x3fd3f9,_0x5bd2af,config[_0xa24c('0x5d')][_0xa24c('0x5e')])[_0xa24c('0x27')](function(){return _0x565f0a;});}return _0x565f0a;}})[_0xa24c('0x27')](function(_0x303b7d){if(_0x303b7d){var _0x37dbbd=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x303b7d['value']);if(!fs[_0xa24c('0x5b')](_0x37dbbd)){throw new db[(_0xa24c('0x61'))]['ValidationError'](_0xa24c('0x62'));}if(_0x303b7d[_0xa24c('0x63')]){return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,_0x303b7d[_0xa24c('0x63')]+path['extname'](_0x37dbbd),function(){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}else{return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,function(_0x5e9631){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}}})[_0xa24c('0x49')](function(_0x2515b1){if(_0x2515b1[_0xa24c('0x64')]===_0xa24c('0x62')){_0x5bde94['status'](0x194)['send'](_0xa24c('0x65'));}else{return handleError(_0x5bde94,null);}});};exports['destroy']=function(_0x52a895,_0xfcc193){return db[_0xa24c('0x45')][_0xa24c('0x4d')]({'where':{'id':_0x52a895['params']['id']}})[_0xa24c('0x27')](function(_0x128e5b){if(_['isNil'](_0x128e5b)){throw new ReferenceError(_0xa24c('0x66'));}return _0x128e5b;})[_0xa24c('0x27')](function(_0x3096bf){var _0x4bee5c=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x3096bf[_0xa24c('0x57')]);logger[_0xa24c('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x4bee5c);if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs[_0xa24c('0x5b')](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}_0x4bee5c=_0x4bee5c+'.cypher';if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs['existsSync'](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}return _0x3096bf;})[_0xa24c('0x27')](function(_0x3a241a){if(!_0x3a241a)throw new InternalError();return _0x3a241a[_0xa24c('0x28')]();})[_0xa24c('0x27')](function(){_0xfcc193[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();})['catch'](handleError(_0xfcc193,null));}; \ No newline at end of file +var _0x038b=['offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','root','%s.cypher','decryptFile','secrets','recording','join','server/files/screen_recordings','existsSync','ValidationError','ScreenRecording\x20not\x20found','filename','download','unlink','message','send','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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'];(function(_0x2c5c15,_0x515232){var _0x2d0f79=function(_0x197628){while(--_0x197628){_0x2c5c15['push'](_0x2c5c15['shift']());}};_0x2d0f79(++_0x515232);}(_0x038b,0x114));var _0xb038=function(_0x46a95f,_0x5c263b){_0x46a95f=_0x46a95f-0x0;var _0x4f74d5=_0x038b[_0x46a95f];return _0x4f74d5;};'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('0x2d')](_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24')),[_0xb038('0x2e')]);_0xc387d['query']=_[_0xb038('0x2f')](_0x2855a6['query']);_0xc387d[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x32')]);_0x12b3b6[_0xb038('0x33')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x32')][_0xb038('0x34')]));_0x12b3b6['attributes']=_0x12b3b6[_0xb038('0x33')][_0xb038('0x35')]?_0x12b3b6[_0xb038('0x33')]:_0xc387d['model'];if(!_0x2855a6['query']['hasOwnProperty'](_0xb038('0x36'))){_0x12b3b6[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x32')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs['offset'](_0x2855a6[_0xb038('0x32')][_0xb038('0x18')]);}_0x12b3b6[_0xb038('0x37')]=qs[_0xb038('0x38')](_0x2855a6['query'][_0xb038('0x38')]);_0x12b3b6[_0xb038('0x39')]=qs['filters'](_['pick'](_0x2855a6[_0xb038('0x32')],_0xc387d[_0xb038('0x30')]),_0x1783d4);if(_0x2855a6[_0xb038('0x32')][_0xb038('0x3a')]){_0x12b3b6[_0xb038('0x39')]=_['merge'](_0x12b3b6[_0xb038('0x39')],{'$or':_[_0xb038('0x26')](_0x1783d4,function(_0x26d48c){if(_0x26d48c[_0xb038('0x2a')]!=='VIRTUAL'){var _0x793da9={};_0x793da9[_0x26d48c[_0xb038('0x24')]]={'$like':'%'+_0x2855a6[_0xb038('0x32')]['filter']+'%'};return _0x793da9;}})});}_0x12b3b6=_[_0xb038('0x3b')]({},_0x12b3b6,_0x2855a6['options']);var _0x36f281={'where':_0x12b3b6[_0xb038('0x39')]};return db[_0xb038('0x27')]['count'](_0x36f281)[_0xb038('0x22')](function(_0x357c78){_0x551b55[_0xb038('0x1a')]=_0x357c78;if(_0x2855a6['query'][_0xb038('0x3c')]){_0x12b3b6[_0xb038('0x3d')]=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3e')](_0x12b3b6);})['then'](function(_0x28b922){_0x551b55[_0xb038('0x3f')]=_0x28b922;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x40')](handleError(_0x28a6a9,null));};exports['show']=function(_0x19dc7b,_0x269c7d){var _0x57816c={'raw':![],'where':{'id':_0x19dc7b[_0xb038('0x41')]['id']}},_0x207fb5={};_0x207fb5[_0xb038('0x2c')]=_['keys'](db[_0xb038('0x27')][_0xb038('0x28')]);_0x207fb5['query']=_['keys'](_0x19dc7b[_0xb038('0x32')]);_0x207fb5[_0xb038('0x30')]=_[_0xb038('0x31')](_0x207fb5[_0xb038('0x2c')],_0x207fb5[_0xb038('0x32')]);_0x57816c[_0xb038('0x33')]=_[_0xb038('0x31')](_0x207fb5[_0xb038('0x2c')],qs['fields'](_0x19dc7b['query']['fields']));_0x57816c[_0xb038('0x33')]=_0x57816c[_0xb038('0x33')]['length']?_0x57816c[_0xb038('0x33')]:_0x207fb5[_0xb038('0x2c')];if(_0x19dc7b[_0xb038('0x32')]['includeAll']){_0x57816c[_0xb038('0x3d')]=[{'all':!![]}];}_0x57816c=_['merge']({},_0x57816c,_0x19dc7b['options']);return db[_0xb038('0x27')][_0xb038('0x42')](_0x57816c)[_0xb038('0x22')](handleEntityNotFound(_0x269c7d,null))[_0xb038('0x22')](respondWithResult(_0x269c7d,null))[_0xb038('0x40')](handleError(_0x269c7d,null));};exports[_0xb038('0x43')]=function(_0x2f053a,_0x473aae){return db[_0xb038('0x27')][_0xb038('0x43')](_0x2f053a['body'],{})[_0xb038('0x22')](respondWithResult(_0x473aae,0xc9))[_0xb038('0x40')](handleError(_0x473aae,null));};exports['update']=function(_0x906c9c,_0x19ab72){if(_0x906c9c['body']['id']){delete _0x906c9c[_0xb038('0x44')]['id'];}delete _0x906c9c[_0xb038('0x44')][_0xb038('0x45')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x46')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x47')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x48')];return db['ScreenRecording'][_0xb038('0x42')]({'where':{'id':_0x906c9c[_0xb038('0x41')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x19ab72,null))[_0xb038('0x22')](saveUpdates(_0x906c9c[_0xb038('0x44')],null))[_0xb038('0x22')](respondWithResult(_0x19ab72,null))['catch'](handleError(_0x19ab72,null));};exports[_0xb038('0x49')]=function(_0x2f3622,_0x2b2b4d){return db[_0xb038('0x27')][_0xb038('0x49')]()[_0xb038('0x22')](respondWithResult(_0x2b2b4d,null))[_0xb038('0x40')](handleError(_0x2b2b4d,null));};exports['download']=function(_0x3abe7a,_0x5c4a79,_0x77f211){var _0x1ea8ad=require(_0xb038('0x4a'));var _0x998fe3=![];var _0x1518c4={};if(_0x3abe7a['query']['type']&&_0x3abe7a['query'][_0xb038('0x2a')]===_0xb038('0x4b')){_0x1518c4[_0xb038('0x4b')]=_0x3abe7a[_0xb038('0x41')]['id'];}else{_0x1518c4['id']=_0x3abe7a[_0xb038('0x41')]['id'];}return db[_0xb038('0x27')]['find']({'where':_0x1518c4,'attributes':['id',_0xb038('0x48')],'raw':!![]})[_0xb038('0x22')](handleEntityNotFound(_0x5c4a79,null))['then'](function(_0x5b27d3){if(_0x5b27d3){var _0xf2907b=path['join'](config[_0xb038('0x4c')],'server/files/screen_recordings',_0x5b27d3[_0xb038('0x48')]);var _0x4677b8=util[_0xb038('0x2e')](_0xb038('0x4d'),_0xf2907b);if(fs['existsSync'](_0x4677b8)){_0x998fe3=!![];return _0x1ea8ad[_0xb038('0x4e')](_0x4677b8,_0xf2907b,config[_0xb038('0x4f')][_0xb038('0x50')])[_0xb038('0x22')](function(){return _0x5b27d3;});}return _0x5b27d3;}})[_0xb038('0x22')](function(_0x1246c8){if(_0x1246c8){var _0x14a553=path[_0xb038('0x51')](config[_0xb038('0x4c')],_0xb038('0x52'),_0x1246c8[_0xb038('0x48')]);if(!fs[_0xb038('0x53')](_0x14a553)){throw new db['Sequelize'][(_0xb038('0x54'))](_0xb038('0x55'));}if(_0x1246c8[_0xb038('0x56')]){return _0x5c4a79[_0xb038('0x57')](_0x14a553,_0x1246c8[_0xb038('0x56')]+path['extname'](_0x14a553),function(){if(_0x998fe3){fs[_0xb038('0x58')](_0x14a553);}});}else{return _0x5c4a79['download'](_0x14a553,function(_0xfb3ce6){if(_0x998fe3){fs[_0xb038('0x58')](_0x14a553);}});}}})['catch'](function(_0x15d61c){if(_0x15d61c[_0xb038('0x59')]===_0xb038('0x55')){_0x5c4a79[_0xb038('0x16')](0x194)[_0xb038('0x5a')](_0xb038('0x5b'));}else{return handleError(_0x5c4a79,null);}});};exports[_0xb038('0x5c')]=function(_0xe275b8,_0x769f1e){return db[_0xb038('0x27')]['find']({'where':{'id':_0xe275b8[_0xb038('0x41')]['id']}})['then'](function(_0x189894){if(_[_0xb038('0x5d')](_0x189894)){throw new ReferenceError(_0xb038('0x5e'));}return _0x189894;})[_0xb038('0x22')](function(_0x1f5f3f){var _0x23fb92=path[_0xb038('0x51')](config['root'],'server/files/screen_recordings',_0x1f5f3f[_0xb038('0x48')]);logger[_0xb038('0x5f')](_0xb038('0x60'),_0x23fb92);if(!_['isNil'](_0x1f5f3f['value'])&&fs[_0xb038('0x53')](_0x23fb92)){logger['info'](_0xb038('0x61')+_0x23fb92+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb038('0x62')](_0x23fb92);}_0x23fb92=_0x23fb92+'.cypher';if(!_[_0xb038('0x5d')](_0x1f5f3f[_0xb038('0x48')])&&fs[_0xb038('0x53')](_0x23fb92)){logger[_0xb038('0x5f')](_0xb038('0x61')+_0x23fb92+_0xb038('0x63'));fs['unlinkSync'](_0x23fb92);}return _0x1f5f3f;})['then'](function(_0x45e628){if(!_0x45e628)throw new InternalError();return _0x45e628['destroy']();})[_0xb038('0x22')](function(){_0x769f1e[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();})['catch'](handleError(_0x769f1e,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 98965a5..e2d931d 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 _0x397b=['interactionid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','screen_recordings'];(function(_0x36f858,_0x468634){var _0x3359cf=function(_0x416242){while(--_0x416242){_0x36f858['push'](_0x36f858['shift']());}};_0x3359cf(++_0x468634);}(_0x397b,0x18d));var _0xb397=function(_0xf400dd,_0x1217d3){_0xf400dd=_0xf400dd-0x0;var _0x3a4599=_0x397b[_0xf400dd];return _0x3a4599;};'use strict';var _=require(_0xb397('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb397('0x1'));var moment=require(_0xb397('0x2'));var BPromise=require(_0xb397('0x3'));var rp=require(_0xb397('0x4'));var fs=require('fs');var path=require(_0xb397('0x5'));var rimraf=require(_0xb397('0x6'));var config=require(_0xb397('0x7'));var attributes=require('./screenRecording.attributes');module[_0xb397('0x8')]=function(_0x394b0c,_0x2bbb51){return _0x394b0c['define']('ScreenRecording',attributes,{'tableName':_0xb397('0x9'),'paranoid':![],'indexes':[{'name':_0xb397('0xa'),'fields':[_0xb397('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc81a=['request-promise','rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','interactionid','util','../../config/logger','api','moment','bluebird'];(function(_0x5dac46,_0x28e9dc){var _0x51095c=function(_0x5918c6){while(--_0x5918c6){_0x5dac46['push'](_0x5dac46['shift']());}};_0x51095c(++_0x28e9dc);}(_0xc81a,0x1c9));var _0xac81=function(_0x5cf869,_0x38b795){_0x5cf869=_0x5cf869-0x0;var _0x50c485=_0xc81a[_0x5cf869];return _0x50c485;};'use strict';var _=require('lodash');var util=require(_0xac81('0x0'));var logger=require(_0xac81('0x1'))(_0xac81('0x2'));var moment=require(_0xac81('0x3'));var BPromise=require(_0xac81('0x4'));var rp=require(_0xac81('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac81('0x6'));var config=require(_0xac81('0x7'));var attributes=require(_0xac81('0x8'));module['exports']=function(_0x411c4a,_0x51c493){return _0x411c4a['define'](_0xac81('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xac81('0xa'),'fields':[_0xac81('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 e6f22bb..8cdf19c 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 _0x1b14=['request','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','ScreenRecording,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27f2b9,_0x144e11){var _0x440385=function(_0x72436d){while(--_0x72436d){_0x27f2b9['push'](_0x27f2b9['shift']());}};_0x440385(++_0x144e11);}(_0x1b14,0xc6));var _0x41b1=function(_0x354d1f,_0xfee75c){_0x354d1f=_0x354d1f-0x0;var _0x110e7c=_0x1b14[_0x354d1f];return _0x110e7c;};'use strict';var _=require(_0x41b1('0x0'));var util=require(_0x41b1('0x1'));var moment=require(_0x41b1('0x2'));var BPromise=require(_0x41b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41b1('0x4'));var db=require(_0x41b1('0x5'))['db'];var utils=require(_0x41b1('0x6'));var logger=require(_0x41b1('0x7'))(_0x41b1('0x8'));var config=require(_0x41b1('0x9'));var jayson=require(_0x41b1('0xa'));var client=jayson[_0x41b1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5226a1,_0x4f427f,_0x333e4c){return new BPromise(function(_0x30f2a8,_0x2a8fcb){return client[_0x41b1('0xc')](_0x5226a1,_0x333e4c)[_0x41b1('0xd')](function(_0x220d35){logger[_0x41b1('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x4f427f,_0x41b1('0xf'));logger['debug'](_0x41b1('0x10'),_0x4f427f,_0x41b1('0xf'),JSON['stringify'](_0x220d35));if(_0x220d35[_0x41b1('0x11')]){if(_0x220d35['error']['code']===0x1f4){logger[_0x41b1('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4f427f,_0x220d35[_0x41b1('0x11')][_0x41b1('0x12')]);return _0x2a8fcb(_0x220d35['error'][_0x41b1('0x12')]);}logger['error'](_0x41b1('0x13'),_0x4f427f,_0x220d35[_0x41b1('0x11')][_0x41b1('0x12')]);return _0x30f2a8(_0x220d35['error'][_0x41b1('0x12')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x4f427f,_0x41b1('0xf'));_0x30f2a8(_0x220d35['result'][_0x41b1('0x12')]);}})[_0x41b1('0x14')](function(_0x236dc2){logger[_0x41b1('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4f427f,_0x236dc2);_0x2a8fcb(_0x236dc2);});});} \ No newline at end of file +var _0xac91=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xac91,0x138));var _0x1ac9=function(_0x57f345,_0x316929){_0x57f345=_0x57f345-0x0;var _0x255e43=_0xac91[_0x57f345];return _0x255e43;};'use strict';var _=require(_0x1ac9('0x0'));var util=require('util');var moment=require(_0x1ac9('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ac9('0x2'));var fs=require('fs');var Redis=require(_0x1ac9('0x3'));var db=require(_0x1ac9('0x4'))['db'];var utils=require(_0x1ac9('0x5'));var logger=require(_0x1ac9('0x6'))(_0x1ac9('0x7'));var config=require(_0x1ac9('0x8'));var jayson=require(_0x1ac9('0x9'));var client=jayson[_0x1ac9('0xa')][_0x1ac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487b90,_0x115303,_0x28bbdc){return new BPromise(function(_0x31d83a,_0x195be2){return client[_0x1ac9('0xc')](_0x487b90,_0x28bbdc)[_0x1ac9('0xd')](function(_0x125908){logger[_0x1ac9('0xe')](_0x1ac9('0xf'),_0x115303,_0x1ac9('0x10'));logger[_0x1ac9('0x11')](_0x1ac9('0x12'),_0x115303,'request\x20sent',JSON['stringify'](_0x125908));if(_0x125908[_0x1ac9('0x13')]){if(_0x125908[_0x1ac9('0x13')][_0x1ac9('0x14')]===0x1f4){logger[_0x1ac9('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x115303,_0x125908[_0x1ac9('0x13')][_0x1ac9('0x15')]);return _0x195be2(_0x125908[_0x1ac9('0x13')][_0x1ac9('0x15')]);}logger[_0x1ac9('0x13')](_0x1ac9('0xf'),_0x115303,_0x125908[_0x1ac9('0x13')][_0x1ac9('0x15')]);return _0x31d83a(_0x125908[_0x1ac9('0x13')]['message']);}else{logger['info'](_0x1ac9('0xf'),_0x115303,_0x1ac9('0x10'));_0x31d83a(_0x125908[_0x1ac9('0x16')]['message']);}})[_0x1ac9('0x17')](function(_0x54a60a){logger[_0x1ac9('0x13')](_0x1ac9('0xf'),_0x115303,_0x54a60a);_0x195be2(_0x54a60a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 22108e6..6c24294 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 _0xecd4=['update','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','format','%s%s','originalname','post','/:id/logo','single','file','server/files/images/logos/','extname','addLogoLogin','addPreferred','root','addFavicon','/:id','isAuthenticated'];(function(_0x4c163f,_0x29fc4e){var _0x46422b=function(_0x337d53){while(--_0x337d53){_0x4c163f['push'](_0x4c163f['shift']());}};_0x46422b(++_0x29fc4e);}(_0xecd4,0xb5));var _0x4ecd=function(_0x96ad7d,_0x1017ba){_0x96ad7d=_0x96ad7d-0x0;var _0x32d63a=_0xecd4[_0x96ad7d];return _0x32d63a;};'use strict';var multer=require(_0x4ecd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ecd('0x1')]();var fs_extra=require(_0x4ecd('0x2'));var auth=require(_0x4ecd('0x3'));var interaction=require(_0x4ecd('0x4'));var config=require(_0x4ecd('0x5'));var controller=require(_0x4ecd('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4ecd('0x7')](_0x4ecd('0x8'),controller['getDate']);router[_0x4ecd('0x7')]('/:id',controller[_0x4ecd('0x9')]);router[_0x4ecd('0x7')]('/:id/logo',controller[_0x4ecd('0xa')]);router[_0x4ecd('0x7')]('/:id/logo_login',controller[_0x4ecd('0xb')]);router[_0x4ecd('0x7')](_0x4ecd('0xc'),controller[_0x4ecd('0xd')]);router[_0x4ecd('0x7')](_0x4ecd('0xe'),controller[_0x4ecd('0xf')]);router[_0x4ecd('0x7')](_0x4ecd('0x10'),controller[_0x4ecd('0x11')]);var upload=multer({'storage':multer[_0x4ecd('0x12')]({'destination':function(_0x369b8b,_0x2f61f4,_0x4e68ba){_0x4e68ba(null,path[_0x4ecd('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3d8f7d,_0x337f9d,_0x162afc){_0x162afc(null,util[_0x4ecd('0x14')](_0x4ecd('0x15'),'logo',path['extname'](_0x337f9d[_0x4ecd('0x16')])));}})});router[_0x4ecd('0x17')](_0x4ecd('0x18'),upload[_0x4ecd('0x19')](_0x4ecd('0x1a')),controller['addLogo']);var upload=multer({'storage':multer[_0x4ecd('0x12')]({'destination':function(_0x4b84bb,_0x1e74be,_0xc8c8bf){_0xc8c8bf(null,path['join'](config['root'],_0x4ecd('0x1b')));},'filename':function(_0x45b02c,_0x2c2cef,_0x49eb5d){_0x49eb5d(null,util['format'](_0x4ecd('0x15'),'logologin',path[_0x4ecd('0x1c')](_0x2c2cef['originalname'])));}})});router[_0x4ecd('0x17')]('/:id/logo_login',upload[_0x4ecd('0x19')](_0x4ecd('0x1a')),controller[_0x4ecd('0x1d')]);var upload=multer({'storage':multer[_0x4ecd('0x12')]({'destination':function(_0x24fc50,_0x114d4f,_0x4750b2){_0x4750b2(null,path[_0x4ecd('0x13')](config['root'],_0x4ecd('0x1b')));},'filename':function(_0x3441cd,_0x81a6f3,_0x498ac7){_0x498ac7(null,util[_0x4ecd('0x14')](_0x4ecd('0x15'),'preferred',path[_0x4ecd('0x1c')](_0x81a6f3[_0x4ecd('0x16')])));}})});router[_0x4ecd('0x17')]('/:id/preferred',upload['single'](_0x4ecd('0x1a')),controller[_0x4ecd('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1fb401,_0x5312b8,_0x23efc8){_0x23efc8(null,path['join'](config[_0x4ecd('0x1f')],_0x4ecd('0x1b')));},'filename':function(_0x2d3d27,_0x1c7f8d,_0x3420f8){_0x3420f8(null,util['format']('%s%s','favicon',path[_0x4ecd('0x1c')](_0x1c7f8d['originalname'])));}})});router[_0x4ecd('0x17')](_0x4ecd('0x10'),upload['single'](_0x4ecd('0x1a')),controller[_0x4ecd('0x20')]);router['put'](_0x4ecd('0x21'),auth[_0x4ecd('0x22')](),controller[_0x4ecd('0x23')]);module['exports']=router; \ No newline at end of file +var _0xcc0a=['gdpr','getPreferred','/:id/favicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','/:id/logo','single','file','logologin','/:id/logo_login','root','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','show','getLogo','getLogoLogin'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xcc0a,0x138));var _0xacc0=function(_0x130bc8,_0x59817e){_0x130bc8=_0x130bc8-0x0;var _0x3ed919=_0xcc0a[_0x130bc8];return _0x3ed919;};'use strict';var multer=require(_0xacc0('0x0'));var util=require(_0xacc0('0x1'));var path=require(_0xacc0('0x2'));var timeout=require(_0xacc0('0x3'));var express=require(_0xacc0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xacc0('0x5'));var interaction=require(_0xacc0('0x6'));var config=require(_0xacc0('0x7'));var controller=require(_0xacc0('0x8'));router['get']('/',auth[_0xacc0('0x9')](),controller[_0xacc0('0xa')]);router[_0xacc0('0xb')](_0xacc0('0xc'),controller['getDate']);router[_0xacc0('0xb')]('/:id',controller[_0xacc0('0xd')]);router['get']('/:id/logo',controller[_0xacc0('0xe')]);router[_0xacc0('0xb')]('/:id/logo_login',controller[_0xacc0('0xf')]);router[_0xacc0('0xb')]('/:id/gdpr',controller[_0xacc0('0x10')]);router['get']('/:id/preferred',controller[_0xacc0('0x11')]);router[_0xacc0('0xb')](_0xacc0('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0xacc0('0x13')]({'destination':function(_0x4efc22,_0x38d8f3,_0x17a64e){_0x17a64e(null,path[_0xacc0('0x14')](config['root'],_0xacc0('0x15')));},'filename':function(_0x18df92,_0x34b814,_0x5c195f){_0x5c195f(null,util[_0xacc0('0x16')](_0xacc0('0x17'),_0xacc0('0x18'),path[_0xacc0('0x19')](_0x34b814[_0xacc0('0x1a')])));}})});router[_0xacc0('0x1b')](_0xacc0('0x1c'),upload[_0xacc0('0x1d')](_0xacc0('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0xacc0('0x13')]({'destination':function(_0x29f8c3,_0x2287f2,_0x4c59e4){_0x4c59e4(null,path[_0xacc0('0x14')](config['root'],'server/files/images/logos/'));},'filename':function(_0x46f085,_0x26ea1a,_0x298f99){_0x298f99(null,util[_0xacc0('0x16')](_0xacc0('0x17'),_0xacc0('0x1f'),path[_0xacc0('0x19')](_0x26ea1a[_0xacc0('0x1a')])));}})});router[_0xacc0('0x1b')](_0xacc0('0x20'),upload[_0xacc0('0x1d')](_0xacc0('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xacc0('0x13')]({'destination':function(_0x241f16,_0x56a907,_0xd8eec1){_0xd8eec1(null,path[_0xacc0('0x14')](config[_0xacc0('0x21')],'server/files/images/logos/'));},'filename':function(_0x56354a,_0x39d18a,_0x545884){_0x545884(null,util[_0xacc0('0x16')](_0xacc0('0x17'),'preferred',path[_0xacc0('0x19')](_0x39d18a[_0xacc0('0x1a')])));}})});router[_0xacc0('0x1b')](_0xacc0('0x22'),upload[_0xacc0('0x1d')](_0xacc0('0x1e')),controller[_0xacc0('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d1b13,_0x2656cc,_0x5210f2){_0x5210f2(null,path[_0xacc0('0x14')](config[_0xacc0('0x21')],_0xacc0('0x15')));},'filename':function(_0x579b34,_0x2cea7a,_0x570061){_0x570061(null,util['format']('%s%s',_0xacc0('0x24'),path[_0xacc0('0x19')](_0x2cea7a[_0xacc0('0x1a')])));}})});router[_0xacc0('0x1b')](_0xacc0('0x12'),upload['single'](_0xacc0('0x1e')),controller[_0xacc0('0x25')]);router[_0xacc0('0x26')]('/:id',auth[_0xacc0('0x9')](),controller[_0xacc0('0x27')]);module[_0xacc0('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 6958c1e..7b9cd8d 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 _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x529cb7,_0x959ea6){var _0x293969=function(_0x1bee6a){while(--_0x1bee6a){_0x529cb7['push'](_0x529cb7['shift']());}};_0x293969(++_0x959ea6);}(_0x7a54,0x106));var _0x47a5=function(_0x24ec92,_0x5769d9){_0x24ec92=_0x24ec92-0x0;var _0x5e30a2=_0x7a54[_0x24ec92];return _0x5e30a2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x40738f,_0x75e461){var _0x578a48=function(_0x28bb1c){while(--_0x28bb1c){_0x40738f['push'](_0x40738f['shift']());}};_0x578a48(++_0x75e461);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0x0b0e[_0x2f1172];return _0x58e374;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c145930..f0bc6c0 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 _0xda0d=['end','offset','undefined','count','limit','set','json','apply','reject','save','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','update','body','file','addLogoLogin','loginLogo','server/files/images/logos','logo','favicon','defaultLogo','defaultLoginLogo','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','ValidationError','download','getLogoLogin','getLicense','preferred','defaultFavicon','default_loginLogo.svg','custom','existsSync','gdpr','addPreferred','filename','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','defaultPreferred','default_favicon.ico','utcOffset','now','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x1d9910,_0x36fd3b){var _0x38eaa0=function(_0x54378c){while(--_0x54378c){_0x1d9910['push'](_0x1d9910['shift']());}};_0x38eaa0(++_0x36fd3b);}(_0xda0d,0xcb));var _0xdda0=function(_0x5cd874,_0x412b60){_0x5cd874=_0x5cd874-0x0;var _0x1613fb=_0xda0d[_0x5cd874];return _0x1613fb;};'use strict';var emlformat=require(_0xdda0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdda0('0x1'));var jsonpatch=require(_0xdda0('0x2'));var rp=require(_0xdda0('0x3'));var moment=require(_0xdda0('0x4'));var BPromise=require(_0xdda0('0x5'));var Mustache=require('mustache');var util=require(_0xdda0('0x6'));var path=require('path');var sox=require(_0xdda0('0x7'));var csv=require(_0xdda0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdda0('0x9'));var _=require(_0xdda0('0xa'));var squel=require(_0xdda0('0xb'));var crypto=require(_0xdda0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdda0('0xd'));var toCsv=require(_0xdda0('0x8'));var querystring=require('querystring');var Papa=require(_0xdda0('0xe'));var Redis=require('ioredis');var authService=require(_0xdda0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdda0('0x10'));var hardwareService=require(_0xdda0('0x11'));var logger=require(_0xdda0('0x12'))('api');var utils=require(_0xdda0('0x13'));var config=require(_0xdda0('0x14'));var licenseUtil=require(_0xdda0('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdda0('0x16'));var client=jayson[_0xdda0('0x17')][_0xdda0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x442745,_0x2f7582,_0x1bdb94,_0xc81899){return new BPromise(function(_0x12d11e,_0x32e402){var _0x5e8d5e=_0xc81899||client;return _0x5e8d5e[_0xdda0('0x19')](_0x442745,_0x1bdb94)[_0xdda0('0x1a')](function(_0x461538){logger[_0xdda0('0x1b')](_0xdda0('0x1c'),_0x2f7582,'request\x20sent');logger['debug'](_0xdda0('0x1d'),_0x2f7582,_0xdda0('0x1e'),JSON[_0xdda0('0x1f')](_0x461538));if(_0x461538['error']){if(_0x461538[_0xdda0('0x20')][_0xdda0('0x21')]===0x1f4){logger['error'](_0xdda0('0x1c'),_0x2f7582,_0x461538['error']['message']);return _0x32e402(_0x461538[_0xdda0('0x20')][_0xdda0('0x22')]);}logger[_0xdda0('0x20')]('Setting,\x20%s,\x20%s',_0x2f7582,_0x461538[_0xdda0('0x20')][_0xdda0('0x22')]);return _0x12d11e(_0x461538[_0xdda0('0x20')][_0xdda0('0x22')]);}else{logger[_0xdda0('0x1b')]('Setting,\x20%s,\x20%s',_0x2f7582,_0xdda0('0x1e'));_0x12d11e(_0x461538[_0xdda0('0x23')][_0xdda0('0x22')]);}})[_0xdda0('0x24')](function(_0x319921){logger[_0xdda0('0x20')](_0xdda0('0x1c'),_0x2f7582,_0x319921);_0x32e402(_0x319921);});});}function respondWithStatusCode(_0x3216c6,_0x3dbb40){_0x3dbb40=_0x3dbb40||0xcc;return function(_0x460150){if(_0x460150){return _0x3216c6[_0xdda0('0x25')](_0x3dbb40);}return _0x3216c6[_0xdda0('0x26')](_0x3dbb40)[_0xdda0('0x27')]();};}function respondWithResult(_0x27d126,_0x3d904c){_0x3d904c=_0x3d904c||0xc8;return function(_0x523a88){if(_0x523a88){return _0x27d126['status'](_0x3d904c)['json'](_0x523a88);}};}function respondWithFilteredResult(_0x2c5798,_0x2d61c3){return function(_0x4fc35c){if(_0x4fc35c){var _0x406fc6=typeof _0x2d61c3[_0xdda0('0x28')]===_0xdda0('0x29')&&typeof _0x2d61c3['limit']===_0xdda0('0x29');var _0x5acdee=_0x4fc35c['count'];var _0x4fa2d5=_0x406fc6?0x0:_0x2d61c3[_0xdda0('0x28')];var _0x9a9448=_0x406fc6?_0x4fc35c[_0xdda0('0x2a')]:_0x2d61c3['offset']+_0x2d61c3[_0xdda0('0x2b')];var _0x4615cc;if(_0x9a9448>=_0x5acdee){_0x9a9448=_0x5acdee;_0x4615cc=0xc8;}else{_0x4615cc=0xce;}_0x2c5798['status'](_0x4615cc);return _0x2c5798[_0xdda0('0x2c')]('Content-Range',_0x4fa2d5+'-'+_0x9a9448+'/'+_0x5acdee)[_0xdda0('0x2d')](_0x4fc35c);}return null;};}function patchUpdates(_0x4abc23){return function(_0x2c5ffa){try{jsonpatch[_0xdda0('0x2e')](_0x2c5ffa,_0x4abc23,!![]);}catch(_0x4cdccf){return BPromise[_0xdda0('0x2f')](_0x4cdccf);}return _0x2c5ffa[_0xdda0('0x30')]();};}function saveUpdates(_0x12e9a6,_0x230f1e){return function(_0x40f41e){if(_0x40f41e){return _0x40f41e['update'](_0x12e9a6)['then'](function(_0x1b2c08){return _0x1b2c08;});}return null;};}function removeEntity(_0xaf184a,_0x480153){return function(_0x5a4d85){if(_0x5a4d85){return _0x5a4d85['destroy']()['then'](function(){_0xaf184a[_0xdda0('0x26')](0xcc)[_0xdda0('0x27')]();});}};}function handleEntityNotFound(_0x3f6e71,_0x229f4e){return function(_0x1f6b5c){if(!_0x1f6b5c){_0x3f6e71['sendStatus'](0x194);}return _0x1f6b5c;};}function handleError(_0x4d6772,_0x43f31f){_0x43f31f=_0x43f31f||0x1f4;return function(_0x11dc57){logger[_0xdda0('0x20')](_0x11dc57['stack']);if(_0x11dc57['name']){delete _0x11dc57[_0xdda0('0x31')];}_0x4d6772[_0xdda0('0x26')](_0x43f31f)[_0xdda0('0x32')](_0x11dc57);};}exports[_0xdda0('0x33')]=function(_0x1410ab,_0x134fd6){var _0x1a6f34={},_0x29ec24={},_0x39267b={'count':0x0,'rows':[]};var _0x536568=_[_0xdda0('0x34')](db[_0xdda0('0x35')][_0xdda0('0x36')],function(_0x2096cc){return{'name':_0x2096cc[_0xdda0('0x37')],'type':_0x2096cc[_0xdda0('0x38')][_0xdda0('0x39')]};});_0x29ec24[_0xdda0('0x3a')]=_[_0xdda0('0x34')](_0x536568,_0xdda0('0x31'));_0x29ec24[_0xdda0('0x3b')]=_[_0xdda0('0x3c')](_0x1410ab['query']);_0x29ec24[_0xdda0('0x3d')]=_[_0xdda0('0x3e')](_0x29ec24[_0xdda0('0x3a')],_0x29ec24[_0xdda0('0x3b')]);_0x1a6f34[_0xdda0('0x3f')]=_[_0xdda0('0x3e')](_0x29ec24['model'],qs[_0xdda0('0x40')](_0x1410ab[_0xdda0('0x3b')]['fields']));_0x1a6f34[_0xdda0('0x3f')]=_0x1a6f34[_0xdda0('0x3f')][_0xdda0('0x41')]?_0x1a6f34[_0xdda0('0x3f')]:_0x29ec24[_0xdda0('0x3a')];if(!_0x1410ab[_0xdda0('0x3b')][_0xdda0('0x42')](_0xdda0('0x43'))){_0x1a6f34[_0xdda0('0x2b')]=qs[_0xdda0('0x2b')](_0x1410ab[_0xdda0('0x3b')][_0xdda0('0x2b')]);_0x1a6f34[_0xdda0('0x28')]=qs[_0xdda0('0x28')](_0x1410ab[_0xdda0('0x3b')][_0xdda0('0x28')]);}_0x1a6f34[_0xdda0('0x44')]=qs[_0xdda0('0x45')](_0x1410ab['query'][_0xdda0('0x45')]);_0x1a6f34[_0xdda0('0x46')]=qs[_0xdda0('0x3d')](_['pick'](_0x1410ab[_0xdda0('0x3b')],_0x29ec24['filters']),_0x536568);if(_0x1410ab[_0xdda0('0x3b')][_0xdda0('0x47')]){_0x1a6f34[_0xdda0('0x46')]=_[_0xdda0('0x48')](_0x1a6f34[_0xdda0('0x46')],{'$or':_[_0xdda0('0x34')](_0x536568,function(_0x4db302){if(_0x4db302[_0xdda0('0x38')]!==_0xdda0('0x49')){var _0x5a1c41={};_0x5a1c41[_0x4db302['name']]={'$like':'%'+_0x1410ab[_0xdda0('0x3b')][_0xdda0('0x47')]+'%'};return _0x5a1c41;}})});}_0x1a6f34=_[_0xdda0('0x48')]({},_0x1a6f34,_0x1410ab[_0xdda0('0x4a')]);var _0x177e60={'where':_0x1a6f34[_0xdda0('0x46')]};return db[_0xdda0('0x35')][_0xdda0('0x2a')](_0x177e60)['then'](function(_0x3869d7){_0x39267b[_0xdda0('0x2a')]=_0x3869d7;if(_0x1410ab[_0xdda0('0x3b')][_0xdda0('0x4b')]){_0x1a6f34['include']=[{'all':!![]}];}return db[_0xdda0('0x35')][_0xdda0('0x4c')](_0x1a6f34);})[_0xdda0('0x1a')](function(_0x4f7bc8){_0x39267b[_0xdda0('0x4d')]=_0x4f7bc8;return _0x39267b;})['then'](respondWithFilteredResult(_0x134fd6,_0x1a6f34))['catch'](handleError(_0x134fd6,null));};exports[_0xdda0('0x4e')]=function(_0x827768,_0x2a19f0){var _0x1d0fcb={'raw':![],'where':{'id':_0x827768[_0xdda0('0x4f')]['id']}},_0x334764={};_0x334764[_0xdda0('0x3a')]=_[_0xdda0('0x3c')](db[_0xdda0('0x35')][_0xdda0('0x36')]);_0x334764['query']=_['keys'](_0x827768[_0xdda0('0x3b')]);_0x334764[_0xdda0('0x3d')]=_[_0xdda0('0x3e')](_0x334764[_0xdda0('0x3a')],_0x334764[_0xdda0('0x3b')]);_0x1d0fcb[_0xdda0('0x3f')]=_[_0xdda0('0x3e')](_0x334764[_0xdda0('0x3a')],qs[_0xdda0('0x40')](_0x827768[_0xdda0('0x3b')][_0xdda0('0x40')]));_0x1d0fcb[_0xdda0('0x3f')]=_0x1d0fcb[_0xdda0('0x3f')][_0xdda0('0x41')]?_0x1d0fcb['attributes']:_0x334764[_0xdda0('0x3a')];if(_0x827768[_0xdda0('0x3b')][_0xdda0('0x4b')]){_0x1d0fcb[_0xdda0('0x50')]=[{'all':!![]}];}_0x1d0fcb=_['merge']({},_0x1d0fcb,_0x827768[_0xdda0('0x4a')]);return db[_0xdda0('0x35')][_0xdda0('0x51')](_0x1d0fcb)[_0xdda0('0x1a')](handleEntityNotFound(_0x2a19f0,null))['then'](respondWithResult(_0x2a19f0,null))['catch'](handleError(_0x2a19f0,null));};exports[_0xdda0('0x52')]=function(_0x25a75c,_0x407a4b){if(_0x25a75c[_0xdda0('0x53')]['id']){delete _0x25a75c[_0xdda0('0x53')]['id'];}return db['Setting'][_0xdda0('0x51')]({'where':{'id':_0x25a75c[_0xdda0('0x4f')]['id']}})[_0xdda0('0x1a')](handleEntityNotFound(_0x407a4b,null))['then'](saveUpdates(_0x25a75c['body'],null))['then'](respondWithResult(_0x407a4b,null))[_0xdda0('0x24')](handleError(_0x407a4b,null));};exports['addLogo']=function(_0x2e9f1f,_0x70f7b,_0x20738c){if(_0x2e9f1f[_0xdda0('0x54')]&&_0x2e9f1f['file']['filename']){_0x2e9f1f[_0xdda0('0x53')]['logo']=_0x2e9f1f['file']['filename'];}return db[_0xdda0('0x35')][_0xdda0('0x51')]({'where':{'id':_0x2e9f1f[_0xdda0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x70f7b,null))[_0xdda0('0x1a')](saveUpdates(_0x2e9f1f[_0xdda0('0x53')],null))[_0xdda0('0x1a')](respondWithResult(_0x70f7b,null))[_0xdda0('0x24')](handleError(_0x70f7b,null));};exports[_0xdda0('0x55')]=function(_0x32a5fc,_0x42a66d,_0x2b679c){if(_0x32a5fc[_0xdda0('0x54')]&&_0x32a5fc[_0xdda0('0x54')]['filename']){_0x32a5fc[_0xdda0('0x53')][_0xdda0('0x56')]=_0x32a5fc[_0xdda0('0x54')]['filename'];}return db[_0xdda0('0x35')]['find']({'where':{'id':_0x32a5fc[_0xdda0('0x4f')]['id']}})[_0xdda0('0x1a')](handleEntityNotFound(_0x42a66d,null))[_0xdda0('0x1a')](saveUpdates(_0x32a5fc[_0xdda0('0x53')],null))[_0xdda0('0x1a')](respondWithResult(_0x42a66d,null))['catch'](handleError(_0x42a66d,null));};var utilLicense=require(_0xdda0('0x15'));exports['getLogo']=function(_0xb9514f,_0x422999,_0x227764){var _0x379fcc=_0xdda0('0x57');var _0x118b96={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x18f5e7){if(_0x18f5e7){_0x118b96=_0x18f5e7;}return db[_0xdda0('0x35')]['find']({'where':{'id':_0xb9514f[_0xdda0('0x4f')]['id']},'attributes':[_0xdda0('0x58'),_0xdda0('0x56'),'preferred',_0xdda0('0x59'),_0xdda0('0x5a'),_0xdda0('0x5b'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xdda0('0x1a')](handleEntityNotFound(_0x422999,null))['then'](function(_0x4d2c68){if(_0x4d2c68){var _0x427a4e=_0x4d2c68[_0xdda0('0x58')]&&fs['existsSync'](path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x379fcc,_[_0xdda0('0x5e')](_0x4d2c68[_0xdda0('0x58')])))?path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x379fcc,_[_0xdda0('0x5e')](_0x4d2c68[_0xdda0('0x58')])):path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x379fcc,_['toLower']('default_logo.svg'));var _0x36f895=_0xdda0('0x5f')+_[_0xdda0('0x60')](_0xdda0('0x58'));if(_0x4d2c68[_0x36f895]||!_0x118b96['custom']){_0x427a4e=path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x379fcc,_['toLower'](_0xdda0('0x61')));}if(!fs['existsSync'](_0x427a4e)){throw new db[(_0xdda0('0x62'))][(_0xdda0('0x63'))](_['upperFirst'](_0xdda0('0x58'))+'\x20not\x20found');}return _0x422999[_0xdda0('0x64')](_0x427a4e);}})[_0xdda0('0x24')](handleError(_0x422999,null));};var utilLicense=require(_0xdda0('0x15'));exports[_0xdda0('0x65')]=function(_0x365b6d,_0x188092,_0x16a043){var _0x25dd20=_0xdda0('0x57');var _0x8bb016={'custom':![]};return utilLicense[_0xdda0('0x66')]()[_0xdda0('0x1a')](function(_0x21d237){if(_0x21d237){_0x8bb016=_0x21d237;}return db['Setting'][_0xdda0('0x51')]({'where':{'id':_0x365b6d['params']['id']},'attributes':['logo',_0xdda0('0x56'),_0xdda0('0x67'),_0xdda0('0x59'),_0xdda0('0x5a'),_0xdda0('0x5b'),'defaultPreferred',_0xdda0('0x68')],'raw':!![]});})[_0xdda0('0x1a')](handleEntityNotFound(_0x188092,null))['then'](function(_0x4b7220){if(_0x4b7220){var _0x1789b1=_0x4b7220['loginLogo']&&fs['existsSync'](path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x25dd20,_['toLower'](_0x4b7220[_0xdda0('0x56')])))?path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x25dd20,_[_0xdda0('0x5e')](_0x4b7220[_0xdda0('0x56')])):path[_0xdda0('0x5c')](config['root'],_0x25dd20,_[_0xdda0('0x5e')](_0xdda0('0x69')));var _0xf02fa9=_0xdda0('0x5f')+_[_0xdda0('0x60')](_0xdda0('0x56'));if(_0x4b7220[_0xf02fa9]||!_0x8bb016[_0xdda0('0x6a')]){_0x1789b1=path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x25dd20,_[_0xdda0('0x5e')]('default_loginLogo.svg'));}if(!fs[_0xdda0('0x6b')](_0x1789b1)){throw new db[(_0xdda0('0x62'))][(_0xdda0('0x63'))](_['upperFirst'](_0xdda0('0x56'))+'\x20not\x20found');}return _0x188092['download'](_0x1789b1);}})['catch'](handleError(_0x188092,null));};exports[_0xdda0('0x6c')]=function(_0xb1a05c,_0x219f23){return db['Setting']['find']({'where':{'id':_0xb1a05c[_0xdda0('0x4f')]['id']},'attributes':['securePassword']})[_0xdda0('0x1a')](respondWithResult(_0x219f23,null))['catch'](handleError(_0x219f23,null));};exports[_0xdda0('0x6d')]=function(_0x26063d,_0x35818c,_0x28c478){if(_0x26063d[_0xdda0('0x54')]&&_0x26063d[_0xdda0('0x54')][_0xdda0('0x6e')]){_0x26063d[_0xdda0('0x53')]['preferred']=_0x26063d[_0xdda0('0x54')][_0xdda0('0x6e')];}return db['Setting'][_0xdda0('0x51')]({'where':{'id':_0x26063d[_0xdda0('0x4f')]['id']}})[_0xdda0('0x1a')](handleEntityNotFound(_0x35818c,null))[_0xdda0('0x1a')](saveUpdates(_0x26063d['body'],null))['then'](respondWithResult(_0x35818c,null))[_0xdda0('0x24')](handleError(_0x35818c,null));};var utilLicense=require(_0xdda0('0x15'));exports[_0xdda0('0x6f')]=function(_0x2490ed,_0x42c9c3,_0x1cbdb7){var _0x32c807=_0xdda0('0x57');var _0x554185={'custom':![]};return utilLicense['getLicense']()[_0xdda0('0x1a')](function(_0x54e278){if(_0x54e278){_0x554185=_0x54e278;}return db[_0xdda0('0x35')][_0xdda0('0x51')]({'where':{'id':_0x2490ed['params']['id']},'attributes':[_0xdda0('0x58'),_0xdda0('0x56'),_0xdda0('0x67'),_0xdda0('0x59'),_0xdda0('0x5a'),'defaultLoginLogo','defaultPreferred',_0xdda0('0x68')],'raw':!![]});})['then'](handleEntityNotFound(_0x42c9c3,null))[_0xdda0('0x1a')](function(_0x13ba0b){if(_0x13ba0b){var _0x2e3314=_0x13ba0b[_0xdda0('0x67')]&&fs[_0xdda0('0x6b')](path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x32c807,_[_0xdda0('0x5e')](_0x13ba0b['preferred'])))?path[_0xdda0('0x5c')](config['root'],_0x32c807,_[_0xdda0('0x5e')](_0x13ba0b['preferred'])):path[_0xdda0('0x5c')](config['root'],_0x32c807,_['toLower'](_0xdda0('0x70')));var _0x4f8765=_0xdda0('0x5f')+_[_0xdda0('0x60')]('preferred');if(_0x13ba0b[_0x4f8765]||!_0x554185[_0xdda0('0x6a')]||!_0x554185[_0xdda0('0x67')]){_0x2e3314=path['join'](config[_0xdda0('0x5d')],_0x32c807,_[_0xdda0('0x5e')](_0xdda0('0x70')));}if(!fs[_0xdda0('0x6b')](_0x2e3314)){throw new db[(_0xdda0('0x62'))][(_0xdda0('0x63'))](_[_0xdda0('0x60')]('preferred')+_0xdda0('0x71'));}return _0x42c9c3['download'](_0x2e3314);}})[_0xdda0('0x24')](handleError(_0x42c9c3,null));};exports[_0xdda0('0x72')]=function(_0x20d2bf,_0x34b56c,_0x18cd05){if(_0x20d2bf[_0xdda0('0x54')]&&_0x20d2bf[_0xdda0('0x54')]['filename']){_0x20d2bf[_0xdda0('0x53')]['favicon']=_0x20d2bf[_0xdda0('0x54')][_0xdda0('0x6e')];}return db[_0xdda0('0x35')][_0xdda0('0x51')]({'where':{'id':_0x20d2bf[_0xdda0('0x4f')]['id']}})[_0xdda0('0x1a')](handleEntityNotFound(_0x34b56c,null))[_0xdda0('0x1a')](saveUpdates(_0x20d2bf['body'],null))[_0xdda0('0x1a')](respondWithResult(_0x34b56c,null))[_0xdda0('0x24')](handleError(_0x34b56c,null));};var utilLicense=require('../../config/license/util');exports[_0xdda0('0x73')]=function(_0x3cc74c,_0x475426,_0xae41c5){var _0x22c0c0='server/files/images/logos';var _0x127a75={'custom':![]};return utilLicense['getLicense']()[_0xdda0('0x1a')](function(_0xf1d45c){if(_0xf1d45c){_0x127a75=_0xf1d45c;}return db['Setting'][_0xdda0('0x51')]({'where':{'id':_0x3cc74c[_0xdda0('0x4f')]['id']},'attributes':[_0xdda0('0x58'),_0xdda0('0x56'),'preferred',_0xdda0('0x59'),'defaultLogo',_0xdda0('0x5b'),_0xdda0('0x74'),_0xdda0('0x68')],'raw':!![]});})[_0xdda0('0x1a')](handleEntityNotFound(_0x475426,null))[_0xdda0('0x1a')](function(_0x4c757f){if(_0x4c757f){var _0x323fc3=_0x4c757f[_0xdda0('0x59')]&&fs[_0xdda0('0x6b')](path[_0xdda0('0x5c')](config['root'],_0x22c0c0,_[_0xdda0('0x5e')](_0x4c757f[_0xdda0('0x59')])))?path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x22c0c0,_[_0xdda0('0x5e')](_0x4c757f['favicon'])):path[_0xdda0('0x5c')](config[_0xdda0('0x5d')],_0x22c0c0,_['toLower'](_0xdda0('0x75')));var _0x432d7c='default'+_[_0xdda0('0x60')](_0xdda0('0x59'));if(_0x4c757f[_0x432d7c]||!_0x127a75[_0xdda0('0x6a')]){_0x323fc3=path['join'](config[_0xdda0('0x5d')],_0x22c0c0,_[_0xdda0('0x5e')](_0xdda0('0x75')));}if(!fs[_0xdda0('0x6b')](_0x323fc3)){throw new db[(_0xdda0('0x62'))][(_0xdda0('0x63'))](_[_0xdda0('0x60')](_0xdda0('0x59'))+'\x20not\x20found');}return _0x475426[_0xdda0('0x64')](_0x323fc3);}})[_0xdda0('0x24')](handleError(_0x475426,null));};exports['getDate']=function(_0x1470cd,_0x2714b2){var _0x4b1190={'offset':moment()[_0xdda0('0x76')]()};_0x4b1190[_0xdda0('0x77')]=moment()['utcOffset'](_0x4b1190[_0xdda0('0x28')])[_0xdda0('0x78')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2714b2[_0xdda0('0x26')](0xc8)[_0xdda0('0x32')](_0x4b1190);}; \ No newline at end of file +var _0x4fde=['findAll','rows','catch','show','params','keys','find','body','file','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','default_loginLogo.svg','securePassword','getPreferred','default_preferred.png','default','download','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll'];(function(_0x55fc8a,_0x376c1d){var _0x4e876d=function(_0xd6a94c){while(--_0xd6a94c){_0x55fc8a['push'](_0x55fc8a['shift']());}};_0x4e876d(++_0x376c1d);}(_0x4fde,0x19f));var _0xe4fd=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x4fde[_0x18b344];return _0x5ef6bb;};'use strict';var emlformat=require(_0xe4fd('0x0'));var rimraf=require(_0xe4fd('0x1'));var zipdir=require(_0xe4fd('0x2'));var jsonpatch=require(_0xe4fd('0x3'));var rp=require('request-promise');var moment=require(_0xe4fd('0x4'));var BPromise=require(_0xe4fd('0x5'));var Mustache=require('mustache');var util=require(_0xe4fd('0x6'));var path=require(_0xe4fd('0x7'));var sox=require(_0xe4fd('0x8'));var csv=require(_0xe4fd('0x9'));var ejs=require(_0xe4fd('0xa'));var fs=require('fs');var fs_extra=require(_0xe4fd('0xb'));var _=require(_0xe4fd('0xc'));var squel=require(_0xe4fd('0xd'));var crypto=require(_0xe4fd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe4fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe4fd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe4fd('0x11'));var qs=require(_0xe4fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4fd('0x13'))(_0xe4fd('0x14'));var utils=require(_0xe4fd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe4fd('0x16'));var db=require(_0xe4fd('0x17'))['db'];var jayson=require(_0xe4fd('0x18'));var client=jayson[_0xe4fd('0x19')][_0xe4fd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2df77c,_0x48a926,_0x45a2b9,_0x2b5a14){return new BPromise(function(_0x5499c6,_0x5c88de){var _0x2ae150=_0x2b5a14||client;return _0x2ae150[_0xe4fd('0x1b')](_0x2df77c,_0x45a2b9)['then'](function(_0x5578e1){logger[_0xe4fd('0x1c')](_0xe4fd('0x1d'),_0x48a926,_0xe4fd('0x1e'));logger['debug'](_0xe4fd('0x1f'),_0x48a926,'request\x20sent',JSON['stringify'](_0x5578e1));if(_0x5578e1[_0xe4fd('0x20')]){if(_0x5578e1[_0xe4fd('0x20')][_0xe4fd('0x21')]===0x1f4){logger[_0xe4fd('0x20')](_0xe4fd('0x1d'),_0x48a926,_0x5578e1['error'][_0xe4fd('0x22')]);return _0x5c88de(_0x5578e1[_0xe4fd('0x20')][_0xe4fd('0x22')]);}logger[_0xe4fd('0x20')](_0xe4fd('0x1d'),_0x48a926,_0x5578e1[_0xe4fd('0x20')][_0xe4fd('0x22')]);return _0x5499c6(_0x5578e1[_0xe4fd('0x20')][_0xe4fd('0x22')]);}else{logger['info'](_0xe4fd('0x1d'),_0x48a926,_0xe4fd('0x1e'));_0x5499c6(_0x5578e1['result']['message']);}})['catch'](function(_0x29c2d7){logger['error'](_0xe4fd('0x1d'),_0x48a926,_0x29c2d7);_0x5c88de(_0x29c2d7);});});}function respondWithStatusCode(_0x5941b5,_0x261259){_0x261259=_0x261259||0xcc;return function(_0x394878){if(_0x394878){return _0x5941b5[_0xe4fd('0x23')](_0x261259);}return _0x5941b5['status'](_0x261259)[_0xe4fd('0x24')]();};}function respondWithResult(_0xa6513c,_0x2f826a){_0x2f826a=_0x2f826a||0xc8;return function(_0x40a748){if(_0x40a748){return _0xa6513c[_0xe4fd('0x25')](_0x2f826a)['json'](_0x40a748);}};}function respondWithFilteredResult(_0x303642,_0x196fe8){return function(_0xef9721){if(_0xef9721){var _0x38f206=typeof _0x196fe8[_0xe4fd('0x26')]===_0xe4fd('0x27')&&typeof _0x196fe8[_0xe4fd('0x28')]===_0xe4fd('0x27');var _0x3aa4cb=_0xef9721[_0xe4fd('0x29')];var _0x2dcbb4=_0x38f206?0x0:_0x196fe8[_0xe4fd('0x26')];var _0x92eed0=_0x38f206?_0xef9721[_0xe4fd('0x29')]:_0x196fe8[_0xe4fd('0x26')]+_0x196fe8[_0xe4fd('0x28')];var _0x392eba;if(_0x92eed0>=_0x3aa4cb){_0x92eed0=_0x3aa4cb;_0x392eba=0xc8;}else{_0x392eba=0xce;}_0x303642['status'](_0x392eba);return _0x303642[_0xe4fd('0x2a')](_0xe4fd('0x2b'),_0x2dcbb4+'-'+_0x92eed0+'/'+_0x3aa4cb)[_0xe4fd('0x2c')](_0xef9721);}return null;};}function patchUpdates(_0x4c8f70){return function(_0x34243c){try{jsonpatch[_0xe4fd('0x2d')](_0x34243c,_0x4c8f70,!![]);}catch(_0xe2f6ce){return BPromise[_0xe4fd('0x2e')](_0xe2f6ce);}return _0x34243c[_0xe4fd('0x2f')]();};}function saveUpdates(_0x4cee0d,_0x39716c){return function(_0x50906){if(_0x50906){return _0x50906[_0xe4fd('0x30')](_0x4cee0d)[_0xe4fd('0x31')](function(_0x1f90bf){return _0x1f90bf;});}return null;};}function removeEntity(_0x2b275d,_0x2085d2){return function(_0x32c71e){if(_0x32c71e){return _0x32c71e[_0xe4fd('0x32')]()[_0xe4fd('0x31')](function(){_0x2b275d[_0xe4fd('0x25')](0xcc)[_0xe4fd('0x24')]();});}};}function handleEntityNotFound(_0x105fbd,_0x149bba){return function(_0x3ba119){if(!_0x3ba119){_0x105fbd[_0xe4fd('0x23')](0x194);}return _0x3ba119;};}function handleError(_0xa75e58,_0xb5325c){_0xb5325c=_0xb5325c||0x1f4;return function(_0x99c273){logger[_0xe4fd('0x20')](_0x99c273[_0xe4fd('0x33')]);if(_0x99c273[_0xe4fd('0x34')]){delete _0x99c273[_0xe4fd('0x34')];}_0xa75e58[_0xe4fd('0x25')](_0xb5325c)[_0xe4fd('0x35')](_0x99c273);};}exports['index']=function(_0x506bac,_0x471dab){var _0x1eb85a={},_0x2af49c={},_0x2929b7={'count':0x0,'rows':[]};var _0x4a25bf=_[_0xe4fd('0x36')](db[_0xe4fd('0x37')][_0xe4fd('0x38')],function(_0x2d0f85){return{'name':_0x2d0f85[_0xe4fd('0x39')],'type':_0x2d0f85[_0xe4fd('0x3a')][_0xe4fd('0x3b')]};});_0x2af49c[_0xe4fd('0x3c')]=_[_0xe4fd('0x36')](_0x4a25bf,'name');_0x2af49c[_0xe4fd('0x3d')]=_['keys'](_0x506bac[_0xe4fd('0x3d')]);_0x2af49c[_0xe4fd('0x3e')]=_[_0xe4fd('0x3f')](_0x2af49c[_0xe4fd('0x3c')],_0x2af49c[_0xe4fd('0x3d')]);_0x1eb85a['attributes']=_[_0xe4fd('0x3f')](_0x2af49c[_0xe4fd('0x3c')],qs[_0xe4fd('0x40')](_0x506bac[_0xe4fd('0x3d')][_0xe4fd('0x40')]));_0x1eb85a[_0xe4fd('0x41')]=_0x1eb85a['attributes'][_0xe4fd('0x42')]?_0x1eb85a[_0xe4fd('0x41')]:_0x2af49c[_0xe4fd('0x3c')];if(!_0x506bac['query'][_0xe4fd('0x43')](_0xe4fd('0x44'))){_0x1eb85a[_0xe4fd('0x28')]=qs[_0xe4fd('0x28')](_0x506bac['query'][_0xe4fd('0x28')]);_0x1eb85a[_0xe4fd('0x26')]=qs[_0xe4fd('0x26')](_0x506bac[_0xe4fd('0x3d')]['offset']);}_0x1eb85a['order']=qs[_0xe4fd('0x45')](_0x506bac[_0xe4fd('0x3d')]['sort']);_0x1eb85a[_0xe4fd('0x46')]=qs[_0xe4fd('0x3e')](_[_0xe4fd('0x47')](_0x506bac[_0xe4fd('0x3d')],_0x2af49c[_0xe4fd('0x3e')]),_0x4a25bf);if(_0x506bac[_0xe4fd('0x3d')]['filter']){_0x1eb85a['where']=_['merge'](_0x1eb85a[_0xe4fd('0x46')],{'$or':_[_0xe4fd('0x36')](_0x4a25bf,function(_0x25237b){if(_0x25237b[_0xe4fd('0x3a')]!==_0xe4fd('0x48')){var _0x28898c={};_0x28898c[_0x25237b[_0xe4fd('0x34')]]={'$like':'%'+_0x506bac[_0xe4fd('0x3d')][_0xe4fd('0x49')]+'%'};return _0x28898c;}})});}_0x1eb85a=_[_0xe4fd('0x4a')]({},_0x1eb85a,_0x506bac[_0xe4fd('0x4b')]);var _0x3ea12e={'where':_0x1eb85a[_0xe4fd('0x46')]};return db[_0xe4fd('0x37')]['count'](_0x3ea12e)[_0xe4fd('0x31')](function(_0x69c186){_0x2929b7[_0xe4fd('0x29')]=_0x69c186;if(_0x506bac['query'][_0xe4fd('0x4c')]){_0x1eb85a['include']=[{'all':!![]}];}return db['Setting'][_0xe4fd('0x4d')](_0x1eb85a);})[_0xe4fd('0x31')](function(_0x312114){_0x2929b7[_0xe4fd('0x4e')]=_0x312114;return _0x2929b7;})[_0xe4fd('0x31')](respondWithFilteredResult(_0x471dab,_0x1eb85a))[_0xe4fd('0x4f')](handleError(_0x471dab,null));};exports[_0xe4fd('0x50')]=function(_0x5d90c4,_0x415582){var _0x22ff0f={'raw':![],'where':{'id':_0x5d90c4[_0xe4fd('0x51')]['id']}},_0x16bd52={};_0x16bd52[_0xe4fd('0x3c')]=_[_0xe4fd('0x52')](db[_0xe4fd('0x37')][_0xe4fd('0x38')]);_0x16bd52[_0xe4fd('0x3d')]=_[_0xe4fd('0x52')](_0x5d90c4[_0xe4fd('0x3d')]);_0x16bd52[_0xe4fd('0x3e')]=_[_0xe4fd('0x3f')](_0x16bd52[_0xe4fd('0x3c')],_0x16bd52[_0xe4fd('0x3d')]);_0x22ff0f['attributes']=_[_0xe4fd('0x3f')](_0x16bd52[_0xe4fd('0x3c')],qs[_0xe4fd('0x40')](_0x5d90c4[_0xe4fd('0x3d')]['fields']));_0x22ff0f['attributes']=_0x22ff0f[_0xe4fd('0x41')][_0xe4fd('0x42')]?_0x22ff0f[_0xe4fd('0x41')]:_0x16bd52['model'];if(_0x5d90c4[_0xe4fd('0x3d')][_0xe4fd('0x4c')]){_0x22ff0f['include']=[{'all':!![]}];}_0x22ff0f=_[_0xe4fd('0x4a')]({},_0x22ff0f,_0x5d90c4[_0xe4fd('0x4b')]);return db[_0xe4fd('0x37')][_0xe4fd('0x53')](_0x22ff0f)[_0xe4fd('0x31')](handleEntityNotFound(_0x415582,null))[_0xe4fd('0x31')](respondWithResult(_0x415582,null))[_0xe4fd('0x4f')](handleError(_0x415582,null));};exports[_0xe4fd('0x30')]=function(_0xcc01a4,_0x5370f6){if(_0xcc01a4['body']['id']){delete _0xcc01a4['body']['id'];}return db[_0xe4fd('0x37')][_0xe4fd('0x53')]({'where':{'id':_0xcc01a4['params']['id']}})[_0xe4fd('0x31')](handleEntityNotFound(_0x5370f6,null))[_0xe4fd('0x31')](saveUpdates(_0xcc01a4[_0xe4fd('0x54')],null))[_0xe4fd('0x31')](respondWithResult(_0x5370f6,null))['catch'](handleError(_0x5370f6,null));};exports['addLogo']=function(_0x52d36f,_0x5cc532,_0x2342bf){if(_0x52d36f[_0xe4fd('0x55')]&&_0x52d36f[_0xe4fd('0x55')][_0xe4fd('0x56')]){_0x52d36f[_0xe4fd('0x54')]['logo']=_0x52d36f[_0xe4fd('0x55')]['filename'];}return db['Setting'][_0xe4fd('0x53')]({'where':{'id':_0x52d36f[_0xe4fd('0x51')]['id']}})[_0xe4fd('0x31')](handleEntityNotFound(_0x5cc532,null))['then'](saveUpdates(_0x52d36f[_0xe4fd('0x54')],null))[_0xe4fd('0x31')](respondWithResult(_0x5cc532,null))['catch'](handleError(_0x5cc532,null));};exports[_0xe4fd('0x57')]=function(_0x450edf,_0x187f5f,_0xecf893){if(_0x450edf[_0xe4fd('0x55')]&&_0x450edf['file']['filename']){_0x450edf[_0xe4fd('0x54')][_0xe4fd('0x58')]=_0x450edf[_0xe4fd('0x55')][_0xe4fd('0x56')];}return db[_0xe4fd('0x37')]['find']({'where':{'id':_0x450edf[_0xe4fd('0x51')]['id']}})[_0xe4fd('0x31')](handleEntityNotFound(_0x187f5f,null))[_0xe4fd('0x31')](saveUpdates(_0x450edf[_0xe4fd('0x54')],null))[_0xe4fd('0x31')](respondWithResult(_0x187f5f,null))[_0xe4fd('0x4f')](handleError(_0x187f5f,null));};var utilLicense=require(_0xe4fd('0x16'));exports['getLogo']=function(_0x3874ac,_0x39c243,_0x83b792){var _0x33cbb2=_0xe4fd('0x59');var _0x5787e9={'custom':![]};return utilLicense[_0xe4fd('0x5a')]()[_0xe4fd('0x31')](function(_0x2fe2c5){if(_0x2fe2c5){_0x5787e9=_0x2fe2c5;}return db[_0xe4fd('0x37')][_0xe4fd('0x53')]({'where':{'id':_0x3874ac[_0xe4fd('0x51')]['id']},'attributes':[_0xe4fd('0x5b'),_0xe4fd('0x58'),_0xe4fd('0x5c'),_0xe4fd('0x5d'),_0xe4fd('0x5e'),_0xe4fd('0x5f'),_0xe4fd('0x60'),_0xe4fd('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x39c243,null))[_0xe4fd('0x31')](function(_0x4b5715){if(_0x4b5715){var _0x17d19a=_0x4b5715[_0xe4fd('0x5b')]&&fs[_0xe4fd('0x62')](path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x33cbb2,_['toLower'](_0x4b5715['logo'])))?path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x33cbb2,_[_0xe4fd('0x65')](_0x4b5715[_0xe4fd('0x5b')])):path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x33cbb2,_[_0xe4fd('0x65')](_0xe4fd('0x66')));var _0x1f3c9e='default'+_[_0xe4fd('0x67')](_0xe4fd('0x5b'));if(_0x4b5715[_0x1f3c9e]||!_0x5787e9[_0xe4fd('0x68')]){_0x17d19a=path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x33cbb2,_['toLower']('default_logo.svg'));}if(!fs['existsSync'](_0x17d19a)){throw new db[(_0xe4fd('0x69'))][(_0xe4fd('0x6a'))](_[_0xe4fd('0x67')](_0xe4fd('0x5b'))+_0xe4fd('0x6b'));}return _0x39c243['download'](_0x17d19a);}})[_0xe4fd('0x4f')](handleError(_0x39c243,null));};var utilLicense=require(_0xe4fd('0x16'));exports[_0xe4fd('0x6c')]=function(_0x32b680,_0x2621ef,_0x2c3e7e){var _0x490bf3='server/files/images/logos';var _0x39ae8c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x426dc6){if(_0x426dc6){_0x39ae8c=_0x426dc6;}return db[_0xe4fd('0x37')][_0xe4fd('0x53')]({'where':{'id':_0x32b680['params']['id']},'attributes':[_0xe4fd('0x5b'),_0xe4fd('0x58'),_0xe4fd('0x5c'),_0xe4fd('0x5d'),_0xe4fd('0x5e'),_0xe4fd('0x5f'),_0xe4fd('0x60'),'defaultFavicon'],'raw':!![]});})[_0xe4fd('0x31')](handleEntityNotFound(_0x2621ef,null))[_0xe4fd('0x31')](function(_0x1de85e){if(_0x1de85e){var _0x4d12ff=_0x1de85e[_0xe4fd('0x58')]&&fs[_0xe4fd('0x62')](path['join'](config[_0xe4fd('0x64')],_0x490bf3,_[_0xe4fd('0x65')](_0x1de85e[_0xe4fd('0x58')])))?path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x490bf3,_[_0xe4fd('0x65')](_0x1de85e[_0xe4fd('0x58')])):path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x490bf3,_[_0xe4fd('0x65')]('default_loginLogo.svg'));var _0x3e73e4='default'+_['upperFirst']('loginLogo');if(_0x1de85e[_0x3e73e4]||!_0x39ae8c[_0xe4fd('0x68')]){_0x4d12ff=path['join'](config['root'],_0x490bf3,_[_0xe4fd('0x65')](_0xe4fd('0x6d')));}if(!fs[_0xe4fd('0x62')](_0x4d12ff)){throw new db['Sequelize'][(_0xe4fd('0x6a'))](_[_0xe4fd('0x67')](_0xe4fd('0x58'))+_0xe4fd('0x6b'));}return _0x2621ef['download'](_0x4d12ff);}})[_0xe4fd('0x4f')](handleError(_0x2621ef,null));};exports['gdpr']=function(_0x151a98,_0x566800){return db[_0xe4fd('0x37')][_0xe4fd('0x53')]({'where':{'id':_0x151a98[_0xe4fd('0x51')]['id']},'attributes':[_0xe4fd('0x6e')]})[_0xe4fd('0x31')](respondWithResult(_0x566800,null))[_0xe4fd('0x4f')](handleError(_0x566800,null));};exports['addPreferred']=function(_0x53f0f7,_0x1b2dad,_0x43e71b){if(_0x53f0f7[_0xe4fd('0x55')]&&_0x53f0f7[_0xe4fd('0x55')][_0xe4fd('0x56')]){_0x53f0f7[_0xe4fd('0x54')][_0xe4fd('0x5c')]=_0x53f0f7[_0xe4fd('0x55')][_0xe4fd('0x56')];}return db[_0xe4fd('0x37')][_0xe4fd('0x53')]({'where':{'id':_0x53f0f7[_0xe4fd('0x51')]['id']}})[_0xe4fd('0x31')](handleEntityNotFound(_0x1b2dad,null))[_0xe4fd('0x31')](saveUpdates(_0x53f0f7[_0xe4fd('0x54')],null))[_0xe4fd('0x31')](respondWithResult(_0x1b2dad,null))[_0xe4fd('0x4f')](handleError(_0x1b2dad,null));};var utilLicense=require(_0xe4fd('0x16'));exports[_0xe4fd('0x6f')]=function(_0x1a1e08,_0x29da05,_0x1ab9b2){var _0x4b38f1=_0xe4fd('0x59');var _0x4ee95a={'custom':![]};return utilLicense[_0xe4fd('0x5a')]()[_0xe4fd('0x31')](function(_0x247dcc){if(_0x247dcc){_0x4ee95a=_0x247dcc;}return db['Setting'][_0xe4fd('0x53')]({'where':{'id':_0x1a1e08['params']['id']},'attributes':[_0xe4fd('0x5b'),_0xe4fd('0x58'),_0xe4fd('0x5c'),_0xe4fd('0x5d'),_0xe4fd('0x5e'),_0xe4fd('0x5f'),_0xe4fd('0x60'),_0xe4fd('0x61')],'raw':!![]});})[_0xe4fd('0x31')](handleEntityNotFound(_0x29da05,null))['then'](function(_0x1063da){if(_0x1063da){var _0x17c83b=_0x1063da[_0xe4fd('0x5c')]&&fs[_0xe4fd('0x62')](path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x4b38f1,_[_0xe4fd('0x65')](_0x1063da[_0xe4fd('0x5c')])))?path['join'](config['root'],_0x4b38f1,_[_0xe4fd('0x65')](_0x1063da[_0xe4fd('0x5c')])):path['join'](config[_0xe4fd('0x64')],_0x4b38f1,_[_0xe4fd('0x65')](_0xe4fd('0x70')));var _0x776869=_0xe4fd('0x71')+_[_0xe4fd('0x67')](_0xe4fd('0x5c'));if(_0x1063da[_0x776869]||!_0x4ee95a[_0xe4fd('0x68')]||!_0x4ee95a[_0xe4fd('0x5c')]){_0x17c83b=path['join'](config['root'],_0x4b38f1,_[_0xe4fd('0x65')]('default_preferred.png'));}if(!fs[_0xe4fd('0x62')](_0x17c83b)){throw new db[(_0xe4fd('0x69'))][(_0xe4fd('0x6a'))](_[_0xe4fd('0x67')](_0xe4fd('0x5c'))+_0xe4fd('0x6b'));}return _0x29da05[_0xe4fd('0x72')](_0x17c83b);}})[_0xe4fd('0x4f')](handleError(_0x29da05,null));};exports[_0xe4fd('0x73')]=function(_0x5870ce,_0x5648dc,_0x139c3f){if(_0x5870ce['file']&&_0x5870ce[_0xe4fd('0x55')][_0xe4fd('0x56')]){_0x5870ce['body'][_0xe4fd('0x5d')]=_0x5870ce[_0xe4fd('0x55')][_0xe4fd('0x56')];}return db['Setting'][_0xe4fd('0x53')]({'where':{'id':_0x5870ce[_0xe4fd('0x51')]['id']}})[_0xe4fd('0x31')](handleEntityNotFound(_0x5648dc,null))[_0xe4fd('0x31')](saveUpdates(_0x5870ce[_0xe4fd('0x54')],null))[_0xe4fd('0x31')](respondWithResult(_0x5648dc,null))[_0xe4fd('0x4f')](handleError(_0x5648dc,null));};var utilLicense=require(_0xe4fd('0x16'));exports[_0xe4fd('0x74')]=function(_0x2900ab,_0x10d3af,_0x479020){var _0x85dc02='server/files/images/logos';var _0x3b6f71={'custom':![]};return utilLicense[_0xe4fd('0x5a')]()['then'](function(_0x1f0c1d){if(_0x1f0c1d){_0x3b6f71=_0x1f0c1d;}return db[_0xe4fd('0x37')][_0xe4fd('0x53')]({'where':{'id':_0x2900ab[_0xe4fd('0x51')]['id']},'attributes':['logo',_0xe4fd('0x58'),_0xe4fd('0x5c'),_0xe4fd('0x5d'),_0xe4fd('0x5e'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xe4fd('0x31')](handleEntityNotFound(_0x10d3af,null))[_0xe4fd('0x31')](function(_0x1ad26a){if(_0x1ad26a){var _0x1a6bad=_0x1ad26a[_0xe4fd('0x5d')]&&fs[_0xe4fd('0x62')](path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x85dc02,_[_0xe4fd('0x65')](_0x1ad26a[_0xe4fd('0x5d')])))?path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x85dc02,_['toLower'](_0x1ad26a[_0xe4fd('0x5d')])):path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x85dc02,_['toLower'](_0xe4fd('0x75')));var _0x49c116=_0xe4fd('0x71')+_[_0xe4fd('0x67')](_0xe4fd('0x5d'));if(_0x1ad26a[_0x49c116]||!_0x3b6f71['custom']){_0x1a6bad=path[_0xe4fd('0x63')](config[_0xe4fd('0x64')],_0x85dc02,_[_0xe4fd('0x65')](_0xe4fd('0x75')));}if(!fs[_0xe4fd('0x62')](_0x1a6bad)){throw new db[(_0xe4fd('0x69'))][(_0xe4fd('0x6a'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x10d3af[_0xe4fd('0x72')](_0x1a6bad);}})[_0xe4fd('0x4f')](handleError(_0x10d3af,null));};exports[_0xe4fd('0x76')]=function(_0x7606f,_0x551e77){var _0x36d73e={'offset':moment()[_0xe4fd('0x77')]()};_0x36d73e[_0xe4fd('0x78')]=moment()[_0xe4fd('0x77')](_0x36d73e['offset'])[_0xe4fd('0x79')](_0xe4fd('0x7a'));return _0x551e77[_0xe4fd('0x25')](0xc8)['send'](_0x36d73e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 7e2b875..279b5a1 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x7217,0x19e));var _0x7721=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x7217[_0x4243a3];return _0x1b2a33;};'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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x7217,0x19e));var _0x7721=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7217[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 6234c0e..cb4385f 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 _0xc7ec=['stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','Setting','find','options','raw','where','map','include','model','attributes','then','ShowSetting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x586671,_0x4dd81b){var _0x5d8606=function(_0xd52fae){while(--_0xd52fae){_0x586671['push'](_0x586671['shift']());}};_0x5d8606(++_0x4dd81b);}(_0xc7ec,0x1aa));var _0xcc7e=function(_0x44caf4,_0x238750){_0x44caf4=_0x44caf4-0x0;var _0x117cad=_0xc7ec[_0x44caf4];return _0x117cad;};'use strict';var _=require('lodash');var util=require(_0xcc7e('0x0'));var moment=require(_0xcc7e('0x1'));var BPromise=require(_0xcc7e('0x2'));var rs=require(_0xcc7e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc7e('0x4'))['db'];var utils=require(_0xcc7e('0x5'));var logger=require(_0xcc7e('0x6'))('rpc');var config=require(_0xcc7e('0x7'));var jayson=require(_0xcc7e('0x8'));var client=jayson[_0xcc7e('0x9')][_0xcc7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cfe11,_0x1d1076,_0x3b52c0){return new BPromise(function(_0x17864a,_0x35dfdb){return client[_0xcc7e('0xb')](_0x2cfe11,_0x3b52c0)['then'](function(_0x1e95ed){logger[_0xcc7e('0xc')]('Setting,\x20%s,\x20%s',_0x1d1076,_0xcc7e('0xd'));logger[_0xcc7e('0xe')](_0xcc7e('0xf'),_0x1d1076,'request\x20sent',JSON[_0xcc7e('0x10')](_0x1e95ed));if(_0x1e95ed[_0xcc7e('0x11')]){if(_0x1e95ed[_0xcc7e('0x11')][_0xcc7e('0x12')]===0x1f4){logger[_0xcc7e('0x11')](_0xcc7e('0x13'),_0x1d1076,_0x1e95ed[_0xcc7e('0x11')][_0xcc7e('0x14')]);return _0x35dfdb(_0x1e95ed[_0xcc7e('0x11')][_0xcc7e('0x14')]);}logger[_0xcc7e('0x11')](_0xcc7e('0x13'),_0x1d1076,_0x1e95ed[_0xcc7e('0x11')][_0xcc7e('0x14')]);return _0x17864a(_0x1e95ed[_0xcc7e('0x11')][_0xcc7e('0x14')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1d1076,_0xcc7e('0xd'));_0x17864a(_0x1e95ed[_0xcc7e('0x15')][_0xcc7e('0x14')]);}})[_0xcc7e('0x16')](function(_0x59a894){logger['error'](_0xcc7e('0x13'),_0x1d1076,_0x59a894);_0x35dfdb(_0x59a894);});});}exports['ShowSetting']=function(_0x4259a2){var _0x37f950=this;return new Promise(function(_0xd94250,_0x3ff2bb){return db[_0xcc7e('0x17')][_0xcc7e('0x18')]({'raw':_0x4259a2[_0xcc7e('0x19')]?_0x4259a2[_0xcc7e('0x19')][_0xcc7e('0x1a')]===undefined?!![]:![]:!![],'where':_0x4259a2[_0xcc7e('0x19')]?_0x4259a2[_0xcc7e('0x19')][_0xcc7e('0x1b')]||null:null,'attributes':_0x4259a2[_0xcc7e('0x19')]?_0x4259a2['options']['attributes']||null:null,'include':_0x4259a2[_0xcc7e('0x19')]?_0x4259a2['options']['include']?_[_0xcc7e('0x1c')](_0x4259a2[_0xcc7e('0x19')][_0xcc7e('0x1d')],function(_0x5c4bab){return{'model':db[_0x5c4bab[_0xcc7e('0x1e')]],'as':_0x5c4bab['as'],'attributes':_0x5c4bab[_0xcc7e('0x1f')],'include':_0x5c4bab[_0xcc7e('0x1d')]?_[_0xcc7e('0x1c')](_0x5c4bab[_0xcc7e('0x1d')],function(_0x4cf157){return{'model':db[_0x4cf157[_0xcc7e('0x1e')]],'as':_0x4cf157['as'],'attributes':_0x4cf157['attributes'],'include':_0x4cf157[_0xcc7e('0x1d')]?_['map'](_0x4cf157[_0xcc7e('0x1d')],function(_0x336dde){return{'model':db[_0x336dde[_0xcc7e('0x1e')]],'as':_0x336dde['as'],'attributes':_0x336dde[_0xcc7e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcc7e('0x20')](function(_0x3d3fea){logger[_0xcc7e('0xc')](_0xcc7e('0x21'),_0x4259a2);logger[_0xcc7e('0xe')](_0xcc7e('0x21'),_0x4259a2,JSON[_0xcc7e('0x10')](_0x3d3fea));_0xd94250(_0x3d3fea);})[_0xcc7e('0x16')](function(_0x1d0f73){logger[_0xcc7e('0x11')](_0xcc7e('0x21'),_0x1d0f73[_0xcc7e('0x14')],_0x4259a2);_0x3ff2bb(_0x37f950[_0xcc7e('0x11')](0x1f4,_0x1d0f73[_0xcc7e('0x14')]));});});}; \ No newline at end of file +var _0xa123=['model','then','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','ShowSetting','find','options','where','include','attributes','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa123,0x1b6));var _0x3a12=function(_0x34d154,_0x27ac14){_0x34d154=_0x34d154-0x0;var _0xec27d4=_0xa123[_0x34d154];return _0xec27d4;};'use strict';var _=require(_0x3a12('0x0'));var util=require(_0x3a12('0x1'));var moment=require('moment');var BPromise=require(_0x3a12('0x2'));var rs=require(_0x3a12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a12('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a12('0x6'));var client=jayson[_0x3a12('0x7')][_0x3a12('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37e90d,_0x31e657,_0xe28931){return new BPromise(function(_0x907006,_0x4d8a44){return client[_0x3a12('0x9')](_0x37e90d,_0xe28931)['then'](function(_0x4eb6c1){logger[_0x3a12('0xa')](_0x3a12('0xb'),_0x31e657,'request\x20sent');logger[_0x3a12('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x31e657,_0x3a12('0xd'),JSON['stringify'](_0x4eb6c1));if(_0x4eb6c1[_0x3a12('0xe')]){if(_0x4eb6c1[_0x3a12('0xe')][_0x3a12('0xf')]===0x1f4){logger[_0x3a12('0xe')](_0x3a12('0xb'),_0x31e657,_0x4eb6c1[_0x3a12('0xe')][_0x3a12('0x10')]);return _0x4d8a44(_0x4eb6c1[_0x3a12('0xe')][_0x3a12('0x10')]);}logger[_0x3a12('0xe')]('Setting,\x20%s,\x20%s',_0x31e657,_0x4eb6c1[_0x3a12('0xe')][_0x3a12('0x10')]);return _0x907006(_0x4eb6c1[_0x3a12('0xe')][_0x3a12('0x10')]);}else{logger[_0x3a12('0xa')](_0x3a12('0xb'),_0x31e657,_0x3a12('0xd'));_0x907006(_0x4eb6c1[_0x3a12('0x11')][_0x3a12('0x10')]);}})[_0x3a12('0x12')](function(_0x588b15){logger['error'](_0x3a12('0xb'),_0x31e657,_0x588b15);_0x4d8a44(_0x588b15);});});}exports[_0x3a12('0x13')]=function(_0x773d0b){var _0x434189=this;return new Promise(function(_0x78e7ac,_0x2b5079){return db['Setting'][_0x3a12('0x14')]({'raw':_0x773d0b[_0x3a12('0x15')]?_0x773d0b['options']['raw']===undefined?!![]:![]:!![],'where':_0x773d0b[_0x3a12('0x15')]?_0x773d0b[_0x3a12('0x15')][_0x3a12('0x16')]||null:null,'attributes':_0x773d0b[_0x3a12('0x15')]?_0x773d0b['options']['attributes']||null:null,'include':_0x773d0b[_0x3a12('0x15')]?_0x773d0b[_0x3a12('0x15')][_0x3a12('0x17')]?_['map'](_0x773d0b[_0x3a12('0x15')][_0x3a12('0x17')],function(_0x289389){return{'model':db[_0x289389['model']],'as':_0x289389['as'],'attributes':_0x289389[_0x3a12('0x18')],'include':_0x289389['include']?_[_0x3a12('0x19')](_0x289389[_0x3a12('0x17')],function(_0x4e5b72){return{'model':db[_0x4e5b72[_0x3a12('0x1a')]],'as':_0x4e5b72['as'],'attributes':_0x4e5b72['attributes'],'include':_0x4e5b72['include']?_[_0x3a12('0x19')](_0x4e5b72['include'],function(_0x181e3d){return{'model':db[_0x181e3d[_0x3a12('0x1a')]],'as':_0x181e3d['as'],'attributes':_0x181e3d[_0x3a12('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3a12('0x1b')](function(_0x2d81a3){logger[_0x3a12('0xa')](_0x3a12('0x13'),_0x773d0b);logger[_0x3a12('0xc')](_0x3a12('0x13'),_0x773d0b,JSON[_0x3a12('0x1c')](_0x2d81a3));_0x78e7ac(_0x2d81a3);})[_0x3a12('0x12')](function(_0x3be0d4){logger[_0x3a12('0xe')]('ShowSetting',_0x3be0d4[_0x3a12('0x10')],_0x773d0b);_0x2b5079(_0x434189[_0x3a12('0xe')](0x1f4,_0x3be0d4[_0x3a12('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 679e014..22158de 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 _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x3e74d4,_0xfeb53){var _0x38adee=function(_0x563c28){while(--_0x563c28){_0x3e74d4['push'](_0x3e74d4['shift']());}};_0x38adee(++_0xfeb53);}(_0x814b,0x1a2));var _0xb814=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x814b[_0x4bc428];return _0x3ca37f;};'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('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x54a490,_0x5dc752){var _0x29365a=function(_0x4fc14f){while(--_0x4fc14f){_0x54a490['push'](_0x54a490['shift']());}};_0x29365a(++_0x5dc752);}(_0x8ef6,0xf2));var _0x68ef=function(_0x223d5b,_0x12f94e){_0x223d5b=_0x223d5b-0x0;var _0x559b5c=_0x8ef6[_0x223d5b];return _0x559b5c;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index b391fe2..fd9e60d 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 _0xbae1=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x5cf1b6,_0x2dd3de){var _0x889a5=function(_0x34bad3){while(--_0x34bad3){_0x5cf1b6['push'](_0x5cf1b6['shift']());}};_0x889a5(++_0x2dd3de);}(_0xbae1,0xf1));var _0x1bae=function(_0x4444dc,_0x3751d8){_0x4444dc=_0x4444dc-0x0;var _0x530d38=_0xbae1[_0x4444dc];return _0x530d38;};'use strict';var Sequelize=require(_0x1bae('0x0'));var rs=require(_0x1bae('0x1'));module[_0x1bae('0x2')]={'name':{'type':Sequelize[_0x1bae('0x3')],'unique':_0x1bae('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x1bae('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x1bae('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x1bae('0x3')],'defaultValue':function(){return rs[_0x1bae('0x5')]();}},'phone':{'type':Sequelize[_0x1bae('0x3')]},'type':{'type':Sequelize['ENUM'](_0x1bae('0x6'),'skebby',_0x1bae('0x7'),_0x1bae('0x8'),_0x1bae('0x9'),_0x1bae('0xa'),_0x1bae('0xb'),_0x1bae('0xc'),_0x1bae('0xd'),_0x1bae('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x1bae('0x3')]},'password':{'type':Sequelize[_0x1bae('0x3')]},'apiKey':{'type':Sequelize[_0x1bae('0x3')]},'applicationId':{'type':Sequelize[_0x1bae('0x3')]},'accountId':{'type':Sequelize[_0x1bae('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x1bae('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1bae('0xf')],'defaultValue':function(){return _0x1bae('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1bae('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1bae('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1bae('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1bae('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1bae('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1bae('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1bae('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1bae('0x12')],'comment':_0x1bae('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x1bae('0x11')],'defaultValue':![],'comment':_0x1bae('0x14'),'set':function(_0x55033b){if(!_0x55033b)this[_0x1bae('0x15')](_0x1bae('0x16'),null);this[_0x1bae('0x15')](_0x1bae('0x17'),_0x55033b);}}}; \ No newline at end of file +var _0x7496=['exports','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x5c7525,_0x39490f){var _0x2e2ec8=function(_0x20d59a){while(--_0x20d59a){_0x5c7525['push'](_0x5c7525['shift']());}};_0x2e2ec8(++_0x39490f);}(_0x7496,0x174));var _0x6749=function(_0x2aef0d,_0x5847e8){_0x2aef0d=_0x2aef0d-0x0;var _0x235eec=_0x7496[_0x2aef0d];return _0x235eec;};'use strict';var Sequelize=require(_0x6749('0x0'));var rs=require(_0x6749('0x1'));module[_0x6749('0x2')]={'name':{'type':Sequelize[_0x6749('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x6749('0x3')],'defaultValue':function(){return rs[_0x6749('0x4')]();}},'phone':{'type':Sequelize[_0x6749('0x3')]},'type':{'type':Sequelize[_0x6749('0x5')](_0x6749('0x6'),'skebby',_0x6749('0x7'),_0x6749('0x8'),_0x6749('0x9'),_0x6749('0xa'),_0x6749('0xb'),_0x6749('0xc'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x6749('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x6749('0x3')]},'smsMethod':{'type':Sequelize[_0x6749('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6749('0x3')]},'password':{'type':Sequelize[_0x6749('0x3')]},'apiKey':{'type':Sequelize[_0x6749('0x3')]},'applicationId':{'type':Sequelize[_0x6749('0x3')]},'accountId':{'type':Sequelize[_0x6749('0x3')]},'senderString':{'type':Sequelize[_0x6749('0x3')]},'deliveryReport':{'type':Sequelize[_0x6749('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x6749('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6749('0xe')],'defaultValue':function(){return _0x6749('0xf');}},'notificationSound':{'type':Sequelize[_0x6749('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6749('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6749('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6749('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6749('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6749('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6749('0x10')],'comment':_0x6749('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x6749('0xd')],'defaultValue':![],'comment':_0x6749('0x12'),'set':function(_0x82ade5){if(!_0x82ade5)this[_0x6749('0x13')](_0x6749('0x14'),null);this[_0x6749('0x13')](_0x6749('0x15'),_0x82ade5);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index b481290..4c56103 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 _0x5f54=['options','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','messageId','sender','text','connectel','clicksend','message_id','plivo','Text','infobip','results','csc','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','send','CmList','List','out','SmsMessage','Messages','dataValues','debug','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','http','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','status','end','json','undefined','limit','count','offset','set','apply','update','destroy','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty'];(function(_0x2f8d76,_0x3f6a7c){var _0x3fbb4a=function(_0x1670d9){while(--_0x1670d9){_0x2f8d76['push'](_0x2f8d76['shift']());}};_0x3fbb4a(++_0x3f6a7c);}(_0x5f54,0x153));var _0x45f5=function(_0x2936cc,_0x1f7952){_0x2936cc=_0x2936cc-0x0;var _0xc23035=_0x5f54[_0x2936cc];return _0xc23035;};'use strict';var emlformat=require(_0x45f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45f5('0x1'));var jsonpatch=require(_0x45f5('0x2'));var rp=require('request-promise');var moment=require(_0x45f5('0x3'));var BPromise=require(_0x45f5('0x4'));var Mustache=require(_0x45f5('0x5'));var util=require(_0x45f5('0x6'));var path=require('path');var sox=require(_0x45f5('0x7'));var csv=require(_0x45f5('0x8'));var ejs=require(_0x45f5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45f5('0xa'));var squel=require(_0x45f5('0xb'));var crypto=require(_0x45f5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x45f5('0xd'));var Papa=require(_0x45f5('0xe'));var Redis=require(_0x45f5('0xf'));var authService=require(_0x45f5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x45f5('0x11'));var hardwareService=require(_0x45f5('0x12'));var logger=require(_0x45f5('0x13'))('api');var utils=require(_0x45f5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x45f5('0x15'));var db=require(_0x45f5('0x16'))['db'];config[_0x45f5('0x17')]=_[_0x45f5('0x18')](config[_0x45f5('0x17')],{'host':_0x45f5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45f5('0x17')]));require(_0x45f5('0x1a'))[_0x45f5('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x45f5('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x505fcc,_0x25c5e0,_0x1d39de,_0x5a0c22){return new BPromise(function(_0x43faa7,_0x2bfe0a){var _0x19b12d=_0x5a0c22||client;return _0x19b12d[_0x45f5('0x1d')](_0x505fcc,_0x1d39de)[_0x45f5('0x1e')](function(_0x19bde5){logger[_0x45f5('0x1f')](_0x45f5('0x20'),_0x25c5e0,'request\x20sent');logger['debug'](_0x45f5('0x21'),_0x25c5e0,'request\x20sent',JSON['stringify'](_0x19bde5));if(_0x19bde5[_0x45f5('0x22')]){if(_0x19bde5['error'][_0x45f5('0x23')]===0x1f4){logger['error'](_0x45f5('0x20'),_0x25c5e0,_0x19bde5[_0x45f5('0x22')][_0x45f5('0x24')]);return _0x2bfe0a(_0x19bde5[_0x45f5('0x22')][_0x45f5('0x24')]);}logger[_0x45f5('0x22')](_0x45f5('0x20'),_0x25c5e0,_0x19bde5['error']['message']);return _0x43faa7(_0x19bde5[_0x45f5('0x22')][_0x45f5('0x24')]);}else{logger[_0x45f5('0x1f')](_0x45f5('0x20'),_0x25c5e0,_0x45f5('0x25'));_0x43faa7(_0x19bde5[_0x45f5('0x26')]['message']);}})[_0x45f5('0x27')](function(_0x1d1a3f){logger[_0x45f5('0x22')]('SmsAccount,\x20%s,\x20%s',_0x25c5e0,_0x1d1a3f);_0x2bfe0a(_0x1d1a3f);});});}function respondWithStatusCode(_0xa8fb09,_0xd3cd29){_0xd3cd29=_0xd3cd29||0xcc;return function(_0x5b1d2f){if(_0x5b1d2f){return _0xa8fb09['sendStatus'](_0xd3cd29);}return _0xa8fb09[_0x45f5('0x28')](_0xd3cd29)[_0x45f5('0x29')]();};}function respondWithResult(_0x2d8386,_0x1dfdce){_0x1dfdce=_0x1dfdce||0xc8;return function(_0x430c8){if(_0x430c8){return _0x2d8386[_0x45f5('0x28')](_0x1dfdce)[_0x45f5('0x2a')](_0x430c8);}};}function respondWithFilteredResult(_0x6b4003,_0x5bf2c6){return function(_0x5d1599){if(_0x5d1599){var _0x205a7b=typeof _0x5bf2c6['offset']===_0x45f5('0x2b')&&typeof _0x5bf2c6[_0x45f5('0x2c')]===_0x45f5('0x2b');var _0x24f8c7=_0x5d1599[_0x45f5('0x2d')];var _0x1ee085=_0x205a7b?0x0:_0x5bf2c6[_0x45f5('0x2e')];var _0x15e7bd=_0x205a7b?_0x5d1599[_0x45f5('0x2d')]:_0x5bf2c6[_0x45f5('0x2e')]+_0x5bf2c6[_0x45f5('0x2c')];var _0x44994f;if(_0x15e7bd>=_0x24f8c7){_0x15e7bd=_0x24f8c7;_0x44994f=0xc8;}else{_0x44994f=0xce;}_0x6b4003[_0x45f5('0x28')](_0x44994f);return _0x6b4003[_0x45f5('0x2f')]('Content-Range',_0x1ee085+'-'+_0x15e7bd+'/'+_0x24f8c7)[_0x45f5('0x2a')](_0x5d1599);}return null;};}function patchUpdates(_0x2b9306){return function(_0x118d8b){try{jsonpatch[_0x45f5('0x30')](_0x118d8b,_0x2b9306,!![]);}catch(_0x23d231){return BPromise['reject'](_0x23d231);}return _0x118d8b['save']();};}function saveUpdates(_0x423e28,_0x368d18){return function(_0x581182){if(_0x581182){return _0x581182[_0x45f5('0x31')](_0x423e28)[_0x45f5('0x1e')](function(_0x3e729c){return _0x3e729c;});}return null;};}function removeEntity(_0x1877ea,_0x45693a){return function(_0x40d8ea){if(_0x40d8ea){return _0x40d8ea[_0x45f5('0x32')]()['then'](function(){var _0x413e32=_0x40d8ea['get']({'plain':!![]});var _0x16b407=_0x45f5('0x33');return db[_0x45f5('0x34')][_0x45f5('0x32')]({'where':{'type':_0x16b407,'resourceId':_0x413e32['id']}})['then'](function(){return _0x40d8ea;});})[_0x45f5('0x1e')](function(){_0x1877ea['status'](0xcc)[_0x45f5('0x29')]();});}};}function handleEntityNotFound(_0x3c9de0,_0x44589a){return function(_0x3861ca){if(!_0x3861ca){_0x3c9de0['sendStatus'](0x194);}return _0x3861ca;};}function handleError(_0x1597d0,_0x454324){_0x454324=_0x454324||0x1f4;return function(_0x452e56){logger[_0x45f5('0x22')](_0x452e56[_0x45f5('0x35')]);if(_0x452e56['name']){delete _0x452e56[_0x45f5('0x36')];}_0x1597d0[_0x45f5('0x28')](_0x454324)['send'](_0x452e56);};}exports[_0x45f5('0x37')]=function(_0x5a010b,_0x2eae2f){var _0x13c941={'include':[{'model':db[_0x45f5('0x38')],'as':'mandatoryDispositionPause'}]},_0xba8e6={},_0x150fb6={'count':0x0,'rows':[]};var _0x587df2=_[_0x45f5('0x39')](db[_0x45f5('0x3a')]['rawAttributes'],function(_0x571bdb){return{'name':_0x571bdb['fieldName'],'type':_0x571bdb[_0x45f5('0x3b')]['key']};});_0xba8e6['model']=_[_0x45f5('0x39')](_0x587df2,_0x45f5('0x36'));_0xba8e6[_0x45f5('0x3c')]=_[_0x45f5('0x3d')](_0x5a010b[_0x45f5('0x3c')]);_0xba8e6[_0x45f5('0x3e')]=_[_0x45f5('0x3f')](_0xba8e6[_0x45f5('0x40')],_0xba8e6['query']);_0x13c941[_0x45f5('0x41')]=_[_0x45f5('0x3f')](_0xba8e6[_0x45f5('0x40')],qs[_0x45f5('0x42')](_0x5a010b[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x13c941['attributes']=_0x13c941[_0x45f5('0x41')][_0x45f5('0x43')]?_0x13c941[_0x45f5('0x41')]:_0xba8e6[_0x45f5('0x40')];if(!_0x5a010b[_0x45f5('0x3c')]['hasOwnProperty'](_0x45f5('0x44'))){_0x13c941[_0x45f5('0x2c')]=qs[_0x45f5('0x2c')](_0x5a010b[_0x45f5('0x3c')][_0x45f5('0x2c')]);_0x13c941[_0x45f5('0x2e')]=qs[_0x45f5('0x2e')](_0x5a010b['query'][_0x45f5('0x2e')]);}_0x13c941[_0x45f5('0x45')]=qs[_0x45f5('0x46')](_0x5a010b[_0x45f5('0x3c')][_0x45f5('0x46')]);_0x13c941[_0x45f5('0x47')]=qs[_0x45f5('0x3e')](_[_0x45f5('0x48')](_0x5a010b[_0x45f5('0x3c')],_0xba8e6[_0x45f5('0x3e')]),_0x587df2);if(_0x5a010b[_0x45f5('0x3c')]['filter']){_0x13c941[_0x45f5('0x47')]=_[_0x45f5('0x49')](_0x13c941['where'],{'$or':_['map'](_0x587df2,function(_0x58a626){if(_0x58a626[_0x45f5('0x3b')]!=='VIRTUAL'){var _0x514ce8={};_0x514ce8[_0x58a626[_0x45f5('0x36')]]={'$like':'%'+_0x5a010b['query'][_0x45f5('0x4a')]+'%'};return _0x514ce8;}})});}_0x13c941=_[_0x45f5('0x49')]({},_0x13c941,_0x5a010b['options']);var _0x87e06f={'where':_0x13c941['where']};return db[_0x45f5('0x3a')][_0x45f5('0x2d')](_0x87e06f)['then'](function(_0x465bc6){_0x150fb6['count']=_0x465bc6;if(_0x5a010b[_0x45f5('0x3c')]['includeAll']){_0x13c941[_0x45f5('0x4b')]=[{'all':!![]}];}return db[_0x45f5('0x3a')][_0x45f5('0x4c')](_0x13c941);})['then'](function(_0x2d4e16){_0x150fb6[_0x45f5('0x4d')]=_0x2d4e16;return _0x150fb6;})[_0x45f5('0x1e')](respondWithFilteredResult(_0x2eae2f,_0x13c941))[_0x45f5('0x27')](handleError(_0x2eae2f,null));};exports[_0x45f5('0x4e')]=function(_0x1b6420,_0x2e44b9){var _0x114227={'raw':![],'where':{'id':_0x1b6420[_0x45f5('0x4f')]['id']},'include':[{'model':db[_0x45f5('0x38')],'as':'mandatoryDispositionPause'}]},_0x1bc937={};_0x1bc937['model']=_[_0x45f5('0x3d')](db[_0x45f5('0x3a')][_0x45f5('0x50')]);_0x1bc937['query']=_[_0x45f5('0x3d')](_0x1b6420['query']);_0x1bc937['filters']=_[_0x45f5('0x3f')](_0x1bc937[_0x45f5('0x40')],_0x1bc937[_0x45f5('0x3c')]);_0x114227[_0x45f5('0x41')]=_[_0x45f5('0x3f')](_0x1bc937[_0x45f5('0x40')],qs[_0x45f5('0x42')](_0x1b6420[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x114227['attributes']=_0x114227['attributes'][_0x45f5('0x43')]?_0x114227[_0x45f5('0x41')]:_0x1bc937[_0x45f5('0x40')];if(_0x1b6420[_0x45f5('0x3c')][_0x45f5('0x51')]){_0x114227['include']=[{'all':!![]}];}_0x114227=_[_0x45f5('0x49')]({},_0x114227,_0x1b6420['options']);return db[_0x45f5('0x3a')][_0x45f5('0x52')](_0x114227)[_0x45f5('0x1e')](handleEntityNotFound(_0x2e44b9,null))[_0x45f5('0x1e')](respondWithResult(_0x2e44b9,null))[_0x45f5('0x27')](handleError(_0x2e44b9,null));};exports[_0x45f5('0x53')]=function(_0x51310e,_0x1feb7e){return db[_0x45f5('0x3a')]['create'](_0x51310e[_0x45f5('0x54')],{})[_0x45f5('0x1e')](function(_0x496a33){var _0x122089=_0x51310e[_0x45f5('0x55')][_0x45f5('0x56')]({'plain':!![]});if(!_0x122089)throw new Error(_0x45f5('0x57'));if(_0x122089[_0x45f5('0x58')]===_0x45f5('0x55')){var _0x3073b3=_0x496a33[_0x45f5('0x56')]({'plain':!![]});var _0x3c4d58=_0x45f5('0x33');return db['UserProfileSection'][_0x45f5('0x52')]({'where':{'name':_0x3c4d58,'userProfileId':_0x122089['userProfileId']},'raw':!![]})[_0x45f5('0x1e')](function(_0x135b8c){if(_0x135b8c&&_0x135b8c[_0x45f5('0x59')]===0x0){return db[_0x45f5('0x34')]['create']({'name':_0x3073b3[_0x45f5('0x36')],'resourceId':_0x3073b3['id'],'type':_0x135b8c[_0x45f5('0x36')],'sectionId':_0x135b8c['id']},{})[_0x45f5('0x1e')](function(){return _0x496a33;});}else{return _0x496a33;}})[_0x45f5('0x27')](function(_0x323740){logger['error'](_0x45f5('0x5a'),_0x323740);throw _0x323740;});}return _0x496a33;})['then'](respondWithResult(_0x1feb7e,0xc9))[_0x45f5('0x27')](handleError(_0x1feb7e,null));};exports[_0x45f5('0x31')]=function(_0x54a88c,_0x472ad2){if(_0x54a88c[_0x45f5('0x54')]['id']){delete _0x54a88c[_0x45f5('0x54')]['id'];}return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x54a88c[_0x45f5('0x4f')]['id']},'include':[{'model':db[_0x45f5('0x38')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x472ad2,null))['then'](saveUpdates(_0x54a88c[_0x45f5('0x54')],null))['then'](respondWithResult(_0x472ad2,null))['catch'](handleError(_0x472ad2,null));};exports[_0x45f5('0x32')]=function(_0x35813c,_0x4e2a3d){return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x35813c['params']['id']}})['then'](handleEntityNotFound(_0x4e2a3d,null))[_0x45f5('0x1e')](removeEntity(_0x4e2a3d,null))[_0x45f5('0x27')](handleError(_0x4e2a3d,null));};exports[_0x45f5('0x5b')]=function(_0x139d35,_0xde9197){return db['SmsAccount'][_0x45f5('0x5b')]()[_0x45f5('0x1e')](respondWithResult(_0xde9197,null))[_0x45f5('0x27')](handleError(_0xde9197,null));};exports[_0x45f5('0x5c')]=function(_0x535e8e,_0x6e0990,_0x417e41){if(_0x535e8e[_0x45f5('0x54')]['id']){delete _0x535e8e[_0x45f5('0x54')]['id'];}return db[_0x45f5('0x3a')]['find']({'where':{'id':_0x535e8e['params']['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x6e0990,null))['then'](function(_0x933ef5){if(_0x933ef5){_0x535e8e[_0x45f5('0x54')]['SmsAccountId']=_0x933ef5['id'];return db[_0x45f5('0x5d')]['create'](_0x535e8e[_0x45f5('0x54')]);}})[_0x45f5('0x1e')](respondWithResult(_0x6e0990,null))['catch'](handleError(_0x6e0990,null));};exports[_0x45f5('0x5e')]=function(_0x1d7772,_0x1bbaf2,_0x373625){var _0x21a1c8={'raw':![],'where':{}};var _0x4bd2fc={};var _0xd96d19={'count':0x0,'rows':[]};return db[_0x45f5('0x3a')][_0x45f5('0x5f')]({'where':{'id':_0x1d7772['params']['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x1bbaf2,null))[_0x45f5('0x1e')](function(_0x264948){if(_0x264948){_0x4bd2fc['model']=_[_0x45f5('0x3d')](db['Disposition'][_0x45f5('0x50')]);_0x4bd2fc[_0x45f5('0x3c')]=_[_0x45f5('0x3d')](_0x1d7772[_0x45f5('0x3c')]);_0x4bd2fc[_0x45f5('0x3e')]=_[_0x45f5('0x3f')](_0x4bd2fc[_0x45f5('0x40')],_0x4bd2fc[_0x45f5('0x3c')]);_0x21a1c8['attributes']=_[_0x45f5('0x3f')](_0x4bd2fc[_0x45f5('0x40')],qs['fields'](_0x1d7772[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x21a1c8[_0x45f5('0x41')]=_0x21a1c8[_0x45f5('0x41')][_0x45f5('0x43')]?_0x21a1c8[_0x45f5('0x41')]:_0x4bd2fc['model'];if(!_0x1d7772[_0x45f5('0x3c')][_0x45f5('0x60')](_0x45f5('0x44'))){_0x21a1c8['limit']=qs['limit'](_0x1d7772[_0x45f5('0x3c')]['limit']);_0x21a1c8[_0x45f5('0x2e')]=qs[_0x45f5('0x2e')](_0x1d7772['query'][_0x45f5('0x2e')]);}_0x21a1c8[_0x45f5('0x45')]=qs['sort'](_0x1d7772[_0x45f5('0x3c')][_0x45f5('0x46')]);_0x21a1c8[_0x45f5('0x47')]=qs[_0x45f5('0x3e')](_[_0x45f5('0x48')](_0x1d7772[_0x45f5('0x3c')],_0x4bd2fc['filters']));_0x21a1c8[_0x45f5('0x47')]['SmsAccountId']=_0x264948['id'];if(_0x1d7772[_0x45f5('0x3c')][_0x45f5('0x4a')]){_0x21a1c8['where']=_[_0x45f5('0x49')](_0x21a1c8[_0x45f5('0x47')],{'$or':_[_0x45f5('0x39')](_0x21a1c8[_0x45f5('0x41')],function(_0x3a0ebe){var _0x26bccf={};_0x26bccf[_0x3a0ebe]={'$like':'%'+_0x1d7772[_0x45f5('0x3c')][_0x45f5('0x4a')]+'%'};return _0x26bccf;})});}_0x21a1c8=_[_0x45f5('0x49')]({},_0x21a1c8,_0x1d7772[_0x45f5('0x61')]);return db[_0x45f5('0x5d')][_0x45f5('0x2d')]({'where':_0x21a1c8[_0x45f5('0x47')]})[_0x45f5('0x1e')](function(_0xff9b5c){_0xd96d19['count']=_0xff9b5c;if(_0x1d7772[_0x45f5('0x3c')]['includeAll']){_0x21a1c8[_0x45f5('0x4b')]=[{'all':!![]}];}return db[_0x45f5('0x5d')][_0x45f5('0x4c')](_0x21a1c8);})['then'](function(_0x454de7){_0xd96d19['rows']=_0x454de7;return _0xd96d19;});}})[_0x45f5('0x1e')](respondWithFilteredResult(_0x1bbaf2,_0x21a1c8))[_0x45f5('0x27')](handleError(_0x1bbaf2,null));};exports[_0x45f5('0x62')]=function(_0x4831cb,_0x411265,_0x3c9ff2){return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x4831cb[_0x45f5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x411265,null))[_0x45f5('0x1e')](function(_0x265115){if(_0x265115){return _0x265115['removeDispositions'](_0x4831cb[_0x45f5('0x3c')][_0x45f5('0x63')]);}})[_0x45f5('0x1e')](respondWithStatusCode(_0x411265,null))[_0x45f5('0x27')](handleError(_0x411265,null));};exports[_0x45f5('0x64')]=function(_0x2a4ba7,_0x2bf757,_0x23cd47){if(_0x2a4ba7['body']['id']){delete _0x2a4ba7[_0x45f5('0x54')]['id'];}return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x2a4ba7['params']['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x2bf757,null))['then'](function(_0x1babd3){if(_0x1babd3){_0x2a4ba7[_0x45f5('0x54')][_0x45f5('0x65')]=_0x1babd3['id'];return db[_0x45f5('0x66')][_0x45f5('0x53')](_0x2a4ba7[_0x45f5('0x54')]);}})[_0x45f5('0x1e')](respondWithResult(_0x2bf757,null))[_0x45f5('0x27')](handleError(_0x2bf757,null));};exports['getAnswers']=function(_0x689892,_0x1e868d,_0x124aaf){var _0x2c4146={'raw':![],'where':{}};var _0x2764ad={};var _0xcf7330={'count':0x0,'rows':[]};return db[_0x45f5('0x3a')]['findOne']({'where':{'id':_0x689892[_0x45f5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1e868d,null))[_0x45f5('0x1e')](function(_0x87b5f9){if(_0x87b5f9){_0x2764ad[_0x45f5('0x40')]=_[_0x45f5('0x3d')](db['CannedAnswer']['rawAttributes']);_0x2764ad[_0x45f5('0x3c')]=_[_0x45f5('0x3d')](_0x689892[_0x45f5('0x3c')]);_0x2764ad[_0x45f5('0x3e')]=_['intersection'](_0x2764ad[_0x45f5('0x40')],_0x2764ad[_0x45f5('0x3c')]);_0x2c4146[_0x45f5('0x41')]=_['intersection'](_0x2764ad[_0x45f5('0x40')],qs[_0x45f5('0x42')](_0x689892[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x2c4146['attributes']=_0x2c4146[_0x45f5('0x41')]['length']?_0x2c4146[_0x45f5('0x41')]:_0x2764ad['model'];if(!_0x689892[_0x45f5('0x3c')][_0x45f5('0x60')](_0x45f5('0x44'))){_0x2c4146[_0x45f5('0x2c')]=qs['limit'](_0x689892[_0x45f5('0x3c')][_0x45f5('0x2c')]);_0x2c4146['offset']=qs[_0x45f5('0x2e')](_0x689892['query'][_0x45f5('0x2e')]);}_0x2c4146['order']=qs[_0x45f5('0x46')](_0x689892['query'][_0x45f5('0x46')]);_0x2c4146['where']=qs[_0x45f5('0x3e')](_[_0x45f5('0x48')](_0x689892['query'],_0x2764ad[_0x45f5('0x3e')]));_0x2c4146[_0x45f5('0x47')][_0x45f5('0x65')]=_0x87b5f9['id'];if(_0x689892[_0x45f5('0x3c')][_0x45f5('0x4a')]){_0x2c4146[_0x45f5('0x47')]=_['merge'](_0x2c4146[_0x45f5('0x47')],{'$or':_[_0x45f5('0x39')](_0x2c4146[_0x45f5('0x41')],function(_0x5cb5ff){var _0x53c451={};_0x53c451[_0x5cb5ff]={'$like':'%'+_0x689892[_0x45f5('0x3c')][_0x45f5('0x4a')]+'%'};return _0x53c451;})});}_0x2c4146=_[_0x45f5('0x49')]({},_0x2c4146,_0x689892['options']);return db[_0x45f5('0x66')][_0x45f5('0x2d')]({'where':_0x2c4146[_0x45f5('0x47')]})[_0x45f5('0x1e')](function(_0x5a7f94){_0xcf7330[_0x45f5('0x2d')]=_0x5a7f94;if(_0x689892['query']['includeAll']){_0x2c4146[_0x45f5('0x4b')]=[{'all':!![]}];}return db[_0x45f5('0x66')]['findAll'](_0x2c4146);})[_0x45f5('0x1e')](function(_0x541661){_0xcf7330[_0x45f5('0x4d')]=_0x541661;return _0xcf7330;});}})[_0x45f5('0x1e')](respondWithFilteredResult(_0x1e868d,_0x2c4146))[_0x45f5('0x27')](handleError(_0x1e868d,null));};exports[_0x45f5('0x67')]=function(_0x583a05,_0x2c10c1,_0x572377){return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x583a05['params']['id']}})['then'](handleEntityNotFound(_0x2c10c1,null))[_0x45f5('0x1e')](function(_0x48b1a6){if(_0x48b1a6){return _0x48b1a6['removeAnswers'](_0x583a05[_0x45f5('0x3c')][_0x45f5('0x63')]);}})[_0x45f5('0x1e')](respondWithStatusCode(_0x2c10c1,null))[_0x45f5('0x27')](handleError(_0x2c10c1,null));};exports[_0x45f5('0x68')]=function(_0x49ef20,_0x38a064,_0xc16a13){var _0x15b3f1={'channel':_0x45f5('0x69')};var _0x260793=[];var _0x2596d2=[];var _0x720948={};return db[_0x45f5('0x3a')]['find']({'where':{'id':_0x49ef20[_0x45f5('0x4f')]['id']},'include':[{'model':db[_0x45f5('0x6a')],'as':_0x45f5('0x6b')}]})[_0x45f5('0x1e')](handleEntityNotFound(_0x38a064,null))[_0x45f5('0x1e')](function(_0x582090){_0x15b3f1[_0x45f5('0x6c')]=_0x582090;_0x15b3f1[_0x45f5('0x6d')]=_[_0x45f5('0x6e')](_0x582090[_0x45f5('0x6b')],[_0x45f5('0x6f')],[_0x45f5('0x70')]);if(_0x15b3f1['account']['Applications']){delete _0x15b3f1[_0x45f5('0x6c')]['Applications'];}return db['CmContact'][_0x45f5('0x5b')]();})['then'](function(_0x11a360){if(!_0x11a360){throw new db[(_0x45f5('0x71'))][(_0x45f5('0x72'))](_0x45f5('0x73'));}_0x260793=_[_0x45f5('0x74')](_[_0x45f5('0x3d')](_0x11a360),[_0x45f5('0x75'),_0x45f5('0x76')]);_0x2596d2=_[_0x45f5('0x74')](_[_0x45f5('0x3d')](_0x11a360),[_0x45f5('0x75'),_0x45f5('0x76'),'CompanyId',_0x45f5('0x77')]);_0x15b3f1[_0x45f5('0x54')]={'mapKey':_0x45f5('0x78')};if(_0x15b3f1['account'][_0x45f5('0x3b')]){switch(_0x15b3f1[_0x45f5('0x6c')]['type']){case'twilio':_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]=_0x49ef20['body'][_0x45f5('0x7a')];_0x15b3f1[_0x45f5('0x54')]['body']=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x7b')];_0x15b3f1['body'][_0x45f5('0x7c')]=_0x49ef20['body']['MessageSid'];break;case'skebby':_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]='+'+_0x49ef20[_0x45f5('0x54')][_0x45f5('0x7d')];_0x15b3f1[_0x45f5('0x54')]['body']=_0x49ef20['body'][_0x45f5('0x7e')];break;case _0x45f5('0x7f'):_0x15b3f1['body'][_0x45f5('0x79')]=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x79')];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')]=_0x49ef20['body'][_0x45f5('0x24')];break;case _0x45f5('0x80'):_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]=_0x49ef20[_0x45f5('0x54')]['from'];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')]=_0x49ef20[_0x45f5('0x54')]['body'];_0x15b3f1[_0x45f5('0x54')]['messageId']=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x81')];break;case _0x45f5('0x82'):_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x7a')];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')]=_0x49ef20['body'][_0x45f5('0x83')];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x7c')]=_0x49ef20[_0x45f5('0x54')]['MessageUUID'];break;case _0x45f5('0x84'):_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]='+'+_0x49ef20[_0x45f5('0x54')][_0x45f5('0x85')][0x0]['from'];_0x15b3f1['body'][_0x45f5('0x54')]=_0x49ef20['body'][_0x45f5('0x85')][0x0][_0x45f5('0x7e')];_0x15b3f1[_0x45f5('0x54')]['messageId']=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x85')][0x0][_0x45f5('0x7c')];break;case _0x45f5('0x86'):_0x15b3f1[_0x45f5('0x54')]['from']=_0x49ef20[_0x45f5('0x54')]['originatingAddress'];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')]=_0x49ef20['body']['segmentedMessage'][_0x45f5('0x24')];break;case _0x45f5('0x87'):_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]=_0x49ef20[_0x45f5('0x54')]['fromNumber'];_0x15b3f1[_0x45f5('0x54')]['body']=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x7e')];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x7c')]=_0x49ef20['body'][_0x45f5('0x88')];break;case _0x45f5('0x89'):_0x15b3f1['body'][_0x45f5('0x7c')]=_0x49ef20[_0x45f5('0x54')][0x0][_0x45f5('0x24')]['id'];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]=_0x49ef20[_0x45f5('0x54')][0x0][_0x45f5('0x24')]['from'];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')]=_0x49ef20['body'][0x0][_0x45f5('0x24')]['text'];break;case _0x45f5('0x8a'):_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')]=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x79')];_0x15b3f1['body'][_0x45f5('0x54')]=_0x49ef20[_0x45f5('0x54')]['message'];_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x7c')]=_0x49ef20[_0x45f5('0x54')][_0x45f5('0x8b')];break;}}if(_0x15b3f1[_0x45f5('0x54')]['id']){delete _0x15b3f1['body']['id'];}if(_[_0x45f5('0x8c')](_0x15b3f1['body']['from'])){throw new db[(_0x45f5('0x71'))][(_0x45f5('0x72'))](_0x45f5('0x8d'));}if(_[_0x45f5('0x8c')](_0x15b3f1['body'][_0x45f5('0x54')])||_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')]===''){throw new db['Sequelize'][(_0x45f5('0x72'))](_0x45f5('0x8e'));}if(_[_0x45f5('0x8c')](_0x15b3f1['body'][_0x45f5('0x8f')])){throw new db[(_0x45f5('0x71'))][(_0x45f5('0x72'))](_0x45f5('0x90')+_0x2596d2);}if(!_[_0x45f5('0x91')](_0x2596d2,_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x8f')])){throw new db[(_0x45f5('0x71'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2596d2);}_0x720948[_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x8f')]]=_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')];return db['CmList']['find']({'where':{'id':_0x15b3f1[_0x45f5('0x6c')]['ListId']},'include':[{'model':db[_0x45f5('0x92')],'as':_0x45f5('0x93'),'where':_0x720948,'limit':0x1,'order':[[_0x45f5('0x76'),_0x45f5('0x94')]]}]});})[_0x45f5('0x1e')](handleEntityNotFound(_0x38a064,null))[_0x45f5('0x1e')](function(_0x5730b4){if(_0x5730b4){_0x15b3f1[_0x45f5('0x95')]=_['omit'](_0x5730b4,[_0x45f5('0x93')]);if(_0x5730b4[_0x45f5('0x93')]['length']){return _0x5730b4['Contacts'][0x0];}var _0x10f81e=_[_0x45f5('0x18')](_0x15b3f1[_0x45f5('0x54')],{'firstName':_0x15b3f1['body'][_0x45f5('0x79')],'ListId':_0x5730b4['id']});_0x10f81e[_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x8f')]]=_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')];return db[_0x45f5('0x92')][_0x45f5('0x53')](_0x10f81e,{'fields':_0x260793,'raw':!![]});}})[_0x45f5('0x1e')](handleEntityNotFound(_0x38a064,null))['then'](function(_0x2c558d){if(_0x2c558d){_0x15b3f1[_0x45f5('0x96')]=_0x2c558d;var _0x505391={'ContactId':_0x2c558d['id'],'phone':_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x79')],'SmsAccountId':_0x49ef20[_0x45f5('0x4f')]['id']};var _0x192951={'ContactId':_0x2c558d['id'],'SmsAccountId':_0x49ef20[_0x45f5('0x4f')]['id'],'closed':![]};return db[_0x45f5('0x97')][_0x45f5('0x52')]({'where':_0x192951})[_0x45f5('0x1e')](function(_0x5e87b8){if(_0x5e87b8){return[_0x5e87b8,![]];}return db['SmsInteraction']['create'](_0x505391)[_0x45f5('0x1e')](function(_0x4ab758){return[_0x4ab758,!![]];});});}})[_0x45f5('0x98')](function(_0x35ce55,_0x31b725){_0x15b3f1[_0x45f5('0x99')]=_0x35ce55[_0x45f5('0x56')]({'plain':!![]});_0x15b3f1['interaction'][_0x45f5('0x9a')]=![];if(_0x31b725){if(_0x15b3f1[_0x45f5('0x6c')][_0x45f5('0x9b')]){_0x15b3f1[_0x45f5('0x6d')]['push']({'id':0x0,'priority':_0x15b3f1[_0x45f5('0x6d')]['length']+0x1,'app':'close','appdata':_0x45f5('0x9c'),'interval':_0x45f5('0x9d')});}_0x15b3f1[_0x45f5('0x99')][_0x45f5('0x9a')]=!![];}return db['SmsMessage']['create']({'phone':_0x15b3f1['body'][_0x45f5('0x79')],'messageId':_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x7c')],'body':_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x54')],'SmsAccountId':_0x49ef20[_0x45f5('0x4f')]['id'],'SmsInteractionId':_0x35ce55['id'],'direction':'in','ContactId':_0x35ce55['ContactId'],'AttachmentId':_0x15b3f1[_0x45f5('0x54')][_0x45f5('0x9e')]});})['then'](function(_0x56cd1c){_0x15b3f1[_0x45f5('0x24')]=_0x56cd1c;if(_0x15b3f1[_0x45f5('0x99')][_0x45f5('0x9f')]){return db[_0x45f5('0xa0')][_0x45f5('0x52')]({'attributes':['id',_0x45f5('0x36')],'where':{'id':_0x15b3f1[_0x45f5('0x99')][_0x45f5('0x9f')]}})[_0x45f5('0x1e')](function(_0xcbbe56){if(_0xcbbe56){_0x15b3f1[_0x45f5('0x6d')][_0x45f5('0xa1')]({'id':0x0,'priority':0x0,'app':_0x45f5('0xa2'),'appdata':_0xcbbe56[_0x45f5('0x36')]+','+(_0x15b3f1['account'][_0x45f5('0xa3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x45f5('0xa4'),_0x45f5('0xa5'),_0x15b3f1);});}return respondWithRpcPromise(_0x45f5('0xa4'),_0x45f5('0xa5'),_0x15b3f1);})['then'](function(_0x68982c){if(_0x68982c){var _0xbb969b=0xc8;var _0x3c46db='receiveMessage';logger[_0x45f5('0x1f')](_0x45f5('0x21'),_0x3c46db,_0xbb969b,_0x45f5('0xa6'));logger['debug'](_0x45f5('0xa7'),_0x3c46db,_0xbb969b,_0x45f5('0xa6'),JSON[_0x45f5('0xa8')](_0x68982c));if(_0x15b3f1[_0x45f5('0x6c')][_0x45f5('0x3b')]==='twilio'){return _0x38a064[_0x45f5('0x28')](_0xbb969b)[_0x45f5('0x2f')](_0x45f5('0xa9'),'text/xml')['send']('\x0a');}else{return _0x38a064[_0x45f5('0x28')](_0xbb969b)[_0x45f5('0x2a')](_0x68982c);}}})[_0x45f5('0x27')](handleError(_0x38a064,null));};exports[_0x45f5('0xaa')]=function(_0x5bebaf,_0x206e48,_0x36060e){return db[_0x45f5('0x3a')]['findOne']({'where':{'id':_0x5bebaf[_0x45f5('0x4f')]['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x206e48,null))['then'](function(_0x128a69){if(_0x128a69){return db[_0x45f5('0xab')][_0x45f5('0xac')](function(_0x1e64ca){return db['SmsApplication'][_0x45f5('0x32')]({'where':{'SmsAccountId':_0x5bebaf[_0x45f5('0x4f')]['id']},'transaction':_0x1e64ca})[_0x45f5('0x1e')](function(_0x25ca3a){var _0x35d234=_[_0x45f5('0x39')](_0x5bebaf[_0x45f5('0x54')],function(_0x5cbc7c){_0x5cbc7c['SmsAccountId']=_0x5bebaf['params']['id'];return _0x5cbc7c;});return db['SmsApplication'][_0x45f5('0xad')](_0x35d234,{'transaction':_0x1e64ca});});})[_0x45f5('0x1e')](function(){return db[_0x45f5('0x6a')][_0x45f5('0xae')]({'where':{'SmsAccountId':_0x5bebaf[_0x45f5('0x4f')]['id']},'order':_0x45f5('0x6f')});});}})[_0x45f5('0x1e')](respondWithResult(_0x206e48,null))['catch'](handleError(_0x206e48,null));};exports[_0x45f5('0xaf')]=function(_0xe5fa3b,_0x2b689d,_0x48569f){var _0x50d3d9={};var _0x59422b={};var _0x200486;var _0x3fe2a3;return db[_0x45f5('0x3a')][_0x45f5('0x5f')]({'where':{'id':_0xe5fa3b[_0x45f5('0x4f')]['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x2b689d,null))[_0x45f5('0x1e')](function(_0x1fb0e8){if(_0x1fb0e8){_0x200486=_0x1fb0e8;_0x59422b[_0x45f5('0x40')]=_['keys'](db['SmsApplication'][_0x45f5('0x50')]);_0x59422b[_0x45f5('0x3c')]=_[_0x45f5('0x3d')](_0xe5fa3b['query']);_0x59422b['filters']=_['intersection'](_0x59422b[_0x45f5('0x40')],_0x59422b[_0x45f5('0x3c')]);_0x50d3d9[_0x45f5('0x41')]=_[_0x45f5('0x3f')](_0x59422b[_0x45f5('0x40')],qs[_0x45f5('0x42')](_0xe5fa3b[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x50d3d9[_0x45f5('0x41')]=_0x50d3d9[_0x45f5('0x41')][_0x45f5('0x43')]?_0x50d3d9['attributes']:_0x59422b['model'];_0x50d3d9[_0x45f5('0x45')]=qs['sort'](_0xe5fa3b[_0x45f5('0x3c')]['sort']);_0x50d3d9[_0x45f5('0x47')]=qs['filters'](_['pick'](_0xe5fa3b[_0x45f5('0x3c')],_0x59422b[_0x45f5('0x3e')]));if(_0xe5fa3b[_0x45f5('0x3c')][_0x45f5('0x4a')]){_0x50d3d9[_0x45f5('0x47')]=_[_0x45f5('0x49')](_0x50d3d9[_0x45f5('0x47')],{'$or':_[_0x45f5('0x39')](_0x50d3d9[_0x45f5('0x41')],function(_0x41977d){var _0x48aebf={};_0x48aebf[_0x41977d]={'$like':'%'+_0xe5fa3b['query'][_0x45f5('0x4a')]+'%'};return _0x48aebf;})});}_0x50d3d9=_[_0x45f5('0x49')]({},_0x50d3d9,_0xe5fa3b['options']);return _0x200486[_0x45f5('0xaf')](_0x50d3d9);}})[_0x45f5('0x1e')](function(_0x436bb1){if(_0x436bb1){_0x3fe2a3=_0x436bb1[_0x45f5('0x43')];if(!_0xe5fa3b[_0x45f5('0x3c')][_0x45f5('0x60')]('nolimit')){_0x50d3d9['limit']=qs[_0x45f5('0x2c')](_0xe5fa3b['query']['limit']);_0x50d3d9[_0x45f5('0x2e')]=qs[_0x45f5('0x2e')](_0xe5fa3b[_0x45f5('0x3c')][_0x45f5('0x2e')]);}return _0x200486[_0x45f5('0xaf')](_0x50d3d9);}})[_0x45f5('0x1e')](function(_0x1a48f9){if(_0x1a48f9){return _0x1a48f9?{'count':_0x3fe2a3,'rows':_0x1a48f9}:null;}})['then'](respondWithResult(_0x2b689d,null))['catch'](handleError(_0x2b689d,null));};exports[_0x45f5('0xb0')]=function(_0x1f111e,_0x5543c1,_0x39dbfe){var _0x1f0295={'raw':![],'where':{}};var _0x98367e={};var _0x4f4c56={'count':0x0,'rows':[]};return db[_0x45f5('0x3a')][_0x45f5('0x5f')]({'where':{'id':_0x1f111e['params']['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x5543c1,null))[_0x45f5('0x1e')](function(_0x8be3ef){if(_0x8be3ef){_0x98367e['model']=_[_0x45f5('0x3d')](db['SmsInteraction'][_0x45f5('0x50')]);_0x98367e[_0x45f5('0x3c')]=_[_0x45f5('0x3d')](_0x1f111e[_0x45f5('0x3c')]);_0x98367e[_0x45f5('0x3e')]=_[_0x45f5('0x3f')](_0x98367e[_0x45f5('0x40')],_0x98367e[_0x45f5('0x3c')]);_0x1f0295[_0x45f5('0x41')]=_[_0x45f5('0x3f')](_0x98367e[_0x45f5('0x40')],qs[_0x45f5('0x42')](_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x1f0295['attributes']=_0x1f0295[_0x45f5('0x41')][_0x45f5('0x43')]?_0x1f0295[_0x45f5('0x41')]:_0x98367e[_0x45f5('0x40')];if(!_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x60')](_0x45f5('0x44'))){_0x1f0295['limit']=qs['limit'](_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x2c')]);_0x1f0295[_0x45f5('0x2e')]=qs[_0x45f5('0x2e')](_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x2e')]);}_0x1f0295[_0x45f5('0x45')]=qs[_0x45f5('0x46')](_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x46')]);_0x1f0295['where']=qs[_0x45f5('0x3e')](_['pick'](_0x1f111e[_0x45f5('0x3c')],_0x98367e[_0x45f5('0x3e')]));_0x1f0295['where'][_0x45f5('0x65')]=_0x8be3ef['id'];if(_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x4a')]){_0x1f0295[_0x45f5('0x47')]=_['merge'](_0x1f0295[_0x45f5('0x47')],{'$or':_['map'](_0x1f0295[_0x45f5('0x41')],function(_0x1d4d70){var _0x1e1793={};_0x1e1793[_0x1d4d70]={'$like':'%'+_0x1f111e[_0x45f5('0x3c')]['filter']+'%'};return _0x1e1793;})});}_0x1f0295=_[_0x45f5('0x49')]({},_0x1f0295,_0x1f111e[_0x45f5('0x61')]);return db[_0x45f5('0x97')][_0x45f5('0x2d')]({'where':_0x1f0295[_0x45f5('0x47')]})[_0x45f5('0x1e')](function(_0x2e6997){_0x4f4c56[_0x45f5('0x2d')]=_0x2e6997;if(_0x1f111e[_0x45f5('0x3c')][_0x45f5('0x51')]){_0x1f0295[_0x45f5('0x4b')]=[{'model':db[_0x45f5('0x92')],'as':_0x45f5('0xb1'),'required':![]},{'model':db[_0x45f5('0xa0')],'as':'Owner','attributes':[_0x45f5('0x36'),_0x45f5('0xb2'),_0x45f5('0xb3')],'required':![]},{'model':db[_0x45f5('0xb4')],'as':_0x45f5('0xb5'),'attributes':['id',_0x45f5('0x36'),_0x45f5('0xb6')],'where':_0x1f111e['query'][_0x45f5('0xb7')]?{'id':_0x1f111e[_0x45f5('0x3c')][_0x45f5('0xb7')]}:undefined,'required':_0x1f111e['query'][_0x45f5('0xb7')]?!![]:![]}];}return db[_0x45f5('0x97')][_0x45f5('0x4c')](_0x1f0295);})[_0x45f5('0x1e')](function(_0x5b38c6){_0x4f4c56['rows']=_0x5b38c6;return _0x4f4c56;});}})['then'](respondWithFilteredResult(_0x5543c1,_0x1f0295))[_0x45f5('0x27')](handleError(_0x5543c1,null));};exports[_0x45f5('0xb8')]=function(_0x13f740,_0x2a8399,_0x33a0b6){var _0x5832ff,_0x4c307b,_0x171548;if(_[_0x45f5('0x8c')](_0x13f740[_0x45f5('0x54')][_0x45f5('0x54')])||_0x13f740[_0x45f5('0x54')][_0x45f5('0x54')]===''){throw new db['Sequelize'][(_0x45f5('0x72'))](_0x45f5('0x8e'));}if(_['isNil'](_0x13f740[_0x45f5('0x54')]['to'])){throw new db[(_0x45f5('0x71'))][(_0x45f5('0x72'))]('to\x20is\x20mandatory');}_0x5832ff=_0x13f740[_0x45f5('0x54')]['to'];return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x13f740['params']['id']},'include':[{'model':db[_0x45f5('0xb9')],'as':'List','include':[{'model':db[_0x45f5('0x92')],'as':_0x45f5('0x93'),'where':{'mobile':_0x5832ff},'limit':0x1,'order':[[_0x45f5('0x76'),_0x45f5('0x94')]]}]}]})[_0x45f5('0x1e')](handleEntityNotFound(_0x2a8399,null))['then'](function(_0x3d5a45){if(_0x3d5a45&&_0x3d5a45['List']){_0x4c307b=_0x3d5a45[_0x45f5('0x56')]({'plain':!![]});if(_0x4c307b['List']&&_0x4c307b[_0x45f5('0xba')][_0x45f5('0x93')][_0x45f5('0x43')]){return _0x4c307b[_0x45f5('0xba')]['Contacts'][0x0];}return db[_0x45f5('0x92')][_0x45f5('0x53')](_['defaults'](_0x13f740['body'],{'firstName':_0x5832ff,'mobile':_0x5832ff,'phone':_0x5832ff,'ListId':_0x4c307b[_0x45f5('0x77')]}));}})[_0x45f5('0x1e')](handleEntityNotFound(_0x2a8399,null))['then'](function(_0x302966){if(_0x302966){_0x171548=_0x302966;return db[_0x45f5('0x97')]['find']({'where':{'ContactId':_0x171548['id'],'closed':![],'SmsAccountId':_0x4c307b['id']}})['then'](function(_0x24228e){if(_0x24228e){return[_0x24228e,![]];}return db[_0x45f5('0x97')][_0x45f5('0x53')]({'UserId':_0x13f740[_0x45f5('0x55')]['id'],'ContactId':_0x171548['id'],'SmsAccountId':_0x4c307b['id'],'phone':_0x5832ff,'firstMsgDirection':_0x45f5('0xbb'),'Messages':[_[_0x45f5('0x49')](_0x13f740['body'],{'read':![],'body':_0x13f740[_0x45f5('0x54')][_0x45f5('0x54')],'phone':_0x5832ff,'SmsAccountId':_0x4c307b['id'],'UserId':_0x13f740['user']['id'],'ContactId':_0x171548['id']})]},{'include':[{'model':db[_0x45f5('0xbc')],'as':_0x45f5('0xbd')}]})[_0x45f5('0x1e')](function(_0x13d154){return[_0x13d154,!![]];});});}})['spread'](function(_0x41d2b6,_0x1b2bb8){if(_0x1b2bb8){return _0x41d2b6;}return db[_0x45f5('0xbc')]['create'](_[_0x45f5('0x49')](_0x13f740[_0x45f5('0x54')],{'read':![],'body':_0x13f740[_0x45f5('0x54')][_0x45f5('0x54')],'phone':_0x5832ff,'SmsAccountId':_0x4c307b['id'],'SmsInteractionId':_0x41d2b6['id'],'UserId':_0x13f740[_0x45f5('0x55')]['id'],'ContactId':_0x171548['id']}))[_0x45f5('0x1e')](function(_0x541583){_0x41d2b6[_0x45f5('0xbe')]['Messages']=[];_0x41d2b6['dataValues'][_0x45f5('0xbd')]['push'](_0x541583[_0x45f5('0xbe')]);return _0x41d2b6;});})['then'](respondWithResult(_0x2a8399,null))[_0x45f5('0x27')](handleError(_0x2a8399,null));};exports[_0x45f5('0x28')]=function(_0x2e1b62,_0x3456eb,_0x4b8f1b){if(_0x2e1b62[_0x45f5('0x54')]['id']){delete _0x2e1b62[_0x45f5('0x54')]['id'];}var _0xed0f72,_0x2a92a5,_0x3a40f7;return db['SmsAccount']['find']({'where':{'id':_0x2e1b62[_0x45f5('0x4f')]['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x3456eb,null))[_0x45f5('0x1e')](function(_0x308f29){if(_0x308f29){_0x3a40f7=_0x308f29;logger[_0x45f5('0xbf')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x45f5('0x28'),'received\x20delivery\x20report\x20from',_0x308f29[_0x45f5('0x3b')],util[_0x45f5('0xc0')](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));switch(_0x308f29['type']){case _0x45f5('0xc1'):if(_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc2')]&&_0x2e1b62[_0x45f5('0x54')][_0x45f5('0x28')]){_0x2a92a5=_0x2e1b62['body'][_0x45f5('0x28')];return db[_0x45f5('0xbc')][_0x45f5('0x52')]({'where':{'messageId':_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc2')]}});}break;case _0x45f5('0x7f'):if(_0x2e1b62['body'][_0x45f5('0xc3')]&&_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc4')]){_0x2a92a5=_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc4')];return db[_0x45f5('0xbc')][_0x45f5('0x52')]({'where':{'messageId':_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc3')]}});}break;case'clicksend':if(_0x2e1b62[_0x45f5('0x54')]['message_id']&&_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc5')]){_0x2a92a5=_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc5')];return db['SmsMessage']['find']({'where':{'messageId':_0x2e1b62[_0x45f5('0x54')]['message_id']}});}break;case _0x45f5('0x84'):var _0x38c06e=_0x2e1b62['body'][_0x45f5('0x85')][0x0];if(_0x38c06e[_0x45f5('0x7c')]&&_0x38c06e[_0x45f5('0x28')][_0x45f5('0xc6')]===_0x45f5('0xc7')){_0x2a92a5=_0x38c06e[_0x45f5('0x28')][_0x45f5('0xc6')];return db[_0x45f5('0xbc')]['find']({'where':{'messageId':_0x38c06e['messageId']}});}break;case _0x45f5('0x87'):if(_0x2e1b62[_0x45f5('0x54')][_0x45f5('0x7c')]&&_0x2e1b62[_0x45f5('0x54')][_0x45f5('0x28')]){_0x2a92a5=_0x2e1b62[_0x45f5('0x54')]['status'];return db[_0x45f5('0xbc')]['find']({'where':{'messageId':_0x2e1b62[_0x45f5('0x54')][_0x45f5('0x7c')]}});}break;case'bandwidth':if(_0x2e1b62['body'][0x0][_0x45f5('0x24')]['id']){_0x2a92a5=_0x2e1b62[_0x45f5('0x54')][0x0][_0x45f5('0x3b')];return db[_0x45f5('0xbc')][_0x45f5('0x52')]({'where':{'messageId':_0x2e1b62['body'][0x0][_0x45f5('0x24')]['id']}});}break;case _0x45f5('0x8a'):if(_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc8')]&&_0x2e1b62['body']['status']){_0x2a92a5=_0x2e1b62[_0x45f5('0x54')]['status'];return db[_0x45f5('0xbc')][_0x45f5('0x52')]({'where':{'messageId':_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc8')]}});}break;}}})['then'](handleEntityNotFound(_0x3456eb,null))[_0x45f5('0x1e')](function(_0x24b89a){if(_0x24b89a){_0xed0f72=_0x24b89a;switch(_0x3a40f7[_0x45f5('0x3b')]){case _0x45f5('0xc1'):if(_0x2a92a5===_0x45f5('0xc7')){return _0xed0f72['update']({'read':!![]});}else{logger[_0x45f5('0x22')](_0x45f5('0x21'),_0x45f5('0x28'),_0x45f5('0xc1'),util[_0x45f5('0xc0')](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x2a92a5==='1'){return _0xed0f72[_0x45f5('0x31')]({'read':!![]});}else{logger[_0x45f5('0x22')](_0x45f5('0x21'),_0x45f5('0x28'),_0x45f5('0xc1'),util['inspect'](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2e1b62[_0x45f5('0x54')][_0x45f5('0xc9')]&&_0x2a92a5>=0xc8&&_0x2a92a5<=0xce){return _0xed0f72[_0x45f5('0x31')]({'read':!![]});}else{logger[_0x45f5('0x22')](_0x45f5('0x21'),_0x45f5('0x28'),_0x45f5('0x80'),util[_0x45f5('0xc0')](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;case _0x45f5('0x84'):var _0x4a0447=_0x2e1b62['body'][_0x45f5('0x85')][0x0];if(_0x4a0447['status'][_0x45f5('0xc6')]==='DELIVERED'){return _0xed0f72['update']({'read':!![]});}else{logger['error'](_0x45f5('0x21'),_0x45f5('0x28'),_0x45f5('0x84'),util[_0x45f5('0xc0')](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;case _0x45f5('0x87'):if(_0x2a92a5==_0x45f5('0xca')||_0x2a92a5==_0x45f5('0xcb')){return _0xed0f72['update']({'read':!![]});}else{logger[_0x45f5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x45f5('0x28'),_0x45f5('0x87'),util[_0x45f5('0xc0')](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;case _0x45f5('0x89'):if(_0x2a92a5==_0x45f5('0xcc')){return _0xed0f72['update']({'read':!![]});}else{logger[_0x45f5('0x22')](_0x45f5('0x21'),_0x45f5('0x28'),_0x45f5('0x89'),util['inspect'](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;case _0x45f5('0x8a'):if(_0x2a92a5===_0x45f5('0xcd')||_0x2a92a5==='ACCEPTD'){return _0xed0f72['update']({'read':!![]});}else{logger[_0x45f5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x45f5('0x28'),'intelepeer',util[_0x45f5('0xc0')](_0x2e1b62[_0x45f5('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xed0f72;}})[_0x45f5('0x1e')](respondWithResult(_0x3456eb,null))[_0x45f5('0x27')](handleError(_0x3456eb,null));};exports[_0x45f5('0xce')]=function(_0xfe34fb,_0x47ca3f,_0x2a4d1b){var _0x491381,_0x1223fa,_0x22cda8;return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0xfe34fb[_0x45f5('0x4f')]['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x47ca3f,null))[_0x45f5('0x1e')](function(_0x4af48a){if(_0x4af48a){_0x22cda8=_0x4af48a;logger[_0x45f5('0xbf')](_0x45f5('0x21'),_0x45f5('0x28'),_0x45f5('0xcf'),_0x4af48a[_0x45f5('0x3b')],util[_0x45f5('0xc0')](_0xfe34fb[_0x45f5('0x3c')],{'showHidden':![],'depth':null}));switch(_0x4af48a[_0x45f5('0x3b')]){case _0x45f5('0x86'):if(_0xfe34fb[_0x45f5('0x3c')][_0x45f5('0xd0')]&&_0xfe34fb[_0x45f5('0x3c')][_0x45f5('0xd1')]){_0x1223fa=_0xfe34fb['query'][_0x45f5('0xd1')];return db[_0x45f5('0xbc')][_0x45f5('0x52')]({'where':{'messageId':_0xfe34fb[_0x45f5('0x3c')][_0x45f5('0xd0')]}});}break;}}})[_0x45f5('0x1e')](handleEntityNotFound(_0x47ca3f,null))[_0x45f5('0x1e')](function(_0x2d587f){if(_0x2d587f){_0x491381=_0x2d587f;switch(_0x22cda8[_0x45f5('0x3b')]){case _0x45f5('0x86'):if(_0x1223fa==='2'||_0x1223fa==='6'){return _0x491381[_0x45f5('0x31')]({'read':!![]});}else{logger[_0x45f5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x45f5('0x28'),_0x45f5('0x86'),util[_0x45f5('0xc0')](_0xfe34fb[_0x45f5('0x3c')],{'showHidden':![],'depth':null}));};break;}return _0x491381;}})[_0x45f5('0x1e')](respondWithResult(_0x47ca3f,null))[_0x45f5('0x27')](handleError(_0x47ca3f,null));};exports[_0x45f5('0xd2')]=function(_0x5a9e43,_0x30d443,_0x568df5){return db[_0x45f5('0x3a')][_0x45f5('0x52')]({'where':{'id':_0x5a9e43[_0x45f5('0x4f')]['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x30d443,null))[_0x45f5('0x1e')](function(_0x3159a8){if(_0x3159a8){return _0x3159a8[_0x45f5('0xd2')](_0x5a9e43['body'][_0x45f5('0x63')],_[_0x45f5('0xd3')](_0x5a9e43['body'],['ids','id'])||{})[_0x45f5('0x98')](function(_0x1ee100){for(var _0xb8688a=0x0;_0xb8688a<_0x5a9e43[_0x45f5('0x54')][_0x45f5('0x63')][_0x45f5('0x43')];_0xb8688a+=0x1){socket[_0x45f5('0xd4')](_0x45f5('0xd5'),{'UserId':Number(_0x5a9e43[_0x45f5('0x54')][_0x45f5('0x63')][_0xb8688a]),'SmsAccountId':Number(_0x5a9e43[_0x45f5('0x4f')]['id'])});}return _0x1ee100;});}})[_0x45f5('0x1e')](respondWithResult(_0x30d443,null))[_0x45f5('0x27')](handleError(_0x30d443,null));};exports[_0x45f5('0xd6')]=function(_0x2cf112,_0x19dd62,_0xca0177){return db['SmsAccount'][_0x45f5('0x52')]({'where':{'id':_0x2cf112[_0x45f5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19dd62,null))[_0x45f5('0x1e')](function(_0x252de4){if(_0x252de4){return _0x252de4[_0x45f5('0xd6')](_0x2cf112[_0x45f5('0x3c')][_0x45f5('0x63')])[_0x45f5('0x1e')](function(){if(_[_0x45f5('0xd7')](_0x2cf112[_0x45f5('0x3c')][_0x45f5('0x63')])){for(var _0x211291=0x0;_0x211291<_0x2cf112[_0x45f5('0x3c')][_0x45f5('0x63')][_0x45f5('0x43')];_0x211291+=0x1){socket[_0x45f5('0xd4')](_0x45f5('0xd8'),{'UserId':Number(_0x2cf112[_0x45f5('0x3c')][_0x45f5('0x63')][_0x211291]),'SmsAccountId':Number(_0x2cf112[_0x45f5('0x4f')]['id'])});}}else{socket[_0x45f5('0xd4')](_0x45f5('0xd8'),{'UserId':Number(_0x2cf112['query']['ids']),'SmsAccountId':Number(_0x2cf112[_0x45f5('0x4f')]['id'])});}});}})[_0x45f5('0x1e')](respondWithStatusCode(_0x19dd62,null))[_0x45f5('0x27')](handleError(_0x19dd62,null));};exports[_0x45f5('0xd9')]=function(_0xfcb092,_0x1db99d,_0x3a5268){var _0x763d93={};var _0x2ef1dc={};var _0x46aa48;var _0x3527b9;return db[_0x45f5('0x3a')][_0x45f5('0x5f')]({'where':{'id':_0xfcb092['params']['id']}})[_0x45f5('0x1e')](handleEntityNotFound(_0x1db99d,null))['then'](function(_0x3cfb3f){if(_0x3cfb3f){_0x46aa48=_0x3cfb3f;_0x2ef1dc['model']=_[_0x45f5('0x3d')](db[_0x45f5('0xa0')]['rawAttributes']);_0x2ef1dc[_0x45f5('0x3c')]=_['keys'](_0xfcb092[_0x45f5('0x3c')]);_0x2ef1dc[_0x45f5('0x3e')]=_[_0x45f5('0x3f')](_0x2ef1dc['model'],_0x2ef1dc[_0x45f5('0x3c')]);_0x763d93['attributes']=_[_0x45f5('0x3f')](_0x2ef1dc['model'],qs['fields'](_0xfcb092[_0x45f5('0x3c')][_0x45f5('0x42')]));_0x763d93[_0x45f5('0x41')]=_0x763d93[_0x45f5('0x41')][_0x45f5('0x43')]?_0x763d93[_0x45f5('0x41')]:_0x2ef1dc[_0x45f5('0x40')];_0x763d93[_0x45f5('0x45')]=qs[_0x45f5('0x46')](_0xfcb092['query'][_0x45f5('0x46')]);_0x763d93[_0x45f5('0x47')]=qs[_0x45f5('0x3e')](_[_0x45f5('0x48')](_0xfcb092[_0x45f5('0x3c')],_0x2ef1dc[_0x45f5('0x3e')]));if(_0xfcb092[_0x45f5('0x3c')][_0x45f5('0x4a')]){_0x763d93[_0x45f5('0x47')]=_[_0x45f5('0x49')](_0x763d93[_0x45f5('0x47')],{'$or':_['map'](_0x763d93[_0x45f5('0x41')],function(_0x216c5f){var _0x4e8868={};_0x4e8868[_0x216c5f]={'$like':'%'+_0xfcb092[_0x45f5('0x3c')][_0x45f5('0x4a')]+'%'};return _0x4e8868;})});}_0x763d93=_['merge']({},_0x763d93,_0xfcb092[_0x45f5('0x61')]);return _0x46aa48[_0x45f5('0xd9')](_0x763d93);}})[_0x45f5('0x1e')](function(_0x170f7c){if(_0x170f7c){_0x3527b9=_0x170f7c[_0x45f5('0x43')];if(!_0xfcb092['query'][_0x45f5('0x60')](_0x45f5('0x44'))){_0x763d93['limit']=qs['limit'](_0xfcb092[_0x45f5('0x3c')]['limit']);_0x763d93[_0x45f5('0x2e')]=qs[_0x45f5('0x2e')](_0xfcb092[_0x45f5('0x3c')]['offset']);}return _0x46aa48['getAgents'](_0x763d93);}})[_0x45f5('0x1e')](function(_0x3d461a){if(_0x3d461a){return _0x3d461a?{'count':_0x3527b9,'rows':_0x3d461a}:null;}})[_0x45f5('0x1e')](respondWithResult(_0x1db99d,null))['catch'](handleError(_0x1db99d,null));}; \ No newline at end of file +var _0x1d4d=['Applications','account','orderBy','priority','asc','CmContact','Sequelize','difference','createdAt','CompanyId','ListId','twilio','from','From','messageId','MessageSid','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','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','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','bulkCreate','getApplications','getInteractions','Owner','internal','Tag','Tags','tag','List','out','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','SmsAccount','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','keys','rawAttributes','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','getAnswers','CannedAnswer','ids','notify','sms','SmsApplication'];(function(_0x1a32a3,_0x1c4641){var _0x59d286=function(_0x3adb84){while(--_0x3adb84){_0x1a32a3['push'](_0x1a32a3['shift']());}};_0x59d286(++_0x1c4641);}(_0x1d4d,0x14c));var _0xd1d4=function(_0x506b34,_0x1ab9ca){_0x506b34=_0x506b34-0x0;var _0x4b0465=_0x1d4d[_0x506b34];return _0x4b0465;};'use strict';var emlformat=require(_0xd1d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1d4('0x1'));var jsonpatch=require(_0xd1d4('0x2'));var rp=require(_0xd1d4('0x3'));var moment=require(_0xd1d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd1d4('0x5'));var util=require(_0xd1d4('0x6'));var path=require(_0xd1d4('0x7'));var sox=require(_0xd1d4('0x8'));var csv=require(_0xd1d4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1d4('0xa'));var _=require(_0xd1d4('0xb'));var squel=require(_0xd1d4('0xc'));var crypto=require(_0xd1d4('0xd'));var jsforce=require(_0xd1d4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd1d4('0xf'));var Redis=require(_0xd1d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd1d4('0x11'));var as=require(_0xd1d4('0x12'));var hardwareService=require(_0xd1d4('0x13'));var logger=require(_0xd1d4('0x14'))('api');var utils=require(_0xd1d4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd1d4('0x16'));var db=require(_0xd1d4('0x17'))['db'];config[_0xd1d4('0x18')]=_[_0xd1d4('0x19')](config[_0xd1d4('0x18')],{'host':_0xd1d4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd1d4('0x18')]));require(_0xd1d4('0x1b'))[_0xd1d4('0x1c')](socket);var jayson=require(_0xd1d4('0x1d'));var client=jayson[_0xd1d4('0x1e')][_0xd1d4('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x25b80e,_0x3c070f,_0x27c0c3,_0x392986){return new BPromise(function(_0x251d16,_0x7f676a){var _0x1d79b2=_0x392986||client;return _0x1d79b2['request'](_0x25b80e,_0x27c0c3)[_0xd1d4('0x20')](function(_0x19bc65){logger['info'](_0xd1d4('0x21'),_0x3c070f,_0xd1d4('0x22'));logger[_0xd1d4('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3c070f,_0xd1d4('0x22'),JSON[_0xd1d4('0x24')](_0x19bc65));if(_0x19bc65[_0xd1d4('0x25')]){if(_0x19bc65[_0xd1d4('0x25')][_0xd1d4('0x26')]===0x1f4){logger[_0xd1d4('0x25')](_0xd1d4('0x21'),_0x3c070f,_0x19bc65[_0xd1d4('0x25')][_0xd1d4('0x27')]);return _0x7f676a(_0x19bc65['error'][_0xd1d4('0x27')]);}logger[_0xd1d4('0x25')](_0xd1d4('0x21'),_0x3c070f,_0x19bc65[_0xd1d4('0x25')][_0xd1d4('0x27')]);return _0x251d16(_0x19bc65['error'][_0xd1d4('0x27')]);}else{logger['info'](_0xd1d4('0x21'),_0x3c070f,_0xd1d4('0x22'));_0x251d16(_0x19bc65['result']['message']);}})[_0xd1d4('0x28')](function(_0x30c1fb){logger['error'](_0xd1d4('0x21'),_0x3c070f,_0x30c1fb);_0x7f676a(_0x30c1fb);});});}function respondWithStatusCode(_0x1e64b4,_0x1f72c0){_0x1f72c0=_0x1f72c0||0xcc;return function(_0x238eff){if(_0x238eff){return _0x1e64b4[_0xd1d4('0x29')](_0x1f72c0);}return _0x1e64b4[_0xd1d4('0x2a')](_0x1f72c0)[_0xd1d4('0x2b')]();};}function respondWithResult(_0x1f4aca,_0xfe83c2){_0xfe83c2=_0xfe83c2||0xc8;return function(_0x5b8fc6){if(_0x5b8fc6){return _0x1f4aca[_0xd1d4('0x2a')](_0xfe83c2)[_0xd1d4('0x2c')](_0x5b8fc6);}};}function respondWithFilteredResult(_0x2d8fe6,_0x310f72){return function(_0x57f3d8){if(_0x57f3d8){var _0x34def1=typeof _0x310f72['offset']==='undefined'&&typeof _0x310f72[_0xd1d4('0x2d')]===_0xd1d4('0x2e');var _0x4fec46=_0x57f3d8['count'];var _0x1d353b=_0x34def1?0x0:_0x310f72[_0xd1d4('0x2f')];var _0x33d582=_0x34def1?_0x57f3d8[_0xd1d4('0x30')]:_0x310f72[_0xd1d4('0x2f')]+_0x310f72['limit'];var _0xe0bec5;if(_0x33d582>=_0x4fec46){_0x33d582=_0x4fec46;_0xe0bec5=0xc8;}else{_0xe0bec5=0xce;}_0x2d8fe6[_0xd1d4('0x2a')](_0xe0bec5);return _0x2d8fe6[_0xd1d4('0x31')](_0xd1d4('0x32'),_0x1d353b+'-'+_0x33d582+'/'+_0x4fec46)[_0xd1d4('0x2c')](_0x57f3d8);}return null;};}function patchUpdates(_0x5a5d98){return function(_0x1f2696){try{jsonpatch[_0xd1d4('0x33')](_0x1f2696,_0x5a5d98,!![]);}catch(_0x300f44){return BPromise['reject'](_0x300f44);}return _0x1f2696[_0xd1d4('0x34')]();};}function saveUpdates(_0x171328,_0xf50869){return function(_0x490130){if(_0x490130){return _0x490130[_0xd1d4('0x35')](_0x171328)[_0xd1d4('0x20')](function(_0x572828){return _0x572828;});}return null;};}function removeEntity(_0x5cf6ad,_0x4aae74){return function(_0x2bb8d5){if(_0x2bb8d5){return _0x2bb8d5[_0xd1d4('0x36')]()['then'](function(){var _0x5f1e82=_0x2bb8d5[_0xd1d4('0x37')]({'plain':!![]});var _0x2ac4f2=_0xd1d4('0x38');return db[_0xd1d4('0x39')][_0xd1d4('0x36')]({'where':{'type':_0x2ac4f2,'resourceId':_0x5f1e82['id']}})['then'](function(){return _0x2bb8d5;});})[_0xd1d4('0x20')](function(){_0x5cf6ad[_0xd1d4('0x2a')](0xcc)[_0xd1d4('0x2b')]();});}};}function handleEntityNotFound(_0x283b08,_0x378d42){return function(_0x12b05e){if(!_0x12b05e){_0x283b08['sendStatus'](0x194);}return _0x12b05e;};}function handleError(_0xf3ba08,_0x164ff1){_0x164ff1=_0x164ff1||0x1f4;return function(_0x3afa26){logger[_0xd1d4('0x25')](_0x3afa26[_0xd1d4('0x3a')]);if(_0x3afa26[_0xd1d4('0x3b')]){delete _0x3afa26[_0xd1d4('0x3b')];}_0xf3ba08[_0xd1d4('0x2a')](_0x164ff1)[_0xd1d4('0x3c')](_0x3afa26);};}exports[_0xd1d4('0x3d')]=function(_0x3db38f,_0x1cbd17){var _0x4455e5={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x275d55={},_0x251f76={'count':0x0,'rows':[]};var _0x271d4d=_['map'](db[_0xd1d4('0x3e')]['rawAttributes'],function(_0x4b9847){return{'name':_0x4b9847['fieldName'],'type':_0x4b9847[_0xd1d4('0x3f')][_0xd1d4('0x40')]};});_0x275d55[_0xd1d4('0x41')]=_[_0xd1d4('0x42')](_0x271d4d,'name');_0x275d55['query']=_['keys'](_0x3db38f[_0xd1d4('0x43')]);_0x275d55[_0xd1d4('0x44')]=_[_0xd1d4('0x45')](_0x275d55[_0xd1d4('0x41')],_0x275d55[_0xd1d4('0x43')]);_0x4455e5[_0xd1d4('0x46')]=_['intersection'](_0x275d55['model'],qs[_0xd1d4('0x47')](_0x3db38f['query'][_0xd1d4('0x47')]));_0x4455e5[_0xd1d4('0x46')]=_0x4455e5[_0xd1d4('0x46')][_0xd1d4('0x48')]?_0x4455e5['attributes']:_0x275d55[_0xd1d4('0x41')];if(!_0x3db38f[_0xd1d4('0x43')][_0xd1d4('0x49')]('nolimit')){_0x4455e5['limit']=qs['limit'](_0x3db38f[_0xd1d4('0x43')]['limit']);_0x4455e5[_0xd1d4('0x2f')]=qs[_0xd1d4('0x2f')](_0x3db38f[_0xd1d4('0x43')][_0xd1d4('0x2f')]);}_0x4455e5[_0xd1d4('0x4a')]=qs[_0xd1d4('0x4b')](_0x3db38f['query'][_0xd1d4('0x4b')]);_0x4455e5[_0xd1d4('0x4c')]=qs[_0xd1d4('0x44')](_[_0xd1d4('0x4d')](_0x3db38f[_0xd1d4('0x43')],_0x275d55['filters']),_0x271d4d);if(_0x3db38f[_0xd1d4('0x43')][_0xd1d4('0x4e')]){_0x4455e5[_0xd1d4('0x4c')]=_[_0xd1d4('0x4f')](_0x4455e5['where'],{'$or':_['map'](_0x271d4d,function(_0x644706){if(_0x644706['type']!=='VIRTUAL'){var _0x116005={};_0x116005[_0x644706['name']]={'$like':'%'+_0x3db38f['query']['filter']+'%'};return _0x116005;}})});}_0x4455e5=_['merge']({},_0x4455e5,_0x3db38f[_0xd1d4('0x50')]);var _0x5c9508={'where':_0x4455e5[_0xd1d4('0x4c')]};return db[_0xd1d4('0x3e')][_0xd1d4('0x30')](_0x5c9508)[_0xd1d4('0x20')](function(_0x11dcae){_0x251f76[_0xd1d4('0x30')]=_0x11dcae;if(_0x3db38f[_0xd1d4('0x43')]['includeAll']){_0x4455e5[_0xd1d4('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0xd1d4('0x52')](_0x4455e5);})['then'](function(_0xa7324c){_0x251f76[_0xd1d4('0x53')]=_0xa7324c;return _0x251f76;})[_0xd1d4('0x20')](respondWithFilteredResult(_0x1cbd17,_0x4455e5))[_0xd1d4('0x28')](handleError(_0x1cbd17,null));};exports[_0xd1d4('0x54')]=function(_0x5a37a6,_0x4427ec){var _0x2ce770={'raw':![],'where':{'id':_0x5a37a6[_0xd1d4('0x55')]['id']},'include':[{'model':db[_0xd1d4('0x56')],'as':_0xd1d4('0x57')}]},_0x3c5857={};_0x3c5857['model']=_[_0xd1d4('0x58')](db['SmsAccount'][_0xd1d4('0x59')]);_0x3c5857[_0xd1d4('0x43')]=_[_0xd1d4('0x58')](_0x5a37a6['query']);_0x3c5857[_0xd1d4('0x44')]=_['intersection'](_0x3c5857[_0xd1d4('0x41')],_0x3c5857[_0xd1d4('0x43')]);_0x2ce770[_0xd1d4('0x46')]=_['intersection'](_0x3c5857[_0xd1d4('0x41')],qs[_0xd1d4('0x47')](_0x5a37a6[_0xd1d4('0x43')]['fields']));_0x2ce770['attributes']=_0x2ce770[_0xd1d4('0x46')][_0xd1d4('0x48')]?_0x2ce770['attributes']:_0x3c5857[_0xd1d4('0x41')];if(_0x5a37a6[_0xd1d4('0x43')][_0xd1d4('0x5a')]){_0x2ce770[_0xd1d4('0x51')]=[{'all':!![]}];}_0x2ce770=_['merge']({},_0x2ce770,_0x5a37a6[_0xd1d4('0x50')]);return db['SmsAccount'][_0xd1d4('0x5b')](_0x2ce770)[_0xd1d4('0x20')](handleEntityNotFound(_0x4427ec,null))[_0xd1d4('0x20')](respondWithResult(_0x4427ec,null))[_0xd1d4('0x28')](handleError(_0x4427ec,null));};exports['create']=function(_0x44b74e,_0x251de3){return db['SmsAccount']['create'](_0x44b74e[_0xd1d4('0x5c')],{})['then'](function(_0xf96140){var _0x4bcb83=_0x44b74e[_0xd1d4('0x5d')]['get']({'plain':!![]});if(!_0x4bcb83)throw new Error(_0xd1d4('0x5e'));if(_0x4bcb83[_0xd1d4('0x5f')]==='user'){var _0x1f109a=_0xf96140[_0xd1d4('0x37')]({'plain':!![]});var _0x55b52a='SmsAccounts';return db[_0xd1d4('0x60')][_0xd1d4('0x5b')]({'where':{'name':_0x55b52a,'userProfileId':_0x4bcb83['userProfileId']},'raw':!![]})[_0xd1d4('0x20')](function(_0x2d27a5){if(_0x2d27a5&&_0x2d27a5[_0xd1d4('0x61')]===0x0){return db[_0xd1d4('0x39')][_0xd1d4('0x62')]({'name':_0x1f109a[_0xd1d4('0x3b')],'resourceId':_0x1f109a['id'],'type':_0x2d27a5[_0xd1d4('0x3b')],'sectionId':_0x2d27a5['id']},{})[_0xd1d4('0x20')](function(){return _0xf96140;});}else{return _0xf96140;}})[_0xd1d4('0x28')](function(_0x1e8981){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e8981);throw _0x1e8981;});}return _0xf96140;})[_0xd1d4('0x20')](respondWithResult(_0x251de3,0xc9))[_0xd1d4('0x28')](handleError(_0x251de3,null));};exports[_0xd1d4('0x35')]=function(_0x50bea0,_0x4f1600){if(_0x50bea0[_0xd1d4('0x5c')]['id']){delete _0x50bea0[_0xd1d4('0x5c')]['id'];}return db[_0xd1d4('0x3e')][_0xd1d4('0x5b')]({'where':{'id':_0x50bea0[_0xd1d4('0x55')]['id']},'include':[{'model':db[_0xd1d4('0x56')],'as':'mandatoryDispositionPause'}]})[_0xd1d4('0x20')](handleEntityNotFound(_0x4f1600,null))['then'](saveUpdates(_0x50bea0['body'],null))[_0xd1d4('0x20')](respondWithResult(_0x4f1600,null))[_0xd1d4('0x28')](handleError(_0x4f1600,null));};exports[_0xd1d4('0x36')]=function(_0x9990b0,_0x545be2){return db[_0xd1d4('0x3e')]['find']({'where':{'id':_0x9990b0[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x545be2,null))[_0xd1d4('0x20')](removeEntity(_0x545be2,null))[_0xd1d4('0x28')](handleError(_0x545be2,null));};exports[_0xd1d4('0x63')]=function(_0x3bdf92,_0x171af0){return db[_0xd1d4('0x3e')][_0xd1d4('0x63')]()[_0xd1d4('0x20')](respondWithResult(_0x171af0,null))['catch'](handleError(_0x171af0,null));};exports[_0xd1d4('0x64')]=function(_0x1d04df,_0x24f112,_0x248f71){if(_0x1d04df[_0xd1d4('0x5c')]['id']){delete _0x1d04df[_0xd1d4('0x5c')]['id'];}return db['SmsAccount'][_0xd1d4('0x5b')]({'where':{'id':_0x1d04df[_0xd1d4('0x55')]['id']}})['then'](handleEntityNotFound(_0x24f112,null))[_0xd1d4('0x20')](function(_0x238421){if(_0x238421){_0x1d04df[_0xd1d4('0x5c')][_0xd1d4('0x65')]=_0x238421['id'];return db[_0xd1d4('0x66')][_0xd1d4('0x62')](_0x1d04df[_0xd1d4('0x5c')]);}})[_0xd1d4('0x20')](respondWithResult(_0x24f112,null))[_0xd1d4('0x28')](handleError(_0x24f112,null));};exports[_0xd1d4('0x67')]=function(_0x5b1b6e,_0x2a0b8b,_0x44af5b){var _0x53e7c2={'raw':![],'where':{}};var _0x54a37c={};var _0x44ed65={'count':0x0,'rows':[]};return db[_0xd1d4('0x3e')][_0xd1d4('0x68')]({'where':{'id':_0x5b1b6e[_0xd1d4('0x55')]['id']}})['then'](handleEntityNotFound(_0x2a0b8b,null))['then'](function(_0x58d8cf){if(_0x58d8cf){_0x54a37c[_0xd1d4('0x41')]=_[_0xd1d4('0x58')](db['Disposition'][_0xd1d4('0x59')]);_0x54a37c[_0xd1d4('0x43')]=_['keys'](_0x5b1b6e[_0xd1d4('0x43')]);_0x54a37c[_0xd1d4('0x44')]=_[_0xd1d4('0x45')](_0x54a37c[_0xd1d4('0x41')],_0x54a37c['query']);_0x53e7c2[_0xd1d4('0x46')]=_[_0xd1d4('0x45')](_0x54a37c[_0xd1d4('0x41')],qs['fields'](_0x5b1b6e['query'][_0xd1d4('0x47')]));_0x53e7c2[_0xd1d4('0x46')]=_0x53e7c2['attributes'][_0xd1d4('0x48')]?_0x53e7c2[_0xd1d4('0x46')]:_0x54a37c[_0xd1d4('0x41')];if(!_0x5b1b6e[_0xd1d4('0x43')][_0xd1d4('0x49')](_0xd1d4('0x69'))){_0x53e7c2[_0xd1d4('0x2d')]=qs['limit'](_0x5b1b6e[_0xd1d4('0x43')][_0xd1d4('0x2d')]);_0x53e7c2[_0xd1d4('0x2f')]=qs[_0xd1d4('0x2f')](_0x5b1b6e[_0xd1d4('0x43')]['offset']);}_0x53e7c2[_0xd1d4('0x4a')]=qs[_0xd1d4('0x4b')](_0x5b1b6e[_0xd1d4('0x43')]['sort']);_0x53e7c2[_0xd1d4('0x4c')]=qs[_0xd1d4('0x44')](_['pick'](_0x5b1b6e[_0xd1d4('0x43')],_0x54a37c[_0xd1d4('0x44')]));_0x53e7c2[_0xd1d4('0x4c')][_0xd1d4('0x65')]=_0x58d8cf['id'];if(_0x5b1b6e['query'][_0xd1d4('0x4e')]){_0x53e7c2[_0xd1d4('0x4c')]=_['merge'](_0x53e7c2[_0xd1d4('0x4c')],{'$or':_[_0xd1d4('0x42')](_0x53e7c2[_0xd1d4('0x46')],function(_0x5dfe89){var _0x547ccf={};_0x547ccf[_0x5dfe89]={'$like':'%'+_0x5b1b6e['query']['filter']+'%'};return _0x547ccf;})});}_0x53e7c2=_['merge']({},_0x53e7c2,_0x5b1b6e[_0xd1d4('0x50')]);return db[_0xd1d4('0x66')][_0xd1d4('0x30')]({'where':_0x53e7c2[_0xd1d4('0x4c')]})[_0xd1d4('0x20')](function(_0x6f062e){_0x44ed65[_0xd1d4('0x30')]=_0x6f062e;if(_0x5b1b6e[_0xd1d4('0x43')][_0xd1d4('0x5a')]){_0x53e7c2[_0xd1d4('0x51')]=[{'all':!![]}];}return db[_0xd1d4('0x66')]['findAll'](_0x53e7c2);})[_0xd1d4('0x20')](function(_0x1e9816){_0x44ed65[_0xd1d4('0x53')]=_0x1e9816;return _0x44ed65;});}})[_0xd1d4('0x20')](respondWithFilteredResult(_0x2a0b8b,_0x53e7c2))[_0xd1d4('0x28')](handleError(_0x2a0b8b,null));};exports[_0xd1d4('0x6a')]=function(_0xb2e820,_0x3acc6f,_0x264f45){return db[_0xd1d4('0x3e')]['find']({'where':{'id':_0xb2e820[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x3acc6f,null))['then'](function(_0x9af285){if(_0x9af285){return _0x9af285[_0xd1d4('0x6a')](_0xb2e820[_0xd1d4('0x43')]['ids']);}})[_0xd1d4('0x20')](respondWithStatusCode(_0x3acc6f,null))[_0xd1d4('0x28')](handleError(_0x3acc6f,null));};exports[_0xd1d4('0x6b')]=function(_0x3b726c,_0x4488b9,_0x4a6465){if(_0x3b726c[_0xd1d4('0x5c')]['id']){delete _0x3b726c['body']['id'];}return db[_0xd1d4('0x3e')][_0xd1d4('0x5b')]({'where':{'id':_0x3b726c[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x4488b9,null))[_0xd1d4('0x20')](function(_0x202c07){if(_0x202c07){_0x3b726c[_0xd1d4('0x5c')]['SmsAccountId']=_0x202c07['id'];return db['CannedAnswer'][_0xd1d4('0x62')](_0x3b726c['body']);}})[_0xd1d4('0x20')](respondWithResult(_0x4488b9,null))[_0xd1d4('0x28')](handleError(_0x4488b9,null));};exports[_0xd1d4('0x6c')]=function(_0xc1c612,_0x37d601,_0x1a4e58){var _0x5af3ce={'raw':![],'where':{}};var _0x598347={};var _0x1bf00c={'count':0x0,'rows':[]};return db[_0xd1d4('0x3e')][_0xd1d4('0x68')]({'where':{'id':_0xc1c612[_0xd1d4('0x55')]['id']}})['then'](handleEntityNotFound(_0x37d601,null))['then'](function(_0x49c9cf){if(_0x49c9cf){_0x598347['model']=_[_0xd1d4('0x58')](db[_0xd1d4('0x6d')]['rawAttributes']);_0x598347[_0xd1d4('0x43')]=_[_0xd1d4('0x58')](_0xc1c612[_0xd1d4('0x43')]);_0x598347[_0xd1d4('0x44')]=_[_0xd1d4('0x45')](_0x598347[_0xd1d4('0x41')],_0x598347[_0xd1d4('0x43')]);_0x5af3ce['attributes']=_[_0xd1d4('0x45')](_0x598347['model'],qs[_0xd1d4('0x47')](_0xc1c612[_0xd1d4('0x43')][_0xd1d4('0x47')]));_0x5af3ce[_0xd1d4('0x46')]=_0x5af3ce[_0xd1d4('0x46')][_0xd1d4('0x48')]?_0x5af3ce[_0xd1d4('0x46')]:_0x598347[_0xd1d4('0x41')];if(!_0xc1c612['query'][_0xd1d4('0x49')](_0xd1d4('0x69'))){_0x5af3ce[_0xd1d4('0x2d')]=qs['limit'](_0xc1c612[_0xd1d4('0x43')][_0xd1d4('0x2d')]);_0x5af3ce['offset']=qs[_0xd1d4('0x2f')](_0xc1c612[_0xd1d4('0x43')][_0xd1d4('0x2f')]);}_0x5af3ce[_0xd1d4('0x4a')]=qs['sort'](_0xc1c612['query'][_0xd1d4('0x4b')]);_0x5af3ce[_0xd1d4('0x4c')]=qs[_0xd1d4('0x44')](_['pick'](_0xc1c612[_0xd1d4('0x43')],_0x598347['filters']));_0x5af3ce['where'][_0xd1d4('0x65')]=_0x49c9cf['id'];if(_0xc1c612[_0xd1d4('0x43')][_0xd1d4('0x4e')]){_0x5af3ce['where']=_[_0xd1d4('0x4f')](_0x5af3ce[_0xd1d4('0x4c')],{'$or':_[_0xd1d4('0x42')](_0x5af3ce[_0xd1d4('0x46')],function(_0x264f8f){var _0x11cecd={};_0x11cecd[_0x264f8f]={'$like':'%'+_0xc1c612[_0xd1d4('0x43')][_0xd1d4('0x4e')]+'%'};return _0x11cecd;})});}_0x5af3ce=_[_0xd1d4('0x4f')]({},_0x5af3ce,_0xc1c612[_0xd1d4('0x50')]);return db['CannedAnswer'][_0xd1d4('0x30')]({'where':_0x5af3ce[_0xd1d4('0x4c')]})[_0xd1d4('0x20')](function(_0x2f8a3d){_0x1bf00c['count']=_0x2f8a3d;if(_0xc1c612[_0xd1d4('0x43')][_0xd1d4('0x5a')]){_0x5af3ce['include']=[{'all':!![]}];}return db[_0xd1d4('0x6d')][_0xd1d4('0x52')](_0x5af3ce);})[_0xd1d4('0x20')](function(_0x1be76c){_0x1bf00c['rows']=_0x1be76c;return _0x1bf00c;});}})['then'](respondWithFilteredResult(_0x37d601,_0x5af3ce))[_0xd1d4('0x28')](handleError(_0x37d601,null));};exports['removeAnswers']=function(_0x183263,_0x38cf5e,_0x2ee42c){return db[_0xd1d4('0x3e')]['find']({'where':{'id':_0x183263['params']['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x38cf5e,null))[_0xd1d4('0x20')](function(_0x262a69){if(_0x262a69){return _0x262a69['removeAnswers'](_0x183263[_0xd1d4('0x43')][_0xd1d4('0x6e')]);}})[_0xd1d4('0x20')](respondWithStatusCode(_0x38cf5e,null))['catch'](handleError(_0x38cf5e,null));};exports[_0xd1d4('0x6f')]=function(_0x54485c,_0x9db9ce,_0x29c6e6){var _0x331009={'channel':_0xd1d4('0x70')};var _0x2abfd3=[];var _0x16e076=[];var _0x2556b9={};return db[_0xd1d4('0x3e')]['find']({'where':{'id':_0x54485c[_0xd1d4('0x55')]['id']},'include':[{'model':db[_0xd1d4('0x71')],'as':_0xd1d4('0x72')}]})[_0xd1d4('0x20')](handleEntityNotFound(_0x9db9ce,null))[_0xd1d4('0x20')](function(_0x5cccf3){_0x331009[_0xd1d4('0x73')]=_0x5cccf3;_0x331009['applications']=_[_0xd1d4('0x74')](_0x5cccf3[_0xd1d4('0x72')],[_0xd1d4('0x75')],[_0xd1d4('0x76')]);if(_0x331009[_0xd1d4('0x73')][_0xd1d4('0x72')]){delete _0x331009[_0xd1d4('0x73')]['Applications'];}return db[_0xd1d4('0x77')][_0xd1d4('0x63')]();})[_0xd1d4('0x20')](function(_0xf237f2){if(!_0xf237f2){throw new db[(_0xd1d4('0x78'))]['ValidationError']('no\x20available\x20attributes');}_0x2abfd3=_[_0xd1d4('0x79')](_[_0xd1d4('0x58')](_0xf237f2),[_0xd1d4('0x7a'),'updatedAt']);_0x16e076=_[_0xd1d4('0x79')](_[_0xd1d4('0x58')](_0xf237f2),[_0xd1d4('0x7a'),'updatedAt',_0xd1d4('0x7b'),_0xd1d4('0x7c')]);_0x331009[_0xd1d4('0x5c')]={'mapKey':'mobile'};if(_0x331009[_0xd1d4('0x73')][_0xd1d4('0x3f')]){switch(_0x331009[_0xd1d4('0x73')][_0xd1d4('0x3f')]){case _0xd1d4('0x7d'):_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]=_0x54485c['body'][_0xd1d4('0x7f')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c[_0xd1d4('0x5c')]['Body'];_0x331009['body'][_0xd1d4('0x80')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x81')];break;case'skebby':_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]='+'+_0x54485c['body'][_0xd1d4('0x82')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c['body'][_0xd1d4('0x83')];break;case _0xd1d4('0x84'):_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]=_0x54485c['body'][_0xd1d4('0x7e')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c['body'][_0xd1d4('0x27')];break;case _0xd1d4('0x85'):_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x7e')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c[_0xd1d4('0x5c')]['body'];_0x331009['body'][_0xd1d4('0x80')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x86')];break;case'plivo':_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]=_0x54485c[_0xd1d4('0x5c')]['From'];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x87')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x80')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x88')];break;case _0xd1d4('0x89'):_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]='+'+_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x8a')][0x0][_0xd1d4('0x7e')];_0x331009[_0xd1d4('0x5c')]['body']=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x8a')][0x0]['text'];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x80')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x8a')][0x0][_0xd1d4('0x80')];break;case _0xd1d4('0x8b'):_0x331009['body'][_0xd1d4('0x7e')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x8c')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x8d')]['message'];break;case _0xd1d4('0x8e'):_0x331009[_0xd1d4('0x5c')]['from']=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x8f')];_0x331009['body'][_0xd1d4('0x5c')]=_0x54485c['body']['text'];_0x331009['body'][_0xd1d4('0x80')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x90')];break;case _0xd1d4('0x91'):_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x80')]=_0x54485c[_0xd1d4('0x5c')][0x0][_0xd1d4('0x27')]['id'];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')]=_0x54485c[_0xd1d4('0x5c')][0x0][_0xd1d4('0x27')][_0xd1d4('0x7e')];_0x331009[_0xd1d4('0x5c')]['body']=_0x54485c[_0xd1d4('0x5c')][0x0][_0xd1d4('0x27')][_0xd1d4('0x83')];break;case _0xd1d4('0x92'):_0x331009['body'][_0xd1d4('0x7e')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x7e')];_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x5c')]=_0x54485c[_0xd1d4('0x5c')][_0xd1d4('0x27')];_0x331009[_0xd1d4('0x5c')]['messageId']=_0x54485c[_0xd1d4('0x5c')]['refid'];break;}}if(_0x331009[_0xd1d4('0x5c')]['id']){delete _0x331009[_0xd1d4('0x5c')]['id'];}if(_[_0xd1d4('0x93')](_0x331009['body'][_0xd1d4('0x7e')])){throw new db[(_0xd1d4('0x78'))][(_0xd1d4('0x94'))](_0xd1d4('0x95'));}if(_[_0xd1d4('0x93')](_0x331009[_0xd1d4('0x5c')]['body'])||_0x331009['body'][_0xd1d4('0x5c')]===''){throw new db[(_0xd1d4('0x78'))][(_0xd1d4('0x94'))](_0xd1d4('0x96'));}if(_['isNil'](_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x97')])){throw new db[(_0xd1d4('0x78'))]['ValidationError'](_0xd1d4('0x98')+_0x16e076);}if(!_[_0xd1d4('0x99')](_0x16e076,_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x97')])){throw new db[(_0xd1d4('0x78'))]['ValidationError'](_0xd1d4('0x9a')+_0x16e076);}_0x2556b9[_0x331009['body']['mapKey']]=_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')];return db[_0xd1d4('0x9b')]['find']({'where':{'id':_0x331009[_0xd1d4('0x73')][_0xd1d4('0x7c')]},'include':[{'model':db[_0xd1d4('0x77')],'as':_0xd1d4('0x9c'),'where':_0x2556b9,'limit':0x1,'order':[[_0xd1d4('0x9d'),_0xd1d4('0x9e')]]}]});})[_0xd1d4('0x20')](handleEntityNotFound(_0x9db9ce,null))[_0xd1d4('0x20')](function(_0x364596){if(_0x364596){_0x331009['list']=_[_0xd1d4('0x9f')](_0x364596,[_0xd1d4('0x9c')]);if(_0x364596['Contacts'][_0xd1d4('0x48')]){return _0x364596[_0xd1d4('0x9c')][0x0];}var _0x377a7=_[_0xd1d4('0x19')](_0x331009[_0xd1d4('0x5c')],{'firstName':_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')],'ListId':_0x364596['id']});_0x377a7[_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x97')]]=_0x331009[_0xd1d4('0x5c')]['from'];return db[_0xd1d4('0x77')][_0xd1d4('0x62')](_0x377a7,{'fields':_0x2abfd3,'raw':!![]});}})[_0xd1d4('0x20')](handleEntityNotFound(_0x9db9ce,null))['then'](function(_0xcb4b56){if(_0xcb4b56){_0x331009[_0xd1d4('0xa0')]=_0xcb4b56;var _0x3da898={'ContactId':_0xcb4b56['id'],'phone':_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x7e')],'SmsAccountId':_0x54485c[_0xd1d4('0x55')]['id']};var _0x382395={'ContactId':_0xcb4b56['id'],'SmsAccountId':_0x54485c[_0xd1d4('0x55')]['id'],'closed':![]};return db[_0xd1d4('0xa1')][_0xd1d4('0x5b')]({'where':_0x382395})[_0xd1d4('0x20')](function(_0x53eb53){if(_0x53eb53){return[_0x53eb53,![]];}return db['SmsInteraction']['create'](_0x3da898)[_0xd1d4('0x20')](function(_0x513b6a){return[_0x513b6a,!![]];});});}})[_0xd1d4('0xa2')](function(_0x48022d,_0x5d9e5f){_0x331009['interaction']=_0x48022d[_0xd1d4('0x37')]({'plain':!![]});_0x331009[_0xd1d4('0xa3')][_0xd1d4('0xa4')]=![];if(_0x5d9e5f){if(_0x331009[_0xd1d4('0x73')][_0xd1d4('0xa5')]){_0x331009['applications']['push']({'id':0x0,'priority':_0x331009[_0xd1d4('0xa6')][_0xd1d4('0x48')]+0x1,'app':_0xd1d4('0xa7'),'appdata':'unmanaged','interval':_0xd1d4('0xa8')});}_0x331009[_0xd1d4('0xa3')]['created']=!![];}return db[_0xd1d4('0xa9')]['create']({'phone':_0x331009[_0xd1d4('0x5c')]['from'],'messageId':_0x331009[_0xd1d4('0x5c')][_0xd1d4('0x80')],'body':_0x331009['body'][_0xd1d4('0x5c')],'SmsAccountId':_0x54485c[_0xd1d4('0x55')]['id'],'SmsInteractionId':_0x48022d['id'],'direction':'in','ContactId':_0x48022d[_0xd1d4('0xaa')],'AttachmentId':_0x331009[_0xd1d4('0x5c')][_0xd1d4('0xab')]});})[_0xd1d4('0x20')](function(_0x572ec4){_0x331009[_0xd1d4('0x27')]=_0x572ec4;if(_0x331009['interaction'][_0xd1d4('0xac')]){return db[_0xd1d4('0xad')][_0xd1d4('0x5b')]({'attributes':['id',_0xd1d4('0x3b')],'where':{'id':_0x331009['interaction'][_0xd1d4('0xac')]}})[_0xd1d4('0x20')](function(_0xae0deb){if(_0xae0deb){_0x331009['applications'][_0xd1d4('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xae0deb[_0xd1d4('0x3b')]+','+(_0x331009[_0xd1d4('0x73')][_0xd1d4('0xaf')]||0xa),'interval':_0xd1d4('0xa8')});}return respondWithRpcPromise(_0xd1d4('0xb0'),_0xd1d4('0xb1'),_0x331009);});}return respondWithRpcPromise('Start',_0xd1d4('0xb1'),_0x331009);})['then'](function(_0x4c2602){if(_0x4c2602){var _0x14d7e3=0xc8;var _0x1610f5=_0xd1d4('0xb2');logger[_0xd1d4('0xb3')](_0xd1d4('0xb4'),_0x1610f5,_0x14d7e3,_0xd1d4('0xb5'));logger[_0xd1d4('0x23')](_0xd1d4('0xb6'),_0x1610f5,_0x14d7e3,_0xd1d4('0xb5'),JSON[_0xd1d4('0x24')](_0x4c2602));if(_0x331009[_0xd1d4('0x73')][_0xd1d4('0x3f')]==='twilio'){return _0x9db9ce[_0xd1d4('0x2a')](_0x14d7e3)[_0xd1d4('0x31')](_0xd1d4('0xb7'),_0xd1d4('0xb8'))[_0xd1d4('0x3c')](_0xd1d4('0xb9'));}else{return _0x9db9ce[_0xd1d4('0x2a')](_0x14d7e3)['json'](_0x4c2602);}}})['catch'](handleError(_0x9db9ce,null));};exports['addApplications']=function(_0x16e597,_0x571b10,_0x54002d){return db[_0xd1d4('0x3e')][_0xd1d4('0x68')]({'where':{'id':_0x16e597['params']['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x571b10,null))[_0xd1d4('0x20')](function(_0x3f6113){if(_0x3f6113){return db[_0xd1d4('0xba')]['transaction'](function(_0x5a64f0){return db[_0xd1d4('0x71')]['destroy']({'where':{'SmsAccountId':_0x16e597['params']['id']},'transaction':_0x5a64f0})[_0xd1d4('0x20')](function(_0x5ce857){var _0x3efa06=_[_0xd1d4('0x42')](_0x16e597[_0xd1d4('0x5c')],function(_0x38c3bb){_0x38c3bb['SmsAccountId']=_0x16e597[_0xd1d4('0x55')]['id'];return _0x38c3bb;});return db[_0xd1d4('0x71')][_0xd1d4('0xbb')](_0x3efa06,{'transaction':_0x5a64f0});});})[_0xd1d4('0x20')](function(){return db[_0xd1d4('0x71')]['findAndCountAll']({'where':{'SmsAccountId':_0x16e597[_0xd1d4('0x55')]['id']},'order':_0xd1d4('0x75')});});}})[_0xd1d4('0x20')](respondWithResult(_0x571b10,null))[_0xd1d4('0x28')](handleError(_0x571b10,null));};exports[_0xd1d4('0xbc')]=function(_0x524a4d,_0x3390ea,_0x22c158){var _0x543bf0={};var _0x1c75c2={};var _0x9c725e;var _0x450f02;return db[_0xd1d4('0x3e')][_0xd1d4('0x68')]({'where':{'id':_0x524a4d[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x3390ea,null))[_0xd1d4('0x20')](function(_0x12f7b5){if(_0x12f7b5){_0x9c725e=_0x12f7b5;_0x1c75c2[_0xd1d4('0x41')]=_[_0xd1d4('0x58')](db[_0xd1d4('0x71')]['rawAttributes']);_0x1c75c2[_0xd1d4('0x43')]=_['keys'](_0x524a4d[_0xd1d4('0x43')]);_0x1c75c2[_0xd1d4('0x44')]=_[_0xd1d4('0x45')](_0x1c75c2[_0xd1d4('0x41')],_0x1c75c2[_0xd1d4('0x43')]);_0x543bf0[_0xd1d4('0x46')]=_['intersection'](_0x1c75c2[_0xd1d4('0x41')],qs[_0xd1d4('0x47')](_0x524a4d[_0xd1d4('0x43')][_0xd1d4('0x47')]));_0x543bf0[_0xd1d4('0x46')]=_0x543bf0[_0xd1d4('0x46')]['length']?_0x543bf0[_0xd1d4('0x46')]:_0x1c75c2[_0xd1d4('0x41')];_0x543bf0[_0xd1d4('0x4a')]=qs[_0xd1d4('0x4b')](_0x524a4d[_0xd1d4('0x43')][_0xd1d4('0x4b')]);_0x543bf0['where']=qs[_0xd1d4('0x44')](_['pick'](_0x524a4d[_0xd1d4('0x43')],_0x1c75c2[_0xd1d4('0x44')]));if(_0x524a4d[_0xd1d4('0x43')][_0xd1d4('0x4e')]){_0x543bf0[_0xd1d4('0x4c')]=_[_0xd1d4('0x4f')](_0x543bf0[_0xd1d4('0x4c')],{'$or':_[_0xd1d4('0x42')](_0x543bf0[_0xd1d4('0x46')],function(_0x560ded){var _0x557c89={};_0x557c89[_0x560ded]={'$like':'%'+_0x524a4d[_0xd1d4('0x43')]['filter']+'%'};return _0x557c89;})});}_0x543bf0=_[_0xd1d4('0x4f')]({},_0x543bf0,_0x524a4d[_0xd1d4('0x50')]);return _0x9c725e[_0xd1d4('0xbc')](_0x543bf0);}})['then'](function(_0x5a3611){if(_0x5a3611){_0x450f02=_0x5a3611[_0xd1d4('0x48')];if(!_0x524a4d[_0xd1d4('0x43')][_0xd1d4('0x49')](_0xd1d4('0x69'))){_0x543bf0[_0xd1d4('0x2d')]=qs['limit'](_0x524a4d[_0xd1d4('0x43')][_0xd1d4('0x2d')]);_0x543bf0[_0xd1d4('0x2f')]=qs[_0xd1d4('0x2f')](_0x524a4d[_0xd1d4('0x43')]['offset']);}return _0x9c725e['getApplications'](_0x543bf0);}})[_0xd1d4('0x20')](function(_0x29f371){if(_0x29f371){return _0x29f371?{'count':_0x450f02,'rows':_0x29f371}:null;}})[_0xd1d4('0x20')](respondWithResult(_0x3390ea,null))['catch'](handleError(_0x3390ea,null));};exports[_0xd1d4('0xbd')]=function(_0x4a8be0,_0x185866,_0x39af4b){var _0x5044ae={'raw':![],'where':{}};var _0x4753bc={};var _0x511be7={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4a8be0[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x185866,null))[_0xd1d4('0x20')](function(_0x7a2724){if(_0x7a2724){_0x4753bc['model']=_['keys'](db['SmsInteraction'][_0xd1d4('0x59')]);_0x4753bc[_0xd1d4('0x43')]=_[_0xd1d4('0x58')](_0x4a8be0[_0xd1d4('0x43')]);_0x4753bc['filters']=_[_0xd1d4('0x45')](_0x4753bc[_0xd1d4('0x41')],_0x4753bc[_0xd1d4('0x43')]);_0x5044ae[_0xd1d4('0x46')]=_[_0xd1d4('0x45')](_0x4753bc[_0xd1d4('0x41')],qs[_0xd1d4('0x47')](_0x4a8be0['query']['fields']));_0x5044ae[_0xd1d4('0x46')]=_0x5044ae[_0xd1d4('0x46')][_0xd1d4('0x48')]?_0x5044ae[_0xd1d4('0x46')]:_0x4753bc[_0xd1d4('0x41')];if(!_0x4a8be0[_0xd1d4('0x43')][_0xd1d4('0x49')](_0xd1d4('0x69'))){_0x5044ae[_0xd1d4('0x2d')]=qs[_0xd1d4('0x2d')](_0x4a8be0[_0xd1d4('0x43')]['limit']);_0x5044ae[_0xd1d4('0x2f')]=qs[_0xd1d4('0x2f')](_0x4a8be0['query'][_0xd1d4('0x2f')]);}_0x5044ae[_0xd1d4('0x4a')]=qs[_0xd1d4('0x4b')](_0x4a8be0[_0xd1d4('0x43')][_0xd1d4('0x4b')]);_0x5044ae[_0xd1d4('0x4c')]=qs['filters'](_['pick'](_0x4a8be0['query'],_0x4753bc[_0xd1d4('0x44')]));_0x5044ae[_0xd1d4('0x4c')][_0xd1d4('0x65')]=_0x7a2724['id'];if(_0x4a8be0[_0xd1d4('0x43')]['filter']){_0x5044ae[_0xd1d4('0x4c')]=_[_0xd1d4('0x4f')](_0x5044ae[_0xd1d4('0x4c')],{'$or':_[_0xd1d4('0x42')](_0x5044ae[_0xd1d4('0x46')],function(_0x470d1b){var _0x166c6d={};_0x166c6d[_0x470d1b]={'$like':'%'+_0x4a8be0[_0xd1d4('0x43')]['filter']+'%'};return _0x166c6d;})});}_0x5044ae=_['merge']({},_0x5044ae,_0x4a8be0[_0xd1d4('0x50')]);return db['SmsInteraction'][_0xd1d4('0x30')]({'where':_0x5044ae['where']})['then'](function(_0x56ec87){_0x511be7['count']=_0x56ec87;if(_0x4a8be0[_0xd1d4('0x43')][_0xd1d4('0x5a')]){_0x5044ae[_0xd1d4('0x51')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xd1d4('0xbe'),'attributes':[_0xd1d4('0x3b'),'fullname',_0xd1d4('0xbf')],'required':![]},{'model':db[_0xd1d4('0xc0')],'as':_0xd1d4('0xc1'),'attributes':['id',_0xd1d4('0x3b'),'color'],'where':_0x4a8be0[_0xd1d4('0x43')][_0xd1d4('0xc2')]?{'id':_0x4a8be0[_0xd1d4('0x43')][_0xd1d4('0xc2')]}:undefined,'required':_0x4a8be0['query']['tag']?!![]:![]}];}return db[_0xd1d4('0xa1')][_0xd1d4('0x52')](_0x5044ae);})['then'](function(_0x43f08c){_0x511be7['rows']=_0x43f08c;return _0x511be7;});}})[_0xd1d4('0x20')](respondWithFilteredResult(_0x185866,_0x5044ae))['catch'](handleError(_0x185866,null));};exports[_0xd1d4('0x3c')]=function(_0x3bf085,_0x446d67,_0x482e10){var _0x49eed5,_0x247f93,_0x5dffaa;if(_[_0xd1d4('0x93')](_0x3bf085['body'][_0xd1d4('0x5c')])||_0x3bf085[_0xd1d4('0x5c')][_0xd1d4('0x5c')]===''){throw new db[(_0xd1d4('0x78'))][(_0xd1d4('0x94'))](_0xd1d4('0x96'));}if(_['isNil'](_0x3bf085[_0xd1d4('0x5c')]['to'])){throw new db['Sequelize'][(_0xd1d4('0x94'))]('to\x20is\x20mandatory');}_0x49eed5=_0x3bf085[_0xd1d4('0x5c')]['to'];return db[_0xd1d4('0x3e')][_0xd1d4('0x5b')]({'where':{'id':_0x3bf085[_0xd1d4('0x55')]['id']},'include':[{'model':db[_0xd1d4('0x9b')],'as':_0xd1d4('0xc3'),'include':[{'model':db[_0xd1d4('0x77')],'as':_0xd1d4('0x9c'),'where':{'mobile':_0x49eed5},'limit':0x1,'order':[['updatedAt',_0xd1d4('0x9e')]]}]}]})[_0xd1d4('0x20')](handleEntityNotFound(_0x446d67,null))['then'](function(_0x51abea){if(_0x51abea&&_0x51abea[_0xd1d4('0xc3')]){_0x247f93=_0x51abea['get']({'plain':!![]});if(_0x247f93[_0xd1d4('0xc3')]&&_0x247f93['List'][_0xd1d4('0x9c')][_0xd1d4('0x48')]){return _0x247f93[_0xd1d4('0xc3')]['Contacts'][0x0];}return db['CmContact'][_0xd1d4('0x62')](_[_0xd1d4('0x19')](_0x3bf085[_0xd1d4('0x5c')],{'firstName':_0x49eed5,'mobile':_0x49eed5,'phone':_0x49eed5,'ListId':_0x247f93[_0xd1d4('0x7c')]}));}})['then'](handleEntityNotFound(_0x446d67,null))['then'](function(_0x3c7114){if(_0x3c7114){_0x5dffaa=_0x3c7114;return db[_0xd1d4('0xa1')][_0xd1d4('0x5b')]({'where':{'ContactId':_0x5dffaa['id'],'closed':![],'SmsAccountId':_0x247f93['id']}})['then'](function(_0xb889ea){if(_0xb889ea){return[_0xb889ea,![]];}return db[_0xd1d4('0xa1')][_0xd1d4('0x62')]({'UserId':_0x3bf085[_0xd1d4('0x5d')]['id'],'ContactId':_0x5dffaa['id'],'SmsAccountId':_0x247f93['id'],'phone':_0x49eed5,'firstMsgDirection':_0xd1d4('0xc4'),'Messages':[_[_0xd1d4('0x4f')](_0x3bf085['body'],{'read':![],'body':_0x3bf085[_0xd1d4('0x5c')][_0xd1d4('0x5c')],'phone':_0x49eed5,'SmsAccountId':_0x247f93['id'],'UserId':_0x3bf085[_0xd1d4('0x5d')]['id'],'ContactId':_0x5dffaa['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xd1d4('0x20')](function(_0x4518a4){return[_0x4518a4,!![]];});});}})['spread'](function(_0x421c67,_0xf15063){if(_0xf15063){return _0x421c67;}return db['SmsMessage'][_0xd1d4('0x62')](_[_0xd1d4('0x4f')](_0x3bf085[_0xd1d4('0x5c')],{'read':![],'body':_0x3bf085[_0xd1d4('0x5c')][_0xd1d4('0x5c')],'phone':_0x49eed5,'SmsAccountId':_0x247f93['id'],'SmsInteractionId':_0x421c67['id'],'UserId':_0x3bf085[_0xd1d4('0x5d')]['id'],'ContactId':_0x5dffaa['id']}))[_0xd1d4('0x20')](function(_0xce583e){_0x421c67[_0xd1d4('0xc5')][_0xd1d4('0xc6')]=[];_0x421c67[_0xd1d4('0xc5')][_0xd1d4('0xc6')][_0xd1d4('0xc7')](_0xce583e['dataValues']);return _0x421c67;});})['then'](respondWithResult(_0x446d67,null))[_0xd1d4('0x28')](handleError(_0x446d67,null));};exports[_0xd1d4('0x2a')]=function(_0x582d54,_0x2ce397,_0x1ce1d3){if(_0x582d54['body']['id']){delete _0x582d54[_0xd1d4('0x5c')]['id'];}var _0x4a82be,_0x239f06,_0xe6cee8;return db[_0xd1d4('0x3e')][_0xd1d4('0x5b')]({'where':{'id':_0x582d54[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x2ce397,null))[_0xd1d4('0x20')](function(_0x571630){if(_0x571630){_0xe6cee8=_0x571630;logger['debug'](_0xd1d4('0xb4'),_0xd1d4('0x2a'),_0xd1d4('0xc8'),_0x571630[_0xd1d4('0x3f')],util[_0xd1d4('0xc9')](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));switch(_0x571630[_0xd1d4('0x3f')]){case _0xd1d4('0xca'):if(_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0xcb')]&&_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0x2a')]){_0x239f06=_0x582d54['body'][_0xd1d4('0x2a')];return db[_0xd1d4('0xa9')][_0xd1d4('0x5b')]({'where':{'messageId':_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0xcb')]}});}break;case _0xd1d4('0x84'):if(_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0xcc')]&&_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0xcd')]){_0x239f06=_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0xcd')];return db[_0xd1d4('0xa9')][_0xd1d4('0x5b')]({'where':{'messageId':_0x582d54[_0xd1d4('0x5c')]['requestid']}});}break;case _0xd1d4('0x85'):if(_0x582d54['body']['message_id']&&_0x582d54[_0xd1d4('0x5c')]['status_code']){_0x239f06=_0x582d54['body'][_0xd1d4('0xce')];return db[_0xd1d4('0xa9')][_0xd1d4('0x5b')]({'where':{'messageId':_0x582d54['body']['message_id']}});}break;case _0xd1d4('0x89'):var _0x170a86=_0x582d54[_0xd1d4('0x5c')]['results'][0x0];if(_0x170a86[_0xd1d4('0x80')]&&_0x170a86[_0xd1d4('0x2a')]['groupName']==='DELIVERED'){_0x239f06=_0x170a86[_0xd1d4('0x2a')][_0xd1d4('0xcf')];return db[_0xd1d4('0xa9')][_0xd1d4('0x5b')]({'where':{'messageId':_0x170a86[_0xd1d4('0x80')]}});}break;case _0xd1d4('0x8e'):if(_0x582d54['body'][_0xd1d4('0x80')]&&_0x582d54['body'][_0xd1d4('0x2a')]){_0x239f06=_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0x2a')];return db['SmsMessage'][_0xd1d4('0x5b')]({'where':{'messageId':_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0x80')]}});}break;case _0xd1d4('0x91'):if(_0x582d54[_0xd1d4('0x5c')][0x0][_0xd1d4('0x27')]['id']){_0x239f06=_0x582d54[_0xd1d4('0x5c')][0x0][_0xd1d4('0x3f')];return db[_0xd1d4('0xa9')][_0xd1d4('0x5b')]({'where':{'messageId':_0x582d54[_0xd1d4('0x5c')][0x0][_0xd1d4('0x27')]['id']}});}break;case _0xd1d4('0x92'):if(_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0xd0')]&&_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0x2a')]){_0x239f06=_0x582d54[_0xd1d4('0x5c')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x582d54['body'][_0xd1d4('0xd0')]}});}break;}}})[_0xd1d4('0x20')](handleEntityNotFound(_0x2ce397,null))[_0xd1d4('0x20')](function(_0x573dda){if(_0x573dda){_0x4a82be=_0x573dda;switch(_0xe6cee8[_0xd1d4('0x3f')]){case _0xd1d4('0xca'):if(_0x239f06==='DELIVERED'){return _0x4a82be[_0xd1d4('0x35')]({'read':!![]});}else{logger[_0xd1d4('0x25')](_0xd1d4('0xb4'),_0xd1d4('0x2a'),_0xd1d4('0xca'),util['inspect'](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x239f06==='1'){return _0x4a82be[_0xd1d4('0x35')]({'read':!![]});}else{logger[_0xd1d4('0x25')](_0xd1d4('0xb4'),_0xd1d4('0x2a'),_0xd1d4('0xca'),util[_0xd1d4('0xc9')](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xd1d4('0x85'):if(!_0x582d54['body'][_0xd1d4('0xd1')]&&_0x239f06>=0xc8&&_0x239f06<=0xce){return _0x4a82be['update']({'read':!![]});}else{logger[_0xd1d4('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd1d4('0x2a'),'clicksend',util['inspect'](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xd1d4('0x89'):var _0xc6942d=_0x582d54[_0xd1d4('0x5c')][_0xd1d4('0x8a')][0x0];if(_0xc6942d['status']['groupName']==='DELIVERED'){return _0x4a82be[_0xd1d4('0x35')]({'read':!![]});}else{logger['error'](_0xd1d4('0xb4'),_0xd1d4('0x2a'),'infobip',util[_0xd1d4('0xc9')](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xd1d4('0x8e'):if(_0x239f06==_0xd1d4('0xd2')||_0x239f06==_0xd1d4('0xd3')){return _0x4a82be['update']({'read':!![]});}else{logger['error'](_0xd1d4('0xb4'),_0xd1d4('0x2a'),_0xd1d4('0x8e'),util['inspect'](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xd1d4('0x91'):if(_0x239f06==_0xd1d4('0xd4')){return _0x4a82be[_0xd1d4('0x35')]({'read':!![]});}else{logger[_0xd1d4('0x25')](_0xd1d4('0xb4'),_0xd1d4('0x2a'),'bandwidth',util['inspect'](_0x582d54['body'],{'showHidden':![],'depth':null}));}break;case _0xd1d4('0x92'):if(_0x239f06==='DELIVRD'||_0x239f06===_0xd1d4('0xd5')){return _0x4a82be[_0xd1d4('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util[_0xd1d4('0xc9')](_0x582d54[_0xd1d4('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4a82be;}})[_0xd1d4('0x20')](respondWithResult(_0x2ce397,null))['catch'](handleError(_0x2ce397,null));};exports['statusGet']=function(_0x190b0d,_0x599ec0,_0x272459){var _0x2dba71,_0x386149,_0x248e05;return db['SmsAccount'][_0xd1d4('0x5b')]({'where':{'id':_0x190b0d[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x599ec0,null))[_0xd1d4('0x20')](function(_0x36b934){if(_0x36b934){_0x248e05=_0x36b934;logger[_0xd1d4('0x23')](_0xd1d4('0xb4'),'status',_0xd1d4('0xc8'),_0x36b934['type'],util[_0xd1d4('0xc9')](_0x190b0d[_0xd1d4('0x43')],{'showHidden':![],'depth':null}));switch(_0x36b934[_0xd1d4('0x3f')]){case'csc':if(_0x190b0d[_0xd1d4('0x43')]['message-id']&&_0x190b0d[_0xd1d4('0x43')][_0xd1d4('0xd6')]){_0x386149=_0x190b0d['query']['state'];return db['SmsMessage'][_0xd1d4('0x5b')]({'where':{'messageId':_0x190b0d[_0xd1d4('0x43')][_0xd1d4('0xd7')]}});}break;}}})[_0xd1d4('0x20')](handleEntityNotFound(_0x599ec0,null))[_0xd1d4('0x20')](function(_0x1f305b){if(_0x1f305b){_0x2dba71=_0x1f305b;switch(_0x248e05['type']){case _0xd1d4('0x8b'):if(_0x386149==='2'||_0x386149==='6'){return _0x2dba71[_0xd1d4('0x35')]({'read':!![]});}else{logger[_0xd1d4('0x25')](_0xd1d4('0xb4'),_0xd1d4('0x2a'),_0xd1d4('0x8b'),util[_0xd1d4('0xc9')](_0x190b0d['query'],{'showHidden':![],'depth':null}));};break;}return _0x2dba71;}})[_0xd1d4('0x20')](respondWithResult(_0x599ec0,null))[_0xd1d4('0x28')](handleError(_0x599ec0,null));};exports[_0xd1d4('0xd8')]=function(_0x59e993,_0x1fb2c4,_0xbbf348){return db[_0xd1d4('0x3e')][_0xd1d4('0x5b')]({'where':{'id':_0x59e993[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x1fb2c4,null))[_0xd1d4('0x20')](function(_0x240338){if(_0x240338){return _0x240338['addAgents'](_0x59e993[_0xd1d4('0x5c')]['ids'],_['omit'](_0x59e993[_0xd1d4('0x5c')],['ids','id'])||{})[_0xd1d4('0xa2')](function(_0x207955){for(var _0x1e17a8=0x0;_0x1e17a8<_0x59e993[_0xd1d4('0x5c')][_0xd1d4('0x6e')][_0xd1d4('0x48')];_0x1e17a8+=0x1){socket[_0xd1d4('0xd9')](_0xd1d4('0xda'),{'UserId':Number(_0x59e993[_0xd1d4('0x5c')][_0xd1d4('0x6e')][_0x1e17a8]),'SmsAccountId':Number(_0x59e993[_0xd1d4('0x55')]['id'])});}return _0x207955;});}})[_0xd1d4('0x20')](respondWithResult(_0x1fb2c4,null))[_0xd1d4('0x28')](handleError(_0x1fb2c4,null));};exports[_0xd1d4('0xdb')]=function(_0x1a0894,_0x37b199,_0x55e745){return db[_0xd1d4('0x3e')]['find']({'where':{'id':_0x1a0894[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x37b199,null))['then'](function(_0x4a8068){if(_0x4a8068){return _0x4a8068['removeAgents'](_0x1a0894[_0xd1d4('0x43')][_0xd1d4('0x6e')])['then'](function(){if(_[_0xd1d4('0xdc')](_0x1a0894['query'][_0xd1d4('0x6e')])){for(var _0x3732ec=0x0;_0x3732ec<_0x1a0894[_0xd1d4('0x43')][_0xd1d4('0x6e')][_0xd1d4('0x48')];_0x3732ec+=0x1){socket[_0xd1d4('0xd9')](_0xd1d4('0xdd'),{'UserId':Number(_0x1a0894['query'][_0xd1d4('0x6e')][_0x3732ec]),'SmsAccountId':Number(_0x1a0894['params']['id'])});}}else{socket[_0xd1d4('0xd9')]('userSmsAccount:remove',{'UserId':Number(_0x1a0894['query'][_0xd1d4('0x6e')]),'SmsAccountId':Number(_0x1a0894['params']['id'])});}});}})[_0xd1d4('0x20')](respondWithStatusCode(_0x37b199,null))[_0xd1d4('0x28')](handleError(_0x37b199,null));};exports[_0xd1d4('0xde')]=function(_0x43b7b6,_0x3fbd29,_0x3b09a8){var _0x216776={};var _0x3ac59f={};var _0x12e121;var _0x4952b6;return db['SmsAccount']['findOne']({'where':{'id':_0x43b7b6[_0xd1d4('0x55')]['id']}})[_0xd1d4('0x20')](handleEntityNotFound(_0x3fbd29,null))['then'](function(_0xff1876){if(_0xff1876){_0x12e121=_0xff1876;_0x3ac59f[_0xd1d4('0x41')]=_[_0xd1d4('0x58')](db[_0xd1d4('0xad')][_0xd1d4('0x59')]);_0x3ac59f[_0xd1d4('0x43')]=_[_0xd1d4('0x58')](_0x43b7b6[_0xd1d4('0x43')]);_0x3ac59f[_0xd1d4('0x44')]=_[_0xd1d4('0x45')](_0x3ac59f[_0xd1d4('0x41')],_0x3ac59f[_0xd1d4('0x43')]);_0x216776['attributes']=_[_0xd1d4('0x45')](_0x3ac59f[_0xd1d4('0x41')],qs[_0xd1d4('0x47')](_0x43b7b6[_0xd1d4('0x43')]['fields']));_0x216776['attributes']=_0x216776[_0xd1d4('0x46')][_0xd1d4('0x48')]?_0x216776['attributes']:_0x3ac59f['model'];_0x216776[_0xd1d4('0x4a')]=qs['sort'](_0x43b7b6[_0xd1d4('0x43')][_0xd1d4('0x4b')]);_0x216776[_0xd1d4('0x4c')]=qs[_0xd1d4('0x44')](_['pick'](_0x43b7b6[_0xd1d4('0x43')],_0x3ac59f[_0xd1d4('0x44')]));if(_0x43b7b6[_0xd1d4('0x43')]['filter']){_0x216776[_0xd1d4('0x4c')]=_[_0xd1d4('0x4f')](_0x216776['where'],{'$or':_[_0xd1d4('0x42')](_0x216776[_0xd1d4('0x46')],function(_0x2a3683){var _0x588612={};_0x588612[_0x2a3683]={'$like':'%'+_0x43b7b6[_0xd1d4('0x43')][_0xd1d4('0x4e')]+'%'};return _0x588612;})});}_0x216776=_[_0xd1d4('0x4f')]({},_0x216776,_0x43b7b6[_0xd1d4('0x50')]);return _0x12e121['getAgents'](_0x216776);}})[_0xd1d4('0x20')](function(_0x348795){if(_0x348795){_0x4952b6=_0x348795[_0xd1d4('0x48')];if(!_0x43b7b6[_0xd1d4('0x43')]['hasOwnProperty']('nolimit')){_0x216776[_0xd1d4('0x2d')]=qs[_0xd1d4('0x2d')](_0x43b7b6[_0xd1d4('0x43')][_0xd1d4('0x2d')]);_0x216776[_0xd1d4('0x2f')]=qs['offset'](_0x43b7b6[_0xd1d4('0x43')][_0xd1d4('0x2f')]);}return _0x12e121['getAgents'](_0x216776);}})[_0xd1d4('0x20')](function(_0x4998ed){if(_0x4998ed){return _0x4998ed?{'count':_0x4952b6,'rows':_0x4998ed}:null;}})[_0xd1d4('0x20')](respondWithResult(_0x3fbd29,null))[_0xd1d4('0x28')](handleError(_0x3fbd29,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 91bc07b..483b904 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 _0x05fc=['remove','emit','hasOwnProperty','events','../../mysqldb','SmsAccount','save','update'];(function(_0x565837,_0x12104f){var _0x1c30b1=function(_0x1f70eb){while(--_0x1f70eb){_0x565837['push'](_0x565837['shift']());}};_0x1c30b1(++_0x12104f);}(_0x05fc,0xb3));var _0xc05f=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x05fc[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0xc05f('0x0'));var SmsAccount=require(_0xc05f('0x1'))['db'][_0xc05f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc05f('0x3'),'afterUpdate':_0xc05f('0x4'),'afterDestroy':_0xc05f('0x5')};function emitEvent(_0x2b101b){return function(_0x14bf0e,_0x576542,_0x204791){SmsAccountEvents[_0xc05f('0x6')](_0x2b101b+':'+_0x14bf0e['id'],_0x14bf0e);SmsAccountEvents[_0xc05f('0x6')](_0x2b101b,_0x14bf0e);_0x204791(null);};}for(var e in events){if(events[_0xc05f('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xf44e=['hook','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x24f5b1,_0x350007){var _0x451a13=function(_0x30d668){while(--_0x30d668){_0x24f5b1['push'](_0x24f5b1['shift']());}};_0x451a13(++_0x350007);}(_0xf44e,0xc9));var _0xef44=function(_0x1c986c,_0x48f730){_0x1c986c=_0x1c986c-0x0;var _0xc6e84d=_0xf44e[_0x1c986c];return _0xc6e84d;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xef44('0x0'))['db'][_0xef44('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xef44('0x2')](0x0);var events={'afterCreate':_0xef44('0x3'),'afterUpdate':_0xef44('0x4'),'afterDestroy':_0xef44('0x5')};function emitEvent(_0x173869){return function(_0x4b0369,_0x9b60ca,_0x3bdb77){SmsAccountEvents[_0xef44('0x6')](_0x173869+':'+_0x4b0369['id'],_0x4b0369);SmsAccountEvents['emit'](_0x173869,_0x4b0369);_0x3bdb77(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xef44('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index eb8cc07..565eff0 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 _0xa66e=['../../config/environment','./smsAccount.attributes','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xa66e,0xf4));var _0xea66=function(_0x2f921b,_0x4d227e){_0x2f921b=_0x2f921b-0x0;var _0x160c17=_0xa66e[_0x2f921b];return _0x160c17;};'use strict';var _=require(_0xea66('0x0'));var util=require(_0xea66('0x1'));var logger=require(_0xea66('0x2'))(_0xea66('0x3'));var moment=require(_0xea66('0x4'));var BPromise=require(_0xea66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea66('0x6'));var rimraf=require(_0xea66('0x7'));var config=require(_0xea66('0x8'));var attributes=require(_0xea66('0x9'));module['exports']=function(_0x256407,_0x20a440){return _0x256407['define'](_0xea66('0xa'),attributes,{'tableName':_0xea66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4607=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsAccount'];(function(_0x224db1,_0x35299a){var _0x5e6f4e=function(_0x3db7fd){while(--_0x3db7fd){_0x224db1['push'](_0x224db1['shift']());}};_0x5e6f4e(++_0x35299a);}(_0x4607,0xf0));var _0x7460=function(_0x160d30,_0x5bf05f){_0x160d30=_0x160d30-0x0;var _0x256036=_0x4607[_0x160d30];return _0x256036;};'use strict';var _=require('lodash');var util=require(_0x7460('0x0'));var logger=require(_0x7460('0x1'))('api');var moment=require(_0x7460('0x2'));var BPromise=require(_0x7460('0x3'));var rp=require(_0x7460('0x4'));var fs=require('fs');var path=require(_0x7460('0x5'));var rimraf=require('rimraf');var config=require(_0x7460('0x6'));var attributes=require('./smsAccount.attributes');module[_0x7460('0x7')]=function(_0x198b02,_0x16cc97){return _0x198b02[_0x7460('0x8')](_0x7460('0x9'),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 869512f..aaa5e87 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 _0xe745=['attributes','map','ShowSmsAccount','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SmsAccount','find','options','raw','where','include','model'];(function(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0xe745,0x1e5));var _0x5e74=function(_0x3e9fc4,_0x4ad680){_0x3e9fc4=_0x3e9fc4-0x0;var _0x4d9cdd=_0xe745[_0x3e9fc4];return _0x4d9cdd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e74('0x0'));var BPromise=require(_0x5e74('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e74('0x2'));var db=require(_0x5e74('0x3'))['db'];var utils=require(_0x5e74('0x4'));var logger=require('../../config/logger')(_0x5e74('0x5'));var config=require(_0x5e74('0x6'));var jayson=require(_0x5e74('0x7'));var client=jayson[_0x5e74('0x8')][_0x5e74('0x9')]({'port':0x232a});config[_0x5e74('0xa')]=_['defaults'](config['redis'],{'host':_0x5e74('0xb'),'port':0x18eb});var socket=require(_0x5e74('0xc'))(new Redis(config[_0x5e74('0xa')]));require(_0x5e74('0xd'))[_0x5e74('0xe')](socket);function respondWithRpcPromise(_0x21770b,_0x365efc,_0x5c6c7f){return new BPromise(function(_0x48d403,_0x92427){return client[_0x5e74('0xf')](_0x21770b,_0x5c6c7f)[_0x5e74('0x10')](function(_0x29b67b){logger[_0x5e74('0x11')](_0x5e74('0x12'),_0x365efc,_0x5e74('0x13'));logger[_0x5e74('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x365efc,'request\x20sent',JSON[_0x5e74('0x15')](_0x29b67b));if(_0x29b67b[_0x5e74('0x16')]){if(_0x29b67b[_0x5e74('0x16')][_0x5e74('0x17')]===0x1f4){logger[_0x5e74('0x16')]('SmsAccount,\x20%s,\x20%s',_0x365efc,_0x29b67b[_0x5e74('0x16')][_0x5e74('0x18')]);return _0x92427(_0x29b67b[_0x5e74('0x16')][_0x5e74('0x18')]);}logger['error'](_0x5e74('0x12'),_0x365efc,_0x29b67b[_0x5e74('0x16')][_0x5e74('0x18')]);return _0x48d403(_0x29b67b['error']['message']);}else{logger[_0x5e74('0x11')](_0x5e74('0x12'),_0x365efc,_0x5e74('0x13'));_0x48d403(_0x29b67b[_0x5e74('0x19')][_0x5e74('0x18')]);}})['catch'](function(_0x34be38){logger['error'](_0x5e74('0x12'),_0x365efc,_0x34be38);_0x92427(_0x34be38);});});}exports['ShowSmsAccount']=function(_0x30b2c6){var _0x36cce0=this;return new Promise(function(_0x3fafa1,_0x231da5){return db[_0x5e74('0x1a')][_0x5e74('0x1b')]({'raw':_0x30b2c6[_0x5e74('0x1c')]?_0x30b2c6[_0x5e74('0x1c')][_0x5e74('0x1d')]===undefined?!![]:![]:!![],'where':_0x30b2c6[_0x5e74('0x1c')]?_0x30b2c6['options'][_0x5e74('0x1e')]||null:null,'attributes':_0x30b2c6[_0x5e74('0x1c')]?_0x30b2c6['options']['attributes']||null:null,'include':_0x30b2c6[_0x5e74('0x1c')]?_0x30b2c6[_0x5e74('0x1c')][_0x5e74('0x1f')]?_['map'](_0x30b2c6[_0x5e74('0x1c')]['include'],function(_0x2bb777){return{'model':db[_0x2bb777[_0x5e74('0x20')]],'as':_0x2bb777['as'],'attributes':_0x2bb777[_0x5e74('0x21')],'include':_0x2bb777[_0x5e74('0x1f')]?_[_0x5e74('0x22')](_0x2bb777[_0x5e74('0x1f')],function(_0x316ae8){return{'model':db[_0x316ae8[_0x5e74('0x20')]],'as':_0x316ae8['as'],'attributes':_0x316ae8['attributes'],'include':_0x316ae8[_0x5e74('0x1f')]?_[_0x5e74('0x22')](_0x316ae8[_0x5e74('0x1f')],function(_0x157606){return{'model':db[_0x157606[_0x5e74('0x20')]],'as':_0x157606['as'],'attributes':_0x157606[_0x5e74('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5e74('0x10')](function(_0x180802){logger['info'](_0x5e74('0x23'),_0x30b2c6);logger['debug']('ShowSmsAccount',_0x30b2c6,JSON[_0x5e74('0x15')](_0x180802));_0x3fafa1(_0x180802);})[_0x5e74('0x24')](function(_0x575349){logger[_0x5e74('0x16')](_0x5e74('0x23'),_0x575349[_0x5e74('0x18')],_0x30b2c6);_0x231da5(_0x36cce0[_0x5e74('0x16')](0x1f4,_0x575349['message']));});});}; \ No newline at end of file +var _0x9b1e=['register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','options','raw','where','map','include','model','attributes','info','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9b1e,0x1b8));var _0xe9b1=function(_0x1d2524,_0x19e773){_0x1d2524=_0x1d2524-0x0;var _0x29539d=_0x9b1e[_0x1d2524];return _0x29539d;};'use strict';var _=require(_0xe9b1('0x0'));var util=require(_0xe9b1('0x1'));var moment=require(_0xe9b1('0x2'));var BPromise=require(_0xe9b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9b1('0x4'));var db=require(_0xe9b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9b1('0x6'))(_0xe9b1('0x7'));var config=require('../../config/environment');var jayson=require(_0xe9b1('0x8'));var client=jayson[_0xe9b1('0x9')][_0xe9b1('0xa')]({'port':0x232a});config[_0xe9b1('0xb')]=_[_0xe9b1('0xc')](config[_0xe9b1('0xb')],{'host':_0xe9b1('0xd'),'port':0x18eb});var socket=require(_0xe9b1('0xe'))(new Redis(config[_0xe9b1('0xb')]));require(_0xe9b1('0xf'))[_0xe9b1('0x10')](socket);function respondWithRpcPromise(_0x297e5b,_0x3d4e40,_0x3da7ad){return new BPromise(function(_0x5592a8,_0x81469c){return client[_0xe9b1('0x11')](_0x297e5b,_0x3da7ad)[_0xe9b1('0x12')](function(_0x5276af){logger['info'](_0xe9b1('0x13'),_0x3d4e40,_0xe9b1('0x14'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3d4e40,_0xe9b1('0x14'),JSON[_0xe9b1('0x15')](_0x5276af));if(_0x5276af[_0xe9b1('0x16')]){if(_0x5276af['error'][_0xe9b1('0x17')]===0x1f4){logger[_0xe9b1('0x16')](_0xe9b1('0x13'),_0x3d4e40,_0x5276af['error'][_0xe9b1('0x18')]);return _0x81469c(_0x5276af['error']['message']);}logger['error'](_0xe9b1('0x13'),_0x3d4e40,_0x5276af[_0xe9b1('0x16')]['message']);return _0x5592a8(_0x5276af[_0xe9b1('0x16')][_0xe9b1('0x18')]);}else{logger['info'](_0xe9b1('0x13'),_0x3d4e40,'request\x20sent');_0x5592a8(_0x5276af[_0xe9b1('0x19')][_0xe9b1('0x18')]);}})['catch'](function(_0xfebb0d){logger[_0xe9b1('0x16')](_0xe9b1('0x13'),_0x3d4e40,_0xfebb0d);_0x81469c(_0xfebb0d);});});}exports[_0xe9b1('0x1a')]=function(_0x5ca5fc){var _0x4a7abf=this;return new Promise(function(_0x1a3fd5,_0x31bbc9){return db[_0xe9b1('0x1b')]['find']({'raw':_0x5ca5fc[_0xe9b1('0x1c')]?_0x5ca5fc[_0xe9b1('0x1c')][_0xe9b1('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ca5fc[_0xe9b1('0x1c')]?_0x5ca5fc[_0xe9b1('0x1c')][_0xe9b1('0x1e')]||null:null,'attributes':_0x5ca5fc[_0xe9b1('0x1c')]?_0x5ca5fc[_0xe9b1('0x1c')]['attributes']||null:null,'include':_0x5ca5fc[_0xe9b1('0x1c')]?_0x5ca5fc[_0xe9b1('0x1c')]['include']?_[_0xe9b1('0x1f')](_0x5ca5fc[_0xe9b1('0x1c')][_0xe9b1('0x20')],function(_0x5bf13d){return{'model':db[_0x5bf13d[_0xe9b1('0x21')]],'as':_0x5bf13d['as'],'attributes':_0x5bf13d[_0xe9b1('0x22')],'include':_0x5bf13d[_0xe9b1('0x20')]?_[_0xe9b1('0x1f')](_0x5bf13d[_0xe9b1('0x20')],function(_0x4dc903){return{'model':db[_0x4dc903[_0xe9b1('0x21')]],'as':_0x4dc903['as'],'attributes':_0x4dc903[_0xe9b1('0x22')],'include':_0x4dc903[_0xe9b1('0x20')]?_[_0xe9b1('0x1f')](_0x4dc903[_0xe9b1('0x20')],function(_0x33fe33){return{'model':db[_0x33fe33[_0xe9b1('0x21')]],'as':_0x33fe33['as'],'attributes':_0x33fe33['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9b1('0x12')](function(_0x4cfc8a){logger[_0xe9b1('0x23')]('ShowSmsAccount',_0x5ca5fc);logger[_0xe9b1('0x24')](_0xe9b1('0x1a'),_0x5ca5fc,JSON[_0xe9b1('0x15')](_0x4cfc8a));_0x1a3fd5(_0x4cfc8a);})[_0xe9b1('0x25')](function(_0x18a0bd){logger[_0xe9b1('0x16')](_0xe9b1('0x1a'),_0x18a0bd['message'],_0x5ca5fc);_0x31bbc9(_0x4a7abf[_0xe9b1('0x16')](0x1f4,_0x18a0bd['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d98cc1c..6cf0dfa 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 173e5ff..5db2ba7 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x39414d,_0x26b932){var _0x5e2c82=function(_0x486c47){while(--_0x486c47){_0x39414d['push'](_0x39414d['shift']());}};_0x5e2c82(++_0x26b932);}(_0x3e74,0x175));var _0x43e7=function(_0xc1ab93,_0x32fce3){_0xc1ab93=_0xc1ab93-0x0;var _0x274e37=_0x3e74[_0xc1ab93];return _0x274e37;};'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 65be2a7..b6d8a1b 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 _0x15a7=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x136659,_0x661891){var _0x192cd9=function(_0x18cdf4){while(--_0x18cdf4){_0x136659['push'](_0x136659['shift']());}};_0x192cd9(++_0x661891);}(_0x15a7,0x15b));var _0x715a=function(_0x329bf2,_0x4325f1){_0x329bf2=_0x329bf2-0x0;var _0x1da227=_0x15a7[_0x329bf2];return _0x1da227;};'use strict';var Sequelize=require(_0x715a('0x0'));module[_0x715a('0x1')]={'priority':{'type':Sequelize[_0x715a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x715a('0x3')],'allowNull':![],'defaultValue':_0x715a('0x4')},'appdata':{'type':Sequelize[_0x715a('0x5')]()},'description':{'type':Sequelize[_0x715a('0x3')]},'interval':{'type':Sequelize[_0x715a('0x3')],'defaultValue':_0x715a('0x6')}}; \ No newline at end of file +var _0x4cda=['sequelize','STRING','noop','TEXT'];(function(_0x440a98,_0x33d569){var _0x598c34=function(_0x18de0c){while(--_0x18de0c){_0x440a98['push'](_0x440a98['shift']());}};_0x598c34(++_0x33d569);}(_0x4cda,0x1e8));var _0xa4cd=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x4cda[_0x4ded65];return _0x5864fb;};'use strict';var Sequelize=require(_0xa4cd('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa4cd('0x1')],'allowNull':![],'defaultValue':_0xa4cd('0x2')},'appdata':{'type':Sequelize[_0xa4cd('0x3')]()},'description':{'type':Sequelize[_0xa4cd('0x1')]},'interval':{'type':Sequelize[_0xa4cd('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 33c069b..a7fbc3e 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 _0x29b4=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','merge','find','catch','body','rimraf','fast-json-patch','request-promise','moment'];(function(_0x436c74,_0x433ce7){var _0x3c3b52=function(_0x3681e9){while(--_0x3681e9){_0x436c74['push'](_0x436c74['shift']());}};_0x3c3b52(++_0x433ce7);}(_0x29b4,0x12c));var _0x429b=function(_0x5d94ae,_0x14c53c){_0x5d94ae=_0x5d94ae-0x0;var _0x22371a=_0x29b4[_0x5d94ae];return _0x22371a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x429b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x429b('0x1'));var rp=require(_0x429b('0x2'));var moment=require(_0x429b('0x3'));var BPromise=require(_0x429b('0x4'));var Mustache=require(_0x429b('0x5'));var util=require(_0x429b('0x6'));var path=require(_0x429b('0x7'));var sox=require(_0x429b('0x8'));var csv=require(_0x429b('0x9'));var ejs=require(_0x429b('0xa'));var fs=require('fs');var fs_extra=require(_0x429b('0xb'));var _=require(_0x429b('0xc'));var squel=require(_0x429b('0xd'));var crypto=require(_0x429b('0xe'));var jsforce=require(_0x429b('0xf'));var deskjs=require(_0x429b('0x10'));var toCsv=require(_0x429b('0x9'));var querystring=require(_0x429b('0x11'));var Papa=require(_0x429b('0x12'));var Redis=require('ioredis');var authService=require(_0x429b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x429b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x429b('0x15'))(_0x429b('0x16'));var utils=require(_0x429b('0x17'));var config=require(_0x429b('0x18'));var licenseUtil=require(_0x429b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36049f,_0x4dd72c){_0x4dd72c=_0x4dd72c||0xcc;return function(_0x357b3c){if(_0x357b3c){return _0x36049f['sendStatus'](_0x4dd72c);}return _0x36049f[_0x429b('0x1a')](_0x4dd72c)[_0x429b('0x1b')]();};}function respondWithResult(_0x4f55b3,_0x1f4bfc){_0x1f4bfc=_0x1f4bfc||0xc8;return function(_0x3d677d){if(_0x3d677d){return _0x4f55b3['status'](_0x1f4bfc)[_0x429b('0x1c')](_0x3d677d);}};}function respondWithFilteredResult(_0x5d4145,_0x4666ce){return function(_0x38ad8e){if(_0x38ad8e){var _0x4df093=typeof _0x4666ce[_0x429b('0x1d')]===_0x429b('0x1e')&&typeof _0x4666ce[_0x429b('0x1f')]===_0x429b('0x1e');var _0x3f2241=_0x38ad8e[_0x429b('0x20')];var _0x5e05a9=_0x4df093?0x0:_0x4666ce[_0x429b('0x1d')];var _0x5e6250=_0x4df093?_0x38ad8e[_0x429b('0x20')]:_0x4666ce[_0x429b('0x1d')]+_0x4666ce[_0x429b('0x1f')];var _0x134e86;if(_0x5e6250>=_0x3f2241){_0x5e6250=_0x3f2241;_0x134e86=0xc8;}else{_0x134e86=0xce;}_0x5d4145[_0x429b('0x1a')](_0x134e86);return _0x5d4145[_0x429b('0x21')](_0x429b('0x22'),_0x5e05a9+'-'+_0x5e6250+'/'+_0x3f2241)[_0x429b('0x1c')](_0x38ad8e);}return null;};}function patchUpdates(_0x134f4b){return function(_0xf39018){try{jsonpatch[_0x429b('0x23')](_0xf39018,_0x134f4b,!![]);}catch(_0x128531){return BPromise[_0x429b('0x24')](_0x128531);}return _0xf39018['save']();};}function saveUpdates(_0x35fbc2,_0x289644){return function(_0x249897){if(_0x249897){return _0x249897[_0x429b('0x25')](_0x35fbc2)[_0x429b('0x26')](function(_0x35ebb0){return _0x35ebb0;});}return null;};}function removeEntity(_0x39c616,_0x34a519){return function(_0x3d5162){if(_0x3d5162){return _0x3d5162[_0x429b('0x27')]()[_0x429b('0x26')](function(){_0x39c616[_0x429b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0e7b,_0x56e63e){return function(_0xddb383){if(!_0xddb383){_0x3e0e7b[_0x429b('0x28')](0x194);}return _0xddb383;};}function handleError(_0x4a50e7,_0x4883b7){_0x4883b7=_0x4883b7||0x1f4;return function(_0x48f211){logger[_0x429b('0x29')](_0x48f211[_0x429b('0x2a')]);if(_0x48f211[_0x429b('0x2b')]){delete _0x48f211['name'];}_0x4a50e7[_0x429b('0x1a')](_0x4883b7)[_0x429b('0x2c')](_0x48f211);};}exports[_0x429b('0x2d')]=function(_0x4d7a4d,_0x64623e){var _0x357a77={},_0x1a15ba={},_0x26518b={'count':0x0,'rows':[]};var _0x484782=_[_0x429b('0x2e')](db[_0x429b('0x2f')][_0x429b('0x30')],function(_0x75067a){return{'name':_0x75067a[_0x429b('0x31')],'type':_0x75067a['type'][_0x429b('0x32')]};});_0x1a15ba[_0x429b('0x33')]=_[_0x429b('0x2e')](_0x484782,_0x429b('0x2b'));_0x1a15ba[_0x429b('0x34')]=_[_0x429b('0x35')](_0x4d7a4d[_0x429b('0x34')]);_0x1a15ba[_0x429b('0x36')]=_[_0x429b('0x37')](_0x1a15ba[_0x429b('0x33')],_0x1a15ba[_0x429b('0x34')]);_0x357a77[_0x429b('0x38')]=_['intersection'](_0x1a15ba[_0x429b('0x33')],qs[_0x429b('0x39')](_0x4d7a4d[_0x429b('0x34')][_0x429b('0x39')]));_0x357a77[_0x429b('0x38')]=_0x357a77[_0x429b('0x38')][_0x429b('0x3a')]?_0x357a77[_0x429b('0x38')]:_0x1a15ba[_0x429b('0x33')];if(!_0x4d7a4d[_0x429b('0x34')]['hasOwnProperty'](_0x429b('0x3b'))){_0x357a77['limit']=qs[_0x429b('0x1f')](_0x4d7a4d[_0x429b('0x34')][_0x429b('0x1f')]);_0x357a77[_0x429b('0x1d')]=qs[_0x429b('0x1d')](_0x4d7a4d[_0x429b('0x34')][_0x429b('0x1d')]);}_0x357a77[_0x429b('0x3c')]=qs[_0x429b('0x3d')](_0x4d7a4d['query'][_0x429b('0x3d')]);_0x357a77[_0x429b('0x3e')]=qs[_0x429b('0x36')](_[_0x429b('0x3f')](_0x4d7a4d[_0x429b('0x34')],_0x1a15ba[_0x429b('0x36')]),_0x484782);if(_0x4d7a4d[_0x429b('0x34')][_0x429b('0x40')]){_0x357a77[_0x429b('0x3e')]=_['merge'](_0x357a77['where'],{'$or':_['map'](_0x484782,function(_0xed3d2c){if(_0xed3d2c['type']!=='VIRTUAL'){var _0x3a5547={};_0x3a5547[_0xed3d2c['name']]={'$like':'%'+_0x4d7a4d[_0x429b('0x34')][_0x429b('0x40')]+'%'};return _0x3a5547;}})});}_0x357a77=_['merge']({},_0x357a77,_0x4d7a4d[_0x429b('0x41')]);var _0x14d936={'where':_0x357a77[_0x429b('0x3e')]};return db[_0x429b('0x2f')][_0x429b('0x20')](_0x14d936)['then'](function(_0x4ba9e0){_0x26518b[_0x429b('0x20')]=_0x4ba9e0;if(_0x4d7a4d[_0x429b('0x34')][_0x429b('0x42')]){_0x357a77[_0x429b('0x43')]=[{'all':!![]}];}return db[_0x429b('0x2f')][_0x429b('0x44')](_0x357a77);})['then'](function(_0x58b71d){_0x26518b[_0x429b('0x45')]=_0x58b71d;return _0x26518b;})[_0x429b('0x26')](respondWithFilteredResult(_0x64623e,_0x357a77))['catch'](handleError(_0x64623e,null));};exports[_0x429b('0x46')]=function(_0xd549e3,_0x36e080){var _0x6fef1a={'raw':!![],'where':{'id':_0xd549e3[_0x429b('0x47')]['id']}},_0x342c30={};_0x342c30['model']=_[_0x429b('0x35')](db['SmsApplication']['rawAttributes']);_0x342c30[_0x429b('0x34')]=_['keys'](_0xd549e3[_0x429b('0x34')]);_0x342c30[_0x429b('0x36')]=_['intersection'](_0x342c30[_0x429b('0x33')],_0x342c30['query']);_0x6fef1a[_0x429b('0x38')]=_[_0x429b('0x37')](_0x342c30[_0x429b('0x33')],qs[_0x429b('0x39')](_0xd549e3[_0x429b('0x34')][_0x429b('0x39')]));_0x6fef1a[_0x429b('0x38')]=_0x6fef1a['attributes'][_0x429b('0x3a')]?_0x6fef1a['attributes']:_0x342c30['model'];if(_0xd549e3[_0x429b('0x34')][_0x429b('0x42')]){_0x6fef1a[_0x429b('0x43')]=[{'all':!![]}];}_0x6fef1a=_[_0x429b('0x48')]({},_0x6fef1a,_0xd549e3[_0x429b('0x41')]);return db[_0x429b('0x2f')][_0x429b('0x49')](_0x6fef1a)[_0x429b('0x26')](handleEntityNotFound(_0x36e080,null))[_0x429b('0x26')](respondWithResult(_0x36e080,null))[_0x429b('0x4a')](handleError(_0x36e080,null));};exports['create']=function(_0x4cb9f5,_0x1b2b60){return db[_0x429b('0x2f')]['create'](_0x4cb9f5[_0x429b('0x4b')],{})[_0x429b('0x26')](respondWithResult(_0x1b2b60,0xc9))[_0x429b('0x4a')](handleError(_0x1b2b60,null));};exports[_0x429b('0x25')]=function(_0x13099c,_0xf6ac1b){if(_0x13099c[_0x429b('0x4b')]['id']){delete _0x13099c[_0x429b('0x4b')]['id'];}return db[_0x429b('0x2f')][_0x429b('0x49')]({'where':{'id':_0x13099c[_0x429b('0x47')]['id']}})[_0x429b('0x26')](handleEntityNotFound(_0xf6ac1b,null))[_0x429b('0x26')](saveUpdates(_0x13099c[_0x429b('0x4b')],null))[_0x429b('0x26')](respondWithResult(_0xf6ac1b,null))[_0x429b('0x4a')](handleError(_0xf6ac1b,null));};exports['destroy']=function(_0x2dbcee,_0x4b2574){return db['SmsApplication'][_0x429b('0x49')]({'where':{'id':_0x2dbcee[_0x429b('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b2574,null))[_0x429b('0x26')](removeEntity(_0x4b2574,null))[_0x429b('0x4a')](handleError(_0x4b2574,null));}; \ No newline at end of file +var _0xb877=['fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','name','send','map','SmsApplication','rawAttributes'];(function(_0x1737cc,_0x594a67){var _0xed2213=function(_0x282236){while(--_0x282236){_0x1737cc['push'](_0x1737cc['shift']());}};_0xed2213(++_0x594a67);}(_0xb877,0x170));var _0x7b87=function(_0x56407b,_0x1188f3){_0x56407b=_0x56407b-0x0;var _0x4f0ef2=_0xb877[_0x56407b];return _0x4f0ef2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b87('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b87('0x1'));var rp=require('request-promise');var moment=require(_0x7b87('0x2'));var BPromise=require(_0x7b87('0x3'));var Mustache=require('mustache');var util=require(_0x7b87('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x7b87('0x5'));var ejs=require(_0x7b87('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7b87('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7b87('0x8'));var toCsv=require(_0x7b87('0x5'));var querystring=require(_0x7b87('0x9'));var Papa=require(_0x7b87('0xa'));var Redis=require(_0x7b87('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x7b87('0xc'));var as=require(_0x7b87('0xd'));var hardwareService=require(_0x7b87('0xe'));var logger=require(_0x7b87('0xf'))(_0x7b87('0x10'));var utils=require(_0x7b87('0x11'));var config=require(_0x7b87('0x12'));var licenseUtil=require(_0x7b87('0x13'));var db=require(_0x7b87('0x14'))['db'];function respondWithStatusCode(_0x18245b,_0x569658){_0x569658=_0x569658||0xcc;return function(_0x5d16d3){if(_0x5d16d3){return _0x18245b[_0x7b87('0x15')](_0x569658);}return _0x18245b[_0x7b87('0x16')](_0x569658)[_0x7b87('0x17')]();};}function respondWithResult(_0x3d732e,_0x57f083){_0x57f083=_0x57f083||0xc8;return function(_0xfd52a9){if(_0xfd52a9){return _0x3d732e[_0x7b87('0x16')](_0x57f083)[_0x7b87('0x18')](_0xfd52a9);}};}function respondWithFilteredResult(_0x252131,_0x1ef5a8){return function(_0xd58f25){if(_0xd58f25){var _0x47e6f1=typeof _0x1ef5a8[_0x7b87('0x19')]===_0x7b87('0x1a')&&typeof _0x1ef5a8[_0x7b87('0x1b')]===_0x7b87('0x1a');var _0x8c5a11=_0xd58f25[_0x7b87('0x1c')];var _0x58d5aa=_0x47e6f1?0x0:_0x1ef5a8[_0x7b87('0x19')];var _0x2bc951=_0x47e6f1?_0xd58f25['count']:_0x1ef5a8[_0x7b87('0x19')]+_0x1ef5a8[_0x7b87('0x1b')];var _0x5efbe5;if(_0x2bc951>=_0x8c5a11){_0x2bc951=_0x8c5a11;_0x5efbe5=0xc8;}else{_0x5efbe5=0xce;}_0x252131[_0x7b87('0x16')](_0x5efbe5);return _0x252131[_0x7b87('0x1d')]('Content-Range',_0x58d5aa+'-'+_0x2bc951+'/'+_0x8c5a11)['json'](_0xd58f25);}return null;};}function patchUpdates(_0x5b4445){return function(_0x1e0406){try{jsonpatch[_0x7b87('0x1e')](_0x1e0406,_0x5b4445,!![]);}catch(_0x2f32bb){return BPromise[_0x7b87('0x1f')](_0x2f32bb);}return _0x1e0406['save']();};}function saveUpdates(_0x5c53be,_0x48434d){return function(_0x7b2597){if(_0x7b2597){return _0x7b2597[_0x7b87('0x20')](_0x5c53be)[_0x7b87('0x21')](function(_0x1bf1d1){return _0x1bf1d1;});}return null;};}function removeEntity(_0x5bff3c,_0x1dd585){return function(_0x9e5b0){if(_0x9e5b0){return _0x9e5b0['destroy']()[_0x7b87('0x21')](function(){_0x5bff3c[_0x7b87('0x16')](0xcc)[_0x7b87('0x17')]();});}};}function handleEntityNotFound(_0x387d7e,_0x4192df){return function(_0x4401f7){if(!_0x4401f7){_0x387d7e[_0x7b87('0x15')](0x194);}return _0x4401f7;};}function handleError(_0x475e81,_0x67d165){_0x67d165=_0x67d165||0x1f4;return function(_0x442239){logger[_0x7b87('0x22')](_0x442239['stack']);if(_0x442239[_0x7b87('0x23')]){delete _0x442239[_0x7b87('0x23')];}_0x475e81[_0x7b87('0x16')](_0x67d165)[_0x7b87('0x24')](_0x442239);};}exports['index']=function(_0xe15415,_0x9709cf){var _0x117980={},_0x1ce73a={},_0x30551a={'count':0x0,'rows':[]};var _0xf584cf=_[_0x7b87('0x25')](db[_0x7b87('0x26')][_0x7b87('0x27')],function(_0x52fc12){return{'name':_0x52fc12[_0x7b87('0x28')],'type':_0x52fc12[_0x7b87('0x29')]['key']};});_0x1ce73a['model']=_[_0x7b87('0x25')](_0xf584cf,_0x7b87('0x23'));_0x1ce73a[_0x7b87('0x2a')]=_[_0x7b87('0x2b')](_0xe15415[_0x7b87('0x2a')]);_0x1ce73a[_0x7b87('0x2c')]=_[_0x7b87('0x2d')](_0x1ce73a[_0x7b87('0x2e')],_0x1ce73a[_0x7b87('0x2a')]);_0x117980[_0x7b87('0x2f')]=_[_0x7b87('0x2d')](_0x1ce73a['model'],qs[_0x7b87('0x30')](_0xe15415[_0x7b87('0x2a')][_0x7b87('0x30')]));_0x117980['attributes']=_0x117980[_0x7b87('0x2f')]['length']?_0x117980[_0x7b87('0x2f')]:_0x1ce73a[_0x7b87('0x2e')];if(!_0xe15415['query'][_0x7b87('0x31')]('nolimit')){_0x117980[_0x7b87('0x1b')]=qs['limit'](_0xe15415[_0x7b87('0x2a')][_0x7b87('0x1b')]);_0x117980[_0x7b87('0x19')]=qs['offset'](_0xe15415[_0x7b87('0x2a')][_0x7b87('0x19')]);}_0x117980[_0x7b87('0x32')]=qs[_0x7b87('0x33')](_0xe15415['query'][_0x7b87('0x33')]);_0x117980['where']=qs[_0x7b87('0x2c')](_['pick'](_0xe15415[_0x7b87('0x2a')],_0x1ce73a[_0x7b87('0x2c')]),_0xf584cf);if(_0xe15415['query'][_0x7b87('0x34')]){_0x117980['where']=_[_0x7b87('0x35')](_0x117980['where'],{'$or':_['map'](_0xf584cf,function(_0x1d9a50){if(_0x1d9a50[_0x7b87('0x29')]!==_0x7b87('0x36')){var _0x41ea1a={};_0x41ea1a[_0x1d9a50[_0x7b87('0x23')]]={'$like':'%'+_0xe15415['query'][_0x7b87('0x34')]+'%'};return _0x41ea1a;}})});}_0x117980=_[_0x7b87('0x35')]({},_0x117980,_0xe15415[_0x7b87('0x37')]);var _0x5d5240={'where':_0x117980[_0x7b87('0x38')]};return db[_0x7b87('0x26')]['count'](_0x5d5240)['then'](function(_0x3c7c29){_0x30551a[_0x7b87('0x1c')]=_0x3c7c29;if(_0xe15415['query'][_0x7b87('0x39')]){_0x117980[_0x7b87('0x3a')]=[{'all':!![]}];}return db[_0x7b87('0x26')][_0x7b87('0x3b')](_0x117980);})[_0x7b87('0x21')](function(_0x5d947c){_0x30551a[_0x7b87('0x3c')]=_0x5d947c;return _0x30551a;})[_0x7b87('0x21')](respondWithFilteredResult(_0x9709cf,_0x117980))[_0x7b87('0x3d')](handleError(_0x9709cf,null));};exports[_0x7b87('0x3e')]=function(_0x4ea771,_0x44f6fe){var _0x5a1ffd={'raw':!![],'where':{'id':_0x4ea771[_0x7b87('0x3f')]['id']}},_0x141c38={};_0x141c38[_0x7b87('0x2e')]=_[_0x7b87('0x2b')](db[_0x7b87('0x26')][_0x7b87('0x27')]);_0x141c38['query']=_[_0x7b87('0x2b')](_0x4ea771[_0x7b87('0x2a')]);_0x141c38['filters']=_[_0x7b87('0x2d')](_0x141c38[_0x7b87('0x2e')],_0x141c38[_0x7b87('0x2a')]);_0x5a1ffd[_0x7b87('0x2f')]=_[_0x7b87('0x2d')](_0x141c38[_0x7b87('0x2e')],qs[_0x7b87('0x30')](_0x4ea771[_0x7b87('0x2a')]['fields']));_0x5a1ffd[_0x7b87('0x2f')]=_0x5a1ffd[_0x7b87('0x2f')][_0x7b87('0x40')]?_0x5a1ffd[_0x7b87('0x2f')]:_0x141c38[_0x7b87('0x2e')];if(_0x4ea771[_0x7b87('0x2a')][_0x7b87('0x39')]){_0x5a1ffd[_0x7b87('0x3a')]=[{'all':!![]}];}_0x5a1ffd=_[_0x7b87('0x35')]({},_0x5a1ffd,_0x4ea771['options']);return db[_0x7b87('0x26')][_0x7b87('0x41')](_0x5a1ffd)[_0x7b87('0x21')](handleEntityNotFound(_0x44f6fe,null))[_0x7b87('0x21')](respondWithResult(_0x44f6fe,null))[_0x7b87('0x3d')](handleError(_0x44f6fe,null));};exports[_0x7b87('0x42')]=function(_0xc79ce3,_0x4f2758){return db[_0x7b87('0x26')]['create'](_0xc79ce3['body'],{})[_0x7b87('0x21')](respondWithResult(_0x4f2758,0xc9))[_0x7b87('0x3d')](handleError(_0x4f2758,null));};exports[_0x7b87('0x20')]=function(_0x3a8911,_0x38d1f8){if(_0x3a8911['body']['id']){delete _0x3a8911[_0x7b87('0x43')]['id'];}return db[_0x7b87('0x26')][_0x7b87('0x41')]({'where':{'id':_0x3a8911['params']['id']}})[_0x7b87('0x21')](handleEntityNotFound(_0x38d1f8,null))[_0x7b87('0x21')](saveUpdates(_0x3a8911[_0x7b87('0x43')],null))[_0x7b87('0x21')](respondWithResult(_0x38d1f8,null))[_0x7b87('0x3d')](handleError(_0x38d1f8,null));};exports['destroy']=function(_0x13cc79,_0x317630){return db['SmsApplication']['find']({'where':{'id':_0x13cc79[_0x7b87('0x3f')]['id']}})[_0x7b87('0x21')](handleEntityNotFound(_0x317630,null))[_0x7b87('0x21')](removeEntity(_0x317630,null))[_0x7b87('0x3d')](handleError(_0x317630,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2fa5308..9e977d9 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 _0xa174=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x13a5e2,_0x4e2d46){var _0x42c586=function(_0x935b12){while(--_0x935b12){_0x13a5e2['push'](_0x13a5e2['shift']());}};_0x42c586(++_0x4e2d46);}(_0xa174,0x1e1));var _0x4a17=function(_0x3417c9,_0x468faa){_0x3417c9=_0x3417c9-0x0;var _0x2407b1=_0xa174[_0x3417c9];return _0x2407b1;};'use strict';var _=require(_0x4a17('0x0'));var util=require(_0x4a17('0x1'));var logger=require(_0x4a17('0x2'))(_0x4a17('0x3'));var moment=require(_0x4a17('0x4'));var BPromise=require(_0x4a17('0x5'));var rp=require(_0x4a17('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a17('0x7'));var attributes=require('./smsApplication.attributes');module[_0x4a17('0x8')]=function(_0x40f3c7,_0x49072b){return _0x40f3c7['define'](_0x4a17('0x9'),attributes,{'tableName':_0x4a17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a17('0xb'),'collate':_0x4a17('0xc')});}; \ No newline at end of file +var _0x33c1=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x5d660b,_0x2b6023){var _0x29263a=function(_0x2320ff){while(--_0x2320ff){_0x5d660b['push'](_0x5d660b['shift']());}};_0x29263a(++_0x2b6023);}(_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':[],'timestamps':!![],'charset':_0x133c('0xc'),'collate':_0x133c('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 90ec458..0550d6d 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 _0xba5a=['error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x16a39e,_0x461134){var _0x42eceb=function(_0x4ee3a0){while(--_0x4ee3a0){_0x16a39e['push'](_0x16a39e['shift']());}};_0x42eceb(++_0x461134);}(_0xba5a,0x1d0));var _0xaba5=function(_0x56ee15,_0x1effd1){_0x56ee15=_0x56ee15-0x0;var _0x94991f=_0xba5a[_0x56ee15];return _0x94991f;};'use strict';var _=require('lodash');var util=require(_0xaba5('0x0'));var moment=require(_0xaba5('0x1'));var BPromise=require(_0xaba5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaba5('0x3'))['db'];var utils=require(_0xaba5('0x4'));var logger=require(_0xaba5('0x5'))(_0xaba5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaba5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e6b46,_0x2ef868,_0x1dba58){return new BPromise(function(_0x3772a2,_0x45f5ea){return client[_0xaba5('0x8')](_0x5e6b46,_0x1dba58)['then'](function(_0x3be776){logger[_0xaba5('0x9')](_0xaba5('0xa'),_0x2ef868,_0xaba5('0xb'));logger[_0xaba5('0xc')](_0xaba5('0xd'),_0x2ef868,_0xaba5('0xb'),JSON[_0xaba5('0xe')](_0x3be776));if(_0x3be776['error']){if(_0x3be776['error'][_0xaba5('0xf')]===0x1f4){logger['error'](_0xaba5('0xa'),_0x2ef868,_0x3be776['error']['message']);return _0x45f5ea(_0x3be776[_0xaba5('0x10')][_0xaba5('0x11')]);}logger[_0xaba5('0x10')](_0xaba5('0xa'),_0x2ef868,_0x3be776[_0xaba5('0x10')][_0xaba5('0x11')]);return _0x3772a2(_0x3be776[_0xaba5('0x10')]['message']);}else{logger['info'](_0xaba5('0xa'),_0x2ef868,_0xaba5('0xb'));_0x3772a2(_0x3be776[_0xaba5('0x12')][_0xaba5('0x11')]);}})[_0xaba5('0x13')](function(_0x53ec3c){logger[_0xaba5('0x10')]('SmsApplication,\x20%s,\x20%s',_0x2ef868,_0x53ec3c);_0x45f5ea(_0x53ec3c);});});} \ No newline at end of file +var _0x1b0e=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b0e,0x132));var _0xe1b0=function(_0x1b50b4,_0x430c58){_0x1b50b4=_0x1b50b4-0x0;var _0x72a232=_0x1b0e[_0x1b50b4];return _0x72a232;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b9f313d..d6b8c56 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 _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5f4860,_0x517bf6){var _0x31260b=function(_0x3ffaca){while(--_0x3ffaca){_0x5f4860['push'](_0x5f4860['shift']());}};_0x31260b(++_0x517bf6);}(_0x2547,0x1cd));var _0x7254=function(_0x3eb02f,_0x5f0372){_0x3eb02f=_0x3eb02f-0x0;var _0x74e00d=_0x2547[_0x3eb02f];return _0x74e00d;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file +var _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x3ab829,_0x3d3be0){var _0x549c24=function(_0x22aa0e){while(--_0x22aa0e){_0x3ab829['push'](_0x3ab829['shift']());}};_0x549c24(++_0x3d3be0);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5774af,_0x411c94){_0x5774af=_0x5774af-0x0;var _0x480589=_0x4cf8[_0x5774af];return _0x480589;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 39d8d24..c7a1ba1 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 _0xf1c6=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4cb027,_0x1ed336){var _0x172d36=function(_0x5d4c16){while(--_0x5d4c16){_0x4cb027['push'](_0x4cb027['shift']());}};_0x172d36(++_0x1ed336);}(_0xf1c6,0x145));var _0x6f1c=function(_0x258529,_0x23d6dd){_0x258529=_0x258529-0x0;var _0x95ee25=_0xf1c6[_0x258529];return _0x95ee25;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x6f1c('0x0')]={'closed':{'type':Sequelize[_0x6f1c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6f1c('0x2')]},'disposition':{'type':Sequelize[_0x6f1c('0x3')]},'secondDisposition':{'type':Sequelize[_0x6f1c('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x6f1c('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x6f1c('0x4')]('in',_0x6f1c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6f1c('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6f1c('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf3ff=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0xf3ff,0xae));var _0xff3f=function(_0x30d976,_0x1df614){_0x30d976=_0x30d976-0x0;var _0x3b6eba=_0xf3ff[_0x30d976];return _0x3b6eba;};'use strict';var Sequelize=require(_0xff3f('0x0'));var moment=require('moment');module[_0xff3f('0x1')]={'closed':{'type':Sequelize[_0xff3f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xff3f('0x3')]},'disposition':{'type':Sequelize[_0xff3f('0x4')]},'secondDisposition':{'type':Sequelize[_0xff3f('0x4')]},'thirdDisposition':{'type':Sequelize[_0xff3f('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xff3f('0x4')]},'read1stAt':{'type':Sequelize[_0xff3f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xff3f('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xff3f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xff3f('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xff3f('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 b9d83bb..2942171 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 _0xe6a5=['jsforce','querystring','papaparse','../../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','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','Users','map','fullname','TagIds','Tags','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','role','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','include','options','create','describe','SmsMessage','addMessage','ids','omit','findOne','$gte','split','format','addTags','spread','findAll','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','direction','secret','SmsAccount','get','Sms','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','System','out','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x54fe00,_0x4a6db9){var _0x4dfe88=function(_0x6747a2){while(--_0x6747a2){_0x54fe00['push'](_0x54fe00['shift']());}};_0x4dfe88(++_0x4a6db9);}(_0xe6a5,0x1c2));var _0x5e6a=function(_0x358097,_0x4fd847){_0x358097=_0x358097-0x0;var _0x32c039=_0xe6a5[_0x358097];return _0x32c039;};'use strict';var emlformat=require(_0x5e6a('0x0'));var rimraf=require(_0x5e6a('0x1'));var zipdir=require(_0x5e6a('0x2'));var jsonpatch=require(_0x5e6a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5e6a('0x4'));var Mustache=require('mustache');var util=require(_0x5e6a('0x5'));var path=require(_0x5e6a('0x6'));var sox=require(_0x5e6a('0x7'));var csv=require(_0x5e6a('0x8'));var ejs=require(_0x5e6a('0x9'));var fs=require('fs');var fs_extra=require(_0x5e6a('0xa'));var _=require(_0x5e6a('0xb'));var squel=require(_0x5e6a('0xc'));var crypto=require(_0x5e6a('0xd'));var jsforce=require(_0x5e6a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5e6a('0x8'));var querystring=require(_0x5e6a('0xf'));var Papa=require(_0x5e6a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e6a('0x11'));var as=require(_0x5e6a('0x12'));var pdf=require(_0x5e6a('0x13'));var hardwareService=require(_0x5e6a('0x14'));var logger=require(_0x5e6a('0x15'))(_0x5e6a('0x16'));var utils=require(_0x5e6a('0x17'));var config=require(_0x5e6a('0x18'));var licenseUtil=require(_0x5e6a('0x19'));var db=require(_0x5e6a('0x1a'))['db'];config[_0x5e6a('0x1b')]=_[_0x5e6a('0x1c')](config[_0x5e6a('0x1b')],{'host':_0x5e6a('0x1d'),'port':0x18eb});var socket=require(_0x5e6a('0x1e'))(new Redis(config[_0x5e6a('0x1b')]));require('./smsInteraction.socket')[_0x5e6a('0x1f')](socket);function respondWithStatusCode(_0x55c6d4,_0x47e72b){_0x47e72b=_0x47e72b||0xcc;return function(_0x2fdccc){if(_0x2fdccc){return _0x55c6d4[_0x5e6a('0x20')](_0x47e72b);}return _0x55c6d4[_0x5e6a('0x21')](_0x47e72b)[_0x5e6a('0x22')]();};}function respondWithResult(_0x2d921e,_0x52518d){_0x52518d=_0x52518d||0xc8;return function(_0x56df6a){if(_0x56df6a){return _0x2d921e[_0x5e6a('0x21')](_0x52518d)[_0x5e6a('0x23')](_0x56df6a);}};}function respondWithFilteredResult(_0x39479b,_0x597245){return function(_0x504c85){if(_0x504c85){var _0xf0c25b=typeof _0x597245['offset']===_0x5e6a('0x24')&&typeof _0x597245[_0x5e6a('0x25')]===_0x5e6a('0x24');var _0x461b16=_0x504c85[_0x5e6a('0x26')];var _0x365c37=_0xf0c25b?0x0:_0x597245[_0x5e6a('0x27')];var _0x592709=_0xf0c25b?_0x504c85[_0x5e6a('0x26')]:_0x597245[_0x5e6a('0x27')]+_0x597245[_0x5e6a('0x25')];var _0x3a8416;if(_0x592709>=_0x461b16){_0x592709=_0x461b16;_0x3a8416=0xc8;}else{_0x3a8416=0xce;}_0x39479b[_0x5e6a('0x21')](_0x3a8416);return _0x39479b['set'](_0x5e6a('0x28'),_0x365c37+'-'+_0x592709+'/'+_0x461b16)['json'](_0x504c85);}return null;};}function patchUpdates(_0x121778){return function(_0xb1acf5){try{jsonpatch[_0x5e6a('0x29')](_0xb1acf5,_0x121778,!![]);}catch(_0x470db8){return BPromise[_0x5e6a('0x2a')](_0x470db8);}return _0xb1acf5[_0x5e6a('0x2b')]();};}function saveUpdates(_0x2ba2b2,_0x2c8ceb){return function(_0x47ac1b){if(_0x47ac1b){return _0x47ac1b[_0x5e6a('0x2c')](_0x2ba2b2)[_0x5e6a('0x2d')](function(_0x2af8c2){return _0x2af8c2;});}return null;};}function removeEntity(_0x45da6f,_0x21b158){return function(_0x2601c1){if(_0x2601c1){return _0x2601c1[_0x5e6a('0x2e')]()[_0x5e6a('0x2d')](function(){_0x45da6f[_0x5e6a('0x21')](0xcc)[_0x5e6a('0x22')]();});}};}function handleEntityNotFound(_0x1d6059,_0x4863dc){return function(_0x3be300){if(!_0x3be300){_0x1d6059[_0x5e6a('0x20')](0x194);}return _0x3be300;};}function handleError(_0x37db71,_0x4890d1){_0x4890d1=_0x4890d1||0x1f4;return function(_0x326b55){logger['error'](_0x326b55['stack']);if(_0x326b55['name']){delete _0x326b55[_0x5e6a('0x2f')];}_0x37db71['status'](_0x4890d1)['send'](_0x326b55);};}function getInteractionUsers(_0x4d9538,_0xebb29a){return new BPromise(function(_0x227df2,_0x4da17a){try{if(_0xebb29a[_0x4d9538['id']]){_0x4d9538[_0x5e6a('0x30')]=_[_0x5e6a('0x31')](_0xebb29a[_0x4d9538['id']],function(_0x3a34a7){return{'id':_0x3a34a7['id'],'fullname':_0x3a34a7[_0x5e6a('0x32')]};});}}catch(_0xf070b4){_0x4da17a(_0xf070b4);}_0x227df2(_0x4d9538);});}function getInteractionTags(_0x57691a,_0x139114){return new BPromise(function(_0x1dc09d,_0x484386){try{if(_0x57691a[_0x5e6a('0x33')]){_0x57691a[_0x5e6a('0x34')]=[];_0x57691a[_0x5e6a('0x33')]['split'](',')['forEach'](function(_0x245d2f){_0x57691a[_0x5e6a('0x34')][_0x5e6a('0x35')](_0x139114[_0x245d2f]);});}delete _0x57691a[_0x5e6a('0x33')];}catch(_0x448742){_0x484386(_0x448742);}_0x1dc09d(_0x57691a);});}function updateSmsInteraction(_0x151f42,_0x158d5a,_0x5d014b){return new BPromise(function(_0x116adf,_0x759780){return getInteractionUsers(_0x151f42,_0x5d014b)[_0x5e6a('0x2d')](function(_0x46ee97){return getInteractionTags(_0x46ee97,_0x158d5a);})['then'](function(_0x4bea24){_0x116adf(_0x4bea24);})[_0x5e6a('0x36')](function(_0x45db3e){_0x759780(_0x45db3e);});});}exports[_0x5e6a('0x37')]=function(_0x1db79,_0x1f46e2){var _0x33762f={},_0x6c171e={},_0x2056d0={'count':0x0,'rows':[]};var _0x444edb=_[_0x5e6a('0x31')](db[_0x5e6a('0x38')][_0x5e6a('0x39')],function(_0x1608b7){return{'name':_0x1608b7[_0x5e6a('0x3a')],'type':_0x1608b7[_0x5e6a('0x3b')][_0x5e6a('0x3c')]};});_0x6c171e[_0x5e6a('0x3d')]=_['map'](_0x444edb,'name');_0x6c171e['query']=_[_0x5e6a('0x3e')](_0x1db79[_0x5e6a('0x3f')]);_0x6c171e[_0x5e6a('0x40')]=_[_0x5e6a('0x41')](_0x6c171e[_0x5e6a('0x3d')],_0x6c171e[_0x5e6a('0x3f')]);_0x33762f['attributes']=_[_0x5e6a('0x41')](_0x6c171e['model'],qs[_0x5e6a('0x42')](_0x1db79[_0x5e6a('0x3f')]['fields']));_0x33762f[_0x5e6a('0x43')]=_0x33762f[_0x5e6a('0x43')][_0x5e6a('0x44')]?_0x33762f[_0x5e6a('0x43')]:_0x6c171e[_0x5e6a('0x3d')];if(!_0x1db79['query'][_0x5e6a('0x45')](_0x5e6a('0x46'))){_0x33762f['limit']=qs[_0x5e6a('0x25')](_0x1db79['query'][_0x5e6a('0x25')]);_0x33762f['offset']=qs[_0x5e6a('0x27')](_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x27')]);}_0x33762f[_0x5e6a('0x47')]=qs[_0x5e6a('0x48')](_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x48')]);_0x33762f[_0x5e6a('0x49')]=qs[_0x5e6a('0x40')](_[_0x5e6a('0x4a')](_0x1db79['query'],_0x6c171e[_0x5e6a('0x40')]),_0x444edb);var _0xec9176=[];var _0x2cdcb0=squel[_0x5e6a('0x4b')]()[_0x5e6a('0x4c')]('id')[_0x5e6a('0x4c')](_0x5e6a('0x2f'))[_0x5e6a('0x4c')](_0x5e6a('0x4d'))[_0x5e6a('0x4e')]('tools_tags');var _0x10a511=squel[_0x5e6a('0x4b')]()[_0x5e6a('0x4c')](_0x5e6a('0x4f'))[_0x5e6a('0x4c')]('u.fullname')[_0x5e6a('0x4c')](_0x5e6a('0x50'))['from'](_0x5e6a('0x51'),'ui')['left_join'](_0x5e6a('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x345ec9=squel[_0x5e6a('0x4b')]()[_0x5e6a('0x4e')](_0x5e6a('0x53'),'i')[_0x5e6a('0x54')]('cm_contacts','c',_0x5e6a('0x55'))[_0x5e6a('0x54')](_0x5e6a('0x52'),'o','o.id\x20=\x20i.UserId')[_0x5e6a('0x54')](_0x5e6a('0x56'),'a',_0x5e6a('0x57'))[_0x5e6a('0x54')](_0x5e6a('0x58'),'me',_0x5e6a('0x59'))['left_join']('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x5e6a('0x5a'),'t',_0x5e6a('0x5b'));var _0x18535=squel['expr']();var _0x1b7db2=[];var _0x42c4da=squel[_0x5e6a('0x5c')]();var _0x24eeb8;if(_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x5d')]){_0x24eeb8=as['parseSearch'](_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x5d')]);var _0x33e3bf=_0x24eeb8[_0x5e6a('0x5e')];for(var _0xa63c4=0x0;_0xa63c4<_0x24eeb8['conditions'][_0x5e6a('0x44')];_0xa63c4++){var _0x51fa32=_0x24eeb8[_0x5e6a('0x5f')][_0xa63c4];var _0x569b8d='i';var _0x225d35=_[_0x5e6a('0x60')](_0x444edb,[_0x5e6a('0x2f'),_0x51fa32[_0x5e6a('0x4c')]]);if(!_0x225d35){switch(_0x51fa32['field']){case _0x5e6a('0x61'):if(_0x51fa32[_0x5e6a('0x62')]==0x1){_0x345ec9[_0x5e6a('0x63')]('`'+_0x51fa32[_0x5e6a('0x4c')]+_0x5e6a('0x64'));}else{_0x345ec9[_0x5e6a('0x63')]('`'+_0x51fa32[_0x5e6a('0x4c')]+_0x5e6a('0x65'));}break;case _0x5e6a('0x66'):if(_0x51fa32[_0x5e6a('0x67')]===_0x5e6a('0x68')){if(_0x51fa32['value']['split']('\x20')[_0x5e6a('0x44')]>0x1){_0x18535[_0x33e3bf](_0x5e6a('0x69'),qs[_0x5e6a('0x6a')](_0x51fa32[_0x5e6a('0x62')]),null);}else{var _0x4a6cad='%'+_0x51fa32['value']+'%';_0x18535[_0x33e3bf](_0x5e6a('0x6b'),_0x4a6cad,_0x4a6cad,_0x4a6cad);}}else{_0x225d35=_[_0x5e6a('0x60')](_0x444edb,[_0x5e6a('0x2f'),_0x5e6a('0x6c')]);_0x51fa32[_0x5e6a('0x4c')]=_0x5e6a('0x6c');_0x13a7c4=as[_0x5e6a('0x6d')](_0x569b8d,_0x225d35[_0x5e6a('0x3b')],_0x51fa32);_0x18535[_0x33e3bf](_0x13a7c4[_0x5e6a('0x6e')],_0x13a7c4[_0x5e6a('0x62')][_0x5e6a('0x6f')],_0x13a7c4['value'][_0x5e6a('0x22')]);}break;case _0x5e6a('0x70'):var _0x1e66f3=_0x51fa32[_0x5e6a('0x62')]['split'](',')['map'](function(_0x32fb9e){return Number(_0x32fb9e);});_0x1e66f3[_0x5e6a('0x71')](function(_0x2fcd5a){_0x42c4da['or'](_0x5e6a('0x72'),'%,'+_0x2fcd5a+',%');});_0x1b7db2=_[_0x5e6a('0x73')](_0x1b7db2,_0x1e66f3);break;case _0x5e6a('0x74'):if(_0x51fa32['operator']===_0x5e6a('0x68')){_0x18535[_0x33e3bf]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x51fa32['value']+'%',null);}else{_0x225d35=_[_0x5e6a('0x60')](_0x444edb,[_0x5e6a('0x2f'),_0x5e6a('0x75')]);_0x51fa32[_0x5e6a('0x4c')]=_0x5e6a('0x75');_0x13a7c4=as[_0x5e6a('0x6d')](_0x569b8d,_0x225d35[_0x5e6a('0x3b')],_0x51fa32);_0x18535[_0x33e3bf](_0x13a7c4[_0x5e6a('0x6e')],_0x13a7c4[_0x5e6a('0x62')]['start'],_0x13a7c4['value'][_0x5e6a('0x22')]);}break;case _0x5e6a('0x76'):_0x13a7c4=as[_0x5e6a('0x6d')]('me',null,_0x51fa32);_0x18535[_0x33e3bf](_0x13a7c4[_0x5e6a('0x6e')],_0x13a7c4[_0x5e6a('0x62')]['start'],_0x13a7c4['value']['end']);break;}}else{var _0x13a7c4=as['buildExpression'](_0x569b8d,_0x225d35[_0x5e6a('0x3b')],_0x51fa32);_0x18535[_0x33e3bf](_0x13a7c4[_0x5e6a('0x6e')],_0x13a7c4[_0x5e6a('0x62')][_0x5e6a('0x6f')],_0x13a7c4[_0x5e6a('0x62')]['end']);}}}else{var _0x1ae4ac=_(_0x1db79['query'])[_0x5e6a('0x3e')]()[_0x5e6a('0x31')](function(_0x21e477){return _[_0x5e6a('0x77')](_0x444edb,[_0x5e6a('0x2f'),_0x21e477])?_0x21e477:undefined;})[_0x5e6a('0x78')]()[_0x5e6a('0x62')]();if(!_[_0x5e6a('0x79')](_0x1ae4ac)){_0x1ae4ac['forEach'](function(_0x7d6d82){if(_0x7d6d82===_0x5e6a('0x7a')){_0x345ec9['where'](_0x5e6a('0x7b'),[][_0x5e6a('0x7c')](_0x1db79[_0x5e6a('0x3f')][_0x7d6d82]));}else if(_0x7d6d82===_0x5e6a('0x7d')){var _0x117f60=JSON['parse'](_0x1db79[_0x5e6a('0x3f')][_0x7d6d82])['$gte'];var _0x5690b7=JSON['parse'](_0x1db79[_0x5e6a('0x3f')][_0x7d6d82])[_0x5e6a('0x7e')];_0x345ec9['where'](_0x5e6a('0x7f'),_0x117f60,_0x5690b7);}else{if(_0x1db79[_0x5e6a('0x3f')][_0x7d6d82]===_0x5e6a('0x80')){_0x345ec9[_0x5e6a('0x49')]('i.'+_0x7d6d82+'\x20IS\x20NULL');}else{_0x345ec9['where']('i.'+_0x7d6d82+_0x5e6a('0x81'),_0x1db79['query'][_0x7d6d82]);}}});}if(_0x1db79['query']['read']){if(_0x1db79['query'][_0x5e6a('0x82')]==0x1){_0x345ec9[_0x5e6a('0x63')](_0x5e6a('0x83'));}else{_0x345ec9[_0x5e6a('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x1db79['query'][_0x5e6a('0x84')]){_0x1b7db2=_[_0x5e6a('0x85')](_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x84')])?_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x84')]:new Array(_0x1db79['query'][_0x5e6a('0x84')]);_0x1b7db2[_0x5e6a('0x71')](function(_0x18b916){_0x42c4da['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18b916+',%');});}if(_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x86')]){var _0x5d03e0=_0x1db79['query'][_0x5e6a('0x86')]['replace']('\x5c','\x5c\x5c')[_0x5e6a('0x87')](/'/g,'\x27\x27');if(qs[_0x5e6a('0x88')](_0x5d03e0)){_0x18535['or'](_0x5e6a('0x89'),_0x5d03e0+'%')['or']('i.phone\x20LIKE\x20?',_0x5d03e0+'%');}else{_0x18535['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5e6a('0x6a')](_0x5d03e0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5d03e0+'%');}}}_0x345ec9[_0x5e6a('0x49')](_0x18535);_0x345ec9[_0x5e6a('0x8a')](_0x5e6a('0x8b'));var _0x2cb4ec={'type':db[_0x5e6a('0x8c')][_0x5e6a('0x8d')][_0x5e6a('0x8e')],'raw':!![]};var _0x795211=_0x345ec9[_0x5e6a('0x8f')]();_0x795211['field'](_0x5e6a('0x8b'));_0x795211[_0x5e6a('0x4c')](_0x5e6a('0x90'),'unreadMessages');if(_0x33762f[_0x5e6a('0x47')]){_0x33762f[_0x5e6a('0x47')][_0x5e6a('0x71')](function(_0x1fd252){var _0x5f3356=_0x1fd252[0x0]===_0x5e6a('0x91')?_0x1fd252[0x0]:'i.'+_0x1fd252[0x0];_0x345ec9[_0x5e6a('0x47')](_0x5f3356,_0x1fd252[0x1]===_0x5e6a('0x92')?![]:!![]);});}if(!_[_0x5e6a('0x79')](_0x1b7db2)){_0x345ec9[_0x5e6a('0x63')](_0x42c4da);_0x795211[_0x5e6a('0x49')]('t.id\x20IN\x20?',_0x1b7db2);}BPromise[_0x5e6a('0x93')]()[_0x5e6a('0x2d')](function(){if(!_0x24eeb8){if(_0x1db79[_0x5e6a('0x3f')][_0x5e6a('0x7a')])return;_0x795211[_0x5e6a('0x49')](_0x5e6a('0x94'));_0x345ec9[_0x5e6a('0x49')](_0x5e6a('0x94'));return;}if(_0x1db79[_0x5e6a('0x95')]['role']!==_0x5e6a('0x96'))return;return _0x1db79[_0x5e6a('0x95')][_0x5e6a('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0xc3b2ba){if(_[_0x5e6a('0x79')](_0xc3b2ba)){_0x795211['where']('i.SmsAccountId\x20IS\x20NULL');_0x345ec9['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x795211[_0x5e6a('0x49')]('i.SmsAccountId\x20IN\x20?',_['map'](_0xc3b2ba,'id'));_0x345ec9[_0x5e6a('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0x5e6a('0x31')](_0xc3b2ba,'id'));}});})['then'](function(){if(_0x1db79[_0x5e6a('0x95')][_0x5e6a('0x98')]===_0x5e6a('0x96')&&!_0x24eeb8&&!_0x1db79[_0x5e6a('0x3f')]['SmsAccountId'])return[];return db[_0x5e6a('0x99')][_0x5e6a('0x3f')](_0x795211[_0x5e6a('0x9a')](),_0x2cb4ec);})[_0x5e6a('0x2d')](function(_0x4a6241){_0x2056d0[_0x5e6a('0x26')]=_0x4a6241[_0x5e6a('0x44')];if(_0x2056d0[_0x5e6a('0x26')]===0x0)return[];return db['sequelize'][_0x5e6a('0x3f')](_0x2cdcb0[_0x5e6a('0x9a')](),_0x2cb4ec)[_0x5e6a('0x2d')](function(_0x219bc9){_0xec9176=_['keyBy'](_0x219bc9,'id');_0x2cb4ec=_[_0x5e6a('0x9b')](_0x2cb4ec,{'model':db[_0x5e6a('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1db79['query']['fields']){_0x33762f[_0x5e6a('0x43')][_0x5e6a('0x71')](function(_0x582021){_0x345ec9[_0x5e6a('0x4c')]('i.'+_0x582021);});}else{_0x345ec9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5e6a('0x61'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0x9c'),_0x5e6a('0x9d'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0x9e'),_0x5e6a('0x9f'));_0x345ec9[_0x5e6a('0x4c')]('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',_0x5e6a('0x91'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xa0'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xa1'),_0x5e6a('0xa2'));_0x345ec9[_0x5e6a('0x4c')]('c.lastName','Contact.lastName');_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xa3'),'Contact.email');_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xa4'),_0x5e6a('0xa5'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xa6'),_0x5e6a('0xa7'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xa8'),_0x5e6a('0xa9'));_0x345ec9['field'](_0x5e6a('0xaa'),_0x5e6a('0xab'));_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xac'),'Owner.internal');_0x345ec9[_0x5e6a('0x4c')](_0x5e6a('0xad'),_0x5e6a('0x33'));}if(_0x33762f[_0x5e6a('0x25')])_0x345ec9['limit'](_0x33762f[_0x5e6a('0x25')]);if(_0x33762f[_0x5e6a('0x27')])_0x345ec9['offset'](_0x33762f[_0x5e6a('0x27')]);return db[_0x5e6a('0x99')][_0x5e6a('0x3f')](_0x345ec9[_0x5e6a('0x9a')](),_0x2cb4ec);})[_0x5e6a('0x2d')](function(_0x1e383d){if(_0x1e383d[_0x5e6a('0x44')]>0x0)_0x10a511[_0x5e6a('0x49')](_0x5e6a('0xae'),_[_0x5e6a('0x31')](_0x1e383d,'id'));return db[_0x5e6a('0x99')][_0x5e6a('0x3f')](_0x10a511[_0x5e6a('0x9a')](),_0x2cb4ec)[_0x5e6a('0x2d')](function(_0x4fa37e){var _0x57cfec=_[_0x5e6a('0xaf')](_0x4fa37e,_0x5e6a('0xb0'));var _0x589d16=[];_0x1e383d['forEach'](function(_0xfa2301){_0x589d16[_0x5e6a('0x35')](updateSmsInteraction(_0xfa2301,_0xec9176,_0x57cfec));});return BPromise[_0x5e6a('0xb1')](_0x589d16);});});})['then'](function(_0x3034c6){_0x2056d0[_0x5e6a('0xb2')]=_0x3034c6;return _0x2056d0;})['then'](respondWithFilteredResult(_0x1f46e2,_0x33762f))[_0x5e6a('0x36')](handleError(_0x1f46e2,null));};exports[_0x5e6a('0xb3')]=function(_0x555dab,_0x2e903e){var _0x44ab80={'raw':![],'where':{'id':_0x555dab[_0x5e6a('0xb4')]['id']}},_0x1b0a8f={};_0x1b0a8f[_0x5e6a('0x3d')]=_[_0x5e6a('0x3e')](db[_0x5e6a('0x38')][_0x5e6a('0x39')]);_0x1b0a8f[_0x5e6a('0x3f')]=_[_0x5e6a('0x3e')](_0x555dab['query']);_0x1b0a8f[_0x5e6a('0x40')]=_[_0x5e6a('0x41')](_0x1b0a8f[_0x5e6a('0x3d')],_0x1b0a8f[_0x5e6a('0x3f')]);_0x44ab80[_0x5e6a('0x43')]=_[_0x5e6a('0x41')](_0x1b0a8f[_0x5e6a('0x3d')],qs[_0x5e6a('0x42')](_0x555dab[_0x5e6a('0x3f')][_0x5e6a('0x42')]));_0x44ab80[_0x5e6a('0x43')]=_0x44ab80[_0x5e6a('0x43')][_0x5e6a('0x44')]?_0x44ab80['attributes']:_0x1b0a8f[_0x5e6a('0x3d')];if(_0x555dab[_0x5e6a('0x3f')]['includeAll']){_0x44ab80[_0x5e6a('0xb5')]=[{'all':!![]}];}_0x44ab80=_[_0x5e6a('0x9b')]({},_0x44ab80,_0x555dab[_0x5e6a('0xb6')]);return db[_0x5e6a('0x38')]['find'](_0x44ab80)[_0x5e6a('0x2d')](handleEntityNotFound(_0x2e903e,null))[_0x5e6a('0x2d')](respondWithResult(_0x2e903e,null))[_0x5e6a('0x36')](handleError(_0x2e903e,null));};exports[_0x5e6a('0xb7')]=function(_0x5235d9,_0x2e8a06){return db[_0x5e6a('0x38')]['create'](_0x5235d9[_0x5e6a('0x76')],{})[_0x5e6a('0x2d')](respondWithResult(_0x2e8a06,0xc9))[_0x5e6a('0x36')](handleError(_0x2e8a06,null));};exports['update']=function(_0x32fb2a,_0x328fd5){if(_0x32fb2a[_0x5e6a('0x76')]['id']){delete _0x32fb2a[_0x5e6a('0x76')]['id'];}return db[_0x5e6a('0x38')][_0x5e6a('0x60')]({'where':{'id':_0x32fb2a[_0x5e6a('0xb4')]['id']}})[_0x5e6a('0x2d')](handleEntityNotFound(_0x328fd5,null))[_0x5e6a('0x2d')](saveUpdates(_0x32fb2a[_0x5e6a('0x76')],null))[_0x5e6a('0x2d')](respondWithResult(_0x328fd5,null))[_0x5e6a('0x36')](handleError(_0x328fd5,null));};exports[_0x5e6a('0x2e')]=function(_0x43b976,_0x4cb965){return db['SmsInteraction'][_0x5e6a('0x60')]({'where':{'id':_0x43b976[_0x5e6a('0xb4')]['id']}})[_0x5e6a('0x2d')](handleEntityNotFound(_0x4cb965,null))[_0x5e6a('0x2d')](removeEntity(_0x4cb965,null))[_0x5e6a('0x36')](handleError(_0x4cb965,null));};exports['describe']=function(_0x57cf3c,_0x34b593){return db[_0x5e6a('0x38')][_0x5e6a('0xb8')]()['then'](respondWithResult(_0x34b593,null))['catch'](handleError(_0x34b593,null));};exports['addMessage']=function(_0x21a452,_0x149083,_0x355c37){return db[_0x5e6a('0xb9')][_0x5e6a('0x60')]({'where':{'id':_0x21a452[_0x5e6a('0xb4')]['id']}})[_0x5e6a('0x2d')](handleEntityNotFound(_0x149083,null))[_0x5e6a('0x2d')](function(_0x1887a5){if(_0x1887a5){return _0x1887a5[_0x5e6a('0xba')](_0x21a452[_0x5e6a('0x76')][_0x5e6a('0xbb')],_[_0x5e6a('0xbc')](_0x21a452[_0x5e6a('0x76')],[_0x5e6a('0xbb'),'id'])||{});}})[_0x5e6a('0x2d')](respondWithResult(_0x149083,null))['catch'](handleError(_0x149083,null));};exports['getMessages']=function(_0x407100,_0x4ba703,_0x581e52){var _0x30c2ff={'raw':![],'where':{}};var _0x51477e={};var _0x507083={'count':0x0,'rows':[]};return db[_0x5e6a('0x38')][_0x5e6a('0xbd')]({'where':{'id':_0x407100[_0x5e6a('0xb4')]['id']}})[_0x5e6a('0x2d')](handleEntityNotFound(_0x4ba703,null))[_0x5e6a('0x2d')](function(_0x301c39){if(_0x301c39){_0x51477e[_0x5e6a('0x3d')]=_[_0x5e6a('0x3e')](db['SmsMessage'][_0x5e6a('0x39')]);_0x51477e['query']=_[_0x5e6a('0x3e')](_0x407100['query']);_0x51477e[_0x5e6a('0x40')]=_[_0x5e6a('0x41')](_0x51477e[_0x5e6a('0x3d')],_0x51477e['query']);_0x30c2ff[_0x5e6a('0x43')]=_['intersection'](_0x51477e['model'],qs[_0x5e6a('0x42')](_0x407100[_0x5e6a('0x3f')]['fields']));_0x30c2ff['attributes']=_0x30c2ff['attributes'][_0x5e6a('0x44')]?_0x30c2ff['attributes']:_0x51477e['model'];if(!_0x407100[_0x5e6a('0x3f')][_0x5e6a('0x45')]('nolimit')){_0x30c2ff[_0x5e6a('0x25')]=qs[_0x5e6a('0x25')](_0x407100[_0x5e6a('0x3f')][_0x5e6a('0x25')]);_0x30c2ff[_0x5e6a('0x27')]=qs[_0x5e6a('0x27')](_0x407100[_0x5e6a('0x3f')]['offset']);}_0x30c2ff[_0x5e6a('0x47')]=qs[_0x5e6a('0x48')](_0x407100[_0x5e6a('0x3f')][_0x5e6a('0x48')]);_0x30c2ff[_0x5e6a('0x49')]=qs[_0x5e6a('0x40')](_['pick'](_0x407100[_0x5e6a('0x3f')],_0x51477e[_0x5e6a('0x40')]));_0x30c2ff[_0x5e6a('0x49')][_0x5e6a('0xb0')]=_0x301c39['id'];if(_0x407100[_0x5e6a('0x3f')][_0x5e6a('0x86')]){_0x30c2ff[_0x5e6a('0x49')]=_[_0x5e6a('0x9b')](_0x30c2ff[_0x5e6a('0x49')],{'$or':_[_0x5e6a('0x31')](_0x30c2ff[_0x5e6a('0x43')],function(_0x3212ad){var _0x5002ad={};_0x5002ad[_0x3212ad]={'$like':'%'+_0x407100[_0x5e6a('0x3f')][_0x5e6a('0x86')]+'%'};return _0x5002ad;})});}if(_0x407100[_0x5e6a('0x3f')][_0x5e6a('0xbe')]){var _0x2bb41f=_0x407100[_0x5e6a('0x3f')][_0x5e6a('0xbe')][_0x5e6a('0xbf')](',');var _0x4688de={};_0x4688de[_0x2bb41f[0x0]]={'$gte':moment(_0x2bb41f[0x1])[_0x5e6a('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x30c2ff['where']=_[_0x5e6a('0x9b')](_0x30c2ff[_0x5e6a('0x49')],_0x4688de);}_0x30c2ff=_[_0x5e6a('0x9b')]({},_0x30c2ff,_0x407100[_0x5e6a('0xb6')]);return db[_0x5e6a('0xb9')][_0x5e6a('0x26')]({'where':_0x30c2ff['where']})['then'](function(_0x41ae9c){_0x507083['count']=_0x41ae9c;if(_0x407100['query']['includeAll']){_0x30c2ff['include']=[{'all':!![]}];}return db[_0x5e6a('0xb9')]['findAll'](_0x30c2ff);})[_0x5e6a('0x2d')](function(_0x21f5b9){_0x507083[_0x5e6a('0xb2')]=_0x21f5b9;return _0x507083;});}})[_0x5e6a('0x2d')](respondWithFilteredResult(_0x4ba703,_0x30c2ff))['catch'](handleError(_0x4ba703,null));};exports[_0x5e6a('0xc1')]=function(_0x4f2c44,_0x176ff7,_0x3f2ead){return db['SmsInteraction'][_0x5e6a('0x60')]({'where':{'id':_0x4f2c44[_0x5e6a('0xb4')]['id']}})['then'](handleEntityNotFound(_0x176ff7,null))[_0x5e6a('0x2d')](function(_0x4d54e1){if(_0x4d54e1){return _0x4d54e1['setTags'](_0x4f2c44['body'][_0x5e6a('0xbb')],_[_0x5e6a('0xbc')](_0x4f2c44[_0x5e6a('0x76')],[_0x5e6a('0xbb'),'id'])||{})[_0x5e6a('0xc2')](function(){return db[_0x5e6a('0x70')][_0x5e6a('0xc3')]({'attributes':['id',_0x5e6a('0x2f'),_0x5e6a('0x4d')],'where':{'id':_0x4f2c44[_0x5e6a('0x76')][_0x5e6a('0xbb')]}});})[_0x5e6a('0x2d')](function(_0x4a164f){socket[_0x5e6a('0xc4')](_0x5e6a('0xc5'),{'id':Number(_0x4f2c44[_0x5e6a('0xb4')]['id']),'tags':_0x4a164f||[]});return{'id':Number(_0x4f2c44[_0x5e6a('0xb4')]['id']),'tags':_0x4a164f||[]};});}})[_0x5e6a('0x2d')](respondWithResult(_0x176ff7,null))[_0x5e6a('0x36')](handleError(_0x176ff7,null));};exports[_0x5e6a('0xc6')]=function(_0x2179e3,_0x2358c4,_0x2dcc20){return db[_0x5e6a('0x38')][_0x5e6a('0x60')]({'where':{'id':_0x2179e3['params']['id']}})[_0x5e6a('0x2d')](handleEntityNotFound(_0x2358c4,null))[_0x5e6a('0x2d')](function(_0x1bbc99){if(_0x1bbc99){return _0x1bbc99[_0x5e6a('0xc6')](_0x2179e3[_0x5e6a('0x3f')][_0x5e6a('0xbb')]);}})[_0x5e6a('0x2d')](respondWithStatusCode(_0x2358c4,null))[_0x5e6a('0x36')](handleError(_0x2358c4,null));};exports[_0x5e6a('0xc7')]=function(_0x503624,_0x5b11a7){var _0x522464=moment()[_0x5e6a('0xc8')]()['toString']();var _0x3bf295=path[_0x5e6a('0xc9')](config['root'],_0x5e6a('0xca'),_0x5e6a('0xcb'),_0x5e6a('0xcc'));var _0x463da3=path[_0x5e6a('0xc9')](config[_0x5e6a('0xcd')],_0x5e6a('0xca'),_0x5e6a('0xcb'),_0x5e6a('0xce'));var _0x38f01c=path['join'](_0x3bf295,_0x522464);var _0xd3a999=util[_0x5e6a('0xc0')](_0x5e6a('0xcf'),_0x503624[_0x5e6a('0xb4')]['id'],_0x522464);var _0x3072c0=path[_0x5e6a('0xc9')](_0x3bf295,_0xd3a999);var _0x16d5e8=[];_0x16d5e8[_0x5e6a('0x35')]({'model':db[_0x5e6a('0x74')],'as':_0x5e6a('0x74'),'attributes':['id',_0x5e6a('0x32')],'raw':!![]});_0x16d5e8['push']({'model':db[_0x5e6a('0xd0')],'as':_0x5e6a('0x66'),'attributes':['id',_0x5e6a('0xd1'),_0x5e6a('0xd2')],'raw':!![]});var _0x53eadc=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x5e6a('0x76'),_0x5e6a('0x7d'),_0x5e6a('0xd3'),_0x5e6a('0xd4'),'read'],'include':_0x16d5e8}];_0x53eadc[_0x5e6a('0x35')]({'model':db[_0x5e6a('0xd5')],'as':'Account','attributes':['id',_0x5e6a('0x2f')]});_0x53eadc[_0x5e6a('0x35')]({'model':db[_0x5e6a('0x74')],'as':'Owner','attributes':['id',_0x5e6a('0x32')]});return db[_0x5e6a('0x38')][_0x5e6a('0x60')]({'where':{'id':_0x503624['params']['id']},'include':_0x53eadc})[_0x5e6a('0x2d')](handleEntityNotFound(_0x5b11a7,null))[_0x5e6a('0x2d')](function(_0x4381d6){if(_0x4381d6){var _0x3831e3=_0x4381d6[_0x5e6a('0xd6')]({'plain':!![]});fs['mkdirSync'](_0x38f01c);var _0x40aa5f={'channel':_0x5e6a('0xd7'),'account':_0x3831e3[_0x5e6a('0xd8')][_0x5e6a('0x2f')],'agent':_0x3831e3[_0x5e6a('0xd9')]?_0x3831e3['Owner']['fullname']:_0x5e6a('0xda'),'createdAt':moment(_0x3831e3[_0x5e6a('0x7d')])[_0x5e6a('0xc0')](_0x5e6a('0xdb'))['toString'](),'closedAt':_0x3831e3[_0x5e6a('0xdc')]?moment(_0x3831e3['closedAt'])[_0x5e6a('0xc0')](_0x5e6a('0xdb'))[_0x5e6a('0x9a')]():'','disposition':_0x3831e3[_0x5e6a('0xdd')],'messages':_(_0x3831e3[_0x5e6a('0xde')])[_0x5e6a('0x86')]({'secret':![]})[_0x5e6a('0x31')](function(_0x531fd0){return{'date':moment(_0x531fd0[_0x5e6a('0x7d')])['format'](_0x5e6a('0xdb'))[_0x5e6a('0x9a')](),'sender':_0x531fd0['direction']==='out'?_0x531fd0[_0x5e6a('0x74')]?_0x531fd0[_0x5e6a('0x74')][_0x5e6a('0x32')]:_0x5e6a('0xdf'):_0x531fd0[_0x5e6a('0x66')][_0x5e6a('0xd1')]+(_0x531fd0['Contact'][_0x5e6a('0xd2')]?'\x20'+_0x531fd0[_0x5e6a('0x66')][_0x5e6a('0xd2')]:''),'body':_0x531fd0[_0x5e6a('0x76')],'direction':_0x531fd0['direction']===_0x5e6a('0xe0')?'A':'C','secret':_0x531fd0['secret'],'read':_0x531fd0[_0x5e6a('0x82')]};})[_0x5e6a('0x62')]()};return ejs['renderFile'](path[_0x5e6a('0xc9')](config[_0x5e6a('0xcd')],'server',_0x5e6a('0xe1'),_0x5e6a('0xe2')),{'interaction':_0x40aa5f})[_0x5e6a('0x2d')](function(_0x6822e7){var _0x185241=path[_0x5e6a('0xc9')](_0x38f01c,'transcript-'+_0x3831e3['id']+'-'+_0x522464+_0x5e6a('0xe3'));var _0x5234ab={'path':_0x185241,'channel':_0x5e6a('0xd7'),'interactionId':_0x3831e3['id']};return pdf[_0x5e6a('0xe4')](_0x6822e7,_0x5234ab);})[_0x5e6a('0x2d')](function(){return new BPromise(function(_0x14b706,_0x579e5b){zipdir(_0x38f01c,{'saveTo':_0x3072c0},function(_0x24163a,_0x5cb683){if(_0x24163a)return _0x579e5b(_0x24163a);return _0x14b706(_0x5cb683);});})[_0x5e6a('0x2d')](function(){return new BPromise(function(_0x564b46,_0x258f99){rimraf(_0x38f01c,function(_0x4d46b3){if(_0x4d46b3)_0x258f99(_0x4d46b3);return _0x564b46();});});})[_0x5e6a('0x2d')](function(){return _0x5b11a7['download'](_0x3072c0,_0xd3a999,function(_0x106727){if(_0x106727){console[_0x5e6a('0xe5')](_0x5e6a('0xe6'),_0x106727);}else{fs[_0x5e6a('0xe7')](_0x3072c0);}});});});}else{return _0x5b11a7[_0x5e6a('0x20')](0xc8);}})[_0x5e6a('0x36')](handleError(_0x5b11a7,null));}; \ No newline at end of file +var _0xdacf=['start','body','some','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','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.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','secret','Owner','get','mkdirSync','Sms','Account','N.A.','closed','closedAt','Messages','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text'];(function(_0x2012a1,_0x51f892){var _0x473c3d=function(_0x1836c8){while(--_0x1836c8){_0x2012a1['push'](_0x2012a1['shift']());}};_0x473c3d(++_0x51f892);}(_0xdacf,0x72));var _0xfdac=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdacf[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xfdac('0x0'));var rimraf=require(_0xfdac('0x1'));var zipdir=require(_0xfdac('0x2'));var jsonpatch=require(_0xfdac('0x3'));var rp=require(_0xfdac('0x4'));var moment=require(_0xfdac('0x5'));var BPromise=require(_0xfdac('0x6'));var Mustache=require(_0xfdac('0x7'));var util=require(_0xfdac('0x8'));var path=require(_0xfdac('0x9'));var sox=require('sox');var csv=require(_0xfdac('0xa'));var ejs=require(_0xfdac('0xb'));var fs=require('fs');var fs_extra=require(_0xfdac('0xc'));var _=require(_0xfdac('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdac('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfdac('0xa'));var querystring=require(_0xfdac('0xf'));var Papa=require(_0xfdac('0x10'));var Redis=require(_0xfdac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfdac('0x12'));var as=require(_0xfdac('0x13'));var pdf=require(_0xfdac('0x14'));var hardwareService=require(_0xfdac('0x15'));var logger=require(_0xfdac('0x16'))(_0xfdac('0x17'));var utils=require(_0xfdac('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfdac('0x19'));var db=require(_0xfdac('0x1a'))['db'];config[_0xfdac('0x1b')]=_[_0xfdac('0x1c')](config[_0xfdac('0x1b')],{'host':_0xfdac('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdac('0x1b')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2f1218,_0x54452e){_0x54452e=_0x54452e||0xcc;return function(_0x75ae3a){if(_0x75ae3a){return _0x2f1218[_0xfdac('0x1e')](_0x54452e);}return _0x2f1218[_0xfdac('0x1f')](_0x54452e)[_0xfdac('0x20')]();};}function respondWithResult(_0x38d225,_0x2b78aa){_0x2b78aa=_0x2b78aa||0xc8;return function(_0x5c266e){if(_0x5c266e){return _0x38d225[_0xfdac('0x1f')](_0x2b78aa)[_0xfdac('0x21')](_0x5c266e);}};}function respondWithFilteredResult(_0x20f52d,_0x3aaefe){return function(_0x5d3f2b){if(_0x5d3f2b){var _0x13ef05=typeof _0x3aaefe['offset']===_0xfdac('0x22')&&typeof _0x3aaefe[_0xfdac('0x23')]===_0xfdac('0x22');var _0x74ba78=_0x5d3f2b['count'];var _0x17e30d=_0x13ef05?0x0:_0x3aaefe[_0xfdac('0x24')];var _0x50a273=_0x13ef05?_0x5d3f2b[_0xfdac('0x25')]:_0x3aaefe[_0xfdac('0x24')]+_0x3aaefe['limit'];var _0x1861dd;if(_0x50a273>=_0x74ba78){_0x50a273=_0x74ba78;_0x1861dd=0xc8;}else{_0x1861dd=0xce;}_0x20f52d[_0xfdac('0x1f')](_0x1861dd);return _0x20f52d['set'](_0xfdac('0x26'),_0x17e30d+'-'+_0x50a273+'/'+_0x74ba78)[_0xfdac('0x21')](_0x5d3f2b);}return null;};}function patchUpdates(_0x3b26d5){return function(_0x328c38){try{jsonpatch[_0xfdac('0x27')](_0x328c38,_0x3b26d5,!![]);}catch(_0x241975){return BPromise[_0xfdac('0x28')](_0x241975);}return _0x328c38[_0xfdac('0x29')]();};}function saveUpdates(_0x226331,_0x252cf4){return function(_0x4aa954){if(_0x4aa954){return _0x4aa954[_0xfdac('0x2a')](_0x226331)['then'](function(_0x3a70f6){return _0x3a70f6;});}return null;};}function removeEntity(_0x47d86b,_0x24cd59){return function(_0x471ed5){if(_0x471ed5){return _0x471ed5[_0xfdac('0x2b')]()[_0xfdac('0x2c')](function(){_0x47d86b['status'](0xcc)[_0xfdac('0x20')]();});}};}function handleEntityNotFound(_0x1c52d1,_0x53eb59){return function(_0x3232d9){if(!_0x3232d9){_0x1c52d1[_0xfdac('0x1e')](0x194);}return _0x3232d9;};}function handleError(_0x8dbe57,_0x27739b){_0x27739b=_0x27739b||0x1f4;return function(_0x4227c9){logger[_0xfdac('0x2d')](_0x4227c9[_0xfdac('0x2e')]);if(_0x4227c9[_0xfdac('0x2f')]){delete _0x4227c9[_0xfdac('0x2f')];}_0x8dbe57[_0xfdac('0x1f')](_0x27739b)[_0xfdac('0x30')](_0x4227c9);};}function getInteractionUsers(_0x23612c,_0x24bd60){return new BPromise(function(_0x1c3c97,_0x2d928f){try{if(_0x24bd60[_0x23612c['id']]){_0x23612c[_0xfdac('0x31')]=_[_0xfdac('0x32')](_0x24bd60[_0x23612c['id']],function(_0x227eaf){return{'id':_0x227eaf['id'],'fullname':_0x227eaf[_0xfdac('0x33')]};});}}catch(_0x3ec134){_0x2d928f(_0x3ec134);}_0x1c3c97(_0x23612c);});}function getInteractionTags(_0x2ba214,_0x3ee8f2){return new BPromise(function(_0x3845f2,_0x36c838){try{if(_0x2ba214[_0xfdac('0x34')]){_0x2ba214[_0xfdac('0x35')]=[];_0x2ba214[_0xfdac('0x34')][_0xfdac('0x36')](',')[_0xfdac('0x37')](function(_0x264561){_0x2ba214[_0xfdac('0x35')][_0xfdac('0x38')](_0x3ee8f2[_0x264561]);});}delete _0x2ba214[_0xfdac('0x34')];}catch(_0x2cc52d){_0x36c838(_0x2cc52d);}_0x3845f2(_0x2ba214);});}function updateSmsInteraction(_0x55183b,_0x49939e,_0x4130e5){return new BPromise(function(_0x3a3531,_0x395aaa){return getInteractionUsers(_0x55183b,_0x4130e5)['then'](function(_0x9f4473){return getInteractionTags(_0x9f4473,_0x49939e);})['then'](function(_0x169a88){_0x3a3531(_0x169a88);})[_0xfdac('0x39')](function(_0x31b8ec){_0x395aaa(_0x31b8ec);});});}exports[_0xfdac('0x3a')]=function(_0x429d34,_0x4b1055){var _0x5fc6c6={},_0x117c13={},_0x538f7a={'count':0x0,'rows':[]};var _0x228f58=_[_0xfdac('0x32')](db['SmsInteraction'][_0xfdac('0x3b')],function(_0x50b506){return{'name':_0x50b506[_0xfdac('0x3c')],'type':_0x50b506[_0xfdac('0x3d')][_0xfdac('0x3e')]};});_0x117c13[_0xfdac('0x3f')]=_[_0xfdac('0x32')](_0x228f58,_0xfdac('0x2f'));_0x117c13[_0xfdac('0x40')]=_[_0xfdac('0x41')](_0x429d34[_0xfdac('0x40')]);_0x117c13[_0xfdac('0x42')]=_['intersection'](_0x117c13[_0xfdac('0x3f')],_0x117c13[_0xfdac('0x40')]);_0x5fc6c6['attributes']=_[_0xfdac('0x43')](_0x117c13['model'],qs[_0xfdac('0x44')](_0x429d34[_0xfdac('0x40')]['fields']));_0x5fc6c6[_0xfdac('0x45')]=_0x5fc6c6[_0xfdac('0x45')][_0xfdac('0x46')]?_0x5fc6c6['attributes']:_0x117c13[_0xfdac('0x3f')];if(!_0x429d34[_0xfdac('0x40')][_0xfdac('0x47')](_0xfdac('0x48'))){_0x5fc6c6[_0xfdac('0x23')]=qs[_0xfdac('0x23')](_0x429d34[_0xfdac('0x40')][_0xfdac('0x23')]);_0x5fc6c6[_0xfdac('0x24')]=qs[_0xfdac('0x24')](_0x429d34[_0xfdac('0x40')]['offset']);}_0x5fc6c6[_0xfdac('0x49')]=qs[_0xfdac('0x4a')](_0x429d34['query'][_0xfdac('0x4a')]);_0x5fc6c6[_0xfdac('0x4b')]=qs[_0xfdac('0x42')](_['pick'](_0x429d34[_0xfdac('0x40')],_0x117c13['filters']),_0x228f58);var _0xdfa88c=[];var _0x20ab93=squel[_0xfdac('0x4c')]()['field']('id')[_0xfdac('0x4d')](_0xfdac('0x2f'))[_0xfdac('0x4d')](_0xfdac('0x4e'))[_0xfdac('0x4f')](_0xfdac('0x50'));var _0xa207c9=squel[_0xfdac('0x4c')]()[_0xfdac('0x4d')](_0xfdac('0x51'))[_0xfdac('0x4d')]('u.fullname')['field']('ui.SmsInteractionId')[_0xfdac('0x4f')](_0xfdac('0x52'),'ui')[_0xfdac('0x53')](_0xfdac('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x5ebab9=squel['select']()['from'](_0xfdac('0x55'),'i')['left_join'](_0xfdac('0x56'),'c',_0xfdac('0x57'))['left_join']('users','o',_0xfdac('0x58'))[_0xfdac('0x53')]('sms_accounts','a',_0xfdac('0x59'))[_0xfdac('0x53')](_0xfdac('0x5a'),'me',_0xfdac('0x5b'))[_0xfdac('0x53')](_0xfdac('0x5c'),'it',_0xfdac('0x5d'))[_0xfdac('0x53')](_0xfdac('0x50'),'t',_0xfdac('0x5e'));var _0x53b421=squel[_0xfdac('0x5f')]();var _0x541c74=[];var _0x5b4d32=squel[_0xfdac('0x5f')]();var _0x318d0e;if(_0x429d34['query']['search']){_0x318d0e=as['parseSearch'](_0x429d34[_0xfdac('0x40')][_0xfdac('0x60')]);var _0x3a4a67=_0x318d0e[_0xfdac('0x61')];for(var _0x562923=0x0;_0x562923<_0x318d0e[_0xfdac('0x62')][_0xfdac('0x46')];_0x562923++){var _0x451159=_0x318d0e[_0xfdac('0x62')][_0x562923];var _0x5c591d='i';var _0x336d4d=_[_0xfdac('0x63')](_0x228f58,['name',_0x451159['field']]);if(!_0x336d4d){switch(_0x451159[_0xfdac('0x4d')]){case _0xfdac('0x64'):if(_0x451159[_0xfdac('0x65')]==0x1){_0x5ebab9[_0xfdac('0x66')]('`'+_0x451159['field']+_0xfdac('0x67'));}else{_0x5ebab9[_0xfdac('0x66')]('`'+_0x451159[_0xfdac('0x4d')]+_0xfdac('0x68'));}break;case _0xfdac('0x69'):if(_0x451159['operator']===_0xfdac('0x6a')){if(_0x451159[_0xfdac('0x65')][_0xfdac('0x36')]('\x20')[_0xfdac('0x46')]>0x1){_0x53b421[_0x3a4a67]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfdac('0x6b')](_0x451159[_0xfdac('0x65')]),null);}else{var _0x8e1c0='%'+_0x451159['value']+'%';_0x53b421[_0x3a4a67](_0xfdac('0x6c'),_0x8e1c0,_0x8e1c0,_0x8e1c0);}}else{_0x336d4d=_[_0xfdac('0x63')](_0x228f58,[_0xfdac('0x2f'),_0xfdac('0x6d')]);_0x451159[_0xfdac('0x4d')]=_0xfdac('0x6d');_0x4e6855=as[_0xfdac('0x6e')](_0x5c591d,_0x336d4d[_0xfdac('0x3d')],_0x451159);_0x53b421[_0x3a4a67](_0x4e6855['text'],_0x4e6855[_0xfdac('0x65')]['start'],_0x4e6855[_0xfdac('0x65')][_0xfdac('0x20')]);}break;case _0xfdac('0x6f'):var _0xa607db=_0x451159[_0xfdac('0x65')]['split'](',')[_0xfdac('0x32')](function(_0x2fab24){return Number(_0x2fab24);});_0xa607db['forEach'](function(_0x5b76f9){_0x5b4d32['or'](_0xfdac('0x70'),'%,'+_0x5b76f9+',%');});_0x541c74=_[_0xfdac('0x71')](_0x541c74,_0xa607db);break;case _0xfdac('0x72'):if(_0x451159[_0xfdac('0x73')]===_0xfdac('0x6a')){_0x53b421[_0x3a4a67](_0xfdac('0x74'),'%'+_0x451159['value']+'%',null);}else{_0x336d4d=_[_0xfdac('0x63')](_0x228f58,[_0xfdac('0x2f'),'UserId']);_0x451159[_0xfdac('0x4d')]=_0xfdac('0x75');_0x4e6855=as[_0xfdac('0x6e')](_0x5c591d,_0x336d4d[_0xfdac('0x3d')],_0x451159);_0x53b421[_0x3a4a67](_0x4e6855[_0xfdac('0x76')],_0x4e6855[_0xfdac('0x65')][_0xfdac('0x77')],_0x4e6855[_0xfdac('0x65')][_0xfdac('0x20')]);}break;case _0xfdac('0x78'):_0x4e6855=as[_0xfdac('0x6e')]('me',null,_0x451159);_0x53b421[_0x3a4a67](_0x4e6855['text'],_0x4e6855[_0xfdac('0x65')][_0xfdac('0x77')],_0x4e6855[_0xfdac('0x65')][_0xfdac('0x20')]);break;}}else{var _0x4e6855=as[_0xfdac('0x6e')](_0x5c591d,_0x336d4d[_0xfdac('0x3d')],_0x451159);_0x53b421[_0x3a4a67](_0x4e6855[_0xfdac('0x76')],_0x4e6855[_0xfdac('0x65')]['start'],_0x4e6855[_0xfdac('0x65')][_0xfdac('0x20')]);}}}else{var _0x1f6ea3=_(_0x429d34['query'])[_0xfdac('0x41')]()[_0xfdac('0x32')](function(_0x5e20d){return _[_0xfdac('0x79')](_0x228f58,['name',_0x5e20d])?_0x5e20d:undefined;})['compact']()[_0xfdac('0x65')]();if(!_[_0xfdac('0x7a')](_0x1f6ea3)){_0x1f6ea3['forEach'](function(_0x57dc53){if(_0x57dc53==='SmsAccountId'){_0x5ebab9[_0xfdac('0x4b')](_0xfdac('0x7b'),[][_0xfdac('0x7c')](_0x429d34[_0xfdac('0x40')][_0x57dc53]));}else if(_0x57dc53===_0xfdac('0x7d')){var _0x5864c7=JSON[_0xfdac('0x7e')](_0x429d34[_0xfdac('0x40')][_0x57dc53])['$gte'];var _0x35e340=JSON[_0xfdac('0x7e')](_0x429d34[_0xfdac('0x40')][_0x57dc53])['$lte'];_0x5ebab9[_0xfdac('0x4b')](_0xfdac('0x7f'),_0x5864c7,_0x35e340);}else{if(_0x429d34[_0xfdac('0x40')][_0x57dc53]===_0xfdac('0x80')){_0x5ebab9[_0xfdac('0x4b')]('i.'+_0x57dc53+_0xfdac('0x81'));}else{_0x5ebab9[_0xfdac('0x4b')]('i.'+_0x57dc53+_0xfdac('0x82'),_0x429d34[_0xfdac('0x40')][_0x57dc53]);}}});}if(_0x429d34['query']['read']){if(_0x429d34[_0xfdac('0x40')][_0xfdac('0x83')]==0x1){_0x5ebab9[_0xfdac('0x66')](_0xfdac('0x84'));}else{_0x5ebab9[_0xfdac('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x429d34['query'][_0xfdac('0x85')]){_0x541c74=_[_0xfdac('0x86')](_0x429d34[_0xfdac('0x40')][_0xfdac('0x85')])?_0x429d34[_0xfdac('0x40')][_0xfdac('0x85')]:new Array(_0x429d34[_0xfdac('0x40')]['tag']);_0x541c74[_0xfdac('0x37')](function(_0x51bd75){_0x5b4d32['or'](_0xfdac('0x70'),'%,'+_0x51bd75+',%');});}if(_0x429d34[_0xfdac('0x40')][_0xfdac('0x87')]){var _0x128173=_0x429d34[_0xfdac('0x40')][_0xfdac('0x87')][_0xfdac('0x88')]('\x5c','\x5c\x5c')[_0xfdac('0x88')](/'/g,'\x27\x27');if(qs[_0xfdac('0x89')](_0x128173)){_0x53b421['or'](_0xfdac('0x8a'),_0x128173+'%')['or'](_0xfdac('0x8b'),_0x128173+'%');}else{_0x53b421['or'](_0xfdac('0x8c'),qs['getFullTextValue'](_0x128173))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x128173+'%');}}}_0x5ebab9['where'](_0x53b421);_0x5ebab9[_0xfdac('0x8d')](_0xfdac('0x8e'));var _0x1fae56={'type':db[_0xfdac('0x8f')]['QueryTypes'][_0xfdac('0x90')],'raw':!![]};var _0x17b990=_0x5ebab9['clone']();_0x17b990['field'](_0xfdac('0x8e'));_0x17b990['field'](_0xfdac('0x91'),_0xfdac('0x64'));if(_0x5fc6c6[_0xfdac('0x49')]){_0x5fc6c6[_0xfdac('0x49')][_0xfdac('0x37')](function(_0x375650){var _0xc22e4a=_0x375650[0x0]==='contactName'?_0x375650[0x0]:'i.'+_0x375650[0x0];_0x5ebab9[_0xfdac('0x49')](_0xc22e4a,_0x375650[0x1]===_0xfdac('0x92')?![]:!![]);});}if(!_[_0xfdac('0x7a')](_0x541c74)){_0x5ebab9[_0xfdac('0x66')](_0x5b4d32);_0x17b990[_0xfdac('0x4b')]('t.id\x20IN\x20?',_0x541c74);}BPromise[_0xfdac('0x93')]()['then'](function(){if(!_0x318d0e){if(_0x429d34[_0xfdac('0x40')]['SmsAccountId'])return;_0x17b990['where'](_0xfdac('0x94'));_0x5ebab9[_0xfdac('0x4b')](_0xfdac('0x94'));return;}if(_0x429d34[_0xfdac('0x95')][_0xfdac('0x96')]!==_0xfdac('0x97'))return;return _0x429d34['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x23518c){if(_[_0xfdac('0x7a')](_0x23518c)){_0x17b990[_0xfdac('0x4b')](_0xfdac('0x98'));_0x5ebab9['where'](_0xfdac('0x98'));}else{_0x17b990[_0xfdac('0x4b')](_0xfdac('0x7b'),_[_0xfdac('0x32')](_0x23518c,'id'));_0x5ebab9[_0xfdac('0x4b')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x23518c,'id'));}});})['then'](function(){if(_0x429d34[_0xfdac('0x95')][_0xfdac('0x96')]===_0xfdac('0x97')&&!_0x318d0e&&!_0x429d34[_0xfdac('0x40')]['SmsAccountId'])return[];return db[_0xfdac('0x99')][_0xfdac('0x40')](_0x17b990[_0xfdac('0x9a')](),_0x1fae56);})[_0xfdac('0x2c')](function(_0x5b0b5c){_0x538f7a['count']=_0x5b0b5c['length'];if(_0x538f7a['count']===0x0)return[];return db[_0xfdac('0x99')]['query'](_0x20ab93[_0xfdac('0x9a')](),_0x1fae56)['then'](function(_0x5c219c){_0xdfa88c=_[_0xfdac('0x9b')](_0x5c219c,'id');_0x1fae56=_[_0xfdac('0x9c')](_0x1fae56,{'model':db[_0xfdac('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x429d34[_0xfdac('0x40')][_0xfdac('0x44')]){_0x5fc6c6[_0xfdac('0x45')][_0xfdac('0x37')](function(_0x3eb731){_0x5ebab9[_0xfdac('0x4d')]('i.'+_0x3eb731);});}else{_0x5ebab9[_0xfdac('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0x9e'),_0xfdac('0x9f'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xa0'),_0xfdac('0xa1'));_0x5ebab9[_0xfdac('0x4d')]('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',_0xfdac('0xa2'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xa3'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xa4'),'Contact.firstName');_0x5ebab9['field'](_0xfdac('0xa5'),'Contact.lastName');_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xa6'),_0xfdac('0xa7'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xa8'),_0xfdac('0xa9'));_0x5ebab9[_0xfdac('0x4d')]('c.mobile',_0xfdac('0xaa'));_0x5ebab9['field'](_0xfdac('0xab'),_0xfdac('0xac'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xad'),_0xfdac('0xae'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xaf'),_0xfdac('0xb0'));_0x5ebab9[_0xfdac('0x4d')](_0xfdac('0xb1'),_0xfdac('0x34'));}if(_0x5fc6c6[_0xfdac('0x23')])_0x5ebab9['limit'](_0x5fc6c6[_0xfdac('0x23')]);if(_0x5fc6c6[_0xfdac('0x24')])_0x5ebab9[_0xfdac('0x24')](_0x5fc6c6[_0xfdac('0x24')]);return db[_0xfdac('0x99')][_0xfdac('0x40')](_0x5ebab9[_0xfdac('0x9a')](),_0x1fae56);})[_0xfdac('0x2c')](function(_0x388aaf){if(_0x388aaf[_0xfdac('0x46')]>0x0)_0xa207c9[_0xfdac('0x4b')](_0xfdac('0xb2'),_[_0xfdac('0x32')](_0x388aaf,'id'));return db['sequelize'][_0xfdac('0x40')](_0xa207c9[_0xfdac('0x9a')](),_0x1fae56)[_0xfdac('0x2c')](function(_0x197342){var _0x4ed5bf=_[_0xfdac('0xb3')](_0x197342,_0xfdac('0xb4'));var _0x5e5e68=[];_0x388aaf[_0xfdac('0x37')](function(_0x56c5a6){_0x5e5e68[_0xfdac('0x38')](updateSmsInteraction(_0x56c5a6,_0xdfa88c,_0x4ed5bf));});return BPromise[_0xfdac('0xb5')](_0x5e5e68);});});})[_0xfdac('0x2c')](function(_0x520aa5){_0x538f7a['rows']=_0x520aa5;return _0x538f7a;})[_0xfdac('0x2c')](respondWithFilteredResult(_0x4b1055,_0x5fc6c6))[_0xfdac('0x39')](handleError(_0x4b1055,null));};exports[_0xfdac('0xb6')]=function(_0x353929,_0x11616f){var _0x224926={'raw':![],'where':{'id':_0x353929[_0xfdac('0xb7')]['id']}},_0x22938d={};_0x22938d[_0xfdac('0x3f')]=_[_0xfdac('0x41')](db[_0xfdac('0x9d')][_0xfdac('0x3b')]);_0x22938d[_0xfdac('0x40')]=_[_0xfdac('0x41')](_0x353929[_0xfdac('0x40')]);_0x22938d[_0xfdac('0x42')]=_[_0xfdac('0x43')](_0x22938d['model'],_0x22938d[_0xfdac('0x40')]);_0x224926[_0xfdac('0x45')]=_[_0xfdac('0x43')](_0x22938d['model'],qs[_0xfdac('0x44')](_0x353929[_0xfdac('0x40')]['fields']));_0x224926[_0xfdac('0x45')]=_0x224926[_0xfdac('0x45')][_0xfdac('0x46')]?_0x224926[_0xfdac('0x45')]:_0x22938d[_0xfdac('0x3f')];if(_0x353929[_0xfdac('0x40')]['includeAll']){_0x224926[_0xfdac('0xb8')]=[{'all':!![]}];}_0x224926=_[_0xfdac('0x9c')]({},_0x224926,_0x353929[_0xfdac('0xb9')]);return db['SmsInteraction'][_0xfdac('0x63')](_0x224926)[_0xfdac('0x2c')](handleEntityNotFound(_0x11616f,null))[_0xfdac('0x2c')](respondWithResult(_0x11616f,null))[_0xfdac('0x39')](handleError(_0x11616f,null));};exports[_0xfdac('0xba')]=function(_0x558982,_0x416878){return db[_0xfdac('0x9d')]['create'](_0x558982['body'],{})[_0xfdac('0x2c')](respondWithResult(_0x416878,0xc9))[_0xfdac('0x39')](handleError(_0x416878,null));};exports[_0xfdac('0x2a')]=function(_0x19071b,_0x4c26ce){if(_0x19071b[_0xfdac('0x78')]['id']){delete _0x19071b['body']['id'];}return db[_0xfdac('0x9d')]['find']({'where':{'id':_0x19071b['params']['id']}})[_0xfdac('0x2c')](handleEntityNotFound(_0x4c26ce,null))[_0xfdac('0x2c')](saveUpdates(_0x19071b[_0xfdac('0x78')],null))[_0xfdac('0x2c')](respondWithResult(_0x4c26ce,null))[_0xfdac('0x39')](handleError(_0x4c26ce,null));};exports['destroy']=function(_0x5a5069,_0x57a2d0){return db[_0xfdac('0x9d')][_0xfdac('0x63')]({'where':{'id':_0x5a5069[_0xfdac('0xb7')]['id']}})[_0xfdac('0x2c')](handleEntityNotFound(_0x57a2d0,null))[_0xfdac('0x2c')](removeEntity(_0x57a2d0,null))[_0xfdac('0x39')](handleError(_0x57a2d0,null));};exports['describe']=function(_0x1fd417,_0x4abfe2){return db['SmsInteraction'][_0xfdac('0xbb')]()[_0xfdac('0x2c')](respondWithResult(_0x4abfe2,null))[_0xfdac('0x39')](handleError(_0x4abfe2,null));};exports[_0xfdac('0xbc')]=function(_0x5eecc2,_0x554ca6,_0x296725){return db[_0xfdac('0xbd')][_0xfdac('0x63')]({'where':{'id':_0x5eecc2['params']['id']}})[_0xfdac('0x2c')](handleEntityNotFound(_0x554ca6,null))[_0xfdac('0x2c')](function(_0x5ee422){if(_0x5ee422){return _0x5ee422['addMessage'](_0x5eecc2[_0xfdac('0x78')][_0xfdac('0xbe')],_[_0xfdac('0xbf')](_0x5eecc2[_0xfdac('0x78')],[_0xfdac('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x554ca6,null))[_0xfdac('0x39')](handleError(_0x554ca6,null));};exports[_0xfdac('0xc0')]=function(_0x3e8ec5,_0x315a3a,_0x5c7bf6){var _0x158c3a={'raw':![],'where':{}};var _0x470745={};var _0x28b021={'count':0x0,'rows':[]};return db[_0xfdac('0x9d')]['findOne']({'where':{'id':_0x3e8ec5[_0xfdac('0xb7')]['id']}})[_0xfdac('0x2c')](handleEntityNotFound(_0x315a3a,null))[_0xfdac('0x2c')](function(_0x59e1d7){if(_0x59e1d7){_0x470745[_0xfdac('0x3f')]=_[_0xfdac('0x41')](db[_0xfdac('0xbd')]['rawAttributes']);_0x470745['query']=_[_0xfdac('0x41')](_0x3e8ec5[_0xfdac('0x40')]);_0x470745[_0xfdac('0x42')]=_[_0xfdac('0x43')](_0x470745[_0xfdac('0x3f')],_0x470745[_0xfdac('0x40')]);_0x158c3a[_0xfdac('0x45')]=_[_0xfdac('0x43')](_0x470745[_0xfdac('0x3f')],qs[_0xfdac('0x44')](_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0x44')]));_0x158c3a[_0xfdac('0x45')]=_0x158c3a['attributes'][_0xfdac('0x46')]?_0x158c3a[_0xfdac('0x45')]:_0x470745['model'];if(!_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0x47')](_0xfdac('0x48'))){_0x158c3a[_0xfdac('0x23')]=qs[_0xfdac('0x23')](_0x3e8ec5['query'][_0xfdac('0x23')]);_0x158c3a['offset']=qs[_0xfdac('0x24')](_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0x24')]);}_0x158c3a[_0xfdac('0x49')]=qs['sort'](_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0x4a')]);_0x158c3a['where']=qs[_0xfdac('0x42')](_[_0xfdac('0xc1')](_0x3e8ec5[_0xfdac('0x40')],_0x470745[_0xfdac('0x42')]));_0x158c3a[_0xfdac('0x4b')][_0xfdac('0xb4')]=_0x59e1d7['id'];if(_0x3e8ec5[_0xfdac('0x40')]['filter']){_0x158c3a[_0xfdac('0x4b')]=_[_0xfdac('0x9c')](_0x158c3a[_0xfdac('0x4b')],{'$or':_[_0xfdac('0x32')](_0x158c3a[_0xfdac('0x45')],function(_0x2cf1e6){var _0x1d7782={};_0x1d7782[_0x2cf1e6]={'$like':'%'+_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0x87')]+'%'};return _0x1d7782;})});}if(_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0xc2')]){var _0x5d4c48=_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0xc2')][_0xfdac('0x36')](',');var _0x180059={};_0x180059[_0x5d4c48[0x0]]={'$gte':moment(_0x5d4c48[0x1])[_0xfdac('0xc3')](_0xfdac('0xc4'))};_0x158c3a[_0xfdac('0x4b')]=_['merge'](_0x158c3a[_0xfdac('0x4b')],_0x180059);}_0x158c3a=_[_0xfdac('0x9c')]({},_0x158c3a,_0x3e8ec5[_0xfdac('0xb9')]);return db[_0xfdac('0xbd')][_0xfdac('0x25')]({'where':_0x158c3a[_0xfdac('0x4b')]})[_0xfdac('0x2c')](function(_0x327f7c){_0x28b021[_0xfdac('0x25')]=_0x327f7c;if(_0x3e8ec5[_0xfdac('0x40')][_0xfdac('0xc5')]){_0x158c3a[_0xfdac('0xb8')]=[{'all':!![]}];}return db[_0xfdac('0xbd')][_0xfdac('0xc6')](_0x158c3a);})[_0xfdac('0x2c')](function(_0x35a403){_0x28b021['rows']=_0x35a403;return _0x28b021;});}})['then'](respondWithFilteredResult(_0x315a3a,_0x158c3a))[_0xfdac('0x39')](handleError(_0x315a3a,null));};exports[_0xfdac('0xc7')]=function(_0x116502,_0x3d973b,_0x54fcf3){return db['SmsInteraction']['find']({'where':{'id':_0x116502['params']['id']}})[_0xfdac('0x2c')](handleEntityNotFound(_0x3d973b,null))['then'](function(_0x18192e){if(_0x18192e){return _0x18192e[_0xfdac('0xc8')](_0x116502[_0xfdac('0x78')]['ids'],_[_0xfdac('0xbf')](_0x116502[_0xfdac('0x78')],[_0xfdac('0xbe'),'id'])||{})['spread'](function(){return db[_0xfdac('0x6f')][_0xfdac('0xc6')]({'attributes':['id',_0xfdac('0x2f'),_0xfdac('0x4e')],'where':{'id':_0x116502[_0xfdac('0x78')][_0xfdac('0xbe')]}});})[_0xfdac('0x2c')](function(_0x197120){socket[_0xfdac('0xc9')]('smsInteractionTags:save',{'id':Number(_0x116502['params']['id']),'tags':_0x197120||[]});return{'id':Number(_0x116502[_0xfdac('0xb7')]['id']),'tags':_0x197120||[]};});}})[_0xfdac('0x2c')](respondWithResult(_0x3d973b,null))['catch'](handleError(_0x3d973b,null));};exports[_0xfdac('0xca')]=function(_0x473d4a,_0x44f93c,_0x5ad336){return db[_0xfdac('0x9d')][_0xfdac('0x63')]({'where':{'id':_0x473d4a['params']['id']}})[_0xfdac('0x2c')](handleEntityNotFound(_0x44f93c,null))['then'](function(_0x429df1){if(_0x429df1){return _0x429df1[_0xfdac('0xca')](_0x473d4a[_0xfdac('0x40')][_0xfdac('0xbe')]);}})[_0xfdac('0x2c')](respondWithStatusCode(_0x44f93c,null))[_0xfdac('0x39')](handleError(_0x44f93c,null));};exports[_0xfdac('0xcb')]=function(_0x4defc8,_0x365f74){var _0x1904f8=moment()['unix']()[_0xfdac('0x9a')]();var _0x9dc142=path[_0xfdac('0xcc')](config[_0xfdac('0xcd')],_0xfdac('0xce'),_0xfdac('0xcf'),_0xfdac('0xd0'));var _0x4a257d=path[_0xfdac('0xcc')](config[_0xfdac('0xcd')],_0xfdac('0xce'),_0xfdac('0xcf'),_0xfdac('0xd1'));var _0x3e42a4=path[_0xfdac('0xcc')](_0x9dc142,_0x1904f8);var _0xe900c0=util[_0xfdac('0xc3')](_0xfdac('0xd2'),_0x4defc8[_0xfdac('0xb7')]['id'],_0x1904f8);var _0x1b8fe2=path[_0xfdac('0xcc')](_0x9dc142,_0xe900c0);var _0x4865be=[];_0x4865be[_0xfdac('0x38')]({'model':db[_0xfdac('0x72')],'as':_0xfdac('0x72'),'attributes':['id',_0xfdac('0x33')],'raw':!![]});_0x4865be[_0xfdac('0x38')]({'model':db['CmContact'],'as':_0xfdac('0x69'),'attributes':['id',_0xfdac('0xd3'),_0xfdac('0xd4')],'raw':!![]});var _0x178db0=[{'model':db[_0xfdac('0xbd')],'as':'Messages','attributes':['id',_0xfdac('0x78'),'createdAt',_0xfdac('0xd5'),_0xfdac('0xd6'),_0xfdac('0x83')],'include':_0x4865be}];_0x178db0[_0xfdac('0x38')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xfdac('0x2f')]});_0x178db0['push']({'model':db['User'],'as':_0xfdac('0xd7'),'attributes':['id',_0xfdac('0x33')]});return db[_0xfdac('0x9d')][_0xfdac('0x63')]({'where':{'id':_0x4defc8[_0xfdac('0xb7')]['id']},'include':_0x178db0})[_0xfdac('0x2c')](handleEntityNotFound(_0x365f74,null))[_0xfdac('0x2c')](function(_0x5e9d93){if(_0x5e9d93){var _0x5d5827=_0x5e9d93[_0xfdac('0xd8')]({'plain':!![]});fs[_0xfdac('0xd9')](_0x3e42a4);var _0x25dd72={'channel':_0xfdac('0xda'),'account':_0x5d5827[_0xfdac('0xdb')][_0xfdac('0x2f')],'agent':_0x5d5827['Owner']?_0x5d5827[_0xfdac('0xd7')][_0xfdac('0x33')]:_0xfdac('0xdc'),'createdAt':moment(_0x5d5827['createdAt'])[_0xfdac('0xc3')](_0xfdac('0xc4'))['toString'](),'closedAt':_0x5d5827[_0xfdac('0xdd')]?moment(_0x5d5827[_0xfdac('0xde')])[_0xfdac('0xc3')](_0xfdac('0xc4'))[_0xfdac('0x9a')]():'','disposition':_0x5d5827['disposition'],'messages':_(_0x5d5827[_0xfdac('0xdf')])[_0xfdac('0x87')]({'secret':![]})[_0xfdac('0x32')](function(_0x47f895){return{'date':moment(_0x47f895[_0xfdac('0x7d')])[_0xfdac('0xc3')](_0xfdac('0xc4'))[_0xfdac('0x9a')](),'sender':_0x47f895['direction']==='out'?_0x47f895[_0xfdac('0x72')]?_0x47f895[_0xfdac('0x72')]['fullname']:_0xfdac('0xe0'):_0x47f895[_0xfdac('0x69')]['firstName']+(_0x47f895[_0xfdac('0x69')][_0xfdac('0xd4')]?'\x20'+_0x47f895[_0xfdac('0x69')]['lastName']:''),'body':_0x47f895[_0xfdac('0x78')],'direction':_0x47f895[_0xfdac('0xd5')]==='out'?'A':'C','secret':_0x47f895[_0xfdac('0xd6')],'read':_0x47f895[_0xfdac('0x83')]};})[_0xfdac('0x65')]()};return ejs[_0xfdac('0xe1')](path[_0xfdac('0xcc')](config[_0xfdac('0xcd')],_0xfdac('0xce'),'views',_0xfdac('0xe2')),{'interaction':_0x25dd72})[_0xfdac('0x2c')](function(_0x2403d0){var _0x5550a=path['join'](_0x3e42a4,_0xfdac('0xe3')+_0x5d5827['id']+'-'+_0x1904f8+_0xfdac('0xe4'));var _0x3628a9={'path':_0x5550a,'channel':_0xfdac('0xda'),'interactionId':_0x5d5827['id']};return pdf[_0xfdac('0xe5')](_0x2403d0,_0x3628a9);})[_0xfdac('0x2c')](function(){return new BPromise(function(_0x1b8f45,_0x30732a){zipdir(_0x3e42a4,{'saveTo':_0x1b8fe2},function(_0x3051ab,_0x2fe699){if(_0x3051ab)return _0x30732a(_0x3051ab);return _0x1b8f45(_0x2fe699);});})[_0xfdac('0x2c')](function(){return new BPromise(function(_0x2d4fc5,_0x14b189){rimraf(_0x3e42a4,function(_0x2280ec){if(_0x2280ec)_0x14b189(_0x2280ec);return _0x2d4fc5();});});})['then'](function(){return _0x365f74[_0xfdac('0xcb')](_0x1b8fe2,_0xe900c0,function(_0x5bcf8f){if(_0x5bcf8f){console[_0xfdac('0xe6')](_0xfdac('0xe7'),_0x5bcf8f);}else{fs[_0xfdac('0xe8')](_0x1b8fe2);}});});});}else{return _0x365f74['sendStatus'](0xc8);}})['catch'](handleError(_0x365f74,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 490a182..fbdcecc 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 _0x66fa=['remove','getUsers','then','setDataValue','map','findAll','emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x218065,_0x2fd55d){var _0xefc24d=function(_0x21e78f){while(--_0x21e78f){_0x218065['push'](_0x218065['shift']());}};_0xefc24d(++_0x2fd55d);}(_0x66fa,0x117));var _0xa66f=function(_0x5ae9df,_0x3be171){_0x5ae9df=_0x5ae9df-0x0;var _0x1308c1=_0x66fa[_0x5ae9df];return _0x1308c1;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var SmsInteraction=require(_0xa66f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xa66f('0x1'))['db'][_0xa66f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa66f('0x3')](0x0);var events={'afterCreate':_0xa66f('0x4'),'afterUpdate':_0xa66f('0x5'),'afterDestroy':_0xa66f('0x6')};function emitEvent(_0x3f4904){return function(_0x5ebea5,_0x4fd9d0,_0x2239d3){_0x5ebea5[_0xa66f('0x7')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x8')](function(_0x1d02fc){_0x5ebea5[_0xa66f('0x9')]('Users',_0x1d02fc[_0xa66f('0xa')](function(_0x4f6717){return{'id':_0x4f6717['id']};}));return SmsMessage[_0xa66f('0xb')]({'where':{'SmsInteractionId':_0x5ebea5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x101e10){_0x5ebea5['setDataValue']('unreadMessages',_0x101e10['length']);SmsInteractionEvents[_0xa66f('0xc')](_0x3f4904+':'+_0x5ebea5['id'],_0x5ebea5);SmsInteractionEvents[_0xa66f('0xc')](_0x3f4904,_0x5ebea5);_0x2239d3(null);})['catch'](_0x2239d3(null));};}for(var e in events){if(events[_0xa66f('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xa66f('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0xfb11=['setMaxListeners','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','SmsInteraction','../../mysqldb'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xfb11[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1fb1('0x1')];var SmsMessage=require(_0x1fb1('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1fb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x190f74){return function(_0x2ae20f,_0x5af469,_0x25d44f){_0x2ae20f[_0x1fb1('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1859da){_0x2ae20f[_0x1fb1('0x6')](_0x1fb1('0x7'),_0x1859da[_0x1fb1('0x8')](function(_0x161e1b){return{'id':_0x161e1b['id']};}));return SmsMessage[_0x1fb1('0x9')]({'where':{'SmsInteractionId':_0x2ae20f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1fb1('0xa')](function(_0x416625){_0x2ae20f[_0x1fb1('0x6')](_0x1fb1('0xb'),_0x416625['length']);SmsInteractionEvents[_0x1fb1('0xc')](_0x190f74+':'+_0x2ae20f['id'],_0x2ae20f);SmsInteractionEvents['emit'](_0x190f74,_0x2ae20f);_0x25d44f(null);})[_0x1fb1('0xd')](_0x25d44f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x1fb1('0xe')](e,emitEvent(event));}}module[_0x1fb1('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 22dc470..6244fb5 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 _0xc1d0=['define','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc1d0,0x111));var _0x0c1d=function(_0x1863fb,_0x3304d3){_0x1863fb=_0x1863fb-0x0;var _0x3c7735=_0xc1d0[_0x1863fb];return _0x3c7735;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c1d('0x0'))(_0x0c1d('0x1'));var moment=require(_0x0c1d('0x2'));var BPromise=require(_0x0c1d('0x3'));var rp=require(_0x0c1d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c1d('0x5'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x0c1d('0x6')]=function(_0x1a0f20,_0x216362){return _0x1a0f20[_0x0c1d('0x7')]('SmsInteraction',attributes,{'tableName':_0x0c1d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ad954,_0x1a9a67,_0xa21bd8){if(_0x1ad954[_0x0c1d('0x9')](_0x0c1d('0xa'))){_0x1ad954[_0x0c1d('0xb')]=moment()[_0x0c1d('0xc')](_0x0c1d('0xd'));}_0xa21bd8(null,_0x1ad954);}}});}; \ No newline at end of file +var _0x060f=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','sms_interactions','changed'];(function(_0x313acd,_0x5cd816){var _0x30693b=function(_0x21ab15){while(--_0x21ab15){_0x313acd['push'](_0x313acd['shift']());}};_0x30693b(++_0x5cd816);}(_0x060f,0xf2));var _0xf060=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x060f[_0x2dd390];return _0x3afe47;};'use strict';var _=require('lodash');var util=require(_0xf060('0x0'));var logger=require(_0xf060('0x1'))(_0xf060('0x2'));var moment=require(_0xf060('0x3'));var BPromise=require(_0xf060('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf060('0x5'));var config=require(_0xf060('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x5b9f16,_0x16c2f3){return _0x5b9f16[_0xf060('0x7')]('SmsInteraction',attributes,{'tableName':_0xf060('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a3141,_0x2c5b80,_0x4b69d4){if(_0x1a3141[_0xf060('0x9')](_0xf060('0xa'))){_0x1a3141[_0xf060('0xb')]=moment()[_0xf060('0xc')](_0xf060('0xd'));}_0x4b69d4(null,_0x1a3141);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a4974bb..2c94a18 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 _0x6cf9=['SmsInteraction,\x20%s,\x20%s','result','catch','UpdateSmsInteraction','body','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6cf9,0x1d6));var _0x96cf=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x6cf9[_0x71cd05];return _0x59c9e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x96cf('0x0'));var rs=require(_0x96cf('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96cf('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x96cf('0x3'))('rpc');var config=require(_0x96cf('0x4'));var jayson=require(_0x96cf('0x5'));var client=jayson[_0x96cf('0x6')][_0x96cf('0x7')]({'port':0x232a});config['redis']=_[_0x96cf('0x8')](config[_0x96cf('0x9')],{'host':_0x96cf('0xa'),'port':0x18eb});var socket=require(_0x96cf('0xb'))(new Redis(config[_0x96cf('0x9')]));require('./smsInteraction.socket')[_0x96cf('0xc')](socket);function respondWithRpcPromise(_0x92f6e7,_0xb8832,_0x32e984){return new BPromise(function(_0x327a6e,_0x2b49eb){return client[_0x96cf('0xd')](_0x92f6e7,_0x32e984)['then'](function(_0x53b785){logger[_0x96cf('0xe')]('SmsInteraction,\x20%s,\x20%s',_0xb8832,_0x96cf('0xf'));logger[_0x96cf('0x10')](_0x96cf('0x11'),_0xb8832,'request\x20sent',JSON[_0x96cf('0x12')](_0x53b785));if(_0x53b785[_0x96cf('0x13')]){if(_0x53b785[_0x96cf('0x13')][_0x96cf('0x14')]===0x1f4){logger[_0x96cf('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xb8832,_0x53b785['error'][_0x96cf('0x15')]);return _0x2b49eb(_0x53b785[_0x96cf('0x13')][_0x96cf('0x15')]);}logger['error'](_0x96cf('0x16'),_0xb8832,_0x53b785[_0x96cf('0x13')]['message']);return _0x327a6e(_0x53b785[_0x96cf('0x13')][_0x96cf('0x15')]);}else{logger['info'](_0x96cf('0x16'),_0xb8832,_0x96cf('0xf'));_0x327a6e(_0x53b785[_0x96cf('0x17')][_0x96cf('0x15')]);}})[_0x96cf('0x18')](function(_0x1276c6){logger[_0x96cf('0x13')](_0x96cf('0x16'),_0xb8832,_0x1276c6);_0x2b49eb(_0x1276c6);});});}exports[_0x96cf('0x19')]=function(_0x589be9){var _0x24ded9=this;return new Promise(function(_0x15717d,_0x12cce5){return db['SmsInteraction']['update'](_0x589be9[_0x96cf('0x1a')],{'raw':_0x589be9[_0x96cf('0x1b')]?_0x589be9[_0x96cf('0x1b')][_0x96cf('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x589be9['options']?_0x589be9['options'][_0x96cf('0x1d')]||null:null,'attributes':_0x589be9['options']?_0x589be9['options'][_0x96cf('0x1e')]||null:null,'limit':_0x589be9['options']?_0x589be9[_0x96cf('0x1b')][_0x96cf('0x1f')]||null:null})[_0x96cf('0x20')](function(_0x41b278){logger[_0x96cf('0xe')](_0x96cf('0x19'),_0x589be9);logger[_0x96cf('0x10')]('UpdateSmsInteraction',_0x589be9,JSON[_0x96cf('0x12')](_0x41b278));_0x15717d(_0x41b278);})[_0x96cf('0x18')](function(_0x48bff6){logger[_0x96cf('0x13')](_0x96cf('0x19'),_0x48bff6[_0x96cf('0x15')],_0x589be9);_0x12cce5(_0x24ded9[_0x96cf('0x13')](0x1f4,_0x48bff6[_0x96cf('0x15')]));});});};exports[_0x96cf('0x21')]=function(_0x28a9f2){return new Promise(function(_0x4c3ef6,_0x372acc){return db[_0x96cf('0x22')][_0x96cf('0x23')]({'where':_0x28a9f2['options']?_0x28a9f2[_0x96cf('0x1b')][_0x96cf('0x1d')]||null:null})[_0x96cf('0x20')](function(_0x1ab4bf){if(_0x1ab4bf){return _0x1ab4bf[_0x96cf('0x24')](_0x28a9f2[_0x96cf('0x1a')][_0x96cf('0x25')],_[_0x96cf('0x26')](_0x28a9f2[_0x96cf('0x1a')],['ids','id'])||{});}})[_0x96cf('0x27')](function(_0x56066d){logger[_0x96cf('0xe')]('AddTags',_0x28a9f2);logger[_0x96cf('0x10')](_0x96cf('0x28'),_0x28a9f2,JSON[_0x96cf('0x12')](_0x56066d));_0x4c3ef6(_0x56066d);})[_0x96cf('0x18')](function(_0x2379c1){logger[_0x96cf('0x13')](_0x96cf('0x28'),_0x2379c1['message'],_0x28a9f2);_0x372acc(_this['error'](0x1f4,_0x2379c1[_0x96cf('0x15')]));});});}; \ No newline at end of file +var _0xf338=['request\x20sent','debug','error','SmsInteraction,\x20%s,\x20%s','message','result','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info'];(function(_0x59e8db,_0x1db639){var _0x389d26=function(_0x17c138){while(--_0x17c138){_0x59e8db['push'](_0x59e8db['shift']());}};_0x389d26(++_0x1db639);}(_0xf338,0x16f));var _0x8f33=function(_0x3a120a,_0x1ef5b9){_0x3a120a=_0x3a120a-0x0;var _0x1cb04d=_0xf338[_0x3a120a];return _0x1cb04d;};'use strict';var _=require(_0x8f33('0x0'));var util=require(_0x8f33('0x1'));var moment=require(_0x8f33('0x2'));var BPromise=require(_0x8f33('0x3'));var rs=require(_0x8f33('0x4'));var fs=require('fs');var Redis=require(_0x8f33('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f33('0x6'));var logger=require(_0x8f33('0x7'))(_0x8f33('0x8'));var config=require('../../config/environment');var jayson=require(_0x8f33('0x9'));var client=jayson[_0x8f33('0xa')][_0x8f33('0xb')]({'port':0x232a});config[_0x8f33('0xc')]=_['defaults'](config[_0x8f33('0xc')],{'host':_0x8f33('0xd'),'port':0x18eb});var socket=require(_0x8f33('0xe'))(new Redis(config[_0x8f33('0xc')]));require(_0x8f33('0xf'))[_0x8f33('0x10')](socket);function respondWithRpcPromise(_0x586f55,_0x3e3122,_0x38ecfc){return new BPromise(function(_0x34cf05,_0x1a01d4){return client[_0x8f33('0x11')](_0x586f55,_0x38ecfc)[_0x8f33('0x12')](function(_0x8cd614){logger[_0x8f33('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x3e3122,_0x8f33('0x14'));logger[_0x8f33('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3e3122,_0x8f33('0x14'),JSON['stringify'](_0x8cd614));if(_0x8cd614[_0x8f33('0x16')]){if(_0x8cd614[_0x8f33('0x16')]['code']===0x1f4){logger[_0x8f33('0x16')](_0x8f33('0x17'),_0x3e3122,_0x8cd614[_0x8f33('0x16')][_0x8f33('0x18')]);return _0x1a01d4(_0x8cd614['error'][_0x8f33('0x18')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x3e3122,_0x8cd614[_0x8f33('0x16')][_0x8f33('0x18')]);return _0x34cf05(_0x8cd614['error'][_0x8f33('0x18')]);}else{logger[_0x8f33('0x13')](_0x8f33('0x17'),_0x3e3122,'request\x20sent');_0x34cf05(_0x8cd614[_0x8f33('0x19')][_0x8f33('0x18')]);}})['catch'](function(_0x1c73ba){logger['error'](_0x8f33('0x17'),_0x3e3122,_0x1c73ba);_0x1a01d4(_0x1c73ba);});});}exports[_0x8f33('0x1a')]=function(_0x4b6c0f){var _0x15e886=this;return new Promise(function(_0x280177,_0x5d4034){return db['SmsInteraction'][_0x8f33('0x1b')](_0x4b6c0f[_0x8f33('0x1c')],{'raw':_0x4b6c0f[_0x8f33('0x1d')]?_0x4b6c0f[_0x8f33('0x1d')][_0x8f33('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6c0f[_0x8f33('0x1d')]?_0x4b6c0f[_0x8f33('0x1d')][_0x8f33('0x1f')]||null:null,'attributes':_0x4b6c0f[_0x8f33('0x1d')]?_0x4b6c0f[_0x8f33('0x1d')][_0x8f33('0x20')]||null:null,'limit':_0x4b6c0f[_0x8f33('0x1d')]?_0x4b6c0f['options'][_0x8f33('0x21')]||null:null})[_0x8f33('0x12')](function(_0x44688a){logger['info'](_0x8f33('0x1a'),_0x4b6c0f);logger[_0x8f33('0x15')](_0x8f33('0x1a'),_0x4b6c0f,JSON[_0x8f33('0x22')](_0x44688a));_0x280177(_0x44688a);})['catch'](function(_0x4e95a0){logger['error'](_0x8f33('0x1a'),_0x4e95a0['message'],_0x4b6c0f);_0x5d4034(_0x15e886[_0x8f33('0x16')](0x1f4,_0x4e95a0[_0x8f33('0x18')]));});});};exports[_0x8f33('0x23')]=function(_0x295216){return new Promise(function(_0x3192e7,_0x1f31b6){return db[_0x8f33('0x24')][_0x8f33('0x25')]({'where':_0x295216['options']?_0x295216[_0x8f33('0x1d')][_0x8f33('0x1f')]||null:null})[_0x8f33('0x12')](function(_0x299a3c){if(_0x299a3c){return _0x299a3c[_0x8f33('0x26')](_0x295216[_0x8f33('0x1c')][_0x8f33('0x27')],_[_0x8f33('0x28')](_0x295216[_0x8f33('0x1c')],[_0x8f33('0x27'),'id'])||{});}})['spread'](function(_0x20ed24){logger[_0x8f33('0x13')](_0x8f33('0x29'),_0x295216);logger[_0x8f33('0x15')]('AddTags',_0x295216,JSON['stringify'](_0x20ed24));_0x3192e7(_0x20ed24);})[_0x8f33('0x2a')](function(_0x1d1e11){logger[_0x8f33('0x16')](_0x8f33('0x29'),_0x1d1e11[_0x8f33('0x18')],_0x295216);_0x1f31b6(_this[_0x8f33('0x16')](0x1f4,_0x1d1e11[_0x8f33('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e51e76d..0bed04f 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 _0x97c8=['register','length','smsInteraction:','save','remove','removeListener'];(function(_0x3744d4,_0x4da8ee){var _0x47dfaa=function(_0x218d01){while(--_0x218d01){_0x3744d4['push'](_0x3744d4['shift']());}};_0x47dfaa(++_0x4da8ee);}(_0x97c8,0x1dd));var _0x897c=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x97c8[_0x5e8d3e];return _0x1348c0;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x897c('0x0'),_0x897c('0x1'),'update'];function createListener(_0x2dffdf,_0x1e3272){return function(_0x23f732){_0x1e3272['emit'](_0x2dffdf,_0x23f732);};}function removeListener(_0x156fbd,_0x236314){return function(){SmsInteractionEvents[_0x897c('0x2')](_0x156fbd,_0x236314);};}exports[_0x897c('0x3')]=function(_0x1c68df){for(var _0x56e0db=0x0,_0x59c686=events[_0x897c('0x4')];_0x56e0db<_0x59c686;_0x56e0db++){var _0x555bb4=events[_0x56e0db];var _0x373ba6=createListener(_0x897c('0x5')+_0x555bb4,_0x1c68df);SmsInteractionEvents['on'](_0x555bb4,_0x373ba6);}}; \ No newline at end of file +var _0xb0c8=['removeListener','register','length','./smsInteraction.events','remove','emit'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0xb0c8,0x177));var _0x8b0c=function(_0x4f7b4a,_0x5ac646){_0x4f7b4a=_0x4f7b4a-0x0;var _0x4c7ed7=_0xb0c8[_0x4f7b4a];return _0x4c7ed7;};'use strict';var SmsInteractionEvents=require(_0x8b0c('0x0'));var events=['save',_0x8b0c('0x1'),'update'];function createListener(_0x59a151,_0x3121e4){return function(_0x4b63be){_0x3121e4[_0x8b0c('0x2')](_0x59a151,_0x4b63be);};}function removeListener(_0x221b41,_0x38da41){return function(){SmsInteractionEvents[_0x8b0c('0x3')](_0x221b41,_0x38da41);};}exports[_0x8b0c('0x4')]=function(_0xed8fa6){for(var _0x559438=0x0,_0x501b56=events[_0x8b0c('0x5')];_0x559438<_0x501b56;_0x559438++){var _0x4585b9=events[_0x559438];var _0x36b7b6=createListener('smsInteraction:'+_0x4585b9,_0xed8fa6);SmsInteractionEvents['on'](_0x4585b9,_0x36b7b6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 48e260c..7ba1280 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 _0x1760=['show','post','tracked','sms','/:id/status','status','put','/:id/accept','accept','/:id/reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1760,0x11a));var _0x0176=function(_0x26712c,_0x1edca1){_0x26712c=_0x26712c-0x0;var _0x59184e=_0x1760[_0x26712c];return _0x59184e;};'use strict';var multer=require(_0x0176('0x0'));var util=require('util');var path=require(_0x0176('0x1'));var timeout=require(_0x0176('0x2'));var express=require(_0x0176('0x3'));var router=express[_0x0176('0x4')]();var fs_extra=require(_0x0176('0x5'));var auth=require(_0x0176('0x6'));var interaction=require(_0x0176('0x7'));var config=require(_0x0176('0x8'));var controller=require(_0x0176('0x9'));router[_0x0176('0xa')]('/',auth['isAuthenticated'](),controller[_0x0176('0xb')]);router[_0x0176('0xa')](_0x0176('0xc'),auth[_0x0176('0xd')](),controller['describe']);router[_0x0176('0xa')](_0x0176('0xe'),auth[_0x0176('0xd')](),controller[_0x0176('0xf')]);router[_0x0176('0x10')]('/',auth[_0x0176('0xd')](),interaction[_0x0176('0x11')](_0x0176('0x12'),'smsmessage:create'),controller['create']);router[_0x0176('0x10')](_0x0176('0x13'),controller[_0x0176('0x14')]);router['put']('/:id',auth[_0x0176('0xd')](),controller['update']);router[_0x0176('0x15')](_0x0176('0x16'),auth['isAuthenticated'](),controller[_0x0176('0x17')]);router[_0x0176('0x15')](_0x0176('0x18'),auth[_0x0176('0xd')](),controller['reject']);router['delete']('/:id',auth[_0x0176('0xd')](),controller[_0x0176('0x19')]);module[_0x0176('0x1a')]=router; \ No newline at end of file +var _0x27dd=['./smsMessage.controller','get','index','/describe','isAuthenticated','tracked','create','post','/:id/status','status','put','/:id/accept','accept','/:id/reject','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x1d7968,_0x33b238){var _0x4d9879=function(_0x3962cf){while(--_0x3962cf){_0x1d7968['push'](_0x1d7968['shift']());}};_0x4d9879(++_0x33b238);}(_0x27dd,0x177));var _0xd27d=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x27dd[_0x5d7227];return _0x15ac55;};'use strict';var multer=require(_0xd27d('0x0'));var util=require('util');var path=require(_0xd27d('0x1'));var timeout=require(_0xd27d('0x2'));var express=require(_0xd27d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd27d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd27d('0x5'));router[_0xd27d('0x6')]('/',auth['isAuthenticated'](),controller[_0xd27d('0x7')]);router[_0xd27d('0x6')](_0xd27d('0x8'),auth[_0xd27d('0x9')](),controller['describe']);router[_0xd27d('0x6')]('/:id',auth[_0xd27d('0x9')](),controller['show']);router['post']('/',auth[_0xd27d('0x9')](),interaction[_0xd27d('0xa')]('sms','smsmessage:create'),controller[_0xd27d('0xb')]);router[_0xd27d('0xc')](_0xd27d('0xd'),controller[_0xd27d('0xe')]);router[_0xd27d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['put'](_0xd27d('0x10'),auth['isAuthenticated'](),controller[_0xd27d('0x11')]);router[_0xd27d('0xf')](_0xd27d('0x12'),auth['isAuthenticated'](),controller['reject']);router['delete']('/:id',auth[_0xd27d('0x9')](),controller['destroy']);module[_0xd27d('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 50f2bd0..5fb5697 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 _0x07b5=['TEXT','ENUM','out','STRING','BOOLEAN','sequelize','exports'];(function(_0xc710eb,_0x3fde72){var _0x4d323b=function(_0x265bca){while(--_0x265bca){_0xc710eb['push'](_0xc710eb['shift']());}};_0x4d323b(++_0x3fde72);}(_0x07b5,0x10f));var _0x507b=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x07b5[_0x1559a5];return _0x17a783;};'use strict';var Sequelize=require(_0x507b('0x0'));module[_0x507b('0x1')]={'body':{'type':Sequelize[_0x507b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x507b('0x3')]('in',_0x507b('0x4')),'defaultValue':_0x507b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x507b('0x5')](0xbe)},'phone':{'type':Sequelize[_0x507b('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x507b('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x507b('0x5')]},'providerResponse':{'type':Sequelize[_0x507b('0x2')]}}; \ No newline at end of file +var _0x7f58=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT'];(function(_0x5b001c,_0x20c547){var _0x302fdd=function(_0x2b3afb){while(--_0x2b3afb){_0x5b001c['push'](_0x5b001c['shift']());}};_0x302fdd(++_0x20c547);}(_0x7f58,0xce));var _0x87f5=function(_0x53c443,_0x2a41d3){_0x53c443=_0x53c443-0x0;var _0x4de62a=_0x7f58[_0x53c443];return _0x4de62a;};'use strict';var Sequelize=require(_0x87f5('0x0'));module['exports']={'body':{'type':Sequelize[_0x87f5('0x1')](_0x87f5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x87f5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x87f5('0x4')]('in',_0x87f5('0x5')),'defaultValue':_0x87f5('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x87f5('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x87f5('0x7')]},'secret':{'type':Sequelize[_0x87f5('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x87f5('0x6')]},'providerResponse':{'type':Sequelize[_0x87f5('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3f81892..9158245 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 _0x5fa1=['findAll','rows','show','params','options','find','create','body','update','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','SELECT','contact','email','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','sendStatus','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include'];(function(_0x194773,_0x9703e3){var _0x50707e=function(_0xd3308a){while(--_0xd3308a){_0x194773['push'](_0x194773['shift']());}};_0x50707e(++_0x9703e3);}(_0x5fa1,0xd2));var _0x15fa=function(_0x1dd253,_0x2ec249){_0x1dd253=_0x1dd253-0x0;var _0xfa5005=_0x5fa1[_0x1dd253];return _0xfa5005;};'use strict';var emlformat=require(_0x15fa('0x0'));var rimraf=require(_0x15fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15fa('0x2'));var rp=require('request-promise');var moment=require(_0x15fa('0x3'));var BPromise=require(_0x15fa('0x4'));var Mustache=require(_0x15fa('0x5'));var util=require('util');var path=require('path');var sox=require(_0x15fa('0x6'));var csv=require(_0x15fa('0x7'));var ejs=require(_0x15fa('0x8'));var fs=require('fs');var fs_extra=require(_0x15fa('0x9'));var _=require('lodash');var squel=require(_0x15fa('0xa'));var crypto=require(_0x15fa('0xb'));var jsforce=require(_0x15fa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x15fa('0x7'));var querystring=require(_0x15fa('0xd'));var Papa=require('papaparse');var Redis=require(_0x15fa('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x15fa('0xf'));var hardwareService=require(_0x15fa('0x10'));var logger=require(_0x15fa('0x11'))(_0x15fa('0x12'));var utils=require(_0x15fa('0x13'));var config=require(_0x15fa('0x14'));var licenseUtil=require(_0x15fa('0x15'));var db=require('../../mysqldb')['db'];config[_0x15fa('0x16')]=_['defaults'](config['redis'],{'host':_0x15fa('0x17'),'port':0x18eb});var socket=require(_0x15fa('0x18'))(new Redis(config[_0x15fa('0x16')]));require(_0x15fa('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x15fa('0x1a')][_0x15fa('0x1b')]({'port':0x232c});var client9002=jayson[_0x15fa('0x1a')][_0x15fa('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x52ffda,_0x51a26b,_0x3eaf47,_0x4781f3){return new BPromise(function(_0x444a73,_0x5e1153){var _0x87b786=_0x4781f3||client;return _0x87b786['request'](_0x52ffda,_0x3eaf47)[_0x15fa('0x1c')](function(_0x5e7e5d){logger['info'](_0x15fa('0x1d'),_0x51a26b,_0x15fa('0x1e'));logger[_0x15fa('0x1f')](_0x15fa('0x20'),_0x51a26b,'request\x20sent',JSON[_0x15fa('0x21')](_0x5e7e5d));if(_0x5e7e5d['error']){if(_0x5e7e5d[_0x15fa('0x22')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x51a26b,_0x5e7e5d[_0x15fa('0x22')][_0x15fa('0x23')]);return _0x5e1153(_0x5e7e5d['error'][_0x15fa('0x23')]);}logger[_0x15fa('0x22')](_0x15fa('0x1d'),_0x51a26b,_0x5e7e5d['error'][_0x15fa('0x23')]);return _0x444a73(_0x5e7e5d[_0x15fa('0x22')][_0x15fa('0x23')]);}else{logger[_0x15fa('0x24')]('SmsMessage,\x20%s,\x20%s',_0x51a26b,'request\x20sent');_0x444a73(_0x5e7e5d[_0x15fa('0x25')][_0x15fa('0x23')]);}})[_0x15fa('0x26')](function(_0x2cc155){logger['error']('SmsMessage,\x20%s,\x20%s',_0x51a26b,_0x2cc155);_0x5e1153(_0x2cc155);});});}function respondWithStatusCode(_0x761ede,_0x4a0ea9){_0x4a0ea9=_0x4a0ea9||0xcc;return function(_0x54919a){if(_0x54919a){return _0x761ede['sendStatus'](_0x4a0ea9);}return _0x761ede[_0x15fa('0x27')](_0x4a0ea9)[_0x15fa('0x28')]();};}function respondWithResult(_0x4385c8,_0xb5a4c8){_0xb5a4c8=_0xb5a4c8||0xc8;return function(_0x1ef666){if(_0x1ef666){return _0x4385c8['status'](_0xb5a4c8)[_0x15fa('0x29')](_0x1ef666);}};}function respondWithFilteredResult(_0x5634ac,_0x545e79){return function(_0x4e33da){if(_0x4e33da){var _0x1ad93c=typeof _0x545e79[_0x15fa('0x2a')]===_0x15fa('0x2b')&&typeof _0x545e79[_0x15fa('0x2c')]===_0x15fa('0x2b');var _0x54aef9=_0x4e33da[_0x15fa('0x2d')];var _0x48e46e=_0x1ad93c?0x0:_0x545e79['offset'];var _0x33fd71=_0x1ad93c?_0x4e33da['count']:_0x545e79['offset']+_0x545e79[_0x15fa('0x2c')];var _0x5a9147;if(_0x33fd71>=_0x54aef9){_0x33fd71=_0x54aef9;_0x5a9147=0xc8;}else{_0x5a9147=0xce;}_0x5634ac[_0x15fa('0x27')](_0x5a9147);return _0x5634ac[_0x15fa('0x2e')](_0x15fa('0x2f'),_0x48e46e+'-'+_0x33fd71+'/'+_0x54aef9)[_0x15fa('0x29')](_0x4e33da);}return null;};}function patchUpdates(_0x36c1db){return function(_0x332d6e){try{jsonpatch[_0x15fa('0x30')](_0x332d6e,_0x36c1db,!![]);}catch(_0x506658){return BPromise[_0x15fa('0x31')](_0x506658);}return _0x332d6e['save']();};}function saveUpdates(_0xb637b2,_0x1d24e5){return function(_0x52307d){if(_0x52307d){return _0x52307d['update'](_0xb637b2)[_0x15fa('0x1c')](function(_0x32a77e){return _0x32a77e;});}return null;};}function removeEntity(_0x1cd36d,_0x2598bb){return function(_0x1ca8fe){if(_0x1ca8fe){return _0x1ca8fe[_0x15fa('0x32')]()[_0x15fa('0x1c')](function(){_0x1cd36d[_0x15fa('0x27')](0xcc)[_0x15fa('0x28')]();});}};}function handleEntityNotFound(_0x2118ca,_0x349bb4){return function(_0x2c847b){if(!_0x2c847b){_0x2118ca[_0x15fa('0x33')](0x194);}return _0x2c847b;};}function handleError(_0x3402b1,_0x485a8a){_0x485a8a=_0x485a8a||0x1f4;return function(_0x3fb491){logger[_0x15fa('0x22')](_0x3fb491['stack']);if(_0x3fb491[_0x15fa('0x34')]){delete _0x3fb491[_0x15fa('0x34')];}_0x3402b1[_0x15fa('0x27')](_0x485a8a)[_0x15fa('0x35')](_0x3fb491);};}exports[_0x15fa('0x36')]=function(_0x470720,_0x32ba40){var _0x3e2ec2={},_0x100d47={},_0x156f51={'count':0x0,'rows':[]};var _0x2b8e5b=_[_0x15fa('0x37')](db[_0x15fa('0x38')][_0x15fa('0x39')],function(_0x27f005){return{'name':_0x27f005[_0x15fa('0x3a')],'type':_0x27f005[_0x15fa('0x3b')][_0x15fa('0x3c')]};});_0x100d47[_0x15fa('0x3d')]=_[_0x15fa('0x37')](_0x2b8e5b,'name');_0x100d47[_0x15fa('0x3e')]=_[_0x15fa('0x3f')](_0x470720[_0x15fa('0x3e')]);_0x100d47[_0x15fa('0x40')]=_[_0x15fa('0x41')](_0x100d47[_0x15fa('0x3d')],_0x100d47[_0x15fa('0x3e')]);_0x3e2ec2['attributes']=_[_0x15fa('0x41')](_0x100d47[_0x15fa('0x3d')],qs[_0x15fa('0x42')](_0x470720[_0x15fa('0x3e')]['fields']));_0x3e2ec2[_0x15fa('0x43')]=_0x3e2ec2[_0x15fa('0x43')][_0x15fa('0x44')]?_0x3e2ec2[_0x15fa('0x43')]:_0x100d47[_0x15fa('0x3d')];if(!_0x470720['query']['hasOwnProperty']('nolimit')){_0x3e2ec2[_0x15fa('0x2c')]=qs[_0x15fa('0x2c')](_0x470720[_0x15fa('0x3e')][_0x15fa('0x2c')]);_0x3e2ec2['offset']=qs[_0x15fa('0x2a')](_0x470720[_0x15fa('0x3e')][_0x15fa('0x2a')]);}_0x3e2ec2[_0x15fa('0x45')]=qs[_0x15fa('0x46')](_0x470720[_0x15fa('0x3e')]['sort']);_0x3e2ec2[_0x15fa('0x47')]=qs['filters'](_[_0x15fa('0x48')](_0x470720[_0x15fa('0x3e')],_0x100d47[_0x15fa('0x40')]),_0x2b8e5b);if(_0x470720[_0x15fa('0x3e')][_0x15fa('0x49')]){_0x3e2ec2[_0x15fa('0x47')]=_['merge'](_0x3e2ec2[_0x15fa('0x47')],{'$or':_[_0x15fa('0x37')](_0x2b8e5b,function(_0x18a2b4){if(_0x18a2b4[_0x15fa('0x3b')]!==_0x15fa('0x4a')){var _0x35adaa={};_0x35adaa[_0x18a2b4[_0x15fa('0x34')]]={'$like':'%'+_0x470720[_0x15fa('0x3e')]['filter']+'%'};return _0x35adaa;}})});}_0x3e2ec2=_[_0x15fa('0x4b')]({},_0x3e2ec2,_0x470720['options']);var _0x408081={'where':_0x3e2ec2[_0x15fa('0x47')]};return db[_0x15fa('0x38')][_0x15fa('0x2d')](_0x408081)['then'](function(_0x27b43e){_0x156f51[_0x15fa('0x2d')]=_0x27b43e;if(_0x470720[_0x15fa('0x3e')][_0x15fa('0x4c')]){_0x3e2ec2[_0x15fa('0x4d')]=[{'all':!![]}];}return db[_0x15fa('0x38')][_0x15fa('0x4e')](_0x3e2ec2);})['then'](function(_0x268c35){_0x156f51[_0x15fa('0x4f')]=_0x268c35;return _0x156f51;})[_0x15fa('0x1c')](respondWithFilteredResult(_0x32ba40,_0x3e2ec2))['catch'](handleError(_0x32ba40,null));};exports[_0x15fa('0x50')]=function(_0x1ea90c,_0x410e2c){var _0x39719c={'raw':!![],'where':{'id':_0x1ea90c[_0x15fa('0x51')]['id']}},_0xe0ddf5={};_0xe0ddf5[_0x15fa('0x3d')]=_[_0x15fa('0x3f')](db['SmsMessage'][_0x15fa('0x39')]);_0xe0ddf5[_0x15fa('0x3e')]=_[_0x15fa('0x3f')](_0x1ea90c[_0x15fa('0x3e')]);_0xe0ddf5[_0x15fa('0x40')]=_[_0x15fa('0x41')](_0xe0ddf5[_0x15fa('0x3d')],_0xe0ddf5[_0x15fa('0x3e')]);_0x39719c[_0x15fa('0x43')]=_[_0x15fa('0x41')](_0xe0ddf5[_0x15fa('0x3d')],qs['fields'](_0x1ea90c[_0x15fa('0x3e')][_0x15fa('0x42')]));_0x39719c[_0x15fa('0x43')]=_0x39719c[_0x15fa('0x43')][_0x15fa('0x44')]?_0x39719c[_0x15fa('0x43')]:_0xe0ddf5[_0x15fa('0x3d')];if(_0x1ea90c[_0x15fa('0x3e')][_0x15fa('0x4c')]){_0x39719c[_0x15fa('0x4d')]=[{'all':!![]}];}_0x39719c=_[_0x15fa('0x4b')]({},_0x39719c,_0x1ea90c[_0x15fa('0x52')]);return db[_0x15fa('0x38')][_0x15fa('0x53')](_0x39719c)['then'](handleEntityNotFound(_0x410e2c,null))[_0x15fa('0x1c')](respondWithResult(_0x410e2c,null))['catch'](handleError(_0x410e2c,null));};exports['create']=function(_0x3ba5e1,_0x2ff090){return db['SmsMessage'][_0x15fa('0x54')](_0x3ba5e1[_0x15fa('0x55')],{})[_0x15fa('0x1c')](respondWithResult(_0x2ff090,0xc9))[_0x15fa('0x26')](handleError(_0x2ff090,null));};exports[_0x15fa('0x56')]=function(_0x26bdcb,_0x2e194f){if(_0x26bdcb[_0x15fa('0x55')]['id']){delete _0x26bdcb[_0x15fa('0x55')]['id'];}return db[_0x15fa('0x38')][_0x15fa('0x53')]({'where':{'id':_0x26bdcb[_0x15fa('0x51')]['id']}})[_0x15fa('0x1c')](handleEntityNotFound(_0x2e194f,null))[_0x15fa('0x1c')](saveUpdates(_0x26bdcb[_0x15fa('0x55')],null))['then'](respondWithResult(_0x2e194f,null))[_0x15fa('0x26')](handleError(_0x2e194f,null));};exports['destroy']=function(_0x59b6b2,_0x33b1cc){return db[_0x15fa('0x38')][_0x15fa('0x53')]({'where':{'id':_0x59b6b2[_0x15fa('0x51')]['id']}})[_0x15fa('0x1c')](handleEntityNotFound(_0x33b1cc,null))[_0x15fa('0x1c')](removeEntity(_0x33b1cc,null))[_0x15fa('0x26')](handleError(_0x33b1cc,null));};exports['describe']=function(_0x1e3357,_0x76e646){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x76e646,null))[_0x15fa('0x26')](handleError(_0x76e646,null));};var interaction_log=require(_0x15fa('0x11'))(_0x15fa('0x57'));exports[_0x15fa('0x58')]=function(_0x3f089d,_0x5635c6,_0x48990c){var _0x1c75a0={'agent':{},'channel':_0x15fa('0x59')};if(_0x3f089d[_0x15fa('0x55')]['id']){delete _0x3f089d['body']['id'];}_0x3f089d['body'][_0x15fa('0x5a')]=!![];_0x3f089d[_0x15fa('0x55')][_0x15fa('0x5b')]=moment()[_0x15fa('0x5c')](_0x15fa('0x5d'));_0x3f089d[_0x15fa('0x55')][_0x15fa('0x5e')]=_0x3f089d[_0x15fa('0x55')]['UserId']||_0x3f089d[_0x15fa('0x5f')]['id'];_0x1c75a0['agent']['id']=_0x3f089d[_0x15fa('0x55')][_0x15fa('0x5e')];return db[_0x15fa('0x38')]['find']({'where':{'id':_0x3f089d[_0x15fa('0x51')]['id'],'UserId':null}})[_0x15fa('0x1c')](handleEntityNotFound(_0x5635c6,null))[_0x15fa('0x1c')](saveUpdates(_0x3f089d[_0x15fa('0x55')],null))[_0x15fa('0x1c')](function(_0x25e4a7){if(_0x25e4a7){_0x1c75a0[_0x15fa('0x23')]=_0x25e4a7[_0x15fa('0x60')]({'plain':!![]});return db[_0x15fa('0x61')]['find']({'where':{'id':_0x25e4a7[_0x15fa('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5635c6,null))[_0x15fa('0x1c')](function(_0x22fbd4){if(_0x22fbd4){return _0x22fbd4[_0x15fa('0x56')]({'UserId':_0x3f089d[_0x15fa('0x55')][_0x15fa('0x5e')],'read1stAt':_[_0x15fa('0x63')](_0x22fbd4[_0x15fa('0x64')])?moment()['format'](_0x15fa('0x5d')):undefined});}return null;})[_0x15fa('0x1c')](function(_0x256f83){if(_0x256f83){_0x1c75a0[_0x15fa('0x65')]=_0x256f83['get']({'plain':!![]});interaction_log[_0x15fa('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3f089d[_0x15fa('0x5f')]['id'],_0x3f089d[_0x15fa('0x5f')][_0x15fa('0x34')],_0x3f089d[_0x15fa('0x5f')]['role'],_0x1c75a0['interaction']['id'],_0x3f089d[_0x15fa('0x55')]?JSON[_0x15fa('0x21')](_0x3f089d['body']):'null');return respondWithRpcPromise(_0x15fa('0x66'),_0x15fa('0x67'),_0x1c75a0);}return null;})[_0x15fa('0x1c')](function(_0x2733cb){var _0x538e18=_0x15fa('0x68')+_0x2733cb['message']['ContactId'];return db[_0x15fa('0x69')][_0x15fa('0x3e')](_0x538e18,{'type':db[_0x15fa('0x6a')][_0x15fa('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x49139f){return _0x49139f;});})[_0x15fa('0x1c')](function(_0xa67d57){if(_0xa67d57){_0x1c75a0['message']['contact']=_0xa67d57[0x0];if(!_0x3f089d[_0x15fa('0x55')][_0x15fa('0x5e')])return;return db[_0x15fa('0x6c')]['find']({'where':{'id':_0x3f089d['body'][_0x15fa('0x5e')],'role':_0x15fa('0x6d')},'attributes':['id',_0x15fa('0x34'),_0x15fa('0x6e'),'email',_0x15fa('0x6f')],'raw':!![]});}return null;})[_0x15fa('0x1c')](function(_0x188ea7){if(!_0x188ea7)return null;_0x1c75a0['message'][_0x15fa('0x6d')]=_0x188ea7;return _0x1c75a0;})[_0x15fa('0x1c')](function(_0x17cb04){if(_0x17cb04){if(_0x3f089d[_0x15fa('0x55')][_0x15fa('0x70')]){_0x1c75a0[_0x15fa('0x23')][_0x15fa('0x71')]=util[_0x15fa('0x5c')](_0x15fa('0x72'),_0x3f089d['user']['name']);_0x1c75a0[_0x15fa('0x23')][_0x15fa('0x73')]=_0x1c75a0[_0x15fa('0x73')];_0x1c75a0[_0x15fa('0x23')][_0x15fa('0x74')]=_0x1c75a0['channel'];_0x1c75a0[_0x15fa('0x23')][_0x15fa('0x75')]='accept';return respondWithRpcPromise(_0x15fa('0x76'),_0x15fa('0x76'),{'event':'acceptmessage','message':_0x1c75a0[_0x15fa('0x23')]},client9002)['then'](function(){return _0x1c75a0;});}return _0x1c75a0;}return null;})[_0x15fa('0x1c')](respondWithResult(_0x5635c6,null))[_0x15fa('0x26')](handleError(_0x5635c6,null));};var interaction_log=require('../../config/logger')(_0x15fa('0x57'));exports[_0x15fa('0x31')]=function(_0x5b0d0a,_0x118d75,_0x4baaef){var _0x18baca={'agent':{},'channel':'sms'};if(_0x5b0d0a[_0x15fa('0x55')]['id']){delete _0x5b0d0a['body']['id'];}_0x5b0d0a[_0x15fa('0x55')][_0x15fa('0x5e')]=_0x5b0d0a[_0x15fa('0x55')][_0x15fa('0x5e')]||_0x5b0d0a[_0x15fa('0x5f')]['id'];_0x18baca[_0x15fa('0x6d')]['id']=_0x5b0d0a['body'][_0x15fa('0x5e')];return db[_0x15fa('0x38')][_0x15fa('0x53')]({'where':{'id':_0x5b0d0a[_0x15fa('0x51')]['id'],'UserId':null}})[_0x15fa('0x1c')](handleEntityNotFound(_0x118d75,null))['then'](function(_0x26eb6c){if(_0x26eb6c){_0x18baca[_0x15fa('0x23')]=_0x26eb6c[_0x15fa('0x60')]({'plain':!![]});return db[_0x15fa('0x61')][_0x15fa('0x53')]({'where':{'id':_0x26eb6c[_0x15fa('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x118d75,null))['then'](function(_0x5b98d6){if(_0x5b98d6){_0x18baca[_0x15fa('0x65')]=_0x5b98d6[_0x15fa('0x60')]({'plain':!![]});interaction_log[_0x15fa('0x24')](_0x15fa('0x77'),_0x5b0d0a[_0x15fa('0x5f')]['id'],_0x5b0d0a[_0x15fa('0x5f')][_0x15fa('0x34')],_0x5b0d0a['user']['role'],_0x18baca[_0x15fa('0x65')]['id'],_0x5b0d0a[_0x15fa('0x55')]?JSON[_0x15fa('0x21')](_0x5b0d0a[_0x15fa('0x55')]):_0x15fa('0x78'));return respondWithRpcPromise(_0x15fa('0x79'),'rejectMessage',_0x18baca);}return null;})['then'](function(_0x5bc70b){var _0x447d0f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5bc70b['message'][_0x15fa('0x7a')];return db['sequelize'][_0x15fa('0x3e')](_0x447d0f,{'type':db['Sequelize'][_0x15fa('0x6b')][_0x15fa('0x7b')],'raw':!![]})[_0x15fa('0x1c')](function(_0x331eb6){return _0x331eb6;});})['then'](function(_0x557a12){if(_0x557a12){_0x18baca[_0x15fa('0x23')][_0x15fa('0x7c')]=_0x557a12[0x0];if(!_0x5b0d0a['body'][_0x15fa('0x5e')])return;return db['User'][_0x15fa('0x53')]({'where':{'id':_0x5b0d0a[_0x15fa('0x55')][_0x15fa('0x5e')],'role':_0x15fa('0x6d')},'attributes':['id',_0x15fa('0x34'),'fullname',_0x15fa('0x7d'),_0x15fa('0x6f')],'raw':!![]});}return null;})[_0x15fa('0x1c')](function(_0x4b048f){if(!_0x4b048f)return null;_0x18baca['message']['agent']=_0x4b048f;return _0x18baca;})[_0x15fa('0x1c')](function(_0x28357f){if(_0x28357f){_0x28357f[_0x15fa('0x23')][_0x15fa('0x71')]=util[_0x15fa('0x5c')]('SIP/%s',_0x5b0d0a['user'][_0x15fa('0x34')]);_0x28357f[_0x15fa('0x23')][_0x15fa('0x73')]=_0x18baca[_0x15fa('0x73')];_0x28357f[_0x15fa('0x23')][_0x15fa('0x74')]=_0x18baca[_0x15fa('0x73')];_0x28357f[_0x15fa('0x23')][_0x15fa('0x75')]=_0x15fa('0x31');respondWithRpcPromise(_0x15fa('0x76'),_0x15fa('0x76'),{'event':_0x15fa('0x7e'),'message':_0x28357f['message']},client9002);return _0x18baca;}return null;})['then'](respondWithResult(_0x118d75,null))[_0x15fa('0x26')](handleError(_0x118d75,null));};exports[_0x15fa('0x27')]=function(_0x333705,_0x401723,_0x25e01d){if(_0x333705[_0x15fa('0x55')]['id']){delete _0x333705[_0x15fa('0x55')]['id'];}var _0x202d0d;return db[_0x15fa('0x38')][_0x15fa('0x53')]({'where':{'id':_0x333705[_0x15fa('0x51')]['id']}})[_0x15fa('0x1c')](handleEntityNotFound(_0x401723,null))[_0x15fa('0x1c')](function(_0x47572c){if(_0x47572c){_0x202d0d=_0x47572c;return db[_0x15fa('0x7f')][_0x15fa('0x53')]({'where':{'id':_0x47572c['SmsAccountId']}});}})[_0x15fa('0x1c')](handleEntityNotFound(_0x401723,null))[_0x15fa('0x1c')](function(_0x465142){if(_0x465142){logger[_0x15fa('0x1f')](_0x15fa('0x20'),_0x15fa('0x27'),_0x15fa('0x80'),_0x465142[_0x15fa('0x3b')],util[_0x15fa('0x81')](_0x333705[_0x15fa('0x55')],{'showHidden':![],'depth':null}));switch(_0x465142[_0x15fa('0x3b')]){case _0x15fa('0x82'):if(_0x333705[_0x15fa('0x55')][_0x15fa('0x83')]&&_0x333705[_0x15fa('0x55')][_0x15fa('0x83')]===_0x202d0d['messageId']){return _0x202d0d[_0x15fa('0x56')]({'read':!![]});}else{logger[_0x15fa('0x22')](_0x15fa('0x84'),_0x15fa('0x27'),_0x15fa('0x82'),util['inspect'](_0x333705[_0x15fa('0x55')],{'showHidden':![],'depth':null}));}break;case _0x15fa('0x85'):if(_0x333705[_0x15fa('0x55')][_0x15fa('0x86')]&&_0x333705[_0x15fa('0x55')][_0x15fa('0x86')]===_0x202d0d[_0x15fa('0x87')]&&_[_0x15fa('0x88')]([_0x15fa('0x89'),_0x15fa('0x8a')],_0x333705['body'][_0x15fa('0x8b')])>=0x0){return _0x202d0d[_0x15fa('0x56')]({'read':!![]});}else{logger['error'](_0x15fa('0x84'),_0x15fa('0x27'),_0x15fa('0x8c'),util[_0x15fa('0x81')](_0x333705['body'],{'showHidden':![],'depth':null}));}break;case _0x15fa('0x8d'):var _0x447777=_0x333705[_0x15fa('0x55')]['results'][0x0];if(_0x447777[_0x15fa('0x27')][_0x15fa('0x8e')]===_0x15fa('0x8f')){return _0x202d0d[_0x15fa('0x56')]({'read':!![]});}else{logger['error'](_0x15fa('0x84'),_0x15fa('0x27'),_0x15fa('0x8d'),util[_0x15fa('0x81')](_0x333705['body'],{'showHidden':![],'depth':null}));}break;}return _0x202d0d;}})[_0x15fa('0x1c')](respondWithResult(_0x401723,null))['catch'](handleError(_0x401723,null));}; \ No newline at end of file +var _0x72fa=['localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','filter','include','findAll','rows','show','params','keys','includeAll','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','User','interface','SmsAccount','SmsAccountId','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x8aec26,_0x14240a){var _0x1df251=function(_0x391dbd){while(--_0x391dbd){_0x8aec26['push'](_0x8aec26['shift']());}};_0x1df251(++_0x14240a);}(_0x72fa,0x78));var _0xa72f=function(_0x54cca3,_0x3b297d){_0x54cca3=_0x54cca3-0x0;var _0x348fde=_0x72fa[_0x54cca3];return _0x348fde;};'use strict';var emlformat=require(_0xa72f('0x0'));var rimraf=require(_0xa72f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa72f('0x2'));var rp=require(_0xa72f('0x3'));var moment=require(_0xa72f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa72f('0x5'));var path=require(_0xa72f('0x6'));var sox=require(_0xa72f('0x7'));var csv=require(_0xa72f('0x8'));var ejs=require(_0xa72f('0x9'));var fs=require('fs');var fs_extra=require(_0xa72f('0xa'));var _=require(_0xa72f('0xb'));var squel=require(_0xa72f('0xc'));var crypto=require(_0xa72f('0xd'));var jsforce=require(_0xa72f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa72f('0x8'));var querystring=require(_0xa72f('0xf'));var Papa=require(_0xa72f('0x10'));var Redis=require('ioredis');var authService=require(_0xa72f('0x11'));var qs=require(_0xa72f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa72f('0x13'));var logger=require(_0xa72f('0x14'))(_0xa72f('0x15'));var utils=require(_0xa72f('0x16'));var config=require(_0xa72f('0x17'));var licenseUtil=require(_0xa72f('0x18'));var db=require(_0xa72f('0x19'))['db'];config[_0xa72f('0x1a')]=_[_0xa72f('0x1b')](config[_0xa72f('0x1a')],{'host':_0xa72f('0x1c'),'port':0x18eb});var socket=require(_0xa72f('0x1d'))(new Redis(config['redis']));require(_0xa72f('0x1e'))[_0xa72f('0x1f')](socket);var jayson=require(_0xa72f('0x20'));var client=jayson['client'][_0xa72f('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xa72f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x661032,_0x5c150c,_0x3a50cc,_0x23b1ec){return new BPromise(function(_0x461119,_0x26c6bf){var _0x505fe9=_0x23b1ec||client;return _0x505fe9[_0xa72f('0x22')](_0x661032,_0x3a50cc)[_0xa72f('0x23')](function(_0x425e89){logger[_0xa72f('0x24')]('SmsMessage,\x20%s,\x20%s',_0x5c150c,_0xa72f('0x25'));logger[_0xa72f('0x26')](_0xa72f('0x27'),_0x5c150c,_0xa72f('0x25'),JSON[_0xa72f('0x28')](_0x425e89));if(_0x425e89[_0xa72f('0x29')]){if(_0x425e89['error'][_0xa72f('0x2a')]===0x1f4){logger['error'](_0xa72f('0x2b'),_0x5c150c,_0x425e89[_0xa72f('0x29')]['message']);return _0x26c6bf(_0x425e89[_0xa72f('0x29')][_0xa72f('0x2c')]);}logger[_0xa72f('0x29')](_0xa72f('0x2b'),_0x5c150c,_0x425e89[_0xa72f('0x29')][_0xa72f('0x2c')]);return _0x461119(_0x425e89[_0xa72f('0x29')][_0xa72f('0x2c')]);}else{logger[_0xa72f('0x24')](_0xa72f('0x2b'),_0x5c150c,'request\x20sent');_0x461119(_0x425e89[_0xa72f('0x2d')][_0xa72f('0x2c')]);}})[_0xa72f('0x2e')](function(_0x40cc13){logger[_0xa72f('0x29')]('SmsMessage,\x20%s,\x20%s',_0x5c150c,_0x40cc13);_0x26c6bf(_0x40cc13);});});}function respondWithStatusCode(_0x38d8f9,_0x1974ea){_0x1974ea=_0x1974ea||0xcc;return function(_0x44db2b){if(_0x44db2b){return _0x38d8f9[_0xa72f('0x2f')](_0x1974ea);}return _0x38d8f9['status'](_0x1974ea)['end']();};}function respondWithResult(_0x4596cb,_0x51e4e4){_0x51e4e4=_0x51e4e4||0xc8;return function(_0x21f4d9){if(_0x21f4d9){return _0x4596cb[_0xa72f('0x30')](_0x51e4e4)[_0xa72f('0x31')](_0x21f4d9);}};}function respondWithFilteredResult(_0x224d1a,_0xc99fec){return function(_0x5c7b09){if(_0x5c7b09){var _0x259a9a=typeof _0xc99fec[_0xa72f('0x32')]===_0xa72f('0x33')&&typeof _0xc99fec[_0xa72f('0x34')]==='undefined';var _0x26aa28=_0x5c7b09[_0xa72f('0x35')];var _0x4c1eff=_0x259a9a?0x0:_0xc99fec[_0xa72f('0x32')];var _0x2216ce=_0x259a9a?_0x5c7b09[_0xa72f('0x35')]:_0xc99fec['offset']+_0xc99fec[_0xa72f('0x34')];var _0x548c9a;if(_0x2216ce>=_0x26aa28){_0x2216ce=_0x26aa28;_0x548c9a=0xc8;}else{_0x548c9a=0xce;}_0x224d1a[_0xa72f('0x30')](_0x548c9a);return _0x224d1a['set'](_0xa72f('0x36'),_0x4c1eff+'-'+_0x2216ce+'/'+_0x26aa28)['json'](_0x5c7b09);}return null;};}function patchUpdates(_0xc38c4c){return function(_0x380239){try{jsonpatch[_0xa72f('0x37')](_0x380239,_0xc38c4c,!![]);}catch(_0x22ad37){return BPromise[_0xa72f('0x38')](_0x22ad37);}return _0x380239['save']();};}function saveUpdates(_0x3793de,_0xe976a){return function(_0x2063d1){if(_0x2063d1){return _0x2063d1[_0xa72f('0x39')](_0x3793de)[_0xa72f('0x23')](function(_0xb360bc){return _0xb360bc;});}return null;};}function removeEntity(_0x37b036,_0x46f18c){return function(_0x33ba2e){if(_0x33ba2e){return _0x33ba2e[_0xa72f('0x3a')]()[_0xa72f('0x23')](function(){_0x37b036['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34346d,_0x465c81){return function(_0x10beeb){if(!_0x10beeb){_0x34346d[_0xa72f('0x2f')](0x194);}return _0x10beeb;};}function handleError(_0x1bb9bc,_0xeba90b){_0xeba90b=_0xeba90b||0x1f4;return function(_0x558abb){logger[_0xa72f('0x29')](_0x558abb[_0xa72f('0x3b')]);if(_0x558abb['name']){delete _0x558abb[_0xa72f('0x3c')];}_0x1bb9bc['status'](_0xeba90b)[_0xa72f('0x3d')](_0x558abb);};}exports[_0xa72f('0x3e')]=function(_0x43a56f,_0x31bac8){var _0x198692={},_0x32301b={},_0x485507={'count':0x0,'rows':[]};var _0x2f3250=_[_0xa72f('0x3f')](db[_0xa72f('0x40')][_0xa72f('0x41')],function(_0x55f75a){return{'name':_0x55f75a[_0xa72f('0x42')],'type':_0x55f75a['type']['key']};});_0x32301b[_0xa72f('0x43')]=_[_0xa72f('0x3f')](_0x2f3250,'name');_0x32301b[_0xa72f('0x44')]=_['keys'](_0x43a56f[_0xa72f('0x44')]);_0x32301b[_0xa72f('0x45')]=_[_0xa72f('0x46')](_0x32301b[_0xa72f('0x43')],_0x32301b[_0xa72f('0x44')]);_0x198692[_0xa72f('0x47')]=_[_0xa72f('0x46')](_0x32301b[_0xa72f('0x43')],qs[_0xa72f('0x48')](_0x43a56f[_0xa72f('0x44')][_0xa72f('0x48')]));_0x198692[_0xa72f('0x47')]=_0x198692['attributes']['length']?_0x198692[_0xa72f('0x47')]:_0x32301b['model'];if(!_0x43a56f[_0xa72f('0x44')][_0xa72f('0x49')]('nolimit')){_0x198692['limit']=qs[_0xa72f('0x34')](_0x43a56f['query'][_0xa72f('0x34')]);_0x198692['offset']=qs[_0xa72f('0x32')](_0x43a56f[_0xa72f('0x44')][_0xa72f('0x32')]);}_0x198692[_0xa72f('0x4a')]=qs[_0xa72f('0x4b')](_0x43a56f[_0xa72f('0x44')][_0xa72f('0x4b')]);_0x198692[_0xa72f('0x4c')]=qs[_0xa72f('0x45')](_[_0xa72f('0x4d')](_0x43a56f['query'],_0x32301b['filters']),_0x2f3250);if(_0x43a56f[_0xa72f('0x44')]['filter']){_0x198692[_0xa72f('0x4c')]=_[_0xa72f('0x4e')](_0x198692['where'],{'$or':_[_0xa72f('0x3f')](_0x2f3250,function(_0x5cd20d){if(_0x5cd20d[_0xa72f('0x4f')]!=='VIRTUAL'){var _0x6562a9={};_0x6562a9[_0x5cd20d['name']]={'$like':'%'+_0x43a56f[_0xa72f('0x44')][_0xa72f('0x50')]+'%'};return _0x6562a9;}})});}_0x198692=_[_0xa72f('0x4e')]({},_0x198692,_0x43a56f['options']);var _0x354149={'where':_0x198692[_0xa72f('0x4c')]};return db[_0xa72f('0x40')][_0xa72f('0x35')](_0x354149)[_0xa72f('0x23')](function(_0x1dcb01){_0x485507[_0xa72f('0x35')]=_0x1dcb01;if(_0x43a56f[_0xa72f('0x44')]['includeAll']){_0x198692[_0xa72f('0x51')]=[{'all':!![]}];}return db[_0xa72f('0x40')][_0xa72f('0x52')](_0x198692);})[_0xa72f('0x23')](function(_0x107901){_0x485507[_0xa72f('0x53')]=_0x107901;return _0x485507;})['then'](respondWithFilteredResult(_0x31bac8,_0x198692))['catch'](handleError(_0x31bac8,null));};exports[_0xa72f('0x54')]=function(_0xfde98b,_0x5af659){var _0x4778e4={'raw':!![],'where':{'id':_0xfde98b[_0xa72f('0x55')]['id']}},_0x3ad771={};_0x3ad771[_0xa72f('0x43')]=_[_0xa72f('0x56')](db[_0xa72f('0x40')][_0xa72f('0x41')]);_0x3ad771['query']=_[_0xa72f('0x56')](_0xfde98b['query']);_0x3ad771[_0xa72f('0x45')]=_[_0xa72f('0x46')](_0x3ad771[_0xa72f('0x43')],_0x3ad771[_0xa72f('0x44')]);_0x4778e4['attributes']=_[_0xa72f('0x46')](_0x3ad771['model'],qs[_0xa72f('0x48')](_0xfde98b[_0xa72f('0x44')][_0xa72f('0x48')]));_0x4778e4[_0xa72f('0x47')]=_0x4778e4[_0xa72f('0x47')]['length']?_0x4778e4[_0xa72f('0x47')]:_0x3ad771[_0xa72f('0x43')];if(_0xfde98b[_0xa72f('0x44')][_0xa72f('0x57')]){_0x4778e4[_0xa72f('0x51')]=[{'all':!![]}];}_0x4778e4=_['merge']({},_0x4778e4,_0xfde98b['options']);return db[_0xa72f('0x40')][_0xa72f('0x58')](_0x4778e4)[_0xa72f('0x23')](handleEntityNotFound(_0x5af659,null))[_0xa72f('0x23')](respondWithResult(_0x5af659,null))[_0xa72f('0x2e')](handleError(_0x5af659,null));};exports[_0xa72f('0x59')]=function(_0x131d4c,_0x1f5687){return db[_0xa72f('0x40')]['create'](_0x131d4c[_0xa72f('0x5a')],{})['then'](respondWithResult(_0x1f5687,0xc9))[_0xa72f('0x2e')](handleError(_0x1f5687,null));};exports[_0xa72f('0x39')]=function(_0x478b25,_0x39be76){if(_0x478b25[_0xa72f('0x5a')]['id']){delete _0x478b25[_0xa72f('0x5a')]['id'];}return db[_0xa72f('0x40')]['find']({'where':{'id':_0x478b25[_0xa72f('0x55')]['id']}})[_0xa72f('0x23')](handleEntityNotFound(_0x39be76,null))[_0xa72f('0x23')](saveUpdates(_0x478b25['body'],null))[_0xa72f('0x23')](respondWithResult(_0x39be76,null))[_0xa72f('0x2e')](handleError(_0x39be76,null));};exports['destroy']=function(_0x26a35c,_0x2c7a6e){return db[_0xa72f('0x40')][_0xa72f('0x58')]({'where':{'id':_0x26a35c[_0xa72f('0x55')]['id']}})['then'](handleEntityNotFound(_0x2c7a6e,null))['then'](removeEntity(_0x2c7a6e,null))[_0xa72f('0x2e')](handleError(_0x2c7a6e,null));};exports[_0xa72f('0x5b')]=function(_0x3fe71c,_0x5b4b8b){return db[_0xa72f('0x40')][_0xa72f('0x5b')]()[_0xa72f('0x23')](respondWithResult(_0x5b4b8b,null))[_0xa72f('0x2e')](handleError(_0x5b4b8b,null));};var interaction_log=require(_0xa72f('0x14'))(_0xa72f('0x5c'));exports[_0xa72f('0x5d')]=function(_0x282290,_0x1f7db2,_0x50e353){var _0x31cc8c={'agent':{},'channel':_0xa72f('0x5e')};if(_0x282290[_0xa72f('0x5a')]['id']){delete _0x282290[_0xa72f('0x5a')]['id'];}_0x282290[_0xa72f('0x5a')][_0xa72f('0x5f')]=!![];_0x282290[_0xa72f('0x5a')][_0xa72f('0x60')]=moment()[_0xa72f('0x61')](_0xa72f('0x62'));_0x282290[_0xa72f('0x5a')][_0xa72f('0x63')]=_0x282290[_0xa72f('0x5a')][_0xa72f('0x63')]||_0x282290[_0xa72f('0x64')]['id'];_0x31cc8c[_0xa72f('0x65')]['id']=_0x282290[_0xa72f('0x5a')][_0xa72f('0x63')];return db[_0xa72f('0x40')][_0xa72f('0x58')]({'where':{'id':_0x282290['params']['id'],'UserId':null}})[_0xa72f('0x23')](handleEntityNotFound(_0x1f7db2,null))[_0xa72f('0x23')](saveUpdates(_0x282290[_0xa72f('0x5a')],null))[_0xa72f('0x23')](function(_0x5e4297){if(_0x5e4297){_0x31cc8c[_0xa72f('0x2c')]=_0x5e4297[_0xa72f('0x66')]({'plain':!![]});return db[_0xa72f('0x67')]['find']({'where':{'id':_0x5e4297[_0xa72f('0x68')]}});}return null;})[_0xa72f('0x23')](handleEntityNotFound(_0x1f7db2,null))[_0xa72f('0x23')](function(_0x3ac8a2){if(_0x3ac8a2){return _0x3ac8a2[_0xa72f('0x39')]({'UserId':_0x282290[_0xa72f('0x5a')][_0xa72f('0x63')],'read1stAt':_[_0xa72f('0x69')](_0x3ac8a2['read1stAt'])?moment()['format'](_0xa72f('0x62')):undefined});}return null;})[_0xa72f('0x23')](function(_0x3847d0){if(_0x3847d0){_0x31cc8c[_0xa72f('0x6a')]=_0x3847d0[_0xa72f('0x66')]({'plain':!![]});interaction_log[_0xa72f('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x282290[_0xa72f('0x64')]['id'],_0x282290[_0xa72f('0x64')][_0xa72f('0x3c')],_0x282290['user'][_0xa72f('0x6b')],_0x31cc8c['interaction']['id'],_0x282290[_0xa72f('0x5a')]?JSON[_0xa72f('0x28')](_0x282290[_0xa72f('0x5a')]):_0xa72f('0x6c'));return respondWithRpcPromise(_0xa72f('0x6d'),_0xa72f('0x6e'),_0x31cc8c);}return null;})[_0xa72f('0x23')](function(_0x3b0898){var _0x5bc38a=_0xa72f('0x6f')+_0x3b0898['message'][_0xa72f('0x70')];return db[_0xa72f('0x71')]['query'](_0x5bc38a,{'type':db[_0xa72f('0x72')][_0xa72f('0x73')][_0xa72f('0x74')],'raw':!![]})['then'](function(_0x4405aa){return _0x4405aa;});})[_0xa72f('0x23')](function(_0x46ef66){if(_0x46ef66){_0x31cc8c[_0xa72f('0x2c')]['contact']=_0x46ef66[0x0];if(!_0x282290[_0xa72f('0x5a')][_0xa72f('0x63')])return;return db['User'][_0xa72f('0x58')]({'where':{'id':_0x282290[_0xa72f('0x5a')][_0xa72f('0x63')],'role':'agent'},'attributes':['id',_0xa72f('0x3c'),_0xa72f('0x75'),_0xa72f('0x76'),_0xa72f('0x77')],'raw':!![]});}return null;})[_0xa72f('0x23')](function(_0x5f3035){if(!_0x5f3035)return null;_0x31cc8c[_0xa72f('0x2c')][_0xa72f('0x65')]=_0x5f3035;return _0x31cc8c;})['then'](function(_0x3a5198){if(_0x3a5198){if(_0x282290['body']['manual']){_0x31cc8c[_0xa72f('0x2c')]['interface']=util[_0xa72f('0x61')](_0xa72f('0x78'),_0x282290[_0xa72f('0x64')][_0xa72f('0x3c')]);_0x31cc8c['message'][_0xa72f('0x79')]=_0x31cc8c[_0xa72f('0x79')];_0x31cc8c['message'][_0xa72f('0x7a')]=_0x31cc8c[_0xa72f('0x79')];_0x31cc8c[_0xa72f('0x2c')][_0xa72f('0x7b')]=_0xa72f('0x5d');return respondWithRpcPromise(_0xa72f('0x7c'),_0xa72f('0x7c'),{'event':_0xa72f('0x7d'),'message':_0x31cc8c[_0xa72f('0x2c')]},client9002)[_0xa72f('0x23')](function(){return _0x31cc8c;});}return _0x31cc8c;}return null;})[_0xa72f('0x23')](respondWithResult(_0x1f7db2,null))[_0xa72f('0x2e')](handleError(_0x1f7db2,null));};var interaction_log=require(_0xa72f('0x14'))(_0xa72f('0x5c'));exports[_0xa72f('0x38')]=function(_0x4504d9,_0x1977d9,_0x49f1f1){var _0x81cf6d={'agent':{},'channel':_0xa72f('0x5e')};if(_0x4504d9[_0xa72f('0x5a')]['id']){delete _0x4504d9['body']['id'];}_0x4504d9[_0xa72f('0x5a')][_0xa72f('0x63')]=_0x4504d9['body'][_0xa72f('0x63')]||_0x4504d9[_0xa72f('0x64')]['id'];_0x81cf6d[_0xa72f('0x65')]['id']=_0x4504d9[_0xa72f('0x5a')][_0xa72f('0x63')];return db['SmsMessage'][_0xa72f('0x58')]({'where':{'id':_0x4504d9['params']['id'],'UserId':null}})[_0xa72f('0x23')](handleEntityNotFound(_0x1977d9,null))[_0xa72f('0x23')](function(_0x27e069){if(_0x27e069){_0x81cf6d[_0xa72f('0x2c')]=_0x27e069[_0xa72f('0x66')]({'plain':!![]});return db[_0xa72f('0x67')][_0xa72f('0x58')]({'where':{'id':_0x27e069['SmsInteractionId']}});}return null;})[_0xa72f('0x23')](handleEntityNotFound(_0x1977d9,null))[_0xa72f('0x23')](function(_0x5993de){if(_0x5993de){_0x81cf6d[_0xa72f('0x6a')]=_0x5993de[_0xa72f('0x66')]({'plain':!![]});interaction_log['info'](_0xa72f('0x7e'),_0x4504d9[_0xa72f('0x64')]['id'],_0x4504d9[_0xa72f('0x64')][_0xa72f('0x3c')],_0x4504d9[_0xa72f('0x64')][_0xa72f('0x6b')],_0x81cf6d['interaction']['id'],_0x4504d9['body']?JSON[_0xa72f('0x28')](_0x4504d9[_0xa72f('0x5a')]):_0xa72f('0x6c'));return respondWithRpcPromise('RejectMessage',_0xa72f('0x7f'),_0x81cf6d);}return null;})['then'](function(_0x1fcfa8){var _0x21c8ee=_0xa72f('0x6f')+_0x1fcfa8[_0xa72f('0x2c')][_0xa72f('0x70')];return db['sequelize'][_0xa72f('0x44')](_0x21c8ee,{'type':db['Sequelize'][_0xa72f('0x73')]['SELECT'],'raw':!![]})[_0xa72f('0x23')](function(_0x49fc89){return _0x49fc89;});})['then'](function(_0x212959){if(_0x212959){_0x81cf6d[_0xa72f('0x2c')][_0xa72f('0x80')]=_0x212959[0x0];if(!_0x4504d9['body']['UserId'])return;return db[_0xa72f('0x81')][_0xa72f('0x58')]({'where':{'id':_0x4504d9[_0xa72f('0x5a')][_0xa72f('0x63')],'role':_0xa72f('0x65')},'attributes':['id','name',_0xa72f('0x75'),_0xa72f('0x76'),_0xa72f('0x77')],'raw':!![]});}return null;})[_0xa72f('0x23')](function(_0x52b5d2){if(!_0x52b5d2)return null;_0x81cf6d[_0xa72f('0x2c')][_0xa72f('0x65')]=_0x52b5d2;return _0x81cf6d;})[_0xa72f('0x23')](function(_0x5e0d56){if(_0x5e0d56){_0x5e0d56['message'][_0xa72f('0x82')]=util['format']('SIP/%s',_0x4504d9[_0xa72f('0x64')][_0xa72f('0x3c')]);_0x5e0d56[_0xa72f('0x2c')][_0xa72f('0x79')]=_0x81cf6d[_0xa72f('0x79')];_0x5e0d56[_0xa72f('0x2c')][_0xa72f('0x7a')]=_0x81cf6d['channel'];_0x5e0d56[_0xa72f('0x2c')]['event']=_0xa72f('0x38');respondWithRpcPromise(_0xa72f('0x7c'),_0xa72f('0x7c'),{'event':'rejectmessage','message':_0x5e0d56[_0xa72f('0x2c')]},client9002);return _0x81cf6d;}return null;})[_0xa72f('0x23')](respondWithResult(_0x1977d9,null))[_0xa72f('0x2e')](handleError(_0x1977d9,null));};exports['status']=function(_0x436063,_0x11b492,_0x3e0737){if(_0x436063[_0xa72f('0x5a')]['id']){delete _0x436063['body']['id'];}var _0x41a77c;return db['SmsMessage'][_0xa72f('0x58')]({'where':{'id':_0x436063[_0xa72f('0x55')]['id']}})[_0xa72f('0x23')](handleEntityNotFound(_0x11b492,null))[_0xa72f('0x23')](function(_0x4fd2ca){if(_0x4fd2ca){_0x41a77c=_0x4fd2ca;return db[_0xa72f('0x83')][_0xa72f('0x58')]({'where':{'id':_0x4fd2ca[_0xa72f('0x84')]}});}})[_0xa72f('0x23')](handleEntityNotFound(_0x11b492,null))['then'](function(_0x311bc3){if(_0x311bc3){logger[_0xa72f('0x26')](_0xa72f('0x27'),_0xa72f('0x30'),'received\x20delivery\x20report\x20from',_0x311bc3[_0xa72f('0x4f')],util['inspect'](_0x436063[_0xa72f('0x5a')],{'showHidden':![],'depth':null}));switch(_0x311bc3[_0xa72f('0x4f')]){case _0xa72f('0x85'):if(_0x436063[_0xa72f('0x5a')][_0xa72f('0x86')]&&_0x436063[_0xa72f('0x5a')][_0xa72f('0x86')]===_0x41a77c[_0xa72f('0x87')]){return _0x41a77c['update']({'read':!![]});}else{logger[_0xa72f('0x29')](_0xa72f('0x88'),'status',_0xa72f('0x85'),util[_0xa72f('0x89')](_0x436063[_0xa72f('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x436063[_0xa72f('0x5a')][_0xa72f('0x8a')]&&_0x436063[_0xa72f('0x5a')][_0xa72f('0x8a')]===_0x41a77c[_0xa72f('0x87')]&&_[_0xa72f('0x8b')]([_0xa72f('0x8c'),_0xa72f('0x8d')],_0x436063[_0xa72f('0x5a')][_0xa72f('0x8e')])>=0x0){return _0x41a77c[_0xa72f('0x39')]({'read':!![]});}else{logger[_0xa72f('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa72f('0x8f'),util[_0xa72f('0x89')](_0x436063[_0xa72f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa72f('0x90'):var _0x26b7f2=_0x436063[_0xa72f('0x5a')][_0xa72f('0x91')][0x0];if(_0x26b7f2['status'][_0xa72f('0x92')]===_0xa72f('0x93')){return _0x41a77c[_0xa72f('0x39')]({'read':!![]});}else{logger['error'](_0xa72f('0x88'),_0xa72f('0x30'),_0xa72f('0x90'),util[_0xa72f('0x89')](_0x436063[_0xa72f('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x41a77c;}})[_0xa72f('0x23')](respondWithResult(_0x11b492,null))[_0xa72f('0x2e')](handleError(_0x11b492,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d19eaf3..473d10e 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 _0x4f5e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4f5e,0x131));var _0xe4f5=function(_0x284640,_0x17d6bb){_0x284640=_0x284640-0x0;var _0x26afaf=_0x4f5e[_0x284640];return _0x26afaf;};'use strict';var EventEmitter=require(_0xe4f5('0x0'));var SmsMessage=require(_0xe4f5('0x1'))['db'][_0xe4f5('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe4f5('0x3')](0x0);var events={'afterCreate':_0xe4f5('0x4'),'afterUpdate':_0xe4f5('0x5'),'afterDestroy':_0xe4f5('0x6')};function emitEvent(_0x26f17a){return function(_0x169cc8,_0x12968e,_0xb35252){SmsMessageEvents[_0xe4f5('0x7')](_0x26f17a+':'+_0x169cc8['id'],_0x169cc8);SmsMessageEvents['emit'](_0x26f17a,_0x169cc8);_0xb35252(null);};}for(var e in events){if(events[_0xe4f5('0x8')](e)){var event=events[e];SmsMessage[_0xe4f5('0x9')](e,emitEvent(event));}}module[_0xe4f5('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0x63fd=['emit','hook','exports','events','../../mysqldb','SmsMessage','save','update'];(function(_0x4cee96,_0x31b011){var _0x1e43b6=function(_0xc82a22){while(--_0xc82a22){_0x4cee96['push'](_0x4cee96['shift']());}};_0x1e43b6(++_0x31b011);}(_0x63fd,0xc3));var _0xd63f=function(_0x2c6ad0,_0x5a1609){_0x2c6ad0=_0x2c6ad0-0x0;var _0x5416f4=_0x63fd[_0x2c6ad0];return _0x5416f4;};'use strict';var EventEmitter=require(_0xd63f('0x0'));var SmsMessage=require(_0xd63f('0x1'))['db'][_0xd63f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd63f('0x3'),'afterUpdate':_0xd63f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4911ea){return function(_0x5f0a36,_0x4d491d,_0x362cef){SmsMessageEvents[_0xd63f('0x5')](_0x4911ea+':'+_0x5f0a36['id'],_0x5f0a36);SmsMessageEvents[_0xd63f('0x5')](_0x4911ea,_0x5f0a36);_0x362cef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xd63f('0x6')](e,emitEvent(event));}}module[_0xd63f('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f97c687..09930d2 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 _0x25b5=['total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','toString','base64','data','head','message_id','clickSend','authId','/api/sms/messages/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','csc','apiKey','login','text','timestamp','sort','length','createHash','md5','digest','signature=','keys','deliveryReport','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','sms_messages','messageId','body','FULLTEXT','get','toLowerCase','direction','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','error','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','POST','user_key','session_key'];(function(_0x3a765a,_0x54a112){var _0x4e93a5=function(_0x3826e1){while(--_0x3826e1){_0x3a765a['push'](_0x3a765a['shift']());}};_0x4e93a5(++_0x54a112);}(_0x25b5,0x198));var _0x525b=function(_0x492859,_0xfe1954){_0x492859=_0x492859-0x0;var _0x6922ca=_0x25b5[_0x492859];return _0x6922ca;};'use strict';var _=require(_0x525b('0x0'));var util=require(_0x525b('0x1'));var logger=require(_0x525b('0x2'))(_0x525b('0x3'));var moment=require(_0x525b('0x4'));var BPromise=require('bluebird');var rp=require(_0x525b('0x5'));var fs=require('fs');var path=require(_0x525b('0x6'));var rimraf=require(_0x525b('0x7'));var config=require(_0x525b('0x8'));var attributes=require(_0x525b('0x9'));module['exports']=function(_0x5cca3f,_0x982127){return _0x5cca3f['define']('SmsMessage',attributes,{'tableName':_0x525b('0xa'),'paranoid':![],'indexes':[{'name':_0x525b('0xb'),'fields':[_0x525b('0xb')]},{'name':'fti_sms_messages','fields':[_0x525b('0xc')],'type':_0x525b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5997d7,_0x535dd9,_0x4ba3c2){var _0x4a91f0=_0x5cca3f['models'];var _0x27ce0f=_0x5997d7[_0x525b('0xe')]({'plain':!![]});if(_0x27ce0f['direction'][_0x525b('0xf')]()==='in'||_0x27ce0f[_0x525b('0x10')][_0x525b('0xf')]()==='out'&&!_0x27ce0f['secret']&&!_[_0x525b('0x11')](_0x27ce0f[_0x525b('0x12')])){_0x4a91f0[_0x525b('0x13')][_0x525b('0x14')]({'where':{'id':_0x27ce0f[_0x525b('0x15')]}})[_0x525b('0x16')](function(_0x281bf4){if(_0x281bf4){_0x281bf4[_0x525b('0x17')]({'lastMsgAt':_0x27ce0f[_0x525b('0x18')],'lastMsgDirection':_0x27ce0f[_0x525b('0x10')][_0x525b('0xf')]()});}})['catch'](function(_0x580429){console[_0x525b('0x19')](_0x580429);});}if(_0x27ce0f[_0x525b('0x10')]==='out'&&!_0x27ce0f['secret']){var _0x43b941;_0x4a91f0[_0x525b('0x1a')][_0x525b('0x1b')]({'where':{'id':_0x27ce0f['SmsAccountId']},'raw':!![]})[_0x525b('0x16')](function(_0x206492){_0x43b941=_0x206492;if(_0x43b941&&_0x43b941[_0x525b('0x1c')]){switch(_0x43b941['type']){case'twilio':var _0x5f1907=require(_0x525b('0x1d'));if(_0x43b941[_0x525b('0x1e')]&&_0x43b941[_0x525b('0x1f')]&&_0x43b941[_0x525b('0x20')]){var _0x14da20=new _0x5f1907(_0x43b941[_0x525b('0x1e')],_0x43b941[_0x525b('0x1f')]);_0x14da20[_0x525b('0x21')][_0x525b('0x22')]({'body':_0x27ce0f['body'],'to':_0x27ce0f[_0x525b('0x20')],'from':_0x43b941[_0x525b('0x20')],'statusCallback':_0x43b941[_0x525b('0x23')]+'/api/sms/messages/'+_0x27ce0f['id']+_0x525b('0x24')+_0x43b941[_0x525b('0x25')]})[_0x525b('0x16')](function(_0x4bfd2b){if(_0x4bfd2b['sid']){return _0x5997d7[_0x525b('0x17')]({'messageId':_0x4bfd2b[_0x525b('0x26')]});}})[_0x525b('0x27')](function(_0x5c0f0c){logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x1d'),util[_0x525b('0x2a')](_0x5c0f0c,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x525b('0x2b'):var _0x5a79e4=_0x525b('0x2c');if(_0x43b941[_0x525b('0x2d')]&&_0x43b941[_0x525b('0x2e')]){var _0x480645={'recipient':[_0x27ce0f['phone']],'message':_0x27ce0f[_0x525b('0xc')],'message_type':_0x43b941[_0x525b('0x2f')]};if(_0x43b941[_0x525b('0x2f')]&&_0x43b941[_0x525b('0x2f')]!=='SI'){_0x480645[_0x525b('0x30')]=_0x43b941['phone'];}var _0x1ffae1={'url':_0x5a79e4+_0x525b('0x31')+_0x43b941[_0x525b('0x2d')]+'&password='+_0x43b941[_0x525b('0x2e')],'method':_0x525b('0x32')};rp(_0x1ffae1)[_0x525b('0x16')](function(_0x3abc26){var _0x1319d7=_0x3abc26[_0x525b('0x33')](';');var _0x5a8330={'user_key':_0x1319d7[0x0],'session_key':_0x1319d7[0x1]};_0x1ffae1={'url':_0x5a79e4+_0x525b('0x34'),'method':_0x525b('0x35'),'headers':{'user_key':_0x5a8330[_0x525b('0x36')],'Session_key':_0x5a8330[_0x525b('0x37')]},'json':!![],'body':_0x480645};return rp(_0x1ffae1);})[_0x525b('0x16')](function(_0x27b123){if(_0x27b123[_0x525b('0x38')]>=0x1){var _0x16fb4d={'messageId':_0x27b123[_0x525b('0x39')]};if(_0x43b941['smsMethod']!=='GP'||!_0x43b941['deliveryReport']){_0x16fb4d[_0x525b('0x3a')]=!![];}return _0x5997d7['update'](_0x16fb4d);}else{return logger['error'](_0x525b('0x28'),'afterCreate','skebby',util['inspect'](_0x27b123,{'showHidden':![],'depth':null}));}})[_0x525b('0x27')](function(_0x4b783d){return logger[_0x525b('0x19')](_0x525b('0x28'),'afterCreate',_0x525b('0x2b'),util[_0x525b('0x2a')](_0x4b783d,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x2b'),_0x525b('0x3b'));}break;case _0x525b('0x3c'):if(_0x43b941[_0x525b('0x1f')]){var _0x472719={'recipient':_0x27ce0f[_0x525b('0x20')],'message':_0x27ce0f[_0x525b('0xc')],'sender':_0x43b941[_0x525b('0x3d')]||_0x43b941[_0x525b('0x20')],'authorization':_0x43b941[_0x525b('0x1f')]};var _0x535dd9={'method':'POST','uri':_0x525b('0x3e'),'body':_0x472719,'json':!![]};rp(_0x535dd9)[_0x525b('0x16')](function(_0x2c22e0){var _0x2d531b={'messageId':_0x2c22e0[_0x525b('0x3f')]};if(!_0x43b941['deliveryReport']){_0x2d531b[_0x525b('0x3a')]=!![];}return _0x5997d7[_0x525b('0x17')](_0x2d531b);})[_0x525b('0x27')](function(_0x263901){logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x3c'),util[_0x525b('0x2a')](_0x263901,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),'afterCreate','connectel',_0x525b('0x40'));}break;case'clicksend':if(_0x43b941[_0x525b('0x2d')]&&_0x43b941['password']){var _0x472719={'messages':[{'source':_0x525b('0x41'),'to':_0x27ce0f[_0x525b('0x20')],'body':_0x27ce0f[_0x525b('0xc')],'from':_0x43b941[_0x525b('0x3d')]||_0x43b941['phone']}]};var _0x443dc0=util[_0x525b('0x42')](_0x525b('0x43'),_0x43b941[_0x525b('0x2d')],_0x43b941[_0x525b('0x2e')]);var _0x535dd9={'method':_0x525b('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x472719,'headers':{'Authorization':util[_0x525b('0x42')]('Basic\x20%s',new Buffer(_0x443dc0)[_0x525b('0x44')](_0x525b('0x45')))},'json':!![]};rp(_0x535dd9)[_0x525b('0x16')](function(_0x275747){if(_0x275747['http_code']>=0xc8&&_0x275747['http_code']<=0xce){if(_0x275747[_0x525b('0x46')]&&_0x275747[_0x525b('0x46')]['queued_count']>0x0){var _0x372b3c=_[_0x525b('0x47')](_0x275747[_0x525b('0x46')][_0x525b('0x21')]);var _0x1d6826={'messageId':_0x372b3c[_0x525b('0x48')]};if(!_0x43b941['deliveryReport']){_0x1d6826[_0x525b('0x3a')]=!![];}return _0x5997d7[_0x525b('0x17')](_0x1d6826);}else{logger[_0x525b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x525b('0x29'),_0x525b('0x49'),util[_0x525b('0x2a')](_0x275747,{'showHidden':![],'depth':null}));}}else{logger[_0x525b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x525b('0x49'),util['inspect'](_0x275747,{'showHidden':![],'depth':null}));}})[_0x525b('0x27')](function(_0x521347){logger[_0x525b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x525b('0x29'),_0x525b('0x49'),util[_0x525b('0x2a')](_0x521347,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),'afterCreate',_0x525b('0x49'),_0x525b('0x3b'));}break;case'plivo':if(_0x43b941[_0x525b('0x4a')]&&_0x43b941[_0x525b('0x1f')]){var _0x472719={'dst':_0x27ce0f[_0x525b('0x20')],'text':_0x27ce0f[_0x525b('0xc')],'src':_0x43b941[_0x525b('0x3d')]||_0x43b941[_0x525b('0x20')],'url':_0x43b941[_0x525b('0x23')]+_0x525b('0x4b')+_0x27ce0f['id']+_0x525b('0x24')+_0x43b941[_0x525b('0x25')]};var _0x443dc0=util[_0x525b('0x42')](_0x525b('0x43'),_0x43b941[_0x525b('0x4a')],_0x43b941['authToken']);var _0x535dd9={'method':_0x525b('0x35'),'uri':util[_0x525b('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x43b941[_0x525b('0x4a')]),'body':_0x472719,'headers':{'Authorization':util['format'](_0x525b('0x4c'),new Buffer(_0x443dc0)[_0x525b('0x44')](_0x525b('0x45')))},'json':!![]};rp(_0x535dd9)[_0x525b('0x16')](function(_0x571873){var _0x1ac3ea={'messageId':_0x571873[_0x525b('0x4d')][0x0]};return _0x5997d7['update'](_0x1ac3ea);})[_0x525b('0x27')](function(_0x209b1a){logger['error'](_0x525b('0x28'),_0x525b('0x29'),'plivo',util[_0x525b('0x2a')](_0x209b1a,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x4e'),_0x525b('0x4f'));}break;case _0x525b('0x50'):if(_0x43b941[_0x525b('0x2d')]&&_0x43b941[_0x525b('0x2e')]){if(_0x43b941[_0x525b('0x51')]){var _0xa14631={'method':_0x525b('0x35'),'uri':_0x43b941[_0x525b('0x51')]+'/auth/1/session','body':{'username':_0x43b941[_0x525b('0x2d')],'password':_0x43b941[_0x525b('0x2e')]},'json':!![]};return rp(_0xa14631)[_0x525b('0x16')](function(_0x3f046c){var _0x5de53f={'method':_0x525b('0x35'),'uri':_0x43b941[_0x525b('0x51')]+_0x525b('0x52'),'body':{'messages':[{'from':_0x43b941[_0x525b('0x20')],'destinations':[{'to':_0x27ce0f[_0x525b('0x20')]}],'text':_0x27ce0f[_0x525b('0xc')],'notifyUrl':_0x43b941['remote']+_0x525b('0x4b')+_0x27ce0f['id']+_0x525b('0x24')+_0x43b941[_0x525b('0x25')],'notifyContentType':_0x525b('0x53'),'callbackData':_0x43b941['phone']+';'+_0x27ce0f[_0x525b('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3f046c['token']},'json':!![]};return rp(_0x5de53f)['then'](function(_0x4b9dbd){if(_0x4b9dbd[_0x525b('0x21')]){var _0x369eee={'messageId':_0x4b9dbd[_0x525b('0x21')][0x0][_0x525b('0xb')]};if(!_0x43b941['deliveryReport']){_0x369eee[_0x525b('0x3a')]=!![];}return _0x5997d7[_0x525b('0x17')](_0x369eee);}else{return logger[_0x525b('0x19')](_0x525b('0x28'),'afterCreate','infobip',util[_0x525b('0x2a')](_0x4b9dbd,{'showHidden':![],'depth':null}));}});})['catch'](function(_0xf0b041){return logger['error'](_0x525b('0x28'),_0x525b('0x29'),'infobip',util[_0x525b('0x2a')](_0xf0b041,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x50'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x50'),_0x525b('0x3b'));}break;case _0x525b('0x54'):var _0x2ae177=require('crypto');if(_0x43b941[_0x525b('0x55')]){var _0xc03cb2={};_0xc03cb2[_0x525b('0x56')]=_0x43b941[_0x525b('0x2d')];_0xc03cb2['phone']=_0x27ce0f['phone'];_0xc03cb2['sender']=_0x43b941['phone'];_0xc03cb2[_0x525b('0x57')]=_0x27ce0f[_0x525b('0xc')];_0xc03cb2[_0x525b('0x58')]=+new Date();var _0x3166b5='';var _0x23d3a8='';var _0x5bc160=Object['keys'](_0xc03cb2);_0x5bc160[_0x525b('0x59')]();for(var _0x1f8b69=0x0;_0x1f8b69<_0x5bc160[_0x525b('0x5a')];_0x1f8b69++){if(_0x3166b5!=''){_0x3166b5+='&';}_0x3166b5+=_0x5bc160[_0x1f8b69]+'='+encodeURIComponent(_0xc03cb2[_0x5bc160[_0x1f8b69]]);_0x23d3a8+=_0xc03cb2[_0x5bc160[_0x1f8b69]];}_0x23d3a8+=_0x43b941[_0x525b('0x55')];_0x23d3a8=_0x2ae177[_0x525b('0x5b')](_0x525b('0x5c'))[_0x525b('0x17')](_0x23d3a8)[_0x525b('0x5d')]('hex');if(_0x3166b5!==''){_0x3166b5+='&';}_0x3166b5+=_0x525b('0x5e')+_0x23d3a8;var _0x1ffae1={'method':_0x525b('0x32'),'uri':_0x43b941['baseUrl']+'/external/get/send.php?'+_0x3166b5,'json':!![]};return rp(_0x1ffae1)['then'](function(_0x1f9f50){var _0x394f0f=Object[_0x525b('0x5f')](_0x1f9f50);if(_0x1f9f50[_0x394f0f[0x0]]['error']&&parseInt(_0x1f9f50[_0x394f0f[0x0]][_0x525b('0x19')])===0x0){var _0x4d002b={'messageId':_0x1f9f50[_0x394f0f[0x0]]['id_sms']};if(!_0x43b941[_0x525b('0x60')]){_0x4d002b[_0x525b('0x3a')]=!![];}return _0x5997d7[_0x525b('0x17')](_0x4d002b);}else{return logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),'csc',util[_0x525b('0x2a')](_0x1f9f50['error'],{'showHidden':![],'depth':null}));}})[_0x525b('0x27')](function(_0x58048b){return logger['error'](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x54'),util[_0x525b('0x2a')](_0x58048b,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x525b('0x29'),_0x525b('0x54'),_0x525b('0x61'));}break;case _0x525b('0x62'):if(_0x43b941[_0x525b('0x55')]){var _0x4c78c9={'method':'POST','uri':_0x525b('0x63'),'headers':{'Authorization':_0x43b941[_0x525b('0x55')]},'body':{'content':_0x27ce0f[_0x525b('0xc')],'to':[_0x27ce0f['phone']],'from':_0x43b941[_0x525b('0x20')],'binary':![],'clientMessageId':_0x525b('0x64'),'charset':_0x525b('0x65')},'json':!![]};rp(_0x4c78c9)[_0x525b('0x16')](function(_0x27ca5f){if(!_0x27ca5f[_0x525b('0x19')]){var _0x1a17c1={'messageId':_0x27ca5f[_0x525b('0x21')][0x0][_0x525b('0x66')]};if(!_0x43b941[_0x525b('0x60')]){_0x1a17c1[_0x525b('0x3a')]=!![];}return _0x5997d7[_0x525b('0x17')](_0x1a17c1);}else{return logger[_0x525b('0x19')](_0x525b('0x28'),'afterCreate',_0x525b('0x62'),util[_0x525b('0x2a')](_0x27ca5f[_0x525b('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x5caa7f){return logger['error'](_0x525b('0x28'),'afterCreate',_0x525b('0x62'),util[_0x525b('0x2a')](_0x5caa7f,{'showHidden':![],'depth':null}));});}else{logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x62'),_0x525b('0x61'));}break;case'bandwidth':if(_0x43b941[_0x525b('0x2d')]&&_0x43b941[_0x525b('0x2e')]){var _0x443dc0=util[_0x525b('0x42')](_0x525b('0x43'),_0x43b941[_0x525b('0x2d')],_0x43b941['password']);var _0x535dd9={'method':_0x525b('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x43b941[_0x525b('0x67')]+_0x525b('0x68'),'body':{'to':[_0x27ce0f[_0x525b('0x20')]],'text':_0x27ce0f[_0x525b('0xc')],'from':_0x43b941[_0x525b('0x20')],'applicationId':_0x43b941[_0x525b('0x69')]},'headers':{'Authorization':util[_0x525b('0x42')](_0x525b('0x4c'),new Buffer(_0x443dc0)[_0x525b('0x44')](_0x525b('0x45')))},'json':!![]};rp(_0x535dd9)[_0x525b('0x16')](function(_0xa21b1a){if(_0xa21b1a['id']){var _0x19ba54={'messageId':_0xa21b1a['id']};return _0x5997d7[_0x525b('0x17')](_0x19ba54);}else{logger[_0x525b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x525b('0x6a'),util[_0x525b('0x2a')](_0xa21b1a,{'showHidden':![],'depth':null}));}})[_0x525b('0x27')](function(_0x48ec6a){logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),'bandwidth',util[_0x525b('0x2a')](_0x48ec6a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x525b('0x28'),'afterCreate',_0x525b('0x6a'),_0x525b('0x3b'));}break;case _0x525b('0x6b'):if(_0x43b941['apiKey']){var _0x57c49c={};var _0x1ffae1={'method':'POST','uri':_0x525b('0x6c'),'headers':{'Authorization':_0x525b('0x6d')+_0x43b941[_0x525b('0x55')],'Content-Type':_0x525b('0x53')},'body':{'from':_0x43b941[_0x525b('0x20')],'to':_0x27ce0f[_0x525b('0x20')],'text':_0x27ce0f[_0x525b('0xc')]},'json':!![]};return rp(_0x1ffae1)[_0x525b('0x16')](function(_0x24c350){if(_0x24c350['code']==0xca){_0x57c49c[_0x525b('0x6e')]=_0x24c350;var _0x187aa4={'method':_0x525b('0x35'),'uri':_0x525b('0x6f'),'headers':{'Authorization':'Bearer\x20'+_0x43b941[_0x525b('0x55')],'Content-Type':_0x525b('0x53')},'body':{'refid':_0x57c49c['message'][_0x525b('0x70')]},'json':!![]};return rp(_0x187aa4)['then'](function(_0x4420fa){_0x57c49c[_0x525b('0x71')]=_0x4420fa;var _0x26aeaf={'messageId':_0x57c49c[_0x525b('0x6e')]['refid'],'read':!![]};return _0x5997d7[_0x525b('0x17')](_0x26aeaf);});}else{return logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x6b'),util[_0x525b('0x2a')](_0x24c350,{'showHidden':![],'depth':null}));}})[_0x525b('0x27')](function(_0x355573){return logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x6b'),util[_0x525b('0x2a')](_0x355573,{'showHidden':![],'depth':null}));});}else{return logger[_0x525b('0x19')](_0x525b('0x28'),_0x525b('0x29'),_0x525b('0x6b'),_0x525b('0x72'));}break;}}})[_0x525b('0x73')](function(){_0x4ba3c2();});}else{_0x4ba3c2();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6ddd=['Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','Missing\x20parameters:\x20base_url','infobip','csc','crypto','apiKey','text','timestamp','keys','length','createHash','md5','digest','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','find','SmsAccountId','then','twilio','accountSid','authToken','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x6ddd,0xae));var _0xd6dd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6ddd[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6dd('0x0'))(_0xd6dd('0x1'));var moment=require(_0xd6dd('0x2'));var BPromise=require(_0xd6dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6dd('0x4'));var rimraf=require('rimraf');var config=require(_0xd6dd('0x5'));var attributes=require('./smsMessage.attributes');module[_0xd6dd('0x6')]=function(_0x27439a,_0x47005f){return _0x27439a['define'](_0xd6dd('0x7'),attributes,{'tableName':_0xd6dd('0x8'),'paranoid':![],'indexes':[{'name':_0xd6dd('0x9'),'fields':[_0xd6dd('0x9')]},{'name':'fti_sms_messages','fields':[_0xd6dd('0xa')],'type':_0xd6dd('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bd0bc,_0x3f39b1,_0x24cff5){var _0x259d75=_0x27439a[_0xd6dd('0xc')];var _0x399823=_0x2bd0bc[_0xd6dd('0xd')]({'plain':!![]});if(_0x399823[_0xd6dd('0xe')][_0xd6dd('0xf')]()==='in'||_0x399823[_0xd6dd('0xe')]['toLowerCase']()===_0xd6dd('0x10')&&!_0x399823[_0xd6dd('0x11')]&&!_[_0xd6dd('0x12')](_0x399823[_0xd6dd('0x13')])){_0x259d75[_0xd6dd('0x14')][_0xd6dd('0x15')]({'where':{'id':_0x399823[_0xd6dd('0x16')]}})['then'](function(_0x305928){if(_0x305928){_0x305928[_0xd6dd('0x17')]({'lastMsgAt':_0x399823[_0xd6dd('0x18')],'lastMsgDirection':_0x399823[_0xd6dd('0xe')][_0xd6dd('0xf')]()});}})[_0xd6dd('0x19')](function(_0x41b358){console[_0xd6dd('0x1a')](_0x41b358);});}if(_0x399823[_0xd6dd('0xe')]===_0xd6dd('0x10')&&!_0x399823[_0xd6dd('0x11')]){var _0x289865;_0x259d75['SmsAccount'][_0xd6dd('0x1b')]({'where':{'id':_0x399823[_0xd6dd('0x1c')]},'raw':!![]})[_0xd6dd('0x1d')](function(_0xc65e92){_0x289865=_0xc65e92;if(_0x289865&&_0x289865['type']){switch(_0x289865['type']){case _0xd6dd('0x1e'):var _0x6945de=require('twilio');if(_0x289865[_0xd6dd('0x1f')]&&_0x289865[_0xd6dd('0x20')]&&_0x289865['phone']){var _0x4436c9=new _0x6945de(_0x289865[_0xd6dd('0x1f')],_0x289865[_0xd6dd('0x20')]);_0x4436c9['messages'][_0xd6dd('0x21')]({'body':_0x399823[_0xd6dd('0xa')],'to':_0x399823[_0xd6dd('0x22')],'from':_0x289865['phone'],'statusCallback':_0x289865[_0xd6dd('0x23')]+_0xd6dd('0x24')+_0x399823['id']+_0xd6dd('0x25')+_0x289865[_0xd6dd('0x26')]})[_0xd6dd('0x1d')](function(_0x33f40b){if(_0x33f40b[_0xd6dd('0x27')]){return _0x2bd0bc['update']({'messageId':_0x33f40b['sid']});}})[_0xd6dd('0x19')](function(_0x48c31a){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd6dd('0x28'),'twilio',util['inspect'](_0x48c31a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x1e'),_0xd6dd('0x2a'));}break;case _0xd6dd('0x2b'):var _0x315e97='https://api.skebby.it/API/v1.0/REST/';if(_0x289865[_0xd6dd('0x2c')]&&_0x289865['password']){var _0x336ec7={'recipient':[_0x399823[_0xd6dd('0x22')]],'message':_0x399823[_0xd6dd('0xa')],'message_type':_0x289865[_0xd6dd('0x2d')]};if(_0x289865[_0xd6dd('0x2d')]&&_0x289865[_0xd6dd('0x2d')]!=='SI'){_0x336ec7[_0xd6dd('0x2e')]=_0x289865[_0xd6dd('0x22')];}var _0x2abb0b={'url':_0x315e97+_0xd6dd('0x2f')+_0x289865['username']+_0xd6dd('0x30')+_0x289865[_0xd6dd('0x31')],'method':_0xd6dd('0x32')};rp(_0x2abb0b)[_0xd6dd('0x1d')](function(_0x2a5a73){var _0x5ef0bc=_0x2a5a73['split'](';');var _0x161a71={'user_key':_0x5ef0bc[0x0],'session_key':_0x5ef0bc[0x1]};_0x2abb0b={'url':_0x315e97+_0xd6dd('0x33'),'method':_0xd6dd('0x34'),'headers':{'user_key':_0x161a71[_0xd6dd('0x35')],'Session_key':_0x161a71[_0xd6dd('0x36')]},'json':!![],'body':_0x336ec7};return rp(_0x2abb0b);})[_0xd6dd('0x1d')](function(_0x1b545f){if(_0x1b545f[_0xd6dd('0x37')]>=0x1){var _0x5b5349={'messageId':_0x1b545f[_0xd6dd('0x38')]};if(_0x289865[_0xd6dd('0x2d')]!=='GP'||!_0x289865[_0xd6dd('0x39')]){_0x5b5349[_0xd6dd('0x3a')]=!![];}return _0x2bd0bc[_0xd6dd('0x17')](_0x5b5349);}else{return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x2b'),util['inspect'](_0x1b545f,{'showHidden':![],'depth':null}));}})[_0xd6dd('0x19')](function(_0x5638cf){return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x2b'),util[_0xd6dd('0x3b')](_0x5638cf,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd6dd('0x28'),_0xd6dd('0x2b'),_0xd6dd('0x3c'));}break;case _0xd6dd('0x3d'):if(_0x289865[_0xd6dd('0x20')]){var _0x48991f={'recipient':_0x399823['phone'],'message':_0x399823[_0xd6dd('0xa')],'sender':_0x289865[_0xd6dd('0x3e')]||_0x289865[_0xd6dd('0x22')],'authorization':_0x289865[_0xd6dd('0x20')]};var _0x3f39b1={'method':_0xd6dd('0x34'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x48991f,'json':!![]};rp(_0x3f39b1)[_0xd6dd('0x1d')](function(_0x4a5989){var _0x561e70={'messageId':_0x4a5989[_0xd6dd('0x3f')]};if(!_0x289865[_0xd6dd('0x39')]){_0x561e70[_0xd6dd('0x3a')]=!![];}return _0x2bd0bc[_0xd6dd('0x17')](_0x561e70);})[_0xd6dd('0x19')](function(_0x6ec07b){logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x3d'),util[_0xd6dd('0x3b')](_0x6ec07b,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x3d'),_0xd6dd('0x40'));}break;case'clicksend':if(_0x289865[_0xd6dd('0x2c')]&&_0x289865['password']){var _0x48991f={'messages':[{'source':_0xd6dd('0x41'),'to':_0x399823['phone'],'body':_0x399823['body'],'from':_0x289865[_0xd6dd('0x3e')]||_0x289865['phone']}]};var _0x985f41=util[_0xd6dd('0x42')](_0xd6dd('0x43'),_0x289865['username'],_0x289865['password']);var _0x3f39b1={'method':_0xd6dd('0x34'),'uri':_0xd6dd('0x44'),'body':_0x48991f,'headers':{'Authorization':util[_0xd6dd('0x42')](_0xd6dd('0x45'),new Buffer(_0x985f41)[_0xd6dd('0x46')](_0xd6dd('0x47')))},'json':!![]};rp(_0x3f39b1)['then'](function(_0x1e7d69){if(_0x1e7d69[_0xd6dd('0x48')]>=0xc8&&_0x1e7d69[_0xd6dd('0x48')]<=0xce){if(_0x1e7d69['data']&&_0x1e7d69[_0xd6dd('0x49')][_0xd6dd('0x4a')]>0x0){var _0x29494e=_[_0xd6dd('0x4b')](_0x1e7d69[_0xd6dd('0x49')][_0xd6dd('0x4c')]);var _0x1aab46={'messageId':_0x29494e[_0xd6dd('0x4d')]};if(!_0x289865['deliveryReport']){_0x1aab46[_0xd6dd('0x3a')]=!![];}return _0x2bd0bc[_0xd6dd('0x17')](_0x1aab46);}else{logger[_0xd6dd('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd6dd('0x28'),_0xd6dd('0x4e'),util[_0xd6dd('0x3b')](_0x1e7d69,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x4e'),util[_0xd6dd('0x3b')](_0x1e7d69,{'showHidden':![],'depth':null}));}})[_0xd6dd('0x19')](function(_0x31dfc3){logger['error'](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x4e'),util[_0xd6dd('0x3b')](_0x31dfc3,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd6dd('0x28'),_0xd6dd('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd6dd('0x4f'):if(_0x289865[_0xd6dd('0x50')]&&_0x289865[_0xd6dd('0x20')]){var _0x48991f={'dst':_0x399823[_0xd6dd('0x22')],'text':_0x399823[_0xd6dd('0xa')],'src':_0x289865[_0xd6dd('0x3e')]||_0x289865[_0xd6dd('0x22')],'url':_0x289865[_0xd6dd('0x23')]+'/api/sms/messages/'+_0x399823['id']+_0xd6dd('0x25')+_0x289865['token']};var _0x985f41=util[_0xd6dd('0x42')](_0xd6dd('0x43'),_0x289865[_0xd6dd('0x50')],_0x289865[_0xd6dd('0x20')]);var _0x3f39b1={'method':'POST','uri':util['format'](_0xd6dd('0x51'),_0x289865[_0xd6dd('0x50')]),'body':_0x48991f,'headers':{'Authorization':util['format'](_0xd6dd('0x45'),new Buffer(_0x985f41)[_0xd6dd('0x46')](_0xd6dd('0x47')))},'json':!![]};rp(_0x3f39b1)[_0xd6dd('0x1d')](function(_0x539a2e){var _0x3b559f={'messageId':_0x539a2e[_0xd6dd('0x52')][0x0]};return _0x2bd0bc[_0xd6dd('0x17')](_0x3b559f);})[_0xd6dd('0x19')](function(_0x45502d){logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),'plivo',util[_0xd6dd('0x3b')](_0x45502d,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd6dd('0x28'),_0xd6dd('0x4f'),_0xd6dd('0x53'));}break;case'infobip':if(_0x289865[_0xd6dd('0x2c')]&&_0x289865[_0xd6dd('0x31')]){if(_0x289865['baseUrl']){var _0x1bb409={'method':_0xd6dd('0x34'),'uri':_0x289865[_0xd6dd('0x54')]+'/auth/1/session','body':{'username':_0x289865[_0xd6dd('0x2c')],'password':_0x289865[_0xd6dd('0x31')]},'json':!![]};return rp(_0x1bb409)[_0xd6dd('0x1d')](function(_0x46ebdc){var _0x1ecff7={'method':_0xd6dd('0x34'),'uri':_0x289865[_0xd6dd('0x54')]+_0xd6dd('0x55'),'body':{'messages':[{'from':_0x289865[_0xd6dd('0x22')],'destinations':[{'to':_0x399823[_0xd6dd('0x22')]}],'text':_0x399823['body'],'notifyUrl':_0x289865[_0xd6dd('0x23')]+_0xd6dd('0x24')+_0x399823['id']+_0xd6dd('0x25')+_0x289865[_0xd6dd('0x26')],'notifyContentType':'application/json','callbackData':_0x289865['phone']+';'+_0x399823[_0xd6dd('0xa')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x46ebdc[_0xd6dd('0x26')]},'json':!![]};return rp(_0x1ecff7)['then'](function(_0x5e7cc7){if(_0x5e7cc7[_0xd6dd('0x4c')]){var _0x366821={'messageId':_0x5e7cc7[_0xd6dd('0x4c')][0x0][_0xd6dd('0x9')]};if(!_0x289865['deliveryReport']){_0x366821['read']=!![];}return _0x2bd0bc[_0xd6dd('0x17')](_0x366821);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0xd6dd('0x3b')](_0x5e7cc7,{'showHidden':![],'depth':null}));}});})[_0xd6dd('0x19')](function(_0x2e19c6){return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),'infobip',util[_0xd6dd('0x3b')](_0x2e19c6,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),'infobip',_0xd6dd('0x56'));}}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x57'),_0xd6dd('0x3c'));}break;case _0xd6dd('0x58'):var _0x40ad0f=require(_0xd6dd('0x59'));if(_0x289865[_0xd6dd('0x5a')]){var _0x4d166b={};_0x4d166b['login']=_0x289865['username'];_0x4d166b[_0xd6dd('0x22')]=_0x399823[_0xd6dd('0x22')];_0x4d166b['sender']=_0x289865[_0xd6dd('0x22')];_0x4d166b[_0xd6dd('0x5b')]=_0x399823['body'];_0x4d166b[_0xd6dd('0x5c')]=+new Date();var _0x270f17='';var _0x2acb5e='';var _0x46c60b=Object[_0xd6dd('0x5d')](_0x4d166b);_0x46c60b['sort']();for(var _0xb3c674=0x0;_0xb3c674<_0x46c60b[_0xd6dd('0x5e')];_0xb3c674++){if(_0x270f17!=''){_0x270f17+='&';}_0x270f17+=_0x46c60b[_0xb3c674]+'='+encodeURIComponent(_0x4d166b[_0x46c60b[_0xb3c674]]);_0x2acb5e+=_0x4d166b[_0x46c60b[_0xb3c674]];}_0x2acb5e+=_0x289865[_0xd6dd('0x5a')];_0x2acb5e=_0x40ad0f[_0xd6dd('0x5f')](_0xd6dd('0x60'))['update'](_0x2acb5e)[_0xd6dd('0x61')]('hex');if(_0x270f17!==''){_0x270f17+='&';}_0x270f17+=_0xd6dd('0x62')+_0x2acb5e;var _0x2abb0b={'method':_0xd6dd('0x32'),'uri':_0x289865[_0xd6dd('0x54')]+_0xd6dd('0x63')+_0x270f17,'json':!![]};return rp(_0x2abb0b)[_0xd6dd('0x1d')](function(_0x38b743){var _0x399d31=Object[_0xd6dd('0x5d')](_0x38b743);if(_0x38b743[_0x399d31[0x0]][_0xd6dd('0x1a')]&&parseInt(_0x38b743[_0x399d31[0x0]][_0xd6dd('0x1a')])===0x0){var _0x527b1b={'messageId':_0x38b743[_0x399d31[0x0]]['id_sms']};if(!_0x289865[_0xd6dd('0x39')]){_0x527b1b[_0xd6dd('0x3a')]=!![];}return _0x2bd0bc['update'](_0x527b1b);}else{return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x58'),util[_0xd6dd('0x3b')](_0x38b743[_0xd6dd('0x1a')],{'showHidden':![],'depth':null}));}})[_0xd6dd('0x19')](function(_0x528fb7){return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x58'),util[_0xd6dd('0x3b')](_0x528fb7,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x58'),_0xd6dd('0x64'));}break;case _0xd6dd('0x65'):if(_0x289865[_0xd6dd('0x5a')]){var _0x4e9248={'method':_0xd6dd('0x34'),'uri':_0xd6dd('0x66'),'headers':{'Authorization':_0x289865[_0xd6dd('0x5a')]},'body':{'content':_0x399823[_0xd6dd('0xa')],'to':[_0x399823['phone']],'from':_0x289865[_0xd6dd('0x22')],'binary':![],'clientMessageId':_0xd6dd('0x67'),'charset':_0xd6dd('0x68')},'json':!![]};rp(_0x4e9248)['then'](function(_0x42378d){if(!_0x42378d[_0xd6dd('0x1a')]){var _0x2ee8ce={'messageId':_0x42378d[_0xd6dd('0x4c')][0x0]['apiMessageId']};if(!_0x289865[_0xd6dd('0x39')]){_0x2ee8ce[_0xd6dd('0x3a')]=!![];}return _0x2bd0bc['update'](_0x2ee8ce);}else{return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x65'),util[_0xd6dd('0x3b')](_0x42378d[_0xd6dd('0x1a')],{'showHidden':![],'depth':null}));}})[_0xd6dd('0x19')](function(_0x25edab){return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate','clickatell',util[_0xd6dd('0x3b')](_0x25edab,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0xd6dd('0x69'):if(_0x289865[_0xd6dd('0x2c')]&&_0x289865[_0xd6dd('0x31')]){var _0x985f41=util[_0xd6dd('0x42')]('%s:%s',_0x289865[_0xd6dd('0x2c')],_0x289865[_0xd6dd('0x31')]);var _0x3f39b1={'method':_0xd6dd('0x34'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x289865[_0xd6dd('0x6a')]+_0xd6dd('0x6b'),'body':{'to':[_0x399823[_0xd6dd('0x22')]],'text':_0x399823[_0xd6dd('0xa')],'from':_0x289865[_0xd6dd('0x22')],'applicationId':_0x289865[_0xd6dd('0x6c')]},'headers':{'Authorization':util[_0xd6dd('0x42')](_0xd6dd('0x45'),new Buffer(_0x985f41)[_0xd6dd('0x46')](_0xd6dd('0x47')))},'json':!![]};rp(_0x3f39b1)['then'](function(_0x9eea8){if(_0x9eea8['id']){var _0x42ad31={'messageId':_0x9eea8['id']};return _0x2bd0bc[_0xd6dd('0x17')](_0x42ad31);}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x69'),util[_0xd6dd('0x3b')](_0x9eea8,{'showHidden':![],'depth':null}));}})[_0xd6dd('0x19')](function(_0x37fe0e){logger[_0xd6dd('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util['inspect'](_0x37fe0e,{'showHidden':![],'depth':null}));});}else{logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x69'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd6dd('0x6d'):if(_0x289865[_0xd6dd('0x5a')]){var _0x5e376b={};var _0x2abb0b={'method':_0xd6dd('0x34'),'uri':_0xd6dd('0x6e'),'headers':{'Authorization':_0xd6dd('0x6f')+_0x289865[_0xd6dd('0x5a')],'Content-Type':_0xd6dd('0x70')},'body':{'from':_0x289865[_0xd6dd('0x22')],'to':_0x399823[_0xd6dd('0x22')],'text':_0x399823[_0xd6dd('0xa')]},'json':!![]};return rp(_0x2abb0b)['then'](function(_0x2c3838){if(_0x2c3838[_0xd6dd('0x71')]==0xca){_0x5e376b[_0xd6dd('0x72')]=_0x2c3838;var _0x2b0752={'method':_0xd6dd('0x34'),'uri':_0xd6dd('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x289865[_0xd6dd('0x5a')],'Content-Type':_0xd6dd('0x70')},'body':{'refid':_0x5e376b[_0xd6dd('0x72')][_0xd6dd('0x74')]},'json':!![]};return rp(_0x2b0752)[_0xd6dd('0x1d')](function(_0x386d47){_0x5e376b['status']=_0x386d47;var _0x53c51b={'messageId':_0x5e376b[_0xd6dd('0x72')][_0xd6dd('0x74')],'read':!![]};return _0x2bd0bc[_0xd6dd('0x17')](_0x53c51b);});}else{return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),_0xd6dd('0x28'),_0xd6dd('0x6d'),util['inspect'](_0x2c3838,{'showHidden':![],'depth':null}));}})[_0xd6dd('0x19')](function(_0xff18bd){return logger[_0xd6dd('0x1a')](_0xd6dd('0x29'),'afterCreate',_0xd6dd('0x6d'),util['inspect'](_0xff18bd,{'showHidden':![],'depth':null}));});}else{return logger[_0xd6dd('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd6dd('0x28'),'intelepeer','Token\x20not\x20received');}break;}}})['finally'](function(){_0x24cff5();});}else{_0x24cff5();}}},'charset':_0xd6dd('0x75'),'collate':_0xd6dd('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ba9f8fa..fa4558b 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 _0xe71b=['../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','body','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x18a881,_0xc048bf){var _0x165bc8=function(_0x105735){while(--_0x105735){_0x18a881['push'](_0x18a881['shift']());}};_0x165bc8(++_0xc048bf);}(_0xe71b,0x117));var _0xbe71=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xe71b[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xbe71('0x0'));var util=require(_0xbe71('0x1'));var moment=require(_0xbe71('0x2'));var BPromise=require(_0xbe71('0x3'));var rs=require(_0xbe71('0x4'));var fs=require('fs');var Redis=require(_0xbe71('0x5'));var db=require(_0xbe71('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe71('0x7'))(_0xbe71('0x8'));var config=require(_0xbe71('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe71('0xa')][_0xbe71('0xb')]({'port':0x232a});config[_0xbe71('0xc')]=_['defaults'](config[_0xbe71('0xc')],{'host':_0xbe71('0xd'),'port':0x18eb});var socket=require(_0xbe71('0xe'))(new Redis(config['redis']));require(_0xbe71('0xf'))[_0xbe71('0x10')](socket);function respondWithRpcPromise(_0xdd452c,_0x36f688,_0x29dc69){return new BPromise(function(_0x3a98d4,_0x5cf80a){return client[_0xbe71('0x11')](_0xdd452c,_0x29dc69)[_0xbe71('0x12')](function(_0x3731a2){logger[_0xbe71('0x13')](_0xbe71('0x14'),_0x36f688,_0xbe71('0x15'));logger[_0xbe71('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x36f688,_0xbe71('0x15'),JSON[_0xbe71('0x17')](_0x3731a2));if(_0x3731a2[_0xbe71('0x18')]){if(_0x3731a2[_0xbe71('0x18')][_0xbe71('0x19')]===0x1f4){logger[_0xbe71('0x18')](_0xbe71('0x14'),_0x36f688,_0x3731a2[_0xbe71('0x18')]['message']);return _0x5cf80a(_0x3731a2[_0xbe71('0x18')][_0xbe71('0x1a')]);}logger[_0xbe71('0x18')](_0xbe71('0x14'),_0x36f688,_0x3731a2['error']['message']);return _0x3a98d4(_0x3731a2[_0xbe71('0x18')][_0xbe71('0x1a')]);}else{logger[_0xbe71('0x13')](_0xbe71('0x14'),_0x36f688,_0xbe71('0x15'));_0x3a98d4(_0x3731a2[_0xbe71('0x1b')]['message']);}})['catch'](function(_0x225852){logger[_0xbe71('0x18')](_0xbe71('0x14'),_0x36f688,_0x225852);_0x5cf80a(_0x225852);});});}exports['CreateSmsMessage']=function(_0x4c05e2){var _0x448379=this;return new Promise(function(_0x2f2668,_0x331c10){return db['SmsMessage']['create'](_0x4c05e2[_0xbe71('0x1c')],{'raw':_0x4c05e2[_0xbe71('0x1d')]?_0x4c05e2['options'][_0xbe71('0x1e')]===undefined?!![]:![]:!![]})[_0xbe71('0x12')](function(_0x3969c1){logger[_0xbe71('0x13')]('CreateSmsMessage',_0x4c05e2);logger[_0xbe71('0x16')]('CreateSmsMessage',_0x4c05e2,JSON[_0xbe71('0x17')](_0x3969c1));_0x2f2668(_0x3969c1);})['catch'](function(_0x9f5361){logger['error'](_0xbe71('0x1f'),_0x9f5361[_0xbe71('0x1a')],_0x4c05e2);_0x331c10(_0x448379[_0xbe71('0x18')](0x1f4,_0x9f5361[_0xbe71('0x1a')]));});});}; \ No newline at end of file +var _0xa828=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','create','body','options','raw','catch','lodash'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0xa828,0xd1));var _0x8a82=function(_0x46894c,_0x15c966){_0x46894c=_0x46894c-0x0;var _0x4938c0=_0xa828[_0x46894c];return _0x4938c0;};'use strict';var _=require(_0x8a82('0x0'));var util=require(_0x8a82('0x1'));var moment=require(_0x8a82('0x2'));var BPromise=require(_0x8a82('0x3'));var rs=require(_0x8a82('0x4'));var fs=require('fs');var Redis=require(_0x8a82('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a82('0x6'));var logger=require(_0x8a82('0x7'))(_0x8a82('0x8'));var config=require(_0x8a82('0x9'));var jayson=require(_0x8a82('0xa'));var client=jayson[_0x8a82('0xb')]['http']({'port':0x232a});config['redis']=_[_0x8a82('0xc')](config['redis'],{'host':_0x8a82('0xd'),'port':0x18eb});var socket=require(_0x8a82('0xe'))(new Redis(config[_0x8a82('0xf')]));require('./smsMessage.socket')[_0x8a82('0x10')](socket);function respondWithRpcPromise(_0xfaa75,_0x130084,_0x389b36){return new BPromise(function(_0x22427e,_0x465b1c){return client[_0x8a82('0x11')](_0xfaa75,_0x389b36)[_0x8a82('0x12')](function(_0x328d31){logger[_0x8a82('0x13')](_0x8a82('0x14'),_0x130084,_0x8a82('0x15'));logger[_0x8a82('0x16')](_0x8a82('0x17'),_0x130084,'request\x20sent',JSON[_0x8a82('0x18')](_0x328d31));if(_0x328d31[_0x8a82('0x19')]){if(_0x328d31[_0x8a82('0x19')][_0x8a82('0x1a')]===0x1f4){logger[_0x8a82('0x19')]('SmsMessage,\x20%s,\x20%s',_0x130084,_0x328d31['error']['message']);return _0x465b1c(_0x328d31[_0x8a82('0x19')][_0x8a82('0x1b')]);}logger[_0x8a82('0x19')](_0x8a82('0x14'),_0x130084,_0x328d31[_0x8a82('0x19')][_0x8a82('0x1b')]);return _0x22427e(_0x328d31[_0x8a82('0x19')]['message']);}else{logger[_0x8a82('0x13')](_0x8a82('0x14'),_0x130084,_0x8a82('0x15'));_0x22427e(_0x328d31[_0x8a82('0x1c')]['message']);}})['catch'](function(_0x2dc3d0){logger[_0x8a82('0x19')](_0x8a82('0x14'),_0x130084,_0x2dc3d0);_0x465b1c(_0x2dc3d0);});});}exports[_0x8a82('0x1d')]=function(_0x513007){var _0x101791=this;return new Promise(function(_0x3c02cd,_0x142d47){return db['SmsMessage'][_0x8a82('0x1e')](_0x513007[_0x8a82('0x1f')],{'raw':_0x513007[_0x8a82('0x20')]?_0x513007[_0x8a82('0x20')][_0x8a82('0x21')]===undefined?!![]:![]:!![]})[_0x8a82('0x12')](function(_0x59f606){logger[_0x8a82('0x13')](_0x8a82('0x1d'),_0x513007);logger[_0x8a82('0x16')](_0x8a82('0x1d'),_0x513007,JSON[_0x8a82('0x18')](_0x59f606));_0x3c02cd(_0x59f606);})[_0x8a82('0x22')](function(_0x335a2f){logger[_0x8a82('0x19')](_0x8a82('0x1d'),_0x335a2f['message'],_0x513007);_0x142d47(_0x101791[_0x8a82('0x19')](0x1f4,_0x335a2f[_0x8a82('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c8e73db..3e3bddf 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 _0x2d3b=['emit','removeListener','register','length','save','remove'];(function(_0x1bf301,_0xda5c4c){var _0x51c947=function(_0x5196d5){while(--_0x5196d5){_0x1bf301['push'](_0x1bf301['shift']());}};_0x51c947(++_0xda5c4c);}(_0x2d3b,0x118));var _0xb2d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x2d3b[_0x278e3c];return _0x3e2d9b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xb2d3('0x0'),_0xb2d3('0x1'),'update'];function createListener(_0x458e3b,_0x16d195){return function(_0x448830){_0x16d195[_0xb2d3('0x2')](_0x458e3b,_0x448830);};}function removeListener(_0x4f5e6e,_0x439f50){return function(){SmsMessageEvents[_0xb2d3('0x3')](_0x4f5e6e,_0x439f50);};}exports[_0xb2d3('0x4')]=function(_0x4c1a36){for(var _0xb86597=0x0,_0x483e25=events[_0xb2d3('0x5')];_0xb86597<_0x483e25;_0xb86597++){var _0x5e8016=events[_0xb86597];var _0x3d1f5a=createListener('smsMessage:'+_0x5e8016,_0x4c1a36);SmsMessageEvents['on'](_0x5e8016,_0x3d1f5a);}}; \ No newline at end of file +var _0x0e46=['remove','removeListener','register','./smsMessage.events','save'];(function(_0x2b62c8,_0x36c80b){var _0x569ebb=function(_0x1f2f37){while(--_0x1f2f37){_0x2b62c8['push'](_0x2b62c8['shift']());}};_0x569ebb(++_0x36c80b);}(_0x0e46,0x161));var _0x60e4=function(_0x2a9a31,_0x4eac39){_0x2a9a31=_0x2a9a31-0x0;var _0x4c5035=_0x0e46[_0x2a9a31];return _0x4c5035;};'use strict';var SmsMessageEvents=require(_0x60e4('0x0'));var events=[_0x60e4('0x1'),_0x60e4('0x2'),'update'];function createListener(_0x3f7940,_0x45bc83){return function(_0x2823e2){_0x45bc83['emit'](_0x3f7940,_0x2823e2);};}function removeListener(_0x1726d4,_0x3148e9){return function(){SmsMessageEvents[_0x60e4('0x3')](_0x1726d4,_0x3148e9);};}exports[_0x60e4('0x4')]=function(_0x3e0863){for(var _0x5e6d15=0x0,_0x3bad2e=events['length'];_0x5e6d15<_0x3bad2e;_0x5e6d15++){var _0x59b525=events[_0x5e6d15];var _0x43aebe=createListener('smsMessage:'+_0x59b525,_0x3e0863);SmsMessageEvents['on'](_0x59b525,_0x43aebe);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5433512..af1d4f6 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 _0x352d=['getAgents','post','create','/:id/teams','addTeams','addAgents','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','getTeams','/:id/users'];(function(_0x487730,_0x48bc6f){var _0x4a9789=function(_0x24a0d5){while(--_0x24a0d5){_0x487730['push'](_0x487730['shift']());}};_0x4a9789(++_0x48bc6f);}(_0x352d,0xa0));var _0xd352=function(_0x257f44,_0x3f1528){_0x257f44=_0x257f44-0x0;var _0x8006ca=_0x352d[_0x257f44];return _0x8006ca;};'use strict';var multer=require(_0xd352('0x0'));var util=require(_0xd352('0x1'));var path=require(_0xd352('0x2'));var timeout=require('connect-timeout');var express=require(_0xd352('0x3'));var router=express[_0xd352('0x4')]();var fs_extra=require(_0xd352('0x5'));var auth=require(_0xd352('0x6'));var interaction=require(_0xd352('0x7'));var config=require(_0xd352('0x8'));var controller=require(_0xd352('0x9'));router[_0xd352('0xa')]('/',auth['isAuthenticated'](),controller[_0xd352('0xb')]);router[_0xd352('0xa')](_0xd352('0xc'),auth['isAuthenticated'](),controller[_0xd352('0xd')]);router['get'](_0xd352('0xe'),auth[_0xd352('0xf')](),controller[_0xd352('0x10')]);router[_0xd352('0xa')]('/:id/members',auth[_0xd352('0xf')](),controller[_0xd352('0x11')]);router[_0xd352('0xa')]('/:id/teams',auth[_0xd352('0xf')](),controller[_0xd352('0x12')]);router[_0xd352('0xa')](_0xd352('0x13'),auth[_0xd352('0xf')](),controller[_0xd352('0x14')]);router[_0xd352('0x15')]('/',auth[_0xd352('0xf')](),controller[_0xd352('0x16')]);router[_0xd352('0x15')](_0xd352('0x17'),auth[_0xd352('0xf')](),controller[_0xd352('0x18')]);router[_0xd352('0x15')](_0xd352('0x13'),auth[_0xd352('0xf')](),controller[_0xd352('0x19')]);router['put'](_0xd352('0xe'),auth[_0xd352('0xf')](),controller['update']);router[_0xd352('0x1a')](_0xd352('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xd352('0x1a')]('/:id/teams',auth[_0xd352('0xf')](),controller[_0xd352('0x1b')]);router[_0xd352('0x1a')](_0xd352('0x13'),auth[_0xd352('0xf')](),controller[_0xd352('0x1c')]);module[_0xd352('0x1d')]=router; \ No newline at end of file +var _0x036c=['Router','fs-extra','../../components/auth/service','./smsQueue.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','express'];(function(_0x8fffd5,_0x56e6f7){var _0x5ed62f=function(_0x1d3565){while(--_0x1d3565){_0x8fffd5['push'](_0x8fffd5['shift']());}};_0x5ed62f(++_0x56e6f7);}(_0x036c,0x1af));var _0xc036=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x036c[_0x411add];return _0x238242;};'use strict';var multer=require(_0xc036('0x0'));var util=require(_0xc036('0x1'));var path=require(_0xc036('0x2'));var timeout=require('connect-timeout');var express=require(_0xc036('0x3'));var router=express[_0xc036('0x4')]();var fs_extra=require(_0xc036('0x5'));var auth=require(_0xc036('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc036('0x7'));router['get']('/',auth[_0xc036('0x8')](),controller['index']);router['get'](_0xc036('0x9'),auth[_0xc036('0x8')](),controller[_0xc036('0xa')]);router[_0xc036('0xb')](_0xc036('0xc'),auth['isAuthenticated'](),controller[_0xc036('0xd')]);router[_0xc036('0xb')](_0xc036('0xe'),auth[_0xc036('0x8')](),controller[_0xc036('0xf')]);router['get'](_0xc036('0x10'),auth[_0xc036('0x8')](),controller[_0xc036('0x11')]);router[_0xc036('0xb')](_0xc036('0x12'),auth['isAuthenticated'](),controller[_0xc036('0x13')]);router['post']('/',auth[_0xc036('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xc036('0x8')](),controller[_0xc036('0x14')]);router[_0xc036('0x15')](_0xc036('0x12'),auth[_0xc036('0x8')](),controller[_0xc036('0x16')]);router[_0xc036('0x17')](_0xc036('0xc'),auth[_0xc036('0x8')](),controller[_0xc036('0x18')]);router[_0xc036('0x19')](_0xc036('0xc'),auth[_0xc036('0x8')](),controller[_0xc036('0x1a')]);router[_0xc036('0x19')](_0xc036('0x10'),auth[_0xc036('0x8')](),controller[_0xc036('0x1b')]);router[_0xc036('0x19')](_0xc036('0x12'),auth[_0xc036('0x8')](),controller[_0xc036('0x1c')]);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 de158ae..1facbdc 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 _0x84e8=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x84e8,0x184));var _0x884e=function(_0x2cdeee,_0x362a32){_0x2cdeee=_0x2cdeee-0x0;var _0x3058dd=_0x84e8[_0x2cdeee];return _0x3058dd;};'use strict';var Sequelize=require(_0x884e('0x0'));module[_0x884e('0x1')]={'name':{'type':Sequelize[_0x884e('0x2')],'unique':_0x884e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x884e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x884e('0x5')](_0x884e('0x6'),_0x884e('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x289e=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3212d0,_0x5dba40){var _0x2f1dc5=function(_0x2468c5){while(--_0x2468c5){_0x3212d0['push'](_0x3212d0['shift']());}};_0x2f1dc5(++_0x5dba40);}(_0x289e,0xb2));var _0xe289=function(_0x4905e6,_0xf1295c){_0x4905e6=_0x4905e6-0x0;var _0x1f7655=_0x289e[_0x4905e6];return _0x1f7655;};'use strict';var Sequelize=require(_0xe289('0x0'));module[_0xe289('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe289('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe289('0x3')]},'timeout':{'type':Sequelize[_0xe289('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe289('0x5')](_0xe289('0x6'),_0xe289('0x7'),_0xe289('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 0ce5057..558e6dc 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 _0xe61c=['apply','save','update','then','get','SmsQueues','UserProfileResource','destroy','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','SmsQueue','catch','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','order','SmsQueueId','findAll','findAndCountAll','agent','updatedAt','createdAt','rows','SIP','smsPause','getTeams','Team','rawAttributes','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','User','select','field','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x1979e4,_0x26173e){var _0x5453c1=function(_0x47ab6c){while(--_0x47ab6c){_0x1979e4['push'](_0x1979e4['shift']());}};_0x5453c1(++_0x26173e);}(_0xe61c,0xee));var _0xce61=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xe61c[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0xce61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce61('0x1'));var jsonpatch=require(_0xce61('0x2'));var rp=require(_0xce61('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xce61('0x4'));var util=require('util');var path=require(_0xce61('0x5'));var sox=require(_0xce61('0x6'));var csv=require(_0xce61('0x7'));var ejs=require(_0xce61('0x8'));var fs=require('fs');var fs_extra=require(_0xce61('0x9'));var _=require(_0xce61('0xa'));var squel=require(_0xce61('0xb'));var crypto=require('crypto');var jsforce=require(_0xce61('0xc'));var deskjs=require(_0xce61('0xd'));var toCsv=require(_0xce61('0x7'));var querystring=require(_0xce61('0xe'));var Papa=require(_0xce61('0xf'));var Redis=require(_0xce61('0x10'));var authService=require(_0xce61('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce61('0x12'));var hardwareService=require(_0xce61('0x13'));var logger=require('../../config/logger')(_0xce61('0x14'));var utils=require(_0xce61('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xce61('0x16'));var db=require('../../mysqldb')['db'];config[_0xce61('0x17')]=_[_0xce61('0x18')](config['redis'],{'host':_0xce61('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce61('0x17')]));require('./smsQueue.socket')[_0xce61('0x1a')](socket);function respondWithStatusCode(_0x17b690,_0x1d7012){_0x1d7012=_0x1d7012||0xcc;return function(_0x3185ae){if(_0x3185ae){return _0x17b690[_0xce61('0x1b')](_0x1d7012);}return _0x17b690['status'](_0x1d7012)['end']();};}function respondWithResult(_0x330cae,_0x5a1398){_0x5a1398=_0x5a1398||0xc8;return function(_0x590cb3){if(_0x590cb3){return _0x330cae[_0xce61('0x1c')](_0x5a1398)[_0xce61('0x1d')](_0x590cb3);}};}function respondWithFilteredResult(_0x1a0553,_0x47eb72){return function(_0x37d4a0){if(_0x37d4a0){var _0x4baf32=typeof _0x47eb72[_0xce61('0x1e')]===_0xce61('0x1f')&&typeof _0x47eb72[_0xce61('0x20')]===_0xce61('0x1f');var _0x3e30fa=_0x37d4a0[_0xce61('0x21')];var _0xea8db2=_0x4baf32?0x0:_0x47eb72[_0xce61('0x1e')];var _0x5ddf64=_0x4baf32?_0x37d4a0['count']:_0x47eb72[_0xce61('0x1e')]+_0x47eb72['limit'];var _0x336ff9;if(_0x5ddf64>=_0x3e30fa){_0x5ddf64=_0x3e30fa;_0x336ff9=0xc8;}else{_0x336ff9=0xce;}_0x1a0553[_0xce61('0x1c')](_0x336ff9);return _0x1a0553[_0xce61('0x22')](_0xce61('0x23'),_0xea8db2+'-'+_0x5ddf64+'/'+_0x3e30fa)[_0xce61('0x1d')](_0x37d4a0);}return null;};}function patchUpdates(_0x3e1957){return function(_0x8d5bb2){try{jsonpatch[_0xce61('0x24')](_0x8d5bb2,_0x3e1957,!![]);}catch(_0x479691){return BPromise['reject'](_0x479691);}return _0x8d5bb2[_0xce61('0x25')]();};}function saveUpdates(_0x2e559b,_0x202c09){return function(_0x15b6e7){if(_0x15b6e7){return _0x15b6e7[_0xce61('0x26')](_0x2e559b)[_0xce61('0x27')](function(_0x471a08){return _0x471a08;});}return null;};}function removeEntity(_0x274f04,_0x33c3ad){return function(_0x2758e4){if(_0x2758e4){return _0x2758e4['destroy']()[_0xce61('0x27')](function(){var _0x48b544=_0x2758e4[_0xce61('0x28')]({'plain':!![]});var _0x2de420=_0xce61('0x29');return db[_0xce61('0x2a')][_0xce61('0x2b')]({'where':{'type':_0x2de420,'resourceId':_0x48b544['id']}})['then'](function(){return _0x2758e4;});})[_0xce61('0x27')](function(){_0x274f04[_0xce61('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e9020,_0x5cb588){return function(_0x1d6220){if(!_0x1d6220){_0x4e9020[_0xce61('0x1b')](0x194);}return _0x1d6220;};}function handleError(_0x4206c7,_0x3a71b4){_0x3a71b4=_0x3a71b4||0x1f4;return function(_0x2a882d){logger['error'](_0x2a882d[_0xce61('0x2c')]);if(_0x2a882d[_0xce61('0x2d')]){delete _0x2a882d['name'];}_0x4206c7[_0xce61('0x1c')](_0x3a71b4)[_0xce61('0x2e')](_0x2a882d);};}exports['index']=function(_0xcface1,_0x3567cd){var _0x53fa92={},_0x3c9163={},_0x4a921f={'count':0x0,'rows':[]};var _0x303295=_['map'](db['SmsQueue']['rawAttributes'],function(_0x1955d3){return{'name':_0x1955d3[_0xce61('0x2f')],'type':_0x1955d3[_0xce61('0x30')][_0xce61('0x31')]};});_0x3c9163[_0xce61('0x32')]=_[_0xce61('0x33')](_0x303295,_0xce61('0x2d'));_0x3c9163[_0xce61('0x34')]=_[_0xce61('0x35')](_0xcface1[_0xce61('0x34')]);_0x3c9163[_0xce61('0x36')]=_[_0xce61('0x37')](_0x3c9163[_0xce61('0x32')],_0x3c9163[_0xce61('0x34')]);_0x53fa92[_0xce61('0x38')]=_[_0xce61('0x37')](_0x3c9163[_0xce61('0x32')],qs[_0xce61('0x39')](_0xcface1[_0xce61('0x34')][_0xce61('0x39')]));_0x53fa92['attributes']=_0x53fa92[_0xce61('0x38')][_0xce61('0x3a')]?_0x53fa92[_0xce61('0x38')]:_0x3c9163['model'];if(!_0xcface1['query']['hasOwnProperty'](_0xce61('0x3b'))){_0x53fa92[_0xce61('0x20')]=qs[_0xce61('0x20')](_0xcface1[_0xce61('0x34')][_0xce61('0x20')]);_0x53fa92[_0xce61('0x1e')]=qs[_0xce61('0x1e')](_0xcface1[_0xce61('0x34')][_0xce61('0x1e')]);}_0x53fa92['order']=qs['sort'](_0xcface1[_0xce61('0x34')][_0xce61('0x3c')]);_0x53fa92[_0xce61('0x3d')]=qs[_0xce61('0x36')](_[_0xce61('0x3e')](_0xcface1['query'],_0x3c9163[_0xce61('0x36')]),_0x303295);if(_0xcface1[_0xce61('0x34')][_0xce61('0x3f')]){_0x53fa92[_0xce61('0x3d')]=_[_0xce61('0x40')](_0x53fa92[_0xce61('0x3d')],{'$or':_['map'](_0x303295,function(_0x441a34){if(_0x441a34[_0xce61('0x30')]!=='VIRTUAL'){var _0x56f258={};_0x56f258[_0x441a34[_0xce61('0x2d')]]={'$like':'%'+_0xcface1[_0xce61('0x34')][_0xce61('0x3f')]+'%'};return _0x56f258;}})});}_0x53fa92=_[_0xce61('0x40')]({},_0x53fa92,_0xcface1[_0xce61('0x41')]);var _0x5ddce5={'where':_0x53fa92[_0xce61('0x3d')]};return db['SmsQueue'][_0xce61('0x21')](_0x5ddce5)[_0xce61('0x27')](function(_0x30bb0c){_0x4a921f[_0xce61('0x21')]=_0x30bb0c;if(_0xcface1['query']['includeAll']){_0x53fa92['include']=[{'all':!![]}];}return db[_0xce61('0x42')]['findAll'](_0x53fa92);})[_0xce61('0x27')](function(_0x2298a8){_0x4a921f['rows']=_0x2298a8;return _0x4a921f;})[_0xce61('0x27')](respondWithFilteredResult(_0x3567cd,_0x53fa92))[_0xce61('0x43')](handleError(_0x3567cd,null));};exports['show']=function(_0x22da74,_0x2fdcb6){var _0x30c992={'raw':!![],'where':{'id':_0x22da74['params']['id']}},_0x1cb5c3={};_0x1cb5c3[_0xce61('0x32')]=_[_0xce61('0x35')](db[_0xce61('0x42')]['rawAttributes']);_0x1cb5c3[_0xce61('0x34')]=_['keys'](_0x22da74[_0xce61('0x34')]);_0x1cb5c3[_0xce61('0x36')]=_[_0xce61('0x37')](_0x1cb5c3[_0xce61('0x32')],_0x1cb5c3[_0xce61('0x34')]);_0x30c992['attributes']=_[_0xce61('0x37')](_0x1cb5c3[_0xce61('0x32')],qs[_0xce61('0x39')](_0x22da74['query']['fields']));_0x30c992[_0xce61('0x38')]=_0x30c992[_0xce61('0x38')][_0xce61('0x3a')]?_0x30c992['attributes']:_0x1cb5c3[_0xce61('0x32')];if(_0x22da74[_0xce61('0x34')][_0xce61('0x44')]){_0x30c992[_0xce61('0x45')]=[{'all':!![]}];}_0x30c992=_[_0xce61('0x40')]({},_0x30c992,_0x22da74[_0xce61('0x41')]);return db[_0xce61('0x42')][_0xce61('0x46')](_0x30c992)[_0xce61('0x27')](handleEntityNotFound(_0x2fdcb6,null))[_0xce61('0x27')](respondWithResult(_0x2fdcb6,null))['catch'](handleError(_0x2fdcb6,null));};exports['create']=function(_0x5b2839,_0x23794c){return db[_0xce61('0x42')][_0xce61('0x47')](_0x5b2839[_0xce61('0x48')],{})[_0xce61('0x27')](function(_0x222f45){var _0x3895b5=_0x5b2839['user'][_0xce61('0x28')]({'plain':!![]});if(!_0x3895b5)throw new Error(_0xce61('0x49'));if(_0x3895b5[_0xce61('0x4a')]==='user'){var _0x5e750d=_0x222f45['get']({'plain':!![]});var _0x3dfdcb=_0xce61('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x3dfdcb,'userProfileId':_0x3895b5[_0xce61('0x4b')]},'raw':!![]})[_0xce61('0x27')](function(_0x15fe9a){if(_0x15fe9a&&_0x15fe9a['autoAssociation']===0x0){return db[_0xce61('0x2a')]['create']({'name':_0x5e750d[_0xce61('0x2d')],'resourceId':_0x5e750d['id'],'type':_0x15fe9a[_0xce61('0x2d')],'sectionId':_0x15fe9a['id']},{})[_0xce61('0x27')](function(){return _0x222f45;});}else{return _0x222f45;}})['catch'](function(_0x3295e5){logger[_0xce61('0x4c')](_0xce61('0x4d'),_0x3295e5);throw _0x3295e5;});}return _0x222f45;})[_0xce61('0x27')](respondWithResult(_0x23794c,0xc9))[_0xce61('0x43')](handleError(_0x23794c,null));};exports[_0xce61('0x26')]=function(_0x3a7b44,_0x12953b){if(_0x3a7b44[_0xce61('0x48')]['id']){delete _0x3a7b44[_0xce61('0x48')]['id'];}return db['SmsQueue'][_0xce61('0x46')]({'where':{'id':_0x3a7b44[_0xce61('0x4e')]['id']}})[_0xce61('0x27')](handleEntityNotFound(_0x12953b,null))[_0xce61('0x27')](saveUpdates(_0x3a7b44[_0xce61('0x48')],null))[_0xce61('0x27')](respondWithResult(_0x12953b,null))[_0xce61('0x43')](handleError(_0x12953b,null));};exports['destroy']=function(_0x114fb9,_0x4db7e2){return db[_0xce61('0x42')]['find']({'where':{'id':_0x114fb9[_0xce61('0x4e')]['id']}})[_0xce61('0x27')](handleEntityNotFound(_0x4db7e2,null))[_0xce61('0x27')](removeEntity(_0x4db7e2,null))[_0xce61('0x43')](handleError(_0x4db7e2,null));};exports[_0xce61('0x4f')]=function(_0x4f812e,_0x3b26b6){return db['SmsQueue'][_0xce61('0x4f')]()[_0xce61('0x27')](respondWithResult(_0x3b26b6,null))[_0xce61('0x43')](handleError(_0x3b26b6,null));};exports[_0xce61('0x50')]=function(_0x542f5b,_0x1ef38e,_0x2b8380){var _0x109e87={'raw':!![],'where':{}},_0x12392b={},_0xe78ec6;return db[_0xce61('0x42')][_0xce61('0x51')]({'where':{'id':_0x542f5b[_0xce61('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ef38e,null))[_0xce61('0x27')](function(_0xba9708){if(_0xba9708){_0xe78ec6=_0xba9708[_0xce61('0x28')]({'plain':!![]});_0x12392b[_0xce61('0x32')]=_['keys'](db[_0xce61('0x52')]['rawAttributes']);_0x12392b[_0xce61('0x34')]=_[_0xce61('0x35')](_0x542f5b[_0xce61('0x34')]);_0x12392b[_0xce61('0x36')]=_[_0xce61('0x37')](_0x12392b[_0xce61('0x32')],_0x12392b[_0xce61('0x34')]);_0x109e87[_0xce61('0x38')]=_['intersection'](_0x12392b[_0xce61('0x32')],qs[_0xce61('0x39')](_0x542f5b['query'][_0xce61('0x39')]));_0x109e87[_0xce61('0x38')]=_0x109e87[_0xce61('0x38')][_0xce61('0x3a')]?_0x109e87[_0xce61('0x38')]:_0x12392b[_0xce61('0x32')];if(!_0x542f5b[_0xce61('0x34')][_0xce61('0x53')](_0xce61('0x3b'))){_0x109e87[_0xce61('0x20')]=qs[_0xce61('0x20')](_0x542f5b[_0xce61('0x34')]['limit']);_0x109e87[_0xce61('0x1e')]=qs[_0xce61('0x1e')](_0x542f5b[_0xce61('0x34')][_0xce61('0x1e')]);}_0x109e87[_0xce61('0x54')]=qs[_0xce61('0x3c')](_0x542f5b[_0xce61('0x34')][_0xce61('0x3c')]);_0x109e87['where']=qs[_0xce61('0x36')](_[_0xce61('0x3e')](_0x542f5b[_0xce61('0x34')],_0x12392b[_0xce61('0x36')]));_0x109e87[_0xce61('0x3d')][_0xce61('0x55')]=_0xba9708['id'];if(_0x542f5b['query'][_0xce61('0x3f')]){_0x109e87[_0xce61('0x3d')]=_[_0xce61('0x40')](_0x109e87['where'],{'$or':_['map'](_0x109e87[_0xce61('0x38')],function(_0x234141){var _0xa16a39={};_0xa16a39[_0x234141]={'$like':'%'+_0x542f5b[_0xce61('0x34')][_0xce61('0x3f')]+'%'};return _0xa16a39;})});}_0x109e87=_[_0xce61('0x40')]({},_0x109e87,_0x542f5b['options']);return db[_0xce61('0x52')][_0xce61('0x56')](_0x109e87);}})[_0xce61('0x27')](function(_0xbb2dd2){if(_0xbb2dd2){return db['User'][_0xce61('0x57')]({'where':{'id':_[_0xce61('0x33')](_0xbb2dd2,'UserId'),'role':_0xce61('0x58')},'attributes':['id','name','smsPause',_0xce61('0x59'),_0xce61('0x5a')]});}})['then'](function(_0x1acde3){if(_0x1acde3){return{'count':_0x1acde3[_0xce61('0x21')],'rows':_['map'](_0x1acde3[_0xce61('0x5b')],function(_0x390cdf){return{'membername':_0x390cdf['name'],'UserId':_0x390cdf['id'],'queue_name':_0xe78ec6['name'],'SmsQueueId':_0xe78ec6['id'],'interface':util['format']('%s/%s',_0xce61('0x5c'),_0x390cdf[_0xce61('0x2d')]),'penalty':0x0,'paused':_0x390cdf[_0xce61('0x5d')],'createdAt':_0x390cdf[_0xce61('0x5a')],'updatedAt':_0x390cdf['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1ef38e,_0x109e87))[_0xce61('0x43')](handleError(_0x1ef38e,null));};exports[_0xce61('0x5e')]=function(_0x5b1b93,_0x20fde3,_0x1ef906){var _0x2a8dd9={};var _0x1f84ea={};var _0x253dba;var _0x3166e3;return db[_0xce61('0x42')][_0xce61('0x51')]({'where':{'id':_0x5b1b93[_0xce61('0x4e')]['id']}})['then'](handleEntityNotFound(_0x20fde3,null))[_0xce61('0x27')](function(_0x473c9b){if(_0x473c9b){_0x253dba=_0x473c9b;_0x1f84ea[_0xce61('0x32')]=_[_0xce61('0x35')](db[_0xce61('0x5f')][_0xce61('0x60')]);_0x1f84ea[_0xce61('0x34')]=_[_0xce61('0x35')](_0x5b1b93[_0xce61('0x34')]);_0x1f84ea[_0xce61('0x36')]=_['intersection'](_0x1f84ea[_0xce61('0x32')],_0x1f84ea[_0xce61('0x34')]);_0x2a8dd9['attributes']=_[_0xce61('0x37')](_0x1f84ea[_0xce61('0x32')],qs[_0xce61('0x39')](_0x5b1b93[_0xce61('0x34')][_0xce61('0x39')]));_0x2a8dd9['attributes']=_0x2a8dd9[_0xce61('0x38')][_0xce61('0x3a')]?_0x2a8dd9[_0xce61('0x38')]:_0x1f84ea['model'];_0x2a8dd9[_0xce61('0x54')]=qs[_0xce61('0x3c')](_0x5b1b93[_0xce61('0x34')][_0xce61('0x3c')]);_0x2a8dd9['where']=qs[_0xce61('0x36')](_[_0xce61('0x3e')](_0x5b1b93[_0xce61('0x34')],_0x1f84ea[_0xce61('0x36')]));if(_0x5b1b93[_0xce61('0x34')][_0xce61('0x3f')]){_0x2a8dd9[_0xce61('0x3d')]=_[_0xce61('0x40')](_0x2a8dd9['where'],{'$or':_[_0xce61('0x33')](_0x2a8dd9[_0xce61('0x38')],function(_0x20973e){var _0x5d66e6={};_0x5d66e6[_0x20973e]={'$like':'%'+_0x5b1b93[_0xce61('0x34')][_0xce61('0x3f')]+'%'};return _0x5d66e6;})});}_0x2a8dd9=_[_0xce61('0x40')]({},_0x2a8dd9,_0x5b1b93[_0xce61('0x41')]);return _0x253dba['getTeams'](_0x2a8dd9);}})[_0xce61('0x27')](function(_0x580881){if(_0x580881){_0x3166e3=_0x580881[_0xce61('0x3a')];if(!_0x5b1b93[_0xce61('0x34')][_0xce61('0x53')](_0xce61('0x3b'))){_0x2a8dd9[_0xce61('0x20')]=qs[_0xce61('0x20')](_0x5b1b93['query'][_0xce61('0x20')]);_0x2a8dd9[_0xce61('0x1e')]=qs['offset'](_0x5b1b93['query'][_0xce61('0x1e')]);}return _0x253dba[_0xce61('0x5e')](_0x2a8dd9);}})[_0xce61('0x27')](function(_0xe1528b){if(_0xe1528b){return _0xe1528b?{'count':_0x3166e3,'rows':_0xe1528b}:null;}})[_0xce61('0x27')](respondWithResult(_0x20fde3,null))['catch'](handleError(_0x20fde3,null));};exports[_0xce61('0x61')]=function(_0x533813,_0x5b215a,_0x47ab25){var _0x56892c=_0x533813['body']['ids'];return db[_0xce61('0x5f')][_0xce61('0x56')]({'where':{'id':_0x56892c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xce61('0x62'),'attributes':['id',_0xce61('0x2d'),_0xce61('0x63'),_0xce61('0x64'),_0xce61('0x65')],'raw':!![]}]})[_0xce61('0x27')](function(_0x184e07){if(_0x184e07){var _0x5cd4b9=_[_0xce61('0x66')](_0x184e07,function(_0x4e4a52){var _0x29526f=_0x4e4a52[_0xce61('0x28')]({'plain':!![]});return _0x29526f[_0xce61('0x62')];});return db[_0xce61('0x42')][_0xce61('0x46')]({'where':{'id':_0x533813['params']['id']}})[_0xce61('0x27')](function(_0x55dcfa){return db[_0xce61('0x67')][_0xce61('0x68')](function(_0x50d4f2){return _0x55dcfa[_0xce61('0x61')](_0x56892c,{'transaction':_0x50d4f2})[_0xce61('0x27')](function(){return BPromise[_0xce61('0x69')](_0x5cd4b9,function(_0x21b4e6){return db[_0xce61('0x52')][_0xce61('0x6a')]({'where':{'UserId':_0x21b4e6['id'],'SmsQueueId':_0x533813[_0xce61('0x4e')]['id']},'transaction':_0x50d4f2});});})['then'](function(){_0x5cd4b9[_0xce61('0x6b')](function(_0x31c9e5){socket['emit'](_0xce61('0x6c'),{'UserId':_0x31c9e5['id'],'SmsQueueId':_0x55dcfa['id']});});});});});}})['then'](respondWithStatusCode(_0x5b215a,null))[_0xce61('0x43')](handleError(_0x5b215a,null));};exports[_0xce61('0x6d')]=function(_0x28f0fa,_0x531dc1,_0x508986){return db[_0xce61('0x5f')]['findAll']({'where':{'id':_0x28f0fa[_0xce61('0x34')][_0xce61('0x6e')]},'attributes':['id'],'include':[{'model':db[_0xce61('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xce61('0x27')](handleEntityNotFound(_0x531dc1,null))['then'](function(_0x5c1a22){var _0x471ffa=_[_0xce61('0x33')](_0x5c1a22,'id');var _0x56f463=[];var _0xd0723b=[];var _0x3e7dd6=squel[_0xce61('0x70')]();_0x3e7dd6[_0xce61('0x71')]('tq.TeamId')['from'](_0xce61('0x72'),'tq')[_0xce61('0x73')](_0xce61('0x74'),'ut',_0xce61('0x75'))['where'](_0xce61('0x76'),_0x28f0fa[_0xce61('0x4e')]['id']);for(var _0x5202a5=0x0;_0x5202a5<_0x5c1a22['length'];_0x5202a5+=0x1){let _0x1c4d5f=_0x5c1a22[_0x5202a5];for(var _0x3f2779=0x0;_0x3f2779<_0x1c4d5f[_0xce61('0x62')]['length'];_0x3f2779+=0x1){let _0x3de23c=_0x1c4d5f['Agents'][_0x3f2779];var _0x13647c=_0x3e7dd6['clone']();_0x13647c['where']('ut.UserId\x20=\x20?',_0x3de23c['id']);_0xd0723b[_0xce61('0x77')](db[_0xce61('0x67')][_0xce61('0x34')](_0x13647c[_0xce61('0x78')](),{'type':db[_0xce61('0x67')][_0xce61('0x79')]['SELECT']})['then'](function(_0x15ccdc){if(_0x15ccdc[_0xce61('0x3a')]===0x1){return _0x3de23c['id'];}else{var _0x44e045=_[_0xce61('0x7a')](_['map'](_0x15ccdc,_0xce61('0x7b')),function(_0x1a4b4f){return _[_0xce61('0x7c')](_0x471ffa,_0x1a4b4f);});if(_0x44e045){return _0x3de23c['id'];}}}));}}return BPromise[_0xce61('0x7d')](_0xd0723b)[_0xce61('0x27')](function(_0x57a4b1){_0x56f463=_(_0x56f463)[_0xce61('0x7e')](_0x57a4b1)['compact']()[_0xce61('0x7f')]();return db[_0xce61('0x42')][_0xce61('0x46')]({'where':{'id':_0x28f0fa['params']['id']}})[_0xce61('0x27')](function(_0x5cbc4e){return db[_0xce61('0x67')][_0xce61('0x68')](function(_0x24201b){return _0x5cbc4e[_0xce61('0x6d')](_0x28f0fa[_0xce61('0x34')][_0xce61('0x6e')],{'transaction':_0x24201b})[_0xce61('0x27')](function(){if(!_[_0xce61('0x80')](_0x56f463)){return _0x5cbc4e[_0xce61('0x81')](_0x56f463,{'transaction':_0x24201b});}})[_0xce61('0x27')](function(){_0x56f463[_0xce61('0x6b')](function(_0x2911a3){socket[_0xce61('0x82')](_0xce61('0x83'),{'UserId':_0x2911a3,'SmsQueueId':_0x5cbc4e['id']});});});});});});})['then'](respondWithStatusCode(_0x531dc1,null))['catch'](handleError(_0x531dc1,null));};exports[_0xce61('0x84')]=function(_0x646e8b,_0x5522dd,_0x26d762){return db[_0xce61('0x42')][_0xce61('0x46')]({'where':{'id':_0x646e8b['params']['id']}})[_0xce61('0x27')](handleEntityNotFound(_0x5522dd,null))[_0xce61('0x27')](function(_0x418161){if(_0x418161){return _0x418161[_0xce61('0x84')](_0x646e8b['body']['ids'],_[_0xce61('0x85')](_0x646e8b[_0xce61('0x48')],[_0xce61('0x6e'),'id'])||{})[_0xce61('0x86')](function(_0x47b115){for(var _0x4a90fe=0x0;_0x4a90fe<_0x646e8b[_0xce61('0x48')][_0xce61('0x6e')][_0xce61('0x3a')];_0x4a90fe+=0x1){socket[_0xce61('0x82')](_0xce61('0x6c'),{'UserId':Number(_0x646e8b[_0xce61('0x48')][_0xce61('0x6e')][_0x4a90fe]),'SmsQueueId':Number(_0x646e8b[_0xce61('0x4e')]['id'])});}return _0x47b115;});}})['then'](respondWithResult(_0x5522dd,null))[_0xce61('0x43')](handleError(_0x5522dd,null));};exports['removeAgents']=function(_0x15e981,_0x318d95,_0x2a51b1){return db[_0xce61('0x42')][_0xce61('0x46')]({'where':{'id':_0x15e981[_0xce61('0x4e')]['id']}})[_0xce61('0x27')](handleEntityNotFound(_0x318d95,null))[_0xce61('0x27')](function(_0x2d5ea7){if(_0x2d5ea7){return _0x2d5ea7[_0xce61('0x81')](_0x15e981[_0xce61('0x34')]['ids'])[_0xce61('0x27')](function(){if(_[_0xce61('0x87')](_0x15e981['query'][_0xce61('0x6e')])){for(var _0x5c7504=0x0;_0x5c7504<_0x15e981[_0xce61('0x34')][_0xce61('0x6e')][_0xce61('0x3a')];_0x5c7504+=0x1){socket['emit'](_0xce61('0x83'),{'UserId':Number(_0x15e981[_0xce61('0x34')][_0xce61('0x6e')][_0x5c7504]),'SmsQueueId':Number(_0x15e981['params']['id'])});}}else{socket[_0xce61('0x82')](_0xce61('0x83'),{'UserId':Number(_0x15e981[_0xce61('0x34')][_0xce61('0x6e')]),'SmsQueueId':Number(_0x15e981[_0xce61('0x4e')]['id'])});}});}})[_0xce61('0x27')](respondWithStatusCode(_0x318d95,null))[_0xce61('0x43')](handleError(_0x318d95,null));};exports[_0xce61('0x88')]=function(_0x2feb0c,_0x4a3fb5,_0x257037){var _0xe2d384={};var _0x3a1a47={};var _0x18a5ca;var _0x3f9098;return db[_0xce61('0x42')][_0xce61('0x51')]({'where':{'id':_0x2feb0c[_0xce61('0x4e')]['id']}})[_0xce61('0x27')](handleEntityNotFound(_0x4a3fb5,null))[_0xce61('0x27')](function(_0xa4448){if(_0xa4448){_0x18a5ca=_0xa4448;_0x3a1a47[_0xce61('0x32')]=_[_0xce61('0x35')](db['User'][_0xce61('0x60')]);_0x3a1a47[_0xce61('0x34')]=_[_0xce61('0x35')](_0x2feb0c['query']);_0x3a1a47[_0xce61('0x36')]=_[_0xce61('0x37')](_0x3a1a47[_0xce61('0x32')],_0x3a1a47[_0xce61('0x34')]);_0xe2d384['attributes']=_['intersection'](_0x3a1a47[_0xce61('0x32')],qs[_0xce61('0x39')](_0x2feb0c[_0xce61('0x34')][_0xce61('0x39')]));_0xe2d384[_0xce61('0x38')]=_0xe2d384[_0xce61('0x38')][_0xce61('0x3a')]?_0xe2d384['attributes']:_0x3a1a47[_0xce61('0x32')];_0xe2d384[_0xce61('0x54')]=qs['sort'](_0x2feb0c[_0xce61('0x34')]['sort']);_0xe2d384[_0xce61('0x3d')]=qs[_0xce61('0x36')](_[_0xce61('0x3e')](_0x2feb0c[_0xce61('0x34')],_0x3a1a47['filters']));if(_0x2feb0c['query']['filter']){_0xe2d384[_0xce61('0x3d')]=_['merge'](_0xe2d384['where'],{'$or':_[_0xce61('0x33')](_0xe2d384[_0xce61('0x38')],function(_0x5568ae){var _0x4419b9={};_0x4419b9[_0x5568ae]={'$like':'%'+_0x2feb0c[_0xce61('0x34')]['filter']+'%'};return _0x4419b9;})});}_0xe2d384=_[_0xce61('0x40')]({},_0xe2d384,_0x2feb0c['options']);return _0x18a5ca[_0xce61('0x88')](_0xe2d384);}})[_0xce61('0x27')](function(_0x13c646){if(_0x13c646){_0x3f9098=_0x13c646[_0xce61('0x3a')];if(!_0x2feb0c[_0xce61('0x34')]['hasOwnProperty'](_0xce61('0x3b'))){_0xe2d384[_0xce61('0x20')]=qs[_0xce61('0x20')](_0x2feb0c[_0xce61('0x34')][_0xce61('0x20')]);_0xe2d384['offset']=qs[_0xce61('0x1e')](_0x2feb0c[_0xce61('0x34')][_0xce61('0x1e')]);}return _0x18a5ca[_0xce61('0x88')](_0xe2d384);}})[_0xce61('0x27')](function(_0x5ce435){if(_0x5ce435){return _0x5ce435?{'count':_0x3f9098,'rows':_0x5ce435}:null;}})['then'](respondWithResult(_0x4a3fb5,null))[_0xce61('0x43')](handleError(_0x4a3fb5,null));}; \ No newline at end of file +var _0x547e=['../../mysqldb','redis','localhost','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','SmsQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','toString','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0xaa0513,_0x119682){var _0x309032=function(_0x17b385){while(--_0x17b385){_0xaa0513['push'](_0xaa0513['shift']());}};_0x309032(++_0x119682);}(_0x547e,0xfd));var _0xe547=function(_0x57decb,_0x43e84b){_0x57decb=_0x57decb-0x0;var _0x1beb47=_0x547e[_0x57decb];return _0x1beb47;};'use strict';var emlformat=require(_0xe547('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe547('0x1'));var jsonpatch=require(_0xe547('0x2'));var rp=require('request-promise');var moment=require(_0xe547('0x3'));var BPromise=require(_0xe547('0x4'));var Mustache=require('mustache');var util=require(_0xe547('0x5'));var path=require(_0xe547('0x6'));var sox=require('sox');var csv=require(_0xe547('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe547('0x8'));var _=require(_0xe547('0x9'));var squel=require('squel');var crypto=require(_0xe547('0xa'));var jsforce=require(_0xe547('0xb'));var deskjs=require(_0xe547('0xc'));var toCsv=require(_0xe547('0x7'));var querystring=require(_0xe547('0xd'));var Papa=require(_0xe547('0xe'));var Redis=require(_0xe547('0xf'));var authService=require(_0xe547('0x10'));var qs=require(_0xe547('0x11'));var as=require(_0xe547('0x12'));var hardwareService=require(_0xe547('0x13'));var logger=require(_0xe547('0x14'))('api');var utils=require(_0xe547('0x15'));var config=require(_0xe547('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe547('0x17'))['db'];config[_0xe547('0x18')]=_['defaults'](config['redis'],{'host':_0xe547('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe547('0x1a'))[_0xe547('0x1b')](socket);function respondWithStatusCode(_0x4102d5,_0x2cd2a0){_0x2cd2a0=_0x2cd2a0||0xcc;return function(_0x49a13f){if(_0x49a13f){return _0x4102d5[_0xe547('0x1c')](_0x2cd2a0);}return _0x4102d5['status'](_0x2cd2a0)[_0xe547('0x1d')]();};}function respondWithResult(_0x5b28fc,_0x3c7124){_0x3c7124=_0x3c7124||0xc8;return function(_0x31ba00){if(_0x31ba00){return _0x5b28fc[_0xe547('0x1e')](_0x3c7124)[_0xe547('0x1f')](_0x31ba00);}};}function respondWithFilteredResult(_0x3e3555,_0x216661){return function(_0x11ad38){if(_0x11ad38){var _0x5a968d=typeof _0x216661[_0xe547('0x20')]===_0xe547('0x21')&&typeof _0x216661[_0xe547('0x22')]===_0xe547('0x21');var _0x383801=_0x11ad38[_0xe547('0x23')];var _0x450701=_0x5a968d?0x0:_0x216661['offset'];var _0x5bc104=_0x5a968d?_0x11ad38[_0xe547('0x23')]:_0x216661['offset']+_0x216661[_0xe547('0x22')];var _0x50dbb0;if(_0x5bc104>=_0x383801){_0x5bc104=_0x383801;_0x50dbb0=0xc8;}else{_0x50dbb0=0xce;}_0x3e3555[_0xe547('0x1e')](_0x50dbb0);return _0x3e3555['set'](_0xe547('0x24'),_0x450701+'-'+_0x5bc104+'/'+_0x383801)[_0xe547('0x1f')](_0x11ad38);}return null;};}function patchUpdates(_0x5f40b7){return function(_0x5a2e80){try{jsonpatch[_0xe547('0x25')](_0x5a2e80,_0x5f40b7,!![]);}catch(_0x1cf90e){return BPromise['reject'](_0x1cf90e);}return _0x5a2e80[_0xe547('0x26')]();};}function saveUpdates(_0x259644,_0x3939fb){return function(_0x44ac10){if(_0x44ac10){return _0x44ac10['update'](_0x259644)[_0xe547('0x27')](function(_0x418d45){return _0x418d45;});}return null;};}function removeEntity(_0x46958f,_0x43ed5c){return function(_0x43ec18){if(_0x43ec18){return _0x43ec18[_0xe547('0x28')]()[_0xe547('0x27')](function(){var _0x2e0075=_0x43ec18['get']({'plain':!![]});var _0x4ff0ed=_0xe547('0x29');return db[_0xe547('0x2a')][_0xe547('0x28')]({'where':{'type':_0x4ff0ed,'resourceId':_0x2e0075['id']}})[_0xe547('0x27')](function(){return _0x43ec18;});})['then'](function(){_0x46958f['status'](0xcc)[_0xe547('0x1d')]();});}};}function handleEntityNotFound(_0x38a4ae,_0x46be34){return function(_0x2c97a5){if(!_0x2c97a5){_0x38a4ae[_0xe547('0x1c')](0x194);}return _0x2c97a5;};}function handleError(_0xc8f420,_0x5c5ed8){_0x5c5ed8=_0x5c5ed8||0x1f4;return function(_0x4a23a6){logger[_0xe547('0x2b')](_0x4a23a6[_0xe547('0x2c')]);if(_0x4a23a6['name']){delete _0x4a23a6[_0xe547('0x2d')];}_0xc8f420[_0xe547('0x1e')](_0x5c5ed8)[_0xe547('0x2e')](_0x4a23a6);};}exports['index']=function(_0xfda88c,_0x47c347){var _0x275264={},_0x1b5cc1={},_0x16b5e4={'count':0x0,'rows':[]};var _0x4c33d7=_['map'](db[_0xe547('0x2f')][_0xe547('0x30')],function(_0x5aafa8){return{'name':_0x5aafa8['fieldName'],'type':_0x5aafa8[_0xe547('0x31')][_0xe547('0x32')]};});_0x1b5cc1[_0xe547('0x33')]=_[_0xe547('0x34')](_0x4c33d7,_0xe547('0x2d'));_0x1b5cc1[_0xe547('0x35')]=_[_0xe547('0x36')](_0xfda88c['query']);_0x1b5cc1[_0xe547('0x37')]=_[_0xe547('0x38')](_0x1b5cc1[_0xe547('0x33')],_0x1b5cc1['query']);_0x275264[_0xe547('0x39')]=_['intersection'](_0x1b5cc1[_0xe547('0x33')],qs[_0xe547('0x3a')](_0xfda88c['query'][_0xe547('0x3a')]));_0x275264[_0xe547('0x39')]=_0x275264[_0xe547('0x39')]['length']?_0x275264[_0xe547('0x39')]:_0x1b5cc1[_0xe547('0x33')];if(!_0xfda88c['query'][_0xe547('0x3b')](_0xe547('0x3c'))){_0x275264[_0xe547('0x22')]=qs[_0xe547('0x22')](_0xfda88c[_0xe547('0x35')][_0xe547('0x22')]);_0x275264['offset']=qs['offset'](_0xfda88c[_0xe547('0x35')][_0xe547('0x20')]);}_0x275264['order']=qs[_0xe547('0x3d')](_0xfda88c[_0xe547('0x35')][_0xe547('0x3d')]);_0x275264[_0xe547('0x3e')]=qs['filters'](_[_0xe547('0x3f')](_0xfda88c[_0xe547('0x35')],_0x1b5cc1[_0xe547('0x37')]),_0x4c33d7);if(_0xfda88c['query'][_0xe547('0x40')]){_0x275264[_0xe547('0x3e')]=_[_0xe547('0x41')](_0x275264[_0xe547('0x3e')],{'$or':_['map'](_0x4c33d7,function(_0x3760ca){if(_0x3760ca[_0xe547('0x31')]!==_0xe547('0x42')){var _0x265623={};_0x265623[_0x3760ca[_0xe547('0x2d')]]={'$like':'%'+_0xfda88c[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x265623;}})});}_0x275264=_[_0xe547('0x41')]({},_0x275264,_0xfda88c[_0xe547('0x43')]);var _0x4a9517={'where':_0x275264[_0xe547('0x3e')]};return db['SmsQueue']['count'](_0x4a9517)[_0xe547('0x27')](function(_0xa8656b){_0x16b5e4[_0xe547('0x23')]=_0xa8656b;if(_0xfda88c['query'][_0xe547('0x44')]){_0x275264[_0xe547('0x45')]=[{'all':!![]}];}return db[_0xe547('0x2f')][_0xe547('0x46')](_0x275264);})['then'](function(_0x4e73ad){_0x16b5e4[_0xe547('0x47')]=_0x4e73ad;return _0x16b5e4;})[_0xe547('0x27')](respondWithFilteredResult(_0x47c347,_0x275264))['catch'](handleError(_0x47c347,null));};exports['show']=function(_0x1e48b9,_0x379368){var _0xe97ef5={'raw':!![],'where':{'id':_0x1e48b9[_0xe547('0x48')]['id']}},_0x4376db={};_0x4376db['model']=_[_0xe547('0x36')](db[_0xe547('0x2f')][_0xe547('0x30')]);_0x4376db[_0xe547('0x35')]=_[_0xe547('0x36')](_0x1e48b9['query']);_0x4376db['filters']=_[_0xe547('0x38')](_0x4376db[_0xe547('0x33')],_0x4376db['query']);_0xe97ef5[_0xe547('0x39')]=_[_0xe547('0x38')](_0x4376db['model'],qs[_0xe547('0x3a')](_0x1e48b9[_0xe547('0x35')][_0xe547('0x3a')]));_0xe97ef5['attributes']=_0xe97ef5[_0xe547('0x39')][_0xe547('0x49')]?_0xe97ef5[_0xe547('0x39')]:_0x4376db['model'];if(_0x1e48b9[_0xe547('0x35')][_0xe547('0x44')]){_0xe97ef5['include']=[{'all':!![]}];}_0xe97ef5=_['merge']({},_0xe97ef5,_0x1e48b9['options']);return db['SmsQueue'][_0xe547('0x4a')](_0xe97ef5)[_0xe547('0x27')](handleEntityNotFound(_0x379368,null))[_0xe547('0x27')](respondWithResult(_0x379368,null))[_0xe547('0x4b')](handleError(_0x379368,null));};exports[_0xe547('0x4c')]=function(_0x4c88ca,_0x107546){return db[_0xe547('0x2f')][_0xe547('0x4c')](_0x4c88ca['body'],{})[_0xe547('0x27')](function(_0x41b305){var _0x4b54e0=_0x4c88ca['user'][_0xe547('0x4d')]({'plain':!![]});if(!_0x4b54e0)throw new Error(_0xe547('0x4e'));if(_0x4b54e0['role']===_0xe547('0x4f')){var _0x3545e1=_0x41b305[_0xe547('0x4d')]({'plain':!![]});var _0x31a479=_0xe547('0x29');return db[_0xe547('0x50')][_0xe547('0x4a')]({'where':{'name':_0x31a479,'userProfileId':_0x4b54e0[_0xe547('0x51')]},'raw':!![]})[_0xe547('0x27')](function(_0x14d89c){if(_0x14d89c&&_0x14d89c['autoAssociation']===0x0){return db[_0xe547('0x2a')]['create']({'name':_0x3545e1[_0xe547('0x2d')],'resourceId':_0x3545e1['id'],'type':_0x14d89c[_0xe547('0x2d')],'sectionId':_0x14d89c['id']},{})['then'](function(){return _0x41b305;});}else{return _0x41b305;}})[_0xe547('0x4b')](function(_0x3f0d88){logger[_0xe547('0x2b')](_0xe547('0x52'),_0x3f0d88);throw _0x3f0d88;});}return _0x41b305;})[_0xe547('0x27')](respondWithResult(_0x107546,0xc9))['catch'](handleError(_0x107546,null));};exports[_0xe547('0x53')]=function(_0x25ae22,_0x553357){if(_0x25ae22[_0xe547('0x54')]['id']){delete _0x25ae22['body']['id'];}return db['SmsQueue'][_0xe547('0x4a')]({'where':{'id':_0x25ae22[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x553357,null))[_0xe547('0x27')](saveUpdates(_0x25ae22['body'],null))[_0xe547('0x27')](respondWithResult(_0x553357,null))[_0xe547('0x4b')](handleError(_0x553357,null));};exports[_0xe547('0x28')]=function(_0x1eed90,_0x2b9359){return db[_0xe547('0x2f')][_0xe547('0x4a')]({'where':{'id':_0x1eed90[_0xe547('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b9359,null))['then'](removeEntity(_0x2b9359,null))[_0xe547('0x4b')](handleError(_0x2b9359,null));};exports[_0xe547('0x55')]=function(_0x5c4b97,_0x26099d){return db[_0xe547('0x2f')][_0xe547('0x55')]()[_0xe547('0x27')](respondWithResult(_0x26099d,null))[_0xe547('0x4b')](handleError(_0x26099d,null));};exports['getMembers']=function(_0x29f3be,_0x151834,_0x1a561a){var _0x42d4dd={'raw':!![],'where':{}},_0x26544a={},_0x24a1d5;return db[_0xe547('0x2f')][_0xe547('0x56')]({'where':{'id':_0x29f3be[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x151834,null))[_0xe547('0x27')](function(_0x581e53){if(_0x581e53){_0x24a1d5=_0x581e53[_0xe547('0x4d')]({'plain':!![]});_0x26544a[_0xe547('0x33')]=_[_0xe547('0x36')](db[_0xe547('0x57')][_0xe547('0x30')]);_0x26544a[_0xe547('0x35')]=_[_0xe547('0x36')](_0x29f3be[_0xe547('0x35')]);_0x26544a[_0xe547('0x37')]=_[_0xe547('0x38')](_0x26544a[_0xe547('0x33')],_0x26544a[_0xe547('0x35')]);_0x42d4dd[_0xe547('0x39')]=_[_0xe547('0x38')](_0x26544a[_0xe547('0x33')],qs[_0xe547('0x3a')](_0x29f3be[_0xe547('0x35')][_0xe547('0x3a')]));_0x42d4dd[_0xe547('0x39')]=_0x42d4dd[_0xe547('0x39')][_0xe547('0x49')]?_0x42d4dd[_0xe547('0x39')]:_0x26544a[_0xe547('0x33')];if(!_0x29f3be[_0xe547('0x35')][_0xe547('0x3b')](_0xe547('0x3c'))){_0x42d4dd[_0xe547('0x22')]=qs[_0xe547('0x22')](_0x29f3be['query'][_0xe547('0x22')]);_0x42d4dd['offset']=qs['offset'](_0x29f3be['query'][_0xe547('0x20')]);}_0x42d4dd[_0xe547('0x58')]=qs[_0xe547('0x3d')](_0x29f3be[_0xe547('0x35')][_0xe547('0x3d')]);_0x42d4dd[_0xe547('0x3e')]=qs[_0xe547('0x37')](_['pick'](_0x29f3be['query'],_0x26544a[_0xe547('0x37')]));_0x42d4dd[_0xe547('0x3e')][_0xe547('0x59')]=_0x581e53['id'];if(_0x29f3be[_0xe547('0x35')][_0xe547('0x40')]){_0x42d4dd['where']=_[_0xe547('0x41')](_0x42d4dd[_0xe547('0x3e')],{'$or':_['map'](_0x42d4dd[_0xe547('0x39')],function(_0x32acf3){var _0x675d8={};_0x675d8[_0x32acf3]={'$like':'%'+_0x29f3be[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x675d8;})});}_0x42d4dd=_[_0xe547('0x41')]({},_0x42d4dd,_0x29f3be[_0xe547('0x43')]);return db['UserSmsQueue']['findAll'](_0x42d4dd);}})[_0xe547('0x27')](function(_0x479f36){if(_0x479f36){return db[_0xe547('0x5a')][_0xe547('0x5b')]({'where':{'id':_[_0xe547('0x34')](_0x479f36,_0xe547('0x5c')),'role':_0xe547('0x5d')},'attributes':['id',_0xe547('0x2d'),_0xe547('0x5e'),_0xe547('0x5f'),_0xe547('0x60')]});}})['then'](function(_0x4b43a9){if(_0x4b43a9){return{'count':_0x4b43a9[_0xe547('0x23')],'rows':_[_0xe547('0x34')](_0x4b43a9[_0xe547('0x47')],function(_0x5b7a48){return{'membername':_0x5b7a48['name'],'UserId':_0x5b7a48['id'],'queue_name':_0x24a1d5[_0xe547('0x2d')],'SmsQueueId':_0x24a1d5['id'],'interface':util[_0xe547('0x61')]('%s/%s',_0xe547('0x62'),_0x5b7a48[_0xe547('0x2d')]),'penalty':0x0,'paused':_0x5b7a48['smsPause'],'createdAt':_0x5b7a48[_0xe547('0x60')],'updatedAt':_0x5b7a48['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe547('0x27')](respondWithFilteredResult(_0x151834,_0x42d4dd))[_0xe547('0x4b')](handleError(_0x151834,null));};exports[_0xe547('0x63')]=function(_0x2d4705,_0x5d3f0b,_0x9c34dc){var _0x49fb12={};var _0x29c194={};var _0xb5e381;var _0x5dfdce;return db[_0xe547('0x2f')][_0xe547('0x56')]({'where':{'id':_0x2d4705[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x5d3f0b,null))[_0xe547('0x27')](function(_0x597ce){if(_0x597ce){_0xb5e381=_0x597ce;_0x29c194[_0xe547('0x33')]=_[_0xe547('0x36')](db[_0xe547('0x64')][_0xe547('0x30')]);_0x29c194['query']=_[_0xe547('0x36')](_0x2d4705[_0xe547('0x35')]);_0x29c194[_0xe547('0x37')]=_[_0xe547('0x38')](_0x29c194['model'],_0x29c194[_0xe547('0x35')]);_0x49fb12['attributes']=_[_0xe547('0x38')](_0x29c194[_0xe547('0x33')],qs[_0xe547('0x3a')](_0x2d4705[_0xe547('0x35')]['fields']));_0x49fb12['attributes']=_0x49fb12[_0xe547('0x39')][_0xe547('0x49')]?_0x49fb12[_0xe547('0x39')]:_0x29c194[_0xe547('0x33')];_0x49fb12[_0xe547('0x58')]=qs[_0xe547('0x3d')](_0x2d4705[_0xe547('0x35')][_0xe547('0x3d')]);_0x49fb12[_0xe547('0x3e')]=qs['filters'](_[_0xe547('0x3f')](_0x2d4705[_0xe547('0x35')],_0x29c194[_0xe547('0x37')]));if(_0x2d4705[_0xe547('0x35')][_0xe547('0x40')]){_0x49fb12['where']=_[_0xe547('0x41')](_0x49fb12[_0xe547('0x3e')],{'$or':_['map'](_0x49fb12[_0xe547('0x39')],function(_0x8f865b){var _0x2f6831={};_0x2f6831[_0x8f865b]={'$like':'%'+_0x2d4705[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x2f6831;})});}_0x49fb12=_['merge']({},_0x49fb12,_0x2d4705[_0xe547('0x43')]);return _0xb5e381[_0xe547('0x63')](_0x49fb12);}})[_0xe547('0x27')](function(_0x45adc0){if(_0x45adc0){_0x5dfdce=_0x45adc0[_0xe547('0x49')];if(!_0x2d4705['query'][_0xe547('0x3b')]('nolimit')){_0x49fb12[_0xe547('0x22')]=qs[_0xe547('0x22')](_0x2d4705[_0xe547('0x35')]['limit']);_0x49fb12['offset']=qs[_0xe547('0x20')](_0x2d4705[_0xe547('0x35')]['offset']);}return _0xb5e381[_0xe547('0x63')](_0x49fb12);}})[_0xe547('0x27')](function(_0x1f6301){if(_0x1f6301){return _0x1f6301?{'count':_0x5dfdce,'rows':_0x1f6301}:null;}})['then'](respondWithResult(_0x5d3f0b,null))['catch'](handleError(_0x5d3f0b,null));};exports[_0xe547('0x65')]=function(_0x482ed2,_0x20b113,_0x13b010){var _0x1b382e=_0x482ed2[_0xe547('0x54')][_0xe547('0x66')];return db[_0xe547('0x64')][_0xe547('0x46')]({'where':{'id':_0x1b382e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe547('0x67'),'attributes':['id',_0xe547('0x2d'),_0xe547('0x68'),_0xe547('0x69'),_0xe547('0x6a')],'raw':!![]}]})[_0xe547('0x27')](function(_0x418b01){if(_0x418b01){var _0x27cc98=_['flatMap'](_0x418b01,function(_0x221b10){var _0x261b0b=_0x221b10['get']({'plain':!![]});return _0x261b0b['Agents'];});return db[_0xe547('0x2f')][_0xe547('0x4a')]({'where':{'id':_0x482ed2[_0xe547('0x48')]['id']}})['then'](function(_0x7bcf5a){return db[_0xe547('0x6b')][_0xe547('0x6c')](function(_0x288b0d){return _0x7bcf5a[_0xe547('0x65')](_0x1b382e,{'transaction':_0x288b0d})[_0xe547('0x27')](function(){return BPromise[_0xe547('0x6d')](_0x27cc98,function(_0x5e93d0){return db[_0xe547('0x57')][_0xe547('0x6e')]({'where':{'UserId':_0x5e93d0['id'],'SmsQueueId':_0x482ed2[_0xe547('0x48')]['id']},'transaction':_0x288b0d});});})[_0xe547('0x27')](function(){_0x27cc98[_0xe547('0x6f')](function(_0x504521){socket[_0xe547('0x70')]('userSmsQueue:save',{'UserId':_0x504521['id'],'SmsQueueId':_0x7bcf5a['id']});});});});});}})['then'](respondWithStatusCode(_0x20b113,null))[_0xe547('0x4b')](handleError(_0x20b113,null));};exports[_0xe547('0x71')]=function(_0x43b154,_0x47b4c7,_0x155693){return db[_0xe547('0x64')][_0xe547('0x46')]({'where':{'id':_0x43b154[_0xe547('0x35')][_0xe547('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe547('0x5a')],'as':_0xe547('0x67'),'attributes':['id'],'raw':!![]}]})[_0xe547('0x27')](handleEntityNotFound(_0x47b4c7,null))[_0xe547('0x27')](function(_0x26b107){var _0x5cca18=_[_0xe547('0x34')](_0x26b107,'id');var _0x370f6f=[];var _0x44f540=[];var _0x58ff41=squel[_0xe547('0x72')]();_0x58ff41[_0xe547('0x73')](_0xe547('0x74'))[_0xe547('0x75')](_0xe547('0x76'),'tq')[_0xe547('0x77')](_0xe547('0x78'),'ut',_0xe547('0x79'))['where'](_0xe547('0x7a'),_0x43b154[_0xe547('0x48')]['id']);for(var _0x3a38b0=0x0;_0x3a38b0<_0x26b107[_0xe547('0x49')];_0x3a38b0+=0x1){let _0x3dbc52=_0x26b107[_0x3a38b0];for(var _0x2d13dc=0x0;_0x2d13dc<_0x3dbc52[_0xe547('0x67')][_0xe547('0x49')];_0x2d13dc+=0x1){let _0x10a9f4=_0x3dbc52['Agents'][_0x2d13dc];var _0x5e032e=_0x58ff41[_0xe547('0x7b')]();_0x5e032e[_0xe547('0x3e')]('ut.UserId\x20=\x20?',_0x10a9f4['id']);_0x44f540['push'](db[_0xe547('0x6b')][_0xe547('0x35')](_0x5e032e[_0xe547('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0xe547('0x7d')]})['then'](function(_0x37973f){if(_0x37973f[_0xe547('0x49')]===0x1){return _0x10a9f4['id'];}else{var _0x216938=_['every'](_[_0xe547('0x34')](_0x37973f,_0xe547('0x7e')),function(_0x395547){return _[_0xe547('0x7f')](_0x5cca18,_0x395547);});if(_0x216938){return _0x10a9f4['id'];}}}));}}return BPromise['all'](_0x44f540)[_0xe547('0x27')](function(_0x342411){_0x370f6f=_(_0x370f6f)[_0xe547('0x80')](_0x342411)[_0xe547('0x81')]()[_0xe547('0x82')]();return db['SmsQueue'][_0xe547('0x4a')]({'where':{'id':_0x43b154[_0xe547('0x48')]['id']}})[_0xe547('0x27')](function(_0x43372b){return db[_0xe547('0x6b')][_0xe547('0x6c')](function(_0x5be988){return _0x43372b[_0xe547('0x71')](_0x43b154['query'][_0xe547('0x66')],{'transaction':_0x5be988})['then'](function(){if(!_[_0xe547('0x83')](_0x370f6f)){return _0x43372b[_0xe547('0x84')](_0x370f6f,{'transaction':_0x5be988});}})[_0xe547('0x27')](function(){_0x370f6f[_0xe547('0x6f')](function(_0x435d59){socket[_0xe547('0x70')](_0xe547('0x85'),{'UserId':_0x435d59,'SmsQueueId':_0x43372b['id']});});});});});});})[_0xe547('0x27')](respondWithStatusCode(_0x47b4c7,null))[_0xe547('0x4b')](handleError(_0x47b4c7,null));};exports[_0xe547('0x86')]=function(_0x1a1824,_0x386faf,_0x25f4e0){return db[_0xe547('0x2f')]['find']({'where':{'id':_0x1a1824['params']['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x386faf,null))[_0xe547('0x27')](function(_0x1186e8){if(_0x1186e8){return _0x1186e8[_0xe547('0x86')](_0x1a1824[_0xe547('0x54')][_0xe547('0x66')],_['omit'](_0x1a1824[_0xe547('0x54')],[_0xe547('0x66'),'id'])||{})[_0xe547('0x87')](function(_0x379716){for(var _0x52ce7e=0x0;_0x52ce7e<_0x1a1824[_0xe547('0x54')][_0xe547('0x66')][_0xe547('0x49')];_0x52ce7e+=0x1){socket[_0xe547('0x70')](_0xe547('0x88'),{'UserId':Number(_0x1a1824['body']['ids'][_0x52ce7e]),'SmsQueueId':Number(_0x1a1824[_0xe547('0x48')]['id'])});}return _0x379716;});}})[_0xe547('0x27')](respondWithResult(_0x386faf,null))[_0xe547('0x4b')](handleError(_0x386faf,null));};exports['removeAgents']=function(_0x5cd43e,_0x1bdc18,_0xc22a84){return db['SmsQueue'][_0xe547('0x4a')]({'where':{'id':_0x5cd43e[_0xe547('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bdc18,null))[_0xe547('0x27')](function(_0x5277b1){if(_0x5277b1){return _0x5277b1['removeAgents'](_0x5cd43e['query'][_0xe547('0x66')])[_0xe547('0x27')](function(){if(_['isArray'](_0x5cd43e['query'][_0xe547('0x66')])){for(var _0x242b80=0x0;_0x242b80<_0x5cd43e['query']['ids'][_0xe547('0x49')];_0x242b80+=0x1){socket[_0xe547('0x70')](_0xe547('0x85'),{'UserId':Number(_0x5cd43e[_0xe547('0x35')][_0xe547('0x66')][_0x242b80]),'SmsQueueId':Number(_0x5cd43e[_0xe547('0x48')]['id'])});}}else{socket[_0xe547('0x70')](_0xe547('0x85'),{'UserId':Number(_0x5cd43e[_0xe547('0x35')][_0xe547('0x66')]),'SmsQueueId':Number(_0x5cd43e[_0xe547('0x48')]['id'])});}});}})[_0xe547('0x27')](respondWithStatusCode(_0x1bdc18,null))[_0xe547('0x4b')](handleError(_0x1bdc18,null));};exports[_0xe547('0x89')]=function(_0x849e7c,_0x4d1d94,_0x5ae194){var _0xf33b49={};var _0x48983b={};var _0x3ca0cb;var _0x1282f0;return db[_0xe547('0x2f')][_0xe547('0x56')]({'where':{'id':_0x849e7c[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x4d1d94,null))[_0xe547('0x27')](function(_0x3d7ef9){if(_0x3d7ef9){_0x3ca0cb=_0x3d7ef9;_0x48983b['model']=_[_0xe547('0x36')](db[_0xe547('0x5a')][_0xe547('0x30')]);_0x48983b['query']=_['keys'](_0x849e7c[_0xe547('0x35')]);_0x48983b[_0xe547('0x37')]=_[_0xe547('0x38')](_0x48983b[_0xe547('0x33')],_0x48983b['query']);_0xf33b49[_0xe547('0x39')]=_['intersection'](_0x48983b[_0xe547('0x33')],qs[_0xe547('0x3a')](_0x849e7c['query'][_0xe547('0x3a')]));_0xf33b49['attributes']=_0xf33b49[_0xe547('0x39')][_0xe547('0x49')]?_0xf33b49[_0xe547('0x39')]:_0x48983b['model'];_0xf33b49[_0xe547('0x58')]=qs['sort'](_0x849e7c[_0xe547('0x35')][_0xe547('0x3d')]);_0xf33b49[_0xe547('0x3e')]=qs[_0xe547('0x37')](_[_0xe547('0x3f')](_0x849e7c[_0xe547('0x35')],_0x48983b[_0xe547('0x37')]));if(_0x849e7c[_0xe547('0x35')]['filter']){_0xf33b49[_0xe547('0x3e')]=_[_0xe547('0x41')](_0xf33b49['where'],{'$or':_[_0xe547('0x34')](_0xf33b49['attributes'],function(_0x1b412f){var _0x5480b6={};_0x5480b6[_0x1b412f]={'$like':'%'+_0x849e7c[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x5480b6;})});}_0xf33b49=_[_0xe547('0x41')]({},_0xf33b49,_0x849e7c[_0xe547('0x43')]);return _0x3ca0cb[_0xe547('0x89')](_0xf33b49);}})[_0xe547('0x27')](function(_0x5b5328){if(_0x5b5328){_0x1282f0=_0x5b5328[_0xe547('0x49')];if(!_0x849e7c[_0xe547('0x35')][_0xe547('0x3b')](_0xe547('0x3c'))){_0xf33b49[_0xe547('0x22')]=qs[_0xe547('0x22')](_0x849e7c[_0xe547('0x35')][_0xe547('0x22')]);_0xf33b49[_0xe547('0x20')]=qs['offset'](_0x849e7c[_0xe547('0x35')][_0xe547('0x20')]);}return _0x3ca0cb[_0xe547('0x89')](_0xf33b49);}})[_0xe547('0x27')](function(_0x143715){if(_0x143715){return _0x143715?{'count':_0x1282f0,'rows':_0x143715}:null;}})[_0xe547('0x27')](respondWithResult(_0x4d1d94,null))[_0xe547('0x4b')](handleError(_0x4d1d94,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b5fe40f..ed179f0 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 _0x875f=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x258b0d,_0x41a5b2){var _0x11b433=function(_0x50b1f0){while(--_0x50b1f0){_0x258b0d['push'](_0x258b0d['shift']());}};_0x11b433(++_0x41a5b2);}(_0x875f,0x1d1));var _0xf875=function(_0x4dbff0,_0x12a22d){_0x4dbff0=_0x4dbff0-0x0;var _0x2283ab=_0x875f[_0x4dbff0];return _0x2283ab;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf875('0x0'))['db'][_0xf875('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf875('0x2')](0x0);var events={'afterCreate':_0xf875('0x3'),'afterUpdate':_0xf875('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45e7d3){return function(_0xb45a67,_0x53d878,_0xf9b04b){SmsQueueEvents[_0xf875('0x5')](_0x45e7d3+':'+_0xb45a67['id'],_0xb45a67);SmsQueueEvents[_0xf875('0x5')](_0x45e7d3,_0xb45a67);_0xf9b04b(null);};}for(var e in events){if(events[_0xf875('0x6')](e)){var event=events[e];SmsQueue[_0xf875('0x7')](e,emitEvent(event));}}module[_0xf875('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xd3b1=['update','emit','hook','exports','SmsQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3b1,0xe2));var _0x1d3b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd3b1[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x1d3b('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1d3b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d3b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x22538e){return function(_0x299afd,_0x27411d,_0x16edd5){SmsQueueEvents[_0x1d3b('0x3')](_0x22538e+':'+_0x299afd['id'],_0x299afd);SmsQueueEvents[_0x1d3b('0x3')](_0x22538e,_0x299afd);_0x16edd5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1d3b('0x4')](e,emitEvent(event));}}module[_0x1d3b('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 38d7fc1..1fcfdd1 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 _0x2b49=['path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x2b49,0x1ba));var _0x92b4=function(_0x115137,_0x3c13eb){_0x115137=_0x115137-0x0;var _0x59bed0=_0x2b49[_0x115137];return _0x59bed0;};'use strict';var _=require(_0x92b4('0x0'));var util=require(_0x92b4('0x1'));var logger=require('../../config/logger')(_0x92b4('0x2'));var moment=require(_0x92b4('0x3'));var BPromise=require(_0x92b4('0x4'));var rp=require(_0x92b4('0x5'));var fs=require('fs');var path=require(_0x92b4('0x6'));var rimraf=require(_0x92b4('0x7'));var config=require(_0x92b4('0x8'));var attributes=require(_0x92b4('0x9'));module[_0x92b4('0xa')]=function(_0x45f2e1,_0x17a54f){return _0x45f2e1[_0x92b4('0xb')](_0x92b4('0xc'),attributes,{'tableName':_0x92b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6ca=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0xf6ca,0x150));var _0xaf6c=function(_0x4da28f,_0x164324){_0x4da28f=_0x4da28f-0x0;var _0xe49192=_0xf6ca[_0x4da28f];return _0xe49192;};'use strict';var _=require('lodash');var util=require(_0xaf6c('0x0'));var logger=require(_0xaf6c('0x1'))('api');var moment=require(_0xaf6c('0x2'));var BPromise=require(_0xaf6c('0x3'));var rp=require(_0xaf6c('0x4'));var fs=require('fs');var path=require(_0xaf6c('0x5'));var rimraf=require(_0xaf6c('0x6'));var config=require(_0xaf6c('0x7'));var attributes=require(_0xaf6c('0x8'));module[_0xaf6c('0x9')]=function(_0x38987b,_0x10163e){return _0x38987b[_0xaf6c('0xa')](_0xaf6c('0xb'),attributes,{'tableName':_0xaf6c('0xc'),'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 ab1f429..a415455 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 _0xfc0c=['result','catch','GetSmsQueue','SmsQueue','findAll','raw','options','limit','include','map','model','attributes','ShowSmsQueue','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3e4853,_0x256600){var _0x214a19=function(_0x1c8f1b){while(--_0x1c8f1b){_0x3e4853['push'](_0x3e4853['shift']());}};_0x214a19(++_0x256600);}(_0xfc0c,0x136));var _0xcfc0=function(_0x8c16e4,_0x2e0c29){_0x8c16e4=_0x8c16e4-0x0;var _0x44455b=_0xfc0c[_0x8c16e4];return _0x44455b;};'use strict';var _=require(_0xcfc0('0x0'));var util=require(_0xcfc0('0x1'));var moment=require('moment');var BPromise=require(_0xcfc0('0x2'));var rs=require(_0xcfc0('0x3'));var fs=require('fs');var Redis=require(_0xcfc0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfc0('0x5'));var logger=require(_0xcfc0('0x6'))('rpc');var config=require(_0xcfc0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcfc0('0x8')]['http']({'port':0x232a});config[_0xcfc0('0x9')]=_[_0xcfc0('0xa')](config[_0xcfc0('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xcfc0('0xb'))(new Redis(config['redis']));require(_0xcfc0('0xc'))[_0xcfc0('0xd')](socket);function respondWithRpcPromise(_0x4eb5ef,_0x3360dc,_0x512479){return new BPromise(function(_0x59f38b,_0x4af3fe){return client[_0xcfc0('0xe')](_0x4eb5ef,_0x512479)[_0xcfc0('0xf')](function(_0x23aed4){logger[_0xcfc0('0x10')](_0xcfc0('0x11'),_0x3360dc,_0xcfc0('0x12'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3360dc,'request\x20sent',JSON[_0xcfc0('0x13')](_0x23aed4));if(_0x23aed4[_0xcfc0('0x14')]){if(_0x23aed4[_0xcfc0('0x14')][_0xcfc0('0x15')]===0x1f4){logger[_0xcfc0('0x14')]('SmsQueue,\x20%s,\x20%s',_0x3360dc,_0x23aed4[_0xcfc0('0x14')]['message']);return _0x4af3fe(_0x23aed4[_0xcfc0('0x14')]['message']);}logger['error'](_0xcfc0('0x11'),_0x3360dc,_0x23aed4['error'][_0xcfc0('0x16')]);return _0x59f38b(_0x23aed4[_0xcfc0('0x14')]['message']);}else{logger[_0xcfc0('0x10')](_0xcfc0('0x11'),_0x3360dc,_0xcfc0('0x12'));_0x59f38b(_0x23aed4[_0xcfc0('0x17')][_0xcfc0('0x16')]);}})[_0xcfc0('0x18')](function(_0xa9a5cc){logger['error'](_0xcfc0('0x11'),_0x3360dc,_0xa9a5cc);_0x4af3fe(_0xa9a5cc);});});}exports[_0xcfc0('0x19')]=function(_0x1f04a3){var _0x261415=this;return new Promise(function(_0x36e2d3,_0x17d661){return db[_0xcfc0('0x1a')][_0xcfc0('0x1b')]({'raw':_0x1f04a3['options']?_0x1f04a3['options'][_0xcfc0('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f04a3[_0xcfc0('0x1d')]?_0x1f04a3[_0xcfc0('0x1d')]['where']||null:null,'attributes':_0x1f04a3[_0xcfc0('0x1d')]?_0x1f04a3[_0xcfc0('0x1d')]['attributes']||null:null,'limit':_0x1f04a3[_0xcfc0('0x1d')]?_0x1f04a3[_0xcfc0('0x1d')][_0xcfc0('0x1e')]||null:null,'include':_0x1f04a3[_0xcfc0('0x1d')]?_0x1f04a3[_0xcfc0('0x1d')][_0xcfc0('0x1f')]?_[_0xcfc0('0x20')](_0x1f04a3['options'][_0xcfc0('0x1f')],function(_0x5f5bc5){return{'model':db[_0x5f5bc5['model']],'as':_0x5f5bc5['as'],'attributes':_0x5f5bc5['attributes'],'include':_0x5f5bc5['include']?_[_0xcfc0('0x20')](_0x5f5bc5['include'],function(_0x39007e){return{'model':db[_0x39007e[_0xcfc0('0x21')]],'as':_0x39007e['as'],'attributes':_0x39007e['attributes'],'include':_0x39007e[_0xcfc0('0x1f')]?_['map'](_0x39007e[_0xcfc0('0x1f')],function(_0x173904){return{'model':db[_0x173904[_0xcfc0('0x21')]],'as':_0x173904['as'],'attributes':_0x173904[_0xcfc0('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d8e0f){logger[_0xcfc0('0x10')](_0xcfc0('0x19'),_0x1f04a3);logger['debug'](_0xcfc0('0x19'),_0x1f04a3,JSON[_0xcfc0('0x13')](_0x2d8e0f));_0x36e2d3(_0x2d8e0f);})[_0xcfc0('0x18')](function(_0x3b275d){logger['error'](_0xcfc0('0x19'),_0x3b275d['message'],_0x1f04a3);_0x17d661(_0x261415[_0xcfc0('0x14')](0x1f4,_0x3b275d[_0xcfc0('0x16')]));});});};exports[_0xcfc0('0x23')]=function(_0x192ea8){var _0x44d950=this;return new Promise(function(_0x13655f,_0x63e16a){return db[_0xcfc0('0x1a')]['find']({'raw':_0x192ea8[_0xcfc0('0x1d')]?_0x192ea8[_0xcfc0('0x1d')][_0xcfc0('0x1c')]===undefined?!![]:![]:!![],'where':_0x192ea8['options']?_0x192ea8[_0xcfc0('0x1d')][_0xcfc0('0x24')]||null:null,'attributes':_0x192ea8[_0xcfc0('0x1d')]?_0x192ea8[_0xcfc0('0x1d')]['attributes']||null:null,'include':_0x192ea8['options']?_0x192ea8['options'][_0xcfc0('0x1f')]?_[_0xcfc0('0x20')](_0x192ea8['options'][_0xcfc0('0x1f')],function(_0x388c22){return{'model':db[_0x388c22[_0xcfc0('0x21')]],'as':_0x388c22['as'],'attributes':_0x388c22[_0xcfc0('0x22')],'include':_0x388c22[_0xcfc0('0x1f')]?_[_0xcfc0('0x20')](_0x388c22[_0xcfc0('0x1f')],function(_0x1738e7){return{'model':db[_0x1738e7[_0xcfc0('0x21')]],'as':_0x1738e7['as'],'attributes':_0x1738e7[_0xcfc0('0x22')],'include':_0x1738e7[_0xcfc0('0x1f')]?_[_0xcfc0('0x20')](_0x1738e7[_0xcfc0('0x1f')],function(_0x239bca){return{'model':db[_0x239bca[_0xcfc0('0x21')]],'as':_0x239bca['as'],'attributes':_0x239bca[_0xcfc0('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcfc0('0xf')](function(_0x30afa9){logger['info'](_0xcfc0('0x23'),_0x192ea8);logger['debug'](_0xcfc0('0x23'),_0x192ea8,JSON[_0xcfc0('0x13')](_0x30afa9));_0x13655f(_0x30afa9);})['catch'](function(_0xd32f11){logger[_0xcfc0('0x14')]('ShowSmsQueue',_0xd32f11[_0xcfc0('0x16')],_0x192ea8);_0x63e16a(_0x44d950[_0xcfc0('0x14')](0x1f4,_0xd32f11[_0xcfc0('0x16')]));});});}; \ No newline at end of file +var _0x3c59=['then','GetSmsQueue','ShowSmsQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x404eed,_0x5390c5){var _0xd45887=function(_0x1ee42b){while(--_0x1ee42b){_0x404eed['push'](_0x404eed['shift']());}};_0xd45887(++_0x5390c5);}(_0x3c59,0xa0));var _0x93c5=function(_0x14286a,_0x54bf72){_0x14286a=_0x14286a-0x0;var _0x26d207=_0x3c59[_0x14286a];return _0x26d207;};'use strict';var _=require(_0x93c5('0x0'));var util=require(_0x93c5('0x1'));var moment=require(_0x93c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x93c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93c5('0x4'))['db'];var utils=require(_0x93c5('0x5'));var logger=require(_0x93c5('0x6'))('rpc');var config=require(_0x93c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93c5('0x8')][_0x93c5('0x9')]({'port':0x232a});config[_0x93c5('0xa')]=_['defaults'](config[_0x93c5('0xa')],{'host':_0x93c5('0xb'),'port':0x18eb});var socket=require(_0x93c5('0xc'))(new Redis(config[_0x93c5('0xa')]));require(_0x93c5('0xd'))[_0x93c5('0xe')](socket);function respondWithRpcPromise(_0x3306e4,_0xe660ce,_0x1b374b){return new BPromise(function(_0x3a065c,_0x6e5b7c){return client['request'](_0x3306e4,_0x1b374b)['then'](function(_0x318490){logger['info'](_0x93c5('0xf'),_0xe660ce,_0x93c5('0x10'));logger[_0x93c5('0x11')](_0x93c5('0x12'),_0xe660ce,_0x93c5('0x10'),JSON[_0x93c5('0x13')](_0x318490));if(_0x318490[_0x93c5('0x14')]){if(_0x318490[_0x93c5('0x14')][_0x93c5('0x15')]===0x1f4){logger[_0x93c5('0x14')](_0x93c5('0xf'),_0xe660ce,_0x318490[_0x93c5('0x14')][_0x93c5('0x16')]);return _0x6e5b7c(_0x318490[_0x93c5('0x14')][_0x93c5('0x16')]);}logger['error'](_0x93c5('0xf'),_0xe660ce,_0x318490[_0x93c5('0x14')][_0x93c5('0x16')]);return _0x3a065c(_0x318490[_0x93c5('0x14')]['message']);}else{logger['info'](_0x93c5('0xf'),_0xe660ce,_0x93c5('0x10'));_0x3a065c(_0x318490[_0x93c5('0x17')]['message']);}})[_0x93c5('0x18')](function(_0x111fc9){logger[_0x93c5('0x14')](_0x93c5('0xf'),_0xe660ce,_0x111fc9);_0x6e5b7c(_0x111fc9);});});}exports['GetSmsQueue']=function(_0x55bf56){var _0x4a3a84=this;return new Promise(function(_0xba9e0c,_0x2bf32f){return db[_0x93c5('0x19')][_0x93c5('0x1a')]({'raw':_0x55bf56[_0x93c5('0x1b')]?_0x55bf56[_0x93c5('0x1b')][_0x93c5('0x1c')]===undefined?!![]:![]:!![],'where':_0x55bf56[_0x93c5('0x1b')]?_0x55bf56[_0x93c5('0x1b')][_0x93c5('0x1d')]||null:null,'attributes':_0x55bf56['options']?_0x55bf56['options'][_0x93c5('0x1e')]||null:null,'limit':_0x55bf56[_0x93c5('0x1b')]?_0x55bf56['options'][_0x93c5('0x1f')]||null:null,'include':_0x55bf56[_0x93c5('0x1b')]?_0x55bf56[_0x93c5('0x1b')][_0x93c5('0x20')]?_[_0x93c5('0x21')](_0x55bf56['options']['include'],function(_0x1ec7f0){return{'model':db[_0x1ec7f0['model']],'as':_0x1ec7f0['as'],'attributes':_0x1ec7f0['attributes'],'include':_0x1ec7f0[_0x93c5('0x20')]?_['map'](_0x1ec7f0[_0x93c5('0x20')],function(_0x62d306){return{'model':db[_0x62d306[_0x93c5('0x22')]],'as':_0x62d306['as'],'attributes':_0x62d306[_0x93c5('0x1e')],'include':_0x62d306[_0x93c5('0x20')]?_['map'](_0x62d306[_0x93c5('0x20')],function(_0xd48042){return{'model':db[_0xd48042['model']],'as':_0xd48042['as'],'attributes':_0xd48042['attributes']};}):[]};}):[]};}):[]:[]})[_0x93c5('0x23')](function(_0x2eb299){logger['info']('GetSmsQueue',_0x55bf56);logger['debug'](_0x93c5('0x24'),_0x55bf56,JSON[_0x93c5('0x13')](_0x2eb299));_0xba9e0c(_0x2eb299);})['catch'](function(_0x44337a){logger[_0x93c5('0x14')](_0x93c5('0x24'),_0x44337a['message'],_0x55bf56);_0x2bf32f(_0x4a3a84[_0x93c5('0x14')](0x1f4,_0x44337a['message']));});});};exports[_0x93c5('0x25')]=function(_0x109334){var _0x4b49c5=this;return new Promise(function(_0x42c597,_0x540f92){return db[_0x93c5('0x19')][_0x93c5('0x26')]({'raw':_0x109334['options']?_0x109334[_0x93c5('0x1b')][_0x93c5('0x1c')]===undefined?!![]:![]:!![],'where':_0x109334[_0x93c5('0x1b')]?_0x109334[_0x93c5('0x1b')][_0x93c5('0x1d')]||null:null,'attributes':_0x109334[_0x93c5('0x1b')]?_0x109334[_0x93c5('0x1b')][_0x93c5('0x1e')]||null:null,'include':_0x109334[_0x93c5('0x1b')]?_0x109334[_0x93c5('0x1b')][_0x93c5('0x20')]?_[_0x93c5('0x21')](_0x109334[_0x93c5('0x1b')]['include'],function(_0x5b7f0c){return{'model':db[_0x5b7f0c[_0x93c5('0x22')]],'as':_0x5b7f0c['as'],'attributes':_0x5b7f0c[_0x93c5('0x1e')],'include':_0x5b7f0c['include']?_[_0x93c5('0x21')](_0x5b7f0c[_0x93c5('0x20')],function(_0x21182e){return{'model':db[_0x21182e[_0x93c5('0x22')]],'as':_0x21182e['as'],'attributes':_0x21182e[_0x93c5('0x1e')],'include':_0x21182e[_0x93c5('0x20')]?_['map'](_0x21182e[_0x93c5('0x20')],function(_0x11dd66){return{'model':db[_0x11dd66[_0x93c5('0x22')]],'as':_0x11dd66['as'],'attributes':_0x11dd66['attributes']};}):[]};}):[]};}):[]:[]})[_0x93c5('0x23')](function(_0x681e81){logger['info']('ShowSmsQueue',_0x109334);logger['debug'](_0x93c5('0x25'),_0x109334,JSON[_0x93c5('0x13')](_0x681e81));_0x42c597(_0x681e81);})[_0x93c5('0x18')](function(_0x411118){logger[_0x93c5('0x14')]('ShowSmsQueue',_0x411118[_0x93c5('0x16')],_0x109334);_0x540f92(_0x4b49c5[_0x93c5('0x14')](0x1f4,_0x411118[_0x93c5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 2ff0ec6..216a197 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 _0x2962=['./smsQueue.events','save','remove','emit','removeListener','register','smsQueue:'];(function(_0x52f637,_0x46f2c6){var _0x4b280e=function(_0x19c312){while(--_0x19c312){_0x52f637['push'](_0x52f637['shift']());}};_0x4b280e(++_0x46f2c6);}(_0x2962,0xfc));var _0x2296=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2962[_0xfae23b];return _0x200640;};'use strict';var SmsQueueEvents=require(_0x2296('0x0'));var events=[_0x2296('0x1'),_0x2296('0x2'),'update'];function createListener(_0x2ba0f9,_0x460887){return function(_0x184e2d){_0x460887[_0x2296('0x3')](_0x2ba0f9,_0x184e2d);};}function removeListener(_0xbe1cd2,_0x54ef2f){return function(){SmsQueueEvents[_0x2296('0x4')](_0xbe1cd2,_0x54ef2f);};}exports[_0x2296('0x5')]=function(_0x3e9e41){for(var _0x4e20ee=0x0,_0x80d2ac=events['length'];_0x4e20ee<_0x80d2ac;_0x4e20ee++){var _0x39d0f2=events[_0x4e20ee];var _0x24e3d7=createListener(_0x2296('0x6')+_0x39d0f2,_0x3e9e41);SmsQueueEvents['on'](_0x39d0f2,_0x24e3d7);}}; \ No newline at end of file +var _0x3f56=['./smsQueue.events','remove','update','removeListener','register','length','smsQueue:'];(function(_0x34fc5d,_0x1a84de){var _0x5dfa65=function(_0x4a7647){while(--_0x4a7647){_0x34fc5d['push'](_0x34fc5d['shift']());}};_0x5dfa65(++_0x1a84de);}(_0x3f56,0x1f1));var _0x63f5=function(_0x4d2582,_0x546e9e){_0x4d2582=_0x4d2582-0x0;var _0x596f76=_0x3f56[_0x4d2582];return _0x596f76;};'use strict';var SmsQueueEvents=require(_0x63f5('0x0'));var events=['save',_0x63f5('0x1'),_0x63f5('0x2')];function createListener(_0x1b91b0,_0x59eeb1){return function(_0x35e42d){_0x59eeb1['emit'](_0x1b91b0,_0x35e42d);};}function removeListener(_0x4f0d78,_0x22f2a1){return function(){SmsQueueEvents[_0x63f5('0x3')](_0x4f0d78,_0x22f2a1);};}exports[_0x63f5('0x4')]=function(_0x179ab5){for(var _0x598db0=0x0,_0x9a2dbe=events[_0x63f5('0x5')];_0x598db0<_0x9a2dbe;_0x598db0++){var _0x141c09=events[_0x598db0];var _0x25bee0=createListener(_0x63f5('0x6')+_0x141c09,_0x179ab5);SmsQueueEvents['on'](_0x141c09,_0x25bee0);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 7a68475..94a4491 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 _0x33c1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','exports','util','connect-timeout','express'];(function(_0x1ba755,_0x111482){var _0x64e4b7=function(_0x374ed9){while(--_0x374ed9){_0x1ba755['push'](_0x1ba755['shift']());}};_0x64e4b7(++_0x111482);}(_0x33c1,0x82));var _0x133c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x33c1[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x133c('0x0'));var path=require('path');var timeout=require(_0x133c('0x1'));var express=require(_0x133c('0x2'));var router=express['Router']();var fs_extra=require(_0x133c('0x3'));var auth=require(_0x133c('0x4'));var interaction=require(_0x133c('0x5'));var config=require(_0x133c('0x6'));var controller=require(_0x133c('0x7'));router[_0x133c('0x8')]('/',auth[_0x133c('0x9')](),controller[_0x133c('0xa')]);router[_0x133c('0x8')](_0x133c('0xb'),auth[_0x133c('0x9')](),controller[_0x133c('0xc')]);router[_0x133c('0x8')](_0x133c('0xd'),auth[_0x133c('0x9')](),controller[_0x133c('0xe')]);router[_0x133c('0xf')]('/',auth['isAuthenticated'](),controller[_0x133c('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x133c('0x9')](),controller[_0x133c('0x11')]);module[_0x133c('0x12')]=router; \ No newline at end of file +var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','delete','destroy'];(function(_0x218809,_0x11da88){var _0x344f3e=function(_0x1ec578){while(--_0x1ec578){_0x218809['push'](_0x218809['shift']());}};_0x344f3e(++_0x11da88);}(_0x2bd8,0x130));var _0x82bd=function(_0x3cabcf,_0x4bbd6f){_0x3cabcf=_0x3cabcf-0x0;var _0x28ad40=_0x2bd8[_0x3cabcf];return _0x28ad40;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['put'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x82bd('0xe')](_0x82bd('0xd'),auth['isAuthenticated'](),controller[_0x82bd('0xf')]);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 347dcd7..99720b7 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 _0x5390=['sequelize','exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5390,0x144));var _0x0539=function(_0x46bac2,_0x8f22b6){_0x46bac2=_0x46bac2-0x0;var _0x18f58d=_0x5390[_0x46bac2];return _0x18f58d;};'use strict';var moment=require(_0x0539('0x0'));var Sequelize=require(_0x0539('0x1'));module[_0x0539('0x2')]={'uniqueid':{'type':Sequelize[_0x0539('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0539('0x3')]},'joinAt':{'type':Sequelize[_0x0539('0x4')]},'leaveAt':{'type':Sequelize[_0x0539('0x4')]},'acceptAt':{'type':Sequelize[_0x0539('0x4')]},'exitAt':{'type':Sequelize[_0x0539('0x4')]},'reason':{'type':Sequelize[_0x0539('0x3')]}}; \ No newline at end of file +var _0xdd1a=['DATE','moment','exports','STRING'];(function(_0x2d8864,_0x2438a0){var _0x188005=function(_0x27d0d2){while(--_0x27d0d2){_0x2d8864['push'](_0x2d8864['shift']());}};_0x188005(++_0x2438a0);}(_0xdd1a,0x1dd));var _0xadd1=function(_0x16daff,_0x16cde8){_0x16daff=_0x16daff-0x0;var _0x47ca36=_0xdd1a[_0x16daff];return _0x47ca36;};'use strict';var moment=require(_0xadd1('0x0'));var Sequelize=require('sequelize');module[_0xadd1('0x1')]={'uniqueid':{'type':Sequelize[_0xadd1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xadd1('0x2')]},'joinAt':{'type':Sequelize[_0xadd1('0x3')]},'leaveAt':{'type':Sequelize[_0xadd1('0x3')]},'acceptAt':{'type':Sequelize[_0xadd1('0x3')]},'exitAt':{'type':Sequelize[_0xadd1('0x3')]},'reason':{'type':Sequelize[_0xadd1('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 7036450..f190e99 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 _0x7016=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','error','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params','fields','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3676fc,_0x369252){var _0x305fa1=function(_0x21b996){while(--_0x21b996){_0x3676fc['push'](_0x3676fc['shift']());}};_0x305fa1(++_0x369252);}(_0x7016,0x8f));var _0x6701=function(_0x535e68,_0x1dc870){_0x535e68=_0x535e68-0x0;var _0x1fd40e=_0x7016[_0x535e68];return _0x1fd40e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6701('0x0'));var zipdir=require(_0x6701('0x1'));var jsonpatch=require(_0x6701('0x2'));var rp=require(_0x6701('0x3'));var moment=require(_0x6701('0x4'));var BPromise=require(_0x6701('0x5'));var Mustache=require('mustache');var util=require(_0x6701('0x6'));var path=require(_0x6701('0x7'));var sox=require(_0x6701('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6701('0x9'));var _=require(_0x6701('0xa'));var squel=require(_0x6701('0xb'));var crypto=require(_0x6701('0xc'));var jsforce=require(_0x6701('0xd'));var deskjs=require(_0x6701('0xe'));var toCsv=require(_0x6701('0xf'));var querystring=require(_0x6701('0x10'));var Papa=require(_0x6701('0x11'));var Redis=require(_0x6701('0x12'));var authService=require(_0x6701('0x13'));var qs=require(_0x6701('0x14'));var as=require(_0x6701('0x15'));var hardwareService=require(_0x6701('0x16'));var logger=require(_0x6701('0x17'))(_0x6701('0x18'));var utils=require(_0x6701('0x19'));var config=require(_0x6701('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6701('0x1b'))['db'];function respondWithStatusCode(_0x15d657,_0x4afac7){_0x4afac7=_0x4afac7||0xcc;return function(_0x4975e5){if(_0x4975e5){return _0x15d657[_0x6701('0x1c')](_0x4afac7);}return _0x15d657[_0x6701('0x1d')](_0x4afac7)[_0x6701('0x1e')]();};}function respondWithResult(_0x3378c2,_0x351af8){_0x351af8=_0x351af8||0xc8;return function(_0x2f3414){if(_0x2f3414){return _0x3378c2['status'](_0x351af8)[_0x6701('0x1f')](_0x2f3414);}};}function respondWithFilteredResult(_0x41c1a1,_0x54288f){return function(_0x3bf8a9){if(_0x3bf8a9){var _0x59874e=typeof _0x54288f['offset']==='undefined'&&typeof _0x54288f[_0x6701('0x20')]===_0x6701('0x21');var _0x414810=_0x3bf8a9[_0x6701('0x22')];var _0x550d3d=_0x59874e?0x0:_0x54288f[_0x6701('0x23')];var _0x199055=_0x59874e?_0x3bf8a9[_0x6701('0x22')]:_0x54288f[_0x6701('0x23')]+_0x54288f[_0x6701('0x20')];var _0x1a07a2;if(_0x199055>=_0x414810){_0x199055=_0x414810;_0x1a07a2=0xc8;}else{_0x1a07a2=0xce;}_0x41c1a1[_0x6701('0x1d')](_0x1a07a2);return _0x41c1a1[_0x6701('0x24')](_0x6701('0x25'),_0x550d3d+'-'+_0x199055+'/'+_0x414810)[_0x6701('0x1f')](_0x3bf8a9);}return null;};}function patchUpdates(_0x3ee67b){return function(_0x513b9e){try{jsonpatch[_0x6701('0x26')](_0x513b9e,_0x3ee67b,!![]);}catch(_0x41f508){return BPromise[_0x6701('0x27')](_0x41f508);}return _0x513b9e[_0x6701('0x28')]();};}function saveUpdates(_0x3f9bb3,_0x565e90){return function(_0x4cf91e){if(_0x4cf91e){return _0x4cf91e['update'](_0x3f9bb3)['then'](function(_0x496a16){return _0x496a16;});}return null;};}function removeEntity(_0x4a629a,_0x54d151){return function(_0x524eb8){if(_0x524eb8){return _0x524eb8[_0x6701('0x29')]()['then'](function(){_0x4a629a[_0x6701('0x1d')](0xcc)[_0x6701('0x1e')]();});}};}function handleEntityNotFound(_0x43ed5c,_0x2f4901){return function(_0x13a3f1){if(!_0x13a3f1){_0x43ed5c[_0x6701('0x1c')](0x194);}return _0x13a3f1;};}function handleError(_0x55a379,_0x41e67c){_0x41e67c=_0x41e67c||0x1f4;return function(_0x5fba2a){logger[_0x6701('0x2a')](_0x5fba2a['stack']);if(_0x5fba2a[_0x6701('0x2b')]){delete _0x5fba2a['name'];}_0x55a379['status'](_0x41e67c)[_0x6701('0x2c')](_0x5fba2a);};}exports[_0x6701('0x2d')]=function(_0x8bd7e4,_0x4b6389){var _0x482b5f={},_0x30ed55={},_0xda43a7={'count':0x0,'rows':[]};var _0x28c574=_['map'](db[_0x6701('0x2e')][_0x6701('0x2f')],function(_0x4d4b6f){return{'name':_0x4d4b6f[_0x6701('0x30')],'type':_0x4d4b6f[_0x6701('0x31')]['key']};});_0x30ed55[_0x6701('0x32')]=_['map'](_0x28c574,_0x6701('0x2b'));_0x30ed55[_0x6701('0x33')]=_[_0x6701('0x34')](_0x8bd7e4['query']);_0x30ed55[_0x6701('0x35')]=_[_0x6701('0x36')](_0x30ed55[_0x6701('0x32')],_0x30ed55[_0x6701('0x33')]);_0x482b5f[_0x6701('0x37')]=_['intersection'](_0x30ed55[_0x6701('0x32')],qs['fields'](_0x8bd7e4[_0x6701('0x33')]['fields']));_0x482b5f['attributes']=_0x482b5f[_0x6701('0x37')][_0x6701('0x38')]?_0x482b5f[_0x6701('0x37')]:_0x30ed55['model'];if(!_0x8bd7e4[_0x6701('0x33')][_0x6701('0x39')](_0x6701('0x3a'))){_0x482b5f[_0x6701('0x20')]=qs['limit'](_0x8bd7e4[_0x6701('0x33')]['limit']);_0x482b5f[_0x6701('0x23')]=qs[_0x6701('0x23')](_0x8bd7e4[_0x6701('0x33')][_0x6701('0x23')]);}_0x482b5f[_0x6701('0x3b')]=qs[_0x6701('0x3c')](_0x8bd7e4[_0x6701('0x33')][_0x6701('0x3c')]);_0x482b5f['where']=qs[_0x6701('0x35')](_[_0x6701('0x3d')](_0x8bd7e4[_0x6701('0x33')],_0x30ed55[_0x6701('0x35')]),_0x28c574);if(_0x8bd7e4['query'][_0x6701('0x3e')]){_0x482b5f[_0x6701('0x3f')]=_[_0x6701('0x40')](_0x482b5f[_0x6701('0x3f')],{'$or':_[_0x6701('0x41')](_0x28c574,function(_0x29b090){if(_0x29b090[_0x6701('0x31')]!==_0x6701('0x42')){var _0x354072={};_0x354072[_0x29b090['name']]={'$like':'%'+_0x8bd7e4[_0x6701('0x33')][_0x6701('0x3e')]+'%'};return _0x354072;}})});}_0x482b5f=_[_0x6701('0x40')]({},_0x482b5f,_0x8bd7e4[_0x6701('0x43')]);var _0x28b383={'where':_0x482b5f[_0x6701('0x3f')]};return db[_0x6701('0x2e')][_0x6701('0x22')](_0x28b383)['then'](function(_0x27811f){_0xda43a7[_0x6701('0x22')]=_0x27811f;if(_0x8bd7e4[_0x6701('0x33')][_0x6701('0x44')]){_0x482b5f[_0x6701('0x45')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x6701('0x46')](_0x482b5f);})['then'](function(_0x52e968){_0xda43a7[_0x6701('0x47')]=_0x52e968;return _0xda43a7;})[_0x6701('0x48')](respondWithFilteredResult(_0x4b6389,_0x482b5f))[_0x6701('0x49')](handleError(_0x4b6389,null));};exports[_0x6701('0x4a')]=function(_0x361a8d,_0x250bce){var _0x30ef2b={'raw':!![],'where':{'id':_0x361a8d[_0x6701('0x4b')]['id']}},_0x23611f={};_0x23611f[_0x6701('0x32')]=_[_0x6701('0x34')](db[_0x6701('0x2e')][_0x6701('0x2f')]);_0x23611f[_0x6701('0x33')]=_[_0x6701('0x34')](_0x361a8d['query']);_0x23611f['filters']=_[_0x6701('0x36')](_0x23611f[_0x6701('0x32')],_0x23611f['query']);_0x30ef2b['attributes']=_['intersection'](_0x23611f[_0x6701('0x32')],qs[_0x6701('0x4c')](_0x361a8d['query'][_0x6701('0x4c')]));_0x30ef2b[_0x6701('0x37')]=_0x30ef2b['attributes'][_0x6701('0x38')]?_0x30ef2b[_0x6701('0x37')]:_0x23611f[_0x6701('0x32')];if(_0x361a8d[_0x6701('0x33')][_0x6701('0x44')]){_0x30ef2b[_0x6701('0x45')]=[{'all':!![]}];}_0x30ef2b=_[_0x6701('0x40')]({},_0x30ef2b,_0x361a8d[_0x6701('0x43')]);return db[_0x6701('0x2e')][_0x6701('0x4d')](_0x30ef2b)[_0x6701('0x48')](handleEntityNotFound(_0x250bce,null))[_0x6701('0x48')](respondWithResult(_0x250bce,null))['catch'](handleError(_0x250bce,null));};exports[_0x6701('0x4e')]=function(_0x52c344,_0x23bb33){return db['SmsQueueReport'][_0x6701('0x4e')](_0x52c344[_0x6701('0x4f')],{})['then'](respondWithResult(_0x23bb33,0xc9))[_0x6701('0x49')](handleError(_0x23bb33,null));};exports[_0x6701('0x50')]=function(_0x13712a,_0x14ea4a){if(_0x13712a[_0x6701('0x4f')]['id']){delete _0x13712a['body']['id'];}return db['SmsQueueReport'][_0x6701('0x4d')]({'where':{'id':_0x13712a['params']['id']}})['then'](handleEntityNotFound(_0x14ea4a,null))[_0x6701('0x48')](saveUpdates(_0x13712a[_0x6701('0x4f')],null))[_0x6701('0x48')](respondWithResult(_0x14ea4a,null))[_0x6701('0x49')](handleError(_0x14ea4a,null));};exports['destroy']=function(_0x51efa5,_0x2abd82){return db['SmsQueueReport'][_0x6701('0x4d')]({'where':{'id':_0x51efa5['params']['id']}})[_0x6701('0x48')](handleEntityNotFound(_0x2abd82,null))['then'](removeEntity(_0x2abd82,null))['catch'](handleError(_0x2abd82,null));};exports[_0x6701('0x51')]=function(_0x537eb6,_0x289e22){return db[_0x6701('0x2e')][_0x6701('0x51')]()['then'](respondWithResult(_0x289e22,null))[_0x6701('0x49')](handleError(_0x289e22,null));}; \ No newline at end of file +var _0x1b95=['intersection','attributes','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','fields','length','create','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x20dd9b,_0x3c0fb8){var _0x2de3b0=function(_0x5673d2){while(--_0x5673d2){_0x20dd9b['push'](_0x20dd9b['shift']());}};_0x2de3b0(++_0x3c0fb8);}(_0x1b95,0x17e));var _0x51b9=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x1b95[_0x363ef8];return _0x148822;};'use strict';var emlformat=require(_0x51b9('0x0'));var rimraf=require(_0x51b9('0x1'));var zipdir=require(_0x51b9('0x2'));var jsonpatch=require(_0x51b9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51b9('0x4'));var Mustache=require(_0x51b9('0x5'));var util=require(_0x51b9('0x6'));var path=require(_0x51b9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x51b9('0x8'));var fs=require('fs');var fs_extra=require(_0x51b9('0x9'));var _=require(_0x51b9('0xa'));var squel=require(_0x51b9('0xb'));var crypto=require(_0x51b9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x51b9('0xd'));var toCsv=require(_0x51b9('0xe'));var querystring=require(_0x51b9('0xf'));var Papa=require('papaparse');var Redis=require(_0x51b9('0x10'));var authService=require(_0x51b9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51b9('0x12'));var logger=require(_0x51b9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x51b9('0x14'));var licenseUtil=require(_0x51b9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17d453,_0x29952b){_0x29952b=_0x29952b||0xcc;return function(_0x1677f1){if(_0x1677f1){return _0x17d453[_0x51b9('0x16')](_0x29952b);}return _0x17d453[_0x51b9('0x17')](_0x29952b)[_0x51b9('0x18')]();};}function respondWithResult(_0x21a0e5,_0x5b37fe){_0x5b37fe=_0x5b37fe||0xc8;return function(_0x23827f){if(_0x23827f){return _0x21a0e5['status'](_0x5b37fe)[_0x51b9('0x19')](_0x23827f);}};}function respondWithFilteredResult(_0xdffbd5,_0x563dfe){return function(_0x2cc444){if(_0x2cc444){var _0xc14a13=typeof _0x563dfe[_0x51b9('0x1a')]===_0x51b9('0x1b')&&typeof _0x563dfe[_0x51b9('0x1c')]===_0x51b9('0x1b');var _0x5af1e2=_0x2cc444[_0x51b9('0x1d')];var _0x2836a0=_0xc14a13?0x0:_0x563dfe[_0x51b9('0x1a')];var _0x2e76e1=_0xc14a13?_0x2cc444[_0x51b9('0x1d')]:_0x563dfe[_0x51b9('0x1a')]+_0x563dfe[_0x51b9('0x1c')];var _0x55313e;if(_0x2e76e1>=_0x5af1e2){_0x2e76e1=_0x5af1e2;_0x55313e=0xc8;}else{_0x55313e=0xce;}_0xdffbd5[_0x51b9('0x17')](_0x55313e);return _0xdffbd5[_0x51b9('0x1e')](_0x51b9('0x1f'),_0x2836a0+'-'+_0x2e76e1+'/'+_0x5af1e2)[_0x51b9('0x19')](_0x2cc444);}return null;};}function patchUpdates(_0x96c95f){return function(_0xd91ad7){try{jsonpatch[_0x51b9('0x20')](_0xd91ad7,_0x96c95f,!![]);}catch(_0x718d78){return BPromise[_0x51b9('0x21')](_0x718d78);}return _0xd91ad7[_0x51b9('0x22')]();};}function saveUpdates(_0x240c27,_0x4ee1bc){return function(_0x5debe7){if(_0x5debe7){return _0x5debe7[_0x51b9('0x23')](_0x240c27)[_0x51b9('0x24')](function(_0x341252){return _0x341252;});}return null;};}function removeEntity(_0x16aae7,_0x5cf155){return function(_0x17bdd6){if(_0x17bdd6){return _0x17bdd6[_0x51b9('0x25')]()[_0x51b9('0x24')](function(){_0x16aae7[_0x51b9('0x17')](0xcc)[_0x51b9('0x18')]();});}};}function handleEntityNotFound(_0x4c7037,_0x45a28b){return function(_0x1bcc35){if(!_0x1bcc35){_0x4c7037[_0x51b9('0x16')](0x194);}return _0x1bcc35;};}function handleError(_0x27a5f,_0x69a6c1){_0x69a6c1=_0x69a6c1||0x1f4;return function(_0x5d33ca){logger[_0x51b9('0x26')](_0x5d33ca['stack']);if(_0x5d33ca[_0x51b9('0x27')]){delete _0x5d33ca[_0x51b9('0x27')];}_0x27a5f[_0x51b9('0x17')](_0x69a6c1)['send'](_0x5d33ca);};}exports[_0x51b9('0x28')]=function(_0x50067f,_0x482da3){var _0x3f1b45={},_0x3784cf={},_0x531588={'count':0x0,'rows':[]};var _0x94a18d=_[_0x51b9('0x29')](db[_0x51b9('0x2a')][_0x51b9('0x2b')],function(_0x2b7d1b){return{'name':_0x2b7d1b[_0x51b9('0x2c')],'type':_0x2b7d1b[_0x51b9('0x2d')]['key']};});_0x3784cf[_0x51b9('0x2e')]=_[_0x51b9('0x29')](_0x94a18d,_0x51b9('0x27'));_0x3784cf[_0x51b9('0x2f')]=_[_0x51b9('0x30')](_0x50067f[_0x51b9('0x2f')]);_0x3784cf[_0x51b9('0x31')]=_[_0x51b9('0x32')](_0x3784cf[_0x51b9('0x2e')],_0x3784cf[_0x51b9('0x2f')]);_0x3f1b45[_0x51b9('0x33')]=_['intersection'](_0x3784cf[_0x51b9('0x2e')],qs['fields'](_0x50067f['query']['fields']));_0x3f1b45[_0x51b9('0x33')]=_0x3f1b45[_0x51b9('0x33')]['length']?_0x3f1b45[_0x51b9('0x33')]:_0x3784cf[_0x51b9('0x2e')];if(!_0x50067f['query'][_0x51b9('0x34')]('nolimit')){_0x3f1b45[_0x51b9('0x1c')]=qs['limit'](_0x50067f[_0x51b9('0x2f')][_0x51b9('0x1c')]);_0x3f1b45[_0x51b9('0x1a')]=qs[_0x51b9('0x1a')](_0x50067f[_0x51b9('0x2f')][_0x51b9('0x1a')]);}_0x3f1b45[_0x51b9('0x35')]=qs['sort'](_0x50067f['query'][_0x51b9('0x36')]);_0x3f1b45[_0x51b9('0x37')]=qs['filters'](_['pick'](_0x50067f[_0x51b9('0x2f')],_0x3784cf[_0x51b9('0x31')]),_0x94a18d);if(_0x50067f[_0x51b9('0x2f')][_0x51b9('0x38')]){_0x3f1b45[_0x51b9('0x37')]=_['merge'](_0x3f1b45['where'],{'$or':_[_0x51b9('0x29')](_0x94a18d,function(_0x5e89d6){if(_0x5e89d6[_0x51b9('0x2d')]!==_0x51b9('0x39')){var _0x228d37={};_0x228d37[_0x5e89d6[_0x51b9('0x27')]]={'$like':'%'+_0x50067f[_0x51b9('0x2f')]['filter']+'%'};return _0x228d37;}})});}_0x3f1b45=_[_0x51b9('0x3a')]({},_0x3f1b45,_0x50067f[_0x51b9('0x3b')]);var _0x1d9a9e={'where':_0x3f1b45[_0x51b9('0x37')]};return db['SmsQueueReport'][_0x51b9('0x1d')](_0x1d9a9e)['then'](function(_0xb4a231){_0x531588['count']=_0xb4a231;if(_0x50067f['query'][_0x51b9('0x3c')]){_0x3f1b45[_0x51b9('0x3d')]=[{'all':!![]}];}return db[_0x51b9('0x2a')][_0x51b9('0x3e')](_0x3f1b45);})[_0x51b9('0x24')](function(_0x104732){_0x531588[_0x51b9('0x3f')]=_0x104732;return _0x531588;})[_0x51b9('0x24')](respondWithFilteredResult(_0x482da3,_0x3f1b45))['catch'](handleError(_0x482da3,null));};exports['show']=function(_0x16cfa8,_0x2cef68){var _0x439a76={'raw':!![],'where':{'id':_0x16cfa8[_0x51b9('0x40')]['id']}},_0x98ea7a={};_0x98ea7a[_0x51b9('0x2e')]=_[_0x51b9('0x30')](db[_0x51b9('0x2a')][_0x51b9('0x2b')]);_0x98ea7a[_0x51b9('0x2f')]=_[_0x51b9('0x30')](_0x16cfa8[_0x51b9('0x2f')]);_0x98ea7a[_0x51b9('0x31')]=_['intersection'](_0x98ea7a[_0x51b9('0x2e')],_0x98ea7a[_0x51b9('0x2f')]);_0x439a76[_0x51b9('0x33')]=_['intersection'](_0x98ea7a[_0x51b9('0x2e')],qs[_0x51b9('0x41')](_0x16cfa8['query'][_0x51b9('0x41')]));_0x439a76[_0x51b9('0x33')]=_0x439a76['attributes'][_0x51b9('0x42')]?_0x439a76[_0x51b9('0x33')]:_0x98ea7a[_0x51b9('0x2e')];if(_0x16cfa8[_0x51b9('0x2f')]['includeAll']){_0x439a76[_0x51b9('0x3d')]=[{'all':!![]}];}_0x439a76=_[_0x51b9('0x3a')]({},_0x439a76,_0x16cfa8[_0x51b9('0x3b')]);return db[_0x51b9('0x2a')]['find'](_0x439a76)[_0x51b9('0x24')](handleEntityNotFound(_0x2cef68,null))[_0x51b9('0x24')](respondWithResult(_0x2cef68,null))['catch'](handleError(_0x2cef68,null));};exports[_0x51b9('0x43')]=function(_0xbb42fd,_0x43a75c){return db[_0x51b9('0x2a')]['create'](_0xbb42fd['body'],{})[_0x51b9('0x24')](respondWithResult(_0x43a75c,0xc9))[_0x51b9('0x44')](handleError(_0x43a75c,null));};exports[_0x51b9('0x23')]=function(_0x3fea27,_0x69c8cf){if(_0x3fea27[_0x51b9('0x45')]['id']){delete _0x3fea27['body']['id'];}return db[_0x51b9('0x2a')][_0x51b9('0x46')]({'where':{'id':_0x3fea27[_0x51b9('0x40')]['id']}})[_0x51b9('0x24')](handleEntityNotFound(_0x69c8cf,null))[_0x51b9('0x24')](saveUpdates(_0x3fea27['body'],null))['then'](respondWithResult(_0x69c8cf,null))['catch'](handleError(_0x69c8cf,null));};exports['destroy']=function(_0x5ebfc0,_0x4ee666){return db[_0x51b9('0x2a')][_0x51b9('0x46')]({'where':{'id':_0x5ebfc0[_0x51b9('0x40')]['id']}})[_0x51b9('0x24')](handleEntityNotFound(_0x4ee666,null))[_0x51b9('0x24')](removeEntity(_0x4ee666,null))[_0x51b9('0x44')](handleError(_0x4ee666,null));};exports['describe']=function(_0xe22fec,_0x1b8d67){return db[_0x51b9('0x2a')][_0x51b9('0x47')]()[_0x51b9('0x24')](respondWithResult(_0x1b8d67,null))[_0x51b9('0x44')](handleError(_0x1b8d67,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0001dfc..0fd49a6 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x274c0f,_0xeee76d){var _0x4c1ccc=function(_0x307106){while(--_0x307106){_0x274c0f['push'](_0x274c0f['shift']());}};_0x4c1ccc(++_0xeee76d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0xcb91[_0x334f9a];return _0x2b219d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 09fe701..de9c610 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 _0x3935=['SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','body','limit','UpdateSmsQueueReport','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x527b3e,_0x237fd4){var _0x531997=function(_0x351417){while(--_0x351417){_0x527b3e['push'](_0x527b3e['shift']());}};_0x531997(++_0x237fd4);}(_0x3935,0x1e4));var _0x5393=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0x3935[_0x2b0a86];return _0x955940;};'use strict';var _=require(_0x5393('0x0'));var util=require(_0x5393('0x1'));var moment=require(_0x5393('0x2'));var BPromise=require(_0x5393('0x3'));var rs=require(_0x5393('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5393('0x5'))['db'];var utils=require(_0x5393('0x6'));var logger=require(_0x5393('0x7'))(_0x5393('0x8'));var config=require('../../config/environment');var jayson=require(_0x5393('0x9'));var client=jayson[_0x5393('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b516e,_0x408e1d,_0x579a08){return new BPromise(function(_0x149e71,_0x46161c){return client[_0x5393('0xb')](_0x4b516e,_0x579a08)['then'](function(_0x489698){logger['info'](_0x5393('0xc'),_0x408e1d,_0x5393('0xd'));logger[_0x5393('0xe')](_0x5393('0xf'),_0x408e1d,_0x5393('0xd'),JSON['stringify'](_0x489698));if(_0x489698[_0x5393('0x10')]){if(_0x489698[_0x5393('0x10')][_0x5393('0x11')]===0x1f4){logger[_0x5393('0x10')](_0x5393('0xc'),_0x408e1d,_0x489698[_0x5393('0x10')][_0x5393('0x12')]);return _0x46161c(_0x489698[_0x5393('0x10')]['message']);}logger[_0x5393('0x10')](_0x5393('0xc'),_0x408e1d,_0x489698[_0x5393('0x10')]['message']);return _0x149e71(_0x489698[_0x5393('0x10')][_0x5393('0x12')]);}else{logger[_0x5393('0x13')](_0x5393('0xc'),_0x408e1d,'request\x20sent');_0x149e71(_0x489698['result']['message']);}})[_0x5393('0x14')](function(_0x395a18){logger[_0x5393('0x10')](_0x5393('0xc'),_0x408e1d,_0x395a18);_0x46161c(_0x395a18);});});}exports[_0x5393('0x15')]=function(_0x33d7ca){var _0x3533d5=this;return new Promise(function(_0x4c0195,_0x1bc418){return db[_0x5393('0x16')][_0x5393('0x17')](_0x33d7ca['body'],{'raw':_0x33d7ca[_0x5393('0x18')]?_0x33d7ca[_0x5393('0x18')][_0x5393('0x19')]===undefined?!![]:![]:!![]})[_0x5393('0x1a')](function(_0x34396f){logger['info'](_0x5393('0x15'),_0x33d7ca);logger[_0x5393('0xe')](_0x5393('0x15'),_0x33d7ca,JSON['stringify'](_0x34396f));_0x4c0195(_0x34396f);})[_0x5393('0x14')](function(_0x5fb30f){logger[_0x5393('0x10')](_0x5393('0x15'),_0x5fb30f[_0x5393('0x12')],_0x33d7ca);_0x1bc418(_0x3533d5['error'](0x1f4,_0x5fb30f[_0x5393('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x19536f){var _0x60966a=this;return new Promise(function(_0x2ea4bb,_0x374ba8){return db[_0x5393('0x16')]['update'](_0x19536f[_0x5393('0x1b')],{'raw':_0x19536f[_0x5393('0x18')]?_0x19536f[_0x5393('0x18')][_0x5393('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19536f[_0x5393('0x18')]?_0x19536f[_0x5393('0x18')]['where']||null:null,'attributes':_0x19536f['options']?_0x19536f[_0x5393('0x18')]['attributes']||null:null,'limit':_0x19536f[_0x5393('0x18')]?_0x19536f[_0x5393('0x18')][_0x5393('0x1c')]||null:null})[_0x5393('0x1a')](function(_0x248ece){logger[_0x5393('0x13')](_0x5393('0x1d'),_0x19536f);logger[_0x5393('0xe')](_0x5393('0x1d'),_0x19536f,JSON[_0x5393('0x1e')](_0x248ece));_0x2ea4bb(_0x248ece);})[_0x5393('0x14')](function(_0x57c790){logger[_0x5393('0x10')]('UpdateSmsQueueReport',_0x57c790[_0x5393('0x12')],_0x19536f);_0x374ba8(_0x60966a[_0x5393('0x10')](0x1f4,_0x57c790[_0x5393('0x12')]));});});}; \ No newline at end of file +var _0x0beb=['rpc','../../config/environment','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x0beb,0x19b));var _0xb0be=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0beb[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xb0be('0x0'));var util=require(_0xb0be('0x1'));var moment=require(_0xb0be('0x2'));var BPromise=require(_0xb0be('0x3'));var rs=require(_0xb0be('0x4'));var fs=require('fs');var Redis=require(_0xb0be('0x5'));var db=require(_0xb0be('0x6'))['db'];var utils=require(_0xb0be('0x7'));var logger=require(_0xb0be('0x8'))(_0xb0be('0x9'));var config=require(_0xb0be('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb0be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x296492,_0x34a730,_0x748319){return new BPromise(function(_0x4ad09e,_0x51ff2f){return client[_0xb0be('0xc')](_0x296492,_0x748319)[_0xb0be('0xd')](function(_0x4be27f){logger['info'](_0xb0be('0xe'),_0x34a730,_0xb0be('0xf'));logger['debug'](_0xb0be('0x10'),_0x34a730,_0xb0be('0xf'),JSON[_0xb0be('0x11')](_0x4be27f));if(_0x4be27f[_0xb0be('0x12')]){if(_0x4be27f['error'][_0xb0be('0x13')]===0x1f4){logger[_0xb0be('0x12')](_0xb0be('0xe'),_0x34a730,_0x4be27f[_0xb0be('0x12')]['message']);return _0x51ff2f(_0x4be27f[_0xb0be('0x12')][_0xb0be('0x14')]);}logger[_0xb0be('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x34a730,_0x4be27f['error'][_0xb0be('0x14')]);return _0x4ad09e(_0x4be27f[_0xb0be('0x12')][_0xb0be('0x14')]);}else{logger[_0xb0be('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x34a730,_0xb0be('0xf'));_0x4ad09e(_0x4be27f['result'][_0xb0be('0x14')]);}})[_0xb0be('0x16')](function(_0x1ceaf7){logger[_0xb0be('0x12')](_0xb0be('0xe'),_0x34a730,_0x1ceaf7);_0x51ff2f(_0x1ceaf7);});});}exports[_0xb0be('0x17')]=function(_0x3cdcda){var _0x1abf25=this;return new Promise(function(_0x3e35e1,_0x3a3114){return db[_0xb0be('0x18')][_0xb0be('0x19')](_0x3cdcda[_0xb0be('0x1a')],{'raw':_0x3cdcda[_0xb0be('0x1b')]?_0x3cdcda[_0xb0be('0x1b')][_0xb0be('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4de0c0){logger['info'](_0xb0be('0x17'),_0x3cdcda);logger[_0xb0be('0x1d')](_0xb0be('0x17'),_0x3cdcda,JSON['stringify'](_0x4de0c0));_0x3e35e1(_0x4de0c0);})[_0xb0be('0x16')](function(_0x840d5b){logger['error'](_0xb0be('0x17'),_0x840d5b['message'],_0x3cdcda);_0x3a3114(_0x1abf25[_0xb0be('0x12')](0x1f4,_0x840d5b[_0xb0be('0x14')]));});});};exports[_0xb0be('0x1e')]=function(_0x98e52){var _0x9fe1c4=this;return new Promise(function(_0x58cfbb,_0x3720fa){return db[_0xb0be('0x18')][_0xb0be('0x1f')](_0x98e52[_0xb0be('0x1a')],{'raw':_0x98e52[_0xb0be('0x1b')]?_0x98e52[_0xb0be('0x1b')][_0xb0be('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x98e52[_0xb0be('0x1b')]?_0x98e52['options'][_0xb0be('0x20')]||null:null,'attributes':_0x98e52[_0xb0be('0x1b')]?_0x98e52['options'][_0xb0be('0x21')]||null:null,'limit':_0x98e52[_0xb0be('0x1b')]?_0x98e52[_0xb0be('0x1b')][_0xb0be('0x22')]||null:null})[_0xb0be('0xd')](function(_0x3c5421){logger[_0xb0be('0x15')]('UpdateSmsQueueReport',_0x98e52);logger[_0xb0be('0x1d')](_0xb0be('0x1e'),_0x98e52,JSON[_0xb0be('0x11')](_0x3c5421));_0x58cfbb(_0x3c5421);})[_0xb0be('0x16')](function(_0x4fb814){logger['error'](_0xb0be('0x1e'),_0x4fb814[_0xb0be('0x14')],_0x98e52);_0x3720fa(_0x9fe1c4[_0xb0be('0x12')](0x1f4,_0x4fb814[_0xb0be('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 28d75f1..0ea6660 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 _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x56ea9c,_0x42e8ea){var _0xdb4829=function(_0x1f47e2){while(--_0x1f47e2){_0x56ea9c['push'](_0x56ea9c['shift']());}};_0xdb4829(++_0x42e8ea);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x1be80d,_0x2764d0){var _0x2bae5d=function(_0x131f65){while(--_0x131f65){_0x1be80d['push'](_0x1be80d['shift']());}};_0x2bae5d(++_0x2764d0);}(_0xe0ae,0xa1));var _0xee0a=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xe0ae[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index ec58077..a706e3b 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2643a8,_0x5e1be9){var _0x26b6d9=function(_0xebf081){while(--_0xebf081){_0x2643a8['push'](_0x2643a8['shift']());}};_0x26b6d9(++_0x5e1be9);}(_0xaa88,0x137));var _0x8aa8=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xaa88[_0x369151];return _0x4292d5;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4f4fa8,_0x455a27){var _0x563b7a=function(_0x32b71b){while(--_0x32b71b){_0x4f4fa8['push'](_0x4f4fa8['shift']());}};_0x563b7a(++_0x455a27);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 086937e..43f7e9b 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 _0xa4bd=['squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','limit','undefined','count','offset','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','show','include','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x5167a4,_0x4ac437){var _0xba0081=function(_0xad262a){while(--_0xad262a){_0x5167a4['push'](_0x5167a4['shift']());}};_0xba0081(++_0x4ac437);}(_0xa4bd,0xd2));var _0xda4b=function(_0x5a9385,_0x33e74c){_0x5a9385=_0x5a9385-0x0;var _0xaa365a=_0xa4bd[_0x5a9385];return _0xaa365a;};'use strict';var emlformat=require(_0xda4b('0x0'));var rimraf=require(_0xda4b('0x1'));var zipdir=require(_0xda4b('0x2'));var jsonpatch=require(_0xda4b('0x3'));var rp=require(_0xda4b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda4b('0x5'));var util=require(_0xda4b('0x6'));var path=require(_0xda4b('0x7'));var sox=require(_0xda4b('0x8'));var csv=require(_0xda4b('0x9'));var ejs=require(_0xda4b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda4b('0xb'));var squel=require(_0xda4b('0xc'));var crypto=require(_0xda4b('0xd'));var jsforce=require(_0xda4b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda4b('0xf'));var Papa=require(_0xda4b('0x10'));var Redis=require('ioredis');var authService=require(_0xda4b('0x11'));var qs=require(_0xda4b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda4b('0x13'));var logger=require(_0xda4b('0x14'))(_0xda4b('0x15'));var utils=require(_0xda4b('0x16'));var config=require(_0xda4b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f2982,_0x48f8d1){_0x48f8d1=_0x48f8d1||0xcc;return function(_0x250434){if(_0x250434){return _0x2f2982[_0xda4b('0x18')](_0x48f8d1);}return _0x2f2982['status'](_0x48f8d1)['end']();};}function respondWithResult(_0x2bc546,_0x3c4c51){_0x3c4c51=_0x3c4c51||0xc8;return function(_0x96f88d){if(_0x96f88d){return _0x2bc546[_0xda4b('0x19')](_0x3c4c51)['json'](_0x96f88d);}};}function respondWithFilteredResult(_0x3c2e4b,_0x4e7c0b){return function(_0x520479){if(_0x520479){var _0xce721=typeof _0x4e7c0b['offset']==='undefined'&&typeof _0x4e7c0b[_0xda4b('0x1a')]===_0xda4b('0x1b');var _0x19ab2d=_0x520479[_0xda4b('0x1c')];var _0x2fdbc8=_0xce721?0x0:_0x4e7c0b[_0xda4b('0x1d')];var _0x56f569=_0xce721?_0x520479['count']:_0x4e7c0b[_0xda4b('0x1d')]+_0x4e7c0b['limit'];var _0x1e5d67;if(_0x56f569>=_0x19ab2d){_0x56f569=_0x19ab2d;_0x1e5d67=0xc8;}else{_0x1e5d67=0xce;}_0x3c2e4b[_0xda4b('0x19')](_0x1e5d67);return _0x3c2e4b[_0xda4b('0x1e')]('Content-Range',_0x2fdbc8+'-'+_0x56f569+'/'+_0x19ab2d)['json'](_0x520479);}return null;};}function patchUpdates(_0x23491b){return function(_0x5cf405){try{jsonpatch[_0xda4b('0x1f')](_0x5cf405,_0x23491b,!![]);}catch(_0x28aa9a){return BPromise[_0xda4b('0x20')](_0x28aa9a);}return _0x5cf405['save']();};}function saveUpdates(_0x4e6d23,_0x2077ff){return function(_0x5c255a){if(_0x5c255a){return _0x5c255a[_0xda4b('0x21')](_0x4e6d23)[_0xda4b('0x22')](function(_0x21d345){return _0x21d345;});}return null;};}function removeEntity(_0xb890b3,_0x4c7128){return function(_0x1b2f51){if(_0x1b2f51){return _0x1b2f51[_0xda4b('0x23')]()[_0xda4b('0x22')](function(){_0xb890b3[_0xda4b('0x19')](0xcc)[_0xda4b('0x24')]();});}};}function handleEntityNotFound(_0x3eb3d9,_0x470d30){return function(_0x4fb2f2){if(!_0x4fb2f2){_0x3eb3d9['sendStatus'](0x194);}return _0x4fb2f2;};}function handleError(_0x69656,_0x19b4c6){_0x19b4c6=_0x19b4c6||0x1f4;return function(_0x42056c){logger[_0xda4b('0x25')](_0x42056c[_0xda4b('0x26')]);if(_0x42056c[_0xda4b('0x27')]){delete _0x42056c[_0xda4b('0x27')];}_0x69656[_0xda4b('0x19')](_0x19b4c6)[_0xda4b('0x28')](_0x42056c);};}exports[_0xda4b('0x29')]=function(_0x24d962,_0x51edd1){var _0x509503={},_0x5057d6={},_0x4d8690={'count':0x0,'rows':[]};var _0xbc7981=_[_0xda4b('0x2a')](db[_0xda4b('0x2b')][_0xda4b('0x2c')],function(_0x3aa204){return{'name':_0x3aa204['fieldName'],'type':_0x3aa204[_0xda4b('0x2d')][_0xda4b('0x2e')]};});_0x5057d6['model']=_[_0xda4b('0x2a')](_0xbc7981,_0xda4b('0x27'));_0x5057d6[_0xda4b('0x2f')]=_[_0xda4b('0x30')](_0x24d962[_0xda4b('0x2f')]);_0x5057d6[_0xda4b('0x31')]=_[_0xda4b('0x32')](_0x5057d6[_0xda4b('0x33')],_0x5057d6['query']);_0x509503[_0xda4b('0x34')]=_['intersection'](_0x5057d6[_0xda4b('0x33')],qs[_0xda4b('0x35')](_0x24d962[_0xda4b('0x2f')]['fields']));_0x509503[_0xda4b('0x34')]=_0x509503['attributes'][_0xda4b('0x36')]?_0x509503['attributes']:_0x5057d6[_0xda4b('0x33')];if(!_0x24d962['query'][_0xda4b('0x37')]('nolimit')){_0x509503[_0xda4b('0x1a')]=qs['limit'](_0x24d962[_0xda4b('0x2f')][_0xda4b('0x1a')]);_0x509503[_0xda4b('0x1d')]=qs[_0xda4b('0x1d')](_0x24d962[_0xda4b('0x2f')][_0xda4b('0x1d')]);}_0x509503[_0xda4b('0x38')]=qs[_0xda4b('0x39')](_0x24d962[_0xda4b('0x2f')][_0xda4b('0x39')]);_0x509503[_0xda4b('0x3a')]=qs[_0xda4b('0x31')](_[_0xda4b('0x3b')](_0x24d962[_0xda4b('0x2f')],_0x5057d6['filters']),_0xbc7981);if(_0x24d962[_0xda4b('0x2f')]['filter']){_0x509503[_0xda4b('0x3a')]=_['merge'](_0x509503['where'],{'$or':_[_0xda4b('0x2a')](_0xbc7981,function(_0x46848d){if(_0x46848d['type']!==_0xda4b('0x3c')){var _0x4197a5={};_0x4197a5[_0x46848d['name']]={'$like':'%'+_0x24d962[_0xda4b('0x2f')][_0xda4b('0x3d')]+'%'};return _0x4197a5;}})});}_0x509503=_[_0xda4b('0x3e')]({},_0x509503,_0x24d962[_0xda4b('0x3f')]);var _0x32e527={'where':_0x509503[_0xda4b('0x3a')]};return db['SmsTransferReport'][_0xda4b('0x1c')](_0x32e527)[_0xda4b('0x22')](function(_0x3db0fd){_0x4d8690['count']=_0x3db0fd;if(_0x24d962[_0xda4b('0x2f')][_0xda4b('0x40')]){_0x509503['include']=[{'all':!![]}];}return db[_0xda4b('0x2b')][_0xda4b('0x41')](_0x509503);})[_0xda4b('0x22')](function(_0x447b00){_0x4d8690['rows']=_0x447b00;return _0x4d8690;})[_0xda4b('0x22')](respondWithFilteredResult(_0x51edd1,_0x509503))['catch'](handleError(_0x51edd1,null));};exports[_0xda4b('0x42')]=function(_0x96729f,_0x3418fc){var _0x42cc73={'raw':!![],'where':{'id':_0x96729f['params']['id']}},_0x15db24={};_0x15db24['model']=_[_0xda4b('0x30')](db[_0xda4b('0x2b')][_0xda4b('0x2c')]);_0x15db24[_0xda4b('0x2f')]=_[_0xda4b('0x30')](_0x96729f['query']);_0x15db24[_0xda4b('0x31')]=_[_0xda4b('0x32')](_0x15db24['model'],_0x15db24[_0xda4b('0x2f')]);_0x42cc73[_0xda4b('0x34')]=_['intersection'](_0x15db24[_0xda4b('0x33')],qs[_0xda4b('0x35')](_0x96729f[_0xda4b('0x2f')][_0xda4b('0x35')]));_0x42cc73[_0xda4b('0x34')]=_0x42cc73[_0xda4b('0x34')]['length']?_0x42cc73[_0xda4b('0x34')]:_0x15db24[_0xda4b('0x33')];if(_0x96729f[_0xda4b('0x2f')][_0xda4b('0x40')]){_0x42cc73[_0xda4b('0x43')]=[{'all':!![]}];}_0x42cc73=_[_0xda4b('0x3e')]({},_0x42cc73,_0x96729f[_0xda4b('0x3f')]);return db['SmsTransferReport']['find'](_0x42cc73)[_0xda4b('0x22')](handleEntityNotFound(_0x3418fc,null))['then'](respondWithResult(_0x3418fc,null))[_0xda4b('0x44')](handleError(_0x3418fc,null));};exports[_0xda4b('0x45')]=function(_0x38d512,_0xfea2ed){return db['SmsTransferReport']['create'](_0x38d512[_0xda4b('0x46')],{})[_0xda4b('0x22')](respondWithResult(_0xfea2ed,0xc9))['catch'](handleError(_0xfea2ed,null));};exports[_0xda4b('0x21')]=function(_0x5dccf0,_0x2f2c6a){if(_0x5dccf0[_0xda4b('0x46')]['id']){delete _0x5dccf0['body']['id'];}return db[_0xda4b('0x2b')][_0xda4b('0x47')]({'where':{'id':_0x5dccf0[_0xda4b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f2c6a,null))[_0xda4b('0x22')](saveUpdates(_0x5dccf0[_0xda4b('0x46')],null))[_0xda4b('0x22')](respondWithResult(_0x2f2c6a,null))[_0xda4b('0x44')](handleError(_0x2f2c6a,null));};exports[_0xda4b('0x23')]=function(_0x164336,_0x1a5ea0){return db['SmsTransferReport'][_0xda4b('0x47')]({'where':{'id':_0x164336[_0xda4b('0x48')]['id']}})[_0xda4b('0x22')](handleEntityNotFound(_0x1a5ea0,null))[_0xda4b('0x22')](removeEntity(_0x1a5ea0,null))[_0xda4b('0x44')](handleError(_0x1a5ea0,null));};exports[_0xda4b('0x49')]=function(_0x16737e,_0x11d782){return db[_0xda4b('0x2b')]['describe']()[_0xda4b('0x22')](respondWithResult(_0x11d782,null))[_0xda4b('0x44')](handleError(_0x11d782,null));}; \ No newline at end of file +var _0xac1b=['rows','catch','show','params','keys','options','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','findAll'];(function(_0x32b07a,_0x31a31f){var _0x55bf66=function(_0x54fd38){while(--_0x54fd38){_0x32b07a['push'](_0x32b07a['shift']());}};_0x55bf66(++_0x31a31f);}(_0xac1b,0x13f));var _0xbac1=function(_0x2aa9be,_0x5e43b4){_0x2aa9be=_0x2aa9be-0x0;var _0x25c176=_0xac1b[_0x2aa9be];return _0x25c176;};'use strict';var emlformat=require(_0xbac1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbac1('0x1'));var jsonpatch=require(_0xbac1('0x2'));var rp=require('request-promise');var moment=require(_0xbac1('0x3'));var BPromise=require(_0xbac1('0x4'));var Mustache=require(_0xbac1('0x5'));var util=require(_0xbac1('0x6'));var path=require('path');var sox=require(_0xbac1('0x7'));var csv=require(_0xbac1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbac1('0x9'));var _=require(_0xbac1('0xa'));var squel=require(_0xbac1('0xb'));var crypto=require(_0xbac1('0xc'));var jsforce=require(_0xbac1('0xd'));var deskjs=require(_0xbac1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbac1('0xf'));var authService=require(_0xbac1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbac1('0x11'));var hardwareService=require(_0xbac1('0x12'));var logger=require('../../config/logger')(_0xbac1('0x13'));var utils=require(_0xbac1('0x14'));var config=require(_0xbac1('0x15'));var licenseUtil=require(_0xbac1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x458da2,_0x2759ce){_0x2759ce=_0x2759ce||0xcc;return function(_0x269565){if(_0x269565){return _0x458da2[_0xbac1('0x17')](_0x2759ce);}return _0x458da2['status'](_0x2759ce)[_0xbac1('0x18')]();};}function respondWithResult(_0x2aaf2d,_0x180a67){_0x180a67=_0x180a67||0xc8;return function(_0x801a0b){if(_0x801a0b){return _0x2aaf2d[_0xbac1('0x19')](_0x180a67)['json'](_0x801a0b);}};}function respondWithFilteredResult(_0x3d23b1,_0xf0a85b){return function(_0x3e425f){if(_0x3e425f){var _0xd3eedf=typeof _0xf0a85b[_0xbac1('0x1a')]===_0xbac1('0x1b')&&typeof _0xf0a85b[_0xbac1('0x1c')]===_0xbac1('0x1b');var _0x52096b=_0x3e425f['count'];var _0x5f5e0b=_0xd3eedf?0x0:_0xf0a85b[_0xbac1('0x1a')];var _0x27605b=_0xd3eedf?_0x3e425f[_0xbac1('0x1d')]:_0xf0a85b[_0xbac1('0x1a')]+_0xf0a85b[_0xbac1('0x1c')];var _0x16af9c;if(_0x27605b>=_0x52096b){_0x27605b=_0x52096b;_0x16af9c=0xc8;}else{_0x16af9c=0xce;}_0x3d23b1['status'](_0x16af9c);return _0x3d23b1[_0xbac1('0x1e')](_0xbac1('0x1f'),_0x5f5e0b+'-'+_0x27605b+'/'+_0x52096b)[_0xbac1('0x20')](_0x3e425f);}return null;};}function patchUpdates(_0x5cf911){return function(_0x450de6){try{jsonpatch[_0xbac1('0x21')](_0x450de6,_0x5cf911,!![]);}catch(_0x5f3cb2){return BPromise[_0xbac1('0x22')](_0x5f3cb2);}return _0x450de6[_0xbac1('0x23')]();};}function saveUpdates(_0x4bc90b,_0x50d1eb){return function(_0x4eb8f5){if(_0x4eb8f5){return _0x4eb8f5[_0xbac1('0x24')](_0x4bc90b)[_0xbac1('0x25')](function(_0x1de5be){return _0x1de5be;});}return null;};}function removeEntity(_0x53babb,_0x1e91d0){return function(_0xe823d6){if(_0xe823d6){return _0xe823d6['destroy']()['then'](function(){_0x53babb[_0xbac1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5402eb,_0x2a6283){return function(_0xc67719){if(!_0xc67719){_0x5402eb[_0xbac1('0x17')](0x194);}return _0xc67719;};}function handleError(_0x5e2995,_0x2df6bb){_0x2df6bb=_0x2df6bb||0x1f4;return function(_0x2fe50e){logger[_0xbac1('0x26')](_0x2fe50e[_0xbac1('0x27')]);if(_0x2fe50e[_0xbac1('0x28')]){delete _0x2fe50e[_0xbac1('0x28')];}_0x5e2995[_0xbac1('0x19')](_0x2df6bb)[_0xbac1('0x29')](_0x2fe50e);};}exports[_0xbac1('0x2a')]=function(_0x3da4ca,_0x2f60ef){var _0x2d414f={},_0x308045={},_0x10ee10={'count':0x0,'rows':[]};var _0x4a7b99=_[_0xbac1('0x2b')](db[_0xbac1('0x2c')][_0xbac1('0x2d')],function(_0x2874de){return{'name':_0x2874de[_0xbac1('0x2e')],'type':_0x2874de[_0xbac1('0x2f')][_0xbac1('0x30')]};});_0x308045[_0xbac1('0x31')]=_['map'](_0x4a7b99,_0xbac1('0x28'));_0x308045[_0xbac1('0x32')]=_['keys'](_0x3da4ca[_0xbac1('0x32')]);_0x308045[_0xbac1('0x33')]=_[_0xbac1('0x34')](_0x308045['model'],_0x308045[_0xbac1('0x32')]);_0x2d414f[_0xbac1('0x35')]=_[_0xbac1('0x34')](_0x308045[_0xbac1('0x31')],qs[_0xbac1('0x36')](_0x3da4ca['query'][_0xbac1('0x36')]));_0x2d414f['attributes']=_0x2d414f['attributes'][_0xbac1('0x37')]?_0x2d414f[_0xbac1('0x35')]:_0x308045[_0xbac1('0x31')];if(!_0x3da4ca[_0xbac1('0x32')][_0xbac1('0x38')](_0xbac1('0x39'))){_0x2d414f[_0xbac1('0x1c')]=qs['limit'](_0x3da4ca[_0xbac1('0x32')][_0xbac1('0x1c')]);_0x2d414f[_0xbac1('0x1a')]=qs[_0xbac1('0x1a')](_0x3da4ca[_0xbac1('0x32')]['offset']);}_0x2d414f['order']=qs[_0xbac1('0x3a')](_0x3da4ca[_0xbac1('0x32')][_0xbac1('0x3a')]);_0x2d414f['where']=qs['filters'](_[_0xbac1('0x3b')](_0x3da4ca[_0xbac1('0x32')],_0x308045[_0xbac1('0x33')]),_0x4a7b99);if(_0x3da4ca[_0xbac1('0x32')][_0xbac1('0x3c')]){_0x2d414f[_0xbac1('0x3d')]=_[_0xbac1('0x3e')](_0x2d414f[_0xbac1('0x3d')],{'$or':_[_0xbac1('0x2b')](_0x4a7b99,function(_0x3a00dd){if(_0x3a00dd[_0xbac1('0x2f')]!=='VIRTUAL'){var _0x4d50d0={};_0x4d50d0[_0x3a00dd[_0xbac1('0x28')]]={'$like':'%'+_0x3da4ca[_0xbac1('0x32')][_0xbac1('0x3c')]+'%'};return _0x4d50d0;}})});}_0x2d414f=_[_0xbac1('0x3e')]({},_0x2d414f,_0x3da4ca['options']);var _0x3fbd2a={'where':_0x2d414f['where']};return db[_0xbac1('0x2c')][_0xbac1('0x1d')](_0x3fbd2a)['then'](function(_0x45a7b2){_0x10ee10[_0xbac1('0x1d')]=_0x45a7b2;if(_0x3da4ca[_0xbac1('0x32')][_0xbac1('0x3f')]){_0x2d414f[_0xbac1('0x40')]=[{'all':!![]}];}return db[_0xbac1('0x2c')][_0xbac1('0x41')](_0x2d414f);})['then'](function(_0x1648b4){_0x10ee10[_0xbac1('0x42')]=_0x1648b4;return _0x10ee10;})[_0xbac1('0x25')](respondWithFilteredResult(_0x2f60ef,_0x2d414f))[_0xbac1('0x43')](handleError(_0x2f60ef,null));};exports[_0xbac1('0x44')]=function(_0x4ba3f2,_0x5168aa){var _0x5804a7={'raw':!![],'where':{'id':_0x4ba3f2[_0xbac1('0x45')]['id']}},_0x17c444={};_0x17c444[_0xbac1('0x31')]=_['keys'](db[_0xbac1('0x2c')][_0xbac1('0x2d')]);_0x17c444[_0xbac1('0x32')]=_[_0xbac1('0x46')](_0x4ba3f2[_0xbac1('0x32')]);_0x17c444[_0xbac1('0x33')]=_['intersection'](_0x17c444[_0xbac1('0x31')],_0x17c444['query']);_0x5804a7[_0xbac1('0x35')]=_[_0xbac1('0x34')](_0x17c444[_0xbac1('0x31')],qs['fields'](_0x4ba3f2[_0xbac1('0x32')][_0xbac1('0x36')]));_0x5804a7[_0xbac1('0x35')]=_0x5804a7[_0xbac1('0x35')][_0xbac1('0x37')]?_0x5804a7[_0xbac1('0x35')]:_0x17c444[_0xbac1('0x31')];if(_0x4ba3f2[_0xbac1('0x32')][_0xbac1('0x3f')]){_0x5804a7['include']=[{'all':!![]}];}_0x5804a7=_[_0xbac1('0x3e')]({},_0x5804a7,_0x4ba3f2[_0xbac1('0x47')]);return db['SmsTransferReport']['find'](_0x5804a7)[_0xbac1('0x25')](handleEntityNotFound(_0x5168aa,null))[_0xbac1('0x25')](respondWithResult(_0x5168aa,null))[_0xbac1('0x43')](handleError(_0x5168aa,null));};exports[_0xbac1('0x48')]=function(_0x52ae74,_0x520715){return db[_0xbac1('0x2c')][_0xbac1('0x48')](_0x52ae74[_0xbac1('0x49')],{})[_0xbac1('0x25')](respondWithResult(_0x520715,0xc9))[_0xbac1('0x43')](handleError(_0x520715,null));};exports[_0xbac1('0x24')]=function(_0x1387ec,_0x2621a0){if(_0x1387ec[_0xbac1('0x49')]['id']){delete _0x1387ec['body']['id'];}return db['SmsTransferReport'][_0xbac1('0x4a')]({'where':{'id':_0x1387ec['params']['id']}})[_0xbac1('0x25')](handleEntityNotFound(_0x2621a0,null))[_0xbac1('0x25')](saveUpdates(_0x1387ec['body'],null))[_0xbac1('0x25')](respondWithResult(_0x2621a0,null))['catch'](handleError(_0x2621a0,null));};exports[_0xbac1('0x4b')]=function(_0x246bb0,_0x5df1f1){return db[_0xbac1('0x2c')]['find']({'where':{'id':_0x246bb0[_0xbac1('0x45')]['id']}})[_0xbac1('0x25')](handleEntityNotFound(_0x5df1f1,null))['then'](removeEntity(_0x5df1f1,null))[_0xbac1('0x43')](handleError(_0x5df1f1,null));};exports[_0xbac1('0x4c')]=function(_0x56b561,_0xbc72d9){return db[_0xbac1('0x2c')][_0xbac1('0x4c')]()[_0xbac1('0x25')](respondWithResult(_0xbc72d9,null))[_0xbac1('0x43')](handleError(_0xbc72d9,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 8945802..5378508 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 _0x956a=['report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','SmsTransferReport'];(function(_0x21e0a9,_0x5edd42){var _0x2a12f5=function(_0x3c53a4){while(--_0x3c53a4){_0x21e0a9['push'](_0x21e0a9['shift']());}};_0x2a12f5(++_0x5edd42);}(_0x956a,0xb6));var _0xa956=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x956a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa956('0x0'));var logger=require(_0xa956('0x1'))(_0xa956('0x2'));var moment=require(_0xa956('0x3'));var BPromise=require(_0xa956('0x4'));var rp=require(_0xa956('0x5'));var fs=require('fs');var path=require(_0xa956('0x6'));var rimraf=require(_0xa956('0x7'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0xa956('0x8')]=function(_0x2b9675,_0x2ce2c8){return _0x2b9675['define'](_0xa956('0x9'),attributes,{'tableName':_0xa956('0xa'),'paranoid':![],'indexes':[{'name':_0xa956('0xb'),'fields':[_0xa956('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3074=['exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x43f64c,_0x339a07){var _0x5bbe63=function(_0x19b391){while(--_0x19b391){_0x43f64c['push'](_0x43f64c['shift']());}};_0x5bbe63(++_0x339a07);}(_0x3074,0x1dd));var _0x4307=function(_0x229d6e,_0x5087b0){_0x229d6e=_0x229d6e-0x0;var _0x306a02=_0x3074[_0x229d6e];return _0x306a02;};'use strict';var _=require(_0x4307('0x0'));var util=require('util');var logger=require(_0x4307('0x1'))(_0x4307('0x2'));var moment=require(_0x4307('0x3'));var BPromise=require('bluebird');var rp=require(_0x4307('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4307('0x5'));var config=require(_0x4307('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x4307('0x7')]=function(_0x2c94ac,_0xf59e6f){return _0x2c94ac['define'](_0x4307('0x8'),attributes,{'tableName':_0x4307('0x9'),'paranoid':![],'indexes':[{'name':_0x4307('0xa'),'fields':[_0x4307('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d30425a..7234183 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d1f54,_0x235954){var _0x2e7be1=function(_0x2910ad){while(--_0x2910ad){_0x4d1f54['push'](_0x4d1f54['shift']());}};_0x2e7be1(++_0x235954);}(_0xa41a,0x6b));var _0xaa41=function(_0x2d55d2,_0x536f4a){_0x2d55d2=_0x2d55d2-0x0;var _0x124954=_0xa41a[_0x2d55d2];return _0x124954;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0xc737=['http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x3994a2,_0x164239){var _0x5a1e21=function(_0x2b0cf6){while(--_0x2b0cf6){_0x3994a2['push'](_0x3994a2['shift']());}};_0x5a1e21(++_0x164239);}(_0xc737,0x8e));var _0x7c73=function(_0x2fef3c,_0x39e5ea){_0x2fef3c=_0x2fef3c-0x0;var _0x211028=_0xc737[_0x2fef3c];return _0x211028;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require('moment');var BPromise=require(_0x7c73('0x2'));var rs=require(_0x7c73('0x3'));var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require(_0x7c73('0x7'))(_0x7c73('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c73('0x9')][_0x7c73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd61255,_0x33bcbd,_0x4c0b1c){return new BPromise(function(_0x575a80,_0x4f9b28){return client['request'](_0xd61255,_0x4c0b1c)['then'](function(_0x155604){logger[_0x7c73('0xb')](_0x7c73('0xc'),_0x33bcbd,_0x7c73('0xd'));logger['debug'](_0x7c73('0xe'),_0x33bcbd,'request\x20sent',JSON[_0x7c73('0xf')](_0x155604));if(_0x155604[_0x7c73('0x10')]){if(_0x155604[_0x7c73('0x10')]['code']===0x1f4){logger[_0x7c73('0x10')](_0x7c73('0xc'),_0x33bcbd,_0x155604[_0x7c73('0x10')][_0x7c73('0x11')]);return _0x4f9b28(_0x155604[_0x7c73('0x10')][_0x7c73('0x11')]);}logger[_0x7c73('0x10')](_0x7c73('0xc'),_0x33bcbd,_0x155604['error'][_0x7c73('0x11')]);return _0x575a80(_0x155604[_0x7c73('0x10')]['message']);}else{logger['info'](_0x7c73('0xc'),_0x33bcbd,_0x7c73('0xd'));_0x575a80(_0x155604['result'][_0x7c73('0x11')]);}})[_0x7c73('0x12')](function(_0x26463c){logger[_0x7c73('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x33bcbd,_0x26463c);_0x4f9b28(_0x26463c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 6b62d75..5e8ab7f 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 _0xb144=['basename','extname','post','file','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s'];(function(_0x3e025c,_0x383237){var _0x39cdde=function(_0x5216d4){while(--_0x5216d4){_0x3e025c['push'](_0x3e025c['shift']());}};_0x39cdde(++_0x383237);}(_0xb144,0xa8));var _0x4b14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb144[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4b14('0x0'));var util=require('util');var path=require(_0x4b14('0x1'));var timeout=require(_0x4b14('0x2'));var express=require(_0x4b14('0x3'));var router=express[_0x4b14('0x4')]();var fs_extra=require(_0x4b14('0x5'));var auth=require(_0x4b14('0x6'));var interaction=require(_0x4b14('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x4b14('0x8')]('/',auth[_0x4b14('0x9')](),controller[_0x4b14('0xa')]);router[_0x4b14('0x8')](_0x4b14('0xb'),auth[_0x4b14('0x9')](),controller['show']);router['get'](_0x4b14('0xc'),auth['isAuthenticated'](),controller[_0x4b14('0xd')]);var upload=multer({'storage':multer[_0x4b14('0xe')]({'destination':function(_0x21623c,_0x2c6ba7,_0x1a0266){_0x1a0266(null,path['join'](config[_0x4b14('0xf')],_0x4b14('0x10')));},'filename':function(_0x78a919,_0x599d6b,_0x56c150){_0x599d6b['originalname']=_0x599d6b[_0x4b14('0x11')][_0x4b14('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56c150(null,util[_0x4b14('0x13')](_0x4b14('0x14'),path[_0x4b14('0x15')](_0x599d6b[_0x4b14('0x11')],path[_0x4b14('0x16')](_0x599d6b[_0x4b14('0x11')])),Date['now'](),path[_0x4b14('0x16')](_0x599d6b[_0x4b14('0x11')])));}})});router[_0x4b14('0x17')]('/',upload['single'](_0x4b14('0x18')),controller['create']);router['put'](_0x4b14('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4b14('0x19')](_0x4b14('0xb'),auth[_0x4b14('0x9')](),controller[_0x4b14('0x19')]);module[_0x4b14('0x1a')]=router; \ No newline at end of file +var _0x88dc=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','replace','basename','extname','now','post','single','file','put','/:id','update','delete','exports','util','connect-timeout'];(function(_0x29fa81,_0x393286){var _0x43134b=function(_0x5094b0){while(--_0x5094b0){_0x29fa81['push'](_0x29fa81['shift']());}};_0x43134b(++_0x393286);}(_0x88dc,0x120));var _0xc88d=function(_0x56b108,_0x32503b){_0x56b108=_0x56b108-0x0;var _0x50d8d7=_0x88dc[_0x56b108];return _0x50d8d7;};'use strict';var multer=require('multer');var util=require(_0xc88d('0x0'));var path=require('path');var timeout=require(_0xc88d('0x1'));var express=require(_0xc88d('0x2'));var router=express['Router']();var fs_extra=require(_0xc88d('0x3'));var auth=require(_0xc88d('0x4'));var interaction=require(_0xc88d('0x5'));var config=require(_0xc88d('0x6'));var controller=require(_0xc88d('0x7'));router['get']('/',auth[_0xc88d('0x8')](),controller[_0xc88d('0x9')]);router[_0xc88d('0xa')]('/:id',auth[_0xc88d('0x8')](),controller[_0xc88d('0xb')]);router['get'](_0xc88d('0xc'),auth[_0xc88d('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xc88d('0xd')]({'destination':function(_0x220e84,_0x1bd4e1,_0xd9a533){_0xd9a533(null,path[_0xc88d('0xe')](config['root'],_0xc88d('0xf')));},'filename':function(_0x219867,_0x9be08f,_0x5e26a7){_0x9be08f[_0xc88d('0x10')]=_0x9be08f[_0xc88d('0x10')][_0xc88d('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e26a7(null,util['format']('%s-%s%s',path[_0xc88d('0x12')](_0x9be08f[_0xc88d('0x10')],path[_0xc88d('0x13')](_0x9be08f[_0xc88d('0x10')])),Date[_0xc88d('0x14')](),path[_0xc88d('0x13')](_0x9be08f[_0xc88d('0x10')])));}})});router[_0xc88d('0x15')]('/',upload[_0xc88d('0x16')](_0xc88d('0x17')),controller['create']);router[_0xc88d('0x18')](_0xc88d('0x19'),auth[_0xc88d('0x8')](),controller[_0xc88d('0x1a')]);router[_0xc88d('0x1b')](_0xc88d('0x19'),auth[_0xc88d('0x8')](),controller[_0xc88d('0x1b')]);module[_0xc88d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c595c21..19585b6 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 _0x1161=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x5c04d7,_0x3dbab2){var _0x10947f=function(_0x198c4d){while(--_0x198c4d){_0x5c04d7['push'](_0x5c04d7['shift']());}};_0x10947f(++_0x3dbab2);}(_0x1161,0x156));var _0x1116=function(_0x3ef8cc,_0x221408){_0x3ef8cc=_0x3ef8cc-0x0;var _0x1f5f9b=_0x1161[_0x3ef8cc];return _0x1f5f9b;};'use strict';var Sequelize=require(_0x1116('0x0'));module[_0x1116('0x1')]={'name':{'type':Sequelize[_0x1116('0x2')],'unique':_0x1116('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x1116('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x1116('0x2')]},'original_duration':{'type':Sequelize[_0x1116('0x4')]},'original_sampleCount':{'type':Sequelize[_0x1116('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x1116('0x5')]},'original_sampleRate':{'type':Sequelize[_0x1116('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x1116('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x1116('0x5')]},'converted_channelCount':{'type':Sequelize[_0x1116('0x6')]},'converted_bitRate':{'type':Sequelize[_0x1116('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa71e=['FLOAT','sequelize','exports','name','STRING','INTEGER','BIGINT'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0xa71e,0x13c));var _0xea71=function(_0x501ca1,_0x6c6edc){_0x501ca1=_0x501ca1-0x0;var _0x2a99c4=_0xa71e[_0x501ca1];return _0x2a99c4;};'use strict';var Sequelize=require(_0xea71('0x0'));module[_0xea71('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xea71('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xea71('0x3')]},'display_name':{'type':Sequelize[_0xea71('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0xea71('0x3')]},'original_format':{'type':Sequelize[_0xea71('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xea71('0x4')]},'original_bitRate':{'type':Sequelize[_0xea71('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xea71('0x3')]},'converted_duration':{'type':Sequelize[_0xea71('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xea71('0x5')]},'converted_channelCount':{'type':Sequelize[_0xea71('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xea71('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 47697e6..2adecf1 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 _0x5bc7=['offset','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','map','Sound','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','options','include','catch','show','params','keys','find','download','save_name','converted_format','join','ValidationError','root','server/files/sounds/converted','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','src','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','description','original_format','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5bc7,0x145));var _0x75bc=function(_0x179900,_0x21fe39){_0x179900=_0x179900-0x0;var _0x257274=_0x5bc7[_0x179900];return _0x257274;};'use strict';var emlformat=require(_0x75bc('0x0'));var rimraf=require(_0x75bc('0x1'));var zipdir=require(_0x75bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x75bc('0x3'));var BPromise=require(_0x75bc('0x4'));var Mustache=require('mustache');var util=require(_0x75bc('0x5'));var path=require(_0x75bc('0x6'));var sox=require(_0x75bc('0x7'));var csv=require(_0x75bc('0x8'));var ejs=require(_0x75bc('0x9'));var fs=require('fs');var fs_extra=require(_0x75bc('0xa'));var _=require(_0x75bc('0xb'));var squel=require(_0x75bc('0xc'));var crypto=require('crypto');var jsforce=require(_0x75bc('0xd'));var deskjs=require(_0x75bc('0xe'));var toCsv=require(_0x75bc('0x8'));var querystring=require(_0x75bc('0xf'));var Papa=require(_0x75bc('0x10'));var Redis=require(_0x75bc('0x11'));var authService=require(_0x75bc('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75bc('0x13'));var logger=require(_0x75bc('0x14'))(_0x75bc('0x15'));var utils=require(_0x75bc('0x16'));var config=require(_0x75bc('0x17'));var licenseUtil=require(_0x75bc('0x18'));var db=require(_0x75bc('0x19'))['db'];function respondWithStatusCode(_0x405315,_0x3b2d96){_0x3b2d96=_0x3b2d96||0xcc;return function(_0x39f683){if(_0x39f683){return _0x405315[_0x75bc('0x1a')](_0x3b2d96);}return _0x405315['status'](_0x3b2d96)[_0x75bc('0x1b')]();};}function respondWithResult(_0x483826,_0x2e6f13){_0x2e6f13=_0x2e6f13||0xc8;return function(_0x452f44){if(_0x452f44){return _0x483826[_0x75bc('0x1c')](_0x2e6f13)[_0x75bc('0x1d')](_0x452f44);}};}function respondWithFilteredResult(_0x19ba45,_0x200d34){return function(_0x585fcd){if(_0x585fcd){var _0x27e06e=typeof _0x200d34['offset']===_0x75bc('0x1e')&&typeof _0x200d34[_0x75bc('0x1f')]===_0x75bc('0x1e');var _0x27f67e=_0x585fcd['count'];var _0x56b999=_0x27e06e?0x0:_0x200d34[_0x75bc('0x20')];var _0x34bc18=_0x27e06e?_0x585fcd[_0x75bc('0x21')]:_0x200d34[_0x75bc('0x20')]+_0x200d34[_0x75bc('0x1f')];var _0x3e2cad;if(_0x34bc18>=_0x27f67e){_0x34bc18=_0x27f67e;_0x3e2cad=0xc8;}else{_0x3e2cad=0xce;}_0x19ba45[_0x75bc('0x1c')](_0x3e2cad);return _0x19ba45['set'](_0x75bc('0x22'),_0x56b999+'-'+_0x34bc18+'/'+_0x27f67e)['json'](_0x585fcd);}return null;};}function patchUpdates(_0x3c3157){return function(_0x34585b){try{jsonpatch[_0x75bc('0x23')](_0x34585b,_0x3c3157,!![]);}catch(_0x57edc5){return BPromise[_0x75bc('0x24')](_0x57edc5);}return _0x34585b[_0x75bc('0x25')]();};}function saveUpdates(_0x65014,_0x439872){return function(_0x455199){if(_0x455199){return _0x455199[_0x75bc('0x26')](_0x65014)[_0x75bc('0x27')](function(_0x3a43f0){return _0x3a43f0;});}return null;};}function removeEntity(_0x196cff,_0x54a9da){return function(_0x1e1328){if(_0x1e1328){return _0x1e1328['destroy']()[_0x75bc('0x27')](function(){var _0x3ad331=_0x1e1328[_0x75bc('0x28')]({'plain':!![]});var _0x5ca8ad='Sounds';return db[_0x75bc('0x29')][_0x75bc('0x2a')]({'where':{'type':_0x5ca8ad,'resourceId':_0x3ad331['id']}})[_0x75bc('0x27')](function(){return _0x1e1328;});})[_0x75bc('0x27')](function(){_0x196cff[_0x75bc('0x1c')](0xcc)[_0x75bc('0x1b')]();});}};}function handleEntityNotFound(_0x5909f6,_0x37909c){return function(_0x17d40c){if(!_0x17d40c){_0x5909f6[_0x75bc('0x1a')](0x194);}return _0x17d40c;};}function handleError(_0x2f62f6,_0x16e823){_0x16e823=_0x16e823||0x1f4;return function(_0x20c708){logger['error'](_0x20c708[_0x75bc('0x2b')]);if(_0x20c708['name']){delete _0x20c708[_0x75bc('0x2c')];}_0x2f62f6[_0x75bc('0x1c')](_0x16e823)['send'](_0x20c708);};}exports['index']=function(_0x4dab39,_0x1f2aee){var _0x4a3dd8={},_0x31bdc1={},_0x518e88={'count':0x0,'rows':[]};var _0x2dea1b=_[_0x75bc('0x2d')](db[_0x75bc('0x2e')][_0x75bc('0x2f')],function(_0x3281a2){return{'name':_0x3281a2['fieldName'],'type':_0x3281a2[_0x75bc('0x30')][_0x75bc('0x31')]};});_0x31bdc1[_0x75bc('0x32')]=_[_0x75bc('0x2d')](_0x2dea1b,_0x75bc('0x2c'));_0x31bdc1[_0x75bc('0x33')]=_['keys'](_0x4dab39[_0x75bc('0x33')]);_0x31bdc1[_0x75bc('0x34')]=_[_0x75bc('0x35')](_0x31bdc1['model'],_0x31bdc1[_0x75bc('0x33')]);_0x4a3dd8[_0x75bc('0x36')]=_['intersection'](_0x31bdc1[_0x75bc('0x32')],qs[_0x75bc('0x37')](_0x4dab39[_0x75bc('0x33')]['fields']));_0x4a3dd8[_0x75bc('0x36')]=_0x4a3dd8[_0x75bc('0x36')]['length']?_0x4a3dd8['attributes']:_0x31bdc1['model'];if(!_0x4dab39[_0x75bc('0x33')][_0x75bc('0x38')]('nolimit')){_0x4a3dd8['limit']=qs['limit'](_0x4dab39[_0x75bc('0x33')][_0x75bc('0x1f')]);_0x4a3dd8[_0x75bc('0x20')]=qs[_0x75bc('0x20')](_0x4dab39[_0x75bc('0x33')]['offset']);}_0x4a3dd8[_0x75bc('0x39')]=qs[_0x75bc('0x3a')](_0x4dab39[_0x75bc('0x33')][_0x75bc('0x3a')]);_0x4a3dd8['where']=qs['filters'](_[_0x75bc('0x3b')](_0x4dab39[_0x75bc('0x33')],_0x31bdc1[_0x75bc('0x34')]),_0x2dea1b);if(_0x4dab39[_0x75bc('0x33')][_0x75bc('0x3c')]){_0x4a3dd8['where']=_[_0x75bc('0x3d')](_0x4a3dd8['where'],{'$or':_[_0x75bc('0x2d')](_0x2dea1b,function(_0x2fa9f5){if(_0x2fa9f5[_0x75bc('0x30')]!=='VIRTUAL'){var _0x3623bd={};_0x3623bd[_0x2fa9f5['name']]={'$like':'%'+_0x4dab39[_0x75bc('0x33')]['filter']+'%'};return _0x3623bd;}})});}_0x4a3dd8=_[_0x75bc('0x3d')]({},_0x4a3dd8,_0x4dab39[_0x75bc('0x3e')]);var _0x24cc87={'where':_0x4a3dd8['where']};return db[_0x75bc('0x2e')]['count'](_0x24cc87)[_0x75bc('0x27')](function(_0x4260be){_0x518e88[_0x75bc('0x21')]=_0x4260be;if(_0x4dab39['query']['includeAll']){_0x4a3dd8[_0x75bc('0x3f')]=[{'all':!![]}];}return db[_0x75bc('0x2e')]['findAll'](_0x4a3dd8);})[_0x75bc('0x27')](function(_0xc8823c){_0x518e88['rows']=_0xc8823c;return _0x518e88;})[_0x75bc('0x27')](respondWithFilteredResult(_0x1f2aee,_0x4a3dd8))[_0x75bc('0x40')](handleError(_0x1f2aee,null));};exports[_0x75bc('0x41')]=function(_0x4baf21,_0x2651dc){var _0x2e4f5c={'raw':!![],'where':{'id':_0x4baf21[_0x75bc('0x42')]['id']}},_0x50df4b={};_0x50df4b[_0x75bc('0x32')]=_[_0x75bc('0x43')](db[_0x75bc('0x2e')][_0x75bc('0x2f')]);_0x50df4b[_0x75bc('0x33')]=_['keys'](_0x4baf21[_0x75bc('0x33')]);_0x50df4b[_0x75bc('0x34')]=_[_0x75bc('0x35')](_0x50df4b[_0x75bc('0x32')],_0x50df4b[_0x75bc('0x33')]);_0x2e4f5c['attributes']=_[_0x75bc('0x35')](_0x50df4b[_0x75bc('0x32')],qs[_0x75bc('0x37')](_0x4baf21[_0x75bc('0x33')][_0x75bc('0x37')]));_0x2e4f5c[_0x75bc('0x36')]=_0x2e4f5c[_0x75bc('0x36')]['length']?_0x2e4f5c[_0x75bc('0x36')]:_0x50df4b[_0x75bc('0x32')];if(_0x4baf21[_0x75bc('0x33')]['includeAll']){_0x2e4f5c['include']=[{'all':!![]}];}_0x2e4f5c=_[_0x75bc('0x3d')]({},_0x2e4f5c,_0x4baf21[_0x75bc('0x3e')]);return db[_0x75bc('0x2e')][_0x75bc('0x44')](_0x2e4f5c)['then'](handleEntityNotFound(_0x2651dc,null))['then'](respondWithResult(_0x2651dc,null))[_0x75bc('0x40')](handleError(_0x2651dc,null));};exports[_0x75bc('0x45')]=function(_0x30d144,_0x75be13,_0x56dbef){return db[_0x75bc('0x2e')]['find']({'where':{'id':_0x30d144['params']['id']},'attributes':[_0x75bc('0x2c'),_0x75bc('0x46'),_0x75bc('0x47')],'raw':!![]})[_0x75bc('0x27')](handleEntityNotFound(_0x75be13,null))[_0x75bc('0x27')](function(_0xcbb877){if(_0xcbb877){if(!fs['existsSync'](path[_0x75bc('0x48')](config['root'],'server/files/sounds/converted',_0xcbb877[_0x75bc('0x46')]+'.'+_0xcbb877[_0x75bc('0x47')]))){throw new db['Sequelize'][(_0x75bc('0x49'))]('Sound\x20not\x20found');}return _0x75be13[_0x75bc('0x45')](path[_0x75bc('0x48')](config[_0x75bc('0x4a')],_0x75bc('0x4b'),util['format'](_0x75bc('0x4c'),_0xcbb877[_0x75bc('0x46')],_0xcbb877[_0x75bc('0x47')])),util['format'](_0x75bc('0x4c'),_0xcbb877['name'],_0xcbb877['converted_format']));}return null;})[_0x75bc('0x40')](handleError(_0x75be13,null));};exports[_0x75bc('0x4d')]=function(_0x2bf46d,_0x116c70,_0x1c1ddf){var _0x17d3ff={'name':path[_0x75bc('0x4e')](_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x50')],path[_0x75bc('0x51')](_0x2bf46d[_0x75bc('0x4f')]['originalname'])),'save_name':path[_0x75bc('0x4e')](_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x52')],path[_0x75bc('0x51')](_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x52')])),'original_format':path['extname'](_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x50')])[_0x75bc('0x53')](0x1),'converted_format':_0x75bc('0x54')};var _0x1f21fd=path[_0x75bc('0x48')](config['root'],_0x75bc('0x55'),_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x52')]);var _0x141bba=path[_0x75bc('0x48')](config['root'],_0x75bc('0x4b'),util[_0x75bc('0x56')]('%s.%s',path[_0x75bc('0x4e')](_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x52')],path[_0x75bc('0x51')](_0x2bf46d[_0x75bc('0x4f')][_0x75bc('0x52')])),_0x17d3ff['converted_format']));logger[_0x75bc('0x57')](_0x75bc('0x58'),_0x1f21fd);logger[_0x75bc('0x57')](_0x75bc('0x59'),_0x141bba);try{fs['chmodSync'](_0x1f21fd,parseInt(_0x75bc('0x5a'),0x8));var _0x4ec421=sox['transcode'](_0x1f21fd,_0x141bba,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4ec421['on']('error',function(_0x34f730){fs[_0x75bc('0x5b')](_0x1f21fd);_0x116c70['status'](0x1f4)['send'](_0x34f730);});_0x4ec421['on'](_0x75bc('0x5c'),function(_0x4e0990){_0x17d3ff[_0x75bc('0x5d')]=isNaN(_0x4e0990[_0x75bc('0x5e')])?null:_0x4e0990['duration']*0x3e8;_0x17d3ff['original_sampleCount']=isNaN(_0x4e0990[_0x75bc('0x5f')])?null:_0x4e0990['sampleCount'];_0x17d3ff['original_channelCount']=isNaN(_0x4e0990['channelCount'])?null:_0x4e0990[_0x75bc('0x60')];_0x17d3ff[_0x75bc('0x61')]=isNaN(_0x4e0990[_0x75bc('0x62')])?null:_0x4e0990[_0x75bc('0x62')];_0x17d3ff[_0x75bc('0x63')]=isNaN(_0x4e0990['sampleRate'])?null:_0x4e0990[_0x75bc('0x64')];});_0x4ec421['on'](_0x75bc('0x65'),function(_0x5f5cb5){_0x17d3ff[_0x75bc('0x66')]=isNaN(_0x5f5cb5[_0x75bc('0x5e')])?null:_0x5f5cb5['duration']*0x3e8;_0x17d3ff['converted_sampleCount']=isNaN(_0x5f5cb5[_0x75bc('0x5f')])?null:_0x5f5cb5['sampleCount'];_0x17d3ff[_0x75bc('0x67')]=isNaN(_0x5f5cb5[_0x75bc('0x60')])?null:_0x5f5cb5[_0x75bc('0x60')];_0x17d3ff['converted_bitRate']=isNaN(_0x5f5cb5[_0x75bc('0x62')])?null:_0x5f5cb5[_0x75bc('0x62')];_0x17d3ff[_0x75bc('0x68')]=isNaN(_0x5f5cb5[_0x75bc('0x64')])?null:_0x5f5cb5[_0x75bc('0x64')];});_0x4ec421['on'](_0x75bc('0x1b'),function(){fs[_0x75bc('0x69')](_0x141bba,parseInt(_0x75bc('0x5a'),0x8));return db[_0x75bc('0x2e')]['create'](_0x17d3ff)[_0x75bc('0x27')](function(_0xff4994){var _0x4e1e63={'role':_0x2bf46d[_0x75bc('0x6a')]['role'],'userProfileId':_0x2bf46d[_0x75bc('0x6a')][_0x75bc('0x6b')]};if(!_0x4e1e63)throw new Error(_0x75bc('0x6c'));if(_0x4e1e63[_0x75bc('0x6d')]===_0x75bc('0x6e')){var _0x2fef2d=_0xff4994[_0x75bc('0x28')]({'plain':!![]});return db[_0x75bc('0x6f')]['find']({'where':{'name':_0x75bc('0x70'),'userProfileId':_0x4e1e63[_0x75bc('0x6b')]},'raw':!![]})[_0x75bc('0x27')](function(_0x4c25de){if(_0x4c25de&&_0x4c25de[_0x75bc('0x71')]===0x0){return db[_0x75bc('0x29')][_0x75bc('0x4d')]({'name':_0x2fef2d[_0x75bc('0x2c')],'resourceId':_0x2fef2d['id'],'type':_0x4c25de['name'],'sectionId':_0x4c25de['id']},{})[_0x75bc('0x27')](function(){return _0xff4994;});}else{return _0xff4994;}})[_0x75bc('0x40')](function(_0x13ba94){logger['error'](_0x75bc('0x72'),_0x13ba94);throw _0x13ba94;});}return _0xff4994;})[_0x75bc('0x27')](respondWithResult(_0x116c70,null))[_0x75bc('0x40')](handleError(_0x116c70,null));});_0x4ec421[_0x75bc('0x73')]();}catch(_0x59a648){_0x116c70[_0x75bc('0x1c')](0x1f4)[_0x75bc('0x74')](_0x59a648);}};exports['update']=function(_0x1d6ce4,_0x2b59a6,_0x76e9a2){return db[_0x75bc('0x2e')][_0x75bc('0x44')]({'where':{'id':_0x1d6ce4[_0x75bc('0x42')]['id']}})[_0x75bc('0x27')](handleEntityNotFound(_0x2b59a6,null))[_0x75bc('0x27')](saveUpdates(_[_0x75bc('0x3b')](_0x1d6ce4[_0x75bc('0x6a')],[_0x75bc('0x2c'),_0x75bc('0x75')]),null))['then'](respondWithResult(_0x2b59a6,null))['catch'](handleError(_0x2b59a6,null));};exports['delete']=function(_0x3f904e,_0x17c2c5,_0xda4b6f){return db['Sound'][_0x75bc('0x44')]({'where':{'id':_0x3f904e[_0x75bc('0x42')]['id']}})['then'](function(_0x5ede11){if(_0x5ede11){return _0x5ede11[_0x75bc('0x2a')]();}})[_0x75bc('0x27')](function(_0x500bd8){var _0x346695=path['join'](config['root'],_0x75bc('0x55'),util[_0x75bc('0x56')](_0x75bc('0x4c'),_0x500bd8[_0x75bc('0x46')],_0x500bd8[_0x75bc('0x76')]));var _0x128234=path[_0x75bc('0x48')](config[_0x75bc('0x4a')],_0x75bc('0x4b'),util[_0x75bc('0x56')](_0x75bc('0x4c'),_0x500bd8[_0x75bc('0x46')],_0x500bd8[_0x75bc('0x47')]));fs[_0x75bc('0x5b')](_0x346695);fs[_0x75bc('0x5b')](_0x128234);return _0x500bd8;})[_0x75bc('0x27')](function(_0xcd3830){if(_0xcd3830){return _0x17c2c5['status'](0xcc)[_0x75bc('0x1b')]();}})[_0x75bc('0x27')](handleEntityNotFound(_0x17c2c5,null))[_0x75bc('0x40')](handleError(_0x17c2c5,null));}; \ No newline at end of file +var _0xc8b4=['Content-Range','apply','save','update','then','destroy','Sounds','UserProfileResource','sendStatus','error','stack','name','send','index','Sound','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','rawAttributes','find','catch','download','save_name','join','server/files/sounds/converted','converted_format','Sequelize','Sound\x20not\x20found','root','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc8b4,0x1d9));var _0x4c8b=function(_0x356d98,_0x2d7b83){_0x356d98=_0x356d98-0x0;var _0x384c3e=_0xc8b4[_0x356d98];return _0x384c3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c8b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c8b('0x1'));var rp=require(_0x4c8b('0x2'));var moment=require(_0x4c8b('0x3'));var BPromise=require(_0x4c8b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4c8b('0x5'));var sox=require(_0x4c8b('0x6'));var csv=require(_0x4c8b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c8b('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4c8b('0x9'));var jsforce=require(_0x4c8b('0xa'));var deskjs=require(_0x4c8b('0xb'));var toCsv=require(_0x4c8b('0x7'));var querystring=require(_0x4c8b('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4c8b('0xd'));var as=require(_0x4c8b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c8b('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x4c8b('0x10'));var licenseUtil=require(_0x4c8b('0x11'));var db=require(_0x4c8b('0x12'))['db'];function respondWithStatusCode(_0x251273,_0x339235){_0x339235=_0x339235||0xcc;return function(_0x164605){if(_0x164605){return _0x251273['sendStatus'](_0x339235);}return _0x251273['status'](_0x339235)[_0x4c8b('0x13')]();};}function respondWithResult(_0x93112b,_0x4ea848){_0x4ea848=_0x4ea848||0xc8;return function(_0x29cf27){if(_0x29cf27){return _0x93112b[_0x4c8b('0x14')](_0x4ea848)[_0x4c8b('0x15')](_0x29cf27);}};}function respondWithFilteredResult(_0x1a64d2,_0x5cc699){return function(_0x1bfeed){if(_0x1bfeed){var _0x48ca31=typeof _0x5cc699[_0x4c8b('0x16')]===_0x4c8b('0x17')&&typeof _0x5cc699[_0x4c8b('0x18')]===_0x4c8b('0x17');var _0x1e3bf8=_0x1bfeed[_0x4c8b('0x19')];var _0x18fdba=_0x48ca31?0x0:_0x5cc699['offset'];var _0x3b8619=_0x48ca31?_0x1bfeed[_0x4c8b('0x19')]:_0x5cc699['offset']+_0x5cc699[_0x4c8b('0x18')];var _0x5e58f1;if(_0x3b8619>=_0x1e3bf8){_0x3b8619=_0x1e3bf8;_0x5e58f1=0xc8;}else{_0x5e58f1=0xce;}_0x1a64d2[_0x4c8b('0x14')](_0x5e58f1);return _0x1a64d2[_0x4c8b('0x1a')](_0x4c8b('0x1b'),_0x18fdba+'-'+_0x3b8619+'/'+_0x1e3bf8)[_0x4c8b('0x15')](_0x1bfeed);}return null;};}function patchUpdates(_0x57cd4f){return function(_0x57fc86){try{jsonpatch[_0x4c8b('0x1c')](_0x57fc86,_0x57cd4f,!![]);}catch(_0x381f5e){return BPromise['reject'](_0x381f5e);}return _0x57fc86[_0x4c8b('0x1d')]();};}function saveUpdates(_0x14dd9c,_0x31c279){return function(_0x3fe6b6){if(_0x3fe6b6){return _0x3fe6b6[_0x4c8b('0x1e')](_0x14dd9c)[_0x4c8b('0x1f')](function(_0x39e6ed){return _0x39e6ed;});}return null;};}function removeEntity(_0x3ffdff,_0x226aaf){return function(_0x106dfb){if(_0x106dfb){return _0x106dfb[_0x4c8b('0x20')]()[_0x4c8b('0x1f')](function(){var _0x4ee2d1=_0x106dfb['get']({'plain':!![]});var _0x5e4e3c=_0x4c8b('0x21');return db[_0x4c8b('0x22')]['destroy']({'where':{'type':_0x5e4e3c,'resourceId':_0x4ee2d1['id']}})[_0x4c8b('0x1f')](function(){return _0x106dfb;});})['then'](function(){_0x3ffdff[_0x4c8b('0x14')](0xcc)[_0x4c8b('0x13')]();});}};}function handleEntityNotFound(_0x24ea58,_0xe436c1){return function(_0x467983){if(!_0x467983){_0x24ea58[_0x4c8b('0x23')](0x194);}return _0x467983;};}function handleError(_0x4f0185,_0x3c7fda){_0x3c7fda=_0x3c7fda||0x1f4;return function(_0x54c86b){logger[_0x4c8b('0x24')](_0x54c86b[_0x4c8b('0x25')]);if(_0x54c86b[_0x4c8b('0x26')]){delete _0x54c86b[_0x4c8b('0x26')];}_0x4f0185[_0x4c8b('0x14')](_0x3c7fda)[_0x4c8b('0x27')](_0x54c86b);};}exports[_0x4c8b('0x28')]=function(_0x2ec453,_0x1092c6){var _0x445827={},_0x1f45a8={},_0x4b6144={'count':0x0,'rows':[]};var _0x1a5c96=_['map'](db[_0x4c8b('0x29')]['rawAttributes'],function(_0x28d568){return{'name':_0x28d568[_0x4c8b('0x2a')],'type':_0x28d568[_0x4c8b('0x2b')][_0x4c8b('0x2c')]};});_0x1f45a8[_0x4c8b('0x2d')]=_[_0x4c8b('0x2e')](_0x1a5c96,_0x4c8b('0x26'));_0x1f45a8[_0x4c8b('0x2f')]=_[_0x4c8b('0x30')](_0x2ec453['query']);_0x1f45a8[_0x4c8b('0x31')]=_[_0x4c8b('0x32')](_0x1f45a8['model'],_0x1f45a8[_0x4c8b('0x2f')]);_0x445827[_0x4c8b('0x33')]=_[_0x4c8b('0x32')](_0x1f45a8[_0x4c8b('0x2d')],qs['fields'](_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x34')]));_0x445827[_0x4c8b('0x33')]=_0x445827['attributes'][_0x4c8b('0x35')]?_0x445827[_0x4c8b('0x33')]:_0x1f45a8[_0x4c8b('0x2d')];if(!_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x36')](_0x4c8b('0x37'))){_0x445827['limit']=qs[_0x4c8b('0x18')](_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x18')]);_0x445827[_0x4c8b('0x16')]=qs[_0x4c8b('0x16')](_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x16')]);}_0x445827[_0x4c8b('0x38')]=qs[_0x4c8b('0x39')](_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x39')]);_0x445827[_0x4c8b('0x3a')]=qs[_0x4c8b('0x31')](_[_0x4c8b('0x3b')](_0x2ec453[_0x4c8b('0x2f')],_0x1f45a8[_0x4c8b('0x31')]),_0x1a5c96);if(_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x3c')]){_0x445827['where']=_[_0x4c8b('0x3d')](_0x445827[_0x4c8b('0x3a')],{'$or':_[_0x4c8b('0x2e')](_0x1a5c96,function(_0x3cb392){if(_0x3cb392[_0x4c8b('0x2b')]!==_0x4c8b('0x3e')){var _0x420368={};_0x420368[_0x3cb392[_0x4c8b('0x26')]]={'$like':'%'+_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x3c')]+'%'};return _0x420368;}})});}_0x445827=_[_0x4c8b('0x3d')]({},_0x445827,_0x2ec453[_0x4c8b('0x3f')]);var _0x5e5679={'where':_0x445827[_0x4c8b('0x3a')]};return db['Sound']['count'](_0x5e5679)[_0x4c8b('0x1f')](function(_0x1e4a14){_0x4b6144[_0x4c8b('0x19')]=_0x1e4a14;if(_0x2ec453[_0x4c8b('0x2f')][_0x4c8b('0x40')]){_0x445827[_0x4c8b('0x41')]=[{'all':!![]}];}return db['Sound'][_0x4c8b('0x42')](_0x445827);})[_0x4c8b('0x1f')](function(_0xbe6758){_0x4b6144['rows']=_0xbe6758;return _0x4b6144;})[_0x4c8b('0x1f')](respondWithFilteredResult(_0x1092c6,_0x445827))['catch'](handleError(_0x1092c6,null));};exports[_0x4c8b('0x43')]=function(_0x545898,_0x35632b){var _0x14728f={'raw':!![],'where':{'id':_0x545898[_0x4c8b('0x44')]['id']}},_0x206880={};_0x206880['model']=_[_0x4c8b('0x30')](db[_0x4c8b('0x29')][_0x4c8b('0x45')]);_0x206880[_0x4c8b('0x2f')]=_[_0x4c8b('0x30')](_0x545898[_0x4c8b('0x2f')]);_0x206880[_0x4c8b('0x31')]=_[_0x4c8b('0x32')](_0x206880['model'],_0x206880[_0x4c8b('0x2f')]);_0x14728f[_0x4c8b('0x33')]=_[_0x4c8b('0x32')](_0x206880['model'],qs[_0x4c8b('0x34')](_0x545898['query']['fields']));_0x14728f['attributes']=_0x14728f['attributes'][_0x4c8b('0x35')]?_0x14728f[_0x4c8b('0x33')]:_0x206880[_0x4c8b('0x2d')];if(_0x545898[_0x4c8b('0x2f')][_0x4c8b('0x40')]){_0x14728f['include']=[{'all':!![]}];}_0x14728f=_[_0x4c8b('0x3d')]({},_0x14728f,_0x545898['options']);return db['Sound'][_0x4c8b('0x46')](_0x14728f)[_0x4c8b('0x1f')](handleEntityNotFound(_0x35632b,null))[_0x4c8b('0x1f')](respondWithResult(_0x35632b,null))[_0x4c8b('0x47')](handleError(_0x35632b,null));};exports[_0x4c8b('0x48')]=function(_0x4c2159,_0x1f7525,_0x2d9983){return db[_0x4c8b('0x29')][_0x4c8b('0x46')]({'where':{'id':_0x4c2159[_0x4c8b('0x44')]['id']},'attributes':[_0x4c8b('0x26'),_0x4c8b('0x49'),'converted_format'],'raw':!![]})[_0x4c8b('0x1f')](handleEntityNotFound(_0x1f7525,null))[_0x4c8b('0x1f')](function(_0x1d8126){if(_0x1d8126){if(!fs['existsSync'](path[_0x4c8b('0x4a')](config['root'],_0x4c8b('0x4b'),_0x1d8126['save_name']+'.'+_0x1d8126[_0x4c8b('0x4c')]))){throw new db[(_0x4c8b('0x4d'))]['ValidationError'](_0x4c8b('0x4e'));}return _0x1f7525[_0x4c8b('0x48')](path[_0x4c8b('0x4a')](config[_0x4c8b('0x4f')],'server/files/sounds/converted',util[_0x4c8b('0x50')](_0x4c8b('0x51'),_0x1d8126[_0x4c8b('0x49')],_0x1d8126[_0x4c8b('0x4c')])),util[_0x4c8b('0x50')](_0x4c8b('0x51'),_0x1d8126[_0x4c8b('0x26')],_0x1d8126['converted_format']));}return null;})[_0x4c8b('0x47')](handleError(_0x1f7525,null));};exports['create']=function(_0x110187,_0xb536d9,_0x53e836){var _0x11352d={'name':path[_0x4c8b('0x52')](_0x110187[_0x4c8b('0x53')][_0x4c8b('0x54')],path[_0x4c8b('0x55')](_0x110187[_0x4c8b('0x53')][_0x4c8b('0x54')])),'save_name':path[_0x4c8b('0x52')](_0x110187[_0x4c8b('0x53')]['filename'],path[_0x4c8b('0x55')](_0x110187[_0x4c8b('0x53')][_0x4c8b('0x56')])),'original_format':path[_0x4c8b('0x55')](_0x110187['file'][_0x4c8b('0x54')])[_0x4c8b('0x57')](0x1),'converted_format':_0x4c8b('0x58')};var _0x17feb=path[_0x4c8b('0x4a')](config['root'],_0x4c8b('0x59'),_0x110187['file'][_0x4c8b('0x56')]);var _0xc550cc=path[_0x4c8b('0x4a')](config[_0x4c8b('0x4f')],_0x4c8b('0x4b'),util[_0x4c8b('0x50')](_0x4c8b('0x51'),path[_0x4c8b('0x52')](_0x110187[_0x4c8b('0x53')][_0x4c8b('0x56')],path[_0x4c8b('0x55')](_0x110187[_0x4c8b('0x53')]['filename'])),_0x11352d[_0x4c8b('0x4c')]));logger['info'](_0x4c8b('0x5a'),_0x17feb);logger[_0x4c8b('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0xc550cc);try{fs[_0x4c8b('0x5c')](_0x17feb,parseInt(_0x4c8b('0x5d'),0x8));var _0x5a7b59=sox[_0x4c8b('0x5e')](_0x17feb,_0xc550cc,{'sampleRate':0x1f40,'format':_0x4c8b('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5a7b59['on'](_0x4c8b('0x24'),function(_0x3875d5){fs[_0x4c8b('0x5f')](_0x17feb);_0xb536d9[_0x4c8b('0x14')](0x1f4)[_0x4c8b('0x27')](_0x3875d5);});_0x5a7b59['on'](_0x4c8b('0x60'),function(_0x25c865){_0x11352d[_0x4c8b('0x61')]=isNaN(_0x25c865[_0x4c8b('0x62')])?null:_0x25c865[_0x4c8b('0x62')]*0x3e8;_0x11352d[_0x4c8b('0x63')]=isNaN(_0x25c865[_0x4c8b('0x64')])?null:_0x25c865[_0x4c8b('0x64')];_0x11352d[_0x4c8b('0x65')]=isNaN(_0x25c865[_0x4c8b('0x66')])?null:_0x25c865['channelCount'];_0x11352d[_0x4c8b('0x67')]=isNaN(_0x25c865['bitRate'])?null:_0x25c865[_0x4c8b('0x68')];_0x11352d[_0x4c8b('0x69')]=isNaN(_0x25c865[_0x4c8b('0x6a')])?null:_0x25c865[_0x4c8b('0x6a')];});_0x5a7b59['on'](_0x4c8b('0x6b'),function(_0x2468a0){_0x11352d['converted_duration']=isNaN(_0x2468a0[_0x4c8b('0x62')])?null:_0x2468a0['duration']*0x3e8;_0x11352d[_0x4c8b('0x6c')]=isNaN(_0x2468a0[_0x4c8b('0x64')])?null:_0x2468a0[_0x4c8b('0x64')];_0x11352d[_0x4c8b('0x6d')]=isNaN(_0x2468a0[_0x4c8b('0x66')])?null:_0x2468a0[_0x4c8b('0x66')];_0x11352d[_0x4c8b('0x6e')]=isNaN(_0x2468a0[_0x4c8b('0x68')])?null:_0x2468a0[_0x4c8b('0x68')];_0x11352d[_0x4c8b('0x6f')]=isNaN(_0x2468a0[_0x4c8b('0x6a')])?null:_0x2468a0['sampleRate'];});_0x5a7b59['on']('end',function(){fs[_0x4c8b('0x5c')](_0xc550cc,parseInt(_0x4c8b('0x5d'),0x8));return db[_0x4c8b('0x29')][_0x4c8b('0x70')](_0x11352d)[_0x4c8b('0x1f')](function(_0x4e0495){var _0x5b400d={'role':_0x110187[_0x4c8b('0x71')][_0x4c8b('0x72')],'userProfileId':_0x110187[_0x4c8b('0x71')][_0x4c8b('0x73')]};if(!_0x5b400d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b400d[_0x4c8b('0x72')]===_0x4c8b('0x74')){var _0x1a0979=_0x4e0495[_0x4c8b('0x75')]({'plain':!![]});return db[_0x4c8b('0x76')][_0x4c8b('0x46')]({'where':{'name':_0x4c8b('0x21'),'userProfileId':_0x5b400d[_0x4c8b('0x73')]},'raw':!![]})['then'](function(_0x19f3a7){if(_0x19f3a7&&_0x19f3a7[_0x4c8b('0x77')]===0x0){return db[_0x4c8b('0x22')][_0x4c8b('0x70')]({'name':_0x1a0979[_0x4c8b('0x26')],'resourceId':_0x1a0979['id'],'type':_0x19f3a7['name'],'sectionId':_0x19f3a7['id']},{})[_0x4c8b('0x1f')](function(){return _0x4e0495;});}else{return _0x4e0495;}})[_0x4c8b('0x47')](function(_0x3aab0e){logger[_0x4c8b('0x24')](_0x4c8b('0x78'),_0x3aab0e);throw _0x3aab0e;});}return _0x4e0495;})[_0x4c8b('0x1f')](respondWithResult(_0xb536d9,null))[_0x4c8b('0x47')](handleError(_0xb536d9,null));});_0x5a7b59[_0x4c8b('0x79')]();}catch(_0x520062){_0xb536d9[_0x4c8b('0x14')](0x1f4)[_0x4c8b('0x27')](_0x520062);}};exports[_0x4c8b('0x1e')]=function(_0x4a7384,_0xf8ea20,_0x37b88d){return db[_0x4c8b('0x29')][_0x4c8b('0x46')]({'where':{'id':_0x4a7384[_0x4c8b('0x44')]['id']}})[_0x4c8b('0x1f')](handleEntityNotFound(_0xf8ea20,null))['then'](saveUpdates(_['pick'](_0x4a7384[_0x4c8b('0x71')],[_0x4c8b('0x26'),_0x4c8b('0x7a')]),null))[_0x4c8b('0x1f')](respondWithResult(_0xf8ea20,null))[_0x4c8b('0x47')](handleError(_0xf8ea20,null));};exports[_0x4c8b('0x7b')]=function(_0x21271b,_0x348fee,_0x29b1ff){return db['Sound'][_0x4c8b('0x46')]({'where':{'id':_0x21271b[_0x4c8b('0x44')]['id']}})[_0x4c8b('0x1f')](function(_0x5f196c){if(_0x5f196c){return _0x5f196c['destroy']();}})['then'](function(_0x132d80){var _0x1b324d=path[_0x4c8b('0x4a')](config['root'],'server/files/sounds/original',util[_0x4c8b('0x50')](_0x4c8b('0x51'),_0x132d80[_0x4c8b('0x49')],_0x132d80[_0x4c8b('0x7c')]));var _0x317831=path['join'](config[_0x4c8b('0x4f')],_0x4c8b('0x4b'),util[_0x4c8b('0x50')](_0x4c8b('0x51'),_0x132d80[_0x4c8b('0x49')],_0x132d80[_0x4c8b('0x4c')]));fs[_0x4c8b('0x5f')](_0x1b324d);fs[_0x4c8b('0x5f')](_0x317831);return _0x132d80;})[_0x4c8b('0x1f')](function(_0x49c2f0){if(_0x49c2f0){return _0x348fee['status'](0xcc)['end']();}})[_0x4c8b('0x1f')](handleEntityNotFound(_0x348fee,null))[_0x4c8b('0x47')](handleError(_0x348fee,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 3a0b006..be98c53 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 _0xb4fa=['./sound.attributes','exports','define','Sound','tools_sounds','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb4fa,0x170));var _0xab4f=function(_0x328f12,_0xfd34d1){_0x328f12=_0x328f12-0x0;var _0x41e11b=_0xb4fa[_0x328f12];return _0x41e11b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab4f('0x0'))(_0xab4f('0x1'));var moment=require(_0xab4f('0x2'));var BPromise=require(_0xab4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab4f('0x4'));var config=require(_0xab4f('0x5'));var attributes=require(_0xab4f('0x6'));module[_0xab4f('0x7')]=function(_0x4f7a9f,_0x545727){return _0x4f7a9f[_0xab4f('0x8')](_0xab4f('0x9'),attributes,{'tableName':_0xab4f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77a2=['./sound.attributes','define','Sound','tools_sounds','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77a2,0xe0));var _0x277a=function(_0x51476a,_0x2e80ae){_0x51476a=_0x51476a-0x0;var _0x18f879=_0x77a2[_0x51476a];return _0x18f879;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x277a('0x0'));var moment=require('moment');var BPromise=require(_0x277a('0x1'));var rp=require(_0x277a('0x2'));var fs=require('fs');var path=require(_0x277a('0x3'));var rimraf=require(_0x277a('0x4'));var config=require(_0x277a('0x5'));var attributes=require(_0x277a('0x6'));module['exports']=function(_0x560f61,_0x46f6ab){return _0x560f61[_0x277a('0x7')](_0x277a('0x8'),attributes,{'tableName':_0x277a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index ca517b0..9953d72 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 _0x82ec=['code','error','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x182006,_0x53f064){var _0x19b2b3=function(_0x4b145b){while(--_0x4b145b){_0x182006['push'](_0x182006['shift']());}};_0x19b2b3(++_0x53f064);}(_0x82ec,0x159));var _0xc82e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x82ec[_0x432682];return _0x463d05;};'use strict';var _=require(_0xc82e('0x0'));var util=require(_0xc82e('0x1'));var moment=require(_0xc82e('0x2'));var BPromise=require(_0xc82e('0x3'));var rs=require(_0xc82e('0x4'));var fs=require('fs');var Redis=require(_0xc82e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc82e('0x6'))(_0xc82e('0x7'));var config=require(_0xc82e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc82e('0x9')][_0xc82e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x490b18,_0x3321b5,_0x315995){return new BPromise(function(_0x183b5d,_0x520797){return client[_0xc82e('0xb')](_0x490b18,_0x315995)['then'](function(_0x16314c){logger[_0xc82e('0xc')](_0xc82e('0xd'),_0x3321b5,'request\x20sent');logger[_0xc82e('0xe')](_0xc82e('0xf'),_0x3321b5,_0xc82e('0x10'),JSON[_0xc82e('0x11')](_0x16314c));if(_0x16314c['error']){if(_0x16314c['error'][_0xc82e('0x12')]===0x1f4){logger['error'](_0xc82e('0xd'),_0x3321b5,_0x16314c[_0xc82e('0x13')][_0xc82e('0x14')]);return _0x520797(_0x16314c[_0xc82e('0x13')]['message']);}logger[_0xc82e('0x13')](_0xc82e('0xd'),_0x3321b5,_0x16314c[_0xc82e('0x13')]['message']);return _0x183b5d(_0x16314c[_0xc82e('0x13')][_0xc82e('0x14')]);}else{logger[_0xc82e('0xc')](_0xc82e('0xd'),_0x3321b5,_0xc82e('0x10'));_0x183b5d(_0x16314c[_0xc82e('0x15')]['message']);}})[_0xc82e('0x16')](function(_0x1bfeca){logger[_0xc82e('0x13')](_0xc82e('0xd'),_0x3321b5,_0x1bfeca);_0x520797(_0x1bfeca);});});}exports[_0xc82e('0x17')]=function(_0x234893){var _0x56a87d=this;return new Promise(function(_0x1629bc,_0x227f3d){return db[_0xc82e('0x18')]['find']({'raw':_0x234893[_0xc82e('0x19')]?_0x234893['options'][_0xc82e('0x1a')]===undefined?!![]:![]:!![],'where':_0x234893[_0xc82e('0x19')]?_0x234893[_0xc82e('0x19')][_0xc82e('0x1b')]||null:null,'attributes':_0x234893[_0xc82e('0x19')]?_0x234893[_0xc82e('0x19')]['attributes']||null:null,'include':_0x234893['options']?_0x234893[_0xc82e('0x19')][_0xc82e('0x1c')]?_['map'](_0x234893[_0xc82e('0x19')]['include'],function(_0x1e5a87){return{'model':db[_0x1e5a87[_0xc82e('0x1d')]],'as':_0x1e5a87['as'],'attributes':_0x1e5a87[_0xc82e('0x1e')],'include':_0x1e5a87[_0xc82e('0x1c')]?_[_0xc82e('0x1f')](_0x1e5a87[_0xc82e('0x1c')],function(_0x518c64){return{'model':db[_0x518c64['model']],'as':_0x518c64['as'],'attributes':_0x518c64['attributes'],'include':_0x518c64[_0xc82e('0x1c')]?_[_0xc82e('0x1f')](_0x518c64[_0xc82e('0x1c')],function(_0x25be9d){return{'model':db[_0x25be9d[_0xc82e('0x1d')]],'as':_0x25be9d['as'],'attributes':_0x25be9d[_0xc82e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc82e('0x20')](function(_0x4e2a5e){logger[_0xc82e('0xc')](_0xc82e('0x17'),_0x234893);logger[_0xc82e('0xe')](_0xc82e('0x17'),_0x234893,JSON[_0xc82e('0x11')](_0x4e2a5e));_0x1629bc(_0x4e2a5e);})[_0xc82e('0x16')](function(_0x21fb15){logger[_0xc82e('0x13')](_0xc82e('0x17'),_0x21fb15[_0xc82e('0x14')],_0x234893);_0x227f3d(_0x56a87d[_0xc82e('0x13')](0x1f4,_0x21fb15['message']));});});}; \ No newline at end of file +var _0xbf5b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','ShowSound','Sound','options','where','map','include','model','attributes','catch','lodash','util','moment'];(function(_0x47f3e3,_0x1deb3f){var _0x10a6e6=function(_0x2371ce){while(--_0x2371ce){_0x47f3e3['push'](_0x47f3e3['shift']());}};_0x10a6e6(++_0x1deb3f);}(_0xbf5b,0xf5));var _0xbbf5=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0xbf5b[_0x1b5080];return _0x195c87;};'use strict';var _=require(_0xbbf5('0x0'));var util=require(_0xbbf5('0x1'));var moment=require(_0xbbf5('0x2'));var BPromise=require(_0xbbf5('0x3'));var rs=require(_0xbbf5('0x4'));var fs=require('fs');var Redis=require(_0xbbf5('0x5'));var db=require(_0xbbf5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbf5('0x7'))(_0xbbf5('0x8'));var config=require(_0xbbf5('0x9'));var jayson=require(_0xbbf5('0xa'));var client=jayson['client'][_0xbbf5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xacab,_0x1cb5b0,_0x5e96a9){return new BPromise(function(_0x18ad22,_0xd27663){return client['request'](_0xacab,_0x5e96a9)[_0xbbf5('0xc')](function(_0x23d2d0){logger[_0xbbf5('0xd')]('Sound,\x20%s,\x20%s',_0x1cb5b0,_0xbbf5('0xe'));logger[_0xbbf5('0xf')](_0xbbf5('0x10'),_0x1cb5b0,_0xbbf5('0xe'),JSON[_0xbbf5('0x11')](_0x23d2d0));if(_0x23d2d0[_0xbbf5('0x12')]){if(_0x23d2d0[_0xbbf5('0x12')][_0xbbf5('0x13')]===0x1f4){logger['error'](_0xbbf5('0x14'),_0x1cb5b0,_0x23d2d0[_0xbbf5('0x12')][_0xbbf5('0x15')]);return _0xd27663(_0x23d2d0[_0xbbf5('0x12')][_0xbbf5('0x15')]);}logger[_0xbbf5('0x12')](_0xbbf5('0x14'),_0x1cb5b0,_0x23d2d0['error']['message']);return _0x18ad22(_0x23d2d0[_0xbbf5('0x12')][_0xbbf5('0x15')]);}else{logger[_0xbbf5('0xd')](_0xbbf5('0x14'),_0x1cb5b0,_0xbbf5('0xe'));_0x18ad22(_0x23d2d0['result'][_0xbbf5('0x15')]);}})['catch'](function(_0x4ef2c8){logger[_0xbbf5('0x12')]('Sound,\x20%s,\x20%s',_0x1cb5b0,_0x4ef2c8);_0xd27663(_0x4ef2c8);});});}exports[_0xbbf5('0x16')]=function(_0x41db43){var _0x2e4813=this;return new Promise(function(_0x43533c,_0x33df3d){return db[_0xbbf5('0x17')]['find']({'raw':_0x41db43[_0xbbf5('0x18')]?_0x41db43[_0xbbf5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x41db43[_0xbbf5('0x18')]?_0x41db43['options'][_0xbbf5('0x19')]||null:null,'attributes':_0x41db43[_0xbbf5('0x18')]?_0x41db43[_0xbbf5('0x18')]['attributes']||null:null,'include':_0x41db43[_0xbbf5('0x18')]?_0x41db43['options']['include']?_[_0xbbf5('0x1a')](_0x41db43['options'][_0xbbf5('0x1b')],function(_0x37b427){return{'model':db[_0x37b427[_0xbbf5('0x1c')]],'as':_0x37b427['as'],'attributes':_0x37b427[_0xbbf5('0x1d')],'include':_0x37b427[_0xbbf5('0x1b')]?_[_0xbbf5('0x1a')](_0x37b427[_0xbbf5('0x1b')],function(_0x1682ba){return{'model':db[_0x1682ba[_0xbbf5('0x1c')]],'as':_0x1682ba['as'],'attributes':_0x1682ba['attributes'],'include':_0x1682ba[_0xbbf5('0x1b')]?_[_0xbbf5('0x1a')](_0x1682ba[_0xbbf5('0x1b')],function(_0xc2bb38){return{'model':db[_0xc2bb38[_0xbbf5('0x1c')]],'as':_0xc2bb38['as'],'attributes':_0xc2bb38[_0xbbf5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbbf5('0xc')](function(_0x950e4d){logger['info']('ShowSound',_0x41db43);logger[_0xbbf5('0xf')](_0xbbf5('0x16'),_0x41db43,JSON[_0xbbf5('0x11')](_0x950e4d));_0x43533c(_0x950e4d);})[_0xbbf5('0x1e')](function(_0x406408){logger[_0xbbf5('0x12')](_0xbbf5('0x16'),_0x406408[_0xbbf5('0x15')],_0x41db43);_0x33df3d(_0x2e4813['error'](0x1f4,_0x406408[_0xbbf5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d945a56..f795cf6 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c98cc,_0x58190a){var _0x164644=function(_0x540bae){while(--_0x540bae){_0x5c98cc['push'](_0x5c98cc['shift']());}};_0x164644(++_0x58190a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0x0b0e[_0x54aea3];return _0x21ae46;};'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('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0x8603,0x190));var _0x3860=function(_0x43c6fa,_0x2744f5){_0x43c6fa=_0x43c6fa-0x0;var _0x2f08d7=_0x8603[_0x43c6fa];return _0x2f08d7;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6d730cc..058586d 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 _0x997f=['exports','STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x997f,0xc3));var _0xf997=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x997f[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xf997('0x0'));module[_0xf997('0x1')]={'uniqueid':{'type':Sequelize[_0xf997('0x2')]},'body':{'type':Sequelize[_0xf997('0x3')](_0xf997('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xf997('0x5')]('in',_0xf997('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xf997('0x2')]},'providerResponse':{'type':Sequelize[_0xf997('0x3')]}}; \ No newline at end of file +var _0x829e=['ENUM','out','STRING','TEXT','medium'];(function(_0x458863,_0x4d083f){var _0x1bc2bb=function(_0xeeb326){while(--_0xeeb326){_0x458863['push'](_0x458863['shift']());}};_0x1bc2bb(++_0x4d083f);}(_0x829e,0x147));var _0xe829=function(_0x138bb2,_0x3e1aa2){_0x138bb2=_0x138bb2-0x0;var _0x25844a=_0x829e[_0x138bb2];return _0x25844a;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe829('0x0')]},'body':{'type':Sequelize[_0xe829('0x1')](_0xe829('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xe829('0x3')]('in',_0xe829('0x4')),'defaultValue':_0xe829('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe829('0x0')]},'providerResponse':{'type':Sequelize[_0xe829('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 634ca69..028395d 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 _0xf264=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','error','name','send','index','map','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','SquareMessage','includeAll','rows','show','params','rawAttributes','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils'];(function(_0x1ae62e,_0xefb435){var _0x2fe38c=function(_0xb1bb87){while(--_0xb1bb87){_0x1ae62e['push'](_0x1ae62e['shift']());}};_0x2fe38c(++_0xefb435);}(_0xf264,0xfd));var _0x4f26=function(_0x56323a,_0x56fb72){_0x56323a=_0x56323a-0x0;var _0x14c7c9=_0xf264[_0x56323a];return _0x14c7c9;};'use strict';var emlformat=require(_0x4f26('0x0'));var rimraf=require(_0x4f26('0x1'));var zipdir=require(_0x4f26('0x2'));var jsonpatch=require(_0x4f26('0x3'));var rp=require('request-promise');var moment=require(_0x4f26('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f26('0x5'));var util=require('util');var path=require(_0x4f26('0x6'));var sox=require('sox');var csv=require(_0x4f26('0x7'));var ejs=require(_0x4f26('0x8'));var fs=require('fs');var fs_extra=require(_0x4f26('0x9'));var _=require(_0x4f26('0xa'));var squel=require(_0x4f26('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f26('0xc'));var toCsv=require(_0x4f26('0x7'));var querystring=require(_0x4f26('0xd'));var Papa=require(_0x4f26('0xe'));var Redis=require(_0x4f26('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4f26('0x10'));var as=require(_0x4f26('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4f26('0x12'));var config=require(_0x4f26('0x13'));var licenseUtil=require(_0x4f26('0x14'));var db=require(_0x4f26('0x15'))['db'];function respondWithStatusCode(_0x4f344e,_0xff78a8){_0xff78a8=_0xff78a8||0xcc;return function(_0x776ed2){if(_0x776ed2){return _0x4f344e[_0x4f26('0x16')](_0xff78a8);}return _0x4f344e['status'](_0xff78a8)[_0x4f26('0x17')]();};}function respondWithResult(_0x26c3b5,_0x108c26){_0x108c26=_0x108c26||0xc8;return function(_0xb068dc){if(_0xb068dc){return _0x26c3b5[_0x4f26('0x18')](_0x108c26)['json'](_0xb068dc);}};}function respondWithFilteredResult(_0x24b370,_0x22d671){return function(_0x4b2cdb){if(_0x4b2cdb){var _0x44b416=typeof _0x22d671[_0x4f26('0x19')]===_0x4f26('0x1a')&&typeof _0x22d671['limit']===_0x4f26('0x1a');var _0x3283e5=_0x4b2cdb[_0x4f26('0x1b')];var _0x593561=_0x44b416?0x0:_0x22d671['offset'];var _0x5a8004=_0x44b416?_0x4b2cdb['count']:_0x22d671[_0x4f26('0x19')]+_0x22d671[_0x4f26('0x1c')];var _0x30fa50;if(_0x5a8004>=_0x3283e5){_0x5a8004=_0x3283e5;_0x30fa50=0xc8;}else{_0x30fa50=0xce;}_0x24b370['status'](_0x30fa50);return _0x24b370[_0x4f26('0x1d')](_0x4f26('0x1e'),_0x593561+'-'+_0x5a8004+'/'+_0x3283e5)['json'](_0x4b2cdb);}return null;};}function patchUpdates(_0x3a4713){return function(_0x498897){try{jsonpatch[_0x4f26('0x1f')](_0x498897,_0x3a4713,!![]);}catch(_0x37d04f){return BPromise['reject'](_0x37d04f);}return _0x498897[_0x4f26('0x20')]();};}function saveUpdates(_0x1d2c63,_0x1f02d7){return function(_0xae0482){if(_0xae0482){return _0xae0482['update'](_0x1d2c63)['then'](function(_0x32a2d5){return _0x32a2d5;});}return null;};}function removeEntity(_0x3b1cb0,_0x1717dd){return function(_0x3b0c84){if(_0x3b0c84){return _0x3b0c84[_0x4f26('0x21')]()[_0x4f26('0x22')](function(){_0x3b1cb0[_0x4f26('0x18')](0xcc)[_0x4f26('0x17')]();});}};}function handleEntityNotFound(_0x9fa472,_0x1a95ff){return function(_0x532bea){if(!_0x532bea){_0x9fa472[_0x4f26('0x16')](0x194);}return _0x532bea;};}function handleError(_0x8ff896,_0x15271c){_0x15271c=_0x15271c||0x1f4;return function(_0x39f7a8){logger[_0x4f26('0x23')](_0x39f7a8['stack']);if(_0x39f7a8[_0x4f26('0x24')]){delete _0x39f7a8[_0x4f26('0x24')];}_0x8ff896['status'](_0x15271c)[_0x4f26('0x25')](_0x39f7a8);};}exports[_0x4f26('0x26')]=function(_0x3c396b,_0x5ce655){var _0x4d210b={},_0x5351b7={},_0x4449e3={'count':0x0,'rows':[]};var _0x4174eb=_[_0x4f26('0x27')](db['SquareMessage']['rawAttributes'],function(_0x3cdfd7){return{'name':_0x3cdfd7[_0x4f26('0x28')],'type':_0x3cdfd7[_0x4f26('0x29')]['key']};});_0x5351b7[_0x4f26('0x2a')]=_['map'](_0x4174eb,_0x4f26('0x24'));_0x5351b7['query']=_[_0x4f26('0x2b')](_0x3c396b[_0x4f26('0x2c')]);_0x5351b7[_0x4f26('0x2d')]=_['intersection'](_0x5351b7[_0x4f26('0x2a')],_0x5351b7[_0x4f26('0x2c')]);_0x4d210b[_0x4f26('0x2e')]=_[_0x4f26('0x2f')](_0x5351b7['model'],qs[_0x4f26('0x30')](_0x3c396b[_0x4f26('0x2c')][_0x4f26('0x30')]));_0x4d210b['attributes']=_0x4d210b[_0x4f26('0x2e')][_0x4f26('0x31')]?_0x4d210b[_0x4f26('0x2e')]:_0x5351b7['model'];if(!_0x3c396b['query'][_0x4f26('0x32')]('nolimit')){_0x4d210b[_0x4f26('0x1c')]=qs['limit'](_0x3c396b[_0x4f26('0x2c')][_0x4f26('0x1c')]);_0x4d210b[_0x4f26('0x19')]=qs['offset'](_0x3c396b[_0x4f26('0x2c')][_0x4f26('0x19')]);}_0x4d210b[_0x4f26('0x33')]=qs[_0x4f26('0x34')](_0x3c396b[_0x4f26('0x2c')][_0x4f26('0x34')]);_0x4d210b['where']=qs[_0x4f26('0x2d')](_['pick'](_0x3c396b[_0x4f26('0x2c')],_0x5351b7[_0x4f26('0x2d')]),_0x4174eb);if(_0x3c396b[_0x4f26('0x2c')]['filter']){_0x4d210b[_0x4f26('0x35')]=_[_0x4f26('0x36')](_0x4d210b[_0x4f26('0x35')],{'$or':_[_0x4f26('0x27')](_0x4174eb,function(_0x216f13){if(_0x216f13['type']!==_0x4f26('0x37')){var _0x4c9d81={};_0x4c9d81[_0x216f13['name']]={'$like':'%'+_0x3c396b[_0x4f26('0x2c')]['filter']+'%'};return _0x4c9d81;}})});}_0x4d210b=_[_0x4f26('0x36')]({},_0x4d210b,_0x3c396b[_0x4f26('0x38')]);var _0x5c8f5f={'where':_0x4d210b['where']};return db[_0x4f26('0x39')]['count'](_0x5c8f5f)[_0x4f26('0x22')](function(_0x2a9d2e){_0x4449e3[_0x4f26('0x1b')]=_0x2a9d2e;if(_0x3c396b[_0x4f26('0x2c')][_0x4f26('0x3a')]){_0x4d210b['include']=[{'all':!![]}];}return db[_0x4f26('0x39')]['findAll'](_0x4d210b);})[_0x4f26('0x22')](function(_0x3d4714){_0x4449e3[_0x4f26('0x3b')]=_0x3d4714;return _0x4449e3;})[_0x4f26('0x22')](respondWithFilteredResult(_0x5ce655,_0x4d210b))['catch'](handleError(_0x5ce655,null));};exports[_0x4f26('0x3c')]=function(_0x59a15d,_0x1e6752){var _0x58f222={'raw':!![],'where':{'id':_0x59a15d[_0x4f26('0x3d')]['id']}},_0x104cae={};_0x104cae[_0x4f26('0x2a')]=_['keys'](db[_0x4f26('0x39')][_0x4f26('0x3e')]);_0x104cae[_0x4f26('0x2c')]=_['keys'](_0x59a15d['query']);_0x104cae['filters']=_[_0x4f26('0x2f')](_0x104cae['model'],_0x104cae[_0x4f26('0x2c')]);_0x58f222['attributes']=_[_0x4f26('0x2f')](_0x104cae['model'],qs[_0x4f26('0x30')](_0x59a15d['query'][_0x4f26('0x30')]));_0x58f222[_0x4f26('0x2e')]=_0x58f222[_0x4f26('0x2e')][_0x4f26('0x31')]?_0x58f222[_0x4f26('0x2e')]:_0x104cae[_0x4f26('0x2a')];if(_0x59a15d[_0x4f26('0x2c')][_0x4f26('0x3a')]){_0x58f222['include']=[{'all':!![]}];}_0x58f222=_['merge']({},_0x58f222,_0x59a15d[_0x4f26('0x38')]);return db[_0x4f26('0x39')][_0x4f26('0x3f')](_0x58f222)[_0x4f26('0x22')](handleEntityNotFound(_0x1e6752,null))[_0x4f26('0x22')](respondWithResult(_0x1e6752,null))[_0x4f26('0x40')](handleError(_0x1e6752,null));};exports[_0x4f26('0x41')]=function(_0xabfad5,_0x1c277a){return db[_0x4f26('0x39')][_0x4f26('0x41')](_0xabfad5[_0x4f26('0x42')],{})['then'](respondWithResult(_0x1c277a,0xc9))[_0x4f26('0x40')](handleError(_0x1c277a,null));};exports[_0x4f26('0x43')]=function(_0x1e50c5,_0xebf86d){if(_0x1e50c5[_0x4f26('0x42')]['id']){delete _0x1e50c5[_0x4f26('0x42')]['id'];}return db[_0x4f26('0x39')]['find']({'where':{'id':_0x1e50c5[_0x4f26('0x3d')]['id']}})[_0x4f26('0x22')](handleEntityNotFound(_0xebf86d,null))[_0x4f26('0x22')](saveUpdates(_0x1e50c5[_0x4f26('0x42')],null))['then'](respondWithResult(_0xebf86d,null))['catch'](handleError(_0xebf86d,null));};exports[_0x4f26('0x21')]=function(_0x3bcd3b,_0x31db09){return db[_0x4f26('0x39')][_0x4f26('0x3f')]({'where':{'id':_0x3bcd3b['params']['id']}})[_0x4f26('0x22')](handleEntityNotFound(_0x31db09,null))[_0x4f26('0x22')](removeEntity(_0x31db09,null))['catch'](handleError(_0x31db09,null));}; \ No newline at end of file +var _0x3792=['stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','destroy','then'];(function(_0x2036e4,_0x2183d0){var _0x4eb9db=function(_0x4c1850){while(--_0x4c1850){_0x2036e4['push'](_0x2036e4['shift']());}};_0x4eb9db(++_0x2183d0);}(_0x3792,0xbe));var _0x2379=function(_0x1f752a,_0x5dba98){_0x1f752a=_0x1f752a-0x0;var _0x2f8b01=_0x3792[_0x1f752a];return _0x2f8b01;};'use strict';var emlformat=require(_0x2379('0x0'));var rimraf=require(_0x2379('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2379('0x2'));var rp=require(_0x2379('0x3'));var moment=require(_0x2379('0x4'));var BPromise=require(_0x2379('0x5'));var Mustache=require('mustache');var util=require(_0x2379('0x6'));var path=require(_0x2379('0x7'));var sox=require(_0x2379('0x8'));var csv=require(_0x2379('0x9'));var ejs=require(_0x2379('0xa'));var fs=require('fs');var fs_extra=require(_0x2379('0xb'));var _=require(_0x2379('0xc'));var squel=require(_0x2379('0xd'));var crypto=require(_0x2379('0xe'));var jsforce=require(_0x2379('0xf'));var deskjs=require(_0x2379('0x10'));var toCsv=require(_0x2379('0x9'));var querystring=require(_0x2379('0x11'));var Papa=require(_0x2379('0x12'));var Redis=require(_0x2379('0x13'));var authService=require(_0x2379('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2379('0x15'));var hardwareService=require(_0x2379('0x16'));var logger=require(_0x2379('0x17'))(_0x2379('0x18'));var utils=require(_0x2379('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2379('0x1a'));var db=require(_0x2379('0x1b'))['db'];function respondWithStatusCode(_0x5b04b0,_0x17a030){_0x17a030=_0x17a030||0xcc;return function(_0x66df59){if(_0x66df59){return _0x5b04b0[_0x2379('0x1c')](_0x17a030);}return _0x5b04b0['status'](_0x17a030)['end']();};}function respondWithResult(_0x4f25fd,_0x618c6a){_0x618c6a=_0x618c6a||0xc8;return function(_0x3c87ff){if(_0x3c87ff){return _0x4f25fd['status'](_0x618c6a)[_0x2379('0x1d')](_0x3c87ff);}};}function respondWithFilteredResult(_0x32b9b0,_0x59fef4){return function(_0x164395){if(_0x164395){var _0x3d78e0=typeof _0x59fef4[_0x2379('0x1e')]==='undefined'&&typeof _0x59fef4[_0x2379('0x1f')]===_0x2379('0x20');var _0x556875=_0x164395[_0x2379('0x21')];var _0x981b22=_0x3d78e0?0x0:_0x59fef4[_0x2379('0x1e')];var _0xa53ac6=_0x3d78e0?_0x164395[_0x2379('0x21')]:_0x59fef4[_0x2379('0x1e')]+_0x59fef4[_0x2379('0x1f')];var _0x28b049;if(_0xa53ac6>=_0x556875){_0xa53ac6=_0x556875;_0x28b049=0xc8;}else{_0x28b049=0xce;}_0x32b9b0[_0x2379('0x22')](_0x28b049);return _0x32b9b0[_0x2379('0x23')](_0x2379('0x24'),_0x981b22+'-'+_0xa53ac6+'/'+_0x556875)[_0x2379('0x1d')](_0x164395);}return null;};}function patchUpdates(_0x18f1dc){return function(_0x1c5ebc){try{jsonpatch[_0x2379('0x25')](_0x1c5ebc,_0x18f1dc,!![]);}catch(_0x3ecb22){return BPromise[_0x2379('0x26')](_0x3ecb22);}return _0x1c5ebc['save']();};}function saveUpdates(_0x1f40ef,_0x54e6f3){return function(_0x207f8d){if(_0x207f8d){return _0x207f8d['update'](_0x1f40ef)['then'](function(_0x281053){return _0x281053;});}return null;};}function removeEntity(_0x5499e4,_0x5c5475){return function(_0x4c17ee){if(_0x4c17ee){return _0x4c17ee[_0x2379('0x27')]()[_0x2379('0x28')](function(){_0x5499e4[_0x2379('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d68b4,_0x170223){return function(_0x424a7f){if(!_0x424a7f){_0x3d68b4[_0x2379('0x1c')](0x194);}return _0x424a7f;};}function handleError(_0x70416a,_0xb09ef3){_0xb09ef3=_0xb09ef3||0x1f4;return function(_0x3acc2b){logger['error'](_0x3acc2b[_0x2379('0x29')]);if(_0x3acc2b[_0x2379('0x2a')]){delete _0x3acc2b[_0x2379('0x2a')];}_0x70416a['status'](_0xb09ef3)[_0x2379('0x2b')](_0x3acc2b);};}exports[_0x2379('0x2c')]=function(_0x560190,_0x5db9e2){var _0x5278c1={},_0x5a633e={},_0xf964d8={'count':0x0,'rows':[]};var _0x4100b5=_[_0x2379('0x2d')](db[_0x2379('0x2e')][_0x2379('0x2f')],function(_0x52fd44){return{'name':_0x52fd44['fieldName'],'type':_0x52fd44[_0x2379('0x30')][_0x2379('0x31')]};});_0x5a633e[_0x2379('0x32')]=_[_0x2379('0x2d')](_0x4100b5,'name');_0x5a633e[_0x2379('0x33')]=_[_0x2379('0x34')](_0x560190['query']);_0x5a633e[_0x2379('0x35')]=_['intersection'](_0x5a633e[_0x2379('0x32')],_0x5a633e[_0x2379('0x33')]);_0x5278c1[_0x2379('0x36')]=_[_0x2379('0x37')](_0x5a633e[_0x2379('0x32')],qs[_0x2379('0x38')](_0x560190[_0x2379('0x33')]['fields']));_0x5278c1[_0x2379('0x36')]=_0x5278c1[_0x2379('0x36')][_0x2379('0x39')]?_0x5278c1['attributes']:_0x5a633e[_0x2379('0x32')];if(!_0x560190[_0x2379('0x33')][_0x2379('0x3a')]('nolimit')){_0x5278c1[_0x2379('0x1f')]=qs['limit'](_0x560190['query'][_0x2379('0x1f')]);_0x5278c1['offset']=qs[_0x2379('0x1e')](_0x560190[_0x2379('0x33')]['offset']);}_0x5278c1[_0x2379('0x3b')]=qs['sort'](_0x560190[_0x2379('0x33')]['sort']);_0x5278c1[_0x2379('0x3c')]=qs['filters'](_[_0x2379('0x3d')](_0x560190[_0x2379('0x33')],_0x5a633e[_0x2379('0x35')]),_0x4100b5);if(_0x560190[_0x2379('0x33')][_0x2379('0x3e')]){_0x5278c1[_0x2379('0x3c')]=_[_0x2379('0x3f')](_0x5278c1[_0x2379('0x3c')],{'$or':_[_0x2379('0x2d')](_0x4100b5,function(_0x436c33){if(_0x436c33['type']!==_0x2379('0x40')){var _0x429f77={};_0x429f77[_0x436c33['name']]={'$like':'%'+_0x560190['query'][_0x2379('0x3e')]+'%'};return _0x429f77;}})});}_0x5278c1=_['merge']({},_0x5278c1,_0x560190[_0x2379('0x41')]);var _0x3d0a38={'where':_0x5278c1[_0x2379('0x3c')]};return db[_0x2379('0x2e')]['count'](_0x3d0a38)[_0x2379('0x28')](function(_0xe18b4c){_0xf964d8[_0x2379('0x21')]=_0xe18b4c;if(_0x560190[_0x2379('0x33')]['includeAll']){_0x5278c1[_0x2379('0x42')]=[{'all':!![]}];}return db[_0x2379('0x2e')][_0x2379('0x43')](_0x5278c1);})[_0x2379('0x28')](function(_0x51f288){_0xf964d8[_0x2379('0x44')]=_0x51f288;return _0xf964d8;})[_0x2379('0x28')](respondWithFilteredResult(_0x5db9e2,_0x5278c1))['catch'](handleError(_0x5db9e2,null));};exports[_0x2379('0x45')]=function(_0x32f4c2,_0x1f3c9b){var _0x56bbd6={'raw':!![],'where':{'id':_0x32f4c2[_0x2379('0x46')]['id']}},_0x4d2822={};_0x4d2822[_0x2379('0x32')]=_[_0x2379('0x34')](db[_0x2379('0x2e')][_0x2379('0x2f')]);_0x4d2822[_0x2379('0x33')]=_[_0x2379('0x34')](_0x32f4c2['query']);_0x4d2822[_0x2379('0x35')]=_[_0x2379('0x37')](_0x4d2822[_0x2379('0x32')],_0x4d2822['query']);_0x56bbd6['attributes']=_[_0x2379('0x37')](_0x4d2822[_0x2379('0x32')],qs['fields'](_0x32f4c2['query']['fields']));_0x56bbd6[_0x2379('0x36')]=_0x56bbd6['attributes'][_0x2379('0x39')]?_0x56bbd6['attributes']:_0x4d2822[_0x2379('0x32')];if(_0x32f4c2[_0x2379('0x33')][_0x2379('0x47')]){_0x56bbd6[_0x2379('0x42')]=[{'all':!![]}];}_0x56bbd6=_['merge']({},_0x56bbd6,_0x32f4c2[_0x2379('0x41')]);return db['SquareMessage'][_0x2379('0x48')](_0x56bbd6)[_0x2379('0x28')](handleEntityNotFound(_0x1f3c9b,null))['then'](respondWithResult(_0x1f3c9b,null))[_0x2379('0x49')](handleError(_0x1f3c9b,null));};exports['create']=function(_0x3a9075,_0x299256){return db[_0x2379('0x2e')][_0x2379('0x4a')](_0x3a9075['body'],{})[_0x2379('0x28')](respondWithResult(_0x299256,0xc9))['catch'](handleError(_0x299256,null));};exports[_0x2379('0x4b')]=function(_0x3aaede,_0x3b7c0e){if(_0x3aaede[_0x2379('0x4c')]['id']){delete _0x3aaede[_0x2379('0x4c')]['id'];}return db[_0x2379('0x2e')][_0x2379('0x48')]({'where':{'id':_0x3aaede[_0x2379('0x46')]['id']}})[_0x2379('0x28')](handleEntityNotFound(_0x3b7c0e,null))[_0x2379('0x28')](saveUpdates(_0x3aaede[_0x2379('0x4c')],null))[_0x2379('0x28')](respondWithResult(_0x3b7c0e,null))['catch'](handleError(_0x3b7c0e,null));};exports[_0x2379('0x27')]=function(_0xacf252,_0x414dfd){return db[_0x2379('0x2e')]['find']({'where':{'id':_0xacf252['params']['id']}})[_0x2379('0x28')](handleEntityNotFound(_0x414dfd,null))['then'](removeEntity(_0x414dfd,null))[_0x2379('0x49')](handleError(_0x414dfd,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ef08c61..6fd797c 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 _0xb67e=['./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x112be8,_0x4220c7){var _0x40a380=function(_0x3d8c67){while(--_0x3d8c67){_0x112be8['push'](_0x112be8['shift']());}};_0x40a380(++_0x4220c7);}(_0xb67e,0xf4));var _0xeb67=function(_0x88d6bc,_0x404bb0){_0x88d6bc=_0x88d6bc-0x0;var _0xf3034=_0xb67e[_0x88d6bc];return _0xf3034;};'use strict';var _=require(_0xeb67('0x0'));var util=require(_0xeb67('0x1'));var logger=require(_0xeb67('0x2'))(_0xeb67('0x3'));var moment=require('moment');var BPromise=require(_0xeb67('0x4'));var rp=require(_0xeb67('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb67('0x6'));var config=require(_0xeb67('0x7'));var attributes=require(_0xeb67('0x8'));module['exports']=function(_0x192921,_0x37648c){return _0x192921[_0xeb67('0x9')](_0xeb67('0xa'),attributes,{'tableName':_0xeb67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c14=['SquareMessage','lodash','moment','bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports'];(function(_0x3eaa9e,_0x90fc49){var _0x2a7306=function(_0x5b7733){while(--_0x5b7733){_0x3eaa9e['push'](_0x3eaa9e['shift']());}};_0x2a7306(++_0x90fc49);}(_0x1c14,0x1d1));var _0x41c1=function(_0x155ab9,_0x38a250){_0x155ab9=_0x155ab9-0x0;var _0x24163b=_0x1c14[_0x155ab9];return _0x24163b;};'use strict';var _=require(_0x41c1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x41c1('0x1'));var BPromise=require(_0x41c1('0x2'));var rp=require(_0x41c1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41c1('0x4'));var attributes=require(_0x41c1('0x5'));module[_0x41c1('0x6')]=function(_0x3e5d96,_0x5be0d6){return _0x3e5d96['define'](_0x41c1('0x7'),attributes,{'tableName':'square_messages','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 faeb165..f0c403c 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 _0x65ca=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','randomstring'];(function(_0x43eba0,_0x59479f){var _0x47e7ce=function(_0x20e5d6){while(--_0x20e5d6){_0x43eba0['push'](_0x43eba0['shift']());}};_0x47e7ce(++_0x59479f);}(_0x65ca,0x15b));var _0xa65c=function(_0x31cae7,_0x297087){_0x31cae7=_0x31cae7-0x0;var _0x3f8521=_0x65ca[_0x31cae7];return _0x3f8521;};'use strict';var _=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var moment=require(_0xa65c('0x2'));var BPromise=require('bluebird');var rs=require(_0xa65c('0x3'));var fs=require('fs');var Redis=require(_0xa65c('0x4'));var db=require(_0xa65c('0x5'))['db'];var utils=require(_0xa65c('0x6'));var logger=require(_0xa65c('0x7'))(_0xa65c('0x8'));var config=require(_0xa65c('0x9'));var jayson=require(_0xa65c('0xa'));var client=jayson[_0xa65c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32682e,_0x35a6f8,_0x27a99f){return new BPromise(function(_0xd10be4,_0x367cab){return client[_0xa65c('0xc')](_0x32682e,_0x27a99f)[_0xa65c('0xd')](function(_0xc352d8){logger[_0xa65c('0xe')](_0xa65c('0xf'),_0x35a6f8,_0xa65c('0x10'));logger[_0xa65c('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x35a6f8,_0xa65c('0x10'),JSON['stringify'](_0xc352d8));if(_0xc352d8[_0xa65c('0x12')]){if(_0xc352d8[_0xa65c('0x12')]['code']===0x1f4){logger[_0xa65c('0x12')](_0xa65c('0xf'),_0x35a6f8,_0xc352d8['error'][_0xa65c('0x13')]);return _0x367cab(_0xc352d8[_0xa65c('0x12')][_0xa65c('0x13')]);}logger[_0xa65c('0x12')](_0xa65c('0xf'),_0x35a6f8,_0xc352d8[_0xa65c('0x12')]['message']);return _0xd10be4(_0xc352d8['error'][_0xa65c('0x13')]);}else{logger[_0xa65c('0xe')]('SquareMessage,\x20%s,\x20%s',_0x35a6f8,'request\x20sent');_0xd10be4(_0xc352d8['result']['message']);}})[_0xa65c('0x14')](function(_0x2825c3){logger[_0xa65c('0x12')](_0xa65c('0xf'),_0x35a6f8,_0x2825c3);_0x367cab(_0x2825c3);});});}exports[_0xa65c('0x15')]=function(_0x4fe16c){var _0x17398e=this;return new Promise(function(_0x48c7b1,_0x45006b){return db[_0xa65c('0x16')][_0xa65c('0x17')](_0x4fe16c[_0xa65c('0x18')],{'raw':_0x4fe16c[_0xa65c('0x19')]?_0x4fe16c[_0xa65c('0x19')][_0xa65c('0x1a')]===undefined?!![]:![]:!![]})[_0xa65c('0xd')](function(_0x9b48a8){logger[_0xa65c('0xe')]('CreateSquareMessage',_0x4fe16c);logger['debug'](_0xa65c('0x15'),_0x4fe16c,JSON['stringify'](_0x9b48a8));_0x48c7b1(_0x9b48a8);})[_0xa65c('0x14')](function(_0x436f5b){logger[_0xa65c('0x12')]('CreateSquareMessage',_0x436f5b[_0xa65c('0x13')],_0x4fe16c);_0x45006b(_0x17398e['error'](0x1f4,_0x436f5b[_0xa65c('0x13')]));});});}; \ No newline at end of file +var _0xe7ce=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x528e34,_0x49857e){var _0x6a2744=function(_0x437f40){while(--_0x437f40){_0x528e34['push'](_0x528e34['shift']());}};_0x6a2744(++_0x49857e);}(_0xe7ce,0x1a1));var _0xee7c=function(_0x7d4f37,_0x273c08){_0x7d4f37=_0x7d4f37-0x0;var _0x2d6ba9=_0xe7ce[_0x7d4f37];return _0x2d6ba9;};'use strict';var _=require(_0xee7c('0x0'));var util=require('util');var moment=require(_0xee7c('0x1'));var BPromise=require(_0xee7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7c('0x3'));var db=require(_0xee7c('0x4'))['db'];var utils=require(_0xee7c('0x5'));var logger=require(_0xee7c('0x6'))('rpc');var config=require(_0xee7c('0x7'));var jayson=require(_0xee7c('0x8'));var client=jayson[_0xee7c('0x9')][_0xee7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x233107,_0x341404,_0x42de3d){return new BPromise(function(_0xd1a69d,_0xdc2370){return client[_0xee7c('0xb')](_0x233107,_0x42de3d)[_0xee7c('0xc')](function(_0x998936){logger[_0xee7c('0xd')]('SquareMessage,\x20%s,\x20%s',_0x341404,_0xee7c('0xe'));logger['debug'](_0xee7c('0xf'),_0x341404,'request\x20sent',JSON[_0xee7c('0x10')](_0x998936));if(_0x998936[_0xee7c('0x11')]){if(_0x998936[_0xee7c('0x11')]['code']===0x1f4){logger[_0xee7c('0x11')](_0xee7c('0x12'),_0x341404,_0x998936[_0xee7c('0x11')]['message']);return _0xdc2370(_0x998936[_0xee7c('0x11')]['message']);}logger[_0xee7c('0x11')](_0xee7c('0x12'),_0x341404,_0x998936[_0xee7c('0x11')][_0xee7c('0x13')]);return _0xd1a69d(_0x998936[_0xee7c('0x11')]['message']);}else{logger['info'](_0xee7c('0x12'),_0x341404,'request\x20sent');_0xd1a69d(_0x998936[_0xee7c('0x14')]['message']);}})[_0xee7c('0x15')](function(_0x4fdcad){logger[_0xee7c('0x11')](_0xee7c('0x12'),_0x341404,_0x4fdcad);_0xdc2370(_0x4fdcad);});});}exports[_0xee7c('0x16')]=function(_0x26f31d){var _0x49964d=this;return new Promise(function(_0xcdf683,_0x2d0048){return db['SquareMessage'][_0xee7c('0x17')](_0x26f31d[_0xee7c('0x18')],{'raw':_0x26f31d[_0xee7c('0x19')]?_0x26f31d[_0xee7c('0x19')][_0xee7c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5d6913){logger[_0xee7c('0xd')](_0xee7c('0x16'),_0x26f31d);logger['debug'](_0xee7c('0x16'),_0x26f31d,JSON['stringify'](_0x5d6913));_0xcdf683(_0x5d6913);})[_0xee7c('0x15')](function(_0x282796){logger[_0xee7c('0x11')](_0xee7c('0x16'),_0x282796[_0xee7c('0x13')],_0x26f31d);_0x2d0048(_0x49964d[_0xee7c('0x11')](0x1f4,_0x282796[_0xee7c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 81a00e3..ffb6d66 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 _0xe5fe=['show','/:id/test','test','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x1e1933,_0x44ad93){var _0x5e184e=function(_0x407e5d){while(--_0x407e5d){_0x1e1933['push'](_0x1e1933['shift']());}};_0x5e184e(++_0x44ad93);}(_0xe5fe,0xc5));var _0xee5f=function(_0x19e9ed,_0x45035f){_0x19e9ed=_0x19e9ed-0x0;var _0xd9d1c1=_0xe5fe[_0x19e9ed];return _0xd9d1c1;};'use strict';var multer=require('multer');var util=require(_0xee5f('0x0'));var path=require(_0xee5f('0x1'));var timeout=require(_0xee5f('0x2'));var express=require(_0xee5f('0x3'));var router=express[_0xee5f('0x4')]();var fs_extra=require(_0xee5f('0x5'));var auth=require(_0xee5f('0x6'));var interaction=require(_0xee5f('0x7'));var config=require('../../config/environment');var controller=require(_0xee5f('0x8'));router[_0xee5f('0x9')]('/',auth[_0xee5f('0xa')](),controller[_0xee5f('0xb')]);router[_0xee5f('0x9')](_0xee5f('0xc'),auth[_0xee5f('0xa')](),controller[_0xee5f('0xd')]);router[_0xee5f('0x9')](_0xee5f('0xe'),auth[_0xee5f('0xa')](),timeout('15s'),controller[_0xee5f('0xf')]);router[_0xee5f('0x10')]('/',auth['isAuthenticated'](),controller[_0xee5f('0x11')]);router[_0xee5f('0x12')](_0xee5f('0xc'),auth[_0xee5f('0xa')](),controller['update']);router[_0xee5f('0x13')]('/:id',auth[_0xee5f('0xa')](),controller[_0xee5f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8367=['15s','test','post','create','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test'];(function(_0x451563,_0x1d02c6){var _0x1bff88=function(_0x4bcb4b){while(--_0x4bcb4b){_0x451563['push'](_0x451563['shift']());}};_0x1bff88(++_0x1d02c6);}(_0x8367,0xb6));var _0x7836=function(_0x12b830,_0xd66540){_0x12b830=_0x12b830-0x0;var _0x261dc4=_0x8367[_0x12b830];return _0x261dc4;};'use strict';var multer=require(_0x7836('0x0'));var util=require(_0x7836('0x1'));var path=require(_0x7836('0x2'));var timeout=require('connect-timeout');var express=require(_0x7836('0x3'));var router=express[_0x7836('0x4')]();var fs_extra=require(_0x7836('0x5'));var auth=require(_0x7836('0x6'));var interaction=require(_0x7836('0x7'));var config=require(_0x7836('0x8'));var controller=require(_0x7836('0x9'));router[_0x7836('0xa')]('/',auth[_0x7836('0xb')](),controller[_0x7836('0xc')]);router[_0x7836('0xa')](_0x7836('0xd'),auth[_0x7836('0xb')](),controller[_0x7836('0xe')]);router[_0x7836('0xa')](_0x7836('0xf'),auth[_0x7836('0xb')](),timeout(_0x7836('0x10')),controller[_0x7836('0x11')]);router[_0x7836('0x12')]('/',auth['isAuthenticated'](),controller[_0x7836('0x13')]);router['put'](_0x7836('0xd'),auth[_0x7836('0xb')](),controller[_0x7836('0x14')]);router['delete'](_0x7836('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x7836('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8348513..24821a8 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 _0x1497=['name','sequelize','STRING'];(function(_0x100c88,_0x4cd4e3){var _0x6bda57=function(_0x1d3348){while(--_0x1d3348){_0x100c88['push'](_0x100c88['shift']());}};_0x6bda57(++_0x4cd4e3);}(_0x1497,0x15a));var _0x7149=function(_0x438e98,_0x3369ba){_0x438e98=_0x438e98-0x0;var _0x495b67=_0x1497[_0x438e98];return _0x495b67;};'use strict';var Sequelize=require(_0x7149('0x0'));module['exports']={'name':{'type':Sequelize[_0x7149('0x1')],'unique':_0x7149('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7149('0x1')]},'description':{'type':Sequelize[_0x7149('0x1')]}}; \ No newline at end of file +var _0x7840=['name','STRING','sequelize','exports'];(function(_0x5bc27a,_0x32e2d1){var _0x2c8a4d=function(_0x1a7dd9){while(--_0x1a7dd9){_0x5bc27a['push'](_0x5bc27a['shift']());}};_0x2c8a4d(++_0x32e2d1);}(_0x7840,0x1c6));var _0x0784=function(_0x571c6e,_0x2d8f3d){_0x571c6e=_0x571c6e-0x0;var _0x525d96=_0x7840[_0x571c6e];return _0x525d96;};'use strict';var Sequelize=require(_0x0784('0x0'));module[_0x0784('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0784('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0784('0x3')]},'description':{'type':Sequelize[_0x0784('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index fdc777e..f3efc5d 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 _0x7f97=['../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','then','get','ODBC','UserProfileResource','destroy','end','error','stack','send','index','map','fieldName','name','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','openSync','dsn','closeSync','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3e28be,_0x70d30f){var _0xcba72d=function(_0x3d2b8b){while(--_0x3d2b8b){_0x3e28be['push'](_0x3e28be['shift']());}};_0xcba72d(++_0x70d30f);}(_0x7f97,0x141));var _0x77f9=function(_0x54206a,_0xc5f2a3){_0x54206a=_0x54206a-0x0;var _0x9aacc0=_0x7f97[_0x54206a];return _0x9aacc0;};'use strict';var emlformat=require(_0x77f9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77f9('0x1'));var rp=require(_0x77f9('0x2'));var moment=require(_0x77f9('0x3'));var BPromise=require(_0x77f9('0x4'));var Mustache=require('mustache');var util=require(_0x77f9('0x5'));var path=require(_0x77f9('0x6'));var sox=require(_0x77f9('0x7'));var csv=require(_0x77f9('0x8'));var ejs=require(_0x77f9('0x9'));var fs=require('fs');var fs_extra=require(_0x77f9('0xa'));var _=require('lodash');var squel=require(_0x77f9('0xb'));var crypto=require(_0x77f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x77f9('0xd'));var toCsv=require(_0x77f9('0x8'));var querystring=require('querystring');var Papa=require(_0x77f9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x77f9('0xf'));var as=require(_0x77f9('0x10'));var hardwareService=require(_0x77f9('0x11'));var logger=require(_0x77f9('0x12'))(_0x77f9('0x13'));var utils=require(_0x77f9('0x14'));var config=require(_0x77f9('0x15'));var licenseUtil=require(_0x77f9('0x16'));var db=require(_0x77f9('0x17'))['db'];function respondWithStatusCode(_0x3d1260,_0x35e6ad){_0x35e6ad=_0x35e6ad||0xcc;return function(_0x2d0fdc){if(_0x2d0fdc){return _0x3d1260[_0x77f9('0x18')](_0x35e6ad);}return _0x3d1260[_0x77f9('0x19')](_0x35e6ad)['end']();};}function respondWithResult(_0x205615,_0x37a78f){_0x37a78f=_0x37a78f||0xc8;return function(_0x1d3c21){if(_0x1d3c21){return _0x205615[_0x77f9('0x19')](_0x37a78f)[_0x77f9('0x1a')](_0x1d3c21);}};}function respondWithFilteredResult(_0xdb749,_0x247bf6){return function(_0x502411){if(_0x502411){var _0xbdc097=typeof _0x247bf6['offset']===_0x77f9('0x1b')&&typeof _0x247bf6[_0x77f9('0x1c')]===_0x77f9('0x1b');var _0x17488d=_0x502411['count'];var _0x4758b7=_0xbdc097?0x0:_0x247bf6['offset'];var _0x2704af=_0xbdc097?_0x502411[_0x77f9('0x1d')]:_0x247bf6[_0x77f9('0x1e')]+_0x247bf6[_0x77f9('0x1c')];var _0x3414c7;if(_0x2704af>=_0x17488d){_0x2704af=_0x17488d;_0x3414c7=0xc8;}else{_0x3414c7=0xce;}_0xdb749['status'](_0x3414c7);return _0xdb749[_0x77f9('0x1f')]('Content-Range',_0x4758b7+'-'+_0x2704af+'/'+_0x17488d)[_0x77f9('0x1a')](_0x502411);}return null;};}function patchUpdates(_0x54307b){return function(_0x484759){try{jsonpatch['apply'](_0x484759,_0x54307b,!![]);}catch(_0xc2ef7f){return BPromise[_0x77f9('0x20')](_0xc2ef7f);}return _0x484759[_0x77f9('0x21')]();};}function saveUpdates(_0x44268d,_0x184333){return function(_0x5a4677){if(_0x5a4677){return _0x5a4677[_0x77f9('0x22')](_0x44268d)['then'](function(_0x353b17){return _0x353b17;});}return null;};}function removeEntity(_0x5b4ba9,_0x50ea8b){return function(_0x1849c4){if(_0x1849c4){return _0x1849c4['destroy']()[_0x77f9('0x23')](function(){var _0x3f8a5a=_0x1849c4[_0x77f9('0x24')]({'plain':!![]});var _0x558767=_0x77f9('0x25');return db[_0x77f9('0x26')][_0x77f9('0x27')]({'where':{'type':_0x558767,'resourceId':_0x3f8a5a['id']}})[_0x77f9('0x23')](function(){return _0x1849c4;});})[_0x77f9('0x23')](function(){_0x5b4ba9[_0x77f9('0x19')](0xcc)[_0x77f9('0x28')]();});}};}function handleEntityNotFound(_0x36c1ef,_0x297977){return function(_0x580622){if(!_0x580622){_0x36c1ef[_0x77f9('0x18')](0x194);}return _0x580622;};}function handleError(_0x1516cf,_0x315209){_0x315209=_0x315209||0x1f4;return function(_0x233bba){logger[_0x77f9('0x29')](_0x233bba[_0x77f9('0x2a')]);if(_0x233bba['name']){delete _0x233bba['name'];}_0x1516cf['status'](_0x315209)[_0x77f9('0x2b')](_0x233bba);};}exports[_0x77f9('0x2c')]=function(_0x508d9c,_0x1f38d3){var _0x221986={},_0x3ee5b1={},_0x239333={'count':0x0,'rows':[]};var _0x353080=_[_0x77f9('0x2d')](db['SquareOdbc']['rawAttributes'],function(_0x3454d3){return{'name':_0x3454d3[_0x77f9('0x2e')],'type':_0x3454d3['type']['key']};});_0x3ee5b1['model']=_[_0x77f9('0x2d')](_0x353080,_0x77f9('0x2f'));_0x3ee5b1['query']=_[_0x77f9('0x30')](_0x508d9c[_0x77f9('0x31')]);_0x3ee5b1[_0x77f9('0x32')]=_[_0x77f9('0x33')](_0x3ee5b1['model'],_0x3ee5b1[_0x77f9('0x31')]);_0x221986[_0x77f9('0x34')]=_[_0x77f9('0x33')](_0x3ee5b1['model'],qs['fields'](_0x508d9c[_0x77f9('0x31')][_0x77f9('0x35')]));_0x221986['attributes']=_0x221986[_0x77f9('0x34')]['length']?_0x221986['attributes']:_0x3ee5b1[_0x77f9('0x36')];if(!_0x508d9c['query'][_0x77f9('0x37')]('nolimit')){_0x221986[_0x77f9('0x1c')]=qs['limit'](_0x508d9c[_0x77f9('0x31')][_0x77f9('0x1c')]);_0x221986[_0x77f9('0x1e')]=qs[_0x77f9('0x1e')](_0x508d9c['query']['offset']);}_0x221986[_0x77f9('0x38')]=qs[_0x77f9('0x39')](_0x508d9c[_0x77f9('0x31')][_0x77f9('0x39')]);_0x221986[_0x77f9('0x3a')]=qs[_0x77f9('0x32')](_[_0x77f9('0x3b')](_0x508d9c[_0x77f9('0x31')],_0x3ee5b1[_0x77f9('0x32')]),_0x353080);if(_0x508d9c[_0x77f9('0x31')][_0x77f9('0x3c')]){_0x221986[_0x77f9('0x3a')]=_[_0x77f9('0x3d')](_0x221986[_0x77f9('0x3a')],{'$or':_[_0x77f9('0x2d')](_0x353080,function(_0x36a96c){if(_0x36a96c['type']!==_0x77f9('0x3e')){var _0x59acd5={};_0x59acd5[_0x36a96c[_0x77f9('0x2f')]]={'$like':'%'+_0x508d9c['query'][_0x77f9('0x3c')]+'%'};return _0x59acd5;}})});}_0x221986=_[_0x77f9('0x3d')]({},_0x221986,_0x508d9c[_0x77f9('0x3f')]);var _0x31d461={'where':_0x221986[_0x77f9('0x3a')]};return db[_0x77f9('0x40')][_0x77f9('0x1d')](_0x31d461)[_0x77f9('0x23')](function(_0x42df15){_0x239333[_0x77f9('0x1d')]=_0x42df15;if(_0x508d9c[_0x77f9('0x31')]['includeAll']){_0x221986[_0x77f9('0x41')]=[{'all':!![]}];}return db[_0x77f9('0x40')][_0x77f9('0x42')](_0x221986);})['then'](function(_0x1a6d0a){_0x239333[_0x77f9('0x43')]=_0x1a6d0a;return _0x239333;})[_0x77f9('0x23')](respondWithFilteredResult(_0x1f38d3,_0x221986))[_0x77f9('0x44')](handleError(_0x1f38d3,null));};exports[_0x77f9('0x45')]=function(_0x53c066,_0x3b151d){var _0xbd1c6b={'raw':!![],'where':{'id':_0x53c066['params']['id']}},_0x14f713={};_0x14f713[_0x77f9('0x36')]=_[_0x77f9('0x30')](db['SquareOdbc'][_0x77f9('0x46')]);_0x14f713['query']=_[_0x77f9('0x30')](_0x53c066[_0x77f9('0x31')]);_0x14f713[_0x77f9('0x32')]=_[_0x77f9('0x33')](_0x14f713[_0x77f9('0x36')],_0x14f713['query']);_0xbd1c6b[_0x77f9('0x34')]=_['intersection'](_0x14f713[_0x77f9('0x36')],qs[_0x77f9('0x35')](_0x53c066[_0x77f9('0x31')][_0x77f9('0x35')]));_0xbd1c6b[_0x77f9('0x34')]=_0xbd1c6b[_0x77f9('0x34')]['length']?_0xbd1c6b[_0x77f9('0x34')]:_0x14f713[_0x77f9('0x36')];if(_0x53c066[_0x77f9('0x31')][_0x77f9('0x47')]){_0xbd1c6b[_0x77f9('0x41')]=[{'all':!![]}];}_0xbd1c6b=_[_0x77f9('0x3d')]({},_0xbd1c6b,_0x53c066[_0x77f9('0x3f')]);return db['SquareOdbc'][_0x77f9('0x48')](_0xbd1c6b)['then'](handleEntityNotFound(_0x3b151d,null))['then'](respondWithResult(_0x3b151d,null))['catch'](handleError(_0x3b151d,null));};exports[_0x77f9('0x49')]=function(_0x5984fb,_0x8f35e0){return db[_0x77f9('0x40')][_0x77f9('0x49')](_0x5984fb[_0x77f9('0x4a')],{})[_0x77f9('0x23')](function(_0x287612){var _0x4d8526=_0x5984fb['user']['get']({'plain':!![]});if(!_0x4d8526)throw new Error(_0x77f9('0x4b'));if(_0x4d8526['role']===_0x77f9('0x4c')){var _0x35d594=_0x287612[_0x77f9('0x24')]({'plain':!![]});var _0x43a88b=_0x77f9('0x25');return db[_0x77f9('0x4d')]['find']({'where':{'name':_0x43a88b,'userProfileId':_0x4d8526[_0x77f9('0x4e')]},'raw':!![]})[_0x77f9('0x23')](function(_0xc68442){if(_0xc68442&&_0xc68442[_0x77f9('0x4f')]===0x0){return db[_0x77f9('0x26')][_0x77f9('0x49')]({'name':_0x35d594[_0x77f9('0x2f')],'resourceId':_0x35d594['id'],'type':_0xc68442[_0x77f9('0x2f')],'sectionId':_0xc68442['id']},{})[_0x77f9('0x23')](function(){return _0x287612;});}else{return _0x287612;}})[_0x77f9('0x44')](function(_0x396ed5){logger['error'](_0x77f9('0x50'),_0x396ed5);throw _0x396ed5;});}return _0x287612;})[_0x77f9('0x23')](respondWithResult(_0x8f35e0,0xc9))[_0x77f9('0x44')](handleError(_0x8f35e0,null));};exports['update']=function(_0x1c2e55,_0x4688ac){if(_0x1c2e55[_0x77f9('0x4a')]['id']){delete _0x1c2e55['body']['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x1c2e55[_0x77f9('0x51')]['id']}})[_0x77f9('0x23')](handleEntityNotFound(_0x4688ac,null))[_0x77f9('0x23')](saveUpdates(_0x1c2e55['body'],null))[_0x77f9('0x23')](respondWithResult(_0x4688ac,null))[_0x77f9('0x44')](handleError(_0x4688ac,null));};exports[_0x77f9('0x27')]=function(_0x9665ab,_0x4fd1d6){return db[_0x77f9('0x40')][_0x77f9('0x48')]({'where':{'id':_0x9665ab[_0x77f9('0x51')]['id']}})[_0x77f9('0x23')](handleEntityNotFound(_0x4fd1d6,null))[_0x77f9('0x23')](removeEntity(_0x4fd1d6,null))[_0x77f9('0x44')](handleError(_0x4fd1d6,null));};exports[_0x77f9('0x52')]=function(_0x3ca1a7,_0xb33ee1,_0x37e6a5){var _0x10aa4a;return db[_0x77f9('0x40')][_0x77f9('0x48')]({'where':{'id':_0x3ca1a7['params']['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0xb33ee1,null))[_0x77f9('0x23')](function(_0x3fc9f4){if(_0x3fc9f4){var _0x1e5840=require('odbc')();_0x1e5840[_0x77f9('0x53')](_0x3fc9f4[_0x77f9('0x54')]);_0x1e5840[_0x77f9('0x55')]();return _0x3fc9f4;}})[_0x77f9('0x23')](respondWithResult(_0xb33ee1,null))['catch'](handleError(_0xb33ee1,null));}; \ No newline at end of file +var _0x92f3=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','error','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','intersection','fields','query','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','include','show','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','test','openSync','dsn','closeSync','rimraf','request-promise','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x495531,_0x34e322){var _0x1a9c4f=function(_0x525ac4){while(--_0x525ac4){_0x495531['push'](_0x495531['shift']());}};_0x1a9c4f(++_0x34e322);}(_0x92f3,0x13e));var _0x392f=function(_0x39d839,_0x5d7c6e){_0x39d839=_0x39d839-0x0;var _0x33b598=_0x92f3[_0x39d839];return _0x33b598;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x392f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x392f('0x1'));var moment=require('moment');var BPromise=require(_0x392f('0x2'));var Mustache=require('mustache');var util=require(_0x392f('0x3'));var path=require(_0x392f('0x4'));var sox=require(_0x392f('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x392f('0x6'));var squel=require(_0x392f('0x7'));var crypto=require('crypto');var jsforce=require(_0x392f('0x8'));var deskjs=require(_0x392f('0x9'));var toCsv=require(_0x392f('0xa'));var querystring=require(_0x392f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x392f('0xc'));var qs=require(_0x392f('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x392f('0xe'));var logger=require(_0x392f('0xf'))(_0x392f('0x10'));var utils=require(_0x392f('0x11'));var config=require(_0x392f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x392f('0x13'))['db'];function respondWithStatusCode(_0x5cdf3f,_0x1f44d4){_0x1f44d4=_0x1f44d4||0xcc;return function(_0x48fa6c){if(_0x48fa6c){return _0x5cdf3f[_0x392f('0x14')](_0x1f44d4);}return _0x5cdf3f[_0x392f('0x15')](_0x1f44d4)['end']();};}function respondWithResult(_0x36ba80,_0x31867f){_0x31867f=_0x31867f||0xc8;return function(_0x4c2bd1){if(_0x4c2bd1){return _0x36ba80[_0x392f('0x15')](_0x31867f)['json'](_0x4c2bd1);}};}function respondWithFilteredResult(_0x1febbd,_0x4a1b60){return function(_0x3cec5f){if(_0x3cec5f){var _0x12f944=typeof _0x4a1b60['offset']===_0x392f('0x16')&&typeof _0x4a1b60['limit']===_0x392f('0x16');var _0x3bee10=_0x3cec5f[_0x392f('0x17')];var _0x55b23f=_0x12f944?0x0:_0x4a1b60[_0x392f('0x18')];var _0x439fe1=_0x12f944?_0x3cec5f[_0x392f('0x17')]:_0x4a1b60[_0x392f('0x18')]+_0x4a1b60[_0x392f('0x19')];var _0x1eb185;if(_0x439fe1>=_0x3bee10){_0x439fe1=_0x3bee10;_0x1eb185=0xc8;}else{_0x1eb185=0xce;}_0x1febbd[_0x392f('0x15')](_0x1eb185);return _0x1febbd[_0x392f('0x1a')](_0x392f('0x1b'),_0x55b23f+'-'+_0x439fe1+'/'+_0x3bee10)['json'](_0x3cec5f);}return null;};}function patchUpdates(_0x3d976e){return function(_0x10921e){try{jsonpatch[_0x392f('0x1c')](_0x10921e,_0x3d976e,!![]);}catch(_0x713e11){return BPromise[_0x392f('0x1d')](_0x713e11);}return _0x10921e[_0x392f('0x1e')]();};}function saveUpdates(_0xb0165e,_0x39925d){return function(_0x496b8a){if(_0x496b8a){return _0x496b8a[_0x392f('0x1f')](_0xb0165e)['then'](function(_0x4b92d4){return _0x4b92d4;});}return null;};}function removeEntity(_0x131645,_0x354ad5){return function(_0x198244){if(_0x198244){return _0x198244['destroy']()[_0x392f('0x20')](function(){var _0x1ef087=_0x198244[_0x392f('0x21')]({'plain':!![]});var _0x77e6e6=_0x392f('0x22');return db[_0x392f('0x23')]['destroy']({'where':{'type':_0x77e6e6,'resourceId':_0x1ef087['id']}})[_0x392f('0x20')](function(){return _0x198244;});})[_0x392f('0x20')](function(){_0x131645[_0x392f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dfbca,_0x2dc0c7){return function(_0x4194ec){if(!_0x4194ec){_0x3dfbca[_0x392f('0x14')](0x194);}return _0x4194ec;};}function handleError(_0x372ad8,_0x90d4f9){_0x90d4f9=_0x90d4f9||0x1f4;return function(_0x15101c){logger[_0x392f('0x24')](_0x15101c[_0x392f('0x25')]);if(_0x15101c['name']){delete _0x15101c['name'];}_0x372ad8[_0x392f('0x15')](_0x90d4f9)[_0x392f('0x26')](_0x15101c);};}exports[_0x392f('0x27')]=function(_0x24c409,_0x559aec){var _0x1c63a3={},_0x2e986e={},_0xb907df={'count':0x0,'rows':[]};var _0x157759=_[_0x392f('0x28')](db[_0x392f('0x29')][_0x392f('0x2a')],function(_0x5a0f1c){return{'name':_0x5a0f1c[_0x392f('0x2b')],'type':_0x5a0f1c[_0x392f('0x2c')][_0x392f('0x2d')]};});_0x2e986e[_0x392f('0x2e')]=_[_0x392f('0x28')](_0x157759,'name');_0x2e986e['query']=_[_0x392f('0x2f')](_0x24c409['query']);_0x2e986e['filters']=_[_0x392f('0x30')](_0x2e986e[_0x392f('0x2e')],_0x2e986e['query']);_0x1c63a3['attributes']=_[_0x392f('0x30')](_0x2e986e[_0x392f('0x2e')],qs[_0x392f('0x31')](_0x24c409[_0x392f('0x32')][_0x392f('0x31')]));_0x1c63a3[_0x392f('0x33')]=_0x1c63a3[_0x392f('0x33')]['length']?_0x1c63a3['attributes']:_0x2e986e['model'];if(!_0x24c409[_0x392f('0x32')][_0x392f('0x34')](_0x392f('0x35'))){_0x1c63a3[_0x392f('0x19')]=qs['limit'](_0x24c409['query'][_0x392f('0x19')]);_0x1c63a3[_0x392f('0x18')]=qs['offset'](_0x24c409[_0x392f('0x32')][_0x392f('0x18')]);}_0x1c63a3[_0x392f('0x36')]=qs[_0x392f('0x37')](_0x24c409[_0x392f('0x32')]['sort']);_0x1c63a3[_0x392f('0x38')]=qs[_0x392f('0x39')](_[_0x392f('0x3a')](_0x24c409[_0x392f('0x32')],_0x2e986e[_0x392f('0x39')]),_0x157759);if(_0x24c409[_0x392f('0x32')]['filter']){_0x1c63a3[_0x392f('0x38')]=_[_0x392f('0x3b')](_0x1c63a3['where'],{'$or':_[_0x392f('0x28')](_0x157759,function(_0x166545){if(_0x166545[_0x392f('0x2c')]!=='VIRTUAL'){var _0x1315d7={};_0x1315d7[_0x166545['name']]={'$like':'%'+_0x24c409[_0x392f('0x32')][_0x392f('0x3c')]+'%'};return _0x1315d7;}})});}_0x1c63a3=_[_0x392f('0x3b')]({},_0x1c63a3,_0x24c409[_0x392f('0x3d')]);var _0x2f8000={'where':_0x1c63a3[_0x392f('0x38')]};return db['SquareOdbc']['count'](_0x2f8000)[_0x392f('0x20')](function(_0x48632c){_0xb907df[_0x392f('0x17')]=_0x48632c;if(_0x24c409['query']['includeAll']){_0x1c63a3[_0x392f('0x3e')]=[{'all':!![]}];}return db[_0x392f('0x29')]['findAll'](_0x1c63a3);})[_0x392f('0x20')](function(_0x55697c){_0xb907df['rows']=_0x55697c;return _0xb907df;})[_0x392f('0x20')](respondWithFilteredResult(_0x559aec,_0x1c63a3))['catch'](handleError(_0x559aec,null));};exports[_0x392f('0x3f')]=function(_0x4493e2,_0x143080){var _0xde9bfb={'raw':!![],'where':{'id':_0x4493e2['params']['id']}},_0x1e8d3d={};_0x1e8d3d[_0x392f('0x2e')]=_[_0x392f('0x2f')](db[_0x392f('0x29')][_0x392f('0x2a')]);_0x1e8d3d[_0x392f('0x32')]=_['keys'](_0x4493e2['query']);_0x1e8d3d[_0x392f('0x39')]=_[_0x392f('0x30')](_0x1e8d3d[_0x392f('0x2e')],_0x1e8d3d[_0x392f('0x32')]);_0xde9bfb[_0x392f('0x33')]=_[_0x392f('0x30')](_0x1e8d3d['model'],qs[_0x392f('0x31')](_0x4493e2[_0x392f('0x32')]['fields']));_0xde9bfb[_0x392f('0x33')]=_0xde9bfb[_0x392f('0x33')][_0x392f('0x40')]?_0xde9bfb[_0x392f('0x33')]:_0x1e8d3d['model'];if(_0x4493e2['query'][_0x392f('0x41')]){_0xde9bfb[_0x392f('0x3e')]=[{'all':!![]}];}_0xde9bfb=_[_0x392f('0x3b')]({},_0xde9bfb,_0x4493e2[_0x392f('0x3d')]);return db[_0x392f('0x29')][_0x392f('0x42')](_0xde9bfb)[_0x392f('0x20')](handleEntityNotFound(_0x143080,null))[_0x392f('0x20')](respondWithResult(_0x143080,null))['catch'](handleError(_0x143080,null));};exports[_0x392f('0x43')]=function(_0x4530d3,_0x5a046c){return db[_0x392f('0x29')][_0x392f('0x43')](_0x4530d3[_0x392f('0x44')],{})[_0x392f('0x20')](function(_0xdcf1cd){var _0xf5b508=_0x4530d3[_0x392f('0x45')]['get']({'plain':!![]});if(!_0xf5b508)throw new Error(_0x392f('0x46'));if(_0xf5b508[_0x392f('0x47')]==='user'){var _0x3d0895=_0xdcf1cd['get']({'plain':!![]});var _0x260927='ODBC';return db[_0x392f('0x48')][_0x392f('0x42')]({'where':{'name':_0x260927,'userProfileId':_0xf5b508[_0x392f('0x49')]},'raw':!![]})[_0x392f('0x20')](function(_0x796cd7){if(_0x796cd7&&_0x796cd7['autoAssociation']===0x0){return db[_0x392f('0x23')][_0x392f('0x43')]({'name':_0x3d0895[_0x392f('0x4a')],'resourceId':_0x3d0895['id'],'type':_0x796cd7[_0x392f('0x4a')],'sectionId':_0x796cd7['id']},{})[_0x392f('0x20')](function(){return _0xdcf1cd;});}else{return _0xdcf1cd;}})[_0x392f('0x4b')](function(_0x4d18d5){logger[_0x392f('0x24')](_0x392f('0x4c'),_0x4d18d5);throw _0x4d18d5;});}return _0xdcf1cd;})[_0x392f('0x20')](respondWithResult(_0x5a046c,0xc9))[_0x392f('0x4b')](handleError(_0x5a046c,null));};exports[_0x392f('0x1f')]=function(_0x3a91a3,_0x20c62e){if(_0x3a91a3[_0x392f('0x44')]['id']){delete _0x3a91a3[_0x392f('0x44')]['id'];}return db[_0x392f('0x29')][_0x392f('0x42')]({'where':{'id':_0x3a91a3['params']['id']}})[_0x392f('0x20')](handleEntityNotFound(_0x20c62e,null))[_0x392f('0x20')](saveUpdates(_0x3a91a3[_0x392f('0x44')],null))[_0x392f('0x20')](respondWithResult(_0x20c62e,null))[_0x392f('0x4b')](handleError(_0x20c62e,null));};exports[_0x392f('0x4d')]=function(_0x244012,_0x484f24){return db[_0x392f('0x29')]['find']({'where':{'id':_0x244012[_0x392f('0x4e')]['id']}})[_0x392f('0x20')](handleEntityNotFound(_0x484f24,null))[_0x392f('0x20')](removeEntity(_0x484f24,null))[_0x392f('0x4b')](handleError(_0x484f24,null));};exports[_0x392f('0x4f')]=function(_0x15053c,_0x4ae4d2,_0x35ca69){var _0x1d0584;return db[_0x392f('0x29')][_0x392f('0x42')]({'where':{'id':_0x15053c['params']['id']},'attributes':['id','dsn']})[_0x392f('0x20')](handleEntityNotFound(_0x4ae4d2,null))[_0x392f('0x20')](function(_0x4a90f8){if(_0x4a90f8){var _0x3ef948=require('odbc')();_0x3ef948[_0x392f('0x50')](_0x4a90f8[_0x392f('0x51')]);_0x3ef948[_0x392f('0x52')]();return _0x4a90f8;}})[_0x392f('0x20')](respondWithResult(_0x4ae4d2,null))[_0x392f('0x4b')](handleError(_0x4ae4d2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 00d4d4d..61848e9 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 _0x705a=['SquareOdbc','square_odbc','lodash','util','bluebird','request-promise','path','./squareOdbc.attributes','exports'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0x705a,0x1df));var _0xa705=function(_0x50118e,_0x13019f){_0x50118e=_0x50118e-0x0;var _0xeafc9c=_0x705a[_0x50118e];return _0xeafc9c;};'use strict';var _=require(_0xa705('0x0'));var util=require(_0xa705('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa705('0x2'));var rp=require(_0xa705('0x3'));var fs=require('fs');var path=require(_0xa705('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa705('0x5'));module[_0xa705('0x6')]=function(_0x288a2a,_0x547323){return _0x288a2a['define'](_0xa705('0x7'),attributes,{'tableName':_0xa705('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9a=['../../config/environment','./squareOdbc.attributes','exports','square_odbc','api','request-promise'];(function(_0x3fb826,_0x7c4fb4){var _0x1ac7b2=function(_0x3e9d40){while(--_0x3e9d40){_0x3fb826['push'](_0x3fb826['shift']());}};_0x1ac7b2(++_0x7c4fb4);}(_0x8a9a,0xb8));var _0xa8a9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8a9a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa8a9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa8a9('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa8a9('0x2'));var attributes=require(_0xa8a9('0x3'));module[_0xa8a9('0x4')]=function(_0x4ca8ba,_0x4d82da){return _0x4ca8ba['define']('SquareOdbc',attributes,{'tableName':_0xa8a9('0x5'),'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 9f79a5d..5bf5c30 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 _0x0173=['find','options','attributes','include','map','model','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc'];(function(_0x328b40,_0x370642){var _0x556a56=function(_0x467553){while(--_0x467553){_0x328b40['push'](_0x328b40['shift']());}};_0x556a56(++_0x370642);}(_0x0173,0x107));var _0x3017=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0173[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3017('0x0'));var util=require('util');var moment=require(_0x3017('0x1'));var BPromise=require(_0x3017('0x2'));var rs=require(_0x3017('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3017('0x4'))['db'];var utils=require(_0x3017('0x5'));var logger=require(_0x3017('0x6'))(_0x3017('0x7'));var config=require(_0x3017('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3017('0x9')][_0x3017('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ff417,_0x4cbb06,_0x3a4745){return new BPromise(function(_0x407e28,_0x28651f){return client[_0x3017('0xb')](_0x2ff417,_0x3a4745)[_0x3017('0xc')](function(_0x3f107f){logger[_0x3017('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4cbb06,_0x3017('0xe'));logger['debug'](_0x3017('0xf'),_0x4cbb06,_0x3017('0xe'),JSON[_0x3017('0x10')](_0x3f107f));if(_0x3f107f[_0x3017('0x11')]){if(_0x3f107f[_0x3017('0x11')][_0x3017('0x12')]===0x1f4){logger[_0x3017('0x11')](_0x3017('0x13'),_0x4cbb06,_0x3f107f[_0x3017('0x11')][_0x3017('0x14')]);return _0x28651f(_0x3f107f[_0x3017('0x11')]['message']);}logger[_0x3017('0x11')](_0x3017('0x13'),_0x4cbb06,_0x3f107f[_0x3017('0x11')][_0x3017('0x14')]);return _0x407e28(_0x3f107f[_0x3017('0x11')][_0x3017('0x14')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4cbb06,'request\x20sent');_0x407e28(_0x3f107f[_0x3017('0x15')][_0x3017('0x14')]);}})[_0x3017('0x16')](function(_0x3c2b7f){logger[_0x3017('0x11')](_0x3017('0x13'),_0x4cbb06,_0x3c2b7f);_0x28651f(_0x3c2b7f);});});}exports[_0x3017('0x17')]=function(_0x5e729c){var _0x341166=this;return new Promise(function(_0x105d22,_0x29adcc){return db[_0x3017('0x18')][_0x3017('0x19')]({'raw':_0x5e729c['options']?_0x5e729c[_0x3017('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5e729c['options']?_0x5e729c[_0x3017('0x1a')]['where']||null:null,'attributes':_0x5e729c['options']?_0x5e729c[_0x3017('0x1a')][_0x3017('0x1b')]||null:null,'include':_0x5e729c['options']?_0x5e729c[_0x3017('0x1a')][_0x3017('0x1c')]?_[_0x3017('0x1d')](_0x5e729c[_0x3017('0x1a')][_0x3017('0x1c')],function(_0x52338e){return{'model':db[_0x52338e[_0x3017('0x1e')]],'as':_0x52338e['as'],'attributes':_0x52338e[_0x3017('0x1b')],'include':_0x52338e[_0x3017('0x1c')]?_[_0x3017('0x1d')](_0x52338e[_0x3017('0x1c')],function(_0x2abc9c){return{'model':db[_0x2abc9c[_0x3017('0x1e')]],'as':_0x2abc9c['as'],'attributes':_0x2abc9c[_0x3017('0x1b')],'include':_0x2abc9c[_0x3017('0x1c')]?_[_0x3017('0x1d')](_0x2abc9c[_0x3017('0x1c')],function(_0x24ca7b){return{'model':db[_0x24ca7b[_0x3017('0x1e')]],'as':_0x24ca7b['as'],'attributes':_0x24ca7b[_0x3017('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33838d){logger[_0x3017('0xd')](_0x3017('0x17'),_0x5e729c);logger[_0x3017('0x1f')](_0x3017('0x17'),_0x5e729c,JSON[_0x3017('0x10')](_0x33838d));_0x105d22(_0x33838d);})[_0x3017('0x16')](function(_0x136dfb){logger['error'](_0x3017('0x17'),_0x136dfb['message'],_0x5e729c);_0x29adcc(_0x341166[_0x3017('0x11')](0x1f4,_0x136dfb['message']));});});}; \ No newline at end of file +var _0x85a9=['include','map','model','ShowSquareOdbc','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','find','options','where','attributes'];(function(_0x14b141,_0x391645){var _0x428ac5=function(_0x3011b6){while(--_0x3011b6){_0x14b141['push'](_0x14b141['shift']());}};_0x428ac5(++_0x391645);}(_0x85a9,0x15a));var _0x985a=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x85a9[_0x8a30cf];return _0x20f439;};'use strict';var _=require('lodash');var util=require(_0x985a('0x0'));var moment=require('moment');var BPromise=require(_0x985a('0x1'));var rs=require(_0x985a('0x2'));var fs=require('fs');var Redis=require(_0x985a('0x3'));var db=require(_0x985a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x985a('0x5'))(_0x985a('0x6'));var config=require(_0x985a('0x7'));var jayson=require(_0x985a('0x8'));var client=jayson[_0x985a('0x9')][_0x985a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c22cf,_0x598594,_0x48ae6e){return new BPromise(function(_0xe437,_0x21e5ee){return client['request'](_0x4c22cf,_0x48ae6e)[_0x985a('0xb')](function(_0x19a09f){logger[_0x985a('0xc')](_0x985a('0xd'),_0x598594,_0x985a('0xe'));logger[_0x985a('0xf')](_0x985a('0x10'),_0x598594,_0x985a('0xe'),JSON[_0x985a('0x11')](_0x19a09f));if(_0x19a09f[_0x985a('0x12')]){if(_0x19a09f[_0x985a('0x12')][_0x985a('0x13')]===0x1f4){logger[_0x985a('0x12')](_0x985a('0xd'),_0x598594,_0x19a09f[_0x985a('0x12')][_0x985a('0x14')]);return _0x21e5ee(_0x19a09f[_0x985a('0x12')]['message']);}logger[_0x985a('0x12')](_0x985a('0xd'),_0x598594,_0x19a09f[_0x985a('0x12')]['message']);return _0xe437(_0x19a09f[_0x985a('0x12')][_0x985a('0x14')]);}else{logger[_0x985a('0xc')](_0x985a('0xd'),_0x598594,'request\x20sent');_0xe437(_0x19a09f[_0x985a('0x15')][_0x985a('0x14')]);}})['catch'](function(_0x35075c){logger[_0x985a('0x12')](_0x985a('0xd'),_0x598594,_0x35075c);_0x21e5ee(_0x35075c);});});}exports['ShowSquareOdbc']=function(_0xb7a3ab){var _0x194d37=this;return new Promise(function(_0x3951bb,_0x28831e){return db['SquareOdbc'][_0x985a('0x16')]({'raw':_0xb7a3ab[_0x985a('0x17')]?_0xb7a3ab[_0x985a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xb7a3ab[_0x985a('0x17')]?_0xb7a3ab[_0x985a('0x17')][_0x985a('0x18')]||null:null,'attributes':_0xb7a3ab['options']?_0xb7a3ab[_0x985a('0x17')][_0x985a('0x19')]||null:null,'include':_0xb7a3ab[_0x985a('0x17')]?_0xb7a3ab[_0x985a('0x17')][_0x985a('0x1a')]?_[_0x985a('0x1b')](_0xb7a3ab['options'][_0x985a('0x1a')],function(_0x5c68ca){return{'model':db[_0x5c68ca[_0x985a('0x1c')]],'as':_0x5c68ca['as'],'attributes':_0x5c68ca[_0x985a('0x19')],'include':_0x5c68ca[_0x985a('0x1a')]?_[_0x985a('0x1b')](_0x5c68ca[_0x985a('0x1a')],function(_0x2a909d){return{'model':db[_0x2a909d['model']],'as':_0x2a909d['as'],'attributes':_0x2a909d[_0x985a('0x19')],'include':_0x2a909d[_0x985a('0x1a')]?_[_0x985a('0x1b')](_0x2a909d[_0x985a('0x1a')],function(_0x4b9903){return{'model':db[_0x4b9903[_0x985a('0x1c')]],'as':_0x4b9903['as'],'attributes':_0x4b9903[_0x985a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x985a('0xb')](function(_0x3075c6){logger[_0x985a('0xc')](_0x985a('0x1d'),_0xb7a3ab);logger[_0x985a('0xf')](_0x985a('0x1d'),_0xb7a3ab,JSON[_0x985a('0x11')](_0x3075c6));_0x3951bb(_0x3075c6);})[_0x985a('0x1e')](function(_0x1fbe8b){logger['error'](_0x985a('0x1d'),_0x1fbe8b[_0x985a('0x14')],_0xb7a3ab);_0x28831e(_0x194d37['error'](0x1f4,_0x1fbe8b[_0x985a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 7bc46cb..07019a5 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 _0x659c=['put','update','delete','destroy','removeUsers','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','./squareProject.controller','get','isAuthenticated','index','/:id','post','create','/:id/users','addUsers'];(function(_0xf2e45f,_0x2928f){var _0x14456a=function(_0x4faa02){while(--_0x4faa02){_0xf2e45f['push'](_0xf2e45f['shift']());}};_0x14456a(++_0x2928f);}(_0x659c,0x1aa));var _0xc659=function(_0x1f4f0b,_0xc6db05){_0x1f4f0b=_0x1f4f0b-0x0;var _0x1be5c2=_0x659c[_0x1f4f0b];return _0x1be5c2;};'use strict';var multer=require(_0xc659('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc659('0x1'));var express=require(_0xc659('0x2'));var router=express['Router']();var fs_extra=require(_0xc659('0x3'));var auth=require(_0xc659('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc659('0x5'));router[_0xc659('0x6')]('/',auth[_0xc659('0x7')](),controller[_0xc659('0x8')]);router[_0xc659('0x6')](_0xc659('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xc659('0x6')]('/:id/users',auth['isAuthenticated'](),controller['getUsers']);router[_0xc659('0xa')]('/',auth[_0xc659('0x7')](),controller[_0xc659('0xb')]);router[_0xc659('0xa')](_0xc659('0xc'),auth[_0xc659('0x7')](),controller[_0xc659('0xd')]);router[_0xc659('0xe')]('/:id',auth[_0xc659('0x7')](),controller[_0xc659('0xf')]);router[_0xc659('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc659('0x11')]);router[_0xc659('0x10')]('/:id/users',auth[_0xc659('0x7')](),controller[_0xc659('0x12')]);module[_0xc659('0x13')]=router; \ No newline at end of file +var _0x02a4=['./squareProject.controller','get','index','/:id','show','isAuthenticated','getUsers','post','addUsers','update','destroy','removeUsers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x02a4,0x19d));var _0x402a=function(_0x25dca9,_0x160a32){_0x25dca9=_0x25dca9-0x0;var _0x1cfe07=_0x02a4[_0x25dca9];return _0x1cfe07;};'use strict';var multer=require(_0x402a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x402a('0x1'));var express=require(_0x402a('0x2'));var router=express[_0x402a('0x3')]();var fs_extra=require(_0x402a('0x4'));var auth=require(_0x402a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x402a('0x6'));var controller=require(_0x402a('0x7'));router[_0x402a('0x8')]('/',auth['isAuthenticated'](),controller[_0x402a('0x9')]);router[_0x402a('0x8')](_0x402a('0xa'),auth['isAuthenticated'](),controller[_0x402a('0xb')]);router[_0x402a('0x8')]('/:id/users',auth[_0x402a('0xc')](),controller[_0x402a('0xd')]);router[_0x402a('0xe')]('/',auth[_0x402a('0xc')](),controller['create']);router['post']('/:id/users',auth[_0x402a('0xc')](),controller[_0x402a('0xf')]);router['put']('/:id',auth[_0x402a('0xc')](),controller[_0x402a('0x10')]);router['delete'](_0x402a('0xa'),auth[_0x402a('0xc')](),controller[_0x402a('0x11')]);router['delete']('/:id/users',auth[_0x402a('0xc')](),controller[_0x402a('0x12')]);module[_0x402a('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e4cb950..4802aaf 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 _0x9a66=['utf8','production','toString','DATE','sequelize','exports','STRING','TEXT','long','getDataValue'];(function(_0x521bed,_0x110c24){var _0x32eb9e=function(_0x4364a3){while(--_0x4364a3){_0x521bed['push'](_0x521bed['shift']());}};_0x32eb9e(++_0x110c24);}(_0x9a66,0xae));var _0x69a6=function(_0xc63e3b,_0x5bb8a6){_0xc63e3b=_0xc63e3b-0x0;var _0x369881=_0x9a66[_0xc63e3b];return _0x369881;};'use strict';var Sequelize=require(_0x69a6('0x0'));module[_0x69a6('0x1')]={'name':{'type':Sequelize[_0x69a6('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x69a6('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x69a6('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x69a6('0x5')]('preproduction')['toString'](_0x69a6('0x6'));}}},'production':{'type':Sequelize['BLOB'](_0x69a6('0x4')),'get':function(){if(this[_0x69a6('0x5')](_0x69a6('0x7'))){return this[_0x69a6('0x5')]('production')[_0x69a6('0x8')](_0x69a6('0x6'));}}},'savedAt':{'type':Sequelize[_0x69a6('0x9')]},'publishedAt':{'type':Sequelize[_0x69a6('0x9')]}}; \ No newline at end of file +var _0xbeb1=['exports','STRING','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize'];(function(_0x5bb94b,_0x41923d){var _0x3ac61f=function(_0x1e0848){while(--_0x1e0848){_0x5bb94b['push'](_0x5bb94b['shift']());}};_0x3ac61f(++_0x41923d);}(_0xbeb1,0x9b));var _0x1beb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbeb1[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x1beb('0x0'));module[_0x1beb('0x1')]={'name':{'type':Sequelize[_0x1beb('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x1beb('0x3')]},'preproduction':{'type':Sequelize[_0x1beb('0x4')]('long'),'get':function(){if(this[_0x1beb('0x5')](_0x1beb('0x6'))){return this[_0x1beb('0x5')](_0x1beb('0x6'))[_0x1beb('0x7')](_0x1beb('0x8'));}}},'production':{'type':Sequelize[_0x1beb('0x4')](_0x1beb('0x9')),'get':function(){if(this[_0x1beb('0x5')](_0x1beb('0xa'))){return this['getDataValue'](_0x1beb('0xa'))[_0x1beb('0x7')](_0x1beb('0x8'));}}},'savedAt':{'type':Sequelize[_0x1beb('0xb')]},'publishedAt':{'type':Sequelize[_0x1beb('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 8361fdb..0af3b21 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 _0xe30f=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','get','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','SquareProject','includeAll','include','rows','catch','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','emit','findOne','User','order','options','getUsers','hasOwnProperty','eml-format','rimraf','zip-dir'];(function(_0xa9e3e6,_0x268274){var _0x4c43d1=function(_0x204b2d){while(--_0x204b2d){_0xa9e3e6['push'](_0xa9e3e6['shift']());}};_0x4c43d1(++_0x268274);}(_0xe30f,0x1f1));var _0xfe30=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe30f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xfe30('0x0'));var rimraf=require(_0xfe30('0x1'));var zipdir=require(_0xfe30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe30('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe30('0x4'));var util=require(_0xfe30('0x5'));var path=require(_0xfe30('0x6'));var sox=require(_0xfe30('0x7'));var csv=require(_0xfe30('0x8'));var ejs=require(_0xfe30('0x9'));var fs=require('fs');var fs_extra=require(_0xfe30('0xa'));var _=require(_0xfe30('0xb'));var squel=require(_0xfe30('0xc'));var crypto=require(_0xfe30('0xd'));var jsforce=require(_0xfe30('0xe'));var deskjs=require(_0xfe30('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfe30('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfe30('0x11'));var as=require(_0xfe30('0x12'));var hardwareService=require(_0xfe30('0x13'));var logger=require('../../config/logger')(_0xfe30('0x14'));var utils=require(_0xfe30('0x15'));var config=require(_0xfe30('0x16'));var licenseUtil=require(_0xfe30('0x17'));var db=require(_0xfe30('0x18'))['db'];config[_0xfe30('0x19')]=_[_0xfe30('0x1a')](config[_0xfe30('0x19')],{'host':_0xfe30('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0xfe30('0x1c')](socket);function respondWithStatusCode(_0x3317ed,_0x3ebb40){_0x3ebb40=_0x3ebb40||0xcc;return function(_0x4a1482){if(_0x4a1482){return _0x3317ed['sendStatus'](_0x3ebb40);}return _0x3317ed[_0xfe30('0x1d')](_0x3ebb40)[_0xfe30('0x1e')]();};}function respondWithResult(_0x2027bf,_0x2e0fdd){_0x2e0fdd=_0x2e0fdd||0xc8;return function(_0x164d44){if(_0x164d44){return _0x2027bf[_0xfe30('0x1d')](_0x2e0fdd)['json'](_0x164d44);}};}function respondWithFilteredResult(_0x1dcb60,_0x3e85b4){return function(_0x325be2){if(_0x325be2){var _0x11390d=typeof _0x3e85b4[_0xfe30('0x1f')]===_0xfe30('0x20')&&typeof _0x3e85b4['limit']===_0xfe30('0x20');var _0xc1e4a9=_0x325be2[_0xfe30('0x21')];var _0x3bcbee=_0x11390d?0x0:_0x3e85b4[_0xfe30('0x1f')];var _0x268cad=_0x11390d?_0x325be2['count']:_0x3e85b4[_0xfe30('0x1f')]+_0x3e85b4['limit'];var _0x337f8f;if(_0x268cad>=_0xc1e4a9){_0x268cad=_0xc1e4a9;_0x337f8f=0xc8;}else{_0x337f8f=0xce;}_0x1dcb60['status'](_0x337f8f);return _0x1dcb60['set'](_0xfe30('0x22'),_0x3bcbee+'-'+_0x268cad+'/'+_0xc1e4a9)[_0xfe30('0x23')](_0x325be2);}return null;};}function patchUpdates(_0x1e8fc0){return function(_0x3c752d){try{jsonpatch[_0xfe30('0x24')](_0x3c752d,_0x1e8fc0,!![]);}catch(_0x591b9b){return BPromise[_0xfe30('0x25')](_0x591b9b);}return _0x3c752d[_0xfe30('0x26')]();};}function saveUpdates(_0x5a1d88,_0x49c84f){return function(_0xa582be){if(_0xa582be){return _0xa582be[_0xfe30('0x27')](_0x5a1d88)[_0xfe30('0x28')](function(_0x1af711){return _0x1af711;});}return null;};}function removeEntity(_0x6f0328,_0x424404){return function(_0xc58fb4){if(_0xc58fb4){return _0xc58fb4['destroy']()[_0xfe30('0x28')](function(){var _0x11aace=_0xc58fb4[_0xfe30('0x29')]({'plain':!![]});var _0xdd1654='SquareProjects';return db['UserProfileResource'][_0xfe30('0x2a')]({'where':{'type':_0xdd1654,'resourceId':_0x11aace['id']}})['then'](function(){return _0xc58fb4;});})[_0xfe30('0x28')](function(){_0x6f0328[_0xfe30('0x1d')](0xcc)[_0xfe30('0x1e')]();});}};}function handleEntityNotFound(_0xe7222d,_0x5f15ac){return function(_0x43a593){if(!_0x43a593){_0xe7222d[_0xfe30('0x2b')](0x194);}return _0x43a593;};}function handleError(_0x47ae84,_0x229665){_0x229665=_0x229665||0x1f4;return function(_0x57bec2){logger[_0xfe30('0x2c')](_0x57bec2[_0xfe30('0x2d')]);if(_0x57bec2[_0xfe30('0x2e')]){delete _0x57bec2[_0xfe30('0x2e')];}_0x47ae84[_0xfe30('0x1d')](_0x229665)[_0xfe30('0x2f')](_0x57bec2);};}exports[_0xfe30('0x30')]=function(_0x5676ed,_0x54c82c){var _0xe92fbb={},_0x4dffcb={},_0x4bad1f={'count':0x0,'rows':[]};var _0x50356f=_[_0xfe30('0x31')](db['SquareProject'][_0xfe30('0x32')],function(_0x227bf0){return{'name':_0x227bf0[_0xfe30('0x33')],'type':_0x227bf0[_0xfe30('0x34')][_0xfe30('0x35')]};});_0x4dffcb[_0xfe30('0x36')]=_[_0xfe30('0x31')](_0x50356f,'name');_0x4dffcb[_0xfe30('0x37')]=_[_0xfe30('0x38')](_0x5676ed[_0xfe30('0x37')]);_0x4dffcb[_0xfe30('0x39')]=_['intersection'](_0x4dffcb['model'],_0x4dffcb[_0xfe30('0x37')]);_0xe92fbb[_0xfe30('0x3a')]=_['intersection'](_0x4dffcb[_0xfe30('0x36')],qs['fields'](_0x5676ed[_0xfe30('0x37')][_0xfe30('0x3b')]));_0xe92fbb[_0xfe30('0x3a')]=_0xe92fbb[_0xfe30('0x3a')][_0xfe30('0x3c')]?_0xe92fbb[_0xfe30('0x3a')]:_0x4dffcb['model'];if(!_0x5676ed[_0xfe30('0x37')]['hasOwnProperty'](_0xfe30('0x3d'))){_0xe92fbb[_0xfe30('0x3e')]=qs[_0xfe30('0x3e')](_0x5676ed[_0xfe30('0x37')][_0xfe30('0x3e')]);_0xe92fbb[_0xfe30('0x1f')]=qs['offset'](_0x5676ed[_0xfe30('0x37')]['offset']);}_0xe92fbb['order']=qs[_0xfe30('0x3f')](_0x5676ed[_0xfe30('0x37')][_0xfe30('0x3f')]);_0xe92fbb['where']=qs[_0xfe30('0x39')](_[_0xfe30('0x40')](_0x5676ed[_0xfe30('0x37')],_0x4dffcb['filters']),_0x50356f);if(_0x5676ed['query'][_0xfe30('0x41')]){_0xe92fbb[_0xfe30('0x42')]=_[_0xfe30('0x43')](_0xe92fbb['where'],{'$or':_['map'](_0x50356f,function(_0x14f15a){if(_0x14f15a[_0xfe30('0x34')]!==_0xfe30('0x44')){var _0x10036b={};_0x10036b[_0x14f15a[_0xfe30('0x2e')]]={'$like':'%'+_0x5676ed['query'][_0xfe30('0x41')]+'%'};return _0x10036b;}})});}_0xe92fbb=_['merge']({},_0xe92fbb,_0x5676ed['options']);var _0x27ecd7={'where':_0xe92fbb[_0xfe30('0x42')]};return db[_0xfe30('0x45')]['count'](_0x27ecd7)['then'](function(_0x161618){_0x4bad1f['count']=_0x161618;if(_0x5676ed[_0xfe30('0x37')][_0xfe30('0x46')]){_0xe92fbb[_0xfe30('0x47')]=[{'all':!![]}];}return db[_0xfe30('0x45')]['findAll'](_0xe92fbb);})['then'](function(_0x945746){_0x4bad1f[_0xfe30('0x48')]=_0x945746;return _0x4bad1f;})[_0xfe30('0x28')](respondWithFilteredResult(_0x54c82c,_0xe92fbb))[_0xfe30('0x49')](handleError(_0x54c82c,null));};exports[_0xfe30('0x4a')]=function(_0x4184ba,_0x2561da){var _0x43b309={'raw':![],'where':{'id':_0x4184ba[_0xfe30('0x4b')]['id']}},_0x3c9a1d={};_0x3c9a1d[_0xfe30('0x36')]=_['keys'](db[_0xfe30('0x45')]['rawAttributes']);_0x3c9a1d[_0xfe30('0x37')]=_[_0xfe30('0x38')](_0x4184ba['query']);_0x3c9a1d[_0xfe30('0x39')]=_[_0xfe30('0x4c')](_0x3c9a1d[_0xfe30('0x36')],_0x3c9a1d[_0xfe30('0x37')]);_0x43b309[_0xfe30('0x3a')]=_[_0xfe30('0x4c')](_0x3c9a1d[_0xfe30('0x36')],qs[_0xfe30('0x3b')](_0x4184ba[_0xfe30('0x37')][_0xfe30('0x3b')]));_0x43b309[_0xfe30('0x3a')]=_0x43b309['attributes'][_0xfe30('0x3c')]?_0x43b309[_0xfe30('0x3a')]:_0x3c9a1d[_0xfe30('0x36')];if(_0x4184ba['query']['includeAll']){_0x43b309[_0xfe30('0x47')]=[{'all':!![]}];}_0x43b309=_[_0xfe30('0x43')]({},_0x43b309,_0x4184ba['options']);return db['SquareProject'][_0xfe30('0x4d')](_0x43b309)['then'](handleEntityNotFound(_0x2561da,null))['then'](respondWithResult(_0x2561da,null))['catch'](handleError(_0x2561da,null));};exports[_0xfe30('0x4e')]=function(_0x3f8092,_0x315da3){return db['SquareProject']['create'](_0x3f8092['body'],{})[_0xfe30('0x28')](function(_0x4d81d5){var _0x593c79=_0x3f8092[_0xfe30('0x4f')][_0xfe30('0x29')]({'plain':!![]});if(!_0x593c79)throw new Error(_0xfe30('0x50'));if(_0x593c79[_0xfe30('0x51')]===_0xfe30('0x4f')){var _0x56ff75=_0x4d81d5[_0xfe30('0x29')]({'plain':!![]});var _0x5493e2=_0xfe30('0x52');return db[_0xfe30('0x53')][_0xfe30('0x4d')]({'where':{'name':_0x5493e2,'userProfileId':_0x593c79[_0xfe30('0x54')]},'raw':!![]})['then'](function(_0x4dd674){if(_0x4dd674&&_0x4dd674[_0xfe30('0x55')]===0x0){return db[_0xfe30('0x56')]['create']({'name':_0x56ff75['name'],'resourceId':_0x56ff75['id'],'type':_0x4dd674[_0xfe30('0x2e')],'sectionId':_0x4dd674['id']},{})[_0xfe30('0x28')](function(){return _0x4d81d5;});}else{return _0x4d81d5;}})[_0xfe30('0x49')](function(_0x303038){logger[_0xfe30('0x2c')](_0xfe30('0x57'),_0x303038);throw _0x303038;});}return _0x4d81d5;})['then'](respondWithResult(_0x315da3,0xc9))['catch'](handleError(_0x315da3,null));};exports[_0xfe30('0x27')]=function(_0x564654,_0x221478){if(_0x564654[_0xfe30('0x58')]['id']){delete _0x564654[_0xfe30('0x58')]['id'];}return db[_0xfe30('0x45')]['find']({'where':{'id':_0x564654['params']['id']}})['then'](handleEntityNotFound(_0x221478,null))[_0xfe30('0x28')](saveUpdates(_0x564654['body'],null))[_0xfe30('0x28')](respondWithResult(_0x221478,null))[_0xfe30('0x49')](handleError(_0x221478,null));};exports[_0xfe30('0x2a')]=function(_0x2a193f,_0x207a87){return db[_0xfe30('0x45')][_0xfe30('0x4d')]({'where':{'id':_0x2a193f[_0xfe30('0x4b')]['id']}})['then'](handleEntityNotFound(_0x207a87,null))[_0xfe30('0x28')](removeEntity(_0x207a87,null))[_0xfe30('0x49')](handleError(_0x207a87,null));};exports[_0xfe30('0x59')]=function(_0x4d44cc,_0x2502ca,_0x4a9bc6){return db[_0xfe30('0x45')][_0xfe30('0x4d')]({'where':{'id':_0x4d44cc['params']['id']}})['then'](handleEntityNotFound(_0x2502ca,null))[_0xfe30('0x28')](function(_0x58a386){if(_0x58a386){return _0x58a386[_0xfe30('0x59')](_0x4d44cc[_0xfe30('0x58')][_0xfe30('0x5a')],_[_0xfe30('0x5b')](_0x4d44cc[_0xfe30('0x58')],[_0xfe30('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x2502ca,null))[_0xfe30('0x49')](handleError(_0x2502ca,null));};exports[_0xfe30('0x5c')]=function(_0x357995,_0x4366b9,_0x2b7a2e){return db['SquareProject'][_0xfe30('0x4d')]({'where':{'id':_0x357995[_0xfe30('0x4b')]['id']}})[_0xfe30('0x28')](handleEntityNotFound(_0x4366b9,null))[_0xfe30('0x28')](function(_0x3608e9){if(_0x3608e9){return _0x3608e9[_0xfe30('0x5c')](_0x357995['query']['ids'])[_0xfe30('0x28')](function(){if(_['isArray'](_0x357995[_0xfe30('0x37')][_0xfe30('0x5a')])){for(var _0x482b6c=0x0;_0x482b6c<_0x357995[_0xfe30('0x37')][_0xfe30('0x5a')][_0xfe30('0x3c')];_0x482b6c+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x357995[_0xfe30('0x37')][_0xfe30('0x5a')][_0x482b6c]),'SquareProjectId':Number(_0x357995[_0xfe30('0x4b')]['id'])});}}else{socket[_0xfe30('0x5d')]('userSquareProject:remove',{'UserId':Number(_0x357995[_0xfe30('0x37')][_0xfe30('0x5a')]),'SquareProjectId':Number(_0x357995[_0xfe30('0x4b')]['id'])});}});}})[_0xfe30('0x28')](respondWithStatusCode(_0x4366b9,null))[_0xfe30('0x49')](handleError(_0x4366b9,null));};exports['getUsers']=function(_0x3820bf,_0x306ed3,_0x41bdb2){var _0x581b94={};var _0x2c935a={};var _0x77cb7;var _0x47d7b3;return db[_0xfe30('0x45')][_0xfe30('0x5e')]({'where':{'id':_0x3820bf[_0xfe30('0x4b')]['id']}})[_0xfe30('0x28')](handleEntityNotFound(_0x306ed3,null))[_0xfe30('0x28')](function(_0x58dc7f){if(_0x58dc7f){_0x77cb7=_0x58dc7f;_0x2c935a['model']=_[_0xfe30('0x38')](db[_0xfe30('0x5f')][_0xfe30('0x32')]);_0x2c935a[_0xfe30('0x37')]=_['keys'](_0x3820bf[_0xfe30('0x37')]);_0x2c935a[_0xfe30('0x39')]=_[_0xfe30('0x4c')](_0x2c935a['model'],_0x2c935a['query']);_0x581b94['attributes']=_[_0xfe30('0x4c')](_0x2c935a[_0xfe30('0x36')],qs[_0xfe30('0x3b')](_0x3820bf[_0xfe30('0x37')][_0xfe30('0x3b')]));_0x581b94[_0xfe30('0x3a')]=_0x581b94[_0xfe30('0x3a')]['length']?_0x581b94[_0xfe30('0x3a')]:_0x2c935a[_0xfe30('0x36')];_0x581b94[_0xfe30('0x60')]=qs[_0xfe30('0x3f')](_0x3820bf[_0xfe30('0x37')][_0xfe30('0x3f')]);_0x581b94[_0xfe30('0x42')]=qs[_0xfe30('0x39')](_['pick'](_0x3820bf[_0xfe30('0x37')],_0x2c935a[_0xfe30('0x39')]));if(_0x3820bf[_0xfe30('0x37')][_0xfe30('0x41')]){_0x581b94[_0xfe30('0x42')]=_[_0xfe30('0x43')](_0x581b94['where'],{'$or':_['map'](_0x581b94[_0xfe30('0x3a')],function(_0x107f0c){var _0x4a7ac6={};_0x4a7ac6[_0x107f0c]={'$like':'%'+_0x3820bf[_0xfe30('0x37')]['filter']+'%'};return _0x4a7ac6;})});}_0x581b94=_[_0xfe30('0x43')]({},_0x581b94,_0x3820bf[_0xfe30('0x61')]);return _0x77cb7[_0xfe30('0x62')](_0x581b94);}})['then'](function(_0x4ffb65){if(_0x4ffb65){_0x47d7b3=_0x4ffb65[_0xfe30('0x3c')];if(!_0x3820bf['query'][_0xfe30('0x63')](_0xfe30('0x3d'))){_0x581b94[_0xfe30('0x3e')]=qs[_0xfe30('0x3e')](_0x3820bf['query'][_0xfe30('0x3e')]);_0x581b94['offset']=qs[_0xfe30('0x1f')](_0x3820bf[_0xfe30('0x37')][_0xfe30('0x1f')]);}return _0x77cb7[_0xfe30('0x62')](_0x581b94);}})[_0xfe30('0x28')](function(_0x1ec50a){if(_0x1ec50a){return _0x1ec50a?{'count':_0x47d7b3,'rows':_0x1ec50a}:null;}})[_0xfe30('0x28')](respondWithResult(_0x306ed3,null))['catch'](handleError(_0x306ed3,null));}; \ No newline at end of file +var _0x399e=['addUsers','ids','omit','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','pick','eml-format','rimraf','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','get','SquareProjects','sendStatus','error','name','send','index','map','SquareProject','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','role','UserProfileSection','UserProfileResource'];(function(_0x2349f2,_0x4abb9e){var _0x32077d=function(_0x1b562b){while(--_0x1b562b){_0x2349f2['push'](_0x2349f2['shift']());}};_0x32077d(++_0x4abb9e);}(_0x399e,0x1d7));var _0xe399=function(_0x17ede9,_0x27d731){_0x17ede9=_0x17ede9-0x0;var _0x35b71d=_0x399e[_0x17ede9];return _0x35b71d;};'use strict';var emlformat=require(_0xe399('0x0'));var rimraf=require(_0xe399('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe399('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe399('0x3'));var path=require('path');var sox=require(_0xe399('0x4'));var csv=require(_0xe399('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe399('0x6'));var _=require(_0xe399('0x7'));var squel=require(_0xe399('0x8'));var crypto=require(_0xe399('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe399('0xa'));var toCsv=require(_0xe399('0x5'));var querystring=require(_0xe399('0xb'));var Papa=require(_0xe399('0xc'));var Redis=require(_0xe399('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe399('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe399('0xf'))(_0xe399('0x10'));var utils=require(_0xe399('0x11'));var config=require(_0xe399('0x12'));var licenseUtil=require(_0xe399('0x13'));var db=require(_0xe399('0x14'))['db'];config['redis']=_[_0xe399('0x15')](config['redis'],{'host':_0xe399('0x16'),'port':0x18eb});var socket=require(_0xe399('0x17'))(new Redis(config[_0xe399('0x18')]));require(_0xe399('0x19'))[_0xe399('0x1a')](socket);function respondWithStatusCode(_0x5e788e,_0x3d3a07){_0x3d3a07=_0x3d3a07||0xcc;return function(_0x186e5f){if(_0x186e5f){return _0x5e788e['sendStatus'](_0x3d3a07);}return _0x5e788e[_0xe399('0x1b')](_0x3d3a07)[_0xe399('0x1c')]();};}function respondWithResult(_0x4c6cdc,_0x3139a7){_0x3139a7=_0x3139a7||0xc8;return function(_0x2f9b52){if(_0x2f9b52){return _0x4c6cdc['status'](_0x3139a7)[_0xe399('0x1d')](_0x2f9b52);}};}function respondWithFilteredResult(_0x26e54e,_0x550e1f){return function(_0x3c13c3){if(_0x3c13c3){var _0x3438f8=typeof _0x550e1f['offset']===_0xe399('0x1e')&&typeof _0x550e1f[_0xe399('0x1f')]===_0xe399('0x1e');var _0x36b6d8=_0x3c13c3[_0xe399('0x20')];var _0x224168=_0x3438f8?0x0:_0x550e1f[_0xe399('0x21')];var _0x1a4598=_0x3438f8?_0x3c13c3['count']:_0x550e1f['offset']+_0x550e1f[_0xe399('0x1f')];var _0x3313b0;if(_0x1a4598>=_0x36b6d8){_0x1a4598=_0x36b6d8;_0x3313b0=0xc8;}else{_0x3313b0=0xce;}_0x26e54e['status'](_0x3313b0);return _0x26e54e[_0xe399('0x22')](_0xe399('0x23'),_0x224168+'-'+_0x1a4598+'/'+_0x36b6d8)[_0xe399('0x1d')](_0x3c13c3);}return null;};}function patchUpdates(_0xa4a166){return function(_0x508654){try{jsonpatch['apply'](_0x508654,_0xa4a166,!![]);}catch(_0x27c750){return BPromise['reject'](_0x27c750);}return _0x508654[_0xe399('0x24')]();};}function saveUpdates(_0x2356f8,_0x4c5822){return function(_0x1bc55f){if(_0x1bc55f){return _0x1bc55f[_0xe399('0x25')](_0x2356f8)['then'](function(_0x595825){return _0x595825;});}return null;};}function removeEntity(_0x38d6db,_0x4a8c94){return function(_0x663162){if(_0x663162){return _0x663162[_0xe399('0x26')]()[_0xe399('0x27')](function(){var _0x543612=_0x663162[_0xe399('0x28')]({'plain':!![]});var _0xbbeafa=_0xe399('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xbbeafa,'resourceId':_0x543612['id']}})[_0xe399('0x27')](function(){return _0x663162;});})[_0xe399('0x27')](function(){_0x38d6db[_0xe399('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1444b5,_0x129489){return function(_0x30e9bb){if(!_0x30e9bb){_0x1444b5[_0xe399('0x2a')](0x194);}return _0x30e9bb;};}function handleError(_0x2f7a3c,_0x3c926e){_0x3c926e=_0x3c926e||0x1f4;return function(_0x18a383){logger[_0xe399('0x2b')](_0x18a383['stack']);if(_0x18a383[_0xe399('0x2c')]){delete _0x18a383[_0xe399('0x2c')];}_0x2f7a3c[_0xe399('0x1b')](_0x3c926e)[_0xe399('0x2d')](_0x18a383);};}exports[_0xe399('0x2e')]=function(_0x2e7de6,_0x2f27f5){var _0x484b2c={},_0x45bbf4={},_0x18976b={'count':0x0,'rows':[]};var _0x5d0c9d=_[_0xe399('0x2f')](db[_0xe399('0x30')]['rawAttributes'],function(_0x2aa63c){return{'name':_0x2aa63c[_0xe399('0x31')],'type':_0x2aa63c[_0xe399('0x32')][_0xe399('0x33')]};});_0x45bbf4['model']=_[_0xe399('0x2f')](_0x5d0c9d,_0xe399('0x2c'));_0x45bbf4['query']=_[_0xe399('0x34')](_0x2e7de6[_0xe399('0x35')]);_0x45bbf4[_0xe399('0x36')]=_[_0xe399('0x37')](_0x45bbf4[_0xe399('0x38')],_0x45bbf4[_0xe399('0x35')]);_0x484b2c['attributes']=_[_0xe399('0x37')](_0x45bbf4[_0xe399('0x38')],qs[_0xe399('0x39')](_0x2e7de6[_0xe399('0x35')]['fields']));_0x484b2c[_0xe399('0x3a')]=_0x484b2c[_0xe399('0x3a')]['length']?_0x484b2c[_0xe399('0x3a')]:_0x45bbf4[_0xe399('0x38')];if(!_0x2e7de6[_0xe399('0x35')][_0xe399('0x3b')](_0xe399('0x3c'))){_0x484b2c['limit']=qs[_0xe399('0x1f')](_0x2e7de6['query'][_0xe399('0x1f')]);_0x484b2c[_0xe399('0x21')]=qs[_0xe399('0x21')](_0x2e7de6[_0xe399('0x35')][_0xe399('0x21')]);}_0x484b2c['order']=qs[_0xe399('0x3d')](_0x2e7de6['query'][_0xe399('0x3d')]);_0x484b2c[_0xe399('0x3e')]=qs[_0xe399('0x36')](_['pick'](_0x2e7de6['query'],_0x45bbf4[_0xe399('0x36')]),_0x5d0c9d);if(_0x2e7de6[_0xe399('0x35')][_0xe399('0x3f')]){_0x484b2c[_0xe399('0x3e')]=_[_0xe399('0x40')](_0x484b2c[_0xe399('0x3e')],{'$or':_[_0xe399('0x2f')](_0x5d0c9d,function(_0x16b04){if(_0x16b04['type']!==_0xe399('0x41')){var _0x3ea40c={};_0x3ea40c[_0x16b04[_0xe399('0x2c')]]={'$like':'%'+_0x2e7de6[_0xe399('0x35')][_0xe399('0x3f')]+'%'};return _0x3ea40c;}})});}_0x484b2c=_[_0xe399('0x40')]({},_0x484b2c,_0x2e7de6[_0xe399('0x42')]);var _0x102835={'where':_0x484b2c[_0xe399('0x3e')]};return db[_0xe399('0x30')]['count'](_0x102835)[_0xe399('0x27')](function(_0x4ec431){_0x18976b[_0xe399('0x20')]=_0x4ec431;if(_0x2e7de6[_0xe399('0x35')]['includeAll']){_0x484b2c['include']=[{'all':!![]}];}return db[_0xe399('0x30')]['findAll'](_0x484b2c);})['then'](function(_0x230f89){_0x18976b[_0xe399('0x43')]=_0x230f89;return _0x18976b;})[_0xe399('0x27')](respondWithFilteredResult(_0x2f27f5,_0x484b2c))[_0xe399('0x44')](handleError(_0x2f27f5,null));};exports[_0xe399('0x45')]=function(_0x254273,_0x10434f){var _0x568da7={'raw':![],'where':{'id':_0x254273[_0xe399('0x46')]['id']}},_0x15151f={};_0x15151f[_0xe399('0x38')]=_[_0xe399('0x34')](db[_0xe399('0x30')][_0xe399('0x47')]);_0x15151f[_0xe399('0x35')]=_[_0xe399('0x34')](_0x254273[_0xe399('0x35')]);_0x15151f[_0xe399('0x36')]=_[_0xe399('0x37')](_0x15151f[_0xe399('0x38')],_0x15151f[_0xe399('0x35')]);_0x568da7[_0xe399('0x3a')]=_[_0xe399('0x37')](_0x15151f[_0xe399('0x38')],qs[_0xe399('0x39')](_0x254273[_0xe399('0x35')][_0xe399('0x39')]));_0x568da7[_0xe399('0x3a')]=_0x568da7['attributes'][_0xe399('0x48')]?_0x568da7['attributes']:_0x15151f['model'];if(_0x254273[_0xe399('0x35')][_0xe399('0x49')]){_0x568da7['include']=[{'all':!![]}];}_0x568da7=_['merge']({},_0x568da7,_0x254273[_0xe399('0x42')]);return db[_0xe399('0x30')][_0xe399('0x4a')](_0x568da7)[_0xe399('0x27')](handleEntityNotFound(_0x10434f,null))[_0xe399('0x27')](respondWithResult(_0x10434f,null))['catch'](handleError(_0x10434f,null));};exports['create']=function(_0xea73b3,_0x516fe8){return db[_0xe399('0x30')][_0xe399('0x4b')](_0xea73b3[_0xe399('0x4c')],{})[_0xe399('0x27')](function(_0x559466){var _0x429d94=_0xea73b3[_0xe399('0x4d')][_0xe399('0x28')]({'plain':!![]});if(!_0x429d94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x429d94[_0xe399('0x4e')]==='user'){var _0x260fc3=_0x559466[_0xe399('0x28')]({'plain':!![]});var _0xd778de=_0xe399('0x29');return db[_0xe399('0x4f')][_0xe399('0x4a')]({'where':{'name':_0xd778de,'userProfileId':_0x429d94['userProfileId']},'raw':!![]})[_0xe399('0x27')](function(_0x2a7db8){if(_0x2a7db8&&_0x2a7db8['autoAssociation']===0x0){return db[_0xe399('0x50')][_0xe399('0x4b')]({'name':_0x260fc3[_0xe399('0x2c')],'resourceId':_0x260fc3['id'],'type':_0x2a7db8[_0xe399('0x2c')],'sectionId':_0x2a7db8['id']},{})['then'](function(){return _0x559466;});}else{return _0x559466;}})['catch'](function(_0x604efd){logger[_0xe399('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x604efd);throw _0x604efd;});}return _0x559466;})[_0xe399('0x27')](respondWithResult(_0x516fe8,0xc9))['catch'](handleError(_0x516fe8,null));};exports[_0xe399('0x25')]=function(_0x56e6ff,_0x5c5ebe){if(_0x56e6ff[_0xe399('0x4c')]['id']){delete _0x56e6ff[_0xe399('0x4c')]['id'];}return db[_0xe399('0x30')][_0xe399('0x4a')]({'where':{'id':_0x56e6ff[_0xe399('0x46')]['id']}})[_0xe399('0x27')](handleEntityNotFound(_0x5c5ebe,null))[_0xe399('0x27')](saveUpdates(_0x56e6ff['body'],null))[_0xe399('0x27')](respondWithResult(_0x5c5ebe,null))[_0xe399('0x44')](handleError(_0x5c5ebe,null));};exports[_0xe399('0x26')]=function(_0x3714f1,_0x387b31){return db['SquareProject']['find']({'where':{'id':_0x3714f1['params']['id']}})[_0xe399('0x27')](handleEntityNotFound(_0x387b31,null))[_0xe399('0x27')](removeEntity(_0x387b31,null))['catch'](handleError(_0x387b31,null));};exports[_0xe399('0x51')]=function(_0x236190,_0xf7738a,_0x4a58b7){return db[_0xe399('0x30')][_0xe399('0x4a')]({'where':{'id':_0x236190['params']['id']}})[_0xe399('0x27')](handleEntityNotFound(_0xf7738a,null))['then'](function(_0x33927a){if(_0x33927a){return _0x33927a[_0xe399('0x51')](_0x236190['body'][_0xe399('0x52')],_[_0xe399('0x53')](_0x236190['body'],['ids','id'])||{});}})[_0xe399('0x27')](respondWithResult(_0xf7738a,null))[_0xe399('0x44')](handleError(_0xf7738a,null));};exports['removeUsers']=function(_0x371974,_0x21d3f1,_0xb493e2){return db['SquareProject']['find']({'where':{'id':_0x371974['params']['id']}})[_0xe399('0x27')](handleEntityNotFound(_0x21d3f1,null))['then'](function(_0x1326df){if(_0x1326df){return _0x1326df['removeUsers'](_0x371974[_0xe399('0x35')][_0xe399('0x52')])[_0xe399('0x27')](function(){if(_[_0xe399('0x54')](_0x371974[_0xe399('0x35')][_0xe399('0x52')])){for(var _0x2374a9=0x0;_0x2374a9<_0x371974[_0xe399('0x35')][_0xe399('0x52')][_0xe399('0x48')];_0x2374a9+=0x1){socket[_0xe399('0x55')](_0xe399('0x56'),{'UserId':Number(_0x371974[_0xe399('0x35')][_0xe399('0x52')][_0x2374a9]),'SquareProjectId':Number(_0x371974[_0xe399('0x46')]['id'])});}}else{socket[_0xe399('0x55')](_0xe399('0x56'),{'UserId':Number(_0x371974[_0xe399('0x35')][_0xe399('0x52')]),'SquareProjectId':Number(_0x371974['params']['id'])});}});}})[_0xe399('0x27')](respondWithStatusCode(_0x21d3f1,null))[_0xe399('0x44')](handleError(_0x21d3f1,null));};exports[_0xe399('0x57')]=function(_0x3a0fda,_0x502fe2,_0xe5b1b8){var _0x4a4c01={};var _0x42330f={};var _0x44de50;var _0x351661;return db[_0xe399('0x30')][_0xe399('0x58')]({'where':{'id':_0x3a0fda[_0xe399('0x46')]['id']}})[_0xe399('0x27')](handleEntityNotFound(_0x502fe2,null))[_0xe399('0x27')](function(_0x497540){if(_0x497540){_0x44de50=_0x497540;_0x42330f[_0xe399('0x38')]=_['keys'](db[_0xe399('0x59')][_0xe399('0x47')]);_0x42330f[_0xe399('0x35')]=_[_0xe399('0x34')](_0x3a0fda['query']);_0x42330f['filters']=_['intersection'](_0x42330f[_0xe399('0x38')],_0x42330f[_0xe399('0x35')]);_0x4a4c01[_0xe399('0x3a')]=_['intersection'](_0x42330f[_0xe399('0x38')],qs[_0xe399('0x39')](_0x3a0fda[_0xe399('0x35')]['fields']));_0x4a4c01[_0xe399('0x3a')]=_0x4a4c01[_0xe399('0x3a')][_0xe399('0x48')]?_0x4a4c01[_0xe399('0x3a')]:_0x42330f[_0xe399('0x38')];_0x4a4c01[_0xe399('0x5a')]=qs[_0xe399('0x3d')](_0x3a0fda[_0xe399('0x35')][_0xe399('0x3d')]);_0x4a4c01[_0xe399('0x3e')]=qs[_0xe399('0x36')](_[_0xe399('0x5b')](_0x3a0fda[_0xe399('0x35')],_0x42330f['filters']));if(_0x3a0fda['query']['filter']){_0x4a4c01[_0xe399('0x3e')]=_[_0xe399('0x40')](_0x4a4c01[_0xe399('0x3e')],{'$or':_['map'](_0x4a4c01[_0xe399('0x3a')],function(_0x34374a){var _0x29c005={};_0x29c005[_0x34374a]={'$like':'%'+_0x3a0fda[_0xe399('0x35')][_0xe399('0x3f')]+'%'};return _0x29c005;})});}_0x4a4c01=_[_0xe399('0x40')]({},_0x4a4c01,_0x3a0fda['options']);return _0x44de50[_0xe399('0x57')](_0x4a4c01);}})[_0xe399('0x27')](function(_0xc65c5c){if(_0xc65c5c){_0x351661=_0xc65c5c[_0xe399('0x48')];if(!_0x3a0fda[_0xe399('0x35')]['hasOwnProperty'](_0xe399('0x3c'))){_0x4a4c01[_0xe399('0x1f')]=qs['limit'](_0x3a0fda[_0xe399('0x35')][_0xe399('0x1f')]);_0x4a4c01[_0xe399('0x21')]=qs[_0xe399('0x21')](_0x3a0fda[_0xe399('0x35')][_0xe399('0x21')]);}return _0x44de50['getUsers'](_0x4a4c01);}})[_0xe399('0x27')](function(_0xcc03ca){if(_0xcc03ca){return _0xcc03ca?{'count':_0x351661,'rows':_0xcc03ca}:null;}})[_0xe399('0x27')](respondWithResult(_0x502fe2,null))[_0xe399('0x44')](handleError(_0x502fe2,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 822dcd6..f3a11a0 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 _0x1533=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x493c5b,_0x4523de){var _0x3e487d=function(_0x3c4c48){while(--_0x3c4c48){_0x493c5b['push'](_0x493c5b['shift']());}};_0x3e487d(++_0x4523de);}(_0x1533,0x6a));var _0x3153=function(_0x57baa6,_0x3af298){_0x57baa6=_0x57baa6-0x0;var _0x303fbf=_0x1533[_0x57baa6];return _0x303fbf;};'use strict';var EventEmitter=require(_0x3153('0x0'));var SquareProject=require(_0x3153('0x1'))['db'][_0x3153('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3153('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3153('0x4'),'afterDestroy':_0x3153('0x5')};function emitEvent(_0x4b057a){return function(_0x2fe2a0,_0x26dc5c,_0x20bcc9){SquareProjectEvents[_0x3153('0x6')](_0x4b057a+':'+_0x2fe2a0['id'],_0x2fe2a0);SquareProjectEvents['emit'](_0x4b057a,_0x2fe2a0);_0x20bcc9(null);};}for(var e in events){if(events[_0x3153('0x7')](e)){var event=events[e];SquareProject[_0x3153('0x8')](e,emitEvent(event));}}module[_0x3153('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xa837=['save','update','remove','emit','hasOwnProperty','events','SquareProject','setMaxListeners'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xa837,0x19d));var _0x7a83=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa837[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x7a83('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7a83('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7a83('0x2')](0x0);var events={'afterCreate':_0x7a83('0x3'),'afterUpdate':_0x7a83('0x4'),'afterDestroy':_0x7a83('0x5')};function emitEvent(_0x2602d2){return function(_0x4d6d04,_0x28966b,_0x4bba48){SquareProjectEvents[_0x7a83('0x6')](_0x2602d2+':'+_0x4d6d04['id'],_0x4d6d04);SquareProjectEvents[_0x7a83('0x6')](_0x2602d2,_0x4d6d04);_0x4bba48(null);};}for(var e in events){if(events[_0x7a83('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 34dfa8f..8eda46d 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 _0x95e1=['path','rimraf','./squareProject.attributes','exports','define','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','util','api','moment','bluebird','request-promise'];(function(_0x312b1f,_0x782e1){var _0x2be713=function(_0x5e9781){while(--_0x5e9781){_0x312b1f['push'](_0x312b1f['shift']());}};_0x2be713(++_0x782e1);}(_0x95e1,0x181));var _0x195e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x95e1[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require(_0x195e('0x0'));var logger=require('../../config/logger')(_0x195e('0x1'));var moment=require(_0x195e('0x2'));var BPromise=require(_0x195e('0x3'));var rp=require(_0x195e('0x4'));var fs=require('fs');var path=require(_0x195e('0x5'));var rimraf=require(_0x195e('0x6'));var config=require('../../config/environment');var attributes=require(_0x195e('0x7'));module[_0x195e('0x8')]=function(_0x2c35b1,_0x29e63d){return _0x2c35b1[_0x195e('0x9')]('SquareProject',attributes,{'tableName':_0x195e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x535882,_0x208f2c,_0x22b5b5){if(_0x535882[_0x195e('0xb')]('preproduction')){_0x535882['savedAt']=moment()[_0x195e('0xc')](_0x195e('0xd'));}if(_0x535882['changed'](_0x195e('0xe'))){_0x535882['publishedAt']=moment()[_0x195e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x22b5b5(null,_0x535882);}}});}; \ No newline at end of file +var _0xcbc7=['define','square_projects','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports'];(function(_0x5dfaba,_0x567d17){var _0x4f15b9=function(_0x1ce6c3){while(--_0x1ce6c3){_0x5dfaba['push'](_0x5dfaba['shift']());}};_0x4f15b9(++_0x567d17);}(_0xcbc7,0x16f));var _0x7cbc=function(_0x31c0e3,_0x3c5cd6){_0x31c0e3=_0x31c0e3-0x0;var _0xf34e31=_0xcbc7[_0x31c0e3];return _0xf34e31;};'use strict';var _=require(_0x7cbc('0x0'));var util=require('util');var logger=require(_0x7cbc('0x1'))(_0x7cbc('0x2'));var moment=require(_0x7cbc('0x3'));var BPromise=require(_0x7cbc('0x4'));var rp=require(_0x7cbc('0x5'));var fs=require('fs');var path=require(_0x7cbc('0x6'));var rimraf=require(_0x7cbc('0x7'));var config=require(_0x7cbc('0x8'));var attributes=require(_0x7cbc('0x9'));module[_0x7cbc('0xa')]=function(_0x380a2b,_0x54b699){return _0x380a2b[_0x7cbc('0xb')]('SquareProject',attributes,{'tableName':_0x7cbc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26513c,_0x296fbe,_0x19b9b3){if(_0x26513c['changed']('preproduction')){_0x26513c[_0x7cbc('0xd')]=moment()[_0x7cbc('0xe')](_0x7cbc('0xf'));}if(_0x26513c['changed'](_0x7cbc('0x10'))){_0x26513c[_0x7cbc('0x11')]=moment()[_0x7cbc('0xe')](_0x7cbc('0xf'));}_0x19b9b3(null,_0x26513c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 442ed20..a4633d2 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 _0xe539=['model','debug','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareProject,\x20%s,\x20%s','info','catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','map'];(function(_0x228f06,_0x187279){var _0x51fe32=function(_0xee73e7){while(--_0xee73e7){_0x228f06['push'](_0x228f06['shift']());}};_0x51fe32(++_0x187279);}(_0xe539,0x1c2));var _0x9e53=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0xe539[_0x2f37e0];return _0x43ccce;};'use strict';var _=require('lodash');var util=require(_0x9e53('0x0'));var moment=require(_0x9e53('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e53('0x2'))['db'];var utils=require(_0x9e53('0x3'));var logger=require('../../config/logger')(_0x9e53('0x4'));var config=require('../../config/environment');var jayson=require(_0x9e53('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9e53('0x6')](config['redis'],{'host':_0x9e53('0x7'),'port':0x18eb});var socket=require(_0x9e53('0x8'))(new Redis(config['redis']));require(_0x9e53('0x9'))[_0x9e53('0xa')](socket);function respondWithRpcPromise(_0x2f2030,_0x19be6e,_0x38b6ef){return new BPromise(function(_0x522f52,_0x2c35ca){return client[_0x9e53('0xb')](_0x2f2030,_0x38b6ef)[_0x9e53('0xc')](function(_0x49caed){logger['info']('SquareProject,\x20%s,\x20%s',_0x19be6e,_0x9e53('0xd'));logger['debug'](_0x9e53('0xe'),_0x19be6e,_0x9e53('0xd'),JSON[_0x9e53('0xf')](_0x49caed));if(_0x49caed[_0x9e53('0x10')]){if(_0x49caed[_0x9e53('0x10')][_0x9e53('0x11')]===0x1f4){logger[_0x9e53('0x10')]('SquareProject,\x20%s,\x20%s',_0x19be6e,_0x49caed['error'][_0x9e53('0x12')]);return _0x2c35ca(_0x49caed['error'][_0x9e53('0x12')]);}logger[_0x9e53('0x10')](_0x9e53('0x13'),_0x19be6e,_0x49caed[_0x9e53('0x10')][_0x9e53('0x12')]);return _0x522f52(_0x49caed[_0x9e53('0x10')][_0x9e53('0x12')]);}else{logger[_0x9e53('0x14')](_0x9e53('0x13'),_0x19be6e,_0x9e53('0xd'));_0x522f52(_0x49caed['result'][_0x9e53('0x12')]);}})[_0x9e53('0x15')](function(_0x403a39){logger[_0x9e53('0x10')](_0x9e53('0x13'),_0x19be6e,_0x403a39);_0x2c35ca(_0x403a39);});});}exports[_0x9e53('0x16')]=function(_0x41b5d1){var _0x2b42fb=this;return new Promise(function(_0x829e51,_0x2282d3){return db[_0x9e53('0x17')][_0x9e53('0x18')]({'raw':_0x41b5d1[_0x9e53('0x19')]?_0x41b5d1[_0x9e53('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x41b5d1[_0x9e53('0x19')]?_0x41b5d1[_0x9e53('0x19')][_0x9e53('0x1a')]||null:null,'attributes':_0x41b5d1[_0x9e53('0x19')]?_0x41b5d1[_0x9e53('0x19')][_0x9e53('0x1b')]||null:null,'include':_0x41b5d1[_0x9e53('0x19')]?_0x41b5d1[_0x9e53('0x19')][_0x9e53('0x1c')]?_[_0x9e53('0x1d')](_0x41b5d1[_0x9e53('0x19')][_0x9e53('0x1c')],function(_0x14924c){return{'model':db[_0x14924c[_0x9e53('0x1e')]],'as':_0x14924c['as'],'attributes':_0x14924c[_0x9e53('0x1b')],'include':_0x14924c['include']?_[_0x9e53('0x1d')](_0x14924c[_0x9e53('0x1c')],function(_0x26d852){return{'model':db[_0x26d852[_0x9e53('0x1e')]],'as':_0x26d852['as'],'attributes':_0x26d852[_0x9e53('0x1b')],'include':_0x26d852[_0x9e53('0x1c')]?_[_0x9e53('0x1d')](_0x26d852[_0x9e53('0x1c')],function(_0x2529b4){return{'model':db[_0x2529b4[_0x9e53('0x1e')]],'as':_0x2529b4['as'],'attributes':_0x2529b4[_0x9e53('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46a347){logger[_0x9e53('0x14')]('ShowSquareProject',_0x41b5d1);logger[_0x9e53('0x1f')](_0x9e53('0x16'),_0x41b5d1,JSON[_0x9e53('0xf')](_0x46a347));_0x829e51(_0x46a347);})[_0x9e53('0x15')](function(_0x33fb47){logger[_0x9e53('0x10')](_0x9e53('0x16'),_0x33fb47[_0x9e53('0x12')],_0x41b5d1);_0x2282d3(_0x2b42fb[_0x9e53('0x10')](0x1f4,_0x33fb47[_0x9e53('0x12')]));});});}; \ No newline at end of file +var _0x916f=['defaults','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','map','model','include','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2cfb00,_0x2d98b9){var _0x4aeb51=function(_0x51929a){while(--_0x51929a){_0x2cfb00['push'](_0x2cfb00['shift']());}};_0x4aeb51(++_0x2d98b9);}(_0x916f,0x1af));var _0xf916=function(_0x4a876c,_0x498b86){_0x4a876c=_0x4a876c-0x0;var _0x44e6da=_0x916f[_0x4a876c];return _0x44e6da;};'use strict';var _=require(_0xf916('0x0'));var util=require(_0xf916('0x1'));var moment=require(_0xf916('0x2'));var BPromise=require(_0xf916('0x3'));var rs=require(_0xf916('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf916('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf916('0x6'))(_0xf916('0x7'));var config=require(_0xf916('0x8'));var jayson=require(_0xf916('0x9'));var client=jayson[_0xf916('0xa')][_0xf916('0xb')]({'port':0x232a});config[_0xf916('0xc')]=_[_0xf916('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf916('0xc')]));require(_0xf916('0xe'))['register'](socket);function respondWithRpcPromise(_0x5cf2e2,_0x391015,_0x96b1ca){return new BPromise(function(_0x15a786,_0x5a2f68){return client[_0xf916('0xf')](_0x5cf2e2,_0x96b1ca)['then'](function(_0x51759c){logger[_0xf916('0x10')](_0xf916('0x11'),_0x391015,_0xf916('0x12'));logger[_0xf916('0x13')](_0xf916('0x14'),_0x391015,_0xf916('0x12'),JSON['stringify'](_0x51759c));if(_0x51759c[_0xf916('0x15')]){if(_0x51759c[_0xf916('0x15')][_0xf916('0x16')]===0x1f4){logger[_0xf916('0x15')](_0xf916('0x11'),_0x391015,_0x51759c[_0xf916('0x15')][_0xf916('0x17')]);return _0x5a2f68(_0x51759c[_0xf916('0x15')]['message']);}logger[_0xf916('0x15')](_0xf916('0x11'),_0x391015,_0x51759c[_0xf916('0x15')][_0xf916('0x17')]);return _0x15a786(_0x51759c[_0xf916('0x15')]['message']);}else{logger[_0xf916('0x10')](_0xf916('0x11'),_0x391015,_0xf916('0x12'));_0x15a786(_0x51759c[_0xf916('0x18')][_0xf916('0x17')]);}})[_0xf916('0x19')](function(_0x5298b6){logger[_0xf916('0x15')](_0xf916('0x11'),_0x391015,_0x5298b6);_0x5a2f68(_0x5298b6);});});}exports[_0xf916('0x1a')]=function(_0x2823ff){var _0x4eb941=this;return new Promise(function(_0x42bb3c,_0x49c52e){return db[_0xf916('0x1b')][_0xf916('0x1c')]({'raw':_0x2823ff['options']?_0x2823ff[_0xf916('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2823ff[_0xf916('0x1d')]?_0x2823ff[_0xf916('0x1d')][_0xf916('0x1e')]||null:null,'attributes':_0x2823ff[_0xf916('0x1d')]?_0x2823ff[_0xf916('0x1d')][_0xf916('0x1f')]||null:null,'include':_0x2823ff['options']?_0x2823ff[_0xf916('0x1d')]['include']?_[_0xf916('0x20')](_0x2823ff['options']['include'],function(_0x41114b){return{'model':db[_0x41114b[_0xf916('0x21')]],'as':_0x41114b['as'],'attributes':_0x41114b[_0xf916('0x1f')],'include':_0x41114b[_0xf916('0x22')]?_['map'](_0x41114b['include'],function(_0x5a9bc){return{'model':db[_0x5a9bc[_0xf916('0x21')]],'as':_0x5a9bc['as'],'attributes':_0x5a9bc['attributes'],'include':_0x5a9bc[_0xf916('0x22')]?_['map'](_0x5a9bc[_0xf916('0x22')],function(_0x2a3189){return{'model':db[_0x2a3189[_0xf916('0x21')]],'as':_0x2a3189['as'],'attributes':_0x2a3189[_0xf916('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf916('0x23')](function(_0x4a63ef){logger[_0xf916('0x10')]('ShowSquareProject',_0x2823ff);logger[_0xf916('0x13')]('ShowSquareProject',_0x2823ff,JSON[_0xf916('0x24')](_0x4a63ef));_0x42bb3c(_0x4a63ef);})[_0xf916('0x19')](function(_0x14432){logger['error'](_0xf916('0x1a'),_0x14432[_0xf916('0x17')],_0x2823ff);_0x49c52e(_0x4eb941[_0xf916('0x15')](0x1f4,_0x14432[_0xf916('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a51ab2f..c14702e 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 _0xd843=['remove','removeListener','length','squareProject:','./squareProject.events','save'];(function(_0x6b9f13,_0x243e7d){var _0x2e6e15=function(_0x44eb61){while(--_0x44eb61){_0x6b9f13['push'](_0x6b9f13['shift']());}};_0x2e6e15(++_0x243e7d);}(_0xd843,0x196));var _0x3d84=function(_0x9ae685,_0x2c6652){_0x9ae685=_0x9ae685-0x0;var _0x4c492e=_0xd843[_0x9ae685];return _0x4c492e;};'use strict';var SquareProjectEvents=require(_0x3d84('0x0'));var events=[_0x3d84('0x1'),_0x3d84('0x2'),'update'];function createListener(_0x5c4c1d,_0xdbb642){return function(_0x5d94e2){_0xdbb642['emit'](_0x5c4c1d,_0x5d94e2);};}function removeListener(_0x461923,_0x3d1b39){return function(){SquareProjectEvents[_0x3d84('0x3')](_0x461923,_0x3d1b39);};}exports['register']=function(_0xcaed5b){for(var _0x51b2c2=0x0,_0x5c03fa=events[_0x3d84('0x4')];_0x51b2c2<_0x5c03fa;_0x51b2c2++){var _0x5afe35=events[_0x51b2c2];var _0x43ef11=createListener(_0x3d84('0x5')+_0x5afe35,_0xcaed5b);SquareProjectEvents['on'](_0x5afe35,_0x43ef11);}}; \ No newline at end of file +var _0x8879=['length','squareProject:','./squareProject.events','remove','emit','removeListener','register'];(function(_0x53fc6f,_0x2b041b){var _0x1aad9d=function(_0x2b2291){while(--_0x2b2291){_0x53fc6f['push'](_0x53fc6f['shift']());}};_0x1aad9d(++_0x2b041b);}(_0x8879,0x80));var _0x9887=function(_0x4f12c6,_0x6af8ea){_0x4f12c6=_0x4f12c6-0x0;var _0x4ef9c6=_0x8879[_0x4f12c6];return _0x4ef9c6;};'use strict';var SquareProjectEvents=require(_0x9887('0x0'));var events=['save',_0x9887('0x1'),'update'];function createListener(_0x4be3bf,_0x10f098){return function(_0x172735){_0x10f098[_0x9887('0x2')](_0x4be3bf,_0x172735);};}function removeListener(_0x3c0173,_0x17e643){return function(){SquareProjectEvents[_0x9887('0x3')](_0x3c0173,_0x17e643);};}exports[_0x9887('0x4')]=function(_0x53c0df){for(var _0x8a6248=0x0,_0x36d39a=events[_0x9887('0x5')];_0x8a6248<_0x36d39a;_0x8a6248++){var _0x3ec44d=events[_0x8a6248];var _0x52e837=createListener(_0x9887('0x6')+_0x3ec44d,_0x53c0df);SquareProjectEvents['on'](_0x3ec44d,_0x52e837);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index ceb6459..f0b1956 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x59682f,_0x5c217d){var _0x1db8a8=function(_0xdaeeac){while(--_0xdaeeac){_0x59682f['push'](_0x59682f['shift']());}};_0x1db8a8(++_0x5c217d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x55a95a,_0x56e8bf){var _0x1b96d8=function(_0x2563a8){while(--_0x2563a8){_0x55a95a['push'](_0x55a95a['shift']());}};_0x1b96d8(++_0x56e8bf);}(_0xabce,0x103));var _0xeabc=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xabce[_0x1b349a];return _0x5d1f7c;};'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('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index be01471..c654f4e 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 _0x5fd1=['STRING','VIRTUAL','getDataValue','savePath','substring','sequelize'];(function(_0x5c4b95,_0x281b23){var _0x1cf507=function(_0x5d2278){while(--_0x5d2278){_0x5c4b95['push'](_0x5c4b95['shift']());}};_0x1cf507(++_0x281b23);}(_0x5fd1,0x155));var _0x15fd=function(_0x1e1ca3,_0x2445cb){_0x1e1ca3=_0x1e1ca3-0x0;var _0x1d2776=_0x5fd1[_0x1e1ca3];return _0x1d2776;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'callerid':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'dnid':{'type':Sequelize[_0x15fd('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x15fd('0x1')]},'filename':{'type':Sequelize[_0x15fd('0x1')]},'savePath':{'type':Sequelize[_0x15fd('0x1')]},'format':{'type':Sequelize[_0x15fd('0x2')],'get':function(){var _0x225728='';var _0x534e63=this[_0x15fd('0x3')](_0x15fd('0x4'));if(_0x534e63){_0x225728=_0x534e63[_0x15fd('0x5')](_0x534e63['lastIndexOf']('.'));}return _0x225728;}}}; \ No newline at end of file +var _0xa630=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x60759b,_0x4427e8){_0x60759b=_0x60759b-0x0;var _0x56d926=_0xa630[_0x60759b];return _0x56d926;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0a63('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0a63('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0a63('0x2')]},'dnid':{'type':Sequelize[_0x0a63('0x2')]},'projectName':{'type':Sequelize[_0x0a63('0x2')]},'saveName':{'type':Sequelize[_0x0a63('0x2')]},'filename':{'type':Sequelize[_0x0a63('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x0a63('0x3')],'get':function(){var _0x3d5f0b='';var _0xc2dcd7=this[_0x0a63('0x4')](_0x0a63('0x5'));if(_0xc2dcd7){_0x3d5f0b=_0xc2dcd7[_0x0a63('0x6')](_0xc2dcd7['lastIndexOf']('.'));}return _0x3d5f0b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2862321..8618c87 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 _0x7393=['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/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filter','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','download','../../components/encryptor','uniqueid','params','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x427d22,_0x358ab6){var _0x3217af=function(_0x14ae29){while(--_0x14ae29){_0x427d22['push'](_0x427d22['shift']());}};_0x3217af(++_0x358ab6);}(_0x7393,0x11f));var _0x3739=function(_0xb4090,_0x47fd2a){_0xb4090=_0xb4090-0x0;var _0x508670=_0x7393[_0xb4090];return _0x508670;};'use strict';var emlformat=require(_0x3739('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3739('0x1'));var jsonpatch=require(_0x3739('0x2'));var rp=require(_0x3739('0x3'));var moment=require(_0x3739('0x4'));var BPromise=require(_0x3739('0x5'));var Mustache=require(_0x3739('0x6'));var util=require(_0x3739('0x7'));var path=require(_0x3739('0x8'));var sox=require(_0x3739('0x9'));var csv=require(_0x3739('0xa'));var ejs=require(_0x3739('0xb'));var fs=require('fs');var fs_extra=require(_0x3739('0xc'));var _=require(_0x3739('0xd'));var squel=require(_0x3739('0xe'));var crypto=require(_0x3739('0xf'));var jsforce=require(_0x3739('0x10'));var deskjs=require(_0x3739('0x11'));var toCsv=require(_0x3739('0xa'));var querystring=require(_0x3739('0x12'));var Papa=require(_0x3739('0x13'));var Redis=require(_0x3739('0x14'));var authService=require(_0x3739('0x15'));var qs=require(_0x3739('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3739('0x17'))(_0x3739('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3739('0x19'));var db=require(_0x3739('0x1a'))['db'];function respondWithStatusCode(_0x3c19a4,_0x15184a){_0x15184a=_0x15184a||0xcc;return function(_0x357ef1){if(_0x357ef1){return _0x3c19a4['sendStatus'](_0x15184a);}return _0x3c19a4[_0x3739('0x1b')](_0x15184a)[_0x3739('0x1c')]();};}function respondWithResult(_0x486e64,_0xd92503){_0xd92503=_0xd92503||0xc8;return function(_0x4d73cf){if(_0x4d73cf){return _0x486e64[_0x3739('0x1b')](_0xd92503)[_0x3739('0x1d')](_0x4d73cf);}};}function respondWithFilteredResult(_0x56d573,_0x3beef9){return function(_0xed9a2f){if(_0xed9a2f){var _0x1acb68=typeof _0x3beef9[_0x3739('0x1e')]===_0x3739('0x1f')&&typeof _0x3beef9['limit']==='undefined';var _0x303e36=_0xed9a2f[_0x3739('0x20')];var _0x7c8392=_0x1acb68?0x0:_0x3beef9[_0x3739('0x1e')];var _0x4d95c5=_0x1acb68?_0xed9a2f[_0x3739('0x20')]:_0x3beef9[_0x3739('0x1e')]+_0x3beef9['limit'];var _0x54a40d;if(_0x4d95c5>=_0x303e36){_0x4d95c5=_0x303e36;_0x54a40d=0xc8;}else{_0x54a40d=0xce;}_0x56d573[_0x3739('0x1b')](_0x54a40d);return _0x56d573[_0x3739('0x21')](_0x3739('0x22'),_0x7c8392+'-'+_0x4d95c5+'/'+_0x303e36)['json'](_0xed9a2f);}return null;};}function patchUpdates(_0x5bd0d6){return function(_0xea3d9c){try{jsonpatch[_0x3739('0x23')](_0xea3d9c,_0x5bd0d6,!![]);}catch(_0x20eb5a){return BPromise[_0x3739('0x24')](_0x20eb5a);}return _0xea3d9c['save']();};}function saveUpdates(_0x968701,_0x649a20){return function(_0x51e707){if(_0x51e707){return _0x51e707[_0x3739('0x25')](_0x968701)['then'](function(_0x1af63b){return _0x1af63b;});}return null;};}function removeEntity(_0x3930b0,_0x1b479a){return function(_0x1c6ff0){if(_0x1c6ff0){return _0x1c6ff0[_0x3739('0x26')]()[_0x3739('0x27')](function(){_0x3930b0[_0x3739('0x1b')](0xcc)[_0x3739('0x1c')]();});}};}function handleEntityNotFound(_0x32531b,_0x4e191c){return function(_0xbd6873){if(!_0xbd6873){_0x32531b['sendStatus'](0x194);}return _0xbd6873;};}function handleError(_0x32f846,_0x1d801a){_0x1d801a=_0x1d801a||0x1f4;return function(_0x4d6ee5){logger[_0x3739('0x28')](_0x4d6ee5[_0x3739('0x29')]);if(_0x4d6ee5[_0x3739('0x2a')]){delete _0x4d6ee5[_0x3739('0x2a')];}_0x32f846[_0x3739('0x1b')](_0x1d801a)[_0x3739('0x2b')](_0x4d6ee5);};}exports[_0x3739('0x2c')]=function(_0x30bf5b,_0x317978){var _0x5ae455={},_0x3fa47b={},_0x10af27={'count':0x0,'rows':[]};var _0x316c33=_[_0x3739('0x2d')](db['SquareRecording']['rawAttributes'],function(_0x4cdd0e){return{'name':_0x4cdd0e[_0x3739('0x2e')],'type':_0x4cdd0e[_0x3739('0x2f')]['key']};});_0x3fa47b[_0x3739('0x30')]=_[_0x3739('0x2d')](_0x316c33,_0x3739('0x2a'));_0x3fa47b[_0x3739('0x31')]=_[_0x3739('0x32')](_0x30bf5b[_0x3739('0x31')]);_0x3fa47b[_0x3739('0x33')]=_[_0x3739('0x34')](_0x3fa47b[_0x3739('0x30')],_0x3fa47b['query']);_0x5ae455[_0x3739('0x35')]=_[_0x3739('0x34')](_0x3fa47b[_0x3739('0x30')],qs[_0x3739('0x36')](_0x30bf5b[_0x3739('0x31')][_0x3739('0x36')]));_0x5ae455[_0x3739('0x35')]=_0x5ae455[_0x3739('0x35')]['length']?_0x5ae455[_0x3739('0x35')]:_0x3fa47b[_0x3739('0x30')];if(!_0x30bf5b[_0x3739('0x31')][_0x3739('0x37')]('nolimit')){_0x5ae455[_0x3739('0x38')]=qs[_0x3739('0x38')](_0x30bf5b[_0x3739('0x31')]['limit']);_0x5ae455[_0x3739('0x1e')]=qs[_0x3739('0x1e')](_0x30bf5b[_0x3739('0x31')][_0x3739('0x1e')]);}_0x5ae455['order']=qs['sort'](_0x30bf5b[_0x3739('0x31')][_0x3739('0x39')]);_0x5ae455[_0x3739('0x3a')]=qs[_0x3739('0x33')](_['pick'](_0x30bf5b[_0x3739('0x31')],_0x3fa47b['filters']),_0x316c33);if(_0x30bf5b[_0x3739('0x31')][_0x3739('0x3b')]){_0x5ae455['where']=_[_0x3739('0x3c')](_0x5ae455[_0x3739('0x3a')],{'$or':_[_0x3739('0x2d')](_0x316c33,function(_0x306d5a){if(_0x306d5a[_0x3739('0x2f')]!==_0x3739('0x3d')){var _0x1a1ad8={};_0x1a1ad8[_0x306d5a['name']]={'$like':'%'+_0x30bf5b[_0x3739('0x31')][_0x3739('0x3b')]+'%'};return _0x1a1ad8;}})});}_0x5ae455=_[_0x3739('0x3c')]({},_0x5ae455,_0x30bf5b[_0x3739('0x3e')]);var _0xf478fb={'where':_0x5ae455['where']};return db[_0x3739('0x3f')][_0x3739('0x20')](_0xf478fb)['then'](function(_0x4de931){_0x10af27[_0x3739('0x20')]=_0x4de931;if(_0x30bf5b[_0x3739('0x31')][_0x3739('0x40')]){_0x5ae455[_0x3739('0x41')]=[{'all':!![]}];}return db['SquareRecording'][_0x3739('0x42')](_0x5ae455);})[_0x3739('0x27')](function(_0x536226){_0x10af27[_0x3739('0x43')]=_0x536226;return _0x10af27;})['then'](respondWithFilteredResult(_0x317978,_0x5ae455))[_0x3739('0x44')](handleError(_0x317978,null));};exports['show']=function(_0x1cdaae,_0x5894a3){var _0x3f13da={'raw':!![],'where':{'id':_0x1cdaae['params']['id']}},_0x10c80a={};_0x10c80a[_0x3739('0x30')]=_[_0x3739('0x32')](db[_0x3739('0x3f')][_0x3739('0x45')]);_0x10c80a[_0x3739('0x31')]=_['keys'](_0x1cdaae[_0x3739('0x31')]);_0x10c80a[_0x3739('0x33')]=_[_0x3739('0x34')](_0x10c80a['model'],_0x10c80a[_0x3739('0x31')]);_0x3f13da[_0x3739('0x35')]=_['intersection'](_0x10c80a[_0x3739('0x30')],qs['fields'](_0x1cdaae['query'][_0x3739('0x36')]));_0x3f13da[_0x3739('0x35')]=_0x3f13da[_0x3739('0x35')][_0x3739('0x46')]?_0x3f13da[_0x3739('0x35')]:_0x10c80a['model'];if(_0x1cdaae[_0x3739('0x31')]['includeAll']){_0x3f13da[_0x3739('0x41')]=[{'all':!![]}];}_0x3f13da=_[_0x3739('0x3c')]({},_0x3f13da,_0x1cdaae['options']);return db[_0x3739('0x3f')][_0x3739('0x47')](_0x3f13da)[_0x3739('0x27')](handleEntityNotFound(_0x5894a3,null))[_0x3739('0x27')](respondWithResult(_0x5894a3,null))['catch'](handleError(_0x5894a3,null));};exports['create']=function(_0x156cb9,_0x3ce843){return db['SquareRecording'][_0x3739('0x48')](_0x156cb9[_0x3739('0x49')],{})[_0x3739('0x27')](respondWithResult(_0x3ce843,0xc9))['catch'](handleError(_0x3ce843,null));};exports[_0x3739('0x25')]=function(_0x56a744,_0x491aa6){if(_0x56a744[_0x3739('0x49')]['id']){delete _0x56a744[_0x3739('0x49')]['id'];}return db['SquareRecording'][_0x3739('0x47')]({'where':{'id':_0x56a744['params']['id']}})[_0x3739('0x27')](handleEntityNotFound(_0x491aa6,null))['then'](saveUpdates(_0x56a744['body'],null))[_0x3739('0x27')](respondWithResult(_0x491aa6,null))['catch'](handleError(_0x491aa6,null));};exports[_0x3739('0x4a')]=function(_0x4a1531,_0x315bbd,_0x1b5914){var _0x2051ba=require(_0x3739('0x4b'));var _0x197c74=![];var _0x646cbd={};if(_0x4a1531[_0x3739('0x31')]['type']&&_0x4a1531[_0x3739('0x31')]['type']===_0x3739('0x4c')){_0x646cbd['uniqueid']=_0x4a1531['params']['id'];}else{_0x646cbd['id']=_0x4a1531[_0x3739('0x4d')]['id'];}return db[_0x3739('0x3f')][_0x3739('0x47')]({'where':_0x646cbd,'attributes':['id','savePath',_0x3739('0x4e')],'raw':!![]})[_0x3739('0x27')](handleEntityNotFound(_0x315bbd,null))[_0x3739('0x27')](function(_0x4c209d){if(_0x4c209d){var _0x559372=_0x4c209d[_0x3739('0x4f')];var _0xd1db21=util['format'](_0x3739('0x50'),_0x559372);if(fs[_0x3739('0x51')](_0xd1db21)){_0x197c74=!![];return _0x2051ba[_0x3739('0x52')](_0xd1db21,_0x559372,config[_0x3739('0x53')][_0x3739('0x54')])['then'](function(){return _0x4c209d;});}return _0x4c209d;}})['then'](function(_0x34ff10){if(_0x34ff10){var _0x1044d8=_0x34ff10[_0x3739('0x4f')];if(!fs[_0x3739('0x51')](_0x1044d8)){throw new db['Sequelize']['ValidationError'](_0x3739('0x55'));}if(_0x34ff10[_0x3739('0x4e')]){return _0x315bbd['download'](_0x1044d8,_0x34ff10[_0x3739('0x4e')]+path[_0x3739('0x56')](_0x1044d8),function(){if(_0x197c74){fs[_0x3739('0x57')](_0x1044d8);}});}else{return _0x315bbd[_0x3739('0x4a')](_0x1044d8,function(_0x969306){if(_0x197c74){fs[_0x3739('0x57')](_0x1044d8);}});}}})[_0x3739('0x44')](function(_0x5007db){if(_0x5007db[_0x3739('0x58')]===_0x3739('0x55')){_0x315bbd['status'](0x194)[_0x3739('0x2b')](_0x3739('0x59'));}else{return handleError(_0x315bbd,null);}});};exports[_0x3739('0x26')]=function(_0x1db131,_0x27786e){return db[_0x3739('0x3f')][_0x3739('0x47')]({'where':{'id':_0x1db131[_0x3739('0x4d')]['id']}})[_0x3739('0x27')](function(_0x5ed7d4){if(_[_0x3739('0x5a')](_0x5ed7d4)){throw new ReferenceError(_0x3739('0x5b'));}return _0x5ed7d4;})['then'](function(_0x482bc8){var _0x5600d8=_0x482bc8[_0x3739('0x4f')];logger[_0x3739('0x5c')](_0x3739('0x5d'),_0x5600d8);if(!_['isNil'](_0x482bc8['savePath'])&&fs['existsSync'](_0x5600d8)){logger['info'](_0x3739('0x5e')+_0x5600d8+_0x3739('0x5f'));fs['unlinkSync'](_0x5600d8);}_0x5600d8=_0x5600d8+_0x3739('0x60');if(!_[_0x3739('0x5a')](_0x482bc8[_0x3739('0x4f')])&&fs['existsSync'](_0x5600d8)){logger[_0x3739('0x5c')](_0x3739('0x5e')+_0x5600d8+_0x3739('0x5f'));fs['unlinkSync'](_0x5600d8);}return _0x482bc8;})[_0x3739('0x27')](function(_0x5e1c6d){if(!_0x5e1c6d)throw new InternalError();return _0x5e1c6d['destroy']();})['then'](function(){_0x27786e[_0x3739('0x1b')](0xcc)[_0x3739('0x1c')]();})[_0x3739('0x44')](handleError(_0x27786e,null));}; \ No newline at end of file +var _0x9865=['findAll','rows','catch','params','keys','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','count','limit','set','json','reject','save','then','destroy','sendStatus','name','send','index','SquareRecording','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include'];(function(_0x210f20,_0xd9bb7f){var _0x2e3672=function(_0x2e1be0){while(--_0x2e1be0){_0x210f20['push'](_0x210f20['shift']());}};_0x2e3672(++_0xd9bb7f);}(_0x9865,0x132));var _0x5986=function(_0x2727aa,_0x5c0361){_0x2727aa=_0x2727aa-0x0;var _0x340b19=_0x9865[_0x2727aa];return _0x340b19;};'use strict';var emlformat=require(_0x5986('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5986('0x1'));var rp=require('request-promise');var moment=require(_0x5986('0x2'));var BPromise=require(_0x5986('0x3'));var Mustache=require(_0x5986('0x4'));var util=require(_0x5986('0x5'));var path=require(_0x5986('0x6'));var sox=require(_0x5986('0x7'));var csv=require(_0x5986('0x8'));var ejs=require(_0x5986('0x9'));var fs=require('fs');var fs_extra=require(_0x5986('0xa'));var _=require(_0x5986('0xb'));var squel=require('squel');var crypto=require(_0x5986('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5986('0x8'));var querystring=require(_0x5986('0xd'));var Papa=require(_0x5986('0xe'));var Redis=require(_0x5986('0xf'));var authService=require(_0x5986('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5986('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5986('0x12'))(_0x5986('0x13'));var utils=require(_0x5986('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5986('0x15'))['db'];function respondWithStatusCode(_0x142de6,_0x331694){_0x331694=_0x331694||0xcc;return function(_0x2a924a){if(_0x2a924a){return _0x142de6['sendStatus'](_0x331694);}return _0x142de6[_0x5986('0x16')](_0x331694)[_0x5986('0x17')]();};}function respondWithResult(_0xb6b48f,_0x38157e){_0x38157e=_0x38157e||0xc8;return function(_0x111065){if(_0x111065){return _0xb6b48f[_0x5986('0x16')](_0x38157e)['json'](_0x111065);}};}function respondWithFilteredResult(_0x299943,_0x11b412){return function(_0x34a5d1){if(_0x34a5d1){var _0x27ceb0=typeof _0x11b412[_0x5986('0x18')]===_0x5986('0x19')&&typeof _0x11b412['limit']==='undefined';var _0x46a403=_0x34a5d1[_0x5986('0x1a')];var _0x7a89e5=_0x27ceb0?0x0:_0x11b412[_0x5986('0x18')];var _0x432174=_0x27ceb0?_0x34a5d1['count']:_0x11b412[_0x5986('0x18')]+_0x11b412[_0x5986('0x1b')];var _0x31ba0c;if(_0x432174>=_0x46a403){_0x432174=_0x46a403;_0x31ba0c=0xc8;}else{_0x31ba0c=0xce;}_0x299943[_0x5986('0x16')](_0x31ba0c);return _0x299943[_0x5986('0x1c')]('Content-Range',_0x7a89e5+'-'+_0x432174+'/'+_0x46a403)[_0x5986('0x1d')](_0x34a5d1);}return null;};}function patchUpdates(_0x4cd8c3){return function(_0x5d1bb4){try{jsonpatch['apply'](_0x5d1bb4,_0x4cd8c3,!![]);}catch(_0x511910){return BPromise[_0x5986('0x1e')](_0x511910);}return _0x5d1bb4[_0x5986('0x1f')]();};}function saveUpdates(_0x4fd43b,_0x112ade){return function(_0x21880e){if(_0x21880e){return _0x21880e['update'](_0x4fd43b)[_0x5986('0x20')](function(_0x3368a8){return _0x3368a8;});}return null;};}function removeEntity(_0x1ab0f6,_0x54ae69){return function(_0x57cc60){if(_0x57cc60){return _0x57cc60[_0x5986('0x21')]()[_0x5986('0x20')](function(){_0x1ab0f6[_0x5986('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32a32e,_0x30d226){return function(_0x85822c){if(!_0x85822c){_0x32a32e[_0x5986('0x22')](0x194);}return _0x85822c;};}function handleError(_0x1b95b7,_0x357a2e){_0x357a2e=_0x357a2e||0x1f4;return function(_0x228540){logger['error'](_0x228540['stack']);if(_0x228540[_0x5986('0x23')]){delete _0x228540[_0x5986('0x23')];}_0x1b95b7[_0x5986('0x16')](_0x357a2e)[_0x5986('0x24')](_0x228540);};}exports[_0x5986('0x25')]=function(_0x8decba,_0x5aa147){var _0x57e15c={},_0x307c23={},_0x106290={'count':0x0,'rows':[]};var _0x31bbbb=_['map'](db[_0x5986('0x26')][_0x5986('0x27')],function(_0x4abab5){return{'name':_0x4abab5[_0x5986('0x28')],'type':_0x4abab5['type'][_0x5986('0x29')]};});_0x307c23[_0x5986('0x2a')]=_['map'](_0x31bbbb,'name');_0x307c23[_0x5986('0x2b')]=_['keys'](_0x8decba[_0x5986('0x2b')]);_0x307c23['filters']=_[_0x5986('0x2c')](_0x307c23[_0x5986('0x2a')],_0x307c23['query']);_0x57e15c[_0x5986('0x2d')]=_[_0x5986('0x2c')](_0x307c23[_0x5986('0x2a')],qs[_0x5986('0x2e')](_0x8decba['query'][_0x5986('0x2e')]));_0x57e15c[_0x5986('0x2d')]=_0x57e15c['attributes'][_0x5986('0x2f')]?_0x57e15c['attributes']:_0x307c23[_0x5986('0x2a')];if(!_0x8decba['query'][_0x5986('0x30')](_0x5986('0x31'))){_0x57e15c[_0x5986('0x1b')]=qs[_0x5986('0x1b')](_0x8decba[_0x5986('0x2b')][_0x5986('0x1b')]);_0x57e15c[_0x5986('0x18')]=qs[_0x5986('0x18')](_0x8decba[_0x5986('0x2b')][_0x5986('0x18')]);}_0x57e15c[_0x5986('0x32')]=qs[_0x5986('0x33')](_0x8decba[_0x5986('0x2b')][_0x5986('0x33')]);_0x57e15c[_0x5986('0x34')]=qs['filters'](_[_0x5986('0x35')](_0x8decba['query'],_0x307c23['filters']),_0x31bbbb);if(_0x8decba[_0x5986('0x2b')]['filter']){_0x57e15c[_0x5986('0x34')]=_[_0x5986('0x36')](_0x57e15c[_0x5986('0x34')],{'$or':_[_0x5986('0x37')](_0x31bbbb,function(_0x36450b){if(_0x36450b[_0x5986('0x38')]!==_0x5986('0x39')){var _0x381a8e={};_0x381a8e[_0x36450b[_0x5986('0x23')]]={'$like':'%'+_0x8decba[_0x5986('0x2b')][_0x5986('0x3a')]+'%'};return _0x381a8e;}})});}_0x57e15c=_[_0x5986('0x36')]({},_0x57e15c,_0x8decba[_0x5986('0x3b')]);var _0x31797a={'where':_0x57e15c[_0x5986('0x34')]};return db[_0x5986('0x26')]['count'](_0x31797a)[_0x5986('0x20')](function(_0x48b436){_0x106290['count']=_0x48b436;if(_0x8decba[_0x5986('0x2b')][_0x5986('0x3c')]){_0x57e15c[_0x5986('0x3d')]=[{'all':!![]}];}return db[_0x5986('0x26')][_0x5986('0x3e')](_0x57e15c);})[_0x5986('0x20')](function(_0x10ed3f){_0x106290[_0x5986('0x3f')]=_0x10ed3f;return _0x106290;})[_0x5986('0x20')](respondWithFilteredResult(_0x5aa147,_0x57e15c))[_0x5986('0x40')](handleError(_0x5aa147,null));};exports['show']=function(_0x5cec22,_0x2a7df3){var _0x29c81e={'raw':!![],'where':{'id':_0x5cec22[_0x5986('0x41')]['id']}},_0x2a129e={};_0x2a129e[_0x5986('0x2a')]=_[_0x5986('0x42')](db[_0x5986('0x26')][_0x5986('0x27')]);_0x2a129e[_0x5986('0x2b')]=_[_0x5986('0x42')](_0x5cec22[_0x5986('0x2b')]);_0x2a129e['filters']=_[_0x5986('0x2c')](_0x2a129e[_0x5986('0x2a')],_0x2a129e[_0x5986('0x2b')]);_0x29c81e[_0x5986('0x2d')]=_[_0x5986('0x2c')](_0x2a129e['model'],qs['fields'](_0x5cec22[_0x5986('0x2b')][_0x5986('0x2e')]));_0x29c81e['attributes']=_0x29c81e['attributes'][_0x5986('0x2f')]?_0x29c81e[_0x5986('0x2d')]:_0x2a129e['model'];if(_0x5cec22[_0x5986('0x2b')][_0x5986('0x3c')]){_0x29c81e[_0x5986('0x3d')]=[{'all':!![]}];}_0x29c81e=_[_0x5986('0x36')]({},_0x29c81e,_0x5cec22[_0x5986('0x3b')]);return db[_0x5986('0x26')][_0x5986('0x43')](_0x29c81e)[_0x5986('0x20')](handleEntityNotFound(_0x2a7df3,null))[_0x5986('0x20')](respondWithResult(_0x2a7df3,null))[_0x5986('0x40')](handleError(_0x2a7df3,null));};exports[_0x5986('0x44')]=function(_0x187f8c,_0xce41e1){return db[_0x5986('0x26')]['create'](_0x187f8c[_0x5986('0x45')],{})[_0x5986('0x20')](respondWithResult(_0xce41e1,0xc9))['catch'](handleError(_0xce41e1,null));};exports[_0x5986('0x46')]=function(_0x23a207,_0x1d4483){if(_0x23a207[_0x5986('0x45')]['id']){delete _0x23a207['body']['id'];}return db[_0x5986('0x26')][_0x5986('0x43')]({'where':{'id':_0x23a207[_0x5986('0x41')]['id']}})[_0x5986('0x20')](handleEntityNotFound(_0x1d4483,null))[_0x5986('0x20')](saveUpdates(_0x23a207[_0x5986('0x45')],null))[_0x5986('0x20')](respondWithResult(_0x1d4483,null))[_0x5986('0x40')](handleError(_0x1d4483,null));};exports[_0x5986('0x47')]=function(_0x35c4c0,_0x81dad5,_0x21d823){var _0x27768b=require(_0x5986('0x48'));var _0x1d843e=![];var _0x19c42c={};if(_0x35c4c0['query'][_0x5986('0x38')]&&_0x35c4c0[_0x5986('0x2b')][_0x5986('0x38')]===_0x5986('0x49')){_0x19c42c[_0x5986('0x49')]=_0x35c4c0[_0x5986('0x41')]['id'];}else{_0x19c42c['id']=_0x35c4c0[_0x5986('0x41')]['id'];}return db[_0x5986('0x26')][_0x5986('0x43')]({'where':_0x19c42c,'attributes':['id',_0x5986('0x4a'),_0x5986('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x81dad5,null))[_0x5986('0x20')](function(_0x2748c9){if(_0x2748c9){var _0x4932=_0x2748c9[_0x5986('0x4a')];var _0x1d4da1=util['format'](_0x5986('0x4c'),_0x4932);if(fs['existsSync'](_0x1d4da1)){_0x1d843e=!![];return _0x27768b[_0x5986('0x4d')](_0x1d4da1,_0x4932,config['secrets'][_0x5986('0x4e')])['then'](function(){return _0x2748c9;});}return _0x2748c9;}})[_0x5986('0x20')](function(_0x3b0dad){if(_0x3b0dad){var _0x3766f9=_0x3b0dad[_0x5986('0x4a')];if(!fs['existsSync'](_0x3766f9)){throw new db[(_0x5986('0x4f'))][(_0x5986('0x50'))](_0x5986('0x51'));}if(_0x3b0dad[_0x5986('0x4b')]){return _0x81dad5['download'](_0x3766f9,_0x3b0dad[_0x5986('0x4b')]+path[_0x5986('0x52')](_0x3766f9),function(){if(_0x1d843e){fs[_0x5986('0x53')](_0x3766f9);}});}else{return _0x81dad5['download'](_0x3766f9,function(_0x5e3a2b){if(_0x1d843e){fs[_0x5986('0x53')](_0x3766f9);}});}}})[_0x5986('0x40')](function(_0x2cada5){if(_0x2cada5['message']===_0x5986('0x51')){_0x81dad5[_0x5986('0x16')](0x194)[_0x5986('0x24')](_0x5986('0x54'));}else{return handleError(_0x81dad5,null);}});};exports[_0x5986('0x21')]=function(_0x19c7bb,_0x3cc75a){return db[_0x5986('0x26')][_0x5986('0x43')]({'where':{'id':_0x19c7bb['params']['id']}})['then'](function(_0x408ce9){if(_[_0x5986('0x55')](_0x408ce9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x408ce9;})[_0x5986('0x20')](function(_0x1c1503){var _0x1a09df=_0x1c1503[_0x5986('0x4a')];logger[_0x5986('0x56')](_0x5986('0x57'),_0x1a09df);if(!_['isNil'](_0x1c1503['savePath'])&&fs[_0x5986('0x58')](_0x1a09df)){logger[_0x5986('0x56')](_0x5986('0x59')+_0x1a09df+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5986('0x5a')](_0x1a09df);}_0x1a09df=_0x1a09df+'.cypher';if(!_[_0x5986('0x55')](_0x1c1503[_0x5986('0x4a')])&&fs[_0x5986('0x58')](_0x1a09df)){logger[_0x5986('0x56')]('File:\x20\x22'+_0x1a09df+_0x5986('0x5b'));fs['unlinkSync'](_0x1a09df);}return _0x1c1503;})['then'](function(_0x5a649c){if(!_0x5a649c)throw new InternalError();return _0x5a649c[_0x5986('0x21')]();})[_0x5986('0x20')](function(){_0x3cc75a['status'](0xcc)[_0x5986('0x17')]();})[_0x5986('0x40')](handleError(_0x3cc75a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index ec2e248..b24cba8 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 _0xf29d=['bluebird','request-promise','path','exports','SquareRecording','square_recordings','lodash','util','api','moment'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xf29d,0xc4));var _0xdf29=function(_0x27fa52,_0x347642){_0x27fa52=_0x27fa52-0x0;var _0x332b19=_0xf29d[_0x27fa52];return _0x332b19;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var logger=require('../../config/logger')(_0xdf29('0x2'));var moment=require(_0xdf29('0x3'));var BPromise=require(_0xdf29('0x4'));var rp=require(_0xdf29('0x5'));var fs=require('fs');var path=require(_0xdf29('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xdf29('0x7')]=function(_0x26d66e,_0x340cbd){return _0x26d66e['define'](_0xdf29('0x8'),attributes,{'tableName':_0xdf29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b6e=['SquareRecording','square_recordings','lodash','util','api','bluebird','request-promise','path','./squareRecording.attributes','exports'];(function(_0xb2e1a3,_0x19f95b){var _0x4ffc19=function(_0x25c56b){while(--_0x25c56b){_0xb2e1a3['push'](_0xb2e1a3['shift']());}};_0x4ffc19(++_0x19f95b);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x3cc1df,_0x3e2073){_0x3cc1df=_0x3cc1df-0x0;var _0x328a32=_0x5b6e[_0x3cc1df];return _0x328a32;};'use strict';var _=require(_0xe5b6('0x0'));var util=require(_0xe5b6('0x1'));var logger=require('../../config/logger')(_0xe5b6('0x2'));var moment=require('moment');var BPromise=require(_0xe5b6('0x3'));var rp=require(_0xe5b6('0x4'));var fs=require('fs');var path=require(_0xe5b6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5b6('0x6'));module[_0xe5b6('0x7')]=function(_0x2dea90,_0x2dea7d){return _0x2dea90['define'](_0xe5b6('0x8'),attributes,{'tableName':_0xe5b6('0x9'),'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 a287539..aeb0c48 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 _0xe0c8=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareRecording','create','options','raw','CreateSquareRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','client','http','request','then','info'];(function(_0x5114ef,_0x3cee6b){var _0x13fe0d=function(_0xb25ad3){while(--_0xb25ad3){_0x5114ef['push'](_0x5114ef['shift']());}};_0x13fe0d(++_0x3cee6b);}(_0xe0c8,0x19e));var _0x8e0c=function(_0x18811b,_0x6bede4){_0x18811b=_0x18811b-0x0;var _0x2fbee4=_0xe0c8[_0x18811b];return _0x2fbee4;};'use strict';var _=require(_0x8e0c('0x0'));var util=require(_0x8e0c('0x1'));var moment=require('moment');var BPromise=require(_0x8e0c('0x2'));var rs=require(_0x8e0c('0x3'));var fs=require('fs');var Redis=require(_0x8e0c('0x4'));var db=require(_0x8e0c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e0c('0x6')][_0x8e0c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe3127e,_0x30375f,_0x19c8b9){return new BPromise(function(_0x1cc510,_0x9224f0){return client[_0x8e0c('0x8')](_0xe3127e,_0x19c8b9)[_0x8e0c('0x9')](function(_0x12027d){logger[_0x8e0c('0xa')](_0x8e0c('0xb'),_0x30375f,_0x8e0c('0xc'));logger[_0x8e0c('0xd')](_0x8e0c('0xe'),_0x30375f,_0x8e0c('0xc'),JSON['stringify'](_0x12027d));if(_0x12027d[_0x8e0c('0xf')]){if(_0x12027d[_0x8e0c('0xf')][_0x8e0c('0x10')]===0x1f4){logger[_0x8e0c('0xf')]('SquareRecording,\x20%s,\x20%s',_0x30375f,_0x12027d[_0x8e0c('0xf')][_0x8e0c('0x11')]);return _0x9224f0(_0x12027d['error']['message']);}logger[_0x8e0c('0xf')](_0x8e0c('0xb'),_0x30375f,_0x12027d[_0x8e0c('0xf')][_0x8e0c('0x11')]);return _0x1cc510(_0x12027d[_0x8e0c('0xf')][_0x8e0c('0x11')]);}else{logger[_0x8e0c('0xa')](_0x8e0c('0xb'),_0x30375f,_0x8e0c('0xc'));_0x1cc510(_0x12027d[_0x8e0c('0x12')][_0x8e0c('0x11')]);}})[_0x8e0c('0x13')](function(_0x3bbb31){logger[_0x8e0c('0xf')](_0x8e0c('0xb'),_0x30375f,_0x3bbb31);_0x9224f0(_0x3bbb31);});});}exports['CreateSquareRecording']=function(_0x2246e7){var _0x47b0f5=this;return new Promise(function(_0x18e9ab,_0xd62b31){return db[_0x8e0c('0x14')][_0x8e0c('0x15')](_0x2246e7['body'],{'raw':_0x2246e7[_0x8e0c('0x16')]?_0x2246e7[_0x8e0c('0x16')][_0x8e0c('0x17')]===undefined?!![]:![]:!![]})[_0x8e0c('0x9')](function(_0x5eaeef){logger[_0x8e0c('0xa')]('CreateSquareRecording',_0x2246e7);logger[_0x8e0c('0xd')](_0x8e0c('0x18'),_0x2246e7,JSON['stringify'](_0x5eaeef));_0x18e9ab(_0x5eaeef);})['catch'](function(_0x560c0c){logger[_0x8e0c('0xf')](_0x8e0c('0x18'),_0x560c0c['message'],_0x2246e7);_0xd62b31(_0x47b0f5[_0x8e0c('0xf')](0x1f4,_0x560c0c[_0x8e0c('0x11')]));});});}; \ No newline at end of file +var _0xe818=['jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x106b58,_0x2db14f){var _0x87ae17=function(_0x1e5c4f){while(--_0x1e5c4f){_0x106b58['push'](_0x106b58['shift']());}};_0x87ae17(++_0x2db14f);}(_0xe818,0x1e4));var _0x8e81=function(_0x129b38,_0x1e09d6){_0x129b38=_0x129b38-0x0;var _0x1213cf=_0xe818[_0x129b38];return _0x1213cf;};'use strict';var _=require(_0x8e81('0x0'));var util=require(_0x8e81('0x1'));var moment=require(_0x8e81('0x2'));var BPromise=require(_0x8e81('0x3'));var rs=require(_0x8e81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e81('0x6'))(_0x8e81('0x7'));var config=require(_0x8e81('0x8'));var jayson=require(_0x8e81('0x9'));var client=jayson[_0x8e81('0xa')][_0x8e81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff76,_0x116b9c,_0x306648){return new BPromise(function(_0x1f7eb8,_0x515c7a){return client[_0x8e81('0xc')](_0x3ff76,_0x306648)[_0x8e81('0xd')](function(_0x2fcf46){logger[_0x8e81('0xe')](_0x8e81('0xf'),_0x116b9c,_0x8e81('0x10'));logger['debug'](_0x8e81('0x11'),_0x116b9c,_0x8e81('0x10'),JSON[_0x8e81('0x12')](_0x2fcf46));if(_0x2fcf46['error']){if(_0x2fcf46[_0x8e81('0x13')][_0x8e81('0x14')]===0x1f4){logger['error'](_0x8e81('0xf'),_0x116b9c,_0x2fcf46['error']['message']);return _0x515c7a(_0x2fcf46[_0x8e81('0x13')][_0x8e81('0x15')]);}logger[_0x8e81('0x13')]('SquareRecording,\x20%s,\x20%s',_0x116b9c,_0x2fcf46['error'][_0x8e81('0x15')]);return _0x1f7eb8(_0x2fcf46[_0x8e81('0x13')]['message']);}else{logger[_0x8e81('0xe')](_0x8e81('0xf'),_0x116b9c,_0x8e81('0x10'));_0x1f7eb8(_0x2fcf46[_0x8e81('0x16')][_0x8e81('0x15')]);}})[_0x8e81('0x17')](function(_0x1ebcb3){logger[_0x8e81('0x13')]('SquareRecording,\x20%s,\x20%s',_0x116b9c,_0x1ebcb3);_0x515c7a(_0x1ebcb3);});});}exports[_0x8e81('0x18')]=function(_0x52979d){var _0x321f9f=this;return new Promise(function(_0x2a5563,_0xae3b48){return db[_0x8e81('0x19')][_0x8e81('0x1a')](_0x52979d[_0x8e81('0x1b')],{'raw':_0x52979d['options']?_0x52979d[_0x8e81('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x8e81('0xd')](function(_0x208710){logger[_0x8e81('0xe')](_0x8e81('0x18'),_0x52979d);logger['debug'](_0x8e81('0x18'),_0x52979d,JSON[_0x8e81('0x12')](_0x208710));_0x2a5563(_0x208710);})[_0x8e81('0x17')](function(_0x165989){logger[_0x8e81('0x13')](_0x8e81('0x18'),_0x165989[_0x8e81('0x15')],_0x52979d);_0xae3b48(_0x321f9f[_0x8e81('0x13')](0x1f4,_0x165989[_0x8e81('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index ff1d3c2..ca9d04e 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x188824,_0x23bd9a){var _0x160191=function(_0x4c1fea){while(--_0x4c1fea){_0x188824['push'](_0x188824['shift']());}};_0x160191(++_0x23bd9a);}(_0xe706,0xa3));var _0x6e70=function(_0x7b102d,_0x414b58){_0x7b102d=_0x7b102d-0x0;var _0x235e07=_0xe706[_0x7b102d];return _0x235e07;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 5eae0bc..395711f 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 _0x3d72=['DATE','BOOLEAN','exports','STRING'];(function(_0x11c2b0,_0x370150){var _0x1f4f90=function(_0x5354a9){while(--_0x5354a9){_0x11c2b0['push'](_0x11c2b0['shift']());}};_0x1f4f90(++_0x370150);}(_0x3d72,0x162));var _0x23d7=function(_0x54f25c,_0x2cf0c1){_0x54f25c=_0x54f25c-0x0;var _0x97947a=_0x3d72[_0x54f25c];return _0x97947a;};'use strict';var Sequelize=require('sequelize');module[_0x23d7('0x0')]={'network':{'type':Sequelize[_0x23d7('0x1')]},'network_script':{'type':Sequelize[_0x23d7('0x1')]},'request':{'type':Sequelize[_0x23d7('0x1')]},'channel':{'type':Sequelize[_0x23d7('0x1')]},'language':{'type':Sequelize[_0x23d7('0x1')]},'type':{'type':Sequelize[_0x23d7('0x1')]},'uniqueid':{'type':Sequelize[_0x23d7('0x1')]},'version':{'type':Sequelize[_0x23d7('0x1')]},'callerid':{'type':Sequelize[_0x23d7('0x1')]},'calleridname':{'type':Sequelize[_0x23d7('0x1')]},'callingpres':{'type':Sequelize[_0x23d7('0x1')]},'callingani2':{'type':Sequelize[_0x23d7('0x1')]},'callington':{'type':Sequelize[_0x23d7('0x1')]},'callingtns':{'type':Sequelize[_0x23d7('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x23d7('0x1')]},'context':{'type':Sequelize[_0x23d7('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x23d7('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x23d7('0x1')]},'threadid':{'type':Sequelize[_0x23d7('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x23d7('0x2')]},'leaveAt':{'type':Sequelize[_0x23d7('0x2')]},'bot':{'type':Sequelize[_0x23d7('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1ef9=['DATE','sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1ef9,0x1b5));var _0x91ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ef9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x91ef('0x0'));module[_0x91ef('0x1')]={'network':{'type':Sequelize[_0x91ef('0x2')]},'network_script':{'type':Sequelize[_0x91ef('0x2')]},'request':{'type':Sequelize[_0x91ef('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x91ef('0x2')]},'uniqueid':{'type':Sequelize[_0x91ef('0x2')]},'version':{'type':Sequelize[_0x91ef('0x2')]},'callerid':{'type':Sequelize[_0x91ef('0x2')]},'calleridname':{'type':Sequelize[_0x91ef('0x2')]},'callingpres':{'type':Sequelize[_0x91ef('0x2')]},'callingani2':{'type':Sequelize[_0x91ef('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x91ef('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x91ef('0x2')]},'context':{'type':Sequelize[_0x91ef('0x2')]},'extension':{'type':Sequelize[_0x91ef('0x2')]},'priority':{'type':Sequelize[_0x91ef('0x2')]},'enhanced':{'type':Sequelize[_0x91ef('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x91ef('0x2')]},'project_name':{'type':Sequelize[_0x91ef('0x2')]},'joinAt':{'type':Sequelize[_0x91ef('0x3')]},'leaveAt':{'type':Sequelize[_0x91ef('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 b618c93..b9f01bc 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 _0xc6a8=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','update','error','stack','name','index','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','SquareReport','includeAll','findAll','rows','then','catch','show','keys','rawAttributes','find','create'];(function(_0x3a2edc,_0x2a69c1){var _0x4ee686=function(_0x210806){while(--_0x210806){_0x3a2edc['push'](_0x3a2edc['shift']());}};_0x4ee686(++_0x2a69c1);}(_0xc6a8,0x1a1));var _0x8c6a=function(_0x12277a,_0x5afc61){_0x12277a=_0x12277a-0x0;var _0x51d512=_0xc6a8[_0x12277a];return _0x51d512;};'use strict';var emlformat=require(_0x8c6a('0x0'));var rimraf=require(_0x8c6a('0x1'));var zipdir=require(_0x8c6a('0x2'));var jsonpatch=require(_0x8c6a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c6a('0x4'));var Mustache=require(_0x8c6a('0x5'));var util=require('util');var path=require(_0x8c6a('0x6'));var sox=require(_0x8c6a('0x7'));var csv=require(_0x8c6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c6a('0x9'));var _=require(_0x8c6a('0xa'));var squel=require(_0x8c6a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8c6a('0xc'));var Papa=require('papaparse');var Redis=require(_0x8c6a('0xd'));var authService=require(_0x8c6a('0xe'));var qs=require(_0x8c6a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c6a('0x10'));var logger=require('../../config/logger')(_0x8c6a('0x11'));var utils=require(_0x8c6a('0x12'));var config=require(_0x8c6a('0x13'));var licenseUtil=require(_0x8c6a('0x14'));var db=require(_0x8c6a('0x15'))['db'];function respondWithStatusCode(_0x3f50af,_0x5cf851){_0x5cf851=_0x5cf851||0xcc;return function(_0x53495e){if(_0x53495e){return _0x3f50af[_0x8c6a('0x16')](_0x5cf851);}return _0x3f50af['status'](_0x5cf851)[_0x8c6a('0x17')]();};}function respondWithResult(_0x45eb16,_0x484919){_0x484919=_0x484919||0xc8;return function(_0x1d3573){if(_0x1d3573){return _0x45eb16[_0x8c6a('0x18')](_0x484919)[_0x8c6a('0x19')](_0x1d3573);}};}function respondWithFilteredResult(_0x4d1c3a,_0x54fa3b){return function(_0x3e5ed9){if(_0x3e5ed9){var _0x414a68=typeof _0x54fa3b['offset']===_0x8c6a('0x1a')&&typeof _0x54fa3b[_0x8c6a('0x1b')]==='undefined';var _0x3c6091=_0x3e5ed9[_0x8c6a('0x1c')];var _0x12e23f=_0x414a68?0x0:_0x54fa3b[_0x8c6a('0x1d')];var _0x118dce=_0x414a68?_0x3e5ed9[_0x8c6a('0x1c')]:_0x54fa3b[_0x8c6a('0x1d')]+_0x54fa3b[_0x8c6a('0x1b')];var _0x49aba6;if(_0x118dce>=_0x3c6091){_0x118dce=_0x3c6091;_0x49aba6=0xc8;}else{_0x49aba6=0xce;}_0x4d1c3a[_0x8c6a('0x18')](_0x49aba6);return _0x4d1c3a[_0x8c6a('0x1e')]('Content-Range',_0x12e23f+'-'+_0x118dce+'/'+_0x3c6091)['json'](_0x3e5ed9);}return null;};}function patchUpdates(_0x18cd62){return function(_0x164120){try{jsonpatch[_0x8c6a('0x1f')](_0x164120,_0x18cd62,!![]);}catch(_0x8cdb31){return BPromise[_0x8c6a('0x20')](_0x8cdb31);}return _0x164120['save']();};}function saveUpdates(_0x53573a,_0x1ebb80){return function(_0x1c01d0){if(_0x1c01d0){return _0x1c01d0[_0x8c6a('0x21')](_0x53573a)['then'](function(_0x53be64){return _0x53be64;});}return null;};}function removeEntity(_0xfb85ce,_0x3cbc71){return function(_0x469e33){if(_0x469e33){return _0x469e33['destroy']()['then'](function(){_0xfb85ce['status'](0xcc)[_0x8c6a('0x17')]();});}};}function handleEntityNotFound(_0x4878f7,_0x3a9e33){return function(_0x6ff118){if(!_0x6ff118){_0x4878f7[_0x8c6a('0x16')](0x194);}return _0x6ff118;};}function handleError(_0x1ba2aa,_0x27b710){_0x27b710=_0x27b710||0x1f4;return function(_0x17d6db){logger[_0x8c6a('0x22')](_0x17d6db[_0x8c6a('0x23')]);if(_0x17d6db[_0x8c6a('0x24')]){delete _0x17d6db[_0x8c6a('0x24')];}_0x1ba2aa[_0x8c6a('0x18')](_0x27b710)['send'](_0x17d6db);};}exports[_0x8c6a('0x25')]=function(_0x14feae,_0x457ce6){var _0x3c49dc={},_0x20e1b3={},_0x49da14={'count':0x0,'rows':[]};var _0x4d678c=_['map'](db['SquareReport']['rawAttributes'],function(_0xb29a7){return{'name':_0xb29a7['fieldName'],'type':_0xb29a7[_0x8c6a('0x26')][_0x8c6a('0x27')]};});_0x20e1b3[_0x8c6a('0x28')]=_[_0x8c6a('0x29')](_0x4d678c,_0x8c6a('0x24'));_0x20e1b3[_0x8c6a('0x2a')]=_['keys'](_0x14feae[_0x8c6a('0x2a')]);_0x20e1b3[_0x8c6a('0x2b')]=_[_0x8c6a('0x2c')](_0x20e1b3[_0x8c6a('0x28')],_0x20e1b3[_0x8c6a('0x2a')]);_0x3c49dc[_0x8c6a('0x2d')]=_[_0x8c6a('0x2c')](_0x20e1b3[_0x8c6a('0x28')],qs['fields'](_0x14feae[_0x8c6a('0x2a')][_0x8c6a('0x2e')]));_0x3c49dc[_0x8c6a('0x2d')]=_0x3c49dc[_0x8c6a('0x2d')]['length']?_0x3c49dc['attributes']:_0x20e1b3[_0x8c6a('0x28')];if(!_0x14feae[_0x8c6a('0x2a')][_0x8c6a('0x2f')](_0x8c6a('0x30'))){_0x3c49dc[_0x8c6a('0x1b')]=qs[_0x8c6a('0x1b')](_0x14feae[_0x8c6a('0x2a')][_0x8c6a('0x1b')]);_0x3c49dc['offset']=qs[_0x8c6a('0x1d')](_0x14feae[_0x8c6a('0x2a')]['offset']);}_0x3c49dc[_0x8c6a('0x31')]=qs['sort'](_0x14feae[_0x8c6a('0x2a')][_0x8c6a('0x32')]);_0x3c49dc[_0x8c6a('0x33')]=qs[_0x8c6a('0x2b')](_['pick'](_0x14feae[_0x8c6a('0x2a')],_0x20e1b3['filters']),_0x4d678c);if(_0x14feae[_0x8c6a('0x2a')][_0x8c6a('0x34')]){_0x3c49dc['where']=_[_0x8c6a('0x35')](_0x3c49dc[_0x8c6a('0x33')],{'$or':_[_0x8c6a('0x29')](_0x4d678c,function(_0x4d0aa0){if(_0x4d0aa0[_0x8c6a('0x26')]!=='VIRTUAL'){var _0x2614e1={};_0x2614e1[_0x4d0aa0['name']]={'$like':'%'+_0x14feae['query'][_0x8c6a('0x34')]+'%'};return _0x2614e1;}})});}_0x3c49dc=_['merge']({},_0x3c49dc,_0x14feae[_0x8c6a('0x36')]);var _0x5a79da={'where':_0x3c49dc[_0x8c6a('0x33')]};return db[_0x8c6a('0x37')][_0x8c6a('0x1c')](_0x5a79da)['then'](function(_0x731566){_0x49da14[_0x8c6a('0x1c')]=_0x731566;if(_0x14feae[_0x8c6a('0x2a')][_0x8c6a('0x38')]){_0x3c49dc['include']=[{'all':!![]}];}return db[_0x8c6a('0x37')][_0x8c6a('0x39')](_0x3c49dc);})['then'](function(_0x1e55fd){_0x49da14[_0x8c6a('0x3a')]=_0x1e55fd;return _0x49da14;})[_0x8c6a('0x3b')](respondWithFilteredResult(_0x457ce6,_0x3c49dc))[_0x8c6a('0x3c')](handleError(_0x457ce6,null));};exports[_0x8c6a('0x3d')]=function(_0xe00841,_0x1995ca){var _0x22f333={'raw':!![],'where':{'id':_0xe00841['params']['id']}},_0xf98182={};_0xf98182[_0x8c6a('0x28')]=_[_0x8c6a('0x3e')](db['SquareReport'][_0x8c6a('0x3f')]);_0xf98182[_0x8c6a('0x2a')]=_[_0x8c6a('0x3e')](_0xe00841['query']);_0xf98182[_0x8c6a('0x2b')]=_[_0x8c6a('0x2c')](_0xf98182[_0x8c6a('0x28')],_0xf98182[_0x8c6a('0x2a')]);_0x22f333['attributes']=_['intersection'](_0xf98182[_0x8c6a('0x28')],qs['fields'](_0xe00841['query'][_0x8c6a('0x2e')]));_0x22f333['attributes']=_0x22f333[_0x8c6a('0x2d')]['length']?_0x22f333['attributes']:_0xf98182[_0x8c6a('0x28')];if(_0xe00841[_0x8c6a('0x2a')][_0x8c6a('0x38')]){_0x22f333['include']=[{'all':!![]}];}_0x22f333=_[_0x8c6a('0x35')]({},_0x22f333,_0xe00841[_0x8c6a('0x36')]);return db['SquareReport'][_0x8c6a('0x40')](_0x22f333)[_0x8c6a('0x3b')](handleEntityNotFound(_0x1995ca,null))[_0x8c6a('0x3b')](respondWithResult(_0x1995ca,null))[_0x8c6a('0x3c')](handleError(_0x1995ca,null));};exports[_0x8c6a('0x41')]=function(_0x21adec,_0x2c4e15){return db['SquareReport'][_0x8c6a('0x41')](_0x21adec['body'],{})[_0x8c6a('0x3b')](respondWithResult(_0x2c4e15,0xc9))['catch'](handleError(_0x2c4e15,null));};exports[_0x8c6a('0x21')]=function(_0x5a253e,_0x337738){if(_0x5a253e[_0x8c6a('0x42')]['id']){delete _0x5a253e[_0x8c6a('0x42')]['id'];}return db[_0x8c6a('0x37')]['find']({'where':{'id':_0x5a253e[_0x8c6a('0x43')]['id']}})[_0x8c6a('0x3b')](handleEntityNotFound(_0x337738,null))[_0x8c6a('0x3b')](saveUpdates(_0x5a253e[_0x8c6a('0x42')],null))[_0x8c6a('0x3b')](respondWithResult(_0x337738,null))['catch'](handleError(_0x337738,null));};exports['destroy']=function(_0x52a09d,_0x126401){return db[_0x8c6a('0x37')][_0x8c6a('0x40')]({'where':{'id':_0x52a09d['params']['id']}})['then'](handleEntityNotFound(_0x126401,null))[_0x8c6a('0x3b')](removeEntity(_0x126401,null))[_0x8c6a('0x3c')](handleError(_0x126401,null));};exports[_0x8c6a('0x44')]=function(_0xffc137,_0xc53f78){return db[_0x8c6a('0x37')][_0x8c6a('0x44')]()[_0x8c6a('0x3b')](respondWithResult(_0xc53f78,null))['catch'](handleError(_0xc53f78,null));}; \ No newline at end of file +var _0x5518=['model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','intersection','include','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','key'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x5518,0xb3));var _0x8551=function(_0x373393,_0x2fad3d){_0x373393=_0x373393-0x0;var _0x22eeba=_0x5518[_0x373393];return _0x22eeba;};'use strict';var emlformat=require(_0x8551('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8551('0x1'));var jsonpatch=require(_0x8551('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8551('0x3'));var Mustache=require(_0x8551('0x4'));var util=require(_0x8551('0x5'));var path=require('path');var sox=require(_0x8551('0x6'));var csv=require(_0x8551('0x7'));var ejs=require(_0x8551('0x8'));var fs=require('fs');var fs_extra=require(_0x8551('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8551('0xa'));var jsforce=require(_0x8551('0xb'));var deskjs=require(_0x8551('0xc'));var toCsv=require(_0x8551('0x7'));var querystring=require('querystring');var Papa=require(_0x8551('0xd'));var Redis=require(_0x8551('0xe'));var authService=require(_0x8551('0xf'));var qs=require(_0x8551('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8551('0x11'));var logger=require('../../config/logger')(_0x8551('0x12'));var utils=require(_0x8551('0x13'));var config=require(_0x8551('0x14'));var licenseUtil=require(_0x8551('0x15'));var db=require(_0x8551('0x16'))['db'];function respondWithStatusCode(_0xaa3f77,_0x33a193){_0x33a193=_0x33a193||0xcc;return function(_0x4117b3){if(_0x4117b3){return _0xaa3f77[_0x8551('0x17')](_0x33a193);}return _0xaa3f77['status'](_0x33a193)[_0x8551('0x18')]();};}function respondWithResult(_0x357385,_0x362285){_0x362285=_0x362285||0xc8;return function(_0x4af973){if(_0x4af973){return _0x357385[_0x8551('0x19')](_0x362285)[_0x8551('0x1a')](_0x4af973);}};}function respondWithFilteredResult(_0x3dcc2e,_0x5c7e14){return function(_0x55a2e5){if(_0x55a2e5){var _0x280440=typeof _0x5c7e14['offset']===_0x8551('0x1b')&&typeof _0x5c7e14['limit']===_0x8551('0x1b');var _0x16dbfe=_0x55a2e5['count'];var _0x3d028f=_0x280440?0x0:_0x5c7e14[_0x8551('0x1c')];var _0xc9a7f8=_0x280440?_0x55a2e5[_0x8551('0x1d')]:_0x5c7e14['offset']+_0x5c7e14['limit'];var _0x86b33f;if(_0xc9a7f8>=_0x16dbfe){_0xc9a7f8=_0x16dbfe;_0x86b33f=0xc8;}else{_0x86b33f=0xce;}_0x3dcc2e['status'](_0x86b33f);return _0x3dcc2e[_0x8551('0x1e')](_0x8551('0x1f'),_0x3d028f+'-'+_0xc9a7f8+'/'+_0x16dbfe)[_0x8551('0x1a')](_0x55a2e5);}return null;};}function patchUpdates(_0x1d2b58){return function(_0xafbecf){try{jsonpatch['apply'](_0xafbecf,_0x1d2b58,!![]);}catch(_0x73b7b7){return BPromise[_0x8551('0x20')](_0x73b7b7);}return _0xafbecf[_0x8551('0x21')]();};}function saveUpdates(_0x2a6fd9,_0x491aab){return function(_0x2a6111){if(_0x2a6111){return _0x2a6111['update'](_0x2a6fd9)[_0x8551('0x22')](function(_0x1ea8af){return _0x1ea8af;});}return null;};}function removeEntity(_0x22c03b,_0x51ae28){return function(_0x2d7d59){if(_0x2d7d59){return _0x2d7d59[_0x8551('0x23')]()[_0x8551('0x22')](function(){_0x22c03b[_0x8551('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18888f,_0x5a6087){return function(_0x1e6a3d){if(!_0x1e6a3d){_0x18888f['sendStatus'](0x194);}return _0x1e6a3d;};}function handleError(_0x29dd91,_0x4fec65){_0x4fec65=_0x4fec65||0x1f4;return function(_0x4f6a83){logger[_0x8551('0x24')](_0x4f6a83[_0x8551('0x25')]);if(_0x4f6a83[_0x8551('0x26')]){delete _0x4f6a83['name'];}_0x29dd91[_0x8551('0x19')](_0x4fec65)[_0x8551('0x27')](_0x4f6a83);};}exports[_0x8551('0x28')]=function(_0x117a66,_0x72eeeb){var _0x510188={},_0x538e15={},_0x3d62fa={'count':0x0,'rows':[]};var _0xbeecdd=_[_0x8551('0x29')](db[_0x8551('0x2a')][_0x8551('0x2b')],function(_0x170d83){return{'name':_0x170d83[_0x8551('0x2c')],'type':_0x170d83['type'][_0x8551('0x2d')]};});_0x538e15[_0x8551('0x2e')]=_[_0x8551('0x29')](_0xbeecdd,_0x8551('0x26'));_0x538e15[_0x8551('0x2f')]=_[_0x8551('0x30')](_0x117a66['query']);_0x538e15['filters']=_['intersection'](_0x538e15[_0x8551('0x2e')],_0x538e15[_0x8551('0x2f')]);_0x510188[_0x8551('0x31')]=_['intersection'](_0x538e15[_0x8551('0x2e')],qs[_0x8551('0x32')](_0x117a66[_0x8551('0x2f')]['fields']));_0x510188[_0x8551('0x31')]=_0x510188[_0x8551('0x31')][_0x8551('0x33')]?_0x510188[_0x8551('0x31')]:_0x538e15['model'];if(!_0x117a66['query'][_0x8551('0x34')](_0x8551('0x35'))){_0x510188['limit']=qs[_0x8551('0x36')](_0x117a66['query'][_0x8551('0x36')]);_0x510188[_0x8551('0x1c')]=qs['offset'](_0x117a66['query'][_0x8551('0x1c')]);}_0x510188[_0x8551('0x37')]=qs[_0x8551('0x38')](_0x117a66['query'][_0x8551('0x38')]);_0x510188[_0x8551('0x39')]=qs[_0x8551('0x3a')](_['pick'](_0x117a66[_0x8551('0x2f')],_0x538e15[_0x8551('0x3a')]),_0xbeecdd);if(_0x117a66[_0x8551('0x2f')][_0x8551('0x3b')]){_0x510188['where']=_[_0x8551('0x3c')](_0x510188[_0x8551('0x39')],{'$or':_[_0x8551('0x29')](_0xbeecdd,function(_0x196c30){if(_0x196c30[_0x8551('0x3d')]!==_0x8551('0x3e')){var _0x556ffe={};_0x556ffe[_0x196c30[_0x8551('0x26')]]={'$like':'%'+_0x117a66[_0x8551('0x2f')][_0x8551('0x3b')]+'%'};return _0x556ffe;}})});}_0x510188=_['merge']({},_0x510188,_0x117a66[_0x8551('0x3f')]);var _0x51c384={'where':_0x510188[_0x8551('0x39')]};return db[_0x8551('0x2a')][_0x8551('0x1d')](_0x51c384)[_0x8551('0x22')](function(_0x44cd68){_0x3d62fa[_0x8551('0x1d')]=_0x44cd68;if(_0x117a66[_0x8551('0x2f')][_0x8551('0x40')]){_0x510188['include']=[{'all':!![]}];}return db[_0x8551('0x2a')][_0x8551('0x41')](_0x510188);})[_0x8551('0x22')](function(_0x1aee34){_0x3d62fa['rows']=_0x1aee34;return _0x3d62fa;})['then'](respondWithFilteredResult(_0x72eeeb,_0x510188))[_0x8551('0x42')](handleError(_0x72eeeb,null));};exports[_0x8551('0x43')]=function(_0x38922b,_0x2daaaf){var _0x101408={'raw':!![],'where':{'id':_0x38922b['params']['id']}},_0xc04947={};_0xc04947['model']=_['keys'](db[_0x8551('0x2a')][_0x8551('0x2b')]);_0xc04947[_0x8551('0x2f')]=_['keys'](_0x38922b[_0x8551('0x2f')]);_0xc04947['filters']=_[_0x8551('0x44')](_0xc04947[_0x8551('0x2e')],_0xc04947[_0x8551('0x2f')]);_0x101408[_0x8551('0x31')]=_[_0x8551('0x44')](_0xc04947[_0x8551('0x2e')],qs[_0x8551('0x32')](_0x38922b[_0x8551('0x2f')][_0x8551('0x32')]));_0x101408[_0x8551('0x31')]=_0x101408['attributes'][_0x8551('0x33')]?_0x101408['attributes']:_0xc04947[_0x8551('0x2e')];if(_0x38922b[_0x8551('0x2f')][_0x8551('0x40')]){_0x101408[_0x8551('0x45')]=[{'all':!![]}];}_0x101408=_[_0x8551('0x3c')]({},_0x101408,_0x38922b[_0x8551('0x3f')]);return db[_0x8551('0x2a')]['find'](_0x101408)['then'](handleEntityNotFound(_0x2daaaf,null))[_0x8551('0x22')](respondWithResult(_0x2daaaf,null))['catch'](handleError(_0x2daaaf,null));};exports[_0x8551('0x46')]=function(_0x156f27,_0x39f7ea){return db['SquareReport'][_0x8551('0x46')](_0x156f27[_0x8551('0x47')],{})[_0x8551('0x22')](respondWithResult(_0x39f7ea,0xc9))[_0x8551('0x42')](handleError(_0x39f7ea,null));};exports[_0x8551('0x48')]=function(_0x4fd9e6,_0x12902d){if(_0x4fd9e6[_0x8551('0x47')]['id']){delete _0x4fd9e6[_0x8551('0x47')]['id'];}return db['SquareReport'][_0x8551('0x49')]({'where':{'id':_0x4fd9e6[_0x8551('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12902d,null))[_0x8551('0x22')](saveUpdates(_0x4fd9e6['body'],null))[_0x8551('0x22')](respondWithResult(_0x12902d,null))[_0x8551('0x42')](handleError(_0x12902d,null));};exports[_0x8551('0x23')]=function(_0xb4b88f,_0x50e795){return db[_0x8551('0x2a')][_0x8551('0x49')]({'where':{'id':_0xb4b88f[_0x8551('0x4a')]['id']}})[_0x8551('0x22')](handleEntityNotFound(_0x50e795,null))[_0x8551('0x22')](removeEntity(_0x50e795,null))[_0x8551('0x42')](handleError(_0x50e795,null));};exports['describe']=function(_0x179249,_0x4ee3bd){return db[_0x8551('0x2a')]['describe']()[_0x8551('0x22')](respondWithResult(_0x4ee3bd,null))['catch'](handleError(_0x4ee3bd,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index f84b6b8..c299f7f 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 _0x492d=['report_square','uid_pname','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x492d,0x16e));var _0xd492=function(_0x33f28f,_0x16853d){_0x33f28f=_0x33f28f-0x0;var _0x2ca1a7=_0x492d[_0x33f28f];return _0x2ca1a7;};'use strict';var _=require('lodash');var util=require(_0xd492('0x0'));var logger=require(_0xd492('0x1'))(_0xd492('0x2'));var moment=require(_0xd492('0x3'));var BPromise=require(_0xd492('0x4'));var rp=require(_0xd492('0x5'));var fs=require('fs');var path=require(_0xd492('0x6'));var rimraf=require('rimraf');var config=require(_0xd492('0x7'));var attributes=require(_0xd492('0x8'));module[_0xd492('0x9')]=function(_0x4e92d5,_0x2cb1d4){return _0x4e92d5[_0xd492('0xa')](_0xd492('0xb'),attributes,{'tableName':_0xd492('0xc'),'paranoid':![],'indexes':[{'name':_0xd492('0xd'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc329=['define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareReport.attributes'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xc329,0x1d7));var _0x9c32=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xc329[_0x4b03c9];return _0x161ba2;};'use strict';var _=require(_0x9c32('0x0'));var util=require(_0x9c32('0x1'));var logger=require(_0x9c32('0x2'))(_0x9c32('0x3'));var moment=require(_0x9c32('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c32('0x5'));var fs=require('fs');var path=require(_0x9c32('0x6'));var rimraf=require(_0x9c32('0x7'));var config=require('../../config/environment');var attributes=require(_0x9c32('0x8'));module['exports']=function(_0x40b6ea,_0x39e290){return _0x40b6ea[_0x9c32('0x9')]('SquareReport',attributes,{'tableName':_0x9c32('0xa'),'paranoid':![],'indexes':[{'name':_0x9c32('0xb'),'fields':[_0x9c32('0xc'),_0x9c32('0xd')]},{'name':_0x9c32('0xe'),'fields':[_0x9c32('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 657e748..98754a2 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 _0x48cd=['../../config/logger','../../config/environment','jayson/promise','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','raw','debug','UpdateSquareReport','update','attributes','limit','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xfafdd4,_0xb32f7f){var _0x37c897=function(_0x517b0e){while(--_0x517b0e){_0xfafdd4['push'](_0xfafdd4['shift']());}};_0x37c897(++_0xb32f7f);}(_0x48cd,0x9a));var _0xd48c=function(_0x2b72cb,_0x5c6c89){_0x2b72cb=_0x2b72cb-0x0;var _0x4126cd=_0x48cd[_0x2b72cb];return _0x4126cd;};'use strict';var _=require(_0xd48c('0x0'));var util=require(_0xd48c('0x1'));var moment=require(_0xd48c('0x2'));var BPromise=require(_0xd48c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd48c('0x4'));var db=require(_0xd48c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd48c('0x6'))('rpc');var config=require(_0xd48c('0x7'));var jayson=require(_0xd48c('0x8'));var client=jayson[_0xd48c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c53e7,_0xe1182d,_0x11d6e9){return new BPromise(function(_0x40f251,_0x10385c){return client[_0xd48c('0xa')](_0x5c53e7,_0x11d6e9)['then'](function(_0x568018){logger[_0xd48c('0xb')](_0xd48c('0xc'),_0xe1182d,_0xd48c('0xd'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0xe1182d,_0xd48c('0xd'),JSON[_0xd48c('0xe')](_0x568018));if(_0x568018[_0xd48c('0xf')]){if(_0x568018[_0xd48c('0xf')][_0xd48c('0x10')]===0x1f4){logger[_0xd48c('0xf')](_0xd48c('0xc'),_0xe1182d,_0x568018[_0xd48c('0xf')][_0xd48c('0x11')]);return _0x10385c(_0x568018[_0xd48c('0xf')][_0xd48c('0x11')]);}logger[_0xd48c('0xf')](_0xd48c('0xc'),_0xe1182d,_0x568018[_0xd48c('0xf')][_0xd48c('0x11')]);return _0x40f251(_0x568018[_0xd48c('0xf')][_0xd48c('0x11')]);}else{logger[_0xd48c('0xb')](_0xd48c('0xc'),_0xe1182d,_0xd48c('0xd'));_0x40f251(_0x568018[_0xd48c('0x12')][_0xd48c('0x11')]);}})['catch'](function(_0x3344b2){logger['error'](_0xd48c('0xc'),_0xe1182d,_0x3344b2);_0x10385c(_0x3344b2);});});}exports[_0xd48c('0x13')]=function(_0x9ae342){var _0xab533e=this;return new Promise(function(_0x18078d,_0x1f1c81){return db[_0xd48c('0x14')][_0xd48c('0x15')](_0x9ae342[_0xd48c('0x16')],{'raw':_0x9ae342[_0xd48c('0x17')]?_0x9ae342[_0xd48c('0x17')][_0xd48c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3fd0fc){logger['info'](_0xd48c('0x13'),_0x9ae342);logger[_0xd48c('0x19')](_0xd48c('0x13'),_0x9ae342,JSON['stringify'](_0x3fd0fc));_0x18078d(_0x3fd0fc);})['catch'](function(_0x3b1475){logger[_0xd48c('0xf')]('CreateSquareReport',_0x3b1475[_0xd48c('0x11')],_0x9ae342);_0x1f1c81(_0xab533e['error'](0x1f4,_0x3b1475['message']));});});};exports[_0xd48c('0x1a')]=function(_0x2ce6c9){var _0x2920e3=this;return new Promise(function(_0x23082b,_0x18fe75){return db['SquareReport'][_0xd48c('0x1b')](_0x2ce6c9[_0xd48c('0x16')],{'raw':_0x2ce6c9['options']?_0x2ce6c9[_0xd48c('0x17')][_0xd48c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ce6c9[_0xd48c('0x17')]?_0x2ce6c9[_0xd48c('0x17')]['where']||null:null,'attributes':_0x2ce6c9['options']?_0x2ce6c9[_0xd48c('0x17')][_0xd48c('0x1c')]||null:null,'limit':_0x2ce6c9[_0xd48c('0x17')]?_0x2ce6c9[_0xd48c('0x17')][_0xd48c('0x1d')]||null:null})[_0xd48c('0x1e')](function(_0x528fed){logger['info'](_0xd48c('0x1a'),_0x2ce6c9);logger['debug'](_0xd48c('0x1a'),_0x2ce6c9,JSON[_0xd48c('0xe')](_0x528fed));_0x23082b(_0x528fed);})[_0xd48c('0x1f')](function(_0x1ffe2b){logger[_0xd48c('0xf')](_0xd48c('0x1a'),_0x1ffe2b[_0xd48c('0x11')],_0x2ce6c9);_0x18fe75(_0x2920e3[_0xd48c('0xf')](0x1f4,_0x1ffe2b['message']));});});}; \ No newline at end of file +var _0xa8cb=['http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareReport','create','raw','CreateSquareReport','update','body','options','where','attributes','limit','UpdateSquareReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa8cb,0xf1));var _0xba8c=function(_0x516e08,_0x4fa563){_0x516e08=_0x516e08-0x0;var _0x28dc21=_0xa8cb[_0x516e08];return _0x28dc21;};'use strict';var _=require('lodash');var util=require(_0xba8c('0x0'));var moment=require(_0xba8c('0x1'));var BPromise=require('bluebird');var rs=require(_0xba8c('0x2'));var fs=require('fs');var Redis=require(_0xba8c('0x3'));var db=require(_0xba8c('0x4'))['db'];var utils=require(_0xba8c('0x5'));var logger=require(_0xba8c('0x6'))(_0xba8c('0x7'));var config=require(_0xba8c('0x8'));var jayson=require(_0xba8c('0x9'));var client=jayson[_0xba8c('0xa')][_0xba8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a759e,_0x5159cb,_0x35f6bb){return new BPromise(function(_0x387b58,_0x42547f){return client[_0xba8c('0xc')](_0x4a759e,_0x35f6bb)[_0xba8c('0xd')](function(_0x16256d){logger[_0xba8c('0xe')](_0xba8c('0xf'),_0x5159cb,_0xba8c('0x10'));logger[_0xba8c('0x11')](_0xba8c('0x12'),_0x5159cb,_0xba8c('0x10'),JSON[_0xba8c('0x13')](_0x16256d));if(_0x16256d['error']){if(_0x16256d[_0xba8c('0x14')][_0xba8c('0x15')]===0x1f4){logger[_0xba8c('0x14')]('SquareReport,\x20%s,\x20%s',_0x5159cb,_0x16256d[_0xba8c('0x14')]['message']);return _0x42547f(_0x16256d[_0xba8c('0x14')][_0xba8c('0x16')]);}logger[_0xba8c('0x14')](_0xba8c('0xf'),_0x5159cb,_0x16256d[_0xba8c('0x14')][_0xba8c('0x16')]);return _0x387b58(_0x16256d[_0xba8c('0x14')][_0xba8c('0x16')]);}else{logger['info'](_0xba8c('0xf'),_0x5159cb,'request\x20sent');_0x387b58(_0x16256d[_0xba8c('0x17')][_0xba8c('0x16')]);}})[_0xba8c('0x18')](function(_0x5cd66e){logger[_0xba8c('0x14')](_0xba8c('0xf'),_0x5159cb,_0x5cd66e);_0x42547f(_0x5cd66e);});});}exports['CreateSquareReport']=function(_0x4150de){var _0x5661fa=this;return new Promise(function(_0x276c8b,_0x37689e){return db[_0xba8c('0x19')][_0xba8c('0x1a')](_0x4150de['body'],{'raw':_0x4150de['options']?_0x4150de['options'][_0xba8c('0x1b')]===undefined?!![]:![]:!![]})[_0xba8c('0xd')](function(_0x356bcf){logger[_0xba8c('0xe')](_0xba8c('0x1c'),_0x4150de);logger[_0xba8c('0x11')](_0xba8c('0x1c'),_0x4150de,JSON[_0xba8c('0x13')](_0x356bcf));_0x276c8b(_0x356bcf);})['catch'](function(_0x1874e4){logger[_0xba8c('0x14')](_0xba8c('0x1c'),_0x1874e4[_0xba8c('0x16')],_0x4150de);_0x37689e(_0x5661fa[_0xba8c('0x14')](0x1f4,_0x1874e4[_0xba8c('0x16')]));});});};exports['UpdateSquareReport']=function(_0x29b9ed){var _0x3da85d=this;return new Promise(function(_0x512483,_0x28d8aa){return db[_0xba8c('0x19')][_0xba8c('0x1d')](_0x29b9ed[_0xba8c('0x1e')],{'raw':_0x29b9ed[_0xba8c('0x1f')]?_0x29b9ed[_0xba8c('0x1f')][_0xba8c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29b9ed[_0xba8c('0x1f')]?_0x29b9ed[_0xba8c('0x1f')][_0xba8c('0x20')]||null:null,'attributes':_0x29b9ed[_0xba8c('0x1f')]?_0x29b9ed[_0xba8c('0x1f')][_0xba8c('0x21')]||null:null,'limit':_0x29b9ed['options']?_0x29b9ed[_0xba8c('0x1f')][_0xba8c('0x22')]||null:null})[_0xba8c('0xd')](function(_0x14e2b8){logger[_0xba8c('0xe')](_0xba8c('0x23'),_0x29b9ed);logger['debug'](_0xba8c('0x23'),_0x29b9ed,JSON[_0xba8c('0x13')](_0x14e2b8));_0x512483(_0x14e2b8);})[_0xba8c('0x18')](function(_0xa6d584){logger['error'](_0xba8c('0x23'),_0xa6d584[_0xba8c('0x16')],_0x29b9ed);_0x28d8aa(_0x3da85d[_0xba8c('0x14')](0x1f4,_0xa6d584[_0xba8c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 392781f..8b19cea 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 _0xdebf=['get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x338db7,_0x512740){var _0x4e8ae4=function(_0x1164bd){while(--_0x1164bd){_0x338db7['push'](_0x338db7['shift']());}};_0x4e8ae4(++_0x512740);}(_0xdebf,0x132));var _0xfdeb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdebf[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xfdeb('0x0'));var util=require(_0xfdeb('0x1'));var path=require(_0xfdeb('0x2'));var timeout=require(_0xfdeb('0x3'));var express=require(_0xfdeb('0x4'));var router=express[_0xfdeb('0x5')]();var fs_extra=require(_0xfdeb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfdeb('0x7'));var config=require(_0xfdeb('0x8'));var controller=require('./squareReportDetail.controller');router[_0xfdeb('0x9')]('/',auth[_0xfdeb('0xa')](),controller['index']);router['get'](_0xfdeb('0xb'),auth['isAuthenticated'](),controller[_0xfdeb('0xc')]);router['get']('/:id',auth[_0xfdeb('0xa')](),controller['show']);router[_0xfdeb('0xd')]('/',auth['isAuthenticated'](),controller[_0xfdeb('0xe')]);router[_0xfdeb('0xf')](_0xfdeb('0x10'),auth[_0xfdeb('0xa')](),controller[_0xfdeb('0x11')]);router[_0xfdeb('0x12')](_0xfdeb('0x10'),auth['isAuthenticated'](),controller[_0xfdeb('0x13')]);module[_0xfdeb('0x14')]=router; \ No newline at end of file +var _0x78bf=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','describe','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x78bf,0x86));var _0xf78b=function(_0x166d74,_0x1bf07e){_0x166d74=_0x166d74-0x0;var _0x13a80f=_0x78bf[_0x166d74];return _0x13a80f;};'use strict';var multer=require(_0xf78b('0x0'));var util=require(_0xf78b('0x1'));var path=require(_0xf78b('0x2'));var timeout=require(_0xf78b('0x3'));var express=require('express');var router=express[_0xf78b('0x4')]();var fs_extra=require(_0xf78b('0x5'));var auth=require(_0xf78b('0x6'));var interaction=require(_0xf78b('0x7'));var config=require(_0xf78b('0x8'));var controller=require(_0xf78b('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf78b('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf78b('0xb')]);router['get'](_0xf78b('0xc'),auth[_0xf78b('0xd')](),controller[_0xf78b('0xe')]);router[_0xf78b('0xf')]('/',auth[_0xf78b('0xd')](),controller[_0xf78b('0x10')]);router[_0xf78b('0x11')](_0xf78b('0xc'),auth['isAuthenticated'](),controller[_0xf78b('0x12')]);router[_0xf78b('0x13')](_0xf78b('0xc'),auth[_0xf78b('0xd')](),controller[_0xf78b('0x14')]);module[_0xf78b('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index dc571a5..5b2d72f 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 _0x431b=['exports','STRING','TEXT','sequelize'];(function(_0x2745e0,_0x3e4904){var _0x4e06dc=function(_0x1eb499){while(--_0x1eb499){_0x2745e0['push'](_0x2745e0['shift']());}};_0x4e06dc(++_0x3e4904);}(_0x431b,0xaf));var _0xb431=function(_0x39ad4c,_0x2fa27e){_0x39ad4c=_0x39ad4c-0x0;var _0xf3314d=_0x431b[_0x39ad4c];return _0xf3314d;};'use strict';var Sequelize=require(_0xb431('0x0'));module[_0xb431('0x1')]={'uniqueid':{'type':Sequelize[_0xb431('0x2')]},'node':{'type':Sequelize[_0xb431('0x2')]},'application':{'type':Sequelize[_0xb431('0x2')]},'data':{'type':Sequelize[_0xb431('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb431('0x2')]}}; \ No newline at end of file +var _0x4c72=['exports','STRING','sequelize'];(function(_0x5dc2ec,_0x388263){var _0x1cb648=function(_0x435c95){while(--_0x435c95){_0x5dc2ec['push'](_0x5dc2ec['shift']());}};_0x1cb648(++_0x388263);}(_0x4c72,0x179));var _0x24c7=function(_0xc84f3d,_0x2e4385){_0xc84f3d=_0xc84f3d-0x0;var _0x33f88e=_0x4c72[_0xc84f3d];return _0x33f88e;};'use strict';var Sequelize=require(_0x24c7('0x0'));module[_0x24c7('0x1')]={'uniqueid':{'type':Sequelize[_0x24c7('0x2')]},'node':{'type':Sequelize[_0x24c7('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x24c7('0x2')]},'callerid':{'type':Sequelize[_0x24c7('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 48c5ec5..faa5574 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 _0x578c=['includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','rimraf','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x4d4122,_0xbc99c6){var _0x127a69=function(_0x570c5b){while(--_0x570c5b){_0x4d4122['push'](_0x4d4122['shift']());}};_0x127a69(++_0xbc99c6);}(_0x578c,0x17e));var _0xc578=function(_0x58218e,_0x4cc3c4){_0x58218e=_0x58218e-0x0;var _0x4d04dd=_0x578c[_0x58218e];return _0x4d04dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc578('0x0'));var zipdir=require(_0xc578('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc578('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc578('0x3'));var util=require(_0xc578('0x4'));var path=require(_0xc578('0x5'));var sox=require(_0xc578('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc578('0x7'));var _=require(_0xc578('0x8'));var squel=require(_0xc578('0x9'));var crypto=require(_0xc578('0xa'));var jsforce=require(_0xc578('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc578('0xc'));var Papa=require('papaparse');var Redis=require(_0xc578('0xd'));var authService=require(_0xc578('0xe'));var qs=require(_0xc578('0xf'));var as=require(_0xc578('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc578('0x11'))(_0xc578('0x12'));var utils=require(_0xc578('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc578('0x14'));var db=require(_0xc578('0x15'))['db'];function respondWithStatusCode(_0x34de34,_0x426a49){_0x426a49=_0x426a49||0xcc;return function(_0x2ce538){if(_0x2ce538){return _0x34de34[_0xc578('0x16')](_0x426a49);}return _0x34de34[_0xc578('0x17')](_0x426a49)[_0xc578('0x18')]();};}function respondWithResult(_0x16f80a,_0x282b4e){_0x282b4e=_0x282b4e||0xc8;return function(_0x4a6c4b){if(_0x4a6c4b){return _0x16f80a[_0xc578('0x17')](_0x282b4e)[_0xc578('0x19')](_0x4a6c4b);}};}function respondWithFilteredResult(_0x2ec82f,_0x816b59){return function(_0x2d8efc){if(_0x2d8efc){var _0x514dc3=typeof _0x816b59[_0xc578('0x1a')]===_0xc578('0x1b')&&typeof _0x816b59[_0xc578('0x1c')]===_0xc578('0x1b');var _0x279dba=_0x2d8efc['count'];var _0x18fe08=_0x514dc3?0x0:_0x816b59[_0xc578('0x1a')];var _0x1bbfba=_0x514dc3?_0x2d8efc[_0xc578('0x1d')]:_0x816b59['offset']+_0x816b59[_0xc578('0x1c')];var _0x336783;if(_0x1bbfba>=_0x279dba){_0x1bbfba=_0x279dba;_0x336783=0xc8;}else{_0x336783=0xce;}_0x2ec82f[_0xc578('0x17')](_0x336783);return _0x2ec82f[_0xc578('0x1e')]('Content-Range',_0x18fe08+'-'+_0x1bbfba+'/'+_0x279dba)[_0xc578('0x19')](_0x2d8efc);}return null;};}function patchUpdates(_0x474a6f){return function(_0x562ce3){try{jsonpatch['apply'](_0x562ce3,_0x474a6f,!![]);}catch(_0x153bee){return BPromise['reject'](_0x153bee);}return _0x562ce3['save']();};}function saveUpdates(_0x920498,_0x4d43d4){return function(_0x4d4856){if(_0x4d4856){return _0x4d4856['update'](_0x920498)['then'](function(_0x550b01){return _0x550b01;});}return null;};}function removeEntity(_0x3d4fb9,_0x391aac){return function(_0x2aa124){if(_0x2aa124){return _0x2aa124[_0xc578('0x1f')]()[_0xc578('0x20')](function(){_0x3d4fb9[_0xc578('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f2068,_0x3c3ffd){return function(_0x1fc00d){if(!_0x1fc00d){_0x3f2068['sendStatus'](0x194);}return _0x1fc00d;};}function handleError(_0x351ebd,_0x40503c){_0x40503c=_0x40503c||0x1f4;return function(_0x55eeae){logger[_0xc578('0x21')](_0x55eeae[_0xc578('0x22')]);if(_0x55eeae[_0xc578('0x23')]){delete _0x55eeae[_0xc578('0x23')];}_0x351ebd[_0xc578('0x17')](_0x40503c)[_0xc578('0x24')](_0x55eeae);};}exports[_0xc578('0x25')]=function(_0x3f0a18,_0x4e0ab5){var _0x24cb5a={},_0xcff0e={},_0x43d368={'count':0x0,'rows':[]};var _0x547ffd=_[_0xc578('0x26')](db[_0xc578('0x27')][_0xc578('0x28')],function(_0x3b12bf){return{'name':_0x3b12bf[_0xc578('0x29')],'type':_0x3b12bf[_0xc578('0x2a')][_0xc578('0x2b')]};});_0xcff0e[_0xc578('0x2c')]=_[_0xc578('0x26')](_0x547ffd,_0xc578('0x23'));_0xcff0e[_0xc578('0x2d')]=_[_0xc578('0x2e')](_0x3f0a18['query']);_0xcff0e['filters']=_[_0xc578('0x2f')](_0xcff0e[_0xc578('0x2c')],_0xcff0e[_0xc578('0x2d')]);_0x24cb5a[_0xc578('0x30')]=_['intersection'](_0xcff0e[_0xc578('0x2c')],qs['fields'](_0x3f0a18['query'][_0xc578('0x31')]));_0x24cb5a[_0xc578('0x30')]=_0x24cb5a[_0xc578('0x30')][_0xc578('0x32')]?_0x24cb5a['attributes']:_0xcff0e[_0xc578('0x2c')];if(!_0x3f0a18[_0xc578('0x2d')][_0xc578('0x33')](_0xc578('0x34'))){_0x24cb5a[_0xc578('0x1c')]=qs[_0xc578('0x1c')](_0x3f0a18[_0xc578('0x2d')][_0xc578('0x1c')]);_0x24cb5a['offset']=qs[_0xc578('0x1a')](_0x3f0a18[_0xc578('0x2d')][_0xc578('0x1a')]);}_0x24cb5a[_0xc578('0x35')]=qs[_0xc578('0x36')](_0x3f0a18[_0xc578('0x2d')][_0xc578('0x36')]);_0x24cb5a[_0xc578('0x37')]=qs[_0xc578('0x38')](_[_0xc578('0x39')](_0x3f0a18[_0xc578('0x2d')],_0xcff0e['filters']),_0x547ffd);if(_0x3f0a18[_0xc578('0x2d')][_0xc578('0x3a')]){_0x24cb5a[_0xc578('0x37')]=_[_0xc578('0x3b')](_0x24cb5a[_0xc578('0x37')],{'$or':_[_0xc578('0x26')](_0x547ffd,function(_0xef1d48){if(_0xef1d48['type']!==_0xc578('0x3c')){var _0x2e7b9e={};_0x2e7b9e[_0xef1d48[_0xc578('0x23')]]={'$like':'%'+_0x3f0a18[_0xc578('0x2d')][_0xc578('0x3a')]+'%'};return _0x2e7b9e;}})});}_0x24cb5a=_[_0xc578('0x3b')]({},_0x24cb5a,_0x3f0a18[_0xc578('0x3d')]);var _0x5cfbcb={'where':_0x24cb5a[_0xc578('0x37')]};return db[_0xc578('0x27')]['count'](_0x5cfbcb)['then'](function(_0x5e8c0f){_0x43d368[_0xc578('0x1d')]=_0x5e8c0f;if(_0x3f0a18[_0xc578('0x2d')][_0xc578('0x3e')]){_0x24cb5a['include']=[{'all':!![]}];}return db[_0xc578('0x27')][_0xc578('0x3f')](_0x24cb5a);})[_0xc578('0x20')](function(_0x2de089){_0x43d368[_0xc578('0x40')]=_0x2de089;return _0x43d368;})['then'](respondWithFilteredResult(_0x4e0ab5,_0x24cb5a))[_0xc578('0x41')](handleError(_0x4e0ab5,null));};exports[_0xc578('0x42')]=function(_0x2f1f01,_0x564ce7){var _0x437b04={'raw':!![],'where':{'id':_0x2f1f01[_0xc578('0x43')]['id']}},_0x39c73c={};_0x39c73c[_0xc578('0x2c')]=_[_0xc578('0x2e')](db[_0xc578('0x27')][_0xc578('0x28')]);_0x39c73c[_0xc578('0x2d')]=_[_0xc578('0x2e')](_0x2f1f01[_0xc578('0x2d')]);_0x39c73c[_0xc578('0x38')]=_[_0xc578('0x2f')](_0x39c73c[_0xc578('0x2c')],_0x39c73c[_0xc578('0x2d')]);_0x437b04[_0xc578('0x30')]=_[_0xc578('0x2f')](_0x39c73c['model'],qs['fields'](_0x2f1f01['query'][_0xc578('0x31')]));_0x437b04[_0xc578('0x30')]=_0x437b04[_0xc578('0x30')][_0xc578('0x32')]?_0x437b04[_0xc578('0x30')]:_0x39c73c[_0xc578('0x2c')];if(_0x2f1f01[_0xc578('0x2d')]['includeAll']){_0x437b04[_0xc578('0x44')]=[{'all':!![]}];}_0x437b04=_[_0xc578('0x3b')]({},_0x437b04,_0x2f1f01['options']);return db[_0xc578('0x27')][_0xc578('0x45')](_0x437b04)[_0xc578('0x20')](handleEntityNotFound(_0x564ce7,null))[_0xc578('0x20')](respondWithResult(_0x564ce7,null))[_0xc578('0x41')](handleError(_0x564ce7,null));};exports[_0xc578('0x46')]=function(_0x518ebe,_0x31e32d){return db['SquareDetailsReport'][_0xc578('0x46')](_0x518ebe[_0xc578('0x47')],{})[_0xc578('0x20')](respondWithResult(_0x31e32d,0xc9))['catch'](handleError(_0x31e32d,null));};exports[_0xc578('0x48')]=function(_0x1cec54,_0x26e464){if(_0x1cec54[_0xc578('0x47')]['id']){delete _0x1cec54[_0xc578('0x47')]['id'];}return db[_0xc578('0x27')][_0xc578('0x45')]({'where':{'id':_0x1cec54['params']['id']}})['then'](handleEntityNotFound(_0x26e464,null))[_0xc578('0x20')](saveUpdates(_0x1cec54[_0xc578('0x47')],null))[_0xc578('0x20')](respondWithResult(_0x26e464,null))['catch'](handleError(_0x26e464,null));};exports[_0xc578('0x1f')]=function(_0x274db0,_0x21c00f){return db['SquareDetailsReport'][_0xc578('0x45')]({'where':{'id':_0x274db0['params']['id']}})['then'](handleEntityNotFound(_0x21c00f,null))['then'](removeEntity(_0x21c00f,null))[_0xc578('0x41')](handleError(_0x21c00f,null));};exports[_0xc578('0x49')]=function(_0x4805b2,_0x187645){return db['SquareDetailsReport'][_0xc578('0x49')]()[_0xc578('0x20')](respondWithResult(_0x187645,null))['catch'](handleError(_0x187645,null));}; \ No newline at end of file +var _0xabf1=['fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','SquareDetailsReport','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','rimraf'];(function(_0xe152b2,_0x1703ad){var _0x5abe5b=function(_0x454a72){while(--_0x454a72){_0xe152b2['push'](_0xe152b2['shift']());}};_0x5abe5b(++_0x1703ad);}(_0xabf1,0x176));var _0x1abf=function(_0x520f3b,_0x2a7684){_0x520f3b=_0x520f3b-0x0;var _0x2e60fe=_0xabf1[_0x520f3b];return _0x2e60fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1abf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1abf('0x1'));var rp=require(_0x1abf('0x2'));var moment=require(_0x1abf('0x3'));var BPromise=require(_0x1abf('0x4'));var Mustache=require('mustache');var util=require(_0x1abf('0x5'));var path=require(_0x1abf('0x6'));var sox=require('sox');var csv=require(_0x1abf('0x7'));var ejs=require(_0x1abf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1abf('0x9'));var squel=require(_0x1abf('0xa'));var crypto=require(_0x1abf('0xb'));var jsforce=require(_0x1abf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1abf('0x7'));var querystring=require(_0x1abf('0xd'));var Papa=require(_0x1abf('0xe'));var Redis=require(_0x1abf('0xf'));var authService=require(_0x1abf('0x10'));var qs=require(_0x1abf('0x11'));var as=require(_0x1abf('0x12'));var hardwareService=require(_0x1abf('0x13'));var logger=require(_0x1abf('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1abf('0x15'));var licenseUtil=require(_0x1abf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x197248,_0x141957){_0x141957=_0x141957||0xcc;return function(_0x5558bd){if(_0x5558bd){return _0x197248[_0x1abf('0x17')](_0x141957);}return _0x197248[_0x1abf('0x18')](_0x141957)['end']();};}function respondWithResult(_0x1cc291,_0x97725c){_0x97725c=_0x97725c||0xc8;return function(_0x208108){if(_0x208108){return _0x1cc291[_0x1abf('0x18')](_0x97725c)[_0x1abf('0x19')](_0x208108);}};}function respondWithFilteredResult(_0x4a36c4,_0x4c8116){return function(_0x330257){if(_0x330257){var _0x2e1601=typeof _0x4c8116[_0x1abf('0x1a')]===_0x1abf('0x1b')&&typeof _0x4c8116[_0x1abf('0x1c')]==='undefined';var _0x556b8d=_0x330257[_0x1abf('0x1d')];var _0x2e7d30=_0x2e1601?0x0:_0x4c8116['offset'];var _0x355986=_0x2e1601?_0x330257[_0x1abf('0x1d')]:_0x4c8116[_0x1abf('0x1a')]+_0x4c8116[_0x1abf('0x1c')];var _0x418ea1;if(_0x355986>=_0x556b8d){_0x355986=_0x556b8d;_0x418ea1=0xc8;}else{_0x418ea1=0xce;}_0x4a36c4['status'](_0x418ea1);return _0x4a36c4[_0x1abf('0x1e')](_0x1abf('0x1f'),_0x2e7d30+'-'+_0x355986+'/'+_0x556b8d)[_0x1abf('0x19')](_0x330257);}return null;};}function patchUpdates(_0x5f18eb){return function(_0x379899){try{jsonpatch[_0x1abf('0x20')](_0x379899,_0x5f18eb,!![]);}catch(_0xc74fb6){return BPromise['reject'](_0xc74fb6);}return _0x379899[_0x1abf('0x21')]();};}function saveUpdates(_0x19717b,_0x5b27e0){return function(_0x285b67){if(_0x285b67){return _0x285b67[_0x1abf('0x22')](_0x19717b)[_0x1abf('0x23')](function(_0x2fe0b1){return _0x2fe0b1;});}return null;};}function removeEntity(_0x1da023,_0x3c1e5b){return function(_0x3c6088){if(_0x3c6088){return _0x3c6088[_0x1abf('0x24')]()['then'](function(){_0x1da023[_0x1abf('0x18')](0xcc)[_0x1abf('0x25')]();});}};}function handleEntityNotFound(_0xb52d79,_0x24977f){return function(_0x5ad5db){if(!_0x5ad5db){_0xb52d79[_0x1abf('0x17')](0x194);}return _0x5ad5db;};}function handleError(_0x299fee,_0x260ce8){_0x260ce8=_0x260ce8||0x1f4;return function(_0x1d4ab1){logger[_0x1abf('0x26')](_0x1d4ab1[_0x1abf('0x27')]);if(_0x1d4ab1['name']){delete _0x1d4ab1[_0x1abf('0x28')];}_0x299fee[_0x1abf('0x18')](_0x260ce8)['send'](_0x1d4ab1);};}exports[_0x1abf('0x29')]=function(_0x12864a,_0x2f19b1){var _0x358805={},_0x2c1b81={},_0x375a07={'count':0x0,'rows':[]};var _0x28a5b1=_[_0x1abf('0x2a')](db[_0x1abf('0x2b')][_0x1abf('0x2c')],function(_0x272e47){return{'name':_0x272e47['fieldName'],'type':_0x272e47[_0x1abf('0x2d')][_0x1abf('0x2e')]};});_0x2c1b81[_0x1abf('0x2f')]=_[_0x1abf('0x2a')](_0x28a5b1,_0x1abf('0x28'));_0x2c1b81['query']=_[_0x1abf('0x30')](_0x12864a[_0x1abf('0x31')]);_0x2c1b81[_0x1abf('0x32')]=_['intersection'](_0x2c1b81['model'],_0x2c1b81[_0x1abf('0x31')]);_0x358805[_0x1abf('0x33')]=_[_0x1abf('0x34')](_0x2c1b81[_0x1abf('0x2f')],qs[_0x1abf('0x35')](_0x12864a['query'][_0x1abf('0x35')]));_0x358805[_0x1abf('0x33')]=_0x358805[_0x1abf('0x33')][_0x1abf('0x36')]?_0x358805[_0x1abf('0x33')]:_0x2c1b81[_0x1abf('0x2f')];if(!_0x12864a[_0x1abf('0x31')][_0x1abf('0x37')](_0x1abf('0x38'))){_0x358805[_0x1abf('0x1c')]=qs[_0x1abf('0x1c')](_0x12864a['query'][_0x1abf('0x1c')]);_0x358805[_0x1abf('0x1a')]=qs[_0x1abf('0x1a')](_0x12864a[_0x1abf('0x31')]['offset']);}_0x358805[_0x1abf('0x39')]=qs[_0x1abf('0x3a')](_0x12864a[_0x1abf('0x31')][_0x1abf('0x3a')]);_0x358805['where']=qs['filters'](_[_0x1abf('0x3b')](_0x12864a[_0x1abf('0x31')],_0x2c1b81['filters']),_0x28a5b1);if(_0x12864a[_0x1abf('0x31')][_0x1abf('0x3c')]){_0x358805[_0x1abf('0x3d')]=_[_0x1abf('0x3e')](_0x358805[_0x1abf('0x3d')],{'$or':_['map'](_0x28a5b1,function(_0x56b1d9){if(_0x56b1d9[_0x1abf('0x2d')]!==_0x1abf('0x3f')){var _0x310eaa={};_0x310eaa[_0x56b1d9[_0x1abf('0x28')]]={'$like':'%'+_0x12864a[_0x1abf('0x31')][_0x1abf('0x3c')]+'%'};return _0x310eaa;}})});}_0x358805=_[_0x1abf('0x3e')]({},_0x358805,_0x12864a[_0x1abf('0x40')]);var _0x1f92cf={'where':_0x358805[_0x1abf('0x3d')]};return db[_0x1abf('0x2b')][_0x1abf('0x1d')](_0x1f92cf)[_0x1abf('0x23')](function(_0x156efd){_0x375a07[_0x1abf('0x1d')]=_0x156efd;if(_0x12864a[_0x1abf('0x31')][_0x1abf('0x41')]){_0x358805[_0x1abf('0x42')]=[{'all':!![]}];}return db[_0x1abf('0x2b')][_0x1abf('0x43')](_0x358805);})['then'](function(_0x4cfc78){_0x375a07['rows']=_0x4cfc78;return _0x375a07;})[_0x1abf('0x23')](respondWithFilteredResult(_0x2f19b1,_0x358805))[_0x1abf('0x44')](handleError(_0x2f19b1,null));};exports[_0x1abf('0x45')]=function(_0x4cbd55,_0x105c89){var _0x3236fc={'raw':!![],'where':{'id':_0x4cbd55[_0x1abf('0x46')]['id']}},_0x49149a={};_0x49149a['model']=_[_0x1abf('0x30')](db[_0x1abf('0x2b')][_0x1abf('0x2c')]);_0x49149a[_0x1abf('0x31')]=_['keys'](_0x4cbd55[_0x1abf('0x31')]);_0x49149a[_0x1abf('0x32')]=_[_0x1abf('0x34')](_0x49149a['model'],_0x49149a[_0x1abf('0x31')]);_0x3236fc['attributes']=_['intersection'](_0x49149a['model'],qs['fields'](_0x4cbd55['query'][_0x1abf('0x35')]));_0x3236fc[_0x1abf('0x33')]=_0x3236fc[_0x1abf('0x33')][_0x1abf('0x36')]?_0x3236fc['attributes']:_0x49149a[_0x1abf('0x2f')];if(_0x4cbd55[_0x1abf('0x31')][_0x1abf('0x41')]){_0x3236fc[_0x1abf('0x42')]=[{'all':!![]}];}_0x3236fc=_[_0x1abf('0x3e')]({},_0x3236fc,_0x4cbd55[_0x1abf('0x40')]);return db[_0x1abf('0x2b')][_0x1abf('0x47')](_0x3236fc)[_0x1abf('0x23')](handleEntityNotFound(_0x105c89,null))[_0x1abf('0x23')](respondWithResult(_0x105c89,null))[_0x1abf('0x44')](handleError(_0x105c89,null));};exports[_0x1abf('0x48')]=function(_0x5b196b,_0x45bdd1){return db[_0x1abf('0x2b')][_0x1abf('0x48')](_0x5b196b[_0x1abf('0x49')],{})[_0x1abf('0x23')](respondWithResult(_0x45bdd1,0xc9))[_0x1abf('0x44')](handleError(_0x45bdd1,null));};exports[_0x1abf('0x22')]=function(_0x135c06,_0x577a1b){if(_0x135c06['body']['id']){delete _0x135c06[_0x1abf('0x49')]['id'];}return db[_0x1abf('0x2b')][_0x1abf('0x47')]({'where':{'id':_0x135c06[_0x1abf('0x46')]['id']}})[_0x1abf('0x23')](handleEntityNotFound(_0x577a1b,null))[_0x1abf('0x23')](saveUpdates(_0x135c06[_0x1abf('0x49')],null))[_0x1abf('0x23')](respondWithResult(_0x577a1b,null))[_0x1abf('0x44')](handleError(_0x577a1b,null));};exports['destroy']=function(_0x356dd5,_0x54e290){return db[_0x1abf('0x2b')][_0x1abf('0x47')]({'where':{'id':_0x356dd5[_0x1abf('0x46')]['id']}})['then'](handleEntityNotFound(_0x54e290,null))[_0x1abf('0x23')](removeEntity(_0x54e290,null))[_0x1abf('0x44')](handleError(_0x54e290,null));};exports[_0x1abf('0x4a')]=function(_0x1507a4,_0x5b28ee){return db['SquareDetailsReport'][_0x1abf('0x4a')]()[_0x1abf('0x23')](respondWithResult(_0x5b28ee,null))['catch'](handleError(_0x5b28ee,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 66d615d..e06e913 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 _0x0c54=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x14a6e9,_0x1b1d59){var _0x3de25a=function(_0x129a69){while(--_0x129a69){_0x14a6e9['push'](_0x14a6e9['shift']());}};_0x3de25a(++_0x1b1d59);}(_0x0c54,0x71));var _0x40c5=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x0c54[_0x478c8a];return _0x3b6b3e;};'use strict';var _=require('lodash');var util=require(_0x40c5('0x0'));var logger=require(_0x40c5('0x1'))(_0x40c5('0x2'));var moment=require('moment');var BPromise=require(_0x40c5('0x3'));var rp=require(_0x40c5('0x4'));var fs=require('fs');var path=require(_0x40c5('0x5'));var rimraf=require('rimraf');var config=require(_0x40c5('0x6'));var attributes=require(_0x40c5('0x7'));module[_0x40c5('0x8')]=function(_0x9e5a8e,_0x2de371){return _0x9e5a8e[_0x40c5('0x9')](_0x40c5('0xa'),attributes,{'tableName':_0x40c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92f0=['exports','define','SquareDetailsReport','lodash','util','api','moment','bluebird','path','./squareReportDetail.attributes'];(function(_0x4fea53,_0x3849da){var _0x4b78f2=function(_0x21d984){while(--_0x21d984){_0x4fea53['push'](_0x4fea53['shift']());}};_0x4b78f2(++_0x3849da);}(_0x92f0,0x99));var _0x092f=function(_0xb4ec3a,_0x2bace0){_0xb4ec3a=_0xb4ec3a-0x0;var _0x1b83db=_0x92f0[_0xb4ec3a];return _0x1b83db;};'use strict';var _=require(_0x092f('0x0'));var util=require(_0x092f('0x1'));var logger=require('../../config/logger')(_0x092f('0x2'));var moment=require(_0x092f('0x3'));var BPromise=require(_0x092f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x092f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x092f('0x6'));module[_0x092f('0x7')]=function(_0x290d24,_0x625051){return _0x290d24[_0x092f('0x8')](_0x092f('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index b68fc15..0244f5a 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 _0x2f3a=['request\x20sent','debug','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s'];(function(_0xb6fead,_0x4c390e){var _0x4da025=function(_0x193224){while(--_0x193224){_0xb6fead['push'](_0xb6fead['shift']());}};_0x4da025(++_0x4c390e);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x57b3b6,_0x1be9af){_0x57b3b6=_0x57b3b6-0x0;var _0x5305de=_0x2f3a[_0x57b3b6];return _0x5305de;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require(_0xa2f3('0x6'))('rpc');var config=require(_0xa2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2f3('0x8')][_0xa2f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4db21d,_0x521ddf,_0x2faf36){return new BPromise(function(_0x3944a0,_0x4405a2){return client[_0xa2f3('0xa')](_0x4db21d,_0x2faf36)['then'](function(_0x358263){logger[_0xa2f3('0xb')](_0xa2f3('0xc'),_0x521ddf,_0xa2f3('0xd'));logger[_0xa2f3('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x521ddf,_0xa2f3('0xd'),JSON[_0xa2f3('0xf')](_0x358263));if(_0x358263['error']){if(_0x358263[_0xa2f3('0x10')][_0xa2f3('0x11')]===0x1f4){logger[_0xa2f3('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x521ddf,_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);return _0x4405a2(_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);}logger[_0xa2f3('0x10')](_0xa2f3('0xc'),_0x521ddf,_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);return _0x3944a0(_0x358263[_0xa2f3('0x10')]['message']);}else{logger[_0xa2f3('0xb')](_0xa2f3('0xc'),_0x521ddf,_0xa2f3('0xd'));_0x3944a0(_0x358263['result'][_0xa2f3('0x12')]);}})[_0xa2f3('0x13')](function(_0x4b138b){logger['error'](_0xa2f3('0xc'),_0x521ddf,_0x4b138b);_0x4405a2(_0x4b138b);});});}exports[_0xa2f3('0x14')]=function(_0x2db0d2){var _0x1c5c62=this;return new Promise(function(_0x205578,_0x23309e){return db[_0xa2f3('0x15')][_0xa2f3('0x16')](_0x2db0d2['body'],{'raw':_0x2db0d2[_0xa2f3('0x17')]?_0x2db0d2[_0xa2f3('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2f74a0){logger['info'](_0xa2f3('0x14'),_0x2db0d2);logger[_0xa2f3('0xe')]('CreateSquareDetailsReport',_0x2db0d2,JSON[_0xa2f3('0xf')](_0x2f74a0));_0x205578(_0x2f74a0);})[_0xa2f3('0x13')](function(_0x14d989){logger[_0xa2f3('0x10')](_0xa2f3('0x14'),_0x14d989[_0xa2f3('0x12')],_0x2db0d2);_0x23309e(_0x1c5c62[_0xa2f3('0x10')](0x1f4,_0x14d989[_0xa2f3('0x12')]));});});}; \ No newline at end of file +var _0xa149=['result','catch','CreateSquareDetailsReport','create','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x2f8125,_0x260435){var _0x332dfb=function(_0x12a258){while(--_0x12a258){_0x2f8125['push'](_0x2f8125['shift']());}};_0x332dfb(++_0x260435);}(_0xa149,0x18c));var _0x9a14=function(_0xa61698,_0x44184b){_0xa61698=_0xa61698-0x0;var _0x3f07fb=_0xa149[_0xa61698];return _0x3f07fb;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var moment=require(_0x9a14('0x2'));var BPromise=require(_0x9a14('0x3'));var rs=require(_0x9a14('0x4'));var fs=require('fs');var Redis=require(_0x9a14('0x5'));var db=require(_0x9a14('0x6'))['db'];var utils=require(_0x9a14('0x7'));var logger=require(_0x9a14('0x8'))('rpc');var config=require(_0x9a14('0x9'));var jayson=require(_0x9a14('0xa'));var client=jayson['client'][_0x9a14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3beb93,_0x286760,_0x17d2e5){return new BPromise(function(_0x109f69,_0x26efc5){return client['request'](_0x3beb93,_0x17d2e5)[_0x9a14('0xc')](function(_0x4bdd6c){logger[_0x9a14('0xd')](_0x9a14('0xe'),_0x286760,_0x9a14('0xf'));logger[_0x9a14('0x10')](_0x9a14('0x11'),_0x286760,_0x9a14('0xf'),JSON['stringify'](_0x4bdd6c));if(_0x4bdd6c['error']){if(_0x4bdd6c['error']['code']===0x1f4){logger[_0x9a14('0x12')](_0x9a14('0xe'),_0x286760,_0x4bdd6c['error'][_0x9a14('0x13')]);return _0x26efc5(_0x4bdd6c['error'][_0x9a14('0x13')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x286760,_0x4bdd6c[_0x9a14('0x12')][_0x9a14('0x13')]);return _0x109f69(_0x4bdd6c[_0x9a14('0x12')][_0x9a14('0x13')]);}else{logger['info'](_0x9a14('0xe'),_0x286760,_0x9a14('0xf'));_0x109f69(_0x4bdd6c[_0x9a14('0x14')][_0x9a14('0x13')]);}})[_0x9a14('0x15')](function(_0x5b3a7a){logger[_0x9a14('0x12')](_0x9a14('0xe'),_0x286760,_0x5b3a7a);_0x26efc5(_0x5b3a7a);});});}exports[_0x9a14('0x16')]=function(_0x3aa654){var _0x38be44=this;return new Promise(function(_0x55a283,_0x5287e6){return db['SquareDetailsReport'][_0x9a14('0x17')](_0x3aa654['body'],{'raw':_0x3aa654[_0x9a14('0x18')]?_0x3aa654[_0x9a14('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53e151){logger['info'](_0x9a14('0x16'),_0x3aa654);logger[_0x9a14('0x10')](_0x9a14('0x16'),_0x3aa654,JSON[_0x9a14('0x19')](_0x53e151));_0x55a283(_0x53e151);})[_0x9a14('0x15')](function(_0xc78dd7){logger[_0x9a14('0x12')]('CreateSquareDetailsReport',_0xc78dd7['message'],_0x3aa654);_0x5287e6(_0x38be44[_0x9a14('0x12')](0x1f4,_0xc78dd7[_0x9a14('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3257f3a..980130a 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 _0x1984=['killProcess','express','Router','../../components/auth/service','./system.controller','isAuthenticated','index','/process/:pid/kill'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x1984,0x199));var _0x4198=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1984[_0x413feb];return _0x40ee88;};'use strict';var express=require(_0x4198('0x0'));var router=express[_0x4198('0x1')]();var auth=require(_0x4198('0x2'));var controller=require(_0x4198('0x3'));router['get']('/',auth[_0x4198('0x4')](),controller[_0x4198('0x5')]);router['get'](_0x4198('0x6'),auth[_0x4198('0x4')](),controller[_0x4198('0x7')]);module['exports']=router; \ No newline at end of file +var _0x1a3d=['exports','express','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x39dfe7,_0x566f3f){var _0xd2f528=function(_0x2b538a){while(--_0x2b538a){_0x39dfe7['push'](_0x39dfe7['shift']());}};_0xd2f528(++_0x566f3f);}(_0x1a3d,0x119));var _0xd1a3=function(_0x10de63,_0x162879){_0x10de63=_0x10de63-0x0;var _0x20351a=_0x1a3d[_0x10de63];return _0x20351a;};'use strict';var express=require(_0xd1a3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xd1a3('0x1')]('/',auth['isAuthenticated'](),controller[_0xd1a3('0x2')]);router[_0xd1a3('0x1')](_0xd1a3('0x3'),auth[_0xd1a3('0x4')](),controller[_0xd1a3('0x5')]);module[_0xd1a3('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index d71dfc3..09eb377 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 _0xf11e=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','components/import/cm','format','params','pid','split','indexOf'];(function(_0x22ee66,_0x53f71a){var _0x4c8425=function(_0x3b722e){while(--_0x3b722e){_0x22ee66['push'](_0x22ee66['shift']());}};_0x4c8425(++_0x53f71a);}(_0xf11e,0x17f));var _0xef11=function(_0x9c40b5,_0x425ca4){_0x9c40b5=_0x9c40b5-0x0;var _0x2965d1=_0xf11e[_0x9c40b5];return _0x2965d1;};'use strict';var info=require(_0xef11('0x0'));var exec=require(_0xef11('0x1'))[_0xef11('0x2')];var logger=require('../../config/logger')(_0xef11('0x3'));var util=require(_0xef11('0x4'));var BPromise=require('bluebird');var _=require(_0xef11('0x5'));function handleError(_0x4558b3,_0x481e27,_0xe4115c){_0x481e27=_0x481e27||0x1f4;return function(_0x4db7ea){logger[_0xef11('0x6')](_0xef11('0x7'),_0xe4115c,_0x481e27,util[_0xef11('0x8')](_0x4db7ea,{'showHidden':![],'depth':null}));delete _0x4db7ea[_0xef11('0x9')];_0x4558b3[_0xef11('0xa')](_0x481e27)['send'](_0x4db7ea);};}exports[_0xef11('0xb')]=function(_0x29b27f,_0xda126f){return info[_0xef11('0xc')]()[_0xef11('0xd')](function(_0x332f15){return _0xda126f['status'](0xc8)[_0xef11('0xe')](_0x332f15);})[_0xef11('0xf')](function(_0xc1b5e5){return _0xda126f[_0xef11('0xa')](0x1f4)['json'](_0xc1b5e5);});};exports['killProcess']=function(_0x1dd80c,_0x8bf676){var _0x253671=[_0xef11('0x10')];return new BPromise(function(_0x12213b,_0x526879){return exec(util[_0xef11('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1dd80c[_0xef11('0x12')][_0xef11('0x13')]),function(_0xc7ee81,_0x5b222c,_0x4d488f){if(_0xc7ee81){return _0x526879(_0xc7ee81);}return _0x12213b(_0x5b222c);});})[_0xef11('0xd')](function(_0x57773e){var _0x3d967f=![];var _0x3c2386=_0x57773e[_0xef11('0x14')](/\n/);for(var _0x6ff9aa=0x0,_0x2850f5=_0x253671['length'];_0x6ff9aa<_0x2850f5,_0x3d967f===![];_0x6ff9aa+=0x1){if(_0x57773e[_0xef11('0x15')](_0x253671[_0x6ff9aa])>=0x0){_0x3d967f=!![];}}if(!_0x3d967f){throw new Error(util[_0xef11('0x11')](_0xef11('0x16'),_0x1dd80c[_0xef11('0x12')]['pid']));}process[_0xef11('0x17')](_0x1dd80c[_0xef11('0x12')][_0xef11('0x13')],_0xef11('0x18'));return _0x8bf676[_0xef11('0xa')](0xc8)[_0xef11('0xe')]({'message':util['format'](_0xef11('0x19'),_0x1dd80c[_0xef11('0x12')][_0xef11('0x13')])});})[_0xef11('0xf')](handleError(_0x8bf676,null,_0xef11('0x1a')));}; \ No newline at end of file +var _0x012c=['pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','child_process','exec','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x3b7295,_0x4ed9cc){var _0x26e3cf=function(_0x42c4a8){while(--_0x42c4a8){_0x3b7295['push'](_0x3b7295['shift']());}};_0x26e3cf(++_0x4ed9cc);}(_0x012c,0x10f));var _0xc012=function(_0x38de16,_0x2acea8){_0x38de16=_0x38de16-0x0;var _0x594a90=_0x012c[_0x38de16];return _0x594a90;};'use strict';var info=require(_0xc012('0x0'));var exec=require(_0xc012('0x1'))[_0xc012('0x2')];var logger=require('../../config/logger')(_0xc012('0x3'));var util=require(_0xc012('0x4'));var BPromise=require('bluebird');var _=require(_0xc012('0x5'));function handleError(_0xf3974d,_0x30836f,_0x4d2d24){_0x30836f=_0x30836f||0x1f4;return function(_0x316ffe){logger[_0xc012('0x6')](_0xc012('0x7'),_0x4d2d24,_0x30836f,util[_0xc012('0x8')](_0x316ffe,{'showHidden':![],'depth':null}));delete _0x316ffe[_0xc012('0x9')];_0xf3974d[_0xc012('0xa')](_0x30836f)[_0xc012('0xb')](_0x316ffe);};}exports[_0xc012('0xc')]=function(_0x1c271b,_0x36c39b){return info[_0xc012('0xd')]()[_0xc012('0xe')](function(_0x4c6c92){return _0x36c39b['status'](0xc8)[_0xc012('0xf')](_0x4c6c92);})['catch'](function(_0x2e06f7){return _0x36c39b[_0xc012('0xa')](0x1f4)[_0xc012('0xf')](_0x2e06f7);});};exports['killProcess']=function(_0x3418ed,_0x164980){var _0x4a5dce=[_0xc012('0x10')];return new BPromise(function(_0x4cced4,_0x2ac68a){return exec(util['format'](_0xc012('0x11'),_0x3418ed[_0xc012('0x12')][_0xc012('0x13')]),function(_0x14a113,_0x2c1f15,_0x2e5949){if(_0x14a113){return _0x2ac68a(_0x14a113);}return _0x4cced4(_0x2c1f15);});})[_0xc012('0xe')](function(_0x1c2318){var _0x5314b7=![];var _0x269129=_0x1c2318[_0xc012('0x14')](/\n/);for(var _0x4e784b=0x0,_0x237f14=_0x4a5dce[_0xc012('0x15')];_0x4e784b<_0x237f14,_0x5314b7===![];_0x4e784b+=0x1){if(_0x1c2318['indexOf'](_0x4a5dce[_0x4e784b])>=0x0){_0x5314b7=!![];}}if(!_0x5314b7){throw new Error(util['format'](_0xc012('0x16'),_0x3418ed[_0xc012('0x12')][_0xc012('0x13')]));}process[_0xc012('0x17')](_0x3418ed[_0xc012('0x12')][_0xc012('0x13')],_0xc012('0x18'));return _0x164980[_0xc012('0xa')](0xc8)[_0xc012('0xf')]({'message':util[_0xc012('0x19')](_0xc012('0x1a'),_0x3418ed['params'][_0xc012('0x13')])});})[_0xc012('0x1b')](handleError(_0x164980,null,_0xc012('0x1c')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a1e0caf..0303868 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 _0xaf3f=['../../components/interaction/service','../../config/environment','./tag.controller','get','index','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4941f1,_0x15453c){var _0x5ad4cb=function(_0x3ad5ed){while(--_0x3ad5ed){_0x4941f1['push'](_0x4941f1['shift']());}};_0x5ad4cb(++_0x15453c);}(_0xaf3f,0x11e));var _0xfaf3=function(_0x3f12a0,_0x3d24c3){_0x3f12a0=_0x3f12a0-0x0;var _0x4b5308=_0xaf3f[_0x3f12a0];return _0x4b5308;};'use strict';var multer=require(_0xfaf3('0x0'));var util=require(_0xfaf3('0x1'));var path=require(_0xfaf3('0x2'));var timeout=require(_0xfaf3('0x3'));var express=require(_0xfaf3('0x4'));var router=express[_0xfaf3('0x5')]();var fs_extra=require(_0xfaf3('0x6'));var auth=require(_0xfaf3('0x7'));var interaction=require(_0xfaf3('0x8'));var config=require(_0xfaf3('0x9'));var controller=require(_0xfaf3('0xa'));router[_0xfaf3('0xb')]('/',auth['isAuthenticated'](),controller[_0xfaf3('0xc')]);router['get']('/:id',auth[_0xfaf3('0xd')](),controller[_0xfaf3('0xe')]);router[_0xfaf3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfaf3('0x10')](_0xfaf3('0x11'),auth[_0xfaf3('0xd')](),controller[_0xfaf3('0x12')]);router[_0xfaf3('0x13')](_0xfaf3('0x11'),auth[_0xfaf3('0xd')](),controller['destroy']);module[_0xfaf3('0x14')]=router; \ No newline at end of file +var _0x6df7=['post','create','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show'];(function(_0x2510a2,_0x54e746){var _0x9bffd9=function(_0x575e3b){while(--_0x575e3b){_0x2510a2['push'](_0x2510a2['shift']());}};_0x9bffd9(++_0x54e746);}(_0x6df7,0x72));var _0x76df=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x6df7[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x76df('0x0'));var util=require('util');var path=require(_0x76df('0x1'));var timeout=require(_0x76df('0x2'));var express=require('express');var router=express[_0x76df('0x3')]();var fs_extra=require(_0x76df('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x76df('0x5'));var config=require(_0x76df('0x6'));var controller=require(_0x76df('0x7'));router['get']('/',auth[_0x76df('0x8')](),controller[_0x76df('0x9')]);router[_0x76df('0xa')]('/:id',auth[_0x76df('0x8')](),controller[_0x76df('0xb')]);router[_0x76df('0xc')]('/',auth[_0x76df('0x8')](),controller[_0x76df('0xd')]);router['put'](_0x76df('0xe'),auth['isAuthenticated'](),controller[_0x76df('0xf')]);router['delete'](_0x76df('0xe'),auth[_0x76df('0x8')](),controller[_0x76df('0x10')]);module[_0x76df('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 d760c70..4c22f0e 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 _0x71f4=['STRING','name','#0091EA'];(function(_0x493f77,_0x4567ac){var _0x472bf8=function(_0x1ceab4){while(--_0x1ceab4){_0x493f77['push'](_0x493f77['shift']());}};_0x472bf8(++_0x4567ac);}(_0x71f4,0xf9));var _0x471f=function(_0x56e72d,_0x146910){_0x56e72d=_0x56e72d-0x0;var _0x576390=_0x71f4[_0x56e72d];return _0x576390;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x471f('0x0')],'unique':_0x471f('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x471f('0x0')],'defaultValue':_0x471f('0x2')},'description':{'type':Sequelize[_0x471f('0x0')]}}; \ No newline at end of file +var _0xd142=['STRING','name','sequelize','exports'];(function(_0x571e32,_0x115f16){var _0x1bfc79=function(_0x4c8888){while(--_0x4c8888){_0x571e32['push'](_0x571e32['shift']());}};_0x1bfc79(++_0x115f16);}(_0xd142,0x11a));var _0x2d14=function(_0x15624a,_0x62a80b){_0x15624a=_0x15624a-0x0;var _0x42b811=_0xd142[_0x15624a];return _0x42b811;};'use strict';var Sequelize=require(_0x2d14('0x0'));module[_0x2d14('0x1')]={'name':{'type':Sequelize[_0x2d14('0x2')],'unique':_0x2d14('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x2d14('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 128833e..c6771c7 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 _0xbb53=['sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x139dd0,_0x79253f){var _0x26f9af=function(_0x4a3f2d){while(--_0x4a3f2d){_0x139dd0['push'](_0x139dd0['shift']());}};_0x26f9af(++_0x79253f);}(_0xbb53,0x121));var _0x3bb5=function(_0x33c7d5,_0x15a1b0){_0x33c7d5=_0x33c7d5-0x0;var _0x1268e9=_0xbb53[_0x33c7d5];return _0x1268e9;};'use strict';var emlformat=require(_0x3bb5('0x0'));var rimraf=require(_0x3bb5('0x1'));var zipdir=require(_0x3bb5('0x2'));var jsonpatch=require(_0x3bb5('0x3'));var rp=require(_0x3bb5('0x4'));var moment=require(_0x3bb5('0x5'));var BPromise=require(_0x3bb5('0x6'));var Mustache=require(_0x3bb5('0x7'));var util=require(_0x3bb5('0x8'));var path=require(_0x3bb5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bb5('0xa'));var fs=require('fs');var fs_extra=require(_0x3bb5('0xb'));var _=require(_0x3bb5('0xc'));var squel=require(_0x3bb5('0xd'));var crypto=require(_0x3bb5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3bb5('0xf'));var Papa=require(_0x3bb5('0x10'));var Redis=require(_0x3bb5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3bb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bb5('0x13'))(_0x3bb5('0x14'));var utils=require('../../config/utils');var config=require(_0x3bb5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bb5('0x16'))['db'];function respondWithStatusCode(_0x511bd8,_0x526bf0){_0x526bf0=_0x526bf0||0xcc;return function(_0x223356){if(_0x223356){return _0x511bd8[_0x3bb5('0x17')](_0x526bf0);}return _0x511bd8[_0x3bb5('0x18')](_0x526bf0)['end']();};}function respondWithResult(_0xd578fc,_0x12e409){_0x12e409=_0x12e409||0xc8;return function(_0x519123){if(_0x519123){return _0xd578fc[_0x3bb5('0x18')](_0x12e409)[_0x3bb5('0x19')](_0x519123);}};}function respondWithFilteredResult(_0x5cec77,_0x5ca99f){return function(_0x50617f){if(_0x50617f){var _0x42ef1b=typeof _0x5ca99f[_0x3bb5('0x1a')]==='undefined'&&typeof _0x5ca99f[_0x3bb5('0x1b')]===_0x3bb5('0x1c');var _0x4656c4=_0x50617f[_0x3bb5('0x1d')];var _0x48bc25=_0x42ef1b?0x0:_0x5ca99f[_0x3bb5('0x1a')];var _0x1109d0=_0x42ef1b?_0x50617f[_0x3bb5('0x1d')]:_0x5ca99f['offset']+_0x5ca99f['limit'];var _0x19b177;if(_0x1109d0>=_0x4656c4){_0x1109d0=_0x4656c4;_0x19b177=0xc8;}else{_0x19b177=0xce;}_0x5cec77[_0x3bb5('0x18')](_0x19b177);return _0x5cec77[_0x3bb5('0x1e')]('Content-Range',_0x48bc25+'-'+_0x1109d0+'/'+_0x4656c4)[_0x3bb5('0x19')](_0x50617f);}return null;};}function patchUpdates(_0x2afe6e){return function(_0x3f94ad){try{jsonpatch[_0x3bb5('0x1f')](_0x3f94ad,_0x2afe6e,!![]);}catch(_0x21a3ff){return BPromise[_0x3bb5('0x20')](_0x21a3ff);}return _0x3f94ad['save']();};}function saveUpdates(_0x37444e,_0x3eae85){return function(_0x438a8d){if(_0x438a8d){return _0x438a8d[_0x3bb5('0x21')](_0x37444e)[_0x3bb5('0x22')](function(_0xfb9e8){return _0xfb9e8;});}return null;};}function removeEntity(_0x341a3f,_0x58c10f){return function(_0x1d2a24){if(_0x1d2a24){return _0x1d2a24[_0x3bb5('0x23')]()['then'](function(){var _0x4fc81b=_0x1d2a24[_0x3bb5('0x24')]({'plain':!![]});var _0x36cfda='Tags';return db['UserProfileResource'][_0x3bb5('0x23')]({'where':{'type':_0x36cfda,'resourceId':_0x4fc81b['id']}})[_0x3bb5('0x22')](function(){return _0x1d2a24;});})[_0x3bb5('0x22')](function(){_0x341a3f[_0x3bb5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5baf9a,_0x33e943){return function(_0x4e8c65){if(!_0x4e8c65){_0x5baf9a[_0x3bb5('0x17')](0x194);}return _0x4e8c65;};}function handleError(_0x2d65ec,_0x2e67f7){_0x2e67f7=_0x2e67f7||0x1f4;return function(_0x534b15){logger['error'](_0x534b15[_0x3bb5('0x25')]);if(_0x534b15[_0x3bb5('0x26')]){delete _0x534b15[_0x3bb5('0x26')];}_0x2d65ec[_0x3bb5('0x18')](_0x2e67f7)[_0x3bb5('0x27')](_0x534b15);};}exports[_0x3bb5('0x28')]=function(_0x3ed2cc,_0x5ce225){var _0x1b429e={},_0xa643c9={},_0x5ebd0a={'count':0x0,'rows':[]};var _0x2ba5f4=_[_0x3bb5('0x29')](db[_0x3bb5('0x2a')][_0x3bb5('0x2b')],function(_0x52cd46){return{'name':_0x52cd46[_0x3bb5('0x2c')],'type':_0x52cd46[_0x3bb5('0x2d')]['key']};});_0xa643c9[_0x3bb5('0x2e')]=_[_0x3bb5('0x29')](_0x2ba5f4,_0x3bb5('0x26'));_0xa643c9[_0x3bb5('0x2f')]=_[_0x3bb5('0x30')](_0x3ed2cc['query']);_0xa643c9[_0x3bb5('0x31')]=_[_0x3bb5('0x32')](_0xa643c9[_0x3bb5('0x2e')],_0xa643c9[_0x3bb5('0x2f')]);_0x1b429e['attributes']=_['intersection'](_0xa643c9[_0x3bb5('0x2e')],qs[_0x3bb5('0x33')](_0x3ed2cc[_0x3bb5('0x2f')][_0x3bb5('0x33')]));_0x1b429e[_0x3bb5('0x34')]=_0x1b429e[_0x3bb5('0x34')][_0x3bb5('0x35')]?_0x1b429e[_0x3bb5('0x34')]:_0xa643c9[_0x3bb5('0x2e')];if(!_0x3ed2cc['query'][_0x3bb5('0x36')](_0x3bb5('0x37'))){_0x1b429e['limit']=qs['limit'](_0x3ed2cc[_0x3bb5('0x2f')][_0x3bb5('0x1b')]);_0x1b429e[_0x3bb5('0x1a')]=qs[_0x3bb5('0x1a')](_0x3ed2cc['query']['offset']);}_0x1b429e[_0x3bb5('0x38')]=qs['sort'](_0x3ed2cc[_0x3bb5('0x2f')]['sort']);_0x1b429e['where']=qs[_0x3bb5('0x31')](_['pick'](_0x3ed2cc['query'],_0xa643c9[_0x3bb5('0x31')]),_0x2ba5f4);if(_0x3ed2cc[_0x3bb5('0x2f')][_0x3bb5('0x39')]){_0x1b429e['where']=_[_0x3bb5('0x3a')](_0x1b429e['where'],{'$or':_[_0x3bb5('0x29')](_0x2ba5f4,function(_0x47c663){if(_0x47c663[_0x3bb5('0x2d')]!==_0x3bb5('0x3b')){var _0x4209d2={};_0x4209d2[_0x47c663[_0x3bb5('0x26')]]={'$like':'%'+_0x3ed2cc[_0x3bb5('0x2f')][_0x3bb5('0x39')]+'%'};return _0x4209d2;}})});}_0x1b429e=_['merge']({},_0x1b429e,_0x3ed2cc[_0x3bb5('0x3c')]);var _0x7c1b7b={'where':_0x1b429e['where']};return db[_0x3bb5('0x2a')][_0x3bb5('0x1d')](_0x7c1b7b)[_0x3bb5('0x22')](function(_0x5cfb72){_0x5ebd0a[_0x3bb5('0x1d')]=_0x5cfb72;if(_0x3ed2cc[_0x3bb5('0x2f')]['includeAll']){_0x1b429e[_0x3bb5('0x3d')]=[{'all':!![]}];}return db[_0x3bb5('0x2a')][_0x3bb5('0x3e')](_0x1b429e);})[_0x3bb5('0x22')](function(_0x663685){_0x5ebd0a[_0x3bb5('0x3f')]=_0x663685;return _0x5ebd0a;})[_0x3bb5('0x22')](respondWithFilteredResult(_0x5ce225,_0x1b429e))[_0x3bb5('0x40')](handleError(_0x5ce225,null));};exports[_0x3bb5('0x41')]=function(_0x42676d,_0x2539e4){var _0x64e6e7={'raw':!![],'where':{'id':_0x42676d[_0x3bb5('0x42')]['id']}},_0x20478a={};_0x20478a['model']=_[_0x3bb5('0x30')](db[_0x3bb5('0x2a')]['rawAttributes']);_0x20478a['query']=_[_0x3bb5('0x30')](_0x42676d[_0x3bb5('0x2f')]);_0x20478a[_0x3bb5('0x31')]=_[_0x3bb5('0x32')](_0x20478a[_0x3bb5('0x2e')],_0x20478a[_0x3bb5('0x2f')]);_0x64e6e7[_0x3bb5('0x34')]=_[_0x3bb5('0x32')](_0x20478a['model'],qs['fields'](_0x42676d[_0x3bb5('0x2f')][_0x3bb5('0x33')]));_0x64e6e7[_0x3bb5('0x34')]=_0x64e6e7['attributes'][_0x3bb5('0x35')]?_0x64e6e7['attributes']:_0x20478a[_0x3bb5('0x2e')];if(_0x42676d[_0x3bb5('0x2f')][_0x3bb5('0x43')]){_0x64e6e7[_0x3bb5('0x3d')]=[{'all':!![]}];}_0x64e6e7=_[_0x3bb5('0x3a')]({},_0x64e6e7,_0x42676d[_0x3bb5('0x3c')]);return db['Tag'][_0x3bb5('0x44')](_0x64e6e7)[_0x3bb5('0x22')](handleEntityNotFound(_0x2539e4,null))['then'](respondWithResult(_0x2539e4,null))[_0x3bb5('0x40')](handleError(_0x2539e4,null));};exports[_0x3bb5('0x45')]=function(_0x5075bd,_0x41edf7){return db[_0x3bb5('0x2a')][_0x3bb5('0x45')](_0x5075bd[_0x3bb5('0x46')],{})[_0x3bb5('0x22')](function(_0x5b2e46){var _0x40f47c=_0x5075bd[_0x3bb5('0x47')]['get']({'plain':!![]});if(!_0x40f47c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40f47c[_0x3bb5('0x48')]===_0x3bb5('0x47')){var _0x1e5b64=_0x5b2e46[_0x3bb5('0x24')]({'plain':!![]});var _0x1e4edd='Tags';return db[_0x3bb5('0x49')][_0x3bb5('0x44')]({'where':{'name':_0x1e4edd,'userProfileId':_0x40f47c[_0x3bb5('0x4a')]},'raw':!![]})[_0x3bb5('0x22')](function(_0x2d03c0){if(_0x2d03c0&&_0x2d03c0[_0x3bb5('0x4b')]===0x0){return db[_0x3bb5('0x4c')]['create']({'name':_0x1e5b64[_0x3bb5('0x26')],'resourceId':_0x1e5b64['id'],'type':_0x2d03c0[_0x3bb5('0x26')],'sectionId':_0x2d03c0['id']},{})[_0x3bb5('0x22')](function(){return _0x5b2e46;});}else{return _0x5b2e46;}})[_0x3bb5('0x40')](function(_0x29e695){logger['error'](_0x3bb5('0x4d'),_0x29e695);throw _0x29e695;});}return _0x5b2e46;})[_0x3bb5('0x22')](respondWithResult(_0x41edf7,0xc9))[_0x3bb5('0x40')](handleError(_0x41edf7,null));};exports[_0x3bb5('0x21')]=function(_0x168aae,_0x3f9133){if(_0x168aae[_0x3bb5('0x46')]['id']){delete _0x168aae[_0x3bb5('0x46')]['id'];}return db['Tag'][_0x3bb5('0x44')]({'where':{'id':_0x168aae[_0x3bb5('0x42')]['id']}})[_0x3bb5('0x22')](handleEntityNotFound(_0x3f9133,null))[_0x3bb5('0x22')](saveUpdates(_0x168aae['body'],null))[_0x3bb5('0x22')](respondWithResult(_0x3f9133,null))['catch'](handleError(_0x3f9133,null));};exports[_0x3bb5('0x23')]=function(_0x26f66d,_0xe04576){return db[_0x3bb5('0x2a')][_0x3bb5('0x44')]({'where':{'id':_0x26f66d['params']['id']}})[_0x3bb5('0x22')](handleEntityNotFound(_0xe04576,null))[_0x3bb5('0x22')](removeEntity(_0xe04576,null))[_0x3bb5('0x40')](handleError(_0xe04576,null));}; \ No newline at end of file +var _0xa8a8=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','get','Tags','UserProfileResource','destroy','error','name','send','index','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','type','options','Tag','catch','show','rawAttributes','includeAll','include','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2b0b53,_0x5ec6cf){var _0x3cfdf8=function(_0x33417d){while(--_0x33417d){_0x2b0b53['push'](_0x2b0b53['shift']());}};_0x3cfdf8(++_0x5ec6cf);}(_0xa8a8,0xec));var _0x8a8a=function(_0x374bb1,_0x516372){_0x374bb1=_0x374bb1-0x0;var _0x470501=_0xa8a8[_0x374bb1];return _0x470501;};'use strict';var emlformat=require(_0x8a8a('0x0'));var rimraf=require(_0x8a8a('0x1'));var zipdir=require(_0x8a8a('0x2'));var jsonpatch=require(_0x8a8a('0x3'));var rp=require('request-promise');var moment=require(_0x8a8a('0x4'));var BPromise=require(_0x8a8a('0x5'));var Mustache=require(_0x8a8a('0x6'));var util=require(_0x8a8a('0x7'));var path=require(_0x8a8a('0x8'));var sox=require(_0x8a8a('0x9'));var csv=require(_0x8a8a('0xa'));var ejs=require(_0x8a8a('0xb'));var fs=require('fs');var fs_extra=require(_0x8a8a('0xc'));var _=require(_0x8a8a('0xd'));var squel=require(_0x8a8a('0xe'));var crypto=require(_0x8a8a('0xf'));var jsforce=require(_0x8a8a('0x10'));var deskjs=require(_0x8a8a('0x11'));var toCsv=require(_0x8a8a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8a8a('0x13'));var as=require(_0x8a8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a8a('0x15'))(_0x8a8a('0x16'));var utils=require(_0x8a8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8a8a('0x18'));var db=require(_0x8a8a('0x19'))['db'];function respondWithStatusCode(_0x330796,_0x234481){_0x234481=_0x234481||0xcc;return function(_0x4a1b91){if(_0x4a1b91){return _0x330796[_0x8a8a('0x1a')](_0x234481);}return _0x330796['status'](_0x234481)[_0x8a8a('0x1b')]();};}function respondWithResult(_0xb2a3bc,_0x787eec){_0x787eec=_0x787eec||0xc8;return function(_0x2f6e33){if(_0x2f6e33){return _0xb2a3bc[_0x8a8a('0x1c')](_0x787eec)[_0x8a8a('0x1d')](_0x2f6e33);}};}function respondWithFilteredResult(_0x16d38d,_0x51ce75){return function(_0x1ed3be){if(_0x1ed3be){var _0x568b83=typeof _0x51ce75[_0x8a8a('0x1e')]===_0x8a8a('0x1f')&&typeof _0x51ce75[_0x8a8a('0x20')]===_0x8a8a('0x1f');var _0x42e8b6=_0x1ed3be['count'];var _0x9d55f9=_0x568b83?0x0:_0x51ce75[_0x8a8a('0x1e')];var _0x262ca9=_0x568b83?_0x1ed3be[_0x8a8a('0x21')]:_0x51ce75[_0x8a8a('0x1e')]+_0x51ce75[_0x8a8a('0x20')];var _0x4d7a45;if(_0x262ca9>=_0x42e8b6){_0x262ca9=_0x42e8b6;_0x4d7a45=0xc8;}else{_0x4d7a45=0xce;}_0x16d38d['status'](_0x4d7a45);return _0x16d38d['set']('Content-Range',_0x9d55f9+'-'+_0x262ca9+'/'+_0x42e8b6)['json'](_0x1ed3be);}return null;};}function patchUpdates(_0x3a9b2f){return function(_0x45095b){try{jsonpatch[_0x8a8a('0x22')](_0x45095b,_0x3a9b2f,!![]);}catch(_0x44719e){return BPromise[_0x8a8a('0x23')](_0x44719e);}return _0x45095b[_0x8a8a('0x24')]();};}function saveUpdates(_0x242bac,_0xe0321c){return function(_0x25d5d4){if(_0x25d5d4){return _0x25d5d4[_0x8a8a('0x25')](_0x242bac)[_0x8a8a('0x26')](function(_0x3aa2bb){return _0x3aa2bb;});}return null;};}function removeEntity(_0x3b4ece,_0x625c1b){return function(_0x442c00){if(_0x442c00){return _0x442c00['destroy']()[_0x8a8a('0x26')](function(){var _0x16c55b=_0x442c00[_0x8a8a('0x27')]({'plain':!![]});var _0x7662e=_0x8a8a('0x28');return db[_0x8a8a('0x29')][_0x8a8a('0x2a')]({'where':{'type':_0x7662e,'resourceId':_0x16c55b['id']}})['then'](function(){return _0x442c00;});})[_0x8a8a('0x26')](function(){_0x3b4ece[_0x8a8a('0x1c')](0xcc)[_0x8a8a('0x1b')]();});}};}function handleEntityNotFound(_0x54ff7e,_0x58f42b){return function(_0x2dafcd){if(!_0x2dafcd){_0x54ff7e[_0x8a8a('0x1a')](0x194);}return _0x2dafcd;};}function handleError(_0x5c70bd,_0x4d8760){_0x4d8760=_0x4d8760||0x1f4;return function(_0x4b3bc5){logger[_0x8a8a('0x2b')](_0x4b3bc5['stack']);if(_0x4b3bc5[_0x8a8a('0x2c')]){delete _0x4b3bc5[_0x8a8a('0x2c')];}_0x5c70bd['status'](_0x4d8760)[_0x8a8a('0x2d')](_0x4b3bc5);};}exports[_0x8a8a('0x2e')]=function(_0x250852,_0x8df0cb){var _0x41802e={},_0x3d6594={},_0x3e73b1={'count':0x0,'rows':[]};var _0x2a2917=_['map'](db['Tag']['rawAttributes'],function(_0x2a00a7){return{'name':_0x2a00a7[_0x8a8a('0x2f')],'type':_0x2a00a7['type'][_0x8a8a('0x30')]};});_0x3d6594[_0x8a8a('0x31')]=_['map'](_0x2a2917,_0x8a8a('0x2c'));_0x3d6594[_0x8a8a('0x32')]=_[_0x8a8a('0x33')](_0x250852['query']);_0x3d6594['filters']=_[_0x8a8a('0x34')](_0x3d6594['model'],_0x3d6594[_0x8a8a('0x32')]);_0x41802e[_0x8a8a('0x35')]=_[_0x8a8a('0x34')](_0x3d6594[_0x8a8a('0x31')],qs[_0x8a8a('0x36')](_0x250852[_0x8a8a('0x32')][_0x8a8a('0x36')]));_0x41802e[_0x8a8a('0x35')]=_0x41802e[_0x8a8a('0x35')][_0x8a8a('0x37')]?_0x41802e[_0x8a8a('0x35')]:_0x3d6594[_0x8a8a('0x31')];if(!_0x250852[_0x8a8a('0x32')][_0x8a8a('0x38')](_0x8a8a('0x39'))){_0x41802e[_0x8a8a('0x20')]=qs[_0x8a8a('0x20')](_0x250852[_0x8a8a('0x32')]['limit']);_0x41802e['offset']=qs['offset'](_0x250852[_0x8a8a('0x32')][_0x8a8a('0x1e')]);}_0x41802e[_0x8a8a('0x3a')]=qs[_0x8a8a('0x3b')](_0x250852[_0x8a8a('0x32')]['sort']);_0x41802e['where']=qs[_0x8a8a('0x3c')](_['pick'](_0x250852[_0x8a8a('0x32')],_0x3d6594['filters']),_0x2a2917);if(_0x250852['query'][_0x8a8a('0x3d')]){_0x41802e[_0x8a8a('0x3e')]=_[_0x8a8a('0x3f')](_0x41802e[_0x8a8a('0x3e')],{'$or':_[_0x8a8a('0x40')](_0x2a2917,function(_0x3a0e91){if(_0x3a0e91[_0x8a8a('0x41')]!=='VIRTUAL'){var _0x40d509={};_0x40d509[_0x3a0e91[_0x8a8a('0x2c')]]={'$like':'%'+_0x250852[_0x8a8a('0x32')]['filter']+'%'};return _0x40d509;}})});}_0x41802e=_[_0x8a8a('0x3f')]({},_0x41802e,_0x250852[_0x8a8a('0x42')]);var _0x3f845e={'where':_0x41802e['where']};return db[_0x8a8a('0x43')][_0x8a8a('0x21')](_0x3f845e)[_0x8a8a('0x26')](function(_0x19fd7a){_0x3e73b1[_0x8a8a('0x21')]=_0x19fd7a;if(_0x250852[_0x8a8a('0x32')]['includeAll']){_0x41802e['include']=[{'all':!![]}];}return db[_0x8a8a('0x43')]['findAll'](_0x41802e);})[_0x8a8a('0x26')](function(_0x1aa8b5){_0x3e73b1['rows']=_0x1aa8b5;return _0x3e73b1;})['then'](respondWithFilteredResult(_0x8df0cb,_0x41802e))[_0x8a8a('0x44')](handleError(_0x8df0cb,null));};exports[_0x8a8a('0x45')]=function(_0x41d986,_0x2c1b87){var _0x492596={'raw':!![],'where':{'id':_0x41d986['params']['id']}},_0x103223={};_0x103223[_0x8a8a('0x31')]=_[_0x8a8a('0x33')](db['Tag'][_0x8a8a('0x46')]);_0x103223[_0x8a8a('0x32')]=_[_0x8a8a('0x33')](_0x41d986['query']);_0x103223[_0x8a8a('0x3c')]=_[_0x8a8a('0x34')](_0x103223[_0x8a8a('0x31')],_0x103223['query']);_0x492596['attributes']=_[_0x8a8a('0x34')](_0x103223[_0x8a8a('0x31')],qs[_0x8a8a('0x36')](_0x41d986['query'][_0x8a8a('0x36')]));_0x492596[_0x8a8a('0x35')]=_0x492596[_0x8a8a('0x35')][_0x8a8a('0x37')]?_0x492596[_0x8a8a('0x35')]:_0x103223[_0x8a8a('0x31')];if(_0x41d986[_0x8a8a('0x32')][_0x8a8a('0x47')]){_0x492596[_0x8a8a('0x48')]=[{'all':!![]}];}_0x492596=_[_0x8a8a('0x3f')]({},_0x492596,_0x41d986[_0x8a8a('0x42')]);return db['Tag'][_0x8a8a('0x49')](_0x492596)[_0x8a8a('0x26')](handleEntityNotFound(_0x2c1b87,null))[_0x8a8a('0x26')](respondWithResult(_0x2c1b87,null))[_0x8a8a('0x44')](handleError(_0x2c1b87,null));};exports[_0x8a8a('0x4a')]=function(_0x2e22b0,_0x565a49){return db[_0x8a8a('0x43')][_0x8a8a('0x4a')](_0x2e22b0[_0x8a8a('0x4b')],{})[_0x8a8a('0x26')](function(_0x494df8){var _0x1faad3=_0x2e22b0[_0x8a8a('0x4c')][_0x8a8a('0x27')]({'plain':!![]});if(!_0x1faad3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1faad3['role']===_0x8a8a('0x4c')){var _0x39a8e0=_0x494df8[_0x8a8a('0x27')]({'plain':!![]});var _0x51d2e=_0x8a8a('0x28');return db[_0x8a8a('0x4d')][_0x8a8a('0x49')]({'where':{'name':_0x51d2e,'userProfileId':_0x1faad3[_0x8a8a('0x4e')]},'raw':!![]})[_0x8a8a('0x26')](function(_0x4ab312){if(_0x4ab312&&_0x4ab312['autoAssociation']===0x0){return db[_0x8a8a('0x29')][_0x8a8a('0x4a')]({'name':_0x39a8e0['name'],'resourceId':_0x39a8e0['id'],'type':_0x4ab312['name'],'sectionId':_0x4ab312['id']},{})[_0x8a8a('0x26')](function(){return _0x494df8;});}else{return _0x494df8;}})['catch'](function(_0x3faa28){logger['error'](_0x8a8a('0x4f'),_0x3faa28);throw _0x3faa28;});}return _0x494df8;})[_0x8a8a('0x26')](respondWithResult(_0x565a49,0xc9))[_0x8a8a('0x44')](handleError(_0x565a49,null));};exports[_0x8a8a('0x25')]=function(_0x330654,_0x14066f){if(_0x330654[_0x8a8a('0x4b')]['id']){delete _0x330654[_0x8a8a('0x4b')]['id'];}return db[_0x8a8a('0x43')][_0x8a8a('0x49')]({'where':{'id':_0x330654['params']['id']}})[_0x8a8a('0x26')](handleEntityNotFound(_0x14066f,null))[_0x8a8a('0x26')](saveUpdates(_0x330654[_0x8a8a('0x4b')],null))[_0x8a8a('0x26')](respondWithResult(_0x14066f,null))[_0x8a8a('0x44')](handleError(_0x14066f,null));};exports['destroy']=function(_0x428d57,_0x140673){return db['Tag']['find']({'where':{'id':_0x428d57[_0x8a8a('0x50')]['id']}})[_0x8a8a('0x26')](handleEntityNotFound(_0x140673,null))[_0x8a8a('0x26')](removeEntity(_0x140673,null))[_0x8a8a('0x44')](handleError(_0x140673,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 2b27957..e3e77f7 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 _0x3e0f=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags'];(function(_0x6ee304,_0x5cb4ea){var _0x439a31=function(_0x3a7215){while(--_0x3a7215){_0x6ee304['push'](_0x6ee304['shift']());}};_0x439a31(++_0x5cb4ea);}(_0x3e0f,0xfc));var _0xf3e0=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x3e0f[_0x580b15];return _0x1adb1b;};'use strict';var _=require(_0xf3e0('0x0'));var util=require(_0xf3e0('0x1'));var logger=require(_0xf3e0('0x2'))(_0xf3e0('0x3'));var moment=require('moment');var BPromise=require(_0xf3e0('0x4'));var rp=require(_0xf3e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3e0('0x6'));var config=require(_0xf3e0('0x7'));var attributes=require(_0xf3e0('0x8'));module[_0xf3e0('0x9')]=function(_0x3006f9,_0x4ffd45){return _0x3006f9['define'](_0xf3e0('0xa'),attributes,{'tableName':_0xf3e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a96=['./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x1b74ed,_0xb8ef87){var _0x258a76=function(_0x2a3a32){while(--_0x2a3a32){_0x1b74ed['push'](_0x1b74ed['shift']());}};_0x258a76(++_0xb8ef87);}(_0x2a96,0xdc));var _0x62a9=function(_0x562fc8,_0x2ff988){_0x562fc8=_0x562fc8-0x0;var _0x4b42d8=_0x2a96[_0x562fc8];return _0x4b42d8;};'use strict';var _=require(_0x62a9('0x0'));var util=require(_0x62a9('0x1'));var logger=require(_0x62a9('0x2'))(_0x62a9('0x3'));var moment=require(_0x62a9('0x4'));var BPromise=require('bluebird');var rp=require(_0x62a9('0x5'));var fs=require('fs');var path=require(_0x62a9('0x6'));var rimraf=require('rimraf');var config=require(_0x62a9('0x7'));var attributes=require(_0x62a9('0x8'));module[_0x62a9('0x9')]=function(_0x4cb441,_0x11e94b){return _0x4cb441[_0x62a9('0xa')](_0x62a9('0xb'),attributes,{'tableName':'tools_tags','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 0ba4fbf..514fddc 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 _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x99e9,0xb4));var _0x999e=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x99e9[_0x4492af];return _0x216729;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('Tag,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});} \ No newline at end of file +var _0xe5d5=['request\x20sent','result','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xe5d5,0x156));var _0x5e5d=function(_0x367e66,_0x40a5fd){_0x367e66=_0x367e66-0x0;var _0x177861=_0xe5d5[_0x367e66];return _0x177861;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e5d('0x0'));var BPromise=require('bluebird');var rs=require(_0x5e5d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e5d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e5d('0x3'))(_0x5e5d('0x4'));var config=require(_0x5e5d('0x5'));var jayson=require(_0x5e5d('0x6'));var client=jayson[_0x5e5d('0x7')][_0x5e5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3200d5,_0xab446c,_0x23de8d){return new BPromise(function(_0x131a59,_0x11973c){return client[_0x5e5d('0x9')](_0x3200d5,_0x23de8d)[_0x5e5d('0xa')](function(_0x5d3a3b){logger['info'](_0x5e5d('0xb'),_0xab446c,'request\x20sent');logger[_0x5e5d('0xc')](_0x5e5d('0xd'),_0xab446c,'request\x20sent',JSON[_0x5e5d('0xe')](_0x5d3a3b));if(_0x5d3a3b[_0x5e5d('0xf')]){if(_0x5d3a3b[_0x5e5d('0xf')][_0x5e5d('0x10')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0xab446c,_0x5d3a3b[_0x5e5d('0xf')][_0x5e5d('0x11')]);return _0x11973c(_0x5d3a3b['error'][_0x5e5d('0x11')]);}logger[_0x5e5d('0xf')]('Tag,\x20%s,\x20%s',_0xab446c,_0x5d3a3b[_0x5e5d('0xf')][_0x5e5d('0x11')]);return _0x131a59(_0x5d3a3b['error']['message']);}else{logger['info'](_0x5e5d('0xb'),_0xab446c,_0x5e5d('0x12'));_0x131a59(_0x5d3a3b[_0x5e5d('0x13')][_0x5e5d('0x11')]);}})['catch'](function(_0x132532){logger[_0x5e5d('0xf')](_0x5e5d('0xb'),_0xab446c,_0x132532);_0x11973c(_0x132532);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 65163cd..431e850 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 4aeb0c3..70144fb 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(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xb7e7,0x121));var _0x7b7e=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xb7e7[_0x55abd9];return _0x3e5669;};'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 _0xd8b0=['exports','sequelize'];(function(_0x5e34b8,_0x25fcf5){var _0x3511e7=function(_0x1e1c17){while(--_0x1e1c17){_0x5e34b8['push'](_0x5e34b8['shift']());}};_0x3511e7(++_0x25fcf5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 3ff6238..f35922a 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 _0xc4e9=['then','includeAll','include','findAll','rows','catch','show','params','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','getQueues','channel','isValidChannel','ValidationError','capitalize','Queue','pick','toLowerCase','Queues','addQueues','findOne','Unknown\x20channel','ids','removeQueues','remove','addAgents','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','defaults','TeamVoiceQueue','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','TeamVoicePrefix','spread','Chat','removeAgents','getAgents','hasOwnProperty','nolimit','eml-format','rimraf','request-promise','moment','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/utils','../../config/environment','../../mysqldb','redis','localhost','./team.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','options'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xc4e9,0x1a9));var _0x9c4e=function(_0x154584,_0x421e12){_0x154584=_0x154584-0x0;var _0x969074=_0xc4e9[_0x154584];return _0x969074;};'use strict';var emlformat=require(_0x9c4e('0x0'));var rimraf=require(_0x9c4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9c4e('0x2'));var moment=require(_0x9c4e('0x3'));var BPromise=require(_0x9c4e('0x4'));var Mustache=require(_0x9c4e('0x5'));var util=require('util');var path=require(_0x9c4e('0x6'));var sox=require(_0x9c4e('0x7'));var csv=require(_0x9c4e('0x8'));var ejs=require(_0x9c4e('0x9'));var fs=require('fs');var fs_extra=require(_0x9c4e('0xa'));var _=require(_0x9c4e('0xb'));var squel=require(_0x9c4e('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c4e('0xd'));var deskjs=require(_0x9c4e('0xe'));var toCsv=require(_0x9c4e('0x8'));var querystring=require(_0x9c4e('0xf'));var Papa=require(_0x9c4e('0x10'));var Redis=require(_0x9c4e('0x11'));var authService=require(_0x9c4e('0x12'));var qs=require(_0x9c4e('0x13'));var as=require(_0x9c4e('0x14'));var hardwareService=require(_0x9c4e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9c4e('0x16'));var config=require(_0x9c4e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c4e('0x18'))['db'];config['redis']=_['defaults'](config[_0x9c4e('0x19')],{'host':_0x9c4e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c4e('0x19')]));require(_0x9c4e('0x1b'))[_0x9c4e('0x1c')](socket);function respondWithStatusCode(_0x11c396,_0x3f9835){_0x3f9835=_0x3f9835||0xcc;return function(_0x390fac){if(_0x390fac){return _0x11c396['sendStatus'](_0x3f9835);}return _0x11c396[_0x9c4e('0x1d')](_0x3f9835)[_0x9c4e('0x1e')]();};}function respondWithResult(_0x1660b8,_0x4289b5){_0x4289b5=_0x4289b5||0xc8;return function(_0x2ae29d){if(_0x2ae29d){return _0x1660b8[_0x9c4e('0x1d')](_0x4289b5)[_0x9c4e('0x1f')](_0x2ae29d);}};}function respondWithFilteredResult(_0xf95772,_0x5af65c){return function(_0x25143d){if(_0x25143d){var _0x35b930=typeof _0x5af65c['offset']===_0x9c4e('0x20')&&typeof _0x5af65c[_0x9c4e('0x21')]===_0x9c4e('0x20');var _0x24546d=_0x25143d[_0x9c4e('0x22')];var _0x99b113=_0x35b930?0x0:_0x5af65c[_0x9c4e('0x23')];var _0x2b2ad2=_0x35b930?_0x25143d[_0x9c4e('0x22')]:_0x5af65c[_0x9c4e('0x23')]+_0x5af65c[_0x9c4e('0x21')];var _0x20a146;if(_0x2b2ad2>=_0x24546d){_0x2b2ad2=_0x24546d;_0x20a146=0xc8;}else{_0x20a146=0xce;}_0xf95772[_0x9c4e('0x1d')](_0x20a146);return _0xf95772[_0x9c4e('0x24')](_0x9c4e('0x25'),_0x99b113+'-'+_0x2b2ad2+'/'+_0x24546d)[_0x9c4e('0x1f')](_0x25143d);}return null;};}function patchUpdates(_0x2db4ec){return function(_0x59c9ee){try{jsonpatch[_0x9c4e('0x26')](_0x59c9ee,_0x2db4ec,!![]);}catch(_0x10a7c9){return BPromise[_0x9c4e('0x27')](_0x10a7c9);}return _0x59c9ee[_0x9c4e('0x28')]();};}function saveUpdates(_0x3d7ca5,_0x1ab677){return function(_0x226ebc){if(_0x226ebc){return _0x226ebc[_0x9c4e('0x29')](_0x3d7ca5)['then'](function(_0x23837c){return _0x23837c;});}return null;};}function handleEntityNotFound(_0x3ca95c,_0x51bf78){return function(_0xee00b6){if(!_0xee00b6){_0x3ca95c[_0x9c4e('0x2a')](0x194);}return _0xee00b6;};}function handleError(_0x1139e6,_0x410329){_0x410329=_0x410329||0x1f4;return function(_0x1e1dc4){logger[_0x9c4e('0x2b')](_0x1e1dc4[_0x9c4e('0x2c')]);if(_0x1e1dc4[_0x9c4e('0x2d')]){delete _0x1e1dc4[_0x9c4e('0x2d')];}_0x1139e6['status'](_0x410329)[_0x9c4e('0x2e')](_0x1e1dc4);};}exports[_0x9c4e('0x2f')]=function(_0x47b56b,_0x46fd6f){var _0x5f35f6={},_0x226eee={},_0x2c5645={'count':0x0,'rows':[]};var _0x2baa7f=_[_0x9c4e('0x30')](db[_0x9c4e('0x31')][_0x9c4e('0x32')],function(_0x9c01d1){return{'name':_0x9c01d1[_0x9c4e('0x33')],'type':_0x9c01d1[_0x9c4e('0x34')][_0x9c4e('0x35')]};});_0x226eee[_0x9c4e('0x36')]=_['map'](_0x2baa7f,_0x9c4e('0x2d'));_0x226eee[_0x9c4e('0x37')]=_[_0x9c4e('0x38')](_0x47b56b[_0x9c4e('0x37')]);_0x226eee[_0x9c4e('0x39')]=_[_0x9c4e('0x3a')](_0x226eee['model'],_0x226eee[_0x9c4e('0x37')]);_0x5f35f6[_0x9c4e('0x3b')]=_[_0x9c4e('0x3a')](_0x226eee[_0x9c4e('0x36')],qs['fields'](_0x47b56b[_0x9c4e('0x37')][_0x9c4e('0x3c')]));_0x5f35f6[_0x9c4e('0x3b')]=_0x5f35f6['attributes']['length']?_0x5f35f6['attributes']:_0x226eee[_0x9c4e('0x36')];if(!_0x47b56b['query']['hasOwnProperty']('nolimit')){_0x5f35f6['limit']=qs[_0x9c4e('0x21')](_0x47b56b[_0x9c4e('0x37')][_0x9c4e('0x21')]);_0x5f35f6[_0x9c4e('0x23')]=qs[_0x9c4e('0x23')](_0x47b56b['query'][_0x9c4e('0x23')]);}_0x5f35f6[_0x9c4e('0x3d')]=qs['sort'](_0x47b56b[_0x9c4e('0x37')][_0x9c4e('0x3e')]);_0x5f35f6[_0x9c4e('0x3f')]=qs['filters'](_['pick'](_0x47b56b[_0x9c4e('0x37')],_0x226eee['filters']),_0x2baa7f);if(_0x47b56b[_0x9c4e('0x37')][_0x9c4e('0x40')]){_0x5f35f6[_0x9c4e('0x3f')]=_[_0x9c4e('0x41')](_0x5f35f6[_0x9c4e('0x3f')],{'$or':_[_0x9c4e('0x30')](_0x2baa7f,function(_0x1bc99d){if(_0x1bc99d['type']!=='VIRTUAL'){var _0x2e1ac1={};_0x2e1ac1[_0x1bc99d[_0x9c4e('0x2d')]]={'$like':'%'+_0x47b56b[_0x9c4e('0x37')][_0x9c4e('0x40')]+'%'};return _0x2e1ac1;}})});}_0x5f35f6=_[_0x9c4e('0x41')]({},_0x5f35f6,_0x47b56b[_0x9c4e('0x42')]);var _0x37af31={'where':_0x5f35f6[_0x9c4e('0x3f')]};return db['Team']['count'](_0x37af31)[_0x9c4e('0x43')](function(_0x4b53c8){_0x2c5645[_0x9c4e('0x22')]=_0x4b53c8;if(_0x47b56b[_0x9c4e('0x37')][_0x9c4e('0x44')]){_0x5f35f6[_0x9c4e('0x45')]=[{'all':!![]}];}return db[_0x9c4e('0x31')][_0x9c4e('0x46')](_0x5f35f6);})[_0x9c4e('0x43')](function(_0x502a09){_0x2c5645[_0x9c4e('0x47')]=_0x502a09;return _0x2c5645;})[_0x9c4e('0x43')](respondWithFilteredResult(_0x46fd6f,_0x5f35f6))[_0x9c4e('0x48')](handleError(_0x46fd6f,null));};exports[_0x9c4e('0x49')]=function(_0x257464,_0x200bd1){var _0xcd214b={'raw':![],'where':{'id':_0x257464[_0x9c4e('0x4a')]['id']}},_0x256aea={};_0x256aea[_0x9c4e('0x36')]=_[_0x9c4e('0x38')](db[_0x9c4e('0x31')]['rawAttributes']);_0x256aea[_0x9c4e('0x37')]=_[_0x9c4e('0x38')](_0x257464['query']);_0x256aea[_0x9c4e('0x39')]=_[_0x9c4e('0x3a')](_0x256aea[_0x9c4e('0x36')],_0x256aea[_0x9c4e('0x37')]);_0xcd214b[_0x9c4e('0x3b')]=_[_0x9c4e('0x3a')](_0x256aea['model'],qs[_0x9c4e('0x3c')](_0x257464['query']['fields']));_0xcd214b[_0x9c4e('0x3b')]=_0xcd214b[_0x9c4e('0x3b')][_0x9c4e('0x4b')]?_0xcd214b['attributes']:_0x256aea['model'];if(_0x257464[_0x9c4e('0x37')]['includeAll']){_0xcd214b['include']=[{'all':!![]}];}_0xcd214b=_[_0x9c4e('0x41')]({},_0xcd214b,_0x257464[_0x9c4e('0x42')]);return db[_0x9c4e('0x31')]['find'](_0xcd214b)[_0x9c4e('0x43')](handleEntityNotFound(_0x200bd1,null))[_0x9c4e('0x43')](respondWithResult(_0x200bd1,null))['catch'](handleError(_0x200bd1,null));};exports[_0x9c4e('0x4c')]=function(_0x4b08c6,_0x245ccf){return db[_0x9c4e('0x31')][_0x9c4e('0x4c')](_0x4b08c6[_0x9c4e('0x4d')],{})[_0x9c4e('0x43')](function(_0x5b9b9c){var _0x9f8bec=_0x4b08c6['user'][_0x9c4e('0x4e')]({'plain':!![]});if(!_0x9f8bec)throw new Error(_0x9c4e('0x4f'));if(_0x9f8bec[_0x9c4e('0x50')]===_0x9c4e('0x51')){var _0x58e7fb=_0x5b9b9c['get']({'plain':!![]});var _0x32f0ef=_0x9c4e('0x52');return db[_0x9c4e('0x53')][_0x9c4e('0x54')]({'where':{'name':_0x32f0ef,'userProfileId':_0x9f8bec['userProfileId']},'raw':!![]})[_0x9c4e('0x43')](function(_0x4db4a5){if(_0x4db4a5&&_0x4db4a5[_0x9c4e('0x55')]===0x0){return db[_0x9c4e('0x56')][_0x9c4e('0x4c')]({'name':_0x58e7fb[_0x9c4e('0x2d')],'resourceId':_0x58e7fb['id'],'type':_0x4db4a5[_0x9c4e('0x2d')],'sectionId':_0x4db4a5['id']},{})[_0x9c4e('0x43')](function(){return _0x5b9b9c;});}else{return _0x5b9b9c;}})[_0x9c4e('0x48')](function(_0x540d5){logger['error'](_0x9c4e('0x57'),_0x540d5);throw _0x540d5;});}return _0x5b9b9c;})[_0x9c4e('0x43')](respondWithResult(_0x245ccf,0xc9))[_0x9c4e('0x48')](handleError(_0x245ccf,null));};exports['update']=function(_0x3c3a8d,_0xe07bf9){if(_0x3c3a8d[_0x9c4e('0x4d')]['id']){delete _0x3c3a8d[_0x9c4e('0x4d')]['id'];}return db[_0x9c4e('0x31')]['find']({'where':{'id':_0x3c3a8d[_0x9c4e('0x4a')]['id']}})[_0x9c4e('0x43')](handleEntityNotFound(_0xe07bf9,null))[_0x9c4e('0x43')](saveUpdates(_0x3c3a8d[_0x9c4e('0x4d')],null))[_0x9c4e('0x43')](respondWithResult(_0xe07bf9,null))[_0x9c4e('0x48')](handleError(_0xe07bf9,null));};exports[_0x9c4e('0x58')]=function(_0x261b23,_0x27d654){var _0x47d534=_0x261b23[_0x9c4e('0x4a')]['id'];var _0x2632d1=[];return db['sequelize']['transaction'](function(_0x1a0229){var _0x4c099e=_0x9c4e('0x59')+_0x47d534;return db[_0x9c4e('0x5a')]['query'](_0x4c099e,{'type':db[_0x9c4e('0x5b')][_0x9c4e('0x5c')][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229})['then'](function(_0x6228e7){_0x2632d1=_[_0x9c4e('0x30')](_0x6228e7,function(_0x1d172c){return Number(_0x1d172c[_0x9c4e('0x5e')]);});})[_0x9c4e('0x43')](function(){var _0xc90305=_0x9c4e('0x5f')+_0x47d534;return db[_0x9c4e('0x5a')][_0x9c4e('0x37')](_0xc90305,{'type':db['Sequelize']['QueryTypes'][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(_0x5039bb){var _0x16e23b=_[_0x9c4e('0x30')](_0x5039bb,function(_0x41d73d){return Number(_0x41d73d[_0x9c4e('0x60')]);});return db[_0x9c4e('0x61')][_0x9c4e('0x58')]({'where':{'UserId':{'$in':_0x2632d1},'VoiceQueueId':{'$in':_0x16e23b}},'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(){var _0x39f2f0=_0x9c4e('0x62')+_0x47d534;return db[_0x9c4e('0x5a')]['query'](_0x39f2f0,{'type':db[_0x9c4e('0x5b')][_0x9c4e('0x5c')][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(_0x1fb204){var _0x4cc636=_[_0x9c4e('0x30')](_0x1fb204,function(_0x1dae45){return Number(_0x1dae45[_0x9c4e('0x63')]);});return db[_0x9c4e('0x64')][_0x9c4e('0x58')]({'where':{'UserId':{'$in':_0x2632d1},'MailQueueId':{'$in':_0x4cc636}},'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(){var _0x23b97a=_0x9c4e('0x65')+_0x47d534;return db[_0x9c4e('0x5a')]['query'](_0x23b97a,{'type':db[_0x9c4e('0x5b')]['QueryTypes'][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(_0x2681cd){var _0x1c8b04=_[_0x9c4e('0x30')](_0x2681cd,function(_0x3ad560){return Number(_0x3ad560[_0x9c4e('0x66')]);});return db[_0x9c4e('0x67')][_0x9c4e('0x58')]({'where':{'UserId':{'$in':_0x2632d1},'SmsQueueId':{'$in':_0x1c8b04}},'transaction':_0x1a0229});})['then'](function(){var _0x3d583d=_0x9c4e('0x68')+_0x47d534;return db[_0x9c4e('0x5a')][_0x9c4e('0x37')](_0x3d583d,{'type':db[_0x9c4e('0x5b')]['QueryTypes'][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229});})['then'](function(_0x5a3806){var _0x53cc29=_[_0x9c4e('0x30')](_0x5a3806,function(_0x51aaf6){return Number(_0x51aaf6[_0x9c4e('0x69')]);});return db[_0x9c4e('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x2632d1},'ChatQueueId':{'$in':_0x53cc29}},'transaction':_0x1a0229});})['then'](function(){var _0x12aa61=_0x9c4e('0x6b')+_0x47d534;return db[_0x9c4e('0x5a')]['query'](_0x12aa61,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(_0x2228a6){var _0x3321bb=_[_0x9c4e('0x30')](_0x2228a6,function(_0x160114){return Number(_0x160114[_0x9c4e('0x6c')]);});return db[_0x9c4e('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x2632d1},'FaxQueueId':{'$in':_0x3321bb}},'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(){var _0x2e771b=_0x9c4e('0x6e')+_0x47d534;return db[_0x9c4e('0x5a')][_0x9c4e('0x37')](_0x2e771b,{'type':db[_0x9c4e('0x5b')]['QueryTypes'][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229});})['then'](function(_0x5bbcc){var _0x53d235=_['map'](_0x5bbcc,function(_0x51cb2c){return Number(_0x51cb2c[_0x9c4e('0x6f')]);});return db[_0x9c4e('0x70')]['destroy']({'where':{'UserId':{'$in':_0x2632d1},'OpenchannelQueueId':{'$in':_0x53d235}},'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(){var _0x23888d=_0x9c4e('0x71')+_0x47d534;return db[_0x9c4e('0x5a')][_0x9c4e('0x37')](_0x23888d,{'type':db[_0x9c4e('0x5b')]['QueryTypes'][_0x9c4e('0x5d')],'raw':!![],'transaction':_0x1a0229});})['then'](function(_0x20a6ee){var _0x27cd08=_['map'](_0x20a6ee,function(_0x223f57){return Number(_0x223f57[_0x9c4e('0x72')]);});return db[_0x9c4e('0x73')][_0x9c4e('0x58')]({'where':{'UserId':{'$in':_0x2632d1},'WhatsappQueueId':{'$in':_0x27cd08}},'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x47d534}});})[_0x9c4e('0x43')](function(_0x265d5f){if(_0x265d5f===null){return;}return db[_0x9c4e('0x74')][_0x9c4e('0x58')]({'where':{'UserId':{'$in':_0x2632d1},'VoicePrefixId':_0x265d5f['VoicePrefixId']},'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(){return db[_0x9c4e('0x31')][_0x9c4e('0x58')]({'where':{'id':_0x47d534},'cascade':!![],'transaction':_0x1a0229});})[_0x9c4e('0x43')](function(_0x7935fb){if(_0x7935fb===0x0){_0x27d654[_0x9c4e('0x2a')](0x194);}else{return db[_0x9c4e('0x56')][_0x9c4e('0x58')]({'where':{'type':_0x9c4e('0x52'),'resourceId':_0x47d534},'cascade':!![],'transaction':_0x1a0229})[_0x9c4e('0x43')](function(){_0x27d654[_0x9c4e('0x1d')](0xcc)[_0x9c4e('0x1e')]();});}})[_0x9c4e('0x48')](function(_0x5ec669){_0x27d654[_0x9c4e('0x1d')](0x1f4)[_0x9c4e('0x2e')](_0x5ec669);});});};exports[_0x9c4e('0x75')]=function(_0x197223,_0x552004,_0x431e2b){return db['Team']['findOne']({'where':{'id':_0x197223[_0x9c4e('0x4a')]['id']}})[_0x9c4e('0x43')](handleEntityNotFound(_0x552004,null))['then'](function(_0x2b783e){if(!_0x197223[_0x9c4e('0x37')][_0x9c4e('0x76')]||!utils[_0x9c4e('0x77')](_0x197223[_0x9c4e('0x37')]['channel'])){throw new db['Sequelize'][(_0x9c4e('0x78'))]('Unknown\x20channel');}var _0x374c8c={};var _0x3e3b54={};_0x3e3b54['model']=_[_0x9c4e('0x38')](db[_[_0x9c4e('0x79')](_0x197223[_0x9c4e('0x37')][_0x9c4e('0x76')]['toLowerCase']())+_0x9c4e('0x7a')][_0x9c4e('0x32')]);_0x3e3b54[_0x9c4e('0x37')]=_[_0x9c4e('0x38')](_0x197223[_0x9c4e('0x37')]);_0x3e3b54['filters']=_[_0x9c4e('0x3a')](_0x3e3b54[_0x9c4e('0x36')],_0x3e3b54[_0x9c4e('0x37')]);_0x374c8c['attributes']=_[_0x9c4e('0x3a')](_0x3e3b54['model'],qs[_0x9c4e('0x3c')](_0x197223[_0x9c4e('0x37')]['fields']));_0x374c8c['attributes']=_0x374c8c[_0x9c4e('0x3b')][_0x9c4e('0x4b')]?_0x374c8c[_0x9c4e('0x3b')]:_0x3e3b54[_0x9c4e('0x36')];_0x374c8c['limit']=qs[_0x9c4e('0x21')](_0x197223[_0x9c4e('0x37')]['limit']);_0x374c8c[_0x9c4e('0x23')]=qs[_0x9c4e('0x23')](_0x197223[_0x9c4e('0x37')]['offset']);_0x374c8c[_0x9c4e('0x3d')]=qs[_0x9c4e('0x3e')](_0x197223[_0x9c4e('0x37')]['sort']);_0x374c8c[_0x9c4e('0x3f')]=qs['filters'](_[_0x9c4e('0x7b')](_0x197223[_0x9c4e('0x37')],_0x3e3b54['filters']));_0x374c8c=_[_0x9c4e('0x41')]({},_0x374c8c,_0x197223[_0x9c4e('0x42')]);return _0x2b783e[_0x9c4e('0x4e')+_['capitalize'](_0x197223['query'][_0x9c4e('0x76')][_0x9c4e('0x7c')]())+_0x9c4e('0x7d')](_0x374c8c);})['then'](respondWithResult(_0x552004,null))[_0x9c4e('0x48')](handleError(_0x552004,null));};exports[_0x9c4e('0x7e')]=function(_0x1543f1,_0x3f8d74,_0x55a733){return db['Team'][_0x9c4e('0x7f')]({'where':{'id':_0x1543f1[_0x9c4e('0x4a')]['id']}})[_0x9c4e('0x43')](function(_0x14826a){if(_0x14826a){if(!_0x1543f1[_0x9c4e('0x4d')][_0x9c4e('0x76')]||!utils[_0x9c4e('0x77')](_0x1543f1[_0x9c4e('0x4d')][_0x9c4e('0x76')])){throw new db[(_0x9c4e('0x5b'))][(_0x9c4e('0x78'))](_0x9c4e('0x80'));}return _0x14826a['add'+_[_0x9c4e('0x79')](_0x1543f1['body'][_0x9c4e('0x76')][_0x9c4e('0x7c')]())+_0x9c4e('0x7d')](_0x1543f1[_0x9c4e('0x4d')][_0x9c4e('0x81')]);}return null;})[_0x9c4e('0x43')](handleEntityNotFound(_0x3f8d74,null))[_0x9c4e('0x43')](respondWithStatusCode(_0x3f8d74,null))[_0x9c4e('0x48')](handleError(_0x3f8d74,null));};exports[_0x9c4e('0x82')]=function(_0x487988,_0x4bef04,_0x4d4170){return db['Team'][_0x9c4e('0x7f')]({'where':{'id':_0x487988['params']['id']}})[_0x9c4e('0x43')](function(_0x4cbdfa){if(_0x4cbdfa){if(!_0x487988[_0x9c4e('0x37')][_0x9c4e('0x76')]||!utils[_0x9c4e('0x77')](_0x487988[_0x9c4e('0x37')][_0x9c4e('0x76')])){throw new db['Sequelize'][(_0x9c4e('0x78'))](_0x9c4e('0x80'));}return _0x4cbdfa[_0x9c4e('0x83')+_[_0x9c4e('0x79')](_0x487988['query'][_0x9c4e('0x76')][_0x9c4e('0x7c')]())+_0x9c4e('0x7d')](_0x487988[_0x9c4e('0x37')]['ids']);}return null;})[_0x9c4e('0x43')](handleEntityNotFound(_0x4bef04,null))[_0x9c4e('0x43')](respondWithStatusCode(_0x4bef04,null))[_0x9c4e('0x48')](handleError(_0x4bef04,null));};exports[_0x9c4e('0x84')]=function(_0x224e8d,_0x37524f){var _0x21cbcd=_['isArray'](_0x224e8d['body'][_0x9c4e('0x81')])?_0x224e8d['body']['ids']:[_0x224e8d['body'][_0x9c4e('0x81')]];var _0x501f73=_0x224e8d['params']['id'];return db[_0x9c4e('0x31')][_0x9c4e('0x54')]({'where':{'id':_0x501f73}})['then'](handleEntityNotFound(_0x37524f,null))[_0x9c4e('0x43')](function(_0x368768){if(_0x368768){var _0x510c41=[_0x9c4e('0x85'),'Chat',_0x9c4e('0x86'),_0x9c4e('0x87'),_0x9c4e('0x88'),_0x9c4e('0x89'),_0x9c4e('0x8a')];return db[_0x9c4e('0x5a')][_0x9c4e('0x8b')](function(_0xa8771){var _0x244ff0=_[_0x9c4e('0x30')](_0x510c41,function(_0x29eb73){var _0x2739ac={'attributes':['id',_0x9c4e('0x2d')]};if(_0x29eb73===_0x9c4e('0x85')){_0x2739ac[_0x9c4e('0x8c')]={'attributes':[_0x9c4e('0x8d')]};}return _0x368768[_0x9c4e('0x4e')+_0x29eb73+_0x9c4e('0x7d')](_0x2739ac)['then'](function(_0x5427c7){var _0x487d3e=_[_0x9c4e('0x30')](_0x5427c7,function(_0x4f7330){var _0xa3a39=_['map'](_0x21cbcd,function(_0x40d861){var _0x40f4ae={'where':{'UserId':_0x40d861,[_0x29eb73+_0x9c4e('0x8e')]:_0x4f7330['id']},'transaction':_0xa8771};if(_0x29eb73===_0x9c4e('0x85')){_0x40f4ae[_0x9c4e('0x8f')]={'penalty':_0x4f7330[_0x9c4e('0x90')][_0x9c4e('0x8d')]};}return db[_0x9c4e('0x91')+_0x29eb73+_0x9c4e('0x7a')]['findOrCreate'](_0x40f4ae)[_0x9c4e('0x43')](function(){socket[_0x9c4e('0x92')](_0x9c4e('0x51')+_0x29eb73+_0x9c4e('0x93'),{'UserId':_0x40d861,[_0x29eb73+'QueueId']:_0x4f7330['id']});if(_0x29eb73!==_0x9c4e('0x85')){return;}return db[_0x9c4e('0x91')][_0x9c4e('0x46')]({'where':{'id':_0x21cbcd,'online':0x1},'attributes':['id',_0x9c4e('0x2d'),_0x9c4e('0x94'),_0x9c4e('0x95'),_0x9c4e('0x96')],'raw':!![]})[_0x9c4e('0x43')](function(_0x3bab12){var _0x591935=_[_0x9c4e('0x30')](_0x3bab12,function(_0x3408ec){return db[_0x9c4e('0x97')][_0x9c4e('0x98')]({'membername':_0x3408ec[_0x9c4e('0x2d')],'UserId':_0x3408ec['id'],'queue_name':_0x4f7330['name'],'VoiceQueueId':_0x4f7330['id'],'interface':_[_0x9c4e('0x99')](_0x3408ec[_0x9c4e('0x96')])?util[_0x9c4e('0x9a')](_0x9c4e('0x9b'),_0x3408ec['name']):_0x3408ec[_0x9c4e('0x96')],'paused':_0x3408ec[_0x9c4e('0x95')]||![],'penalty':_0x4f7330[_0x9c4e('0x90')][_0x9c4e('0x8d')]},{'transaction':_0xa8771});});return Promise[_0x9c4e('0x9c')](_0x591935);});});});return Promise[_0x9c4e('0x9c')](_0xa3a39);});return Promise['all'](_0x487d3e);})['then'](function(){return db[_0x9c4e('0x9d')][_0x9c4e('0x7f')]({'where':{'teamId':_0x501f73}})['then'](function(_0x2bfb6c){if(_0x2bfb6c){var _0x48db5c=_[_0x9c4e('0x30')](_0x21cbcd,function(_0x157266){db['UserVoicePrefix'][_0x9c4e('0x98')]({'UserId':_0x157266,'VoicePrefixId':_0x2bfb6c['VoicePrefixId']});});return Promise[_0x9c4e('0x9c')](_0x48db5c);}});});});return Promise['all'](_0x244ff0)[_0x9c4e('0x43')](function(){return _0x368768[_0x9c4e('0x84')](_0x21cbcd,{'transaction':_0xa8771})[_0x9c4e('0x9e')](function(_0x3c8056){return _0x3c8056;});});});}})[_0x9c4e('0x43')](respondWithResult(_0x37524f,null))[_0x9c4e('0x48')](handleError(_0x37524f,null));};exports['removeAgents']=function(_0x299486,_0x2d0a06){var _0xbc3f20=_['isArray'](_0x299486[_0x9c4e('0x37')]['ids'])?_0x299486[_0x9c4e('0x37')]['ids']:[_0x299486[_0x9c4e('0x37')][_0x9c4e('0x81')]];var _0x306642=_0x299486[_0x9c4e('0x4a')]['id'];return db[_0x9c4e('0x31')][_0x9c4e('0x54')]({'where':{'id':_0x306642}})[_0x9c4e('0x43')](handleEntityNotFound(_0x2d0a06,null))[_0x9c4e('0x43')](function(_0x273334){if(_0x273334){var _0x313d90=['Voice',_0x9c4e('0x9f'),'Mail',_0x9c4e('0x87'),_0x9c4e('0x88'),'Openchannel',_0x9c4e('0x8a')];return db[_0x9c4e('0x5a')]['transaction'](function(_0x18e75d){var _0x3e785b=_[_0x9c4e('0x30')](_0x313d90,function(_0x531b23){var _0xdb5295={'attributes':['id',_0x9c4e('0x2d')]};return _0x273334[_0x9c4e('0x4e')+_0x531b23+_0x9c4e('0x7d')](_0xdb5295)['then'](function(_0x3b79e0){var _0x5de998=_['map'](_0x3b79e0,function(_0x2f256a){return _0x2f256a[_0x9c4e('0xa0')](_0xbc3f20,{'transaction':_0x18e75d})[_0x9c4e('0x43')](function(){var _0x5bf53c=_['map'](_0xbc3f20,function(_0x3f133c){socket[_0x9c4e('0x92')](_0x9c4e('0x51')+_0x531b23+'Queue:remove',{'UserId':Number(_0x3f133c),[_0x531b23+_0x9c4e('0x8e')]:_0x2f256a['id']});if(_0x531b23!==_0x9c4e('0x85')){return;}return db[_0x9c4e('0x97')][_0x9c4e('0x58')]({'where':{'VoiceQueueId':_0x2f256a['id'],'UserId':_0x3f133c},'transaction':_0x18e75d});});return Promise[_0x9c4e('0x9c')](_0x5bf53c);});});return Promise[_0x9c4e('0x9c')](_0x5de998);});});return Promise[_0x9c4e('0x9c')](_0x3e785b)[_0x9c4e('0x43')](function(){return _0x273334[_0x9c4e('0xa0')](_0xbc3f20,{'transaction':_0x18e75d});})[_0x9c4e('0x43')](function(){return db[_0x9c4e('0x9d')][_0x9c4e('0x7f')]({'where':{'teamId':_0x306642}})['then'](function(_0x15421a){if(_0x15421a){var _0x2e7a88=_['map'](_0xbc3f20,function(_0x58ca91){db[_0x9c4e('0x74')][_0x9c4e('0x58')]({'where':{'UserId':_0x58ca91,'VoicePrefixId':_0x15421a['VoicePrefixId']}});});return Promise['all'](_0x2e7a88);}});});});}})[_0x9c4e('0x43')](respondWithStatusCode(_0x2d0a06,null))['catch'](handleError(_0x2d0a06,null));};exports['getAgents']=function(_0xb6e31d,_0x7b04fa,_0x55c378){var _0x4fe7bd={};var _0x2dcb05={};var _0x29b146;var _0x25c30a;return db[_0x9c4e('0x31')][_0x9c4e('0x7f')]({'where':{'id':_0xb6e31d[_0x9c4e('0x4a')]['id']}})[_0x9c4e('0x43')](handleEntityNotFound(_0x7b04fa,null))[_0x9c4e('0x43')](function(_0x43d13a){if(_0x43d13a){_0x29b146=_0x43d13a;_0x2dcb05[_0x9c4e('0x36')]=_[_0x9c4e('0x38')](db[_0x9c4e('0x91')][_0x9c4e('0x32')]);_0x2dcb05[_0x9c4e('0x37')]=_[_0x9c4e('0x38')](_0xb6e31d['query']);_0x2dcb05[_0x9c4e('0x39')]=_['intersection'](_0x2dcb05[_0x9c4e('0x36')],_0x2dcb05[_0x9c4e('0x37')]);_0x4fe7bd['attributes']=_[_0x9c4e('0x3a')](_0x2dcb05['model'],qs[_0x9c4e('0x3c')](_0xb6e31d['query'][_0x9c4e('0x3c')]));_0x4fe7bd[_0x9c4e('0x3b')]=_0x4fe7bd['attributes'][_0x9c4e('0x4b')]?_0x4fe7bd['attributes']:_0x2dcb05[_0x9c4e('0x36')];_0x4fe7bd[_0x9c4e('0x3d')]=qs[_0x9c4e('0x3e')](_0xb6e31d['query'][_0x9c4e('0x3e')]);_0x4fe7bd[_0x9c4e('0x3f')]=qs[_0x9c4e('0x39')](_[_0x9c4e('0x7b')](_0xb6e31d[_0x9c4e('0x37')],_0x2dcb05[_0x9c4e('0x39')]));if(_0xb6e31d[_0x9c4e('0x37')]['filter']){_0x4fe7bd[_0x9c4e('0x3f')]=_[_0x9c4e('0x41')](_0x4fe7bd['where'],{'$or':_['map'](_0x4fe7bd['attributes'],function(_0x2f913f){var _0x7d9de9={};_0x7d9de9[_0x2f913f]={'$like':'%'+_0xb6e31d[_0x9c4e('0x37')]['filter']+'%'};return _0x7d9de9;})});}_0x4fe7bd=_[_0x9c4e('0x41')]({},_0x4fe7bd,_0xb6e31d[_0x9c4e('0x42')]);return _0x29b146[_0x9c4e('0xa1')](_0x4fe7bd);}})[_0x9c4e('0x43')](function(_0x12c581){if(_0x12c581){_0x25c30a=_0x12c581['length'];if(!_0xb6e31d[_0x9c4e('0x37')][_0x9c4e('0xa2')](_0x9c4e('0xa3'))){_0x4fe7bd[_0x9c4e('0x21')]=qs['limit'](_0xb6e31d[_0x9c4e('0x37')][_0x9c4e('0x21')]);_0x4fe7bd['offset']=qs[_0x9c4e('0x23')](_0xb6e31d['query'][_0x9c4e('0x23')]);}return _0x29b146[_0x9c4e('0xa1')](_0x4fe7bd);}})[_0x9c4e('0x43')](function(_0x429581){if(_0x429581){return _0x429581?{'count':_0x25c30a,'rows':_0x429581}:null;}})[_0x9c4e('0x43')](respondWithResult(_0x7b04fa,null))[_0x9c4e('0x48')](handleError(_0x7b04fa,null));}; \ No newline at end of file +var _0x1e70=['../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','update','then','error','name','send','index','Team','rawAttributes','fieldName','type','key','model','map','keys','attributes','intersection','fields','query','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','sequelize','transaction','Sequelize','QueryTypes','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','getQueues','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','length','Queues','addQueues','findOne','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Openchannel','through','QueueId','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','User','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','isArray','Sms','Fax','Queue:remove','getAgents','hasOwnProperty','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1205b1,_0x335c3d){var _0x45374c=function(_0x4966a3){while(--_0x4966a3){_0x1205b1['push'](_0x1205b1['shift']());}};_0x45374c(++_0x335c3d);}(_0x1e70,0x123));var _0x01e7=function(_0x293455,_0x40a5df){_0x293455=_0x293455-0x0;var _0x176b8c=_0x1e70[_0x293455];return _0x176b8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01e7('0x1'));var rp=require(_0x01e7('0x2'));var moment=require(_0x01e7('0x3'));var BPromise=require(_0x01e7('0x4'));var Mustache=require(_0x01e7('0x5'));var util=require(_0x01e7('0x6'));var path=require('path');var sox=require(_0x01e7('0x7'));var csv=require(_0x01e7('0x8'));var ejs=require(_0x01e7('0x9'));var fs=require('fs');var fs_extra=require(_0x01e7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x01e7('0xb'));var jsforce=require(_0x01e7('0xc'));var deskjs=require(_0x01e7('0xd'));var toCsv=require(_0x01e7('0x8'));var querystring=require(_0x01e7('0xe'));var Papa=require(_0x01e7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x01e7('0x10'));var as=require(_0x01e7('0x11'));var hardwareService=require(_0x01e7('0x12'));var logger=require('../../config/logger')(_0x01e7('0x13'));var utils=require(_0x01e7('0x14'));var config=require(_0x01e7('0x15'));var licenseUtil=require(_0x01e7('0x16'));var db=require(_0x01e7('0x17'))['db'];config[_0x01e7('0x18')]=_[_0x01e7('0x19')](config[_0x01e7('0x18')],{'host':_0x01e7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x01e7('0x1b'))[_0x01e7('0x1c')](socket);function respondWithStatusCode(_0x123a5b,_0x44d5bc){_0x44d5bc=_0x44d5bc||0xcc;return function(_0x4e8436){if(_0x4e8436){return _0x123a5b[_0x01e7('0x1d')](_0x44d5bc);}return _0x123a5b['status'](_0x44d5bc)[_0x01e7('0x1e')]();};}function respondWithResult(_0x389733,_0xc2d9b3){_0xc2d9b3=_0xc2d9b3||0xc8;return function(_0x90b37a){if(_0x90b37a){return _0x389733[_0x01e7('0x1f')](_0xc2d9b3)['json'](_0x90b37a);}};}function respondWithFilteredResult(_0x50841c,_0x541009){return function(_0x393a39){if(_0x393a39){var _0x521bdc=typeof _0x541009['offset']==='undefined'&&typeof _0x541009[_0x01e7('0x20')]==='undefined';var _0x35ea27=_0x393a39[_0x01e7('0x21')];var _0x4df3cf=_0x521bdc?0x0:_0x541009[_0x01e7('0x22')];var _0x5bfb14=_0x521bdc?_0x393a39[_0x01e7('0x21')]:_0x541009['offset']+_0x541009[_0x01e7('0x20')];var _0x1506c5;if(_0x5bfb14>=_0x35ea27){_0x5bfb14=_0x35ea27;_0x1506c5=0xc8;}else{_0x1506c5=0xce;}_0x50841c[_0x01e7('0x1f')](_0x1506c5);return _0x50841c[_0x01e7('0x23')](_0x01e7('0x24'),_0x4df3cf+'-'+_0x5bfb14+'/'+_0x35ea27)[_0x01e7('0x25')](_0x393a39);}return null;};}function patchUpdates(_0x3dfe9e){return function(_0x450852){try{jsonpatch[_0x01e7('0x26')](_0x450852,_0x3dfe9e,!![]);}catch(_0x20b118){return BPromise['reject'](_0x20b118);}return _0x450852['save']();};}function saveUpdates(_0x16efe9,_0x4220dd){return function(_0x307760){if(_0x307760){return _0x307760[_0x01e7('0x27')](_0x16efe9)[_0x01e7('0x28')](function(_0x2f1b56){return _0x2f1b56;});}return null;};}function handleEntityNotFound(_0x29d834,_0x476d86){return function(_0x57f7ef){if(!_0x57f7ef){_0x29d834[_0x01e7('0x1d')](0x194);}return _0x57f7ef;};}function handleError(_0x48a72e,_0xf87c7){_0xf87c7=_0xf87c7||0x1f4;return function(_0x1b7da5){logger[_0x01e7('0x29')](_0x1b7da5['stack']);if(_0x1b7da5['name']){delete _0x1b7da5[_0x01e7('0x2a')];}_0x48a72e[_0x01e7('0x1f')](_0xf87c7)[_0x01e7('0x2b')](_0x1b7da5);};}exports[_0x01e7('0x2c')]=function(_0x1fdef1,_0x1d7cd2){var _0x262bb7={},_0x554f7f={},_0x52ba18={'count':0x0,'rows':[]};var _0x3b1de4=_['map'](db[_0x01e7('0x2d')][_0x01e7('0x2e')],function(_0x2a8e58){return{'name':_0x2a8e58[_0x01e7('0x2f')],'type':_0x2a8e58[_0x01e7('0x30')][_0x01e7('0x31')]};});_0x554f7f[_0x01e7('0x32')]=_[_0x01e7('0x33')](_0x3b1de4,_0x01e7('0x2a'));_0x554f7f['query']=_[_0x01e7('0x34')](_0x1fdef1['query']);_0x554f7f['filters']=_['intersection'](_0x554f7f['model'],_0x554f7f['query']);_0x262bb7[_0x01e7('0x35')]=_[_0x01e7('0x36')](_0x554f7f[_0x01e7('0x32')],qs[_0x01e7('0x37')](_0x1fdef1[_0x01e7('0x38')][_0x01e7('0x37')]));_0x262bb7['attributes']=_0x262bb7[_0x01e7('0x35')]['length']?_0x262bb7[_0x01e7('0x35')]:_0x554f7f[_0x01e7('0x32')];if(!_0x1fdef1[_0x01e7('0x38')]['hasOwnProperty'](_0x01e7('0x39'))){_0x262bb7[_0x01e7('0x20')]=qs[_0x01e7('0x20')](_0x1fdef1['query']['limit']);_0x262bb7[_0x01e7('0x22')]=qs[_0x01e7('0x22')](_0x1fdef1[_0x01e7('0x38')][_0x01e7('0x22')]);}_0x262bb7[_0x01e7('0x3a')]=qs['sort'](_0x1fdef1[_0x01e7('0x38')][_0x01e7('0x3b')]);_0x262bb7[_0x01e7('0x3c')]=qs[_0x01e7('0x3d')](_[_0x01e7('0x3e')](_0x1fdef1['query'],_0x554f7f['filters']),_0x3b1de4);if(_0x1fdef1[_0x01e7('0x38')][_0x01e7('0x3f')]){_0x262bb7['where']=_[_0x01e7('0x40')](_0x262bb7[_0x01e7('0x3c')],{'$or':_[_0x01e7('0x33')](_0x3b1de4,function(_0x4e9102){if(_0x4e9102[_0x01e7('0x30')]!==_0x01e7('0x41')){var _0x3e4d86={};_0x3e4d86[_0x4e9102['name']]={'$like':'%'+_0x1fdef1[_0x01e7('0x38')][_0x01e7('0x3f')]+'%'};return _0x3e4d86;}})});}_0x262bb7=_['merge']({},_0x262bb7,_0x1fdef1[_0x01e7('0x42')]);var _0x38fba7={'where':_0x262bb7[_0x01e7('0x3c')]};return db[_0x01e7('0x2d')][_0x01e7('0x21')](_0x38fba7)[_0x01e7('0x28')](function(_0x1fb153){_0x52ba18[_0x01e7('0x21')]=_0x1fb153;if(_0x1fdef1[_0x01e7('0x38')][_0x01e7('0x43')]){_0x262bb7['include']=[{'all':!![]}];}return db[_0x01e7('0x2d')]['findAll'](_0x262bb7);})[_0x01e7('0x28')](function(_0x3c01e4){_0x52ba18[_0x01e7('0x44')]=_0x3c01e4;return _0x52ba18;})[_0x01e7('0x28')](respondWithFilteredResult(_0x1d7cd2,_0x262bb7))[_0x01e7('0x45')](handleError(_0x1d7cd2,null));};exports[_0x01e7('0x46')]=function(_0x12e87a,_0x4573e3){var _0x2346f6={'raw':![],'where':{'id':_0x12e87a['params']['id']}},_0x1c6d83={};_0x1c6d83[_0x01e7('0x32')]=_[_0x01e7('0x34')](db['Team'][_0x01e7('0x2e')]);_0x1c6d83[_0x01e7('0x38')]=_[_0x01e7('0x34')](_0x12e87a[_0x01e7('0x38')]);_0x1c6d83[_0x01e7('0x3d')]=_[_0x01e7('0x36')](_0x1c6d83[_0x01e7('0x32')],_0x1c6d83[_0x01e7('0x38')]);_0x2346f6[_0x01e7('0x35')]=_['intersection'](_0x1c6d83['model'],qs[_0x01e7('0x37')](_0x12e87a[_0x01e7('0x38')][_0x01e7('0x37')]));_0x2346f6[_0x01e7('0x35')]=_0x2346f6[_0x01e7('0x35')]['length']?_0x2346f6[_0x01e7('0x35')]:_0x1c6d83[_0x01e7('0x32')];if(_0x12e87a['query']['includeAll']){_0x2346f6[_0x01e7('0x47')]=[{'all':!![]}];}_0x2346f6=_[_0x01e7('0x40')]({},_0x2346f6,_0x12e87a[_0x01e7('0x42')]);return db[_0x01e7('0x2d')]['find'](_0x2346f6)[_0x01e7('0x28')](handleEntityNotFound(_0x4573e3,null))[_0x01e7('0x28')](respondWithResult(_0x4573e3,null))['catch'](handleError(_0x4573e3,null));};exports[_0x01e7('0x48')]=function(_0x12e7a4,_0x27db14){return db[_0x01e7('0x2d')][_0x01e7('0x48')](_0x12e7a4['body'],{})[_0x01e7('0x28')](function(_0x339c57){var _0x4aaeee=_0x12e7a4[_0x01e7('0x49')][_0x01e7('0x4a')]({'plain':!![]});if(!_0x4aaeee)throw new Error(_0x01e7('0x4b'));if(_0x4aaeee[_0x01e7('0x4c')]===_0x01e7('0x49')){var _0x33bf3e=_0x339c57[_0x01e7('0x4a')]({'plain':!![]});var _0x4d8c55=_0x01e7('0x4d');return db['UserProfileSection'][_0x01e7('0x4e')]({'where':{'name':_0x4d8c55,'userProfileId':_0x4aaeee[_0x01e7('0x4f')]},'raw':!![]})[_0x01e7('0x28')](function(_0x1459db){if(_0x1459db&&_0x1459db[_0x01e7('0x50')]===0x0){return db[_0x01e7('0x51')][_0x01e7('0x48')]({'name':_0x33bf3e[_0x01e7('0x2a')],'resourceId':_0x33bf3e['id'],'type':_0x1459db[_0x01e7('0x2a')],'sectionId':_0x1459db['id']},{})[_0x01e7('0x28')](function(){return _0x339c57;});}else{return _0x339c57;}})[_0x01e7('0x45')](function(_0x50d389){logger[_0x01e7('0x29')](_0x01e7('0x52'),_0x50d389);throw _0x50d389;});}return _0x339c57;})[_0x01e7('0x28')](respondWithResult(_0x27db14,0xc9))['catch'](handleError(_0x27db14,null));};exports[_0x01e7('0x27')]=function(_0x5d2b06,_0x1682e9){if(_0x5d2b06['body']['id']){delete _0x5d2b06['body']['id'];}return db[_0x01e7('0x2d')][_0x01e7('0x4e')]({'where':{'id':_0x5d2b06['params']['id']}})[_0x01e7('0x28')](handleEntityNotFound(_0x1682e9,null))[_0x01e7('0x28')](saveUpdates(_0x5d2b06[_0x01e7('0x53')],null))[_0x01e7('0x28')](respondWithResult(_0x1682e9,null))['catch'](handleError(_0x1682e9,null));};exports[_0x01e7('0x54')]=function(_0x5da8e0,_0x4ae877){var _0x5dcf82=_0x5da8e0[_0x01e7('0x55')]['id'];var _0x3de8da=[];return db[_0x01e7('0x56')][_0x01e7('0x57')](function(_0x38143b){var _0x1a62f4='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x5dcf82;return db[_0x01e7('0x56')][_0x01e7('0x38')](_0x1a62f4,{'type':db[_0x01e7('0x58')][_0x01e7('0x59')]['SELECT'],'raw':!![],'transaction':_0x38143b})[_0x01e7('0x28')](function(_0x10a8f3){_0x3de8da=_[_0x01e7('0x33')](_0x10a8f3,function(_0x4972aa){return Number(_0x4972aa['UserId']);});})[_0x01e7('0x28')](function(){var _0x1f1b1a=_0x01e7('0x5a')+_0x5dcf82;return db[_0x01e7('0x56')][_0x01e7('0x38')](_0x1f1b1a,{'type':db[_0x01e7('0x58')][_0x01e7('0x59')][_0x01e7('0x5b')],'raw':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x1c1e77){var _0x4cb50a=_[_0x01e7('0x33')](_0x1c1e77,function(_0x5531f9){return Number(_0x5531f9['VoiceQueueId']);});return db[_0x01e7('0x5c')][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'VoiceQueueId':{'$in':_0x4cb50a}},'transaction':_0x38143b});})[_0x01e7('0x28')](function(){var _0x25ae7c=_0x01e7('0x5d')+_0x5dcf82;return db[_0x01e7('0x56')][_0x01e7('0x38')](_0x25ae7c,{'type':db[_0x01e7('0x58')][_0x01e7('0x59')][_0x01e7('0x5b')],'raw':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x2819e6){var _0x5da905=_[_0x01e7('0x33')](_0x2819e6,function(_0x41dce8){return Number(_0x41dce8[_0x01e7('0x5e')]);});return db[_0x01e7('0x5f')][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'MailQueueId':{'$in':_0x5da905}},'transaction':_0x38143b});})[_0x01e7('0x28')](function(){var _0x2e52cc=_0x01e7('0x60')+_0x5dcf82;return db[_0x01e7('0x56')][_0x01e7('0x38')](_0x2e52cc,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x1151a2){var _0x1070a1=_['map'](_0x1151a2,function(_0x44550d){return Number(_0x44550d[_0x01e7('0x61')]);});return db[_0x01e7('0x62')][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'SmsQueueId':{'$in':_0x1070a1}},'transaction':_0x38143b});})[_0x01e7('0x28')](function(){var _0x34f6c1='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5dcf82;return db[_0x01e7('0x56')][_0x01e7('0x38')](_0x34f6c1,{'type':db['Sequelize'][_0x01e7('0x59')][_0x01e7('0x5b')],'raw':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x7d5708){var _0x1734f3=_['map'](_0x7d5708,function(_0x4108ea){return Number(_0x4108ea[_0x01e7('0x63')]);});return db[_0x01e7('0x64')][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'ChatQueueId':{'$in':_0x1734f3}},'transaction':_0x38143b});})['then'](function(){var _0x5dbfc1=_0x01e7('0x65')+_0x5dcf82;return db[_0x01e7('0x56')][_0x01e7('0x38')](_0x5dbfc1,{'type':db[_0x01e7('0x58')][_0x01e7('0x59')][_0x01e7('0x5b')],'raw':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x1b744d){var _0x49e11f=_['map'](_0x1b744d,function(_0x483285){return Number(_0x483285[_0x01e7('0x66')]);});return db[_0x01e7('0x67')][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'FaxQueueId':{'$in':_0x49e11f}},'transaction':_0x38143b});})['then'](function(){var _0x56291f=_0x01e7('0x68')+_0x5dcf82;return db['sequelize']['query'](_0x56291f,{'type':db['Sequelize'][_0x01e7('0x59')]['SELECT'],'raw':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x4992d1){var _0x4c4382=_['map'](_0x4992d1,function(_0x335ef7){return Number(_0x335ef7[_0x01e7('0x69')]);});return db[_0x01e7('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x3de8da},'OpenchannelQueueId':{'$in':_0x4c4382}},'transaction':_0x38143b});})[_0x01e7('0x28')](function(){var _0x4d5f74=_0x01e7('0x6b')+_0x5dcf82;return db[_0x01e7('0x56')]['query'](_0x4d5f74,{'type':db[_0x01e7('0x58')][_0x01e7('0x59')][_0x01e7('0x5b')],'raw':!![],'transaction':_0x38143b});})['then'](function(_0x56d6d2){var _0x14e8e3=_[_0x01e7('0x33')](_0x56d6d2,function(_0x16a5e0){return Number(_0x16a5e0[_0x01e7('0x6c')]);});return db['UserWhatsappQueue'][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'WhatsappQueueId':{'$in':_0x14e8e3}},'transaction':_0x38143b});})['then'](function(){return db[_0x01e7('0x6d')]['find']({'where':{'TeamId':_0x5dcf82}});})[_0x01e7('0x28')](function(_0x1ab3d5){if(_0x1ab3d5===null){return;}return db[_0x01e7('0x6e')][_0x01e7('0x54')]({'where':{'UserId':{'$in':_0x3de8da},'VoicePrefixId':_0x1ab3d5['VoicePrefixId']},'transaction':_0x38143b});})[_0x01e7('0x28')](function(){return db[_0x01e7('0x2d')]['destroy']({'where':{'id':_0x5dcf82},'cascade':!![],'transaction':_0x38143b});})[_0x01e7('0x28')](function(_0x24309e){if(_0x24309e===0x0){_0x4ae877[_0x01e7('0x1d')](0x194);}else{return db[_0x01e7('0x51')][_0x01e7('0x54')]({'where':{'type':_0x01e7('0x4d'),'resourceId':_0x5dcf82},'cascade':!![],'transaction':_0x38143b})[_0x01e7('0x28')](function(){_0x4ae877['status'](0xcc)[_0x01e7('0x1e')]();});}})['catch'](function(_0x1efa76){_0x4ae877[_0x01e7('0x1f')](0x1f4)[_0x01e7('0x2b')](_0x1efa76);});});};exports[_0x01e7('0x6f')]=function(_0x1cf853,_0x25dcb1,_0x10d8e2){return db[_0x01e7('0x2d')]['findOne']({'where':{'id':_0x1cf853[_0x01e7('0x55')]['id']}})[_0x01e7('0x28')](handleEntityNotFound(_0x25dcb1,null))[_0x01e7('0x28')](function(_0x20a460){if(!_0x1cf853[_0x01e7('0x38')]['channel']||!utils[_0x01e7('0x70')](_0x1cf853[_0x01e7('0x38')][_0x01e7('0x71')])){throw new db['Sequelize'][(_0x01e7('0x72'))](_0x01e7('0x73'));}var _0x64ef29={};var _0x1223ce={};_0x1223ce[_0x01e7('0x32')]=_[_0x01e7('0x34')](db[_[_0x01e7('0x74')](_0x1cf853['query'][_0x01e7('0x71')][_0x01e7('0x75')]())+_0x01e7('0x76')][_0x01e7('0x2e')]);_0x1223ce[_0x01e7('0x38')]=_['keys'](_0x1cf853[_0x01e7('0x38')]);_0x1223ce[_0x01e7('0x3d')]=_[_0x01e7('0x36')](_0x1223ce['model'],_0x1223ce[_0x01e7('0x38')]);_0x64ef29[_0x01e7('0x35')]=_[_0x01e7('0x36')](_0x1223ce[_0x01e7('0x32')],qs[_0x01e7('0x37')](_0x1cf853[_0x01e7('0x38')][_0x01e7('0x37')]));_0x64ef29[_0x01e7('0x35')]=_0x64ef29['attributes'][_0x01e7('0x77')]?_0x64ef29[_0x01e7('0x35')]:_0x1223ce['model'];_0x64ef29[_0x01e7('0x20')]=qs['limit'](_0x1cf853[_0x01e7('0x38')][_0x01e7('0x20')]);_0x64ef29['offset']=qs[_0x01e7('0x22')](_0x1cf853[_0x01e7('0x38')]['offset']);_0x64ef29['order']=qs[_0x01e7('0x3b')](_0x1cf853[_0x01e7('0x38')][_0x01e7('0x3b')]);_0x64ef29[_0x01e7('0x3c')]=qs[_0x01e7('0x3d')](_[_0x01e7('0x3e')](_0x1cf853[_0x01e7('0x38')],_0x1223ce['filters']));_0x64ef29=_['merge']({},_0x64ef29,_0x1cf853['options']);return _0x20a460[_0x01e7('0x4a')+_[_0x01e7('0x74')](_0x1cf853[_0x01e7('0x38')][_0x01e7('0x71')]['toLowerCase']())+_0x01e7('0x78')](_0x64ef29);})[_0x01e7('0x28')](respondWithResult(_0x25dcb1,null))[_0x01e7('0x45')](handleError(_0x25dcb1,null));};exports[_0x01e7('0x79')]=function(_0x588c5c,_0x228c7e,_0x3c8426){return db[_0x01e7('0x2d')][_0x01e7('0x7a')]({'where':{'id':_0x588c5c['params']['id']}})['then'](function(_0x256e9){if(_0x256e9){if(!_0x588c5c[_0x01e7('0x53')][_0x01e7('0x71')]||!utils[_0x01e7('0x70')](_0x588c5c[_0x01e7('0x53')]['channel'])){throw new db[(_0x01e7('0x58'))]['ValidationError'](_0x01e7('0x73'));}return _0x256e9[_0x01e7('0x7b')+_[_0x01e7('0x74')](_0x588c5c[_0x01e7('0x53')][_0x01e7('0x71')]['toLowerCase']())+_0x01e7('0x78')](_0x588c5c[_0x01e7('0x53')][_0x01e7('0x7c')]);}return null;})[_0x01e7('0x28')](handleEntityNotFound(_0x228c7e,null))['then'](respondWithStatusCode(_0x228c7e,null))['catch'](handleError(_0x228c7e,null));};exports[_0x01e7('0x7d')]=function(_0x474cff,_0x10c5b0,_0x442d9d){return db[_0x01e7('0x2d')][_0x01e7('0x7a')]({'where':{'id':_0x474cff['params']['id']}})[_0x01e7('0x28')](function(_0x52c3db){if(_0x52c3db){if(!_0x474cff[_0x01e7('0x38')][_0x01e7('0x71')]||!utils[_0x01e7('0x70')](_0x474cff[_0x01e7('0x38')][_0x01e7('0x71')])){throw new db[(_0x01e7('0x58'))][(_0x01e7('0x72'))](_0x01e7('0x73'));}return _0x52c3db[_0x01e7('0x7e')+_['capitalize'](_0x474cff['query'][_0x01e7('0x71')][_0x01e7('0x75')]())+_0x01e7('0x78')](_0x474cff[_0x01e7('0x38')]['ids']);}return null;})[_0x01e7('0x28')](handleEntityNotFound(_0x10c5b0,null))[_0x01e7('0x28')](respondWithStatusCode(_0x10c5b0,null))[_0x01e7('0x45')](handleError(_0x10c5b0,null));};exports[_0x01e7('0x7f')]=function(_0x1c3034,_0x26ba20){var _0x2de545=_['isArray'](_0x1c3034[_0x01e7('0x53')][_0x01e7('0x7c')])?_0x1c3034[_0x01e7('0x53')][_0x01e7('0x7c')]:[_0x1c3034[_0x01e7('0x53')][_0x01e7('0x7c')]];var _0x4969b1=_0x1c3034[_0x01e7('0x55')]['id'];return db[_0x01e7('0x2d')][_0x01e7('0x4e')]({'where':{'id':_0x4969b1}})['then'](handleEntityNotFound(_0x26ba20,null))[_0x01e7('0x28')](function(_0x3f82f4){if(_0x3f82f4){var _0x2381e4=[_0x01e7('0x80'),_0x01e7('0x81'),_0x01e7('0x82'),'Sms','Fax',_0x01e7('0x83'),'Whatsapp'];return db[_0x01e7('0x56')][_0x01e7('0x57')](function(_0x4b25b7){var _0x1412be=_[_0x01e7('0x33')](_0x2381e4,function(_0x405a8a){var _0x4a0a47={'attributes':['id','name']};if(_0x405a8a===_0x01e7('0x80')){_0x4a0a47[_0x01e7('0x84')]={'attributes':['penalty']};}return _0x3f82f4[_0x01e7('0x4a')+_0x405a8a+_0x01e7('0x78')](_0x4a0a47)['then'](function(_0x14bfa3){var _0x5c5e93=_[_0x01e7('0x33')](_0x14bfa3,function(_0x103d15){var _0x51bbdc=_[_0x01e7('0x33')](_0x2de545,function(_0xe3cc8c){var _0x214659={'where':{'UserId':_0xe3cc8c,[_0x405a8a+_0x01e7('0x85')]:_0x103d15['id']},'transaction':_0x4b25b7};if(_0x405a8a===_0x01e7('0x80')){_0x214659[_0x01e7('0x19')]={'penalty':_0x103d15[_0x01e7('0x86')][_0x01e7('0x87')]};}return db['User'+_0x405a8a+_0x01e7('0x76')][_0x01e7('0x88')](_0x214659)['then'](function(){socket[_0x01e7('0x89')]('user'+_0x405a8a+_0x01e7('0x8a'),{'UserId':_0xe3cc8c,[_0x405a8a+'QueueId']:_0x103d15['id']});if(_0x405a8a!=='Voice'){return;}return db[_0x01e7('0x8b')]['findAll']({'where':{'id':_0x2de545,'online':0x1},'attributes':['id','name',_0x01e7('0x8c'),_0x01e7('0x8d'),_0x01e7('0x8e')],'raw':!![]})[_0x01e7('0x28')](function(_0x42a98d){var _0x46ec96=_[_0x01e7('0x33')](_0x42a98d,function(_0x151f78){return db[_0x01e7('0x8f')][_0x01e7('0x90')]({'membername':_0x151f78[_0x01e7('0x2a')],'UserId':_0x151f78['id'],'queue_name':_0x103d15['name'],'VoiceQueueId':_0x103d15['id'],'interface':_['isNil'](_0x151f78['interface'])?util[_0x01e7('0x91')](_0x01e7('0x92'),_0x151f78['name']):_0x151f78[_0x01e7('0x8e')],'paused':_0x151f78[_0x01e7('0x8d')]||![],'penalty':_0x103d15[_0x01e7('0x86')][_0x01e7('0x87')]},{'transaction':_0x4b25b7});});return Promise[_0x01e7('0x93')](_0x46ec96);});});});return Promise[_0x01e7('0x93')](_0x51bbdc);});return Promise['all'](_0x5c5e93);})[_0x01e7('0x28')](function(){return db[_0x01e7('0x6d')][_0x01e7('0x7a')]({'where':{'teamId':_0x4969b1}})[_0x01e7('0x28')](function(_0x4cae4c){if(_0x4cae4c){var _0x30caaf=_[_0x01e7('0x33')](_0x2de545,function(_0x77dfb2){db['UserVoicePrefix']['upsert']({'UserId':_0x77dfb2,'VoicePrefixId':_0x4cae4c[_0x01e7('0x94')]});});return Promise[_0x01e7('0x93')](_0x30caaf);}});});});return Promise['all'](_0x1412be)['then'](function(){return _0x3f82f4[_0x01e7('0x7f')](_0x2de545,{'transaction':_0x4b25b7})[_0x01e7('0x95')](function(_0x2ea163){return _0x2ea163;});});});}})['then'](respondWithResult(_0x26ba20,null))['catch'](handleError(_0x26ba20,null));};exports[_0x01e7('0x96')]=function(_0x268963,_0x1b8b47){var _0xf09d39=_[_0x01e7('0x97')](_0x268963[_0x01e7('0x38')][_0x01e7('0x7c')])?_0x268963[_0x01e7('0x38')][_0x01e7('0x7c')]:[_0x268963['query'][_0x01e7('0x7c')]];var _0x420577=_0x268963[_0x01e7('0x55')]['id'];return db[_0x01e7('0x2d')][_0x01e7('0x4e')]({'where':{'id':_0x420577}})[_0x01e7('0x28')](handleEntityNotFound(_0x1b8b47,null))['then'](function(_0x3fb643){if(_0x3fb643){var _0x2ff2d1=[_0x01e7('0x80'),'Chat',_0x01e7('0x82'),_0x01e7('0x98'),_0x01e7('0x99'),_0x01e7('0x83'),'Whatsapp'];return db[_0x01e7('0x56')]['transaction'](function(_0x519c42){var _0x86f5ca=_[_0x01e7('0x33')](_0x2ff2d1,function(_0x5413c6){var _0x382a7c={'attributes':['id','name']};return _0x3fb643['get'+_0x5413c6+_0x01e7('0x78')](_0x382a7c)[_0x01e7('0x28')](function(_0x56875c){var _0x30db09=_[_0x01e7('0x33')](_0x56875c,function(_0x12c5fc){return _0x12c5fc[_0x01e7('0x96')](_0xf09d39,{'transaction':_0x519c42})['then'](function(){var _0x195848=_[_0x01e7('0x33')](_0xf09d39,function(_0x3c3099){socket[_0x01e7('0x89')](_0x01e7('0x49')+_0x5413c6+_0x01e7('0x9a'),{'UserId':Number(_0x3c3099),[_0x5413c6+_0x01e7('0x85')]:_0x12c5fc['id']});if(_0x5413c6!==_0x01e7('0x80')){return;}return db[_0x01e7('0x8f')][_0x01e7('0x54')]({'where':{'VoiceQueueId':_0x12c5fc['id'],'UserId':_0x3c3099},'transaction':_0x519c42});});return Promise['all'](_0x195848);});});return Promise[_0x01e7('0x93')](_0x30db09);});});return Promise['all'](_0x86f5ca)[_0x01e7('0x28')](function(){return _0x3fb643[_0x01e7('0x96')](_0xf09d39,{'transaction':_0x519c42});})[_0x01e7('0x28')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x420577}})[_0x01e7('0x28')](function(_0x3f0920){if(_0x3f0920){var _0xa50c93=_[_0x01e7('0x33')](_0xf09d39,function(_0x430c69){db[_0x01e7('0x6e')][_0x01e7('0x54')]({'where':{'UserId':_0x430c69,'VoicePrefixId':_0x3f0920['VoicePrefixId']}});});return Promise[_0x01e7('0x93')](_0xa50c93);}});});});}})[_0x01e7('0x28')](respondWithStatusCode(_0x1b8b47,null))['catch'](handleError(_0x1b8b47,null));};exports[_0x01e7('0x9b')]=function(_0x59f792,_0x1af9b0,_0x42d8b5){var _0x3e67ab={};var _0x1ac732={};var _0x5a6ca7;var _0x5e5d61;return db[_0x01e7('0x2d')][_0x01e7('0x7a')]({'where':{'id':_0x59f792[_0x01e7('0x55')]['id']}})['then'](handleEntityNotFound(_0x1af9b0,null))[_0x01e7('0x28')](function(_0xa08576){if(_0xa08576){_0x5a6ca7=_0xa08576;_0x1ac732[_0x01e7('0x32')]=_[_0x01e7('0x34')](db[_0x01e7('0x8b')][_0x01e7('0x2e')]);_0x1ac732['query']=_[_0x01e7('0x34')](_0x59f792[_0x01e7('0x38')]);_0x1ac732['filters']=_[_0x01e7('0x36')](_0x1ac732[_0x01e7('0x32')],_0x1ac732['query']);_0x3e67ab[_0x01e7('0x35')]=_[_0x01e7('0x36')](_0x1ac732['model'],qs[_0x01e7('0x37')](_0x59f792[_0x01e7('0x38')][_0x01e7('0x37')]));_0x3e67ab[_0x01e7('0x35')]=_0x3e67ab['attributes'][_0x01e7('0x77')]?_0x3e67ab['attributes']:_0x1ac732[_0x01e7('0x32')];_0x3e67ab[_0x01e7('0x3a')]=qs[_0x01e7('0x3b')](_0x59f792['query'][_0x01e7('0x3b')]);_0x3e67ab['where']=qs[_0x01e7('0x3d')](_['pick'](_0x59f792[_0x01e7('0x38')],_0x1ac732[_0x01e7('0x3d')]));if(_0x59f792[_0x01e7('0x38')][_0x01e7('0x3f')]){_0x3e67ab[_0x01e7('0x3c')]=_['merge'](_0x3e67ab[_0x01e7('0x3c')],{'$or':_[_0x01e7('0x33')](_0x3e67ab[_0x01e7('0x35')],function(_0x3d9ddd){var _0x53e6af={};_0x53e6af[_0x3d9ddd]={'$like':'%'+_0x59f792[_0x01e7('0x38')][_0x01e7('0x3f')]+'%'};return _0x53e6af;})});}_0x3e67ab=_[_0x01e7('0x40')]({},_0x3e67ab,_0x59f792[_0x01e7('0x42')]);return _0x5a6ca7[_0x01e7('0x9b')](_0x3e67ab);}})[_0x01e7('0x28')](function(_0x2ccd45){if(_0x2ccd45){_0x5e5d61=_0x2ccd45[_0x01e7('0x77')];if(!_0x59f792[_0x01e7('0x38')][_0x01e7('0x9c')]('nolimit')){_0x3e67ab[_0x01e7('0x20')]=qs[_0x01e7('0x20')](_0x59f792[_0x01e7('0x38')][_0x01e7('0x20')]);_0x3e67ab[_0x01e7('0x22')]=qs['offset'](_0x59f792[_0x01e7('0x38')][_0x01e7('0x22')]);}return _0x5a6ca7[_0x01e7('0x9b')](_0x3e67ab);}})['then'](function(_0x386ff){if(_0x386ff){return _0x386ff?{'count':_0x5e5d61,'rows':_0x386ff}:null;}})['then'](respondWithResult(_0x1af9b0,null))[_0x01e7('0x45')](handleError(_0x1af9b0,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b710214..ad57133 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 _0xabc7=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xabc7,0x11e));var _0x7abc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xabc7[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require('events');var Team=require(_0x7abc('0x0'))['db'][_0x7abc('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x7abc('0x2')](0x0);var events={'afterCreate':_0x7abc('0x3'),'afterUpdate':_0x7abc('0x4'),'afterDestroy':_0x7abc('0x5')};function emitEvent(_0x4388b2){return function(_0xb06ad3,_0x1a98cd,_0x2dce65){TeamEvents[_0x7abc('0x6')](_0x4388b2+':'+_0xb06ad3['id'],_0xb06ad3);TeamEvents[_0x7abc('0x6')](_0x4388b2,_0xb06ad3);_0x2dce65(null);};}for(var e in events){if(events[_0x7abc('0x7')](e)){var event=events[e];Team[_0x7abc('0x8')](e,emitEvent(event));}}module[_0x7abc('0x9')]=TeamEvents; \ No newline at end of file +var _0x6bdd=['update','remove','emit','hook','events','Team','setMaxListeners','save'];(function(_0x5105e8,_0x44a2e0){var _0x53bbf5=function(_0x29dfb8){while(--_0x29dfb8){_0x5105e8['push'](_0x5105e8['shift']());}};_0x53bbf5(++_0x44a2e0);}(_0x6bdd,0x1dc));var _0xd6bd=function(_0x431f27,_0x152cc4){_0x431f27=_0x431f27-0x0;var _0x559a65=_0x6bdd[_0x431f27];return _0x559a65;};'use strict';var EventEmitter=require(_0xd6bd('0x0'));var Team=require('../../mysqldb')['db'][_0xd6bd('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xd6bd('0x2')](0x0);var events={'afterCreate':_0xd6bd('0x3'),'afterUpdate':_0xd6bd('0x4'),'afterDestroy':_0xd6bd('0x5')};function emitEvent(_0x56f9bc){return function(_0x275bce,_0x22c6fe,_0x2660ff){TeamEvents[_0xd6bd('0x6')](_0x56f9bc+':'+_0x275bce['id'],_0x275bce);TeamEvents[_0xd6bd('0x6')](_0x56f9bc,_0x275bce);_0x2660ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd6bd('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index fea0412..bd8bec3 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 _0xc286=['rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util','api','moment','request-promise','path'];(function(_0x4e7c2,_0x3b3347){var _0x84bb35=function(_0x217b38){while(--_0x217b38){_0x4e7c2['push'](_0x4e7c2['shift']());}};_0x84bb35(++_0x3b3347);}(_0xc286,0x96));var _0x6c28=function(_0x3f0ee3,_0x461a42){_0x3f0ee3=_0x3f0ee3-0x0;var _0x3f90b9=_0xc286[_0x3f0ee3];return _0x3f90b9;};'use strict';var _=require(_0x6c28('0x0'));var util=require(_0x6c28('0x1'));var logger=require('../../config/logger')(_0x6c28('0x2'));var moment=require(_0x6c28('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c28('0x4'));var fs=require('fs');var path=require(_0x6c28('0x5'));var rimraf=require(_0x6c28('0x6'));var config=require(_0x6c28('0x7'));var attributes=require(_0x6c28('0x8'));module[_0x6c28('0x9')]=function(_0x589686,_0x2c5b28){return _0x589686[_0x6c28('0xa')](_0x6c28('0xb'),attributes,{'tableName':_0x6c28('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x876a=['../../config/logger','api','moment','bluebird','path','../../config/environment','./team.attributes','exports','define','Team','lodash'];(function(_0x16d491,_0x30f4fa){var _0x371faf=function(_0x995992){while(--_0x995992){_0x16d491['push'](_0x16d491['shift']());}};_0x371faf(++_0x30f4fa);}(_0x876a,0x13e));var _0xa876=function(_0x4e84d3,_0x1add05){_0x4e84d3=_0x4e84d3-0x0;var _0x1a0df6=_0x876a[_0x4e84d3];return _0x1a0df6;};'use strict';var _=require(_0xa876('0x0'));var util=require('util');var logger=require(_0xa876('0x1'))(_0xa876('0x2'));var moment=require(_0xa876('0x3'));var BPromise=require(_0xa876('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa876('0x5'));var rimraf=require('rimraf');var config=require(_0xa876('0x6'));var attributes=require(_0xa876('0x7'));module[_0xa876('0x8')]=function(_0x3fa070,_0x1e9e59){return _0x3fa070[_0xa876('0x9')](_0xa876('0xa'),attributes,{'tableName':'teams','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 b16d1b0..4721766 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 _0x5162=['debug','stringify','error','code','message','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent'];(function(_0x534314,_0xc1f12a){var _0x2710c1=function(_0x2236b3){while(--_0x2236b3){_0x534314['push'](_0x534314['shift']());}};_0x2710c1(++_0xc1f12a);}(_0x5162,0x103));var _0x2516=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0x5162[_0x1602fb];return _0x461831;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var utils=require(_0x2516('0x3'));var logger=require(_0x2516('0x4'))(_0x2516('0x5'));var config=require(_0x2516('0x6'));var jayson=require(_0x2516('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2516('0x8')](config[_0x2516('0x9')],{'host':_0x2516('0xa'),'port':0x18eb});var socket=require(_0x2516('0xb'))(new Redis(config[_0x2516('0x9')]));require(_0x2516('0xc'))[_0x2516('0xd')](socket);function respondWithRpcPromise(_0x590875,_0x409550,_0x3f7e71){return new BPromise(function(_0x18bfd3,_0x5dda21){return client['request'](_0x590875,_0x3f7e71)['then'](function(_0x4ceaa1){logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,_0x2516('0x10'));logger[_0x2516('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x409550,_0x2516('0x10'),JSON[_0x2516('0x12')](_0x4ceaa1));if(_0x4ceaa1[_0x2516('0x13')]){if(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x14')]===0x1f4){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x5dda21(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);}logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x18bfd3(_0x4ceaa1['error'][_0x2516('0x15')]);}else{logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,'request\x20sent');_0x18bfd3(_0x4ceaa1[_0x2516('0x16')]['message']);}})['catch'](function(_0x31a817){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x31a817);_0x5dda21(_0x31a817);});});} \ No newline at end of file +var _0x458f=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Team,\x20%s,\x20%s','request\x20sent','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x458f,0x104));var _0xf458=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x458f[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xf458('0x0'));var moment=require(_0xf458('0x1'));var BPromise=require(_0xf458('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf458('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf458('0x4'))(_0xf458('0x5'));var config=require(_0xf458('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf458('0x7')]({'port':0x232a});config['redis']=_[_0xf458('0x8')](config[_0xf458('0x9')],{'host':_0xf458('0xa'),'port':0x18eb});var socket=require(_0xf458('0xb'))(new Redis(config[_0xf458('0x9')]));require('./team.socket')[_0xf458('0xc')](socket);function respondWithRpcPromise(_0x5a5cb3,_0x4fd7d1,_0x2f1f5d){return new BPromise(function(_0x184c99,_0x6cef2d){return client['request'](_0x5a5cb3,_0x2f1f5d)[_0xf458('0xd')](function(_0x1bc352){logger[_0xf458('0xe')]('Team,\x20%s,\x20%s',_0x4fd7d1,'request\x20sent');logger[_0xf458('0xf')](_0xf458('0x10'),_0x4fd7d1,'request\x20sent',JSON[_0xf458('0x11')](_0x1bc352));if(_0x1bc352[_0xf458('0x12')]){if(_0x1bc352[_0xf458('0x12')][_0xf458('0x13')]===0x1f4){logger[_0xf458('0x12')]('Team,\x20%s,\x20%s',_0x4fd7d1,_0x1bc352[_0xf458('0x12')][_0xf458('0x14')]);return _0x6cef2d(_0x1bc352[_0xf458('0x12')][_0xf458('0x14')]);}logger[_0xf458('0x12')](_0xf458('0x15'),_0x4fd7d1,_0x1bc352[_0xf458('0x12')][_0xf458('0x14')]);return _0x184c99(_0x1bc352[_0xf458('0x12')][_0xf458('0x14')]);}else{logger[_0xf458('0xe')](_0xf458('0x15'),_0x4fd7d1,_0xf458('0x16'));_0x184c99(_0x1bc352[_0xf458('0x17')][_0xf458('0x14')]);}})[_0xf458('0x18')](function(_0x11e81f){logger[_0xf458('0x12')](_0xf458('0x15'),_0x4fd7d1,_0x11e81f);_0x6cef2d(_0x11e81f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 5be56cf..cff51dc 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 _0x1cf6=['save','remove','update','removeListener','register','length','team:'];(function(_0xba1835,_0x219a4c){var _0x41e70a=function(_0x3f14da){while(--_0x3f14da){_0xba1835['push'](_0xba1835['shift']());}};_0x41e70a(++_0x219a4c);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x2a2a18,_0x46dca4){_0x2a2a18=_0x2a2a18-0x0;var _0x5445fb=_0x1cf6[_0x2a2a18];return _0x5445fb;};'use strict';var TeamEvents=require('./team.events');var events=[_0x61cf('0x0'),_0x61cf('0x1'),_0x61cf('0x2')];function createListener(_0x749677,_0xbe877b){return function(_0x4658f9){_0xbe877b['emit'](_0x749677,_0x4658f9);};}function removeListener(_0x384925,_0x2c3db1){return function(){TeamEvents[_0x61cf('0x3')](_0x384925,_0x2c3db1);};}exports[_0x61cf('0x4')]=function(_0x2ba08f){for(var _0x14987c=0x0,_0x53d574=events[_0x61cf('0x5')];_0x14987c<_0x53d574;_0x14987c++){var _0x437945=events[_0x14987c];var _0x3c0798=createListener(_0x61cf('0x6')+_0x437945,_0x2ba08f);TeamEvents['on'](_0x437945,_0x3c0798);}}; \ No newline at end of file +var _0xd9b6=['register','length','team:','./team.events','save','remove','emit','removeListener'];(function(_0xe5e265,_0x4cecdd){var _0x46e596=function(_0x424ef5){while(--_0x424ef5){_0xe5e265['push'](_0xe5e265['shift']());}};_0x46e596(++_0x4cecdd);}(_0xd9b6,0x17b));var _0x6d9b=function(_0x1829fd,_0x33b470){_0x1829fd=_0x1829fd-0x0;var _0x177d22=_0xd9b6[_0x1829fd];return _0x177d22;};'use strict';var TeamEvents=require(_0x6d9b('0x0'));var events=[_0x6d9b('0x1'),_0x6d9b('0x2'),'update'];function createListener(_0x4fdd48,_0x7e7189){return function(_0x46969d){_0x7e7189[_0x6d9b('0x3')](_0x4fdd48,_0x46969d);};}function removeListener(_0x3d32e8,_0x44efde){return function(){TeamEvents[_0x6d9b('0x4')](_0x3d32e8,_0x44efde);};}exports[_0x6d9b('0x5')]=function(_0xc0b369){for(var _0x5525da=0x0,_0x2ba696=events[_0x6d9b('0x6')];_0x5525da<_0x2ba696;_0x5525da++){var _0x4361f4=events[_0x5525da];var _0x65869a=createListener(_0x6d9b('0x7')+_0x4361f4,_0xc0b369);TeamEvents['on'](_0x4361f4,_0x65869a);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7be76ca..574f946 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 _0xafa8=['INTEGER','exports'];(function(_0x58e2ec,_0x42341d){var _0x12a922=function(_0x2f8524){while(--_0x2f8524){_0x58e2ec['push'](_0x58e2ec['shift']());}};_0x12a922(++_0x42341d);}(_0xafa8,0x135));var _0x8afa=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0xafa8[_0x246227];return _0x37bd4a;};'use strict';var Sequelize=require('sequelize');module[_0x8afa('0x0')]={'TeamId':{'type':Sequelize[_0x8afa('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8afa('0x1')]}}; \ No newline at end of file +var _0xa446=['sequelize','exports','INTEGER'];(function(_0x5aecee,_0x8bb05b){var _0x1d3d6b=function(_0x1e34a7){while(--_0x1e34a7){_0x5aecee['push'](_0x5aecee['shift']());}};_0x1d3d6b(++_0x8bb05b);}(_0xa446,0xc6));var _0x6a44=function(_0x16787a,_0x6b4ac7){_0x16787a=_0x16787a-0x0;var _0x46608c=_0xa446[_0x16787a];return _0x46608c;};'use strict';var Sequelize=require(_0x6a44('0x0'));module[_0x6a44('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x6a44('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index ae9ed18..1ad198a 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 _0x1e7b=['../../config/environment','exports','define','TeamVoicePrefix','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x4d49eb,_0x4a607b){var _0x22c91c=function(_0x20969c){while(--_0x20969c){_0x4d49eb['push'](_0x4d49eb['shift']());}};_0x22c91c(++_0x4a607b);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x1fe809,_0x433222){_0x1fe809=_0x1fe809-0x0;var _0x59c58c=_0x1e7b[_0x1fe809];return _0x59c58c;};'use strict';var _=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var logger=require('../../config/logger')(_0xb1e7('0x2'));var moment=require(_0xb1e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb1e7('0x4'));var fs=require('fs');var path=require(_0xb1e7('0x5'));var rimraf=require(_0xb1e7('0x6'));var config=require(_0xb1e7('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xb1e7('0x8')]=function(_0x2f733c,_0x3bc43b){return _0x2f733c[_0xb1e7('0x9')](_0xb1e7('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bb0=['exports','define','TeamVoicePrefix','lodash','util','../../config/logger','moment','path','../../config/environment','./teamVoicePrefix.attributes'];(function(_0xb4fce8,_0x40b80c){var _0x4cf0b3=function(_0x4438e2){while(--_0x4438e2){_0xb4fce8['push'](_0xb4fce8['shift']());}};_0x4cf0b3(++_0x40b80c);}(_0x2bb0,0xf3));var _0x02bb=function(_0x147f07,_0xb0c8e2){_0x147f07=_0x147f07-0x0;var _0x5e7345=_0x2bb0[_0x147f07];return _0x5e7345;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var logger=require(_0x02bb('0x2'))('api');var moment=require(_0x02bb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x02bb('0x4'));var rimraf=require('rimraf');var config=require(_0x02bb('0x5'));var attributes=require(_0x02bb('0x6'));module[_0x02bb('0x7')]=function(_0x390ff7,_0x43dbb7){return _0x390ff7[_0x02bb('0x8')](_0x02bb('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ff97573..66b8e81 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x457248,_0x3e6457){var _0x24c841=function(_0x452316){while(--_0x452316){_0x457248['push'](_0x457248['shift']());}};_0x24c841(++_0x3e6457);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xcb91[_0x166742];return _0xb7814a;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x321c6d,_0x6e6f64){var _0x2f36da=function(_0x11c29a){while(--_0x11c29a){_0x321c6d['push'](_0x321c6d['shift']());}};_0x2f36da(++_0x6e6f64);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 212aef3..e592bf1 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 _0xe11f=['sequelize'];(function(_0x5eb4e5,_0x964b16){var _0x2c5309=function(_0x1628fa){while(--_0x1628fa){_0x5eb4e5['push'](_0x5eb4e5['shift']());}};_0x2c5309(++_0x964b16);}(_0xe11f,0x176));var _0xfe11=function(_0x72bcf9,_0x501170){_0x72bcf9=_0x72bcf9-0x0;var _0x1d4889=_0xe11f[_0x72bcf9];return _0x1d4889;};'use strict';var Sequelize=require(_0xfe11('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x72d7=['INTEGER'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x72d7,0x129));var _0x772d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x72d7[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x772d('0x0')],'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 e8fbf17..b8e7660 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 _0xb4e6=['bluebird','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x22e163,_0x2a2830){var _0x524a25=function(_0x2de368){while(--_0x2de368){_0x22e163['push'](_0x22e163['shift']());}};_0x524a25(++_0x2a2830);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0xb4e6[_0x496738];return _0xee1381;};'use strict';var _=require(_0x6b4e('0x0'));var util=require(_0x6b4e('0x1'));var logger=require(_0x6b4e('0x2'))(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require('rimraf');var config=require(_0x6b4e('0x7'));var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x431dde,_0x5ad54e){return _0x431dde[_0x6b4e('0xa')](_0x6b4e('0xb'),attributes,{'tableName':_0x6b4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f94=['path','rimraf','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2f9ee0,_0x4ac1db){var _0x49bbfd=function(_0x1243cf){while(--_0x1243cf){_0x2f9ee0['push'](_0x2f9ee0['shift']());}};_0x49bbfd(++_0x4ac1db);}(_0x9f94,0x1e7));var _0x49f9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f94[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var logger=require(_0x49f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x49f9('0x3'));var rp=require(_0x49f9('0x4'));var fs=require('fs');var path=require(_0x49f9('0x5'));var rimraf=require(_0x49f9('0x6'));var config=require(_0x49f9('0x7'));var attributes=require('./teamVoiceQueue.attributes');module[_0x49f9('0x8')]=function(_0x31a7fe,_0x3cd35a){return _0x31a7fe[_0x49f9('0x9')](_0x49f9('0xa'),attributes,{'tableName':_0x49f9('0xb'),'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 dd43172..30958e8 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 _0xeea3=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xeea3,0xd7));var _0x3eea=function(_0x576233,_0x50874f){_0x576233=_0x576233-0x0;var _0x5f14f3=_0xeea3[_0x576233];return _0x5f14f3;};'use strict';var _=require(_0x3eea('0x0'));var util=require(_0x3eea('0x1'));var moment=require('moment');var BPromise=require(_0x3eea('0x2'));var rs=require(_0x3eea('0x3'));var fs=require('fs');var Redis=require(_0x3eea('0x4'));var db=require(_0x3eea('0x5'))['db'];var utils=require(_0x3eea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3eea('0x7'));var jayson=require(_0x3eea('0x8'));var client=jayson['client'][_0x3eea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4123d9,_0x3e40c5,_0x545662){return new BPromise(function(_0x25fa3b,_0x2e2185){return client[_0x3eea('0xa')](_0x4123d9,_0x545662)[_0x3eea('0xb')](function(_0x3b59fd){logger['info'](_0x3eea('0xc'),_0x3e40c5,_0x3eea('0xd'));logger[_0x3eea('0xe')](_0x3eea('0xf'),_0x3e40c5,_0x3eea('0xd'),JSON[_0x3eea('0x10')](_0x3b59fd));if(_0x3b59fd[_0x3eea('0x11')]){if(_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x12')]===0x1f4){logger['error'](_0x3eea('0xc'),_0x3e40c5,_0x3b59fd['error'][_0x3eea('0x13')]);return _0x2e2185(_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x13')]);}logger['error'](_0x3eea('0xc'),_0x3e40c5,_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x13')]);return _0x25fa3b(_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x13')]);}else{logger[_0x3eea('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3e40c5,_0x3eea('0xd'));_0x25fa3b(_0x3b59fd[_0x3eea('0x15')][_0x3eea('0x13')]);}})[_0x3eea('0x16')](function(_0x5ee088){logger['error'](_0x3eea('0xc'),_0x3e40c5,_0x5ee088);_0x2e2185(_0x5ee088);});});} \ No newline at end of file +var _0x4071=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x4071,0x1c0));var _0x1407=function(_0x4dd4ff,_0x32eb3c){_0x4dd4ff=_0x4dd4ff-0x0;var _0x4f3fe3=_0x4071[_0x4dd4ff];return _0x4f3fe3;};'use strict';var _=require('lodash');var util=require(_0x1407('0x0'));var moment=require(_0x1407('0x1'));var BPromise=require('bluebird');var rs=require(_0x1407('0x2'));var fs=require('fs');var Redis=require(_0x1407('0x3'));var db=require(_0x1407('0x4'))['db'];var utils=require(_0x1407('0x5'));var logger=require(_0x1407('0x6'))(_0x1407('0x7'));var config=require(_0x1407('0x8'));var jayson=require(_0x1407('0x9'));var client=jayson[_0x1407('0xa')][_0x1407('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30d87b,_0x465c6a,_0x32768d){return new BPromise(function(_0x113699,_0x2ee942){return client[_0x1407('0xc')](_0x30d87b,_0x32768d)['then'](function(_0x5c0a56){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x465c6a,_0x1407('0xd'));logger[_0x1407('0xe')](_0x1407('0xf'),_0x465c6a,'request\x20sent',JSON[_0x1407('0x10')](_0x5c0a56));if(_0x5c0a56[_0x1407('0x11')]){if(_0x5c0a56[_0x1407('0x11')]['code']===0x1f4){logger['error'](_0x1407('0x12'),_0x465c6a,_0x5c0a56[_0x1407('0x11')][_0x1407('0x13')]);return _0x2ee942(_0x5c0a56[_0x1407('0x11')][_0x1407('0x13')]);}logger[_0x1407('0x11')](_0x1407('0x12'),_0x465c6a,_0x5c0a56[_0x1407('0x11')]['message']);return _0x113699(_0x5c0a56['error'][_0x1407('0x13')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x465c6a,'request\x20sent');_0x113699(_0x5c0a56['result'][_0x1407('0x13')]);}})[_0x1407('0x14')](function(_0x3e0f9e){logger['error'](_0x1407('0x12'),_0x465c6a,_0x3e0f9e);_0x2ee942(_0x3e0f9e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 1a291ff..b572814 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 _0x1f2d=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x4c5c4d,_0xaedb35){var _0x4f0ae8=function(_0x3a125f){while(--_0x3a125f){_0x4c5c4d['push'](_0x4c5c4d['shift']());}};_0x4f0ae8(++_0xaedb35);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x1f2d[_0x5774be];return _0x4914b4;};'use strict';var multer=require(_0xd1f2('0x0'));var util=require(_0xd1f2('0x1'));var path=require(_0xd1f2('0x2'));var timeout=require(_0xd1f2('0x3'));var express=require('express');var router=express[_0xd1f2('0x4')]();var fs_extra=require(_0xd1f2('0x5'));var auth=require(_0xd1f2('0x6'));var interaction=require(_0xd1f2('0x7'));var config=require(_0xd1f2('0x8'));var controller=require(_0xd1f2('0x9'));router[_0xd1f2('0xa')]('/',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0xc')]);router[_0xd1f2('0xa')](_0xd1f2('0xd'),auth[_0xd1f2('0xb')](),controller[_0xd1f2('0xe')]);router[_0xd1f2('0xf')]('/',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0x10')]);router[_0xd1f2('0x11')]('/:id',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0x12')]);router[_0xd1f2('0x13')](_0xd1f2('0xd'),auth['isAuthenticated'](),controller[_0xd1f2('0x14')]);module[_0xd1f2('0x15')]=router; \ No newline at end of file +var _0x8ace=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','put'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0x8ace[_0x216f7d];return _0xc49d7f;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['show']);router['post']('/',auth[_0xe8ac('0xc')](),controller['create']);router[_0xe8ac('0xf')](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x12')]);module[_0xe8ac('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f5adafd..feaadf9 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 _0xe8bd=['exports','STRING','sequelize'];(function(_0x496ae8,_0x10138c){var _0x5ad82e=function(_0x88527a){while(--_0x88527a){_0x496ae8['push'](_0x496ae8['shift']());}};_0x5ad82e(++_0x10138c);}(_0xe8bd,0x1d6));var _0xde8b=function(_0x5c6081,_0x247a8f){_0x5c6081=_0x5c6081-0x0;var _0x10aadb=_0xe8bd[_0x5c6081];return _0x10aadb;};'use strict';var Sequelize=require(_0xde8b('0x0'));module[_0xde8b('0x1')]={'name':{'type':Sequelize[_0xde8b('0x2')]},'description':{'type':Sequelize[_0xde8b('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x093e=['exports','STRING','TEXT','sequelize'];(function(_0x22fc43,_0x49be1e){var _0x205516=function(_0x3de8e8){while(--_0x3de8e8){_0x22fc43['push'](_0x22fc43['shift']());}};_0x205516(++_0x49be1e);}(_0x093e,0x1e7));var _0xe093=function(_0x3cb08d,_0x1f84a5){_0x3cb08d=_0x3cb08d-0x0;var _0xeef830=_0x093e[_0x3cb08d];return _0xeef830;};'use strict';var Sequelize=require(_0xe093('0x0'));module[_0xe093('0x1')]={'name':{'type':Sequelize[_0xe093('0x2')]},'description':{'type':Sequelize[_0xe093('0x2')]},'html':{'type':Sequelize[_0xe093('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a30ca95..23cf7e1 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 _0x4320=['Template','findAll','rows','catch','show','keys','includeAll','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','then','destroy','get','UserProfileResource','name','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0x4320,0x16e));var _0x0432=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4320[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0432('0x0'));var zipdir=require(_0x0432('0x1'));var jsonpatch=require(_0x0432('0x2'));var rp=require(_0x0432('0x3'));var moment=require(_0x0432('0x4'));var BPromise=require(_0x0432('0x5'));var Mustache=require(_0x0432('0x6'));var util=require(_0x0432('0x7'));var path=require(_0x0432('0x8'));var sox=require('sox');var csv=require(_0x0432('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0432('0xa'));var squel=require(_0x0432('0xb'));var crypto=require(_0x0432('0xc'));var jsforce=require(_0x0432('0xd'));var deskjs=require(_0x0432('0xe'));var toCsv=require(_0x0432('0x9'));var querystring=require(_0x0432('0xf'));var Papa=require(_0x0432('0x10'));var Redis=require(_0x0432('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0432('0x12'));var as=require(_0x0432('0x13'));var hardwareService=require(_0x0432('0x14'));var logger=require(_0x0432('0x15'))(_0x0432('0x16'));var utils=require(_0x0432('0x17'));var config=require(_0x0432('0x18'));var licenseUtil=require(_0x0432('0x19'));var db=require(_0x0432('0x1a'))['db'];function respondWithStatusCode(_0x12549c,_0xc67c89){_0xc67c89=_0xc67c89||0xcc;return function(_0x3fd466){if(_0x3fd466){return _0x12549c[_0x0432('0x1b')](_0xc67c89);}return _0x12549c['status'](_0xc67c89)[_0x0432('0x1c')]();};}function respondWithResult(_0x27f815,_0x456a5f){_0x456a5f=_0x456a5f||0xc8;return function(_0x249884){if(_0x249884){return _0x27f815['status'](_0x456a5f)[_0x0432('0x1d')](_0x249884);}};}function respondWithFilteredResult(_0x243e00,_0x161ff9){return function(_0x484f1d){if(_0x484f1d){var _0x349ba2=typeof _0x161ff9[_0x0432('0x1e')]===_0x0432('0x1f')&&typeof _0x161ff9[_0x0432('0x20')]===_0x0432('0x1f');var _0x798e3b=_0x484f1d['count'];var _0x5e2bcd=_0x349ba2?0x0:_0x161ff9[_0x0432('0x1e')];var _0x40e6a6=_0x349ba2?_0x484f1d[_0x0432('0x21')]:_0x161ff9[_0x0432('0x1e')]+_0x161ff9[_0x0432('0x20')];var _0x40f18c;if(_0x40e6a6>=_0x798e3b){_0x40e6a6=_0x798e3b;_0x40f18c=0xc8;}else{_0x40f18c=0xce;}_0x243e00[_0x0432('0x22')](_0x40f18c);return _0x243e00[_0x0432('0x23')]('Content-Range',_0x5e2bcd+'-'+_0x40e6a6+'/'+_0x798e3b)[_0x0432('0x1d')](_0x484f1d);}return null;};}function patchUpdates(_0xb3c003){return function(_0x59c2dc){try{jsonpatch[_0x0432('0x24')](_0x59c2dc,_0xb3c003,!![]);}catch(_0x336758){return BPromise[_0x0432('0x25')](_0x336758);}return _0x59c2dc[_0x0432('0x26')]();};}function saveUpdates(_0x5c7184,_0x5f46b1){return function(_0x30b08c){if(_0x30b08c){return _0x30b08c['update'](_0x5c7184)[_0x0432('0x27')](function(_0x1591fe){return _0x1591fe;});}return null;};}function removeEntity(_0x4e1d32,_0x5144d6){return function(_0x42be88){if(_0x42be88){return _0x42be88[_0x0432('0x28')]()['then'](function(){var _0x3395b4=_0x42be88[_0x0432('0x29')]({'plain':!![]});var _0x154bd7='Templates';return db[_0x0432('0x2a')]['destroy']({'where':{'type':_0x154bd7,'resourceId':_0x3395b4['id']}})['then'](function(){return _0x42be88;});})[_0x0432('0x27')](function(){_0x4e1d32[_0x0432('0x22')](0xcc)[_0x0432('0x1c')]();});}};}function handleEntityNotFound(_0x19afab,_0x26d968){return function(_0x516ca9){if(!_0x516ca9){_0x19afab[_0x0432('0x1b')](0x194);}return _0x516ca9;};}function handleError(_0xa2d04c,_0x445208){_0x445208=_0x445208||0x1f4;return function(_0x49e1ad){logger['error'](_0x49e1ad['stack']);if(_0x49e1ad[_0x0432('0x2b')]){delete _0x49e1ad[_0x0432('0x2b')];}_0xa2d04c[_0x0432('0x22')](_0x445208)['send'](_0x49e1ad);};}exports[_0x0432('0x2c')]=function(_0x24c901,_0x4e4ae6){var _0x4ce2c0={},_0x5f47a6={},_0x5c1c94={'count':0x0,'rows':[]};var _0x36ce01=_['map'](db['Template'][_0x0432('0x2d')],function(_0x5699b2){return{'name':_0x5699b2[_0x0432('0x2e')],'type':_0x5699b2[_0x0432('0x2f')][_0x0432('0x30')]};});_0x5f47a6['model']=_['map'](_0x36ce01,_0x0432('0x2b'));_0x5f47a6[_0x0432('0x31')]=_['keys'](_0x24c901[_0x0432('0x31')]);_0x5f47a6[_0x0432('0x32')]=_[_0x0432('0x33')](_0x5f47a6[_0x0432('0x34')],_0x5f47a6['query']);_0x4ce2c0[_0x0432('0x35')]=_[_0x0432('0x33')](_0x5f47a6[_0x0432('0x34')],qs[_0x0432('0x36')](_0x24c901[_0x0432('0x31')]['fields']));_0x4ce2c0['attributes']=_0x4ce2c0['attributes'][_0x0432('0x37')]?_0x4ce2c0[_0x0432('0x35')]:_0x5f47a6[_0x0432('0x34')];if(!_0x24c901[_0x0432('0x31')][_0x0432('0x38')](_0x0432('0x39'))){_0x4ce2c0['limit']=qs['limit'](_0x24c901[_0x0432('0x31')]['limit']);_0x4ce2c0['offset']=qs[_0x0432('0x1e')](_0x24c901[_0x0432('0x31')][_0x0432('0x1e')]);}_0x4ce2c0['order']=qs[_0x0432('0x3a')](_0x24c901[_0x0432('0x31')][_0x0432('0x3a')]);_0x4ce2c0['where']=qs['filters'](_[_0x0432('0x3b')](_0x24c901['query'],_0x5f47a6[_0x0432('0x32')]),_0x36ce01);if(_0x24c901['query'][_0x0432('0x3c')]){_0x4ce2c0[_0x0432('0x3d')]=_[_0x0432('0x3e')](_0x4ce2c0['where'],{'$or':_[_0x0432('0x3f')](_0x36ce01,function(_0x2be717){if(_0x2be717['type']!=='VIRTUAL'){var _0x46fda1={};_0x46fda1[_0x2be717['name']]={'$like':'%'+_0x24c901[_0x0432('0x31')][_0x0432('0x3c')]+'%'};return _0x46fda1;}})});}_0x4ce2c0=_[_0x0432('0x3e')]({},_0x4ce2c0,_0x24c901['options']);var _0x461662={'where':_0x4ce2c0[_0x0432('0x3d')]};return db[_0x0432('0x40')][_0x0432('0x21')](_0x461662)[_0x0432('0x27')](function(_0x3e6c44){_0x5c1c94[_0x0432('0x21')]=_0x3e6c44;if(_0x24c901[_0x0432('0x31')]['includeAll']){_0x4ce2c0['include']=[{'all':!![]}];}return db[_0x0432('0x40')][_0x0432('0x41')](_0x4ce2c0);})[_0x0432('0x27')](function(_0x9a0059){_0x5c1c94[_0x0432('0x42')]=_0x9a0059;return _0x5c1c94;})[_0x0432('0x27')](respondWithFilteredResult(_0x4e4ae6,_0x4ce2c0))[_0x0432('0x43')](handleError(_0x4e4ae6,null));};exports[_0x0432('0x44')]=function(_0x3aec3a,_0x2f661d){var _0x1219f0={'raw':!![],'where':{'id':_0x3aec3a['params']['id']}},_0x3ff3f4={};_0x3ff3f4[_0x0432('0x34')]=_['keys'](db[_0x0432('0x40')][_0x0432('0x2d')]);_0x3ff3f4[_0x0432('0x31')]=_[_0x0432('0x45')](_0x3aec3a[_0x0432('0x31')]);_0x3ff3f4[_0x0432('0x32')]=_['intersection'](_0x3ff3f4[_0x0432('0x34')],_0x3ff3f4[_0x0432('0x31')]);_0x1219f0['attributes']=_['intersection'](_0x3ff3f4[_0x0432('0x34')],qs[_0x0432('0x36')](_0x3aec3a[_0x0432('0x31')][_0x0432('0x36')]));_0x1219f0[_0x0432('0x35')]=_0x1219f0['attributes'][_0x0432('0x37')]?_0x1219f0[_0x0432('0x35')]:_0x3ff3f4[_0x0432('0x34')];if(_0x3aec3a[_0x0432('0x31')][_0x0432('0x46')]){_0x1219f0[_0x0432('0x47')]=[{'all':!![]}];}_0x1219f0=_[_0x0432('0x3e')]({},_0x1219f0,_0x3aec3a[_0x0432('0x48')]);return db['Template']['find'](_0x1219f0)['then'](handleEntityNotFound(_0x2f661d,null))[_0x0432('0x27')](respondWithResult(_0x2f661d,null))['catch'](handleError(_0x2f661d,null));};exports[_0x0432('0x49')]=function(_0x4db387,_0x30d168){return db[_0x0432('0x40')][_0x0432('0x49')](_0x4db387[_0x0432('0x4a')],{})['then'](function(_0x383d12){var _0x35a49e=_0x4db387['user'][_0x0432('0x29')]({'plain':!![]});if(!_0x35a49e)throw new Error(_0x0432('0x4b'));if(_0x35a49e[_0x0432('0x4c')]===_0x0432('0x4d')){var _0x521e69=_0x383d12['get']({'plain':!![]});var _0x149dec=_0x0432('0x4e');return db['UserProfileSection'][_0x0432('0x4f')]({'where':{'name':_0x149dec,'userProfileId':_0x35a49e[_0x0432('0x50')]},'raw':!![]})['then'](function(_0x416665){if(_0x416665&&_0x416665[_0x0432('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x521e69[_0x0432('0x2b')],'resourceId':_0x521e69['id'],'type':_0x416665[_0x0432('0x2b')],'sectionId':_0x416665['id']},{})[_0x0432('0x27')](function(){return _0x383d12;});}else{return _0x383d12;}})['catch'](function(_0x53bef8){logger[_0x0432('0x52')](_0x0432('0x53'),_0x53bef8);throw _0x53bef8;});}return _0x383d12;})[_0x0432('0x27')](respondWithResult(_0x30d168,0xc9))[_0x0432('0x43')](handleError(_0x30d168,null));};exports[_0x0432('0x54')]=function(_0x51c956,_0x3aa960){if(_0x51c956[_0x0432('0x4a')]['id']){delete _0x51c956[_0x0432('0x4a')]['id'];}return db[_0x0432('0x40')][_0x0432('0x4f')]({'where':{'id':_0x51c956[_0x0432('0x55')]['id']}})[_0x0432('0x27')](handleEntityNotFound(_0x3aa960,null))[_0x0432('0x27')](saveUpdates(_0x51c956[_0x0432('0x4a')],null))[_0x0432('0x27')](respondWithResult(_0x3aa960,null))[_0x0432('0x43')](handleError(_0x3aa960,null));};exports[_0x0432('0x28')]=function(_0x2141b3,_0x5e62ed){return db[_0x0432('0x40')][_0x0432('0x4f')]({'where':{'id':_0x2141b3[_0x0432('0x55')]['id']}})[_0x0432('0x27')](handleEntityNotFound(_0x5e62ed,null))[_0x0432('0x27')](removeEntity(_0x5e62ed,null))[_0x0432('0x43')](handleError(_0x5e62ed,null));}; \ No newline at end of file +var _0x3732=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Templates','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x2e1798,_0x5b14fa){var _0x51e1c4=function(_0xb427a7){while(--_0xb427a7){_0x2e1798['push'](_0x2e1798['shift']());}};_0x51e1c4(++_0x5b14fa);}(_0x3732,0xf9));var _0x2373=function(_0x357d9f,_0x22aab6){_0x357d9f=_0x357d9f-0x0;var _0x4da7f0=_0x3732[_0x357d9f];return _0x4da7f0;};'use strict';var emlformat=require(_0x2373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2373('0x1'));var jsonpatch=require(_0x2373('0x2'));var rp=require(_0x2373('0x3'));var moment=require(_0x2373('0x4'));var BPromise=require(_0x2373('0x5'));var Mustache=require(_0x2373('0x6'));var util=require(_0x2373('0x7'));var path=require(_0x2373('0x8'));var sox=require('sox');var csv=require(_0x2373('0x9'));var ejs=require(_0x2373('0xa'));var fs=require('fs');var fs_extra=require(_0x2373('0xb'));var _=require(_0x2373('0xc'));var squel=require(_0x2373('0xd'));var crypto=require('crypto');var jsforce=require(_0x2373('0xe'));var deskjs=require(_0x2373('0xf'));var toCsv=require(_0x2373('0x9'));var querystring=require('querystring');var Papa=require(_0x2373('0x10'));var Redis=require(_0x2373('0x11'));var authService=require(_0x2373('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2373('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2373('0x14'))('api');var utils=require(_0x2373('0x15'));var config=require(_0x2373('0x16'));var licenseUtil=require(_0x2373('0x17'));var db=require(_0x2373('0x18'))['db'];function respondWithStatusCode(_0x5f09a0,_0x3e6956){_0x3e6956=_0x3e6956||0xcc;return function(_0x3dd641){if(_0x3dd641){return _0x5f09a0[_0x2373('0x19')](_0x3e6956);}return _0x5f09a0[_0x2373('0x1a')](_0x3e6956)[_0x2373('0x1b')]();};}function respondWithResult(_0x4b7a02,_0x3bf239){_0x3bf239=_0x3bf239||0xc8;return function(_0x474c4e){if(_0x474c4e){return _0x4b7a02[_0x2373('0x1a')](_0x3bf239)[_0x2373('0x1c')](_0x474c4e);}};}function respondWithFilteredResult(_0x59fe6c,_0x5ed40f){return function(_0x36838e){if(_0x36838e){var _0x447cb5=typeof _0x5ed40f[_0x2373('0x1d')]===_0x2373('0x1e')&&typeof _0x5ed40f[_0x2373('0x1f')]===_0x2373('0x1e');var _0x32df4d=_0x36838e['count'];var _0x5c19dc=_0x447cb5?0x0:_0x5ed40f[_0x2373('0x1d')];var _0x5245e6=_0x447cb5?_0x36838e[_0x2373('0x20')]:_0x5ed40f[_0x2373('0x1d')]+_0x5ed40f[_0x2373('0x1f')];var _0x1790f4;if(_0x5245e6>=_0x32df4d){_0x5245e6=_0x32df4d;_0x1790f4=0xc8;}else{_0x1790f4=0xce;}_0x59fe6c[_0x2373('0x1a')](_0x1790f4);return _0x59fe6c[_0x2373('0x21')](_0x2373('0x22'),_0x5c19dc+'-'+_0x5245e6+'/'+_0x32df4d)['json'](_0x36838e);}return null;};}function patchUpdates(_0x15716d){return function(_0x2083e7){try{jsonpatch[_0x2373('0x23')](_0x2083e7,_0x15716d,!![]);}catch(_0x238bcd){return BPromise[_0x2373('0x24')](_0x238bcd);}return _0x2083e7['save']();};}function saveUpdates(_0x3c8715,_0x4795c6){return function(_0x4d1c89){if(_0x4d1c89){return _0x4d1c89[_0x2373('0x25')](_0x3c8715)[_0x2373('0x26')](function(_0xfcd5dd){return _0xfcd5dd;});}return null;};}function removeEntity(_0x5615ff,_0x155881){return function(_0x5920a7){if(_0x5920a7){return _0x5920a7[_0x2373('0x27')]()[_0x2373('0x26')](function(){var _0x4ccff0=_0x5920a7['get']({'plain':!![]});var _0x438fc9='Templates';return db[_0x2373('0x28')]['destroy']({'where':{'type':_0x438fc9,'resourceId':_0x4ccff0['id']}})[_0x2373('0x26')](function(){return _0x5920a7;});})[_0x2373('0x26')](function(){_0x5615ff[_0x2373('0x1a')](0xcc)[_0x2373('0x1b')]();});}};}function handleEntityNotFound(_0x34d29e,_0x51cbb1){return function(_0x2a7016){if(!_0x2a7016){_0x34d29e[_0x2373('0x19')](0x194);}return _0x2a7016;};}function handleError(_0x4b9288,_0x29c3cc){_0x29c3cc=_0x29c3cc||0x1f4;return function(_0x1a1d8b){logger['error'](_0x1a1d8b[_0x2373('0x29')]);if(_0x1a1d8b['name']){delete _0x1a1d8b[_0x2373('0x2a')];}_0x4b9288[_0x2373('0x1a')](_0x29c3cc)[_0x2373('0x2b')](_0x1a1d8b);};}exports[_0x2373('0x2c')]=function(_0x341a79,_0x2dcf78){var _0x52cb6f={},_0x35f637={},_0x3eacbf={'count':0x0,'rows':[]};var _0x5297dd=_[_0x2373('0x2d')](db[_0x2373('0x2e')][_0x2373('0x2f')],function(_0x31db41){return{'name':_0x31db41[_0x2373('0x30')],'type':_0x31db41[_0x2373('0x31')]['key']};});_0x35f637[_0x2373('0x32')]=_[_0x2373('0x2d')](_0x5297dd,_0x2373('0x2a'));_0x35f637[_0x2373('0x33')]=_['keys'](_0x341a79['query']);_0x35f637[_0x2373('0x34')]=_[_0x2373('0x35')](_0x35f637[_0x2373('0x32')],_0x35f637[_0x2373('0x33')]);_0x52cb6f['attributes']=_[_0x2373('0x35')](_0x35f637[_0x2373('0x32')],qs['fields'](_0x341a79['query'][_0x2373('0x36')]));_0x52cb6f[_0x2373('0x37')]=_0x52cb6f['attributes'][_0x2373('0x38')]?_0x52cb6f[_0x2373('0x37')]:_0x35f637['model'];if(!_0x341a79['query'][_0x2373('0x39')](_0x2373('0x3a'))){_0x52cb6f['limit']=qs[_0x2373('0x1f')](_0x341a79[_0x2373('0x33')][_0x2373('0x1f')]);_0x52cb6f[_0x2373('0x1d')]=qs[_0x2373('0x1d')](_0x341a79[_0x2373('0x33')][_0x2373('0x1d')]);}_0x52cb6f[_0x2373('0x3b')]=qs[_0x2373('0x3c')](_0x341a79[_0x2373('0x33')][_0x2373('0x3c')]);_0x52cb6f[_0x2373('0x3d')]=qs[_0x2373('0x34')](_[_0x2373('0x3e')](_0x341a79[_0x2373('0x33')],_0x35f637[_0x2373('0x34')]),_0x5297dd);if(_0x341a79['query'][_0x2373('0x3f')]){_0x52cb6f[_0x2373('0x3d')]=_[_0x2373('0x40')](_0x52cb6f[_0x2373('0x3d')],{'$or':_[_0x2373('0x2d')](_0x5297dd,function(_0x19e9ad){if(_0x19e9ad[_0x2373('0x31')]!==_0x2373('0x41')){var _0x54b9c3={};_0x54b9c3[_0x19e9ad[_0x2373('0x2a')]]={'$like':'%'+_0x341a79['query'][_0x2373('0x3f')]+'%'};return _0x54b9c3;}})});}_0x52cb6f=_[_0x2373('0x40')]({},_0x52cb6f,_0x341a79[_0x2373('0x42')]);var _0x24d371={'where':_0x52cb6f[_0x2373('0x3d')]};return db[_0x2373('0x2e')][_0x2373('0x20')](_0x24d371)[_0x2373('0x26')](function(_0x33eab7){_0x3eacbf[_0x2373('0x20')]=_0x33eab7;if(_0x341a79[_0x2373('0x33')][_0x2373('0x43')]){_0x52cb6f[_0x2373('0x44')]=[{'all':!![]}];}return db[_0x2373('0x2e')][_0x2373('0x45')](_0x52cb6f);})[_0x2373('0x26')](function(_0x1b36c5){_0x3eacbf[_0x2373('0x46')]=_0x1b36c5;return _0x3eacbf;})['then'](respondWithFilteredResult(_0x2dcf78,_0x52cb6f))[_0x2373('0x47')](handleError(_0x2dcf78,null));};exports[_0x2373('0x48')]=function(_0x3afb52,_0x5a8bc8){var _0x4ddba1={'raw':!![],'where':{'id':_0x3afb52[_0x2373('0x49')]['id']}},_0x1ef331={};_0x1ef331['model']=_[_0x2373('0x4a')](db[_0x2373('0x2e')]['rawAttributes']);_0x1ef331[_0x2373('0x33')]=_[_0x2373('0x4a')](_0x3afb52[_0x2373('0x33')]);_0x1ef331[_0x2373('0x34')]=_[_0x2373('0x35')](_0x1ef331['model'],_0x1ef331['query']);_0x4ddba1['attributes']=_[_0x2373('0x35')](_0x1ef331['model'],qs[_0x2373('0x36')](_0x3afb52[_0x2373('0x33')][_0x2373('0x36')]));_0x4ddba1['attributes']=_0x4ddba1[_0x2373('0x37')][_0x2373('0x38')]?_0x4ddba1[_0x2373('0x37')]:_0x1ef331[_0x2373('0x32')];if(_0x3afb52['query'][_0x2373('0x43')]){_0x4ddba1[_0x2373('0x44')]=[{'all':!![]}];}_0x4ddba1=_[_0x2373('0x40')]({},_0x4ddba1,_0x3afb52[_0x2373('0x42')]);return db[_0x2373('0x2e')]['find'](_0x4ddba1)['then'](handleEntityNotFound(_0x5a8bc8,null))['then'](respondWithResult(_0x5a8bc8,null))['catch'](handleError(_0x5a8bc8,null));};exports[_0x2373('0x4b')]=function(_0x3e92da,_0x5172c8){return db[_0x2373('0x2e')]['create'](_0x3e92da[_0x2373('0x4c')],{})[_0x2373('0x26')](function(_0x39c0ad){var _0x354cd0=_0x3e92da[_0x2373('0x4d')][_0x2373('0x4e')]({'plain':!![]});if(!_0x354cd0)throw new Error(_0x2373('0x4f'));if(_0x354cd0['role']===_0x2373('0x4d')){var _0x2ebedf=_0x39c0ad[_0x2373('0x4e')]({'plain':!![]});var _0x452873=_0x2373('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x452873,'userProfileId':_0x354cd0[_0x2373('0x51')]},'raw':!![]})['then'](function(_0x2b041a){if(_0x2b041a&&_0x2b041a[_0x2373('0x52')]===0x0){return db['UserProfileResource'][_0x2373('0x4b')]({'name':_0x2ebedf[_0x2373('0x2a')],'resourceId':_0x2ebedf['id'],'type':_0x2b041a[_0x2373('0x2a')],'sectionId':_0x2b041a['id']},{})[_0x2373('0x26')](function(){return _0x39c0ad;});}else{return _0x39c0ad;}})['catch'](function(_0x525c59){logger[_0x2373('0x53')](_0x2373('0x54'),_0x525c59);throw _0x525c59;});}return _0x39c0ad;})['then'](respondWithResult(_0x5172c8,0xc9))[_0x2373('0x47')](handleError(_0x5172c8,null));};exports[_0x2373('0x25')]=function(_0xb866b3,_0x556708){if(_0xb866b3[_0x2373('0x4c')]['id']){delete _0xb866b3[_0x2373('0x4c')]['id'];}return db['Template'][_0x2373('0x55')]({'where':{'id':_0xb866b3['params']['id']}})[_0x2373('0x26')](handleEntityNotFound(_0x556708,null))[_0x2373('0x26')](saveUpdates(_0xb866b3[_0x2373('0x4c')],null))[_0x2373('0x26')](respondWithResult(_0x556708,null))['catch'](handleError(_0x556708,null));};exports[_0x2373('0x27')]=function(_0x52263e,_0x5a07d1){return db[_0x2373('0x2e')][_0x2373('0x55')]({'where':{'id':_0x52263e['params']['id']}})[_0x2373('0x26')](handleEntityNotFound(_0x5a07d1,null))[_0x2373('0x26')](removeEntity(_0x5a07d1,null))['catch'](handleError(_0x5a07d1,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1de512d..75b81df 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 _0x753e=['tools_templates','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x42e26b,_0x2eeb42){var _0x66917f=function(_0x418012){while(--_0x418012){_0x42e26b['push'](_0x42e26b['shift']());}};_0x66917f(++_0x2eeb42);}(_0x753e,0xb7));var _0xe753=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x753e[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xe753('0x0'));var util=require(_0xe753('0x1'));var logger=require(_0xe753('0x2'))('api');var moment=require(_0xe753('0x3'));var BPromise=require(_0xe753('0x4'));var rp=require(_0xe753('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe753('0x6'));var config=require(_0xe753('0x7'));var attributes=require(_0xe753('0x8'));module[_0xe753('0x9')]=function(_0xf614c6,_0x394bf2){return _0xf614c6[_0xe753('0xa')](_0xe753('0xb'),attributes,{'tableName':_0xe753('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec2f=['path','./template.attributes','exports','define','Template','tools_templates','lodash','util','api','moment','bluebird','request-promise'];(function(_0x7f9b1f,_0x1ddbd6){var _0x1e9df2=function(_0x3bfe92){while(--_0x3bfe92){_0x7f9b1f['push'](_0x7f9b1f['shift']());}};_0x1e9df2(++_0x1ddbd6);}(_0xec2f,0x11a));var _0xfec2=function(_0x7dacfe,_0x23d6a5){_0x7dacfe=_0x7dacfe-0x0;var _0x112a5c=_0xec2f[_0x7dacfe];return _0x112a5c;};'use strict';var _=require(_0xfec2('0x0'));var util=require(_0xfec2('0x1'));var logger=require('../../config/logger')(_0xfec2('0x2'));var moment=require(_0xfec2('0x3'));var BPromise=require(_0xfec2('0x4'));var rp=require(_0xfec2('0x5'));var fs=require('fs');var path=require(_0xfec2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfec2('0x7'));module[_0xfec2('0x8')]=function(_0x16335f,_0x509f94){return _0x16335f[_0xfec2('0x9')](_0xfec2('0xa'),attributes,{'tableName':_0xfec2('0xb'),'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 2cd6206..35f29b7 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 _0xb7c2=['raw','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTemplate','findAll','options'];(function(_0x4a42b7,_0x473fe4){var _0x1c8bb6=function(_0x23d0a3){while(--_0x23d0a3){_0x4a42b7['push'](_0x4a42b7['shift']());}};_0x1c8bb6(++_0x473fe4);}(_0xb7c2,0x13d));var _0x2b7c=function(_0xb5dcc1,_0xf3a85d){_0xb5dcc1=_0xb5dcc1-0x0;var _0x2cb944=_0xb7c2[_0xb5dcc1];return _0x2cb944;};'use strict';var _=require(_0x2b7c('0x0'));var util=require(_0x2b7c('0x1'));var moment=require(_0x2b7c('0x2'));var BPromise=require(_0x2b7c('0x3'));var rs=require(_0x2b7c('0x4'));var fs=require('fs');var Redis=require(_0x2b7c('0x5'));var db=require(_0x2b7c('0x6'))['db'];var utils=require(_0x2b7c('0x7'));var logger=require('../../config/logger')(_0x2b7c('0x8'));var config=require(_0x2b7c('0x9'));var jayson=require(_0x2b7c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8b2630,_0x4a3de2,_0x10ff97){return new BPromise(function(_0x4322b4,_0x47e965){return client[_0x2b7c('0xb')](_0x8b2630,_0x10ff97)[_0x2b7c('0xc')](function(_0x1009a9){logger[_0x2b7c('0xd')](_0x2b7c('0xe'),_0x4a3de2,_0x2b7c('0xf'));logger['debug'](_0x2b7c('0x10'),_0x4a3de2,_0x2b7c('0xf'),JSON[_0x2b7c('0x11')](_0x1009a9));if(_0x1009a9[_0x2b7c('0x12')]){if(_0x1009a9[_0x2b7c('0x12')]['code']===0x1f4){logger[_0x2b7c('0x12')](_0x2b7c('0xe'),_0x4a3de2,_0x1009a9[_0x2b7c('0x12')][_0x2b7c('0x13')]);return _0x47e965(_0x1009a9[_0x2b7c('0x12')]['message']);}logger[_0x2b7c('0x12')](_0x2b7c('0xe'),_0x4a3de2,_0x1009a9[_0x2b7c('0x12')][_0x2b7c('0x13')]);return _0x4322b4(_0x1009a9[_0x2b7c('0x12')][_0x2b7c('0x13')]);}else{logger[_0x2b7c('0xd')](_0x2b7c('0xe'),_0x4a3de2,_0x2b7c('0xf'));_0x4322b4(_0x1009a9['result'][_0x2b7c('0x13')]);}})[_0x2b7c('0x14')](function(_0x450f71){logger[_0x2b7c('0x12')](_0x2b7c('0xe'),_0x4a3de2,_0x450f71);_0x47e965(_0x450f71);});});}exports[_0x2b7c('0x15')]=function(_0x352a00){var _0x2e853a=this;return new Promise(function(_0x2886a1,_0x121d0c){return db['Template'][_0x2b7c('0x16')]({'raw':_0x352a00[_0x2b7c('0x17')]?_0x352a00['options'][_0x2b7c('0x18')]===undefined?!![]:![]:!![],'where':_0x352a00[_0x2b7c('0x17')]?_0x352a00[_0x2b7c('0x17')][_0x2b7c('0x19')]||null:null,'attributes':_0x352a00['options']?_0x352a00[_0x2b7c('0x17')][_0x2b7c('0x1a')]||null:null,'limit':_0x352a00[_0x2b7c('0x17')]?_0x352a00[_0x2b7c('0x17')][_0x2b7c('0x1b')]||null:null,'include':_0x352a00[_0x2b7c('0x17')]?_0x352a00[_0x2b7c('0x17')]['include']?_[_0x2b7c('0x1c')](_0x352a00['options'][_0x2b7c('0x1d')],function(_0x59a403){return{'model':db[_0x59a403[_0x2b7c('0x1e')]],'as':_0x59a403['as'],'attributes':_0x59a403['attributes'],'include':_0x59a403['include']?_[_0x2b7c('0x1c')](_0x59a403[_0x2b7c('0x1d')],function(_0x3c3d5c){return{'model':db[_0x3c3d5c[_0x2b7c('0x1e')]],'as':_0x3c3d5c['as'],'attributes':_0x3c3d5c['attributes'],'include':_0x3c3d5c['include']?_['map'](_0x3c3d5c[_0x2b7c('0x1d')],function(_0x418d5a){return{'model':db[_0x418d5a[_0x2b7c('0x1e')]],'as':_0x418d5a['as'],'attributes':_0x418d5a[_0x2b7c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b7c('0xc')](function(_0x455b10){logger[_0x2b7c('0xd')]('GetTemplate',_0x352a00);logger['debug']('GetTemplate',_0x352a00,JSON[_0x2b7c('0x11')](_0x455b10));_0x2886a1(_0x455b10);})[_0x2b7c('0x14')](function(_0x20ab8){logger[_0x2b7c('0x12')](_0x2b7c('0x15'),_0x20ab8[_0x2b7c('0x13')],_0x352a00);_0x121d0c(_0x2e853a['error'](0x1f4,_0x20ab8[_0x2b7c('0x13')]));});});}; \ No newline at end of file +var _0xaa92=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Template','findAll','options','raw','where','attributes','map','include','model','then','GetTemplate','debug','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5cae20,_0x54f16a){var _0x4f0264=function(_0x4248b3){while(--_0x4248b3){_0x5cae20['push'](_0x5cae20['shift']());}};_0x4f0264(++_0x54f16a);}(_0xaa92,0x166));var _0x2aa9=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0xaa92[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require(_0x2aa9('0x0'));var util=require('util');var moment=require(_0x2aa9('0x1'));var BPromise=require(_0x2aa9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2aa9('0x3'));var db=require(_0x2aa9('0x4'))['db'];var utils=require(_0x2aa9('0x5'));var logger=require(_0x2aa9('0x6'))(_0x2aa9('0x7'));var config=require(_0x2aa9('0x8'));var jayson=require(_0x2aa9('0x9'));var client=jayson[_0x2aa9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22cc57,_0x5eb04c,_0x51c870){return new BPromise(function(_0x26048e,_0x185266){return client[_0x2aa9('0xb')](_0x22cc57,_0x51c870)['then'](function(_0x5c24a6){logger[_0x2aa9('0xc')](_0x2aa9('0xd'),_0x5eb04c,_0x2aa9('0xe'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x5eb04c,_0x2aa9('0xe'),JSON[_0x2aa9('0xf')](_0x5c24a6));if(_0x5c24a6[_0x2aa9('0x10')]){if(_0x5c24a6[_0x2aa9('0x10')][_0x2aa9('0x11')]===0x1f4){logger['error'](_0x2aa9('0xd'),_0x5eb04c,_0x5c24a6[_0x2aa9('0x10')][_0x2aa9('0x12')]);return _0x185266(_0x5c24a6[_0x2aa9('0x10')][_0x2aa9('0x12')]);}logger[_0x2aa9('0x10')](_0x2aa9('0xd'),_0x5eb04c,_0x5c24a6['error'][_0x2aa9('0x12')]);return _0x26048e(_0x5c24a6['error'][_0x2aa9('0x12')]);}else{logger['info'](_0x2aa9('0xd'),_0x5eb04c,'request\x20sent');_0x26048e(_0x5c24a6[_0x2aa9('0x13')][_0x2aa9('0x12')]);}})[_0x2aa9('0x14')](function(_0x532ff6){logger['error']('Template,\x20%s,\x20%s',_0x5eb04c,_0x532ff6);_0x185266(_0x532ff6);});});}exports['GetTemplate']=function(_0x46ee05){var _0x577d9f=this;return new Promise(function(_0x4d67ca,_0x47c1da){return db[_0x2aa9('0x15')][_0x2aa9('0x16')]({'raw':_0x46ee05[_0x2aa9('0x17')]?_0x46ee05['options'][_0x2aa9('0x18')]===undefined?!![]:![]:!![],'where':_0x46ee05[_0x2aa9('0x17')]?_0x46ee05[_0x2aa9('0x17')][_0x2aa9('0x19')]||null:null,'attributes':_0x46ee05[_0x2aa9('0x17')]?_0x46ee05[_0x2aa9('0x17')][_0x2aa9('0x1a')]||null:null,'limit':_0x46ee05['options']?_0x46ee05[_0x2aa9('0x17')]['limit']||null:null,'include':_0x46ee05[_0x2aa9('0x17')]?_0x46ee05[_0x2aa9('0x17')]['include']?_[_0x2aa9('0x1b')](_0x46ee05[_0x2aa9('0x17')][_0x2aa9('0x1c')],function(_0x232e63){return{'model':db[_0x232e63['model']],'as':_0x232e63['as'],'attributes':_0x232e63[_0x2aa9('0x1a')],'include':_0x232e63[_0x2aa9('0x1c')]?_[_0x2aa9('0x1b')](_0x232e63[_0x2aa9('0x1c')],function(_0x27c87b){return{'model':db[_0x27c87b[_0x2aa9('0x1d')]],'as':_0x27c87b['as'],'attributes':_0x27c87b[_0x2aa9('0x1a')],'include':_0x27c87b[_0x2aa9('0x1c')]?_[_0x2aa9('0x1b')](_0x27c87b['include'],function(_0x3495be){return{'model':db[_0x3495be[_0x2aa9('0x1d')]],'as':_0x3495be['as'],'attributes':_0x3495be['attributes']};}):[]};}):[]};}):[]:[]})[_0x2aa9('0x1e')](function(_0x3f80c9){logger['info'](_0x2aa9('0x1f'),_0x46ee05);logger[_0x2aa9('0x20')](_0x2aa9('0x1f'),_0x46ee05,JSON[_0x2aa9('0xf')](_0x3f80c9));_0x4d67ca(_0x3f80c9);})[_0x2aa9('0x14')](function(_0x1e28c8){logger['error'](_0x2aa9('0x1f'),_0x1e28c8['message'],_0x46ee05);_0x47c1da(_0x577d9f[_0x2aa9('0x10')](0x1f4,_0x1e28c8[_0x2aa9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 27cb0e7..24fff0b 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 _0x4227=['get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAction','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller'];(function(_0x3ec5a3,_0x543f15){var _0x29ba50=function(_0x1976fd){while(--_0x1976fd){_0x3ec5a3['push'](_0x3ec5a3['shift']());}};_0x29ba50(++_0x543f15);}(_0x4227,0x89));var _0x7422=function(_0x253d4b,_0x29df93){_0x253d4b=_0x253d4b-0x0;var _0x442cf0=_0x4227[_0x253d4b];return _0x442cf0;};'use strict';var multer=require(_0x7422('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7422('0x1'));var express=require('express');var router=express[_0x7422('0x2')]();var fs_extra=require(_0x7422('0x3'));var auth=require(_0x7422('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7422('0x5'));var controller=require(_0x7422('0x6'));router[_0x7422('0x7')]('/',auth[_0x7422('0x8')](),controller[_0x7422('0x9')]);router[_0x7422('0x7')](_0x7422('0xa'),auth[_0x7422('0x8')](),controller[_0x7422('0xb')]);router['get'](_0x7422('0xc'),auth[_0x7422('0x8')](),controller[_0x7422('0xd')]);router['get'](_0x7422('0xe'),auth['isAuthenticated'](),controller[_0x7422('0xf')]);router[_0x7422('0x7')](_0x7422('0x10'),auth[_0x7422('0x8')](),controller[_0x7422('0x11')]);router['post']('/',auth[_0x7422('0x8')](),controller[_0x7422('0x12')]);router['post'](_0x7422('0xc'),auth[_0x7422('0x8')](),controller['addAllCondition']);router[_0x7422('0x13')](_0x7422('0xe'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x7422('0x13')]('/:id/actions',auth[_0x7422('0x8')](),controller[_0x7422('0x14')]);router['put'](_0x7422('0xa'),auth[_0x7422('0x8')](),controller[_0x7422('0x15')]);router[_0x7422('0x16')](_0x7422('0xa'),auth[_0x7422('0x8')](),controller['destroy']);module[_0x7422('0x17')]=router; \ No newline at end of file +var _0x4030=['index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','/:id/actions','addAction','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4030,0x1ee));var _0x0403=function(_0x2afaf3,_0x4ebf7a){_0x2afaf3=_0x2afaf3-0x0;var _0xf45003=_0x4030[_0x2afaf3];return _0xf45003;};'use strict';var multer=require(_0x0403('0x0'));var util=require(_0x0403('0x1'));var path=require('path');var timeout=require(_0x0403('0x2'));var express=require(_0x0403('0x3'));var router=express[_0x0403('0x4')]();var fs_extra=require(_0x0403('0x5'));var auth=require(_0x0403('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0403('0x7'));var controller=require(_0x0403('0x8'));router['get']('/',auth[_0x0403('0x9')](),controller[_0x0403('0xa')]);router[_0x0403('0xb')]('/:id',auth[_0x0403('0x9')](),controller[_0x0403('0xc')]);router[_0x0403('0xb')](_0x0403('0xd'),auth['isAuthenticated'](),controller[_0x0403('0xe')]);router[_0x0403('0xb')](_0x0403('0xf'),auth['isAuthenticated'](),controller[_0x0403('0x10')]);router[_0x0403('0xb')]('/:id/actions',auth[_0x0403('0x9')](),controller[_0x0403('0x11')]);router[_0x0403('0x12')]('/',auth[_0x0403('0x9')](),controller[_0x0403('0x13')]);router['post'](_0x0403('0xd'),auth[_0x0403('0x9')](),controller[_0x0403('0x14')]);router[_0x0403('0x12')]('/:id/any_conditions',auth[_0x0403('0x9')](),controller['addAnyCondition']);router['post'](_0x0403('0x15'),auth[_0x0403('0x9')](),controller[_0x0403('0x16')]);router[_0x0403('0x17')](_0x0403('0x18'),auth[_0x0403('0x9')](),controller[_0x0403('0x19')]);router[_0x0403('0x1a')](_0x0403('0x18'),auth['isAuthenticated'](),controller[_0x0403('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 50aa63b..2d85527 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 _0x0935=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0935,0x126));var _0x5093=function(_0xe21b94,_0x11c251){_0xe21b94=_0xe21b94-0x0;var _0x4ef3c9=_0x0935[_0xe21b94];return _0x4ef3c9;};'use strict';var Sequelize=require(_0x5093('0x0'));module[_0x5093('0x1')]={'name':{'type':Sequelize[_0x5093('0x2')]},'channel':{'type':Sequelize[_0x5093('0x2')]},'description':{'type':Sequelize[_0x5093('0x2')]},'status':{'type':Sequelize[_0x5093('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c51=['STRING','BOOLEAN'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x6c51,0x19a));var _0x16c5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6c51[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x16c5('0x0')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x16c5('0x0')]},'status':{'type':Sequelize[_0x16c5('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 51dfe69..1ac2968 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 _0x440f=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','count','include','rows','catch','params','includeAll','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Triggers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf'];(function(_0x5e428b,_0x1155f5){var _0x511e59=function(_0x34cb7a){while(--_0x34cb7a){_0x5e428b['push'](_0x5e428b['shift']());}};_0x511e59(++_0x1155f5);}(_0x440f,0x1d9));var _0xf440=function(_0xe47d4,_0x25da81){_0xe47d4=_0xe47d4-0x0;var _0x1b18a0=_0x440f[_0xe47d4];return _0x1b18a0;};'use strict';var emlformat=require(_0xf440('0x0'));var rimraf=require(_0xf440('0x1'));var zipdir=require(_0xf440('0x2'));var jsonpatch=require(_0xf440('0x3'));var rp=require('request-promise');var moment=require(_0xf440('0x4'));var BPromise=require(_0xf440('0x5'));var Mustache=require(_0xf440('0x6'));var util=require(_0xf440('0x7'));var path=require(_0xf440('0x8'));var sox=require(_0xf440('0x9'));var csv=require('to-csv');var ejs=require(_0xf440('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf440('0xb'));var squel=require(_0xf440('0xc'));var crypto=require(_0xf440('0xd'));var jsforce=require(_0xf440('0xe'));var deskjs=require(_0xf440('0xf'));var toCsv=require(_0xf440('0x10'));var querystring=require('querystring');var Papa=require(_0xf440('0x11'));var Redis=require(_0xf440('0x12'));var authService=require(_0xf440('0x13'));var qs=require(_0xf440('0x14'));var as=require(_0xf440('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf440('0x16'));var utils=require(_0xf440('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf440('0x18'));var db=require(_0xf440('0x19'))['db'];function respondWithStatusCode(_0x11a7a7,_0x2acc0b){_0x2acc0b=_0x2acc0b||0xcc;return function(_0x3f5598){if(_0x3f5598){return _0x11a7a7[_0xf440('0x1a')](_0x2acc0b);}return _0x11a7a7[_0xf440('0x1b')](_0x2acc0b)[_0xf440('0x1c')]();};}function respondWithResult(_0x2e67cf,_0x174150){_0x174150=_0x174150||0xc8;return function(_0x2b4b15){if(_0x2b4b15){return _0x2e67cf[_0xf440('0x1b')](_0x174150)[_0xf440('0x1d')](_0x2b4b15);}};}function respondWithFilteredResult(_0x11ed45,_0x2b98f1){return function(_0x5e115d){if(_0x5e115d){var _0x393bb0=typeof _0x2b98f1[_0xf440('0x1e')]==='undefined'&&typeof _0x2b98f1[_0xf440('0x1f')]==='undefined';var _0x120d29=_0x5e115d['count'];var _0x303e7b=_0x393bb0?0x0:_0x2b98f1[_0xf440('0x1e')];var _0x58329e=_0x393bb0?_0x5e115d['count']:_0x2b98f1[_0xf440('0x1e')]+_0x2b98f1[_0xf440('0x1f')];var _0x4c69ac;if(_0x58329e>=_0x120d29){_0x58329e=_0x120d29;_0x4c69ac=0xc8;}else{_0x4c69ac=0xce;}_0x11ed45[_0xf440('0x1b')](_0x4c69ac);return _0x11ed45['set'](_0xf440('0x20'),_0x303e7b+'-'+_0x58329e+'/'+_0x120d29)[_0xf440('0x1d')](_0x5e115d);}return null;};}function patchUpdates(_0x151091){return function(_0x5f5d42){try{jsonpatch[_0xf440('0x21')](_0x5f5d42,_0x151091,!![]);}catch(_0x856a6){return BPromise[_0xf440('0x22')](_0x856a6);}return _0x5f5d42[_0xf440('0x23')]();};}function saveUpdates(_0xdadb2,_0x27aa56){return function(_0x2a350d){if(_0x2a350d){return _0x2a350d[_0xf440('0x24')](_0xdadb2)['then'](function(_0x104418){return _0x104418;});}return null;};}function removeEntity(_0x3757bb,_0x5bd25d){return function(_0x58e298){if(_0x58e298){return _0x58e298[_0xf440('0x25')]()[_0xf440('0x26')](function(){var _0x2fce2f=_0x58e298['get']({'plain':!![]});var _0x1096df='Triggers';return db[_0xf440('0x27')][_0xf440('0x25')]({'where':{'type':_0x1096df,'resourceId':_0x2fce2f['id']}})[_0xf440('0x26')](function(){return _0x58e298;});})['then'](function(){_0x3757bb[_0xf440('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59611b,_0x110939){return function(_0x35e726){if(!_0x35e726){_0x59611b['sendStatus'](0x194);}return _0x35e726;};}function handleError(_0xe17d2a,_0x2188d2){_0x2188d2=_0x2188d2||0x1f4;return function(_0x5a248e){logger[_0xf440('0x28')](_0x5a248e['stack']);if(_0x5a248e[_0xf440('0x29')]){delete _0x5a248e[_0xf440('0x29')];}_0xe17d2a[_0xf440('0x1b')](_0x2188d2)[_0xf440('0x2a')](_0x5a248e);};}exports[_0xf440('0x2b')]=function(_0x543f08,_0x2afe1d){var _0x54c3c1={},_0x377c27={},_0x5d91b0={'count':0x0,'rows':[]};var _0x56e97b=_[_0xf440('0x2c')](db[_0xf440('0x2d')][_0xf440('0x2e')],function(_0x3490a7){return{'name':_0x3490a7[_0xf440('0x2f')],'type':_0x3490a7[_0xf440('0x30')][_0xf440('0x31')]};});_0x377c27[_0xf440('0x32')]=_[_0xf440('0x2c')](_0x56e97b,'name');_0x377c27[_0xf440('0x33')]=_[_0xf440('0x34')](_0x543f08['query']);_0x377c27['filters']=_[_0xf440('0x35')](_0x377c27['model'],_0x377c27[_0xf440('0x33')]);_0x54c3c1[_0xf440('0x36')]=_[_0xf440('0x35')](_0x377c27[_0xf440('0x32')],qs[_0xf440('0x37')](_0x543f08['query']['fields']));_0x54c3c1[_0xf440('0x36')]=_0x54c3c1['attributes'][_0xf440('0x38')]?_0x54c3c1[_0xf440('0x36')]:_0x377c27['model'];if(!_0x543f08[_0xf440('0x33')][_0xf440('0x39')](_0xf440('0x3a'))){_0x54c3c1[_0xf440('0x1f')]=qs[_0xf440('0x1f')](_0x543f08[_0xf440('0x33')][_0xf440('0x1f')]);_0x54c3c1[_0xf440('0x1e')]=qs[_0xf440('0x1e')](_0x543f08[_0xf440('0x33')]['offset']);}_0x54c3c1['order']=qs[_0xf440('0x3b')](_0x543f08[_0xf440('0x33')][_0xf440('0x3b')]);_0x54c3c1['where']=qs[_0xf440('0x3c')](_[_0xf440('0x3d')](_0x543f08[_0xf440('0x33')],_0x377c27[_0xf440('0x3c')]),_0x56e97b);if(_0x543f08['query'][_0xf440('0x3e')]){_0x54c3c1[_0xf440('0x3f')]=_[_0xf440('0x40')](_0x54c3c1['where'],{'$or':_[_0xf440('0x2c')](_0x56e97b,function(_0x55271f){if(_0x55271f['type']!==_0xf440('0x41')){var _0x716e8e={};_0x716e8e[_0x55271f[_0xf440('0x29')]]={'$like':'%'+_0x543f08[_0xf440('0x33')][_0xf440('0x3e')]+'%'};return _0x716e8e;}})});}_0x54c3c1=_[_0xf440('0x40')]({},_0x54c3c1,_0x543f08['options']);var _0x3df7a9={'where':_0x54c3c1[_0xf440('0x3f')]};return db[_0xf440('0x2d')]['count'](_0x3df7a9)[_0xf440('0x26')](function(_0x502887){_0x5d91b0[_0xf440('0x42')]=_0x502887;if(_0x543f08['query']['includeAll']){_0x54c3c1[_0xf440('0x43')]=[{'all':!![]}];}return db[_0xf440('0x2d')]['findAll'](_0x54c3c1);})['then'](function(_0x408eae){_0x5d91b0[_0xf440('0x44')]=_0x408eae;return _0x5d91b0;})[_0xf440('0x26')](respondWithFilteredResult(_0x2afe1d,_0x54c3c1))[_0xf440('0x45')](handleError(_0x2afe1d,null));};exports['show']=function(_0x527183,_0x572a41){var _0x3a3e56={'raw':![],'where':{'id':_0x527183[_0xf440('0x46')]['id']}},_0x660adc={};_0x660adc[_0xf440('0x32')]=_[_0xf440('0x34')](db['Trigger']['rawAttributes']);_0x660adc[_0xf440('0x33')]=_[_0xf440('0x34')](_0x527183[_0xf440('0x33')]);_0x660adc['filters']=_['intersection'](_0x660adc['model'],_0x660adc[_0xf440('0x33')]);_0x3a3e56[_0xf440('0x36')]=_[_0xf440('0x35')](_0x660adc[_0xf440('0x32')],qs[_0xf440('0x37')](_0x527183['query'][_0xf440('0x37')]));_0x3a3e56[_0xf440('0x36')]=_0x3a3e56[_0xf440('0x36')]['length']?_0x3a3e56[_0xf440('0x36')]:_0x660adc['model'];if(_0x527183[_0xf440('0x33')][_0xf440('0x47')]){_0x3a3e56[_0xf440('0x43')]=[{'all':!![]}];}_0x3a3e56=_[_0xf440('0x40')]({},_0x3a3e56,_0x527183[_0xf440('0x48')]);return db[_0xf440('0x2d')]['find'](_0x3a3e56)[_0xf440('0x26')](handleEntityNotFound(_0x572a41,null))['then'](respondWithResult(_0x572a41,null))['catch'](handleError(_0x572a41,null));};exports[_0xf440('0x49')]=function(_0x422dbd,_0x29cf30){return db[_0xf440('0x2d')]['create'](_0x422dbd['body'],{})[_0xf440('0x26')](function(_0x1c5779){var _0x336742=_0x422dbd['user'][_0xf440('0x4a')]({'plain':!![]});if(!_0x336742)throw new Error(_0xf440('0x4b'));if(_0x336742['role']===_0xf440('0x4c')){var _0x681af7=_0x1c5779[_0xf440('0x4a')]({'plain':!![]});var _0x561c19=_0xf440('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x561c19,'userProfileId':_0x336742[_0xf440('0x4e')]},'raw':!![]})[_0xf440('0x26')](function(_0x172a91){if(_0x172a91&&_0x172a91[_0xf440('0x4f')]===0x0){return db['UserProfileResource'][_0xf440('0x49')]({'name':_0x681af7['name'],'resourceId':_0x681af7['id'],'type':_0x172a91[_0xf440('0x29')],'sectionId':_0x172a91['id']},{})[_0xf440('0x26')](function(){return _0x1c5779;});}else{return _0x1c5779;}})[_0xf440('0x45')](function(_0x146cf8){logger['error'](_0xf440('0x50'),_0x146cf8);throw _0x146cf8;});}return _0x1c5779;})[_0xf440('0x26')](respondWithResult(_0x29cf30,0xc9))[_0xf440('0x45')](handleError(_0x29cf30,null));};exports[_0xf440('0x24')]=function(_0x1f3b41,_0x22bea5){if(_0x1f3b41[_0xf440('0x51')]['id']){delete _0x1f3b41[_0xf440('0x51')]['id'];}return db[_0xf440('0x2d')]['find']({'where':{'id':_0x1f3b41[_0xf440('0x46')]['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x22bea5,null))[_0xf440('0x26')](saveUpdates(_0x1f3b41[_0xf440('0x51')],null))[_0xf440('0x26')](respondWithResult(_0x22bea5,null))[_0xf440('0x45')](handleError(_0x22bea5,null));};exports[_0xf440('0x25')]=function(_0x3752ef,_0x1500c9){return db[_0xf440('0x2d')][_0xf440('0x52')]({'where':{'id':_0x3752ef['params']['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x1500c9,null))['then'](removeEntity(_0x1500c9,null))[_0xf440('0x45')](handleError(_0x1500c9,null));};exports[_0xf440('0x53')]=function(_0x3cf431,_0x3d5715,_0x11f5cb){if(_0x3cf431[_0xf440('0x51')]['id']){delete _0x3cf431[_0xf440('0x51')]['id'];}return db[_0xf440('0x2d')]['find']({'where':{'id':_0x3cf431['params']['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x3d5715,null))['then'](function(_0x26ce0f){if(_0x26ce0f){_0x3cf431[_0xf440('0x51')][_0xf440('0x54')]=_0x26ce0f['id'];return db[_0xf440('0x55')][_0xf440('0x49')](_0x3cf431[_0xf440('0x51')]);}})[_0xf440('0x26')](respondWithResult(_0x3d5715,null))[_0xf440('0x45')](handleError(_0x3d5715,null));};exports[_0xf440('0x56')]=function(_0x444423,_0x52d13a,_0x18bac){if(_0x444423['body']['id']){delete _0x444423[_0xf440('0x51')]['id'];}return db[_0xf440('0x2d')][_0xf440('0x52')]({'where':{'id':_0x444423[_0xf440('0x46')]['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x52d13a,null))[_0xf440('0x26')](function(_0x40e198){if(_0x40e198){_0x444423[_0xf440('0x51')][_0xf440('0x57')]=_0x40e198['id'];return db[_0xf440('0x55')]['create'](_0x444423[_0xf440('0x51')]);}})[_0xf440('0x26')](respondWithResult(_0x52d13a,null))['catch'](handleError(_0x52d13a,null));};exports['getAllConditions']=function(_0x4bb683,_0x423255,_0x45757e){var _0xef09e5={};var _0x57b5fd={};var _0xd249c5;var _0x496a86;return db['Trigger'][_0xf440('0x58')]({'where':{'id':_0x4bb683[_0xf440('0x46')]['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x423255,null))['then'](function(_0x144ba4){if(_0x144ba4){_0xd249c5=_0x144ba4;_0x57b5fd[_0xf440('0x32')]=_[_0xf440('0x34')](db['Condition'][_0xf440('0x2e')]);_0x57b5fd[_0xf440('0x33')]=_[_0xf440('0x34')](_0x4bb683[_0xf440('0x33')]);_0x57b5fd['filters']=_[_0xf440('0x35')](_0x57b5fd[_0xf440('0x32')],_0x57b5fd[_0xf440('0x33')]);_0xef09e5[_0xf440('0x36')]=_[_0xf440('0x35')](_0x57b5fd[_0xf440('0x32')],qs['fields'](_0x4bb683[_0xf440('0x33')]['fields']));_0xef09e5['attributes']=_0xef09e5[_0xf440('0x36')][_0xf440('0x38')]?_0xef09e5[_0xf440('0x36')]:_0x57b5fd[_0xf440('0x32')];_0xef09e5['order']=qs[_0xf440('0x3b')](_0x4bb683['query'][_0xf440('0x3b')]);_0xef09e5[_0xf440('0x3f')]=qs[_0xf440('0x3c')](_[_0xf440('0x3d')](_0x4bb683[_0xf440('0x33')],_0x57b5fd[_0xf440('0x3c')]));if(_0x4bb683['query'][_0xf440('0x3e')]){_0xef09e5['where']=_['merge'](_0xef09e5[_0xf440('0x3f')],{'$or':_[_0xf440('0x2c')](_0xef09e5[_0xf440('0x36')],function(_0x2fcb3d){var _0x2f6f12={};_0x2f6f12[_0x2fcb3d]={'$like':'%'+_0x4bb683['query']['filter']+'%'};return _0x2f6f12;})});}_0xef09e5=_[_0xf440('0x40')]({},_0xef09e5,_0x4bb683[_0xf440('0x48')]);return _0xd249c5['getAllConditions'](_0xef09e5);}})[_0xf440('0x26')](function(_0x48d25d){if(_0x48d25d){_0x496a86=_0x48d25d[_0xf440('0x38')];if(!_0x4bb683['query'][_0xf440('0x39')](_0xf440('0x3a'))){_0xef09e5[_0xf440('0x1f')]=qs['limit'](_0x4bb683[_0xf440('0x33')][_0xf440('0x1f')]);_0xef09e5[_0xf440('0x1e')]=qs['offset'](_0x4bb683[_0xf440('0x33')]['offset']);}return _0xd249c5['getAllConditions'](_0xef09e5);}})[_0xf440('0x26')](function(_0x4fdbe6){if(_0x4fdbe6){return _0x4fdbe6?{'count':_0x496a86,'rows':_0x4fdbe6}:null;}})['then'](respondWithResult(_0x423255,null))['catch'](handleError(_0x423255,null));};exports['getAnyConditions']=function(_0x38396e,_0x55bfaf,_0x100d7a){var _0x5213a5={};var _0x109e49={};var _0x56f91e;var _0x44a600;return db[_0xf440('0x2d')][_0xf440('0x58')]({'where':{'id':_0x38396e[_0xf440('0x46')]['id']}})['then'](handleEntityNotFound(_0x55bfaf,null))[_0xf440('0x26')](function(_0x48c7ba){if(_0x48c7ba){_0x56f91e=_0x48c7ba;_0x109e49['model']=_[_0xf440('0x34')](db[_0xf440('0x55')][_0xf440('0x2e')]);_0x109e49['query']=_[_0xf440('0x34')](_0x38396e[_0xf440('0x33')]);_0x109e49[_0xf440('0x3c')]=_[_0xf440('0x35')](_0x109e49[_0xf440('0x32')],_0x109e49[_0xf440('0x33')]);_0x5213a5['attributes']=_[_0xf440('0x35')](_0x109e49[_0xf440('0x32')],qs[_0xf440('0x37')](_0x38396e[_0xf440('0x33')][_0xf440('0x37')]));_0x5213a5['attributes']=_0x5213a5[_0xf440('0x36')][_0xf440('0x38')]?_0x5213a5[_0xf440('0x36')]:_0x109e49[_0xf440('0x32')];_0x5213a5[_0xf440('0x59')]=qs['sort'](_0x38396e[_0xf440('0x33')][_0xf440('0x3b')]);_0x5213a5['where']=qs[_0xf440('0x3c')](_[_0xf440('0x3d')](_0x38396e[_0xf440('0x33')],_0x109e49[_0xf440('0x3c')]));if(_0x38396e[_0xf440('0x33')][_0xf440('0x3e')]){_0x5213a5[_0xf440('0x3f')]=_['merge'](_0x5213a5['where'],{'$or':_['map'](_0x5213a5[_0xf440('0x36')],function(_0x141b18){var _0x5221cf={};_0x5221cf[_0x141b18]={'$like':'%'+_0x38396e['query'][_0xf440('0x3e')]+'%'};return _0x5221cf;})});}_0x5213a5=_[_0xf440('0x40')]({},_0x5213a5,_0x38396e[_0xf440('0x48')]);return _0x56f91e[_0xf440('0x5a')](_0x5213a5);}})[_0xf440('0x26')](function(_0x5d5265){if(_0x5d5265){_0x44a600=_0x5d5265['length'];if(!_0x38396e['query'][_0xf440('0x39')]('nolimit')){_0x5213a5['limit']=qs[_0xf440('0x1f')](_0x38396e[_0xf440('0x33')][_0xf440('0x1f')]);_0x5213a5['offset']=qs[_0xf440('0x1e')](_0x38396e[_0xf440('0x33')][_0xf440('0x1e')]);}return _0x56f91e[_0xf440('0x5a')](_0x5213a5);}})[_0xf440('0x26')](function(_0x5df725){if(_0x5df725){return _0x5df725?{'count':_0x44a600,'rows':_0x5df725}:null;}})[_0xf440('0x26')](respondWithResult(_0x55bfaf,null))[_0xf440('0x45')](handleError(_0x55bfaf,null));};exports[_0xf440('0x5b')]=function(_0xaf7529,_0x2eb943,_0x2fe7c3){if(_0xaf7529[_0xf440('0x51')]['id']){delete _0xaf7529[_0xf440('0x51')]['id'];}return db[_0xf440('0x2d')]['find']({'where':{'id':_0xaf7529['params']['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x2eb943,null))[_0xf440('0x26')](function(_0x3c8841){if(_0x3c8841){_0xaf7529['body'][_0xf440('0x5c')]=_0x3c8841['id'];return db[_0xf440('0x5d')][_0xf440('0x49')](_0xaf7529[_0xf440('0x51')]);}})[_0xf440('0x26')](respondWithResult(_0x2eb943,null))[_0xf440('0x45')](handleError(_0x2eb943,null));};exports[_0xf440('0x5e')]=function(_0x3fa2a8,_0x2525f4,_0x360a7e){var _0x40c577={};var _0x2032bd={};var _0x31686f;var _0x36140c;return db[_0xf440('0x2d')]['findOne']({'where':{'id':_0x3fa2a8[_0xf440('0x46')]['id']}})[_0xf440('0x26')](handleEntityNotFound(_0x2525f4,null))[_0xf440('0x26')](function(_0x15e298){if(_0x15e298){_0x31686f=_0x15e298;_0x2032bd[_0xf440('0x32')]=_[_0xf440('0x34')](db[_0xf440('0x5d')]['rawAttributes']);_0x2032bd[_0xf440('0x33')]=_[_0xf440('0x34')](_0x3fa2a8[_0xf440('0x33')]);_0x2032bd[_0xf440('0x3c')]=_[_0xf440('0x35')](_0x2032bd[_0xf440('0x32')],_0x2032bd[_0xf440('0x33')]);_0x40c577[_0xf440('0x36')]=_[_0xf440('0x35')](_0x2032bd[_0xf440('0x32')],qs[_0xf440('0x37')](_0x3fa2a8[_0xf440('0x33')][_0xf440('0x37')]));_0x40c577[_0xf440('0x36')]=_0x40c577[_0xf440('0x36')][_0xf440('0x38')]?_0x40c577[_0xf440('0x36')]:_0x2032bd[_0xf440('0x32')];_0x40c577[_0xf440('0x59')]=qs[_0xf440('0x3b')](_0x3fa2a8[_0xf440('0x33')][_0xf440('0x3b')]);_0x40c577[_0xf440('0x3f')]=qs[_0xf440('0x3c')](_[_0xf440('0x3d')](_0x3fa2a8[_0xf440('0x33')],_0x2032bd['filters']));if(_0x3fa2a8[_0xf440('0x33')]['filter']){_0x40c577['where']=_[_0xf440('0x40')](_0x40c577[_0xf440('0x3f')],{'$or':_['map'](_0x40c577['attributes'],function(_0x34c081){var _0x4120d7={};_0x4120d7[_0x34c081]={'$like':'%'+_0x3fa2a8[_0xf440('0x33')][_0xf440('0x3e')]+'%'};return _0x4120d7;})});}_0x40c577=_['merge']({},_0x40c577,_0x3fa2a8[_0xf440('0x48')]);return _0x31686f[_0xf440('0x5e')](_0x40c577);}})[_0xf440('0x26')](function(_0x33d274){if(_0x33d274){_0x36140c=_0x33d274[_0xf440('0x38')];if(!_0x3fa2a8[_0xf440('0x33')]['hasOwnProperty'](_0xf440('0x3a'))){_0x40c577[_0xf440('0x1f')]=qs[_0xf440('0x1f')](_0x3fa2a8['query'][_0xf440('0x1f')]);_0x40c577['offset']=qs[_0xf440('0x1e')](_0x3fa2a8[_0xf440('0x33')][_0xf440('0x1e')]);}return _0x31686f[_0xf440('0x5e')](_0x40c577);}})['then'](function(_0x53e8b6){if(_0x53e8b6){return _0x53e8b6?{'count':_0x36140c,'rows':_0x53e8b6}:null;}})['then'](respondWithResult(_0x2525f4,null))[_0xf440('0x45')](handleError(_0x2525f4,null));}; \ No newline at end of file +var _0x6b97=['map','Trigger','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','getAllConditions','findOne','Condition','rawAttributes','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','Triggers','UserProfileResource','sendStatus','error','stack','name','index'];(function(_0x551b51,_0x2b0479){var _0x49a306=function(_0x52572c){while(--_0x52572c){_0x551b51['push'](_0x551b51['shift']());}};_0x49a306(++_0x2b0479);}(_0x6b97,0x1b6));var _0x76b9=function(_0x1291c1,_0x1d4506){_0x1291c1=_0x1291c1-0x0;var _0x11dc13=_0x6b97[_0x1291c1];return _0x11dc13;};'use strict';var emlformat=require(_0x76b9('0x0'));var rimraf=require(_0x76b9('0x1'));var zipdir=require(_0x76b9('0x2'));var jsonpatch=require(_0x76b9('0x3'));var rp=require(_0x76b9('0x4'));var moment=require(_0x76b9('0x5'));var BPromise=require(_0x76b9('0x6'));var Mustache=require(_0x76b9('0x7'));var util=require(_0x76b9('0x8'));var path=require(_0x76b9('0x9'));var sox=require(_0x76b9('0xa'));var csv=require(_0x76b9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76b9('0xc'));var _=require(_0x76b9('0xd'));var squel=require(_0x76b9('0xe'));var crypto=require(_0x76b9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76b9('0xb'));var querystring=require(_0x76b9('0x10'));var Papa=require(_0x76b9('0x11'));var Redis=require(_0x76b9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x76b9('0x13'));var as=require(_0x76b9('0x14'));var hardwareService=require(_0x76b9('0x15'));var logger=require(_0x76b9('0x16'))(_0x76b9('0x17'));var utils=require(_0x76b9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x76b9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46d9b7,_0x43b955){_0x43b955=_0x43b955||0xcc;return function(_0x1e15af){if(_0x1e15af){return _0x46d9b7['sendStatus'](_0x43b955);}return _0x46d9b7[_0x76b9('0x1a')](_0x43b955)[_0x76b9('0x1b')]();};}function respondWithResult(_0x3ed5b4,_0x3f39fc){_0x3f39fc=_0x3f39fc||0xc8;return function(_0x39a515){if(_0x39a515){return _0x3ed5b4['status'](_0x3f39fc)[_0x76b9('0x1c')](_0x39a515);}};}function respondWithFilteredResult(_0x2d5cbf,_0x28ae96){return function(_0x4454a0){if(_0x4454a0){var _0x51338c=typeof _0x28ae96[_0x76b9('0x1d')]===_0x76b9('0x1e')&&typeof _0x28ae96[_0x76b9('0x1f')]===_0x76b9('0x1e');var _0x4ac67e=_0x4454a0[_0x76b9('0x20')];var _0x16a7f9=_0x51338c?0x0:_0x28ae96[_0x76b9('0x1d')];var _0x51e77e=_0x51338c?_0x4454a0['count']:_0x28ae96[_0x76b9('0x1d')]+_0x28ae96[_0x76b9('0x1f')];var _0x580b49;if(_0x51e77e>=_0x4ac67e){_0x51e77e=_0x4ac67e;_0x580b49=0xc8;}else{_0x580b49=0xce;}_0x2d5cbf['status'](_0x580b49);return _0x2d5cbf[_0x76b9('0x21')](_0x76b9('0x22'),_0x16a7f9+'-'+_0x51e77e+'/'+_0x4ac67e)['json'](_0x4454a0);}return null;};}function patchUpdates(_0x2c3d2f){return function(_0x1bc385){try{jsonpatch[_0x76b9('0x23')](_0x1bc385,_0x2c3d2f,!![]);}catch(_0xca8d34){return BPromise[_0x76b9('0x24')](_0xca8d34);}return _0x1bc385[_0x76b9('0x25')]();};}function saveUpdates(_0x101ebf,_0x5cbc96){return function(_0x1afb04){if(_0x1afb04){return _0x1afb04['update'](_0x101ebf)['then'](function(_0xf85e5c){return _0xf85e5c;});}return null;};}function removeEntity(_0x270c5b,_0x550cbc){return function(_0x2b3d79){if(_0x2b3d79){return _0x2b3d79[_0x76b9('0x26')]()[_0x76b9('0x27')](function(){var _0x3371d7=_0x2b3d79['get']({'plain':!![]});var _0x3a16a3=_0x76b9('0x28');return db[_0x76b9('0x29')][_0x76b9('0x26')]({'where':{'type':_0x3a16a3,'resourceId':_0x3371d7['id']}})['then'](function(){return _0x2b3d79;});})[_0x76b9('0x27')](function(){_0x270c5b[_0x76b9('0x1a')](0xcc)[_0x76b9('0x1b')]();});}};}function handleEntityNotFound(_0xfc8a2b,_0x30ca0d){return function(_0x25607f){if(!_0x25607f){_0xfc8a2b[_0x76b9('0x2a')](0x194);}return _0x25607f;};}function handleError(_0x1bb941,_0x2668c5){_0x2668c5=_0x2668c5||0x1f4;return function(_0x2117de){logger[_0x76b9('0x2b')](_0x2117de[_0x76b9('0x2c')]);if(_0x2117de[_0x76b9('0x2d')]){delete _0x2117de[_0x76b9('0x2d')];}_0x1bb941[_0x76b9('0x1a')](_0x2668c5)['send'](_0x2117de);};}exports[_0x76b9('0x2e')]=function(_0x59f53e,_0x5ec473){var _0x556c3f={},_0x1a516f={},_0x1613f5={'count':0x0,'rows':[]};var _0xfc77b6=_[_0x76b9('0x2f')](db[_0x76b9('0x30')]['rawAttributes'],function(_0x5e9a6f){return{'name':_0x5e9a6f['fieldName'],'type':_0x5e9a6f[_0x76b9('0x31')][_0x76b9('0x32')]};});_0x1a516f['model']=_[_0x76b9('0x2f')](_0xfc77b6,_0x76b9('0x2d'));_0x1a516f[_0x76b9('0x33')]=_[_0x76b9('0x34')](_0x59f53e[_0x76b9('0x33')]);_0x1a516f[_0x76b9('0x35')]=_[_0x76b9('0x36')](_0x1a516f['model'],_0x1a516f[_0x76b9('0x33')]);_0x556c3f[_0x76b9('0x37')]=_[_0x76b9('0x36')](_0x1a516f[_0x76b9('0x38')],qs[_0x76b9('0x39')](_0x59f53e['query'][_0x76b9('0x39')]));_0x556c3f[_0x76b9('0x37')]=_0x556c3f[_0x76b9('0x37')][_0x76b9('0x3a')]?_0x556c3f[_0x76b9('0x37')]:_0x1a516f['model'];if(!_0x59f53e[_0x76b9('0x33')][_0x76b9('0x3b')](_0x76b9('0x3c'))){_0x556c3f[_0x76b9('0x1f')]=qs[_0x76b9('0x1f')](_0x59f53e[_0x76b9('0x33')][_0x76b9('0x1f')]);_0x556c3f[_0x76b9('0x1d')]=qs[_0x76b9('0x1d')](_0x59f53e[_0x76b9('0x33')][_0x76b9('0x1d')]);}_0x556c3f[_0x76b9('0x3d')]=qs['sort'](_0x59f53e[_0x76b9('0x33')][_0x76b9('0x3e')]);_0x556c3f[_0x76b9('0x3f')]=qs[_0x76b9('0x35')](_[_0x76b9('0x40')](_0x59f53e[_0x76b9('0x33')],_0x1a516f[_0x76b9('0x35')]),_0xfc77b6);if(_0x59f53e['query']['filter']){_0x556c3f['where']=_[_0x76b9('0x41')](_0x556c3f[_0x76b9('0x3f')],{'$or':_[_0x76b9('0x2f')](_0xfc77b6,function(_0x1482cf){if(_0x1482cf[_0x76b9('0x31')]!==_0x76b9('0x42')){var _0x593a2e={};_0x593a2e[_0x1482cf[_0x76b9('0x2d')]]={'$like':'%'+_0x59f53e['query'][_0x76b9('0x43')]+'%'};return _0x593a2e;}})});}_0x556c3f=_[_0x76b9('0x41')]({},_0x556c3f,_0x59f53e[_0x76b9('0x44')]);var _0x334ae8={'where':_0x556c3f['where']};return db[_0x76b9('0x30')][_0x76b9('0x20')](_0x334ae8)[_0x76b9('0x27')](function(_0x1e21f4){_0x1613f5['count']=_0x1e21f4;if(_0x59f53e[_0x76b9('0x33')][_0x76b9('0x45')]){_0x556c3f[_0x76b9('0x46')]=[{'all':!![]}];}return db[_0x76b9('0x30')][_0x76b9('0x47')](_0x556c3f);})[_0x76b9('0x27')](function(_0x53d65a){_0x1613f5[_0x76b9('0x48')]=_0x53d65a;return _0x1613f5;})[_0x76b9('0x27')](respondWithFilteredResult(_0x5ec473,_0x556c3f))[_0x76b9('0x49')](handleError(_0x5ec473,null));};exports[_0x76b9('0x4a')]=function(_0x198a3e,_0x4275a6){var _0x1b2913={'raw':![],'where':{'id':_0x198a3e[_0x76b9('0x4b')]['id']}},_0x84a437={};_0x84a437['model']=_[_0x76b9('0x34')](db[_0x76b9('0x30')]['rawAttributes']);_0x84a437[_0x76b9('0x33')]=_[_0x76b9('0x34')](_0x198a3e['query']);_0x84a437[_0x76b9('0x35')]=_['intersection'](_0x84a437[_0x76b9('0x38')],_0x84a437[_0x76b9('0x33')]);_0x1b2913['attributes']=_['intersection'](_0x84a437['model'],qs[_0x76b9('0x39')](_0x198a3e[_0x76b9('0x33')][_0x76b9('0x39')]));_0x1b2913[_0x76b9('0x37')]=_0x1b2913[_0x76b9('0x37')][_0x76b9('0x3a')]?_0x1b2913['attributes']:_0x84a437[_0x76b9('0x38')];if(_0x198a3e[_0x76b9('0x33')][_0x76b9('0x45')]){_0x1b2913[_0x76b9('0x46')]=[{'all':!![]}];}_0x1b2913=_[_0x76b9('0x41')]({},_0x1b2913,_0x198a3e['options']);return db[_0x76b9('0x30')][_0x76b9('0x4c')](_0x1b2913)[_0x76b9('0x27')](handleEntityNotFound(_0x4275a6,null))[_0x76b9('0x27')](respondWithResult(_0x4275a6,null))[_0x76b9('0x49')](handleError(_0x4275a6,null));};exports[_0x76b9('0x4d')]=function(_0x2db7dd,_0x49aa9a){return db[_0x76b9('0x30')][_0x76b9('0x4d')](_0x2db7dd[_0x76b9('0x4e')],{})[_0x76b9('0x27')](function(_0x4686a1){var _0xad378c=_0x2db7dd[_0x76b9('0x4f')][_0x76b9('0x50')]({'plain':!![]});if(!_0xad378c)throw new Error(_0x76b9('0x51'));if(_0xad378c[_0x76b9('0x52')]===_0x76b9('0x4f')){var _0x372443=_0x4686a1[_0x76b9('0x50')]({'plain':!![]});var _0x1c7a58=_0x76b9('0x28');return db[_0x76b9('0x53')][_0x76b9('0x4c')]({'where':{'name':_0x1c7a58,'userProfileId':_0xad378c[_0x76b9('0x54')]},'raw':!![]})['then'](function(_0x2e8514){if(_0x2e8514&&_0x2e8514['autoAssociation']===0x0){return db[_0x76b9('0x29')][_0x76b9('0x4d')]({'name':_0x372443[_0x76b9('0x2d')],'resourceId':_0x372443['id'],'type':_0x2e8514[_0x76b9('0x2d')],'sectionId':_0x2e8514['id']},{})['then'](function(){return _0x4686a1;});}else{return _0x4686a1;}})[_0x76b9('0x49')](function(_0x1e1578){logger['error'](_0x76b9('0x55'),_0x1e1578);throw _0x1e1578;});}return _0x4686a1;})['then'](respondWithResult(_0x49aa9a,0xc9))[_0x76b9('0x49')](handleError(_0x49aa9a,null));};exports[_0x76b9('0x56')]=function(_0x110d13,_0x354f93){if(_0x110d13[_0x76b9('0x4e')]['id']){delete _0x110d13[_0x76b9('0x4e')]['id'];}return db['Trigger'][_0x76b9('0x4c')]({'where':{'id':_0x110d13['params']['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x354f93,null))[_0x76b9('0x27')](saveUpdates(_0x110d13[_0x76b9('0x4e')],null))[_0x76b9('0x27')](respondWithResult(_0x354f93,null))[_0x76b9('0x49')](handleError(_0x354f93,null));};exports[_0x76b9('0x26')]=function(_0x55c63b,_0x32d6db){return db[_0x76b9('0x30')]['find']({'where':{'id':_0x55c63b[_0x76b9('0x4b')]['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x32d6db,null))[_0x76b9('0x27')](removeEntity(_0x32d6db,null))[_0x76b9('0x49')](handleError(_0x32d6db,null));};exports[_0x76b9('0x57')]=function(_0x4c3732,_0x229068,_0x4332a8){if(_0x4c3732[_0x76b9('0x4e')]['id']){delete _0x4c3732[_0x76b9('0x4e')]['id'];}return db[_0x76b9('0x30')][_0x76b9('0x4c')]({'where':{'id':_0x4c3732[_0x76b9('0x4b')]['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x229068,null))['then'](function(_0x4dbc3e){if(_0x4dbc3e){_0x4c3732[_0x76b9('0x4e')][_0x76b9('0x58')]=_0x4dbc3e['id'];return db['Condition'][_0x76b9('0x4d')](_0x4c3732[_0x76b9('0x4e')]);}})[_0x76b9('0x27')](respondWithResult(_0x229068,null))[_0x76b9('0x49')](handleError(_0x229068,null));};exports['addAnyCondition']=function(_0x7b391c,_0x50bd8e,_0x4bd9d4){if(_0x7b391c['body']['id']){delete _0x7b391c['body']['id'];}return db[_0x76b9('0x30')][_0x76b9('0x4c')]({'where':{'id':_0x7b391c['params']['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x50bd8e,null))[_0x76b9('0x27')](function(_0x1bc5ce){if(_0x1bc5ce){_0x7b391c[_0x76b9('0x4e')]['TriggerAnyId']=_0x1bc5ce['id'];return db['Condition'][_0x76b9('0x4d')](_0x7b391c['body']);}})[_0x76b9('0x27')](respondWithResult(_0x50bd8e,null))[_0x76b9('0x49')](handleError(_0x50bd8e,null));};exports[_0x76b9('0x59')]=function(_0x571c5c,_0x397059,_0x17c1fd){var _0x36ffba={};var _0x40b14e={};var _0x4ce8b8;var _0x14624c;return db[_0x76b9('0x30')][_0x76b9('0x5a')]({'where':{'id':_0x571c5c[_0x76b9('0x4b')]['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x397059,null))['then'](function(_0x30a63b){if(_0x30a63b){_0x4ce8b8=_0x30a63b;_0x40b14e['model']=_[_0x76b9('0x34')](db[_0x76b9('0x5b')][_0x76b9('0x5c')]);_0x40b14e[_0x76b9('0x33')]=_[_0x76b9('0x34')](_0x571c5c[_0x76b9('0x33')]);_0x40b14e[_0x76b9('0x35')]=_[_0x76b9('0x36')](_0x40b14e['model'],_0x40b14e['query']);_0x36ffba[_0x76b9('0x37')]=_['intersection'](_0x40b14e[_0x76b9('0x38')],qs[_0x76b9('0x39')](_0x571c5c[_0x76b9('0x33')][_0x76b9('0x39')]));_0x36ffba[_0x76b9('0x37')]=_0x36ffba[_0x76b9('0x37')]['length']?_0x36ffba['attributes']:_0x40b14e[_0x76b9('0x38')];_0x36ffba[_0x76b9('0x3d')]=qs[_0x76b9('0x3e')](_0x571c5c[_0x76b9('0x33')][_0x76b9('0x3e')]);_0x36ffba[_0x76b9('0x3f')]=qs[_0x76b9('0x35')](_[_0x76b9('0x40')](_0x571c5c[_0x76b9('0x33')],_0x40b14e[_0x76b9('0x35')]));if(_0x571c5c['query'][_0x76b9('0x43')]){_0x36ffba['where']=_['merge'](_0x36ffba[_0x76b9('0x3f')],{'$or':_[_0x76b9('0x2f')](_0x36ffba[_0x76b9('0x37')],function(_0x330c22){var _0x264a99={};_0x264a99[_0x330c22]={'$like':'%'+_0x571c5c[_0x76b9('0x33')][_0x76b9('0x43')]+'%'};return _0x264a99;})});}_0x36ffba=_[_0x76b9('0x41')]({},_0x36ffba,_0x571c5c['options']);return _0x4ce8b8[_0x76b9('0x59')](_0x36ffba);}})[_0x76b9('0x27')](function(_0x74d540){if(_0x74d540){_0x14624c=_0x74d540[_0x76b9('0x3a')];if(!_0x571c5c[_0x76b9('0x33')]['hasOwnProperty'](_0x76b9('0x3c'))){_0x36ffba['limit']=qs[_0x76b9('0x1f')](_0x571c5c[_0x76b9('0x33')][_0x76b9('0x1f')]);_0x36ffba[_0x76b9('0x1d')]=qs[_0x76b9('0x1d')](_0x571c5c[_0x76b9('0x33')]['offset']);}return _0x4ce8b8[_0x76b9('0x59')](_0x36ffba);}})['then'](function(_0x1a63ae){if(_0x1a63ae){return _0x1a63ae?{'count':_0x14624c,'rows':_0x1a63ae}:null;}})[_0x76b9('0x27')](respondWithResult(_0x397059,null))[_0x76b9('0x49')](handleError(_0x397059,null));};exports[_0x76b9('0x5d')]=function(_0x3250eb,_0x971bb4,_0x3a21f8){var _0x29b5b1={};var _0x4a287e={};var _0x5205b5;var _0x32fcb3;return db['Trigger'][_0x76b9('0x5a')]({'where':{'id':_0x3250eb[_0x76b9('0x4b')]['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x971bb4,null))['then'](function(_0x37fb22){if(_0x37fb22){_0x5205b5=_0x37fb22;_0x4a287e[_0x76b9('0x38')]=_['keys'](db[_0x76b9('0x5b')][_0x76b9('0x5c')]);_0x4a287e[_0x76b9('0x33')]=_[_0x76b9('0x34')](_0x3250eb[_0x76b9('0x33')]);_0x4a287e[_0x76b9('0x35')]=_[_0x76b9('0x36')](_0x4a287e[_0x76b9('0x38')],_0x4a287e['query']);_0x29b5b1[_0x76b9('0x37')]=_[_0x76b9('0x36')](_0x4a287e['model'],qs[_0x76b9('0x39')](_0x3250eb['query'][_0x76b9('0x39')]));_0x29b5b1[_0x76b9('0x37')]=_0x29b5b1['attributes']['length']?_0x29b5b1[_0x76b9('0x37')]:_0x4a287e['model'];_0x29b5b1[_0x76b9('0x3d')]=qs[_0x76b9('0x3e')](_0x3250eb[_0x76b9('0x33')][_0x76b9('0x3e')]);_0x29b5b1['where']=qs[_0x76b9('0x35')](_[_0x76b9('0x40')](_0x3250eb[_0x76b9('0x33')],_0x4a287e[_0x76b9('0x35')]));if(_0x3250eb[_0x76b9('0x33')][_0x76b9('0x43')]){_0x29b5b1[_0x76b9('0x3f')]=_[_0x76b9('0x41')](_0x29b5b1[_0x76b9('0x3f')],{'$or':_['map'](_0x29b5b1['attributes'],function(_0x170935){var _0x21d047={};_0x21d047[_0x170935]={'$like':'%'+_0x3250eb[_0x76b9('0x33')]['filter']+'%'};return _0x21d047;})});}_0x29b5b1=_[_0x76b9('0x41')]({},_0x29b5b1,_0x3250eb['options']);return _0x5205b5[_0x76b9('0x5d')](_0x29b5b1);}})[_0x76b9('0x27')](function(_0xea0d80){if(_0xea0d80){_0x32fcb3=_0xea0d80[_0x76b9('0x3a')];if(!_0x3250eb[_0x76b9('0x33')][_0x76b9('0x3b')](_0x76b9('0x3c'))){_0x29b5b1[_0x76b9('0x1f')]=qs[_0x76b9('0x1f')](_0x3250eb[_0x76b9('0x33')]['limit']);_0x29b5b1[_0x76b9('0x1d')]=qs['offset'](_0x3250eb[_0x76b9('0x33')][_0x76b9('0x1d')]);}return _0x5205b5['getAnyConditions'](_0x29b5b1);}})['then'](function(_0x3724ba){if(_0x3724ba){return _0x3724ba?{'count':_0x32fcb3,'rows':_0x3724ba}:null;}})[_0x76b9('0x27')](respondWithResult(_0x971bb4,null))[_0x76b9('0x49')](handleError(_0x971bb4,null));};exports['addAction']=function(_0x18396a,_0x3d3c82,_0x4908e5){if(_0x18396a[_0x76b9('0x4e')]['id']){delete _0x18396a[_0x76b9('0x4e')]['id'];}return db['Trigger'][_0x76b9('0x4c')]({'where':{'id':_0x18396a[_0x76b9('0x4b')]['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x3d3c82,null))[_0x76b9('0x27')](function(_0xc9adfd){if(_0xc9adfd){_0x18396a['body'][_0x76b9('0x5e')]=_0xc9adfd['id'];return db[_0x76b9('0x5f')][_0x76b9('0x4d')](_0x18396a[_0x76b9('0x4e')]);}})[_0x76b9('0x27')](respondWithResult(_0x3d3c82,null))[_0x76b9('0x49')](handleError(_0x3d3c82,null));};exports[_0x76b9('0x60')]=function(_0x2321ce,_0x4d4119,_0x2f305d){var _0x26ef18={};var _0x2caa38={};var _0x33cbe8;var _0x181a71;return db[_0x76b9('0x30')]['findOne']({'where':{'id':_0x2321ce[_0x76b9('0x4b')]['id']}})[_0x76b9('0x27')](handleEntityNotFound(_0x4d4119,null))['then'](function(_0x2518a7){if(_0x2518a7){_0x33cbe8=_0x2518a7;_0x2caa38[_0x76b9('0x38')]=_[_0x76b9('0x34')](db['Action'][_0x76b9('0x5c')]);_0x2caa38[_0x76b9('0x33')]=_[_0x76b9('0x34')](_0x2321ce[_0x76b9('0x33')]);_0x2caa38[_0x76b9('0x35')]=_[_0x76b9('0x36')](_0x2caa38[_0x76b9('0x38')],_0x2caa38['query']);_0x26ef18['attributes']=_['intersection'](_0x2caa38[_0x76b9('0x38')],qs[_0x76b9('0x39')](_0x2321ce[_0x76b9('0x33')]['fields']));_0x26ef18[_0x76b9('0x37')]=_0x26ef18[_0x76b9('0x37')]['length']?_0x26ef18[_0x76b9('0x37')]:_0x2caa38['model'];_0x26ef18[_0x76b9('0x3d')]=qs[_0x76b9('0x3e')](_0x2321ce[_0x76b9('0x33')][_0x76b9('0x3e')]);_0x26ef18['where']=qs['filters'](_[_0x76b9('0x40')](_0x2321ce['query'],_0x2caa38['filters']));if(_0x2321ce[_0x76b9('0x33')][_0x76b9('0x43')]){_0x26ef18[_0x76b9('0x3f')]=_[_0x76b9('0x41')](_0x26ef18[_0x76b9('0x3f')],{'$or':_[_0x76b9('0x2f')](_0x26ef18[_0x76b9('0x37')],function(_0x561ddb){var _0x1b0bc8={};_0x1b0bc8[_0x561ddb]={'$like':'%'+_0x2321ce['query'][_0x76b9('0x43')]+'%'};return _0x1b0bc8;})});}_0x26ef18=_[_0x76b9('0x41')]({},_0x26ef18,_0x2321ce[_0x76b9('0x44')]);return _0x33cbe8[_0x76b9('0x60')](_0x26ef18);}})[_0x76b9('0x27')](function(_0x5d79d7){if(_0x5d79d7){_0x181a71=_0x5d79d7['length'];if(!_0x2321ce['query']['hasOwnProperty']('nolimit')){_0x26ef18[_0x76b9('0x1f')]=qs['limit'](_0x2321ce[_0x76b9('0x33')][_0x76b9('0x1f')]);_0x26ef18[_0x76b9('0x1d')]=qs[_0x76b9('0x1d')](_0x2321ce['query']['offset']);}return _0x33cbe8[_0x76b9('0x60')](_0x26ef18);}})[_0x76b9('0x27')](function(_0x28c0d6){if(_0x28c0d6){return _0x28c0d6?{'count':_0x181a71,'rows':_0x28c0d6}:null;}})[_0x76b9('0x27')](respondWithResult(_0x4d4119,null))['catch'](handleError(_0x4d4119,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 92e2a14..ef81656 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 _0xbe02=['define','Trigger','util','../../config/logger','api','request-promise','path','../../config/environment','./trigger.attributes','exports'];(function(_0x5be97c,_0x4d93d6){var _0x5e555c=function(_0x54fde3){while(--_0x54fde3){_0x5be97c['push'](_0x5be97c['shift']());}};_0x5e555c(++_0x4d93d6);}(_0xbe02,0x124));var _0x2be0=function(_0x4afd29,_0x3ebcec){_0x4afd29=_0x4afd29-0x0;var _0x530885=_0xbe02[_0x4afd29];return _0x530885;};'use strict';var _=require('lodash');var util=require(_0x2be0('0x0'));var logger=require(_0x2be0('0x1'))(_0x2be0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2be0('0x3'));var fs=require('fs');var path=require(_0x2be0('0x4'));var rimraf=require('rimraf');var config=require(_0x2be0('0x5'));var attributes=require(_0x2be0('0x6'));module[_0x2be0('0x7')]=function(_0xa6a72f,_0x35e7d8){return _0xa6a72f[_0x2be0('0x8')](_0x2be0('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f7d=['define','Trigger','tools_triggers','lodash','util','api','request-promise','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x19bb5e,_0x39ff5b){var _0x9ec683=function(_0x3c1947){while(--_0x3c1947){_0x19bb5e['push'](_0x19bb5e['shift']());}};_0x9ec683(++_0x39ff5b);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x31bb83,_0x4b65dc){_0x31bb83=_0x31bb83-0x0;var _0x1f7e27=_0x8f7d[_0x31bb83];return _0x1f7e27;};'use strict';var _=require(_0xd8f7('0x0'));var util=require(_0xd8f7('0x1'));var logger=require('../../config/logger')(_0xd8f7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8f7('0x4'));var config=require(_0xd8f7('0x5'));var attributes=require(_0xd8f7('0x6'));module[_0xd8f7('0x7')]=function(_0x524a2e,_0x4090c9){return _0x524a2e[_0xd8f7('0x8')](_0xd8f7('0x9'),attributes,{'tableName':_0xd8f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 2617117..1393023 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 _0x6d29=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x19a9e1,_0x13bcde){var _0x39904e=function(_0x34632b){while(--_0x34632b){_0x19a9e1['push'](_0x19a9e1['shift']());}};_0x39904e(++_0x13bcde);}(_0x6d29,0xf2));var _0x96d2=function(_0x47794f,_0x12c9b3){_0x47794f=_0x47794f-0x0;var _0x2ca51d=_0x6d29[_0x47794f];return _0x2ca51d;};'use strict';var _=require(_0x96d2('0x0'));var util=require(_0x96d2('0x1'));var moment=require(_0x96d2('0x2'));var BPromise=require(_0x96d2('0x3'));var rs=require(_0x96d2('0x4'));var fs=require('fs');var Redis=require(_0x96d2('0x5'));var db=require(_0x96d2('0x6'))['db'];var utils=require(_0x96d2('0x7'));var logger=require(_0x96d2('0x8'))(_0x96d2('0x9'));var config=require(_0x96d2('0xa'));var jayson=require(_0x96d2('0xb'));var client=jayson[_0x96d2('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250785,_0x51c83a,_0x404daa){return new BPromise(function(_0x5ef7e6,_0x3d7736){return client['request'](_0x250785,_0x404daa)[_0x96d2('0xd')](function(_0x29ec7d){logger[_0x96d2('0xe')](_0x96d2('0xf'),_0x51c83a,_0x96d2('0x10'));logger['debug'](_0x96d2('0x11'),_0x51c83a,_0x96d2('0x10'),JSON[_0x96d2('0x12')](_0x29ec7d));if(_0x29ec7d[_0x96d2('0x13')]){if(_0x29ec7d['error'][_0x96d2('0x14')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x51c83a,_0x29ec7d[_0x96d2('0x13')][_0x96d2('0x15')]);return _0x3d7736(_0x29ec7d[_0x96d2('0x13')][_0x96d2('0x15')]);}logger[_0x96d2('0x13')](_0x96d2('0xf'),_0x51c83a,_0x29ec7d[_0x96d2('0x13')][_0x96d2('0x15')]);return _0x5ef7e6(_0x29ec7d[_0x96d2('0x13')][_0x96d2('0x15')]);}else{logger[_0x96d2('0xe')](_0x96d2('0xf'),_0x51c83a,_0x96d2('0x10'));_0x5ef7e6(_0x29ec7d['result'][_0x96d2('0x15')]);}})[_0x96d2('0x16')](function(_0x59ba40){logger['error']('Trigger,\x20%s,\x20%s',_0x51c83a,_0x59ba40);_0x3d7736(_0x59ba40);});});}exports[_0x96d2('0x17')]=function(_0x3c432f){var _0x59b30b=this;return new Promise(function(_0x30b0af,_0x360844){return db[_0x96d2('0x18')][_0x96d2('0x19')]({'raw':_0x3c432f[_0x96d2('0x1a')]?_0x3c432f['options'][_0x96d2('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c432f[_0x96d2('0x1a')]?_0x3c432f[_0x96d2('0x1a')][_0x96d2('0x1c')]||null:null,'attributes':_0x3c432f[_0x96d2('0x1a')]?_0x3c432f[_0x96d2('0x1a')]['attributes']||null:null,'limit':_0x3c432f[_0x96d2('0x1a')]?_0x3c432f['options'][_0x96d2('0x1d')]||null:null,'include':_0x3c432f[_0x96d2('0x1a')]?_0x3c432f[_0x96d2('0x1a')]['include']?_[_0x96d2('0x1e')](_0x3c432f['options'][_0x96d2('0x1f')],function(_0x4c1a7c){return{'model':db[_0x4c1a7c[_0x96d2('0x20')]],'as':_0x4c1a7c['as'],'attributes':_0x4c1a7c['attributes'],'include':_0x4c1a7c[_0x96d2('0x1f')]?_['map'](_0x4c1a7c[_0x96d2('0x1f')],function(_0x8ccd5c){return{'model':db[_0x8ccd5c[_0x96d2('0x20')]],'as':_0x8ccd5c['as'],'attributes':_0x8ccd5c[_0x96d2('0x21')],'include':_0x8ccd5c[_0x96d2('0x1f')]?_[_0x96d2('0x1e')](_0x8ccd5c['include'],function(_0x39c755){return{'model':db[_0x39c755[_0x96d2('0x20')]],'as':_0x39c755['as'],'attributes':_0x39c755['attributes']};}):[]};}):[]};}):[]:[]})[_0x96d2('0xd')](function(_0x3ea074){logger[_0x96d2('0xe')]('GetTrigger',_0x3c432f);logger[_0x96d2('0x22')]('GetTrigger',_0x3c432f,JSON[_0x96d2('0x12')](_0x3ea074));_0x30b0af(_0x3ea074);})[_0x96d2('0x16')](function(_0x30394f){logger[_0x96d2('0x13')](_0x96d2('0x17'),_0x30394f[_0x96d2('0x15')],_0x3c432f);_0x360844(_0x59b30b['error'](0x1f4,_0x30394f[_0x96d2('0x15')]));});});};exports[_0x96d2('0x23')]=function(_0x5bbf1c){var _0x262415=this;return new Promise(function(_0x2e8583,_0x3055ff){return db[_0x96d2('0x18')][_0x96d2('0x24')]({'raw':_0x5bbf1c[_0x96d2('0x1a')]?_0x5bbf1c[_0x96d2('0x1a')][_0x96d2('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bbf1c[_0x96d2('0x1a')]?_0x5bbf1c['options']['where']||null:null,'attributes':_0x5bbf1c['options']?_0x5bbf1c[_0x96d2('0x1a')][_0x96d2('0x21')]||null:null,'include':_0x5bbf1c[_0x96d2('0x1a')]?_0x5bbf1c[_0x96d2('0x1a')][_0x96d2('0x1f')]?_[_0x96d2('0x1e')](_0x5bbf1c[_0x96d2('0x1a')][_0x96d2('0x1f')],function(_0x573cb7){return{'model':db[_0x573cb7[_0x96d2('0x20')]],'as':_0x573cb7['as'],'attributes':_0x573cb7[_0x96d2('0x21')],'include':_0x573cb7['include']?_[_0x96d2('0x1e')](_0x573cb7[_0x96d2('0x1f')],function(_0x4bbac0){return{'model':db[_0x4bbac0['model']],'as':_0x4bbac0['as'],'attributes':_0x4bbac0[_0x96d2('0x21')],'include':_0x4bbac0[_0x96d2('0x1f')]?_['map'](_0x4bbac0['include'],function(_0x248c93){return{'model':db[_0x248c93[_0x96d2('0x20')]],'as':_0x248c93['as'],'attributes':_0x248c93[_0x96d2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x96d2('0xd')](function(_0x2b308d){logger[_0x96d2('0xe')](_0x96d2('0x23'),_0x5bbf1c);logger[_0x96d2('0x22')](_0x96d2('0x23'),_0x5bbf1c,JSON[_0x96d2('0x12')](_0x2b308d));_0x2e8583(_0x2b308d);})[_0x96d2('0x16')](function(_0x199392){logger[_0x96d2('0x13')]('ShowTrigger',_0x199392[_0x96d2('0x15')],_0x5bbf1c);_0x3055ff(_0x262415[_0x96d2('0x13')](0x1f4,_0x199392[_0x96d2('0x15')]));});});}; \ No newline at end of file +var _0x32ff=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','limit','include','map','model','attributes','stringify','catch','ShowTrigger','find','where','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x5970f5,_0xe9d3c2){var _0x182ae2=function(_0x47b75d){while(--_0x47b75d){_0x5970f5['push'](_0x5970f5['shift']());}};_0x182ae2(++_0xe9d3c2);}(_0x32ff,0x123));var _0xf32f=function(_0x46639c,_0x8dd072){_0x46639c=_0x46639c-0x0;var _0x1e7b0b=_0x32ff[_0x46639c];return _0x1e7b0b;};'use strict';var _=require(_0xf32f('0x0'));var util=require(_0xf32f('0x1'));var moment=require(_0xf32f('0x2'));var BPromise=require('bluebird');var rs=require(_0xf32f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf32f('0x4'))['db'];var utils=require(_0xf32f('0x5'));var logger=require(_0xf32f('0x6'))(_0xf32f('0x7'));var config=require(_0xf32f('0x8'));var jayson=require(_0xf32f('0x9'));var client=jayson[_0xf32f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf1f3d9,_0x140252,_0x255832){return new BPromise(function(_0x1e2a8d,_0x267946){return client[_0xf32f('0xb')](_0xf1f3d9,_0x255832)[_0xf32f('0xc')](function(_0x186457){logger[_0xf32f('0xd')]('Trigger,\x20%s,\x20%s',_0x140252,_0xf32f('0xe'));logger[_0xf32f('0xf')](_0xf32f('0x10'),_0x140252,'request\x20sent',JSON['stringify'](_0x186457));if(_0x186457[_0xf32f('0x11')]){if(_0x186457[_0xf32f('0x11')][_0xf32f('0x12')]===0x1f4){logger[_0xf32f('0x11')](_0xf32f('0x13'),_0x140252,_0x186457[_0xf32f('0x11')]['message']);return _0x267946(_0x186457['error'][_0xf32f('0x14')]);}logger[_0xf32f('0x11')](_0xf32f('0x13'),_0x140252,_0x186457[_0xf32f('0x11')]['message']);return _0x1e2a8d(_0x186457[_0xf32f('0x11')][_0xf32f('0x14')]);}else{logger[_0xf32f('0xd')]('Trigger,\x20%s,\x20%s',_0x140252,_0xf32f('0xe'));_0x1e2a8d(_0x186457[_0xf32f('0x15')][_0xf32f('0x14')]);}})['catch'](function(_0x475587){logger[_0xf32f('0x11')](_0xf32f('0x13'),_0x140252,_0x475587);_0x267946(_0x475587);});});}exports[_0xf32f('0x16')]=function(_0xb37e90){var _0x300080=this;return new Promise(function(_0x17da4f,_0x455fd2){return db[_0xf32f('0x17')][_0xf32f('0x18')]({'raw':_0xb37e90[_0xf32f('0x19')]?_0xb37e90[_0xf32f('0x19')][_0xf32f('0x1a')]===undefined?!![]:![]:!![],'where':_0xb37e90['options']?_0xb37e90[_0xf32f('0x19')]['where']||null:null,'attributes':_0xb37e90[_0xf32f('0x19')]?_0xb37e90['options']['attributes']||null:null,'limit':_0xb37e90[_0xf32f('0x19')]?_0xb37e90[_0xf32f('0x19')][_0xf32f('0x1b')]||null:null,'include':_0xb37e90['options']?_0xb37e90[_0xf32f('0x19')][_0xf32f('0x1c')]?_[_0xf32f('0x1d')](_0xb37e90[_0xf32f('0x19')]['include'],function(_0x4f88d2){return{'model':db[_0x4f88d2[_0xf32f('0x1e')]],'as':_0x4f88d2['as'],'attributes':_0x4f88d2[_0xf32f('0x1f')],'include':_0x4f88d2[_0xf32f('0x1c')]?_[_0xf32f('0x1d')](_0x4f88d2['include'],function(_0x2fe06e){return{'model':db[_0x2fe06e['model']],'as':_0x2fe06e['as'],'attributes':_0x2fe06e[_0xf32f('0x1f')],'include':_0x2fe06e['include']?_[_0xf32f('0x1d')](_0x2fe06e['include'],function(_0x1ca5bc){return{'model':db[_0x1ca5bc[_0xf32f('0x1e')]],'as':_0x1ca5bc['as'],'attributes':_0x1ca5bc[_0xf32f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10eb6b){logger[_0xf32f('0xd')]('GetTrigger',_0xb37e90);logger[_0xf32f('0xf')](_0xf32f('0x16'),_0xb37e90,JSON[_0xf32f('0x20')](_0x10eb6b));_0x17da4f(_0x10eb6b);})[_0xf32f('0x21')](function(_0x276802){logger['error'](_0xf32f('0x16'),_0x276802[_0xf32f('0x14')],_0xb37e90);_0x455fd2(_0x300080[_0xf32f('0x11')](0x1f4,_0x276802['message']));});});};exports[_0xf32f('0x22')]=function(_0x5194e1){var _0x59b1eb=this;return new Promise(function(_0x5d5ff7,_0x52a4b8){return db[_0xf32f('0x17')][_0xf32f('0x23')]({'raw':_0x5194e1[_0xf32f('0x19')]?_0x5194e1[_0xf32f('0x19')][_0xf32f('0x1a')]===undefined?!![]:![]:!![],'where':_0x5194e1['options']?_0x5194e1[_0xf32f('0x19')][_0xf32f('0x24')]||null:null,'attributes':_0x5194e1[_0xf32f('0x19')]?_0x5194e1[_0xf32f('0x19')]['attributes']||null:null,'include':_0x5194e1[_0xf32f('0x19')]?_0x5194e1[_0xf32f('0x19')]['include']?_[_0xf32f('0x1d')](_0x5194e1[_0xf32f('0x19')][_0xf32f('0x1c')],function(_0x3f43e8){return{'model':db[_0x3f43e8[_0xf32f('0x1e')]],'as':_0x3f43e8['as'],'attributes':_0x3f43e8[_0xf32f('0x1f')],'include':_0x3f43e8[_0xf32f('0x1c')]?_['map'](_0x3f43e8[_0xf32f('0x1c')],function(_0x42642f){return{'model':db[_0x42642f[_0xf32f('0x1e')]],'as':_0x42642f['as'],'attributes':_0x42642f[_0xf32f('0x1f')],'include':_0x42642f[_0xf32f('0x1c')]?_[_0xf32f('0x1d')](_0x42642f['include'],function(_0x3f4de1){return{'model':db[_0x3f4de1[_0xf32f('0x1e')]],'as':_0x3f4de1['as'],'attributes':_0x3f4de1[_0xf32f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf32f('0xc')](function(_0x54feb5){logger[_0xf32f('0xd')](_0xf32f('0x22'),_0x5194e1);logger[_0xf32f('0xf')](_0xf32f('0x22'),_0x5194e1,JSON[_0xf32f('0x20')](_0x54feb5));_0x5d5ff7(_0x54feb5);})[_0xf32f('0x21')](function(_0x38b4ed){logger[_0xf32f('0x11')]('ShowTrigger',_0x38b4ed[_0xf32f('0x14')],_0x5194e1);_0x52a4b8(_0x59b1eb['error'](0x1f4,_0x38b4ed[_0xf32f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 32b829c..c8bb79a 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 _0x2e63=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','multer'];(function(_0xe9997f,_0x5d6b53){var _0x519d69=function(_0x7daea5){while(--_0x7daea5){_0xe9997f['push'](_0xe9997f['shift']());}};_0x519d69(++_0x5d6b53);}(_0x2e63,0x12b));var _0x32e6=function(_0x393438,_0x4883a6){_0x393438=_0x393438-0x0;var _0x2a0986=_0x2e63[_0x393438];return _0x2a0986;};'use strict';var multer=require(_0x32e6('0x0'));var util=require(_0x32e6('0x1'));var path=require(_0x32e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x32e6('0x3'));var router=express[_0x32e6('0x4')]();var fs_extra=require(_0x32e6('0x5'));var auth=require(_0x32e6('0x6'));var interaction=require(_0x32e6('0x7'));var config=require(_0x32e6('0x8'));var controller=require('./trunk.controller');router[_0x32e6('0x9')]('/',auth[_0x32e6('0xa')](),controller[_0x32e6('0xb')]);router[_0x32e6('0x9')]('/:id',auth[_0x32e6('0xa')](),controller[_0x32e6('0xc')]);router['post']('/:id/clone',auth[_0x32e6('0xa')](),controller['clone']);router[_0x32e6('0xd')]('/',auth[_0x32e6('0xa')](),controller[_0x32e6('0xe')]);router[_0x32e6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x32e6('0x10')]);router[_0x32e6('0x11')](_0x32e6('0x12'),auth[_0x32e6('0xa')](),controller[_0x32e6('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf3ba=['get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xf3ba,0x15f));var _0xaf3b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xf3ba[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0xaf3b('0x0'));var util=require('util');var path=require(_0xaf3b('0x1'));var timeout=require(_0xaf3b('0x2'));var express=require(_0xaf3b('0x3'));var router=express['Router']();var fs_extra=require(_0xaf3b('0x4'));var auth=require(_0xaf3b('0x5'));var interaction=require(_0xaf3b('0x6'));var config=require(_0xaf3b('0x7'));var controller=require(_0xaf3b('0x8'));router[_0xaf3b('0x9')]('/',auth[_0xaf3b('0xa')](),controller[_0xaf3b('0xb')]);router['get'](_0xaf3b('0xc'),auth[_0xaf3b('0xa')](),controller[_0xaf3b('0xd')]);router[_0xaf3b('0xe')](_0xaf3b('0xf'),auth['isAuthenticated'](),controller[_0xaf3b('0x10')]);router[_0xaf3b('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf3b('0x11')]);router['put']('/:id',auth[_0xaf3b('0xa')](),controller['update']);router[_0xaf3b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaf3b('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index fe261ff..dd5448f 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 _0x63b3=['user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','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','shortinfo','inband','auto','nonat','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend'];(function(_0x26c961,_0x45da5a){var _0x3071c4=function(_0x541bbf){while(--_0x541bbf){_0x26c961['push'](_0x26c961['shift']());}};_0x3071c4(++_0x45da5a);}(_0x63b3,0x99));var _0x363b=function(_0x57bf1e,_0x3bddf2){_0x57bf1e=_0x57bf1e-0x0;var _0x215002=_0x63b3[_0x57bf1e];return _0x215002;};'use strict';var Sequelize=require(_0x363b('0x0'));module[_0x363b('0x1')]={'name':{'type':Sequelize[_0x363b('0x2')],'allowNull':![],'unique':_0x363b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x5'),_0x363b('0x6'),_0x363b('0x7')),'allowNull':![],'defaultValue':_0x363b('0x5')},'context':{'type':Sequelize[_0x363b('0x2')],'allowNull':![],'defaultValue':_0x363b('0x8')},'callingpres':{'type':Sequelize[_0x363b('0x4')]('ALLOWED_NOT_SCREENED',_0x363b('0x9'),_0x363b('0xa'),_0x363b('0xb'),'PROHIB_NOT_SCREENED',_0x363b('0xc'),_0x363b('0xd'),_0x363b('0xe'))},'deny':{'type':Sequelize[_0x363b('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x363b('0x2')]},'transport':{'type':Sequelize[_0x363b('0x2')],'defaultValue':_0x363b('0xf'),'set':function(_0x14a612){this[_0x363b('0x10')]('transport',_0x14a612?_0x14a612[_0x363b('0x11')](','):null);},'get':function(){return this[_0x363b('0x12')](_0x363b('0x13'))?this[_0x363b('0x12')](_0x363b('0x13'))[_0x363b('0x14')](','):null;},'comment':_0x363b('0x15')},'dtmfmode':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x16'),'info',_0x363b('0x17'),_0x363b('0x18'),_0x363b('0x19')),'defaultValue':_0x363b('0x16')},'directmedia':{'type':Sequelize[_0x363b('0x4')]('yes','no',_0x363b('0x1a'),'update',_0x363b('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x363b('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x210b05){this[_0x363b('0x10')](_0x363b('0x1d'),_0x210b05?_0x210b05[_0x363b('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x363b('0x1d'))?this[_0x363b('0x12')](_0x363b('0x1d'))[_0x363b('0x14')](','):null;},'comment':_0x363b('0x1e')},'callgroup':{'type':Sequelize[_0x363b('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x363b('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x363b('0x2')]},'language':{'type':Sequelize[_0x363b('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x363b('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x363b('0x2')],'defaultValue':_0x363b('0x1f')},'allow':{'type':Sequelize[_0x363b('0x2')],'allowNull':![],'defaultValue':_0x363b('0x20'),'set':function(_0x25a667){this['setDataValue'](_0x363b('0x21'),_0x25a667?_0x25a667['join'](';'):_0x363b('0x20'));},'get':function(){return this[_0x363b('0x12')]('allow')?this[_0x363b('0x12')](_0x363b('0x21'))[_0x363b('0x14')](';'):null;},'comment':_0x363b('0x22')},'autoframing':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no')},'insecure':{'type':Sequelize[_0x363b('0x2')],'defaultValue':'port,invite','set':function(_0x3bb4d6){this['setDataValue'](_0x363b('0x23'),_0x3bb4d6?_0x3bb4d6[_0x363b('0x11')](','):null);},'get':function(){return this[_0x363b('0x12')]('insecure')?this[_0x363b('0x12')](_0x363b('0x23'))[_0x363b('0x14')](','):null;},'comment':_0x363b('0x24')},'trustrpid':{'type':Sequelize[_0x363b('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no',_0x363b('0x25'))},'promiscredir':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x363b('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x363b('0x26')](0xb)},'setvar':{'type':Sequelize[_0x363b('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x363b('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x363b('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x363b('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x363b('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x363b('0x2')]},'template':{'type':Sequelize[_0x363b('0x2')]},'videosupport':{'type':Sequelize[_0x363b('0x4')]('yes','no',_0x363b('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x363b('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x363b('0x2')]},'session_timers':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x28'),_0x363b('0x29'),_0x363b('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x363b('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x2b'),_0x363b('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x363b('0x2')]},'fromdomain':{'type':Sequelize[_0x363b('0x2')]},'fromuser':{'type':Sequelize[_0x363b('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x363b('0x1c'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x363b('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x363b('0x2')]},'defaultuser':{'type':Sequelize[_0x363b('0x2')]},'rtptimeout':{'type':Sequelize[_0x363b('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x363b('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x363b('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no',_0x363b('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x363b('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x363b('0x26')](0xb)},'timerb':{'type':Sequelize[_0x363b('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x363b('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x363b('0x2')]},'contactdeny':{'type':Sequelize[_0x363b('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x363b('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x363b('0x1c'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no')},'dtlsverify':{'type':Sequelize[_0x363b('0x4')]('yes','no','fingerprint',_0x363b('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x363b('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x363b('0x2')]},'dtlscipher':{'type':Sequelize[_0x363b('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x2f'),_0x363b('0x30'),_0x363b('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x363b('0x2')]},'usereqphone':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x363b('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x363b('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0x363b('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x363b('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x363b('0x2')]},'parkinglot':{'type':Sequelize[_0x363b('0x2')]},'description':{'type':Sequelize[_0x363b('0x2')]},'host':{'type':Sequelize[_0x363b('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x363b('0x4')](_0x363b('0x1c'),'no',_0x363b('0x1a'),_0x363b('0x32'),_0x363b('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x363b('0x2')]},'otherFields':{'type':Sequelize[_0x363b('0x2')]},'active':{'type':Sequelize[_0x363b('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x363b('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x960d=['update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uac','uas','certificate','actpass'];(function(_0x2f479c,_0x664341){var _0x66d649=function(_0x332490){while(--_0x332490){_0x2f479c['push'](_0x2f479c['shift']());}};_0x66d649(++_0x664341);}(_0x960d,0xfc));var _0xd960=function(_0x8dd13b,_0x652362){_0x8dd13b=_0x8dd13b-0x0;var _0x8ec50e=_0x960d[_0x8dd13b];return _0x8ec50e;};'use strict';var Sequelize=require(_0xd960('0x0'));module[_0xd960('0x1')]={'name':{'type':Sequelize[_0xd960('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x4'),'user',_0xd960('0x5')),'allowNull':![],'defaultValue':_0xd960('0x4')},'context':{'type':Sequelize[_0xd960('0x2')],'allowNull':![],'defaultValue':_0xd960('0x6')},'callingpres':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x7'),_0xd960('0x8'),'ALLOWED_FAILED_SCREEN',_0xd960('0x9'),_0xd960('0xa'),_0xd960('0xb'),_0xd960('0xc'),_0xd960('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xd960('0x2')]},'secret':{'type':Sequelize[_0xd960('0x2')]},'md5secret':{'type':Sequelize[_0xd960('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xd960('0x2')],'defaultValue':_0xd960('0xe'),'set':function(_0x4486c6){this[_0xd960('0xf')](_0xd960('0x10'),_0x4486c6?_0x4486c6['join'](','):null);},'get':function(){return this[_0xd960('0x11')](_0xd960('0x10'))?this[_0xd960('0x11')](_0xd960('0x10'))[_0xd960('0x12')](','):null;},'comment':_0xd960('0x13')},'dtmfmode':{'type':Sequelize[_0xd960('0x3')]('rfc2833',_0xd960('0x14'),_0xd960('0x15'),_0xd960('0x16'),_0xd960('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no',_0xd960('0x19'),_0xd960('0x1a'),_0xd960('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd960('0x2')]},'directmediadeny':{'type':Sequelize[_0xd960('0x2')]},'nat':{'type':Sequelize[_0xd960('0x2')],'defaultValue':_0xd960('0x1c'),'set':function(_0x5238e0){this['setDataValue']('nat',_0x5238e0?_0x5238e0[_0xd960('0x1d')](','):null);},'get':function(){return this[_0xd960('0x11')](_0xd960('0x1e'))?this[_0xd960('0x11')](_0xd960('0x1e'))[_0xd960('0x12')](','):null;},'comment':_0xd960('0x1f')},'callgroup':{'type':Sequelize[_0xd960('0x2')]},'namedcallgroup':{'type':Sequelize[_0xd960('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd960('0x2')]},'language':{'type':Sequelize[_0xd960('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd960('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xd960('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd960('0x21'),'set':function(_0x2cce9b){this[_0xd960('0xf')](_0xd960('0x22'),_0x2cce9b?_0x2cce9b[_0xd960('0x1d')](';'):_0xd960('0x21'));},'get':function(){return this[_0xd960('0x11')](_0xd960('0x22'))?this[_0xd960('0x11')](_0xd960('0x22'))['split'](';'):null;},'comment':_0xd960('0x23')},'autoframing':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'insecure':{'type':Sequelize[_0xd960('0x2')],'defaultValue':_0xd960('0x24'),'set':function(_0x478578){this['setDataValue'](_0xd960('0x25'),_0x478578?_0x478578[_0xd960('0x1d')](','):null);},'get':function(){return this[_0xd960('0x11')](_0xd960('0x25'))?this['getDataValue'](_0xd960('0x25'))['split'](','):null;},'comment':_0xd960('0x26')},'trustrpid':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd960('0x3')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'accountcode':{'type':Sequelize[_0xd960('0x27')](0xb)},'setvar':{'type':Sequelize[_0xd960('0x2')]},'callerid':{'type':Sequelize[_0xd960('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd960('0x2')]},'callcounter':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no'),'defaultValue':_0xd960('0x18')},'busylevel':{'type':Sequelize[_0xd960('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xd960('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xd960('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xd960('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xd960('0x2')]},'videosupport':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no',_0xd960('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd960('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd960('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x29'),_0xd960('0x2a'),_0xd960('0x2b'))},'session_expires':{'type':Sequelize[_0xd960('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xd960('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xd960('0x2c'),_0xd960('0x2d')),'defaultValue':_0xd960('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xd960('0x2')]},'regexten':{'type':Sequelize[_0xd960('0x2')]},'fromdomain':{'type':Sequelize[_0xd960('0x2')]},'fromuser':{'type':Sequelize[_0xd960('0x2')]},'port':{'type':Sequelize[_0xd960('0x27')](0x5)},'qualify':{'type':Sequelize[_0xd960('0x3')]('yes','no'),'defaultValue':_0xd960('0x18')},'keepalive':{'type':Sequelize[_0xd960('0x27')](0xb)},'defaultip':{'type':Sequelize[_0xd960('0x2')]},'defaultuser':{'type':Sequelize[_0xd960('0x2')]},'rtptimeout':{'type':Sequelize[_0xd960('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd960('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xd960('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd960('0x2')]},'callbackextension':{'type':Sequelize[_0xd960('0x2')]},'timert1':{'type':Sequelize[_0xd960('0x27')](0xb)},'timerb':{'type':Sequelize[_0xd960('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xd960('0x2')]},'contactdeny':{'type':Sequelize[_0xd960('0x2')]},'contactacl':{'type':Sequelize[_0xd960('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xd960('0x2')]},'use_q850_reason':{'type':Sequelize[_0xd960('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd960('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'force_avp':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xd960('0x3')]('yes','no','fingerprint',_0xd960('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xd960('0x27')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xd960('0x2')]},'dtlscafile':{'type':Sequelize[_0xd960('0x2')]},'dtlscapath':{'type':Sequelize[_0xd960('0x2')]},'dtlssetup':{'type':Sequelize[_0xd960('0x3')]('active','passive',_0xd960('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd960('0x2')]},'usereqphone':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xd960('0x2')]},'call_limit':{'type':Sequelize[_0xd960('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xd960('0x2')]},'mohsuggest':{'type':Sequelize[_0xd960('0x2')]},'parkinglot':{'type':Sequelize[_0xd960('0x2')]},'description':{'type':Sequelize[_0xd960('0x2')]},'host':{'type':Sequelize[_0xd960('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xd960('0x3')](_0xd960('0x18'),'no',_0xd960('0x19'),_0xd960('0x1a'),_0xd960('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd960('0x2')]},'otherFields':{'type':Sequelize[_0xd960('0x2')]},'active':{'type':Sequelize[_0xd960('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd960('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 89d3ad3..7b2e7ab 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0xc66d59,_0x3606da){var _0x48e80f=function(_0x25cab6){while(--_0x25cab6){_0xc66d59['push'](_0xc66d59['shift']());}};_0x48e80f(++_0x3606da);}(_0xbec5,0xe5));var _0x5bec=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0xbec5[_0x328534];return _0x2796c0;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','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','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x22af08,_0x2740cc){var _0x2879fa=function(_0x4ff6d8){while(--_0x4ff6d8){_0x22af08['push'](_0x22af08['shift']());}};_0x2879fa(++_0x2740cc);}(_0x54ef,0x112));var _0xf54e=function(_0x193d3c,_0x344863){_0x193d3c=_0x193d3c-0x0;var _0x142cad=_0x54ef[_0x193d3c];return _0x142cad;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 1a99c31..e4353f6 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 _0x4701=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','define'];(function(_0x105977,_0x3cb58a){var _0x362d40=function(_0x5463af){while(--_0x5463af){_0x105977['push'](_0x105977['shift']());}};_0x362d40(++_0x3cb58a);}(_0x4701,0x140));var _0x1470=function(_0x3a4562,_0x35512d){_0x3a4562=_0x3a4562-0x0;var _0x31df08=_0x4701[_0x3a4562];return _0x31df08;};'use strict';var _=require(_0x1470('0x0'));var util=require('util');var logger=require(_0x1470('0x1'))(_0x1470('0x2'));var moment=require(_0x1470('0x3'));var BPromise=require(_0x1470('0x4'));var rp=require(_0x1470('0x5'));var fs=require('fs');var path=require(_0x1470('0x6'));var rimraf=require(_0x1470('0x7'));var config=require('../../config/environment');var attributes=require(_0x1470('0x8'));module['exports']=function(_0x410149,_0x9f617b){return _0x410149[_0x1470('0x9')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c89=['tools_trunks','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk'];(function(_0x4f78f9,_0x460f63){var _0x1a24ac=function(_0x3d3e0c){while(--_0x3d3e0c){_0x4f78f9['push'](_0x4f78f9['shift']());}};_0x1a24ac(++_0x460f63);}(_0x2c89,0x69));var _0x92c8=function(_0x4723e6,_0x13c815){_0x4723e6=_0x4723e6-0x0;var _0x2a3fc6=_0x2c89[_0x4723e6];return _0x2a3fc6;};'use strict';var _=require(_0x92c8('0x0'));var util=require(_0x92c8('0x1'));var logger=require(_0x92c8('0x2'))('api');var moment=require(_0x92c8('0x3'));var BPromise=require(_0x92c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92c8('0x5'));var rimraf=require(_0x92c8('0x6'));var config=require(_0x92c8('0x7'));var attributes=require(_0x92c8('0x8'));module[_0x92c8('0x9')]=function(_0x2bae10,_0x398a41){return _0x2bae10[_0x92c8('0xa')](_0x92c8('0xb'),attributes,{'tableName':_0x92c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index f12f716..a65336a 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 _0xf598=['findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowTrunk','Trunk','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrunk'];(function(_0x4bd76e,_0x260c31){var _0x96a285=function(_0x28176d){while(--_0x28176d){_0x4bd76e['push'](_0x4bd76e['shift']());}};_0x96a285(++_0x260c31);}(_0xf598,0x134));var _0x8f59=function(_0x39ee98,_0x3be8a5){_0x39ee98=_0x39ee98-0x0;var _0x837d07=_0xf598[_0x39ee98];return _0x837d07;};'use strict';var _=require(_0x8f59('0x0'));var util=require(_0x8f59('0x1'));var moment=require('moment');var BPromise=require(_0x8f59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f59('0x3'));var db=require(_0x8f59('0x4'))['db'];var utils=require(_0x8f59('0x5'));var logger=require(_0x8f59('0x6'))(_0x8f59('0x7'));var config=require(_0x8f59('0x8'));var jayson=require(_0x8f59('0x9'));var client=jayson[_0x8f59('0xa')][_0x8f59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cac8c,_0xdc1fa1,_0x392b6f){return new BPromise(function(_0x327a92,_0x1a191f){return client[_0x8f59('0xc')](_0x5cac8c,_0x392b6f)[_0x8f59('0xd')](function(_0x5b3b8e){logger['info'](_0x8f59('0xe'),_0xdc1fa1,_0x8f59('0xf'));logger['debug'](_0x8f59('0x10'),_0xdc1fa1,_0x8f59('0xf'),JSON[_0x8f59('0x11')](_0x5b3b8e));if(_0x5b3b8e[_0x8f59('0x12')]){if(_0x5b3b8e[_0x8f59('0x12')][_0x8f59('0x13')]===0x1f4){logger['error'](_0x8f59('0xe'),_0xdc1fa1,_0x5b3b8e['error'][_0x8f59('0x14')]);return _0x1a191f(_0x5b3b8e[_0x8f59('0x12')][_0x8f59('0x14')]);}logger[_0x8f59('0x12')](_0x8f59('0xe'),_0xdc1fa1,_0x5b3b8e[_0x8f59('0x12')][_0x8f59('0x14')]);return _0x327a92(_0x5b3b8e[_0x8f59('0x12')][_0x8f59('0x14')]);}else{logger[_0x8f59('0x15')](_0x8f59('0xe'),_0xdc1fa1,_0x8f59('0xf'));_0x327a92(_0x5b3b8e[_0x8f59('0x16')][_0x8f59('0x14')]);}})[_0x8f59('0x17')](function(_0x5c93c5){logger[_0x8f59('0x12')](_0x8f59('0xe'),_0xdc1fa1,_0x5c93c5);_0x1a191f(_0x5c93c5);});});}exports[_0x8f59('0x18')]=function(_0x53e107){var _0x5ca7b6=this;return new Promise(function(_0x4cda95,_0x241581){return db['Trunk'][_0x8f59('0x19')]({'raw':_0x53e107[_0x8f59('0x1a')]?_0x53e107[_0x8f59('0x1a')][_0x8f59('0x1b')]===undefined?!![]:![]:!![],'where':_0x53e107[_0x8f59('0x1a')]?_0x53e107[_0x8f59('0x1a')][_0x8f59('0x1c')]||null:null,'attributes':_0x53e107['options']?_0x53e107[_0x8f59('0x1a')][_0x8f59('0x1d')]||null:null,'limit':_0x53e107[_0x8f59('0x1a')]?_0x53e107[_0x8f59('0x1a')][_0x8f59('0x1e')]||null:null,'include':_0x53e107[_0x8f59('0x1a')]?_0x53e107[_0x8f59('0x1a')][_0x8f59('0x1f')]?_['map'](_0x53e107[_0x8f59('0x1a')]['include'],function(_0x140881){return{'model':db[_0x140881[_0x8f59('0x20')]],'as':_0x140881['as'],'attributes':_0x140881[_0x8f59('0x1d')],'include':_0x140881[_0x8f59('0x1f')]?_[_0x8f59('0x21')](_0x140881[_0x8f59('0x1f')],function(_0x4c802a){return{'model':db[_0x4c802a['model']],'as':_0x4c802a['as'],'attributes':_0x4c802a['attributes'],'include':_0x4c802a[_0x8f59('0x1f')]?_[_0x8f59('0x21')](_0x4c802a[_0x8f59('0x1f')],function(_0x744c73){return{'model':db[_0x744c73[_0x8f59('0x20')]],'as':_0x744c73['as'],'attributes':_0x744c73[_0x8f59('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8f59('0xd')](function(_0x4c4d2b){logger['info']('GetTrunk',_0x53e107);logger[_0x8f59('0x22')](_0x8f59('0x18'),_0x53e107,JSON[_0x8f59('0x11')](_0x4c4d2b));_0x4cda95(_0x4c4d2b);})['catch'](function(_0x7d3e70){logger['error']('GetTrunk',_0x7d3e70['message'],_0x53e107);_0x241581(_0x5ca7b6['error'](0x1f4,_0x7d3e70['message']));});});};exports[_0x8f59('0x23')]=function(_0x924bf0){var _0x183a1c=this;return new Promise(function(_0x180976,_0x1f5450){return db[_0x8f59('0x24')]['find']({'raw':_0x924bf0[_0x8f59('0x1a')]?_0x924bf0[_0x8f59('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x924bf0['options']?_0x924bf0['options'][_0x8f59('0x1c')]||null:null,'attributes':_0x924bf0[_0x8f59('0x1a')]?_0x924bf0[_0x8f59('0x1a')][_0x8f59('0x1d')]||null:null,'include':_0x924bf0['options']?_0x924bf0[_0x8f59('0x1a')]['include']?_['map'](_0x924bf0[_0x8f59('0x1a')][_0x8f59('0x1f')],function(_0x5e99aa){return{'model':db[_0x5e99aa[_0x8f59('0x20')]],'as':_0x5e99aa['as'],'attributes':_0x5e99aa[_0x8f59('0x1d')],'include':_0x5e99aa[_0x8f59('0x1f')]?_[_0x8f59('0x21')](_0x5e99aa[_0x8f59('0x1f')],function(_0x155b03){return{'model':db[_0x155b03[_0x8f59('0x20')]],'as':_0x155b03['as'],'attributes':_0x155b03['attributes'],'include':_0x155b03['include']?_[_0x8f59('0x21')](_0x155b03['include'],function(_0x4928bd){return{'model':db[_0x4928bd[_0x8f59('0x20')]],'as':_0x4928bd['as'],'attributes':_0x4928bd[_0x8f59('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8f59('0xd')](function(_0x2880db){logger['info'](_0x8f59('0x23'),_0x924bf0);logger[_0x8f59('0x22')]('ShowTrunk',_0x924bf0,JSON[_0x8f59('0x11')](_0x2880db));_0x180976(_0x2880db);})[_0x8f59('0x17')](function(_0x2f4784){logger['error']('ShowTrunk',_0x2f4784[_0x8f59('0x14')],_0x924bf0);_0x1f5450(_0x183a1c[_0x8f59('0x12')](0x1f4,_0x2f4784[_0x8f59('0x14')]));});});}; \ No newline at end of file +var _0x64f2=['raw','where','attributes','include','map','model','debug','catch','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTrunk','Trunk','options'];(function(_0x52baa9,_0x2b08c0){var _0x1d4ff7=function(_0x58ac03){while(--_0x58ac03){_0x52baa9['push'](_0x52baa9['shift']());}};_0x1d4ff7(++_0x2b08c0);}(_0x64f2,0x1f3));var _0x264f=function(_0x428229,_0x5ad254){_0x428229=_0x428229-0x0;var _0x3df79b=_0x64f2[_0x428229];return _0x3df79b;};'use strict';var _=require(_0x264f('0x0'));var util=require(_0x264f('0x1'));var moment=require(_0x264f('0x2'));var BPromise=require(_0x264f('0x3'));var rs=require(_0x264f('0x4'));var fs=require('fs');var Redis=require(_0x264f('0x5'));var db=require(_0x264f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x264f('0x7'))(_0x264f('0x8'));var config=require(_0x264f('0x9'));var jayson=require(_0x264f('0xa'));var client=jayson[_0x264f('0xb')][_0x264f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e30d1,_0x269766,_0x59cba9){return new BPromise(function(_0x413b2d,_0x5ea239){return client[_0x264f('0xd')](_0x1e30d1,_0x59cba9)[_0x264f('0xe')](function(_0x31eccf){logger[_0x264f('0xf')](_0x264f('0x10'),_0x269766,_0x264f('0x11'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x269766,_0x264f('0x11'),JSON[_0x264f('0x12')](_0x31eccf));if(_0x31eccf['error']){if(_0x31eccf[_0x264f('0x13')][_0x264f('0x14')]===0x1f4){logger[_0x264f('0x13')](_0x264f('0x10'),_0x269766,_0x31eccf['error']['message']);return _0x5ea239(_0x31eccf[_0x264f('0x13')][_0x264f('0x15')]);}logger[_0x264f('0x13')]('Trunk,\x20%s,\x20%s',_0x269766,_0x31eccf[_0x264f('0x13')][_0x264f('0x15')]);return _0x413b2d(_0x31eccf[_0x264f('0x13')][_0x264f('0x15')]);}else{logger[_0x264f('0xf')]('Trunk,\x20%s,\x20%s',_0x269766,'request\x20sent');_0x413b2d(_0x31eccf[_0x264f('0x16')][_0x264f('0x15')]);}})['catch'](function(_0x541a88){logger[_0x264f('0x13')](_0x264f('0x10'),_0x269766,_0x541a88);_0x5ea239(_0x541a88);});});}exports[_0x264f('0x17')]=function(_0x3192d6){var _0x37c036=this;return new Promise(function(_0x21c160,_0x397588){return db[_0x264f('0x18')]['findAll']({'raw':_0x3192d6[_0x264f('0x19')]?_0x3192d6[_0x264f('0x19')][_0x264f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3192d6['options']?_0x3192d6[_0x264f('0x19')][_0x264f('0x1b')]||null:null,'attributes':_0x3192d6[_0x264f('0x19')]?_0x3192d6[_0x264f('0x19')][_0x264f('0x1c')]||null:null,'limit':_0x3192d6[_0x264f('0x19')]?_0x3192d6[_0x264f('0x19')]['limit']||null:null,'include':_0x3192d6['options']?_0x3192d6[_0x264f('0x19')][_0x264f('0x1d')]?_[_0x264f('0x1e')](_0x3192d6[_0x264f('0x19')]['include'],function(_0x4806f1){return{'model':db[_0x4806f1['model']],'as':_0x4806f1['as'],'attributes':_0x4806f1['attributes'],'include':_0x4806f1[_0x264f('0x1d')]?_[_0x264f('0x1e')](_0x4806f1[_0x264f('0x1d')],function(_0xda5d26){return{'model':db[_0xda5d26['model']],'as':_0xda5d26['as'],'attributes':_0xda5d26[_0x264f('0x1c')],'include':_0xda5d26[_0x264f('0x1d')]?_[_0x264f('0x1e')](_0xda5d26['include'],function(_0xfdba7c){return{'model':db[_0xfdba7c[_0x264f('0x1f')]],'as':_0xfdba7c['as'],'attributes':_0xfdba7c[_0x264f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x264f('0xe')](function(_0xdaa383){logger['info'](_0x264f('0x17'),_0x3192d6);logger[_0x264f('0x20')](_0x264f('0x17'),_0x3192d6,JSON[_0x264f('0x12')](_0xdaa383));_0x21c160(_0xdaa383);})[_0x264f('0x21')](function(_0x381c6c){logger['error'](_0x264f('0x17'),_0x381c6c[_0x264f('0x15')],_0x3192d6);_0x397588(_0x37c036[_0x264f('0x13')](0x1f4,_0x381c6c['message']));});});};exports[_0x264f('0x22')]=function(_0x2e4a42){var _0x54d89c=this;return new Promise(function(_0x56232a,_0x389755){return db[_0x264f('0x18')]['find']({'raw':_0x2e4a42[_0x264f('0x19')]?_0x2e4a42[_0x264f('0x19')][_0x264f('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e4a42[_0x264f('0x19')]?_0x2e4a42[_0x264f('0x19')][_0x264f('0x1b')]||null:null,'attributes':_0x2e4a42[_0x264f('0x19')]?_0x2e4a42[_0x264f('0x19')][_0x264f('0x1c')]||null:null,'include':_0x2e4a42[_0x264f('0x19')]?_0x2e4a42['options'][_0x264f('0x1d')]?_[_0x264f('0x1e')](_0x2e4a42[_0x264f('0x19')][_0x264f('0x1d')],function(_0x1dd089){return{'model':db[_0x1dd089[_0x264f('0x1f')]],'as':_0x1dd089['as'],'attributes':_0x1dd089['attributes'],'include':_0x1dd089['include']?_['map'](_0x1dd089[_0x264f('0x1d')],function(_0x5d84a7){return{'model':db[_0x5d84a7[_0x264f('0x1f')]],'as':_0x5d84a7['as'],'attributes':_0x5d84a7[_0x264f('0x1c')],'include':_0x5d84a7[_0x264f('0x1d')]?_[_0x264f('0x1e')](_0x5d84a7[_0x264f('0x1d')],function(_0x48ad2e){return{'model':db[_0x48ad2e[_0x264f('0x1f')]],'as':_0x48ad2e['as'],'attributes':_0x48ad2e[_0x264f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x264f('0xe')](function(_0x2457df){logger[_0x264f('0xf')](_0x264f('0x22'),_0x2e4a42);logger['debug'](_0x264f('0x22'),_0x2e4a42,JSON[_0x264f('0x12')](_0x2457df));_0x56232a(_0x2457df);})[_0x264f('0x21')](function(_0x1a0106){logger[_0x264f('0x13')](_0x264f('0x22'),_0x1a0106[_0x264f('0x15')],_0x2e4a42);_0x389755(_0x54d89c[_0x264f('0x13')](0x1f4,_0x1a0106[_0x264f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 8606e46..510f7f1 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 _0xe5f3=['/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','diskStorage','join','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','logout','/:id/unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','/:id','update','/:id/password','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','/presence','show','/:id/avatar','/:id/open_tabs','getContacts'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xe5f3,0xd3));var _0x3e5f=function(_0x21c23e,_0x1d33e3){_0x21c23e=_0x21c23e-0x0;var _0xa7b7e2=_0xe5f3[_0x21c23e];return _0xa7b7e2;};'use strict';var multer=require(_0x3e5f('0x0'));var util=require(_0x3e5f('0x1'));var path=require(_0x3e5f('0x2'));var timeout=require(_0x3e5f('0x3'));var express=require('express');var router=express[_0x3e5f('0x4')]();var fs_extra=require(_0x3e5f('0x5'));var auth=require(_0x3e5f('0x6'));var interaction=require(_0x3e5f('0x7'));var config=require(_0x3e5f('0x8'));var controller=require(_0x3e5f('0x9'));router[_0x3e5f('0xa')]('/',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0xc')]);router[_0x3e5f('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x3e5f('0xd')]);router['get'](_0x3e5f('0xe'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0xf')]);router[_0x3e5f('0xa')](_0x3e5f('0x10'),auth[_0x3e5f('0xb')](),controller['getPresence']);router[_0x3e5f('0xa')]('/:id',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x11')]);router[_0x3e5f('0xa')](_0x3e5f('0x12'),controller['getAvatar']);router[_0x3e5f('0xa')](_0x3e5f('0x13'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x3e5f('0xa')]('/:id/contacts',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x14')]);router[_0x3e5f('0xa')](_0x3e5f('0x15'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x16')]);router[_0x3e5f('0xa')](_0x3e5f('0x17'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x18')]);router['get'](_0x3e5f('0x19'),auth[_0x3e5f('0xb')](),controller['getGroups']);router[_0x3e5f('0xa')](_0x3e5f('0x1a'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x1b')]);router[_0x3e5f('0xa')]('/:id/screen_recordings',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x1c')]);router['get']('/:id/chat/interactions',auth[_0x3e5f('0xb')](),controller['getChatInteractions']);router[_0x3e5f('0xa')](_0x3e5f('0x1d'),auth['isAuthenticated'](),controller[_0x3e5f('0x1e')]);router['get'](_0x3e5f('0x1f'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x20')]);router[_0x3e5f('0xa')](_0x3e5f('0x21'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x22')]);router[_0x3e5f('0xa')]('/:id/fax/interactions',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x23')]);router[_0x3e5f('0xa')](_0x3e5f('0x24'),auth['isAuthenticated'](),controller[_0x3e5f('0x25')]);router[_0x3e5f('0xa')](_0x3e5f('0x26'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x27')]);router[_0x3e5f('0xa')](_0x3e5f('0x28'),auth['isAuthenticated'](),controller[_0x3e5f('0x29')]);router[_0x3e5f('0xa')](_0x3e5f('0x2a'),auth[_0x3e5f('0xb')](),controller['getAgents']);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0x3e5f('0x2b')]);router[_0x3e5f('0xa')](_0x3e5f('0x2c'),auth[_0x3e5f('0xb')](),controller['getFaxAccounts']);router[_0x3e5f('0xa')](_0x3e5f('0x2d'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x2e')]);router['get'](_0x3e5f('0x2f'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x30')]);router[_0x3e5f('0xa')](_0x3e5f('0x31'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x32')]);router['get']('/:id/chat_websites',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x33')]);router['get'](_0x3e5f('0x34'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x35')]);router[_0x3e5f('0xa')](_0x3e5f('0x36'),auth['isAuthenticated'](),controller['getSquareProjects']);router['get'](_0x3e5f('0x37'),auth[_0x3e5f('0xb')](),controller['getScheduledCalls']);router[_0x3e5f('0xa')]('/:id/api_key',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x38')]);router[_0x3e5f('0x39')](_0x3e5f('0x3a'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x3b')]);router[_0x3e5f('0x39')]('/',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x3c')]);router[_0x3e5f('0x39')](_0x3e5f('0x3d'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x3e')]);router[_0x3e5f('0x39')](_0x3e5f('0x15'),auth[_0x3e5f('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x3e5f('0x3f')]({'destination':function(_0x39204c,_0x28a07f,_0x44e479){_0x44e479(null,path[_0x3e5f('0x40')](config['root'],_0x3e5f('0x41')));},'filename':function(_0x4c61f8,_0x145169,_0x33769e){_0x33769e(null,util['format'](_0x3e5f('0x42'),Date[_0x3e5f('0x43')](),_0x145169[_0x3e5f('0x44')]));}})});router['post'](_0x3e5f('0x12'),upload[_0x3e5f('0x45')](_0x3e5f('0x46')),controller[_0x3e5f('0x47')]);router[_0x3e5f('0x39')]('/:id/login',auth['isAuthenticated'](),controller[_0x3e5f('0x48')]);router[_0x3e5f('0x39')](_0x3e5f('0x49'),auth['isAuthenticated'](),controller[_0x3e5f('0x4a')]);router[_0x3e5f('0x39')]('/:id/pause',auth[_0x3e5f('0xb')](),controller['pause']);router[_0x3e5f('0x39')](_0x3e5f('0x4b'),auth['isAuthenticated'](),controller['unpause']);router[_0x3e5f('0x39')](_0x3e5f('0x26'),auth['isAuthenticated'](),controller[_0x3e5f('0x4c')]);router[_0x3e5f('0x39')]('/:id/chat_interactions',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x4d')]);router[_0x3e5f('0x39')](_0x3e5f('0x4e'),auth['isAuthenticated'](),controller[_0x3e5f('0x4f')]);router[_0x3e5f('0x39')](_0x3e5f('0x50'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x51')]);router[_0x3e5f('0x39')](_0x3e5f('0x52'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x53')]);router[_0x3e5f('0x39')](_0x3e5f('0x54'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x55')]);router[_0x3e5f('0x39')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x3e5f('0x56')]);router['post'](_0x3e5f('0x2c'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x57')]);router[_0x3e5f('0x39')](_0x3e5f('0x2d'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x3e5f('0x39')](_0x3e5f('0x2f'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x58')]);router['post'](_0x3e5f('0x31'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x59')]);router[_0x3e5f('0x39')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x3e5f('0x5a')]);router[_0x3e5f('0x39')](_0x3e5f('0x34'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x5b')]);router[_0x3e5f('0x39')](_0x3e5f('0x36'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x5c')]);router[_0x3e5f('0x39')](_0x3e5f('0x5d'),auth[_0x3e5f('0xb')](),controller['createApiKey']);router['put'](_0x3e5f('0x5e'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x5f')]);router['put'](_0x3e5f('0x60'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x61')]);router[_0x3e5f('0x62')](_0x3e5f('0x15'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x63')]);router[_0x3e5f('0x62')](_0x3e5f('0x26'),auth[_0x3e5f('0xb')](),controller['removeTeams']);router[_0x3e5f('0x62')]('/:id',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x64')]);router[_0x3e5f('0x62')](_0x3e5f('0x65'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x66')]);router[_0x3e5f('0x62')](_0x3e5f('0x4e'),auth['isAuthenticated'](),controller[_0x3e5f('0x67')]);router[_0x3e5f('0x62')](_0x3e5f('0x50'),auth['isAuthenticated'](),controller[_0x3e5f('0x68')]);router[_0x3e5f('0x62')](_0x3e5f('0x52'),auth[_0x3e5f('0xb')](),controller['removeSmsInteractions']);router[_0x3e5f('0x62')]('/:id/openchannel_interactions',auth[_0x3e5f('0xb')](),controller['removeOpenchannelInteractions']);router[_0x3e5f('0x62')](_0x3e5f('0x69'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x6a')]);router['delete'](_0x3e5f('0x2c'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x6b')]);router[_0x3e5f('0x62')](_0x3e5f('0x2d'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x6c')]);router[_0x3e5f('0x62')](_0x3e5f('0x2f'),auth[_0x3e5f('0xb')](),controller['removeOpenchannelAccounts']);router[_0x3e5f('0x62')](_0x3e5f('0x31'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x6d')]);router['delete'](_0x3e5f('0x6e'),auth['isAuthenticated'](),controller[_0x3e5f('0x6f')]);router['delete'](_0x3e5f('0x34'),auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x70')]);router['delete'](_0x3e5f('0x36'),auth['isAuthenticated'](),controller[_0x3e5f('0x71')]);router[_0x3e5f('0x62')]('/:id/api_key',auth[_0x3e5f('0xb')](),controller[_0x3e5f('0x72')]);module[_0x3e5f('0x73')]=router; \ No newline at end of file +var _0x6138=['removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','bulkCreate','addQueues','join','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6138,0x76));var _0x8613=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x6138[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x8613('0x0'));var path=require(_0x8613('0x1'));var timeout=require('connect-timeout');var express=require(_0x8613('0x2'));var router=express[_0x8613('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8613('0x4'));var interaction=require(_0x8613('0x5'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0x8613('0x6')](),controller[_0x8613('0x7')]);router[_0x8613('0x8')]('/describe',auth[_0x8613('0x6')](),controller[_0x8613('0x9')]);router[_0x8613('0x8')](_0x8613('0xa'),auth[_0x8613('0x6')](),controller[_0x8613('0xb')]);router[_0x8613('0x8')](_0x8613('0xc'),auth[_0x8613('0x6')](),controller[_0x8613('0xd')]);router[_0x8613('0x8')](_0x8613('0xe'),auth[_0x8613('0x6')](),controller[_0x8613('0xf')]);router[_0x8613('0x8')]('/:id/avatar',controller[_0x8613('0x10')]);router[_0x8613('0x8')](_0x8613('0x11'),auth[_0x8613('0x6')](),controller['getOpenTabs']);router['get'](_0x8613('0x12'),auth[_0x8613('0x6')](),controller[_0x8613('0x13')]);router['get'](_0x8613('0x14'),auth[_0x8613('0x6')](),controller['getQueues']);router[_0x8613('0x8')](_0x8613('0x15'),auth['isAuthenticated'](),controller[_0x8613('0x16')]);router[_0x8613('0x8')]('/:id/groups',auth[_0x8613('0x6')](),controller[_0x8613('0x17')]);router[_0x8613('0x8')]('/:id/recordings',auth[_0x8613('0x6')](),controller['getRecordings']);router[_0x8613('0x8')](_0x8613('0x18'),auth['isAuthenticated'](),controller[_0x8613('0x19')]);router[_0x8613('0x8')](_0x8613('0x1a'),auth[_0x8613('0x6')](),controller[_0x8613('0x1b')]);router['get']('/:id/openchannel/interactions',auth[_0x8613('0x6')](),controller[_0x8613('0x1c')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x8613('0x8')](_0x8613('0x1d'),auth[_0x8613('0x6')](),controller[_0x8613('0x1e')]);router[_0x8613('0x8')]('/:id/fax/interactions',auth[_0x8613('0x6')](),controller[_0x8613('0x1f')]);router[_0x8613('0x8')](_0x8613('0x20'),auth[_0x8613('0x6')](),controller[_0x8613('0x21')]);router[_0x8613('0x8')](_0x8613('0x22'),auth[_0x8613('0x6')](),controller[_0x8613('0x23')]);router['get']('/:id/lists',auth[_0x8613('0x6')](),controller[_0x8613('0x24')]);router[_0x8613('0x8')](_0x8613('0x25'),auth['isAuthenticated'](),controller[_0x8613('0x26')]);router['get'](_0x8613('0x27'),auth[_0x8613('0x6')](),controller['getVoicePrefixes']);router[_0x8613('0x8')](_0x8613('0x28'),auth['isAuthenticated'](),controller[_0x8613('0x29')]);router[_0x8613('0x8')](_0x8613('0x2a'),auth[_0x8613('0x6')](),controller[_0x8613('0x2b')]);router[_0x8613('0x8')](_0x8613('0x2c'),auth['isAuthenticated'](),controller[_0x8613('0x2d')]);router[_0x8613('0x8')]('/:id/sms_accounts',auth[_0x8613('0x6')](),controller[_0x8613('0x2e')]);router[_0x8613('0x8')](_0x8613('0x2f'),auth[_0x8613('0x6')](),controller[_0x8613('0x30')]);router['get'](_0x8613('0x31'),auth[_0x8613('0x6')](),controller[_0x8613('0x32')]);router[_0x8613('0x8')](_0x8613('0x33'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x8613('0x8')](_0x8613('0x34'),auth[_0x8613('0x6')](),controller[_0x8613('0x35')]);router[_0x8613('0x8')](_0x8613('0x36'),auth[_0x8613('0x6')](),controller['getApiKey']);router[_0x8613('0x37')](_0x8613('0x12'),auth[_0x8613('0x6')](),controller[_0x8613('0x38')]);router[_0x8613('0x37')]('/',auth['isAuthenticated'](),controller[_0x8613('0x39')]);router['post']('/create_many',auth[_0x8613('0x6')](),controller[_0x8613('0x3a')]);router[_0x8613('0x37')](_0x8613('0x14'),auth[_0x8613('0x6')](),controller[_0x8613('0x3b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4cdf1,_0x39c0ec,_0x4dc06e){_0x4dc06e(null,path[_0x8613('0x3c')](config['root'],_0x8613('0x3d')));},'filename':function(_0x39b2e8,_0x3e9b99,_0x55cbe8){_0x55cbe8(null,util[_0x8613('0x3e')](_0x8613('0x3f'),Date[_0x8613('0x40')](),_0x3e9b99[_0x8613('0x41')]));}})});router[_0x8613('0x37')](_0x8613('0x42'),upload['single']('file'),controller[_0x8613('0x43')]);router[_0x8613('0x37')](_0x8613('0x44'),auth[_0x8613('0x6')](),controller[_0x8613('0x45')]);router['post'](_0x8613('0x46'),auth[_0x8613('0x6')](),controller[_0x8613('0x47')]);router[_0x8613('0x37')]('/:id/pause',auth[_0x8613('0x6')](),controller[_0x8613('0x48')]);router[_0x8613('0x37')](_0x8613('0x49'),auth[_0x8613('0x6')](),controller['unpause']);router['post']('/:id/teams',auth[_0x8613('0x6')](),controller[_0x8613('0x4a')]);router[_0x8613('0x37')](_0x8613('0x4b'),auth[_0x8613('0x6')](),controller['addChatInteractions']);router[_0x8613('0x37')](_0x8613('0x4c'),auth[_0x8613('0x6')](),controller[_0x8613('0x4d')]);router[_0x8613('0x37')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x8613('0x4e')]);router[_0x8613('0x37')](_0x8613('0x4f'),auth[_0x8613('0x6')](),controller['addSmsInteractions']);router[_0x8613('0x37')](_0x8613('0x50'),auth[_0x8613('0x6')](),controller[_0x8613('0x51')]);router[_0x8613('0x37')](_0x8613('0x52'),auth[_0x8613('0x6')](),controller[_0x8613('0x53')]);router[_0x8613('0x37')](_0x8613('0x28'),auth[_0x8613('0x6')](),controller[_0x8613('0x54')]);router['post'](_0x8613('0x2a'),auth['isAuthenticated'](),controller[_0x8613('0x55')]);router[_0x8613('0x37')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x8613('0x37')](_0x8613('0x56'),auth[_0x8613('0x6')](),controller[_0x8613('0x57')]);router['post']('/:id/chat_websites',auth[_0x8613('0x6')](),controller['addChatWebsites']);router[_0x8613('0x37')](_0x8613('0x31'),auth[_0x8613('0x6')](),controller[_0x8613('0x58')]);router[_0x8613('0x37')](_0x8613('0x33'),auth[_0x8613('0x6')](),controller[_0x8613('0x59')]);router[_0x8613('0x37')](_0x8613('0x36'),auth['isAuthenticated'](),controller[_0x8613('0x5a')]);router[_0x8613('0x5b')]('/:id',auth[_0x8613('0x6')](),controller[_0x8613('0x5c')]);router[_0x8613('0x5b')](_0x8613('0x5d'),auth['isAuthenticated'](),controller[_0x8613('0x5e')]);router[_0x8613('0x5f')](_0x8613('0x14'),auth['isAuthenticated'](),controller[_0x8613('0x60')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x8613('0x5f')](_0x8613('0xe'),auth['isAuthenticated'](),controller[_0x8613('0x61')]);router[_0x8613('0x5f')](_0x8613('0x4b'),auth[_0x8613('0x6')](),controller[_0x8613('0x62')]);router[_0x8613('0x5f')](_0x8613('0x4c'),auth[_0x8613('0x6')](),controller[_0x8613('0x63')]);router[_0x8613('0x5f')](_0x8613('0x64'),auth['isAuthenticated'](),controller[_0x8613('0x65')]);router[_0x8613('0x5f')](_0x8613('0x4f'),auth[_0x8613('0x6')](),controller[_0x8613('0x66')]);router[_0x8613('0x5f')](_0x8613('0x50'),auth[_0x8613('0x6')](),controller[_0x8613('0x67')]);router[_0x8613('0x5f')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x8613('0x68')]);router[_0x8613('0x5f')](_0x8613('0x28'),auth['isAuthenticated'](),controller[_0x8613('0x69')]);router[_0x8613('0x5f')](_0x8613('0x2a'),auth[_0x8613('0x6')](),controller['removeMailAccounts']);router[_0x8613('0x5f')](_0x8613('0x2c'),auth[_0x8613('0x6')](),controller['removeOpenchannelAccounts']);router[_0x8613('0x5f')]('/:id/sms_accounts',auth[_0x8613('0x6')](),controller['removeSmsAccounts']);router[_0x8613('0x5f')](_0x8613('0x2f'),auth[_0x8613('0x6')](),controller['removeChatWebsites']);router[_0x8613('0x5f')](_0x8613('0x31'),auth['isAuthenticated'](),controller[_0x8613('0x6a')]);router[_0x8613('0x5f')](_0x8613('0x33'),auth[_0x8613('0x6')](),controller[_0x8613('0x6b')]);router[_0x8613('0x5f')](_0x8613('0x36'),auth[_0x8613('0x6')](),controller[_0x8613('0x6c')]);module[_0x8613('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index cbd044c..4be2145 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 _0xd47f=['local','INTEGER','accountcode','callerid','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','split','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','admin'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0xd47f,0x1bd));var _0xfd47=function(_0x30af6f,_0x31ae68){_0x30af6f=_0x30af6f-0x0;var _0x9c1ea5=_0xd47f[_0x30af6f];return _0x9c1ea5;};'use strict';var Sequelize=require(_0xfd47('0x0'));var moment=require('moment');var util=require(_0xfd47('0x1'));var _=require(_0xfd47('0x2'));module[_0xfd47('0x3')]={'name':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'unique':_0xfd47('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x32a237){this[_0xfd47('0x6')](_0xfd47('0x5'),_0x32a237);this[_0xfd47('0x6')](_0xfd47('0x7'),_0x32a237);},'comment':_0xfd47('0x8')},'fullname':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'set':function(_0x55fd0b){this['setDataValue'](_0xfd47('0x9'),_0x55fd0b);this['setDataValue']('callerid',util['format'](_0xfd47('0xa'),_0x55fd0b,this[_0xfd47('0xb')](_0xfd47('0xc'))));}},'alias':{'type':Sequelize[_0xfd47('0x4')]},'email':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'unique':_0xfd47('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5a6644){if(_0x5a6644){this['setDataValue'](_0xfd47('0xd'),_0x5a6644['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xfd47('0xe'),'user','agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xfd47('0xf')},'internal':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':![],'unique':_0xfd47('0xc'),'set':function(_0x49c00a){this[_0xfd47('0x6')](_0xfd47('0xc'),_0x49c00a);this[_0xfd47('0x6')](_0xfd47('0x11'),_0x49c00a);this['setDataValue'](_0xfd47('0x12'),util[_0xfd47('0x13')](_0xfd47('0xa'),this['getDataValue']('fullname'),_0x49c00a));}},'salt':{'type':Sequelize[_0xfd47('0x4')]},'phone':{'type':Sequelize[_0xfd47('0x4')]},'mobile':{'type':Sequelize[_0xfd47('0x4')]},'address':{'type':Sequelize[_0xfd47('0x4')]},'zipcode':{'type':Sequelize[_0xfd47('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfd47('0x4')]},'country':{'type':Sequelize[_0xfd47('0x4')]},'online':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfd47('0x15')]},'voicePause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':_0xfd47('0x16')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfd47('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfd47('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x17')},'ipaddr':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xfd47('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x19'),_0xfd47('0x1a'),_0xfd47('0x1b')),'allowNull':!![],'defaultValue':_0xfd47('0x19')},'context':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x1c')},'callingpres':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x1d'),'ALLOWED_PASSED_SCREEN',_0xfd47('0x1e'),_0xfd47('0x1f'),_0xfd47('0x20'),'PROHIB_PASSED_SCREEN',_0xfd47('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x22'),'set':function(_0x3d95bc){this[_0xfd47('0x6')](_0xfd47('0x23'),_0x3d95bc?_0x3d95bc[_0xfd47('0x24')](','):null);},'get':function(){return this[_0xfd47('0xb')]('transport')?this[_0xfd47('0xb')](_0xfd47('0x23'))['split'](','):null;},'comment':_0xfd47('0x25')},'dtmfmode':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x26'),'info',_0xfd47('0x27'),'inband',_0xfd47('0x28')),'allowNull':!![],'defaultValue':_0xfd47('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no',_0xfd47('0x2a'),_0xfd47('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x2c'),'set':function(_0x516a4c){this[_0xfd47('0x6')](_0xfd47('0x2d'),_0x516a4c?_0x516a4c['join'](','):null);},'get':function(){return this['getDataValue'](_0xfd47('0x2d'))?this['getDataValue'](_0xfd47('0x2d'))['split'](','):null;},'comment':_0xfd47('0x2e')},'callgroup':{'type':Sequelize[_0xfd47('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfd47('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'defaultValue':_0xfd47('0x2f'),'set':function(_0x2c70a8){this['setDataValue']('allow',_0x2c70a8?_0x2c70a8['join'](';'):_0xfd47('0x2f'));},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x30'))?this[_0xfd47('0xb')](_0xfd47('0x30'))['split'](';'):null;},'comment':_0xfd47('0x31')},'autoframing':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'set':function(_0xf0727c){this[_0xfd47('0x6')](_0xfd47('0x32'),_0xf0727c?_0xf0727c[_0xfd47('0x24')](','):null);},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x32'))?this[_0xfd47('0xb')](_0xfd47('0x32'))['split'](','):null;},'comment':_0xfd47('0x33')},'trustrpid':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfd47('0x18')]('yes','no',_0xfd47('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x35')},'amaflags':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![],'defaultValue':_0xfd47('0x29')},'busylevel':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfd47('0x18')]('yes','no',_0xfd47('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xfd47('0x37'),_0xfd47('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x39'),_0xfd47('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfd47('0x29')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xfd47('0x3b'),_0xfd47('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x3d'),_0xfd47('0x3e'),_0xfd47('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no',_0xfd47('0x2a'),_0xfd47('0x2b'),_0xfd47('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfd47('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfd47('0x15')]},'passwordResetAt':{'type':Sequelize[_0xfd47('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0,'set':function(_0x583e85){this[_0xfd47('0x6')](_0xfd47('0x41'),_0x583e85);var _0x2b2ae1=this['get']({'plain':!![]});switch(_0x583e85){case 0x0:case 0x1:var _0xb988b9=_0x2b2ae1[_0xfd47('0x23')]?_[_0xfd47('0x42')](_0x2b2ae1[_0xfd47('0x23')])?_0x2b2ae1['transport'][_0xfd47('0x24')]():_0x2b2ae1[_0xfd47('0x23')]:_0xfd47('0x22');if(_0xb988b9===_0xfd47('0x43')){_0xb988b9=_0xfd47('0x22');}this[_0xfd47('0x6')](_0xfd47('0x23'),_0xb988b9);this[_0xfd47('0x6')](_0xfd47('0x44'),'no');this['setDataValue'](_0xfd47('0x45'),null);this[_0xfd47('0x6')](_0xfd47('0x46'),null);this[_0xfd47('0x6')]('icesupport',null);this['setDataValue'](_0xfd47('0x47'),null);this['setDataValue'](_0xfd47('0x48'),null);this[_0xfd47('0x6')](_0xfd47('0x49'),null);this[_0xfd47('0x6')](_0xfd47('0x4a'),null);this[_0xfd47('0x6')](_0xfd47('0x4b'),null);this[_0xfd47('0x6')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xfd47('0x23'),_0xfd47('0x43'));this[_0xfd47('0x6')](_0xfd47('0x44'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x45'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x46'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x4c'),'yes');this['setDataValue'](_0xfd47('0x47'),'yes');this[_0xfd47('0x6')](_0xfd47('0x48'),'no');this['setDataValue']('dtlssetup',_0xfd47('0x3f'));this[_0xfd47('0x6')]('dtlscertfile',_0x2b2ae1[_0xfd47('0x4a')]||_0xfd47('0x4d'));this[_0xfd47('0x6')](_0xfd47('0x4b'),_0x2b2ae1[_0xfd47('0x4b')]||_0xfd47('0x4e'));this[_0xfd47('0x6')](_0xfd47('0x4f'),_0xfd47('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xfd47('0x50')],'set':function(_0x4e39d3){this[_0xfd47('0x6')](_0xfd47('0x51'),_0x4e39d3?_0x4e39d3[_0xfd47('0x24')](','):[]);},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x51'))?_[_0xfd47('0x52')](this[_0xfd47('0xb')](_0xfd47('0x51'))[_0xfd47('0x53')](','),function(_0x1ef84e){return parseInt(_0x1ef84e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfd47('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xfd47('0xb')](_0xfd47('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![],'set':function(_0x4cea58){if(typeof _0x4cea58===_0xfd47('0x55')){var _0x2119c1=_0x4cea58==='1'?!![]:_0x4cea58==='0'?![]:_0x4cea58===_0xfd47('0x56')?!![]:_0x4cea58===_0xfd47('0x57')?![]:![];this[_0xfd47('0x6')](_0xfd47('0x58'),_0x2119c1);}else{this['setDataValue']('screenrecording',_0x4cea58);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x64f723){this['setDataValue'](_0xfd47('0x59'),_0x64f723);if(_0x64f723===!![]){this[_0xfd47('0x6')](_0xfd47('0x5a'),moment());this[_0xfd47('0x6')]('loginAttempts',0x0);}else{this[_0xfd47('0x6')](_0xfd47('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfd47('0x10')](0x5)[_0xfd47('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1cb9=['internal','email','toLowerCase','ENUM','user','agent','local','INTEGER','callerid','fullname','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','auto','update','outgoing','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uas','fingerprint','certificate','active','actpass','nonat','update,nonat','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','exports','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','getDataValue'];(function(_0xcb67f5,_0x53ecbc){var _0x4d29c3=function(_0x1f4350){while(--_0x1f4350){_0xcb67f5['push'](_0xcb67f5['shift']());}};_0x4d29c3(++_0x53ecbc);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21940e,_0x232ece){_0x21940e=_0x21940e-0x0;var _0x495aa4=_0x1cb9[_0x21940e];return _0x495aa4;};'use strict';var Sequelize=require(_0x91cb('0x0'));var moment=require('moment');var util=require(_0x91cb('0x1'));var _=require(_0x91cb('0x2'));module[_0x91cb('0x3')]={'name':{'type':Sequelize[_0x91cb('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x42910d){this[_0x91cb('0x5')]('name',_0x42910d);this[_0x91cb('0x5')](_0x91cb('0x6'),_0x42910d);},'comment':_0x91cb('0x7')},'fullname':{'type':Sequelize[_0x91cb('0x4')],'allowNull':![],'set':function(_0x3b9d98){this[_0x91cb('0x5')]('fullname',_0x3b9d98);this[_0x91cb('0x5')]('callerid',util[_0x91cb('0x8')]('\x22%s\x22\x20<%s>',_0x3b9d98,this[_0x91cb('0x9')](_0x91cb('0xa'))));}},'alias':{'type':Sequelize[_0x91cb('0x4')]},'email':{'type':Sequelize[_0x91cb('0x4')],'allowNull':![],'unique':_0x91cb('0xb'),'validate':{'isEmail':!![]},'set':function(_0x23ba9a){if(_0x23ba9a){this[_0x91cb('0x5')](_0x91cb('0xb'),_0x23ba9a[_0x91cb('0xc')]());}}},'role':{'type':Sequelize[_0x91cb('0xd')]('admin',_0x91cb('0xe'),_0x91cb('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x91cb('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x91cb('0x4')],'defaultValue':_0x91cb('0x10')},'internal':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4cc6ef){this[_0x91cb('0x5')](_0x91cb('0xa'),_0x4cc6ef);this['setDataValue']('accountcode',_0x4cc6ef);this[_0x91cb('0x5')](_0x91cb('0x12'),util[_0x91cb('0x8')]('\x22%s\x22\x20<%s>',this[_0x91cb('0x9')](_0x91cb('0x13')),_0x4cc6ef));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x91cb('0x4')]},'mobile':{'type':Sequelize[_0x91cb('0x4')]},'address':{'type':Sequelize[_0x91cb('0x4')]},'zipcode':{'type':Sequelize[_0x91cb('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x91cb('0x4')]},'country':{'type':Sequelize[_0x91cb('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x91cb('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x91cb('0x4')],'defaultValue':_0x91cb('0x16')},'lastPauseAt':{'type':Sequelize[_0x91cb('0x14')]},'chatCapacity':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x91cb('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x91cb('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x91cb('0x17')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x91cb('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x18'),_0x91cb('0xe'),_0x91cb('0x19')),'allowNull':!![],'defaultValue':_0x91cb('0x18')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x91cb('0x1a')},'callingpres':{'type':Sequelize['ENUM'](_0x91cb('0x1b'),_0x91cb('0x1c'),_0x91cb('0x1d'),'ALLOWED',_0x91cb('0x1e'),_0x91cb('0x1f'),_0x91cb('0x20'),_0x91cb('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x91cb('0x22'),'set':function(_0x474a15){this[_0x91cb('0x5')](_0x91cb('0x23'),_0x474a15?_0x474a15[_0x91cb('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x91cb('0x23'))?this[_0x91cb('0x9')](_0x91cb('0x23'))[_0x91cb('0x25')](','):null;},'comment':_0x91cb('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x91cb('0x27'),'info','shortinfo','inband',_0x91cb('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x91cb('0xd')]('yes','no','nonat',_0x91cb('0x29'),_0x91cb('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![],'defaultValue':_0x91cb('0x2c'),'set':function(_0x13a5ea){this[_0x91cb('0x5')]('nat',_0x13a5ea?_0x13a5ea['join'](','):null);},'get':function(){return this[_0x91cb('0x9')](_0x91cb('0x2d'))?this['getDataValue'](_0x91cb('0x2d'))[_0x91cb('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x91cb('0x4')]},'namedcallgroup':{'type':Sequelize[_0x91cb('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x91cb('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x91cb('0x4')]},'disallow':{'type':Sequelize[_0x91cb('0x4')],'allowNull':![],'defaultValue':_0x91cb('0x2e')},'allow':{'type':Sequelize[_0x91cb('0x4')],'allowNull':![],'defaultValue':_0x91cb('0x2f'),'set':function(_0x20bf50){this['setDataValue'](_0x91cb('0x30'),_0x20bf50?_0x20bf50[_0x91cb('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x91cb('0x9')]('allow')?this[_0x91cb('0x9')](_0x91cb('0x30'))[_0x91cb('0x25')](';'):null;},'comment':_0x91cb('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![],'set':function(_0x2cf27e){this[_0x91cb('0x5')](_0x91cb('0x32'),_0x2cf27e?_0x2cf27e[_0x91cb('0x24')](','):null);},'get':function(){return this[_0x91cb('0x9')](_0x91cb('0x32'))?this[_0x91cb('0x9')](_0x91cb('0x32'))['split'](','):null;},'comment':_0x91cb('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no',_0x91cb('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![],'defaultValue':_0x91cb('0x35')},'amaflags':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x91cb('0x2b')},'busylevel':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x91cb('0xd')]('yes','no',_0x91cb('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x37'),'refuse',_0x91cb('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0x91cb('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x91cb('0x2b')},'keepalive':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x91cb('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x91cb('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x91cb('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no',_0x91cb('0x3a'),_0x91cb('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x91cb('0x3c'),'passive',_0x91cb('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x91cb('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x91cb('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no',_0x91cb('0x3e'),'update',_0x91cb('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x91cb('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0,'set':function(_0x1237fd){this['setDataValue']('showWebBar',_0x1237fd);var _0x2ef82f=this['get']({'plain':!![]});switch(_0x1237fd){case 0x0:case 0x1:var _0x1b69ce=_0x2ef82f[_0x91cb('0x23')]?_[_0x91cb('0x40')](_0x2ef82f['transport'])?_0x2ef82f[_0x91cb('0x23')]['join']():_0x2ef82f[_0x91cb('0x23')]:_0x91cb('0x22');if(_0x1b69ce===_0x91cb('0x41')){_0x1b69ce=_0x91cb('0x22');}this['setDataValue'](_0x91cb('0x23'),_0x1b69ce);this[_0x91cb('0x5')](_0x91cb('0x42'),'no');this[_0x91cb('0x5')](_0x91cb('0x43'),null);this[_0x91cb('0x5')](_0x91cb('0x44'),null);this[_0x91cb('0x5')](_0x91cb('0x45'),null);this[_0x91cb('0x5')](_0x91cb('0x46'),null);this[_0x91cb('0x5')]('dtlsverify',null);this[_0x91cb('0x5')](_0x91cb('0x47'),null);this[_0x91cb('0x5')](_0x91cb('0x48'),null);this[_0x91cb('0x5')](_0x91cb('0x49'),null);this[_0x91cb('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x91cb('0x5')]('transport',_0x91cb('0x41'));this[_0x91cb('0x5')](_0x91cb('0x42'),_0x91cb('0x2b'));this['setDataValue'](_0x91cb('0x43'),_0x91cb('0x2b'));this[_0x91cb('0x5')](_0x91cb('0x44'),_0x91cb('0x2b'));this[_0x91cb('0x5')]('icesupport',_0x91cb('0x2b'));this[_0x91cb('0x5')](_0x91cb('0x46'),_0x91cb('0x2b'));this[_0x91cb('0x5')](_0x91cb('0x4a'),'no');this[_0x91cb('0x5')](_0x91cb('0x47'),_0x91cb('0x3d'));this[_0x91cb('0x5')](_0x91cb('0x48'),_0x2ef82f[_0x91cb('0x48')]||_0x91cb('0x4b'));this[_0x91cb('0x5')](_0x91cb('0x49'),_0x2ef82f[_0x91cb('0x49')]||_0x91cb('0x4c'));this['setDataValue'](_0x91cb('0x4d'),_0x91cb('0x2b'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x37719c){this[_0x91cb('0x5')](_0x91cb('0x4e'),_0x37719c?_0x37719c['join'](','):[]);},'get':function(){return this[_0x91cb('0x9')](_0x91cb('0x4e'))?_['map'](this['getDataValue'](_0x91cb('0x4e'))['split'](','),function(_0x2a9515){return parseInt(_0x2a9515,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x91cb('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x91cb('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x91cb('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x91cb('0xd')](_0x91cb('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x91cb('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x91cb('0x9')](_0x91cb('0x4f'))?this[_0x91cb('0x9')](_0x91cb('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x91cb('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![],'set':function(_0x33d4ab){if(typeof _0x33d4ab===_0x91cb('0x50')){var _0x12d3d1=_0x33d4ab==='1'?!![]:_0x33d4ab==='0'?![]:_0x33d4ab==='true'?!![]:_0x33d4ab===_0x91cb('0x51')?![]:![];this[_0x91cb('0x5')]('screenrecording',_0x12d3d1);}else{this[_0x91cb('0x5')]('screenrecording',_0x33d4ab);}}},'blocked':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![],'set':function(_0x3ba2cf){this[_0x91cb('0x5')](_0x91cb('0x52'),_0x3ba2cf);if(_0x3ba2cf===!![]){this[_0x91cb('0x5')](_0x91cb('0x53'),moment());this[_0x91cb('0x5')](_0x91cb('0x54'),0x0);}else{this[_0x91cb('0x5')](_0x91cb('0x53'),null);}}},'blockedAt':{'type':Sequelize[_0x91cb('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x91cb('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x91cb('0x11')](0x5)[_0x91cb('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x91cb('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 1a6e7a9..8c51d83 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 _0x47c5=['telephone','filter','ignore','map','value','includes','stack','name','send','rawAttributes','fieldName','salt','where','User','query','includeAll','include','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','password','intersection','fields','options','find','true','update','body','describe','addContacts','ids','internal','Setting','findById','min_internal','isNil','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)','QueryTypes','SELECT','from','mailbox','fullname','email','permissions','101','113','110','104','105','108','109','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','isEmpty','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','format','each','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Unknown\x20channel','remove','Queue:remove','voice','addAvatar','file','filename','root','userpic','download','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','filters','order','sort','pick','CmList','List','Tag','color','tag','nolimit','limit','getContacts','getQueues','Queue','merge','Unknown\x20role','hasOwnProperty','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','count','getScreenRecordings','ScreenRecording','UserId','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','isMiddleware','resolve','QueuePause','pause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','faxPause','openchannelPause','pauseType','lastPauseAt','%s%s','manual','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','Sms','Whatsapp','getFaxQueues','Fax','Openchannel','transaction','addAgent','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','getVoiceQueues','getWhatsappQueues','flatten','removeAgent','UserVoicePrefix','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','firstName','phone','Contact','getApiKey','retrieveApiKey','token','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','VoiceQueue','inbound','lower','col','asc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','slice','charAt','toUpperCase','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','toString','moment','bluebird','util','path','lodash','squel','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','set','Content-Range','destroy','get','role','admin','user','Agents','agent','Telephones'];(function(_0x4f723f,_0xbdf4e7){var _0x3f01a0=function(_0x1a4791){while(--_0x1a4791){_0x4f723f['push'](_0x4f723f['shift']());}};_0x3f01a0(++_0xbdf4e7);}(_0x47c5,0x165));var _0x547c=function(_0x5d4ca7,_0x19113b){_0x5d4ca7=_0x5d4ca7-0x0;var _0x3efc03=_0x47c5[_0x5d4ca7];return _0x3efc03;};'use strict';var moment=require(_0x547c('0x0'));var BPromise=require(_0x547c('0x1'));var util=require(_0x547c('0x2'));var path=require(_0x547c('0x3'));var fs=require('fs');var _=require(_0x547c('0x4'));var squel=require(_0x547c('0x5'));var jayson=require('jayson/promise');var Redis=require(_0x547c('0x6'));var authService=require(_0x547c('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x547c('0x8'))(_0x547c('0x9'));var utils=require('../../config/utils');var config=require(_0x547c('0xa'));var licenseUtil=require(_0x547c('0xb'));var db=require(_0x547c('0xc'))['db'];var socket=require(_0x547c('0xd'))(new Redis(config[_0x547c('0xe')]));require(_0x547c('0xf'))[_0x547c('0x10')](socket);config[_0x547c('0xe')]=_[_0x547c('0x11')](config[_0x547c('0xe')],{'host':_0x547c('0x12'),'port':0x18eb});var client=jayson[_0x547c('0x13')][_0x547c('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2455e9,_0x386e2c,_0x8addbe,_0x44ab17){return new BPromise(function(_0x549bf0,_0x13a103){var _0x39dce7=_0x44ab17||client;return _0x39dce7['request'](_0x2455e9,_0x8addbe)[_0x547c('0x15')](function(_0x201d95){logger[_0x547c('0x16')](_0x547c('0x17'),_0x386e2c,_0x547c('0x18'));logger[_0x547c('0x19')](_0x547c('0x1a'),_0x386e2c,_0x547c('0x18'),JSON[_0x547c('0x1b')](_0x201d95));if(_0x201d95[_0x547c('0x1c')]){if(_0x201d95[_0x547c('0x1c')][_0x547c('0x1d')]===0x1f4){logger[_0x547c('0x1c')](_0x547c('0x17'),_0x386e2c,_0x201d95[_0x547c('0x1c')][_0x547c('0x1e')]);return _0x13a103(_0x201d95[_0x547c('0x1c')][_0x547c('0x1e')]);}logger['error']('User,\x20%s,\x20%s',_0x386e2c,_0x201d95[_0x547c('0x1c')][_0x547c('0x1e')]);return _0x549bf0(_0x201d95[_0x547c('0x1c')]['message']);}else{logger[_0x547c('0x16')](_0x547c('0x17'),_0x386e2c,_0x547c('0x18'));_0x549bf0(_0x201d95['result'][_0x547c('0x1e')]);}})[_0x547c('0x1f')](function(_0x496c38){logger['error'](_0x547c('0x17'),_0x386e2c,_0x496c38);_0x13a103(_0x496c38);});});}function respondWithStatusCode(_0x4ce2a6,_0x4f20c1){_0x4f20c1=_0x4f20c1||0xcc;return function(_0x11e709){if(_0x11e709){return _0x4ce2a6[_0x547c('0x20')](_0x4f20c1);}return _0x4ce2a6['status'](_0x4f20c1)[_0x547c('0x21')]();};}function respondWithResult(_0x17fd97,_0x436e67){_0x436e67=_0x436e67||0xc8;return function(_0x4c718c){if(_0x4c718c){return _0x17fd97[_0x547c('0x22')](_0x436e67)[_0x547c('0x23')](_0x4c718c);}};}function respondWithFilteredResult(_0x470694,_0x26823c){return function(_0x1f3581){if(_0x1f3581){var _0x2663bc=typeof _0x26823c[_0x547c('0x24')]===_0x547c('0x25')&&typeof _0x26823c['limit']===_0x547c('0x25');var _0x4c66b9=_0x1f3581['count'];var _0x4855fd=_0x2663bc?0x0:_0x26823c['offset'];var _0x2c725d=_0x2663bc?_0x1f3581['count']:_0x26823c[_0x547c('0x24')]+_0x26823c['limit'];var _0x3ea493;if(_0x2c725d>=_0x4c66b9){_0x2c725d=_0x4c66b9;_0x3ea493=0xc8;}else{_0x3ea493=0xce;}_0x470694['status'](_0x3ea493);return _0x470694[_0x547c('0x26')](_0x547c('0x27'),_0x4855fd+'-'+_0x2c725d+'/'+_0x4c66b9)[_0x547c('0x23')](_0x1f3581);}return null;};}function saveUpdates(_0x30a96c){return function(_0x198afb){if(_0x198afb){return _0x198afb['update'](_0x30a96c)['then'](function(_0x28c282){return _0x28c282;});}return null;};}function removeEntity(_0x54de6f){return function(_0x303b57){if(_0x303b57){return _0x303b57[_0x547c('0x28')]()[_0x547c('0x15')](function(){var _0x1695be=_0x303b57[_0x547c('0x29')]({'plain':!![]});if(_0x1695be[_0x547c('0x2a')]===_0x547c('0x2b'))return;var _0x4d4dbd=[{'name':'Users','value':_0x547c('0x2c'),'ignore':!![]},{'name':_0x547c('0x2d'),'value':_0x547c('0x2e'),'ignore':![]},{'name':_0x547c('0x2f'),'value':_0x547c('0x30'),'ignore':![]}];var _0x18d7c1=_(_0x4d4dbd)[_0x547c('0x31')](_0x547c('0x32'))[_0x547c('0x33')](_0x547c('0x34'))[_0x547c('0x34')]();if(_[_0x547c('0x35')](_0x18d7c1,_0x1695be[_0x547c('0x2a')])){return;}var _0x385275=_['find'](_0x4d4dbd,[_0x547c('0x34'),_0x1695be['role']])['name'];return db['UserProfileResource'][_0x547c('0x28')]({'where':{'type':_0x385275,'resourceId':_0x1695be['id']}})[_0x547c('0x15')](function(){return _0x303b57;});})[_0x547c('0x15')](function(){_0x54de6f[_0x547c('0x22')](0xcc)[_0x547c('0x21')]();});}};}function handleEntityNotFound(_0x45f724){return function(_0x5c920e){if(!_0x5c920e){_0x45f724['sendStatus'](0x194);}return _0x5c920e;};}function handleError(_0x5ea2c7,_0xb51625){_0xb51625=_0xb51625||0x1f4;return function(_0x338b6b){logger[_0x547c('0x1c')](_0x338b6b[_0x547c('0x36')]);if(_0x338b6b[_0x547c('0x37')]){delete _0x338b6b[_0x547c('0x37')];}_0x5ea2c7['status'](_0xb51625)[_0x547c('0x38')](_0x338b6b);};}exports['index']=function(_0x32308f,_0x18fcc5){var _0x5b80f4={},_0x380705={'count':0x0,'rows':[]};var _0x5c57ae=_(db['User'][_0x547c('0x39')])[_0x547c('0x33')](function(_0x36bffe){return{'name':_0x36bffe[_0x547c('0x3a')],'type':_0x36bffe['type']['key']};})[_0x547c('0x31')](function(_0x1e8dd0){return!_[_0x547c('0x35')](['password',_0x547c('0x3b')],_0x1e8dd0[_0x547c('0x37')]);})[_0x547c('0x34')]();_0x5b80f4=qs['getOptions'](_0x5c57ae,_0x32308f);var _0x40184f={'where':_0x5b80f4[_0x547c('0x3c')]};return db[_0x547c('0x3d')]['count'](_0x40184f)[_0x547c('0x15')](function(_0xc28dc0){_0x380705['count']=_0xc28dc0;if(_0x32308f[_0x547c('0x3e')][_0x547c('0x3f')]){_0x5b80f4[_0x547c('0x40')]=[{'all':!![]}];}if(!_['includes'](_0x5b80f4[_0x547c('0x41')],'id')){_0x5b80f4['attributes'][_0x547c('0x42')]('id');}return db['User'][_0x547c('0x43')](_0x5b80f4);})[_0x547c('0x15')](function(_0x3d37d7){_0x380705[_0x547c('0x44')]=_0x3d37d7;if(_0x32308f[_0x547c('0x3e')][_0x547c('0x45')]==='true'){var _0x4ccbcf=[];for(var _0x1457ab=0x0;_0x1457ab<_0x380705[_0x547c('0x44')][_0x547c('0x46')];_0x1457ab++){_0x4ccbcf['push'](get_open_tabs(_0x547c('0x47'),_0x380705[_0x547c('0x44')][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x49'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x4a'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));_0x4ccbcf[_0x547c('0x42')](get_open_tabs(_0x547c('0x4b'),_0x380705[_0x547c('0x44')][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf['push'](get_open_tabs(_0x547c('0x4c'),_0x380705['rows'][_0x1457ab][_0x547c('0x48')]));_0x4ccbcf['push'](get_open_tabs(_0x547c('0x4d'),_0x380705[_0x547c('0x44')][_0x1457ab]['dataValues']));}return BPromise[_0x547c('0x4e')](_0x4ccbcf)[_0x547c('0x15')](function(_0xa005cc){return _0x380705;});}else{return _0x380705;}})[_0x547c('0x15')](respondWithFilteredResult(_0x18fcc5,_0x5b80f4))['catch'](handleError(_0x18fcc5,null));};exports[_0x547c('0x4f')]=function(_0x484ede,_0x5649b6){var _0x4d4a92={'raw':![],'where':{'id':_0x484ede[_0x547c('0x50')]['id']}},_0x91fa04={};_0x91fa04[_0x547c('0x51')]=_[_0x547c('0x52')](_[_0x547c('0x53')](db[_0x547c('0x3d')][_0x547c('0x39')]),[_0x547c('0x54'),_0x547c('0x3b')]);_0x91fa04[_0x547c('0x3e')]=_[_0x547c('0x53')](_0x484ede['query']);_0x91fa04['filters']=_[_0x547c('0x55')](_0x91fa04[_0x547c('0x51')],_0x91fa04['query']);_0x4d4a92[_0x547c('0x41')]=_[_0x547c('0x55')](_0x91fa04[_0x547c('0x51')],qs[_0x547c('0x56')](_0x484ede[_0x547c('0x3e')][_0x547c('0x56')]));_0x4d4a92['attributes']=_0x4d4a92[_0x547c('0x41')]['length']?_0x4d4a92[_0x547c('0x41')]:_0x91fa04[_0x547c('0x51')];if(_0x484ede[_0x547c('0x3e')]['includeAll']){_0x4d4a92[_0x547c('0x40')]=[{'all':!![]}];}_0x4d4a92=_['merge']({},_0x4d4a92,_0x484ede[_0x547c('0x57')]);if(!_[_0x547c('0x35')](_0x4d4a92['attributes'],'id')){_0x4d4a92[_0x547c('0x41')][_0x547c('0x42')]('id');}return db[_0x547c('0x3d')][_0x547c('0x58')](_0x4d4a92)[_0x547c('0x15')](handleEntityNotFound(_0x5649b6,null))[_0x547c('0x15')](function(_0x224040){var _0x4a42d1=[];values=_0x224040;if(_0x484ede[_0x547c('0x3e')]['openTabs']===_0x547c('0x59')){_0x4a42d1[_0x547c('0x42')](get_open_tabs(_0x547c('0x47'),_0x224040[_0x547c('0x48')]));_0x4a42d1[_0x547c('0x42')](get_open_tabs('sms',_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4c'),_0x224040[_0x547c('0x48')]));_0x4a42d1[_0x547c('0x42')](get_open_tabs(_0x547c('0x4d'),_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4a'),_0x224040[_0x547c('0x48')]));_0x4a42d1['push'](get_open_tabs(_0x547c('0x4b'),_0x224040[_0x547c('0x48')]));return BPromise[_0x547c('0x4e')](_0x4a42d1);}else{return values;}})[_0x547c('0x15')](function(_0x53fed6){return values;})['then'](respondWithResult(_0x5649b6,null))['catch'](handleError(_0x5649b6,null));};exports[_0x547c('0x5a')]=function(_0x455467,_0x5e0e21){if(_0x455467[_0x547c('0x5b')]['id']){delete _0x455467['body']['id'];}delete _0x455467[_0x547c('0x5b')][_0x547c('0x2a')];return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x455467[_0x547c('0x50')]['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x5e0e21,null))[_0x547c('0x15')](saveUpdates(_0x455467['body'],null))['then'](respondWithResult(_0x5e0e21,null))[_0x547c('0x1f')](handleError(_0x5e0e21,null));};exports[_0x547c('0x5c')]=function(_0x3105cb,_0x64bf1e){return db[_0x547c('0x3d')]['describe']()['then'](respondWithResult(_0x64bf1e,null))['catch'](handleError(_0x64bf1e,null));};exports['addContacts']=function(_0x5d6c7f,_0x16ebb7){return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x5d6c7f['params']['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x16ebb7,null))[_0x547c('0x15')](function(_0x1d9666){if(_0x1d9666){return _0x1d9666[_0x547c('0x5d')](_0x5d6c7f['body']['ids'],_['omit'](_0x5d6c7f[_0x547c('0x5b')],[_0x547c('0x5e'),'id'])||{});}})[_0x547c('0x15')](respondWithResult(_0x16ebb7,null))[_0x547c('0x1f')](handleError(_0x16ebb7,null));};function validateUser(_0x345192){return new BPromise(function(_0x4dd4dc,_0x4e0da1){if(_0x345192[_0x547c('0x5f')])return _0x4dd4dc(_0x345192);return db[_0x547c('0x60')][_0x547c('0x61')](0x1)[_0x547c('0x15')](function(_0xa0fd35){if(_0xa0fd35['securePassword'])authService['validatePasswordPattern'](_0x345192['password']);db[_0x547c('0x3d')]['max'](_0x547c('0x5f'))[_0x547c('0x15')](function(_0x3d9ff6){if(_['isNil'](_0x3d9ff6)){_0x345192['internal']=_0xa0fd35[_0x547c('0x62')]||0x1;return;}if(_[_0x547c('0x63')](_0xa0fd35[_0x547c('0x62')])||_0xa0fd35[_0x547c('0x62')]===_0x3d9ff6){_0x345192[_0x547c('0x5f')]=_0x3d9ff6+0x1;return;}if(_0xa0fd35[_0x547c('0x62')]>_0x3d9ff6){_0x345192[_0x547c('0x5f')]=_0xa0fd35['min_internal'];return;}return db[_0x547c('0x64')][_0x547c('0x3e')](_0x547c('0x65'),{'type':db[_0x547c('0x64')][_0x547c('0x66')][_0x547c('0x67')]})[_0x547c('0x15')](function(_0x4066ce){if(_0x4066ce&&_0x4066ce['length']){for(var _0x1fa11a=0x0,_0x284fb7=_0x4066ce[_0x547c('0x46')];_0x1fa11a<_0x284fb7&&_[_0x547c('0x63')](_0x345192['internal']);_0x1fa11a++){if(_0xa0fd35[_0x547c('0x62')]<=_0x4066ce[_0x1fa11a][_0x547c('0x68')]){_0x345192[_0x547c('0x5f')]=_0x4066ce[_0x1fa11a]['from'];}else if(_0xa0fd35['min_internal']>_0x4066ce[_0x1fa11a]['from']&&_0xa0fd35[_0x547c('0x62')]<=_0x4066ce[_0x1fa11a]['to']){_0x345192[_0x547c('0x5f')]=_0xa0fd35[_0x547c('0x62')];}}}if(_['isNil'](_0x345192[_0x547c('0x5f')])){_0x345192[_0x547c('0x5f')]=_0x3d9ff6+0x1;}return _0x4dd4dc(_0x345192);});});})[_0x547c('0x1f')](function(_0x24a8f7){_0x4e0da1(_0x24a8f7);});});}function updateUser(_0x590e5f){return new BPromise(function(_0x482afb,_0x6b4445){try{if(_0x590e5f['voicemail']){_0x590e5f[_0x547c('0x69')]=_0x590e5f[_0x547c('0x5f')];_0x590e5f['VoiceMail']={'mailbox':_0x590e5f[_0x547c('0x5f')],'password':_0x590e5f['password'],'fullname':_0x590e5f[_0x547c('0x6a')],'email':_0x590e5f[_0x547c('0x6b')]};}if(_0x590e5f['role']===_0x547c('0x2e')){if(!_0x590e5f[_0x547c('0x6c')])_0x590e5f[_0x547c('0x6c')]=[_0x547c('0x6d'),'102','103',_0x547c('0x6e'),_0x547c('0x6f'),_0x547c('0x70'),_0x547c('0x71'),'106','107',_0x547c('0x72'),_0x547c('0x73'),_0x547c('0x74'),_0x547c('0x75'),_0x547c('0x76'),_0x547c('0x77')];}_0x482afb(_0x590e5f);}catch(_0x1e9026){_0x6b4445(_0x1e9026);}});}exports[_0x547c('0x78')]=function(_0x42ef60,_0x91bbf){if(_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]===_0x547c('0x2e'))throw new Error('Unauthorized');if(_0x42ef60['body']['role']===_0x547c('0x2c')&&_0x42ef60['user']['role']!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x42ef60['body'][_0x547c('0x2a')]===_0x547c('0x2b')&&_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]!=='admin'){throw new Error(_0x547c('0x79'));}return licenseUtil[_0x547c('0x7a')]([_0x42ef60['body']])['then'](function(){return validateUser(_0x42ef60[_0x547c('0x5b')]);})[_0x547c('0x15')](function(_0x2fecce){return updateUser(_0x2fecce)[_0x547c('0x15')](function(_0x204aad){if(_0x204aad[_0x547c('0x2a')]===_0x547c('0x2b')){_0x204aad[_0x547c('0x7b')]=_0x42ef60['user'][_0x547c('0x7b')];delete _0x204aad[_0x547c('0x7c')];}return _0x204aad;});})[_0x547c('0x15')](function(_0x5c2e3c){return db[_0x547c('0x3d')][_0x547c('0x78')](_0x5c2e3c,{'include':[{'model':db[_0x547c('0x7d')],'as':_0x547c('0x7d')}]});})[_0x547c('0x15')](function(_0x10c1a7){if(_0x42ef60[_0x547c('0x5b')][_0x547c('0x2a')]===_0x547c('0x2c'))return _0x10c1a7;if(_0x42ef60[_0x547c('0x2c')][_0x547c('0x2a')]!==_0x547c('0x2c'))return _0x10c1a7;return db[_0x547c('0x7e')][_0x547c('0x58')]({'where':{'name':_0x10c1a7['role']===_0x547c('0x2e')?_0x547c('0x2d'):_0x547c('0x2f'),'userProfileId':_0x42ef60['user'][_0x547c('0x7c')]},'raw':!![]})[_0x547c('0x15')](function(_0x185176){if(!_0x185176||_0x185176[_0x547c('0x7f')]!=0x0)return _0x10c1a7;return db[_0x547c('0x80')][_0x547c('0x78')]({'name':_0x10c1a7[_0x547c('0x37')],'resourceId':_0x10c1a7['id'],'type':_0x185176[_0x547c('0x37')],'sectionId':_0x185176['id']},{})[_0x547c('0x15')](function(){return _0x10c1a7;});})[_0x547c('0x1f')](function(_0x224f62){logger[_0x547c('0x1c')](_0x547c('0x81'),_0x224f62);throw _0x224f62;});})['then'](respondWithResult(_0x91bbf,0xc9))['catch'](handleError(_0x91bbf,null));};exports['bulkCreate']=function(_0x588e2b,_0x5bafab){var _0x4b09fb=_0x588e2b[_0x547c('0x5b')];var _0x3bf455=[];if(_0x588e2b[_0x547c('0x2c')][_0x547c('0x2a')]==='agent')throw new Error(_0x547c('0x82'));if(_[_0x547c('0x83')](_0x4b09fb,[_0x547c('0x2a'),'user'])&&_0x588e2b[_0x547c('0x2c')][_0x547c('0x2a')]!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x4b09fb,['role',_0x547c('0x2b')])&&_0x588e2b['user'][_0x547c('0x2a')]!==_0x547c('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x547c('0x7a')](_0x4b09fb)[_0x547c('0x15')](function(){return validateUser(_0x4b09fb[0x0]);})[_0x547c('0x15')](function(){for(var _0x3f54cf=0x1;_0x3f54cf<_0x4b09fb[_0x547c('0x46')];_0x3f54cf++){var _0x5a067c=_0x4b09fb[_0x3f54cf-0x1][_0x547c('0x5f')];if(!_0x4b09fb[_0x3f54cf]['internal'])_0x4b09fb[_0x3f54cf][_0x547c('0x5f')]=_0x5a067c+0x1;_0x3bf455[_0x547c('0x42')](validateUser(_0x4b09fb[_0x3f54cf]));}return BPromise[_0x547c('0x4e')](_0x3bf455);})[_0x547c('0x15')](function(){_0x3bf455=[];for(var _0x4e8596=0x0;_0x4e8596<_0x4b09fb[_0x547c('0x46')];_0x4e8596++){_0x3bf455['push'](updateUser(_0x4b09fb[_0x4e8596]));}return BPromise[_0x547c('0x4e')](_0x3bf455);})[_0x547c('0x15')](function(){return BPromise['each'](_0x4b09fb,function(_0x348ef8){return db['User'][_0x547c('0x78')](_0x348ef8,{'include':[{'model':db[_0x547c('0x7d')],'as':_0x547c('0x7d')}]})[_0x547c('0x15')](function(_0x55411b){_0x348ef8['id']=_0x55411b['id'];return _0x348ef8;});});})[_0x547c('0x15')](function(_0x311cb8){if(_0x588e2b[_0x547c('0x5b')][_0x547c('0x2a')]===_0x547c('0x2c'))return _0x311cb8;if(_0x588e2b['user'][_0x547c('0x2a')]!==_0x547c('0x2c'))return _0x311cb8;var _0x28cbee=_['some'](_0x311cb8,function(_0xcf70f8){return _0xcf70f8[_0x547c('0x2a')]===_0x547c('0x2e')||_0xcf70f8[_0x547c('0x2a')]==='telephone';});if(!_0x28cbee)return _0x311cb8;return db[_0x547c('0x7e')]['findAll']({'where':{'name':{'$or':[_0x547c('0x2d'),'Telephones']},'userProfileId':_0x588e2b[_0x547c('0x2c')][_0x547c('0x7c')]},'raw':!![]})[_0x547c('0x15')](function(_0x27b3ff){if(_[_0x547c('0x84')](_0x27b3ff)||!_[_0x547c('0x83')](_0x27b3ff,['autoAssociation',0x0]))return _0x311cb8;_0x3bf455=[];var _0x481894=_(_0x27b3ff)['map'](function(_0x449255){if(_0x449255[_0x547c('0x7f')]===0x1)return;return _0x449255[_0x547c('0x37')]===_0x547c('0x2d')?'agent':_0x547c('0x30');})['compact']()[_0x547c('0x34')]();for(var _0xad8038=0x0;_0xad8038<_0x311cb8[_0x547c('0x46')];_0xad8038++){if(!_[_0x547c('0x35')](_0x481894,_0x311cb8[_0xad8038][_0x547c('0x2a')]))return;var _0x15778c=_0x311cb8[_0xad8038]['role']===_0x547c('0x2e')?'Agents':_0x547c('0x2f');_0x3bf455[_0x547c('0x42')](db['UserProfileResource'][_0x547c('0x78')]({'name':_0x311cb8[_0xad8038][_0x547c('0x37')],'resourceId':_0x311cb8[_0xad8038]['id'],'type':_0x15778c,'sectionId':_[_0x547c('0x58')](_0x27b3ff,[_0x547c('0x37'),_0x15778c])['id']},{}));}return BPromise[_0x547c('0x4e')](_0x3bf455);});})[_0x547c('0x15')](respondWithResult(_0x5bafab,0xc9))[_0x547c('0x1f')](handleError(_0x5bafab,null));};exports['changePassword']=function(_0xcdd93f,_0x1e242f){if(_0xcdd93f[_0x547c('0x5b')]['id']){delete _0xcdd93f['body']['id'];}return db[_0x547c('0x3d')]['find']({'where':{'id':_0xcdd93f[_0x547c('0x50')]['id']}})['then'](function(_0x44b5e9){if(!_0x44b5e9)return null;if(_0x44b5e9['id']===_0xcdd93f[_0x547c('0x2c')]['id']){if(!_0xcdd93f[_0x547c('0x5b')][_0x547c('0x85')]||!_0xcdd93f['body'][_0x547c('0x86')]){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x89'));}if(!_0x44b5e9['authenticate'](_0xcdd93f['body'][_0x547c('0x85')])){throw new db[(_0x547c('0x87'))]['ValidationError'](_0x547c('0x8a'));}if(_0xcdd93f['body']['oldPassword']===_0xcdd93f['body'][_0x547c('0x86')]){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x8b'));}}else if(_0xcdd93f['user'][_0x547c('0x2a')]===_0x547c('0x2b')){if(!_0xcdd93f[_0x547c('0x5b')]['newPassword']){throw new db[(_0x547c('0x87'))]['ValidationError'](_0x547c('0x8c'));}}else if(_0xcdd93f[_0x547c('0x2c')][_0x547c('0x2a')]==='user'){if(!_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')]){throw new db['Sequelize'][(_0x547c('0x88'))](_0x547c('0x8c'));}if(_0x44b5e9[_0x547c('0x2a')]!==_0x547c('0x2e')){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x82'));}}else{throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0x82'));}return _0x44b5e9;})['then'](handleEntityNotFound(_0x1e242f,null))['then'](function(_0x4267e3){return db['Setting'][_0x547c('0x8d')]({'attributes':['id','securePassword',_0x547c('0x8e'),_0x547c('0x8f')]})[_0x547c('0x15')](function(_0x39cb92){if(_0x39cb92[_0x547c('0x90')])authService[_0x547c('0x91')](_0xcdd93f[_0x547c('0x5b')]['newPassword']);if(!_0x39cb92[_0x547c('0x8e')]||!_0x4267e3[_0x547c('0x92')])return _0x4267e3;authService[_0x547c('0x93')](_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')],_0x4267e3[_0x547c('0x92')],_0x39cb92[_0x547c('0x8f')]);return _0x4267e3;})[_0x547c('0x15')](saveUpdates({'password':_0xcdd93f[_0x547c('0x5b')][_0x547c('0x86')],'passwordResetAt':_0xcdd93f[_0x547c('0x2c')]['id']==_0xcdd93f[_0x547c('0x50')]['id']?moment():null,'previousPasswords':authService[_0x547c('0x94')](_0xcdd93f['body'][_0x547c('0x86')],_0x4267e3[_0x547c('0x92')])},null));})[_0x547c('0x15')](respondWithResult(_0x1e242f,null))[_0x547c('0x1f')](handleError(_0x1e242f,null));};exports[_0x547c('0x95')]=function(_0x11e9fd,_0x35b426){var _0x3fae07=_0x11e9fd['body'][_0x547c('0x96')];return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x11e9fd['params']['id']},'attributes':['id','name',_0x547c('0x2a'),_0x547c('0x97'),_0x547c('0x98'),_0x547c('0x99'),_0x547c('0x9a')]})[_0x547c('0x15')](handleEntityNotFound(_0x35b426,null))[_0x547c('0x15')](function(_0xb541a7){if(_0xb541a7){if(!utils['isValidChannel'](_0x3fae07)){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))]('Unknown\x20channel');}return _0xb541a7[_0x547c('0x9b')+_[_0x547c('0x9c')](_0x3fae07[_0x547c('0x9d')]())+_0x547c('0x9e')](_0x11e9fd['body'][_0x547c('0x5e')],{'penalty':_0x11e9fd[_0x547c('0x5b')][_0x547c('0x9f')]||0x0})[_0x547c('0xa0')](function(_0x21938c){for(var _0x2c0a98=0x0;_0x2c0a98<_0x11e9fd[_0x547c('0x5b')]['ids'][_0x547c('0x46')];_0x2c0a98+=0x1){var _0x1564b8={'UserId':Number(_0x11e9fd[_0x547c('0x50')]['id'])};_0x1564b8[_[_0x547c('0x9c')](_0x3fae07['toLowerCase']())+_0x547c('0xa1')]=Number(_0x11e9fd['body']['ids'][_0x2c0a98]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_['capitalize'](_0x3fae07[_0x547c('0x9d')]())+_0x547c('0xa3'),_0x1564b8);}return _0x21938c;})[_0x547c('0x15')](function(){if(_0x3fae07==='voice'){return db['VoiceQueue'][_0x547c('0x43')]({'where':{'id':_0x11e9fd['body'][_0x547c('0x5e')]||[]},'raw':!![],'attributes':['id',_0x547c('0x37')]});}})[_0x547c('0x15')](function(_0x4cb529){var _0x4a2612=_0xb541a7[_0x547c('0x29')]({'plain':!![]});var _0xea7f3f=[];if(_0x3fae07==='voice'&&_0x4a2612[_0x547c('0x2a')]===_0x547c('0x2e')&&_0x4a2612['online']){for(var _0x1764f2=0x0;_0x1764f2<_0x4cb529[_0x547c('0x46')];_0x1764f2+=0x1){_0xea7f3f[_0x547c('0x42')]({'membername':_0x4a2612['name'],'UserId':_0x4a2612['id'],'queue_name':_0x4cb529[_0x1764f2][_0x547c('0x37')],'VoiceQueueId':_0x4cb529[_0x1764f2]['id'],'interface':_['isNil'](_0x4a2612['interface'])?util[_0x547c('0xa4')]('SIP/%s',_0x4a2612[_0x547c('0x37')]):_0x4a2612['interface'],'paused':_0x4a2612[_0x547c('0x99')]||![],'penalty':_0x11e9fd['body'][_0x547c('0x9f')]||0x0});}return BPromise[_0x547c('0xa5')](_0xea7f3f,function(_0x2a1bbf){return db[_0x547c('0xa6')][_0x547c('0xa7')](_0x2a1bbf);});}return _0xb541a7;});}})[_0x547c('0x15')](respondWithStatusCode(_0x35b426,null))[_0x547c('0x1f')](handleError(_0x35b426,null));};exports[_0x547c('0xa8')]=function(_0x54fb86,_0x2a560a){var _0x3131af;return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x54fb86[_0x547c('0x50')]['id']},'attributes':['id',_0x547c('0x37'),_0x547c('0x2a')]})[_0x547c('0x15')](handleEntityNotFound(_0x2a560a,null))[_0x547c('0x15')](function(_0x9e9307){if(_0x9e9307){_0x3131af=_0x9e9307;if(!_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')]||!utils[_0x547c('0xa9')](_0x54fb86[_0x547c('0x3e')]['channel'])){throw new db[(_0x547c('0x87'))][(_0x547c('0x88'))](_0x547c('0xaa'));}return _0x9e9307[_0x547c('0xab')+_['capitalize'](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+_0x547c('0x9e')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')]);}})[_0x547c('0x15')](function(_0xecf19c){if(_['isArray'](_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')])){for(var _0x17520a=0x0;_0x17520a<_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')][_0x547c('0x46')];_0x17520a+=0x1){var _0x3b20e9={'UserId':Number(_0x54fb86[_0x547c('0x50')]['id'])};_0x3b20e9[_[_0x547c('0x9c')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+'QueueId']=Number(_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')][_0x17520a]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_[_0x547c('0x9c')](_0x54fb86['query']['channel'][_0x547c('0x9d')]())+_0x547c('0xac'),_0x3b20e9);}}else{var _0x3b20e9={'UserId':Number(_0x54fb86['params']['id'])};_0x3b20e9[_[_0x547c('0x9c')](_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')][_0x547c('0x9d')]())+_0x547c('0xa1')]=Number(_0x54fb86[_0x547c('0x3e')][_0x547c('0x5e')]);socket[_0x547c('0xa2')](_0x547c('0x2c')+_['capitalize'](_0x54fb86['query'][_0x547c('0x96')][_0x547c('0x9d')]())+'Queue:remove',_0x3b20e9);}return _0xecf19c;})[_0x547c('0x15')](function(){if(_0x54fb86[_0x547c('0x3e')][_0x547c('0x96')]===_0x547c('0xad')){return db[_0x547c('0xa6')][_0x547c('0x28')]({'where':{'UserId':_0x54fb86[_0x547c('0x50')]['id'],'VoiceQueueId':_0x54fb86[_0x547c('0x3e')]['ids']},'individualHooks':!![]})['then'](function(){return _0x3131af;});}return _0x3131af;})[_0x547c('0x15')](respondWithStatusCode(_0x2a560a,null))['catch'](handleError(_0x2a560a,null));};exports[_0x547c('0xae')]=function(_0x3d9a66,_0x592246){_0x3d9a66[_0x547c('0x5b')]['userpic']=_0x3d9a66[_0x547c('0xaf')][_0x547c('0xb0')];return db['User'][_0x547c('0x58')]({'where':{'id':_0x3d9a66[_0x547c('0x50')]['id']}})[_0x547c('0x15')](handleEntityNotFound(_0x592246,null))[_0x547c('0x15')](saveUpdates(_0x3d9a66[_0x547c('0x5b')],null))[_0x547c('0x15')](respondWithResult(_0x592246,null))[_0x547c('0x1f')](handleError(_0x592246,null));};exports['getAvatar']=function(_0x4c7336,_0x21c274){var _0x2a0b2b=path['join'](config[_0x547c('0xb1')],'server/files/images/logos/default_profile.png');return db[_0x547c('0x3d')][_0x547c('0x58')]({'where':{'id':_0x4c7336[_0x547c('0x50')]['id']},'attributes':['id',_0x547c('0xb2')],'raw':!![]})['then'](handleEntityNotFound(_0x21c274,null))[_0x547c('0x15')](function(_0x434d03){if(_0x434d03){if(_[_0x547c('0x63')](_0x434d03['userpic'])){return _0x21c274[_0x547c('0xb3')](_0x2a0b2b);}else{if(!fs['existsSync'](path[_0x547c('0xb4')](config[_0x547c('0xb1')],_0x547c('0xb5'),_0x434d03[_0x547c('0xb2')]))){return _0x21c274[_0x547c('0xb3')](_0x2a0b2b);}return _0x21c274[_0x547c('0xb3')](path[_0x547c('0xb4')](config[_0x547c('0xb1')],'server/files/images/',_0x434d03['userpic']));}}})[_0x547c('0x1f')](handleError(_0x21c274,null));};exports[_0x547c('0xb6')]=function(_0x5e70bc,_0x352781){return db[_0x547c('0x3d')]['find']({'where':{'id':_0x5e70bc['params']['id']},'attributes':['id']})[_0x547c('0x15')](handleEntityNotFound(_0x352781,null))[_0x547c('0x15')](function(_0x3cdca2){var _0xf2d9a7=[];values=_0x3cdca2['dataValues'];_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x47'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs('sms',_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4c'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4d'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4a'),_0x3cdca2[_0x547c('0x48')]));_0xf2d9a7[_0x547c('0x42')](get_open_tabs(_0x547c('0x4b'),_0x3cdca2[_0x547c('0x48')]));return BPromise[_0x547c('0x4e')](_0xf2d9a7);})['then'](function(_0x5b28f7){var _0x307b25=[];if(_0x5b28f7){for(var _0x4e4a63=0x0;_0x4e4a63=_0x2f2f05){_0x273ce2=_0x2f2f05;_0x1c150d=0xc8;}else{_0x1c150d=0xce;}_0x47f063[_0x51a8('0x1c')](_0x1c150d);return _0x47f063[_0x51a8('0x22')](_0x51a8('0x23'),_0x1326a2+'-'+_0x273ce2+'/'+_0x2f2f05)[_0x51a8('0x24')](_0x52e503);}return null;};}function saveUpdates(_0x4b5cda){return function(_0x20c6b5){if(_0x20c6b5){return _0x20c6b5[_0x51a8('0x25')](_0x4b5cda)['then'](function(_0x2f9d53){return _0x2f9d53;});}return null;};}function removeEntity(_0x58cba0){return function(_0x276424){if(_0x276424){return _0x276424[_0x51a8('0x26')]()[_0x51a8('0x11')](function(){var _0x41df56=_0x276424[_0x51a8('0x27')]({'plain':!![]});if(_0x41df56['role']===_0x51a8('0x28'))return;var _0x4c67ff=[{'name':_0x51a8('0x29'),'value':_0x51a8('0x2a'),'ignore':!![]},{'name':_0x51a8('0x2b'),'value':'agent','ignore':![]},{'name':_0x51a8('0x2c'),'value':'telephone','ignore':![]}];var _0x25a858=_(_0x4c67ff)[_0x51a8('0x2d')](_0x51a8('0x2e'))[_0x51a8('0x2f')](_0x51a8('0x30'))['value']();if(_[_0x51a8('0x31')](_0x25a858,_0x41df56['role'])){return;}var _0x9f0e6=_[_0x51a8('0x32')](_0x4c67ff,[_0x51a8('0x30'),_0x41df56['role']])[_0x51a8('0x33')];return db[_0x51a8('0x34')][_0x51a8('0x26')]({'where':{'type':_0x9f0e6,'resourceId':_0x41df56['id']}})[_0x51a8('0x11')](function(){return _0x276424;});})[_0x51a8('0x11')](function(){_0x58cba0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d3114){return function(_0x21b871){if(!_0x21b871){_0x4d3114[_0x51a8('0x35')](0x194);}return _0x21b871;};}function handleError(_0x4ec1db,_0x35d7a1){_0x35d7a1=_0x35d7a1||0x1f4;return function(_0x4ec0ac){logger[_0x51a8('0x17')](_0x4ec0ac[_0x51a8('0x36')]);if(_0x4ec0ac[_0x51a8('0x33')]){delete _0x4ec0ac[_0x51a8('0x33')];}_0x4ec1db[_0x51a8('0x1c')](_0x35d7a1)[_0x51a8('0x37')](_0x4ec0ac);};}exports['index']=function(_0x4e5566,_0x377b4c){var _0x5f524e={},_0x5d7214={'count':0x0,'rows':[]};var _0x5df144=_(db[_0x51a8('0x38')][_0x51a8('0x39')])[_0x51a8('0x2f')](function(_0x5956b8){return{'name':_0x5956b8[_0x51a8('0x3a')],'type':_0x5956b8[_0x51a8('0x3b')][_0x51a8('0x3c')]};})[_0x51a8('0x2d')](function(_0x5d3983){return!_[_0x51a8('0x31')]([_0x51a8('0x3d'),_0x51a8('0x3e')],_0x5d3983['name']);})[_0x51a8('0x30')]();_0x5f524e=qs['getOptions'](_0x5df144,_0x4e5566);var _0x2032c0={'where':_0x5f524e[_0x51a8('0x3f')]};return db[_0x51a8('0x38')][_0x51a8('0x21')](_0x2032c0)['then'](function(_0x8e248){_0x5d7214[_0x51a8('0x21')]=_0x8e248;if(_0x4e5566[_0x51a8('0x40')][_0x51a8('0x41')]){_0x5f524e[_0x51a8('0x42')]=[{'all':!![]}];}if(!_[_0x51a8('0x31')](_0x5f524e[_0x51a8('0x43')],'id')){_0x5f524e[_0x51a8('0x43')][_0x51a8('0x44')]('id');}return db['User'][_0x51a8('0x45')](_0x5f524e);})[_0x51a8('0x11')](function(_0x4c7c67){_0x5d7214['rows']=_0x4c7c67;if(_0x4e5566[_0x51a8('0x40')][_0x51a8('0x46')]===_0x51a8('0x47')){var _0x27b8e5=[];for(var _0x311574=0x0;_0x311574<_0x5d7214[_0x51a8('0x48')][_0x51a8('0x49')];_0x311574++){_0x27b8e5[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4a'),_0x5d7214[_0x51a8('0x48')][_0x311574]['dataValues']));_0x27b8e5[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4b'),_0x5d7214[_0x51a8('0x48')][_0x311574][_0x51a8('0x4c')]));_0x27b8e5[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4d'),_0x5d7214['rows'][_0x311574][_0x51a8('0x4c')]));_0x27b8e5['push'](get_open_tabs(_0x51a8('0x4e'),_0x5d7214[_0x51a8('0x48')][_0x311574][_0x51a8('0x4c')]));_0x27b8e5[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4f'),_0x5d7214['rows'][_0x311574]['dataValues']));_0x27b8e5[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x50'),_0x5d7214[_0x51a8('0x48')][_0x311574][_0x51a8('0x4c')]));}return BPromise[_0x51a8('0x51')](_0x27b8e5)['then'](function(_0x504a43){return _0x5d7214;});}else{return _0x5d7214;}})[_0x51a8('0x11')](respondWithFilteredResult(_0x377b4c,_0x5f524e))[_0x51a8('0x1b')](handleError(_0x377b4c,null));};exports[_0x51a8('0x52')]=function(_0x419863,_0x40c97a){var _0x1cf058={'raw':![],'where':{'id':_0x419863[_0x51a8('0x53')]['id']}},_0x15e5a2={};_0x15e5a2[_0x51a8('0x54')]=_['differenceBy'](_['keys'](db['User'][_0x51a8('0x39')]),[_0x51a8('0x3d'),_0x51a8('0x3e')]);_0x15e5a2['query']=_[_0x51a8('0x55')](_0x419863[_0x51a8('0x40')]);_0x15e5a2['filters']=_[_0x51a8('0x56')](_0x15e5a2['model'],_0x15e5a2['query']);_0x1cf058[_0x51a8('0x43')]=_[_0x51a8('0x56')](_0x15e5a2[_0x51a8('0x54')],qs['fields'](_0x419863['query'][_0x51a8('0x57')]));_0x1cf058['attributes']=_0x1cf058[_0x51a8('0x43')][_0x51a8('0x49')]?_0x1cf058[_0x51a8('0x43')]:_0x15e5a2[_0x51a8('0x54')];if(_0x419863[_0x51a8('0x40')][_0x51a8('0x41')]){_0x1cf058[_0x51a8('0x42')]=[{'all':!![]}];}_0x1cf058=_[_0x51a8('0x58')]({},_0x1cf058,_0x419863[_0x51a8('0x59')]);if(!_['includes'](_0x1cf058[_0x51a8('0x43')],'id')){_0x1cf058[_0x51a8('0x43')][_0x51a8('0x44')]('id');}return db[_0x51a8('0x38')]['find'](_0x1cf058)[_0x51a8('0x11')](handleEntityNotFound(_0x40c97a,null))['then'](function(_0x12e2b6){var _0x252c20=[];values=_0x12e2b6;if(_0x419863['query']['openTabs']===_0x51a8('0x47')){_0x252c20[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4a'),_0x12e2b6[_0x51a8('0x4c')]));_0x252c20[_0x51a8('0x44')](get_open_tabs('sms',_0x12e2b6[_0x51a8('0x4c')]));_0x252c20[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4f'),_0x12e2b6[_0x51a8('0x4c')]));_0x252c20[_0x51a8('0x44')](get_open_tabs('whatsapp',_0x12e2b6[_0x51a8('0x4c')]));_0x252c20[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4d'),_0x12e2b6[_0x51a8('0x4c')]));_0x252c20[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4e'),_0x12e2b6['dataValues']));return BPromise['all'](_0x252c20);}else{return values;}})['then'](function(_0x52787e){return values;})[_0x51a8('0x11')](respondWithResult(_0x40c97a,null))[_0x51a8('0x1b')](handleError(_0x40c97a,null));};exports['update']=function(_0x7ac0ae,_0x56d3d7){if(_0x7ac0ae[_0x51a8('0x5a')]['id']){delete _0x7ac0ae['body']['id'];}delete _0x7ac0ae[_0x51a8('0x5a')][_0x51a8('0x5b')];return db['User']['find']({'where':{'id':_0x7ac0ae['params']['id']}})[_0x51a8('0x11')](handleEntityNotFound(_0x56d3d7,null))[_0x51a8('0x11')](saveUpdates(_0x7ac0ae[_0x51a8('0x5a')],null))[_0x51a8('0x11')](respondWithResult(_0x56d3d7,null))[_0x51a8('0x1b')](handleError(_0x56d3d7,null));};exports[_0x51a8('0x5c')]=function(_0x3fd347,_0x259153){return db['User'][_0x51a8('0x5c')]()[_0x51a8('0x11')](respondWithResult(_0x259153,null))['catch'](handleError(_0x259153,null));};exports[_0x51a8('0x5d')]=function(_0x315231,_0xf24966){return db[_0x51a8('0x38')][_0x51a8('0x32')]({'where':{'id':_0x315231[_0x51a8('0x53')]['id']}})['then'](handleEntityNotFound(_0xf24966,null))['then'](function(_0x31a464){if(_0x31a464){return _0x31a464['addContacts'](_0x315231['body']['ids'],_['omit'](_0x315231['body'],[_0x51a8('0x5e'),'id'])||{});}})['then'](respondWithResult(_0xf24966,null))[_0x51a8('0x1b')](handleError(_0xf24966,null));};function validateUser(_0x4772cd){return new BPromise(function(_0x1e7135,_0x2d3d37){if(_0x4772cd[_0x51a8('0x5f')])return _0x1e7135(_0x4772cd);return db[_0x51a8('0x60')][_0x51a8('0x61')](0x1)[_0x51a8('0x11')](function(_0x4b4740){if(_0x4b4740[_0x51a8('0x62')])authService['validatePasswordPattern'](_0x4772cd[_0x51a8('0x3d')]);db[_0x51a8('0x38')][_0x51a8('0x63')]('internal')['then'](function(_0x5e6bf8){if(_[_0x51a8('0x64')](_0x5e6bf8)){_0x4772cd[_0x51a8('0x5f')]=_0x4b4740[_0x51a8('0x65')]||0x1;return;}if(_[_0x51a8('0x64')](_0x4b4740[_0x51a8('0x65')])||_0x4b4740[_0x51a8('0x65')]===_0x5e6bf8){_0x4772cd[_0x51a8('0x5f')]=_0x5e6bf8+0x1;return;}if(_0x4b4740[_0x51a8('0x65')]>_0x5e6bf8){_0x4772cd[_0x51a8('0x5f')]=_0x4b4740[_0x51a8('0x65')];return;}return db[_0x51a8('0x66')][_0x51a8('0x40')](_0x51a8('0x67'),{'type':db['sequelize'][_0x51a8('0x68')][_0x51a8('0x69')]})['then'](function(_0x2dc9cb){if(_0x2dc9cb&&_0x2dc9cb['length']){for(var _0x4ac62e=0x0,_0x59c80f=_0x2dc9cb[_0x51a8('0x49')];_0x4ac62e<_0x59c80f&&_[_0x51a8('0x64')](_0x4772cd[_0x51a8('0x5f')]);_0x4ac62e++){if(_0x4b4740[_0x51a8('0x65')]<=_0x2dc9cb[_0x4ac62e][_0x51a8('0x6a')]){_0x4772cd[_0x51a8('0x5f')]=_0x2dc9cb[_0x4ac62e][_0x51a8('0x6a')];}else if(_0x4b4740['min_internal']>_0x2dc9cb[_0x4ac62e]['from']&&_0x4b4740['min_internal']<=_0x2dc9cb[_0x4ac62e]['to']){_0x4772cd[_0x51a8('0x5f')]=_0x4b4740[_0x51a8('0x65')];}}}if(_[_0x51a8('0x64')](_0x4772cd[_0x51a8('0x5f')])){_0x4772cd[_0x51a8('0x5f')]=_0x5e6bf8+0x1;}return _0x1e7135(_0x4772cd);});});})[_0x51a8('0x1b')](function(_0x57bf5c){_0x2d3d37(_0x57bf5c);});});}function updateUser(_0x254ab5){return new BPromise(function(_0x481030,_0x1c11d5){try{if(_0x254ab5[_0x51a8('0x6b')]){_0x254ab5[_0x51a8('0x6c')]=_0x254ab5[_0x51a8('0x5f')];_0x254ab5[_0x51a8('0x6d')]={'mailbox':_0x254ab5[_0x51a8('0x5f')],'password':_0x254ab5[_0x51a8('0x3d')],'fullname':_0x254ab5[_0x51a8('0x6e')],'email':_0x254ab5[_0x51a8('0x6f')]};}if(_0x254ab5[_0x51a8('0x5b')]===_0x51a8('0x70')){if(!_0x254ab5['permissions'])_0x254ab5['permissions']=[_0x51a8('0x71'),_0x51a8('0x72'),_0x51a8('0x73'),_0x51a8('0x74'),'110',_0x51a8('0x75'),'105',_0x51a8('0x76'),_0x51a8('0x77'),_0x51a8('0x78'),_0x51a8('0x79'),_0x51a8('0x7a'),_0x51a8('0x7b'),_0x51a8('0x7c'),_0x51a8('0x7d')];}_0x481030(_0x254ab5);}catch(_0x379028){_0x1c11d5(_0x379028);}});}exports['create']=function(_0x15f2fc,_0xb5aa9f){if(_0x15f2fc[_0x51a8('0x2a')][_0x51a8('0x5b')]==='agent')throw new Error('Unauthorized');if(_0x15f2fc[_0x51a8('0x5a')]['role']==='user'&&_0x15f2fc['user'][_0x51a8('0x5b')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x15f2fc[_0x51a8('0x5a')][_0x51a8('0x5b')]===_0x51a8('0x28')&&_0x15f2fc['user'][_0x51a8('0x5b')]!==_0x51a8('0x28')){throw new Error(_0x51a8('0x7e'));}return licenseUtil['checkUserLimits']([_0x15f2fc[_0x51a8('0x5a')]])[_0x51a8('0x11')](function(){return validateUser(_0x15f2fc[_0x51a8('0x5a')]);})[_0x51a8('0x11')](function(_0xac2108){return updateUser(_0xac2108)[_0x51a8('0x11')](function(_0x2b6e5d){if(_0x2b6e5d[_0x51a8('0x5b')]===_0x51a8('0x28')){_0x2b6e5d['settingsEnabled']=_0x15f2fc[_0x51a8('0x2a')][_0x51a8('0x7f')];delete _0x2b6e5d['userProfileId'];}return _0x2b6e5d;});})[_0x51a8('0x11')](function(_0x43112c){return db['User'][_0x51a8('0x80')](_0x43112c,{'include':[{'model':db[_0x51a8('0x6d')],'as':_0x51a8('0x6d')}]});})[_0x51a8('0x11')](function(_0x398fb2){if(_0x15f2fc['body'][_0x51a8('0x5b')]===_0x51a8('0x2a'))return _0x398fb2;if(_0x15f2fc[_0x51a8('0x2a')][_0x51a8('0x5b')]!=='user')return _0x398fb2;return db[_0x51a8('0x81')][_0x51a8('0x32')]({'where':{'name':_0x398fb2[_0x51a8('0x5b')]===_0x51a8('0x70')?_0x51a8('0x2b'):_0x51a8('0x2c'),'userProfileId':_0x15f2fc[_0x51a8('0x2a')][_0x51a8('0x82')]},'raw':!![]})['then'](function(_0x1d7794){if(!_0x1d7794||_0x1d7794[_0x51a8('0x83')]!=0x0)return _0x398fb2;return db['UserProfileResource'][_0x51a8('0x80')]({'name':_0x398fb2[_0x51a8('0x33')],'resourceId':_0x398fb2['id'],'type':_0x1d7794['name'],'sectionId':_0x1d7794['id']},{})[_0x51a8('0x11')](function(){return _0x398fb2;});})['catch'](function(_0x48ad09){logger[_0x51a8('0x17')](_0x51a8('0x84'),_0x48ad09);throw _0x48ad09;});})[_0x51a8('0x11')](respondWithResult(_0xb5aa9f,0xc9))['catch'](handleError(_0xb5aa9f,null));};exports['bulkCreate']=function(_0x73ecd7,_0x513d31){var _0x30c1be=_0x73ecd7[_0x51a8('0x5a')];var _0x46a32c=[];if(_0x73ecd7[_0x51a8('0x2a')][_0x51a8('0x5b')]===_0x51a8('0x70'))throw new Error(_0x51a8('0x85'));if(_[_0x51a8('0x86')](_0x30c1be,[_0x51a8('0x5b'),_0x51a8('0x2a')])&&_0x73ecd7[_0x51a8('0x2a')][_0x51a8('0x5b')]!==_0x51a8('0x28')){throw new Error(_0x51a8('0x87'));}if(_[_0x51a8('0x86')](_0x30c1be,['role','admin'])&&_0x73ecd7[_0x51a8('0x2a')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x51a8('0x88')](_0x30c1be)[_0x51a8('0x11')](function(){return validateUser(_0x30c1be[0x0]);})[_0x51a8('0x11')](function(){for(var _0x125a28=0x1;_0x125a28<_0x30c1be['length'];_0x125a28++){var _0x975b8=_0x30c1be[_0x125a28-0x1][_0x51a8('0x5f')];if(!_0x30c1be[_0x125a28]['internal'])_0x30c1be[_0x125a28][_0x51a8('0x5f')]=_0x975b8+0x1;_0x46a32c[_0x51a8('0x44')](validateUser(_0x30c1be[_0x125a28]));}return BPromise['all'](_0x46a32c);})['then'](function(){_0x46a32c=[];for(var _0x11e388=0x0;_0x11e388<_0x30c1be[_0x51a8('0x49')];_0x11e388++){_0x46a32c[_0x51a8('0x44')](updateUser(_0x30c1be[_0x11e388]));}return BPromise[_0x51a8('0x51')](_0x46a32c);})[_0x51a8('0x11')](function(){return BPromise[_0x51a8('0x89')](_0x30c1be,function(_0x4e566a){return db[_0x51a8('0x38')][_0x51a8('0x80')](_0x4e566a,{'include':[{'model':db[_0x51a8('0x6d')],'as':'VoiceMail'}]})[_0x51a8('0x11')](function(_0x3f4649){_0x4e566a['id']=_0x3f4649['id'];return _0x4e566a;});});})[_0x51a8('0x11')](function(_0x58a83c){if(_0x73ecd7[_0x51a8('0x5a')][_0x51a8('0x5b')]==='user')return _0x58a83c;if(_0x73ecd7[_0x51a8('0x2a')]['role']!==_0x51a8('0x2a'))return _0x58a83c;var _0x2d4c2b=_[_0x51a8('0x86')](_0x58a83c,function(_0x1ab629){return _0x1ab629[_0x51a8('0x5b')]===_0x51a8('0x70')||_0x1ab629[_0x51a8('0x5b')]===_0x51a8('0x8a');});if(!_0x2d4c2b)return _0x58a83c;return db['UserProfileSection'][_0x51a8('0x45')]({'where':{'name':{'$or':[_0x51a8('0x2b'),_0x51a8('0x2c')]},'userProfileId':_0x73ecd7[_0x51a8('0x2a')][_0x51a8('0x82')]},'raw':!![]})['then'](function(_0x4e58fe){if(_[_0x51a8('0x8b')](_0x4e58fe)||!_[_0x51a8('0x86')](_0x4e58fe,[_0x51a8('0x83'),0x0]))return _0x58a83c;_0x46a32c=[];var _0x2e354f=_(_0x4e58fe)[_0x51a8('0x2f')](function(_0x54ef0e){if(_0x54ef0e[_0x51a8('0x83')]===0x1)return;return _0x54ef0e['name']===_0x51a8('0x2b')?_0x51a8('0x70'):'telephone';})[_0x51a8('0x8c')]()['value']();for(var _0x3b7e30=0x0;_0x3b7e30<_0x58a83c[_0x51a8('0x49')];_0x3b7e30++){if(!_[_0x51a8('0x31')](_0x2e354f,_0x58a83c[_0x3b7e30][_0x51a8('0x5b')]))return;var _0x35b703=_0x58a83c[_0x3b7e30]['role']===_0x51a8('0x70')?_0x51a8('0x2b'):'Telephones';_0x46a32c[_0x51a8('0x44')](db[_0x51a8('0x34')]['create']({'name':_0x58a83c[_0x3b7e30]['name'],'resourceId':_0x58a83c[_0x3b7e30]['id'],'type':_0x35b703,'sectionId':_[_0x51a8('0x32')](_0x4e58fe,[_0x51a8('0x33'),_0x35b703])['id']},{}));}return BPromise[_0x51a8('0x51')](_0x46a32c);});})['then'](respondWithResult(_0x513d31,0xc9))[_0x51a8('0x1b')](handleError(_0x513d31,null));};exports[_0x51a8('0x8d')]=function(_0x3a4bb0,_0x11aab9){if(_0x3a4bb0[_0x51a8('0x5a')]['id']){delete _0x3a4bb0[_0x51a8('0x5a')]['id'];}return db[_0x51a8('0x38')]['find']({'where':{'id':_0x3a4bb0[_0x51a8('0x53')]['id']}})[_0x51a8('0x11')](function(_0xa29735){if(!_0xa29735)return null;if(_0xa29735['id']===_0x3a4bb0[_0x51a8('0x2a')]['id']){if(!_0x3a4bb0['body']['oldPassword']||!_0x3a4bb0[_0x51a8('0x5a')][_0x51a8('0x8e')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xa29735[_0x51a8('0x8f')](_0x3a4bb0['body']['oldPassword'])){throw new db['Sequelize'][(_0x51a8('0x90'))]('Wrong\x20credentials');}if(_0x3a4bb0[_0x51a8('0x5a')][_0x51a8('0x91')]===_0x3a4bb0['body']['newPassword']){throw new db[(_0x51a8('0x92'))]['ValidationError'](_0x51a8('0x93'));}}else if(_0x3a4bb0[_0x51a8('0x2a')]['role']===_0x51a8('0x28')){if(!_0x3a4bb0[_0x51a8('0x5a')]['newPassword']){throw new db[(_0x51a8('0x92'))][(_0x51a8('0x90'))](_0x51a8('0x94'));}}else if(_0x3a4bb0['user'][_0x51a8('0x5b')]===_0x51a8('0x2a')){if(!_0x3a4bb0[_0x51a8('0x5a')]['newPassword']){throw new db['Sequelize'][(_0x51a8('0x90'))](_0x51a8('0x94'));}if(_0xa29735[_0x51a8('0x5b')]!==_0x51a8('0x70')){throw new db[(_0x51a8('0x92'))][(_0x51a8('0x90'))](_0x51a8('0x85'));}}else{throw new db[(_0x51a8('0x92'))][(_0x51a8('0x90'))](_0x51a8('0x85'));}return _0xa29735;})[_0x51a8('0x11')](handleEntityNotFound(_0x11aab9,null))[_0x51a8('0x11')](function(_0x3b8c6f){return db['Setting']['findOne']({'attributes':['id',_0x51a8('0x62'),_0x51a8('0x95'),_0x51a8('0x96')]})[_0x51a8('0x11')](function(_0x33ec41){if(_0x33ec41['securePassword'])authService['validatePasswordPattern'](_0x3a4bb0[_0x51a8('0x5a')][_0x51a8('0x8e')]);if(!_0x33ec41['enforcePasswordHistory']||!_0x3b8c6f[_0x51a8('0x97')])return _0x3b8c6f;authService[_0x51a8('0x98')](_0x3a4bb0[_0x51a8('0x5a')][_0x51a8('0x8e')],_0x3b8c6f[_0x51a8('0x97')],_0x33ec41['passwordHistoryLimit']);return _0x3b8c6f;})['then'](saveUpdates({'password':_0x3a4bb0[_0x51a8('0x5a')]['newPassword'],'passwordResetAt':_0x3a4bb0[_0x51a8('0x2a')]['id']==_0x3a4bb0['params']['id']?moment():null,'previousPasswords':authService[_0x51a8('0x99')](_0x3a4bb0[_0x51a8('0x5a')]['newPassword'],_0x3b8c6f[_0x51a8('0x97')])},null));})[_0x51a8('0x11')](respondWithResult(_0x11aab9,null))[_0x51a8('0x1b')](handleError(_0x11aab9,null));};exports[_0x51a8('0x9a')]=function(_0x5cacc1,_0x57b718){var _0x126320=_0x5cacc1[_0x51a8('0x5a')][_0x51a8('0x9b')];return db[_0x51a8('0x38')]['find']({'where':{'id':_0x5cacc1[_0x51a8('0x53')]['id']},'attributes':['id','name',_0x51a8('0x5b'),'online',_0x51a8('0x9c'),_0x51a8('0x9d'),_0x51a8('0x9e')]})[_0x51a8('0x11')](handleEntityNotFound(_0x57b718,null))['then'](function(_0x432e6a){if(_0x432e6a){if(!utils['isValidChannel'](_0x126320)){throw new db[(_0x51a8('0x92'))][(_0x51a8('0x90'))](_0x51a8('0x9f'));}return _0x432e6a['add'+_[_0x51a8('0xa0')](_0x126320[_0x51a8('0xa1')]())+_0x51a8('0xa2')](_0x5cacc1['body']['ids'],{'penalty':_0x5cacc1[_0x51a8('0x5a')][_0x51a8('0xa3')]||0x0})[_0x51a8('0xa4')](function(_0x706653){for(var _0x4c3d87=0x0;_0x4c3d87<_0x5cacc1['body'][_0x51a8('0x5e')]['length'];_0x4c3d87+=0x1){var _0x1b9cd4={'UserId':Number(_0x5cacc1[_0x51a8('0x53')]['id'])};_0x1b9cd4[_[_0x51a8('0xa0')](_0x126320[_0x51a8('0xa1')]())+_0x51a8('0xa5')]=Number(_0x5cacc1[_0x51a8('0x5a')][_0x51a8('0x5e')][_0x4c3d87]);socket['emit']('user'+_['capitalize'](_0x126320[_0x51a8('0xa1')]())+_0x51a8('0xa6'),_0x1b9cd4);}return _0x706653;})[_0x51a8('0x11')](function(){if(_0x126320===_0x51a8('0xa7')){return db[_0x51a8('0xa8')]['findAll']({'where':{'id':_0x5cacc1[_0x51a8('0x5a')]['ids']||[]},'raw':!![],'attributes':['id',_0x51a8('0x33')]});}})[_0x51a8('0x11')](function(_0x1dcdd9){var _0xb9dad5=_0x432e6a['get']({'plain':!![]});var _0x5250c9=[];if(_0x126320===_0x51a8('0xa7')&&_0xb9dad5['role']===_0x51a8('0x70')&&_0xb9dad5[_0x51a8('0xa9')]){for(var _0x292f74=0x0;_0x292f74<_0x1dcdd9[_0x51a8('0x49')];_0x292f74+=0x1){_0x5250c9['push']({'membername':_0xb9dad5[_0x51a8('0x33')],'UserId':_0xb9dad5['id'],'queue_name':_0x1dcdd9[_0x292f74][_0x51a8('0x33')],'VoiceQueueId':_0x1dcdd9[_0x292f74]['id'],'interface':_[_0x51a8('0x64')](_0xb9dad5[_0x51a8('0x9e')])?util[_0x51a8('0xaa')](_0x51a8('0xab'),_0xb9dad5[_0x51a8('0x33')]):_0xb9dad5[_0x51a8('0x9e')],'paused':_0xb9dad5[_0x51a8('0x9d')]||![],'penalty':_0x5cacc1[_0x51a8('0x5a')][_0x51a8('0xa3')]||0x0});}return BPromise['each'](_0x5250c9,function(_0x3791f1){return db[_0x51a8('0xac')][_0x51a8('0xad')](_0x3791f1);});}return _0x432e6a;});}})[_0x51a8('0x11')](respondWithStatusCode(_0x57b718,null))[_0x51a8('0x1b')](handleError(_0x57b718,null));};exports['removeQueues']=function(_0x3ed105,_0x4a48b4){var _0xb8cb9c;return db['User'][_0x51a8('0x32')]({'where':{'id':_0x3ed105[_0x51a8('0x53')]['id']},'attributes':['id',_0x51a8('0x33'),'role']})[_0x51a8('0x11')](handleEntityNotFound(_0x4a48b4,null))[_0x51a8('0x11')](function(_0x26fde4){if(_0x26fde4){_0xb8cb9c=_0x26fde4;if(!_0x3ed105[_0x51a8('0x40')]['channel']||!utils['isValidChannel'](_0x3ed105['query'][_0x51a8('0x9b')])){throw new db['Sequelize']['ValidationError'](_0x51a8('0x9f'));}return _0x26fde4[_0x51a8('0xae')+_[_0x51a8('0xa0')](_0x3ed105[_0x51a8('0x40')][_0x51a8('0x9b')][_0x51a8('0xa1')]())+'Queues'](_0x3ed105[_0x51a8('0x40')][_0x51a8('0x5e')]);}})['then'](function(_0x4a0407){if(_[_0x51a8('0xaf')](_0x3ed105[_0x51a8('0x40')]['ids'])){for(var _0x3f5239=0x0;_0x3f5239<_0x3ed105[_0x51a8('0x40')][_0x51a8('0x5e')][_0x51a8('0x49')];_0x3f5239+=0x1){var _0x1d9439={'UserId':Number(_0x3ed105[_0x51a8('0x53')]['id'])};_0x1d9439[_[_0x51a8('0xa0')](_0x3ed105[_0x51a8('0x40')][_0x51a8('0x9b')][_0x51a8('0xa1')]())+_0x51a8('0xa5')]=Number(_0x3ed105[_0x51a8('0x40')][_0x51a8('0x5e')][_0x3f5239]);socket[_0x51a8('0xb0')](_0x51a8('0x2a')+_['capitalize'](_0x3ed105[_0x51a8('0x40')][_0x51a8('0x9b')]['toLowerCase']())+_0x51a8('0xb1'),_0x1d9439);}}else{var _0x1d9439={'UserId':Number(_0x3ed105['params']['id'])};_0x1d9439[_[_0x51a8('0xa0')](_0x3ed105['query']['channel'][_0x51a8('0xa1')]())+'QueueId']=Number(_0x3ed105[_0x51a8('0x40')][_0x51a8('0x5e')]);socket[_0x51a8('0xb0')](_0x51a8('0x2a')+_['capitalize'](_0x3ed105['query']['channel']['toLowerCase']())+_0x51a8('0xb1'),_0x1d9439);}return _0x4a0407;})[_0x51a8('0x11')](function(){if(_0x3ed105[_0x51a8('0x40')][_0x51a8('0x9b')]===_0x51a8('0xa7')){return db[_0x51a8('0xac')][_0x51a8('0x26')]({'where':{'UserId':_0x3ed105['params']['id'],'VoiceQueueId':_0x3ed105['query'][_0x51a8('0x5e')]},'individualHooks':!![]})['then'](function(){return _0xb8cb9c;});}return _0xb8cb9c;})['then'](respondWithStatusCode(_0x4a48b4,null))[_0x51a8('0x1b')](handleError(_0x4a48b4,null));};exports[_0x51a8('0xb2')]=function(_0xab369d,_0x12adb3){_0xab369d[_0x51a8('0x5a')][_0x51a8('0xb3')]=_0xab369d[_0x51a8('0xb4')][_0x51a8('0xb5')];return db[_0x51a8('0x38')]['find']({'where':{'id':_0xab369d['params']['id']}})[_0x51a8('0x11')](handleEntityNotFound(_0x12adb3,null))[_0x51a8('0x11')](saveUpdates(_0xab369d[_0x51a8('0x5a')],null))[_0x51a8('0x11')](respondWithResult(_0x12adb3,null))[_0x51a8('0x1b')](handleError(_0x12adb3,null));};exports[_0x51a8('0xb6')]=function(_0x1bb721,_0x2c1f9d){var _0x1530e2=path[_0x51a8('0xb7')](config['root'],'server/files/images/logos/default_profile.png');return db['User'][_0x51a8('0x32')]({'where':{'id':_0x1bb721[_0x51a8('0x53')]['id']},'attributes':['id',_0x51a8('0xb3')],'raw':!![]})['then'](handleEntityNotFound(_0x2c1f9d,null))[_0x51a8('0x11')](function(_0x18179c){if(_0x18179c){if(_[_0x51a8('0x64')](_0x18179c[_0x51a8('0xb3')])){return _0x2c1f9d['download'](_0x1530e2);}else{if(!fs[_0x51a8('0xb8')](path[_0x51a8('0xb7')](config['root'],_0x51a8('0xb9'),_0x18179c['userpic']))){return _0x2c1f9d[_0x51a8('0xba')](_0x1530e2);}return _0x2c1f9d[_0x51a8('0xba')](path[_0x51a8('0xb7')](config[_0x51a8('0xbb')],'server/files/images/',_0x18179c[_0x51a8('0xb3')]));}}})['catch'](handleError(_0x2c1f9d,null));};exports['getOpenTabs']=function(_0x3fe627,_0x1d61fe){return db[_0x51a8('0x38')][_0x51a8('0x32')]({'where':{'id':_0x3fe627[_0x51a8('0x53')]['id']},'attributes':['id']})[_0x51a8('0x11')](handleEntityNotFound(_0x1d61fe,null))[_0x51a8('0x11')](function(_0x5a2c8b){var _0x45d02e=[];values=_0x5a2c8b[_0x51a8('0x4c')];_0x45d02e[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4a'),_0x5a2c8b['dataValues']));_0x45d02e[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4b'),_0x5a2c8b[_0x51a8('0x4c')]));_0x45d02e[_0x51a8('0x44')](get_open_tabs('openchannel',_0x5a2c8b[_0x51a8('0x4c')]));_0x45d02e[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x50'),_0x5a2c8b[_0x51a8('0x4c')]));_0x45d02e['push'](get_open_tabs(_0x51a8('0x4d'),_0x5a2c8b[_0x51a8('0x4c')]));_0x45d02e[_0x51a8('0x44')](get_open_tabs(_0x51a8('0x4e'),_0x5a2c8b[_0x51a8('0x4c')]));return BPromise[_0x51a8('0x51')](_0x45d02e);})[_0x51a8('0x11')](function(_0x36d7bd){var _0x1dc993=[];if(_0x36d7bd){for(var _0x3b535f=0x0;_0x3b535f=_0x468907[_0xd2ff('0x50')]){throw new Error(_0xd2ff('0x51'));}})[_0xd2ff('0xe')](function(){if(_0x251985){return db['UserVoiceQueueRt'][_0xd2ff('0x4a')]({'where':{'membername':_0x251985[_0xd2ff('0x29')]},'individualHooks':!![]});}})[_0xd2ff('0xe')](function(){if(_0x251985){return _0x251985['getVoiceQueues']({'raw':!![]});}})[_0xd2ff('0xe')](function(_0x100f92){if(_0x251985){if(_0x100f92){var _0x1d5ef4=[];_0x38ec92=_0x100f92;if(_0x38ec92[_0xd2ff('0x2b')]){for(var _0x20f12b=0x0;_0x20f12b<_0x38ec92[_0xd2ff('0x2b')];_0x20f12b++){_0x1d5ef4[_0xd2ff('0x30')](db[_0xd2ff('0x28')]['upsert']({'membername':_0x251985[_0xd2ff('0x29')],'UserId':_0x251985['id'],'queue_name':_0x38ec92[_0x20f12b][_0xd2ff('0x29')],'VoiceQueueId':_0x38ec92[_0x20f12b]['id'],'interface':_0x2d0c74,'paused':_0x251985[_0xd2ff('0x4d')]||![],'penalty':_0x38ec92[_0x20f12b][_0xd2ff('0x52')]||0x0}));}return BPromise[_0xd2ff('0x48')](_0x1d5ef4);}}}})['then'](function(){if(_0x251985){return db[_0xd2ff('0x44')][_0xd2ff('0x53')]({'where':{'membername':_0x251985['name'],'exitAt':null}});}})[_0xd2ff('0xe')](function(_0x3771cd){if(_0x251985){if(_0x3771cd&&_0x3771cd[_0xd2ff('0x2b')]){var _0x41c985=[];_0x3771cd['forEach'](function(_0x418576){_0x41c985['push'](_0x418576[_0xd2ff('0x38')]({'exitAt':moment()[_0xd2ff('0x2c')](_0xd2ff('0x2d'))}));});return BPromise['all'](_0x41c985);}}})[_0xd2ff('0xe')](function(_0x32c5d4){if(_0x251985){var _0x527074=[];var _0x58da47=[];var _0x274824=utils[_0xd2ff('0x54')]();var _0x84877a={'membername':_0x251985[_0xd2ff('0x29')],'interface':_0x2d0c74,'enterAt':moment()[_0xd2ff('0x2c')](_0xd2ff('0x2d')),'role':_0x251985['role'],'internal':_0x251985[_0xd2ff('0x26')]};_0x274824[_0xd2ff('0x2f')](function(_0x1d38b3){_0x527074[_0xd2ff('0x30')](_['merge']({'channel':_0x1d38b3,'type':_0xd2ff('0x55'),'data1':_0xd2ff('0x56'),'data2':_0x2d0c74},_0x84877a));if(_0x251985[_0xd2ff('0x4d')]){_0x58da47[_0xd2ff('0x30')](_[_0xd2ff('0x57')]({'channel':_0x1d38b3,'type':_0xd2ff('0x2a'),'data1':_0xd2ff('0x58')},_0x84877a));}});return db[_0xd2ff('0x44')][_0xd2ff('0x37')](_0x527074[_0xd2ff('0x59')](_0x58da47),{'individualHooks':!![]});}})['then'](function(){if(_0x251985){return _0x251985[_0xd2ff('0x38')]({'online':!![],'lastLoginAt':moment()['format'](_0xd2ff('0x2d')),'voicePause':_0x251985[_0xd2ff('0x4d')]||![],'mailPause':_0x251985[_0xd2ff('0x4d')]||![],'chatPause':_0x251985[_0xd2ff('0x4d')]||![],'faxPause':_0x251985[_0xd2ff('0x4d')]||![],'smsPause':_0x251985[_0xd2ff('0x4d')]||![],'openchannelPause':_0x251985['loginInPause']||![],'pauseType':_0x251985[_0xd2ff('0x4d')]?_0xd2ff('0x58'):null,'lastPauseAt':moment()[_0xd2ff('0x2c')](_0xd2ff('0x2d')),'interface':_0x2d0c74});}})['then'](function(_0x3ae05e){_0x89b3f5(_0x3ae05e);})[_0xd2ff('0x16')](function(_0x2aee3b){_0x4861d4(_0x1131ad['error'](0x1f4,_0x2aee3b[_0xd2ff('0x14')]));});});}; \ No newline at end of file +var _0x32f8=['merge','callysquare','loginInPause','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw','where','limit','include','model','attributes','map','ShowUser','find','role','interface','UserVoiceQueueRt','update','MemberReport','name','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','push','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','UnpauseUser','channel','Unknown\x20channel','voice','system','mail','fax','sms','openchannel','whatsapp','set','%s%s','Pause','all','LoginUser','findOne','mobile','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','forEach'];(function(_0x403f00,_0x50caf8){var _0x1335d3=function(_0x4871b9){while(--_0x4871b9){_0x403f00['push'](_0x403f00['shift']());}};_0x1335d3(++_0x50caf8);}(_0x32f8,0x1b6));var _0x832f=function(_0x547d0a,_0x31c1c5){_0x547d0a=_0x547d0a-0x0;var _0x570836=_0x32f8[_0x547d0a];return _0x570836;};'use strict';var _=require(_0x832f('0x0'));var util=require('util');var moment=require(_0x832f('0x1'));var BPromise=require('bluebird');var rs=require(_0x832f('0x2'));var fs=require('fs');var Redis=require(_0x832f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x832f('0x4'));var logger=require(_0x832f('0x5'))(_0x832f('0x6'));var config=require(_0x832f('0x7'));var jayson=require(_0x832f('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x832f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x832f('0xa'))(new Redis(config[_0x832f('0x9')]));require('./user.socket')[_0x832f('0xb')](socket);function respondWithRpcPromise(_0x1c363e,_0x15ed8c,_0x45adc8){return new BPromise(function(_0x3b2078,_0x43d929){return client[_0x832f('0xc')](_0x1c363e,_0x45adc8)[_0x832f('0xd')](function(_0x215564){logger[_0x832f('0xe')](_0x832f('0xf'),_0x15ed8c,_0x832f('0x10'));logger[_0x832f('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x15ed8c,'request\x20sent',JSON[_0x832f('0x12')](_0x215564));if(_0x215564[_0x832f('0x13')]){if(_0x215564['error'][_0x832f('0x14')]===0x1f4){logger[_0x832f('0x13')](_0x832f('0xf'),_0x15ed8c,_0x215564[_0x832f('0x13')][_0x832f('0x15')]);return _0x43d929(_0x215564[_0x832f('0x13')][_0x832f('0x15')]);}logger[_0x832f('0x13')](_0x832f('0xf'),_0x15ed8c,_0x215564[_0x832f('0x13')][_0x832f('0x15')]);return _0x3b2078(_0x215564[_0x832f('0x13')][_0x832f('0x15')]);}else{logger[_0x832f('0xe')](_0x832f('0xf'),_0x15ed8c,_0x832f('0x10'));_0x3b2078(_0x215564[_0x832f('0x16')][_0x832f('0x15')]);}})[_0x832f('0x17')](function(_0x192510){logger[_0x832f('0x13')](_0x832f('0xf'),_0x15ed8c,_0x192510);_0x43d929(_0x192510);});});}exports[_0x832f('0x18')]=function(_0xea51dc){var _0x36878e=this;return new Promise(function(_0x22a823,_0x422eef){return db[_0x832f('0x19')][_0x832f('0x1a')]({'raw':_0xea51dc[_0x832f('0x1b')]?_0xea51dc['options'][_0x832f('0x1c')]===undefined?!![]:![]:!![],'where':_0xea51dc[_0x832f('0x1b')]?_0xea51dc['options'][_0x832f('0x1d')]||null:null,'attributes':_0xea51dc[_0x832f('0x1b')]?_0xea51dc['options']['attributes']||null:null,'limit':_0xea51dc[_0x832f('0x1b')]?_0xea51dc[_0x832f('0x1b')][_0x832f('0x1e')]||null:null,'include':_0xea51dc['options']?_0xea51dc[_0x832f('0x1b')]['include']?_['map'](_0xea51dc[_0x832f('0x1b')][_0x832f('0x1f')],function(_0x4eabf0){return{'model':db[_0x4eabf0[_0x832f('0x20')]],'as':_0x4eabf0['as'],'attributes':_0x4eabf0[_0x832f('0x21')],'include':_0x4eabf0[_0x832f('0x1f')]?_[_0x832f('0x22')](_0x4eabf0[_0x832f('0x1f')],function(_0x1add55){return{'model':db[_0x1add55[_0x832f('0x20')]],'as':_0x1add55['as'],'attributes':_0x1add55[_0x832f('0x21')],'include':_0x1add55[_0x832f('0x1f')]?_[_0x832f('0x22')](_0x1add55[_0x832f('0x1f')],function(_0x28b0f2){return{'model':db[_0x28b0f2[_0x832f('0x20')]],'as':_0x28b0f2['as'],'attributes':_0x28b0f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x169f2f){logger[_0x832f('0xe')](_0x832f('0x18'),_0xea51dc);logger['debug'](_0x832f('0x18'),_0xea51dc,JSON[_0x832f('0x12')](_0x169f2f));_0x22a823(_0x169f2f);})[_0x832f('0x17')](function(_0x2f1e02){logger['error'](_0x832f('0x18'),_0x2f1e02['message'],_0xea51dc);_0x422eef(_0x36878e[_0x832f('0x13')](0x1f4,_0x2f1e02['message']));});});};exports[_0x832f('0x23')]=function(_0x3c5d74){var _0x43b1b6=this;return new Promise(function(_0x4cb9ea,_0x24eaeb){return db[_0x832f('0x19')][_0x832f('0x24')]({'raw':_0x3c5d74[_0x832f('0x1b')]?_0x3c5d74['options'][_0x832f('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c5d74[_0x832f('0x1b')]?_0x3c5d74[_0x832f('0x1b')][_0x832f('0x1d')]||null:null,'attributes':_0x3c5d74[_0x832f('0x1b')]?_0x3c5d74[_0x832f('0x1b')][_0x832f('0x21')]||null:null,'include':_0x3c5d74['options']?_0x3c5d74[_0x832f('0x1b')][_0x832f('0x1f')]?_['map'](_0x3c5d74[_0x832f('0x1b')][_0x832f('0x1f')],function(_0x52fe8f){return{'model':db[_0x52fe8f[_0x832f('0x20')]],'as':_0x52fe8f['as'],'attributes':_0x52fe8f[_0x832f('0x21')],'include':_0x52fe8f['include']?_[_0x832f('0x22')](_0x52fe8f['include'],function(_0x22adb8){return{'model':db[_0x22adb8[_0x832f('0x20')]],'as':_0x22adb8['as'],'attributes':_0x22adb8[_0x832f('0x21')],'include':_0x22adb8[_0x832f('0x1f')]?_[_0x832f('0x22')](_0x22adb8[_0x832f('0x1f')],function(_0x475b3f){return{'model':db[_0x475b3f[_0x832f('0x20')]],'as':_0x475b3f['as'],'attributes':_0x475b3f['attributes']};}):[]};}):[]};}):[]:[]})[_0x832f('0xd')](function(_0x59dbbd){logger['info'](_0x832f('0x23'),_0x3c5d74);logger[_0x832f('0x11')]('ShowUser',_0x3c5d74,JSON[_0x832f('0x12')](_0x59dbbd));_0x4cb9ea(_0x59dbbd);})[_0x832f('0x17')](function(_0x590894){logger[_0x832f('0x13')](_0x832f('0x23'),_0x590894[_0x832f('0x15')],_0x3c5d74);_0x24eaeb(_0x43b1b6[_0x832f('0x13')](0x1f4,_0x590894[_0x832f('0x15')]));});});};exports['PauseUser']=function(_0x18a355){var _0x4266f9=this;return new Promise(function(_0x3dfa76,_0x52ff97){var _0x310e98;return db[_0x832f('0x19')]['find']({'where':_0x18a355[_0x832f('0x1b')][_0x832f('0x1d')]||{},'attributes':['id','name',_0x832f('0x25'),'internal',_0x832f('0x26')]})[_0x832f('0xd')](function(_0xe551da){if(_0xe551da){_0x310e98=_0xe551da;return db[_0x832f('0x27')][_0x832f('0x28')]({'paused':0x1},{'where':{'UserId':_0x310e98['id']},'individualHooks':!![]});}})['then'](function(){if(_0x310e98){return db[_0x832f('0x29')][_0x832f('0x1a')]({'where':{'membername':_0x310e98[_0x832f('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0x832f('0xd')](function(_0xf80e2b){if(_0x310e98){if(_0xf80e2b&&_0xf80e2b['length']){var _0xeb9b89=moment()[_0x832f('0x2b')](_0x832f('0x2c'));for(var _0x1839d6=0x0,_0x5bc873=_0xf80e2b[_0x832f('0x2d')];_0x1839d6<_0x5bc873;_0x1839d6++){_0xf80e2b[_0x1839d6][_0x832f('0x2e')]({'exitAt':_0xeb9b89});}}}})[_0x832f('0xd')](function(){if(_0x310e98){var _0x2c1fe3=[];var _0x425c13=utils[_0x832f('0x2f')]();_0x425c13['forEach'](function(_0x29b653){_0x2c1fe3[_0x832f('0x30')]({'channel':_0x29b653,'membername':_0x310e98['name'],'interface':_[_0x832f('0x31')](_0x310e98['interface'])?util[_0x832f('0x2b')](_0x832f('0x32'),_0x310e98[_0x832f('0x2a')]):_0x310e98[_0x832f('0x26')],'type':_0x832f('0x33'),'enterAt':moment()[_0x832f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x18a355[_0x832f('0x34')][_0x832f('0x35')]||_0x832f('0x36'),'role':_0x310e98[_0x832f('0x25')],'internal':_0x310e98[_0x832f('0x37')],'uniqueid':_0x18a355[_0x832f('0x34')][_0x832f('0x38')]||null});});return db[_0x832f('0x29')][_0x832f('0x39')](_0x2c1fe3,{'individualHooks':!![]});}})[_0x832f('0xd')](function(){if(_0x310e98){return _0x310e98[_0x832f('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x18a355[_0x832f('0x34')][_0x832f('0x35')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x832f('0x2b')](_0x832f('0x2c'))});}})[_0x832f('0xd')](function(_0xe2fa05){_0x3dfa76(_0xe2fa05);})[_0x832f('0x17')](function(_0x20da34){_0x52ff97(_0x4266f9['error'](0x1f4,_0x20da34['message']));});});};exports[_0x832f('0x3a')]=function(_0x557b1b){var _0x42ad86=this;return new Promise(function(_0x2ba5ba,_0x2b1241){var _0x1ba229;return db['User']['findOne']({'where':_0x557b1b[_0x832f('0x1b')][_0x832f('0x1d')]||{},'attributes':['id',_0x832f('0x2a')]})[_0x832f('0xd')](function(_0x4c6e12){if(_0x4c6e12){_0x1ba229=_0x4c6e12;if(_0x557b1b[_0x832f('0x34')][_0x832f('0x3b')]&&!utils['isValidChannel'](_0x557b1b[_0x832f('0x34')][_0x832f('0x3b')])){throw new Error(_0x832f('0x3c'));}switch(_0x557b1b[_0x832f('0x34')]['channel']){case _0x832f('0x3d'):return db[_0x832f('0x27')][_0x832f('0x28')]({'paused':0x0},{'where':{'UserId':_0x1ba229['id']}})[_0x832f('0xd')](function(){return db[_0x832f('0x29')][_0x832f('0x24')]({'where':{'channel':_0x557b1b['body'][_0x832f('0x3b')],'membername':_0x1ba229[_0x832f('0x2a')],'type':_0x832f('0x33'),'exitAt':null}});})['then'](function(_0x1f2c01){if(_0x1f2c01){return _0x1f2c01[_0x832f('0x28')]({'exitAt':moment()[_0x832f('0x2b')](_0x832f('0x2c')),'data2':_0x832f('0x3e')},{'individualHooks':!![]});}return null;})[_0x832f('0xd')](function(){return _0x1ba229[_0x832f('0x28')]({'voicePause':![]});});case _0x832f('0x3f'):case'chat':case _0x832f('0x40'):case _0x832f('0x41'):case _0x832f('0x42'):case _0x832f('0x43'):return db[_0x832f('0x29')]['find']({'where':{'channel':_0x557b1b[_0x832f('0x34')][_0x832f('0x3b')],'membername':_0x1ba229[_0x832f('0x2a')],'type':_0x832f('0x33'),'exitAt':null}})[_0x832f('0xd')](function(_0x379c66){return _0x379c66[_0x832f('0x28')]({'exitAt':moment()['format'](_0x832f('0x2c')),'data2':_0x832f('0x3e')},{'individualHooks':!![]});})[_0x832f('0xd')](function(){var _0x2d1e5b={};_[_0x832f('0x44')](_0x2d1e5b,util[_0x832f('0x2b')](_0x832f('0x45'),_0x557b1b['body'][_0x832f('0x3b')],_0x832f('0x46')),![]);return _0x1ba229[_0x832f('0x28')](_0x2d1e5b);});default:return db['UserVoiceQueueRt'][_0x832f('0x28')]({'paused':0x0},{'where':{'UserId':_0x1ba229['id']}})[_0x832f('0xd')](function(){return db[_0x832f('0x29')][_0x832f('0x1a')]({'where':{'membername':_0x1ba229['name'],'type':_0x832f('0x33'),'exitAt':null}});})[_0x832f('0xd')](function(_0x43c178){var _0x471caa=[];_0x43c178['forEach'](function(_0x18cbe3){_0x471caa[_0x832f('0x30')](_0x18cbe3[_0x832f('0x28')]({'exitAt':moment()[_0x832f('0x2b')](_0x832f('0x2c')),'data2':_0x832f('0x3e')}));});return BPromise['all'](_0x471caa);})[_0x832f('0xd')](function(){return _0x1ba229[_0x832f('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x832f('0xd')](function(_0x5cf6a0){_0x2ba5ba(_0x5cf6a0);})[_0x832f('0x17')](function(_0x4c910b){_0x2b1241(_0x42ad86[_0x832f('0x13')](0x1f4,_0x4c910b[_0x832f('0x15')]));});});};exports['LogoutUser']=function(_0x18f61d){var _0x5cc582=this;return new Promise(function(_0x24f3e8,_0x256539){var _0x5323d1;return db['User']['findOne']({'where':_0x18f61d['options']['where']||{},'attributes':['id',_0x832f('0x2a')]})[_0x832f('0xd')](function(_0x2b06ee){if(_0x2b06ee){_0x5323d1=_0x2b06ee;return db[_0x832f('0x27')]['destroy']({'where':{'membername':_0x5323d1['name']},'individualHooks':!![]});}})[_0x832f('0xd')](function(){if(_0x5323d1){return db[_0x832f('0x29')][_0x832f('0x1a')]({'where':{'membername':_0x5323d1[_0x832f('0x2a')],'exitAt':null}});}})[_0x832f('0xd')](function(_0x31ce46){if(_0x5323d1){if(_0x31ce46&&_0x31ce46[_0x832f('0x2d')]){var _0x5996ab=[];_0x31ce46['forEach'](function(_0x4fc53a){_0x5996ab['push'](_0x4fc53a[_0x832f('0x28')]({'exitAt':moment()['format'](_0x832f('0x2c'))}));});return BPromise[_0x832f('0x47')](_0x5996ab);}}})[_0x832f('0xd')](function(){if(_0x5323d1){return _0x5323d1[_0x832f('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2def5b){_0x24f3e8(_0x2def5b);})[_0x832f('0x17')](function(_0x36b838){_0x256539(_0x5cc582[_0x832f('0x13')](0x1f4,_0x36b838[_0x832f('0x15')]));});});};exports[_0x832f('0x48')]=function(_0x5e2c5d){var _0x1a9283=this;return new Promise(function(_0x3d6300,_0x325f99){var _0x5f3563;var _0x4978f2;var _0x2696db;var _0x10220f;return db[_0x832f('0x19')][_0x832f('0x49')]({'where':_0x5e2c5d[_0x832f('0x1b')][_0x832f('0x1d')]||{},'attributes':['id',_0x832f('0x2a'),_0x832f('0x25'),_0x832f('0x4a'),'phone',_0x832f('0x37'),'loginInPause',_0x832f('0x26')]})['then'](function(_0x297eaa){if(_0x297eaa){_0x5f3563=_0x297eaa;_0x10220f=_0x5e2c5d[_0x832f('0x34')][_0x832f('0x26')]?_0x5e2c5d['body'][_0x832f('0x26')]:util[_0x832f('0x2b')](_0x832f('0x32'),_0x5f3563[_0x832f('0x2a')]);return db[_0x832f('0x19')]['count']({'where':{'role':_0x832f('0x4b'),'online':!![],'id':{'$ne':_0x5f3563['id']}}});}})[_0x832f('0xd')](function(_0x1dee1a){if(_0x1dee1a){_0x2696db=_0x1dee1a;return require('../../config/license/util')[_0x832f('0x4c')]();}})['then'](function(_0x316e42){if(_0x316e42&&_0x316e42['agents']&&_0x2696db>=_0x316e42[_0x832f('0x4d')]){throw new Error(_0x832f('0x4e'));}})[_0x832f('0xd')](function(){if(_0x5f3563){return db['UserVoiceQueueRt'][_0x832f('0x4f')]({'where':{'membername':_0x5f3563[_0x832f('0x2a')]},'individualHooks':!![]});}})[_0x832f('0xd')](function(){if(_0x5f3563){return _0x5f3563[_0x832f('0x50')]({'raw':!![]});}})[_0x832f('0xd')](function(_0x5025ad){if(_0x5f3563){if(_0x5025ad){var _0x391685=[];_0x4978f2=_0x5025ad;if(_0x4978f2[_0x832f('0x2d')]){for(var _0xaa2622=0x0;_0xaa2622<_0x4978f2[_0x832f('0x2d')];_0xaa2622++){_0x391685['push'](db[_0x832f('0x27')][_0x832f('0x51')]({'membername':_0x5f3563['name'],'UserId':_0x5f3563['id'],'queue_name':_0x4978f2[_0xaa2622][_0x832f('0x2a')],'VoiceQueueId':_0x4978f2[_0xaa2622]['id'],'interface':_0x10220f,'paused':_0x5f3563['loginInPause']||![],'penalty':_0x4978f2[_0xaa2622][_0x832f('0x52')]||0x0}));}return BPromise[_0x832f('0x47')](_0x391685);}}}})[_0x832f('0xd')](function(){if(_0x5f3563){return db[_0x832f('0x29')][_0x832f('0x1a')]({'where':{'membername':_0x5f3563['name'],'exitAt':null}});}})['then'](function(_0x488765){if(_0x5f3563){if(_0x488765&&_0x488765[_0x832f('0x2d')]){var _0x1e482d=[];_0x488765[_0x832f('0x53')](function(_0x359efc){_0x1e482d[_0x832f('0x30')](_0x359efc['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x832f('0x47')](_0x1e482d);}}})['then'](function(_0x35707c){if(_0x5f3563){var _0x2c955b=[];var _0x14f5a4=[];var _0x314dac=utils[_0x832f('0x2f')]();var _0x114f1e={'membername':_0x5f3563[_0x832f('0x2a')],'interface':_0x10220f,'enterAt':moment()[_0x832f('0x2b')](_0x832f('0x2c')),'role':_0x5f3563[_0x832f('0x25')],'internal':_0x5f3563[_0x832f('0x37')]};_0x314dac[_0x832f('0x53')](function(_0x423b9f){_0x2c955b[_0x832f('0x30')](_[_0x832f('0x54')]({'channel':_0x423b9f,'type':'LOGIN','data1':_0x832f('0x55'),'data2':_0x10220f},_0x114f1e));if(_0x5f3563['loginInPause']){_0x14f5a4[_0x832f('0x30')](_[_0x832f('0x54')]({'channel':_0x423b9f,'type':'PAUSE','data1':'LOGININPAUSE'},_0x114f1e));}});return db['MemberReport'][_0x832f('0x39')](_0x2c955b['concat'](_0x14f5a4),{'individualHooks':!![]});}})[_0x832f('0xd')](function(){if(_0x5f3563){return _0x5f3563[_0x832f('0x28')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5f3563['loginInPause']||![],'mailPause':_0x5f3563[_0x832f('0x56')]||![],'chatPause':_0x5f3563[_0x832f('0x56')]||![],'faxPause':_0x5f3563[_0x832f('0x56')]||![],'smsPause':_0x5f3563['loginInPause']||![],'openchannelPause':_0x5f3563['loginInPause']||![],'pauseType':_0x5f3563[_0x832f('0x56')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x832f('0x2b')](_0x832f('0x2c')),'interface':_0x10220f});}})[_0x832f('0xd')](function(_0x1d8dca){_0x3d6300(_0x1d8dca);})['catch'](function(_0x5c1eac){_0x325f99(_0x1a9283[_0x832f('0x13')](0x1f4,_0x5c1eac[_0x832f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 67460c0..3666344 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 _0x7abd=['user:','./user.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1c0794,_0x59c455){var _0x4bb62f=function(_0x15ba66){while(--_0x15ba66){_0x1c0794['push'](_0x1c0794['shift']());}};_0x4bb62f(++_0x59c455);}(_0x7abd,0xa3));var _0xd7ab=function(_0x2fc8a9,_0x500be1){_0x2fc8a9=_0x2fc8a9-0x0;var _0x1ca3f5=_0x7abd[_0x2fc8a9];return _0x1ca3f5;};'use strict';var UserEvents=require(_0xd7ab('0x0'));var events=[_0xd7ab('0x1'),_0xd7ab('0x2'),_0xd7ab('0x3')];function createListener(_0x5b107b,_0x583b6f){return function(_0x233540){_0x583b6f[_0xd7ab('0x4')](_0x5b107b,_0x233540);};}function removeListener(_0x4838bb,_0x5d2834){return function(){UserEvents[_0xd7ab('0x5')](_0x4838bb,_0x5d2834);};}exports[_0xd7ab('0x6')]=function(_0x453c7f){for(var _0x509188=0x0,_0x572d9c=events[_0xd7ab('0x7')];_0x509188<_0x572d9c;_0x509188++){var _0x374568=events[_0x509188];var _0x37d875=createListener(_0xd7ab('0x8')+_0x374568,_0x453c7f);UserEvents['on'](_0x374568,_0x37d875);}}; \ No newline at end of file +var _0x1697=['user:','remove','update','removeListener','register'];(function(_0x1fbe59,_0x45dd45){var _0x315b32=function(_0x403fe){while(--_0x403fe){_0x1fbe59['push'](_0x1fbe59['shift']());}};_0x315b32(++_0x45dd45);}(_0x1697,0x14b));var _0x7169=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x1697[_0x54d4a8];return _0x3b321b;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x7169('0x0'),_0x7169('0x1')];function createListener(_0x3dfb8a,_0xf0ddbb){return function(_0x5ef43e){_0xf0ddbb['emit'](_0x3dfb8a,_0x5ef43e);};}function removeListener(_0x190401,_0x2354d9){return function(){UserEvents[_0x7169('0x2')](_0x190401,_0x2354d9);};}exports[_0x7169('0x3')]=function(_0x16f38d){for(var _0x4a6622=0x0,_0x444cd1=events['length'];_0x4a6622<_0x444cd1;_0x4a6622++){var _0xb1df07=events[_0x4a6622];var _0x2507a7=createListener(_0x7169('0x4')+_0xb1df07,_0x16f38d);UserEvents['on'](_0xb1df07,_0x2507a7);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b0277e4..aad39b5 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(_0x5e678e,_0x2ba727){var _0x3509a0=function(_0x264137){while(--_0x264137){_0x5e678e['push'](_0x5e678e['shift']());}};_0x3509a0(++_0x2ba727);}(_0x70e0,0x17b));var _0x070e=function(_0x310dc9,_0x2466d9){_0x310dc9=_0x310dc9-0x0;var _0x412fae=_0x70e0[_0x310dc9];return _0x412fae;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4ae8d9,_0x4894f1){var _0x261051=function(_0x279407){while(--_0x279407){_0x4ae8d9['push'](_0x4ae8d9['shift']());}};_0x261051(++_0x4894f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9765ee5..ede46c4 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 _0xf15d=['exports','sequelize'];(function(_0x3169c9,_0x18d487){var _0x42dd87=function(_0x204c7d){while(--_0x204c7d){_0x3169c9['push'](_0x3169c9['shift']());}};_0x42dd87(++_0x18d487);}(_0xf15d,0x1a9));var _0xdf15=function(_0xd89aec,_0x2ebba0){_0xd89aec=_0xd89aec-0x0;var _0x605ba9=_0xf15d[_0xd89aec];return _0x605ba9;};'use strict';var Sequelize=require(_0xdf15('0x0'));module[_0xdf15('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf3ed=['INTEGER','sequelize'];(function(_0x52bc46,_0x4d97b2){var _0x3009b6=function(_0x4ea7cd){while(--_0x4ea7cd){_0x52bc46['push'](_0x52bc46['shift']());}};_0x3009b6(++_0x4d97b2);}(_0xf3ed,0xed));var _0xdf3e=function(_0x40740d,_0x25783c){_0x40740d=_0x40740d-0x0;var _0x2a45b5=_0xf3ed[_0x40740d];return _0x2a45b5;};'use strict';var Sequelize=require(_0xdf3e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdf3e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index b1942a3..a64b3fd 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 _0xab1f=['UserChatQueue','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define'];(function(_0x195b7c,_0x26df69){var _0x4920ab=function(_0xff024){while(--_0xff024){_0x195b7c['push'](_0x195b7c['shift']());}};_0x4920ab(++_0x26df69);}(_0xab1f,0xe5));var _0xfab1=function(_0x2da057,_0x1a79e8){_0x2da057=_0x2da057-0x0;var _0x4f1d5e=_0xab1f[_0x2da057];return _0x4f1d5e;};'use strict';var _=require(_0xfab1('0x0'));var util=require(_0xfab1('0x1'));var logger=require(_0xfab1('0x2'))(_0xfab1('0x3'));var moment=require(_0xfab1('0x4'));var BPromise=require('bluebird');var rp=require(_0xfab1('0x5'));var fs=require('fs');var path=require(_0xfab1('0x6'));var rimraf=require('rimraf');var config=require(_0xfab1('0x7'));var attributes=require(_0xfab1('0x8'));module[_0xfab1('0x9')]=function(_0x27c2b2,_0x3e3428){return _0x27c2b2[_0xfab1('0xa')](_0xfab1('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f6=['path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x54f6,0x89));var _0x654f=function(_0x592581,_0x2676e9){_0x592581=_0x592581-0x0;var _0x17ee1e=_0x54f6[_0x592581];return _0x17ee1e;};'use strict';var _=require(_0x654f('0x0'));var util=require(_0x654f('0x1'));var logger=require('../../config/logger')(_0x654f('0x2'));var moment=require(_0x654f('0x3'));var BPromise=require(_0x654f('0x4'));var rp=require(_0x654f('0x5'));var fs=require('fs');var path=require(_0x654f('0x6'));var rimraf=require(_0x654f('0x7'));var config=require('../../config/environment');var attributes=require(_0x654f('0x8'));module[_0x654f('0x9')]=function(_0x401f06,_0x3c3299){return _0x401f06[_0x654f('0xa')](_0x654f('0xb'),attributes,{'tableName':_0x654f('0xc'),'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 dad26ae..1821437 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 _0x21dd=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x25d2fa,_0x1d35c6){var _0x42d4aa=function(_0x590383){while(--_0x590383){_0x25d2fa['push'](_0x25d2fa['shift']());}};_0x42d4aa(++_0x1d35c6);}(_0x21dd,0x160));var _0xd21d=function(_0x5d6d9e,_0xb5d95e){_0x5d6d9e=_0x5d6d9e-0x0;var _0x24bab0=_0x21dd[_0x5d6d9e];return _0x24bab0;};'use strict';var _=require(_0xd21d('0x0'));var util=require(_0xd21d('0x1'));var moment=require('moment');var BPromise=require(_0xd21d('0x2'));var rs=require(_0xd21d('0x3'));var fs=require('fs');var Redis=require(_0xd21d('0x4'));var db=require(_0xd21d('0x5'))['db'];var utils=require(_0xd21d('0x6'));var logger=require(_0xd21d('0x7'))(_0xd21d('0x8'));var config=require(_0xd21d('0x9'));var jayson=require(_0xd21d('0xa'));var client=jayson[_0xd21d('0xb')][_0xd21d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c965d,_0x4b1cb1,_0x3d66b8){return new BPromise(function(_0x3ac089,_0x17940b){return client[_0xd21d('0xd')](_0x3c965d,_0x3d66b8)[_0xd21d('0xe')](function(_0x5121d2){logger[_0xd21d('0xf')](_0xd21d('0x10'),_0x4b1cb1,_0xd21d('0x11'));logger[_0xd21d('0x12')](_0xd21d('0x13'),_0x4b1cb1,_0xd21d('0x11'),JSON[_0xd21d('0x14')](_0x5121d2));if(_0x5121d2[_0xd21d('0x15')]){if(_0x5121d2[_0xd21d('0x15')]['code']===0x1f4){logger['error'](_0xd21d('0x10'),_0x4b1cb1,_0x5121d2[_0xd21d('0x15')]['message']);return _0x17940b(_0x5121d2[_0xd21d('0x15')]['message']);}logger[_0xd21d('0x15')](_0xd21d('0x10'),_0x4b1cb1,_0x5121d2[_0xd21d('0x15')][_0xd21d('0x16')]);return _0x3ac089(_0x5121d2[_0xd21d('0x15')][_0xd21d('0x16')]);}else{logger[_0xd21d('0xf')](_0xd21d('0x10'),_0x4b1cb1,_0xd21d('0x11'));_0x3ac089(_0x5121d2[_0xd21d('0x17')][_0xd21d('0x16')]);}})['catch'](function(_0x1f14c4){logger['error'](_0xd21d('0x10'),_0x4b1cb1,_0x1f14c4);_0x17940b(_0x1f14c4);});});} \ No newline at end of file +var _0x045e=['util','moment','randomstring','../../config/utils','rpc','../../config/environment','client','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x318dc3,_0x270585){var _0x4ba85c=function(_0x302691){while(--_0x302691){_0x318dc3['push'](_0x318dc3['shift']());}};_0x4ba85c(++_0x270585);}(_0x045e,0x77));var _0xe045=function(_0x59385f,_0x218c19){_0x59385f=_0x59385f-0x0;var _0x3502df=_0x045e[_0x59385f];return _0x3502df;};'use strict';var _=require(_0xe045('0x0'));var util=require(_0xe045('0x1'));var moment=require(_0xe045('0x2'));var BPromise=require('bluebird');var rs=require(_0xe045('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe045('0x4'));var logger=require('../../config/logger')(_0xe045('0x5'));var config=require(_0xe045('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe045('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dba94,_0x72530d,_0x4d1faf){return new BPromise(function(_0x593c45,_0x369642){return client[_0xe045('0x8')](_0x3dba94,_0x4d1faf)[_0xe045('0x9')](function(_0xeb3f08){logger[_0xe045('0xa')](_0xe045('0xb'),_0x72530d,'request\x20sent');logger[_0xe045('0xc')](_0xe045('0xd'),_0x72530d,_0xe045('0xe'),JSON[_0xe045('0xf')](_0xeb3f08));if(_0xeb3f08[_0xe045('0x10')]){if(_0xeb3f08[_0xe045('0x10')]['code']===0x1f4){logger[_0xe045('0x10')](_0xe045('0xb'),_0x72530d,_0xeb3f08[_0xe045('0x10')]['message']);return _0x369642(_0xeb3f08[_0xe045('0x10')]['message']);}logger['error'](_0xe045('0xb'),_0x72530d,_0xeb3f08[_0xe045('0x10')]['message']);return _0x593c45(_0xeb3f08[_0xe045('0x10')][_0xe045('0x11')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x72530d,_0xe045('0xe'));_0x593c45(_0xeb3f08[_0xe045('0x12')][_0xe045('0x11')]);}})[_0xe045('0x13')](function(_0x40fc3d){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x72530d,_0x40fc3d);_0x369642(_0x40fc3d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 379f701..f39d055 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(_0x8ac33f,_0x6a7cfc){var _0x5810e4=function(_0x5c3fee){while(--_0x5c3fee){_0x8ac33f['push'](_0x8ac33f['shift']());}};_0x5810e4(++_0x6a7cfc);}(_0x70e0,0x17b));var _0x070e=function(_0x4f77e6,_0x458430){_0x4f77e6=_0x4f77e6-0x0;var _0xb526b0=_0x70e0[_0x4f77e6];return _0xb526b0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3cae2b,_0xc098d5){var _0x28cca1=function(_0x53b323){while(--_0x53b323){_0x3cae2b['push'](_0x3cae2b['shift']());}};_0x28cca1(++_0xc098d5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xcb91[_0x4a7631];return _0x1a5a6f;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index ac93b11..137e025 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 _0xf02d=['INTEGER','STRING','sequelize','exports'];(function(_0xce59d2,_0x75f3b8){var _0x4fdc51=function(_0x216e81){while(--_0x216e81){_0xce59d2['push'](_0xce59d2['shift']());}};_0x4fdc51(++_0x75f3b8);}(_0xf02d,0x1e6));var _0xdf02=function(_0x725dc6,_0x3f4fb9){_0x725dc6=_0x725dc6-0x0;var _0x54e151=_0xf02d[_0x725dc6];return _0x54e151;};'use strict';var Sequelize=require(_0xdf02('0x0'));module[_0xdf02('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdf02('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdf02('0x3')]}}; \ No newline at end of file +var _0x4628=['INTEGER','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4628,0x6d));var _0x8462=function(_0x3f36bb,_0xa60c91){_0x3f36bb=_0x3f36bb-0x0;var _0x4adb54=_0x4628[_0x3f36bb];return _0x4adb54;};'use strict';var Sequelize=require(_0x8462('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8462('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 67b1d59..5a3c9c8 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 _0x3e57=['exports','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x3e57,0x184));var _0x73e5=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x3e57[_0x28669c];return _0x4a3af6;};'use strict';var _=require('lodash');var util=require(_0x73e5('0x0'));var logger=require(_0x73e5('0x1'))(_0x73e5('0x2'));var moment=require(_0x73e5('0x3'));var BPromise=require(_0x73e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73e5('0x5'));var rimraf=require(_0x73e5('0x6'));var config=require(_0x73e5('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x73e5('0x8')]=function(_0x41eaab,_0x9e1db6){return _0x41eaab[_0x73e5('0x9')](_0x73e5('0xa'),attributes,{'tableName':_0x73e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03c3=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x52b5c1,_0xf6ef3a){var _0x1e4e1e=function(_0x3a6657){while(--_0x3a6657){_0x52b5c1['push'](_0x52b5c1['shift']());}};_0x1e4e1e(++_0xf6ef3a);}(_0x03c3,0x1bd));var _0x303c=function(_0x4bd976,_0x9e9938){_0x4bd976=_0x4bd976-0x0;var _0x2792ee=_0x03c3[_0x4bd976];return _0x2792ee;};'use strict';var _=require(_0x303c('0x0'));var util=require(_0x303c('0x1'));var logger=require(_0x303c('0x2'))(_0x303c('0x3'));var moment=require(_0x303c('0x4'));var BPromise=require(_0x303c('0x5'));var rp=require(_0x303c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x303c('0x7'));var config=require(_0x303c('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x303c('0x9')]=function(_0x5b243e,_0x2338ae){return _0x5b243e[_0x303c('0xa')](_0x303c('0xb'),attributes,{'tableName':_0x303c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 267b18e..f53ed6f 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 _0xdf48=['info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0xd3a73e,_0x202985){var _0x49e51e=function(_0x40870c){while(--_0x40870c){_0xd3a73e['push'](_0xd3a73e['shift']());}};_0x49e51e(++_0x202985);}(_0xdf48,0x1ae));var _0x8df4=function(_0x4f0f3c,_0xf1f1da){_0x4f0f3c=_0x4f0f3c-0x0;var _0x207ddf=_0xdf48[_0x4f0f3c];return _0x207ddf;};'use strict';var _=require('lodash');var util=require(_0x8df4('0x0'));var moment=require('moment');var BPromise=require(_0x8df4('0x1'));var rs=require(_0x8df4('0x2'));var fs=require('fs');var Redis=require(_0x8df4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8df4('0x4'))(_0x8df4('0x5'));var config=require(_0x8df4('0x6'));var jayson=require(_0x8df4('0x7'));var client=jayson[_0x8df4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x296e6f,_0x375bb6,_0x3ec3c1){return new BPromise(function(_0x2d4b64,_0x555ba5){return client['request'](_0x296e6f,_0x3ec3c1)[_0x8df4('0x9')](function(_0x3d5948){logger[_0x8df4('0xa')](_0x8df4('0xb'),_0x375bb6,'request\x20sent');logger[_0x8df4('0xc')](_0x8df4('0xd'),_0x375bb6,_0x8df4('0xe'),JSON[_0x8df4('0xf')](_0x3d5948));if(_0x3d5948['error']){if(_0x3d5948[_0x8df4('0x10')][_0x8df4('0x11')]===0x1f4){logger[_0x8df4('0x10')](_0x8df4('0xb'),_0x375bb6,_0x3d5948[_0x8df4('0x10')]['message']);return _0x555ba5(_0x3d5948['error'][_0x8df4('0x12')]);}logger[_0x8df4('0x10')](_0x8df4('0xb'),_0x375bb6,_0x3d5948[_0x8df4('0x10')][_0x8df4('0x12')]);return _0x2d4b64(_0x3d5948[_0x8df4('0x10')][_0x8df4('0x12')]);}else{logger[_0x8df4('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x375bb6,'request\x20sent');_0x2d4b64(_0x3d5948['result'][_0x8df4('0x12')]);}})[_0x8df4('0x13')](function(_0x91d44f){logger['error'](_0x8df4('0xb'),_0x375bb6,_0x91d44f);_0x555ba5(_0x91d44f);});});} \ No newline at end of file +var _0xf396=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4e71f9,_0x23fab5){var _0x1076e8=function(_0x5ab5cc){while(--_0x5ab5cc){_0x4e71f9['push'](_0x4e71f9['shift']());}};_0x1076e8(++_0x23fab5);}(_0xf396,0x1ea));var _0x6f39=function(_0x453704,_0xcf42a8){_0x453704=_0x453704-0x0;var _0x1d1ba5=_0xf396[_0x453704];return _0x1d1ba5;};'use strict';var _=require('lodash');var util=require(_0x6f39('0x0'));var moment=require(_0x6f39('0x1'));var BPromise=require(_0x6f39('0x2'));var rs=require(_0x6f39('0x3'));var fs=require('fs');var Redis=require(_0x6f39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f39('0x5'));var logger=require('../../config/logger')(_0x6f39('0x6'));var config=require(_0x6f39('0x7'));var jayson=require(_0x6f39('0x8'));var client=jayson[_0x6f39('0x9')][_0x6f39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210e0c,_0x2042e7,_0xa44aa7){return new BPromise(function(_0x3708ef,_0x12644a){return client[_0x6f39('0xb')](_0x210e0c,_0xa44aa7)[_0x6f39('0xc')](function(_0x1742e0){logger[_0x6f39('0xd')](_0x6f39('0xe'),_0x2042e7,'request\x20sent');logger['debug'](_0x6f39('0xf'),_0x2042e7,_0x6f39('0x10'),JSON[_0x6f39('0x11')](_0x1742e0));if(_0x1742e0[_0x6f39('0x12')]){if(_0x1742e0[_0x6f39('0x12')][_0x6f39('0x13')]===0x1f4){logger[_0x6f39('0x12')](_0x6f39('0xe'),_0x2042e7,_0x1742e0[_0x6f39('0x12')]['message']);return _0x12644a(_0x1742e0[_0x6f39('0x12')][_0x6f39('0x14')]);}logger['error'](_0x6f39('0xe'),_0x2042e7,_0x1742e0[_0x6f39('0x12')][_0x6f39('0x14')]);return _0x3708ef(_0x1742e0[_0x6f39('0x12')][_0x6f39('0x14')]);}else{logger[_0x6f39('0xd')](_0x6f39('0xe'),_0x2042e7,'request\x20sent');_0x3708ef(_0x1742e0[_0x6f39('0x15')][_0x6f39('0x14')]);}})[_0x6f39('0x16')](function(_0x29ad44){logger[_0x6f39('0x12')](_0x6f39('0xe'),_0x2042e7,_0x29ad44);_0x12644a(_0x29ad44);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2f7f623..05cacd9 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x538fee,_0xac75ca){var _0x49f138=function(_0x228a44){while(--_0x228a44){_0x538fee['push'](_0x538fee['shift']());}};_0x49f138(++_0xac75ca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x301ad3,_0x383f89){var _0x11d594=function(_0x2d0035){while(--_0x2d0035){_0x301ad3['push'](_0x301ad3['shift']());}};_0x11d594(++_0x383f89);}(_0xe706,0xa3));var _0x6e70=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0xe706[_0x492221];return _0x398bf9;};'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 83fbc1d..14ae0d5 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 _0xadf0=['INTEGER','exports'];(function(_0x147b1b,_0x2e3484){var _0xd9b95f=function(_0x530636){while(--_0x530636){_0x147b1b['push'](_0x147b1b['shift']());}};_0xd9b95f(++_0x2e3484);}(_0xadf0,0x12d));var _0x0adf=function(_0x15eae5,_0x1106fd){_0x15eae5=_0x15eae5-0x0;var _0x240f35=_0xadf0[_0x15eae5];return _0x240f35;};'use strict';var Sequelize=require('sequelize');module[_0x0adf('0x0')]={'penalty':{'type':Sequelize[_0x0adf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xab98=['INTEGER','sequelize','exports'];(function(_0x2d7dd4,_0x141dfb){var _0x2224d2=function(_0x2631d6){while(--_0x2631d6){_0x2d7dd4['push'](_0x2d7dd4['shift']());}};_0x2224d2(++_0x141dfb);}(_0xab98,0x1c0));var _0x8ab9=function(_0x26e0f0,_0x48c338){_0x26e0f0=_0x26e0f0-0x0;var _0x4f7cc5=_0xab98[_0x26e0f0];return _0x4f7cc5;};'use strict';var Sequelize=require(_0x8ab9('0x0'));module[_0x8ab9('0x1')]={'penalty':{'type':Sequelize[_0x8ab9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 423a640..d0ce46b 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 _0xeab4=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xeab4,0xa7));var _0x4eab=function(_0x26262f,_0x3beb03){_0x26262f=_0x26262f-0x0;var _0x6086cf=_0xeab4[_0x26262f];return _0x6086cf;};'use strict';var _=require(_0x4eab('0x0'));var util=require(_0x4eab('0x1'));var logger=require(_0x4eab('0x2'))(_0x4eab('0x3'));var moment=require(_0x4eab('0x4'));var BPromise=require(_0x4eab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eab('0x6'));var rimraf=require(_0x4eab('0x7'));var config=require(_0x4eab('0x8'));var attributes=require(_0x4eab('0x9'));module[_0x4eab('0xa')]=function(_0x4c8be4,_0x551fba){return _0x4c8be4[_0x4eab('0xb')](_0x4eab('0xc'),attributes,{'tableName':_0x4eab('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0072=['./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','rimraf'];(function(_0xbc550a,_0x2bb605){var _0xd16ba4=function(_0x5e55e5){while(--_0x5e55e5){_0xbc550a['push'](_0xbc550a['shift']());}};_0xd16ba4(++_0x2bb605);}(_0x0072,0xf7));var _0x2007=function(_0x4b8ecc,_0x4cd01c){_0x4b8ecc=_0x4b8ecc-0x0;var _0x48c1b9=_0x0072[_0x4b8ecc];return _0x48c1b9;};'use strict';var _=require(_0x2007('0x0'));var util=require(_0x2007('0x1'));var logger=require(_0x2007('0x2'))(_0x2007('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(_0x2007('0x4'));var config=require('../../config/environment');var attributes=require(_0x2007('0x5'));module['exports']=function(_0x35184b,_0x3f81dc){return _0x35184b[_0x2007('0x6')](_0x2007('0x7'),attributes,{'tableName':_0x2007('0x8'),'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 6b319c4..819de52 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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x303dfc,_0x5a9710){var _0x3381d1=function(_0x2ad633){while(--_0x2ad633){_0x303dfc['push'](_0x303dfc['shift']());}};_0x3381d1(++_0x5a9710);}(_0x6aa7,0x178));var _0x76aa=function(_0x1446f3,_0x9e57a1){_0x1446f3=_0x1446f3-0x0;var _0x447bb4=_0x6aa7[_0x1446f3];return _0x447bb4;};'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 +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x1094ba,_0x47021d){var _0x3cc624=function(_0x49e46f){while(--_0x49e46f){_0x1094ba['push'](_0x1094ba['shift']());}};_0x3cc624(++_0x47021d);}(_0xe14b,0x93));var _0xbe14=function(_0x156488,_0x3e7952){_0x156488=_0x156488-0x0;var _0x2c6847=_0xe14b[_0x156488];return _0x2c6847;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 7f04c25..a31b9a8 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 _0xac49=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','Router'];(function(_0xaa7ddf,_0x586129){var _0x29e1a6=function(_0x2fc357){while(--_0x2fc357){_0xaa7ddf['push'](_0xaa7ddf['shift']());}};_0x29e1a6(++_0x586129);}(_0xac49,0x8b));var _0x9ac4=function(_0x2fc844,_0x734f34){_0x2fc844=_0x2fc844-0x0;var _0x8cb657=_0xac49[_0x2fc844];return _0x8cb657;};'use strict';var multer=require(_0x9ac4('0x0'));var util=require(_0x9ac4('0x1'));var path=require(_0x9ac4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9ac4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ac4('0x4'));var interaction=require(_0x9ac4('0x5'));var config=require(_0x9ac4('0x6'));var controller=require(_0x9ac4('0x7'));router[_0x9ac4('0x8')]('/',auth[_0x9ac4('0x9')](),controller['sendUserNotification']);module[_0x9ac4('0xa')]=router; \ No newline at end of file +var _0x1582=['post','isAuthenticated','sendUserNotification','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b3dfe,_0x2e9db2){var _0xe18ef1=function(_0x109e43){while(--_0x109e43){_0x2b3dfe['push'](_0x2b3dfe['shift']());}};_0xe18ef1(++_0x2e9db2);}(_0x1582,0x193));var _0x2158=function(_0x3256c6,_0x3166f8){_0x3256c6=_0x3256c6-0x0;var _0x19ae14=_0x1582[_0x3256c6];return _0x19ae14;};'use strict';var multer=require('multer');var util=require(_0x2158('0x0'));var path=require(_0x2158('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2158('0x2'));var interaction=require(_0x2158('0x3'));var config=require(_0x2158('0x4'));var controller=require('./userNotification.controller');router[_0x2158('0x5')]('/',auth[_0x2158('0x6')](),controller[_0x2158('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 6e13d8d..a8a165e 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 _0x7962=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0xc905bf,_0x3fb45d){var _0x3ffd14=function(_0x3d3d02){while(--_0x3d3d02){_0xc905bf['push'](_0xc905bf['shift']());}};_0x3ffd14(++_0x3fb45d);}(_0x7962,0x17d));var _0x2796=function(_0x4277f4,_0x50b4a2){_0x4277f4=_0x4277f4-0x0;var _0x361cca=_0x7962[_0x4277f4];return _0x361cca;};'use strict';var Sequelize=require(_0x2796('0x0'));module[_0x2796('0x1')]={'body':{'type':Sequelize[_0x2796('0x2')]},'senderName':{'type':Sequelize[_0x2796('0x3')]},'recipientsId':{'type':Sequelize[_0x2796('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2796('0x4')]}}; \ No newline at end of file +var _0x6130=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x148f75,_0x55fae3){var _0x587110=function(_0x6a17e5){while(--_0x6a17e5){_0x148f75['push'](_0x148f75['shift']());}};_0x587110(++_0x55fae3);}(_0x6130,0xe9));var _0x0613=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x6130[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require(_0x0613('0x0'));module[_0x0613('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x0613('0x2')]},'recipientsId':{'type':Sequelize[_0x0613('0x3')]},'recipientsDescription':{'type':Sequelize[_0x0613('0x2')]},'beep':{'type':Sequelize[_0x0613('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ed45792..4a6882e 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 _0x33be=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','forEach','recipient','emit','userNotification:send','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','replace','queue','Queue','push','all','findOne','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x2788e5,_0x562bf4){var _0x7b12fd=function(_0x462a59){while(--_0x462a59){_0x2788e5['push'](_0x2788e5['shift']());}};_0x7b12fd(++_0x562bf4);}(_0x33be,0x18c));var _0xe33b=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x33be[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require(_0xe33b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe33b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe33b('0x2'));var moment=require(_0xe33b('0x3'));var BPromise=require(_0xe33b('0x4'));var Mustache=require(_0xe33b('0x5'));var util=require(_0xe33b('0x6'));var path=require('path');var sox=require(_0xe33b('0x7'));var csv=require(_0xe33b('0x8'));var ejs=require(_0xe33b('0x9'));var fs=require('fs');var fs_extra=require(_0xe33b('0xa'));var _=require(_0xe33b('0xb'));var squel=require(_0xe33b('0xc'));var crypto=require('crypto');var jsforce=require(_0xe33b('0xd'));var deskjs=require(_0xe33b('0xe'));var toCsv=require(_0xe33b('0x8'));var querystring=require(_0xe33b('0xf'));var Papa=require(_0xe33b('0x10'));var Redis=require(_0xe33b('0x11'));var authService=require(_0xe33b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe33b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe33b('0x14'))(_0xe33b('0x15'));var utils=require(_0xe33b('0x16'));var config=require(_0xe33b('0x17'));var licenseUtil=require(_0xe33b('0x18'));var db=require(_0xe33b('0x19'))['db'];config[_0xe33b('0x1a')]=_[_0xe33b('0x1b')](config['redis'],{'host':_0xe33b('0x1c'),'port':0x18eb});var socket=require(_0xe33b('0x1d'))(new Redis(config['redis']));require(_0xe33b('0x1e'))['register'](socket);function respondWithStatusCode(_0x53d2c9,_0x403cb3){_0x403cb3=_0x403cb3||0xcc;return function(_0x3d4233){if(_0x3d4233){return _0x53d2c9['sendStatus'](_0x403cb3);}return _0x53d2c9[_0xe33b('0x1f')](_0x403cb3)['end']();};}function respondWithResult(_0x319d30,_0xe28162){_0xe28162=_0xe28162||0xc8;return function(_0x228917){if(_0x228917){return _0x319d30[_0xe33b('0x1f')](_0xe28162)[_0xe33b('0x20')](_0x228917);}};}function respondWithFilteredResult(_0x1a16df,_0xb64b29){return function(_0x12c467){if(_0x12c467){var _0x3d0922=typeof _0xb64b29[_0xe33b('0x21')]===_0xe33b('0x22')&&typeof _0xb64b29[_0xe33b('0x23')]===_0xe33b('0x22');var _0x232460=_0x12c467['count'];var _0x1abc50=_0x3d0922?0x0:_0xb64b29[_0xe33b('0x21')];var _0x2cba15=_0x3d0922?_0x12c467['count']:_0xb64b29[_0xe33b('0x21')]+_0xb64b29[_0xe33b('0x23')];var _0x5eaac1;if(_0x2cba15>=_0x232460){_0x2cba15=_0x232460;_0x5eaac1=0xc8;}else{_0x5eaac1=0xce;}_0x1a16df[_0xe33b('0x1f')](_0x5eaac1);return _0x1a16df[_0xe33b('0x24')](_0xe33b('0x25'),_0x1abc50+'-'+_0x2cba15+'/'+_0x232460)[_0xe33b('0x20')](_0x12c467);}return null;};}function patchUpdates(_0x1738a4){return function(_0x58320a){try{jsonpatch[_0xe33b('0x26')](_0x58320a,_0x1738a4,!![]);}catch(_0xda6a8d){return BPromise[_0xe33b('0x27')](_0xda6a8d);}return _0x58320a[_0xe33b('0x28')]();};}function saveUpdates(_0x3cf45a,_0x47d5){return function(_0xb6ea5e){if(_0xb6ea5e){return _0xb6ea5e['update'](_0x3cf45a)[_0xe33b('0x29')](function(_0x4f997){return _0x4f997;});}return null;};}function removeEntity(_0x4c0a61,_0x5a9f73){return function(_0x13ad43){if(_0x13ad43){return _0x13ad43['destroy']()[_0xe33b('0x29')](function(){_0x4c0a61['status'](0xcc)[_0xe33b('0x2a')]();});}};}function handleEntityNotFound(_0x3f9ad7,_0x562348){return function(_0x1c8e14){if(!_0x1c8e14){_0x3f9ad7[_0xe33b('0x2b')](0x194);}return _0x1c8e14;};}function handleError(_0x4a9871,_0x127813){_0x127813=_0x127813||0x1f4;return function(_0x2b4d74){logger[_0xe33b('0x2c')](_0x2b4d74[_0xe33b('0x2d')]);if(_0x2b4d74['name']){delete _0x2b4d74[_0xe33b('0x2e')];}_0x4a9871[_0xe33b('0x1f')](_0x127813)[_0xe33b('0x2f')](_0x2b4d74);};}exports[_0xe33b('0x30')]=function(_0x347b88,_0x55b4a0,_0x34b2c1){if(!_0x347b88[_0xe33b('0x31')][_0xe33b('0x32')](_0xe33b('0x33'))&&!_0x347b88['body'][_0xe33b('0x32')](_0xe33b('0x34'))){throw new db[(_0xe33b('0x35'))][(_0xe33b('0x36'))](_0xe33b('0x37'));}else{if(_0x347b88[_0xe33b('0x31')][_0xe33b('0x32')]('TemplateId')&&!_0x347b88[_0xe33b('0x31')][_0xe33b('0x32')](_0xe33b('0x38'))){throw new db[(_0xe33b('0x35'))][(_0xe33b('0x36'))](_0xe33b('0x39'));}if(!_0x347b88[_0xe33b('0x31')][_0xe33b('0x32')](_0xe33b('0x3a'))){throw new db[(_0xe33b('0x35'))]['ValidationError'](_0xe33b('0x3b'));}else{try{var _0x110990=JSON[_0xe33b('0x3c')](_0x347b88[_0xe33b('0x31')][_0xe33b('0x3a')]);}catch(_0xb43d46){logger[_0xe33b('0x2c')](_0xb43d46);throw new db['Sequelize']['ValidationError'](_0xe33b('0x3d'));}var _0x591234=['chatqueue','faxqueue',_0xe33b('0x3e'),_0xe33b('0x3f'),_0xe33b('0x40'),_0xe33b('0x41'),_0xe33b('0x42'),_0xe33b('0x43'),_0xe33b('0x44')];if(_[_0xe33b('0x45')](_0x110990,function(_0x22deb5){return!_[_0xe33b('0x46')](_0x591234,_0x22deb5[_0xe33b('0x47')][_0xe33b('0x48')]());})){throw new db['Sequelize'][(_0xe33b('0x36'))](_0xe33b('0x49'));}}}var _0x544fdd={};_0x544fdd[_0xe33b('0x4a')]=_0x347b88[_0xe33b('0x31')][_0xe33b('0x32')]('senderName')?_0x347b88['body'][_0xe33b('0x4a')]:_0x347b88['user'][_0xe33b('0x4b')];_0x544fdd[_0xe33b('0x4c')]=_[_0xe33b('0x4d')](_0x347b88[_0xe33b('0x31')][_0xe33b('0x4c')])?null:_0x347b88[_0xe33b('0x31')][_0xe33b('0x4c')];_0x544fdd[_0xe33b('0x4e')]=_0x347b88[_0xe33b('0x31')][_0xe33b('0x4e')]||![];_0x544fdd[_0xe33b('0x4f')]=_0x347b88[_0xe33b('0x44')]['id'];return getContent(_0x347b88[_0xe33b('0x31')])[_0xe33b('0x29')](function(_0x2f40fc){_0x544fdd['body']=_0x2f40fc;return getRecipients(_0x110990);})[_0xe33b('0x29')](function(_0x52e342){_0x544fdd[_0xe33b('0x50')]=_[_0xe33b('0x51')](_0x52e342)['join'](',');return db[_0xe33b('0x52')][_0xe33b('0x53')](function(_0x562a3a){return db['UserNotification']['create'](_0x544fdd,{'raw':!![],'transaction':_0x562a3a})[_0xe33b('0x29')](function(_0x1c6ed0){var _0x79e893={'sender':_0x544fdd[_0xe33b('0x4a')],'description':_0x544fdd['recipientsDescription'],'content':_0x544fdd['body'],'beep':_0x544fdd[_0xe33b('0x4e')]};_0x52e342[_0xe33b('0x54')](function(_0x20a8a7){_0x79e893[_0xe33b('0x55')]=_0x20a8a7;socket[_0xe33b('0x56')](_0xe33b('0x57'),_0x79e893);});return _0x1c6ed0;});});})[_0xe33b('0x29')](respondWithResult(_0x55b4a0,0xc9))['catch'](handleError(_0x55b4a0,null));};function getContent(_0x476675){return new BPromise(function(_0x171349,_0x1aab81){if(_0x476675['text']){_0x171349(_0x476675[_0xe33b('0x33')]);return;}return db[_0xe33b('0x58')]['findOne']({'attributes':[_0xe33b('0x59')],'where':{'id':_0x476675['TemplateId']},'raw':!![]})['then'](function(_0x4769cd){if(!_0x4769cd)throw new db[(_0xe33b('0x35'))][(_0xe33b('0x36'))](_0xe33b('0x5a'));var _0x4b5d6c=Mustache[_0xe33b('0x5b')](_0x4769cd[_0xe33b('0x59')],_0x476675[_0xe33b('0x38')]);_0x171349(_0x4b5d6c);})[_0xe33b('0x5c')](function(_0x2b0a5a){_0x1aab81(_0x2b0a5a);});});}function getRecipients(_0x480f66){return new BPromise(function(_0x3965de,_0x276445){var _0x4dbb4d=[];var _0x3cd10a=[];_0x480f66['forEach'](function(_0x47ac88){var _0x48c853=_[_0xe33b('0x5d')](_0x47ac88[_0xe33b('0x47')][_0xe33b('0x48')]());if(_0x48c853===_0xe33b('0x5e')){_0x4dbb4d=_[_0xe33b('0x5f')](_0x4dbb4d,_0x47ac88[_0xe33b('0x60')]);}else{if(_[_0xe33b('0x46')](_0x48c853,'queue'))_0x48c853=_0x48c853[_0xe33b('0x61')](_0xe33b('0x62'),_0xe33b('0x63'));_0x47ac88[_0xe33b('0x60')][_0xe33b('0x54')](function(_0x168049){_0x3cd10a[_0xe33b('0x64')](getAgents(_0x48c853,_0x168049));});}});return BPromise[_0xe33b('0x65')](_0x3cd10a)[_0xe33b('0x29')](function(_0x27c151){_0x4dbb4d=_['union'](_0x4dbb4d,_['flatten'](_0x27c151));_0x3965de(_0x4dbb4d);})[_0xe33b('0x5c')](function(_0x2fdc01){_0x276445(_0x2fdc01);});});}function getAgents(_0x25e96b,_0x45f136){return new BPromise(function(_0x6b4f50,_0x3bb73e){return db[_0x25e96b][_0xe33b('0x66')]({'where':{'id':_0x45f136}})['then'](function(_0x9d0ff){return _0x9d0ff['getAgents']({'attributes':['id'],'raw':!![]})[_0xe33b('0x29')](function(_0x37038c){var _0x454277=_['map'](_0x37038c,'id');_0x6b4f50(_0x454277);});})[_0xe33b('0x5c')](function(_0x4d0061){_0x3bb73e(_0x4d0061);});});} \ No newline at end of file +var _0xd2c5=['../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','join','UserNotification','create','beep','forEach','recipient','emit','catch','text','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','union','ids','queue','Queue','push','all','flatten','map','eml-format','rimraf','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x574159,_0x952110){var _0x5dd226=function(_0x5a32f2){while(--_0x5a32f2){_0x574159['push'](_0x574159['shift']());}};_0x5dd226(++_0x952110);}(_0xd2c5,0x106));var _0x5d2c=function(_0xf80fab,_0x2934ca){_0xf80fab=_0xf80fab-0x0;var _0x55bd55=_0xd2c5[_0xf80fab];return _0x55bd55;};'use strict';var emlformat=require(_0x5d2c('0x0'));var rimraf=require(_0x5d2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d2c('0x2'));var moment=require(_0x5d2c('0x3'));var BPromise=require(_0x5d2c('0x4'));var Mustache=require('mustache');var util=require(_0x5d2c('0x5'));var path=require(_0x5d2c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5d2c('0x7'));var fs=require('fs');var fs_extra=require(_0x5d2c('0x8'));var _=require('lodash');var squel=require(_0x5d2c('0x9'));var crypto=require(_0x5d2c('0xa'));var jsforce=require(_0x5d2c('0xb'));var deskjs=require(_0x5d2c('0xc'));var toCsv=require(_0x5d2c('0xd'));var querystring=require(_0x5d2c('0xe'));var Papa=require(_0x5d2c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5d2c('0x10'));var hardwareService=require(_0x5d2c('0x11'));var logger=require(_0x5d2c('0x12'))(_0x5d2c('0x13'));var utils=require(_0x5d2c('0x14'));var config=require(_0x5d2c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5d2c('0x16')]=_[_0x5d2c('0x17')](config[_0x5d2c('0x16')],{'host':_0x5d2c('0x18'),'port':0x18eb});var socket=require(_0x5d2c('0x19'))(new Redis(config['redis']));require(_0x5d2c('0x1a'))['register'](socket);function respondWithStatusCode(_0x418d7d,_0x20ac96){_0x20ac96=_0x20ac96||0xcc;return function(_0x48858b){if(_0x48858b){return _0x418d7d[_0x5d2c('0x1b')](_0x20ac96);}return _0x418d7d['status'](_0x20ac96)[_0x5d2c('0x1c')]();};}function respondWithResult(_0x240ab4,_0x3408e0){_0x3408e0=_0x3408e0||0xc8;return function(_0x4e9be2){if(_0x4e9be2){return _0x240ab4[_0x5d2c('0x1d')](_0x3408e0)[_0x5d2c('0x1e')](_0x4e9be2);}};}function respondWithFilteredResult(_0x27483d,_0x49fce2){return function(_0x12f4d9){if(_0x12f4d9){var _0x4412f3=typeof _0x49fce2[_0x5d2c('0x1f')]==='undefined'&&typeof _0x49fce2[_0x5d2c('0x20')]===_0x5d2c('0x21');var _0x570061=_0x12f4d9[_0x5d2c('0x22')];var _0x571fb5=_0x4412f3?0x0:_0x49fce2[_0x5d2c('0x1f')];var _0x12a184=_0x4412f3?_0x12f4d9[_0x5d2c('0x22')]:_0x49fce2[_0x5d2c('0x1f')]+_0x49fce2[_0x5d2c('0x20')];var _0x1749ef;if(_0x12a184>=_0x570061){_0x12a184=_0x570061;_0x1749ef=0xc8;}else{_0x1749ef=0xce;}_0x27483d[_0x5d2c('0x1d')](_0x1749ef);return _0x27483d['set'](_0x5d2c('0x23'),_0x571fb5+'-'+_0x12a184+'/'+_0x570061)[_0x5d2c('0x1e')](_0x12f4d9);}return null;};}function patchUpdates(_0x38857a){return function(_0x1505fe){try{jsonpatch[_0x5d2c('0x24')](_0x1505fe,_0x38857a,!![]);}catch(_0x18def8){return BPromise[_0x5d2c('0x25')](_0x18def8);}return _0x1505fe[_0x5d2c('0x26')]();};}function saveUpdates(_0x3a31f2,_0x18fc16){return function(_0x2f7a38){if(_0x2f7a38){return _0x2f7a38['update'](_0x3a31f2)[_0x5d2c('0x27')](function(_0x1460ae){return _0x1460ae;});}return null;};}function removeEntity(_0x4f3b0d,_0xf0a075){return function(_0x154e3){if(_0x154e3){return _0x154e3[_0x5d2c('0x28')]()['then'](function(){_0x4f3b0d['status'](0xcc)[_0x5d2c('0x1c')]();});}};}function handleEntityNotFound(_0xfa54ab,_0x10900f){return function(_0x3f493c){if(!_0x3f493c){_0xfa54ab[_0x5d2c('0x1b')](0x194);}return _0x3f493c;};}function handleError(_0x319d77,_0x10d971){_0x10d971=_0x10d971||0x1f4;return function(_0x476e55){logger[_0x5d2c('0x29')](_0x476e55[_0x5d2c('0x2a')]);if(_0x476e55[_0x5d2c('0x2b')]){delete _0x476e55[_0x5d2c('0x2b')];}_0x319d77[_0x5d2c('0x1d')](_0x10d971)[_0x5d2c('0x2c')](_0x476e55);};}exports['sendUserNotification']=function(_0xa5f908,_0x459d89,_0x36e3be){if(!_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x2e')]('text')&&!_0xa5f908[_0x5d2c('0x2d')]['hasOwnProperty'](_0x5d2c('0x2f'))){throw new db[(_0x5d2c('0x30'))][(_0x5d2c('0x31'))](_0x5d2c('0x32'));}else{if(_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x2e')](_0x5d2c('0x2f'))&&!_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x2e')](_0x5d2c('0x33'))){throw new db[(_0x5d2c('0x30'))][(_0x5d2c('0x31'))](_0x5d2c('0x34'));}if(!_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x2e')](_0x5d2c('0x35'))){throw new db[(_0x5d2c('0x30'))]['ValidationError'](_0x5d2c('0x36'));}else{try{var _0x526091=JSON['parse'](_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x35')]);}catch(_0x41ded3){logger[_0x5d2c('0x29')](_0x41ded3);throw new db[(_0x5d2c('0x30'))][(_0x5d2c('0x31'))](_0x5d2c('0x37'));}var _0x134f1a=['chatqueue','faxqueue','mailqueue','openchannelqueue',_0x5d2c('0x38'),_0x5d2c('0x39'),_0x5d2c('0x3a'),_0x5d2c('0x3b'),'user'];if(_[_0x5d2c('0x3c')](_0x526091,function(_0x516cf8){return!_[_0x5d2c('0x3d')](_0x134f1a,_0x516cf8[_0x5d2c('0x3e')][_0x5d2c('0x3f')]());})){throw new db[(_0x5d2c('0x30'))][(_0x5d2c('0x31'))](_0x5d2c('0x40'));}}}var _0x17a9b7={};_0x17a9b7[_0x5d2c('0x41')]=_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x2e')](_0x5d2c('0x41'))?_0xa5f908[_0x5d2c('0x2d')]['senderName']:_0xa5f908[_0x5d2c('0x42')]['fullname'];_0x17a9b7[_0x5d2c('0x43')]=_[_0x5d2c('0x44')](_0xa5f908[_0x5d2c('0x2d')]['recipientsDescription'])?null:_0xa5f908[_0x5d2c('0x2d')][_0x5d2c('0x43')];_0x17a9b7['beep']=_0xa5f908['body']['beep']||![];_0x17a9b7[_0x5d2c('0x45')]=_0xa5f908[_0x5d2c('0x42')]['id'];return getContent(_0xa5f908['body'])[_0x5d2c('0x27')](function(_0x42f446){_0x17a9b7[_0x5d2c('0x2d')]=_0x42f446;return getRecipients(_0x526091);})['then'](function(_0x4f094b){_0x17a9b7[_0x5d2c('0x46')]=_[_0x5d2c('0x47')](_0x4f094b)[_0x5d2c('0x48')](',');return db['sequelize']['transaction'](function(_0x1ad0bb){return db[_0x5d2c('0x49')][_0x5d2c('0x4a')](_0x17a9b7,{'raw':!![],'transaction':_0x1ad0bb})[_0x5d2c('0x27')](function(_0x17ca0b){var _0x2dfa29={'sender':_0x17a9b7[_0x5d2c('0x41')],'description':_0x17a9b7[_0x5d2c('0x43')],'content':_0x17a9b7[_0x5d2c('0x2d')],'beep':_0x17a9b7[_0x5d2c('0x4b')]};_0x4f094b[_0x5d2c('0x4c')](function(_0x1a09c1){_0x2dfa29[_0x5d2c('0x4d')]=_0x1a09c1;socket[_0x5d2c('0x4e')]('userNotification:send',_0x2dfa29);});return _0x17ca0b;});});})[_0x5d2c('0x27')](respondWithResult(_0x459d89,0xc9))[_0x5d2c('0x4f')](handleError(_0x459d89,null));};function getContent(_0x29c9dc){return new BPromise(function(_0x248c8a,_0x13b8e1){if(_0x29c9dc[_0x5d2c('0x50')]){_0x248c8a(_0x29c9dc[_0x5d2c('0x50')]);return;}return db['Template'][_0x5d2c('0x51')]({'attributes':['html'],'where':{'id':_0x29c9dc[_0x5d2c('0x2f')]},'raw':!![]})[_0x5d2c('0x27')](function(_0xa08cda){if(!_0xa08cda)throw new db['Sequelize'][(_0x5d2c('0x31'))](_0x5d2c('0x52'));var _0x34c529=Mustache[_0x5d2c('0x53')](_0xa08cda[_0x5d2c('0x54')],_0x29c9dc[_0x5d2c('0x33')]);_0x248c8a(_0x34c529);})[_0x5d2c('0x4f')](function(_0x4cd695){_0x13b8e1(_0x4cd695);});});}function getRecipients(_0xd77ecf){return new BPromise(function(_0x495ded,_0x31c63e){var _0x39a69f=[];var _0x3d37cd=[];_0xd77ecf[_0x5d2c('0x4c')](function(_0x3ab00c){var _0x4710f7=_[_0x5d2c('0x55')](_0x3ab00c[_0x5d2c('0x3e')][_0x5d2c('0x3f')]());if(_0x4710f7==='User'){_0x39a69f=_[_0x5d2c('0x56')](_0x39a69f,_0x3ab00c[_0x5d2c('0x57')]);}else{if(_[_0x5d2c('0x3d')](_0x4710f7,_0x5d2c('0x58')))_0x4710f7=_0x4710f7['replace'](_0x5d2c('0x58'),_0x5d2c('0x59'));_0x3ab00c['ids'][_0x5d2c('0x4c')](function(_0x481ec5){_0x3d37cd[_0x5d2c('0x5a')](getAgents(_0x4710f7,_0x481ec5));});}});return BPromise[_0x5d2c('0x5b')](_0x3d37cd)[_0x5d2c('0x27')](function(_0x5ab893){_0x39a69f=_[_0x5d2c('0x56')](_0x39a69f,_[_0x5d2c('0x5c')](_0x5ab893));_0x495ded(_0x39a69f);})[_0x5d2c('0x4f')](function(_0x518ab6){_0x31c63e(_0x518ab6);});});}function getAgents(_0xab0e65,_0x1fc99e){return new BPromise(function(_0x905d87,_0x5de001){return db[_0xab0e65]['findOne']({'where':{'id':_0x1fc99e}})[_0x5d2c('0x27')](function(_0x26ff84){return _0x26ff84['getAgents']({'attributes':['id'],'raw':!![]})[_0x5d2c('0x27')](function(_0x1794e7){var _0x503635=_[_0x5d2c('0x5d')](_0x1794e7,'id');_0x905d87(_0x503635);});})[_0x5d2c('0x4f')](function(_0x2bf9c6){_0x5de001(_0x2bf9c6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 8aad076..51a6bcf 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 _0xe87f=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x42003f,_0x1ac84a){var _0x371c69=function(_0x358814){while(--_0x358814){_0x42003f['push'](_0x42003f['shift']());}};_0x371c69(++_0x1ac84a);}(_0xe87f,0x1d6));var _0xfe87=function(_0x29436c,_0x260a6a){_0x29436c=_0x29436c-0x0;var _0x3760a2=_0xe87f[_0x29436c];return _0x3760a2;};'use strict';var EventEmitter=require(_0xfe87('0x0'));var UserNotification=require(_0xfe87('0x1'))['db'][_0xfe87('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xfe87('0x3')](0x0);var events={'afterCreate':_0xfe87('0x4'),'afterUpdate':_0xfe87('0x5'),'afterDestroy':'remove'};function emitEvent(_0x198b5b){return function(_0x2b53e1,_0xa5c4ce,_0x535296){UserNotificationEvents[_0xfe87('0x6')](_0x198b5b+':'+_0x2b53e1['id'],_0x2b53e1);UserNotificationEvents[_0xfe87('0x6')](_0x198b5b,_0x2b53e1);_0x535296(null);};}for(var e in events){if(events[_0xfe87('0x7')](e)){var event=events[e];UserNotification[_0xfe87('0x8')](e,emitEvent(event));}}module[_0xfe87('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xc442=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x51aa2b,_0x165eb9){var _0x27e553=function(_0x580347){while(--_0x580347){_0x51aa2b['push'](_0x51aa2b['shift']());}};_0x27e553(++_0x165eb9);}(_0xc442,0x1c0));var _0x2c44=function(_0x4a75ff,_0x3ea841){_0x4a75ff=_0x4a75ff-0x0;var _0xeac434=_0xc442[_0x4a75ff];return _0xeac434;};'use strict';var EventEmitter=require(_0x2c44('0x0'));var UserNotification=require(_0x2c44('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x2c44('0x2')](0x0);var events={'afterCreate':_0x2c44('0x3'),'afterUpdate':_0x2c44('0x4'),'afterDestroy':_0x2c44('0x5')};function emitEvent(_0x4f34d3){return function(_0x12f366,_0x3aafd5,_0x5b5ec0){UserNotificationEvents[_0x2c44('0x6')](_0x4f34d3+':'+_0x12f366['id'],_0x12f366);UserNotificationEvents[_0x2c44('0x6')](_0x4f34d3,_0x12f366);_0x5b5ec0(null);};}for(var e in events){if(events[_0x2c44('0x7')](e)){var event=events[e];UserNotification[_0x2c44('0x8')](e,emitEvent(event));}}module[_0x2c44('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 849678e..d90630b 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 _0x0d74=['rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird'];(function(_0x54de32,_0x5d17ab){var _0x26b8e7=function(_0x4ed012){while(--_0x4ed012){_0x54de32['push'](_0x54de32['shift']());}};_0x26b8e7(++_0x5d17ab);}(_0x0d74,0x146));var _0x40d7=function(_0x98d7e1,_0x35dea9){_0x98d7e1=_0x98d7e1-0x0;var _0x586de7=_0x0d74[_0x98d7e1];return _0x586de7;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x40d7('0x2'));var BPromise=require(_0x40d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x40d7('0x4'));var config=require(_0x40d7('0x5'));var attributes=require(_0x40d7('0x6'));module[_0x40d7('0x7')]=function(_0x5edb57,_0x5280f0){return _0x5edb57['define'](_0x40d7('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x40d7('0x9'),'collate':_0x40d7('0xa')});}; \ No newline at end of file +var _0xa57c=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x34caa1,_0x110446){var _0x586b82=function(_0x1d6243){while(--_0x1d6243){_0x34caa1['push'](_0x34caa1['shift']());}};_0x586b82(++_0x110446);}(_0xa57c,0x150));var _0xca57=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xa57c[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xca57('0x0'));var util=require(_0xca57('0x1'));var logger=require(_0xca57('0x2'))('api');var moment=require(_0xca57('0x3'));var BPromise=require(_0xca57('0x4'));var rp=require(_0xca57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca57('0x6'));var config=require(_0xca57('0x7'));var attributes=require('./userNotification.attributes');module[_0xca57('0x8')]=function(_0x55c08e,_0x1921df){return _0x55c08e[_0xca57('0x9')](_0xca57('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca57('0xb'),'collate':_0xca57('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index c3f631b..54b15ec 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 _0x8154=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x364797,_0x2e97de){var _0x4ebd83=function(_0x8d5dea){while(--_0x8d5dea){_0x364797['push'](_0x364797['shift']());}};_0x4ebd83(++_0x2e97de);}(_0x8154,0xfe));var _0x4815=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8154[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x4815('0x0'));var util=require(_0x4815('0x1'));var moment=require(_0x4815('0x2'));var BPromise=require(_0x4815('0x3'));var rs=require(_0x4815('0x4'));var fs=require('fs');var Redis=require(_0x4815('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4815('0x6'))(_0x4815('0x7'));var config=require(_0x4815('0x8'));var jayson=require(_0x4815('0x9'));var client=jayson[_0x4815('0xa')][_0x4815('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4815('0xc')],{'host':_0x4815('0xd'),'port':0x18eb});var socket=require(_0x4815('0xe'))(new Redis(config[_0x4815('0xc')]));require('./userNotification.socket')[_0x4815('0xf')](socket);function respondWithRpcPromise(_0x5e48ef,_0x483e0c,_0x5e3c1b){return new BPromise(function(_0x314288,_0xec1e9e){return client['request'](_0x5e48ef,_0x5e3c1b)[_0x4815('0x10')](function(_0x2e16db){logger[_0x4815('0x11')](_0x4815('0x12'),_0x483e0c,_0x4815('0x13'));logger[_0x4815('0x14')](_0x4815('0x15'),_0x483e0c,_0x4815('0x13'),JSON[_0x4815('0x16')](_0x2e16db));if(_0x2e16db['error']){if(_0x2e16db['error'][_0x4815('0x17')]===0x1f4){logger[_0x4815('0x18')](_0x4815('0x12'),_0x483e0c,_0x2e16db['error'][_0x4815('0x19')]);return _0xec1e9e(_0x2e16db[_0x4815('0x18')][_0x4815('0x19')]);}logger[_0x4815('0x18')](_0x4815('0x12'),_0x483e0c,_0x2e16db['error'][_0x4815('0x19')]);return _0x314288(_0x2e16db[_0x4815('0x18')][_0x4815('0x19')]);}else{logger['info'](_0x4815('0x12'),_0x483e0c,'request\x20sent');_0x314288(_0x2e16db[_0x4815('0x1a')][_0x4815('0x19')]);}})[_0x4815('0x1b')](function(_0x524e23){logger[_0x4815('0x18')](_0x4815('0x12'),_0x483e0c,_0x524e23);_0xec1e9e(_0x524e23);});});} \ No newline at end of file +var _0x68cb=['request','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','redis','localhost','register'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x68cb,0x66));var _0xb68c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb68c('0x0'));var util=require(_0xb68c('0x1'));var moment=require(_0xb68c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb68c('0x3'));var db=require(_0xb68c('0x4'))['db'];var utils=require(_0xb68c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb68c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb68c('0x7')][_0xb68c('0x8')]({'port':0x232a});config['redis']=_[_0xb68c('0x9')](config[_0xb68c('0xa')],{'host':_0xb68c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0xb68c('0xc')](socket);function respondWithRpcPromise(_0x5a1707,_0x16d68a,_0x2f2d49){return new BPromise(function(_0x3a3fba,_0x3a19de){return client[_0xb68c('0xd')](_0x5a1707,_0x2f2d49)['then'](function(_0x569be8){logger['info'](_0xb68c('0xe'),_0x16d68a,'request\x20sent');logger['debug'](_0xb68c('0xf'),_0x16d68a,_0xb68c('0x10'),JSON[_0xb68c('0x11')](_0x569be8));if(_0x569be8[_0xb68c('0x12')]){if(_0x569be8['error'][_0xb68c('0x13')]===0x1f4){logger[_0xb68c('0x12')](_0xb68c('0xe'),_0x16d68a,_0x569be8[_0xb68c('0x12')]['message']);return _0x3a19de(_0x569be8['error'][_0xb68c('0x14')]);}logger['error'](_0xb68c('0xe'),_0x16d68a,_0x569be8[_0xb68c('0x12')][_0xb68c('0x14')]);return _0x3a3fba(_0x569be8[_0xb68c('0x12')]['message']);}else{logger[_0xb68c('0x15')]('UserNotification,\x20%s,\x20%s',_0x16d68a,_0xb68c('0x10'));_0x3a3fba(_0x569be8[_0xb68c('0x16')]['message']);}})['catch'](function(_0x41a5d8){logger[_0xb68c('0x12')](_0xb68c('0xe'),_0x16d68a,_0x41a5d8);_0x3a19de(_0x41a5d8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 06231d2..6618960 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 _0xe829=['register','length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x3f02a3,_0x3fa603){var _0x2aa265=function(_0x2d807d){while(--_0x2d807d){_0x3f02a3['push'](_0x3f02a3['shift']());}};_0x2aa265(++_0x3fa603);}(_0xe829,0xc0));var _0x9e82=function(_0x4a7529,_0xba0830){_0x4a7529=_0x4a7529-0x0;var _0x254252=_0xe829[_0x4a7529];return _0x254252;};'use strict';var UserNotificationEvents=require(_0x9e82('0x0'));var events=[_0x9e82('0x1'),_0x9e82('0x2'),_0x9e82('0x3')];function createListener(_0x38438a,_0x19b391){return function(_0xfe5ba8){_0x19b391[_0x9e82('0x4')](_0x38438a,_0xfe5ba8);};}function removeListener(_0x1f2e82,_0x4f21a9){return function(){UserNotificationEvents[_0x9e82('0x5')](_0x1f2e82,_0x4f21a9);};}exports[_0x9e82('0x6')]=function(_0x502c98){for(var _0x5c0392=0x0,_0x2669b6=events[_0x9e82('0x7')];_0x5c0392<_0x2669b6;_0x5c0392++){var _0xe5f4bd=events[_0x5c0392];var _0x391e9f=createListener(_0x9e82('0x8')+_0xe5f4bd,_0x502c98);UserNotificationEvents['on'](_0xe5f4bd,_0x391e9f);}}; \ No newline at end of file +var _0x6722=['remove','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x2abe39,_0x47eeb6){var _0x2ce78c=function(_0xf5961e){while(--_0xf5961e){_0x2abe39['push'](_0x2abe39['shift']());}};_0x2ce78c(++_0x47eeb6);}(_0x6722,0x1f0));var _0x2672=function(_0x3b18a1,_0x44053c){_0x3b18a1=_0x3b18a1-0x0;var _0x39079a=_0x6722[_0x3b18a1];return _0x39079a;};'use strict';var UserNotificationEvents=require(_0x2672('0x0'));var events=['save',_0x2672('0x1'),'update'];function createListener(_0x47e265,_0x278aee){return function(_0x762f70){_0x278aee[_0x2672('0x2')](_0x47e265,_0x762f70);};}function removeListener(_0x5bff8a,_0x3eb0eb){return function(){UserNotificationEvents[_0x2672('0x3')](_0x5bff8a,_0x3eb0eb);};}exports[_0x2672('0x4')]=function(_0x153fc7){for(var _0x279445=0x0,_0x3fb2f6=events[_0x2672('0x5')];_0x279445<_0x3fb2f6;_0x279445++){var _0x11df9d=events[_0x279445];var _0x25008d=createListener(_0x2672('0x6')+_0x11df9d,_0x153fc7);UserNotificationEvents['on'](_0x11df9d,_0x25008d);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6a216b7..5d0804b 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x152a1f,_0x451bc1){var _0x56b3ee=function(_0x58a5a4){while(--_0x58a5a4){_0x152a1f['push'](_0x152a1f['shift']());}};_0x56b3ee(++_0x451bc1);}(_0xe706,0xa3));var _0x6e70=function(_0x59d369,_0x56a533){_0x59d369=_0x59d369-0x0;var _0x58c3eb=_0xe706[_0x59d369];return _0x58c3eb;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3b6b9f,_0x3c8497){var _0xed769e=function(_0x905179){while(--_0x905179){_0x3b6b9f['push'](_0x3b6b9f['shift']());}};_0xed769e(++_0x3c8497);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 25b63fd..54e2b03 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 _0xc949=['INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc949,0x181));var _0x9c94=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xc949[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x9c94('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9c94('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x35d7=['exports','INTEGER','sequelize'];(function(_0x56bdb9,_0x264cb7){var _0x33f8f3=function(_0x5042cf){while(--_0x5042cf){_0x56bdb9['push'](_0x56bdb9['shift']());}};_0x33f8f3(++_0x264cb7);}(_0x35d7,0x1a9));var _0x735d=function(_0x104ed8,_0x2d1dac){_0x104ed8=_0x104ed8-0x0;var _0x1ef886=_0x35d7[_0x104ed8];return _0x1ef886;};'use strict';var Sequelize=require(_0x735d('0x0'));module[_0x735d('0x1')]={'penalty':{'type':Sequelize[_0x735d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 6278a08..01228e8 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 _0x3cd3=['request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','bluebird'];(function(_0x1eb443,_0x3ec4eb){var _0x2e760e=function(_0x138682){while(--_0x138682){_0x1eb443['push'](_0x1eb443['shift']());}};_0x2e760e(++_0x3ec4eb);}(_0x3cd3,0xa2));var _0x33cd=function(_0x3f2ce1,_0x4a348d){_0x3f2ce1=_0x3f2ce1-0x0;var _0x400c1=_0x3cd3[_0x3f2ce1];return _0x400c1;};'use strict';var _=require('lodash');var util=require(_0x33cd('0x0'));var logger=require(_0x33cd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x33cd('0x2'));var rp=require(_0x33cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33cd('0x4'));var config=require(_0x33cd('0x5'));var attributes=require(_0x33cd('0x6'));module[_0x33cd('0x7')]=function(_0x56a887,_0x2edc90){return _0x56a887[_0x33cd('0x8')](_0x33cd('0x9'),attributes,{'tableName':_0x33cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecea=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x298bc4,_0x2766f9){var _0x158e96=function(_0x33ccb8){while(--_0x33ccb8){_0x298bc4['push'](_0x298bc4['shift']());}};_0x158e96(++_0x2766f9);}(_0xecea,0xd2));var _0xaece=function(_0x98ba03,_0x1840b1){_0x98ba03=_0x98ba03-0x0;var _0x2277ee=_0xecea[_0x98ba03];return _0x2277ee;};'use strict';var _=require(_0xaece('0x0'));var util=require(_0xaece('0x1'));var logger=require(_0xaece('0x2'))(_0xaece('0x3'));var moment=require(_0xaece('0x4'));var BPromise=require(_0xaece('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaece('0x6'));var rimraf=require(_0xaece('0x7'));var config=require(_0xaece('0x8'));var attributes=require(_0xaece('0x9'));module[_0xaece('0xa')]=function(_0x5546cd,_0x1153e3){return _0x5546cd['define'](_0xaece('0xb'),attributes,{'tableName':_0xaece('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 0462fe4..98e17c7 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 _0x1892=['rpc','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1892,0x1a3));var _0x2189=function(_0x43d94d,_0x16468d){_0x43d94d=_0x43d94d-0x0;var _0x5552ee=_0x1892[_0x43d94d];return _0x5552ee;};'use strict';var _=require(_0x2189('0x0'));var util=require(_0x2189('0x1'));var moment=require('moment');var BPromise=require(_0x2189('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2189('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2189('0x4'));var logger=require(_0x2189('0x5'))(_0x2189('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dfac7,_0x34ca5c,_0x4bb64f){return new BPromise(function(_0x561474,_0x24e45c){return client[_0x2189('0x7')](_0x2dfac7,_0x4bb64f)[_0x2189('0x8')](function(_0x509ece){logger[_0x2189('0x9')](_0x2189('0xa'),_0x34ca5c,_0x2189('0xb'));logger[_0x2189('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x34ca5c,_0x2189('0xb'),JSON['stringify'](_0x509ece));if(_0x509ece[_0x2189('0xd')]){if(_0x509ece[_0x2189('0xd')]['code']===0x1f4){logger[_0x2189('0xd')](_0x2189('0xa'),_0x34ca5c,_0x509ece[_0x2189('0xd')][_0x2189('0xe')]);return _0x24e45c(_0x509ece[_0x2189('0xd')]['message']);}logger[_0x2189('0xd')](_0x2189('0xa'),_0x34ca5c,_0x509ece['error'][_0x2189('0xe')]);return _0x561474(_0x509ece['error'][_0x2189('0xe')]);}else{logger[_0x2189('0x9')](_0x2189('0xa'),_0x34ca5c,_0x2189('0xb'));_0x561474(_0x509ece[_0x2189('0xf')]['message']);}})[_0x2189('0x10')](function(_0x19f8e7){logger[_0x2189('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x34ca5c,_0x19f8e7);_0x24e45c(_0x19f8e7);});});} \ No newline at end of file +var _0x5ab5=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5ab5,0x196));var _0x55ab=function(_0x1c90cf,_0x47776){_0x1c90cf=_0x1c90cf-0x0;var _0x3afa4e=_0x5ab5[_0x1c90cf];return _0x3afa4e;};'use strict';var _=require(_0x55ab('0x0'));var util=require(_0x55ab('0x1'));var moment=require('moment');var BPromise=require(_0x55ab('0x2'));var rs=require(_0x55ab('0x3'));var fs=require('fs');var Redis=require(_0x55ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x55ab('0x5'));var config=require(_0x55ab('0x6'));var jayson=require(_0x55ab('0x7'));var client=jayson[_0x55ab('0x8')][_0x55ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d879e,_0x50f80c,_0x22d446){return new BPromise(function(_0x47ced1,_0x3dbf52){return client[_0x55ab('0xa')](_0x2d879e,_0x22d446)['then'](function(_0x341f61){logger[_0x55ab('0xb')](_0x55ab('0xc'),_0x50f80c,_0x55ab('0xd'));logger[_0x55ab('0xe')](_0x55ab('0xf'),_0x50f80c,_0x55ab('0xd'),JSON[_0x55ab('0x10')](_0x341f61));if(_0x341f61[_0x55ab('0x11')]){if(_0x341f61[_0x55ab('0x11')][_0x55ab('0x12')]===0x1f4){logger['error'](_0x55ab('0xc'),_0x50f80c,_0x341f61[_0x55ab('0x11')]['message']);return _0x3dbf52(_0x341f61['error'][_0x55ab('0x13')]);}logger[_0x55ab('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x50f80c,_0x341f61[_0x55ab('0x11')][_0x55ab('0x13')]);return _0x47ced1(_0x341f61[_0x55ab('0x11')]['message']);}else{logger[_0x55ab('0xb')](_0x55ab('0xc'),_0x50f80c,_0x55ab('0xd'));_0x47ced1(_0x341f61[_0x55ab('0x14')][_0x55ab('0x13')]);}})['catch'](function(_0x395f44){logger[_0x55ab('0x11')](_0x55ab('0xc'),_0x50f80c,_0x395f44);_0x3dbf52(_0x395f44);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 64dbfd2..76f5fbe 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 _0xe5e7=['isAuthenticated','describe','get','/:id','/:id/sections','/:id/resources','create','post','/:id/clone','clone','addSections','addResources','put','delete','removeSections','removeResources','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','/describe'];(function(_0x48737f,_0x51ad45){var _0x918a2c=function(_0x3aad77){while(--_0x3aad77){_0x48737f['push'](_0x48737f['shift']());}};_0x918a2c(++_0x51ad45);}(_0xe5e7,0x10d));var _0x7e5e=function(_0x19b057,_0x47b061){_0x19b057=_0x19b057-0x0;var _0x5ee333=_0xe5e7[_0x19b057];return _0x5ee333;};'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['getSections']);router[_0x7e5e('0xd')](_0x7e5e('0x10'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth['isAuthenticated'](),controller[_0x7e5e('0x11')]);router[_0x7e5e('0x12')](_0x7e5e('0x13'),auth[_0x7e5e('0xb')](),controller[_0x7e5e('0x14')]);router[_0x7e5e('0x12')](_0x7e5e('0xf'),auth['isAuthenticated'](),controller[_0x7e5e('0x15')]);router[_0x7e5e('0x12')]('/:id/resources',auth['isAuthenticated'](),controller[_0x7e5e('0x16')]);router[_0x7e5e('0x17')](_0x7e5e('0xe'),auth[_0x7e5e('0xb')](),controller['update']);router[_0x7e5e('0x18')](_0x7e5e('0xe'),auth[_0x7e5e('0xb')](),controller['destroy']);router['delete'](_0x7e5e('0xf'),auth[_0x7e5e('0xb')](),controller[_0x7e5e('0x19')]);router['delete'](_0x7e5e('0x10'),auth[_0x7e5e('0xb')](),controller[_0x7e5e('0x1a')]);module[_0x7e5e('0x1b')]=router; \ No newline at end of file +var _0xba17=['create','clone','addSections','post','addResources','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xba17,0xb9));var _0x7ba1=function(_0x3733d3,_0x4d9d0d){_0x3733d3=_0x3733d3-0x0;var _0x473cc8=_0xba17[_0x3733d3];return _0x473cc8;};'use strict';var multer=require(_0x7ba1('0x0'));var util=require(_0x7ba1('0x1'));var path=require(_0x7ba1('0x2'));var timeout=require(_0x7ba1('0x3'));var express=require('express');var router=express[_0x7ba1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7ba1('0x5'));var config=require('../../config/environment');var controller=require(_0x7ba1('0x6'));router[_0x7ba1('0x7')]('/',auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x9')]);router[_0x7ba1('0x7')](_0x7ba1('0xa'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0xb')]);router[_0x7ba1('0x7')](_0x7ba1('0xc'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0xd')]);router[_0x7ba1('0x7')](_0x7ba1('0xe'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0xf')]);router[_0x7ba1('0x7')](_0x7ba1('0x10'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x11')]);router['post']('/',auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x12')]);router['post']('/:id/clone',auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x13')]);router['post'](_0x7ba1('0xe'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x14')]);router[_0x7ba1('0x15')](_0x7ba1('0x10'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x16')]);router['put'](_0x7ba1('0xc'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x17')]);router[_0x7ba1('0x18')](_0x7ba1('0xc'),auth['isAuthenticated'](),controller[_0x7ba1('0x19')]);router['delete'](_0x7ba1('0xe'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x1a')]);router[_0x7ba1('0x18')](_0x7ba1('0x10'),auth[_0x7ba1('0x8')](),controller[_0x7ba1('0x1b')]);module[_0x7ba1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2ba4fe9..937c7d8 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 _0xe372=['exports','STRING','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xe372,0xcf));var _0x2e37=function(_0x5663ec,_0x3007b6){_0x5663ec=_0x5663ec-0x0;var _0x1977a3=_0xe372[_0x5663ec];return _0x1977a3;};'use strict';var Sequelize=require(_0x2e37('0x0'));module[_0x2e37('0x1')]={'name':{'type':Sequelize[_0x2e37('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2e37('0x2')],'set':function(_0x48e679){this[_0x2e37('0x3')](_0x2e37('0x4'),_0x48e679?_0x48e679['join'](''):[]);},'get':function(){return this['getDataValue'](_0x2e37('0x4'))?this[_0x2e37('0x5')](_0x2e37('0x4'))[_0x2e37('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2e37('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2e37('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2e37('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2e37('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2e37('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2e37('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2e37('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa84f=['STRING','setDataValue','join','crudPermissions','getDataValue','BOOLEAN','sequelize','exports','name'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0xa84f,0x69));var _0xfa84=function(_0x5ad00b,_0x22c334){_0x5ad00b=_0x5ad00b-0x0;var _0x2aab79=_0xa84f[_0x5ad00b];return _0x2aab79;};'use strict';var Sequelize=require(_0xfa84('0x0'));module[_0xfa84('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa84('0x2')},'crudPermissions':{'type':Sequelize[_0xfa84('0x3')],'set':function(_0x34d669){this[_0xfa84('0x4')]('crudPermissions',_0x34d669?_0x34d669[_0xfa84('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xfa84('0x6'))?this[_0xfa84('0x7')](_0xfa84('0x6'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xfa84('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xfa84('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfa84('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xfa84('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfa84('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b8628d2..2f6e011 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 _0x00ea=['map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','UserProfile','findAll','rows','catch','show','create','body','clone','get','createdAt','updatedAt','omit','transaction','params','each','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','addSections','find','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','push','findOne','autoAssociation','Dashboard','forEach','resourceId','Plugin','addResources','sequelize','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x00ea,0x19d));var _0xa00e=function(_0x24e26e,_0x56afbc){_0x24e26e=_0x24e26e-0x0;var _0x426f6a=_0x00ea[_0x24e26e];return _0x426f6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa00e('0x0'));var zipdir=require(_0xa00e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa00e('0x2'));var moment=require(_0xa00e('0x3'));var BPromise=require(_0xa00e('0x4'));var Mustache=require(_0xa00e('0x5'));var util=require(_0xa00e('0x6'));var path=require(_0xa00e('0x7'));var sox=require('sox');var csv=require(_0xa00e('0x8'));var ejs=require(_0xa00e('0x9'));var fs=require('fs');var fs_extra=require(_0xa00e('0xa'));var _=require(_0xa00e('0xb'));var squel=require('squel');var crypto=require(_0xa00e('0xc'));var jsforce=require(_0xa00e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa00e('0x8'));var querystring=require(_0xa00e('0xe'));var Papa=require('papaparse');var Redis=require(_0xa00e('0xf'));var authService=require(_0xa00e('0x10'));var qs=require(_0xa00e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa00e('0x12'));var logger=require(_0xa00e('0x13'))('api');var utils=require(_0xa00e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa00e('0x15'));var db=require(_0xa00e('0x16'))['db'];config[_0xa00e('0x17')]=_[_0xa00e('0x18')](config['redis'],{'host':_0xa00e('0x19'),'port':0x18eb});var socket=require(_0xa00e('0x1a'))(new Redis(config['redis']));require(_0xa00e('0x1b'))['register'](socket);function respondWithStatusCode(_0x2f6124,_0x326b37){_0x326b37=_0x326b37||0xcc;return function(_0x261645){if(_0x261645){return _0x2f6124['sendStatus'](_0x326b37);}return _0x2f6124['status'](_0x326b37)[_0xa00e('0x1c')]();};}function respondWithResult(_0x4ccc1f,_0x2d0107){_0x2d0107=_0x2d0107||0xc8;return function(_0x37b130){if(_0x37b130){return _0x4ccc1f[_0xa00e('0x1d')](_0x2d0107)[_0xa00e('0x1e')](_0x37b130);}};}function respondWithFilteredResult(_0x3beb8b,_0x2635e3){return function(_0x119261){if(_0x119261){var _0x3e112d=typeof _0x2635e3[_0xa00e('0x1f')]===_0xa00e('0x20')&&typeof _0x2635e3[_0xa00e('0x21')]===_0xa00e('0x20');var _0x1111d9=_0x119261[_0xa00e('0x22')];var _0x5b86c4=_0x3e112d?0x0:_0x2635e3['offset'];var _0x53803b=_0x3e112d?_0x119261[_0xa00e('0x22')]:_0x2635e3[_0xa00e('0x1f')]+_0x2635e3[_0xa00e('0x21')];var _0x2ff99f;if(_0x53803b>=_0x1111d9){_0x53803b=_0x1111d9;_0x2ff99f=0xc8;}else{_0x2ff99f=0xce;}_0x3beb8b[_0xa00e('0x1d')](_0x2ff99f);return _0x3beb8b[_0xa00e('0x23')](_0xa00e('0x24'),_0x5b86c4+'-'+_0x53803b+'/'+_0x1111d9)[_0xa00e('0x1e')](_0x119261);}return null;};}function patchUpdates(_0x3a35c9){return function(_0x45d6bd){try{jsonpatch[_0xa00e('0x25')](_0x45d6bd,_0x3a35c9,!![]);}catch(_0x5c22bc){return BPromise['reject'](_0x5c22bc);}return _0x45d6bd[_0xa00e('0x26')]();};}function saveUpdates(_0x5af57a,_0x32aa90){return function(_0x2cf378){if(_0x2cf378){return _0x2cf378[_0xa00e('0x27')](_0x5af57a)[_0xa00e('0x28')](function(_0xe367f0){return _0xe367f0;});}return null;};}function removeEntity(_0xf6607,_0x480103){return function(_0x5b45be){if(_0x5b45be){return _0x5b45be[_0xa00e('0x29')]()[_0xa00e('0x28')](function(){_0xf6607[_0xa00e('0x1d')](0xcc)[_0xa00e('0x1c')]();});}};}function handleEntityNotFound(_0x352cea,_0x3f6a62){return function(_0x47ec77){if(!_0x47ec77){_0x352cea[_0xa00e('0x2a')](0x194);}return _0x47ec77;};}function handleError(_0xef9e9b,_0x5dbdb3){_0x5dbdb3=_0x5dbdb3||0x1f4;return function(_0x1313b2){logger[_0xa00e('0x2b')](_0x1313b2[_0xa00e('0x2c')]);if(_0x1313b2[_0xa00e('0x2d')]){delete _0x1313b2[_0xa00e('0x2d')];}_0xef9e9b['status'](_0x5dbdb3)['send'](_0x1313b2);};}exports[_0xa00e('0x2e')]=function(_0x18b9b2,_0x3ebe09){var _0x1f37aa={},_0x26450c={},_0x5519b6={'count':0x0,'rows':[]};var _0x2029e7=_[_0xa00e('0x2f')](db['UserProfile'][_0xa00e('0x30')],function(_0x2773af){return{'name':_0x2773af[_0xa00e('0x31')],'type':_0x2773af[_0xa00e('0x32')][_0xa00e('0x33')]};});_0x26450c[_0xa00e('0x34')]=_[_0xa00e('0x2f')](_0x2029e7,_0xa00e('0x2d'));_0x26450c['query']=_[_0xa00e('0x35')](_0x18b9b2['query']);_0x26450c[_0xa00e('0x36')]=_[_0xa00e('0x37')](_0x26450c[_0xa00e('0x34')],_0x26450c[_0xa00e('0x38')]);_0x1f37aa[_0xa00e('0x39')]=_['intersection'](_0x26450c[_0xa00e('0x34')],qs[_0xa00e('0x3a')](_0x18b9b2[_0xa00e('0x38')]['fields']));_0x1f37aa[_0xa00e('0x39')]=_0x1f37aa['attributes'][_0xa00e('0x3b')]?_0x1f37aa[_0xa00e('0x39')]:_0x26450c['model'];if(!_0x18b9b2[_0xa00e('0x38')][_0xa00e('0x3c')]('nolimit')){_0x1f37aa[_0xa00e('0x21')]=qs[_0xa00e('0x21')](_0x18b9b2[_0xa00e('0x38')]['limit']);_0x1f37aa['offset']=qs['offset'](_0x18b9b2[_0xa00e('0x38')][_0xa00e('0x1f')]);}_0x1f37aa[_0xa00e('0x3d')]=qs[_0xa00e('0x3e')](_0x18b9b2[_0xa00e('0x38')][_0xa00e('0x3e')]);_0x1f37aa[_0xa00e('0x3f')]=qs[_0xa00e('0x36')](_[_0xa00e('0x40')](_0x18b9b2[_0xa00e('0x38')],_0x26450c['filters']),_0x2029e7);if(_0x18b9b2[_0xa00e('0x38')][_0xa00e('0x41')]){_0x1f37aa[_0xa00e('0x3f')]=_[_0xa00e('0x42')](_0x1f37aa[_0xa00e('0x3f')],{'$or':_['map'](_0x2029e7,function(_0x1a0ca3){if(_0x1a0ca3[_0xa00e('0x32')]!==_0xa00e('0x43')){var _0xfd20b8={};_0xfd20b8[_0x1a0ca3[_0xa00e('0x2d')]]={'$like':'%'+_0x18b9b2['query'][_0xa00e('0x41')]+'%'};return _0xfd20b8;}})});}_0x1f37aa=_['merge']({},_0x1f37aa,_0x18b9b2[_0xa00e('0x44')]);var _0x560c1c={'where':_0x1f37aa['where']};return db['UserProfile'][_0xa00e('0x22')](_0x560c1c)[_0xa00e('0x28')](function(_0x4763a1){_0x5519b6['count']=_0x4763a1;if(_0x18b9b2[_0xa00e('0x38')][_0xa00e('0x45')]){_0x1f37aa[_0xa00e('0x46')]=[{'all':!![]}];}return db[_0xa00e('0x47')][_0xa00e('0x48')](_0x1f37aa);})[_0xa00e('0x28')](function(_0x427c34){_0x5519b6[_0xa00e('0x49')]=_0x427c34;return _0x5519b6;})['then'](respondWithFilteredResult(_0x3ebe09,_0x1f37aa))[_0xa00e('0x4a')](handleError(_0x3ebe09,null));};exports[_0xa00e('0x4b')]=function(_0x342530,_0x98dd17){var _0x3efd46={'raw':![],'where':{'id':_0x342530['params']['id']}},_0x54f271={};_0x54f271['model']=_['keys'](db['UserProfile'][_0xa00e('0x30')]);_0x54f271[_0xa00e('0x38')]=_['keys'](_0x342530['query']);_0x54f271[_0xa00e('0x36')]=_[_0xa00e('0x37')](_0x54f271['model'],_0x54f271[_0xa00e('0x38')]);_0x3efd46['attributes']=_['intersection'](_0x54f271[_0xa00e('0x34')],qs[_0xa00e('0x3a')](_0x342530[_0xa00e('0x38')][_0xa00e('0x3a')]));_0x3efd46[_0xa00e('0x39')]=_0x3efd46['attributes'][_0xa00e('0x3b')]?_0x3efd46[_0xa00e('0x39')]:_0x54f271[_0xa00e('0x34')];if(_0x342530[_0xa00e('0x38')][_0xa00e('0x45')]){_0x3efd46[_0xa00e('0x46')]=[{'all':!![]}];}_0x3efd46=_[_0xa00e('0x42')]({},_0x3efd46,_0x342530[_0xa00e('0x44')]);return db[_0xa00e('0x47')]['find'](_0x3efd46)['then'](handleEntityNotFound(_0x98dd17,null))[_0xa00e('0x28')](respondWithResult(_0x98dd17,null))['catch'](handleError(_0x98dd17,null));};exports[_0xa00e('0x4c')]=function(_0x4fd0b7,_0x168c07){return db[_0xa00e('0x47')][_0xa00e('0x4c')](_0x4fd0b7[_0xa00e('0x4d')],{})['then'](respondWithResult(_0x168c07,0xc9))['catch'](handleError(_0x168c07,null));};exports[_0xa00e('0x4e')]=function(_0xc72bec,_0x5a1a92){var _0x17de99={'where':{'id':_0xc72bec['params']['id']}},_0x5dbcc9={};_0x5dbcc9[_0xa00e('0x34')]=_[_0xa00e('0x35')](db[_0xa00e('0x47')][_0xa00e('0x30')]);_0x17de99[_0xa00e('0x39')]=_[_0xa00e('0x37')](_0x5dbcc9['model'],qs[_0xa00e('0x3a')](_0xc72bec[_0xa00e('0x38')][_0xa00e('0x3a')]));_0x17de99[_0xa00e('0x39')]=_0x17de99[_0xa00e('0x39')]['length']?_0x17de99['attributes']:_0x5dbcc9[_0xa00e('0x34')];if(_0xc72bec[_0xa00e('0x38')][_0xa00e('0x45')]){_0x17de99[_0xa00e('0x46')]=[{'all':!![]}];}_0x17de99=_[_0xa00e('0x42')]({},_0x17de99,_0xc72bec[_0xa00e('0x44')]);return db[_0xa00e('0x47')]['find'](_0x17de99)[_0xa00e('0x28')](handleEntityNotFound(_0x5a1a92,null))[_0xa00e('0x28')](function(_0x40847e){if(_0x40847e){var _0x542137=_0x40847e[_0xa00e('0x4f')]({'plain':!![]});_0x542137=qs['omit'](_0x542137,['id',_0xa00e('0x50'),_0xa00e('0x51'),'crudPermissions']);_0xc72bec[_0xa00e('0x4d')]=_[_0xa00e('0x52')](_0xc72bec[_0xa00e('0x4d')],['id','createdAt','updatedAt']);return db['sequelize'][_0xa00e('0x53')](function(_0x9f15a4){return db[_0xa00e('0x47')]['create'](_[_0xa00e('0x42')](_0x542137,_0xc72bec[_0xa00e('0x4d')]),{'include':_0xc72bec[_0xa00e('0x38')][_0xa00e('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x9f15a4})[_0xa00e('0x28')](function(_0xe60a30){var _0x19e657=_0xe60a30['get']({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xc72bec[_0xa00e('0x54')]['id']},'raw':!![]})['then'](function(_0x43d6ca){if(_0x43d6ca){return BPromise[_0xa00e('0x55')](_0x43d6ca,function(_0x2a6834){return new BPromise(function(_0x58483a,_0x4ecca2){if(_0x2a6834['autoAssociation']===null||_0x2a6834['autoAssociation']===0x1)_0x58483a(null);return db[_0xa00e('0x56')][_0xa00e('0x48')]({'where':{'sectionId':_0x2a6834['id']},'raw':!![]})[_0xa00e('0x28')](function(_0x43eaea){var _0x481276=_['map'](_0x43eaea,function(_0x5c8cea){return qs[_0xa00e('0x52')](_0x5c8cea,['id',_0xa00e('0x50'),_0xa00e('0x51'),_0xa00e('0x57')]);});_0x58483a(_0x481276);})[_0xa00e('0x4a')](function(_0x21eebb){_0x4ecca2(_0x21eebb);});})[_0xa00e('0x28')](function(_0x35399a){var _0x4fff00=qs[_0xa00e('0x52')](_0x2a6834,['id','createdAt',_0xa00e('0x51')]);_0x4fff00[_0xa00e('0x58')]=_0x19e657['id'];if(_0x35399a)_0x4fff00[_0xa00e('0x59')]=_0x35399a;return _0x4fff00;})[_0xa00e('0x28')](function(_0x33d7fc){return db[_0xa00e('0x5a')][_0xa00e('0x4c')](_0x33d7fc,{'include':[{'model':db['UserProfileResource'],'as':_0xa00e('0x59')}],'raw':!![],'transaction':_0x9f15a4});});})[_0xa00e('0x28')](function(){return _0x19e657;});}});});});}})['then'](respondWithResult(_0x5a1a92,0xc9))[_0xa00e('0x4a')](handleError(_0x5a1a92,null));};exports[_0xa00e('0x27')]=function(_0x3adbf1,_0x1ae36c){if(_0x3adbf1[_0xa00e('0x4d')]['id']){delete _0x3adbf1['body']['id'];}return db[_0xa00e('0x47')]['find']({'where':{'id':_0x3adbf1['params']['id']}})[_0xa00e('0x28')](handleEntityNotFound(_0x1ae36c,null))['then'](saveUpdates(_0x3adbf1['body'],null))[_0xa00e('0x28')](respondWithResult(_0x1ae36c,null))[_0xa00e('0x4a')](handleError(_0x1ae36c,null));};exports[_0xa00e('0x29')]=function(_0x2a52e4,_0x283fc3){return db[_0xa00e('0x47')]['find']({'where':{'id':_0x2a52e4[_0xa00e('0x54')]['id']}})[_0xa00e('0x28')](handleEntityNotFound(_0x283fc3,null))[_0xa00e('0x28')](removeEntity(_0x283fc3,null))[_0xa00e('0x4a')](handleError(_0x283fc3,null));};exports['describe']=function(_0x26a61e,_0x1282a7){return db[_0xa00e('0x47')]['describe']()[_0xa00e('0x28')](respondWithResult(_0x1282a7,null))[_0xa00e('0x4a')](handleError(_0x1282a7,null));};exports[_0xa00e('0x5b')]=function(_0x5a8949,_0xde0cc1){var _0x188b22=_0x5a8949[_0xa00e('0x4d')];return db[_0xa00e('0x47')][_0xa00e('0x5c')]({'where':{'id':_0x5a8949['params']['id']}})[_0xa00e('0x28')](handleEntityNotFound(_0xde0cc1,null))[_0xa00e('0x28')](function(_0x5d43e7){if(_0x5d43e7){return db['sequelize']['transaction'](function(_0x102b19){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x5a8949[_0xa00e('0x54')]['id'],'sectionId':_[_0xa00e('0x2f')](_0x188b22,function(_0x151150){return _0x151150[_0xa00e('0x57')];})},'transaction':_0x102b19})[_0xa00e('0x28')](function(){var _0x3e91b0=_[_0xa00e('0x2f')](_0x188b22,function(_0x5f2a82){_0x5f2a82[_0xa00e('0x58')]=_0x5a8949[_0xa00e('0x54')]['id'];return _0x5f2a82;});var _0x393404=[];return BPromise['each'](_0x3e91b0,function(_0x583c63){return db['UserProfileSection']['create'](_0x583c63,{'include':[{'model':db[_0xa00e('0x56')],'as':_0xa00e('0x59')}],'raw':!![],'transaction':_0x102b19})[_0xa00e('0x28')](function(_0x14aeae){_0x393404['push'](_0x14aeae[_0xa00e('0x4f')]({'plain':!![]}));});})[_0xa00e('0x28')](function(){return _0x393404;});});});}})[_0xa00e('0x28')](function(_0x1c0348){return _0x1c0348;})[_0xa00e('0x28')](respondWithResult(_0xde0cc1,null))['catch'](handleError(_0xde0cc1,null));};exports[_0xa00e('0x5d')]=function(_0x45be45,_0x4a4560){var _0x46691f;return db[_0xa00e('0x47')]['find']({'where':{'id':_0x45be45[_0xa00e('0x54')]['id']},'attributes':['id',_0xa00e('0x2d')]})[_0xa00e('0x28')](handleEntityNotFound(_0x4a4560,null))[_0xa00e('0x28')](function(_0x140b1e){if(_0x140b1e){_0x46691f=_0x140b1e;return db[_0xa00e('0x5a')][_0xa00e('0x29')]({'where':{'userProfileId':_0x45be45[_0xa00e('0x54')]['id'],'sectionId':_0x45be45['query'][_0xa00e('0x5e')]}});}})['then'](function(){return _0x46691f;})[_0xa00e('0x28')](respondWithStatusCode(_0x4a4560,null))[_0xa00e('0x4a')](handleError(_0x4a4560,null));};exports[_0xa00e('0x5f')]=function(_0x596cd7,_0x161c55){var _0x4cf37e=[];var _0x47d873=[];return db[_0xa00e('0x5a')][_0xa00e('0x48')]({'where':{'userProfileId':_0x596cd7[_0xa00e('0x54')]['id']},'raw':!![]})[_0xa00e('0x28')](function(_0x3fb711){_0x4cf37e=_[_0xa00e('0x41')](_0x3fb711,function(_0x5f2f67){return _0x5f2f67[_0xa00e('0x60')]===0x1||_[_0xa00e('0x61')]([0x3eb,0x709],_0x5f2f67['sectionId']);});if(!_[_0xa00e('0x62')](_0x4cf37e)){return _[_0xa00e('0x2f')](_0x4cf37e,function(_0xfff177){return _0xfff177[_0xa00e('0x57')];});}else{return;}})[_0xa00e('0x28')](function(_0x2a22ce){if(_0x2a22ce)_0x47d873=_0x2a22ce;if(_[_0xa00e('0x61')](_0x47d873,0x64)){var _0x3f8a25=_[_0xa00e('0x5c')](_0x4cf37e,{'sectionId':0x64});return hasDefaultDashboard(_0x3f8a25)[_0xa00e('0x28')](function(_0x354f3b){return _[_0xa00e('0x2f')](_0x4cf37e,function(_0x4e6e63){if(_0x4e6e63[_0xa00e('0x57')]===0x64){_0x4e6e63[_0xa00e('0x63')]=_0x354f3b;}return _0x4e6e63;});});}else{return;}})['then'](function(_0x57e11e){if(_0x57e11e)_0x4cf37e=_0x57e11e;if(_['includes'](_0x47d873,0x3eb)){var _0xc81ce2=_['find'](_0x4cf37e,{'sectionId':0x3eb});return getCustomDashboards(_0xc81ce2)[_0xa00e('0x28')](function(_0x4db7b8){return _[_0xa00e('0x2f')](_0x4cf37e,function(_0x3b7f1c){if(_0xc81ce2['enabled']){if(_0x3b7f1c[_0xa00e('0x57')]===0x3eb){_0x3b7f1c['subsections']=_0x4db7b8;}}else{if(_0x3b7f1c[_0xa00e('0x57')]===0x64){_0x3b7f1c[_0xa00e('0x63')]=_0x4db7b8;}}return _0x3b7f1c;});});}else{return;}})[_0xa00e('0x28')](function(_0x548674){if(_0x548674)_0x4cf37e=_0x548674;if(_['includes'](_0x47d873,0x709)){var _0x3b1c48=_[_0xa00e('0x5c')](_0x4cf37e,{'sectionId':0x709});return getPlugins(_0x3b1c48)[_0xa00e('0x28')](function(_0x1ee032){if(_0x3b1c48[_0xa00e('0x60')]){return _['map'](_0x4cf37e,function(_0x439b26){if(_0x439b26[_0xa00e('0x57')]===0x709){_0x439b26[_0xa00e('0x63')]=_0x1ee032;}return _0x439b26;});}else{var _0x2d0a5f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1ee032};var _0x2dd436=_['map'](_0x4cf37e);_0x2dd436[_0xa00e('0x64')](_0x2d0a5f);return _0x2dd436;}});}else{return;}})[_0xa00e('0x28')](function(_0x1a4b0a){if(_0x1a4b0a)_0x4cf37e=_0x1a4b0a;return _[_0xa00e('0x41')](_0x4cf37e,['enabled',0x1]);})['then'](respondWithResult(_0x161c55,null))[_0xa00e('0x4a')](handleError(_0x161c55,null));};function hasDefaultDashboard(_0x4218cc){var _0x5d600b=[0x65];return new BPromise(function(_0x5a5c91,_0x4c922f){try{if(_0x4218cc['autoAssociation']){_0x5a5c91(_0x5d600b);}else{return db[_0xa00e('0x56')][_0xa00e('0x65')]({'where':{'sectionId':_0x4218cc['id']},'raw':!![]})[_0xa00e('0x28')](function(_0xa4936a){_0xa4936a?_0x5a5c91(_0x5d600b):_0x5a5c91();});}}catch(_0x5c47b3){_0x4c922f(_0x5c47b3);}});}function getCustomDashboards(_0xd62163){var _0x31594f=[];return new BPromise(function(_0x44de3c,_0xfc02bb){try{if(_0xd62163[_0xa00e('0x66')]){return db[_0xa00e('0x67')][_0xa00e('0x48')]({'raw':!![]})[_0xa00e('0x28')](function(_0x455222){_0x455222[_0xa00e('0x68')](function(_0x1d00c6){_0x31594f[_0xa00e('0x64')](_0x1d00c6['id']+0x1869f);});_0x44de3c(_0x31594f);});}else{return db['UserProfileResource'][_0xa00e('0x48')]({'where':{'sectionId':_0xd62163['id']},'raw':!![]})[_0xa00e('0x28')](function(_0x2631bc){_0x2631bc[_0xa00e('0x68')](function(_0x4601ef){_0x31594f[_0xa00e('0x64')](_0x4601ef[_0xa00e('0x69')]+0x1869f);});_0x44de3c(_0x31594f);});}}catch(_0x3ee193){_0xfc02bb(_0x3ee193);}});}function getPlugins(_0x296712){var _0x4b278a=[];return new BPromise(function(_0x3db437,_0x4e1f8f){try{if(_0x296712[_0xa00e('0x66')]){return db[_0xa00e('0x6a')][_0xa00e('0x48')]({'raw':!![]})[_0xa00e('0x28')](function(_0x4f3af0){_0x4f3af0[_0xa00e('0x68')](function(_0x3e1cef){_0x4b278a[_0xa00e('0x64')](_0x3e1cef['id']+0x15b38);});_0x3db437(_0x4b278a);});}else{return db['UserProfileResource'][_0xa00e('0x48')]({'where':{'sectionId':_0x296712['id']},'raw':!![]})[_0xa00e('0x28')](function(_0x44775e){_0x44775e[_0xa00e('0x68')](function(_0x1ff73e){_0x4b278a[_0xa00e('0x64')](_0x1ff73e[_0xa00e('0x69')]+0x15b38);});_0x3db437(_0x4b278a);});}}catch(_0x2175be){_0x4e1f8f(_0x2175be);}});}exports[_0xa00e('0x6b')]=function(_0x1d4863,_0x618319){return db['UserProfile'][_0xa00e('0x5c')]({'where':{'id':_0x1d4863[_0xa00e('0x54')]['id']}})[_0xa00e('0x28')](handleEntityNotFound(_0x618319,null))['then'](function(_0x3a2bb2){if(_0x3a2bb2){return db[_0xa00e('0x6c')]['transaction'](function(_0x314783){return db[_0xa00e('0x5a')]['findAll']({'where':{'userProfileId':_0x1d4863[_0xa00e('0x54')]['id']},'attributes':['id'],'raw':!![]})[_0xa00e('0x28')](function(_0x1f04c5){if(_0x1f04c5){return db['UserProfileSection'][_0xa00e('0x29')]({'where':{'userProfileId':_0x1d4863[_0xa00e('0x54')]['id'],'id':_[_0xa00e('0x2f')](_0x1f04c5,function(_0x11de84){return _0x11de84['id'];})},'transaction':_0x314783});}})['then'](function(_0x84f995){var _0x5da2b3=_[_0xa00e('0x2f')](_0x1d4863[_0xa00e('0x4d')],function(_0x532d83){_0x532d83[_0xa00e('0x58')]=_0x1d4863[_0xa00e('0x54')]['id'];return _0x532d83;});return db[_0xa00e('0x5a')]['bulkCreate'](_0x5da2b3,{'raw':!![],'transaction':_0x314783});})[_0xa00e('0x28')](function(_0x298ed1){var _0x1ddff3=_[_0xa00e('0x41')](_['map'](_0x298ed1,function(_0x3f8cdb){return _0x3f8cdb[_0xa00e('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x1ddff3){return db[_0xa00e('0x5a')][_0xa00e('0x48')]({'where':{'userProfileId':_0x1d4863['params']['id'],'sectionId':_[_0xa00e('0x2f')](_0x1ddff3,function(_0x512d09){return _0x512d09[_0xa00e('0x57')];})},'attributes':['id',_0xa00e('0x57')],'raw':!![]})[_0xa00e('0x28')](function(_0x5421b7){var _0x19796c=_[_0xa00e('0x2f')](_0x1d4863[_0xa00e('0x4d')],function(_0x221c8b){_0x221c8b[_0xa00e('0x58')]=_0x1d4863['params']['id'];return _0x221c8b;});return db[_0xa00e('0x56')]['bulkCreate'](_0x19796c,{'raw':!![],'transaction':_0x314783});});}})[_0xa00e('0x4a')](handleError(_0x618319,null));});}})[_0xa00e('0x28')](function(_0x36c0ae){var _0x3dbd23=_['map'](_0x36c0ae,function(_0x509009){return _0x509009[_0xa00e('0x4f')]({'plain':!![]});});})[_0xa00e('0x28')](respondWithResult(_0x618319,null))['catch'](handleError(_0x618319,null));};exports[_0xa00e('0x6d')]=function(_0x4af4c6,_0x4fd197,_0x1f8f6f){return db[_0xa00e('0x47')][_0xa00e('0x5c')]({'where':{'id':_0x4af4c6[_0xa00e('0x54')]['id']}})[_0xa00e('0x28')](handleEntityNotFound(_0x4fd197,null))[_0xa00e('0x28')](function(_0x242335){if(_0x242335){return _0x242335[_0xa00e('0x6d')](_0x4af4c6[_0xa00e('0x38')]['ids']);}})[_0xa00e('0x28')](respondWithStatusCode(_0x4fd197,null))[_0xa00e('0x4a')](handleError(_0x4fd197,null));};exports[_0xa00e('0x6e')]=function(_0x77c803,_0x2579af){var _0x1254f4={};if(!_0x77c803['query'][_0xa00e('0x6f')])throw new Error(_0xa00e('0x70'));if(!_0x77c803[_0xa00e('0x38')][_0xa00e('0x3c')](_0xa00e('0x71'))){_0x1254f4[_0xa00e('0x21')]=qs['limit'](_0x77c803['query'][_0xa00e('0x21')]);_0x1254f4[_0xa00e('0x1f')]=qs[_0xa00e('0x1f')](_0x77c803[_0xa00e('0x38')][_0xa00e('0x1f')]);}return db['UserProfile'][_0xa00e('0x5c')]({'where':{'id':_0x77c803[_0xa00e('0x54')]['id']}})[_0xa00e('0x28')](function(_0x2f8f35){if(!_0x2f8f35)throw new Error(_0xa00e('0x72')+_0x77c803['params']['id']);return db['UserProfile'][_0xa00e('0x6e')](_0x77c803);})[_0xa00e('0x28')](respondWithFilteredResult(_0x2579af,_0x1254f4))[_0xa00e('0x4a')](handleError(_0x2579af,null));}; \ No newline at end of file +var _0x3c32=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','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','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','UserProfile','includeAll','include','rows','then','catch','show','create','body','clone','params','get','createdAt','updatedAt','crudPermissions','sequelize','transaction','findAll','each','autoAssociation','sectionId','omit','userProfileId','Resources','UserProfileSection','UserProfileResource','find','describe','push','removeSections','ids','getSections','enabled','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x3c32,0x161));var _0x23c3=function(_0x11fd7f,_0xeb00e4){_0x11fd7f=_0x11fd7f-0x0;var _0x2ecdef=_0x3c32[_0x11fd7f];return _0x2ecdef;};'use strict';var emlformat=require(_0x23c3('0x0'));var rimraf=require(_0x23c3('0x1'));var zipdir=require(_0x23c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23c3('0x3'));var moment=require(_0x23c3('0x4'));var BPromise=require(_0x23c3('0x5'));var Mustache=require('mustache');var util=require(_0x23c3('0x6'));var path=require('path');var sox=require(_0x23c3('0x7'));var csv=require(_0x23c3('0x8'));var ejs=require(_0x23c3('0x9'));var fs=require('fs');var fs_extra=require(_0x23c3('0xa'));var _=require(_0x23c3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x23c3('0xc'));var toCsv=require(_0x23c3('0x8'));var querystring=require(_0x23c3('0xd'));var Papa=require(_0x23c3('0xe'));var Redis=require(_0x23c3('0xf'));var authService=require(_0x23c3('0x10'));var qs=require(_0x23c3('0x11'));var as=require(_0x23c3('0x12'));var hardwareService=require(_0x23c3('0x13'));var logger=require(_0x23c3('0x14'))(_0x23c3('0x15'));var utils=require(_0x23c3('0x16'));var config=require(_0x23c3('0x17'));var licenseUtil=require(_0x23c3('0x18'));var db=require(_0x23c3('0x19'))['db'];config[_0x23c3('0x1a')]=_[_0x23c3('0x1b')](config[_0x23c3('0x1a')],{'host':_0x23c3('0x1c'),'port':0x18eb});var socket=require(_0x23c3('0x1d'))(new Redis(config['redis']));require('./userProfile.socket')[_0x23c3('0x1e')](socket);function respondWithStatusCode(_0x38a11a,_0x4192bf){_0x4192bf=_0x4192bf||0xcc;return function(_0x32c118){if(_0x32c118){return _0x38a11a[_0x23c3('0x1f')](_0x4192bf);}return _0x38a11a[_0x23c3('0x20')](_0x4192bf)[_0x23c3('0x21')]();};}function respondWithResult(_0x51e880,_0x4f65f8){_0x4f65f8=_0x4f65f8||0xc8;return function(_0x2b224d){if(_0x2b224d){return _0x51e880[_0x23c3('0x20')](_0x4f65f8)['json'](_0x2b224d);}};}function respondWithFilteredResult(_0x4737e4,_0x2d63e2){return function(_0x20a8b7){if(_0x20a8b7){var _0x1456a3=typeof _0x2d63e2[_0x23c3('0x22')]===_0x23c3('0x23')&&typeof _0x2d63e2['limit']===_0x23c3('0x23');var _0x4742be=_0x20a8b7[_0x23c3('0x24')];var _0x47abe2=_0x1456a3?0x0:_0x2d63e2[_0x23c3('0x22')];var _0x48a50a=_0x1456a3?_0x20a8b7['count']:_0x2d63e2[_0x23c3('0x22')]+_0x2d63e2['limit'];var _0x5719d3;if(_0x48a50a>=_0x4742be){_0x48a50a=_0x4742be;_0x5719d3=0xc8;}else{_0x5719d3=0xce;}_0x4737e4[_0x23c3('0x20')](_0x5719d3);return _0x4737e4[_0x23c3('0x25')](_0x23c3('0x26'),_0x47abe2+'-'+_0x48a50a+'/'+_0x4742be)[_0x23c3('0x27')](_0x20a8b7);}return null;};}function patchUpdates(_0x5c5993){return function(_0x47067e){try{jsonpatch['apply'](_0x47067e,_0x5c5993,!![]);}catch(_0xc287a5){return BPromise[_0x23c3('0x28')](_0xc287a5);}return _0x47067e[_0x23c3('0x29')]();};}function saveUpdates(_0x1210a4,_0x576c20){return function(_0xc5affc){if(_0xc5affc){return _0xc5affc[_0x23c3('0x2a')](_0x1210a4)['then'](function(_0x24fabd){return _0x24fabd;});}return null;};}function removeEntity(_0x27cd14,_0x2864c6){return function(_0x4552aa){if(_0x4552aa){return _0x4552aa[_0x23c3('0x2b')]()['then'](function(){_0x27cd14[_0x23c3('0x20')](0xcc)[_0x23c3('0x21')]();});}};}function handleEntityNotFound(_0x2c3a6a,_0x1c958a){return function(_0xa520fc){if(!_0xa520fc){_0x2c3a6a[_0x23c3('0x1f')](0x194);}return _0xa520fc;};}function handleError(_0x237c7d,_0x2a1b2c){_0x2a1b2c=_0x2a1b2c||0x1f4;return function(_0x856e72){logger[_0x23c3('0x2c')](_0x856e72[_0x23c3('0x2d')]);if(_0x856e72[_0x23c3('0x2e')]){delete _0x856e72[_0x23c3('0x2e')];}_0x237c7d[_0x23c3('0x20')](_0x2a1b2c)[_0x23c3('0x2f')](_0x856e72);};}exports[_0x23c3('0x30')]=function(_0x1ad0ea,_0x28af56){var _0x12b8be={},_0xd732d7={},_0x1bc3ce={'count':0x0,'rows':[]};var _0x47abc5=_['map'](db['UserProfile'][_0x23c3('0x31')],function(_0x5e117f){return{'name':_0x5e117f[_0x23c3('0x32')],'type':_0x5e117f['type'][_0x23c3('0x33')]};});_0xd732d7[_0x23c3('0x34')]=_[_0x23c3('0x35')](_0x47abc5,_0x23c3('0x2e'));_0xd732d7[_0x23c3('0x36')]=_[_0x23c3('0x37')](_0x1ad0ea[_0x23c3('0x36')]);_0xd732d7['filters']=_[_0x23c3('0x38')](_0xd732d7['model'],_0xd732d7[_0x23c3('0x36')]);_0x12b8be[_0x23c3('0x39')]=_['intersection'](_0xd732d7['model'],qs['fields'](_0x1ad0ea[_0x23c3('0x36')][_0x23c3('0x3a')]));_0x12b8be[_0x23c3('0x39')]=_0x12b8be['attributes'][_0x23c3('0x3b')]?_0x12b8be[_0x23c3('0x39')]:_0xd732d7[_0x23c3('0x34')];if(!_0x1ad0ea[_0x23c3('0x36')][_0x23c3('0x3c')]('nolimit')){_0x12b8be[_0x23c3('0x3d')]=qs[_0x23c3('0x3d')](_0x1ad0ea[_0x23c3('0x36')]['limit']);_0x12b8be['offset']=qs[_0x23c3('0x22')](_0x1ad0ea[_0x23c3('0x36')][_0x23c3('0x22')]);}_0x12b8be[_0x23c3('0x3e')]=qs['sort'](_0x1ad0ea[_0x23c3('0x36')][_0x23c3('0x3f')]);_0x12b8be[_0x23c3('0x40')]=qs[_0x23c3('0x41')](_[_0x23c3('0x42')](_0x1ad0ea[_0x23c3('0x36')],_0xd732d7['filters']),_0x47abc5);if(_0x1ad0ea['query'][_0x23c3('0x43')]){_0x12b8be['where']=_[_0x23c3('0x44')](_0x12b8be[_0x23c3('0x40')],{'$or':_[_0x23c3('0x35')](_0x47abc5,function(_0xb46bc){if(_0xb46bc[_0x23c3('0x45')]!==_0x23c3('0x46')){var _0x3dbdc0={};_0x3dbdc0[_0xb46bc[_0x23c3('0x2e')]]={'$like':'%'+_0x1ad0ea[_0x23c3('0x36')][_0x23c3('0x43')]+'%'};return _0x3dbdc0;}})});}_0x12b8be=_[_0x23c3('0x44')]({},_0x12b8be,_0x1ad0ea[_0x23c3('0x47')]);var _0x277681={'where':_0x12b8be[_0x23c3('0x40')]};return db[_0x23c3('0x48')]['count'](_0x277681)['then'](function(_0x21b427){_0x1bc3ce[_0x23c3('0x24')]=_0x21b427;if(_0x1ad0ea['query'][_0x23c3('0x49')]){_0x12b8be[_0x23c3('0x4a')]=[{'all':!![]}];}return db[_0x23c3('0x48')]['findAll'](_0x12b8be);})['then'](function(_0x1e98be){_0x1bc3ce[_0x23c3('0x4b')]=_0x1e98be;return _0x1bc3ce;})[_0x23c3('0x4c')](respondWithFilteredResult(_0x28af56,_0x12b8be))[_0x23c3('0x4d')](handleError(_0x28af56,null));};exports[_0x23c3('0x4e')]=function(_0x4474d3,_0x3bcaad){var _0x33b393={'raw':![],'where':{'id':_0x4474d3['params']['id']}},_0xef696c={};_0xef696c['model']=_[_0x23c3('0x37')](db['UserProfile'][_0x23c3('0x31')]);_0xef696c[_0x23c3('0x36')]=_['keys'](_0x4474d3[_0x23c3('0x36')]);_0xef696c[_0x23c3('0x41')]=_[_0x23c3('0x38')](_0xef696c[_0x23c3('0x34')],_0xef696c[_0x23c3('0x36')]);_0x33b393['attributes']=_[_0x23c3('0x38')](_0xef696c[_0x23c3('0x34')],qs['fields'](_0x4474d3['query']['fields']));_0x33b393['attributes']=_0x33b393[_0x23c3('0x39')][_0x23c3('0x3b')]?_0x33b393[_0x23c3('0x39')]:_0xef696c[_0x23c3('0x34')];if(_0x4474d3[_0x23c3('0x36')][_0x23c3('0x49')]){_0x33b393[_0x23c3('0x4a')]=[{'all':!![]}];}_0x33b393=_[_0x23c3('0x44')]({},_0x33b393,_0x4474d3['options']);return db[_0x23c3('0x48')]['find'](_0x33b393)[_0x23c3('0x4c')](handleEntityNotFound(_0x3bcaad,null))[_0x23c3('0x4c')](respondWithResult(_0x3bcaad,null))['catch'](handleError(_0x3bcaad,null));};exports[_0x23c3('0x4f')]=function(_0x1c29e1,_0x13d2e1){return db[_0x23c3('0x48')][_0x23c3('0x4f')](_0x1c29e1[_0x23c3('0x50')],{})['then'](respondWithResult(_0x13d2e1,0xc9))['catch'](handleError(_0x13d2e1,null));};exports[_0x23c3('0x51')]=function(_0x2550e8,_0x49a182){var _0x1f2139={'where':{'id':_0x2550e8[_0x23c3('0x52')]['id']}},_0x49c47a={};_0x49c47a['model']=_['keys'](db[_0x23c3('0x48')][_0x23c3('0x31')]);_0x1f2139[_0x23c3('0x39')]=_['intersection'](_0x49c47a['model'],qs[_0x23c3('0x3a')](_0x2550e8[_0x23c3('0x36')]['fields']));_0x1f2139['attributes']=_0x1f2139['attributes'][_0x23c3('0x3b')]?_0x1f2139['attributes']:_0x49c47a[_0x23c3('0x34')];if(_0x2550e8[_0x23c3('0x36')][_0x23c3('0x49')]){_0x1f2139[_0x23c3('0x4a')]=[{'all':!![]}];}_0x1f2139=_[_0x23c3('0x44')]({},_0x1f2139,_0x2550e8[_0x23c3('0x47')]);return db['UserProfile']['find'](_0x1f2139)[_0x23c3('0x4c')](handleEntityNotFound(_0x49a182,null))['then'](function(_0x5f31ca){if(_0x5f31ca){var _0x1fc444=_0x5f31ca[_0x23c3('0x53')]({'plain':!![]});_0x1fc444=qs['omit'](_0x1fc444,['id',_0x23c3('0x54'),_0x23c3('0x55'),_0x23c3('0x56')]);_0x2550e8['body']=_['omit'](_0x2550e8[_0x23c3('0x50')],['id','createdAt',_0x23c3('0x55')]);return db[_0x23c3('0x57')][_0x23c3('0x58')](function(_0x29a881){return db[_0x23c3('0x48')][_0x23c3('0x4f')](_[_0x23c3('0x44')](_0x1fc444,_0x2550e8[_0x23c3('0x50')]),{'include':_0x2550e8[_0x23c3('0x36')][_0x23c3('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x29a881})[_0x23c3('0x4c')](function(_0x5df662){var _0xb6734=_0x5df662[_0x23c3('0x53')]({'plain':!![]});return db['UserProfileSection'][_0x23c3('0x59')]({'where':{'userProfileId':_0x2550e8[_0x23c3('0x52')]['id']},'raw':!![]})[_0x23c3('0x4c')](function(_0x5eeefb){if(_0x5eeefb){return BPromise[_0x23c3('0x5a')](_0x5eeefb,function(_0x5a95b5){return new BPromise(function(_0x34bdb2,_0x121237){if(_0x5a95b5['autoAssociation']===null||_0x5a95b5[_0x23c3('0x5b')]===0x1)_0x34bdb2(null);return db['UserProfileResource'][_0x23c3('0x59')]({'where':{'sectionId':_0x5a95b5['id']},'raw':!![]})[_0x23c3('0x4c')](function(_0x154619){var _0x3d5be0=_['map'](_0x154619,function(_0x4b851b){return qs['omit'](_0x4b851b,['id','createdAt',_0x23c3('0x55'),_0x23c3('0x5c')]);});_0x34bdb2(_0x3d5be0);})[_0x23c3('0x4d')](function(_0x1817dd){_0x121237(_0x1817dd);});})[_0x23c3('0x4c')](function(_0x389f13){var _0x402605=qs[_0x23c3('0x5d')](_0x5a95b5,['id',_0x23c3('0x54'),_0x23c3('0x55')]);_0x402605[_0x23c3('0x5e')]=_0xb6734['id'];if(_0x389f13)_0x402605[_0x23c3('0x5f')]=_0x389f13;return _0x402605;})[_0x23c3('0x4c')](function(_0x1a1aec){return db[_0x23c3('0x60')]['create'](_0x1a1aec,{'include':[{'model':db[_0x23c3('0x61')],'as':_0x23c3('0x5f')}],'raw':!![],'transaction':_0x29a881});});})['then'](function(){return _0xb6734;});}});});});}})['then'](respondWithResult(_0x49a182,0xc9))['catch'](handleError(_0x49a182,null));};exports[_0x23c3('0x2a')]=function(_0xdc0fa2,_0x57a668){if(_0xdc0fa2['body']['id']){delete _0xdc0fa2[_0x23c3('0x50')]['id'];}return db[_0x23c3('0x48')]['find']({'where':{'id':_0xdc0fa2['params']['id']}})[_0x23c3('0x4c')](handleEntityNotFound(_0x57a668,null))[_0x23c3('0x4c')](saveUpdates(_0xdc0fa2[_0x23c3('0x50')],null))[_0x23c3('0x4c')](respondWithResult(_0x57a668,null))[_0x23c3('0x4d')](handleError(_0x57a668,null));};exports[_0x23c3('0x2b')]=function(_0x282984,_0x2b959a){return db[_0x23c3('0x48')][_0x23c3('0x62')]({'where':{'id':_0x282984['params']['id']}})['then'](handleEntityNotFound(_0x2b959a,null))['then'](removeEntity(_0x2b959a,null))['catch'](handleError(_0x2b959a,null));};exports[_0x23c3('0x63')]=function(_0x46631e,_0xc9ce5f){return db[_0x23c3('0x48')][_0x23c3('0x63')]()[_0x23c3('0x4c')](respondWithResult(_0xc9ce5f,null))[_0x23c3('0x4d')](handleError(_0xc9ce5f,null));};exports['addSections']=function(_0x1fc2e1,_0x3a6b84){var _0x4bccd1=_0x1fc2e1[_0x23c3('0x50')];return db['UserProfile'][_0x23c3('0x62')]({'where':{'id':_0x1fc2e1[_0x23c3('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a6b84,null))[_0x23c3('0x4c')](function(_0x4a17bf){if(_0x4a17bf){return db[_0x23c3('0x57')]['transaction'](function(_0x398e2d){return db[_0x23c3('0x60')]['destroy']({'where':{'userProfileId':_0x1fc2e1[_0x23c3('0x52')]['id'],'sectionId':_['map'](_0x4bccd1,function(_0x14e441){return _0x14e441[_0x23c3('0x5c')];})},'transaction':_0x398e2d})[_0x23c3('0x4c')](function(){var _0x2ff83f=_[_0x23c3('0x35')](_0x4bccd1,function(_0x16a4d){_0x16a4d[_0x23c3('0x5e')]=_0x1fc2e1[_0x23c3('0x52')]['id'];return _0x16a4d;});var _0xe20942=[];return BPromise[_0x23c3('0x5a')](_0x2ff83f,function(_0x209369){return db[_0x23c3('0x60')]['create'](_0x209369,{'include':[{'model':db[_0x23c3('0x61')],'as':_0x23c3('0x5f')}],'raw':!![],'transaction':_0x398e2d})[_0x23c3('0x4c')](function(_0x42225f){_0xe20942[_0x23c3('0x64')](_0x42225f['get']({'plain':!![]}));});})[_0x23c3('0x4c')](function(){return _0xe20942;});});});}})[_0x23c3('0x4c')](function(_0x1a7437){return _0x1a7437;})[_0x23c3('0x4c')](respondWithResult(_0x3a6b84,null))[_0x23c3('0x4d')](handleError(_0x3a6b84,null));};exports[_0x23c3('0x65')]=function(_0x19fc55,_0x2ae60e){var _0x2834c1;return db[_0x23c3('0x48')][_0x23c3('0x62')]({'where':{'id':_0x19fc55['params']['id']},'attributes':['id','name']})[_0x23c3('0x4c')](handleEntityNotFound(_0x2ae60e,null))[_0x23c3('0x4c')](function(_0x32098d){if(_0x32098d){_0x2834c1=_0x32098d;return db['UserProfileSection'][_0x23c3('0x2b')]({'where':{'userProfileId':_0x19fc55[_0x23c3('0x52')]['id'],'sectionId':_0x19fc55['query'][_0x23c3('0x66')]}});}})[_0x23c3('0x4c')](function(){return _0x2834c1;})[_0x23c3('0x4c')](respondWithStatusCode(_0x2ae60e,null))[_0x23c3('0x4d')](handleError(_0x2ae60e,null));};exports[_0x23c3('0x67')]=function(_0x4fb289,_0x48d1dc){var _0x3da3db=[];var _0x38a152=[];return db[_0x23c3('0x60')][_0x23c3('0x59')]({'where':{'userProfileId':_0x4fb289['params']['id']},'raw':!![]})['then'](function(_0x5b4041){_0x3da3db=_[_0x23c3('0x43')](_0x5b4041,function(_0x1dc0ef){return _0x1dc0ef[_0x23c3('0x68')]===0x1||_['includes']([0x3eb,0x709],_0x1dc0ef[_0x23c3('0x5c')]);});if(!_[_0x23c3('0x69')](_0x3da3db)){return _[_0x23c3('0x35')](_0x3da3db,function(_0x241978){return _0x241978['sectionId'];});}else{return;}})['then'](function(_0x13924c){if(_0x13924c)_0x38a152=_0x13924c;if(_['includes'](_0x38a152,0x64)){var _0x280bdf=_[_0x23c3('0x62')](_0x3da3db,{'sectionId':0x64});return hasDefaultDashboard(_0x280bdf)['then'](function(_0x343461){return _[_0x23c3('0x35')](_0x3da3db,function(_0x1f39bd){if(_0x1f39bd['sectionId']===0x64){_0x1f39bd['subsections']=_0x343461;}return _0x1f39bd;});});}else{return;}})[_0x23c3('0x4c')](function(_0x2d5ac2){if(_0x2d5ac2)_0x3da3db=_0x2d5ac2;if(_['includes'](_0x38a152,0x3eb)){var _0x3c74e0=_['find'](_0x3da3db,{'sectionId':0x3eb});return getCustomDashboards(_0x3c74e0)['then'](function(_0x5132f7){return _[_0x23c3('0x35')](_0x3da3db,function(_0x4ec854){if(_0x3c74e0[_0x23c3('0x68')]){if(_0x4ec854[_0x23c3('0x5c')]===0x3eb){_0x4ec854[_0x23c3('0x6a')]=_0x5132f7;}}else{if(_0x4ec854[_0x23c3('0x5c')]===0x64){_0x4ec854['subsections']=_0x5132f7;}}return _0x4ec854;});});}else{return;}})[_0x23c3('0x4c')](function(_0x12d39a){if(_0x12d39a)_0x3da3db=_0x12d39a;if(_['includes'](_0x38a152,0x709)){var _0x376e4e=_[_0x23c3('0x62')](_0x3da3db,{'sectionId':0x709});return getPlugins(_0x376e4e)[_0x23c3('0x4c')](function(_0x33928d){if(_0x376e4e[_0x23c3('0x68')]){return _[_0x23c3('0x35')](_0x3da3db,function(_0x8b6aca){if(_0x8b6aca[_0x23c3('0x5c')]===0x709){_0x8b6aca[_0x23c3('0x6a')]=_0x33928d;}return _0x8b6aca;});}else{var _0x162388={'sectionId':0x76c,'enabled':0x1,'subsections':_0x33928d};var _0x4dac2c=_[_0x23c3('0x35')](_0x3da3db);_0x4dac2c[_0x23c3('0x64')](_0x162388);return _0x4dac2c;}});}else{return;}})['then'](function(_0x5c9506){if(_0x5c9506)_0x3da3db=_0x5c9506;return _[_0x23c3('0x43')](_0x3da3db,[_0x23c3('0x68'),0x1]);})['then'](respondWithResult(_0x48d1dc,null))[_0x23c3('0x4d')](handleError(_0x48d1dc,null));};function hasDefaultDashboard(_0x3f969e){var _0x351e17=[0x65];return new BPromise(function(_0x7167d0,_0x35f166){try{if(_0x3f969e['autoAssociation']){_0x7167d0(_0x351e17);}else{return db['UserProfileResource'][_0x23c3('0x6b')]({'where':{'sectionId':_0x3f969e['id']},'raw':!![]})[_0x23c3('0x4c')](function(_0x3ec4af){_0x3ec4af?_0x7167d0(_0x351e17):_0x7167d0();});}}catch(_0x125846){_0x35f166(_0x125846);}});}function getCustomDashboards(_0x65a9f6){var _0x599f30=[];return new BPromise(function(_0x3560cb,_0xe3a164){try{if(_0x65a9f6[_0x23c3('0x5b')]){return db[_0x23c3('0x6c')][_0x23c3('0x59')]({'raw':!![]})['then'](function(_0x2358cc){_0x2358cc[_0x23c3('0x6d')](function(_0x385c09){_0x599f30[_0x23c3('0x64')](_0x385c09['id']+0x1869f);});_0x3560cb(_0x599f30);});}else{return db['UserProfileResource'][_0x23c3('0x59')]({'where':{'sectionId':_0x65a9f6['id']},'raw':!![]})[_0x23c3('0x4c')](function(_0x5a7f08){_0x5a7f08[_0x23c3('0x6d')](function(_0x31169c){_0x599f30['push'](_0x31169c[_0x23c3('0x6e')]+0x1869f);});_0x3560cb(_0x599f30);});}}catch(_0xf34f22){_0xe3a164(_0xf34f22);}});}function getPlugins(_0x15c5c4){var _0x5665ad=[];return new BPromise(function(_0x2fa763,_0x509f0d){try{if(_0x15c5c4['autoAssociation']){return db[_0x23c3('0x6f')][_0x23c3('0x59')]({'raw':!![]})[_0x23c3('0x4c')](function(_0x44e19d){_0x44e19d[_0x23c3('0x6d')](function(_0x3aad3e){_0x5665ad[_0x23c3('0x64')](_0x3aad3e['id']+0x15b38);});_0x2fa763(_0x5665ad);});}else{return db[_0x23c3('0x61')][_0x23c3('0x59')]({'where':{'sectionId':_0x15c5c4['id']},'raw':!![]})[_0x23c3('0x4c')](function(_0x418092){_0x418092['forEach'](function(_0x1c2d15){_0x5665ad['push'](_0x1c2d15[_0x23c3('0x6e')]+0x15b38);});_0x2fa763(_0x5665ad);});}}catch(_0x2e4ebf){_0x509f0d(_0x2e4ebf);}});}exports[_0x23c3('0x70')]=function(_0x1d7cb7,_0x27103b){return db['UserProfile'][_0x23c3('0x62')]({'where':{'id':_0x1d7cb7[_0x23c3('0x52')]['id']}})[_0x23c3('0x4c')](handleEntityNotFound(_0x27103b,null))['then'](function(_0x38f1b2){if(_0x38f1b2){return db['sequelize']['transaction'](function(_0x50c0c4){return db[_0x23c3('0x60')][_0x23c3('0x59')]({'where':{'userProfileId':_0x1d7cb7[_0x23c3('0x52')]['id']},'attributes':['id'],'raw':!![]})[_0x23c3('0x4c')](function(_0x1677ec){if(_0x1677ec){return db['UserProfileSection'][_0x23c3('0x2b')]({'where':{'userProfileId':_0x1d7cb7[_0x23c3('0x52')]['id'],'id':_[_0x23c3('0x35')](_0x1677ec,function(_0x5e9c53){return _0x5e9c53['id'];})},'transaction':_0x50c0c4});}})[_0x23c3('0x4c')](function(_0x157957){var _0x2042e7=_[_0x23c3('0x35')](_0x1d7cb7['body'],function(_0x150713){_0x150713[_0x23c3('0x5e')]=_0x1d7cb7[_0x23c3('0x52')]['id'];return _0x150713;});return db[_0x23c3('0x60')][_0x23c3('0x71')](_0x2042e7,{'raw':!![],'transaction':_0x50c0c4});})[_0x23c3('0x4c')](function(_0xadf06c){var _0x5abc41=_[_0x23c3('0x43')](_[_0x23c3('0x35')](_0xadf06c,function(_0x2c79fe){return _0x2c79fe[_0x23c3('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x5abc41){return db['UserProfileSection'][_0x23c3('0x59')]({'where':{'userProfileId':_0x1d7cb7[_0x23c3('0x52')]['id'],'sectionId':_['map'](_0x5abc41,function(_0x42fb48){return _0x42fb48['sectionId'];})},'attributes':['id',_0x23c3('0x5c')],'raw':!![]})['then'](function(_0x2833db){var _0x57c2c1=_[_0x23c3('0x35')](_0x1d7cb7[_0x23c3('0x50')],function(_0x5c23f1){_0x5c23f1[_0x23c3('0x5e')]=_0x1d7cb7[_0x23c3('0x52')]['id'];return _0x5c23f1;});return db[_0x23c3('0x61')][_0x23c3('0x71')](_0x57c2c1,{'raw':!![],'transaction':_0x50c0c4});});}})['catch'](handleError(_0x27103b,null));});}})['then'](function(_0x45d096){var _0x53ba12=_['map'](_0x45d096,function(_0x5a198b){return _0x5a198b[_0x23c3('0x53')]({'plain':!![]});});})[_0x23c3('0x4c')](respondWithResult(_0x27103b,null))[_0x23c3('0x4d')](handleError(_0x27103b,null));};exports[_0x23c3('0x72')]=function(_0x1f22cb,_0x525fa6,_0x1f47fe){return db[_0x23c3('0x48')][_0x23c3('0x62')]({'where':{'id':_0x1f22cb['params']['id']}})['then'](handleEntityNotFound(_0x525fa6,null))[_0x23c3('0x4c')](function(_0x386eb9){if(_0x386eb9){return _0x386eb9[_0x23c3('0x72')](_0x1f22cb[_0x23c3('0x36')][_0x23c3('0x66')]);}})[_0x23c3('0x4c')](respondWithStatusCode(_0x525fa6,null))[_0x23c3('0x4d')](handleError(_0x525fa6,null));};exports['getResources']=function(_0x56a3e7,_0x58104c){var _0x5d7e73={};if(!_0x56a3e7[_0x23c3('0x36')][_0x23c3('0x73')])throw new Error(_0x23c3('0x74'));if(!_0x56a3e7[_0x23c3('0x36')]['hasOwnProperty'](_0x23c3('0x75'))){_0x5d7e73['limit']=qs[_0x23c3('0x3d')](_0x56a3e7[_0x23c3('0x36')][_0x23c3('0x3d')]);_0x5d7e73['offset']=qs[_0x23c3('0x22')](_0x56a3e7[_0x23c3('0x36')][_0x23c3('0x22')]);}return db[_0x23c3('0x48')][_0x23c3('0x62')]({'where':{'id':_0x56a3e7[_0x23c3('0x52')]['id']}})[_0x23c3('0x4c')](function(_0x297689){if(!_0x297689)throw new Error(_0x23c3('0x76')+_0x56a3e7[_0x23c3('0x52')]['id']);return db[_0x23c3('0x48')]['getResources'](_0x56a3e7);})[_0x23c3('0x4c')](respondWithFilteredResult(_0x58104c,_0x5d7e73))[_0x23c3('0x4d')](handleError(_0x58104c,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f48419e..13e0fc5 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 _0x6829=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','update','remove'];(function(_0x6da433,_0x38cf77){var _0x214d4d=function(_0x1e0a77){while(--_0x1e0a77){_0x6da433['push'](_0x6da433['shift']());}};_0x214d4d(++_0x38cf77);}(_0x6829,0x14c));var _0x9682=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x6829[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require(_0x9682('0x0'));var UserProfile=require(_0x9682('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9682('0x2'),'afterDestroy':_0x9682('0x3')};function emitEvent(_0x1bfe61){return function(_0x3b8d4a,_0x3b721e,_0x1b0e5f){UserProfileEvents[_0x9682('0x4')](_0x1bfe61+':'+_0x3b8d4a['id'],_0x3b8d4a);UserProfileEvents[_0x9682('0x4')](_0x1bfe61,_0x3b8d4a);_0x1b0e5f(null);};}for(var e in events){if(events[_0x9682('0x5')](e)){var event=events[e];UserProfile[_0x9682('0x6')](e,emitEvent(event));}}module[_0x9682('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x8a9a=['UserProfile','setMaxListeners','save','update','remove','emit','hook','../../mysqldb'];(function(_0x2c2b35,_0x2b15a8){var _0x59d5c9=function(_0x1e0ed8){while(--_0x1e0ed8){_0x2c2b35['push'](_0x2c2b35['shift']());}};_0x59d5c9(++_0x2b15a8);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x8a9a[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa8a9('0x0'))['db'][_0xa8a9('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa8a9('0x2')](0x0);var events={'afterCreate':_0xa8a9('0x3'),'afterUpdate':_0xa8a9('0x4'),'afterDestroy':_0xa8a9('0x5')};function emitEvent(_0x2d782d){return function(_0x9570dc,_0x3fcb8c,_0xe5e64b){UserProfileEvents[_0xa8a9('0x6')](_0x2d782d+':'+_0x9570dc['id'],_0x9570dc);UserProfileEvents[_0xa8a9('0x6')](_0x2d782d,_0x9570dc);_0xe5e64b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xa8a9('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index cc00be7..72bb650 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 _0x6d38=['inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','type','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','telephones','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','triggers','Trigger','trunks','variables','Variable','extractedreports','AnalyticExtractedReport','Reports','reportId','charAt','toUpperCase','slice','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','query','OpenTabs','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','union','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','DefaultReports','custom','count','rows','Tags','color','tag','openTabs','true','dataValues','sms','fax','mail','./userProfile.attributes','../../components/parsers/qs','squel','filter','value','findAll','then','map','catch','field','model','associatedResources','name','resolve','UserProfileResource','resourceId','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','FaxQueue','faxaccounts','FaxAccount'];(function(_0x3baead,_0x426fb6){var _0x410e60=function(_0x3313fa){while(--_0x3313fa){_0x3baead['push'](_0x3baead['shift']());}};_0x410e60(++_0x426fb6);}(_0x6d38,0x1ef));var _0x86d3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6d38[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var attributes=require(_0x86d3('0x0'));var qs=require(_0x86d3('0x1'));var squel=require(_0x86d3('0x2'));module['exports']=function(_0x5c0b77){var _0xd1c7c=_0x5c0b77['models'];function _0xe9198a(_0x455b9d,_0x2501dd){return new Promise(function(_0x4ef557,_0x2d8272){if(!_0x2501dd)return _0x4ef557(null);var _0xfbbc15=_0x2501dd[_0x86d3('0x3')]?{[_0x2501dd[_0x86d3('0x3')]['field']]:_0x2501dd['filter'][_0x86d3('0x4')]}:undefined;return _0xd1c7c[_0x455b9d][_0x86d3('0x5')]({'where':_0xfbbc15,'raw':!![]})[_0x86d3('0x6')](function(_0x499640){_0x2501dd['associatedResources']=_[_0x86d3('0x7')](_0x499640,'id');_0x4ef557(_0x2501dd);})[_0x86d3('0x8')](function(_0x49b436){_0x2d8272(_0x49b436);});});}function _0x5606eb(_0x4300e2,_0x4dc834){return new Promise(function(_0x4f216c,_0x9fd6e8){var _0x5e9606=_0x4300e2[_0x86d3('0x3')]?{[_0x4300e2[_0x86d3('0x3')][_0x86d3('0x9')]]:_0x4300e2[_0x86d3('0x3')][_0x86d3('0x4')]}:undefined;return _0xd1c7c[_0x4300e2[_0x86d3('0xa')]][_0x86d3('0x5')]({'where':_0x5e9606,'raw':!![]})[_0x86d3('0x6')](function(_0x5ce2ff){_0x4dc834[_0x86d3('0xb')]=_[_0x86d3('0x7')](_0x5ce2ff,function(_0x356e7d){return _0x356e7d[_0x86d3('0xc')];});_0x4f216c(_0x4dc834);})[_0x86d3('0x8')](function(_0x34fb3b){_0x9fd6e8(_0x34fb3b);});});}function _0x1ff008(_0x44436d,_0x53b437,_0x2d5ba9){if(!_0x53b437)return Promise[_0x86d3('0xd')](null);return new Promise(function(_0x431b3f,_0xa26ea2){return _0xd1c7c[_0x86d3('0xe')][_0x86d3('0x5')]({'where':{'sectionId':_0x53b437['id']},'raw':!![]})[_0x86d3('0x6')](function(_0x32dee7){if(_0x44436d[_0x86d3('0x9')]&&_0x44436d['field']!=='id'){_0x53b437[_0x86d3('0xb')]=_['map'](_0x32dee7,function(_0x6ced9e){return _0x6ced9e[_0x44436d['field']];});}else{if(_0x2d5ba9==='AnalyticExtractedReport'){_0x53b437[_0x86d3('0xb')]=_[_0x86d3('0x7')](_0x32dee7,function(_0x988066){return{'id':_0x988066[_0x86d3('0xf')],'type':_0x988066['type']};});}else{_0x53b437[_0x86d3('0xb')]=_['map'](_0x32dee7,function(_0x36e0fa){return _0x36e0fa[_0x86d3('0xf')];});}}_0x431b3f(_0x53b437);})[_0x86d3('0x8')](function(_0x5b990d){_0xa26ea2(_0x5b990d);});});}function _0x39d819(_0x72b3d4,_0x1fa4ac){var _0x4bf5b8={'parentSections':[]};switch(_0x72b3d4['toLowerCase']()){case _0x86d3('0x10'):_0x4bf5b8['childModel']=_0x86d3('0x11');break;case _0x86d3('0x12'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x14');break;case'squarerecordings':_0x4bf5b8['childModel']=_0x86d3('0x15');_0x4bf5b8[_0x86d3('0x16')]=[{'name':'SquareProjects','field':_0x86d3('0xc'),'foreignKey':'projectName'}];break;case _0x86d3('0x17'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x18');break;case _0x86d3('0x19'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x1a');_0x4bf5b8[_0x86d3('0x16')]=[{'name':_0x86d3('0x1b'),'field':'id','foreignKey':_0x86d3('0x1c')}];break;case _0x86d3('0x1d'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x1e');break;case _0x86d3('0x1f'):_0x4bf5b8[_0x86d3('0x13')]='CmCompany';break;case _0x86d3('0x20'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x21');break;case _0x86d3('0x22'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x23');break;case'chatwebsites':_0x4bf5b8[_0x86d3('0x13')]='ChatWebsite';break;case'faxqueues':_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x24');break;case _0x86d3('0x25'):_0x4bf5b8['childModel']=_0x86d3('0x26');break;case _0x86d3('0x27'):case'internalroutes':case _0x86d3('0x28'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x29');break;case _0x86d3('0x2a'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x2b');break;case _0x86d3('0x2c'):_0x4bf5b8[_0x86d3('0x13')]='VoiceMail';break;case'voicerecordings':_0x4bf5b8['childModel']=_0x86d3('0x2d');_0x4bf5b8['parentSections']=[{'name':_0x86d3('0x2e'),'field':'name','foreignKey':_0x86d3('0x2f'),'model':_0x86d3('0x30'),'filter':{'field':_0x86d3('0x31'),'value':[_0x86d3('0x32')]}},{'name':_0x86d3('0x33'),'field':_0x86d3('0xc'),'foreignKey':_0x86d3('0x2f'),'model':'User','filter':{'field':_0x86d3('0x31'),'value':[_0x86d3('0x34')]}},{'name':'VoiceQueues','field':_0x86d3('0xc'),'foreignKey':_0x86d3('0x35'),'model':_0x86d3('0x36'),'filter':{'field':_0x86d3('0x37'),'value':['inbound']}},{'name':_0x86d3('0x38'),'field':_0x86d3('0xc'),'foreignKey':_0x86d3('0x35'),'model':'VoiceQueue','filter':{'field':_0x86d3('0x37'),'value':[_0x86d3('0x39')]}}];break;case _0x86d3('0x3a'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x3b');break;case _0x86d3('0x3c'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x3d');break;case'voiceprefixes':_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x3e');break;case _0x86d3('0x3f'):_0x4bf5b8[_0x86d3('0x13')]='Campaign';break;case _0x86d3('0x40'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x41');break;case _0x86d3('0x42'):_0x4bf5b8['childModel']='MailAccount';break;case _0x86d3('0x43'):_0x4bf5b8['childModel']='MailSubstatus';break;case _0x86d3('0x44'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x45');break;case _0x86d3('0x46'):_0x4bf5b8[_0x86d3('0x13')]='OpenchannelAccount';break;case _0x86d3('0x47'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x48');break;case'smsaccounts':_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x49');break;case'whatsappqueues':_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x4a');break;case'whatsappaccounts':_0x4bf5b8['childModel']='WhatsappAccount';break;case _0x86d3('0x4b'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x4c');break;case _0x86d3('0x4d'):case _0x86d3('0x4e'):_0x4bf5b8[_0x86d3('0x13')]='VoiceQueue';if(_0x1fa4ac){_0x4bf5b8[_0x86d3('0x16')]=[{'name':_0x86d3('0x4f')},{'name':'QueueCampaigns'}];}break;case _0x86d3('0x50'):case _0x86d3('0x51'):case _0x86d3('0x52'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x30');if(_0x1fa4ac){_0x4bf5b8[_0x86d3('0x16')]=[{'name':'Users','filter':{'field':_0x86d3('0x31'),'value':[_0x86d3('0x53'),'user']},'ignore':!![]},{'name':_0x86d3('0x2e')},{'name':_0x86d3('0x33')}];}break;case _0x86d3('0x54'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x55');break;case'salesforceaccounts':_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x56');break;case _0x86d3('0x57'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x58');break;case _0x86d3('0x59'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x5a');break;case _0x86d3('0x5b'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x5c');break;case _0x86d3('0x5d'):_0x4bf5b8['childModel']=_0x86d3('0x5e');break;case _0x86d3('0x5f'):_0x4bf5b8['childModel']=_0x86d3('0x30');break;case _0x86d3('0x60'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x61');break;case _0x86d3('0x62'):_0x4bf5b8[_0x86d3('0x13')]='Disposition';break;case'customdashboards':_0x4bf5b8['childModel']='Dashboard';break;case _0x86d3('0x63'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x64');break;case _0x86d3('0x65'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x66');break;case _0x86d3('0x67'):_0x4bf5b8['childModel']=_0x86d3('0x68');break;case _0x86d3('0x69'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x6a');break;case _0x86d3('0x6b'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x6c');break;case'templates':_0x4bf5b8[_0x86d3('0x13')]='Template';break;case _0x86d3('0x6d'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x6e');break;case _0x86d3('0x6f'):_0x4bf5b8[_0x86d3('0x13')]='Trunk';break;case _0x86d3('0x70'):_0x4bf5b8[_0x86d3('0x13')]=_0x86d3('0x71');break;case'plugins':_0x4bf5b8['childModel']='Plugin';break;case _0x86d3('0x72'):_0x4bf5b8['childModel']=_0x86d3('0x73');_0x4bf5b8[_0x86d3('0x16')]=[{'name':_0x86d3('0x74'),'field':'id','foreignKey':_0x86d3('0x75')}];break;case'metrics':_0x4bf5b8['childModel']='AnalyticMetric';break;}return _0x4bf5b8;}function _0x28655a(_0x100588,_0x5a7b69){var _0x3561c5=_0x100588[_0x86d3('0x76')](0x0)[_0x86d3('0x77')]()+_0x100588[_0x86d3('0x78')](0x1);var _0x3fdce3={'type':_0xd1c7c['Sequelize'][_0x86d3('0x79')][_0x86d3('0x7a')],'raw':!![]};return new Promise(function(_0x462e96,_0x3c038b){var _0x49a277=squel[_0x86d3('0x7b')]()[_0x86d3('0x9')]('ui.'+_0x3561c5+_0x86d3('0x7c'),'id')[_0x86d3('0x9')](_0x86d3('0x7d'))[_0x86d3('0x7e')](_0x86d3('0x7f')+_0x100588+_0x86d3('0x80'),'ui')[_0x86d3('0x81')]('ui.UserId\x20=\x20?',_0x5a7b69['id']);return _0xd1c7c['sequelize'][_0x86d3('0x82')](_0x49a277['toString'](),_0x3fdce3)['then'](function(_0x58e4b6){_0x5a7b69[_0x3561c5+_0x86d3('0x83')]=_0x58e4b6;_0x462e96(_0x58e4b6);})['catch'](function(_0x254ac3){_0x3c038b(_0x254ac3);});});}return _0x5c0b77['define'](_0x86d3('0x84'),attributes,{'tableName':_0x86d3('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xa48003){var _0x4797b5={'raw':![],'where':{}};var _0x4c3e66={};var _0x4639bb={'count':0x0,'rows':[]};var _0xf2c179=_0xa48003[_0x86d3('0x82')][_0x86d3('0x86')];var _0x22d8eb=_0xa48003[_0x86d3('0x82')][_0x86d3('0x87')]||![];var _0x27b8f6=_0x39d819(_0xf2c179,_0x22d8eb);if(!_0x27b8f6[_0x86d3('0x13')])throw new Error(_0x86d3('0x88')+_0xf2c179+'\x27');var _0x1e3479=[{'name':_0xf2c179}];if(!_[_0x86d3('0x89')](_0x27b8f6[_0x86d3('0x16')]))_0x1e3479=_0x27b8f6[_0x86d3('0x16')];var _0x3f978c=[];for(var _0x5e1835=0x0;_0x5e1835<_0x1e3479[_0x86d3('0x8a')];_0x5e1835++){_0x3f978c[_0x86d3('0x8b')](_0xd1c7c['UserProfileSection'][_0x86d3('0x8c')]({'where':{'userProfileId':_0xa48003[_0x86d3('0x8d')]['id'],'name':_0x1e3479[_0x5e1835][_0x86d3('0xc')]},'raw':!![]}));}return Promise['all'](_0x3f978c)[_0x86d3('0x6')](function(_0x307baf){var _0x45e8d9=_[_0x86d3('0x3')](_0x307baf,function(_0x48f9d4){return _0x48f9d4?_0x48f9d4:undefined;});var _0x41d448=_['filter'](_0x1e3479,[_0x86d3('0x8e'),!![]]);var _0x42bb6f=_[_0x86d3('0x89')](_0x45e8d9)&&_[_0x86d3('0x89')](_0x41d448)?null:_[_0x86d3('0x8f')](_0x41d448,_0x45e8d9);if(!_0x42bb6f)return null;var _0x56fd96=[];for(var _0x3cc1d8=0x0;_0x3cc1d8<_0x42bb6f['length'];_0x3cc1d8++){var _0x1ddd6d=_[_0x86d3('0x8c')](_0x1e3479,function(_0x5866fe){return _0x42bb6f[_0x3cc1d8]?_0x5866fe[_0x86d3('0xc')]===_0x42bb6f[_0x3cc1d8][_0x86d3('0xc')]:null;});if(_0x1ddd6d){if(_0x42bb6f[_0x3cc1d8][_0x86d3('0x8e')]){_0x56fd96[_0x86d3('0x8b')](_0xe9198a(_0x27b8f6[_0x86d3('0x13')],_0x42bb6f[_0x3cc1d8]));}else{if(!_0x42bb6f[_0x3cc1d8][_0x86d3('0x90')]){_0x56fd96[_0x86d3('0x8b')](_0x1ff008(_0x1ddd6d,_0x42bb6f[_0x3cc1d8],_0x27b8f6['childModel']));}else{if(_0x1ddd6d[_0x86d3('0xa')]){_0x56fd96[_0x86d3('0x8b')](_0x5606eb(_0x1ddd6d,_0x42bb6f[_0x3cc1d8]));}}}}}return Promise[_0x86d3('0x91')](_0x56fd96);})[_0x86d3('0x6')](function(_0x46e356){var _0x47f72e=_0x46e356;var _0x2e995e=null;if(_0x47f72e){_0x2e995e=_0x47f72e[_0x86d3('0x8a')]===0x1?_0x47f72e[0x0]:null;}if(!_0x2e995e&&!_0x47f72e)return _0x4639bb;var _0x4f99ca=_0xd1c7c[_0x27b8f6[_0x86d3('0x13')]][_0x86d3('0x92')];_0x4c3e66[_0x86d3('0xa')]=_[_0x86d3('0x93')](_0x4f99ca);_0x4c3e66[_0x86d3('0x82')]=_[_0x86d3('0x93')](_0xa48003[_0x86d3('0x82')]);_0x4c3e66[_0x86d3('0x94')]=_[_0x86d3('0x95')](_0x4c3e66[_0x86d3('0xa')],_0x4c3e66[_0x86d3('0x82')]);_0x4797b5[_0x86d3('0x96')]=_[_0x86d3('0x95')](_0x4c3e66[_0x86d3('0xa')],qs['fields'](_0xa48003[_0x86d3('0x82')][_0x86d3('0x97')]));_0x4797b5[_0x86d3('0x96')]=_0x4797b5[_0x86d3('0x96')]['length']?_0x4797b5[_0x86d3('0x96')]:_0x4c3e66[_0x86d3('0xa')];if(!_0xa48003[_0x86d3('0x82')][_0x86d3('0x98')]('nolimit')){_0x4797b5['limit']=qs[_0x86d3('0x99')](_0xa48003['query'][_0x86d3('0x99')]);_0x4797b5['offset']=qs['offset'](_0xa48003[_0x86d3('0x82')][_0x86d3('0x9a')]);}_0x4797b5[_0x86d3('0x9b')]=qs[_0x86d3('0x9c')](_0xa48003[_0x86d3('0x82')]['sort']);_0x4797b5[_0x86d3('0x81')]=qs[_0x86d3('0x94')](_['pick'](_0xa48003[_0x86d3('0x82')],_0x4c3e66[_0x86d3('0x94')]));if(_0xa48003['query'][_0x86d3('0x3')]){_0x4797b5['where']=_[_0x86d3('0x9d')](_0x4797b5['where'],{'$or':_['map'](_0x4f99ca,function(_0x2eb5d2){if(_0x2eb5d2['type'][_0x86d3('0x9e')]!==_0x86d3('0x9f')){var _0xc84385={};_0xc84385[_0x2eb5d2[_0x86d3('0x9')]]={'$like':'%'+_0xa48003[_0x86d3('0x82')][_0x86d3('0x3')]+'%'};return _0xc84385;}})});}var _0x268c93=[];var _0x3b989c=null;var _0x566a91={};if(_0x2e995e){_0x3b989c=_[_0x86d3('0x8c')](_0x1e3479,[_0x86d3('0xc'),_0x2e995e[_0x86d3('0xc')]]);if(_0x3b989c[_0x86d3('0x9')]){_0x566a91={};if(_0x27b8f6[_0x86d3('0x13')]==='AnalyticExtractedReport'){_0x566a91[_0x3b989c[_0x86d3('0xa0')]]=_[_0x86d3('0x7')](_0x2e995e[_0x86d3('0xb')],'id');}else{_0x566a91[_0x3b989c[_0x86d3('0xa0')]]=_0x2e995e[_0x86d3('0xb')];}_0x268c93[_0x86d3('0x8b')](_0x566a91);}else{_0x4797b5[_0x86d3('0x81')]['id']=_0x2e995e['associatedResources'];}}else{for(var _0x44ced5=0x0;_0x44ced5<_0x47f72e['length'];_0x44ced5++){_0x3b989c=_[_0x86d3('0x8c')](_0x1e3479,['name',_0x47f72e[_0x44ced5]['name']]);if(_0x3b989c[_0x86d3('0x9')]){_0x566a91={};_0x566a91[_0x3b989c[_0x86d3('0xa0')]]=_0x47f72e[_0x44ced5]['associatedResources'];_0x268c93[_0x86d3('0x8b')](_0x566a91);}else{if(!_0x4797b5[_0x86d3('0x81')]['id'])_0x4797b5[_0x86d3('0x81')]['id']=[];_0x47f72e[_0x44ced5][_0x86d3('0xb')][_0x86d3('0xa1')](function(_0x11d8c7){_0x4797b5[_0x86d3('0x81')]['id']['push'](_0x11d8c7);});}}}if(!_['isEmpty'](_0x268c93)){_0x4797b5[_0x86d3('0x81')]=_[_0x86d3('0x9d')](_0x4797b5[_0x86d3('0x81')],{'$and':{'$or':_0x268c93}});}_0x4797b5=_[_0x86d3('0x9d')]({},_0x4797b5,_0xa48003[_0x86d3('0xa2')]);if(_0x2e995e&&!_0x2e995e[_0x86d3('0x90')]&&_0x27b8f6['childModel']===_0x86d3('0x73')){if(_0xa48003[_0x86d3('0x82')][_0x86d3('0xa3')]){_0x4797b5[_0x86d3('0xa4')]=[{'all':!![]}];}return _0xd1c7c[_0x27b8f6[_0x86d3('0x13')]][_0x86d3('0x5')](_0x4797b5)[_0x86d3('0x6')](function(_0x2a9b06){var _0x15dfa1=[];_0x2a9b06['forEach'](function(_0x2fe326){var _0x458526;switch(_0x2fe326['reportType']){case'default':_0x458526=_[_0x86d3('0x8c')](_0x2e995e[_0x86d3('0xb')],function(_0x682a6d){return _0x682a6d['id']===_0x2fe326['reportId']&&_0x682a6d[_0x86d3('0x37')]===_0x86d3('0xa5');});break;case _0x86d3('0xa6'):_0x458526=_[_0x86d3('0x8c')](_0x2e995e[_0x86d3('0xb')],function(_0x49d0c9){return _0x49d0c9['id']===_0x2fe326[_0x86d3('0x75')]&&_0x49d0c9[_0x86d3('0x37')]==='CustomReports';});break;}if(_0x458526)_0x15dfa1[_0x86d3('0x8b')](_0x2fe326);});_0x4639bb[_0x86d3('0xa7')]=_0x15dfa1[_0x86d3('0x8a')];_0x4639bb[_0x86d3('0xa8')]=_0x15dfa1;return _0x4639bb;});}else{return _0xd1c7c[_0x27b8f6['childModel']][_0x86d3('0xa7')]({'where':_0x4797b5[_0x86d3('0x81')]})[_0x86d3('0x6')](function(_0x18295c){_0x4639bb[_0x86d3('0xa7')]=_0x18295c;if(_0xa48003['query'][_0x86d3('0xa3')]){if(_0x27b8f6[_0x86d3('0x13')]===_0x86d3('0x1a')){_0x4797b5[_0x86d3('0xa4')]=[{'model':_0xd1c7c[_0x86d3('0x6c')],'as':_0x86d3('0xa9'),'attributes':['id',_0x86d3('0xc'),_0x86d3('0xaa')],'required':_0xa48003[_0x86d3('0x82')][_0x86d3('0xab')]?!![]:![]},{'model':_0xd1c7c['Tag'],'as':'ThroughTags','attributes':['id',_0x86d3('0xc'),_0x86d3('0xaa')],'through':_0xa48003['query'][_0x86d3('0xab')]?{'attributes':[],'where':{'TagId':_0xa48003[_0x86d3('0x82')][_0x86d3('0xab')]||undefined}}:{},'required':_0xa48003[_0x86d3('0x82')][_0x86d3('0xab')]?!![]:![]}];}else{_0x4797b5[_0x86d3('0xa4')]=[{'all':!![]}];}}return _0xd1c7c[_0x27b8f6[_0x86d3('0x13')]][_0x86d3('0x5')](_0x4797b5);})[_0x86d3('0x6')](function(_0x49e8bc){_0x4639bb['rows']=_0x49e8bc;if(_0xf2c179==='Agents'&&_0xa48003['query'][_0x86d3('0xac')]===_0x86d3('0xad')){var _0x28a509=[];for(var _0x3d2b13=0x0;_0x3d2b13<_0x4639bb[_0x86d3('0xa8')][_0x86d3('0x8a')];_0x3d2b13++){_0x28a509[_0x86d3('0x8b')](_0x28655a('chat',_0x4639bb[_0x86d3('0xa8')][_0x3d2b13][_0x86d3('0xae')]));_0x28a509[_0x86d3('0x8b')](_0x28655a(_0x86d3('0xaf'),_0x4639bb['rows'][_0x3d2b13][_0x86d3('0xae')]));_0x28a509['push'](_0x28655a(_0x86d3('0xb0'),_0x4639bb[_0x86d3('0xa8')][_0x3d2b13][_0x86d3('0xae')]));_0x28a509[_0x86d3('0x8b')](_0x28655a(_0x86d3('0xb1'),_0x4639bb['rows'][_0x3d2b13]['dataValues']));_0x28a509[_0x86d3('0x8b')](_0x28655a('openchannel',_0x4639bb[_0x86d3('0xa8')][_0x3d2b13]['dataValues']));_0x28a509[_0x86d3('0x8b')](_0x28655a('whatsapp',_0x4639bb['rows'][_0x3d2b13][_0x86d3('0xae')]));}return Promise[_0x86d3('0x91')](_0x28a509)[_0x86d3('0x6')](function(){return _0x4639bb;});}return _0x4639bb;});}});}}});}; \ No newline at end of file +var _0x4bd3=['key','foreignKey','where','forEach','options','includeAll','include','custom','CustomReports','count','rows','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','fax','mail','all','lodash','../../components/parsers/qs','squel','models','filter','value','findAll','then','associatedResources','catch','field','model','resolve','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','agent','Telephones','name','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','voicequeues','users','agents','telephones','admin','user','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','Dashboard','Pause','sounds','tags','Tag','templates','Template','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','section','mergeResources','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge'];(function(_0x310ef0,_0x24725a){var _0x2c048b=function(_0x4c6ca4){while(--_0x4c6ca4){_0x310ef0['push'](_0x310ef0['shift']());}};_0x2c048b(++_0x24725a);}(_0x4bd3,0x174));var _0x34bd=function(_0x4e379a,_0x10b368){_0x4e379a=_0x4e379a-0x0;var _0x109c5a=_0x4bd3[_0x4e379a];return _0x109c5a;};'use strict';var _=require(_0x34bd('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x34bd('0x1'));var squel=require(_0x34bd('0x2'));module['exports']=function(_0x4997bc){var _0x4cad21=_0x4997bc[_0x34bd('0x3')];function _0x44854a(_0x1fc8eb,_0x5846f3){return new Promise(function(_0x2133c5,_0x2a15a2){if(!_0x5846f3)return _0x2133c5(null);var _0x5c2a7a=_0x5846f3[_0x34bd('0x4')]?{[_0x5846f3[_0x34bd('0x4')]['field']]:_0x5846f3[_0x34bd('0x4')][_0x34bd('0x5')]}:undefined;return _0x4cad21[_0x1fc8eb][_0x34bd('0x6')]({'where':_0x5c2a7a,'raw':!![]})[_0x34bd('0x7')](function(_0x1ac77f){_0x5846f3[_0x34bd('0x8')]=_['map'](_0x1ac77f,'id');_0x2133c5(_0x5846f3);})[_0x34bd('0x9')](function(_0x45322f){_0x2a15a2(_0x45322f);});});}function _0x282ea6(_0x7c7992,_0x501b7f){return new Promise(function(_0x4a8622,_0x3da7a0){var _0x5e4ce7=_0x7c7992['filter']?{[_0x7c7992[_0x34bd('0x4')][_0x34bd('0xa')]]:_0x7c7992[_0x34bd('0x4')][_0x34bd('0x5')]}:undefined;return _0x4cad21[_0x7c7992[_0x34bd('0xb')]][_0x34bd('0x6')]({'where':_0x5e4ce7,'raw':!![]})[_0x34bd('0x7')](function(_0x236f6b){_0x501b7f[_0x34bd('0x8')]=_['map'](_0x236f6b,function(_0x3fa6a8){return _0x3fa6a8['name'];});_0x4a8622(_0x501b7f);})['catch'](function(_0x6638ed){_0x3da7a0(_0x6638ed);});});}function _0x30b3f2(_0x280c1a,_0x2dc917,_0x34b91b){if(!_0x2dc917)return Promise[_0x34bd('0xc')](null);return new Promise(function(_0xd39d72,_0x1c12e8){return _0x4cad21[_0x34bd('0xd')][_0x34bd('0x6')]({'where':{'sectionId':_0x2dc917['id']},'raw':!![]})[_0x34bd('0x7')](function(_0x48d2ba){if(_0x280c1a[_0x34bd('0xa')]&&_0x280c1a[_0x34bd('0xa')]!=='id'){_0x2dc917[_0x34bd('0x8')]=_[_0x34bd('0xe')](_0x48d2ba,function(_0x3976e4){return _0x3976e4[_0x280c1a[_0x34bd('0xa')]];});}else{if(_0x34b91b===_0x34bd('0xf')){_0x2dc917[_0x34bd('0x8')]=_[_0x34bd('0xe')](_0x48d2ba,function(_0x55538e){return{'id':_0x55538e[_0x34bd('0x10')],'type':_0x55538e[_0x34bd('0x11')]};});}else{_0x2dc917[_0x34bd('0x8')]=_[_0x34bd('0xe')](_0x48d2ba,function(_0x463224){return _0x463224['resourceId'];});}}_0xd39d72(_0x2dc917);})['catch'](function(_0x5da62a){_0x1c12e8(_0x5da62a);});});}function _0x4edf84(_0x3dafe8,_0x503a60){var _0x10fc4b={'parentSections':[]};switch(_0x3dafe8[_0x34bd('0x12')]()){case _0x34bd('0x13'):_0x10fc4b['childModel']=_0x34bd('0x14');break;case _0x34bd('0x15'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x17');break;case'squarerecordings':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x18');_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x1a'),'field':'name','foreignKey':_0x34bd('0x1b')}];break;case _0x34bd('0x1c'):_0x10fc4b['childModel']=_0x34bd('0x1d');break;case _0x34bd('0x1e'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x1f');_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x20'),'field':'id','foreignKey':_0x34bd('0x21')}];break;case'lists':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x22');break;case'companies':_0x10fc4b['childModel']=_0x34bd('0x23');break;case _0x34bd('0x24'):_0x10fc4b[_0x34bd('0x16')]='CmCustomField';break;case'chatqueues':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x25');break;case _0x34bd('0x26'):_0x10fc4b[_0x34bd('0x16')]='ChatWebsite';break;case _0x34bd('0x27'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x28');break;case _0x34bd('0x29'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x2a');break;case'inboundroutes':case _0x34bd('0x2b'):case'outboundroutes':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x2c');break;case _0x34bd('0x2d'):_0x10fc4b['childModel']=_0x34bd('0x2e');break;case _0x34bd('0x2f'):_0x10fc4b['childModel']=_0x34bd('0x30');break;case _0x34bd('0x31'):_0x10fc4b[_0x34bd('0x16')]='VoiceRecording';_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x32'),'field':'name','foreignKey':_0x34bd('0x33'),'model':_0x34bd('0x34'),'filter':{'field':_0x34bd('0x35'),'value':[_0x34bd('0x36')]}},{'name':_0x34bd('0x37'),'field':_0x34bd('0x38'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x34bd('0x39')]}},{'name':_0x34bd('0x3a'),'field':'name','foreignKey':'queue','model':_0x34bd('0x3b'),'filter':{'field':'type','value':['inbound']}},{'name':_0x34bd('0x3c'),'field':_0x34bd('0x38'),'foreignKey':_0x34bd('0x3d'),'model':_0x34bd('0x3b'),'filter':{'field':_0x34bd('0x11'),'value':['outbound']}}];break;case'musiconholds':_0x10fc4b[_0x34bd('0x16')]='VoiceMusicOnHold';break;case _0x34bd('0x3e'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x3f');break;case _0x34bd('0x40'):_0x10fc4b[_0x34bd('0x16')]='VoicePrefix';break;case _0x34bd('0x41'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x42');break;case _0x34bd('0x43'):_0x10fc4b['childModel']=_0x34bd('0x44');break;case'mailaccounts':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x45');break;case'mailsubstatuses':_0x10fc4b[_0x34bd('0x16')]='MailSubstatus';break;case _0x34bd('0x46'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x47');break;case _0x34bd('0x48'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x49');break;case _0x34bd('0x4a'):_0x10fc4b['childModel']='SmsQueue';break;case'smsaccounts':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x4b');break;case _0x34bd('0x4c'):_0x10fc4b[_0x34bd('0x16')]='WhatsappQueue';break;case _0x34bd('0x4d'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x4e');break;case _0x34bd('0x4f'):_0x10fc4b[_0x34bd('0x16')]='Team';break;case _0x34bd('0x50'):case'queuecampaigns':_0x10fc4b['childModel']=_0x34bd('0x3b');if(_0x503a60){_0x10fc4b['parentSections']=[{'name':_0x34bd('0x3a')},{'name':_0x34bd('0x3c')}];}break;case _0x34bd('0x51'):case _0x34bd('0x52'):case _0x34bd('0x53'):_0x10fc4b['childModel']='User';if(_0x503a60){_0x10fc4b[_0x34bd('0x19')]=[{'name':'Users','filter':{'field':_0x34bd('0x35'),'value':[_0x34bd('0x54'),_0x34bd('0x55')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x10fc4b['childModel']=_0x34bd('0x56');break;case'salesforceaccounts':_0x10fc4b[_0x34bd('0x16')]='SalesforceAccount';break;case _0x34bd('0x57'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x58');break;case _0x34bd('0x59'):_0x10fc4b[_0x34bd('0x16')]='SugarcrmAccount';break;case _0x34bd('0x5a'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x5b');break;case _0x34bd('0x5c'):_0x10fc4b[_0x34bd('0x16')]='ZohoAccount';break;case _0x34bd('0x5d'):_0x10fc4b[_0x34bd('0x16')]='User';break;case _0x34bd('0x5e'):_0x10fc4b[_0x34bd('0x16')]='CannedAnswer';break;case'dispositions':_0x10fc4b[_0x34bd('0x16')]='Disposition';break;case'customdashboards':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x5f');break;case'intervals':_0x10fc4b['childModel']='Interval';break;case'pauses':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x60');break;case'scheduler':_0x10fc4b['childModel']='Schedule';break;case _0x34bd('0x61'):_0x10fc4b[_0x34bd('0x16')]='Sound';break;case _0x34bd('0x62'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x63');break;case _0x34bd('0x64'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x65');break;case'triggers':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x66');break;case _0x34bd('0x67'):_0x10fc4b[_0x34bd('0x16')]='Trunk';break;case _0x34bd('0x68'):_0x10fc4b['childModel']=_0x34bd('0x69');break;case'plugins':_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x6a');break;case _0x34bd('0x6b'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0xf');_0x10fc4b[_0x34bd('0x19')]=[{'name':_0x34bd('0x6c'),'field':'id','foreignKey':_0x34bd('0x6d')}];break;case _0x34bd('0x6e'):_0x10fc4b[_0x34bd('0x16')]=_0x34bd('0x6f');break;}return _0x10fc4b;}function _0x5ddb03(_0x2e232f,_0x55f72e){var _0x15fea7=_0x2e232f['charAt'](0x0)[_0x34bd('0x70')]()+_0x2e232f['slice'](0x1);var _0x1d85d0={'type':_0x4cad21[_0x34bd('0x71')][_0x34bd('0x72')][_0x34bd('0x73')],'raw':!![]};return new Promise(function(_0x3ebbf2,_0x34dbcc){var _0x109fce=squel[_0x34bd('0x74')]()[_0x34bd('0xa')](_0x34bd('0x75')+_0x15fea7+_0x34bd('0x76'),'id')[_0x34bd('0xa')](_0x34bd('0x77'))[_0x34bd('0x78')](_0x34bd('0x79')+_0x2e232f+'_interactions','ui')['where'](_0x34bd('0x7a'),_0x55f72e['id']);return _0x4cad21[_0x34bd('0x7b')][_0x34bd('0x7c')](_0x109fce[_0x34bd('0x7d')](),_0x1d85d0)[_0x34bd('0x7')](function(_0x5d4833){_0x55f72e[_0x15fea7+'OpenTabs']=_0x5d4833;_0x3ebbf2(_0x5d4833);})['catch'](function(_0x49f095){_0x34dbcc(_0x49f095);});});}return _0x4997bc[_0x34bd('0x7e')](_0x34bd('0x7f'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x163935){var _0xfa0814={'raw':![],'where':{}};var _0x13db71={};var _0x583590={'count':0x0,'rows':[]};var _0x40b148=_0x163935[_0x34bd('0x7c')][_0x34bd('0x80')];var _0x344be3=_0x163935[_0x34bd('0x7c')][_0x34bd('0x81')]||![];var _0x310bac=_0x4edf84(_0x40b148,_0x344be3);if(!_0x310bac[_0x34bd('0x16')])throw new Error('Invalid\x20section\x20\x27'+_0x40b148+'\x27');var _0x5e239f=[{'name':_0x40b148}];if(!_[_0x34bd('0x82')](_0x310bac['parentSections']))_0x5e239f=_0x310bac[_0x34bd('0x19')];var _0x4762d9=[];for(var _0x2ae5e4=0x0;_0x2ae5e4<_0x5e239f['length'];_0x2ae5e4++){_0x4762d9['push'](_0x4cad21[_0x34bd('0x83')][_0x34bd('0x84')]({'where':{'userProfileId':_0x163935[_0x34bd('0x85')]['id'],'name':_0x5e239f[_0x2ae5e4]['name']},'raw':!![]}));}return Promise['all'](_0x4762d9)[_0x34bd('0x7')](function(_0x8d929e){var _0x32c61f=_[_0x34bd('0x4')](_0x8d929e,function(_0x29b588){return _0x29b588?_0x29b588:undefined;});var _0x34c9bc=_[_0x34bd('0x4')](_0x5e239f,[_0x34bd('0x86'),!![]]);var _0x31bedd=_['isEmpty'](_0x32c61f)&&_['isEmpty'](_0x34c9bc)?null:_[_0x34bd('0x87')](_0x34c9bc,_0x32c61f);if(!_0x31bedd)return null;var _0x4fab21=[];for(var _0x2b9bc3=0x0;_0x2b9bc3<_0x31bedd[_0x34bd('0x88')];_0x2b9bc3++){var _0x1639de=_[_0x34bd('0x84')](_0x5e239f,function(_0x4a5e55){return _0x31bedd[_0x2b9bc3]?_0x4a5e55['name']===_0x31bedd[_0x2b9bc3][_0x34bd('0x38')]:null;});if(_0x1639de){if(_0x31bedd[_0x2b9bc3][_0x34bd('0x86')]){_0x4fab21[_0x34bd('0x89')](_0x44854a(_0x310bac['childModel'],_0x31bedd[_0x2b9bc3]));}else{if(!_0x31bedd[_0x2b9bc3][_0x34bd('0x8a')]){_0x4fab21['push'](_0x30b3f2(_0x1639de,_0x31bedd[_0x2b9bc3],_0x310bac[_0x34bd('0x16')]));}else{if(_0x1639de[_0x34bd('0xb')]){_0x4fab21[_0x34bd('0x89')](_0x282ea6(_0x1639de,_0x31bedd[_0x2b9bc3]));}}}}}return Promise['all'](_0x4fab21);})[_0x34bd('0x7')](function(_0x5c6898){var _0x5d96b9=_0x5c6898;var _0x3cf4c3=null;if(_0x5d96b9){_0x3cf4c3=_0x5d96b9[_0x34bd('0x88')]===0x1?_0x5d96b9[0x0]:null;}if(!_0x3cf4c3&&!_0x5d96b9)return _0x583590;var _0x29a259=_0x4cad21[_0x310bac['childModel']][_0x34bd('0x8b')];_0x13db71[_0x34bd('0xb')]=_[_0x34bd('0x8c')](_0x29a259);_0x13db71['query']=_[_0x34bd('0x8c')](_0x163935[_0x34bd('0x7c')]);_0x13db71[_0x34bd('0x8d')]=_[_0x34bd('0x8e')](_0x13db71[_0x34bd('0xb')],_0x13db71[_0x34bd('0x7c')]);_0xfa0814[_0x34bd('0x8f')]=_[_0x34bd('0x8e')](_0x13db71[_0x34bd('0xb')],qs[_0x34bd('0x90')](_0x163935[_0x34bd('0x7c')]['fields']));_0xfa0814[_0x34bd('0x8f')]=_0xfa0814['attributes'][_0x34bd('0x88')]?_0xfa0814['attributes']:_0x13db71[_0x34bd('0xb')];if(!_0x163935[_0x34bd('0x7c')][_0x34bd('0x91')](_0x34bd('0x92'))){_0xfa0814[_0x34bd('0x93')]=qs[_0x34bd('0x93')](_0x163935[_0x34bd('0x7c')][_0x34bd('0x93')]);_0xfa0814[_0x34bd('0x94')]=qs[_0x34bd('0x94')](_0x163935['query']['offset']);}_0xfa0814[_0x34bd('0x95')]=qs[_0x34bd('0x96')](_0x163935[_0x34bd('0x7c')]['sort']);_0xfa0814['where']=qs['filters'](_[_0x34bd('0x97')](_0x163935[_0x34bd('0x7c')],_0x13db71[_0x34bd('0x8d')]));if(_0x163935[_0x34bd('0x7c')][_0x34bd('0x4')]){_0xfa0814['where']=_[_0x34bd('0x98')](_0xfa0814['where'],{'$or':_[_0x34bd('0xe')](_0x29a259,function(_0x34b7ea){if(_0x34b7ea['type'][_0x34bd('0x99')]!=='VIRTUAL'){var _0x242093={};_0x242093[_0x34b7ea['field']]={'$like':'%'+_0x163935[_0x34bd('0x7c')]['filter']+'%'};return _0x242093;}})});}var _0x397396=[];var _0x38f6f2=null;var _0x3506da={};if(_0x3cf4c3){_0x38f6f2=_[_0x34bd('0x84')](_0x5e239f,[_0x34bd('0x38'),_0x3cf4c3[_0x34bd('0x38')]]);if(_0x38f6f2[_0x34bd('0xa')]){_0x3506da={};if(_0x310bac[_0x34bd('0x16')]==='AnalyticExtractedReport'){_0x3506da[_0x38f6f2[_0x34bd('0x9a')]]=_[_0x34bd('0xe')](_0x3cf4c3[_0x34bd('0x8')],'id');}else{_0x3506da[_0x38f6f2['foreignKey']]=_0x3cf4c3['associatedResources'];}_0x397396['push'](_0x3506da);}else{_0xfa0814[_0x34bd('0x9b')]['id']=_0x3cf4c3[_0x34bd('0x8')];}}else{for(var _0x56935e=0x0;_0x56935e<_0x5d96b9[_0x34bd('0x88')];_0x56935e++){_0x38f6f2=_['find'](_0x5e239f,[_0x34bd('0x38'),_0x5d96b9[_0x56935e][_0x34bd('0x38')]]);if(_0x38f6f2[_0x34bd('0xa')]){_0x3506da={};_0x3506da[_0x38f6f2['foreignKey']]=_0x5d96b9[_0x56935e][_0x34bd('0x8')];_0x397396['push'](_0x3506da);}else{if(!_0xfa0814[_0x34bd('0x9b')]['id'])_0xfa0814[_0x34bd('0x9b')]['id']=[];_0x5d96b9[_0x56935e][_0x34bd('0x8')][_0x34bd('0x9c')](function(_0x1fe8cc){_0xfa0814[_0x34bd('0x9b')]['id'][_0x34bd('0x89')](_0x1fe8cc);});}}}if(!_[_0x34bd('0x82')](_0x397396)){_0xfa0814[_0x34bd('0x9b')]=_[_0x34bd('0x98')](_0xfa0814[_0x34bd('0x9b')],{'$and':{'$or':_0x397396}});}_0xfa0814=_[_0x34bd('0x98')]({},_0xfa0814,_0x163935[_0x34bd('0x9d')]);if(_0x3cf4c3&&!_0x3cf4c3[_0x34bd('0x8a')]&&_0x310bac['childModel']===_0x34bd('0xf')){if(_0x163935[_0x34bd('0x7c')][_0x34bd('0x9e')]){_0xfa0814[_0x34bd('0x9f')]=[{'all':!![]}];}return _0x4cad21[_0x310bac[_0x34bd('0x16')]]['findAll'](_0xfa0814)[_0x34bd('0x7')](function(_0x1d4259){var _0x14b45a=[];_0x1d4259[_0x34bd('0x9c')](function(_0x59708f){var _0x2b838a;switch(_0x59708f['reportType']){case'default':_0x2b838a=_['find'](_0x3cf4c3['associatedResources'],function(_0x325f8a){return _0x325f8a['id']===_0x59708f[_0x34bd('0x6d')]&&_0x325f8a[_0x34bd('0x11')]==='DefaultReports';});break;case _0x34bd('0xa0'):_0x2b838a=_[_0x34bd('0x84')](_0x3cf4c3[_0x34bd('0x8')],function(_0x2b27c7){return _0x2b27c7['id']===_0x59708f[_0x34bd('0x6d')]&&_0x2b27c7[_0x34bd('0x11')]===_0x34bd('0xa1');});break;}if(_0x2b838a)_0x14b45a[_0x34bd('0x89')](_0x59708f);});_0x583590[_0x34bd('0xa2')]=_0x14b45a[_0x34bd('0x88')];_0x583590[_0x34bd('0xa3')]=_0x14b45a;return _0x583590;});}else{return _0x4cad21[_0x310bac['childModel']]['count']({'where':_0xfa0814[_0x34bd('0x9b')]})['then'](function(_0xbe3d9c){_0x583590[_0x34bd('0xa2')]=_0xbe3d9c;if(_0x163935[_0x34bd('0x7c')][_0x34bd('0x9e')]){if(_0x310bac[_0x34bd('0x16')]===_0x34bd('0x1f')){_0xfa0814[_0x34bd('0x9f')]=[{'model':_0x4cad21[_0x34bd('0x63')],'as':'Tags','attributes':['id',_0x34bd('0x38'),_0x34bd('0xa4')],'required':_0x163935[_0x34bd('0x7c')]['tag']?!![]:![]},{'model':_0x4cad21[_0x34bd('0x63')],'as':_0x34bd('0xa5'),'attributes':['id',_0x34bd('0x38'),_0x34bd('0xa4')],'through':_0x163935['query'][_0x34bd('0xa6')]?{'attributes':[],'where':{'TagId':_0x163935[_0x34bd('0x7c')][_0x34bd('0xa6')]||undefined}}:{},'required':_0x163935[_0x34bd('0x7c')][_0x34bd('0xa6')]?!![]:![]}];}else{_0xfa0814[_0x34bd('0x9f')]=[{'all':!![]}];}}return _0x4cad21[_0x310bac[_0x34bd('0x16')]][_0x34bd('0x6')](_0xfa0814);})[_0x34bd('0x7')](function(_0x3b95f6){_0x583590['rows']=_0x3b95f6;if(_0x40b148===_0x34bd('0x32')&&_0x163935[_0x34bd('0x7c')][_0x34bd('0xa7')]===_0x34bd('0xa8')){var _0x2f7caf=[];for(var _0x38752d=0x0;_0x38752d<_0x583590[_0x34bd('0xa3')][_0x34bd('0x88')];_0x38752d++){_0x2f7caf[_0x34bd('0x89')](_0x5ddb03(_0x34bd('0xa9'),_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03(_0x34bd('0xab'),_0x583590['rows'][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf['push'](_0x5ddb03(_0x34bd('0xac'),_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03(_0x34bd('0xad'),_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03('openchannel',_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));_0x2f7caf[_0x34bd('0x89')](_0x5ddb03('whatsapp',_0x583590[_0x34bd('0xa3')][_0x38752d][_0x34bd('0xaa')]));}return Promise[_0x34bd('0xae')](_0x2f7caf)[_0x34bd('0x7')](function(){return _0x583590;});}return _0x583590;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index ca0a840..ab2ac6a 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 _0x9219=['http','redis','defaults','localhost','socket.io-emitter','then','info','UserProfile,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x9219,0x19e));var _0x9921=function(_0x171c54,_0x12c217){_0x171c54=_0x171c54-0x0;var _0x3602bf=_0x9219[_0x171c54];return _0x3602bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9921('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9921('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x9921('0x2'));var jayson=require(_0x9921('0x3'));var client=jayson['client'][_0x9921('0x4')]({'port':0x232a});config[_0x9921('0x5')]=_[_0x9921('0x6')](config[_0x9921('0x5')],{'host':_0x9921('0x7'),'port':0x18eb});var socket=require(_0x9921('0x8'))(new Redis(config[_0x9921('0x5')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x5c6b6f,_0x2ac547,_0x4b975c){return new BPromise(function(_0x122f00,_0x591e9a){return client['request'](_0x5c6b6f,_0x4b975c)[_0x9921('0x9')](function(_0x168c4a){logger[_0x9921('0xa')](_0x9921('0xb'),_0x2ac547,'request\x20sent');logger[_0x9921('0xc')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2ac547,'request\x20sent',JSON[_0x9921('0xd')](_0x168c4a));if(_0x168c4a[_0x9921('0xe')]){if(_0x168c4a['error'][_0x9921('0xf')]===0x1f4){logger[_0x9921('0xe')]('UserProfile,\x20%s,\x20%s',_0x2ac547,_0x168c4a[_0x9921('0xe')][_0x9921('0x10')]);return _0x591e9a(_0x168c4a[_0x9921('0xe')]['message']);}logger[_0x9921('0xe')](_0x9921('0xb'),_0x2ac547,_0x168c4a[_0x9921('0xe')]['message']);return _0x122f00(_0x168c4a[_0x9921('0xe')][_0x9921('0x10')]);}else{logger[_0x9921('0xa')](_0x9921('0xb'),_0x2ac547,'request\x20sent');_0x122f00(_0x168c4a[_0x9921('0x11')][_0x9921('0x10')]);}})[_0x9921('0x12')](function(_0x55f82c){logger[_0x9921('0xe')](_0x9921('0xb'),_0x2ac547,_0x55f82c);_0x591e9a(_0x55f82c);});});} \ No newline at end of file +var _0x073d=['message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x431bd2,_0x1cdba3){var _0x3c4804=function(_0x5a80ef){while(--_0x5a80ef){_0x431bd2['push'](_0x431bd2['shift']());}};_0x3c4804(++_0x1cdba3);}(_0x073d,0xd2));var _0xd073=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0x073d[_0x15106b];return _0x521203;};'use strict';var _=require('lodash');var util=require(_0xd073('0x0'));var moment=require(_0xd073('0x1'));var BPromise=require(_0xd073('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd073('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd073('0x4'));var logger=require(_0xd073('0x5'))('rpc');var config=require(_0xd073('0x6'));var jayson=require(_0xd073('0x7'));var client=jayson[_0xd073('0x8')][_0xd073('0x9')]({'port':0x232a});config[_0xd073('0xa')]=_[_0xd073('0xb')](config[_0xd073('0xa')],{'host':_0xd073('0xc'),'port':0x18eb});var socket=require(_0xd073('0xd'))(new Redis(config[_0xd073('0xa')]));require(_0xd073('0xe'))[_0xd073('0xf')](socket);function respondWithRpcPromise(_0x238d31,_0x3f1fc6,_0x5c916e){return new BPromise(function(_0x53abea,_0xf39d94){return client['request'](_0x238d31,_0x5c916e)[_0xd073('0x10')](function(_0xf3f0f0){logger[_0xd073('0x11')](_0xd073('0x12'),_0x3f1fc6,_0xd073('0x13'));logger['debug'](_0xd073('0x14'),_0x3f1fc6,_0xd073('0x13'),JSON[_0xd073('0x15')](_0xf3f0f0));if(_0xf3f0f0[_0xd073('0x16')]){if(_0xf3f0f0['error'][_0xd073('0x17')]===0x1f4){logger[_0xd073('0x16')]('UserProfile,\x20%s,\x20%s',_0x3f1fc6,_0xf3f0f0[_0xd073('0x16')][_0xd073('0x18')]);return _0xf39d94(_0xf3f0f0[_0xd073('0x16')][_0xd073('0x18')]);}logger['error'](_0xd073('0x12'),_0x3f1fc6,_0xf3f0f0['error']['message']);return _0x53abea(_0xf3f0f0[_0xd073('0x16')][_0xd073('0x18')]);}else{logger[_0xd073('0x11')]('UserProfile,\x20%s,\x20%s',_0x3f1fc6,_0xd073('0x13'));_0x53abea(_0xf3f0f0[_0xd073('0x19')][_0xd073('0x18')]);}})['catch'](function(_0x194db8){logger[_0xd073('0x16')](_0xd073('0x12'),_0x3f1fc6,_0x194db8);_0xf39d94(_0x194db8);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index f159a96..6ff4ba9 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 _0x33cc=['remove','emit','removeListener','register','length','userProfile:','save'];(function(_0x469fa4,_0x2766c9){var _0x5d16be=function(_0x207d93){while(--_0x207d93){_0x469fa4['push'](_0x469fa4['shift']());}};_0x5d16be(++_0x2766c9);}(_0x33cc,0x125));var _0xc33c=function(_0x425ea8,_0x41f7ad){_0x425ea8=_0x425ea8-0x0;var _0x51ee0f=_0x33cc[_0x425ea8];return _0x51ee0f;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc33c('0x0'),_0xc33c('0x1'),'update'];function createListener(_0x4c3874,_0xa5a478){return function(_0xb5697b){_0xa5a478[_0xc33c('0x2')](_0x4c3874,_0xb5697b);};}function removeListener(_0x10fa50,_0x402c63){return function(){UserProfileEvents[_0xc33c('0x3')](_0x10fa50,_0x402c63);};}exports[_0xc33c('0x4')]=function(_0x5ab5f9){for(var _0x476621=0x0,_0x21c644=events[_0xc33c('0x5')];_0x476621<_0x21c644;_0x476621++){var _0x4ab832=events[_0x476621];var _0x51142a=createListener(_0xc33c('0x6')+_0x4ab832,_0x5ab5f9);UserProfileEvents['on'](_0x4ab832,_0x51142a);}}; \ No newline at end of file +var _0xc0a8=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','length'];(function(_0x8462a1,_0x4a6f40){var _0x1187b9=function(_0x1f8368){while(--_0x1f8368){_0x8462a1['push'](_0x8462a1['shift']());}};_0x1187b9(++_0x4a6f40);}(_0xc0a8,0xb9));var _0x8c0a=function(_0x20b48b,_0x17c959){_0x20b48b=_0x20b48b-0x0;var _0xc97883=_0xc0a8[_0x20b48b];return _0xc97883;};'use strict';var UserProfileEvents=require(_0x8c0a('0x0'));var events=[_0x8c0a('0x1'),_0x8c0a('0x2'),_0x8c0a('0x3')];function createListener(_0x377019,_0x146a27){return function(_0x4d6ff8){_0x146a27[_0x8c0a('0x4')](_0x377019,_0x4d6ff8);};}function removeListener(_0xd1a17e,_0x133444){return function(){UserProfileEvents[_0x8c0a('0x5')](_0xd1a17e,_0x133444);};}exports['register']=function(_0x46eafe){for(var _0xbf1f0e=0x0,_0x4ed3ff=events[_0x8c0a('0x6')];_0xbf1f0e<_0x4ed3ff;_0xbf1f0e++){var _0x47b5fe=events[_0xbf1f0e];var _0x37d495=createListener(_0x8c0a('0x7')+_0x47b5fe,_0x46eafe);UserProfileEvents['on'](_0x47b5fe,_0x37d495);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 175688d..49e379a 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 _0xba11=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x5c8730,_0x1741bb){var _0x462a26=function(_0x3642d1){while(--_0x3642d1){_0x5c8730['push'](_0x5c8730['shift']());}};_0x462a26(++_0x1741bb);}(_0xba11,0x1db));var _0x1ba1=function(_0x5a4473,_0xf868f2){_0x5a4473=_0x5a4473-0x0;var _0x4016ca=_0xba11[_0x5a4473];return _0x4016ca;};'use strict';var multer=require(_0x1ba1('0x0'));var util=require(_0x1ba1('0x1'));var path=require(_0x1ba1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ba1('0x3'));var auth=require(_0x1ba1('0x4'));var interaction=require(_0x1ba1('0x5'));var config=require(_0x1ba1('0x6'));var controller=require(_0x1ba1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ba1('0x8')]);router[_0x1ba1('0x9')](_0x1ba1('0xa'),auth[_0x1ba1('0xb')](),controller[_0x1ba1('0xc')]);router[_0x1ba1('0x9')](_0x1ba1('0xd'),auth[_0x1ba1('0xb')](),controller[_0x1ba1('0xe')]);router['post']('/',auth[_0x1ba1('0xb')](),controller[_0x1ba1('0xf')]);router[_0x1ba1('0x10')](_0x1ba1('0xd'),auth[_0x1ba1('0xb')](),controller[_0x1ba1('0x11')]);router['delete'](_0x1ba1('0xd'),auth[_0x1ba1('0xb')](),controller[_0x1ba1('0x12')]);module[_0x1ba1('0x13')]=router; \ No newline at end of file +var _0x9c83=['fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','util','path','connect-timeout'];(function(_0x442f45,_0x1f03f0){var _0x50c2ed=function(_0x48436a){while(--_0x48436a){_0x442f45['push'](_0x442f45['shift']());}};_0x50c2ed(++_0x1f03f0);}(_0x9c83,0xd5));var _0x39c8=function(_0x28aa2c,_0x90302f){_0x28aa2c=_0x28aa2c-0x0;var _0x1576df=_0x9c83[_0x28aa2c];return _0x1576df;};'use strict';var multer=require('multer');var util=require(_0x39c8('0x0'));var path=require(_0x39c8('0x1'));var timeout=require(_0x39c8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x39c8('0x3'));var auth=require(_0x39c8('0x4'));var interaction=require(_0x39c8('0x5'));var config=require('../../config/environment');var controller=require(_0x39c8('0x6'));router[_0x39c8('0x7')]('/',auth[_0x39c8('0x8')](),controller['index']);router['get'](_0x39c8('0x9'),auth['isAuthenticated'](),controller[_0x39c8('0xa')]);router[_0x39c8('0x7')](_0x39c8('0xb'),auth['isAuthenticated'](),controller[_0x39c8('0xc')]);router[_0x39c8('0xd')]('/',auth[_0x39c8('0x8')](),controller[_0x39c8('0xe')]);router[_0x39c8('0xf')]('/:id',auth[_0x39c8('0x8')](),controller['update']);router[_0x39c8('0x10')]('/:id',auth[_0x39c8('0x8')](),controller['destroy']);module[_0x39c8('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e982524..1c14bd7 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 _0x0c6f=['exports','STRING','INTEGER','sequelize'];(function(_0x3c1309,_0x66e161){var _0x4b71bf=function(_0x46426e){while(--_0x46426e){_0x3c1309['push'](_0x3c1309['shift']());}};_0x4b71bf(++_0x66e161);}(_0x0c6f,0x18b));var _0xf0c6=function(_0x572522,_0x1d3a96){_0x572522=_0x572522-0x0;var _0x452953=_0x0c6f[_0x572522];return _0x452953;};'use strict';var Sequelize=require(_0xf0c6('0x0'));module[_0xf0c6('0x1')]={'name':{'type':Sequelize[_0xf0c6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf0c6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf0c6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb0f4=['STRING','INTEGER','sequelize','exports'];(function(_0x18bb55,_0x46fd1c){var _0x5320d5=function(_0x7c93de){while(--_0x7c93de){_0x18bb55['push'](_0x18bb55['shift']());}};_0x5320d5(++_0x46fd1c);}(_0xb0f4,0x132));var _0x4b0f=function(_0x525f77,_0x49069f){_0x525f77=_0x525f77-0x0;var _0x1e732d=_0xb0f4[_0x525f77];return _0x1e732d;};'use strict';var Sequelize=require(_0x4b0f('0x0'));module[_0x4b0f('0x1')]={'name':{'type':Sequelize[_0x4b0f('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4b0f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4b0f('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 22fe34b..2e63677 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 _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','UserProfileResource','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1ff1c3,_0x18581f){var _0x1c3fbb=function(_0x260c18){while(--_0x260c18){_0x1ff1c3['push'](_0x1ff1c3['shift']());}};_0x1c3fbb(++_0x18581f);}(_0xd117,0x182));var _0x7d11=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xd117[_0x5b5cde];return _0x364ad2;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['UserProfileResource'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));}; \ No newline at end of file +var _0x9582=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x4640c4,_0x5210a5){var _0x485acb=function(_0x168889){while(--_0x168889){_0x4640c4['push'](_0x4640c4['shift']());}};_0x485acb(++_0x5210a5);}(_0x9582,0x95));var _0x2958=function(_0x248d52,_0x4d25e4){_0x248d52=_0x248d52-0x0;var _0x4948fb=_0x9582[_0x248d52];return _0x4948fb;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));};exports[_0x2958('0x4b')]=function(_0x1db8b1,_0x534677){return db['UserProfileResource'][_0x2958('0x4b')]()[_0x2958('0x25')](respondWithResult(_0x534677,null))[_0x2958('0x44')](handleError(_0x534677,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 75fd35d..f107351 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 _0x161d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','sectionId'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x161d,0x10a));var _0xd161=function(_0x77f408,_0x417a68){_0x77f408=_0x77f408-0x0;var _0xf699c7=_0x161d[_0x77f408];return _0xf699c7;};'use strict';var _=require(_0xd161('0x0'));var util=require(_0xd161('0x1'));var logger=require(_0xd161('0x2'))(_0xd161('0x3'));var moment=require(_0xd161('0x4'));var BPromise=require(_0xd161('0x5'));var rp=require(_0xd161('0x6'));var fs=require('fs');var path=require(_0xd161('0x7'));var rimraf=require('rimraf');var config=require(_0xd161('0x8'));var attributes=require(_0xd161('0x9'));module[_0xd161('0xa')]=function(_0x46a8cc,_0x83d626){return _0x46a8cc[_0xd161('0xb')]('UserProfileResource',attributes,{'tableName':_0xd161('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xd161('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb323=['sectionId','lodash','util','api','moment','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xb323,0x79));var _0x3b32=function(_0x4e3fc4,_0x1b74ca){_0x4e3fc4=_0x4e3fc4-0x0;var _0x364db1=_0xb323[_0x4e3fc4];return _0x364db1;};'use strict';var _=require(_0x3b32('0x0'));var util=require(_0x3b32('0x1'));var logger=require('../../config/logger')(_0x3b32('0x2'));var moment=require(_0x3b32('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b32('0x4'));var rimraf=require(_0x3b32('0x5'));var config=require(_0x3b32('0x6'));var attributes=require(_0x3b32('0x7'));module[_0x3b32('0x8')]=function(_0x3e1766,_0x8ab47d){return _0x3e1766[_0x3b32('0x9')](_0x3b32('0xa'),attributes,{'tableName':_0x3b32('0xb'),'paranoid':![],'indexes':[{'name':_0x3b32('0xc'),'fields':[_0x3b32('0xd'),_0x3b32('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 5a61fed..0f0588f 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 _0x8ea8=['client','http','request','then','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x57b8b4,_0x5e3e78){var _0x3cb37a=function(_0x2a2fa1){while(--_0x2a2fa1){_0x57b8b4['push'](_0x57b8b4['shift']());}};_0x3cb37a(++_0x5e3e78);}(_0x8ea8,0x1c5));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x88ea('0x0'));var util=require(_0x88ea('0x1'));var moment=require(_0x88ea('0x2'));var BPromise=require(_0x88ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88ea('0x5'))(_0x88ea('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88ea('0x7')][_0x88ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45d874,_0x2fc6d7,_0x4940ef){return new BPromise(function(_0x379c0c,_0x4ffce4){return client[_0x88ea('0x9')](_0x45d874,_0x4940ef)[_0x88ea('0xa')](function(_0x4bf013){logger[_0x88ea('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x2fc6d7,_0x88ea('0xc'));logger['debug'](_0x88ea('0xd'),_0x2fc6d7,'request\x20sent',JSON[_0x88ea('0xe')](_0x4bf013));if(_0x4bf013['error']){if(_0x4bf013[_0x88ea('0xf')][_0x88ea('0x10')]===0x1f4){logger[_0x88ea('0xf')](_0x88ea('0x11'),_0x2fc6d7,_0x4bf013['error'][_0x88ea('0x12')]);return _0x4ffce4(_0x4bf013[_0x88ea('0xf')][_0x88ea('0x12')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x2fc6d7,_0x4bf013[_0x88ea('0xf')][_0x88ea('0x12')]);return _0x379c0c(_0x4bf013['error']['message']);}else{logger[_0x88ea('0xb')](_0x88ea('0x11'),_0x2fc6d7,'request\x20sent');_0x379c0c(_0x4bf013[_0x88ea('0x13')][_0x88ea('0x12')]);}})['catch'](function(_0x2816c0){logger[_0x88ea('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x2fc6d7,_0x2816c0);_0x4ffce4(_0x2816c0);});});} \ No newline at end of file +var _0x4e7c=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x583456,_0x10f8cc){var _0x542be5=function(_0x45e577){while(--_0x45e577){_0x583456['push'](_0x583456['shift']());}};_0x542be5(++_0x10f8cc);}(_0x4e7c,0x82));var _0xc4e7=function(_0x226aea,_0x78e3ed){_0x226aea=_0x226aea-0x0;var _0x229e93=_0x4e7c[_0x226aea];return _0x229e93;};'use strict';var _=require(_0xc4e7('0x0'));var util=require('util');var moment=require(_0xc4e7('0x1'));var BPromise=require(_0xc4e7('0x2'));var rs=require(_0xc4e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4e7('0x4'))['db'];var utils=require(_0xc4e7('0x5'));var logger=require(_0xc4e7('0x6'))(_0xc4e7('0x7'));var config=require(_0xc4e7('0x8'));var jayson=require(_0xc4e7('0x9'));var client=jayson[_0xc4e7('0xa')][_0xc4e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x598355,_0x555225,_0x3d862f){return new BPromise(function(_0x3b317f,_0x4b518a){return client['request'](_0x598355,_0x3d862f)[_0xc4e7('0xc')](function(_0x2bdf31){logger['info'](_0xc4e7('0xd'),_0x555225,'request\x20sent');logger['debug'](_0xc4e7('0xe'),_0x555225,_0xc4e7('0xf'),JSON['stringify'](_0x2bdf31));if(_0x2bdf31[_0xc4e7('0x10')]){if(_0x2bdf31[_0xc4e7('0x10')][_0xc4e7('0x11')]===0x1f4){logger['error'](_0xc4e7('0xd'),_0x555225,_0x2bdf31['error'][_0xc4e7('0x12')]);return _0x4b518a(_0x2bdf31[_0xc4e7('0x10')][_0xc4e7('0x12')]);}logger[_0xc4e7('0x10')](_0xc4e7('0xd'),_0x555225,_0x2bdf31[_0xc4e7('0x10')][_0xc4e7('0x12')]);return _0x3b317f(_0x2bdf31['error'][_0xc4e7('0x12')]);}else{logger['info'](_0xc4e7('0xd'),_0x555225,_0xc4e7('0xf'));_0x3b317f(_0x2bdf31[_0xc4e7('0x13')]['message']);}})[_0xc4e7('0x14')](function(_0x4e73c1){logger[_0xc4e7('0x10')](_0xc4e7('0xd'),_0x555225,_0x4e73c1);_0x4b518a(_0x4e73c1);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index fdc8694..32e3963 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 _0x26e7=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x114878,_0x12a6b2){var _0x2651f5=function(_0x55f0cf){while(--_0x55f0cf){_0x114878['push'](_0x114878['shift']());}};_0x2651f5(++_0x12a6b2);}(_0x26e7,0x10b));var _0x726e=function(_0x5e5b5e,_0x1d4bde){_0x5e5b5e=_0x5e5b5e-0x0;var _0x296489=_0x26e7[_0x5e5b5e];return _0x296489;};'use strict';var multer=require(_0x726e('0x0'));var util=require('util');var path=require(_0x726e('0x1'));var timeout=require(_0x726e('0x2'));var express=require(_0x726e('0x3'));var router=express[_0x726e('0x4')]();var fs_extra=require(_0x726e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x726e('0x6'));var config=require(_0x726e('0x7'));var controller=require(_0x726e('0x8'));router[_0x726e('0x9')]('/',auth['isAuthenticated'](),controller[_0x726e('0xa')]);router[_0x726e('0x9')](_0x726e('0xb'),auth[_0x726e('0xc')](),controller[_0x726e('0xd')]);router[_0x726e('0x9')](_0x726e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x726e('0xf')]('/',auth[_0x726e('0xc')](),controller[_0x726e('0x10')]);router[_0x726e('0x11')]('/:id',auth[_0x726e('0xc')](),controller[_0x726e('0x12')]);router[_0x726e('0x13')](_0x726e('0xe'),auth['isAuthenticated'](),controller[_0x726e('0x14')]);module[_0x726e('0x15')]=router; \ No newline at end of file +var _0xc811=['/:id','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','describe'];(function(_0x3748eb,_0x4dbd41){var _0x5493d7=function(_0x3bbfe9){while(--_0x3bbfe9){_0x3748eb['push'](_0x3748eb['shift']());}};_0x5493d7(++_0x4dbd41);}(_0xc811,0x1f3));var _0x1c81=function(_0x4f5122,_0x48748a){_0x4f5122=_0x4f5122-0x0;var _0x4d3cc6=_0xc811[_0x4f5122];return _0x4d3cc6;};'use strict';var multer=require('multer');var util=require(_0x1c81('0x0'));var path=require(_0x1c81('0x1'));var timeout=require(_0x1c81('0x2'));var express=require('express');var router=express[_0x1c81('0x3')]();var fs_extra=require(_0x1c81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c81('0x5'));var config=require(_0x1c81('0x6'));var controller=require(_0x1c81('0x7'));router[_0x1c81('0x8')]('/',auth[_0x1c81('0x9')](),controller['index']);router[_0x1c81('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1c81('0xa')]);router[_0x1c81('0x8')](_0x1c81('0xb'),auth[_0x1c81('0x9')](),controller['show']);router['post']('/',auth[_0x1c81('0x9')](),controller[_0x1c81('0xc')]);router[_0x1c81('0xd')](_0x1c81('0xb'),auth[_0x1c81('0x9')](),controller[_0x1c81('0xe')]);router['delete']('/:id',auth[_0x1c81('0x9')](),controller[_0x1c81('0xf')]);module[_0x1c81('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index ca160b1..a5bb7f1 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 _0xa478=['sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x4132f2,_0x1c1f28){var _0x43d8f4=function(_0x1cdc02){while(--_0x1cdc02){_0x4132f2['push'](_0x4132f2['shift']());}};_0x43d8f4(++_0x1c1f28);}(_0xa478,0x136));var _0x8a47=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xa478[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'name':{'type':Sequelize[_0x8a47('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x8a47('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8a47('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8a47('0x2')],'set':function(_0x2b3110){this[_0x8a47('0x5')](_0x8a47('0x6'),_0x2b3110?_0x2b3110[_0x8a47('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0x8a47('0x6'))?this[_0x8a47('0x8')](_0x8a47('0x6'))[_0x8a47('0x9')](''):[];}}}; \ No newline at end of file +var _0x6b20=['getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x3bdf22,_0x103fac){var _0x21d0bd=function(_0x3ef529){while(--_0x3ef529){_0x3bdf22['push'](_0x3bdf22['shift']());}};_0x21d0bd(++_0x103fac);}(_0x6b20,0xd1));var _0x06b2=function(_0x3622d2,_0x1b45f5){_0x3622d2=_0x3622d2-0x0;var _0x28fae9=_0x6b20[_0x3622d2];return _0x28fae9;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x06b2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x06b2('0x2')],'set':function(_0x5ba392){this[_0x06b2('0x4')](_0x06b2('0x5'),_0x5ba392?_0x5ba392[_0x06b2('0x6')](''):[]);},'get':function(){return this[_0x06b2('0x7')](_0x06b2('0x5'))?this[_0x06b2('0x7')](_0x06b2('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2cfa761..56246ea 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 _0x16b1=['show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','name','filter','options','includeAll','include','findAll','rows','catch'];(function(_0x42586a,_0x4f66d3){var _0x39f699=function(_0x41d7bc){while(--_0x41d7bc){_0x42586a['push'](_0x42586a['shift']());}};_0x39f699(++_0x4f66d3);}(_0x16b1,0x137));var _0x116b=function(_0x52adf8,_0x206cdd){_0x52adf8=_0x52adf8-0x0;var _0x15346e=_0x16b1[_0x52adf8];return _0x15346e;};'use strict';var emlformat=require(_0x116b('0x0'));var rimraf=require(_0x116b('0x1'));var zipdir=require(_0x116b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x116b('0x3'));var moment=require(_0x116b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x116b('0x5'));var util=require(_0x116b('0x6'));var path=require(_0x116b('0x7'));var sox=require(_0x116b('0x8'));var csv=require('to-csv');var ejs=require(_0x116b('0x9'));var fs=require('fs');var fs_extra=require(_0x116b('0xa'));var _=require('lodash');var squel=require(_0x116b('0xb'));var crypto=require('crypto');var jsforce=require(_0x116b('0xc'));var deskjs=require(_0x116b('0xd'));var toCsv=require(_0x116b('0xe'));var querystring=require(_0x116b('0xf'));var Papa=require(_0x116b('0x10'));var Redis=require(_0x116b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x116b('0x12'));var as=require(_0x116b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x116b('0x14'));var utils=require(_0x116b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x116b('0x16'));var db=require(_0x116b('0x17'))['db'];function respondWithStatusCode(_0x49c87a,_0x1e3b9c){_0x1e3b9c=_0x1e3b9c||0xcc;return function(_0x4a4f49){if(_0x4a4f49){return _0x49c87a[_0x116b('0x18')](_0x1e3b9c);}return _0x49c87a[_0x116b('0x19')](_0x1e3b9c)['end']();};}function respondWithResult(_0x2cce54,_0x5ba815){_0x5ba815=_0x5ba815||0xc8;return function(_0x32608b){if(_0x32608b){return _0x2cce54[_0x116b('0x19')](_0x5ba815)[_0x116b('0x1a')](_0x32608b);}};}function respondWithFilteredResult(_0x4b215e,_0xe1a0ee){return function(_0x5c3fa1){if(_0x5c3fa1){var _0x260058=typeof _0xe1a0ee[_0x116b('0x1b')]==='undefined'&&typeof _0xe1a0ee['limit']==='undefined';var _0x8098ce=_0x5c3fa1[_0x116b('0x1c')];var _0x30197e=_0x260058?0x0:_0xe1a0ee[_0x116b('0x1b')];var _0x513fce=_0x260058?_0x5c3fa1[_0x116b('0x1c')]:_0xe1a0ee[_0x116b('0x1b')]+_0xe1a0ee[_0x116b('0x1d')];var _0x2432e9;if(_0x513fce>=_0x8098ce){_0x513fce=_0x8098ce;_0x2432e9=0xc8;}else{_0x2432e9=0xce;}_0x4b215e[_0x116b('0x19')](_0x2432e9);return _0x4b215e[_0x116b('0x1e')](_0x116b('0x1f'),_0x30197e+'-'+_0x513fce+'/'+_0x8098ce)[_0x116b('0x1a')](_0x5c3fa1);}return null;};}function patchUpdates(_0x285d11){return function(_0x530d34){try{jsonpatch[_0x116b('0x20')](_0x530d34,_0x285d11,!![]);}catch(_0x9aa3b3){return BPromise[_0x116b('0x21')](_0x9aa3b3);}return _0x530d34[_0x116b('0x22')]();};}function saveUpdates(_0x31ef0e,_0x40ef8a){return function(_0x14b95f){if(_0x14b95f){return _0x14b95f[_0x116b('0x23')](_0x31ef0e)[_0x116b('0x24')](function(_0x70baff){return _0x70baff;});}return null;};}function removeEntity(_0x30dfbb,_0x6317fb){return function(_0x33cc3e){if(_0x33cc3e){return _0x33cc3e[_0x116b('0x25')]()[_0x116b('0x24')](function(){_0x30dfbb['status'](0xcc)[_0x116b('0x26')]();});}};}function handleEntityNotFound(_0x5d2548,_0xf230e6){return function(_0x53268c){if(!_0x53268c){_0x5d2548[_0x116b('0x18')](0x194);}return _0x53268c;};}function handleError(_0x742204,_0x3fdd3d){_0x3fdd3d=_0x3fdd3d||0x1f4;return function(_0x16b25d){logger[_0x116b('0x27')](_0x16b25d[_0x116b('0x28')]);if(_0x16b25d['name']){delete _0x16b25d['name'];}_0x742204['status'](_0x3fdd3d)[_0x116b('0x29')](_0x16b25d);};}exports[_0x116b('0x2a')]=function(_0x4339ee,_0x2c39ae){var _0x2314fc={},_0x4e72a5={},_0x3bf23f={'count':0x0,'rows':[]};var _0x4724e8=_[_0x116b('0x2b')](db[_0x116b('0x2c')]['rawAttributes'],function(_0x2f9c93){return{'name':_0x2f9c93[_0x116b('0x2d')],'type':_0x2f9c93[_0x116b('0x2e')][_0x116b('0x2f')]};});_0x4e72a5[_0x116b('0x30')]=_[_0x116b('0x2b')](_0x4724e8,'name');_0x4e72a5[_0x116b('0x31')]=_[_0x116b('0x32')](_0x4339ee[_0x116b('0x31')]);_0x4e72a5[_0x116b('0x33')]=_[_0x116b('0x34')](_0x4e72a5[_0x116b('0x30')],_0x4e72a5[_0x116b('0x31')]);_0x2314fc[_0x116b('0x35')]=_[_0x116b('0x34')](_0x4e72a5['model'],qs[_0x116b('0x36')](_0x4339ee['query'][_0x116b('0x36')]));_0x2314fc['attributes']=_0x2314fc[_0x116b('0x35')][_0x116b('0x37')]?_0x2314fc['attributes']:_0x4e72a5[_0x116b('0x30')];if(!_0x4339ee['query'][_0x116b('0x38')](_0x116b('0x39'))){_0x2314fc['limit']=qs['limit'](_0x4339ee[_0x116b('0x31')]['limit']);_0x2314fc[_0x116b('0x1b')]=qs[_0x116b('0x1b')](_0x4339ee[_0x116b('0x31')][_0x116b('0x1b')]);}_0x2314fc['order']=qs[_0x116b('0x3a')](_0x4339ee['query'][_0x116b('0x3a')]);_0x2314fc[_0x116b('0x3b')]=qs['filters'](_['pick'](_0x4339ee[_0x116b('0x31')],_0x4e72a5[_0x116b('0x33')]),_0x4724e8);if(_0x4339ee[_0x116b('0x31')]['filter']){_0x2314fc[_0x116b('0x3b')]=_[_0x116b('0x3c')](_0x2314fc['where'],{'$or':_[_0x116b('0x2b')](_0x4724e8,function(_0x26ee96){if(_0x26ee96[_0x116b('0x2e')]!=='VIRTUAL'){var _0x18eefc={};_0x18eefc[_0x26ee96[_0x116b('0x3d')]]={'$like':'%'+_0x4339ee[_0x116b('0x31')][_0x116b('0x3e')]+'%'};return _0x18eefc;}})});}_0x2314fc=_[_0x116b('0x3c')]({},_0x2314fc,_0x4339ee[_0x116b('0x3f')]);var _0x575f70={'where':_0x2314fc[_0x116b('0x3b')]};return db['UserProfileSection'][_0x116b('0x1c')](_0x575f70)[_0x116b('0x24')](function(_0x3d6f0b){_0x3bf23f[_0x116b('0x1c')]=_0x3d6f0b;if(_0x4339ee['query'][_0x116b('0x40')]){_0x2314fc[_0x116b('0x41')]=[{'all':!![]}];}return db[_0x116b('0x2c')][_0x116b('0x42')](_0x2314fc);})['then'](function(_0x3fad54){_0x3bf23f[_0x116b('0x43')]=_0x3fad54;return _0x3bf23f;})[_0x116b('0x24')](respondWithFilteredResult(_0x2c39ae,_0x2314fc))[_0x116b('0x44')](handleError(_0x2c39ae,null));};exports[_0x116b('0x45')]=function(_0x24dc04,_0x5a4d13){var _0x39536b={'raw':![],'where':{'id':_0x24dc04[_0x116b('0x46')]['id']}},_0x59e6ed={};_0x59e6ed[_0x116b('0x30')]=_[_0x116b('0x32')](db[_0x116b('0x2c')][_0x116b('0x47')]);_0x59e6ed[_0x116b('0x31')]=_[_0x116b('0x32')](_0x24dc04[_0x116b('0x31')]);_0x59e6ed[_0x116b('0x33')]=_[_0x116b('0x34')](_0x59e6ed[_0x116b('0x30')],_0x59e6ed[_0x116b('0x31')]);_0x39536b['attributes']=_['intersection'](_0x59e6ed[_0x116b('0x30')],qs['fields'](_0x24dc04[_0x116b('0x31')][_0x116b('0x36')]));_0x39536b['attributes']=_0x39536b['attributes'][_0x116b('0x37')]?_0x39536b[_0x116b('0x35')]:_0x59e6ed[_0x116b('0x30')];if(_0x24dc04[_0x116b('0x31')][_0x116b('0x40')]){_0x39536b[_0x116b('0x41')]=[{'all':!![]}];}_0x39536b=_[_0x116b('0x3c')]({},_0x39536b,_0x24dc04[_0x116b('0x3f')]);return db[_0x116b('0x2c')][_0x116b('0x48')](_0x39536b)[_0x116b('0x24')](handleEntityNotFound(_0x5a4d13,null))[_0x116b('0x24')](respondWithResult(_0x5a4d13,null))[_0x116b('0x44')](handleError(_0x5a4d13,null));};exports[_0x116b('0x49')]=function(_0x481e32,_0x2ba326){return db[_0x116b('0x2c')][_0x116b('0x49')](_0x481e32[_0x116b('0x4a')],{})[_0x116b('0x24')](respondWithResult(_0x2ba326,0xc9))[_0x116b('0x44')](handleError(_0x2ba326,null));};exports['update']=function(_0x48070f,_0x3c24a4){if(_0x48070f['body']['id']){delete _0x48070f[_0x116b('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x48070f[_0x116b('0x46')]['id']}})[_0x116b('0x24')](handleEntityNotFound(_0x3c24a4,null))['then'](saveUpdates(_0x48070f['body'],null))['then'](respondWithResult(_0x3c24a4,null))['catch'](handleError(_0x3c24a4,null));};exports[_0x116b('0x25')]=function(_0x4e8025,_0x4975a0){return db['UserProfileSection'][_0x116b('0x48')]({'where':{'id':_0x4e8025['params']['id']}})[_0x116b('0x24')](handleEntityNotFound(_0x4975a0,null))[_0x116b('0x24')](removeEntity(_0x4975a0,null))['catch'](handleError(_0x4975a0,null));};exports['describe']=function(_0x3506ef,_0x13ebac){return db[_0x116b('0x2c')][_0x116b('0x4b')]()[_0x116b('0x24')](respondWithResult(_0x13ebac,null))[_0x116b('0x44')](handleError(_0x13ebac,null));}; \ No newline at end of file +var _0x975b=['apply','save','then','destroy','error','stack','send','map','UserProfileSection','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','update','body','describe','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0x975b,0xb4));var _0xb975=function(_0xfafc3b,_0x43ca99){_0xfafc3b=_0xfafc3b-0x0;var _0x57b902=_0x975b[_0xfafc3b];return _0x57b902;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb975('0x0'));var zipdir=require(_0xb975('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb975('0x2'));var moment=require('moment');var BPromise=require(_0xb975('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb975('0x4'));var sox=require(_0xb975('0x5'));var csv=require(_0xb975('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb975('0x7'));var _=require(_0xb975('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb975('0x9'));var deskjs=require(_0xb975('0xa'));var toCsv=require(_0xb975('0x6'));var querystring=require('querystring');var Papa=require(_0xb975('0xb'));var Redis=require(_0xb975('0xc'));var authService=require(_0xb975('0xd'));var qs=require(_0xb975('0xe'));var as=require(_0xb975('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb975('0x10'))('api');var utils=require(_0xb975('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xb975('0x12'));var db=require(_0xb975('0x13'))['db'];function respondWithStatusCode(_0x4f1e2e,_0x205dd9){_0x205dd9=_0x205dd9||0xcc;return function(_0x28a65d){if(_0x28a65d){return _0x4f1e2e[_0xb975('0x14')](_0x205dd9);}return _0x4f1e2e[_0xb975('0x15')](_0x205dd9)[_0xb975('0x16')]();};}function respondWithResult(_0x156341,_0x106b45){_0x106b45=_0x106b45||0xc8;return function(_0x2340d3){if(_0x2340d3){return _0x156341[_0xb975('0x15')](_0x106b45)[_0xb975('0x17')](_0x2340d3);}};}function respondWithFilteredResult(_0x5e67f1,_0x78b46){return function(_0x27e00d){if(_0x27e00d){var _0x467143=typeof _0x78b46['offset']==='undefined'&&typeof _0x78b46[_0xb975('0x18')]===_0xb975('0x19');var _0x2fd34f=_0x27e00d['count'];var _0xf63b4d=_0x467143?0x0:_0x78b46['offset'];var _0x7d7f1d=_0x467143?_0x27e00d[_0xb975('0x1a')]:_0x78b46[_0xb975('0x1b')]+_0x78b46[_0xb975('0x18')];var _0x2915e6;if(_0x7d7f1d>=_0x2fd34f){_0x7d7f1d=_0x2fd34f;_0x2915e6=0xc8;}else{_0x2915e6=0xce;}_0x5e67f1[_0xb975('0x15')](_0x2915e6);return _0x5e67f1[_0xb975('0x1c')](_0xb975('0x1d'),_0xf63b4d+'-'+_0x7d7f1d+'/'+_0x2fd34f)[_0xb975('0x17')](_0x27e00d);}return null;};}function patchUpdates(_0x381552){return function(_0x2db038){try{jsonpatch[_0xb975('0x1e')](_0x2db038,_0x381552,!![]);}catch(_0x162d1a){return BPromise['reject'](_0x162d1a);}return _0x2db038[_0xb975('0x1f')]();};}function saveUpdates(_0xee37a7,_0x4f5745){return function(_0x17752c){if(_0x17752c){return _0x17752c['update'](_0xee37a7)[_0xb975('0x20')](function(_0x2b61d4){return _0x2b61d4;});}return null;};}function removeEntity(_0x5aa9a8,_0x4cc148){return function(_0x3da7fc){if(_0x3da7fc){return _0x3da7fc[_0xb975('0x21')]()[_0xb975('0x20')](function(){_0x5aa9a8[_0xb975('0x15')](0xcc)[_0xb975('0x16')]();});}};}function handleEntityNotFound(_0x5edff7,_0x283d8c){return function(_0x1ed8fc){if(!_0x1ed8fc){_0x5edff7[_0xb975('0x14')](0x194);}return _0x1ed8fc;};}function handleError(_0x4d6f23,_0x2039aa){_0x2039aa=_0x2039aa||0x1f4;return function(_0x9a3747){logger[_0xb975('0x22')](_0x9a3747[_0xb975('0x23')]);if(_0x9a3747['name']){delete _0x9a3747['name'];}_0x4d6f23['status'](_0x2039aa)[_0xb975('0x24')](_0x9a3747);};}exports['index']=function(_0x102705,_0x374660){var _0x762bfa={},_0x860c85={},_0x50c19d={'count':0x0,'rows':[]};var _0x2f87d7=_[_0xb975('0x25')](db[_0xb975('0x26')][_0xb975('0x27')],function(_0x254d38){return{'name':_0x254d38['fieldName'],'type':_0x254d38[_0xb975('0x28')][_0xb975('0x29')]};});_0x860c85[_0xb975('0x2a')]=_[_0xb975('0x25')](_0x2f87d7,_0xb975('0x2b'));_0x860c85[_0xb975('0x2c')]=_[_0xb975('0x2d')](_0x102705['query']);_0x860c85['filters']=_[_0xb975('0x2e')](_0x860c85[_0xb975('0x2a')],_0x860c85[_0xb975('0x2c')]);_0x762bfa[_0xb975('0x2f')]=_[_0xb975('0x2e')](_0x860c85['model'],qs[_0xb975('0x30')](_0x102705['query'][_0xb975('0x30')]));_0x762bfa[_0xb975('0x2f')]=_0x762bfa['attributes'][_0xb975('0x31')]?_0x762bfa['attributes']:_0x860c85[_0xb975('0x2a')];if(!_0x102705['query'][_0xb975('0x32')]('nolimit')){_0x762bfa['limit']=qs['limit'](_0x102705[_0xb975('0x2c')]['limit']);_0x762bfa['offset']=qs['offset'](_0x102705[_0xb975('0x2c')][_0xb975('0x1b')]);}_0x762bfa['order']=qs[_0xb975('0x33')](_0x102705[_0xb975('0x2c')]['sort']);_0x762bfa['where']=qs['filters'](_[_0xb975('0x34')](_0x102705['query'],_0x860c85[_0xb975('0x35')]),_0x2f87d7);if(_0x102705['query'][_0xb975('0x36')]){_0x762bfa[_0xb975('0x37')]=_['merge'](_0x762bfa[_0xb975('0x37')],{'$or':_[_0xb975('0x25')](_0x2f87d7,function(_0x1e466b){if(_0x1e466b[_0xb975('0x28')]!==_0xb975('0x38')){var _0x38cafe={};_0x38cafe[_0x1e466b[_0xb975('0x2b')]]={'$like':'%'+_0x102705['query'][_0xb975('0x36')]+'%'};return _0x38cafe;}})});}_0x762bfa=_[_0xb975('0x39')]({},_0x762bfa,_0x102705[_0xb975('0x3a')]);var _0x14ccee={'where':_0x762bfa[_0xb975('0x37')]};return db[_0xb975('0x26')][_0xb975('0x1a')](_0x14ccee)[_0xb975('0x20')](function(_0x8cfb1d){_0x50c19d[_0xb975('0x1a')]=_0x8cfb1d;if(_0x102705['query'][_0xb975('0x3b')]){_0x762bfa[_0xb975('0x3c')]=[{'all':!![]}];}return db[_0xb975('0x26')][_0xb975('0x3d')](_0x762bfa);})[_0xb975('0x20')](function(_0x5ae9d0){_0x50c19d[_0xb975('0x3e')]=_0x5ae9d0;return _0x50c19d;})['then'](respondWithFilteredResult(_0x374660,_0x762bfa))[_0xb975('0x3f')](handleError(_0x374660,null));};exports['show']=function(_0xcd04e9,_0x3c61fc){var _0x154ca0={'raw':![],'where':{'id':_0xcd04e9[_0xb975('0x40')]['id']}},_0x1f6aed={};_0x1f6aed[_0xb975('0x2a')]=_[_0xb975('0x2d')](db['UserProfileSection'][_0xb975('0x27')]);_0x1f6aed['query']=_[_0xb975('0x2d')](_0xcd04e9['query']);_0x1f6aed['filters']=_[_0xb975('0x2e')](_0x1f6aed[_0xb975('0x2a')],_0x1f6aed[_0xb975('0x2c')]);_0x154ca0[_0xb975('0x2f')]=_[_0xb975('0x2e')](_0x1f6aed[_0xb975('0x2a')],qs['fields'](_0xcd04e9[_0xb975('0x2c')]['fields']));_0x154ca0['attributes']=_0x154ca0[_0xb975('0x2f')]['length']?_0x154ca0[_0xb975('0x2f')]:_0x1f6aed[_0xb975('0x2a')];if(_0xcd04e9['query'][_0xb975('0x3b')]){_0x154ca0[_0xb975('0x3c')]=[{'all':!![]}];}_0x154ca0=_[_0xb975('0x39')]({},_0x154ca0,_0xcd04e9[_0xb975('0x3a')]);return db[_0xb975('0x26')][_0xb975('0x41')](_0x154ca0)['then'](handleEntityNotFound(_0x3c61fc,null))[_0xb975('0x20')](respondWithResult(_0x3c61fc,null))[_0xb975('0x3f')](handleError(_0x3c61fc,null));};exports[_0xb975('0x42')]=function(_0x2c0d1f,_0x3b9dab){return db[_0xb975('0x26')][_0xb975('0x42')](_0x2c0d1f['body'],{})[_0xb975('0x20')](respondWithResult(_0x3b9dab,0xc9))['catch'](handleError(_0x3b9dab,null));};exports[_0xb975('0x43')]=function(_0x43f8bf,_0x1516b7){if(_0x43f8bf[_0xb975('0x44')]['id']){delete _0x43f8bf[_0xb975('0x44')]['id'];}return db[_0xb975('0x26')][_0xb975('0x41')]({'where':{'id':_0x43f8bf[_0xb975('0x40')]['id']}})[_0xb975('0x20')](handleEntityNotFound(_0x1516b7,null))[_0xb975('0x20')](saveUpdates(_0x43f8bf[_0xb975('0x44')],null))[_0xb975('0x20')](respondWithResult(_0x1516b7,null))[_0xb975('0x3f')](handleError(_0x1516b7,null));};exports['destroy']=function(_0x5926c1,_0x533f49){return db[_0xb975('0x26')][_0xb975('0x41')]({'where':{'id':_0x5926c1['params']['id']}})[_0xb975('0x20')](handleEntityNotFound(_0x533f49,null))[_0xb975('0x20')](removeEntity(_0x533f49,null))['catch'](handleError(_0x533f49,null));};exports[_0xb975('0x45')]=function(_0x57ce95,_0x4b1ce0){return db[_0xb975('0x26')]['describe']()[_0xb975('0x20')](respondWithResult(_0x4b1ce0,null))[_0xb975('0x3f')](handleError(_0x4b1ce0,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 7d22646..eadfc9a 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 _0xbeca=['user_profile_has_sections','sectionId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection'];(function(_0x3b1424,_0x447f3c){var _0x4a2c9a=function(_0x1220c6){while(--_0x1220c6){_0x3b1424['push'](_0x3b1424['shift']());}};_0x4a2c9a(++_0x447f3c);}(_0xbeca,0x106));var _0xabec=function(_0x1d850e,_0x723bc4){_0x1d850e=_0x1d850e-0x0;var _0x2efd1f=_0xbeca[_0x1d850e];return _0x2efd1f;};'use strict';var _=require(_0xabec('0x0'));var util=require(_0xabec('0x1'));var logger=require('../../config/logger')(_0xabec('0x2'));var moment=require(_0xabec('0x3'));var BPromise=require(_0xabec('0x4'));var rp=require(_0xabec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabec('0x6'));var config=require(_0xabec('0x7'));var attributes=require(_0xabec('0x8'));module['exports']=function(_0x1f82db,_0x71ca5b){return _0x1f82db[_0xabec('0x9')](_0xabec('0xa'),attributes,{'tableName':_0xabec('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xabec('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1930=['request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','moment','bluebird'];(function(_0x5c4b6a,_0x3e4163){var _0x2dec05=function(_0x17017e){while(--_0x17017e){_0x5c4b6a['push'](_0x5c4b6a['shift']());}};_0x2dec05(++_0x3e4163);}(_0x1930,0x99));var _0x0193=function(_0x246def,_0x8fa95){_0x246def=_0x246def-0x0;var _0x567b57=_0x1930[_0x246def];return _0x567b57;};'use strict';var _=require(_0x0193('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0193('0x1'));var BPromise=require(_0x0193('0x2'));var rp=require(_0x0193('0x3'));var fs=require('fs');var path=require(_0x0193('0x4'));var rimraf=require(_0x0193('0x5'));var config=require(_0x0193('0x6'));var attributes=require(_0x0193('0x7'));module[_0x0193('0x8')]=function(_0x3bfba0,_0x1f07e5){return _0x3bfba0[_0x0193('0x9')](_0x0193('0xa'),attributes,{'tableName':_0x0193('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x0193('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fa3a70a..07734e7 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 _0x0a9e=['UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a9e,0x97));var _0xe0a9=function(_0x42c825,_0x22dec8){_0x42c825=_0x42c825-0x0;var _0x395977=_0x0a9e[_0x42c825];return _0x395977;};'use strict';var _=require(_0xe0a9('0x0'));var util=require('util');var moment=require(_0xe0a9('0x1'));var BPromise=require(_0xe0a9('0x2'));var rs=require(_0xe0a9('0x3'));var fs=require('fs');var Redis=require(_0xe0a9('0x4'));var db=require(_0xe0a9('0x5'))['db'];var utils=require(_0xe0a9('0x6'));var logger=require(_0xe0a9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe0a9('0x8'));var client=jayson[_0xe0a9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10fdaf,_0x5dc1a5,_0x36beca){return new BPromise(function(_0x4d1f44,_0x564276){return client[_0xe0a9('0xa')](_0x10fdaf,_0x36beca)['then'](function(_0x42d3a7){logger['info'](_0xe0a9('0xb'),_0x5dc1a5,_0xe0a9('0xc'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5dc1a5,_0xe0a9('0xc'),JSON[_0xe0a9('0xd')](_0x42d3a7));if(_0x42d3a7[_0xe0a9('0xe')]){if(_0x42d3a7[_0xe0a9('0xe')]['code']===0x1f4){logger[_0xe0a9('0xe')](_0xe0a9('0xb'),_0x5dc1a5,_0x42d3a7['error']['message']);return _0x564276(_0x42d3a7['error'][_0xe0a9('0xf')]);}logger[_0xe0a9('0xe')](_0xe0a9('0xb'),_0x5dc1a5,_0x42d3a7[_0xe0a9('0xe')][_0xe0a9('0xf')]);return _0x4d1f44(_0x42d3a7[_0xe0a9('0xe')][_0xe0a9('0xf')]);}else{logger[_0xe0a9('0x10')](_0xe0a9('0xb'),_0x5dc1a5,_0xe0a9('0xc'));_0x4d1f44(_0x42d3a7[_0xe0a9('0x11')][_0xe0a9('0xf')]);}})['catch'](function(_0x2d4838){logger[_0xe0a9('0xe')](_0xe0a9('0xb'),_0x5dc1a5,_0x2d4838);_0x564276(_0x2d4838);});});} \ No newline at end of file +var _0xb8c9=['UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info'];(function(_0x2f5ce8,_0x39850c){var _0x448e17=function(_0x4c2345){while(--_0x4c2345){_0x2f5ce8['push'](_0x2f5ce8['shift']());}};_0x448e17(++_0x39850c);}(_0xb8c9,0x1d6));var _0x9b8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9b8c('0x0'));var moment=require(_0x9b8c('0x1'));var BPromise=require(_0x9b8c('0x2'));var rs=require(_0x9b8c('0x3'));var fs=require('fs');var Redis=require(_0x9b8c('0x4'));var db=require(_0x9b8c('0x5'))['db'];var utils=require(_0x9b8c('0x6'));var logger=require('../../config/logger')(_0x9b8c('0x7'));var config=require('../../config/environment');var jayson=require(_0x9b8c('0x8'));var client=jayson[_0x9b8c('0x9')][_0x9b8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15ba28,_0x3abc4f,_0x202d4e){return new BPromise(function(_0x38ff4a,_0x1c0bab){return client['request'](_0x15ba28,_0x202d4e)[_0x9b8c('0xb')](function(_0x1aa699){logger[_0x9b8c('0xc')](_0x9b8c('0xd'),_0x3abc4f,_0x9b8c('0xe'));logger['debug'](_0x9b8c('0xf'),_0x3abc4f,'request\x20sent',JSON[_0x9b8c('0x10')](_0x1aa699));if(_0x1aa699['error']){if(_0x1aa699[_0x9b8c('0x11')][_0x9b8c('0x12')]===0x1f4){logger[_0x9b8c('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x3abc4f,_0x1aa699['error'][_0x9b8c('0x13')]);return _0x1c0bab(_0x1aa699[_0x9b8c('0x11')]['message']);}logger[_0x9b8c('0x11')](_0x9b8c('0xd'),_0x3abc4f,_0x1aa699[_0x9b8c('0x11')][_0x9b8c('0x13')]);return _0x38ff4a(_0x1aa699[_0x9b8c('0x11')][_0x9b8c('0x13')]);}else{logger['info'](_0x9b8c('0xd'),_0x3abc4f,'request\x20sent');_0x38ff4a(_0x1aa699['result'][_0x9b8c('0x13')]);}})[_0x9b8c('0x14')](function(_0x5185e3){logger[_0x9b8c('0x11')](_0x9b8c('0xd'),_0x3abc4f,_0x5185e3);_0x1c0bab(_0x5185e3);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c515be0..9382ad9 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4cb874,_0x1a872a){var _0x4f947a=function(_0xb713c1){while(--_0xb713c1){_0x4cb874['push'](_0x4cb874['shift']());}};_0x4f947a(++_0x1a872a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xcb91[_0x1faaa1];return _0x994ec;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1d9813,_0x4ca59d){var _0x561d3e=function(_0x1df9cf){while(--_0x1df9cf){_0x1d9813['push'](_0x1d9813['shift']());}};_0x561d3e(++_0x4ca59d);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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 016101d..febd819 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 _0xc510=['sequelize','exports'];(function(_0x5ebfae,_0x5b5708){var _0x56fcff=function(_0x48b758){while(--_0x48b758){_0x5ebfae['push'](_0x5ebfae['shift']());}};_0x56fcff(++_0x5b5708);}(_0xc510,0x1a8));var _0x0c51=function(_0x49b343,_0x89e908){_0x49b343=_0x49b343-0x0;var _0x44621b=_0xc510[_0x49b343];return _0x44621b;};'use strict';var Sequelize=require(_0x0c51('0x0'));module[_0x0c51('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9e08=['sequelize','INTEGER'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x9e08,0x198));var _0x89e0=function(_0x21047a,_0xbeab33){_0x21047a=_0x21047a-0x0;var _0x93bd8f=_0x9e08[_0x21047a];return _0x93bd8f;};'use strict';var Sequelize=require(_0x89e0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x89e0('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 685f447..3eb3c2b 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 _0x1189=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x295f8f,_0x245326){var _0x5039bc=function(_0x7d7710){while(--_0x7d7710){_0x295f8f['push'](_0x295f8f['shift']());}};_0x5039bc(++_0x245326);}(_0x1189,0x17f));var _0x9118=function(_0x13ae89,_0x832c38){_0x13ae89=_0x13ae89-0x0;var _0x1744a0=_0x1189[_0x13ae89];return _0x1744a0;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var logger=require(_0x9118('0x2'))(_0x9118('0x3'));var moment=require('moment');var BPromise=require(_0x9118('0x4'));var rp=require(_0x9118('0x5'));var fs=require('fs');var path=require(_0x9118('0x6'));var rimraf=require(_0x9118('0x7'));var config=require(_0x9118('0x8'));var attributes=require(_0x9118('0x9'));module[_0x9118('0xa')]=function(_0x499ee5,_0x124b4a){return _0x499ee5[_0x9118('0xb')](_0x9118('0xc'),attributes,{'tableName':_0x9118('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa498=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue'];(function(_0x58f254,_0x153760){var _0x485fd9=function(_0x170314){while(--_0x170314){_0x58f254['push'](_0x58f254['shift']());}};_0x485fd9(++_0x153760);}(_0xa498,0x1d6));var _0x8a49=function(_0x13b70f,_0x5c1116){_0x13b70f=_0x13b70f-0x0;var _0x51427c=_0xa498[_0x13b70f];return _0x51427c;};'use strict';var _=require('lodash');var util=require(_0x8a49('0x0'));var logger=require(_0x8a49('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8a49('0x2'));var rp=require(_0x8a49('0x3'));var fs=require('fs');var path=require(_0x8a49('0x4'));var rimraf=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x8a49('0x7')]=function(_0x5c5df6,_0x366d5b){return _0x5c5df6[_0x8a49('0x8')](_0x8a49('0x9'),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 88c2891..7d67af7 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 _0x843a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x185369,_0x46be46){var _0x4b98ba=function(_0x40bbb4){while(--_0x40bbb4){_0x185369['push'](_0x185369['shift']());}};_0x4b98ba(++_0x46be46);}(_0x843a,0x11b));var _0xa843=function(_0x12cd3d,_0x15bc4c){_0x12cd3d=_0x12cd3d-0x0;var _0x248932=_0x843a[_0x12cd3d];return _0x248932;};'use strict';var _=require(_0xa843('0x0'));var util=require(_0xa843('0x1'));var moment=require('moment');var BPromise=require(_0xa843('0x2'));var rs=require(_0xa843('0x3'));var fs=require('fs');var Redis=require(_0xa843('0x4'));var db=require(_0xa843('0x5'))['db'];var utils=require(_0xa843('0x6'));var logger=require('../../config/logger')(_0xa843('0x7'));var config=require(_0xa843('0x8'));var jayson=require(_0xa843('0x9'));var client=jayson[_0xa843('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x186166,_0x1ddedd,_0x5efa3c){return new BPromise(function(_0x4e22d9,_0x1f8681){return client[_0xa843('0xb')](_0x186166,_0x5efa3c)[_0xa843('0xc')](function(_0x1cd3cd){logger['info'](_0xa843('0xd'),_0x1ddedd,_0xa843('0xe'));logger[_0xa843('0xf')](_0xa843('0x10'),_0x1ddedd,_0xa843('0xe'),JSON[_0xa843('0x11')](_0x1cd3cd));if(_0x1cd3cd[_0xa843('0x12')]){if(_0x1cd3cd[_0xa843('0x12')][_0xa843('0x13')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1ddedd,_0x1cd3cd[_0xa843('0x12')][_0xa843('0x14')]);return _0x1f8681(_0x1cd3cd[_0xa843('0x12')][_0xa843('0x14')]);}logger[_0xa843('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x1ddedd,_0x1cd3cd[_0xa843('0x12')][_0xa843('0x14')]);return _0x4e22d9(_0x1cd3cd[_0xa843('0x12')][_0xa843('0x14')]);}else{logger[_0xa843('0x15')](_0xa843('0xd'),_0x1ddedd,_0xa843('0xe'));_0x4e22d9(_0x1cd3cd[_0xa843('0x16')][_0xa843('0x14')]);}})[_0xa843('0x17')](function(_0x4b8301){logger[_0xa843('0x12')](_0xa843('0xd'),_0x1ddedd,_0x4b8301);_0x1f8681(_0x4b8301);});});} \ No newline at end of file +var _0x2230=['../../config/environment','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x3ceab4,_0x4e8085){var _0x333e23=function(_0x32d24c){while(--_0x32d24c){_0x3ceab4['push'](_0x3ceab4['shift']());}};_0x333e23(++_0x4e8085);}(_0x2230,0x108));var _0x0223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2230[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0223('0x0'));var util=require(_0x0223('0x1'));var moment=require('moment');var BPromise=require(_0x0223('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0223('0x3'));var db=require(_0x0223('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0223('0x5'));var config=require(_0x0223('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0223('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10a7d6,_0x29d618,_0x238965){return new BPromise(function(_0x41731,_0x2039b4){return client[_0x0223('0x8')](_0x10a7d6,_0x238965)[_0x0223('0x9')](function(_0x50bdf9){logger[_0x0223('0xa')](_0x0223('0xb'),_0x29d618,'request\x20sent');logger['debug'](_0x0223('0xc'),_0x29d618,_0x0223('0xd'),JSON[_0x0223('0xe')](_0x50bdf9));if(_0x50bdf9[_0x0223('0xf')]){if(_0x50bdf9[_0x0223('0xf')][_0x0223('0x10')]===0x1f4){logger[_0x0223('0xf')](_0x0223('0xb'),_0x29d618,_0x50bdf9[_0x0223('0xf')]['message']);return _0x2039b4(_0x50bdf9[_0x0223('0xf')][_0x0223('0x11')]);}logger[_0x0223('0xf')](_0x0223('0xb'),_0x29d618,_0x50bdf9['error'][_0x0223('0x11')]);return _0x41731(_0x50bdf9['error'][_0x0223('0x11')]);}else{logger[_0x0223('0xa')](_0x0223('0xb'),_0x29d618,_0x0223('0xd'));_0x41731(_0x50bdf9['result'][_0x0223('0x11')]);}})['catch'](function(_0x3014a6){logger['error'](_0x0223('0xb'),_0x29d618,_0x3014a6);_0x2039b4(_0x3014a6);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 70db22b..9550e09 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 _0x90cc=['sequelize','exports','INTEGER'];(function(_0x5836f7,_0x5b18f0){var _0x365d33=function(_0x29f115){while(--_0x29f115){_0x5836f7['push'](_0x5836f7['shift']());}};_0x365d33(++_0x5b18f0);}(_0x90cc,0x10b));var _0xc90c=function(_0x3b0a60,_0x34d2fb){_0x3b0a60=_0x3b0a60-0x0;var _0x276256=_0x90cc[_0x3b0a60];return _0x276256;};'use strict';var Sequelize=require(_0xc90c('0x0'));module[_0xc90c('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc90c('0x2')]}}; \ No newline at end of file +var _0x1a52=['sequelize','INTEGER'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x1a52,0x8c));var _0x21a5=function(_0x568b2a,_0x286e68){_0x568b2a=_0x568b2a-0x0;var _0x580a57=_0x1a52[_0x568b2a];return _0x580a57;};'use strict';var Sequelize=require(_0x21a5('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x21a5('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x21a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c311609..e88e3a0 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(_0xf88f3b,_0x1cc742){var _0x34a2fe=function(_0x20998a){while(--_0x20998a){_0xf88f3b['push'](_0xf88f3b['shift']());}};_0x34a2fe(++_0x1cc742);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x3067ec,_0x19c38b){var _0x59e89c=function(_0x2f1265){while(--_0x2f1265){_0x3067ec['push'](_0x3067ec['shift']());}};_0x59e89c(++_0x19c38b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 6456a99..f7b0596 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(_0x36fa51,_0x55ad58){var _0x337877=function(_0xfde693){while(--_0xfde693){_0x36fa51['push'](_0x36fa51['shift']());}};_0x337877(++_0x55ad58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x240860,_0x20c04d){var _0x40e288=function(_0x38a753){while(--_0x38a753){_0x240860['push'](_0x240860['shift']());}};_0x40e288(++_0x20c04d);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 54dee60..98e54dc 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 _0x613d=['sequelize','exports','INTEGER'];(function(_0x4fa189,_0x1787c4){var _0x457271=function(_0x21f372){while(--_0x21f372){_0x4fa189['push'](_0x4fa189['shift']());}};_0x457271(++_0x1787c4);}(_0x613d,0x177));var _0xd613=function(_0x19c0ea,_0x5973a8){_0x19c0ea=_0x19c0ea-0x0;var _0x3700e8=_0x613d[_0x19c0ea];return _0x3700e8;};'use strict';var Sequelize=require(_0xd613('0x0'));module[_0xd613('0x1')]={'penalty':{'type':Sequelize[_0xd613('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3a16=['sequelize'];(function(_0x49258d,_0x5bcf0e){var _0x2a9044=function(_0x1a629e){while(--_0x1a629e){_0x49258d['push'](_0x49258d['shift']());}};_0x2a9044(++_0x5bcf0e);}(_0x3a16,0x192));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x63a1('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 23a2884..a2a0303 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 _0xadb5=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadb5,0xf8));var _0x5adb=function(_0x44157a,_0xf3e75b){_0x44157a=_0x44157a-0x0;var _0xd9874f=_0xadb5[_0x44157a];return _0xd9874f;};'use strict';var _=require(_0x5adb('0x0'));var util=require(_0x5adb('0x1'));var logger=require(_0x5adb('0x2'))('api');var moment=require(_0x5adb('0x3'));var BPromise=require(_0x5adb('0x4'));var rp=require(_0x5adb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5adb('0x6'));var config=require(_0x5adb('0x7'));var attributes=require(_0x5adb('0x8'));module[_0x5adb('0x9')]=function(_0x25c405,_0x3a2b5d){return _0x25c405['define']('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a73=['moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash','util','api'];(function(_0x248e29,_0x5518f5){var _0x19a0ac=function(_0x405cf3){while(--_0x405cf3){_0x248e29['push'](_0x248e29['shift']());}};_0x19a0ac(++_0x5518f5);}(_0x7a73,0xa2));var _0x37a7=function(_0x6e9956,_0x204e9a){_0x6e9956=_0x6e9956-0x0;var _0x4ebb7d=_0x7a73[_0x6e9956];return _0x4ebb7d;};'use strict';var _=require(_0x37a7('0x0'));var util=require(_0x37a7('0x1'));var logger=require('../../config/logger')(_0x37a7('0x2'));var moment=require(_0x37a7('0x3'));var BPromise=require(_0x37a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37a7('0x5'));var rimraf=require(_0x37a7('0x6'));var config=require(_0x37a7('0x7'));var attributes=require(_0x37a7('0x8'));module[_0x37a7('0x9')]=function(_0x2b5212,_0x36aec9){return _0x2b5212['define']('UserVoiceQueue',attributes,{'tableName':_0x37a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index cc5cb63..6da5056 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 _0x8b6a=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b6a,0x1de));var _0xa8b6=function(_0x58aa31,_0x206b6f){_0x58aa31=_0x58aa31-0x0;var _0x5ac5ae=_0x8b6a[_0x58aa31];return _0x5ac5ae;};'use strict';var _=require(_0xa8b6('0x0'));var util=require(_0xa8b6('0x1'));var moment=require(_0xa8b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8b6('0x3'));var fs=require('fs');var Redis=require(_0xa8b6('0x4'));var db=require(_0xa8b6('0x5'))['db'];var utils=require(_0xa8b6('0x6'));var logger=require(_0xa8b6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa8b6('0x8'));var client=jayson[_0xa8b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5232fd,_0x39c929,_0x2a8bdc){return new BPromise(function(_0x8c794e,_0x3eed2b){return client[_0xa8b6('0xa')](_0x5232fd,_0x2a8bdc)[_0xa8b6('0xb')](function(_0x1767b7){logger[_0xa8b6('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x39c929,_0xa8b6('0xd'));logger['debug'](_0xa8b6('0xe'),_0x39c929,_0xa8b6('0xd'),JSON[_0xa8b6('0xf')](_0x1767b7));if(_0x1767b7[_0xa8b6('0x10')]){if(_0x1767b7[_0xa8b6('0x10')][_0xa8b6('0x11')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x39c929,_0x1767b7['error'][_0xa8b6('0x12')]);return _0x3eed2b(_0x1767b7[_0xa8b6('0x10')]['message']);}logger['error'](_0xa8b6('0x13'),_0x39c929,_0x1767b7['error'][_0xa8b6('0x12')]);return _0x8c794e(_0x1767b7[_0xa8b6('0x10')][_0xa8b6('0x12')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x39c929,_0xa8b6('0xd'));_0x8c794e(_0x1767b7[_0xa8b6('0x14')][_0xa8b6('0x12')]);}})[_0xa8b6('0x15')](function(_0x491e86){logger[_0xa8b6('0x10')](_0xa8b6('0x13'),_0x39c929,_0x491e86);_0x3eed2b(_0x491e86);});});} \ No newline at end of file +var _0x296c=['info','request\x20sent','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','result','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x36515b,_0x3ba216){var _0x7176f6=function(_0x3d0a47){while(--_0x3d0a47){_0x36515b['push'](_0x36515b['shift']());}};_0x7176f6(++_0x3ba216);}(_0x296c,0xa2));var _0xc296=function(_0x100ace,_0x561b4c){_0x100ace=_0x100ace-0x0;var _0x4d67df=_0x296c[_0x100ace];return _0x4d67df;};'use strict';var _=require('lodash');var util=require(_0xc296('0x0'));var moment=require(_0xc296('0x1'));var BPromise=require(_0xc296('0x2'));var rs=require(_0xc296('0x3'));var fs=require('fs');var Redis=require(_0xc296('0x4'));var db=require(_0xc296('0x5'))['db'];var utils=require(_0xc296('0x6'));var logger=require(_0xc296('0x7'))(_0xc296('0x8'));var config=require(_0xc296('0x9'));var jayson=require(_0xc296('0xa'));var client=jayson[_0xc296('0xb')][_0xc296('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cc5a5,_0xa90b6,_0x2ee65a){return new BPromise(function(_0x3d4204,_0x3a0678){return client['request'](_0x4cc5a5,_0x2ee65a)[_0xc296('0xd')](function(_0x35944c){logger[_0xc296('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0xa90b6,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0xa90b6,_0xc296('0xf'),JSON[_0xc296('0x10')](_0x35944c));if(_0x35944c['error']){if(_0x35944c[_0xc296('0x11')][_0xc296('0x12')]===0x1f4){logger[_0xc296('0x11')](_0xc296('0x13'),_0xa90b6,_0x35944c[_0xc296('0x11')]['message']);return _0x3a0678(_0x35944c[_0xc296('0x11')]['message']);}logger[_0xc296('0x11')](_0xc296('0x13'),_0xa90b6,_0x35944c[_0xc296('0x11')]['message']);return _0x3d4204(_0x35944c[_0xc296('0x11')]['message']);}else{logger[_0xc296('0xe')](_0xc296('0x13'),_0xa90b6,'request\x20sent');_0x3d4204(_0x35944c[_0xc296('0x14')][_0xc296('0x15')]);}})['catch'](function(_0x2c5762){logger[_0xc296('0x11')](_0xc296('0x13'),_0xa90b6,_0x2c5762);_0x3a0678(_0x2c5762);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index fb350cd..dd9dc68 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d74be,_0x599ca7){var _0x4ac1c0=function(_0x306091){while(--_0x306091){_0x4d74be['push'](_0x4d74be['shift']());}};_0x4ac1c0(++_0x599ca7);}(_0xe706,0xa3));var _0x6e70=function(_0x7450d2,_0x46afc8){_0x7450d2=_0x7450d2-0x0;var _0x5987aa=_0xe706[_0x7450d2];return _0x5987aa;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1badda,_0x1f700e){var _0x169ea6=function(_0x4ab51c){while(--_0x4ab51c){_0x1badda['push'](_0x1badda['shift']());}};_0x169ea6(++_0x1f700e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x438685,_0x4ec0c0){_0x438685=_0x438685-0x0;var _0x41cca2=_0xcb91[_0x438685];return _0x41cca2;};'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 b82da81..8d2a006 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 _0x33d0=['sequelize','exports','INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x33d0,0x144));var _0x033d=function(_0x46ea9a,_0x1f5337){_0x46ea9a=_0x46ea9a-0x0;var _0x5a474d=_0x33d0[_0x46ea9a];return _0x5a474d;};'use strict';var Sequelize=require(_0x033d('0x0'));module[_0x033d('0x1')]={'uniqueid':{'type':Sequelize[_0x033d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x033d('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x033d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x033d('0x3')],'allowNull':![],'unique':_0x033d('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x033d('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x033d('0x4'),'comment':_0x033d('0x5')},'penalty':{'type':Sequelize[_0x033d('0x2')](0xb),'defaultValue':0x0,'comment':_0x033d('0x5')},'paused':{'type':Sequelize[_0x033d('0x2')](0xb),'defaultValue':0x0,'comment':_0x033d('0x5')}}; \ No newline at end of file +var _0xdc59=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xdc59,0x1a2));var _0x9dc5=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xdc59[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x9dc5('0x0'));module[_0x9dc5('0x1')]={'uniqueid':{'type':Sequelize[_0x9dc5('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9dc5('0x3')},'membername':{'type':Sequelize[_0x9dc5('0x4')],'allowNull':![],'comment':_0x9dc5('0x3')},'UserId':{'type':Sequelize[_0x9dc5('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9dc5('0x5'),'comment':_0x9dc5('0x3')},'VoiceQueueId':{'type':Sequelize[_0x9dc5('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x9dc5('0x3')},'penalty':{'type':Sequelize[_0x9dc5('0x2')](0xb),'defaultValue':0x0,'comment':_0x9dc5('0x3')},'paused':{'type':Sequelize[_0x9dc5('0x2')](0xb),'defaultValue':0x0,'comment':_0x9dc5('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 0e88e2d..12459d8 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 _0x809b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x440fe0,_0x1e775a){var _0x154a93=function(_0x312e72){while(--_0x312e72){_0x440fe0['push'](_0x440fe0['shift']());}};_0x154a93(++_0x1e775a);}(_0x809b,0x1e6));var _0xb809=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x809b[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0xb809('0x0'));var UserVoiceQueueRt=require(_0xb809('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb809('0x2')](0x0);var events={'afterCreate':_0xb809('0x3'),'afterUpdate':_0xb809('0x4'),'afterDestroy':_0xb809('0x5')};function emitEvent(_0x405136){return function(_0xca626a,_0x1362f7,_0x2b966c){UserVoiceQueueRtEvents[_0xb809('0x6')](_0x405136+':'+_0xca626a['id'],_0xca626a);UserVoiceQueueRtEvents[_0xb809('0x6')](_0x405136,_0xca626a);_0x2b966c(null);};}for(var e in events){if(events[_0xb809('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xb809('0x8')](e,emitEvent(event));}}module[_0xb809('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd804=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove'];(function(_0x561f76,_0x3c0bef){var _0x48b8e4=function(_0x3b7865){while(--_0x3b7865){_0x561f76['push'](_0x561f76['shift']());}};_0x48b8e4(++_0x3c0bef);}(_0xd804,0x1e1));var _0x4d80=function(_0x1ac149,_0x3c7233){_0x1ac149=_0x1ac149-0x0;var _0x478535=_0xd804[_0x1ac149];return _0x478535;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4d80('0x0'))['db'][_0x4d80('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4d80('0x2')](0x0);var events={'afterCreate':_0x4d80('0x3'),'afterUpdate':'update','afterDestroy':_0x4d80('0x4')};function emitEvent(_0x5a0789){return function(_0x167cc3,_0x49a5ad,_0xbb75d0){UserVoiceQueueRtEvents[_0x4d80('0x5')](_0x5a0789+':'+_0x167cc3['id'],_0x167cc3);UserVoiceQueueRtEvents['emit'](_0x5a0789,_0x167cc3);_0xbb75d0(null);};}for(var e in events){if(events[_0x4d80('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4d80('0x7')](e,emitEvent(event));}}module[_0x4d80('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 4495d41..15b48af 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 _0x22df=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x4ac515,_0x4e1320){var _0x4734dc=function(_0x3d005a){while(--_0x3d005a){_0x4ac515['push'](_0x4ac515['shift']());}};_0x4734dc(++_0x4e1320);}(_0x22df,0x100));var _0xf22d=function(_0x1c2830,_0x5e88da){_0x1c2830=_0x1c2830-0x0;var _0x23fcd0=_0x22df[_0x1c2830];return _0x23fcd0;};'use strict';var _=require(_0xf22d('0x0'));var util=require(_0xf22d('0x1'));var logger=require(_0xf22d('0x2'))(_0xf22d('0x3'));var moment=require(_0xf22d('0x4'));var BPromise=require(_0xf22d('0x5'));var rp=require(_0xf22d('0x6'));var fs=require('fs');var path=require(_0xf22d('0x7'));var rimraf=require(_0xf22d('0x8'));var config=require(_0xf22d('0x9'));var attributes=require(_0xf22d('0xa'));module[_0xf22d('0xb')]=function(_0x13f99f,_0x11d673){return _0x13f99f[_0xf22d('0xc')](_0xf22d('0xd'),attributes,{'tableName':_0xf22d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','lodash'];(function(_0x2e368a,_0x331e64){var _0xbe1265=function(_0x3a07b0){while(--_0x3a07b0){_0x2e368a['push'](_0x2e368a['shift']());}};_0xbe1265(++_0x331e64);}(_0x9a19,0x6b));var _0x99a1=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x9a19[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))(_0x99a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99a1('0x4'));var fs=require('fs');var path=require(_0x99a1('0x5'));var rimraf=require(_0x99a1('0x6'));var config=require(_0x99a1('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x99a1('0x8')]=function(_0x47a2f0,_0x4e6531){return _0x47a2f0['define']('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 9221303..fb295cf 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 _0x02a9=['GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xb1e4d7,_0x198d47){var _0x261428=function(_0x18fc00){while(--_0x18fc00){_0xb1e4d7['push'](_0xb1e4d7['shift']());}};_0x261428(++_0x198d47);}(_0x02a9,0x158));var _0x902a=function(_0x220861,_0x59e0c8){_0x220861=_0x220861-0x0;var _0x203063=_0x02a9[_0x220861];return _0x203063;};'use strict';var _=require(_0x902a('0x0'));var util=require(_0x902a('0x1'));var moment=require(_0x902a('0x2'));var BPromise=require(_0x902a('0x3'));var rs=require(_0x902a('0x4'));var fs=require('fs');var Redis=require(_0x902a('0x5'));var db=require(_0x902a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x902a('0x7'))(_0x902a('0x8'));var config=require(_0x902a('0x9'));var jayson=require(_0x902a('0xa'));var client=jayson[_0x902a('0xb')][_0x902a('0xc')]({'port':0x232a});config[_0x902a('0xd')]=_['defaults'](config[_0x902a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x902a('0xe'))(new Redis(config[_0x902a('0xd')]));require(_0x902a('0xf'))[_0x902a('0x10')](socket);function respondWithRpcPromise(_0x438927,_0x1df65a,_0x2b4d3a){return new BPromise(function(_0x3018d3,_0x5b3798){return client[_0x902a('0x11')](_0x438927,_0x2b4d3a)['then'](function(_0x5b444a){logger[_0x902a('0x12')](_0x902a('0x13'),_0x1df65a,_0x902a('0x14'));logger[_0x902a('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1df65a,_0x902a('0x14'),JSON[_0x902a('0x16')](_0x5b444a));if(_0x5b444a['error']){if(_0x5b444a[_0x902a('0x17')][_0x902a('0x18')]===0x1f4){logger['error'](_0x902a('0x13'),_0x1df65a,_0x5b444a[_0x902a('0x17')][_0x902a('0x19')]);return _0x5b3798(_0x5b444a['error'][_0x902a('0x19')]);}logger[_0x902a('0x17')](_0x902a('0x13'),_0x1df65a,_0x5b444a['error'][_0x902a('0x19')]);return _0x3018d3(_0x5b444a[_0x902a('0x17')][_0x902a('0x19')]);}else{logger[_0x902a('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1df65a,_0x902a('0x14'));_0x3018d3(_0x5b444a['result'][_0x902a('0x19')]);}})['catch'](function(_0x159eb3){logger[_0x902a('0x17')](_0x902a('0x13'),_0x1df65a,_0x159eb3);_0x5b3798(_0x159eb3);});});}exports[_0x902a('0x1a')]=function(_0x292db5){var _0x23b2f6=this;return new Promise(function(_0x2785cd,_0x5c2a14){return db['UserVoiceQueueRt'][_0x902a('0x1b')]({'raw':_0x292db5[_0x902a('0x1c')]?_0x292db5[_0x902a('0x1c')][_0x902a('0x1d')]===undefined?!![]:![]:!![],'where':_0x292db5[_0x902a('0x1c')]?_0x292db5['options'][_0x902a('0x1e')]||null:null,'attributes':[[db[_0x902a('0x1f')]['fn'](_0x902a('0x20'),db[_0x902a('0x1f')]['fn']('IF',db[_0x902a('0x1f')][_0x902a('0x21')](_0x902a('0x22')))),_0x902a('0x23')]]})[_0x902a('0x24')](function(_0x365c84){logger[_0x902a('0x12')](_0x902a('0x1a'),_0x292db5);logger[_0x902a('0x15')](_0x902a('0x1a'),_0x292db5,JSON[_0x902a('0x16')](_0x365c84));_0x2785cd(_0x365c84);})['catch'](function(_0x1c89b1){logger[_0x902a('0x17')]('GetVoiceQueueRtPauses',_0x1c89b1['message'],_0x292db5);_0x5c2a14(_0x23b2f6[_0x902a('0x17')](0x1f4,_0x1c89b1[_0x902a('0x19')]));});});}; \ No newline at end of file +var _0xf8cb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','catch','lodash','util','bluebird','randomstring'];(function(_0x5eefad,_0x264aae){var _0x19a080=function(_0x3a4b68){while(--_0x3a4b68){_0x5eefad['push'](_0x5eefad['shift']());}};_0x19a080(++_0x264aae);}(_0xf8cb,0x124));var _0xbf8c=function(_0x56794c,_0x216662){_0x56794c=_0x56794c-0x0;var _0x100a0d=_0xf8cb[_0x56794c];return _0x100a0d;};'use strict';var _=require(_0xbf8c('0x0'));var util=require(_0xbf8c('0x1'));var moment=require('moment');var BPromise=require(_0xbf8c('0x2'));var rs=require(_0xbf8c('0x3'));var fs=require('fs');var Redis=require(_0xbf8c('0x4'));var db=require(_0xbf8c('0x5'))['db'];var utils=require(_0xbf8c('0x6'));var logger=require(_0xbf8c('0x7'))(_0xbf8c('0x8'));var config=require(_0xbf8c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbf8c('0xa')][_0xbf8c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbf8c('0xc')],{'host':_0xbf8c('0xd'),'port':0x18eb});var socket=require(_0xbf8c('0xe'))(new Redis(config[_0xbf8c('0xc')]));require('./userVoiceQueueRt.socket')[_0xbf8c('0xf')](socket);function respondWithRpcPromise(_0x708461,_0x3d7559,_0x5adc68){return new BPromise(function(_0x564699,_0x48d448){return client[_0xbf8c('0x10')](_0x708461,_0x5adc68)['then'](function(_0x4520b6){logger[_0xbf8c('0x11')](_0xbf8c('0x12'),_0x3d7559,'request\x20sent');logger[_0xbf8c('0x13')](_0xbf8c('0x14'),_0x3d7559,_0xbf8c('0x15'),JSON[_0xbf8c('0x16')](_0x4520b6));if(_0x4520b6[_0xbf8c('0x17')]){if(_0x4520b6['error'][_0xbf8c('0x18')]===0x1f4){logger[_0xbf8c('0x17')](_0xbf8c('0x12'),_0x3d7559,_0x4520b6[_0xbf8c('0x17')][_0xbf8c('0x19')]);return _0x48d448(_0x4520b6[_0xbf8c('0x17')][_0xbf8c('0x19')]);}logger[_0xbf8c('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3d7559,_0x4520b6['error'][_0xbf8c('0x19')]);return _0x564699(_0x4520b6[_0xbf8c('0x17')]['message']);}else{logger[_0xbf8c('0x11')](_0xbf8c('0x12'),_0x3d7559,_0xbf8c('0x15'));_0x564699(_0x4520b6['result']['message']);}})['catch'](function(_0x516d32){logger[_0xbf8c('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3d7559,_0x516d32);_0x48d448(_0x516d32);});});}exports['GetVoiceQueueRtPauses']=function(_0x231053){var _0x229686=this;return new Promise(function(_0x563f01,_0x59ff39){return db[_0xbf8c('0x1a')][_0xbf8c('0x1b')]({'raw':_0x231053[_0xbf8c('0x1c')]?_0x231053[_0xbf8c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x231053[_0xbf8c('0x1c')]?_0x231053[_0xbf8c('0x1c')][_0xbf8c('0x1d')]||null:null,'attributes':[[db[_0xbf8c('0x1e')]['fn'](_0xbf8c('0x1f'),db[_0xbf8c('0x1e')]['fn']('IF',db[_0xbf8c('0x1e')]['literal'](_0xbf8c('0x20')))),_0xbf8c('0x21')]]})[_0xbf8c('0x22')](function(_0x42e471){logger[_0xbf8c('0x11')](_0xbf8c('0x23'),_0x231053);logger[_0xbf8c('0x13')](_0xbf8c('0x23'),_0x231053,JSON[_0xbf8c('0x16')](_0x42e471));_0x563f01(_0x42e471);})[_0xbf8c('0x24')](function(_0x5681cc){logger[_0xbf8c('0x17')](_0xbf8c('0x23'),_0x5681cc[_0xbf8c('0x19')],_0x231053);_0x59ff39(_0x229686[_0xbf8c('0x17')](0x1f4,_0x5681cc['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1629cbf..1c4c332 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 _0xc5c8=['./userVoiceQueueRt.events','save','remove','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5c8,0x118));var _0x8c5c=function(_0x394459,_0x1c6bb0){_0x394459=_0x394459-0x0;var _0x4d75af=_0xc5c8[_0x394459];return _0x4d75af;};'use strict';var UserVoiceQueueRtEvents=require(_0x8c5c('0x0'));var events=[_0x8c5c('0x1'),_0x8c5c('0x2'),'update'];function createListener(_0x1217bd,_0x5eb28f){return function(_0x5c7570){_0x5eb28f[_0x8c5c('0x3')](_0x1217bd,_0x5c7570);};}function removeListener(_0x210e70,_0x56f1db){return function(){UserVoiceQueueRtEvents[_0x8c5c('0x4')](_0x210e70,_0x56f1db);};}exports[_0x8c5c('0x5')]=function(_0x390b86){for(var _0x2e297d=0x0,_0x1ae0a1=events[_0x8c5c('0x6')];_0x2e297d<_0x1ae0a1;_0x2e297d++){var _0xffaa6c=events[_0x2e297d];var _0x10d3d8=createListener(_0x8c5c('0x7')+_0xffaa6c,_0x390b86);UserVoiceQueueRtEvents['on'](_0xffaa6c,_0x10d3d8);}}; \ No newline at end of file +var _0x448a=['removeListener','register','length','save','remove','emit'];(function(_0x299984,_0x383734){var _0xae48c9=function(_0x836ac6){while(--_0x836ac6){_0x299984['push'](_0x299984['shift']());}};_0xae48c9(++_0x383734);}(_0x448a,0x1ef));var _0xa448=function(_0x27ec97,_0x57baa9){_0x27ec97=_0x27ec97-0x0;var _0x1840ff=_0x448a[_0x27ec97];return _0x1840ff;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa448('0x0'),_0xa448('0x1'),'update'];function createListener(_0x3f08b0,_0x47909c){return function(_0x5ea7f4){_0x47909c[_0xa448('0x2')](_0x3f08b0,_0x5ea7f4);};}function removeListener(_0x3206fd,_0x57e1ea){return function(){UserVoiceQueueRtEvents[_0xa448('0x3')](_0x3206fd,_0x57e1ea);};}exports[_0xa448('0x4')]=function(_0x343b79){for(var _0x2c16e3=0x0,_0x12b0e2=events[_0xa448('0x5')];_0x2c16e3<_0x12b0e2;_0x2c16e3++){var _0x1ec2d8=events[_0x2c16e3];var _0x54bdb0=createListener('userVoiceQueueRt:'+_0x1ec2d8,_0x343b79);UserVoiceQueueRtEvents['on'](_0x1ec2d8,_0x54bdb0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 628256c..dc0bb5b 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5ef515,_0x26a8c0){var _0x1b4429=function(_0x3aceba){while(--_0x3aceba){_0x5ef515['push'](_0x5ef515['shift']());}};_0x1b4429(++_0x26a8c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0xcb91[_0x509273];return _0x38ef40;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x40b0b7,_0xf53ae5){var _0x5dfb0b=function(_0x5a9c9e){while(--_0x5a9c9e){_0x40b0b7['push'](_0x40b0b7['shift']());}};_0x5dfb0b(++_0xf53ae5);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f73a525..278eeb5 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 _0xe103=['exports','sequelize'];(function(_0x18568b,_0x159197){var _0x58d513=function(_0x1670b6){while(--_0x1670b6){_0x18568b['push'](_0x18568b['shift']());}};_0x58d513(++_0x159197);}(_0xe103,0x12f));var _0x3e10=function(_0xec778e,_0x354656){_0xec778e=_0xec778e-0x0;var _0x1b1e1d=_0xe103[_0xec778e];return _0x1b1e1d;};'use strict';var Sequelize=require(_0x3e10('0x0'));module[_0x3e10('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa4f0=['sequelize'];(function(_0xf55772,_0x2cdc2){var _0x55c194=function(_0x1adb4e){while(--_0x1adb4e){_0xf55772['push'](_0xf55772['shift']());}};_0x55c194(++_0x2cdc2);}(_0xa4f0,0x1c5));var _0x0a4f=function(_0x1501e2,_0x271210){_0x1501e2=_0x1501e2-0x0;var _0xfce8c5=_0xa4f0[_0x1501e2];return _0xfce8c5;};'use strict';var Sequelize=require(_0x0a4f('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 6946002..963e6ed 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 _0x603d=['bluebird','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment'];(function(_0x523403,_0x5c9446){var _0x664e80=function(_0x873dc0){while(--_0x873dc0){_0x523403['push'](_0x523403['shift']());}};_0x664e80(++_0x5c9446);}(_0x603d,0x140));var _0xd603=function(_0x5a7bfc,_0x5eea0b){_0x5a7bfc=_0x5a7bfc-0x0;var _0x6961e4=_0x603d[_0x5a7bfc];return _0x6961e4;};'use strict';var _=require(_0xd603('0x0'));var util=require(_0xd603('0x1'));var logger=require('../../config/logger')(_0xd603('0x2'));var moment=require(_0xd603('0x3'));var BPromise=require(_0xd603('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd603('0x5'));var config=require(_0xd603('0x6'));var attributes=require(_0xd603('0x7'));module[_0xd603('0x8')]=function(_0x59ba51,_0x222947){return _0x59ba51[_0xd603('0x9')](_0xd603('0xa'),attributes,{'tableName':_0xd603('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9eed=['user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define'];(function(_0x1e1cbe,_0x4fa2ff){var _0x58d722=function(_0x261bb7){while(--_0x261bb7){_0x1e1cbe['push'](_0x1e1cbe['shift']());}};_0x58d722(++_0x4fa2ff);}(_0x9eed,0x6d));var _0xd9ee=function(_0x1ff0d5,_0x3f7a84){_0x1ff0d5=_0x1ff0d5-0x0;var _0x6f67dc=_0x9eed[_0x1ff0d5];return _0x6f67dc;};'use strict';var _=require(_0xd9ee('0x0'));var util=require(_0xd9ee('0x1'));var logger=require('../../config/logger')(_0xd9ee('0x2'));var moment=require(_0xd9ee('0x3'));var BPromise=require(_0xd9ee('0x4'));var rp=require(_0xd9ee('0x5'));var fs=require('fs');var path=require(_0xd9ee('0x6'));var rimraf=require(_0xd9ee('0x7'));var config=require(_0xd9ee('0x8'));var attributes=require(_0xd9ee('0x9'));module['exports']=function(_0x5222f6,_0x3ea896){return _0x5222f6[_0xd9ee('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0xd9ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index ae515c0..8631540 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 _0xa26c=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x26a672,_0x59f5be){var _0x348f43=function(_0x461812){while(--_0x461812){_0x26a672['push'](_0x26a672['shift']());}};_0x348f43(++_0x59f5be);}(_0xa26c,0x79));var _0xca26=function(_0x17d19e,_0x14453d){_0x17d19e=_0x17d19e-0x0;var _0x56212e=_0xa26c[_0x17d19e];return _0x56212e;};'use strict';var _=require(_0xca26('0x0'));var util=require(_0xca26('0x1'));var moment=require(_0xca26('0x2'));var BPromise=require('bluebird');var rs=require(_0xca26('0x3'));var fs=require('fs');var Redis=require(_0xca26('0x4'));var db=require(_0xca26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca26('0x6'))(_0xca26('0x7'));var config=require('../../config/environment');var jayson=require(_0xca26('0x8'));var client=jayson['client'][_0xca26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45b94d,_0x556466,_0x449ffc){return new BPromise(function(_0x515971,_0x23993b){return client[_0xca26('0xa')](_0x45b94d,_0x449ffc)['then'](function(_0x8c36ed){logger[_0xca26('0xb')](_0xca26('0xc'),_0x556466,_0xca26('0xd'));logger[_0xca26('0xe')](_0xca26('0xf'),_0x556466,'request\x20sent',JSON[_0xca26('0x10')](_0x8c36ed));if(_0x8c36ed[_0xca26('0x11')]){if(_0x8c36ed[_0xca26('0x11')][_0xca26('0x12')]===0x1f4){logger[_0xca26('0x11')](_0xca26('0xc'),_0x556466,_0x8c36ed[_0xca26('0x11')][_0xca26('0x13')]);return _0x23993b(_0x8c36ed[_0xca26('0x11')]['message']);}logger['error'](_0xca26('0xc'),_0x556466,_0x8c36ed[_0xca26('0x11')][_0xca26('0x13')]);return _0x515971(_0x8c36ed[_0xca26('0x11')][_0xca26('0x13')]);}else{logger[_0xca26('0xb')](_0xca26('0xc'),_0x556466,_0xca26('0xd'));_0x515971(_0x8c36ed[_0xca26('0x14')][_0xca26('0x13')]);}})['catch'](function(_0x58a59b){logger[_0xca26('0x11')](_0xca26('0xc'),_0x556466,_0x58a59b);_0x23993b(_0x58a59b);});});} \ No newline at end of file +var _0x222e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x17bdf0,_0x6693ca){var _0x57a9d4=function(_0xb52548){while(--_0xb52548){_0x17bdf0['push'](_0x17bdf0['shift']());}};_0x57a9d4(++_0x6693ca);}(_0x222e,0x1b2));var _0xe222=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x222e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe222('0x0'));var util=require(_0xe222('0x1'));var moment=require(_0xe222('0x2'));var BPromise=require(_0xe222('0x3'));var rs=require(_0xe222('0x4'));var fs=require('fs');var Redis=require(_0xe222('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe222('0x6'));var logger=require('../../config/logger')(_0xe222('0x7'));var config=require(_0xe222('0x8'));var jayson=require(_0xe222('0x9'));var client=jayson['client'][_0xe222('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222ae4,_0x3e5090,_0x3d8faa){return new BPromise(function(_0x97f0f2,_0xf55b06){return client[_0xe222('0xb')](_0x222ae4,_0x3d8faa)[_0xe222('0xc')](function(_0x3d307b){logger[_0xe222('0xd')](_0xe222('0xe'),_0x3e5090,'request\x20sent');logger[_0xe222('0xf')](_0xe222('0x10'),_0x3e5090,'request\x20sent',JSON[_0xe222('0x11')](_0x3d307b));if(_0x3d307b[_0xe222('0x12')]){if(_0x3d307b[_0xe222('0x12')][_0xe222('0x13')]===0x1f4){logger[_0xe222('0x12')](_0xe222('0xe'),_0x3e5090,_0x3d307b[_0xe222('0x12')][_0xe222('0x14')]);return _0xf55b06(_0x3d307b['error'][_0xe222('0x14')]);}logger[_0xe222('0x12')](_0xe222('0xe'),_0x3e5090,_0x3d307b['error']['message']);return _0x97f0f2(_0x3d307b[_0xe222('0x12')][_0xe222('0x14')]);}else{logger[_0xe222('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3e5090,_0xe222('0x15'));_0x97f0f2(_0x3d307b[_0xe222('0x16')]['message']);}})[_0xe222('0x17')](function(_0x410280){logger[_0xe222('0x12')](_0xe222('0xe'),_0x3e5090,_0x410280);_0xf55b06(_0x410280);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index dbff5f6..b0af503 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 _0xdeb3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','create','put','update','delete','multer','util','path'];(function(_0x461f1a,_0x3e38d5){var _0x399267=function(_0x5410a2){while(--_0x5410a2){_0x461f1a['push'](_0x461f1a['shift']());}};_0x399267(++_0x3e38d5);}(_0xdeb3,0xeb));var _0x3deb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdeb3[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var path=require(_0x3deb('0x2'));var timeout=require(_0x3deb('0x3'));var express=require(_0x3deb('0x4'));var router=express[_0x3deb('0x5')]();var fs_extra=require(_0x3deb('0x6'));var auth=require(_0x3deb('0x7'));var interaction=require(_0x3deb('0x8'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xa')]);router[_0x3deb('0xb')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller['show']);router['post']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xd')]);router[_0x3deb('0xe')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller[_0x3deb('0xf')]);router[_0x3deb('0x10')](_0x3deb('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b37=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x2b37,0x12b));var _0x72b3=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x2b37[_0x4521e3];return _0x46a272;};'use strict';var multer=require(_0x72b3('0x0'));var util=require(_0x72b3('0x1'));var path=require(_0x72b3('0x2'));var timeout=require(_0x72b3('0x3'));var express=require(_0x72b3('0x4'));var router=express[_0x72b3('0x5')]();var fs_extra=require(_0x72b3('0x6'));var auth=require(_0x72b3('0x7'));var interaction=require(_0x72b3('0x8'));var config=require(_0x72b3('0x9'));var controller=require('./variable.controller');router[_0x72b3('0xa')]('/',auth[_0x72b3('0xb')](),controller['index']);router[_0x72b3('0xa')](_0x72b3('0xc'),auth[_0x72b3('0xb')](),controller['show']);router[_0x72b3('0xd')]('/',auth[_0x72b3('0xb')](),controller[_0x72b3('0xe')]);router['put'](_0x72b3('0xc'),auth[_0x72b3('0xb')](),controller[_0x72b3('0xf')]);router[_0x72b3('0x10')](_0x72b3('0xc'),auth[_0x72b3('0xb')](),controller[_0x72b3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b293397..c74b148 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 _0xbaad=['STRING','name','sequelize','exports'];(function(_0x3d2015,_0x4a0528){var _0x5b5ba1=function(_0xb41b7d){while(--_0xb41b7d){_0x3d2015['push'](_0x3d2015['shift']());}};_0x5b5ba1(++_0x4a0528);}(_0xbaad,0x1e6));var _0xdbaa=function(_0x591624,_0x462f1b){_0x591624=_0x591624-0x0;var _0x5b70f4=_0xbaad[_0x591624];return _0x5b70f4;};'use strict';var Sequelize=require(_0xdbaa('0x0'));module[_0xdbaa('0x1')]={'name':{'type':Sequelize[_0xdbaa('0x2')],'unique':_0xdbaa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdbaa('0x2')]}}; \ No newline at end of file +var _0x2b7c=['exports','STRING','sequelize'];(function(_0x49a57f,_0x405f38){var _0x2fa2a5=function(_0x359a98){while(--_0x359a98){_0x49a57f['push'](_0x49a57f['shift']());}};_0x2fa2a5(++_0x405f38);}(_0x2b7c,0x158));var _0xc2b7=function(_0xa3bbd9,_0x337116){_0xa3bbd9=_0xa3bbd9-0x0;var _0x298a1e=_0x2b7c[_0xa3bbd9];return _0x298a1e;};'use strict';var Sequelize=require(_0xc2b7('0x0'));module[_0xc2b7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc2b7('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index ad95d8c..38b2c35 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 _0xa577=['then','UserProfileResource','destroy','error','stack','name','send','index','Variable','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','get','role','Variables','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update'];(function(_0x5a10c4,_0x552377){var _0x1b093a=function(_0x1ccaff){while(--_0x1ccaff){_0x5a10c4['push'](_0x5a10c4['shift']());}};_0x1b093a(++_0x552377);}(_0xa577,0x126));var _0x7a57=function(_0x574a6f,_0x284b4c){_0x574a6f=_0x574a6f-0x0;var _0x5eb03c=_0xa577[_0x574a6f];return _0x5eb03c;};'use strict';var emlformat=require(_0x7a57('0x0'));var rimraf=require(_0x7a57('0x1'));var zipdir=require(_0x7a57('0x2'));var jsonpatch=require(_0x7a57('0x3'));var rp=require(_0x7a57('0x4'));var moment=require(_0x7a57('0x5'));var BPromise=require(_0x7a57('0x6'));var Mustache=require(_0x7a57('0x7'));var util=require(_0x7a57('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7a57('0x9'));var ejs=require(_0x7a57('0xa'));var fs=require('fs');var fs_extra=require(_0x7a57('0xb'));var _=require(_0x7a57('0xc'));var squel=require(_0x7a57('0xd'));var crypto=require(_0x7a57('0xe'));var jsforce=require(_0x7a57('0xf'));var deskjs=require(_0x7a57('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7a57('0x11'));var Papa=require(_0x7a57('0x12'));var Redis=require(_0x7a57('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7a57('0x14'));var as=require(_0x7a57('0x15'));var hardwareService=require(_0x7a57('0x16'));var logger=require(_0x7a57('0x17'))(_0x7a57('0x18'));var utils=require('../../config/utils');var config=require(_0x7a57('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a57('0x1a'))['db'];function respondWithStatusCode(_0x2d4d3a,_0x22257a){_0x22257a=_0x22257a||0xcc;return function(_0x5b5bec){if(_0x5b5bec){return _0x2d4d3a[_0x7a57('0x1b')](_0x22257a);}return _0x2d4d3a[_0x7a57('0x1c')](_0x22257a)['end']();};}function respondWithResult(_0x2221a1,_0x380eef){_0x380eef=_0x380eef||0xc8;return function(_0x39167a){if(_0x39167a){return _0x2221a1[_0x7a57('0x1c')](_0x380eef)[_0x7a57('0x1d')](_0x39167a);}};}function respondWithFilteredResult(_0x450779,_0x4f96d1){return function(_0x3e7e37){if(_0x3e7e37){var _0x4fb55e=typeof _0x4f96d1['offset']==='undefined'&&typeof _0x4f96d1['limit']===_0x7a57('0x1e');var _0xaebf10=_0x3e7e37[_0x7a57('0x1f')];var _0x3ecb6d=_0x4fb55e?0x0:_0x4f96d1[_0x7a57('0x20')];var _0x25f4b3=_0x4fb55e?_0x3e7e37[_0x7a57('0x1f')]:_0x4f96d1[_0x7a57('0x20')]+_0x4f96d1[_0x7a57('0x21')];var _0x23d4ae;if(_0x25f4b3>=_0xaebf10){_0x25f4b3=_0xaebf10;_0x23d4ae=0xc8;}else{_0x23d4ae=0xce;}_0x450779['status'](_0x23d4ae);return _0x450779['set'](_0x7a57('0x22'),_0x3ecb6d+'-'+_0x25f4b3+'/'+_0xaebf10)[_0x7a57('0x1d')](_0x3e7e37);}return null;};}function patchUpdates(_0x333ea7){return function(_0x2f0506){try{jsonpatch[_0x7a57('0x23')](_0x2f0506,_0x333ea7,!![]);}catch(_0xdb9da0){return BPromise[_0x7a57('0x24')](_0xdb9da0);}return _0x2f0506['save']();};}function saveUpdates(_0x3e5d88,_0x54c6ad){return function(_0x31cf55){if(_0x31cf55){return _0x31cf55[_0x7a57('0x25')](_0x3e5d88)[_0x7a57('0x26')](function(_0x2e9854){return _0x2e9854;});}return null;};}function removeEntity(_0x1fa6f0,_0x201248){return function(_0x40c534){if(_0x40c534){return _0x40c534['destroy']()[_0x7a57('0x26')](function(){var _0x140088=_0x40c534['get']({'plain':!![]});var _0x5019c1='Variables';return db[_0x7a57('0x27')][_0x7a57('0x28')]({'where':{'type':_0x5019c1,'resourceId':_0x140088['id']}})['then'](function(){return _0x40c534;});})[_0x7a57('0x26')](function(){_0x1fa6f0[_0x7a57('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3215e5,_0x1aff80){return function(_0x3fda2c){if(!_0x3fda2c){_0x3215e5[_0x7a57('0x1b')](0x194);}return _0x3fda2c;};}function handleError(_0x21d81b,_0x1cd648){_0x1cd648=_0x1cd648||0x1f4;return function(_0x13b090){logger[_0x7a57('0x29')](_0x13b090[_0x7a57('0x2a')]);if(_0x13b090[_0x7a57('0x2b')]){delete _0x13b090[_0x7a57('0x2b')];}_0x21d81b[_0x7a57('0x1c')](_0x1cd648)[_0x7a57('0x2c')](_0x13b090);};}exports[_0x7a57('0x2d')]=function(_0x4f014b,_0x24e10b){var _0x579382={},_0x1654e7={},_0x587e39={'count':0x0,'rows':[]};var _0x49a3ea=_['map'](db[_0x7a57('0x2e')]['rawAttributes'],function(_0x59de86){return{'name':_0x59de86[_0x7a57('0x2f')],'type':_0x59de86['type'][_0x7a57('0x30')]};});_0x1654e7['model']=_[_0x7a57('0x31')](_0x49a3ea,'name');_0x1654e7[_0x7a57('0x32')]=_[_0x7a57('0x33')](_0x4f014b['query']);_0x1654e7[_0x7a57('0x34')]=_[_0x7a57('0x35')](_0x1654e7[_0x7a57('0x36')],_0x1654e7[_0x7a57('0x32')]);_0x579382['attributes']=_[_0x7a57('0x35')](_0x1654e7[_0x7a57('0x36')],qs[_0x7a57('0x37')](_0x4f014b[_0x7a57('0x32')]['fields']));_0x579382[_0x7a57('0x38')]=_0x579382[_0x7a57('0x38')][_0x7a57('0x39')]?_0x579382['attributes']:_0x1654e7['model'];if(!_0x4f014b[_0x7a57('0x32')][_0x7a57('0x3a')](_0x7a57('0x3b'))){_0x579382[_0x7a57('0x21')]=qs['limit'](_0x4f014b['query'][_0x7a57('0x21')]);_0x579382[_0x7a57('0x20')]=qs[_0x7a57('0x20')](_0x4f014b[_0x7a57('0x32')][_0x7a57('0x20')]);}_0x579382[_0x7a57('0x3c')]=qs[_0x7a57('0x3d')](_0x4f014b[_0x7a57('0x32')]['sort']);_0x579382[_0x7a57('0x3e')]=qs['filters'](_['pick'](_0x4f014b[_0x7a57('0x32')],_0x1654e7[_0x7a57('0x34')]),_0x49a3ea);if(_0x4f014b[_0x7a57('0x32')]['filter']){_0x579382[_0x7a57('0x3e')]=_[_0x7a57('0x3f')](_0x579382[_0x7a57('0x3e')],{'$or':_[_0x7a57('0x31')](_0x49a3ea,function(_0x2af274){if(_0x2af274[_0x7a57('0x40')]!=='VIRTUAL'){var _0x5950cb={};_0x5950cb[_0x2af274[_0x7a57('0x2b')]]={'$like':'%'+_0x4f014b['query'][_0x7a57('0x41')]+'%'};return _0x5950cb;}})});}_0x579382=_['merge']({},_0x579382,_0x4f014b[_0x7a57('0x42')]);var _0x53e071={'where':_0x579382[_0x7a57('0x3e')]};return db[_0x7a57('0x2e')][_0x7a57('0x1f')](_0x53e071)['then'](function(_0x4a6a94){_0x587e39[_0x7a57('0x1f')]=_0x4a6a94;if(_0x4f014b[_0x7a57('0x32')][_0x7a57('0x43')]){_0x579382['include']=[{'all':!![]}];}return db[_0x7a57('0x2e')][_0x7a57('0x44')](_0x579382);})[_0x7a57('0x26')](function(_0x24307c){_0x587e39[_0x7a57('0x45')]=_0x24307c;return _0x587e39;})[_0x7a57('0x26')](respondWithFilteredResult(_0x24e10b,_0x579382))[_0x7a57('0x46')](handleError(_0x24e10b,null));};exports[_0x7a57('0x47')]=function(_0x311b84,_0x5b1f6c){var _0x2ef59f={'raw':!![],'where':{'id':_0x311b84[_0x7a57('0x48')]['id']}},_0x1d603c={};_0x1d603c[_0x7a57('0x36')]=_['keys'](db[_0x7a57('0x2e')]['rawAttributes']);_0x1d603c[_0x7a57('0x32')]=_[_0x7a57('0x33')](_0x311b84[_0x7a57('0x32')]);_0x1d603c[_0x7a57('0x34')]=_[_0x7a57('0x35')](_0x1d603c['model'],_0x1d603c[_0x7a57('0x32')]);_0x2ef59f[_0x7a57('0x38')]=_['intersection'](_0x1d603c[_0x7a57('0x36')],qs[_0x7a57('0x37')](_0x311b84[_0x7a57('0x32')][_0x7a57('0x37')]));_0x2ef59f[_0x7a57('0x38')]=_0x2ef59f[_0x7a57('0x38')][_0x7a57('0x39')]?_0x2ef59f[_0x7a57('0x38')]:_0x1d603c[_0x7a57('0x36')];if(_0x311b84[_0x7a57('0x32')]['includeAll']){_0x2ef59f[_0x7a57('0x49')]=[{'all':!![]}];}_0x2ef59f=_[_0x7a57('0x3f')]({},_0x2ef59f,_0x311b84['options']);return db['Variable'][_0x7a57('0x4a')](_0x2ef59f)[_0x7a57('0x26')](handleEntityNotFound(_0x5b1f6c,null))[_0x7a57('0x26')](respondWithResult(_0x5b1f6c,null))[_0x7a57('0x46')](handleError(_0x5b1f6c,null));};exports[_0x7a57('0x4b')]=function(_0x42c353,_0x3cc40f){return db[_0x7a57('0x2e')][_0x7a57('0x4b')](_0x42c353['body'],{})[_0x7a57('0x26')](function(_0x264d2a){var _0x284002=_0x42c353['user'][_0x7a57('0x4c')]({'plain':!![]});if(!_0x284002)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x284002[_0x7a57('0x4d')]==='user'){var _0x69692a=_0x264d2a['get']({'plain':!![]});var _0x9a377=_0x7a57('0x4e');return db['UserProfileSection'][_0x7a57('0x4a')]({'where':{'name':_0x9a377,'userProfileId':_0x284002[_0x7a57('0x4f')]},'raw':!![]})[_0x7a57('0x26')](function(_0x503070){if(_0x503070&&_0x503070[_0x7a57('0x50')]===0x0){return db[_0x7a57('0x27')][_0x7a57('0x4b')]({'name':_0x69692a[_0x7a57('0x2b')],'resourceId':_0x69692a['id'],'type':_0x503070[_0x7a57('0x2b')],'sectionId':_0x503070['id']},{})[_0x7a57('0x26')](function(){return _0x264d2a;});}else{return _0x264d2a;}})[_0x7a57('0x46')](function(_0x2267b2){logger[_0x7a57('0x29')](_0x7a57('0x51'),_0x2267b2);throw _0x2267b2;});}return _0x264d2a;})[_0x7a57('0x26')](respondWithResult(_0x3cc40f,0xc9))[_0x7a57('0x46')](handleError(_0x3cc40f,null));};exports[_0x7a57('0x25')]=function(_0x12711f,_0x40df33){if(_0x12711f[_0x7a57('0x52')]['id']){delete _0x12711f[_0x7a57('0x52')]['id'];}return db[_0x7a57('0x2e')][_0x7a57('0x4a')]({'where':{'id':_0x12711f['params']['id']}})[_0x7a57('0x26')](handleEntityNotFound(_0x40df33,null))['then'](saveUpdates(_0x12711f['body'],null))['then'](respondWithResult(_0x40df33,null))['catch'](handleError(_0x40df33,null));};exports[_0x7a57('0x28')]=function(_0x4d202e,_0x2dc87f){return db[_0x7a57('0x2e')]['find']({'where':{'id':_0x4d202e[_0x7a57('0x48')]['id']}})['then'](handleEntityNotFound(_0x2dc87f,null))[_0x7a57('0x26')](removeEntity(_0x2dc87f,null))[_0x7a57('0x46')](handleError(_0x2dc87f,null));}; \ No newline at end of file +var _0x0640=['map','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','type','Variable','includeAll','include','catch','show','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','error','name','send','rawAttributes','model'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0x0640,0x6a));var _0x0064=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x0640[_0x5bfb78];return _0x4efd00;};'use strict';var emlformat=require(_0x0064('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0064('0x1'));var jsonpatch=require(_0x0064('0x2'));var rp=require(_0x0064('0x3'));var moment=require('moment');var BPromise=require(_0x0064('0x4'));var Mustache=require(_0x0064('0x5'));var util=require(_0x0064('0x6'));var path=require('path');var sox=require(_0x0064('0x7'));var csv=require(_0x0064('0x8'));var ejs=require(_0x0064('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0064('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0064('0xb'));var deskjs=require(_0x0064('0xc'));var toCsv=require(_0x0064('0x8'));var querystring=require(_0x0064('0xd'));var Papa=require(_0x0064('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0064('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0064('0x10'));var logger=require(_0x0064('0x11'))(_0x0064('0x12'));var utils=require(_0x0064('0x13'));var config=require(_0x0064('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0064('0x15'))['db'];function respondWithStatusCode(_0x380f45,_0x542a3b){_0x542a3b=_0x542a3b||0xcc;return function(_0x2ad485){if(_0x2ad485){return _0x380f45[_0x0064('0x16')](_0x542a3b);}return _0x380f45[_0x0064('0x17')](_0x542a3b)[_0x0064('0x18')]();};}function respondWithResult(_0x1402b0,_0x45a546){_0x45a546=_0x45a546||0xc8;return function(_0x20649f){if(_0x20649f){return _0x1402b0[_0x0064('0x17')](_0x45a546)[_0x0064('0x19')](_0x20649f);}};}function respondWithFilteredResult(_0x104529,_0x2047fe){return function(_0x27c7f3){if(_0x27c7f3){var _0x423d54=typeof _0x2047fe[_0x0064('0x1a')]===_0x0064('0x1b')&&typeof _0x2047fe[_0x0064('0x1c')]===_0x0064('0x1b');var _0x682e48=_0x27c7f3[_0x0064('0x1d')];var _0x465ae6=_0x423d54?0x0:_0x2047fe['offset'];var _0x5d802f=_0x423d54?_0x27c7f3[_0x0064('0x1d')]:_0x2047fe['offset']+_0x2047fe[_0x0064('0x1c')];var _0x4ad507;if(_0x5d802f>=_0x682e48){_0x5d802f=_0x682e48;_0x4ad507=0xc8;}else{_0x4ad507=0xce;}_0x104529[_0x0064('0x17')](_0x4ad507);return _0x104529[_0x0064('0x1e')](_0x0064('0x1f'),_0x465ae6+'-'+_0x5d802f+'/'+_0x682e48)[_0x0064('0x19')](_0x27c7f3);}return null;};}function patchUpdates(_0x52d9f3){return function(_0x4418b9){try{jsonpatch[_0x0064('0x20')](_0x4418b9,_0x52d9f3,!![]);}catch(_0x4d6516){return BPromise[_0x0064('0x21')](_0x4d6516);}return _0x4418b9[_0x0064('0x22')]();};}function saveUpdates(_0x337683,_0x23488a){return function(_0x4af483){if(_0x4af483){return _0x4af483[_0x0064('0x23')](_0x337683)['then'](function(_0x2cf9a2){return _0x2cf9a2;});}return null;};}function removeEntity(_0x123318,_0x3ae6dc){return function(_0xa254fb){if(_0xa254fb){return _0xa254fb[_0x0064('0x24')]()[_0x0064('0x25')](function(){var _0x1e5c50=_0xa254fb[_0x0064('0x26')]({'plain':!![]});var _0x4cf5e2=_0x0064('0x27');return db[_0x0064('0x28')][_0x0064('0x24')]({'where':{'type':_0x4cf5e2,'resourceId':_0x1e5c50['id']}})[_0x0064('0x25')](function(){return _0xa254fb;});})[_0x0064('0x25')](function(){_0x123318[_0x0064('0x17')](0xcc)[_0x0064('0x18')]();});}};}function handleEntityNotFound(_0x2deacc,_0x3b9446){return function(_0xd22b76){if(!_0xd22b76){_0x2deacc['sendStatus'](0x194);}return _0xd22b76;};}function handleError(_0x559db6,_0x2831ea){_0x2831ea=_0x2831ea||0x1f4;return function(_0xe6f8c0){logger[_0x0064('0x29')](_0xe6f8c0['stack']);if(_0xe6f8c0[_0x0064('0x2a')]){delete _0xe6f8c0[_0x0064('0x2a')];}_0x559db6['status'](_0x2831ea)[_0x0064('0x2b')](_0xe6f8c0);};}exports['index']=function(_0x51eeef,_0x2b5c85){var _0x33e4f7={},_0x371c9b={},_0x5c9126={'count':0x0,'rows':[]};var _0x3bbf8c=_['map'](db['Variable'][_0x0064('0x2c')],function(_0x465d48){return{'name':_0x465d48['fieldName'],'type':_0x465d48['type']['key']};});_0x371c9b[_0x0064('0x2d')]=_[_0x0064('0x2e')](_0x3bbf8c,_0x0064('0x2a'));_0x371c9b[_0x0064('0x2f')]=_[_0x0064('0x30')](_0x51eeef[_0x0064('0x2f')]);_0x371c9b[_0x0064('0x31')]=_[_0x0064('0x32')](_0x371c9b[_0x0064('0x2d')],_0x371c9b[_0x0064('0x2f')]);_0x33e4f7[_0x0064('0x33')]=_[_0x0064('0x32')](_0x371c9b['model'],qs[_0x0064('0x34')](_0x51eeef['query']['fields']));_0x33e4f7[_0x0064('0x33')]=_0x33e4f7[_0x0064('0x33')]['length']?_0x33e4f7['attributes']:_0x371c9b[_0x0064('0x2d')];if(!_0x51eeef[_0x0064('0x2f')]['hasOwnProperty'](_0x0064('0x35'))){_0x33e4f7[_0x0064('0x1c')]=qs[_0x0064('0x1c')](_0x51eeef[_0x0064('0x2f')][_0x0064('0x1c')]);_0x33e4f7['offset']=qs[_0x0064('0x1a')](_0x51eeef['query'][_0x0064('0x1a')]);}_0x33e4f7['order']=qs[_0x0064('0x36')](_0x51eeef[_0x0064('0x2f')][_0x0064('0x36')]);_0x33e4f7['where']=qs['filters'](_[_0x0064('0x37')](_0x51eeef[_0x0064('0x2f')],_0x371c9b['filters']),_0x3bbf8c);if(_0x51eeef[_0x0064('0x2f')][_0x0064('0x38')]){_0x33e4f7[_0x0064('0x39')]=_[_0x0064('0x3a')](_0x33e4f7[_0x0064('0x39')],{'$or':_[_0x0064('0x2e')](_0x3bbf8c,function(_0x300fe3){if(_0x300fe3[_0x0064('0x3b')]!=='VIRTUAL'){var _0x27ec4e={};_0x27ec4e[_0x300fe3[_0x0064('0x2a')]]={'$like':'%'+_0x51eeef['query'][_0x0064('0x38')]+'%'};return _0x27ec4e;}})});}_0x33e4f7=_['merge']({},_0x33e4f7,_0x51eeef['options']);var _0x34c1ea={'where':_0x33e4f7[_0x0064('0x39')]};return db[_0x0064('0x3c')][_0x0064('0x1d')](_0x34c1ea)['then'](function(_0x2651d5){_0x5c9126['count']=_0x2651d5;if(_0x51eeef[_0x0064('0x2f')][_0x0064('0x3d')]){_0x33e4f7[_0x0064('0x3e')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x33e4f7);})['then'](function(_0x2880db){_0x5c9126['rows']=_0x2880db;return _0x5c9126;})['then'](respondWithFilteredResult(_0x2b5c85,_0x33e4f7))[_0x0064('0x3f')](handleError(_0x2b5c85,null));};exports[_0x0064('0x40')]=function(_0x3171e4,_0x389145){var _0x2eb479={'raw':!![],'where':{'id':_0x3171e4['params']['id']}},_0x1624aa={};_0x1624aa[_0x0064('0x2d')]=_[_0x0064('0x30')](db['Variable'][_0x0064('0x2c')]);_0x1624aa[_0x0064('0x2f')]=_['keys'](_0x3171e4[_0x0064('0x2f')]);_0x1624aa['filters']=_['intersection'](_0x1624aa[_0x0064('0x2d')],_0x1624aa[_0x0064('0x2f')]);_0x2eb479[_0x0064('0x33')]=_[_0x0064('0x32')](_0x1624aa[_0x0064('0x2d')],qs['fields'](_0x3171e4['query'][_0x0064('0x34')]));_0x2eb479['attributes']=_0x2eb479['attributes']['length']?_0x2eb479['attributes']:_0x1624aa[_0x0064('0x2d')];if(_0x3171e4[_0x0064('0x2f')][_0x0064('0x3d')]){_0x2eb479[_0x0064('0x3e')]=[{'all':!![]}];}_0x2eb479=_[_0x0064('0x3a')]({},_0x2eb479,_0x3171e4[_0x0064('0x41')]);return db[_0x0064('0x3c')][_0x0064('0x42')](_0x2eb479)[_0x0064('0x25')](handleEntityNotFound(_0x389145,null))['then'](respondWithResult(_0x389145,null))[_0x0064('0x3f')](handleError(_0x389145,null));};exports[_0x0064('0x43')]=function(_0x337a4f,_0x592ab9){return db[_0x0064('0x3c')][_0x0064('0x43')](_0x337a4f['body'],{})['then'](function(_0x3bbbfd){var _0xa25c2c=_0x337a4f[_0x0064('0x44')][_0x0064('0x26')]({'plain':!![]});if(!_0xa25c2c)throw new Error(_0x0064('0x45'));if(_0xa25c2c['role']===_0x0064('0x44')){var _0x5ae2d3=_0x3bbbfd[_0x0064('0x26')]({'plain':!![]});var _0xf61053=_0x0064('0x27');return db[_0x0064('0x46')][_0x0064('0x42')]({'where':{'name':_0xf61053,'userProfileId':_0xa25c2c[_0x0064('0x47')]},'raw':!![]})['then'](function(_0x37dec8){if(_0x37dec8&&_0x37dec8[_0x0064('0x48')]===0x0){return db[_0x0064('0x28')][_0x0064('0x43')]({'name':_0x5ae2d3[_0x0064('0x2a')],'resourceId':_0x5ae2d3['id'],'type':_0x37dec8['name'],'sectionId':_0x37dec8['id']},{})['then'](function(){return _0x3bbbfd;});}else{return _0x3bbbfd;}})[_0x0064('0x3f')](function(_0x4a0a1d){logger['error'](_0x0064('0x49'),_0x4a0a1d);throw _0x4a0a1d;});}return _0x3bbbfd;})[_0x0064('0x25')](respondWithResult(_0x592ab9,0xc9))['catch'](handleError(_0x592ab9,null));};exports[_0x0064('0x23')]=function(_0x201cf0,_0x244892){if(_0x201cf0[_0x0064('0x4a')]['id']){delete _0x201cf0[_0x0064('0x4a')]['id'];}return db[_0x0064('0x3c')][_0x0064('0x42')]({'where':{'id':_0x201cf0['params']['id']}})['then'](handleEntityNotFound(_0x244892,null))['then'](saveUpdates(_0x201cf0['body'],null))[_0x0064('0x25')](respondWithResult(_0x244892,null))[_0x0064('0x3f')](handleError(_0x244892,null));};exports[_0x0064('0x24')]=function(_0x35e604,_0x29fbf5){return db[_0x0064('0x3c')][_0x0064('0x42')]({'where':{'id':_0x35e604[_0x0064('0x4b')]['id']}})[_0x0064('0x25')](handleEntityNotFound(_0x29fbf5,null))[_0x0064('0x25')](removeEntity(_0x29fbf5,null))['catch'](handleError(_0x29fbf5,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8d08465..8bb545a 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 _0xb349=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./variable.attributes','define'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0xb349,0x1dd));var _0x9b34=function(_0x4f2a06,_0xbfb645){_0x4f2a06=_0x4f2a06-0x0;var _0x2ae47d=_0xb349[_0x4f2a06];return _0x2ae47d;};'use strict';var _=require(_0x9b34('0x0'));var util=require(_0x9b34('0x1'));var logger=require(_0x9b34('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9b34('0x3'));var rp=require(_0x9b34('0x4'));var fs=require('fs');var path=require(_0x9b34('0x5'));var rimraf=require(_0x9b34('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b34('0x7'));module['exports']=function(_0x280170,_0x254290){return _0x280170[_0x9b34('0x8')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cac=['request-promise','path','rimraf','../../config/environment','exports','Variable','tools_variables','util','../../config/logger','bluebird'];(function(_0x191140,_0x17e2f7){var _0x2567af=function(_0x4780f1){while(--_0x4780f1){_0x191140['push'](_0x191140['shift']());}};_0x2567af(++_0x17e2f7);}(_0x6cac,0x16f));var _0xc6ca=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6cac[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xc6ca('0x0'));var logger=require(_0xc6ca('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc6ca('0x2'));var rp=require(_0xc6ca('0x3'));var fs=require('fs');var path=require(_0xc6ca('0x4'));var rimraf=require(_0xc6ca('0x5'));var config=require(_0xc6ca('0x6'));var attributes=require('./variable.attributes');module[_0xc6ca('0x7')]=function(_0x28f37f,_0x137c14){return _0x28f37f['define'](_0xc6ca('0x8'),attributes,{'tableName':_0xc6ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 330a5b3..6748d24 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 _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x5a5a98,_0x74f555){var _0x7d43ef=function(_0x36116a){while(--_0x36116a){_0x5a5a98['push'](_0x5a5a98['shift']());}};_0x7d43ef(++_0x74f555);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x4b84[_0x5a26f5];return _0x2e9ef7;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file +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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x326f,0xd1));var _0xf326=function(_0x194fdd,_0x40e869){_0x194fdd=_0x194fdd-0x0;var _0x8d6b0e=_0x326f[_0x194fdd];return _0x8d6b0e;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 78ae18b..bee8be8 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 _0xa2e2=['exports','express','Router','../../components/auth/service','./version.controller','index','isAuthenticated','canUpdate','fetch','get','/reset','/pull','pull','restart','/migrations','migrations'];(function(_0x3dc670,_0x453cb9){var _0x2a27ad=function(_0x376a55){while(--_0x376a55){_0x3dc670['push'](_0x3dc670['shift']());}};_0x2a27ad(++_0x453cb9);}(_0xa2e2,0xb1));var _0x2a2e=function(_0x1abb18,_0x3960ec){_0x1abb18=_0x1abb18-0x0;var _0x2a4e44=_0xa2e2[_0x1abb18];return _0x2a4e44;};'use strict';var express=require(_0x2a2e('0x0'));var router=express[_0x2a2e('0x1')]();var auth=require(_0x2a2e('0x2'));var controller=require(_0x2a2e('0x3'));router['get']('/',controller[_0x2a2e('0x4')]);router['get']('/fetch',auth[_0x2a2e('0x5')](),auth[_0x2a2e('0x6')](),controller[_0x2a2e('0x7')]);router[_0x2a2e('0x8')](_0x2a2e('0x9'),auth[_0x2a2e('0x5')](),auth[_0x2a2e('0x6')](),controller['reset']);router['get'](_0x2a2e('0xa'),auth['isAuthenticated'](),auth[_0x2a2e('0x6')](),controller[_0x2a2e('0xb')]);router[_0x2a2e('0x8')]('/restart',auth['isAuthenticated'](),controller[_0x2a2e('0xc')]);router['get'](_0x2a2e('0xd'),controller[_0x2a2e('0xe')]);module[_0x2a2e('0xf')]=router; \ No newline at end of file +var _0xbe44=['pull','restart','migrations','express','Router','./version.controller','index','get','isAuthenticated','fetch','/reset','reset','/pull','canUpdate'];(function(_0x11eab5,_0x4a1891){var _0x261560=function(_0x42383d){while(--_0x42383d){_0x11eab5['push'](_0x11eab5['shift']());}};_0x261560(++_0x4a1891);}(_0xbe44,0x199));var _0x4be4=function(_0x3c3698,_0xa0bf08){_0x3c3698=_0x3c3698-0x0;var _0x4e6637=_0xbe44[_0x3c3698];return _0x4e6637;};'use strict';var express=require(_0x4be4('0x0'));var router=express[_0x4be4('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x4be4('0x2'));router['get']('/',controller[_0x4be4('0x3')]);router[_0x4be4('0x4')]('/fetch',auth[_0x4be4('0x5')](),auth['canUpdate'](),controller[_0x4be4('0x6')]);router[_0x4be4('0x4')](_0x4be4('0x7'),auth[_0x4be4('0x5')](),auth['canUpdate'](),controller[_0x4be4('0x8')]);router['get'](_0x4be4('0x9'),auth['isAuthenticated'](),auth[_0x4be4('0xa')](),controller[_0x4be4('0xb')]);router[_0x4be4('0x4')]('/restart',auth[_0x4be4('0x5')](),controller[_0x4be4('0xc')]);router[_0x4be4('0x4')]('/migrations',controller[_0x4be4('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ed955ba..fdd8977 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 _0x07dd=['motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','exports','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','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','lodash','version','compare-versions','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','restart'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x07dd,0xae));var _0xd07d=function(_0x1e5dd7,_0x1aff9a){_0x1e5dd7=_0x1e5dd7-0x0;var _0x48f942=_0x07dd[_0x1e5dd7];return _0x48f942;};'use strict';var Umzug=require('umzug');var path=require(_0xd07d('0x0'));var fs=require('fs');var _=require(_0xd07d('0x1'));var pkginfo=require('pkginfo')(module,_0xd07d('0x2'));var compareVersions=require(_0xd07d('0x3'));var exec=require('child_process')['exec'];var db=require(_0xd07d('0x4'))['db'];var config=require('../../config/environment');var pm2=require(_0xd07d('0x5'));var logger=require(_0xd07d('0x6'))(_0xd07d('0x7'));var git=require(_0xd07d('0x8'))(config[_0xd07d('0x9')]);exports[_0xd07d('0xa')]=function(_0x3eb0cd,_0x2ac4d1){var _0x21825d={'current':module['exports'][_0xd07d('0x2')],'phonebar':0x2};if(_0x3eb0cd[_0xd07d('0xb')]&&_0x3eb0cd[_0xd07d('0xb')]['latest']){return git[_0xd07d('0xc')]()[_0xd07d('0xd')](function(_0x1facf3,_0x335a75){_0x21825d[_0xd07d('0xe')]=(_0x1facf3?module['exports'][_0xd07d('0x2')]:_0x335a75[_0xd07d('0xe')])||_0xd07d('0xf');return _0x2ac4d1[_0xd07d('0x10')](0xc8)[_0xd07d('0x11')](_0x21825d);});}else{return _0x2ac4d1[_0xd07d('0x10')](0xc8)['json'](_0x21825d);}};exports[_0xd07d('0xc')]=function(_0x46aada,_0x4f3917){return git[_0xd07d('0xc')]([_0xd07d('0x12'),_0xd07d('0x13')],function(_0x46344c){if(_0x46344c){logger[_0xd07d('0x14')](_0x46344c);return _0x4f3917['status'](0x1f4)[_0xd07d('0x11')](_0x46344c);}logger['info'](_0xd07d('0x15'));return _0x4f3917[_0xd07d('0x10')](0xc8)['json']({'output':_0xd07d('0x16')});});};exports[_0xd07d('0x17')]=function(_0x239fd5,_0x596a65){return git[_0xd07d('0x17')]([_0xd07d('0x18'),_0xd07d('0x19')],function(_0x3fea99){if(_0x3fea99){logger['error'](_0x3fea99);return _0x596a65[_0xd07d('0x10')](0x1f4)['json'](_0x3fea99);}logger[_0xd07d('0x1a')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x596a65[_0xd07d('0x10')](0xc8)[_0xd07d('0x11')]({'output':_0xd07d('0x1b')});});};exports[_0xd07d('0x1c')]=function(_0x3e9969,_0x20b5c2){exec('npm\x20install\x20--production',function(_0xd6d90e,_0x25e1e4,_0x30c5bb){logger[_0xd07d('0x1a')](_0x25e1e4);logger[_0xd07d('0x1a')](_0x30c5bb);if(_0xd6d90e){logger[_0xd07d('0x14')](_0xd6d90e);return _0x20b5c2[_0xd07d('0x10')](0x1f4)['json'](_0xd6d90e);}return _0x20b5c2[_0xd07d('0x10')](0xc8)[_0xd07d('0x11')]({'output':_0x25e1e4});});};exports[_0xd07d('0x1d')]=function(_0xca9e7d,_0x470df4){return pm2[_0xd07d('0x1d')](_0xd07d('0x1e'))['then'](function(_0x2ae634){logger[_0xd07d('0x1a')](_0xd07d('0x1f'),_0x2ae634);return _0x470df4[_0xd07d('0x10')](0xc8)[_0xd07d('0x11')]({'output':_0xd07d('0x20')});})[_0xd07d('0x21')](function(_0x57161e){logger['error'](_0x57161e);return _0x470df4[_0xd07d('0x10')](0x1f4)[_0xd07d('0x11')](_0x57161e);});};exports[_0xd07d('0x22')]=function(_0x1d3523,_0x15ae76){var _0x5aaba4=fs[_0xd07d('0x23')](path[_0xd07d('0x24')](config[_0xd07d('0x9')],_0xd07d('0x25'),'migrations'));var _0x1e284a=[];for(var _0x5621d5=0x0;_0x5621d5<_0x5aaba4[_0xd07d('0x26')];_0x5621d5++){var _0x3cf12d=_0x5aaba4[_0x5621d5]['replace'](_0xd07d('0x27'),'');if(compareVersions(module[_0xd07d('0x28')][_0xd07d('0x2')],_0x3cf12d)===-0x1){_0x1e284a['push'](_0x3cf12d);}}if(_0x1e284a[_0xd07d('0x26')]){var _0x4e473d=_0x1e284a['sort'](compareVersions);var _0x2e7812=new Umzug({'storage':_0xd07d('0x29'),'storageOptions':{'model':db[_0xd07d('0x2a')],'modelName':_0xd07d('0x2a'),'columnName':_0xd07d('0x2')},'migrations':{'params':[db[_0xd07d('0x29')][_0xd07d('0x2b')](),db[_0xd07d('0x29')][_0xd07d('0x2c')],function(){throw new Error(_0xd07d('0x2d'));}],'path':path[_0xd07d('0x24')](config[_0xd07d('0x9')],_0xd07d('0x25'),_0xd07d('0x22')),'pattern':/\.js$/}});_0x2e7812['up']({'migrations':_[_0xd07d('0x2e')](_0x4e473d,function(_0x1fae6e){return _0x1fae6e+'.js';})})['then'](function(){return _0x15ae76['status'](0xc8)[_0xd07d('0x11')]({'output':_0xd07d('0x2f')+module['exports']['version']+_0xd07d('0x30')+_[_0xd07d('0x31')](_0x4e473d),'migrations':_[_0xd07d('0x24')](_0x4e473d)});})[_0xd07d('0x21')](function(_0x3dae38){if(_0x3dae38 instanceof db[_0xd07d('0x29')]['UniqueConstraintError']){return _0x15ae76['status'](0xc8)[_0xd07d('0x11')]({'output':_0xd07d('0x32')});}else{return _0x15ae76[_0xd07d('0x10')](0x1f4)['json'](_0x3dae38);}});}else{return _0x15ae76[_0xd07d('0x10')](0xc8)['json']({'output':_0xd07d('0x32')});}}; \ No newline at end of file +var _0x6db1=['../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','tags','2.0.0','status','json','fetch','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','server','length','.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','migrations','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0x6db1,0x67));var _0x16db=function(_0x1bfaed,_0x1e04ad){_0x1bfaed=_0x1bfaed-0x0;var _0x1b772a=_0x6db1[_0x1bfaed];return _0x1b772a;};'use strict';var Umzug=require(_0x16db('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x16db('0x1'));var pkginfo=require(_0x16db('0x2'))(module,_0x16db('0x3'));var compareVersions=require(_0x16db('0x4'));var exec=require(_0x16db('0x5'))[_0x16db('0x6')];var db=require(_0x16db('0x7'))['db'];var config=require(_0x16db('0x8'));var pm2=require(_0x16db('0x9'));var logger=require(_0x16db('0xa'))('update');var git=require(_0x16db('0xb'))(config[_0x16db('0xc')]);exports['index']=function(_0x300746,_0x3554bc){var _0x22cad6={'current':module[_0x16db('0xd')]['version'],'phonebar':0x2};if(_0x300746['query']&&_0x300746[_0x16db('0xe')][_0x16db('0xf')]){return git['fetch']()[_0x16db('0x10')](function(_0x17645e,_0x5a026e){_0x22cad6['latest']=(_0x17645e?module[_0x16db('0xd')][_0x16db('0x3')]:_0x5a026e[_0x16db('0xf')])||_0x16db('0x11');return _0x3554bc[_0x16db('0x12')](0xc8)['json'](_0x22cad6);});}else{return _0x3554bc['status'](0xc8)[_0x16db('0x13')](_0x22cad6);}};exports[_0x16db('0x14')]=function(_0x35322f,_0x82d9ec){return git[_0x16db('0x14')]([_0x16db('0x15'),'master'],function(_0x28fe5c){if(_0x28fe5c){logger[_0x16db('0x16')](_0x28fe5c);return _0x82d9ec[_0x16db('0x12')](0x1f4)[_0x16db('0x13')](_0x28fe5c);}logger['info'](_0x16db('0x17'));return _0x82d9ec[_0x16db('0x12')](0xc8)[_0x16db('0x13')]({'output':_0x16db('0x18')});});};exports[_0x16db('0x19')]=function(_0x33bcd2,_0x182c2b){return git[_0x16db('0x19')]([_0x16db('0x1a'),_0x16db('0x1b')],function(_0x1808e2){if(_0x1808e2){logger['error'](_0x1808e2);return _0x182c2b[_0x16db('0x12')](0x1f4)[_0x16db('0x13')](_0x1808e2);}logger[_0x16db('0x1c')](_0x16db('0x1d'));return _0x182c2b[_0x16db('0x12')](0xc8)[_0x16db('0x13')]({'output':_0x16db('0x1e')});});};exports[_0x16db('0x1f')]=function(_0x1db5a8,_0x4f5630){exec('npm\x20install\x20--production',function(_0x26485e,_0x47d7a8,_0x1e8ae1){logger[_0x16db('0x1c')](_0x47d7a8);logger[_0x16db('0x1c')](_0x1e8ae1);if(_0x26485e){logger[_0x16db('0x16')](_0x26485e);return _0x4f5630[_0x16db('0x12')](0x1f4)[_0x16db('0x13')](_0x26485e);}return _0x4f5630[_0x16db('0x12')](0xc8)[_0x16db('0x13')]({'output':_0x47d7a8});});};exports['restart']=function(_0x3b7974,_0x179f2e){return pm2[_0x16db('0x20')](_0x16db('0x21'))['then'](function(_0x4be8ee){logger[_0x16db('0x1c')](_0x16db('0x22'),_0x4be8ee);return _0x179f2e[_0x16db('0x12')](0xc8)['json']({'output':_0x16db('0x23')});})[_0x16db('0x24')](function(_0x309e90){logger[_0x16db('0x16')](_0x309e90);return _0x179f2e[_0x16db('0x12')](0x1f4)[_0x16db('0x13')](_0x309e90);});};exports['migrations']=function(_0x58c45d,_0x37faac){var _0x24c531=fs['readdirSync'](path['join'](config[_0x16db('0xc')],_0x16db('0x25'),'migrations'));var _0x44adc4=[];for(var _0x9f26f3=0x0;_0x9f26f3<_0x24c531[_0x16db('0x26')];_0x9f26f3++){var _0x39b333=_0x24c531[_0x9f26f3]['replace'](_0x16db('0x27'),'');if(compareVersions(module[_0x16db('0xd')][_0x16db('0x3')],_0x39b333)===-0x1){_0x44adc4[_0x16db('0x28')](_0x39b333);}}if(_0x44adc4[_0x16db('0x26')]){var _0x196fb4=_0x44adc4[_0x16db('0x29')](compareVersions);var _0x21d491=new Umzug({'storage':_0x16db('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0x16db('0x2b'),'columnName':_0x16db('0x3')},'migrations':{'params':[db[_0x16db('0x2a')]['getQueryInterface'](),db['sequelize'][_0x16db('0x2c')],function(){throw new Error(_0x16db('0x2d'));}],'path':path[_0x16db('0x2e')](config['root'],_0x16db('0x25'),_0x16db('0x2f')),'pattern':/\.js$/}});_0x21d491['up']({'migrations':_[_0x16db('0x30')](_0x196fb4,function(_0x325253){return _0x325253+_0x16db('0x27');})})[_0x16db('0x31')](function(){return _0x37faac[_0x16db('0x12')](0xc8)['json']({'output':_0x16db('0x32')+module[_0x16db('0xd')][_0x16db('0x3')]+_0x16db('0x33')+_[_0x16db('0x34')](_0x196fb4),'migrations':_[_0x16db('0x2e')](_0x196fb4)});})[_0x16db('0x24')](function(_0x3d2646){if(_0x3d2646 instanceof db[_0x16db('0x2a')][_0x16db('0x35')]){return _0x37faac[_0x16db('0x12')](0xc8)['json']({'output':_0x16db('0x36')});}else{return _0x37faac[_0x16db('0x12')](0x1f4)['json'](_0x3d2646);}});}else{return _0x37faac[_0x16db('0x12')](0xc8)[_0x16db('0x13')]({'output':_0x16db('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b79c8b1..fc69472 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 _0xb0e3=['exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0xb0e3,0x73));var _0x3b0e=function(_0x9baca5,_0x277e8d){_0x9baca5=_0x9baca5-0x0;var _0x10344d=_0xb0e3[_0x9baca5];return _0x10344d;};'use strict';var multer=require('multer');var util=require(_0x3b0e('0x0'));var path=require(_0x3b0e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b0e('0x2')]();var fs_extra=require(_0x3b0e('0x3'));var auth=require(_0x3b0e('0x4'));var interaction=require(_0x3b0e('0x5'));var config=require('../../config/environment');var controller=require(_0x3b0e('0x6'));router[_0x3b0e('0x7')]('/',auth['isAuthenticated'](),controller[_0x3b0e('0x8')]);router[_0x3b0e('0x7')](_0x3b0e('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3b0e('0xa'),auth['isAuthenticated'](),controller[_0x3b0e('0xb')]);router[_0x3b0e('0xc')]('/',auth['isAuthenticated'](),controller[_0x3b0e('0xd')]);router[_0x3b0e('0xe')](_0x3b0e('0xa'),auth['isAuthenticated'](),controller[_0x3b0e('0xf')]);router[_0x3b0e('0x10')](_0x3b0e('0xa'),auth['isAuthenticated'](),controller[_0x3b0e('0x11')]);module[_0x3b0e('0x12')]=router; \ No newline at end of file +var _0x07bd=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x458656,_0x4292d8){var _0x24e475=function(_0x15f497){while(--_0x15f497){_0x458656['push'](_0x458656['shift']());}};_0x24e475(++_0x4292d8);}(_0x07bd,0x11b));var _0xd07b=function(_0x4cdffd,_0x28ccb3){_0x4cdffd=_0x4cdffd-0x0;var _0x375531=_0x07bd[_0x4cdffd];return _0x375531;};'use strict';var multer=require(_0xd07b('0x0'));var util=require(_0xd07b('0x1'));var path=require(_0xd07b('0x2'));var timeout=require(_0xd07b('0x3'));var express=require(_0xd07b('0x4'));var router=express[_0xd07b('0x5')]();var fs_extra=require(_0xd07b('0x6'));var auth=require(_0xd07b('0x7'));var interaction=require(_0xd07b('0x8'));var config=require(_0xd07b('0x9'));var controller=require('./voiceAgentReport.controller');router[_0xd07b('0xa')]('/',auth[_0xd07b('0xb')](),controller[_0xd07b('0xc')]);router[_0xd07b('0xa')](_0xd07b('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xd07b('0xa')](_0xd07b('0xe'),auth[_0xd07b('0xb')](),controller[_0xd07b('0xf')]);router['post']('/',auth[_0xd07b('0xb')](),controller[_0xd07b('0x10')]);router['put'](_0xd07b('0xe'),auth[_0xd07b('0xb')](),controller['update']);router[_0xd07b('0x11')](_0xd07b('0xe'),auth['isAuthenticated'](),controller[_0xd07b('0x12')]);module[_0xd07b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 503ccbc..322c3e6 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 _0xbb35=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x4d1355,_0x5e65da){_0x4d1355=_0x4d1355-0x0;var _0x28c610=_0xbb35[_0x4d1355];return _0x28c610;};'use strict';var Sequelize=require('sequelize');module[_0x5bb3('0x0')]={'type':{'type':Sequelize[_0x5bb3('0x1')]},'uniqueid':{'type':Sequelize[_0x5bb3('0x1')]},'calleridnum':{'type':Sequelize[_0x5bb3('0x1')]},'calleridname':{'type':Sequelize[_0x5bb3('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5bb3('0x1')]},'membername':{'type':Sequelize[_0x5bb3('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentconnectAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentdumpAt':{'type':Sequelize[_0x5bb3('0x2')]},'holdtime':{'type':Sequelize[_0x5bb3('0x3')]},'agentcomplete':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5bb3('0x3')]},'agentacw':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5bb3('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x5bb3('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5bb3('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5bb3('0x1')]},'connectedlinename':{'type':Sequelize[_0x5bb3('0x1')]},'language':{'type':Sequelize[_0x5bb3('0x1')]},'accountcode':{'type':Sequelize[_0x5bb3('0x1')]},'context':{'type':Sequelize[_0x5bb3('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5bb3('0x1')]},'destchannel':{'type':Sequelize[_0x5bb3('0x1')]},'destchannelstate':{'type':Sequelize[_0x5bb3('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x5bb3('0x1')]},'destcalleridname':{'type':Sequelize[_0x5bb3('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x5bb3('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x5bb3('0x1')]},'destlanguage':{'type':Sequelize[_0x5bb3('0x1')]},'destaccountcode':{'type':Sequelize[_0x5bb3('0x1')]},'destcontext':{'type':Sequelize[_0x5bb3('0x1')]},'destexten':{'type':Sequelize[_0x5bb3('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5bb3('0x1')]},'transfer':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5bb3('0x1')],'comment':_0x5bb3('0x5')},'transferexten':{'type':Sequelize[_0x5bb3('0x1')]},'transferuniqueid':{'type':Sequelize[_0x5bb3('0x1')]},'agententerreason':{'type':Sequelize[_0x5bb3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4dd2=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x19a3d2,_0x1a5e1c){var _0x34c0aa=function(_0x4f0c1b){while(--_0x4f0c1b){_0x19a3d2['push'](_0x19a3d2['shift']());}};_0x34c0aa(++_0x1a5e1c);}(_0x4dd2,0xf1));var _0x24dd=function(_0xcfcbaa,_0x369d95){_0xcfcbaa=_0xcfcbaa-0x0;var _0x157ed0=_0x4dd2[_0xcfcbaa];return _0x157ed0;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'type':{'type':Sequelize[_0x24dd('0x1')]},'uniqueid':{'type':Sequelize[_0x24dd('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x24dd('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x24dd('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x24dd('0x2')]},'agentconnectAt':{'type':Sequelize[_0x24dd('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x24dd('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x24dd('0x3')]},'agentcomplete':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x24dd('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x24dd('0x3')]},'reason':{'type':Sequelize[_0x24dd('0x1')]},'lastevent':{'type':Sequelize[_0x24dd('0x1')]},'channel':{'type':Sequelize[_0x24dd('0x1')]},'channelstate':{'type':Sequelize[_0x24dd('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x24dd('0x1')]},'connectedlinename':{'type':Sequelize[_0x24dd('0x1')]},'language':{'type':Sequelize[_0x24dd('0x1')]},'accountcode':{'type':Sequelize[_0x24dd('0x1')]},'context':{'type':Sequelize[_0x24dd('0x1')]},'exten':{'type':Sequelize[_0x24dd('0x1')]},'priority':{'type':Sequelize[_0x24dd('0x1')]},'destchannel':{'type':Sequelize[_0x24dd('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x24dd('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x24dd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x24dd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x24dd('0x1')]},'destcontext':{'type':Sequelize[_0x24dd('0x1')]},'destexten':{'type':Sequelize[_0x24dd('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x24dd('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x24dd('0x1')]},'transfer':{'type':Sequelize[_0x24dd('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x24dd('0x1')],'comment':_0x24dd('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x24dd('0x1')]},'agententerreason':{'type':Sequelize[_0x24dd('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6b5193d..8b04042 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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 1e4214e..a86d023 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 _0x0207=['report_agent','uniqueid','destuniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport'];(function(_0x38ef69,_0x3876f6){var _0x38ca83=function(_0x24aa6b){while(--_0x24aa6b){_0x38ef69['push'](_0x38ef69['shift']());}};_0x38ca83(++_0x3876f6);}(_0x0207,0x162));var _0x7020=function(_0x385571,_0x23b65a){_0x385571=_0x385571-0x0;var _0x107c01=_0x0207[_0x385571];return _0x107c01;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7020('0x1'));var BPromise=require(_0x7020('0x2'));var rp=require(_0x7020('0x3'));var fs=require('fs');var path=require(_0x7020('0x4'));var rimraf=require(_0x7020('0x5'));var config=require(_0x7020('0x6'));var attributes=require(_0x7020('0x7'));module['exports']=function(_0x5074d7,_0x38c320){return _0x5074d7[_0x7020('0x8')](_0x7020('0x9'),attributes,{'tableName':_0x7020('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7020('0xb'),_0x7020('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7676=['define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','path','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x55e839,_0x3b5345){var _0x39c61a=function(_0x5bd269){while(--_0x5bd269){_0x55e839['push'](_0x55e839['shift']());}};_0x39c61a(++_0x3b5345);}(_0x7676,0xb8));var _0x6767=function(_0x2f5008,_0x58e0a4){_0x2f5008=_0x2f5008-0x0;var _0x10f47d=_0x7676[_0x2f5008];return _0x10f47d;};'use strict';var _=require(_0x6767('0x0'));var util=require(_0x6767('0x1'));var logger=require(_0x6767('0x2'))('api');var moment=require(_0x6767('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6767('0x4'));var rimraf=require('rimraf');var config=require(_0x6767('0x5'));var attributes=require(_0x6767('0x6'));module[_0x6767('0x7')]=function(_0x4d0c08,_0x24d747){return _0x4d0c08[_0x6767('0x8')](_0x6767('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x6767('0xa'),_0x6767('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index b87e8a6..9920af5 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 _0xa628=['code','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','then','UpdateVoiceAgentReport','update','raw','where','options','limit','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa628,0x106));var _0x8a62=function(_0x1cad51,_0x27ff4d){_0x1cad51=_0x1cad51-0x0;var _0x2ef33e=_0xa628[_0x1cad51];return _0x2ef33e;};'use strict';var _=require(_0x8a62('0x0'));var util=require('util');var moment=require(_0x8a62('0x1'));var BPromise=require(_0x8a62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a62('0x3'))['db'];var utils=require(_0x8a62('0x4'));var logger=require(_0x8a62('0x5'))(_0x8a62('0x6'));var config=require(_0x8a62('0x7'));var jayson=require(_0x8a62('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x224c30,_0x198198,_0x41248d){return new BPromise(function(_0x25f084,_0x50c910){return client[_0x8a62('0x9')](_0x224c30,_0x41248d)['then'](function(_0x527670){logger[_0x8a62('0xa')](_0x8a62('0xb'),_0x198198,'request\x20sent');logger[_0x8a62('0xc')](_0x8a62('0xd'),_0x198198,_0x8a62('0xe'),JSON[_0x8a62('0xf')](_0x527670));if(_0x527670[_0x8a62('0x10')]){if(_0x527670['error'][_0x8a62('0x11')]===0x1f4){logger[_0x8a62('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x198198,_0x527670[_0x8a62('0x10')][_0x8a62('0x12')]);return _0x50c910(_0x527670['error'][_0x8a62('0x12')]);}logger[_0x8a62('0x10')](_0x8a62('0xb'),_0x198198,_0x527670[_0x8a62('0x10')][_0x8a62('0x12')]);return _0x25f084(_0x527670['error'][_0x8a62('0x12')]);}else{logger[_0x8a62('0xa')](_0x8a62('0xb'),_0x198198,_0x8a62('0xe'));_0x25f084(_0x527670[_0x8a62('0x13')][_0x8a62('0x12')]);}})['catch'](function(_0x18698d){logger[_0x8a62('0x10')](_0x8a62('0xb'),_0x198198,_0x18698d);_0x50c910(_0x18698d);});});}exports[_0x8a62('0x14')]=function(_0x1bd950){var _0x12e7d0=this;return new Promise(function(_0x228bb5,_0x1ba8e0){return db[_0x8a62('0x15')]['create'](_0x1bd950[_0x8a62('0x16')],{'raw':_0x1bd950['options']?_0x1bd950['options']['raw']===undefined?!![]:![]:!![]})[_0x8a62('0x17')](function(_0xa5ff6a){logger[_0x8a62('0xa')](_0x8a62('0x14'),_0x1bd950);logger[_0x8a62('0xc')](_0x8a62('0x14'),_0x1bd950,JSON[_0x8a62('0xf')](_0xa5ff6a));_0x228bb5(_0xa5ff6a);})['catch'](function(_0xd6ddee){logger[_0x8a62('0x10')]('CreateVoiceAgentReport',_0xd6ddee[_0x8a62('0x12')],_0x1bd950);_0x1ba8e0(_0x12e7d0['error'](0x1f4,_0xd6ddee['message']));});});};exports[_0x8a62('0x18')]=function(_0x3a27a1){var _0x1222e1=this;return new Promise(function(_0x3dcbb5,_0x1eb645){return db['VoiceAgentReport'][_0x8a62('0x19')](_0x3a27a1[_0x8a62('0x16')],{'raw':_0x3a27a1['options']?_0x3a27a1['options'][_0x8a62('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a27a1['options']?_0x3a27a1['options'][_0x8a62('0x1b')]||null:null,'attributes':_0x3a27a1[_0x8a62('0x1c')]?_0x3a27a1[_0x8a62('0x1c')]['attributes']||null:null,'limit':_0x3a27a1[_0x8a62('0x1c')]?_0x3a27a1[_0x8a62('0x1c')][_0x8a62('0x1d')]||null:null})[_0x8a62('0x17')](function(_0x9b4242){logger[_0x8a62('0xa')](_0x8a62('0x18'),_0x3a27a1);logger[_0x8a62('0xc')](_0x8a62('0x18'),_0x3a27a1,JSON['stringify'](_0x9b4242));_0x3dcbb5(_0x9b4242);})[_0x8a62('0x1e')](function(_0x510e7f){logger[_0x8a62('0x10')](_0x8a62('0x18'),_0x510e7f[_0x8a62('0x12')],_0x3a27a1);_0x1eb645(_0x1222e1['error'](0x1f4,_0x510e7f[_0x8a62('0x12')]));});});}; \ No newline at end of file +var _0xe2c4=['VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','catch','UpdateVoiceAgentReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x352b61,_0x4b2959){var _0x1cbed5=function(_0x36fcb0){while(--_0x36fcb0){_0x352b61['push'](_0x352b61['shift']());}};_0x1cbed5(++_0x4b2959);}(_0xe2c4,0x191));var _0x4e2c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe2c4[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x4e2c('0x0'));var util=require(_0x4e2c('0x1'));var moment=require(_0x4e2c('0x2'));var BPromise=require(_0x4e2c('0x3'));var rs=require(_0x4e2c('0x4'));var fs=require('fs');var Redis=require(_0x4e2c('0x5'));var db=require(_0x4e2c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e2c('0x7'))(_0x4e2c('0x8'));var config=require(_0x4e2c('0x9'));var jayson=require(_0x4e2c('0xa'));var client=jayson[_0x4e2c('0xb')][_0x4e2c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26ebe9,_0x14ebf9,_0x119313){return new BPromise(function(_0x34d88f,_0x2d930c){return client[_0x4e2c('0xd')](_0x26ebe9,_0x119313)[_0x4e2c('0xe')](function(_0x3f1376){logger[_0x4e2c('0xf')](_0x4e2c('0x10'),_0x14ebf9,_0x4e2c('0x11'));logger[_0x4e2c('0x12')](_0x4e2c('0x13'),_0x14ebf9,'request\x20sent',JSON[_0x4e2c('0x14')](_0x3f1376));if(_0x3f1376['error']){if(_0x3f1376[_0x4e2c('0x15')][_0x4e2c('0x16')]===0x1f4){logger[_0x4e2c('0x15')](_0x4e2c('0x10'),_0x14ebf9,_0x3f1376[_0x4e2c('0x15')][_0x4e2c('0x17')]);return _0x2d930c(_0x3f1376['error']['message']);}logger['error'](_0x4e2c('0x10'),_0x14ebf9,_0x3f1376[_0x4e2c('0x15')][_0x4e2c('0x17')]);return _0x34d88f(_0x3f1376['error'][_0x4e2c('0x17')]);}else{logger[_0x4e2c('0xf')](_0x4e2c('0x10'),_0x14ebf9,_0x4e2c('0x11'));_0x34d88f(_0x3f1376[_0x4e2c('0x18')][_0x4e2c('0x17')]);}})['catch'](function(_0x3538e8){logger[_0x4e2c('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x14ebf9,_0x3538e8);_0x2d930c(_0x3538e8);});});}exports[_0x4e2c('0x19')]=function(_0x503c2e){var _0x555501=this;return new Promise(function(_0x4457c0,_0x563002){return db[_0x4e2c('0x1a')][_0x4e2c('0x1b')](_0x503c2e[_0x4e2c('0x1c')],{'raw':_0x503c2e[_0x4e2c('0x1d')]?_0x503c2e['options'][_0x4e2c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x11ae4a){logger['info']('CreateVoiceAgentReport',_0x503c2e);logger['debug'](_0x4e2c('0x19'),_0x503c2e,JSON['stringify'](_0x11ae4a));_0x4457c0(_0x11ae4a);})[_0x4e2c('0x1f')](function(_0x1e6968){logger[_0x4e2c('0x15')](_0x4e2c('0x19'),_0x1e6968['message'],_0x503c2e);_0x563002(_0x555501[_0x4e2c('0x15')](0x1f4,_0x1e6968[_0x4e2c('0x17')]));});});};exports[_0x4e2c('0x20')]=function(_0x189466){var _0x56924b=this;return new Promise(function(_0x2cc568,_0x1b0e51){return db[_0x4e2c('0x1a')][_0x4e2c('0x21')](_0x189466[_0x4e2c('0x1c')],{'raw':_0x189466['options']?_0x189466['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x189466['options']?_0x189466['options'][_0x4e2c('0x22')]||null:null,'attributes':_0x189466[_0x4e2c('0x1d')]?_0x189466[_0x4e2c('0x1d')]['attributes']||null:null,'limit':_0x189466[_0x4e2c('0x1d')]?_0x189466[_0x4e2c('0x1d')]['limit']||null:null})['then'](function(_0x4f7866){logger['info'](_0x4e2c('0x20'),_0x189466);logger[_0x4e2c('0x12')](_0x4e2c('0x20'),_0x189466,JSON[_0x4e2c('0x14')](_0x4f7866));_0x2cc568(_0x4f7866);})['catch'](function(_0x3448a2){logger[_0x4e2c('0x15')](_0x4e2c('0x20'),_0x3448a2[_0x4e2c('0x17')],_0x189466);_0x1b0e51(_0x56924b[_0x4e2c('0x15')](0x1f4,_0x3448a2[_0x4e2c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 42bf3e4..dbca5cd 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 _0x3baf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x176253,_0x416776){var _0x11618b=function(_0x32f430){while(--_0x32f430){_0x176253['push'](_0x176253['shift']());}};_0x11618b(++_0x416776);}(_0x3baf,0xf7));var _0xf3ba=function(_0x4fe5b5,_0x41efab){_0x4fe5b5=_0x4fe5b5-0x0;var _0x221fbe=_0x3baf[_0x4fe5b5];return _0x221fbe;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var fs_extra=require(_0xf3ba('0x6'));var auth=require(_0xf3ba('0x7'));var interaction=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var controller=require(_0xf3ba('0xa'));router[_0xf3ba('0xb')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xd')]);router[_0xf3ba('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf3ba('0xb')]('/:id',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xe')]);router[_0xf3ba('0xf')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x10')]);router[_0xf3ba('0x11')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x14')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x15')]);module[_0xf3ba('0x16')]=router; \ No newline at end of file +var _0xf69d=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xf69d,0xd3));var _0xdf69=function(_0x56f0b5,_0x346ae2){_0x56f0b5=_0x56f0b5-0x0;var _0x3f485f=_0xf69d[_0x56f0b5];return _0x3f485f;};'use strict';var multer=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var path=require(_0xdf69('0x2'));var timeout=require(_0xdf69('0x3'));var express=require(_0xdf69('0x4'));var router=express['Router']();var fs_extra=require(_0xdf69('0x5'));var auth=require(_0xdf69('0x6'));var interaction=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var controller=require(_0xdf69('0x9'));router[_0xdf69('0xa')]('/',auth[_0xdf69('0xb')](),controller[_0xdf69('0xc')]);router[_0xdf69('0xa')](_0xdf69('0xd'),auth[_0xdf69('0xb')](),controller[_0xdf69('0xe')]);router[_0xdf69('0xa')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x10')]);router[_0xdf69('0x11')]('/',auth['isAuthenticated'](),controller[_0xdf69('0x12')]);router[_0xdf69('0x13')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x14')]);router[_0xdf69('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 252fa06..0662032 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 _0x58c8=['exports','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x1dd056,_0x8eed9a){var _0x449b56=function(_0x5f0ecc){while(--_0x5f0ecc){_0x1dd056['push'](_0x1dd056['shift']());}};_0x449b56(++_0x8eed9a);}(_0x58c8,0x1d9));var _0x858c=function(_0x17e7bd,_0x37f1dd){_0x17e7bd=_0x17e7bd-0x0;var _0x550244=_0x58c8[_0x17e7bd];return _0x550244;};'use strict';var Sequelize=require('sequelize');module[_0x858c('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x858c('0x1')]('inbound',_0x858c('0x2'),_0x858c('0x3'),_0x858c('0x4'),_0x858c('0x5'),_0x858c('0x6'))},'tag':{'type':Sequelize[_0x858c('0x7')]},'accountcode':{'type':Sequelize[_0x858c('0x7')]},'source':{'type':Sequelize[_0x858c('0x7')]},'destination':{'type':Sequelize[_0x858c('0x7')]},'destinationcontext':{'type':Sequelize[_0x858c('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x858c('0x7')]},'lastapplication':{'type':Sequelize[_0x858c('0x7')]},'lastdata':{'type':Sequelize[_0x858c('0x8')]},'starttime':{'type':Sequelize[_0x858c('0x9')]},'systemanswertime':{'type':Sequelize[_0x858c('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x858c('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x858c('0xa')]},'mohtime':{'type':Sequelize[_0x858c('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x858c('0x7')]},'userfield':{'type':Sequelize[_0x858c('0x7')]},'userDisposition':{'type':Sequelize[_0x858c('0x7')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x858c('0x7')]},'prefix':{'type':Sequelize[_0x858c('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x858c('0x7')]}}; \ No newline at end of file +var _0x3080=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound'];(function(_0x141c07,_0x2016b4){var _0x44d37b=function(_0xdb159a){while(--_0xdb159a){_0x141c07['push'](_0x141c07['shift']());}};_0x44d37b(++_0x2016b4);}(_0x3080,0x1e6));var _0x0308=function(_0x7be343,_0x160c95){_0x7be343=_0x7be343-0x0;var _0x7ba533=_0x3080[_0x7be343];return _0x7ba533;};'use strict';var Sequelize=require(_0x0308('0x0'));module[_0x0308('0x1')]={'uniqueid':{'type':Sequelize[_0x0308('0x2')]},'type':{'type':Sequelize[_0x0308('0x3')]('inbound',_0x0308('0x4'),_0x0308('0x5'),_0x0308('0x6'),_0x0308('0x7'),_0x0308('0x8'))},'tag':{'type':Sequelize[_0x0308('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x0308('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x0308('0x2')]},'callerid':{'type':Sequelize[_0x0308('0x2')]},'channel':{'type':Sequelize[_0x0308('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0308('0x2')]},'lastdata':{'type':Sequelize[_0x0308('0x9')]},'starttime':{'type':Sequelize[_0x0308('0xa')]},'systemanswertime':{'type':Sequelize[_0x0308('0xa')]},'answertime':{'type':Sequelize[_0x0308('0xa')]},'endtime':{'type':Sequelize[_0x0308('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x0308('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0308('0x2')]},'amaflags':{'type':Sequelize[_0x0308('0x2')]},'userfield':{'type':Sequelize[_0x0308('0x2')]},'userDisposition':{'type':Sequelize[_0x0308('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x0308('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x0308('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x0308('0xb')]},'sipcallid':{'type':Sequelize[_0x0308('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e09953b..eb9d698 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x5c3e31,_0x40c03e){var _0x4fbe0d=function(_0x51e656){while(--_0x51e656){_0x5c3e31['push'](_0x5c3e31['shift']());}};_0x4fbe0d(++_0x40c03e);}(_0xdb28,0x106));var _0x8db2=function(_0x1d7d4e,_0x13e94f){_0x1d7d4e=_0x1d7d4e-0x0;var _0x289138=_0xdb28[_0x1d7d4e];return _0x289138;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ee284,_0x2c50a8){_0x5ee284=_0x5ee284-0x0;var _0x365bd1=_0x5f2f[_0x5ee284];return _0x365bd1;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 838f3d0..f48b2f0 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 _0x6f1e=['./voiceCallReport.attributes','VoiceCallReport','report_call','lodash','util','api','path','rimraf','../../config/environment'];(function(_0x401f2e,_0x119d0d){var _0x4ef876=function(_0x5bb365){while(--_0x5bb365){_0x401f2e['push'](_0x401f2e['shift']());}};_0x4ef876(++_0x119d0d);}(_0x6f1e,0x1e0));var _0xe6f1=function(_0x3634e9,_0x20d9fb){_0x3634e9=_0x3634e9-0x0;var _0x46ce35=_0x6f1e[_0x3634e9];return _0x46ce35;};'use strict';var _=require(_0xe6f1('0x0'));var util=require(_0xe6f1('0x1'));var logger=require('../../config/logger')(_0xe6f1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6f1('0x3'));var rimraf=require(_0xe6f1('0x4'));var config=require(_0xe6f1('0x5'));var attributes=require(_0xe6f1('0x6'));module['exports']=function(_0x484969,_0xbb2a32){return _0x484969['define'](_0xe6f1('0x7'),attributes,{'tableName':_0xe6f1('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3408=['../../config/logger','api','path','rimraf','../../config/environment','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x2c9d50,_0x5697cf){var _0x4f643f=function(_0x3c5d25){while(--_0x3c5d25){_0x2c9d50['push'](_0x2c9d50['shift']());}};_0x4f643f(++_0x5697cf);}(_0x3408,0x15d));var _0x8340=function(_0x21dd01,_0x5d4a3a){_0x21dd01=_0x21dd01-0x0;var _0x13c673=_0x3408[_0x21dd01];return _0x13c673;};'use strict';var _=require(_0x8340('0x0'));var util=require('util');var logger=require(_0x8340('0x1'))(_0x8340('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8340('0x3'));var rimraf=require(_0x8340('0x4'));var config=require(_0x8340('0x5'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x3de8d8,_0x21d78d){return _0x3de8d8[_0x8340('0x6')](_0x8340('0x7'),attributes,{'tableName':_0x8340('0x8'),'paranoid':![],'indexes':[{'fields':[_0x8340('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9d256f8..1d54579 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 _0x5941=['model','create','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','map'];(function(_0x33f355,_0x233b45){var _0x980864=function(_0x14ea4d){while(--_0x14ea4d){_0x33f355['push'](_0x33f355['shift']());}};_0x980864(++_0x233b45);}(_0x5941,0x149));var _0x1594=function(_0x271130,_0x4a8440){_0x271130=_0x271130-0x0;var _0x4b0f57=_0x5941[_0x271130];return _0x4b0f57;};'use strict';var _=require(_0x1594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1594('0x1'));var rs=require(_0x1594('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1594('0x3'))['db'];var utils=require(_0x1594('0x4'));var logger=require(_0x1594('0x5'))(_0x1594('0x6'));var config=require(_0x1594('0x7'));var jayson=require(_0x1594('0x8'));var client=jayson[_0x1594('0x9')][_0x1594('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c82dd,_0x254b08,_0x3b701b){return new BPromise(function(_0x1eb825,_0x351822){return client['request'](_0x5c82dd,_0x3b701b)[_0x1594('0xb')](function(_0x1b51f8){logger[_0x1594('0xc')](_0x1594('0xd'),_0x254b08,_0x1594('0xe'));logger[_0x1594('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x254b08,'request\x20sent',JSON[_0x1594('0x10')](_0x1b51f8));if(_0x1b51f8[_0x1594('0x11')]){if(_0x1b51f8[_0x1594('0x11')][_0x1594('0x12')]===0x1f4){logger[_0x1594('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x254b08,_0x1b51f8[_0x1594('0x11')][_0x1594('0x13')]);return _0x351822(_0x1b51f8[_0x1594('0x11')]['message']);}logger[_0x1594('0x11')](_0x1594('0xd'),_0x254b08,_0x1b51f8[_0x1594('0x11')][_0x1594('0x13')]);return _0x1eb825(_0x1b51f8['error'][_0x1594('0x13')]);}else{logger[_0x1594('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x254b08,_0x1594('0xe'));_0x1eb825(_0x1b51f8[_0x1594('0x14')][_0x1594('0x13')]);}})[_0x1594('0x15')](function(_0x26ec47){logger[_0x1594('0x11')](_0x1594('0xd'),_0x254b08,_0x26ec47);_0x351822(_0x26ec47);});});}exports[_0x1594('0x16')]=function(_0x48164b){var _0x3089f0=this;return new Promise(function(_0xa350dc,_0x130d88){return db[_0x1594('0x17')][_0x1594('0x18')]({'raw':_0x48164b[_0x1594('0x19')]?_0x48164b['options'][_0x1594('0x1a')]===undefined?!![]:![]:!![],'where':_0x48164b['options']?_0x48164b[_0x1594('0x19')][_0x1594('0x1b')]||null:null,'attributes':_0x48164b[_0x1594('0x19')]?_0x48164b[_0x1594('0x19')][_0x1594('0x1c')]||null:null,'limit':_0x48164b[_0x1594('0x19')]?_0x48164b[_0x1594('0x19')]['limit']||null:null,'include':_0x48164b[_0x1594('0x19')]?_0x48164b[_0x1594('0x19')][_0x1594('0x1d')]?_[_0x1594('0x1e')](_0x48164b['options'][_0x1594('0x1d')],function(_0x1c9bfb){return{'model':db[_0x1c9bfb[_0x1594('0x1f')]],'as':_0x1c9bfb['as'],'attributes':_0x1c9bfb[_0x1594('0x1c')],'include':_0x1c9bfb['include']?_[_0x1594('0x1e')](_0x1c9bfb[_0x1594('0x1d')],function(_0x112d53){return{'model':db[_0x112d53['model']],'as':_0x112d53['as'],'attributes':_0x112d53[_0x1594('0x1c')],'include':_0x112d53[_0x1594('0x1d')]?_[_0x1594('0x1e')](_0x112d53[_0x1594('0x1d')],function(_0x5c2c31){return{'model':db[_0x5c2c31[_0x1594('0x1f')]],'as':_0x5c2c31['as'],'attributes':_0x5c2c31[_0x1594('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1594('0xb')](function(_0x3221e5){logger['info'](_0x1594('0x16'),_0x48164b);logger[_0x1594('0xf')](_0x1594('0x16'),_0x48164b,JSON[_0x1594('0x10')](_0x3221e5));_0xa350dc(_0x3221e5);})[_0x1594('0x15')](function(_0x2461e6){logger['error'](_0x1594('0x16'),_0x2461e6[_0x1594('0x13')],_0x48164b);_0x130d88(_0x3089f0['error'](0x1f4,_0x2461e6[_0x1594('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x49ed50){var _0xd76d15=this;return new Promise(function(_0x40128b,_0x572099){return db[_0x1594('0x17')][_0x1594('0x20')](_0x49ed50['body'],{'raw':_0x49ed50[_0x1594('0x19')]?_0x49ed50[_0x1594('0x19')][_0x1594('0x1a')]===undefined?!![]:![]:!![]})[_0x1594('0xb')](function(_0x4847f3){logger[_0x1594('0xc')]('CreateVoiceCallReport',_0x49ed50);logger[_0x1594('0xf')](_0x1594('0x21'),_0x49ed50,JSON[_0x1594('0x10')](_0x4847f3));_0x40128b(_0x4847f3);})[_0x1594('0x15')](function(_0x1b3b79){logger[_0x1594('0x11')](_0x1594('0x21'),_0x1b3b79[_0x1594('0x13')],_0x49ed50);_0x572099(_0xd76d15['error'](0x1f4,_0x1b3b79['message']));});});};exports[_0x1594('0x22')]=function(_0x310939){var _0x5ac694=this;return new Promise(function(_0x443550,_0x2583e1){return db[_0x1594('0x17')][_0x1594('0x23')](_0x310939['body'],{'raw':_0x310939['options']?_0x310939[_0x1594('0x19')][_0x1594('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310939[_0x1594('0x19')]?_0x310939[_0x1594('0x19')][_0x1594('0x1b')]||null:null,'attributes':_0x310939[_0x1594('0x19')]?_0x310939[_0x1594('0x19')][_0x1594('0x1c')]||null:null,'limit':_0x310939[_0x1594('0x19')]?_0x310939[_0x1594('0x19')]['limit']||null:null})[_0x1594('0xb')](function(_0x1213e7){logger['info'](_0x1594('0x22'),_0x310939);logger[_0x1594('0xf')](_0x1594('0x22'),_0x310939,JSON['stringify'](_0x1213e7));_0x443550(_0x1213e7);})['catch'](function(_0x1204fb){logger[_0x1594('0x11')](_0x1594('0x22'),_0x1204fb[_0x1594('0x13')],_0x310939);_0x2583e1(_0x5ac694[_0x1594('0x11')](0x1f4,_0x1204fb[_0x1594('0x13')]));});});}; \ No newline at end of file +var _0x22d3=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','map','model','debug','create','body','raw','then','CreateVoiceCallReport','UpdateVoiceCallReport','where','lodash','moment','bluebird','randomstring'];(function(_0x37c1ca,_0x2f3f3e){var _0x46b88e=function(_0x2307a0){while(--_0x2307a0){_0x37c1ca['push'](_0x37c1ca['shift']());}};_0x46b88e(++_0x2f3f3e);}(_0x22d3,0xff));var _0x322d=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0x22d3[_0x2c69a1];return _0x24bb91;};'use strict';var _=require(_0x322d('0x0'));var util=require('util');var moment=require(_0x322d('0x1'));var BPromise=require(_0x322d('0x2'));var rs=require(_0x322d('0x3'));var fs=require('fs');var Redis=require(_0x322d('0x4'));var db=require(_0x322d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x322d('0x6'))(_0x322d('0x7'));var config=require(_0x322d('0x8'));var jayson=require(_0x322d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d41af,_0xe9ebbd,_0x1c47ed){return new BPromise(function(_0x367d7e,_0x529ca4){return client['request'](_0x2d41af,_0x1c47ed)['then'](function(_0x7fdffb){logger['info'](_0x322d('0xa'),_0xe9ebbd,_0x322d('0xb'));logger['debug'](_0x322d('0xc'),_0xe9ebbd,_0x322d('0xb'),JSON[_0x322d('0xd')](_0x7fdffb));if(_0x7fdffb[_0x322d('0xe')]){if(_0x7fdffb[_0x322d('0xe')][_0x322d('0xf')]===0x1f4){logger['error'](_0x322d('0xa'),_0xe9ebbd,_0x7fdffb[_0x322d('0xe')][_0x322d('0x10')]);return _0x529ca4(_0x7fdffb[_0x322d('0xe')]['message']);}logger['error'](_0x322d('0xa'),_0xe9ebbd,_0x7fdffb[_0x322d('0xe')][_0x322d('0x10')]);return _0x367d7e(_0x7fdffb[_0x322d('0xe')][_0x322d('0x10')]);}else{logger[_0x322d('0x11')](_0x322d('0xa'),_0xe9ebbd,_0x322d('0xb'));_0x367d7e(_0x7fdffb[_0x322d('0x12')][_0x322d('0x10')]);}})[_0x322d('0x13')](function(_0x590bce){logger[_0x322d('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0xe9ebbd,_0x590bce);_0x529ca4(_0x590bce);});});}exports[_0x322d('0x14')]=function(_0x39b760){var _0x12da09=this;return new Promise(function(_0x5a1cb2,_0x499e26){return db[_0x322d('0x15')][_0x322d('0x16')]({'raw':_0x39b760['options']?_0x39b760[_0x322d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x39b760[_0x322d('0x17')]?_0x39b760[_0x322d('0x17')]['where']||null:null,'attributes':_0x39b760['options']?_0x39b760['options'][_0x322d('0x18')]||null:null,'limit':_0x39b760[_0x322d('0x17')]?_0x39b760[_0x322d('0x17')][_0x322d('0x19')]||null:null,'include':_0x39b760[_0x322d('0x17')]?_0x39b760[_0x322d('0x17')][_0x322d('0x1a')]?_[_0x322d('0x1b')](_0x39b760[_0x322d('0x17')]['include'],function(_0x18a51e){return{'model':db[_0x18a51e[_0x322d('0x1c')]],'as':_0x18a51e['as'],'attributes':_0x18a51e['attributes'],'include':_0x18a51e['include']?_[_0x322d('0x1b')](_0x18a51e[_0x322d('0x1a')],function(_0x17117a){return{'model':db[_0x17117a['model']],'as':_0x17117a['as'],'attributes':_0x17117a[_0x322d('0x18')],'include':_0x17117a[_0x322d('0x1a')]?_[_0x322d('0x1b')](_0x17117a[_0x322d('0x1a')],function(_0x542a40){return{'model':db[_0x542a40[_0x322d('0x1c')]],'as':_0x542a40['as'],'attributes':_0x542a40[_0x322d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x118ac1){logger[_0x322d('0x11')](_0x322d('0x14'),_0x39b760);logger[_0x322d('0x1d')](_0x322d('0x14'),_0x39b760,JSON['stringify'](_0x118ac1));_0x5a1cb2(_0x118ac1);})[_0x322d('0x13')](function(_0xa8b282){logger[_0x322d('0xe')]('GetVoiceCallReport',_0xa8b282[_0x322d('0x10')],_0x39b760);_0x499e26(_0x12da09['error'](0x1f4,_0xa8b282['message']));});});};exports['CreateVoiceCallReport']=function(_0x1ba7de){var _0x41b80c=this;return new Promise(function(_0x4938a9,_0x3d069b){return db[_0x322d('0x15')][_0x322d('0x1e')](_0x1ba7de[_0x322d('0x1f')],{'raw':_0x1ba7de[_0x322d('0x17')]?_0x1ba7de[_0x322d('0x17')][_0x322d('0x20')]===undefined?!![]:![]:!![]})[_0x322d('0x21')](function(_0x49e3f1){logger[_0x322d('0x11')](_0x322d('0x22'),_0x1ba7de);logger[_0x322d('0x1d')](_0x322d('0x22'),_0x1ba7de,JSON['stringify'](_0x49e3f1));_0x4938a9(_0x49e3f1);})[_0x322d('0x13')](function(_0x3a5a84){logger[_0x322d('0xe')](_0x322d('0x22'),_0x3a5a84[_0x322d('0x10')],_0x1ba7de);_0x3d069b(_0x41b80c[_0x322d('0xe')](0x1f4,_0x3a5a84[_0x322d('0x10')]));});});};exports[_0x322d('0x23')]=function(_0x549da8){var _0x577cfe=this;return new Promise(function(_0x2081a9,_0x131240){return db[_0x322d('0x15')]['update'](_0x549da8[_0x322d('0x1f')],{'raw':_0x549da8[_0x322d('0x17')]?_0x549da8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x549da8[_0x322d('0x17')]?_0x549da8[_0x322d('0x17')][_0x322d('0x24')]||null:null,'attributes':_0x549da8[_0x322d('0x17')]?_0x549da8[_0x322d('0x17')][_0x322d('0x18')]||null:null,'limit':_0x549da8[_0x322d('0x17')]?_0x549da8[_0x322d('0x17')][_0x322d('0x19')]||null:null})['then'](function(_0x4dc11d){logger['info'](_0x322d('0x23'),_0x549da8);logger['debug'](_0x322d('0x23'),_0x549da8,JSON['stringify'](_0x4dc11d));_0x2081a9(_0x4dc11d);})['catch'](function(_0x4b191c){logger['error'](_0x322d('0x23'),_0x4b191c[_0x322d('0x10')],_0x549da8);_0x131240(_0x577cfe[_0x322d('0xe')](0x1f4,_0x4b191c[_0x322d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 7fbbf5c..d33b380 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 _0x1db7=['path','connect-timeout','fs-extra','../../components/auth/service','get','/:id','post','create','isAuthenticated','multer','util'];(function(_0x145d29,_0xd74d5){var _0x294f75=function(_0x588130){while(--_0x588130){_0x145d29['push'](_0x145d29['shift']());}};_0x294f75(++_0xd74d5);}(_0x1db7,0x127));var _0x71db=function(_0x29fe6a,_0x32ccf7){_0x29fe6a=_0x29fe6a-0x0;var _0x212d03=_0x1db7[_0x29fe6a];return _0x212d03;};'use strict';var multer=require(_0x71db('0x0'));var util=require(_0x71db('0x1'));var path=require(_0x71db('0x2'));var timeout=require(_0x71db('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x71db('0x4'));var auth=require(_0x71db('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x71db('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x71db('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x71db('0x8')]('/',auth['isAuthenticated'](),controller[_0x71db('0x9')]);router['put'](_0x71db('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x71db('0x7'),auth[_0x71db('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf6af=['/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get'];(function(_0x13d1eb,_0x5489f4){var _0x34cb84=function(_0x2cdc94){while(--_0x2cdc94){_0x13d1eb['push'](_0x13d1eb['shift']());}};_0x34cb84(++_0x5489f4);}(_0xf6af,0x1d3));var _0xff6a=function(_0x374944,_0x182a13){_0x374944=_0x374944-0x0;var _0x2aeb08=_0xf6af[_0x374944];return _0x2aeb08;};'use strict';var multer=require(_0xff6a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xff6a('0x1'));var express=require('express');var router=express[_0xff6a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xff6a('0x3'));var interaction=require(_0xff6a('0x4'));var config=require('../../config/environment');var controller=require(_0xff6a('0x5'));router['get']('/',auth[_0xff6a('0x6')](),controller[_0xff6a('0x7')]);router[_0xff6a('0x8')](_0xff6a('0x9'),auth[_0xff6a('0x6')](),controller['show']);router[_0xff6a('0xa')]('/',auth[_0xff6a('0x6')](),controller[_0xff6a('0xb')]);router[_0xff6a('0xc')]('/:id',auth[_0xff6a('0x6')](),controller[_0xff6a('0xd')]);router[_0xff6a('0xe')](_0xff6a('0x9'),auth[_0xff6a('0x6')](),controller[_0xff6a('0xf')]);module[_0xff6a('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index a8eb038..2702177 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 _0x62ae=['options','split','BOOLEAN','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x24e826,_0x1cc2a7){var _0x1eff29=function(_0x2e6145){while(--_0x2e6145){_0x24e826['push'](_0x24e826['shift']());}};_0x1eff29(++_0x1cc2a7);}(_0x62ae,0xff));var _0xe62a=function(_0x1726f1,_0x32720e){_0x1726f1=_0x1726f1-0x0;var _0x1b8014=_0x62ae[_0x1726f1];return _0x1b8014;};'use strict';var Sequelize=require('sequelize');module[_0xe62a('0x0')]={'name':{'type':Sequelize[_0xe62a('0x1')]},'prefix':{'type':Sequelize[_0xe62a('0x1')],'unique':_0xe62a('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x79ac1f){this[_0xe62a('0x3')]('options',_0x79ac1f?_0x79ac1f[_0xe62a('0x4')](''):[]);},'get':function(){return this[_0xe62a('0x5')](_0xe62a('0x6'))?this['getDataValue'](_0xe62a('0x6'))[_0xe62a('0x7')](''):[];}},'auth':{'type':Sequelize[_0xe62a('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xe62a('0x1')]},'record':{'type':Sequelize[_0xe62a('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe62a('0x1')]},'description':{'type':Sequelize[_0xe62a('0x1')]}}; \ No newline at end of file +var _0xe84e=['name','options','join','split','BOOLEAN','sequelize','STRING'];(function(_0x5a778b,_0x717daa){var _0x32f0da=function(_0x546db4){while(--_0x546db4){_0x5a778b['push'](_0x5a778b['shift']());}};_0x32f0da(++_0x717daa);}(_0xe84e,0xad));var _0xee84=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xe84e[_0x152fe3];return _0xc5bb39;};'use strict';var Sequelize=require(_0xee84('0x0'));module['exports']={'name':{'type':Sequelize[_0xee84('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xee84('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xee84('0x1')],'set':function(_0x4f805d){this['setDataValue'](_0xee84('0x3'),_0x4f805d?_0x4f805d[_0xee84('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xee84('0x3'))?this['getDataValue'](_0xee84('0x3'))[_0xee84('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xee84('0x1')]},'record':{'type':Sequelize[_0xee84('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xee84('0x1')]},'description':{'type':Sequelize[_0xee84('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8f3585c..812d3ca 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 _0x5e14=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','map','type','VIRTUAL','filter','includeAll','findAll','rows','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x346f75,_0x47607b){var _0x4241ef=function(_0x1e5e44){while(--_0x1e5e44){_0x346f75['push'](_0x346f75['shift']());}};_0x4241ef(++_0x47607b);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x45e1('0x0'));var rimraf=require(_0x45e1('0x1'));var zipdir=require(_0x45e1('0x2'));var jsonpatch=require(_0x45e1('0x3'));var rp=require(_0x45e1('0x4'));var moment=require(_0x45e1('0x5'));var BPromise=require(_0x45e1('0x6'));var Mustache=require(_0x45e1('0x7'));var util=require(_0x45e1('0x8'));var path=require(_0x45e1('0x9'));var sox=require(_0x45e1('0xa'));var csv=require(_0x45e1('0xb'));var ejs=require(_0x45e1('0xc'));var fs=require('fs');var fs_extra=require(_0x45e1('0xd'));var _=require(_0x45e1('0xe'));var squel=require(_0x45e1('0xf'));var crypto=require(_0x45e1('0x10'));var jsforce=require(_0x45e1('0x11'));var deskjs=require(_0x45e1('0x12'));var toCsv=require(_0x45e1('0xb'));var querystring=require(_0x45e1('0x13'));var Papa=require(_0x45e1('0x14'));var Redis=require('ioredis');var authService=require(_0x45e1('0x15'));var qs=require(_0x45e1('0x16'));var as=require(_0x45e1('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45e1('0x18'))('api');var utils=require(_0x45e1('0x19'));var config=require(_0x45e1('0x1a'));var licenseUtil=require(_0x45e1('0x1b'));var db=require(_0x45e1('0x1c'))['db'];function respondWithStatusCode(_0x3c88b1,_0x2ec2b9){_0x2ec2b9=_0x2ec2b9||0xcc;return function(_0x2ab53e){if(_0x2ab53e){return _0x3c88b1['sendStatus'](_0x2ec2b9);}return _0x3c88b1[_0x45e1('0x1d')](_0x2ec2b9)[_0x45e1('0x1e')]();};}function respondWithResult(_0x473ec6,_0x370297){_0x370297=_0x370297||0xc8;return function(_0x4364a0){if(_0x4364a0){return _0x473ec6[_0x45e1('0x1d')](_0x370297)[_0x45e1('0x1f')](_0x4364a0);}};}function respondWithFilteredResult(_0x4c2344,_0x5d9dba){return function(_0x2de680){if(_0x2de680){var _0x53a90e=typeof _0x5d9dba['offset']==='undefined'&&typeof _0x5d9dba[_0x45e1('0x20')]===_0x45e1('0x21');var _0x4de963=_0x2de680[_0x45e1('0x22')];var _0xa8bbf9=_0x53a90e?0x0:_0x5d9dba[_0x45e1('0x23')];var _0x4aea60=_0x53a90e?_0x2de680[_0x45e1('0x22')]:_0x5d9dba['offset']+_0x5d9dba[_0x45e1('0x20')];var _0x486782;if(_0x4aea60>=_0x4de963){_0x4aea60=_0x4de963;_0x486782=0xc8;}else{_0x486782=0xce;}_0x4c2344[_0x45e1('0x1d')](_0x486782);return _0x4c2344[_0x45e1('0x24')](_0x45e1('0x25'),_0xa8bbf9+'-'+_0x4aea60+'/'+_0x4de963)[_0x45e1('0x1f')](_0x2de680);}return null;};}function patchUpdates(_0x393fdf){return function(_0x4f4884){try{jsonpatch[_0x45e1('0x26')](_0x4f4884,_0x393fdf,!![]);}catch(_0x43cc42){return BPromise[_0x45e1('0x27')](_0x43cc42);}return _0x4f4884[_0x45e1('0x28')]();};}function saveUpdates(_0x3a312b,_0x32ae6b){return function(_0x477b12){if(_0x477b12){return _0x477b12[_0x45e1('0x29')](_0x3a312b)[_0x45e1('0x2a')](function(_0x68a3b){return _0x68a3b;});}return null;};}function removeEntity(_0x2f724b,_0x51fb60){return function(_0x3847dd){if(_0x3847dd){return _0x3847dd[_0x45e1('0x2b')]()[_0x45e1('0x2a')](function(){var _0x2d615a=_0x3847dd[_0x45e1('0x2c')]({'plain':!![]});var _0x103b7a=_0x45e1('0x2d');return db[_0x45e1('0x2e')][_0x45e1('0x2b')]({'where':{'type':_0x103b7a,'resourceId':_0x2d615a['id']}})[_0x45e1('0x2a')](function(){return _0x3847dd;});})[_0x45e1('0x2a')](function(){_0x2f724b[_0x45e1('0x1d')](0xcc)[_0x45e1('0x1e')]();});}};}function handleEntityNotFound(_0x2a3f95,_0x2d2b14){return function(_0x371cf5){if(!_0x371cf5){_0x2a3f95[_0x45e1('0x2f')](0x194);}return _0x371cf5;};}function handleError(_0x8b253,_0x541a9a){_0x541a9a=_0x541a9a||0x1f4;return function(_0x2b6287){logger['error'](_0x2b6287[_0x45e1('0x30')]);if(_0x2b6287[_0x45e1('0x31')]){delete _0x2b6287['name'];}_0x8b253[_0x45e1('0x1d')](_0x541a9a)[_0x45e1('0x32')](_0x2b6287);};}exports[_0x45e1('0x33')]=function(_0x2e5391,_0x1f2069){var _0x290d99={},_0x85a172={},_0x47e77d={'count':0x0,'rows':[]};var _0x2259bc=_['map'](db[_0x45e1('0x34')][_0x45e1('0x35')],function(_0x3df426){return{'name':_0x3df426[_0x45e1('0x36')],'type':_0x3df426['type']['key']};});_0x85a172[_0x45e1('0x37')]=_['map'](_0x2259bc,_0x45e1('0x31'));_0x85a172[_0x45e1('0x38')]=_[_0x45e1('0x39')](_0x2e5391['query']);_0x85a172[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x85a172[_0x45e1('0x37')],_0x85a172[_0x45e1('0x38')]);_0x290d99[_0x45e1('0x3c')]=_['intersection'](_0x85a172[_0x45e1('0x37')],qs[_0x45e1('0x3d')](_0x2e5391[_0x45e1('0x38')]['fields']));_0x290d99['attributes']=_0x290d99[_0x45e1('0x3c')][_0x45e1('0x3e')]?_0x290d99['attributes']:_0x85a172['model'];if(!_0x2e5391[_0x45e1('0x38')][_0x45e1('0x3f')]('nolimit')){_0x290d99[_0x45e1('0x20')]=qs['limit'](_0x2e5391[_0x45e1('0x38')][_0x45e1('0x20')]);_0x290d99[_0x45e1('0x23')]=qs['offset'](_0x2e5391['query'][_0x45e1('0x23')]);}_0x290d99[_0x45e1('0x40')]=qs[_0x45e1('0x41')](_0x2e5391[_0x45e1('0x38')]['sort']);_0x290d99['where']=qs['filters'](_[_0x45e1('0x42')](_0x2e5391[_0x45e1('0x38')],_0x85a172[_0x45e1('0x3a')]),_0x2259bc);if(_0x2e5391['query']['filter']){_0x290d99['where']=_[_0x45e1('0x43')](_0x290d99[_0x45e1('0x44')],{'$or':_[_0x45e1('0x45')](_0x2259bc,function(_0x134210){if(_0x134210[_0x45e1('0x46')]!==_0x45e1('0x47')){var _0x566b6f={};_0x566b6f[_0x134210[_0x45e1('0x31')]]={'$like':'%'+_0x2e5391[_0x45e1('0x38')][_0x45e1('0x48')]+'%'};return _0x566b6f;}})});}_0x290d99=_[_0x45e1('0x43')]({},_0x290d99,_0x2e5391['options']);var _0x3fb463={'where':_0x290d99['where']};return db[_0x45e1('0x34')]['count'](_0x3fb463)[_0x45e1('0x2a')](function(_0x30af52){_0x47e77d[_0x45e1('0x22')]=_0x30af52;if(_0x2e5391[_0x45e1('0x38')][_0x45e1('0x49')]){_0x290d99['include']=[{'all':!![]}];}return db[_0x45e1('0x34')][_0x45e1('0x4a')](_0x290d99);})[_0x45e1('0x2a')](function(_0x46feb6){_0x47e77d[_0x45e1('0x4b')]=_0x46feb6;return _0x47e77d;})[_0x45e1('0x2a')](respondWithFilteredResult(_0x1f2069,_0x290d99))['catch'](handleError(_0x1f2069,null));};exports[_0x45e1('0x4c')]=function(_0x859bb3,_0x5e25f8){var _0x3d14b1={'raw':![],'where':{'id':_0x859bb3[_0x45e1('0x4d')]['id']}},_0x3df715={};_0x3df715[_0x45e1('0x37')]=_[_0x45e1('0x39')](db[_0x45e1('0x34')][_0x45e1('0x35')]);_0x3df715[_0x45e1('0x38')]=_[_0x45e1('0x39')](_0x859bb3[_0x45e1('0x38')]);_0x3df715[_0x45e1('0x3a')]=_[_0x45e1('0x3b')](_0x3df715[_0x45e1('0x37')],_0x3df715[_0x45e1('0x38')]);_0x3d14b1[_0x45e1('0x3c')]=_['intersection'](_0x3df715[_0x45e1('0x37')],qs[_0x45e1('0x3d')](_0x859bb3[_0x45e1('0x38')][_0x45e1('0x3d')]));_0x3d14b1[_0x45e1('0x3c')]=_0x3d14b1[_0x45e1('0x3c')][_0x45e1('0x3e')]?_0x3d14b1[_0x45e1('0x3c')]:_0x3df715[_0x45e1('0x37')];if(_0x859bb3[_0x45e1('0x38')][_0x45e1('0x49')]){_0x3d14b1['include']=[{'all':!![]}];}_0x3d14b1=_[_0x45e1('0x43')]({},_0x3d14b1,_0x859bb3['options']);return db[_0x45e1('0x34')][_0x45e1('0x4e')](_0x3d14b1)[_0x45e1('0x2a')](handleEntityNotFound(_0x5e25f8,null))[_0x45e1('0x2a')](respondWithResult(_0x5e25f8,null))['catch'](handleError(_0x5e25f8,null));};exports[_0x45e1('0x4f')]=function(_0x38f779,_0x17701d){return db[_0x45e1('0x34')][_0x45e1('0x4f')](_0x38f779[_0x45e1('0x50')],{})['then'](function(_0x409f0f){var _0x30fbaa=_0x38f779[_0x45e1('0x51')][_0x45e1('0x2c')]({'plain':!![]});if(!_0x30fbaa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30fbaa[_0x45e1('0x52')]===_0x45e1('0x51')){var _0x14bd32=_0x409f0f[_0x45e1('0x2c')]({'plain':!![]});var _0x10580e=_0x45e1('0x2d');return db[_0x45e1('0x53')][_0x45e1('0x4e')]({'where':{'name':_0x10580e,'userProfileId':_0x30fbaa[_0x45e1('0x54')]},'raw':!![]})[_0x45e1('0x2a')](function(_0x53f2f4){if(_0x53f2f4&&_0x53f2f4[_0x45e1('0x55')]===0x0){return db[_0x45e1('0x2e')][_0x45e1('0x4f')]({'name':_0x14bd32[_0x45e1('0x31')],'resourceId':_0x14bd32['id'],'type':_0x53f2f4['name'],'sectionId':_0x53f2f4['id']},{})[_0x45e1('0x2a')](function(){return _0x409f0f;});}else{return _0x409f0f;}})[_0x45e1('0x56')](function(_0x4e0bca){logger[_0x45e1('0x57')](_0x45e1('0x58'),_0x4e0bca);throw _0x4e0bca;});}return _0x409f0f;})[_0x45e1('0x2a')](respondWithResult(_0x17701d,0xc9))[_0x45e1('0x56')](handleError(_0x17701d,null));};exports[_0x45e1('0x29')]=function(_0x5e08e1,_0x260ee1){if(_0x5e08e1[_0x45e1('0x50')]['id']){delete _0x5e08e1[_0x45e1('0x50')]['id'];}return db[_0x45e1('0x34')]['find']({'where':{'id':_0x5e08e1[_0x45e1('0x4d')]['id']}})[_0x45e1('0x2a')](handleEntityNotFound(_0x260ee1,null))['then'](saveUpdates(_0x5e08e1[_0x45e1('0x50')],null))[_0x45e1('0x2a')](respondWithResult(_0x260ee1,null))[_0x45e1('0x56')](handleError(_0x260ee1,null));};exports[_0x45e1('0x2b')]=function(_0x1140ce,_0x17a0ae){return db['VoiceChanSpy']['find']({'where':{'id':_0x1140ce['params']['id']}})[_0x45e1('0x2a')](handleEntityNotFound(_0x17a0ae,null))['then'](removeEntity(_0x17a0ae,null))[_0x45e1('0x56')](handleError(_0x17a0ae,null));}; \ No newline at end of file +var _0x220b=['findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','ChanSpies','destroy','sendStatus','stack','name','send','index','map','VoiceChanSpy','fieldName','query','keys','filters','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x1f9179,_0x598964){var _0x2974c9=function(_0x52443b){while(--_0x52443b){_0x1f9179['push'](_0x1f9179['shift']());}};_0x2974c9(++_0x598964);}(_0x220b,0x1a2));var _0xb220=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x220b[_0x24fa1a];return _0xc5621f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb220('0x0'));var zipdir=require(_0xb220('0x1'));var jsonpatch=require(_0xb220('0x2'));var rp=require(_0xb220('0x3'));var moment=require('moment');var BPromise=require(_0xb220('0x4'));var Mustache=require('mustache');var util=require(_0xb220('0x5'));var path=require('path');var sox=require(_0xb220('0x6'));var csv=require(_0xb220('0x7'));var ejs=require(_0xb220('0x8'));var fs=require('fs');var fs_extra=require(_0xb220('0x9'));var _=require('lodash');var squel=require(_0xb220('0xa'));var crypto=require(_0xb220('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb220('0xc'));var toCsv=require(_0xb220('0x7'));var querystring=require(_0xb220('0xd'));var Papa=require(_0xb220('0xe'));var Redis=require(_0xb220('0xf'));var authService=require(_0xb220('0x10'));var qs=require(_0xb220('0x11'));var as=require(_0xb220('0x12'));var hardwareService=require(_0xb220('0x13'));var logger=require('../../config/logger')(_0xb220('0x14'));var utils=require(_0xb220('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x528ce0,_0x59ef3e){_0x59ef3e=_0x59ef3e||0xcc;return function(_0x11229c){if(_0x11229c){return _0x528ce0['sendStatus'](_0x59ef3e);}return _0x528ce0[_0xb220('0x16')](_0x59ef3e)[_0xb220('0x17')]();};}function respondWithResult(_0x378a3b,_0x312c59){_0x312c59=_0x312c59||0xc8;return function(_0x576649){if(_0x576649){return _0x378a3b['status'](_0x312c59)[_0xb220('0x18')](_0x576649);}};}function respondWithFilteredResult(_0x1db409,_0x159eb7){return function(_0x2ee3d2){if(_0x2ee3d2){var _0x16a34b=typeof _0x159eb7[_0xb220('0x19')]===_0xb220('0x1a')&&typeof _0x159eb7[_0xb220('0x1b')]===_0xb220('0x1a');var _0x1416de=_0x2ee3d2[_0xb220('0x1c')];var _0x464ceb=_0x16a34b?0x0:_0x159eb7[_0xb220('0x19')];var _0x21cf2d=_0x16a34b?_0x2ee3d2[_0xb220('0x1c')]:_0x159eb7[_0xb220('0x19')]+_0x159eb7[_0xb220('0x1b')];var _0x1cc822;if(_0x21cf2d>=_0x1416de){_0x21cf2d=_0x1416de;_0x1cc822=0xc8;}else{_0x1cc822=0xce;}_0x1db409[_0xb220('0x16')](_0x1cc822);return _0x1db409[_0xb220('0x1d')](_0xb220('0x1e'),_0x464ceb+'-'+_0x21cf2d+'/'+_0x1416de)[_0xb220('0x18')](_0x2ee3d2);}return null;};}function patchUpdates(_0x213736){return function(_0x358035){try{jsonpatch['apply'](_0x358035,_0x213736,!![]);}catch(_0x45b406){return BPromise['reject'](_0x45b406);}return _0x358035[_0xb220('0x1f')]();};}function saveUpdates(_0x5c4d46,_0x3a1ad7){return function(_0x501f0f){if(_0x501f0f){return _0x501f0f[_0xb220('0x20')](_0x5c4d46)[_0xb220('0x21')](function(_0x2ddf73){return _0x2ddf73;});}return null;};}function removeEntity(_0x2f5a0d,_0x396c72){return function(_0x2975ff){if(_0x2975ff){return _0x2975ff['destroy']()[_0xb220('0x21')](function(){var _0x108450=_0x2975ff[_0xb220('0x22')]({'plain':!![]});var _0x1849c8=_0xb220('0x23');return db['UserProfileResource'][_0xb220('0x24')]({'where':{'type':_0x1849c8,'resourceId':_0x108450['id']}})[_0xb220('0x21')](function(){return _0x2975ff;});})['then'](function(){_0x2f5a0d[_0xb220('0x16')](0xcc)[_0xb220('0x17')]();});}};}function handleEntityNotFound(_0x19d0c4,_0x20b7e5){return function(_0x386778){if(!_0x386778){_0x19d0c4[_0xb220('0x25')](0x194);}return _0x386778;};}function handleError(_0x5c18cb,_0x3b4644){_0x3b4644=_0x3b4644||0x1f4;return function(_0x54c1b9){logger['error'](_0x54c1b9[_0xb220('0x26')]);if(_0x54c1b9[_0xb220('0x27')]){delete _0x54c1b9[_0xb220('0x27')];}_0x5c18cb[_0xb220('0x16')](_0x3b4644)[_0xb220('0x28')](_0x54c1b9);};}exports[_0xb220('0x29')]=function(_0x463e6a,_0x355525){var _0x44da01={},_0x436715={},_0x4e202c={'count':0x0,'rows':[]};var _0x2d98e5=_[_0xb220('0x2a')](db[_0xb220('0x2b')]['rawAttributes'],function(_0x5768eb){return{'name':_0x5768eb[_0xb220('0x2c')],'type':_0x5768eb['type']['key']};});_0x436715['model']=_[_0xb220('0x2a')](_0x2d98e5,_0xb220('0x27'));_0x436715[_0xb220('0x2d')]=_[_0xb220('0x2e')](_0x463e6a[_0xb220('0x2d')]);_0x436715[_0xb220('0x2f')]=_['intersection'](_0x436715['model'],_0x436715[_0xb220('0x2d')]);_0x44da01[_0xb220('0x30')]=_['intersection'](_0x436715[_0xb220('0x31')],qs['fields'](_0x463e6a[_0xb220('0x2d')][_0xb220('0x32')]));_0x44da01[_0xb220('0x30')]=_0x44da01[_0xb220('0x30')][_0xb220('0x33')]?_0x44da01['attributes']:_0x436715['model'];if(!_0x463e6a['query'][_0xb220('0x34')]('nolimit')){_0x44da01[_0xb220('0x1b')]=qs[_0xb220('0x1b')](_0x463e6a[_0xb220('0x2d')]['limit']);_0x44da01['offset']=qs[_0xb220('0x19')](_0x463e6a['query'][_0xb220('0x19')]);}_0x44da01[_0xb220('0x35')]=qs['sort'](_0x463e6a[_0xb220('0x2d')][_0xb220('0x36')]);_0x44da01[_0xb220('0x37')]=qs[_0xb220('0x2f')](_[_0xb220('0x38')](_0x463e6a[_0xb220('0x2d')],_0x436715[_0xb220('0x2f')]),_0x2d98e5);if(_0x463e6a[_0xb220('0x2d')][_0xb220('0x39')]){_0x44da01[_0xb220('0x37')]=_[_0xb220('0x3a')](_0x44da01[_0xb220('0x37')],{'$or':_[_0xb220('0x2a')](_0x2d98e5,function(_0x5ef350){if(_0x5ef350[_0xb220('0x3b')]!==_0xb220('0x3c')){var _0x1cca35={};_0x1cca35[_0x5ef350[_0xb220('0x27')]]={'$like':'%'+_0x463e6a[_0xb220('0x2d')]['filter']+'%'};return _0x1cca35;}})});}_0x44da01=_[_0xb220('0x3a')]({},_0x44da01,_0x463e6a[_0xb220('0x3d')]);var _0x2a5008={'where':_0x44da01[_0xb220('0x37')]};return db['VoiceChanSpy']['count'](_0x2a5008)[_0xb220('0x21')](function(_0x51fd4f){_0x4e202c['count']=_0x51fd4f;if(_0x463e6a[_0xb220('0x2d')]['includeAll']){_0x44da01['include']=[{'all':!![]}];}return db[_0xb220('0x2b')][_0xb220('0x3e')](_0x44da01);})[_0xb220('0x21')](function(_0x24d75c){_0x4e202c[_0xb220('0x3f')]=_0x24d75c;return _0x4e202c;})['then'](respondWithFilteredResult(_0x355525,_0x44da01))[_0xb220('0x40')](handleError(_0x355525,null));};exports[_0xb220('0x41')]=function(_0x458105,_0x284eb2){var _0x45c609={'raw':![],'where':{'id':_0x458105[_0xb220('0x42')]['id']}},_0x2689a1={};_0x2689a1[_0xb220('0x31')]=_[_0xb220('0x2e')](db['VoiceChanSpy']['rawAttributes']);_0x2689a1['query']=_[_0xb220('0x2e')](_0x458105[_0xb220('0x2d')]);_0x2689a1[_0xb220('0x2f')]=_[_0xb220('0x43')](_0x2689a1[_0xb220('0x31')],_0x2689a1[_0xb220('0x2d')]);_0x45c609[_0xb220('0x30')]=_[_0xb220('0x43')](_0x2689a1[_0xb220('0x31')],qs[_0xb220('0x32')](_0x458105[_0xb220('0x2d')][_0xb220('0x32')]));_0x45c609[_0xb220('0x30')]=_0x45c609['attributes'][_0xb220('0x33')]?_0x45c609[_0xb220('0x30')]:_0x2689a1['model'];if(_0x458105[_0xb220('0x2d')][_0xb220('0x44')]){_0x45c609[_0xb220('0x45')]=[{'all':!![]}];}_0x45c609=_[_0xb220('0x3a')]({},_0x45c609,_0x458105[_0xb220('0x3d')]);return db[_0xb220('0x2b')][_0xb220('0x46')](_0x45c609)[_0xb220('0x21')](handleEntityNotFound(_0x284eb2,null))[_0xb220('0x21')](respondWithResult(_0x284eb2,null))[_0xb220('0x40')](handleError(_0x284eb2,null));};exports['create']=function(_0x56fb72,_0x4d80f6){return db[_0xb220('0x2b')][_0xb220('0x47')](_0x56fb72[_0xb220('0x48')],{})[_0xb220('0x21')](function(_0x5c6c3d){var _0x4e0f01=_0x56fb72[_0xb220('0x49')][_0xb220('0x22')]({'plain':!![]});if(!_0x4e0f01)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e0f01['role']===_0xb220('0x49')){var _0x5ef174=_0x5c6c3d[_0xb220('0x22')]({'plain':!![]});var _0xa4ce65=_0xb220('0x23');return db[_0xb220('0x4a')][_0xb220('0x46')]({'where':{'name':_0xa4ce65,'userProfileId':_0x4e0f01[_0xb220('0x4b')]},'raw':!![]})['then'](function(_0x3e1156){if(_0x3e1156&&_0x3e1156[_0xb220('0x4c')]===0x0){return db[_0xb220('0x4d')][_0xb220('0x47')]({'name':_0x5ef174[_0xb220('0x27')],'resourceId':_0x5ef174['id'],'type':_0x3e1156[_0xb220('0x27')],'sectionId':_0x3e1156['id']},{})['then'](function(){return _0x5c6c3d;});}else{return _0x5c6c3d;}})['catch'](function(_0x179cc5){logger[_0xb220('0x4e')](_0xb220('0x4f'),_0x179cc5);throw _0x179cc5;});}return _0x5c6c3d;})[_0xb220('0x21')](respondWithResult(_0x4d80f6,0xc9))[_0xb220('0x40')](handleError(_0x4d80f6,null));};exports[_0xb220('0x20')]=function(_0x255b7b,_0xc92b82){if(_0x255b7b[_0xb220('0x48')]['id']){delete _0x255b7b[_0xb220('0x48')]['id'];}return db['VoiceChanSpy'][_0xb220('0x46')]({'where':{'id':_0x255b7b['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0xc92b82,null))[_0xb220('0x21')](saveUpdates(_0x255b7b[_0xb220('0x48')],null))[_0xb220('0x21')](respondWithResult(_0xc92b82,null))[_0xb220('0x40')](handleError(_0xc92b82,null));};exports[_0xb220('0x24')]=function(_0x22063c,_0x5e7a1f){return db['VoiceChanSpy'][_0xb220('0x46')]({'where':{'id':_0x22063c[_0xb220('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e7a1f,null))[_0xb220('0x21')](removeEntity(_0x5e7a1f,null))['catch'](handleError(_0x5e7a1f,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c4ca6eb..b0f4a1a 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 _0x7699=['push','merge','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','SIP/%s,%s','options','join','StopMixMonitor','length','name','User','findAll','internal','agent','then','catch','exports','models','define','voice_chanspy','bulkCreate','destroy','VoiceExtension','context','format','%s%s','prefix'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x7699,0x92));var _0x9769=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x7699[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x4d163f,_0x5edde5,_0x40b27c){var _0x355a2a=0x1;var _0x49db3b=[];var _0x306001={'context':_0x5edde5[_0x9769('0x0')]||'from-sip','exten':util[_0x9769('0x1')](_0x9769('0x2'),_0x4d163f[_0x9769('0x3')],_0x40b27c),'type':'system','isApp':![],'ChanSpyId':_0x4d163f['id'],'UserId':_0x5edde5['id']};_0x49db3b[_0x9769('0x4')](_[_0x9769('0x5')]({'app':'Set','appdata':util['format'](_0x9769('0x6'),'chanspy'),'priority':_0x355a2a++},_0x306001));if(_0x4d163f[_0x9769('0x7')]){_0x49db3b['push'](_[_0x9769('0x5')]({'app':'MixMonitor','appdata':util[_0x9769('0x1')](_0x9769('0x8'),_0x4d163f[_0x9769('0x9')]),'priority':_0x355a2a++},_0x306001));}if(_0x4d163f[_0x9769('0xa')]){_0x49db3b[_0x9769('0x4')](_[_0x9769('0x5')]({'app':'Authenticate','appdata':_0x4d163f['password'],'priority':_0x355a2a++},_0x306001));}_0x49db3b[_0x9769('0x4')](_[_0x9769('0x5')]({'app':'ChanSpy','appdata':util[_0x9769('0x1')](_0x9769('0xb'),_0x5edde5['name'],_0x4d163f[_0x9769('0xc')]?_0x4d163f['options'][_0x9769('0xd')](''):''),'priority':_0x355a2a++},_0x306001));if(_0x4d163f['record']){_0x49db3b[_0x9769('0x4')](_[_0x9769('0x5')]({'app':_0x9769('0xe'),'priority':_0x355a2a++},_0x306001));}return _0x49db3b;};var getChanSpyApplications=function(_0x129a87,_0x32ac82){var _0x2a1e9c=[];for(var _0x6bd457=0x0,_0x5db686=0x1;_0x6bd457<_0x32ac82[_0x9769('0xf')];_0x6bd457++,_0x5db686=0x1){_0x2a1e9c=_0x2a1e9c['concat'](getUserApplications(_0x129a87,_0x32ac82[_0x6bd457],_0x32ac82[_0x6bd457]['internal']));if(_0x32ac82[_0x6bd457]['internal']!=_0x32ac82[_0x6bd457][_0x9769('0x10')]){_0x2a1e9c=_0x2a1e9c['concat'](getUserApplications(_0x129a87,_0x32ac82[_0x6bd457],_0x32ac82[_0x6bd457][_0x9769('0x10')]));}}return _0x2a1e9c;};var getChanSpyPromise=function(_0x4db008,_0x236a9e){return new BPromise(function(_0x2b5044,_0xf14187){return _0x4db008[_0x9769('0x11')][_0x9769('0x12')]({'attributes':['id','name',_0x9769('0x13')],'where':{'role':_0x9769('0x14'),'chanspy':!![]},'raw':!![]})[_0x9769('0x15')](function(_0x48a056){if(_0x48a056){return _0x2b5044(getChanSpyApplications(_0x236a9e,_0x48a056));}return _0x2b5044([]);})[_0x9769('0x16')](function(_0x5754dd){_0xf14187(_0x5754dd);});});};module[_0x9769('0x17')]=function(_0x4c678b,_0x541b10){var _0x555797=_0x4c678b[_0x9769('0x18')];return _0x4c678b[_0x9769('0x19')]('VoiceChanSpy',attributes,{'tableName':_0x9769('0x1a'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd751bf,_0x56deb2,_0x33fa82){return getChanSpyPromise(_0x555797,_0xd751bf)[_0x9769('0x15')](function(_0x400889){if(_0x400889&&_0x400889[_0x9769('0xf')]){return _0x555797['VoiceExtension'][_0x9769('0x1b')](_0x400889);}})[_0x9769('0x15')](function(){_0x33fa82();})[_0x9769('0x16')](function(_0x210651){_0x33fa82(_0x210651);});},'afterUpdate':function(_0x147081,_0x5b5fde,_0x5ce65b){return _0x555797['VoiceExtension'][_0x9769('0x1c')]({'where':{'ChanSpyId':_0x147081['id']}})[_0x9769('0x15')](function(){return getChanSpyPromise(_0x555797,_0x147081);})[_0x9769('0x15')](function(_0x4783dd){if(_0x4783dd&&_0x4783dd[_0x9769('0xf')]){return _0x555797[_0x9769('0x1d')][_0x9769('0x1b')](_0x4783dd);}})['then'](function(){_0x5ce65b();})[_0x9769('0x16')](function(_0x129d11){_0x5ce65b(_0x129d11);});},'afterDestroy':function(_0x2e69b1,_0x272ca6,_0x3ec599){return _0x555797[_0x9769('0x1d')][_0x9769('0x1c')]({'where':{'ChanSpyId':_0x2e69b1['id']}})[_0x9769('0x15')](function(){_0x3ec599();})[_0x9769('0x16')](function(_0x42a566){_0x3ec599(_0x42a566);});}}});}; \ No newline at end of file +var _0xd4a0=['push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','models','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xd4a0,0x110));var _0x0d4a=function(_0x5071eb,_0x4c9c6a){_0x5071eb=_0x5071eb-0x0;var _0x2a746a=_0xd4a0[_0x5071eb];return _0x2a746a;};'use strict';var _=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var BPromise=require('bluebird');var attributes=require(_0x0d4a('0x2'));var getUserApplications=function(_0x31d5ec,_0x27d561,_0x4c5727){var _0x4a65ff=0x1;var _0x1d0b5d=[];var _0x451f96={'context':_0x27d561[_0x0d4a('0x3')]||_0x0d4a('0x4'),'exten':util[_0x0d4a('0x5')](_0x0d4a('0x6'),_0x31d5ec[_0x0d4a('0x7')],_0x4c5727),'type':'system','isApp':![],'ChanSpyId':_0x31d5ec['id'],'UserId':_0x27d561['id']};_0x1d0b5d[_0x0d4a('0x8')](_[_0x0d4a('0x9')]({'app':_0x0d4a('0xa'),'appdata':util['format'](_0x0d4a('0xb'),_0x0d4a('0xc')),'priority':_0x4a65ff++},_0x451f96));if(_0x31d5ec[_0x0d4a('0xd')]){_0x1d0b5d[_0x0d4a('0x8')](_['merge']({'app':_0x0d4a('0xe'),'appdata':util[_0x0d4a('0x5')](_0x0d4a('0xf'),_0x31d5ec['recordingFormat']),'priority':_0x4a65ff++},_0x451f96));}if(_0x31d5ec['auth']){_0x1d0b5d[_0x0d4a('0x8')](_[_0x0d4a('0x9')]({'app':_0x0d4a('0x10'),'appdata':_0x31d5ec[_0x0d4a('0x11')],'priority':_0x4a65ff++},_0x451f96));}_0x1d0b5d[_0x0d4a('0x8')](_[_0x0d4a('0x9')]({'app':_0x0d4a('0x12'),'appdata':util[_0x0d4a('0x5')]('SIP/%s,%s',_0x27d561[_0x0d4a('0x13')],_0x31d5ec[_0x0d4a('0x14')]?_0x31d5ec[_0x0d4a('0x14')]['join'](''):''),'priority':_0x4a65ff++},_0x451f96));if(_0x31d5ec[_0x0d4a('0xd')]){_0x1d0b5d[_0x0d4a('0x8')](_[_0x0d4a('0x9')]({'app':_0x0d4a('0x15'),'priority':_0x4a65ff++},_0x451f96));}return _0x1d0b5d;};var getChanSpyApplications=function(_0x5320a8,_0x3fba16){var _0x48f93c=[];for(var _0x3055e7=0x0,_0x284f69=0x1;_0x3055e7<_0x3fba16[_0x0d4a('0x16')];_0x3055e7++,_0x284f69=0x1){_0x48f93c=_0x48f93c[_0x0d4a('0x17')](getUserApplications(_0x5320a8,_0x3fba16[_0x3055e7],_0x3fba16[_0x3055e7][_0x0d4a('0x18')]));if(_0x3fba16[_0x3055e7]['internal']!=_0x3fba16[_0x3055e7][_0x0d4a('0x13')]){_0x48f93c=_0x48f93c[_0x0d4a('0x17')](getUserApplications(_0x5320a8,_0x3fba16[_0x3055e7],_0x3fba16[_0x3055e7][_0x0d4a('0x13')]));}}return _0x48f93c;};var getChanSpyPromise=function(_0x23d086,_0x3218e0){return new BPromise(function(_0x280eec,_0x514b87){return _0x23d086[_0x0d4a('0x19')][_0x0d4a('0x1a')]({'attributes':['id',_0x0d4a('0x13'),_0x0d4a('0x18')],'where':{'role':_0x0d4a('0x1b'),'chanspy':!![]},'raw':!![]})[_0x0d4a('0x1c')](function(_0x50577c){if(_0x50577c){return _0x280eec(getChanSpyApplications(_0x3218e0,_0x50577c));}return _0x280eec([]);})[_0x0d4a('0x1d')](function(_0x3ffe5b){_0x514b87(_0x3ffe5b);});});};module['exports']=function(_0x1599ec,_0x43489b){var _0x14568b=_0x1599ec[_0x0d4a('0x1e')];return _0x1599ec['define'](_0x0d4a('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e36f7,_0x1c6758,_0xad64f3){return getChanSpyPromise(_0x14568b,_0x2e36f7)[_0x0d4a('0x1c')](function(_0x2b5bf4){if(_0x2b5bf4&&_0x2b5bf4[_0x0d4a('0x16')]){return _0x14568b[_0x0d4a('0x20')][_0x0d4a('0x21')](_0x2b5bf4);}})[_0x0d4a('0x1c')](function(){_0xad64f3();})[_0x0d4a('0x1d')](function(_0x38d051){_0xad64f3(_0x38d051);});},'afterUpdate':function(_0x2db304,_0x50cb6d,_0x5663c9){return _0x14568b['VoiceExtension'][_0x0d4a('0x22')]({'where':{'ChanSpyId':_0x2db304['id']}})[_0x0d4a('0x1c')](function(){return getChanSpyPromise(_0x14568b,_0x2db304);})[_0x0d4a('0x1c')](function(_0xf09ab8){if(_0xf09ab8&&_0xf09ab8[_0x0d4a('0x16')]){return _0x14568b[_0x0d4a('0x20')][_0x0d4a('0x21')](_0xf09ab8);}})[_0x0d4a('0x1c')](function(){_0x5663c9();})['catch'](function(_0x1ae37c){_0x5663c9(_0x1ae37c);});},'afterDestroy':function(_0x36a178,_0xe25182,_0x35740c){return _0x14568b['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x36a178['id']}})[_0x0d4a('0x1c')](function(){_0x35740c();})[_0x0d4a('0x1d')](function(_0x229958){_0x35740c(_0x229958);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 3b93b47..aa679cb 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 _0xdb94=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x5d011d,_0x224380){var _0x1eaf16=function(_0x586af1){while(--_0x586af1){_0x5d011d['push'](_0x5d011d['shift']());}};_0x1eaf16(++_0x224380);}(_0xdb94,0xab));var _0x4db9=function(_0x5bd35c,_0x59c903){_0x5bd35c=_0x5bd35c-0x0;var _0x50026e=_0xdb94[_0x5bd35c];return _0x50026e;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});} \ No newline at end of file +var _0x0565=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2c22af,_0x2eb697){var _0x152f58=function(_0x4d61ac){while(--_0x4d61ac){_0x2c22af['push'](_0x2c22af['shift']());}};_0x152f58(++_0x2eb697);}(_0x0565,0xf2));var _0x5056=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0565[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index dfe709d..b715378 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 _0x045f=['index','get','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x045f,0x1ea));var _0xf045=function(_0x3873bf,_0x1c0241){_0x3873bf=_0x3873bf-0x0;var _0x9e86c9=_0x045f[_0x3873bf];return _0x9e86c9;};'use strict';var multer=require(_0xf045('0x0'));var util=require(_0xf045('0x1'));var path=require(_0xf045('0x2'));var timeout=require(_0xf045('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf045('0x4'));var auth=require(_0xf045('0x5'));var interaction=require(_0xf045('0x6'));var config=require(_0xf045('0x7'));var controller=require(_0xf045('0x8'));router['get']('/',auth[_0xf045('0x9')](),controller[_0xf045('0xa')]);router[_0xf045('0xb')]('/:id',auth[_0xf045('0x9')](),controller[_0xf045('0xc')]);router[_0xf045('0xd')]('/',auth[_0xf045('0x9')](),controller[_0xf045('0xe')]);router[_0xf045('0xf')]('/:id',auth[_0xf045('0x9')](),controller['update']);router[_0xf045('0x10')](_0xf045('0x11'),auth[_0xf045('0x9')](),controller[_0xf045('0x12')]);module[_0xf045('0x13')]=router; \ No newline at end of file +var _0xebd0=['isAuthenticated','index','/:id','show','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0xebd0,0x170));var _0x0ebd=function(_0x12046c,_0x5a34f4){_0x12046c=_0x12046c-0x0;var _0x3a1f2b=_0xebd0[_0x12046c];return _0x3a1f2b;};'use strict';var multer=require('multer');var util=require(_0x0ebd('0x0'));var path=require(_0x0ebd('0x1'));var timeout=require(_0x0ebd('0x2'));var express=require(_0x0ebd('0x3'));var router=express[_0x0ebd('0x4')]();var fs_extra=require(_0x0ebd('0x5'));var auth=require(_0x0ebd('0x6'));var interaction=require(_0x0ebd('0x7'));var config=require('../../config/environment');var controller=require(_0x0ebd('0x8'));router[_0x0ebd('0x9')]('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xb')]);router['get'](_0x0ebd('0xc'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xd')]);router['post']('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xe')]);router['put'](_0x0ebd('0xc'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xf')]);router[_0x0ebd('0x10')]('/:id',auth[_0x0ebd('0xa')](),controller['destroy']);module[_0x0ebd('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 0fd2cea..0c9390c 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 _0xfb70=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x489744,_0x4da3b1){var _0xa4de3f=function(_0x3511e5){while(--_0x3511e5){_0x489744['push'](_0x489744['shift']());}};_0xa4de3f(++_0x4da3b1);}(_0xfb70,0x150));var _0x0fb7=function(_0x12a1e1,_0x4f7845){_0x12a1e1=_0x12a1e1-0x0;var _0x1dab51=_0xfb70[_0x12a1e1];return _0x1dab51;};'use strict';var Sequelize=require(_0x0fb7('0x0'));module[_0x0fb7('0x1')]={'name':{'type':Sequelize[_0x0fb7('0x2')],'unique':_0x0fb7('0x3')},'description':{'type':Sequelize[_0x0fb7('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0fb7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xee36=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xee36,0x109));var _0x6ee3=function(_0x151a57,_0x12770d){_0x151a57=_0x151a57-0x0;var _0x5747c7=_0xee36[_0x151a57];return _0x5747c7;};'use strict';var Sequelize=require(_0x6ee3('0x0'));module[_0x6ee3('0x1')]={'name':{'type':Sequelize[_0x6ee3('0x2')],'unique':_0x6ee3('0x3')},'description':{'type':Sequelize[_0x6ee3('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6ee3('0x4')],'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 cbe99db..a9b7767 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 _0x805e=['Reload','create','chan_sip.so','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','end','undefined','offset','limit','set','json','save','update','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf'];(function(_0x3ba9f9,_0x175e35){var _0x4ae181=function(_0x53d133){while(--_0x53d133){_0x3ba9f9['push'](_0x3ba9f9['shift']());}};_0x4ae181(++_0x175e35);}(_0x805e,0x131));var _0xe805=function(_0x3ebabb,_0x1cef82){_0x3ebabb=_0x3ebabb-0x0;var _0x3488cf=_0x805e[_0x3ebabb];return _0x3488cf;};'use strict';var emlformat=require(_0xe805('0x0'));var rimraf=require(_0xe805('0x1'));var zipdir=require(_0xe805('0x2'));var jsonpatch=require(_0xe805('0x3'));var rp=require(_0xe805('0x4'));var moment=require(_0xe805('0x5'));var BPromise=require(_0xe805('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe805('0x7'));var sox=require(_0xe805('0x8'));var csv=require(_0xe805('0x9'));var ejs=require(_0xe805('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe805('0xb'));var crypto=require(_0xe805('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe805('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe805('0xe'));var Papa=require(_0xe805('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe805('0x10'))(_0xe805('0x11'));var utils=require(_0xe805('0x12'));var config=require(_0xe805('0x13'));var licenseUtil=require(_0xe805('0x14'));var db=require(_0xe805('0x15'))['db'];var jayson=require(_0xe805('0x16'));var client=jayson['client'][_0xe805('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x58a64b,_0x2eb2fc,_0x3ae3af,_0x699d00){return new BPromise(function(_0x26ef3d,_0x1f573f){var _0x3c95ce=_0x699d00||client;return _0x3c95ce[_0xe805('0x18')](_0x58a64b,_0x3ae3af)[_0xe805('0x19')](function(_0x2d5a86){logger['info'](_0xe805('0x1a'),_0x2eb2fc,_0xe805('0x1b'));logger[_0xe805('0x1c')](_0xe805('0x1d'),_0x2eb2fc,_0xe805('0x1b'),JSON['stringify'](_0x2d5a86));if(_0x2d5a86[_0xe805('0x1e')]){if(_0x2d5a86['error'][_0xe805('0x1f')]===0x1f4){logger[_0xe805('0x1e')](_0xe805('0x1a'),_0x2eb2fc,_0x2d5a86[_0xe805('0x1e')][_0xe805('0x20')]);return _0x1f573f(_0x2d5a86[_0xe805('0x1e')][_0xe805('0x20')]);}logger[_0xe805('0x1e')](_0xe805('0x1a'),_0x2eb2fc,_0x2d5a86[_0xe805('0x1e')][_0xe805('0x20')]);return _0x26ef3d(_0x2d5a86[_0xe805('0x1e')]['message']);}else{logger[_0xe805('0x21')](_0xe805('0x1a'),_0x2eb2fc,'request\x20sent');_0x26ef3d(_0x2d5a86[_0xe805('0x22')][_0xe805('0x20')]);}})['catch'](function(_0x2d4d32){logger[_0xe805('0x1e')](_0xe805('0x1a'),_0x2eb2fc,_0x2d4d32);_0x1f573f(_0x2d4d32);});});}function respondWithStatusCode(_0x35b89d,_0x11bc9b){_0x11bc9b=_0x11bc9b||0xcc;return function(_0x2d9b59){if(_0x2d9b59){return _0x35b89d[_0xe805('0x23')](_0x11bc9b);}return _0x35b89d[_0xe805('0x24')](_0x11bc9b)[_0xe805('0x25')]();};}function respondWithResult(_0xec749,_0x53347e){_0x53347e=_0x53347e||0xc8;return function(_0x36397d){if(_0x36397d){return _0xec749[_0xe805('0x24')](_0x53347e)['json'](_0x36397d);}};}function respondWithFilteredResult(_0x26784a,_0x5bf8c3){return function(_0x315f84){if(_0x315f84){var _0x322577=typeof _0x5bf8c3['offset']===_0xe805('0x26')&&typeof _0x5bf8c3['limit']===_0xe805('0x26');var _0x5677f2=_0x315f84['count'];var _0x29d429=_0x322577?0x0:_0x5bf8c3[_0xe805('0x27')];var _0x1eb701=_0x322577?_0x315f84['count']:_0x5bf8c3[_0xe805('0x27')]+_0x5bf8c3[_0xe805('0x28')];var _0x5210fc;if(_0x1eb701>=_0x5677f2){_0x1eb701=_0x5677f2;_0x5210fc=0xc8;}else{_0x5210fc=0xce;}_0x26784a['status'](_0x5210fc);return _0x26784a[_0xe805('0x29')]('Content-Range',_0x29d429+'-'+_0x1eb701+'/'+_0x5677f2)[_0xe805('0x2a')](_0x315f84);}return null;};}function patchUpdates(_0x22606e){return function(_0x4dfa67){try{jsonpatch['apply'](_0x4dfa67,_0x22606e,!![]);}catch(_0x24f835){return BPromise['reject'](_0x24f835);}return _0x4dfa67[_0xe805('0x2b')]();};}function saveUpdates(_0x344e14,_0xfbe809){return function(_0x18f4d8){if(_0x18f4d8){return _0x18f4d8[_0xe805('0x2c')](_0x344e14)['then'](function(_0xe8e02f){return _0xe8e02f;});}return null;};}function removeEntity(_0x11546f,_0x2b28b0){return function(_0x526273){if(_0x526273){return _0x526273[_0xe805('0x2d')]()[_0xe805('0x19')](function(){var _0x136895=_0x526273[_0xe805('0x2e')]({'plain':!![]});var _0x43087f=_0xe805('0x2f');return db[_0xe805('0x30')]['destroy']({'where':{'type':_0x43087f,'resourceId':_0x136895['id']}})[_0xe805('0x19')](function(){return _0x526273;});})[_0xe805('0x19')](function(){_0x11546f[_0xe805('0x24')](0xcc)[_0xe805('0x25')]();});}};}function handleEntityNotFound(_0x54f605,_0x54b811){return function(_0x59bb88){if(!_0x59bb88){_0x54f605['sendStatus'](0x194);}return _0x59bb88;};}function handleError(_0x2b7813,_0x13c10c){_0x13c10c=_0x13c10c||0x1f4;return function(_0x28c5c2){logger[_0xe805('0x1e')](_0x28c5c2[_0xe805('0x31')]);if(_0x28c5c2[_0xe805('0x32')]){delete _0x28c5c2[_0xe805('0x32')];}_0x2b7813[_0xe805('0x24')](_0x13c10c)['send'](_0x28c5c2);};}exports[_0xe805('0x33')]=function(_0x31d6d9,_0x4f97a4){var _0x2124cb={},_0x36a8c9={},_0x3723ee={'count':0x0,'rows':[]};var _0x3c88cf=_[_0xe805('0x34')](db[_0xe805('0x35')]['rawAttributes'],function(_0x18d179){return{'name':_0x18d179[_0xe805('0x36')],'type':_0x18d179[_0xe805('0x37')]['key']};});_0x36a8c9[_0xe805('0x38')]=_['map'](_0x3c88cf,_0xe805('0x32'));_0x36a8c9['query']=_[_0xe805('0x39')](_0x31d6d9[_0xe805('0x3a')]);_0x36a8c9[_0xe805('0x3b')]=_[_0xe805('0x3c')](_0x36a8c9['model'],_0x36a8c9[_0xe805('0x3a')]);_0x2124cb[_0xe805('0x3d')]=_[_0xe805('0x3c')](_0x36a8c9[_0xe805('0x38')],qs[_0xe805('0x3e')](_0x31d6d9['query'][_0xe805('0x3e')]));_0x2124cb[_0xe805('0x3d')]=_0x2124cb['attributes']['length']?_0x2124cb[_0xe805('0x3d')]:_0x36a8c9[_0xe805('0x38')];if(!_0x31d6d9[_0xe805('0x3a')][_0xe805('0x3f')](_0xe805('0x40'))){_0x2124cb[_0xe805('0x28')]=qs[_0xe805('0x28')](_0x31d6d9[_0xe805('0x3a')]['limit']);_0x2124cb[_0xe805('0x27')]=qs[_0xe805('0x27')](_0x31d6d9['query']['offset']);}_0x2124cb[_0xe805('0x41')]=qs[_0xe805('0x42')](_0x31d6d9[_0xe805('0x3a')]['sort']);_0x2124cb[_0xe805('0x43')]=qs[_0xe805('0x3b')](_[_0xe805('0x44')](_0x31d6d9['query'],_0x36a8c9[_0xe805('0x3b')]),_0x3c88cf);if(_0x31d6d9[_0xe805('0x3a')][_0xe805('0x45')]){_0x2124cb[_0xe805('0x43')]=_['merge'](_0x2124cb[_0xe805('0x43')],{'$or':_['map'](_0x3c88cf,function(_0x29ff9b){if(_0x29ff9b['type']!==_0xe805('0x46')){var _0x2485a8={};_0x2485a8[_0x29ff9b[_0xe805('0x32')]]={'$like':'%'+_0x31d6d9[_0xe805('0x3a')]['filter']+'%'};return _0x2485a8;}})});}_0x2124cb=_[_0xe805('0x47')]({},_0x2124cb,_0x31d6d9[_0xe805('0x48')]);var _0x18fb66={'where':_0x2124cb[_0xe805('0x43')]};return db[_0xe805('0x35')]['count'](_0x18fb66)[_0xe805('0x19')](function(_0x27baca){_0x3723ee[_0xe805('0x49')]=_0x27baca;if(_0x31d6d9[_0xe805('0x3a')][_0xe805('0x4a')]){_0x2124cb['include']=[{'all':!![]}];}return db['VoiceContext'][_0xe805('0x4b')](_0x2124cb);})[_0xe805('0x19')](function(_0x57f51d){_0x3723ee[_0xe805('0x4c')]=_0x57f51d;return _0x3723ee;})[_0xe805('0x19')](respondWithFilteredResult(_0x4f97a4,_0x2124cb))[_0xe805('0x4d')](handleError(_0x4f97a4,null));};exports[_0xe805('0x4e')]=function(_0x5ea5b9,_0x895c8b){var _0x46bce1={'raw':![],'where':{'id':_0x5ea5b9[_0xe805('0x4f')]['id']}},_0x37daf2={};_0x37daf2[_0xe805('0x38')]=_[_0xe805('0x39')](db[_0xe805('0x35')][_0xe805('0x50')]);_0x37daf2[_0xe805('0x3a')]=_[_0xe805('0x39')](_0x5ea5b9[_0xe805('0x3a')]);_0x37daf2[_0xe805('0x3b')]=_[_0xe805('0x3c')](_0x37daf2[_0xe805('0x38')],_0x37daf2[_0xe805('0x3a')]);_0x46bce1['attributes']=_[_0xe805('0x3c')](_0x37daf2[_0xe805('0x38')],qs['fields'](_0x5ea5b9[_0xe805('0x3a')][_0xe805('0x3e')]));_0x46bce1[_0xe805('0x3d')]=_0x46bce1[_0xe805('0x3d')][_0xe805('0x51')]?_0x46bce1[_0xe805('0x3d')]:_0x37daf2[_0xe805('0x38')];if(_0x5ea5b9[_0xe805('0x3a')][_0xe805('0x4a')]){_0x46bce1['include']=[{'all':!![]}];}_0x46bce1=_[_0xe805('0x47')]({},_0x46bce1,_0x5ea5b9[_0xe805('0x48')]);return db[_0xe805('0x35')][_0xe805('0x52')](_0x46bce1)[_0xe805('0x19')](handleEntityNotFound(_0x895c8b,null))['then'](respondWithResult(_0x895c8b,null))[_0xe805('0x4d')](handleError(_0x895c8b,null));};exports['create']=function(_0x431258,_0x33bfb0,_0x76ccb7){var _0x40c484;return db[_0xe805('0x35')]['create'](_0x431258[_0xe805('0x53')],{'raw':!![]})['then'](function(_0x263d53){_0x40c484=_0x263d53;return db[_0xe805('0x35')]['findAll']({'raw':!![]});})['then'](function(_0x49e9af){var _0x2f59f6=fs[_0xe805('0x54')](path[_0xe805('0x55')](config[_0xe805('0x56')],_0xe805('0x57')),_0xe805('0x58'));var _0x2b580d=ejs[_0xe805('0x59')](_0x2f59f6,{'contexts':_0x49e9af||[]});fs['writeFileSync'](_0xe805('0x5a'),_0x2b580d);})['then'](function(){return respondWithRpcPromise(_0xe805('0x5b'),_0xe805('0x5c'),{'module':_0xe805('0x5d')});})[_0xe805('0x19')](function(){var _0x2144c8=_0x431258[_0xe805('0x5e')][_0xe805('0x2e')]({'plain':!![]});if(!_0x2144c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2144c8['role']==='user'){var _0x447f3e=_0x40c484[_0xe805('0x2e')]({'plain':!![]});return db['UserProfileSection'][_0xe805('0x52')]({'where':{'name':_0xe805('0x2f'),'userProfileId':_0x2144c8[_0xe805('0x5f')]},'raw':!![]})['then'](function(_0x36757e){if(_0x36757e&&_0x36757e[_0xe805('0x60')]===0x0){return db[_0xe805('0x30')]['create']({'name':_0x447f3e[_0xe805('0x32')],'resourceId':_0x447f3e['id'],'type':_0x36757e[_0xe805('0x32')],'sectionId':_0x36757e['id']},{})['then'](function(){return _0x40c484;});}else{return _0x40c484;}})[_0xe805('0x4d')](function(_0x3953a4){logger[_0xe805('0x1e')](_0xe805('0x61'),_0x3953a4);throw _0x3953a4;});}return _0x40c484;})['then'](respondWithResult(_0x33bfb0,0xc9))[_0xe805('0x4d')](handleError(_0x33bfb0,null));};exports[_0xe805('0x2c')]=function(_0x29ccd1,_0x4887fc,_0x3a09f3){var _0x2549a6;return db[_0xe805('0x35')][_0xe805('0x52')]({'where':{'id':_0x29ccd1['params']['id']}})['then'](handleEntityNotFound(_0x4887fc,null))['then'](saveUpdates(_0x29ccd1[_0xe805('0x53')],null))['then'](function(_0x4214cb){if(_0x4214cb){_0x2549a6=_0x4214cb;return db[_0xe805('0x35')][_0xe805('0x4b')]({'raw':!![]});}})[_0xe805('0x19')](function(_0x9432a9){var _0xaa5bec=fs[_0xe805('0x54')](path[_0xe805('0x55')](config['root'],_0xe805('0x57')),_0xe805('0x58'));var _0xd6889e=ejs[_0xe805('0x59')](_0xaa5bec,{'contexts':_0x9432a9||[]});fs[_0xe805('0x62')](_0xe805('0x5a'),_0xd6889e);})[_0xe805('0x19')](function(){return respondWithRpcPromise(_0xe805('0x5b'),_0xe805('0x2c'),{'module':_0xe805('0x5d')});})[_0xe805('0x19')](function(){return _0x2549a6;})[_0xe805('0x19')](respondWithResult(_0x4887fc,null))[_0xe805('0x4d')](handleError(_0x4887fc,null));};exports[_0xe805('0x2d')]=function(_0x25266d,_0x467c0a,_0x5435e5){var _0x1aeb5d;return db[_0xe805('0x35')][_0xe805('0x52')]({'where':{'id':_0x25266d[_0xe805('0x4f')]['id']}})[_0xe805('0x19')](handleEntityNotFound(_0x467c0a,null))[_0xe805('0x19')](removeEntity(_0x467c0a,null))[_0xe805('0x19')](function(){return db[_0xe805('0x35')][_0xe805('0x4b')]({'raw':!![]});})[_0xe805('0x19')](function(_0xe9278d){var _0x13ac8c=fs[_0xe805('0x54')](path['join'](config[_0xe805('0x56')],'server/files/templates/context.ejs'),'utf8');var _0x17d6c3=ejs[_0xe805('0x59')](_0x13ac8c,{'contexts':_0xe9278d});fs[_0xe805('0x62')](_0xe805('0x5a'),_0x17d6c3);return respondWithRpcPromise(_0xe805('0x5b'),_0xe805('0x2d'),{'module':_0xe805('0x5d')});})[_0xe805('0x4d')](handleError(_0x467c0a,null));}; \ No newline at end of file +var _0x4eae=['/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','body','readFileSync','join','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','destroy','Contexts','end','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','create','root','server/files/templates/context.ejs','utf8','render','writeFileSync'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x4eae,0x7c));var _0xe4ea=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x4eae[_0x1d87fc];return _0x492b56;};'use strict';var emlformat=require(_0xe4ea('0x0'));var rimraf=require(_0xe4ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4ea('0x2'));var rp=require('request-promise');var moment=require(_0xe4ea('0x3'));var BPromise=require(_0xe4ea('0x4'));var Mustache=require(_0xe4ea('0x5'));var util=require(_0xe4ea('0x6'));var path=require('path');var sox=require(_0xe4ea('0x7'));var csv=require(_0xe4ea('0x8'));var ejs=require(_0xe4ea('0x9'));var fs=require('fs');var fs_extra=require(_0xe4ea('0xa'));var _=require(_0xe4ea('0xb'));var squel=require(_0xe4ea('0xc'));var crypto=require('crypto');var jsforce=require(_0xe4ea('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe4ea('0xe'));var Papa=require(_0xe4ea('0xf'));var Redis=require(_0xe4ea('0x10'));var authService=require(_0xe4ea('0x11'));var qs=require(_0xe4ea('0x12'));var as=require(_0xe4ea('0x13'));var hardwareService=require(_0xe4ea('0x14'));var logger=require(_0xe4ea('0x15'))(_0xe4ea('0x16'));var utils=require(_0xe4ea('0x17'));var config=require(_0xe4ea('0x18'));var licenseUtil=require(_0xe4ea('0x19'));var db=require(_0xe4ea('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe4ea('0x1b')][_0xe4ea('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x504cdb,_0x1b5ceb,_0xa19c6f,_0x16381f){return new BPromise(function(_0x1692d8,_0x1fb573){var _0x33a15c=_0x16381f||client;return _0x33a15c[_0xe4ea('0x1d')](_0x504cdb,_0xa19c6f)[_0xe4ea('0x1e')](function(_0x525f73){logger[_0xe4ea('0x1f')](_0xe4ea('0x20'),_0x1b5ceb,_0xe4ea('0x21'));logger['debug'](_0xe4ea('0x22'),_0x1b5ceb,_0xe4ea('0x21'),JSON[_0xe4ea('0x23')](_0x525f73));if(_0x525f73[_0xe4ea('0x24')]){if(_0x525f73[_0xe4ea('0x24')][_0xe4ea('0x25')]===0x1f4){logger[_0xe4ea('0x24')](_0xe4ea('0x20'),_0x1b5ceb,_0x525f73[_0xe4ea('0x24')][_0xe4ea('0x26')]);return _0x1fb573(_0x525f73[_0xe4ea('0x24')][_0xe4ea('0x26')]);}logger[_0xe4ea('0x24')](_0xe4ea('0x20'),_0x1b5ceb,_0x525f73[_0xe4ea('0x24')]['message']);return _0x1692d8(_0x525f73['error']['message']);}else{logger[_0xe4ea('0x1f')](_0xe4ea('0x20'),_0x1b5ceb,'request\x20sent');_0x1692d8(_0x525f73[_0xe4ea('0x27')][_0xe4ea('0x26')]);}})[_0xe4ea('0x28')](function(_0x268e5b){logger[_0xe4ea('0x24')](_0xe4ea('0x20'),_0x1b5ceb,_0x268e5b);_0x1fb573(_0x268e5b);});});}function respondWithStatusCode(_0x4d7b3b,_0x468977){_0x468977=_0x468977||0xcc;return function(_0x51c316){if(_0x51c316){return _0x4d7b3b[_0xe4ea('0x29')](_0x468977);}return _0x4d7b3b['status'](_0x468977)['end']();};}function respondWithResult(_0xa98bc5,_0x507e14){_0x507e14=_0x507e14||0xc8;return function(_0x5e9f2f){if(_0x5e9f2f){return _0xa98bc5['status'](_0x507e14)['json'](_0x5e9f2f);}};}function respondWithFilteredResult(_0x509f05,_0x2e7448){return function(_0x5acefd){if(_0x5acefd){var _0x5a9e84=typeof _0x2e7448[_0xe4ea('0x2a')]===_0xe4ea('0x2b')&&typeof _0x2e7448['limit']==='undefined';var _0x5c03dc=_0x5acefd[_0xe4ea('0x2c')];var _0x159cff=_0x5a9e84?0x0:_0x2e7448[_0xe4ea('0x2a')];var _0x27f51d=_0x5a9e84?_0x5acefd[_0xe4ea('0x2c')]:_0x2e7448[_0xe4ea('0x2a')]+_0x2e7448[_0xe4ea('0x2d')];var _0x58a863;if(_0x27f51d>=_0x5c03dc){_0x27f51d=_0x5c03dc;_0x58a863=0xc8;}else{_0x58a863=0xce;}_0x509f05[_0xe4ea('0x2e')](_0x58a863);return _0x509f05['set'](_0xe4ea('0x2f'),_0x159cff+'-'+_0x27f51d+'/'+_0x5c03dc)['json'](_0x5acefd);}return null;};}function patchUpdates(_0x1f8cc2){return function(_0x50e145){try{jsonpatch[_0xe4ea('0x30')](_0x50e145,_0x1f8cc2,!![]);}catch(_0x2dad4e){return BPromise[_0xe4ea('0x31')](_0x2dad4e);}return _0x50e145[_0xe4ea('0x32')]();};}function saveUpdates(_0x55bd6a,_0x26eeda){return function(_0x342d9d){if(_0x342d9d){return _0x342d9d[_0xe4ea('0x33')](_0x55bd6a)[_0xe4ea('0x1e')](function(_0x5cc5b0){return _0x5cc5b0;});}return null;};}function removeEntity(_0x47c4a2,_0x52ef95){return function(_0x5bc8aa){if(_0x5bc8aa){return _0x5bc8aa[_0xe4ea('0x34')]()[_0xe4ea('0x1e')](function(){var _0x3ad671=_0x5bc8aa['get']({'plain':!![]});var _0x4d68cd=_0xe4ea('0x35');return db['UserProfileResource'][_0xe4ea('0x34')]({'where':{'type':_0x4d68cd,'resourceId':_0x3ad671['id']}})[_0xe4ea('0x1e')](function(){return _0x5bc8aa;});})[_0xe4ea('0x1e')](function(){_0x47c4a2[_0xe4ea('0x2e')](0xcc)[_0xe4ea('0x36')]();});}};}function handleEntityNotFound(_0x15ba9f,_0x3749b7){return function(_0x428f6f){if(!_0x428f6f){_0x15ba9f[_0xe4ea('0x29')](0x194);}return _0x428f6f;};}function handleError(_0x8c230a,_0xf0e34f){_0xf0e34f=_0xf0e34f||0x1f4;return function(_0x662c14){logger[_0xe4ea('0x24')](_0x662c14['stack']);if(_0x662c14[_0xe4ea('0x37')]){delete _0x662c14[_0xe4ea('0x37')];}_0x8c230a[_0xe4ea('0x2e')](_0xf0e34f)[_0xe4ea('0x38')](_0x662c14);};}exports[_0xe4ea('0x39')]=function(_0x216187,_0x3a351f){var _0xbd580={},_0x40ae2c={},_0x1e537c={'count':0x0,'rows':[]};var _0x43ef80=_['map'](db[_0xe4ea('0x3a')][_0xe4ea('0x3b')],function(_0x16bb70){return{'name':_0x16bb70[_0xe4ea('0x3c')],'type':_0x16bb70[_0xe4ea('0x3d')][_0xe4ea('0x3e')]};});_0x40ae2c[_0xe4ea('0x3f')]=_[_0xe4ea('0x40')](_0x43ef80,_0xe4ea('0x37'));_0x40ae2c['query']=_[_0xe4ea('0x41')](_0x216187['query']);_0x40ae2c['filters']=_[_0xe4ea('0x42')](_0x40ae2c[_0xe4ea('0x3f')],_0x40ae2c[_0xe4ea('0x43')]);_0xbd580[_0xe4ea('0x44')]=_[_0xe4ea('0x42')](_0x40ae2c[_0xe4ea('0x3f')],qs[_0xe4ea('0x45')](_0x216187[_0xe4ea('0x43')][_0xe4ea('0x45')]));_0xbd580[_0xe4ea('0x44')]=_0xbd580['attributes'][_0xe4ea('0x46')]?_0xbd580[_0xe4ea('0x44')]:_0x40ae2c[_0xe4ea('0x3f')];if(!_0x216187['query'][_0xe4ea('0x47')](_0xe4ea('0x48'))){_0xbd580[_0xe4ea('0x2d')]=qs[_0xe4ea('0x2d')](_0x216187[_0xe4ea('0x43')][_0xe4ea('0x2d')]);_0xbd580[_0xe4ea('0x2a')]=qs[_0xe4ea('0x2a')](_0x216187['query'][_0xe4ea('0x2a')]);}_0xbd580[_0xe4ea('0x49')]=qs[_0xe4ea('0x4a')](_0x216187['query'][_0xe4ea('0x4a')]);_0xbd580['where']=qs[_0xe4ea('0x4b')](_[_0xe4ea('0x4c')](_0x216187[_0xe4ea('0x43')],_0x40ae2c[_0xe4ea('0x4b')]),_0x43ef80);if(_0x216187[_0xe4ea('0x43')][_0xe4ea('0x4d')]){_0xbd580[_0xe4ea('0x4e')]=_[_0xe4ea('0x4f')](_0xbd580[_0xe4ea('0x4e')],{'$or':_['map'](_0x43ef80,function(_0x49f908){if(_0x49f908[_0xe4ea('0x3d')]!=='VIRTUAL'){var _0x400acb={};_0x400acb[_0x49f908[_0xe4ea('0x37')]]={'$like':'%'+_0x216187[_0xe4ea('0x43')][_0xe4ea('0x4d')]+'%'};return _0x400acb;}})});}_0xbd580=_[_0xe4ea('0x4f')]({},_0xbd580,_0x216187[_0xe4ea('0x50')]);var _0x304ed8={'where':_0xbd580[_0xe4ea('0x4e')]};return db['VoiceContext']['count'](_0x304ed8)[_0xe4ea('0x1e')](function(_0x2e5ab3){_0x1e537c[_0xe4ea('0x2c')]=_0x2e5ab3;if(_0x216187[_0xe4ea('0x43')][_0xe4ea('0x51')]){_0xbd580[_0xe4ea('0x52')]=[{'all':!![]}];}return db['VoiceContext'][_0xe4ea('0x53')](_0xbd580);})[_0xe4ea('0x1e')](function(_0x552c8c){_0x1e537c[_0xe4ea('0x54')]=_0x552c8c;return _0x1e537c;})[_0xe4ea('0x1e')](respondWithFilteredResult(_0x3a351f,_0xbd580))[_0xe4ea('0x28')](handleError(_0x3a351f,null));};exports[_0xe4ea('0x55')]=function(_0x367695,_0x49a6df){var _0x4a0fcf={'raw':![],'where':{'id':_0x367695['params']['id']}},_0x221e6f={};_0x221e6f[_0xe4ea('0x3f')]=_[_0xe4ea('0x41')](db['VoiceContext'][_0xe4ea('0x3b')]);_0x221e6f[_0xe4ea('0x43')]=_[_0xe4ea('0x41')](_0x367695[_0xe4ea('0x43')]);_0x221e6f[_0xe4ea('0x4b')]=_['intersection'](_0x221e6f[_0xe4ea('0x3f')],_0x221e6f[_0xe4ea('0x43')]);_0x4a0fcf['attributes']=_[_0xe4ea('0x42')](_0x221e6f['model'],qs[_0xe4ea('0x45')](_0x367695[_0xe4ea('0x43')][_0xe4ea('0x45')]));_0x4a0fcf[_0xe4ea('0x44')]=_0x4a0fcf[_0xe4ea('0x44')][_0xe4ea('0x46')]?_0x4a0fcf[_0xe4ea('0x44')]:_0x221e6f[_0xe4ea('0x3f')];if(_0x367695['query'][_0xe4ea('0x51')]){_0x4a0fcf[_0xe4ea('0x52')]=[{'all':!![]}];}_0x4a0fcf=_[_0xe4ea('0x4f')]({},_0x4a0fcf,_0x367695[_0xe4ea('0x50')]);return db['VoiceContext']['find'](_0x4a0fcf)[_0xe4ea('0x1e')](handleEntityNotFound(_0x49a6df,null))[_0xe4ea('0x1e')](respondWithResult(_0x49a6df,null))[_0xe4ea('0x28')](handleError(_0x49a6df,null));};exports[_0xe4ea('0x56')]=function(_0x44a8a8,_0x11b34f,_0x150c05){var _0x46b566;return db[_0xe4ea('0x3a')][_0xe4ea('0x56')](_0x44a8a8['body'],{'raw':!![]})[_0xe4ea('0x1e')](function(_0x3ba9a9){_0x46b566=_0x3ba9a9;return db[_0xe4ea('0x3a')][_0xe4ea('0x53')]({'raw':!![]});})[_0xe4ea('0x1e')](function(_0x277904){var _0x411748=fs['readFileSync'](path['join'](config[_0xe4ea('0x57')],_0xe4ea('0x58')),_0xe4ea('0x59'));var _0x3ab277=ejs[_0xe4ea('0x5a')](_0x411748,{'contexts':_0x277904||[]});fs[_0xe4ea('0x5b')](_0xe4ea('0x5c'),_0x3ab277);})[_0xe4ea('0x1e')](function(){return respondWithRpcPromise(_0xe4ea('0x5d'),'create',{'module':_0xe4ea('0x5e')});})[_0xe4ea('0x1e')](function(){var _0x28492c=_0x44a8a8[_0xe4ea('0x5f')][_0xe4ea('0x60')]({'plain':!![]});if(!_0x28492c)throw new Error(_0xe4ea('0x61'));if(_0x28492c[_0xe4ea('0x62')]==='user'){var _0x282540=_0x46b566['get']({'plain':!![]});return db[_0xe4ea('0x63')][_0xe4ea('0x64')]({'where':{'name':_0xe4ea('0x35'),'userProfileId':_0x28492c[_0xe4ea('0x65')]},'raw':!![]})[_0xe4ea('0x1e')](function(_0x4f5565){if(_0x4f5565&&_0x4f5565[_0xe4ea('0x66')]===0x0){return db[_0xe4ea('0x67')][_0xe4ea('0x56')]({'name':_0x282540[_0xe4ea('0x37')],'resourceId':_0x282540['id'],'type':_0x4f5565['name'],'sectionId':_0x4f5565['id']},{})['then'](function(){return _0x46b566;});}else{return _0x46b566;}})[_0xe4ea('0x28')](function(_0x4fd91c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fd91c);throw _0x4fd91c;});}return _0x46b566;})['then'](respondWithResult(_0x11b34f,0xc9))[_0xe4ea('0x28')](handleError(_0x11b34f,null));};exports['update']=function(_0x3d847e,_0x4a95f3,_0x92556f){var _0x2385f3;return db[_0xe4ea('0x3a')][_0xe4ea('0x64')]({'where':{'id':_0x3d847e[_0xe4ea('0x68')]['id']}})[_0xe4ea('0x1e')](handleEntityNotFound(_0x4a95f3,null))[_0xe4ea('0x1e')](saveUpdates(_0x3d847e[_0xe4ea('0x69')],null))[_0xe4ea('0x1e')](function(_0x320e87){if(_0x320e87){_0x2385f3=_0x320e87;return db['VoiceContext'][_0xe4ea('0x53')]({'raw':!![]});}})[_0xe4ea('0x1e')](function(_0x313023){var _0x3f9683=fs[_0xe4ea('0x6a')](path[_0xe4ea('0x6b')](config['root'],'server/files/templates/context.ejs'),_0xe4ea('0x59'));var _0x4b43a3=ejs['render'](_0x3f9683,{'contexts':_0x313023||[]});fs[_0xe4ea('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4b43a3);})['then'](function(){return respondWithRpcPromise(_0xe4ea('0x5d'),_0xe4ea('0x33'),{'module':'chan_sip.so'});})[_0xe4ea('0x1e')](function(){return _0x2385f3;})['then'](respondWithResult(_0x4a95f3,null))['catch'](handleError(_0x4a95f3,null));};exports[_0xe4ea('0x34')]=function(_0x21b3a9,_0x445676,_0x146dbb){var _0x1d1ca6;return db['VoiceContext'][_0xe4ea('0x64')]({'where':{'id':_0x21b3a9[_0xe4ea('0x68')]['id']}})[_0xe4ea('0x1e')](handleEntityNotFound(_0x445676,null))[_0xe4ea('0x1e')](removeEntity(_0x445676,null))[_0xe4ea('0x1e')](function(){return db[_0xe4ea('0x3a')]['findAll']({'raw':!![]});})[_0xe4ea('0x1e')](function(_0x219729){var _0x3f38e3=fs[_0xe4ea('0x6a')](path[_0xe4ea('0x6b')](config[_0xe4ea('0x57')],_0xe4ea('0x58')),'utf8');var _0x568776=ejs[_0xe4ea('0x5a')](_0x3f38e3,{'contexts':_0x219729});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x568776);return respondWithRpcPromise(_0xe4ea('0x5d'),_0xe4ea('0x34'),{'module':_0xe4ea('0x5e')});})[_0xe4ea('0x28')](handleError(_0x445676,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index d5781d9..40323ee 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 _0xc87f=['moment','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','api'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xc87f,0x169));var _0xfc87=function(_0x5ece3e,_0x5a6e21){_0x5ece3e=_0x5ece3e-0x0;var _0x3fbbd6=_0xc87f[_0x5ece3e];return _0x3fbbd6;};'use strict';var _=require(_0xfc87('0x0'));var util=require(_0xfc87('0x1'));var logger=require('../../config/logger')(_0xfc87('0x2'));var moment=require(_0xfc87('0x3'));var BPromise=require(_0xfc87('0x4'));var rp=require(_0xfc87('0x5'));var fs=require('fs');var path=require(_0xfc87('0x6'));var rimraf=require('rimraf');var config=require(_0xfc87('0x7'));var attributes=require(_0xfc87('0x8'));module[_0xfc87('0x9')]=function(_0x2b1a50,_0x2c37ea){return _0x2b1a50[_0xfc87('0xa')](_0xfc87('0xb'),attributes,{'tableName':_0xfc87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab38=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','VoiceContext','lodash'];(function(_0x2e5485,_0x542da1){var _0x44b7fc=function(_0x4701a4){while(--_0x4701a4){_0x2e5485['push'](_0x2e5485['shift']());}};_0x44b7fc(++_0x542da1);}(_0xab38,0x137));var _0x8ab3=function(_0x4d23dc,_0x30def6){_0x4d23dc=_0x4d23dc-0x0;var _0x1ffc30=_0xab38[_0x4d23dc];return _0x1ffc30;};'use strict';var _=require(_0x8ab3('0x0'));var util=require(_0x8ab3('0x1'));var logger=require(_0x8ab3('0x2'))(_0x8ab3('0x3'));var moment=require(_0x8ab3('0x4'));var BPromise=require(_0x8ab3('0x5'));var rp=require(_0x8ab3('0x6'));var fs=require('fs');var path=require(_0x8ab3('0x7'));var rimraf=require(_0x8ab3('0x8'));var config=require('../../config/environment');var attributes=require(_0x8ab3('0x9'));module[_0x8ab3('0xa')]=function(_0x2e4d99,_0x5037c3){return _0x2e4d99[_0x8ab3('0xb')](_0x8ab3('0xc'),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 9ee5c6e..274f68e 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 _0x6da1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0x6da1,0x1b8));var _0x16da=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x6da1[_0x1db481];return _0x3db95b;};'use strict';var _=require('lodash');var util=require(_0x16da('0x0'));var moment=require('moment');var BPromise=require(_0x16da('0x1'));var rs=require(_0x16da('0x2'));var fs=require('fs');var Redis=require(_0x16da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x16da('0x4'));var logger=require(_0x16da('0x5'))('rpc');var config=require(_0x16da('0x6'));var jayson=require(_0x16da('0x7'));var client=jayson[_0x16da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa4b0,_0x414b10,_0x9ced5c){return new BPromise(function(_0x12df0e,_0x4410d0){return client['request'](_0x4aa4b0,_0x9ced5c)[_0x16da('0x9')](function(_0x495f89){logger[_0x16da('0xa')](_0x16da('0xb'),_0x414b10,_0x16da('0xc'));logger[_0x16da('0xd')](_0x16da('0xe'),_0x414b10,_0x16da('0xc'),JSON[_0x16da('0xf')](_0x495f89));if(_0x495f89[_0x16da('0x10')]){if(_0x495f89[_0x16da('0x10')][_0x16da('0x11')]===0x1f4){logger[_0x16da('0x10')]('VoiceContext,\x20%s,\x20%s',_0x414b10,_0x495f89['error']['message']);return _0x4410d0(_0x495f89[_0x16da('0x10')][_0x16da('0x12')]);}logger[_0x16da('0x10')]('VoiceContext,\x20%s,\x20%s',_0x414b10,_0x495f89[_0x16da('0x10')][_0x16da('0x12')]);return _0x12df0e(_0x495f89[_0x16da('0x10')]['message']);}else{logger[_0x16da('0xa')](_0x16da('0xb'),_0x414b10,_0x16da('0xc'));_0x12df0e(_0x495f89[_0x16da('0x13')]['message']);}})[_0x16da('0x14')](function(_0x30e761){logger[_0x16da('0x10')](_0x16da('0xb'),_0x414b10,_0x30e761);_0x4410d0(_0x30e761);});});} \ No newline at end of file +var _0x82ee=['stringify','error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x26aef2,_0x223f75){var _0x38ede2=function(_0x37f2ab){while(--_0x37f2ab){_0x26aef2['push'](_0x26aef2['shift']());}};_0x38ede2(++_0x223f75);}(_0x82ee,0xeb));var _0xe82e=function(_0x4f51dd,_0x56b445){_0x4f51dd=_0x4f51dd-0x0;var _0x2ad03c=_0x82ee[_0x4f51dd];return _0x2ad03c;};'use strict';var _=require('lodash');var util=require(_0xe82e('0x0'));var moment=require(_0xe82e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe82e('0x2'));var fs=require('fs');var Redis=require(_0xe82e('0x3'));var db=require(_0xe82e('0x4'))['db'];var utils=require(_0xe82e('0x5'));var logger=require(_0xe82e('0x6'))(_0xe82e('0x7'));var config=require(_0xe82e('0x8'));var jayson=require(_0xe82e('0x9'));var client=jayson[_0xe82e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5b08,_0x46b63b,_0x161f8f){return new BPromise(function(_0x48a15f,_0xf36c06){return client[_0xe82e('0xb')](_0x1e5b08,_0x161f8f)[_0xe82e('0xc')](function(_0x5163e4){logger[_0xe82e('0xd')](_0xe82e('0xe'),_0x46b63b,_0xe82e('0xf'));logger['debug'](_0xe82e('0x10'),_0x46b63b,'request\x20sent',JSON[_0xe82e('0x11')](_0x5163e4));if(_0x5163e4['error']){if(_0x5163e4[_0xe82e('0x12')]['code']===0x1f4){logger[_0xe82e('0x12')](_0xe82e('0xe'),_0x46b63b,_0x5163e4[_0xe82e('0x12')]['message']);return _0xf36c06(_0x5163e4[_0xe82e('0x12')][_0xe82e('0x13')]);}logger[_0xe82e('0x12')](_0xe82e('0xe'),_0x46b63b,_0x5163e4[_0xe82e('0x12')][_0xe82e('0x13')]);return _0x48a15f(_0x5163e4[_0xe82e('0x12')][_0xe82e('0x13')]);}else{logger[_0xe82e('0xd')]('VoiceContext,\x20%s,\x20%s',_0x46b63b,_0xe82e('0xf'));_0x48a15f(_0x5163e4['result'][_0xe82e('0x13')]);}})[_0xe82e('0x14')](function(_0x367e73){logger['error']('VoiceContext,\x20%s,\x20%s',_0x46b63b,_0x367e73);_0xf36c06(_0x367e73);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 75baf4e..c9c1fda 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 _0x92e7=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x506774,_0x18525b){var _0x1aabdf=function(_0x2f973c){while(--_0x2f973c){_0x506774['push'](_0x506774['shift']());}};_0x1aabdf(++_0x18525b);}(_0x92e7,0x1ab));var _0x792e=function(_0xebe12b,_0x16894b){_0xebe12b=_0xebe12b-0x0;var _0x24ff97=_0x92e7[_0xebe12b];return _0x24ff97;};'use strict';var multer=require(_0x792e('0x0'));var util=require('util');var path=require(_0x792e('0x1'));var timeout=require(_0x792e('0x2'));var express=require(_0x792e('0x3'));var router=express[_0x792e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x792e('0x5'));var config=require('../../config/environment');var controller=require(_0x792e('0x6'));router[_0x792e('0x7')]('/',auth['isAuthenticated'](),controller[_0x792e('0x8')]);router['get'](_0x792e('0x9'),auth[_0x792e('0xa')](),controller[_0x792e('0xb')]);router[_0x792e('0x7')](_0x792e('0xc'),auth[_0x792e('0xa')](),controller['show']);router[_0x792e('0xd')]('/',auth[_0x792e('0xa')](),controller[_0x792e('0xe')]);router[_0x792e('0xf')](_0x792e('0xc'),auth[_0x792e('0xa')](),controller[_0x792e('0x10')]);router[_0x792e('0x11')](_0x792e('0xc'),auth[_0x792e('0xa')](),controller[_0x792e('0x12')]);module[_0x792e('0x13')]=router; \ No newline at end of file +var _0xb6f6=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','/describe','describe','/:id','show','isAuthenticated','create','update','destroy','multer','util'];(function(_0x1bf216,_0x3bbd0c){var _0x2b2e35=function(_0x4e8201){while(--_0x4e8201){_0x1bf216['push'](_0x1bf216['shift']());}};_0x2b2e35(++_0x3bbd0c);}(_0xb6f6,0x18e));var _0x6b6f=function(_0x2cd1b9,_0x52f45e){_0x2cd1b9=_0x2cd1b9-0x0;var _0x212f36=_0xb6f6[_0x2cd1b9];return _0x212f36;};'use strict';var multer=require(_0x6b6f('0x0'));var util=require(_0x6b6f('0x1'));var path=require(_0x6b6f('0x2'));var timeout=require(_0x6b6f('0x3'));var express=require('express');var router=express[_0x6b6f('0x4')]();var fs_extra=require(_0x6b6f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6b6f('0x6'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x6b6f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6b6f('0x7')](_0x6b6f('0x8'),auth['isAuthenticated'](),controller[_0x6b6f('0x9')]);router[_0x6b6f('0x7')](_0x6b6f('0xa'),auth['isAuthenticated'](),controller[_0x6b6f('0xb')]);router['post']('/',auth[_0x6b6f('0xc')](),controller[_0x6b6f('0xd')]);router['put'](_0x6b6f('0xa'),auth[_0x6b6f('0xc')](),controller[_0x6b6f('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6b6f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index e9f4cb0..dac8a43 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 _0xbec5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x4f547f,_0xba26d5){var _0x5e17a2=function(_0xe96400){while(--_0xe96400){_0x4f547f['push'](_0x4f547f['shift']());}};_0x5e17a2(++_0xba26d5);}(_0xbec5,0xe5));var _0x5bec=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0xbec5[_0x187718];return _0x29ddf4;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5bec('0x2')]},'channelstate':{'type':Sequelize[_0x5bec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'calleridnum':{'type':Sequelize[_0x5bec('0x2')]},'calleridname':{'type':Sequelize[_0x5bec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5bec('0x2')]},'language':{'type':Sequelize[_0x5bec('0x2')]},'accountcode':{'type':Sequelize[_0x5bec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5bec('0x2')]},'priority':{'type':Sequelize[_0x5bec('0x3')]},'uniqueid':{'type':Sequelize[_0x5bec('0x2')]},'linkedid':{'type':Sequelize[_0x5bec('0x2')]},'destchannel':{'type':Sequelize[_0x5bec('0x2')]},'destchannelstate':{'type':Sequelize[_0x5bec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5bec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5bec('0x2')]},'destaccountcode':{'type':Sequelize[_0x5bec('0x2')]},'destcontext':{'type':Sequelize[_0x5bec('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5bec('0x3')]},'destuniqueid':{'type':Sequelize[_0x5bec('0x2')]},'destlinkedid':{'type':Sequelize[_0x5bec('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5bec('0x2')]},'starttime':{'type':Sequelize[_0x5bec('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5bec('0x4')]},'lastevent':{'type':Sequelize[_0x5bec('0x2')],'comment':_0x5bec('0x5')},'routeId':{'type':Sequelize[_0x5bec('0x3')]},'duration':{'type':Sequelize[_0x5bec('0x3')]},'holdtime':{'type':Sequelize[_0x5bec('0x3')]},'billableseconds':{'type':Sequelize[_0x5bec('0x3')]}}; \ No newline at end of file +var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x16d53b,_0x259b9e){var _0x3347b6=function(_0x203033){while(--_0x203033){_0x16d53b['push'](_0x16d53b['shift']());}};_0x3347b6(++_0x259b9e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x00bb[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'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 31f1222..23c9f3d 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 _0xc533=['limit','status','set','Content-Range','reject','update','then','error','name','send','index','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc533,0x108));var _0x3c53=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xc533[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x3c53('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c53('0x1'));var rp=require(_0x3c53('0x2'));var moment=require(_0x3c53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c53('0x4'));var util=require(_0x3c53('0x5'));var path=require('path');var sox=require(_0x3c53('0x6'));var csv=require(_0x3c53('0x7'));var ejs=require(_0x3c53('0x8'));var fs=require('fs');var fs_extra=require(_0x3c53('0x9'));var _=require('lodash');var squel=require(_0x3c53('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c53('0xb'));var toCsv=require(_0x3c53('0x7'));var querystring=require(_0x3c53('0xc'));var Papa=require('papaparse');var Redis=require(_0x3c53('0xd'));var authService=require(_0x3c53('0xe'));var qs=require(_0x3c53('0xf'));var as=require(_0x3c53('0x10'));var hardwareService=require(_0x3c53('0x11'));var logger=require('../../config/logger')(_0x3c53('0x12'));var utils=require(_0x3c53('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3c53('0x14'));var db=require(_0x3c53('0x15'))['db'];function respondWithStatusCode(_0xaa1ed8,_0x3bec2f){_0x3bec2f=_0x3bec2f||0xcc;return function(_0x537b0c){if(_0x537b0c){return _0xaa1ed8[_0x3c53('0x16')](_0x3bec2f);}return _0xaa1ed8['status'](_0x3bec2f)[_0x3c53('0x17')]();};}function respondWithResult(_0x340f83,_0x535c41){_0x535c41=_0x535c41||0xc8;return function(_0x31cde4){if(_0x31cde4){return _0x340f83['status'](_0x535c41)[_0x3c53('0x18')](_0x31cde4);}};}function respondWithFilteredResult(_0x3a7c68,_0x26b0f0){return function(_0x284066){if(_0x284066){var _0x374ca8=typeof _0x26b0f0['offset']===_0x3c53('0x19')&&typeof _0x26b0f0['limit']==='undefined';var _0x2aef3f=_0x284066[_0x3c53('0x1a')];var _0x4ecb5e=_0x374ca8?0x0:_0x26b0f0[_0x3c53('0x1b')];var _0x4b7148=_0x374ca8?_0x284066[_0x3c53('0x1a')]:_0x26b0f0[_0x3c53('0x1b')]+_0x26b0f0[_0x3c53('0x1c')];var _0x5b443b;if(_0x4b7148>=_0x2aef3f){_0x4b7148=_0x2aef3f;_0x5b443b=0xc8;}else{_0x5b443b=0xce;}_0x3a7c68[_0x3c53('0x1d')](_0x5b443b);return _0x3a7c68[_0x3c53('0x1e')](_0x3c53('0x1f'),_0x4ecb5e+'-'+_0x4b7148+'/'+_0x2aef3f)[_0x3c53('0x18')](_0x284066);}return null;};}function patchUpdates(_0x198093){return function(_0x290e7a){try{jsonpatch['apply'](_0x290e7a,_0x198093,!![]);}catch(_0x2159fe){return BPromise[_0x3c53('0x20')](_0x2159fe);}return _0x290e7a['save']();};}function saveUpdates(_0x53fe2d,_0x384ea5){return function(_0x442e11){if(_0x442e11){return _0x442e11[_0x3c53('0x21')](_0x53fe2d)['then'](function(_0x51c449){return _0x51c449;});}return null;};}function removeEntity(_0xa489d5,_0x599bd2){return function(_0x2e4c94){if(_0x2e4c94){return _0x2e4c94['destroy']()[_0x3c53('0x22')](function(){_0xa489d5[_0x3c53('0x1d')](0xcc)[_0x3c53('0x17')]();});}};}function handleEntityNotFound(_0x309885,_0x2df253){return function(_0x498a77){if(!_0x498a77){_0x309885[_0x3c53('0x16')](0x194);}return _0x498a77;};}function handleError(_0x4c1fff,_0x235776){_0x235776=_0x235776||0x1f4;return function(_0x47769b){logger[_0x3c53('0x23')](_0x47769b['stack']);if(_0x47769b['name']){delete _0x47769b[_0x3c53('0x24')];}_0x4c1fff[_0x3c53('0x1d')](_0x235776)[_0x3c53('0x25')](_0x47769b);};}exports[_0x3c53('0x26')]=function(_0x1c1fb4,_0x25d806){var _0x3d8001={},_0x388678={},_0x5b8660={'count':0x0,'rows':[]};var _0x1ef875=_[_0x3c53('0x27')](db[_0x3c53('0x28')]['rawAttributes'],function(_0xcefc48){return{'name':_0xcefc48[_0x3c53('0x29')],'type':_0xcefc48[_0x3c53('0x2a')][_0x3c53('0x2b')]};});_0x388678[_0x3c53('0x2c')]=_[_0x3c53('0x27')](_0x1ef875,_0x3c53('0x24'));_0x388678[_0x3c53('0x2d')]=_[_0x3c53('0x2e')](_0x1c1fb4[_0x3c53('0x2d')]);_0x388678[_0x3c53('0x2f')]=_[_0x3c53('0x30')](_0x388678[_0x3c53('0x2c')],_0x388678[_0x3c53('0x2d')]);_0x3d8001[_0x3c53('0x31')]=_[_0x3c53('0x30')](_0x388678['model'],qs[_0x3c53('0x32')](_0x1c1fb4['query'][_0x3c53('0x32')]));_0x3d8001[_0x3c53('0x31')]=_0x3d8001['attributes'][_0x3c53('0x33')]?_0x3d8001[_0x3c53('0x31')]:_0x388678[_0x3c53('0x2c')];if(!_0x1c1fb4[_0x3c53('0x2d')][_0x3c53('0x34')](_0x3c53('0x35'))){_0x3d8001[_0x3c53('0x1c')]=qs[_0x3c53('0x1c')](_0x1c1fb4[_0x3c53('0x2d')][_0x3c53('0x1c')]);_0x3d8001[_0x3c53('0x1b')]=qs[_0x3c53('0x1b')](_0x1c1fb4[_0x3c53('0x2d')]['offset']);}_0x3d8001[_0x3c53('0x36')]=qs[_0x3c53('0x37')](_0x1c1fb4[_0x3c53('0x2d')]['sort']);_0x3d8001[_0x3c53('0x38')]=qs[_0x3c53('0x2f')](_[_0x3c53('0x39')](_0x1c1fb4[_0x3c53('0x2d')],_0x388678['filters']),_0x1ef875);if(_0x1c1fb4[_0x3c53('0x2d')][_0x3c53('0x3a')]){_0x3d8001[_0x3c53('0x38')]=_[_0x3c53('0x3b')](_0x3d8001[_0x3c53('0x38')],{'$or':_[_0x3c53('0x27')](_0x1ef875,function(_0x2b4d8a){if(_0x2b4d8a[_0x3c53('0x2a')]!==_0x3c53('0x3c')){var _0x5253f0={};_0x5253f0[_0x2b4d8a[_0x3c53('0x24')]]={'$like':'%'+_0x1c1fb4[_0x3c53('0x2d')][_0x3c53('0x3a')]+'%'};return _0x5253f0;}})});}_0x3d8001=_[_0x3c53('0x3b')]({},_0x3d8001,_0x1c1fb4['options']);var _0x214062={'where':_0x3d8001[_0x3c53('0x38')]};return db['VoiceDialReport']['count'](_0x214062)[_0x3c53('0x22')](function(_0x2f2466){_0x5b8660[_0x3c53('0x1a')]=_0x2f2466;if(_0x1c1fb4[_0x3c53('0x2d')][_0x3c53('0x3d')]){_0x3d8001[_0x3c53('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x3d8001);})['then'](function(_0x116a1e){_0x5b8660[_0x3c53('0x3f')]=_0x116a1e;return _0x5b8660;})[_0x3c53('0x22')](respondWithFilteredResult(_0x25d806,_0x3d8001))[_0x3c53('0x40')](handleError(_0x25d806,null));};exports[_0x3c53('0x41')]=function(_0x5d2976,_0x39a8f3){var _0x29abc5={'raw':!![],'where':{'id':_0x5d2976[_0x3c53('0x42')]['id']}},_0x21f042={};_0x21f042['model']=_[_0x3c53('0x2e')](db[_0x3c53('0x28')][_0x3c53('0x43')]);_0x21f042[_0x3c53('0x2d')]=_['keys'](_0x5d2976['query']);_0x21f042['filters']=_[_0x3c53('0x30')](_0x21f042[_0x3c53('0x2c')],_0x21f042[_0x3c53('0x2d')]);_0x29abc5[_0x3c53('0x31')]=_['intersection'](_0x21f042[_0x3c53('0x2c')],qs[_0x3c53('0x32')](_0x5d2976[_0x3c53('0x2d')]['fields']));_0x29abc5[_0x3c53('0x31')]=_0x29abc5[_0x3c53('0x31')]['length']?_0x29abc5[_0x3c53('0x31')]:_0x21f042[_0x3c53('0x2c')];if(_0x5d2976[_0x3c53('0x2d')]['includeAll']){_0x29abc5['include']=[{'all':!![]}];}_0x29abc5=_[_0x3c53('0x3b')]({},_0x29abc5,_0x5d2976['options']);return db['VoiceDialReport'][_0x3c53('0x44')](_0x29abc5)[_0x3c53('0x22')](handleEntityNotFound(_0x39a8f3,null))[_0x3c53('0x22')](respondWithResult(_0x39a8f3,null))[_0x3c53('0x40')](handleError(_0x39a8f3,null));};exports[_0x3c53('0x45')]=function(_0x289548,_0x1a3c5a){return db[_0x3c53('0x28')]['create'](_0x289548[_0x3c53('0x46')],{})[_0x3c53('0x22')](respondWithResult(_0x1a3c5a,0xc9))[_0x3c53('0x40')](handleError(_0x1a3c5a,null));};exports['update']=function(_0x1a5b9e,_0x4892c3){if(_0x1a5b9e['body']['id']){delete _0x1a5b9e[_0x3c53('0x46')]['id'];}return db[_0x3c53('0x28')]['find']({'where':{'id':_0x1a5b9e[_0x3c53('0x42')]['id']}})[_0x3c53('0x22')](handleEntityNotFound(_0x4892c3,null))[_0x3c53('0x22')](saveUpdates(_0x1a5b9e[_0x3c53('0x46')],null))['then'](respondWithResult(_0x4892c3,null))[_0x3c53('0x40')](handleError(_0x4892c3,null));};exports[_0x3c53('0x47')]=function(_0x5596d0,_0x4f0b16){return db[_0x3c53('0x28')][_0x3c53('0x44')]({'where':{'id':_0x5596d0[_0x3c53('0x42')]['id']}})[_0x3c53('0x22')](handleEntityNotFound(_0x4f0b16,null))[_0x3c53('0x22')](removeEntity(_0x4f0b16,null))['catch'](handleError(_0x4f0b16,null));};exports[_0x3c53('0x48')]=function(_0x574ed8,_0x1169ba){return db[_0x3c53('0x28')][_0x3c53('0x48')]()[_0x3c53('0x22')](respondWithResult(_0x1169ba,null))[_0x3c53('0x40')](handleError(_0x1169ba,null));}; \ No newline at end of file +var _0x37f5=['filters','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','then','destroy','end','error','stack','name','send','map','VoiceDialReport','rawAttributes','type','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys'];(function(_0x4e56b2,_0x3fd41f){var _0x128057=function(_0x38d5a1){while(--_0x38d5a1){_0x4e56b2['push'](_0x4e56b2['shift']());}};_0x128057(++_0x3fd41f);}(_0x37f5,0x9c));var _0x537f=function(_0x1d58a6,_0x2e4b55){_0x1d58a6=_0x1d58a6-0x0;var _0x422a60=_0x37f5[_0x1d58a6];return _0x422a60;};'use strict';var emlformat=require(_0x537f('0x0'));var rimraf=require(_0x537f('0x1'));var zipdir=require(_0x537f('0x2'));var jsonpatch=require(_0x537f('0x3'));var rp=require(_0x537f('0x4'));var moment=require(_0x537f('0x5'));var BPromise=require(_0x537f('0x6'));var Mustache=require(_0x537f('0x7'));var util=require(_0x537f('0x8'));var path=require(_0x537f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x537f('0xa'));var _=require(_0x537f('0xb'));var squel=require('squel');var crypto=require(_0x537f('0xc'));var jsforce=require(_0x537f('0xd'));var deskjs=require(_0x537f('0xe'));var toCsv=require(_0x537f('0xf'));var querystring=require('querystring');var Papa=require(_0x537f('0x10'));var Redis=require(_0x537f('0x11'));var authService=require(_0x537f('0x12'));var qs=require(_0x537f('0x13'));var as=require(_0x537f('0x14'));var hardwareService=require(_0x537f('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x537f('0x16'));var licenseUtil=require(_0x537f('0x17'));var db=require(_0x537f('0x18'))['db'];function respondWithStatusCode(_0x1e9596,_0x6f26af){_0x6f26af=_0x6f26af||0xcc;return function(_0x4704ff){if(_0x4704ff){return _0x1e9596[_0x537f('0x19')](_0x6f26af);}return _0x1e9596[_0x537f('0x1a')](_0x6f26af)['end']();};}function respondWithResult(_0x355466,_0x5b5c6c){_0x5b5c6c=_0x5b5c6c||0xc8;return function(_0x55de50){if(_0x55de50){return _0x355466[_0x537f('0x1a')](_0x5b5c6c)[_0x537f('0x1b')](_0x55de50);}};}function respondWithFilteredResult(_0x4a971b,_0x25dd5e){return function(_0x18d335){if(_0x18d335){var _0x51924c=typeof _0x25dd5e[_0x537f('0x1c')]===_0x537f('0x1d')&&typeof _0x25dd5e[_0x537f('0x1e')]===_0x537f('0x1d');var _0x673197=_0x18d335[_0x537f('0x1f')];var _0x532714=_0x51924c?0x0:_0x25dd5e[_0x537f('0x1c')];var _0x4f137a=_0x51924c?_0x18d335[_0x537f('0x1f')]:_0x25dd5e['offset']+_0x25dd5e[_0x537f('0x1e')];var _0x5f0ea9;if(_0x4f137a>=_0x673197){_0x4f137a=_0x673197;_0x5f0ea9=0xc8;}else{_0x5f0ea9=0xce;}_0x4a971b[_0x537f('0x1a')](_0x5f0ea9);return _0x4a971b['set']('Content-Range',_0x532714+'-'+_0x4f137a+'/'+_0x673197)[_0x537f('0x1b')](_0x18d335);}return null;};}function patchUpdates(_0x599f46){return function(_0x546c59){try{jsonpatch['apply'](_0x546c59,_0x599f46,!![]);}catch(_0x31d941){return BPromise[_0x537f('0x20')](_0x31d941);}return _0x546c59['save']();};}function saveUpdates(_0x4be8fd,_0x482c6d){return function(_0x167184){if(_0x167184){return _0x167184[_0x537f('0x21')](_0x4be8fd)[_0x537f('0x22')](function(_0x2fe902){return _0x2fe902;});}return null;};}function removeEntity(_0x5272a4,_0x4364fa){return function(_0x53fcdb){if(_0x53fcdb){return _0x53fcdb[_0x537f('0x23')]()[_0x537f('0x22')](function(){_0x5272a4[_0x537f('0x1a')](0xcc)[_0x537f('0x24')]();});}};}function handleEntityNotFound(_0x1862ac,_0x42d654){return function(_0x299404){if(!_0x299404){_0x1862ac[_0x537f('0x19')](0x194);}return _0x299404;};}function handleError(_0x16bc1e,_0x4b4cc7){_0x4b4cc7=_0x4b4cc7||0x1f4;return function(_0x38788d){logger[_0x537f('0x25')](_0x38788d[_0x537f('0x26')]);if(_0x38788d[_0x537f('0x27')]){delete _0x38788d[_0x537f('0x27')];}_0x16bc1e['status'](_0x4b4cc7)[_0x537f('0x28')](_0x38788d);};}exports['index']=function(_0x35ec89,_0x218a2e){var _0x1ca3f1={},_0x2d4164={},_0x29449d={'count':0x0,'rows':[]};var _0x1e3ecd=_[_0x537f('0x29')](db[_0x537f('0x2a')][_0x537f('0x2b')],function(_0x2155d5){return{'name':_0x2155d5['fieldName'],'type':_0x2155d5[_0x537f('0x2c')][_0x537f('0x2d')]};});_0x2d4164[_0x537f('0x2e')]=_[_0x537f('0x29')](_0x1e3ecd,_0x537f('0x27'));_0x2d4164[_0x537f('0x2f')]=_['keys'](_0x35ec89[_0x537f('0x2f')]);_0x2d4164['filters']=_[_0x537f('0x30')](_0x2d4164[_0x537f('0x2e')],_0x2d4164['query']);_0x1ca3f1['attributes']=_[_0x537f('0x30')](_0x2d4164[_0x537f('0x2e')],qs[_0x537f('0x31')](_0x35ec89[_0x537f('0x2f')][_0x537f('0x31')]));_0x1ca3f1[_0x537f('0x32')]=_0x1ca3f1[_0x537f('0x32')]['length']?_0x1ca3f1[_0x537f('0x32')]:_0x2d4164[_0x537f('0x2e')];if(!_0x35ec89[_0x537f('0x2f')]['hasOwnProperty'](_0x537f('0x33'))){_0x1ca3f1[_0x537f('0x1e')]=qs[_0x537f('0x1e')](_0x35ec89['query'][_0x537f('0x1e')]);_0x1ca3f1[_0x537f('0x1c')]=qs['offset'](_0x35ec89[_0x537f('0x2f')][_0x537f('0x1c')]);}_0x1ca3f1[_0x537f('0x34')]=qs[_0x537f('0x35')](_0x35ec89[_0x537f('0x2f')][_0x537f('0x35')]);_0x1ca3f1[_0x537f('0x36')]=qs['filters'](_[_0x537f('0x37')](_0x35ec89[_0x537f('0x2f')],_0x2d4164['filters']),_0x1e3ecd);if(_0x35ec89[_0x537f('0x2f')][_0x537f('0x38')]){_0x1ca3f1[_0x537f('0x36')]=_[_0x537f('0x39')](_0x1ca3f1['where'],{'$or':_[_0x537f('0x29')](_0x1e3ecd,function(_0x3093b8){if(_0x3093b8[_0x537f('0x2c')]!==_0x537f('0x3a')){var _0x29268e={};_0x29268e[_0x3093b8[_0x537f('0x27')]]={'$like':'%'+_0x35ec89[_0x537f('0x2f')]['filter']+'%'};return _0x29268e;}})});}_0x1ca3f1=_[_0x537f('0x39')]({},_0x1ca3f1,_0x35ec89[_0x537f('0x3b')]);var _0x1f5456={'where':_0x1ca3f1[_0x537f('0x36')]};return db[_0x537f('0x2a')][_0x537f('0x1f')](_0x1f5456)['then'](function(_0x304c74){_0x29449d[_0x537f('0x1f')]=_0x304c74;if(_0x35ec89['query']['includeAll']){_0x1ca3f1[_0x537f('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x537f('0x3d')](_0x1ca3f1);})[_0x537f('0x22')](function(_0x221434){_0x29449d[_0x537f('0x3e')]=_0x221434;return _0x29449d;})[_0x537f('0x22')](respondWithFilteredResult(_0x218a2e,_0x1ca3f1))[_0x537f('0x3f')](handleError(_0x218a2e,null));};exports[_0x537f('0x40')]=function(_0x36a44d,_0x34c25f){var _0x11dad8={'raw':!![],'where':{'id':_0x36a44d['params']['id']}},_0x4627ef={};_0x4627ef[_0x537f('0x2e')]=_[_0x537f('0x41')](db['VoiceDialReport'][_0x537f('0x2b')]);_0x4627ef[_0x537f('0x2f')]=_[_0x537f('0x41')](_0x36a44d['query']);_0x4627ef[_0x537f('0x42')]=_[_0x537f('0x30')](_0x4627ef['model'],_0x4627ef['query']);_0x11dad8[_0x537f('0x32')]=_[_0x537f('0x30')](_0x4627ef[_0x537f('0x2e')],qs['fields'](_0x36a44d[_0x537f('0x2f')]['fields']));_0x11dad8[_0x537f('0x32')]=_0x11dad8[_0x537f('0x32')][_0x537f('0x43')]?_0x11dad8[_0x537f('0x32')]:_0x4627ef['model'];if(_0x36a44d[_0x537f('0x2f')][_0x537f('0x44')]){_0x11dad8['include']=[{'all':!![]}];}_0x11dad8=_[_0x537f('0x39')]({},_0x11dad8,_0x36a44d['options']);return db[_0x537f('0x2a')][_0x537f('0x45')](_0x11dad8)[_0x537f('0x22')](handleEntityNotFound(_0x34c25f,null))['then'](respondWithResult(_0x34c25f,null))[_0x537f('0x3f')](handleError(_0x34c25f,null));};exports['create']=function(_0x521c48,_0x4d9491){return db[_0x537f('0x2a')][_0x537f('0x46')](_0x521c48[_0x537f('0x47')],{})[_0x537f('0x22')](respondWithResult(_0x4d9491,0xc9))['catch'](handleError(_0x4d9491,null));};exports[_0x537f('0x21')]=function(_0x372b06,_0xc25bcf){if(_0x372b06[_0x537f('0x47')]['id']){delete _0x372b06[_0x537f('0x47')]['id'];}return db[_0x537f('0x2a')][_0x537f('0x45')]({'where':{'id':_0x372b06[_0x537f('0x48')]['id']}})[_0x537f('0x22')](handleEntityNotFound(_0xc25bcf,null))[_0x537f('0x22')](saveUpdates(_0x372b06[_0x537f('0x47')],null))['then'](respondWithResult(_0xc25bcf,null))[_0x537f('0x3f')](handleError(_0xc25bcf,null));};exports[_0x537f('0x23')]=function(_0x55b698,_0x3ac8ee){return db[_0x537f('0x2a')][_0x537f('0x45')]({'where':{'id':_0x55b698[_0x537f('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ac8ee,null))['then'](removeEntity(_0x3ac8ee,null))[_0x537f('0x3f')](handleError(_0x3ac8ee,null));};exports[_0x537f('0x49')]=function(_0x4ba75a,_0x54d038){return db['VoiceDialReport'][_0x537f('0x49')]()[_0x537f('0x22')](respondWithResult(_0x54d038,null))[_0x537f('0x3f')](handleError(_0x54d038,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5d964aa..2620067 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 _0xb926=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','uniqueid','lodash'];(function(_0x485ace,_0x8e7058){var _0x455213=function(_0x3935e9){while(--_0x3935e9){_0x485ace['push'](_0x485ace['shift']());}};_0x455213(++_0x8e7058);}(_0xb926,0x83));var _0x6b92=function(_0x2d8a02,_0x1f4e5d){_0x2d8a02=_0x2d8a02-0x0;var _0xe7aaf8=_0xb926[_0x2d8a02];return _0xe7aaf8;};'use strict';var _=require(_0x6b92('0x0'));var util=require(_0x6b92('0x1'));var logger=require(_0x6b92('0x2'))(_0x6b92('0x3'));var moment=require('moment');var BPromise=require(_0x6b92('0x4'));var rp=require(_0x6b92('0x5'));var fs=require('fs');var path=require(_0x6b92('0x6'));var rimraf=require(_0x6b92('0x7'));var config=require(_0x6b92('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x6b92('0x9')]=function(_0x1e59bc,_0x435308){return _0x1e59bc[_0x6b92('0xa')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x6b92('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e7=['./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x482597,_0x1a57ee){var _0x1f1884=function(_0x522c2d){while(--_0x522c2d){_0x482597['push'](_0x482597['shift']());}};_0x1f1884(++_0x1a57ee);}(_0xd0e7,0x10d));var _0x7d0e=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xd0e7[_0x3430aa];return _0x2ac5c;};'use strict';var _=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var logger=require(_0x7d0e('0x2'))(_0x7d0e('0x3'));var moment=require('moment');var BPromise=require(_0x7d0e('0x4'));var rp=require(_0x7d0e('0x5'));var fs=require('fs');var path=require(_0x7d0e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7d0e('0x7'));module[_0x7d0e('0x8')]=function(_0x376672,_0x2546e2){return _0x376672[_0x7d0e('0x9')](_0x7d0e('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x7d0e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 93df7e6..0aab2d1 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 _0x8b59=['result','catch','VoiceDialReport','options','raw','CreateVoiceDialReport','update','where','limit','UpdateVoiceDialReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x8b59,0x149));var _0x98b5=function(_0x2400dd,_0x350440){_0x2400dd=_0x2400dd-0x0;var _0x2bcaba=_0x8b59[_0x2400dd];return _0x2bcaba;};'use strict';var _=require('lodash');var util=require(_0x98b5('0x0'));var moment=require(_0x98b5('0x1'));var BPromise=require(_0x98b5('0x2'));var rs=require(_0x98b5('0x3'));var fs=require('fs');var Redis=require(_0x98b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x98b5('0x5'));var logger=require('../../config/logger')(_0x98b5('0x6'));var config=require('../../config/environment');var jayson=require(_0x98b5('0x7'));var client=jayson[_0x98b5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c071a,_0x13b89a,_0x852a67){return new BPromise(function(_0x86a1a2,_0x44c5a1){return client['request'](_0x4c071a,_0x852a67)[_0x98b5('0x9')](function(_0x19584b){logger[_0x98b5('0xa')](_0x98b5('0xb'),_0x13b89a,_0x98b5('0xc'));logger[_0x98b5('0xd')](_0x98b5('0xe'),_0x13b89a,'request\x20sent',JSON[_0x98b5('0xf')](_0x19584b));if(_0x19584b[_0x98b5('0x10')]){if(_0x19584b['error'][_0x98b5('0x11')]===0x1f4){logger[_0x98b5('0x10')](_0x98b5('0xb'),_0x13b89a,_0x19584b[_0x98b5('0x10')]['message']);return _0x44c5a1(_0x19584b[_0x98b5('0x10')][_0x98b5('0x12')]);}logger[_0x98b5('0x10')](_0x98b5('0xb'),_0x13b89a,_0x19584b['error']['message']);return _0x86a1a2(_0x19584b[_0x98b5('0x10')][_0x98b5('0x12')]);}else{logger[_0x98b5('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x13b89a,_0x98b5('0xc'));_0x86a1a2(_0x19584b[_0x98b5('0x13')][_0x98b5('0x12')]);}})[_0x98b5('0x14')](function(_0x1e79cf){logger[_0x98b5('0x10')](_0x98b5('0xb'),_0x13b89a,_0x1e79cf);_0x44c5a1(_0x1e79cf);});});}exports['CreateVoiceDialReport']=function(_0x383ecd){var _0x3b39ae=this;return new Promise(function(_0x40f5e4,_0xd2eed4){return db[_0x98b5('0x15')]['create'](_0x383ecd['body'],{'raw':_0x383ecd['options']?_0x383ecd[_0x98b5('0x16')][_0x98b5('0x17')]===undefined?!![]:![]:!![]})[_0x98b5('0x9')](function(_0x5d5a07){logger[_0x98b5('0xa')]('CreateVoiceDialReport',_0x383ecd);logger['debug']('CreateVoiceDialReport',_0x383ecd,JSON[_0x98b5('0xf')](_0x5d5a07));_0x40f5e4(_0x5d5a07);})[_0x98b5('0x14')](function(_0x966431){logger['error'](_0x98b5('0x18'),_0x966431[_0x98b5('0x12')],_0x383ecd);_0xd2eed4(_0x3b39ae[_0x98b5('0x10')](0x1f4,_0x966431['message']));});});};exports['UpdateVoiceDialReport']=function(_0x797e04){var _0x1c51b0=this;return new Promise(function(_0x14733b,_0x597b32){return db[_0x98b5('0x15')][_0x98b5('0x19')](_0x797e04['body'],{'raw':_0x797e04[_0x98b5('0x16')]?_0x797e04['options'][_0x98b5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x797e04[_0x98b5('0x16')]?_0x797e04[_0x98b5('0x16')][_0x98b5('0x1a')]||null:null,'attributes':_0x797e04[_0x98b5('0x16')]?_0x797e04[_0x98b5('0x16')]['attributes']||null:null,'limit':_0x797e04[_0x98b5('0x16')]?_0x797e04[_0x98b5('0x16')][_0x98b5('0x1b')]||null:null})[_0x98b5('0x9')](function(_0x55ee9c){logger['info']('UpdateVoiceDialReport',_0x797e04);logger[_0x98b5('0xd')](_0x98b5('0x1c'),_0x797e04,JSON['stringify'](_0x55ee9c));_0x14733b(_0x55ee9c);})[_0x98b5('0x14')](function(_0x2c0759){logger[_0x98b5('0x10')](_0x98b5('0x1c'),_0x2c0759['message'],_0x797e04);_0x597b32(_0x1c51b0['error'](0x1f4,_0x2c0759[_0x98b5('0x12')]));});});}; \ No newline at end of file +var _0x07e5=['CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07e5,0x15c));var _0x507e=function(_0x40ca04,_0x4a3dc7){_0x40ca04=_0x40ca04-0x0;var _0x557fb2=_0x07e5[_0x40ca04];return _0x557fb2;};'use strict';var _=require(_0x507e('0x0'));var util=require(_0x507e('0x1'));var moment=require(_0x507e('0x2'));var BPromise=require(_0x507e('0x3'));var rs=require(_0x507e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x507e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x507e('0x6'))(_0x507e('0x7'));var config=require(_0x507e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x507e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x133f86,_0xf51d97,_0x318a82){return new BPromise(function(_0x16af09,_0x2eedbb){return client['request'](_0x133f86,_0x318a82)[_0x507e('0xa')](function(_0xd876a9){logger[_0x507e('0xb')](_0x507e('0xc'),_0xf51d97,_0x507e('0xd'));logger[_0x507e('0xe')](_0x507e('0xf'),_0xf51d97,_0x507e('0xd'),JSON[_0x507e('0x10')](_0xd876a9));if(_0xd876a9[_0x507e('0x11')]){if(_0xd876a9['error'][_0x507e('0x12')]===0x1f4){logger[_0x507e('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0xf51d97,_0xd876a9[_0x507e('0x11')][_0x507e('0x13')]);return _0x2eedbb(_0xd876a9['error'][_0x507e('0x13')]);}logger[_0x507e('0x11')](_0x507e('0xc'),_0xf51d97,_0xd876a9[_0x507e('0x11')]['message']);return _0x16af09(_0xd876a9[_0x507e('0x11')][_0x507e('0x13')]);}else{logger['info'](_0x507e('0xc'),_0xf51d97,_0x507e('0xd'));_0x16af09(_0xd876a9[_0x507e('0x14')][_0x507e('0x13')]);}})[_0x507e('0x15')](function(_0x5446e0){logger['error'](_0x507e('0xc'),_0xf51d97,_0x5446e0);_0x2eedbb(_0x5446e0);});});}exports['CreateVoiceDialReport']=function(_0x33790c){var _0x588726=this;return new Promise(function(_0x344eea,_0x4da606){return db['VoiceDialReport'][_0x507e('0x16')](_0x33790c['body'],{'raw':_0x33790c[_0x507e('0x17')]?_0x33790c[_0x507e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x507e('0xa')](function(_0xd0dfd5){logger['info'](_0x507e('0x18'),_0x33790c);logger[_0x507e('0xe')]('CreateVoiceDialReport',_0x33790c,JSON[_0x507e('0x10')](_0xd0dfd5));_0x344eea(_0xd0dfd5);})['catch'](function(_0x213dc8){logger[_0x507e('0x11')](_0x507e('0x18'),_0x213dc8['message'],_0x33790c);_0x4da606(_0x588726[_0x507e('0x11')](0x1f4,_0x213dc8[_0x507e('0x13')]));});});};exports[_0x507e('0x19')]=function(_0x565107){var _0x34da65=this;return new Promise(function(_0x18f31d,_0x19ec9e){return db[_0x507e('0x1a')][_0x507e('0x1b')](_0x565107['body'],{'raw':_0x565107['options']?_0x565107[_0x507e('0x17')][_0x507e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565107['options']?_0x565107[_0x507e('0x17')]['where']||null:null,'attributes':_0x565107['options']?_0x565107[_0x507e('0x17')][_0x507e('0x1d')]||null:null,'limit':_0x565107[_0x507e('0x17')]?_0x565107[_0x507e('0x17')][_0x507e('0x1e')]||null:null})[_0x507e('0xa')](function(_0xf57477){logger[_0x507e('0xb')]('UpdateVoiceDialReport',_0x565107);logger[_0x507e('0xe')](_0x507e('0x19'),_0x565107,JSON[_0x507e('0x10')](_0xf57477));_0x18f31d(_0xf57477);})[_0x507e('0x15')](function(_0x575253){logger[_0x507e('0x11')](_0x507e('0x19'),_0x575253[_0x507e('0x13')],_0x565107);_0x19ec9e(_0x34da65[_0x507e('0x11')](0x1f4,_0x575253[_0x507e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 949ae7d..8735156 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 _0xc88e=['update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications'];(function(_0x206b5c,_0x5a4ba5){var _0x1bc879=function(_0x13f352){while(--_0x13f352){_0x206b5c['push'](_0x206b5c['shift']());}};_0x1bc879(++_0x5a4ba5);}(_0xc88e,0x193));var _0xec88=function(_0x3176d6,_0x27ef13){_0x3176d6=_0x3176d6-0x0;var _0x4ec505=_0xc88e[_0x3176d6];return _0x4ec505;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xec88('0x0'));var timeout=require(_0xec88('0x1'));var express=require('express');var router=express[_0xec88('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xec88('0x3'));var interaction=require(_0xec88('0x4'));var config=require(_0xec88('0x5'));var controller=require(_0xec88('0x6'));router[_0xec88('0x7')]('/',auth[_0xec88('0x8')](),controller[_0xec88('0x9')]);router[_0xec88('0x7')](_0xec88('0xa'),auth[_0xec88('0x8')](),controller[_0xec88('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xec88('0xc')](_0xec88('0xd'),auth[_0xec88('0x8')](),controller[_0xec88('0xe')]);router['put']('/:id',auth[_0xec88('0x8')](),controller[_0xec88('0xf')]);router[_0xec88('0x10')](_0xec88('0xa'),auth['isAuthenticated'](),controller[_0xec88('0x11')]);module[_0xec88('0x12')]=router; \ No newline at end of file +var _0xe959=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','/:id/applications','addApplications','put','/:id','update','delete','destroy','multer','util'];(function(_0x574b7f,_0x5a758e){var _0x3da1af=function(_0x4b382e){while(--_0x4b382e){_0x574b7f['push'](_0x574b7f['shift']());}};_0x3da1af(++_0x5a758e);}(_0xe959,0xf0));var _0x9e95=function(_0x47c9ce,_0xe57350){_0x47c9ce=_0x47c9ce-0x0;var _0x2e6d4d=_0xe959[_0x47c9ce];return _0x2e6d4d;};'use strict';var multer=require(_0x9e95('0x0'));var util=require(_0x9e95('0x1'));var path=require(_0x9e95('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e95('0x3'));var router=express[_0x9e95('0x4')]();var fs_extra=require(_0x9e95('0x5'));var auth=require(_0x9e95('0x6'));var interaction=require(_0x9e95('0x7'));var config=require(_0x9e95('0x8'));var controller=require(_0x9e95('0x9'));router[_0x9e95('0xa')]('/',auth[_0x9e95('0xb')](),controller[_0x9e95('0xc')]);router[_0x9e95('0xa')]('/:id',auth[_0x9e95('0xb')](),controller[_0x9e95('0xd')]);router[_0x9e95('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9e95('0xf'),auth[_0x9e95('0xb')](),controller[_0x9e95('0x10')]);router[_0x9e95('0x11')](_0x9e95('0x12'),auth[_0x9e95('0xb')](),controller[_0x9e95('0x13')]);router[_0x9e95('0x14')](_0x9e95('0x12'),auth[_0x9e95('0xb')](),controller[_0x9e95('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 53b67da..9803808 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 _0xf9a6=['sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','exten'];(function(_0x466eff,_0x5cebbe){var _0x46cdd1=function(_0x41c836){while(--_0x41c836){_0x466eff['push'](_0x466eff['shift']());}};_0x46cdd1(++_0x5cebbe);}(_0xf9a6,0x154));var _0x6f9a=function(_0x270e1a,_0x2fd54c){_0x270e1a=_0x270e1a-0x0;var _0x389968=_0xf9a6[_0x270e1a];return _0x389968;};'use strict';var Sequelize=require(_0x6f9a('0x0'));module['exports']={'context':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':![],'unique':_0x6f9a('0x2')},'priority':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x6f9a('0x2')},'tag':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':![],'defaultValue':_0x6f9a('0x3')},'appdata':{'type':Sequelize[_0x6f9a('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6f9a('0x4')](_0x6f9a('0x5'),_0x6f9a('0x6'),'internal',_0x6f9a('0x7'),_0x6f9a('0x8'),_0x6f9a('0x9'),_0x6f9a('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x6f9a('0x1')]},'interval':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':![],'defaultValue':_0x6f9a('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x6f9a('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6f9a('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6f9a('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6f9a('0xd')]},'recordingFormat':{'type':Sequelize[_0x6f9a('0x1')],'defaultValue':_0x6f9a('0xe')},'answer':{'type':Sequelize[_0x6f9a('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6f9a('0xf')],'get':function(_0x1bf932){return this['getDataValue'](_0x6f9a('0x10'));}},'alias':{'type':Sequelize[_0x6f9a('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xc269=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','any'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xc269,0x148));var _0x9c26=function(_0x3ae9f3,_0x5e9253){_0x3ae9f3=_0x3ae9f3-0x0;var _0x2d1a27=_0xc269[_0x3ae9f3];return _0x2d1a27;};'use strict';var Sequelize=require(_0x9c26('0x0'));module[_0x9c26('0x1')]={'context':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![],'unique':_0x9c26('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![],'unique':_0x9c26('0x3')},'priority':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x9c26('0x3')},'tag':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![],'defaultValue':_0x9c26('0x4')},'appdata':{'type':Sequelize[_0x9c26('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x9c26('0x5')](_0x9c26('0x6'),_0x9c26('0x7'),_0x9c26('0x8'),_0x9c26('0x9'),'outbound-fax',_0x9c26('0xa'),_0x9c26('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x9c26('0x2')]},'interval':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![],'defaultValue':_0x9c26('0xc')},'IntervalId':{'type':Sequelize[_0x9c26('0xd')]},'isApp':{'type':Sequelize[_0x9c26('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9c26('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x9c26('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x9c26('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x9c26('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x9c26('0xf')],'get':function(_0x586312){return this['getDataValue'](_0x9c26('0x10'));}},'alias':{'type':Sequelize[_0x9c26('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 7557666..ada4fb5 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 _0x38db=['update','context','description','cutdigits','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','undefined','limit','count','set','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','value','includes','type','find','name','UserProfileResource','then','sendStatus','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','fields','length','destroy','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4fd51d,_0x371051){var _0x831756=function(_0x3bbded){while(--_0x3bbded){_0x4fd51d['push'](_0x4fd51d['shift']());}};_0x831756(++_0x371051);}(_0x38db,0x6a));var _0xb38d=function(_0x159410,_0x4c52ec){_0x159410=_0x159410-0x0;var _0x4a13a2=_0x38db[_0x159410];return _0x4a13a2;};'use strict';var _=require(_0xb38d('0x0'));var Redis=require(_0xb38d('0x1'));var qs=require(_0xb38d('0x2'));var logger=require(_0xb38d('0x3'))(_0xb38d('0x4'));var config=require(_0xb38d('0x5'));var db=require(_0xb38d('0x6'))['db'];config[_0xb38d('0x7')]=_[_0xb38d('0x8')](config[_0xb38d('0x7')],{'host':_0xb38d('0x9'),'port':0x18eb});var socket=require(_0xb38d('0xa'))(new Redis(config[_0xb38d('0x7')]));require(_0xb38d('0xb'))[_0xb38d('0xc')](socket);function respondWithStatusCode(_0x1036b3,_0x1e53d3){_0x1e53d3=_0x1e53d3||0xcc;return function(_0xc112c){if(_0xc112c){return _0x1036b3['sendStatus'](_0x1e53d3);}return _0x1036b3[_0xb38d('0xd')](_0x1e53d3)[_0xb38d('0xe')]();};}function respondWithResult(_0x40007b,_0x23da41){_0x23da41=_0x23da41||0xc8;return function(_0x2ace5a){if(_0x2ace5a){return _0x40007b[_0xb38d('0xd')](_0x23da41)[_0xb38d('0xf')](_0x2ace5a);}};}function respondWithFilteredResult(_0x51c465,_0x1a179e){return function(_0xb02ddd){if(_0xb02ddd){var _0x4a20d2=typeof _0x1a179e[_0xb38d('0x10')]===_0xb38d('0x11')&&typeof _0x1a179e[_0xb38d('0x12')]===_0xb38d('0x11');var _0x61ffd=_0xb02ddd[_0xb38d('0x13')];var _0x199b5b=_0x4a20d2?0x0:_0x1a179e['offset'];var _0x281e89=_0x4a20d2?_0xb02ddd[_0xb38d('0x13')]:_0x1a179e['offset']+_0x1a179e[_0xb38d('0x12')];var _0x11c956;if(_0x281e89>=_0x61ffd){_0x281e89=_0x61ffd;_0x11c956=0xc8;}else{_0x11c956=0xce;}_0x51c465['status'](_0x11c956);return _0x51c465[_0xb38d('0x14')]('Content-Range',_0x199b5b+'-'+_0x281e89+'/'+_0x61ffd)[_0xb38d('0xf')](_0xb02ddd);}return null;};}function removeEntity(_0x523057){return function(_0x406a44){if(_0x406a44){return _0x406a44['destroy']()['then'](function(){var _0x3f859f=_0x406a44[_0xb38d('0x15')]({'plain':!![]});var _0x16311b=[{'name':_0xb38d('0x16'),'value':'inbound','ignore':![]},{'name':_0xb38d('0x17'),'value':_0xb38d('0x18'),'ignore':![]},{'name':_0xb38d('0x19'),'value':_0xb38d('0x1a'),'ignore':![]}];var _0x255d4f=_(_0x16311b)[_0xb38d('0x1b')]('ignore')['map'](_0xb38d('0x1c'))['value']();if(_[_0xb38d('0x1d')](_0x255d4f,_0x3f859f[_0xb38d('0x1e')])){return;}var _0xd01e92=_[_0xb38d('0x1f')](_0x16311b,[_0xb38d('0x1c'),_0x3f859f['type']])[_0xb38d('0x20')];return db[_0xb38d('0x21')]['destroy']({'where':{'type':_0xd01e92,'resourceId':_0x3f859f['id']}})[_0xb38d('0x22')](function(){return _0x406a44;});})[_0xb38d('0x22')](function(){_0x523057['status'](0xcc)[_0xb38d('0xe')]();});}};}function handleEntityNotFound(_0x1e0607){return function(_0x172599){if(!_0x172599){_0x1e0607[_0xb38d('0x23')](0x194);}return _0x172599;};}function handleError(_0x117900,_0x457a59){_0x457a59=_0x457a59||0x1f4;return function(_0x2745ed){logger['error'](_0x2745ed['stack']);if(_0x2745ed[_0xb38d('0x20')]){delete _0x2745ed['name'];}_0x117900[_0xb38d('0xd')](_0x457a59)['send'](_0x2745ed);};}exports['index']=function(_0xbc35c,_0x5c5cde){var _0x1df6bb={},_0x3b3c5f={},_0x30022a={'count':0x0,'rows':[]};var _0x2db1cd=_[_0xb38d('0x24')](db[_0xb38d('0x25')][_0xb38d('0x26')],function(_0x1db844){return{'name':_0x1db844[_0xb38d('0x27')],'type':_0x1db844[_0xb38d('0x1e')][_0xb38d('0x28')]};});_0x3b3c5f[_0xb38d('0x29')]=_[_0xb38d('0x24')](_0x2db1cd,_0xb38d('0x20'));_0x3b3c5f[_0xb38d('0x2a')]=_[_0xb38d('0x2b')](_0xbc35c['query']);_0x3b3c5f[_0xb38d('0x2c')]=_[_0xb38d('0x2d')](_0x3b3c5f['model'],_0x3b3c5f[_0xb38d('0x2a')]);_0x1df6bb[_0xb38d('0x2e')]=_[_0xb38d('0x2d')](_0x3b3c5f['model'],qs['fields'](_0xbc35c[_0xb38d('0x2a')]['fields']));_0x1df6bb['attributes']=_0x1df6bb[_0xb38d('0x2e')]['length']?_0x1df6bb[_0xb38d('0x2e')]:_0x3b3c5f['model'];if(!_0xbc35c[_0xb38d('0x2a')][_0xb38d('0x2f')](_0xb38d('0x30'))){_0x1df6bb[_0xb38d('0x12')]=qs['limit'](_0xbc35c['query'][_0xb38d('0x12')]);_0x1df6bb[_0xb38d('0x10')]=qs['offset'](_0xbc35c[_0xb38d('0x2a')][_0xb38d('0x10')]);}_0x1df6bb[_0xb38d('0x31')]=qs[_0xb38d('0x32')](_0xbc35c[_0xb38d('0x2a')][_0xb38d('0x32')]);_0x1df6bb[_0xb38d('0x33')]=qs['filters'](_[_0xb38d('0x34')](_0xbc35c[_0xb38d('0x2a')],_0x3b3c5f[_0xb38d('0x2c')]),_0x2db1cd);if(_0xbc35c['query'][_0xb38d('0x1b')]){_0x1df6bb[_0xb38d('0x33')]=_[_0xb38d('0x35')](_0x1df6bb['where'],{'$or':_['map'](_0x2db1cd,function(_0x3c22bb){if(_0x3c22bb[_0xb38d('0x1e')]!==_0xb38d('0x36')){var _0x48a958={};_0x48a958[_0x3c22bb[_0xb38d('0x20')]]={'$like':'%'+_0xbc35c['query']['filter']+'%'};return _0x48a958;}})});}_0x1df6bb=_[_0xb38d('0x35')]({},_0x1df6bb,_0xbc35c[_0xb38d('0x37')]);var _0x31fbde={'where':_0x1df6bb[_0xb38d('0x33')]};return db[_0xb38d('0x25')]['count'](_0x31fbde)['then'](function(_0xd02e91){_0x30022a[_0xb38d('0x13')]=_0xd02e91;if(_0xbc35c[_0xb38d('0x2a')][_0xb38d('0x38')]){_0x1df6bb[_0xb38d('0x39')]=[{'all':!![]}];}return db[_0xb38d('0x25')][_0xb38d('0x3a')](_0x1df6bb);})[_0xb38d('0x22')](function(_0x3a8bc8){_0x30022a['rows']=_0x3a8bc8;return _0x30022a;})[_0xb38d('0x22')](respondWithFilteredResult(_0x5c5cde,_0x1df6bb))[_0xb38d('0x3b')](handleError(_0x5c5cde,null));};exports['show']=function(_0x2d873e,_0x335dfa){var _0x503e89={'raw':![],'where':{'id':_0x2d873e[_0xb38d('0x3c')]['id']}},_0x5aac0f={};_0x5aac0f['model']=_[_0xb38d('0x2b')](db[_0xb38d('0x25')][_0xb38d('0x26')]);_0x5aac0f[_0xb38d('0x2a')]=_['keys'](_0x2d873e[_0xb38d('0x2a')]);_0x5aac0f['filters']=_[_0xb38d('0x2d')](_0x5aac0f[_0xb38d('0x29')],_0x5aac0f[_0xb38d('0x2a')]);_0x503e89['attributes']=_[_0xb38d('0x2d')](_0x5aac0f['model'],qs[_0xb38d('0x3d')](_0x2d873e[_0xb38d('0x2a')][_0xb38d('0x3d')]));_0x503e89[_0xb38d('0x2e')]=_0x503e89[_0xb38d('0x2e')][_0xb38d('0x3e')]?_0x503e89['attributes']:_0x5aac0f[_0xb38d('0x29')];if(_0x2d873e[_0xb38d('0x2a')]['includeAll']){_0x503e89[_0xb38d('0x39')]=[{'all':!![]}];}_0x503e89=_['merge']({},_0x503e89,_0x2d873e[_0xb38d('0x37')]);return db[_0xb38d('0x25')][_0xb38d('0x1f')](_0x503e89)[_0xb38d('0x22')](handleEntityNotFound(_0x335dfa,null))[_0xb38d('0x22')](respondWithResult(_0x335dfa,null))[_0xb38d('0x3b')](handleError(_0x335dfa,null));};exports[_0xb38d('0x3f')]=function(_0x1c1003,_0x24f4a6){return db[_0xb38d('0x25')]['find']({'where':{'id':_0x1c1003[_0xb38d('0x3c')]['id']}})[_0xb38d('0x22')](handleEntityNotFound(_0x24f4a6,null))[_0xb38d('0x22')](removeEntity(_0x24f4a6,null))[_0xb38d('0x3b')](handleError(_0x24f4a6,null));};exports[_0xb38d('0x40')]=function(_0xb3a169,_0x2cbe8d){if(_0xb3a169[_0xb38d('0x41')][_0xb38d('0x1e')]===_0xb38d('0x18')&&!_[_0xb38d('0x42')](_0xb3a169[_0xb38d('0x41')][_0xb38d('0x43')],'_')){_0xb3a169['body']['exten']='_'[_0xb38d('0x44')](_0xb3a169[_0xb38d('0x41')][_0xb38d('0x43')]);}return db['VoiceExtension'][_0xb38d('0x40')](_0xb3a169[_0xb38d('0x41')],{'raw':![]})[_0xb38d('0x22')](function(_0x1e6dd6){var _0x413a27=_0xb3a169['user'][_0xb38d('0x15')]({'plain':!![]});if(!_0x413a27)throw new Error(_0xb38d('0x45'));if(_0x413a27[_0xb38d('0x46')]===_0xb38d('0x47')){var _0x10c409=_0x1e6dd6[_0xb38d('0x15')]({'plain':!![]});var _0x410930=[{'name':_0xb38d('0x16'),'value':_0xb38d('0x48')},{'name':_0xb38d('0x17'),'value':_0xb38d('0x18')},{'name':'InternalRoutes','value':_0xb38d('0x1a')}];var _0x41ae51=_[_0xb38d('0x1f')](_0x410930,['value',_0x10c409[_0xb38d('0x1e')]])[_0xb38d('0x20')];return db[_0xb38d('0x49')][_0xb38d('0x1f')]({'where':{'name':_0x41ae51,'userProfileId':_0x413a27[_0xb38d('0x4a')]},'raw':!![]})[_0xb38d('0x22')](function(_0x32801e){if(_0x32801e&&_0x32801e[_0xb38d('0x4b')]===0x0){return db[_0xb38d('0x21')][_0xb38d('0x40')]({'name':_0x10c409[_0xb38d('0x20')],'resourceId':_0x10c409['id'],'type':_0x32801e[_0xb38d('0x20')],'sectionId':_0x32801e['id']},{})[_0xb38d('0x22')](function(){return _0x1e6dd6;});}else{return _0x1e6dd6;}})['catch'](function(_0x1b9d8e){logger[_0xb38d('0x4c')](_0xb38d('0x4d'),_0x1b9d8e);throw _0x1b9d8e;});}return _0x1e6dd6;})[_0xb38d('0x22')](respondWithResult(_0x2cbe8d,0xc9))['catch'](handleError(_0x2cbe8d,null));};exports['update']=function(_0x1ae49a,_0x4c4a5c){if(_0x1ae49a[_0xb38d('0x41')]['id']){delete _0x1ae49a[_0xb38d('0x41')]['id'];}return db[_0xb38d('0x25')]['find']({'where':{'id':_0x1ae49a[_0xb38d('0x3c')]['id']}})[_0xb38d('0x22')](handleEntityNotFound(_0x4c4a5c,null))['then'](function(_0x567674){if(_0x567674){return db[_0xb38d('0x25')][_0xb38d('0x4e')](_[_0xb38d('0x34')](_0x1ae49a[_0xb38d('0x41')],['exten',_0xb38d('0x4f'),_0xb38d('0x50'),'recordingFormat',_0xb38d('0x51'),'mandatoryDisposition',_0xb38d('0x52')]),{'where':{'context':_0x567674[_0xb38d('0x4f')],'exten':_0x567674[_0xb38d('0x43')]},'individualHooks':!![]})[_0xb38d('0x22')](function(_0x4732c5){return _0x4732c5;});}return null;})[_0xb38d('0x22')](respondWithStatusCode(_0x4c4a5c,null))[_0xb38d('0x3b')](handleError(_0x4c4a5c,null));};exports[_0xb38d('0x53')]=function(_0x3d8c5f,_0x3f41f7){return db[_0xb38d('0x25')][_0xb38d('0x54')]({'where':{'id':_0x3d8c5f[_0xb38d('0x3c')]['id']}})[_0xb38d('0x22')](function(_0x14742f){if(_0x14742f){return db[_0xb38d('0x55')][_0xb38d('0x56')](function(_0x444621){return db[_0xb38d('0x25')][_0xb38d('0x3f')]({'where':{'VoiceExtensionId':_0x3d8c5f[_0xb38d('0x3c')]['id']},'transaction':_0x444621})[_0xb38d('0x22')](function(){var _0x4a68d0=_[_0xb38d('0x24')](_0x3d8c5f[_0xb38d('0x41')],function(_0x387f1e){_0x387f1e[_0xb38d('0x57')]=_0x3d8c5f[_0xb38d('0x3c')]['id'];_0x387f1e[_0xb38d('0x58')]=!![];return _0x387f1e;});return _0x14742f[_0xb38d('0x59')](_0x4a68d0);})[_0xb38d('0x22')](function(_0x18a15c){console[_0xb38d('0x5a')](_0xb38d('0x5b'),_0x18a15c);return db[_0xb38d('0x25')]['bulkCreate'](_0x18a15c,{'transaction':_0x444621});});})[_0xb38d('0x22')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x3d8c5f[_0xb38d('0x3c')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xb38d('0x22')](respondWithResult(_0x3f41f7,null))[_0xb38d('0x3b')](handleError(_0x3f41f7,null));}; \ No newline at end of file +var _0x119c=['key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','startsWith','exten','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','outbound','UserProfileSection','userProfileId','autoAssociation','context','description','recordingFormat','mandatoryDisposition','alias','findOne','transaction','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','ioredis','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','then','get','InboundRoutes','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceExtension'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x119c,0xea));var _0xc119=function(_0x4c29f9,_0x5bddd4){_0x4c29f9=_0x4c29f9-0x0;var _0x4e17b8=_0x119c[_0x4c29f9];return _0x4e17b8;};'use strict';var _=require('lodash');var Redis=require(_0xc119('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xc119('0x1'))(_0xc119('0x2'));var config=require(_0xc119('0x3'));var db=require('../../mysqldb')['db'];config[_0xc119('0x4')]=_[_0xc119('0x5')](config[_0xc119('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xc119('0x6'))(new Redis(config['redis']));require(_0xc119('0x7'))['register'](socket);function respondWithStatusCode(_0x16b3d2,_0x3dbd20){_0x3dbd20=_0x3dbd20||0xcc;return function(_0x900301){if(_0x900301){return _0x16b3d2[_0xc119('0x8')](_0x3dbd20);}return _0x16b3d2[_0xc119('0x9')](_0x3dbd20)[_0xc119('0xa')]();};}function respondWithResult(_0x367745,_0x3a5827){_0x3a5827=_0x3a5827||0xc8;return function(_0x3222dc){if(_0x3222dc){return _0x367745[_0xc119('0x9')](_0x3a5827)[_0xc119('0xb')](_0x3222dc);}};}function respondWithFilteredResult(_0x511bb0,_0x4774d9){return function(_0x5536dc){if(_0x5536dc){var _0x3c29d2=typeof _0x4774d9[_0xc119('0xc')]===_0xc119('0xd')&&typeof _0x4774d9[_0xc119('0xe')]===_0xc119('0xd');var _0x3ac20c=_0x5536dc['count'];var _0x57208c=_0x3c29d2?0x0:_0x4774d9[_0xc119('0xc')];var _0x34d296=_0x3c29d2?_0x5536dc[_0xc119('0xf')]:_0x4774d9[_0xc119('0xc')]+_0x4774d9[_0xc119('0xe')];var _0x51f9f3;if(_0x34d296>=_0x3ac20c){_0x34d296=_0x3ac20c;_0x51f9f3=0xc8;}else{_0x51f9f3=0xce;}_0x511bb0[_0xc119('0x9')](_0x51f9f3);return _0x511bb0['set'](_0xc119('0x10'),_0x57208c+'-'+_0x34d296+'/'+_0x3ac20c)[_0xc119('0xb')](_0x5536dc);}return null;};}function removeEntity(_0x4ebc72){return function(_0x6313d4){if(_0x6313d4){return _0x6313d4[_0xc119('0x11')]()[_0xc119('0x12')](function(){var _0x286c1a=_0x6313d4[_0xc119('0x13')]({'plain':!![]});var _0x1d993e=[{'name':_0xc119('0x14'),'value':'inbound','ignore':![]},{'name':_0xc119('0x15'),'value':'outbound','ignore':![]},{'name':_0xc119('0x16'),'value':_0xc119('0x17'),'ignore':![]}];var _0x47ead7=_(_0x1d993e)[_0xc119('0x18')](_0xc119('0x19'))[_0xc119('0x1a')](_0xc119('0x1b'))[_0xc119('0x1b')]();if(_[_0xc119('0x1c')](_0x47ead7,_0x286c1a[_0xc119('0x1d')])){return;}var _0x220452=_['find'](_0x1d993e,[_0xc119('0x1b'),_0x286c1a['type']])[_0xc119('0x1e')];return db[_0xc119('0x1f')][_0xc119('0x11')]({'where':{'type':_0x220452,'resourceId':_0x286c1a['id']}})[_0xc119('0x12')](function(){return _0x6313d4;});})['then'](function(){_0x4ebc72[_0xc119('0x9')](0xcc)[_0xc119('0xa')]();});}};}function handleEntityNotFound(_0x47769a){return function(_0x234bea){if(!_0x234bea){_0x47769a[_0xc119('0x8')](0x194);}return _0x234bea;};}function handleError(_0x146629,_0x38da8e){_0x38da8e=_0x38da8e||0x1f4;return function(_0x52faaa){logger[_0xc119('0x20')](_0x52faaa['stack']);if(_0x52faaa['name']){delete _0x52faaa[_0xc119('0x1e')];}_0x146629['status'](_0x38da8e)[_0xc119('0x21')](_0x52faaa);};}exports[_0xc119('0x22')]=function(_0x499d11,_0x4ffe42){var _0x331e09={},_0xfa620b={},_0x4030f8={'count':0x0,'rows':[]};var _0x1272cd=_[_0xc119('0x1a')](db[_0xc119('0x23')]['rawAttributes'],function(_0x5c1e34){return{'name':_0x5c1e34['fieldName'],'type':_0x5c1e34[_0xc119('0x1d')][_0xc119('0x24')]};});_0xfa620b[_0xc119('0x25')]=_['map'](_0x1272cd,'name');_0xfa620b[_0xc119('0x26')]=_[_0xc119('0x27')](_0x499d11[_0xc119('0x26')]);_0xfa620b[_0xc119('0x28')]=_['intersection'](_0xfa620b[_0xc119('0x25')],_0xfa620b[_0xc119('0x26')]);_0x331e09[_0xc119('0x29')]=_[_0xc119('0x2a')](_0xfa620b[_0xc119('0x25')],qs[_0xc119('0x2b')](_0x499d11[_0xc119('0x26')]['fields']));_0x331e09[_0xc119('0x29')]=_0x331e09[_0xc119('0x29')]['length']?_0x331e09[_0xc119('0x29')]:_0xfa620b[_0xc119('0x25')];if(!_0x499d11[_0xc119('0x26')][_0xc119('0x2c')](_0xc119('0x2d'))){_0x331e09['limit']=qs[_0xc119('0xe')](_0x499d11['query'][_0xc119('0xe')]);_0x331e09[_0xc119('0xc')]=qs['offset'](_0x499d11[_0xc119('0x26')]['offset']);}_0x331e09[_0xc119('0x2e')]=qs[_0xc119('0x2f')](_0x499d11[_0xc119('0x26')][_0xc119('0x2f')]);_0x331e09['where']=qs['filters'](_[_0xc119('0x30')](_0x499d11[_0xc119('0x26')],_0xfa620b[_0xc119('0x28')]),_0x1272cd);if(_0x499d11[_0xc119('0x26')][_0xc119('0x18')]){_0x331e09[_0xc119('0x31')]=_[_0xc119('0x32')](_0x331e09[_0xc119('0x31')],{'$or':_[_0xc119('0x1a')](_0x1272cd,function(_0x3d7776){if(_0x3d7776['type']!==_0xc119('0x33')){var _0x45f3ad={};_0x45f3ad[_0x3d7776['name']]={'$like':'%'+_0x499d11['query']['filter']+'%'};return _0x45f3ad;}})});}_0x331e09=_[_0xc119('0x32')]({},_0x331e09,_0x499d11[_0xc119('0x34')]);var _0x22fc16={'where':_0x331e09[_0xc119('0x31')]};return db['VoiceExtension'][_0xc119('0xf')](_0x22fc16)[_0xc119('0x12')](function(_0x2caa6e){_0x4030f8[_0xc119('0xf')]=_0x2caa6e;if(_0x499d11[_0xc119('0x26')][_0xc119('0x35')]){_0x331e09[_0xc119('0x36')]=[{'all':!![]}];}return db[_0xc119('0x23')][_0xc119('0x37')](_0x331e09);})[_0xc119('0x12')](function(_0x64da2e){_0x4030f8[_0xc119('0x38')]=_0x64da2e;return _0x4030f8;})[_0xc119('0x12')](respondWithFilteredResult(_0x4ffe42,_0x331e09))[_0xc119('0x39')](handleError(_0x4ffe42,null));};exports[_0xc119('0x3a')]=function(_0x339a97,_0x2491d8){var _0x4335d4={'raw':![],'where':{'id':_0x339a97[_0xc119('0x3b')]['id']}},_0xf5d892={};_0xf5d892[_0xc119('0x25')]=_['keys'](db[_0xc119('0x23')][_0xc119('0x3c')]);_0xf5d892['query']=_[_0xc119('0x27')](_0x339a97['query']);_0xf5d892[_0xc119('0x28')]=_[_0xc119('0x2a')](_0xf5d892[_0xc119('0x25')],_0xf5d892[_0xc119('0x26')]);_0x4335d4[_0xc119('0x29')]=_['intersection'](_0xf5d892['model'],qs['fields'](_0x339a97[_0xc119('0x26')][_0xc119('0x2b')]));_0x4335d4['attributes']=_0x4335d4[_0xc119('0x29')][_0xc119('0x3d')]?_0x4335d4[_0xc119('0x29')]:_0xf5d892[_0xc119('0x25')];if(_0x339a97[_0xc119('0x26')]['includeAll']){_0x4335d4[_0xc119('0x36')]=[{'all':!![]}];}_0x4335d4=_[_0xc119('0x32')]({},_0x4335d4,_0x339a97[_0xc119('0x34')]);return db[_0xc119('0x23')][_0xc119('0x3e')](_0x4335d4)['then'](handleEntityNotFound(_0x2491d8,null))[_0xc119('0x12')](respondWithResult(_0x2491d8,null))['catch'](handleError(_0x2491d8,null));};exports[_0xc119('0x11')]=function(_0x1b1c26,_0x28def5){return db[_0xc119('0x23')][_0xc119('0x3e')]({'where':{'id':_0x1b1c26[_0xc119('0x3b')]['id']}})[_0xc119('0x12')](handleEntityNotFound(_0x28def5,null))[_0xc119('0x12')](removeEntity(_0x28def5,null))[_0xc119('0x39')](handleError(_0x28def5,null));};exports['create']=function(_0x35081b,_0x48d417){if(_0x35081b[_0xc119('0x3f')][_0xc119('0x1d')]==='outbound'&&!_[_0xc119('0x40')](_0x35081b[_0xc119('0x3f')][_0xc119('0x41')],'_')){_0x35081b[_0xc119('0x3f')][_0xc119('0x41')]='_'[_0xc119('0x42')](_0x35081b[_0xc119('0x3f')][_0xc119('0x41')]);}return db[_0xc119('0x23')][_0xc119('0x43')](_0x35081b['body'],{'raw':![]})['then'](function(_0x4643b2){var _0x6969f=_0x35081b['user'][_0xc119('0x13')]({'plain':!![]});if(!_0x6969f)throw new Error(_0xc119('0x44'));if(_0x6969f[_0xc119('0x45')]===_0xc119('0x46')){var _0x453b75=_0x4643b2[_0xc119('0x13')]({'plain':!![]});var _0x520783=[{'name':_0xc119('0x14'),'value':'inbound'},{'name':_0xc119('0x15'),'value':_0xc119('0x47')},{'name':_0xc119('0x16'),'value':_0xc119('0x17')}];var _0x255789=_[_0xc119('0x3e')](_0x520783,[_0xc119('0x1b'),_0x453b75['type']])[_0xc119('0x1e')];return db[_0xc119('0x48')][_0xc119('0x3e')]({'where':{'name':_0x255789,'userProfileId':_0x6969f[_0xc119('0x49')]},'raw':!![]})[_0xc119('0x12')](function(_0x3b2f28){if(_0x3b2f28&&_0x3b2f28[_0xc119('0x4a')]===0x0){return db[_0xc119('0x1f')][_0xc119('0x43')]({'name':_0x453b75[_0xc119('0x1e')],'resourceId':_0x453b75['id'],'type':_0x3b2f28[_0xc119('0x1e')],'sectionId':_0x3b2f28['id']},{})[_0xc119('0x12')](function(){return _0x4643b2;});}else{return _0x4643b2;}})[_0xc119('0x39')](function(_0x32de09){logger[_0xc119('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32de09);throw _0x32de09;});}return _0x4643b2;})['then'](respondWithResult(_0x48d417,0xc9))[_0xc119('0x39')](handleError(_0x48d417,null));};exports['update']=function(_0x1ec3c8,_0x385eb8){if(_0x1ec3c8['body']['id']){delete _0x1ec3c8[_0xc119('0x3f')]['id'];}return db[_0xc119('0x23')]['find']({'where':{'id':_0x1ec3c8[_0xc119('0x3b')]['id']}})['then'](handleEntityNotFound(_0x385eb8,null))['then'](function(_0x1b86f5){if(_0x1b86f5){return db[_0xc119('0x23')]['update'](_[_0xc119('0x30')](_0x1ec3c8['body'],['exten',_0xc119('0x4b'),_0xc119('0x4c'),_0xc119('0x4d'),'cutdigits',_0xc119('0x4e'),_0xc119('0x4f')]),{'where':{'context':_0x1b86f5['context'],'exten':_0x1b86f5[_0xc119('0x41')]},'individualHooks':!![]})[_0xc119('0x12')](function(_0x194791){return _0x194791;});}return null;})[_0xc119('0x12')](respondWithStatusCode(_0x385eb8,null))[_0xc119('0x39')](handleError(_0x385eb8,null));};exports['addApplications']=function(_0x1d210a,_0x42318b){return db['VoiceExtension'][_0xc119('0x50')]({'where':{'id':_0x1d210a[_0xc119('0x3b')]['id']}})[_0xc119('0x12')](function(_0x1b13e8){if(_0x1b13e8){return db['sequelize'][_0xc119('0x51')](function(_0x4023c3){return db[_0xc119('0x23')][_0xc119('0x11')]({'where':{'VoiceExtensionId':_0x1d210a['params']['id']},'transaction':_0x4023c3})[_0xc119('0x12')](function(){var _0x18c565=_[_0xc119('0x1a')](_0x1d210a['body'],function(_0xfd55ee){_0xfd55ee[_0xc119('0x52')]=_0x1d210a['params']['id'];_0xfd55ee[_0xc119('0x53')]=!![];return _0xfd55ee;});return _0x1b13e8[_0xc119('0x54')](_0x18c565);})['then'](function(_0xbd60dc){console[_0xc119('0x55')](_0xc119('0x56'),_0xbd60dc);return db['VoiceExtension'][_0xc119('0x57')](_0xbd60dc,{'transaction':_0x4023c3});});})[_0xc119('0x12')](function(){return db[_0xc119('0x23')][_0xc119('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1d210a[_0xc119('0x3b')]['id']},'order':_0xc119('0x59')});});}})['then'](respondWithResult(_0x42318b,null))['catch'](handleError(_0x42318b,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index f74fdd5..fc1a4b2 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 _0x6728=['update','remove','emit','hasOwnProperty','events','setMaxListeners'];(function(_0x47ff2f,_0x435af2){var _0x170768=function(_0x24b58c){while(--_0x24b58c){_0x47ff2f['push'](_0x47ff2f['shift']());}};_0x170768(++_0x435af2);}(_0x6728,0xb2));var _0x8672=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6728[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x8672('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8672('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8672('0x2'),'afterDestroy':_0x8672('0x3')};function emitEvent(_0x8a22cf){return function(_0x220dda,_0x3913ee,_0x46b648){VoiceExtensionEvents[_0x8672('0x4')](_0x8a22cf+':'+_0x220dda['id'],_0x220dda);VoiceExtensionEvents['emit'](_0x8a22cf,_0x220dda);_0x46b648(null);};}for(var e in events){if(events[_0x8672('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x0c10=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0c10,0x198));var _0x00c1=function(_0x24cb8c,_0x423901){_0x24cb8c=_0x24cb8c-0x0;var _0x2b9b59=_0x0c10[_0x24cb8c];return _0x2b9b59;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x00c1('0x0'))['db'][_0x00c1('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x00c1('0x2')](0x0);var events={'afterCreate':_0x00c1('0x3'),'afterUpdate':_0x00c1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27ba8d){return function(_0x5f2f6f,_0x753379,_0x6eff99){VoiceExtensionEvents['emit'](_0x27ba8d+':'+_0x5f2f6f['id'],_0x5f2f6f);VoiceExtensionEvents[_0x00c1('0x5')](_0x27ba8d,_0x5f2f6f);_0x6eff99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x00c1('0x6')](e,emitEvent(event));}}module[_0x00c1('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 32f23c8..afcbb60 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 _0xc492=['cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','length','param','split','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','intervals','map','filter','IntervalId','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime','appdata','concat','catch','voice_extensions','get','last','priority','then','lodash','./voiceExtension.attributes','exports','models','Set','type','context','alias','NoOp','inbound','exten','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)='];(function(_0x182159,_0x2a8561){var _0x9bdde6=function(_0x36ad97){while(--_0x36ad97){_0x182159['push'](_0x182159['shift']());}};_0x9bdde6(++_0x2a8561);}(_0xc492,0xd7));var _0x2c49=function(_0x3ae754,_0x4bd3b0){_0x3ae754=_0x3ae754-0x0;var _0x239542=_0xc492[_0x3ae754];return _0x239542;};'use strict';var _=require(_0x2c49('0x0'));var attributes=require(_0x2c49('0x1'));module[_0x2c49('0x2')]=function(_0x5c2d08){var _0x57cde2=_0x5c2d08[_0x2c49('0x3')];function _0x5bab73(_0x4c9b2d){var _0x555cba=0x2;var _0x1de940=[{'type':_0x4c9b2d['type'],'app':_0x2c49('0x4'),'appdata':'CDR(type)='+_0x4c9b2d[_0x2c49('0x5')],'context':_0x4c9b2d[_0x2c49('0x6')],'exten':_0x4c9b2d['exten'],'priority':_0x555cba++,'VoiceExtensionId':_0x4c9b2d['id']},{'type':_0x4c9b2d[_0x2c49('0x5')],'app':_0x4c9b2d[_0x2c49('0x7')]?_0x2c49('0x4'):_0x2c49('0x8'),'appdata':_0x4c9b2d[_0x2c49('0x7')]?'CDR(routeAlias)='+_0x4c9b2d[_0x2c49('0x7')]:'No\x20alias\x20set','context':_0x4c9b2d['context'],'exten':_0x4c9b2d['exten'],'priority':_0x555cba++,'VoiceExtensionId':_0x4c9b2d['id']}];if(_0x4c9b2d['type']===_0x2c49('0x9')){_0x1de940['push']({'type':_0x2c49('0x9'),'app':_0x2c49('0x4'),'appdata':'CDR(routeid)='+_0x4c9b2d['id'],'context':_0x4c9b2d[_0x2c49('0x6')],'exten':_0x4c9b2d[_0x2c49('0xa')],'priority':_0x555cba++,'VoiceExtensionId':_0x4c9b2d['id']});}_0x1de940[_0x2c49('0xb')]({'type':_0x4c9b2d[_0x2c49('0x5')],'app':_0x2c49('0x4'),'appdata':_0x2c49('0xc'),'context':_0x4c9b2d['context'],'exten':_0x4c9b2d[_0x2c49('0xa')],'priority':_0x555cba++,'VoiceExtensionId':_0x4c9b2d['id']},{'type':_0x4c9b2d[_0x2c49('0x5')],'app':_0x2c49('0x4'),'appdata':_0x2c49('0xd'),'context':_0x4c9b2d[_0x2c49('0x6')],'exten':_0x4c9b2d['exten'],'priority':_0x555cba++,'VoiceExtensionId':_0x4c9b2d['id']},{'type':_0x4c9b2d[_0x2c49('0x5')],'app':_0x2c49('0x4'),'appdata':_0x2c49('0xe'),'context':_0x4c9b2d[_0x2c49('0x6')],'exten':_0x4c9b2d[_0x2c49('0xa')],'priority':_0x555cba++,'VoiceExtensionId':_0x4c9b2d['id']});return _0x1de940;}function _0x88e972(_0x175646){var _0x2e2e07=0x2;var _0x1fe9f8=[{'type':_0x2c49('0xf'),'app':'Set','appdata':_0x2c49('0x10'),'context':_0x175646[_0x2c49('0x6')],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':_0x175646['alias']?_0x2c49('0x4'):'NoOp','appdata':_0x175646[_0x2c49('0x7')]?_0x2c49('0x11')+_0x175646['alias']:'No\x20alias\x20set','context':_0x175646[_0x2c49('0x6')],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':_0x2c49('0x4'),'appdata':_0x2c49('0x12')+(_0x175646[_0x2c49('0x13')]?_0x2c49('0x14')+_0x175646[_0x2c49('0x13')]+'}':_0x2c49('0x15')),'context':_0x175646['context'],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':_0x2c49('0x4'),'appdata':_0x2c49('0x16')+_0x175646['id'],'context':_0x175646['context'],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':_0x2c49('0x17'),'appdata':_0x2c49('0x18')+(_0x2e2e07+0x2)+'):Goto('+(_0x2e2e07+0x1)+')','context':_0x175646[_0x2c49('0x6')],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':'Set','appdata':_0x175646[_0x2c49('0x13')]?_0x2c49('0x19')+_0x175646['cutdigits']+'}':_0x2c49('0x1a'),'context':_0x175646['context'],'exten':_0x175646['exten'],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':'Set','appdata':_0x2c49('0xc'),'context':_0x175646['context'],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':_0x2c49('0x4'),'appdata':_0x2c49('0xd'),'context':_0x175646[_0x2c49('0x6')],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':_0x2c49('0x4'),'appdata':_0x2c49('0xe'),'context':_0x175646[_0x2c49('0x6')],'exten':_0x175646['exten'],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':'Set','appdata':_0x2c49('0x1b')+_0x175646['id'],'context':_0x175646[_0x2c49('0x6')],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']}];if(_0x175646[_0x2c49('0x1c')](_0x2c49('0x1d'))&&_0x175646[_0x2c49('0x1d')]!==_0x2c49('0x1e')){_0x1fe9f8[_0x2c49('0xb')]({'type':_0x2c49('0xf'),'app':_0x2c49('0x4'),'appdata':_0x2c49('0x1f'),'context':_0x175646[_0x2c49('0x6')],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']},{'type':_0x2c49('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x175646[_0x2c49('0x1d')]||_0x2c49('0x20'),'context':_0x175646['context'],'exten':_0x175646[_0x2c49('0xa')],'priority':_0x2e2e07++,'VoiceExtensionId':_0x175646['id']});}return _0x1fe9f8;}function _0x3f92cd(_0x14aeea,_0x320c60){var _0x3be1d6=[{'name':_0x2c49('0x21'),'param':0x0},{'name':_0x2c49('0x22'),'param':0x1},{'name':_0x2c49('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0x2cbddb={};var _0x35487c=_0x320c60['split'](',');var _0x3dcf7c=[];for(var _0x1d6136=0x0;_0x1d6136<_0x3be1d6[_0x2c49('0x24')];_0x1d6136++){switch(_0x3be1d6[_0x1d6136]['name']){case _0x2c49('0x21'):_0x2cbddb[_0x2c49('0x21')]=_0x35487c[_0x3be1d6[_0x1d6136][_0x2c49('0x25')]][_0x2c49('0x26')]('/')[0x1];_0x2cbddb[_0x2c49('0x27')]=_0x35487c[_0x3be1d6[_0x1d6136][_0x2c49('0x25')]]['split']('/')[0x2];_0x2cbddb[_0x2c49('0x28')]=_0x2cbddb[_0x2c49('0x27')]?_0x2cbddb['phone'][_0x2c49('0x26')]('$')[0x0]:undefined;_0x2cbddb[_0x2c49('0x27')]=_0x14aeea['cutdigits']?(_0x2cbddb[_0x2c49('0x28')]||'')+'${EXTEN:'+_0x14aeea[_0x2c49('0x13')]+'}':(_0x2cbddb[_0x2c49('0x28')]||'')+_0x2c49('0x15');_0x3dcf7c[_0x3be1d6[_0x1d6136]['param']]=[_0x2c49('0x29'),_0x2cbddb['trunk'],_0x2cbddb[_0x2c49('0x27')]][_0x2c49('0x2a')]('/');break;case _0x2c49('0x23'):_0x2cbddb[_0x2c49('0x23')]=_0x35487c[_0x3be1d6[_0x1d6136][_0x2c49('0x25')]];if(_0x14aeea['recordingFormat']!==_0x2c49('0x1e')){if(_0x2cbddb[_0x2c49('0x23')][_0x2c49('0x2b')](_0x2c49('0x2c'))<0x0){_0x2cbddb[_0x2c49('0x23')]+=_0x2c49('0x2c');}}else{_0x2cbddb[_0x2c49('0x23')]=_0x2cbddb[_0x2c49('0x23')]['replace'](_0x2c49('0x2c'),'');}_0x3dcf7c[_0x3be1d6[_0x1d6136][_0x2c49('0x25')]]=_0x2cbddb['options'];break;default:_0x3dcf7c[_0x3be1d6[_0x1d6136][_0x2c49('0x25')]]=_0x35487c[_0x3be1d6[_0x1d6136][_0x2c49('0x25')]];}}return _0x3dcf7c['join'](',');}function _0x390e78(_0x5beba3,_0x58b2cf,_0x5707b5){return new Promise(function(_0x584023,_0x362942){var _0x3161c5=[];if(_[_0x2c49('0x2d')](_0x58b2cf))return _0x584023(_0x3161c5);_0x57cde2[_0x2c49('0x2e')][_0x2c49('0x2f')]({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x5ee329){for(var _0x43b5ca=0x0,_0x4f11d1=0x0;_0x43b5ca<_0x58b2cf[_0x2c49('0x24')];_0x43b5ca++,_0x4f11d1=0x0){var _0x52c772=_0x58b2cf[_0x43b5ca];var _0x55a997=[];var _0x4e0742=[];delete _0x52c772['id'];if(_0x52c772[_0x2c49('0x30')]!=='*,*,*,*'){_0x52c772[_0x2c49('0x31')]=[_0x52c772[_0x2c49('0x30')]];}else{_0x52c772['intervals']=_0x52c772['IntervalId']?_[_0x2c49('0x32')](_[_0x2c49('0x33')](_0x5ee329,{'IntervalId':_0x52c772[_0x2c49('0x34')]}),_0x2c49('0x30')):[];}_0x52c772[_0x2c49('0x6')]=_0x5beba3['context'];_0x52c772['exten']=_0x5beba3[_0x2c49('0xa')];if(_0x52c772[_0x2c49('0x5')])_0x52c772['type']=_0x52c772['type']['toLowerCase']();if(_0x5beba3[_0x2c49('0x5')]===_0x2c49('0xf')){if(_0x52c772[_0x2c49('0x1c')]('tag')&&_0x52c772[_0x2c49('0x35')]&&_0x52c772[_0x2c49('0x35')]!=='--'){_0x55a997[_0x2c49('0xb')]({'type':_0x52c772[_0x2c49('0x5')][_0x2c49('0x36')](),'app':_0x2c49('0x4'),'appdata':_0x2c49('0x37')+_0x52c772['tag'],'context':_0x5beba3['context'],'exten':_0x5beba3['exten'],'priority':_0x52c772[_0x2c49('0x31')][_0x2c49('0x24')]+_0x5707b5+_0x4f11d1++,'VoiceExtensionId':_0x5beba3['id']});}_0x55a997['push']({'type':_0x52c772[_0x2c49('0x5')][_0x2c49('0x36')](),'app':_0x2c49('0x17'),'appdata':_0x2c49('0x38')+(_0x52c772[_0x2c49('0x39')]?_0x2c49('0x3a')+_0x52c772[_0x2c49('0x39')]+')':_0x2c49('0x3b')),'context':_0x5beba3[_0x2c49('0x6')],'exten':_0x5beba3[_0x2c49('0xa')],'priority':_0x52c772['intervals'][_0x2c49('0x24')]+_0x5707b5+_0x4f11d1++,'VoiceExtensionId':_0x5beba3['id']});}else{if(_0x52c772[_0x2c49('0x1c')](_0x2c49('0x3c'))){if(['queue',_0x2c49('0x3d')][_0x2c49('0x3e')](_0x52c772['app'][_0x2c49('0x36')]())&&_0x52c772[_0x2c49('0x3f')]!==_0x2c49('0x40')){if(_0x52c772[_0x2c49('0x3c')]){_0x55a997['push']({'type':_0x52c772[_0x2c49('0x5')][_0x2c49('0x36')](),'app':_0x2c49('0x17'),'appdata':_0x2c49('0x41'),'context':_0x5beba3['context'],'exten':_0x5beba3[_0x2c49('0xa')],'priority':_0x52c772[_0x2c49('0x31')][_0x2c49('0x24')]+_0x5707b5+_0x4f11d1++,'VoiceExtensionId':_0x5beba3['id']});_0x55a997[_0x2c49('0xb')]({'type':_0x52c772[_0x2c49('0x5')][_0x2c49('0x36')](),'app':_0x2c49('0x4'),'appdata':_0x2c49('0x42'),'context':_0x5beba3[_0x2c49('0x6')],'exten':_0x5beba3['exten'],'priority':_0x52c772['intervals'][_0x2c49('0x24')]+_0x5707b5+_0x4f11d1++,'VoiceExtensionId':_0x5beba3['id']});}else{_0x55a997[_0x2c49('0xb')]({'type':_0x52c772['type'][_0x2c49('0x36')](),'app':'ExecIf','appdata':_0x2c49('0x43'),'context':_0x5beba3[_0x2c49('0x6')],'exten':_0x5beba3[_0x2c49('0xa')],'priority':_0x52c772[_0x2c49('0x31')][_0x2c49('0x24')]+_0x5707b5+_0x4f11d1++,'VoiceExtensionId':_0x5beba3['id']});_0x55a997['push']({'type':_0x52c772[_0x2c49('0x5')][_0x2c49('0x36')](),'app':_0x2c49('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5beba3[_0x2c49('0x6')],'exten':_0x5beba3[_0x2c49('0xa')],'priority':_0x52c772['intervals'][_0x2c49('0x24')]+_0x5707b5+_0x4f11d1++,'VoiceExtensionId':_0x5beba3['id']});}}}}for(var _0x45d4bb=0x0;_0x45d4bb<_0x52c772['intervals'][_0x2c49('0x24')];_0x45d4bb++){var _0x50706a=_0x5707b5+_0x52c772[_0x2c49('0x31')][_0x2c49('0x24')];var _0x1263f7=_0x45d4bb===_0x52c772[_0x2c49('0x31')][_0x2c49('0x24')]-0x1?_0x5707b5+_0x55a997[_0x2c49('0x24')]+_0x4e0742['length']+0x2:_0x5707b5+_0x45d4bb+0x1;_0x55a997[_0x2c49('0x44')](_0x45d4bb,0x0,{'type':_0x5beba3[_0x2c49('0x5')],'app':_0x2c49('0x45'),'appdata':_0x52c772['intervals'][_0x45d4bb]+'?'+_0x5beba3[_0x2c49('0x6')]+',${EXTEN},'+_0x50706a+':'+_0x5beba3['context']+',${EXTEN},'+_0x1263f7,'exten':_0x5beba3[_0x2c49('0xa')],'context':_0x5beba3[_0x2c49('0x6')],'priority':_0x5707b5+_0x45d4bb,'VoiceExtensionId':_0x5beba3['id']});}if(_0x52c772[_0x2c49('0x3f')]==='outboundDial')_0x52c772[_0x2c49('0x46')]=_0x3f92cd(_0x5beba3,_0x52c772['appdata']);_0x52c772['priority']=_0x55a997['length']?_['last'](_0x55a997)['priority']+0x1:_0x5707b5;_0x3161c5=_[_0x2c49('0x47')](_0x3161c5,_0x55a997,[_0x52c772],_0x4e0742);_0x5707b5=_['last'](_0x3161c5)['priority']+0x1;}return _0x584023(_0x3161c5);})[_0x2c49('0x48')](function(_0x557b68){_0x362942(_0x557b68);});});}return _0x5c2d08['define']('VoiceExtension',attributes,{'tableName':_0x2c49('0x49'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x8945a7){var _0x3861a8=this[_0x2c49('0x4a')]({'plain':!![]});var _0x3fd55e=_0x3861a8[_0x2c49('0x5')]===_0x2c49('0xf')?_0x88e972(_0x3861a8):_0x5bab73(_0x3861a8);return _0x390e78(_0x3861a8,_0x8945a7,_[_0x2c49('0x4b')](_0x3fd55e)[_0x2c49('0x4c')]+0x1)[_0x2c49('0x4d')](function(_0x1695e5){var _0x3d6703=_[_0x2c49('0x47')](_0x3fd55e,_0x1695e5);_0x3d6703[_0x2c49('0xb')]({'type':_0x3861a8[_0x2c49('0x5')],'app':'Hangup','exten':_0x3861a8[_0x2c49('0xa')],'context':_0x3861a8[_0x2c49('0x6')],'priority':_['last'](_0x3d6703)[_0x2c49('0x4c')]+0x1,'VoiceExtensionId':_0x3861a8['id']});return _0x3d6703;});}}});}; \ No newline at end of file +var _0x2eec=['push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','trunk','timeout','options','url','split','param','prefix','phone','${EXTEN}','SIP','indexOf','U(xcally-mixmonitor-context)','join','isEmpty','Interval','interval','then','length','intervals','map','IntervalId','toLowerCase','CDR(tag)=','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','get','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound'];(function(_0xc9a5b2,_0x416d3a){var _0x155285=function(_0x1d6a9d){while(--_0x1d6a9d){_0xc9a5b2['push'](_0xc9a5b2['shift']());}};_0x155285(++_0x416d3a);}(_0x2eec,0xe6));var _0xc2ee=function(_0x22128d,_0x3f54cc){_0x22128d=_0x22128d-0x0;var _0x4c0bd6=_0x2eec[_0x22128d];return _0x4c0bd6;};'use strict';var _=require(_0xc2ee('0x0'));var attributes=require(_0xc2ee('0x1'));module[_0xc2ee('0x2')]=function(_0x31c363){var _0xf3adb6=_0x31c363['models'];function _0x4d3241(_0x35ae58){var _0x34844e=0x2;var _0x4e17e7=[{'type':_0x35ae58['type'],'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x4')+_0x35ae58[_0xc2ee('0x5')],'context':_0x35ae58[_0xc2ee('0x6')],'exten':_0x35ae58[_0xc2ee('0x7')],'priority':_0x34844e++,'VoiceExtensionId':_0x35ae58['id']},{'type':_0x35ae58[_0xc2ee('0x5')],'app':_0x35ae58[_0xc2ee('0x8')]?_0xc2ee('0x3'):_0xc2ee('0x9'),'appdata':_0x35ae58[_0xc2ee('0x8')]?_0xc2ee('0xa')+_0x35ae58['alias']:_0xc2ee('0xb'),'context':_0x35ae58[_0xc2ee('0x6')],'exten':_0x35ae58[_0xc2ee('0x7')],'priority':_0x34844e++,'VoiceExtensionId':_0x35ae58['id']}];if(_0x35ae58['type']===_0xc2ee('0xc')){_0x4e17e7[_0xc2ee('0xd')]({'type':_0xc2ee('0xc'),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0xe')+_0x35ae58['id'],'context':_0x35ae58[_0xc2ee('0x6')],'exten':_0x35ae58[_0xc2ee('0x7')],'priority':_0x34844e++,'VoiceExtensionId':_0x35ae58['id']});}_0x4e17e7[_0xc2ee('0xd')]({'type':_0x35ae58[_0xc2ee('0x5')],'app':_0xc2ee('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x35ae58['context'],'exten':_0x35ae58[_0xc2ee('0x7')],'priority':_0x34844e++,'VoiceExtensionId':_0x35ae58['id']},{'type':_0x35ae58[_0xc2ee('0x5')],'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0xf'),'context':_0x35ae58['context'],'exten':_0x35ae58[_0xc2ee('0x7')],'priority':_0x34844e++,'VoiceExtensionId':_0x35ae58['id']},{'type':_0x35ae58['type'],'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x10'),'context':_0x35ae58['context'],'exten':_0x35ae58[_0xc2ee('0x7')],'priority':_0x34844e++,'VoiceExtensionId':_0x35ae58['id']});return _0x4e17e7;}function _0x554bb3(_0x1c5cd6){var _0x588e16=0x2;var _0x562850=[{'type':_0xc2ee('0x11'),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x12'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6['exten'],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':'outbound','app':_0x1c5cd6[_0xc2ee('0x8')]?'Set':_0xc2ee('0x9'),'appdata':_0x1c5cd6[_0xc2ee('0x8')]?_0xc2ee('0xa')+_0x1c5cd6[_0xc2ee('0x8')]:_0xc2ee('0xb'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':'Set','appdata':_0xc2ee('0x13')+(_0x1c5cd6[_0xc2ee('0x14')]?_0xc2ee('0x15')+_0x1c5cd6[_0xc2ee('0x14')]+'}':'${EXTEN}'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6['exten'],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':'outbound','app':_0xc2ee('0x3'),'appdata':_0xc2ee('0xe')+_0x1c5cd6['id'],'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':_0xc2ee('0x16'),'appdata':_0xc2ee('0x17')+(_0x588e16+0x2)+'):Goto('+(_0x588e16+0x1)+')','context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':'outbound','app':_0xc2ee('0x3'),'appdata':_0x1c5cd6[_0xc2ee('0x14')]?_0xc2ee('0x18')+_0x1c5cd6['cutdigits']+'}':_0xc2ee('0x19'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':'Set','appdata':_0xc2ee('0x1a'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0xf'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6['exten'],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x10'),'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x1b')+_0x1c5cd6['id'],'context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']}];if(_0x1c5cd6[_0xc2ee('0x1c')](_0xc2ee('0x1d'))&&_0x1c5cd6[_0xc2ee('0x1d')]!==_0xc2ee('0x1e')){_0x562850[_0xc2ee('0xd')]({'type':_0xc2ee('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1c5cd6['context'],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']},{'type':_0xc2ee('0x11'),'app':_0xc2ee('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1c5cd6[_0xc2ee('0x1d')]||'wav','context':_0x1c5cd6[_0xc2ee('0x6')],'exten':_0x1c5cd6[_0xc2ee('0x7')],'priority':_0x588e16++,'VoiceExtensionId':_0x1c5cd6['id']});}return _0x562850;}function _0x4e0b99(_0x47b90f,_0x3aa75b){var _0x56e464=[{'name':_0xc2ee('0x1f'),'param':0x0},{'name':_0xc2ee('0x20'),'param':0x1},{'name':_0xc2ee('0x21'),'param':0x2},{'name':_0xc2ee('0x22'),'param':0x3}];var _0x4ac4fd={};var _0x3b1f3f=_0x3aa75b[_0xc2ee('0x23')](',');var _0x2abbeb=[];for(var _0x43a833=0x0;_0x43a833<_0x56e464['length'];_0x43a833++){switch(_0x56e464[_0x43a833]['name']){case _0xc2ee('0x1f'):_0x4ac4fd[_0xc2ee('0x1f')]=_0x3b1f3f[_0x56e464[_0x43a833][_0xc2ee('0x24')]][_0xc2ee('0x23')]('/')[0x1];_0x4ac4fd['phone']=_0x3b1f3f[_0x56e464[_0x43a833][_0xc2ee('0x24')]]['split']('/')[0x2];_0x4ac4fd[_0xc2ee('0x25')]=_0x4ac4fd[_0xc2ee('0x26')]?_0x4ac4fd[_0xc2ee('0x26')]['split']('$')[0x0]:undefined;_0x4ac4fd[_0xc2ee('0x26')]=_0x47b90f[_0xc2ee('0x14')]?(_0x4ac4fd[_0xc2ee('0x25')]||'')+_0xc2ee('0x15')+_0x47b90f[_0xc2ee('0x14')]+'}':(_0x4ac4fd[_0xc2ee('0x25')]||'')+_0xc2ee('0x27');_0x2abbeb[_0x56e464[_0x43a833][_0xc2ee('0x24')]]=[_0xc2ee('0x28'),_0x4ac4fd['trunk'],_0x4ac4fd[_0xc2ee('0x26')]]['join']('/');break;case'options':_0x4ac4fd[_0xc2ee('0x21')]=_0x3b1f3f[_0x56e464[_0x43a833]['param']];if(_0x47b90f[_0xc2ee('0x1d')]!==_0xc2ee('0x1e')){if(_0x4ac4fd[_0xc2ee('0x21')][_0xc2ee('0x29')](_0xc2ee('0x2a'))<0x0){_0x4ac4fd[_0xc2ee('0x21')]+=_0xc2ee('0x2a');}}else{_0x4ac4fd['options']=_0x4ac4fd['options']['replace'](_0xc2ee('0x2a'),'');}_0x2abbeb[_0x56e464[_0x43a833][_0xc2ee('0x24')]]=_0x4ac4fd[_0xc2ee('0x21')];break;default:_0x2abbeb[_0x56e464[_0x43a833]['param']]=_0x3b1f3f[_0x56e464[_0x43a833][_0xc2ee('0x24')]];}}return _0x2abbeb[_0xc2ee('0x2b')](',');}function _0x126866(_0x56d09f,_0x367895,_0x26dcfb){return new Promise(function(_0x1bca4d,_0x197b90){var _0x412db0=[];if(_[_0xc2ee('0x2c')](_0x367895))return _0x1bca4d(_0x412db0);_0xf3adb6[_0xc2ee('0x2d')]['findAll']({'attributes':['id',_0xc2ee('0x2e'),'IntervalId'],'raw':!![]})[_0xc2ee('0x2f')](function(_0x3bc08e){for(var _0x2ad452=0x0,_0x44cd77=0x0;_0x2ad452<_0x367895[_0xc2ee('0x30')];_0x2ad452++,_0x44cd77=0x0){var _0x459bb1=_0x367895[_0x2ad452];var _0x26adc1=[];var _0x188aea=[];delete _0x459bb1['id'];if(_0x459bb1[_0xc2ee('0x2e')]!=='*,*,*,*'){_0x459bb1[_0xc2ee('0x31')]=[_0x459bb1[_0xc2ee('0x2e')]];}else{_0x459bb1['intervals']=_0x459bb1['IntervalId']?_[_0xc2ee('0x32')](_['filter'](_0x3bc08e,{'IntervalId':_0x459bb1[_0xc2ee('0x33')]}),_0xc2ee('0x2e')):[];}_0x459bb1[_0xc2ee('0x6')]=_0x56d09f[_0xc2ee('0x6')];_0x459bb1['exten']=_0x56d09f[_0xc2ee('0x7')];if(_0x459bb1[_0xc2ee('0x5')])_0x459bb1[_0xc2ee('0x5')]=_0x459bb1[_0xc2ee('0x5')][_0xc2ee('0x34')]();if(_0x56d09f[_0xc2ee('0x5')]===_0xc2ee('0x11')){if(_0x459bb1[_0xc2ee('0x1c')]('tag')&&_0x459bb1['tag']&&_0x459bb1['tag']!=='--'){_0x26adc1[_0xc2ee('0xd')]({'type':_0x459bb1[_0xc2ee('0x5')]['toLowerCase'](),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x35')+_0x459bb1[_0xc2ee('0x36')],'context':_0x56d09f['context'],'exten':_0x56d09f[_0xc2ee('0x7')],'priority':_0x459bb1[_0xc2ee('0x31')][_0xc2ee('0x30')]+_0x26dcfb+_0x44cd77++,'VoiceExtensionId':_0x56d09f['id']});}_0x26adc1[_0xc2ee('0xd')]({'type':_0x459bb1[_0xc2ee('0x5')][_0xc2ee('0x34')](),'app':_0xc2ee('0x16'),'appdata':_0xc2ee('0x37')+(_0x459bb1['callerID']?_0xc2ee('0x38')+_0x459bb1[_0xc2ee('0x39')]+')':_0xc2ee('0x3a')),'context':_0x56d09f[_0xc2ee('0x6')],'exten':_0x56d09f[_0xc2ee('0x7')],'priority':_0x459bb1[_0xc2ee('0x31')][_0xc2ee('0x30')]+_0x26dcfb+_0x44cd77++,'VoiceExtensionId':_0x56d09f['id']});}else{if(_0x459bb1['hasOwnProperty'](_0xc2ee('0x3b'))){if([_0xc2ee('0x3c'),_0xc2ee('0x3d')][_0xc2ee('0x3e')](_0x459bb1[_0xc2ee('0x3f')][_0xc2ee('0x34')]())&&_0x459bb1[_0xc2ee('0x40')]!==_0xc2ee('0x41')){if(_0x459bb1[_0xc2ee('0x3b')]){_0x26adc1[_0xc2ee('0xd')]({'type':_0x459bb1[_0xc2ee('0x5')][_0xc2ee('0x34')](),'app':_0xc2ee('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x56d09f[_0xc2ee('0x6')],'exten':_0x56d09f[_0xc2ee('0x7')],'priority':_0x459bb1[_0xc2ee('0x31')][_0xc2ee('0x30')]+_0x26dcfb+_0x44cd77++,'VoiceExtensionId':_0x56d09f['id']});_0x26adc1['push']({'type':_0x459bb1[_0xc2ee('0x5')][_0xc2ee('0x34')](),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x42'),'context':_0x56d09f[_0xc2ee('0x6')],'exten':_0x56d09f[_0xc2ee('0x7')],'priority':_0x459bb1['intervals'][_0xc2ee('0x30')]+_0x26dcfb+_0x44cd77++,'VoiceExtensionId':_0x56d09f['id']});}else{_0x26adc1[_0xc2ee('0xd')]({'type':_0x459bb1[_0xc2ee('0x5')][_0xc2ee('0x34')](),'app':_0xc2ee('0x16'),'appdata':_0xc2ee('0x43'),'context':_0x56d09f[_0xc2ee('0x6')],'exten':_0x56d09f[_0xc2ee('0x7')],'priority':_0x459bb1[_0xc2ee('0x31')]['length']+_0x26dcfb+_0x44cd77++,'VoiceExtensionId':_0x56d09f['id']});_0x26adc1[_0xc2ee('0xd')]({'type':_0x459bb1[_0xc2ee('0x5')][_0xc2ee('0x34')](),'app':_0xc2ee('0x3'),'appdata':_0xc2ee('0x44'),'context':_0x56d09f[_0xc2ee('0x6')],'exten':_0x56d09f['exten'],'priority':_0x459bb1[_0xc2ee('0x31')]['length']+_0x26dcfb+_0x44cd77++,'VoiceExtensionId':_0x56d09f['id']});}}}}for(var _0x298020=0x0;_0x298020<_0x459bb1[_0xc2ee('0x31')][_0xc2ee('0x30')];_0x298020++){var _0x48a351=_0x26dcfb+_0x459bb1[_0xc2ee('0x31')][_0xc2ee('0x30')];var _0x56846c=_0x298020===_0x459bb1[_0xc2ee('0x31')]['length']-0x1?_0x26dcfb+_0x26adc1[_0xc2ee('0x30')]+_0x188aea[_0xc2ee('0x30')]+0x2:_0x26dcfb+_0x298020+0x1;_0x26adc1[_0xc2ee('0x45')](_0x298020,0x0,{'type':_0x56d09f[_0xc2ee('0x5')],'app':_0xc2ee('0x46'),'appdata':_0x459bb1[_0xc2ee('0x31')][_0x298020]+'?'+_0x56d09f[_0xc2ee('0x6')]+_0xc2ee('0x47')+_0x48a351+':'+_0x56d09f[_0xc2ee('0x6')]+_0xc2ee('0x47')+_0x56846c,'exten':_0x56d09f[_0xc2ee('0x7')],'context':_0x56d09f[_0xc2ee('0x6')],'priority':_0x26dcfb+_0x298020,'VoiceExtensionId':_0x56d09f['id']});}if(_0x459bb1['appType']===_0xc2ee('0x48'))_0x459bb1['appdata']=_0x4e0b99(_0x56d09f,_0x459bb1[_0xc2ee('0x49')]);_0x459bb1[_0xc2ee('0x4a')]=_0x26adc1['length']?_['last'](_0x26adc1)[_0xc2ee('0x4a')]+0x1:_0x26dcfb;_0x412db0=_[_0xc2ee('0x4b')](_0x412db0,_0x26adc1,[_0x459bb1],_0x188aea);_0x26dcfb=_[_0xc2ee('0x4c')](_0x412db0)[_0xc2ee('0x4a')]+0x1;}return _0x1bca4d(_0x412db0);})[_0xc2ee('0x4d')](function(_0x40f80f){_0x197b90(_0x40f80f);});});}return _0x31c363[_0xc2ee('0x4e')](_0xc2ee('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x348a89){var _0x34f911=this[_0xc2ee('0x50')]({'plain':!![]});var _0x106668=_0x34f911[_0xc2ee('0x5')]==='outbound'?_0x554bb3(_0x34f911):_0x4d3241(_0x34f911);return _0x126866(_0x34f911,_0x348a89,_[_0xc2ee('0x4c')](_0x106668)[_0xc2ee('0x4a')]+0x1)['then'](function(_0xad7a9){var _0x139eb5=_['concat'](_0x106668,_0xad7a9);_0x139eb5[_0xc2ee('0xd')]({'type':_0x34f911['type'],'app':'Hangup','exten':_0x34f911[_0xc2ee('0x7')],'context':_0x34f911[_0xc2ee('0x6')],'priority':_[_0xc2ee('0x4c')](_0x139eb5)[_0xc2ee('0x4a')]+0x1,'VoiceExtensionId':_0x34f911['id']});return _0x139eb5;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 7c1949c..9d94493 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 _0x5162=['attributes','limit','include','map','model','then','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x5162,0x103));var _0x2516=function(_0x1df803,_0x25192d){_0x1df803=_0x1df803-0x0;var _0x20ef12=_0x5162[_0x1df803];return _0x20ef12;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var utils=require(_0x2516('0x3'));var logger=require(_0x2516('0x4'))(_0x2516('0x5'));var config=require(_0x2516('0x6'));var jayson=require(_0x2516('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2516('0x8')](config[_0x2516('0x9')],{'host':_0x2516('0xa'),'port':0x18eb});var socket=require(_0x2516('0xb'))(new Redis(config[_0x2516('0x9')]));require(_0x2516('0xc'))[_0x2516('0xd')](socket);function respondWithRpcPromise(_0x590875,_0x409550,_0x3f7e71){return new BPromise(function(_0x18bfd3,_0x5dda21){return client['request'](_0x590875,_0x3f7e71)['then'](function(_0x4ceaa1){logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,_0x2516('0x10'));logger[_0x2516('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x409550,_0x2516('0x10'),JSON[_0x2516('0x12')](_0x4ceaa1));if(_0x4ceaa1[_0x2516('0x13')]){if(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x14')]===0x1f4){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x5dda21(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);}logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x18bfd3(_0x4ceaa1['error'][_0x2516('0x15')]);}else{logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,'request\x20sent');_0x18bfd3(_0x4ceaa1[_0x2516('0x16')]['message']);}})['catch'](function(_0x31a817){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x31a817);_0x5dda21(_0x31a817);});});}exports[_0x2516('0x17')]=function(_0x198b93){var _0x42ba50=this;return new Promise(function(_0x2bf0ee,_0x113616){return db[_0x2516('0x18')][_0x2516('0x19')]({'raw':_0x198b93[_0x2516('0x1a')]?_0x198b93[_0x2516('0x1a')][_0x2516('0x1b')]===undefined?!![]:![]:!![],'where':_0x198b93['options']?_0x198b93['options'][_0x2516('0x1c')]||null:null,'attributes':_0x198b93[_0x2516('0x1a')]?_0x198b93[_0x2516('0x1a')][_0x2516('0x1d')]||null:null,'limit':_0x198b93[_0x2516('0x1a')]?_0x198b93[_0x2516('0x1a')][_0x2516('0x1e')]||null:null,'include':_0x198b93[_0x2516('0x1a')]?_0x198b93['options'][_0x2516('0x1f')]?_[_0x2516('0x20')](_0x198b93[_0x2516('0x1a')][_0x2516('0x1f')],function(_0x47f4fb){return{'model':db[_0x47f4fb[_0x2516('0x21')]],'as':_0x47f4fb['as'],'attributes':_0x47f4fb[_0x2516('0x1d')],'include':_0x47f4fb[_0x2516('0x1f')]?_[_0x2516('0x20')](_0x47f4fb[_0x2516('0x1f')],function(_0x4a3dc8){return{'model':db[_0x4a3dc8[_0x2516('0x21')]],'as':_0x4a3dc8['as'],'attributes':_0x4a3dc8[_0x2516('0x1d')],'include':_0x4a3dc8[_0x2516('0x1f')]?_[_0x2516('0x20')](_0x4a3dc8[_0x2516('0x1f')],function(_0x285e67){return{'model':db[_0x285e67['model']],'as':_0x285e67['as'],'attributes':_0x285e67[_0x2516('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2516('0x22')](function(_0x493a3e){logger[_0x2516('0xe')](_0x2516('0x17'),_0x198b93);logger[_0x2516('0x11')](_0x2516('0x17'),_0x198b93,JSON[_0x2516('0x12')](_0x493a3e));_0x2bf0ee(_0x493a3e);})[_0x2516('0x23')](function(_0x2e92f2){logger[_0x2516('0x13')](_0x2516('0x17'),_0x2e92f2[_0x2516('0x15')],_0x198b93);_0x113616(_0x42ba50[_0x2516('0x13')](0x1f4,_0x2e92f2[_0x2516('0x15')]));});});}; \ No newline at end of file +var _0x01db=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','lodash'];(function(_0x331022,_0x45a791){var _0x4f4cf1=function(_0x259bdb){while(--_0x259bdb){_0x331022['push'](_0x331022['shift']());}};_0x4f4cf1(++_0x45a791);}(_0x01db,0x171));var _0xb01d=function(_0x498d21,_0x22420f){_0x498d21=_0x498d21-0x0;var _0xb166d3=_0x01db[_0x498d21];return _0xb166d3;};'use strict';var _=require(_0xb01d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb01d('0x1'));var rs=require(_0xb01d('0x2'));var fs=require('fs');var Redis=require(_0xb01d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb01d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb01d('0x5'));var jayson=require(_0xb01d('0x6'));var client=jayson[_0xb01d('0x7')][_0xb01d('0x8')]({'port':0x232a});config[_0xb01d('0x9')]=_[_0xb01d('0xa')](config[_0xb01d('0x9')],{'host':_0xb01d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb01d('0xc'))[_0xb01d('0xd')](socket);function respondWithRpcPromise(_0x28e0fc,_0x3b2de4,_0x147b7b){return new BPromise(function(_0x9112c1,_0x4eb866){return client['request'](_0x28e0fc,_0x147b7b)[_0xb01d('0xe')](function(_0x1b59b9){logger[_0xb01d('0xf')](_0xb01d('0x10'),_0x3b2de4,_0xb01d('0x11'));logger[_0xb01d('0x12')](_0xb01d('0x13'),_0x3b2de4,'request\x20sent',JSON['stringify'](_0x1b59b9));if(_0x1b59b9[_0xb01d('0x14')]){if(_0x1b59b9['error'][_0xb01d('0x15')]===0x1f4){logger[_0xb01d('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x3b2de4,_0x1b59b9[_0xb01d('0x14')][_0xb01d('0x16')]);return _0x4eb866(_0x1b59b9[_0xb01d('0x14')][_0xb01d('0x16')]);}logger['error'](_0xb01d('0x10'),_0x3b2de4,_0x1b59b9['error'][_0xb01d('0x16')]);return _0x9112c1(_0x1b59b9[_0xb01d('0x14')][_0xb01d('0x16')]);}else{logger[_0xb01d('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x3b2de4,_0xb01d('0x11'));_0x9112c1(_0x1b59b9[_0xb01d('0x17')][_0xb01d('0x16')]);}})['catch'](function(_0x210023){logger['error'](_0xb01d('0x10'),_0x3b2de4,_0x210023);_0x4eb866(_0x210023);});});}exports[_0xb01d('0x18')]=function(_0x3e96ef){var _0x28a6a7=this;return new Promise(function(_0x3d5c9d,_0x4d517e){return db[_0xb01d('0x19')][_0xb01d('0x1a')]({'raw':_0x3e96ef[_0xb01d('0x1b')]?_0x3e96ef[_0xb01d('0x1b')][_0xb01d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e96ef[_0xb01d('0x1b')]?_0x3e96ef[_0xb01d('0x1b')][_0xb01d('0x1d')]||null:null,'attributes':_0x3e96ef[_0xb01d('0x1b')]?_0x3e96ef[_0xb01d('0x1b')][_0xb01d('0x1e')]||null:null,'limit':_0x3e96ef[_0xb01d('0x1b')]?_0x3e96ef['options'][_0xb01d('0x1f')]||null:null,'include':_0x3e96ef['options']?_0x3e96ef[_0xb01d('0x1b')][_0xb01d('0x20')]?_[_0xb01d('0x21')](_0x3e96ef[_0xb01d('0x1b')][_0xb01d('0x20')],function(_0x1d8f04){return{'model':db[_0x1d8f04[_0xb01d('0x22')]],'as':_0x1d8f04['as'],'attributes':_0x1d8f04[_0xb01d('0x1e')],'include':_0x1d8f04[_0xb01d('0x20')]?_[_0xb01d('0x21')](_0x1d8f04[_0xb01d('0x20')],function(_0x531d37){return{'model':db[_0x531d37[_0xb01d('0x22')]],'as':_0x531d37['as'],'attributes':_0x531d37[_0xb01d('0x1e')],'include':_0x531d37[_0xb01d('0x20')]?_['map'](_0x531d37[_0xb01d('0x20')],function(_0x1bd8d2){return{'model':db[_0x1bd8d2[_0xb01d('0x22')]],'as':_0x1bd8d2['as'],'attributes':_0x1bd8d2['attributes']};}):[]};}):[]};}):[]:[]})[_0xb01d('0xe')](function(_0x5007d1){logger[_0xb01d('0xf')](_0xb01d('0x18'),_0x3e96ef);logger[_0xb01d('0x12')]('GetVoiceExtension',_0x3e96ef,JSON[_0xb01d('0x23')](_0x5007d1));_0x3d5c9d(_0x5007d1);})[_0xb01d('0x24')](function(_0x1666a1){logger[_0xb01d('0x14')](_0xb01d('0x18'),_0x1666a1[_0xb01d('0x16')],_0x3e96ef);_0x4d517e(_0x28a6a7['error'](0x1f4,_0x1666a1[_0xb01d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4ca2929..64d494e 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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x814b,0x1a2));var _0xb814=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x814b[_0xc20f22];return _0x1535d5;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x175297,_0x3cddd8){var _0x474e16=function(_0x18b358){while(--_0x18b358){_0x175297['push'](_0x175297['shift']());}};_0x474e16(++_0x3cddd8);}(_0x1261,0x144));var _0x1126=function(_0x40d548,_0x233d52){_0x40d548=_0x40d548-0x0;var _0x1791f8=_0x1261[_0x40d548];return _0x1791f8;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 5a6d7aa..a5c4e47 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 _0xdf55=['/:id/messages','getMessages','create','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x56fc9f,_0x35633e){var _0x508e76=function(_0x1da2e1){while(--_0x1da2e1){_0x56fc9f['push'](_0x56fc9f['shift']());}};_0x508e76(++_0x35633e);}(_0xdf55,0x83));var _0x5df5=function(_0x3a7490,_0x265112){_0x3a7490=_0x3a7490-0x0;var _0x4209ab=_0xdf55[_0x3a7490];return _0x4209ab;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5df5('0xf')]);router['put'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller['update']);router['delete'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x10')]);module[_0x5df5('0x11')]=router; \ No newline at end of file +var _0xc2c7=['../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages','getMessages','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x492f01,_0x3b9e9a){var _0x2eed00=function(_0x110e79){while(--_0x110e79){_0x492f01['push'](_0x492f01['shift']());}};_0x2eed00(++_0x3b9e9a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4e8daf,_0x421153){_0x4e8daf=_0x4e8daf-0x0;var _0x530ca3=_0xc2c7[_0x4e8daf];return _0x530ca3;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x11')]);router[_0x7c2c('0x12')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x13')]);module[_0x7c2c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 431b7a0..6ee7fd7 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 _0x0c06=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x0c06,0x18f));var _0x60c0=function(_0x4ee02b,_0x1d95c0){_0x4ee02b=_0x4ee02b-0x0;var _0x49a802=_0x0c06[_0x4ee02b];return _0x49a802;};'use strict';var Sequelize=require(_0x60c0('0x0'));module[_0x60c0('0x1')]={'customer_id':{'type':Sequelize[_0x60c0('0x2')]},'context':{'type':Sequelize[_0x60c0('0x2')],'defaultValue':_0x60c0('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x60c0('0x2')],'defaultValue':'','allowNull':![],'unique':_0x60c0('0x4')},'password':{'type':Sequelize[_0x60c0('0x2')]},'fullname':{'type':Sequelize[_0x60c0('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x473d6e){this[_0x60c0('0x5')](_0x60c0('0x6'),typeof _0x473d6e===_0x60c0('0x7')&&_0x473d6e[_0x60c0('0x8')]()?_0x473d6e[_0x60c0('0x8')]():null);}},'pager':{'type':Sequelize[_0x60c0('0x2')]},'tz':{'type':Sequelize[_0x60c0('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':_0x60c0('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x60c0('0x2')]},'review':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x60c0('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':_0x60c0('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x60c0('0x9')](_0x60c0('0xa'),'no'),'defaultValue':_0x60c0('0xa'),'allowNull':![]},'stamp':{'type':_0x60c0('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x60c0('0x2')]},'maxsecs':{'type':Sequelize[_0x60c0('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x60c0('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x60c0('0xe')],'get':function(){return this['getDataValue'](_0x60c0('0xf'))+_0x60c0('0x10')+this[_0x60c0('0x11')](_0x60c0('0x12'));}}}; \ No newline at end of file +var _0x6a69=['yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x206867,_0x5063df){var _0x3d2f9b=function(_0x1d75a6){while(--_0x1d75a6){_0x206867['push'](_0x206867['shift']());}};_0x3d2f9b(++_0x5063df);}(_0x6a69,0xc7));var _0x96a6=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x6a69[_0x5ac84c];return _0x3c53d2;};'use strict';var Sequelize=require('sequelize');module[_0x96a6('0x0')]={'customer_id':{'type':Sequelize[_0x96a6('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x96a6('0x2'),'unique':_0x96a6('0x3')},'mailbox':{'type':Sequelize[_0x96a6('0x1')],'defaultValue':'','allowNull':![],'unique':_0x96a6('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x96a6('0x1')]},'email':{'type':Sequelize[_0x96a6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x287a0c){this[_0x96a6('0x4')](_0x96a6('0x5'),typeof _0x287a0c===_0x96a6('0x6')&&_0x287a0c[_0x96a6('0x7')]()?_0x287a0c[_0x96a6('0x7')]():null);}},'pager':{'type':Sequelize[_0x96a6('0x1')]},'tz':{'type':Sequelize[_0x96a6('0x1')],'defaultValue':_0x96a6('0x8')},'attach':{'type':Sequelize[_0x96a6('0x9')]('yes','no'),'defaultValue':_0x96a6('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x96a6('0x9')]('yes','no'),'defaultValue':_0x96a6('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x96a6('0x1')]},'callback':{'type':Sequelize[_0x96a6('0x1')]},'review':{'type':Sequelize[_0x96a6('0x9')](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x96a6('0x9')](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x96a6('0x9')](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x96a6('0x9')](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x96a6('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x96a6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x96a6('0x9')]('yes','no'),'defaultValue':_0x96a6('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x96a6('0x9')](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x96a6('0x9')](_0x96a6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x96a6('0xa'),'no'),'defaultValue':_0x96a6('0xa'),'allowNull':![]},'stamp':{'type':_0x96a6('0xc')},'emailsubject':{'type':Sequelize[_0x96a6('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x96a6('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x96a6('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x96a6('0xe')],'get':function(){return this[_0x96a6('0xf')](_0x96a6('0x10'))+_0x96a6('0x11')+this[_0x96a6('0xf')](_0x96a6('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 596f6a1..577dff5 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 _0x2547=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','options','includeAll','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','sort','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','error','stack','name','send','VoiceMail','rawAttributes','fieldName','type'];(function(_0x3d0ee4,_0x6b9bb2){var _0x47cb21=function(_0x140a5b){while(--_0x140a5b){_0x3d0ee4['push'](_0x3d0ee4['shift']());}};_0x47cb21(++_0x6b9bb2);}(_0x2547,0x1cd));var _0x7254=function(_0x8f5219,_0x455a12){_0x8f5219=_0x8f5219-0x0;var _0x3b9499=_0x2547[_0x8f5219];return _0x3b9499;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){var _0x54dace=_0x136ea3[_0x7254('0x27')]({'plain':!![]});var _0x36b5d5=_0x7254('0x28');return db['UserProfileResource'][_0x7254('0x26')]({'where':{'type':_0x36b5d5,'resourceId':_0x54dace['id']}})[_0x7254('0x25')](function(){return _0x136ea3;});})[_0x7254('0x25')](function(){_0x50c34b['status'](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x594a63,_0x1bb6a7){return function(_0x134a9e){if(!_0x134a9e){_0x594a63['sendStatus'](0x194);}return _0x134a9e;};}function handleError(_0x17bb46,_0x158356){_0x158356=_0x158356||0x1f4;return function(_0x4f684c){logger[_0x7254('0x29')](_0x4f684c[_0x7254('0x2a')]);if(_0x4f684c[_0x7254('0x2b')]){delete _0x4f684c[_0x7254('0x2b')];}_0x17bb46[_0x7254('0x18')](_0x158356)[_0x7254('0x2c')](_0x4f684c);};}exports['index']=function(_0x146028,_0x2dba3f){var _0x5569be={},_0x2f75ea={},_0x1279cd={'count':0x0,'rows':[]};var _0x2be5fc=_['map'](db[_0x7254('0x2d')][_0x7254('0x2e')],function(_0x354305){return{'name':_0x354305[_0x7254('0x2f')],'type':_0x354305[_0x7254('0x30')][_0x7254('0x31')]};});_0x2f75ea[_0x7254('0x32')]=_['map'](_0x2be5fc,_0x7254('0x2b'));_0x2f75ea['query']=_['keys'](_0x146028[_0x7254('0x33')]);_0x2f75ea[_0x7254('0x34')]=_[_0x7254('0x35')](_0x2f75ea[_0x7254('0x32')],_0x2f75ea[_0x7254('0x33')]);_0x5569be[_0x7254('0x36')]=_[_0x7254('0x35')](_0x2f75ea[_0x7254('0x32')],qs[_0x7254('0x37')](_0x146028[_0x7254('0x33')][_0x7254('0x37')]));_0x5569be[_0x7254('0x36')]=_0x5569be[_0x7254('0x36')][_0x7254('0x38')]?_0x5569be['attributes']:_0x2f75ea[_0x7254('0x32')];if(!_0x146028[_0x7254('0x33')][_0x7254('0x39')](_0x7254('0x3a'))){_0x5569be[_0x7254('0x1d')]=qs['limit'](_0x146028[_0x7254('0x33')]['limit']);_0x5569be[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x146028[_0x7254('0x33')][_0x7254('0x1b')]);}_0x5569be[_0x7254('0x3b')]=qs['sort'](_0x146028[_0x7254('0x33')]['sort']);_0x5569be[_0x7254('0x3c')]=qs[_0x7254('0x34')](_['pick'](_0x146028[_0x7254('0x33')],_0x2f75ea[_0x7254('0x34')]),_0x2be5fc);if(_0x146028[_0x7254('0x33')][_0x7254('0x3d')]){_0x5569be[_0x7254('0x3c')]=_[_0x7254('0x3e')](_0x5569be['where'],{'$or':_[_0x7254('0x3f')](_0x2be5fc,function(_0x102d87){if(_0x102d87[_0x7254('0x30')]!=='VIRTUAL'){var _0x3fbad7={};_0x3fbad7[_0x102d87[_0x7254('0x2b')]]={'$like':'%'+_0x146028[_0x7254('0x33')]['filter']+'%'};return _0x3fbad7;}})});}_0x5569be=_[_0x7254('0x3e')]({},_0x5569be,_0x146028[_0x7254('0x40')]);var _0x18a918={'where':_0x5569be[_0x7254('0x3c')]};return db[_0x7254('0x2d')]['count'](_0x18a918)['then'](function(_0x25004f){_0x1279cd[_0x7254('0x1e')]=_0x25004f;if(_0x146028[_0x7254('0x33')][_0x7254('0x41')]){_0x5569be['include']=[{'all':!![]}];}return db['VoiceMail'][_0x7254('0x42')](_0x5569be);})['then'](function(_0x2ae22e){_0x1279cd[_0x7254('0x43')]=_0x2ae22e;return _0x1279cd;})[_0x7254('0x25')](respondWithFilteredResult(_0x2dba3f,_0x5569be))[_0x7254('0x44')](handleError(_0x2dba3f,null));};exports['show']=function(_0x4adf34,_0x467f31){var _0x3f6ead={'raw':!![],'where':{'id':_0x4adf34[_0x7254('0x45')]['id']}},_0x29b90c={};_0x29b90c[_0x7254('0x32')]=_['keys'](db['VoiceMail'][_0x7254('0x2e')]);_0x29b90c[_0x7254('0x33')]=_[_0x7254('0x46')](_0x4adf34['query']);_0x29b90c[_0x7254('0x34')]=_[_0x7254('0x35')](_0x29b90c['model'],_0x29b90c[_0x7254('0x33')]);_0x3f6ead[_0x7254('0x36')]=_[_0x7254('0x35')](_0x29b90c[_0x7254('0x32')],qs['fields'](_0x4adf34[_0x7254('0x33')][_0x7254('0x37')]));_0x3f6ead['attributes']=_0x3f6ead[_0x7254('0x36')][_0x7254('0x38')]?_0x3f6ead[_0x7254('0x36')]:_0x29b90c['model'];if(_0x4adf34[_0x7254('0x33')][_0x7254('0x41')]){_0x3f6ead['include']=[{'all':!![]}];}_0x3f6ead=_['merge']({},_0x3f6ead,_0x4adf34[_0x7254('0x40')]);return db['VoiceMail'][_0x7254('0x47')](_0x3f6ead)[_0x7254('0x25')](handleEntityNotFound(_0x467f31,null))['then'](respondWithResult(_0x467f31,null))['catch'](handleError(_0x467f31,null));};exports[_0x7254('0x48')]=function(_0xc40bc5,_0x38bcd5){return db[_0x7254('0x2d')][_0x7254('0x48')](_0xc40bc5[_0x7254('0x49')],{})['then'](function(_0x245213){var _0x5ef7f9=_0xc40bc5[_0x7254('0x4a')][_0x7254('0x27')]({'plain':!![]});if(!_0x5ef7f9)throw new Error(_0x7254('0x4b'));if(_0x5ef7f9['role']===_0x7254('0x4a')){var _0x1c1a0e=_0x245213[_0x7254('0x27')]({'plain':!![]});var _0x5b3b6e=_0x7254('0x28');return db[_0x7254('0x4c')][_0x7254('0x47')]({'where':{'name':_0x5b3b6e,'userProfileId':_0x5ef7f9[_0x7254('0x4d')]},'raw':!![]})[_0x7254('0x25')](function(_0x4e1e38){if(_0x4e1e38&&_0x4e1e38['autoAssociation']===0x0){return db[_0x7254('0x4e')][_0x7254('0x48')]({'name':_0x1c1a0e[_0x7254('0x2b')],'resourceId':_0x1c1a0e['id'],'type':_0x4e1e38[_0x7254('0x2b')],'sectionId':_0x4e1e38['id']},{})[_0x7254('0x25')](function(){return _0x245213;});}else{return _0x245213;}})['catch'](function(_0x5a44fb){logger[_0x7254('0x29')](_0x7254('0x4f'),_0x5a44fb);throw _0x5a44fb;});}return _0x245213;})[_0x7254('0x25')](respondWithResult(_0x38bcd5,0xc9))[_0x7254('0x44')](handleError(_0x38bcd5,null));};exports['update']=function(_0xaf6d3d,_0x3e3d09){if(_0xaf6d3d['body']['id']){delete _0xaf6d3d[_0x7254('0x49')]['id'];}return db['VoiceMail'][_0x7254('0x47')]({'where':{'id':_0xaf6d3d['params']['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x3e3d09,null))['then'](saveUpdates(_0xaf6d3d['body'],null))[_0x7254('0x25')](respondWithResult(_0x3e3d09,null))[_0x7254('0x44')](handleError(_0x3e3d09,null));};exports[_0x7254('0x26')]=function(_0x1122e8,_0x4f6c9f){return db[_0x7254('0x2d')]['find']({'where':{'id':_0x1122e8[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x4f6c9f,null))[_0x7254('0x25')](removeEntity(_0x4f6c9f,null))[_0x7254('0x44')](handleError(_0x4f6c9f,null));};exports[_0x7254('0x50')]=function(_0x283da0,_0x48b69a,_0x1ca394){return db[_0x7254('0x2d')][_0x7254('0x51')]({'where':{'id':_0x283da0[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x48b69a,null))[_0x7254('0x25')](function(_0x556cad){var _0x2fe0b2;var _0x457f71={},_0x215304={};_0x215304[_0x7254('0x32')]=_[_0x7254('0x46')](db[_0x7254('0x52')][_0x7254('0x2e')]);_0x215304['query']=_['keys'](_0x283da0[_0x7254('0x33')]);_0x215304['filters']=_['intersection'](_0x215304[_0x7254('0x32')],_0x215304[_0x7254('0x33')]);_0x457f71[_0x7254('0x36')]=_['intersection'](_0x215304[_0x7254('0x32')],qs['fields'](_0x283da0[_0x7254('0x33')][_0x7254('0x37')]));_0x457f71[_0x7254('0x36')]=_0x457f71[_0x7254('0x36')][_0x7254('0x38')]?_0x457f71['attributes']:_0x215304[_0x7254('0x32')];if(!_0x283da0[_0x7254('0x33')][_0x7254('0x39')](_0x7254('0x3a'))){_0x457f71['limit']=qs['limit'](_0x283da0[_0x7254('0x33')][_0x7254('0x1d')]);_0x457f71[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x283da0[_0x7254('0x33')][_0x7254('0x1b')]);}_0x457f71[_0x7254('0x3b')]=qs[_0x7254('0x53')](_0x283da0[_0x7254('0x33')][_0x7254('0x53')]);_0x457f71[_0x7254('0x3c')]=qs[_0x7254('0x34')](_[_0x7254('0x54')](_0x283da0['query'],_0x215304[_0x7254('0x34')]));if(_0x283da0[_0x7254('0x33')][_0x7254('0x3d')]){_0x457f71['where']=_[_0x7254('0x3e')](_0x457f71[_0x7254('0x3c')],{'$or':_[_0x7254('0x3f')](_0x457f71[_0x7254('0x36')],function(_0x49f62d){var _0x1d9238={};_0x1d9238[_0x49f62d]={'$like':'%'+_0x283da0['query'][_0x7254('0x3d')]+'%'};return _0x1d9238;})});}_0x457f71[_0x7254('0x3c')]=_[_0x7254('0x3e')](_0x457f71[_0x7254('0x3c')],{'mailboxuser':_0x556cad['mailbox']});_0x457f71=_[_0x7254('0x3e')]({},_0x457f71,_0x283da0['options']);return db[_0x7254('0x52')]['findAndCountAll'](_0x457f71)[_0x7254('0x25')](respondWithFilteredResult(_0x48b69a,_0x457f71));})[_0x7254('0x44')](handleError(_0x48b69a,null));}; \ No newline at end of file +var _0x282b=['json','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','VoiceMail','includeAll','include','findAll','catch','show','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x282b,0xec));var _0xb282=function(_0x111821,_0x1180e4){_0x111821=_0x111821-0x0;var _0x516ef6=_0x282b[_0x111821];return _0x516ef6;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){var _0x5e828e=_0x360f15[_0xb282('0x25')]({'plain':!![]});var _0x114f77=_0xb282('0x26');return db[_0xb282('0x27')][_0xb282('0x24')]({'where':{'type':_0x114f77,'resourceId':_0x5e828e['id']}})[_0xb282('0x23')](function(){return _0x360f15;});})['then'](function(){_0x56645f[_0xb282('0x18')](0xcc)[_0xb282('0x28')]();});}};}function handleEntityNotFound(_0x50bd73,_0x22d895){return function(_0x38a1f8){if(!_0x38a1f8){_0x50bd73[_0xb282('0x17')](0x194);}return _0x38a1f8;};}function handleError(_0x280940,_0x59644e){_0x59644e=_0x59644e||0x1f4;return function(_0x1520b1){logger[_0xb282('0x29')](_0x1520b1[_0xb282('0x2a')]);if(_0x1520b1[_0xb282('0x2b')]){delete _0x1520b1[_0xb282('0x2b')];}_0x280940[_0xb282('0x18')](_0x59644e)[_0xb282('0x2c')](_0x1520b1);};}exports['index']=function(_0x1b15b5,_0x1e2861){var _0x3eb294={},_0xd8780b={},_0x42ef75={'count':0x0,'rows':[]};var _0x5f3ddf=_[_0xb282('0x2d')](db['VoiceMail'][_0xb282('0x2e')],function(_0x1bf721){return{'name':_0x1bf721[_0xb282('0x2f')],'type':_0x1bf721['type'][_0xb282('0x30')]};});_0xd8780b['model']=_[_0xb282('0x2d')](_0x5f3ddf,_0xb282('0x2b'));_0xd8780b[_0xb282('0x31')]=_[_0xb282('0x32')](_0x1b15b5[_0xb282('0x31')]);_0xd8780b[_0xb282('0x33')]=_['intersection'](_0xd8780b[_0xb282('0x34')],_0xd8780b[_0xb282('0x31')]);_0x3eb294['attributes']=_['intersection'](_0xd8780b[_0xb282('0x34')],qs[_0xb282('0x35')](_0x1b15b5[_0xb282('0x31')]['fields']));_0x3eb294['attributes']=_0x3eb294['attributes'][_0xb282('0x36')]?_0x3eb294[_0xb282('0x37')]:_0xd8780b[_0xb282('0x34')];if(!_0x1b15b5[_0xb282('0x31')][_0xb282('0x38')](_0xb282('0x39'))){_0x3eb294[_0xb282('0x1b')]=qs['limit'](_0x1b15b5[_0xb282('0x31')]['limit']);_0x3eb294[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1b15b5[_0xb282('0x31')]['offset']);}_0x3eb294[_0xb282('0x3a')]=qs['sort'](_0x1b15b5[_0xb282('0x31')][_0xb282('0x3b')]);_0x3eb294[_0xb282('0x3c')]=qs[_0xb282('0x33')](_['pick'](_0x1b15b5['query'],_0xd8780b[_0xb282('0x33')]),_0x5f3ddf);if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]){_0x3eb294[_0xb282('0x3c')]=_['merge'](_0x3eb294[_0xb282('0x3c')],{'$or':_['map'](_0x5f3ddf,function(_0x475895){if(_0x475895[_0xb282('0x3e')]!=='VIRTUAL'){var _0x41f2c4={};_0x41f2c4[_0x475895[_0xb282('0x2b')]]={'$like':'%'+_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]+'%'};return _0x41f2c4;}})});}_0x3eb294=_[_0xb282('0x3f')]({},_0x3eb294,_0x1b15b5[_0xb282('0x40')]);var _0x43e87e={'where':_0x3eb294[_0xb282('0x3c')]};return db[_0xb282('0x41')][_0xb282('0x1c')](_0x43e87e)[_0xb282('0x23')](function(_0x91fe43){_0x42ef75[_0xb282('0x1c')]=_0x91fe43;if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x42')]){_0x3eb294[_0xb282('0x43')]=[{'all':!![]}];}return db[_0xb282('0x41')][_0xb282('0x44')](_0x3eb294);})['then'](function(_0x310ad1){_0x42ef75['rows']=_0x310ad1;return _0x42ef75;})[_0xb282('0x23')](respondWithFilteredResult(_0x1e2861,_0x3eb294))[_0xb282('0x45')](handleError(_0x1e2861,null));};exports[_0xb282('0x46')]=function(_0x2f2ce8,_0x197472){var _0x3ddf56={'raw':!![],'where':{'id':_0x2f2ce8['params']['id']}},_0x5a6c0d={};_0x5a6c0d[_0xb282('0x34')]=_['keys'](db[_0xb282('0x41')][_0xb282('0x2e')]);_0x5a6c0d['query']=_[_0xb282('0x32')](_0x2f2ce8[_0xb282('0x31')]);_0x5a6c0d[_0xb282('0x33')]=_['intersection'](_0x5a6c0d['model'],_0x5a6c0d[_0xb282('0x31')]);_0x3ddf56['attributes']=_[_0xb282('0x47')](_0x5a6c0d[_0xb282('0x34')],qs[_0xb282('0x35')](_0x2f2ce8[_0xb282('0x31')][_0xb282('0x35')]));_0x3ddf56[_0xb282('0x37')]=_0x3ddf56['attributes'][_0xb282('0x36')]?_0x3ddf56[_0xb282('0x37')]:_0x5a6c0d[_0xb282('0x34')];if(_0x2f2ce8['query'][_0xb282('0x42')]){_0x3ddf56['include']=[{'all':!![]}];}_0x3ddf56=_[_0xb282('0x3f')]({},_0x3ddf56,_0x2f2ce8['options']);return db[_0xb282('0x41')]['find'](_0x3ddf56)['then'](handleEntityNotFound(_0x197472,null))['then'](respondWithResult(_0x197472,null))[_0xb282('0x45')](handleError(_0x197472,null));};exports[_0xb282('0x48')]=function(_0x42d99f,_0x7a5aa4){return db['VoiceMail']['create'](_0x42d99f['body'],{})[_0xb282('0x23')](function(_0x255ad5){var _0x3bed8d=_0x42d99f[_0xb282('0x49')]['get']({'plain':!![]});if(!_0x3bed8d)throw new Error(_0xb282('0x4a'));if(_0x3bed8d[_0xb282('0x4b')]==='user'){var _0x33bded=_0x255ad5[_0xb282('0x25')]({'plain':!![]});var _0x16f66b=_0xb282('0x26');return db[_0xb282('0x4c')]['find']({'where':{'name':_0x16f66b,'userProfileId':_0x3bed8d[_0xb282('0x4d')]},'raw':!![]})[_0xb282('0x23')](function(_0x465209){if(_0x465209&&_0x465209[_0xb282('0x4e')]===0x0){return db[_0xb282('0x27')][_0xb282('0x48')]({'name':_0x33bded['name'],'resourceId':_0x33bded['id'],'type':_0x465209[_0xb282('0x2b')],'sectionId':_0x465209['id']},{})['then'](function(){return _0x255ad5;});}else{return _0x255ad5;}})[_0xb282('0x45')](function(_0x1e6ade){logger['error'](_0xb282('0x4f'),_0x1e6ade);throw _0x1e6ade;});}return _0x255ad5;})[_0xb282('0x23')](respondWithResult(_0x7a5aa4,0xc9))[_0xb282('0x45')](handleError(_0x7a5aa4,null));};exports['update']=function(_0x51cbb0,_0x1028b9){if(_0x51cbb0[_0xb282('0x50')]['id']){delete _0x51cbb0[_0xb282('0x50')]['id'];}return db['VoiceMail'][_0xb282('0x51')]({'where':{'id':_0x51cbb0['params']['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x1028b9,null))[_0xb282('0x23')](saveUpdates(_0x51cbb0['body'],null))[_0xb282('0x23')](respondWithResult(_0x1028b9,null))['catch'](handleError(_0x1028b9,null));};exports[_0xb282('0x24')]=function(_0x34b31a,_0x2e6eaa){return db[_0xb282('0x41')][_0xb282('0x51')]({'where':{'id':_0x34b31a[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e6eaa,null))[_0xb282('0x23')](removeEntity(_0x2e6eaa,null))['catch'](handleError(_0x2e6eaa,null));};exports[_0xb282('0x53')]=function(_0x34baf2,_0x53d50a,_0x597793){return db[_0xb282('0x41')][_0xb282('0x54')]({'where':{'id':_0x34baf2[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x53d50a,null))['then'](function(_0x40ae87){var _0x2dbbc4;var _0x3716b0={},_0x5d6a78={};_0x5d6a78[_0xb282('0x34')]=_['keys'](db[_0xb282('0x55')][_0xb282('0x2e')]);_0x5d6a78[_0xb282('0x31')]=_[_0xb282('0x32')](_0x34baf2[_0xb282('0x31')]);_0x5d6a78[_0xb282('0x33')]=_[_0xb282('0x47')](_0x5d6a78['model'],_0x5d6a78[_0xb282('0x31')]);_0x3716b0[_0xb282('0x37')]=_[_0xb282('0x47')](_0x5d6a78['model'],qs['fields'](_0x34baf2[_0xb282('0x31')][_0xb282('0x35')]));_0x3716b0[_0xb282('0x37')]=_0x3716b0['attributes']['length']?_0x3716b0[_0xb282('0x37')]:_0x5d6a78[_0xb282('0x34')];if(!_0x34baf2['query'][_0xb282('0x38')](_0xb282('0x39'))){_0x3716b0[_0xb282('0x1b')]=qs['limit'](_0x34baf2[_0xb282('0x31')][_0xb282('0x1b')]);_0x3716b0['offset']=qs[_0xb282('0x19')](_0x34baf2[_0xb282('0x31')][_0xb282('0x19')]);}_0x3716b0[_0xb282('0x3a')]=qs['sort'](_0x34baf2['query'][_0xb282('0x3b')]);_0x3716b0[_0xb282('0x3c')]=qs['filters'](_[_0xb282('0x56')](_0x34baf2[_0xb282('0x31')],_0x5d6a78[_0xb282('0x33')]));if(_0x34baf2[_0xb282('0x31')][_0xb282('0x3d')]){_0x3716b0[_0xb282('0x3c')]=_[_0xb282('0x3f')](_0x3716b0[_0xb282('0x3c')],{'$or':_['map'](_0x3716b0[_0xb282('0x37')],function(_0xb22721){var _0x18f33d={};_0x18f33d[_0xb22721]={'$like':'%'+_0x34baf2['query'][_0xb282('0x3d')]+'%'};return _0x18f33d;})});}_0x3716b0[_0xb282('0x3c')]=_['merge'](_0x3716b0['where'],{'mailboxuser':_0x40ae87[_0xb282('0x57')]});_0x3716b0=_[_0xb282('0x3f')]({},_0x3716b0,_0x34baf2[_0xb282('0x40')]);return db[_0xb282('0x55')][_0xb282('0x58')](_0x3716b0)[_0xb282('0x23')](respondWithFilteredResult(_0x53d50a,_0x3716b0));})[_0xb282('0x45')](handleError(_0x53d50a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index a6660fe..26e33bf 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 _0x04e0=['exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x3fb135,_0xa2bc39){var _0x1120fb=function(_0x298f9d){while(--_0x298f9d){_0x3fb135['push'](_0x3fb135['shift']());}};_0x1120fb(++_0xa2bc39);}(_0x04e0,0x1ce));var _0x004e=function(_0x510466,_0x8b7cfc){_0x510466=_0x510466-0x0;var _0xef43c7=_0x04e0[_0x510466];return _0xef43c7;};'use strict';var _=require(_0x004e('0x0'));var util=require(_0x004e('0x1'));var logger=require('../../config/logger')(_0x004e('0x2'));var moment=require('moment');var BPromise=require(_0x004e('0x3'));var rp=require(_0x004e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x004e('0x5'));var attributes=require('./voiceMail.attributes');module[_0x004e('0x6')]=function(_0x252f22,_0x2ecbf7){return _0x252f22[_0x004e('0x7')](_0x004e('0x8'),attributes,{'tableName':_0x004e('0x9'),'paranoid':![],'indexes':[{'name':_0x004e('0xa'),'fields':['mailbox',_0x004e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x59f4=['lodash','api','moment','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x4774ac,_0x2f0c40){var _0x2a74f7=function(_0x140428){while(--_0x140428){_0x4774ac['push'](_0x4774ac['shift']());}};_0x2a74f7(++_0x2f0c40);}(_0x59f4,0x152));var _0x459f=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x59f4[_0x3cb6dc];return _0x47ec89;};'use strict';var _=require(_0x459f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x459f('0x1'));var moment=require(_0x459f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x459f('0x3'));var rimraf=require(_0x459f('0x4'));var config=require('../../config/environment');var attributes=require(_0x459f('0x5'));module[_0x459f('0x6')]=function(_0x2152dd,_0x3eca0c){return _0x2152dd[_0x459f('0x7')](_0x459f('0x8'),attributes,{'tableName':_0x459f('0x9'),'paranoid':![],'indexes':[{'name':_0x459f('0xa'),'fields':[_0x459f('0xb'),_0x459f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 48f95ca..5b80a0a 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 _0x368c=['rpc','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3e7b59,_0x14a4cd){var _0x4bd64a=function(_0x144656){while(--_0x144656){_0x3e7b59['push'](_0x3e7b59['shift']());}};_0x4bd64a(++_0x14a4cd);}(_0x368c,0x14d));var _0xc368=function(_0x1e0c74,_0x1aca43){_0x1e0c74=_0x1e0c74-0x0;var _0x31dee8=_0x368c[_0x1e0c74];return _0x31dee8;};'use strict';var _=require(_0xc368('0x0'));var util=require('util');var moment=require(_0xc368('0x1'));var BPromise=require(_0xc368('0x2'));var rs=require(_0xc368('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc368('0x4'))['db'];var utils=require(_0xc368('0x5'));var logger=require(_0xc368('0x6'))(_0xc368('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc368('0x8')][_0xc368('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3003,_0x1e5e06,_0x5ead77){return new BPromise(function(_0x23755f,_0x1266db){return client['request'](_0x4c3003,_0x5ead77)[_0xc368('0xa')](function(_0x530e6a){logger[_0xc368('0xb')](_0xc368('0xc'),_0x1e5e06,_0xc368('0xd'));logger[_0xc368('0xe')](_0xc368('0xf'),_0x1e5e06,_0xc368('0xd'),JSON[_0xc368('0x10')](_0x530e6a));if(_0x530e6a[_0xc368('0x11')]){if(_0x530e6a[_0xc368('0x11')][_0xc368('0x12')]===0x1f4){logger['error'](_0xc368('0xc'),_0x1e5e06,_0x530e6a[_0xc368('0x11')][_0xc368('0x13')]);return _0x1266db(_0x530e6a[_0xc368('0x11')]['message']);}logger[_0xc368('0x11')](_0xc368('0xc'),_0x1e5e06,_0x530e6a[_0xc368('0x11')]['message']);return _0x23755f(_0x530e6a[_0xc368('0x11')][_0xc368('0x13')]);}else{logger[_0xc368('0xb')](_0xc368('0xc'),_0x1e5e06,_0xc368('0xd'));_0x23755f(_0x530e6a['result'][_0xc368('0x13')]);}})['catch'](function(_0x8db9b2){logger['error'](_0xc368('0xc'),_0x1e5e06,_0x8db9b2);_0x1266db(_0x8db9b2);});});} \ No newline at end of file +var _0x7d3f=['then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x278051,_0x317025){var _0x21b307=function(_0x22f8bc){while(--_0x22f8bc){_0x278051['push'](_0x278051['shift']());}};_0x21b307(++_0x317025);}(_0x7d3f,0xcf));var _0xf7d3=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x7d3f[_0x4bd67a];return _0x2be5fb;};'use strict';var _=require(_0xf7d3('0x0'));var util=require(_0xf7d3('0x1'));var moment=require(_0xf7d3('0x2'));var BPromise=require(_0xf7d3('0x3'));var rs=require(_0xf7d3('0x4'));var fs=require('fs');var Redis=require(_0xf7d3('0x5'));var db=require(_0xf7d3('0x6'))['db'];var utils=require(_0xf7d3('0x7'));var logger=require(_0xf7d3('0x8'))(_0xf7d3('0x9'));var config=require(_0xf7d3('0xa'));var jayson=require(_0xf7d3('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cf533,_0x2c5eae,_0x590487){return new BPromise(function(_0x42c682,_0x2a25db){return client[_0xf7d3('0xc')](_0x5cf533,_0x590487)[_0xf7d3('0xd')](function(_0x2a5e3d){logger[_0xf7d3('0xe')](_0xf7d3('0xf'),_0x2c5eae,_0xf7d3('0x10'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2c5eae,_0xf7d3('0x10'),JSON[_0xf7d3('0x11')](_0x2a5e3d));if(_0x2a5e3d['error']){if(_0x2a5e3d[_0xf7d3('0x12')]['code']===0x1f4){logger[_0xf7d3('0x12')](_0xf7d3('0xf'),_0x2c5eae,_0x2a5e3d[_0xf7d3('0x12')][_0xf7d3('0x13')]);return _0x2a25db(_0x2a5e3d[_0xf7d3('0x12')][_0xf7d3('0x13')]);}logger[_0xf7d3('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2c5eae,_0x2a5e3d['error'][_0xf7d3('0x13')]);return _0x42c682(_0x2a5e3d[_0xf7d3('0x12')][_0xf7d3('0x13')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x2c5eae,_0xf7d3('0x10'));_0x42c682(_0x2a5e3d[_0xf7d3('0x14')][_0xf7d3('0x13')]);}})[_0xf7d3('0x15')](function(_0x37126a){logger[_0xf7d3('0x12')](_0xf7d3('0xf'),_0x2c5eae,_0x37126a);_0x2a25db(_0x37126a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 68f7785..7aacd92 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 _0x729d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x729d,0x163));var _0xd729=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x729d[_0x3b2369];return _0x5a1367;};'use strict';var multer=require(_0xd729('0x0'));var util=require(_0xd729('0x1'));var path=require('path');var timeout=require(_0xd729('0x2'));var express=require(_0xd729('0x3'));var router=express[_0xd729('0x4')]();var fs_extra=require(_0xd729('0x5'));var auth=require(_0xd729('0x6'));var interaction=require(_0xd729('0x7'));var config=require(_0xd729('0x8'));var controller=require(_0xd729('0x9'));router[_0xd729('0xa')]('/',auth[_0xd729('0xb')](),controller[_0xd729('0xc')]);router['get']('/:id',auth[_0xd729('0xb')](),controller[_0xd729('0xd')]);router[_0xd729('0xa')]('/:id/download',auth[_0xd729('0xb')](),controller[_0xd729('0xe')]);router[_0xd729('0xf')]('/',auth[_0xd729('0xb')](),controller['create']);router['put'](_0xd729('0x10'),auth[_0xd729('0xb')](),controller[_0xd729('0x11')]);router[_0xd729('0x12')](_0xd729('0x10'),auth[_0xd729('0xb')](),controller[_0xd729('0x13')]);module[_0xd729('0x14')]=router; \ No newline at end of file +var _0xb4f9=['get','isAuthenticated','index','/:id','/:id/download','download','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x16add4,_0x475d64){var _0x541f09=function(_0x38c92a){while(--_0x38c92a){_0x16add4['push'](_0x16add4['shift']());}};_0x541f09(++_0x475d64);}(_0xb4f9,0x1bf));var _0x9b4f=function(_0x2f1f08,_0x158f35){_0x2f1f08=_0x2f1f08-0x0;var _0x32f365=_0xb4f9[_0x2f1f08];return _0x32f365;};'use strict';var multer=require(_0x9b4f('0x0'));var util=require(_0x9b4f('0x1'));var path=require(_0x9b4f('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b4f('0x3'));var router=express[_0x9b4f('0x4')]();var fs_extra=require(_0x9b4f('0x5'));var auth=require(_0x9b4f('0x6'));var interaction=require(_0x9b4f('0x7'));var config=require(_0x9b4f('0x8'));var controller=require('./voiceMailMessage.controller');router[_0x9b4f('0x9')]('/',auth[_0x9b4f('0xa')](),controller[_0x9b4f('0xb')]);router['get'](_0x9b4f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9b4f('0x9')](_0x9b4f('0xd'),auth[_0x9b4f('0xa')](),controller[_0x9b4f('0xe')]);router['post']('/',auth[_0x9b4f('0xa')](),controller['create']);router['put'](_0x9b4f('0xc'),auth[_0x9b4f('0xa')](),controller[_0x9b4f('0xf')]);router[_0x9b4f('0x10')](_0x9b4f('0xc'),auth[_0x9b4f('0xa')](),controller[_0x9b4f('0x11')]);module[_0x9b4f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f738feb..3ef152e 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 _0x70c6=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','long'];(function(_0x336030,_0x4086ea){var _0x2b203b=function(_0x10b0ad){while(--_0x10b0ad){_0x336030['push'](_0x336030['shift']());}};_0x2b203b(++_0x4086ea);}(_0x70c6,0x81));var _0x670c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x70c6[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x670c('0x0'));module[_0x670c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4b24d9){return this[_0x670c('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x670c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x670c('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x670c('0x4')],'defaultValue':''},'stamp':{'type':_0x670c('0x6'),'defaultValue':Sequelize[_0x670c('0x7')](_0x670c('0x8'))}}; \ No newline at end of file +var _0x37bb=['INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x59a1be,_0x43e99e){var _0x3a8011=function(_0x3fc1a6){while(--_0x3fc1a6){_0x59a1be['push'](_0x59a1be['shift']());}};_0x3a8011(++_0x43e99e);}(_0x37bb,0x129));var _0xb37b=function(_0x5111c8,_0x55eec6){_0x5111c8=_0x5111c8-0x0;var _0x2cc3f7=_0x37bb[_0x5111c8];return _0x2cc3f7;};'use strict';var Sequelize=require(_0xb37b('0x0'));module[_0xb37b('0x1')]={'name':{'type':Sequelize[_0xb37b('0x2')],'get':function(_0x1bfc64){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xb37b('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb37b('0x5')](_0xb37b('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb37b('0x4')],'defaultValue':''},'stamp':{'type':_0xb37b('0x7'),'defaultValue':Sequelize[_0xb37b('0x8')](_0xb37b('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index eed283f..c091ee0 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 _0x6ff3=['send','index','map','rawAttributes','fieldName','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VoiceMailMessage','then','count','includeAll','include','findAll','show','find','catch','create','body','params','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment;\x20filename=\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','error','stack','name'];(function(_0x1f7acf,_0x41f5b2){var _0x403211=function(_0x252b7b){while(--_0x252b7b){_0x1f7acf['push'](_0x1f7acf['shift']());}};_0x403211(++_0x41f5b2);}(_0x6ff3,0xc7));var _0x36ff=function(_0x483d6a,_0x5c3688){_0x483d6a=_0x483d6a-0x0;var _0x2b9a4f=_0x6ff3[_0x483d6a];return _0x2b9a4f;};'use strict';var emlformat=require(_0x36ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36ff('0x1'));var jsonpatch=require(_0x36ff('0x2'));var rp=require(_0x36ff('0x3'));var moment=require(_0x36ff('0x4'));var BPromise=require(_0x36ff('0x5'));var Mustache=require(_0x36ff('0x6'));var util=require(_0x36ff('0x7'));var path=require(_0x36ff('0x8'));var sox=require('sox');var csv=require(_0x36ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36ff('0xa'));var squel=require('squel');var crypto=require(_0x36ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x36ff('0xc'));var toCsv=require(_0x36ff('0x9'));var querystring=require('querystring');var Papa=require(_0x36ff('0xd'));var Redis=require(_0x36ff('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x36ff('0xf'))(_0x36ff('0x10'));var utils=require('../../config/utils');var config=require(_0x36ff('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x36ff('0x12'))['db'];function respondWithStatusCode(_0x5f2597,_0x52692d){_0x52692d=_0x52692d||0xcc;return function(_0x14e172){if(_0x14e172){return _0x5f2597[_0x36ff('0x13')](_0x52692d);}return _0x5f2597[_0x36ff('0x14')](_0x52692d)[_0x36ff('0x15')]();};}function respondWithResult(_0x1c7466,_0x120253){_0x120253=_0x120253||0xc8;return function(_0x19ffa3){if(_0x19ffa3){return _0x1c7466[_0x36ff('0x14')](_0x120253)[_0x36ff('0x16')](_0x19ffa3);}};}function respondWithFilteredResult(_0x21480b,_0x52ae0d){return function(_0x4a3303){if(_0x4a3303){var _0x273c1d=typeof _0x52ae0d[_0x36ff('0x17')]===_0x36ff('0x18')&&typeof _0x52ae0d[_0x36ff('0x19')]===_0x36ff('0x18');var _0x5be502=_0x4a3303['count'];var _0x1662a4=_0x273c1d?0x0:_0x52ae0d[_0x36ff('0x17')];var _0x2281f1=_0x273c1d?_0x4a3303['count']:_0x52ae0d['offset']+_0x52ae0d[_0x36ff('0x19')];var _0x1d336b;if(_0x2281f1>=_0x5be502){_0x2281f1=_0x5be502;_0x1d336b=0xc8;}else{_0x1d336b=0xce;}_0x21480b[_0x36ff('0x14')](_0x1d336b);return _0x21480b[_0x36ff('0x1a')]('Content-Range',_0x1662a4+'-'+_0x2281f1+'/'+_0x5be502)[_0x36ff('0x16')](_0x4a3303);}return null;};}function patchUpdates(_0x2882f4){return function(_0x3ba8ae){try{jsonpatch[_0x36ff('0x1b')](_0x3ba8ae,_0x2882f4,!![]);}catch(_0x51cd47){return BPromise[_0x36ff('0x1c')](_0x51cd47);}return _0x3ba8ae[_0x36ff('0x1d')]();};}function saveUpdates(_0x39c1d2,_0x34de59){return function(_0x26a8a5){if(_0x26a8a5){return _0x26a8a5[_0x36ff('0x1e')](_0x39c1d2)['then'](function(_0x2ce1db){return _0x2ce1db;});}return null;};}function removeEntity(_0x55e70c,_0x433d42){return function(_0x17558e){if(_0x17558e){return _0x17558e[_0x36ff('0x1f')]()['then'](function(){_0x55e70c['status'](0xcc)[_0x36ff('0x15')]();});}};}function handleEntityNotFound(_0x7b34de,_0x93e743){return function(_0x5306ff){if(!_0x5306ff){_0x7b34de['sendStatus'](0x194);}return _0x5306ff;};}function handleError(_0x3d0f0b,_0xb1c3ed){_0xb1c3ed=_0xb1c3ed||0x1f4;return function(_0x4b1337){logger[_0x36ff('0x20')](_0x4b1337[_0x36ff('0x21')]);if(_0x4b1337[_0x36ff('0x22')]){delete _0x4b1337['name'];}_0x3d0f0b[_0x36ff('0x14')](_0xb1c3ed)[_0x36ff('0x23')](_0x4b1337);};}exports[_0x36ff('0x24')]=function(_0x5606ff,_0x2bc94c){var _0x7e185b={},_0x26f2dd={},_0x1d3fbf={'count':0x0,'rows':[]};var _0x246025=_[_0x36ff('0x25')](db['VoiceMailMessage'][_0x36ff('0x26')],function(_0x4014d1){return{'name':_0x4014d1[_0x36ff('0x27')],'type':_0x4014d1[_0x36ff('0x28')]['key']};});_0x26f2dd[_0x36ff('0x29')]=_[_0x36ff('0x2a')](_[_0x36ff('0x25')](_0x246025,'name'),[_0x36ff('0x22')]);_0x26f2dd[_0x36ff('0x2b')]=_[_0x36ff('0x2c')](_0x5606ff[_0x36ff('0x2b')]);_0x26f2dd[_0x36ff('0x2d')]=_[_0x36ff('0x2e')](_0x26f2dd[_0x36ff('0x29')],_0x26f2dd[_0x36ff('0x2b')]);_0x7e185b[_0x36ff('0x2f')]=_[_0x36ff('0x2e')](_0x26f2dd[_0x36ff('0x29')],qs[_0x36ff('0x30')](_0x5606ff[_0x36ff('0x2b')][_0x36ff('0x30')]));_0x7e185b['attributes']=_0x7e185b[_0x36ff('0x2f')][_0x36ff('0x31')]?_0x7e185b[_0x36ff('0x2f')]:_0x26f2dd[_0x36ff('0x29')];if(!_0x5606ff[_0x36ff('0x2b')][_0x36ff('0x32')](_0x36ff('0x33'))){_0x7e185b['limit']=qs[_0x36ff('0x19')](_0x5606ff[_0x36ff('0x2b')][_0x36ff('0x19')]);_0x7e185b[_0x36ff('0x17')]=qs['offset'](_0x5606ff['query']['offset']);}_0x7e185b[_0x36ff('0x34')]=qs[_0x36ff('0x35')](_0x5606ff[_0x36ff('0x2b')][_0x36ff('0x35')]);_0x7e185b[_0x36ff('0x36')]=qs[_0x36ff('0x2d')](_['pick'](_0x5606ff['query'],_0x26f2dd[_0x36ff('0x2d')]),_0x246025);if(_0x5606ff[_0x36ff('0x2b')][_0x36ff('0x37')]){_0x7e185b[_0x36ff('0x36')]=_[_0x36ff('0x38')](_0x7e185b[_0x36ff('0x36')],{'$or':_[_0x36ff('0x25')](_0x246025,function(_0x49ab7b){if(_0x49ab7b[_0x36ff('0x28')]!==_0x36ff('0x39')){var _0x786acf={};_0x786acf[_0x49ab7b[_0x36ff('0x22')]]={'$like':'%'+_0x5606ff[_0x36ff('0x2b')]['filter']+'%'};return _0x786acf;}})});}_0x7e185b=_['merge']({},_0x7e185b,_0x5606ff[_0x36ff('0x3a')]);var _0x1474c7={'where':_0x7e185b[_0x36ff('0x36')]};return db[_0x36ff('0x3b')]['count'](_0x1474c7)[_0x36ff('0x3c')](function(_0x1723e1){_0x1d3fbf[_0x36ff('0x3d')]=_0x1723e1;if(_0x5606ff[_0x36ff('0x2b')][_0x36ff('0x3e')]){_0x7e185b[_0x36ff('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x36ff('0x40')](_0x7e185b);})['then'](function(_0x21185d){_0x1d3fbf['rows']=_0x21185d;return _0x1d3fbf;})['then'](respondWithFilteredResult(_0x2bc94c,_0x7e185b))['catch'](handleError(_0x2bc94c,null));};exports[_0x36ff('0x41')]=function(_0x1eb7ec,_0x76c893){var _0x4a8903={'raw':!![],'where':{'id':_0x1eb7ec['params']['id']}},_0x4d99f5={};_0x4d99f5[_0x36ff('0x29')]=_['keys'](db[_0x36ff('0x3b')][_0x36ff('0x26')]);_0x4d99f5[_0x36ff('0x2b')]=_['keys'](_0x1eb7ec['query']);_0x4d99f5['filters']=_[_0x36ff('0x2e')](_0x4d99f5['model'],_0x4d99f5[_0x36ff('0x2b')]);_0x4a8903['attributes']=_[_0x36ff('0x2e')](_0x4d99f5['model'],qs['fields'](_0x1eb7ec['query'][_0x36ff('0x30')]));_0x4a8903[_0x36ff('0x2f')]=_0x4a8903[_0x36ff('0x2f')]['length']?_0x4a8903['attributes']:_0x4d99f5[_0x36ff('0x29')];if(_0x1eb7ec[_0x36ff('0x2b')][_0x36ff('0x3e')]){_0x4a8903[_0x36ff('0x3f')]=[{'all':!![]}];}_0x4a8903=_[_0x36ff('0x38')]({},_0x4a8903,_0x1eb7ec[_0x36ff('0x3a')]);return db[_0x36ff('0x3b')][_0x36ff('0x42')](_0x4a8903)['then'](handleEntityNotFound(_0x76c893,null))[_0x36ff('0x3c')](respondWithResult(_0x76c893,null))[_0x36ff('0x43')](handleError(_0x76c893,null));};exports[_0x36ff('0x44')]=function(_0x1a5e59,_0x4f0cda){return db['VoiceMailMessage'][_0x36ff('0x44')](_0x1a5e59[_0x36ff('0x45')],{})[_0x36ff('0x3c')](respondWithResult(_0x4f0cda,0xc9))['catch'](handleError(_0x4f0cda,null));};exports[_0x36ff('0x1e')]=function(_0x278ccb,_0x374afd){if(_0x278ccb[_0x36ff('0x45')]['id']){delete _0x278ccb['body']['id'];}return db[_0x36ff('0x3b')][_0x36ff('0x42')]({'where':{'id':_0x278ccb['params']['id']}})[_0x36ff('0x3c')](handleEntityNotFound(_0x374afd,null))['then'](saveUpdates(_0x278ccb['body'],null))[_0x36ff('0x3c')](respondWithResult(_0x374afd,null))['catch'](handleError(_0x374afd,null));};exports[_0x36ff('0x1f')]=function(_0x31fb7e,_0x36565a){return db[_0x36ff('0x3b')][_0x36ff('0x42')]({'where':{'id':_0x31fb7e[_0x36ff('0x46')]['id']}})[_0x36ff('0x3c')](handleEntityNotFound(_0x36565a,null))[_0x36ff('0x3c')](removeEntity(_0x36565a,null))['catch'](handleError(_0x36565a,null));};exports[_0x36ff('0x47')]=function(_0x2b7b73,_0x37d172,_0x2fe3c3){return db[_0x36ff('0x3b')][_0x36ff('0x42')]({'where':{'id':_0x2b7b73[_0x36ff('0x46')]['id']},'attributes':['id',_0x36ff('0x48'),_0x36ff('0x49')]})[_0x36ff('0x3c')](handleEntityNotFound(_0x37d172,null))[_0x36ff('0x3c')](function(_0x1a0de7){if(_0x1a0de7){if(!_0x1a0de7['recording']){throw new db[(_0x36ff('0x4a'))][(_0x36ff('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0x34fb11={'Content-Type':_0x36ff('0x4c'),'Content-Disposition':'attachment'};if(_0x1a0de7[_0x36ff('0x49')]){_0x34fb11['Content-Disposition']=_0x36ff('0x4d')+_0x1a0de7[_0x36ff('0x49')]+'.wav\x22';}_0x37d172['set'](_0x34fb11);return _0x37d172[_0x36ff('0x23')](new Buffer(_0x1a0de7[_0x36ff('0x48')]));}})[_0x36ff('0x43')](handleError(_0x37d172,null));}; \ No newline at end of file +var _0x9312=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','error','name','send','index','VoiceMailMessage','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','merge','where','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x18a835,_0x1678da){var _0x3117df=function(_0x4c34c3){while(--_0x4c34c3){_0x18a835['push'](_0x18a835['shift']());}};_0x3117df(++_0x1678da);}(_0x9312,0x1e4));var _0x2931=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x9312[_0x5e77db];return _0x34b675;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2931('0x0'));var zipdir=require(_0x2931('0x1'));var jsonpatch=require(_0x2931('0x2'));var rp=require(_0x2931('0x3'));var moment=require(_0x2931('0x4'));var BPromise=require(_0x2931('0x5'));var Mustache=require(_0x2931('0x6'));var util=require('util');var path=require(_0x2931('0x7'));var sox=require(_0x2931('0x8'));var csv=require(_0x2931('0x9'));var ejs=require(_0x2931('0xa'));var fs=require('fs');var fs_extra=require(_0x2931('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2931('0xc'));var jsforce=require(_0x2931('0xd'));var deskjs=require(_0x2931('0xe'));var toCsv=require(_0x2931('0x9'));var querystring=require('querystring');var Papa=require(_0x2931('0xf'));var Redis=require(_0x2931('0x10'));var authService=require(_0x2931('0x11'));var qs=require(_0x2931('0x12'));var as=require(_0x2931('0x13'));var hardwareService=require(_0x2931('0x14'));var logger=require(_0x2931('0x15'))(_0x2931('0x16'));var utils=require(_0x2931('0x17'));var config=require(_0x2931('0x18'));var licenseUtil=require(_0x2931('0x19'));var db=require(_0x2931('0x1a'))['db'];function respondWithStatusCode(_0x4d7da8,_0x28032d){_0x28032d=_0x28032d||0xcc;return function(_0x141a53){if(_0x141a53){return _0x4d7da8['sendStatus'](_0x28032d);}return _0x4d7da8[_0x2931('0x1b')](_0x28032d)[_0x2931('0x1c')]();};}function respondWithResult(_0x4a4f4f,_0x240e56){_0x240e56=_0x240e56||0xc8;return function(_0x598c81){if(_0x598c81){return _0x4a4f4f[_0x2931('0x1b')](_0x240e56)[_0x2931('0x1d')](_0x598c81);}};}function respondWithFilteredResult(_0x59c7d5,_0x5eff55){return function(_0x178a83){if(_0x178a83){var _0x5b70c4=typeof _0x5eff55['offset']===_0x2931('0x1e')&&typeof _0x5eff55[_0x2931('0x1f')]==='undefined';var _0x56ece9=_0x178a83['count'];var _0x111fec=_0x5b70c4?0x0:_0x5eff55[_0x2931('0x20')];var _0x1947c8=_0x5b70c4?_0x178a83['count']:_0x5eff55[_0x2931('0x20')]+_0x5eff55[_0x2931('0x1f')];var _0x312420;if(_0x1947c8>=_0x56ece9){_0x1947c8=_0x56ece9;_0x312420=0xc8;}else{_0x312420=0xce;}_0x59c7d5[_0x2931('0x1b')](_0x312420);return _0x59c7d5[_0x2931('0x21')](_0x2931('0x22'),_0x111fec+'-'+_0x1947c8+'/'+_0x56ece9)[_0x2931('0x1d')](_0x178a83);}return null;};}function patchUpdates(_0x1692e0){return function(_0x1b8951){try{jsonpatch['apply'](_0x1b8951,_0x1692e0,!![]);}catch(_0x9b763e){return BPromise[_0x2931('0x23')](_0x9b763e);}return _0x1b8951['save']();};}function saveUpdates(_0x101534,_0x34c2a8){return function(_0x5973b8){if(_0x5973b8){return _0x5973b8[_0x2931('0x24')](_0x101534)[_0x2931('0x25')](function(_0x5aeb4c){return _0x5aeb4c;});}return null;};}function removeEntity(_0x1965ea,_0x9eae4b){return function(_0x5420c9){if(_0x5420c9){return _0x5420c9[_0x2931('0x26')]()[_0x2931('0x25')](function(){_0x1965ea[_0x2931('0x1b')](0xcc)[_0x2931('0x1c')]();});}};}function handleEntityNotFound(_0x31603f,_0x571d06){return function(_0x2ff3c7){if(!_0x2ff3c7){_0x31603f['sendStatus'](0x194);}return _0x2ff3c7;};}function handleError(_0x39c12b,_0x388ccf){_0x388ccf=_0x388ccf||0x1f4;return function(_0x4cc0e2){logger[_0x2931('0x27')](_0x4cc0e2['stack']);if(_0x4cc0e2[_0x2931('0x28')]){delete _0x4cc0e2[_0x2931('0x28')];}_0x39c12b[_0x2931('0x1b')](_0x388ccf)[_0x2931('0x29')](_0x4cc0e2);};}exports[_0x2931('0x2a')]=function(_0x4e9a77,_0x27c55a){var _0x3c44b4={},_0x590123={},_0x3a7561={'count':0x0,'rows':[]};var _0x2c46e7=_['map'](db[_0x2931('0x2b')][_0x2931('0x2c')],function(_0x420000){return{'name':_0x420000['fieldName'],'type':_0x420000['type'][_0x2931('0x2d')]};});_0x590123[_0x2931('0x2e')]=_['differenceBy'](_[_0x2931('0x2f')](_0x2c46e7,_0x2931('0x28')),[_0x2931('0x28')]);_0x590123[_0x2931('0x30')]=_[_0x2931('0x31')](_0x4e9a77[_0x2931('0x30')]);_0x590123[_0x2931('0x32')]=_['intersection'](_0x590123['model'],_0x590123[_0x2931('0x30')]);_0x3c44b4[_0x2931('0x33')]=_[_0x2931('0x34')](_0x590123['model'],qs[_0x2931('0x35')](_0x4e9a77[_0x2931('0x30')][_0x2931('0x35')]));_0x3c44b4[_0x2931('0x33')]=_0x3c44b4[_0x2931('0x33')][_0x2931('0x36')]?_0x3c44b4['attributes']:_0x590123[_0x2931('0x2e')];if(!_0x4e9a77[_0x2931('0x30')]['hasOwnProperty']('nolimit')){_0x3c44b4[_0x2931('0x1f')]=qs['limit'](_0x4e9a77[_0x2931('0x30')][_0x2931('0x1f')]);_0x3c44b4[_0x2931('0x20')]=qs[_0x2931('0x20')](_0x4e9a77[_0x2931('0x30')][_0x2931('0x20')]);}_0x3c44b4[_0x2931('0x37')]=qs[_0x2931('0x38')](_0x4e9a77['query']['sort']);_0x3c44b4['where']=qs[_0x2931('0x32')](_[_0x2931('0x39')](_0x4e9a77[_0x2931('0x30')],_0x590123['filters']),_0x2c46e7);if(_0x4e9a77[_0x2931('0x30')][_0x2931('0x3a')]){_0x3c44b4['where']=_[_0x2931('0x3b')](_0x3c44b4[_0x2931('0x3c')],{'$or':_[_0x2931('0x2f')](_0x2c46e7,function(_0x139754){if(_0x139754[_0x2931('0x3d')]!==_0x2931('0x3e')){var _0x869ad5={};_0x869ad5[_0x139754[_0x2931('0x28')]]={'$like':'%'+_0x4e9a77[_0x2931('0x30')][_0x2931('0x3a')]+'%'};return _0x869ad5;}})});}_0x3c44b4=_[_0x2931('0x3b')]({},_0x3c44b4,_0x4e9a77[_0x2931('0x3f')]);var _0x329334={'where':_0x3c44b4[_0x2931('0x3c')]};return db[_0x2931('0x2b')][_0x2931('0x40')](_0x329334)[_0x2931('0x25')](function(_0x6d6317){_0x3a7561[_0x2931('0x40')]=_0x6d6317;if(_0x4e9a77[_0x2931('0x30')][_0x2931('0x41')]){_0x3c44b4[_0x2931('0x42')]=[{'all':!![]}];}return db[_0x2931('0x2b')][_0x2931('0x43')](_0x3c44b4);})[_0x2931('0x25')](function(_0x12fe6b){_0x3a7561[_0x2931('0x44')]=_0x12fe6b;return _0x3a7561;})[_0x2931('0x25')](respondWithFilteredResult(_0x27c55a,_0x3c44b4))[_0x2931('0x45')](handleError(_0x27c55a,null));};exports[_0x2931('0x46')]=function(_0x4a8788,_0x5f1b75){var _0xbe4127={'raw':!![],'where':{'id':_0x4a8788[_0x2931('0x47')]['id']}},_0x36d452={};_0x36d452[_0x2931('0x2e')]=_[_0x2931('0x31')](db[_0x2931('0x2b')]['rawAttributes']);_0x36d452[_0x2931('0x30')]=_[_0x2931('0x31')](_0x4a8788[_0x2931('0x30')]);_0x36d452[_0x2931('0x32')]=_[_0x2931('0x34')](_0x36d452[_0x2931('0x2e')],_0x36d452[_0x2931('0x30')]);_0xbe4127['attributes']=_['intersection'](_0x36d452['model'],qs['fields'](_0x4a8788[_0x2931('0x30')][_0x2931('0x35')]));_0xbe4127[_0x2931('0x33')]=_0xbe4127[_0x2931('0x33')][_0x2931('0x36')]?_0xbe4127[_0x2931('0x33')]:_0x36d452['model'];if(_0x4a8788['query'][_0x2931('0x41')]){_0xbe4127['include']=[{'all':!![]}];}_0xbe4127=_['merge']({},_0xbe4127,_0x4a8788[_0x2931('0x3f')]);return db[_0x2931('0x2b')][_0x2931('0x48')](_0xbe4127)[_0x2931('0x25')](handleEntityNotFound(_0x5f1b75,null))['then'](respondWithResult(_0x5f1b75,null))[_0x2931('0x45')](handleError(_0x5f1b75,null));};exports[_0x2931('0x49')]=function(_0x54c06a,_0x24bccd){return db[_0x2931('0x2b')][_0x2931('0x49')](_0x54c06a['body'],{})[_0x2931('0x25')](respondWithResult(_0x24bccd,0xc9))[_0x2931('0x45')](handleError(_0x24bccd,null));};exports[_0x2931('0x24')]=function(_0x4f7723,_0x57eaea){if(_0x4f7723[_0x2931('0x4a')]['id']){delete _0x4f7723[_0x2931('0x4a')]['id'];}return db[_0x2931('0x2b')][_0x2931('0x48')]({'where':{'id':_0x4f7723[_0x2931('0x47')]['id']}})[_0x2931('0x25')](handleEntityNotFound(_0x57eaea,null))['then'](saveUpdates(_0x4f7723[_0x2931('0x4a')],null))[_0x2931('0x25')](respondWithResult(_0x57eaea,null))[_0x2931('0x45')](handleError(_0x57eaea,null));};exports[_0x2931('0x26')]=function(_0x2e23eb,_0x28eff5){return db[_0x2931('0x2b')][_0x2931('0x48')]({'where':{'id':_0x2e23eb[_0x2931('0x47')]['id']}})[_0x2931('0x25')](handleEntityNotFound(_0x28eff5,null))[_0x2931('0x25')](removeEntity(_0x28eff5,null))[_0x2931('0x45')](handleError(_0x28eff5,null));};exports['download']=function(_0x408787,_0x36557b,_0x4a458c){return db['VoiceMailMessage'][_0x2931('0x48')]({'where':{'id':_0x408787[_0x2931('0x47')]['id']},'attributes':['id',_0x2931('0x4b'),'msg_id']})[_0x2931('0x25')](handleEntityNotFound(_0x36557b,null))[_0x2931('0x25')](function(_0x213b40){if(_0x213b40){if(!_0x213b40[_0x2931('0x4b')]){throw new db[(_0x2931('0x4c'))][(_0x2931('0x4d'))](_0x2931('0x4e'));}var _0x3308fc={'Content-Type':'audio/wav','Content-Disposition':_0x2931('0x4f')};if(_0x213b40[_0x2931('0x50')]){_0x3308fc[_0x2931('0x51')]=_0x2931('0x52')+_0x213b40[_0x2931('0x50')]+_0x2931('0x53');}_0x36557b['set'](_0x3308fc);return _0x36557b[_0x2931('0x29')](new Buffer(_0x213b40[_0x2931('0x4b')]));}})[_0x2931('0x45')](handleError(_0x36557b,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 18294cd..0d2c683 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 _0xd042=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3faefd,_0x35eb89){var _0xf3ada7=function(_0x524a83){while(--_0x524a83){_0x3faefd['push'](_0x3faefd['shift']());}};_0xf3ada7(++_0x35eb89);}(_0xd042,0xf4));var _0x2d04=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd042[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x2d04('0x0'));var util=require(_0x2d04('0x1'));var logger=require(_0x2d04('0x2'))(_0x2d04('0x3'));var moment=require(_0x2d04('0x4'));var BPromise=require(_0x2d04('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d04('0x6'));var rimraf=require(_0x2d04('0x7'));var config=require(_0x2d04('0x8'));var attributes=require(_0x2d04('0x9'));module[_0x2d04('0xa')]=function(_0x28a4ce,_0x43c1be){return _0x28a4ce[_0x2d04('0xb')](_0x2d04('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x2d04('0xd'),'fields':[_0x2d04('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc419=['./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x71303,_0x4423fe){var _0x880fa8=function(_0x23f32d){while(--_0x23f32d){_0x71303['push'](_0x71303['shift']());}};_0x880fa8(++_0x4423fe);}(_0xc419,0x1a9));var _0x9c41=function(_0x4d7895,_0x1e2a52){_0x4d7895=_0x4d7895-0x0;var _0x2a1e12=_0xc419[_0x4d7895];return _0x2a1e12;};'use strict';var _=require(_0x9c41('0x0'));var util=require(_0x9c41('0x1'));var logger=require(_0x9c41('0x2'))(_0x9c41('0x3'));var moment=require(_0x9c41('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c41('0x5'));var fs=require('fs');var path=require(_0x9c41('0x6'));var rimraf=require(_0x9c41('0x7'));var config=require(_0x9c41('0x8'));var attributes=require(_0x9c41('0x9'));module[_0x9c41('0xa')]=function(_0x324ecf,_0x59b514){return _0x324ecf['define'](_0x9c41('0xb'),attributes,{'tableName':_0x9c41('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x9c41('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 33dced4..c6557ae 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 _0x0ae0=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','moment','bluebird','randomstring'];(function(_0x15d203,_0x1fab5b){var _0x498d8d=function(_0x5db9f7){while(--_0x5db9f7){_0x15d203['push'](_0x15d203['shift']());}};_0x498d8d(++_0x1fab5b);}(_0x0ae0,0xcf));var _0x00ae=function(_0x14801c,_0x401273){_0x14801c=_0x14801c-0x0;var _0x4336b1=_0x0ae0[_0x14801c];return _0x4336b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x00ae('0x0'));var BPromise=require(_0x00ae('0x1'));var rs=require(_0x00ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x00ae('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x00ae('0x4'))(_0x00ae('0x5'));var config=require(_0x00ae('0x6'));var jayson=require(_0x00ae('0x7'));var client=jayson[_0x00ae('0x8')][_0x00ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x239108,_0x23fbb0,_0x15f256){return new BPromise(function(_0x5ef8d7,_0x15b3aa){return client[_0x00ae('0xa')](_0x239108,_0x15f256)[_0x00ae('0xb')](function(_0x568ea7){logger[_0x00ae('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x23fbb0,_0x00ae('0xd'));logger[_0x00ae('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x23fbb0,'request\x20sent',JSON[_0x00ae('0xf')](_0x568ea7));if(_0x568ea7[_0x00ae('0x10')]){if(_0x568ea7[_0x00ae('0x10')][_0x00ae('0x11')]===0x1f4){logger[_0x00ae('0x10')](_0x00ae('0x12'),_0x23fbb0,_0x568ea7[_0x00ae('0x10')][_0x00ae('0x13')]);return _0x15b3aa(_0x568ea7[_0x00ae('0x10')]['message']);}logger[_0x00ae('0x10')](_0x00ae('0x12'),_0x23fbb0,_0x568ea7[_0x00ae('0x10')][_0x00ae('0x13')]);return _0x5ef8d7(_0x568ea7[_0x00ae('0x10')][_0x00ae('0x13')]);}else{logger[_0x00ae('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x23fbb0,_0x00ae('0xd'));_0x5ef8d7(_0x568ea7[_0x00ae('0x14')][_0x00ae('0x13')]);}})['catch'](function(_0x3eafce){logger[_0x00ae('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x23fbb0,_0x3eafce);_0x15b3aa(_0x3eafce);});});} \ No newline at end of file +var _0xecfe=['request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xecfe,0x1bc));var _0xeecf=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xecfe[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xeecf('0x0'));var util=require(_0xeecf('0x1'));var moment=require(_0xeecf('0x2'));var BPromise=require(_0xeecf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeecf('0x4'));var db=require(_0xeecf('0x5'))['db'];var utils=require(_0xeecf('0x6'));var logger=require(_0xeecf('0x7'))(_0xeecf('0x8'));var config=require(_0xeecf('0x9'));var jayson=require(_0xeecf('0xa'));var client=jayson['client'][_0xeecf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd49d,_0x141f65,_0xf9a6d8){return new BPromise(function(_0x5e4aca,_0x30eb5b){return client[_0xeecf('0xc')](_0x3fd49d,_0xf9a6d8)[_0xeecf('0xd')](function(_0x2f2806){logger[_0xeecf('0xe')](_0xeecf('0xf'),_0x141f65,_0xeecf('0x10'));logger[_0xeecf('0x11')](_0xeecf('0x12'),_0x141f65,_0xeecf('0x10'),JSON['stringify'](_0x2f2806));if(_0x2f2806[_0xeecf('0x13')]){if(_0x2f2806['error'][_0xeecf('0x14')]===0x1f4){logger[_0xeecf('0x13')](_0xeecf('0xf'),_0x141f65,_0x2f2806[_0xeecf('0x13')][_0xeecf('0x15')]);return _0x30eb5b(_0x2f2806[_0xeecf('0x13')]['message']);}logger['error'](_0xeecf('0xf'),_0x141f65,_0x2f2806[_0xeecf('0x13')]['message']);return _0x5e4aca(_0x2f2806['error'][_0xeecf('0x15')]);}else{logger['info'](_0xeecf('0xf'),_0x141f65,_0xeecf('0x10'));_0x5e4aca(_0x2f2806['result'][_0xeecf('0x15')]);}})[_0xeecf('0x16')](function(_0x1da5b5){logger[_0xeecf('0x13')](_0xeecf('0xf'),_0x141f65,_0x1da5b5);_0x30eb5b(_0x1da5b5);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index adeeb08..fd64fb3 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 _0x0e6a=['update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','/:id','show','get','getSounds','post','create','/:id/sounds'];(function(_0xa4a6b0,_0x82ec99){var _0x118343=function(_0x4b387){while(--_0x4b387){_0xa4a6b0['push'](_0xa4a6b0['shift']());}};_0x118343(++_0x82ec99);}(_0x0e6a,0x16d));var _0xa0e6=function(_0xfc0021,_0x336a32){_0xfc0021=_0xfc0021-0x0;var _0x5f392c=_0x0e6a[_0xfc0021];return _0x5f392c;};'use strict';var multer=require(_0xa0e6('0x0'));var util=require(_0xa0e6('0x1'));var path=require(_0xa0e6('0x2'));var timeout=require(_0xa0e6('0x3'));var express=require(_0xa0e6('0x4'));var router=express[_0xa0e6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa0e6('0x6'));var interaction=require(_0xa0e6('0x7'));var config=require(_0xa0e6('0x8'));var controller=require(_0xa0e6('0x9'));router['get']('/',auth[_0xa0e6('0xa')](),controller[_0xa0e6('0xb')]);router['get'](_0xa0e6('0xc'),auth[_0xa0e6('0xa')](),controller[_0xa0e6('0xd')]);router[_0xa0e6('0xe')]('/:id/sounds',auth[_0xa0e6('0xa')](),controller[_0xa0e6('0xf')]);router[_0xa0e6('0x10')]('/',auth[_0xa0e6('0xa')](),controller[_0xa0e6('0x11')]);router[_0xa0e6('0x10')](_0xa0e6('0x12'),auth[_0xa0e6('0xa')](),controller['addSound']);router['put'](_0xa0e6('0xc'),auth[_0xa0e6('0xa')](),controller[_0xa0e6('0x13')]);router[_0xa0e6('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xa0e6('0x15')]);router['delete']('/:id/sounds/:id2',auth[_0xa0e6('0xa')](),controller[_0xa0e6('0x16')]);module[_0xa0e6('0x17')]=router; \ No newline at end of file +var _0xa326=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','getSounds','post','/:id/sounds','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x252c60,_0x1b5abf){var _0x4fc4ed=function(_0xf8e39f){while(--_0xf8e39f){_0x252c60['push'](_0x252c60['shift']());}};_0x4fc4ed(++_0x1b5abf);}(_0xa326,0x149));var _0x6a32=function(_0xa5214e,_0x17504f){_0xa5214e=_0xa5214e-0x0;var _0x4d70f7=_0xa326[_0xa5214e];return _0x4d70f7;};'use strict';var multer=require(_0x6a32('0x0'));var util=require(_0x6a32('0x1'));var path=require(_0x6a32('0x2'));var timeout=require(_0x6a32('0x3'));var express=require(_0x6a32('0x4'));var router=express[_0x6a32('0x5')]();var fs_extra=require(_0x6a32('0x6'));var auth=require(_0x6a32('0x7'));var interaction=require(_0x6a32('0x8'));var config=require(_0x6a32('0x9'));var controller=require(_0x6a32('0xa'));router[_0x6a32('0xb')]('/',auth[_0x6a32('0xc')](),controller[_0x6a32('0xd')]);router[_0x6a32('0xb')](_0x6a32('0xe'),auth['isAuthenticated'](),controller[_0x6a32('0xf')]);router[_0x6a32('0xb')]('/:id/sounds',auth[_0x6a32('0xc')](),controller[_0x6a32('0x10')]);router['post']('/',auth[_0x6a32('0xc')](),controller['create']);router[_0x6a32('0x11')](_0x6a32('0x12'),auth[_0x6a32('0xc')](),controller['addSound']);router['put'](_0x6a32('0xe'),auth['isAuthenticated'](),controller[_0x6a32('0x13')]);router[_0x6a32('0x14')]('/:id',auth[_0x6a32('0xc')](),controller[_0x6a32('0x15')]);router[_0x6a32('0x14')](_0x6a32('0x16'),auth[_0x6a32('0xc')](),controller[_0x6a32('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 2bafcd4..cc390d6 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 _0xca91=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca91,0x1a6));var _0x1ca9=function(_0x154983,_0xc29edf){_0x154983=_0x154983-0x0;var _0x3d1243=_0xca91[_0x154983];return _0x3d1243;};'use strict';var Sequelize=require(_0x1ca9('0x0'));module[_0x1ca9('0x1')]={'name':{'type':Sequelize[_0x1ca9('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1ca9('0x3')]('custom',_0x1ca9('0x4'),_0x1ca9('0x5'),_0x1ca9('0x6'),_0x1ca9('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x1ca9('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x1ca9('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1ca9('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1ca9('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x1ca9('0x2')],'allowNull':!![]},'stamp':{'type':_0x1ca9('0x8')},'defaultEntry':{'type':Sequelize[_0x1ca9('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0e8f=['quietmp3','files','alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','mp3nb','quietmp3nb'];(function(_0x4180c9,_0x58f04b){var _0x4a81b2=function(_0x8c315a){while(--_0x8c315a){_0x4180c9['push'](_0x4180c9['shift']());}};_0x4a81b2(++_0x58f04b);}(_0x0e8f,0x1c0));var _0xf0e8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0e8f[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xf0e8('0x0'));module[_0xf0e8('0x1')]={'name':{'type':Sequelize[_0xf0e8('0x2')],'allowNull':![],'unique':_0xf0e8('0x3')},'mode':{'type':Sequelize[_0xf0e8('0x4')](_0xf0e8('0x5'),'files',_0xf0e8('0x6'),_0xf0e8('0x7'),_0xf0e8('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0xf0e8('0x9')},'directory':{'type':Sequelize[_0xf0e8('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xf0e8('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf0e8('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf0e8('0x2')],'allowNull':!![],'defaultValue':_0xf0e8('0xa')},'format':{'type':Sequelize[_0xf0e8('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xf0e8('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 97dd336..f1323cf 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 _0x7248=['key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','format','basename','save_name','extname','%s.%s','symlinkSync','removeSound','id2','createdAt','getSounds','hasOwnProperty','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','error','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x7248,0xb6));var _0x8724=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x7248[_0x4350c2];return _0x8b6406;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8724('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8724('0x1'));var rp=require(_0x8724('0x2'));var moment=require(_0x8724('0x3'));var BPromise=require(_0x8724('0x4'));var Mustache=require('mustache');var util=require(_0x8724('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8724('0x6'));var fs=require('fs');var fs_extra=require(_0x8724('0x7'));var _=require(_0x8724('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8724('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x8724('0xa'));var querystring=require(_0x8724('0xb'));var Papa=require(_0x8724('0xc'));var Redis=require(_0x8724('0xd'));var authService=require(_0x8724('0xe'));var qs=require(_0x8724('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8724('0x10'));var logger=require(_0x8724('0x11'))(_0x8724('0x12'));var utils=require(_0x8724('0x13'));var config=require(_0x8724('0x14'));var licenseUtil=require(_0x8724('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d7f73,_0x71fedd){_0x71fedd=_0x71fedd||0xcc;return function(_0xc8f851){if(_0xc8f851){return _0x1d7f73[_0x8724('0x16')](_0x71fedd);}return _0x1d7f73[_0x8724('0x17')](_0x71fedd)[_0x8724('0x18')]();};}function respondWithResult(_0x262b7a,_0x27b20b){_0x27b20b=_0x27b20b||0xc8;return function(_0x43beea){if(_0x43beea){return _0x262b7a[_0x8724('0x17')](_0x27b20b)[_0x8724('0x19')](_0x43beea);}};}function respondWithFilteredResult(_0x143120,_0x2a09ff){return function(_0x2cb74e){if(_0x2cb74e){var _0x46339e=typeof _0x2a09ff['offset']===_0x8724('0x1a')&&typeof _0x2a09ff[_0x8724('0x1b')]===_0x8724('0x1a');var _0x14e01d=_0x2cb74e[_0x8724('0x1c')];var _0x303933=_0x46339e?0x0:_0x2a09ff['offset'];var _0x4b445b=_0x46339e?_0x2cb74e[_0x8724('0x1c')]:_0x2a09ff['offset']+_0x2a09ff[_0x8724('0x1b')];var _0xd1d7df;if(_0x4b445b>=_0x14e01d){_0x4b445b=_0x14e01d;_0xd1d7df=0xc8;}else{_0xd1d7df=0xce;}_0x143120[_0x8724('0x17')](_0xd1d7df);return _0x143120[_0x8724('0x1d')](_0x8724('0x1e'),_0x303933+'-'+_0x4b445b+'/'+_0x14e01d)[_0x8724('0x19')](_0x2cb74e);}return null;};}function patchUpdates(_0x25b1d9){return function(_0x231ee4){try{jsonpatch[_0x8724('0x1f')](_0x231ee4,_0x25b1d9,!![]);}catch(_0x53c02c){return BPromise['reject'](_0x53c02c);}return _0x231ee4[_0x8724('0x20')]();};}function saveUpdates(_0xb99526,_0x2205ea){return function(_0x396155){if(_0x396155){return _0x396155[_0x8724('0x21')](_0xb99526)[_0x8724('0x22')](function(_0x457b56){return _0x457b56;});}return null;};}function removeEntity(_0xa85194,_0x2262b4){return function(_0x556a42){if(_0x556a42){return _0x556a42[_0x8724('0x23')]()[_0x8724('0x22')](function(){var _0x3e4e88=_0x556a42[_0x8724('0x24')]({'plain':!![]});var _0x35282f='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x35282f,'resourceId':_0x3e4e88['id']}})[_0x8724('0x22')](function(){return _0x556a42;});})[_0x8724('0x22')](function(){_0xa85194['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9915,_0x29119b){return function(_0x48dbf0){if(!_0x48dbf0){_0x3f9915['sendStatus'](0x194);}return _0x48dbf0;};}function handleError(_0x517959,_0x4d4564){_0x4d4564=_0x4d4564||0x1f4;return function(_0x52167b){logger[_0x8724('0x25')](_0x52167b['stack']);if(_0x52167b[_0x8724('0x26')]){delete _0x52167b[_0x8724('0x26')];}_0x517959[_0x8724('0x17')](_0x4d4564)[_0x8724('0x27')](_0x52167b);};}exports[_0x8724('0x28')]=function(_0x10c6be,_0x520265){var _0x4dc23a={},_0x56f8c5={},_0x4d1335={'count':0x0,'rows':[]};var _0x36f3aa=_['map'](db[_0x8724('0x29')][_0x8724('0x2a')],function(_0x585cca){return{'name':_0x585cca[_0x8724('0x2b')],'type':_0x585cca['type'][_0x8724('0x2c')]};});_0x56f8c5[_0x8724('0x2d')]=_[_0x8724('0x2e')](_0x36f3aa,_0x8724('0x26'));_0x56f8c5[_0x8724('0x2f')]=_[_0x8724('0x30')](_0x10c6be[_0x8724('0x2f')]);_0x56f8c5[_0x8724('0x31')]=_['intersection'](_0x56f8c5[_0x8724('0x2d')],_0x56f8c5[_0x8724('0x2f')]);_0x4dc23a[_0x8724('0x32')]=_[_0x8724('0x33')](_0x56f8c5[_0x8724('0x2d')],qs['fields'](_0x10c6be[_0x8724('0x2f')][_0x8724('0x34')]));_0x4dc23a[_0x8724('0x32')]=_0x4dc23a['attributes']['length']?_0x4dc23a['attributes']:_0x56f8c5[_0x8724('0x2d')];if(!_0x10c6be[_0x8724('0x2f')]['hasOwnProperty'](_0x8724('0x35'))){_0x4dc23a[_0x8724('0x1b')]=qs[_0x8724('0x1b')](_0x10c6be[_0x8724('0x2f')][_0x8724('0x1b')]);_0x4dc23a[_0x8724('0x36')]=qs[_0x8724('0x36')](_0x10c6be[_0x8724('0x2f')][_0x8724('0x36')]);}_0x4dc23a[_0x8724('0x37')]=qs[_0x8724('0x38')](_0x10c6be[_0x8724('0x2f')]['sort']);delete _0x10c6be[_0x8724('0x2f')][_0x8724('0x38')];_0x4dc23a[_0x8724('0x39')]=qs['filters'](_[_0x8724('0x3a')](_0x10c6be[_0x8724('0x2f')],_0x56f8c5[_0x8724('0x31')]),_0x36f3aa);if(_0x10c6be['query'][_0x8724('0x3b')]){_0x4dc23a[_0x8724('0x39')]=_[_0x8724('0x3c')](_0x4dc23a['where'],{'$or':_[_0x8724('0x2e')](_0x36f3aa,function(_0x4a0c22){if(_0x4a0c22[_0x8724('0x3d')]!==_0x8724('0x3e')){var _0x5197a9={};_0x5197a9[_0x4a0c22[_0x8724('0x26')]]={'$like':'%'+_0x10c6be[_0x8724('0x2f')][_0x8724('0x3b')]+'%'};return _0x5197a9;}})});}_0x4dc23a=_[_0x8724('0x3c')]({},_0x4dc23a,_0x10c6be[_0x8724('0x3f')]);var _0x129ef5={'where':_0x4dc23a['where']};return db[_0x8724('0x29')][_0x8724('0x1c')](_0x129ef5)[_0x8724('0x22')](function(_0x4b86dd){_0x4d1335[_0x8724('0x1c')]=_0x4b86dd;if(_0x10c6be[_0x8724('0x2f')][_0x8724('0x40')]){_0x4dc23a[_0x8724('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x8724('0x42')](_0x4dc23a);})[_0x8724('0x22')](function(_0x78ebda){_0x4d1335[_0x8724('0x43')]=_0x78ebda;return _0x4d1335;})['then'](respondWithFilteredResult(_0x520265,_0x4dc23a))[_0x8724('0x44')](handleError(_0x520265,null));};exports[_0x8724('0x45')]=function(_0x41fe4c,_0x328d85){var _0x215b5c={'raw':![],'where':{'id':_0x41fe4c[_0x8724('0x46')]['id']}},_0x46f7bc={};_0x46f7bc['model']=_[_0x8724('0x30')](db[_0x8724('0x29')][_0x8724('0x2a')]);_0x46f7bc[_0x8724('0x2f')]=_[_0x8724('0x30')](_0x41fe4c['query']);_0x46f7bc[_0x8724('0x31')]=_[_0x8724('0x33')](_0x46f7bc[_0x8724('0x2d')],_0x46f7bc['query']);_0x215b5c[_0x8724('0x32')]=_[_0x8724('0x33')](_0x46f7bc[_0x8724('0x2d')],qs['fields'](_0x41fe4c[_0x8724('0x2f')][_0x8724('0x34')]));_0x215b5c[_0x8724('0x32')]=_0x215b5c[_0x8724('0x32')][_0x8724('0x47')]?_0x215b5c[_0x8724('0x32')]:_0x46f7bc[_0x8724('0x2d')];if(_0x41fe4c[_0x8724('0x2f')][_0x8724('0x40')]){_0x215b5c['include']=[{'all':!![]}];}_0x215b5c=_[_0x8724('0x3c')]({},_0x215b5c,_0x41fe4c[_0x8724('0x3f')]);return db[_0x8724('0x29')][_0x8724('0x48')](_0x215b5c)[_0x8724('0x22')](handleEntityNotFound(_0x328d85,null))[_0x8724('0x22')](respondWithResult(_0x328d85,null))[_0x8724('0x44')](handleError(_0x328d85,null));};exports[_0x8724('0x21')]=function(_0x39c5ad,_0x1d35dc){if(_0x39c5ad[_0x8724('0x49')]['id']){delete _0x39c5ad['body']['id'];}return db[_0x8724('0x29')][_0x8724('0x48')]({'where':{'id':_0x39c5ad[_0x8724('0x46')]['id']}})[_0x8724('0x22')](handleEntityNotFound(_0x1d35dc,null))[_0x8724('0x22')](saveUpdates(_0x39c5ad[_0x8724('0x49')],null))[_0x8724('0x22')](respondWithResult(_0x1d35dc,null))[_0x8724('0x44')](handleError(_0x1d35dc,null));};exports[_0x8724('0x4a')]=function(_0x2bd8b7,_0x2aa2b4,_0x18bb0b){return db[_0x8724('0x4b')][_0x8724('0x4c')](function(_0xc5261a){if(_0x2bd8b7[_0x8724('0x49')][_0x8724('0x4d')]==='files'){_0x2bd8b7[_0x8724('0x49')][_0x8724('0x4e')]=path[_0x8724('0x4f')](config[_0x8724('0x50')],_0x8724('0x51'),_0x2bd8b7['body'][_0x8724('0x26')]);}return db[_0x8724('0x29')][_0x8724('0x4a')](_0x2bd8b7[_0x8724('0x49')],{'transaction':_0xc5261a})[_0x8724('0x22')](function(_0x413535){if(_0x2bd8b7[_0x8724('0x49')][_0x8724('0x4d')]===_0x8724('0x52')){fs['mkdirSync'](_0x413535['directory'],parseInt(_0x8724('0x53'),0x8));}var _0x2d3e58=_0x2bd8b7[_0x8724('0x54')]['get']({'plain':!![]});if(!_0x2d3e58)throw new Error(_0x8724('0x55'));if(_0x2d3e58[_0x8724('0x56')]===_0x8724('0x54')){var _0x25b9fa=_0x413535['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x8724('0x57'),'userProfileId':_0x2d3e58[_0x8724('0x58')]},'raw':!![]})[_0x8724('0x22')](function(_0x280d04){if(_0x280d04&&_0x280d04['autoAssociation']===0x0){return db[_0x8724('0x59')]['create']({'name':_0x25b9fa[_0x8724('0x26')],'resourceId':_0x25b9fa['id'],'type':_0x280d04[_0x8724('0x26')],'sectionId':_0x280d04['id']},{})[_0x8724('0x22')](function(){return _0x413535;});}else{return _0x413535;}})[_0x8724('0x44')](function(_0x8b27){logger[_0x8724('0x25')](_0x8724('0x5a'),_0x8b27);});}return _0x413535;});})[_0x8724('0x22')](respondWithResult(_0x2aa2b4,0xc9))[_0x8724('0x44')](handleError(_0x2aa2b4,null));};exports['destroy']=function(_0x521046,_0x5e509d,_0x37af8f){var _0x122ab3;return db[_0x8724('0x29')]['find']({'where':{'id':_0x521046[_0x8724('0x46')]['id']}})[_0x8724('0x22')](function(_0x59f364){if(_0x59f364){return db[_0x8724('0x4b')][_0x8724('0x4c')](function(_0x537ec1){return _0x59f364[_0x8724('0x23')]({'transaction':_0x537ec1,'raw':!![]})[_0x8724('0x22')](function(_0x38da47){if(_0x38da47[_0x8724('0x4e')]){fs[_0x8724('0x5b')](_0x38da47[_0x8724('0x4e')])[_0x8724('0x5c')](function(_0x5df860){fs[_0x8724('0x5d')](path[_0x8724('0x4f')](_0x38da47[_0x8724('0x4e')],_0x5df860));});fs[_0x8724('0x5e')](_0x38da47[_0x8724('0x4e')]);}return _0x38da47;});})['catch'](function(_0xe0ae5b){throw new db[(_0x8724('0x5f'))][(_0x8724('0x60'))](_0xe0ae5b[_0x8724('0x61')]);});}})['then'](handleEntityNotFound(_0x5e509d,null))['then'](removeEntity(_0x5e509d,null))[_0x8724('0x44')](handleError(_0x5e509d,null));};exports[_0x8724('0x62')]=function(_0x5a5011,_0x29cc3e,_0x2e9c6b){return db[_0x8724('0x4b')][_0x8724('0x4c')](function(_0x178611){var _0x45f66f;return db[_0x8724('0x29')][_0x8724('0x48')]({'where':{'id':_0x5a5011[_0x8724('0x46')]['id']}})['then'](function(_0x3ff760){if(_0x3ff760){_0x45f66f=_0x3ff760;return _0x3ff760['addSound'](_0x5a5011['body']['id'],{'transaction':_0x178611});}})['then'](function(_0x30913d){if(_0x30913d){return db[_0x8724('0x63')][_0x8724('0x64')]({'where':{'id':_0x5a5011[_0x8724('0x49')]['id']},'attributes':['id','name','save_name',_0x8724('0x65'),'createdAt'],'raw':!![]});}})[_0x8724('0x22')](function(_0x2d93d7){if(_0x2d93d7){var _0x40d982=path[_0x8724('0x4f')](config[_0x8724('0x50')],'server/files/sounds/converted',util[_0x8724('0x66')]('%s.%s',path[_0x8724('0x67')](_0x2d93d7[_0x8724('0x68')],path[_0x8724('0x69')](_0x2d93d7['save_name'])),_0x2d93d7[_0x8724('0x65')]));var _0x1d318f=path['join'](config[_0x8724('0x50')],_0x8724('0x51'),_0x45f66f[_0x8724('0x26')],util['format'](_0x8724('0x6a'),_0x2d93d7[_0x8724('0x26')],_0x2d93d7[_0x8724('0x65')]));fs[_0x8724('0x6b')](_0x40d982,_0x1d318f);return _0x2d93d7;}})[_0x8724('0x44')](function(_0x4a03d3){throw new db['Sequelize'][(_0x8724('0x60'))](_0x4a03d3['message']);});})[_0x8724('0x22')](handleEntityNotFound(_0x29cc3e,null))[_0x8724('0x22')](respondWithResult(_0x29cc3e,0xc9))[_0x8724('0x44')](handleError(_0x29cc3e,null));};exports[_0x8724('0x6c')]=function(_0x201b07,_0x491d01,_0x42a09b){return db[_0x8724('0x4b')][_0x8724('0x4c')](function(_0x41c658){var _0x4e2e47;return db[_0x8724('0x29')]['findOne']({'where':{'id':_0x201b07[_0x8724('0x46')]['id']}})[_0x8724('0x22')](handleEntityNotFound(_0x491d01,null))[_0x8724('0x22')](function(_0x31df4e){if(_0x31df4e){_0x4e2e47=_0x31df4e;return _0x31df4e[_0x8724('0x6c')](_0x201b07[_0x8724('0x46')][_0x8724('0x6d')]);}})[_0x8724('0x22')](function(_0x9137f4){if(_0x9137f4){return db[_0x8724('0x63')][_0x8724('0x64')]({'where':{'id':_0x201b07[_0x8724('0x46')]['id2']},'attributes':['id',_0x8724('0x26'),'save_name',_0x8724('0x65'),_0x8724('0x6e')],'raw':!![]});}})[_0x8724('0x22')](function(_0x2e3e4c){if(_0x2e3e4c){fs['unlinkSync'](path[_0x8724('0x4f')](_0x4e2e47[_0x8724('0x4e')],util[_0x8724('0x66')]('%s.%s',_0x2e3e4c['name'],_0x2e3e4c['converted_format'])));return _0x2e3e4c;}})[_0x8724('0x44')](function(_0x1eb665){throw new db['Sequelize'][(_0x8724('0x60'))](_0x1eb665[_0x8724('0x61')]);});})[_0x8724('0x22')](handleEntityNotFound(_0x491d01,null))[_0x8724('0x22')](respondWithStatusCode(_0x491d01,0xcc))[_0x8724('0x44')](handleError(_0x491d01,null));};exports[_0x8724('0x6f')]=function(_0x586ee0,_0x291cf3,_0x25d618){var _0x57a442={};var _0x50176b={};var _0x51fc35;var _0x19c531;return db['VoiceMusicOnHold'][_0x8724('0x64')]({'where':{'id':_0x586ee0[_0x8724('0x46')]['id']}})[_0x8724('0x22')](handleEntityNotFound(_0x291cf3,null))['then'](function(_0x4815d7){if(_0x4815d7){_0x51fc35=_0x4815d7;_0x50176b[_0x8724('0x2d')]=_[_0x8724('0x30')](db[_0x8724('0x63')][_0x8724('0x2a')]);_0x50176b['query']=_['keys'](_0x586ee0[_0x8724('0x2f')]);_0x50176b[_0x8724('0x31')]=_[_0x8724('0x33')](_0x50176b['model'],_0x50176b['query']);_0x57a442['attributes']=_[_0x8724('0x33')](_0x50176b[_0x8724('0x2d')],qs['fields'](_0x586ee0['query']['fields']));_0x57a442[_0x8724('0x32')]=_0x57a442[_0x8724('0x32')]['length']?_0x57a442[_0x8724('0x32')]:_0x50176b[_0x8724('0x2d')];_0x57a442[_0x8724('0x37')]=qs[_0x8724('0x38')](_0x586ee0[_0x8724('0x2f')][_0x8724('0x38')]);_0x57a442[_0x8724('0x39')]=qs['filters'](_[_0x8724('0x3a')](_0x586ee0[_0x8724('0x2f')],_0x50176b[_0x8724('0x31')]));if(_0x586ee0['query']['filter']){_0x57a442['where']=_['merge'](_0x57a442[_0x8724('0x39')],{'$or':_['map'](_0x57a442[_0x8724('0x32')],function(_0x10ac61){var _0x23717a={};_0x23717a[_0x10ac61]={'$like':'%'+_0x586ee0[_0x8724('0x2f')][_0x8724('0x3b')]+'%'};return _0x23717a;})});}_0x57a442=_[_0x8724('0x3c')]({},_0x57a442,_0x586ee0[_0x8724('0x3f')]);return _0x51fc35['getSounds'](_0x57a442);}})[_0x8724('0x22')](function(_0x2d98c4){if(_0x2d98c4){_0x19c531=_0x2d98c4[_0x8724('0x47')];if(!_0x586ee0[_0x8724('0x2f')][_0x8724('0x70')](_0x8724('0x35'))){_0x57a442[_0x8724('0x1b')]=qs['limit'](_0x586ee0[_0x8724('0x2f')][_0x8724('0x1b')]);_0x57a442[_0x8724('0x36')]=qs[_0x8724('0x36')](_0x586ee0[_0x8724('0x2f')]['offset']);}return _0x51fc35[_0x8724('0x6f')](_0x57a442);}})[_0x8724('0x22')](function(_0x345d3c){if(_0x345d3c){return _0x345d3c?{'count':_0x19c531,'rows':_0x345d3c}:null;}})[_0x8724('0x22')](respondWithResult(_0x291cf3,null))[_0x8724('0x44')](handleError(_0x291cf3,null));}; \ No newline at end of file +var _0xf3fe=['error','stack','name','map','VoiceMusicOnHold','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','count','findAll','rows','catch','show','length','includeAll','include','update','body','create','transaction','directory','join','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','params','forEach','rmdirSync','Sequelize','ValidationError','message','sequelize','addSound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','%s.%s','extname','server/files/moh','format','symlinkSync','removeSound','id2','Sound','unlinkSync','getSounds','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','destroy','get','MusicOnHolds','UserProfileResource','then','end'];(function(_0x35dc0c,_0xcb5b2a){var _0x1c1d71=function(_0x351574){while(--_0x351574){_0x35dc0c['push'](_0x35dc0c['shift']());}};_0x1c1d71(++_0xcb5b2a);}(_0xf3fe,0xb5));var _0xef3f=function(_0x3ec217,_0xf590cf){_0x3ec217=_0x3ec217-0x0;var _0x512066=_0xf3fe[_0x3ec217];return _0x512066;};'use strict';var emlformat=require(_0xef3f('0x0'));var rimraf=require(_0xef3f('0x1'));var zipdir=require(_0xef3f('0x2'));var jsonpatch=require(_0xef3f('0x3'));var rp=require(_0xef3f('0x4'));var moment=require(_0xef3f('0x5'));var BPromise=require(_0xef3f('0x6'));var Mustache=require(_0xef3f('0x7'));var util=require(_0xef3f('0x8'));var path=require('path');var sox=require(_0xef3f('0x9'));var csv=require(_0xef3f('0xa'));var ejs=require(_0xef3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef3f('0xc'));var squel=require('squel');var crypto=require(_0xef3f('0xd'));var jsforce=require(_0xef3f('0xe'));var deskjs=require(_0xef3f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xef3f('0x10'));var Papa=require(_0xef3f('0x11'));var Redis=require(_0xef3f('0x12'));var authService=require(_0xef3f('0x13'));var qs=require(_0xef3f('0x14'));var as=require(_0xef3f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef3f('0x16'))(_0xef3f('0x17'));var utils=require(_0xef3f('0x18'));var config=require(_0xef3f('0x19'));var licenseUtil=require(_0xef3f('0x1a'));var db=require(_0xef3f('0x1b'))['db'];function respondWithStatusCode(_0x1eecda,_0x42b6e1){_0x42b6e1=_0x42b6e1||0xcc;return function(_0x25d508){if(_0x25d508){return _0x1eecda[_0xef3f('0x1c')](_0x42b6e1);}return _0x1eecda[_0xef3f('0x1d')](_0x42b6e1)['end']();};}function respondWithResult(_0xf88976,_0x1c0376){_0x1c0376=_0x1c0376||0xc8;return function(_0x5a33c1){if(_0x5a33c1){return _0xf88976[_0xef3f('0x1d')](_0x1c0376)[_0xef3f('0x1e')](_0x5a33c1);}};}function respondWithFilteredResult(_0x544b3e,_0x5d1631){return function(_0x56ebec){if(_0x56ebec){var _0x13d97a=typeof _0x5d1631[_0xef3f('0x1f')]===_0xef3f('0x20')&&typeof _0x5d1631[_0xef3f('0x21')]===_0xef3f('0x20');var _0x188238=_0x56ebec['count'];var _0x38129a=_0x13d97a?0x0:_0x5d1631[_0xef3f('0x1f')];var _0x1a8fd9=_0x13d97a?_0x56ebec['count']:_0x5d1631[_0xef3f('0x1f')]+_0x5d1631[_0xef3f('0x21')];var _0x341d4e;if(_0x1a8fd9>=_0x188238){_0x1a8fd9=_0x188238;_0x341d4e=0xc8;}else{_0x341d4e=0xce;}_0x544b3e[_0xef3f('0x1d')](_0x341d4e);return _0x544b3e['set'](_0xef3f('0x22'),_0x38129a+'-'+_0x1a8fd9+'/'+_0x188238)[_0xef3f('0x1e')](_0x56ebec);}return null;};}function patchUpdates(_0x412a5c){return function(_0x1edf99){try{jsonpatch[_0xef3f('0x23')](_0x1edf99,_0x412a5c,!![]);}catch(_0x483d92){return BPromise[_0xef3f('0x24')](_0x483d92);}return _0x1edf99['save']();};}function saveUpdates(_0x442131,_0x4d3f58){return function(_0x2091a2){if(_0x2091a2){return _0x2091a2['update'](_0x442131)['then'](function(_0x5523c0){return _0x5523c0;});}return null;};}function removeEntity(_0x323a19,_0x470107){return function(_0x5d086e){if(_0x5d086e){return _0x5d086e[_0xef3f('0x25')]()['then'](function(){var _0x9ea20f=_0x5d086e[_0xef3f('0x26')]({'plain':!![]});var _0x2f6ca0=_0xef3f('0x27');return db[_0xef3f('0x28')][_0xef3f('0x25')]({'where':{'type':_0x2f6ca0,'resourceId':_0x9ea20f['id']}})[_0xef3f('0x29')](function(){return _0x5d086e;});})[_0xef3f('0x29')](function(){_0x323a19[_0xef3f('0x1d')](0xcc)[_0xef3f('0x2a')]();});}};}function handleEntityNotFound(_0x4ea163,_0x44441c){return function(_0x594e42){if(!_0x594e42){_0x4ea163['sendStatus'](0x194);}return _0x594e42;};}function handleError(_0x8799e4,_0x52502f){_0x52502f=_0x52502f||0x1f4;return function(_0x313cee){logger[_0xef3f('0x2b')](_0x313cee[_0xef3f('0x2c')]);if(_0x313cee[_0xef3f('0x2d')]){delete _0x313cee[_0xef3f('0x2d')];}_0x8799e4['status'](_0x52502f)['send'](_0x313cee);};}exports['index']=function(_0xa28ebd,_0x1ecff3){var _0x2ecfd0={},_0x464fe3={},_0x5e897a={'count':0x0,'rows':[]};var _0x66ea62=_[_0xef3f('0x2e')](db[_0xef3f('0x2f')][_0xef3f('0x30')],function(_0x989646){return{'name':_0x989646['fieldName'],'type':_0x989646[_0xef3f('0x31')]['key']};});_0x464fe3[_0xef3f('0x32')]=_[_0xef3f('0x2e')](_0x66ea62,_0xef3f('0x2d'));_0x464fe3[_0xef3f('0x33')]=_[_0xef3f('0x34')](_0xa28ebd[_0xef3f('0x33')]);_0x464fe3[_0xef3f('0x35')]=_[_0xef3f('0x36')](_0x464fe3[_0xef3f('0x32')],_0x464fe3[_0xef3f('0x33')]);_0x2ecfd0[_0xef3f('0x37')]=_[_0xef3f('0x36')](_0x464fe3[_0xef3f('0x32')],qs['fields'](_0xa28ebd[_0xef3f('0x33')][_0xef3f('0x38')]));_0x2ecfd0[_0xef3f('0x37')]=_0x2ecfd0[_0xef3f('0x37')]['length']?_0x2ecfd0[_0xef3f('0x37')]:_0x464fe3[_0xef3f('0x32')];if(!_0xa28ebd['query'][_0xef3f('0x39')](_0xef3f('0x3a'))){_0x2ecfd0[_0xef3f('0x21')]=qs[_0xef3f('0x21')](_0xa28ebd[_0xef3f('0x33')][_0xef3f('0x21')]);_0x2ecfd0['offset']=qs['offset'](_0xa28ebd['query']['offset']);}_0x2ecfd0[_0xef3f('0x3b')]=qs[_0xef3f('0x3c')](_0xa28ebd[_0xef3f('0x33')][_0xef3f('0x3c')]);delete _0xa28ebd[_0xef3f('0x33')][_0xef3f('0x3c')];_0x2ecfd0[_0xef3f('0x3d')]=qs['filters'](_[_0xef3f('0x3e')](_0xa28ebd[_0xef3f('0x33')],_0x464fe3[_0xef3f('0x35')]),_0x66ea62);if(_0xa28ebd[_0xef3f('0x33')]['filter']){_0x2ecfd0[_0xef3f('0x3d')]=_[_0xef3f('0x3f')](_0x2ecfd0[_0xef3f('0x3d')],{'$or':_[_0xef3f('0x2e')](_0x66ea62,function(_0x1069ce){if(_0x1069ce[_0xef3f('0x31')]!=='VIRTUAL'){var _0x565d7d={};_0x565d7d[_0x1069ce[_0xef3f('0x2d')]]={'$like':'%'+_0xa28ebd[_0xef3f('0x33')]['filter']+'%'};return _0x565d7d;}})});}_0x2ecfd0=_['merge']({},_0x2ecfd0,_0xa28ebd[_0xef3f('0x40')]);var _0x54d641={'where':_0x2ecfd0[_0xef3f('0x3d')]};return db[_0xef3f('0x2f')]['count'](_0x54d641)[_0xef3f('0x29')](function(_0x2451e8){_0x5e897a[_0xef3f('0x41')]=_0x2451e8;if(_0xa28ebd[_0xef3f('0x33')]['includeAll']){_0x2ecfd0['include']=[{'all':!![]}];}return db[_0xef3f('0x2f')][_0xef3f('0x42')](_0x2ecfd0);})[_0xef3f('0x29')](function(_0xdd2b25){_0x5e897a[_0xef3f('0x43')]=_0xdd2b25;return _0x5e897a;})[_0xef3f('0x29')](respondWithFilteredResult(_0x1ecff3,_0x2ecfd0))[_0xef3f('0x44')](handleError(_0x1ecff3,null));};exports[_0xef3f('0x45')]=function(_0x1c5f40,_0x66a3c0){var _0x59d9f8={'raw':![],'where':{'id':_0x1c5f40['params']['id']}},_0x47cb43={};_0x47cb43[_0xef3f('0x32')]=_['keys'](db[_0xef3f('0x2f')][_0xef3f('0x30')]);_0x47cb43[_0xef3f('0x33')]=_[_0xef3f('0x34')](_0x1c5f40[_0xef3f('0x33')]);_0x47cb43['filters']=_[_0xef3f('0x36')](_0x47cb43[_0xef3f('0x32')],_0x47cb43[_0xef3f('0x33')]);_0x59d9f8[_0xef3f('0x37')]=_['intersection'](_0x47cb43['model'],qs[_0xef3f('0x38')](_0x1c5f40[_0xef3f('0x33')][_0xef3f('0x38')]));_0x59d9f8['attributes']=_0x59d9f8[_0xef3f('0x37')][_0xef3f('0x46')]?_0x59d9f8['attributes']:_0x47cb43[_0xef3f('0x32')];if(_0x1c5f40[_0xef3f('0x33')][_0xef3f('0x47')]){_0x59d9f8[_0xef3f('0x48')]=[{'all':!![]}];}_0x59d9f8=_['merge']({},_0x59d9f8,_0x1c5f40[_0xef3f('0x40')]);return db['VoiceMusicOnHold']['find'](_0x59d9f8)[_0xef3f('0x29')](handleEntityNotFound(_0x66a3c0,null))['then'](respondWithResult(_0x66a3c0,null))[_0xef3f('0x44')](handleError(_0x66a3c0,null));};exports[_0xef3f('0x49')]=function(_0x4ff86c,_0x41b48c){if(_0x4ff86c[_0xef3f('0x4a')]['id']){delete _0x4ff86c[_0xef3f('0x4a')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4ff86c['params']['id']}})[_0xef3f('0x29')](handleEntityNotFound(_0x41b48c,null))[_0xef3f('0x29')](saveUpdates(_0x4ff86c['body'],null))['then'](respondWithResult(_0x41b48c,null))[_0xef3f('0x44')](handleError(_0x41b48c,null));};exports[_0xef3f('0x4b')]=function(_0x42f771,_0x23a16c,_0x2cdd60){return db['sequelize'][_0xef3f('0x4c')](function(_0x115218){if(_0x42f771['body']['mode']==='files'){_0x42f771[_0xef3f('0x4a')][_0xef3f('0x4d')]=path[_0xef3f('0x4e')](config['root'],'server/files/moh',_0x42f771[_0xef3f('0x4a')][_0xef3f('0x2d')]);}return db['VoiceMusicOnHold'][_0xef3f('0x4b')](_0x42f771['body'],{'transaction':_0x115218})[_0xef3f('0x29')](function(_0x50cc3d){if(_0x42f771[_0xef3f('0x4a')]['mode']===_0xef3f('0x4f')){fs[_0xef3f('0x50')](_0x50cc3d[_0xef3f('0x4d')],parseInt(_0xef3f('0x51'),0x8));}var _0x2aa117=_0x42f771['user'][_0xef3f('0x26')]({'plain':!![]});if(!_0x2aa117)throw new Error(_0xef3f('0x52'));if(_0x2aa117['role']===_0xef3f('0x53')){var _0x54aa09=_0x50cc3d[_0xef3f('0x26')]({'plain':!![]});return db[_0xef3f('0x54')][_0xef3f('0x55')]({'where':{'name':'MusicOnHolds','userProfileId':_0x2aa117['userProfileId']},'raw':!![]})[_0xef3f('0x29')](function(_0x478d5b){if(_0x478d5b&&_0x478d5b[_0xef3f('0x56')]===0x0){return db[_0xef3f('0x28')][_0xef3f('0x4b')]({'name':_0x54aa09[_0xef3f('0x2d')],'resourceId':_0x54aa09['id'],'type':_0x478d5b[_0xef3f('0x2d')],'sectionId':_0x478d5b['id']},{})['then'](function(){return _0x50cc3d;});}else{return _0x50cc3d;}})[_0xef3f('0x44')](function(_0x55b308){logger[_0xef3f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55b308);});}return _0x50cc3d;});})[_0xef3f('0x29')](respondWithResult(_0x23a16c,0xc9))[_0xef3f('0x44')](handleError(_0x23a16c,null));};exports[_0xef3f('0x25')]=function(_0x1816d8,_0x23dfe3,_0x2a2884){var _0x3f4a97;return db['VoiceMusicOnHold'][_0xef3f('0x55')]({'where':{'id':_0x1816d8[_0xef3f('0x57')]['id']}})['then'](function(_0x245327){if(_0x245327){return db['sequelize'][_0xef3f('0x4c')](function(_0xc7f889){return _0x245327[_0xef3f('0x25')]({'transaction':_0xc7f889,'raw':!![]})['then'](function(_0x4659ec){if(_0x4659ec[_0xef3f('0x4d')]){fs['readdirSync'](_0x4659ec[_0xef3f('0x4d')])[_0xef3f('0x58')](function(_0x20451d){fs['unlinkSync'](path[_0xef3f('0x4e')](_0x4659ec['directory'],_0x20451d));});fs[_0xef3f('0x59')](_0x4659ec[_0xef3f('0x4d')]);}return _0x4659ec;});})[_0xef3f('0x44')](function(_0x4f07f4){throw new db[(_0xef3f('0x5a'))][(_0xef3f('0x5b'))](_0x4f07f4[_0xef3f('0x5c')]);});}})[_0xef3f('0x29')](handleEntityNotFound(_0x23dfe3,null))[_0xef3f('0x29')](removeEntity(_0x23dfe3,null))[_0xef3f('0x44')](handleError(_0x23dfe3,null));};exports['addSound']=function(_0x364f94,_0xb5c4bd,_0x381909){return db[_0xef3f('0x5d')][_0xef3f('0x4c')](function(_0x1f0419){var _0x5ee97c;return db[_0xef3f('0x2f')]['find']({'where':{'id':_0x364f94['params']['id']}})['then'](function(_0x22c59c){if(_0x22c59c){_0x5ee97c=_0x22c59c;return _0x22c59c[_0xef3f('0x5e')](_0x364f94[_0xef3f('0x4a')]['id'],{'transaction':_0x1f0419});}})[_0xef3f('0x29')](function(_0x4e7eec){if(_0x4e7eec){return db['Sound'][_0xef3f('0x5f')]({'where':{'id':_0x364f94[_0xef3f('0x4a')]['id']},'attributes':['id',_0xef3f('0x2d'),_0xef3f('0x60'),_0xef3f('0x61'),_0xef3f('0x62')],'raw':!![]});}})['then'](function(_0x3c0f41){if(_0x3c0f41){var _0x3a98ca=path['join'](config[_0xef3f('0x63')],_0xef3f('0x64'),util['format'](_0xef3f('0x65'),path['basename'](_0x3c0f41[_0xef3f('0x60')],path[_0xef3f('0x66')](_0x3c0f41[_0xef3f('0x60')])),_0x3c0f41[_0xef3f('0x61')]));var _0x3acca0=path[_0xef3f('0x4e')](config[_0xef3f('0x63')],_0xef3f('0x67'),_0x5ee97c['name'],util[_0xef3f('0x68')]('%s.%s',_0x3c0f41[_0xef3f('0x2d')],_0x3c0f41['converted_format']));fs[_0xef3f('0x69')](_0x3a98ca,_0x3acca0);return _0x3c0f41;}})[_0xef3f('0x44')](function(_0x2d6fde){throw new db[(_0xef3f('0x5a'))][(_0xef3f('0x5b'))](_0x2d6fde[_0xef3f('0x5c')]);});})[_0xef3f('0x29')](handleEntityNotFound(_0xb5c4bd,null))[_0xef3f('0x29')](respondWithResult(_0xb5c4bd,0xc9))['catch'](handleError(_0xb5c4bd,null));};exports[_0xef3f('0x6a')]=function(_0x25fd0e,_0x1f97b7,_0x1fc6d2){return db['sequelize'][_0xef3f('0x4c')](function(_0x5596e0){var _0x5e8ea8;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x25fd0e[_0xef3f('0x57')]['id']}})[_0xef3f('0x29')](handleEntityNotFound(_0x1f97b7,null))[_0xef3f('0x29')](function(_0x509df0){if(_0x509df0){_0x5e8ea8=_0x509df0;return _0x509df0['removeSound'](_0x25fd0e[_0xef3f('0x57')][_0xef3f('0x6b')]);}})[_0xef3f('0x29')](function(_0x2eae6a){if(_0x2eae6a){return db[_0xef3f('0x6c')]['findOne']({'where':{'id':_0x25fd0e['params'][_0xef3f('0x6b')]},'attributes':['id','name',_0xef3f('0x60'),_0xef3f('0x61'),_0xef3f('0x62')],'raw':!![]});}})[_0xef3f('0x29')](function(_0x185ad4){if(_0x185ad4){fs[_0xef3f('0x6d')](path[_0xef3f('0x4e')](_0x5e8ea8[_0xef3f('0x4d')],util[_0xef3f('0x68')](_0xef3f('0x65'),_0x185ad4['name'],_0x185ad4['converted_format'])));return _0x185ad4;}})[_0xef3f('0x44')](function(_0x5a9f25){throw new db[(_0xef3f('0x5a'))][(_0xef3f('0x5b'))](_0x5a9f25['message']);});})[_0xef3f('0x29')](handleEntityNotFound(_0x1f97b7,null))[_0xef3f('0x29')](respondWithStatusCode(_0x1f97b7,0xcc))[_0xef3f('0x44')](handleError(_0x1f97b7,null));};exports[_0xef3f('0x6e')]=function(_0x8de9cb,_0x132008,_0x417183){var _0xf357de={};var _0x2d8d22={};var _0x152199;var _0x13584d;return db['VoiceMusicOnHold'][_0xef3f('0x5f')]({'where':{'id':_0x8de9cb['params']['id']}})[_0xef3f('0x29')](handleEntityNotFound(_0x132008,null))['then'](function(_0x139972){if(_0x139972){_0x152199=_0x139972;_0x2d8d22[_0xef3f('0x32')]=_[_0xef3f('0x34')](db['Sound'][_0xef3f('0x30')]);_0x2d8d22[_0xef3f('0x33')]=_[_0xef3f('0x34')](_0x8de9cb[_0xef3f('0x33')]);_0x2d8d22[_0xef3f('0x35')]=_[_0xef3f('0x36')](_0x2d8d22[_0xef3f('0x32')],_0x2d8d22['query']);_0xf357de[_0xef3f('0x37')]=_[_0xef3f('0x36')](_0x2d8d22[_0xef3f('0x32')],qs[_0xef3f('0x38')](_0x8de9cb[_0xef3f('0x33')][_0xef3f('0x38')]));_0xf357de[_0xef3f('0x37')]=_0xf357de[_0xef3f('0x37')][_0xef3f('0x46')]?_0xf357de[_0xef3f('0x37')]:_0x2d8d22[_0xef3f('0x32')];_0xf357de[_0xef3f('0x3b')]=qs[_0xef3f('0x3c')](_0x8de9cb[_0xef3f('0x33')][_0xef3f('0x3c')]);_0xf357de[_0xef3f('0x3d')]=qs[_0xef3f('0x35')](_[_0xef3f('0x3e')](_0x8de9cb[_0xef3f('0x33')],_0x2d8d22[_0xef3f('0x35')]));if(_0x8de9cb[_0xef3f('0x33')][_0xef3f('0x6f')]){_0xf357de['where']=_['merge'](_0xf357de[_0xef3f('0x3d')],{'$or':_[_0xef3f('0x2e')](_0xf357de['attributes'],function(_0x25ebf9){var _0x2be5e0={};_0x2be5e0[_0x25ebf9]={'$like':'%'+_0x8de9cb[_0xef3f('0x33')][_0xef3f('0x6f')]+'%'};return _0x2be5e0;})});}_0xf357de=_[_0xef3f('0x3f')]({},_0xf357de,_0x8de9cb['options']);return _0x152199[_0xef3f('0x6e')](_0xf357de);}})[_0xef3f('0x29')](function(_0x41f347){if(_0x41f347){_0x13584d=_0x41f347[_0xef3f('0x46')];if(!_0x8de9cb[_0xef3f('0x33')][_0xef3f('0x39')](_0xef3f('0x3a'))){_0xf357de[_0xef3f('0x21')]=qs[_0xef3f('0x21')](_0x8de9cb[_0xef3f('0x33')]['limit']);_0xf357de[_0xef3f('0x1f')]=qs['offset'](_0x8de9cb[_0xef3f('0x33')][_0xef3f('0x1f')]);}return _0x152199[_0xef3f('0x6e')](_0xf357de);}})['then'](function(_0x3aa352){if(_0x3aa352){return _0x3aa352?{'count':_0x13584d,'rows':_0x3aa352}:null;}})[_0xef3f('0x29')](respondWithResult(_0x132008,null))['catch'](handleError(_0x132008,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5ce5798..844e3c9 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 _0x0962=['exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x0962,0x1d1));var _0x2096=function(_0x575523,_0x117a76){_0x575523=_0x575523-0x0;var _0x269423=_0x0962[_0x575523];return _0x269423;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var logger=require(_0x2096('0x2'))(_0x2096('0x3'));var moment=require(_0x2096('0x4'));var BPromise=require(_0x2096('0x5'));var rp=require(_0x2096('0x6'));var fs=require('fs');var path=require(_0x2096('0x7'));var rimraf=require(_0x2096('0x8'));var config=require(_0x2096('0x9'));var attributes=require(_0x2096('0xa'));module[_0x2096('0xb')]=function(_0x4cc05c,_0xc23256){return _0x4cc05c['define'](_0x2096('0xc'),attributes,{'tableName':_0x2096('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58ef=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x37f48e,_0x18bba3){var _0x31a100=function(_0x45f26c){while(--_0x45f26c){_0x37f48e['push'](_0x37f48e['shift']());}};_0x31a100(++_0x18bba3);}(_0x58ef,0x1ce));var _0xf58e=function(_0x4d81c0,_0x1aada4){_0x4d81c0=_0x4d81c0-0x0;var _0x3ef8b9=_0x58ef[_0x4d81c0];return _0x3ef8b9;};'use strict';var _=require(_0xf58e('0x0'));var util=require('util');var logger=require(_0xf58e('0x1'))(_0xf58e('0x2'));var moment=require(_0xf58e('0x3'));var BPromise=require(_0xf58e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf58e('0x5'));var rimraf=require(_0xf58e('0x6'));var config=require(_0xf58e('0x7'));var attributes=require(_0xf58e('0x8'));module[_0xf58e('0x9')]=function(_0x1ede65,_0x42c3ee){return _0x1ede65[_0xf58e('0xa')](_0xf58e('0xb'),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 ba760e1..b64eb61 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x447f63,_0x4287ea){var _0x7eadfe=function(_0x15deb9){while(--_0x15deb9){_0x447f63['push'](_0x447f63['shift']());}};_0x7eadfe(++_0x4287ea);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0xe2d058,_0x472903){var _0x4d53dc=function(_0x2557b0){while(--_0x2557b0){_0xe2d058['push'](_0xe2d058['shift']());}};_0x4d53dc(++_0x472903);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 22c8d7c..fc88d52 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 _0xbb05=['/:id','show','/:id/users','getAgents','/:id/teams','post','addAgents','addTeams','put','update','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./voicePrefix.controller','index','get','/describe','isAuthenticated'];(function(_0x1af00d,_0x3632e6){var _0xc4db0e=function(_0x598ba8){while(--_0x598ba8){_0x1af00d['push'](_0x1af00d['shift']());}};_0xc4db0e(++_0x3632e6);}(_0xbb05,0x1b6));var _0x5bb0=function(_0x47b318,_0x338cf8){_0x47b318=_0x47b318-0x0;var _0x574404=_0xbb05[_0x47b318];return _0x574404;};'use strict';var multer=require(_0x5bb0('0x0'));var util=require(_0x5bb0('0x1'));var path=require(_0x5bb0('0x2'));var timeout=require('connect-timeout');var express=require(_0x5bb0('0x3'));var router=express[_0x5bb0('0x4')]();var fs_extra=require(_0x5bb0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bb0('0x6'));var controller=require(_0x5bb0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5bb0('0x8')]);router[_0x5bb0('0x9')](_0x5bb0('0xa'),auth[_0x5bb0('0xb')](),controller['describe']);router['get'](_0x5bb0('0xc'),auth[_0x5bb0('0xb')](),controller[_0x5bb0('0xd')]);router[_0x5bb0('0x9')](_0x5bb0('0xe'),auth['isAuthenticated'](),controller[_0x5bb0('0xf')]);router['get'](_0x5bb0('0x10'),auth[_0x5bb0('0xb')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5bb0('0x11')](_0x5bb0('0xe'),auth[_0x5bb0('0xb')](),controller[_0x5bb0('0x12')]);router[_0x5bb0('0x11')](_0x5bb0('0x10'),auth[_0x5bb0('0xb')](),controller[_0x5bb0('0x13')]);router[_0x5bb0('0x14')](_0x5bb0('0xc'),auth[_0x5bb0('0xb')](),controller[_0x5bb0('0x15')]);router[_0x5bb0('0x16')](_0x5bb0('0xc'),auth[_0x5bb0('0xb')](),controller['destroy']);router[_0x5bb0('0x16')](_0x5bb0('0xe'),auth[_0x5bb0('0xb')](),controller[_0x5bb0('0x17')]);router[_0x5bb0('0x16')]('/:id/teams',auth[_0x5bb0('0xb')](),controller['removeTeams']);module[_0x5bb0('0x18')]=router; \ No newline at end of file +var _0x777f=['addAgents','/:id/teams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','describe','/:id','show','getAgents','getTeams','post','create','/:id/users'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x777f,0x9f));var _0xf777=function(_0x228641,_0x25d636){_0x228641=_0x228641-0x0;var _0x5d5d78=_0x777f[_0x228641];return _0x5d5d78;};'use strict';var multer=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var path=require(_0xf777('0x2'));var timeout=require(_0xf777('0x3'));var express=require(_0xf777('0x4'));var router=express[_0xf777('0x5')]();var fs_extra=require(_0xf777('0x6'));var auth=require(_0xf777('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf777('0x8'));var controller=require(_0xf777('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf777('0xa')](_0xf777('0xb'),auth[_0xf777('0xc')](),controller[_0xf777('0xd')]);router[_0xf777('0xa')](_0xf777('0xe'),auth[_0xf777('0xc')](),controller[_0xf777('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xf777('0x10')]);router[_0xf777('0xa')]('/:id/teams',auth[_0xf777('0xc')](),controller[_0xf777('0x11')]);router[_0xf777('0x12')]('/',auth['isAuthenticated'](),controller[_0xf777('0x13')]);router[_0xf777('0x12')](_0xf777('0x14'),auth[_0xf777('0xc')](),controller[_0xf777('0x15')]);router[_0xf777('0x12')](_0xf777('0x16'),auth['isAuthenticated'](),controller['addTeams']);router[_0xf777('0x17')]('/:id',auth[_0xf777('0xc')](),controller[_0xf777('0x18')]);router[_0xf777('0x19')]('/:id',auth[_0xf777('0xc')](),controller[_0xf777('0x1a')]);router[_0xf777('0x19')](_0xf777('0x14'),auth[_0xf777('0xc')](),controller[_0xf777('0x1b')]);router[_0xf777('0x19')](_0xf777('0x16'),auth[_0xf777('0xc')](),controller[_0xf777('0x1c')]);module[_0xf777('0x1d')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 4828a9b..f1ea628 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 _0xdbe5=['STRING','name','VIRTUAL','INTEGER','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xdbe5,0xea));var _0x5dbe=function(_0x134dfa,_0x175be8){_0x134dfa=_0x134dfa-0x0;var _0x180d25=_0xdbe5[_0x134dfa];return _0x180d25;};'use strict';var Sequelize=require(_0x5dbe('0x0'));module['exports']={'name':{'type':Sequelize[_0x5dbe('0x1')],'allowNull':![],'unique':_0x5dbe('0x2')},'prefix':{'type':Sequelize[_0x5dbe('0x3')],'get':function(_0xcf5b5f){return'system-'+this['getDataValue'](_0x5dbe('0x2'))+'-';}},'description':{'type':Sequelize[_0x5dbe('0x1')]},'callerIdAll':{'type':Sequelize[_0x5dbe('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x5dbe('0x4')]}}; \ No newline at end of file +var _0xcaee=['VIRTUAL','system-','name','INTEGER','exports','STRING'];(function(_0x522c57,_0x4b86a3){var _0x3626ec=function(_0x2540b5){while(--_0x2540b5){_0x522c57['push'](_0x522c57['shift']());}};_0x3626ec(++_0x4b86a3);}(_0xcaee,0x1c6));var _0xecae=function(_0x17643a,_0x22c57f){_0x17643a=_0x17643a-0x0;var _0x2b31a1=_0xcaee[_0x17643a];return _0x2b31a1;};'use strict';var Sequelize=require('sequelize');module[_0xecae('0x0')]={'name':{'type':Sequelize[_0xecae('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xecae('0x2')],'get':function(_0x1a365e){return _0xecae('0x3')+this['getDataValue'](_0xecae('0x4'))+'-';}},'description':{'type':Sequelize[_0xecae('0x1')]},'callerIdAll':{'type':Sequelize[_0xecae('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xecae('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index efc18f2..2eba5e1 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 _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(_0x15db73,_0x5d0076){var _0xefe368=function(_0xacc2a9){while(--_0xacc2a9){_0x15db73['push'](_0x15db73['shift']());}};_0xefe368(++_0x5d0076);}(_0xef0f,0x168));var _0xfef0=function(_0x15ea02,_0x4fefa8){_0x15ea02=_0x15ea02-0x0;var _0x1c01d8=_0xef0f[_0x15ea02];return _0x1c01d8;};'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 +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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4b17,0x10f));var _0x74b1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x4b17[_0x3070dc];return _0x431489;};'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 diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 393711a..9bae85f 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 _0x5554=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','remove','emit','hook'];(function(_0x31dff6,_0x3b2578){var _0x3a3998=function(_0x498ee2){while(--_0x498ee2){_0x31dff6['push'](_0x31dff6['shift']());}};_0x3a3998(++_0x3b2578);}(_0x5554,0x1a1));var _0x4555=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x5554[_0x34bf97];return _0x292719;};'use strict';var EventEmitter=require(_0x4555('0x0'));var VoicePrefix=require(_0x4555('0x1'))['db'][_0x4555('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4555('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4555('0x4')};function emitEvent(_0x19c607){return function(_0x10a9f5,_0x15c702,_0xddd432){VoicePrefixEvents[_0x4555('0x5')](_0x19c607+':'+_0x10a9f5['id'],_0x10a9f5);VoicePrefixEvents[_0x4555('0x5')](_0x19c607,_0x10a9f5);_0xddd432(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x4555('0x6')](e,emitEvent(event));}}module[_0x4555('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x07c1=['VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5ec334,_0x20923c){var _0x311347=function(_0x327185){while(--_0x327185){_0x5ec334['push'](_0x5ec334['shift']());}};_0x311347(++_0x20923c);}(_0x07c1,0x9e));var _0x107c=function(_0x4d4cda,_0x12b180){_0x4d4cda=_0x4d4cda-0x0;var _0x38e4af=_0x07c1[_0x4d4cda];return _0x38e4af;};'use strict';var EventEmitter=require(_0x107c('0x0'));var VoicePrefix=require(_0x107c('0x1'))['db'][_0x107c('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x107c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x107c('0x4'),'afterDestroy':_0x107c('0x5')};function emitEvent(_0x578eb6){return function(_0x247d09,_0x1ac6fc,_0x22b576){VoicePrefixEvents[_0x107c('0x6')](_0x578eb6+':'+_0x247d09['id'],_0x247d09);VoicePrefixEvents[_0x107c('0x6')](_0x578eb6,_0x247d09);_0x22b576(null);};}for(var e in events){if(events[_0x107c('0x7')](e)){var event=events[e];VoicePrefix[_0x107c('0x8')](e,emitEvent(event));}}module[_0x107c('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 9b6b6e7..2b81ff1 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 _0xa4ff=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger'];(function(_0x5b9709,_0x5ce3e9){var _0x33f2f6=function(_0x2a10fe){while(--_0x2a10fe){_0x5b9709['push'](_0x5b9709['shift']());}};_0x33f2f6(++_0x5ce3e9);}(_0xa4ff,0x142));var _0xfa4f=function(_0x4e8cec,_0x579240){_0x4e8cec=_0x4e8cec-0x0;var _0x24dcdb=_0xa4ff[_0x4e8cec];return _0x24dcdb;};'use strict';var _=require(_0xfa4f('0x0'));var util=require(_0xfa4f('0x1'));var logger=require(_0xfa4f('0x2'))(_0xfa4f('0x3'));var moment=require('moment');var BPromise=require(_0xfa4f('0x4'));var rp=require(_0xfa4f('0x5'));var fs=require('fs');var path=require(_0xfa4f('0x6'));var rimraf=require(_0xfa4f('0x7'));var config=require(_0xfa4f('0x8'));var attributes=require(_0xfa4f('0x9'));module[_0xfa4f('0xa')]=function(_0x1e246d,_0x1ab8cd){return _0x1e246d[_0xfa4f('0xb')](_0xfa4f('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7708=['../../config/environment','exports','define','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x7708,0x1a1));var _0x8770=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x7708[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require(_0x8770('0x2'))('api');var moment=require(_0x8770('0x3'));var BPromise=require(_0x8770('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8770('0x5'));var rimraf=require('rimraf');var config=require(_0x8770('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x8770('0x7')]=function(_0x254fac,_0x14d655){return _0x254fac[_0x8770('0x8')]('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 b7ad61c..43a0474 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 _0xdab3=['then','info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoicePrefix,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x7f91f8,_0x45e91b){var _0x49eb21=function(_0x50b983){while(--_0x50b983){_0x7f91f8['push'](_0x7f91f8['shift']());}};_0x49eb21(++_0x45e91b);}(_0xdab3,0xeb));var _0x3dab=function(_0x4f0a78,_0x34c9da){_0x4f0a78=_0x4f0a78-0x0;var _0x24bda2=_0xdab3[_0x4f0a78];return _0x24bda2;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var moment=require('moment');var BPromise=require(_0x3dab('0x2'));var rs=require(_0x3dab('0x3'));var fs=require('fs');var Redis=require(_0x3dab('0x4'));var db=require(_0x3dab('0x5'))['db'];var utils=require(_0x3dab('0x6'));var logger=require(_0x3dab('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3dab('0x8'));var client=jayson[_0x3dab('0x9')][_0x3dab('0xa')]({'port':0x232a});config[_0x3dab('0xb')]=_[_0x3dab('0xc')](config[_0x3dab('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3dab('0xd'))(new Redis(config[_0x3dab('0xb')]));require(_0x3dab('0xe'))[_0x3dab('0xf')](socket);function respondWithRpcPromise(_0xcec578,_0xf7ea3d,_0x1f6b1b){return new BPromise(function(_0x4943ae,_0x45f023){return client[_0x3dab('0x10')](_0xcec578,_0x1f6b1b)[_0x3dab('0x11')](function(_0x454e3a){logger[_0x3dab('0x12')]('VoicePrefix,\x20%s,\x20%s',_0xf7ea3d,'request\x20sent');logger[_0x3dab('0x13')](_0x3dab('0x14'),_0xf7ea3d,_0x3dab('0x15'),JSON[_0x3dab('0x16')](_0x454e3a));if(_0x454e3a[_0x3dab('0x17')]){if(_0x454e3a[_0x3dab('0x17')][_0x3dab('0x18')]===0x1f4){logger[_0x3dab('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xf7ea3d,_0x454e3a[_0x3dab('0x17')][_0x3dab('0x19')]);return _0x45f023(_0x454e3a[_0x3dab('0x17')][_0x3dab('0x19')]);}logger[_0x3dab('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xf7ea3d,_0x454e3a['error'][_0x3dab('0x19')]);return _0x4943ae(_0x454e3a[_0x3dab('0x17')][_0x3dab('0x19')]);}else{logger[_0x3dab('0x12')](_0x3dab('0x1a'),_0xf7ea3d,'request\x20sent');_0x4943ae(_0x454e3a[_0x3dab('0x1b')][_0x3dab('0x19')]);}})['catch'](function(_0x38337d){logger[_0x3dab('0x17')](_0x3dab('0x1a'),_0xf7ea3d,_0x38337d);_0x45f023(_0x38337d);});});} \ No newline at end of file +var _0xcd0e=['defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5e3b4d,_0x292f10){var _0x3a5e56=function(_0x3bec7e){while(--_0x3bec7e){_0x5e3b4d['push'](_0x5e3b4d['shift']());}};_0x3a5e56(++_0x292f10);}(_0xcd0e,0xe9));var _0xecd0=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xcd0e[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xecd0('0x0'));var util=require(_0xecd0('0x1'));var moment=require(_0xecd0('0x2'));var BPromise=require(_0xecd0('0x3'));var rs=require(_0xecd0('0x4'));var fs=require('fs');var Redis=require(_0xecd0('0x5'));var db=require(_0xecd0('0x6'))['db'];var utils=require(_0xecd0('0x7'));var logger=require(_0xecd0('0x8'))(_0xecd0('0x9'));var config=require(_0xecd0('0xa'));var jayson=require(_0xecd0('0xb'));var client=jayson[_0xecd0('0xc')][_0xecd0('0xd')]({'port':0x232a});config[_0xecd0('0xe')]=_[_0xecd0('0xf')](config[_0xecd0('0xe')],{'host':_0xecd0('0x10'),'port':0x18eb});var socket=require(_0xecd0('0x11'))(new Redis(config['redis']));require(_0xecd0('0x12'))[_0xecd0('0x13')](socket);function respondWithRpcPromise(_0x3f4534,_0x375315,_0x2b0840){return new BPromise(function(_0x3bb95e,_0x1c047a){return client[_0xecd0('0x14')](_0x3f4534,_0x2b0840)[_0xecd0('0x15')](function(_0x5ae4b3){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x375315,_0xecd0('0x16'));logger[_0xecd0('0x17')](_0xecd0('0x18'),_0x375315,_0xecd0('0x16'),JSON[_0xecd0('0x19')](_0x5ae4b3));if(_0x5ae4b3[_0xecd0('0x1a')]){if(_0x5ae4b3['error']['code']===0x1f4){logger[_0xecd0('0x1a')](_0xecd0('0x1b'),_0x375315,_0x5ae4b3['error'][_0xecd0('0x1c')]);return _0x1c047a(_0x5ae4b3[_0xecd0('0x1a')]['message']);}logger['error'](_0xecd0('0x1b'),_0x375315,_0x5ae4b3['error'][_0xecd0('0x1c')]);return _0x3bb95e(_0x5ae4b3[_0xecd0('0x1a')]['message']);}else{logger[_0xecd0('0x1d')](_0xecd0('0x1b'),_0x375315,_0xecd0('0x16'));_0x3bb95e(_0x5ae4b3['result'][_0xecd0('0x1c')]);}})[_0xecd0('0x1e')](function(_0x13736a){logger['error'](_0xecd0('0x1b'),_0x375315,_0x13736a);_0x1c047a(_0x13736a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f888dd5..2d77cc0 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 _0x902b=['register','./voicePrefix.events','remove','update','emit'];(function(_0x35da54,_0x47e8d6){var _0x19d34d=function(_0x38b602){while(--_0x38b602){_0x35da54['push'](_0x35da54['shift']());}};_0x19d34d(++_0x47e8d6);}(_0x902b,0x6a));var _0xb902=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x902b[_0x36ed48];return _0x51c63a;};'use strict';var VoicePrefixEvents=require(_0xb902('0x0'));var events=['save',_0xb902('0x1'),_0xb902('0x2')];function createListener(_0x26d7c7,_0x20a412){return function(_0xa2acb9){_0x20a412[_0xb902('0x3')](_0x26d7c7,_0xa2acb9);};}function removeListener(_0x492bd4,_0x1af7b5){return function(){VoicePrefixEvents['removeListener'](_0x492bd4,_0x1af7b5);};}exports[_0xb902('0x4')]=function(_0x5d38bb){for(var _0x157e14=0x0,_0x5e7240=events['length'];_0x157e14<_0x5e7240;_0x157e14++){var _0x5b0b74=events[_0x157e14];var _0x55331d=createListener('voicePrefix:'+_0x5b0b74,_0x5d38bb);VoicePrefixEvents['on'](_0x5b0b74,_0x55331d);}}; \ No newline at end of file +var _0x049e=['register','length','./voicePrefix.events','save','update','emit'];(function(_0x54f1b3,_0x590323){var _0x254029=function(_0x220e29){while(--_0x220e29){_0x54f1b3['push'](_0x54f1b3['shift']());}};_0x254029(++_0x590323);}(_0x049e,0x16a));var _0xe049=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x049e[_0x2850c0];return _0x21e830;};'use strict';var VoicePrefixEvents=require(_0xe049('0x0'));var events=[_0xe049('0x1'),'remove',_0xe049('0x2')];function createListener(_0x47aa93,_0x155cb3){return function(_0x13cc6a){_0x155cb3[_0xe049('0x3')](_0x47aa93,_0x13cc6a);};}function removeListener(_0x4001a8,_0x2abd06){return function(){VoicePrefixEvents['removeListener'](_0x4001a8,_0x2abd06);};}exports[_0xe049('0x4')]=function(_0x196af2){for(var _0x22e8f5=0x0,_0x221a5f=events[_0xe049('0x5')];_0x22e8f5<_0x221a5f;_0x22e8f5++){var _0x17945b=events[_0x22e8f5];var _0x22abb2=createListener('voicePrefix:'+_0x17945b,_0x196af2);VoicePrefixEvents['on'](_0x17945b,_0x22abb2);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index a6d0429..5cd3ec8 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 _0x1a91=['/:id/users','getAgents','/:id/members','getMembers','/:id/blacklists','getBlackLists','post','create','/:id/clone','/:id/teams','addTeams','addBlackLists','update','destroy','delete','removeTeams','removeLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getTeams'];(function(_0x4c3728,_0x39fd17){var _0xbe7497=function(_0x5c154b){while(--_0x5c154b){_0x4c3728['push'](_0x4c3728['shift']());}};_0xbe7497(++_0x39fd17);}(_0x1a91,0xa9));var _0x11a9=function(_0x375961,_0x211a76){_0x375961=_0x375961-0x0;var _0x50f35a=_0x1a91[_0x375961];return _0x50f35a;};'use strict';var multer=require(_0x11a9('0x0'));var util=require(_0x11a9('0x1'));var path=require(_0x11a9('0x2'));var timeout=require(_0x11a9('0x3'));var express=require(_0x11a9('0x4'));var router=express[_0x11a9('0x5')]();var fs_extra=require(_0x11a9('0x6'));var auth=require(_0x11a9('0x7'));var interaction=require(_0x11a9('0x8'));var config=require(_0x11a9('0x9'));var controller=require(_0x11a9('0xa'));router[_0x11a9('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x11a9('0xc'),auth[_0x11a9('0xd')](),controller[_0x11a9('0xe')]);router[_0x11a9('0xb')](_0x11a9('0xf'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x10')]);router[_0x11a9('0xb')](_0x11a9('0x11'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x12')]);router[_0x11a9('0xb')]('/:id/hopper_finals',auth[_0x11a9('0xd')](),controller['getHopperFinals']);router[_0x11a9('0xb')](_0x11a9('0x13'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get']('/:id/teams',auth[_0x11a9('0xd')](),controller[_0x11a9('0x14')]);router[_0x11a9('0xb')](_0x11a9('0x15'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x16')]);router[_0x11a9('0xb')](_0x11a9('0x17'),auth['isAuthenticated'](),controller[_0x11a9('0x18')]);router[_0x11a9('0xb')]('/:id/lists',auth[_0x11a9('0xd')](),controller['getLists']);router[_0x11a9('0xb')](_0x11a9('0x19'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x1a')]);router[_0x11a9('0x1b')]('/',auth['isAuthenticated'](),controller[_0x11a9('0x1c')]);router[_0x11a9('0x1b')](_0x11a9('0x1d'),auth[_0x11a9('0xd')](),controller['clone']);router[_0x11a9('0x1b')](_0x11a9('0x1e'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x1f')]);router[_0x11a9('0x1b')]('/:id/users',auth[_0x11a9('0xd')](),controller['addAgents']);router['post']('/:id/lists',auth[_0x11a9('0xd')](),controller['addLists']);router[_0x11a9('0x1b')]('/:id/blacklists',auth[_0x11a9('0xd')](),controller[_0x11a9('0x20')]);router['put'](_0x11a9('0xc'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x21')]);router['delete'](_0x11a9('0xc'),auth[_0x11a9('0xd')](),controller[_0x11a9('0x22')]);router[_0x11a9('0x23')](_0x11a9('0x1e'),auth['isAuthenticated'](),controller[_0x11a9('0x24')]);router[_0x11a9('0x23')](_0x11a9('0x15'),auth[_0x11a9('0xd')](),controller['removeAgents']);router[_0x11a9('0x23')]('/:id/lists',auth[_0x11a9('0xd')](),controller[_0x11a9('0x25')]);router[_0x11a9('0x23')]('/:id/blacklists',auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0xd61b=['post','addTeams','addAgents','addLists','addBlackLists','put','delete','removeTeams','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','clone'];(function(_0x57f3bb,_0x3aaa94){var _0x3010af=function(_0x394611){while(--_0x394611){_0x57f3bb['push'](_0x57f3bb['shift']());}};_0x3010af(++_0x3aaa94);}(_0xd61b,0x187));var _0xbd61=function(_0x31fb16,_0x262d15){_0x31fb16=_0x31fb16-0x0;var _0xc1998b=_0xd61b[_0x31fb16];return _0xc1998b;};'use strict';var multer=require(_0xbd61('0x0'));var util=require(_0xbd61('0x1'));var path=require(_0xbd61('0x2'));var timeout=require(_0xbd61('0x3'));var express=require(_0xbd61('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd61('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd61('0x6'));var controller=require('./voiceQueue.controller');router['get']('/',auth[_0xbd61('0x7')](),controller[_0xbd61('0x8')]);router[_0xbd61('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbd61('0xa')]);router[_0xbd61('0x9')](_0xbd61('0xb'),auth[_0xbd61('0x7')](),controller[_0xbd61('0xc')]);router[_0xbd61('0x9')](_0xbd61('0xd'),auth[_0xbd61('0x7')](),controller[_0xbd61('0xe')]);router['get'](_0xbd61('0xf'),auth[_0xbd61('0x7')](),controller['getHopperFinals']);router[_0xbd61('0x9')]('/:id/hopper_black',auth[_0xbd61('0x7')](),controller[_0xbd61('0x10')]);router[_0xbd61('0x9')](_0xbd61('0x11'),auth['isAuthenticated'](),controller[_0xbd61('0x12')]);router[_0xbd61('0x9')](_0xbd61('0x13'),auth[_0xbd61('0x7')](),controller[_0xbd61('0x14')]);router[_0xbd61('0x9')]('/:id/members',auth[_0xbd61('0x7')](),controller['getMembers']);router[_0xbd61('0x9')](_0xbd61('0x15'),auth['isAuthenticated'](),controller[_0xbd61('0x16')]);router[_0xbd61('0x9')](_0xbd61('0x17'),auth[_0xbd61('0x7')](),controller['getBlackLists']);router['post']('/',auth[_0xbd61('0x7')](),controller[_0xbd61('0x18')]);router['post'](_0xbd61('0x19'),auth[_0xbd61('0x7')](),controller[_0xbd61('0x1a')]);router[_0xbd61('0x1b')]('/:id/teams',auth[_0xbd61('0x7')](),controller[_0xbd61('0x1c')]);router['post'](_0xbd61('0x13'),auth[_0xbd61('0x7')](),controller[_0xbd61('0x1d')]);router[_0xbd61('0x1b')](_0xbd61('0x15'),auth[_0xbd61('0x7')](),controller[_0xbd61('0x1e')]);router[_0xbd61('0x1b')]('/:id/blacklists',auth[_0xbd61('0x7')](),controller[_0xbd61('0x1f')]);router[_0xbd61('0x20')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbd61('0x21')]('/:id',auth[_0xbd61('0x7')](),controller['destroy']);router[_0xbd61('0x21')](_0xbd61('0x11'),auth['isAuthenticated'](),controller[_0xbd61('0x22')]);router[_0xbd61('0x21')]('/:id/users',auth[_0xbd61('0x7')](),controller['removeAgents']);router[_0xbd61('0x21')]('/:id/lists',auth[_0xbd61('0x7')](),controller[_0xbd61('0x23')]);router['delete']('/:id/blacklists',auth[_0xbd61('0x7')](),controller[_0xbd61('0x24')]);module[_0xbd61('0x25')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a439ecc..81ba4a2 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 _0xd0a4=['STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','rrmemory','rrordered','ringall','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','INTEGER','yes','once','TEXT','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports'];(function(_0x3530af,_0x1210ac){var _0x236595=function(_0x208ec2){while(--_0x208ec2){_0x3530af['push'](_0x3530af['shift']());}};_0x236595(++_0x1210ac);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd0a4[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x4d0a('0x0'));module[_0x4d0a('0x1')]={'name':{'type':Sequelize[_0x4d0a('0x2')],'allowNull':![],'unique':_0x4d0a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x5'),_0x4d0a('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':_0x4d0a('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x4d0a('0x8'),_0x4d0a('0x9'),'random',_0x4d0a('0xa'),'linear','wrandom',_0x4d0a('0xb')),'allowNull':![],'defaultValue':_0x4d0a('0xc'),'set':function(_0x3a421f){this['setDataValue'](_0x4d0a('0xd'),_0x3a421f?_0x3a421f:_0x4d0a('0xa'));},'get':function(){var _0x29d5ff=this[_0x4d0a('0xe')](_0x4d0a('0xf'));var _0x99cb99=this[_0x4d0a('0xe')](_0x4d0a('0x10'));var _0x477bd2=this[_0x4d0a('0xe')]('strategy');if(_0x29d5ff==='inbound'){return _0x477bd2;}if(_0x99cb99===_0x4d0a('0x11')&&_0x477bd2===_0x4d0a('0xa')||_0x99cb99===_0x4d0a('0x11')&&_0x477bd2===_0x4d0a('0x12')){return _0x477bd2;}if(_0x99cb99===_0x4d0a('0x13')||_0x99cb99==='predictive'||_0x99cb99==='power'){return _0x477bd2;}return null;}},'servicelevel':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4d0a('0x14')](0xb)},'timeout':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4d0a('0x2')]},'weight':{'type':Sequelize[_0x4d0a('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':_0x4d0a('0x15')},'autopause':{'type':Sequelize['ENUM'](_0x4d0a('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4d0a('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x4d0a('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4d0a('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':_0x4d0a('0x15')},'announce_holdtime':{'type':Sequelize[_0x4d0a('0x4')]('yes','no',_0x4d0a('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4d0a('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x4d0a('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4d0a('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4d0a('0x2')]},'queue_youarenext':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4d0a('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4d0a('0x2')]},'queue_quantity1':{'type':Sequelize[_0x4d0a('0x2')]},'queue_quantity2':{'type':Sequelize[_0x4d0a('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x4d0a('0x2')]},'periodic_announce':{'type':Sequelize[_0x4d0a('0x17')],'set':function(_0x4646bc){this['setDataValue'](_0x4d0a('0x18'),_0x4646bc?_0x4646bc[_0x4d0a('0x19')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x4d0a('0xe')](_0x4d0a('0x18'))[_0x4d0a('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x4d0a('0x15'),'set':function(_0x1be190){this[_0x4d0a('0x1b')]('joinempty',_0x1be190?_0x1be190[_0x4d0a('0x19')](','):undefined);},'get':function(){return this[_0x4d0a('0xe')](_0x4d0a('0x1c'))?this[_0x4d0a('0xe')](_0x4d0a('0x1c'))[_0x4d0a('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':'no','set':function(_0x207259){this[_0x4d0a('0x1b')](_0x4d0a('0x1d'),_0x207259?_0x207259[_0x4d0a('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x4d0a('0x1d'))?this[_0x4d0a('0xe')]('leavewhenempty')[_0x4d0a('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4d0a('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4d0a('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x57aa2e){this[_0x4d0a('0x1b')](_0x4d0a('0x1e'),_0x57aa2e);if(_0x57aa2e){if(this[_0x4d0a('0xe')](_0x4d0a('0x1f'))<0x2){this[_0x4d0a('0x1b')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4d0a('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4d0a('0x20')],'defaultValue':0x0,'comment':_0x4d0a('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0x4d0a('0x22'),_0x4d0a('0x13'),_0x4d0a('0x23'),'predictive',_0x4d0a('0x11')),'defaultValue':_0x4d0a('0x13'),'comment':_0x4d0a('0x24')},'dialLimitChannel':{'type':Sequelize[_0x4d0a('0x14')](0x4)[_0x4d0a('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4d0a('0x26')},'dialLimitQueue':{'type':Sequelize[_0x4d0a('0x14')](0x4)[_0x4d0a('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4d0a('0x27')},'dialPowerLevel':{'type':Sequelize[_0x4d0a('0x28')](0x2)[_0x4d0a('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4d0a('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x4d0a('0x2a')),'defaultValue':_0x4d0a('0x2a'),'comment':_0x4d0a('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4d0a('0x28')](0x2)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4d0a('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4d0a('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4d0a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4d0a('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':_0x4d0a('0x2f'),'comment':_0x4d0a('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x31')},'dialQueueProject':{'type':Sequelize[_0x4d0a('0x2')],'comment':_0x4d0a('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4d0a('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d0a('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x35')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'comment':_0x4d0a('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d0a('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':_0x4d0a('0x38')},'dialPrefix':{'type':Sequelize[_0x4d0a('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4d0a('0x4')](_0x4d0a('0x39'),_0x4d0a('0x3a'),'onlyIfOpen'),'defaultValue':_0x4d0a('0x39')},'dialAMDActive':{'type':Sequelize[_0x4d0a('0x20')],'defaultValue':0x0,'comment':_0x4d0a('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x4d0a('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4d0a('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x4d0a('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4d0a('0x14')](0x9)[_0x4d0a('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4d0a('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4d0a('0x14')](0x9)[_0x4d0a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4d0a('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4d0a('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4d0a('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4d0a('0x14')](0x9)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4d0a('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4d0a('0x14')](0x5)[_0x4d0a('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4d0a('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4d0a('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x4d0a('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4d0a('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x4d0a('0x20')],'defaultValue':0x0,'comment':_0x4d0a('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4d0a('0x4')]('DESC',_0x4d0a('0x43')),'defaultValue':_0x4d0a('0x44')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x4d0a('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4d0a('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4d0a('0x45')},'dialCutDigit':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4d0a('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4d0a('0x14')](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x48')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d0a('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4d0a('0x14')](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4d0a('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4d0a('0x14')](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4d0a('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4d0a('0x14')](0x5)[_0x4d0a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4d0a('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4d0a('0x20')],'defaultValue':![],'comment':_0x4d0a('0x4e'),'set':function(_0x751801){if(!_0x751801)this[_0x4d0a('0x1b')]('mandatoryDispositionPauseId',null);this[_0x4d0a('0x1b')](_0x4d0a('0x4f'),_0x751801);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4d0a('0x14')](0x3)[_0x4d0a('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa1f6=['#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)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x218dd8,_0x46df98){var _0x3de3f2=function(_0xeb2f61){while(--_0xeb2f61){_0x218dd8['push'](_0x218dd8['shift']());}};_0x3de3f2(++_0x46df98);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xa1f6[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x6a1f('0x0'));module[_0x6a1f('0x1')]={'name':{'type':Sequelize[_0x6a1f('0x2')],'allowNull':![],'unique':_0x6a1f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x5'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x6a1f('0x4')]('rr',_0x6a1f('0x6'),_0x6a1f('0x7'),_0x6a1f('0x8'),_0x6a1f('0x9'),_0x6a1f('0xa'),_0x6a1f('0xb'),'wrandom',_0x6a1f('0xc')),'allowNull':![],'defaultValue':_0x6a1f('0x6'),'set':function(_0x2300b1){this[_0x6a1f('0xd')](_0x6a1f('0xe'),_0x2300b1?_0x2300b1:'rrmemory');},'get':function(){var _0x30fd4e=this[_0x6a1f('0xf')](_0x6a1f('0x10'));var _0x3151f9=this['getDataValue'](_0x6a1f('0x11'));var _0x4de5e8=this[_0x6a1f('0xf')](_0x6a1f('0xe'));if(_0x30fd4e===_0x6a1f('0x5')){return _0x4de5e8;}if(_0x3151f9===_0x6a1f('0x12')&&_0x4de5e8===_0x6a1f('0xa')||_0x3151f9===_0x6a1f('0x12')&&_0x4de5e8===_0x6a1f('0x13')){return _0x4de5e8;}if(_0x3151f9===_0x6a1f('0x14')||_0x3151f9===_0x6a1f('0x15')||_0x3151f9===_0x6a1f('0x16')){return _0x4de5e8;}return null;}},'servicelevel':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x6a1f('0x17')](0xb)},'timeout':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6a1f('0x2')]},'weight':{'type':Sequelize[_0x6a1f('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x6a1f('0x4')]('yes','no'),'defaultValue':_0x6a1f('0x18')},'autopause':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x18'),'no',_0x6a1f('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x6a1f('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x6a1f('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6a1f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6a1f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x6a1f('0x18'),'no'),'defaultValue':_0x6a1f('0x18')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6a1f('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6a1f('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6a1f('0x2')]},'queue_youarenext':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6a1f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x6a1f('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x6a1f('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x6a1f('0x2')]},'queue_less_than':{'type':Sequelize[_0x6a1f('0x2')]},'periodic_announce':{'type':Sequelize[_0x6a1f('0x1a')],'set':function(_0x2e71a5){this[_0x6a1f('0xd')](_0x6a1f('0x1b'),_0x2e71a5?_0x2e71a5['join'](','):[]);},'get':function(){return this['getDataValue'](_0x6a1f('0x1b'))?this[_0x6a1f('0xf')](_0x6a1f('0x1b'))[_0x6a1f('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':_0x6a1f('0x18'),'set':function(_0x35e5ab){this['setDataValue'](_0x6a1f('0x1d'),_0x35e5ab?_0x35e5ab[_0x6a1f('0x1e')](','):undefined);},'get':function(){return this['getDataValue'](_0x6a1f('0x1d'))?this[_0x6a1f('0xf')](_0x6a1f('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5b003e){this[_0x6a1f('0xd')](_0x6a1f('0x1f'),_0x5b003e?_0x5b003e['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x6a1f('0x1f'))?this[_0x6a1f('0xf')](_0x6a1f('0x1f'))[_0x6a1f('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6a1f('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6a1f('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x6a1f('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x6a1f('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':0x0,'set':function(_0x72ec84){this['setDataValue'](_0x6a1f('0x21'),_0x72ec84);if(_0x72ec84){if(this['getDataValue'](_0x6a1f('0x22'))<0x2){this['setDataValue'](_0x6a1f('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':0x0,'comment':_0x6a1f('0x23')},'dialMethod':{'type':Sequelize['ENUM'](_0x6a1f('0x24'),_0x6a1f('0x14'),'power','predictive',_0x6a1f('0x12')),'defaultValue':_0x6a1f('0x14'),'comment':_0x6a1f('0x25')},'dialLimitChannel':{'type':Sequelize[_0x6a1f('0x17')](0x4)[_0x6a1f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6a1f('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x6a1f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6a1f('0x28')},'dialPowerLevel':{'type':Sequelize[_0x6a1f('0x29')](0x2)[_0x6a1f('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6a1f('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x2b'),_0x6a1f('0x2c')),'defaultValue':_0x6a1f('0x2c'),'comment':_0x6a1f('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6a1f('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6a1f('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6a1f('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6a1f('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6a1f('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6a1f('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':_0x6a1f('0x30'),'comment':_0x6a1f('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a1f('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x6a1f('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a1f('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6a1f('0x17')](0x5)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a1f('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a1f('0x36')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'comment':_0x6a1f('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6a1f('0x17')](0x5)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a1f('0x38')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x6a1f('0x39'),_0x6a1f('0x3a'),_0x6a1f('0x3b')),'defaultValue':_0x6a1f('0x39')},'dialAMDActive':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':0x0,'comment':_0x6a1f('0x3c')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6a1f('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6a1f('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x6a1f('0x17')](0x9)[_0x6a1f('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6a1f('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6a1f('0x17')](0x9)[_0x6a1f('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6a1f('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6a1f('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6a1f('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x6a1f('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6a1f('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6a1f('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6a1f('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6a1f('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6a1f('0x17')](0x5)[_0x6a1f('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6a1f('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6a1f('0x43')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6a1f('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x6a1f('0x4')](_0x6a1f('0x45'),_0x6a1f('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x6a1f('0x2')],'comment':_0x6a1f('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6a1f('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a1f('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x6a1f('0x17')](0x5)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a1f('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6a1f('0x17')](0x5)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a1f('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x6a1f('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a1f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a1f('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6a1f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a1f('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6a1f('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6a1f('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x44a026){if(!_0x44a026)this[_0x6a1f('0xd')](_0x6a1f('0x4d'),null);this['setDataValue'](_0x6a1f('0x4e'),_0x44a026);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x6a1f('0x17')](0x3)[_0x6a1f('0x26')],'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 73b4528..9db14b9 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 _0xb50f=['getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','upsert','isNil','format','SIP/%s','interface','voicePause','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','spread','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ListId','updatedAt','select','scheduledAt','ContactId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','CmHopper','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','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/license/util','redis','localhost','socket.io-emitter','register','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','ignore','value','includes','type','name','UserProfileResource','sendStatus','error','send','map','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','rawAttributes','pick','VoiceQueueId'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0xb50f,0x1c2));var _0xfb50=function(_0x2657fa,_0x15fab8){_0x2657fa=_0x2657fa-0x0;var _0x555b92=_0xb50f[_0x2657fa];return _0x555b92;};'use strict';var emlformat=require(_0xfb50('0x0'));var rimraf=require(_0xfb50('0x1'));var zipdir=require(_0xfb50('0x2'));var jsonpatch=require(_0xfb50('0x3'));var rp=require(_0xfb50('0x4'));var moment=require('moment');var BPromise=require(_0xfb50('0x5'));var Mustache=require(_0xfb50('0x6'));var util=require(_0xfb50('0x7'));var path=require(_0xfb50('0x8'));var sox=require(_0xfb50('0x9'));var csv=require('to-csv');var ejs=require(_0xfb50('0xa'));var fs=require('fs');var fs_extra=require(_0xfb50('0xb'));var _=require('lodash');var squel=require(_0xfb50('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb50('0xd'));var deskjs=require(_0xfb50('0xe'));var toCsv=require(_0xfb50('0xf'));var querystring=require('querystring');var Papa=require(_0xfb50('0x10'));var Redis=require(_0xfb50('0x11'));var authService=require(_0xfb50('0x12'));var qs=require(_0xfb50('0x13'));var as=require(_0xfb50('0x14'));var hardwareService=require(_0xfb50('0x15'));var logger=require(_0xfb50('0x16'))(_0xfb50('0x17'));var utils=require(_0xfb50('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfb50('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xfb50('0x1a')],{'host':_0xfb50('0x1b'),'port':0x18eb});var socket=require(_0xfb50('0x1c'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xfb50('0x1d')](socket);function respondWithStatusCode(_0x1f8fef,_0x5b003f){_0x5b003f=_0x5b003f||0xcc;return function(_0x5e44f9){if(_0x5e44f9){return _0x1f8fef['sendStatus'](_0x5b003f);}return _0x1f8fef[_0xfb50('0x1e')](_0x5b003f)[_0xfb50('0x1f')]();};}function respondWithResult(_0x399478,_0x1165bb){_0x1165bb=_0x1165bb||0xc8;return function(_0x2efd03){if(_0x2efd03){return _0x399478[_0xfb50('0x1e')](_0x1165bb)['json'](_0x2efd03);}};}function respondWithFilteredResult(_0x28274b,_0x33d44a){return function(_0x9473a5){if(_0x9473a5){var _0x4586ad=typeof _0x33d44a[_0xfb50('0x20')]===_0xfb50('0x21')&&typeof _0x33d44a['limit']===_0xfb50('0x21');var _0x472799=_0x9473a5[_0xfb50('0x22')];var _0x4973de=_0x4586ad?0x0:_0x33d44a[_0xfb50('0x20')];var _0x4bd86f=_0x4586ad?_0x9473a5['count']:_0x33d44a[_0xfb50('0x20')]+_0x33d44a[_0xfb50('0x23')];var _0x23a973;if(_0x4bd86f>=_0x472799){_0x4bd86f=_0x472799;_0x23a973=0xc8;}else{_0x23a973=0xce;}_0x28274b[_0xfb50('0x1e')](_0x23a973);return _0x28274b[_0xfb50('0x24')](_0xfb50('0x25'),_0x4973de+'-'+_0x4bd86f+'/'+_0x472799)[_0xfb50('0x26')](_0x9473a5);}return null;};}function patchUpdates(_0x5070a9){return function(_0x3dde24){try{jsonpatch[_0xfb50('0x27')](_0x3dde24,_0x5070a9,!![]);}catch(_0x470dbf){return BPromise[_0xfb50('0x28')](_0x470dbf);}return _0x3dde24[_0xfb50('0x29')]();};}function saveUpdates(_0x5a4240,_0x139096){return function(_0x1e00ff){if(_0x1e00ff){return _0x1e00ff[_0xfb50('0x2a')](_0x5a4240)[_0xfb50('0x2b')](function(_0x81ce92){return _0x81ce92;});}return null;};}function removeEntity(_0x44d4ab,_0xfed93e){return function(_0x294db0){if(_0x294db0){return _0x294db0[_0xfb50('0x2c')]()[_0xfb50('0x2b')](function(){var _0xc49119=_0x294db0[_0xfb50('0x2d')]({'plain':!![]});var _0x233e5d=[{'name':_0xfb50('0x2e'),'value':_0xfb50('0x2f'),'ignore':![]},{'name':_0xfb50('0x30'),'value':'outbound','ignore':![]}];var _0x2fbb3a=_(_0x233e5d)['filter'](_0xfb50('0x31'))['map'](_0xfb50('0x32'))['value']();if(_[_0xfb50('0x33')](_0x2fbb3a,_0xc49119[_0xfb50('0x34')])){return;}var _0x5081b5=_['find'](_0x233e5d,['value',_0xc49119[_0xfb50('0x34')]])[_0xfb50('0x35')];return db[_0xfb50('0x36')][_0xfb50('0x2c')]({'where':{'type':_0x5081b5,'resourceId':_0xc49119['id']}})[_0xfb50('0x2b')](function(){return _0x294db0;});})[_0xfb50('0x2b')](function(){_0x44d4ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x33ad9c,_0x4fa7eb){return function(_0x5726a7){if(!_0x5726a7){_0x33ad9c[_0xfb50('0x37')](0x194);}return _0x5726a7;};}function handleError(_0x242080,_0xaccf44){_0xaccf44=_0xaccf44||0x1f4;return function(_0x4fe85d){logger[_0xfb50('0x38')](_0x4fe85d['stack']);if(_0x4fe85d['name']){delete _0x4fe85d[_0xfb50('0x35')];}_0x242080[_0xfb50('0x1e')](_0xaccf44)[_0xfb50('0x39')](_0x4fe85d);};}exports['index']=function(_0x4599d4,_0x3be463){var _0x4a75cb={},_0x30d320={},_0x59569f={'count':0x0,'rows':[]};var _0x1be7c7=_[_0xfb50('0x3a')](db[_0xfb50('0x3b')]['rawAttributes'],function(_0x54c00f){return{'name':_0x54c00f[_0xfb50('0x3c')],'type':_0x54c00f[_0xfb50('0x34')][_0xfb50('0x3d')]};});_0x30d320[_0xfb50('0x3e')]=_['map'](_0x1be7c7,_0xfb50('0x35'));_0x30d320[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x4599d4[_0xfb50('0x3f')]);_0x30d320[_0xfb50('0x41')]=_[_0xfb50('0x42')](_0x30d320[_0xfb50('0x3e')],_0x30d320[_0xfb50('0x3f')]);_0x4a75cb[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x30d320[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x4599d4[_0xfb50('0x3f')][_0xfb50('0x44')]));_0x4a75cb['attributes']=_0x4a75cb[_0xfb50('0x43')]['length']?_0x4a75cb['attributes']:_0x30d320[_0xfb50('0x3e')];if(!_0x4599d4[_0xfb50('0x3f')][_0xfb50('0x45')](_0xfb50('0x46'))){_0x4a75cb[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x4599d4[_0xfb50('0x3f')][_0xfb50('0x23')]);_0x4a75cb[_0xfb50('0x20')]=qs[_0xfb50('0x20')](_0x4599d4[_0xfb50('0x3f')][_0xfb50('0x20')]);}_0x4a75cb[_0xfb50('0x47')]=qs['sort'](_0x4599d4[_0xfb50('0x3f')][_0xfb50('0x48')]);_0x4a75cb[_0xfb50('0x49')]=qs['filters'](_['pick'](_0x4599d4[_0xfb50('0x3f')],_0x30d320[_0xfb50('0x41')]),_0x1be7c7);if(_0x4599d4['query']['filter']){_0x4a75cb['where']=_[_0xfb50('0x4a')](_0x4a75cb[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x1be7c7,function(_0x30cf4c){if(_0x30cf4c[_0xfb50('0x34')]!==_0xfb50('0x4b')){var _0x18f0d5={};_0x18f0d5[_0x30cf4c['name']]={'$like':'%'+_0x4599d4['query'][_0xfb50('0x4c')]+'%'};return _0x18f0d5;}})});}_0x4a75cb=_[_0xfb50('0x4a')]({},_0x4a75cb,_0x4599d4[_0xfb50('0x4d')]);var _0x22fc0d={'where':_0x4a75cb['where']};return db[_0xfb50('0x3b')][_0xfb50('0x22')](_0x22fc0d)[_0xfb50('0x2b')](function(_0x581fb5){_0x59569f[_0xfb50('0x22')]=_0x581fb5;if(_0x4599d4[_0xfb50('0x3f')][_0xfb50('0x4e')]){_0x4a75cb[_0xfb50('0x4f')]=[{'all':!![]}];}return db['VoiceQueue'][_0xfb50('0x50')](_0x4a75cb);})[_0xfb50('0x2b')](function(_0x3e6cee){_0x59569f[_0xfb50('0x51')]=_0x3e6cee;return _0x59569f;})[_0xfb50('0x2b')](respondWithFilteredResult(_0x3be463,_0x4a75cb))[_0xfb50('0x52')](handleError(_0x3be463,null));};exports[_0xfb50('0x53')]=function(_0x407689,_0x1ba4bd){var _0x53b518={'raw':![],'where':{'id':_0x407689[_0xfb50('0x54')]['id']}},_0x3a41ac={};_0x3a41ac[_0xfb50('0x3e')]=_[_0xfb50('0x40')](db[_0xfb50('0x3b')]['rawAttributes']);_0x3a41ac[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x407689['query']);_0x3a41ac[_0xfb50('0x41')]=_['intersection'](_0x3a41ac[_0xfb50('0x3e')],_0x3a41ac[_0xfb50('0x3f')]);_0x53b518[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x3a41ac['model'],qs[_0xfb50('0x44')](_0x407689['query']['fields']));_0x53b518[_0xfb50('0x43')]=_0x53b518['attributes'][_0xfb50('0x55')]?_0x53b518['attributes']:_0x3a41ac[_0xfb50('0x3e')];if(_0x407689[_0xfb50('0x3f')]['includeAll']){_0x53b518['include']=[{'all':!![]}];}_0x53b518=_['merge']({},_0x53b518,_0x407689['options']);return db[_0xfb50('0x3b')][_0xfb50('0x56')](_0x53b518)[_0xfb50('0x2b')](handleEntityNotFound(_0x1ba4bd,null))['then'](respondWithResult(_0x1ba4bd,null))[_0xfb50('0x52')](handleError(_0x1ba4bd,null));};exports['create']=function(_0x15c9c6,_0x46b8a5){return db[_0xfb50('0x3b')][_0xfb50('0x57')](_0x15c9c6[_0xfb50('0x58')],{})['then'](function(_0x22203c){var _0x3ca43c=_0x15c9c6[_0xfb50('0x59')][_0xfb50('0x2d')]({'plain':!![]});if(!_0x3ca43c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ca43c[_0xfb50('0x5a')]==='user'){var _0x581c48=_0x22203c['get']({'plain':!![]});var _0x3be562=[{'name':_0xfb50('0x2e'),'value':_0xfb50('0x2f')},{'name':_0xfb50('0x30'),'value':_0xfb50('0x5b')}];var _0x1deac9=_['find'](_0x3be562,[_0xfb50('0x32'),_0x581c48['type']])[_0xfb50('0x35')];return db[_0xfb50('0x5c')][_0xfb50('0x56')]({'where':{'name':_0x1deac9,'userProfileId':_0x3ca43c[_0xfb50('0x5d')]},'raw':!![]})[_0xfb50('0x2b')](function(_0x3d67ca){if(_0x3d67ca&&_0x3d67ca[_0xfb50('0x5e')]===0x0){return db[_0xfb50('0x36')][_0xfb50('0x57')]({'name':_0x581c48[_0xfb50('0x35')],'resourceId':_0x581c48['id'],'type':_0x3d67ca[_0xfb50('0x35')],'sectionId':_0x3d67ca['id']},{})['then'](function(){return _0x22203c;});}else{return _0x22203c;}})[_0xfb50('0x52')](function(_0xd2ded2){logger[_0xfb50('0x38')](_0xfb50('0x5f'),_0xd2ded2);throw _0xd2ded2;});}return _0x22203c;})[_0xfb50('0x2b')](respondWithResult(_0x46b8a5,0xc9))[_0xfb50('0x52')](handleError(_0x46b8a5,null));};exports[_0xfb50('0x60')]=function(_0x224210,_0x3687d7){var _0x350e24={'where':{'id':_0x224210[_0xfb50('0x54')]['id']}},_0x1da62f={};_0x1da62f[_0xfb50('0x3e')]=_[_0xfb50('0x40')](db[_0xfb50('0x3b')]['rawAttributes']);_0x350e24[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x1da62f[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x224210[_0xfb50('0x3f')]['fields']));_0x350e24[_0xfb50('0x43')]=_0x350e24['attributes'][_0xfb50('0x55')]?_0x350e24[_0xfb50('0x43')]:_0x1da62f[_0xfb50('0x3e')];if(_0x224210['query'][_0xfb50('0x4e')]){_0x350e24[_0xfb50('0x4f')]=[{'all':!![]}];}_0x350e24=_[_0xfb50('0x4a')]({},_0x350e24,_0x224210['options']);return db[_0xfb50('0x3b')][_0xfb50('0x56')](_0x350e24)[_0xfb50('0x2b')](handleEntityNotFound(_0x3687d7,null))['then'](function(_0x4addd4){if(_0x4addd4){var _0x3c189d=_0x4addd4[_0xfb50('0x2d')]({'plain':!![]});_0x3c189d=qs[_0xfb50('0x61')](_0x3c189d,['id',_0xfb50('0x62'),'updatedAt']);_0x224210[_0xfb50('0x58')]=_[_0xfb50('0x61')](_0x224210[_0xfb50('0x58')],['id',_0xfb50('0x62'),'updatedAt']);return db[_0xfb50('0x3b')][_0xfb50('0x57')](_[_0xfb50('0x4a')](_0x3c189d,_0x224210['body']),{'include':_0x224210['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1111f0){var _0x783c74=_0x224210[_0xfb50('0x59')][_0xfb50('0x2d')]({'plain':!![]});if(!_0x783c74)throw new Error(_0xfb50('0x63'));if(_0x783c74[_0xfb50('0x5a')]===_0xfb50('0x59')){var _0x21a04a=_0x1111f0[_0xfb50('0x2d')]({'plain':!![]});var _0x45b478=[{'name':_0xfb50('0x2e'),'value':'inbound'},{'name':_0xfb50('0x30'),'value':'outbound'}];var _0x9bff1e=_[_0xfb50('0x56')](_0x45b478,['value',_0x21a04a[_0xfb50('0x34')]])[_0xfb50('0x35')];return db['UserProfileSection'][_0xfb50('0x56')]({'where':{'name':_0x9bff1e,'userProfileId':_0x783c74['userProfileId']},'raw':!![]})[_0xfb50('0x2b')](function(_0x558ba6){if(_0x558ba6&&_0x558ba6['autoAssociation']===0x0){return db[_0xfb50('0x36')]['create']({'name':_0x21a04a[_0xfb50('0x35')],'resourceId':_0x21a04a['id'],'type':_0x558ba6[_0xfb50('0x35')],'sectionId':_0x558ba6['id']},{})[_0xfb50('0x2b')](function(){return _0x1111f0;});}else{return _0x1111f0;}})['catch'](function(_0x2f3417){logger[_0xfb50('0x38')](_0xfb50('0x5f'),_0x2f3417);throw _0x2f3417;});}return _0x1111f0;});}})['then'](respondWithResult(_0x3687d7,0xc9))['catch'](handleError(_0x3687d7,null));};exports[_0xfb50('0x2a')]=function(_0x1167de,_0x167adc){if(_0x1167de[_0xfb50('0x58')]['id']){delete _0x1167de['body']['id'];}return db['VoiceQueue'][_0xfb50('0x56')]({'where':{'id':_0x1167de[_0xfb50('0x54')]['id']}})['then'](handleEntityNotFound(_0x167adc,null))[_0xfb50('0x2b')](saveUpdates(_0x1167de[_0xfb50('0x58')],null))[_0xfb50('0x2b')](respondWithResult(_0x167adc,null))[_0xfb50('0x52')](handleError(_0x167adc,null));};exports['destroy']=function(_0x2b61df,_0x4b73a9){return db[_0xfb50('0x3b')][_0xfb50('0x56')]({'where':{'id':_0x2b61df[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x4b73a9,null))['then'](removeEntity(_0x4b73a9,null))[_0xfb50('0x52')](handleError(_0x4b73a9,null));};exports[_0xfb50('0x64')]=function(_0x532ae3,_0x479b88,_0x5e7f1e){var _0x19b57c={'raw':![],'where':{}};var _0x40d681={};var _0x43fb79={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfb50('0x65')]({'where':{'id':_0x532ae3[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x479b88,null))[_0xfb50('0x2b')](function(_0x50c4eb){if(_0x50c4eb){_0x40d681['model']=_['keys'](db['CmHopper'][_0xfb50('0x66')]);_0x40d681[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x532ae3[_0xfb50('0x3f')]);_0x40d681[_0xfb50('0x41')]=_[_0xfb50('0x42')](_0x40d681[_0xfb50('0x3e')],_0x40d681[_0xfb50('0x3f')]);_0x19b57c[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x40d681[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x532ae3[_0xfb50('0x3f')][_0xfb50('0x44')]));_0x19b57c[_0xfb50('0x43')]=_0x19b57c['attributes']['length']?_0x19b57c[_0xfb50('0x43')]:_0x40d681[_0xfb50('0x3e')];if(!_0x532ae3[_0xfb50('0x3f')][_0xfb50('0x45')]('nolimit')){_0x19b57c[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x532ae3['query']['limit']);_0x19b57c['offset']=qs[_0xfb50('0x20')](_0x532ae3[_0xfb50('0x3f')][_0xfb50('0x20')]);}_0x19b57c[_0xfb50('0x47')]=qs[_0xfb50('0x48')](_0x532ae3['query']['sort']);_0x19b57c[_0xfb50('0x49')]=qs['filters'](_[_0xfb50('0x67')](_0x532ae3[_0xfb50('0x3f')],_0x40d681[_0xfb50('0x41')]));_0x19b57c[_0xfb50('0x49')][_0xfb50('0x68')]=_0x50c4eb['id'];if(_0x532ae3[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x19b57c[_0xfb50('0x49')]=_['merge'](_0x19b57c[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x19b57c[_0xfb50('0x43')],function(_0x1cf551){var _0x1a79c0={};_0x1a79c0[_0x1cf551]={'$like':'%'+_0x532ae3['query'][_0xfb50('0x4c')]+'%'};return _0x1a79c0;})});}_0x19b57c=_['merge']({},_0x19b57c,_0x532ae3[_0xfb50('0x4d')]);return db['CmHopper'][_0xfb50('0x22')]({'where':_0x19b57c[_0xfb50('0x49')]})['then'](function(_0x11ee55){_0x43fb79[_0xfb50('0x22')]=_0x11ee55;if(_0x532ae3[_0xfb50('0x3f')][_0xfb50('0x4e')]){_0x19b57c[_0xfb50('0x4f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x19b57c);})['then'](function(_0x7c6a37){_0x43fb79['rows']=_0x7c6a37;return _0x43fb79;});}})[_0xfb50('0x2b')](respondWithFilteredResult(_0x479b88,_0x19b57c))[_0xfb50('0x52')](handleError(_0x479b88,null));};exports[_0xfb50('0x69')]=function(_0x5c4ce7,_0x47015c,_0x240ede){var _0x1eeeb6={'raw':!![],'where':{}};var _0x119e91={};var _0x37fc4c={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5c4ce7[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x47015c,null))['then'](function(_0x2f37b8){if(_0x2f37b8){_0x119e91[_0xfb50('0x3e')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x119e91[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x5c4ce7[_0xfb50('0x3f')]);_0x119e91[_0xfb50('0x41')]=_[_0xfb50('0x42')](_0x119e91['model'],_0x119e91[_0xfb50('0x3f')]);_0x1eeeb6[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x119e91[_0xfb50('0x3e')],qs['fields'](_0x5c4ce7[_0xfb50('0x3f')][_0xfb50('0x44')]));_0x1eeeb6[_0xfb50('0x43')]=_0x1eeeb6[_0xfb50('0x43')][_0xfb50('0x55')]?_0x1eeeb6[_0xfb50('0x43')]:_0x119e91[_0xfb50('0x3e')];if(!_0x5c4ce7[_0xfb50('0x3f')][_0xfb50('0x45')](_0xfb50('0x46'))){_0x1eeeb6[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x5c4ce7['query'][_0xfb50('0x23')]);_0x1eeeb6[_0xfb50('0x20')]=qs['offset'](_0x5c4ce7[_0xfb50('0x3f')][_0xfb50('0x20')]);}_0x1eeeb6[_0xfb50('0x47')]=qs[_0xfb50('0x48')](_0x5c4ce7['query'][_0xfb50('0x48')]);_0x1eeeb6['where']=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0x5c4ce7['query'],_0x119e91['filters']));_0x1eeeb6[_0xfb50('0x49')][_0xfb50('0x68')]=_0x2f37b8['id'];if(_0x5c4ce7[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x1eeeb6[_0xfb50('0x49')]=_[_0xfb50('0x4a')](_0x1eeeb6[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x1eeeb6[_0xfb50('0x43')],function(_0x920288){var _0x378507={};_0x378507[_0x920288]={'$like':'%'+_0x5c4ce7[_0xfb50('0x3f')][_0xfb50('0x4c')]+'%'};return _0x378507;})});}_0x1eeeb6=_['merge']({},_0x1eeeb6,_0x5c4ce7[_0xfb50('0x4d')]);return db['CmHopperHistory'][_0xfb50('0x22')]({'where':_0x1eeeb6['where']})[_0xfb50('0x2b')](function(_0x29a0d0){_0x37fc4c[_0xfb50('0x22')]=_0x29a0d0;if(_0x5c4ce7[_0xfb50('0x3f')]['includeAll']){_0x1eeeb6[_0xfb50('0x4f')]=[{'all':!![]}];}return db[_0xfb50('0x6a')][_0xfb50('0x50')](_0x1eeeb6);})['then'](function(_0x4a9439){_0x37fc4c['rows']=_0x4a9439;return _0x37fc4c;});}})['then'](respondWithFilteredResult(_0x47015c,_0x1eeeb6))[_0xfb50('0x52')](handleError(_0x47015c,null));};exports[_0xfb50('0x6b')]=function(_0x5397fd,_0x356ec4,_0x416529){var _0x46d762={'raw':!![],'where':{}};var _0x4385c1={};var _0x14481d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfb50('0x65')]({'where':{'id':_0x5397fd[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x356ec4,null))['then'](function(_0x321241){if(_0x321241){_0x4385c1[_0xfb50('0x3e')]=_[_0xfb50('0x40')](db[_0xfb50('0x6c')][_0xfb50('0x66')]);_0x4385c1[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x5397fd['query']);_0x4385c1[_0xfb50('0x41')]=_[_0xfb50('0x42')](_0x4385c1[_0xfb50('0x3e')],_0x4385c1[_0xfb50('0x3f')]);_0x46d762[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x4385c1[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x5397fd[_0xfb50('0x3f')]['fields']));_0x46d762[_0xfb50('0x43')]=_0x46d762[_0xfb50('0x43')][_0xfb50('0x55')]?_0x46d762[_0xfb50('0x43')]:_0x4385c1['model'];if(!_0x5397fd[_0xfb50('0x3f')][_0xfb50('0x45')]('nolimit')){_0x46d762[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x5397fd['query']['limit']);_0x46d762[_0xfb50('0x20')]=qs[_0xfb50('0x20')](_0x5397fd[_0xfb50('0x3f')][_0xfb50('0x20')]);}_0x46d762[_0xfb50('0x47')]=qs[_0xfb50('0x48')](_0x5397fd[_0xfb50('0x3f')][_0xfb50('0x48')]);_0x46d762[_0xfb50('0x49')]=qs['filters'](_[_0xfb50('0x67')](_0x5397fd[_0xfb50('0x3f')],_0x4385c1[_0xfb50('0x41')]));_0x46d762[_0xfb50('0x49')][_0xfb50('0x68')]=_0x321241['id'];if(_0x5397fd[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x46d762[_0xfb50('0x49')]=_[_0xfb50('0x4a')](_0x46d762[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x46d762[_0xfb50('0x43')],function(_0x53f96a){var _0x5983d8={};_0x5983d8[_0x53f96a]={'$like':'%'+_0x5397fd[_0xfb50('0x3f')]['filter']+'%'};return _0x5983d8;})});}_0x46d762=_['merge']({},_0x46d762,_0x5397fd[_0xfb50('0x4d')]);return db[_0xfb50('0x6c')][_0xfb50('0x22')]({'where':_0x46d762['where']})[_0xfb50('0x2b')](function(_0x4de4db){_0x14481d[_0xfb50('0x22')]=_0x4de4db;if(_0x5397fd[_0xfb50('0x3f')][_0xfb50('0x4e')]){_0x46d762[_0xfb50('0x4f')]=[{'all':!![]}];}return db[_0xfb50('0x6c')][_0xfb50('0x50')](_0x46d762);})[_0xfb50('0x2b')](function(_0x506db0){_0x14481d['rows']=_0x506db0;return _0x14481d;});}})[_0xfb50('0x2b')](respondWithFilteredResult(_0x356ec4,_0x46d762))[_0xfb50('0x52')](handleError(_0x356ec4,null));};exports[_0xfb50('0x6d')]=function(_0x3c76a7,_0x2ce4c7,_0x3d766f){var _0x258fd7={'raw':!![],'where':{}};var _0x2b8f8d={};var _0x15ad21={'count':0x0,'rows':[]};return db[_0xfb50('0x3b')][_0xfb50('0x65')]({'where':{'id':_0x3c76a7['params']['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x2ce4c7,null))[_0xfb50('0x2b')](function(_0xa176ea){if(_0xa176ea){_0x2b8f8d[_0xfb50('0x3e')]=_['keys'](db[_0xfb50('0x6e')]['rawAttributes']);_0x2b8f8d[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x3c76a7[_0xfb50('0x3f')]);_0x2b8f8d[_0xfb50('0x41')]=_['intersection'](_0x2b8f8d[_0xfb50('0x3e')],_0x2b8f8d[_0xfb50('0x3f')]);_0x258fd7[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x2b8f8d[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x3c76a7[_0xfb50('0x3f')][_0xfb50('0x44')]));_0x258fd7[_0xfb50('0x43')]=_0x258fd7[_0xfb50('0x43')][_0xfb50('0x55')]?_0x258fd7[_0xfb50('0x43')]:_0x2b8f8d[_0xfb50('0x3e')];if(!_0x3c76a7[_0xfb50('0x3f')][_0xfb50('0x45')](_0xfb50('0x46'))){_0x258fd7[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x3c76a7[_0xfb50('0x3f')]['limit']);_0x258fd7[_0xfb50('0x20')]=qs[_0xfb50('0x20')](_0x3c76a7[_0xfb50('0x3f')][_0xfb50('0x20')]);}_0x258fd7['order']=qs['sort'](_0x3c76a7['query']['sort']);_0x258fd7[_0xfb50('0x49')]=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0x3c76a7[_0xfb50('0x3f')],_0x2b8f8d[_0xfb50('0x41')]));_0x258fd7[_0xfb50('0x49')]['VoiceQueueId']=_0xa176ea['id'];if(_0x3c76a7[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x258fd7[_0xfb50('0x49')]=_[_0xfb50('0x4a')](_0x258fd7[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x258fd7[_0xfb50('0x43')],function(_0xc56624){var _0x4836d0={};_0x4836d0[_0xc56624]={'$like':'%'+_0x3c76a7['query'][_0xfb50('0x4c')]+'%'};return _0x4836d0;})});}_0x258fd7=_[_0xfb50('0x4a')]({},_0x258fd7,_0x3c76a7[_0xfb50('0x4d')]);return db[_0xfb50('0x6e')][_0xfb50('0x22')]({'where':_0x258fd7[_0xfb50('0x49')]})[_0xfb50('0x2b')](function(_0x320e7a){_0x15ad21[_0xfb50('0x22')]=_0x320e7a;if(_0x3c76a7['query'][_0xfb50('0x4e')]){_0x258fd7[_0xfb50('0x4f')]=[{'all':!![]}];}return db[_0xfb50('0x6e')][_0xfb50('0x50')](_0x258fd7);})[_0xfb50('0x2b')](function(_0x33e6e3){_0x15ad21['rows']=_0x33e6e3;return _0x15ad21;});}})['then'](respondWithFilteredResult(_0x2ce4c7,_0x258fd7))[_0xfb50('0x52')](handleError(_0x2ce4c7,null));};exports['getTeams']=function(_0x27b47d,_0xaaba37,_0x4aa9bf){var _0x3dac84={};var _0x23a6bb={};var _0x597b90;var _0x3d8d82;return db['VoiceQueue']['findOne']({'where':{'id':_0x27b47d[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0xaaba37,null))['then'](function(_0x56a16c){if(_0x56a16c){_0x597b90=_0x56a16c;_0x23a6bb['model']=_['keys'](db[_0xfb50('0x6f')][_0xfb50('0x66')]);_0x23a6bb[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x27b47d[_0xfb50('0x3f')]);_0x23a6bb['filters']=_[_0xfb50('0x42')](_0x23a6bb[_0xfb50('0x3e')],_0x23a6bb[_0xfb50('0x3f')]);_0x3dac84[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x23a6bb[_0xfb50('0x3e')],qs['fields'](_0x27b47d[_0xfb50('0x3f')][_0xfb50('0x44')]));_0x3dac84[_0xfb50('0x43')]=_0x3dac84['attributes']['length']?_0x3dac84[_0xfb50('0x43')]:_0x23a6bb[_0xfb50('0x3e')];_0x3dac84['order']=qs[_0xfb50('0x48')](_0x27b47d[_0xfb50('0x3f')][_0xfb50('0x48')]);_0x3dac84[_0xfb50('0x49')]=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0x27b47d[_0xfb50('0x3f')],_0x23a6bb[_0xfb50('0x41')]));if(_0x27b47d[_0xfb50('0x3f')]['filter']){_0x3dac84[_0xfb50('0x49')]=_[_0xfb50('0x4a')](_0x3dac84[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x3dac84['attributes'],function(_0x13e5a4){var _0x2a9c72={};_0x2a9c72[_0x13e5a4]={'$like':'%'+_0x27b47d['query'][_0xfb50('0x4c')]+'%'};return _0x2a9c72;})});}_0x3dac84=_[_0xfb50('0x4a')]({},_0x3dac84,_0x27b47d[_0xfb50('0x4d')]);return _0x597b90[_0xfb50('0x70')](_0x3dac84);}})[_0xfb50('0x2b')](function(_0x4f70e8){if(_0x4f70e8){_0x3d8d82=_0x4f70e8[_0xfb50('0x55')];if(!_0x27b47d[_0xfb50('0x3f')][_0xfb50('0x45')](_0xfb50('0x46'))){_0x3dac84['limit']=qs[_0xfb50('0x23')](_0x27b47d[_0xfb50('0x3f')][_0xfb50('0x23')]);_0x3dac84['offset']=qs['offset'](_0x27b47d[_0xfb50('0x3f')][_0xfb50('0x20')]);}return _0x597b90['getTeams'](_0x3dac84);}})[_0xfb50('0x2b')](function(_0x2d0f5a){if(_0x2d0f5a){return _0x2d0f5a?{'count':_0x3d8d82,'rows':_0x2d0f5a}:null;}})[_0xfb50('0x2b')](respondWithResult(_0xaaba37,null))['catch'](handleError(_0xaaba37,null));};exports[_0xfb50('0x71')]=function(_0x5a6397,_0x4c6874,_0x3baa39){var _0x4707f7=_0x5a6397[_0xfb50('0x58')]['teams'];var _0x984d49=_[_0xfb50('0x3a')](_0x4707f7,'id');return db[_0xfb50('0x6f')]['findAll']({'where':{'id':_0x984d49},'attributes':['id'],'include':[{'model':db[_0xfb50('0x72')],'as':_0xfb50('0x73'),'attributes':['id',_0xfb50('0x35'),_0xfb50('0x74'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x3a706b){if(_0x3a706b){var _0x13c6d4=_[_0xfb50('0x75')](_0x3a706b,function(_0x36a9c8){var _0x184556=_0x36a9c8[_0xfb50('0x2d')]({'plain':!![]});_0x184556[_0xfb50('0x73')][_0xfb50('0x76')](function(_0x2debbb){_0x2debbb[_0xfb50('0x77')]=_[_0xfb50('0x56')](_0x4707f7,{'id':_0x184556['id']})[_0xfb50('0x77')];});return _0x184556['Agents'];});return db[_0xfb50('0x3b')][_0xfb50('0x56')]({'where':{'id':_0x5a6397[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](function(_0x56626b){return db[_0xfb50('0x78')][_0xfb50('0x79')](function(_0x55c8e6){return _0x56626b['addTeams'](_0x984d49,{'transaction':_0x55c8e6})[_0xfb50('0x2b')](function(){return BPromise[_0xfb50('0x7a')](_0x4707f7,function(_0x2fa03d){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x2fa03d['id'],'VoiceQueueId':_0x5a6397['params']['id'],'penalty':_0x2fa03d[_0xfb50('0x77')]},{'transaction':_0x55c8e6});});})[_0xfb50('0x2b')](function(){return BPromise[_0xfb50('0x7a')](_0x13c6d4,function(_0x230252){return db[_0xfb50('0x7b')][_0xfb50('0x7c')]({'where':{'UserId':_0x230252['id'],'VoiceQueueId':_0x5a6397[_0xfb50('0x54')]['id']},'defaults':{'penalty':_0x230252[_0xfb50('0x77')]},'transaction':_0x55c8e6});});})[_0xfb50('0x2b')](function(){return BPromise[_0xfb50('0x7a')](_[_0xfb50('0x4c')](_0x13c6d4,{'online':!![]}),function(_0x4783bb){return db['UserVoiceQueueRt'][_0xfb50('0x7d')]({'membername':_0x4783bb[_0xfb50('0x35')],'UserId':_0x4783bb['id'],'queue_name':_0x56626b['name'],'VoiceQueueId':_0x56626b['id'],'interface':_[_0xfb50('0x7e')](_0x4783bb['interface'])?util[_0xfb50('0x7f')](_0xfb50('0x80'),_0x4783bb['name']):_0x4783bb[_0xfb50('0x81')],'paused':_0x4783bb[_0xfb50('0x82')]||![],'penalty':_0x4783bb[_0xfb50('0x77')]},{'transaction':_0x55c8e6});});})[_0xfb50('0x2b')](function(){_0x13c6d4[_0xfb50('0x76')](function(_0x44654d){socket[_0xfb50('0x83')](_0xfb50('0x84'),{'UserId':_0x44654d['id'],'VoiceQueueId':_0x56626b['id']});});});});});}})['then'](respondWithStatusCode(_0x4c6874,null))[_0xfb50('0x52')](handleError(_0x4c6874,null));};exports[_0xfb50('0x85')]=function(_0x48bb4c,_0x38a3bc,_0x397810){return db[_0xfb50('0x6f')][_0xfb50('0x50')]({'where':{'id':_0x48bb4c[_0xfb50('0x3f')][_0xfb50('0x86')]},'attributes':['id'],'include':[{'model':db[_0xfb50('0x72')],'as':_0xfb50('0x73'),'attributes':['id'],'raw':!![]}]})[_0xfb50('0x2b')](handleEntityNotFound(_0x38a3bc,null))['then'](function(_0x1ac499){var _0x21c4b8=_[_0xfb50('0x3a')](_0x1ac499,'id');var _0x28d6c7=[];var _0x15180a=[];var _0x13cf9c=squel['select']();_0x13cf9c[_0xfb50('0x87')](_0xfb50('0x88'))[_0xfb50('0x89')]('team_has_voice_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoiceQueueId\x20=\x20?',_0x48bb4c[_0xfb50('0x54')]['id']);for(var _0x4b3a3d=0x0;_0x4b3a3d<_0x1ac499[_0xfb50('0x55')];_0x4b3a3d+=0x1){let _0x20c166=_0x1ac499[_0x4b3a3d];for(var _0x598722=0x0;_0x598722<_0x20c166[_0xfb50('0x73')]['length'];_0x598722+=0x1){let _0x582e22=_0x20c166[_0xfb50('0x73')][_0x598722];var _0x561b45=_0x13cf9c['clone']();_0x561b45[_0xfb50('0x49')](_0xfb50('0x8a'),_0x582e22['id']);_0x15180a[_0xfb50('0x8b')](db[_0xfb50('0x78')][_0xfb50('0x3f')](_0x561b45['toString'](),{'type':db['sequelize'][_0xfb50('0x8c')][_0xfb50('0x8d')]})[_0xfb50('0x2b')](function(_0x389a52){if(_0x389a52['length']===0x1){return _0x582e22['id'];}else{var _0x22d6df=_[_0xfb50('0x8e')](_['map'](_0x389a52,'TeamId'),function(_0x175a4a){return _['includes'](_0x21c4b8,_0x175a4a);});if(_0x22d6df){return _0x582e22['id'];}}}));}}return BPromise[_0xfb50('0x8f')](_0x15180a)[_0xfb50('0x2b')](function(_0x57ac75){_0x28d6c7=_(_0x28d6c7)[_0xfb50('0x90')](_0x57ac75)[_0xfb50('0x91')]()[_0xfb50('0x32')]();return db['VoiceQueue']['find']({'where':{'id':_0x48bb4c[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](function(_0x50d287){return db[_0xfb50('0x78')][_0xfb50('0x79')](function(_0x5125ad){return _0x50d287['removeTeams'](_0x48bb4c[_0xfb50('0x3f')][_0xfb50('0x86')],{'transaction':_0x5125ad})[_0xfb50('0x2b')](function(){if(!_[_0xfb50('0x92')](_0x28d6c7)){return _0x50d287[_0xfb50('0x93')](_0x28d6c7,{'transaction':_0x5125ad})[_0xfb50('0x2b')](function(){return db[_0xfb50('0x94')]['destroy']({'where':{'VoiceQueueId':_0x48bb4c[_0xfb50('0x54')]['id'],'UserId':_0x28d6c7},'transaction':_0x5125ad});});}})[_0xfb50('0x2b')](function(){_0x28d6c7[_0xfb50('0x76')](function(_0x53605b){socket[_0xfb50('0x83')]('userVoiceQueue:remove',{'UserId':_0x53605b,'VoiceQueueId':_0x50d287['id']});});});});});});})[_0xfb50('0x2b')](respondWithStatusCode(_0x38a3bc,null))[_0xfb50('0x52')](handleError(_0x38a3bc,null));};exports['addAgents']=function(_0x138ebb,_0x5ea8d1,_0x4c6b82){var _0x4ab7bf,_0x58ec0c;return db['VoiceQueue'][_0xfb50('0x56')]({'where':{'id':_0x138ebb[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x5ea8d1,null))[_0xfb50('0x2b')](function(_0x2395f6){if(_0x2395f6){_0x58ec0c=_0x2395f6;return _0x2395f6[_0xfb50('0x95')](_0x138ebb['body'][_0xfb50('0x86')],_['omit'](_0x138ebb['body'],[_0xfb50('0x86'),'id'])||{})[_0xfb50('0x96')](function(_0x2c8312){for(var _0x37cdce=0x0;_0x37cdce<_0x138ebb['body'][_0xfb50('0x86')][_0xfb50('0x55')];_0x37cdce+=0x1){socket['emit'](_0xfb50('0x84'),{'UserId':Number(_0x138ebb[_0xfb50('0x58')][_0xfb50('0x86')][_0x37cdce]),'VoiceQueueId':Number(_0x138ebb[_0xfb50('0x54')]['id'])});}return _0x2c8312;});}})[_0xfb50('0x2b')](function(_0x1d5fb3){_0x4ab7bf=_0x1d5fb3||[];if(_0x58ec0c){return db[_0xfb50('0x72')]['findAll']({'where':{'id':_0x138ebb['body']['ids']},'attributes':['id','name',_0xfb50('0x74'),_0xfb50('0x82'),_0xfb50('0x81')],'raw':!![]});}})[_0xfb50('0x2b')](function(_0x1b12ae){if(!_[_0xfb50('0x92')](_0x1b12ae)){var _0x40d33c=[];for(var _0x19e15f=0x0;_0x19e15f<_0x1b12ae[_0xfb50('0x55')];_0x19e15f++){if(_0x1b12ae[_0x19e15f]['online']){_0x40d33c[_0xfb50('0x8b')](db[_0xfb50('0x94')]['upsert']({'membername':_0x1b12ae[_0x19e15f][_0xfb50('0x35')],'UserId':_0x1b12ae[_0x19e15f]['id'],'queue_name':_0x58ec0c[_0xfb50('0x35')],'VoiceQueueId':_0x58ec0c['id'],'interface':_[_0xfb50('0x7e')](_0x1b12ae[_0x19e15f]['interface'])?util[_0xfb50('0x7f')](_0xfb50('0x80'),_0x1b12ae[_0x19e15f][_0xfb50('0x35')]):_0x1b12ae[_0x19e15f][_0xfb50('0x81')],'paused':_0x1b12ae[_0x19e15f][_0xfb50('0x82')]||![],'penalty':_0x138ebb[_0xfb50('0x58')][_0xfb50('0x77')]||0x0}));}}return BPromise[_0xfb50('0x8f')](_0x40d33c);}})[_0xfb50('0x2b')](function(){return _0x4ab7bf;})[_0xfb50('0x2b')](respondWithResult(_0x5ea8d1,null))[_0xfb50('0x52')](handleError(_0x5ea8d1,null));};exports[_0xfb50('0x93')]=function(_0x12b0e4,_0x3743d6,_0x1b3511){return db['VoiceQueue'][_0xfb50('0x56')]({'where':{'id':_0x12b0e4[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x3743d6,null))[_0xfb50('0x2b')](function(_0x38d182){if(_0x38d182){return _0x38d182[_0xfb50('0x93')](_0x12b0e4[_0xfb50('0x3f')][_0xfb50('0x86')])['then'](function(){if(_[_0xfb50('0x97')](_0x12b0e4[_0xfb50('0x3f')]['ids'])){for(var _0xd8fd90=0x0;_0xd8fd90<_0x12b0e4[_0xfb50('0x3f')]['ids']['length'];_0xd8fd90+=0x1){socket['emit'](_0xfb50('0x98'),{'UserId':Number(_0x12b0e4[_0xfb50('0x3f')][_0xfb50('0x86')][_0xd8fd90]),'VoiceQueueId':Number(_0x12b0e4['params']['id'])});}}else{socket[_0xfb50('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x12b0e4['query']['ids']),'VoiceQueueId':Number(_0x12b0e4[_0xfb50('0x54')]['id'])});}});}})[_0xfb50('0x2b')](function(_0x41f802){return db[_0xfb50('0x94')][_0xfb50('0x2c')]({'where':{'VoiceQueueId':_0x12b0e4[_0xfb50('0x54')]['id'],'UserId':_0x12b0e4['query']['ids']}})[_0xfb50('0x2b')](function(){return _0x41f802;});})[_0xfb50('0x2b')](respondWithStatusCode(_0x3743d6,null))['catch'](handleError(_0x3743d6,null));};exports['getAgents']=function(_0x14d877,_0x32ada6,_0x12e253){var _0x636875={};var _0x37159c={};var _0x27df55;var _0x3307d4;return db[_0xfb50('0x3b')][_0xfb50('0x65')]({'where':{'id':_0x14d877[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x32ada6,null))[_0xfb50('0x2b')](function(_0x33fabe){if(_0x33fabe){_0x27df55=_0x33fabe;_0x37159c[_0xfb50('0x3e')]=_[_0xfb50('0x40')](db['User'][_0xfb50('0x66')]);_0x37159c[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x14d877[_0xfb50('0x3f')]);_0x37159c[_0xfb50('0x41')]=_[_0xfb50('0x42')](_0x37159c[_0xfb50('0x3e')],_0x37159c[_0xfb50('0x3f')]);_0x636875[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x37159c['model'],qs[_0xfb50('0x44')](_0x14d877[_0xfb50('0x3f')]['fields']));_0x636875[_0xfb50('0x43')]=_0x636875[_0xfb50('0x43')][_0xfb50('0x55')]?_0x636875[_0xfb50('0x43')]:_0x37159c[_0xfb50('0x3e')];_0x636875['order']=qs['sort'](_0x14d877[_0xfb50('0x3f')][_0xfb50('0x48')]);_0x636875[_0xfb50('0x49')]=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0x14d877[_0xfb50('0x3f')],_0x37159c['filters']));if(_0x14d877['query'][_0xfb50('0x4c')]){_0x636875[_0xfb50('0x49')]=_[_0xfb50('0x4a')](_0x636875[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x636875[_0xfb50('0x43')],function(_0x10e1de){var _0x3f864e={};_0x3f864e[_0x10e1de]={'$like':'%'+_0x14d877[_0xfb50('0x3f')][_0xfb50('0x4c')]+'%'};return _0x3f864e;})});}_0x636875=_[_0xfb50('0x4a')]({},_0x636875,_0x14d877[_0xfb50('0x4d')]);return _0x27df55[_0xfb50('0x99')](_0x636875);}})[_0xfb50('0x2b')](function(_0x312167){if(_0x312167){_0x3307d4=_0x312167['length'];if(!_0x14d877['query'][_0xfb50('0x45')](_0xfb50('0x46'))){_0x636875[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x14d877[_0xfb50('0x3f')]['limit']);_0x636875[_0xfb50('0x20')]=qs['offset'](_0x14d877[_0xfb50('0x3f')][_0xfb50('0x20')]);}return _0x27df55[_0xfb50('0x99')](_0x636875);}})[_0xfb50('0x2b')](function(_0x41a5c8){if(_0x41a5c8){return _0x41a5c8?{'count':_0x3307d4,'rows':_0x41a5c8}:null;}})[_0xfb50('0x2b')](respondWithResult(_0x32ada6,null))['catch'](handleError(_0x32ada6,null));};exports[_0xfb50('0x9a')]=function(_0x3b9e1a,_0x2ebf75,_0x1fa604){var _0x1dfb58={};var _0x4903d5={};var _0x2d4b4a;var _0x49b80d;return db[_0xfb50('0x3b')][_0xfb50('0x65')]({'where':{'id':_0x3b9e1a[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x2ebf75,null))['then'](function(_0x319eaa){if(_0x319eaa){_0x2d4b4a=_0x319eaa;_0x4903d5[_0xfb50('0x3e')]=_['keys'](db[_0xfb50('0x94')][_0xfb50('0x66')]);_0x4903d5[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x3b9e1a[_0xfb50('0x3f')]);_0x4903d5[_0xfb50('0x41')]=_[_0xfb50('0x42')](_0x4903d5[_0xfb50('0x3e')],_0x4903d5[_0xfb50('0x3f')]);_0x1dfb58[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x4903d5[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x3b9e1a['query']['fields']));_0x1dfb58[_0xfb50('0x43')]=_0x1dfb58[_0xfb50('0x43')]['length']?_0x1dfb58[_0xfb50('0x43')]:_0x4903d5[_0xfb50('0x3e')];_0x1dfb58[_0xfb50('0x47')]=qs[_0xfb50('0x48')](_0x3b9e1a[_0xfb50('0x3f')][_0xfb50('0x48')]);_0x1dfb58['where']=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0x3b9e1a[_0xfb50('0x3f')],_0x4903d5[_0xfb50('0x41')]));if(_0x3b9e1a[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x1dfb58[_0xfb50('0x49')]=_['merge'](_0x1dfb58[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x1dfb58[_0xfb50('0x43')],function(_0x20665a){var _0x405671={};_0x405671[_0x20665a]={'$like':'%'+_0x3b9e1a[_0xfb50('0x3f')][_0xfb50('0x4c')]+'%'};return _0x405671;})});}_0x1dfb58=_[_0xfb50('0x4a')]({},_0x1dfb58,_0x3b9e1a[_0xfb50('0x4d')]);return _0x2d4b4a[_0xfb50('0x9a')](_0x1dfb58);}})[_0xfb50('0x2b')](function(_0x1c57ac){if(_0x1c57ac){_0x49b80d=_0x1c57ac[_0xfb50('0x55')];if(!_0x3b9e1a[_0xfb50('0x3f')][_0xfb50('0x45')](_0xfb50('0x46'))){_0x1dfb58[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0x3b9e1a[_0xfb50('0x3f')]['limit']);_0x1dfb58[_0xfb50('0x20')]=qs[_0xfb50('0x20')](_0x3b9e1a[_0xfb50('0x3f')]['offset']);}return _0x2d4b4a[_0xfb50('0x9a')](_0x1dfb58);}})['then'](function(_0x2fcda8){return _0x2fcda8?{'count':_0x49b80d,'rows':_0x2fcda8}:null;})['then'](respondWithResult(_0x2ebf75,null))[_0xfb50('0x52')](handleError(_0x2ebf75,null));};exports['getLists']=function(_0xb5b479,_0x28c109,_0x36836e){var _0x3eadd2={};var _0x29c663={};var _0x69528f;var _0x2a4b88;return db[_0xfb50('0x3b')]['findOne']({'where':{'id':_0xb5b479['params']['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x28c109,null))[_0xfb50('0x2b')](function(_0x450bdf){if(_0x450bdf){_0x69528f=_0x450bdf;_0x29c663[_0xfb50('0x3e')]=_[_0xfb50('0x40')](db[_0xfb50('0x9b')]['rawAttributes']);_0x29c663[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0xb5b479['query']);_0x29c663['filters']=_['intersection'](_0x29c663[_0xfb50('0x3e')],_0x29c663['query']);_0x3eadd2['attributes']=_[_0xfb50('0x42')](_0x29c663[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0xb5b479['query'][_0xfb50('0x44')]));_0x3eadd2[_0xfb50('0x43')]=_0x3eadd2[_0xfb50('0x43')][_0xfb50('0x55')]?_0x3eadd2[_0xfb50('0x43')]:_0x29c663['model'];_0x3eadd2[_0xfb50('0x47')]=qs['sort'](_0xb5b479[_0xfb50('0x3f')][_0xfb50('0x48')]);_0x3eadd2[_0xfb50('0x49')]=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0xb5b479[_0xfb50('0x3f')],_0x29c663[_0xfb50('0x41')]));if(_0xb5b479[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x3eadd2['where']=_['merge'](_0x3eadd2[_0xfb50('0x49')],{'$or':_['map'](_0x3eadd2[_0xfb50('0x43')],function(_0xaefcf0){var _0xa48b74={};_0xa48b74[_0xaefcf0]={'$like':'%'+_0xb5b479[_0xfb50('0x3f')][_0xfb50('0x4c')]+'%'};return _0xa48b74;})});}_0x3eadd2=_['merge']({},_0x3eadd2,_0xb5b479['options']);return _0x69528f['getLists'](_0x3eadd2);}})[_0xfb50('0x2b')](function(_0x39ac97){if(_0x39ac97){_0x2a4b88=_0x39ac97[_0xfb50('0x55')];if(!_0xb5b479['query'][_0xfb50('0x45')](_0xfb50('0x46'))){_0x3eadd2[_0xfb50('0x23')]=qs[_0xfb50('0x23')](_0xb5b479[_0xfb50('0x3f')][_0xfb50('0x23')]);_0x3eadd2[_0xfb50('0x20')]=qs[_0xfb50('0x20')](_0xb5b479[_0xfb50('0x3f')][_0xfb50('0x20')]);}return _0x69528f[_0xfb50('0x9c')](_0x3eadd2);}})[_0xfb50('0x2b')](function(_0x208c9){if(_0x208c9){return _0x208c9?{'count':_0x2a4b88,'rows':_0x208c9}:null;}})[_0xfb50('0x2b')](respondWithResult(_0x28c109,null))['catch'](handleError(_0x28c109,null));};exports[_0xfb50('0x9d')]=function(_0x2b6d7c,_0x1af850,_0xfffd5a){var _0x4e44e0,_0xe181a5;return db[_0xfb50('0x3b')][_0xfb50('0x56')]({'where':{'id':_0x2b6d7c[_0xfb50('0x54')]['id']}})['then'](handleEntityNotFound(_0x1af850,null))['then'](function(_0x10a5a9){if(_0x10a5a9){_0xe181a5=_0x10a5a9;return _0x10a5a9[_0xfb50('0x9d')](_0x2b6d7c['body'][_0xfb50('0x86')],_[_0xfb50('0x61')](_0x2b6d7c[_0xfb50('0x58')],[_0xfb50('0x86'),'id'])||{});}return null;})[_0xfb50('0x96')](function(_0x5880c4){var _0x4578ed;_0x4e44e0=_0x5880c4||[];var _0xd6b67c=[];if(_0x5880c4){for(var _0x39db08=0x0;_0x39db08<_0x5880c4[_0xfb50('0x55')];_0x39db08+=0x1){var _0x166d9a=_0x5880c4[_0x39db08][_0xfb50('0x2d')]({'plain':!![]});_0xe181a5['dialCheckDuplicateType']=_0x2b6d7c[_0xfb50('0x58')][_0xfb50('0x9e')]?_0x2b6d7c[_0xfb50('0x58')][_0xfb50('0x9e')]:_0xe181a5[_0xfb50('0x9e')];switch(_0xe181a5[_0xfb50('0x9e')]){case'always':_0x4578ed=squel[_0xfb50('0x9f')]()[_0xfb50('0xa0')](_0xfb50('0xa1'))[_0xfb50('0xa2')]([_0xfb50('0xa3'),'scheduledAt','ContactId',_0xfb50('0xa4'),'VoiceQueueId',_0xfb50('0x62'),_0xfb50('0xa5')],squel[_0xfb50('0xa6')]()[_0xfb50('0x87')]('phone',_0xfb50('0xa3'))[_0xfb50('0x87')]('NOW()',_0xfb50('0xa7'))[_0xfb50('0x87')]('id',_0xfb50('0xa8'))[_0xfb50('0x87')](_0x166d9a[_0xfb50('0xa9')][_0xfb50('0xaa')](),_0xfb50('0xa4'))['field'](_0x2b6d7c['params']['id']['toString'](),_0xfb50('0x68'))[_0xfb50('0x87')]('NOW()','createdAt')['field'](_0xfb50('0xab'),_0xfb50('0xa5'))[_0xfb50('0x89')](_0xfb50('0xac'))['where'](_0xfb50('0xad'))['where'](_0xfb50('0xae'),_0x166d9a['CmListId']['toString']())[_0xfb50('0x49')](_0xfb50('0xaf'))[_0xfb50('0x49')](_0xfb50('0xb0'),squel[_0xfb50('0xa6')]()['field'](_0xfb50('0xb1'))['from']('cm_hopper_final')[_0xfb50('0x49')](_0xfb50('0xb2'),_0x2b6d7c[_0xfb50('0x54')]['id'][_0xfb50('0xaa')]()))[_0xfb50('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfb50('0xa6')]()['field']('COALESCE(phone,\x27\x27)')[_0xfb50('0x89')](_0xfb50('0xa1'))['where'](_0xfb50('0xb2'),_0x2b6d7c[_0xfb50('0x54')]['id']['toString']())))[_0xfb50('0xaa')]();break;case'onlyIfOpen':_0x4578ed=squel[_0xfb50('0x9f')]()[_0xfb50('0xa0')](_0xfb50('0xa1'))[_0xfb50('0xa2')](['phone',_0xfb50('0xa7'),'ContactId','ListId',_0xfb50('0x68'),_0xfb50('0x62'),'updatedAt'],squel[_0xfb50('0xa6')]()[_0xfb50('0x87')](_0xfb50('0xa3'),'phone')[_0xfb50('0x87')](_0xfb50('0xab'),'scheduledAt')[_0xfb50('0x87')]('id',_0xfb50('0xa8'))['field'](_0x166d9a[_0xfb50('0xa9')][_0xfb50('0xaa')](),'ListId')[_0xfb50('0x87')](_0x2b6d7c[_0xfb50('0x54')]['id'][_0xfb50('0xaa')](),_0xfb50('0x68'))['field'](_0xfb50('0xab'),_0xfb50('0x62'))['field']('NOW()',_0xfb50('0xa5'))[_0xfb50('0x89')]('cm_contacts')['where'](_0xfb50('0xad'))['where'](_0xfb50('0xae'),_0x166d9a[_0xfb50('0xa9')][_0xfb50('0xaa')]())[_0xfb50('0x49')]('phone\x20IS\x20NOT\x20NULL')[_0xfb50('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfb50('0xa6')]()['field'](_0xfb50('0xb3'))[_0xfb50('0x89')](_0xfb50('0xa1'))[_0xfb50('0x49')](_0xfb50('0xb2'),_0x2b6d7c['params']['id'][_0xfb50('0xaa')]())))[_0xfb50('0xaa')]();break;default:_0x4578ed=squel[_0xfb50('0x9f')]()[_0xfb50('0xa0')](_0xfb50('0xa1'))[_0xfb50('0xa2')]([_0xfb50('0xa3'),_0xfb50('0xa7'),_0xfb50('0xa8'),'ListId',_0xfb50('0x68'),'createdAt',_0xfb50('0xa5')],squel[_0xfb50('0xa6')]()[_0xfb50('0x87')](_0xfb50('0xa3'),_0xfb50('0xa3'))[_0xfb50('0x87')](_0xfb50('0xab'),_0xfb50('0xa7'))[_0xfb50('0x87')]('id','ContactId')['field'](_0x166d9a[_0xfb50('0xa9')][_0xfb50('0xaa')](),_0xfb50('0xa4'))['field'](_0x2b6d7c['params']['id'][_0xfb50('0xaa')](),_0xfb50('0x68'))[_0xfb50('0x87')](_0xfb50('0xab'),_0xfb50('0x62'))['field']('NOW()',_0xfb50('0xa5'))['from'](_0xfb50('0xac'))[_0xfb50('0x49')](_0xfb50('0xad'))[_0xfb50('0x49')](_0xfb50('0xae'),_0x166d9a[_0xfb50('0xa9')]['toString']())[_0xfb50('0x49')](_0xfb50('0xaf')))[_0xfb50('0xaa')]();}_0xd6b67c[_0xfb50('0x8b')](db[_0xfb50('0x78')][_0xfb50('0x3f')](_0x4578ed));}return BPromise[_0xfb50('0x8f')](_0xd6b67c);}})[_0xfb50('0x2b')](function(){return _0x4e44e0;})[_0xfb50('0x2b')](respondWithResult(_0x1af850,null))[_0xfb50('0x52')](handleError(_0x1af850,null));};exports['removeLists']=function(_0xdd9de,_0x5063df,_0x10ffd7){return db[_0xfb50('0x3b')][_0xfb50('0x56')]({'where':{'id':_0xdd9de['params']['id']}})['then'](handleEntityNotFound(_0x5063df,null))['then'](function(_0x11560f){if(_0x11560f){return _0x11560f[_0xfb50('0xb4')](_0xdd9de[_0xfb50('0x3f')][_0xfb50('0x86')]);}})[_0xfb50('0x2b')](function(_0x337529){if(_0x337529){return db[_0xfb50('0xb5')]['destroy']({'where':{'ListId':_0xdd9de[_0xfb50('0x3f')]['ids'],'VoiceQueueId':_0xdd9de[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](function(){return _0x337529;});}})[_0xfb50('0x2b')](respondWithStatusCode(_0x5063df,null))[_0xfb50('0x52')](handleError(_0x5063df,null));};exports[_0xfb50('0xb6')]=function(_0x42340,_0x33c484,_0x43b95d){var _0x27bb03={};var _0x53109d={};var _0x43d67a;var _0x5065e1;return db[_0xfb50('0x3b')][_0xfb50('0x65')]({'where':{'id':_0x42340[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x33c484,null))[_0xfb50('0x2b')](function(_0x52ddc5){if(_0x52ddc5){_0x43d67a=_0x52ddc5;_0x53109d[_0xfb50('0x3e')]=_[_0xfb50('0x40')](db[_0xfb50('0x9b')]['rawAttributes']);_0x53109d[_0xfb50('0x3f')]=_[_0xfb50('0x40')](_0x42340[_0xfb50('0x3f')]);_0x53109d['filters']=_['intersection'](_0x53109d[_0xfb50('0x3e')],_0x53109d[_0xfb50('0x3f')]);_0x27bb03[_0xfb50('0x43')]=_[_0xfb50('0x42')](_0x53109d[_0xfb50('0x3e')],qs[_0xfb50('0x44')](_0x42340[_0xfb50('0x3f')][_0xfb50('0x44')]));_0x27bb03[_0xfb50('0x43')]=_0x27bb03['attributes'][_0xfb50('0x55')]?_0x27bb03['attributes']:_0x53109d[_0xfb50('0x3e')];_0x27bb03[_0xfb50('0x47')]=qs[_0xfb50('0x48')](_0x42340['query'][_0xfb50('0x48')]);_0x27bb03[_0xfb50('0x49')]=qs[_0xfb50('0x41')](_[_0xfb50('0x67')](_0x42340[_0xfb50('0x3f')],_0x53109d[_0xfb50('0x41')]));if(_0x42340[_0xfb50('0x3f')][_0xfb50('0x4c')]){_0x27bb03[_0xfb50('0x49')]=_[_0xfb50('0x4a')](_0x27bb03[_0xfb50('0x49')],{'$or':_[_0xfb50('0x3a')](_0x27bb03[_0xfb50('0x43')],function(_0x21a16d){var _0x21e3f9={};_0x21e3f9[_0x21a16d]={'$like':'%'+_0x42340[_0xfb50('0x3f')]['filter']+'%'};return _0x21e3f9;})});}_0x27bb03=_[_0xfb50('0x4a')]({},_0x27bb03,_0x42340[_0xfb50('0x4d')]);return _0x43d67a['getBlackLists'](_0x27bb03);}})['then'](function(_0x27e6ab){if(_0x27e6ab){_0x5065e1=_0x27e6ab['length'];if(!_0x42340['query'][_0xfb50('0x45')](_0xfb50('0x46'))){_0x27bb03['limit']=qs[_0xfb50('0x23')](_0x42340[_0xfb50('0x3f')][_0xfb50('0x23')]);_0x27bb03[_0xfb50('0x20')]=qs[_0xfb50('0x20')](_0x42340['query'][_0xfb50('0x20')]);}return _0x43d67a['getBlackLists'](_0x27bb03);}})[_0xfb50('0x2b')](function(_0x2ac3fd){if(_0x2ac3fd){return _0x2ac3fd?{'count':_0x5065e1,'rows':_0x2ac3fd}:null;}})[_0xfb50('0x2b')](respondWithResult(_0x33c484,null))[_0xfb50('0x52')](handleError(_0x33c484,null));};exports['addBlackLists']=function(_0x614a77,_0x21d179,_0x266696){var _0x55f5b9,_0x10f8b8;return db[_0xfb50('0x3b')][_0xfb50('0x56')]({'where':{'id':_0x614a77['params']['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x21d179,null))[_0xfb50('0x2b')](function(_0x2a2ccb){if(_0x2a2ccb){_0x10f8b8=_0x2a2ccb;return _0x2a2ccb['addBlackLists'](_0x614a77[_0xfb50('0x58')][_0xfb50('0x86')],_['omit'](_0x614a77[_0xfb50('0x58')],[_0xfb50('0x86'),'id'])||{});}return null;})['spread'](function(_0x16e487){var _0x30e6e1;_0x55f5b9=_0x16e487||[];var _0x16c1dc=[];if(_0x16e487){for(var _0x6db3b4=0x0;_0x6db3b4<_0x16e487[_0xfb50('0x55')];_0x6db3b4+=0x1){var _0x1bda9b=_0x16e487[_0x6db3b4][_0xfb50('0x2d')]({'plain':!![]});_0x30e6e1=squel[_0xfb50('0x9f')]()['into'](_0xfb50('0xb7'))[_0xfb50('0xa2')](['phone','ContactId','ListId',_0xfb50('0x68'),_0xfb50('0x62'),_0xfb50('0xa5')],squel[_0xfb50('0xa6')]()[_0xfb50('0x87')](_0xfb50('0xa3'),_0xfb50('0xa3'))[_0xfb50('0x87')]('id',_0xfb50('0xa8'))[_0xfb50('0x87')](_0x1bda9b[_0xfb50('0xa9')][_0xfb50('0xaa')](),_0xfb50('0xa4'))[_0xfb50('0x87')](_0x614a77['params']['id'][_0xfb50('0xaa')](),_0xfb50('0x68'))[_0xfb50('0x87')](_0xfb50('0xab'),_0xfb50('0x62'))[_0xfb50('0x87')]('NOW()','updatedAt')[_0xfb50('0x89')](_0xfb50('0xac'))[_0xfb50('0x49')](_0xfb50('0xad'))[_0xfb50('0x49')](_0xfb50('0xae'),_0x1bda9b[_0xfb50('0xa9')][_0xfb50('0xaa')]())[_0xfb50('0x49')](_0xfb50('0xaf')))['toString']();_0x16c1dc['push'](db[_0xfb50('0x78')][_0xfb50('0x3f')](_0x30e6e1));}return BPromise[_0xfb50('0x8f')](_0x16c1dc);}})[_0xfb50('0x2b')](function(){return _0x55f5b9;})[_0xfb50('0x2b')](respondWithResult(_0x21d179,null))['catch'](handleError(_0x21d179,null));};exports[_0xfb50('0xb8')]=function(_0x284103,_0x41ab7c,_0x537056){return db['VoiceQueue'][_0xfb50('0x56')]({'where':{'id':_0x284103['params']['id']}})[_0xfb50('0x2b')](handleEntityNotFound(_0x41ab7c,null))[_0xfb50('0x2b')](function(_0x46e9bf){if(_0x46e9bf){return _0x46e9bf[_0xfb50('0xb8')](_0x284103[_0xfb50('0x3f')][_0xfb50('0x86')]);}})[_0xfb50('0x2b')](function(_0x4b0735){if(_0x4b0735){return db['CmHopperBlack'][_0xfb50('0x2c')]({'where':{'ListId':_0x284103[_0xfb50('0x3f')][_0xfb50('0x86')],'VoiceQueueId':_0x284103[_0xfb50('0x54')]['id']}})[_0xfb50('0x2b')](function(){return _0x4b0735;});}})[_0xfb50('0x2b')](respondWithStatusCode(_0x41ab7c,null))[_0xfb50('0x52')](handleError(_0x41ab7c,null));}; \ No newline at end of file +var _0xdc1e=['cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','removeLists','getBlackLists','addBlackLists','into','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','then','end','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','isNil','format','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','isEmpty','destroy','addAgents','spread','push','upsert','SIP/%s','all','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always'];(function(_0x4846fd,_0x37a6ba){var _0x5d7fba=function(_0x2860c9){while(--_0x2860c9){_0x4846fd['push'](_0x4846fd['shift']());}};_0x5d7fba(++_0x37a6ba);}(_0xdc1e,0x181));var _0xedc1=function(_0x50e8bc,_0x31049f){_0x50e8bc=_0x50e8bc-0x0;var _0xd856ff=_0xdc1e[_0x50e8bc];return _0xd856ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xedc1('0x0'));var jsonpatch=require(_0xedc1('0x1'));var rp=require(_0xedc1('0x2'));var moment=require(_0xedc1('0x3'));var BPromise=require(_0xedc1('0x4'));var Mustache=require(_0xedc1('0x5'));var util=require(_0xedc1('0x6'));var path=require(_0xedc1('0x7'));var sox=require(_0xedc1('0x8'));var csv=require(_0xedc1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedc1('0xa'));var _=require(_0xedc1('0xb'));var squel=require('squel');var crypto=require(_0xedc1('0xc'));var jsforce=require(_0xedc1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedc1('0x9'));var querystring=require(_0xedc1('0xe'));var Papa=require(_0xedc1('0xf'));var Redis=require('ioredis');var authService=require(_0xedc1('0x10'));var qs=require(_0xedc1('0x11'));var as=require(_0xedc1('0x12'));var hardwareService=require(_0xedc1('0x13'));var logger=require('../../config/logger')(_0xedc1('0x14'));var utils=require(_0xedc1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xedc1('0x16'));var db=require(_0xedc1('0x17'))['db'];config[_0xedc1('0x18')]=_['defaults'](config['redis'],{'host':_0xedc1('0x19'),'port':0x18eb});var socket=require(_0xedc1('0x1a'))(new Redis(config[_0xedc1('0x18')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x13018c,_0xbd45ff){_0xbd45ff=_0xbd45ff||0xcc;return function(_0x55a46b){if(_0x55a46b){return _0x13018c['sendStatus'](_0xbd45ff);}return _0x13018c[_0xedc1('0x1b')](_0xbd45ff)['end']();};}function respondWithResult(_0x42804b,_0x12e3ec){_0x12e3ec=_0x12e3ec||0xc8;return function(_0x52fa79){if(_0x52fa79){return _0x42804b[_0xedc1('0x1b')](_0x12e3ec)[_0xedc1('0x1c')](_0x52fa79);}};}function respondWithFilteredResult(_0x11c710,_0x306c98){return function(_0x27fee2){if(_0x27fee2){var _0x5dd506=typeof _0x306c98[_0xedc1('0x1d')]===_0xedc1('0x1e')&&typeof _0x306c98[_0xedc1('0x1f')]==='undefined';var _0x35b9d8=_0x27fee2['count'];var _0x47a4ec=_0x5dd506?0x0:_0x306c98['offset'];var _0xdb273d=_0x5dd506?_0x27fee2[_0xedc1('0x20')]:_0x306c98['offset']+_0x306c98[_0xedc1('0x1f')];var _0x59298d;if(_0xdb273d>=_0x35b9d8){_0xdb273d=_0x35b9d8;_0x59298d=0xc8;}else{_0x59298d=0xce;}_0x11c710['status'](_0x59298d);return _0x11c710['set'](_0xedc1('0x21'),_0x47a4ec+'-'+_0xdb273d+'/'+_0x35b9d8)['json'](_0x27fee2);}return null;};}function patchUpdates(_0x54c1ed){return function(_0x53b9d5){try{jsonpatch[_0xedc1('0x22')](_0x53b9d5,_0x54c1ed,!![]);}catch(_0xc9edda){return BPromise[_0xedc1('0x23')](_0xc9edda);}return _0x53b9d5[_0xedc1('0x24')]();};}function saveUpdates(_0xf1e517,_0x54fad4){return function(_0x4e00e6){if(_0x4e00e6){return _0x4e00e6[_0xedc1('0x25')](_0xf1e517)['then'](function(_0x12a017){return _0x12a017;});}return null;};}function removeEntity(_0x30ec13,_0x16be86){return function(_0x37c95a){if(_0x37c95a){return _0x37c95a['destroy']()['then'](function(){var _0x33ba79=_0x37c95a['get']({'plain':!![]});var _0x5026da=[{'name':_0xedc1('0x26'),'value':'inbound','ignore':![]},{'name':_0xedc1('0x27'),'value':_0xedc1('0x28'),'ignore':![]}];var _0x54cd4b=_(_0x5026da)[_0xedc1('0x29')](_0xedc1('0x2a'))[_0xedc1('0x2b')](_0xedc1('0x2c'))[_0xedc1('0x2c')]();if(_[_0xedc1('0x2d')](_0x54cd4b,_0x33ba79[_0xedc1('0x2e')])){return;}var _0x293249=_['find'](_0x5026da,['value',_0x33ba79['type']])[_0xedc1('0x2f')];return db[_0xedc1('0x30')]['destroy']({'where':{'type':_0x293249,'resourceId':_0x33ba79['id']}})['then'](function(){return _0x37c95a;});})[_0xedc1('0x31')](function(){_0x30ec13[_0xedc1('0x1b')](0xcc)[_0xedc1('0x32')]();});}};}function handleEntityNotFound(_0x59b66c,_0x19dd83){return function(_0x2d41d9){if(!_0x2d41d9){_0x59b66c[_0xedc1('0x33')](0x194);}return _0x2d41d9;};}function handleError(_0x5995ad,_0xdcb994){_0xdcb994=_0xdcb994||0x1f4;return function(_0x1a7ee2){logger[_0xedc1('0x34')](_0x1a7ee2[_0xedc1('0x35')]);if(_0x1a7ee2[_0xedc1('0x2f')]){delete _0x1a7ee2['name'];}_0x5995ad[_0xedc1('0x1b')](_0xdcb994)[_0xedc1('0x36')](_0x1a7ee2);};}exports[_0xedc1('0x37')]=function(_0x14af3a,_0x27a893){var _0x11da1d={},_0x413e3f={},_0xa7ccdf={'count':0x0,'rows':[]};var _0x3a871c=_[_0xedc1('0x2b')](db[_0xedc1('0x38')][_0xedc1('0x39')],function(_0x4f05d6){return{'name':_0x4f05d6['fieldName'],'type':_0x4f05d6[_0xedc1('0x2e')][_0xedc1('0x3a')]};});_0x413e3f[_0xedc1('0x3b')]=_[_0xedc1('0x2b')](_0x3a871c,_0xedc1('0x2f'));_0x413e3f[_0xedc1('0x3c')]=_['keys'](_0x14af3a[_0xedc1('0x3c')]);_0x413e3f['filters']=_['intersection'](_0x413e3f['model'],_0x413e3f[_0xedc1('0x3c')]);_0x11da1d[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x413e3f[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x14af3a[_0xedc1('0x3c')]['fields']));_0x11da1d['attributes']=_0x11da1d['attributes'][_0xedc1('0x40')]?_0x11da1d[_0xedc1('0x3d')]:_0x413e3f[_0xedc1('0x3b')];if(!_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x41')](_0xedc1('0x42'))){_0x11da1d[_0xedc1('0x1f')]=qs[_0xedc1('0x1f')](_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x1f')]);_0x11da1d[_0xedc1('0x1d')]=qs[_0xedc1('0x1d')](_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x1d')]);}_0x11da1d[_0xedc1('0x43')]=qs['sort'](_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x44')]);_0x11da1d[_0xedc1('0x45')]=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x14af3a[_0xedc1('0x3c')],_0x413e3f['filters']),_0x3a871c);if(_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x29')]){_0x11da1d['where']=_[_0xedc1('0x48')](_0x11da1d[_0xedc1('0x45')],{'$or':_[_0xedc1('0x2b')](_0x3a871c,function(_0x424357){if(_0x424357['type']!=='VIRTUAL'){var _0x58298a={};_0x58298a[_0x424357[_0xedc1('0x2f')]]={'$like':'%'+_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x29')]+'%'};return _0x58298a;}})});}_0x11da1d=_['merge']({},_0x11da1d,_0x14af3a[_0xedc1('0x49')]);var _0xb22e29={'where':_0x11da1d[_0xedc1('0x45')]};return db[_0xedc1('0x38')][_0xedc1('0x20')](_0xb22e29)[_0xedc1('0x31')](function(_0x4a99f5){_0xa7ccdf[_0xedc1('0x20')]=_0x4a99f5;if(_0x14af3a[_0xedc1('0x3c')][_0xedc1('0x4a')]){_0x11da1d[_0xedc1('0x4b')]=[{'all':!![]}];}return db[_0xedc1('0x38')][_0xedc1('0x4c')](_0x11da1d);})['then'](function(_0x306da8){_0xa7ccdf[_0xedc1('0x4d')]=_0x306da8;return _0xa7ccdf;})[_0xedc1('0x31')](respondWithFilteredResult(_0x27a893,_0x11da1d))[_0xedc1('0x4e')](handleError(_0x27a893,null));};exports[_0xedc1('0x4f')]=function(_0x175096,_0x1f43d0){var _0x22d7e4={'raw':![],'where':{'id':_0x175096['params']['id']}},_0x1d3a9f={};_0x1d3a9f['model']=_[_0xedc1('0x50')](db[_0xedc1('0x38')][_0xedc1('0x39')]);_0x1d3a9f[_0xedc1('0x3c')]=_[_0xedc1('0x50')](_0x175096['query']);_0x1d3a9f[_0xedc1('0x46')]=_[_0xedc1('0x3e')](_0x1d3a9f['model'],_0x1d3a9f[_0xedc1('0x3c')]);_0x22d7e4['attributes']=_[_0xedc1('0x3e')](_0x1d3a9f[_0xedc1('0x3b')],qs['fields'](_0x175096['query']['fields']));_0x22d7e4[_0xedc1('0x3d')]=_0x22d7e4['attributes'][_0xedc1('0x40')]?_0x22d7e4[_0xedc1('0x3d')]:_0x1d3a9f[_0xedc1('0x3b')];if(_0x175096[_0xedc1('0x3c')]['includeAll']){_0x22d7e4[_0xedc1('0x4b')]=[{'all':!![]}];}_0x22d7e4=_['merge']({},_0x22d7e4,_0x175096[_0xedc1('0x49')]);return db[_0xedc1('0x38')][_0xedc1('0x51')](_0x22d7e4)['then'](handleEntityNotFound(_0x1f43d0,null))[_0xedc1('0x31')](respondWithResult(_0x1f43d0,null))[_0xedc1('0x4e')](handleError(_0x1f43d0,null));};exports['create']=function(_0x7937,_0x46d4c4){return db[_0xedc1('0x38')][_0xedc1('0x52')](_0x7937[_0xedc1('0x53')],{})[_0xedc1('0x31')](function(_0x43be26){var _0x57fe1f=_0x7937[_0xedc1('0x54')][_0xedc1('0x55')]({'plain':!![]});if(!_0x57fe1f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57fe1f[_0xedc1('0x56')]===_0xedc1('0x54')){var _0x3ec659=_0x43be26['get']({'plain':!![]});var _0x5a1231=[{'name':_0xedc1('0x26'),'value':_0xedc1('0x57')},{'name':_0xedc1('0x27'),'value':'outbound'}];var _0x4adbcd=_[_0xedc1('0x51')](_0x5a1231,['value',_0x3ec659['type']])[_0xedc1('0x2f')];return db[_0xedc1('0x58')][_0xedc1('0x51')]({'where':{'name':_0x4adbcd,'userProfileId':_0x57fe1f[_0xedc1('0x59')]},'raw':!![]})[_0xedc1('0x31')](function(_0x208a9b){if(_0x208a9b&&_0x208a9b[_0xedc1('0x5a')]===0x0){return db[_0xedc1('0x30')][_0xedc1('0x52')]({'name':_0x3ec659['name'],'resourceId':_0x3ec659['id'],'type':_0x208a9b[_0xedc1('0x2f')],'sectionId':_0x208a9b['id']},{})[_0xedc1('0x31')](function(){return _0x43be26;});}else{return _0x43be26;}})[_0xedc1('0x4e')](function(_0x3d56d5){logger[_0xedc1('0x34')](_0xedc1('0x5b'),_0x3d56d5);throw _0x3d56d5;});}return _0x43be26;})[_0xedc1('0x31')](respondWithResult(_0x46d4c4,0xc9))['catch'](handleError(_0x46d4c4,null));};exports[_0xedc1('0x5c')]=function(_0x4e394f,_0xd6074e){var _0x4d9a5a={'where':{'id':_0x4e394f[_0xedc1('0x5d')]['id']}},_0x4fb358={};_0x4fb358[_0xedc1('0x3b')]=_[_0xedc1('0x50')](db[_0xedc1('0x38')][_0xedc1('0x39')]);_0x4d9a5a[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x4fb358[_0xedc1('0x3b')],qs['fields'](_0x4e394f[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x4d9a5a['attributes']=_0x4d9a5a[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x4d9a5a[_0xedc1('0x3d')]:_0x4fb358[_0xedc1('0x3b')];if(_0x4e394f['query'][_0xedc1('0x4a')]){_0x4d9a5a[_0xedc1('0x4b')]=[{'all':!![]}];}_0x4d9a5a=_[_0xedc1('0x48')]({},_0x4d9a5a,_0x4e394f[_0xedc1('0x49')]);return db[_0xedc1('0x38')][_0xedc1('0x51')](_0x4d9a5a)[_0xedc1('0x31')](handleEntityNotFound(_0xd6074e,null))['then'](function(_0x4f4dff){if(_0x4f4dff){var _0x3039e8=_0x4f4dff[_0xedc1('0x55')]({'plain':!![]});_0x3039e8=qs['omit'](_0x3039e8,['id',_0xedc1('0x5e'),_0xedc1('0x5f')]);_0x4e394f[_0xedc1('0x53')]=_[_0xedc1('0x60')](_0x4e394f[_0xedc1('0x53')],['id',_0xedc1('0x5e'),_0xedc1('0x5f')]);return db[_0xedc1('0x38')][_0xedc1('0x52')](_[_0xedc1('0x48')](_0x3039e8,_0x4e394f['body']),{'include':_0x4e394f[_0xedc1('0x3c')][_0xedc1('0x4a')]?[{'all':!![]}]:undefined})[_0xedc1('0x31')](function(_0x4c42b9){var _0xa3955=_0x4e394f[_0xedc1('0x54')]['get']({'plain':!![]});if(!_0xa3955)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa3955['role']===_0xedc1('0x54')){var _0x176a81=_0x4c42b9[_0xedc1('0x55')]({'plain':!![]});var _0x6a75cd=[{'name':_0xedc1('0x26'),'value':_0xedc1('0x57')},{'name':_0xedc1('0x27'),'value':_0xedc1('0x28')}];var _0x348b85=_[_0xedc1('0x51')](_0x6a75cd,[_0xedc1('0x2c'),_0x176a81[_0xedc1('0x2e')]])[_0xedc1('0x2f')];return db[_0xedc1('0x58')][_0xedc1('0x51')]({'where':{'name':_0x348b85,'userProfileId':_0xa3955[_0xedc1('0x59')]},'raw':!![]})[_0xedc1('0x31')](function(_0x13aaa2){if(_0x13aaa2&&_0x13aaa2['autoAssociation']===0x0){return db[_0xedc1('0x30')][_0xedc1('0x52')]({'name':_0x176a81['name'],'resourceId':_0x176a81['id'],'type':_0x13aaa2['name'],'sectionId':_0x13aaa2['id']},{})[_0xedc1('0x31')](function(){return _0x4c42b9;});}else{return _0x4c42b9;}})[_0xedc1('0x4e')](function(_0x46e668){logger[_0xedc1('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46e668);throw _0x46e668;});}return _0x4c42b9;});}})['then'](respondWithResult(_0xd6074e,0xc9))['catch'](handleError(_0xd6074e,null));};exports[_0xedc1('0x25')]=function(_0x3254d3,_0x53a112){if(_0x3254d3[_0xedc1('0x53')]['id']){delete _0x3254d3['body']['id'];}return db[_0xedc1('0x38')][_0xedc1('0x51')]({'where':{'id':_0x3254d3[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x53a112,null))[_0xedc1('0x31')](saveUpdates(_0x3254d3['body'],null))['then'](respondWithResult(_0x53a112,null))[_0xedc1('0x4e')](handleError(_0x53a112,null));};exports['destroy']=function(_0x7e2d6d,_0x444c4c){return db[_0xedc1('0x38')][_0xedc1('0x51')]({'where':{'id':_0x7e2d6d[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x444c4c,null))['then'](removeEntity(_0x444c4c,null))[_0xedc1('0x4e')](handleError(_0x444c4c,null));};exports[_0xedc1('0x61')]=function(_0x1921ed,_0x126a03,_0x2a0531){var _0x4b7fdd={'raw':![],'where':{}};var _0x2fe51d={};var _0x192576={'count':0x0,'rows':[]};return db[_0xedc1('0x38')][_0xedc1('0x62')]({'where':{'id':_0x1921ed['params']['id']}})['then'](handleEntityNotFound(_0x126a03,null))[_0xedc1('0x31')](function(_0x5f46ff){if(_0x5f46ff){_0x2fe51d[_0xedc1('0x3b')]=_['keys'](db['CmHopper'][_0xedc1('0x39')]);_0x2fe51d[_0xedc1('0x3c')]=_[_0xedc1('0x50')](_0x1921ed[_0xedc1('0x3c')]);_0x2fe51d['filters']=_[_0xedc1('0x3e')](_0x2fe51d[_0xedc1('0x3b')],_0x2fe51d[_0xedc1('0x3c')]);_0x4b7fdd[_0xedc1('0x3d')]=_['intersection'](_0x2fe51d[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x1921ed[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x4b7fdd[_0xedc1('0x3d')]=_0x4b7fdd[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x4b7fdd[_0xedc1('0x3d')]:_0x2fe51d['model'];if(!_0x1921ed[_0xedc1('0x3c')][_0xedc1('0x41')](_0xedc1('0x42'))){_0x4b7fdd[_0xedc1('0x1f')]=qs[_0xedc1('0x1f')](_0x1921ed[_0xedc1('0x3c')][_0xedc1('0x1f')]);_0x4b7fdd['offset']=qs['offset'](_0x1921ed[_0xedc1('0x3c')]['offset']);}_0x4b7fdd['order']=qs[_0xedc1('0x44')](_0x1921ed[_0xedc1('0x3c')]['sort']);_0x4b7fdd[_0xedc1('0x45')]=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x1921ed[_0xedc1('0x3c')],_0x2fe51d['filters']));_0x4b7fdd['where']['VoiceQueueId']=_0x5f46ff['id'];if(_0x1921ed['query']['filter']){_0x4b7fdd[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x4b7fdd[_0xedc1('0x45')],{'$or':_[_0xedc1('0x2b')](_0x4b7fdd[_0xedc1('0x3d')],function(_0x247fc8){var _0x73fee1={};_0x73fee1[_0x247fc8]={'$like':'%'+_0x1921ed[_0xedc1('0x3c')][_0xedc1('0x29')]+'%'};return _0x73fee1;})});}_0x4b7fdd=_[_0xedc1('0x48')]({},_0x4b7fdd,_0x1921ed[_0xedc1('0x49')]);return db['CmHopper'][_0xedc1('0x20')]({'where':_0x4b7fdd['where']})[_0xedc1('0x31')](function(_0x28ea8c){_0x192576[_0xedc1('0x20')]=_0x28ea8c;if(_0x1921ed[_0xedc1('0x3c')]['includeAll']){_0x4b7fdd['include']=[{'all':!![]}];}return db[_0xedc1('0x63')]['findAll'](_0x4b7fdd);})['then'](function(_0x446b7d){_0x192576[_0xedc1('0x4d')]=_0x446b7d;return _0x192576;});}})['then'](respondWithFilteredResult(_0x126a03,_0x4b7fdd))[_0xedc1('0x4e')](handleError(_0x126a03,null));};exports[_0xedc1('0x64')]=function(_0x5d8979,_0x265dc4,_0x33d281){var _0x4eed14={'raw':!![],'where':{}};var _0x303429={};var _0x5c80b7={'count':0x0,'rows':[]};return db[_0xedc1('0x38')]['findOne']({'where':{'id':_0x5d8979[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x265dc4,null))[_0xedc1('0x31')](function(_0x5aff36){if(_0x5aff36){_0x303429[_0xedc1('0x3b')]=_[_0xedc1('0x50')](db[_0xedc1('0x65')][_0xedc1('0x39')]);_0x303429['query']=_[_0xedc1('0x50')](_0x5d8979[_0xedc1('0x3c')]);_0x303429[_0xedc1('0x46')]=_[_0xedc1('0x3e')](_0x303429[_0xedc1('0x3b')],_0x303429[_0xedc1('0x3c')]);_0x4eed14[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x303429[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x5d8979['query'][_0xedc1('0x3f')]));_0x4eed14['attributes']=_0x4eed14['attributes'][_0xedc1('0x40')]?_0x4eed14[_0xedc1('0x3d')]:_0x303429[_0xedc1('0x3b')];if(!_0x5d8979[_0xedc1('0x3c')][_0xedc1('0x41')]('nolimit')){_0x4eed14['limit']=qs[_0xedc1('0x1f')](_0x5d8979[_0xedc1('0x3c')][_0xedc1('0x1f')]);_0x4eed14[_0xedc1('0x1d')]=qs[_0xedc1('0x1d')](_0x5d8979['query']['offset']);}_0x4eed14[_0xedc1('0x43')]=qs[_0xedc1('0x44')](_0x5d8979['query'][_0xedc1('0x44')]);_0x4eed14['where']=qs['filters'](_[_0xedc1('0x47')](_0x5d8979[_0xedc1('0x3c')],_0x303429[_0xedc1('0x46')]));_0x4eed14[_0xedc1('0x45')][_0xedc1('0x66')]=_0x5aff36['id'];if(_0x5d8979['query'][_0xedc1('0x29')]){_0x4eed14[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x4eed14[_0xedc1('0x45')],{'$or':_['map'](_0x4eed14[_0xedc1('0x3d')],function(_0x33aa50){var _0x26262d={};_0x26262d[_0x33aa50]={'$like':'%'+_0x5d8979[_0xedc1('0x3c')]['filter']+'%'};return _0x26262d;})});}_0x4eed14=_[_0xedc1('0x48')]({},_0x4eed14,_0x5d8979['options']);return db[_0xedc1('0x65')]['count']({'where':_0x4eed14['where']})[_0xedc1('0x31')](function(_0x3e8469){_0x5c80b7[_0xedc1('0x20')]=_0x3e8469;if(_0x5d8979[_0xedc1('0x3c')]['includeAll']){_0x4eed14['include']=[{'all':!![]}];}return db[_0xedc1('0x65')][_0xedc1('0x4c')](_0x4eed14);})[_0xedc1('0x31')](function(_0x4f38e1){_0x5c80b7['rows']=_0x4f38e1;return _0x5c80b7;});}})[_0xedc1('0x31')](respondWithFilteredResult(_0x265dc4,_0x4eed14))['catch'](handleError(_0x265dc4,null));};exports[_0xedc1('0x67')]=function(_0x1fc005,_0x4b2de2,_0x16e349){var _0x1da148={'raw':!![],'where':{}};var _0x4cdd90={};var _0x4b89a4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xedc1('0x62')]({'where':{'id':_0x1fc005['params']['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x4b2de2,null))[_0xedc1('0x31')](function(_0xfbe33d){if(_0xfbe33d){_0x4cdd90['model']=_[_0xedc1('0x50')](db[_0xedc1('0x68')][_0xedc1('0x39')]);_0x4cdd90[_0xedc1('0x3c')]=_[_0xedc1('0x50')](_0x1fc005[_0xedc1('0x3c')]);_0x4cdd90['filters']=_[_0xedc1('0x3e')](_0x4cdd90['model'],_0x4cdd90[_0xedc1('0x3c')]);_0x1da148[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x4cdd90[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x1fc005[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x1da148['attributes']=_0x1da148[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x1da148['attributes']:_0x4cdd90[_0xedc1('0x3b')];if(!_0x1fc005['query'][_0xedc1('0x41')](_0xedc1('0x42'))){_0x1da148[_0xedc1('0x1f')]=qs['limit'](_0x1fc005['query'][_0xedc1('0x1f')]);_0x1da148[_0xedc1('0x1d')]=qs[_0xedc1('0x1d')](_0x1fc005[_0xedc1('0x3c')][_0xedc1('0x1d')]);}_0x1da148[_0xedc1('0x43')]=qs[_0xedc1('0x44')](_0x1fc005[_0xedc1('0x3c')][_0xedc1('0x44')]);_0x1da148[_0xedc1('0x45')]=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x1fc005[_0xedc1('0x3c')],_0x4cdd90[_0xedc1('0x46')]));_0x1da148[_0xedc1('0x45')][_0xedc1('0x66')]=_0xfbe33d['id'];if(_0x1fc005[_0xedc1('0x3c')][_0xedc1('0x29')]){_0x1da148[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x1da148['where'],{'$or':_[_0xedc1('0x2b')](_0x1da148[_0xedc1('0x3d')],function(_0x641c73){var _0x172025={};_0x172025[_0x641c73]={'$like':'%'+_0x1fc005[_0xedc1('0x3c')]['filter']+'%'};return _0x172025;})});}_0x1da148=_[_0xedc1('0x48')]({},_0x1da148,_0x1fc005['options']);return db[_0xedc1('0x68')][_0xedc1('0x20')]({'where':_0x1da148[_0xedc1('0x45')]})[_0xedc1('0x31')](function(_0xb1d76d){_0x4b89a4['count']=_0xb1d76d;if(_0x1fc005[_0xedc1('0x3c')]['includeAll']){_0x1da148[_0xedc1('0x4b')]=[{'all':!![]}];}return db[_0xedc1('0x68')][_0xedc1('0x4c')](_0x1da148);})[_0xedc1('0x31')](function(_0x32ef26){_0x4b89a4[_0xedc1('0x4d')]=_0x32ef26;return _0x4b89a4;});}})[_0xedc1('0x31')](respondWithFilteredResult(_0x4b2de2,_0x1da148))[_0xedc1('0x4e')](handleError(_0x4b2de2,null));};exports[_0xedc1('0x69')]=function(_0x538675,_0x5b1616,_0x540c84){var _0x3544f1={'raw':!![],'where':{}};var _0x4c928e={};var _0xa60a64={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xedc1('0x62')]({'where':{'id':_0x538675['params']['id']}})['then'](handleEntityNotFound(_0x5b1616,null))[_0xedc1('0x31')](function(_0x4c8464){if(_0x4c8464){_0x4c928e[_0xedc1('0x3b')]=_['keys'](db[_0xedc1('0x6a')][_0xedc1('0x39')]);_0x4c928e[_0xedc1('0x3c')]=_['keys'](_0x538675[_0xedc1('0x3c')]);_0x4c928e[_0xedc1('0x46')]=_[_0xedc1('0x3e')](_0x4c928e[_0xedc1('0x3b')],_0x4c928e[_0xedc1('0x3c')]);_0x3544f1[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x4c928e[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x538675[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x3544f1['attributes']=_0x3544f1['attributes'][_0xedc1('0x40')]?_0x3544f1['attributes']:_0x4c928e[_0xedc1('0x3b')];if(!_0x538675[_0xedc1('0x3c')]['hasOwnProperty'](_0xedc1('0x42'))){_0x3544f1['limit']=qs[_0xedc1('0x1f')](_0x538675[_0xedc1('0x3c')][_0xedc1('0x1f')]);_0x3544f1['offset']=qs[_0xedc1('0x1d')](_0x538675[_0xedc1('0x3c')]['offset']);}_0x3544f1[_0xedc1('0x43')]=qs[_0xedc1('0x44')](_0x538675['query'][_0xedc1('0x44')]);_0x3544f1[_0xedc1('0x45')]=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x538675['query'],_0x4c928e[_0xedc1('0x46')]));_0x3544f1[_0xedc1('0x45')][_0xedc1('0x66')]=_0x4c8464['id'];if(_0x538675[_0xedc1('0x3c')]['filter']){_0x3544f1[_0xedc1('0x45')]=_['merge'](_0x3544f1[_0xedc1('0x45')],{'$or':_['map'](_0x3544f1[_0xedc1('0x3d')],function(_0x1eb0c2){var _0x493ca6={};_0x493ca6[_0x1eb0c2]={'$like':'%'+_0x538675[_0xedc1('0x3c')][_0xedc1('0x29')]+'%'};return _0x493ca6;})});}_0x3544f1=_[_0xedc1('0x48')]({},_0x3544f1,_0x538675[_0xedc1('0x49')]);return db[_0xedc1('0x6a')]['count']({'where':_0x3544f1['where']})[_0xedc1('0x31')](function(_0x1494f8){_0xa60a64[_0xedc1('0x20')]=_0x1494f8;if(_0x538675[_0xedc1('0x3c')][_0xedc1('0x4a')]){_0x3544f1[_0xedc1('0x4b')]=[{'all':!![]}];}return db[_0xedc1('0x6a')][_0xedc1('0x4c')](_0x3544f1);})[_0xedc1('0x31')](function(_0x7fd37b){_0xa60a64[_0xedc1('0x4d')]=_0x7fd37b;return _0xa60a64;});}})[_0xedc1('0x31')](respondWithFilteredResult(_0x5b1616,_0x3544f1))['catch'](handleError(_0x5b1616,null));};exports[_0xedc1('0x6b')]=function(_0x16a10d,_0xda4d2d,_0x4f6938){var _0x4bd27d={};var _0x27a510={};var _0x3018f9;var _0x1829c9;return db[_0xedc1('0x38')]['findOne']({'where':{'id':_0x16a10d[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0xda4d2d,null))[_0xedc1('0x31')](function(_0x181fdd){if(_0x181fdd){_0x3018f9=_0x181fdd;_0x27a510['model']=_['keys'](db['Team']['rawAttributes']);_0x27a510['query']=_[_0xedc1('0x50')](_0x16a10d[_0xedc1('0x3c')]);_0x27a510[_0xedc1('0x46')]=_[_0xedc1('0x3e')](_0x27a510[_0xedc1('0x3b')],_0x27a510[_0xedc1('0x3c')]);_0x4bd27d[_0xedc1('0x3d')]=_['intersection'](_0x27a510[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x16a10d[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x4bd27d['attributes']=_0x4bd27d['attributes'][_0xedc1('0x40')]?_0x4bd27d[_0xedc1('0x3d')]:_0x27a510[_0xedc1('0x3b')];_0x4bd27d['order']=qs[_0xedc1('0x44')](_0x16a10d[_0xedc1('0x3c')]['sort']);_0x4bd27d['where']=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x16a10d[_0xedc1('0x3c')],_0x27a510['filters']));if(_0x16a10d[_0xedc1('0x3c')][_0xedc1('0x29')]){_0x4bd27d[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x4bd27d[_0xedc1('0x45')],{'$or':_[_0xedc1('0x2b')](_0x4bd27d['attributes'],function(_0x3a669f){var _0x1a7c1a={};_0x1a7c1a[_0x3a669f]={'$like':'%'+_0x16a10d['query'][_0xedc1('0x29')]+'%'};return _0x1a7c1a;})});}_0x4bd27d=_[_0xedc1('0x48')]({},_0x4bd27d,_0x16a10d[_0xedc1('0x49')]);return _0x3018f9['getTeams'](_0x4bd27d);}})[_0xedc1('0x31')](function(_0x17c396){if(_0x17c396){_0x1829c9=_0x17c396[_0xedc1('0x40')];if(!_0x16a10d[_0xedc1('0x3c')][_0xedc1('0x41')]('nolimit')){_0x4bd27d[_0xedc1('0x1f')]=qs[_0xedc1('0x1f')](_0x16a10d[_0xedc1('0x3c')][_0xedc1('0x1f')]);_0x4bd27d[_0xedc1('0x1d')]=qs['offset'](_0x16a10d['query'][_0xedc1('0x1d')]);}return _0x3018f9[_0xedc1('0x6b')](_0x4bd27d);}})[_0xedc1('0x31')](function(_0x2b3ee5){if(_0x2b3ee5){return _0x2b3ee5?{'count':_0x1829c9,'rows':_0x2b3ee5}:null;}})[_0xedc1('0x31')](respondWithResult(_0xda4d2d,null))[_0xedc1('0x4e')](handleError(_0xda4d2d,null));};exports[_0xedc1('0x6c')]=function(_0x44e9e8,_0xc33f8a,_0x3704ec){var _0x288755=_0x44e9e8['body']['teams'];var _0x2f6dd1=_[_0xedc1('0x2b')](_0x288755,'id');return db[_0xedc1('0x6d')][_0xedc1('0x4c')]({'where':{'id':_0x2f6dd1},'attributes':['id'],'include':[{'model':db[_0xedc1('0x6e')],'as':_0xedc1('0x6f'),'attributes':['id','name',_0xedc1('0x70'),_0xedc1('0x71'),_0xedc1('0x72')],'raw':!![]}]})[_0xedc1('0x31')](function(_0xb745d2){if(_0xb745d2){var _0xb0567a=_[_0xedc1('0x73')](_0xb745d2,function(_0x539ac4){var _0x3aa39b=_0x539ac4[_0xedc1('0x55')]({'plain':!![]});_0x3aa39b[_0xedc1('0x6f')][_0xedc1('0x74')](function(_0x4e308d){_0x4e308d[_0xedc1('0x75')]=_['find'](_0x288755,{'id':_0x3aa39b['id']})[_0xedc1('0x75')];});return _0x3aa39b[_0xedc1('0x6f')];});return db[_0xedc1('0x38')]['find']({'where':{'id':_0x44e9e8['params']['id']}})[_0xedc1('0x31')](function(_0x263735){return db[_0xedc1('0x76')][_0xedc1('0x77')](function(_0x12ac0d){return _0x263735[_0xedc1('0x6c')](_0x2f6dd1,{'transaction':_0x12ac0d})['then'](function(){return BPromise[_0xedc1('0x78')](_0x288755,function(_0x506c1a){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x506c1a['id'],'VoiceQueueId':_0x44e9e8['params']['id'],'penalty':_0x506c1a[_0xedc1('0x75')]},{'transaction':_0x12ac0d});});})[_0xedc1('0x31')](function(){return BPromise[_0xedc1('0x78')](_0xb0567a,function(_0x15f432){return db['UserVoiceQueue'][_0xedc1('0x79')]({'where':{'UserId':_0x15f432['id'],'VoiceQueueId':_0x44e9e8[_0xedc1('0x5d')]['id']},'defaults':{'penalty':_0x15f432[_0xedc1('0x75')]},'transaction':_0x12ac0d});});})[_0xedc1('0x31')](function(){return BPromise['each'](_['filter'](_0xb0567a,{'online':!![]}),function(_0x21e99d){return db[_0xedc1('0x7a')]['upsert']({'membername':_0x21e99d[_0xedc1('0x2f')],'UserId':_0x21e99d['id'],'queue_name':_0x263735[_0xedc1('0x2f')],'VoiceQueueId':_0x263735['id'],'interface':_[_0xedc1('0x7b')](_0x21e99d[_0xedc1('0x72')])?util[_0xedc1('0x7c')]('SIP/%s',_0x21e99d[_0xedc1('0x2f')]):_0x21e99d['interface'],'paused':_0x21e99d[_0xedc1('0x71')]||![],'penalty':_0x21e99d[_0xedc1('0x75')]},{'transaction':_0x12ac0d});});})[_0xedc1('0x31')](function(){_0xb0567a['forEach'](function(_0x1c19cb){socket[_0xedc1('0x7d')](_0xedc1('0x7e'),{'UserId':_0x1c19cb['id'],'VoiceQueueId':_0x263735['id']});});});});});}})[_0xedc1('0x31')](respondWithStatusCode(_0xc33f8a,null))[_0xedc1('0x4e')](handleError(_0xc33f8a,null));};exports[_0xedc1('0x7f')]=function(_0x2db55a,_0x3b7501,_0x5200cb){return db[_0xedc1('0x6d')]['findAll']({'where':{'id':_0x2db55a[_0xedc1('0x3c')][_0xedc1('0x80')]},'attributes':['id'],'include':[{'model':db[_0xedc1('0x6e')],'as':_0xedc1('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xedc1('0x31')](handleEntityNotFound(_0x3b7501,null))[_0xedc1('0x31')](function(_0x2a9b21){var _0x26f967=_['map'](_0x2a9b21,'id');var _0x5e6975=[];var _0x5c3c0b=[];var _0x588672=squel['select']();_0x588672[_0xedc1('0x81')](_0xedc1('0x82'))['from'](_0xedc1('0x83'),'tq')['join'](_0xedc1('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xedc1('0x85'),_0x2db55a[_0xedc1('0x5d')]['id']);for(var _0x2d2dfc=0x0;_0x2d2dfc<_0x2a9b21[_0xedc1('0x40')];_0x2d2dfc+=0x1){let _0x19b7f6=_0x2a9b21[_0x2d2dfc];for(var _0x3c7b12=0x0;_0x3c7b12<_0x19b7f6[_0xedc1('0x6f')][_0xedc1('0x40')];_0x3c7b12+=0x1){let _0x1b01e9=_0x19b7f6['Agents'][_0x3c7b12];var _0x1752ae=_0x588672[_0xedc1('0x5c')]();_0x1752ae[_0xedc1('0x45')]('ut.UserId\x20=\x20?',_0x1b01e9['id']);_0x5c3c0b['push'](db[_0xedc1('0x76')][_0xedc1('0x3c')](_0x1752ae[_0xedc1('0x86')](),{'type':db['sequelize'][_0xedc1('0x87')][_0xedc1('0x88')]})[_0xedc1('0x31')](function(_0x1a3f69){if(_0x1a3f69[_0xedc1('0x40')]===0x1){return _0x1b01e9['id'];}else{var _0x15cee2=_[_0xedc1('0x89')](_['map'](_0x1a3f69,_0xedc1('0x8a')),function(_0x5e0178){return _[_0xedc1('0x2d')](_0x26f967,_0x5e0178);});if(_0x15cee2){return _0x1b01e9['id'];}}}));}}return BPromise['all'](_0x5c3c0b)[_0xedc1('0x31')](function(_0x2bc22a){_0x5e6975=_(_0x5e6975)[_0xedc1('0x8b')](_0x2bc22a)['compact']()[_0xedc1('0x2c')]();return db[_0xedc1('0x38')]['find']({'where':{'id':_0x2db55a[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](function(_0x158169){return db[_0xedc1('0x76')][_0xedc1('0x77')](function(_0x57ea5a){return _0x158169[_0xedc1('0x7f')](_0x2db55a['query']['ids'],{'transaction':_0x57ea5a})[_0xedc1('0x31')](function(){if(!_[_0xedc1('0x8c')](_0x5e6975)){return _0x158169['removeAgents'](_0x5e6975,{'transaction':_0x57ea5a})[_0xedc1('0x31')](function(){return db[_0xedc1('0x7a')][_0xedc1('0x8d')]({'where':{'VoiceQueueId':_0x2db55a[_0xedc1('0x5d')]['id'],'UserId':_0x5e6975},'transaction':_0x57ea5a});});}})['then'](function(){_0x5e6975[_0xedc1('0x74')](function(_0x52a495){socket[_0xedc1('0x7d')]('userVoiceQueue:remove',{'UserId':_0x52a495,'VoiceQueueId':_0x158169['id']});});});});});});})['then'](respondWithStatusCode(_0x3b7501,null))[_0xedc1('0x4e')](handleError(_0x3b7501,null));};exports[_0xedc1('0x8e')]=function(_0x34ae37,_0x5f28f4,_0x23e51c){var _0x2ef6e2,_0x219a72;return db['VoiceQueue'][_0xedc1('0x51')]({'where':{'id':_0x34ae37[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x5f28f4,null))[_0xedc1('0x31')](function(_0x3175a7){if(_0x3175a7){_0x219a72=_0x3175a7;return _0x3175a7[_0xedc1('0x8e')](_0x34ae37[_0xedc1('0x53')][_0xedc1('0x80')],_[_0xedc1('0x60')](_0x34ae37[_0xedc1('0x53')],['ids','id'])||{})[_0xedc1('0x8f')](function(_0x30273f){for(var _0x48653d=0x0;_0x48653d<_0x34ae37[_0xedc1('0x53')][_0xedc1('0x80')][_0xedc1('0x40')];_0x48653d+=0x1){socket[_0xedc1('0x7d')](_0xedc1('0x7e'),{'UserId':Number(_0x34ae37[_0xedc1('0x53')][_0xedc1('0x80')][_0x48653d]),'VoiceQueueId':Number(_0x34ae37['params']['id'])});}return _0x30273f;});}})[_0xedc1('0x31')](function(_0x2bd8c2){_0x2ef6e2=_0x2bd8c2||[];if(_0x219a72){return db['User'][_0xedc1('0x4c')]({'where':{'id':_0x34ae37[_0xedc1('0x53')][_0xedc1('0x80')]},'attributes':['id',_0xedc1('0x2f'),_0xedc1('0x70'),'voicePause',_0xedc1('0x72')],'raw':!![]});}})[_0xedc1('0x31')](function(_0x346313){if(!_[_0xedc1('0x8c')](_0x346313)){var _0xf5d811=[];for(var _0x14f936=0x0;_0x14f936<_0x346313['length'];_0x14f936++){if(_0x346313[_0x14f936]['online']){_0xf5d811[_0xedc1('0x90')](db[_0xedc1('0x7a')][_0xedc1('0x91')]({'membername':_0x346313[_0x14f936]['name'],'UserId':_0x346313[_0x14f936]['id'],'queue_name':_0x219a72[_0xedc1('0x2f')],'VoiceQueueId':_0x219a72['id'],'interface':_[_0xedc1('0x7b')](_0x346313[_0x14f936][_0xedc1('0x72')])?util[_0xedc1('0x7c')](_0xedc1('0x92'),_0x346313[_0x14f936][_0xedc1('0x2f')]):_0x346313[_0x14f936][_0xedc1('0x72')],'paused':_0x346313[_0x14f936][_0xedc1('0x71')]||![],'penalty':_0x34ae37[_0xedc1('0x53')]['penalty']||0x0}));}}return BPromise[_0xedc1('0x93')](_0xf5d811);}})[_0xedc1('0x31')](function(){return _0x2ef6e2;})[_0xedc1('0x31')](respondWithResult(_0x5f28f4,null))[_0xedc1('0x4e')](handleError(_0x5f28f4,null));};exports[_0xedc1('0x94')]=function(_0x3439d4,_0x24415d,_0x1eb443){return db[_0xedc1('0x38')][_0xedc1('0x51')]({'where':{'id':_0x3439d4['params']['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x24415d,null))[_0xedc1('0x31')](function(_0x4d0890){if(_0x4d0890){return _0x4d0890[_0xedc1('0x94')](_0x3439d4[_0xedc1('0x3c')][_0xedc1('0x80')])['then'](function(){if(_[_0xedc1('0x95')](_0x3439d4[_0xedc1('0x3c')]['ids'])){for(var _0x35a944=0x0;_0x35a944<_0x3439d4[_0xedc1('0x3c')][_0xedc1('0x80')]['length'];_0x35a944+=0x1){socket[_0xedc1('0x7d')](_0xedc1('0x96'),{'UserId':Number(_0x3439d4[_0xedc1('0x3c')]['ids'][_0x35a944]),'VoiceQueueId':Number(_0x3439d4['params']['id'])});}}else{socket[_0xedc1('0x7d')](_0xedc1('0x96'),{'UserId':Number(_0x3439d4[_0xedc1('0x3c')][_0xedc1('0x80')]),'VoiceQueueId':Number(_0x3439d4[_0xedc1('0x5d')]['id'])});}});}})[_0xedc1('0x31')](function(_0x3b1bc1){return db[_0xedc1('0x7a')][_0xedc1('0x8d')]({'where':{'VoiceQueueId':_0x3439d4[_0xedc1('0x5d')]['id'],'UserId':_0x3439d4[_0xedc1('0x3c')][_0xedc1('0x80')]}})[_0xedc1('0x31')](function(){return _0x3b1bc1;});})['then'](respondWithStatusCode(_0x24415d,null))['catch'](handleError(_0x24415d,null));};exports[_0xedc1('0x97')]=function(_0x40d98d,_0x22e57c,_0x225305){var _0x57249f={};var _0x4af587={};var _0x50c197;var _0x410f36;return db[_0xedc1('0x38')][_0xedc1('0x62')]({'where':{'id':_0x40d98d[_0xedc1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x22e57c,null))['then'](function(_0x4ddde6){if(_0x4ddde6){_0x50c197=_0x4ddde6;_0x4af587[_0xedc1('0x3b')]=_['keys'](db['User'][_0xedc1('0x39')]);_0x4af587[_0xedc1('0x3c')]=_[_0xedc1('0x50')](_0x40d98d[_0xedc1('0x3c')]);_0x4af587[_0xedc1('0x46')]=_['intersection'](_0x4af587[_0xedc1('0x3b')],_0x4af587[_0xedc1('0x3c')]);_0x57249f[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x4af587[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x40d98d[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x57249f[_0xedc1('0x3d')]=_0x57249f[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x57249f[_0xedc1('0x3d')]:_0x4af587[_0xedc1('0x3b')];_0x57249f[_0xedc1('0x43')]=qs[_0xedc1('0x44')](_0x40d98d['query']['sort']);_0x57249f[_0xedc1('0x45')]=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x40d98d[_0xedc1('0x3c')],_0x4af587[_0xedc1('0x46')]));if(_0x40d98d[_0xedc1('0x3c')]['filter']){_0x57249f[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x57249f[_0xedc1('0x45')],{'$or':_[_0xedc1('0x2b')](_0x57249f['attributes'],function(_0xd7dcfb){var _0x513f4f={};_0x513f4f[_0xd7dcfb]={'$like':'%'+_0x40d98d['query'][_0xedc1('0x29')]+'%'};return _0x513f4f;})});}_0x57249f=_['merge']({},_0x57249f,_0x40d98d['options']);return _0x50c197['getAgents'](_0x57249f);}})['then'](function(_0x26410c){if(_0x26410c){_0x410f36=_0x26410c[_0xedc1('0x40')];if(!_0x40d98d[_0xedc1('0x3c')][_0xedc1('0x41')](_0xedc1('0x42'))){_0x57249f['limit']=qs[_0xedc1('0x1f')](_0x40d98d['query'][_0xedc1('0x1f')]);_0x57249f['offset']=qs[_0xedc1('0x1d')](_0x40d98d[_0xedc1('0x3c')]['offset']);}return _0x50c197['getAgents'](_0x57249f);}})[_0xedc1('0x31')](function(_0x1e016e){if(_0x1e016e){return _0x1e016e?{'count':_0x410f36,'rows':_0x1e016e}:null;}})['then'](respondWithResult(_0x22e57c,null))[_0xedc1('0x4e')](handleError(_0x22e57c,null));};exports['getMembers']=function(_0x3cfdb4,_0x181c01,_0x39c0de){var _0x53c790={};var _0x34e989={};var _0x16dfec;var _0x33b4d7;return db[_0xedc1('0x38')][_0xedc1('0x62')]({'where':{'id':_0x3cfdb4[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x181c01,null))[_0xedc1('0x31')](function(_0x40e4c7){if(_0x40e4c7){_0x16dfec=_0x40e4c7;_0x34e989[_0xedc1('0x3b')]=_['keys'](db['UserVoiceQueueRt'][_0xedc1('0x39')]);_0x34e989[_0xedc1('0x3c')]=_[_0xedc1('0x50')](_0x3cfdb4[_0xedc1('0x3c')]);_0x34e989[_0xedc1('0x46')]=_[_0xedc1('0x3e')](_0x34e989[_0xedc1('0x3b')],_0x34e989[_0xedc1('0x3c')]);_0x53c790['attributes']=_[_0xedc1('0x3e')](_0x34e989[_0xedc1('0x3b')],qs[_0xedc1('0x3f')](_0x3cfdb4[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x53c790['attributes']=_0x53c790[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x53c790[_0xedc1('0x3d')]:_0x34e989[_0xedc1('0x3b')];_0x53c790[_0xedc1('0x43')]=qs[_0xedc1('0x44')](_0x3cfdb4[_0xedc1('0x3c')][_0xedc1('0x44')]);_0x53c790['where']=qs[_0xedc1('0x46')](_['pick'](_0x3cfdb4[_0xedc1('0x3c')],_0x34e989[_0xedc1('0x46')]));if(_0x3cfdb4[_0xedc1('0x3c')][_0xedc1('0x29')]){_0x53c790[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x53c790[_0xedc1('0x45')],{'$or':_[_0xedc1('0x2b')](_0x53c790[_0xedc1('0x3d')],function(_0x29a89f){var _0x3bee3d={};_0x3bee3d[_0x29a89f]={'$like':'%'+_0x3cfdb4[_0xedc1('0x3c')]['filter']+'%'};return _0x3bee3d;})});}_0x53c790=_[_0xedc1('0x48')]({},_0x53c790,_0x3cfdb4[_0xedc1('0x49')]);return _0x16dfec[_0xedc1('0x98')](_0x53c790);}})[_0xedc1('0x31')](function(_0x370f80){if(_0x370f80){_0x33b4d7=_0x370f80[_0xedc1('0x40')];if(!_0x3cfdb4['query']['hasOwnProperty']('nolimit')){_0x53c790[_0xedc1('0x1f')]=qs[_0xedc1('0x1f')](_0x3cfdb4['query'][_0xedc1('0x1f')]);_0x53c790[_0xedc1('0x1d')]=qs['offset'](_0x3cfdb4[_0xedc1('0x3c')][_0xedc1('0x1d')]);}return _0x16dfec[_0xedc1('0x98')](_0x53c790);}})[_0xedc1('0x31')](function(_0x78b7ff){return _0x78b7ff?{'count':_0x33b4d7,'rows':_0x78b7ff}:null;})[_0xedc1('0x31')](respondWithResult(_0x181c01,null))['catch'](handleError(_0x181c01,null));};exports[_0xedc1('0x99')]=function(_0xe17f72,_0x122b10,_0x4ccef2){var _0x14a47a={};var _0x3ca673={};var _0x2d663e;var _0xff4e21;return db[_0xedc1('0x38')][_0xedc1('0x62')]({'where':{'id':_0xe17f72['params']['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x122b10,null))[_0xedc1('0x31')](function(_0x514d0d){if(_0x514d0d){_0x2d663e=_0x514d0d;_0x3ca673[_0xedc1('0x3b')]=_['keys'](db[_0xedc1('0x9a')][_0xedc1('0x39')]);_0x3ca673[_0xedc1('0x3c')]=_[_0xedc1('0x50')](_0xe17f72[_0xedc1('0x3c')]);_0x3ca673['filters']=_[_0xedc1('0x3e')](_0x3ca673[_0xedc1('0x3b')],_0x3ca673[_0xedc1('0x3c')]);_0x14a47a[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x3ca673['model'],qs[_0xedc1('0x3f')](_0xe17f72[_0xedc1('0x3c')][_0xedc1('0x3f')]));_0x14a47a[_0xedc1('0x3d')]=_0x14a47a[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x14a47a[_0xedc1('0x3d')]:_0x3ca673[_0xedc1('0x3b')];_0x14a47a[_0xedc1('0x43')]=qs['sort'](_0xe17f72[_0xedc1('0x3c')]['sort']);_0x14a47a['where']=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0xe17f72[_0xedc1('0x3c')],_0x3ca673[_0xedc1('0x46')]));if(_0xe17f72[_0xedc1('0x3c')][_0xedc1('0x29')]){_0x14a47a[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x14a47a[_0xedc1('0x45')],{'$or':_[_0xedc1('0x2b')](_0x14a47a[_0xedc1('0x3d')],function(_0x17c5fd){var _0x491920={};_0x491920[_0x17c5fd]={'$like':'%'+_0xe17f72[_0xedc1('0x3c')][_0xedc1('0x29')]+'%'};return _0x491920;})});}_0x14a47a=_[_0xedc1('0x48')]({},_0x14a47a,_0xe17f72[_0xedc1('0x49')]);return _0x2d663e[_0xedc1('0x99')](_0x14a47a);}})[_0xedc1('0x31')](function(_0x147a6c){if(_0x147a6c){_0xff4e21=_0x147a6c[_0xedc1('0x40')];if(!_0xe17f72['query'][_0xedc1('0x41')](_0xedc1('0x42'))){_0x14a47a[_0xedc1('0x1f')]=qs[_0xedc1('0x1f')](_0xe17f72[_0xedc1('0x3c')][_0xedc1('0x1f')]);_0x14a47a['offset']=qs[_0xedc1('0x1d')](_0xe17f72[_0xedc1('0x3c')][_0xedc1('0x1d')]);}return _0x2d663e[_0xedc1('0x99')](_0x14a47a);}})[_0xedc1('0x31')](function(_0x316ae3){if(_0x316ae3){return _0x316ae3?{'count':_0xff4e21,'rows':_0x316ae3}:null;}})[_0xedc1('0x31')](respondWithResult(_0x122b10,null))[_0xedc1('0x4e')](handleError(_0x122b10,null));};exports['addLists']=function(_0x43e5ae,_0x30de3f,_0x1973f5){var _0x5f34f5,_0x302d64;return db[_0xedc1('0x38')]['find']({'where':{'id':_0x43e5ae[_0xedc1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x30de3f,null))[_0xedc1('0x31')](function(_0x15328f){if(_0x15328f){_0x302d64=_0x15328f;return _0x15328f[_0xedc1('0x9b')](_0x43e5ae['body'][_0xedc1('0x80')],_[_0xedc1('0x60')](_0x43e5ae['body'],[_0xedc1('0x80'),'id'])||{});}return null;})[_0xedc1('0x8f')](function(_0x148564){var _0x7d08;_0x5f34f5=_0x148564||[];var _0x2a4521=[];if(_0x148564){for(var _0x3bfcb7=0x0;_0x3bfcb7<_0x148564['length'];_0x3bfcb7+=0x1){var _0x20a7f7=_0x148564[_0x3bfcb7][_0xedc1('0x55')]({'plain':!![]});_0x302d64['dialCheckDuplicateType']=_0x43e5ae['body'][_0xedc1('0x9c')]?_0x43e5ae['body'][_0xedc1('0x9c')]:_0x302d64['dialCheckDuplicateType'];switch(_0x302d64['dialCheckDuplicateType']){case _0xedc1('0x9d'):_0x7d08=squel['insert']()['into'](_0xedc1('0x9e'))[_0xedc1('0x9f')]([_0xedc1('0xa0'),_0xedc1('0xa1'),_0xedc1('0xa2'),'ListId',_0xedc1('0x66'),_0xedc1('0x5e'),_0xedc1('0x5f')],squel['select']()[_0xedc1('0x81')](_0xedc1('0xa0'),'phone')[_0xedc1('0x81')](_0xedc1('0xa3'),'scheduledAt')[_0xedc1('0x81')]('id','ContactId')[_0xedc1('0x81')](_0x20a7f7[_0xedc1('0xa4')][_0xedc1('0x86')](),_0xedc1('0xa5'))[_0xedc1('0x81')](_0x43e5ae[_0xedc1('0x5d')]['id'][_0xedc1('0x86')](),_0xedc1('0x66'))[_0xedc1('0x81')](_0xedc1('0xa3'),_0xedc1('0x5e'))['field']('NOW()','updatedAt')[_0xedc1('0xa6')](_0xedc1('0xa7'))[_0xedc1('0x45')](_0xedc1('0xa8'))['where']('ListId\x20=\x20?',_0x20a7f7[_0xedc1('0xa4')][_0xedc1('0x86')]())[_0xedc1('0x45')](_0xedc1('0xa9'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xedc1('0xaa')]()[_0xedc1('0x81')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0xedc1('0x45')](_0xedc1('0x85'),_0x43e5ae[_0xedc1('0x5d')]['id'][_0xedc1('0x86')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xedc1('0xaa')]()[_0xedc1('0x81')](_0xedc1('0xab'))[_0xedc1('0xa6')](_0xedc1('0x9e'))[_0xedc1('0x45')](_0xedc1('0x85'),_0x43e5ae[_0xedc1('0x5d')]['id']['toString']())))['toString']();break;case _0xedc1('0xac'):_0x7d08=squel[_0xedc1('0xad')]()['into'](_0xedc1('0x9e'))[_0xedc1('0x9f')]([_0xedc1('0xa0'),_0xedc1('0xa1'),'ContactId',_0xedc1('0xa5'),_0xedc1('0x66'),_0xedc1('0x5e'),_0xedc1('0x5f')],squel[_0xedc1('0xaa')]()[_0xedc1('0x81')]('phone',_0xedc1('0xa0'))[_0xedc1('0x81')](_0xedc1('0xa3'),'scheduledAt')[_0xedc1('0x81')]('id',_0xedc1('0xa2'))[_0xedc1('0x81')](_0x20a7f7[_0xedc1('0xa4')][_0xedc1('0x86')](),_0xedc1('0xa5'))[_0xedc1('0x81')](_0x43e5ae[_0xedc1('0x5d')]['id'][_0xedc1('0x86')](),_0xedc1('0x66'))[_0xedc1('0x81')](_0xedc1('0xa3'),_0xedc1('0x5e'))[_0xedc1('0x81')](_0xedc1('0xa3'),_0xedc1('0x5f'))['from'](_0xedc1('0xa7'))['where'](_0xedc1('0xa8'))[_0xedc1('0x45')](_0xedc1('0xae'),_0x20a7f7['CmListId'][_0xedc1('0x86')]())['where'](_0xedc1('0xa9'))[_0xedc1('0x45')](_0xedc1('0xaf'),squel[_0xedc1('0xaa')]()[_0xedc1('0x81')]('COALESCE(phone,\x27\x27)')['from'](_0xedc1('0x9e'))[_0xedc1('0x45')]('VoiceQueueId\x20=\x20?',_0x43e5ae[_0xedc1('0x5d')]['id'][_0xedc1('0x86')]())))[_0xedc1('0x86')]();break;default:_0x7d08=squel[_0xedc1('0xad')]()['into'](_0xedc1('0x9e'))['fromQuery'](['phone',_0xedc1('0xa1'),'ContactId',_0xedc1('0xa5'),_0xedc1('0x66'),_0xedc1('0x5e'),_0xedc1('0x5f')],squel['select']()[_0xedc1('0x81')]('phone',_0xedc1('0xa0'))['field']('NOW()',_0xedc1('0xa1'))[_0xedc1('0x81')]('id',_0xedc1('0xa2'))[_0xedc1('0x81')](_0x20a7f7[_0xedc1('0xa4')][_0xedc1('0x86')](),_0xedc1('0xa5'))[_0xedc1('0x81')](_0x43e5ae['params']['id'][_0xedc1('0x86')](),'VoiceQueueId')[_0xedc1('0x81')](_0xedc1('0xa3'),_0xedc1('0x5e'))[_0xedc1('0x81')](_0xedc1('0xa3'),_0xedc1('0x5f'))[_0xedc1('0xa6')]('cm_contacts')[_0xedc1('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0xedc1('0xae'),_0x20a7f7['CmListId'][_0xedc1('0x86')]())[_0xedc1('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xedc1('0x86')]();}_0x2a4521['push'](db[_0xedc1('0x76')][_0xedc1('0x3c')](_0x7d08));}return BPromise['all'](_0x2a4521);}})['then'](function(){return _0x5f34f5;})[_0xedc1('0x31')](respondWithResult(_0x30de3f,null))[_0xedc1('0x4e')](handleError(_0x30de3f,null));};exports[_0xedc1('0xb0')]=function(_0x151bca,_0x3531b3,_0x7f49f6){return db[_0xedc1('0x38')][_0xedc1('0x51')]({'where':{'id':_0x151bca['params']['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x3531b3,null))['then'](function(_0x4de063){if(_0x4de063){return _0x4de063[_0xedc1('0xb0')](_0x151bca[_0xedc1('0x3c')][_0xedc1('0x80')]);}})[_0xedc1('0x31')](function(_0x3e8fb2){if(_0x3e8fb2){return db[_0xedc1('0x63')][_0xedc1('0x8d')]({'where':{'ListId':_0x151bca['query'][_0xedc1('0x80')],'VoiceQueueId':_0x151bca['params']['id']}})[_0xedc1('0x31')](function(){return _0x3e8fb2;});}})[_0xedc1('0x31')](respondWithStatusCode(_0x3531b3,null))['catch'](handleError(_0x3531b3,null));};exports[_0xedc1('0xb1')]=function(_0x40c71e,_0x599656,_0x1e1b76){var _0x3e5b26={};var _0x525add={};var _0x142aee;var _0x27f707;return db[_0xedc1('0x38')]['findOne']({'where':{'id':_0x40c71e[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x599656,null))['then'](function(_0x40d7bb){if(_0x40d7bb){_0x142aee=_0x40d7bb;_0x525add[_0xedc1('0x3b')]=_[_0xedc1('0x50')](db['CmList'][_0xedc1('0x39')]);_0x525add[_0xedc1('0x3c')]=_['keys'](_0x40c71e['query']);_0x525add[_0xedc1('0x46')]=_['intersection'](_0x525add[_0xedc1('0x3b')],_0x525add['query']);_0x3e5b26[_0xedc1('0x3d')]=_[_0xedc1('0x3e')](_0x525add['model'],qs[_0xedc1('0x3f')](_0x40c71e['query'][_0xedc1('0x3f')]));_0x3e5b26[_0xedc1('0x3d')]=_0x3e5b26[_0xedc1('0x3d')][_0xedc1('0x40')]?_0x3e5b26['attributes']:_0x525add['model'];_0x3e5b26[_0xedc1('0x43')]=qs[_0xedc1('0x44')](_0x40c71e[_0xedc1('0x3c')][_0xedc1('0x44')]);_0x3e5b26[_0xedc1('0x45')]=qs[_0xedc1('0x46')](_[_0xedc1('0x47')](_0x40c71e[_0xedc1('0x3c')],_0x525add[_0xedc1('0x46')]));if(_0x40c71e[_0xedc1('0x3c')][_0xedc1('0x29')]){_0x3e5b26[_0xedc1('0x45')]=_[_0xedc1('0x48')](_0x3e5b26['where'],{'$or':_[_0xedc1('0x2b')](_0x3e5b26['attributes'],function(_0x37f71c){var _0x131d5e={};_0x131d5e[_0x37f71c]={'$like':'%'+_0x40c71e[_0xedc1('0x3c')]['filter']+'%'};return _0x131d5e;})});}_0x3e5b26=_[_0xedc1('0x48')]({},_0x3e5b26,_0x40c71e[_0xedc1('0x49')]);return _0x142aee[_0xedc1('0xb1')](_0x3e5b26);}})[_0xedc1('0x31')](function(_0x7919f7){if(_0x7919f7){_0x27f707=_0x7919f7[_0xedc1('0x40')];if(!_0x40c71e[_0xedc1('0x3c')]['hasOwnProperty'](_0xedc1('0x42'))){_0x3e5b26['limit']=qs['limit'](_0x40c71e['query'][_0xedc1('0x1f')]);_0x3e5b26[_0xedc1('0x1d')]=qs[_0xedc1('0x1d')](_0x40c71e[_0xedc1('0x3c')]['offset']);}return _0x142aee[_0xedc1('0xb1')](_0x3e5b26);}})[_0xedc1('0x31')](function(_0x3ffe82){if(_0x3ffe82){return _0x3ffe82?{'count':_0x27f707,'rows':_0x3ffe82}:null;}})['then'](respondWithResult(_0x599656,null))[_0xedc1('0x4e')](handleError(_0x599656,null));};exports[_0xedc1('0xb2')]=function(_0x4ff641,_0x331119,_0x414101){var _0x12f4fc,_0x9ed340;return db[_0xedc1('0x38')][_0xedc1('0x51')]({'where':{'id':_0x4ff641[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x331119,null))['then'](function(_0x19d59b){if(_0x19d59b){_0x9ed340=_0x19d59b;return _0x19d59b[_0xedc1('0xb2')](_0x4ff641['body'][_0xedc1('0x80')],_[_0xedc1('0x60')](_0x4ff641['body'],[_0xedc1('0x80'),'id'])||{});}return null;})[_0xedc1('0x8f')](function(_0x2a0fdd){var _0x4b1c7f;_0x12f4fc=_0x2a0fdd||[];var _0x8b1f51=[];if(_0x2a0fdd){for(var _0x3e54f5=0x0;_0x3e54f5<_0x2a0fdd[_0xedc1('0x40')];_0x3e54f5+=0x1){var _0x4fec50=_0x2a0fdd[_0x3e54f5]['get']({'plain':!![]});_0x4b1c7f=squel['insert']()[_0xedc1('0xb3')]('cm_hopper_black')[_0xedc1('0x9f')]([_0xedc1('0xa0'),_0xedc1('0xa2'),_0xedc1('0xa5'),_0xedc1('0x66'),_0xedc1('0x5e'),_0xedc1('0x5f')],squel[_0xedc1('0xaa')]()[_0xedc1('0x81')]('phone','phone')[_0xedc1('0x81')]('id',_0xedc1('0xa2'))[_0xedc1('0x81')](_0x4fec50['CmListId']['toString'](),_0xedc1('0xa5'))[_0xedc1('0x81')](_0x4ff641[_0xedc1('0x5d')]['id'][_0xedc1('0x86')](),_0xedc1('0x66'))['field']('NOW()',_0xedc1('0x5e'))['field']('NOW()',_0xedc1('0x5f'))['from'](_0xedc1('0xa7'))['where'](_0xedc1('0xa8'))['where'](_0xedc1('0xae'),_0x4fec50[_0xedc1('0xa4')]['toString']())[_0xedc1('0x45')](_0xedc1('0xa9')))[_0xedc1('0x86')]();_0x8b1f51[_0xedc1('0x90')](db[_0xedc1('0x76')]['query'](_0x4b1c7f));}return BPromise[_0xedc1('0x93')](_0x8b1f51);}})[_0xedc1('0x31')](function(){return _0x12f4fc;})[_0xedc1('0x31')](respondWithResult(_0x331119,null))[_0xedc1('0x4e')](handleError(_0x331119,null));};exports['removeBlackLists']=function(_0x3e4701,_0x26f28e,_0x2cf8f0){return db[_0xedc1('0x38')]['find']({'where':{'id':_0x3e4701[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](handleEntityNotFound(_0x26f28e,null))[_0xedc1('0x31')](function(_0x320ae6){if(_0x320ae6){return _0x320ae6[_0xedc1('0xb4')](_0x3e4701[_0xedc1('0x3c')][_0xedc1('0x80')]);}})[_0xedc1('0x31')](function(_0x1f591d){if(_0x1f591d){return db[_0xedc1('0x6a')][_0xedc1('0x8d')]({'where':{'ListId':_0x3e4701[_0xedc1('0x3c')][_0xedc1('0x80')],'VoiceQueueId':_0x3e4701[_0xedc1('0x5d')]['id']}})[_0xedc1('0x31')](function(){return _0x1f591d;});}})[_0xedc1('0x31')](respondWithStatusCode(_0x26f28e,null))[_0xedc1('0x4e')](handleError(_0x26f28e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 15d1e11..b620ba5 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 _0xe509=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x48b3fb,_0x4b07bf){var _0x458604=function(_0x5484a2){while(--_0x5484a2){_0x48b3fb['push'](_0x48b3fb['shift']());}};_0x458604(++_0x4b07bf);}(_0xe509,0x161));var _0x9e50=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0xe509[_0x4cee4b];return _0x4d891d;};'use strict';var EventEmitter=require(_0x9e50('0x0'));var VoiceQueue=require(_0x9e50('0x1'))['db'][_0x9e50('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9e50('0x3')](0x0);var events={'afterCreate':_0x9e50('0x4'),'afterUpdate':_0x9e50('0x5'),'afterDestroy':_0x9e50('0x6')};function emitEvent(_0x4b4a40){return function(_0x60eaa5,_0xafa6ca,_0x4b8943){VoiceQueueEvents['emit'](_0x4b4a40+':'+_0x60eaa5['id'],_0x60eaa5);VoiceQueueEvents[_0x9e50('0x7')](_0x4b4a40,_0x60eaa5);_0x4b8943(null);};}for(var e in events){if(events[_0x9e50('0x8')](e)){var event=events[e];VoiceQueue[_0x9e50('0x9')](e,emitEvent(event));}}module[_0x9e50('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0x1bcf=['hook','events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x1bcf,0x1c1));var _0xf1bc=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x1bcf[_0x4ca6a4];return _0x120555;};'use strict';var EventEmitter=require(_0xf1bc('0x0'));var VoiceQueue=require(_0xf1bc('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf1bc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf1bc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e55c3){return function(_0x59cb4d,_0x6302b5,_0x3e240f){VoiceQueueEvents[_0xf1bc('0x4')](_0x3e55c3+':'+_0x59cb4d['id'],_0x59cb4d);VoiceQueueEvents[_0xf1bc('0x4')](_0x3e55c3,_0x59cb4d);_0x3e240f(null);};}for(var e in events){if(events[_0xf1bc('0x5')](e)){var event=events[e];VoiceQueue[_0xf1bc('0x6')](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 afe8a52..9b37001 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x55ca,0x126));var _0xa55c=function(_0x412ae1,_0x20a4c4){_0x412ae1=_0x412ae1-0x0;var _0x50bea0=_0x55ca[_0x412ae1];return _0x50bea0;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x8a612,_0x1a614e){var _0x1bf1a9=function(_0x3f5b6f){while(--_0x3f5b6f){_0x8a612['push'](_0x8a612['shift']());}};_0x1bf1a9(++_0x1a614e);}(_0x34e8,0x12c));var _0x834e=function(_0x659b46,_0x198b61){_0x659b46=_0x659b46-0x0;var _0x42bd2f=_0x34e8[_0x659b46];return _0x42bd2f;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 25adfce..6b22331 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 _0xf1f9=['../../config/utils','../../config/environment','client','http','redis','defaults','localhost','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','debug','ShowVoiceQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xf738ad,_0x5e1d7f){var _0x598570=function(_0x35088e){while(--_0x35088e){_0xf738ad['push'](_0xf738ad['shift']());}};_0x598570(++_0x5e1d7f);}(_0xf1f9,0x158));var _0x9f1f=function(_0x1263ff,_0x37a913){_0x1263ff=_0x1263ff-0x0;var _0x9c1e2=_0xf1f9[_0x1263ff];return _0x9c1e2;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f1f('0x3'));var fs=require('fs');var Redis=require(_0x9f1f('0x4'));var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9f1f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f1f('0x8')][_0x9f1f('0x9')]({'port':0x232a});config[_0x9f1f('0xa')]=_[_0x9f1f('0xb')](config[_0x9f1f('0xa')],{'host':_0x9f1f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f1f('0xa')]));require(_0x9f1f('0xd'))['register'](socket);function respondWithRpcPromise(_0x9e29e4,_0xd11e0d,_0x74651c){return new BPromise(function(_0x3a8d4d,_0x2ca9d0){return client['request'](_0x9e29e4,_0x74651c)[_0x9f1f('0xe')](function(_0xf0a401){logger[_0x9f1f('0xf')](_0x9f1f('0x10'),_0xd11e0d,_0x9f1f('0x11'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xd11e0d,_0x9f1f('0x11'),JSON[_0x9f1f('0x12')](_0xf0a401));if(_0xf0a401['error']){if(_0xf0a401[_0x9f1f('0x13')][_0x9f1f('0x14')]===0x1f4){logger[_0x9f1f('0x13')](_0x9f1f('0x10'),_0xd11e0d,_0xf0a401[_0x9f1f('0x13')][_0x9f1f('0x15')]);return _0x2ca9d0(_0xf0a401[_0x9f1f('0x13')]['message']);}logger[_0x9f1f('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xd11e0d,_0xf0a401[_0x9f1f('0x13')]['message']);return _0x3a8d4d(_0xf0a401[_0x9f1f('0x13')][_0x9f1f('0x15')]);}else{logger[_0x9f1f('0xf')](_0x9f1f('0x10'),_0xd11e0d,'request\x20sent');_0x3a8d4d(_0xf0a401[_0x9f1f('0x16')][_0x9f1f('0x15')]);}})[_0x9f1f('0x17')](function(_0x14eaa1){logger['error'](_0x9f1f('0x10'),_0xd11e0d,_0x14eaa1);_0x2ca9d0(_0x14eaa1);});});}exports['GetVoiceQueue']=function(_0x36990a){var _0x22d975=this;return new Promise(function(_0x3c2e81,_0x549a64){return db['VoiceQueue']['findAll']({'raw':_0x36990a[_0x9f1f('0x18')]?_0x36990a[_0x9f1f('0x18')][_0x9f1f('0x19')]===undefined?!![]:![]:!![],'where':_0x36990a[_0x9f1f('0x18')]?_0x36990a[_0x9f1f('0x18')][_0x9f1f('0x1a')]||null:null,'attributes':_0x36990a[_0x9f1f('0x18')]?_0x36990a[_0x9f1f('0x18')][_0x9f1f('0x1b')]||null:null,'limit':_0x36990a[_0x9f1f('0x18')]?_0x36990a[_0x9f1f('0x18')][_0x9f1f('0x1c')]||null:null,'include':_0x36990a['options']?_0x36990a[_0x9f1f('0x18')][_0x9f1f('0x1d')]?_[_0x9f1f('0x1e')](_0x36990a[_0x9f1f('0x18')][_0x9f1f('0x1d')],function(_0x2fcf38){return{'model':db[_0x2fcf38['model']],'as':_0x2fcf38['as'],'attributes':_0x2fcf38[_0x9f1f('0x1b')],'include':_0x2fcf38['include']?_[_0x9f1f('0x1e')](_0x2fcf38[_0x9f1f('0x1d')],function(_0xa80a1b){return{'model':db[_0xa80a1b[_0x9f1f('0x1f')]],'as':_0xa80a1b['as'],'attributes':_0xa80a1b[_0x9f1f('0x1b')],'include':_0xa80a1b[_0x9f1f('0x1d')]?_[_0x9f1f('0x1e')](_0xa80a1b[_0x9f1f('0x1d')],function(_0xe208e6){return{'model':db[_0xe208e6[_0x9f1f('0x1f')]],'as':_0xe208e6['as'],'attributes':_0xe208e6[_0x9f1f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9f1f('0xe')](function(_0x38c3f3){logger[_0x9f1f('0xf')](_0x9f1f('0x20'),_0x36990a);logger[_0x9f1f('0x21')](_0x9f1f('0x20'),_0x36990a,JSON[_0x9f1f('0x12')](_0x38c3f3));_0x3c2e81(_0x38c3f3);})[_0x9f1f('0x17')](function(_0x582389){logger[_0x9f1f('0x13')](_0x9f1f('0x20'),_0x582389[_0x9f1f('0x15')],_0x36990a);_0x549a64(_0x22d975[_0x9f1f('0x13')](0x1f4,_0x582389[_0x9f1f('0x15')]));});});};exports[_0x9f1f('0x22')]=function(_0x25cc91){var _0x4d3aaf=this;return new Promise(function(_0x41b062,_0x1569a6){return db['VoiceQueue']['find']({'raw':_0x25cc91['options']?_0x25cc91['options']['raw']===undefined?!![]:![]:!![],'where':_0x25cc91[_0x9f1f('0x18')]?_0x25cc91['options'][_0x9f1f('0x1a')]||null:null,'attributes':_0x25cc91['options']?_0x25cc91[_0x9f1f('0x18')][_0x9f1f('0x1b')]||null:null,'include':_0x25cc91[_0x9f1f('0x18')]?_0x25cc91[_0x9f1f('0x18')]['include']?_[_0x9f1f('0x1e')](_0x25cc91[_0x9f1f('0x18')][_0x9f1f('0x1d')],function(_0x10b2b4){return{'model':db[_0x10b2b4['model']],'as':_0x10b2b4['as'],'attributes':_0x10b2b4[_0x9f1f('0x1b')],'include':_0x10b2b4[_0x9f1f('0x1d')]?_[_0x9f1f('0x1e')](_0x10b2b4[_0x9f1f('0x1d')],function(_0x82752f){return{'model':db[_0x82752f[_0x9f1f('0x1f')]],'as':_0x82752f['as'],'attributes':_0x82752f['attributes'],'include':_0x82752f['include']?_[_0x9f1f('0x1e')](_0x82752f[_0x9f1f('0x1d')],function(_0x5629b6){return{'model':db[_0x5629b6['model']],'as':_0x5629b6['as'],'attributes':_0x5629b6[_0x9f1f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9f1f('0xe')](function(_0x4e6e81){logger[_0x9f1f('0xf')](_0x9f1f('0x22'),_0x25cc91);logger[_0x9f1f('0x21')]('ShowVoiceQueue',_0x25cc91,JSON[_0x9f1f('0x12')](_0x4e6e81));_0x41b062(_0x4e6e81);})['catch'](function(_0x8f35f9){logger[_0x9f1f('0x13')](_0x9f1f('0x22'),_0x8f35f9[_0x9f1f('0x15')],_0x25cc91);_0x1569a6(_0x4d3aaf[_0x9f1f('0x13')](0x1f4,_0x8f35f9[_0x9f1f('0x15')]));});});}; \ No newline at end of file +var _0x3387=['redis','defaults','socket.io-emitter','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','where','attributes','include','map','model','info','stringify','find','raw','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0xd73240,_0x9b21c7){var _0xe53824=function(_0x3b13a4){while(--_0x3b13a4){_0xd73240['push'](_0xd73240['shift']());}};_0xe53824(++_0x9b21c7);}(_0x3387,0xae));var _0x7338=function(_0x59d419,_0x4a8af3){_0x59d419=_0x59d419-0x0;var _0x1b4165=_0x3387[_0x59d419];return _0x1b4165;};'use strict';var _=require(_0x7338('0x0'));var util=require(_0x7338('0x1'));var moment=require(_0x7338('0x2'));var BPromise=require(_0x7338('0x3'));var rs=require(_0x7338('0x4'));var fs=require('fs');var Redis=require(_0x7338('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7338('0x6'));var logger=require('../../config/logger')(_0x7338('0x7'));var config=require(_0x7338('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7338('0x9')][_0x7338('0xa')]({'port':0x232a});config[_0x7338('0xb')]=_[_0x7338('0xc')](config[_0x7338('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7338('0xd'))(new Redis(config[_0x7338('0xb')]));require('./voiceQueue.socket')[_0x7338('0xe')](socket);function respondWithRpcPromise(_0x4389c3,_0x141a32,_0x28a031){return new BPromise(function(_0x52bb98,_0xd058c1){return client[_0x7338('0xf')](_0x4389c3,_0x28a031)[_0x7338('0x10')](function(_0x56fbe9){logger['info'](_0x7338('0x11'),_0x141a32,_0x7338('0x12'));logger[_0x7338('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x141a32,_0x7338('0x12'),JSON['stringify'](_0x56fbe9));if(_0x56fbe9[_0x7338('0x14')]){if(_0x56fbe9[_0x7338('0x14')]['code']===0x1f4){logger[_0x7338('0x14')](_0x7338('0x11'),_0x141a32,_0x56fbe9['error'][_0x7338('0x15')]);return _0xd058c1(_0x56fbe9[_0x7338('0x14')]['message']);}logger[_0x7338('0x14')](_0x7338('0x11'),_0x141a32,_0x56fbe9[_0x7338('0x14')][_0x7338('0x15')]);return _0x52bb98(_0x56fbe9[_0x7338('0x14')]['message']);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x141a32,_0x7338('0x12'));_0x52bb98(_0x56fbe9[_0x7338('0x16')][_0x7338('0x15')]);}})[_0x7338('0x17')](function(_0x194db1){logger[_0x7338('0x14')](_0x7338('0x11'),_0x141a32,_0x194db1);_0xd058c1(_0x194db1);});});}exports[_0x7338('0x18')]=function(_0xcfba36){var _0x1fae60=this;return new Promise(function(_0x304f14,_0x2a85a0){return db[_0x7338('0x19')]['findAll']({'raw':_0xcfba36[_0x7338('0x1a')]?_0xcfba36[_0x7338('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xcfba36[_0x7338('0x1a')]?_0xcfba36[_0x7338('0x1a')][_0x7338('0x1b')]||null:null,'attributes':_0xcfba36['options']?_0xcfba36[_0x7338('0x1a')][_0x7338('0x1c')]||null:null,'limit':_0xcfba36[_0x7338('0x1a')]?_0xcfba36[_0x7338('0x1a')]['limit']||null:null,'include':_0xcfba36['options']?_0xcfba36[_0x7338('0x1a')][_0x7338('0x1d')]?_[_0x7338('0x1e')](_0xcfba36[_0x7338('0x1a')]['include'],function(_0x5e0983){return{'model':db[_0x5e0983[_0x7338('0x1f')]],'as':_0x5e0983['as'],'attributes':_0x5e0983['attributes'],'include':_0x5e0983['include']?_[_0x7338('0x1e')](_0x5e0983[_0x7338('0x1d')],function(_0xd9f0c3){return{'model':db[_0xd9f0c3['model']],'as':_0xd9f0c3['as'],'attributes':_0xd9f0c3['attributes'],'include':_0xd9f0c3[_0x7338('0x1d')]?_['map'](_0xd9f0c3[_0x7338('0x1d')],function(_0x7f12d){return{'model':db[_0x7f12d['model']],'as':_0x7f12d['as'],'attributes':_0x7f12d[_0x7338('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7338('0x10')](function(_0xb93bff){logger[_0x7338('0x20')]('GetVoiceQueue',_0xcfba36);logger[_0x7338('0x13')]('GetVoiceQueue',_0xcfba36,JSON[_0x7338('0x21')](_0xb93bff));_0x304f14(_0xb93bff);})['catch'](function(_0x158593){logger[_0x7338('0x14')](_0x7338('0x18'),_0x158593[_0x7338('0x15')],_0xcfba36);_0x2a85a0(_0x1fae60[_0x7338('0x14')](0x1f4,_0x158593[_0x7338('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x363ad0){var _0x13c725=this;return new Promise(function(_0x3a321c,_0x443f17){return db[_0x7338('0x19')][_0x7338('0x22')]({'raw':_0x363ad0[_0x7338('0x1a')]?_0x363ad0['options'][_0x7338('0x23')]===undefined?!![]:![]:!![],'where':_0x363ad0[_0x7338('0x1a')]?_0x363ad0['options']['where']||null:null,'attributes':_0x363ad0[_0x7338('0x1a')]?_0x363ad0[_0x7338('0x1a')][_0x7338('0x1c')]||null:null,'include':_0x363ad0[_0x7338('0x1a')]?_0x363ad0[_0x7338('0x1a')][_0x7338('0x1d')]?_[_0x7338('0x1e')](_0x363ad0['options']['include'],function(_0x221fd8){return{'model':db[_0x221fd8['model']],'as':_0x221fd8['as'],'attributes':_0x221fd8[_0x7338('0x1c')],'include':_0x221fd8[_0x7338('0x1d')]?_[_0x7338('0x1e')](_0x221fd8[_0x7338('0x1d')],function(_0x4e27ff){return{'model':db[_0x4e27ff[_0x7338('0x1f')]],'as':_0x4e27ff['as'],'attributes':_0x4e27ff[_0x7338('0x1c')],'include':_0x4e27ff[_0x7338('0x1d')]?_[_0x7338('0x1e')](_0x4e27ff['include'],function(_0x777d16){return{'model':db[_0x777d16['model']],'as':_0x777d16['as'],'attributes':_0x777d16[_0x7338('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7338('0x10')](function(_0x2f14a6){logger[_0x7338('0x20')]('ShowVoiceQueue',_0x363ad0);logger[_0x7338('0x13')]('ShowVoiceQueue',_0x363ad0,JSON[_0x7338('0x21')](_0x2f14a6));_0x3a321c(_0x2f14a6);})[_0x7338('0x17')](function(_0x436459){logger[_0x7338('0x14')](_0x7338('0x24'),_0x436459[_0x7338('0x15')],_0x363ad0);_0x443f17(_0x13c725[_0x7338('0x14')](0x1f4,_0x436459[_0x7338('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 593a5aa..f4926c3 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 _0x0f10=['save','remove','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x5dbccf,_0x23d9d9){var _0x5a73ef=function(_0x3f475c){while(--_0x3f475c){_0x5dbccf['push'](_0x5dbccf['shift']());}};_0x5a73ef(++_0x23d9d9);}(_0x0f10,0x18b));var _0x00f1=function(_0x3918cb,_0x528fb9){_0x3918cb=_0x3918cb-0x0;var _0x12b5d3=_0x0f10[_0x3918cb];return _0x12b5d3;};'use strict';var VoiceQueueEvents=require(_0x00f1('0x0'));var events=[_0x00f1('0x1'),_0x00f1('0x2'),'update'];function createListener(_0xd83b29,_0x53d408){return function(_0x53d5d7){_0x53d408['emit'](_0xd83b29,_0x53d5d7);};}function removeListener(_0x122de2,_0x5af84b){return function(){VoiceQueueEvents[_0x00f1('0x3')](_0x122de2,_0x5af84b);};}exports[_0x00f1('0x4')]=function(_0x2ea596){for(var _0x2a553c=0x0,_0x325e46=events['length'];_0x2a553c<_0x325e46;_0x2a553c++){var _0x28f468=events[_0x2a553c];var _0x4b8fa4=createListener(_0x00f1('0x5')+_0x28f468,_0x2ea596);VoiceQueueEvents['on'](_0x28f468,_0x4b8fa4);}}; \ No newline at end of file +var _0xed92=['remove','update','removeListener','register','length'];(function(_0x338085,_0x4496b2){var _0x3212ca=function(_0x100a2c){while(--_0x100a2c){_0x338085['push'](_0x338085['shift']());}};_0x3212ca(++_0x4496b2);}(_0xed92,0x163));var _0x2ed9=function(_0x564518,_0x5ab2b2){_0x564518=_0x564518-0x0;var _0x5bf3c9=_0xed92[_0x564518];return _0x5bf3c9;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x2ed9('0x0'),_0x2ed9('0x1')];function createListener(_0x44fbc1,_0x1f4124){return function(_0x4e4256){_0x1f4124['emit'](_0x44fbc1,_0x4e4256);};}function removeListener(_0x517cd8,_0x4c5b6f){return function(){VoiceQueueEvents[_0x2ed9('0x2')](_0x517cd8,_0x4c5b6f);};}exports[_0x2ed9('0x3')]=function(_0x2ee338){for(var _0x2bc96f=0x0,_0x45b811=events[_0x2ed9('0x4')];_0x2bc96f<_0x45b811;_0x2bc96f++){var _0x4c4ac3=events[_0x2bc96f];var _0x42a575=createListener('voiceQueue:'+_0x4c4ac3,_0x2ee338);VoiceQueueEvents['on'](_0x4c4ac3,_0x42a575);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 859810b..fd6806c 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 _0x0e17=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','post','create','put','/:id','update'];(function(_0x2c8eae,_0x4f8837){var _0x2a6d30=function(_0x31620d){while(--_0x31620d){_0x2c8eae['push'](_0x2c8eae['shift']());}};_0x2a6d30(++_0x4f8837);}(_0x0e17,0xf5));var _0x70e1=function(_0x4337e3,_0x2c20b3){_0x4337e3=_0x4337e3-0x0;var _0x3fd01f=_0x0e17[_0x4337e3];return _0x3fd01f;};'use strict';var multer=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var path=require('path');var timeout=require(_0x70e1('0x2'));var express=require(_0x70e1('0x3'));var router=express['Router']();var fs_extra=require(_0x70e1('0x4'));var auth=require(_0x70e1('0x5'));var interaction=require(_0x70e1('0x6'));var config=require(_0x70e1('0x7'));var controller=require(_0x70e1('0x8'));router[_0x70e1('0x9')]('/',auth[_0x70e1('0xa')](),controller['index']);router['get'](_0x70e1('0xb'),auth['isAuthenticated'](),controller[_0x70e1('0xc')]);router[_0x70e1('0x9')](_0x70e1('0xd'),auth[_0x70e1('0xa')](),controller['getVoiceQueuesReport']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x70e1('0xe')]('/',auth[_0x70e1('0xa')](),controller[_0x70e1('0xf')]);router[_0x70e1('0x10')](_0x70e1('0x11'),auth[_0x70e1('0xa')](),controller[_0x70e1('0x12')]);router[_0x70e1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x70e1('0x14')]);module[_0x70e1('0x15')]=router; \ No newline at end of file +var _0x4262=['connect-timeout','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','destroy','exports','util'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x4262,0x109));var _0x2426=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4262[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x2426('0x0'));var path=require('path');var timeout=require(_0x2426('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2426('0x2'));var interaction=require(_0x2426('0x3'));var config=require('../../config/environment');var controller=require(_0x2426('0x4'));router[_0x2426('0x5')]('/',auth[_0x2426('0x6')](),controller[_0x2426('0x7')]);router[_0x2426('0x5')](_0x2426('0x8'),auth[_0x2426('0x6')](),controller['describe']);router[_0x2426('0x5')](_0x2426('0x9'),auth[_0x2426('0x6')](),controller[_0x2426('0xa')]);router[_0x2426('0x5')](_0x2426('0xb'),auth[_0x2426('0x6')](),controller[_0x2426('0xc')]);router[_0x2426('0xd')]('/',auth[_0x2426('0x6')](),controller[_0x2426('0xe')]);router[_0x2426('0xf')](_0x2426('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2426('0x10')](_0x2426('0xb'),auth[_0x2426('0x6')](),controller[_0x2426('0x11')]);module[_0x2426('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 998b2fb..7a53b52 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 _0xb415=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x426711,_0x12264c){var _0x592991=function(_0x564614){while(--_0x564614){_0x426711['push'](_0x426711['shift']());}};_0x592991(++_0x12264c);}(_0xb415,0x7f));var _0x5b41=function(_0x1599fa,_0x1a5de9){_0x1599fa=_0x1599fa-0x0;var _0x586ce5=_0xb415[_0x1599fa];return _0x586ce5;};'use strict';var Sequelize=require(_0x5b41('0x0'));var moment=require(_0x5b41('0x1'));module[_0x5b41('0x2')]={'type':{'type':Sequelize[_0x5b41('0x3')]},'uniqueid':{'type':Sequelize[_0x5b41('0x3')]},'calleridnum':{'type':Sequelize[_0x5b41('0x3')]},'calleridname':{'type':Sequelize[_0x5b41('0x3')]},'queue':{'type':Sequelize[_0x5b41('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x5b41('0x4')],'set':function(_0x5d2003){var _0x3feddb=moment(_0x5d2003);var _0x4254df=moment(this[_0x5b41('0x5')](_0x5b41('0x6')))['format'](_0x5b41('0x7'));var _0x560897=_0x3feddb['diff'](_0x4254df,'seconds');this[_0x5b41('0x8')](_0x5b41('0x9'),_0x5d2003);this['setDataValue'](_0x5b41('0xa'),_0x560897||null);}},'position':{'type':Sequelize[_0x5b41('0xb')]},'count':{'type':Sequelize[_0x5b41('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x5b41('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x5b41('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5b41('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5b41('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x5b41('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x5b41('0xb')]},'channel':{'type':Sequelize[_0x5b41('0x3')]},'connectedlinenum':{'type':Sequelize[_0x5b41('0x3')]},'connectedlinename':{'type':Sequelize[_0x5b41('0x3')]},'accountcode':{'type':Sequelize[_0x5b41('0x3')]},'context':{'type':Sequelize[_0x5b41('0x3')]},'exten':{'type':Sequelize[_0x5b41('0x3')]},'priority':{'type':Sequelize[_0x5b41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5b41('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5b41('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x5b41('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5b41('0x3')],'comment':_0x5b41('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x5b41('0x3')]},'disposition':{'type':Sequelize[_0x5b41('0x3')]},'secondDisposition':{'type':Sequelize[_0x5b41('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5b41('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x5b41('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfbc6=['diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x552807,_0x13d10c){var _0x31cc0b=function(_0x1c5fba){while(--_0x1c5fba){_0x552807['push'](_0x552807['shift']());}};_0x31cc0b(++_0x13d10c);}(_0xfbc6,0x13c));var _0x6fbc=function(_0x5738f7,_0x17df47){_0x5738f7=_0x5738f7-0x0;var _0x2e6d3c=_0xfbc6[_0x5738f7];return _0x2e6d3c;};'use strict';var Sequelize=require(_0x6fbc('0x0'));var moment=require('moment');module[_0x6fbc('0x1')]={'type':{'type':Sequelize[_0x6fbc('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6fbc('0x2')]},'queue':{'type':Sequelize[_0x6fbc('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x6fbc('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x6fbc('0x3')],'set':function(_0x41c1f5){var _0x2f0e0f=moment(_0x41c1f5);var _0x525594=moment(this['getDataValue']('queuecallerjoinAt'))[_0x6fbc('0x4')](_0x6fbc('0x5'));var _0x2682d4=_0x2f0e0f[_0x6fbc('0x6')](_0x525594,_0x6fbc('0x7'));this['setDataValue'](_0x6fbc('0x8'),_0x41c1f5);this[_0x6fbc('0x9')](_0x6fbc('0xa'),_0x2682d4||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x6fbc('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x6fbc('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6fbc('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x6fbc('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x6fbc('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6fbc('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x6fbc('0x2')],'comment':_0x6fbc('0xd')},'originalposition':{'type':Sequelize[_0x6fbc('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6fbc('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6fbc('0x2')]},'context':{'type':Sequelize[_0x6fbc('0x2')]},'exten':{'type':Sequelize[_0x6fbc('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x6fbc('0xb')]},'mohtime':{'type':Sequelize[_0x6fbc('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6fbc('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6fbc('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x6fbc('0x2')]},'transferuniqueid':{'type':Sequelize[_0x6fbc('0x2')]},'disposition':{'type':Sequelize[_0x6fbc('0x2')]},'secondDisposition':{'type':Sequelize[_0x6fbc('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x6fbc('0xb')],'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 084fe60..622c40e 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 _0xbedf=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','rows','catch','show','intersection','find','create','body','params','describe','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0xbedf,0x17d));var _0xfbed=function(_0x367a44,_0x121a26){_0x367a44=_0x367a44-0x0;var _0x14c9d1=_0xbedf[_0x367a44];return _0x14c9d1;};'use strict';var emlformat=require(_0xfbed('0x0'));var rimraf=require(_0xfbed('0x1'));var zipdir=require(_0xfbed('0x2'));var jsonpatch=require(_0xfbed('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfbed('0x4'));var Mustache=require(_0xfbed('0x5'));var util=require(_0xfbed('0x6'));var path=require(_0xfbed('0x7'));var sox=require(_0xfbed('0x8'));var csv=require(_0xfbed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfbed('0xa'));var crypto=require(_0xfbed('0xb'));var jsforce=require(_0xfbed('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfbed('0x9'));var querystring=require(_0xfbed('0xd'));var Papa=require(_0xfbed('0xe'));var Redis=require('ioredis');var authService=require(_0xfbed('0xf'));var qs=require(_0xfbed('0x10'));var as=require(_0xfbed('0x11'));var hardwareService=require(_0xfbed('0x12'));var logger=require(_0xfbed('0x13'))(_0xfbed('0x14'));var utils=require(_0xfbed('0x15'));var config=require(_0xfbed('0x16'));var licenseUtil=require(_0xfbed('0x17'));var db=require(_0xfbed('0x18'))['db'];config[_0xfbed('0x19')]=_[_0xfbed('0x1a')](config[_0xfbed('0x19')],{'host':_0xfbed('0x1b'),'port':0x18eb});var socket=require(_0xfbed('0x1c'))(new Redis(config[_0xfbed('0x19')]));require('./voiceQueueReport.socket')[_0xfbed('0x1d')](socket);function respondWithStatusCode(_0x6d3081,_0x3a2420){_0x3a2420=_0x3a2420||0xcc;return function(_0x511e2c){if(_0x511e2c){return _0x6d3081[_0xfbed('0x1e')](_0x3a2420);}return _0x6d3081[_0xfbed('0x1f')](_0x3a2420)[_0xfbed('0x20')]();};}function respondWithResult(_0x4770bc,_0x49f4bf){_0x49f4bf=_0x49f4bf||0xc8;return function(_0x12120a){if(_0x12120a){return _0x4770bc[_0xfbed('0x1f')](_0x49f4bf)[_0xfbed('0x21')](_0x12120a);}};}function respondWithFilteredResult(_0x1f70eb,_0x4647e5){return function(_0x14f659){if(_0x14f659){var _0x3cc033=typeof _0x4647e5['offset']===_0xfbed('0x22')&&typeof _0x4647e5[_0xfbed('0x23')]==='undefined';var _0x228ed3=_0x14f659['count'];var _0xc77798=_0x3cc033?0x0:_0x4647e5[_0xfbed('0x24')];var _0x1a22b6=_0x3cc033?_0x14f659[_0xfbed('0x25')]:_0x4647e5[_0xfbed('0x24')]+_0x4647e5[_0xfbed('0x23')];var _0x2e2c93;if(_0x1a22b6>=_0x228ed3){_0x1a22b6=_0x228ed3;_0x2e2c93=0xc8;}else{_0x2e2c93=0xce;}_0x1f70eb[_0xfbed('0x1f')](_0x2e2c93);return _0x1f70eb['set'](_0xfbed('0x26'),_0xc77798+'-'+_0x1a22b6+'/'+_0x228ed3)[_0xfbed('0x21')](_0x14f659);}return null;};}function patchUpdates(_0x45da5b){return function(_0x2d4cc8){try{jsonpatch[_0xfbed('0x27')](_0x2d4cc8,_0x45da5b,!![]);}catch(_0x4f895a){return BPromise[_0xfbed('0x28')](_0x4f895a);}return _0x2d4cc8[_0xfbed('0x29')]();};}function saveUpdates(_0x2131ba,_0xcfb8b1){return function(_0x57834d){if(_0x57834d){return _0x57834d[_0xfbed('0x2a')](_0x2131ba)[_0xfbed('0x2b')](function(_0x521e40){return _0x521e40;});}return null;};}function removeEntity(_0x5981cb,_0x57c0ff){return function(_0x11763b){if(_0x11763b){return _0x11763b['destroy']()[_0xfbed('0x2b')](function(){_0x5981cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b026,_0x50e070){return function(_0x34ebb1){if(!_0x34ebb1){_0x32b026[_0xfbed('0x1e')](0x194);}return _0x34ebb1;};}function handleError(_0x4c2bc1,_0x5bed14){_0x5bed14=_0x5bed14||0x1f4;return function(_0x404341){logger['error'](_0x404341['stack']);if(_0x404341[_0xfbed('0x2c')]){delete _0x404341['name'];}_0x4c2bc1[_0xfbed('0x1f')](_0x5bed14)[_0xfbed('0x2d')](_0x404341);};}exports[_0xfbed('0x2e')]=function(_0x44510b,_0x513b88){var _0x5e4ff5={},_0x167057={},_0x1b9af2={'count':0x0,'rows':[]};var _0x44b64f=_[_0xfbed('0x2f')](db[_0xfbed('0x30')][_0xfbed('0x31')],function(_0x31abae){return{'name':_0x31abae['fieldName'],'type':_0x31abae[_0xfbed('0x32')]['key']};});_0x167057[_0xfbed('0x33')]=_['map'](_0x44b64f,'name');_0x167057[_0xfbed('0x34')]=_[_0xfbed('0x35')](_0x44510b['query']);_0x167057[_0xfbed('0x36')]=_['intersection'](_0x167057[_0xfbed('0x33')],_0x167057[_0xfbed('0x34')]);_0x5e4ff5[_0xfbed('0x37')]=_['intersection'](_0x167057['model'],qs[_0xfbed('0x38')](_0x44510b[_0xfbed('0x34')]['fields']));_0x5e4ff5[_0xfbed('0x37')]=_0x5e4ff5[_0xfbed('0x37')][_0xfbed('0x39')]?_0x5e4ff5[_0xfbed('0x37')]:_0x167057[_0xfbed('0x33')];if(!_0x44510b[_0xfbed('0x34')][_0xfbed('0x3a')](_0xfbed('0x3b'))){_0x5e4ff5[_0xfbed('0x23')]=qs[_0xfbed('0x23')](_0x44510b[_0xfbed('0x34')]['limit']);_0x5e4ff5['offset']=qs[_0xfbed('0x24')](_0x44510b['query'][_0xfbed('0x24')]);}_0x5e4ff5[_0xfbed('0x3c')]=qs[_0xfbed('0x3d')](_0x44510b['query'][_0xfbed('0x3d')]);_0x5e4ff5['where']=qs[_0xfbed('0x36')](_[_0xfbed('0x3e')](_0x44510b[_0xfbed('0x34')],_0x167057[_0xfbed('0x36')]),_0x44b64f);if(_0x44510b[_0xfbed('0x34')][_0xfbed('0x3f')]){_0x5e4ff5['where']=_[_0xfbed('0x40')](_0x5e4ff5[_0xfbed('0x41')],{'$or':_[_0xfbed('0x2f')](_0x44b64f,function(_0x55255b){if(_0x55255b[_0xfbed('0x32')]!=='VIRTUAL'){var _0x58b758={};_0x58b758[_0x55255b[_0xfbed('0x2c')]]={'$like':'%'+_0x44510b['query'][_0xfbed('0x3f')]+'%'};return _0x58b758;}})});}_0x5e4ff5=_[_0xfbed('0x40')]({},_0x5e4ff5,_0x44510b[_0xfbed('0x42')]);var _0x45d38e={'where':_0x5e4ff5[_0xfbed('0x41')]};return db['VoiceQueueReport'][_0xfbed('0x25')](_0x45d38e)['then'](function(_0x144c1d){_0x1b9af2[_0xfbed('0x25')]=_0x144c1d;if(_0x44510b[_0xfbed('0x34')][_0xfbed('0x43')]){_0x5e4ff5[_0xfbed('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5e4ff5);})[_0xfbed('0x2b')](function(_0x2c3678){_0x1b9af2[_0xfbed('0x45')]=_0x2c3678;return _0x1b9af2;})[_0xfbed('0x2b')](respondWithFilteredResult(_0x513b88,_0x5e4ff5))[_0xfbed('0x46')](handleError(_0x513b88,null));};exports[_0xfbed('0x47')]=function(_0x45ab4a,_0x5cad58){var _0x334a06={'raw':![],'where':{'id':_0x45ab4a['params']['id']}},_0x11aa12={};_0x11aa12['model']=_['keys'](db[_0xfbed('0x30')][_0xfbed('0x31')]);_0x11aa12['query']=_[_0xfbed('0x35')](_0x45ab4a['query']);_0x11aa12[_0xfbed('0x36')]=_['intersection'](_0x11aa12[_0xfbed('0x33')],_0x11aa12['query']);_0x334a06[_0xfbed('0x37')]=_[_0xfbed('0x48')](_0x11aa12[_0xfbed('0x33')],qs[_0xfbed('0x38')](_0x45ab4a['query'][_0xfbed('0x38')]));_0x334a06['attributes']=_0x334a06[_0xfbed('0x37')][_0xfbed('0x39')]?_0x334a06[_0xfbed('0x37')]:_0x11aa12[_0xfbed('0x33')];if(_0x45ab4a[_0xfbed('0x34')][_0xfbed('0x43')]){_0x334a06[_0xfbed('0x44')]=[{'all':!![]}];}_0x334a06=_[_0xfbed('0x40')]({},_0x334a06,_0x45ab4a[_0xfbed('0x42')]);return db['VoiceQueueReport'][_0xfbed('0x49')](_0x334a06)['then'](handleEntityNotFound(_0x5cad58,null))[_0xfbed('0x2b')](respondWithResult(_0x5cad58,null))[_0xfbed('0x46')](handleError(_0x5cad58,null));};exports[_0xfbed('0x4a')]=function(_0x563d3f,_0x5ec6c2){return db[_0xfbed('0x30')][_0xfbed('0x4a')](_0x563d3f[_0xfbed('0x4b')],{})[_0xfbed('0x2b')](respondWithResult(_0x5ec6c2,0xc9))[_0xfbed('0x46')](handleError(_0x5ec6c2,null));};exports[_0xfbed('0x2a')]=function(_0x1a9ec5,_0x2d5f31){if(_0x1a9ec5[_0xfbed('0x4b')]['id']){delete _0x1a9ec5[_0xfbed('0x4b')]['id'];}return db[_0xfbed('0x30')][_0xfbed('0x49')]({'where':{'id':_0x1a9ec5[_0xfbed('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d5f31,null))[_0xfbed('0x2b')](saveUpdates(_0x1a9ec5[_0xfbed('0x4b')],null))[_0xfbed('0x2b')](respondWithResult(_0x2d5f31,null))[_0xfbed('0x46')](handleError(_0x2d5f31,null));};exports['destroy']=function(_0x5633a2,_0x3ac5ba){return db['VoiceQueueReport'][_0xfbed('0x49')]({'where':{'id':_0x5633a2['params']['id']}})[_0xfbed('0x2b')](handleEntityNotFound(_0x3ac5ba,null))['then'](removeEntity(_0x3ac5ba,null))[_0xfbed('0x46')](handleError(_0x3ac5ba,null));};exports[_0xfbed('0x4d')]=function(_0x4f9fb7,_0x282432){return db['VoiceQueueReport']['describe']()[_0xfbed('0x2b')](respondWithResult(_0x282432,null))[_0xfbed('0x46')](handleError(_0x282432,null));};exports['getVoiceQueuesReport']=function(_0x5f4c70,_0x41d724){var _0x6ed874={},_0x3df77a={},_0x33aac4={'count':0x0,'rows':[]};_0x3df77a['model']=_[_0xfbed('0x35')](db[_0xfbed('0x30')][_0xfbed('0x31')]);_0x3df77a[_0xfbed('0x34')]=_[_0xfbed('0x35')](_0x5f4c70[_0xfbed('0x34')]);_0x3df77a[_0xfbed('0x36')]=_[_0xfbed('0x48')](_0x3df77a[_0xfbed('0x33')],_0x3df77a[_0xfbed('0x34')]);_0x6ed874['attributes']=_[_0xfbed('0x48')](_0x3df77a[_0xfbed('0x33')],qs[_0xfbed('0x38')](_0x5f4c70[_0xfbed('0x34')]['fields']));_0x6ed874['attributes']=_0x6ed874[_0xfbed('0x37')][_0xfbed('0x39')]?_0x6ed874['attributes']:_0x3df77a[_0xfbed('0x33')];if(!_0x5f4c70[_0xfbed('0x34')][_0xfbed('0x3a')](_0xfbed('0x3b'))){_0x6ed874[_0xfbed('0x23')]=qs['limit'](_0x5f4c70[_0xfbed('0x34')][_0xfbed('0x23')]);_0x6ed874[_0xfbed('0x24')]=qs[_0xfbed('0x24')](_0x5f4c70[_0xfbed('0x34')][_0xfbed('0x24')]);}_0x6ed874[_0xfbed('0x3c')]=qs[_0xfbed('0x3d')](_0x5f4c70[_0xfbed('0x34')][_0xfbed('0x3d')]);_0x6ed874[_0xfbed('0x41')]=qs[_0xfbed('0x36')](_[_0xfbed('0x3e')](_0x5f4c70[_0xfbed('0x34')],_0x3df77a['filters']));if(_0x5f4c70[_0xfbed('0x34')][_0xfbed('0x3f')]){_0x6ed874[_0xfbed('0x41')]=_[_0xfbed('0x40')](_0x6ed874[_0xfbed('0x41')],{'$or':_[_0xfbed('0x2f')](_0x6ed874[_0xfbed('0x37')],function(_0x392f4a){var _0x453dab={};_0x453dab[_0x392f4a]={'$like':'%'+_0x5f4c70[_0xfbed('0x34')]['filter']+'%'};return _0x453dab;})});}_0x6ed874=_[_0xfbed('0x40')]({},_0x6ed874,_0x5f4c70[_0xfbed('0x42')]);var _0x226b80={'where':_0x6ed874[_0xfbed('0x41')]};return db[_0xfbed('0x30')][_0xfbed('0x25')](_0x226b80)[_0xfbed('0x2b')](function(_0x1ee046){_0x33aac4[_0xfbed('0x25')]=_0x1ee046;if(_0x5f4c70[_0xfbed('0x34')][_0xfbed('0x43')]){_0x6ed874[_0xfbed('0x44')]=[{'all':!![]}];}return db[_0xfbed('0x30')][_0xfbed('0x4e')](_0x6ed874);})['then'](function(_0x197055){_0x33aac4[_0xfbed('0x45')]=_0x197055;return _0x33aac4;})[_0xfbed('0x2b')](respondWithFilteredResult(_0x41d724,_0x6ed874,'getVoiceQueuesReport'))[_0xfbed('0x46')](handleError(_0x41d724,null,_0xfbed('0x4f')));}; \ No newline at end of file +var _0xb20c=['findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','reject','then','destroy','error','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','rows','params','options','find','catch','create','body','describe','getVoiceQueuesReport','pick'];(function(_0x2687a4,_0x3889f7){var _0x281ae3=function(_0x11bdd2){while(--_0x11bdd2){_0x2687a4['push'](_0x2687a4['shift']());}};_0x281ae3(++_0x3889f7);}(_0xb20c,0x99));var _0xcb20=function(_0x1ece1e,_0x4b1a11){_0x1ece1e=_0x1ece1e-0x0;var _0x305011=_0xb20c[_0x1ece1e];return _0x305011;};'use strict';var emlformat=require(_0xcb20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb20('0x1'));var jsonpatch=require(_0xcb20('0x2'));var rp=require(_0xcb20('0x3'));var moment=require(_0xcb20('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb20('0x5'));var util=require(_0xcb20('0x6'));var path=require(_0xcb20('0x7'));var sox=require('sox');var csv=require(_0xcb20('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb20('0x9'));var squel=require('squel');var crypto=require(_0xcb20('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcb20('0xb'));var Papa=require(_0xcb20('0xc'));var Redis=require('ioredis');var authService=require(_0xcb20('0xd'));var qs=require(_0xcb20('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb20('0xf'));var logger=require(_0xcb20('0x10'))(_0xcb20('0x11'));var utils=require(_0xcb20('0x12'));var config=require(_0xcb20('0x13'));var licenseUtil=require(_0xcb20('0x14'));var db=require(_0xcb20('0x15'))['db'];config[_0xcb20('0x16')]=_['defaults'](config['redis'],{'host':_0xcb20('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb20('0x16')]));require(_0xcb20('0x18'))[_0xcb20('0x19')](socket);function respondWithStatusCode(_0x4056f,_0x53b732){_0x53b732=_0x53b732||0xcc;return function(_0x401d39){if(_0x401d39){return _0x4056f[_0xcb20('0x1a')](_0x53b732);}return _0x4056f['status'](_0x53b732)[_0xcb20('0x1b')]();};}function respondWithResult(_0x2d7e6d,_0x4ccefc){_0x4ccefc=_0x4ccefc||0xc8;return function(_0x466ee4){if(_0x466ee4){return _0x2d7e6d[_0xcb20('0x1c')](_0x4ccefc)[_0xcb20('0x1d')](_0x466ee4);}};}function respondWithFilteredResult(_0x31f11d,_0xf67956){return function(_0x4287bc){if(_0x4287bc){var _0x8d44b1=typeof _0xf67956[_0xcb20('0x1e')]==='undefined'&&typeof _0xf67956[_0xcb20('0x1f')]===_0xcb20('0x20');var _0x30efae=_0x4287bc[_0xcb20('0x21')];var _0x4f1f09=_0x8d44b1?0x0:_0xf67956[_0xcb20('0x1e')];var _0x2bf33a=_0x8d44b1?_0x4287bc[_0xcb20('0x21')]:_0xf67956[_0xcb20('0x1e')]+_0xf67956[_0xcb20('0x1f')];var _0x2dd708;if(_0x2bf33a>=_0x30efae){_0x2bf33a=_0x30efae;_0x2dd708=0xc8;}else{_0x2dd708=0xce;}_0x31f11d[_0xcb20('0x1c')](_0x2dd708);return _0x31f11d['set']('Content-Range',_0x4f1f09+'-'+_0x2bf33a+'/'+_0x30efae)[_0xcb20('0x1d')](_0x4287bc);}return null;};}function patchUpdates(_0x12c3cf){return function(_0x48c54d){try{jsonpatch['apply'](_0x48c54d,_0x12c3cf,!![]);}catch(_0x537f0a){return BPromise[_0xcb20('0x22')](_0x537f0a);}return _0x48c54d['save']();};}function saveUpdates(_0x3dbc9a,_0x1a66e8){return function(_0xc828f3){if(_0xc828f3){return _0xc828f3['update'](_0x3dbc9a)[_0xcb20('0x23')](function(_0x33450d){return _0x33450d;});}return null;};}function removeEntity(_0x1a4a9c,_0x48ddec){return function(_0x9483a3){if(_0x9483a3){return _0x9483a3[_0xcb20('0x24')]()[_0xcb20('0x23')](function(){_0x1a4a9c[_0xcb20('0x1c')](0xcc)[_0xcb20('0x1b')]();});}};}function handleEntityNotFound(_0x5be4e6,_0x414371){return function(_0x2925e6){if(!_0x2925e6){_0x5be4e6[_0xcb20('0x1a')](0x194);}return _0x2925e6;};}function handleError(_0x3007c4,_0x321aed){_0x321aed=_0x321aed||0x1f4;return function(_0x1ce1dd){logger[_0xcb20('0x25')](_0x1ce1dd['stack']);if(_0x1ce1dd[_0xcb20('0x26')]){delete _0x1ce1dd[_0xcb20('0x26')];}_0x3007c4[_0xcb20('0x1c')](_0x321aed)[_0xcb20('0x27')](_0x1ce1dd);};}exports[_0xcb20('0x28')]=function(_0x51595d,_0x8b5a7b){var _0x1983f4={},_0x9902a1={},_0x25d7e3={'count':0x0,'rows':[]};var _0x5b6b74=_['map'](db[_0xcb20('0x29')][_0xcb20('0x2a')],function(_0x1bbdc){return{'name':_0x1bbdc[_0xcb20('0x2b')],'type':_0x1bbdc[_0xcb20('0x2c')][_0xcb20('0x2d')]};});_0x9902a1[_0xcb20('0x2e')]=_[_0xcb20('0x2f')](_0x5b6b74,_0xcb20('0x26'));_0x9902a1['query']=_[_0xcb20('0x30')](_0x51595d[_0xcb20('0x31')]);_0x9902a1[_0xcb20('0x32')]=_[_0xcb20('0x33')](_0x9902a1[_0xcb20('0x2e')],_0x9902a1['query']);_0x1983f4[_0xcb20('0x34')]=_[_0xcb20('0x33')](_0x9902a1[_0xcb20('0x2e')],qs[_0xcb20('0x35')](_0x51595d[_0xcb20('0x31')][_0xcb20('0x35')]));_0x1983f4['attributes']=_0x1983f4[_0xcb20('0x34')][_0xcb20('0x36')]?_0x1983f4['attributes']:_0x9902a1[_0xcb20('0x2e')];if(!_0x51595d[_0xcb20('0x31')][_0xcb20('0x37')](_0xcb20('0x38'))){_0x1983f4[_0xcb20('0x1f')]=qs['limit'](_0x51595d[_0xcb20('0x31')][_0xcb20('0x1f')]);_0x1983f4['offset']=qs[_0xcb20('0x1e')](_0x51595d[_0xcb20('0x31')][_0xcb20('0x1e')]);}_0x1983f4[_0xcb20('0x39')]=qs[_0xcb20('0x3a')](_0x51595d[_0xcb20('0x31')][_0xcb20('0x3a')]);_0x1983f4['where']=qs[_0xcb20('0x32')](_['pick'](_0x51595d[_0xcb20('0x31')],_0x9902a1[_0xcb20('0x32')]),_0x5b6b74);if(_0x51595d[_0xcb20('0x31')][_0xcb20('0x3b')]){_0x1983f4[_0xcb20('0x3c')]=_[_0xcb20('0x3d')](_0x1983f4[_0xcb20('0x3c')],{'$or':_[_0xcb20('0x2f')](_0x5b6b74,function(_0x467cce){if(_0x467cce['type']!==_0xcb20('0x3e')){var _0x4eaab1={};_0x4eaab1[_0x467cce['name']]={'$like':'%'+_0x51595d['query'][_0xcb20('0x3b')]+'%'};return _0x4eaab1;}})});}_0x1983f4=_[_0xcb20('0x3d')]({},_0x1983f4,_0x51595d['options']);var _0x519e4a={'where':_0x1983f4['where']};return db[_0xcb20('0x29')]['count'](_0x519e4a)[_0xcb20('0x23')](function(_0x54199c){_0x25d7e3['count']=_0x54199c;if(_0x51595d[_0xcb20('0x31')][_0xcb20('0x3f')]){_0x1983f4[_0xcb20('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1983f4);})[_0xcb20('0x23')](function(_0x1b1a33){_0x25d7e3[_0xcb20('0x41')]=_0x1b1a33;return _0x25d7e3;})[_0xcb20('0x23')](respondWithFilteredResult(_0x8b5a7b,_0x1983f4))['catch'](handleError(_0x8b5a7b,null));};exports['show']=function(_0x5368e3,_0x57d827){var _0x117f2f={'raw':![],'where':{'id':_0x5368e3[_0xcb20('0x42')]['id']}},_0x513fcf={};_0x513fcf[_0xcb20('0x2e')]=_[_0xcb20('0x30')](db[_0xcb20('0x29')][_0xcb20('0x2a')]);_0x513fcf['query']=_[_0xcb20('0x30')](_0x5368e3[_0xcb20('0x31')]);_0x513fcf[_0xcb20('0x32')]=_[_0xcb20('0x33')](_0x513fcf[_0xcb20('0x2e')],_0x513fcf['query']);_0x117f2f[_0xcb20('0x34')]=_[_0xcb20('0x33')](_0x513fcf[_0xcb20('0x2e')],qs[_0xcb20('0x35')](_0x5368e3[_0xcb20('0x31')][_0xcb20('0x35')]));_0x117f2f[_0xcb20('0x34')]=_0x117f2f[_0xcb20('0x34')][_0xcb20('0x36')]?_0x117f2f['attributes']:_0x513fcf['model'];if(_0x5368e3['query']['includeAll']){_0x117f2f['include']=[{'all':!![]}];}_0x117f2f=_[_0xcb20('0x3d')]({},_0x117f2f,_0x5368e3[_0xcb20('0x43')]);return db[_0xcb20('0x29')][_0xcb20('0x44')](_0x117f2f)[_0xcb20('0x23')](handleEntityNotFound(_0x57d827,null))[_0xcb20('0x23')](respondWithResult(_0x57d827,null))[_0xcb20('0x45')](handleError(_0x57d827,null));};exports[_0xcb20('0x46')]=function(_0x48bc35,_0x296456){return db[_0xcb20('0x29')][_0xcb20('0x46')](_0x48bc35[_0xcb20('0x47')],{})['then'](respondWithResult(_0x296456,0xc9))[_0xcb20('0x45')](handleError(_0x296456,null));};exports['update']=function(_0x481a4c,_0x3df0b2){if(_0x481a4c[_0xcb20('0x47')]['id']){delete _0x481a4c[_0xcb20('0x47')]['id'];}return db[_0xcb20('0x29')][_0xcb20('0x44')]({'where':{'id':_0x481a4c['params']['id']}})[_0xcb20('0x23')](handleEntityNotFound(_0x3df0b2,null))[_0xcb20('0x23')](saveUpdates(_0x481a4c['body'],null))['then'](respondWithResult(_0x3df0b2,null))[_0xcb20('0x45')](handleError(_0x3df0b2,null));};exports[_0xcb20('0x24')]=function(_0x3ef6be,_0x11d2a3){return db[_0xcb20('0x29')][_0xcb20('0x44')]({'where':{'id':_0x3ef6be[_0xcb20('0x42')]['id']}})['then'](handleEntityNotFound(_0x11d2a3,null))['then'](removeEntity(_0x11d2a3,null))[_0xcb20('0x45')](handleError(_0x11d2a3,null));};exports[_0xcb20('0x48')]=function(_0x2fe321,_0x260314){return db[_0xcb20('0x29')]['describe']()[_0xcb20('0x23')](respondWithResult(_0x260314,null))['catch'](handleError(_0x260314,null));};exports[_0xcb20('0x49')]=function(_0x4cd5d8,_0x41d3fb){var _0x13008b={},_0x58d017={},_0x9fbe18={'count':0x0,'rows':[]};_0x58d017[_0xcb20('0x2e')]=_['keys'](db[_0xcb20('0x29')]['rawAttributes']);_0x58d017[_0xcb20('0x31')]=_[_0xcb20('0x30')](_0x4cd5d8['query']);_0x58d017[_0xcb20('0x32')]=_[_0xcb20('0x33')](_0x58d017[_0xcb20('0x2e')],_0x58d017[_0xcb20('0x31')]);_0x13008b[_0xcb20('0x34')]=_[_0xcb20('0x33')](_0x58d017['model'],qs[_0xcb20('0x35')](_0x4cd5d8[_0xcb20('0x31')][_0xcb20('0x35')]));_0x13008b[_0xcb20('0x34')]=_0x13008b['attributes'][_0xcb20('0x36')]?_0x13008b[_0xcb20('0x34')]:_0x58d017['model'];if(!_0x4cd5d8['query'][_0xcb20('0x37')](_0xcb20('0x38'))){_0x13008b[_0xcb20('0x1f')]=qs['limit'](_0x4cd5d8['query'][_0xcb20('0x1f')]);_0x13008b['offset']=qs[_0xcb20('0x1e')](_0x4cd5d8[_0xcb20('0x31')][_0xcb20('0x1e')]);}_0x13008b['order']=qs[_0xcb20('0x3a')](_0x4cd5d8[_0xcb20('0x31')][_0xcb20('0x3a')]);_0x13008b[_0xcb20('0x3c')]=qs['filters'](_[_0xcb20('0x4a')](_0x4cd5d8['query'],_0x58d017[_0xcb20('0x32')]));if(_0x4cd5d8[_0xcb20('0x31')][_0xcb20('0x3b')]){_0x13008b['where']=_[_0xcb20('0x3d')](_0x13008b[_0xcb20('0x3c')],{'$or':_[_0xcb20('0x2f')](_0x13008b[_0xcb20('0x34')],function(_0x3da318){var _0x117331={};_0x117331[_0x3da318]={'$like':'%'+_0x4cd5d8[_0xcb20('0x31')]['filter']+'%'};return _0x117331;})});}_0x13008b=_[_0xcb20('0x3d')]({},_0x13008b,_0x4cd5d8[_0xcb20('0x43')]);var _0xed15b5={'where':_0x13008b['where']};return db['VoiceQueueReport'][_0xcb20('0x21')](_0xed15b5)[_0xcb20('0x23')](function(_0x3169dd){_0x9fbe18[_0xcb20('0x21')]=_0x3169dd;if(_0x4cd5d8[_0xcb20('0x31')][_0xcb20('0x3f')]){_0x13008b[_0xcb20('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xcb20('0x4b')](_0x13008b);})['then'](function(_0x1f3e6c){_0x9fbe18[_0xcb20('0x41')]=_0x1f3e6c;return _0x9fbe18;})[_0xcb20('0x23')](respondWithFilteredResult(_0x41d3fb,_0x13008b,_0xcb20('0x49')))[_0xcb20('0x45')](handleError(_0x41d3fb,null,_0xcb20('0x49')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 61987ce..de2386f 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 _0xbe70=['hook','exports','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbe70,0x1ca));var _0x0be7=function(_0x3b6184,_0xd673ea){_0x3b6184=_0x3b6184-0x0;var _0x4fb89c=_0xbe70[_0x3b6184];return _0x4fb89c;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x0be7('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0be7('0x1')](0x0);var events={'afterCreate':_0x0be7('0x2'),'afterUpdate':'update','afterDestroy':_0x0be7('0x3')};function emitEvent(_0x4e82cd){return function(_0x44028f,_0x47315d,_0x258a5a){VoiceQueueReportEvents[_0x0be7('0x4')](_0x4e82cd+':'+_0x44028f['id'],_0x44028f);VoiceQueueReportEvents[_0x0be7('0x4')](_0x4e82cd,_0x44028f);_0x258a5a(null);};}for(var e in events){if(events[_0x0be7('0x5')](e)){var event=events[e];VoiceQueueReport[_0x0be7('0x6')](e,emitEvent(event));}}module[_0x0be7('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf979=['exports','events','../../mysqldb','VoiceQueueReport','save','update','emit','hook'];(function(_0x5adecf,_0x123f8e){var _0x5cd350=function(_0x4e46c2){while(--_0x4e46c2){_0x5adecf['push'](_0x5adecf['shift']());}};_0x5cd350(++_0x123f8e);}(_0xf979,0x99));var _0x9f97=function(_0x39bd0d,_0x5778f8){_0x39bd0d=_0x39bd0d-0x0;var _0x110bd5=_0xf979[_0x39bd0d];return _0x110bd5;};'use strict';var EventEmitter=require(_0x9f97('0x0'));var VoiceQueueReport=require(_0x9f97('0x1'))['db'][_0x9f97('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f97('0x3'),'afterUpdate':_0x9f97('0x4'),'afterDestroy':'remove'};function emitEvent(_0x386571){return function(_0x452ca2,_0x385dec,_0x52e523){VoiceQueueReportEvents[_0x9f97('0x5')](_0x386571+':'+_0x452ca2['id'],_0x452ca2);VoiceQueueReportEvents[_0x9f97('0x5')](_0x386571,_0x452ca2);_0x52e523(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x9f97('0x6')](e,emitEvent(event));}}module[_0x9f97('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 4dd00ad..f5263e4 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 _0xeb24=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','report_queue','uniqueid','calleridnum','util'];(function(_0xb43aa,_0x17bde3){var _0x3f3213=function(_0xe5cee){while(--_0xe5cee){_0xb43aa['push'](_0xb43aa['shift']());}};_0x3f3213(++_0x17bde3);}(_0xeb24,0x8b));var _0x4eb2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xeb24[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require(_0x4eb2('0x0'));var logger=require(_0x4eb2('0x1'))(_0x4eb2('0x2'));var moment=require(_0x4eb2('0x3'));var BPromise=require(_0x4eb2('0x4'));var rp=require(_0x4eb2('0x5'));var fs=require('fs');var path=require(_0x4eb2('0x6'));var rimraf=require(_0x4eb2('0x7'));var config=require(_0x4eb2('0x8'));var attributes=require(_0x4eb2('0x9'));module['exports']=function(_0xacf529,_0x1a6164){return _0xacf529['define'](_0x4eb2('0xa'),attributes,{'tableName':_0x4eb2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4eb2('0xc')]},{'fields':[_0x4eb2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a92=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','calleridnum'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9a92,0x196));var _0x29a9=function(_0x182b12,_0x57cc66){_0x182b12=_0x182b12-0x0;var _0x383c7e=_0x9a92[_0x182b12];return _0x383c7e;};'use strict';var _=require(_0x29a9('0x0'));var util=require(_0x29a9('0x1'));var logger=require(_0x29a9('0x2'))(_0x29a9('0x3'));var moment=require(_0x29a9('0x4'));var BPromise=require(_0x29a9('0x5'));var rp=require(_0x29a9('0x6'));var fs=require('fs');var path=require(_0x29a9('0x7'));var rimraf=require(_0x29a9('0x8'));var config=require(_0x29a9('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x29a9('0xa')]=function(_0x246d80,_0x4b12a8){return _0x246d80[_0x29a9('0xb')](_0x29a9('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x29a9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 0aa0d8b..07019e0 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 _0x0331=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','limit','include','model','attributes','map','catch','body','stringify','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xe60b92,_0x1d4ec9){var _0xae621c=function(_0x448274){while(--_0x448274){_0xe60b92['push'](_0xe60b92['shift']());}};_0xae621c(++_0x1d4ec9);}(_0x0331,0xc6));var _0x1033=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x0331[_0x282a1f];return _0x296ea7;};'use strict';var _=require(_0x1033('0x0'));var util=require('util');var moment=require(_0x1033('0x1'));var BPromise=require('bluebird');var rs=require(_0x1033('0x2'));var fs=require('fs');var Redis=require(_0x1033('0x3'));var db=require(_0x1033('0x4'))['db'];var utils=require(_0x1033('0x5'));var logger=require(_0x1033('0x6'))(_0x1033('0x7'));var config=require(_0x1033('0x8'));var jayson=require(_0x1033('0x9'));var client=jayson[_0x1033('0xa')][_0x1033('0xb')]({'port':0x232a});config[_0x1033('0xc')]=_['defaults'](config[_0x1033('0xc')],{'host':_0x1033('0xd'),'port':0x18eb});var socket=require(_0x1033('0xe'))(new Redis(config[_0x1033('0xc')]));require(_0x1033('0xf'))[_0x1033('0x10')](socket);function respondWithRpcPromise(_0xc7b40b,_0x349ff2,_0x1cf340){return new BPromise(function(_0xfe2928,_0x207d66){return client['request'](_0xc7b40b,_0x1cf340)[_0x1033('0x11')](function(_0x4e26af){logger[_0x1033('0x12')](_0x1033('0x13'),_0x349ff2,_0x1033('0x14'));logger[_0x1033('0x15')](_0x1033('0x16'),_0x349ff2,_0x1033('0x14'),JSON['stringify'](_0x4e26af));if(_0x4e26af[_0x1033('0x17')]){if(_0x4e26af['error'][_0x1033('0x18')]===0x1f4){logger[_0x1033('0x17')](_0x1033('0x13'),_0x349ff2,_0x4e26af[_0x1033('0x17')][_0x1033('0x19')]);return _0x207d66(_0x4e26af[_0x1033('0x17')]['message']);}logger[_0x1033('0x17')](_0x1033('0x13'),_0x349ff2,_0x4e26af[_0x1033('0x17')]['message']);return _0xfe2928(_0x4e26af[_0x1033('0x17')][_0x1033('0x19')]);}else{logger[_0x1033('0x12')](_0x1033('0x13'),_0x349ff2,'request\x20sent');_0xfe2928(_0x4e26af['result']['message']);}})['catch'](function(_0x58e590){logger[_0x1033('0x17')](_0x1033('0x13'),_0x349ff2,_0x58e590);_0x207d66(_0x58e590);});});}exports[_0x1033('0x1a')]=function(_0x751306){var _0x5ef44a=this;return new Promise(function(_0x19683d,_0x238f24){return db[_0x1033('0x1b')]['findAll']({'raw':_0x751306[_0x1033('0x1c')]?_0x751306[_0x1033('0x1c')][_0x1033('0x1d')]===undefined?!![]:![]:!![],'where':_0x751306['options']?_0x751306[_0x1033('0x1c')][_0x1033('0x1e')]||null:null,'attributes':_0x751306[_0x1033('0x1c')]?_0x751306[_0x1033('0x1c')]['attributes']||null:null,'limit':_0x751306[_0x1033('0x1c')]?_0x751306[_0x1033('0x1c')][_0x1033('0x1f')]||null:null,'include':_0x751306[_0x1033('0x1c')]?_0x751306[_0x1033('0x1c')][_0x1033('0x20')]?_['map'](_0x751306[_0x1033('0x1c')][_0x1033('0x20')],function(_0x48ed2d){return{'model':db[_0x48ed2d[_0x1033('0x21')]],'as':_0x48ed2d['as'],'attributes':_0x48ed2d[_0x1033('0x22')],'include':_0x48ed2d[_0x1033('0x20')]?_[_0x1033('0x23')](_0x48ed2d[_0x1033('0x20')],function(_0x376508){return{'model':db[_0x376508[_0x1033('0x21')]],'as':_0x376508['as'],'attributes':_0x376508[_0x1033('0x22')],'include':_0x376508[_0x1033('0x20')]?_['map'](_0x376508[_0x1033('0x20')],function(_0x449500){return{'model':db[_0x449500[_0x1033('0x21')]],'as':_0x449500['as'],'attributes':_0x449500[_0x1033('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x272652){logger['info'](_0x1033('0x1a'),_0x751306);logger[_0x1033('0x15')](_0x1033('0x1a'),_0x751306,JSON['stringify'](_0x272652));_0x19683d(_0x272652);})[_0x1033('0x24')](function(_0x452251){logger[_0x1033('0x17')](_0x1033('0x1a'),_0x452251[_0x1033('0x19')],_0x751306);_0x238f24(_0x5ef44a[_0x1033('0x17')](0x1f4,_0x452251[_0x1033('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x19c4d6){var _0x4c96e2=this;return new Promise(function(_0x35cb4f,_0x2d9e80){return db[_0x1033('0x1b')]['create'](_0x19c4d6[_0x1033('0x25')],{'raw':_0x19c4d6['options']?_0x19c4d6[_0x1033('0x1c')][_0x1033('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x36b5ad){logger['info']('CreateVoiceQueueReport',_0x19c4d6);logger['debug']('CreateVoiceQueueReport',_0x19c4d6,JSON[_0x1033('0x26')](_0x36b5ad));_0x35cb4f(_0x36b5ad);})[_0x1033('0x24')](function(_0x2ee75f){logger[_0x1033('0x17')](_0x1033('0x27'),_0x2ee75f['message'],_0x19c4d6);_0x2d9e80(_0x4c96e2['error'](0x1f4,_0x2ee75f[_0x1033('0x19')]));});});};exports[_0x1033('0x28')]=function(_0x3f6db8){var _0x268a54=this;return new Promise(function(_0x492fd4,_0xff3871){return db['VoiceQueueReport'][_0x1033('0x29')](_0x3f6db8['body'],{'raw':_0x3f6db8[_0x1033('0x1c')]?_0x3f6db8[_0x1033('0x1c')][_0x1033('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6db8[_0x1033('0x1c')]?_0x3f6db8[_0x1033('0x1c')]['where']||null:null,'attributes':_0x3f6db8[_0x1033('0x1c')]?_0x3f6db8[_0x1033('0x1c')]['attributes']||null:null,'limit':_0x3f6db8[_0x1033('0x1c')]?_0x3f6db8[_0x1033('0x1c')][_0x1033('0x1f')]||null:null})[_0x1033('0x11')](function(_0x295b63){logger[_0x1033('0x12')](_0x1033('0x28'),_0x3f6db8);logger[_0x1033('0x15')](_0x1033('0x28'),_0x3f6db8,JSON[_0x1033('0x26')](_0x295b63));_0x492fd4(_0x295b63);})[_0x1033('0x24')](function(_0xafca32){logger[_0x1033('0x17')](_0x1033('0x28'),_0xafca32[_0x1033('0x19')],_0x3f6db8);_0xff3871(_0x268a54[_0x1033('0x17')](0x1f4,_0xafca32[_0x1033('0x19')]));});});}; \ No newline at end of file +var _0x7c62=['where','attributes','limit','include','model','GetVoiceQueueReport','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceQueueReport','options','raw'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x7c62,0x14a));var _0x27c6=function(_0x4ae1b1,_0x1d3fd7){_0x4ae1b1=_0x4ae1b1-0x0;var _0x19f211=_0x7c62[_0x4ae1b1];return _0x19f211;};'use strict';var _=require('lodash');var util=require(_0x27c6('0x0'));var moment=require(_0x27c6('0x1'));var BPromise=require(_0x27c6('0x2'));var rs=require(_0x27c6('0x3'));var fs=require('fs');var Redis=require(_0x27c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x27c6('0x5'));var logger=require('../../config/logger')(_0x27c6('0x6'));var config=require(_0x27c6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x27c6('0x8')][_0x27c6('0x9')]({'port':0x232a});config['redis']=_[_0x27c6('0xa')](config[_0x27c6('0xb')],{'host':_0x27c6('0xc'),'port':0x18eb});var socket=require(_0x27c6('0xd'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x27c6('0xe')](socket);function respondWithRpcPromise(_0x37bb1d,_0x599aaf,_0x11ba08){return new BPromise(function(_0x121993,_0x20a1b2){return client[_0x27c6('0xf')](_0x37bb1d,_0x11ba08)[_0x27c6('0x10')](function(_0x164d77){logger[_0x27c6('0x11')](_0x27c6('0x12'),_0x599aaf,_0x27c6('0x13'));logger[_0x27c6('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x599aaf,'request\x20sent',JSON[_0x27c6('0x15')](_0x164d77));if(_0x164d77[_0x27c6('0x16')]){if(_0x164d77[_0x27c6('0x16')][_0x27c6('0x17')]===0x1f4){logger['error'](_0x27c6('0x12'),_0x599aaf,_0x164d77[_0x27c6('0x16')]['message']);return _0x20a1b2(_0x164d77[_0x27c6('0x16')][_0x27c6('0x18')]);}logger[_0x27c6('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x599aaf,_0x164d77['error'][_0x27c6('0x18')]);return _0x121993(_0x164d77[_0x27c6('0x16')][_0x27c6('0x18')]);}else{logger[_0x27c6('0x11')](_0x27c6('0x12'),_0x599aaf,'request\x20sent');_0x121993(_0x164d77[_0x27c6('0x19')][_0x27c6('0x18')]);}})[_0x27c6('0x1a')](function(_0xbc225){logger[_0x27c6('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x599aaf,_0xbc225);_0x20a1b2(_0xbc225);});});}exports['GetVoiceQueueReport']=function(_0x3a97fb){var _0x2bc4c6=this;return new Promise(function(_0x284fe9,_0x4c457d){return db[_0x27c6('0x1b')]['findAll']({'raw':_0x3a97fb[_0x27c6('0x1c')]?_0x3a97fb[_0x27c6('0x1c')][_0x27c6('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a97fb[_0x27c6('0x1c')]?_0x3a97fb['options'][_0x27c6('0x1e')]||null:null,'attributes':_0x3a97fb[_0x27c6('0x1c')]?_0x3a97fb[_0x27c6('0x1c')][_0x27c6('0x1f')]||null:null,'limit':_0x3a97fb[_0x27c6('0x1c')]?_0x3a97fb[_0x27c6('0x1c')][_0x27c6('0x20')]||null:null,'include':_0x3a97fb[_0x27c6('0x1c')]?_0x3a97fb[_0x27c6('0x1c')][_0x27c6('0x21')]?_['map'](_0x3a97fb['options'][_0x27c6('0x21')],function(_0xccdeff){return{'model':db[_0xccdeff[_0x27c6('0x22')]],'as':_0xccdeff['as'],'attributes':_0xccdeff[_0x27c6('0x1f')],'include':_0xccdeff['include']?_['map'](_0xccdeff['include'],function(_0x7205a8){return{'model':db[_0x7205a8[_0x27c6('0x22')]],'as':_0x7205a8['as'],'attributes':_0x7205a8[_0x27c6('0x1f')],'include':_0x7205a8['include']?_['map'](_0x7205a8[_0x27c6('0x21')],function(_0x3b5a84){return{'model':db[_0x3b5a84['model']],'as':_0x3b5a84['as'],'attributes':_0x3b5a84[_0x27c6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e29dc){logger['info'](_0x27c6('0x23'),_0x3a97fb);logger['debug']('GetVoiceQueueReport',_0x3a97fb,JSON['stringify'](_0x4e29dc));_0x284fe9(_0x4e29dc);})[_0x27c6('0x1a')](function(_0x1881b3){logger[_0x27c6('0x16')](_0x27c6('0x23'),_0x1881b3[_0x27c6('0x18')],_0x3a97fb);_0x4c457d(_0x2bc4c6[_0x27c6('0x16')](0x1f4,_0x1881b3[_0x27c6('0x18')]));});});};exports[_0x27c6('0x24')]=function(_0x221993){var _0x275e37=this;return new Promise(function(_0x39cb6d,_0x3b653c){return db[_0x27c6('0x1b')]['create'](_0x221993[_0x27c6('0x25')],{'raw':_0x221993[_0x27c6('0x1c')]?_0x221993[_0x27c6('0x1c')][_0x27c6('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5add1c){logger[_0x27c6('0x11')](_0x27c6('0x24'),_0x221993);logger['debug']('CreateVoiceQueueReport',_0x221993,JSON[_0x27c6('0x15')](_0x5add1c));_0x39cb6d(_0x5add1c);})['catch'](function(_0x6a07b8){logger['error'](_0x27c6('0x24'),_0x6a07b8['message'],_0x221993);_0x3b653c(_0x275e37[_0x27c6('0x16')](0x1f4,_0x6a07b8[_0x27c6('0x18')]));});});};exports[_0x27c6('0x26')]=function(_0xd4c1d){var _0x54f827=this;return new Promise(function(_0x27b654,_0x5f59d5){return db[_0x27c6('0x1b')][_0x27c6('0x27')](_0xd4c1d[_0x27c6('0x25')],{'raw':_0xd4c1d['options']?_0xd4c1d['options'][_0x27c6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd4c1d[_0x27c6('0x1c')]?_0xd4c1d[_0x27c6('0x1c')][_0x27c6('0x1e')]||null:null,'attributes':_0xd4c1d[_0x27c6('0x1c')]?_0xd4c1d[_0x27c6('0x1c')][_0x27c6('0x1f')]||null:null,'limit':_0xd4c1d[_0x27c6('0x1c')]?_0xd4c1d['options']['limit']||null:null})[_0x27c6('0x10')](function(_0x47fd11){logger['info'](_0x27c6('0x26'),_0xd4c1d);logger[_0x27c6('0x14')](_0x27c6('0x26'),_0xd4c1d,JSON[_0x27c6('0x15')](_0x47fd11));_0x27b654(_0x47fd11);})['catch'](function(_0x19aad1){logger['error'](_0x27c6('0x26'),_0x19aad1['message'],_0xd4c1d);_0x5f59d5(_0x54f827[_0x27c6('0x16')](0x1f4,_0x19aad1[_0x27c6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index a9f8b76..bf8eada 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 _0x046e=['register','./voiceQueueReport.events','remove'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x046e,0x1b4));var _0xe046=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x046e[_0x2cf2e9];return _0xd3670d;};'use strict';var VoiceQueueReportEvents=require(_0xe046('0x0'));var events=['save',_0xe046('0x1'),'update'];function createListener(_0x247106,_0x15c7db){return function(_0x22645c){_0x15c7db['emit'](_0x247106,_0x22645c);};}function removeListener(_0x3ab165,_0x497e56){return function(){VoiceQueueReportEvents['removeListener'](_0x3ab165,_0x497e56);};}exports[_0xe046('0x2')]=function(_0x59fa28){for(var _0x57db0c=0x0,_0x2afa1d=events['length'];_0x57db0c<_0x2afa1d;_0x57db0c++){var _0x2fa485=events[_0x57db0c];var _0x88ec06=createListener('voiceQueueReport:'+_0x2fa485,_0x59fa28);VoiceQueueReportEvents['on'](_0x2fa485,_0x88ec06);}}; \ No newline at end of file +var _0xb66c=['voiceQueueReport:','./voiceQueueReport.events','remove','removeListener','register','length'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb66c,0x175));var _0xcb66=function(_0x894fef,_0xde452b){_0x894fef=_0x894fef-0x0;var _0x5e931f=_0xb66c[_0x894fef];return _0x5e931f;};'use strict';var VoiceQueueReportEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){VoiceQueueReportEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);VoiceQueueReportEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 6e706f5..20c737f 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 _0x2029=['isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x55bb91,_0x1be3f0){var _0x380d02=function(_0x5c1b7b){while(--_0x5c1b7b){_0x55bb91['push'](_0x55bb91['shift']());}};_0x380d02(++_0x1be3f0);}(_0x2029,0x171));var _0x9202=function(_0x5b0b15,_0x5002e5){_0x5b0b15=_0x5b0b15-0x0;var _0x3507eb=_0x2029[_0x5b0b15];return _0x3507eb;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var fs_extra=require(_0x9202('0x5'));var auth=require(_0x9202('0x6'));var interaction=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var controller=require(_0x9202('0x9'));router[_0x9202('0xa')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0xc')]);router[_0x9202('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9202('0xd')]);router['post']('/',auth[_0x9202('0xb')](),controller[_0x9202('0xe')]);router['put'](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x10')]);router[_0x9202('0x11')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x12')]);module[_0x9202('0x13')]=router; \ No newline at end of file +var _0xc7ad=['update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xc7ad,0xca));var _0xdc7a=function(_0x5d234c,_0x4b66e2){_0x5d234c=_0x5d234c-0x0;var _0x1460ac=_0xc7ad[_0x5d234c];return _0x1460ac;};'use strict';var multer=require(_0xdc7a('0x0'));var util=require(_0xdc7a('0x1'));var path=require(_0xdc7a('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc7a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc7a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdc7a('0x5'));var controller=require(_0xdc7a('0x6'));router[_0xdc7a('0x7')]('/',auth[_0xdc7a('0x8')](),controller[_0xdc7a('0x9')]);router[_0xdc7a('0x7')](_0xdc7a('0xa'),auth[_0xdc7a('0x8')](),controller[_0xdc7a('0xb')]);router[_0xdc7a('0xc')]('/',auth[_0xdc7a('0x8')](),controller[_0xdc7a('0xd')]);router['put'](_0xdc7a('0xa'),auth[_0xdc7a('0x8')](),controller[_0xdc7a('0xe')]);router[_0xdc7a('0xf')](_0xdc7a('0xa'),auth[_0xdc7a('0x8')](),controller[_0xdc7a('0x10')]);module[_0xdc7a('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index fafdf3c..c40e164 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 _0x5ce5=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x4b89f2,_0x36f3cb){var _0x343053=function(_0x3c9adf){while(--_0x3c9adf){_0x4b89f2['push'](_0x4b89f2['shift']());}};_0x343053(++_0x36f3cb);}(_0x5ce5,0xa0));var _0x55ce=function(_0x47d89d,_0x427636){_0x47d89d=_0x47d89d-0x0;var _0xefb03a=_0x5ce5[_0x47d89d];return _0xefb03a;};'use strict';var Sequelize=require(_0x55ce('0x0'));var moment=require(_0x55ce('0x1'));module[_0x55ce('0x2')]={'time':{'type':Sequelize[_0x55ce('0x3')]},'callid':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x55ce('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x55ce('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x55ce('0x5'))}}; \ No newline at end of file +var _0xde73=['format','sequelize','moment','exports','STRING'];(function(_0x2b5dbe,_0x3a53a2){var _0x1fe0a9=function(_0x691674){while(--_0x691674){_0x2b5dbe['push'](_0x2b5dbe['shift']());}};_0x1fe0a9(++_0x3a53a2);}(_0xde73,0x137));var _0x3de7=function(_0x193a48,_0x39abca){_0x193a48=_0x193a48-0x0;var _0x33a662=_0xde73[_0x193a48];return _0x33a662;};'use strict';var Sequelize=require(_0x3de7('0x0'));var moment=require(_0x3de7('0x1'));module[_0x3de7('0x2')]={'time':{'type':Sequelize[_0x3de7('0x3')]},'callid':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3de7('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x3de7('0x4')]('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 82a3893..351c9d4 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 _0xc546=['end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0xa4f047,_0x30cffe){var _0x280a03=function(_0x1c4c36){while(--_0x1c4c36){_0xa4f047['push'](_0xa4f047['shift']());}};_0x280a03(++_0x30cffe);}(_0xc546,0x76));var _0x6c54=function(_0x1e6c4e,_0x302fac){_0x1e6c4e=_0x1e6c4e-0x0;var _0xea175b=_0xc546[_0x1e6c4e];return _0xea175b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c54('0x0'));var zipdir=require(_0x6c54('0x1'));var jsonpatch=require(_0x6c54('0x2'));var rp=require(_0x6c54('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6c54('0x4'));var util=require(_0x6c54('0x5'));var path=require(_0x6c54('0x6'));var sox=require(_0x6c54('0x7'));var csv=require(_0x6c54('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c54('0x9'));var _=require(_0x6c54('0xa'));var squel=require(_0x6c54('0xb'));var crypto=require(_0x6c54('0xc'));var jsforce=require(_0x6c54('0xd'));var deskjs=require(_0x6c54('0xe'));var toCsv=require(_0x6c54('0x8'));var querystring=require('querystring');var Papa=require(_0x6c54('0xf'));var Redis=require(_0x6c54('0x10'));var authService=require(_0x6c54('0x11'));var qs=require(_0x6c54('0x12'));var as=require(_0x6c54('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c54('0x14'))(_0x6c54('0x15'));var utils=require('../../config/utils');var config=require(_0x6c54('0x16'));var licenseUtil=require(_0x6c54('0x17'));var db=require(_0x6c54('0x18'))['db'];function respondWithStatusCode(_0x125a8a,_0x3826b5){_0x3826b5=_0x3826b5||0xcc;return function(_0x7e61e7){if(_0x7e61e7){return _0x125a8a['sendStatus'](_0x3826b5);}return _0x125a8a[_0x6c54('0x19')](_0x3826b5)[_0x6c54('0x1a')]();};}function respondWithResult(_0x2fe6cf,_0x4785ef){_0x4785ef=_0x4785ef||0xc8;return function(_0x7e6aa2){if(_0x7e6aa2){return _0x2fe6cf[_0x6c54('0x19')](_0x4785ef)[_0x6c54('0x1b')](_0x7e6aa2);}};}function respondWithFilteredResult(_0x17d2a4,_0x177612){return function(_0x430e58){if(_0x430e58){var _0x3903fc=typeof _0x177612[_0x6c54('0x1c')]==='undefined'&&typeof _0x177612[_0x6c54('0x1d')]===_0x6c54('0x1e');var _0x1f9a0f=_0x430e58[_0x6c54('0x1f')];var _0x52cfc3=_0x3903fc?0x0:_0x177612[_0x6c54('0x1c')];var _0x253314=_0x3903fc?_0x430e58[_0x6c54('0x1f')]:_0x177612[_0x6c54('0x1c')]+_0x177612[_0x6c54('0x1d')];var _0x161df6;if(_0x253314>=_0x1f9a0f){_0x253314=_0x1f9a0f;_0x161df6=0xc8;}else{_0x161df6=0xce;}_0x17d2a4[_0x6c54('0x19')](_0x161df6);return _0x17d2a4['set'](_0x6c54('0x20'),_0x52cfc3+'-'+_0x253314+'/'+_0x1f9a0f)[_0x6c54('0x1b')](_0x430e58);}return null;};}function patchUpdates(_0x20fd9f){return function(_0x566d50){try{jsonpatch[_0x6c54('0x21')](_0x566d50,_0x20fd9f,!![]);}catch(_0x1fec6d){return BPromise[_0x6c54('0x22')](_0x1fec6d);}return _0x566d50['save']();};}function saveUpdates(_0x1ed7b1,_0x2cd6e1){return function(_0x185d52){if(_0x185d52){return _0x185d52[_0x6c54('0x23')](_0x1ed7b1)[_0x6c54('0x24')](function(_0x5d7b28){return _0x5d7b28;});}return null;};}function removeEntity(_0x606750,_0x104cf9){return function(_0x52152d){if(_0x52152d){return _0x52152d[_0x6c54('0x25')]()[_0x6c54('0x24')](function(){_0x606750['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ba5d,_0x49fae1){return function(_0x380bbb){if(!_0x380bbb){_0x16ba5d['sendStatus'](0x194);}return _0x380bbb;};}function handleError(_0x4578d1,_0x571343){_0x571343=_0x571343||0x1f4;return function(_0x122c3c){logger[_0x6c54('0x26')](_0x122c3c['stack']);if(_0x122c3c[_0x6c54('0x27')]){delete _0x122c3c[_0x6c54('0x27')];}_0x4578d1[_0x6c54('0x19')](_0x571343)[_0x6c54('0x28')](_0x122c3c);};}exports[_0x6c54('0x29')]=function(_0x15634b,_0x59ca68){var _0x7392a9={},_0x606a91={},_0x7c2e40={'count':0x0,'rows':[]};var _0x4a6b61=_[_0x6c54('0x2a')](db[_0x6c54('0x2b')][_0x6c54('0x2c')],function(_0x4d09e8){return{'name':_0x4d09e8['fieldName'],'type':_0x4d09e8['type'][_0x6c54('0x2d')]};});_0x606a91[_0x6c54('0x2e')]=_['map'](_0x4a6b61,_0x6c54('0x27'));_0x606a91[_0x6c54('0x2f')]=_[_0x6c54('0x30')](_0x15634b[_0x6c54('0x2f')]);_0x606a91[_0x6c54('0x31')]=_[_0x6c54('0x32')](_0x606a91['model'],_0x606a91[_0x6c54('0x2f')]);_0x7392a9[_0x6c54('0x33')]=_[_0x6c54('0x32')](_0x606a91[_0x6c54('0x2e')],qs[_0x6c54('0x34')](_0x15634b['query'][_0x6c54('0x34')]));_0x7392a9[_0x6c54('0x33')]=_0x7392a9[_0x6c54('0x33')][_0x6c54('0x35')]?_0x7392a9[_0x6c54('0x33')]:_0x606a91['model'];if(!_0x15634b[_0x6c54('0x2f')][_0x6c54('0x36')]('nolimit')){_0x7392a9['limit']=qs[_0x6c54('0x1d')](_0x15634b[_0x6c54('0x2f')][_0x6c54('0x1d')]);_0x7392a9[_0x6c54('0x1c')]=qs[_0x6c54('0x1c')](_0x15634b[_0x6c54('0x2f')]['offset']);}_0x7392a9[_0x6c54('0x37')]=qs[_0x6c54('0x38')](_0x15634b[_0x6c54('0x2f')]['sort']);_0x7392a9[_0x6c54('0x39')]=qs[_0x6c54('0x31')](_[_0x6c54('0x3a')](_0x15634b[_0x6c54('0x2f')],_0x606a91['filters']),_0x4a6b61);if(_0x15634b[_0x6c54('0x2f')][_0x6c54('0x3b')]){_0x7392a9[_0x6c54('0x39')]=_[_0x6c54('0x3c')](_0x7392a9['where'],{'$or':_['map'](_0x4a6b61,function(_0x35c469){if(_0x35c469['type']!==_0x6c54('0x3d')){var _0x3676d5={};_0x3676d5[_0x35c469[_0x6c54('0x27')]]={'$like':'%'+_0x15634b[_0x6c54('0x2f')][_0x6c54('0x3b')]+'%'};return _0x3676d5;}})});}_0x7392a9=_[_0x6c54('0x3c')]({},_0x7392a9,_0x15634b[_0x6c54('0x3e')]);var _0xc97db5={'where':_0x7392a9[_0x6c54('0x39')]};return db[_0x6c54('0x2b')]['count'](_0xc97db5)[_0x6c54('0x24')](function(_0x6bb840){_0x7c2e40[_0x6c54('0x1f')]=_0x6bb840;if(_0x15634b['query'][_0x6c54('0x3f')]){_0x7392a9['include']=[{'all':!![]}];}return db[_0x6c54('0x2b')][_0x6c54('0x40')](_0x7392a9);})[_0x6c54('0x24')](function(_0x1ce0a1){_0x7c2e40[_0x6c54('0x41')]=_0x1ce0a1;return _0x7c2e40;})[_0x6c54('0x24')](respondWithFilteredResult(_0x59ca68,_0x7392a9))['catch'](handleError(_0x59ca68,null));};exports['show']=function(_0x561038,_0x22a1ff){var _0x3a3835={'raw':!![],'where':{'id':_0x561038[_0x6c54('0x42')]['id']}},_0x457095={};_0x457095[_0x6c54('0x2e')]=_['keys'](db[_0x6c54('0x2b')][_0x6c54('0x2c')]);_0x457095[_0x6c54('0x2f')]=_[_0x6c54('0x30')](_0x561038[_0x6c54('0x2f')]);_0x457095[_0x6c54('0x31')]=_['intersection'](_0x457095[_0x6c54('0x2e')],_0x457095['query']);_0x3a3835[_0x6c54('0x33')]=_[_0x6c54('0x32')](_0x457095[_0x6c54('0x2e')],qs[_0x6c54('0x34')](_0x561038[_0x6c54('0x2f')]['fields']));_0x3a3835[_0x6c54('0x33')]=_0x3a3835[_0x6c54('0x33')]['length']?_0x3a3835[_0x6c54('0x33')]:_0x457095[_0x6c54('0x2e')];if(_0x561038[_0x6c54('0x2f')][_0x6c54('0x3f')]){_0x3a3835[_0x6c54('0x43')]=[{'all':!![]}];}_0x3a3835=_[_0x6c54('0x3c')]({},_0x3a3835,_0x561038[_0x6c54('0x3e')]);return db['VoiceQueuesLog'][_0x6c54('0x44')](_0x3a3835)['then'](handleEntityNotFound(_0x22a1ff,null))[_0x6c54('0x24')](respondWithResult(_0x22a1ff,null))['catch'](handleError(_0x22a1ff,null));};exports[_0x6c54('0x45')]=function(_0x26e7d5,_0x2be8b1){return db[_0x6c54('0x2b')][_0x6c54('0x45')](_0x26e7d5[_0x6c54('0x46')],{})[_0x6c54('0x24')](respondWithResult(_0x2be8b1,0xc9))[_0x6c54('0x47')](handleError(_0x2be8b1,null));};exports[_0x6c54('0x23')]=function(_0x1bd47f,_0x1659e4){if(_0x1bd47f['body']['id']){delete _0x1bd47f[_0x6c54('0x46')]['id'];}return db[_0x6c54('0x2b')][_0x6c54('0x44')]({'where':{'id':_0x1bd47f[_0x6c54('0x42')]['id']}})['then'](handleEntityNotFound(_0x1659e4,null))[_0x6c54('0x24')](saveUpdates(_0x1bd47f[_0x6c54('0x46')],null))[_0x6c54('0x24')](respondWithResult(_0x1659e4,null))['catch'](handleError(_0x1659e4,null));};exports['destroy']=function(_0x29350b,_0x47f543){return db[_0x6c54('0x2b')][_0x6c54('0x44')]({'where':{'id':_0x29350b[_0x6c54('0x42')]['id']}})[_0x6c54('0x24')](handleEntityNotFound(_0x47f543,null))['then'](removeEntity(_0x47f543,null))[_0x6c54('0x47')](handleError(_0x47f543,null));}; \ No newline at end of file +var _0x5310=['filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','VoiceQueuesLog','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','eml-format','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','error','name','send','map','rawAttributes','type','key','model','query'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5310,0x1c2));var _0x0531=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x5310[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0x0531('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0531('0x1'));var BPromise=require(_0x0531('0x2'));var Mustache=require(_0x0531('0x3'));var util=require('util');var path=require(_0x0531('0x4'));var sox=require(_0x0531('0x5'));var csv=require('to-csv');var ejs=require(_0x0531('0x6'));var fs=require('fs');var fs_extra=require(_0x0531('0x7'));var _=require(_0x0531('0x8'));var squel=require(_0x0531('0x9'));var crypto=require('crypto');var jsforce=require(_0x0531('0xa'));var deskjs=require(_0x0531('0xb'));var toCsv=require(_0x0531('0xc'));var querystring=require(_0x0531('0xd'));var Papa=require(_0x0531('0xe'));var Redis=require('ioredis');var authService=require(_0x0531('0xf'));var qs=require(_0x0531('0x10'));var as=require(_0x0531('0x11'));var hardwareService=require(_0x0531('0x12'));var logger=require(_0x0531('0x13'))(_0x0531('0x14'));var utils=require(_0x0531('0x15'));var config=require(_0x0531('0x16'));var licenseUtil=require(_0x0531('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3da71a,_0x10ebec){_0x10ebec=_0x10ebec||0xcc;return function(_0x3f4cd5){if(_0x3f4cd5){return _0x3da71a[_0x0531('0x18')](_0x10ebec);}return _0x3da71a[_0x0531('0x19')](_0x10ebec)[_0x0531('0x1a')]();};}function respondWithResult(_0x4a3ad2,_0x384944){_0x384944=_0x384944||0xc8;return function(_0x3a4760){if(_0x3a4760){return _0x4a3ad2[_0x0531('0x19')](_0x384944)['json'](_0x3a4760);}};}function respondWithFilteredResult(_0x4ff589,_0x1cc0b3){return function(_0x3f217b){if(_0x3f217b){var _0x329431=typeof _0x1cc0b3['offset']===_0x0531('0x1b')&&typeof _0x1cc0b3[_0x0531('0x1c')]===_0x0531('0x1b');var _0x5d5c21=_0x3f217b[_0x0531('0x1d')];var _0x4f3a2d=_0x329431?0x0:_0x1cc0b3[_0x0531('0x1e')];var _0x6faa5c=_0x329431?_0x3f217b[_0x0531('0x1d')]:_0x1cc0b3[_0x0531('0x1e')]+_0x1cc0b3['limit'];var _0x45c780;if(_0x6faa5c>=_0x5d5c21){_0x6faa5c=_0x5d5c21;_0x45c780=0xc8;}else{_0x45c780=0xce;}_0x4ff589[_0x0531('0x19')](_0x45c780);return _0x4ff589[_0x0531('0x1f')](_0x0531('0x20'),_0x4f3a2d+'-'+_0x6faa5c+'/'+_0x5d5c21)[_0x0531('0x21')](_0x3f217b);}return null;};}function patchUpdates(_0x3b2982){return function(_0x495f46){try{jsonpatch[_0x0531('0x22')](_0x495f46,_0x3b2982,!![]);}catch(_0x309298){return BPromise['reject'](_0x309298);}return _0x495f46[_0x0531('0x23')]();};}function saveUpdates(_0x5638e0,_0x39bd60){return function(_0x204bd8){if(_0x204bd8){return _0x204bd8['update'](_0x5638e0)[_0x0531('0x24')](function(_0x4913f2){return _0x4913f2;});}return null;};}function removeEntity(_0x53e825,_0x38eca4){return function(_0x36ae89){if(_0x36ae89){return _0x36ae89[_0x0531('0x25')]()[_0x0531('0x24')](function(){_0x53e825[_0x0531('0x19')](0xcc)[_0x0531('0x1a')]();});}};}function handleEntityNotFound(_0x142344,_0xdae3ef){return function(_0x4c8253){if(!_0x4c8253){_0x142344[_0x0531('0x18')](0x194);}return _0x4c8253;};}function handleError(_0x10d4aa,_0x2f2acc){_0x2f2acc=_0x2f2acc||0x1f4;return function(_0x299b6f){logger[_0x0531('0x26')](_0x299b6f['stack']);if(_0x299b6f[_0x0531('0x27')]){delete _0x299b6f[_0x0531('0x27')];}_0x10d4aa[_0x0531('0x19')](_0x2f2acc)[_0x0531('0x28')](_0x299b6f);};}exports['index']=function(_0x1f3e07,_0x200706){var _0x23b56b={},_0x32c6c6={},_0x456790={'count':0x0,'rows':[]};var _0x13f7e3=_[_0x0531('0x29')](db['VoiceQueuesLog'][_0x0531('0x2a')],function(_0xb8a16b){return{'name':_0xb8a16b['fieldName'],'type':_0xb8a16b[_0x0531('0x2b')][_0x0531('0x2c')]};});_0x32c6c6[_0x0531('0x2d')]=_[_0x0531('0x29')](_0x13f7e3,_0x0531('0x27'));_0x32c6c6[_0x0531('0x2e')]=_['keys'](_0x1f3e07['query']);_0x32c6c6[_0x0531('0x2f')]=_[_0x0531('0x30')](_0x32c6c6[_0x0531('0x2d')],_0x32c6c6[_0x0531('0x2e')]);_0x23b56b[_0x0531('0x31')]=_[_0x0531('0x30')](_0x32c6c6[_0x0531('0x2d')],qs['fields'](_0x1f3e07['query']['fields']));_0x23b56b[_0x0531('0x31')]=_0x23b56b[_0x0531('0x31')][_0x0531('0x32')]?_0x23b56b[_0x0531('0x31')]:_0x32c6c6['model'];if(!_0x1f3e07['query'][_0x0531('0x33')]('nolimit')){_0x23b56b[_0x0531('0x1c')]=qs['limit'](_0x1f3e07['query'][_0x0531('0x1c')]);_0x23b56b['offset']=qs['offset'](_0x1f3e07['query'][_0x0531('0x1e')]);}_0x23b56b[_0x0531('0x34')]=qs[_0x0531('0x35')](_0x1f3e07[_0x0531('0x2e')][_0x0531('0x35')]);_0x23b56b[_0x0531('0x36')]=qs[_0x0531('0x2f')](_[_0x0531('0x37')](_0x1f3e07[_0x0531('0x2e')],_0x32c6c6[_0x0531('0x2f')]),_0x13f7e3);if(_0x1f3e07[_0x0531('0x2e')][_0x0531('0x38')]){_0x23b56b['where']=_[_0x0531('0x39')](_0x23b56b[_0x0531('0x36')],{'$or':_[_0x0531('0x29')](_0x13f7e3,function(_0x416f8f){if(_0x416f8f[_0x0531('0x2b')]!=='VIRTUAL'){var _0x1860a8={};_0x1860a8[_0x416f8f['name']]={'$like':'%'+_0x1f3e07[_0x0531('0x2e')][_0x0531('0x38')]+'%'};return _0x1860a8;}})});}_0x23b56b=_[_0x0531('0x39')]({},_0x23b56b,_0x1f3e07[_0x0531('0x3a')]);var _0x25a88e={'where':_0x23b56b[_0x0531('0x36')]};return db[_0x0531('0x3b')][_0x0531('0x1d')](_0x25a88e)[_0x0531('0x24')](function(_0x76b497){_0x456790[_0x0531('0x1d')]=_0x76b497;if(_0x1f3e07[_0x0531('0x2e')][_0x0531('0x3c')]){_0x23b56b[_0x0531('0x3d')]=[{'all':!![]}];}return db[_0x0531('0x3b')][_0x0531('0x3e')](_0x23b56b);})[_0x0531('0x24')](function(_0x1b3f6c){_0x456790['rows']=_0x1b3f6c;return _0x456790;})['then'](respondWithFilteredResult(_0x200706,_0x23b56b))[_0x0531('0x3f')](handleError(_0x200706,null));};exports[_0x0531('0x40')]=function(_0x291294,_0x5c3cb5){var _0x461a9c={'raw':!![],'where':{'id':_0x291294[_0x0531('0x41')]['id']}},_0x4fdf0f={};_0x4fdf0f[_0x0531('0x2d')]=_['keys'](db[_0x0531('0x3b')][_0x0531('0x2a')]);_0x4fdf0f['query']=_[_0x0531('0x42')](_0x291294[_0x0531('0x2e')]);_0x4fdf0f[_0x0531('0x2f')]=_[_0x0531('0x30')](_0x4fdf0f[_0x0531('0x2d')],_0x4fdf0f[_0x0531('0x2e')]);_0x461a9c[_0x0531('0x31')]=_[_0x0531('0x30')](_0x4fdf0f[_0x0531('0x2d')],qs['fields'](_0x291294[_0x0531('0x2e')][_0x0531('0x43')]));_0x461a9c[_0x0531('0x31')]=_0x461a9c[_0x0531('0x31')]['length']?_0x461a9c['attributes']:_0x4fdf0f[_0x0531('0x2d')];if(_0x291294[_0x0531('0x2e')][_0x0531('0x3c')]){_0x461a9c[_0x0531('0x3d')]=[{'all':!![]}];}_0x461a9c=_[_0x0531('0x39')]({},_0x461a9c,_0x291294[_0x0531('0x3a')]);return db['VoiceQueuesLog'][_0x0531('0x44')](_0x461a9c)[_0x0531('0x24')](handleEntityNotFound(_0x5c3cb5,null))[_0x0531('0x24')](respondWithResult(_0x5c3cb5,null))[_0x0531('0x3f')](handleError(_0x5c3cb5,null));};exports[_0x0531('0x45')]=function(_0x3d6d60,_0x1a8b7d){return db[_0x0531('0x3b')]['create'](_0x3d6d60[_0x0531('0x46')],{})['then'](respondWithResult(_0x1a8b7d,0xc9))[_0x0531('0x3f')](handleError(_0x1a8b7d,null));};exports['update']=function(_0x2eeebf,_0x21134c){if(_0x2eeebf['body']['id']){delete _0x2eeebf[_0x0531('0x46')]['id'];}return db['VoiceQueuesLog'][_0x0531('0x44')]({'where':{'id':_0x2eeebf[_0x0531('0x41')]['id']}})[_0x0531('0x24')](handleEntityNotFound(_0x21134c,null))[_0x0531('0x24')](saveUpdates(_0x2eeebf[_0x0531('0x46')],null))[_0x0531('0x24')](respondWithResult(_0x21134c,null))[_0x0531('0x3f')](handleError(_0x21134c,null));};exports['destroy']=function(_0x5849a6,_0xa114c9){return db['VoiceQueuesLog']['find']({'where':{'id':_0x5849a6[_0x0531('0x41')]['id']}})[_0x0531('0x24')](handleEntityNotFound(_0xa114c9,null))['then'](removeEntity(_0xa114c9,null))[_0x0531('0x3f')](handleError(_0xa114c9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a4dcdd7..c7a736a 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 _0x3cb7=['VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x4cf649,_0x86da78){var _0x140998=function(_0x4479a8){while(--_0x4479a8){_0x4cf649['push'](_0x4cf649['shift']());}};_0x140998(++_0x86da78);}(_0x3cb7,0x1a8));var _0x73cb=function(_0xcf807,_0x4c736b){_0xcf807=_0xcf807-0x0;var _0x2ef9e9=_0x3cb7[_0xcf807];return _0x2ef9e9;};'use strict';var _=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var logger=require('../../config/logger')(_0x73cb('0x2'));var moment=require(_0x73cb('0x3'));var BPromise=require(_0x73cb('0x4'));var rp=require(_0x73cb('0x5'));var fs=require('fs');var path=require(_0x73cb('0x6'));var rimraf=require('rimraf');var config=require(_0x73cb('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x73cb('0x8')]=function(_0x12b454,_0x24de35){return _0x12b454[_0x73cb('0x9')](_0x73cb('0xa'),attributes,{'tableName':_0x73cb('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x73cb('0xc'),_0x73cb('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x963a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x963a,0xbe));var _0xa963=function(_0x5a2c56,_0x37f1ad){_0x5a2c56=_0x5a2c56-0x0;var _0x5b9f8c=_0x963a[_0x5a2c56];return _0x5b9f8c;};'use strict';var _=require(_0xa963('0x0'));var util=require(_0xa963('0x1'));var logger=require(_0xa963('0x2'))(_0xa963('0x3'));var moment=require(_0xa963('0x4'));var BPromise=require(_0xa963('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa963('0x6'));var rimraf=require(_0xa963('0x7'));var config=require(_0xa963('0x8'));var attributes=require(_0xa963('0x9'));module['exports']=function(_0x34110d,_0x4c9765){return _0x34110d[_0xa963('0xa')](_0xa963('0xb'),attributes,{'tableName':_0xa963('0xc'),'paranoid':![],'indexes':[{'name':_0xa963('0xd'),'fields':[_0xa963('0xe'),_0xa963('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c16cd81..620e098 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 _0xad75=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x478877,_0x3d4bc7){var _0x3b7150=function(_0x7704f0){while(--_0x7704f0){_0x478877['push'](_0x478877['shift']());}};_0x3b7150(++_0x3d4bc7);}(_0xad75,0xdb));var _0x5ad7=function(_0x2d1b2e,_0x2577bb){_0x2d1b2e=_0x2d1b2e-0x0;var _0x5560ae=_0xad75[_0x2d1b2e];return _0x5560ae;};'use strict';var _=require(_0x5ad7('0x0'));var util=require(_0x5ad7('0x1'));var moment=require(_0x5ad7('0x2'));var BPromise=require(_0x5ad7('0x3'));var rs=require(_0x5ad7('0x4'));var fs=require('fs');var Redis=require(_0x5ad7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ad7('0x6'));var logger=require(_0x5ad7('0x7'))(_0x5ad7('0x8'));var config=require('../../config/environment');var jayson=require(_0x5ad7('0x9'));var client=jayson[_0x5ad7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59e095,_0x5cb253,_0x54f3f8){return new BPromise(function(_0x2eebb6,_0x3e561c){return client[_0x5ad7('0xb')](_0x59e095,_0x54f3f8)[_0x5ad7('0xc')](function(_0x1dd651){logger[_0x5ad7('0xd')](_0x5ad7('0xe'),_0x5cb253,'request\x20sent');logger['debug'](_0x5ad7('0xf'),_0x5cb253,_0x5ad7('0x10'),JSON[_0x5ad7('0x11')](_0x1dd651));if(_0x1dd651[_0x5ad7('0x12')]){if(_0x1dd651[_0x5ad7('0x12')]['code']===0x1f4){logger[_0x5ad7('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5cb253,_0x1dd651[_0x5ad7('0x12')][_0x5ad7('0x13')]);return _0x3e561c(_0x1dd651[_0x5ad7('0x12')][_0x5ad7('0x13')]);}logger[_0x5ad7('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5cb253,_0x1dd651[_0x5ad7('0x12')][_0x5ad7('0x13')]);return _0x2eebb6(_0x1dd651['error'][_0x5ad7('0x13')]);}else{logger[_0x5ad7('0xd')](_0x5ad7('0xe'),_0x5cb253,'request\x20sent');_0x2eebb6(_0x1dd651[_0x5ad7('0x14')]['message']);}})[_0x5ad7('0x15')](function(_0x2938d7){logger['error'](_0x5ad7('0xe'),_0x5cb253,_0x2938d7);_0x3e561c(_0x2938d7);});});} \ No newline at end of file +var _0x28b5=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x52b226,_0x37908a){var _0x3b76f9=function(_0x1810d9){while(--_0x1810d9){_0x52b226['push'](_0x52b226['shift']());}};_0x3b76f9(++_0x37908a);}(_0x28b5,0x13f));var _0x528b=function(_0x3facd8,_0x177ed1){_0x3facd8=_0x3facd8-0x0;var _0xc13275=_0x28b5[_0x3facd8];return _0xc13275;};'use strict';var _=require(_0x528b('0x0'));var util=require('util');var moment=require(_0x528b('0x1'));var BPromise=require(_0x528b('0x2'));var rs=require(_0x528b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x528b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x528b('0x5'));var config=require(_0x528b('0x6'));var jayson=require(_0x528b('0x7'));var client=jayson[_0x528b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4d4a,_0x5a7f64,_0x5b78c1){return new BPromise(function(_0xbf8f4b,_0x1b90b9){return client[_0x528b('0x9')](_0x3c4d4a,_0x5b78c1)['then'](function(_0x585f7d){logger[_0x528b('0xa')](_0x528b('0xb'),_0x5a7f64,_0x528b('0xc'));logger[_0x528b('0xd')](_0x528b('0xe'),_0x5a7f64,'request\x20sent',JSON[_0x528b('0xf')](_0x585f7d));if(_0x585f7d[_0x528b('0x10')]){if(_0x585f7d[_0x528b('0x10')][_0x528b('0x11')]===0x1f4){logger[_0x528b('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a7f64,_0x585f7d['error'][_0x528b('0x12')]);return _0x1b90b9(_0x585f7d['error'][_0x528b('0x12')]);}logger[_0x528b('0x10')](_0x528b('0xb'),_0x5a7f64,_0x585f7d[_0x528b('0x10')][_0x528b('0x12')]);return _0xbf8f4b(_0x585f7d['error'][_0x528b('0x12')]);}else{logger[_0x528b('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a7f64,_0x528b('0xc'));_0xbf8f4b(_0x585f7d[_0x528b('0x13')]['message']);}})[_0x528b('0x14')](function(_0x2852ae){logger[_0x528b('0x10')](_0x528b('0xb'),_0x5a7f64,_0x2852ae);_0x1b90b9(_0x2852ae);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ac212d0..7cdd1a1 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 _0xa6a4=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','multer'];(function(_0x16a447,_0xa797fc){var _0x2366b5=function(_0x21f207){while(--_0x21f207){_0x16a447['push'](_0x16a447['shift']());}};_0x2366b5(++_0xa797fc);}(_0xa6a4,0x1b9));var _0x4a6a=function(_0x1186e0,_0xd12641){_0x1186e0=_0x1186e0-0x0;var _0x1dfdcb=_0xa6a4[_0x1186e0];return _0x1dfdcb;};'use strict';var multer=require(_0x4a6a('0x0'));var util=require(_0x4a6a('0x1'));var path=require(_0x4a6a('0x2'));var timeout=require(_0x4a6a('0x3'));var express=require(_0x4a6a('0x4'));var router=express['Router']();var fs_extra=require(_0x4a6a('0x5'));var auth=require(_0x4a6a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4a6a('0x7'));var controller=require('./voiceRecording.controller');router[_0x4a6a('0x8')]('/',auth[_0x4a6a('0x9')](),controller[_0x4a6a('0xa')]);router[_0x4a6a('0x8')](_0x4a6a('0xb'),auth[_0x4a6a('0x9')](),controller[_0x4a6a('0xc')]);router[_0x4a6a('0x8')](_0x4a6a('0xd'),auth[_0x4a6a('0x9')](),controller[_0x4a6a('0xe')]);router[_0x4a6a('0x8')](_0x4a6a('0xf'),auth[_0x4a6a('0x9')](),controller['download']);router[_0x4a6a('0x8')](_0x4a6a('0x10'),controller['downloads']);router[_0x4a6a('0x8')](_0x4a6a('0x11'),auth['isAuthenticated'](),controller[_0x4a6a('0x12')]);router[_0x4a6a('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4a6a('0x13')](_0x4a6a('0x11'),auth[_0x4a6a('0x9')](),controller[_0x4a6a('0x14')]);router[_0x4a6a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x4a6a('0x16')]);router[_0x4a6a('0x17')](_0x4a6a('0xd'),auth['isAuthenticated'](),controller[_0x4a6a('0x18')]);module[_0x4a6a('0x19')]=router; \ No newline at end of file +var _0x7f1a=['put','/:id','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id/download','download','downloads','/:id/transcribe','post','create','runTranscribe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7f1a,0x1ae));var _0xa7f1=function(_0x3ba94e,_0x142dd5){_0x3ba94e=_0x3ba94e-0x0;var _0x3aa60a=_0x7f1a[_0x3ba94e];return _0x3aa60a;};'use strict';var multer=require('multer');var util=require(_0xa7f1('0x0'));var path=require(_0xa7f1('0x1'));var timeout=require(_0xa7f1('0x2'));var express=require(_0xa7f1('0x3'));var router=express['Router']();var fs_extra=require(_0xa7f1('0x4'));var auth=require(_0xa7f1('0x5'));var interaction=require(_0xa7f1('0x6'));var config=require('../../config/environment');var controller=require(_0xa7f1('0x7'));router[_0xa7f1('0x8')]('/',auth['isAuthenticated'](),controller[_0xa7f1('0x9')]);router[_0xa7f1('0x8')](_0xa7f1('0xa'),auth[_0xa7f1('0xb')](),controller[_0xa7f1('0xc')]);router['get']('/:id',auth[_0xa7f1('0xb')](),controller['show']);router[_0xa7f1('0x8')](_0xa7f1('0xd'),auth[_0xa7f1('0xb')](),controller[_0xa7f1('0xe')]);router[_0xa7f1('0x8')]('/:id/downloads',controller[_0xa7f1('0xf')]);router[_0xa7f1('0x8')](_0xa7f1('0x10'),auth[_0xa7f1('0xb')](),controller['downloadTranscribe']);router[_0xa7f1('0x11')]('/',auth[_0xa7f1('0xb')](),controller[_0xa7f1('0x12')]);router[_0xa7f1('0x11')](_0xa7f1('0x10'),auth['isAuthenticated'](),controller[_0xa7f1('0x13')]);router[_0xa7f1('0x14')](_0xa7f1('0x15'),auth[_0xa7f1('0xb')](),controller['update']);router[_0xa7f1('0x16')](_0xa7f1('0x15'),auth[_0xa7f1('0xb')](),controller[_0xa7f1('0x17')]);module[_0xa7f1('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 44552f0..deb5b0f 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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 9d79277..a9d61a4 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 _0x5752=['listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','runTranscribe','ValidationError','Voice\x20Recording\x20not\x20found','findOne','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','fieldName','type','format','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','VIRTUAL','merge','options','findAll','rows','show','keys','rawAttributes','includeAll','include','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','params','value','%s.cypher','existsSync','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','decryptFile','extname','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x5752,0x155));var _0x2575=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x5752[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0x2575('0x0'));var rimraf=require(_0x2575('0x1'));var zipdir=require(_0x2575('0x2'));var jsonpatch=require(_0x2575('0x3'));var rp=require(_0x2575('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2575('0x5'));var path=require('path');var sox=require(_0x2575('0x6'));var csv=require('to-csv');var ejs=require(_0x2575('0x7'));var fs=require('fs');var fs_extra=require(_0x2575('0x8'));var _=require('lodash');var squel=require(_0x2575('0x9'));var crypto=require(_0x2575('0xa'));var jsforce=require(_0x2575('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2575('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x2575('0xd'));var uuidv4=require('uuid/v4');var Redis=require(_0x2575('0xe'));var authService=require(_0x2575('0xf'));var qs=require(_0x2575('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2575('0x11'))(_0x2575('0x12'));var utils=require(_0x2575('0x13'));var config=require(_0x2575('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2575('0x15'))['db'];function respondWithStatusCode(_0x4d7770,_0x29fff7){_0x29fff7=_0x29fff7||0xcc;return function(_0x41a027){if(_0x41a027){return _0x4d7770[_0x2575('0x16')](_0x29fff7);}return _0x4d7770[_0x2575('0x17')](_0x29fff7)[_0x2575('0x18')]();};}function respondWithResult(_0x1410d6,_0x2067b7){_0x2067b7=_0x2067b7||0xc8;return function(_0x22aa86){if(_0x22aa86){return _0x1410d6[_0x2575('0x17')](_0x2067b7)[_0x2575('0x19')](_0x22aa86);}};}function respondWithFilteredResult(_0x3d7371,_0x2f5bf1){return function(_0x25ee31){if(_0x25ee31){var _0x160b9a=typeof _0x2f5bf1['offset']===_0x2575('0x1a')&&typeof _0x2f5bf1[_0x2575('0x1b')]==='undefined';var _0x14e7f0=_0x25ee31[_0x2575('0x1c')];var _0x11aada=_0x160b9a?0x0:_0x2f5bf1['offset'];var _0x2118d9=_0x160b9a?_0x25ee31[_0x2575('0x1c')]:_0x2f5bf1['offset']+_0x2f5bf1[_0x2575('0x1b')];var _0x41b2ba;if(_0x2118d9>=_0x14e7f0){_0x2118d9=_0x14e7f0;_0x41b2ba=0xc8;}else{_0x41b2ba=0xce;}_0x3d7371[_0x2575('0x17')](_0x41b2ba);return _0x3d7371[_0x2575('0x1d')]('Content-Range',_0x11aada+'-'+_0x2118d9+'/'+_0x14e7f0)[_0x2575('0x19')](_0x25ee31);}return null;};}function patchUpdates(_0xd8e88){return function(_0x1567d4){try{jsonpatch['apply'](_0x1567d4,_0xd8e88,!![]);}catch(_0x18d6cd){return BPromise[_0x2575('0x1e')](_0x18d6cd);}return _0x1567d4['save']();};}function saveUpdates(_0x3fd0e1,_0x585e72){return function(_0x497380){if(_0x497380){return _0x497380[_0x2575('0x1f')](_0x3fd0e1)[_0x2575('0x20')](function(_0x4121b3){return _0x4121b3;});}return null;};}function removeEntity(_0x2ae7c0,_0x290902){return function(_0x1a0b5c){if(_0x1a0b5c){return _0x1a0b5c[_0x2575('0x21')]()[_0x2575('0x20')](function(){_0x2ae7c0[_0x2575('0x17')](0xcc)[_0x2575('0x18')]();});}};}function handleEntityNotFound(_0x121f7e,_0x6eb61a){return function(_0x9c9fc6){if(!_0x9c9fc6){_0x121f7e[_0x2575('0x16')](0x194);}return _0x9c9fc6;};}function handleError(_0x58d023,_0x1ea9e7){_0x1ea9e7=_0x1ea9e7||0x1f4;return function(_0x4d6d5c){logger[_0x2575('0x22')](_0x4d6d5c[_0x2575('0x23')]);if(_0x4d6d5c[_0x2575('0x24')]){delete _0x4d6d5c[_0x2575('0x24')];}_0x58d023[_0x2575('0x17')](_0x1ea9e7)[_0x2575('0x25')](_0x4d6d5c);};}exports[_0x2575('0x26')]=function(_0x32d201,_0x23dc2d){var _0x16878e={},_0x5d44cc={},_0x4be3f8={'count':0x0,'rows':[]};var _0x24dedb=_[_0x2575('0x27')](db[_0x2575('0x28')]['rawAttributes'],function(_0x97992a){return{'name':_0x97992a[_0x2575('0x29')],'type':_0x97992a[_0x2575('0x2a')]['key']};});_0x5d44cc['model']=_['differenceBy'](_['map'](_0x24dedb,_0x2575('0x24')),[_0x2575('0x2b')]);_0x5d44cc['query']=_['keys'](_0x32d201[_0x2575('0x2c')]);_0x5d44cc[_0x2575('0x2d')]=_[_0x2575('0x2e')](_0x5d44cc['model'],_0x5d44cc[_0x2575('0x2c')]);_0x16878e['attributes']=_[_0x2575('0x2e')](_0x5d44cc[_0x2575('0x2f')],qs[_0x2575('0x30')](_0x32d201[_0x2575('0x2c')]['fields']));_0x16878e[_0x2575('0x31')]=_0x16878e[_0x2575('0x31')][_0x2575('0x32')]?_0x16878e[_0x2575('0x31')]:_0x5d44cc[_0x2575('0x2f')];if(!_0x32d201['query'][_0x2575('0x33')](_0x2575('0x34'))){_0x16878e[_0x2575('0x1b')]=qs[_0x2575('0x1b')](_0x32d201[_0x2575('0x2c')][_0x2575('0x1b')]);_0x16878e['offset']=qs[_0x2575('0x35')](_0x32d201[_0x2575('0x2c')][_0x2575('0x35')]);}_0x16878e['order']=qs[_0x2575('0x36')](_0x32d201[_0x2575('0x2c')][_0x2575('0x36')]);_0x16878e[_0x2575('0x37')]=qs[_0x2575('0x2d')](_['pick'](_0x32d201['query'],_0x5d44cc['filters']),_0x24dedb);if(_0x32d201[_0x2575('0x2c')]['filter']){_0x16878e[_0x2575('0x37')]=_['merge'](_0x16878e[_0x2575('0x37')],{'$or':_[_0x2575('0x27')](_0x24dedb,function(_0x48e55c){if(_0x48e55c[_0x2575('0x2a')]!==_0x2575('0x38')){var _0x3224ea={};_0x3224ea[_0x48e55c[_0x2575('0x24')]]={'$like':'%'+_0x32d201[_0x2575('0x2c')]['filter']+'%'};return _0x3224ea;}})});}_0x16878e=_[_0x2575('0x39')]({},_0x16878e,_0x32d201[_0x2575('0x3a')]);var _0x1b86da={'where':_0x16878e[_0x2575('0x37')]};return db[_0x2575('0x28')][_0x2575('0x1c')](_0x1b86da)[_0x2575('0x20')](function(_0x2821fc){_0x4be3f8['count']=_0x2821fc;if(_0x32d201[_0x2575('0x2c')]['includeAll']){_0x16878e['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x2575('0x3b')](_0x16878e);})[_0x2575('0x20')](function(_0x6a53e7){_0x4be3f8[_0x2575('0x3c')]=_0x6a53e7;return _0x4be3f8;})[_0x2575('0x20')](respondWithFilteredResult(_0x23dc2d,_0x16878e))['catch'](handleError(_0x23dc2d,null));};exports[_0x2575('0x3d')]=function(_0x2ec088,_0x1cbda7){var _0x343a7b={'raw':![],'where':{'id':_0x2ec088['params']['id']}},_0x244821={};_0x244821[_0x2575('0x2f')]=_[_0x2575('0x3e')](db[_0x2575('0x28')][_0x2575('0x3f')]);_0x244821[_0x2575('0x2c')]=_[_0x2575('0x3e')](_0x2ec088[_0x2575('0x2c')]);_0x244821[_0x2575('0x2d')]=_[_0x2575('0x2e')](_0x244821[_0x2575('0x2f')],_0x244821[_0x2575('0x2c')]);_0x343a7b[_0x2575('0x31')]=_['intersection'](_0x244821[_0x2575('0x2f')],qs['fields'](_0x2ec088['query'][_0x2575('0x30')]));_0x343a7b[_0x2575('0x31')]=_0x343a7b[_0x2575('0x31')]['length']?_0x343a7b['attributes']:_0x244821['model'];if(_0x2ec088[_0x2575('0x2c')][_0x2575('0x40')]){_0x343a7b[_0x2575('0x41')]=[{'all':!![]}];}_0x343a7b=_[_0x2575('0x39')]({},_0x343a7b,_0x2ec088['options']);return db['VoiceRecording'][_0x2575('0x42')](_0x343a7b)[_0x2575('0x20')](handleEntityNotFound(_0x1cbda7,null))[_0x2575('0x20')](respondWithResult(_0x1cbda7,null))[_0x2575('0x43')](handleError(_0x1cbda7,null));};exports['create']=function(_0x2b6256,_0xf11151){return db[_0x2575('0x28')][_0x2575('0x44')](_0x2b6256[_0x2575('0x45')],{})[_0x2575('0x20')](respondWithResult(_0xf11151,0xc9))[_0x2575('0x43')](handleError(_0xf11151,null));};exports[_0x2575('0x1f')]=function(_0x58bd29,_0x188ad0){if(_0x58bd29[_0x2575('0x45')]['id']){delete _0x58bd29['body']['id'];}return db[_0x2575('0x28')][_0x2575('0x42')]({'where':{'id':_0x58bd29['params']['id']}})['then'](handleEntityNotFound(_0x188ad0,null))[_0x2575('0x20')](saveUpdates(_0x58bd29['body'],null))[_0x2575('0x20')](respondWithResult(_0x188ad0,null))[_0x2575('0x43')](handleError(_0x188ad0,null));};exports['describe']=function(_0x5dc33c,_0x4c6a41){return db[_0x2575('0x28')][_0x2575('0x46')]()['then'](respondWithResult(_0x4c6a41,null))[_0x2575('0x43')](handleError(_0x4c6a41,null));};exports[_0x2575('0x47')]=function(_0x47c086,_0x544a4f,_0x16add8){var _0xbe42a8=require(_0x2575('0x48'));var _0x135cf5=![];var _0x40dfbc={};if(_0x47c086['query'][_0x2575('0x2a')]&&_0x47c086[_0x2575('0x2c')][_0x2575('0x2a')]===_0x2575('0x49')){_0x40dfbc[_0x2575('0x49')]=_0x47c086[_0x2575('0x4a')]['id'];}else{_0x40dfbc['id']=_0x47c086[_0x2575('0x4a')]['id'];}return db[_0x2575('0x28')][_0x2575('0x42')]({'where':_0x40dfbc,'attributes':['id',_0x2575('0x4b')],'raw':!![]})[_0x2575('0x20')](handleEntityNotFound(_0x544a4f,null))[_0x2575('0x20')](function(_0x2b0768){if(_0x2b0768){var _0x18e74b=_0x2b0768[_0x2575('0x4b')];var _0x48bcb4=util[_0x2575('0x2b')](_0x2575('0x4c'),_0x18e74b);if(fs[_0x2575('0x4d')](_0x48bcb4)){_0x135cf5=!![];return _0xbe42a8['decryptFile'](_0x48bcb4,_0x18e74b,config[_0x2575('0x4e')][_0x2575('0x4f')])[_0x2575('0x20')](function(){return _0x2b0768;});}return _0x2b0768;}})[_0x2575('0x20')](function(_0x510715){if(_0x510715){var _0x36163b=_0x510715[_0x2575('0x4b')];if(!fs['existsSync'](_0x36163b)){throw new db[(_0x2575('0x50'))]['ValidationError'](_0x2575('0x51'));}if(_0x510715['filename']){return _0x544a4f[_0x2575('0x47')](_0x36163b,_0x510715[_0x2575('0x52')]+path['extname'](_0x36163b),function(){if(_0x135cf5){fs[_0x2575('0x53')](_0x36163b);}});}else{return _0x544a4f[_0x2575('0x47')](_0x36163b,function(_0x34d7a5){if(_0x135cf5){fs[_0x2575('0x53')](_0x36163b);}});}}})['catch'](function(_0x2be817){if(_0x2be817['message']===_0x2575('0x51')){_0x544a4f[_0x2575('0x17')](0x194)['send'](_0x2575('0x54'));}else{return handleError(_0x544a4f,null);}});};exports[_0x2575('0x55')]=function(_0xa6cec3,_0x581ac1,_0x5640a5){var _0x41d6ad=require(_0x2575('0x48'));var _0x27873d=![];var _0x39107d={'$and':[db['sequelize'][_0x2575('0x37')](db[_0x2575('0x56')]['fn'](_0x2575('0x57'),db['sequelize'][_0x2575('0x58')](_0x2575('0x49'))),_0xa6cec3[_0x2575('0x2c')][_0x2575('0x59')])]};if(_0xa6cec3['query']['type']&&_0xa6cec3[_0x2575('0x2c')][_0x2575('0x2a')]==='uniqueid'){_0x39107d['$and'][_0x2575('0x5a')]({'uniqueid':_0xa6cec3[_0x2575('0x4a')]['id']});}else{_0x39107d[_0x2575('0x5b')][_0x2575('0x5a')]({'id':_0xa6cec3[_0x2575('0x4a')]['id']});}return db['VoiceRecording'][_0x2575('0x42')]({'where':_0x39107d,'attributes':['id','value'],'raw':!![]})[_0x2575('0x20')](handleEntityNotFound(_0x581ac1,null))[_0x2575('0x20')](function(_0x25d43e){if(_0x25d43e){var _0x44f250=util[_0x2575('0x2b')]('%s.cypher',_0x25d43e['value']);if(fs[_0x2575('0x4d')](_0x44f250)){_0x27873d=!![];return _0x41d6ad[_0x2575('0x5c')](_0x44f250,_0x25d43e[_0x2575('0x4b')],config[_0x2575('0x4e')][_0x2575('0x4f')])['then'](function(){return _0x25d43e;});}return _0x25d43e;}})[_0x2575('0x20')](function(_0x35794d){if(_0x35794d){if(!fs[_0x2575('0x4d')](_0x35794d['value'])){throw new db[(_0x2575('0x50'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x35794d[_0x2575('0x52')]){return _0x581ac1[_0x2575('0x47')](_0x35794d[_0x2575('0x4b')],_0x35794d['filename']+path[_0x2575('0x5d')](_0x35794d['value']),function(){if(_0x27873d){fs[_0x2575('0x53')](_0x35794d[_0x2575('0x4b')]);}});}else{return _0x581ac1[_0x2575('0x47')](_0x35794d['value'],function(_0x3e5473){if(_0x27873d){fs[_0x2575('0x53')](_0x35794d[_0x2575('0x4b')]);}});}}})[_0x2575('0x43')](handleError(_0x581ac1,null));};exports[_0x2575('0x21')]=function(_0x468a42,_0x1fc709){return db[_0x2575('0x28')][_0x2575('0x42')]({'where':{'id':_0x468a42['params']['id']}})[_0x2575('0x20')](function(_0x1803a3){if(_['isNil'](_0x1803a3)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1803a3;})[_0x2575('0x20')](function(_0x45ab94){var _0x57ef92=_0x45ab94[_0x2575('0x4b')];logger[_0x2575('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x57ef92);if(!_[_0x2575('0x5f')](_0x45ab94['value'])&&fs[_0x2575('0x4d')](_0x57ef92)){logger['info'](_0x2575('0x60')+_0x57ef92+_0x2575('0x61'));fs['unlinkSync'](_0x57ef92);}_0x57ef92=_0x57ef92+_0x2575('0x62');if(!_[_0x2575('0x5f')](_0x45ab94[_0x2575('0x4b')])&&fs[_0x2575('0x4d')](_0x57ef92)){logger['info'](_0x2575('0x60')+_0x57ef92+_0x2575('0x61'));fs[_0x2575('0x63')](_0x57ef92);}return _0x45ab94;})[_0x2575('0x20')](function(_0x42dbc0){if(!_0x42dbc0)throw new InternalError();return _0x42dbc0['destroy']();})['then'](function(){_0x1fc709[_0x2575('0x17')](0xcc)[_0x2575('0x18')]();})[_0x2575('0x43')](handleError(_0x1fc709,null));};function getBucketslist(_0x58c37d,_0x5e7895,_0x4e1489){return new Promise(function(_0x518b08,_0x59034f){var _0x5b82b=new AWS['S3']({'accessKeyId':_0x5e7895,'secretAccessKey':_0x58c37d,'region':_0x4e1489});_0x5b82b[_0x2575('0x64')]({},function(_0x21d61c,_0x35f019){if(_0x21d61c){return _0x59034f(_0x21d61c);}else{return _0x518b08(_0x35f019);}});});}function createBucket(_0xb4ef5c,_0x4b11d0,_0x1339ae,_0x274e3e){return new Promise(function(_0x45ba17,_0x364a60){var _0x29fdf5=new AWS['S3']({'accessKeyId':_0x4b11d0,'secretAccessKey':_0xb4ef5c,'region':_0x1339ae});_0x29fdf5[_0x2575('0x65')]({'Bucket':_0x274e3e},function(_0xa9c06a,_0x3eeb85){if(_0xa9c06a){return _0x364a60(_0xa9c06a);}else{return _0x45ba17(_0x3eeb85);}});});}function uploadFile(_0x45e920,_0x318f98,_0x182830,_0x3e0646,_0x569048,_0x6e7139){return new Promise(function(_0x5eb5e6,_0x2f3b48){var _0x544a87=new AWS['S3']({'accessKeyId':_0x318f98,'secretAccessKey':_0x45e920,'region':_0x182830});_0x544a87[_0x2575('0x66')]({'Bucket':_0x3e0646,'Key':_0x569048,'Body':_0x6e7139},function(_0x46abbf,_0x2c85c6){if(_0x46abbf){return _0x2f3b48(_0x46abbf);}else{return _0x5eb5e6(_0x2c85c6);}});});}function startTranscribe(_0x2f81b4,_0x356767,_0x5b6682,_0x44b686,_0x460d0c,_0x347722){return new Promise(function(_0x151bbd,_0x59725e){var _0x5cfa87=new AWS[(_0x2575('0x67'))]({'accessKeyId':_0x356767,'secretAccessKey':_0x2f81b4,'region':_0x5b6682});_0x5cfa87[_0x2575('0x68')]({'TranscriptionJobName':_0x44b686,'LanguageCode':_0x460d0c,'Media':{'MediaFileUri':_0x347722}},function(_0x4b00c8,_0x438962){if(_0x4b00c8){return _0x59725e(_0x4b00c8);}else{return _0x151bbd(_0x438962);}});});}function transcribe(_0x52c90e,_0x1c9236,_0x21a040,_0x498b82,_0x1eda9f,_0x48d240,_0x49fcef){return new Promise(function(_0x1e6496,_0x45ed91){var _0xa8d1b1={};logger[_0x2575('0x5e')](util['format'](_0x2575('0x69'),_0x52c90e,_0x1eda9f));return uploadFile(_0x1c9236,_0x21a040,_0x498b82,_0x1eda9f,path[_0x2575('0x6a')](_0x48d240),fs[_0x2575('0x6b')](_0x48d240))['then'](function(_0x270e4c){logger[_0x2575('0x5e')](util[_0x2575('0x2b')](_0x2575('0x6c'),_0x52c90e,_0x1eda9f,_0x270e4c[_0x2575('0x6d')]));_0xa8d1b1[_0x2575('0x6e')]=_0x270e4c[_0x2575('0x6f')];_0xa8d1b1[_0x2575('0x70')]=_0x270e4c[_0x2575('0x6d')];logger['info'](util[_0x2575('0x2b')](_0x2575('0x71'),_0x52c90e));return startTranscribe(_0x1c9236,_0x21a040,_0x498b82,uuidv4(),_0x49fcef,_0x270e4c['Location']);})[_0x2575('0x20')](function(_0x3b34f0){logger[_0x2575('0x5e')](util['format'](_0x2575('0x72'),_0x52c90e,_0x3b34f0['TranscriptionJob'][_0x2575('0x73')]));_0xa8d1b1['transcribeName']=_0x3b34f0[_0x2575('0x74')]['TranscriptionJobName'];_0xa8d1b1[_0x2575('0x75')]=_0x3b34f0[_0x2575('0x74')]['TranscriptionJobStatus'];return _0x1e6496(_0xa8d1b1);})[_0x2575('0x43')](function(_0x4d1714){return _0x45ed91(_0x4d1714);});});}exports[_0x2575('0x76')]=function(_0x563208,_0x17427b,_0x2d6fed){var _0x4c4096;var _0x36d987;var _0x4c6295;var _0x1977c6=require(_0x2575('0x48'));return db['VoiceRecording']['findOne']({'where':{'id':_0x563208[_0x2575('0x4a')]['id']}})[_0x2575('0x20')](function(_0x3ccb4d){if(_0x3ccb4d){var _0x1e3522=util['format'](_0x2575('0x4c'),_0x3ccb4d['value']);if(fs[_0x2575('0x4d')](_0x1e3522)){cypher=!![];return _0x1977c6[_0x2575('0x5c')](_0x1e3522,_0x3ccb4d[_0x2575('0x4b')],config[_0x2575('0x4e')][_0x2575('0x4f')])[_0x2575('0x20')](function(){return _0x3ccb4d;});}return _0x3ccb4d;}})[_0x2575('0x20')](function(_0x58b5ad){if(!_0x58b5ad){throw new db[(_0x2575('0x50'))][(_0x2575('0x77'))](_0x2575('0x78'));}_0x36d987=_0x58b5ad;return db['Setting'][_0x2575('0x79')]({'where':{'id':0x1}});})[_0x2575('0x20')](handleEntityNotFound(_0x17427b,null))[_0x2575('0x20')](function(_0x5a07f2){if(_0x5a07f2){_0x4c4096=_0x5a07f2;if(!_0x4c4096['transcribe']||!_0x4c4096[_0x2575('0x7a')]||!_0x4c4096[_0x2575('0x7b')]||!_0x4c4096['language']||!_0x4c4096[_0x2575('0x6e')]){throw new db[(_0x2575('0x50'))][(_0x2575('0x77'))](_0x2575('0x7c'));}if(_0x563208[_0x2575('0x45')][_0x2575('0x7d')]&&(!_0x4c4096[_0x2575('0x7e')]||!_0x4c4096[_0x2575('0x7f')]||!_0x4c4096['sentimentRegion']||!_0x4c4096['language']||!_0x4c4096[_0x2575('0x6e')])){throw new db[(_0x2575('0x50'))][(_0x2575('0x77'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x2575('0x80')][_0x2575('0x79')]({'where':{'id':_0x4c4096['transcribeAccountId']}});}})[_0x2575('0x20')](function(_0x2fdaaf){if(!_0x2fdaaf){throw new db[(_0x2575('0x50'))][(_0x2575('0x77'))](_0x2575('0x81'));}if(!_0x2fdaaf['data1']||!_0x2fdaaf['data2']){throw new db[(_0x2575('0x50'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x4c6295=_0x2fdaaf;return getBucketslist(_0x4c6295[_0x2575('0x82')],_0x4c6295[_0x2575('0x83')],_0x4c4096[_0x2575('0x7b')]);})[_0x2575('0x20')](function(_0x54edf8){if(_0x54edf8&&_0x54edf8['Buckets']){var _0x415257=_[_0x2575('0x42')](_0x54edf8[_0x2575('0x84')],function(_0x505089){return _0x505089[_0x2575('0x85')]===_0x4c4096[_0x2575('0x6e')];});if(!_0x415257){logger[_0x2575('0x5e')](util['format'](_0x2575('0x86'),_0x563208[_0x2575('0x4a')]['id'],_0x4c4096['bucket']));return createBucket(_0x4c6295[_0x2575('0x82')],_0x4c6295['data2'],_0x4c4096[_0x2575('0x7b')],_0x4c4096['bucket']);}logger[_0x2575('0x5e')](util['format'](_0x2575('0x87'),_0x563208[_0x2575('0x4a')]['id'],_0x4c4096[_0x2575('0x6e')]));return;}})[_0x2575('0x20')](function(_0x17fb9d){if(_0x36d987[_0x2575('0x75')]===_0x2575('0x88')){return transcribe(_0x563208['params']['id'],_0x4c6295[_0x2575('0x82')],_0x4c6295['data2'],_0x4c4096[_0x2575('0x7b')],_0x4c4096[_0x2575('0x6e')],_0x36d987['value'],_0x4c4096[_0x2575('0x89')]);}else{logger['info'](util['format'](_0x2575('0x8a'),_0x563208[_0x2575('0x4a')]['id']));return{'transcribeStatus':_0x2575('0x8b')};}})['then'](function(_0x4cf917){if(_0x4cf917){_0x4cf917[_0x2575('0x8c')]=_0x563208[_0x2575('0x45')][_0x2575('0x7d')];return _0x36d987[_0x2575('0x8d')](_0x4cf917);}})[_0x2575('0x20')](respondWithResult(_0x17427b,null))[_0x2575('0x43')](handleError(_0x17427b,null));};function writeFile(_0x361563,_0x4a38c7){return new Promise(function(_0x411eb6,_0x223684){fs[_0x2575('0x8e')](_0x4a38c7,_0x361563,function(_0x3b6acc,_0x5d4363){if(_0x3b6acc){return _0x223684(_0x3b6acc);}else{return _0x411eb6(_0x5d4363);}});});}exports[_0x2575('0x8f')]=function(_0x163223,_0x2c5ea0,_0x3c770a){return db['VoiceRecording'][_0x2575('0x79')]({'where':{'id':_0x163223[_0x2575('0x4a')]['id']}})[_0x2575('0x20')](handleEntityNotFound(_0x2c5ea0))[_0x2575('0x20')](function(_0x467b87){if(_0x467b87&&_0x467b87[_0x2575('0x90')]){var _0x49f380=_0x467b87['fileText'];var _0x38b46d=config[_0x2575('0x91')]+'/server/files/transcribes/transcribe_'+_0x467b87['id']+_0x2575('0x92');if(fs['existsSync'](_0x38b46d)){return _0x38b46d;}return writeFile(_0x49f380,_0x38b46d)[_0x2575('0x20')](function(){return _0x38b46d;});}else{throw new db[(_0x2575('0x50'))][(_0x2575('0x77'))]('Transcript\x20not\x20available');}})[_0x2575('0x20')](function(_0x1dcf2e){return _0x2c5ea0[_0x2575('0x47')](_0x1dcf2e);})[_0x2575('0x43')](handleError(_0x2c5ea0));}; \ No newline at end of file +var _0x4a7a=['papaparse','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','MD5','sequelize','col','token','$and','push','isNil','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','secrets','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','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','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','fileText','root','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x20a53f,_0x235ac5){var _0x39a977=function(_0x91a86b){while(--_0x91a86b){_0x20a53f['push'](_0x20a53f['shift']());}};_0x39a977(++_0x235ac5);}(_0x4a7a,0x1c3));var _0xa4a7=function(_0x436827,_0x570104){_0x436827=_0x436827-0x0;var _0x22434d=_0x4a7a[_0x436827];return _0x22434d;};'use strict';var emlformat=require(_0xa4a7('0x0'));var rimraf=require(_0xa4a7('0x1'));var zipdir=require(_0xa4a7('0x2'));var jsonpatch=require(_0xa4a7('0x3'));var rp=require(_0xa4a7('0x4'));var moment=require(_0xa4a7('0x5'));var BPromise=require(_0xa4a7('0x6'));var Mustache=require(_0xa4a7('0x7'));var util=require(_0xa4a7('0x8'));var path=require(_0xa4a7('0x9'));var sox=require(_0xa4a7('0xa'));var csv=require(_0xa4a7('0xb'));var ejs=require(_0xa4a7('0xc'));var fs=require('fs');var fs_extra=require(_0xa4a7('0xd'));var _=require(_0xa4a7('0xe'));var squel=require(_0xa4a7('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa4a7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa4a7('0x11'));var AWS=require(_0xa4a7('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0xa4a7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa4a7('0x14'));var as=require(_0xa4a7('0x15'));var hardwareService=require(_0xa4a7('0x16'));var logger=require(_0xa4a7('0x17'))(_0xa4a7('0x18'));var utils=require(_0xa4a7('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4a7('0x1a'))['db'];function respondWithStatusCode(_0x4ae823,_0x4ce6bd){_0x4ce6bd=_0x4ce6bd||0xcc;return function(_0x340589){if(_0x340589){return _0x4ae823['sendStatus'](_0x4ce6bd);}return _0x4ae823[_0xa4a7('0x1b')](_0x4ce6bd)[_0xa4a7('0x1c')]();};}function respondWithResult(_0x486129,_0xb75080){_0xb75080=_0xb75080||0xc8;return function(_0x3fb264){if(_0x3fb264){return _0x486129[_0xa4a7('0x1b')](_0xb75080)[_0xa4a7('0x1d')](_0x3fb264);}};}function respondWithFilteredResult(_0x337951,_0xc5e51a){return function(_0x2665ad){if(_0x2665ad){var _0x42e55a=typeof _0xc5e51a[_0xa4a7('0x1e')]==='undefined'&&typeof _0xc5e51a[_0xa4a7('0x1f')]===_0xa4a7('0x20');var _0x107936=_0x2665ad[_0xa4a7('0x21')];var _0x331872=_0x42e55a?0x0:_0xc5e51a['offset'];var _0x25196e=_0x42e55a?_0x2665ad[_0xa4a7('0x21')]:_0xc5e51a['offset']+_0xc5e51a[_0xa4a7('0x1f')];var _0x51558c;if(_0x25196e>=_0x107936){_0x25196e=_0x107936;_0x51558c=0xc8;}else{_0x51558c=0xce;}_0x337951[_0xa4a7('0x1b')](_0x51558c);return _0x337951[_0xa4a7('0x22')](_0xa4a7('0x23'),_0x331872+'-'+_0x25196e+'/'+_0x107936)[_0xa4a7('0x1d')](_0x2665ad);}return null;};}function patchUpdates(_0x25d473){return function(_0x5f4265){try{jsonpatch['apply'](_0x5f4265,_0x25d473,!![]);}catch(_0x5175c5){return BPromise[_0xa4a7('0x24')](_0x5175c5);}return _0x5f4265[_0xa4a7('0x25')]();};}function saveUpdates(_0x427eca,_0x41e6ad){return function(_0x215f86){if(_0x215f86){return _0x215f86['update'](_0x427eca)[_0xa4a7('0x26')](function(_0x3dcbcb){return _0x3dcbcb;});}return null;};}function removeEntity(_0x29be0f,_0x4aa378){return function(_0x3ad9e6){if(_0x3ad9e6){return _0x3ad9e6[_0xa4a7('0x27')]()[_0xa4a7('0x26')](function(){_0x29be0f[_0xa4a7('0x1b')](0xcc)[_0xa4a7('0x1c')]();});}};}function handleEntityNotFound(_0x4d6643,_0x4f16a0){return function(_0x2c29b9){if(!_0x2c29b9){_0x4d6643[_0xa4a7('0x28')](0x194);}return _0x2c29b9;};}function handleError(_0x3cfeee,_0x2eb901){_0x2eb901=_0x2eb901||0x1f4;return function(_0x1fe9b8){logger[_0xa4a7('0x29')](_0x1fe9b8[_0xa4a7('0x2a')]);if(_0x1fe9b8['name']){delete _0x1fe9b8[_0xa4a7('0x2b')];}_0x3cfeee[_0xa4a7('0x1b')](_0x2eb901)[_0xa4a7('0x2c')](_0x1fe9b8);};}exports[_0xa4a7('0x2d')]=function(_0x2357eb,_0x448efe){var _0x866ac6={},_0x78efd6={},_0x45a36d={'count':0x0,'rows':[]};var _0x2b1168=_['map'](db[_0xa4a7('0x2e')][_0xa4a7('0x2f')],function(_0xfa4a3d){return{'name':_0xfa4a3d[_0xa4a7('0x30')],'type':_0xfa4a3d[_0xa4a7('0x31')]['key']};});_0x78efd6[_0xa4a7('0x32')]=_['differenceBy'](_[_0xa4a7('0x33')](_0x2b1168,_0xa4a7('0x2b')),['format']);_0x78efd6[_0xa4a7('0x34')]=_[_0xa4a7('0x35')](_0x2357eb[_0xa4a7('0x34')]);_0x78efd6[_0xa4a7('0x36')]=_[_0xa4a7('0x37')](_0x78efd6['model'],_0x78efd6[_0xa4a7('0x34')]);_0x866ac6['attributes']=_[_0xa4a7('0x37')](_0x78efd6[_0xa4a7('0x32')],qs[_0xa4a7('0x38')](_0x2357eb[_0xa4a7('0x34')]['fields']));_0x866ac6[_0xa4a7('0x39')]=_0x866ac6['attributes'][_0xa4a7('0x3a')]?_0x866ac6[_0xa4a7('0x39')]:_0x78efd6[_0xa4a7('0x32')];if(!_0x2357eb[_0xa4a7('0x34')][_0xa4a7('0x3b')](_0xa4a7('0x3c'))){_0x866ac6[_0xa4a7('0x1f')]=qs['limit'](_0x2357eb[_0xa4a7('0x34')][_0xa4a7('0x1f')]);_0x866ac6[_0xa4a7('0x1e')]=qs['offset'](_0x2357eb[_0xa4a7('0x34')][_0xa4a7('0x1e')]);}_0x866ac6[_0xa4a7('0x3d')]=qs[_0xa4a7('0x3e')](_0x2357eb[_0xa4a7('0x34')][_0xa4a7('0x3e')]);_0x866ac6[_0xa4a7('0x3f')]=qs['filters'](_[_0xa4a7('0x40')](_0x2357eb[_0xa4a7('0x34')],_0x78efd6[_0xa4a7('0x36')]),_0x2b1168);if(_0x2357eb[_0xa4a7('0x34')][_0xa4a7('0x41')]){_0x866ac6[_0xa4a7('0x3f')]=_[_0xa4a7('0x42')](_0x866ac6[_0xa4a7('0x3f')],{'$or':_[_0xa4a7('0x33')](_0x2b1168,function(_0x3a0c0d){if(_0x3a0c0d[_0xa4a7('0x31')]!==_0xa4a7('0x43')){var _0x2340c7={};_0x2340c7[_0x3a0c0d['name']]={'$like':'%'+_0x2357eb['query'][_0xa4a7('0x41')]+'%'};return _0x2340c7;}})});}_0x866ac6=_[_0xa4a7('0x42')]({},_0x866ac6,_0x2357eb[_0xa4a7('0x44')]);var _0x51941e={'where':_0x866ac6['where']};return db[_0xa4a7('0x2e')][_0xa4a7('0x21')](_0x51941e)['then'](function(_0x5f18e5){_0x45a36d[_0xa4a7('0x21')]=_0x5f18e5;if(_0x2357eb[_0xa4a7('0x34')]['includeAll']){_0x866ac6[_0xa4a7('0x45')]=[{'all':!![]}];}return db[_0xa4a7('0x2e')][_0xa4a7('0x46')](_0x866ac6);})[_0xa4a7('0x26')](function(_0xaa8309){_0x45a36d[_0xa4a7('0x47')]=_0xaa8309;return _0x45a36d;})['then'](respondWithFilteredResult(_0x448efe,_0x866ac6))[_0xa4a7('0x48')](handleError(_0x448efe,null));};exports[_0xa4a7('0x49')]=function(_0x4be335,_0x245e51){var _0x3764be={'raw':![],'where':{'id':_0x4be335['params']['id']}},_0x55a06e={};_0x55a06e[_0xa4a7('0x32')]=_['keys'](db['VoiceRecording'][_0xa4a7('0x2f')]);_0x55a06e[_0xa4a7('0x34')]=_['keys'](_0x4be335[_0xa4a7('0x34')]);_0x55a06e[_0xa4a7('0x36')]=_['intersection'](_0x55a06e[_0xa4a7('0x32')],_0x55a06e[_0xa4a7('0x34')]);_0x3764be['attributes']=_[_0xa4a7('0x37')](_0x55a06e[_0xa4a7('0x32')],qs['fields'](_0x4be335[_0xa4a7('0x34')][_0xa4a7('0x38')]));_0x3764be['attributes']=_0x3764be['attributes'][_0xa4a7('0x3a')]?_0x3764be[_0xa4a7('0x39')]:_0x55a06e[_0xa4a7('0x32')];if(_0x4be335['query'][_0xa4a7('0x4a')]){_0x3764be[_0xa4a7('0x45')]=[{'all':!![]}];}_0x3764be=_[_0xa4a7('0x42')]({},_0x3764be,_0x4be335[_0xa4a7('0x44')]);return db[_0xa4a7('0x2e')][_0xa4a7('0x4b')](_0x3764be)[_0xa4a7('0x26')](handleEntityNotFound(_0x245e51,null))[_0xa4a7('0x26')](respondWithResult(_0x245e51,null))['catch'](handleError(_0x245e51,null));};exports[_0xa4a7('0x4c')]=function(_0xf4ba76,_0x30b2c8){return db[_0xa4a7('0x2e')][_0xa4a7('0x4c')](_0xf4ba76['body'],{})[_0xa4a7('0x26')](respondWithResult(_0x30b2c8,0xc9))[_0xa4a7('0x48')](handleError(_0x30b2c8,null));};exports['update']=function(_0x1e70dd,_0x95d1d5){if(_0x1e70dd[_0xa4a7('0x4d')]['id']){delete _0x1e70dd['body']['id'];}return db['VoiceRecording'][_0xa4a7('0x4b')]({'where':{'id':_0x1e70dd[_0xa4a7('0x4e')]['id']}})[_0xa4a7('0x26')](handleEntityNotFound(_0x95d1d5,null))[_0xa4a7('0x26')](saveUpdates(_0x1e70dd[_0xa4a7('0x4d')],null))[_0xa4a7('0x26')](respondWithResult(_0x95d1d5,null))[_0xa4a7('0x48')](handleError(_0x95d1d5,null));};exports['describe']=function(_0x599204,_0x45aa3f){return db['VoiceRecording'][_0xa4a7('0x4f')]()[_0xa4a7('0x26')](respondWithResult(_0x45aa3f,null))[_0xa4a7('0x48')](handleError(_0x45aa3f,null));};exports[_0xa4a7('0x50')]=function(_0x188ae4,_0x4edcdc,_0x167450){var _0x3e301e=require(_0xa4a7('0x51'));var _0x23f542=![];var _0x21ec2d={};if(_0x188ae4['query']['type']&&_0x188ae4['query'][_0xa4a7('0x31')]==='uniqueid'){_0x21ec2d[_0xa4a7('0x52')]=_0x188ae4[_0xa4a7('0x4e')]['id'];}else{_0x21ec2d['id']=_0x188ae4[_0xa4a7('0x4e')]['id'];}return db['VoiceRecording']['find']({'where':_0x21ec2d,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4edcdc,null))[_0xa4a7('0x26')](function(_0x466aa1){if(_0x466aa1){var _0x5dd10a=_0x466aa1[_0xa4a7('0x53')];var _0x43e547=util[_0xa4a7('0x54')](_0xa4a7('0x55'),_0x5dd10a);if(fs[_0xa4a7('0x56')](_0x43e547)){_0x23f542=!![];return _0x3e301e[_0xa4a7('0x57')](_0x43e547,_0x5dd10a,config['secrets'][_0xa4a7('0x58')])[_0xa4a7('0x26')](function(){return _0x466aa1;});}return _0x466aa1;}})[_0xa4a7('0x26')](function(_0x2b559b){if(_0x2b559b){var _0x4293e2=_0x2b559b['value'];if(!fs[_0xa4a7('0x56')](_0x4293e2)){throw new db[(_0xa4a7('0x59'))][(_0xa4a7('0x5a'))](_0xa4a7('0x5b'));}if(_0x2b559b['filename']){return _0x4edcdc['download'](_0x4293e2,_0x2b559b[_0xa4a7('0x5c')]+path[_0xa4a7('0x5d')](_0x4293e2),function(){if(_0x23f542){fs['unlink'](_0x4293e2);}});}else{return _0x4edcdc[_0xa4a7('0x50')](_0x4293e2,function(_0x3d34e9){if(_0x23f542){fs[_0xa4a7('0x5e')](_0x4293e2);}});}}})[_0xa4a7('0x48')](function(_0x3d4391){if(_0x3d4391[_0xa4a7('0x5f')]==='VoiceRecording\x20not\x20found'){_0x4edcdc['status'](0x194)[_0xa4a7('0x2c')](_0xa4a7('0x60'));}else{return handleError(_0x4edcdc,null);}});};exports[_0xa4a7('0x61')]=function(_0x3d9f43,_0x2562df,_0x6a9a0d){var _0x50d7db=require(_0xa4a7('0x51'));var _0x372501=![];var _0x5014f9={'$and':[db['sequelize'][_0xa4a7('0x3f')](db['sequelize']['fn'](_0xa4a7('0x62'),db[_0xa4a7('0x63')][_0xa4a7('0x64')](_0xa4a7('0x52'))),_0x3d9f43[_0xa4a7('0x34')][_0xa4a7('0x65')])]};if(_0x3d9f43[_0xa4a7('0x34')][_0xa4a7('0x31')]&&_0x3d9f43[_0xa4a7('0x34')][_0xa4a7('0x31')]===_0xa4a7('0x52')){_0x5014f9[_0xa4a7('0x66')]['push']({'uniqueid':_0x3d9f43['params']['id']});}else{_0x5014f9[_0xa4a7('0x66')][_0xa4a7('0x67')]({'id':_0x3d9f43[_0xa4a7('0x4e')]['id']});}return db['VoiceRecording'][_0xa4a7('0x4b')]({'where':_0x5014f9,'attributes':['id',_0xa4a7('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x2562df,null))[_0xa4a7('0x26')](function(_0x5692cd){if(_0x5692cd){var _0x4264b7=util[_0xa4a7('0x54')]('%s.cypher',_0x5692cd[_0xa4a7('0x53')]);if(fs[_0xa4a7('0x56')](_0x4264b7)){_0x372501=!![];return _0x50d7db[_0xa4a7('0x57')](_0x4264b7,_0x5692cd[_0xa4a7('0x53')],config['secrets']['recording'])[_0xa4a7('0x26')](function(){return _0x5692cd;});}return _0x5692cd;}})[_0xa4a7('0x26')](function(_0x43f151){if(_0x43f151){if(!fs[_0xa4a7('0x56')](_0x43f151[_0xa4a7('0x53')])){throw new db[(_0xa4a7('0x59'))][(_0xa4a7('0x5a'))]('VoiceRecording\x20not\x20found');}if(_0x43f151[_0xa4a7('0x5c')]){return _0x2562df[_0xa4a7('0x50')](_0x43f151['value'],_0x43f151[_0xa4a7('0x5c')]+path[_0xa4a7('0x5d')](_0x43f151[_0xa4a7('0x53')]),function(){if(_0x372501){fs[_0xa4a7('0x5e')](_0x43f151[_0xa4a7('0x53')]);}});}else{return _0x2562df['download'](_0x43f151[_0xa4a7('0x53')],function(_0x3c68f6){if(_0x372501){fs['unlink'](_0x43f151[_0xa4a7('0x53')]);}});}}})[_0xa4a7('0x48')](handleError(_0x2562df,null));};exports['destroy']=function(_0x4d555c,_0x503a1d){return db[_0xa4a7('0x2e')][_0xa4a7('0x4b')]({'where':{'id':_0x4d555c[_0xa4a7('0x4e')]['id']}})['then'](function(_0x3796e4){if(_[_0xa4a7('0x68')](_0x3796e4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3796e4;})[_0xa4a7('0x26')](function(_0x13cdda){var _0x53fce7=_0x13cdda[_0xa4a7('0x53')];logger['info'](_0xa4a7('0x69'),_0x53fce7);if(!_[_0xa4a7('0x68')](_0x13cdda[_0xa4a7('0x53')])&&fs[_0xa4a7('0x56')](_0x53fce7)){logger[_0xa4a7('0x6a')]('File:\x20\x22'+_0x53fce7+_0xa4a7('0x6b'));fs[_0xa4a7('0x6c')](_0x53fce7);}_0x53fce7=_0x53fce7+_0xa4a7('0x6d');if(!_['isNil'](_0x13cdda['value'])&&fs[_0xa4a7('0x56')](_0x53fce7)){logger[_0xa4a7('0x6a')](_0xa4a7('0x6e')+_0x53fce7+_0xa4a7('0x6b'));fs[_0xa4a7('0x6c')](_0x53fce7);}return _0x13cdda;})[_0xa4a7('0x26')](function(_0xdb03){if(!_0xdb03)throw new InternalError();return _0xdb03[_0xa4a7('0x27')]();})['then'](function(){_0x503a1d[_0xa4a7('0x1b')](0xcc)[_0xa4a7('0x1c')]();})[_0xa4a7('0x48')](handleError(_0x503a1d,null));};function getBucketslist(_0x67f560,_0x16affc,_0x20add6){return new Promise(function(_0x5a5a94,_0x54eddb){var _0x5e04ef=new AWS['S3']({'accessKeyId':_0x16affc,'secretAccessKey':_0x67f560,'region':_0x20add6});_0x5e04ef[_0xa4a7('0x6f')]({},function(_0x5321f5,_0x14c583){if(_0x5321f5){return _0x54eddb(_0x5321f5);}else{return _0x5a5a94(_0x14c583);}});});}function createBucket(_0x510fee,_0x2c51b1,_0x132608,_0xcee04f){return new Promise(function(_0x4f6e65,_0x2dc97c){var _0x571092=new AWS['S3']({'accessKeyId':_0x2c51b1,'secretAccessKey':_0x510fee,'region':_0x132608});_0x571092[_0xa4a7('0x70')]({'Bucket':_0xcee04f},function(_0x458e5d,_0x3d77b1){if(_0x458e5d){return _0x2dc97c(_0x458e5d);}else{return _0x4f6e65(_0x3d77b1);}});});}function uploadFile(_0xae9d7d,_0x368f17,_0x2cbbcb,_0x424a23,_0x4ab279,_0x2bf616){return new Promise(function(_0x822d1a,_0x20c266){var _0x3176a4=new AWS['S3']({'accessKeyId':_0x368f17,'secretAccessKey':_0xae9d7d,'region':_0x2cbbcb});_0x3176a4['upload']({'Bucket':_0x424a23,'Key':_0x4ab279,'Body':_0x2bf616},function(_0x5cf212,_0x1f9170){if(_0x5cf212){return _0x20c266(_0x5cf212);}else{return _0x822d1a(_0x1f9170);}});});}function startTranscribe(_0x5b27f0,_0x36b50e,_0x405beb,_0x353952,_0x5f4d83,_0x82e360){return new Promise(function(_0x466d04,_0x5789a6){var _0x5700c1=new AWS[(_0xa4a7('0x71'))]({'accessKeyId':_0x36b50e,'secretAccessKey':_0x5b27f0,'region':_0x405beb});_0x5700c1[_0xa4a7('0x72')]({'TranscriptionJobName':_0x353952,'LanguageCode':_0x5f4d83,'Media':{'MediaFileUri':_0x82e360}},function(_0x1c9e96,_0x509944){if(_0x1c9e96){return _0x5789a6(_0x1c9e96);}else{return _0x466d04(_0x509944);}});});}function transcribe(_0x20c788,_0x36415e,_0x3b43ea,_0x503562,_0x1f9328,_0x2db442,_0x4b2db3){return new Promise(function(_0x370353,_0x560967){var _0x3632e6={};logger[_0xa4a7('0x6a')](util[_0xa4a7('0x54')](_0xa4a7('0x73'),_0x20c788,_0x1f9328));return uploadFile(_0x36415e,_0x3b43ea,_0x503562,_0x1f9328,path[_0xa4a7('0x74')](_0x2db442),fs['readFileSync'](_0x2db442))[_0xa4a7('0x26')](function(_0x43d19b){logger[_0xa4a7('0x6a')](util[_0xa4a7('0x54')](_0xa4a7('0x75'),_0x20c788,_0x1f9328,_0x43d19b[_0xa4a7('0x76')]));_0x3632e6[_0xa4a7('0x77')]=_0x43d19b[_0xa4a7('0x78')];_0x3632e6[_0xa4a7('0x79')]=_0x43d19b[_0xa4a7('0x76')];logger[_0xa4a7('0x6a')](util[_0xa4a7('0x54')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x20c788));return startTranscribe(_0x36415e,_0x3b43ea,_0x503562,uuidv4(),_0x4b2db3,_0x43d19b[_0xa4a7('0x76')]);})[_0xa4a7('0x26')](function(_0x51e3c9){logger[_0xa4a7('0x6a')](util[_0xa4a7('0x54')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x20c788,_0x51e3c9[_0xa4a7('0x7a')]['TranscriptionJobName']));_0x3632e6[_0xa4a7('0x7b')]=_0x51e3c9['TranscriptionJob'][_0xa4a7('0x7c')];_0x3632e6[_0xa4a7('0x7d')]=_0x51e3c9['TranscriptionJob'][_0xa4a7('0x7e')];return _0x370353(_0x3632e6);})[_0xa4a7('0x48')](function(_0x1c551f){return _0x560967(_0x1c551f);});});}exports[_0xa4a7('0x7f')]=function(_0x4c581e,_0x1a0fb2,_0x596a07){var _0x4cf70c;var _0x21f3dc;var _0x27a809;var _0x351ca4=require('../../components/encryptor');return db[_0xa4a7('0x2e')][_0xa4a7('0x80')]({'where':{'id':_0x4c581e[_0xa4a7('0x4e')]['id']}})[_0xa4a7('0x26')](function(_0x905a00){if(_0x905a00){var _0x43ace6=util[_0xa4a7('0x54')](_0xa4a7('0x55'),_0x905a00[_0xa4a7('0x53')]);if(fs['existsSync'](_0x43ace6)){cypher=!![];return _0x351ca4['decryptFile'](_0x43ace6,_0x905a00[_0xa4a7('0x53')],config[_0xa4a7('0x81')][_0xa4a7('0x58')])[_0xa4a7('0x26')](function(){return _0x905a00;});}return _0x905a00;}})[_0xa4a7('0x26')](function(_0x590ea4){if(!_0x590ea4){throw new db[(_0xa4a7('0x59'))][(_0xa4a7('0x5a'))](_0xa4a7('0x82'));}_0x21f3dc=_0x590ea4;return db['Setting'][_0xa4a7('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x1a0fb2,null))['then'](function(_0x2f4cbc){if(_0x2f4cbc){_0x4cf70c=_0x2f4cbc;if(!_0x4cf70c[_0xa4a7('0x83')]||!_0x4cf70c[_0xa4a7('0x84')]||!_0x4cf70c[_0xa4a7('0x85')]||!_0x4cf70c['language']||!_0x4cf70c[_0xa4a7('0x77')]){throw new db[(_0xa4a7('0x59'))][(_0xa4a7('0x5a'))](_0xa4a7('0x86'));}if(_0x4c581e['body']['runSentiment']&&(!_0x4cf70c[_0xa4a7('0x87')]||!_0x4cf70c[_0xa4a7('0x88')]||!_0x4cf70c[_0xa4a7('0x89')]||!_0x4cf70c[_0xa4a7('0x8a')]||!_0x4cf70c[_0xa4a7('0x77')])){throw new db[(_0xa4a7('0x59'))][(_0xa4a7('0x5a'))](_0xa4a7('0x8b'));}return db[_0xa4a7('0x8c')][_0xa4a7('0x80')]({'where':{'id':_0x4cf70c[_0xa4a7('0x84')]}});}})[_0xa4a7('0x26')](function(_0x189ca3){if(!_0x189ca3){throw new db[(_0xa4a7('0x59'))]['ValidationError'](_0xa4a7('0x8d'));}if(!_0x189ca3[_0xa4a7('0x8e')]||!_0x189ca3[_0xa4a7('0x8f')]){throw new db['Sequelize'][(_0xa4a7('0x5a'))](_0xa4a7('0x90'));}_0x27a809=_0x189ca3;return getBucketslist(_0x27a809[_0xa4a7('0x8e')],_0x27a809[_0xa4a7('0x8f')],_0x4cf70c[_0xa4a7('0x85')]);})[_0xa4a7('0x26')](function(_0x486502){if(_0x486502&&_0x486502[_0xa4a7('0x91')]){var _0x1c8b7b=_[_0xa4a7('0x4b')](_0x486502['Buckets'],function(_0x4be25a){return _0x4be25a[_0xa4a7('0x92')]===_0x4cf70c[_0xa4a7('0x77')];});if(!_0x1c8b7b){logger[_0xa4a7('0x6a')](util['format'](_0xa4a7('0x93'),_0x4c581e['params']['id'],_0x4cf70c[_0xa4a7('0x77')]));return createBucket(_0x27a809[_0xa4a7('0x8e')],_0x27a809[_0xa4a7('0x8f')],_0x4cf70c[_0xa4a7('0x85')],_0x4cf70c[_0xa4a7('0x77')]);}logger[_0xa4a7('0x6a')](util[_0xa4a7('0x54')](_0xa4a7('0x94'),_0x4c581e[_0xa4a7('0x4e')]['id'],_0x4cf70c['bucket']));return;}})[_0xa4a7('0x26')](function(_0x53ce0f){if(_0x21f3dc[_0xa4a7('0x7d')]===_0xa4a7('0x95')){return transcribe(_0x4c581e['params']['id'],_0x27a809[_0xa4a7('0x8e')],_0x27a809[_0xa4a7('0x8f')],_0x4cf70c['transcribeRegion'],_0x4cf70c[_0xa4a7('0x77')],_0x21f3dc[_0xa4a7('0x53')],_0x4cf70c[_0xa4a7('0x8a')]);}else{logger[_0xa4a7('0x6a')](util[_0xa4a7('0x54')](_0xa4a7('0x96'),_0x4c581e[_0xa4a7('0x4e')]['id']));return{'transcribeStatus':_0xa4a7('0x97')};}})[_0xa4a7('0x26')](function(_0x3745ca){if(_0x3745ca){_0x3745ca[_0xa4a7('0x98')]=_0x4c581e[_0xa4a7('0x4d')]['runSentiment'];return _0x21f3dc['updateAttributes'](_0x3745ca);}})[_0xa4a7('0x26')](respondWithResult(_0x1a0fb2,null))['catch'](handleError(_0x1a0fb2,null));};function writeFile(_0x444ff2,_0x3d1fa9){return new Promise(function(_0x19df98,_0x3fc5fd){fs['writeFile'](_0x3d1fa9,_0x444ff2,function(_0x798f87,_0x236e16){if(_0x798f87){return _0x3fc5fd(_0x798f87);}else{return _0x19df98(_0x236e16);}});});}exports['downloadTranscribe']=function(_0x5dfc9e,_0x45328b,_0x2391de){return db[_0xa4a7('0x2e')][_0xa4a7('0x80')]({'where':{'id':_0x5dfc9e[_0xa4a7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45328b))[_0xa4a7('0x26')](function(_0x7e448f){if(_0x7e448f&&_0x7e448f['fileText']){var _0x7d90ef=_0x7e448f[_0xa4a7('0x99')];var _0x4af1bc=config[_0xa4a7('0x9a')]+'/server/files/transcribes/transcribe_'+_0x7e448f['id']+_0xa4a7('0x9b');if(fs['existsSync'](_0x4af1bc)){return _0x4af1bc;}return writeFile(_0x7d90ef,_0x4af1bc)[_0xa4a7('0x26')](function(){return _0x4af1bc;});}else{throw new db['Sequelize'][(_0xa4a7('0x5a'))]('Transcript\x20not\x20available');}})[_0xa4a7('0x26')](function(_0x490c18){return _0x45328b[_0xa4a7('0x50')](_0x490c18);})[_0xa4a7('0x48')](handleError(_0x45328b));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 4833f00..98e7fc5 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 _0xa5d1=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x51b9bc,_0x49c60d){var _0x4fec5b=function(_0xbb4d50){while(--_0xbb4d50){_0x51b9bc['push'](_0x51b9bc['shift']());}};_0x4fec5b(++_0x49c60d);}(_0xa5d1,0x8c));var _0x1a5d=function(_0x4be4c3,_0x39878a){_0x4be4c3=_0x4be4c3-0x0;var _0x4969c8=_0xa5d1[_0x4be4c3];return _0x4969c8;};'use strict';var _=require(_0x1a5d('0x0'));var util=require(_0x1a5d('0x1'));var logger=require('../../config/logger')(_0x1a5d('0x2'));var moment=require(_0x1a5d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a5d('0x4'));var fs=require('fs');var path=require(_0x1a5d('0x5'));var rimraf=require(_0x1a5d('0x6'));var config=require(_0x1a5d('0x7'));var attributes=require(_0x1a5d('0x8'));module[_0x1a5d('0x9')]=function(_0x5c5028,_0x1a008d){return _0x5c5028[_0x1a5d('0xa')](_0x1a5d('0xb'),attributes,{'tableName':_0x1a5d('0xc'),'paranoid':![],'indexes':[{'name':_0x1a5d('0xd'),'fields':[_0x1a5d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf819=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceRecording','voice_recordings'];(function(_0x46c6aa,_0x136572){var _0x510a6b=function(_0x15d3de){while(--_0x15d3de){_0x46c6aa['push'](_0x46c6aa['shift']());}};_0x510a6b(++_0x136572);}(_0xf819,0x9d));var _0x9f81=function(_0x4e9b5f,_0xbfb45b){_0x4e9b5f=_0x4e9b5f-0x0;var _0x23a694=_0xf819[_0x4e9b5f];return _0x23a694;};'use strict';var _=require(_0x9f81('0x0'));var util=require(_0x9f81('0x1'));var logger=require('../../config/logger')(_0x9f81('0x2'));var moment=require(_0x9f81('0x3'));var BPromise=require(_0x9f81('0x4'));var rp=require(_0x9f81('0x5'));var fs=require('fs');var path=require(_0x9f81('0x6'));var rimraf=require('rimraf');var config=require(_0x9f81('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x9f81('0x8')]=function(_0x17e097,_0x54d281){return _0x17e097[_0x9f81('0x9')](_0x9f81('0xa'),attributes,{'tableName':_0x9f81('0xb'),'paranoid':![],'indexes':[{'name':_0x9f81('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b85f0a0..d8fee56 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4fbf45,_0x185249){var _0x19e317=function(_0x10686d){while(--_0x10686d){_0x4fbf45['push'](_0x4fbf45['shift']());}};_0x19e317(++_0x185249);}(_0x1623,0xab));var _0x3162=function(_0x6ccc07,_0x53ab50){_0x6ccc07=_0x6ccc07-0x0;var _0x3001b4=_0x1623[_0x6ccc07];return _0x3001b4;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')](_0x1eed46[_0x3162('0x19')],{'raw':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1b')]||null:null,'attributes':_0x1eed46[_0x3162('0x1a')]?_0x1eed46['options']['attributes']||null:null,'limit':_0x1eed46[_0x3162('0x1a')]?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1c')]||null:null})[_0x3162('0xa')](function(_0x31b27b){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger[_0x3162('0xc')]('UpdateVoiceRecording',_0x1eed46,JSON[_0x3162('0xf')](_0x31b27b));_0x4b2bf3(_0x31b27b);})[_0x3162('0x15')](function(_0x3919e7){logger[_0x3162('0x10')](_0x3162('0x16'),_0x3919e7[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97[_0x3162('0x10')](0x1f4,_0x3919e7[_0x3162('0x13')]));});});};exports[_0x3162('0x1d')]=function(_0x356c5d){var _0x8fa09f=this;return new Promise(function(_0x2f62d7,_0x1c03a4){var _0x48de45=require(_0x3162('0x1e'));var _0x552469;return db[_0x3162('0x1f')][_0x3162('0x20')]({'attributes':['id',_0x3162('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4903e7){_0x552469=_0x4903e7;return db[_0x3162('0x17')][_0x3162('0x22')](_0x356c5d[_0x3162('0x19')]);})[_0x3162('0xa')](function(_0x2f88ec){if(_0x552469['callRecordingEncryption']&&fs[_0x3162('0x23')](_0x2f88ec['value'])){var _0xf11765=util[_0x3162('0x24')](_0x3162('0x25'),_0x2f88ec[_0x3162('0x26')]);return _0x48de45[_0x3162('0x27')](_0x2f88ec[_0x3162('0x26')],_0xf11765,config[_0x3162('0x28')][_0x3162('0x29')])['then'](function(){fs[_0x3162('0x2a')](_0x2f88ec[_0x3162('0x26')]);logger['info'](_0x3162('0x2b'));return _0x2f88ec;});}return _0x2f88ec;})[_0x3162('0xa')](function(_0x528340){logger['info'](_0x3162('0x1d'),_0x356c5d);logger['debug'](_0x3162('0x1d'),_0x356c5d,JSON[_0x3162('0xf')](_0x528340));_0x2f62d7(_0x528340);})[_0x3162('0x15')](function(_0x551442){logger['error'](_0x3162('0x1d'),_0x551442[_0x3162('0x13')],_0x356c5d);_0x1c03a4(_0x8fa09f['error'](0x1f4,_0x551442[_0x3162('0x13')]));});});}; \ No newline at end of file +var _0x4991=['where','attributes','limit','catch','VoiceRecording','create','existsSync','value','%s.cypher','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateVoiceRecording','update','body','options','raw'];(function(_0x28e2a6,_0x34933f){var _0x589aca=function(_0x22ba2a){while(--_0x22ba2a){_0x28e2a6['push'](_0x28e2a6['shift']());}};_0x589aca(++_0x34933f);}(_0x4991,0xf7));var _0x1499=function(_0x26ca44,_0x16372b){_0x26ca44=_0x26ca44-0x0;var _0x5a3150=_0x4991[_0x26ca44];return _0x5a3150;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['VoiceRecording'][_0x1499('0x16')](_0x1e45a9[_0x1499('0x17')],{'raw':_0x1e45a9['options']?_0x1e45a9[_0x1499('0x18')][_0x1499('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1a')]||null:null,'attributes':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1b')]||null:null,'limit':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1c')]||null:null})[_0x1499('0xc')](function(_0x223f4c){logger[_0x1499('0xd')](_0x1499('0x15'),_0x1e45a9);logger[_0x1499('0xf')](_0x1499('0x15'),_0x1e45a9,JSON['stringify'](_0x223f4c));_0x5b9859(_0x223f4c);})[_0x1499('0x1d')](function(_0xc79f69){logger[_0x1499('0x12')](_0x1499('0x15'),_0xc79f69[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533[_0x1499('0x12')](0x1f4,_0xc79f69['message']));});});};exports['CreateVoiceRecording']=function(_0x12739b){var _0x3c9aca=this;return new Promise(function(_0x3b9259,_0x50f0cc){var _0x32782a=require('../../components/encryptor');var _0x3e5ed1;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x1499('0xc')](function(_0x103efa){_0x3e5ed1=_0x103efa;return db[_0x1499('0x1e')][_0x1499('0x1f')](_0x12739b[_0x1499('0x17')]);})[_0x1499('0xc')](function(_0x3dd534){if(_0x3e5ed1['callRecordingEncryption']&&fs[_0x1499('0x20')](_0x3dd534[_0x1499('0x21')])){var _0x39995b=util['format'](_0x1499('0x22'),_0x3dd534[_0x1499('0x21')]);return _0x32782a['encryptFile'](_0x3dd534[_0x1499('0x21')],_0x39995b,config[_0x1499('0x23')]['recording'])[_0x1499('0xc')](function(){fs[_0x1499('0x24')](_0x3dd534[_0x1499('0x21')]);logger[_0x1499('0xd')](_0x1499('0x25'));return _0x3dd534;});}return _0x3dd534;})[_0x1499('0xc')](function(_0x7b4d75){logger[_0x1499('0xd')](_0x1499('0x26'),_0x12739b);logger[_0x1499('0xf')](_0x1499('0x26'),_0x12739b,JSON[_0x1499('0x11')](_0x7b4d75));_0x3b9259(_0x7b4d75);})[_0x1499('0x1d')](function(_0x3f4c1a){logger[_0x1499('0x12')](_0x1499('0x26'),_0x3f4c1a[_0x1499('0x13')],_0x12739b);_0x50f0cc(_0x3c9aca[_0x1499('0x12')](0x1f4,_0x3f4c1a[_0x1499('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 053d9a8..5af2ece 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 _0xe1ee=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xe1ee,0x89));var _0xee1e=function(_0xfd7b8,_0x4b30c4){_0xfd7b8=_0xfd7b8-0x0;var _0x494707=_0xe1ee[_0xfd7b8];return _0x494707;};'use strict';var multer=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var path=require(_0xee1e('0x2'));var timeout=require(_0xee1e('0x3'));var express=require(_0xee1e('0x4'));var router=express[_0xee1e('0x5')]();var fs_extra=require(_0xee1e('0x6'));var auth=require(_0xee1e('0x7'));var interaction=require(_0xee1e('0x8'));var config=require(_0xee1e('0x9'));var controller=require(_0xee1e('0xa'));router[_0xee1e('0xb')]('/',auth[_0xee1e('0xc')](),controller[_0xee1e('0xd')]);router[_0xee1e('0xb')](_0xee1e('0xe'),auth[_0xee1e('0xc')](),controller[_0xee1e('0xf')]);router[_0xee1e('0xb')]('/:id',auth[_0xee1e('0xc')](),controller[_0xee1e('0x10')]);router[_0xee1e('0x11')]('/',auth[_0xee1e('0xc')](),controller[_0xee1e('0x12')]);router[_0xee1e('0x13')](_0xee1e('0x14'),auth[_0xee1e('0xc')](),controller['update']);router[_0xee1e('0x15')]('/:id',auth[_0xee1e('0xc')](),controller[_0xee1e('0x16')]);module[_0xee1e('0x17')]=router; \ No newline at end of file +var _0xd922=['put','update','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x1c62f7,_0xf46da3){var _0x1e07e6=function(_0x461240){while(--_0x461240){_0x1c62f7['push'](_0x1c62f7['shift']());}};_0x1e07e6(++_0xf46da3);}(_0xd922,0xb9));var _0x2d92=function(_0x45b459,_0x32df29){_0x45b459=_0x45b459-0x0;var _0x318c0a=_0xd922[_0x45b459];return _0x318c0a;};'use strict';var multer=require(_0x2d92('0x0'));var util=require('util');var path=require(_0x2d92('0x1'));var timeout=require(_0x2d92('0x2'));var express=require(_0x2d92('0x3'));var router=express['Router']();var fs_extra=require(_0x2d92('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d92('0x5'));var config=require(_0x2d92('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x2d92('0x7')]('/',auth[_0x2d92('0x8')](),controller[_0x2d92('0x9')]);router[_0x2d92('0x7')](_0x2d92('0xa'),auth[_0x2d92('0x8')](),controller[_0x2d92('0xb')]);router[_0x2d92('0x7')]('/:id',auth[_0x2d92('0x8')](),controller[_0x2d92('0xc')]);router[_0x2d92('0xd')]('/',auth['isAuthenticated'](),controller[_0x2d92('0xe')]);router[_0x2d92('0xf')]('/:id',auth[_0x2d92('0x8')](),controller[_0x2d92('0x10')]);router['delete'](_0x2d92('0x11'),auth['isAuthenticated'](),controller[_0x2d92('0x12')]);module[_0x2d92('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 710ab3b..1e6d681 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 _0x6f4d=['exports','ENUM','STRING','Yes','sequelize'];(function(_0x4a113f,_0x56a686){var _0x4c2737=function(_0x1bd30c){while(--_0x1bd30c){_0x4a113f['push'](_0x4a113f['shift']());}};_0x4c2737(++_0x56a686);}(_0x6f4d,0x15d));var _0xd6f4=function(_0x3f6248,_0x4691c3){_0x3f6248=_0x3f6248-0x0;var _0x45045c=_0x6f4d[_0x3f6248];return _0x45045c;};'use strict';var Sequelize=require(_0xd6f4('0x0'));var moment=require('moment');module[_0xd6f4('0x1')]={'type':{'type':Sequelize[_0xd6f4('0x2')]('blind','attended')},'result':{'type':Sequelize[_0xd6f4('0x3')]},'transfererchannel':{'type':Sequelize[_0xd6f4('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xd6f4('0x3')]},'transferercalleridname':{'type':Sequelize[_0xd6f4('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd6f4('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xd6f4('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xd6f4('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xd6f4('0x3')]},'transfereechannel':{'type':Sequelize[_0xd6f4('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xd6f4('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd6f4('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd6f4('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xd6f4('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xd6f4('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xd6f4('0x3')]},'isexternal':{'type':Sequelize[_0xd6f4('0x2')](_0xd6f4('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xd6f4('0x3')]}}; \ No newline at end of file +var _0x6c2c=['ENUM','STRING','sequelize','moment','exports'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x6c2c,0x188));var _0xc6c2=function(_0x4f4dc4,_0x352a8f){_0x4f4dc4=_0x4f4dc4-0x0;var _0x49bb0e=_0x6c2c[_0x4f4dc4];return _0x49bb0e;};'use strict';var Sequelize=require(_0xc6c2('0x0'));var moment=require(_0xc6c2('0x1'));module[_0xc6c2('0x2')]={'type':{'type':Sequelize[_0xc6c2('0x3')]('blind','attended')},'result':{'type':Sequelize[_0xc6c2('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xc6c2('0x4')]},'transferercalleridname':{'type':Sequelize[_0xc6c2('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xc6c2('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xc6c2('0x4')]},'transferercontext':{'type':Sequelize[_0xc6c2('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xc6c2('0x4')]},'transfereechannel':{'type':Sequelize[_0xc6c2('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xc6c2('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xc6c2('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc6c2('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xc6c2('0x4')]},'transfereecontext':{'type':Sequelize[_0xc6c2('0x4')]},'transfereeexten':{'type':Sequelize[_0xc6c2('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xc6c2('0x4')]},'isexternal':{'type':Sequelize[_0xc6c2('0x3')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc6c2('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 34e79b1..55fbab0 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 _0xebbd=['create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','count','set','apply','reject','save','update','destroy','error','stack','name','VoiceTransferReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','type','VIRTUAL','options','then','includeAll','include','catch','show','params','find'];(function(_0xcbd50d,_0x349854){var _0x53b7e4=function(_0x3b0745){while(--_0x3b0745){_0xcbd50d['push'](_0xcbd50d['shift']());}};_0x53b7e4(++_0x349854);}(_0xebbd,0x19b));var _0xdebb=function(_0x52f1f9,_0x171046){_0x52f1f9=_0x52f1f9-0x0;var _0x178fc2=_0xebbd[_0x52f1f9];return _0x178fc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdebb('0x0'));var zipdir=require(_0xdebb('0x1'));var jsonpatch=require(_0xdebb('0x2'));var rp=require(_0xdebb('0x3'));var moment=require(_0xdebb('0x4'));var BPromise=require(_0xdebb('0x5'));var Mustache=require('mustache');var util=require(_0xdebb('0x6'));var path=require('path');var sox=require(_0xdebb('0x7'));var csv=require(_0xdebb('0x8'));var ejs=require(_0xdebb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdebb('0xa'));var crypto=require(_0xdebb('0xb'));var jsforce=require(_0xdebb('0xc'));var deskjs=require(_0xdebb('0xd'));var toCsv=require(_0xdebb('0x8'));var querystring=require('querystring');var Papa=require(_0xdebb('0xe'));var Redis=require('ioredis');var authService=require(_0xdebb('0xf'));var qs=require(_0xdebb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdebb('0x11'));var logger=require(_0xdebb('0x12'))('api');var utils=require(_0xdebb('0x13'));var config=require(_0xdebb('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdebb('0x15'))['db'];function respondWithStatusCode(_0x4d2953,_0x244c4e){_0x244c4e=_0x244c4e||0xcc;return function(_0x1fdd55){if(_0x1fdd55){return _0x4d2953['sendStatus'](_0x244c4e);}return _0x4d2953[_0xdebb('0x16')](_0x244c4e)[_0xdebb('0x17')]();};}function respondWithResult(_0x3741e7,_0x287fa6){_0x287fa6=_0x287fa6||0xc8;return function(_0x2ed4d6){if(_0x2ed4d6){return _0x3741e7['status'](_0x287fa6)['json'](_0x2ed4d6);}};}function respondWithFilteredResult(_0x21ef44,_0x3c80b4){return function(_0x1ae4dd){if(_0x1ae4dd){var _0x5dfa90=typeof _0x3c80b4[_0xdebb('0x18')]==='undefined'&&typeof _0x3c80b4[_0xdebb('0x19')]==='undefined';var _0xa3244a=_0x1ae4dd[_0xdebb('0x1a')];var _0x5d00c9=_0x5dfa90?0x0:_0x3c80b4[_0xdebb('0x18')];var _0x32fad4=_0x5dfa90?_0x1ae4dd[_0xdebb('0x1a')]:_0x3c80b4['offset']+_0x3c80b4[_0xdebb('0x19')];var _0x4f3dff;if(_0x32fad4>=_0xa3244a){_0x32fad4=_0xa3244a;_0x4f3dff=0xc8;}else{_0x4f3dff=0xce;}_0x21ef44[_0xdebb('0x16')](_0x4f3dff);return _0x21ef44[_0xdebb('0x1b')]('Content-Range',_0x5d00c9+'-'+_0x32fad4+'/'+_0xa3244a)['json'](_0x1ae4dd);}return null;};}function patchUpdates(_0x52dcd3){return function(_0x63155d){try{jsonpatch[_0xdebb('0x1c')](_0x63155d,_0x52dcd3,!![]);}catch(_0x265fa4){return BPromise[_0xdebb('0x1d')](_0x265fa4);}return _0x63155d[_0xdebb('0x1e')]();};}function saveUpdates(_0xc5b683,_0x2f679a){return function(_0x195224){if(_0x195224){return _0x195224[_0xdebb('0x1f')](_0xc5b683)['then'](function(_0x44bf55){return _0x44bf55;});}return null;};}function removeEntity(_0x4bd39d,_0x187a52){return function(_0x4cf27d){if(_0x4cf27d){return _0x4cf27d[_0xdebb('0x20')]()['then'](function(){_0x4bd39d[_0xdebb('0x16')](0xcc)[_0xdebb('0x17')]();});}};}function handleEntityNotFound(_0x17774d,_0x11e138){return function(_0x290b70){if(!_0x290b70){_0x17774d['sendStatus'](0x194);}return _0x290b70;};}function handleError(_0x2fb038,_0x1e096d){_0x1e096d=_0x1e096d||0x1f4;return function(_0x4ad02a){logger[_0xdebb('0x21')](_0x4ad02a[_0xdebb('0x22')]);if(_0x4ad02a[_0xdebb('0x23')]){delete _0x4ad02a[_0xdebb('0x23')];}_0x2fb038[_0xdebb('0x16')](_0x1e096d)['send'](_0x4ad02a);};}exports['index']=function(_0x1e07ac,_0x18f451){var _0x3b06c7={},_0x2e326b={},_0x3b0387={'count':0x0,'rows':[]};var _0x329306=_['map'](db[_0xdebb('0x24')][_0xdebb('0x25')],function(_0x1c86ff){return{'name':_0x1c86ff[_0xdebb('0x26')],'type':_0x1c86ff['type'][_0xdebb('0x27')]};});_0x2e326b[_0xdebb('0x28')]=_[_0xdebb('0x29')](_0x329306,_0xdebb('0x23'));_0x2e326b[_0xdebb('0x2a')]=_[_0xdebb('0x2b')](_0x1e07ac[_0xdebb('0x2a')]);_0x2e326b['filters']=_[_0xdebb('0x2c')](_0x2e326b[_0xdebb('0x28')],_0x2e326b['query']);_0x3b06c7[_0xdebb('0x2d')]=_[_0xdebb('0x2c')](_0x2e326b[_0xdebb('0x28')],qs[_0xdebb('0x2e')](_0x1e07ac[_0xdebb('0x2a')][_0xdebb('0x2e')]));_0x3b06c7[_0xdebb('0x2d')]=_0x3b06c7[_0xdebb('0x2d')][_0xdebb('0x2f')]?_0x3b06c7['attributes']:_0x2e326b[_0xdebb('0x28')];if(!_0x1e07ac[_0xdebb('0x2a')][_0xdebb('0x30')](_0xdebb('0x31'))){_0x3b06c7[_0xdebb('0x19')]=qs[_0xdebb('0x19')](_0x1e07ac[_0xdebb('0x2a')]['limit']);_0x3b06c7[_0xdebb('0x18')]=qs[_0xdebb('0x18')](_0x1e07ac[_0xdebb('0x2a')][_0xdebb('0x18')]);}_0x3b06c7[_0xdebb('0x32')]=qs['sort'](_0x1e07ac[_0xdebb('0x2a')]['sort']);_0x3b06c7[_0xdebb('0x33')]=qs[_0xdebb('0x34')](_[_0xdebb('0x35')](_0x1e07ac[_0xdebb('0x2a')],_0x2e326b[_0xdebb('0x34')]),_0x329306);if(_0x1e07ac[_0xdebb('0x2a')]['filter']){_0x3b06c7[_0xdebb('0x33')]=_[_0xdebb('0x36')](_0x3b06c7[_0xdebb('0x33')],{'$or':_['map'](_0x329306,function(_0x7cc97f){if(_0x7cc97f[_0xdebb('0x37')]!==_0xdebb('0x38')){var _0x5641d1={};_0x5641d1[_0x7cc97f['name']]={'$like':'%'+_0x1e07ac[_0xdebb('0x2a')]['filter']+'%'};return _0x5641d1;}})});}_0x3b06c7=_['merge']({},_0x3b06c7,_0x1e07ac[_0xdebb('0x39')]);var _0x16996e={'where':_0x3b06c7[_0xdebb('0x33')]};return db[_0xdebb('0x24')]['count'](_0x16996e)[_0xdebb('0x3a')](function(_0x53fa32){_0x3b0387[_0xdebb('0x1a')]=_0x53fa32;if(_0x1e07ac[_0xdebb('0x2a')][_0xdebb('0x3b')]){_0x3b06c7[_0xdebb('0x3c')]=[{'all':!![]}];}return db[_0xdebb('0x24')]['findAll'](_0x3b06c7);})[_0xdebb('0x3a')](function(_0x1a0d23){_0x3b0387['rows']=_0x1a0d23;return _0x3b0387;})['then'](respondWithFilteredResult(_0x18f451,_0x3b06c7))[_0xdebb('0x3d')](handleError(_0x18f451,null));};exports[_0xdebb('0x3e')]=function(_0xfe2dc0,_0x9f3a51){var _0x1f09c3={'raw':!![],'where':{'id':_0xfe2dc0[_0xdebb('0x3f')]['id']}},_0x4f35bc={};_0x4f35bc['model']=_[_0xdebb('0x2b')](db[_0xdebb('0x24')][_0xdebb('0x25')]);_0x4f35bc[_0xdebb('0x2a')]=_['keys'](_0xfe2dc0[_0xdebb('0x2a')]);_0x4f35bc[_0xdebb('0x34')]=_[_0xdebb('0x2c')](_0x4f35bc['model'],_0x4f35bc[_0xdebb('0x2a')]);_0x1f09c3[_0xdebb('0x2d')]=_[_0xdebb('0x2c')](_0x4f35bc[_0xdebb('0x28')],qs[_0xdebb('0x2e')](_0xfe2dc0['query'][_0xdebb('0x2e')]));_0x1f09c3[_0xdebb('0x2d')]=_0x1f09c3[_0xdebb('0x2d')][_0xdebb('0x2f')]?_0x1f09c3[_0xdebb('0x2d')]:_0x4f35bc[_0xdebb('0x28')];if(_0xfe2dc0['query']['includeAll']){_0x1f09c3[_0xdebb('0x3c')]=[{'all':!![]}];}_0x1f09c3=_[_0xdebb('0x36')]({},_0x1f09c3,_0xfe2dc0[_0xdebb('0x39')]);return db[_0xdebb('0x24')][_0xdebb('0x40')](_0x1f09c3)[_0xdebb('0x3a')](handleEntityNotFound(_0x9f3a51,null))[_0xdebb('0x3a')](respondWithResult(_0x9f3a51,null))[_0xdebb('0x3d')](handleError(_0x9f3a51,null));};exports[_0xdebb('0x41')]=function(_0x128940,_0x1127e5){return db[_0xdebb('0x24')]['create'](_0x128940[_0xdebb('0x42')],{})[_0xdebb('0x3a')](respondWithResult(_0x1127e5,0xc9))[_0xdebb('0x3d')](handleError(_0x1127e5,null));};exports[_0xdebb('0x1f')]=function(_0x179a6f,_0x39e621){if(_0x179a6f[_0xdebb('0x42')]['id']){delete _0x179a6f[_0xdebb('0x42')]['id'];}return db[_0xdebb('0x24')][_0xdebb('0x40')]({'where':{'id':_0x179a6f['params']['id']}})['then'](handleEntityNotFound(_0x39e621,null))['then'](saveUpdates(_0x179a6f[_0xdebb('0x42')],null))[_0xdebb('0x3a')](respondWithResult(_0x39e621,null))[_0xdebb('0x3d')](handleError(_0x39e621,null));};exports[_0xdebb('0x20')]=function(_0x51bf58,_0x52ca27){return db[_0xdebb('0x24')][_0xdebb('0x40')]({'where':{'id':_0x51bf58[_0xdebb('0x3f')]['id']}})[_0xdebb('0x3a')](handleEntityNotFound(_0x52ca27,null))['then'](removeEntity(_0x52ca27,null))[_0xdebb('0x3d')](handleError(_0x52ca27,null));};exports[_0xdebb('0x43')]=function(_0x3ea2d7,_0xec4e1b){return db[_0xdebb('0x24')][_0xdebb('0x43')]()['then'](respondWithResult(_0xec4e1b,null))['catch'](handleError(_0xec4e1b,null));}; \ No newline at end of file +var _0xdeda=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VoiceTransferReport','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','rawAttributes','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xdeda,0x17e));var _0xaded=function(_0x5da877,_0x361726){_0x5da877=_0x5da877-0x0;var _0x3f2c10=_0xdeda[_0x5da877];return _0x3f2c10;};'use strict';var emlformat=require(_0xaded('0x0'));var rimraf=require(_0xaded('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaded('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaded('0x3'));var Mustache=require(_0xaded('0x4'));var util=require(_0xaded('0x5'));var path=require('path');var sox=require(_0xaded('0x6'));var csv=require(_0xaded('0x7'));var ejs=require(_0xaded('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaded('0x9'));var squel=require(_0xaded('0xa'));var crypto=require(_0xaded('0xb'));var jsforce=require(_0xaded('0xc'));var deskjs=require(_0xaded('0xd'));var toCsv=require(_0xaded('0x7'));var querystring=require(_0xaded('0xe'));var Papa=require(_0xaded('0xf'));var Redis=require(_0xaded('0x10'));var authService=require(_0xaded('0x11'));var qs=require(_0xaded('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaded('0x13'));var logger=require(_0xaded('0x14'))(_0xaded('0x15'));var utils=require('../../config/utils');var config=require(_0xaded('0x16'));var licenseUtil=require(_0xaded('0x17'));var db=require(_0xaded('0x18'))['db'];function respondWithStatusCode(_0x1d2ba3,_0x344892){_0x344892=_0x344892||0xcc;return function(_0x31a256){if(_0x31a256){return _0x1d2ba3[_0xaded('0x19')](_0x344892);}return _0x1d2ba3[_0xaded('0x1a')](_0x344892)[_0xaded('0x1b')]();};}function respondWithResult(_0xb2c787,_0x10aeb1){_0x10aeb1=_0x10aeb1||0xc8;return function(_0x41adb9){if(_0x41adb9){return _0xb2c787[_0xaded('0x1a')](_0x10aeb1)[_0xaded('0x1c')](_0x41adb9);}};}function respondWithFilteredResult(_0x4f987f,_0x3cdb54){return function(_0x4cbfaa){if(_0x4cbfaa){var _0xc7bdfb=typeof _0x3cdb54[_0xaded('0x1d')]==='undefined'&&typeof _0x3cdb54['limit']===_0xaded('0x1e');var _0x4b5a24=_0x4cbfaa[_0xaded('0x1f')];var _0x4c4b75=_0xc7bdfb?0x0:_0x3cdb54[_0xaded('0x1d')];var _0x148280=_0xc7bdfb?_0x4cbfaa[_0xaded('0x1f')]:_0x3cdb54[_0xaded('0x1d')]+_0x3cdb54[_0xaded('0x20')];var _0x3422bb;if(_0x148280>=_0x4b5a24){_0x148280=_0x4b5a24;_0x3422bb=0xc8;}else{_0x3422bb=0xce;}_0x4f987f[_0xaded('0x1a')](_0x3422bb);return _0x4f987f['set'](_0xaded('0x21'),_0x4c4b75+'-'+_0x148280+'/'+_0x4b5a24)['json'](_0x4cbfaa);}return null;};}function patchUpdates(_0x427527){return function(_0xe97391){try{jsonpatch[_0xaded('0x22')](_0xe97391,_0x427527,!![]);}catch(_0x22f450){return BPromise[_0xaded('0x23')](_0x22f450);}return _0xe97391[_0xaded('0x24')]();};}function saveUpdates(_0xf67948,_0x217523){return function(_0xc6d24c){if(_0xc6d24c){return _0xc6d24c[_0xaded('0x25')](_0xf67948)['then'](function(_0x39beeb){return _0x39beeb;});}return null;};}function removeEntity(_0x34e270,_0x72d5a3){return function(_0x1a46cc){if(_0x1a46cc){return _0x1a46cc[_0xaded('0x26')]()[_0xaded('0x27')](function(){_0x34e270[_0xaded('0x1a')](0xcc)[_0xaded('0x1b')]();});}};}function handleEntityNotFound(_0x50a2cb,_0xd1def){return function(_0x5a3cfd){if(!_0x5a3cfd){_0x50a2cb[_0xaded('0x19')](0x194);}return _0x5a3cfd;};}function handleError(_0xbf4316,_0x52ce33){_0x52ce33=_0x52ce33||0x1f4;return function(_0xd033ad){logger['error'](_0xd033ad[_0xaded('0x28')]);if(_0xd033ad[_0xaded('0x29')]){delete _0xd033ad[_0xaded('0x29')];}_0xbf4316[_0xaded('0x1a')](_0x52ce33)[_0xaded('0x2a')](_0xd033ad);};}exports[_0xaded('0x2b')]=function(_0x3be0dd,_0x4dee8c){var _0x4e8716={},_0x5646b7={},_0x123a8a={'count':0x0,'rows':[]};var _0x1d0f22=_[_0xaded('0x2c')](db[_0xaded('0x2d')]['rawAttributes'],function(_0x448c5d){return{'name':_0x448c5d['fieldName'],'type':_0x448c5d[_0xaded('0x2e')][_0xaded('0x2f')]};});_0x5646b7['model']=_[_0xaded('0x2c')](_0x1d0f22,'name');_0x5646b7[_0xaded('0x30')]=_['keys'](_0x3be0dd[_0xaded('0x30')]);_0x5646b7[_0xaded('0x31')]=_[_0xaded('0x32')](_0x5646b7['model'],_0x5646b7['query']);_0x4e8716['attributes']=_[_0xaded('0x32')](_0x5646b7[_0xaded('0x33')],qs[_0xaded('0x34')](_0x3be0dd[_0xaded('0x30')][_0xaded('0x34')]));_0x4e8716[_0xaded('0x35')]=_0x4e8716[_0xaded('0x35')][_0xaded('0x36')]?_0x4e8716[_0xaded('0x35')]:_0x5646b7[_0xaded('0x33')];if(!_0x3be0dd['query'][_0xaded('0x37')](_0xaded('0x38'))){_0x4e8716[_0xaded('0x20')]=qs['limit'](_0x3be0dd[_0xaded('0x30')][_0xaded('0x20')]);_0x4e8716['offset']=qs[_0xaded('0x1d')](_0x3be0dd[_0xaded('0x30')][_0xaded('0x1d')]);}_0x4e8716[_0xaded('0x39')]=qs[_0xaded('0x3a')](_0x3be0dd[_0xaded('0x30')][_0xaded('0x3a')]);_0x4e8716['where']=qs[_0xaded('0x31')](_[_0xaded('0x3b')](_0x3be0dd[_0xaded('0x30')],_0x5646b7[_0xaded('0x31')]),_0x1d0f22);if(_0x3be0dd['query'][_0xaded('0x3c')]){_0x4e8716[_0xaded('0x3d')]=_[_0xaded('0x3e')](_0x4e8716[_0xaded('0x3d')],{'$or':_['map'](_0x1d0f22,function(_0x21acb3){if(_0x21acb3['type']!==_0xaded('0x3f')){var _0x118fb1={};_0x118fb1[_0x21acb3['name']]={'$like':'%'+_0x3be0dd[_0xaded('0x30')]['filter']+'%'};return _0x118fb1;}})});}_0x4e8716=_[_0xaded('0x3e')]({},_0x4e8716,_0x3be0dd['options']);var _0x3a25e7={'where':_0x4e8716[_0xaded('0x3d')]};return db[_0xaded('0x2d')][_0xaded('0x1f')](_0x3a25e7)[_0xaded('0x27')](function(_0x10b719){_0x123a8a[_0xaded('0x1f')]=_0x10b719;if(_0x3be0dd['query'][_0xaded('0x40')]){_0x4e8716['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0xaded('0x41')](_0x4e8716);})['then'](function(_0x5225eb){_0x123a8a[_0xaded('0x42')]=_0x5225eb;return _0x123a8a;})['then'](respondWithFilteredResult(_0x4dee8c,_0x4e8716))[_0xaded('0x43')](handleError(_0x4dee8c,null));};exports[_0xaded('0x44')]=function(_0x2b57e7,_0x3b4077){var _0x3d9031={'raw':!![],'where':{'id':_0x2b57e7['params']['id']}},_0x57b5d8={};_0x57b5d8[_0xaded('0x33')]=_[_0xaded('0x45')](db[_0xaded('0x2d')][_0xaded('0x46')]);_0x57b5d8['query']=_[_0xaded('0x45')](_0x2b57e7['query']);_0x57b5d8[_0xaded('0x31')]=_[_0xaded('0x32')](_0x57b5d8[_0xaded('0x33')],_0x57b5d8['query']);_0x3d9031['attributes']=_[_0xaded('0x32')](_0x57b5d8[_0xaded('0x33')],qs[_0xaded('0x34')](_0x2b57e7[_0xaded('0x30')][_0xaded('0x34')]));_0x3d9031[_0xaded('0x35')]=_0x3d9031['attributes'][_0xaded('0x36')]?_0x3d9031[_0xaded('0x35')]:_0x57b5d8['model'];if(_0x2b57e7[_0xaded('0x30')][_0xaded('0x40')]){_0x3d9031['include']=[{'all':!![]}];}_0x3d9031=_[_0xaded('0x3e')]({},_0x3d9031,_0x2b57e7[_0xaded('0x47')]);return db['VoiceTransferReport'][_0xaded('0x48')](_0x3d9031)[_0xaded('0x27')](handleEntityNotFound(_0x3b4077,null))[_0xaded('0x27')](respondWithResult(_0x3b4077,null))[_0xaded('0x43')](handleError(_0x3b4077,null));};exports[_0xaded('0x49')]=function(_0x28740c,_0x14f5ac){return db[_0xaded('0x2d')]['create'](_0x28740c[_0xaded('0x4a')],{})['then'](respondWithResult(_0x14f5ac,0xc9))['catch'](handleError(_0x14f5ac,null));};exports[_0xaded('0x25')]=function(_0xc2c620,_0xcc1345){if(_0xc2c620[_0xaded('0x4a')]['id']){delete _0xc2c620[_0xaded('0x4a')]['id'];}return db[_0xaded('0x2d')]['find']({'where':{'id':_0xc2c620[_0xaded('0x4b')]['id']}})['then'](handleEntityNotFound(_0xcc1345,null))[_0xaded('0x27')](saveUpdates(_0xc2c620[_0xaded('0x4a')],null))[_0xaded('0x27')](respondWithResult(_0xcc1345,null))['catch'](handleError(_0xcc1345,null));};exports['destroy']=function(_0x4f9239,_0x39dd87){return db[_0xaded('0x2d')][_0xaded('0x48')]({'where':{'id':_0x4f9239[_0xaded('0x4b')]['id']}})[_0xaded('0x27')](handleEntityNotFound(_0x39dd87,null))[_0xaded('0x27')](removeEntity(_0x39dd87,null))['catch'](handleError(_0x39dd87,null));};exports['describe']=function(_0x3966d7,_0x81be5f){return db[_0xaded('0x2d')][_0xaded('0x4c')]()['then'](respondWithResult(_0x81be5f,null))[_0xaded('0x43')](handleError(_0x81be5f,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6448a81..b1dace3 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 _0xc1fe=['bluebird','request-promise','path','../../config/environment','define','report_call_transfer','lodash','moment'];(function(_0x10f458,_0x392eef){var _0x29dae4=function(_0x119d32){while(--_0x119d32){_0x10f458['push'](_0x10f458['shift']());}};_0x29dae4(++_0x392eef);}(_0xc1fe,0x1ce));var _0xec1f=function(_0x4cd547,_0x548df1){_0x4cd547=_0x4cd547-0x0;var _0x4d0ebd=_0xc1fe[_0x4cd547];return _0x4d0ebd;};'use strict';var _=require(_0xec1f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xec1f('0x1'));var BPromise=require(_0xec1f('0x2'));var rp=require(_0xec1f('0x3'));var fs=require('fs');var path=require(_0xec1f('0x4'));var rimraf=require('rimraf');var config=require(_0xec1f('0x5'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x3a10ea,_0x34a905){return _0x3a10ea[_0xec1f('0x6')]('VoiceTransferReport',attributes,{'tableName':_0xec1f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98a8=['VoiceTransferReport','report_call_transfer','util','../../config/logger','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98a8,0x1ec));var _0x898a=function(_0x3ee80a,_0x2b9ad3){_0x3ee80a=_0x3ee80a-0x0;var _0x572055=_0x98a8[_0x3ee80a];return _0x572055;};'use strict';var _=require('lodash');var util=require(_0x898a('0x0'));var logger=require(_0x898a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x898a('0x2'));var fs=require('fs');var path=require(_0x898a('0x3'));var rimraf=require(_0x898a('0x4'));var config=require('../../config/environment');var attributes=require(_0x898a('0x5'));module[_0x898a('0x6')]=function(_0x4b36ee,_0x36ef23){return _0x4b36ee[_0x898a('0x7')](_0x898a('0x8'),attributes,{'tableName':_0x898a('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 b8bf830..936638a 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 _0x147a=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','create','options','info','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x26f68f,_0x125079){var _0x3047dd=function(_0xa2b931){while(--_0xa2b931){_0x26f68f['push'](_0x26f68f['shift']());}};_0x3047dd(++_0x125079);}(_0x147a,0x142));var _0xa147=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0x147a[_0x5b6cf1];return _0x46278c;};'use strict';var _=require('lodash');var util=require(_0xa147('0x0'));var moment=require('moment');var BPromise=require(_0xa147('0x1'));var rs=require(_0xa147('0x2'));var fs=require('fs');var Redis=require(_0xa147('0x3'));var db=require(_0xa147('0x4'))['db'];var utils=require(_0xa147('0x5'));var logger=require(_0xa147('0x6'))(_0xa147('0x7'));var config=require(_0xa147('0x8'));var jayson=require(_0xa147('0x9'));var client=jayson[_0xa147('0xa')][_0xa147('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20018e,_0x1a6406,_0x1c3d34){return new BPromise(function(_0x202efa,_0x4e2149){return client[_0xa147('0xc')](_0x20018e,_0x1c3d34)[_0xa147('0xd')](function(_0x52d12c){logger['info'](_0xa147('0xe'),_0x1a6406,_0xa147('0xf'));logger[_0xa147('0x10')](_0xa147('0x11'),_0x1a6406,_0xa147('0xf'),JSON[_0xa147('0x12')](_0x52d12c));if(_0x52d12c[_0xa147('0x13')]){if(_0x52d12c['error'][_0xa147('0x14')]===0x1f4){logger[_0xa147('0x13')](_0xa147('0xe'),_0x1a6406,_0x52d12c[_0xa147('0x13')][_0xa147('0x15')]);return _0x4e2149(_0x52d12c['error'][_0xa147('0x15')]);}logger[_0xa147('0x13')](_0xa147('0xe'),_0x1a6406,_0x52d12c[_0xa147('0x13')][_0xa147('0x15')]);return _0x202efa(_0x52d12c['error'][_0xa147('0x15')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1a6406,_0xa147('0xf'));_0x202efa(_0x52d12c[_0xa147('0x16')][_0xa147('0x15')]);}})[_0xa147('0x17')](function(_0x4ab9dd){logger[_0xa147('0x13')](_0xa147('0xe'),_0x1a6406,_0x4ab9dd);_0x4e2149(_0x4ab9dd);});});}exports[_0xa147('0x18')]=function(_0x1e13b5){var _0x209754=this;return new Promise(function(_0x5b977d,_0x4f6732){return db['VoiceTransferReport'][_0xa147('0x19')](_0x1e13b5['body'],{'raw':_0x1e13b5[_0xa147('0x1a')]?_0x1e13b5[_0xa147('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa147('0xd')](function(_0x4a019b){logger[_0xa147('0x1b')](_0xa147('0x18'),_0x1e13b5);logger[_0xa147('0x10')](_0xa147('0x18'),_0x1e13b5,JSON[_0xa147('0x12')](_0x4a019b));_0x5b977d(_0x4a019b);})[_0xa147('0x17')](function(_0x5c60fc){logger[_0xa147('0x13')](_0xa147('0x18'),_0x5c60fc[_0xa147('0x15')],_0x1e13b5);_0x4f6732(_0x209754[_0xa147('0x13')](0x1f4,_0x5c60fc[_0xa147('0x15')]));});});}; \ No newline at end of file +var _0x9fed=['request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','create','body','options','debug','CreateVoiceTransferReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x9fed,0x8f));var _0xd9fe=function(_0x49d421,_0x5eab5b){_0x49d421=_0x49d421-0x0;var _0x28b561=_0x9fed[_0x49d421];return _0x28b561;};'use strict';var _=require(_0xd9fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd9fe('0x1'));var rs=require(_0xd9fe('0x2'));var fs=require('fs');var Redis=require(_0xd9fe('0x3'));var db=require(_0xd9fe('0x4'))['db'];var utils=require(_0xd9fe('0x5'));var logger=require(_0xd9fe('0x6'))(_0xd9fe('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9fe('0x8'));var client=jayson[_0xd9fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45287a,_0x97d1a7,_0x54ea07){return new BPromise(function(_0x22298f,_0x409eba){return client[_0xd9fe('0xa')](_0x45287a,_0x54ea07)['then'](function(_0x4ade88){logger[_0xd9fe('0xb')](_0xd9fe('0xc'),_0x97d1a7,_0xd9fe('0xd'));logger['debug'](_0xd9fe('0xe'),_0x97d1a7,'request\x20sent',JSON[_0xd9fe('0xf')](_0x4ade88));if(_0x4ade88['error']){if(_0x4ade88['error'][_0xd9fe('0x10')]===0x1f4){logger[_0xd9fe('0x11')](_0xd9fe('0xc'),_0x97d1a7,_0x4ade88[_0xd9fe('0x11')][_0xd9fe('0x12')]);return _0x409eba(_0x4ade88[_0xd9fe('0x11')]['message']);}logger[_0xd9fe('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x97d1a7,_0x4ade88['error'][_0xd9fe('0x12')]);return _0x22298f(_0x4ade88[_0xd9fe('0x11')]['message']);}else{logger[_0xd9fe('0xb')](_0xd9fe('0xc'),_0x97d1a7,_0xd9fe('0xd'));_0x22298f(_0x4ade88[_0xd9fe('0x13')]['message']);}})[_0xd9fe('0x14')](function(_0x23ccc3){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x97d1a7,_0x23ccc3);_0x409eba(_0x23ccc3);});});}exports['CreateVoiceTransferReport']=function(_0x350cbc){var _0x1437a4=this;return new Promise(function(_0x1ff898,_0x17e030){return db['VoiceTransferReport'][_0xd9fe('0x15')](_0x350cbc[_0xd9fe('0x16')],{'raw':_0x350cbc[_0xd9fe('0x17')]?_0x350cbc['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x43cdfa){logger[_0xd9fe('0xb')]('CreateVoiceTransferReport',_0x350cbc);logger[_0xd9fe('0x18')](_0xd9fe('0x19'),_0x350cbc,JSON[_0xd9fe('0xf')](_0x43cdfa));_0x1ff898(_0x43cdfa);})[_0xd9fe('0x14')](function(_0x36954d){logger[_0xd9fe('0x11')]('CreateVoiceTransferReport',_0x36954d['message'],_0x350cbc);_0x17e030(_0x1437a4[_0xd9fe('0x11')](0x1f4,_0x36954d[_0xd9fe('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 80f4456..849c2a1 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 _0x3387=['originate','hangup','/answer','answer','/hold','hold','/unhold','/calls','calls','/transfer','transfer','exports','express','Router','./webbar.controller','post','isAuthenticated','canUpdate'];(function(_0x23d68e,_0x16d36d){var _0x2bbae1=function(_0x25db66){while(--_0x25db66){_0x23d68e['push'](_0x23d68e['shift']());}};_0x2bbae1(++_0x16d36d);}(_0x3387,0x1ce));var _0x7338=function(_0x404363,_0x534aed){_0x404363=_0x404363-0x0;var _0x447d73=_0x3387[_0x404363];return _0x447d73;};'use strict';var express=require(_0x7338('0x0'));var router=express[_0x7338('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x7338('0x2'));router[_0x7338('0x3')]('/originate',auth[_0x7338('0x4')](),auth[_0x7338('0x5')](),controller[_0x7338('0x6')]);router[_0x7338('0x3')]('/hangup',auth[_0x7338('0x4')](),auth['canUpdate'](),controller[_0x7338('0x7')]);router[_0x7338('0x3')](_0x7338('0x8'),auth[_0x7338('0x4')](),auth[_0x7338('0x5')](),controller[_0x7338('0x9')]);router[_0x7338('0x3')](_0x7338('0xa'),auth[_0x7338('0x4')](),auth[_0x7338('0x5')](),controller[_0x7338('0xb')]);router['post'](_0x7338('0xc'),auth['isAuthenticated'](),auth[_0x7338('0x5')](),controller['unhold']);router[_0x7338('0x3')](_0x7338('0xd'),auth[_0x7338('0x4')](),auth['canUpdate'](),controller[_0x7338('0xe')]);router[_0x7338('0x3')](_0x7338('0xf'),auth[_0x7338('0x4')](),auth['canUpdate'](),controller[_0x7338('0x10')]);module[_0x7338('0x11')]=router; \ No newline at end of file +var _0xeef8=['express','./webbar.controller','post','isAuthenticated','canUpdate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','unhold','calls','/transfer','transfer','exports'];(function(_0x641bd6,_0x39c20a){var _0x41a480=function(_0x540f71){while(--_0x540f71){_0x641bd6['push'](_0x641bd6['shift']());}};_0x41a480(++_0x39c20a);}(_0xeef8,0xcc));var _0x8eef=function(_0x1ca629,_0x3d7573){_0x1ca629=_0x1ca629-0x0;var _0x32633f=_0xeef8[_0x1ca629];return _0x32633f;};'use strict';var express=require(_0x8eef('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x8eef('0x1'));router[_0x8eef('0x2')]('/originate',auth[_0x8eef('0x3')](),auth[_0x8eef('0x4')](),controller['originate']);router['post'](_0x8eef('0x5'),auth['isAuthenticated'](),auth[_0x8eef('0x4')](),controller[_0x8eef('0x6')]);router[_0x8eef('0x2')](_0x8eef('0x7'),auth['isAuthenticated'](),auth[_0x8eef('0x4')](),controller[_0x8eef('0x8')]);router[_0x8eef('0x2')](_0x8eef('0x9'),auth['isAuthenticated'](),auth[_0x8eef('0x4')](),controller[_0x8eef('0xa')]);router[_0x8eef('0x2')](_0x8eef('0xb'),auth[_0x8eef('0x3')](),auth['canUpdate'](),controller[_0x8eef('0xc')]);router[_0x8eef('0x2')]('/calls',auth[_0x8eef('0x3')](),auth['canUpdate'](),controller[_0x8eef('0xd')]);router['post'](_0x8eef('0xe'),auth[_0x8eef('0x3')](),auth['canUpdate'](),controller[_0x8eef('0xf')]);module[_0x8eef('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 6eebc04..746bf91 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 _0xd382=['stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','findOne','VoiceChannels','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','all','filter','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','defaults','redis','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:'];(function(_0x5514d6,_0x2e9970){var _0x7c637e=function(_0xb37d4){while(--_0xb37d4){_0x5514d6['push'](_0x5514d6['shift']());}};_0x7c637e(++_0x2e9970);}(_0xd382,0x1b6));var _0x2d38=function(_0x44a97e,_0x330dd8){_0x44a97e=_0x44a97e-0x0;var _0x430c8d=_0xd382[_0x44a97e];return _0x430c8d;};'use strict';var path=require(_0x2d38('0x0'));var fs=require('fs');var _=require(_0x2d38('0x1'));var db=require(_0x2d38('0x2'))['db'];var config=require(_0x2d38('0x3'));var util=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var jayson=require(_0x2d38('0x6'));var amiClient=jayson[_0x2d38('0x7')][_0x2d38('0x8')]({'port':0x232a});var logger=require(_0x2d38('0x9'))('webbarapi');var Redis=require('ioredis');config['redis']=_[_0x2d38('0xa')](config[_0x2d38('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x2d38('0xc'))(new Redis(config[_0x2d38('0xb')]));var Schema=require(_0x2d38('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0xf')]},'callerId':{'type':_0x2d38('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});function emit(_0xc6de5a,_0x2d3cb1,_0xc17f9e){logger[_0x2d38('0x13')](_0xc6de5a,_0x2d3cb1,JSON[_0x2d38('0x14')](_0xc17f9e));io['to'](_0xc6de5a)[_0x2d38('0x15')](_0x2d3cb1,_0xc17f9e);}function handleError(_0x31a29e){return function(_0x1e3028){console[_0x2d38('0x16')](_0x2d38('0x17'),_0x1e3028,_0x1e3028 instanceof RangeError);logger['error'](_0x1e3028[_0x2d38('0x18')]);if(_0x1e3028 instanceof RangeError){if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x194)[_0x2d38('0x1b')](_0x1e3028);}else{if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x1f4)['send'](_0x1e3028);}};}function checkError(){return function(_0x4bdac6){if(!_0x4bdac6){throw new RangeError(_0x2d38('0x1c'));}return _0x4bdac6;};}function respondWithRpcPromise(_0x2e0b73,_0x3713ea){return new BPromise(function(_0x3892a5,_0x19e658){var _0x3138bc=amiClient;return _0x3138bc[_0x2d38('0x1d')](_0x2e0b73,_0x3713ea)[_0x2d38('0x1e')](function(_0x24e2cb){if(_0x24e2cb[_0x2d38('0x1f')]){if(_0x24e2cb['error'][_0x2d38('0x20')]===0x1f4){return _0x19e658(_0x24e2cb['error'][_0x2d38('0x21')]);}return _0x3892a5(_0x24e2cb['error'][_0x2d38('0x21')]);}else{_0x3892a5(_0x24e2cb[_0x2d38('0x22')]);}})[_0x2d38('0x23')](function(_0x10e283){_0x19e658(_0x10e283);});});}function getAgent(_0xffa3ce){return db[_0x2d38('0x24')][_0x2d38('0x25')]({'where':{'id':_0xffa3ce,'role':'agent'}})[_0x2d38('0x1e')](checkError());}function getAgentCheckSession(_0x3f0f7a,_0x34599a){return new BPromise(function(_0x3d18cd,_0x346934){var _0xe73710=respondWithRpcPromise(_0x2d38('0x26'));var _0x3a6437=getAgent(_0x3f0f7a);Promise['all']([_0xe73710,_0x3a6437])['then'](function(_0x5570c2){var _0x31d427=_0x5570c2[0x0];var _0xbd364b=_0x5570c2[0x1];var _0xd333fe=_['filter'](_0x31d427[_0x2d38('0x27')],function(_0x4b5891){return _0x4b5891[_0x2d38('0x28')]==_0xbd364b['id']&&_0x4b5891[_0x2d38('0x29')]==_0x34599a;});if(_0xd333fe[_0x2d38('0x2a')]==0x1){_0x3d18cd(_0xbd364b);}else{_0x346934(new RangeError('sessionId\x20'+_0x34599a+_0x2d38('0x2b')));}});});}exports[_0x2d38('0x2c')]=function(_0x389e74,_0x52a3ce){logger[_0x2d38('0x13')](_0x2d38('0x2d'),_0x389e74[_0x2d38('0x2e')]);var _0x1b48a9=originateValidation[_0x2d38('0xd')](_0x389e74[_0x2d38('0x2e')]);if(_0x1b48a9['length']>0x0){return _0x52a3ce[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x1b48a9);}var _0xa9bf8c=_0x389e74[_0x2d38('0x2e')]['userId'];var _0x21c943=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x30')];var _0x46c154=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x31')];var _0x2f2549=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x32')];return getAgent(_0xa9bf8c)[_0x2d38('0x1e')](function(_0x5b8ae7){logger['info'](_0x2d38('0x33'),_0x5b8ae7[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x5b8ae7[_0x2d38('0x19')]),_0x2d38('0x36'),{'callNumber':_0x21c943,'callerId':_0x46c154,'callbackUrl':_0x2f2549});return _0x52a3ce[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x37')});})[_0x2d38('0x23')](handleError(_0x52a3ce));};exports[_0x2d38('0x38')]=function(_0x29dda7,_0x11f5b8){logger['info'](_0x2d38('0x39'),_0x29dda7[_0x2d38('0x2e')]);var _0x30b318=hangupValidation[_0x2d38('0xd')](_0x29dda7['body']);if(_0x30b318[_0x2d38('0x2a')]>0x0){return _0x11f5b8[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x30b318);}var _0x11e58c=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x971848=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x11e58c)[_0x2d38('0x1e')](function(_0x3cd072){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x3cd072[_0x2d38('0x19')]);emit(util['format'](_0x2d38('0x35'),_0x3cd072[_0x2d38('0x19')]),'webbar:hangup',{'sessionId':_0x971848});return _0x11f5b8['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3b')});})[_0x2d38('0x23')](handleError(_0x11f5b8));};exports['answer']=function(_0x6108f1,_0x17cc8d){logger[_0x2d38('0x13')]('answer\x20fired:',_0x6108f1['body']);var _0x2eeca7=answerValidation['validate'](_0x6108f1[_0x2d38('0x2e')]);if(_0x2eeca7[_0x2d38('0x2a')]>0x0){return _0x17cc8d[_0x2d38('0x1a')](0x190)['json'](_0x2eeca7);}var _0x50cb25=_0x6108f1[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x306d6d=_0x6108f1['body'][_0x2d38('0x29')];return getAgent(_0x50cb25)[_0x2d38('0x1e')](function(_0x94f76b){logger['info'](_0x2d38('0x33'),_0x94f76b[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x94f76b['name']),_0x2d38('0x3c'),{'sessionId':_0x306d6d});return _0x17cc8d[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3d')});})['catch'](handleError(_0x17cc8d));};exports[_0x2d38('0x3e')]=function(_0x26d0b0,_0xd2df89){logger['info'](_0x2d38('0x3f'),_0x26d0b0['body']);var _0x580d04=holdValidation[_0x2d38('0xd')](_0x26d0b0[_0x2d38('0x2e')]);if(_0x580d04[_0x2d38('0x2a')]>0x0){return _0xd2df89[_0x2d38('0x1a')](0x190)['json'](_0x580d04);}var _0x4c4c95=_0x26d0b0[_0x2d38('0x2e')]['userId'];var _0x9c67cb=_0x26d0b0[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x4c4c95)[_0x2d38('0x1e')](function(_0x35a2ae){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x35a2ae[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x35a2ae[_0x2d38('0x19')]),'webbar:hold',{'sessionId':_0x9c67cb});return _0xd2df89[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':'hold\x20executed!'});})[_0x2d38('0x23')](handleError(_0xd2df89));};exports[_0x2d38('0x40')]=function(_0x187ba3,_0x3c2756){logger[_0x2d38('0x13')](_0x2d38('0x41'),_0x187ba3[_0x2d38('0x2e')]);var _0x360804=unholdValidation['validate'](_0x187ba3[_0x2d38('0x2e')]);if(_0x360804[_0x2d38('0x2a')]>0x0){return _0x3c2756[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x360804);}var _0x389982=_0x187ba3[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x358e2b=_0x187ba3[_0x2d38('0x2e')]['sessionId'];return getAgent(_0x389982)[_0x2d38('0x1e')](function(_0x1f92c2){logger['info']('entityFound:',_0x1f92c2[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x1f92c2[_0x2d38('0x19')]),'webbar:unhold',{'sessionId':_0x358e2b});return _0x3c2756['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x42')});})[_0x2d38('0x23')](handleError(_0x3c2756));};exports[_0x2d38('0x43')]=function(_0x3f1f12,_0x457a82){logger[_0x2d38('0x13')](_0x2d38('0x44'),_0x457a82[_0x2d38('0x2e')]);var _0x24c107=callsValidation[_0x2d38('0xd')](_0x3f1f12['body']);if(_0x24c107[_0x2d38('0x2a')]>0x0){return _0x457a82['status'](0x190)['json'](_0x24c107);}var _0x175981=_0x3f1f12[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x4d310b=respondWithRpcPromise('VoiceChannels');var _0x3ca706=getAgent(_0x175981);return Promise[_0x2d38('0x45')]([_0x4d310b,_0x3ca706])['then'](function(_0x720bd9){var _0x245e6a=_0x720bd9[0x0];var _0x2e978c=_0x720bd9[0x1];var _0x456dc4=_[_0x2d38('0x46')](_0x245e6a['rows'],function(_0x519913){return _0x519913[_0x2d38('0x28')]==_0x2e978c['id'];});return _0x457a82['status'](0xc8)[_0x2d38('0x2f')]({'count':_0x456dc4[_0x2d38('0x2a')],'rows':_0x456dc4});})[_0x2d38('0x23')](handleError(_0x457a82));};exports[_0x2d38('0x47')]=function(_0x4fa858,_0x415817){logger[_0x2d38('0x13')]('conference\x20fired:',_0x4fa858[_0x2d38('0x2e')]);var _0x2fa092=conferenceValidation['validate'](_0x4fa858[_0x2d38('0x2e')]);if(_0x2fa092['length']>0x0){return _0x415817['status'](0x190)[_0x2d38('0x2f')](_0x2fa092);}var _0xfb9270=_0x4fa858['body']['userId'];return getAgent(_0xfb9270)[_0x2d38('0x1e')](function(_0x4deb3c){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x4deb3c[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x4deb3c[_0x2d38('0x19')]),_0x2d38('0x48'));return _0x415817['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x49')});})[_0x2d38('0x23')](handleError(_0x415817));};exports[_0x2d38('0x4a')]=function(_0x16e148,_0x498fc2){logger[_0x2d38('0x13')]('transfer\x20fired:',_0x16e148[_0x2d38('0x2e')]);var _0x333792=transferValidation['validate'](_0x16e148['body']);if(_0x333792[_0x2d38('0x2a')]>0x0){return _0x498fc2[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x333792);}var _0x163ad5=_0x16e148['body'][_0x2d38('0x3a')];var _0x5de6ba=_0x16e148['body'][_0x2d38('0x29')];var _0x11f13e=_0x16e148[_0x2d38('0x2e')][_0x2d38('0x4b')];return getAgent(_0x163ad5)['then'](function(_0x453fff){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x453fff[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x453fff['name']),'webbar:transfer',{'sessionId':_0x5de6ba,'transferNumber':_0x11f13e});return _0x498fc2['status'](0xc8)['json']({'error':![],'message':_0x2d38('0x4c')});})[_0x2d38('0x23')](handleError(_0x498fc2));}; \ No newline at end of file +var _0x16d2=['localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','then','error','code','message','findOne','agent','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','hangup','hangup\x20fired:','validate','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','catch','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x16d2,0x123));var _0x216d=function(_0x1d90d4,_0x259856){_0x1d90d4=_0x1d90d4-0x0;var _0x5e6c65=_0x16d2[_0x1d90d4];return _0x5e6c65;};'use strict';var path=require(_0x216d('0x0'));var fs=require('fs');var _=require(_0x216d('0x1'));var db=require(_0x216d('0x2'))['db'];var config=require(_0x216d('0x3'));var util=require(_0x216d('0x4'));var BPromise=require(_0x216d('0x5'));var jayson=require(_0x216d('0x6'));var amiClient=jayson[_0x216d('0x7')][_0x216d('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0x216d('0x9'));var Redis=require(_0x216d('0xa'));config[_0x216d('0xb')]=_[_0x216d('0xc')](config[_0x216d('0xb')],{'host':_0x216d('0xd'),'port':0x18eb});var io=require(_0x216d('0xe'))(new Redis(config[_0x216d('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'callNumber':{'type':_0x216d('0x11'),'required':[!![],_0x216d('0x12')]},'callerId':{'type':_0x216d('0x11')},'callbackUrl':{'type':_0x216d('0x11')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x216d('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':_0x216d('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':_0x216d('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x216d('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]}});function emit(_0x4631b0,_0x23ff86,_0x3e5585){logger[_0x216d('0x13')](_0x4631b0,_0x23ff86,JSON[_0x216d('0x14')](_0x3e5585));io['to'](_0x4631b0)[_0x216d('0x15')](_0x23ff86,_0x3e5585);}function handleError(_0x19fdac){return function(_0x53d464){console[_0x216d('0x16')]('handleError:',_0x53d464,_0x53d464 instanceof RangeError);logger['error'](_0x53d464[_0x216d('0x17')]);if(_0x53d464 instanceof RangeError){if(_0x53d464[_0x216d('0x18')]){delete _0x53d464['name'];}_0x19fdac[_0x216d('0x19')](0x194)[_0x216d('0x1a')](_0x53d464);}else{if(_0x53d464['name']){delete _0x53d464[_0x216d('0x18')];}_0x19fdac[_0x216d('0x19')](0x1f4)[_0x216d('0x1a')](_0x53d464);}};}function checkError(){return function(_0x3e9818){if(!_0x3e9818){throw new RangeError('NotFound');}return _0x3e9818;};}function respondWithRpcPromise(_0x20ee7c,_0x294bbf){return new BPromise(function(_0x10f299,_0x438981){var _0x206782=amiClient;return _0x206782['request'](_0x20ee7c,_0x294bbf)[_0x216d('0x1b')](function(_0x1bd4db){if(_0x1bd4db[_0x216d('0x1c')]){if(_0x1bd4db[_0x216d('0x1c')][_0x216d('0x1d')]===0x1f4){return _0x438981(_0x1bd4db['error'][_0x216d('0x1e')]);}return _0x10f299(_0x1bd4db[_0x216d('0x1c')][_0x216d('0x1e')]);}else{_0x10f299(_0x1bd4db['result']);}})['catch'](function(_0x56460f){_0x438981(_0x56460f);});});}function getAgent(_0x4c792e){return db['User'][_0x216d('0x1f')]({'where':{'id':_0x4c792e,'role':_0x216d('0x20')}})[_0x216d('0x1b')](checkError());}function getAgentCheckSession(_0x73b509,_0x46d0ef){return new BPromise(function(_0x47fa6d,_0x5b21d8){var _0xa7624a=respondWithRpcPromise('VoiceChannels');var _0x23d1c3=getAgent(_0x73b509);Promise[_0x216d('0x21')]([_0xa7624a,_0x23d1c3])[_0x216d('0x1b')](function(_0x20bc16){var _0x307f2b=_0x20bc16[0x0];var _0x12bcab=_0x20bc16[0x1];var _0x28fcc2=_[_0x216d('0x22')](_0x307f2b[_0x216d('0x23')],function(_0x28f56a){return _0x28f56a[_0x216d('0x24')]==_0x12bcab['id']&&_0x28f56a[_0x216d('0x25')]==_0x46d0ef;});if(_0x28fcc2[_0x216d('0x26')]==0x1){_0x47fa6d(_0x12bcab);}else{_0x5b21d8(new RangeError('sessionId\x20'+_0x46d0ef+_0x216d('0x27')));}});});}exports[_0x216d('0x28')]=function(_0x37e8e6,_0x510ad9){logger[_0x216d('0x13')](_0x216d('0x29'),_0x37e8e6[_0x216d('0x2a')]);var _0xeff234=originateValidation['validate'](_0x37e8e6[_0x216d('0x2a')]);if(_0xeff234[_0x216d('0x26')]>0x0){return _0x510ad9[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0xeff234);}var _0x14d417=_0x37e8e6[_0x216d('0x2a')][_0x216d('0x2c')];var _0x35d4d2=_0x37e8e6[_0x216d('0x2a')][_0x216d('0x2d')];var _0x6eda4=_0x37e8e6['body'][_0x216d('0x2e')];var _0x451c4d=_0x37e8e6[_0x216d('0x2a')]['callbackUrl'];return getAgent(_0x14d417)[_0x216d('0x1b')](function(_0x2e86f9){logger['info'](_0x216d('0x2f'),_0x2e86f9['name']);emit(util['format'](_0x216d('0x30'),_0x2e86f9[_0x216d('0x18')]),_0x216d('0x31'),{'callNumber':_0x35d4d2,'callerId':_0x6eda4,'callbackUrl':_0x451c4d});return _0x510ad9[_0x216d('0x19')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x510ad9));};exports[_0x216d('0x32')]=function(_0x38972e,_0x47e006){logger[_0x216d('0x13')](_0x216d('0x33'),_0x38972e['body']);var _0xe49ba4=hangupValidation[_0x216d('0x34')](_0x38972e[_0x216d('0x2a')]);if(_0xe49ba4[_0x216d('0x26')]>0x0){return _0x47e006[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0xe49ba4);}var _0x35cb6e=_0x38972e[_0x216d('0x2a')]['userId'];var _0x4bc645=_0x38972e[_0x216d('0x2a')][_0x216d('0x25')];return getAgent(_0x35cb6e)['then'](function(_0xf33f9c){logger[_0x216d('0x13')](_0x216d('0x2f'),_0xf33f9c['name']);emit(util[_0x216d('0x35')](_0x216d('0x30'),_0xf33f9c[_0x216d('0x18')]),_0x216d('0x36'),{'sessionId':_0x4bc645});return _0x47e006['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x37')});})['catch'](handleError(_0x47e006));};exports[_0x216d('0x38')]=function(_0x306e9f,_0x590eb6){logger['info'](_0x216d('0x39'),_0x306e9f[_0x216d('0x2a')]);var _0x3c491e=answerValidation['validate'](_0x306e9f[_0x216d('0x2a')]);if(_0x3c491e['length']>0x0){return _0x590eb6['status'](0x190)[_0x216d('0x2b')](_0x3c491e);}var _0x43336e=_0x306e9f[_0x216d('0x2a')]['userId'];var _0xaccf45=_0x306e9f['body'][_0x216d('0x25')];return getAgent(_0x43336e)[_0x216d('0x1b')](function(_0x842af2){logger['info'](_0x216d('0x2f'),_0x842af2[_0x216d('0x18')]);emit(util[_0x216d('0x35')](_0x216d('0x30'),_0x842af2['name']),'webbar:answer',{'sessionId':_0xaccf45});return _0x590eb6['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x3a')});})[_0x216d('0x3b')](handleError(_0x590eb6));};exports[_0x216d('0x3c')]=function(_0x3344e3,_0x13f51c){logger[_0x216d('0x13')](_0x216d('0x3d'),_0x3344e3['body']);var _0x3771dc=holdValidation[_0x216d('0x34')](_0x3344e3[_0x216d('0x2a')]);if(_0x3771dc[_0x216d('0x26')]>0x0){return _0x13f51c['status'](0x190)[_0x216d('0x2b')](_0x3771dc);}var _0x542e1b=_0x3344e3[_0x216d('0x2a')][_0x216d('0x2c')];var _0xceb993=_0x3344e3['body']['sessionId'];return getAgent(_0x542e1b)[_0x216d('0x1b')](function(_0x32d499){logger[_0x216d('0x13')](_0x216d('0x2f'),_0x32d499[_0x216d('0x18')]);emit(util[_0x216d('0x35')]('user:%s',_0x32d499['name']),_0x216d('0x3e'),{'sessionId':_0xceb993});return _0x13f51c['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x3f')});})['catch'](handleError(_0x13f51c));};exports['unhold']=function(_0x5f37e3,_0x4bac14){logger[_0x216d('0x13')](_0x216d('0x40'),_0x5f37e3[_0x216d('0x2a')]);var _0x216f44=unholdValidation[_0x216d('0x34')](_0x5f37e3[_0x216d('0x2a')]);if(_0x216f44[_0x216d('0x26')]>0x0){return _0x4bac14['status'](0x190)[_0x216d('0x2b')](_0x216f44);}var _0x34cdb9=_0x5f37e3[_0x216d('0x2a')]['userId'];var _0x1e1caf=_0x5f37e3[_0x216d('0x2a')][_0x216d('0x25')];return getAgent(_0x34cdb9)[_0x216d('0x1b')](function(_0x481754){logger[_0x216d('0x13')](_0x216d('0x2f'),_0x481754[_0x216d('0x18')]);emit(util[_0x216d('0x35')]('user:%s',_0x481754[_0x216d('0x18')]),_0x216d('0x41'),{'sessionId':_0x1e1caf});return _0x4bac14['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':'unhold\x20executed!'});})[_0x216d('0x3b')](handleError(_0x4bac14));};exports[_0x216d('0x42')]=function(_0x22e025,_0xe65193){logger[_0x216d('0x13')](_0x216d('0x43'),_0xe65193[_0x216d('0x2a')]);var _0x2c6cb6=callsValidation[_0x216d('0x34')](_0x22e025['body']);if(_0x2c6cb6[_0x216d('0x26')]>0x0){return _0xe65193[_0x216d('0x19')](0x190)['json'](_0x2c6cb6);}var _0x241ce4=_0x22e025[_0x216d('0x2a')]['userId'];var _0x4edf77=respondWithRpcPromise(_0x216d('0x44'));var _0x5e4b3d=getAgent(_0x241ce4);return Promise[_0x216d('0x21')]([_0x4edf77,_0x5e4b3d])[_0x216d('0x1b')](function(_0x2c9b1f){var _0x590c4e=_0x2c9b1f[0x0];var _0x3acd4b=_0x2c9b1f[0x1];var _0x5112ea=_['filter'](_0x590c4e[_0x216d('0x23')],function(_0x38ee94){return _0x38ee94['UserId']==_0x3acd4b['id'];});return _0xe65193[_0x216d('0x19')](0xc8)[_0x216d('0x2b')]({'count':_0x5112ea[_0x216d('0x26')],'rows':_0x5112ea});})[_0x216d('0x3b')](handleError(_0xe65193));};exports[_0x216d('0x45')]=function(_0xd723fc,_0x5276df){logger['info'](_0x216d('0x46'),_0xd723fc[_0x216d('0x2a')]);var _0x1ce36c=conferenceValidation[_0x216d('0x34')](_0xd723fc[_0x216d('0x2a')]);if(_0x1ce36c[_0x216d('0x26')]>0x0){return _0x5276df[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0x1ce36c);}var _0x3c01a4=_0xd723fc[_0x216d('0x2a')][_0x216d('0x2c')];return getAgent(_0x3c01a4)[_0x216d('0x1b')](function(_0x489bdd){logger['info'](_0x216d('0x2f'),_0x489bdd[_0x216d('0x18')]);emit(util['format'](_0x216d('0x30'),_0x489bdd['name']),'webbar:conference');return _0x5276df[_0x216d('0x19')](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x47')});})[_0x216d('0x3b')](handleError(_0x5276df));};exports[_0x216d('0x48')]=function(_0x3847b6,_0xb00e58){logger[_0x216d('0x13')](_0x216d('0x49'),_0x3847b6[_0x216d('0x2a')]);var _0x1c08d9=transferValidation[_0x216d('0x34')](_0x3847b6[_0x216d('0x2a')]);if(_0x1c08d9[_0x216d('0x26')]>0x0){return _0xb00e58[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0x1c08d9);}var _0xb398cc=_0x3847b6[_0x216d('0x2a')][_0x216d('0x2c')];var _0x34540e=_0x3847b6[_0x216d('0x2a')][_0x216d('0x25')];var _0x5f04ba=_0x3847b6[_0x216d('0x2a')]['transferNumber'];return getAgent(_0xb398cc)[_0x216d('0x1b')](function(_0x51507b){logger[_0x216d('0x13')](_0x216d('0x2f'),_0x51507b['name']);emit(util[_0x216d('0x35')](_0x216d('0x30'),_0x51507b[_0x216d('0x18')]),_0x216d('0x4a'),{'sessionId':_0x34540e,'transferNumber':_0x5f04ba});return _0xb00e58[_0x216d('0x19')](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x4b')});})[_0x216d('0x3b')](handleError(_0xb00e58));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 503df5e..d380b0f 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 _0x896e=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/send','send','put','destroy','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x896e,0x1e9));var _0xe896=function(_0x147961,_0x2f52a8){_0x147961=_0x147961-0x0;var _0x4af690=_0x896e[_0x147961];return _0x4af690;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['get'](_0xe896('0x12'),auth['isAuthenticated'](),controller[_0xe896('0x13')]);router['get'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);router['get'](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x17')]);router['get'](_0xe896('0x18'),auth[_0xe896('0xe')](),controller[_0xe896('0x19')]);router['post']('/',auth[_0xe896('0xe')](),controller[_0xe896('0x1a')]);router[_0xe896('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe896('0x1c')]);router[_0xe896('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe896('0x1d')]);router[_0xe896('0x1b')]('/:id/users',auth[_0xe896('0xe')](),controller['addAgents']);router[_0xe896('0x1b')](_0xe896('0x18'),auth[_0xe896('0xe')](),controller['addApplications']);router[_0xe896('0x1b')](_0xe896('0x1e'),controller[_0xe896('0x1f')]);router[_0xe896('0x1b')](_0xe896('0x20'),auth[_0xe896('0xe')](),controller[_0xe896('0x21')]);router[_0xe896('0x22')]('/:id',auth[_0xe896('0xe')](),controller['update']);router['delete'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x23')]);router[_0xe896('0x24')]('/:id/dispositions',auth[_0xe896('0xe')](),controller['removeDispositions']);router['delete'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x25')]);router[_0xe896('0x24')](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x26')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x772a37,_0x4e4fa5){var _0x285bd6=function(_0x5836a1){while(--_0x5836a1){_0x772a37['push'](_0x772a37['shift']());}};_0x285bd6(++_0x4e4fa5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5a5aca,_0x368fbb){_0x5a5aca=_0x5a5aca-0x0;var _0x1cb523=_0x0b0e[_0x5a5aca];return _0x1cb523;};'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/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index edf64a5..7e1287f 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 _0x849a=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x849a,0x1a7));var _0xa849=function(_0x1918b0,_0x4e529d){_0x1918b0=_0x1918b0-0x0;var _0x1314b0=_0x849a[_0x1918b0];return _0x1314b0;};'use strict';var Sequelize=require(_0xa849('0x0'));var rs=require(_0xa849('0x1'));module['exports']={'name':{'type':Sequelize[_0xa849('0x2')],'unique':_0xa849('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa849('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa849('0x4')]();}},'phone':{'type':Sequelize[_0xa849('0x2')]},'type':{'type':Sequelize[_0xa849('0x5')](_0xa849('0x6'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa849('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa849('0x7');}},'notificationSound':{'type':Sequelize[_0xa849('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa849('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa849('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa849('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa849('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa849('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa849('0x9')],'comment':_0xa849('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xa849('0x8')],'defaultValue':![],'comment':_0xa849('0xb'),'set':function(_0x5d9335){if(!_0x5d9335){this[_0xa849('0xc')](_0xa849('0xd'),null);}this[_0xa849('0xc')](_0xa849('0xe'),_0x5d9335);}},'description':{'type':Sequelize[_0xa849('0x2')]}}; \ No newline at end of file +var _0x0366=['twilio','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','exports','STRING','name','generate'];(function(_0x43c920,_0x2352bd){var _0x2757f8=function(_0x568314){while(--_0x568314){_0x43c920['push'](_0x43c920['shift']());}};_0x2757f8(++_0x2352bd);}(_0x0366,0x1a8));var _0x6036=function(_0x38c212,_0x239d0a){_0x38c212=_0x38c212-0x0;var _0x545cfa=_0x0366[_0x38c212];return _0x545cfa;};'use strict';var Sequelize=require(_0x6036('0x0'));var rs=require('randomstring');module[_0x6036('0x1')]={'name':{'type':Sequelize[_0x6036('0x2')],'unique':_0x6036('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x6036('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x6036('0x2')],'defaultValue':function(){return rs[_0x6036('0x4')]();}},'phone':{'type':Sequelize[_0x6036('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6036('0x5'))},'accountSid':{'type':Sequelize[_0x6036('0x2')]},'authToken':{'type':Sequelize[_0x6036('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6036('0x6');}},'notificationSound':{'type':Sequelize[_0x6036('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6036('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6036('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6036('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6036('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6036('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6036('0x8')],'comment':_0x6036('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x6036('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x164585){if(!_0x164585){this[_0x6036('0xa')](_0x6036('0xb'),null);}this[_0x6036('0xa')](_0x6036('0xc'),_0x164585);}},'description':{'type':Sequelize[_0x6036('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 9e070c1..ce70df8 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 _0xc9aa=['List','DESC','out','WhatsappMessage','Messages','dataValues','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','get','UserProfileResource','end','name','send','index','Pause','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','WhatsappAccount','includeAll','include','findAll','show','params','mandatoryDispositionPause','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','WhatsappAccountId','findOne','Disposition','pick','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','ids','addAgents','omit','spread','isArray','emit','userWhatsappAccount:remove','User','getAgents','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','account','orderBy','Applications','asc','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','Body','messageId','MessageSid','isNil','from','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','ContactId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','set','text/xml','\x0a','to\x20is\x20mandatory'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0xc9aa,0x16a));var _0xac9a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xc9aa[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac9a('0x0'));var jsonpatch=require(_0xac9a('0x1'));var rp=require(_0xac9a('0x2'));var moment=require('moment');var BPromise=require(_0xac9a('0x3'));var Mustache=require(_0xac9a('0x4'));var util=require('util');var path=require('path');var sox=require(_0xac9a('0x5'));var csv=require('to-csv');var ejs=require(_0xac9a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac9a('0x7'));var squel=require(_0xac9a('0x8'));var crypto=require(_0xac9a('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac9a('0xa'));var querystring=require(_0xac9a('0xb'));var Papa=require(_0xac9a('0xc'));var Redis=require(_0xac9a('0xd'));var authService=require(_0xac9a('0xe'));var qs=require(_0xac9a('0xf'));var as=require(_0xac9a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xac9a('0x11'));var utils=require(_0xac9a('0x12'));var config=require(_0xac9a('0x13'));var licenseUtil=require(_0xac9a('0x14'));var db=require(_0xac9a('0x15'))['db'];config[_0xac9a('0x16')]=_[_0xac9a('0x17')](config[_0xac9a('0x16')],{'host':_0xac9a('0x18'),'port':0x18eb});var socket=require(_0xac9a('0x19'))(new Redis(config[_0xac9a('0x16')]));require(_0xac9a('0x1a'))[_0xac9a('0x1b')](socket);var jayson=require(_0xac9a('0x1c'));var client=jayson[_0xac9a('0x1d')][_0xac9a('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x32ead6,_0x12a47d,_0x4931f5,_0x897949){return new BPromise(function(_0x24b561,_0x14d122){var _0x2b875b=_0x897949||client;return _0x2b875b['request'](_0x32ead6,_0x4931f5)[_0xac9a('0x1f')](function(_0x4989cb){logger[_0xac9a('0x20')](_0xac9a('0x21'),_0x12a47d,_0xac9a('0x22'));logger[_0xac9a('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x12a47d,'request\x20sent',JSON[_0xac9a('0x24')](_0x4989cb));if(_0x4989cb[_0xac9a('0x25')]){if(_0x4989cb[_0xac9a('0x25')][_0xac9a('0x26')]===0x1f4){logger[_0xac9a('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x12a47d,_0x4989cb[_0xac9a('0x25')]['message']);return _0x14d122(_0x4989cb[_0xac9a('0x25')]['message']);}logger[_0xac9a('0x25')](_0xac9a('0x21'),_0x12a47d,_0x4989cb['error']['message']);return _0x24b561(_0x4989cb[_0xac9a('0x25')][_0xac9a('0x27')]);}else{logger[_0xac9a('0x20')](_0xac9a('0x21'),_0x12a47d,_0xac9a('0x22'));_0x24b561(_0x4989cb[_0xac9a('0x28')]['message']);}})[_0xac9a('0x29')](function(_0x56bbaa){logger[_0xac9a('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x12a47d,_0x56bbaa);_0x14d122(_0x56bbaa);});});}function respondWithStatusCode(_0x37759b,_0x338b08){_0x338b08=_0x338b08||0xcc;return function(_0x168a87){if(_0x168a87){return _0x37759b[_0xac9a('0x2a')](_0x338b08);}return _0x37759b[_0xac9a('0x2b')](_0x338b08)['end']();};}function respondWithResult(_0x4026f0,_0x280e4c){_0x280e4c=_0x280e4c||0xc8;return function(_0xbf43b0){if(_0xbf43b0){return _0x4026f0[_0xac9a('0x2b')](_0x280e4c)['json'](_0xbf43b0);}};}function respondWithFilteredResult(_0x1fcdfe,_0x103bfa){return function(_0x161c0f){if(_0x161c0f){var _0x4f162e=typeof _0x103bfa[_0xac9a('0x2c')]===_0xac9a('0x2d')&&typeof _0x103bfa[_0xac9a('0x2e')]==='undefined';var _0x2e60f1=_0x161c0f['count'];var _0xdc202b=_0x4f162e?0x0:_0x103bfa[_0xac9a('0x2c')];var _0x924b43=_0x4f162e?_0x161c0f[_0xac9a('0x2f')]:_0x103bfa[_0xac9a('0x2c')]+_0x103bfa['limit'];var _0x17e38f;if(_0x924b43>=_0x2e60f1){_0x924b43=_0x2e60f1;_0x17e38f=0xc8;}else{_0x17e38f=0xce;}_0x1fcdfe['status'](_0x17e38f);return _0x1fcdfe['set'](_0xac9a('0x30'),_0xdc202b+'-'+_0x924b43+'/'+_0x2e60f1)[_0xac9a('0x31')](_0x161c0f);}return null;};}function patchUpdates(_0x36aeac){return function(_0x7404d3){try{jsonpatch['apply'](_0x7404d3,_0x36aeac,!![]);}catch(_0x289011){return BPromise[_0xac9a('0x32')](_0x289011);}return _0x7404d3[_0xac9a('0x33')]();};}function saveUpdates(_0x1030d6,_0x12d16b){return function(_0x11e019){if(_0x11e019){return _0x11e019['update'](_0x1030d6)[_0xac9a('0x1f')](function(_0x28e21f){return _0x28e21f;});}return null;};}function removeEntity(_0x563c7d,_0xf57e64){return function(_0x5c3924){if(_0x5c3924){return _0x5c3924['destroy']()['then'](function(){var _0x5d789d=_0x5c3924[_0xac9a('0x34')]({'plain':!![]});var _0x5c52e5='WhatsappAccounts';return db[_0xac9a('0x35')]['destroy']({'where':{'type':_0x5c52e5,'resourceId':_0x5d789d['id']}})[_0xac9a('0x1f')](function(){return _0x5c3924;});})['then'](function(){_0x563c7d[_0xac9a('0x2b')](0xcc)[_0xac9a('0x36')]();});}};}function handleEntityNotFound(_0x59f4b3,_0x37bc89){return function(_0x277e9d){if(!_0x277e9d){_0x59f4b3[_0xac9a('0x2a')](0x194);}return _0x277e9d;};}function handleError(_0x101302,_0x4d8fed){_0x4d8fed=_0x4d8fed||0x1f4;return function(_0x2809a8){logger['error'](_0x2809a8['stack']);if(_0x2809a8[_0xac9a('0x37')]){delete _0x2809a8[_0xac9a('0x37')];}_0x101302[_0xac9a('0x2b')](_0x4d8fed)[_0xac9a('0x38')](_0x2809a8);};}exports[_0xac9a('0x39')]=function(_0x4e1619,_0x1c4d37){var _0x4817c6={'include':[{'model':db[_0xac9a('0x3a')],'as':'mandatoryDispositionPause'}]},_0x4b4669={},_0x2ab7cb={'count':0x0,'rows':[]};var _0x469743=_[_0xac9a('0x3b')](db['WhatsappAccount'][_0xac9a('0x3c')],function(_0x272afd){return{'name':_0x272afd['fieldName'],'type':_0x272afd[_0xac9a('0x3d')]['key']};});_0x4b4669[_0xac9a('0x3e')]=_[_0xac9a('0x3b')](_0x469743,_0xac9a('0x37'));_0x4b4669[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x4e1619[_0xac9a('0x3f')]);_0x4b4669[_0xac9a('0x41')]=_[_0xac9a('0x42')](_0x4b4669[_0xac9a('0x3e')],_0x4b4669[_0xac9a('0x3f')]);_0x4817c6['attributes']=_[_0xac9a('0x42')](_0x4b4669[_0xac9a('0x3e')],qs['fields'](_0x4e1619['query'][_0xac9a('0x43')]));_0x4817c6[_0xac9a('0x44')]=_0x4817c6[_0xac9a('0x44')]['length']?_0x4817c6[_0xac9a('0x44')]:_0x4b4669[_0xac9a('0x3e')];if(!_0x4e1619[_0xac9a('0x3f')]['hasOwnProperty'](_0xac9a('0x45'))){_0x4817c6[_0xac9a('0x2e')]=qs[_0xac9a('0x2e')](_0x4e1619[_0xac9a('0x3f')][_0xac9a('0x2e')]);_0x4817c6[_0xac9a('0x2c')]=qs[_0xac9a('0x2c')](_0x4e1619['query'][_0xac9a('0x2c')]);}_0x4817c6[_0xac9a('0x46')]=qs[_0xac9a('0x47')](_0x4e1619[_0xac9a('0x3f')][_0xac9a('0x47')]);_0x4817c6[_0xac9a('0x48')]=qs[_0xac9a('0x41')](_['pick'](_0x4e1619[_0xac9a('0x3f')],_0x4b4669[_0xac9a('0x41')]),_0x469743);if(_0x4e1619[_0xac9a('0x3f')][_0xac9a('0x49')]){_0x4817c6[_0xac9a('0x48')]=_[_0xac9a('0x4a')](_0x4817c6['where'],{'$or':_[_0xac9a('0x3b')](_0x469743,function(_0x5002bf){if(_0x5002bf[_0xac9a('0x3d')]!=='VIRTUAL'){var _0x1fd169={};_0x1fd169[_0x5002bf[_0xac9a('0x37')]]={'$like':'%'+_0x4e1619[_0xac9a('0x3f')][_0xac9a('0x49')]+'%'};return _0x1fd169;}})});}_0x4817c6=_[_0xac9a('0x4a')]({},_0x4817c6,_0x4e1619[_0xac9a('0x4b')]);var _0x1dacba={'where':_0x4817c6['where']};return db[_0xac9a('0x4c')]['count'](_0x1dacba)[_0xac9a('0x1f')](function(_0x36812a){_0x2ab7cb[_0xac9a('0x2f')]=_0x36812a;if(_0x4e1619['query'][_0xac9a('0x4d')]){_0x4817c6[_0xac9a('0x4e')]=[{'all':!![]}];}return db[_0xac9a('0x4c')][_0xac9a('0x4f')](_0x4817c6);})[_0xac9a('0x1f')](function(_0x31dc70){_0x2ab7cb['rows']=_0x31dc70;return _0x2ab7cb;})[_0xac9a('0x1f')](respondWithFilteredResult(_0x1c4d37,_0x4817c6))[_0xac9a('0x29')](handleError(_0x1c4d37,null));};exports[_0xac9a('0x50')]=function(_0x904e90,_0x19cb46){var _0x1a6180={'raw':![],'where':{'id':_0x904e90[_0xac9a('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0xac9a('0x52')}]},_0x4fdd05={};_0x4fdd05[_0xac9a('0x3e')]=_[_0xac9a('0x40')](db[_0xac9a('0x4c')][_0xac9a('0x3c')]);_0x4fdd05[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x904e90['query']);_0x4fdd05[_0xac9a('0x41')]=_[_0xac9a('0x42')](_0x4fdd05['model'],_0x4fdd05['query']);_0x1a6180[_0xac9a('0x44')]=_[_0xac9a('0x42')](_0x4fdd05[_0xac9a('0x3e')],qs[_0xac9a('0x43')](_0x904e90[_0xac9a('0x3f')]['fields']));_0x1a6180[_0xac9a('0x44')]=_0x1a6180[_0xac9a('0x44')][_0xac9a('0x53')]?_0x1a6180[_0xac9a('0x44')]:_0x4fdd05[_0xac9a('0x3e')];if(_0x904e90[_0xac9a('0x3f')][_0xac9a('0x4d')]){_0x1a6180[_0xac9a('0x4e')]=[{'all':!![]}];}_0x1a6180=_[_0xac9a('0x4a')]({},_0x1a6180,_0x904e90[_0xac9a('0x4b')]);return db[_0xac9a('0x4c')]['find'](_0x1a6180)['then'](handleEntityNotFound(_0x19cb46,null))[_0xac9a('0x1f')](respondWithResult(_0x19cb46,null))[_0xac9a('0x29')](handleError(_0x19cb46,null));};exports[_0xac9a('0x54')]=function(_0x357874,_0x15c19b){return db['WhatsappAccount']['create'](_0x357874[_0xac9a('0x55')],{})[_0xac9a('0x1f')](function(_0x5abe01){var _0x501123=_0x357874[_0xac9a('0x56')]['get']({'plain':!![]});if(!_0x501123)throw new Error(_0xac9a('0x57'));if(_0x501123[_0xac9a('0x58')]===_0xac9a('0x56')){var _0x437bd8=_0x5abe01[_0xac9a('0x34')]({'plain':!![]});var _0x336175=_0xac9a('0x59');return db[_0xac9a('0x5a')][_0xac9a('0x5b')]({'where':{'name':_0x336175,'userProfileId':_0x501123[_0xac9a('0x5c')]},'raw':!![]})[_0xac9a('0x1f')](function(_0x574c3e){if(_0x574c3e&&_0x574c3e['autoAssociation']===0x0){return db[_0xac9a('0x35')][_0xac9a('0x54')]({'name':_0x437bd8[_0xac9a('0x37')],'resourceId':_0x437bd8['id'],'type':_0x574c3e['name'],'sectionId':_0x574c3e['id']},{})[_0xac9a('0x1f')](function(){return _0x5abe01;});}else{return _0x5abe01;}})[_0xac9a('0x29')](function(_0xd1618e){logger[_0xac9a('0x25')](_0xac9a('0x5d'),_0xd1618e);throw _0xd1618e;});}return _0x5abe01;})[_0xac9a('0x1f')](respondWithResult(_0x15c19b,0xc9))['catch'](handleError(_0x15c19b,null));};exports['update']=function(_0x3396ef,_0x41309b){if(_0x3396ef[_0xac9a('0x55')]['id']){delete _0x3396ef[_0xac9a('0x55')]['id'];}return db[_0xac9a('0x4c')][_0xac9a('0x5b')]({'where':{'id':_0x3396ef['params']['id']},'include':[{'model':db[_0xac9a('0x3a')],'as':_0xac9a('0x52')}]})[_0xac9a('0x1f')](handleEntityNotFound(_0x41309b,null))['then'](saveUpdates(_0x3396ef[_0xac9a('0x55')],null))[_0xac9a('0x1f')](respondWithResult(_0x41309b,null))[_0xac9a('0x29')](handleError(_0x41309b,null));};exports[_0xac9a('0x5e')]=function(_0x4debf1,_0x1ac4cd){return db['WhatsappAccount']['find']({'where':{'id':_0x4debf1[_0xac9a('0x51')]['id']}})['then'](handleEntityNotFound(_0x1ac4cd,null))['then'](removeEntity(_0x1ac4cd,null))[_0xac9a('0x29')](handleError(_0x1ac4cd,null));};exports['describe']=function(_0x426cb6,_0x1853e0){return db[_0xac9a('0x4c')][_0xac9a('0x5f')]()[_0xac9a('0x1f')](respondWithResult(_0x1853e0,null))[_0xac9a('0x29')](handleError(_0x1853e0,null));};exports['addDisposition']=function(_0x309cae,_0x55d6a3,_0x5e1846){if(_0x309cae['body']['id']){delete _0x309cae[_0xac9a('0x55')]['id'];}return db[_0xac9a('0x4c')][_0xac9a('0x5b')]({'where':{'id':_0x309cae[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x55d6a3,null))[_0xac9a('0x1f')](function(_0x4a34a3){if(_0x4a34a3){_0x309cae[_0xac9a('0x55')][_0xac9a('0x60')]=_0x4a34a3['id'];return db['Disposition'][_0xac9a('0x54')](_0x309cae[_0xac9a('0x55')]);}})[_0xac9a('0x1f')](respondWithResult(_0x55d6a3,null))[_0xac9a('0x29')](handleError(_0x55d6a3,null));};exports['getDispositions']=function(_0x21eb1f,_0x2b9839,_0x499a91){var _0x4ad770={'raw':![],'where':{}};var _0x5a45df={};var _0x5a0f83={'count':0x0,'rows':[]};return db[_0xac9a('0x4c')][_0xac9a('0x61')]({'where':{'id':_0x21eb1f[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x2b9839,null))[_0xac9a('0x1f')](function(_0x4644be){if(_0x4644be){_0x5a45df[_0xac9a('0x3e')]=_[_0xac9a('0x40')](db[_0xac9a('0x62')][_0xac9a('0x3c')]);_0x5a45df[_0xac9a('0x3f')]=_['keys'](_0x21eb1f[_0xac9a('0x3f')]);_0x5a45df['filters']=_['intersection'](_0x5a45df[_0xac9a('0x3e')],_0x5a45df[_0xac9a('0x3f')]);_0x4ad770['attributes']=_[_0xac9a('0x42')](_0x5a45df['model'],qs[_0xac9a('0x43')](_0x21eb1f[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x4ad770[_0xac9a('0x44')]=_0x4ad770[_0xac9a('0x44')][_0xac9a('0x53')]?_0x4ad770[_0xac9a('0x44')]:_0x5a45df[_0xac9a('0x3e')];if(!_0x21eb1f['query']['hasOwnProperty']('nolimit')){_0x4ad770[_0xac9a('0x2e')]=qs[_0xac9a('0x2e')](_0x21eb1f[_0xac9a('0x3f')][_0xac9a('0x2e')]);_0x4ad770['offset']=qs['offset'](_0x21eb1f['query'][_0xac9a('0x2c')]);}_0x4ad770[_0xac9a('0x46')]=qs[_0xac9a('0x47')](_0x21eb1f['query'][_0xac9a('0x47')]);_0x4ad770[_0xac9a('0x48')]=qs[_0xac9a('0x41')](_[_0xac9a('0x63')](_0x21eb1f[_0xac9a('0x3f')],_0x5a45df[_0xac9a('0x41')]));_0x4ad770[_0xac9a('0x48')]['WhatsappAccountId']=_0x4644be['id'];if(_0x21eb1f['query'][_0xac9a('0x49')]){_0x4ad770[_0xac9a('0x48')]=_[_0xac9a('0x4a')](_0x4ad770[_0xac9a('0x48')],{'$or':_['map'](_0x4ad770[_0xac9a('0x44')],function(_0x2c3f26){var _0x33c8c1={};_0x33c8c1[_0x2c3f26]={'$like':'%'+_0x21eb1f[_0xac9a('0x3f')][_0xac9a('0x49')]+'%'};return _0x33c8c1;})});}_0x4ad770=_[_0xac9a('0x4a')]({},_0x4ad770,_0x21eb1f[_0xac9a('0x4b')]);return db[_0xac9a('0x62')][_0xac9a('0x2f')]({'where':_0x4ad770[_0xac9a('0x48')]})[_0xac9a('0x1f')](function(_0x3b6f5f){_0x5a0f83[_0xac9a('0x2f')]=_0x3b6f5f;if(_0x21eb1f[_0xac9a('0x3f')]['includeAll']){_0x4ad770[_0xac9a('0x4e')]=[{'all':!![]}];}return db[_0xac9a('0x62')][_0xac9a('0x4f')](_0x4ad770);})[_0xac9a('0x1f')](function(_0x21b144){_0x5a0f83[_0xac9a('0x64')]=_0x21b144;return _0x5a0f83;});}})[_0xac9a('0x1f')](respondWithFilteredResult(_0x2b9839,_0x4ad770))[_0xac9a('0x29')](handleError(_0x2b9839,null));};exports[_0xac9a('0x65')]=function(_0x20f7ef,_0xa86738,_0x5e5401){return db[_0xac9a('0x4c')][_0xac9a('0x5b')]({'where':{'id':_0x20f7ef[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0xa86738,null))[_0xac9a('0x1f')](function(_0x65ea8){if(_0x65ea8){return _0x65ea8[_0xac9a('0x65')](_0x20f7ef[_0xac9a('0x3f')]['ids']);}})[_0xac9a('0x1f')](respondWithStatusCode(_0xa86738,null))['catch'](handleError(_0xa86738,null));};exports[_0xac9a('0x66')]=function(_0x104250,_0x580846,_0x2fb9b0){if(_0x104250[_0xac9a('0x55')]['id']){delete _0x104250[_0xac9a('0x55')]['id'];}return db[_0xac9a('0x4c')]['find']({'where':{'id':_0x104250[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x580846,null))[_0xac9a('0x1f')](function(_0x3ff4bd){if(_0x3ff4bd){_0x104250['body'][_0xac9a('0x60')]=_0x3ff4bd['id'];return db['CannedAnswer'][_0xac9a('0x54')](_0x104250[_0xac9a('0x55')]);}})[_0xac9a('0x1f')](respondWithResult(_0x580846,null))[_0xac9a('0x29')](handleError(_0x580846,null));};exports[_0xac9a('0x67')]=function(_0x39c3cd,_0x4279ae,_0x1f56a0){var _0x34781e={'raw':![],'where':{}};var _0x55e086={};var _0x82ad4d={'count':0x0,'rows':[]};return db[_0xac9a('0x4c')][_0xac9a('0x61')]({'where':{'id':_0x39c3cd[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x4279ae,null))['then'](function(_0x58fe87){if(_0x58fe87){_0x55e086[_0xac9a('0x3e')]=_[_0xac9a('0x40')](db[_0xac9a('0x68')][_0xac9a('0x3c')]);_0x55e086[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x39c3cd[_0xac9a('0x3f')]);_0x55e086[_0xac9a('0x41')]=_[_0xac9a('0x42')](_0x55e086[_0xac9a('0x3e')],_0x55e086[_0xac9a('0x3f')]);_0x34781e[_0xac9a('0x44')]=_[_0xac9a('0x42')](_0x55e086[_0xac9a('0x3e')],qs[_0xac9a('0x43')](_0x39c3cd['query'][_0xac9a('0x43')]));_0x34781e[_0xac9a('0x44')]=_0x34781e[_0xac9a('0x44')][_0xac9a('0x53')]?_0x34781e[_0xac9a('0x44')]:_0x55e086[_0xac9a('0x3e')];if(!_0x39c3cd[_0xac9a('0x3f')][_0xac9a('0x69')](_0xac9a('0x45'))){_0x34781e['limit']=qs[_0xac9a('0x2e')](_0x39c3cd[_0xac9a('0x3f')]['limit']);_0x34781e['offset']=qs[_0xac9a('0x2c')](_0x39c3cd[_0xac9a('0x3f')][_0xac9a('0x2c')]);}_0x34781e[_0xac9a('0x46')]=qs[_0xac9a('0x47')](_0x39c3cd[_0xac9a('0x3f')][_0xac9a('0x47')]);_0x34781e[_0xac9a('0x48')]=qs[_0xac9a('0x41')](_[_0xac9a('0x63')](_0x39c3cd[_0xac9a('0x3f')],_0x55e086['filters']));_0x34781e[_0xac9a('0x48')][_0xac9a('0x60')]=_0x58fe87['id'];if(_0x39c3cd['query']['filter']){_0x34781e[_0xac9a('0x48')]=_[_0xac9a('0x4a')](_0x34781e[_0xac9a('0x48')],{'$or':_[_0xac9a('0x3b')](_0x34781e[_0xac9a('0x44')],function(_0x130cde){var _0x59d377={};_0x59d377[_0x130cde]={'$like':'%'+_0x39c3cd[_0xac9a('0x3f')]['filter']+'%'};return _0x59d377;})});}_0x34781e=_['merge']({},_0x34781e,_0x39c3cd[_0xac9a('0x4b')]);return db[_0xac9a('0x68')][_0xac9a('0x2f')]({'where':_0x34781e[_0xac9a('0x48')]})['then'](function(_0x414008){_0x82ad4d[_0xac9a('0x2f')]=_0x414008;if(_0x39c3cd['query'][_0xac9a('0x4d')]){_0x34781e['include']=[{'all':!![]}];}return db[_0xac9a('0x68')]['findAll'](_0x34781e);})[_0xac9a('0x1f')](function(_0x37c252){_0x82ad4d['rows']=_0x37c252;return _0x82ad4d;});}})[_0xac9a('0x1f')](respondWithFilteredResult(_0x4279ae,_0x34781e))[_0xac9a('0x29')](handleError(_0x4279ae,null));};exports[_0xac9a('0x6a')]=function(_0x1d83b0,_0x3733da,_0xd26dda){return db[_0xac9a('0x4c')][_0xac9a('0x5b')]({'where':{'id':_0x1d83b0[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x3733da,null))[_0xac9a('0x1f')](function(_0x5bb7e6){if(_0x5bb7e6){return _0x5bb7e6['removeAnswers'](_0x1d83b0[_0xac9a('0x3f')][_0xac9a('0x6b')]);}})[_0xac9a('0x1f')](respondWithStatusCode(_0x3733da,null))[_0xac9a('0x29')](handleError(_0x3733da,null));};exports[_0xac9a('0x6c')]=function(_0x49c03d,_0xe7ebb2,_0x8dbb61){return db['WhatsappAccount'][_0xac9a('0x5b')]({'where':{'id':_0x49c03d[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0xe7ebb2,null))['then'](function(_0x4e1a91){if(_0x4e1a91){return _0x4e1a91['addAgents'](_0x49c03d[_0xac9a('0x55')]['ids'],_[_0xac9a('0x6d')](_0x49c03d[_0xac9a('0x55')],['ids','id'])||{})[_0xac9a('0x6e')](function(_0xcd6c87){for(var _0x12858c=0x0;_0x12858c<_0x49c03d[_0xac9a('0x55')][_0xac9a('0x6b')]['length'];_0x12858c+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x49c03d[_0xac9a('0x55')][_0xac9a('0x6b')][_0x12858c]),'WhatsappAccountId':Number(_0x49c03d[_0xac9a('0x51')]['id'])});}return _0xcd6c87;});}})['then'](respondWithResult(_0xe7ebb2,null))[_0xac9a('0x29')](handleError(_0xe7ebb2,null));};exports['removeAgents']=function(_0x4e6992,_0x2687ff,_0x40f979){return db[_0xac9a('0x4c')][_0xac9a('0x5b')]({'where':{'id':_0x4e6992[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x2687ff,null))[_0xac9a('0x1f')](function(_0x594cfd){if(_0x594cfd){return _0x594cfd['removeAgents'](_0x4e6992[_0xac9a('0x3f')][_0xac9a('0x6b')])[_0xac9a('0x1f')](function(){if(_[_0xac9a('0x6f')](_0x4e6992['query'][_0xac9a('0x6b')])){for(var _0x2f250f=0x0;_0x2f250f<_0x4e6992[_0xac9a('0x3f')]['ids'][_0xac9a('0x53')];_0x2f250f+=0x1){socket[_0xac9a('0x70')](_0xac9a('0x71'),{'UserId':Number(_0x4e6992[_0xac9a('0x3f')]['ids'][_0x2f250f]),'WhatsappAccountId':Number(_0x4e6992[_0xac9a('0x51')]['id'])});}}else{socket[_0xac9a('0x70')](_0xac9a('0x71'),{'UserId':Number(_0x4e6992[_0xac9a('0x3f')][_0xac9a('0x6b')]),'WhatsappAccountId':Number(_0x4e6992[_0xac9a('0x51')]['id'])});}});}})[_0xac9a('0x1f')](respondWithStatusCode(_0x2687ff,null))[_0xac9a('0x29')](handleError(_0x2687ff,null));};exports['getAgents']=function(_0x2888fc,_0x1d9e10,_0x23ef33){var _0x418168={};var _0x38a86e={};var _0x5e25ae;var _0x3f76fb;return db[_0xac9a('0x4c')][_0xac9a('0x61')]({'where':{'id':_0x2888fc[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x1d9e10,null))[_0xac9a('0x1f')](function(_0x49f4f0){if(_0x49f4f0){_0x5e25ae=_0x49f4f0;_0x38a86e[_0xac9a('0x3e')]=_[_0xac9a('0x40')](db[_0xac9a('0x72')][_0xac9a('0x3c')]);_0x38a86e[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x2888fc[_0xac9a('0x3f')]);_0x38a86e[_0xac9a('0x41')]=_['intersection'](_0x38a86e[_0xac9a('0x3e')],_0x38a86e[_0xac9a('0x3f')]);_0x418168[_0xac9a('0x44')]=_['intersection'](_0x38a86e[_0xac9a('0x3e')],qs[_0xac9a('0x43')](_0x2888fc[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x418168[_0xac9a('0x44')]=_0x418168[_0xac9a('0x44')][_0xac9a('0x53')]?_0x418168[_0xac9a('0x44')]:_0x38a86e[_0xac9a('0x3e')];_0x418168[_0xac9a('0x46')]=qs['sort'](_0x2888fc[_0xac9a('0x3f')]['sort']);_0x418168['where']=qs[_0xac9a('0x41')](_[_0xac9a('0x63')](_0x2888fc['query'],_0x38a86e[_0xac9a('0x41')]));if(_0x2888fc[_0xac9a('0x3f')][_0xac9a('0x49')]){_0x418168[_0xac9a('0x48')]=_[_0xac9a('0x4a')](_0x418168['where'],{'$or':_['map'](_0x418168[_0xac9a('0x44')],function(_0x105c82){var _0x3f7ec7={};_0x3f7ec7[_0x105c82]={'$like':'%'+_0x2888fc[_0xac9a('0x3f')][_0xac9a('0x49')]+'%'};return _0x3f7ec7;})});}_0x418168=_['merge']({},_0x418168,_0x2888fc[_0xac9a('0x4b')]);return _0x5e25ae['getAgents'](_0x418168);}})[_0xac9a('0x1f')](function(_0x1c2f70){if(_0x1c2f70){_0x3f76fb=_0x1c2f70[_0xac9a('0x53')];if(!_0x2888fc['query'][_0xac9a('0x69')]('nolimit')){_0x418168[_0xac9a('0x2e')]=qs[_0xac9a('0x2e')](_0x2888fc['query'][_0xac9a('0x2e')]);_0x418168['offset']=qs[_0xac9a('0x2c')](_0x2888fc[_0xac9a('0x3f')][_0xac9a('0x2c')]);}return _0x5e25ae[_0xac9a('0x73')](_0x418168);}})['then'](function(_0x4f7a5f){if(_0x4f7a5f){return _0x4f7a5f?{'count':_0x3f76fb,'rows':_0x4f7a5f}:null;}})[_0xac9a('0x1f')](respondWithResult(_0x1d9e10,null))[_0xac9a('0x29')](handleError(_0x1d9e10,null));};exports['addApplications']=function(_0x479355,_0x3f3163,_0x2fd5df){return db[_0xac9a('0x4c')]['findOne']({'where':{'id':_0x479355[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x3f3163,null))[_0xac9a('0x1f')](function(_0x5e7aaa){if(_0x5e7aaa){return db['sequelize'][_0xac9a('0x74')](function(_0x162926){return db[_0xac9a('0x75')][_0xac9a('0x5e')]({'where':{'WhatsappAccountId':_0x479355['params']['id']},'transaction':_0x162926})[_0xac9a('0x1f')](function(_0x44c1e9){var _0x567262=_[_0xac9a('0x3b')](_0x479355[_0xac9a('0x55')],function(_0x45e453){_0x45e453[_0xac9a('0x60')]=_0x479355[_0xac9a('0x51')]['id'];return _0x45e453;});return db[_0xac9a('0x75')][_0xac9a('0x76')](_0x567262,{'transaction':_0x162926});});})[_0xac9a('0x1f')](function(){return db[_0xac9a('0x75')][_0xac9a('0x77')]({'where':{'WhatsappAccountId':_0x479355[_0xac9a('0x51')]['id']},'order':_0xac9a('0x78')});});}})[_0xac9a('0x1f')](respondWithResult(_0x3f3163,null))[_0xac9a('0x29')](handleError(_0x3f3163,null));};exports[_0xac9a('0x79')]=function(_0x4b2ba4,_0x375a52,_0x495554){var _0x5ee7c8={};var _0x12be1e={};var _0x13a366;var _0x2e3c6c;return db[_0xac9a('0x4c')][_0xac9a('0x61')]({'where':{'id':_0x4b2ba4[_0xac9a('0x51')]['id']}})[_0xac9a('0x1f')](handleEntityNotFound(_0x375a52,null))['then'](function(_0x4f267c){if(_0x4f267c){_0x13a366=_0x4f267c;_0x12be1e[_0xac9a('0x3e')]=_[_0xac9a('0x40')](db[_0xac9a('0x75')][_0xac9a('0x3c')]);_0x12be1e['query']=_[_0xac9a('0x40')](_0x4b2ba4[_0xac9a('0x3f')]);_0x12be1e[_0xac9a('0x41')]=_['intersection'](_0x12be1e[_0xac9a('0x3e')],_0x12be1e[_0xac9a('0x3f')]);_0x5ee7c8[_0xac9a('0x44')]=_[_0xac9a('0x42')](_0x12be1e[_0xac9a('0x3e')],qs[_0xac9a('0x43')](_0x4b2ba4[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x5ee7c8[_0xac9a('0x44')]=_0x5ee7c8[_0xac9a('0x44')][_0xac9a('0x53')]?_0x5ee7c8[_0xac9a('0x44')]:_0x12be1e[_0xac9a('0x3e')];_0x5ee7c8['order']=qs[_0xac9a('0x47')](_0x4b2ba4[_0xac9a('0x3f')][_0xac9a('0x47')]);_0x5ee7c8['where']=qs[_0xac9a('0x41')](_['pick'](_0x4b2ba4[_0xac9a('0x3f')],_0x12be1e['filters']));if(_0x4b2ba4[_0xac9a('0x3f')][_0xac9a('0x49')]){_0x5ee7c8[_0xac9a('0x48')]=_[_0xac9a('0x4a')](_0x5ee7c8[_0xac9a('0x48')],{'$or':_[_0xac9a('0x3b')](_0x5ee7c8[_0xac9a('0x44')],function(_0x1bbda3){var _0x13ea4f={};_0x13ea4f[_0x1bbda3]={'$like':'%'+_0x4b2ba4['query'][_0xac9a('0x49')]+'%'};return _0x13ea4f;})});}_0x5ee7c8=_[_0xac9a('0x4a')]({},_0x5ee7c8,_0x4b2ba4[_0xac9a('0x4b')]);return _0x13a366[_0xac9a('0x79')](_0x5ee7c8);}})[_0xac9a('0x1f')](function(_0x1affc0){if(_0x1affc0){_0x2e3c6c=_0x1affc0['length'];if(!_0x4b2ba4[_0xac9a('0x3f')][_0xac9a('0x69')]('nolimit')){_0x5ee7c8[_0xac9a('0x2e')]=qs[_0xac9a('0x2e')](_0x4b2ba4[_0xac9a('0x3f')][_0xac9a('0x2e')]);_0x5ee7c8[_0xac9a('0x2c')]=qs['offset'](_0x4b2ba4[_0xac9a('0x3f')][_0xac9a('0x2c')]);}return _0x13a366[_0xac9a('0x79')](_0x5ee7c8);}})['then'](function(_0x502a9d){if(_0x502a9d){return _0x502a9d?{'count':_0x2e3c6c,'rows':_0x502a9d}:null;}})[_0xac9a('0x1f')](respondWithResult(_0x375a52,null))[_0xac9a('0x29')](handleError(_0x375a52,null));};exports[_0xac9a('0x7a')]=function(_0x328cf4,_0x1e559b,_0x5b41db){var _0x19f7e9={'channel':_0xac9a('0x7b')};var _0x555e9c=[];var _0x6ff42c=[];var _0x1d293a={};return db[_0xac9a('0x4c')]['find']({'where':{'id':_0x328cf4['params']['id']},'include':[{'model':db[_0xac9a('0x75')],'as':'Applications'}]})[_0xac9a('0x1f')](handleEntityNotFound(_0x1e559b,null))[_0xac9a('0x1f')](function(_0x20d52d){_0x19f7e9[_0xac9a('0x7c')]=_0x20d52d;_0x19f7e9['applications']=_[_0xac9a('0x7d')](_0x20d52d[_0xac9a('0x7e')],[_0xac9a('0x78')],[_0xac9a('0x7f')]);if(_0x19f7e9[_0xac9a('0x7c')]['Applications']){delete _0x19f7e9[_0xac9a('0x7c')]['Applications'];}return db['CmContact'][_0xac9a('0x5f')]();})[_0xac9a('0x1f')](function(_0x1439ec){if(!_0x1439ec){throw new db[(_0xac9a('0x80'))]['ValidationError']('no\x20available\x20attributes');}_0x555e9c=_[_0xac9a('0x81')](_[_0xac9a('0x40')](_0x1439ec),[_0xac9a('0x82'),_0xac9a('0x83')]);_0x6ff42c=_['difference'](_[_0xac9a('0x40')](_0x1439ec),[_0xac9a('0x82'),'updatedAt',_0xac9a('0x84'),_0xac9a('0x85')]);_0x19f7e9[_0xac9a('0x55')]={'mapKey':_0xac9a('0x86')};if(_0x19f7e9[_0xac9a('0x7c')][_0xac9a('0x3d')]&&_0x19f7e9[_0xac9a('0x7c')][_0xac9a('0x3d')]===_0xac9a('0x87')){_0x19f7e9[_0xac9a('0x55')]['from']=_0x328cf4[_0xac9a('0x55')][_0xac9a('0x88')][_0xac9a('0x89')]('whatsapp:','');_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x55')]=_0x328cf4[_0xac9a('0x55')][_0xac9a('0x8a')];_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x8b')]=_0x328cf4[_0xac9a('0x55')][_0xac9a('0x8c')];}if(_0x19f7e9[_0xac9a('0x55')]['id']){delete _0x19f7e9[_0xac9a('0x55')]['id'];}if(_[_0xac9a('0x8d')](_0x19f7e9['body'][_0xac9a('0x8e')])){throw new db[(_0xac9a('0x80'))]['ValidationError'](_0xac9a('0x8f'));}if(_[_0xac9a('0x8d')](_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x55')])||_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x55')]===''){throw new db['Sequelize'][(_0xac9a('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x19f7e9['body'][_0xac9a('0x91')])){throw new db[(_0xac9a('0x80'))][(_0xac9a('0x90'))](_0xac9a('0x92')+_0x6ff42c);}if(!_['includes'](_0x6ff42c,_0x19f7e9['body']['mapKey'])){throw new db[(_0xac9a('0x80'))][(_0xac9a('0x90'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6ff42c);}_0x1d293a[_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x91')]]=_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x8e')];return db[_0xac9a('0x93')][_0xac9a('0x5b')]({'where':{'id':_0x19f7e9[_0xac9a('0x7c')][_0xac9a('0x85')]},'include':[{'model':db[_0xac9a('0x94')],'as':_0xac9a('0x95'),'where':_0x1d293a,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xac9a('0x1f')](handleEntityNotFound(_0x1e559b,null))['then'](function(_0x44a91b){if(_0x44a91b){_0x19f7e9[_0xac9a('0x96')]=_['omit'](_0x44a91b,[_0xac9a('0x95')]);if(_0x44a91b[_0xac9a('0x95')][_0xac9a('0x53')]){return _0x44a91b[_0xac9a('0x95')][0x0];}var _0x171f6a=_['defaults'](_0x19f7e9[_0xac9a('0x55')],{'firstName':_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x8e')],'ListId':_0x44a91b['id']});_0x171f6a[_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x91')]]=_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x8e')];return db[_0xac9a('0x94')]['create'](_0x171f6a,{'fields':_0x555e9c,'raw':!![]});}})[_0xac9a('0x1f')](handleEntityNotFound(_0x1e559b,null))['then'](function(_0x288033){if(_0x288033){_0x19f7e9[_0xac9a('0x97')]=_0x288033;var _0x1bf97b={'ContactId':_0x288033['id'],'phone':_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x8e')],'WhatsappAccountId':_0x328cf4[_0xac9a('0x51')]['id']};var _0x397da2={'ContactId':_0x288033['id'],'WhatsappAccountId':_0x328cf4['params']['id'],'closed':![]};return db[_0xac9a('0x98')][_0xac9a('0x5b')]({'where':_0x397da2})[_0xac9a('0x1f')](function(_0x570050){if(_0x570050){return[_0x570050,![]];}return db[_0xac9a('0x98')]['create'](_0x1bf97b)[_0xac9a('0x1f')](function(_0x33f6cb){return[_0x33f6cb,!![]];});});}})['spread'](function(_0x1ca5cf,_0x519959){_0x19f7e9[_0xac9a('0x99')]=_0x1ca5cf['get']({'plain':!![]});_0x19f7e9['interaction'][_0xac9a('0x9a')]=![];if(_0x519959){if(_0x19f7e9['account'][_0xac9a('0x9b')]){_0x19f7e9[_0xac9a('0x9c')]['push']({'id':0x0,'priority':_0x19f7e9[_0xac9a('0x9c')][_0xac9a('0x53')]+0x1,'app':_0xac9a('0x9d'),'appdata':_0xac9a('0x9e'),'interval':_0xac9a('0x9f')});}_0x19f7e9[_0xac9a('0x99')][_0xac9a('0x9a')]=!![];}return db['WhatsappMessage'][_0xac9a('0x54')]({'phone':_0x19f7e9[_0xac9a('0x55')]['from'],'messageId':_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x8b')],'body':_0x19f7e9[_0xac9a('0x55')][_0xac9a('0x55')],'WhatsappAccountId':_0x328cf4[_0xac9a('0x51')]['id'],'WhatsappInteractionId':_0x1ca5cf['id'],'direction':'in','ContactId':_0x1ca5cf[_0xac9a('0xa0')],'AttachmentId':_0x19f7e9['body']['AttachmentId']});})[_0xac9a('0x1f')](function(_0x33a57e){_0x19f7e9[_0xac9a('0x27')]=_0x33a57e;if(_0x19f7e9[_0xac9a('0x99')][_0xac9a('0xa1')]){return db['User']['find']({'attributes':['id',_0xac9a('0x37')],'where':{'id':_0x19f7e9[_0xac9a('0x99')][_0xac9a('0xa1')]}})[_0xac9a('0x1f')](function(_0x512f17){if(_0x512f17){_0x19f7e9[_0xac9a('0x9c')]['unshift']({'id':0x0,'priority':0x0,'app':_0xac9a('0xa2'),'appdata':_0x512f17[_0xac9a('0x37')]+','+(_0x19f7e9[_0xac9a('0x7c')][_0xac9a('0xa3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xac9a('0xa4'),_0x19f7e9);});}return respondWithRpcPromise(_0xac9a('0xa5'),_0xac9a('0xa4'),_0x19f7e9);})[_0xac9a('0x1f')](function(_0x19c569){if(_0x19c569){var _0x465b1c=0xc8;var _0x3f6340='receiveMessage';logger[_0xac9a('0x20')](_0xac9a('0xa6'),_0x3f6340,_0x465b1c,'entity\x20found');logger[_0xac9a('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3f6340,_0x465b1c,_0xac9a('0xa7'),JSON[_0xac9a('0x24')](_0x19c569));if(_0x19f7e9['account']['type']==='twilio'){return _0x1e559b['status'](_0x465b1c)[_0xac9a('0xa8')]('Content-Type',_0xac9a('0xa9'))[_0xac9a('0x38')](_0xac9a('0xaa'));}else{return _0x1e559b[_0xac9a('0x2b')](_0x465b1c)[_0xac9a('0x31')](_0x19c569);}}})['catch'](handleError(_0x1e559b,null));};exports[_0xac9a('0x38')]=function(_0x50a85a,_0x69633b,_0x319c29){var _0x139b61,_0x9390df,_0xd5ca2b;if(_['isNil'](_0x50a85a[_0xac9a('0x55')][_0xac9a('0x55')])||_0x50a85a[_0xac9a('0x55')]['body']===''){throw new db[(_0xac9a('0x80'))][(_0xac9a('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xac9a('0x8d')](_0x50a85a['body']['to'])){throw new db[(_0xac9a('0x80'))][(_0xac9a('0x90'))](_0xac9a('0xab'));}_0x139b61=_0x50a85a[_0xac9a('0x55')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x50a85a[_0xac9a('0x51')]['id']},'include':[{'model':db[_0xac9a('0x93')],'as':_0xac9a('0xac'),'include':[{'model':db[_0xac9a('0x94')],'as':_0xac9a('0x95'),'where':{'mobile':_0x139b61},'limit':0x1,'order':[[_0xac9a('0x83'),_0xac9a('0xad')]]}]}]})[_0xac9a('0x1f')](handleEntityNotFound(_0x69633b,null))[_0xac9a('0x1f')](function(_0x4e42a2){if(_0x4e42a2&&_0x4e42a2[_0xac9a('0xac')]){_0x9390df=_0x4e42a2[_0xac9a('0x34')]({'plain':!![]});if(_0x9390df[_0xac9a('0xac')]&&_0x9390df[_0xac9a('0xac')][_0xac9a('0x95')]['length']){return _0x9390df[_0xac9a('0xac')][_0xac9a('0x95')][0x0];}return db[_0xac9a('0x94')][_0xac9a('0x54')](_[_0xac9a('0x17')](_0x50a85a[_0xac9a('0x55')],{'firstName':_0x139b61,'mobile':_0x139b61,'phone':_0x139b61,'ListId':_0x9390df[_0xac9a('0x85')]}));}})[_0xac9a('0x1f')](handleEntityNotFound(_0x69633b,null))[_0xac9a('0x1f')](function(_0x10dfb3){if(_0x10dfb3){_0xd5ca2b=_0x10dfb3;return db[_0xac9a('0x98')][_0xac9a('0x5b')]({'where':{'ContactId':_0xd5ca2b['id'],'closed':![],'WhatsappAccountId':_0x9390df['id']}})['then'](function(_0xab05e8){if(_0xab05e8){return[_0xab05e8,![]];}return db[_0xac9a('0x98')][_0xac9a('0x54')]({'UserId':_0x50a85a[_0xac9a('0x56')]['id'],'ContactId':_0xd5ca2b['id'],'WhatsappAccountId':_0x9390df['id'],'phone':_0x139b61,'firstMsgDirection':_0xac9a('0xae'),'Messages':[_[_0xac9a('0x4a')](_0x50a85a[_0xac9a('0x55')],{'read':![],'body':_0x50a85a[_0xac9a('0x55')][_0xac9a('0x55')],'phone':_0x139b61,'WhatsappAccountId':_0x9390df['id'],'UserId':_0x50a85a[_0xac9a('0x56')]['id'],'ContactId':_0xd5ca2b['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0xac9a('0x1f')](function(_0x72121){return[_0x72121,!![]];});});}})[_0xac9a('0x6e')](function(_0x31294b,_0x591aee){if(_0x591aee){return _0x31294b;}return db[_0xac9a('0xaf')][_0xac9a('0x54')](_['merge'](_0x50a85a[_0xac9a('0x55')],{'read':![],'body':_0x50a85a[_0xac9a('0x55')][_0xac9a('0x55')],'phone':_0x139b61,'WhatsappAccountId':_0x9390df['id'],'WhatsappInteractionId':_0x31294b['id'],'UserId':_0x50a85a[_0xac9a('0x56')]['id'],'ContactId':_0xd5ca2b['id']}))['then'](function(_0x2684a9){_0x31294b['dataValues'][_0xac9a('0xb0')]=[];_0x31294b[_0xac9a('0xb1')][_0xac9a('0xb0')]['push'](_0x2684a9[_0xac9a('0xb1')]);return _0x31294b;});})[_0xac9a('0x1f')](respondWithResult(_0x69633b,null))[_0xac9a('0x29')](handleError(_0x69633b,null));}; \ No newline at end of file +var _0xb609=['applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','replace','whatsapp:','Body','messageId','MessageSid','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','account'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xb609,0xf8));var _0x9b60=function(_0x3f58d8,_0x5e516f){_0x3f58d8=_0x3f58d8-0x0;var _0x2e44d0=_0xb609[_0x3f58d8];return _0x2e44d0;};'use strict';var emlformat=require(_0x9b60('0x0'));var rimraf=require(_0x9b60('0x1'));var zipdir=require(_0x9b60('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b60('0x3'));var moment=require(_0x9b60('0x4'));var BPromise=require(_0x9b60('0x5'));var Mustache=require(_0x9b60('0x6'));var util=require(_0x9b60('0x7'));var path=require(_0x9b60('0x8'));var sox=require(_0x9b60('0x9'));var csv=require(_0x9b60('0xa'));var ejs=require(_0x9b60('0xb'));var fs=require('fs');var fs_extra=require(_0x9b60('0xc'));var _=require(_0x9b60('0xd'));var squel=require(_0x9b60('0xe'));var crypto=require(_0x9b60('0xf'));var jsforce=require(_0x9b60('0x10'));var deskjs=require(_0x9b60('0x11'));var toCsv=require(_0x9b60('0xa'));var querystring=require(_0x9b60('0x12'));var Papa=require(_0x9b60('0x13'));var Redis=require('ioredis');var authService=require(_0x9b60('0x14'));var qs=require(_0x9b60('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b60('0x16'));var logger=require(_0x9b60('0x17'))(_0x9b60('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b60('0x19'));var db=require(_0x9b60('0x1a'))['db'];config[_0x9b60('0x1b')]=_['defaults'](config[_0x9b60('0x1b')],{'host':_0x9b60('0x1c'),'port':0x18eb});var socket=require(_0x9b60('0x1d'))(new Redis(config[_0x9b60('0x1b')]));require(_0x9b60('0x1e'))[_0x9b60('0x1f')](socket);var jayson=require(_0x9b60('0x20'));var client=jayson[_0x9b60('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x55f2a2,_0x26ce25,_0x4d881c,_0x2072e1){return new BPromise(function(_0x5147d1,_0x10607b){var _0x52dba8=_0x2072e1||client;return _0x52dba8[_0x9b60('0x22')](_0x55f2a2,_0x4d881c)[_0x9b60('0x23')](function(_0x4635bf){logger[_0x9b60('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x26ce25,_0x9b60('0x25'));logger['debug'](_0x9b60('0x26'),_0x26ce25,_0x9b60('0x25'),JSON[_0x9b60('0x27')](_0x4635bf));if(_0x4635bf[_0x9b60('0x28')]){if(_0x4635bf['error'][_0x9b60('0x29')]===0x1f4){logger['error'](_0x9b60('0x2a'),_0x26ce25,_0x4635bf[_0x9b60('0x28')][_0x9b60('0x2b')]);return _0x10607b(_0x4635bf[_0x9b60('0x28')][_0x9b60('0x2b')]);}logger[_0x9b60('0x28')](_0x9b60('0x2a'),_0x26ce25,_0x4635bf[_0x9b60('0x28')][_0x9b60('0x2b')]);return _0x5147d1(_0x4635bf[_0x9b60('0x28')][_0x9b60('0x2b')]);}else{logger[_0x9b60('0x24')](_0x9b60('0x2a'),_0x26ce25,_0x9b60('0x25'));_0x5147d1(_0x4635bf[_0x9b60('0x2c')][_0x9b60('0x2b')]);}})['catch'](function(_0x25ad9d){logger[_0x9b60('0x28')](_0x9b60('0x2a'),_0x26ce25,_0x25ad9d);_0x10607b(_0x25ad9d);});});}function respondWithStatusCode(_0x3380e9,_0x5936bf){_0x5936bf=_0x5936bf||0xcc;return function(_0x35a779){if(_0x35a779){return _0x3380e9[_0x9b60('0x2d')](_0x5936bf);}return _0x3380e9[_0x9b60('0x2e')](_0x5936bf)['end']();};}function respondWithResult(_0x35a4d4,_0x46fff5){_0x46fff5=_0x46fff5||0xc8;return function(_0xd957ee){if(_0xd957ee){return _0x35a4d4[_0x9b60('0x2e')](_0x46fff5)[_0x9b60('0x2f')](_0xd957ee);}};}function respondWithFilteredResult(_0x2dc557,_0x567d17){return function(_0x47af14){if(_0x47af14){var _0x2bc4e0=typeof _0x567d17[_0x9b60('0x30')]===_0x9b60('0x31')&&typeof _0x567d17[_0x9b60('0x32')]===_0x9b60('0x31');var _0x38e78e=_0x47af14[_0x9b60('0x33')];var _0x3a4442=_0x2bc4e0?0x0:_0x567d17[_0x9b60('0x30')];var _0x44953c=_0x2bc4e0?_0x47af14[_0x9b60('0x33')]:_0x567d17[_0x9b60('0x30')]+_0x567d17[_0x9b60('0x32')];var _0x454402;if(_0x44953c>=_0x38e78e){_0x44953c=_0x38e78e;_0x454402=0xc8;}else{_0x454402=0xce;}_0x2dc557['status'](_0x454402);return _0x2dc557[_0x9b60('0x34')](_0x9b60('0x35'),_0x3a4442+'-'+_0x44953c+'/'+_0x38e78e)['json'](_0x47af14);}return null;};}function patchUpdates(_0x414fae){return function(_0x2e2cf1){try{jsonpatch[_0x9b60('0x36')](_0x2e2cf1,_0x414fae,!![]);}catch(_0x17ca9b){return BPromise[_0x9b60('0x37')](_0x17ca9b);}return _0x2e2cf1['save']();};}function saveUpdates(_0x1eb3bd,_0x8708d8){return function(_0x4cf8e4){if(_0x4cf8e4){return _0x4cf8e4[_0x9b60('0x38')](_0x1eb3bd)['then'](function(_0x406368){return _0x406368;});}return null;};}function removeEntity(_0x53584c,_0x4ee548){return function(_0xfe779b){if(_0xfe779b){return _0xfe779b[_0x9b60('0x39')]()['then'](function(){var _0x2fd92a=_0xfe779b[_0x9b60('0x3a')]({'plain':!![]});var _0x451435='WhatsappAccounts';return db[_0x9b60('0x3b')]['destroy']({'where':{'type':_0x451435,'resourceId':_0x2fd92a['id']}})[_0x9b60('0x23')](function(){return _0xfe779b;});})['then'](function(){_0x53584c[_0x9b60('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x447761,_0x4e17a9){return function(_0x475ae1){if(!_0x475ae1){_0x447761[_0x9b60('0x2d')](0x194);}return _0x475ae1;};}function handleError(_0x2067f8,_0x1d94c4){_0x1d94c4=_0x1d94c4||0x1f4;return function(_0x3d934b){logger[_0x9b60('0x28')](_0x3d934b[_0x9b60('0x3c')]);if(_0x3d934b[_0x9b60('0x3d')]){delete _0x3d934b['name'];}_0x2067f8['status'](_0x1d94c4)[_0x9b60('0x3e')](_0x3d934b);};}exports[_0x9b60('0x3f')]=function(_0x362e08,_0x7c8eca){var _0x239b68={'include':[{'model':db[_0x9b60('0x40')],'as':_0x9b60('0x41')}]},_0x3a3307={},_0x9ec5ce={'count':0x0,'rows':[]};var _0x1f0cf0=_['map'](db[_0x9b60('0x42')]['rawAttributes'],function(_0x3c514b){return{'name':_0x3c514b[_0x9b60('0x43')],'type':_0x3c514b[_0x9b60('0x44')][_0x9b60('0x45')]};});_0x3a3307[_0x9b60('0x46')]=_[_0x9b60('0x47')](_0x1f0cf0,_0x9b60('0x3d'));_0x3a3307['query']=_[_0x9b60('0x48')](_0x362e08[_0x9b60('0x49')]);_0x3a3307[_0x9b60('0x4a')]=_[_0x9b60('0x4b')](_0x3a3307['model'],_0x3a3307[_0x9b60('0x49')]);_0x239b68['attributes']=_[_0x9b60('0x4b')](_0x3a3307[_0x9b60('0x46')],qs['fields'](_0x362e08[_0x9b60('0x49')][_0x9b60('0x4c')]));_0x239b68[_0x9b60('0x4d')]=_0x239b68[_0x9b60('0x4d')]['length']?_0x239b68[_0x9b60('0x4d')]:_0x3a3307[_0x9b60('0x46')];if(!_0x362e08['query'][_0x9b60('0x4e')](_0x9b60('0x4f'))){_0x239b68[_0x9b60('0x32')]=qs[_0x9b60('0x32')](_0x362e08['query'][_0x9b60('0x32')]);_0x239b68['offset']=qs[_0x9b60('0x30')](_0x362e08['query'][_0x9b60('0x30')]);}_0x239b68['order']=qs[_0x9b60('0x50')](_0x362e08['query'][_0x9b60('0x50')]);_0x239b68[_0x9b60('0x51')]=qs[_0x9b60('0x4a')](_[_0x9b60('0x52')](_0x362e08['query'],_0x3a3307[_0x9b60('0x4a')]),_0x1f0cf0);if(_0x362e08[_0x9b60('0x49')][_0x9b60('0x53')]){_0x239b68[_0x9b60('0x51')]=_[_0x9b60('0x54')](_0x239b68['where'],{'$or':_[_0x9b60('0x47')](_0x1f0cf0,function(_0x120b9c){if(_0x120b9c[_0x9b60('0x44')]!==_0x9b60('0x55')){var _0x4c3ad5={};_0x4c3ad5[_0x120b9c[_0x9b60('0x3d')]]={'$like':'%'+_0x362e08[_0x9b60('0x49')][_0x9b60('0x53')]+'%'};return _0x4c3ad5;}})});}_0x239b68=_[_0x9b60('0x54')]({},_0x239b68,_0x362e08[_0x9b60('0x56')]);var _0x3b81df={'where':_0x239b68[_0x9b60('0x51')]};return db['WhatsappAccount'][_0x9b60('0x33')](_0x3b81df)[_0x9b60('0x23')](function(_0x465219){_0x9ec5ce[_0x9b60('0x33')]=_0x465219;if(_0x362e08[_0x9b60('0x49')][_0x9b60('0x57')]){_0x239b68['include']=[{'all':!![]}];}return db[_0x9b60('0x42')][_0x9b60('0x58')](_0x239b68);})[_0x9b60('0x23')](function(_0x4993f0){_0x9ec5ce['rows']=_0x4993f0;return _0x9ec5ce;})[_0x9b60('0x23')](respondWithFilteredResult(_0x7c8eca,_0x239b68))['catch'](handleError(_0x7c8eca,null));};exports[_0x9b60('0x59')]=function(_0x4a9849,_0xd569cf){var _0x3f3451={'raw':![],'where':{'id':_0x4a9849[_0x9b60('0x5a')]['id']},'include':[{'model':db[_0x9b60('0x40')],'as':_0x9b60('0x41')}]},_0x48ade9={};_0x48ade9[_0x9b60('0x46')]=_['keys'](db['WhatsappAccount'][_0x9b60('0x5b')]);_0x48ade9[_0x9b60('0x49')]=_[_0x9b60('0x48')](_0x4a9849[_0x9b60('0x49')]);_0x48ade9[_0x9b60('0x4a')]=_[_0x9b60('0x4b')](_0x48ade9[_0x9b60('0x46')],_0x48ade9['query']);_0x3f3451[_0x9b60('0x4d')]=_[_0x9b60('0x4b')](_0x48ade9['model'],qs[_0x9b60('0x4c')](_0x4a9849['query'][_0x9b60('0x4c')]));_0x3f3451[_0x9b60('0x4d')]=_0x3f3451[_0x9b60('0x4d')][_0x9b60('0x5c')]?_0x3f3451['attributes']:_0x48ade9['model'];if(_0x4a9849[_0x9b60('0x49')]['includeAll']){_0x3f3451[_0x9b60('0x5d')]=[{'all':!![]}];}_0x3f3451=_['merge']({},_0x3f3451,_0x4a9849[_0x9b60('0x56')]);return db[_0x9b60('0x42')][_0x9b60('0x5e')](_0x3f3451)['then'](handleEntityNotFound(_0xd569cf,null))[_0x9b60('0x23')](respondWithResult(_0xd569cf,null))[_0x9b60('0x5f')](handleError(_0xd569cf,null));};exports[_0x9b60('0x60')]=function(_0x30e949,_0x1b6fe3){return db['WhatsappAccount'][_0x9b60('0x60')](_0x30e949['body'],{})[_0x9b60('0x23')](function(_0x37f467){var _0x3ccf57=_0x30e949[_0x9b60('0x61')][_0x9b60('0x3a')]({'plain':!![]});if(!_0x3ccf57)throw new Error(_0x9b60('0x62'));if(_0x3ccf57[_0x9b60('0x63')]==='user'){var _0x50e130=_0x37f467[_0x9b60('0x3a')]({'plain':!![]});var _0x41ad83=_0x9b60('0x64');return db['UserProfileSection']['find']({'where':{'name':_0x41ad83,'userProfileId':_0x3ccf57['userProfileId']},'raw':!![]})['then'](function(_0x4328a7){if(_0x4328a7&&_0x4328a7[_0x9b60('0x65')]===0x0){return db[_0x9b60('0x3b')][_0x9b60('0x60')]({'name':_0x50e130[_0x9b60('0x3d')],'resourceId':_0x50e130['id'],'type':_0x4328a7[_0x9b60('0x3d')],'sectionId':_0x4328a7['id']},{})['then'](function(){return _0x37f467;});}else{return _0x37f467;}})[_0x9b60('0x5f')](function(_0x3526fb){logger['error'](_0x9b60('0x66'),_0x3526fb);throw _0x3526fb;});}return _0x37f467;})[_0x9b60('0x23')](respondWithResult(_0x1b6fe3,0xc9))['catch'](handleError(_0x1b6fe3,null));};exports[_0x9b60('0x38')]=function(_0x5ed42a,_0x2e855e){if(_0x5ed42a[_0x9b60('0x67')]['id']){delete _0x5ed42a['body']['id'];}return db['WhatsappAccount'][_0x9b60('0x5e')]({'where':{'id':_0x5ed42a[_0x9b60('0x5a')]['id']},'include':[{'model':db[_0x9b60('0x40')],'as':_0x9b60('0x41')}]})[_0x9b60('0x23')](handleEntityNotFound(_0x2e855e,null))['then'](saveUpdates(_0x5ed42a[_0x9b60('0x67')],null))['then'](respondWithResult(_0x2e855e,null))[_0x9b60('0x5f')](handleError(_0x2e855e,null));};exports['destroy']=function(_0x38350c,_0x1e2e12){return db[_0x9b60('0x42')]['find']({'where':{'id':_0x38350c[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x1e2e12,null))[_0x9b60('0x23')](removeEntity(_0x1e2e12,null))[_0x9b60('0x5f')](handleError(_0x1e2e12,null));};exports[_0x9b60('0x68')]=function(_0x5d7bd7,_0x27ba37){return db[_0x9b60('0x42')]['describe']()[_0x9b60('0x23')](respondWithResult(_0x27ba37,null))[_0x9b60('0x5f')](handleError(_0x27ba37,null));};exports[_0x9b60('0x69')]=function(_0x499fa5,_0x43f023,_0x1b20e8){if(_0x499fa5[_0x9b60('0x67')]['id']){delete _0x499fa5['body']['id'];}return db[_0x9b60('0x42')]['find']({'where':{'id':_0x499fa5[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x43f023,null))[_0x9b60('0x23')](function(_0x518ff1){if(_0x518ff1){_0x499fa5[_0x9b60('0x67')][_0x9b60('0x6a')]=_0x518ff1['id'];return db[_0x9b60('0x6b')]['create'](_0x499fa5[_0x9b60('0x67')]);}})[_0x9b60('0x23')](respondWithResult(_0x43f023,null))[_0x9b60('0x5f')](handleError(_0x43f023,null));};exports['getDispositions']=function(_0x115b46,_0x36dc76,_0x4d2223){var _0x1fe47d={'raw':![],'where':{}};var _0x206415={};var _0x358618={'count':0x0,'rows':[]};return db[_0x9b60('0x42')][_0x9b60('0x6c')]({'where':{'id':_0x115b46['params']['id']}})['then'](handleEntityNotFound(_0x36dc76,null))[_0x9b60('0x23')](function(_0x1fd21a){if(_0x1fd21a){_0x206415[_0x9b60('0x46')]=_['keys'](db['Disposition'][_0x9b60('0x5b')]);_0x206415[_0x9b60('0x49')]=_[_0x9b60('0x48')](_0x115b46['query']);_0x206415[_0x9b60('0x4a')]=_[_0x9b60('0x4b')](_0x206415['model'],_0x206415['query']);_0x1fe47d[_0x9b60('0x4d')]=_[_0x9b60('0x4b')](_0x206415['model'],qs[_0x9b60('0x4c')](_0x115b46[_0x9b60('0x49')][_0x9b60('0x4c')]));_0x1fe47d[_0x9b60('0x4d')]=_0x1fe47d[_0x9b60('0x4d')][_0x9b60('0x5c')]?_0x1fe47d['attributes']:_0x206415[_0x9b60('0x46')];if(!_0x115b46['query'][_0x9b60('0x4e')](_0x9b60('0x4f'))){_0x1fe47d[_0x9b60('0x32')]=qs['limit'](_0x115b46[_0x9b60('0x49')]['limit']);_0x1fe47d['offset']=qs[_0x9b60('0x30')](_0x115b46[_0x9b60('0x49')][_0x9b60('0x30')]);}_0x1fe47d[_0x9b60('0x6d')]=qs['sort'](_0x115b46['query'][_0x9b60('0x50')]);_0x1fe47d[_0x9b60('0x51')]=qs['filters'](_[_0x9b60('0x52')](_0x115b46[_0x9b60('0x49')],_0x206415[_0x9b60('0x4a')]));_0x1fe47d[_0x9b60('0x51')][_0x9b60('0x6a')]=_0x1fd21a['id'];if(_0x115b46['query'][_0x9b60('0x53')]){_0x1fe47d[_0x9b60('0x51')]=_[_0x9b60('0x54')](_0x1fe47d['where'],{'$or':_['map'](_0x1fe47d[_0x9b60('0x4d')],function(_0x129aab){var _0x38baf5={};_0x38baf5[_0x129aab]={'$like':'%'+_0x115b46[_0x9b60('0x49')][_0x9b60('0x53')]+'%'};return _0x38baf5;})});}_0x1fe47d=_[_0x9b60('0x54')]({},_0x1fe47d,_0x115b46[_0x9b60('0x56')]);return db[_0x9b60('0x6b')][_0x9b60('0x33')]({'where':_0x1fe47d[_0x9b60('0x51')]})[_0x9b60('0x23')](function(_0x3901c1){_0x358618[_0x9b60('0x33')]=_0x3901c1;if(_0x115b46[_0x9b60('0x49')][_0x9b60('0x57')]){_0x1fe47d[_0x9b60('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0x9b60('0x58')](_0x1fe47d);})[_0x9b60('0x23')](function(_0x288d82){_0x358618['rows']=_0x288d82;return _0x358618;});}})[_0x9b60('0x23')](respondWithFilteredResult(_0x36dc76,_0x1fe47d))[_0x9b60('0x5f')](handleError(_0x36dc76,null));};exports[_0x9b60('0x6e')]=function(_0x24769b,_0xd10555,_0x1131b3){return db[_0x9b60('0x42')]['find']({'where':{'id':_0x24769b[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0xd10555,null))[_0x9b60('0x23')](function(_0x101f9e){if(_0x101f9e){return _0x101f9e[_0x9b60('0x6e')](_0x24769b[_0x9b60('0x49')][_0x9b60('0x6f')]);}})[_0x9b60('0x23')](respondWithStatusCode(_0xd10555,null))['catch'](handleError(_0xd10555,null));};exports[_0x9b60('0x70')]=function(_0x129ceb,_0x2f85c5,_0x5f4fe9){if(_0x129ceb[_0x9b60('0x67')]['id']){delete _0x129ceb[_0x9b60('0x67')]['id'];}return db[_0x9b60('0x42')][_0x9b60('0x5e')]({'where':{'id':_0x129ceb[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x2f85c5,null))['then'](function(_0x444d97){if(_0x444d97){_0x129ceb[_0x9b60('0x67')][_0x9b60('0x6a')]=_0x444d97['id'];return db[_0x9b60('0x71')][_0x9b60('0x60')](_0x129ceb['body']);}})['then'](respondWithResult(_0x2f85c5,null))[_0x9b60('0x5f')](handleError(_0x2f85c5,null));};exports[_0x9b60('0x72')]=function(_0x31ae85,_0x388f97,_0x323f4b){var _0x10b1fa={'raw':![],'where':{}};var _0x26add4={};var _0x520e68={'count':0x0,'rows':[]};return db[_0x9b60('0x42')][_0x9b60('0x6c')]({'where':{'id':_0x31ae85[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x388f97,null))['then'](function(_0x8eef34){if(_0x8eef34){_0x26add4[_0x9b60('0x46')]=_['keys'](db['CannedAnswer'][_0x9b60('0x5b')]);_0x26add4['query']=_[_0x9b60('0x48')](_0x31ae85[_0x9b60('0x49')]);_0x26add4[_0x9b60('0x4a')]=_['intersection'](_0x26add4[_0x9b60('0x46')],_0x26add4[_0x9b60('0x49')]);_0x10b1fa[_0x9b60('0x4d')]=_['intersection'](_0x26add4['model'],qs['fields'](_0x31ae85[_0x9b60('0x49')]['fields']));_0x10b1fa[_0x9b60('0x4d')]=_0x10b1fa['attributes'][_0x9b60('0x5c')]?_0x10b1fa['attributes']:_0x26add4[_0x9b60('0x46')];if(!_0x31ae85[_0x9b60('0x49')][_0x9b60('0x4e')](_0x9b60('0x4f'))){_0x10b1fa['limit']=qs[_0x9b60('0x32')](_0x31ae85['query']['limit']);_0x10b1fa['offset']=qs[_0x9b60('0x30')](_0x31ae85[_0x9b60('0x49')][_0x9b60('0x30')]);}_0x10b1fa[_0x9b60('0x6d')]=qs['sort'](_0x31ae85[_0x9b60('0x49')][_0x9b60('0x50')]);_0x10b1fa[_0x9b60('0x51')]=qs[_0x9b60('0x4a')](_['pick'](_0x31ae85[_0x9b60('0x49')],_0x26add4['filters']));_0x10b1fa[_0x9b60('0x51')]['WhatsappAccountId']=_0x8eef34['id'];if(_0x31ae85['query']['filter']){_0x10b1fa[_0x9b60('0x51')]=_[_0x9b60('0x54')](_0x10b1fa[_0x9b60('0x51')],{'$or':_[_0x9b60('0x47')](_0x10b1fa[_0x9b60('0x4d')],function(_0x1fa410){var _0x4b814b={};_0x4b814b[_0x1fa410]={'$like':'%'+_0x31ae85[_0x9b60('0x49')][_0x9b60('0x53')]+'%'};return _0x4b814b;})});}_0x10b1fa=_[_0x9b60('0x54')]({},_0x10b1fa,_0x31ae85[_0x9b60('0x56')]);return db[_0x9b60('0x71')][_0x9b60('0x33')]({'where':_0x10b1fa[_0x9b60('0x51')]})['then'](function(_0x40af8e){_0x520e68['count']=_0x40af8e;if(_0x31ae85[_0x9b60('0x49')][_0x9b60('0x57')]){_0x10b1fa[_0x9b60('0x5d')]=[{'all':!![]}];}return db[_0x9b60('0x71')][_0x9b60('0x58')](_0x10b1fa);})[_0x9b60('0x23')](function(_0x348e63){_0x520e68[_0x9b60('0x73')]=_0x348e63;return _0x520e68;});}})[_0x9b60('0x23')](respondWithFilteredResult(_0x388f97,_0x10b1fa))[_0x9b60('0x5f')](handleError(_0x388f97,null));};exports[_0x9b60('0x74')]=function(_0x5b703d,_0x1351c3,_0x2ce493){return db[_0x9b60('0x42')][_0x9b60('0x5e')]({'where':{'id':_0x5b703d[_0x9b60('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1351c3,null))[_0x9b60('0x23')](function(_0x424e14){if(_0x424e14){return _0x424e14[_0x9b60('0x74')](_0x5b703d['query'][_0x9b60('0x6f')]);}})[_0x9b60('0x23')](respondWithStatusCode(_0x1351c3,null))[_0x9b60('0x5f')](handleError(_0x1351c3,null));};exports['addAgents']=function(_0x4775ae,_0x108aa7,_0xae0650){return db[_0x9b60('0x42')][_0x9b60('0x5e')]({'where':{'id':_0x4775ae[_0x9b60('0x5a')]['id']}})['then'](handleEntityNotFound(_0x108aa7,null))[_0x9b60('0x23')](function(_0x3a242b){if(_0x3a242b){return _0x3a242b[_0x9b60('0x75')](_0x4775ae[_0x9b60('0x67')][_0x9b60('0x6f')],_[_0x9b60('0x76')](_0x4775ae[_0x9b60('0x67')],[_0x9b60('0x6f'),'id'])||{})['spread'](function(_0x57eaec){for(var _0x286da1=0x0;_0x286da1<_0x4775ae[_0x9b60('0x67')][_0x9b60('0x6f')][_0x9b60('0x5c')];_0x286da1+=0x1){socket[_0x9b60('0x77')](_0x9b60('0x78'),{'UserId':Number(_0x4775ae[_0x9b60('0x67')][_0x9b60('0x6f')][_0x286da1]),'WhatsappAccountId':Number(_0x4775ae[_0x9b60('0x5a')]['id'])});}return _0x57eaec;});}})[_0x9b60('0x23')](respondWithResult(_0x108aa7,null))[_0x9b60('0x5f')](handleError(_0x108aa7,null));};exports[_0x9b60('0x79')]=function(_0x380192,_0x2b9ad6,_0x116173){return db[_0x9b60('0x42')][_0x9b60('0x5e')]({'where':{'id':_0x380192[_0x9b60('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2b9ad6,null))[_0x9b60('0x23')](function(_0x13e2ab){if(_0x13e2ab){return _0x13e2ab[_0x9b60('0x79')](_0x380192['query']['ids'])[_0x9b60('0x23')](function(){if(_['isArray'](_0x380192['query'][_0x9b60('0x6f')])){for(var _0x4dc2bd=0x0;_0x4dc2bd<_0x380192[_0x9b60('0x49')]['ids'][_0x9b60('0x5c')];_0x4dc2bd+=0x1){socket[_0x9b60('0x77')](_0x9b60('0x7a'),{'UserId':Number(_0x380192[_0x9b60('0x49')][_0x9b60('0x6f')][_0x4dc2bd]),'WhatsappAccountId':Number(_0x380192[_0x9b60('0x5a')]['id'])});}}else{socket[_0x9b60('0x77')](_0x9b60('0x7a'),{'UserId':Number(_0x380192[_0x9b60('0x49')][_0x9b60('0x6f')]),'WhatsappAccountId':Number(_0x380192[_0x9b60('0x5a')]['id'])});}});}})[_0x9b60('0x23')](respondWithStatusCode(_0x2b9ad6,null))[_0x9b60('0x5f')](handleError(_0x2b9ad6,null));};exports[_0x9b60('0x7b')]=function(_0x8a963d,_0x1ec81c,_0x210bd8){var _0x1bf5db={};var _0x15d5d1={};var _0xd822c9;var _0x2da1ab;return db[_0x9b60('0x42')]['findOne']({'where':{'id':_0x8a963d[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x1ec81c,null))['then'](function(_0x1af74b){if(_0x1af74b){_0xd822c9=_0x1af74b;_0x15d5d1[_0x9b60('0x46')]=_[_0x9b60('0x48')](db[_0x9b60('0x7c')]['rawAttributes']);_0x15d5d1['query']=_[_0x9b60('0x48')](_0x8a963d['query']);_0x15d5d1[_0x9b60('0x4a')]=_[_0x9b60('0x4b')](_0x15d5d1[_0x9b60('0x46')],_0x15d5d1['query']);_0x1bf5db[_0x9b60('0x4d')]=_[_0x9b60('0x4b')](_0x15d5d1[_0x9b60('0x46')],qs[_0x9b60('0x4c')](_0x8a963d['query']['fields']));_0x1bf5db[_0x9b60('0x4d')]=_0x1bf5db[_0x9b60('0x4d')]['length']?_0x1bf5db[_0x9b60('0x4d')]:_0x15d5d1['model'];_0x1bf5db[_0x9b60('0x6d')]=qs[_0x9b60('0x50')](_0x8a963d[_0x9b60('0x49')][_0x9b60('0x50')]);_0x1bf5db[_0x9b60('0x51')]=qs[_0x9b60('0x4a')](_[_0x9b60('0x52')](_0x8a963d[_0x9b60('0x49')],_0x15d5d1[_0x9b60('0x4a')]));if(_0x8a963d[_0x9b60('0x49')][_0x9b60('0x53')]){_0x1bf5db[_0x9b60('0x51')]=_['merge'](_0x1bf5db[_0x9b60('0x51')],{'$or':_['map'](_0x1bf5db['attributes'],function(_0x3bdfce){var _0x186c78={};_0x186c78[_0x3bdfce]={'$like':'%'+_0x8a963d[_0x9b60('0x49')][_0x9b60('0x53')]+'%'};return _0x186c78;})});}_0x1bf5db=_['merge']({},_0x1bf5db,_0x8a963d[_0x9b60('0x56')]);return _0xd822c9[_0x9b60('0x7b')](_0x1bf5db);}})[_0x9b60('0x23')](function(_0x3a2d72){if(_0x3a2d72){_0x2da1ab=_0x3a2d72[_0x9b60('0x5c')];if(!_0x8a963d[_0x9b60('0x49')][_0x9b60('0x4e')](_0x9b60('0x4f'))){_0x1bf5db[_0x9b60('0x32')]=qs[_0x9b60('0x32')](_0x8a963d[_0x9b60('0x49')]['limit']);_0x1bf5db['offset']=qs['offset'](_0x8a963d[_0x9b60('0x49')]['offset']);}return _0xd822c9['getAgents'](_0x1bf5db);}})[_0x9b60('0x23')](function(_0x4cef07){if(_0x4cef07){return _0x4cef07?{'count':_0x2da1ab,'rows':_0x4cef07}:null;}})[_0x9b60('0x23')](respondWithResult(_0x1ec81c,null))['catch'](handleError(_0x1ec81c,null));};exports[_0x9b60('0x7d')]=function(_0x4ef562,_0x4d2624,_0x5372fd){return db[_0x9b60('0x42')][_0x9b60('0x6c')]({'where':{'id':_0x4ef562[_0x9b60('0x5a')]['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x4d2624,null))['then'](function(_0x10f9d0){if(_0x10f9d0){return db[_0x9b60('0x7e')][_0x9b60('0x7f')](function(_0x4187d7){return db[_0x9b60('0x80')][_0x9b60('0x39')]({'where':{'WhatsappAccountId':_0x4ef562[_0x9b60('0x5a')]['id']},'transaction':_0x4187d7})[_0x9b60('0x23')](function(_0x4caec6){var _0xea5ca0=_[_0x9b60('0x47')](_0x4ef562['body'],function(_0x3fde5e){_0x3fde5e[_0x9b60('0x6a')]=_0x4ef562[_0x9b60('0x5a')]['id'];return _0x3fde5e;});return db[_0x9b60('0x80')][_0x9b60('0x81')](_0xea5ca0,{'transaction':_0x4187d7});});})[_0x9b60('0x23')](function(){return db[_0x9b60('0x80')][_0x9b60('0x82')]({'where':{'WhatsappAccountId':_0x4ef562[_0x9b60('0x5a')]['id']},'order':'priority'});});}})[_0x9b60('0x23')](respondWithResult(_0x4d2624,null))[_0x9b60('0x5f')](handleError(_0x4d2624,null));};exports[_0x9b60('0x83')]=function(_0x364f84,_0x5770c0,_0x1580f1){var _0x127f6c={};var _0x39845f={};var _0x5e7f63;var _0x7fbb7;return db[_0x9b60('0x42')]['findOne']({'where':{'id':_0x364f84['params']['id']}})[_0x9b60('0x23')](handleEntityNotFound(_0x5770c0,null))[_0x9b60('0x23')](function(_0x31ccae){if(_0x31ccae){_0x5e7f63=_0x31ccae;_0x39845f[_0x9b60('0x46')]=_[_0x9b60('0x48')](db[_0x9b60('0x80')][_0x9b60('0x5b')]);_0x39845f[_0x9b60('0x49')]=_[_0x9b60('0x48')](_0x364f84[_0x9b60('0x49')]);_0x39845f['filters']=_['intersection'](_0x39845f[_0x9b60('0x46')],_0x39845f['query']);_0x127f6c[_0x9b60('0x4d')]=_[_0x9b60('0x4b')](_0x39845f['model'],qs['fields'](_0x364f84[_0x9b60('0x49')][_0x9b60('0x4c')]));_0x127f6c[_0x9b60('0x4d')]=_0x127f6c['attributes'][_0x9b60('0x5c')]?_0x127f6c[_0x9b60('0x4d')]:_0x39845f[_0x9b60('0x46')];_0x127f6c[_0x9b60('0x6d')]=qs[_0x9b60('0x50')](_0x364f84[_0x9b60('0x49')][_0x9b60('0x50')]);_0x127f6c[_0x9b60('0x51')]=qs[_0x9b60('0x4a')](_[_0x9b60('0x52')](_0x364f84[_0x9b60('0x49')],_0x39845f[_0x9b60('0x4a')]));if(_0x364f84[_0x9b60('0x49')]['filter']){_0x127f6c[_0x9b60('0x51')]=_['merge'](_0x127f6c[_0x9b60('0x51')],{'$or':_[_0x9b60('0x47')](_0x127f6c[_0x9b60('0x4d')],function(_0x3f1ac1){var _0x4bc34a={};_0x4bc34a[_0x3f1ac1]={'$like':'%'+_0x364f84[_0x9b60('0x49')][_0x9b60('0x53')]+'%'};return _0x4bc34a;})});}_0x127f6c=_[_0x9b60('0x54')]({},_0x127f6c,_0x364f84['options']);return _0x5e7f63['getApplications'](_0x127f6c);}})['then'](function(_0x5f2c30){if(_0x5f2c30){_0x7fbb7=_0x5f2c30['length'];if(!_0x364f84[_0x9b60('0x49')][_0x9b60('0x4e')](_0x9b60('0x4f'))){_0x127f6c['limit']=qs['limit'](_0x364f84['query']['limit']);_0x127f6c[_0x9b60('0x30')]=qs[_0x9b60('0x30')](_0x364f84[_0x9b60('0x49')][_0x9b60('0x30')]);}return _0x5e7f63[_0x9b60('0x83')](_0x127f6c);}})['then'](function(_0xdf7dcd){if(_0xdf7dcd){return _0xdf7dcd?{'count':_0x7fbb7,'rows':_0xdf7dcd}:null;}})[_0x9b60('0x23')](respondWithResult(_0x5770c0,null))[_0x9b60('0x5f')](handleError(_0x5770c0,null));};exports[_0x9b60('0x84')]=function(_0x4773b0,_0x348f0d,_0xa70a76){var _0x570b35={'channel':_0x9b60('0x85')};var _0x4269ca=[];var _0x1b9d8e=[];var _0x3db14d={};return db[_0x9b60('0x42')]['find']({'where':{'id':_0x4773b0['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9b60('0x86')}]})['then'](handleEntityNotFound(_0x348f0d,null))[_0x9b60('0x23')](function(_0x36979c){_0x570b35[_0x9b60('0x87')]=_0x36979c;_0x570b35[_0x9b60('0x88')]=_[_0x9b60('0x89')](_0x36979c['Applications'],[_0x9b60('0x8a')],['asc']);if(_0x570b35[_0x9b60('0x87')][_0x9b60('0x86')]){delete _0x570b35['account'][_0x9b60('0x86')];}return db[_0x9b60('0x8b')]['describe']();})[_0x9b60('0x23')](function(_0x2f3df9){if(!_0x2f3df9){throw new db[(_0x9b60('0x8c'))][(_0x9b60('0x8d'))](_0x9b60('0x8e'));}_0x4269ca=_[_0x9b60('0x8f')](_[_0x9b60('0x48')](_0x2f3df9),[_0x9b60('0x90'),_0x9b60('0x91')]);_0x1b9d8e=_[_0x9b60('0x8f')](_[_0x9b60('0x48')](_0x2f3df9),[_0x9b60('0x90'),_0x9b60('0x91'),_0x9b60('0x92'),'ListId']);_0x570b35['body']={'mapKey':_0x9b60('0x93')};if(_0x570b35[_0x9b60('0x87')][_0x9b60('0x44')]&&_0x570b35[_0x9b60('0x87')][_0x9b60('0x44')]===_0x9b60('0x94')){_0x570b35[_0x9b60('0x67')]['from']=_0x4773b0[_0x9b60('0x67')]['From'][_0x9b60('0x95')](_0x9b60('0x96'),'');_0x570b35['body']['body']=_0x4773b0['body'][_0x9b60('0x97')];_0x570b35['body'][_0x9b60('0x98')]=_0x4773b0[_0x9b60('0x67')][_0x9b60('0x99')];}if(_0x570b35[_0x9b60('0x67')]['id']){delete _0x570b35[_0x9b60('0x67')]['id'];}if(_['isNil'](_0x570b35['body'][_0x9b60('0x9a')])){throw new db[(_0x9b60('0x8c'))][(_0x9b60('0x8d'))](_0x9b60('0x9b'));}if(_['isNil'](_0x570b35['body'][_0x9b60('0x67')])||_0x570b35['body'][_0x9b60('0x67')]===''){throw new db[(_0x9b60('0x8c'))][(_0x9b60('0x8d'))](_0x9b60('0x9c'));}if(_[_0x9b60('0x9d')](_0x570b35[_0x9b60('0x67')][_0x9b60('0x9e')])){throw new db[(_0x9b60('0x8c'))][(_0x9b60('0x8d'))](_0x9b60('0x9f')+_0x1b9d8e);}if(!_[_0x9b60('0xa0')](_0x1b9d8e,_0x570b35['body'][_0x9b60('0x9e')])){throw new db[(_0x9b60('0x8c'))][(_0x9b60('0x8d'))](_0x9b60('0xa1')+_0x1b9d8e);}_0x3db14d[_0x570b35[_0x9b60('0x67')]['mapKey']]=_0x570b35[_0x9b60('0x67')][_0x9b60('0x9a')];return db[_0x9b60('0xa2')][_0x9b60('0x5e')]({'where':{'id':_0x570b35[_0x9b60('0x87')][_0x9b60('0xa3')]},'include':[{'model':db[_0x9b60('0x8b')],'as':_0x9b60('0xa4'),'where':_0x3db14d,'limit':0x1,'order':[[_0x9b60('0x91'),_0x9b60('0xa5')]]}]});})[_0x9b60('0x23')](handleEntityNotFound(_0x348f0d,null))[_0x9b60('0x23')](function(_0x238992){if(_0x238992){_0x570b35[_0x9b60('0xa6')]=_[_0x9b60('0x76')](_0x238992,[_0x9b60('0xa4')]);if(_0x238992[_0x9b60('0xa4')][_0x9b60('0x5c')]){return _0x238992[_0x9b60('0xa4')][0x0];}var _0x1ce162=_['defaults'](_0x570b35['body'],{'firstName':_0x570b35[_0x9b60('0x67')][_0x9b60('0x9a')],'ListId':_0x238992['id']});_0x1ce162[_0x570b35['body'][_0x9b60('0x9e')]]=_0x570b35['body'][_0x9b60('0x9a')];return db['CmContact']['create'](_0x1ce162,{'fields':_0x4269ca,'raw':!![]});}})[_0x9b60('0x23')](handleEntityNotFound(_0x348f0d,null))[_0x9b60('0x23')](function(_0x444091){if(_0x444091){_0x570b35[_0x9b60('0xa7')]=_0x444091;var _0x21e998={'ContactId':_0x444091['id'],'phone':_0x570b35[_0x9b60('0x67')][_0x9b60('0x9a')],'WhatsappAccountId':_0x4773b0['params']['id']};var _0xda278d={'ContactId':_0x444091['id'],'WhatsappAccountId':_0x4773b0[_0x9b60('0x5a')]['id'],'closed':![]};return db[_0x9b60('0xa8')][_0x9b60('0x5e')]({'where':_0xda278d})['then'](function(_0x451524){if(_0x451524){return[_0x451524,![]];}return db[_0x9b60('0xa8')][_0x9b60('0x60')](_0x21e998)[_0x9b60('0x23')](function(_0x2a6636){return[_0x2a6636,!![]];});});}})[_0x9b60('0xa9')](function(_0x3ba3f0,_0x2df125){_0x570b35[_0x9b60('0xaa')]=_0x3ba3f0['get']({'plain':!![]});_0x570b35[_0x9b60('0xaa')][_0x9b60('0xab')]=![];if(_0x2df125){if(_0x570b35[_0x9b60('0x87')]['autoclose']){_0x570b35['applications'][_0x9b60('0xac')]({'id':0x0,'priority':_0x570b35[_0x9b60('0x88')][_0x9b60('0x5c')]+0x1,'app':_0x9b60('0xad'),'appdata':_0x9b60('0xae'),'interval':_0x9b60('0xaf')});}_0x570b35['interaction']['created']=!![];}return db[_0x9b60('0xb0')]['create']({'phone':_0x570b35[_0x9b60('0x67')][_0x9b60('0x9a')],'messageId':_0x570b35[_0x9b60('0x67')][_0x9b60('0x98')],'body':_0x570b35[_0x9b60('0x67')]['body'],'WhatsappAccountId':_0x4773b0['params']['id'],'WhatsappInteractionId':_0x3ba3f0['id'],'direction':'in','ContactId':_0x3ba3f0['ContactId'],'AttachmentId':_0x570b35[_0x9b60('0x67')][_0x9b60('0xb1')]});})['then'](function(_0x3d2870){_0x570b35['message']=_0x3d2870;if(_0x570b35['interaction'][_0x9b60('0xb2')]){return db[_0x9b60('0x7c')][_0x9b60('0x5e')]({'attributes':['id','name'],'where':{'id':_0x570b35['interaction'][_0x9b60('0xb2')]}})[_0x9b60('0x23')](function(_0x36c48f){if(_0x36c48f){_0x570b35[_0x9b60('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x36c48f[_0x9b60('0x3d')]+','+(_0x570b35[_0x9b60('0x87')][_0x9b60('0xb3')]||0xa),'interval':_0x9b60('0xaf')});}return respondWithRpcPromise(_0x9b60('0xb4'),'startRouting',_0x570b35);});}return respondWithRpcPromise(_0x9b60('0xb4'),_0x9b60('0xb5'),_0x570b35);})[_0x9b60('0x23')](function(_0x5a9911){if(_0x5a9911){var _0x9829a3=0xc8;var _0x3cf19b=_0x9b60('0xb6');logger[_0x9b60('0x24')](_0x9b60('0x26'),_0x3cf19b,_0x9829a3,'entity\x20found');logger[_0x9b60('0xb7')](_0x9b60('0xb8'),_0x3cf19b,_0x9829a3,_0x9b60('0xb9'),JSON[_0x9b60('0x27')](_0x5a9911));if(_0x570b35[_0x9b60('0x87')]['type']==='twilio'){return _0x348f0d[_0x9b60('0x2e')](_0x9829a3)['set'](_0x9b60('0xba'),'text/xml')['send']('\x0a');}else{return _0x348f0d['status'](_0x9829a3)[_0x9b60('0x2f')](_0x5a9911);}}})[_0x9b60('0x5f')](handleError(_0x348f0d,null));};exports[_0x9b60('0x3e')]=function(_0x5c3091,_0x2826ba,_0xfec7fb){var _0x6e1b38,_0xc0feb6,_0x10e88c;if(_[_0x9b60('0x9d')](_0x5c3091[_0x9b60('0x67')][_0x9b60('0x67')])||_0x5c3091[_0x9b60('0x67')][_0x9b60('0x67')]===''){throw new db[(_0x9b60('0x8c'))][(_0x9b60('0x8d'))](_0x9b60('0x9c'));}if(_['isNil'](_0x5c3091['body']['to'])){throw new db['Sequelize'][(_0x9b60('0x8d'))](_0x9b60('0xbb'));}_0x6e1b38=_0x5c3091['body']['to'];return db[_0x9b60('0x42')][_0x9b60('0x5e')]({'where':{'id':_0x5c3091[_0x9b60('0x5a')]['id']},'include':[{'model':db[_0x9b60('0xa2')],'as':_0x9b60('0xbc'),'include':[{'model':db[_0x9b60('0x8b')],'as':_0x9b60('0xa4'),'where':{'mobile':_0x6e1b38},'limit':0x1,'order':[['updatedAt',_0x9b60('0xa5')]]}]}]})['then'](handleEntityNotFound(_0x2826ba,null))[_0x9b60('0x23')](function(_0x3d9ec7){if(_0x3d9ec7&&_0x3d9ec7[_0x9b60('0xbc')]){_0xc0feb6=_0x3d9ec7[_0x9b60('0x3a')]({'plain':!![]});if(_0xc0feb6[_0x9b60('0xbc')]&&_0xc0feb6[_0x9b60('0xbc')]['Contacts'][_0x9b60('0x5c')]){return _0xc0feb6[_0x9b60('0xbc')][_0x9b60('0xa4')][0x0];}return db[_0x9b60('0x8b')][_0x9b60('0x60')](_['defaults'](_0x5c3091[_0x9b60('0x67')],{'firstName':_0x6e1b38,'mobile':_0x6e1b38,'phone':_0x6e1b38,'ListId':_0xc0feb6[_0x9b60('0xa3')]}));}})[_0x9b60('0x23')](handleEntityNotFound(_0x2826ba,null))['then'](function(_0x12efe1){if(_0x12efe1){_0x10e88c=_0x12efe1;return db[_0x9b60('0xa8')][_0x9b60('0x5e')]({'where':{'ContactId':_0x10e88c['id'],'closed':![],'WhatsappAccountId':_0xc0feb6['id']}})[_0x9b60('0x23')](function(_0x4c4cd2){if(_0x4c4cd2){return[_0x4c4cd2,![]];}return db[_0x9b60('0xa8')][_0x9b60('0x60')]({'UserId':_0x5c3091[_0x9b60('0x61')]['id'],'ContactId':_0x10e88c['id'],'WhatsappAccountId':_0xc0feb6['id'],'phone':_0x6e1b38,'firstMsgDirection':_0x9b60('0xbd'),'Messages':[_[_0x9b60('0x54')](_0x5c3091[_0x9b60('0x67')],{'read':![],'body':_0x5c3091[_0x9b60('0x67')][_0x9b60('0x67')],'phone':_0x6e1b38,'WhatsappAccountId':_0xc0feb6['id'],'UserId':_0x5c3091[_0x9b60('0x61')]['id'],'ContactId':_0x10e88c['id']})]},{'include':[{'model':db[_0x9b60('0xb0')],'as':_0x9b60('0xbe')}]})[_0x9b60('0x23')](function(_0x595d21){return[_0x595d21,!![]];});});}})[_0x9b60('0xa9')](function(_0x5d7353,_0x226505){if(_0x226505){return _0x5d7353;}return db[_0x9b60('0xb0')]['create'](_[_0x9b60('0x54')](_0x5c3091[_0x9b60('0x67')],{'read':![],'body':_0x5c3091['body'][_0x9b60('0x67')],'phone':_0x6e1b38,'WhatsappAccountId':_0xc0feb6['id'],'WhatsappInteractionId':_0x5d7353['id'],'UserId':_0x5c3091['user']['id'],'ContactId':_0x10e88c['id']}))['then'](function(_0x15adc0){_0x5d7353[_0x9b60('0xbf')][_0x9b60('0xbe')]=[];_0x5d7353['dataValues']['Messages']['push'](_0x15adc0[_0x9b60('0xbf')]);return _0x5d7353;});})[_0x9b60('0x23')](respondWithResult(_0x2826ba,null))[_0x9b60('0x5f')](handleError(_0x2826ba,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 44434c9..8705d0a 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 _0xc791=['WhatsappAccount','update','emit','hasOwnProperty','events'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc791,0xf9));var _0x1c79=function(_0x39e740,_0x3a3084){_0x39e740=_0x39e740-0x0;var _0x49d5fc=_0xc791[_0x39e740];return _0x49d5fc;};'use strict';var EventEmitter=require(_0x1c79('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x1c79('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c79('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4cc06c){return function(_0x445bf0,_0xe7fdf,_0x4db30f){WhatsappAccountEvents[_0x1c79('0x3')](_0x4cc06c+':'+_0x445bf0['id'],_0x445bf0);WhatsappAccountEvents['emit'](_0x4cc06c,_0x445bf0);_0x4db30f(null);};}for(var e in events){if(events[_0x1c79('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x07ea=['../../mysqldb','WhatsappAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x270e67,_0x3f0989){var _0x1098d8=function(_0x19572f){while(--_0x19572f){_0x270e67['push'](_0x270e67['shift']());}};_0x1098d8(++_0x3f0989);}(_0x07ea,0x18f));var _0xa07e=function(_0x42d131,_0x10a237){_0x42d131=_0x42d131-0x0;var _0x247dd2=_0x07ea[_0x42d131];return _0x247dd2;};'use strict';var EventEmitter=require(_0xa07e('0x0'));var WhatsappAccount=require(_0xa07e('0x1'))['db'][_0xa07e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa07e('0x3'),'afterUpdate':_0xa07e('0x4'),'afterDestroy':_0xa07e('0x5')};function emitEvent(_0x2a1763){return function(_0x539810,_0x198791,_0xb58823){WhatsappAccountEvents[_0xa07e('0x6')](_0x2a1763+':'+_0x539810['id'],_0x539810);WhatsappAccountEvents[_0xa07e('0x6')](_0x2a1763,_0x539810);_0xb58823(null);};}for(var e in events){if(events[_0xa07e('0x7')](e)){var event=events[e];WhatsappAccount[_0xa07e('0x8')](e,emitEvent(event));}}module[_0xa07e('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index cb4ebb5..3854d09 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 _0xa773=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','path','../../config/environment','./whatsappAccount.attributes'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0xa773,0xa0));var _0x3a77=function(_0x139f11,_0x2e8c5e){_0x139f11=_0x139f11-0x0;var _0x2f8acf=_0xa773[_0x139f11];return _0x2f8acf;};'use strict';var _=require(_0x3a77('0x0'));var util=require(_0x3a77('0x1'));var logger=require('../../config/logger')(_0x3a77('0x2'));var moment=require(_0x3a77('0x3'));var BPromise=require(_0x3a77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a77('0x5'));var rimraf=require('rimraf');var config=require(_0x3a77('0x6'));var attributes=require(_0x3a77('0x7'));module[_0x3a77('0x8')]=function(_0xc8d032,_0x212619){return _0xc8d032[_0x3a77('0x9')](_0x3a77('0xa'),attributes,{'tableName':_0x3a77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1916=['path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','moment','request-promise'];(function(_0x42683e,_0x40d83d){var _0x16ab9b=function(_0x3b2804){while(--_0x3b2804){_0x42683e['push'](_0x42683e['shift']());}};_0x16ab9b(++_0x40d83d);}(_0x1916,0xb0));var _0x6191=function(_0x28df3e,_0x27c111){_0x28df3e=_0x28df3e-0x0;var _0x143773=_0x1916[_0x28df3e];return _0x143773;};'use strict';var _=require(_0x6191('0x0'));var util=require(_0x6191('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6191('0x2'));var BPromise=require('bluebird');var rp=require(_0x6191('0x3'));var fs=require('fs');var path=require(_0x6191('0x4'));var rimraf=require(_0x6191('0x5'));var config=require('../../config/environment');var attributes=require(_0x6191('0x6'));module[_0x6191('0x7')]=function(_0x21ad94,_0x2590e7){return _0x21ad94[_0x6191('0x8')](_0x6191('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 57b61f2..8513b23 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 _0xf0c0=['find','options','raw','where','include','map','model','attributes','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappAccount'];(function(_0x36231c,_0x545ef6){var _0x2bc9a6=function(_0x174175){while(--_0x174175){_0x36231c['push'](_0x36231c['shift']());}};_0x2bc9a6(++_0x545ef6);}(_0xf0c0,0x168));var _0x0f0c=function(_0x3e90f6,_0x3b463a){_0x3e90f6=_0x3e90f6-0x0;var _0x2bc84f=_0xf0c0[_0x3e90f6];return _0x2bc84f;};'use strict';var _=require(_0x0f0c('0x0'));var util=require(_0x0f0c('0x1'));var moment=require(_0x0f0c('0x2'));var BPromise=require(_0x0f0c('0x3'));var rs=require(_0x0f0c('0x4'));var fs=require('fs');var Redis=require(_0x0f0c('0x5'));var db=require(_0x0f0c('0x6'))['db'];var utils=require(_0x0f0c('0x7'));var logger=require(_0x0f0c('0x8'))(_0x0f0c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f0c('0xa')]['http']({'port':0x232a});config[_0x0f0c('0xb')]=_[_0x0f0c('0xc')](config[_0x0f0c('0xb')],{'host':_0x0f0c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f0c('0xb')]));require(_0x0f0c('0xe'))[_0x0f0c('0xf')](socket);function respondWithRpcPromise(_0x241db2,_0x7928aa,_0x332f65){return new BPromise(function(_0x21ef34,_0x403369){return client[_0x0f0c('0x10')](_0x241db2,_0x332f65)[_0x0f0c('0x11')](function(_0x12e6f5){logger[_0x0f0c('0x12')](_0x0f0c('0x13'),_0x7928aa,_0x0f0c('0x14'));logger[_0x0f0c('0x15')](_0x0f0c('0x16'),_0x7928aa,_0x0f0c('0x14'),JSON[_0x0f0c('0x17')](_0x12e6f5));if(_0x12e6f5[_0x0f0c('0x18')]){if(_0x12e6f5[_0x0f0c('0x18')][_0x0f0c('0x19')]===0x1f4){logger['error'](_0x0f0c('0x13'),_0x7928aa,_0x12e6f5['error'][_0x0f0c('0x1a')]);return _0x403369(_0x12e6f5['error'][_0x0f0c('0x1a')]);}logger[_0x0f0c('0x18')](_0x0f0c('0x13'),_0x7928aa,_0x12e6f5[_0x0f0c('0x18')][_0x0f0c('0x1a')]);return _0x21ef34(_0x12e6f5[_0x0f0c('0x18')]['message']);}else{logger['info'](_0x0f0c('0x13'),_0x7928aa,_0x0f0c('0x14'));_0x21ef34(_0x12e6f5[_0x0f0c('0x1b')][_0x0f0c('0x1a')]);}})[_0x0f0c('0x1c')](function(_0x1ef129){logger[_0x0f0c('0x18')](_0x0f0c('0x13'),_0x7928aa,_0x1ef129);_0x403369(_0x1ef129);});});}exports['ShowWhatsappAccount']=function(_0xd74687){var _0x38e332=this;return new Promise(function(_0xf490b2,_0x593cdb){return db[_0x0f0c('0x1d')][_0x0f0c('0x1e')]({'raw':_0xd74687[_0x0f0c('0x1f')]?_0xd74687[_0x0f0c('0x1f')][_0x0f0c('0x20')]===undefined?!![]:![]:!![],'where':_0xd74687['options']?_0xd74687[_0x0f0c('0x1f')][_0x0f0c('0x21')]||null:null,'attributes':_0xd74687['options']?_0xd74687[_0x0f0c('0x1f')]['attributes']||null:null,'include':_0xd74687[_0x0f0c('0x1f')]?_0xd74687[_0x0f0c('0x1f')][_0x0f0c('0x22')]?_[_0x0f0c('0x23')](_0xd74687[_0x0f0c('0x1f')][_0x0f0c('0x22')],function(_0x2a3e1e){return{'model':db[_0x2a3e1e[_0x0f0c('0x24')]],'as':_0x2a3e1e['as'],'attributes':_0x2a3e1e[_0x0f0c('0x25')],'include':_0x2a3e1e[_0x0f0c('0x22')]?_['map'](_0x2a3e1e[_0x0f0c('0x22')],function(_0x4a3702){return{'model':db[_0x4a3702['model']],'as':_0x4a3702['as'],'attributes':_0x4a3702['attributes'],'include':_0x4a3702[_0x0f0c('0x22')]?_['map'](_0x4a3702[_0x0f0c('0x22')],function(_0x27b7fe){return{'model':db[_0x27b7fe[_0x0f0c('0x24')]],'as':_0x27b7fe['as'],'attributes':_0x27b7fe[_0x0f0c('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0f0c('0x11')](function(_0xfa16aa){logger[_0x0f0c('0x12')](_0x0f0c('0x26'),_0xd74687);logger[_0x0f0c('0x15')](_0x0f0c('0x26'),_0xd74687,JSON[_0x0f0c('0x17')](_0xfa16aa));_0xf490b2(_0xfa16aa);})['catch'](function(_0x35e92b){logger[_0x0f0c('0x18')](_0x0f0c('0x26'),_0x35e92b[_0x0f0c('0x1a')],_0xd74687);_0x593cdb(_0x38e332['error'](0x1f4,_0x35e92b['message']));});});}; \ No newline at end of file +var _0xf59d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappAccount.socket','register','request','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','ShowWhatsappAccount','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d181a,_0x24dec1){var _0x322f58=function(_0x2ae79e){while(--_0x2ae79e){_0x3d181a['push'](_0x3d181a['shift']());}};_0x322f58(++_0x24dec1);}(_0xf59d,0x121));var _0xdf59=function(_0x408bf2,_0x3c2f96){_0x408bf2=_0x408bf2-0x0;var _0x255194=_0xf59d[_0x408bf2];return _0x255194;};'use strict';var _=require(_0xdf59('0x0'));var util=require(_0xdf59('0x1'));var moment=require(_0xdf59('0x2'));var BPromise=require(_0xdf59('0x3'));var rs=require(_0xdf59('0x4'));var fs=require('fs');var Redis=require(_0xdf59('0x5'));var db=require(_0xdf59('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf59('0x7'))(_0xdf59('0x8'));var config=require(_0xdf59('0x9'));var jayson=require(_0xdf59('0xa'));var client=jayson[_0xdf59('0xb')]['http']({'port':0x232a});config[_0xdf59('0xc')]=_[_0xdf59('0xd')](config[_0xdf59('0xc')],{'host':_0xdf59('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf59('0xc')]));require(_0xdf59('0xf'))[_0xdf59('0x10')](socket);function respondWithRpcPromise(_0x25d8d9,_0x45b37d,_0x4f53e2){return new BPromise(function(_0x359f4d,_0x5f4d67){return client[_0xdf59('0x11')](_0x25d8d9,_0x4f53e2)['then'](function(_0x593e67){logger['info'](_0xdf59('0x12'),_0x45b37d,'request\x20sent');logger[_0xdf59('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x45b37d,_0xdf59('0x14'),JSON[_0xdf59('0x15')](_0x593e67));if(_0x593e67['error']){if(_0x593e67[_0xdf59('0x16')]['code']===0x1f4){logger['error'](_0xdf59('0x12'),_0x45b37d,_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);return _0x5f4d67(_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);}logger[_0xdf59('0x16')](_0xdf59('0x12'),_0x45b37d,_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);return _0x359f4d(_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);}else{logger[_0xdf59('0x18')](_0xdf59('0x12'),_0x45b37d,_0xdf59('0x14'));_0x359f4d(_0x593e67[_0xdf59('0x19')]['message']);}})[_0xdf59('0x1a')](function(_0x12c0b9){logger[_0xdf59('0x16')](_0xdf59('0x12'),_0x45b37d,_0x12c0b9);_0x5f4d67(_0x12c0b9);});});}exports[_0xdf59('0x1b')]=function(_0x56526c){var _0x28ae2f=this;return new Promise(function(_0x99564c,_0x1b87c1){return db['WhatsappAccount'][_0xdf59('0x1c')]({'raw':_0x56526c[_0xdf59('0x1d')]?_0x56526c['options'][_0xdf59('0x1e')]===undefined?!![]:![]:!![],'where':_0x56526c[_0xdf59('0x1d')]?_0x56526c[_0xdf59('0x1d')][_0xdf59('0x1f')]||null:null,'attributes':_0x56526c[_0xdf59('0x1d')]?_0x56526c[_0xdf59('0x1d')][_0xdf59('0x20')]||null:null,'include':_0x56526c['options']?_0x56526c[_0xdf59('0x1d')][_0xdf59('0x21')]?_[_0xdf59('0x22')](_0x56526c[_0xdf59('0x1d')]['include'],function(_0x1ee43d){return{'model':db[_0x1ee43d[_0xdf59('0x23')]],'as':_0x1ee43d['as'],'attributes':_0x1ee43d[_0xdf59('0x20')],'include':_0x1ee43d['include']?_[_0xdf59('0x22')](_0x1ee43d['include'],function(_0x1f4446){return{'model':db[_0x1f4446['model']],'as':_0x1f4446['as'],'attributes':_0x1f4446[_0xdf59('0x20')],'include':_0x1f4446[_0xdf59('0x21')]?_['map'](_0x1f4446[_0xdf59('0x21')],function(_0x1efaba){return{'model':db[_0x1efaba[_0xdf59('0x23')]],'as':_0x1efaba['as'],'attributes':_0x1efaba[_0xdf59('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdf59('0x24')](function(_0x162f31){logger[_0xdf59('0x18')](_0xdf59('0x1b'),_0x56526c);logger[_0xdf59('0x13')]('ShowWhatsappAccount',_0x56526c,JSON['stringify'](_0x162f31));_0x99564c(_0x162f31);})[_0xdf59('0x1a')](function(_0x2593ec){logger[_0xdf59('0x16')](_0xdf59('0x1b'),_0x2593ec[_0xdf59('0x17')],_0x56526c);_0x1b87c1(_0x28ae2f[_0xdf59('0x16')](0x1f4,_0x2593ec[_0xdf59('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a697487..2cf2654 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 _0x189d=['removeListener','register','length','./whatsappAccount.events','remove','emit'];(function(_0xf6cf09,_0x27fb3a){var _0x5b8cba=function(_0x7ad7bf){while(--_0x7ad7bf){_0xf6cf09['push'](_0xf6cf09['shift']());}};_0x5b8cba(++_0x27fb3a);}(_0x189d,0x99));var _0xd189=function(_0x46c253,_0x44bc69){_0x46c253=_0x46c253-0x0;var _0x30f4bc=_0x189d[_0x46c253];return _0x30f4bc;};'use strict';var WhatsappAccountEvents=require(_0xd189('0x0'));var events=['save',_0xd189('0x1'),'update'];function createListener(_0x12bfcb,_0x1b8af5){return function(_0x5e1bb1){_0x1b8af5[_0xd189('0x2')](_0x12bfcb,_0x5e1bb1);};}function removeListener(_0x2549ec,_0x41570a){return function(){WhatsappAccountEvents[_0xd189('0x3')](_0x2549ec,_0x41570a);};}exports[_0xd189('0x4')]=function(_0x79d93f){for(var _0x4be711=0x0,_0x161337=events[_0xd189('0x5')];_0x4be711<_0x161337;_0x4be711++){var _0x57f48f=events[_0x4be711];var _0x14d569=createListener('whatsappAccount:'+_0x57f48f,_0x79d93f);WhatsappAccountEvents['on'](_0x57f48f,_0x14d569);}}; \ No newline at end of file +var _0x3791=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','remove','update','emit'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3791,0x74));var _0x1379=function(_0x3af923,_0x2bbf90){_0x3af923=_0x3af923-0x0;var _0x374220=_0x3791[_0x3af923];return _0x374220;};'use strict';var WhatsappAccountEvents=require(_0x1379('0x0'));var events=['save',_0x1379('0x1'),_0x1379('0x2')];function createListener(_0x5487eb,_0x15eac9){return function(_0xc34f47){_0x15eac9[_0x1379('0x3')](_0x5487eb,_0xc34f47);};}function removeListener(_0x38d415,_0x150530){return function(){WhatsappAccountEvents[_0x1379('0x4')](_0x38d415,_0x150530);};}exports[_0x1379('0x5')]=function(_0x433cf0){for(var _0x26e822=0x0,_0x59a536=events[_0x1379('0x6')];_0x26e822<_0x59a536;_0x26e822++){var _0x4499ad=events[_0x26e822];var _0x1002b6=createListener(_0x1379('0x7')+_0x4499ad,_0x433cf0);WhatsappAccountEvents['on'](_0x4499ad,_0x1002b6);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e46d7e6..50782c2 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 _0xb1d9=['./whatsappApplication.controller','get','/:id','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17020a,_0x278709){var _0x5bc427=function(_0x40587d){while(--_0x40587d){_0x17020a['push'](_0x17020a['shift']());}};_0x5bc427(++_0x278709);}(_0xb1d9,0x198));var _0x9b1d=function(_0x32a804,_0x2b4402){_0x32a804=_0x32a804-0x0;var _0x485a4a=_0xb1d9[_0x32a804];return _0x485a4a;};'use strict';var multer=require(_0x9b1d('0x0'));var util=require(_0x9b1d('0x1'));var path=require(_0x9b1d('0x2'));var timeout=require(_0x9b1d('0x3'));var express=require(_0x9b1d('0x4'));var router=express[_0x9b1d('0x5')]();var fs_extra=require(_0x9b1d('0x6'));var auth=require(_0x9b1d('0x7'));var interaction=require(_0x9b1d('0x8'));var config=require(_0x9b1d('0x9'));var controller=require(_0x9b1d('0xa'));router[_0x9b1d('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9b1d('0xb')](_0x9b1d('0xc'),auth[_0x9b1d('0xd')](),controller['show']);router['post']('/',auth[_0x9b1d('0xd')](),controller[_0x9b1d('0xe')]);router[_0x9b1d('0xf')](_0x9b1d('0xc'),auth[_0x9b1d('0xd')](),controller[_0x9b1d('0x10')]);router[_0x9b1d('0x11')](_0x9b1d('0xc'),auth[_0x9b1d('0xd')](),controller['destroy']);module[_0x9b1d('0x12')]=router; \ No newline at end of file +var _0x821e=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','show','post','isAuthenticated','update','delete','/:id','destroy','exports','multer'];(function(_0x2e81a2,_0x4477fc){var _0x27b108=function(_0xcee602){while(--_0xcee602){_0x2e81a2['push'](_0x2e81a2['shift']());}};_0x27b108(++_0x4477fc);}(_0x821e,0x1db));var _0xe821=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0x821e[_0x4d8a8f];return _0xfc4adc;};'use strict';var multer=require(_0xe821('0x0'));var util=require('util');var path=require(_0xe821('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe821('0x2')]();var fs_extra=require(_0xe821('0x3'));var auth=require(_0xe821('0x4'));var interaction=require(_0xe821('0x5'));var config=require(_0xe821('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe821('0x7')]);router[_0xe821('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe821('0x9')]);router[_0xe821('0xa')]('/',auth[_0xe821('0xb')](),controller['create']);router['put']('/:id',auth[_0xe821('0xb')](),controller[_0xe821('0xc')]);router[_0xe821('0xd')](_0xe821('0xe'),auth['isAuthenticated'](),controller[_0xe821('0xf')]);module[_0xe821('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 1a6af1b..2b404a1 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 _0x6df1=['STRING','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x28aab6,_0x2a8232){var _0x24d66f=function(_0xc998da){while(--_0xc998da){_0x28aab6['push'](_0x28aab6['shift']());}};_0x24d66f(++_0x2a8232);}(_0x6df1,0xad));var _0x16df=function(_0x2c4e32,_0x3a5590){_0x2c4e32=_0x2c4e32-0x0;var _0x1eac30=_0x6df1[_0x2c4e32];return _0x1eac30;};'use strict';var Sequelize=require(_0x16df('0x0'));module['exports']={'priority':{'type':Sequelize[_0x16df('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x16df('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x16df('0x3')]()},'description':{'type':Sequelize[_0x16df('0x2')]},'interval':{'type':Sequelize[_0x16df('0x2')],'defaultValue':_0x16df('0x4')}}; \ No newline at end of file +var _0x4012=['noop','TEXT','exports','STRING'];(function(_0x4cc43f,_0x4dca10){var _0x57eabf=function(_0x1f3491){while(--_0x1f3491){_0x4cc43f['push'](_0x4cc43f['shift']());}};_0x57eabf(++_0x4dca10);}(_0x4012,0xde));var _0x2401=function(_0x290591,_0x349cb5){_0x290591=_0x290591-0x0;var _0x62ef7=_0x4012[_0x290591];return _0x62ef7;};'use strict';var Sequelize=require('sequelize');module[_0x2401('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2401('0x1')],'allowNull':![],'defaultValue':_0x2401('0x2')},'appdata':{'type':Sequelize[_0x2401('0x3')]()},'description':{'type':Sequelize[_0x2401('0x1')]},'interval':{'type':Sequelize[_0x2401('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 16750b0..30fbd8e 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 _0x6dc0=['../../config/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','apply','reject','save','then','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0xfe6811,_0x433dac){var _0xeb3fa6=function(_0x54dfc1){while(--_0x54dfc1){_0xfe6811['push'](_0xfe6811['shift']());}};_0xeb3fa6(++_0x433dac);}(_0x6dc0,0xb6));var _0x06dc=function(_0x54044f,_0x287473){_0x54044f=_0x54044f-0x0;var _0x1ad1ef=_0x6dc0[_0x54044f];return _0x1ad1ef;};'use strict';var emlformat=require(_0x06dc('0x0'));var rimraf=require(_0x06dc('0x1'));var zipdir=require(_0x06dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06dc('0x3'));var moment=require(_0x06dc('0x4'));var BPromise=require(_0x06dc('0x5'));var Mustache=require(_0x06dc('0x6'));var util=require('util');var path=require(_0x06dc('0x7'));var sox=require(_0x06dc('0x8'));var csv=require('to-csv');var ejs=require(_0x06dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06dc('0xa'));var squel=require(_0x06dc('0xb'));var crypto=require(_0x06dc('0xc'));var jsforce=require(_0x06dc('0xd'));var deskjs=require(_0x06dc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x06dc('0xf'));var authService=require(_0x06dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x06dc('0x11'));var hardwareService=require(_0x06dc('0x12'));var logger=require(_0x06dc('0x13'))(_0x06dc('0x14'));var utils=require('../../config/utils');var config=require(_0x06dc('0x15'));var licenseUtil=require(_0x06dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527806,_0x534c07){_0x534c07=_0x534c07||0xcc;return function(_0x4f086f){if(_0x4f086f){return _0x527806[_0x06dc('0x17')](_0x534c07);}return _0x527806['status'](_0x534c07)['end']();};}function respondWithResult(_0x4874ce,_0x196cfd){_0x196cfd=_0x196cfd||0xc8;return function(_0x47753d){if(_0x47753d){return _0x4874ce[_0x06dc('0x18')](_0x196cfd)['json'](_0x47753d);}};}function respondWithFilteredResult(_0x183302,_0x1d92c2){return function(_0x145a07){if(_0x145a07){var _0x3da2c5=typeof _0x1d92c2['offset']===_0x06dc('0x19')&&typeof _0x1d92c2[_0x06dc('0x1a')]===_0x06dc('0x19');var _0x2478b9=_0x145a07[_0x06dc('0x1b')];var _0x51df31=_0x3da2c5?0x0:_0x1d92c2[_0x06dc('0x1c')];var _0x1d6ec8=_0x3da2c5?_0x145a07[_0x06dc('0x1b')]:_0x1d92c2[_0x06dc('0x1c')]+_0x1d92c2[_0x06dc('0x1a')];var _0x152ed2;if(_0x1d6ec8>=_0x2478b9){_0x1d6ec8=_0x2478b9;_0x152ed2=0xc8;}else{_0x152ed2=0xce;}_0x183302['status'](_0x152ed2);return _0x183302['set'](_0x06dc('0x1d'),_0x51df31+'-'+_0x1d6ec8+'/'+_0x2478b9)['json'](_0x145a07);}return null;};}function patchUpdates(_0x21c8c3){return function(_0x5088f3){try{jsonpatch[_0x06dc('0x1e')](_0x5088f3,_0x21c8c3,!![]);}catch(_0x369c60){return BPromise[_0x06dc('0x1f')](_0x369c60);}return _0x5088f3[_0x06dc('0x20')]();};}function saveUpdates(_0x8aaf2,_0x427f39){return function(_0x577284){if(_0x577284){return _0x577284['update'](_0x8aaf2)[_0x06dc('0x21')](function(_0x426260){return _0x426260;});}return null;};}function removeEntity(_0x56c345,_0x95dab2){return function(_0x5eab9b){if(_0x5eab9b){return _0x5eab9b['destroy']()['then'](function(){_0x56c345['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd3e42b,_0x5edc7b){return function(_0xfa043e){if(!_0xfa043e){_0xd3e42b['sendStatus'](0x194);}return _0xfa043e;};}function handleError(_0x52afcf,_0xa85ffc){_0xa85ffc=_0xa85ffc||0x1f4;return function(_0x26bbfe){logger['error'](_0x26bbfe['stack']);if(_0x26bbfe[_0x06dc('0x22')]){delete _0x26bbfe['name'];}_0x52afcf[_0x06dc('0x18')](_0xa85ffc)[_0x06dc('0x23')](_0x26bbfe);};}exports[_0x06dc('0x24')]=function(_0xfd5611,_0x1d98b8){var _0x31f5cd={},_0x164554={},_0x33ff4c={'count':0x0,'rows':[]};var _0x3f0e2d=_[_0x06dc('0x25')](db[_0x06dc('0x26')][_0x06dc('0x27')],function(_0x43e689){return{'name':_0x43e689['fieldName'],'type':_0x43e689['type'][_0x06dc('0x28')]};});_0x164554[_0x06dc('0x29')]=_[_0x06dc('0x25')](_0x3f0e2d,_0x06dc('0x22'));_0x164554[_0x06dc('0x2a')]=_[_0x06dc('0x2b')](_0xfd5611[_0x06dc('0x2a')]);_0x164554[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x164554[_0x06dc('0x29')],_0x164554['query']);_0x31f5cd[_0x06dc('0x2e')]=_[_0x06dc('0x2d')](_0x164554[_0x06dc('0x29')],qs[_0x06dc('0x2f')](_0xfd5611[_0x06dc('0x2a')]['fields']));_0x31f5cd[_0x06dc('0x2e')]=_0x31f5cd[_0x06dc('0x2e')][_0x06dc('0x30')]?_0x31f5cd['attributes']:_0x164554[_0x06dc('0x29')];if(!_0xfd5611[_0x06dc('0x2a')]['hasOwnProperty'](_0x06dc('0x31'))){_0x31f5cd[_0x06dc('0x1a')]=qs['limit'](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x1a')]);_0x31f5cd[_0x06dc('0x1c')]=qs[_0x06dc('0x1c')](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x1c')]);}_0x31f5cd[_0x06dc('0x32')]=qs[_0x06dc('0x33')](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x33')]);_0x31f5cd['where']=qs['filters'](_['pick'](_0xfd5611[_0x06dc('0x2a')],_0x164554[_0x06dc('0x2c')]),_0x3f0e2d);if(_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x34')]){_0x31f5cd['where']=_['merge'](_0x31f5cd[_0x06dc('0x35')],{'$or':_[_0x06dc('0x25')](_0x3f0e2d,function(_0xdc718a){if(_0xdc718a[_0x06dc('0x36')]!==_0x06dc('0x37')){var _0xe65d69={};_0xe65d69[_0xdc718a[_0x06dc('0x22')]]={'$like':'%'+_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x34')]+'%'};return _0xe65d69;}})});}_0x31f5cd=_[_0x06dc('0x38')]({},_0x31f5cd,_0xfd5611[_0x06dc('0x39')]);var _0x11e2f6={'where':_0x31f5cd[_0x06dc('0x35')]};return db[_0x06dc('0x26')][_0x06dc('0x1b')](_0x11e2f6)[_0x06dc('0x21')](function(_0x3e9434){_0x33ff4c[_0x06dc('0x1b')]=_0x3e9434;if(_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x3a')]){_0x31f5cd['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x06dc('0x3b')](_0x31f5cd);})[_0x06dc('0x21')](function(_0x4250fd){_0x33ff4c[_0x06dc('0x3c')]=_0x4250fd;return _0x33ff4c;})[_0x06dc('0x21')](respondWithFilteredResult(_0x1d98b8,_0x31f5cd))['catch'](handleError(_0x1d98b8,null));};exports[_0x06dc('0x3d')]=function(_0x37ec58,_0x64f6f3){var _0x59d4a0={'raw':!![],'where':{'id':_0x37ec58[_0x06dc('0x3e')]['id']}},_0x164684={};_0x164684['model']=_[_0x06dc('0x2b')](db[_0x06dc('0x26')][_0x06dc('0x27')]);_0x164684[_0x06dc('0x2a')]=_['keys'](_0x37ec58['query']);_0x164684[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x164684[_0x06dc('0x29')],_0x164684['query']);_0x59d4a0[_0x06dc('0x2e')]=_[_0x06dc('0x2d')](_0x164684[_0x06dc('0x29')],qs[_0x06dc('0x2f')](_0x37ec58[_0x06dc('0x2a')]['fields']));_0x59d4a0[_0x06dc('0x2e')]=_0x59d4a0['attributes']['length']?_0x59d4a0[_0x06dc('0x2e')]:_0x164684[_0x06dc('0x29')];if(_0x37ec58[_0x06dc('0x2a')][_0x06dc('0x3a')]){_0x59d4a0[_0x06dc('0x3f')]=[{'all':!![]}];}_0x59d4a0=_['merge']({},_0x59d4a0,_0x37ec58[_0x06dc('0x39')]);return db[_0x06dc('0x26')][_0x06dc('0x40')](_0x59d4a0)[_0x06dc('0x21')](handleEntityNotFound(_0x64f6f3,null))[_0x06dc('0x21')](respondWithResult(_0x64f6f3,null))[_0x06dc('0x41')](handleError(_0x64f6f3,null));};exports[_0x06dc('0x42')]=function(_0x6a5800,_0x1081a9){return db[_0x06dc('0x26')][_0x06dc('0x42')](_0x6a5800['body'],{})[_0x06dc('0x21')](respondWithResult(_0x1081a9,0xc9))[_0x06dc('0x41')](handleError(_0x1081a9,null));};exports['update']=function(_0xb9c6a2,_0x39e42a){if(_0xb9c6a2[_0x06dc('0x43')]['id']){delete _0xb9c6a2['body']['id'];}return db[_0x06dc('0x26')][_0x06dc('0x40')]({'where':{'id':_0xb9c6a2['params']['id']}})['then'](handleEntityNotFound(_0x39e42a,null))['then'](saveUpdates(_0xb9c6a2[_0x06dc('0x43')],null))[_0x06dc('0x21')](respondWithResult(_0x39e42a,null))[_0x06dc('0x41')](handleError(_0x39e42a,null));};exports['destroy']=function(_0x5dd2c2,_0x1d759b){return db[_0x06dc('0x26')][_0x06dc('0x40')]({'where':{'id':_0x5dd2c2[_0x06dc('0x3e')]['id']}})[_0x06dc('0x21')](handleEntityNotFound(_0x1d759b,null))['then'](removeEntity(_0x1d759b,null))[_0x06dc('0x41')](handleError(_0x1d759b,null));}; \ No newline at end of file +var _0x002d=['../../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','reject','save','update','then','destroy','name','send','index','map','WhatsappApplication','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','catch','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0x558097,_0x5a6cc2){var _0xe80464=function(_0x46db4f){while(--_0x46db4f){_0x558097['push'](_0x558097['shift']());}};_0xe80464(++_0x5a6cc2);}(_0x002d,0xca));var _0xd002=function(_0x442870,_0x3fbbc2){_0x442870=_0x442870-0x0;var _0x2cce66=_0x002d[_0x442870];return _0x2cce66;};'use strict';var emlformat=require(_0xd002('0x0'));var rimraf=require(_0xd002('0x1'));var zipdir=require(_0xd002('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd002('0x3'));var BPromise=require(_0xd002('0x4'));var Mustache=require(_0xd002('0x5'));var util=require(_0xd002('0x6'));var path=require(_0xd002('0x7'));var sox=require(_0xd002('0x8'));var csv=require(_0xd002('0x9'));var ejs=require(_0xd002('0xa'));var fs=require('fs');var fs_extra=require(_0xd002('0xb'));var _=require(_0xd002('0xc'));var squel=require(_0xd002('0xd'));var crypto=require(_0xd002('0xe'));var jsforce=require(_0xd002('0xf'));var deskjs=require(_0xd002('0x10'));var toCsv=require(_0xd002('0x9'));var querystring=require(_0xd002('0x11'));var Papa=require(_0xd002('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd002('0x13'));var as=require(_0xd002('0x14'));var hardwareService=require(_0xd002('0x15'));var logger=require('../../config/logger')(_0xd002('0x16'));var utils=require(_0xd002('0x17'));var config=require(_0xd002('0x18'));var licenseUtil=require(_0xd002('0x19'));var db=require(_0xd002('0x1a'))['db'];function respondWithStatusCode(_0x1e6efa,_0x21a778){_0x21a778=_0x21a778||0xcc;return function(_0x28920f){if(_0x28920f){return _0x1e6efa[_0xd002('0x1b')](_0x21a778);}return _0x1e6efa[_0xd002('0x1c')](_0x21a778)[_0xd002('0x1d')]();};}function respondWithResult(_0x4de1c3,_0x3cbe14){_0x3cbe14=_0x3cbe14||0xc8;return function(_0x1e5c3b){if(_0x1e5c3b){return _0x4de1c3['status'](_0x3cbe14)['json'](_0x1e5c3b);}};}function respondWithFilteredResult(_0x5bc910,_0x460e7b){return function(_0x53cd4b){if(_0x53cd4b){var _0x13acd5=typeof _0x460e7b[_0xd002('0x1e')]===_0xd002('0x1f')&&typeof _0x460e7b[_0xd002('0x20')]===_0xd002('0x1f');var _0x124d97=_0x53cd4b[_0xd002('0x21')];var _0x5e1f31=_0x13acd5?0x0:_0x460e7b[_0xd002('0x1e')];var _0x4708f6=_0x13acd5?_0x53cd4b[_0xd002('0x21')]:_0x460e7b[_0xd002('0x1e')]+_0x460e7b[_0xd002('0x20')];var _0x4aa45d;if(_0x4708f6>=_0x124d97){_0x4708f6=_0x124d97;_0x4aa45d=0xc8;}else{_0x4aa45d=0xce;}_0x5bc910[_0xd002('0x1c')](_0x4aa45d);return _0x5bc910[_0xd002('0x22')](_0xd002('0x23'),_0x5e1f31+'-'+_0x4708f6+'/'+_0x124d97)[_0xd002('0x24')](_0x53cd4b);}return null;};}function patchUpdates(_0x5f3854){return function(_0x27c9c5){try{jsonpatch['apply'](_0x27c9c5,_0x5f3854,!![]);}catch(_0x490310){return BPromise[_0xd002('0x25')](_0x490310);}return _0x27c9c5[_0xd002('0x26')]();};}function saveUpdates(_0x1bfa76,_0x45cd2e){return function(_0x28cfb1){if(_0x28cfb1){return _0x28cfb1[_0xd002('0x27')](_0x1bfa76)[_0xd002('0x28')](function(_0x3a99ee){return _0x3a99ee;});}return null;};}function removeEntity(_0xe28024,_0x15ccfb){return function(_0x1a9884){if(_0x1a9884){return _0x1a9884[_0xd002('0x29')]()['then'](function(){_0xe28024[_0xd002('0x1c')](0xcc)[_0xd002('0x1d')]();});}};}function handleEntityNotFound(_0x55e3be,_0x32ac79){return function(_0x21fe25){if(!_0x21fe25){_0x55e3be[_0xd002('0x1b')](0x194);}return _0x21fe25;};}function handleError(_0x4df8db,_0x1c4b8a){_0x1c4b8a=_0x1c4b8a||0x1f4;return function(_0x4f58fa){logger['error'](_0x4f58fa['stack']);if(_0x4f58fa[_0xd002('0x2a')]){delete _0x4f58fa[_0xd002('0x2a')];}_0x4df8db[_0xd002('0x1c')](_0x1c4b8a)[_0xd002('0x2b')](_0x4f58fa);};}exports[_0xd002('0x2c')]=function(_0x24722d,_0x1648e1){var _0x3e0cc2={},_0x9999ea={},_0x70610d={'count':0x0,'rows':[]};var _0x5a79ba=_[_0xd002('0x2d')](db[_0xd002('0x2e')][_0xd002('0x2f')],function(_0x3b6653){return{'name':_0x3b6653['fieldName'],'type':_0x3b6653[_0xd002('0x30')]['key']};});_0x9999ea[_0xd002('0x31')]=_['map'](_0x5a79ba,_0xd002('0x2a'));_0x9999ea[_0xd002('0x32')]=_[_0xd002('0x33')](_0x24722d[_0xd002('0x32')]);_0x9999ea[_0xd002('0x34')]=_[_0xd002('0x35')](_0x9999ea[_0xd002('0x31')],_0x9999ea[_0xd002('0x32')]);_0x3e0cc2['attributes']=_[_0xd002('0x35')](_0x9999ea[_0xd002('0x31')],qs[_0xd002('0x36')](_0x24722d[_0xd002('0x32')][_0xd002('0x36')]));_0x3e0cc2[_0xd002('0x37')]=_0x3e0cc2['attributes']['length']?_0x3e0cc2['attributes']:_0x9999ea[_0xd002('0x31')];if(!_0x24722d['query'][_0xd002('0x38')](_0xd002('0x39'))){_0x3e0cc2[_0xd002('0x20')]=qs[_0xd002('0x20')](_0x24722d[_0xd002('0x32')][_0xd002('0x20')]);_0x3e0cc2[_0xd002('0x1e')]=qs[_0xd002('0x1e')](_0x24722d['query'][_0xd002('0x1e')]);}_0x3e0cc2[_0xd002('0x3a')]=qs['sort'](_0x24722d['query'][_0xd002('0x3b')]);_0x3e0cc2[_0xd002('0x3c')]=qs[_0xd002('0x34')](_[_0xd002('0x3d')](_0x24722d['query'],_0x9999ea[_0xd002('0x34')]),_0x5a79ba);if(_0x24722d['query'][_0xd002('0x3e')]){_0x3e0cc2[_0xd002('0x3c')]=_[_0xd002('0x3f')](_0x3e0cc2[_0xd002('0x3c')],{'$or':_[_0xd002('0x2d')](_0x5a79ba,function(_0x54c2ec){if(_0x54c2ec[_0xd002('0x30')]!==_0xd002('0x40')){var _0x23ad2e={};_0x23ad2e[_0x54c2ec[_0xd002('0x2a')]]={'$like':'%'+_0x24722d[_0xd002('0x32')][_0xd002('0x3e')]+'%'};return _0x23ad2e;}})});}_0x3e0cc2=_[_0xd002('0x3f')]({},_0x3e0cc2,_0x24722d[_0xd002('0x41')]);var _0x2693a9={'where':_0x3e0cc2[_0xd002('0x3c')]};return db[_0xd002('0x2e')][_0xd002('0x21')](_0x2693a9)[_0xd002('0x28')](function(_0x1509d0){_0x70610d[_0xd002('0x21')]=_0x1509d0;if(_0x24722d[_0xd002('0x32')]['includeAll']){_0x3e0cc2[_0xd002('0x42')]=[{'all':!![]}];}return db[_0xd002('0x2e')][_0xd002('0x43')](_0x3e0cc2);})[_0xd002('0x28')](function(_0x5339e3){_0x70610d[_0xd002('0x44')]=_0x5339e3;return _0x70610d;})[_0xd002('0x28')](respondWithFilteredResult(_0x1648e1,_0x3e0cc2))['catch'](handleError(_0x1648e1,null));};exports['show']=function(_0x3978a3,_0x382693){var _0x10ce62={'raw':!![],'where':{'id':_0x3978a3[_0xd002('0x45')]['id']}},_0x53e3ab={};_0x53e3ab['model']=_['keys'](db[_0xd002('0x2e')]['rawAttributes']);_0x53e3ab[_0xd002('0x32')]=_[_0xd002('0x33')](_0x3978a3['query']);_0x53e3ab[_0xd002('0x34')]=_[_0xd002('0x35')](_0x53e3ab[_0xd002('0x31')],_0x53e3ab[_0xd002('0x32')]);_0x10ce62[_0xd002('0x37')]=_['intersection'](_0x53e3ab['model'],qs[_0xd002('0x36')](_0x3978a3['query'][_0xd002('0x36')]));_0x10ce62[_0xd002('0x37')]=_0x10ce62['attributes']['length']?_0x10ce62[_0xd002('0x37')]:_0x53e3ab['model'];if(_0x3978a3[_0xd002('0x32')]['includeAll']){_0x10ce62[_0xd002('0x42')]=[{'all':!![]}];}_0x10ce62=_['merge']({},_0x10ce62,_0x3978a3[_0xd002('0x41')]);return db[_0xd002('0x2e')]['find'](_0x10ce62)[_0xd002('0x28')](handleEntityNotFound(_0x382693,null))[_0xd002('0x28')](respondWithResult(_0x382693,null))[_0xd002('0x46')](handleError(_0x382693,null));};exports[_0xd002('0x47')]=function(_0xe8893e,_0x246f9f){return db['WhatsappApplication'][_0xd002('0x47')](_0xe8893e[_0xd002('0x48')],{})[_0xd002('0x28')](respondWithResult(_0x246f9f,0xc9))[_0xd002('0x46')](handleError(_0x246f9f,null));};exports['update']=function(_0x1c5b7e,_0xf3edf0){if(_0x1c5b7e[_0xd002('0x48')]['id']){delete _0x1c5b7e[_0xd002('0x48')]['id'];}return db[_0xd002('0x2e')][_0xd002('0x49')]({'where':{'id':_0x1c5b7e['params']['id']}})[_0xd002('0x28')](handleEntityNotFound(_0xf3edf0,null))[_0xd002('0x28')](saveUpdates(_0x1c5b7e[_0xd002('0x48')],null))[_0xd002('0x28')](respondWithResult(_0xf3edf0,null))[_0xd002('0x46')](handleError(_0xf3edf0,null));};exports[_0xd002('0x29')]=function(_0x2f2c1f,_0x143060){return db[_0xd002('0x2e')][_0xd002('0x49')]({'where':{'id':_0x2f2c1f['params']['id']}})[_0xd002('0x28')](handleEntityNotFound(_0x143060,null))[_0xd002('0x28')](removeEntity(_0x143060,null))[_0xd002('0x46')](handleError(_0x143060,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c201cea..063115f 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 _0xae79=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0xae79,0x1d3));var _0x9ae7=function(_0x54d900,_0xdd3d2e){_0x54d900=_0x54d900-0x0;var _0x4b3252=_0xae79[_0x54d900];return _0x4b3252;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var logger=require(_0x9ae7('0x2'))(_0x9ae7('0x3'));var moment=require(_0x9ae7('0x4'));var BPromise=require(_0x9ae7('0x5'));var rp=require(_0x9ae7('0x6'));var fs=require('fs');var path=require(_0x9ae7('0x7'));var rimraf=require(_0x9ae7('0x8'));var config=require(_0x9ae7('0x9'));var attributes=require(_0x9ae7('0xa'));module[_0x9ae7('0xb')]=function(_0x3e98cf,_0x396863){return _0x3e98cf[_0x9ae7('0xc')]('WhatsappApplication',attributes,{'tableName':_0x9ae7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ae7('0xe'),'collate':_0x9ae7('0xf')});}; \ No newline at end of file +var _0x008c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4_unicode_ci'];(function(_0x451f41,_0x177893){var _0x85b5b2=function(_0x5aa5ff){while(--_0x5aa5ff){_0x451f41['push'](_0x451f41['shift']());}};_0x85b5b2(++_0x177893);}(_0x008c,0x188));var _0xc008=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x008c[_0x38ced4];return _0x547c07;};'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')]('WhatsappApplication',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc008('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 90af82a..af17f5c 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 _0x4ea3=['WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x4ea3,0x70));var _0x34ea=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4ea3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file +var _0x6f0d=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x8d062b,_0x570218){var _0x149214=function(_0x79d468){while(--_0x79d468){_0x8d062b['push'](_0x8d062b['shift']());}};_0x149214(++_0x570218);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xdc26b1,_0x5a2772){_0xdc26b1=_0xdc26b1-0x0;var _0x3c7e01=_0x6f0d[_0xdc26b1];return _0x3c7e01;};'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});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 937621f..2e85bbe 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 _0x86f4=['get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','put','whatsapp','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x47c9b5,_0x30cf3d){var _0x6580e1=function(_0x52a368){while(--_0x52a368){_0x47c9b5['push'](_0x47c9b5['shift']());}};_0x6580e1(++_0x30cf3d);}(_0x86f4,0x18a));var _0x486f=function(_0x4eaa04,_0x7d0b7e){_0x4eaa04=_0x4eaa04-0x0;var _0x52b479=_0x86f4[_0x4eaa04];return _0x52b479;};'use strict';var multer=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var path=require(_0x486f('0x2'));var timeout=require(_0x486f('0x3'));var express=require(_0x486f('0x4'));var router=express[_0x486f('0x5')]();var fs_extra=require(_0x486f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x486f('0x7'));var config=require(_0x486f('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x486f('0x9')]('/',auth[_0x486f('0xa')](),controller[_0x486f('0xb')]);router[_0x486f('0x9')](_0x486f('0xc'),auth[_0x486f('0xa')](),controller['describe']);router[_0x486f('0x9')](_0x486f('0xd'),auth[_0x486f('0xa')](),controller[_0x486f('0xe')]);router[_0x486f('0x9')](_0x486f('0xf'),auth[_0x486f('0xa')](),controller[_0x486f('0x10')]);router[_0x486f('0x9')](_0x486f('0x11'),auth[_0x486f('0xa')](),controller[_0x486f('0x12')]);router[_0x486f('0x13')]('/',auth[_0x486f('0xa')](),controller[_0x486f('0x14')]);router[_0x486f('0x13')](_0x486f('0xf'),auth['isAuthenticated'](),controller[_0x486f('0x15')]);router['post'](_0x486f('0x16'),auth[_0x486f('0xa')](),interaction[_0x486f('0x17')]('whatsapp','whatsappinteraction:addtags'),controller[_0x486f('0x18')]);router[_0x486f('0x19')]('/:id',auth[_0x486f('0xa')](),interaction[_0x486f('0x17')](_0x486f('0x1a'),'whatsappinteraction:update'),controller['update']);router[_0x486f('0x1b')](_0x486f('0xd'),auth[_0x486f('0xa')](),interaction[_0x486f('0x17')]('whatsapp','whatsappinteraction:destroy'),controller[_0x486f('0x1c')]);router[_0x486f('0x1b')](_0x486f('0x16'),auth[_0x486f('0xa')](),controller[_0x486f('0x1d')]);module[_0x486f('0x1e')]=router; \ No newline at end of file +var _0x5075=['describe','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','index','get','isAuthenticated'];(function(_0x2c87b3,_0x166dad){var _0x51298d=function(_0x2f60a2){while(--_0x2f60a2){_0x2c87b3['push'](_0x2c87b3['shift']());}};_0x51298d(++_0x166dad);}(_0x5075,0x73));var _0x5507=function(_0x2418e0,_0x7215b0){_0x2418e0=_0x2418e0-0x0;var _0x55ffbf=_0x5075[_0x2418e0];return _0x55ffbf;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5507('0xa')]);router[_0x5507('0xb')]('/describe',auth[_0x5507('0xc')](),controller[_0x5507('0xd')]);router[_0x5507('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xb')](_0x5507('0xf'),auth[_0x5507('0xc')](),controller['getMessages']);router[_0x5507('0xb')](_0x5507('0x10'),auth['isAuthenticated'](),controller[_0x5507('0x11')]);router[_0x5507('0x12')]('/',auth['isAuthenticated'](),controller[_0x5507('0x13')]);router[_0x5507('0x12')](_0x5507('0xf'),auth[_0x5507('0xc')](),controller[_0x5507('0x14')]);router[_0x5507('0x12')]('/:id/tags',auth[_0x5507('0xc')](),interaction[_0x5507('0x15')](_0x5507('0x16'),_0x5507('0x17')),controller['addTags']);router[_0x5507('0x18')](_0x5507('0x19'),auth[_0x5507('0xc')](),interaction[_0x5507('0x15')](_0x5507('0x16'),_0x5507('0x1a')),controller[_0x5507('0x1b')]);router[_0x5507('0x1c')](_0x5507('0x19'),auth[_0x5507('0xc')](),interaction[_0x5507('0x15')](_0x5507('0x16'),_0x5507('0x1d')),controller['destroy']);router[_0x5507('0x1c')](_0x5507('0x1e'),auth[_0x5507('0xc')](),controller[_0x5507('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 56bed3a..a8a8ac1 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 _0xb0df=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2bdb2e,_0x33fff2){var _0x2d9e58=function(_0x528938){while(--_0x528938){_0x2bdb2e['push'](_0x2bdb2e['shift']());}};_0x2d9e58(++_0x33fff2);}(_0xb0df,0x85));var _0xfb0d=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xb0df[_0x4eec9b];return _0x2e3849;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfb0d('0x0'));module[_0xfb0d('0x1')]={'closed':{'type':Sequelize[_0xfb0d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfb0d('0x3')]},'disposition':{'type':Sequelize[_0xfb0d('0x4')]},'secondDisposition':{'type':Sequelize[_0xfb0d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xfb0d('0x4')]},'note':{'type':Sequelize[_0xfb0d('0x4')]},'phone':{'type':Sequelize[_0xfb0d('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xfb0d('0x5')]('in',_0xfb0d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfb0d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfb0d('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xacd6=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0xacd6,0xef));var _0x6acd=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0xacd6[_0x1e172a];return _0x96338b;};'use strict';var Sequelize=require(_0x6acd('0x0'));var moment=require(_0x6acd('0x1'));module[_0x6acd('0x2')]={'closed':{'type':Sequelize[_0x6acd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6acd('0x4')]},'disposition':{'type':Sequelize[_0x6acd('0x5')]},'secondDisposition':{'type':Sequelize[_0x6acd('0x5')]},'thirdDisposition':{'type':Sequelize[_0x6acd('0x5')]},'note':{'type':Sequelize[_0x6acd('0x5')]},'phone':{'type':Sequelize[_0x6acd('0x5')]},'read1stAt':{'type':Sequelize[_0x6acd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6acd('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6acd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6acd('0x6')]('in',_0x6acd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6acd('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 8073516..251c68d 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 _0x2f72=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','agent','sequelize','toString','merge','WhatsappInteraction','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','includeAll','include','create','describe','addMessage','WhatsappMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','download','join','root','files','tmp','server','transcript-%d-%s.zip','CmContact','lastName','Attachment','direction','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','firstName','secret','renderFile','views','downloadInteraction.ejs','.pdf','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','catch','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User'];(function(_0x3d9b00,_0x1356a3){var _0x4383c4=function(_0xd828ab){while(--_0xd828ab){_0x3d9b00['push'](_0x3d9b00['shift']());}};_0x4383c4(++_0x1356a3);}(_0x2f72,0x166));var _0x22f7=function(_0x34a363,_0x395a43){_0x34a363=_0x34a363-0x0;var _0x5baccf=_0x2f72[_0x34a363];return _0x5baccf;};'use strict';var emlformat=require(_0x22f7('0x0'));var rimraf=require(_0x22f7('0x1'));var zipdir=require(_0x22f7('0x2'));var jsonpatch=require(_0x22f7('0x3'));var rp=require(_0x22f7('0x4'));var moment=require(_0x22f7('0x5'));var BPromise=require(_0x22f7('0x6'));var Mustache=require(_0x22f7('0x7'));var util=require('util');var path=require(_0x22f7('0x8'));var sox=require(_0x22f7('0x9'));var csv=require(_0x22f7('0xa'));var ejs=require(_0x22f7('0xb'));var fs=require('fs');var fs_extra=require(_0x22f7('0xc'));var _=require(_0x22f7('0xd'));var squel=require(_0x22f7('0xe'));var crypto=require(_0x22f7('0xf'));var jsforce=require(_0x22f7('0x10'));var deskjs=require(_0x22f7('0x11'));var toCsv=require(_0x22f7('0xa'));var querystring=require(_0x22f7('0x12'));var Papa=require(_0x22f7('0x13'));var Redis=require(_0x22f7('0x14'));var authService=require(_0x22f7('0x15'));var qs=require(_0x22f7('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x22f7('0x17'));var hardwareService=require(_0x22f7('0x18'));var logger=require('../../config/logger')(_0x22f7('0x19'));var utils=require(_0x22f7('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x22f7('0x1b'));var db=require('../../mysqldb')['db'];config[_0x22f7('0x1c')]=_[_0x22f7('0x1d')](config['redis'],{'host':_0x22f7('0x1e'),'port':0x18eb});var socket=require(_0x22f7('0x1f'))(new Redis(config[_0x22f7('0x1c')]));require(_0x22f7('0x20'))[_0x22f7('0x21')](socket);function respondWithStatusCode(_0x40ddf3,_0x31a446){_0x31a446=_0x31a446||0xcc;return function(_0x2e91d3){if(_0x2e91d3){return _0x40ddf3[_0x22f7('0x22')](_0x31a446);}return _0x40ddf3[_0x22f7('0x23')](_0x31a446)[_0x22f7('0x24')]();};}function respondWithResult(_0x24a356,_0xdae3e3){_0xdae3e3=_0xdae3e3||0xc8;return function(_0x3b2861){if(_0x3b2861){return _0x24a356[_0x22f7('0x23')](_0xdae3e3)['json'](_0x3b2861);}};}function respondWithFilteredResult(_0x4e71f5,_0x3894f4){return function(_0x1c3971){if(_0x1c3971){var _0x3f15b8=typeof _0x3894f4[_0x22f7('0x25')]===_0x22f7('0x26')&&typeof _0x3894f4[_0x22f7('0x27')]===_0x22f7('0x26');var _0xe025fa=_0x1c3971['count'];var _0x53e472=_0x3f15b8?0x0:_0x3894f4[_0x22f7('0x25')];var _0x1f363d=_0x3f15b8?_0x1c3971[_0x22f7('0x28')]:_0x3894f4['offset']+_0x3894f4[_0x22f7('0x27')];var _0x3db7ed;if(_0x1f363d>=_0xe025fa){_0x1f363d=_0xe025fa;_0x3db7ed=0xc8;}else{_0x3db7ed=0xce;}_0x4e71f5[_0x22f7('0x23')](_0x3db7ed);return _0x4e71f5[_0x22f7('0x29')](_0x22f7('0x2a'),_0x53e472+'-'+_0x1f363d+'/'+_0xe025fa)['json'](_0x1c3971);}return null;};}function patchUpdates(_0x48e352){return function(_0x18fcfa){try{jsonpatch['apply'](_0x18fcfa,_0x48e352,!![]);}catch(_0x320dc1){return BPromise[_0x22f7('0x2b')](_0x320dc1);}return _0x18fcfa[_0x22f7('0x2c')]();};}function saveUpdates(_0x3bb24e,_0x10adc7){return function(_0x177ff1){if(_0x177ff1){return _0x177ff1['update'](_0x3bb24e)[_0x22f7('0x2d')](function(_0x48c489){return _0x48c489;});}return null;};}function removeEntity(_0x580245,_0x18ad43){return function(_0x3cee67){if(_0x3cee67){return _0x3cee67[_0x22f7('0x2e')]()['then'](function(){_0x580245[_0x22f7('0x23')](0xcc)[_0x22f7('0x24')]();});}};}function handleEntityNotFound(_0x5a5360,_0x1748e3){return function(_0x2e9ba8){if(!_0x2e9ba8){_0x5a5360['sendStatus'](0x194);}return _0x2e9ba8;};}function handleError(_0x6cdd51,_0x5c4282){_0x5c4282=_0x5c4282||0x1f4;return function(_0xa3346f){logger[_0x22f7('0x2f')](_0xa3346f[_0x22f7('0x30')]);if(_0xa3346f['name']){delete _0xa3346f[_0x22f7('0x31')];}_0x6cdd51[_0x22f7('0x23')](_0x5c4282)[_0x22f7('0x32')](_0xa3346f);};}function getInteractionUsers(_0x5cd8f7,_0x47ce76){return new BPromise(function(_0x2c7d6c,_0xec422e){try{if(_0x47ce76[_0x5cd8f7['id']]){_0x5cd8f7[_0x22f7('0x33')]=_['map'](_0x47ce76[_0x5cd8f7['id']],function(_0x11e51f){return{'id':_0x11e51f['id'],'fullname':_0x11e51f[_0x22f7('0x34')]};});}}catch(_0x28451f){_0xec422e(_0x28451f);}_0x2c7d6c(_0x5cd8f7);});}function getInteractionTags(_0xb49ec7,_0x5b6991){return new BPromise(function(_0x23f6c8,_0x200935){try{if(_0xb49ec7[_0x22f7('0x35')]){_0xb49ec7['Tags']=[];_0xb49ec7[_0x22f7('0x35')][_0x22f7('0x36')](',')[_0x22f7('0x37')](function(_0x3655b0){_0xb49ec7[_0x22f7('0x38')][_0x22f7('0x39')](_0x5b6991[_0x3655b0]);});}delete _0xb49ec7[_0x22f7('0x35')];}catch(_0x265d5d){_0x200935(_0x265d5d);}_0x23f6c8(_0xb49ec7);});}function updateWhatsappInteraction(_0x26f0d5,_0x5e1f75,_0x398dde){return new BPromise(function(_0x2b63e2,_0x399627){return getInteractionUsers(_0x26f0d5,_0x398dde)[_0x22f7('0x2d')](function(_0xa8be9f){return getInteractionTags(_0xa8be9f,_0x5e1f75);})[_0x22f7('0x2d')](function(_0x3014c0){_0x2b63e2(_0x3014c0);})[_0x22f7('0x3a')](function(_0x1ac785){_0x399627(_0x1ac785);});});}exports[_0x22f7('0x3b')]=function(_0x10e1db,_0x2e43c2){var _0x22371e={},_0x3b55b1={},_0x33848e={'count':0x0,'rows':[]};var _0x520f8b=_[_0x22f7('0x3c')](db['WhatsappInteraction'][_0x22f7('0x3d')],function(_0x1fc93f){return{'name':_0x1fc93f[_0x22f7('0x3e')],'type':_0x1fc93f[_0x22f7('0x3f')]['key']};});_0x3b55b1[_0x22f7('0x40')]=_[_0x22f7('0x3c')](_0x520f8b,'name');_0x3b55b1[_0x22f7('0x41')]=_[_0x22f7('0x42')](_0x10e1db[_0x22f7('0x41')]);_0x3b55b1[_0x22f7('0x43')]=_[_0x22f7('0x44')](_0x3b55b1[_0x22f7('0x40')],_0x3b55b1[_0x22f7('0x41')]);_0x22371e[_0x22f7('0x45')]=_[_0x22f7('0x44')](_0x3b55b1[_0x22f7('0x40')],qs['fields'](_0x10e1db[_0x22f7('0x41')][_0x22f7('0x46')]));_0x22371e[_0x22f7('0x45')]=_0x22371e['attributes'][_0x22f7('0x47')]?_0x22371e['attributes']:_0x3b55b1[_0x22f7('0x40')];if(!_0x10e1db['query'][_0x22f7('0x48')](_0x22f7('0x49'))){_0x22371e[_0x22f7('0x27')]=qs[_0x22f7('0x27')](_0x10e1db[_0x22f7('0x41')][_0x22f7('0x27')]);_0x22371e[_0x22f7('0x25')]=qs['offset'](_0x10e1db[_0x22f7('0x41')][_0x22f7('0x25')]);}_0x22371e['order']=qs[_0x22f7('0x4a')](_0x10e1db['query'][_0x22f7('0x4a')]);_0x22371e[_0x22f7('0x4b')]=qs['filters'](_[_0x22f7('0x4c')](_0x10e1db[_0x22f7('0x41')],_0x3b55b1['filters']),_0x520f8b);var _0x54a46d=[];var _0x84055f=squel[_0x22f7('0x4d')]()[_0x22f7('0x4e')]('id')[_0x22f7('0x4e')]('name')[_0x22f7('0x4e')](_0x22f7('0x4f'))[_0x22f7('0x50')]('tools_tags');var _0x5a6f55=squel['select']()[_0x22f7('0x4e')](_0x22f7('0x51'))[_0x22f7('0x4e')](_0x22f7('0x52'))[_0x22f7('0x4e')]('ui.WhatsappInteractionId')[_0x22f7('0x50')](_0x22f7('0x53'),'ui')[_0x22f7('0x54')](_0x22f7('0x55'),'u',_0x22f7('0x56'));var _0x7c8460=squel['select']()[_0x22f7('0x50')](_0x22f7('0x57'),'i')['left_join'](_0x22f7('0x58'),'c',_0x22f7('0x59'))['left_join'](_0x22f7('0x55'),'o',_0x22f7('0x5a'))[_0x22f7('0x54')](_0x22f7('0x5b'),'a',_0x22f7('0x5c'))[_0x22f7('0x54')](_0x22f7('0x5d'),'me',_0x22f7('0x5e'))[_0x22f7('0x54')]('whatsapp_interaction_has_tags','it',_0x22f7('0x5f'))[_0x22f7('0x54')](_0x22f7('0x60'),'t',_0x22f7('0x61'));var _0xad1e57=squel[_0x22f7('0x62')]();var _0x3868b9=[];var _0x47c1c9=squel[_0x22f7('0x62')]();var _0x11308a;if(_0x10e1db[_0x22f7('0x41')][_0x22f7('0x63')]){_0x11308a=as[_0x22f7('0x64')](_0x10e1db[_0x22f7('0x41')][_0x22f7('0x63')]);var _0x1b7347=_0x11308a[_0x22f7('0x65')];for(var _0x329111=0x0;_0x329111<_0x11308a['conditions'][_0x22f7('0x47')];_0x329111++){var _0x2ca246=_0x11308a[_0x22f7('0x66')][_0x329111];var _0x52b3e6='i';var _0x21b1b1=_[_0x22f7('0x67')](_0x520f8b,[_0x22f7('0x31'),_0x2ca246[_0x22f7('0x4e')]]);if(!_0x21b1b1){switch(_0x2ca246[_0x22f7('0x4e')]){case _0x22f7('0x68'):if(_0x2ca246[_0x22f7('0x69')]==0x1){_0x7c8460['having']('`'+_0x2ca246[_0x22f7('0x4e')]+'`\x20=\x200');}else{_0x7c8460[_0x22f7('0x6a')]('`'+_0x2ca246[_0x22f7('0x4e')]+_0x22f7('0x6b'));}break;case _0x22f7('0x6c'):if(_0x2ca246[_0x22f7('0x6d')]===_0x22f7('0x6e')){if(_0x2ca246[_0x22f7('0x69')][_0x22f7('0x36')]('\x20')[_0x22f7('0x47')]>0x1){_0xad1e57[_0x1b7347](_0x22f7('0x6f'),qs[_0x22f7('0x70')](_0x2ca246[_0x22f7('0x69')]),null);}else{var _0x28ed1b='%'+_0x2ca246['value']+'%';_0xad1e57[_0x1b7347](_0x22f7('0x71'),_0x28ed1b,_0x28ed1b,_0x28ed1b);}}else{_0x21b1b1=_[_0x22f7('0x67')](_0x520f8b,[_0x22f7('0x31'),_0x22f7('0x72')]);_0x2ca246[_0x22f7('0x4e')]=_0x22f7('0x72');_0x2cb65e=as[_0x22f7('0x73')](_0x52b3e6,_0x21b1b1['type'],_0x2ca246);_0xad1e57[_0x1b7347](_0x2cb65e[_0x22f7('0x74')],_0x2cb65e['value'][_0x22f7('0x75')],_0x2cb65e[_0x22f7('0x69')][_0x22f7('0x24')]);}break;case _0x22f7('0x76'):var _0x5907d1=_0x2ca246[_0x22f7('0x69')][_0x22f7('0x36')](',')[_0x22f7('0x3c')](function(_0x53daaa){return Number(_0x53daaa);});_0x5907d1[_0x22f7('0x37')](function(_0x5f1e86){_0x47c1c9['or'](_0x22f7('0x77'),'%,'+_0x5f1e86+',%');});_0x3868b9=_[_0x22f7('0x78')](_0x3868b9,_0x5907d1);break;case _0x22f7('0x79'):if(_0x2ca246[_0x22f7('0x6d')]===_0x22f7('0x6e')){_0xad1e57[_0x1b7347](_0x22f7('0x7a'),'%'+_0x2ca246[_0x22f7('0x69')]+'%',null);}else{_0x21b1b1=_[_0x22f7('0x67')](_0x520f8b,[_0x22f7('0x31'),_0x22f7('0x7b')]);_0x2ca246[_0x22f7('0x4e')]='UserId';_0x2cb65e=as['buildExpression'](_0x52b3e6,_0x21b1b1[_0x22f7('0x3f')],_0x2ca246);_0xad1e57[_0x1b7347](_0x2cb65e[_0x22f7('0x74')],_0x2cb65e[_0x22f7('0x69')]['start'],_0x2cb65e[_0x22f7('0x69')][_0x22f7('0x24')]);}break;case _0x22f7('0x7c'):_0x2cb65e=as[_0x22f7('0x73')]('me',null,_0x2ca246);_0xad1e57[_0x1b7347](_0x2cb65e[_0x22f7('0x74')],_0x2cb65e[_0x22f7('0x69')][_0x22f7('0x75')],_0x2cb65e[_0x22f7('0x69')][_0x22f7('0x24')]);break;}}else{var _0x2cb65e=as[_0x22f7('0x73')](_0x52b3e6,_0x21b1b1[_0x22f7('0x3f')],_0x2ca246);_0xad1e57[_0x1b7347](_0x2cb65e[_0x22f7('0x74')],_0x2cb65e[_0x22f7('0x69')][_0x22f7('0x75')],_0x2cb65e['value'][_0x22f7('0x24')]);}}}else{var _0x327a31=_(_0x10e1db[_0x22f7('0x41')])[_0x22f7('0x42')]()[_0x22f7('0x3c')](function(_0x3edebf){return _[_0x22f7('0x7d')](_0x520f8b,[_0x22f7('0x31'),_0x3edebf])?_0x3edebf:undefined;})[_0x22f7('0x7e')]()[_0x22f7('0x69')]();if(!_[_0x22f7('0x7f')](_0x327a31)){_0x327a31[_0x22f7('0x37')](function(_0x24199d){if(_0x24199d===_0x22f7('0x80')){_0x7c8460[_0x22f7('0x4b')](_0x22f7('0x81'),[][_0x22f7('0x82')](_0x10e1db[_0x22f7('0x41')][_0x24199d]));}else if(_0x24199d===_0x22f7('0x83')){var _0x58e605=JSON['parse'](_0x10e1db['query'][_0x24199d])[_0x22f7('0x84')];var _0x3345b1=JSON['parse'](_0x10e1db['query'][_0x24199d])[_0x22f7('0x85')];_0x7c8460['where'](_0x22f7('0x86'),_0x58e605,_0x3345b1);}else{if(_0x10e1db[_0x22f7('0x41')][_0x24199d]===_0x22f7('0x87')){_0x7c8460['where']('i.'+_0x24199d+_0x22f7('0x88'));}else{_0x7c8460['where']('i.'+_0x24199d+_0x22f7('0x89'),_0x10e1db['query'][_0x24199d]);}}});}if(_0x10e1db[_0x22f7('0x41')][_0x22f7('0x8a')]){if(_0x10e1db[_0x22f7('0x41')][_0x22f7('0x8a')]==0x1){_0x7c8460['having']('`unreadMessages`\x20=\x200');}else{_0x7c8460[_0x22f7('0x6a')](_0x22f7('0x8b'));}}if(_0x10e1db[_0x22f7('0x41')]['tag']){_0x3868b9=_[_0x22f7('0x8c')](_0x10e1db[_0x22f7('0x41')][_0x22f7('0x8d')])?_0x10e1db['query']['tag']:new Array(_0x10e1db[_0x22f7('0x41')][_0x22f7('0x8d')]);_0x3868b9[_0x22f7('0x37')](function(_0x3fd9ac){_0x47c1c9['or'](_0x22f7('0x77'),'%,'+_0x3fd9ac+',%');});}if(_0x10e1db[_0x22f7('0x41')][_0x22f7('0x8e')]){var _0x392395=_0x10e1db[_0x22f7('0x41')]['filter']['replace']('\x5c','\x5c\x5c')[_0x22f7('0x8f')](/'/g,'\x27\x27');if(qs[_0x22f7('0x90')](_0x392395)){_0xad1e57['or'](_0x22f7('0x91'),_0x392395+'%')['or'](_0x22f7('0x92'),_0x392395+'%');}else{_0xad1e57['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x392395))['or'](_0x22f7('0x93'),_0x392395+'%');}}}_0x7c8460['where'](_0xad1e57);_0x7c8460[_0x22f7('0x94')]('i.id');var _0x429ae0={'type':db['Sequelize'][_0x22f7('0x95')][_0x22f7('0x96')],'raw':!![]};var _0x713ca1=_0x7c8460[_0x22f7('0x97')]();_0x713ca1[_0x22f7('0x4e')]('i.id');_0x713ca1[_0x22f7('0x4e')](_0x22f7('0x98'),'unreadMessages');if(_0x22371e[_0x22f7('0x99')]){_0x22371e[_0x22f7('0x99')][_0x22f7('0x37')](function(_0x517725){var _0x4c4a07=_0x517725[0x0]===_0x22f7('0x9a')?_0x517725[0x0]:'i.'+_0x517725[0x0];_0x7c8460[_0x22f7('0x99')](_0x4c4a07,_0x517725[0x1]==='DESC'?![]:!![]);});}if(!_[_0x22f7('0x7f')](_0x3868b9)){_0x7c8460[_0x22f7('0x6a')](_0x47c1c9);_0x713ca1['where'](_0x22f7('0x9b'),_0x3868b9);}BPromise['resolve']()[_0x22f7('0x2d')](function(){if(!_0x11308a){if(_0x10e1db[_0x22f7('0x41')]['WhatsappAccountId'])return;_0x713ca1[_0x22f7('0x4b')](_0x22f7('0x9c'));_0x7c8460['where'](_0x22f7('0x9c'));return;}if(_0x10e1db[_0x22f7('0x9d')][_0x22f7('0x9e')]!=='agent')return;return _0x10e1db[_0x22f7('0x9d')][_0x22f7('0x9f')]({'attributes':['id'],'raw':!![]})[_0x22f7('0x2d')](function(_0x443321){if(_[_0x22f7('0x7f')](_0x443321)){_0x713ca1[_0x22f7('0x4b')]('i.WhatsappAccountId\x20IS\x20NULL');_0x7c8460[_0x22f7('0x4b')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x713ca1[_0x22f7('0x4b')](_0x22f7('0x81'),_[_0x22f7('0x3c')](_0x443321,'id'));_0x7c8460[_0x22f7('0x4b')](_0x22f7('0x81'),_[_0x22f7('0x3c')](_0x443321,'id'));}});})[_0x22f7('0x2d')](function(){if(_0x10e1db['user'][_0x22f7('0x9e')]===_0x22f7('0xa0')&&!_0x11308a&&!_0x10e1db[_0x22f7('0x41')][_0x22f7('0x80')])return[];return db[_0x22f7('0xa1')][_0x22f7('0x41')](_0x713ca1[_0x22f7('0xa2')](),_0x429ae0);})[_0x22f7('0x2d')](function(_0x417dca){_0x33848e[_0x22f7('0x28')]=_0x417dca[_0x22f7('0x47')];if(_0x33848e[_0x22f7('0x28')]===0x0)return[];return db[_0x22f7('0xa1')][_0x22f7('0x41')](_0x84055f[_0x22f7('0xa2')](),_0x429ae0)['then'](function(_0x4f4208){_0x54a46d=_['keyBy'](_0x4f4208,'id');_0x429ae0=_[_0x22f7('0xa3')](_0x429ae0,{'model':db[_0x22f7('0xa4')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10e1db['query'][_0x22f7('0x46')]){_0x22371e[_0x22f7('0x45')][_0x22f7('0x37')](function(_0x44607b){_0x7c8460['field']('i.'+_0x44607b);});}else{_0x7c8460[_0x22f7('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x22f7('0x68'));_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xa5'),'Account.key');_0x7c8460[_0x22f7('0x4e')]('a.mandatoryDisposition',_0x22f7('0xa6'));_0x7c8460['field'](_0x22f7('0xa7'),'contactName');_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xa8'));_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xa9'),_0x22f7('0xaa'));_0x7c8460[_0x22f7('0x4e')]('c.lastName',_0x22f7('0xab'));_0x7c8460[_0x22f7('0x4e')]('c.email',_0x22f7('0xac'));_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xad'),_0x22f7('0xae'));_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xaf'),_0x22f7('0xb0'));_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xb1'),'Contact.fax');_0x7c8460['field']('o.fullname','Owner.fullname');_0x7c8460[_0x22f7('0x4e')]('o.internal',_0x22f7('0xb2'));_0x7c8460[_0x22f7('0x4e')](_0x22f7('0xb3'),_0x22f7('0x35'));}if(_0x22371e['limit'])_0x7c8460['limit'](_0x22371e[_0x22f7('0x27')]);if(_0x22371e[_0x22f7('0x25')])_0x7c8460[_0x22f7('0x25')](_0x22371e['offset']);return db[_0x22f7('0xa1')][_0x22f7('0x41')](_0x7c8460['toString'](),_0x429ae0);})[_0x22f7('0x2d')](function(_0x42d5d0){if(_0x42d5d0[_0x22f7('0x47')]>0x0)_0x5a6f55['where'](_0x22f7('0xb4'),_[_0x22f7('0x3c')](_0x42d5d0,'id'));return db[_0x22f7('0xa1')][_0x22f7('0x41')](_0x5a6f55['toString'](),_0x429ae0)[_0x22f7('0x2d')](function(_0x54cb75){var _0x2804d4=_['groupBy'](_0x54cb75,_0x22f7('0xb5'));var _0x38dafe=[];_0x42d5d0[_0x22f7('0x37')](function(_0x4e6394){_0x38dafe[_0x22f7('0x39')](updateWhatsappInteraction(_0x4e6394,_0x54a46d,_0x2804d4));});return BPromise[_0x22f7('0xb6')](_0x38dafe);});});})['then'](function(_0x2bc3de){_0x33848e[_0x22f7('0xb7')]=_0x2bc3de;return _0x33848e;})[_0x22f7('0x2d')](respondWithFilteredResult(_0x2e43c2,_0x22371e))[_0x22f7('0x3a')](handleError(_0x2e43c2,null));};exports[_0x22f7('0xb8')]=function(_0x3b6436,_0x1f31c6){var _0x10e286={'raw':![],'where':{'id':_0x3b6436[_0x22f7('0xb9')]['id']}},_0x2e15e8={};_0x2e15e8['model']=_['keys'](db[_0x22f7('0xa4')][_0x22f7('0x3d')]);_0x2e15e8[_0x22f7('0x41')]=_[_0x22f7('0x42')](_0x3b6436['query']);_0x2e15e8[_0x22f7('0x43')]=_[_0x22f7('0x44')](_0x2e15e8[_0x22f7('0x40')],_0x2e15e8[_0x22f7('0x41')]);_0x10e286[_0x22f7('0x45')]=_['intersection'](_0x2e15e8[_0x22f7('0x40')],qs[_0x22f7('0x46')](_0x3b6436['query'][_0x22f7('0x46')]));_0x10e286['attributes']=_0x10e286[_0x22f7('0x45')][_0x22f7('0x47')]?_0x10e286[_0x22f7('0x45')]:_0x2e15e8['model'];if(_0x3b6436[_0x22f7('0x41')][_0x22f7('0xba')]){_0x10e286[_0x22f7('0xbb')]=[{'all':!![]}];}_0x10e286=_[_0x22f7('0xa3')]({},_0x10e286,_0x3b6436['options']);return db['WhatsappInteraction']['find'](_0x10e286)[_0x22f7('0x2d')](handleEntityNotFound(_0x1f31c6,null))[_0x22f7('0x2d')](respondWithResult(_0x1f31c6,null))[_0x22f7('0x3a')](handleError(_0x1f31c6,null));};exports[_0x22f7('0xbc')]=function(_0x4335e4,_0x8af80f){return db[_0x22f7('0xa4')][_0x22f7('0xbc')](_0x4335e4[_0x22f7('0x7c')],{})[_0x22f7('0x2d')](respondWithResult(_0x8af80f,0xc9))['catch'](handleError(_0x8af80f,null));};exports['update']=function(_0x693a12,_0x1240df){if(_0x693a12[_0x22f7('0x7c')]['id']){delete _0x693a12['body']['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x693a12[_0x22f7('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1240df,null))[_0x22f7('0x2d')](saveUpdates(_0x693a12[_0x22f7('0x7c')],null))['then'](respondWithResult(_0x1240df,null))[_0x22f7('0x3a')](handleError(_0x1240df,null));};exports['destroy']=function(_0x1c13a1,_0x541bb5){return db['WhatsappInteraction']['find']({'where':{'id':_0x1c13a1[_0x22f7('0xb9')]['id']}})[_0x22f7('0x2d')](handleEntityNotFound(_0x541bb5,null))[_0x22f7('0x2d')](removeEntity(_0x541bb5,null))[_0x22f7('0x3a')](handleError(_0x541bb5,null));};exports[_0x22f7('0xbd')]=function(_0x1c6642,_0x30b679){return db[_0x22f7('0xa4')][_0x22f7('0xbd')]()[_0x22f7('0x2d')](respondWithResult(_0x30b679,null))[_0x22f7('0x3a')](handleError(_0x30b679,null));};exports[_0x22f7('0xbe')]=function(_0x7b1f5d,_0xcf3565,_0x1a3e19){return db[_0x22f7('0xbf')][_0x22f7('0x67')]({'where':{'id':_0x7b1f5d['params']['id']}})[_0x22f7('0x2d')](handleEntityNotFound(_0xcf3565,null))[_0x22f7('0x2d')](function(_0x408f7f){if(_0x408f7f){return _0x408f7f[_0x22f7('0xbe')](_0x7b1f5d[_0x22f7('0x7c')]['ids'],_['omit'](_0x7b1f5d[_0x22f7('0x7c')],[_0x22f7('0xc0'),'id'])||{});}})[_0x22f7('0x2d')](respondWithResult(_0xcf3565,null))[_0x22f7('0x3a')](handleError(_0xcf3565,null));};exports[_0x22f7('0xc1')]=function(_0x6d499e,_0x4d5376,_0x2c3f79){var _0x5aaf93={'raw':![],'where':{}};var _0x251f1f={};var _0x458a28={'count':0x0,'rows':[]};return db[_0x22f7('0xa4')]['findOne']({'where':{'id':_0x6d499e[_0x22f7('0xb9')]['id']}})[_0x22f7('0x2d')](handleEntityNotFound(_0x4d5376,null))[_0x22f7('0x2d')](function(_0x5bdbaf){if(_0x5bdbaf){_0x251f1f[_0x22f7('0x40')]=_['keys'](db[_0x22f7('0xbf')][_0x22f7('0x3d')]);_0x251f1f['query']=_['keys'](_0x6d499e[_0x22f7('0x41')]);_0x251f1f[_0x22f7('0x43')]=_['intersection'](_0x251f1f[_0x22f7('0x40')],_0x251f1f[_0x22f7('0x41')]);_0x5aaf93['attributes']=_['intersection'](_0x251f1f[_0x22f7('0x40')],qs['fields'](_0x6d499e['query'][_0x22f7('0x46')]));_0x5aaf93[_0x22f7('0x45')]=_0x5aaf93[_0x22f7('0x45')][_0x22f7('0x47')]?_0x5aaf93[_0x22f7('0x45')]:_0x251f1f[_0x22f7('0x40')];if(!_0x6d499e[_0x22f7('0x41')]['hasOwnProperty'](_0x22f7('0x49'))){_0x5aaf93['limit']=qs['limit'](_0x6d499e[_0x22f7('0x41')]['limit']);_0x5aaf93[_0x22f7('0x25')]=qs[_0x22f7('0x25')](_0x6d499e[_0x22f7('0x41')][_0x22f7('0x25')]);}_0x5aaf93['order']=qs['sort'](_0x6d499e['query']['sort']);_0x5aaf93['where']=qs['filters'](_[_0x22f7('0x4c')](_0x6d499e[_0x22f7('0x41')],_0x251f1f[_0x22f7('0x43')]));_0x5aaf93[_0x22f7('0x4b')]['WhatsappInteractionId']=_0x5bdbaf['id'];if(_0x6d499e['query'][_0x22f7('0x8e')]){_0x5aaf93['where']=_[_0x22f7('0xa3')](_0x5aaf93['where'],{'$or':_[_0x22f7('0x3c')](_0x5aaf93['attributes'],function(_0x6f53b4){var _0x25d951={};_0x25d951[_0x6f53b4]={'$like':'%'+_0x6d499e['query'][_0x22f7('0x8e')]+'%'};return _0x25d951;})});}if(_0x6d499e[_0x22f7('0x41')][_0x22f7('0x84')]){var _0x5b405f=_0x6d499e[_0x22f7('0x41')][_0x22f7('0x84')][_0x22f7('0x36')](',');var _0x1c6191={};_0x1c6191[_0x5b405f[0x0]]={'$gte':moment(_0x5b405f[0x1])[_0x22f7('0xc2')](_0x22f7('0xc3'))};_0x5aaf93[_0x22f7('0x4b')]=_['merge'](_0x5aaf93[_0x22f7('0x4b')],_0x1c6191);}_0x5aaf93=_[_0x22f7('0xa3')]({},_0x5aaf93,_0x6d499e[_0x22f7('0xc4')]);return db['WhatsappMessage'][_0x22f7('0x28')]({'where':_0x5aaf93[_0x22f7('0x4b')]})[_0x22f7('0x2d')](function(_0x5360fc){_0x458a28[_0x22f7('0x28')]=_0x5360fc;if(_0x6d499e[_0x22f7('0x41')]['includeAll']){_0x5aaf93[_0x22f7('0xbb')]=[{'all':!![]}];}return db[_0x22f7('0xbf')][_0x22f7('0xc5')](_0x5aaf93);})[_0x22f7('0x2d')](function(_0x2139c4){_0x458a28[_0x22f7('0xb7')]=_0x2139c4;return _0x458a28;});}})[_0x22f7('0x2d')](respondWithFilteredResult(_0x4d5376,_0x5aaf93))[_0x22f7('0x3a')](handleError(_0x4d5376,null));};exports[_0x22f7('0xc6')]=function(_0x3db20e,_0x361a7a,_0x2ad40e){return db[_0x22f7('0xa4')][_0x22f7('0x67')]({'where':{'id':_0x3db20e[_0x22f7('0xb9')]['id']}})[_0x22f7('0x2d')](handleEntityNotFound(_0x361a7a,null))[_0x22f7('0x2d')](function(_0x1486b3){if(_0x1486b3){return _0x1486b3[_0x22f7('0xc7')](_0x3db20e[_0x22f7('0x7c')][_0x22f7('0xc0')],_[_0x22f7('0xc8')](_0x3db20e[_0x22f7('0x7c')],[_0x22f7('0xc0'),'id'])||{})[_0x22f7('0xc9')](function(){return db[_0x22f7('0x76')][_0x22f7('0xc5')]({'attributes':['id',_0x22f7('0x31'),_0x22f7('0x4f')],'where':{'id':_0x3db20e[_0x22f7('0x7c')][_0x22f7('0xc0')]}});})[_0x22f7('0x2d')](function(_0x3dcc42){socket[_0x22f7('0xca')](_0x22f7('0xcb'),{'id':Number(_0x3db20e[_0x22f7('0xb9')]['id']),'tags':_0x3dcc42||[]});return{'id':Number(_0x3db20e[_0x22f7('0xb9')]['id']),'tags':_0x3dcc42||[]};});}})['then'](respondWithResult(_0x361a7a,null))[_0x22f7('0x3a')](handleError(_0x361a7a,null));};exports[_0x22f7('0xcc')]=function(_0x277155,_0x4f05c9,_0x2906fa){return db[_0x22f7('0xa4')][_0x22f7('0x67')]({'where':{'id':_0x277155['params']['id']}})['then'](handleEntityNotFound(_0x4f05c9,null))[_0x22f7('0x2d')](function(_0x579df2){if(_0x579df2){return _0x579df2[_0x22f7('0xcc')](_0x277155['query'][_0x22f7('0xc0')]);}})[_0x22f7('0x2d')](respondWithStatusCode(_0x4f05c9,null))[_0x22f7('0x3a')](handleError(_0x4f05c9,null));};exports[_0x22f7('0xcd')]=function(_0x39d4e5,_0x14c7f2){var _0x5857f5=moment()['unix']()['toString']();var _0x4eaa02=path[_0x22f7('0xce')](config[_0x22f7('0xcf')],'server',_0x22f7('0xd0'),_0x22f7('0xd1'));var _0x56d33d=path['join'](config[_0x22f7('0xcf')],_0x22f7('0xd2'),_0x22f7('0xd0'),'attachments');var _0x204a1e=path[_0x22f7('0xce')](_0x4eaa02,_0x5857f5);var _0x5dc780=util['format'](_0x22f7('0xd3'),_0x39d4e5[_0x22f7('0xb9')]['id'],_0x5857f5);var _0x17f544=path[_0x22f7('0xce')](_0x4eaa02,_0x5dc780);var _0x17d49c=[];_0x17d49c[_0x22f7('0x39')]({'model':db[_0x22f7('0x79')],'as':_0x22f7('0x79'),'attributes':['id','fullname'],'raw':!![]});_0x17d49c[_0x22f7('0x39')]({'model':db[_0x22f7('0xd4')],'as':_0x22f7('0x6c'),'attributes':['id','firstName',_0x22f7('0xd5')],'raw':!![]});if(_0x39d4e5[_0x22f7('0x41')]['attachments']){_0x17d49c[_0x22f7('0x39')]({'model':db[_0x22f7('0xd6')],'as':_0x22f7('0xd6'),'raw':!![]});}var _0x3348d3=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id','body',_0x22f7('0x83'),_0x22f7('0xd7'),'secret',_0x22f7('0x8a')],'include':_0x17d49c}];_0x3348d3[_0x22f7('0x39')]({'model':db[_0x22f7('0xd8')],'as':_0x22f7('0xd9'),'attributes':['id',_0x22f7('0x31')]});_0x3348d3[_0x22f7('0x39')]({'model':db[_0x22f7('0x79')],'as':'Owner','attributes':['id',_0x22f7('0x34')]});return db[_0x22f7('0xa4')]['find']({'where':{'id':_0x39d4e5[_0x22f7('0xb9')]['id']},'include':_0x3348d3})[_0x22f7('0x2d')](handleEntityNotFound(_0x14c7f2,null))[_0x22f7('0x2d')](function(_0x308936){if(_0x308936){var _0x1db21d=_0x308936[_0x22f7('0xda')]({'plain':!![]});fs[_0x22f7('0xdb')](_0x204a1e);var _0x1e861b={'channel':_0x22f7('0xdc'),'account':_0x1db21d['Account'][_0x22f7('0x31')],'agent':_0x1db21d[_0x22f7('0xdd')]?_0x1db21d[_0x22f7('0xdd')][_0x22f7('0x34')]:_0x22f7('0xde'),'createdAt':moment(_0x1db21d[_0x22f7('0x83')])[_0x22f7('0xc2')](_0x22f7('0xc3'))[_0x22f7('0xa2')](),'closedAt':_0x1db21d[_0x22f7('0xdf')]?moment(_0x1db21d[_0x22f7('0xe0')])[_0x22f7('0xc2')](_0x22f7('0xc3'))[_0x22f7('0xa2')]():'','disposition':_0x1db21d[_0x22f7('0xe1')],'messages':_(_0x1db21d[_0x22f7('0xe2')])[_0x22f7('0x8e')]({'secret':![]})[_0x22f7('0x3c')](function(_0xf578fe){if(_0xf578fe[_0x22f7('0xd6')]){var _0x4a1d97=path['join'](_0x56d33d,_0xf578fe[_0x22f7('0xd6')][_0x22f7('0xe3')]);if(fs[_0x22f7('0xe4')](_0x4a1d97)){fs[_0x22f7('0xe5')](_0x4a1d97)[_0x22f7('0xe6')](fs[_0x22f7('0xe7')](path[_0x22f7('0xce')](_0x204a1e,_0xf578fe[_0x22f7('0xd6')][_0x22f7('0xe3')])));}}return{'date':moment(_0xf578fe[_0x22f7('0x83')])[_0x22f7('0xc2')](_0x22f7('0xc3'))[_0x22f7('0xa2')](),'sender':_0xf578fe[_0x22f7('0xd7')]==='out'?_0xf578fe[_0x22f7('0x79')]?_0xf578fe[_0x22f7('0x79')][_0x22f7('0x34')]:_0x22f7('0xe8'):_0xf578fe['Contact'][_0x22f7('0xe9')]+(_0xf578fe[_0x22f7('0x6c')][_0x22f7('0xd5')]?'\x20'+_0xf578fe[_0x22f7('0x6c')][_0x22f7('0xd5')]:''),'body':_0xf578fe[_0x22f7('0xd6')]?_0xf578fe['Attachment']['basename']:_0xf578fe[_0x22f7('0x7c')],'direction':_0xf578fe[_0x22f7('0xd7')]==='out'?'A':'C','secret':_0xf578fe[_0x22f7('0xea')],'read':_0xf578fe['read'],'attachment':_0xf578fe['Attachment']};})[_0x22f7('0x69')]()};return ejs[_0x22f7('0xeb')](path[_0x22f7('0xce')](config['root'],_0x22f7('0xd2'),_0x22f7('0xec'),_0x22f7('0xed')),{'interaction':_0x1e861b})['then'](function(_0xc82db){var _0x2cfff6=path[_0x22f7('0xce')](_0x204a1e,'transcript-'+_0x1db21d['id']+'-'+_0x5857f5+_0x22f7('0xee'));var _0x4c5efd={'path':_0x2cfff6,'channel':_0x22f7('0xdc'),'interactionId':_0x1db21d['id']};return pdf['createPdfFromHTML'](_0xc82db,_0x4c5efd);})[_0x22f7('0x2d')](function(){return new BPromise(function(_0x2d6c41,_0x576c2b){zipdir(_0x204a1e,{'saveTo':_0x17f544},function(_0x910fbc,_0x12ceb6){if(_0x910fbc)return _0x576c2b(_0x910fbc);return _0x2d6c41(_0x12ceb6);});})[_0x22f7('0x2d')](function(){return new BPromise(function(_0x63be84,_0x1df9a3){rimraf(_0x204a1e,function(_0x54e5fa){if(_0x54e5fa)_0x1df9a3(_0x54e5fa);return _0x63be84();});});})[_0x22f7('0x2d')](function(){return _0x14c7f2[_0x22f7('0xcd')](_0x17f544,_0x5dc780,function(_0x3b1d23){if(_0x3b1d23){console['log'](_0x22f7('0xef'),_0x3b1d23);}else{fs['unlinkSync'](_0x17f544);}});});});}else{return _0x14c7f2[_0x22f7('0x22')](0xc8);}})['catch'](handleError(_0x14c7f2,null));}; \ No newline at end of file +var _0xfd7b=['views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./whatsappInteraction.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','map','WhatsappInteraction','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','from','user_has_whatsapp_interactions','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','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','ContactId','buildExpression','type','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','body','text','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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)','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','WhatsappMessage','omit','ids','findOne','rawAttributes','format','findAll','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Attachment','Messages','createdAt','direction','secret','Account','Owner','get','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','System','lastName'];(function(_0x52013d,_0x1bdba3){var _0xc20029=function(_0x527520){while(--_0x527520){_0x52013d['push'](_0x52013d['shift']());}};_0xc20029(++_0x1bdba3);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xfd7b[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd7('0x0'));var zipdir=require(_0xbfd7('0x1'));var jsonpatch=require(_0xbfd7('0x2'));var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require(_0xbfd7('0x7'));var path=require(_0xbfd7('0x8'));var sox=require(_0xbfd7('0x9'));var csv=require(_0xbfd7('0xa'));var ejs=require(_0xbfd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xc'));var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xa'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var as=require(_0xbfd7('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfd7('0x14'))(_0xbfd7('0x15'));var utils=require(_0xbfd7('0x16'));var config=require(_0xbfd7('0x17'));var licenseUtil=require(_0xbfd7('0x18'));var db=require('../../mysqldb')['db'];config[_0xbfd7('0x19')]=_['defaults'](config[_0xbfd7('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfd7('0x19')]));require(_0xbfd7('0x1a'))[_0xbfd7('0x1b')](socket);function respondWithStatusCode(_0x371592,_0x5abca0){_0x5abca0=_0x5abca0||0xcc;return function(_0x5efd54){if(_0x5efd54){return _0x371592['sendStatus'](_0x5abca0);}return _0x371592[_0xbfd7('0x1c')](_0x5abca0)[_0xbfd7('0x1d')]();};}function respondWithResult(_0x33d900,_0x3e8754){_0x3e8754=_0x3e8754||0xc8;return function(_0x30c721){if(_0x30c721){return _0x33d900[_0xbfd7('0x1c')](_0x3e8754)[_0xbfd7('0x1e')](_0x30c721);}};}function respondWithFilteredResult(_0x614c9d,_0x3053f3){return function(_0x514248){if(_0x514248){var _0x5b718b=typeof _0x3053f3[_0xbfd7('0x1f')]===_0xbfd7('0x20')&&typeof _0x3053f3['limit']==='undefined';var _0x141211=_0x514248['count'];var _0x5025ee=_0x5b718b?0x0:_0x3053f3[_0xbfd7('0x1f')];var _0x5eab37=_0x5b718b?_0x514248[_0xbfd7('0x21')]:_0x3053f3[_0xbfd7('0x1f')]+_0x3053f3[_0xbfd7('0x22')];var _0x1e244a;if(_0x5eab37>=_0x141211){_0x5eab37=_0x141211;_0x1e244a=0xc8;}else{_0x1e244a=0xce;}_0x614c9d['status'](_0x1e244a);return _0x614c9d[_0xbfd7('0x23')](_0xbfd7('0x24'),_0x5025ee+'-'+_0x5eab37+'/'+_0x141211)[_0xbfd7('0x1e')](_0x514248);}return null;};}function patchUpdates(_0x630a56){return function(_0x229f2f){try{jsonpatch[_0xbfd7('0x25')](_0x229f2f,_0x630a56,!![]);}catch(_0x51b13d){return BPromise[_0xbfd7('0x26')](_0x51b13d);}return _0x229f2f[_0xbfd7('0x27')]();};}function saveUpdates(_0x2cdb9a,_0x5c920e){return function(_0x301b51){if(_0x301b51){return _0x301b51[_0xbfd7('0x28')](_0x2cdb9a)[_0xbfd7('0x29')](function(_0x2d0549){return _0x2d0549;});}return null;};}function removeEntity(_0x358549,_0x585e60){return function(_0x2a7749){if(_0x2a7749){return _0x2a7749[_0xbfd7('0x2a')]()[_0xbfd7('0x29')](function(){_0x358549[_0xbfd7('0x1c')](0xcc)[_0xbfd7('0x1d')]();});}};}function handleEntityNotFound(_0x303060,_0x378428){return function(_0x55b2c8){if(!_0x55b2c8){_0x303060[_0xbfd7('0x2b')](0x194);}return _0x55b2c8;};}function handleError(_0x2f83a0,_0x4d7ef4){_0x4d7ef4=_0x4d7ef4||0x1f4;return function(_0x2971ea){logger[_0xbfd7('0x2c')](_0x2971ea[_0xbfd7('0x2d')]);if(_0x2971ea[_0xbfd7('0x2e')]){delete _0x2971ea['name'];}_0x2f83a0[_0xbfd7('0x1c')](_0x4d7ef4)[_0xbfd7('0x2f')](_0x2971ea);};}function getInteractionUsers(_0x15f211,_0x489365){return new BPromise(function(_0xd5c121,_0x51a508){try{if(_0x489365[_0x15f211['id']]){_0x15f211[_0xbfd7('0x30')]=_['map'](_0x489365[_0x15f211['id']],function(_0xb1ff27){return{'id':_0xb1ff27['id'],'fullname':_0xb1ff27[_0xbfd7('0x31')]};});}}catch(_0x532c5f){_0x51a508(_0x532c5f);}_0xd5c121(_0x15f211);});}function getInteractionTags(_0x57d919,_0xde0053){return new BPromise(function(_0x49a56a,_0x2e7111){try{if(_0x57d919[_0xbfd7('0x32')]){_0x57d919[_0xbfd7('0x33')]=[];_0x57d919['TagIds'][_0xbfd7('0x34')](',')[_0xbfd7('0x35')](function(_0x267b31){_0x57d919[_0xbfd7('0x33')][_0xbfd7('0x36')](_0xde0053[_0x267b31]);});}delete _0x57d919[_0xbfd7('0x32')];}catch(_0x11e58b){_0x2e7111(_0x11e58b);}_0x49a56a(_0x57d919);});}function updateWhatsappInteraction(_0x2a44b6,_0x418994,_0x14b17){return new BPromise(function(_0x26802b,_0x4f62b4){return getInteractionUsers(_0x2a44b6,_0x14b17)[_0xbfd7('0x29')](function(_0x488d0b){return getInteractionTags(_0x488d0b,_0x418994);})['then'](function(_0x3bffcd){_0x26802b(_0x3bffcd);})[_0xbfd7('0x37')](function(_0xa81490){_0x4f62b4(_0xa81490);});});}exports[_0xbfd7('0x38')]=function(_0xc51f8b,_0x403bf5){var _0x25d050={},_0x373c4a={},_0x5d4928={'count':0x0,'rows':[]};var _0x4b275e=_[_0xbfd7('0x39')](db[_0xbfd7('0x3a')]['rawAttributes'],function(_0x3a88c3){return{'name':_0x3a88c3[_0xbfd7('0x3b')],'type':_0x3a88c3['type']['key']};});_0x373c4a[_0xbfd7('0x3c')]=_[_0xbfd7('0x39')](_0x4b275e,'name');_0x373c4a[_0xbfd7('0x3d')]=_[_0xbfd7('0x3e')](_0xc51f8b[_0xbfd7('0x3d')]);_0x373c4a[_0xbfd7('0x3f')]=_[_0xbfd7('0x40')](_0x373c4a['model'],_0x373c4a[_0xbfd7('0x3d')]);_0x25d050[_0xbfd7('0x41')]=_[_0xbfd7('0x40')](_0x373c4a[_0xbfd7('0x3c')],qs[_0xbfd7('0x42')](_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x42')]));_0x25d050[_0xbfd7('0x41')]=_0x25d050['attributes'][_0xbfd7('0x43')]?_0x25d050['attributes']:_0x373c4a['model'];if(!_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x44')](_0xbfd7('0x45'))){_0x25d050[_0xbfd7('0x22')]=qs[_0xbfd7('0x22')](_0xc51f8b[_0xbfd7('0x3d')]['limit']);_0x25d050[_0xbfd7('0x1f')]=qs['offset'](_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x1f')]);}_0x25d050[_0xbfd7('0x46')]=qs[_0xbfd7('0x47')](_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x47')]);_0x25d050[_0xbfd7('0x48')]=qs['filters'](_[_0xbfd7('0x49')](_0xc51f8b[_0xbfd7('0x3d')],_0x373c4a[_0xbfd7('0x3f')]),_0x4b275e);var _0x1d2248=[];var _0x1a9dd8=squel[_0xbfd7('0x4a')]()[_0xbfd7('0x4b')]('id')['field'](_0xbfd7('0x2e'))[_0xbfd7('0x4b')](_0xbfd7('0x4c'))['from']('tools_tags');var _0x4bc829=squel[_0xbfd7('0x4a')]()[_0xbfd7('0x4b')](_0xbfd7('0x4d'))[_0xbfd7('0x4b')]('u.fullname')[_0xbfd7('0x4b')]('ui.WhatsappInteractionId')[_0xbfd7('0x4e')](_0xbfd7('0x4f'),'ui')['left_join'](_0xbfd7('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x26963f=squel[_0xbfd7('0x4a')]()[_0xbfd7('0x4e')]('whatsapp_interactions','i')['left_join'](_0xbfd7('0x51'),'c',_0xbfd7('0x52'))['left_join']('users','o',_0xbfd7('0x53'))[_0xbfd7('0x54')](_0xbfd7('0x55'),'a',_0xbfd7('0x56'))[_0xbfd7('0x54')](_0xbfd7('0x57'),'me',_0xbfd7('0x58'))['left_join']('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xbfd7('0x54')](_0xbfd7('0x59'),'t',_0xbfd7('0x5a'));var _0x59116d=squel[_0xbfd7('0x5b')]();var _0x2df7d2=[];var _0x4ae9f9=squel['expr']();var _0xc89535;if(_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x5c')]){_0xc89535=as['parseSearch'](_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x5c')]);var _0x1f0b1d=_0xc89535['sqlOperator'];for(var _0x371d01=0x0;_0x371d01<_0xc89535[_0xbfd7('0x5d')][_0xbfd7('0x43')];_0x371d01++){var _0x3b246f=_0xc89535['conditions'][_0x371d01];var _0x17ea18='i';var _0x8b7ca2=_[_0xbfd7('0x5e')](_0x4b275e,['name',_0x3b246f[_0xbfd7('0x4b')]]);if(!_0x8b7ca2){switch(_0x3b246f['field']){case _0xbfd7('0x5f'):if(_0x3b246f[_0xbfd7('0x60')]==0x1){_0x26963f[_0xbfd7('0x61')]('`'+_0x3b246f[_0xbfd7('0x4b')]+'`\x20=\x200');}else{_0x26963f[_0xbfd7('0x61')]('`'+_0x3b246f[_0xbfd7('0x4b')]+_0xbfd7('0x62'));}break;case _0xbfd7('0x63'):if(_0x3b246f[_0xbfd7('0x64')]===_0xbfd7('0x65')){if(_0x3b246f[_0xbfd7('0x60')][_0xbfd7('0x34')]('\x20')[_0xbfd7('0x43')]>0x1){_0x59116d[_0x1f0b1d](_0xbfd7('0x66'),qs[_0xbfd7('0x67')](_0x3b246f[_0xbfd7('0x60')]),null);}else{var _0x1732f9='%'+_0x3b246f[_0xbfd7('0x60')]+'%';_0x59116d[_0x1f0b1d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1732f9,_0x1732f9,_0x1732f9);}}else{_0x8b7ca2=_['find'](_0x4b275e,[_0xbfd7('0x2e'),_0xbfd7('0x68')]);_0x3b246f[_0xbfd7('0x4b')]=_0xbfd7('0x68');_0x434176=as[_0xbfd7('0x69')](_0x17ea18,_0x8b7ca2[_0xbfd7('0x6a')],_0x3b246f);_0x59116d[_0x1f0b1d](_0x434176['text'],_0x434176[_0xbfd7('0x60')]['start'],_0x434176['value']['end']);}break;case _0xbfd7('0x6b'):var _0x2e5667=_0x3b246f['value'][_0xbfd7('0x34')](',')[_0xbfd7('0x39')](function(_0x2c71eb){return Number(_0x2c71eb);});_0x2e5667[_0xbfd7('0x35')](function(_0x3dcd77){_0x4ae9f9['or'](_0xbfd7('0x6c'),'%,'+_0x3dcd77+',%');});_0x2df7d2=_[_0xbfd7('0x6d')](_0x2df7d2,_0x2e5667);break;case _0xbfd7('0x6e'):if(_0x3b246f[_0xbfd7('0x64')]==='$substring'){_0x59116d[_0x1f0b1d](_0xbfd7('0x6f'),'%'+_0x3b246f[_0xbfd7('0x60')]+'%',null);}else{_0x8b7ca2=_[_0xbfd7('0x5e')](_0x4b275e,['name','UserId']);_0x3b246f[_0xbfd7('0x4b')]=_0xbfd7('0x70');_0x434176=as[_0xbfd7('0x69')](_0x17ea18,_0x8b7ca2[_0xbfd7('0x6a')],_0x3b246f);_0x59116d[_0x1f0b1d](_0x434176['text'],_0x434176[_0xbfd7('0x60')][_0xbfd7('0x71')],_0x434176[_0xbfd7('0x60')][_0xbfd7('0x1d')]);}break;case _0xbfd7('0x72'):_0x434176=as[_0xbfd7('0x69')]('me',null,_0x3b246f);_0x59116d[_0x1f0b1d](_0x434176[_0xbfd7('0x73')],_0x434176[_0xbfd7('0x60')][_0xbfd7('0x71')],_0x434176[_0xbfd7('0x60')][_0xbfd7('0x1d')]);break;}}else{var _0x434176=as[_0xbfd7('0x69')](_0x17ea18,_0x8b7ca2['type'],_0x3b246f);_0x59116d[_0x1f0b1d](_0x434176[_0xbfd7('0x73')],_0x434176[_0xbfd7('0x60')][_0xbfd7('0x71')],_0x434176['value'][_0xbfd7('0x1d')]);}}}else{var _0x7d7684=_(_0xc51f8b[_0xbfd7('0x3d')])[_0xbfd7('0x3e')]()[_0xbfd7('0x39')](function(_0x569612){return _[_0xbfd7('0x74')](_0x4b275e,[_0xbfd7('0x2e'),_0x569612])?_0x569612:undefined;})[_0xbfd7('0x75')]()[_0xbfd7('0x60')]();if(!_[_0xbfd7('0x76')](_0x7d7684)){_0x7d7684[_0xbfd7('0x35')](function(_0x35b346){if(_0x35b346===_0xbfd7('0x77')){_0x26963f[_0xbfd7('0x48')](_0xbfd7('0x78'),[][_0xbfd7('0x79')](_0xc51f8b[_0xbfd7('0x3d')][_0x35b346]));}else if(_0x35b346==='createdAt'){var _0x4f2b7f=JSON[_0xbfd7('0x7a')](_0xc51f8b[_0xbfd7('0x3d')][_0x35b346])[_0xbfd7('0x7b')];var _0x3951c9=JSON['parse'](_0xc51f8b['query'][_0x35b346])[_0xbfd7('0x7c')];_0x26963f[_0xbfd7('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f2b7f,_0x3951c9);}else{if(_0xc51f8b[_0xbfd7('0x3d')][_0x35b346]===_0xbfd7('0x7d')){_0x26963f['where']('i.'+_0x35b346+_0xbfd7('0x7e'));}else{_0x26963f[_0xbfd7('0x48')]('i.'+_0x35b346+_0xbfd7('0x7f'),_0xc51f8b['query'][_0x35b346]);}}});}if(_0xc51f8b[_0xbfd7('0x3d')]['read']){if(_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x80')]==0x1){_0x26963f[_0xbfd7('0x61')](_0xbfd7('0x81'));}else{_0x26963f[_0xbfd7('0x61')](_0xbfd7('0x82'));}}if(_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x83')]){_0x2df7d2=_[_0xbfd7('0x84')](_0xc51f8b['query'][_0xbfd7('0x83')])?_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x83')]:new Array(_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x83')]);_0x2df7d2[_0xbfd7('0x35')](function(_0x2ef9ae){_0x4ae9f9['or'](_0xbfd7('0x6c'),'%,'+_0x2ef9ae+',%');});}if(_0xc51f8b['query'][_0xbfd7('0x85')]){var _0x2d8cb2=_0xc51f8b['query']['filter'][_0xbfd7('0x86')]('\x5c','\x5c\x5c')[_0xbfd7('0x86')](/'/g,'\x27\x27');if(qs[_0xbfd7('0x87')](_0x2d8cb2)){_0x59116d['or'](_0xbfd7('0x88'),_0x2d8cb2+'%')['or'](_0xbfd7('0x89'),_0x2d8cb2+'%');}else{_0x59116d['or'](_0xbfd7('0x8a'),qs[_0xbfd7('0x67')](_0x2d8cb2))['or'](_0xbfd7('0x8b'),_0x2d8cb2+'%');}}}_0x26963f['where'](_0x59116d);_0x26963f[_0xbfd7('0x8c')](_0xbfd7('0x8d'));var _0x1a42b9={'type':db[_0xbfd7('0x8e')][_0xbfd7('0x8f')]['SELECT'],'raw':!![]};var _0x1a60f5=_0x26963f['clone']();_0x1a60f5['field'](_0xbfd7('0x8d'));_0x1a60f5[_0xbfd7('0x4b')](_0xbfd7('0x90'),_0xbfd7('0x5f'));if(_0x25d050['order']){_0x25d050[_0xbfd7('0x46')][_0xbfd7('0x35')](function(_0x6d6aec){var _0x1c2dc7=_0x6d6aec[0x0]===_0xbfd7('0x91')?_0x6d6aec[0x0]:'i.'+_0x6d6aec[0x0];_0x26963f[_0xbfd7('0x46')](_0x1c2dc7,_0x6d6aec[0x1]===_0xbfd7('0x92')?![]:!![]);});}if(!_[_0xbfd7('0x76')](_0x2df7d2)){_0x26963f[_0xbfd7('0x61')](_0x4ae9f9);_0x1a60f5['where']('t.id\x20IN\x20?',_0x2df7d2);}BPromise[_0xbfd7('0x93')]()[_0xbfd7('0x29')](function(){if(!_0xc89535){if(_0xc51f8b['query'][_0xbfd7('0x77')])return;_0x1a60f5[_0xbfd7('0x48')](_0xbfd7('0x94'));_0x26963f[_0xbfd7('0x48')](_0xbfd7('0x94'));return;}if(_0xc51f8b[_0xbfd7('0x95')][_0xbfd7('0x96')]!==_0xbfd7('0x97'))return;return _0xc51f8b[_0xbfd7('0x95')][_0xbfd7('0x98')]({'attributes':['id'],'raw':!![]})[_0xbfd7('0x29')](function(_0x10aded){if(_[_0xbfd7('0x76')](_0x10aded)){_0x1a60f5['where'](_0xbfd7('0x99'));_0x26963f[_0xbfd7('0x48')](_0xbfd7('0x99'));}else{_0x1a60f5[_0xbfd7('0x48')](_0xbfd7('0x78'),_[_0xbfd7('0x39')](_0x10aded,'id'));_0x26963f[_0xbfd7('0x48')]('i.WhatsappAccountId\x20IN\x20?',_[_0xbfd7('0x39')](_0x10aded,'id'));}});})[_0xbfd7('0x29')](function(){if(_0xc51f8b['user'][_0xbfd7('0x96')]===_0xbfd7('0x97')&&!_0xc89535&&!_0xc51f8b[_0xbfd7('0x3d')]['WhatsappAccountId'])return[];return db[_0xbfd7('0x9a')][_0xbfd7('0x3d')](_0x1a60f5[_0xbfd7('0x9b')](),_0x1a42b9);})['then'](function(_0x2787e8){_0x5d4928[_0xbfd7('0x21')]=_0x2787e8[_0xbfd7('0x43')];if(_0x5d4928[_0xbfd7('0x21')]===0x0)return[];return db[_0xbfd7('0x9a')][_0xbfd7('0x3d')](_0x1a9dd8['toString'](),_0x1a42b9)[_0xbfd7('0x29')](function(_0x4aef17){_0x1d2248=_[_0xbfd7('0x9c')](_0x4aef17,'id');_0x1a42b9=_[_0xbfd7('0x9d')](_0x1a42b9,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc51f8b[_0xbfd7('0x3d')][_0xbfd7('0x42')]){_0x25d050[_0xbfd7('0x41')][_0xbfd7('0x35')](function(_0x5dad4c){_0x26963f[_0xbfd7('0x4b')]('i.'+_0x5dad4c);});}else{_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0x90'),_0xbfd7('0x5f'));_0x26963f['field'](_0xbfd7('0x9e'),'Account.key');_0x26963f[_0xbfd7('0x4b')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x26963f['field'](_0xbfd7('0x9f'),'contactName');_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0xa0'));_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0xa1'),_0xbfd7('0xa2'));_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0xa3'),_0xbfd7('0xa4'));_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0xa5'),_0xbfd7('0xa6'));_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0xa7'),'Contact.phone');_0x26963f['field'](_0xbfd7('0xa8'),'Contact.mobile');_0x26963f['field'](_0xbfd7('0xa9'),_0xbfd7('0xaa'));_0x26963f['field'](_0xbfd7('0xab'),_0xbfd7('0xac'));_0x26963f[_0xbfd7('0x4b')](_0xbfd7('0xad'),_0xbfd7('0xae'));_0x26963f[_0xbfd7('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x25d050[_0xbfd7('0x22')])_0x26963f['limit'](_0x25d050[_0xbfd7('0x22')]);if(_0x25d050[_0xbfd7('0x1f')])_0x26963f[_0xbfd7('0x1f')](_0x25d050['offset']);return db[_0xbfd7('0x9a')][_0xbfd7('0x3d')](_0x26963f[_0xbfd7('0x9b')](),_0x1a42b9);})['then'](function(_0x2ddded){if(_0x2ddded['length']>0x0)_0x4bc829[_0xbfd7('0x48')](_0xbfd7('0xaf'),_[_0xbfd7('0x39')](_0x2ddded,'id'));return db[_0xbfd7('0x9a')][_0xbfd7('0x3d')](_0x4bc829['toString'](),_0x1a42b9)[_0xbfd7('0x29')](function(_0x1d0468){var _0x493b4a=_[_0xbfd7('0xb0')](_0x1d0468,_0xbfd7('0xb1'));var _0x5b199b=[];_0x2ddded[_0xbfd7('0x35')](function(_0x5d8a43){_0x5b199b['push'](updateWhatsappInteraction(_0x5d8a43,_0x1d2248,_0x493b4a));});return BPromise[_0xbfd7('0xb2')](_0x5b199b);});});})['then'](function(_0x49ca0a){_0x5d4928[_0xbfd7('0xb3')]=_0x49ca0a;return _0x5d4928;})[_0xbfd7('0x29')](respondWithFilteredResult(_0x403bf5,_0x25d050))[_0xbfd7('0x37')](handleError(_0x403bf5,null));};exports[_0xbfd7('0xb4')]=function(_0x37dfce,_0x37a1f1){var _0x1e0c4f={'raw':![],'where':{'id':_0x37dfce[_0xbfd7('0xb5')]['id']}},_0xd9304e={};_0xd9304e['model']=_[_0xbfd7('0x3e')](db['WhatsappInteraction']['rawAttributes']);_0xd9304e[_0xbfd7('0x3d')]=_[_0xbfd7('0x3e')](_0x37dfce['query']);_0xd9304e[_0xbfd7('0x3f')]=_['intersection'](_0xd9304e['model'],_0xd9304e['query']);_0x1e0c4f[_0xbfd7('0x41')]=_[_0xbfd7('0x40')](_0xd9304e['model'],qs[_0xbfd7('0x42')](_0x37dfce[_0xbfd7('0x3d')][_0xbfd7('0x42')]));_0x1e0c4f[_0xbfd7('0x41')]=_0x1e0c4f[_0xbfd7('0x41')]['length']?_0x1e0c4f[_0xbfd7('0x41')]:_0xd9304e['model'];if(_0x37dfce[_0xbfd7('0x3d')][_0xbfd7('0xb6')]){_0x1e0c4f[_0xbfd7('0xb7')]=[{'all':!![]}];}_0x1e0c4f=_[_0xbfd7('0x9d')]({},_0x1e0c4f,_0x37dfce[_0xbfd7('0xb8')]);return db[_0xbfd7('0x3a')]['find'](_0x1e0c4f)[_0xbfd7('0x29')](handleEntityNotFound(_0x37a1f1,null))[_0xbfd7('0x29')](respondWithResult(_0x37a1f1,null))[_0xbfd7('0x37')](handleError(_0x37a1f1,null));};exports[_0xbfd7('0xb9')]=function(_0x1790ee,_0xb177d3){return db['WhatsappInteraction'][_0xbfd7('0xb9')](_0x1790ee['body'],{})[_0xbfd7('0x29')](respondWithResult(_0xb177d3,0xc9))[_0xbfd7('0x37')](handleError(_0xb177d3,null));};exports['update']=function(_0x47f8ff,_0x4017bf){if(_0x47f8ff[_0xbfd7('0x72')]['id']){delete _0x47f8ff[_0xbfd7('0x72')]['id'];}return db[_0xbfd7('0x3a')][_0xbfd7('0x5e')]({'where':{'id':_0x47f8ff['params']['id']}})['then'](handleEntityNotFound(_0x4017bf,null))[_0xbfd7('0x29')](saveUpdates(_0x47f8ff['body'],null))[_0xbfd7('0x29')](respondWithResult(_0x4017bf,null))['catch'](handleError(_0x4017bf,null));};exports['destroy']=function(_0x5c70dd,_0x4cda54){return db[_0xbfd7('0x3a')][_0xbfd7('0x5e')]({'where':{'id':_0x5c70dd[_0xbfd7('0xb5')]['id']}})['then'](handleEntityNotFound(_0x4cda54,null))[_0xbfd7('0x29')](removeEntity(_0x4cda54,null))[_0xbfd7('0x37')](handleError(_0x4cda54,null));};exports[_0xbfd7('0xba')]=function(_0x536419,_0x37e409){return db['WhatsappInteraction']['describe']()[_0xbfd7('0x29')](respondWithResult(_0x37e409,null))[_0xbfd7('0x37')](handleError(_0x37e409,null));};exports[_0xbfd7('0xbb')]=function(_0x5ecf44,_0x399fe4,_0x3733e6){return db[_0xbfd7('0xbc')]['find']({'where':{'id':_0x5ecf44[_0xbfd7('0xb5')]['id']}})[_0xbfd7('0x29')](handleEntityNotFound(_0x399fe4,null))[_0xbfd7('0x29')](function(_0x361502){if(_0x361502){return _0x361502[_0xbfd7('0xbb')](_0x5ecf44[_0xbfd7('0x72')]['ids'],_[_0xbfd7('0xbd')](_0x5ecf44['body'],[_0xbfd7('0xbe'),'id'])||{});}})[_0xbfd7('0x29')](respondWithResult(_0x399fe4,null))[_0xbfd7('0x37')](handleError(_0x399fe4,null));};exports['getMessages']=function(_0xd66343,_0x5e0212,_0x58842b){var _0xaa6f7f={'raw':![],'where':{}};var _0x3683c2={};var _0x28f051={'count':0x0,'rows':[]};return db[_0xbfd7('0x3a')][_0xbfd7('0xbf')]({'where':{'id':_0xd66343[_0xbfd7('0xb5')]['id']}})['then'](handleEntityNotFound(_0x5e0212,null))[_0xbfd7('0x29')](function(_0x2c526a){if(_0x2c526a){_0x3683c2[_0xbfd7('0x3c')]=_[_0xbfd7('0x3e')](db['WhatsappMessage'][_0xbfd7('0xc0')]);_0x3683c2[_0xbfd7('0x3d')]=_[_0xbfd7('0x3e')](_0xd66343[_0xbfd7('0x3d')]);_0x3683c2['filters']=_['intersection'](_0x3683c2[_0xbfd7('0x3c')],_0x3683c2[_0xbfd7('0x3d')]);_0xaa6f7f[_0xbfd7('0x41')]=_[_0xbfd7('0x40')](_0x3683c2[_0xbfd7('0x3c')],qs[_0xbfd7('0x42')](_0xd66343[_0xbfd7('0x3d')][_0xbfd7('0x42')]));_0xaa6f7f[_0xbfd7('0x41')]=_0xaa6f7f[_0xbfd7('0x41')][_0xbfd7('0x43')]?_0xaa6f7f[_0xbfd7('0x41')]:_0x3683c2[_0xbfd7('0x3c')];if(!_0xd66343[_0xbfd7('0x3d')]['hasOwnProperty'](_0xbfd7('0x45'))){_0xaa6f7f[_0xbfd7('0x22')]=qs[_0xbfd7('0x22')](_0xd66343[_0xbfd7('0x3d')][_0xbfd7('0x22')]);_0xaa6f7f[_0xbfd7('0x1f')]=qs[_0xbfd7('0x1f')](_0xd66343[_0xbfd7('0x3d')]['offset']);}_0xaa6f7f['order']=qs[_0xbfd7('0x47')](_0xd66343['query'][_0xbfd7('0x47')]);_0xaa6f7f[_0xbfd7('0x48')]=qs[_0xbfd7('0x3f')](_[_0xbfd7('0x49')](_0xd66343[_0xbfd7('0x3d')],_0x3683c2[_0xbfd7('0x3f')]));_0xaa6f7f[_0xbfd7('0x48')][_0xbfd7('0xb1')]=_0x2c526a['id'];if(_0xd66343['query']['filter']){_0xaa6f7f[_0xbfd7('0x48')]=_[_0xbfd7('0x9d')](_0xaa6f7f['where'],{'$or':_[_0xbfd7('0x39')](_0xaa6f7f[_0xbfd7('0x41')],function(_0x354b2c){var _0x5c96af={};_0x5c96af[_0x354b2c]={'$like':'%'+_0xd66343['query'][_0xbfd7('0x85')]+'%'};return _0x5c96af;})});}if(_0xd66343[_0xbfd7('0x3d')]['$gte']){var _0x589c6b=_0xd66343[_0xbfd7('0x3d')]['$gte'][_0xbfd7('0x34')](',');var _0x33f669={};_0x33f669[_0x589c6b[0x0]]={'$gte':moment(_0x589c6b[0x1])[_0xbfd7('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0xaa6f7f[_0xbfd7('0x48')]=_[_0xbfd7('0x9d')](_0xaa6f7f[_0xbfd7('0x48')],_0x33f669);}_0xaa6f7f=_['merge']({},_0xaa6f7f,_0xd66343['options']);return db['WhatsappMessage']['count']({'where':_0xaa6f7f['where']})[_0xbfd7('0x29')](function(_0xda2a1b){_0x28f051[_0xbfd7('0x21')]=_0xda2a1b;if(_0xd66343[_0xbfd7('0x3d')]['includeAll']){_0xaa6f7f[_0xbfd7('0xb7')]=[{'all':!![]}];}return db[_0xbfd7('0xbc')][_0xbfd7('0xc2')](_0xaa6f7f);})['then'](function(_0x549644){_0x28f051[_0xbfd7('0xb3')]=_0x549644;return _0x28f051;});}})['then'](respondWithFilteredResult(_0x5e0212,_0xaa6f7f))[_0xbfd7('0x37')](handleError(_0x5e0212,null));};exports['addTags']=function(_0x2cc39b,_0x3bd04e,_0xe3dcbc){return db['WhatsappInteraction'][_0xbfd7('0x5e')]({'where':{'id':_0x2cc39b[_0xbfd7('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3bd04e,null))[_0xbfd7('0x29')](function(_0x578e61){if(_0x578e61){return _0x578e61['setTags'](_0x2cc39b['body'][_0xbfd7('0xbe')],_[_0xbfd7('0xbd')](_0x2cc39b[_0xbfd7('0x72')],[_0xbfd7('0xbe'),'id'])||{})[_0xbfd7('0xc3')](function(){return db[_0xbfd7('0x6b')][_0xbfd7('0xc2')]({'attributes':['id',_0xbfd7('0x2e'),_0xbfd7('0x4c')],'where':{'id':_0x2cc39b['body'][_0xbfd7('0xbe')]}});})['then'](function(_0x1843bc){socket[_0xbfd7('0xc4')](_0xbfd7('0xc5'),{'id':Number(_0x2cc39b['params']['id']),'tags':_0x1843bc||[]});return{'id':Number(_0x2cc39b[_0xbfd7('0xb5')]['id']),'tags':_0x1843bc||[]};});}})[_0xbfd7('0x29')](respondWithResult(_0x3bd04e,null))[_0xbfd7('0x37')](handleError(_0x3bd04e,null));};exports[_0xbfd7('0xc6')]=function(_0x417098,_0x599413,_0xfb48cd){return db[_0xbfd7('0x3a')][_0xbfd7('0x5e')]({'where':{'id':_0x417098['params']['id']}})[_0xbfd7('0x29')](handleEntityNotFound(_0x599413,null))[_0xbfd7('0x29')](function(_0x33f165){if(_0x33f165){return _0x33f165[_0xbfd7('0xc6')](_0x417098[_0xbfd7('0x3d')][_0xbfd7('0xbe')]);}})[_0xbfd7('0x29')](respondWithStatusCode(_0x599413,null))[_0xbfd7('0x37')](handleError(_0x599413,null));};exports[_0xbfd7('0xc7')]=function(_0x1ad284,_0x23ee5f){var _0xd73583=moment()[_0xbfd7('0xc8')]()['toString']();var _0x476ead=path[_0xbfd7('0xc9')](config[_0xbfd7('0xca')],_0xbfd7('0xcb'),_0xbfd7('0xcc'),_0xbfd7('0xcd'));var _0x1e6d04=path[_0xbfd7('0xc9')](config['root'],'server',_0xbfd7('0xcc'),_0xbfd7('0xce'));var _0x46dd19=path['join'](_0x476ead,_0xd73583);var _0x49693e=util['format'](_0xbfd7('0xcf'),_0x1ad284[_0xbfd7('0xb5')]['id'],_0xd73583);var _0x1e845e=path['join'](_0x476ead,_0x49693e);var _0x4df5b3=[];_0x4df5b3['push']({'model':db['User'],'as':_0xbfd7('0x6e'),'attributes':['id','fullname'],'raw':!![]});_0x4df5b3['push']({'model':db['CmContact'],'as':_0xbfd7('0x63'),'attributes':['id',_0xbfd7('0xd0'),'lastName'],'raw':!![]});if(_0x1ad284['query']['attachments']){_0x4df5b3[_0xbfd7('0x36')]({'model':db[_0xbfd7('0xd1')],'as':'Attachment','raw':!![]});}var _0x343953=[{'model':db[_0xbfd7('0xbc')],'as':_0xbfd7('0xd2'),'attributes':['id',_0xbfd7('0x72'),_0xbfd7('0xd3'),_0xbfd7('0xd4'),_0xbfd7('0xd5'),_0xbfd7('0x80')],'include':_0x4df5b3}];_0x343953[_0xbfd7('0x36')]({'model':db['WhatsappAccount'],'as':_0xbfd7('0xd6'),'attributes':['id',_0xbfd7('0x2e')]});_0x343953[_0xbfd7('0x36')]({'model':db[_0xbfd7('0x6e')],'as':_0xbfd7('0xd7'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0xbfd7('0x5e')]({'where':{'id':_0x1ad284[_0xbfd7('0xb5')]['id']},'include':_0x343953})[_0xbfd7('0x29')](handleEntityNotFound(_0x23ee5f,null))['then'](function(_0x5e13ba){if(_0x5e13ba){var _0x1a9235=_0x5e13ba[_0xbfd7('0xd8')]({'plain':!![]});fs[_0xbfd7('0xd9')](_0x46dd19);var _0x1adb07={'channel':'Whatsapp','account':_0x1a9235['Account']['name'],'agent':_0x1a9235[_0xbfd7('0xd7')]?_0x1a9235[_0xbfd7('0xd7')]['fullname']:'N.A.','createdAt':moment(_0x1a9235['createdAt'])[_0xbfd7('0xc1')](_0xbfd7('0xda'))[_0xbfd7('0x9b')](),'closedAt':_0x1a9235[_0xbfd7('0xdb')]?moment(_0x1a9235[_0xbfd7('0xdc')])['format'](_0xbfd7('0xda'))[_0xbfd7('0x9b')]():'','disposition':_0x1a9235[_0xbfd7('0xdd')],'messages':_(_0x1a9235['Messages'])['filter']({'secret':![]})[_0xbfd7('0x39')](function(_0x7b5edf){if(_0x7b5edf[_0xbfd7('0xd1')]){var _0x4949b1=path['join'](_0x1e6d04,_0x7b5edf[_0xbfd7('0xd1')][_0xbfd7('0xde')]);if(fs[_0xbfd7('0xdf')](_0x4949b1)){fs[_0xbfd7('0xe0')](_0x4949b1)[_0xbfd7('0xe1')](fs[_0xbfd7('0xe2')](path['join'](_0x46dd19,_0x7b5edf[_0xbfd7('0xd1')][_0xbfd7('0xde')])));}}return{'date':moment(_0x7b5edf[_0xbfd7('0xd3')])[_0xbfd7('0xc1')](_0xbfd7('0xda'))[_0xbfd7('0x9b')](),'sender':_0x7b5edf['direction']==='out'?_0x7b5edf[_0xbfd7('0x6e')]?_0x7b5edf['User']['fullname']:_0xbfd7('0xe3'):_0x7b5edf['Contact']['firstName']+(_0x7b5edf[_0xbfd7('0x63')][_0xbfd7('0xe4')]?'\x20'+_0x7b5edf[_0xbfd7('0x63')]['lastName']:''),'body':_0x7b5edf[_0xbfd7('0xd1')]?_0x7b5edf[_0xbfd7('0xd1')]['basename']:_0x7b5edf[_0xbfd7('0x72')],'direction':_0x7b5edf[_0xbfd7('0xd4')]==='out'?'A':'C','secret':_0x7b5edf[_0xbfd7('0xd5')],'read':_0x7b5edf['read'],'attachment':_0x7b5edf['Attachment']};})[_0xbfd7('0x60')]()};return ejs['renderFile'](path['join'](config[_0xbfd7('0xca')],_0xbfd7('0xcb'),_0xbfd7('0xe5'),_0xbfd7('0xe6')),{'interaction':_0x1adb07})[_0xbfd7('0x29')](function(_0x469a62){var _0x4f0652=path[_0xbfd7('0xc9')](_0x46dd19,_0xbfd7('0xe7')+_0x1a9235['id']+'-'+_0xd73583+_0xbfd7('0xe8'));var _0x39a1a5={'path':_0x4f0652,'channel':_0xbfd7('0xe9'),'interactionId':_0x1a9235['id']};return pdf['createPdfFromHTML'](_0x469a62,_0x39a1a5);})['then'](function(){return new BPromise(function(_0x4ddc6f,_0x53e4df){zipdir(_0x46dd19,{'saveTo':_0x1e845e},function(_0x13a2b3,_0xc378b4){if(_0x13a2b3)return _0x53e4df(_0x13a2b3);return _0x4ddc6f(_0xc378b4);});})[_0xbfd7('0x29')](function(){return new BPromise(function(_0xec36c8,_0x1d91cd){rimraf(_0x46dd19,function(_0x2ef250){if(_0x2ef250)_0x1d91cd(_0x2ef250);return _0xec36c8();});});})[_0xbfd7('0x29')](function(){return _0x23ee5f[_0xbfd7('0xc7')](_0x1e845e,_0x49693e,function(_0x49c789){if(_0x49c789){console['log'](_0xbfd7('0xea'),_0x49c789);}else{fs[_0xbfd7('0xeb')](_0x1e845e);}});});});}else{return _0x23ee5f[_0xbfd7('0x2b')](0xc8);}})[_0xbfd7('0x37')](handleError(_0x23ee5f,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 69a077e..928da2c 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 _0xc91b=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','catch','hasOwnProperty','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update'];(function(_0x2432d9,_0x26e92e){var _0x53609a=function(_0x477189){while(--_0x477189){_0x2432d9['push'](_0x2432d9['shift']());}};_0x53609a(++_0x26e92e);}(_0xc91b,0x16f));var _0xbc91=function(_0x4263e7,_0x453ca0){_0x4263e7=_0x4263e7-0x0;var _0xe85771=_0xc91b[_0x4263e7];return _0xe85771;};'use strict';var EventEmitter=require(_0xbc91('0x0'));var WhatsappInteraction=require(_0xbc91('0x1'))['db'][_0xbc91('0x2')];var WhatsappMessage=require(_0xbc91('0x1'))['db'][_0xbc91('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbc91('0x4')](0x0);var events={'afterCreate':_0xbc91('0x5'),'afterUpdate':_0xbc91('0x6'),'afterDestroy':'remove'};function emitEvent(_0x38fe3a){return function(_0x24a895,_0x4a88e3,_0x222ed7){_0x24a895[_0xbc91('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xf88d45){_0x24a895[_0xbc91('0x8')](_0xbc91('0x9'),_0xf88d45[_0xbc91('0xa')](function(_0x3f9299){return{'id':_0x3f9299['id']};}));return WhatsappMessage[_0xbc91('0xb')]({'where':{'WhatsappInteractionId':_0x24a895['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc91('0xc')](function(_0x4e1d68){_0x24a895[_0xbc91('0x8')](_0xbc91('0xd'),_0x4e1d68[_0xbc91('0xe')]);WhatsappInteractionEvents['emit'](_0x38fe3a+':'+_0x24a895['id'],_0x24a895);WhatsappInteractionEvents['emit'](_0x38fe3a,_0x24a895);_0x222ed7(null);})[_0xbc91('0xf')](_0x222ed7(null));};}for(var e in events){if(events[_0xbc91('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x61a5=['events','WhatsappInteraction','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x2ba357,_0x38b735){var _0x3f74bc=function(_0x4c817f){while(--_0x4c817f){_0x2ba357['push'](_0x2ba357['shift']());}};_0x3f74bc(++_0x38b735);}(_0x61a5,0x19e));var _0x561a=function(_0x269c42,_0xeed101){_0x269c42=_0x269c42-0x0;var _0x4dad76=_0x61a5[_0x269c42];return _0x4dad76;};'use strict';var EventEmitter=require(_0x561a('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x561a('0x1')];var WhatsappMessage=require(_0x561a('0x2'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x561a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x561a('0x4'),'afterDestroy':_0x561a('0x5')};function emitEvent(_0x1d8bd8){return function(_0x1bce83,_0x2261b3,_0x28ff42){_0x1bce83[_0x561a('0x6')]({'attributes':['id'],'raw':!![]})[_0x561a('0x7')](function(_0x4c2853){_0x1bce83[_0x561a('0x8')](_0x561a('0x9'),_0x4c2853[_0x561a('0xa')](function(_0x5cd4f6){return{'id':_0x5cd4f6['id']};}));return WhatsappMessage[_0x561a('0xb')]({'where':{'WhatsappInteractionId':_0x1bce83['id'],'direction':'in','read':![]},'raw':!![]});})[_0x561a('0x7')](function(_0x5a4e9b){_0x1bce83[_0x561a('0x8')](_0x561a('0xc'),_0x5a4e9b[_0x561a('0xd')]);WhatsappInteractionEvents[_0x561a('0xe')](_0x1d8bd8+':'+_0x1bce83['id'],_0x1bce83);WhatsappInteractionEvents['emit'](_0x1d8bd8,_0x1bce83);_0x28ff42(null);})['catch'](_0x28ff42(null));};}for(var e in events){if(events[_0x561a('0xf')](e)){var event=events[e];WhatsappInteraction[_0x561a('0x10')](e,emitEvent(event));}}module[_0x561a('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 355bdb4..adfdc20 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 _0xb884=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','whatsapp_interactions','changed'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0xb884,0x134));var _0x4b88=function(_0x4b573a,_0x13828a){_0x4b573a=_0x4b573a-0x0;var _0x1ae343=_0xb884[_0x4b573a];return _0x1ae343;};'use strict';var _=require(_0x4b88('0x0'));var util=require('util');var logger=require(_0x4b88('0x1'))(_0x4b88('0x2'));var moment=require(_0x4b88('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b88('0x4'));var fs=require('fs');var path=require(_0x4b88('0x5'));var rimraf=require(_0x4b88('0x6'));var config=require(_0x4b88('0x7'));var attributes=require(_0x4b88('0x8'));module[_0x4b88('0x9')]=function(_0x553f1a,_0x213cbf){return _0x553f1a['define']('WhatsappInteraction',attributes,{'tableName':_0x4b88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x473451,_0x2fb2ac,_0x39d0ba){if(_0x473451[_0x4b88('0xb')](_0x4b88('0xc'))){_0x473451[_0x4b88('0xd')]=moment()[_0x4b88('0xe')](_0x4b88('0xf'));}_0x39d0ba(null,_0x473451);}}});}; \ No newline at end of file +var _0xf954=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','lodash','util'];(function(_0x1866b0,_0x127c0a){var _0x51c8f8=function(_0x61f734){while(--_0x61f734){_0x1866b0['push'](_0x1866b0['shift']());}};_0x51c8f8(++_0x127c0a);}(_0xf954,0x10e));var _0x4f95=function(_0x23200d,_0x15fb6e){_0x23200d=_0x23200d-0x0;var _0x3f8381=_0xf954[_0x23200d];return _0x3f8381;};'use strict';var _=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var logger=require(_0x4f95('0x2'))(_0x4f95('0x3'));var moment=require(_0x4f95('0x4'));var BPromise=require(_0x4f95('0x5'));var rp=require(_0x4f95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f95('0x7'));var attributes=require(_0x4f95('0x8'));module[_0x4f95('0x9')]=function(_0x3ca6c3,_0x5c68f3){return _0x3ca6c3[_0x4f95('0xa')](_0x4f95('0xb'),attributes,{'tableName':_0x4f95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f8c9a,_0x4a61f7,_0x4af27c){if(_0x3f8c9a[_0x4f95('0xd')](_0x4f95('0xe'))){_0x3f8c9a[_0x4f95('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4af27c(null,_0x3f8c9a);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 0e963d7..3cd855d 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 _0xb1d3=['WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','then'];(function(_0x283014,_0x2ac650){var _0x5d4811=function(_0x39f372){while(--_0x39f372){_0x283014['push'](_0x283014['shift']());}};_0x5d4811(++_0x2ac650);}(_0xb1d3,0x172));var _0x3b1d=function(_0x2144cb,_0x5d7711){_0x2144cb=_0x2144cb-0x0;var _0x7199f0=_0xb1d3[_0x2144cb];return _0x7199f0;};'use strict';var _=require(_0x3b1d('0x0'));var util=require(_0x3b1d('0x1'));var moment=require(_0x3b1d('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b1d('0x3'));var fs=require('fs');var Redis=require(_0x3b1d('0x4'));var db=require(_0x3b1d('0x5'))['db'];var utils=require(_0x3b1d('0x6'));var logger=require('../../config/logger')(_0x3b1d('0x7'));var config=require(_0x3b1d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3b1d('0x9')][_0x3b1d('0xa')]({'port':0x232a});config['redis']=_[_0x3b1d('0xb')](config[_0x3b1d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b1d('0xd'))(new Redis(config[_0x3b1d('0xc')]));require(_0x3b1d('0xe'))[_0x3b1d('0xf')](socket);function respondWithRpcPromise(_0x460d7b,_0x144eb9,_0x525e41){return new BPromise(function(_0x49a04e,_0x4cf3ab){return client['request'](_0x460d7b,_0x525e41)[_0x3b1d('0x10')](function(_0x164f58){logger['info'](_0x3b1d('0x11'),_0x144eb9,'request\x20sent');logger[_0x3b1d('0x12')](_0x3b1d('0x13'),_0x144eb9,_0x3b1d('0x14'),JSON[_0x3b1d('0x15')](_0x164f58));if(_0x164f58[_0x3b1d('0x16')]){if(_0x164f58[_0x3b1d('0x16')][_0x3b1d('0x17')]===0x1f4){logger[_0x3b1d('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x144eb9,_0x164f58[_0x3b1d('0x16')][_0x3b1d('0x18')]);return _0x4cf3ab(_0x164f58['error'][_0x3b1d('0x18')]);}logger[_0x3b1d('0x16')](_0x3b1d('0x11'),_0x144eb9,_0x164f58['error'][_0x3b1d('0x18')]);return _0x49a04e(_0x164f58['error'][_0x3b1d('0x18')]);}else{logger[_0x3b1d('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x144eb9,_0x3b1d('0x14'));_0x49a04e(_0x164f58[_0x3b1d('0x1a')]['message']);}})[_0x3b1d('0x1b')](function(_0x447d74){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x144eb9,_0x447d74);_0x4cf3ab(_0x447d74);});});}exports[_0x3b1d('0x1c')]=function(_0x4cf882){var _0x51f220=this;return new Promise(function(_0x59d250,_0x4ad284){return db[_0x3b1d('0x1d')][_0x3b1d('0x1e')](_0x4cf882[_0x3b1d('0x1f')],{'raw':_0x4cf882[_0x3b1d('0x20')]?_0x4cf882[_0x3b1d('0x20')][_0x3b1d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf882['options']?_0x4cf882['options'][_0x3b1d('0x22')]||null:null,'attributes':_0x4cf882[_0x3b1d('0x20')]?_0x4cf882[_0x3b1d('0x20')][_0x3b1d('0x23')]||null:null,'limit':_0x4cf882[_0x3b1d('0x20')]?_0x4cf882[_0x3b1d('0x20')][_0x3b1d('0x24')]||null:null})['then'](function(_0x3ec565){logger['info']('UpdateWhatsappInteraction',_0x4cf882);logger['debug'](_0x3b1d('0x1c'),_0x4cf882,JSON[_0x3b1d('0x15')](_0x3ec565));_0x59d250(_0x3ec565);})[_0x3b1d('0x1b')](function(_0x45e163){logger[_0x3b1d('0x16')](_0x3b1d('0x1c'),_0x45e163['message'],_0x4cf882);_0x4ad284(_0x51f220[_0x3b1d('0x16')](0x1f4,_0x45e163[_0x3b1d('0x18')]));});});};exports[_0x3b1d('0x25')]=function(_0x1f69a4){return new Promise(function(_0x154fb0,_0x4ebb19){return db['WhatsappInteraction'][_0x3b1d('0x26')]({'where':_0x1f69a4[_0x3b1d('0x20')]?_0x1f69a4[_0x3b1d('0x20')][_0x3b1d('0x22')]||null:null})['then'](function(_0x1b4bb3){if(_0x1b4bb3){return _0x1b4bb3[_0x3b1d('0x27')](_0x1f69a4['body']['ids'],_[_0x3b1d('0x28')](_0x1f69a4[_0x3b1d('0x1f')],['ids','id'])||{});}})[_0x3b1d('0x29')](function(_0x54001a){logger['info'](_0x3b1d('0x2a'),_0x1f69a4);logger['debug']('AddTags',_0x1f69a4,JSON['stringify'](_0x54001a));_0x154fb0(_0x54001a);})[_0x3b1d('0x1b')](function(_0x1b3d39){logger[_0x3b1d('0x16')](_0x3b1d('0x2a'),_0x1b3d39[_0x3b1d('0x18')],_0x1f69a4);_0x4ebb19(_this[_0x3b1d('0x16')](0x1f4,_0x1b3d39[_0x3b1d('0x18')]));});});}; \ No newline at end of file +var _0x1b39=['code','message','info','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','limit','catch','AddTagsToWhatsappInteraction','where','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b39,0x1a0));var _0x91b3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b39[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x91b3('0x0'));var util=require('util');var moment=require(_0x91b3('0x1'));var BPromise=require(_0x91b3('0x2'));var rs=require(_0x91b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91b3('0x4'))['db'];var utils=require(_0x91b3('0x5'));var logger=require(_0x91b3('0x6'))(_0x91b3('0x7'));var config=require(_0x91b3('0x8'));var jayson=require(_0x91b3('0x9'));var client=jayson[_0x91b3('0xa')][_0x91b3('0xb')]({'port':0x232a});config[_0x91b3('0xc')]=_[_0x91b3('0xd')](config[_0x91b3('0xc')],{'host':_0x91b3('0xe'),'port':0x18eb});var socket=require(_0x91b3('0xf'))(new Redis(config[_0x91b3('0xc')]));require('./whatsappInteraction.socket')[_0x91b3('0x10')](socket);function respondWithRpcPromise(_0x1680ae,_0x67955e,_0xdfb21c){return new BPromise(function(_0x27cd99,_0x27557b){return client[_0x91b3('0x11')](_0x1680ae,_0xdfb21c)[_0x91b3('0x12')](function(_0x3f38c6){logger['info'](_0x91b3('0x13'),_0x67955e,'request\x20sent');logger[_0x91b3('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x67955e,_0x91b3('0x15'),JSON[_0x91b3('0x16')](_0x3f38c6));if(_0x3f38c6[_0x91b3('0x17')]){if(_0x3f38c6[_0x91b3('0x17')][_0x91b3('0x18')]===0x1f4){logger[_0x91b3('0x17')](_0x91b3('0x13'),_0x67955e,_0x3f38c6[_0x91b3('0x17')][_0x91b3('0x19')]);return _0x27557b(_0x3f38c6['error'][_0x91b3('0x19')]);}logger['error'](_0x91b3('0x13'),_0x67955e,_0x3f38c6[_0x91b3('0x17')][_0x91b3('0x19')]);return _0x27cd99(_0x3f38c6[_0x91b3('0x17')][_0x91b3('0x19')]);}else{logger[_0x91b3('0x1a')](_0x91b3('0x13'),_0x67955e,_0x91b3('0x15'));_0x27cd99(_0x3f38c6['result'][_0x91b3('0x19')]);}})['catch'](function(_0x529ff4){logger[_0x91b3('0x17')](_0x91b3('0x13'),_0x67955e,_0x529ff4);_0x27557b(_0x529ff4);});});}exports[_0x91b3('0x1b')]=function(_0x18846c){var _0x3ab721=this;return new Promise(function(_0x1ccefe,_0x6e0bea){return db[_0x91b3('0x1c')][_0x91b3('0x1d')](_0x18846c[_0x91b3('0x1e')],{'raw':_0x18846c[_0x91b3('0x1f')]?_0x18846c[_0x91b3('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18846c[_0x91b3('0x1f')]?_0x18846c[_0x91b3('0x1f')]['where']||null:null,'attributes':_0x18846c[_0x91b3('0x1f')]?_0x18846c['options']['attributes']||null:null,'limit':_0x18846c[_0x91b3('0x1f')]?_0x18846c[_0x91b3('0x1f')][_0x91b3('0x20')]||null:null})[_0x91b3('0x12')](function(_0x56730f){logger[_0x91b3('0x1a')](_0x91b3('0x1b'),_0x18846c);logger[_0x91b3('0x14')](_0x91b3('0x1b'),_0x18846c,JSON[_0x91b3('0x16')](_0x56730f));_0x1ccefe(_0x56730f);})[_0x91b3('0x21')](function(_0x1a5305){logger['error']('UpdateWhatsappInteraction',_0x1a5305[_0x91b3('0x19')],_0x18846c);_0x6e0bea(_0x3ab721[_0x91b3('0x17')](0x1f4,_0x1a5305['message']));});});};exports[_0x91b3('0x22')]=function(_0x29d367){return new Promise(function(_0x53a5d3,_0x178f60){return db[_0x91b3('0x1c')]['find']({'where':_0x29d367['options']?_0x29d367[_0x91b3('0x1f')][_0x91b3('0x23')]||null:null})[_0x91b3('0x12')](function(_0x78efad){if(_0x78efad){return _0x78efad[_0x91b3('0x24')](_0x29d367['body'][_0x91b3('0x25')],_['omit'](_0x29d367[_0x91b3('0x1e')],['ids','id'])||{});}})[_0x91b3('0x26')](function(_0x515a3c){logger[_0x91b3('0x1a')](_0x91b3('0x27'),_0x29d367);logger[_0x91b3('0x14')](_0x91b3('0x27'),_0x29d367,JSON[_0x91b3('0x16')](_0x515a3c));_0x53a5d3(_0x515a3c);})['catch'](function(_0x184cfd){logger[_0x91b3('0x17')](_0x91b3('0x27'),_0x184cfd[_0x91b3('0x19')],_0x29d367);_0x178f60(_this['error'](0x1f4,_0x184cfd[_0x91b3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 0e8dafe..53c8944 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 _0xe54c=['./whatsappInteraction.events','remove','emit','removeListener','length','whatsappInteraction:'];(function(_0x112706,_0x205714){var _0xb9a02f=function(_0x7309af){while(--_0x7309af){_0x112706['push'](_0x112706['shift']());}};_0xb9a02f(++_0x205714);}(_0xe54c,0x90));var _0xce54=function(_0x334688,_0xf68c2c){_0x334688=_0x334688-0x0;var _0x42dc15=_0xe54c[_0x334688];return _0x42dc15;};'use strict';var WhatsappInteractionEvents=require(_0xce54('0x0'));var events=['save',_0xce54('0x1'),'update'];function createListener(_0x36bbc7,_0x165031){return function(_0xf79282){_0x165031[_0xce54('0x2')](_0x36bbc7,_0xf79282);};}function removeListener(_0x192a74,_0x33c40d){return function(){WhatsappInteractionEvents[_0xce54('0x3')](_0x192a74,_0x33c40d);};}exports['register']=function(_0x371693){for(var _0x161514=0x0,_0x8133d1=events[_0xce54('0x4')];_0x161514<_0x8133d1;_0x161514++){var _0x337d63=events[_0x161514];var _0x5a41a3=createListener(_0xce54('0x5')+_0x337d63,_0x371693);WhatsappInteractionEvents['on'](_0x337d63,_0x5a41a3);}}; \ No newline at end of file +var _0x6e3c=['emit','removeListener','register','length','whatsappInteraction:','save','remove','update'];(function(_0x4da162,_0x24acec){var _0x40ebe7=function(_0x3f300c){while(--_0x3f300c){_0x4da162['push'](_0x4da162['shift']());}};_0x40ebe7(++_0x24acec);}(_0x6e3c,0x9d));var _0xc6e3=function(_0x491001,_0x2e13ee){_0x491001=_0x491001-0x0;var _0x2971ef=_0x6e3c[_0x491001];return _0x2971ef;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xc6e3('0x0'),_0xc6e3('0x1'),_0xc6e3('0x2')];function createListener(_0x457dfc,_0x4a9524){return function(_0x31b123){_0x4a9524[_0xc6e3('0x3')](_0x457dfc,_0x31b123);};}function removeListener(_0xef70d2,_0x2244ed){return function(){WhatsappInteractionEvents[_0xc6e3('0x4')](_0xef70d2,_0x2244ed);};}exports[_0xc6e3('0x5')]=function(_0x106f3e){for(var _0x43a958=0x0,_0x4b0340=events[_0xc6e3('0x6')];_0x43a958<_0x4b0340;_0x43a958++){var _0x32548e=events[_0x43a958];var _0xc5b19a=createListener(_0xc6e3('0x7')+_0x32548e,_0x106f3e);WhatsappInteractionEvents['on'](_0x32548e,_0xc5b19a);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f090bdf..abb94f7 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 _0x7a8d=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','/:id','show','post','tracked','create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x13a077,_0x3234c8){var _0x4d0ccc=function(_0x165e2c){while(--_0x165e2c){_0x13a077['push'](_0x13a077['shift']());}};_0x4d0ccc(++_0x3234c8);}(_0x7a8d,0xe3));var _0xd7a8=function(_0x160f53,_0x19c643){_0x160f53=_0x160f53-0x0;var _0x19e938=_0x7a8d[_0x160f53];return _0x19e938;};'use strict';var multer=require(_0xd7a8('0x0'));var util=require(_0xd7a8('0x1'));var path=require(_0xd7a8('0x2'));var timeout=require(_0xd7a8('0x3'));var express=require(_0xd7a8('0x4'));var router=express['Router']();var fs_extra=require(_0xd7a8('0x5'));var auth=require(_0xd7a8('0x6'));var interaction=require(_0xd7a8('0x7'));var config=require('../../config/environment');var controller=require(_0xd7a8('0x8'));router[_0xd7a8('0x9')]('/',auth[_0xd7a8('0xa')](),controller['index']);router[_0xd7a8('0x9')](_0xd7a8('0xb'),auth[_0xd7a8('0xa')](),controller['describe']);router[_0xd7a8('0x9')](_0xd7a8('0xc'),auth['isAuthenticated'](),controller[_0xd7a8('0xd')]);router[_0xd7a8('0xe')]('/',auth[_0xd7a8('0xa')](),interaction[_0xd7a8('0xf')]('whatsapp','whatsappmessage:create'),controller[_0xd7a8('0x10')]);router[_0xd7a8('0xe')](_0xd7a8('0x11'),controller[_0xd7a8('0x12')]);router['put'](_0xd7a8('0xc'),auth[_0xd7a8('0xa')](),controller[_0xd7a8('0x13')]);router[_0xd7a8('0x14')](_0xd7a8('0x15'),auth[_0xd7a8('0xa')](),controller[_0xd7a8('0x16')]);router[_0xd7a8('0x14')](_0xd7a8('0x17'),auth['isAuthenticated'](),controller[_0xd7a8('0x18')]);router[_0xd7a8('0x19')](_0xd7a8('0xc'),auth['isAuthenticated'](),controller[_0xd7a8('0x1a')]);module[_0xd7a8('0x1b')]=router; \ No newline at end of file +var _0xdc72=['show','post','tracked','whatsapp','create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0xdc72,0xaf));var _0x2dc7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdc72[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x2dc7('0x0'));var util=require(_0x2dc7('0x1'));var path=require('path');var timeout=require(_0x2dc7('0x2'));var express=require(_0x2dc7('0x3'));var router=express[_0x2dc7('0x4')]();var fs_extra=require(_0x2dc7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2dc7('0x6'));var config=require(_0x2dc7('0x7'));var controller=require('./whatsappMessage.controller');router[_0x2dc7('0x8')]('/',auth[_0x2dc7('0x9')](),controller[_0x2dc7('0xa')]);router[_0x2dc7('0x8')](_0x2dc7('0xb'),auth[_0x2dc7('0x9')](),controller[_0x2dc7('0xc')]);router['get'](_0x2dc7('0xd'),auth[_0x2dc7('0x9')](),controller[_0x2dc7('0xe')]);router[_0x2dc7('0xf')]('/',auth[_0x2dc7('0x9')](),interaction[_0x2dc7('0x10')](_0x2dc7('0x11'),'whatsappmessage:create'),controller[_0x2dc7('0x12')]);router[_0x2dc7('0xf')](_0x2dc7('0x13'),controller[_0x2dc7('0x14')]);router[_0x2dc7('0x15')]('/:id',auth[_0x2dc7('0x9')](),controller['update']);router[_0x2dc7('0x15')](_0x2dc7('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x2dc7('0x15')](_0x2dc7('0x17'),auth['isAuthenticated'](),controller[_0x2dc7('0x18')]);router[_0x2dc7('0x19')](_0x2dc7('0xd'),auth[_0x2dc7('0x9')](),controller[_0x2dc7('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 05ae872..78a4871 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 _0xd21f=['DATE','TEXT','medium','ENUM','out','STRING'];(function(_0x126a6f,_0x390a17){var _0x3988db=function(_0x162d81){while(--_0x162d81){_0x126a6f['push'](_0x126a6f['shift']());}};_0x3988db(++_0x390a17);}(_0xd21f,0xf7));var _0xfd21=function(_0x20dd9b,_0x3c0fb8){_0x20dd9b=_0x20dd9b-0x0;var _0x2de3b0=_0xd21f[_0x20dd9b];return _0x2de3b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xfd21('0x0')](_0xfd21('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfd21('0x2')]('in',_0xfd21('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xfd21('0x4')](0xbe)},'phone':{'type':Sequelize[_0xfd21('0x4')]},'readAt':{'type':Sequelize[_0xfd21('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfd21('0x0')]}}; \ No newline at end of file +var _0x403d=['TEXT','sequelize','exports','medium','ENUM','STRING','DATE','BOOLEAN'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x403d,0x111));var _0xd403=function(_0xaba410,_0x11680e){_0xaba410=_0xaba410-0x0;var _0x10cd03=_0x403d[_0xaba410];return _0x10cd03;};'use strict';var Sequelize=require(_0xd403('0x0'));module[_0xd403('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd403('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd403('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xd403('0x4')]},'readAt':{'type':Sequelize[_0xd403('0x5')]},'secret':{'type':Sequelize[_0xd403('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd403('0x4')]},'providerResponse':{'type':Sequelize[_0xd403('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 9b94773..20ca67d 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 _0xe94b=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','then','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','WhatsappMessage','rawAttributes','type','key','name','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','merge','options','findAll','show','params','include','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','EventManager','acceptmessage','null','RejectMessage','rejectMessage','sequelize','internal','motionChannel','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x16ccc4,_0x439e40){var _0x2d3fd0=function(_0x16c8e2){while(--_0x16c8e2){_0x16ccc4['push'](_0x16ccc4['shift']());}};_0x2d3fd0(++_0x439e40);}(_0xe94b,0x7b));var _0xbe94=function(_0x9b4c4f,_0x26224a){_0x9b4c4f=_0x9b4c4f-0x0;var _0x44093f=_0xe94b[_0x9b4c4f];return _0x44093f;};'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(_0xbe94('0x0'));var moment=require(_0xbe94('0x1'));var BPromise=require(_0xbe94('0x2'));var Mustache=require(_0xbe94('0x3'));var util=require(_0xbe94('0x4'));var path=require('path');var sox=require(_0xbe94('0x5'));var csv=require(_0xbe94('0x6'));var ejs=require(_0xbe94('0x7'));var fs=require('fs');var fs_extra=require(_0xbe94('0x8'));var _=require(_0xbe94('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe94('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbe94('0x6'));var querystring=require(_0xbe94('0xb'));var Papa=require(_0xbe94('0xc'));var Redis=require(_0xbe94('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbe94('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe94('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbe94('0x10'));var db=require('../../mysqldb')['db'];config[_0xbe94('0x11')]=_['defaults'](config[_0xbe94('0x11')],{'host':_0xbe94('0x12'),'port':0x18eb});var socket=require(_0xbe94('0x13'))(new Redis(config['redis']));require(_0xbe94('0x14'))['register'](socket);var jayson=require(_0xbe94('0x15'));var client=jayson[_0xbe94('0x16')][_0xbe94('0x17')]({'port':0x232c});var client9002=jayson[_0xbe94('0x16')][_0xbe94('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x11e239,_0x42bb2e,_0x5a7f0c,_0x1fde31){return new BPromise(function(_0x786460,_0x1ceaa2){var _0x3df9be=_0x1fde31||client;return _0x3df9be['request'](_0x11e239,_0x5a7f0c)[_0xbe94('0x18')](function(_0x555ed9){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x42bb2e,'request\x20sent');logger[_0xbe94('0x19')](_0xbe94('0x1a'),_0x42bb2e,_0xbe94('0x1b'),JSON[_0xbe94('0x1c')](_0x555ed9));if(_0x555ed9[_0xbe94('0x1d')]){if(_0x555ed9['error'][_0xbe94('0x1e')]===0x1f4){logger[_0xbe94('0x1d')](_0xbe94('0x1f'),_0x42bb2e,_0x555ed9[_0xbe94('0x1d')][_0xbe94('0x20')]);return _0x1ceaa2(_0x555ed9[_0xbe94('0x1d')][_0xbe94('0x20')]);}logger[_0xbe94('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0x42bb2e,_0x555ed9[_0xbe94('0x1d')][_0xbe94('0x20')]);return _0x786460(_0x555ed9[_0xbe94('0x1d')][_0xbe94('0x20')]);}else{logger[_0xbe94('0x21')](_0xbe94('0x1f'),_0x42bb2e,_0xbe94('0x1b'));_0x786460(_0x555ed9['result']['message']);}})[_0xbe94('0x22')](function(_0x4703de){logger[_0xbe94('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0x42bb2e,_0x4703de);_0x1ceaa2(_0x4703de);});});}function respondWithStatusCode(_0x5096af,_0x3375b9){_0x3375b9=_0x3375b9||0xcc;return function(_0x36ffea){if(_0x36ffea){return _0x5096af[_0xbe94('0x23')](_0x3375b9);}return _0x5096af[_0xbe94('0x24')](_0x3375b9)[_0xbe94('0x25')]();};}function respondWithResult(_0x410744,_0x243a95){_0x243a95=_0x243a95||0xc8;return function(_0x14a674){if(_0x14a674){return _0x410744[_0xbe94('0x24')](_0x243a95)['json'](_0x14a674);}};}function respondWithFilteredResult(_0x53ce84,_0x400f3f){return function(_0x304a30){if(_0x304a30){var _0x57bad8=typeof _0x400f3f[_0xbe94('0x26')]==='undefined'&&typeof _0x400f3f[_0xbe94('0x27')]===_0xbe94('0x28');var _0x4147a2=_0x304a30[_0xbe94('0x29')];var _0x1980ad=_0x57bad8?0x0:_0x400f3f[_0xbe94('0x26')];var _0x4af947=_0x57bad8?_0x304a30[_0xbe94('0x29')]:_0x400f3f['offset']+_0x400f3f[_0xbe94('0x27')];var _0x468589;if(_0x4af947>=_0x4147a2){_0x4af947=_0x4147a2;_0x468589=0xc8;}else{_0x468589=0xce;}_0x53ce84[_0xbe94('0x24')](_0x468589);return _0x53ce84['set'](_0xbe94('0x2a'),_0x1980ad+'-'+_0x4af947+'/'+_0x4147a2)['json'](_0x304a30);}return null;};}function patchUpdates(_0x564743){return function(_0x4f9343){try{jsonpatch[_0xbe94('0x2b')](_0x4f9343,_0x564743,!![]);}catch(_0x1ef00e){return BPromise[_0xbe94('0x2c')](_0x1ef00e);}return _0x4f9343[_0xbe94('0x2d')]();};}function saveUpdates(_0x321681,_0x9aee6a){return function(_0x36d8e0){if(_0x36d8e0){return _0x36d8e0[_0xbe94('0x2e')](_0x321681)[_0xbe94('0x18')](function(_0x3962f6){return _0x3962f6;});}return null;};}function removeEntity(_0x31252a,_0x4040a4){return function(_0x136a1b){if(_0x136a1b){return _0x136a1b[_0xbe94('0x2f')]()['then'](function(){_0x31252a[_0xbe94('0x24')](0xcc)[_0xbe94('0x25')]();});}};}function handleEntityNotFound(_0x33b465,_0x17287d){return function(_0x8af77){if(!_0x8af77){_0x33b465[_0xbe94('0x23')](0x194);}return _0x8af77;};}function handleError(_0x4cbad0,_0x344d2b){_0x344d2b=_0x344d2b||0x1f4;return function(_0x474310){logger['error'](_0x474310[_0xbe94('0x30')]);if(_0x474310['name']){delete _0x474310['name'];}_0x4cbad0[_0xbe94('0x24')](_0x344d2b)[_0xbe94('0x31')](_0x474310);};}exports[_0xbe94('0x32')]=function(_0x549afb,_0x3566f6){var _0x463b58={},_0x5ab914={},_0x41da3d={'count':0x0,'rows':[]};var _0xa2d621=_[_0xbe94('0x33')](db[_0xbe94('0x34')][_0xbe94('0x35')],function(_0xc6b744){return{'name':_0xc6b744['fieldName'],'type':_0xc6b744[_0xbe94('0x36')][_0xbe94('0x37')]};});_0x5ab914['model']=_[_0xbe94('0x33')](_0xa2d621,_0xbe94('0x38'));_0x5ab914[_0xbe94('0x39')]=_[_0xbe94('0x3a')](_0x549afb[_0xbe94('0x39')]);_0x5ab914[_0xbe94('0x3b')]=_[_0xbe94('0x3c')](_0x5ab914['model'],_0x5ab914[_0xbe94('0x39')]);_0x463b58['attributes']=_[_0xbe94('0x3c')](_0x5ab914['model'],qs['fields'](_0x549afb[_0xbe94('0x39')][_0xbe94('0x3d')]));_0x463b58[_0xbe94('0x3e')]=_0x463b58['attributes'][_0xbe94('0x3f')]?_0x463b58[_0xbe94('0x3e')]:_0x5ab914[_0xbe94('0x40')];if(!_0x549afb['query'][_0xbe94('0x41')](_0xbe94('0x42'))){_0x463b58[_0xbe94('0x27')]=qs[_0xbe94('0x27')](_0x549afb[_0xbe94('0x39')]['limit']);_0x463b58[_0xbe94('0x26')]=qs[_0xbe94('0x26')](_0x549afb[_0xbe94('0x39')][_0xbe94('0x26')]);}_0x463b58[_0xbe94('0x43')]=qs[_0xbe94('0x44')](_0x549afb[_0xbe94('0x39')]['sort']);_0x463b58[_0xbe94('0x45')]=qs[_0xbe94('0x3b')](_['pick'](_0x549afb['query'],_0x5ab914['filters']),_0xa2d621);if(_0x549afb[_0xbe94('0x39')]['filter']){_0x463b58[_0xbe94('0x45')]=_[_0xbe94('0x46')](_0x463b58[_0xbe94('0x45')],{'$or':_[_0xbe94('0x33')](_0xa2d621,function(_0xf4a954){if(_0xf4a954[_0xbe94('0x36')]!=='VIRTUAL'){var _0x5f4531={};_0x5f4531[_0xf4a954[_0xbe94('0x38')]]={'$like':'%'+_0x549afb[_0xbe94('0x39')]['filter']+'%'};return _0x5f4531;}})});}_0x463b58=_[_0xbe94('0x46')]({},_0x463b58,_0x549afb[_0xbe94('0x47')]);var _0x27afb8={'where':_0x463b58[_0xbe94('0x45')]};return db['WhatsappMessage'][_0xbe94('0x29')](_0x27afb8)[_0xbe94('0x18')](function(_0x45f5f2){_0x41da3d[_0xbe94('0x29')]=_0x45f5f2;if(_0x549afb['query']['includeAll']){_0x463b58['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xbe94('0x48')](_0x463b58);})[_0xbe94('0x18')](function(_0x1b7fac){_0x41da3d['rows']=_0x1b7fac;return _0x41da3d;})[_0xbe94('0x18')](respondWithFilteredResult(_0x3566f6,_0x463b58))[_0xbe94('0x22')](handleError(_0x3566f6,null));};exports[_0xbe94('0x49')]=function(_0x31733a,_0x58b122){var _0x3ce914={'raw':!![],'where':{'id':_0x31733a[_0xbe94('0x4a')]['id']}},_0x5db58a={};_0x5db58a[_0xbe94('0x40')]=_[_0xbe94('0x3a')](db[_0xbe94('0x34')][_0xbe94('0x35')]);_0x5db58a['query']=_[_0xbe94('0x3a')](_0x31733a[_0xbe94('0x39')]);_0x5db58a[_0xbe94('0x3b')]=_['intersection'](_0x5db58a[_0xbe94('0x40')],_0x5db58a[_0xbe94('0x39')]);_0x3ce914['attributes']=_[_0xbe94('0x3c')](_0x5db58a['model'],qs[_0xbe94('0x3d')](_0x31733a[_0xbe94('0x39')][_0xbe94('0x3d')]));_0x3ce914[_0xbe94('0x3e')]=_0x3ce914[_0xbe94('0x3e')][_0xbe94('0x3f')]?_0x3ce914[_0xbe94('0x3e')]:_0x5db58a['model'];if(_0x31733a['query']['includeAll']){_0x3ce914[_0xbe94('0x4b')]=[{'all':!![]}];}_0x3ce914=_[_0xbe94('0x46')]({},_0x3ce914,_0x31733a[_0xbe94('0x47')]);return db[_0xbe94('0x34')][_0xbe94('0x4c')](_0x3ce914)[_0xbe94('0x18')](handleEntityNotFound(_0x58b122,null))[_0xbe94('0x18')](respondWithResult(_0x58b122,null))[_0xbe94('0x22')](handleError(_0x58b122,null));};exports[_0xbe94('0x4d')]=function(_0x1e58b4,_0x143ae8){return db['WhatsappMessage'][_0xbe94('0x4d')](_0x1e58b4[_0xbe94('0x4e')],{})[_0xbe94('0x18')](respondWithResult(_0x143ae8,0xc9))['catch'](handleError(_0x143ae8,null));};exports[_0xbe94('0x2e')]=function(_0x1810f0,_0x487de2){if(_0x1810f0[_0xbe94('0x4e')]['id']){delete _0x1810f0[_0xbe94('0x4e')]['id'];}return db[_0xbe94('0x34')][_0xbe94('0x4c')]({'where':{'id':_0x1810f0['params']['id']}})[_0xbe94('0x18')](handleEntityNotFound(_0x487de2,null))[_0xbe94('0x18')](saveUpdates(_0x1810f0[_0xbe94('0x4e')],null))[_0xbe94('0x18')](respondWithResult(_0x487de2,null))['catch'](handleError(_0x487de2,null));};exports[_0xbe94('0x2f')]=function(_0x3d2412,_0x170d52){return db[_0xbe94('0x34')][_0xbe94('0x4c')]({'where':{'id':_0x3d2412[_0xbe94('0x4a')]['id']}})[_0xbe94('0x18')](handleEntityNotFound(_0x170d52,null))[_0xbe94('0x18')](removeEntity(_0x170d52,null))['catch'](handleError(_0x170d52,null));};exports['describe']=function(_0x1e6e90,_0x541732){return db[_0xbe94('0x34')][_0xbe94('0x4f')]()[_0xbe94('0x18')](respondWithResult(_0x541732,null))['catch'](handleError(_0x541732,null));};var interaction_log=require(_0xbe94('0xf'))(_0xbe94('0x50'));exports[_0xbe94('0x51')]=function(_0xf68563,_0x3792ab,_0x4e496e){var _0x35ce26={'agent':{},'channel':_0xbe94('0x52')};if(_0xf68563[_0xbe94('0x4e')]['id']){delete _0xf68563[_0xbe94('0x4e')]['id'];}_0xf68563[_0xbe94('0x4e')][_0xbe94('0x53')]=!![];_0xf68563['body'][_0xbe94('0x54')]=moment()[_0xbe94('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0xf68563['body'][_0xbe94('0x56')]=_0xf68563[_0xbe94('0x4e')][_0xbe94('0x56')]||_0xf68563[_0xbe94('0x57')]['id'];_0x35ce26['agent']['id']=_0xf68563[_0xbe94('0x4e')]['UserId'];return db[_0xbe94('0x34')][_0xbe94('0x4c')]({'where':{'id':_0xf68563[_0xbe94('0x4a')]['id'],'UserId':null}})[_0xbe94('0x18')](handleEntityNotFound(_0x3792ab,null))[_0xbe94('0x18')](saveUpdates(_0xf68563['body'],null))[_0xbe94('0x18')](function(_0x4dab9c){if(_0x4dab9c){_0x35ce26['message']=_0x4dab9c['get']({'plain':!![]});return db[_0xbe94('0x58')][_0xbe94('0x4c')]({'where':{'id':_0x4dab9c[_0xbe94('0x59')]}});}return null;})[_0xbe94('0x18')](handleEntityNotFound(_0x3792ab,null))[_0xbe94('0x18')](function(_0x3597aa){if(_0x3597aa){return _0x3597aa[_0xbe94('0x2e')]({'UserId':_0xf68563[_0xbe94('0x4e')][_0xbe94('0x56')],'read1stAt':_[_0xbe94('0x5a')](_0x3597aa[_0xbe94('0x5b')])?moment()[_0xbe94('0x55')](_0xbe94('0x5c')):undefined});}return null;})[_0xbe94('0x18')](function(_0x40605f){if(_0x40605f){_0x35ce26[_0xbe94('0x5d')]=_0x40605f[_0xbe94('0x5e')]({'plain':!![]});interaction_log['info'](_0xbe94('0x5f'),_0xf68563[_0xbe94('0x57')]['id'],_0xf68563['user']['name'],_0xf68563['user'][_0xbe94('0x60')],_0x35ce26[_0xbe94('0x5d')]['id'],_0xf68563['body']?JSON[_0xbe94('0x1c')](_0xf68563['body']):'null');return respondWithRpcPromise(_0xbe94('0x61'),'acceptMessage',_0x35ce26);}return null;})['then'](function(_0x25bf2e){var _0x4c3e8b=_0xbe94('0x62')+_0x25bf2e[_0xbe94('0x20')][_0xbe94('0x63')];return db['sequelize'][_0xbe94('0x39')](_0x4c3e8b,{'type':db[_0xbe94('0x64')]['QueryTypes'][_0xbe94('0x65')],'raw':!![]})[_0xbe94('0x18')](function(_0x3f16e0){return _0x3f16e0;});})[_0xbe94('0x18')](function(_0x54c11b){if(_0x54c11b){_0x35ce26[_0xbe94('0x20')][_0xbe94('0x66')]=_0x54c11b[0x0];if(!_0xf68563[_0xbe94('0x4e')][_0xbe94('0x56')])return;return db[_0xbe94('0x67')][_0xbe94('0x4c')]({'where':{'id':_0xf68563['body'][_0xbe94('0x56')],'role':_0xbe94('0x68')},'attributes':['id',_0xbe94('0x38'),_0xbe94('0x69'),'email','internal'],'raw':!![]});}return null;})[_0xbe94('0x18')](function(_0x4f9565){if(!_0x4f9565)return null;_0x35ce26[_0xbe94('0x20')][_0xbe94('0x68')]=_0x4f9565;return _0x35ce26;})['then'](function(_0x2b7325){if(_0x2b7325){if(_0xf68563['body'][_0xbe94('0x6a')]){_0x35ce26[_0xbe94('0x20')][_0xbe94('0x6b')]=util['format'](_0xbe94('0x6c'),_0xf68563[_0xbe94('0x57')][_0xbe94('0x38')]);_0x35ce26[_0xbe94('0x20')][_0xbe94('0x6d')]=_0x35ce26[_0xbe94('0x6d')];_0x35ce26[_0xbe94('0x20')]['motionChannel']=_0x35ce26['channel'];_0x35ce26[_0xbe94('0x20')]['event']=_0xbe94('0x51');return respondWithRpcPromise(_0xbe94('0x6e'),_0xbe94('0x6e'),{'event':_0xbe94('0x6f'),'message':_0x35ce26[_0xbe94('0x20')]},client9002)[_0xbe94('0x18')](function(){return _0x35ce26;});}return _0x35ce26;}return null;})[_0xbe94('0x18')](respondWithResult(_0x3792ab,null))[_0xbe94('0x22')](handleError(_0x3792ab,null));};var interaction_log=require(_0xbe94('0xf'))(_0xbe94('0x50'));exports[_0xbe94('0x2c')]=function(_0x5ad674,_0x4042ba,_0x33f366){var _0x33a4b6={'agent':{},'channel':_0xbe94('0x52')};if(_0x5ad674[_0xbe94('0x4e')]['id']){delete _0x5ad674[_0xbe94('0x4e')]['id'];}_0x5ad674[_0xbe94('0x4e')]['UserId']=_0x5ad674[_0xbe94('0x4e')]['UserId']||_0x5ad674[_0xbe94('0x57')]['id'];_0x33a4b6[_0xbe94('0x68')]['id']=_0x5ad674[_0xbe94('0x4e')][_0xbe94('0x56')];return db[_0xbe94('0x34')][_0xbe94('0x4c')]({'where':{'id':_0x5ad674[_0xbe94('0x4a')]['id'],'UserId':null}})[_0xbe94('0x18')](handleEntityNotFound(_0x4042ba,null))[_0xbe94('0x18')](function(_0x3883cd){if(_0x3883cd){_0x33a4b6[_0xbe94('0x20')]=_0x3883cd[_0xbe94('0x5e')]({'plain':!![]});return db[_0xbe94('0x58')][_0xbe94('0x4c')]({'where':{'id':_0x3883cd['WhatsappInteractionId']}});}return null;})[_0xbe94('0x18')](handleEntityNotFound(_0x4042ba,null))[_0xbe94('0x18')](function(_0xf99256){if(_0xf99256){_0x33a4b6[_0xbe94('0x5d')]=_0xf99256[_0xbe94('0x5e')]({'plain':!![]});interaction_log[_0xbe94('0x21')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ad674[_0xbe94('0x57')]['id'],_0x5ad674[_0xbe94('0x57')]['name'],_0x5ad674[_0xbe94('0x57')]['role'],_0x33a4b6['interaction']['id'],_0x5ad674['body']?JSON[_0xbe94('0x1c')](_0x5ad674[_0xbe94('0x4e')]):_0xbe94('0x70'));return respondWithRpcPromise(_0xbe94('0x71'),_0xbe94('0x72'),_0x33a4b6);}return null;})[_0xbe94('0x18')](function(_0x24c18){var _0x5bb5a3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x24c18['message'][_0xbe94('0x63')];return db[_0xbe94('0x73')]['query'](_0x5bb5a3,{'type':db['Sequelize']['QueryTypes'][_0xbe94('0x65')],'raw':!![]})[_0xbe94('0x18')](function(_0x22ebb2){return _0x22ebb2;});})[_0xbe94('0x18')](function(_0x3fbcfa){if(_0x3fbcfa){_0x33a4b6[_0xbe94('0x20')][_0xbe94('0x66')]=_0x3fbcfa[0x0];if(!_0x5ad674[_0xbe94('0x4e')][_0xbe94('0x56')])return;return db[_0xbe94('0x67')][_0xbe94('0x4c')]({'where':{'id':_0x5ad674[_0xbe94('0x4e')][_0xbe94('0x56')],'role':_0xbe94('0x68')},'attributes':['id',_0xbe94('0x38'),_0xbe94('0x69'),'email',_0xbe94('0x74')],'raw':!![]});}return null;})[_0xbe94('0x18')](function(_0x2543e5){if(!_0x2543e5)return null;_0x33a4b6[_0xbe94('0x20')][_0xbe94('0x68')]=_0x2543e5;return _0x33a4b6;})[_0xbe94('0x18')](function(_0x35211d){if(_0x35211d){_0x35211d['message'][_0xbe94('0x6b')]=util[_0xbe94('0x55')](_0xbe94('0x6c'),_0x5ad674[_0xbe94('0x57')]['name']);_0x35211d['message'][_0xbe94('0x6d')]=_0x33a4b6[_0xbe94('0x6d')];_0x35211d[_0xbe94('0x20')][_0xbe94('0x75')]=_0x33a4b6['channel'];_0x35211d['message'][_0xbe94('0x76')]='reject';respondWithRpcPromise(_0xbe94('0x6e'),_0xbe94('0x6e'),{'event':'rejectmessage','message':_0x35211d[_0xbe94('0x20')]},client9002);return _0x33a4b6;}return null;})[_0xbe94('0x18')](respondWithResult(_0x4042ba,null))[_0xbe94('0x22')](handleError(_0x4042ba,null));};exports['status']=function(_0x2b3a48,_0x541a8e,_0x1ad18b){if(_0x2b3a48[_0xbe94('0x4e')]['id']){delete _0x2b3a48[_0xbe94('0x4e')]['id'];}var _0x552970;return db[_0xbe94('0x34')][_0xbe94('0x4c')]({'where':{'id':_0x2b3a48[_0xbe94('0x4a')]['id']}})[_0xbe94('0x18')](handleEntityNotFound(_0x541a8e,null))[_0xbe94('0x18')](function(_0x4354fe){if(_0x4354fe){_0x552970=_0x4354fe;return db[_0xbe94('0x77')][_0xbe94('0x4c')]({'where':{'id':_0x4354fe[_0xbe94('0x78')]}});}})['then'](handleEntityNotFound(_0x541a8e,null))[_0xbe94('0x18')](function(_0x160e0a){if(_0x160e0a){logger[_0xbe94('0x19')](_0xbe94('0x79'),_0xbe94('0x24'),_0xbe94('0x7a'),_0x160e0a[_0xbe94('0x36')],util[_0xbe94('0x7b')](_0x2b3a48[_0xbe94('0x4e')],{'showHidden':![],'depth':null}));switch(_0x160e0a['type']){case _0xbe94('0x7c'):if(_0x2b3a48['body'][_0xbe94('0x7d')]&&_0x2b3a48[_0xbe94('0x4e')]['MessageSid']===_0x552970[_0xbe94('0x7e')]&&_0x2b3a48[_0xbe94('0x4e')]['MessageStatus']&&_0x2b3a48[_0xbe94('0x4e')][_0xbe94('0x7f')]===_0xbe94('0x53')){return _0x552970[_0xbe94('0x2e')]({'read':!![]});}else{logger[_0xbe94('0x1d')](_0xbe94('0x80'),_0xbe94('0x24'),_0xbe94('0x7c'),util[_0xbe94('0x7b')](_0x2b3a48['body'],{'showHidden':![],'depth':null}));}break;}return _0x552970;}})[_0xbe94('0x18')](respondWithResult(_0x541a8e,null))['catch'](handleError(_0x541a8e,null));}; \ No newline at end of file +var _0x90cd=['user','agent','WhatsappInteractionId','update','isNil','read1stAt','format','interaction','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','fullname','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','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/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','client','http','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','end','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','stack','name','index','WhatsappMessage','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','show','params','options','create','body','find','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x3d8995,_0x5f4f4b){var _0x5dd8ed=function(_0x55e159){while(--_0x55e159){_0x3d8995['push'](_0x3d8995['shift']());}};_0x5dd8ed(++_0x5f4f4b);}(_0x90cd,0x1bf));var _0xd90c=function(_0x4d5455,_0x15fad5){_0x4d5455=_0x4d5455-0x0;var _0x2538e6=_0x90cd[_0x4d5455];return _0x2538e6;};'use strict';var emlformat=require(_0xd90c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd90c('0x1'));var jsonpatch=require(_0xd90c('0x2'));var rp=require('request-promise');var moment=require(_0xd90c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd90c('0x4'));var util=require(_0xd90c('0x5'));var path=require(_0xd90c('0x6'));var sox=require(_0xd90c('0x7'));var csv=require(_0xd90c('0x8'));var ejs=require(_0xd90c('0x9'));var fs=require('fs');var fs_extra=require(_0xd90c('0xa'));var _=require(_0xd90c('0xb'));var squel=require(_0xd90c('0xc'));var crypto=require(_0xd90c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd90c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd90c('0xf'));var Papa=require(_0xd90c('0x10'));var Redis=require(_0xd90c('0x11'));var authService=require(_0xd90c('0x12'));var qs=require(_0xd90c('0x13'));var as=require(_0xd90c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd90c('0x15'))(_0xd90c('0x16'));var utils=require('../../config/utils');var config=require(_0xd90c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd90c('0x18'))['db'];config[_0xd90c('0x19')]=_[_0xd90c('0x1a')](config[_0xd90c('0x19')],{'host':_0xd90c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd90c('0x19')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd90c('0x1c')][_0xd90c('0x1d')]({'port':0x232c});var client9002=jayson[_0xd90c('0x1c')][_0xd90c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x34db97,_0xfc1d17,_0x4e2a3d,_0x25a0c9){return new BPromise(function(_0x7b3121,_0xb08ea8){var _0x3a8294=_0x25a0c9||client;return _0x3a8294['request'](_0x34db97,_0x4e2a3d)['then'](function(_0x1883ef){logger[_0xd90c('0x1e')](_0xd90c('0x1f'),_0xfc1d17,'request\x20sent');logger[_0xd90c('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xfc1d17,_0xd90c('0x21'),JSON['stringify'](_0x1883ef));if(_0x1883ef[_0xd90c('0x22')]){if(_0x1883ef[_0xd90c('0x22')]['code']===0x1f4){logger[_0xd90c('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0xfc1d17,_0x1883ef[_0xd90c('0x22')][_0xd90c('0x23')]);return _0xb08ea8(_0x1883ef[_0xd90c('0x22')][_0xd90c('0x23')]);}logger[_0xd90c('0x22')](_0xd90c('0x1f'),_0xfc1d17,_0x1883ef['error']['message']);return _0x7b3121(_0x1883ef[_0xd90c('0x22')][_0xd90c('0x23')]);}else{logger[_0xd90c('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0xfc1d17,'request\x20sent');_0x7b3121(_0x1883ef[_0xd90c('0x24')][_0xd90c('0x23')]);}})[_0xd90c('0x25')](function(_0x9be5f1){logger[_0xd90c('0x22')](_0xd90c('0x1f'),_0xfc1d17,_0x9be5f1);_0xb08ea8(_0x9be5f1);});});}function respondWithStatusCode(_0x134442,_0x1ebc57){_0x1ebc57=_0x1ebc57||0xcc;return function(_0x43b863){if(_0x43b863){return _0x134442['sendStatus'](_0x1ebc57);}return _0x134442['status'](_0x1ebc57)[_0xd90c('0x26')]();};}function respondWithResult(_0x5d447f,_0x15fa3c){_0x15fa3c=_0x15fa3c||0xc8;return function(_0x48f25f){if(_0x48f25f){return _0x5d447f[_0xd90c('0x27')](_0x15fa3c)[_0xd90c('0x28')](_0x48f25f);}};}function respondWithFilteredResult(_0x7041d,_0x3456d2){return function(_0x545f22){if(_0x545f22){var _0x3957a7=typeof _0x3456d2['offset']==='undefined'&&typeof _0x3456d2['limit']===_0xd90c('0x29');var _0x4293ac=_0x545f22[_0xd90c('0x2a')];var _0x3d13af=_0x3957a7?0x0:_0x3456d2[_0xd90c('0x2b')];var _0xce3c51=_0x3957a7?_0x545f22[_0xd90c('0x2a')]:_0x3456d2[_0xd90c('0x2b')]+_0x3456d2[_0xd90c('0x2c')];var _0x7f86f7;if(_0xce3c51>=_0x4293ac){_0xce3c51=_0x4293ac;_0x7f86f7=0xc8;}else{_0x7f86f7=0xce;}_0x7041d[_0xd90c('0x27')](_0x7f86f7);return _0x7041d[_0xd90c('0x2d')]('Content-Range',_0x3d13af+'-'+_0xce3c51+'/'+_0x4293ac)[_0xd90c('0x28')](_0x545f22);}return null;};}function patchUpdates(_0x589f9c){return function(_0x4122f9){try{jsonpatch[_0xd90c('0x2e')](_0x4122f9,_0x589f9c,!![]);}catch(_0x2d6d81){return BPromise[_0xd90c('0x2f')](_0x2d6d81);}return _0x4122f9[_0xd90c('0x30')]();};}function saveUpdates(_0x3c7f2b,_0x2158a3){return function(_0x51459f){if(_0x51459f){return _0x51459f['update'](_0x3c7f2b)[_0xd90c('0x31')](function(_0xc1833f){return _0xc1833f;});}return null;};}function removeEntity(_0x5869b8,_0xbb291){return function(_0x23936e){if(_0x23936e){return _0x23936e[_0xd90c('0x32')]()[_0xd90c('0x31')](function(){_0x5869b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b433,_0x1065e7){return function(_0x398674){if(!_0x398674){_0x46b433[_0xd90c('0x33')](0x194);}return _0x398674;};}function handleError(_0x3d751f,_0x476f25){_0x476f25=_0x476f25||0x1f4;return function(_0xfcc846){logger[_0xd90c('0x22')](_0xfcc846[_0xd90c('0x34')]);if(_0xfcc846[_0xd90c('0x35')]){delete _0xfcc846[_0xd90c('0x35')];}_0x3d751f[_0xd90c('0x27')](_0x476f25)['send'](_0xfcc846);};}exports[_0xd90c('0x36')]=function(_0x64d320,_0x3a91a9){var _0x57ab16={},_0xaa58f4={},_0x3c6025={'count':0x0,'rows':[]};var _0x1b4e63=_['map'](db[_0xd90c('0x37')][_0xd90c('0x38')],function(_0x58c787){return{'name':_0x58c787[_0xd90c('0x39')],'type':_0x58c787['type'][_0xd90c('0x3a')]};});_0xaa58f4['model']=_[_0xd90c('0x3b')](_0x1b4e63,'name');_0xaa58f4['query']=_[_0xd90c('0x3c')](_0x64d320[_0xd90c('0x3d')]);_0xaa58f4[_0xd90c('0x3e')]=_[_0xd90c('0x3f')](_0xaa58f4[_0xd90c('0x40')],_0xaa58f4[_0xd90c('0x3d')]);_0x57ab16[_0xd90c('0x41')]=_[_0xd90c('0x3f')](_0xaa58f4[_0xd90c('0x40')],qs[_0xd90c('0x42')](_0x64d320[_0xd90c('0x3d')]['fields']));_0x57ab16[_0xd90c('0x41')]=_0x57ab16['attributes'][_0xd90c('0x43')]?_0x57ab16['attributes']:_0xaa58f4[_0xd90c('0x40')];if(!_0x64d320[_0xd90c('0x3d')]['hasOwnProperty'](_0xd90c('0x44'))){_0x57ab16[_0xd90c('0x2c')]=qs[_0xd90c('0x2c')](_0x64d320[_0xd90c('0x3d')]['limit']);_0x57ab16[_0xd90c('0x2b')]=qs[_0xd90c('0x2b')](_0x64d320['query']['offset']);}_0x57ab16[_0xd90c('0x45')]=qs['sort'](_0x64d320[_0xd90c('0x3d')][_0xd90c('0x46')]);_0x57ab16[_0xd90c('0x47')]=qs[_0xd90c('0x3e')](_[_0xd90c('0x48')](_0x64d320[_0xd90c('0x3d')],_0xaa58f4[_0xd90c('0x3e')]),_0x1b4e63);if(_0x64d320['query']['filter']){_0x57ab16[_0xd90c('0x47')]=_[_0xd90c('0x49')](_0x57ab16['where'],{'$or':_[_0xd90c('0x3b')](_0x1b4e63,function(_0x2f69be){if(_0x2f69be[_0xd90c('0x4a')]!=='VIRTUAL'){var _0x8b9817={};_0x8b9817[_0x2f69be[_0xd90c('0x35')]]={'$like':'%'+_0x64d320[_0xd90c('0x3d')][_0xd90c('0x4b')]+'%'};return _0x8b9817;}})});}_0x57ab16=_[_0xd90c('0x49')]({},_0x57ab16,_0x64d320['options']);var _0x34e491={'where':_0x57ab16['where']};return db[_0xd90c('0x37')][_0xd90c('0x2a')](_0x34e491)[_0xd90c('0x31')](function(_0x198040){_0x3c6025[_0xd90c('0x2a')]=_0x198040;if(_0x64d320[_0xd90c('0x3d')][_0xd90c('0x4c')]){_0x57ab16[_0xd90c('0x4d')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xd90c('0x4e')](_0x57ab16);})['then'](function(_0xbef643){_0x3c6025[_0xd90c('0x4f')]=_0xbef643;return _0x3c6025;})[_0xd90c('0x31')](respondWithFilteredResult(_0x3a91a9,_0x57ab16))[_0xd90c('0x25')](handleError(_0x3a91a9,null));};exports[_0xd90c('0x50')]=function(_0x1ec5e9,_0x29ed9a){var _0x42d97e={'raw':!![],'where':{'id':_0x1ec5e9[_0xd90c('0x51')]['id']}},_0x3a392d={};_0x3a392d['model']=_['keys'](db['WhatsappMessage'][_0xd90c('0x38')]);_0x3a392d[_0xd90c('0x3d')]=_[_0xd90c('0x3c')](_0x1ec5e9[_0xd90c('0x3d')]);_0x3a392d[_0xd90c('0x3e')]=_[_0xd90c('0x3f')](_0x3a392d['model'],_0x3a392d[_0xd90c('0x3d')]);_0x42d97e['attributes']=_[_0xd90c('0x3f')](_0x3a392d['model'],qs[_0xd90c('0x42')](_0x1ec5e9[_0xd90c('0x3d')][_0xd90c('0x42')]));_0x42d97e['attributes']=_0x42d97e[_0xd90c('0x41')][_0xd90c('0x43')]?_0x42d97e[_0xd90c('0x41')]:_0x3a392d[_0xd90c('0x40')];if(_0x1ec5e9[_0xd90c('0x3d')][_0xd90c('0x4c')]){_0x42d97e[_0xd90c('0x4d')]=[{'all':!![]}];}_0x42d97e=_[_0xd90c('0x49')]({},_0x42d97e,_0x1ec5e9[_0xd90c('0x52')]);return db[_0xd90c('0x37')]['find'](_0x42d97e)['then'](handleEntityNotFound(_0x29ed9a,null))[_0xd90c('0x31')](respondWithResult(_0x29ed9a,null))[_0xd90c('0x25')](handleError(_0x29ed9a,null));};exports['create']=function(_0x5b018b,_0x1fe0e3){return db[_0xd90c('0x37')][_0xd90c('0x53')](_0x5b018b[_0xd90c('0x54')],{})['then'](respondWithResult(_0x1fe0e3,0xc9))[_0xd90c('0x25')](handleError(_0x1fe0e3,null));};exports['update']=function(_0x35de84,_0xe73ec0){if(_0x35de84[_0xd90c('0x54')]['id']){delete _0x35de84['body']['id'];}return db[_0xd90c('0x37')][_0xd90c('0x55')]({'where':{'id':_0x35de84[_0xd90c('0x51')]['id']}})['then'](handleEntityNotFound(_0xe73ec0,null))[_0xd90c('0x31')](saveUpdates(_0x35de84['body'],null))['then'](respondWithResult(_0xe73ec0,null))[_0xd90c('0x25')](handleError(_0xe73ec0,null));};exports[_0xd90c('0x32')]=function(_0x226fa8,_0x1ae8fb){return db['WhatsappMessage'][_0xd90c('0x55')]({'where':{'id':_0x226fa8['params']['id']}})['then'](handleEntityNotFound(_0x1ae8fb,null))[_0xd90c('0x31')](removeEntity(_0x1ae8fb,null))[_0xd90c('0x25')](handleError(_0x1ae8fb,null));};exports['describe']=function(_0x3a211d,_0x434c65){return db[_0xd90c('0x37')]['describe']()[_0xd90c('0x31')](respondWithResult(_0x434c65,null))[_0xd90c('0x25')](handleError(_0x434c65,null));};var interaction_log=require(_0xd90c('0x15'))(_0xd90c('0x56'));exports[_0xd90c('0x57')]=function(_0xe552a1,_0x5c85ed,_0x1fb761){var _0x47e49a={'agent':{},'channel':_0xd90c('0x58')};if(_0xe552a1['body']['id']){delete _0xe552a1[_0xd90c('0x54')]['id'];}_0xe552a1[_0xd90c('0x54')][_0xd90c('0x59')]=!![];_0xe552a1[_0xd90c('0x54')][_0xd90c('0x5a')]=moment()['format'](_0xd90c('0x5b'));_0xe552a1[_0xd90c('0x54')][_0xd90c('0x5c')]=_0xe552a1[_0xd90c('0x54')][_0xd90c('0x5c')]||_0xe552a1[_0xd90c('0x5d')]['id'];_0x47e49a[_0xd90c('0x5e')]['id']=_0xe552a1['body'][_0xd90c('0x5c')];return db[_0xd90c('0x37')][_0xd90c('0x55')]({'where':{'id':_0xe552a1[_0xd90c('0x51')]['id'],'UserId':null}})[_0xd90c('0x31')](handleEntityNotFound(_0x5c85ed,null))[_0xd90c('0x31')](saveUpdates(_0xe552a1['body'],null))[_0xd90c('0x31')](function(_0xa91b3){if(_0xa91b3){_0x47e49a[_0xd90c('0x23')]=_0xa91b3['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0xa91b3[_0xd90c('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x5c85ed,null))['then'](function(_0x3d4c30){if(_0x3d4c30){return _0x3d4c30[_0xd90c('0x60')]({'UserId':_0xe552a1[_0xd90c('0x54')][_0xd90c('0x5c')],'read1stAt':_[_0xd90c('0x61')](_0x3d4c30[_0xd90c('0x62')])?moment()[_0xd90c('0x63')](_0xd90c('0x5b')):undefined});}return null;})[_0xd90c('0x31')](function(_0x1a26c8){if(_0x1a26c8){_0x47e49a[_0xd90c('0x64')]=_0x1a26c8['get']({'plain':!![]});interaction_log[_0xd90c('0x1e')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe552a1[_0xd90c('0x5d')]['id'],_0xe552a1[_0xd90c('0x5d')][_0xd90c('0x35')],_0xe552a1['user'][_0xd90c('0x65')],_0x47e49a[_0xd90c('0x64')]['id'],_0xe552a1[_0xd90c('0x54')]?JSON[_0xd90c('0x66')](_0xe552a1[_0xd90c('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0xd90c('0x67'),_0x47e49a);}return null;})[_0xd90c('0x31')](function(_0x2e932f){var _0x13d449=_0xd90c('0x68')+_0x2e932f[_0xd90c('0x23')][_0xd90c('0x69')];return db['sequelize']['query'](_0x13d449,{'type':db[_0xd90c('0x6a')][_0xd90c('0x6b')]['SELECT'],'raw':!![]})[_0xd90c('0x31')](function(_0x3122bd){return _0x3122bd;});})[_0xd90c('0x31')](function(_0x3f20b2){if(_0x3f20b2){_0x47e49a[_0xd90c('0x23')]['contact']=_0x3f20b2[0x0];if(!_0xe552a1[_0xd90c('0x54')][_0xd90c('0x5c')])return;return db[_0xd90c('0x6c')][_0xd90c('0x55')]({'where':{'id':_0xe552a1[_0xd90c('0x54')][_0xd90c('0x5c')],'role':_0xd90c('0x5e')},'attributes':['id',_0xd90c('0x35'),'fullname',_0xd90c('0x6d'),_0xd90c('0x6e')],'raw':!![]});}return null;})[_0xd90c('0x31')](function(_0x28ce47){if(!_0x28ce47)return null;_0x47e49a[_0xd90c('0x23')][_0xd90c('0x5e')]=_0x28ce47;return _0x47e49a;})[_0xd90c('0x31')](function(_0x419e24){if(_0x419e24){if(_0xe552a1[_0xd90c('0x54')][_0xd90c('0x6f')]){_0x47e49a['message'][_0xd90c('0x70')]=util[_0xd90c('0x63')](_0xd90c('0x71'),_0xe552a1['user'][_0xd90c('0x35')]);_0x47e49a[_0xd90c('0x23')]['channel']=_0x47e49a['channel'];_0x47e49a[_0xd90c('0x23')][_0xd90c('0x72')]=_0x47e49a[_0xd90c('0x73')];_0x47e49a[_0xd90c('0x23')]['event']=_0xd90c('0x57');return respondWithRpcPromise(_0xd90c('0x74'),_0xd90c('0x74'),{'event':_0xd90c('0x75'),'message':_0x47e49a[_0xd90c('0x23')]},client9002)[_0xd90c('0x31')](function(){return _0x47e49a;});}return _0x47e49a;}return null;})[_0xd90c('0x31')](respondWithResult(_0x5c85ed,null))[_0xd90c('0x25')](handleError(_0x5c85ed,null));};var interaction_log=require(_0xd90c('0x15'))('whatsapp-interactions');exports[_0xd90c('0x2f')]=function(_0x42108c,_0x295625,_0x10bc6e){var _0x12cb76={'agent':{},'channel':'whatsapp'};if(_0x42108c[_0xd90c('0x54')]['id']){delete _0x42108c['body']['id'];}_0x42108c['body'][_0xd90c('0x5c')]=_0x42108c['body'][_0xd90c('0x5c')]||_0x42108c[_0xd90c('0x5d')]['id'];_0x12cb76[_0xd90c('0x5e')]['id']=_0x42108c[_0xd90c('0x54')][_0xd90c('0x5c')];return db[_0xd90c('0x37')][_0xd90c('0x55')]({'where':{'id':_0x42108c[_0xd90c('0x51')]['id'],'UserId':null}})[_0xd90c('0x31')](handleEntityNotFound(_0x295625,null))['then'](function(_0x28cd51){if(_0x28cd51){_0x12cb76[_0xd90c('0x23')]=_0x28cd51['get']({'plain':!![]});return db['WhatsappInteraction'][_0xd90c('0x55')]({'where':{'id':_0x28cd51[_0xd90c('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x295625,null))[_0xd90c('0x31')](function(_0x271024){if(_0x271024){_0x12cb76[_0xd90c('0x64')]=_0x271024[_0xd90c('0x76')]({'plain':!![]});interaction_log[_0xd90c('0x1e')](_0xd90c('0x77'),_0x42108c[_0xd90c('0x5d')]['id'],_0x42108c[_0xd90c('0x5d')]['name'],_0x42108c['user'][_0xd90c('0x65')],_0x12cb76[_0xd90c('0x64')]['id'],_0x42108c[_0xd90c('0x54')]?JSON['stringify'](_0x42108c['body']):_0xd90c('0x78'));return respondWithRpcPromise(_0xd90c('0x79'),_0xd90c('0x7a'),_0x12cb76);}return null;})[_0xd90c('0x31')](function(_0x1f4da0){var _0x4a7e74=_0xd90c('0x68')+_0x1f4da0[_0xd90c('0x23')][_0xd90c('0x69')];return db[_0xd90c('0x7b')][_0xd90c('0x3d')](_0x4a7e74,{'type':db[_0xd90c('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0xd90c('0x31')](function(_0x379ee3){return _0x379ee3;});})[_0xd90c('0x31')](function(_0x3894c8){if(_0x3894c8){_0x12cb76['message']['contact']=_0x3894c8[0x0];if(!_0x42108c['body'][_0xd90c('0x5c')])return;return db[_0xd90c('0x6c')]['find']({'where':{'id':_0x42108c[_0xd90c('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0xd90c('0x35'),_0xd90c('0x7c'),_0xd90c('0x6d'),_0xd90c('0x6e')],'raw':!![]});}return null;})['then'](function(_0x56a089){if(!_0x56a089)return null;_0x12cb76['message'][_0xd90c('0x5e')]=_0x56a089;return _0x12cb76;})['then'](function(_0x456999){if(_0x456999){_0x456999['message'][_0xd90c('0x70')]=util[_0xd90c('0x63')](_0xd90c('0x71'),_0x42108c[_0xd90c('0x5d')][_0xd90c('0x35')]);_0x456999['message'][_0xd90c('0x73')]=_0x12cb76[_0xd90c('0x73')];_0x456999['message'][_0xd90c('0x72')]=_0x12cb76[_0xd90c('0x73')];_0x456999[_0xd90c('0x23')][_0xd90c('0x7d')]='reject';respondWithRpcPromise(_0xd90c('0x74'),_0xd90c('0x74'),{'event':'rejectmessage','message':_0x456999['message']},client9002);return _0x12cb76;}return null;})['then'](respondWithResult(_0x295625,null))['catch'](handleError(_0x295625,null));};exports[_0xd90c('0x27')]=function(_0x4e3b8e,_0x535832,_0x393abf){if(_0x4e3b8e[_0xd90c('0x54')]['id']){delete _0x4e3b8e[_0xd90c('0x54')]['id'];}var _0x5de8c7;return db['WhatsappMessage']['find']({'where':{'id':_0x4e3b8e[_0xd90c('0x51')]['id']}})[_0xd90c('0x31')](handleEntityNotFound(_0x535832,null))[_0xd90c('0x31')](function(_0x5b2453){if(_0x5b2453){_0x5de8c7=_0x5b2453;return db[_0xd90c('0x7e')]['find']({'where':{'id':_0x5b2453[_0xd90c('0x7f')]}});}})[_0xd90c('0x31')](handleEntityNotFound(_0x535832,null))[_0xd90c('0x31')](function(_0x3beaa4){if(_0x3beaa4){logger['debug'](_0xd90c('0x80'),_0xd90c('0x27'),'received\x20delivery\x20report\x20from',_0x3beaa4[_0xd90c('0x4a')],util[_0xd90c('0x81')](_0x4e3b8e[_0xd90c('0x54')],{'showHidden':![],'depth':null}));switch(_0x3beaa4['type']){case _0xd90c('0x82'):if(_0x4e3b8e['body'][_0xd90c('0x83')]&&_0x4e3b8e['body'][_0xd90c('0x83')]===_0x5de8c7[_0xd90c('0x84')]&&_0x4e3b8e[_0xd90c('0x54')][_0xd90c('0x85')]&&_0x4e3b8e['body'][_0xd90c('0x85')]===_0xd90c('0x59')){return _0x5de8c7[_0xd90c('0x60')]({'read':!![]});}else{logger[_0xd90c('0x22')](_0xd90c('0x86'),_0xd90c('0x27'),_0xd90c('0x82'),util['inspect'](_0x4e3b8e[_0xd90c('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x5de8c7;}})[_0xd90c('0x31')](respondWithResult(_0x535832,null))[_0xd90c('0x25')](handleError(_0x535832,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index aa4cfd5..c154847 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 _0xee4f=['setMaxListeners','save','update','emit','exports','events'];(function(_0x275472,_0x2c9de8){var _0x1490b8=function(_0x16a9a7){while(--_0x16a9a7){_0x275472['push'](_0x275472['shift']());}};_0x1490b8(++_0x2c9de8);}(_0xee4f,0xad));var _0xfee4=function(_0x55a256,_0x38602f){_0x55a256=_0x55a256-0x0;var _0x3bace2=_0xee4f[_0x55a256];return _0x3bace2;};'use strict';var EventEmitter=require(_0xfee4('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xfee4('0x1')](0x0);var events={'afterCreate':_0xfee4('0x2'),'afterUpdate':_0xfee4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37c05f){return function(_0x5b9149,_0x27874a,_0x505b55){WhatsappMessageEvents['emit'](_0x37c05f+':'+_0x5b9149['id'],_0x5b9149);WhatsappMessageEvents[_0xfee4('0x4')](_0x37c05f,_0x5b9149);_0x505b55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xfee4('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0xe706=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','save','update','remove','emit'];(function(_0x40a1e7,_0x36b9fa){var _0x8532e0=function(_0x157472){while(--_0x157472){_0x40a1e7['push'](_0x40a1e7['shift']());}};_0x8532e0(++_0x36b9fa);}(_0xe706,0xa3));var _0x6e70=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0xe706[_0x4bfade];return _0x272465;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var WhatsappMessage=require(_0x6e70('0x1'))['db'][_0x6e70('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x3'),'afterUpdate':_0x6e70('0x4'),'afterDestroy':_0x6e70('0x5')};function emitEvent(_0x7dfbc3){return function(_0x142c27,_0x2164a4,_0x376a8d){WhatsappMessageEvents[_0x6e70('0x6')](_0x7dfbc3+':'+_0x142c27['id'],_0x142c27);WhatsappMessageEvents[_0x6e70('0x6')](_0x7dfbc3,_0x142c27);_0x376a8d(null);};}for(var e in events){if(events[_0x6e70('0x7')](e)){var event=events[e];WhatsappMessage[_0x6e70('0x8')](e,emitEvent(event));}}module[_0x6e70('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 04f87d8..5b04ce8 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 _0xa5ca=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4'];(function(_0x139e6a,_0x443ab7){var _0x19c2ba=function(_0x5be05b){while(--_0x5be05b){_0x139e6a['push'](_0x139e6a['shift']());}};_0x19c2ba(++_0x443ab7);}(_0xa5ca,0x173));var _0xaa5c=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xa5ca[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var logger=require(_0xaa5c('0x2'))(_0xaa5c('0x3'));var moment=require(_0xaa5c('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa5c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa5c('0x6'));var config=require('../../config/environment');var attributes=require(_0xaa5c('0x7'));module[_0xaa5c('0x8')]=function(_0x8f352e,_0x5dc042){return _0x8f352e[_0xaa5c('0x9')](_0xaa5c('0xa'),attributes,{'tableName':_0xaa5c('0xb'),'paranoid':![],'indexes':[{'name':_0xaa5c('0xc'),'fields':['messageId']},{'name':_0xaa5c('0xd'),'fields':[_0xaa5c('0xe')],'type':_0xaa5c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b4415,_0x237502,_0x45adbe){var _0x6df29c=_0x8f352e[_0xaa5c('0x10')];var _0x396873=_0x2b4415[_0xaa5c('0x11')]({'plain':!![]});if(_0x396873[_0xaa5c('0x12')][_0xaa5c('0x13')]()==='in'||_0x396873['direction']['toLowerCase']()===_0xaa5c('0x14')&&!_0x396873[_0xaa5c('0x15')]&&!_[_0xaa5c('0x16')](_0x396873[_0xaa5c('0x17')])){_0x6df29c[_0xaa5c('0x18')][_0xaa5c('0x19')]({'where':{'id':_0x396873[_0xaa5c('0x1a')]}})['then'](function(_0x42c07f){if(_0x42c07f){_0x42c07f[_0xaa5c('0x1b')]({'lastMsgAt':_0x396873[_0xaa5c('0x1c')],'lastMsgDirection':_0x396873[_0xaa5c('0x12')][_0xaa5c('0x13')]()});}})[_0xaa5c('0x1d')](function(_0x1bd0cf){console[_0xaa5c('0x1e')](_0x1bd0cf);});}if(_0x396873[_0xaa5c('0x12')]===_0xaa5c('0x14')&&!_0x396873[_0xaa5c('0x15')]){var _0x2275e9;_0x6df29c[_0xaa5c('0x1f')][_0xaa5c('0x20')]({'where':{'id':_0x396873[_0xaa5c('0x21')]},'raw':!![]})[_0xaa5c('0x22')](function(_0x5ea26a){_0x2275e9=_0x5ea26a;if(_0x2275e9&&_0x2275e9[_0xaa5c('0x23')]){switch(_0x2275e9[_0xaa5c('0x23')]){case'twilio':var _0x436b65=require(_0xaa5c('0x24'));if(_0x2275e9[_0xaa5c('0x25')]&&_0x2275e9[_0xaa5c('0x26')]&&_0x2275e9['phone']){var _0x38401d=new _0x436b65(_0x2275e9['accountSid'],_0x2275e9[_0xaa5c('0x26')]);_0x38401d[_0xaa5c('0x27')][_0xaa5c('0x28')]({'body':_0x396873['body'],'to':_0xaa5c('0x29')+_0x396873[_0xaa5c('0x2a')],'from':_0xaa5c('0x29')+_0x2275e9['phone'],'statusCallback':_0x2275e9[_0xaa5c('0x2b')]+_0xaa5c('0x2c')+_0x396873['id']+_0xaa5c('0x2d')+_0x2275e9[_0xaa5c('0x2e')]})[_0xaa5c('0x22')](function(_0x499c70){if(_0x499c70['sid']){return _0x2b4415[_0xaa5c('0x1b')]({'messageId':_0x499c70[_0xaa5c('0x2f')]});}})[_0xaa5c('0x1d')](function(_0x583060){logger[_0xaa5c('0x1e')](_0xaa5c('0x30'),_0xaa5c('0x31'),_0xaa5c('0x24'),util['inspect'](_0x583060,{'showHidden':![],'depth':null}));});}else{logger[_0xaa5c('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xaa5c('0x31'),_0xaa5c('0x24'),_0xaa5c('0x32'));}break;}}})[_0xaa5c('0x33')](function(){_0x45adbe();});}else{_0x45adbe();}}},'charset':_0xaa5c('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x682e=['phone','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','toLowerCase','direction','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','WhatsappAccountId','type','authToken','accountSid','messages','create','whatsapp:'];(function(_0x3e3012,_0x46fe06){var _0x5dfc61=function(_0x4737b8){while(--_0x4737b8){_0x3e3012['push'](_0x3e3012['shift']());}};_0x5dfc61(++_0x46fe06);}(_0x682e,0x1ce));var _0xe682=function(_0xfec893,_0x1fb335){_0xfec893=_0xfec893-0x0;var _0x22a809=_0x682e[_0xfec893];return _0x22a809;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));var moment=require(_0xe682('0x4'));var BPromise=require(_0xe682('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe682('0x6'));var rimraf=require(_0xe682('0x7'));var config=require(_0xe682('0x8'));var attributes=require(_0xe682('0x9'));module[_0xe682('0xa')]=function(_0x51e786,_0x3b4c98){return _0x51e786[_0xe682('0xb')](_0xe682('0xc'),attributes,{'tableName':_0xe682('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe682('0xe')]},{'name':_0xe682('0xf'),'fields':[_0xe682('0x10')],'type':_0xe682('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd3143e,_0x2f7213,_0x5acc03){var _0x152b9f=_0x51e786['models'];var _0x111bc8=_0xd3143e['get']({'plain':!![]});if(_0x111bc8['direction'][_0xe682('0x12')]()==='in'||_0x111bc8[_0xe682('0x13')][_0xe682('0x12')]()===_0xe682('0x14')&&!_0x111bc8[_0xe682('0x15')]&&!_[_0xe682('0x16')](_0x111bc8['UserId'])){_0x152b9f[_0xe682('0x17')][_0xe682('0x18')]({'where':{'id':_0x111bc8[_0xe682('0x19')]}})[_0xe682('0x1a')](function(_0x29ec5a){if(_0x29ec5a){_0x29ec5a[_0xe682('0x1b')]({'lastMsgAt':_0x111bc8[_0xe682('0x1c')],'lastMsgDirection':_0x111bc8[_0xe682('0x13')]['toLowerCase']()});}})[_0xe682('0x1d')](function(_0x5e29bd){console['error'](_0x5e29bd);});}if(_0x111bc8['direction']===_0xe682('0x14')&&!_0x111bc8[_0xe682('0x15')]){var _0xeae968;_0x152b9f[_0xe682('0x1e')]['find']({'where':{'id':_0x111bc8[_0xe682('0x1f')]},'raw':!![]})['then'](function(_0x2dcfdd){_0xeae968=_0x2dcfdd;if(_0xeae968&&_0xeae968['type']){switch(_0xeae968[_0xe682('0x20')]){case'twilio':var _0x31d8e4=require('twilio');if(_0xeae968['accountSid']&&_0xeae968[_0xe682('0x21')]&&_0xeae968['phone']){var _0x36c7e0=new _0x31d8e4(_0xeae968[_0xe682('0x22')],_0xeae968[_0xe682('0x21')]);_0x36c7e0[_0xe682('0x23')][_0xe682('0x24')]({'body':_0x111bc8[_0xe682('0x10')],'to':_0xe682('0x25')+_0x111bc8[_0xe682('0x26')],'from':_0xe682('0x25')+_0xeae968[_0xe682('0x26')],'statusCallback':_0xeae968[_0xe682('0x27')]+_0xe682('0x28')+_0x111bc8['id']+_0xe682('0x29')+_0xeae968['token']})['then'](function(_0x56fcdb){if(_0x56fcdb[_0xe682('0x2a')]){return _0xd3143e[_0xe682('0x1b')]({'messageId':_0x56fcdb['sid']});}})[_0xe682('0x1d')](function(_0x4a3835){logger['error'](_0xe682('0x2b'),_0xe682('0x2c'),_0xe682('0x2d'),util[_0xe682('0x2e')](_0x4a3835,{'showHidden':![],'depth':null}));});}else{logger[_0xe682('0x2f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0xe682('0x30'));}break;}}})['finally'](function(){_0x5acc03();});}else{_0x5acc03();}}},'charset':'utf8mb4','collate':_0xe682('0x31')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 0a41e28..db45a9c 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 _0x72e5=['create','body','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappMessage'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x72e5,0x19c));var _0x572e=function(_0x2e5d9e,_0x5c40bf){_0x2e5d9e=_0x2e5d9e-0x0;var _0x1d4d0c=_0x72e5[_0x2e5d9e];return _0x1d4d0c;};'use strict';var _=require('lodash');var util=require(_0x572e('0x0'));var moment=require(_0x572e('0x1'));var BPromise=require(_0x572e('0x2'));var rs=require(_0x572e('0x3'));var fs=require('fs');var Redis=require(_0x572e('0x4'));var db=require(_0x572e('0x5'))['db'];var utils=require(_0x572e('0x6'));var logger=require(_0x572e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x572e('0x8'));var client=jayson[_0x572e('0x9')][_0x572e('0xa')]({'port':0x232a});config[_0x572e('0xb')]=_['defaults'](config[_0x572e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x572e('0xb')]));require(_0x572e('0xc'))['register'](socket);function respondWithRpcPromise(_0x229d7a,_0x26ec95,_0x4c25f8){return new BPromise(function(_0x3e38ab,_0x1fd7cb){return client[_0x572e('0xd')](_0x229d7a,_0x4c25f8)['then'](function(_0x1ebf67){logger[_0x572e('0xe')](_0x572e('0xf'),_0x26ec95,_0x572e('0x10'));logger['debug'](_0x572e('0x11'),_0x26ec95,_0x572e('0x10'),JSON[_0x572e('0x12')](_0x1ebf67));if(_0x1ebf67[_0x572e('0x13')]){if(_0x1ebf67[_0x572e('0x13')]['code']===0x1f4){logger[_0x572e('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x26ec95,_0x1ebf67[_0x572e('0x13')]['message']);return _0x1fd7cb(_0x1ebf67[_0x572e('0x13')]['message']);}logger[_0x572e('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x26ec95,_0x1ebf67[_0x572e('0x13')][_0x572e('0x14')]);return _0x3e38ab(_0x1ebf67[_0x572e('0x13')]['message']);}else{logger[_0x572e('0xe')](_0x572e('0xf'),_0x26ec95,_0x572e('0x10'));_0x3e38ab(_0x1ebf67['result'][_0x572e('0x14')]);}})[_0x572e('0x15')](function(_0x4e8551){logger[_0x572e('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x26ec95,_0x4e8551);_0x1fd7cb(_0x4e8551);});});}exports[_0x572e('0x16')]=function(_0x557f88){var _0x3ce4af=this;return new Promise(function(_0x3a0ca6,_0xab49a7){return db['WhatsappMessage'][_0x572e('0x17')](_0x557f88[_0x572e('0x18')],{'raw':_0x557f88['options']?_0x557f88[_0x572e('0x19')][_0x572e('0x1a')]===undefined?!![]:![]:!![]})[_0x572e('0x1b')](function(_0x1b5a4f){logger['info']('CreateWhatsappMessage',_0x557f88);logger[_0x572e('0x1c')]('CreateWhatsappMessage',_0x557f88,JSON['stringify'](_0x1b5a4f));_0x3a0ca6(_0x1b5a4f);})['catch'](function(_0x2f2e2e){logger['error'](_0x572e('0x16'),_0x2f2e2e[_0x572e('0x14')],_0x557f88);_0xab49a7(_0x3ce4af[_0x572e('0x13')](0x1f4,_0x2f2e2e[_0x572e('0x14')]));});});}; \ No newline at end of file +var _0x38c4=['WhatsappMessage','create','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4a46ca,_0x2fce09){var _0x28336e=function(_0x322ce5){while(--_0x322ce5){_0x4a46ca['push'](_0x4a46ca['shift']());}};_0x28336e(++_0x2fce09);}(_0x38c4,0xcb));var _0x438c=function(_0x5211d2,_0x724eae){_0x5211d2=_0x5211d2-0x0;var _0x26fdbb=_0x38c4[_0x5211d2];return _0x26fdbb;};'use strict';var _=require(_0x438c('0x0'));var util=require(_0x438c('0x1'));var moment=require(_0x438c('0x2'));var BPromise=require(_0x438c('0x3'));var rs=require(_0x438c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x438c('0x5'))['db'];var utils=require(_0x438c('0x6'));var logger=require(_0x438c('0x7'))(_0x438c('0x8'));var config=require('../../config/environment');var jayson=require(_0x438c('0x9'));var client=jayson[_0x438c('0xa')][_0x438c('0xb')]({'port':0x232a});config[_0x438c('0xc')]=_[_0x438c('0xd')](config[_0x438c('0xc')],{'host':_0x438c('0xe'),'port':0x18eb});var socket=require(_0x438c('0xf'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x438c('0x10')](socket);function respondWithRpcPromise(_0x48bb82,_0x3ad8fe,_0x4e3b5a){return new BPromise(function(_0x371570,_0x275b3d){return client[_0x438c('0x11')](_0x48bb82,_0x4e3b5a)[_0x438c('0x12')](function(_0x4f1038){logger[_0x438c('0x13')](_0x438c('0x14'),_0x3ad8fe,_0x438c('0x15'));logger[_0x438c('0x16')](_0x438c('0x17'),_0x3ad8fe,_0x438c('0x15'),JSON['stringify'](_0x4f1038));if(_0x4f1038[_0x438c('0x18')]){if(_0x4f1038['error'][_0x438c('0x19')]===0x1f4){logger[_0x438c('0x18')](_0x438c('0x14'),_0x3ad8fe,_0x4f1038[_0x438c('0x18')]['message']);return _0x275b3d(_0x4f1038[_0x438c('0x18')][_0x438c('0x1a')]);}logger[_0x438c('0x18')](_0x438c('0x14'),_0x3ad8fe,_0x4f1038[_0x438c('0x18')][_0x438c('0x1a')]);return _0x371570(_0x4f1038[_0x438c('0x18')][_0x438c('0x1a')]);}else{logger['info'](_0x438c('0x14'),_0x3ad8fe,_0x438c('0x15'));_0x371570(_0x4f1038[_0x438c('0x1b')]['message']);}})['catch'](function(_0x38b9ec){logger[_0x438c('0x18')](_0x438c('0x14'),_0x3ad8fe,_0x38b9ec);_0x275b3d(_0x38b9ec);});});}exports['CreateWhatsappMessage']=function(_0x1714ef){var _0x960b6=this;return new Promise(function(_0x2a2e26,_0x743f9d){return db[_0x438c('0x1c')][_0x438c('0x1d')](_0x1714ef['body'],{'raw':_0x1714ef[_0x438c('0x1e')]?_0x1714ef[_0x438c('0x1e')][_0x438c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1d8895){logger[_0x438c('0x13')](_0x438c('0x20'),_0x1714ef);logger[_0x438c('0x16')](_0x438c('0x20'),_0x1714ef,JSON['stringify'](_0x1d8895));_0x2a2e26(_0x1d8895);})['catch'](function(_0x2dac89){logger[_0x438c('0x18')](_0x438c('0x20'),_0x2dac89[_0x438c('0x1a')],_0x1714ef);_0x743f9d(_0x960b6[_0x438c('0x18')](0x1f4,_0x2dac89[_0x438c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 21285eb..9d35cad 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 _0x811f=['register','save','remove','emit','removeListener'];(function(_0x1767ab,_0x1df0ec){var _0x5e718d=function(_0x518788){while(--_0x518788){_0x1767ab['push'](_0x1767ab['shift']());}};_0x5e718d(++_0x1df0ec);}(_0x811f,0x18c));var _0xf811=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x811f[_0x2a8c21];return _0x5f3061;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xf811('0x0'),_0xf811('0x1'),'update'];function createListener(_0x25b312,_0x49df9c){return function(_0x39c5fc){_0x49df9c[_0xf811('0x2')](_0x25b312,_0x39c5fc);};}function removeListener(_0xfabecc,_0x921931){return function(){WhatsappMessageEvents[_0xf811('0x3')](_0xfabecc,_0x921931);};}exports[_0xf811('0x4')]=function(_0x5dfc14){for(var _0x4c5fd4=0x0,_0x198011=events['length'];_0x4c5fd4<_0x198011;_0x4c5fd4++){var _0x3f31ba=events[_0x4c5fd4];var _0x4a9fb1=createListener('whatsappMessage:'+_0x3f31ba,_0x5dfc14);WhatsappMessageEvents['on'](_0x3f31ba,_0x4a9fb1);}}; \ No newline at end of file +var _0x3267=['save','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x177a36,_0x37eb0b){var _0x3f6fb5=function(_0x5e768a){while(--_0x5e768a){_0x177a36['push'](_0x177a36['shift']());}};_0x3f6fb5(++_0x37eb0b);}(_0x3267,0x93));var _0x7326=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x3267[_0x764874];return _0x29f9d5;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x7326('0x0'),'remove',_0x7326('0x1')];function createListener(_0x8d1aea,_0x57584b){return function(_0x148fbb){_0x57584b[_0x7326('0x2')](_0x8d1aea,_0x148fbb);};}function removeListener(_0x5920e2,_0x535558){return function(){WhatsappMessageEvents[_0x7326('0x3')](_0x5920e2,_0x535558);};}exports[_0x7326('0x4')]=function(_0x19686e){for(var _0x32f856=0x0,_0x2d928b=events[_0x7326('0x5')];_0x32f856<_0x2d928b;_0x32f856++){var _0x40db0f=events[_0x32f856];var _0x3d808f=createListener(_0x7326('0x6')+_0x40db0f,_0x19686e);WhatsappMessageEvents['on'](_0x40db0f,_0x3d808f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d948854..a09d184 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 _0xc17c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','/:id','removeTeams','removeAgents','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x177dc7,_0x13501c){var _0x19b7dc=function(_0x1b1437){while(--_0x1b1437){_0x177dc7['push'](_0x177dc7['shift']());}};_0x19b7dc(++_0x13501c);}(_0xc17c,0x1f3));var _0xcc17=function(_0x41a26d,_0x162816){_0x41a26d=_0x41a26d-0x0;var _0x285b67=_0xc17c[_0x41a26d];return _0x285b67;};'use strict';var multer=require('multer');var util=require(_0xcc17('0x0'));var path=require(_0xcc17('0x1'));var timeout=require(_0xcc17('0x2'));var express=require('express');var router=express[_0xcc17('0x3')]();var fs_extra=require(_0xcc17('0x4'));var auth=require(_0xcc17('0x5'));var interaction=require(_0xcc17('0x6'));var config=require(_0xcc17('0x7'));var controller=require(_0xcc17('0x8'));router[_0xcc17('0x9')]('/',auth[_0xcc17('0xa')](),controller[_0xcc17('0xb')]);router[_0xcc17('0x9')]('/describe',auth[_0xcc17('0xa')](),controller[_0xcc17('0xc')]);router[_0xcc17('0x9')]('/:id',auth[_0xcc17('0xa')](),controller[_0xcc17('0xd')]);router[_0xcc17('0x9')]('/:id/members',auth[_0xcc17('0xa')](),controller[_0xcc17('0xe')]);router[_0xcc17('0x9')](_0xcc17('0xf'),auth[_0xcc17('0xa')](),controller[_0xcc17('0x10')]);router['get'](_0xcc17('0x11'),auth[_0xcc17('0xa')](),controller[_0xcc17('0x12')]);router[_0xcc17('0x13')]('/',auth[_0xcc17('0xa')](),controller['create']);router[_0xcc17('0x13')](_0xcc17('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0xcc17('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xcc17('0x14')]);router[_0xcc17('0x15')]('/:id',auth[_0xcc17('0xa')](),controller[_0xcc17('0x16')]);router[_0xcc17('0x17')](_0xcc17('0x18'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xcc17('0xf'),auth[_0xcc17('0xa')](),controller[_0xcc17('0x19')]);router[_0xcc17('0x17')](_0xcc17('0x11'),auth[_0xcc17('0xa')](),controller[_0xcc17('0x1a')]);module[_0xcc17('0x1b')]=router; \ No newline at end of file +var _0x86c0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','exports','multer','util'];(function(_0xb5ac37,_0x2a24ad){var _0x4c5b39=function(_0x110b47){while(--_0x110b47){_0xb5ac37['push'](_0xb5ac37['shift']());}};_0x4c5b39(++_0x2a24ad);}(_0x86c0,0x8a));var _0x086c=function(_0x2d905,_0x505ae4){_0x2d905=_0x2d905-0x0;var _0xc4cc9c=_0x86c0[_0x2d905];return _0xc4cc9c;};'use strict';var multer=require(_0x086c('0x0'));var util=require(_0x086c('0x1'));var path=require(_0x086c('0x2'));var timeout=require(_0x086c('0x3'));var express=require(_0x086c('0x4'));var router=express[_0x086c('0x5')]();var fs_extra=require(_0x086c('0x6'));var auth=require(_0x086c('0x7'));var interaction=require(_0x086c('0x8'));var config=require(_0x086c('0x9'));var controller=require(_0x086c('0xa'));router[_0x086c('0xb')]('/',auth[_0x086c('0xc')](),controller['index']);router['get']('/describe',auth[_0x086c('0xc')](),controller[_0x086c('0xd')]);router[_0x086c('0xb')](_0x086c('0xe'),auth[_0x086c('0xc')](),controller['show']);router['get'](_0x086c('0xf'),auth[_0x086c('0xc')](),controller['getMembers']);router['get'](_0x086c('0x10'),auth[_0x086c('0xc')](),controller[_0x086c('0x11')]);router[_0x086c('0xb')](_0x086c('0x12'),auth[_0x086c('0xc')](),controller[_0x086c('0x13')]);router[_0x086c('0x14')]('/',auth[_0x086c('0xc')](),controller[_0x086c('0x15')]);router[_0x086c('0x14')](_0x086c('0x10'),auth[_0x086c('0xc')](),controller[_0x086c('0x16')]);router[_0x086c('0x14')](_0x086c('0x12'),auth[_0x086c('0xc')](),controller[_0x086c('0x17')]);router[_0x086c('0x18')](_0x086c('0xe'),auth[_0x086c('0xc')](),controller['update']);router['delete'](_0x086c('0xe'),auth[_0x086c('0xc')](),controller[_0x086c('0x19')]);router[_0x086c('0x1a')](_0x086c('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x086c('0x12'),auth[_0x086c('0xc')](),controller['removeAgents']);module[_0x086c('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 34e3460..1ba9c81 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 _0x9234=['INTEGER','ENUM','beepall','roundrobin','sequelize','STRING','name'];(function(_0x3e618e,_0x4d8239){var _0x5300f1=function(_0x22c5b5){while(--_0x22c5b5){_0x3e618e['push'](_0x3e618e['shift']());}};_0x5300f1(++_0x4d8239);}(_0x9234,0x1bd));var _0x4923=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0x9234[_0x39d39d];return _0x577ac3;};'use strict';var Sequelize=require(_0x4923('0x0'));module['exports']={'name':{'type':Sequelize[_0x4923('0x1')],'unique':_0x4923('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4923('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4923('0x4')]('rrmemory',_0x4923('0x5'),_0x4923('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c4a=['STRING','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x487bd7,_0xb42654){_0x487bd7=_0x487bd7-0x0;var _0x38bac3=_0x5c4a[_0x487bd7];return _0x38bac3;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa5c4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa5c4('0x3')]('rrmemory',_0xa5c4('0x4'),_0xa5c4('0x5'))},'description':{'type':Sequelize[_0xa5c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 72b8e7f..62164d8 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 _0xf489=['getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','includes','value','addAgents','spread','removeAgents','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','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','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','WhatsappQueue','includeAll','include','findAll','show','params','keys','catch','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','UserWhatsappQueue','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','createdAt'];(function(_0x4108e9,_0x58da63){var _0x369cc4=function(_0x527bfd){while(--_0x527bfd){_0x4108e9['push'](_0x4108e9['shift']());}};_0x369cc4(++_0x58da63);}(_0xf489,0xac));var _0x9f48=function(_0x2e48f7,_0x548db1){_0x2e48f7=_0x2e48f7-0x0;var _0x33525c=_0xf489[_0x2e48f7];return _0x33525c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f48('0x0'));var zipdir=require(_0x9f48('0x1'));var jsonpatch=require(_0x9f48('0x2'));var rp=require(_0x9f48('0x3'));var moment=require(_0x9f48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f48('0x5'));var util=require(_0x9f48('0x6'));var path=require(_0x9f48('0x7'));var sox=require(_0x9f48('0x8'));var csv=require(_0x9f48('0x9'));var ejs=require(_0x9f48('0xa'));var fs=require('fs');var fs_extra=require(_0x9f48('0xb'));var _=require(_0x9f48('0xc'));var squel=require(_0x9f48('0xd'));var crypto=require(_0x9f48('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f48('0x9'));var querystring=require(_0x9f48('0xf'));var Papa=require(_0x9f48('0x10'));var Redis=require(_0x9f48('0x11'));var authService=require(_0x9f48('0x12'));var qs=require(_0x9f48('0x13'));var as=require(_0x9f48('0x14'));var hardwareService=require(_0x9f48('0x15'));var logger=require(_0x9f48('0x16'))(_0x9f48('0x17'));var utils=require(_0x9f48('0x18'));var config=require(_0x9f48('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f48('0x1a'))['db'];config['redis']=_[_0x9f48('0x1b')](config[_0x9f48('0x1c')],{'host':_0x9f48('0x1d'),'port':0x18eb});var socket=require(_0x9f48('0x1e'))(new Redis(config['redis']));require(_0x9f48('0x1f'))[_0x9f48('0x20')](socket);function respondWithStatusCode(_0x962f1b,_0x4c4561){_0x4c4561=_0x4c4561||0xcc;return function(_0x46394b){if(_0x46394b){return _0x962f1b['sendStatus'](_0x4c4561);}return _0x962f1b[_0x9f48('0x21')](_0x4c4561)[_0x9f48('0x22')]();};}function respondWithResult(_0x249ad2,_0x1ba594){_0x1ba594=_0x1ba594||0xc8;return function(_0x4e537a){if(_0x4e537a){return _0x249ad2[_0x9f48('0x21')](_0x1ba594)[_0x9f48('0x23')](_0x4e537a);}};}function respondWithFilteredResult(_0xf665f8,_0x1ccbc1){return function(_0x4bdb3e){if(_0x4bdb3e){var _0x99de68=typeof _0x1ccbc1['offset']===_0x9f48('0x24')&&typeof _0x1ccbc1[_0x9f48('0x25')]==='undefined';var _0xfceaab=_0x4bdb3e['count'];var _0x39ee7e=_0x99de68?0x0:_0x1ccbc1['offset'];var _0x3c1001=_0x99de68?_0x4bdb3e[_0x9f48('0x26')]:_0x1ccbc1[_0x9f48('0x27')]+_0x1ccbc1['limit'];var _0x1626aa;if(_0x3c1001>=_0xfceaab){_0x3c1001=_0xfceaab;_0x1626aa=0xc8;}else{_0x1626aa=0xce;}_0xf665f8['status'](_0x1626aa);return _0xf665f8[_0x9f48('0x28')](_0x9f48('0x29'),_0x39ee7e+'-'+_0x3c1001+'/'+_0xfceaab)[_0x9f48('0x23')](_0x4bdb3e);}return null;};}function patchUpdates(_0x55ae07){return function(_0x501035){try{jsonpatch['apply'](_0x501035,_0x55ae07,!![]);}catch(_0x268626){return BPromise[_0x9f48('0x2a')](_0x268626);}return _0x501035['save']();};}function saveUpdates(_0x1bde5f,_0x36bc22){return function(_0x333aa3){if(_0x333aa3){return _0x333aa3[_0x9f48('0x2b')](_0x1bde5f)['then'](function(_0x27ba99){return _0x27ba99;});}return null;};}function removeEntity(_0x1b72a4,_0x2d2105){return function(_0x38716f){if(_0x38716f){return _0x38716f[_0x9f48('0x2c')]()[_0x9f48('0x2d')](function(){var _0xbb423b=_0x38716f[_0x9f48('0x2e')]({'plain':!![]});var _0x26d635='WhatsappQueues';return db[_0x9f48('0x2f')][_0x9f48('0x2c')]({'where':{'type':_0x26d635,'resourceId':_0xbb423b['id']}})[_0x9f48('0x2d')](function(){return _0x38716f;});})['then'](function(){_0x1b72a4[_0x9f48('0x21')](0xcc)[_0x9f48('0x22')]();});}};}function handleEntityNotFound(_0x2ad013,_0x526f74){return function(_0xa7b229){if(!_0xa7b229){_0x2ad013[_0x9f48('0x30')](0x194);}return _0xa7b229;};}function handleError(_0x53c6c5,_0x51260d){_0x51260d=_0x51260d||0x1f4;return function(_0x3135bc){logger[_0x9f48('0x31')](_0x3135bc[_0x9f48('0x32')]);if(_0x3135bc[_0x9f48('0x33')]){delete _0x3135bc[_0x9f48('0x33')];}_0x53c6c5[_0x9f48('0x21')](_0x51260d)['send'](_0x3135bc);};}exports[_0x9f48('0x34')]=function(_0x185f61,_0x5b0e74){var _0x303315={},_0x311bd8={},_0x1671f2={'count':0x0,'rows':[]};var _0x24f42e=_[_0x9f48('0x35')](db['WhatsappQueue'][_0x9f48('0x36')],function(_0x55c363){return{'name':_0x55c363[_0x9f48('0x37')],'type':_0x55c363[_0x9f48('0x38')]['key']};});_0x311bd8[_0x9f48('0x39')]=_['map'](_0x24f42e,_0x9f48('0x33'));_0x311bd8[_0x9f48('0x3a')]=_['keys'](_0x185f61[_0x9f48('0x3a')]);_0x311bd8[_0x9f48('0x3b')]=_[_0x9f48('0x3c')](_0x311bd8[_0x9f48('0x39')],_0x311bd8[_0x9f48('0x3a')]);_0x303315['attributes']=_[_0x9f48('0x3c')](_0x311bd8[_0x9f48('0x39')],qs[_0x9f48('0x3d')](_0x185f61[_0x9f48('0x3a')][_0x9f48('0x3d')]));_0x303315['attributes']=_0x303315['attributes'][_0x9f48('0x3e')]?_0x303315[_0x9f48('0x3f')]:_0x311bd8[_0x9f48('0x39')];if(!_0x185f61[_0x9f48('0x3a')][_0x9f48('0x40')](_0x9f48('0x41'))){_0x303315[_0x9f48('0x25')]=qs[_0x9f48('0x25')](_0x185f61[_0x9f48('0x3a')][_0x9f48('0x25')]);_0x303315['offset']=qs[_0x9f48('0x27')](_0x185f61[_0x9f48('0x3a')][_0x9f48('0x27')]);}_0x303315[_0x9f48('0x42')]=qs[_0x9f48('0x43')](_0x185f61['query'][_0x9f48('0x43')]);_0x303315[_0x9f48('0x44')]=qs[_0x9f48('0x3b')](_['pick'](_0x185f61[_0x9f48('0x3a')],_0x311bd8[_0x9f48('0x3b')]),_0x24f42e);if(_0x185f61['query'][_0x9f48('0x45')]){_0x303315['where']=_[_0x9f48('0x46')](_0x303315[_0x9f48('0x44')],{'$or':_[_0x9f48('0x35')](_0x24f42e,function(_0x4604e9){if(_0x4604e9['type']!=='VIRTUAL'){var _0x5360e1={};_0x5360e1[_0x4604e9[_0x9f48('0x33')]]={'$like':'%'+_0x185f61[_0x9f48('0x3a')][_0x9f48('0x45')]+'%'};return _0x5360e1;}})});}_0x303315=_[_0x9f48('0x46')]({},_0x303315,_0x185f61[_0x9f48('0x47')]);var _0x14c533={'where':_0x303315[_0x9f48('0x44')]};return db[_0x9f48('0x48')]['count'](_0x14c533)['then'](function(_0x2766bb){_0x1671f2[_0x9f48('0x26')]=_0x2766bb;if(_0x185f61[_0x9f48('0x3a')][_0x9f48('0x49')]){_0x303315[_0x9f48('0x4a')]=[{'all':!![]}];}return db[_0x9f48('0x48')][_0x9f48('0x4b')](_0x303315);})['then'](function(_0xb96316){_0x1671f2['rows']=_0xb96316;return _0x1671f2;})[_0x9f48('0x2d')](respondWithFilteredResult(_0x5b0e74,_0x303315))['catch'](handleError(_0x5b0e74,null));};exports[_0x9f48('0x4c')]=function(_0xb5abeb,_0x9d4b94){var _0x1cf47c={'raw':!![],'where':{'id':_0xb5abeb[_0x9f48('0x4d')]['id']}},_0x35be80={};_0x35be80[_0x9f48('0x39')]=_['keys'](db['WhatsappQueue'][_0x9f48('0x36')]);_0x35be80['query']=_[_0x9f48('0x4e')](_0xb5abeb['query']);_0x35be80['filters']=_['intersection'](_0x35be80[_0x9f48('0x39')],_0x35be80['query']);_0x1cf47c['attributes']=_['intersection'](_0x35be80[_0x9f48('0x39')],qs['fields'](_0xb5abeb[_0x9f48('0x3a')][_0x9f48('0x3d')]));_0x1cf47c[_0x9f48('0x3f')]=_0x1cf47c[_0x9f48('0x3f')][_0x9f48('0x3e')]?_0x1cf47c[_0x9f48('0x3f')]:_0x35be80['model'];if(_0xb5abeb[_0x9f48('0x3a')]['includeAll']){_0x1cf47c[_0x9f48('0x4a')]=[{'all':!![]}];}_0x1cf47c=_[_0x9f48('0x46')]({},_0x1cf47c,_0xb5abeb[_0x9f48('0x47')]);return db[_0x9f48('0x48')]['find'](_0x1cf47c)[_0x9f48('0x2d')](handleEntityNotFound(_0x9d4b94,null))['then'](respondWithResult(_0x9d4b94,null))[_0x9f48('0x4f')](handleError(_0x9d4b94,null));};exports[_0x9f48('0x50')]=function(_0x208fb5,_0x3cf60e){return db[_0x9f48('0x48')][_0x9f48('0x50')](_0x208fb5[_0x9f48('0x51')],{})['then'](function(_0x3ae848){var _0x416873=_0x208fb5[_0x9f48('0x52')][_0x9f48('0x2e')]({'plain':!![]});if(!_0x416873)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x416873[_0x9f48('0x53')]==='user'){var _0x1765b8=_0x3ae848[_0x9f48('0x2e')]({'plain':!![]});var _0x3ea067='WhatsappQueues';return db[_0x9f48('0x54')]['find']({'where':{'name':_0x3ea067,'userProfileId':_0x416873['userProfileId']},'raw':!![]})[_0x9f48('0x2d')](function(_0x5b8fe0){if(_0x5b8fe0&&_0x5b8fe0[_0x9f48('0x55')]===0x0){return db[_0x9f48('0x2f')][_0x9f48('0x50')]({'name':_0x1765b8[_0x9f48('0x33')],'resourceId':_0x1765b8['id'],'type':_0x5b8fe0[_0x9f48('0x33')],'sectionId':_0x5b8fe0['id']},{})[_0x9f48('0x2d')](function(){return _0x3ae848;});}else{return _0x3ae848;}})[_0x9f48('0x4f')](function(_0x238306){logger[_0x9f48('0x31')](_0x9f48('0x56'),_0x238306);throw _0x238306;});}return _0x3ae848;})[_0x9f48('0x2d')](respondWithResult(_0x3cf60e,0xc9))['catch'](handleError(_0x3cf60e,null));};exports[_0x9f48('0x2b')]=function(_0x8547cc,_0x38f235){if(_0x8547cc[_0x9f48('0x51')]['id']){delete _0x8547cc[_0x9f48('0x51')]['id'];}return db[_0x9f48('0x48')][_0x9f48('0x57')]({'where':{'id':_0x8547cc[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x38f235,null))['then'](saveUpdates(_0x8547cc[_0x9f48('0x51')],null))[_0x9f48('0x2d')](respondWithResult(_0x38f235,null))[_0x9f48('0x4f')](handleError(_0x38f235,null));};exports['destroy']=function(_0x3f65f3,_0x9f49fd){return db[_0x9f48('0x48')][_0x9f48('0x57')]({'where':{'id':_0x3f65f3[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x9f49fd,null))[_0x9f48('0x2d')](removeEntity(_0x9f49fd,null))[_0x9f48('0x4f')](handleError(_0x9f49fd,null));};exports[_0x9f48('0x58')]=function(_0x3a12cb,_0x596a4e){return db[_0x9f48('0x48')][_0x9f48('0x58')]()[_0x9f48('0x2d')](respondWithResult(_0x596a4e,null))[_0x9f48('0x4f')](handleError(_0x596a4e,null));};exports['getMembers']=function(_0x28dd0f,_0x217c9e,_0x2289c9){var _0x54086e={'raw':!![],'where':{}},_0x5957d9={},_0x192342;return db[_0x9f48('0x48')][_0x9f48('0x59')]({'where':{'id':_0x28dd0f['params']['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x217c9e,null))[_0x9f48('0x2d')](function(_0x17c39f){if(_0x17c39f){_0x192342=_0x17c39f[_0x9f48('0x2e')]({'plain':!![]});_0x5957d9[_0x9f48('0x39')]=_['keys'](db[_0x9f48('0x5a')][_0x9f48('0x36')]);_0x5957d9[_0x9f48('0x3a')]=_['keys'](_0x28dd0f[_0x9f48('0x3a')]);_0x5957d9[_0x9f48('0x3b')]=_[_0x9f48('0x3c')](_0x5957d9['model'],_0x5957d9['query']);_0x54086e[_0x9f48('0x3f')]=_['intersection'](_0x5957d9[_0x9f48('0x39')],qs[_0x9f48('0x3d')](_0x28dd0f[_0x9f48('0x3a')][_0x9f48('0x3d')]));_0x54086e[_0x9f48('0x3f')]=_0x54086e[_0x9f48('0x3f')]['length']?_0x54086e[_0x9f48('0x3f')]:_0x5957d9[_0x9f48('0x39')];if(!_0x28dd0f[_0x9f48('0x3a')][_0x9f48('0x40')]('nolimit')){_0x54086e[_0x9f48('0x25')]=qs[_0x9f48('0x25')](_0x28dd0f['query']['limit']);_0x54086e[_0x9f48('0x27')]=qs[_0x9f48('0x27')](_0x28dd0f[_0x9f48('0x3a')]['offset']);}_0x54086e['order']=qs[_0x9f48('0x43')](_0x28dd0f[_0x9f48('0x3a')][_0x9f48('0x43')]);_0x54086e[_0x9f48('0x44')]=qs[_0x9f48('0x3b')](_[_0x9f48('0x5b')](_0x28dd0f[_0x9f48('0x3a')],_0x5957d9[_0x9f48('0x3b')]));_0x54086e[_0x9f48('0x44')][_0x9f48('0x5c')]=_0x17c39f['id'];if(_0x28dd0f[_0x9f48('0x3a')][_0x9f48('0x45')]){_0x54086e[_0x9f48('0x44')]=_[_0x9f48('0x46')](_0x54086e['where'],{'$or':_['map'](_0x54086e[_0x9f48('0x3f')],function(_0xcce460){var _0x4b559f={};_0x4b559f[_0xcce460]={'$like':'%'+_0x28dd0f[_0x9f48('0x3a')][_0x9f48('0x45')]+'%'};return _0x4b559f;})});}_0x54086e=_[_0x9f48('0x46')]({},_0x54086e,_0x28dd0f[_0x9f48('0x47')]);return db[_0x9f48('0x5a')][_0x9f48('0x4b')](_0x54086e);}})[_0x9f48('0x2d')](function(_0x167ccc){if(_0x167ccc){return db[_0x9f48('0x5d')][_0x9f48('0x5e')]({'where':{'id':_['map'](_0x167ccc,_0x9f48('0x5f')),'role':_0x9f48('0x60')},'attributes':['id',_0x9f48('0x33'),_0x9f48('0x61'),_0x9f48('0x62'),'createdAt']});}})[_0x9f48('0x2d')](function(_0x35b04a){if(_0x35b04a){return{'count':_0x35b04a['count'],'rows':_['map'](_0x35b04a[_0x9f48('0x63')],function(_0x42e182){return{'membername':_0x42e182[_0x9f48('0x33')],'UserId':_0x42e182['id'],'queue_name':_0x192342[_0x9f48('0x33')],'WhatsappQueueId':_0x192342['id'],'interface':util[_0x9f48('0x64')]('%s/%s','SIP',_0x42e182[_0x9f48('0x33')]),'penalty':0x0,'paused':_0x42e182[_0x9f48('0x61')],'createdAt':_0x42e182[_0x9f48('0x65')],'updatedAt':_0x42e182[_0x9f48('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f48('0x2d')](respondWithFilteredResult(_0x217c9e,_0x54086e))[_0x9f48('0x4f')](handleError(_0x217c9e,null));};exports[_0x9f48('0x66')]=function(_0x84195d,_0x96a305,_0x119dc1){var _0x11b793={};var _0x189cba={};var _0x44fee0;var _0x2b12f8;return db[_0x9f48('0x48')]['findOne']({'where':{'id':_0x84195d[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x96a305,null))['then'](function(_0x31a0b3){if(_0x31a0b3){_0x44fee0=_0x31a0b3;_0x189cba[_0x9f48('0x39')]=_['keys'](db['Team'][_0x9f48('0x36')]);_0x189cba[_0x9f48('0x3a')]=_['keys'](_0x84195d[_0x9f48('0x3a')]);_0x189cba[_0x9f48('0x3b')]=_[_0x9f48('0x3c')](_0x189cba[_0x9f48('0x39')],_0x189cba[_0x9f48('0x3a')]);_0x11b793['attributes']=_[_0x9f48('0x3c')](_0x189cba[_0x9f48('0x39')],qs[_0x9f48('0x3d')](_0x84195d[_0x9f48('0x3a')][_0x9f48('0x3d')]));_0x11b793[_0x9f48('0x3f')]=_0x11b793[_0x9f48('0x3f')][_0x9f48('0x3e')]?_0x11b793['attributes']:_0x189cba[_0x9f48('0x39')];_0x11b793['order']=qs[_0x9f48('0x43')](_0x84195d['query'][_0x9f48('0x43')]);_0x11b793[_0x9f48('0x44')]=qs['filters'](_[_0x9f48('0x5b')](_0x84195d[_0x9f48('0x3a')],_0x189cba[_0x9f48('0x3b')]));if(_0x84195d[_0x9f48('0x3a')][_0x9f48('0x45')]){_0x11b793[_0x9f48('0x44')]=_['merge'](_0x11b793[_0x9f48('0x44')],{'$or':_['map'](_0x11b793[_0x9f48('0x3f')],function(_0x2b4af9){var _0x11059b={};_0x11059b[_0x2b4af9]={'$like':'%'+_0x84195d[_0x9f48('0x3a')]['filter']+'%'};return _0x11059b;})});}_0x11b793=_[_0x9f48('0x46')]({},_0x11b793,_0x84195d[_0x9f48('0x47')]);return _0x44fee0[_0x9f48('0x66')](_0x11b793);}})['then'](function(_0xc64695){if(_0xc64695){_0x2b12f8=_0xc64695[_0x9f48('0x3e')];if(!_0x84195d['query'][_0x9f48('0x40')](_0x9f48('0x41'))){_0x11b793[_0x9f48('0x25')]=qs['limit'](_0x84195d[_0x9f48('0x3a')][_0x9f48('0x25')]);_0x11b793[_0x9f48('0x27')]=qs[_0x9f48('0x27')](_0x84195d[_0x9f48('0x3a')][_0x9f48('0x27')]);}return _0x44fee0[_0x9f48('0x66')](_0x11b793);}})[_0x9f48('0x2d')](function(_0x1b85bb){if(_0x1b85bb){return _0x1b85bb?{'count':_0x2b12f8,'rows':_0x1b85bb}:null;}})[_0x9f48('0x2d')](respondWithResult(_0x96a305,null))['catch'](handleError(_0x96a305,null));};exports[_0x9f48('0x67')]=function(_0x5c34a2,_0x480894,_0x125505){var _0x3e4359=_0x5c34a2['body'][_0x9f48('0x68')];return db[_0x9f48('0x69')][_0x9f48('0x4b')]({'where':{'id':_0x3e4359},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9f48('0x33'),_0x9f48('0x6a'),_0x9f48('0x6b'),_0x9f48('0x6c')],'raw':!![]}]})[_0x9f48('0x2d')](function(_0x3dbdf4){if(_0x3dbdf4){var _0x325190=_[_0x9f48('0x6d')](_0x3dbdf4,function(_0x4e01de){var _0x1b3d03=_0x4e01de[_0x9f48('0x2e')]({'plain':!![]});return _0x1b3d03[_0x9f48('0x6e')];});return db[_0x9f48('0x48')][_0x9f48('0x57')]({'where':{'id':_0x5c34a2[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](function(_0x16462d){return db[_0x9f48('0x6f')][_0x9f48('0x70')](function(_0x42ae9a){return _0x16462d[_0x9f48('0x67')](_0x3e4359,{'transaction':_0x42ae9a})['then'](function(){return BPromise[_0x9f48('0x71')](_0x325190,function(_0x5b4037){return db[_0x9f48('0x5a')]['findOrCreate']({'where':{'UserId':_0x5b4037['id'],'WhatsappQueueId':_0x5c34a2[_0x9f48('0x4d')]['id']},'transaction':_0x42ae9a});});})[_0x9f48('0x2d')](function(){_0x325190[_0x9f48('0x72')](function(_0x28a24d){socket[_0x9f48('0x73')](_0x9f48('0x74'),{'UserId':_0x28a24d['id'],'WhatsappQueueId':_0x16462d['id']});});});});});}})['then'](respondWithStatusCode(_0x480894,null))[_0x9f48('0x4f')](handleError(_0x480894,null));};exports[_0x9f48('0x75')]=function(_0x4fd546,_0x4c8642,_0x6a2f31){return db[_0x9f48('0x69')][_0x9f48('0x4b')]({'where':{'id':_0x4fd546['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9f48('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4c8642,null))[_0x9f48('0x2d')](function(_0x48e68f){var _0x549acc=_['map'](_0x48e68f,'id');var _0x2893a1=[];var _0x5f2f07=[];var _0x3c4542=squel[_0x9f48('0x76')]();_0x3c4542[_0x9f48('0x77')](_0x9f48('0x78'))[_0x9f48('0x79')](_0x9f48('0x7a'),'tq')[_0x9f48('0x7b')]('user_has_teams','ut',_0x9f48('0x7c'))[_0x9f48('0x44')]('WhatsappQueueId\x20=\x20?',_0x4fd546[_0x9f48('0x4d')]['id']);for(var _0x20de44=0x0;_0x20de44<_0x48e68f[_0x9f48('0x3e')];_0x20de44+=0x1){let _0x9767b1=_0x48e68f[_0x20de44];for(var _0x480020=0x0;_0x480020<_0x9767b1[_0x9f48('0x6e')][_0x9f48('0x3e')];_0x480020+=0x1){let _0x1c2518=_0x9767b1['Agents'][_0x480020];var _0x365dc6=_0x3c4542[_0x9f48('0x7d')]();_0x365dc6[_0x9f48('0x44')](_0x9f48('0x7e'),_0x1c2518['id']);_0x5f2f07[_0x9f48('0x7f')](db[_0x9f48('0x6f')]['query'](_0x365dc6['toString'](),{'type':db['sequelize'][_0x9f48('0x80')]['SELECT']})['then'](function(_0x224658){if(_0x224658[_0x9f48('0x3e')]===0x1){return _0x1c2518['id'];}else{var _0x378946=_[_0x9f48('0x81')](_[_0x9f48('0x35')](_0x224658,'TeamId'),function(_0x24a7cb){return _[_0x9f48('0x82')](_0x549acc,_0x24a7cb);});if(_0x378946){return _0x1c2518['id'];}}}));}}return BPromise['all'](_0x5f2f07)[_0x9f48('0x2d')](function(_0x5a4d20){_0x2893a1=_(_0x2893a1)['union'](_0x5a4d20)['compact']()[_0x9f48('0x83')]();return db[_0x9f48('0x48')][_0x9f48('0x57')]({'where':{'id':_0x4fd546[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](function(_0x4ff47b){return db[_0x9f48('0x6f')][_0x9f48('0x70')](function(_0x39f48a){return _0x4ff47b[_0x9f48('0x75')](_0x4fd546[_0x9f48('0x3a')]['ids'],{'transaction':_0x39f48a})[_0x9f48('0x2d')](function(){if(!_['isEmpty'](_0x2893a1)){return _0x4ff47b['removeAgents'](_0x2893a1,{'transaction':_0x39f48a});}})['then'](function(){_0x2893a1[_0x9f48('0x72')](function(_0x765008){socket[_0x9f48('0x73')]('userWhatsappQueue:remove',{'UserId':_0x765008,'WhatsappQueueId':_0x4ff47b['id']});});});});});});})['then'](respondWithStatusCode(_0x4c8642,null))['catch'](handleError(_0x4c8642,null));};exports[_0x9f48('0x84')]=function(_0xb6c49a,_0x50b8e1,_0x2f7ff9){return db[_0x9f48('0x48')][_0x9f48('0x57')]({'where':{'id':_0xb6c49a[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x50b8e1,null))[_0x9f48('0x2d')](function(_0x90ad42){if(_0x90ad42){return _0x90ad42[_0x9f48('0x84')](_0xb6c49a[_0x9f48('0x51')][_0x9f48('0x68')],_['omit'](_0xb6c49a[_0x9f48('0x51')],[_0x9f48('0x68'),'id'])||{})[_0x9f48('0x85')](function(_0x8f84af){for(var _0x2b43c4=0x0;_0x2b43c4<_0xb6c49a[_0x9f48('0x51')][_0x9f48('0x68')][_0x9f48('0x3e')];_0x2b43c4+=0x1){socket['emit'](_0x9f48('0x74'),{'UserId':Number(_0xb6c49a[_0x9f48('0x51')][_0x9f48('0x68')][_0x2b43c4]),'WhatsappQueueId':Number(_0xb6c49a[_0x9f48('0x4d')]['id'])});}return _0x8f84af;});}})['then'](respondWithResult(_0x50b8e1,null))[_0x9f48('0x4f')](handleError(_0x50b8e1,null));};exports[_0x9f48('0x86')]=function(_0x13ac2b,_0x2b2226,_0x4e122a){return db[_0x9f48('0x48')][_0x9f48('0x57')]({'where':{'id':_0x13ac2b[_0x9f48('0x4d')]['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x2b2226,null))['then'](function(_0x19a517){if(_0x19a517){return _0x19a517[_0x9f48('0x86')](_0x13ac2b[_0x9f48('0x3a')][_0x9f48('0x68')])[_0x9f48('0x2d')](function(){if(_['isArray'](_0x13ac2b[_0x9f48('0x3a')][_0x9f48('0x68')])){for(var _0x238915=0x0;_0x238915<_0x13ac2b[_0x9f48('0x3a')][_0x9f48('0x68')][_0x9f48('0x3e')];_0x238915+=0x1){socket['emit'](_0x9f48('0x87'),{'UserId':Number(_0x13ac2b['query'][_0x9f48('0x68')][_0x238915]),'WhatsappQueueId':Number(_0x13ac2b['params']['id'])});}}else{socket['emit'](_0x9f48('0x87'),{'UserId':Number(_0x13ac2b[_0x9f48('0x3a')][_0x9f48('0x68')]),'WhatsappQueueId':Number(_0x13ac2b[_0x9f48('0x4d')]['id'])});}});}})[_0x9f48('0x2d')](respondWithStatusCode(_0x2b2226,null))[_0x9f48('0x4f')](handleError(_0x2b2226,null));};exports[_0x9f48('0x88')]=function(_0xf64596,_0x5b36c1,_0x16c057){var _0x1aceb0={};var _0xa4891c={};var _0x1b0e6a;var _0x5bddc6;return db[_0x9f48('0x48')][_0x9f48('0x59')]({'where':{'id':_0xf64596['params']['id']}})[_0x9f48('0x2d')](handleEntityNotFound(_0x5b36c1,null))[_0x9f48('0x2d')](function(_0x1b2a30){if(_0x1b2a30){_0x1b0e6a=_0x1b2a30;_0xa4891c[_0x9f48('0x39')]=_[_0x9f48('0x4e')](db[_0x9f48('0x5d')][_0x9f48('0x36')]);_0xa4891c[_0x9f48('0x3a')]=_['keys'](_0xf64596[_0x9f48('0x3a')]);_0xa4891c[_0x9f48('0x3b')]=_['intersection'](_0xa4891c['model'],_0xa4891c[_0x9f48('0x3a')]);_0x1aceb0['attributes']=_['intersection'](_0xa4891c['model'],qs[_0x9f48('0x3d')](_0xf64596[_0x9f48('0x3a')][_0x9f48('0x3d')]));_0x1aceb0[_0x9f48('0x3f')]=_0x1aceb0[_0x9f48('0x3f')][_0x9f48('0x3e')]?_0x1aceb0[_0x9f48('0x3f')]:_0xa4891c[_0x9f48('0x39')];_0x1aceb0['order']=qs['sort'](_0xf64596['query'][_0x9f48('0x43')]);_0x1aceb0[_0x9f48('0x44')]=qs['filters'](_[_0x9f48('0x5b')](_0xf64596[_0x9f48('0x3a')],_0xa4891c['filters']));if(_0xf64596[_0x9f48('0x3a')][_0x9f48('0x45')]){_0x1aceb0[_0x9f48('0x44')]=_[_0x9f48('0x46')](_0x1aceb0[_0x9f48('0x44')],{'$or':_[_0x9f48('0x35')](_0x1aceb0['attributes'],function(_0x2ce4b6){var _0x493591={};_0x493591[_0x2ce4b6]={'$like':'%'+_0xf64596['query'][_0x9f48('0x45')]+'%'};return _0x493591;})});}_0x1aceb0=_[_0x9f48('0x46')]({},_0x1aceb0,_0xf64596[_0x9f48('0x47')]);return _0x1b0e6a[_0x9f48('0x88')](_0x1aceb0);}})[_0x9f48('0x2d')](function(_0x3224f2){if(_0x3224f2){_0x5bddc6=_0x3224f2[_0x9f48('0x3e')];if(!_0xf64596[_0x9f48('0x3a')]['hasOwnProperty'](_0x9f48('0x41'))){_0x1aceb0[_0x9f48('0x25')]=qs[_0x9f48('0x25')](_0xf64596['query']['limit']);_0x1aceb0[_0x9f48('0x27')]=qs[_0x9f48('0x27')](_0xf64596[_0x9f48('0x3a')]['offset']);}return _0x1b0e6a[_0x9f48('0x88')](_0x1aceb0);}})[_0x9f48('0x2d')](function(_0x536d3b){if(_0x536d3b){return _0x536d3b?{'count':_0x5bddc6,'rows':_0x536d3b}:null;}})[_0x9f48('0x2d')](respondWithResult(_0x5b36c1,null))[_0x9f48('0x4f')](handleError(_0x5b36c1,null));}; \ No newline at end of file +var _0xfbe8=['each','findOrCreate','emit','removeTeams','Agents','select','field','tq.TeamId','from','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','forEach','addAgents','omit','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','get','WhatsappQueues','error','name','send','index','map','WhatsappQueue','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','createdAt','rows','%s/%s','updatedAt','getTeams','findOne','Team','hasOwnProperty','addTeams','ids','online','voicePause','interface','flatMap','transaction'];(function(_0x4e4d1a,_0x3e20c6){var _0x308b60=function(_0x2db360){while(--_0x2db360){_0x4e4d1a['push'](_0x4e4d1a['shift']());}};_0x308b60(++_0x3e20c6);}(_0xfbe8,0xa6));var _0x8fbe=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfbe8[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x8fbe('0x0'));var rimraf=require(_0x8fbe('0x1'));var zipdir=require(_0x8fbe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fbe('0x3'));var moment=require('moment');var BPromise=require(_0x8fbe('0x4'));var Mustache=require(_0x8fbe('0x5'));var util=require(_0x8fbe('0x6'));var path=require(_0x8fbe('0x7'));var sox=require(_0x8fbe('0x8'));var csv=require(_0x8fbe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fbe('0xa'));var squel=require(_0x8fbe('0xb'));var crypto=require('crypto');var jsforce=require(_0x8fbe('0xc'));var deskjs=require(_0x8fbe('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8fbe('0xe'));var Redis=require(_0x8fbe('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8fbe('0x10'));var as=require(_0x8fbe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fbe('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8fbe('0x13'))['db'];config['redis']=_[_0x8fbe('0x14')](config[_0x8fbe('0x15')],{'host':_0x8fbe('0x16'),'port':0x18eb});var socket=require(_0x8fbe('0x17'))(new Redis(config[_0x8fbe('0x15')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x60f263,_0x385405){_0x385405=_0x385405||0xcc;return function(_0x2458d2){if(_0x2458d2){return _0x60f263[_0x8fbe('0x18')](_0x385405);}return _0x60f263['status'](_0x385405)[_0x8fbe('0x19')]();};}function respondWithResult(_0x1b88d6,_0x402e1e){_0x402e1e=_0x402e1e||0xc8;return function(_0x37e872){if(_0x37e872){return _0x1b88d6[_0x8fbe('0x1a')](_0x402e1e)[_0x8fbe('0x1b')](_0x37e872);}};}function respondWithFilteredResult(_0x212527,_0x4d09ba){return function(_0x7427e7){if(_0x7427e7){var _0x5cdf8f=typeof _0x4d09ba[_0x8fbe('0x1c')]==='undefined'&&typeof _0x4d09ba[_0x8fbe('0x1d')]===_0x8fbe('0x1e');var _0x417854=_0x7427e7['count'];var _0x26d076=_0x5cdf8f?0x0:_0x4d09ba[_0x8fbe('0x1c')];var _0x228ba5=_0x5cdf8f?_0x7427e7[_0x8fbe('0x1f')]:_0x4d09ba['offset']+_0x4d09ba[_0x8fbe('0x1d')];var _0x521b50;if(_0x228ba5>=_0x417854){_0x228ba5=_0x417854;_0x521b50=0xc8;}else{_0x521b50=0xce;}_0x212527[_0x8fbe('0x1a')](_0x521b50);return _0x212527[_0x8fbe('0x20')](_0x8fbe('0x21'),_0x26d076+'-'+_0x228ba5+'/'+_0x417854)[_0x8fbe('0x1b')](_0x7427e7);}return null;};}function patchUpdates(_0x4cc256){return function(_0x42cce9){try{jsonpatch['apply'](_0x42cce9,_0x4cc256,!![]);}catch(_0x30b52a){return BPromise[_0x8fbe('0x22')](_0x30b52a);}return _0x42cce9['save']();};}function saveUpdates(_0x64bd46,_0x5910ca){return function(_0x178616){if(_0x178616){return _0x178616[_0x8fbe('0x23')](_0x64bd46)[_0x8fbe('0x24')](function(_0x5edbe1){return _0x5edbe1;});}return null;};}function removeEntity(_0xe28d16,_0x28877c){return function(_0x4fc373){if(_0x4fc373){return _0x4fc373[_0x8fbe('0x25')]()[_0x8fbe('0x24')](function(){var _0x4650e2=_0x4fc373[_0x8fbe('0x26')]({'plain':!![]});var _0x2c3dbf=_0x8fbe('0x27');return db['UserProfileResource'][_0x8fbe('0x25')]({'where':{'type':_0x2c3dbf,'resourceId':_0x4650e2['id']}})['then'](function(){return _0x4fc373;});})['then'](function(){_0xe28d16[_0x8fbe('0x1a')](0xcc)[_0x8fbe('0x19')]();});}};}function handleEntityNotFound(_0x43754a,_0x1cd02a){return function(_0xeafbcb){if(!_0xeafbcb){_0x43754a[_0x8fbe('0x18')](0x194);}return _0xeafbcb;};}function handleError(_0xf813a,_0x32e52e){_0x32e52e=_0x32e52e||0x1f4;return function(_0x2718e3){logger[_0x8fbe('0x28')](_0x2718e3['stack']);if(_0x2718e3[_0x8fbe('0x29')]){delete _0x2718e3[_0x8fbe('0x29')];}_0xf813a[_0x8fbe('0x1a')](_0x32e52e)[_0x8fbe('0x2a')](_0x2718e3);};}exports[_0x8fbe('0x2b')]=function(_0x52817d,_0xb4bc50){var _0x827531={},_0x356a18={},_0x5ee8d2={'count':0x0,'rows':[]};var _0x4aa12c=_[_0x8fbe('0x2c')](db[_0x8fbe('0x2d')][_0x8fbe('0x2e')],function(_0x1c8542){return{'name':_0x1c8542['fieldName'],'type':_0x1c8542[_0x8fbe('0x2f')][_0x8fbe('0x30')]};});_0x356a18[_0x8fbe('0x31')]=_['map'](_0x4aa12c,_0x8fbe('0x29'));_0x356a18[_0x8fbe('0x32')]=_['keys'](_0x52817d[_0x8fbe('0x32')]);_0x356a18['filters']=_[_0x8fbe('0x33')](_0x356a18[_0x8fbe('0x31')],_0x356a18['query']);_0x827531[_0x8fbe('0x34')]=_[_0x8fbe('0x33')](_0x356a18['model'],qs[_0x8fbe('0x35')](_0x52817d['query'][_0x8fbe('0x35')]));_0x827531[_0x8fbe('0x34')]=_0x827531[_0x8fbe('0x34')][_0x8fbe('0x36')]?_0x827531[_0x8fbe('0x34')]:_0x356a18[_0x8fbe('0x31')];if(!_0x52817d[_0x8fbe('0x32')]['hasOwnProperty']('nolimit')){_0x827531['limit']=qs[_0x8fbe('0x1d')](_0x52817d[_0x8fbe('0x32')][_0x8fbe('0x1d')]);_0x827531[_0x8fbe('0x1c')]=qs['offset'](_0x52817d[_0x8fbe('0x32')][_0x8fbe('0x1c')]);}_0x827531[_0x8fbe('0x37')]=qs[_0x8fbe('0x38')](_0x52817d['query'][_0x8fbe('0x38')]);_0x827531[_0x8fbe('0x39')]=qs[_0x8fbe('0x3a')](_[_0x8fbe('0x3b')](_0x52817d[_0x8fbe('0x32')],_0x356a18['filters']),_0x4aa12c);if(_0x52817d[_0x8fbe('0x32')][_0x8fbe('0x3c')]){_0x827531[_0x8fbe('0x39')]=_[_0x8fbe('0x3d')](_0x827531['where'],{'$or':_['map'](_0x4aa12c,function(_0x56cd33){if(_0x56cd33[_0x8fbe('0x2f')]!==_0x8fbe('0x3e')){var _0x1dc05b={};_0x1dc05b[_0x56cd33[_0x8fbe('0x29')]]={'$like':'%'+_0x52817d[_0x8fbe('0x32')]['filter']+'%'};return _0x1dc05b;}})});}_0x827531=_['merge']({},_0x827531,_0x52817d[_0x8fbe('0x3f')]);var _0x25949f={'where':_0x827531['where']};return db['WhatsappQueue']['count'](_0x25949f)[_0x8fbe('0x24')](function(_0x392233){_0x5ee8d2[_0x8fbe('0x1f')]=_0x392233;if(_0x52817d[_0x8fbe('0x32')]['includeAll']){_0x827531[_0x8fbe('0x40')]=[{'all':!![]}];}return db[_0x8fbe('0x2d')][_0x8fbe('0x41')](_0x827531);})[_0x8fbe('0x24')](function(_0x5542be){_0x5ee8d2['rows']=_0x5542be;return _0x5ee8d2;})['then'](respondWithFilteredResult(_0xb4bc50,_0x827531))[_0x8fbe('0x42')](handleError(_0xb4bc50,null));};exports['show']=function(_0x3e0a59,_0x16ee8a){var _0x24eff6={'raw':!![],'where':{'id':_0x3e0a59[_0x8fbe('0x43')]['id']}},_0x3e3f0b={};_0x3e3f0b[_0x8fbe('0x31')]=_[_0x8fbe('0x44')](db[_0x8fbe('0x2d')]['rawAttributes']);_0x3e3f0b[_0x8fbe('0x32')]=_['keys'](_0x3e0a59[_0x8fbe('0x32')]);_0x3e3f0b[_0x8fbe('0x3a')]=_[_0x8fbe('0x33')](_0x3e3f0b[_0x8fbe('0x31')],_0x3e3f0b['query']);_0x24eff6[_0x8fbe('0x34')]=_[_0x8fbe('0x33')](_0x3e3f0b['model'],qs[_0x8fbe('0x35')](_0x3e0a59[_0x8fbe('0x32')][_0x8fbe('0x35')]));_0x24eff6[_0x8fbe('0x34')]=_0x24eff6[_0x8fbe('0x34')][_0x8fbe('0x36')]?_0x24eff6[_0x8fbe('0x34')]:_0x3e3f0b[_0x8fbe('0x31')];if(_0x3e0a59['query'][_0x8fbe('0x45')]){_0x24eff6[_0x8fbe('0x40')]=[{'all':!![]}];}_0x24eff6=_[_0x8fbe('0x3d')]({},_0x24eff6,_0x3e0a59[_0x8fbe('0x3f')]);return db['WhatsappQueue'][_0x8fbe('0x46')](_0x24eff6)[_0x8fbe('0x24')](handleEntityNotFound(_0x16ee8a,null))['then'](respondWithResult(_0x16ee8a,null))['catch'](handleError(_0x16ee8a,null));};exports['create']=function(_0x1ca642,_0x45cb89){return db[_0x8fbe('0x2d')][_0x8fbe('0x47')](_0x1ca642[_0x8fbe('0x48')],{})[_0x8fbe('0x24')](function(_0x4fef05){var _0x133de8=_0x1ca642['user'][_0x8fbe('0x26')]({'plain':!![]});if(!_0x133de8)throw new Error(_0x8fbe('0x49'));if(_0x133de8[_0x8fbe('0x4a')]===_0x8fbe('0x4b')){var _0x2f2b2f=_0x4fef05['get']({'plain':!![]});var _0x462892='WhatsappQueues';return db[_0x8fbe('0x4c')][_0x8fbe('0x46')]({'where':{'name':_0x462892,'userProfileId':_0x133de8[_0x8fbe('0x4d')]},'raw':!![]})[_0x8fbe('0x24')](function(_0x55753b){if(_0x55753b&&_0x55753b[_0x8fbe('0x4e')]===0x0){return db[_0x8fbe('0x4f')]['create']({'name':_0x2f2b2f[_0x8fbe('0x29')],'resourceId':_0x2f2b2f['id'],'type':_0x55753b['name'],'sectionId':_0x55753b['id']},{})[_0x8fbe('0x24')](function(){return _0x4fef05;});}else{return _0x4fef05;}})[_0x8fbe('0x42')](function(_0x47b290){logger[_0x8fbe('0x28')](_0x8fbe('0x50'),_0x47b290);throw _0x47b290;});}return _0x4fef05;})['then'](respondWithResult(_0x45cb89,0xc9))['catch'](handleError(_0x45cb89,null));};exports[_0x8fbe('0x23')]=function(_0x43d596,_0x5e4aad){if(_0x43d596[_0x8fbe('0x48')]['id']){delete _0x43d596[_0x8fbe('0x48')]['id'];}return db[_0x8fbe('0x2d')][_0x8fbe('0x46')]({'where':{'id':_0x43d596['params']['id']}})['then'](handleEntityNotFound(_0x5e4aad,null))[_0x8fbe('0x24')](saveUpdates(_0x43d596[_0x8fbe('0x48')],null))[_0x8fbe('0x24')](respondWithResult(_0x5e4aad,null))['catch'](handleError(_0x5e4aad,null));};exports[_0x8fbe('0x25')]=function(_0x45c53a,_0x36db4b){return db[_0x8fbe('0x2d')]['find']({'where':{'id':_0x45c53a[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](handleEntityNotFound(_0x36db4b,null))[_0x8fbe('0x24')](removeEntity(_0x36db4b,null))['catch'](handleError(_0x36db4b,null));};exports['describe']=function(_0x5387e2,_0x4e291c){return db[_0x8fbe('0x2d')]['describe']()['then'](respondWithResult(_0x4e291c,null))[_0x8fbe('0x42')](handleError(_0x4e291c,null));};exports[_0x8fbe('0x51')]=function(_0x382675,_0x17cff1,_0x567cf9){var _0x5d5a19={'raw':!![],'where':{}},_0x18d9e0={},_0x309f4e;return db[_0x8fbe('0x2d')]['findOne']({'where':{'id':_0x382675[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](handleEntityNotFound(_0x17cff1,null))[_0x8fbe('0x24')](function(_0x57846d){if(_0x57846d){_0x309f4e=_0x57846d[_0x8fbe('0x26')]({'plain':!![]});_0x18d9e0['model']=_[_0x8fbe('0x44')](db[_0x8fbe('0x52')]['rawAttributes']);_0x18d9e0[_0x8fbe('0x32')]=_['keys'](_0x382675[_0x8fbe('0x32')]);_0x18d9e0['filters']=_['intersection'](_0x18d9e0[_0x8fbe('0x31')],_0x18d9e0['query']);_0x5d5a19[_0x8fbe('0x34')]=_[_0x8fbe('0x33')](_0x18d9e0[_0x8fbe('0x31')],qs['fields'](_0x382675['query'][_0x8fbe('0x35')]));_0x5d5a19[_0x8fbe('0x34')]=_0x5d5a19[_0x8fbe('0x34')][_0x8fbe('0x36')]?_0x5d5a19[_0x8fbe('0x34')]:_0x18d9e0['model'];if(!_0x382675[_0x8fbe('0x32')]['hasOwnProperty'](_0x8fbe('0x53'))){_0x5d5a19['limit']=qs[_0x8fbe('0x1d')](_0x382675[_0x8fbe('0x32')][_0x8fbe('0x1d')]);_0x5d5a19[_0x8fbe('0x1c')]=qs[_0x8fbe('0x1c')](_0x382675[_0x8fbe('0x32')][_0x8fbe('0x1c')]);}_0x5d5a19[_0x8fbe('0x37')]=qs[_0x8fbe('0x38')](_0x382675[_0x8fbe('0x32')][_0x8fbe('0x38')]);_0x5d5a19[_0x8fbe('0x39')]=qs[_0x8fbe('0x3a')](_[_0x8fbe('0x3b')](_0x382675[_0x8fbe('0x32')],_0x18d9e0[_0x8fbe('0x3a')]));_0x5d5a19['where'][_0x8fbe('0x54')]=_0x57846d['id'];if(_0x382675[_0x8fbe('0x32')][_0x8fbe('0x3c')]){_0x5d5a19['where']=_[_0x8fbe('0x3d')](_0x5d5a19[_0x8fbe('0x39')],{'$or':_[_0x8fbe('0x2c')](_0x5d5a19[_0x8fbe('0x34')],function(_0x141c4b){var _0x4549c2={};_0x4549c2[_0x141c4b]={'$like':'%'+_0x382675[_0x8fbe('0x32')][_0x8fbe('0x3c')]+'%'};return _0x4549c2;})});}_0x5d5a19=_[_0x8fbe('0x3d')]({},_0x5d5a19,_0x382675[_0x8fbe('0x3f')]);return db[_0x8fbe('0x52')]['findAll'](_0x5d5a19);}})['then'](function(_0x130970){if(_0x130970){return db[_0x8fbe('0x55')][_0x8fbe('0x56')]({'where':{'id':_['map'](_0x130970,_0x8fbe('0x57')),'role':'agent'},'attributes':['id',_0x8fbe('0x29'),_0x8fbe('0x58'),'updatedAt',_0x8fbe('0x59')]});}})['then'](function(_0x2b992f){if(_0x2b992f){return{'count':_0x2b992f[_0x8fbe('0x1f')],'rows':_[_0x8fbe('0x2c')](_0x2b992f[_0x8fbe('0x5a')],function(_0x42c0de){return{'membername':_0x42c0de[_0x8fbe('0x29')],'UserId':_0x42c0de['id'],'queue_name':_0x309f4e[_0x8fbe('0x29')],'WhatsappQueueId':_0x309f4e['id'],'interface':util['format'](_0x8fbe('0x5b'),'SIP',_0x42c0de[_0x8fbe('0x29')]),'penalty':0x0,'paused':_0x42c0de[_0x8fbe('0x58')],'createdAt':_0x42c0de[_0x8fbe('0x59')],'updatedAt':_0x42c0de[_0x8fbe('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17cff1,_0x5d5a19))[_0x8fbe('0x42')](handleError(_0x17cff1,null));};exports[_0x8fbe('0x5d')]=function(_0x1fa30b,_0x550462,_0x3cd0fb){var _0x23b954={};var _0x41a445={};var _0x2703be;var _0x18da31;return db['WhatsappQueue'][_0x8fbe('0x5e')]({'where':{'id':_0x1fa30b[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](handleEntityNotFound(_0x550462,null))[_0x8fbe('0x24')](function(_0x35cb31){if(_0x35cb31){_0x2703be=_0x35cb31;_0x41a445['model']=_[_0x8fbe('0x44')](db[_0x8fbe('0x5f')][_0x8fbe('0x2e')]);_0x41a445['query']=_[_0x8fbe('0x44')](_0x1fa30b['query']);_0x41a445[_0x8fbe('0x3a')]=_['intersection'](_0x41a445[_0x8fbe('0x31')],_0x41a445[_0x8fbe('0x32')]);_0x23b954[_0x8fbe('0x34')]=_['intersection'](_0x41a445[_0x8fbe('0x31')],qs['fields'](_0x1fa30b['query'][_0x8fbe('0x35')]));_0x23b954[_0x8fbe('0x34')]=_0x23b954[_0x8fbe('0x34')][_0x8fbe('0x36')]?_0x23b954[_0x8fbe('0x34')]:_0x41a445[_0x8fbe('0x31')];_0x23b954[_0x8fbe('0x37')]=qs[_0x8fbe('0x38')](_0x1fa30b[_0x8fbe('0x32')][_0x8fbe('0x38')]);_0x23b954['where']=qs[_0x8fbe('0x3a')](_[_0x8fbe('0x3b')](_0x1fa30b[_0x8fbe('0x32')],_0x41a445[_0x8fbe('0x3a')]));if(_0x1fa30b[_0x8fbe('0x32')][_0x8fbe('0x3c')]){_0x23b954[_0x8fbe('0x39')]=_[_0x8fbe('0x3d')](_0x23b954[_0x8fbe('0x39')],{'$or':_[_0x8fbe('0x2c')](_0x23b954[_0x8fbe('0x34')],function(_0x19b3c5){var _0x47bb4c={};_0x47bb4c[_0x19b3c5]={'$like':'%'+_0x1fa30b[_0x8fbe('0x32')]['filter']+'%'};return _0x47bb4c;})});}_0x23b954=_['merge']({},_0x23b954,_0x1fa30b[_0x8fbe('0x3f')]);return _0x2703be[_0x8fbe('0x5d')](_0x23b954);}})['then'](function(_0x513a1e){if(_0x513a1e){_0x18da31=_0x513a1e[_0x8fbe('0x36')];if(!_0x1fa30b[_0x8fbe('0x32')][_0x8fbe('0x60')](_0x8fbe('0x53'))){_0x23b954[_0x8fbe('0x1d')]=qs[_0x8fbe('0x1d')](_0x1fa30b[_0x8fbe('0x32')][_0x8fbe('0x1d')]);_0x23b954[_0x8fbe('0x1c')]=qs[_0x8fbe('0x1c')](_0x1fa30b[_0x8fbe('0x32')][_0x8fbe('0x1c')]);}return _0x2703be[_0x8fbe('0x5d')](_0x23b954);}})[_0x8fbe('0x24')](function(_0x26f53f){if(_0x26f53f){return _0x26f53f?{'count':_0x18da31,'rows':_0x26f53f}:null;}})[_0x8fbe('0x24')](respondWithResult(_0x550462,null))[_0x8fbe('0x42')](handleError(_0x550462,null));};exports[_0x8fbe('0x61')]=function(_0x55aabe,_0x23b222,_0x4c3bff){var _0x49b3e4=_0x55aabe[_0x8fbe('0x48')][_0x8fbe('0x62')];return db['Team'][_0x8fbe('0x41')]({'where':{'id':_0x49b3e4},'attributes':['id'],'include':[{'model':db[_0x8fbe('0x55')],'as':'Agents','attributes':['id',_0x8fbe('0x29'),_0x8fbe('0x63'),_0x8fbe('0x64'),_0x8fbe('0x65')],'raw':!![]}]})[_0x8fbe('0x24')](function(_0xd7687f){if(_0xd7687f){var _0x2c5a20=_[_0x8fbe('0x66')](_0xd7687f,function(_0x2c4b10){var _0x4d601c=_0x2c4b10[_0x8fbe('0x26')]({'plain':!![]});return _0x4d601c['Agents'];});return db[_0x8fbe('0x2d')]['find']({'where':{'id':_0x55aabe[_0x8fbe('0x43')]['id']}})['then'](function(_0xf25604){return db['sequelize'][_0x8fbe('0x67')](function(_0x2eb486){return _0xf25604[_0x8fbe('0x61')](_0x49b3e4,{'transaction':_0x2eb486})[_0x8fbe('0x24')](function(){return BPromise[_0x8fbe('0x68')](_0x2c5a20,function(_0x450a89){return db[_0x8fbe('0x52')][_0x8fbe('0x69')]({'where':{'UserId':_0x450a89['id'],'WhatsappQueueId':_0x55aabe['params']['id']},'transaction':_0x2eb486});});})[_0x8fbe('0x24')](function(){_0x2c5a20['forEach'](function(_0xb73c81){socket[_0x8fbe('0x6a')]('userWhatsappQueue:save',{'UserId':_0xb73c81['id'],'WhatsappQueueId':_0xf25604['id']});});});});});}})[_0x8fbe('0x24')](respondWithStatusCode(_0x23b222,null))[_0x8fbe('0x42')](handleError(_0x23b222,null));};exports[_0x8fbe('0x6b')]=function(_0x21d6d9,_0x3cc4a0,_0x5312e9){return db[_0x8fbe('0x5f')]['findAll']({'where':{'id':_0x21d6d9[_0x8fbe('0x32')][_0x8fbe('0x62')]},'attributes':['id'],'include':[{'model':db[_0x8fbe('0x55')],'as':_0x8fbe('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x8fbe('0x24')](handleEntityNotFound(_0x3cc4a0,null))['then'](function(_0x495f58){var _0x19f518=_['map'](_0x495f58,'id');var _0x255f59=[];var _0x3117ac=[];var _0x332853=squel[_0x8fbe('0x6d')]();_0x332853[_0x8fbe('0x6e')](_0x8fbe('0x6f'))[_0x8fbe('0x70')]('team_has_whatsapp_queues','tq')['join'](_0x8fbe('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8fbe('0x39')](_0x8fbe('0x72'),_0x21d6d9[_0x8fbe('0x43')]['id']);for(var _0x522e8a=0x0;_0x522e8a<_0x495f58[_0x8fbe('0x36')];_0x522e8a+=0x1){let _0x10c4ea=_0x495f58[_0x522e8a];for(var _0xf0506b=0x0;_0xf0506b<_0x10c4ea[_0x8fbe('0x6c')][_0x8fbe('0x36')];_0xf0506b+=0x1){let _0x4c87f1=_0x10c4ea['Agents'][_0xf0506b];var _0x3ef091=_0x332853[_0x8fbe('0x73')]();_0x3ef091['where'](_0x8fbe('0x74'),_0x4c87f1['id']);_0x3117ac[_0x8fbe('0x75')](db[_0x8fbe('0x76')][_0x8fbe('0x32')](_0x3ef091['toString'](),{'type':db[_0x8fbe('0x76')][_0x8fbe('0x77')][_0x8fbe('0x78')]})[_0x8fbe('0x24')](function(_0x13d331){if(_0x13d331[_0x8fbe('0x36')]===0x1){return _0x4c87f1['id'];}else{var _0x339b84=_[_0x8fbe('0x79')](_[_0x8fbe('0x2c')](_0x13d331,_0x8fbe('0x7a')),function(_0x2dad82){return _[_0x8fbe('0x7b')](_0x19f518,_0x2dad82);});if(_0x339b84){return _0x4c87f1['id'];}}}));}}return BPromise[_0x8fbe('0x7c')](_0x3117ac)['then'](function(_0x36f78e){_0x255f59=_(_0x255f59)['union'](_0x36f78e)[_0x8fbe('0x7d')]()[_0x8fbe('0x7e')]();return db[_0x8fbe('0x2d')][_0x8fbe('0x46')]({'where':{'id':_0x21d6d9[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](function(_0xed8379){return db['sequelize']['transaction'](function(_0x34f228){return _0xed8379[_0x8fbe('0x6b')](_0x21d6d9[_0x8fbe('0x32')][_0x8fbe('0x62')],{'transaction':_0x34f228})['then'](function(){if(!_['isEmpty'](_0x255f59)){return _0xed8379['removeAgents'](_0x255f59,{'transaction':_0x34f228});}})[_0x8fbe('0x24')](function(){_0x255f59[_0x8fbe('0x7f')](function(_0x4ed2c3){socket[_0x8fbe('0x6a')]('userWhatsappQueue:remove',{'UserId':_0x4ed2c3,'WhatsappQueueId':_0xed8379['id']});});});});});});})[_0x8fbe('0x24')](respondWithStatusCode(_0x3cc4a0,null))['catch'](handleError(_0x3cc4a0,null));};exports[_0x8fbe('0x80')]=function(_0x18f900,_0x1c4eda,_0xdb674){return db['WhatsappQueue'][_0x8fbe('0x46')]({'where':{'id':_0x18f900[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](handleEntityNotFound(_0x1c4eda,null))[_0x8fbe('0x24')](function(_0x3f8477){if(_0x3f8477){return _0x3f8477[_0x8fbe('0x80')](_0x18f900['body'][_0x8fbe('0x62')],_[_0x8fbe('0x81')](_0x18f900['body'],['ids','id'])||{})[_0x8fbe('0x82')](function(_0x12db38){for(var _0x1d1b8d=0x0;_0x1d1b8d<_0x18f900['body'][_0x8fbe('0x62')][_0x8fbe('0x36')];_0x1d1b8d+=0x1){socket[_0x8fbe('0x6a')]('userWhatsappQueue:save',{'UserId':Number(_0x18f900[_0x8fbe('0x48')][_0x8fbe('0x62')][_0x1d1b8d]),'WhatsappQueueId':Number(_0x18f900[_0x8fbe('0x43')]['id'])});}return _0x12db38;});}})['then'](respondWithResult(_0x1c4eda,null))[_0x8fbe('0x42')](handleError(_0x1c4eda,null));};exports[_0x8fbe('0x83')]=function(_0x3d8314,_0x15c687,_0x24ebe3){return db[_0x8fbe('0x2d')][_0x8fbe('0x46')]({'where':{'id':_0x3d8314[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](handleEntityNotFound(_0x15c687,null))[_0x8fbe('0x24')](function(_0x36f2e7){if(_0x36f2e7){return _0x36f2e7[_0x8fbe('0x83')](_0x3d8314[_0x8fbe('0x32')][_0x8fbe('0x62')])[_0x8fbe('0x24')](function(){if(_[_0x8fbe('0x84')](_0x3d8314[_0x8fbe('0x32')][_0x8fbe('0x62')])){for(var _0x4fe3b6=0x0;_0x4fe3b6<_0x3d8314[_0x8fbe('0x32')]['ids'][_0x8fbe('0x36')];_0x4fe3b6+=0x1){socket[_0x8fbe('0x6a')](_0x8fbe('0x85'),{'UserId':Number(_0x3d8314[_0x8fbe('0x32')][_0x8fbe('0x62')][_0x4fe3b6]),'WhatsappQueueId':Number(_0x3d8314['params']['id'])});}}else{socket['emit'](_0x8fbe('0x85'),{'UserId':Number(_0x3d8314[_0x8fbe('0x32')][_0x8fbe('0x62')]),'WhatsappQueueId':Number(_0x3d8314[_0x8fbe('0x43')]['id'])});}});}})['then'](respondWithStatusCode(_0x15c687,null))[_0x8fbe('0x42')](handleError(_0x15c687,null));};exports[_0x8fbe('0x86')]=function(_0x3b5f21,_0x5cdbd3,_0x2dec17){var _0x3f9484={};var _0x1d1efd={};var _0x37de20;var _0x15d894;return db[_0x8fbe('0x2d')][_0x8fbe('0x5e')]({'where':{'id':_0x3b5f21[_0x8fbe('0x43')]['id']}})[_0x8fbe('0x24')](handleEntityNotFound(_0x5cdbd3,null))[_0x8fbe('0x24')](function(_0x2d6981){if(_0x2d6981){_0x37de20=_0x2d6981;_0x1d1efd[_0x8fbe('0x31')]=_[_0x8fbe('0x44')](db[_0x8fbe('0x55')][_0x8fbe('0x2e')]);_0x1d1efd[_0x8fbe('0x32')]=_['keys'](_0x3b5f21[_0x8fbe('0x32')]);_0x1d1efd[_0x8fbe('0x3a')]=_['intersection'](_0x1d1efd[_0x8fbe('0x31')],_0x1d1efd[_0x8fbe('0x32')]);_0x3f9484[_0x8fbe('0x34')]=_[_0x8fbe('0x33')](_0x1d1efd[_0x8fbe('0x31')],qs['fields'](_0x3b5f21[_0x8fbe('0x32')][_0x8fbe('0x35')]));_0x3f9484['attributes']=_0x3f9484[_0x8fbe('0x34')][_0x8fbe('0x36')]?_0x3f9484[_0x8fbe('0x34')]:_0x1d1efd['model'];_0x3f9484[_0x8fbe('0x37')]=qs[_0x8fbe('0x38')](_0x3b5f21['query'][_0x8fbe('0x38')]);_0x3f9484[_0x8fbe('0x39')]=qs[_0x8fbe('0x3a')](_[_0x8fbe('0x3b')](_0x3b5f21[_0x8fbe('0x32')],_0x1d1efd['filters']));if(_0x3b5f21[_0x8fbe('0x32')][_0x8fbe('0x3c')]){_0x3f9484[_0x8fbe('0x39')]=_['merge'](_0x3f9484[_0x8fbe('0x39')],{'$or':_[_0x8fbe('0x2c')](_0x3f9484[_0x8fbe('0x34')],function(_0x27ab4f){var _0x4ec55e={};_0x4ec55e[_0x27ab4f]={'$like':'%'+_0x3b5f21[_0x8fbe('0x32')][_0x8fbe('0x3c')]+'%'};return _0x4ec55e;})});}_0x3f9484=_[_0x8fbe('0x3d')]({},_0x3f9484,_0x3b5f21[_0x8fbe('0x3f')]);return _0x37de20['getAgents'](_0x3f9484);}})[_0x8fbe('0x24')](function(_0x5f5603){if(_0x5f5603){_0x15d894=_0x5f5603[_0x8fbe('0x36')];if(!_0x3b5f21[_0x8fbe('0x32')][_0x8fbe('0x60')](_0x8fbe('0x53'))){_0x3f9484['limit']=qs[_0x8fbe('0x1d')](_0x3b5f21['query'][_0x8fbe('0x1d')]);_0x3f9484[_0x8fbe('0x1c')]=qs[_0x8fbe('0x1c')](_0x3b5f21[_0x8fbe('0x32')][_0x8fbe('0x1c')]);}return _0x37de20[_0x8fbe('0x86')](_0x3f9484);}})[_0x8fbe('0x24')](function(_0x3efa59){if(_0x3efa59){return _0x3efa59?{'count':_0x15d894,'rows':_0x3efa59}:null;}})[_0x8fbe('0x24')](respondWithResult(_0x5cdbd3,null))[_0x8fbe('0x42')](handleError(_0x5cdbd3,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b77aa35..1a9cc8b 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 _0x7e5e=['emit','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x34d03f,_0x193a7d){var _0x4bb6eb=function(_0x54e28e){while(--_0x54e28e){_0x34d03f['push'](_0x34d03f['shift']());}};_0x4bb6eb(++_0x193a7d);}(_0x7e5e,0x1f1));var _0xe7e5=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x7e5e[_0x737a1f];return _0x16eba1;};'use strict';var EventEmitter=require(_0xe7e5('0x0'));var WhatsappQueue=require(_0xe7e5('0x1'))['db'][_0xe7e5('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xe7e5('0x3')](0x0);var events={'afterCreate':_0xe7e5('0x4'),'afterUpdate':_0xe7e5('0x5'),'afterDestroy':_0xe7e5('0x6')};function emitEvent(_0x4b7c9d){return function(_0x13479c,_0x4a3106,_0x140173){WhatsappQueueEvents[_0xe7e5('0x7')](_0x4b7c9d+':'+_0x13479c['id'],_0x13479c);WhatsappQueueEvents['emit'](_0x4b7c9d,_0x13479c);_0x140173(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xe7e5('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x7073=['update','emit','hook','exports','events','WhatsappQueue','save'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0x7073,0x138));var _0x3707=function(_0x58cb81,_0x189b06){_0x58cb81=_0x58cb81-0x0;var _0xf87f0f=_0x7073[_0x58cb81];return _0xf87f0f;};'use strict';var EventEmitter=require(_0x3707('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x3707('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3707('0x2'),'afterUpdate':_0x3707('0x3'),'afterDestroy':'remove'};function emitEvent(_0x471913){return function(_0x5b156a,_0x2bd34f,_0x4d1b4d){WhatsappQueueEvents[_0x3707('0x4')](_0x471913+':'+_0x5b156a['id'],_0x5b156a);WhatsappQueueEvents[_0x3707('0x4')](_0x471913,_0x5b156a);_0x4d1b4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x3707('0x5')](e,emitEvent(event));}}module[_0x3707('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 4a169da..653f3fc 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 _0x3713=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','request-promise','path','define'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3713,0x1bb));var _0x3371=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x3713[_0x2d126e];return _0xcb04d3;};'use strict';var _=require(_0x3371('0x0'));var util=require(_0x3371('0x1'));var logger=require(_0x3371('0x2'))(_0x3371('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3371('0x4'));var fs=require('fs');var path=require(_0x3371('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x4d7d24,_0x59032c){return _0x4d7d24[_0x3371('0x6')](_0x3371('0x7'),attributes,{'tableName':_0x3371('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b20=['moment','bluebird','path','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','../../config/logger','api'];(function(_0x5d24dc,_0x489275){var _0x52d7a1=function(_0x462cb7){while(--_0x462cb7){_0x5d24dc['push'](_0x5d24dc['shift']());}};_0x52d7a1(++_0x489275);}(_0x6b20,0x1b5));var _0x06b2=function(_0x1e8abd,_0x2e9d22){_0x1e8abd=_0x1e8abd-0x0;var _0x34302d=_0x6b20[_0x1e8abd];return _0x34302d;};'use strict';var _=require(_0x06b2('0x0'));var util=require('util');var logger=require(_0x06b2('0x1'))(_0x06b2('0x2'));var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x06b2('0x5'));var rimraf=require('rimraf');var config=require(_0x06b2('0x6'));var attributes=require(_0x06b2('0x7'));module[_0x06b2('0x8')]=function(_0x41a10c,_0x239d04){return _0x41a10c[_0x06b2('0x9')]('WhatsappQueue',attributes,{'tableName':_0x06b2('0xa'),'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 15726e3..2c26d68 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 _0x4edb=['register','request','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowWhatsappQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket'];(function(_0x2d7320,_0xdd10b9){var _0x1cbe09=function(_0x5d69a8){while(--_0x5d69a8){_0x2d7320['push'](_0x2d7320['shift']());}};_0x1cbe09(++_0xdd10b9);}(_0x4edb,0x161));var _0xb4ed=function(_0x3fa59c,_0x2302f9){_0x3fa59c=_0x3fa59c-0x0;var _0x239a2c=_0x4edb[_0x3fa59c];return _0x239a2c;};'use strict';var _=require(_0xb4ed('0x0'));var util=require(_0xb4ed('0x1'));var moment=require(_0xb4ed('0x2'));var BPromise=require(_0xb4ed('0x3'));var rs=require(_0xb4ed('0x4'));var fs=require('fs');var Redis=require(_0xb4ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb4ed('0x6'))('rpc');var config=require(_0xb4ed('0x7'));var jayson=require(_0xb4ed('0x8'));var client=jayson[_0xb4ed('0x9')][_0xb4ed('0xa')]({'port':0x232a});config[_0xb4ed('0xb')]=_[_0xb4ed('0xc')](config[_0xb4ed('0xb')],{'host':_0xb4ed('0xd'),'port':0x18eb});var socket=require(_0xb4ed('0xe'))(new Redis(config[_0xb4ed('0xb')]));require(_0xb4ed('0xf'))[_0xb4ed('0x10')](socket);function respondWithRpcPromise(_0xb56694,_0x2e5983,_0x37d4df){return new BPromise(function(_0x21522b,_0x54ed6e){return client[_0xb4ed('0x11')](_0xb56694,_0x37d4df)['then'](function(_0x1bfeea){logger[_0xb4ed('0x12')](_0xb4ed('0x13'),_0x2e5983,'request\x20sent');logger[_0xb4ed('0x14')](_0xb4ed('0x15'),_0x2e5983,_0xb4ed('0x16'),JSON[_0xb4ed('0x17')](_0x1bfeea));if(_0x1bfeea[_0xb4ed('0x18')]){if(_0x1bfeea['error']['code']===0x1f4){logger[_0xb4ed('0x18')](_0xb4ed('0x13'),_0x2e5983,_0x1bfeea[_0xb4ed('0x18')][_0xb4ed('0x19')]);return _0x54ed6e(_0x1bfeea[_0xb4ed('0x18')][_0xb4ed('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2e5983,_0x1bfeea[_0xb4ed('0x18')]['message']);return _0x21522b(_0x1bfeea['error'][_0xb4ed('0x19')]);}else{logger['info'](_0xb4ed('0x13'),_0x2e5983,_0xb4ed('0x16'));_0x21522b(_0x1bfeea[_0xb4ed('0x1a')]['message']);}})[_0xb4ed('0x1b')](function(_0x1794cb){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2e5983,_0x1794cb);_0x54ed6e(_0x1794cb);});});}exports[_0xb4ed('0x1c')]=function(_0x591bea){var _0x5c966e=this;return new Promise(function(_0x32098f,_0x5d96f8){return db[_0xb4ed('0x1d')][_0xb4ed('0x1e')]({'raw':_0x591bea[_0xb4ed('0x1f')]?_0x591bea[_0xb4ed('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x591bea[_0xb4ed('0x1f')]?_0x591bea[_0xb4ed('0x1f')][_0xb4ed('0x20')]||null:null,'attributes':_0x591bea[_0xb4ed('0x1f')]?_0x591bea[_0xb4ed('0x1f')][_0xb4ed('0x21')]||null:null,'limit':_0x591bea[_0xb4ed('0x1f')]?_0x591bea['options'][_0xb4ed('0x22')]||null:null,'include':_0x591bea[_0xb4ed('0x1f')]?_0x591bea[_0xb4ed('0x1f')][_0xb4ed('0x23')]?_[_0xb4ed('0x24')](_0x591bea[_0xb4ed('0x1f')][_0xb4ed('0x23')],function(_0x401343){return{'model':db[_0x401343['model']],'as':_0x401343['as'],'attributes':_0x401343[_0xb4ed('0x21')],'include':_0x401343[_0xb4ed('0x23')]?_[_0xb4ed('0x24')](_0x401343[_0xb4ed('0x23')],function(_0x5e11c7){return{'model':db[_0x5e11c7[_0xb4ed('0x25')]],'as':_0x5e11c7['as'],'attributes':_0x5e11c7[_0xb4ed('0x21')],'include':_0x5e11c7[_0xb4ed('0x23')]?_[_0xb4ed('0x24')](_0x5e11c7['include'],function(_0xe6fdec){return{'model':db[_0xe6fdec[_0xb4ed('0x25')]],'as':_0xe6fdec['as'],'attributes':_0xe6fdec[_0xb4ed('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb4ed('0x26')](function(_0x2f2868){logger[_0xb4ed('0x12')]('GetWhatsappQueue',_0x591bea);logger[_0xb4ed('0x14')](_0xb4ed('0x1c'),_0x591bea,JSON[_0xb4ed('0x17')](_0x2f2868));_0x32098f(_0x2f2868);})['catch'](function(_0xf5dbaf){logger[_0xb4ed('0x18')](_0xb4ed('0x1c'),_0xf5dbaf[_0xb4ed('0x19')],_0x591bea);_0x5d96f8(_0x5c966e[_0xb4ed('0x18')](0x1f4,_0xf5dbaf[_0xb4ed('0x19')]));});});};exports[_0xb4ed('0x27')]=function(_0x24d295){var _0x1f03e5=this;return new Promise(function(_0x5156a9,_0xefb886){return db[_0xb4ed('0x1d')]['find']({'raw':_0x24d295['options']?_0x24d295[_0xb4ed('0x1f')][_0xb4ed('0x28')]===undefined?!![]:![]:!![],'where':_0x24d295[_0xb4ed('0x1f')]?_0x24d295[_0xb4ed('0x1f')][_0xb4ed('0x20')]||null:null,'attributes':_0x24d295['options']?_0x24d295['options'][_0xb4ed('0x21')]||null:null,'include':_0x24d295[_0xb4ed('0x1f')]?_0x24d295['options'][_0xb4ed('0x23')]?_['map'](_0x24d295[_0xb4ed('0x1f')][_0xb4ed('0x23')],function(_0x57b943){return{'model':db[_0x57b943['model']],'as':_0x57b943['as'],'attributes':_0x57b943[_0xb4ed('0x21')],'include':_0x57b943[_0xb4ed('0x23')]?_[_0xb4ed('0x24')](_0x57b943[_0xb4ed('0x23')],function(_0x41dbf4){return{'model':db[_0x41dbf4[_0xb4ed('0x25')]],'as':_0x41dbf4['as'],'attributes':_0x41dbf4['attributes'],'include':_0x41dbf4['include']?_[_0xb4ed('0x24')](_0x41dbf4[_0xb4ed('0x23')],function(_0x51cb0c){return{'model':db[_0x51cb0c[_0xb4ed('0x25')]],'as':_0x51cb0c['as'],'attributes':_0x51cb0c[_0xb4ed('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb4ed('0x26')](function(_0x1bef5d){logger['info'](_0xb4ed('0x27'),_0x24d295);logger[_0xb4ed('0x14')](_0xb4ed('0x27'),_0x24d295,JSON[_0xb4ed('0x17')](_0x1bef5d));_0x5156a9(_0x1bef5d);})[_0xb4ed('0x1b')](function(_0xdad49){logger[_0xb4ed('0x18')](_0xb4ed('0x27'),_0xdad49[_0xb4ed('0x19')],_0x24d295);_0xefb886(_0x1f03e5[_0xb4ed('0x18')](0x1f4,_0xdad49[_0xb4ed('0x19')]));});});}; \ No newline at end of file +var _0xb4c6=['debug','find','ShowWhatsappQueue','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','then','info','request\x20sent','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','limit','include','map','model','attributes'];(function(_0x4d7113,_0x1dece0){var _0x40e6c7=function(_0x466d0){while(--_0x466d0){_0x4d7113['push'](_0x4d7113['shift']());}};_0x40e6c7(++_0x1dece0);}(_0xb4c6,0x1bc));var _0x6b4c=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0xb4c6[_0x29d623];return _0x242e59;};'use strict';var _=require(_0x6b4c('0x0'));var util=require(_0x6b4c('0x1'));var moment=require(_0x6b4c('0x2'));var BPromise=require(_0x6b4c('0x3'));var rs=require(_0x6b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b4c('0x5'))['db'];var utils=require(_0x6b4c('0x6'));var logger=require(_0x6b4c('0x7'))(_0x6b4c('0x8'));var config=require(_0x6b4c('0x9'));var jayson=require(_0x6b4c('0xa'));var client=jayson[_0x6b4c('0xb')][_0x6b4c('0xc')]({'port':0x232a});config[_0x6b4c('0xd')]=_[_0x6b4c('0xe')](config[_0x6b4c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b4c('0xf'))(new Redis(config[_0x6b4c('0xd')]));require(_0x6b4c('0x10'))['register'](socket);function respondWithRpcPromise(_0x2f9a02,_0x327cde,_0x2f5f51){return new BPromise(function(_0xa502,_0x228c65){return client['request'](_0x2f9a02,_0x2f5f51)[_0x6b4c('0x11')](function(_0x29219e){logger[_0x6b4c('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x327cde,_0x6b4c('0x13'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x327cde,'request\x20sent',JSON['stringify'](_0x29219e));if(_0x29219e[_0x6b4c('0x14')]){if(_0x29219e['error'][_0x6b4c('0x15')]===0x1f4){logger[_0x6b4c('0x14')](_0x6b4c('0x16'),_0x327cde,_0x29219e[_0x6b4c('0x14')]['message']);return _0x228c65(_0x29219e[_0x6b4c('0x14')][_0x6b4c('0x17')]);}logger['error'](_0x6b4c('0x16'),_0x327cde,_0x29219e[_0x6b4c('0x14')]['message']);return _0xa502(_0x29219e[_0x6b4c('0x14')][_0x6b4c('0x17')]);}else{logger[_0x6b4c('0x12')](_0x6b4c('0x16'),_0x327cde,_0x6b4c('0x13'));_0xa502(_0x29219e[_0x6b4c('0x18')][_0x6b4c('0x17')]);}})[_0x6b4c('0x19')](function(_0x290614){logger['error'](_0x6b4c('0x16'),_0x327cde,_0x290614);_0x228c65(_0x290614);});});}exports[_0x6b4c('0x1a')]=function(_0x543071){var _0x256838=this;return new Promise(function(_0x532543,_0x52abcc){return db[_0x6b4c('0x1b')]['findAll']({'raw':_0x543071[_0x6b4c('0x1c')]?_0x543071[_0x6b4c('0x1c')][_0x6b4c('0x1d')]===undefined?!![]:![]:!![],'where':_0x543071[_0x6b4c('0x1c')]?_0x543071[_0x6b4c('0x1c')][_0x6b4c('0x1e')]||null:null,'attributes':_0x543071['options']?_0x543071[_0x6b4c('0x1c')]['attributes']||null:null,'limit':_0x543071['options']?_0x543071[_0x6b4c('0x1c')][_0x6b4c('0x1f')]||null:null,'include':_0x543071['options']?_0x543071[_0x6b4c('0x1c')][_0x6b4c('0x20')]?_[_0x6b4c('0x21')](_0x543071['options'][_0x6b4c('0x20')],function(_0x1103ca){return{'model':db[_0x1103ca[_0x6b4c('0x22')]],'as':_0x1103ca['as'],'attributes':_0x1103ca[_0x6b4c('0x23')],'include':_0x1103ca[_0x6b4c('0x20')]?_['map'](_0x1103ca[_0x6b4c('0x20')],function(_0x1e9659){return{'model':db[_0x1e9659['model']],'as':_0x1e9659['as'],'attributes':_0x1e9659['attributes'],'include':_0x1e9659['include']?_['map'](_0x1e9659[_0x6b4c('0x20')],function(_0x59dc93){return{'model':db[_0x59dc93['model']],'as':_0x59dc93['as'],'attributes':_0x59dc93[_0x6b4c('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47a5f8){logger[_0x6b4c('0x12')](_0x6b4c('0x1a'),_0x543071);logger[_0x6b4c('0x24')](_0x6b4c('0x1a'),_0x543071,JSON['stringify'](_0x47a5f8));_0x532543(_0x47a5f8);})[_0x6b4c('0x19')](function(_0x1c0eac){logger[_0x6b4c('0x14')](_0x6b4c('0x1a'),_0x1c0eac[_0x6b4c('0x17')],_0x543071);_0x52abcc(_0x256838['error'](0x1f4,_0x1c0eac['message']));});});};exports['ShowWhatsappQueue']=function(_0x1c04b2){var _0x4100e1=this;return new Promise(function(_0x309a14,_0x198180){return db['WhatsappQueue'][_0x6b4c('0x25')]({'raw':_0x1c04b2[_0x6b4c('0x1c')]?_0x1c04b2[_0x6b4c('0x1c')][_0x6b4c('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c04b2[_0x6b4c('0x1c')]?_0x1c04b2[_0x6b4c('0x1c')][_0x6b4c('0x1e')]||null:null,'attributes':_0x1c04b2['options']?_0x1c04b2['options'][_0x6b4c('0x23')]||null:null,'include':_0x1c04b2[_0x6b4c('0x1c')]?_0x1c04b2[_0x6b4c('0x1c')][_0x6b4c('0x20')]?_[_0x6b4c('0x21')](_0x1c04b2[_0x6b4c('0x1c')]['include'],function(_0x3f4918){return{'model':db[_0x3f4918[_0x6b4c('0x22')]],'as':_0x3f4918['as'],'attributes':_0x3f4918[_0x6b4c('0x23')],'include':_0x3f4918['include']?_[_0x6b4c('0x21')](_0x3f4918[_0x6b4c('0x20')],function(_0x32d385){return{'model':db[_0x32d385[_0x6b4c('0x22')]],'as':_0x32d385['as'],'attributes':_0x32d385[_0x6b4c('0x23')],'include':_0x32d385['include']?_[_0x6b4c('0x21')](_0x32d385[_0x6b4c('0x20')],function(_0xeb4cdb){return{'model':db[_0xeb4cdb[_0x6b4c('0x22')]],'as':_0xeb4cdb['as'],'attributes':_0xeb4cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b4c('0x11')](function(_0x496bb0){logger[_0x6b4c('0x12')](_0x6b4c('0x26'),_0x1c04b2);logger[_0x6b4c('0x24')](_0x6b4c('0x26'),_0x1c04b2,JSON[_0x6b4c('0x27')](_0x496bb0));_0x309a14(_0x496bb0);})['catch'](function(_0x382aed){logger[_0x6b4c('0x14')](_0x6b4c('0x26'),_0x382aed['message'],_0x1c04b2);_0x198180(_0x4100e1['error'](0x1f4,_0x382aed[_0x6b4c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9f145e8..14b2e97 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 _0x38fb=['length','whatsappQueue:','remove','update','emit'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0x38fb,0xe3));var _0xb38f=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0x38fb[_0x254081];return _0x5d1e2a;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xb38f('0x0'),_0xb38f('0x1')];function createListener(_0x580122,_0x27023d){return function(_0x7a5adc){_0x27023d[_0xb38f('0x2')](_0x580122,_0x7a5adc);};}function removeListener(_0x3566a3,_0x196ecb){return function(){WhatsappQueueEvents['removeListener'](_0x3566a3,_0x196ecb);};}exports['register']=function(_0x4e184c){for(var _0xd818da=0x0,_0x19626d=events[_0xb38f('0x3')];_0xd818da<_0x19626d;_0xd818da++){var _0x52809c=events[_0xd818da];var _0x13bc79=createListener(_0xb38f('0x4')+_0x52809c,_0x4e184c);WhatsappQueueEvents['on'](_0x52809c,_0x13bc79);}}; \ No newline at end of file +var _0xfca3=['update','removeListener','register','length','save','remove'];(function(_0x2359d5,_0x30ab3f){var _0x2f013c=function(_0x26e3d3){while(--_0x26e3d3){_0x2359d5['push'](_0x2359d5['shift']());}};_0x2f013c(++_0x30ab3f);}(_0xfca3,0x9a));var _0x3fca=function(_0x5b2239,_0x5c4a38){_0x5b2239=_0x5b2239-0x0;var _0x566d96=_0xfca3[_0x5b2239];return _0x566d96;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x3fca('0x0'),_0x3fca('0x1'),_0x3fca('0x2')];function createListener(_0x233f55,_0x5bd1de){return function(_0xf6ed1d){_0x5bd1de['emit'](_0x233f55,_0xf6ed1d);};}function removeListener(_0x41301d,_0x92fe70){return function(){WhatsappQueueEvents[_0x3fca('0x3')](_0x41301d,_0x92fe70);};}exports[_0x3fca('0x4')]=function(_0x415dc5){for(var _0xfc7936=0x0,_0x22f124=events[_0x3fca('0x5')];_0xfc7936<_0x22f124;_0xfc7936++){var _0x3d5748=events[_0xfc7936];var _0x256b02=createListener('whatsappQueue:'+_0x3d5748,_0x415dc5);WhatsappQueueEvents['on'](_0x3d5748,_0x256b02);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index eac7574..f105618 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 _0x0e5a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','describe','/:id','show','post','put','isAuthenticated','multer'];(function(_0x21029a,_0x3d080e){var _0x115e43=function(_0x1d3980){while(--_0x1d3980){_0x21029a['push'](_0x21029a['shift']());}};_0x115e43(++_0x3d080e);}(_0x0e5a,0xff));var _0xa0e5=function(_0x401a82,_0x4b2a07){_0x401a82=_0x401a82-0x0;var _0x275448=_0x0e5a[_0x401a82];return _0x275448;};'use strict';var multer=require(_0xa0e5('0x0'));var util=require(_0xa0e5('0x1'));var path=require(_0xa0e5('0x2'));var timeout=require(_0xa0e5('0x3'));var express=require(_0xa0e5('0x4'));var router=express['Router']();var fs_extra=require(_0xa0e5('0x5'));var auth=require(_0xa0e5('0x6'));var interaction=require(_0xa0e5('0x7'));var config=require(_0xa0e5('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xa0e5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa0e5('0xa')]);router[_0xa0e5('0x9')](_0xa0e5('0xb'),auth['isAuthenticated'](),controller[_0xa0e5('0xc')]);router[_0xa0e5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa0e5('0xe')](_0xa0e5('0xb'),auth[_0xa0e5('0xf')](),controller['update']);router['delete']('/:id',auth[_0xa0e5('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfa0a=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy'];(function(_0x6099bf,_0x56f92e){var _0x30b7f5=function(_0xce5fd7){while(--_0xce5fd7){_0x6099bf['push'](_0x6099bf['shift']());}};_0x30b7f5(++_0x56f92e);}(_0xfa0a,0x119));var _0xafa0=function(_0x195919,_0x177c79){_0x195919=_0x195919-0x0;var _0x2aa39d=_0xfa0a[_0x195919];return _0x2aa39d;};'use strict';var multer=require(_0xafa0('0x0'));var util=require('util');var path=require(_0xafa0('0x1'));var timeout=require(_0xafa0('0x2'));var express=require(_0xafa0('0x3'));var router=express[_0xafa0('0x4')]();var fs_extra=require(_0xafa0('0x5'));var auth=require(_0xafa0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xafa0('0x7'));var controller=require(_0xafa0('0x8'));router[_0xafa0('0x9')]('/',auth[_0xafa0('0xa')](),controller[_0xafa0('0xb')]);router[_0xafa0('0x9')](_0xafa0('0xc'),auth[_0xafa0('0xa')](),controller[_0xafa0('0xd')]);router[_0xafa0('0x9')](_0xafa0('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xafa0('0xf')]);router[_0xafa0('0x10')](_0xafa0('0xe'),auth[_0xafa0('0xa')](),controller['update']);router[_0xafa0('0x11')](_0xafa0('0xe'),auth[_0xafa0('0xa')](),controller[_0xafa0('0x12')]);module[_0xafa0('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 1b1f881..a426255 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4d3002,_0x325fc1){var _0x473b7f=function(_0x4ac017){while(--_0x4ac017){_0x4d3002['push'](_0x4d3002['shift']());}};_0x473b7f(++_0x325fc1);}(_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 +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x10d655,_0x365ac1){var _0xdcedff=function(_0x54e800){while(--_0x54e800){_0x10d655['push'](_0x10d655['shift']());}};_0xdcedff(++_0x365ac1);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 4c82d10..715ddda 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x2032,0xd9));var _0x2203=function(_0x388d1e,_0x3f18e5){_0x388d1e=_0x388d1e-0x0;var _0x5368e4=_0x2032[_0x388d1e];return _0x5368e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['WhatsappQueueReport'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['WhatsappQueueReport']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['WhatsappQueueReport'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};exports['describe']=function(_0x49999a,_0x4064d5){return db[_0x2203('0x2c')]['describe']()[_0x2203('0x23')](respondWithResult(_0x4064d5,null))[_0x2203('0x46')](handleError(_0x4064d5,null));}; \ No newline at end of file +var _0xb62e=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','show','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xeb62('0x0'));var rimraf=require(_0xeb62('0x1'));var zipdir=require(_0xeb62('0x2'));var jsonpatch=require(_0xeb62('0x3'));var rp=require('request-promise');var moment=require(_0xeb62('0x4'));var BPromise=require(_0xeb62('0x5'));var Mustache=require(_0xeb62('0x6'));var util=require(_0xeb62('0x7'));var path=require(_0xeb62('0x8'));var sox=require(_0xeb62('0x9'));var csv=require('to-csv');var ejs=require(_0xeb62('0xa'));var fs=require('fs');var fs_extra=require(_0xeb62('0xb'));var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb62('0x11'));var authService=require(_0xeb62('0x12'));var qs=require(_0xeb62('0x13'));var as=require(_0xeb62('0x14'));var hardwareService=require(_0xeb62('0x15'));var logger=require(_0xeb62('0x16'))(_0xeb62('0x17'));var utils=require(_0xeb62('0x18'));var config=require(_0xeb62('0x19'));var licenseUtil=require(_0xeb62('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x422daf,_0xcc11c4){_0xcc11c4=_0xcc11c4||0xcc;return function(_0x27671e){if(_0x27671e){return _0x422daf[_0xeb62('0x1b')](_0xcc11c4);}return _0x422daf['status'](_0xcc11c4)[_0xeb62('0x1c')]();};}function respondWithResult(_0x2fbad2,_0x23fb15){_0x23fb15=_0x23fb15||0xc8;return function(_0x4da178){if(_0x4da178){return _0x2fbad2[_0xeb62('0x1d')](_0x23fb15)[_0xeb62('0x1e')](_0x4da178);}};}function respondWithFilteredResult(_0x2fd4c7,_0x4ce9fa){return function(_0x1f6a1f){if(_0x1f6a1f){var _0x15b3e8=typeof _0x4ce9fa[_0xeb62('0x1f')]===_0xeb62('0x20')&&typeof _0x4ce9fa[_0xeb62('0x21')]===_0xeb62('0x20');var _0x1fb460=_0x1f6a1f[_0xeb62('0x22')];var _0x39b138=_0x15b3e8?0x0:_0x4ce9fa[_0xeb62('0x1f')];var _0x27efc8=_0x15b3e8?_0x1f6a1f[_0xeb62('0x22')]:_0x4ce9fa[_0xeb62('0x1f')]+_0x4ce9fa['limit'];var _0x38c5e4;if(_0x27efc8>=_0x1fb460){_0x27efc8=_0x1fb460;_0x38c5e4=0xc8;}else{_0x38c5e4=0xce;}_0x2fd4c7[_0xeb62('0x1d')](_0x38c5e4);return _0x2fd4c7[_0xeb62('0x23')](_0xeb62('0x24'),_0x39b138+'-'+_0x27efc8+'/'+_0x1fb460)[_0xeb62('0x1e')](_0x1f6a1f);}return null;};}function patchUpdates(_0x24cbf3){return function(_0x2ed96d){try{jsonpatch['apply'](_0x2ed96d,_0x24cbf3,!![]);}catch(_0x599d0b){return BPromise[_0xeb62('0x25')](_0x599d0b);}return _0x2ed96d[_0xeb62('0x26')]();};}function saveUpdates(_0x11ed9c,_0x13243f){return function(_0x122b15){if(_0x122b15){return _0x122b15['update'](_0x11ed9c)['then'](function(_0x4664ce){return _0x4664ce;});}return null;};}function removeEntity(_0x132861,_0x182781){return function(_0x395b70){if(_0x395b70){return _0x395b70['destroy']()['then'](function(){_0x132861[_0xeb62('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x448327,_0x4b0f46){return function(_0xfe3e16){if(!_0xfe3e16){_0x448327['sendStatus'](0x194);}return _0xfe3e16;};}function handleError(_0x3ac28c,_0x6bfbbc){_0x6bfbbc=_0x6bfbbc||0x1f4;return function(_0x46d1bb){logger['error'](_0x46d1bb[_0xeb62('0x27')]);if(_0x46d1bb[_0xeb62('0x28')]){delete _0x46d1bb[_0xeb62('0x28')];}_0x3ac28c[_0xeb62('0x1d')](_0x6bfbbc)[_0xeb62('0x29')](_0x46d1bb);};}exports[_0xeb62('0x2a')]=function(_0x511202,_0x192517){var _0x1616ee={},_0x57169a={},_0x157474={'count':0x0,'rows':[]};var _0x2b51b2=_[_0xeb62('0x2b')](db[_0xeb62('0x2c')][_0xeb62('0x2d')],function(_0x5195bf){return{'name':_0x5195bf['fieldName'],'type':_0x5195bf[_0xeb62('0x2e')][_0xeb62('0x2f')]};});_0x57169a[_0xeb62('0x30')]=_[_0xeb62('0x2b')](_0x2b51b2,_0xeb62('0x28'));_0x57169a[_0xeb62('0x31')]=_[_0xeb62('0x32')](_0x511202['query']);_0x57169a[_0xeb62('0x33')]=_['intersection'](_0x57169a['model'],_0x57169a[_0xeb62('0x31')]);_0x1616ee[_0xeb62('0x34')]=_['intersection'](_0x57169a[_0xeb62('0x30')],qs['fields'](_0x511202[_0xeb62('0x31')][_0xeb62('0x35')]));_0x1616ee['attributes']=_0x1616ee[_0xeb62('0x34')][_0xeb62('0x36')]?_0x1616ee['attributes']:_0x57169a[_0xeb62('0x30')];if(!_0x511202[_0xeb62('0x31')][_0xeb62('0x37')](_0xeb62('0x38'))){_0x1616ee['limit']=qs[_0xeb62('0x21')](_0x511202[_0xeb62('0x31')]['limit']);_0x1616ee['offset']=qs[_0xeb62('0x1f')](_0x511202[_0xeb62('0x31')]['offset']);}_0x1616ee[_0xeb62('0x39')]=qs[_0xeb62('0x3a')](_0x511202[_0xeb62('0x31')][_0xeb62('0x3a')]);_0x1616ee[_0xeb62('0x3b')]=qs[_0xeb62('0x33')](_[_0xeb62('0x3c')](_0x511202['query'],_0x57169a['filters']),_0x2b51b2);if(_0x511202[_0xeb62('0x31')][_0xeb62('0x3d')]){_0x1616ee[_0xeb62('0x3b')]=_[_0xeb62('0x3e')](_0x1616ee['where'],{'$or':_[_0xeb62('0x2b')](_0x2b51b2,function(_0x510c7d){if(_0x510c7d[_0xeb62('0x2e')]!==_0xeb62('0x3f')){var _0x2dac2f={};_0x2dac2f[_0x510c7d[_0xeb62('0x28')]]={'$like':'%'+_0x511202[_0xeb62('0x31')][_0xeb62('0x3d')]+'%'};return _0x2dac2f;}})});}_0x1616ee=_[_0xeb62('0x3e')]({},_0x1616ee,_0x511202[_0xeb62('0x40')]);var _0x5e8ef8={'where':_0x1616ee[_0xeb62('0x3b')]};return db[_0xeb62('0x2c')][_0xeb62('0x22')](_0x5e8ef8)[_0xeb62('0x41')](function(_0x5dd0e3){_0x157474['count']=_0x5dd0e3;if(_0x511202[_0xeb62('0x31')][_0xeb62('0x42')]){_0x1616ee['include']=[{'all':!![]}];}return db[_0xeb62('0x2c')][_0xeb62('0x43')](_0x1616ee);})['then'](function(_0x25e9f0){_0x157474['rows']=_0x25e9f0;return _0x157474;})[_0xeb62('0x41')](respondWithFilteredResult(_0x192517,_0x1616ee))['catch'](handleError(_0x192517,null));};exports[_0xeb62('0x44')]=function(_0x5dde1d,_0x2bf77f){var _0x609b2d={'raw':!![],'where':{'id':_0x5dde1d['params']['id']}},_0x317f50={};_0x317f50['model']=_[_0xeb62('0x32')](db[_0xeb62('0x2c')][_0xeb62('0x2d')]);_0x317f50[_0xeb62('0x31')]=_[_0xeb62('0x32')](_0x5dde1d['query']);_0x317f50[_0xeb62('0x33')]=_['intersection'](_0x317f50[_0xeb62('0x30')],_0x317f50['query']);_0x609b2d[_0xeb62('0x34')]=_['intersection'](_0x317f50[_0xeb62('0x30')],qs['fields'](_0x5dde1d[_0xeb62('0x31')][_0xeb62('0x35')]));_0x609b2d[_0xeb62('0x34')]=_0x609b2d[_0xeb62('0x34')][_0xeb62('0x36')]?_0x609b2d[_0xeb62('0x34')]:_0x317f50['model'];if(_0x5dde1d[_0xeb62('0x31')][_0xeb62('0x42')]){_0x609b2d['include']=[{'all':!![]}];}_0x609b2d=_['merge']({},_0x609b2d,_0x5dde1d['options']);return db['WhatsappQueueReport'][_0xeb62('0x45')](_0x609b2d)[_0xeb62('0x41')](handleEntityNotFound(_0x2bf77f,null))['then'](respondWithResult(_0x2bf77f,null))[_0xeb62('0x46')](handleError(_0x2bf77f,null));};exports[_0xeb62('0x47')]=function(_0x412e93,_0x16e262){return db[_0xeb62('0x2c')]['create'](_0x412e93[_0xeb62('0x48')],{})['then'](respondWithResult(_0x16e262,0xc9))[_0xeb62('0x46')](handleError(_0x16e262,null));};exports[_0xeb62('0x49')]=function(_0x7fb53f,_0x18c40d){if(_0x7fb53f[_0xeb62('0x48')]['id']){delete _0x7fb53f[_0xeb62('0x48')]['id'];}return db[_0xeb62('0x2c')][_0xeb62('0x45')]({'where':{'id':_0x7fb53f[_0xeb62('0x4a')]['id']}})[_0xeb62('0x41')](handleEntityNotFound(_0x18c40d,null))[_0xeb62('0x41')](saveUpdates(_0x7fb53f[_0xeb62('0x48')],null))['then'](respondWithResult(_0x18c40d,null))[_0xeb62('0x46')](handleError(_0x18c40d,null));};exports['destroy']=function(_0x4edd8c,_0x2dcb2d){return db[_0xeb62('0x2c')]['find']({'where':{'id':_0x4edd8c[_0xeb62('0x4a')]['id']}})[_0xeb62('0x41')](handleEntityNotFound(_0x2dcb2d,null))['then'](removeEntity(_0x2dcb2d,null))[_0xeb62('0x46')](handleError(_0x2dcb2d,null));};exports[_0xeb62('0x4b')]=function(_0x20b73b,_0x60617){return db[_0xeb62('0x2c')][_0xeb62('0x4b')]()[_0xeb62('0x41')](respondWithResult(_0x60617,null))[_0xeb62('0x46')](handleError(_0x60617,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 3eaf89c..3219f71 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 _0x3486=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport'];(function(_0x3e5016,_0x849b89){var _0x33fc0b=function(_0x22b681){while(--_0x22b681){_0x3e5016['push'](_0x3e5016['shift']());}};_0x33fc0b(++_0x849b89);}(_0x3486,0x1b5));var _0x6348=function(_0x25738b,_0x4c5218){_0x25738b=_0x25738b-0x0;var _0x4a8d51=_0x3486[_0x25738b];return _0x4a8d51;};'use strict';var _=require(_0x6348('0x0'));var util=require(_0x6348('0x1'));var logger=require(_0x6348('0x2'))(_0x6348('0x3'));var moment=require(_0x6348('0x4'));var BPromise=require(_0x6348('0x5'));var rp=require(_0x6348('0x6'));var fs=require('fs');var path=require(_0x6348('0x7'));var rimraf=require(_0x6348('0x8'));var config=require(_0x6348('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0x6348('0xa')]=function(_0x1770f9,_0x186d94){return _0x1770f9[_0x6348('0xb')](_0x6348('0xc'),attributes,{'tableName':_0x6348('0xd'),'paranoid':![],'indexes':[{'name':_0x6348('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xca62=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xca62,0x10a));var _0x2ca6=function(_0x5b5eb9,_0x50619d){_0x5b5eb9=_0x5b5eb9-0x0;var _0x4e6512=_0xca62[_0x5b5eb9];return _0x4e6512;};'use strict';var _=require(_0x2ca6('0x0'));var util=require(_0x2ca6('0x1'));var logger=require(_0x2ca6('0x2'))(_0x2ca6('0x3'));var moment=require(_0x2ca6('0x4'));var BPromise=require(_0x2ca6('0x5'));var rp=require(_0x2ca6('0x6'));var fs=require('fs');var path=require(_0x2ca6('0x7'));var rimraf=require('rimraf');var config=require(_0x2ca6('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x2ca6('0x9')]=function(_0x41e5f2,_0x31d09e){return _0x41e5f2[_0x2ca6('0xa')](_0x2ca6('0xb'),attributes,{'tableName':_0x2ca6('0xc'),'paranoid':![],'indexes':[{'name':_0x2ca6('0xd'),'fields':[_0x2ca6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 20a1ce0..3f1a1a5 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 _0xa320=['error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','options','catch','UpdateWhatsappQueueReport','update','body','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa320,0x1df));var _0x0a32=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xa320[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x0a32('0x0'));var util=require(_0x0a32('0x1'));var moment=require(_0x0a32('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a32('0x3'));var db=require(_0x0a32('0x4'))['db'];var utils=require(_0x0a32('0x5'));var logger=require('../../config/logger')(_0x0a32('0x6'));var config=require(_0x0a32('0x7'));var jayson=require(_0x0a32('0x8'));var client=jayson['client'][_0x0a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x681322,_0x501d13,_0x3181aa){return new BPromise(function(_0x315683,_0x185774){return client['request'](_0x681322,_0x3181aa)[_0x0a32('0xa')](function(_0x45217a){logger[_0x0a32('0xb')](_0x0a32('0xc'),_0x501d13,'request\x20sent');logger[_0x0a32('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x501d13,_0x0a32('0xe'),JSON['stringify'](_0x45217a));if(_0x45217a[_0x0a32('0xf')]){if(_0x45217a['error']['code']===0x1f4){logger['error'](_0x0a32('0xc'),_0x501d13,_0x45217a[_0x0a32('0xf')]['message']);return _0x185774(_0x45217a['error'][_0x0a32('0x10')]);}logger[_0x0a32('0xf')](_0x0a32('0xc'),_0x501d13,_0x45217a['error'][_0x0a32('0x10')]);return _0x315683(_0x45217a[_0x0a32('0xf')][_0x0a32('0x10')]);}else{logger[_0x0a32('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x501d13,'request\x20sent');_0x315683(_0x45217a[_0x0a32('0x11')][_0x0a32('0x10')]);}})['catch'](function(_0x4571d4){logger['error'](_0x0a32('0xc'),_0x501d13,_0x4571d4);_0x185774(_0x4571d4);});});}exports[_0x0a32('0x12')]=function(_0x5becde){var _0x10bba5=this;return new Promise(function(_0x370caa,_0x2ac9f2){return db[_0x0a32('0x13')]['create'](_0x5becde['body'],{'raw':_0x5becde[_0x0a32('0x14')]?_0x5becde[_0x0a32('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x0a32('0xa')](function(_0x4d830b){logger['info'](_0x0a32('0x12'),_0x5becde);logger[_0x0a32('0xd')]('CreateWhatsappQueueReport',_0x5becde,JSON['stringify'](_0x4d830b));_0x370caa(_0x4d830b);})[_0x0a32('0x15')](function(_0x40bb3b){logger[_0x0a32('0xf')](_0x0a32('0x12'),_0x40bb3b[_0x0a32('0x10')],_0x5becde);_0x2ac9f2(_0x10bba5[_0x0a32('0xf')](0x1f4,_0x40bb3b[_0x0a32('0x10')]));});});};exports[_0x0a32('0x16')]=function(_0x3a0c69){var _0x3cd613=this;return new Promise(function(_0x366402,_0x4c563c){return db[_0x0a32('0x13')][_0x0a32('0x17')](_0x3a0c69[_0x0a32('0x18')],{'raw':_0x3a0c69[_0x0a32('0x14')]?_0x3a0c69[_0x0a32('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a0c69['options']?_0x3a0c69[_0x0a32('0x14')]['where']||null:null,'attributes':_0x3a0c69[_0x0a32('0x14')]?_0x3a0c69['options'][_0x0a32('0x19')]||null:null,'limit':_0x3a0c69[_0x0a32('0x14')]?_0x3a0c69['options']['limit']||null:null})[_0x0a32('0xa')](function(_0x4ccbf7){logger[_0x0a32('0xb')](_0x0a32('0x16'),_0x3a0c69);logger[_0x0a32('0xd')](_0x0a32('0x16'),_0x3a0c69,JSON['stringify'](_0x4ccbf7));_0x366402(_0x4ccbf7);})['catch'](function(_0x45305c){logger[_0x0a32('0xf')](_0x0a32('0x16'),_0x45305c[_0x0a32('0x10')],_0x3a0c69);_0x4c563c(_0x3cd613[_0x0a32('0xf')](0x1f4,_0x45305c[_0x0a32('0x10')]));});});}; \ No newline at end of file +var _0x6030=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','CreateWhatsappQueueReport','create','body','options','debug','update','where','attributes','limit','stringify','UpdateWhatsappQueueReport'];(function(_0x3da72b,_0x4fd809){var _0xc64ac4=function(_0x387e50){while(--_0x387e50){_0x3da72b['push'](_0x3da72b['shift']());}};_0xc64ac4(++_0x4fd809);}(_0x6030,0x9b));var _0x0603=function(_0x554148,_0x1ae5f9){_0x554148=_0x554148-0x0;var _0x57dcb6=_0x6030[_0x554148];return _0x57dcb6;};'use strict';var _=require('lodash');var util=require(_0x0603('0x0'));var moment=require(_0x0603('0x1'));var BPromise=require(_0x0603('0x2'));var rs=require(_0x0603('0x3'));var fs=require('fs');var Redis=require(_0x0603('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0603('0x5'))(_0x0603('0x6'));var config=require(_0x0603('0x7'));var jayson=require(_0x0603('0x8'));var client=jayson[_0x0603('0x9')][_0x0603('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x374b23,_0x431a1a,_0x48b961){return new BPromise(function(_0x179d79,_0x1827d9){return client['request'](_0x374b23,_0x48b961)[_0x0603('0xb')](function(_0x1ecb9d){logger[_0x0603('0xc')](_0x0603('0xd'),_0x431a1a,_0x0603('0xe'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x431a1a,'request\x20sent',JSON['stringify'](_0x1ecb9d));if(_0x1ecb9d['error']){if(_0x1ecb9d['error'][_0x0603('0xf')]===0x1f4){logger[_0x0603('0x10')](_0x0603('0xd'),_0x431a1a,_0x1ecb9d[_0x0603('0x10')][_0x0603('0x11')]);return _0x1827d9(_0x1ecb9d['error']['message']);}logger[_0x0603('0x10')](_0x0603('0xd'),_0x431a1a,_0x1ecb9d[_0x0603('0x10')][_0x0603('0x11')]);return _0x179d79(_0x1ecb9d['error'][_0x0603('0x11')]);}else{logger[_0x0603('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x431a1a,_0x0603('0xe'));_0x179d79(_0x1ecb9d[_0x0603('0x12')][_0x0603('0x11')]);}})[_0x0603('0x13')](function(_0x32c079){logger[_0x0603('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x431a1a,_0x32c079);_0x1827d9(_0x32c079);});});}exports[_0x0603('0x14')]=function(_0x54bea5){var _0x5af5b3=this;return new Promise(function(_0x23940b,_0xc95e47){return db['WhatsappQueueReport'][_0x0603('0x15')](_0x54bea5[_0x0603('0x16')],{'raw':_0x54bea5['options']?_0x54bea5[_0x0603('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0603('0xb')](function(_0x1de57a){logger[_0x0603('0xc')](_0x0603('0x14'),_0x54bea5);logger[_0x0603('0x18')](_0x0603('0x14'),_0x54bea5,JSON['stringify'](_0x1de57a));_0x23940b(_0x1de57a);})[_0x0603('0x13')](function(_0x6fc1bc){logger[_0x0603('0x10')](_0x0603('0x14'),_0x6fc1bc[_0x0603('0x11')],_0x54bea5);_0xc95e47(_0x5af5b3[_0x0603('0x10')](0x1f4,_0x6fc1bc[_0x0603('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2e7979){var _0x145890=this;return new Promise(function(_0x5cea94,_0x477430){return db['WhatsappQueueReport'][_0x0603('0x19')](_0x2e7979[_0x0603('0x16')],{'raw':_0x2e7979[_0x0603('0x17')]?_0x2e7979[_0x0603('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e7979[_0x0603('0x17')]?_0x2e7979[_0x0603('0x17')][_0x0603('0x1a')]||null:null,'attributes':_0x2e7979[_0x0603('0x17')]?_0x2e7979[_0x0603('0x17')][_0x0603('0x1b')]||null:null,'limit':_0x2e7979[_0x0603('0x17')]?_0x2e7979['options'][_0x0603('0x1c')]||null:null})[_0x0603('0xb')](function(_0x3a79e8){logger[_0x0603('0xc')]('UpdateWhatsappQueueReport',_0x2e7979);logger[_0x0603('0x18')]('UpdateWhatsappQueueReport',_0x2e7979,JSON[_0x0603('0x1d')](_0x3a79e8));_0x5cea94(_0x3a79e8);})[_0x0603('0x13')](function(_0x418d90){logger[_0x0603('0x10')](_0x0603('0x1e'),_0x418d90[_0x0603('0x11')],_0x2e7979);_0x477430(_0x145890[_0x0603('0x10')](0x1f4,_0x418d90[_0x0603('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 99c7f20..1932a67 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 _0xb839=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0xc8b136,_0x418247){var _0x281b79=function(_0x4fc27c){while(--_0x4fc27c){_0xc8b136['push'](_0xc8b136['shift']());}};_0x281b79(++_0x418247);}(_0xb839,0x7c));var _0x9b83=function(_0x3f306b,_0x39cfd0){_0x3f306b=_0x3f306b-0x0;var _0x230e48=_0xb839[_0x3f306b];return _0x230e48;};'use strict';var multer=require(_0x9b83('0x0'));var util=require(_0x9b83('0x1'));var path=require(_0x9b83('0x2'));var timeout=require(_0x9b83('0x3'));var express=require('express');var router=express[_0x9b83('0x4')]();var fs_extra=require(_0x9b83('0x5'));var auth=require(_0x9b83('0x6'));var interaction=require(_0x9b83('0x7'));var config=require('../../config/environment');var controller=require(_0x9b83('0x8'));router['get']('/',auth[_0x9b83('0x9')](),controller[_0x9b83('0xa')]);router[_0x9b83('0xb')](_0x9b83('0xc'),auth['isAuthenticated'](),controller[_0x9b83('0xd')]);router[_0x9b83('0xb')](_0x9b83('0xe'),auth[_0x9b83('0x9')](),controller[_0x9b83('0xf')]);router[_0x9b83('0x10')]('/',auth[_0x9b83('0x9')](),controller[_0x9b83('0x11')]);router[_0x9b83('0x12')]('/:id',auth[_0x9b83('0x9')](),controller[_0x9b83('0x13')]);router[_0x9b83('0x14')](_0x9b83('0xe'),auth[_0x9b83('0x9')](),controller[_0x9b83('0x15')]);module[_0x9b83('0x16')]=router; \ No newline at end of file +var _0xa70a=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','post','create','put','/:id','update','delete','destroy'];(function(_0x110bfe,_0x468711){var _0x4b8aa4=function(_0x3992e1){while(--_0x3992e1){_0x110bfe['push'](_0x110bfe['shift']());}};_0x4b8aa4(++_0x468711);}(_0xa70a,0xe8));var _0xaa70=function(_0x207909,_0x5ccc80){_0x207909=_0x207909-0x0;var _0x46b282=_0xa70a[_0x207909];return _0x46b282;};'use strict';var multer=require(_0xaa70('0x0'));var util=require(_0xaa70('0x1'));var path=require(_0xaa70('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa70('0x3')]();var fs_extra=require(_0xaa70('0x4'));var auth=require(_0xaa70('0x5'));var interaction=require(_0xaa70('0x6'));var config=require(_0xaa70('0x7'));var controller=require(_0xaa70('0x8'));router[_0xaa70('0x9')]('/',auth[_0xaa70('0xa')](),controller[_0xaa70('0xb')]);router['get']('/describe',auth[_0xaa70('0xa')](),controller[_0xaa70('0xc')]);router[_0xaa70('0x9')]('/:id',auth[_0xaa70('0xa')](),controller['show']);router[_0xaa70('0xd')]('/',auth['isAuthenticated'](),controller[_0xaa70('0xe')]);router[_0xaa70('0xf')](_0xaa70('0x10'),auth[_0xaa70('0xa')](),controller[_0xaa70('0x11')]);router[_0xaa70('0x12')](_0xaa70('0x10'),auth['isAuthenticated'](),controller[_0xaa70('0x13')]);module[_0xaa70('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index b2b499a..05437e3 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 _0x7334=['STRING','agent','DATE','sequelize','exports'];(function(_0x54c3d6,_0x2f90ad){var _0x550df0=function(_0x425bd5){while(--_0x425bd5){_0x54c3d6['push'](_0x54c3d6['shift']());}};_0x550df0(++_0x2f90ad);}(_0x7334,0x184));var _0x4733=function(_0x174125,_0x542e78){_0x174125=_0x174125-0x0;var _0x513f0c=_0x7334[_0x174125];return _0x513f0c;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'uniqueid':{'type':Sequelize[_0x4733('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x4733('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4733('0x4')]}}; \ No newline at end of file +var _0x3d45=['ENUM','account','queue','DATE','sequelize','exports','STRING'];(function(_0x3ef45a,_0x4b6756){var _0x86f9aa=function(_0x20ecc9){while(--_0x20ecc9){_0x3ef45a['push'](_0x3ef45a['shift']());}};_0x86f9aa(++_0x4b6756);}(_0x3d45,0x1d2));var _0x53d4=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x3d45[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x53d4('0x0'));module[_0x53d4('0x1')]={'uniqueid':{'type':Sequelize[_0x53d4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x53d4('0x3')](_0x53d4('0x4'),'agent',_0x53d4('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x53d4('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a274056..242822a 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 _0x72a0=['error','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then'];(function(_0x42b4fa,_0x4addce){var _0xd7f68b=function(_0x1dca44){while(--_0x1dca44){_0x42b4fa['push'](_0x42b4fa['shift']());}};_0xd7f68b(++_0x4addce);}(_0x72a0,0x194));var _0x072a=function(_0x555bf0,_0x479de5){_0x555bf0=_0x555bf0-0x0;var _0xc75c62=_0x72a0[_0x555bf0];return _0xc75c62;};'use strict';var emlformat=require(_0x072a('0x0'));var rimraf=require(_0x072a('0x1'));var zipdir=require(_0x072a('0x2'));var jsonpatch=require(_0x072a('0x3'));var rp=require(_0x072a('0x4'));var moment=require(_0x072a('0x5'));var BPromise=require(_0x072a('0x6'));var Mustache=require('mustache');var util=require(_0x072a('0x7'));var path=require('path');var sox=require(_0x072a('0x8'));var csv=require('to-csv');var ejs=require(_0x072a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x072a('0xa'));var squel=require(_0x072a('0xb'));var crypto=require(_0x072a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x072a('0xd'));var toCsv=require(_0x072a('0xe'));var querystring=require(_0x072a('0xf'));var Papa=require('papaparse');var Redis=require(_0x072a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x072a('0x11'));var as=require(_0x072a('0x12'));var hardwareService=require(_0x072a('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x072a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3361a4,_0x428dde){_0x428dde=_0x428dde||0xcc;return function(_0x2a860f){if(_0x2a860f){return _0x3361a4[_0x072a('0x15')](_0x428dde);}return _0x3361a4[_0x072a('0x16')](_0x428dde)['end']();};}function respondWithResult(_0xea2f14,_0xe6daaa){_0xe6daaa=_0xe6daaa||0xc8;return function(_0x38e1c1){if(_0x38e1c1){return _0xea2f14[_0x072a('0x16')](_0xe6daaa)[_0x072a('0x17')](_0x38e1c1);}};}function respondWithFilteredResult(_0x589581,_0x32fc3c){return function(_0x28800a){if(_0x28800a){var _0x3867fd=typeof _0x32fc3c[_0x072a('0x18')]===_0x072a('0x19')&&typeof _0x32fc3c[_0x072a('0x1a')]===_0x072a('0x19');var _0x4d7e08=_0x28800a[_0x072a('0x1b')];var _0x5669b6=_0x3867fd?0x0:_0x32fc3c[_0x072a('0x18')];var _0xec90b8=_0x3867fd?_0x28800a[_0x072a('0x1b')]:_0x32fc3c['offset']+_0x32fc3c[_0x072a('0x1a')];var _0x3e3923;if(_0xec90b8>=_0x4d7e08){_0xec90b8=_0x4d7e08;_0x3e3923=0xc8;}else{_0x3e3923=0xce;}_0x589581[_0x072a('0x16')](_0x3e3923);return _0x589581['set'](_0x072a('0x1c'),_0x5669b6+'-'+_0xec90b8+'/'+_0x4d7e08)[_0x072a('0x17')](_0x28800a);}return null;};}function patchUpdates(_0x58b855){return function(_0x1dbadc){try{jsonpatch[_0x072a('0x1d')](_0x1dbadc,_0x58b855,!![]);}catch(_0x2ea707){return BPromise[_0x072a('0x1e')](_0x2ea707);}return _0x1dbadc[_0x072a('0x1f')]();};}function saveUpdates(_0x303afe,_0x1d207c){return function(_0x84587b){if(_0x84587b){return _0x84587b['update'](_0x303afe)['then'](function(_0x7539f3){return _0x7539f3;});}return null;};}function removeEntity(_0x37aa7a,_0x4c6e66){return function(_0x1f25d7){if(_0x1f25d7){return _0x1f25d7[_0x072a('0x20')]()[_0x072a('0x21')](function(){_0x37aa7a[_0x072a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8f8b53,_0x27220c){return function(_0x14bb0d){if(!_0x14bb0d){_0x8f8b53[_0x072a('0x15')](0x194);}return _0x14bb0d;};}function handleError(_0x4e3532,_0x221969){_0x221969=_0x221969||0x1f4;return function(_0x756cdd){logger[_0x072a('0x22')](_0x756cdd[_0x072a('0x23')]);if(_0x756cdd[_0x072a('0x24')]){delete _0x756cdd[_0x072a('0x24')];}_0x4e3532[_0x072a('0x16')](_0x221969)[_0x072a('0x25')](_0x756cdd);};}exports[_0x072a('0x26')]=function(_0x4abe54,_0x45ae6b){var _0x310113={},_0x3cac2d={},_0x28b61d={'count':0x0,'rows':[]};var _0x962411=_[_0x072a('0x27')](db[_0x072a('0x28')]['rawAttributes'],function(_0x1b8ecb){return{'name':_0x1b8ecb[_0x072a('0x29')],'type':_0x1b8ecb[_0x072a('0x2a')][_0x072a('0x2b')]};});_0x3cac2d[_0x072a('0x2c')]=_[_0x072a('0x27')](_0x962411,'name');_0x3cac2d[_0x072a('0x2d')]=_[_0x072a('0x2e')](_0x4abe54['query']);_0x3cac2d['filters']=_['intersection'](_0x3cac2d[_0x072a('0x2c')],_0x3cac2d['query']);_0x310113['attributes']=_[_0x072a('0x2f')](_0x3cac2d['model'],qs[_0x072a('0x30')](_0x4abe54[_0x072a('0x2d')][_0x072a('0x30')]));_0x310113[_0x072a('0x31')]=_0x310113['attributes'][_0x072a('0x32')]?_0x310113[_0x072a('0x31')]:_0x3cac2d[_0x072a('0x2c')];if(!_0x4abe54['query'][_0x072a('0x33')]('nolimit')){_0x310113[_0x072a('0x1a')]=qs['limit'](_0x4abe54['query'][_0x072a('0x1a')]);_0x310113[_0x072a('0x18')]=qs[_0x072a('0x18')](_0x4abe54['query'][_0x072a('0x18')]);}_0x310113[_0x072a('0x34')]=qs[_0x072a('0x35')](_0x4abe54[_0x072a('0x2d')][_0x072a('0x35')]);_0x310113[_0x072a('0x36')]=qs[_0x072a('0x37')](_['pick'](_0x4abe54[_0x072a('0x2d')],_0x3cac2d[_0x072a('0x37')]),_0x962411);if(_0x4abe54[_0x072a('0x2d')]['filter']){_0x310113[_0x072a('0x36')]=_[_0x072a('0x38')](_0x310113[_0x072a('0x36')],{'$or':_[_0x072a('0x27')](_0x962411,function(_0x5c281a){if(_0x5c281a['type']!==_0x072a('0x39')){var _0x3d71ff={};_0x3d71ff[_0x5c281a[_0x072a('0x24')]]={'$like':'%'+_0x4abe54['query'][_0x072a('0x3a')]+'%'};return _0x3d71ff;}})});}_0x310113=_[_0x072a('0x38')]({},_0x310113,_0x4abe54[_0x072a('0x3b')]);var _0x2cb9c5={'where':_0x310113[_0x072a('0x36')]};return db[_0x072a('0x28')][_0x072a('0x1b')](_0x2cb9c5)['then'](function(_0x22b3e1){_0x28b61d[_0x072a('0x1b')]=_0x22b3e1;if(_0x4abe54[_0x072a('0x2d')][_0x072a('0x3c')]){_0x310113['include']=[{'all':!![]}];}return db[_0x072a('0x28')][_0x072a('0x3d')](_0x310113);})[_0x072a('0x21')](function(_0x240f15){_0x28b61d[_0x072a('0x3e')]=_0x240f15;return _0x28b61d;})['then'](respondWithFilteredResult(_0x45ae6b,_0x310113))[_0x072a('0x3f')](handleError(_0x45ae6b,null));};exports[_0x072a('0x40')]=function(_0x553b5d,_0x30d910){var _0x549567={'raw':!![],'where':{'id':_0x553b5d[_0x072a('0x41')]['id']}},_0x543da5={};_0x543da5[_0x072a('0x2c')]=_['keys'](db['WhatsappTransferReport'][_0x072a('0x42')]);_0x543da5['query']=_[_0x072a('0x2e')](_0x553b5d[_0x072a('0x2d')]);_0x543da5['filters']=_[_0x072a('0x2f')](_0x543da5['model'],_0x543da5[_0x072a('0x2d')]);_0x549567[_0x072a('0x31')]=_[_0x072a('0x2f')](_0x543da5[_0x072a('0x2c')],qs['fields'](_0x553b5d[_0x072a('0x2d')]['fields']));_0x549567[_0x072a('0x31')]=_0x549567[_0x072a('0x31')][_0x072a('0x32')]?_0x549567[_0x072a('0x31')]:_0x543da5['model'];if(_0x553b5d['query'][_0x072a('0x3c')]){_0x549567[_0x072a('0x43')]=[{'all':!![]}];}_0x549567=_[_0x072a('0x38')]({},_0x549567,_0x553b5d[_0x072a('0x3b')]);return db[_0x072a('0x28')][_0x072a('0x44')](_0x549567)['then'](handleEntityNotFound(_0x30d910,null))['then'](respondWithResult(_0x30d910,null))['catch'](handleError(_0x30d910,null));};exports['create']=function(_0x3429e5,_0x3064c2){return db[_0x072a('0x28')][_0x072a('0x45')](_0x3429e5['body'],{})[_0x072a('0x21')](respondWithResult(_0x3064c2,0xc9))[_0x072a('0x3f')](handleError(_0x3064c2,null));};exports[_0x072a('0x46')]=function(_0x5c8f2b,_0x3eafe9){if(_0x5c8f2b[_0x072a('0x47')]['id']){delete _0x5c8f2b['body']['id'];}return db[_0x072a('0x28')][_0x072a('0x44')]({'where':{'id':_0x5c8f2b[_0x072a('0x41')]['id']}})[_0x072a('0x21')](handleEntityNotFound(_0x3eafe9,null))[_0x072a('0x21')](saveUpdates(_0x5c8f2b['body'],null))[_0x072a('0x21')](respondWithResult(_0x3eafe9,null))['catch'](handleError(_0x3eafe9,null));};exports[_0x072a('0x20')]=function(_0x48158a,_0xdf1458){return db['WhatsappTransferReport']['find']({'where':{'id':_0x48158a[_0x072a('0x41')]['id']}})[_0x072a('0x21')](handleEntityNotFound(_0xdf1458,null))[_0x072a('0x21')](removeEntity(_0xdf1458,null))[_0x072a('0x3f')](handleError(_0xdf1458,null));};exports[_0x072a('0x48')]=function(_0x578695,_0x2570bb){return db[_0x072a('0x28')][_0x072a('0x48')]()[_0x072a('0x21')](respondWithResult(_0x2570bb,null))['catch'](handleError(_0x2570bb,null));}; \ No newline at end of file +var _0x20cc=['includeAll','findAll','catch','show','params','fields','include','options','find','create','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','WhatsappTransferReport'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x20cc,0x196));var _0xc20c=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x20cc[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require(_0xc20c('0x0'));var rimraf=require(_0xc20c('0x1'));var zipdir=require(_0xc20c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc20c('0x3'));var moment=require(_0xc20c('0x4'));var BPromise=require(_0xc20c('0x5'));var Mustache=require(_0xc20c('0x6'));var util=require(_0xc20c('0x7'));var path=require(_0xc20c('0x8'));var sox=require(_0xc20c('0x9'));var csv=require(_0xc20c('0xa'));var ejs=require(_0xc20c('0xb'));var fs=require('fs');var fs_extra=require(_0xc20c('0xc'));var _=require(_0xc20c('0xd'));var squel=require(_0xc20c('0xe'));var crypto=require('crypto');var jsforce=require(_0xc20c('0xf'));var deskjs=require(_0xc20c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc20c('0x11'));var Papa=require(_0xc20c('0x12'));var Redis=require('ioredis');var authService=require(_0xc20c('0x13'));var qs=require(_0xc20c('0x14'));var as=require(_0xc20c('0x15'));var hardwareService=require(_0xc20c('0x16'));var logger=require(_0xc20c('0x17'))('api');var utils=require(_0xc20c('0x18'));var config=require(_0xc20c('0x19'));var licenseUtil=require(_0xc20c('0x1a'));var db=require(_0xc20c('0x1b'))['db'];function respondWithStatusCode(_0xde552,_0x474fe5){_0x474fe5=_0x474fe5||0xcc;return function(_0xb7b6d6){if(_0xb7b6d6){return _0xde552[_0xc20c('0x1c')](_0x474fe5);}return _0xde552[_0xc20c('0x1d')](_0x474fe5)['end']();};}function respondWithResult(_0x155c0b,_0x57b37c){_0x57b37c=_0x57b37c||0xc8;return function(_0x25c8c5){if(_0x25c8c5){return _0x155c0b[_0xc20c('0x1d')](_0x57b37c)[_0xc20c('0x1e')](_0x25c8c5);}};}function respondWithFilteredResult(_0x74ceee,_0xc41e74){return function(_0x1649c2){if(_0x1649c2){var _0x325dd0=typeof _0xc41e74[_0xc20c('0x1f')]===_0xc20c('0x20')&&typeof _0xc41e74[_0xc20c('0x21')]==='undefined';var _0x3d7a41=_0x1649c2[_0xc20c('0x22')];var _0x4893a9=_0x325dd0?0x0:_0xc41e74[_0xc20c('0x1f')];var _0x31e740=_0x325dd0?_0x1649c2['count']:_0xc41e74['offset']+_0xc41e74[_0xc20c('0x21')];var _0x4aa423;if(_0x31e740>=_0x3d7a41){_0x31e740=_0x3d7a41;_0x4aa423=0xc8;}else{_0x4aa423=0xce;}_0x74ceee['status'](_0x4aa423);return _0x74ceee[_0xc20c('0x23')]('Content-Range',_0x4893a9+'-'+_0x31e740+'/'+_0x3d7a41)[_0xc20c('0x1e')](_0x1649c2);}return null;};}function patchUpdates(_0x450394){return function(_0x243a59){try{jsonpatch['apply'](_0x243a59,_0x450394,!![]);}catch(_0x277718){return BPromise[_0xc20c('0x24')](_0x277718);}return _0x243a59[_0xc20c('0x25')]();};}function saveUpdates(_0x4021fc,_0x19f685){return function(_0x4ec035){if(_0x4ec035){return _0x4ec035[_0xc20c('0x26')](_0x4021fc)[_0xc20c('0x27')](function(_0x2e0506){return _0x2e0506;});}return null;};}function removeEntity(_0x140adf,_0x4f46bb){return function(_0x6a9e5b){if(_0x6a9e5b){return _0x6a9e5b[_0xc20c('0x28')]()[_0xc20c('0x27')](function(){_0x140adf['status'](0xcc)[_0xc20c('0x29')]();});}};}function handleEntityNotFound(_0x145b68,_0x55c66a){return function(_0x39386e){if(!_0x39386e){_0x145b68['sendStatus'](0x194);}return _0x39386e;};}function handleError(_0x29bd16,_0xa55d11){_0xa55d11=_0xa55d11||0x1f4;return function(_0x22f124){logger[_0xc20c('0x2a')](_0x22f124[_0xc20c('0x2b')]);if(_0x22f124[_0xc20c('0x2c')]){delete _0x22f124['name'];}_0x29bd16[_0xc20c('0x1d')](_0xa55d11)['send'](_0x22f124);};}exports[_0xc20c('0x2d')]=function(_0x4b3943,_0x2b35ca){var _0x30a50b={},_0xac2aea={},_0x2c7a01={'count':0x0,'rows':[]};var _0x14951e=_['map'](db['WhatsappTransferReport'][_0xc20c('0x2e')],function(_0x4e3045){return{'name':_0x4e3045[_0xc20c('0x2f')],'type':_0x4e3045[_0xc20c('0x30')][_0xc20c('0x31')]};});_0xac2aea[_0xc20c('0x32')]=_['map'](_0x14951e,'name');_0xac2aea['query']=_[_0xc20c('0x33')](_0x4b3943[_0xc20c('0x34')]);_0xac2aea['filters']=_[_0xc20c('0x35')](_0xac2aea[_0xc20c('0x32')],_0xac2aea['query']);_0x30a50b[_0xc20c('0x36')]=_[_0xc20c('0x35')](_0xac2aea['model'],qs['fields'](_0x4b3943['query']['fields']));_0x30a50b[_0xc20c('0x36')]=_0x30a50b[_0xc20c('0x36')][_0xc20c('0x37')]?_0x30a50b[_0xc20c('0x36')]:_0xac2aea[_0xc20c('0x32')];if(!_0x4b3943['query'][_0xc20c('0x38')](_0xc20c('0x39'))){_0x30a50b['limit']=qs[_0xc20c('0x21')](_0x4b3943['query']['limit']);_0x30a50b[_0xc20c('0x1f')]=qs[_0xc20c('0x1f')](_0x4b3943[_0xc20c('0x34')][_0xc20c('0x1f')]);}_0x30a50b[_0xc20c('0x3a')]=qs['sort'](_0x4b3943[_0xc20c('0x34')][_0xc20c('0x3b')]);_0x30a50b[_0xc20c('0x3c')]=qs[_0xc20c('0x3d')](_[_0xc20c('0x3e')](_0x4b3943[_0xc20c('0x34')],_0xac2aea[_0xc20c('0x3d')]),_0x14951e);if(_0x4b3943[_0xc20c('0x34')][_0xc20c('0x3f')]){_0x30a50b[_0xc20c('0x3c')]=_[_0xc20c('0x40')](_0x30a50b['where'],{'$or':_[_0xc20c('0x41')](_0x14951e,function(_0x140e89){if(_0x140e89[_0xc20c('0x30')]!==_0xc20c('0x42')){var _0x9225cb={};_0x9225cb[_0x140e89[_0xc20c('0x2c')]]={'$like':'%'+_0x4b3943['query'][_0xc20c('0x3f')]+'%'};return _0x9225cb;}})});}_0x30a50b=_[_0xc20c('0x40')]({},_0x30a50b,_0x4b3943['options']);var _0x1c2612={'where':_0x30a50b[_0xc20c('0x3c')]};return db[_0xc20c('0x43')][_0xc20c('0x22')](_0x1c2612)[_0xc20c('0x27')](function(_0x410d74){_0x2c7a01[_0xc20c('0x22')]=_0x410d74;if(_0x4b3943[_0xc20c('0x34')][_0xc20c('0x44')]){_0x30a50b['include']=[{'all':!![]}];}return db[_0xc20c('0x43')][_0xc20c('0x45')](_0x30a50b);})['then'](function(_0x498ece){_0x2c7a01['rows']=_0x498ece;return _0x2c7a01;})[_0xc20c('0x27')](respondWithFilteredResult(_0x2b35ca,_0x30a50b))[_0xc20c('0x46')](handleError(_0x2b35ca,null));};exports[_0xc20c('0x47')]=function(_0x29cf08,_0x5dac84){var _0x139d72={'raw':!![],'where':{'id':_0x29cf08[_0xc20c('0x48')]['id']}},_0xff3839={};_0xff3839[_0xc20c('0x32')]=_[_0xc20c('0x33')](db[_0xc20c('0x43')]['rawAttributes']);_0xff3839[_0xc20c('0x34')]=_['keys'](_0x29cf08[_0xc20c('0x34')]);_0xff3839['filters']=_[_0xc20c('0x35')](_0xff3839['model'],_0xff3839[_0xc20c('0x34')]);_0x139d72['attributes']=_[_0xc20c('0x35')](_0xff3839['model'],qs[_0xc20c('0x49')](_0x29cf08[_0xc20c('0x34')][_0xc20c('0x49')]));_0x139d72[_0xc20c('0x36')]=_0x139d72[_0xc20c('0x36')][_0xc20c('0x37')]?_0x139d72[_0xc20c('0x36')]:_0xff3839['model'];if(_0x29cf08['query'][_0xc20c('0x44')]){_0x139d72[_0xc20c('0x4a')]=[{'all':!![]}];}_0x139d72=_[_0xc20c('0x40')]({},_0x139d72,_0x29cf08[_0xc20c('0x4b')]);return db[_0xc20c('0x43')][_0xc20c('0x4c')](_0x139d72)['then'](handleEntityNotFound(_0x5dac84,null))[_0xc20c('0x27')](respondWithResult(_0x5dac84,null))[_0xc20c('0x46')](handleError(_0x5dac84,null));};exports[_0xc20c('0x4d')]=function(_0x468381,_0x5ee635){return db[_0xc20c('0x43')][_0xc20c('0x4d')](_0x468381['body'],{})[_0xc20c('0x27')](respondWithResult(_0x5ee635,0xc9))[_0xc20c('0x46')](handleError(_0x5ee635,null));};exports[_0xc20c('0x26')]=function(_0x35df8f,_0x24ece1){if(_0x35df8f['body']['id']){delete _0x35df8f['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x35df8f[_0xc20c('0x48')]['id']}})[_0xc20c('0x27')](handleEntityNotFound(_0x24ece1,null))[_0xc20c('0x27')](saveUpdates(_0x35df8f['body'],null))[_0xc20c('0x27')](respondWithResult(_0x24ece1,null))[_0xc20c('0x46')](handleError(_0x24ece1,null));};exports[_0xc20c('0x28')]=function(_0x157380,_0x511ffa){return db[_0xc20c('0x43')]['find']({'where':{'id':_0x157380['params']['id']}})[_0xc20c('0x27')](handleEntityNotFound(_0x511ffa,null))[_0xc20c('0x27')](removeEntity(_0x511ffa,null))['catch'](handleError(_0x511ffa,null));};exports[_0xc20c('0x4e')]=function(_0x50c19b,_0x2f2cdd){return db[_0xc20c('0x43')][_0xc20c('0x4e')]()[_0xc20c('0x27')](respondWithResult(_0x2f2cdd,null))[_0xc20c('0x46')](handleError(_0x2f2cdd,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e67b3f6..7d6020e 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 _0xdf62=['uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x33e55a,_0x3d5690){var _0x542283=function(_0x4eba1d){while(--_0x4eba1d){_0x33e55a['push'](_0x33e55a['shift']());}};_0x542283(++_0x3d5690);}(_0xdf62,0x151));var _0x2df6=function(_0x3ba033,_0x96257c){_0x3ba033=_0x3ba033-0x0;var _0x25b9dc=_0xdf62[_0x3ba033];return _0x25b9dc;};'use strict';var _=require('lodash');var util=require(_0x2df6('0x0'));var logger=require(_0x2df6('0x1'))('api');var moment=require(_0x2df6('0x2'));var BPromise=require('bluebird');var rp=require(_0x2df6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2df6('0x4'));var config=require(_0x2df6('0x5'));var attributes=require(_0x2df6('0x6'));module[_0x2df6('0x7')]=function(_0x4be7ad,_0x271ef5){return _0x4be7ad[_0x2df6('0x8')](_0x2df6('0x9'),attributes,{'tableName':_0x2df6('0xa'),'paranoid':![],'indexes':[{'name':_0x2df6('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3eaf=['lodash','util','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid'];(function(_0x2c4f00,_0x27a40c){var _0x3a72e4=function(_0x3a24ca){while(--_0x3a24ca){_0x2c4f00['push'](_0x2c4f00['shift']());}};_0x3a72e4(++_0x27a40c);}(_0x3eaf,0x1b8));var _0xf3ea=function(_0x9fc30a,_0x3048b1){_0x9fc30a=_0x9fc30a-0x0;var _0x3a9fa2=_0x3eaf[_0x9fc30a];return _0x3a9fa2;};'use strict';var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf3ea('0x2'));var rp=require(_0xf3ea('0x3'));var fs=require('fs');var path=require(_0xf3ea('0x4'));var rimraf=require(_0xf3ea('0x5'));var config=require('../../config/environment');var attributes=require(_0xf3ea('0x6'));module[_0xf3ea('0x7')]=function(_0x20e158,_0x2e825e){return _0x20e158['define']('WhatsappTransferReport',attributes,{'tableName':_0xf3ea('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf3ea('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index f0b393c..986df24 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 _0xe6c1=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x140684,_0x2edddd){var _0x1c3dc4=function(_0x39e999){while(--_0x39e999){_0x140684['push'](_0x140684['shift']());}};_0x1c3dc4(++_0x2edddd);}(_0xe6c1,0xd7));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1e6c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1e6c('0x1'));var rs=require(_0x1e6c('0x2'));var fs=require('fs');var Redis=require(_0x1e6c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1e6c('0x4'));var logger=require(_0x1e6c('0x5'))(_0x1e6c('0x6'));var config=require(_0x1e6c('0x7'));var jayson=require(_0x1e6c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42880a,_0x3f863c,_0x5de371){return new BPromise(function(_0x36b843,_0x25d445){return client[_0x1e6c('0x9')](_0x42880a,_0x5de371)[_0x1e6c('0xa')](function(_0x362372){logger['info'](_0x1e6c('0xb'),_0x3f863c,'request\x20sent');logger[_0x1e6c('0xc')](_0x1e6c('0xd'),_0x3f863c,_0x1e6c('0xe'),JSON[_0x1e6c('0xf')](_0x362372));if(_0x362372[_0x1e6c('0x10')]){if(_0x362372['error'][_0x1e6c('0x11')]===0x1f4){logger[_0x1e6c('0x10')](_0x1e6c('0xb'),_0x3f863c,_0x362372['error']['message']);return _0x25d445(_0x362372[_0x1e6c('0x10')][_0x1e6c('0x12')]);}logger[_0x1e6c('0x10')](_0x1e6c('0xb'),_0x3f863c,_0x362372[_0x1e6c('0x10')]['message']);return _0x36b843(_0x362372[_0x1e6c('0x10')]['message']);}else{logger[_0x1e6c('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3f863c,'request\x20sent');_0x36b843(_0x362372[_0x1e6c('0x14')][_0x1e6c('0x12')]);}})[_0x1e6c('0x15')](function(_0x45ff57){logger['error'](_0x1e6c('0xb'),_0x3f863c,_0x45ff57);_0x25d445(_0x45ff57);});});} \ No newline at end of file +var _0x986f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d4848,_0x5647ba){var _0x22d11b=function(_0x553a70){while(--_0x553a70){_0x4d4848['push'](_0x4d4848['shift']());}};_0x22d11b(++_0x5647ba);}(_0x986f,0x84));var _0xf986=function(_0xced28b,_0x467bb9){_0xced28b=_0xced28b-0x0;var _0x2ca2d3=_0x986f[_0xced28b];return _0x2ca2d3;};'use strict';var _=require(_0xf986('0x0'));var util=require(_0xf986('0x1'));var moment=require(_0xf986('0x2'));var BPromise=require(_0xf986('0x3'));var rs=require(_0xf986('0x4'));var fs=require('fs');var Redis=require(_0xf986('0x5'));var db=require(_0xf986('0x6'))['db'];var utils=require(_0xf986('0x7'));var logger=require(_0xf986('0x8'))(_0xf986('0x9'));var config=require(_0xf986('0xa'));var jayson=require(_0xf986('0xb'));var client=jayson[_0xf986('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a92c5,_0x1b7ac9,_0x89ee7){return new BPromise(function(_0x495942,_0x2c44d1){return client[_0xf986('0xd')](_0x3a92c5,_0x89ee7)[_0xf986('0xe')](function(_0x443499){logger[_0xf986('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1b7ac9,_0xf986('0x10'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x1b7ac9,_0xf986('0x10'),JSON[_0xf986('0x11')](_0x443499));if(_0x443499['error']){if(_0x443499[_0xf986('0x12')]['code']===0x1f4){logger['error'](_0xf986('0x13'),_0x1b7ac9,_0x443499[_0xf986('0x12')]['message']);return _0x2c44d1(_0x443499[_0xf986('0x12')][_0xf986('0x14')]);}logger[_0xf986('0x12')](_0xf986('0x13'),_0x1b7ac9,_0x443499['error'][_0xf986('0x14')]);return _0x495942(_0x443499[_0xf986('0x12')][_0xf986('0x14')]);}else{logger[_0xf986('0xf')](_0xf986('0x13'),_0x1b7ac9,'request\x20sent');_0x495942(_0x443499[_0xf986('0x15')]['message']);}})[_0xf986('0x16')](function(_0x50023e){logger[_0xf986('0x12')](_0xf986('0x13'),_0x1b7ac9,_0x50023e);_0x2c44d1(_0x50023e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 616d778..e28a519 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b8e=['default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sync','then','listen','start','info','Online\x20apps:','map','name','Offline\x20apps:','filter','status','online','join','seedDB','./config/seedDB'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x9b8e,0x147));var _0xe9b8=function(_0x465374,_0x19c620){_0x465374=_0x465374-0x0;var _0x42d0f0=_0x9b8e[_0x465374];return _0x42d0f0;};'use strict';var _=require(_0xe9b8('0x0'));var mysqldb=require(_0xe9b8('0x1'));var rpc=require(_0xe9b8('0x2'));var config=require(_0xe9b8('0x3'));var logger=require('./config/logger')(_0xe9b8('0x4'));var pm2=require(_0xe9b8('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xe9b8('0x6'));var chat=require(_0xe9b8('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xe9b8('0x8'));function main(){return mysqldb['db']['sequelize'][_0xe9b8('0x9')]()[_0xe9b8('0xa')](function(){return rpc[_0xe9b8('0xb')]();})[_0xe9b8('0xa')](function(_0x1fb345){logger['info'](_0x1fb345);return chat['start']();})[_0xe9b8('0xa')](function(){return whatsapp['start']();})[_0xe9b8('0xa')](function(){return schedule['start']();})['then'](function(){return transcribe[_0xe9b8('0xc')]();})[_0xe9b8('0xa')](function(_0x3ce950){logger['info'](_0x3ce950);return pm2[_0xe9b8('0xc')](pm2Config);})[_0xe9b8('0xa')](function(_0x421d99){logger[_0xe9b8('0xd')](_0xe9b8('0xe'),_[_0xe9b8('0xf')](_['filter'](_0x421d99,{'status':'online'}),_0xe9b8('0x10'))['join']());logger['info'](_0xe9b8('0x11'),_[_0xe9b8('0xf')](_[_0xe9b8('0x12')](_0x421d99,function(_0x5a5beb){return _0x5a5beb[_0xe9b8('0x13')]!==_0xe9b8('0x14');}),_0xe9b8('0x10'))[_0xe9b8('0x15')]()||'None');config[_0xe9b8('0x16')]&&require(_0xe9b8('0x17'))[_0xe9b8('0x18')]();require('./config/license')['default']();})[_0xe9b8('0x19')](function(_0x54ac15){logger['error'](_0xe9b8('0x1a'),_0x54ac15);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x2475=['./mysqldb','./rpc','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sequelize','sync','then','listen','info','start','Online\x20apps:','map','online','name','Offline\x20apps:','filter','status','join','None','seedDB','./config/seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash'];(function(_0x201ed7,_0xef46cf){var _0x1d461c=function(_0x49a6ba){while(--_0x49a6ba){_0x201ed7['push'](_0x201ed7['shift']());}};_0x1d461c(++_0xef46cf);}(_0x2475,0x14f));var _0x5247=function(_0x2b47eb,_0x2be0d8){_0x2b47eb=_0x2b47eb-0x0;var _0x32f45f=_0x2475[_0x2b47eb];return _0x32f45f;};'use strict';var _=require(_0x5247('0x0'));var mysqldb=require(_0x5247('0x1'));var rpc=require(_0x5247('0x2'));var config=require('./config/environment');var logger=require(_0x5247('0x3'))(_0x5247('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x5247('0x5'));var schedule=require(_0x5247('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x5247('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x5247('0x8')][_0x5247('0x9')]()[_0x5247('0xa')](function(){return rpc[_0x5247('0xb')]();})[_0x5247('0xa')](function(_0x5a5af4){logger[_0x5247('0xc')](_0x5a5af4);return chat['start']();})[_0x5247('0xa')](function(){return whatsapp['start']();})[_0x5247('0xa')](function(){return schedule[_0x5247('0xd')]();})[_0x5247('0xa')](function(){return transcribe['start']();})[_0x5247('0xa')](function(_0x32e547){logger[_0x5247('0xc')](_0x32e547);return pm2[_0x5247('0xd')](pm2Config);})[_0x5247('0xa')](function(_0x47afa6){logger['info'](_0x5247('0xe'),_[_0x5247('0xf')](_['filter'](_0x47afa6,{'status':_0x5247('0x10')}),_0x5247('0x11'))['join']());logger[_0x5247('0xc')](_0x5247('0x12'),_[_0x5247('0xf')](_[_0x5247('0x13')](_0x47afa6,function(_0x1be4ae){return _0x1be4ae[_0x5247('0x14')]!==_0x5247('0x10');}),_0x5247('0x11'))[_0x5247('0x15')]()||_0x5247('0x16'));config[_0x5247('0x17')]&&require(_0x5247('0x18'))[_0x5247('0x19')]();require('./config/license')['default']();})[_0x5247('0x1a')](function(_0x48d6b4){logger['error'](_0x5247('0x1b'),_0x48d6b4);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 1542f1e..19f47f8 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 _0xc5d7=['randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','secrets','session','role','fullname','name','md5secret','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','isAuthenticated','use','user','params','closed','disposition','then','status','json','Unmanaged.','Forbidden.','catch','startsWith','headers','authorization','Basic','User','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','find','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','add','minutes','Invalid\x20API\x20access\x20key','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','unshift','encryptString','promisify','sign','secret','payload','options','verify'];(function(_0x2b8259,_0x379a03){var _0x403a45=function(_0x4bc0a0){while(--_0x4bc0a0){_0x2b8259['push'](_0x2b8259['shift']());}};_0x403a45(++_0x379a03);}(_0xc5d7,0xf7));var _0x7c5d=function(_0x4bc555,_0x5c6d7f){_0x4bc555=_0x4bc555-0x0;var _0x1019af=_0xc5d7[_0x4bc555];return _0x1019af;};'use strict';var db=require(_0x7c5d('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x7c5d('0x1'));var encryptor=require(_0x7c5d('0x2'));var _=require('lodash');var jwt=require(_0x7c5d('0x3'));var expressJwt=require(_0x7c5d('0x4'));var compose=require(_0x7c5d('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0x7c5d('0x6'));var BPromise=require(_0x7c5d('0x7'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x7c5d('0x8')][_0x7c5d('0x9')]});var userAttributes=['id',_0x7c5d('0xa'),_0x7c5d('0xb'),_0x7c5d('0xc'),'internal','email','userpic','permissions',_0x7c5d('0xd'),'voicePause',_0x7c5d('0xe'),'mailPause',_0x7c5d('0xf'),_0x7c5d('0x10'),_0x7c5d('0x11'),_0x7c5d('0x12'),_0x7c5d('0x13'),_0x7c5d('0x14'),'lastPauseAt',_0x7c5d('0x15'),_0x7c5d('0x16'),_0x7c5d('0x17'),_0x7c5d('0x18'),_0x7c5d('0x19'),_0x7c5d('0x1a'),'phoneBarDnd',_0x7c5d('0x1b'),_0x7c5d('0x1c'),_0x7c5d('0x1d'),_0x7c5d('0x1e'),_0x7c5d('0x1f'),_0x7c5d('0x20'),_0x7c5d('0x21'),_0x7c5d('0x22'),_0x7c5d('0x23'),_0x7c5d('0x24'),'privacyEnabled',_0x7c5d('0x25'),_0x7c5d('0x26'),'downloadVoiceRecordings',_0x7c5d('0x27'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this[_0x7c5d('0x28')](!![])[_0x7c5d('0x29')](function(_0x3b292c,_0xdc996d,_0x586bc6){if(_0x3b292c[_0x7c5d('0x2a')]){_0x586bc6();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x3b292c[_0x7c5d('0x2b')]['id']},'attributes':['id',_0x7c5d('0x2c'),_0x7c5d('0x2d')],'raw':!![]})[_0x7c5d('0x2e')](function(_0x14da90){if(_0x14da90&&_0x14da90['closed']){return _0xdc996d[_0x7c5d('0x2f')](_0x14da90[_0x7c5d('0x2d')]==='unmanaged'?0x195:0x193)[_0x7c5d('0x30')]({'message':_0x14da90[_0x7c5d('0x2d')]==='unmanaged'?_0x7c5d('0x31'):_0x7c5d('0x32')});}else{_0x586bc6();}})[_0x7c5d('0x33')](function(_0x5b71ea){_0x586bc6(_0x5b71ea);});}});};exports[_0x7c5d('0x28')]=function isAuthenticated(_0x5c4d16){return compose()[_0x7c5d('0x29')](function(_0x528abc,_0x100d8d,_0x12a826){var _0x104ef4;if(_0x528abc['headers']['authorization']){if(_[_0x7c5d('0x34')](_0x528abc[_0x7c5d('0x35')][_0x7c5d('0x36')],_0x7c5d('0x37'))){var _0x2876dd=basicAuth(_0x528abc);db[_0x7c5d('0x38')]['find']({'where':{'name':_0x2876dd[_0x7c5d('0xc')]}})[_0x7c5d('0x2e')](function(_0xef2113){if(!_0xef2113||!_0xef2113[_0x7c5d('0x39')](_0x2876dd[_0x7c5d('0x3a')])){return _0x100d8d[_0x7c5d('0x2f')](0x191)['json']({'message':_0x7c5d('0x3b')});}_0x528abc[_0x7c5d('0x2a')]={'id':_0xef2113['id']};_0x12a826();})['catch'](function(_0xd6a2bf){_0x12a826(_0xd6a2bf);});}else if(_[_0x7c5d('0x34')](_0x528abc['headers']['authorization'],_0x7c5d('0x3c'))){validateJwt(_0x528abc,_0x100d8d,_0x12a826);}else{if(_0x5c4d16){_0x12a826();}else{return _0x100d8d[_0x7c5d('0x2f')](0x193)[_0x7c5d('0x30')]({'message':_0x7c5d('0x3d')});}}}else if(_0x528abc[_0x7c5d('0x3e')]['apikey']){try{var _0x2828f7={'audience':hardwareConf[_0x7c5d('0x3f')](),'issuer':hardwareConf[_0x7c5d('0x3f')]()};verifyJwt(_0x528abc['query'][_0x7c5d('0x40')],_0x2828f7)[_0x7c5d('0x2e')](function(_0x2827c7){return db['User'][_0x7c5d('0x41')]({'where':{'id':_0x2827c7[_0x7c5d('0x42')]}})[_0x7c5d('0x2e')](function(_0x33b1a0){_0x104ef4=_0x33b1a0;return db[_0x7c5d('0x43')][_0x7c5d('0x44')]({'where':{'id':0x1},'attributes':[_0x7c5d('0x45'),_0x7c5d('0x46')],'raw':!![]});})[_0x7c5d('0x2e')](function(_0x2e0273){if(!_0x104ef4||!_[_0x7c5d('0x47')](_0x104ef4[_0x7c5d('0x48')],_0x2827c7[_0x7c5d('0x49')])){return _0x100d8d[_0x7c5d('0x2f')](0x191)[_0x7c5d('0x30')]({'message':_0x7c5d('0x4a')});}if(_0x104ef4[_0x7c5d('0x4b')]){return _0x100d8d[_0x7c5d('0x2f')](0x191)[_0x7c5d('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x104ef4[_0x7c5d('0x4c')]){if(_0x2e0273['blockDuration']>0x0){if(moment(_0x104ef4['blockedAt'])[_0x7c5d('0x4d')](_0x2e0273[_0x7c5d('0x46')],_0x7c5d('0x4e'))>moment()){return _0x100d8d['status'](0x191)['json']({'message':_0x7c5d('0x4f')});}}else{return _0x100d8d[_0x7c5d('0x2f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x528abc[_0x7c5d('0x2a')]={'id':_0x104ef4['id']};_0x12a826();});})['catch'](function(){return _0x100d8d[_0x7c5d('0x2f')](0x191)[_0x7c5d('0x30')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2947e8){_0x12a826(_0x2947e8);}}else if(_0x5c4d16){_0x12a826();}else{return _0x100d8d['status'](0x193)['json']({'message':_0x7c5d('0x3d')});}})[_0x7c5d('0x29')](function(_0x1a0f08,_0x3bf8c3,_0x386297){if(_0x1a0f08[_0x7c5d('0x2a')]){db[_0x7c5d('0x38')]['find']({'where':{'id':_0x1a0f08[_0x7c5d('0x2a')]['id']},'attributes':userAttributes})['then'](function(_0x554c52){if(!_0x554c52){return _0x3bf8c3[_0x7c5d('0x2f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x1a0f08[_0x7c5d('0x2a')]=_0x554c52;_0x386297();})['catch'](function(_0x2f4b01){_0x386297(_0x2f4b01);});}else if(_0x5c4d16){_0x386297();}else{return _0x3bf8c3[_0x7c5d('0x2f')](0x194)[_0x7c5d('0x30')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x7c5d('0x50')]=function canUpdate(){return compose()[_0x7c5d('0x29')](function(_0x346e22,_0x328d02,_0x2f145d){return licenseUtil[_0x7c5d('0x51')]()[_0x7c5d('0x2e')](function(_0x52ccbf){if(_0x52ccbf[_0x7c5d('0x52')]){_0x2f145d();}else{return _0x328d02[_0x7c5d('0x2f')](0x193)[_0x7c5d('0x30')]({'message':_0x7c5d('0x53')});}})[_0x7c5d('0x33')](function(_0x1e6c1d){_0x2f145d(_0x1e6c1d);});});};exports[_0x7c5d('0x54')]=function(_0x20266a,_0x3c1a9e,_0x1fd91d){_0x20266a[_0x7c5d('0x54')]=!![];return _0x1fd91d();};exports[_0x7c5d('0x55')]=function signToken(_0x4b178c){return signJwt(_0x4b178c);};exports[_0x7c5d('0x56')]=function(_0x96892c,_0x5096bb){if(!_0x96892c[_0x7c5d('0x2a')]){return _0x5096bb[_0x7c5d('0x2f')](0x194)[_0x7c5d('0x30')]({'message':_0x7c5d('0x57')});}var _0x3a1f16={'payload':{'id':_0x96892c['user']['id'],'role':_0x96892c[_0x7c5d('0x2a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3a1f16)[_0x7c5d('0x2e')](function(_0x7b4ecd){_0x5096bb[_0x7c5d('0x58')](_0x7c5d('0x59'),_0x7b4ecd);_0x5096bb[_0x7c5d('0x5a')](_0x7c5d('0x5b'));})[_0x7c5d('0x33')](function(_0x272df0){return _0x5096bb[_0x7c5d('0x2f')](0x1f4)[_0x7c5d('0x5c')](_0x272df0);});};exports['retrieveApiKey']=function(_0x4d4e35){if(_[_0x7c5d('0x5d')](_0x4d4e35[_0x7c5d('0x48')])||_[_0x7c5d('0x5d')](_0x4d4e35[_0x7c5d('0x5e')])){return null;}else{return createJwt(_0x4d4e35);}};exports[_0x7c5d('0x5f')]=function(_0x2f266e){_0x2f266e['apiKeyNonce']=generateNonce();_0x2f266e[_0x7c5d('0x5e')]=generateIssuedAt();return createJwt(_0x2f266e);};exports[_0x7c5d('0x60')]=function(_0x36b6f1,_0x57dbb2){var _0x5aeb00=_0x36b6f1[_0x7c5d('0x3e')]['apikey'];if(_0x5aeb00){var _0x32e3d0={'nonce':_0x57dbb2[_0x7c5d('0x48')],'iat':_0x57dbb2[_0x7c5d('0x5e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7c5d('0x3f')]()};return verifyJwt(_0x5aeb00,_0x32e3d0)[_0x7c5d('0x2e')](function(){return generateApiKey(_0x57dbb2);});}else{throw{'message':_0x7c5d('0x61')};}};exports['validatePasswordPattern']=function(_0x10cd08){var _0x5d792f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5d792f[_0x7c5d('0x62')](_0x10cd08))throw new db[(_0x7c5d('0x63'))][(_0x7c5d('0x64'))](_0x7c5d('0x65'));return;};exports['validatePasswordHistory']=function(_0x47d609,_0x4c7697,_0xc38dc4){var _0x38ca83=encryptor[_0x7c5d('0x66')](_0x4c7697)[_0x7c5d('0x67')](',');for(var _0x22adca=0x0;_0x22adca<_0xc38dc4;_0x22adca++){if(!_0x38ca83[_0x22adca])break;if(_0x47d609[_0x7c5d('0x68')]()===_0x38ca83[_0x22adca][_0x7c5d('0x68')]()){var _0x34bcd4=util[_0x7c5d('0x69')](_0x7c5d('0x6a'),_0xc38dc4);if(_0xc38dc4===0x1){_0x34bcd4=_0x7c5d('0x6b');}throw new db[(_0x7c5d('0x63'))][(_0x7c5d('0x64'))](_0x34bcd4);}}return;};exports['updatePasswordsHistory']=function(_0x2b2a5f,_0x3db9e4){var _0x254de2=_0x3db9e4?encryptor[_0x7c5d('0x66')](_0x3db9e4)[_0x7c5d('0x67')](','):[];if(_0x254de2['length']===0x5){_0x254de2['splice'](-0x1,0x1);}_0x254de2[_0x7c5d('0x6c')](_0x2b2a5f);return encryptor[_0x7c5d('0x6d')](_0x254de2['join'](','));};function signJwt(_0x42e15a){var _0x448011=BPromise[_0x7c5d('0x6e')](jwt[_0x7c5d('0x6f')],{'context':jwt});var _0x1409db=_0x42e15a[_0x7c5d('0x70')]||config['secrets'][_0x7c5d('0x9')];return new BPromise(function(_0x39568a,_0x36c33c){_0x448011(_0x42e15a[_0x7c5d('0x71')],_0x1409db,_0x42e15a[_0x7c5d('0x72')])[_0x7c5d('0x2e')](function(_0x51a40d){_0x39568a(_0x51a40d);})[_0x7c5d('0x33')](function(_0x343464){_0x36c33c(_0x343464);});});}function verifyJwt(_0x54e490,_0x15573f,_0x1dad44){var _0x440fa5=BPromise[_0x7c5d('0x6e')](jwt[_0x7c5d('0x73')],{'context':jwt});var _0x266254=_0x1dad44||config[_0x7c5d('0x8')]['session'];return new BPromise(function(_0x56010d,_0x5d54a3){_0x440fa5(_0x54e490,_0x266254,_0x15573f)[_0x7c5d('0x2e')](function(_0x2f8377){_0x56010d(_0x2f8377);})[_0x7c5d('0x33')](function(_0x2d4f95){_0x5d54a3(_0x2d4f95);});});}function generateNonce(){return crypto[_0x7c5d('0x74')](0x10)[_0x7c5d('0x75')](_0x7c5d('0x76'));}function generateIssuedAt(){return Math[_0x7c5d('0x77')](Date['now']()/0x3e8)[_0x7c5d('0x75')]();}function createJwt(_0x170ccc){var _0x258fa7={'payload':{'iat':_0x170ccc[_0x7c5d('0x5e')],'nonce':_0x170ccc['apiKeyNonce']},'options':{'algorithm':_0x7c5d('0x78'),'subject':_0x170ccc['id']['toString'](),'issuer':hardwareConf[_0x7c5d('0x3f')](),'audience':hardwareConf[_0x7c5d('0x3f')]()}};return signJwt(_0x258fa7)[_0x7c5d('0x2e')](function(_0x4aa13d){return{'iat':_0x170ccc['apiKeyIat'],'nonce':_0x170ccc['apiKeyNonce'],'token':_0x4aa13d};});} \ No newline at end of file +var _0x2ac1=['apiKeyIat','generateApiKey','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','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.','split','unshift','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','toString','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','disposition','then','closed','status','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','apikey','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','/dashboards/general','send','retrieveApiKey','isNil'];(function(_0x564ea1,_0x2be3fd){var _0x519a53=function(_0x131bf3){while(--_0x131bf3){_0x564ea1['push'](_0x564ea1['shift']());}};_0x519a53(++_0x2be3fd);}(_0x2ac1,0x11d));var _0x12ac=function(_0x466186,_0x2276fb){_0x466186=_0x466186-0x0;var _0x1ee9af=_0x2ac1[_0x466186];return _0x1ee9af;};'use strict';var db=require(_0x12ac('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x12ac('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x12ac('0x2'));var jwt=require(_0x12ac('0x3'));var expressJwt=require(_0x12ac('0x4'));var compose=require(_0x12ac('0x5'));var basicAuth=require(_0x12ac('0x6'));var crypto=require(_0x12ac('0x7'));var BPromise=require(_0x12ac('0x8'));var util=require(_0x12ac('0x9'));var moment=require(_0x12ac('0xa'));var validateJwt=expressJwt({'secret':config[_0x12ac('0xb')][_0x12ac('0xc')]});var userAttributes=['id','role',_0x12ac('0xd'),_0x12ac('0xe'),_0x12ac('0xf'),_0x12ac('0x10'),_0x12ac('0x11'),_0x12ac('0x12'),_0x12ac('0x13'),_0x12ac('0x14'),_0x12ac('0x15'),'mailPause',_0x12ac('0x16'),_0x12ac('0x17'),_0x12ac('0x18'),_0x12ac('0x19'),'showWebBar','lastLoginAt',_0x12ac('0x1a'),_0x12ac('0x1b'),_0x12ac('0x1c'),_0x12ac('0x1d'),'alias',_0x12ac('0x1e'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0x12ac('0x1f'),_0x12ac('0x20'),_0x12ac('0x21'),_0x12ac('0x22'),_0x12ac('0x23'),_0x12ac('0x24'),_0x12ac('0x25'),'hotdesk',_0x12ac('0x26'),_0x12ac('0x27'),_0x12ac('0x28'),_0x12ac('0x29'),_0x12ac('0x2a'),'downloadVoiceRecordings',_0x12ac('0x2b'),_0x12ac('0x2c')];exports[_0x12ac('0x2d')]=function(){return this[_0x12ac('0x2e')](!![])[_0x12ac('0x2f')](function(_0x5077d9,_0x43ce08,_0xf2070d){if(_0x5077d9[_0x12ac('0x30')]){_0xf2070d();}else{return db[_0x12ac('0x31')][_0x12ac('0x32')]({'where':{'id':_0x5077d9['params']['id']},'attributes':['id','closed',_0x12ac('0x33')],'raw':!![]})[_0x12ac('0x34')](function(_0x22df71){if(_0x22df71&&_0x22df71[_0x12ac('0x35')]){return _0x43ce08[_0x12ac('0x36')](_0x22df71[_0x12ac('0x33')]===_0x12ac('0x37')?0x195:0x193)['json']({'message':_0x22df71['disposition']===_0x12ac('0x37')?_0x12ac('0x38'):_0x12ac('0x39')});}else{_0xf2070d();}})['catch'](function(_0x168dc9){_0xf2070d(_0x168dc9);});}});};exports['isAuthenticated']=function isAuthenticated(_0x10448f){return compose()[_0x12ac('0x2f')](function(_0x8774b5,_0x175c30,_0x68644){var _0x56e468;if(_0x8774b5[_0x12ac('0x3a')][_0x12ac('0x3b')]){if(_[_0x12ac('0x3c')](_0x8774b5[_0x12ac('0x3a')]['authorization'],_0x12ac('0x3d'))){var _0xf6cb80=basicAuth(_0x8774b5);db[_0x12ac('0x3e')][_0x12ac('0x3f')]({'where':{'name':_0xf6cb80[_0x12ac('0xe')]}})[_0x12ac('0x34')](function(_0xdc7ea5){if(!_0xdc7ea5||!_0xdc7ea5[_0x12ac('0x40')](_0xf6cb80[_0x12ac('0x41')])){return _0x175c30[_0x12ac('0x36')](0x191)['json']({'message':_0x12ac('0x42')});}_0x8774b5[_0x12ac('0x30')]={'id':_0xdc7ea5['id']};_0x68644();})['catch'](function(_0x5da995){_0x68644(_0x5da995);});}else if(_[_0x12ac('0x3c')](_0x8774b5[_0x12ac('0x3a')][_0x12ac('0x3b')],_0x12ac('0x43'))){validateJwt(_0x8774b5,_0x175c30,_0x68644);}else{if(_0x10448f){_0x68644();}else{return _0x175c30[_0x12ac('0x36')](0x193)[_0x12ac('0x44')]({'message':_0x12ac('0x45')});}}}else if(_0x8774b5[_0x12ac('0x46')][_0x12ac('0x47')]){try{var _0x213b05={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x8774b5[_0x12ac('0x46')][_0x12ac('0x47')],_0x213b05)[_0x12ac('0x34')](function(_0x1b4d47){return db[_0x12ac('0x3e')][_0x12ac('0x3f')]({'where':{'id':_0x1b4d47[_0x12ac('0x48')]}})[_0x12ac('0x34')](function(_0x677065){_0x56e468=_0x677065;return db[_0x12ac('0x49')][_0x12ac('0x32')]({'where':{'id':0x1},'attributes':[_0x12ac('0x4a'),_0x12ac('0x4b')],'raw':!![]});})[_0x12ac('0x34')](function(_0x11d10e){if(!_0x56e468||!_[_0x12ac('0x4c')](_0x56e468[_0x12ac('0x4d')],_0x1b4d47['nonce'])){return _0x175c30[_0x12ac('0x36')](0x191)['json']({'message':_0x12ac('0x4e')});}if(_0x56e468[_0x12ac('0x4f')]){return _0x175c30[_0x12ac('0x36')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e468[_0x12ac('0x50')]){if(_0x11d10e[_0x12ac('0x4b')]>0x0){if(moment(_0x56e468[_0x12ac('0x51')])[_0x12ac('0x52')](_0x11d10e[_0x12ac('0x4b')],_0x12ac('0x53'))>moment()){return _0x175c30[_0x12ac('0x36')](0x191)[_0x12ac('0x44')]({'message':_0x12ac('0x54')});}}else{return _0x175c30['status'](0x191)['json']({'message':_0x12ac('0x54')});}}_0x8774b5['user']={'id':_0x56e468['id']};_0x68644();});})[_0x12ac('0x55')](function(){return _0x175c30['status'](0x191)[_0x12ac('0x44')]({'message':_0x12ac('0x54')});});}catch(_0x3a37cb){_0x68644(_0x3a37cb);}}else if(_0x10448f){_0x68644();}else{return _0x175c30[_0x12ac('0x36')](0x193)['json']({'message':_0x12ac('0x45')});}})[_0x12ac('0x2f')](function(_0x322afe,_0x1b8e70,_0x3dc662){if(_0x322afe[_0x12ac('0x30')]){db[_0x12ac('0x3e')][_0x12ac('0x3f')]({'where':{'id':_0x322afe['user']['id']},'attributes':userAttributes})['then'](function(_0x2c02f2){if(!_0x2c02f2){return _0x1b8e70[_0x12ac('0x36')](0x194)[_0x12ac('0x44')]({'message':_0x12ac('0x56')});}_0x322afe[_0x12ac('0x30')]=_0x2c02f2;_0x3dc662();})['catch'](function(_0x46c083){_0x3dc662(_0x46c083);});}else if(_0x10448f){_0x3dc662();}else{return _0x1b8e70['status'](0x194)[_0x12ac('0x44')]({'message':_0x12ac('0x57')});}});};exports[_0x12ac('0x58')]=function canUpdate(){return compose()['use'](function(_0x58cce7,_0x4fbec4,_0x5ce189){return licenseUtil[_0x12ac('0x59')]()['then'](function(_0x405fff){if(_0x405fff[_0x12ac('0x5a')]){_0x5ce189();}else{return _0x4fbec4[_0x12ac('0x36')](0x193)[_0x12ac('0x44')]({'message':_0x12ac('0x5b')});}})[_0x12ac('0x55')](function(_0x4a081b){_0x5ce189(_0x4a081b);});});};exports[_0x12ac('0x5c')]=function(_0x4b4e9f,_0x3a6690,_0x57ddfd){_0x4b4e9f['isMiddleware']=!![];return _0x57ddfd();};exports[_0x12ac('0x5d')]=function signToken(_0x5684fe){return signJwt(_0x5684fe);};exports[_0x12ac('0x5e')]=function(_0x59fd56,_0x490704){if(!_0x59fd56['user']){return _0x490704['status'](0x194)['json']({'message':_0x12ac('0x5f')});}var _0x3854db={'payload':{'id':_0x59fd56[_0x12ac('0x30')]['id'],'role':_0x59fd56[_0x12ac('0x30')][_0x12ac('0x60')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3854db)[_0x12ac('0x34')](function(_0x326b60){_0x490704['cookie'](_0x12ac('0x61'),_0x326b60);_0x490704['redirect'](_0x12ac('0x62'));})[_0x12ac('0x55')](function(_0x7091b8){return _0x490704['status'](0x1f4)[_0x12ac('0x63')](_0x7091b8);});};exports[_0x12ac('0x64')]=function(_0x41983b){if(_[_0x12ac('0x65')](_0x41983b[_0x12ac('0x4d')])||_[_0x12ac('0x65')](_0x41983b[_0x12ac('0x66')])){return null;}else{return createJwt(_0x41983b);}};exports[_0x12ac('0x67')]=function(_0x19b5d9){_0x19b5d9['apiKeyNonce']=generateNonce();_0x19b5d9['apiKeyIat']=generateIssuedAt();return createJwt(_0x19b5d9);};exports[_0x12ac('0x68')]=function(_0x4948d3,_0x3612be){var _0x549847=_0x4948d3[_0x12ac('0x46')][_0x12ac('0x47')];if(_0x549847){var _0x329909={'nonce':_0x3612be[_0x12ac('0x4d')],'iat':_0x3612be[_0x12ac('0x66')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x12ac('0x69')]()};return verifyJwt(_0x549847,_0x329909)[_0x12ac('0x34')](function(){return generateApiKey(_0x3612be);});}else{throw{'message':_0x12ac('0x6a')};}};exports['validatePasswordPattern']=function(_0x18d7e6){var _0x127507=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x127507[_0x12ac('0x6b')](_0x18d7e6))throw new db[(_0x12ac('0x6c'))][(_0x12ac('0x6d'))](_0x12ac('0x6e'));return;};exports[_0x12ac('0x6f')]=function(_0x2f7c57,_0x3ab6d5,_0xae1309){var _0x26af40=encryptor['decryptString'](_0x3ab6d5)['split'](',');for(var _0x550164=0x0;_0x550164<_0xae1309;_0x550164++){if(!_0x26af40[_0x550164])break;if(_0x2f7c57[_0x12ac('0x70')]()===_0x26af40[_0x550164]['toLowerCase']()){var _0x5471b5=util['format'](_0x12ac('0x71'),_0xae1309);if(_0xae1309===0x1){_0x5471b5=_0x12ac('0x72');}throw new db[(_0x12ac('0x6c'))]['ValidationError'](_0x5471b5);}}return;};exports['updatePasswordsHistory']=function(_0x56f917,_0x45c43d){var _0x18f4ce=_0x45c43d?encryptor['decryptString'](_0x45c43d)[_0x12ac('0x73')](','):[];if(_0x18f4ce['length']===0x5){_0x18f4ce['splice'](-0x1,0x1);}_0x18f4ce[_0x12ac('0x74')](_0x56f917);return encryptor['encryptString'](_0x18f4ce[_0x12ac('0x75')](','));};function signJwt(_0x2ffe55){var _0x144630=BPromise[_0x12ac('0x76')](jwt[_0x12ac('0x77')],{'context':jwt});var _0x31e13b=_0x2ffe55[_0x12ac('0x78')]||config['secrets']['session'];return new BPromise(function(_0x1e74aa,_0xc6fdda){_0x144630(_0x2ffe55[_0x12ac('0x79')],_0x31e13b,_0x2ffe55[_0x12ac('0x7a')])[_0x12ac('0x34')](function(_0x54f1c4){_0x1e74aa(_0x54f1c4);})[_0x12ac('0x55')](function(_0x36cf91){_0xc6fdda(_0x36cf91);});});}function verifyJwt(_0x4d4e2a,_0x2c7087,_0xebb9c5){var _0x51e7dc=BPromise[_0x12ac('0x76')](jwt[_0x12ac('0x7b')],{'context':jwt});var _0x586160=_0xebb9c5||config[_0x12ac('0xb')][_0x12ac('0xc')];return new BPromise(function(_0x398ec4,_0x404182){_0x51e7dc(_0x4d4e2a,_0x586160,_0x2c7087)[_0x12ac('0x34')](function(_0x491de8){_0x398ec4(_0x491de8);})['catch'](function(_0xf9b098){_0x404182(_0xf9b098);});});}function generateNonce(){return crypto[_0x12ac('0x7c')](0x10)['toString'](_0x12ac('0x7d'));}function generateIssuedAt(){return Math[_0x12ac('0x7e')](Date[_0x12ac('0x7f')]()/0x3e8)[_0x12ac('0x80')]();}function createJwt(_0x179a71){var _0x297615={'payload':{'iat':_0x179a71[_0x12ac('0x66')],'nonce':_0x179a71[_0x12ac('0x4d')]},'options':{'algorithm':'HS512','subject':_0x179a71['id']['toString'](),'issuer':hardwareConf[_0x12ac('0x69')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x297615)[_0x12ac('0x34')](function(_0x149108){return{'iat':_0x179a71[_0x12ac('0x66')],'nonce':_0x179a71[_0x12ac('0x4d')],'token':_0x149108};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 2d78b36..c682fd6 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 _0xdccb=['update','binary','write','end','final','close','unlink','decryptFile','createDecipher','secret','createCipher','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data'];(function(_0x22c792,_0x51866d){var _0xee78e0=function(_0x2292f2){while(--_0x2292f2){_0x22c792['push'](_0x22c792['shift']());}};_0xee78e0(++_0x51866d);}(_0xdccb,0x1c8));var _0xbdcc=function(_0x52b9a2,_0x4e8ea1){_0x52b9a2=_0x52b9a2-0x0;var _0xdce3cf=_0xdccb[_0x52b9a2];return _0xdce3cf;};'use strict';var crypto=require(_0xbdcc('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xbdcc('0x1'));var config=require(_0xbdcc('0x2'));var logger=require(_0xbdcc('0x3'))(_0xbdcc('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xbdcc('0x5')]['session'],'algorithm':_0xbdcc('0x6')};const fileOptions={'algorithm':_0xbdcc('0x7')};if(config[_0xbdcc('0x8')]&&config['encrypt'][_0xbdcc('0x9')]){var isSupported=isAlgorithmSupported(config[_0xbdcc('0x8')]['algorithm']);if(isSupported){fileOptions[_0xbdcc('0x9')]=config[_0xbdcc('0x8')][_0xbdcc('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xbdcc('0xa')](',\x20');logger['error'](config[_0xbdcc('0x8')]['algorithm'],_0xbdcc('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x37e9b1){return AES_SUPPORTED_RX[_0xbdcc('0xc')](_0x37e9b1);}function getSupportedCiphers(){return crypto[_0xbdcc('0xd')]()[_0xbdcc('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x35d5cf){return getSupportedCiphers()['indexOf'](_0x35d5cf)>-0x1;}function combineOptions(_0x1e505e){var _0x34eaba={};for(var _0x194b64 in fileOptions){if(fileOptions[_0xbdcc('0xf')](_0x194b64)){_0x34eaba[_0x194b64]=fileOptions[_0x194b64];}}if(_0x1e505e){for(var _0x1d7e9c in _0x1e505e){if(_0x1e505e[_0xbdcc('0xf')](_0x1d7e9c)){_0x34eaba[_0x1d7e9c]=_0x1e505e[_0x1d7e9c];}}}return _0x34eaba;}exports[_0xbdcc('0x10')]=function(_0x533322,_0x52f1c4,_0x5045f4,_0x39d50c){return new BPromise(function(_0x2d2276,_0xaf0c51){_0x39d50c=combineOptions(_0x39d50c);var _0x19a402=new Buffer(_0x5045f4);var _0x345261=fs[_0xbdcc('0x11')](_0x533322);var _0x405eb1=fs[_0xbdcc('0x12')](_0x52f1c4);var _0x5bb41d=crypto['createCipher'](_0x39d50c[_0xbdcc('0x9')],_0x19a402);_0x345261['on'](_0xbdcc('0x13'),function(_0xeeb82){var _0x136dba=new Buffer(_0x5bb41d[_0xbdcc('0x14')](_0xeeb82),_0xbdcc('0x15'));_0x405eb1[_0xbdcc('0x16')](_0x136dba);});_0x345261['on'](_0xbdcc('0x17'),function(){try{var _0x48ed8f=new Buffer(_0x5bb41d[_0xbdcc('0x18')](_0xbdcc('0x15')),_0xbdcc('0x15'));_0x405eb1[_0xbdcc('0x16')](_0x48ed8f);_0x405eb1[_0xbdcc('0x17')]();_0x405eb1['on'](_0xbdcc('0x19'),function(){return _0x2d2276(_0x52f1c4);});}catch(_0x18bcfe){fs[_0xbdcc('0x1a')](_0x52f1c4);return _0xaf0c51(_0x18bcfe);}});});};exports[_0xbdcc('0x1b')]=function(_0x2d7608,_0x1219a2,_0x5599c4,_0x19fc5e){return new BPromise(function(_0x5ed6eb,_0x1eb7c3){_0x19fc5e=combineOptions(_0x19fc5e);var _0x7cbbd8=new Buffer(_0x5599c4);var _0x37fc57=fs[_0xbdcc('0x11')](_0x2d7608);var _0x330491=fs['createWriteStream'](_0x1219a2);var _0x481a49=crypto[_0xbdcc('0x1c')](_0x19fc5e[_0xbdcc('0x9')],_0x7cbbd8);_0x37fc57['on'](_0xbdcc('0x13'),function(_0x22d05a){var _0x2830d6=new Buffer(_0x481a49['update'](_0x22d05a),'binary');_0x330491['write'](_0x2830d6);});_0x37fc57['on'](_0xbdcc('0x17'),function(){try{var _0x2415e4=new Buffer(_0x481a49[_0xbdcc('0x18')](_0xbdcc('0x15')),_0xbdcc('0x15'));_0x330491['write'](_0x2415e4);_0x330491[_0xbdcc('0x17')]();_0x330491['on'](_0xbdcc('0x19'),function(){return _0x5ed6eb(_0x1219a2);});}catch(_0x526e3c){fs[_0xbdcc('0x1a')](_0x1219a2);return _0x1eb7c3(_0x526e3c);}});});};exports['encryptString']=function(_0x5bed93,_0x4b8f8d,_0x20014d){var _0x2e4f6c=_0x20014d||stringOptions[_0xbdcc('0x9')];var _0x57b9fb=_0x4b8f8d||stringOptions[_0xbdcc('0x1d')];var _0x9d2f21=crypto[_0xbdcc('0x1e')](_0x2e4f6c,_0x57b9fb);var _0x2156b2=_0x9d2f21[_0xbdcc('0x14')](_0x5bed93,_0xbdcc('0x1f'),_0xbdcc('0x20'));_0x2156b2+=_0x9d2f21['final'](_0xbdcc('0x20'));return _0x2156b2;};exports[_0xbdcc('0x21')]=function(_0x158917,_0xe11e72,_0x503870){var _0x420f6d=_0x503870||stringOptions[_0xbdcc('0x9')];var _0x21d765=_0xe11e72||stringOptions[_0xbdcc('0x1d')];var _0x56cb1f=crypto[_0xbdcc('0x1c')](_0x420f6d,_0x21d765);var _0x3b06b5=_0x56cb1f[_0xbdcc('0x14')](_0x158917,_0xbdcc('0x20'),_0xbdcc('0x1f'));_0x3b06b5+=_0x56cb1f[_0xbdcc('0x18')](_0xbdcc('0x1f'));return _0x3b06b5;}; \ No newline at end of file +var _0xb46d=['unlink','decryptFile','createDecipher','encryptString','createCipher','utf8','base64','decryptString','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','end','final','write'];(function(_0x41265b,_0x3997ca){var _0x101e2d=function(_0x43b13f){while(--_0x43b13f){_0x41265b['push'](_0x41265b['shift']());}};_0x101e2d(++_0x3997ca);}(_0xb46d,0xad));var _0xdb46=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xb46d[_0x65c50e];return _0x4573e7;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xdb46('0x0'));var _=require('lodash');var config=require(_0xdb46('0x1'));var logger=require(_0xdb46('0x2'))(_0xdb46('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xdb46('0x4')][_0xdb46('0x5')],'algorithm':_0xdb46('0x6')};const fileOptions={'algorithm':_0xdb46('0x7')};if(config[_0xdb46('0x8')]&&config[_0xdb46('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xdb46('0x8')][_0xdb46('0x9')]);if(isSupported){fileOptions[_0xdb46('0x9')]=config[_0xdb46('0x8')][_0xdb46('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdb46('0xa')](',\x20');logger['error'](config['encrypt'][_0xdb46('0x9')],_0xdb46('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x14cb7a){return AES_SUPPORTED_RX['test'](_0x14cb7a);}function getSupportedCiphers(){return crypto[_0xdb46('0xc')]()[_0xdb46('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x5a880e){return getSupportedCiphers()[_0xdb46('0xe')](_0x5a880e)>-0x1;}function combineOptions(_0x150fd6){var _0x606116={};for(var _0x5e057d in fileOptions){if(fileOptions[_0xdb46('0xf')](_0x5e057d)){_0x606116[_0x5e057d]=fileOptions[_0x5e057d];}}if(_0x150fd6){for(var _0x497d3c in _0x150fd6){if(_0x150fd6['hasOwnProperty'](_0x497d3c)){_0x606116[_0x497d3c]=_0x150fd6[_0x497d3c];}}}return _0x606116;}exports[_0xdb46('0x10')]=function(_0xb8d0a8,_0x469fec,_0x4841da,_0x2ac85a){return new BPromise(function(_0x3ab758,_0x9ebe00){_0x2ac85a=combineOptions(_0x2ac85a);var _0x2f5193=new Buffer(_0x4841da);var _0x327b23=fs[_0xdb46('0x11')](_0xb8d0a8);var _0x3d4c31=fs[_0xdb46('0x12')](_0x469fec);var _0x19dc77=crypto['createCipher'](_0x2ac85a['algorithm'],_0x2f5193);_0x327b23['on'](_0xdb46('0x13'),function(_0x39cd34){var _0x6c7889=new Buffer(_0x19dc77[_0xdb46('0x14')](_0x39cd34),_0xdb46('0x15'));_0x3d4c31['write'](_0x6c7889);});_0x327b23['on'](_0xdb46('0x16'),function(){try{var _0x3921d6=new Buffer(_0x19dc77[_0xdb46('0x17')]('binary'),_0xdb46('0x15'));_0x3d4c31[_0xdb46('0x18')](_0x3921d6);_0x3d4c31[_0xdb46('0x16')]();_0x3d4c31['on']('close',function(){return _0x3ab758(_0x469fec);});}catch(_0x3f0562){fs[_0xdb46('0x19')](_0x469fec);return _0x9ebe00(_0x3f0562);}});});};exports[_0xdb46('0x1a')]=function(_0x1d7bf5,_0x360768,_0x242421,_0x340487){return new BPromise(function(_0x119a94,_0x1bc1d5){_0x340487=combineOptions(_0x340487);var _0x2d5941=new Buffer(_0x242421);var _0x91057c=fs[_0xdb46('0x11')](_0x1d7bf5);var _0x56fdb4=fs[_0xdb46('0x12')](_0x360768);var _0x26bc19=crypto[_0xdb46('0x1b')](_0x340487[_0xdb46('0x9')],_0x2d5941);_0x91057c['on'](_0xdb46('0x13'),function(_0x53d023){var _0x37da86=new Buffer(_0x26bc19[_0xdb46('0x14')](_0x53d023),'binary');_0x56fdb4[_0xdb46('0x18')](_0x37da86);});_0x91057c['on'](_0xdb46('0x16'),function(){try{var _0x9af8bb=new Buffer(_0x26bc19[_0xdb46('0x17')](_0xdb46('0x15')),_0xdb46('0x15'));_0x56fdb4['write'](_0x9af8bb);_0x56fdb4[_0xdb46('0x16')]();_0x56fdb4['on']('close',function(){return _0x119a94(_0x360768);});}catch(_0x1e67cd){fs[_0xdb46('0x19')](_0x360768);return _0x1bc1d5(_0x1e67cd);}});});};exports[_0xdb46('0x1c')]=function(_0x1816f5,_0x5a8533,_0x46f69d){var _0x5d7170=_0x46f69d||stringOptions[_0xdb46('0x9')];var _0x3d9765=_0x5a8533||stringOptions['secret'];var _0x2d5321=crypto[_0xdb46('0x1d')](_0x5d7170,_0x3d9765);var _0x21b4f8=_0x2d5321[_0xdb46('0x14')](_0x1816f5,_0xdb46('0x1e'),'base64');_0x21b4f8+=_0x2d5321[_0xdb46('0x17')](_0xdb46('0x1f'));return _0x21b4f8;};exports[_0xdb46('0x20')]=function(_0x3c2d2e,_0x28b5c0,_0x543483){var _0x307c9e=_0x543483||stringOptions[_0xdb46('0x9')];var _0xb7f7a=_0x28b5c0||stringOptions['secret'];var _0x3b940d=crypto[_0xdb46('0x1b')](_0x307c9e,_0xb7f7a);var _0x2df5a8=_0x3b940d[_0xdb46('0x14')](_0x3c2d2e,'base64','utf8');_0x2df5a8+=_0x3b940d[_0xdb46('0x17')]('utf8');return _0x2df5a8;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index cc4355a..7189dc4 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 _0xae7d=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','util','path','lodash','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach'];(function(_0x4091da,_0x5740a4){var _0xa14d25=function(_0xa75e86){while(--_0xa75e86){_0x4091da['push'](_0x4091da['shift']());}};_0xa14d25(++_0x5740a4);}(_0xae7d,0xd3));var _0xdae7=function(_0x16607b,_0x43692c){_0x16607b=_0x16607b-0x0;var _0xf817d1=_0xae7d[_0x16607b];return _0xf817d1;};'use strict';var util=require(_0xdae7('0x0'));var path=require(_0xdae7('0x1'));var _=require(_0xdae7('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xdae7('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xdae7('0x4'));var db=require(_0xdae7('0x5'))['db'];var dbH=require(_0xdae7('0x5'))[_0xdae7('0x6')];var logger=require('../../config/logger')(_0xdae7('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xdae7('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x180196,_0xf06832){var _0x50b7fd={'status':_0x180196};var _0x5b34ce={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf06832){_0x50b7fd['savename']=_0xf06832;}return db[_0xdae7('0x9')][_0xdae7('0xa')](_0x50b7fd,_0x5b34ce);}function main(){var _0x1034ba=0x1388;var _0x57244f;logger['info'](util[_0xdae7('0xb')](_0xdae7('0xc'),EXTRACTED_REPORT_ID,_0xdae7('0xd')));return db[_0xdae7('0xe')][_0xdae7('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdae7('0x10'),_0xdae7('0x11')]})['then'](function(_0x3f02bf){if(_0x3f02bf){_0x57244f=_0x3f02bf;_0x1034ba=_0x57244f[_0xdae7('0x11')]||0x1388;}})[_0xdae7('0x12')](function(){return dbH[_0xdae7('0x13')][_0xdae7('0x14')](util['format'](_0xdae7('0x15'),QUERY),{'type':dbH[_0xdae7('0x13')]['QueryTypes'][_0xdae7('0x16')]});})['then'](function(_0x2401ef){if(!_0x2401ef[0x0][_0xdae7('0x17')]){return analyticExtractedReport(_0xdae7('0x18'));}var _0x43769d=[];var _0x112d5f=0x0;if(_0x57244f[_0xdae7('0x10')]){if(_0x2401ef&&_0x2401ef[_0xdae7('0x19')]){var _0x36b52e=_[_0xdae7('0x1a')](_0x2401ef[0x0][_0xdae7('0x17')]/_0x1034ba);var _0x13c0e7=Number[_0xdae7('0x1b')](_0x2401ef[0x0][_0xdae7('0x17')]/_0x1034ba)?_0x2401ef[0x0][_0xdae7('0x17')]%_0x1034ba:0x0;_0x36b52e[_0xdae7('0x1c')](function(_0x590b9b){if(_0x590b9b>0x0){_0x112d5f+=_0x1034ba;}_0x43769d[_0xdae7('0x1d')](dbH['sequelize'][_0xdae7('0x14')](util[_0xdae7('0xb')](_0xdae7('0x1e'),QUERY,_0x1034ba,_0x112d5f),{'type':dbH[_0xdae7('0x13')]['QueryTypes'][_0xdae7('0x16')]}));});if(_0x13c0e7>0x0){_0x112d5f+=_0x1034ba;_0x43769d[_0xdae7('0x1d')](dbH[_0xdae7('0x13')]['query'](util['format'](_0xdae7('0x1e'),QUERY,_0x13c0e7,_0x112d5f),{'type':dbH[_0xdae7('0x13')]['QueryTypes'][_0xdae7('0x16')]}));}}}else{_0x43769d['push'](dbH[_0xdae7('0x13')]['query'](QUERY,{'type':dbH[_0xdae7('0x13')]['QueryTypes']['SELECT']}));}var _0x4d3df3=path[_0xdae7('0x1f')](PATH);var _0x28bf3e=path[_0xdae7('0x20')](PATH,_0xdae7('0x21'));var _0x1a7b23=_0x57244f[_0xdae7('0x10')]&&_0x43769d['length']>0x1;var _0x3acfc4=[];if(!fs['existsSync'](path['join'](_0x4d3df3,_0x28bf3e))&&_0x1a7b23){fs[_0xdae7('0x22')](path[_0xdae7('0x23')](_0x4d3df3,_0x28bf3e));}return BPromise[_0xdae7('0x24')](_0x43769d,function(_0x2d22b0){_0x3acfc4['push'](_0x2d22b0);})['then'](function(){for(var _0x5cd5df=0x0;_0x5cd5df<_0x3acfc4[_0xdae7('0x19')];_0x5cd5df+=0x1){var _0x54bb8d;var _0xb4f10e=_0x3acfc4[_0x5cd5df];if(_0x1a7b23){_0x54bb8d=path[_0xdae7('0x23')](_0x4d3df3,_0x28bf3e,util[_0xdae7('0xb')](_0xdae7('0x25'),_0x28bf3e,_0x5cd5df,_0xdae7('0x26')));}else{_0x54bb8d=path[_0xdae7('0x23')](_0x4d3df3,util[_0xdae7('0xb')](_0xdae7('0x27'),_0x28bf3e,_0xdae7('0x26')));}fs[_0xdae7('0x28')](_0x54bb8d,csv(_0xb4f10e));}})[_0xdae7('0x12')](function(){if(_0x1a7b23){return new Promise(function(_0x18723a){zipdir(path[_0xdae7('0x23')](_0x4d3df3,_0x28bf3e),{'saveTo':path[_0xdae7('0x23')](_0x4d3df3,util[_0xdae7('0xb')](_0xdae7('0x27'),_0x28bf3e,_0xdae7('0x29')))},function(_0x20e4f2,_0x49c8a3){rimraf(path[_0xdae7('0x23')](_0x4d3df3,_0x28bf3e),function(){});_0x18723a('zip\x20finished');});});}})['then'](function(){logger[_0xdae7('0x2a')](util['format'](_0xdae7('0x2b'),EXTRACTED_REPORT_ID,_0xdae7('0xd')));return analyticExtractedReport(_0xdae7('0x2c'),_0x1a7b23?util[_0xdae7('0xb')](_0xdae7('0x27'),_0x28bf3e,_0x1a7b23?_0xdae7('0x29'):_0xdae7('0x26')):null);});})[_0xdae7('0x2d')](function(_0x3fe584){logger[_0xdae7('0x2a')](util[_0xdae7('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xdae7('0xd')),util[_0xdae7('0x2e')](_0x3fe584,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdae7('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x058e=['push','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','isInteger','forEach'];(function(_0x29d717,_0x25a8b9){var _0xa1ed40=function(_0x4b59ca){while(--_0x4b59ca){_0x29d717['push'](_0x29d717['shift']());}};_0xa1ed40(++_0x25a8b9);}(_0x058e,0x1a5));var _0xe058=function(_0x297a99,_0x64476d){_0x297a99=_0x297a99-0x0;var _0x11e1d6=_0x058e[_0x297a99];return _0x11e1d6;};'use strict';var util=require(_0xe058('0x0'));var path=require(_0xe058('0x1'));var _=require(_0xe058('0x2'));var csv=require(_0xe058('0x3'));var fs=require('fs');var BPromise=require(_0xe058('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xe058('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe058('0x6'))['dbH'];var logger=require(_0xe058('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe058('0x8')][0x2]);var QUERY=process[_0xe058('0x8')][0x3];var PATH=process[_0xe058('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x123886,_0x2d27a0){var _0x2132b0={'status':_0x123886};var _0x5205dd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d27a0){_0x2132b0[_0xe058('0x9')]=_0x2d27a0;}return db[_0xe058('0xa')][_0xe058('0xb')](_0x2132b0,_0x5205dd);}function main(){var _0x50f222=0x1388;var _0x2b9d09;logger[_0xe058('0xc')](util[_0xe058('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe058('0xe')));return db[_0xe058('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe058('0x10'),_0xe058('0x11')]})[_0xe058('0x12')](function(_0x1b6743){if(_0x1b6743){_0x2b9d09=_0x1b6743;_0x50f222=_0x2b9d09[_0xe058('0x11')]||0x1388;}})[_0xe058('0x12')](function(){return dbH[_0xe058('0x13')][_0xe058('0x14')](util['format'](_0xe058('0x15'),QUERY),{'type':dbH[_0xe058('0x13')][_0xe058('0x16')][_0xe058('0x17')]});})[_0xe058('0x12')](function(_0x5af185){if(!_0x5af185[0x0]['num']){return analyticExtractedReport(_0xe058('0x18'));}var _0x10e84a=[];var _0x586a14=0x0;if(_0x2b9d09['split']){if(_0x5af185&&_0x5af185[_0xe058('0x19')]){var _0xce1587=_['range'](_0x5af185[0x0][_0xe058('0x1a')]/_0x50f222);var _0x37bceb=Number[_0xe058('0x1b')](_0x5af185[0x0][_0xe058('0x1a')]/_0x50f222)?_0x5af185[0x0]['num']%_0x50f222:0x0;_0xce1587[_0xe058('0x1c')](function(_0x407a37){if(_0x407a37>0x0){_0x586a14+=_0x50f222;}_0x10e84a[_0xe058('0x1d')](dbH[_0xe058('0x13')][_0xe058('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x50f222,_0x586a14),{'type':dbH['sequelize'][_0xe058('0x16')][_0xe058('0x17')]}));});if(_0x37bceb>0x0){_0x586a14+=_0x50f222;_0x10e84a[_0xe058('0x1d')](dbH[_0xe058('0x13')][_0xe058('0x14')](util[_0xe058('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x37bceb,_0x586a14),{'type':dbH[_0xe058('0x13')][_0xe058('0x16')]['SELECT']}));}}}else{_0x10e84a[_0xe058('0x1d')](dbH[_0xe058('0x13')][_0xe058('0x14')](QUERY,{'type':dbH[_0xe058('0x13')][_0xe058('0x16')]['SELECT']}));}var _0x14b9ba=path['dirname'](PATH);var _0x13c935=path['basename'](PATH,_0xe058('0x1e'));var _0xfefb03=_0x2b9d09[_0xe058('0x10')]&&_0x10e84a[_0xe058('0x19')]>0x1;var _0x1a3683=[];if(!fs[_0xe058('0x1f')](path[_0xe058('0x20')](_0x14b9ba,_0x13c935))&&_0xfefb03){fs[_0xe058('0x21')](path[_0xe058('0x20')](_0x14b9ba,_0x13c935));}return BPromise['each'](_0x10e84a,function(_0x2b9694){_0x1a3683['push'](_0x2b9694);})[_0xe058('0x12')](function(){for(var _0x45083b=0x0;_0x45083b<_0x1a3683[_0xe058('0x19')];_0x45083b+=0x1){var _0x3b8c5a;var _0x46d368=_0x1a3683[_0x45083b];if(_0xfefb03){_0x3b8c5a=path[_0xe058('0x20')](_0x14b9ba,_0x13c935,util[_0xe058('0xd')](_0xe058('0x22'),_0x13c935,_0x45083b,_0xe058('0x23')));}else{_0x3b8c5a=path['join'](_0x14b9ba,util[_0xe058('0xd')](_0xe058('0x24'),_0x13c935,'csv'));}fs['writeFileSync'](_0x3b8c5a,csv(_0x46d368));}})[_0xe058('0x12')](function(){if(_0xfefb03){return new Promise(function(_0x351164){zipdir(path['join'](_0x14b9ba,_0x13c935),{'saveTo':path[_0xe058('0x20')](_0x14b9ba,util[_0xe058('0xd')](_0xe058('0x24'),_0x13c935,'zip'))},function(_0xe9e66f,_0x5cee95){rimraf(path[_0xe058('0x20')](_0x14b9ba,_0x13c935),function(){});_0x351164('zip\x20finished');});});}})[_0xe058('0x12')](function(){logger[_0xe058('0xc')](util[_0xe058('0xd')](_0xe058('0x25'),EXTRACTED_REPORT_ID,_0xe058('0xe')));return analyticExtractedReport(_0xe058('0x26'),_0xfefb03?util[_0xe058('0xd')](_0xe058('0x24'),_0x13c935,_0xfefb03?_0xe058('0x27'):_0xe058('0x23')):null);});})[_0xe058('0x28')](function(_0x33ff38){logger[_0xe058('0xc')](util[_0xe058('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe058('0xe')),util[_0xe058('0x29')](_0x33ff38,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe058('0x2a'));})[_0xe058('0x2b')](function(){process[_0xe058('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5e80a2f..652714a 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 _0xd5e9=['mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','PDF','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','map','tableHeader','pick','value','fill','length','auto','body','chunk','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','then','splitSizePdf','range','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xd5e9,0x17b));var _0x9d5e=function(_0x42b436,_0x56dd8f){_0x42b436=_0x42b436-0x0;var _0x5986b7=_0xd5e9[_0x42b436];return _0x5986b7;};'use strict';var _=require(_0x9d5e('0x0'));var fs=require('fs');var util=require(_0x9d5e('0x1'));var path=require(_0x9d5e('0x2'));var moment=require(_0x9d5e('0x3'));var htmlToPdfmake=require(_0x9d5e('0x4'));var PdfPrinter=require(_0x9d5e('0x5'));var zipdir=require(_0x9d5e('0x6'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x9d5e('0x7')];var window=new JSDOM('')[_0x9d5e('0x8')];var BPromise=require(_0x9d5e('0x9'));var db=require(_0x9d5e('0xa'))['db'];var dbH=require(_0x9d5e('0xa'))['dbH'];var logger=require('../../config/logger')(_0x9d5e('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x9d5e('0xc')][0x2]);var QUERY=process[_0x9d5e('0xc')][0x3];var PATH=process[_0x9d5e('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b1435,_0x3ffd7d){var _0x72e3f5={'status':_0x1b1435};var _0x30f6a3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ffd7d){_0x72e3f5[_0x9d5e('0xd')]=_0x3ffd7d;}return db[_0x9d5e('0xe')]['update'](_0x72e3f5,_0x30f6a3);}function getHeaders(_0x8e0e21){return _[_0x9d5e('0xf')](_0x8e0e21,function(_0x554817){return{'text':_0x554817,'style':_0x9d5e('0x10')};});}function getRows(_0x12a563,_0x52aa16){return _['map'](_0x52aa16,function(_0x453b01){return _(_0x453b01)[_0x9d5e('0x11')](_0x12a563)[_0x9d5e('0xf')](function(_0x5c93db){return _0x5c93db?_['toString'](_0x5c93db):'';})[_0x9d5e('0x12')]();});}function createTable(_0x4a5c1b,_0x8b547b){var _0x1366c4={'widths':_[_0x9d5e('0x13')](Array(_0x4a5c1b[_0x9d5e('0x14')]),0x91),'heights':function(_0x13d22e){return _0x13d22e===0x0?_0x9d5e('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1984b1=getHeaders(_0x4a5c1b);_0x1366c4[_0x9d5e('0x16')]['push'](_0x1984b1);var _0x3ce5ea=getRows(_0x4a5c1b,_0x8b547b);_0x1366c4[_0x9d5e('0x16')]=_0x1366c4['body']['concat'](_0x3ce5ea);return _0x1366c4;}function createTables(_0x596b87){var _0x58453b=[];var _0x3023c1=_[_0x9d5e('0x17')](Object['keys'](_0x596b87[0x0]),0x5);_0x3023c1[_0x9d5e('0x18')](function(_0x27dc2b){_0x58453b[_0x9d5e('0x19')](createTable(_0x27dc2b,_0x596b87));});return _0x58453b;}function getPDFDocDefinition(_0x57699f){var _0x3eb6a0=util[_0x9d5e('0x1a')](_0x9d5e('0x1b'),NAME,EXTRACTED_REPORT[_0x9d5e('0x1c')],moment(EXTRACTED_REPORT[_0x9d5e('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x9d5e('0x1e')])[_0x9d5e('0x1a')](FORMAT));var _0x224ce7=[];for(var _0x1b6b3e=0x0;_0x1b6b3e<_0x57699f[_0x9d5e('0x14')];_0x1b6b3e++){var _0x179bd8=[];if(_0x1b6b3e===0x0){_0x179bd8[_0x9d5e('0x19')]({'text':_0x3eb6a0,'style':_0x9d5e('0x1f')});}var _0x37b985={'table':_0x57699f[_0x1b6b3e]};if(_0x1b6b3e>0x0){_0x37b985[_0x9d5e('0x20')]='before';_0x37b985[_0x9d5e('0x21')]=[0x0,0x46,0x0,0x0];}_0x179bd8[_0x9d5e('0x19')](_0x37b985);_0x224ce7[_0x9d5e('0x19')](_0x179bd8);}return{'pageSize':'A4','pageOrientation':_0x9d5e('0x22'),'content':_0x224ce7,'footer':function(_0x5af8e2,_0xd2d1a4){return{'text':_0x5af8e2['toString']()+_0x9d5e('0x23')+_0xd2d1a4,'style':_0x9d5e('0x24')};},'defaultStyle':{'font':_0x9d5e('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9d5e('0x26')},'footer':{'alignment':_0x9d5e('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x52af88){var _0x247309=0x1388;var _0xf556c1;if(!_0x52af88[0x0]['num']){return analyticExtractedReport(_0x9d5e('0x28'));}return db[_0x9d5e('0x29')][_0x9d5e('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9d5e('0x2b'),'splitSizePdf']})[_0x9d5e('0x2c')](function(_0x27f95b){if(_0x27f95b){_0xf556c1=_0x27f95b;_0x247309=_0xf556c1[_0x9d5e('0x2d')]||0x3e8;}})['then'](function(){var _0x12c09e=[];var _0x5a8e81=0x0;if(_0xf556c1[_0x9d5e('0x2b')]){if(_0x52af88&&_0x52af88[_0x9d5e('0x14')]){var _0x416211=_[_0x9d5e('0x2e')](_0x52af88[0x0][_0x9d5e('0x2f')]/_0x247309);var _0x19d304=Number['isInteger'](_0x52af88[0x0][_0x9d5e('0x2f')]/_0x247309)?_0x52af88[0x0][_0x9d5e('0x2f')]%_0x247309:0x0;_0x416211[_0x9d5e('0x18')](function(_0x119d07){if(_0x119d07>0x0){_0x5a8e81+=_0x247309;}_0x12c09e[_0x9d5e('0x19')](dbH[_0x9d5e('0x30')][_0x9d5e('0x31')](util[_0x9d5e('0x1a')](_0x9d5e('0x32'),QUERY,_0x247309,_0x5a8e81),{'type':dbH['sequelize'][_0x9d5e('0x33')][_0x9d5e('0x34')]}));});if(_0x19d304>0x0){_0x5a8e81+=_0x247309;_0x12c09e[_0x9d5e('0x19')](dbH['sequelize'][_0x9d5e('0x31')](util[_0x9d5e('0x1a')](_0x9d5e('0x32'),QUERY,_0x19d304,_0x5a8e81),{'type':dbH[_0x9d5e('0x30')]['QueryTypes'][_0x9d5e('0x34')]}));}}}else{_0x12c09e[_0x9d5e('0x19')](dbH[_0x9d5e('0x30')][_0x9d5e('0x31')](QUERY,{'type':dbH['sequelize'][_0x9d5e('0x33')][_0x9d5e('0x34')]}));}var _0x337042=path[_0x9d5e('0x35')](PATH);var _0x57f74b=path[_0x9d5e('0x36')](PATH,_0x9d5e('0x37'));var _0x95a4ce=_0xf556c1[_0x9d5e('0x2b')]&&_0x12c09e[_0x9d5e('0x14')]>0x1;var _0x70bbe3=[];if(!fs['existsSync'](path['join'](_0x337042,_0x57f74b))&&_0x95a4ce){fs[_0x9d5e('0x38')](path[_0x9d5e('0x39')](_0x337042,_0x57f74b));}return BPromise[_0x9d5e('0x3a')](_0x12c09e,function(_0x1c1e77){_0x70bbe3[_0x9d5e('0x19')](_0x1c1e77);})[_0x9d5e('0x2c')](function(){var _0x51010c=[];for(var _0xb68b58=0x0;_0xb68b58<_0x70bbe3['length'];_0xb68b58+=0x1){var _0x427882=_0x70bbe3[_0xb68b58];var _0x3d7358=createTables(_[_0x9d5e('0x3b')](_0x427882));var _0x4c8aaa;var _0x2ef522=getPDFDocDefinition(_0x3d7358);var _0x267f5f=getPDFPrinter();var _0x1a31d8=_0x267f5f['createPdfKitDocument'](_0x2ef522);if(_0x95a4ce){_0x4c8aaa=path[_0x9d5e('0x39')](_0x337042,_0x57f74b,util[_0x9d5e('0x1a')](_0x9d5e('0x3c'),_0x57f74b,_0xb68b58,_0x9d5e('0x3d')));}else{_0x4c8aaa=path[_0x9d5e('0x39')](_0x337042,util['format'](_0x9d5e('0x3e'),_0x57f74b,_0x9d5e('0x3d')));}_0x51010c['push'](writePDFDocument(_0x1a31d8,_0x4c8aaa));}return Promise['all'](_0x51010c);})[_0x9d5e('0x2c')](function(){if(_0x95a4ce){return new Promise(function(_0x5082d6){zipdir(path[_0x9d5e('0x39')](_0x337042,_0x57f74b),{'saveTo':path[_0x9d5e('0x39')](_0x337042,util[_0x9d5e('0x1a')]('%s.%s',_0x57f74b,_0x9d5e('0x3f')))},function(){rimraf(path[_0x9d5e('0x39')](_0x337042,_0x57f74b),function(){});_0x5082d6(_0x9d5e('0x40'));});});}})['then'](function(){if(!_0x95a4ce)return;rimraf(path[_0x9d5e('0x39')](_0x337042,_0x57f74b),function(){});})[_0x9d5e('0x2c')](function(){logger[_0x9d5e('0x41')](util[_0x9d5e('0x1a')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9d5e('0x42')));return analyticExtractedReport('Completed',_0x95a4ce?util[_0x9d5e('0x1a')](_0x9d5e('0x3e'),_0x57f74b,_0x95a4ce?_0x9d5e('0x3f'):_0x9d5e('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9d5e('0x41')](util[_0x9d5e('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9d5e('0x42')));return db[_0x9d5e('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9d5e('0x2c')](function(_0x2567da){EXTRACTED_REPORT=_0x2567da;return dbH[_0x9d5e('0x30')][_0x9d5e('0x31')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9d5e('0x30')][_0x9d5e('0x33')]['SELECT']});})['then'](extractReport)[_0x9d5e('0x43')](function(_0x359dba){logger[_0x9d5e('0x41')](util[_0x9d5e('0x1a')](_0x9d5e('0x44'),EXTRACTED_REPORT_ID,_0x9d5e('0x42')),util[_0x9d5e('0x45')](_0x359dba,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x9d5e('0x46')](function(){process[_0x9d5e('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1499f0=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x9d5e('0x48'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9d5e('0x49')}});return _0x1499f0;}function getPDFDocDefinitionFromHTML(_0x1485d3,_0x563adb){var _0x29909b=util[_0x9d5e('0x1a')](_0x9d5e('0x4a'),_0x563adb[_0x9d5e('0x4b')],_0x563adb['interactionId']);var _0x54377e=moment()['format'](_0x9d5e('0x4c'))['toString']();var _0x474346=htmlToPdfmake(_0x1485d3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x474346],'defaultStyle':{'font':_0x9d5e('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9d5e('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9d5e('0x4d')}},'header':function(){return[{'text':_0x9d5e('0x4e'),'style':_0x9d5e('0x1f')}];},'footer':function(_0x2c0d33,_0x252f82){return[{'text':util[_0x9d5e('0x1a')](_0x9d5e('0x4f'),_0x29909b,_0x2c0d33,_0x252f82,_0x54377e),'style':'footer'}];}};}function writePDFDocument(_0x33c096,_0xfb1b64){return new Promise(function(_0x221d5b,_0x17ddac){var _0x594cda=_0x33c096[_0x9d5e('0x50')](fs[_0x9d5e('0x51')](_0xfb1b64));_0x594cda['on']('finish',function(){_0x221d5b(_0x9d5e('0x52'));});_0x594cda['on'](_0x9d5e('0x53'),function(_0xbd9a92){_0x17ddac(_0xbd9a92);});_0x33c096[_0x9d5e('0x54')]();});}exports[_0x9d5e('0x55')]=function(_0x350d9a,_0x5adce9){var _0x20ac44=getPDFPrinter();var _0x23667f=getPDFDocDefinitionFromHTML(_0x350d9a,_0x5adce9);var _0x576f7e=_0x20ac44[_0x9d5e('0x56')](_0x23667f);return writePDFDocument(_0x576f7e,_0x5adce9[_0x9d5e('0x2')])[_0x9d5e('0x43')](function(_0x8d86a5){throw _0x8d86a5;});}; \ No newline at end of file +var _0x9a78=['dirname','basename','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','then','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','path','lodash','util','moment','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','fill','length','body','concat','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','format','endDate','before','margin','landscape','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT'];(function(_0x358c70,_0x327ed7){var _0x1fbc33=function(_0x25b6e7){while(--_0x25b6e7){_0x358c70['push'](_0x358c70['shift']());}};_0x1fbc33(++_0x327ed7);}(_0x9a78,0x83));var _0x89a7=function(_0x1c1b53,_0x5d3d05){_0x1c1b53=_0x1c1b53-0x0;var _0x4bd0fd=_0x9a78[_0x1c1b53];return _0x4bd0fd;};'use strict';var _=require(_0x89a7('0x0'));var fs=require('fs');var util=require(_0x89a7('0x1'));var path=require('path');var moment=require(_0x89a7('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x89a7('0x3'));var zipdir=require(_0x89a7('0x4'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x89a7('0x5')];var window=new JSDOM('')[_0x89a7('0x6')];var BPromise=require(_0x89a7('0x7'));var db=require(_0x89a7('0x8'))['db'];var dbH=require(_0x89a7('0x8'))['dbH'];var logger=require('../../config/logger')(_0x89a7('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x89a7('0xa')][0x2]);var QUERY=process[_0x89a7('0xa')][0x3];var PATH=process[_0x89a7('0xa')][0x4];var NAME=process[_0x89a7('0xa')][0x5];var FORMAT=_0x89a7('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x355fbd,_0x1464aa){var _0x1de9fc={'status':_0x355fbd};var _0x5f0ba4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1464aa){_0x1de9fc[_0x89a7('0xc')]=_0x1464aa;}return db[_0x89a7('0xd')][_0x89a7('0xe')](_0x1de9fc,_0x5f0ba4);}function getHeaders(_0x501e98){return _[_0x89a7('0xf')](_0x501e98,function(_0x399396){return{'text':_0x399396,'style':_0x89a7('0x10')};});}function getRows(_0x13313c,_0x57fb3b){return _[_0x89a7('0xf')](_0x57fb3b,function(_0x5b81eb){return _(_0x5b81eb)[_0x89a7('0x11')](_0x13313c)['map'](function(_0x163964){return _0x163964?_[_0x89a7('0x12')](_0x163964):'';})['value']();});}function createTable(_0x1ca09f,_0x117bc8){var _0xd1f09d={'widths':_[_0x89a7('0x13')](Array(_0x1ca09f[_0x89a7('0x14')]),0x91),'heights':function(_0x435f80){return _0x435f80===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xa99c21=getHeaders(_0x1ca09f);_0xd1f09d[_0x89a7('0x15')]['push'](_0xa99c21);var _0x2170f3=getRows(_0x1ca09f,_0x117bc8);_0xd1f09d[_0x89a7('0x15')]=_0xd1f09d[_0x89a7('0x15')][_0x89a7('0x16')](_0x2170f3);return _0xd1f09d;}function createTables(_0x86a472){var _0x114117=[];var _0x22536e=_['chunk'](Object['keys'](_0x86a472[0x0]),0x5);_0x22536e[_0x89a7('0x17')](function(_0x3fb90c){_0x114117[_0x89a7('0x18')](createTable(_0x3fb90c,_0x86a472));});return _0x114117;}function getPDFDocDefinition(_0x9ada74){var _0x2724fd=util['format'](_0x89a7('0x19'),NAME,EXTRACTED_REPORT[_0x89a7('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x89a7('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x89a7('0x1c')])[_0x89a7('0x1b')](FORMAT));var _0x3c6a96=[];for(var _0x2be95a=0x0;_0x2be95a<_0x9ada74[_0x89a7('0x14')];_0x2be95a++){var _0x45bb77=[];if(_0x2be95a===0x0){_0x45bb77[_0x89a7('0x18')]({'text':_0x2724fd,'style':'header'});}var _0x4e4860={'table':_0x9ada74[_0x2be95a]};if(_0x2be95a>0x0){_0x4e4860['pageBreak']=_0x89a7('0x1d');_0x4e4860[_0x89a7('0x1e')]=[0x0,0x46,0x0,0x0];}_0x45bb77[_0x89a7('0x18')](_0x4e4860);_0x3c6a96[_0x89a7('0x18')](_0x45bb77);}return{'pageSize':'A4','pageOrientation':_0x89a7('0x1f'),'content':_0x3c6a96,'footer':function(_0x942cdb,_0x26bce1){return{'text':_0x942cdb[_0x89a7('0x12')]()+'\x20/\x20'+_0x26bce1,'style':_0x89a7('0x20')};},'defaultStyle':{'font':_0x89a7('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x89a7('0x22')},'footer':{'alignment':_0x89a7('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x24ed9b){var _0x22e697=0x1388;var _0x57976d;if(!_0x24ed9b[0x0][_0x89a7('0x24')]){return analyticExtractedReport(_0x89a7('0x25'));}return db[_0x89a7('0x26')][_0x89a7('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x89a7('0x28'),_0x89a7('0x29')]})['then'](function(_0x35cb1a){if(_0x35cb1a){_0x57976d=_0x35cb1a;_0x22e697=_0x57976d[_0x89a7('0x29')]||0x3e8;}})['then'](function(){var _0x57cbac=[];var _0x2365f8=0x0;if(_0x57976d[_0x89a7('0x28')]){if(_0x24ed9b&&_0x24ed9b[_0x89a7('0x14')]){var _0x2b7f8e=_[_0x89a7('0x2a')](_0x24ed9b[0x0][_0x89a7('0x24')]/_0x22e697);var _0x454f41=Number[_0x89a7('0x2b')](_0x24ed9b[0x0]['num']/_0x22e697)?_0x24ed9b[0x0][_0x89a7('0x24')]%_0x22e697:0x0;_0x2b7f8e[_0x89a7('0x17')](function(_0x4a66e1){if(_0x4a66e1>0x0){_0x2365f8+=_0x22e697;}_0x57cbac[_0x89a7('0x18')](dbH[_0x89a7('0x2c')][_0x89a7('0x2d')](util[_0x89a7('0x1b')](_0x89a7('0x2e'),QUERY,_0x22e697,_0x2365f8),{'type':dbH['sequelize'][_0x89a7('0x2f')]['SELECT']}));});if(_0x454f41>0x0){_0x2365f8+=_0x22e697;_0x57cbac[_0x89a7('0x18')](dbH[_0x89a7('0x2c')][_0x89a7('0x2d')](util[_0x89a7('0x1b')](_0x89a7('0x2e'),QUERY,_0x454f41,_0x2365f8),{'type':dbH['sequelize'][_0x89a7('0x2f')][_0x89a7('0x30')]}));}}}else{_0x57cbac[_0x89a7('0x18')](dbH[_0x89a7('0x2c')][_0x89a7('0x2d')](QUERY,{'type':dbH[_0x89a7('0x2c')]['QueryTypes'][_0x89a7('0x30')]}));}var _0x1afc05=path[_0x89a7('0x31')](PATH);var _0x33e8ec=path[_0x89a7('0x32')](PATH,'.pdf');var _0x386266=_0x57976d['split']&&_0x57cbac[_0x89a7('0x14')]>0x1;var _0x413bde=[];if(!fs[_0x89a7('0x33')](path['join'](_0x1afc05,_0x33e8ec))&&_0x386266){fs['mkdirSync'](path[_0x89a7('0x34')](_0x1afc05,_0x33e8ec));}return BPromise[_0x89a7('0x35')](_0x57cbac,function(_0x16f3fe){_0x413bde[_0x89a7('0x18')](_0x16f3fe);})['then'](function(){var _0x189b6b=[];for(var _0x86b888=0x0;_0x86b888<_0x413bde[_0x89a7('0x14')];_0x86b888+=0x1){var _0x4c343c=_0x413bde[_0x86b888];var _0x2888ab=createTables(_[_0x89a7('0x36')](_0x4c343c));var _0x7f228c;var _0x4d0318=getPDFDocDefinition(_0x2888ab);var _0x16f0d8=getPDFPrinter();var _0x2becdc=_0x16f0d8[_0x89a7('0x37')](_0x4d0318);if(_0x386266){_0x7f228c=path[_0x89a7('0x34')](_0x1afc05,_0x33e8ec,util[_0x89a7('0x1b')](_0x89a7('0x38'),_0x33e8ec,_0x86b888,_0x89a7('0x39')));}else{_0x7f228c=path[_0x89a7('0x34')](_0x1afc05,util[_0x89a7('0x1b')]('%s.%s',_0x33e8ec,_0x89a7('0x39')));}_0x189b6b['push'](writePDFDocument(_0x2becdc,_0x7f228c));}return Promise[_0x89a7('0x3a')](_0x189b6b);})[_0x89a7('0x3b')](function(){if(_0x386266){return new Promise(function(_0x424ca3){zipdir(path[_0x89a7('0x34')](_0x1afc05,_0x33e8ec),{'saveTo':path[_0x89a7('0x34')](_0x1afc05,util[_0x89a7('0x1b')]('%s.%s',_0x33e8ec,'zip'))},function(){rimraf(path[_0x89a7('0x34')](_0x1afc05,_0x33e8ec),function(){});_0x424ca3(_0x89a7('0x3c'));});});}})[_0x89a7('0x3b')](function(){if(!_0x386266)return;rimraf(path[_0x89a7('0x34')](_0x1afc05,_0x33e8ec),function(){});})[_0x89a7('0x3b')](function(){logger['info'](util[_0x89a7('0x1b')](_0x89a7('0x3d'),EXTRACTED_REPORT_ID,_0x89a7('0x3e')));return analyticExtractedReport(_0x89a7('0x3f'),_0x386266?util[_0x89a7('0x1b')](_0x89a7('0x40'),_0x33e8ec,_0x386266?_0x89a7('0x41'):_0x89a7('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x89a7('0x42')](util[_0x89a7('0x1b')](_0x89a7('0x43'),EXTRACTED_REPORT_ID,_0x89a7('0x3e')));return db[_0x89a7('0xd')][_0x89a7('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x89a7('0x3b')](function(_0x3573e2){EXTRACTED_REPORT=_0x3573e2;return dbH[_0x89a7('0x2c')][_0x89a7('0x2d')](util[_0x89a7('0x1b')](_0x89a7('0x45'),QUERY),{'type':dbH[_0x89a7('0x2c')][_0x89a7('0x2f')]['SELECT']});})[_0x89a7('0x3b')](extractReport)[_0x89a7('0x46')](function(_0x17700b){logger[_0x89a7('0x42')](util[_0x89a7('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x89a7('0x3e')),util[_0x89a7('0x47')](_0x17700b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x89a7('0x48'));})[_0x89a7('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x53b33d=new PdfPrinter({'Arial':{'normal':__dirname+_0x89a7('0x4a'),'bold':__dirname+_0x89a7('0x4b'),'italics':__dirname+_0x89a7('0x4c'),'bolditalics':__dirname+_0x89a7('0x4d')}});return _0x53b33d;}function getPDFDocDefinitionFromHTML(_0x5d9e49,_0x2db6b){var _0x7e532e=util['format'](_0x89a7('0x4e'),_0x2db6b[_0x89a7('0x4f')],_0x2db6b[_0x89a7('0x50')]);var _0x4eda31=moment()['format']('YYYY-MM-DD')[_0x89a7('0x12')]();var _0x357015=htmlToPdfmake(_0x5d9e49,{'window':window,'tableAutoSize':!![]});return{'content':[_0x357015],'defaultStyle':{'font':_0x89a7('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x89a7('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x89a7('0x52')}];},'footer':function(_0x51f845,_0x3a4bc4){return[{'text':util[_0x89a7('0x1b')](_0x89a7('0x53'),_0x7e532e,_0x51f845,_0x3a4bc4,_0x4eda31),'style':_0x89a7('0x20')}];}};}function writePDFDocument(_0x4f689f,_0x21ed22){return new Promise(function(_0x60e019,_0x265ddb){var _0x5dfeb0=_0x4f689f[_0x89a7('0x54')](fs[_0x89a7('0x55')](_0x21ed22));_0x5dfeb0['on'](_0x89a7('0x56'),function(){_0x60e019(_0x89a7('0x56'));});_0x5dfeb0['on']('error',function(_0x30a864){_0x265ddb(_0x30a864);});_0x4f689f[_0x89a7('0x57')]();});}exports[_0x89a7('0x58')]=function(_0x25ec53,_0x35c158){var _0x4a42f2=getPDFPrinter();var _0x220aef=getPDFDocDefinitionFromHTML(_0x25ec53,_0x35c158);var _0x227781=_0x4a42f2[_0x89a7('0x37')](_0x220aef);return writePDFDocument(_0x227781,_0x35c158[_0x89a7('0x59')])[_0x89a7('0x46')](function(_0x450789){throw _0x450789;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 442d8f4..f933cce 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 _0x51f9=['zip','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','json2xls','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','XLSX','splitSizeXlsx','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','split','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip\x20finished'];(function(_0x2ab63b,_0x2801ac){var _0x1415f2=function(_0x114d97){while(--_0x114d97){_0x2ab63b['push'](_0x2ab63b['shift']());}};_0x1415f2(++_0x2801ac);}(_0x51f9,0x1eb));var _0x951f=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x51f9[_0x152121];return _0x592a85;};'use strict';var util=require(_0x951f('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x951f('0x1'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x951f('0x2'));var db=require(_0x951f('0x3'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x951f('0x4'))(_0x951f('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x951f('0x6')][0x2]);var QUERY=process[_0x951f('0x6')][0x3];var PATH=process[_0x951f('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5ebdc5,_0x14f2a7){var _0x14377b={'status':_0x5ebdc5};var _0x27cafc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x14f2a7){_0x14377b['savename']=_0x14f2a7;}return db[_0x951f('0x7')]['update'](_0x14377b,_0x27cafc);}function main(){var _0xb88e28=0x1388;var _0x13d2d5;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x951f('0x8')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x951f('0x9')]})[_0x951f('0xa')](function(_0x278823){if(_0x278823){_0x13d2d5=_0x278823;_0xb88e28=_0x13d2d5['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x951f('0xb')]['query'](util[_0x951f('0xc')](_0x951f('0xd'),QUERY),{'type':dbH['sequelize'][_0x951f('0xe')][_0x951f('0xf')]});})['then'](function(_0x274bef){if(!_0x274bef[0x0][_0x951f('0x10')]){return analyticExtractedReport('Empty');}var _0x35a210=[];var _0x4a2d85=0x0;if(_0x13d2d5['split']){if(_0x274bef&&_0x274bef[_0x951f('0x11')]){var _0x3fb6f3=_[_0x951f('0x12')](_0x274bef[0x0][_0x951f('0x10')]/_0xb88e28);var _0x3f5511=Number[_0x951f('0x13')](_0x274bef[0x0][_0x951f('0x10')]/_0xb88e28)?_0x274bef[0x0][_0x951f('0x10')]%_0xb88e28:0x0;_0x3fb6f3[_0x951f('0x14')](function(_0x57b0b0){if(_0x57b0b0>0x0){_0x4a2d85+=_0xb88e28;}_0x35a210['push'](dbH[_0x951f('0xb')][_0x951f('0x15')](util['format'](_0x951f('0x16'),QUERY,_0xb88e28,_0x4a2d85),{'type':dbH[_0x951f('0xb')][_0x951f('0xe')][_0x951f('0xf')]}));});if(_0x3f5511>0x0){_0x4a2d85+=_0xb88e28;_0x35a210[_0x951f('0x17')](dbH[_0x951f('0xb')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3f5511,_0x4a2d85),{'type':dbH[_0x951f('0xb')]['QueryTypes'][_0x951f('0xf')]}));}}}else{_0x35a210[_0x951f('0x17')](dbH[_0x951f('0xb')][_0x951f('0x15')](QUERY,{'type':dbH[_0x951f('0xb')][_0x951f('0xe')][_0x951f('0xf')]}));}var _0x2f3812=path[_0x951f('0x18')](PATH);var _0x1b19a6=path[_0x951f('0x19')](PATH,_0x951f('0x1a'));var _0x439237=_0x13d2d5[_0x951f('0x1b')]&&_0x35a210['length']>0x1;var _0x49ee3b=[];if(!fs[_0x951f('0x1c')](path[_0x951f('0x1d')](_0x2f3812,_0x1b19a6))&&_0x439237){fs[_0x951f('0x1e')](path[_0x951f('0x1d')](_0x2f3812,_0x1b19a6));}return BPromise[_0x951f('0x1f')](_0x35a210,function(_0x5ae40a){_0x49ee3b[_0x951f('0x17')](_0x5ae40a);})['then'](function(){for(var _0x4a20be=0x0;_0x4a20be<_0x49ee3b[_0x951f('0x11')];_0x4a20be+=0x1){var _0x2acb4a;var _0x344372=_0x49ee3b[_0x4a20be];if(_0x439237){_0x2acb4a=path[_0x951f('0x1d')](_0x2f3812,_0x1b19a6,util[_0x951f('0xc')]('%s%d.%s',_0x1b19a6,_0x4a20be,_0x951f('0x20')));}else{_0x2acb4a=path['join'](_0x2f3812,util[_0x951f('0xc')](_0x951f('0x21'),_0x1b19a6,_0x951f('0x20')));}fs[_0x951f('0x22')](_0x2acb4a,json2xls(_0x344372),_0x951f('0x23'));}})[_0x951f('0xa')](function(){if(_0x439237){return new Promise(function(_0x51ad01){zipdir(path[_0x951f('0x1d')](_0x2f3812,_0x1b19a6),{'saveTo':path[_0x951f('0x1d')](_0x2f3812,util[_0x951f('0xc')]('%s.%s',_0x1b19a6,'zip'))},function(_0x9b680,_0x1d964a){rimraf(path[_0x951f('0x1d')](_0x2f3812,_0x1b19a6),function(){});_0x51ad01(_0x951f('0x24'));});});}})[_0x951f('0xa')](function(){logger['info'](util[_0x951f('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x951f('0x8')));return analyticExtractedReport('Completed',_0x439237?util[_0x951f('0xc')](_0x951f('0x21'),_0x1b19a6,_0x439237?_0x951f('0x25'):_0x951f('0x20')):null);});})['catch'](function(_0x27c4e5){logger[_0x951f('0x26')](util[_0x951f('0xc')](_0x951f('0x27'),EXTRACTED_REPORT_ID,_0x951f('0x8')),util[_0x951f('0x28')](_0x27c4e5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x951f('0x29'));})[_0x951f('0x2a')](function(){process[_0x951f('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc568=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','query','sequelize','QueryTypes','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','mkdirSync','each','then','%s%d.%s','%s.%s','xlsx','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','info'];(function(_0x27e3f7,_0x59530f){var _0x582995=function(_0x1906fe){while(--_0x1906fe){_0x27e3f7['push'](_0x27e3f7['shift']());}};_0x582995(++_0x59530f);}(_0xc568,0x1d4));var _0x8c56=function(_0x539bd9,_0xa28adb){_0x539bd9=_0x539bd9-0x0;var _0x4d1991=_0xc568[_0x539bd9];return _0x4d1991;};'use strict';var util=require('util');var path=require(_0x8c56('0x0'));var _=require(_0x8c56('0x1'));var fs=require('fs');var json2xls=require(_0x8c56('0x2'));var BPromise=require(_0x8c56('0x3'));var zipdir=require(_0x8c56('0x4'));var rimraf=require(_0x8c56('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8c56('0x6'))[_0x8c56('0x7')];var logger=require('../../config/logger')(_0x8c56('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8c56('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8c56('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2220b1,_0x30e0f6){var _0x39f26b={'status':_0x2220b1};var _0x44c407={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x30e0f6){_0x39f26b[_0x8c56('0xa')]=_0x30e0f6;}return db['AnalyticExtractedReport']['update'](_0x39f26b,_0x44c407);}function main(){var _0x240f1a=0x1388;var _0x2e3a91;logger[_0x8c56('0xb')](util[_0x8c56('0xc')](_0x8c56('0xd'),EXTRACTED_REPORT_ID,_0x8c56('0xe')));return db['Setting'][_0x8c56('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8c56('0x10'),_0x8c56('0x11')]})['then'](function(_0x568608){if(_0x568608){_0x2e3a91=_0x568608;_0x240f1a=_0x2e3a91[_0x8c56('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x8c56('0x12')](util[_0x8c56('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x8c56('0x13')][_0x8c56('0x14')]['SELECT']});})['then'](function(_0x266893){if(!_0x266893[0x0][_0x8c56('0x15')]){return analyticExtractedReport(_0x8c56('0x16'));}var _0x1b70c6=[];var _0x3e4939=0x0;if(_0x2e3a91[_0x8c56('0x10')]){if(_0x266893&&_0x266893[_0x8c56('0x17')]){var _0x18affe=_[_0x8c56('0x18')](_0x266893[0x0][_0x8c56('0x15')]/_0x240f1a);var _0x479d35=Number[_0x8c56('0x19')](_0x266893[0x0][_0x8c56('0x15')]/_0x240f1a)?_0x266893[0x0][_0x8c56('0x15')]%_0x240f1a:0x0;_0x18affe[_0x8c56('0x1a')](function(_0xcf9edb){if(_0xcf9edb>0x0){_0x3e4939+=_0x240f1a;}_0x1b70c6[_0x8c56('0x1b')](dbH[_0x8c56('0x13')]['query'](util[_0x8c56('0xc')](_0x8c56('0x1c'),QUERY,_0x240f1a,_0x3e4939),{'type':dbH[_0x8c56('0x13')][_0x8c56('0x14')][_0x8c56('0x1d')]}));});if(_0x479d35>0x0){_0x3e4939+=_0x240f1a;_0x1b70c6[_0x8c56('0x1b')](dbH[_0x8c56('0x13')][_0x8c56('0x12')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x479d35,_0x3e4939),{'type':dbH[_0x8c56('0x13')][_0x8c56('0x14')]['SELECT']}));}}}else{_0x1b70c6['push'](dbH['sequelize'][_0x8c56('0x12')](QUERY,{'type':dbH['sequelize'][_0x8c56('0x14')][_0x8c56('0x1d')]}));}var _0x1c7bb9=path[_0x8c56('0x1e')](PATH);var _0x185030=path[_0x8c56('0x1f')](PATH,'.xlsx');var _0x5df7a8=_0x2e3a91['split']&&_0x1b70c6[_0x8c56('0x17')]>0x1;var _0x2cb8aa=[];if(!fs[_0x8c56('0x20')](path[_0x8c56('0x21')](_0x1c7bb9,_0x185030))&&_0x5df7a8){fs[_0x8c56('0x22')](path[_0x8c56('0x21')](_0x1c7bb9,_0x185030));}return BPromise[_0x8c56('0x23')](_0x1b70c6,function(_0x2150ac){_0x2cb8aa[_0x8c56('0x1b')](_0x2150ac);})[_0x8c56('0x24')](function(){for(var _0x304357=0x0;_0x304357<_0x2cb8aa[_0x8c56('0x17')];_0x304357+=0x1){var _0x394342;var _0xb32317=_0x2cb8aa[_0x304357];if(_0x5df7a8){_0x394342=path[_0x8c56('0x21')](_0x1c7bb9,_0x185030,util[_0x8c56('0xc')](_0x8c56('0x25'),_0x185030,_0x304357,'xlsx'));}else{_0x394342=path[_0x8c56('0x21')](_0x1c7bb9,util[_0x8c56('0xc')](_0x8c56('0x26'),_0x185030,_0x8c56('0x27')));}fs['writeFileSync'](_0x394342,json2xls(_0xb32317),_0x8c56('0x28'));}})['then'](function(){if(_0x5df7a8){return new Promise(function(_0x59787d){zipdir(path[_0x8c56('0x21')](_0x1c7bb9,_0x185030),{'saveTo':path[_0x8c56('0x21')](_0x1c7bb9,util[_0x8c56('0xc')](_0x8c56('0x26'),_0x185030,_0x8c56('0x29')))},function(_0x125977,_0x522051){rimraf(path['join'](_0x1c7bb9,_0x185030),function(){});_0x59787d(_0x8c56('0x2a'));});});}})[_0x8c56('0x24')](function(){logger[_0x8c56('0xb')](util['format'](_0x8c56('0x2b'),EXTRACTED_REPORT_ID,_0x8c56('0xe')));return analyticExtractedReport('Completed',_0x5df7a8?util[_0x8c56('0xc')](_0x8c56('0x26'),_0x185030,_0x5df7a8?'zip':_0x8c56('0x27')):null);});})['catch'](function(_0x32e695){logger[_0x8c56('0xb')](util['format'](_0x8c56('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x8c56('0x2d')](_0x32e695,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8c56('0x2e'));})[_0x8c56('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 5deda6f..aea6bce 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 _0xc6db=['cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','recordingFormat','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','filter','groupBy','queue','playback','priority','extensions','extension','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)='];(function(_0x4c3049,_0x1aa857){var _0x55d0b1=function(_0x553404){while(--_0x553404){_0x4c3049['push'](_0x4c3049['shift']());}};_0x55d0b1(++_0x1aa857);}(_0xc6db,0x188));var _0xbc6d=function(_0x2749cd,_0x1d51ac){_0x2749cd=_0x2749cd-0x0;var _0x6417a7=_0xc6db[_0x2749cd];return _0x6417a7;};'use strict';var _=require(_0xbc6d('0x0'));var util=require(_0xbc6d('0x1'));function rewrite(_0x591db3,_0x52e203){var _0x1079cf=this;return _0x591db3[_0xbc6d('0x2')]['Interval'][_0xbc6d('0x3')]({'raw':!![]})[_0xbc6d('0x4')](function(_0x2cee3f){_0x1079cf[_0xbc6d('0x5')]=_0x2cee3f;return _0x591db3[_0xbc6d('0x2')][_0xbc6d('0x6')][_0xbc6d('0x3')]({'where':{'IntervalId':_0x52e203[_0xbc6d('0x7')]},'raw':!![]});})[_0xbc6d('0x4')](function(_0x9d0bec){return _0x591db3['models'][_0xbc6d('0x6')][_0xbc6d('0x3')]({'where':{'exten':{'$in':_[_0xbc6d('0x8')](_[_0xbc6d('0x9')](_0x9d0bec,_0xbc6d('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x544000){var _0x1030e5=_[_0xbc6d('0xb')](_0x544000,{'priority':'1'});var _0x3b2def=_[_0xbc6d('0xb')](_0x544000,{'isApp':0x1});var _0x1687a8=_[_0xbc6d('0xc')](_0x3b2def,_0xbc6d('0xa'));var _0x59fce2=[_0xbc6d('0xd'),_0xbc6d('0xe')];var _0x4b0b7a=[];var _0x46d661=[];for(var _0x212059 in _0x1687a8){if(_0x1687a8['hasOwnProperty'](_0x212059)){_0x1079cf[_0xbc6d('0xf')]=0x2;_0x1079cf[_0xbc6d('0x10')]=[];_0x1079cf[_0xbc6d('0x11')]=_['find'](_0x1030e5,{'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')]});_0x1079cf[_0xbc6d('0x10')][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':util[_0xbc6d('0x15')](_0xbc6d('0x16'),_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')]),'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf['priority']++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});if(_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')]===_0xbc6d('0x19')){_0x1079cf['extensions'][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')],'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0]['exten'],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});}else if(_0x1687a8[_0x212059][0x0]['type']===_0xbc6d('0x1a')){if(_0x1079cf[_0xbc6d('0x11')]){_0x1079cf['extensions'][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x1b')+(_0x1079cf[_0xbc6d('0x11')][_0xbc6d('0x1c')]?_0xbc6d('0x1d')+_0x1079cf[_0xbc6d('0x11')][_0xbc6d('0x1c')]+'}':_0xbc6d('0x1e')),'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0]['VoiceExtensionId']});}_0x1079cf['extensions'][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':'CDR(routeid)='+_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')],'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});var _0x3600d0=_0x1079cf[_0xbc6d('0xf')]++;_0x1079cf[_0xbc6d('0x10')][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':'ExecIf','appdata':_0xbc6d('0x1f')+(_0x3600d0+0x2)+_0xbc6d('0x20')+(_0x3600d0+0x1)+')','context':_0x1687a8[_0x212059][0x0]['context'],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x3600d0,'VoiceExtensionId':_0x1687a8[_0x212059][0x0]['VoiceExtensionId']});if(_0x1079cf[_0xbc6d('0x11')]){_0x1079cf['extensions'][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':_0x1079cf[_0xbc6d('0x11')][_0xbc6d('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x1079cf[_0xbc6d('0x11')]['cutdigits']+'}':_0xbc6d('0x21'),'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0]['VoiceExtensionId']});}_0x1079cf[_0xbc6d('0x10')]['push']({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x22')+_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')],'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});if(_0x1079cf['extension']&&_0x1079cf[_0xbc6d('0x11')][_0xbc6d('0x23')]('recordingFormat')&&_0x1079cf['extension']['recordingFormat']!==_0xbc6d('0x24')){_0x1079cf[_0xbc6d('0x10')][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x25'),'context':_0x1687a8[_0x212059][0x0]['context'],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf['priority']++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});_0x1079cf['extensions']['push']({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1079cf[_0xbc6d('0x11')][_0xbc6d('0x26')]||_0xbc6d('0x27'),'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0]['exten'],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});}}_0x1079cf[_0xbc6d('0x10')][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0][_0xbc6d('0x13')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0]['VoiceExtensionId']});_0x1079cf[_0xbc6d('0x10')][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0]['type'],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x28'),'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});_0x1079cf[_0xbc6d('0x10')][_0xbc6d('0x12')]({'type':_0x1687a8[_0x212059][0x0]['type'],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x29'),'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'exten':_0x1687a8[_0x212059][0x0][_0xbc6d('0xa')],'priority':_0x1079cf[_0xbc6d('0xf')]++,'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});for(var _0x1a2e2f=0x0,_0x1f36b6=0x0;_0x1a2e2f<_0x1687a8[_0x212059][_0xbc6d('0x2a')];_0x1a2e2f+=0x1,_0x1f36b6=0x0){var _0x1067c5=_0x1687a8[_0x212059][_0x1a2e2f];if(_0x1067c5[_0xbc6d('0x13')]){_0x1067c5['type']=_0x1067c5[_0xbc6d('0x13')][_0xbc6d('0x2b')]();}var _0x175b89=[];var _0x5257be=[];delete _0x1067c5['id'];delete _0x1067c5[_0xbc6d('0x2c')];delete _0x1067c5[_0xbc6d('0x2d')];var _0x40dca0=_0x1067c5[_0xbc6d('0x2e')]!=='*,*,*,*'?[_0x1067c5[_0xbc6d('0x2e')]]:_0x1067c5[_0xbc6d('0x7')]?_[_0xbc6d('0x9')](_[_0xbc6d('0xb')](_0x1079cf[_0xbc6d('0x5')],{'IntervalId':_0x1067c5[_0xbc6d('0x7')]}),_0xbc6d('0x2e')):[];if(_0x1067c5[_0xbc6d('0x23')]('tag')){if(_0x1067c5[_0xbc6d('0x2f')]&&_0x1067c5[_0xbc6d('0x2f')]!=='--'){_0x175b89[_0xbc6d('0x12')]({'type':_0x1067c5[_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x30')+_0x1067c5[_0xbc6d('0x2f')],'context':_0x1067c5[_0xbc6d('0x17')],'exten':_0x1067c5['exten'],'priority':_0x40dca0[_0xbc6d('0x2a')]+_0x1079cf[_0xbc6d('0xf')]+_0x1f36b6++,'VoiceExtensionId':_0x1067c5[_0xbc6d('0x18')]});}}if(_0x1067c5[_0xbc6d('0x13')]==='outbound'&&_0x1067c5[_0xbc6d('0x23')]('callerID')){if(_0x1067c5[_0xbc6d('0x31')]){_0x175b89[_0xbc6d('0x12')]({'type':_0x1067c5[_0xbc6d('0x13')],'app':_0xbc6d('0x32'),'appdata':_0xbc6d('0x33')+_0x1067c5[_0xbc6d('0x31')]+')','context':_0x1067c5[_0xbc6d('0x17')],'exten':_0x1067c5[_0xbc6d('0xa')],'priority':_0x40dca0['length']+_0x1079cf['priority']+_0x1f36b6++,'VoiceExtensionId':_0x1067c5[_0xbc6d('0x18')]});}else{_0x175b89['push']({'type':_0x1067c5['type'],'app':'ExecIf','appdata':_0xbc6d('0x34'),'context':_0x1067c5[_0xbc6d('0x17')],'exten':_0x1067c5[_0xbc6d('0xa')],'priority':_0x40dca0[_0xbc6d('0x2a')]+_0x1079cf[_0xbc6d('0xf')]+_0x1f36b6++,'VoiceExtensionId':_0x1067c5[_0xbc6d('0x18')]});}}if(_0x1067c5[_0xbc6d('0x23')](_0xbc6d('0x35'))){if(_0x59fce2[_0xbc6d('0x36')](_0x1067c5[_0xbc6d('0x37')][_0xbc6d('0x2b')]())>=0x0&&_0x1067c5['appType']!=='custom'){if(_0x1067c5[_0xbc6d('0x35')]){_0x175b89[_0xbc6d('0x12')]({'type':_0x1067c5[_0xbc6d('0x13')],'app':_0xbc6d('0x32'),'appdata':_0xbc6d('0x38'),'context':_0x1067c5[_0xbc6d('0x17')],'exten':_0x1067c5[_0xbc6d('0xa')],'priority':_0x40dca0['length']+_0x1079cf[_0xbc6d('0xf')]+_0x1f36b6++,'VoiceExtensionId':_0x1067c5['VoiceExtensionId']});_0x175b89[_0xbc6d('0x12')]({'type':_0x1067c5[_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1067c5['context'],'exten':_0x1067c5[_0xbc6d('0xa')],'priority':_0x40dca0[_0xbc6d('0x2a')]+_0x1079cf[_0xbc6d('0xf')]+_0x1f36b6++,'VoiceExtensionId':_0x1067c5['VoiceExtensionId']});}else{_0x175b89[_0xbc6d('0x12')]({'type':_0x1067c5['type'],'app':_0xbc6d('0x32'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1067c5['context'],'exten':_0x1067c5[_0xbc6d('0xa')],'priority':_0x40dca0[_0xbc6d('0x2a')]+_0x1079cf[_0xbc6d('0xf')]+_0x1f36b6++,'VoiceExtensionId':_0x1067c5[_0xbc6d('0x18')]});_0x175b89[_0xbc6d('0x12')]({'type':_0x1067c5[_0xbc6d('0x13')],'app':_0xbc6d('0x14'),'appdata':_0xbc6d('0x39'),'context':_0x1067c5['context'],'exten':_0x1067c5[_0xbc6d('0xa')],'priority':_0x40dca0[_0xbc6d('0x2a')]+_0x1079cf[_0xbc6d('0xf')]+_0x1f36b6++,'VoiceExtensionId':_0x1067c5[_0xbc6d('0x18')]});}}}for(var _0x1c3c2a=0x0;_0x1c3c2a<_0x40dca0['length'];_0x1c3c2a+=0x1){var _0x2597c1=_0x1079cf[_0xbc6d('0xf')]+_0x40dca0[_0xbc6d('0x2a')];var _0x558e74=_0x1c3c2a===_0x40dca0[_0xbc6d('0x2a')]-0x1?_0x1079cf[_0xbc6d('0xf')]+_0x175b89['length']+_0x5257be[_0xbc6d('0x2a')]+0x2:_0x1079cf['priority']+_0x1c3c2a+0x1;_0x175b89[_0xbc6d('0x3a')](_0x1c3c2a,0x0,{'type':_0x1067c5[_0xbc6d('0x13')],'app':_0xbc6d('0x3b'),'appdata':_0x40dca0[_0x1c3c2a]+'?'+_0x1067c5['context']+_0xbc6d('0x3c')+_0x2597c1+':'+_0x1067c5[_0xbc6d('0x17')]+_0xbc6d('0x3c')+_0x558e74,'exten':_0x1067c5[_0xbc6d('0xa')],'context':_0x1067c5[_0xbc6d('0x17')],'priority':_0x1079cf[_0xbc6d('0xf')]+_0x1c3c2a,'VoiceExtensionId':_0x1687a8[_0x212059][0x0]['VoiceExtensionId']});}_0x1067c5[_0xbc6d('0xf')]=_0x175b89[_0xbc6d('0x2a')]?_[_0xbc6d('0x3d')](_0x175b89)['priority']+0x1:_0x1079cf[_0xbc6d('0xf')];_0x1079cf['priority']=(_0x5257be[_0xbc6d('0x2a')]?_[_0xbc6d('0x3d')](_0x5257be)[_0xbc6d('0xf')]:_0x1067c5['priority'])+0x1;_0x1079cf[_0xbc6d('0x10')]=_[_0xbc6d('0x3e')](_0x1079cf[_0xbc6d('0x10')],_0x175b89,[_0x1067c5],_0x5257be);}_0x1079cf[_0xbc6d('0x10')]['push']({'type':_0x1687a8[_0x212059][0x0]['type'],'app':_0xbc6d('0x3f'),'exten':_0x1687a8[_0x212059][0x0]['exten'],'context':_0x1687a8[_0x212059][0x0][_0xbc6d('0x17')],'priority':_0x1079cf[_0xbc6d('0xf')],'VoiceExtensionId':_0x1687a8[_0x212059][0x0][_0xbc6d('0x18')]});_0x4b0b7a['push'](_0x1687a8[_0x212059][0x0]['VoiceExtensionId']);_0x46d661=_[_0xbc6d('0x3e')](_0x46d661,_0x1079cf[_0xbc6d('0x10')]);}}return _0x591db3[_0xbc6d('0x40')](function(_0x29c49a){return _0x591db3[_0xbc6d('0x2')][_0xbc6d('0x6')][_0xbc6d('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x4b0b7a}},'transaction':_0x29c49a})['then'](function(_0x66e409){return _0x591db3[_0xbc6d('0x2')][_0xbc6d('0x6')][_0xbc6d('0x42')](_[_0xbc6d('0x43')](_0x46d661,_0xbc6d('0xf')),{'transaction':_0x29c49a});});});})[_0xbc6d('0x44')](function(_0x7f48cf){console[_0xbc6d('0x45')](_0x7f48cf);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x0af2=['Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','models','destroy','bulkCreate','catch','error','rewrite','lodash','findAll','then','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find'];(function(_0x59c7d3,_0x232cc8){var _0x4c93c9=function(_0x3e0b00){while(--_0x3e0b00){_0x59c7d3['push'](_0x59c7d3['shift']());}};_0x4c93c9(++_0x232cc8);}(_0x0af2,0x108));var _0x20af=function(_0x5344a6,_0x41dd4c){_0x5344a6=_0x5344a6-0x0;var _0x547cff=_0x0af2[_0x5344a6];return _0x547cff;};'use strict';var _=require(_0x20af('0x0'));var util=require('util');function rewrite(_0x3d9bd1,_0x40aad2){var _0x1bc94d=this;return _0x3d9bd1['models']['Interval'][_0x20af('0x1')]({'raw':!![]})[_0x20af('0x2')](function(_0x3463ea){_0x1bc94d['intervals']=_0x3463ea;return _0x3d9bd1['models'][_0x20af('0x3')][_0x20af('0x1')]({'where':{'IntervalId':_0x40aad2[_0x20af('0x4')]},'raw':!![]});})[_0x20af('0x2')](function(_0x369faa){return _0x3d9bd1['models'][_0x20af('0x3')][_0x20af('0x1')]({'where':{'exten':{'$in':_[_0x20af('0x5')](_['map'](_0x369faa,_0x20af('0x6')))}},'order':[{'raw':_0x20af('0x7')}],'raw':!![]});})[_0x20af('0x2')](function(_0x75f9f5){var _0x152d15=_[_0x20af('0x8')](_0x75f9f5,{'priority':'1'});var _0x3b165d=_[_0x20af('0x8')](_0x75f9f5,{'isApp':0x1});var _0x346a4d=_[_0x20af('0x9')](_0x3b165d,_0x20af('0x6'));var _0x1b371c=[_0x20af('0xa'),_0x20af('0xb')];var _0x34bc00=[];var _0x44a493=[];for(var _0x3b44fd in _0x346a4d){if(_0x346a4d[_0x20af('0xc')](_0x3b44fd)){_0x1bc94d[_0x20af('0xd')]=0x2;_0x1bc94d[_0x20af('0xe')]=[];_0x1bc94d['extension']=_[_0x20af('0xf')](_0x152d15,{'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')]});_0x1bc94d[_0x20af('0xe')]['push']({'type':_0x346a4d[_0x3b44fd][0x0]['type'],'app':_0x20af('0x10'),'appdata':util[_0x20af('0x11')](_0x20af('0x12'),_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')]),'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});if(_0x346a4d[_0x3b44fd][0x0]['type']===_0x20af('0x16')){_0x1bc94d['extensions'][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0]['type'],'app':_0x20af('0x10'),'appdata':_0x20af('0x18')+_0x346a4d[_0x3b44fd][0x0]['VoiceExtensionId'],'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});}else if(_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')]===_0x20af('0x19')){if(_0x1bc94d[_0x20af('0x1a')]){_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':_0x20af('0x1b')+(_0x1bc94d[_0x20af('0x1a')]['cutdigits']?_0x20af('0x1c')+_0x1bc94d[_0x20af('0x1a')][_0x20af('0x1d')]+'}':_0x20af('0x1e')),'context':_0x346a4d[_0x3b44fd][0x0]['context'],'exten':_0x346a4d[_0x3b44fd][0x0]['exten'],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});}_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':_0x20af('0x18')+_0x346a4d[_0x3b44fd][0x0]['VoiceExtensionId'],'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0]['VoiceExtensionId']});var _0x32b4c4=_0x1bc94d[_0x20af('0xd')]++;_0x1bc94d['extensions']['push']({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x1f'),'appdata':_0x20af('0x20')+(_0x32b4c4+0x2)+_0x20af('0x21')+(_0x32b4c4+0x1)+')','context':_0x346a4d[_0x3b44fd][0x0]['context'],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x32b4c4,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0]['VoiceExtensionId']});if(_0x1bc94d[_0x20af('0x1a')]){_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0]['type'],'app':_0x20af('0x10'),'appdata':_0x1bc94d['extension'][_0x20af('0x1d')]?_0x20af('0x22')+_0x1bc94d[_0x20af('0x1a')][_0x20af('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});}_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':'outboundrouteid='+_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')],'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});if(_0x1bc94d[_0x20af('0x1a')]&&_0x1bc94d[_0x20af('0x1a')][_0x20af('0xc')](_0x20af('0x23'))&&_0x1bc94d[_0x20af('0x1a')][_0x20af('0x23')]!==_0x20af('0x24')){_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1bc94d['extension']['recordingFormat']||_0x20af('0x25'),'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});}}_0x1bc94d['extensions'][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0]['type'],'app':'Set','appdata':_0x20af('0x26'),'context':_0x346a4d[_0x3b44fd][0x0]['context'],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':_0x20af('0x27'),'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0]['VoiceExtensionId']});_0x1bc94d[_0x20af('0xe')][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':'Set','appdata':_0x20af('0x28'),'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'exten':_0x346a4d[_0x3b44fd][0x0]['exten'],'priority':_0x1bc94d[_0x20af('0xd')]++,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});for(var _0x2bd47f=0x0,_0x166cdb=0x0;_0x2bd47f<_0x346a4d[_0x3b44fd][_0x20af('0x29')];_0x2bd47f+=0x1,_0x166cdb=0x0){var _0x56ba0c=_0x346a4d[_0x3b44fd][_0x2bd47f];if(_0x56ba0c[_0x20af('0x13')]){_0x56ba0c[_0x20af('0x13')]=_0x56ba0c['type'][_0x20af('0x2a')]();}var _0x45a53a=[];var _0x320895=[];delete _0x56ba0c['id'];delete _0x56ba0c[_0x20af('0x2b')];delete _0x56ba0c[_0x20af('0x2c')];var _0x1cff2d=_0x56ba0c[_0x20af('0x2d')]!=='*,*,*,*'?[_0x56ba0c[_0x20af('0x2d')]]:_0x56ba0c[_0x20af('0x4')]?_['map'](_['filter'](_0x1bc94d[_0x20af('0x2e')],{'IntervalId':_0x56ba0c[_0x20af('0x4')]}),_0x20af('0x2d')):[];if(_0x56ba0c[_0x20af('0xc')](_0x20af('0x2f'))){if(_0x56ba0c['tag']&&_0x56ba0c[_0x20af('0x2f')]!=='--'){_0x45a53a[_0x20af('0x17')]({'type':_0x56ba0c[_0x20af('0x13')],'app':_0x20af('0x10'),'appdata':'CDR(tag)='+_0x56ba0c['tag'],'context':_0x56ba0c[_0x20af('0x14')],'exten':_0x56ba0c[_0x20af('0x6')],'priority':_0x1cff2d['length']+_0x1bc94d[_0x20af('0xd')]+_0x166cdb++,'VoiceExtensionId':_0x56ba0c[_0x20af('0x15')]});}}if(_0x56ba0c['type']===_0x20af('0x19')&&_0x56ba0c[_0x20af('0xc')]('callerID')){if(_0x56ba0c[_0x20af('0x30')]){_0x45a53a[_0x20af('0x17')]({'type':_0x56ba0c[_0x20af('0x13')],'app':_0x20af('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x56ba0c[_0x20af('0x30')]+')','context':_0x56ba0c[_0x20af('0x14')],'exten':_0x56ba0c['exten'],'priority':_0x1cff2d['length']+_0x1bc94d['priority']+_0x166cdb++,'VoiceExtensionId':_0x56ba0c['VoiceExtensionId']});}else{_0x45a53a[_0x20af('0x17')]({'type':_0x56ba0c[_0x20af('0x13')],'app':_0x20af('0x1f'),'appdata':_0x20af('0x31'),'context':_0x56ba0c[_0x20af('0x14')],'exten':_0x56ba0c[_0x20af('0x6')],'priority':_0x1cff2d[_0x20af('0x29')]+_0x1bc94d[_0x20af('0xd')]+_0x166cdb++,'VoiceExtensionId':_0x56ba0c[_0x20af('0x15')]});}}if(_0x56ba0c['hasOwnProperty'](_0x20af('0x32'))){if(_0x1b371c[_0x20af('0x33')](_0x56ba0c[_0x20af('0x34')][_0x20af('0x2a')]())>=0x0&&_0x56ba0c[_0x20af('0x35')]!==_0x20af('0x36')){if(_0x56ba0c[_0x20af('0x32')]){_0x45a53a['push']({'type':_0x56ba0c[_0x20af('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x56ba0c[_0x20af('0x14')],'exten':_0x56ba0c['exten'],'priority':_0x1cff2d[_0x20af('0x29')]+_0x1bc94d[_0x20af('0xd')]+_0x166cdb++,'VoiceExtensionId':_0x56ba0c[_0x20af('0x15')]});_0x45a53a['push']({'type':_0x56ba0c[_0x20af('0x13')],'app':'Set','appdata':_0x20af('0x37'),'context':_0x56ba0c['context'],'exten':_0x56ba0c[_0x20af('0x6')],'priority':_0x1cff2d[_0x20af('0x29')]+_0x1bc94d[_0x20af('0xd')]+_0x166cdb++,'VoiceExtensionId':_0x56ba0c['VoiceExtensionId']});}else{_0x45a53a[_0x20af('0x17')]({'type':_0x56ba0c[_0x20af('0x13')],'app':'ExecIf','appdata':_0x20af('0x38'),'context':_0x56ba0c['context'],'exten':_0x56ba0c[_0x20af('0x6')],'priority':_0x1cff2d[_0x20af('0x29')]+_0x1bc94d[_0x20af('0xd')]+_0x166cdb++,'VoiceExtensionId':_0x56ba0c[_0x20af('0x15')]});_0x45a53a[_0x20af('0x17')]({'type':_0x56ba0c['type'],'app':'Set','appdata':_0x20af('0x39'),'context':_0x56ba0c[_0x20af('0x14')],'exten':_0x56ba0c['exten'],'priority':_0x1cff2d[_0x20af('0x29')]+_0x1bc94d[_0x20af('0xd')]+_0x166cdb++,'VoiceExtensionId':_0x56ba0c[_0x20af('0x15')]});}}}for(var _0x11b06e=0x0;_0x11b06e<_0x1cff2d['length'];_0x11b06e+=0x1){var _0x321cb2=_0x1bc94d[_0x20af('0xd')]+_0x1cff2d['length'];var _0x248f13=_0x11b06e===_0x1cff2d[_0x20af('0x29')]-0x1?_0x1bc94d['priority']+_0x45a53a[_0x20af('0x29')]+_0x320895[_0x20af('0x29')]+0x2:_0x1bc94d[_0x20af('0xd')]+_0x11b06e+0x1;_0x45a53a[_0x20af('0x3a')](_0x11b06e,0x0,{'type':_0x56ba0c[_0x20af('0x13')],'app':_0x20af('0x3b'),'appdata':_0x1cff2d[_0x11b06e]+'?'+_0x56ba0c['context']+',${EXTEN},'+_0x321cb2+':'+_0x56ba0c[_0x20af('0x14')]+_0x20af('0x3c')+_0x248f13,'exten':_0x56ba0c['exten'],'context':_0x56ba0c[_0x20af('0x14')],'priority':_0x1bc94d[_0x20af('0xd')]+_0x11b06e,'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]});}_0x56ba0c['priority']=_0x45a53a['length']?_[_0x20af('0x3d')](_0x45a53a)[_0x20af('0xd')]+0x1:_0x1bc94d[_0x20af('0xd')];_0x1bc94d[_0x20af('0xd')]=(_0x320895[_0x20af('0x29')]?_[_0x20af('0x3d')](_0x320895)['priority']:_0x56ba0c[_0x20af('0xd')])+0x1;_0x1bc94d['extensions']=_[_0x20af('0x3e')](_0x1bc94d[_0x20af('0xe')],_0x45a53a,[_0x56ba0c],_0x320895);}_0x1bc94d['extensions'][_0x20af('0x17')]({'type':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x13')],'app':'Hangup','exten':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x6')],'context':_0x346a4d[_0x3b44fd][0x0][_0x20af('0x14')],'priority':_0x1bc94d['priority'],'VoiceExtensionId':_0x346a4d[_0x3b44fd][0x0]['VoiceExtensionId']});_0x34bc00[_0x20af('0x17')](_0x346a4d[_0x3b44fd][0x0][_0x20af('0x15')]);_0x44a493=_[_0x20af('0x3e')](_0x44a493,_0x1bc94d[_0x20af('0xe')]);}}return _0x3d9bd1[_0x20af('0x3f')](function(_0x4dab6f){return _0x3d9bd1[_0x20af('0x40')][_0x20af('0x3')][_0x20af('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x34bc00}},'transaction':_0x4dab6f})['then'](function(_0x177893){return _0x3d9bd1['models'][_0x20af('0x3')][_0x20af('0x42')](_['sortBy'](_0x44a493,'priority'),{'transaction':_0x4dab6f});});});})[_0x20af('0x43')](function(_0x59c09d){console[_0x20af('0x44')](_0x59c09d);});}exports[_0x20af('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 8225560..8cdc5cc 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 _0xa20d=['test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','checkHopper','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','select','str','calleridnum','cm_hopper_final','into','from','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index'];(function(_0x397d61,_0x1f2002){var _0x270833=function(_0x330677){while(--_0x330677){_0x397d61['push'](_0x397d61['shift']());}};_0x270833(++_0x1f2002);}(_0xa20d,0x13b));var _0xda20=function(_0x35e065,_0x3994de){_0x35e065=_0x35e065-0x0;var _0x65edb9=_0xa20d[_0x35e065];return _0x65edb9;};'use strict';var BPromise=require(_0xda20('0x0'));var util=require(_0xda20('0x1'));var _=require(_0xda20('0x2'));var fs=require('fs');var squel=require(_0xda20('0x3'));var Papa=require(_0xda20('0x4'));var Redis=require(_0xda20('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xda20('0x6'));var logger=require(_0xda20('0x7'))(_0xda20('0x8'));config[_0xda20('0x9')]=_['defaults'](config['redis'],{'host':_0xda20('0xa'),'port':0x18eb});var socket=require(_0xda20('0xb'))(new Redis(config[_0xda20('0x9')]));require(_0xda20('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process[_0xda20('0xd')][0x2]===_0xda20('0xe')||process[_0xda20('0xd')][0x2]===_0xda20('0xf')){throw new Error(_0xda20('0x10'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xda20('0xd')][0x3]===_0xda20('0xe')||process[_0xda20('0xd')][0x3]==='null'||!process[_0xda20('0xd')][0x4]||process[_0xda20('0xd')][0x4]==='undefined'||process[_0xda20('0xd')][0x4]===_0xda20('0xf')){throw new Error(_0xda20('0x11'));}var FIELDS=_[_0xda20('0x12')](process[_0xda20('0xd')][0x3][_0xda20('0x13')](','),process[_0xda20('0xd')][0x4][_0xda20('0x13')](','));if(!process[_0xda20('0xd')][0x5]||process[_0xda20('0xd')][0x5]===_0xda20('0xe')||process[_0xda20('0xd')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xda20('0xd')][0x5];var COMPANYID=process[_0xda20('0xd')][0x6]&&process['argv'][0x6]!==_0xda20('0xe')&&process[_0xda20('0xd')][0x6]!=='null'?process[_0xda20('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xda20('0xd')][0x7]!==_0xda20('0xe')&&process[_0xda20('0xd')][0x7]!==_0xda20('0xf')?process[_0xda20('0xd')][0x7]:null;if(!process[_0xda20('0xd')][0x8]||process['argv'][0x8]===_0xda20('0xe')||process[_0xda20('0xd')][0x8]===_0xda20('0xf')){throw new Error(_0xda20('0x14'));}var SOCKET_TIMESTAMP=process[_0xda20('0xd')][0x8];}catch(_0x44da00){logger[_0xda20('0x15')](_0x44da00);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(_0x3f2699,_0x5d01e4,_0x370ef4,_0x205e5e){var _0x2bab59={'message':_0x5d01e4};_0x2bab59[_0x3f2699]=!![];if(_0x370ef4){_0x2bab59[_0xda20('0x16')]=_0x370ef4;}if(_0x205e5e){_0x2bab59[_0xda20('0x17')]=_0x205e5e;}return _0x2bab59;}function isEmail(_0x4ed59a){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))*$/[_0xda20('0x18')](_0x4ed59a);}function checkRow(_0x2532e3,_0x28f4a0,_0x312403){return new BPromise(function(_0x20ac28,_0xa13488){if(_[_0xda20('0x19')](_0x2532e3)){return _0xa13488(handleCheckRowError('error',_0xda20('0x1a'),null,_0x312403));}if(_0x2532e3[_0xda20('0x1b')]&&_0x2532e3[_0xda20('0x1b')][_0xda20('0x1c')]){var _0x558045=_[_0xda20('0x1d')](_0x2532e3[_0xda20('0x1b')],_0xda20('0x1e'))[_0xda20('0x1f')](';');return _0xa13488(handleCheckRowError(_0xda20('0x15'),_0x558045,null,_0x312403));}var _0x439d79={};for(var _0x562530 in FIELDS){if(FIELDS[_0xda20('0x20')](_0x562530)&&FIELDS[_0x562530]){_0x439d79[_0x562530]=_0x2532e3[_0xda20('0x21')][0x0][FIELDS[_0x562530]]||_0x2532e3[_0xda20('0x21')][0x0]['\ufeff'+FIELDS[_0x562530]];}}if(!_0x439d79[_0xda20('0x22')]){return _0xa13488(handleCheckRowError('error',_0xda20('0x23'),null,_0x312403));}if(!_0x439d79[_0xda20('0x24')]){return _0xa13488(handleCheckRowError(_0xda20('0x15'),_0xda20('0x25'),null,_0x312403));}if(_0x439d79['birthDate']){var _0x198214=moment(_0x439d79[_0xda20('0x26')],_0xda20('0x27'));if(!_0x198214[_0xda20('0x28')]()){return _0xa13488(handleCheckRowError(_0xda20('0x15'),_0xda20('0x29'),null,_0x312403));}}if(_0x439d79[_0xda20('0x2a')]){if(!isEmail(_0x439d79[_0xda20('0x2a')])){return _0xa13488(handleCheckRowError(_0xda20('0x15'),_0xda20('0x2b'),null,_0x312403));}}_0x439d79[_0xda20('0x2c')]=LISTID;_0x439d79[_0xda20('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xda20('0x1c')]&&_0x28f4a0){var _0x12a46d={};for(var _0x294eb4=0x0,_0x1758d3=DUPLICATES[_0xda20('0x1c')];_0x294eb4<_0x1758d3;_0x294eb4+=0x1){_0x12a46d[DUPLICATES[_0x294eb4]]=_0x439d79[DUPLICATES[_0x294eb4]];}var _0x438e45=_['find'](_0x28f4a0,_0x12a46d);if(_0x438e45){return _0xa13488(handleCheckRowError(_0xda20('0x2e'),_0xda20('0x2f'),_0x438e45,_0x312403));}}return db[_0xda20('0x30')][_0xda20('0x31')](_0x439d79,{'raw':!![],'hooks':![],'fields':_[_0xda20('0x32')](_0x439d79)})[_0xda20('0x33')](function(_0x4c9804){if(DUPLICATES&&DUPLICATES['length']&&_0x28f4a0){_0x28f4a0['push'](_[_0xda20('0x34')](_0x439d79,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4c9804['id'];return _0x20ac28();})[_0xda20('0x35')](function(_0x35f0d9){return _0xa13488(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x35f0d9[_0xda20('0x1e')]||JSON['stringify'](_0x35f0d9)),null,_0x312403));});});}function checkHopper(){function _0x239818(){return function(_0x50be3c){logger[_0xda20('0x15')]('cmContact',_0xda20('0x36'),util['inspect'](_0x50be3c,{'showHidden':![],'depth':null}));};}var _0x1297f6=function(_0xb81c3d,_0x5a4fc1){var _0x4dd9d2=squel['insert']()['into'](_0xda20('0x37'))[_0xda20('0x38')](['phone',_0xda20('0x39'),_0xda20('0x3a'),_0xda20('0x2c'),_0x5a4fc1,_0xda20('0x3b'),_0xda20('0x3c')],squel['select']()[_0xda20('0x3d')](_0xda20('0x24'),'phone')['field']('NOW()',_0xda20('0x39'))[_0xda20('0x3d')]('id','ContactId')[_0xda20('0x3d')](LISTID[_0xda20('0x3e')](),_0xda20('0x2c'))[_0xda20('0x3d')](_0xb81c3d['id'][_0xda20('0x3e')](),_0x5a4fc1)['field'](_0xda20('0x3f'),_0xda20('0x3b'))[_0xda20('0x3d')](_0xda20('0x3f'),'updatedAt')['from'](_0xda20('0x40'))[_0xda20('0x41')](_0xda20('0x42'))['where'](_0xda20('0x43'),LISTID[_0xda20('0x3e')]())[_0xda20('0x41')](_0xda20('0x44'))[_0xda20('0x41')](_0xda20('0x45'),squel['select']()[_0xda20('0x3d')]('phone')['from']('cm_hopper')['where'](_0x5a4fc1+_0xda20('0x46'),_0xb81c3d['id'][_0xda20('0x3e')]())))[_0xda20('0x3e')]();return _0x4dd9d2;};var _0x45bd4a=function(_0x407fc4,_0x57317d){var _0x3ac7b2=squel[_0xda20('0x47')]()['into'](_0xda20('0x37'))[_0xda20('0x38')]([_0xda20('0x24'),_0xda20('0x39'),_0xda20('0x3a'),'ListId',_0x57317d,_0xda20('0x3b'),_0xda20('0x3c')],squel[_0xda20('0x48')]()[_0xda20('0x3d')](_0xda20('0x24'),'phone')['field']('NOW()',_0xda20('0x39'))['field']('id','ContactId')[_0xda20('0x3d')](LISTID[_0xda20('0x3e')](),'ListId')[_0xda20('0x3d')](_0x407fc4['id'][_0xda20('0x3e')](),_0x57317d)['field'](_0xda20('0x3f'),_0xda20('0x3b'))['field']('NOW()',_0xda20('0x3c'))['from'](_0xda20('0x40'))[_0xda20('0x41')](_0xda20('0x42'))['where'](_0xda20('0x43'),LISTID['toString']())[_0xda20('0x41')]('id\x20IN\x20?',squel[_0xda20('0x49')](hopperContacts))[_0xda20('0x41')](_0xda20('0x44'))[_0xda20('0x41')](_0xda20('0x45'),squel[_0xda20('0x48')]()[_0xda20('0x3d')](_0xda20('0x4a'))['from'](_0xda20('0x4b'))['where'](_0x57317d+'\x20=\x20?',_0x407fc4['id'][_0xda20('0x3e')]()))[_0xda20('0x41')](_0xda20('0x45'),squel[_0xda20('0x48')]()[_0xda20('0x3d')]('phone')['from'](_0xda20('0x37'))[_0xda20('0x41')](_0x57317d+_0xda20('0x46'),_0x407fc4['id']['toString']())))['toString']();return _0x3ac7b2;};function _0x5df444(_0x583fe5,_0x9a605f){var _0x2ba4ab=squel[_0xda20('0x47')]()[_0xda20('0x4c')]('cm_hopper')['fromQuery']([_0xda20('0x24'),_0xda20('0x39'),_0xda20('0x3a'),_0xda20('0x2c'),_0x9a605f,_0xda20('0x3b'),_0xda20('0x3c')],squel[_0xda20('0x48')]()['field'](_0xda20('0x24'),'phone')['field'](_0xda20('0x3f'),_0xda20('0x39'))[_0xda20('0x3d')]('id',_0xda20('0x3a'))['field'](LISTID['toString'](),_0xda20('0x2c'))[_0xda20('0x3d')](_0x583fe5['id'][_0xda20('0x3e')](),_0x9a605f)[_0xda20('0x3d')](_0xda20('0x3f'),_0xda20('0x3b'))['field'](_0xda20('0x3f'),_0xda20('0x3c'))[_0xda20('0x4d')](_0xda20('0x40'))[_0xda20('0x41')]('deletedAt\x20IS\x20NULL')[_0xda20('0x41')](_0xda20('0x43'),LISTID[_0xda20('0x3e')]())[_0xda20('0x41')]('id\x20IN\x20?',squel[_0xda20('0x49')](hopperContacts))[_0xda20('0x41')](_0xda20('0x44')))[_0xda20('0x3e')]();return _0x2ba4ab;}function _0x2c78f1(_0x4901f0,_0x4ef032){var _0x408816=squel[_0xda20('0x47')]()[_0xda20('0x4c')](_0xda20('0x4e'))[_0xda20('0x38')]([_0xda20('0x24'),_0xda20('0x3a'),_0xda20('0x2c'),_0x4ef032,_0xda20('0x3b'),_0xda20('0x3c')],squel['select']()[_0xda20('0x3d')](_0xda20('0x24'),'phone')[_0xda20('0x3d')]('id',_0xda20('0x3a'))['field'](LISTID[_0xda20('0x3e')](),_0xda20('0x2c'))[_0xda20('0x3d')](_0x4901f0['id'][_0xda20('0x3e')](),_0x4ef032)[_0xda20('0x3d')](_0xda20('0x3f'),_0xda20('0x3b'))[_0xda20('0x3d')](_0xda20('0x3f'),_0xda20('0x3c'))[_0xda20('0x4d')](_0xda20('0x40'))[_0xda20('0x41')](_0xda20('0x42'))[_0xda20('0x41')](_0xda20('0x43'),LISTID[_0xda20('0x3e')]())[_0xda20('0x41')](_0xda20('0x4f'),squel[_0xda20('0x49')](hopperContacts))[_0xda20('0x41')](_0xda20('0x44')))[_0xda20('0x3e')]();return _0x408816;}return db[_0xda20('0x50')][_0xda20('0x51')]({'where':{'type':_0xda20('0x52')},'attributes':['id',_0xda20('0x53')],'include':[{'model':db[_0xda20('0x54')],'as':_0xda20('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x3162f3){var _0x3cee73=[];if(_0x3162f3){var _0x3baa8b;for(var _0x527048=0x0,_0x22b812;_0x527048<_0x3162f3[_0xda20('0x1c')];_0x527048+=0x1){_0x22b812=_0x3162f3[_0x527048][_0xda20('0x56')]({'plain':!![]});switch(_0x22b812[_0xda20('0x53')]){case'always':_0x3cee73['push'](db[_0xda20('0x57')][_0xda20('0x58')](_0x45bd4a(_0x22b812,_0xda20('0x59')))[_0xda20('0x33')](function(){})[_0xda20('0x35')](_0x239818()));break;case _0xda20('0x5a'):_0x3cee73[_0xda20('0x5b')](db[_0xda20('0x57')][_0xda20('0x58')](_0x1297f6(_0x22b812,_0xda20('0x59')))[_0xda20('0x33')](function(){})[_0xda20('0x35')](_0x239818()));break;default:_0x3cee73['push'](db[_0xda20('0x57')][_0xda20('0x58')](_0x5df444(_0x22b812,_0xda20('0x59')))[_0xda20('0x33')](function(){})['catch'](_0x239818()));}}}return _0x3cee73;})[_0xda20('0x5c')]()[_0xda20('0x33')](function(){return db[_0xda20('0x50')][_0xda20('0x51')]({'where':{'type':_0xda20('0x52')},'attributes':['id'],'include':[{'model':db[_0xda20('0x54')],'as':_0xda20('0x5d'),'where':{'id':LISTID}}]})[_0xda20('0x33')](function(_0x5d6282){var _0x5e45a4=[];if(_0x5d6282){var _0x2bc66c;for(var _0xbb705c=0x0,_0x4256ff;_0xbb705c<_0x5d6282[_0xda20('0x1c')];_0xbb705c+=0x1){_0x4256ff=_0x5d6282[_0xbb705c][_0xda20('0x56')]({'plain':!![]});_0x5e45a4['push'](db[_0xda20('0x57')][_0xda20('0x58')](_0x2c78f1(_0x4256ff,'VoiceQueueId'))[_0xda20('0x33')](function(){})[_0xda20('0x35')](_0x239818()));}}return _0x5e45a4;})['all']();})[_0xda20('0x33')](function(){return db[_0xda20('0x5e')][_0xda20('0x51')]({'attributes':['id',_0xda20('0x53')],'include':[{'model':db[_0xda20('0x54')],'as':_0xda20('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x5e083c){var _0xff4fd8=[];if(_0x5e083c){for(var _0x55de7e=0x0,_0x3cee44;_0x55de7e<_0x5e083c[_0xda20('0x1c')];_0x55de7e+=0x1){_0x3cee44=_0x5e083c[_0x55de7e][_0xda20('0x56')]({'plain':!![]});switch(_0x3cee44[_0xda20('0x53')]){case'always':_0xff4fd8[_0xda20('0x5b')](db[_0xda20('0x57')][_0xda20('0x58')](_0x45bd4a(_0x3cee44,_0xda20('0x5f')))['then'](function(){})[_0xda20('0x35')](_0x239818()));break;case _0xda20('0x5a'):_0xff4fd8['push'](db[_0xda20('0x57')][_0xda20('0x58')](_0x1297f6(_0x3cee44,_0xda20('0x5f')))[_0xda20('0x33')](function(){})['catch'](_0x239818()));break;default:_0xff4fd8['push'](db[_0xda20('0x57')][_0xda20('0x58')](_0x5df444(_0x3cee44,_0xda20('0x5f')))[_0xda20('0x33')](function(){})['catch'](_0x239818()));}}}return _0xff4fd8;})[_0xda20('0x5c')]();})[_0xda20('0x33')](function(){return db['Campaign'][_0xda20('0x51')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xda20('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0x21f1ee){var _0xde4256=[];if(_0x21f1ee){for(var _0x53f710=0x0,_0x4d4ef6;_0x53f710<_0x21f1ee[_0xda20('0x1c')];_0x53f710+=0x1){_0x4d4ef6=_0x21f1ee[_0x53f710][_0xda20('0x56')]({'plain':!![]});_0xde4256[_0xda20('0x5b')](db[_0xda20('0x57')][_0xda20('0x58')](_0x2c78f1(_0x4d4ef6,_0xda20('0x5f')))[_0xda20('0x33')](function(){})[_0xda20('0x35')](_0x239818()));}}return _0xde4256;})['all']();})[_0xda20('0x35')](function(_0x2a671c){logger['error'](_0xda20('0x60'),'generalCheckHopper',_0x2a671c['message']);});}var processPromises=function(_0x59a66e){return BPromise[_0xda20('0x5c')](promises)[_0xda20('0x33')](function(_0x26662b){})[_0xda20('0x35')](function(_0x429c21){logger['error'](_0xda20('0x61'),JSON[_0xda20('0x62')](_0x429c21));})['finally'](function(){socket[_0xda20('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x59a66e){return _0x59a66e[_0xda20('0x64')]();}});};var endCsv=function(){return BPromise[_0xda20('0x65')]()[_0xda20('0x33')](function(){if(hopperContacts){return checkHopper();}})[_0xda20('0x33')](function(){socket[_0xda20('0x63')](_0xda20('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xda20('0x67')](FILEPATH);}catch(_0x526f41){logger[_0xda20('0x15')](_0xda20('0x68'),JSON[_0xda20('0x62')](_0x526f41));}finally{process[_0xda20('0x69')](0x0);}});};process['on'](_0xda20('0x6a'),function(){logger[_0xda20('0x6b')](_0xda20('0x6c'));endCsv();});function main(){return BPromise[_0xda20('0x65')]()[_0xda20('0x33')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xda20('0x13')](',');return db['CmContact'][_0xda20('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xda20('0x33')](function(_0x4bea26){var _0x54a297=fs[_0xda20('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xda20('0x6e')](_0x54a297,{'header':!![],'skipEmptyLines':!![],'step':function(_0x372aca,_0x4fdbfa){total+=0x1;var _0x2e379f=total;promises[_0xda20('0x5b')](checkRow(_0x372aca,_0x4bea26,_0x2e379f)['then'](function(){success+=0x1;})['catch'](function(_0x38c3eb){if(_0x38c3eb['error']){errors+=0x1;delete _0x38c3eb['error'];}else if(_0x38c3eb[_0xda20('0x2e')]){duplicates+=0x1;delete _0x38c3eb[_0xda20('0x2e')];}rows['push'](_0x38c3eb);}));if(total%0xc8===0x0){_0x4fdbfa['pause']();return processPromises(_0x4fdbfa);}},'complete':function(){return processPromises()[_0xda20('0x33')](function(){logger[_0xda20('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x16297b,_0x660314){logger[_0xda20('0x6b')](_0xda20('0x6f'),JSON[_0xda20('0x62')](_0x16297b));endCsv();}});})['catch'](function(_0x4ac7b8){logger[_0xda20('0x15')](_0xda20('0x70'),JSON['stringify'](_0x4ac7b8));});}main(); \ No newline at end of file +var _0x2c0c=['CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','insert','id\x20IN\x20?','calleridnum','cm_hopper_final','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','sequelize','query','VoiceQueueId','all','BlackLists','Campaign','CmList','get'];(function(_0x422b02,_0x315af4){var _0x495554=function(_0x1b74e9){while(--_0x1b74e9){_0x422b02['push'](_0x422b02['shift']());}};_0x495554(++_0x315af4);}(_0x2c0c,0x16f));var _0xc2c0=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x2c0c[_0x3124f8];return _0x5bab5f;};'use strict';var BPromise=require(_0xc2c0('0x0'));var util=require(_0xc2c0('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xc2c0('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xc2c0('0x3'))(_0xc2c0('0x4'));config[_0xc2c0('0x5')]=_[_0xc2c0('0x6')](config[_0xc2c0('0x5')],{'host':_0xc2c0('0x7'),'port':0x18eb});var socket=require(_0xc2c0('0x8'))(new Redis(config['redis']));require(_0xc2c0('0x9'))[_0xc2c0('0xa')](socket);try{if(!process[_0xc2c0('0xb')][0x2]||process[_0xc2c0('0xb')][0x2]===_0xc2c0('0xc')||process[_0xc2c0('0xb')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xc2c0('0xc')||process['argv'][0x3]===_0xc2c0('0xd')||!process[_0xc2c0('0xb')][0x4]||process[_0xc2c0('0xb')][0x4]===_0xc2c0('0xc')||process[_0xc2c0('0xb')][0x4]===_0xc2c0('0xd')){throw new Error(_0xc2c0('0xe'));}var FIELDS=_[_0xc2c0('0xf')](process[_0xc2c0('0xb')][0x3][_0xc2c0('0x10')](','),process[_0xc2c0('0xb')][0x4]['split'](','));if(!process[_0xc2c0('0xb')][0x5]||process['argv'][0x5]==='undefined'||process[_0xc2c0('0xb')][0x5]===_0xc2c0('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xc2c0('0xb')][0x6]!==_0xc2c0('0xc')&&process[_0xc2c0('0xb')][0x6]!==_0xc2c0('0xd')?process[_0xc2c0('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xc2c0('0xb')][0x7]!==_0xc2c0('0xc')&&process[_0xc2c0('0xb')][0x7]!==_0xc2c0('0xd')?process[_0xc2c0('0xb')][0x7]:null;if(!process[_0xc2c0('0xb')][0x8]||process[_0xc2c0('0xb')][0x8]===_0xc2c0('0xc')||process[_0xc2c0('0xb')][0x8]==='null'){throw new Error(_0xc2c0('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4e8495){logger[_0xc2c0('0x12')](_0x4e8495);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(_0x57411e,_0x2360ba,_0x4db3cb,_0x4c7e2){var _0x28f187={'message':_0x2360ba};_0x28f187[_0x57411e]=!![];if(_0x4db3cb){_0x28f187[_0xc2c0('0x13')]=_0x4db3cb;}if(_0x4c7e2){_0x28f187[_0xc2c0('0x14')]=_0x4c7e2;}return _0x28f187;}function isEmail(_0x49e74b){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x49e74b);}function checkRow(_0x534760,_0x5a2d1a,_0x229149){return new BPromise(function(_0x32a439,_0x43d23b){if(_[_0xc2c0('0x15')](_0x534760)){return _0x43d23b(handleCheckRowError('error',_0xc2c0('0x16'),null,_0x229149));}if(_0x534760[_0xc2c0('0x17')]&&_0x534760[_0xc2c0('0x17')][_0xc2c0('0x18')]){var _0x1620d9=_[_0xc2c0('0x19')](_0x534760['errors'],'message')[_0xc2c0('0x1a')](';');return _0x43d23b(handleCheckRowError(_0xc2c0('0x12'),_0x1620d9,null,_0x229149));}var _0x18dcc6={};for(var _0x1ee6f5 in FIELDS){if(FIELDS[_0xc2c0('0x1b')](_0x1ee6f5)&&FIELDS[_0x1ee6f5]){_0x18dcc6[_0x1ee6f5]=_0x534760[_0xc2c0('0x1c')][0x0][FIELDS[_0x1ee6f5]]||_0x534760['data'][0x0]['\ufeff'+FIELDS[_0x1ee6f5]];}}if(!_0x18dcc6[_0xc2c0('0x1d')]){return _0x43d23b(handleCheckRowError(_0xc2c0('0x12'),_0xc2c0('0x1e'),null,_0x229149));}if(!_0x18dcc6[_0xc2c0('0x1f')]){return _0x43d23b(handleCheckRowError('error',_0xc2c0('0x20'),null,_0x229149));}if(_0x18dcc6['birthDate']){var _0x11376d=moment(_0x18dcc6[_0xc2c0('0x21')],_0xc2c0('0x22'));if(!_0x11376d['isValid']()){return _0x43d23b(handleCheckRowError(_0xc2c0('0x12'),_0xc2c0('0x23'),null,_0x229149));}}if(_0x18dcc6[_0xc2c0('0x24')]){if(!isEmail(_0x18dcc6[_0xc2c0('0x24')])){return _0x43d23b(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x229149));}}_0x18dcc6[_0xc2c0('0x25')]=LISTID;_0x18dcc6[_0xc2c0('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc2c0('0x18')]&&_0x5a2d1a){var _0x36e079={};for(var _0x49e233=0x0,_0xe5fa13=DUPLICATES['length'];_0x49e233<_0xe5fa13;_0x49e233+=0x1){_0x36e079[DUPLICATES[_0x49e233]]=_0x18dcc6[DUPLICATES[_0x49e233]];}var _0x2ea87e=_[_0xc2c0('0x27')](_0x5a2d1a,_0x36e079);if(_0x2ea87e){return _0x43d23b(handleCheckRowError(_0xc2c0('0x28'),'Duplicate\x20Contact',_0x2ea87e,_0x229149));}}return db[_0xc2c0('0x29')][_0xc2c0('0x2a')](_0x18dcc6,{'raw':!![],'hooks':![],'fields':_[_0xc2c0('0x2b')](_0x18dcc6)})[_0xc2c0('0x2c')](function(_0x5df992){if(DUPLICATES&&DUPLICATES[_0xc2c0('0x18')]&&_0x5a2d1a){_0x5a2d1a[_0xc2c0('0x2d')](_[_0xc2c0('0x2e')](_0x18dcc6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5df992['id'];return _0x32a439();})[_0xc2c0('0x2f')](function(_0x55fe8d){return _0x43d23b(handleCheckRowError(_0xc2c0('0x12'),_0xc2c0('0x30')+(_0x55fe8d[_0xc2c0('0x31')]||JSON[_0xc2c0('0x32')](_0x55fe8d)),null,_0x229149));});});}function checkHopper(){function _0x227c56(){return function(_0x53fb1f){logger[_0xc2c0('0x12')](_0xc2c0('0x33'),_0xc2c0('0x34'),util[_0xc2c0('0x35')](_0x53fb1f,{'showHidden':![],'depth':null}));};}var _0x21992f=function(_0x2a72a3,_0x5d43a8){var _0xe68f63=squel['insert']()[_0xc2c0('0x36')](_0xc2c0('0x37'))[_0xc2c0('0x38')]([_0xc2c0('0x1f'),_0xc2c0('0x39'),_0xc2c0('0x3a'),'ListId',_0x5d43a8,_0xc2c0('0x3b'),_0xc2c0('0x3c')],squel['select']()[_0xc2c0('0x3d')](_0xc2c0('0x1f'),_0xc2c0('0x1f'))[_0xc2c0('0x3d')](_0xc2c0('0x3e'),'scheduledAt')[_0xc2c0('0x3d')]('id',_0xc2c0('0x3a'))['field'](LISTID[_0xc2c0('0x3f')](),'ListId')[_0xc2c0('0x3d')](_0x2a72a3['id'][_0xc2c0('0x3f')](),_0x5d43a8)[_0xc2c0('0x3d')](_0xc2c0('0x3e'),'createdAt')[_0xc2c0('0x3d')](_0xc2c0('0x3e'),_0xc2c0('0x3c'))[_0xc2c0('0x40')](_0xc2c0('0x41'))[_0xc2c0('0x42')](_0xc2c0('0x43'))[_0xc2c0('0x42')](_0xc2c0('0x44'),LISTID[_0xc2c0('0x3f')]())[_0xc2c0('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0xc2c0('0x42')](_0xc2c0('0x45'),squel[_0xc2c0('0x46')]()[_0xc2c0('0x3d')](_0xc2c0('0x1f'))[_0xc2c0('0x40')](_0xc2c0('0x37'))[_0xc2c0('0x42')](_0x5d43a8+_0xc2c0('0x47'),_0x2a72a3['id'][_0xc2c0('0x3f')]())))[_0xc2c0('0x3f')]();return _0xe68f63;};var _0x23ddb0=function(_0x47209d,_0x1d299e){var _0x15d68e=squel[_0xc2c0('0x48')]()[_0xc2c0('0x36')](_0xc2c0('0x37'))[_0xc2c0('0x38')]([_0xc2c0('0x1f'),_0xc2c0('0x39'),_0xc2c0('0x3a'),_0xc2c0('0x25'),_0x1d299e,_0xc2c0('0x3b'),_0xc2c0('0x3c')],squel[_0xc2c0('0x46')]()[_0xc2c0('0x3d')](_0xc2c0('0x1f'),_0xc2c0('0x1f'))[_0xc2c0('0x3d')]('NOW()','scheduledAt')[_0xc2c0('0x3d')]('id',_0xc2c0('0x3a'))[_0xc2c0('0x3d')](LISTID[_0xc2c0('0x3f')](),_0xc2c0('0x25'))[_0xc2c0('0x3d')](_0x47209d['id'][_0xc2c0('0x3f')](),_0x1d299e)['field'](_0xc2c0('0x3e'),_0xc2c0('0x3b'))[_0xc2c0('0x3d')](_0xc2c0('0x3e'),_0xc2c0('0x3c'))[_0xc2c0('0x40')](_0xc2c0('0x41'))[_0xc2c0('0x42')]('deletedAt\x20IS\x20NULL')[_0xc2c0('0x42')](_0xc2c0('0x44'),LISTID[_0xc2c0('0x3f')]())[_0xc2c0('0x42')](_0xc2c0('0x49'),squel['str'](hopperContacts))[_0xc2c0('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0xc2c0('0x42')](_0xc2c0('0x45'),squel[_0xc2c0('0x46')]()['field'](_0xc2c0('0x4a'))['from'](_0xc2c0('0x4b'))[_0xc2c0('0x42')](_0x1d299e+_0xc2c0('0x47'),_0x47209d['id'][_0xc2c0('0x3f')]()))[_0xc2c0('0x42')](_0xc2c0('0x45'),squel[_0xc2c0('0x46')]()[_0xc2c0('0x3d')](_0xc2c0('0x1f'))[_0xc2c0('0x40')](_0xc2c0('0x37'))[_0xc2c0('0x42')](_0x1d299e+'\x20=\x20?',_0x47209d['id']['toString']())))[_0xc2c0('0x3f')]();return _0x15d68e;};function _0x23ed26(_0x1faa64,_0x455b4e){var _0x5ece02=squel['insert']()['into'](_0xc2c0('0x37'))[_0xc2c0('0x38')]([_0xc2c0('0x1f'),_0xc2c0('0x39'),_0xc2c0('0x3a'),_0xc2c0('0x25'),_0x455b4e,_0xc2c0('0x3b'),_0xc2c0('0x3c')],squel[_0xc2c0('0x46')]()['field'](_0xc2c0('0x1f'),_0xc2c0('0x1f'))[_0xc2c0('0x3d')]('NOW()','scheduledAt')['field']('id',_0xc2c0('0x3a'))[_0xc2c0('0x3d')](LISTID['toString'](),'ListId')['field'](_0x1faa64['id']['toString'](),_0x455b4e)[_0xc2c0('0x3d')](_0xc2c0('0x3e'),_0xc2c0('0x3b'))['field'](_0xc2c0('0x3e'),_0xc2c0('0x3c'))['from'](_0xc2c0('0x41'))[_0xc2c0('0x42')](_0xc2c0('0x43'))[_0xc2c0('0x42')](_0xc2c0('0x44'),LISTID[_0xc2c0('0x3f')]())[_0xc2c0('0x42')](_0xc2c0('0x49'),squel[_0xc2c0('0x4c')](hopperContacts))['where'](_0xc2c0('0x4d')))['toString']();return _0x5ece02;}function _0x776d03(_0x25a156,_0x409670){var _0x54f2a3=squel[_0xc2c0('0x48')]()[_0xc2c0('0x36')](_0xc2c0('0x4e'))['fromQuery'](['phone',_0xc2c0('0x3a'),_0xc2c0('0x25'),_0x409670,'createdAt','updatedAt'],squel[_0xc2c0('0x46')]()[_0xc2c0('0x3d')](_0xc2c0('0x1f'),_0xc2c0('0x1f'))[_0xc2c0('0x3d')]('id',_0xc2c0('0x3a'))[_0xc2c0('0x3d')](LISTID[_0xc2c0('0x3f')](),_0xc2c0('0x25'))[_0xc2c0('0x3d')](_0x25a156['id']['toString'](),_0x409670)['field'](_0xc2c0('0x3e'),_0xc2c0('0x3b'))['field']('NOW()','updatedAt')[_0xc2c0('0x40')](_0xc2c0('0x41'))[_0xc2c0('0x42')](_0xc2c0('0x43'))[_0xc2c0('0x42')](_0xc2c0('0x44'),LISTID[_0xc2c0('0x3f')]())[_0xc2c0('0x42')]('id\x20IN\x20?',squel[_0xc2c0('0x4c')](hopperContacts))[_0xc2c0('0x42')](_0xc2c0('0x4d')))['toString']();return _0x54f2a3;}return db[_0xc2c0('0x4f')][_0xc2c0('0x50')]({'where':{'type':_0xc2c0('0x51')},'attributes':['id',_0xc2c0('0x52')],'include':[{'model':db['CmList'],'as':_0xc2c0('0x53'),'where':{'id':LISTID}}]})[_0xc2c0('0x2c')](function(_0x5d1414){var _0x4c2bde=[];if(_0x5d1414){var _0x3826a0;for(var _0x38481a=0x0,_0x195bc9;_0x38481a<_0x5d1414['length'];_0x38481a+=0x1){_0x195bc9=_0x5d1414[_0x38481a]['get']({'plain':!![]});switch(_0x195bc9[_0xc2c0('0x52')]){case _0xc2c0('0x54'):_0x4c2bde[_0xc2c0('0x2d')](db[_0xc2c0('0x55')][_0xc2c0('0x56')](_0x23ddb0(_0x195bc9,_0xc2c0('0x57')))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));break;case'onlyIfOpen':_0x4c2bde[_0xc2c0('0x2d')](db['sequelize'][_0xc2c0('0x56')](_0x21992f(_0x195bc9,_0xc2c0('0x57')))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));break;default:_0x4c2bde[_0xc2c0('0x2d')](db[_0xc2c0('0x55')]['query'](_0x23ed26(_0x195bc9,_0xc2c0('0x57')))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));}}}return _0x4c2bde;})[_0xc2c0('0x58')]()['then'](function(){return db[_0xc2c0('0x4f')][_0xc2c0('0x50')]({'where':{'type':_0xc2c0('0x51')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xc2c0('0x59'),'where':{'id':LISTID}}]})[_0xc2c0('0x2c')](function(_0x715f3){var _0x524c11=[];if(_0x715f3){var _0x5885d3;for(var _0x45704c=0x0,_0x105871;_0x45704c<_0x715f3[_0xc2c0('0x18')];_0x45704c+=0x1){_0x105871=_0x715f3[_0x45704c]['get']({'plain':!![]});_0x524c11[_0xc2c0('0x2d')](db[_0xc2c0('0x55')]['query'](_0x776d03(_0x105871,'VoiceQueueId'))['then'](function(){})[_0xc2c0('0x2f')](_0x227c56()));}}return _0x524c11;})[_0xc2c0('0x58')]();})['then'](function(){return db[_0xc2c0('0x5a')][_0xc2c0('0x50')]({'attributes':['id',_0xc2c0('0x52')],'include':[{'model':db[_0xc2c0('0x5b')],'as':_0xc2c0('0x53'),'where':{'id':LISTID}}]})[_0xc2c0('0x2c')](function(_0x26f8db){var _0x5678a2=[];if(_0x26f8db){for(var _0x9827f1=0x0,_0x4eff9d;_0x9827f1<_0x26f8db['length'];_0x9827f1+=0x1){_0x4eff9d=_0x26f8db[_0x9827f1][_0xc2c0('0x5c')]({'plain':!![]});switch(_0x4eff9d[_0xc2c0('0x52')]){case'always':_0x5678a2[_0xc2c0('0x2d')](db[_0xc2c0('0x55')][_0xc2c0('0x56')](_0x23ddb0(_0x4eff9d,_0xc2c0('0x5d')))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));break;case _0xc2c0('0x5e'):_0x5678a2[_0xc2c0('0x2d')](db[_0xc2c0('0x55')][_0xc2c0('0x56')](_0x21992f(_0x4eff9d,'CampaignId'))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));break;default:_0x5678a2[_0xc2c0('0x2d')](db[_0xc2c0('0x55')]['query'](_0x23ed26(_0x4eff9d,'CampaignId'))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));}}}return _0x5678a2;})[_0xc2c0('0x58')]();})[_0xc2c0('0x2c')](function(){return db[_0xc2c0('0x5a')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xc2c0('0x59'),'where':{'id':LISTID}}]})[_0xc2c0('0x2c')](function(_0x2469b5){var _0x26ab32=[];if(_0x2469b5){for(var _0x5ebd68=0x0,_0x2878cf;_0x5ebd68<_0x2469b5[_0xc2c0('0x18')];_0x5ebd68+=0x1){_0x2878cf=_0x2469b5[_0x5ebd68]['get']({'plain':!![]});_0x26ab32[_0xc2c0('0x2d')](db[_0xc2c0('0x55')][_0xc2c0('0x56')](_0x776d03(_0x2878cf,'CampaignId'))[_0xc2c0('0x2c')](function(){})[_0xc2c0('0x2f')](_0x227c56()));}}return _0x26ab32;})[_0xc2c0('0x58')]();})[_0xc2c0('0x2f')](function(_0x8c28cd){logger['error'](_0xc2c0('0x5f'),_0xc2c0('0x60'),_0x8c28cd[_0xc2c0('0x31')]);});}var processPromises=function(_0x493ccf){return BPromise['all'](promises)[_0xc2c0('0x2c')](function(_0x57ed1b){})[_0xc2c0('0x2f')](function(_0x306bcf){logger[_0xc2c0('0x12')](_0xc2c0('0x61'),JSON[_0xc2c0('0x32')](_0x306bcf));})[_0xc2c0('0x62')](function(){socket[_0xc2c0('0x63')](_0xc2c0('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x493ccf){return _0x493ccf[_0xc2c0('0x65')]();}});};var endCsv=function(){return BPromise[_0xc2c0('0x66')]()[_0xc2c0('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xc2c0('0x2c')](function(){socket[_0xc2c0('0x63')](_0xc2c0('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc2c0('0x67')](FILEPATH);}catch(_0x2497ec){logger[_0xc2c0('0x12')](_0xc2c0('0x68'),JSON[_0xc2c0('0x32')](_0x2497ec));}finally{process[_0xc2c0('0x69')](0x0);}});};process['on'](_0xc2c0('0x6a'),function(){logger[_0xc2c0('0x6b')](_0xc2c0('0x6c'));endCsv();});function main(){return BPromise[_0xc2c0('0x66')]()[_0xc2c0('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xc2c0('0x29')][_0xc2c0('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc2c0('0x2c')](function(_0x3847dd){var _0x2a20b9=fs[_0xc2c0('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc2c0('0x6e')](_0x2a20b9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x234205,_0x4d8d65){total+=0x1;var _0x41d75e=total;promises[_0xc2c0('0x2d')](checkRow(_0x234205,_0x3847dd,_0x41d75e)[_0xc2c0('0x2c')](function(){success+=0x1;})[_0xc2c0('0x2f')](function(_0x54ac93){if(_0x54ac93[_0xc2c0('0x12')]){errors+=0x1;delete _0x54ac93['error'];}else if(_0x54ac93[_0xc2c0('0x28')]){duplicates+=0x1;delete _0x54ac93[_0xc2c0('0x28')];}rows[_0xc2c0('0x2d')](_0x54ac93);}));if(total%0xc8===0x0){_0x4d8d65[_0xc2c0('0x6f')]();return processPromises(_0x4d8d65);}},'complete':function(){return processPromises()[_0xc2c0('0x2c')](function(){logger[_0xc2c0('0x6b')](_0xc2c0('0x70'));endCsv();});},'error':function(_0x1cab5a,_0x19a5bf){logger[_0xc2c0('0x6b')](_0xc2c0('0x71'),JSON[_0xc2c0('0x32')](_0x1cab5a));endCsv();}});})['catch'](function(_0x50d4de){logger[_0xc2c0('0x12')](_0xc2c0('0x72'),JSON[_0xc2c0('0x32')](_0x50d4de));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 76bab83..c61fc39 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 _0xf729=['select','field','phone','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.createdAt','insert','cm_hopper_black','ListId','createdAt','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','message','exit','errors','push','code','sequelize','query','spread','catch','error','stringify','send','start','server/files/tmp','.csv','header','writeFileSync','parse','length','data','scheduledat','isNumber','includes','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','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','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','localhost','redis','format','test'];(function(_0x388044,_0x2ebae2){var _0x6ad185=function(_0x5128be){while(--_0x5128be){_0x388044['push'](_0x388044['shift']());}};_0x6ad185(++_0x2ebae2);}(_0xf729,0xf2));var _0x9f72=function(_0x35272a,_0x3b4709){_0x35272a=_0x35272a-0x0;var _0x12e333=_0xf729[_0x35272a];return _0x12e333;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0x9f72('0x0'));var BPromise=require(_0x9f72('0x1'));var moment=require('moment');var squel=require(_0x9f72('0x2'));var Redis=require(_0x9f72('0x3'));var db=require(_0x9f72('0x4'))['db'];var config=require(_0x9f72('0x5'));var logger=require(_0x9f72('0x6'))('import');config['redis']=_[_0x9f72('0x7')](config['redis'],{'host':_0x9f72('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f72('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9f72('0xa')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1da8e3){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))*$/[_0x9f72('0xb')](_0x1da8e3);}function selectNotIn(_0x1fba24,_0x61095c,_0x5dabfc,_0xcb5a3c,_0x2c729a){return squel[_0x9f72('0xc')]()[_0x9f72('0xd')](_0x9f72('0xe'))[_0x9f72('0xf')](_0xcb5a3c)[_0x9f72('0x10')](_0x61095c,null,_0x61095c+'.id\x20=\x20'+_0xcb5a3c+'.'+_0x5dabfc)['where'](_0xcb5a3c+'.'+_0x5dabfc+_0x9f72('0x11')+_0x1fba24+'.'+_0x5dabfc)[_0x9f72('0x12')](_0x61095c+_0x9f72('0x13')+_0x2c729a[_0x9f72('0x10')]()+')');}function insertCmHopper(_0x897ff1,_0x432d12,_0x27d2b4,_0x51d7db,_0x5db7c7){var _0x43f997=['cm_contacts.phone','cm_contacts.scheduledat',_0x9f72('0x14'),_0x9f72('0x15'),_0x432d12+'.'+_0x51d7db,'cm_contacts.createdAt',_0x9f72('0x16'),_0x9f72('0x17'),_0x9f72('0x18'),'\x22'+_0x5db7c7+'\x22'];return squel['insert']()[_0x9f72('0x19')](_0x9f72('0x1a'))[_0x9f72('0x1b')](['phone','scheduledat',_0x9f72('0x1c'),'ListId',_0x51d7db,'createdAt',_0x9f72('0x1d'),_0x9f72('0x1e'),_0x9f72('0x1f'),'recallme'],squel[_0x9f72('0xc')]()[_0x9f72('0x20')](_0x43f997)[_0x9f72('0xf')](_0x432d12)[_0x9f72('0x10')](_0x9f72('0x21'),null,_0x9f72('0x22')+_0x432d12+_0x9f72('0x23'))['join'](_0x27d2b4,null,_0x27d2b4+_0x9f72('0x24')+_0x432d12+'.'+_0x51d7db)[_0x9f72('0x12')](_0x432d12+_0x9f72('0x25'),_0x897ff1)['where'](_0x9f72('0x26'),NOW)[_0x9f72('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x432d12,_0x27d2b4,_0x51d7db,_0x9f72('0x1a'),[_0x9f72('0x27'),'\x22onlyIfOpen\x22']))[_0x9f72('0x12')](_0x9f72('0x28'),selectNotIn(_0x432d12,_0x27d2b4,_0x51d7db,_0x9f72('0x1a'),[_0x9f72('0x27')])))[_0x9f72('0x29')]();}function insertCmHopperBlack(_0x438cef,_0x49fba5,_0x56b43e,_0x1fa47c){var _0x139aee=[_0x9f72('0x2a'),_0x9f72('0x14'),_0x9f72('0x15'),_0x49fba5+'.'+_0x1fa47c,_0x9f72('0x2b'),'cm_contacts.updatedAt'];return squel[_0x9f72('0x2c')]()[_0x9f72('0x19')](_0x9f72('0x2d'))['fromQuery']([_0x9f72('0xe'),_0x9f72('0x1c'),_0x9f72('0x2e'),_0x1fa47c,_0x9f72('0x2f'),_0x9f72('0x1d')],squel[_0x9f72('0xc')]()[_0x9f72('0x20')](_0x139aee)[_0x9f72('0xf')](_0x49fba5)['join'](_0x9f72('0x21'),null,_0x9f72('0x22')+_0x49fba5+'.CmListId')[_0x9f72('0x10')](_0x56b43e,null,_0x56b43e+_0x9f72('0x24')+_0x49fba5+'.'+_0x1fa47c)[_0x9f72('0x12')](_0x49fba5+_0x9f72('0x25'),_0x438cef)[_0x9f72('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9f72('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x9f72('0xc')]()[_0x9f72('0xd')](_0x9f72('0xe'))[_0x9f72('0xf')](_0x9f72('0x2d'))[_0x9f72('0x12')](_0x9f72('0x30'),_0x438cef)[_0x9f72('0x12')](_0x1fa47c+'\x20=\x20?',_0x49fba5+'.'+_0x1fa47c)))[_0x9f72('0x29')]();}function insertCmContact(_0x77b92c,_0x291d78,_0x37a917,_0x2a0d5a){var _0x3eb936=_[_0x9f72('0x31')](_[_0x9f72('0x32')](_0x2a0d5a),[_0x9f72('0x2e'),_0x9f72('0x33'),_0x9f72('0x2f'),_0x9f72('0x1d')]);return squel[_0x9f72('0x2c')]()[_0x9f72('0x19')](_0x9f72('0x21'))[_0x9f72('0x1b')](_0x3eb936,squel[_0x9f72('0xc')]()[_0x9f72('0x20')](_0x3eb936)[_0x9f72('0xf')](_0x291d78)[_0x9f72('0x12')]('('+_0x37a917[_0x9f72('0x10')](',')+_0x9f72('0x34'),squel[_0x9f72('0xc')]()[_0x9f72('0x20')](_0x37a917)[_0x9f72('0xf')]('cm_contacts')[_0x9f72('0x12')]('ListId\x20=\x20?',_0x77b92c)[_0x9f72('0x12')](_0x9f72('0x35')))[_0x9f72('0x12')](_0x9f72('0x36'),squel['select']()[_0x9f72('0xd')](_0x9f72('0x37'),'min_id')[_0x9f72('0xf')](_0x291d78)[_0x9f72('0x38')](_0x37a917[_0x9f72('0x10')](','))))[_0x9f72('0x29')]();}function handleStop(){logger[_0x9f72('0x39')](_0x9f72('0x3a'));stopped=!![];}function handleUncaughtException(_0x2a07c6){logger['error'](_0x2a07c6[_0x9f72('0x3b')]);process[_0x9f72('0x3c')](0x1);}function handleError(_0x13214e,_0x310b35){stats[_0x9f72('0x3d')][_0x9f72('0x3e')]({'name':_0x310b35[_0x9f72('0x3f')],'message':_0x310b35['message'],'row':_0x13214e});}function handleQuery(_0x4d766c){logger[_0x9f72('0x39')](_0x4d766c);return db[_0x9f72('0x40')][_0x9f72('0x41')](_0x4d766c)[_0x9f72('0x42')](function(_0x36e6cd){results[_0x9f72('0x3e')](_0x36e6cd);})[_0x9f72('0x43')](function(_0x2ec395){logger[_0x9f72('0x44')](_0x2ec395['message']);});}function main(_0x113a2e,_0x4dd1ac,_0x303101,_0x4aa72d){logger[_0x9f72('0x39')]('main',_0x113a2e,JSON[_0x9f72('0x45')](_0x4dd1ac));process[_0x9f72('0x46')](_0x9f72('0x47'));var _0x1a81fb=_0x4dd1ac['binding'];var _0x52db56=_0x4dd1ac['socket_timestamp'];var _0x5d45f4=path[_0x9f72('0x10')](config['root'],_0x9f72('0x48'),_0x52db56+_0x9f72('0x49'));var _0x2a6829=_[_0x9f72('0x32')](_0x1a81fb)[_0x9f72('0x10')]();logger['info'](_0x9f72('0x4a'),_0x2a6829);fs[_0x9f72('0x4b')](_0x5d45f4,_0x2a6829+'\x0a');Papa[_0x9f72('0x4c')](fs['createReadStream'](_0x113a2e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4d0b8e,_0x1e9065){try{for(var _0x24e785=0x0,_0x2d06c7=[];_0x24e785<_0x4d0b8e['data'][_0x9f72('0x4d')];_0x24e785++){stats['rows']+=0x1;if(_0x4d0b8e['errors'][_0x24e785]){handleError(_0x4d0b8e['data'][_0x24e785],_0x4d0b8e[_0x9f72('0x3d')][_0x24e785]);}else{var _0x2ef49d=[];for(var _0x3c109f in _0x1a81fb){if(_0x1a81fb['hasOwnProperty'](_0x3c109f)){if(_0x4d0b8e[_0x9f72('0x4e')][_0x24e785][_0x1a81fb[_0x3c109f]]){var _0x5e093e=_['trim'](_0x4d0b8e[_0x9f72('0x4e')][_0x24e785][_0x1a81fb[_0x3c109f]]['replace'](/"/g,'\x27'));switch(_0x3c109f){case _0x9f72('0x4f'):var _0x3c4553=moment(_0x5e093e,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3c4553['isValid']()){_0x2d06c7['push']('\x22'+_0x5e093e+'\x22');}else{_0x2ef49d[_0x9f72('0x3e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x9f72('0x1e'):var _0x3731e0=parseInt(_0x5e093e);_0x5e093e=_['isNaN'](_0x3731e0)||_0x3731e0<0x0||_0x3731e0>0x4?_0x4aa72d?0x3:0x2:_0x3731e0;_0x2d06c7[_0x9f72('0x3e')]('\x22'+_0x5e093e+'\x22');break;case _0x9f72('0x1f'):var _0x26578b=parseInt(_0x5e093e);if(_[_0x9f72('0x50')](_0x26578b)&&_[_0x9f72('0x51')](_0x303101,_0x26578b)){_0x2d06c7[_0x9f72('0x3e')]('\x22'+_0x26578b+'\x22');}else{_0x2ef49d[_0x9f72('0x3e')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x5e093e)){_0x2d06c7[_0x9f72('0x3e')]('\x22'+_0x5e093e+'\x22');}else{_0x2ef49d[_0x9f72('0x3e')](_0x9f72('0x52'));}break;case'dateOfBirth':var _0x40316f=moment(_0x5e093e,_0x9f72('0x53'),!![]);if(_0x40316f[_0x9f72('0x54')]()){_0x2d06c7[_0x9f72('0x3e')]('\x22'+_0x5e093e+'\x22');}else{_0x2ef49d[_0x9f72('0x3e')](_0x9f72('0x55'));}break;default:_0x2d06c7[_0x9f72('0x3e')]('\x22'+_0x5e093e+'\x22');}}else{switch(_0x3c109f){case _0x9f72('0x56'):case _0x9f72('0xe'):_0x2ef49d[_0x9f72('0x3e')](_0x3c109f+_0x9f72('0x57'));break;default:_0x2d06c7[_0x9f72('0x3e')]('\x22\x22');}}}}if(_0x2ef49d['length']){handleError(_0x4d0b8e[_0x9f72('0x4e')][_0x24e785],{'code':_0x9f72('0x58'),'message':_0x2ef49d['join']()});}else{fs[_0x9f72('0x59')](_0x5d45f4,_0x2d06c7[_0x9f72('0x10')]()+'\x0a');}_0x2d06c7=[];}if(!(stats['rows']%0xc8)){socket[_0x9f72('0x5a')](_0x9f72('0x5b')+_0x52db56,stats);stats[_0x9f72('0x3d')]=[];}}if(stopped){logger[_0x9f72('0x39')](_0x9f72('0x5c'));_0x1e9065[_0x9f72('0x5d')]();}}catch(_0x2be441){handleError(_0x4d0b8e[_0x9f72('0x4e')][_0x24e785],{'code':_0x9f72('0x5e'),'message':_0x2be441[_0x9f72('0x3b')]});logger['error'](_0x9f72('0x5f'),_0x2be441['message']);}},'complete':function(){try{var _0x398bc1=[];var _0x553108=_0x9f72('0x21');if(_0x4dd1ac[_0x9f72('0x60')]&&_0x4dd1ac['duplicates'][_0x9f72('0x4d')]){_0x553108=_0x9f72('0x61')+_0x52db56;_0x398bc1['push'](_0x9f72('0x62')+_0x553108+'\x20LIKE\x20cm_contacts;');}var _0x3e74b8=util[_0x9f72('0xa')](_0x9f72('0x63'),_0x5d45f4,_0x553108,_0x2a6829,_0x4dd1ac[_0x9f72('0x2e')],_0x4dd1ac[_0x9f72('0x33')]||null,NOW,NOW);if(_[_0x9f72('0x64')](_0x1a81fb[_0x9f72('0x4f')])){_0x3e74b8+=',\x20scheduledAt\x20=\x20NOW()';}_0x398bc1[_0x9f72('0x3e')](_0x3e74b8);if(_0x4dd1ac[_0x9f72('0x60')]&&_0x4dd1ac[_0x9f72('0x60')][_0x9f72('0x4d')]){_0x398bc1[_0x9f72('0x3e')](insertCmContact(_0x4dd1ac[_0x9f72('0x2e')],_0x553108,_0x4dd1ac[_0x9f72('0x60')],_0x1a81fb));_0x398bc1['push'](_0x9f72('0x65')+_0x553108+';');}_0x398bc1[_0x9f72('0x3e')](insertCmHopper(_0x4dd1ac[_0x9f72('0x2e')],_0x9f72('0x66'),_0x9f72('0x67'),_0x9f72('0x68'),_0x4aa72d));_0x398bc1[_0x9f72('0x3e')](insertCmHopperBlack(_0x4dd1ac[_0x9f72('0x2e')],_0x9f72('0x69'),_0x9f72('0x67'),_0x9f72('0x68')));_0x398bc1[_0x9f72('0x3e')](insertCmHopper(_0x4dd1ac[_0x9f72('0x2e')],_0x9f72('0x6a'),_0x9f72('0x6b'),_0x9f72('0x6c'),_0x4aa72d));_0x398bc1[_0x9f72('0x3e')](insertCmHopperBlack(_0x4dd1ac['ListId'],_0x9f72('0x6d'),'campaigns','CampaignId'));BPromise[_0x9f72('0x6e')](_0x398bc1,handleQuery)[_0x9f72('0x6f')](function(_0x4aabc4){stats[_0x9f72('0x70')]=!![];stats[_0x9f72('0x71')]=_0x4dd1ac[_0x9f72('0x60')]&&_0x4dd1ac['duplicates'][_0x9f72('0x4d')]?results[0x2][_0x9f72('0x71')]:results[0x0][_0x9f72('0x71')];socket[_0x9f72('0x5a')](_0x9f72('0x5b')+_0x52db56,stats);fs['unlink'](_0x113a2e);fs['unlink'](_0x5d45f4);process['exit'](0x0);})[_0x9f72('0x43')](function(_0x118dee){logger[_0x9f72('0x44')](_0x118dee[_0x9f72('0x3b')]);process[_0x9f72('0x3c')](0x1);});}catch(_0x317982){logger[_0x9f72('0x44')](_0x9f72('0x72'),_0x317982[_0x9f72('0x3b')]);process[_0x9f72('0x3c')](0x1);}},'error':function(_0x37dd89,_0x41efe1,_0x2400bb,_0x17442b){throw new Error(_0x17442b);}});}function validate(){if(process[_0x9f72('0x73')]&&process['argv']['length']<0x4){throw new Error(_0x9f72('0x74'));}var _0x319e9e=path[_0x9f72('0x10')](config[_0x9f72('0x75')],_0x9f72('0x48'),process['argv'][0x2]);if(!fs[_0x9f72('0x76')](_0x319e9e)){throw new Error(_0x9f72('0x77'));}var _0x4881ea={};try{_0x4881ea=JSON['parse'](process['argv'][0x3]);if(!_0x4881ea[_0x9f72('0x78')]){throw new Error(_0x9f72('0x79'));}if(!_0x4881ea['binding'][_0x9f72('0xe')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x4881ea['binding']['firstName']){throw new Error(_0x9f72('0x7a'));}var _0x47d162=0x0;if(_0x4881ea['binding'][_0x9f72('0x1f')]){_0x47d162=0x1;}if(!_0x4881ea[_0x9f72('0x2e')]){throw new Error(_0x9f72('0x7b'));}}catch(_0x4ddcd8){throw new Error(_0x9f72('0x7c'));}var _0x53c041=[];try{_0x53c041=_['map'](JSON['parse'](process[_0x9f72('0x73')][0x4]),'id');}catch(_0xed27a9){logger[_0x9f72('0x39')](_0x9f72('0x7d'));}main(_0x319e9e,_0x4881ea,_0x53c041,_0x47d162);}validate();process['on'](_0x9f72('0x7e'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x27e1=['catch','error','main','send','start','binding','server/files/tmp','.csv','header','createReadStream','data','rows','errors','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','duplicates','length','cm_contacts_','CREATE\x20TABLE\x20',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','squel','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','.id\x20=\x20','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','fields','field','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','message','exit','push','query','spread'];(function(_0x4d1377,_0x649ff9){var _0x7a5212=function(_0x3e8b0b){while(--_0x3e8b0b){_0x4d1377['push'](_0x4d1377['shift']());}};_0x7a5212(++_0x649ff9);}(_0x27e1,0x137));var _0x127e=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x27e1[_0x47b15f];return _0x55bf25;};'use strict';var fs=require('fs');var path=require(_0x127e('0x0'));var _=require(_0x127e('0x1'));var Papa=require(_0x127e('0x2'));var util=require(_0x127e('0x3'));var BPromise=require(_0x127e('0x4'));var moment=require('moment');var squel=require(_0x127e('0x5'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x127e('0x6'));config[_0x127e('0x7')]=_[_0x127e('0x8')](config[_0x127e('0x7')],{'host':_0x127e('0x9'),'port':0x18eb});var socket=require(_0x127e('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x127e('0xb'));function isEmail(_0x275012){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x275012);}function selectNotIn(_0xa9ea01,_0x51b9ea,_0x41f34f,_0xdacb47,_0x34f90b){return squel[_0x127e('0xc')]()['field'](_0x127e('0xd'))[_0x127e('0xe')](_0xdacb47)[_0x127e('0xf')](_0x51b9ea,null,_0x51b9ea+_0x127e('0x10')+_0xdacb47+'.'+_0x41f34f)['where'](_0xdacb47+'.'+_0x41f34f+_0x127e('0x11')+_0xa9ea01+'.'+_0x41f34f)['where'](_0x51b9ea+'.dialCheckDuplicateType\x20IN\x20('+_0x34f90b[_0x127e('0xf')]()+')');}function insertCmHopper(_0x1faf8d,_0x5dabac,_0x38a05b,_0x3dc215,_0x4acf8d){var _0x745e2=[_0x127e('0x12'),_0x127e('0x13'),_0x127e('0x14'),_0x127e('0x15'),_0x5dabac+'.'+_0x3dc215,_0x127e('0x16'),_0x127e('0x17'),'cm_contacts.priority',_0x127e('0x18'),'\x22'+_0x4acf8d+'\x22'];return squel[_0x127e('0x19')]()[_0x127e('0x1a')](_0x127e('0x1b'))[_0x127e('0x1c')]([_0x127e('0xd'),_0x127e('0x1d'),_0x127e('0x1e'),'ListId',_0x3dc215,_0x127e('0x1f'),_0x127e('0x20'),_0x127e('0x21'),_0x127e('0x22'),'recallme'],squel[_0x127e('0xc')]()['fields'](_0x745e2)[_0x127e('0xe')](_0x5dabac)[_0x127e('0xf')](_0x127e('0x23'),null,_0x127e('0x24')+_0x5dabac+_0x127e('0x25'))[_0x127e('0xf')](_0x38a05b,null,_0x38a05b+_0x127e('0x10')+_0x5dabac+'.'+_0x3dc215)[_0x127e('0x26')](_0x5dabac+_0x127e('0x27'),_0x1faf8d)[_0x127e('0x26')](_0x127e('0x28'),NOW)[_0x127e('0x26')](_0x127e('0x29'),selectNotIn(_0x5dabac,_0x38a05b,_0x3dc215,_0x127e('0x1b'),[_0x127e('0x2a'),_0x127e('0x2b')]))[_0x127e('0x26')](_0x127e('0x29'),selectNotIn(_0x5dabac,_0x38a05b,_0x3dc215,_0x127e('0x1b'),[_0x127e('0x2a')])))[_0x127e('0x2c')]();}function insertCmHopperBlack(_0xe1cdf7,_0x586ad8,_0x2b8d0c,_0x3e7e45){var _0x540849=['cm_contacts.phone',_0x127e('0x14'),_0x127e('0x15'),_0x586ad8+'.'+_0x3e7e45,_0x127e('0x16'),_0x127e('0x17')];return squel[_0x127e('0x19')]()[_0x127e('0x1a')](_0x127e('0x2d'))[_0x127e('0x1c')](['phone',_0x127e('0x1e'),_0x127e('0x2e'),_0x3e7e45,_0x127e('0x1f'),_0x127e('0x20')],squel['select']()[_0x127e('0x2f')](_0x540849)['from'](_0x586ad8)['join'](_0x127e('0x23'),null,_0x127e('0x24')+_0x586ad8+'.CmListId')['join'](_0x2b8d0c,null,_0x2b8d0c+_0x127e('0x10')+_0x586ad8+'.'+_0x3e7e45)['where'](_0x586ad8+'.CmListId\x20=\x20?',_0xe1cdf7)['where'](_0x127e('0x28'),NOW)['where'](_0x127e('0x29'),squel[_0x127e('0xc')]()[_0x127e('0x30')](_0x127e('0xd'))[_0x127e('0xe')]('cm_hopper_black')[_0x127e('0x26')](_0x127e('0x31'),_0xe1cdf7)[_0x127e('0x26')](_0x3e7e45+_0x127e('0x32'),_0x586ad8+'.'+_0x3e7e45)))['toString']();}function insertCmContact(_0x557ae2,_0x749ac4,_0x2db5fe,_0x4747d7){var _0x3489ce=_[_0x127e('0x33')](_['keys'](_0x4747d7),['ListId',_0x127e('0x34'),'createdAt',_0x127e('0x20')]);return squel[_0x127e('0x19')]()['into'](_0x127e('0x23'))['fromQuery'](_0x3489ce,squel[_0x127e('0xc')]()['fields'](_0x3489ce)[_0x127e('0xe')](_0x749ac4)[_0x127e('0x26')]('('+_0x2db5fe[_0x127e('0xf')](',')+_0x127e('0x35'),squel[_0x127e('0xc')]()[_0x127e('0x2f')](_0x2db5fe)[_0x127e('0xe')](_0x127e('0x23'))[_0x127e('0x26')](_0x127e('0x31'),_0x557ae2)[_0x127e('0x26')]('deletedAt\x20IS\x20NULL'))[_0x127e('0x26')](_0x127e('0x36'),squel['select']()[_0x127e('0x30')](_0x127e('0x37'),'min_id')[_0x127e('0xe')](_0x749ac4)[_0x127e('0x38')](_0x2db5fe[_0x127e('0xf')](','))))['toString']();}function handleStop(){logger[_0x127e('0x39')](_0x127e('0x3a'));stopped=!![];}function handleUncaughtException(_0x1d7adc){logger['error'](_0x1d7adc[_0x127e('0x3b')]);process[_0x127e('0x3c')](0x1);}function handleError(_0x5d2e64,_0x588c71){stats['errors'][_0x127e('0x3d')]({'name':_0x588c71['code'],'message':_0x588c71['message'],'row':_0x5d2e64});}function handleQuery(_0x2474cc){logger[_0x127e('0x39')](_0x2474cc);return db['sequelize'][_0x127e('0x3e')](_0x2474cc)[_0x127e('0x3f')](function(_0x1524df){results[_0x127e('0x3d')](_0x1524df);})[_0x127e('0x40')](function(_0x1c735d){logger[_0x127e('0x41')](_0x1c735d['message']);});}function main(_0x4f0664,_0x15ff26,_0x9ac7a,_0x4931ed){logger[_0x127e('0x39')](_0x127e('0x42'),_0x4f0664,JSON['stringify'](_0x15ff26));process[_0x127e('0x43')](_0x127e('0x44'));var _0x1e42aa=_0x15ff26[_0x127e('0x45')];var _0x69826b=_0x15ff26['socket_timestamp'];var _0x328019=path[_0x127e('0xf')](config['root'],_0x127e('0x46'),_0x69826b+_0x127e('0x47'));var _0x157daa=_['keys'](_0x1e42aa)['join']();logger[_0x127e('0x39')](_0x127e('0x48'),_0x157daa);fs['writeFileSync'](_0x328019,_0x157daa+'\x0a');Papa['parse'](fs[_0x127e('0x49')](_0x4f0664),{'header':!![],'skipEmptyLines':!![],'step':function(_0x321441,_0x5e4e00){try{for(var _0x68b3a=0x0,_0x464e9c=[];_0x68b3a<_0x321441[_0x127e('0x4a')]['length'];_0x68b3a++){stats[_0x127e('0x4b')]+=0x1;if(_0x321441[_0x127e('0x4c')][_0x68b3a]){handleError(_0x321441['data'][_0x68b3a],_0x321441[_0x127e('0x4c')][_0x68b3a]);}else{var _0x1a01cf=[];for(var _0x403309 in _0x1e42aa){if(_0x1e42aa[_0x127e('0x4d')](_0x403309)){if(_0x321441[_0x127e('0x4a')][_0x68b3a][_0x1e42aa[_0x403309]]){var _0x5ceca6=_[_0x127e('0x4e')](_0x321441[_0x127e('0x4a')][_0x68b3a][_0x1e42aa[_0x403309]][_0x127e('0x4f')](/"/g,'\x27'));switch(_0x403309){case _0x127e('0x1d'):var _0x2591b8=moment(_0x5ceca6,_0x127e('0xb'),!![]);if(_0x2591b8[_0x127e('0x50')]()){_0x464e9c[_0x127e('0x3d')]('\x22'+_0x5ceca6+'\x22');}else{_0x1a01cf[_0x127e('0x3d')](_0x127e('0x51'));}break;case _0x127e('0x21'):var _0x2278c5=parseInt(_0x5ceca6);_0x5ceca6=_[_0x127e('0x52')](_0x2278c5)||_0x2278c5<0x0||_0x2278c5>0x4?_0x4931ed?0x3:0x2:_0x2278c5;_0x464e9c['push']('\x22'+_0x5ceca6+'\x22');break;case _0x127e('0x22'):var _0x331d44=parseInt(_0x5ceca6);if(_[_0x127e('0x53')](_0x331d44)&&_[_0x127e('0x54')](_0x9ac7a,_0x331d44)){_0x464e9c['push']('\x22'+_0x331d44+'\x22');}else{_0x1a01cf[_0x127e('0x3d')](_0x127e('0x55'));}break;case'email':if(isEmail(_0x5ceca6)){_0x464e9c['push']('\x22'+_0x5ceca6+'\x22');}else{_0x1a01cf['push'](_0x127e('0x56'));}break;case _0x127e('0x57'):var _0xd13df2=moment(_0x5ceca6,'YYYY-MM-DD',!![]);if(_0xd13df2[_0x127e('0x50')]()){_0x464e9c[_0x127e('0x3d')]('\x22'+_0x5ceca6+'\x22');}else{_0x1a01cf[_0x127e('0x3d')](_0x127e('0x58'));}break;default:_0x464e9c[_0x127e('0x3d')]('\x22'+_0x5ceca6+'\x22');}}else{switch(_0x403309){case _0x127e('0x59'):case'phone':_0x1a01cf[_0x127e('0x3d')](_0x403309+_0x127e('0x5a'));break;default:_0x464e9c['push']('\x22\x22');}}}}if(_0x1a01cf['length']){handleError(_0x321441['data'][_0x68b3a],{'code':_0x127e('0x5b'),'message':_0x1a01cf[_0x127e('0xf')]()});}else{fs[_0x127e('0x5c')](_0x328019,_0x464e9c[_0x127e('0xf')]()+'\x0a');}_0x464e9c=[];}if(!(stats['rows']%0xc8)){socket[_0x127e('0x5d')]('contact:import:'+_0x69826b,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x127e('0x5e'));_0x5e4e00[_0x127e('0x5f')]();}}catch(_0x151135){handleError(_0x321441['data'][_0x68b3a],{'code':_0x127e('0x60'),'message':_0x151135['message']});logger[_0x127e('0x41')]('step',_0x151135[_0x127e('0x3b')]);}},'complete':function(){try{var _0x3efce8=[];var _0x3d953f=_0x127e('0x23');if(_0x15ff26[_0x127e('0x61')]&&_0x15ff26['duplicates'][_0x127e('0x62')]){_0x3d953f=_0x127e('0x63')+_0x69826b;_0x3efce8[_0x127e('0x3d')](_0x127e('0x64')+_0x3d953f+'\x20LIKE\x20cm_contacts;');}var _0x23c18a=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x328019,_0x3d953f,_0x157daa,_0x15ff26['ListId'],_0x15ff26[_0x127e('0x34')]||null,NOW,NOW);if(_['isNil'](_0x1e42aa[_0x127e('0x1d')])){_0x23c18a+=_0x127e('0x65');}_0x3efce8[_0x127e('0x3d')](_0x23c18a);if(_0x15ff26[_0x127e('0x61')]&&_0x15ff26[_0x127e('0x61')][_0x127e('0x62')]){_0x3efce8[_0x127e('0x3d')](insertCmContact(_0x15ff26['ListId'],_0x3d953f,_0x15ff26[_0x127e('0x61')],_0x1e42aa));_0x3efce8['push'](_0x127e('0x66')+_0x3d953f+';');}_0x3efce8[_0x127e('0x3d')](insertCmHopper(_0x15ff26['ListId'],'voice_queues_has_cm_lists','voice_queues',_0x127e('0x67'),_0x4931ed));_0x3efce8[_0x127e('0x3d')](insertCmHopperBlack(_0x15ff26[_0x127e('0x2e')],_0x127e('0x68'),_0x127e('0x69'),_0x127e('0x67')));_0x3efce8[_0x127e('0x3d')](insertCmHopper(_0x15ff26['ListId'],_0x127e('0x6a'),_0x127e('0x6b'),'CampaignId',_0x4931ed));_0x3efce8[_0x127e('0x3d')](insertCmHopperBlack(_0x15ff26[_0x127e('0x2e')],_0x127e('0x6c'),_0x127e('0x6b'),_0x127e('0x6d')));BPromise[_0x127e('0x6e')](_0x3efce8,handleQuery)[_0x127e('0x6f')](function(_0x3d5139){stats[_0x127e('0x70')]=!![];stats[_0x127e('0x71')]=_0x15ff26['duplicates']&&_0x15ff26[_0x127e('0x61')]['length']?results[0x2][_0x127e('0x71')]:results[0x0]['affectedRows'];socket[_0x127e('0x5d')]('contact:import:'+_0x69826b,stats);fs[_0x127e('0x72')](_0x4f0664);fs['unlink'](_0x328019);process[_0x127e('0x3c')](0x0);})[_0x127e('0x40')](function(_0x5210a9){logger[_0x127e('0x41')](_0x5210a9[_0x127e('0x3b')]);process[_0x127e('0x3c')](0x1);});}catch(_0x1b341c){logger[_0x127e('0x41')]('complete',_0x1b341c['message']);process[_0x127e('0x3c')](0x1);}},'error':function(_0xb4e098,_0x281f11,_0x28646b,_0x39a429){throw new Error(_0x39a429);}});}function validate(){if(process[_0x127e('0x73')]&&process[_0x127e('0x73')]['length']<0x4){throw new Error(_0x127e('0x74'));}var _0x1701d0=path[_0x127e('0xf')](config[_0x127e('0x75')],_0x127e('0x46'),process['argv'][0x2]);if(!fs[_0x127e('0x76')](_0x1701d0)){throw new Error(_0x127e('0x77'));}var _0xe2d1ae={};try{_0xe2d1ae=JSON[_0x127e('0x78')](process[_0x127e('0x73')][0x3]);if(!_0xe2d1ae[_0x127e('0x45')]){throw new Error(_0x127e('0x79'));}if(!_0xe2d1ae[_0x127e('0x45')][_0x127e('0xd')]){throw new Error('phone\x20is\x20mandatory');}if(!_0xe2d1ae[_0x127e('0x45')][_0x127e('0x59')]){throw new Error(_0x127e('0x7a'));}var _0x556812=0x0;if(_0xe2d1ae[_0x127e('0x45')][_0x127e('0x22')]){_0x556812=0x1;}if(!_0xe2d1ae['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x43563f){throw new Error('body\x20id\x20mandatory');}var _0x146f5e=[];try{_0x146f5e=_[_0x127e('0x7b')](JSON[_0x127e('0x78')](process[_0x127e('0x73')][0x4]),'id');}catch(_0x1fb5e2){logger[_0x127e('0x39')](_0x127e('0x7c'));}main(_0x1701d0,_0xe2d1ae,_0x146f5e,_0x556812);}validate();process['on']('SIGINT',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 b63b45b..7587bfa 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 _0xf264=['answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','Agent\x20Name','destcalleridname','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Member\x20Name','membername','starttime','Answer\x20Time'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf264,0x115));var _0x4f26=function(_0x2948d7,_0x1a9438){_0x2948d7=_0x2948d7-0x0;var _0x476117=_0xf264[_0x2948d7];return _0x476117;};'use strict';exports[_0x4f26('0x0')]=function(_0x1c897d,_0x57df83){var _0x20fe02=[{'type':_0x4f26('0x1'),'content':_0x4f26('0x2'),'variableName':null}];switch(_0x1c897d['toLowerCase']()){case _0x4f26('0x3'):switch(_0x57df83[_0x4f26('0x4')]()){case'inbound':_0x20fe02[_0x4f26('0x5')]({'type':_0x4f26('0x6'),'content':'','variableName':_0x4f26('0x7')});_0x20fe02[_0x4f26('0x5')]({'type':_0x4f26('0x6'),'content':'','variableName':_0x4f26('0x8')});break;case _0x4f26('0x9'):_0x20fe02[_0x4f26('0x5')]({'type':_0x4f26('0x1'),'content':_0x4f26('0xa'),'variableName':null});_0x20fe02['push']({'type':_0x4f26('0x6'),'content':'','variableName':_0x4f26('0xb')});break;}}return _0x20fe02;};exports[_0x4f26('0xc')]=function(_0x566575,_0x32abf3){var _0x29cf94=[];switch(_0x566575['toLowerCase']()){case _0x4f26('0x3'):switch(_0x32abf3[_0x4f26('0x4')]()){case _0x4f26('0xd'):_0x29cf94=[{'type':_0x4f26('0x1'),'content':_0x4f26('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x10'),'keyType':'variable','variableName':_0x4f26('0x8')},{'type':_0x4f26('0xf'),'content':'','key':'Caller\x20Name','keyType':_0x4f26('0x6'),'variableName':_0x4f26('0x11')},{'type':'keyValue','content':'','key':_0x4f26('0x12'),'keyType':_0x4f26('0x6'),'variableName':_0x4f26('0x13')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x14'),'keyType':'variable','variableName':_0x4f26('0x7')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x15'),'keyType':'variable','variableName':_0x4f26('0x16')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x17'),'keyType':_0x4f26('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4f26('0x18'),'keyType':_0x4f26('0x6'),'variableName':_0x4f26('0x19')},{'type':_0x4f26('0xf'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0x4f26('0xb')},{'type':_0x4f26('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4f26('0x1a'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x1b'),'keyType':'variable','variableName':_0x4f26('0x1c')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x1d'),'keyType':_0x4f26('0x6'),'variableName':_0x4f26('0x1e')},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x4f26('0x1f')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x20'),'keyType':'variable','variableName':_0x4f26('0x21')}];break;case _0x4f26('0x9'):_0x29cf94=[{'type':_0x4f26('0x1'),'content':_0x4f26('0xe'),'variableName':null},{'type':_0x4f26('0xf'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x22'),'keyType':_0x4f26('0x6'),'keyContent':'','variableName':_0x4f26('0x23')},{'type':_0x4f26('0xf'),'content':'','key':'UniqueId','keyType':_0x4f26('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x17'),'keyType':'variable','keyContent':'','variableName':_0x4f26('0x24')},{'type':_0x4f26('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x25'),'keyType':_0x4f26('0x6'),'keyContent':'','variableName':_0x4f26('0x26')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x27'),'keyType':_0x4f26('0x6'),'keyContent':'','variableName':_0x4f26('0x28')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x29'),'keyType':_0x4f26('0x6'),'keyContent':'','variableName':_0x4f26('0x2a')},{'type':_0x4f26('0xf'),'content':'','key':_0x4f26('0x2b'),'keyType':_0x4f26('0x6'),'keyContent':'','variableName':_0x4f26('0x2c')}];break;}}return _0x29cf94;}; \ No newline at end of file +var _0xd991=['destcalleridname','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','holdtime','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***'];(function(_0x1534d1,_0x2de47d){var _0x297e4c=function(_0x5f1e2f){while(--_0x5f1e2f){_0x1534d1['push'](_0x1534d1['shift']());}};_0x297e4c(++_0x2de47d);}(_0xd991,0x140));var _0x1d99=function(_0x2787be,_0x42af16){_0x2787be=_0x2787be-0x0;var _0x4d72cc=_0xd991[_0x2787be];return _0x4d72cc;};'use strict';exports['getSubjects']=function(_0x3f4fb8,_0x282f3e){var _0x40d226=[{'type':'string','content':_0x1d99('0x0'),'variableName':null}];switch(_0x3f4fb8[_0x1d99('0x1')]()){case _0x1d99('0x2'):switch(_0x282f3e[_0x1d99('0x1')]()){case'inbound':_0x40d226[_0x1d99('0x3')]({'type':_0x1d99('0x4'),'content':'','variableName':_0x1d99('0x5')});_0x40d226[_0x1d99('0x3')]({'type':_0x1d99('0x4'),'content':'','variableName':_0x1d99('0x6')});break;case _0x1d99('0x7'):_0x40d226['push']({'type':_0x1d99('0x8'),'content':_0x1d99('0x9'),'variableName':null});_0x40d226[_0x1d99('0x3')]({'type':_0x1d99('0x4'),'content':'','variableName':_0x1d99('0xa')});break;}}return _0x40d226;};exports[_0x1d99('0xb')]=function(_0x5c3602,_0x1d39b8){var _0x508d5e=[];switch(_0x5c3602[_0x1d99('0x1')]()){case _0x1d99('0x2'):switch(_0x1d39b8[_0x1d99('0x1')]()){case _0x1d99('0xc'):_0x508d5e=[{'type':'string','content':_0x1d99('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0xf'),'keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x6')},{'type':_0x1d99('0xe'),'content':'','key':'Caller\x20Name','keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x10')},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x11'),'keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x12')},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x13'),'keyType':'variable','variableName':_0x1d99('0x5')},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x14'),'keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x15')},{'type':'keyValue','content':'','key':'Date','keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x16')},{'type':_0x1d99('0x8'),'content':_0x1d99('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x1d99('0xe'),'content':'','key':'Agent\x20Name','keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x18')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x1d99('0x4'),'variableName':'destcalleridnum'},{'type':_0x1d99('0x8'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x19'),'keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x16')},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x1a'),'keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x1b')},{'type':_0x1d99('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x1d99('0x4'),'variableName':_0x1d99('0x1c')},{'type':_0x1d99('0xe'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x1d99('0x1d')},{'type':_0x1d99('0xe'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x1d99('0x1e')}];break;case _0x1d99('0x7'):_0x508d5e=[{'type':_0x1d99('0x8'),'content':_0x1d99('0xd'),'variableName':null},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x1f'),'keyType':_0x1d99('0x4'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x20'),'keyType':'variable','keyContent':'','variableName':_0x1d99('0x21')},{'type':'keyValue','content':'','key':_0x1d99('0x14'),'keyType':_0x1d99('0x4'),'keyContent':'','variableName':_0x1d99('0x15')},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x22'),'keyType':_0x1d99('0x4'),'keyContent':'','variableName':_0x1d99('0x23')},{'type':'string','content':_0x1d99('0x24')},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x25'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x26'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0x1d99('0xe'),'content':'','key':_0x1d99('0x27'),'keyType':_0x1d99('0x4'),'keyContent':'','variableName':_0x1d99('0x28')},{'type':'keyValue','content':'','key':_0x1d99('0x29'),'keyType':_0x1d99('0x4'),'keyContent':'','variableName':_0x1d99('0x2a')}];break;}}return _0x508d5e;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 09e34ea..f7b96a5 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 _0x1f6a=['error','tracked','query','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f6a,0x12b));var _0xa1f6=function(_0x5c9274,_0x4e849b){_0x5c9274=_0x5c9274-0x0;var _0x1ef7d3=_0x1f6a[_0x5c9274];return _0x1ef7d3;};'use strict';var _=require(_0xa1f6('0x0'));var db=require(_0xa1f6('0x1'))['db'];var loggers={'openchannel':require(_0xa1f6('0x2'))('openchannel-interactions'),'mail':require(_0xa1f6('0x2'))(_0xa1f6('0x3')),'fax':require('../../config/logger')(_0xa1f6('0x4')),'sms':require(_0xa1f6('0x2'))(_0xa1f6('0x5')),'chat':require(_0xa1f6('0x2'))(_0xa1f6('0x6')),'whatsapp':require(_0xa1f6('0x2'))(_0xa1f6('0x7'))};function getInteractionId(_0x261c4d,_0x2af373,_0xcdfcf1){if(_0x261c4d&&_0x261c4d[_['upperFirst'](_0xcdfcf1)+'InteractionId']){return _0x261c4d[_[_0xa1f6('0x8')](_0xcdfcf1)+'InteractionId'];}else if(_0x261c4d&&_0x261c4d['id']){return _0x261c4d['id'];}else if(_0x2af373&&_0x2af373['id']){return _0x2af373['id'];}else{return _0xa1f6('0x9');}}function log(_0x20a50f,_0x1e6490,_0x184485,_0x2819b5,_0xd1ff8d,_0x8a338e){loggers[_0xd1ff8d[_0xa1f6('0xa')]()][_0x20a50f](_0xa1f6('0xb'),_0x8a338e['toUpperCase'](),_0x1e6490?_0x1e6490['id']:null,_0x1e6490?_0x1e6490[_0xa1f6('0xc')]:null,_0x1e6490?_0x1e6490[_0xa1f6('0xd')]:null,getInteractionId(_0x184485,_0x2819b5,_0xd1ff8d),_0x184485?JSON[_0xa1f6('0xe')](_0x184485):_0xa1f6('0xf'));}function updateUser(_0x5d2d0a,_0xbfa47d,_0x13eb72,_0x515c78,_0x5ac806){db[_[_0xa1f6('0x8')](_0x515c78)+_0xa1f6('0x10')][_0xa1f6('0x11')]({'where':{'id':getInteractionId(_0xbfa47d,_0x13eb72,_0x515c78)}})[_0xa1f6('0x12')](function(_0x30165c){if(_0x30165c){return _0x30165c[_0xa1f6('0x13')]({'UserId':_0x5d2d0a?_0x5d2d0a['id']:null});}})[_0xa1f6('0x12')](function(_0x1e43ee){if(_0x1e43ee){log('info',_0x5d2d0a,_0xbfa47d,_0x13eb72,_0x515c78,_0x5ac806);}})['catch'](function(){log(_0xa1f6('0x14'),_0x5d2d0a,_0xbfa47d,_0x13eb72,_0x515c78,_0x5ac806);});}exports[_0xa1f6('0x15')]=function(_0x5b66b7,_0x1ed028){return function(_0x49105a,_0x522096,_0x1f57d5){var _0x2fd897=_0x49105a['user'];var _0xe63294={};var _0x2081ac=_0x49105a[_0xa1f6('0x16')];if(_0xe63294){_0xe63294=_['clone'](_0x49105a[_0xa1f6('0x17')]);_0xe63294=_[_0xa1f6('0x18')](_0xe63294,[_0xa1f6('0x17'),_0xa1f6('0x19'),_0xa1f6('0x1a'),_0xa1f6('0x1b'),_0xa1f6('0x1c')]);}updateUser(_0x2fd897,_0xe63294,_0x2081ac,_0x5b66b7,_0x1ed028);_0x1f57d5(null);};}; \ No newline at end of file +var _0x42ba=['user','query','clone','omit','body','html','phone','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','upperFirst','Interaction','findOne','then','update','tracked'];(function(_0x51ce0f,_0x3a0c05){var _0x2326a3=function(_0x2bb2ed){while(--_0x2bb2ed){_0x51ce0f['push'](_0x51ce0f['shift']());}};_0x2326a3(++_0x3a0c05);}(_0x42ba,0x1b8));var _0xa42b=function(_0x477603,_0x31ccc1){_0x477603=_0x477603-0x0;var _0x4055df=_0x42ba[_0x477603];return _0x4055df;};'use strict';var _=require(_0xa42b('0x0'));var db=require(_0xa42b('0x1'))['db'];var loggers={'openchannel':require(_0xa42b('0x2'))('openchannel-interactions'),'mail':require(_0xa42b('0x2'))(_0xa42b('0x3')),'fax':require(_0xa42b('0x2'))('fax-interactions'),'sms':require(_0xa42b('0x2'))(_0xa42b('0x4')),'chat':require(_0xa42b('0x2'))('chat-interactions'),'whatsapp':require(_0xa42b('0x2'))('whatsapp-interactions')};function getInteractionId(_0x50fbe0,_0x53e860,_0xc10d0f){if(_0x50fbe0&&_0x50fbe0[_['upperFirst'](_0xc10d0f)+_0xa42b('0x5')]){return _0x50fbe0[_['upperFirst'](_0xc10d0f)+_0xa42b('0x5')];}else if(_0x50fbe0&&_0x50fbe0['id']){return _0x50fbe0['id'];}else if(_0x53e860&&_0x53e860['id']){return _0x53e860['id'];}else{return _0xa42b('0x6');}}function log(_0x581173,_0x471875,_0x5db212,_0x2636e5,_0x1f24bb,_0x41b418){loggers[_0x1f24bb[_0xa42b('0x7')]()][_0x581173](_0xa42b('0x8'),_0x41b418[_0xa42b('0x9')](),_0x471875?_0x471875['id']:null,_0x471875?_0x471875[_0xa42b('0xa')]:null,_0x471875?_0x471875[_0xa42b('0xb')]:null,getInteractionId(_0x5db212,_0x2636e5,_0x1f24bb),_0x5db212?JSON['stringify'](_0x5db212):_0xa42b('0xc'));}function updateUser(_0x169218,_0x269935,_0x3eabf7,_0x4fecd0,_0x12153e){db[_[_0xa42b('0xd')](_0x4fecd0)+_0xa42b('0xe')][_0xa42b('0xf')]({'where':{'id':getInteractionId(_0x269935,_0x3eabf7,_0x4fecd0)}})[_0xa42b('0x10')](function(_0x36745c){if(_0x36745c){return _0x36745c[_0xa42b('0x11')]({'UserId':_0x169218?_0x169218['id']:null});}})['then'](function(_0x427109){if(_0x427109){log('info',_0x169218,_0x269935,_0x3eabf7,_0x4fecd0,_0x12153e);}})['catch'](function(){log('error',_0x169218,_0x269935,_0x3eabf7,_0x4fecd0,_0x12153e);});}exports[_0xa42b('0x12')]=function(_0xa3ce71,_0x4eaa2d){return function(_0x4b9fca,_0x3001be,_0x1c1f2b){var _0x1b17ed=_0x4b9fca[_0xa42b('0x13')];var _0x48a346={};var _0x3a1283=_0x4b9fca[_0xa42b('0x14')];if(_0x48a346){_0x48a346=_[_0xa42b('0x15')](_0x4b9fca['body']);_0x48a346=_[_0xa42b('0x16')](_0x48a346,[_0xa42b('0x17'),_0xa42b('0x18'),_0xa42b('0x19'),'fax',_0xa42b('0x1a')]);}updateUser(_0x1b17ed,_0x48a346,_0x3a1283,_0xa3ce71,_0x4eaa2d);_0x1c1f2b(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 17c3857..68cdeb3 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 _0x491d=['aes-256-ctr','format','base64','utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher'];(function(_0x195654,_0x5b8d18){var _0x11ce84=function(_0x1d3800){while(--_0x1d3800){_0x195654['push'](_0x195654['shift']());}};_0x11ce84(++_0x5b8d18);}(_0x491d,0x9f));var _0xd491=function(_0x23d99b,_0x2b476c){_0x23d99b=_0x23d99b-0x0;var _0x529836=_0x491d[_0x23d99b];return _0x529836;};'use strict';var crypto=require(_0xd491('0x0'));var util=require(_0xd491('0x1'));var compose=require(_0xd491('0x2'));var db=require(_0xd491('0x3'))['db'];var config=require(_0xd491('0x4'));function getValueFromLicense(_0x4b0c3c,_0x538944){if(_0x4b0c3c&&_0x538944){if(_0x538944['data1']&&_0x538944[_0xd491('0x5')]){var _0x5a490c=_0x538944[_0xd491('0x6')];var _0x3d8235=_0x538944[_0xd491('0x5')];var _0x4d14c2=_0x5a490c[_0xd491('0x7')]('-')[0x4];var _0x5d7629=_0x5a490c[_0xd491('0x7')]('-')[0x0];var _0xa66832=crypto[_0xd491('0x8')](_0xd491('0x9'),util[_0xd491('0xa')]('%s:%s:%s',_0x4d14c2,_0x5a490c,_0x5d7629));var _0x5c088e=_0xa66832['update'](_0x3d8235,_0xd491('0xb'),_0xd491('0xc'));_0x5c088e+=_0xa66832[_0xd491('0xd')](_0xd491('0xc'));var _0x48312c=JSON[_0xd491('0xe')](_0x5c088e);return _0x48312c['hasOwnProperty'](_0x4b0c3c)?_0x48312c[_0x4b0c3c]:null;}}return null;}function isLimit(_0xe9dd0e,_0xb54267,_0x16a22f,_0x8e5103){var _0x552e91=_0xb54267;return compose()[_0xd491('0xf')](function(_0x16df86,_0x269a31,_0x6a081){return db[_0xd491('0x10')][_0xd491('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xd491('0x12')](function(_0x472a30){var _0x33e232=getValueFromLicense(_0xe9dd0e,_0x472a30);return _0x33e232?_0x33e232:_0x552e91;})[_0xd491('0x12')](function(_0x59e754){_0x552e91=_0x59e754;return _0x16a22f[_0xd491('0x13')](_0x8e5103);})['then'](function(_0x463f03){if(_0x463f03>=_0x552e91){return _0x269a31[_0xd491('0x14')](0x193)[_0xd491('0x15')]({'message':util['format'](_0xd491('0x16'),_0xe9dd0e)});}_0x6a081();})[_0xd491('0x17')](function(_0x178b6f){_0x6a081(_0x178b6f);});});}function isUserLimit(){return isLimit(_0xd491('0x18'),0x1,db[_0xd491('0x19')],{'where':{'$or':[{'role':_0xd491('0x1a')},{'role':_0xd491('0x1b')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x1f1b=['base64','utf8','parse','hasOwnProperty','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s'];(function(_0x2be677,_0x39f2e7){var _0x3b1125=function(_0x5a413c){while(--_0x5a413c){_0x2be677['push'](_0x2be677['shift']());}};_0x3b1125(++_0x39f2e7);}(_0x1f1b,0x1f1));var _0xb1f1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1f1b[_0x19950b];return _0x3c6b41;};'use strict';var crypto=require('crypto');var util=require(_0xb1f1('0x0'));var compose=require(_0xb1f1('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xb1f1('0x2'));function getValueFromLicense(_0x54195b,_0x4d0299){if(_0x54195b&&_0x4d0299){if(_0x4d0299[_0xb1f1('0x3')]&&_0x4d0299[_0xb1f1('0x4')]){var _0x352a75=_0x4d0299[_0xb1f1('0x3')];var _0x302ea8=_0x4d0299['license'];var _0x123880=_0x352a75[_0xb1f1('0x5')]('-')[0x4];var _0x3ec7de=_0x352a75[_0xb1f1('0x5')]('-')[0x0];var _0x3ed1ec=crypto[_0xb1f1('0x6')]('aes-256-ctr',util[_0xb1f1('0x7')](_0xb1f1('0x8'),_0x123880,_0x352a75,_0x3ec7de));var _0x329068=_0x3ed1ec['update'](_0x302ea8,_0xb1f1('0x9'),_0xb1f1('0xa'));_0x329068+=_0x3ed1ec['final'](_0xb1f1('0xa'));var _0x38ae6c=JSON[_0xb1f1('0xb')](_0x329068);return _0x38ae6c[_0xb1f1('0xc')](_0x54195b)?_0x38ae6c[_0x54195b]:null;}}return null;}function isLimit(_0x210d3b,_0x39b98b,_0xd94d9e,_0x38acd3){var _0x485e5c=_0x39b98b;return compose()['use'](function(_0x1d7953,_0xef480b,_0x8561a3){return db['License'][_0xb1f1('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xb1f1('0xe')](function(_0x3fde10){var _0x391ca9=getValueFromLicense(_0x210d3b,_0x3fde10);return _0x391ca9?_0x391ca9:_0x485e5c;})[_0xb1f1('0xe')](function(_0x1fec02){_0x485e5c=_0x1fec02;return _0xd94d9e[_0xb1f1('0xf')](_0x38acd3);})[_0xb1f1('0xe')](function(_0x43a72c){if(_0x43a72c>=_0x485e5c){return _0xef480b[_0xb1f1('0x10')](0x193)['json']({'message':util[_0xb1f1('0x7')](_0xb1f1('0x11'),_0x210d3b)});}_0x8561a3();})[_0xb1f1('0x12')](function(_0x11847a){_0x8561a3(_0x11847a);});});}function isUserLimit(){return isLimit(_0xb1f1('0x13'),0x1,db[_0xb1f1('0x14')],{'where':{'$or':[{'role':_0xb1f1('0x15')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index e660e1e..6a868eb 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 _0x71af=['seconds','lodash','moment','parseSearch','sqlOperator','startsWith','replace','[$and]','split','slice','forEach','match','filter','indexOf','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','format','hours','minutes'];(function(_0x58ee27,_0x36528c){var _0x35459d=function(_0x7ab8cb){while(--_0x7ab8cb){_0x58ee27['push'](_0x58ee27['shift']());}};_0x35459d(++_0x36528c);}(_0x71af,0x199));var _0xf71a=function(_0x13be1a,_0x32c41d){_0x13be1a=_0x13be1a-0x0;var _0x495ea2=_0x71af[_0x13be1a];return _0x495ea2;};'use strict';var _=require(_0xf71a('0x0'));var moment=require(_0xf71a('0x1'));exports[_0xf71a('0x2')]=function(_0x2ef6e9){var _0x49e426={'conditions':[]};_0x49e426[_0xf71a('0x3')]=_[_0xf71a('0x4')](_0x2ef6e9,'[$or]')?'or':'and';var _0x428b98=_0x2ef6e9[_0xf71a('0x5')](_0xf71a('0x6'),'')[_0xf71a('0x5')]('[$or]','')['split']('||');for(var _0x543fd4=0x0;_0x543fd4<_0x428b98['length'];_0x543fd4++){var _0xab1d9c=_0x428b98[_0x543fd4][_0xf71a('0x7')](':=');var _0x356dd7=_0xab1d9c[0x0];var _0x1ab832=_0xab1d9c[_0xf71a('0x8')](0x1);_0x1ab832[_0xf71a('0x9')](function(_0x542376){var _0x5e61a3=_0x542376[_0xf71a('0x7')]('[')['shift']();var _0x273d01=_0x542376[_0xf71a('0xa')](/\[(.*?)\]/g);_0x273d01['forEach'](function(_0x18b80b){var _0x212fdd=_0x18b80b[_0xf71a('0x7')]('[')[_0xf71a('0xb')](function(_0x16346f){return _0x16346f[_0xf71a('0xc')](']')>-0x1;})['map'](function(_0x400119){return _0x400119[_0xf71a('0x7')](']')[0x0];})[0x0];_0x49e426['conditions']['push']({'field':_0x356dd7,'operator':_0x5e61a3,'value':_0x212fdd});});});}return _0x49e426;};exports['buildExpression']=function(_0x53bc4f,_0x22dd9f,_0xb43fde){var _0x354522={};if(_0x22dd9f===_0xf71a('0xd')){if(_0xb43fde[_0xf71a('0xe')]===_0xf71a('0xf')){_0xb43fde[_0xf71a('0xe')]=_0xf71a('0x10');_0xb43fde[_0xf71a('0x11')]+=','+_0xb43fde['value'];}else if(_[_0xf71a('0x12')]([_0xf71a('0x13'),_0xf71a('0x14')],_0xb43fde[_0xf71a('0xe')])){_0xb43fde['value']=moment(_0xb43fde[_0xf71a('0x11')])[_0xf71a('0x15')](0x1,_0xf71a('0x16'))['format'](_0xf71a('0x17'));}}if(_0xb43fde[_0xf71a('0x18')]){_0x22dd9f=_0xb43fde[_0xf71a('0x18')];_0x354522[_0xf71a('0x19')]=_0xf71a('0x1a')+_0x53bc4f+'.'+_0xb43fde[_0xf71a('0x1b')]+'\x20AS\x20'+_0xb43fde['castTo']+')\x20'+parseOperator(_0xb43fde[_0xf71a('0xe')]);}else{_0x354522[_0xf71a('0x19')]=_0x53bc4f+'.'+_0xb43fde[_0xf71a('0x1b')]+'\x20'+parseOperator(_0xb43fde[_0xf71a('0xe')]);}if(_[_0xf71a('0x12')]([_0xf71a('0x1c'),_0xf71a('0x1d')],_0xb43fde[_0xf71a('0xe')]))_0x354522[_0xf71a('0x19')]='('+_0x354522['text']+_0xf71a('0x1e')+_0x53bc4f+'.'+_0xb43fde[_0xf71a('0x1b')]+_0xf71a('0x1f');_0x354522[_0xf71a('0x11')]=parseValue(_0x22dd9f,_0xb43fde[_0xf71a('0xe')],_0xb43fde[_0xf71a('0x11')]);return _0x354522;};function parseOperator(_0x4784c9){var _0x4d6eac;switch(_0x4784c9){case'$in':_0x4d6eac='IN\x20?';break;case _0xf71a('0x1d'):_0x4d6eac=_0xf71a('0x20');break;case _0xf71a('0xf'):_0x4d6eac=_0xf71a('0x21');break;case _0xf71a('0x1c'):_0x4d6eac=_0xf71a('0x22');break;case _0xf71a('0x23'):case _0xf71a('0x24'):case _0xf71a('0x25'):_0x4d6eac=_0xf71a('0x26');break;case _0xf71a('0x27'):_0x4d6eac=_0xf71a('0x28');break;case _0xf71a('0x13'):_0x4d6eac=_0xf71a('0x29');break;case _0xf71a('0x14'):_0x4d6eac='<=\x20?';break;case _0xf71a('0x2a'):_0x4d6eac='>=\x20?';break;case _0xf71a('0x10'):_0x4d6eac=_0xf71a('0x2b');break;}return _0x4d6eac;}function parseValue(_0x38335d,_0x4dcf85,_0x271fc7){var _0x22656f={'start':undefined,'end':undefined};switch(_0x4dcf85){case'$in':case _0xf71a('0x1d'):_0x22656f[_0xf71a('0x2c')]=_0x271fc7[_0xf71a('0x7')](',');break;case _0xf71a('0x23'):_0x22656f[_0xf71a('0x2c')]='%'+_0x271fc7+'%';break;case _0xf71a('0x24'):_0x22656f['start']=_0x271fc7+'%';break;case _0xf71a('0x25'):_0x22656f['start']='%'+_0x271fc7;break;case _0xf71a('0x10'):var _0x49767b=_0x271fc7['split'](',');var _0x271fc7=_0x49767b[_0xf71a('0x2d')]();var _0x423b66=_0x49767b['pop']();if(_0x38335d===_0xf71a('0xd')){_0x271fc7=moment(_0x271fc7)[_0xf71a('0x2e')](0x0,!![])[_0xf71a('0x2f')]();_0x423b66=moment(_0x423b66)[_0xf71a('0x2e')](0x0,!![])['add'](0x17,_0xf71a('0x30'))[_0xf71a('0x15')](0x3b,_0xf71a('0x31'))[_0xf71a('0x15')](0x3b,_0xf71a('0x32'))[_0xf71a('0x2f')]();}_0x22656f={'start':_0x271fc7,'end':_0x423b66};break;default:_0x22656f['start']=_0x271fc7;break;}return _0x22656f;} \ No newline at end of file +var _0x75c8=['field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$substring','$startsWith','$endsWith','minutes','seconds','parseSearch','sqlOperator','startsWith','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST('];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x75c8,0xbf));var _0x875c=function(_0x3775b6,_0x11146d){_0x3775b6=_0x3775b6-0x0;var _0x5ccdbd=_0x75c8[_0x3775b6];return _0x5ccdbd;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x875c('0x0')]=function(_0x37be7a){var _0x564378={'conditions':[]};_0x564378[_0x875c('0x1')]=_[_0x875c('0x2')](_0x37be7a,'[$or]')?'or':_0x875c('0x3');var _0x3991d6=_0x37be7a[_0x875c('0x4')](_0x875c('0x5'),'')[_0x875c('0x4')]('[$or]','')[_0x875c('0x6')]('||');for(var _0x44bb2c=0x0;_0x44bb2c<_0x3991d6[_0x875c('0x7')];_0x44bb2c++){var _0x19ec40=_0x3991d6[_0x44bb2c][_0x875c('0x6')](':=');var _0x41e255=_0x19ec40[0x0];var _0x14f8e2=_0x19ec40[_0x875c('0x8')](0x1);_0x14f8e2[_0x875c('0x9')](function(_0x1a0808){var _0x10d960=_0x1a0808[_0x875c('0x6')]('[')[_0x875c('0xa')]();var _0x4e099b=_0x1a0808[_0x875c('0xb')](/\[(.*?)\]/g);_0x4e099b[_0x875c('0x9')](function(_0x1f4170){var _0x331b4f=_0x1f4170['split']('[')[_0x875c('0xc')](function(_0x5b82d8){return _0x5b82d8[_0x875c('0xd')](']')>-0x1;})[_0x875c('0xe')](function(_0x1013ed){return _0x1013ed[_0x875c('0x6')](']')[0x0];})[0x0];_0x564378[_0x875c('0xf')][_0x875c('0x10')]({'field':_0x41e255,'operator':_0x10d960,'value':_0x331b4f});});});}return _0x564378;};exports[_0x875c('0x11')]=function(_0x338a53,_0x25d9e8,_0x37b15e){var _0x51c9f5={};if(_0x25d9e8===_0x875c('0x12')){if(_0x37b15e[_0x875c('0x13')]==='$eq'){_0x37b15e['operator']='$between';_0x37b15e['value']+=','+_0x37b15e[_0x875c('0x14')];}else if(_['includes'](['$gt',_0x875c('0x15')],_0x37b15e[_0x875c('0x13')])){_0x37b15e['value']=moment(_0x37b15e['value'])[_0x875c('0x16')](0x1,_0x875c('0x17'))[_0x875c('0x18')](_0x875c('0x19'));}}if(_0x37b15e[_0x875c('0x1a')]){_0x25d9e8=_0x37b15e[_0x875c('0x1a')];_0x51c9f5[_0x875c('0x1b')]=_0x875c('0x1c')+_0x338a53+'.'+_0x37b15e[_0x875c('0x1d')]+'\x20AS\x20'+_0x37b15e[_0x875c('0x1a')]+')\x20'+parseOperator(_0x37b15e['operator']);}else{_0x51c9f5['text']=_0x338a53+'.'+_0x37b15e['field']+'\x20'+parseOperator(_0x37b15e[_0x875c('0x13')]);}if(_['includes']([_0x875c('0x1e'),_0x875c('0x1f')],_0x37b15e[_0x875c('0x13')]))_0x51c9f5[_0x875c('0x1b')]='('+_0x51c9f5[_0x875c('0x1b')]+_0x875c('0x20')+_0x338a53+'.'+_0x37b15e[_0x875c('0x1d')]+_0x875c('0x21');_0x51c9f5[_0x875c('0x14')]=parseValue(_0x25d9e8,_0x37b15e[_0x875c('0x13')],_0x37b15e['value']);return _0x51c9f5;};function parseOperator(_0x237ecb){var _0x555ca8;switch(_0x237ecb){case _0x875c('0x22'):_0x555ca8=_0x875c('0x23');break;case'$notIn':_0x555ca8=_0x875c('0x24');break;case _0x875c('0x25'):_0x555ca8=_0x875c('0x26');break;case'$ne':_0x555ca8=_0x875c('0x27');break;case'$substring':case'$startsWith':case'$endsWith':_0x555ca8=_0x875c('0x28');break;case _0x875c('0x29'):_0x555ca8=_0x875c('0x2a');break;case _0x875c('0x2b'):_0x555ca8=_0x875c('0x2c');break;case _0x875c('0x15'):_0x555ca8=_0x875c('0x2d');break;case'$gte':_0x555ca8=_0x875c('0x2e');break;case _0x875c('0x2f'):_0x555ca8=_0x875c('0x30');break;}return _0x555ca8;}function parseValue(_0x5b17b3,_0x4a1db9,_0x10da63){var _0xaf6706={'start':undefined,'end':undefined};switch(_0x4a1db9){case _0x875c('0x22'):case _0x875c('0x1f'):_0xaf6706[_0x875c('0x31')]=_0x10da63[_0x875c('0x6')](',');break;case _0x875c('0x32'):_0xaf6706[_0x875c('0x31')]='%'+_0x10da63+'%';break;case _0x875c('0x33'):_0xaf6706[_0x875c('0x31')]=_0x10da63+'%';break;case _0x875c('0x34'):_0xaf6706[_0x875c('0x31')]='%'+_0x10da63;break;case _0x875c('0x2f'):var _0x4419bc=_0x10da63[_0x875c('0x6')](',');var _0x10da63=_0x4419bc[_0x875c('0xa')]();var _0x59b7c9=_0x4419bc['pop']();if(_0x5b17b3==='DATE'){_0x10da63=moment(_0x10da63)['utcOffset'](0x0,!![])[_0x875c('0x18')]();_0x59b7c9=moment(_0x59b7c9)['utcOffset'](0x0,!![])[_0x875c('0x16')](0x17,'hours')['add'](0x3b,_0x875c('0x35'))[_0x875c('0x16')](0x3b,_0x875c('0x36'))[_0x875c('0x18')]();}_0xaf6706={'start':_0x10da63,'end':_0x59b7c9};break;default:_0xaf6706[_0x875c('0x31')]=_0x10da63;break;}return _0xaf6706;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 8a33a9a..689c84e 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 _0x2826=['join','query','model','name','attributes','intersection','limit','offset','where','pick','VIRTUAL','lower','filter','options','lodash','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','find','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','uniqueid','isArray','split','sort','map','indexOf','priority','cast','col','DESC','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','replace','push'];(function(_0x50eff5,_0x394254){var _0xf8de90=function(_0x5d1d48){while(--_0x5d1d48){_0x50eff5['push'](_0x50eff5['shift']());}};_0xf8de90(++_0x394254);}(_0x2826,0x1e2));var _0x6282=function(_0x31c27f,_0x40294c){_0x31c27f=_0x31c27f-0x0;var _0x28f9c6=_0x2826[_0x31c27f];return _0x28f9c6;};'use strict';var _=require(_0x6282('0x0'));var sequelize=require(_0x6282('0x1'));var moment=require(_0x6282('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2e105e){var _0x34d9e6=['ne'];try{var _0x3c95e5=JSON[_0x6282('0x3')](_0x2e105e);var _0x4ad928=Object[_0x6282('0x4')](_0x3c95e5)[0x0];return _0x34d9e6[_0x6282('0x5')](_0x4ad928);}catch(_0x27f3cf){return![];}}function getOperatorValue(_0x488101){var _0x226747=JSON[_0x6282('0x3')](_0x488101);var _0x3fbde8=Object['keys'](_0x226747)[0x0];var _0x24c4d2=_0x226747[_0x3fbde8];return{['$'+_0x3fbde8]:_0x24c4d2};}exports[_0x6282('0x6')]=function(_0x3c1d34){var _0x43c993=null;if(_0x3c1d34){_0x43c993=_0x3c1d34['split'](',');}return _0x43c993;};exports[_0x6282('0x7')]=function(_0x51a292,_0x1aa1f7){var _0x7fad7f={};if(!_[_0x6282('0x8')](_0x51a292)){_['forOwn'](_0x51a292,function(_0xf07b64,_0x2910c2){try{if(_0x1aa1f7){var _0x4a42e7=_[_0x6282('0x9')](_0x1aa1f7,{'name':_0x2910c2})||{};if(hasSequelizeOperator(_0xf07b64)){_0x7fad7f[_0x2910c2]=getOperatorValue(_0xf07b64);}else if(_0x4a42e7['type']==='DATE'&&_[_0x6282('0xa')](_0xf07b64)){var _0x533470=JSON[_0x6282('0x3')](_0xf07b64);var _0x406e96={'$gte':moment(moment(_0x533470[_0x6282('0xb')])[_0x6282('0xc')](_0x6282('0xd')))[_0x6282('0xe')]()[_0x6282('0xc')](),'$lte':moment(moment(_0x533470[_0x6282('0xf')])['format'](_0x6282('0xd')))[_0x6282('0xe')]()['subtract'](0x1,'s')[_0x6282('0xc')]()};_0x7fad7f[_0x2910c2]=_0x406e96;}else if(_0x4a42e7['name']===_0x6282('0x10')){_0x7fad7f[_0x2910c2]=_0xf07b64;}else{_0x7fad7f[_0x2910c2]=_['isArray'](_0xf07b64)?_0xf07b64:JSON[_0x6282('0x3')](_0xf07b64);}}else{_0x7fad7f[_0x2910c2]=_[_0x6282('0x11')](_0xf07b64)?_0xf07b64:JSON[_0x6282('0x3')](_0xf07b64);}}catch(_0x249d47){_0x7fad7f[_0x2910c2]=_0xf07b64[_0x6282('0x12')](',');}});}return _0x7fad7f;};exports['limit']=function(_0x14a062){_0x14a062=parseInt(_0x14a062,0xa);if(!_0x14a062||_0x14a062<0x0){_0x14a062=LIMIT_VALUE;}return _0x14a062;};exports['offset']=function(_0x529b30){_0x529b30=parseInt(_0x529b30,0xa);if(!_0x529b30||_0x529b30<0x0){_0x529b30=0x0;}return _0x529b30;};exports[_0x6282('0x13')]=function(_0x29e78a){var _0x1b5a02,_0x4e8807=null;if(_0x29e78a){_0x1b5a02=_0x29e78a['split'](',');_0x4e8807=_[_0x6282('0x14')](_0x1b5a02,function(_0x308e01){if(_0x308e01[_0x6282('0x15')]('-')===0x0){return[_0x308e01===_0x6282('0x16')?sequelize[_0x6282('0x17')](sequelize[_0x6282('0x18')](_0x6282('0x16')),'unsigned'):_0x308e01['substr'](0x1),_0x6282('0x19')];}else{return[_0x308e01==='priority'?sequelize[_0x6282('0x17')](sequelize['col']('priority'),'unsigned'):_0x308e01,_0x6282('0x1a')];}});}return _0x4e8807;};exports[_0x6282('0x1b')]=function(_0x510ea2,_0x467dba){if(_[_0x6282('0x8')](_0x510ea2)){return _0x510ea2;}if(_[_0x6282('0x11')](_0x510ea2)){for(var _0x222720=0x0;_0x222720<_0x510ea2['length'];_0x222720+=0x1){_0x510ea2[_0x222720]=this[_0x6282('0x1b')](_0x510ea2[_0x222720],_0x467dba);}return _0x510ea2;}if(!_['isObject'](_0x510ea2)){return _0x510ea2;}if(_[_0x6282('0x1c')](_0x467dba)){_0x467dba=[_0x467dba];}if(!_[_0x6282('0x11')](_0x467dba)){return _0x510ea2;}for(var _0x54e786=0x0;_0x54e786<_0x467dba[_0x6282('0x1d')];_0x54e786+=0x1){_[_0x6282('0x1e')](_0x510ea2,_0x467dba[_0x54e786]);}for(var _0x34e5cd in _0x510ea2){if(_0x510ea2[_0x6282('0x1f')](_0x34e5cd)){_0x510ea2[_0x34e5cd]=this['omit'](_0x510ea2[_0x34e5cd],_0x467dba);}}return _0x510ea2;};exports[_0x6282('0x20')]=function(_0x22ea87){return _0x22ea87[_0x6282('0x21')](RegExp(_0x6282('0x22')))?!![]:![];};exports['isEmail']=function(_0x6429b0){return _0x6429b0[_0x6282('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x6282('0x23')]=function(_0x45b3a4){var _0x3a27a1=[];_0x45b3a4['split'](/[ ,]+/)['forEach'](function(_0x4d1984){_0x4d1984=_0x4d1984[_0x6282('0x24')](/([^:]")"+/g,'$1');_0x4d1984='+'+_0x4d1984+'*';if(_0x4d1984[_0x6282('0x5')]('@'))_0x4d1984='\x22'+_0x4d1984+'\x22';_0x3a27a1[_0x6282('0x25')](_0x4d1984);});return _0x3a27a1[_0x6282('0x26')]('\x20');};exports['getOptions']=function(_0x5145ff,_0x45860e,_0x5a42d6){var _0x209e00={},_0x1a80ce={};if(_0x45860e['query']['$id']){_0x45860e[_0x6282('0x27')]['id']=_0x45860e[_0x6282('0x27')]['$id'];delete _0x45860e['query']['$id'];}_0x209e00[_0x6282('0x28')]=_[_0x6282('0x14')](_0x5145ff,_0x6282('0x29'));_0x209e00[_0x6282('0x27')]=_[_0x6282('0x4')](_0x45860e[_0x6282('0x27')]);_0x209e00[_0x6282('0x7')]=_['intersection'](_0x209e00[_0x6282('0x28')],_0x209e00[_0x6282('0x27')]);_0x1a80ce[_0x6282('0x2a')]=_[_0x6282('0x2b')](_0x209e00['model'],this['fields'](_0x45860e[_0x6282('0x27')]['fields']));_0x1a80ce['attributes']=_0x1a80ce[_0x6282('0x2a')]['length']?_0x1a80ce[_0x6282('0x2a')]:_0x209e00[_0x6282('0x28')];if(!_0x45860e[_0x6282('0x27')][_0x6282('0x1f')]('nolimit')){_0x1a80ce['limit']=this[_0x6282('0x2c')](_0x45860e[_0x6282('0x27')][_0x6282('0x2c')]);_0x1a80ce['offset']=this['offset'](_0x45860e[_0x6282('0x27')][_0x6282('0x2d')]);}_0x1a80ce['order']=this[_0x6282('0x13')](_0x45860e['query']['sort']);_0x1a80ce[_0x6282('0x2e')]=this['filters'](_[_0x6282('0x2f')](_0x45860e[_0x6282('0x27')],_0x209e00[_0x6282('0x7')]),_0x5145ff);if(_0x45860e[_0x6282('0x27')]['filter']){_0x1a80ce['where']=_['merge'](_0x1a80ce['where'],{'$or':_[_0x6282('0x14')](_0x5145ff,function(_0x521969){if(_0x521969['type']!==_0x6282('0x30')){if(_0x5a42d6){return sequelize[_0x6282('0x2e')](sequelize['fn'](_0x6282('0x31'),sequelize[_0x6282('0x18')](_0x521969[_0x6282('0x29')])),{'$like':sequelize['fn'](_0x6282('0x31'),'%'+_0x45860e[_0x6282('0x27')][_0x6282('0x32')]+'%')});}else{var _0x491375={};_0x491375[_0x521969['name']]={'$like':'%'+_0x45860e[_0x6282('0x27')][_0x6282('0x32')]+'%'};return _0x491375;}}})});}_0x1a80ce=_['merge']({},_0x1a80ce,_0x45860e[_0x6282('0x33')]);return _0x1a80ce;}; \ No newline at end of file +var _0x0f4d=['forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','parse','limit','offset','sort','indexOf','priority','col','unsigned','DESC','length','isObject','unset','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','getOptions','$id','query','model','map','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','lower','options','lodash','sequelize','keys','includes','fields','split','isEmpty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f4d,0x6f));var _0xd0f4=function(_0x2f009e,_0x272387){_0x2f009e=_0x2f009e-0x0;var _0x3a9931=_0x0f4d[_0x2f009e];return _0x3a9931;};'use strict';var _=require(_0xd0f4('0x0'));var sequelize=require(_0xd0f4('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f1a50){var _0x56f623=['ne'];try{var _0x42f4a8=JSON['parse'](_0x1f1a50);var _0x21d848=Object[_0xd0f4('0x2')](_0x42f4a8)[0x0];return _0x56f623[_0xd0f4('0x3')](_0x21d848);}catch(_0x53b479){return![];}}function getOperatorValue(_0x4edb23){var _0x453dc0=JSON['parse'](_0x4edb23);var _0xf338cc=Object[_0xd0f4('0x2')](_0x453dc0)[0x0];var _0x1509ae=_0x453dc0[_0xf338cc];return{['$'+_0xf338cc]:_0x1509ae};}exports[_0xd0f4('0x4')]=function(_0x5b4ba1){var _0x12385a=null;if(_0x5b4ba1){_0x12385a=_0x5b4ba1[_0xd0f4('0x5')](',');}return _0x12385a;};exports['filters']=function(_0x3bbcc0,_0x2db8ce){var _0x588d29={};if(!_[_0xd0f4('0x6')](_0x3bbcc0)){_[_0xd0f4('0x7')](_0x3bbcc0,function(_0x5d6784,_0x5b0a4f){try{if(_0x2db8ce){var _0x290f2a=_['find'](_0x2db8ce,{'name':_0x5b0a4f})||{};if(hasSequelizeOperator(_0x5d6784)){_0x588d29[_0x5b0a4f]=getOperatorValue(_0x5d6784);}else if(_0x290f2a['type']===_0xd0f4('0x8')&&_[_0xd0f4('0x9')](_0x5d6784)){var _0x5dbe58=JSON['parse'](_0x5d6784);var _0x474df9={'$gte':moment(moment(_0x5dbe58[_0xd0f4('0xa')])[_0xd0f4('0xb')](_0xd0f4('0xc')))[_0xd0f4('0xd')]()[_0xd0f4('0xb')](),'$lte':moment(moment(_0x5dbe58[_0xd0f4('0xe')])[_0xd0f4('0xb')](_0xd0f4('0xc')))[_0xd0f4('0xd')]()[_0xd0f4('0xf')](0x1,'s')[_0xd0f4('0xb')]()};_0x588d29[_0x5b0a4f]=_0x474df9;}else if(_0x290f2a[_0xd0f4('0x10')]===_0xd0f4('0x11')){_0x588d29[_0x5b0a4f]=_0x5d6784;}else{_0x588d29[_0x5b0a4f]=_[_0xd0f4('0x12')](_0x5d6784)?_0x5d6784:JSON['parse'](_0x5d6784);}}else{_0x588d29[_0x5b0a4f]=_[_0xd0f4('0x12')](_0x5d6784)?_0x5d6784:JSON[_0xd0f4('0x13')](_0x5d6784);}}catch(_0x53dd48){_0x588d29[_0x5b0a4f]=_0x5d6784['split'](',');}});}return _0x588d29;};exports[_0xd0f4('0x14')]=function(_0x4dad2a){_0x4dad2a=parseInt(_0x4dad2a,0xa);if(!_0x4dad2a||_0x4dad2a<0x0){_0x4dad2a=LIMIT_VALUE;}return _0x4dad2a;};exports[_0xd0f4('0x15')]=function(_0x507770){_0x507770=parseInt(_0x507770,0xa);if(!_0x507770||_0x507770<0x0){_0x507770=0x0;}return _0x507770;};exports[_0xd0f4('0x16')]=function(_0x15d31f){var _0x34a64c,_0x529da2=null;if(_0x15d31f){_0x34a64c=_0x15d31f[_0xd0f4('0x5')](',');_0x529da2=_['map'](_0x34a64c,function(_0x3612d7){if(_0x3612d7[_0xd0f4('0x17')]('-')===0x0){return[_0x3612d7===_0xd0f4('0x18')?sequelize['cast'](sequelize[_0xd0f4('0x19')]('priority'),_0xd0f4('0x1a')):_0x3612d7['substr'](0x1),_0xd0f4('0x1b')];}else{return[_0x3612d7===_0xd0f4('0x18')?sequelize['cast'](sequelize[_0xd0f4('0x19')]('priority'),'unsigned'):_0x3612d7,'ASC'];}});}return _0x529da2;};exports['omit']=function(_0x1182a6,_0x2d21d4){if(_['isEmpty'](_0x1182a6)){return _0x1182a6;}if(_['isArray'](_0x1182a6)){for(var _0x272db1=0x0;_0x272db1<_0x1182a6[_0xd0f4('0x1c')];_0x272db1+=0x1){_0x1182a6[_0x272db1]=this['omit'](_0x1182a6[_0x272db1],_0x2d21d4);}return _0x1182a6;}if(!_[_0xd0f4('0x1d')](_0x1182a6)){return _0x1182a6;}if(_['isString'](_0x2d21d4)){_0x2d21d4=[_0x2d21d4];}if(!_[_0xd0f4('0x12')](_0x2d21d4)){return _0x1182a6;}for(var _0x4d73d1=0x0;_0x4d73d1<_0x2d21d4['length'];_0x4d73d1+=0x1){_[_0xd0f4('0x1e')](_0x1182a6,_0x2d21d4[_0x4d73d1]);}for(var _0xf46e4c in _0x1182a6){if(_0x1182a6['hasOwnProperty'](_0xf46e4c)){_0x1182a6[_0xf46e4c]=this[_0xd0f4('0x1f')](_0x1182a6[_0xf46e4c],_0x2d21d4);}}return _0x1182a6;};exports[_0xd0f4('0x20')]=function(_0x1b1d96){return _0x1b1d96[_0xd0f4('0x21')](RegExp(_0xd0f4('0x22')))?!![]:![];};exports[_0xd0f4('0x23')]=function(_0x1a5701){return _0x1a5701[_0xd0f4('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x5f2b4a){var _0xbe6d2b=[];_0x5f2b4a[_0xd0f4('0x5')](/[ ,]+/)[_0xd0f4('0x24')](function(_0xe68739){_0xe68739=_0xe68739[_0xd0f4('0x25')](/([^:]")"+/g,'$1');_0xe68739='+'+_0xe68739+'*';if(_0xe68739[_0xd0f4('0x3')]('@'))_0xe68739='\x22'+_0xe68739+'\x22';_0xbe6d2b[_0xd0f4('0x26')](_0xe68739);});return _0xbe6d2b[_0xd0f4('0x27')]('\x20');};exports[_0xd0f4('0x28')]=function(_0x13091d,_0x26e231,_0x1ae3ee){var _0x12c2c0={},_0x224720={};if(_0x26e231['query'][_0xd0f4('0x29')]){_0x26e231[_0xd0f4('0x2a')]['id']=_0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x29')];delete _0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x29')];}_0x12c2c0[_0xd0f4('0x2b')]=_[_0xd0f4('0x2c')](_0x13091d,_0xd0f4('0x10'));_0x12c2c0[_0xd0f4('0x2a')]=_[_0xd0f4('0x2')](_0x26e231[_0xd0f4('0x2a')]);_0x12c2c0[_0xd0f4('0x2d')]=_['intersection'](_0x12c2c0[_0xd0f4('0x2b')],_0x12c2c0[_0xd0f4('0x2a')]);_0x224720['attributes']=_[_0xd0f4('0x2e')](_0x12c2c0[_0xd0f4('0x2b')],this[_0xd0f4('0x4')](_0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x4')]));_0x224720[_0xd0f4('0x2f')]=_0x224720[_0xd0f4('0x2f')][_0xd0f4('0x1c')]?_0x224720[_0xd0f4('0x2f')]:_0x12c2c0['model'];if(!_0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x30')](_0xd0f4('0x31'))){_0x224720[_0xd0f4('0x14')]=this[_0xd0f4('0x14')](_0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x14')]);_0x224720[_0xd0f4('0x15')]=this['offset'](_0x26e231[_0xd0f4('0x2a')]['offset']);}_0x224720[_0xd0f4('0x32')]=this[_0xd0f4('0x16')](_0x26e231[_0xd0f4('0x2a')]['sort']);_0x224720[_0xd0f4('0x33')]=this[_0xd0f4('0x2d')](_[_0xd0f4('0x34')](_0x26e231[_0xd0f4('0x2a')],_0x12c2c0[_0xd0f4('0x2d')]),_0x13091d);if(_0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x35')]){_0x224720['where']=_[_0xd0f4('0x36')](_0x224720[_0xd0f4('0x33')],{'$or':_[_0xd0f4('0x2c')](_0x13091d,function(_0x3c95f4){if(_0x3c95f4[_0xd0f4('0x37')]!==_0xd0f4('0x38')){if(_0x1ae3ee){return sequelize[_0xd0f4('0x33')](sequelize['fn']('lower',sequelize[_0xd0f4('0x19')](_0x3c95f4[_0xd0f4('0x10')])),{'$like':sequelize['fn'](_0xd0f4('0x39'),'%'+_0x26e231[_0xd0f4('0x2a')][_0xd0f4('0x35')]+'%')});}else{var _0xe1b338={};_0xe1b338[_0x3c95f4[_0xd0f4('0x10')]]={'$like':'%'+_0x26e231[_0xd0f4('0x2a')]['filter']+'%'};return _0xe1b338;}}})});}_0x224720=_[_0xd0f4('0x36')]({},_0x224720,_0x26e231[_0xd0f4('0x3a')]);return _0x224720;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index be21a7c..6095722 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb212=['errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath','root','public','development','test','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser'];(function(_0x2ad6a6,_0xc51775){var _0x48a8de=function(_0xc4eaf5){while(--_0xc4eaf5){_0x2ad6a6['push'](_0x2ad6a6['shift']());}};_0x48a8de(++_0xc51775);}(_0xb212,0x13f));var _0x2b21=function(_0x3fc87d,_0x322212){_0x3fc87d=_0x3fc87d-0x0;var _0x4f9cef=_0xb212[_0x3fc87d];return _0x4f9cef;};'use strict';var express=require(_0x2b21('0x0'));var favicon=require(_0x2b21('0x1'));var bodyParser=require(_0x2b21('0x2'));var methodOverride=require(_0x2b21('0x3'));var cookieParser=require(_0x2b21('0x4'));var errorHandler=require(_0x2b21('0x5'));var path=require(_0x2b21('0x6'));var passport=require(_0x2b21('0x7'));var cors=require(_0x2b21('0x8'));var moment=require(_0x2b21('0x9'));var config=require(_0x2b21('0xa'));var db=require(_0x2b21('0xb'))['db'];exports[_0x2b21('0xc')]=function(_0x3569d1){var _0xb04f74=_0x3569d1[_0x2b21('0xd')](_0x2b21('0xe'));if(_0xb04f74===_0x2b21('0xf')){_0x3569d1[_0x2b21('0x10')](_0x2b21('0x11'),path['join'](config[_0x2b21('0x12')],_0x2b21('0x13')));}if(_0xb04f74===_0x2b21('0x14')||_0xb04f74===_0x2b21('0x15')){_0x3569d1[_0x2b21('0x10')](_0x2b21('0x11'),path['join'](config[_0x2b21('0x12')],_0x2b21('0x16')));_0x3569d1[_0x2b21('0x17')](errorHandler());}_0x3569d1['set'](_0x2b21('0x18'),function(_0x33f1cd,_0x108c5c){if(this[_0x33f1cd]instanceof Date){_0x108c5c=this[_0x33f1cd][_0x2b21('0x19')]()[_0x2b21('0x1a')]('.')[0x0]+'Z';}return _0x108c5c;});_0x3569d1[_0x2b21('0x17')](express[_0x2b21('0x1b')](_0x3569d1[_0x2b21('0xd')](_0x2b21('0x11'))));_0x3569d1[_0x2b21('0x10')]('views',config['root']+_0x2b21('0x1c'));_0x3569d1[_0x2b21('0x1d')](_0x2b21('0x1e'),require(_0x2b21('0x1f'))[_0x2b21('0x20')]);_0x3569d1['set'](_0x2b21('0x21'),'html');_0x3569d1[_0x2b21('0x17')](bodyParser['urlencoded']({'limit':_0x2b21('0x22'),'extended':!![]}));_0x3569d1['use'](bodyParser['json']({'limit':_0x2b21('0x22')}));_0x3569d1[_0x2b21('0x17')](cors());_0x3569d1[_0x2b21('0x17')](methodOverride());_0x3569d1[_0x2b21('0x17')](cookieParser());_0x3569d1[_0x2b21('0x17')](passport[_0x2b21('0x23')]());}; \ No newline at end of file +var _0x3c93=['cookie-parser','passport','cors','moment','../mysqldb','default','get','env','set','appPath','join','public','development','root','json\x20replacer','toISOString','use','static','views','/server/views','engine','html','ejs','renderFile','50mb','json','initialize','express','serve-favicon','method-override'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3c93,0xb1));var _0x33c9=function(_0x461e12,_0x36958d){_0x461e12=_0x461e12-0x0;var _0x3fd69a=_0x3c93[_0x461e12];return _0x3fd69a;};'use strict';var express=require(_0x33c9('0x0'));var favicon=require(_0x33c9('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x33c9('0x2'));var cookieParser=require(_0x33c9('0x3'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x33c9('0x4'));var cors=require(_0x33c9('0x5'));var moment=require(_0x33c9('0x6'));var config=require('./environment');var db=require(_0x33c9('0x7'))['db'];exports[_0x33c9('0x8')]=function(_0x501ae8){var _0x4eb1c4=_0x501ae8[_0x33c9('0x9')](_0x33c9('0xa'));if(_0x4eb1c4==='production'){_0x501ae8[_0x33c9('0xb')](_0x33c9('0xc'),path[_0x33c9('0xd')](config['root'],_0x33c9('0xe')));}if(_0x4eb1c4===_0x33c9('0xf')||_0x4eb1c4==='test'){_0x501ae8['set'](_0x33c9('0xc'),path[_0x33c9('0xd')](config[_0x33c9('0x10')],'client'));_0x501ae8['use'](errorHandler());}_0x501ae8[_0x33c9('0xb')](_0x33c9('0x11'),function(_0x23e472,_0x4a5e4d){if(this[_0x23e472]instanceof Date){_0x4a5e4d=this[_0x23e472][_0x33c9('0x12')]()['split']('.')[0x0]+'Z';}return _0x4a5e4d;});_0x501ae8[_0x33c9('0x13')](express[_0x33c9('0x14')](_0x501ae8[_0x33c9('0x9')](_0x33c9('0xc'))));_0x501ae8['set'](_0x33c9('0x15'),config[_0x33c9('0x10')]+_0x33c9('0x16'));_0x501ae8[_0x33c9('0x17')](_0x33c9('0x18'),require(_0x33c9('0x19'))[_0x33c9('0x1a')]);_0x501ae8[_0x33c9('0xb')]('view\x20engine',_0x33c9('0x18'));_0x501ae8[_0x33c9('0x13')](bodyParser['urlencoded']({'limit':_0x33c9('0x1b'),'extended':!![]}));_0x501ae8[_0x33c9('0x13')](bodyParser[_0x33c9('0x1c')]({'limit':_0x33c9('0x1b')}));_0x501ae8[_0x33c9('0x13')](cors());_0x501ae8[_0x33c9('0x13')](methodOverride());_0x501ae8[_0x33c9('0x13')](cookieParser());_0x501ae8['use'](passport[_0x33c9('0x1d')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 7a1c840..2d1d9f9 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 _0xa882=['licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','substring','crypto','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','createHash','md5','update','digest','hex','getUuid','platform'];(function(_0x2f2a71,_0x16a61d){var _0x3a212b=function(_0x3e7760){while(--_0x3e7760){_0x2f2a71['push'](_0x2f2a71['shift']());}};_0x3a212b(++_0x16a61d);}(_0xa882,0x71));var _0x2a88=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa882[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x2a88('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x2a88('0x1'))['execSync'];var config=require(_0x2a88('0x2'));function getInterfaces(){var _0x57a75e=[];var _0x4f176f=os[_0x2a88('0x3')]();var _0x16b05a=_[_0x2a88('0x4')](_[_0x2a88('0x5')](_0x4f176f));for(var _0x3a67f7=0x0;_0x3a67f7<_0x16b05a[_0x2a88('0x6')];_0x3a67f7++){var _0x3fa7ae=_0x4f176f[_0x16b05a[_0x3a67f7]][_0x2a88('0x7')](function(_0x5c6364){return _0x5c6364[_0x2a88('0x8')]===_0x2a88('0x9')&&_0x5c6364[_0x2a88('0xa')]===![];});_0x57a75e=_0x57a75e[_0x2a88('0xb')](_0x3fa7ae);}return _0x57a75e;}function getFirstInterface(){var _0x209ae4=_[_0x2a88('0xc')](getInterfaces());return{'macAddress':_0x209ae4&&_0x209ae4[_0x2a88('0xd')]?_0x209ae4['mac']:_0x2a88('0xe'),'ipAddress':_0x209ae4&&_0x209ae4['address']?_0x209ae4[_0x2a88('0xf')]:_0x2a88('0x10')};}exports[_0x2a88('0x11')]=getFirstInterface;function getCPUhash(){var _0x2aeb8a=_[_0x2a88('0x4')](os['cpus']()[_0x2a88('0x12')](function(_0x428fff){return _0x428fff['model'];}))[_0x2a88('0x13')](':');return crypto[_0x2a88('0x14')](_0x2a88('0x15'))[_0x2a88('0x16')](_0x2aeb8a)[_0x2a88('0x17')](_0x2a88('0x18'));}exports[_0x2a88('0x19')]=function(){var _0x272815=os[_0x2a88('0x1a')]();var _0x11f5db=/[0-9a-f-]{36}/;if(config[_0x2a88('0x1b')]&&_0x11f5db['test'](config[_0x2a88('0x1b')])){return config[_0x2a88('0x1b')];}else if(_0x272815===_0x2a88('0x1c')){return exec(_0x2a88('0x1d'),{'encoding':_0x2a88('0x1e')})[_0x2a88('0x1f')]('\x0d\x0a','');}else{var _0x1db7e8=getFirstInterface();var _0x51d4e7=getCPUhash();var _0x16aa77=_0x51d4e7+'|'+os['hostname']()+'|'+_0x1db7e8[_0x2a88('0x20')]+'|'+_0x1db7e8[_0x2a88('0x21')];var _0x49d3ad=crypto[_0x2a88('0x14')]('md5')[_0x2a88('0x16')](_0x16aa77)[_0x2a88('0x17')]('hex');return _0x49d3ad[_0x2a88('0x22')](0x0,0x8)+'-'+_0x49d3ad['substring'](0x8,0xc)+'-'+_0x49d3ad[_0x2a88('0x22')](0xc,0x10)+'-'+_0x49d3ad[_0x2a88('0x22')](0x10,0x14)+'-'+_0x49d3ad[_0x2a88('0x22')](0x14);}}; \ No newline at end of file +var _0x7813=['lodash','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','length','family','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','hex','substring'];(function(_0x51a723,_0x59e085){var _0x39ce92=function(_0xf84a6a){while(--_0xf84a6a){_0x51a723['push'](_0x51a723['shift']());}};_0x39ce92(++_0x59e085);}(_0x7813,0x132));var _0x3781=function(_0x40ae18,_0x271674){_0x40ae18=_0x40ae18-0x0;var _0x3a6f2c=_0x7813[_0x40ae18];return _0x3a6f2c;};'use strict';var _=require(_0x3781('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x3781('0x1'));var exec=require(_0x3781('0x2'))[_0x3781('0x3')];var config=require(_0x3781('0x4'));function getInterfaces(){var _0x4fa87b=[];var _0x3b020b=os['networkInterfaces']();var _0x24a975=_[_0x3781('0x5')](_['keys'](_0x3b020b));for(var _0xf41957=0x0;_0xf41957<_0x24a975[_0x3781('0x6')];_0xf41957++){var _0x43f1a5=_0x3b020b[_0x24a975[_0xf41957]]['filter'](function(_0x2baa80){return _0x2baa80[_0x3781('0x7')]===_0x3781('0x8')&&_0x2baa80[_0x3781('0x9')]===![];});_0x4fa87b=_0x4fa87b[_0x3781('0xa')](_0x43f1a5);}return _0x4fa87b;}function getFirstInterface(){var _0x187eeb=_[_0x3781('0xb')](getInterfaces());return{'macAddress':_0x187eeb&&_0x187eeb[_0x3781('0xc')]?_0x187eeb['mac']:'00:00:00:00:00:00','ipAddress':_0x187eeb&&_0x187eeb[_0x3781('0xd')]?_0x187eeb[_0x3781('0xd')]:_0x3781('0xe')};}exports[_0x3781('0xf')]=getFirstInterface;function getCPUhash(){var _0x507ac9=_[_0x3781('0x5')](os[_0x3781('0x10')]()['map'](function(_0x166eb8){return _0x166eb8[_0x3781('0x11')];}))[_0x3781('0x12')](':');return crypto[_0x3781('0x13')](_0x3781('0x14'))[_0x3781('0x15')](_0x507ac9)[_0x3781('0x16')]('hex');}exports['getUuid']=function(){var _0x27784d=os[_0x3781('0x17')]();var _0x4f26ab=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4f26ab[_0x3781('0x18')](config['licenseToken'])){return config[_0x3781('0x19')];}else if(_0x27784d===_0x3781('0x1a')){return exec(_0x3781('0x1b'),{'encoding':_0x3781('0x1c')})['replace']('\x0d\x0a','');}else{var _0x593f0c=getFirstInterface();var _0x39cdfa=getCPUhash();var _0x2ad68b=_0x39cdfa+'|'+os[_0x3781('0x1d')]()+'|'+_0x593f0c[_0x3781('0x1e')]+'|'+_0x593f0c[_0x3781('0x1f')];var _0x3bc1a0=crypto[_0x3781('0x13')]('md5')[_0x3781('0x15')](_0x2ad68b)[_0x3781('0x16')](_0x3781('0x20'));return _0x3bc1a0[_0x3781('0x21')](0x0,0x8)+'-'+_0x3bc1a0['substring'](0x8,0xc)+'-'+_0x3bc1a0[_0x3781('0x21')](0xc,0x10)+'-'+_0x3bc1a0[_0x3781('0x21')](0x10,0x14)+'-'+_0x3bc1a0['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0525f25..ab00be8 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 _0x254e=['license','https://www.xcallymotion.com','format','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','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','decryptString','days','message','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger'];(function(_0x1beb92,_0x23d19a){var _0x13f1fd=function(_0x5cee31){while(--_0x5cee31){_0x1beb92['push'](_0x1beb92['shift']());}};_0x13f1fd(++_0x23d19a);}(_0x254e,0x103));var _0xe254=function(_0x24bac1,_0x243d4a){_0x24bac1=_0x24bac1-0x0;var _0x4494c7=_0x254e[_0x24bac1];return _0x4494c7;};'use strict';var util=require('util');var moment=require(_0xe254('0x0'));var rp=require('request-promise');var BPromise=require(_0xe254('0x1'));var pkginfo=require(_0xe254('0x2'))(module,'version');var db=require(_0xe254('0x3'))['db'];var encryptor=require(_0xe254('0x4'));var hardware=require(_0xe254('0x5'));var logger=require(_0xe254('0x6'))(_0xe254('0x7'));var HOST=_0xe254('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x49fb1a){return new BPromise(function(_0x32388f,_0xf46675){var _0x3a593e=util[_0xe254('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x49fb1a,module[_0xe254('0xa')][_0xe254('0xb')]);if(oldToken){_0x3a593e=util[_0xe254('0x9')](_0xe254('0xc'),HOST,_0x49fb1a,module[_0xe254('0xa')][_0xe254('0xb')],oldToken);}var _0xd1f860={'uri':_0x3a593e,'method':_0xe254('0xd'),'timeout':0xea60,'json':!![]};return rp(_0xd1f860)[_0xe254('0xe')](function(_0x332f58){_0x32388f(_0x332f58);})[_0xe254('0xf')](function(_0x1b4ca7){_0xf46675(_0x1b4ca7);});});}function manageLicense(_0x5e9790,_0x477931){var _0x128a48=_0x477931[_0xe254('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x128a48[_0xe254('0x11')]!==_0x5e9790&&!_0x128a48[_0xe254('0x12')]){oldToken=_0x128a48[_0xe254('0x11')];}httpRequest(_0x5e9790)[_0xe254('0xe')](function(_0x22d620){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x22d620['active']){isOldTokenSent=![];if(!_0x128a48[_0xe254('0x7')]&&_0x128a48[_0xe254('0x7')]!=_0x22d620[_0xe254('0x7')]||_0x128a48['license']&&_0x128a48[_0xe254('0x12')]){logger['info'](_0xe254('0x13'));}if(_0x128a48['license']&&!_0x128a48[_0xe254('0x12')]&&_0x128a48[_0xe254('0x7')]!=_0x22d620[_0xe254('0x7')]){logger[_0xe254('0x14')](_0xe254('0x15'));}if(_0x128a48[_0xe254('0x7')]&&!_0x128a48['data2']&&_0x128a48[_0xe254('0x7')]==_0x22d620[_0xe254('0x7')]){return _0x477931;}return _0x477931[_0xe254('0x16')]({'data1':_0x5e9790,'data2':null,'license':_0x22d620[_0xe254('0x7')]});}else{if(_0x22d620[_0xe254('0x7')]||_0x128a48[_0xe254('0x7')]){if(!_0x128a48[_0xe254('0x12')]){if(_0x128a48['data1']==_0x5e9790){GRAY_PERIOD_REASON='Disabled';logger[_0xe254('0x14')](_0xe254('0x17'));}else{GRAY_PERIOD_REASON=_0xe254('0x18');logger[_0xe254('0x14')](_0xe254('0x19'),_0x128a48[_0xe254('0x11')],_0x5e9790);}logger[_0xe254('0x14')](_0xe254('0x1a'),GRAY_PERIOD_REASON[_0xe254('0x1b')](),moment()[_0xe254('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x477931[_0xe254('0x16')]({'data2':encryptor['encryptString'](moment()[_0xe254('0x9')](_0xe254('0x1c')))});}else{if(moment()['diff'](encryptor[_0xe254('0x1d')](_0x128a48['data2']),_0xe254('0x1e'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xe254('0x9')](_0xe254('0x1c')));isOldTokenSent=![];return _0x477931[_0xe254('0x16')]({'data1':_0x5e9790,'data2':null,'license':null});}}}else{if(_0x128a48[_0xe254('0x11')]!=_0x5e9790){logger['info'](_0xe254('0x19'),_0x128a48['data1'],_0x5e9790);return _0x477931['update']({'data1':_0x5e9790,'data2':null,'license':null});}}}return _0x477931;})[_0xe254('0xe')](function(_0x1815ea){_0x477931=_0x1815ea;})[_0xe254('0xf')](function(_0x14d29c){logger['error'](_0x14d29c[_0xe254('0x1f')]);})[_0xe254('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xe254('0x21')](),_0x477931);},TIME);});}function defaultLicense(){var _0x3ac8b3=hardware['getUuid']();if(_0x3ac8b3){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3ac8b3}})[_0xe254('0x22')](function(_0x15ae58,_0x450e3b){logger[_0xe254('0x14')](_0xe254('0x23'),_0x3ac8b3);manageLicense(_0x3ac8b3,_0x15ae58);})[_0xe254('0xf')](function(_0x3df404){logger[_0xe254('0x24')](_0x3df404[_0xe254('0x1f')]);});}}exports[_0xe254('0x25')]=defaultLicense; \ No newline at end of file +var _0xe1ed=['days','DEMO\x20START\x20AT\x20%s','update','catch','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','../logger','https://www.xcallymotion.com','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString'];(function(_0x207315,_0x262c4d){var _0xbcd81c=function(_0x573486){while(--_0x573486){_0x207315['push'](_0x207315['shift']());}};_0xbcd81c(++_0x262c4d);}(_0xe1ed,0xde));var _0xde1e=function(_0x503ac6,_0x5ef9f5){_0x503ac6=_0x503ac6-0x0;var _0x3aa041=_0xe1ed[_0x503ac6];return _0x3aa041;};'use strict';var util=require(_0xde1e('0x0'));var moment=require(_0xde1e('0x1'));var rp=require(_0xde1e('0x2'));var BPromise=require(_0xde1e('0x3'));var pkginfo=require(_0xde1e('0x4'))(module,'version');var db=require(_0xde1e('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0xde1e('0x6'))('license');var HOST=_0xde1e('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1104f1){return new BPromise(function(_0x5147a1,_0x3c2f74){var _0x42ecdc=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x1104f1,module[_0xde1e('0x8')][_0xde1e('0x9')]);if(oldToken){_0x42ecdc=util[_0xde1e('0xa')](_0xde1e('0xb'),HOST,_0x1104f1,module[_0xde1e('0x8')]['version'],oldToken);}var _0x1d79fb={'uri':_0x42ecdc,'method':_0xde1e('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x1d79fb)[_0xde1e('0xd')](function(_0x434318){_0x5147a1(_0x434318);})['catch'](function(_0x2e7ca8){_0x3c2f74(_0x2e7ca8);});});}function manageLicense(_0x5990f8,_0x3c9943){var _0x2af89d=_0x3c9943[_0xde1e('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x2af89d[_0xde1e('0xf')]!==_0x5990f8&&!_0x2af89d[_0xde1e('0x10')]){oldToken=_0x2af89d[_0xde1e('0xf')];}httpRequest(_0x5990f8)[_0xde1e('0xd')](function(_0x43f5dc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x43f5dc[_0xde1e('0x11')]){isOldTokenSent=![];if(!_0x2af89d['license']&&_0x2af89d['license']!=_0x43f5dc[_0xde1e('0x12')]||_0x2af89d[_0xde1e('0x12')]&&_0x2af89d[_0xde1e('0x10')]){logger[_0xde1e('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2af89d[_0xde1e('0x12')]&&!_0x2af89d[_0xde1e('0x10')]&&_0x2af89d['license']!=_0x43f5dc['license']){logger[_0xde1e('0x13')](_0xde1e('0x14'));}if(_0x2af89d[_0xde1e('0x12')]&&!_0x2af89d['data2']&&_0x2af89d[_0xde1e('0x12')]==_0x43f5dc[_0xde1e('0x12')]){return _0x3c9943;}return _0x3c9943['update']({'data1':_0x5990f8,'data2':null,'license':_0x43f5dc[_0xde1e('0x12')]});}else{if(_0x43f5dc[_0xde1e('0x12')]||_0x2af89d[_0xde1e('0x12')]){if(!_0x2af89d[_0xde1e('0x10')]){if(_0x2af89d[_0xde1e('0xf')]==_0x5990f8){GRAY_PERIOD_REASON=_0xde1e('0x15');logger[_0xde1e('0x13')](_0xde1e('0x16'));}else{GRAY_PERIOD_REASON=_0xde1e('0x17');logger[_0xde1e('0x13')](_0xde1e('0x18'),_0x2af89d[_0xde1e('0xf')],_0x5990f8);}logger['info'](_0xde1e('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xde1e('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x3c9943['update']({'data2':encryptor[_0xde1e('0x1a')](moment()[_0xde1e('0xa')](_0xde1e('0x1b')))});}else{if(moment()[_0xde1e('0x1c')](encryptor[_0xde1e('0x1d')](_0x2af89d[_0xde1e('0x10')]),_0xde1e('0x1e'))>DAYS){logger['info'](_0xde1e('0x1f'),moment()[_0xde1e('0xa')](_0xde1e('0x1b')));isOldTokenSent=![];return _0x3c9943[_0xde1e('0x20')]({'data1':_0x5990f8,'data2':null,'license':null});}}}else{if(_0x2af89d['data1']!=_0x5990f8){logger[_0xde1e('0x13')](_0xde1e('0x18'),_0x2af89d[_0xde1e('0xf')],_0x5990f8);return _0x3c9943[_0xde1e('0x20')]({'data1':_0x5990f8,'data2':null,'license':null});}}}return _0x3c9943;})[_0xde1e('0xd')](function(_0x20c22d){_0x3c9943=_0x20c22d;})[_0xde1e('0x21')](function(_0x46c131){logger[_0xde1e('0x22')](_0x46c131[_0xde1e('0x23')]);})[_0xde1e('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xde1e('0x25')](),_0x3c9943);},TIME);});}function defaultLicense(){var _0x1f9928=hardware['getUuid']();if(_0x1f9928){return db[_0xde1e('0x26')][_0xde1e('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x1f9928}})['spread'](function(_0x50e2b4,_0x834375){logger['info'](_0xde1e('0x28'),_0x1f9928);manageLicense(_0x1f9928,_0x50e2b4);})[_0xde1e('0x21')](function(_0x2faf19){logger[_0xde1e('0x22')](_0x2faf19[_0xde1e('0x23')]);});}}exports[_0xde1e('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c47531e..d70772b 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 _0x6825=['parse','demo','uuid','machineUuid','decryptString','gray','deadline','add','grayReason','changed','disabled','message','User','role','sequelize','COUNT','count','admin','telephone','users','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s'];(function(_0x962de1,_0x361057){var _0x14085a=function(_0x220dae){while(--_0x220dae){_0x962de1['push'](_0x962de1['shift']());}};_0x14085a(++_0x361057);}(_0x6825,0x188));var _0x5682=function(_0x9e8ddc,_0x373777){_0x9e8ddc=_0x9e8ddc-0x0;var _0x3ab2d4=_0x6825[_0x9e8ddc];return _0x3ab2d4;};'use strict';var util=require(_0x5682('0x0'));var _=require(_0x5682('0x1'));var moment=require('moment');var BPromise=require(_0x5682('0x2'));var hardware=require(_0x5682('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x5682('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5682('0x5'),'machineUuid':hardware[_0x5682('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5682('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5682('0x8'),'machineUuid':hardware[_0x5682('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xf65687){return new BPromise(function(_0x5332af,_0x1f83fe){return db[_0x5682('0x9')][_0x5682('0xa')](_[_0x5682('0xb')](_0xf65687,{'raw':!![],'where':{'id':0x1}}))[_0x5682('0xc')](function(_0x1793d4){return checkLicense(_0x1793d4,null);})['then'](function(_0x30ddfc){_0x5332af(_0x30ddfc);return;})[_0x5682('0xd')](function(_0x358276){_0x1f83fe(_0x358276);});});}function checkLicense(_0xea7ccc,_0x118ffc){if(!_0xea7ccc){demoLicense['uuid']=_0xea7ccc[_0x5682('0xe')];return demoLicense;}try{var _0x218f19=_0x118ffc||_0xea7ccc[_0x5682('0xf')];if(_[_0x5682('0x10')](_0x218f19)){throw new Error(_0x5682('0x11'));}var _0x115255=_0xea7ccc['data1'];var _0x1ebc46=_0xea7ccc[_0x5682('0x12')];var _0x488277=_0x115255[_0x5682('0x13')]('-')[0x4];var _0x4b8265=_0x115255[_0x5682('0x13')]('-')[0x0];var _0x26140a=encryptor['decryptString'](_0x218f19,util[_0x5682('0x14')](_0x5682('0x15'),_0x488277,_0x115255,_0x4b8265));var _0x50d8db=JSON[_0x5682('0x16')](_0x26140a);_0x50d8db[_0x5682('0x17')]=![];_0x50d8db[_0x5682('0x18')]=_0x115255;_0x50d8db[_0x5682('0x19')]=hardware[_0x5682('0x6')]();if(_0x1ebc46){var _0xb96799=encryptor[_0x5682('0x1a')](_0x1ebc46);_0x50d8db[_0x5682('0x1b')]=_0xb96799;_0x50d8db[_0x5682('0x1c')]=moment(_0xb96799)[_0x5682('0x1d')](0x7,'days')['format']();_0x50d8db[_0x5682('0x1e')]=_0x50d8db[_0x5682('0x18')]!=_0x50d8db[_0x5682('0x19')]?_0x5682('0x1f'):_0x5682('0x20');}return _0x50d8db;}catch(_0x339b71){breakingLicense[_0x5682('0x18')]=_0xea7ccc['data1'];breakingLicense[_0x5682('0x21')]=_0x339b71[_0x5682('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x17c28a,_0x3f6e44){getLicense()['then'](function(_0x388cb8){return db[_0x5682('0x22')]['findAll']({'attributes':[_0x5682('0x23'),[db[_0x5682('0x24')]['fn'](_0x5682('0x25'),db[_0x5682('0x24')]['col'](_0x5682('0x23'))),_0x5682('0x26')]],'group':_0x5682('0x23'),'where':{'role':{'$or':[_0x5682('0x27'),'user',_0x5682('0x28')]}},'raw':!![]})['then'](function(_0x55e9e9){var _0x422677={'user':_0x388cb8[_0x5682('0x29')]||0x0,'telephone':_0x388cb8['telephones']||0x0};_0x55e9e9['forEach'](function(_0x2abcad){var _0x103a8d=_0x2abcad[_0x5682('0x23')]===_0x5682('0x27')?'user':_0x2abcad[_0x5682('0x23')];_0x422677[_0x103a8d]-=_0x2abcad[_0x5682('0x26')];if(_0x422677[_0x103a8d]<0x0)_0x422677[_0x103a8d]=0x0;});_0x17c28a(_0x422677);return;});})[_0x5682('0xd')](function(_0xed5e2d){_0x3f6e44(_0xed5e2d);});});}function checkUserLimits(_0x504b6f){return new BPromise(function(_0x2269ee,_0x4555c6){getLimits()['then'](function(_0x4e21d8){var _0x43b41f=_['pick'](_['countBy'](_0x504b6f,_0x5682('0x23')),[_0x5682('0x27'),'user',_0x5682('0x28')]);var _0x33ec98=(_0x43b41f['admin']||0x0)+(_0x43b41f[_0x5682('0x2a')]||0x0);var _0x36bbb1=_0x43b41f['telephone']||0x0;if(_0x33ec98>_0x4e21d8['user'])return _0x4555c6(_0x5682('0x2b'));if(_0x36bbb1>_0x4e21d8[_0x5682('0x28')])return _0x4555c6(_0x5682('0x2c'));return _0x2269ee();})['catch'](function(_0x3afca2){_0x4555c6(_0x3afca2);});});}module[_0x5682('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x9fe1=['days','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','telephone','users','forEach','admin','user','count','pick','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','Breaking\x20license','getUuid','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','decryptString','format','demo','machineUuid','deadline','add'];(function(_0x449909,_0x431e05){var _0x2e75bf=function(_0x47efc5){while(--_0x47efc5){_0x449909['push'](_0x449909['shift']());}};_0x2e75bf(++_0x431e05);}(_0x9fe1,0x185));var _0x19fe=function(_0xfaf73a,_0x575f41){_0xfaf73a=_0xfaf73a-0x0;var _0x2bcc58=_0x9fe1[_0xfaf73a];return _0x2bcc58;};'use strict';var util=require(_0x19fe('0x0'));var _=require(_0x19fe('0x1'));var moment=require(_0x19fe('0x2'));var BPromise=require(_0x19fe('0x3'));var hardware=require(_0x19fe('0x4'));var encryptor=require(_0x19fe('0x5'));var db=require(_0x19fe('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x19fe('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x19fe('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x19fe('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x19fe('0x9'),'machineUuid':hardware[_0x19fe('0xa')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x51cbf0){return new BPromise(function(_0x5672db,_0x54b57b){return db['License']['find'](_['defaults'](_0x51cbf0,{'raw':!![],'where':{'id':0x1}}))[_0x19fe('0xb')](function(_0x4bbc72){return checkLicense(_0x4bbc72,null);})[_0x19fe('0xb')](function(_0x42f41b){_0x5672db(_0x42f41b);return;})[_0x19fe('0xc')](function(_0x6a37a8){_0x54b57b(_0x6a37a8);});});}function checkLicense(_0x561b5d,_0x24dfc9){if(!_0x561b5d){demoLicense[_0x19fe('0xd')]=_0x561b5d[_0x19fe('0xe')];return demoLicense;}try{var _0x5d4a21=_0x24dfc9||_0x561b5d[_0x19fe('0xf')];if(_[_0x19fe('0x10')](_0x5d4a21)){throw new Error(_0x19fe('0x11'));}var _0x5bcc2d=_0x561b5d[_0x19fe('0xe')];var _0x40cac4=_0x561b5d[_0x19fe('0x12')];var _0x53089a=_0x5bcc2d['split']('-')[0x4];var _0x3139b4=_0x5bcc2d['split']('-')[0x0];var _0x1d5b24=encryptor[_0x19fe('0x13')](_0x5d4a21,util[_0x19fe('0x14')]('%s:%s:%s',_0x53089a,_0x5bcc2d,_0x3139b4));var _0x2bb3b4=JSON['parse'](_0x1d5b24);_0x2bb3b4[_0x19fe('0x15')]=![];_0x2bb3b4[_0x19fe('0xd')]=_0x5bcc2d;_0x2bb3b4[_0x19fe('0x16')]=hardware[_0x19fe('0xa')]();if(_0x40cac4){var _0x35482c=encryptor['decryptString'](_0x40cac4);_0x2bb3b4['gray']=_0x35482c;_0x2bb3b4[_0x19fe('0x17')]=moment(_0x35482c)[_0x19fe('0x18')](0x7,_0x19fe('0x19'))[_0x19fe('0x14')]();_0x2bb3b4[_0x19fe('0x1a')]=_0x2bb3b4['uuid']!=_0x2bb3b4[_0x19fe('0x16')]?_0x19fe('0x1b'):_0x19fe('0x1c');}return _0x2bb3b4;}catch(_0x149be0){breakingLicense[_0x19fe('0xd')]=_0x561b5d[_0x19fe('0xe')];breakingLicense[_0x19fe('0x1d')]=_0x149be0[_0x19fe('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x48dc1b,_0x12e841){getLicense()[_0x19fe('0xb')](function(_0x5d2e01){return db[_0x19fe('0x1e')]['findAll']({'attributes':[_0x19fe('0x1f'),[db[_0x19fe('0x20')]['fn'](_0x19fe('0x21'),db['sequelize'][_0x19fe('0x22')]('role')),'count']],'group':'role','where':{'role':{'$or':['admin','user',_0x19fe('0x23')]}},'raw':!![]})['then'](function(_0x2b25f6){var _0x1fc836={'user':_0x5d2e01[_0x19fe('0x24')]||0x0,'telephone':_0x5d2e01['telephones']||0x0};_0x2b25f6[_0x19fe('0x25')](function(_0x3805c9){var _0x3ef9b2=_0x3805c9['role']===_0x19fe('0x26')?_0x19fe('0x27'):_0x3805c9[_0x19fe('0x1f')];_0x1fc836[_0x3ef9b2]-=_0x3805c9[_0x19fe('0x28')];if(_0x1fc836[_0x3ef9b2]<0x0)_0x1fc836[_0x3ef9b2]=0x0;});_0x48dc1b(_0x1fc836);return;});})[_0x19fe('0xc')](function(_0xb4c623){_0x12e841(_0xb4c623);});});}function checkUserLimits(_0x6b6cbc){return new BPromise(function(_0x314cd3,_0x4e22f3){getLimits()[_0x19fe('0xb')](function(_0x331443){var _0x5d8310=_[_0x19fe('0x29')](_[_0x19fe('0x2a')](_0x6b6cbc,_0x19fe('0x1f')),[_0x19fe('0x26'),_0x19fe('0x27'),_0x19fe('0x23')]);var _0x5cd26f=(_0x5d8310[_0x19fe('0x26')]||0x0)+(_0x5d8310['user']||0x0);var _0x108b5c=_0x5d8310['telephone']||0x0;if(_0x5cd26f>_0x331443[_0x19fe('0x27')])return _0x4e22f3(_0x19fe('0x2b'));if(_0x108b5c>_0x331443[_0x19fe('0x23')])return _0x4e22f3(_0x19fe('0x2c'));return _0x314cd3();})['catch'](function(_0x58b73b){_0x4e22f3(_0x58b73b);});});}module[_0x19fe('0x2d')]={'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 023f028..71cd6ae 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 _0x6d11=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x42bb6c,_0x434ce2){var _0x257308=function(_0x3cbdaa){while(--_0x3cbdaa){_0x42bb6c['push'](_0x42bb6c['shift']());}};_0x257308(++_0x434ce2);}(_0x6d11,0xbf));var _0x16d1=function(_0x35e87f,_0x4fbd56){_0x35e87f=_0x35e87f-0x0;var _0x3dab4e=_0x6d11[_0x35e87f];return _0x3dab4e;};'use strict';module[_0x16d1('0x0')]={'DOMAIN':_0x16d1('0x1'),'SESSION_SECRET':_0x16d1('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x16d1('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x47c5=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x30c66d,_0x69767c){var _0x5c4ad1=function(_0x11e8cd){while(--_0x11e8cd){_0x30c66d['push'](_0x30c66d['shift']());}};_0x5c4ad1(++_0x69767c);}(_0x47c5,0x165));var _0x547c=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0x47c5[_0x4b0290];return _0x4bd9f4;};'use strict';module[_0x547c('0x0')]={'DOMAIN':_0x547c('0x1'),'SESSION_SECRET':_0x547c('0x2'),'GOOGLE_ID':_0x547c('0x3'),'GOOGLE_SECRET':_0x547c('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index abac512..075b8ae 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b3d=['{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','%s-%s','error','info','Console','moment','winston','util','path','INFO','join','/var','xcally','message','replace'];(function(_0x867da2,_0x2d7c8b){var _0x160ea9=function(_0x4fe57c){while(--_0x4fe57c){_0x867da2['push'](_0x867da2['shift']());}};_0x160ea9(++_0x2d7c8b);}(_0x4b3d,0x1c4));var _0xd4b3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4b3d[_0x13d07a];return _0x5ee0ee;};'use strict';var moment=require(_0xd4b3('0x0'));var winston=require(_0xd4b3('0x1'));var util=require(_0xd4b3('0x2'));var path=require(_0xd4b3('0x3'));var debugLevel=_0xd4b3('0x4');function filename(_0x9e49c5,_0x5090fe){return path[_0xd4b3('0x5')](_0xd4b3('0x6'),'log',_0xd4b3('0x7'),util['format']('%s-%s.log',_0x9e49c5,_0x5090fe));}function formatter(_0x555125,_0x214e63){_0x214e63[_0xd4b3('0x8')]=_0x214e63[_0xd4b3('0x8')][_0xd4b3('0x9')](/@@{/g,_0xd4b3('0xa'))[_0xd4b3('0x9')](/}@@/g,_0xd4b3('0xb'))['replace'](/@{/g,'{{')[_0xd4b3('0x9')](/}@/g,'}}');return util[_0xd4b3('0xc')](_0xd4b3('0xd'),moment()[_0xd4b3('0xc')](_0xd4b3('0xe')),_0x214e63[_0xd4b3('0xf')]['toUpperCase'](),_0x555125,_0x214e63['message']);}module['exports']=function(_0x1dfe0a){return new winston[(_0xd4b3('0x10'))]({'transports':[new winston[(_0xd4b3('0x11'))]['File']({'name':util[_0xd4b3('0xc')](_0xd4b3('0x12'),_0x1dfe0a,_0xd4b3('0x13')),'filename':filename(_0x1dfe0a,_0xd4b3('0x13')),'level':_0xd4b3('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c05f3){return formatter(_0x1dfe0a,_0x5c05f3);}}),new winston[(_0xd4b3('0x11'))]['File']({'name':util[_0xd4b3('0xc')](_0xd4b3('0x12'),_0x1dfe0a,_0xd4b3('0x14')),'filename':filename(_0x1dfe0a,_0xd4b3('0x14')),'level':_0xd4b3('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x48f4bd){return formatter(_0x1dfe0a,_0x48f4bd);}}),new winston[(_0xd4b3('0x11'))][(_0xd4b3('0x15'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0xaec416){return formatter(_0x1dfe0a,_0xaec416);}})]});}; \ No newline at end of file +var _0xc6b4=['join','log','xcally','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','moment','winston','util','path','INFO'];(function(_0x76a7ae,_0x490d47){var _0x12eeb4=function(_0x237f15){while(--_0x237f15){_0x76a7ae['push'](_0x76a7ae['shift']());}};_0x12eeb4(++_0x490d47);}(_0xc6b4,0x97));var _0x4c6b=function(_0x500812,_0x296a3c){_0x500812=_0x500812-0x0;var _0x4add02=_0xc6b4[_0x500812];return _0x4add02;};'use strict';var moment=require(_0x4c6b('0x0'));var winston=require(_0x4c6b('0x1'));var util=require(_0x4c6b('0x2'));var path=require(_0x4c6b('0x3'));var debugLevel=_0x4c6b('0x4');function filename(_0x464273,_0x43240e){return path[_0x4c6b('0x5')]('/var',_0x4c6b('0x6'),_0x4c6b('0x7'),util[_0x4c6b('0x8')]('%s-%s.log',_0x464273,_0x43240e));}function formatter(_0xb88397,_0x51e5b3){_0x51e5b3[_0x4c6b('0x9')]=_0x51e5b3['message'][_0x4c6b('0xa')](/@@{/g,_0x4c6b('0xb'))['replace'](/}@@/g,_0x4c6b('0xc'))['replace'](/@{/g,'{{')[_0x4c6b('0xa')](/}@/g,'}}');return util[_0x4c6b('0x8')](_0x4c6b('0xd'),moment()[_0x4c6b('0x8')](_0x4c6b('0xe')),_0x51e5b3[_0x4c6b('0xf')][_0x4c6b('0x10')](),_0xb88397,_0x51e5b3[_0x4c6b('0x9')]);}module[_0x4c6b('0x11')]=function(_0x348cc2){return new winston[(_0x4c6b('0x12'))]({'transports':[new winston[(_0x4c6b('0x13'))][(_0x4c6b('0x14'))]({'name':util[_0x4c6b('0x8')](_0x4c6b('0x15'),_0x348cc2,_0x4c6b('0x16')),'filename':filename(_0x348cc2,_0x4c6b('0x16')),'level':_0x4c6b('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x317c88){return formatter(_0x348cc2,_0x317c88);}}),new winston[(_0x4c6b('0x13'))]['File']({'name':util[_0x4c6b('0x8')](_0x4c6b('0x15'),_0x348cc2,_0x4c6b('0x17')),'filename':filename(_0x348cc2,_0x4c6b('0x17')),'level':_0x4c6b('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3d35ba){return formatter(_0x348cc2,_0x3d35ba);}}),new winston[(_0x4c6b('0x13'))][(_0x4c6b('0x18'))]({'level':process[_0x4c6b('0x19')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x38bdb6){return formatter(_0x348cc2,_0x38bdb6);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5b5294b..0d6cf07 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 _0xdcee=['join','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','email'];(function(_0x17c8ec,_0x1c88ff){var _0x16753d=function(_0x39fd84){while(--_0x39fd84){_0x17c8ec['push'](_0x17c8ec['shift']());}};_0x16753d(++_0x1c88ff);}(_0xdcee,0xcb));var _0xedce=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0xdcee[_0x53e3fa];return _0xe8584a;};'use strict';var path=require(_0xedce('0x0'));var os=require('os');var config={'apps':[{'name':_0xedce('0x1'),'script':path['join'](__dirname,_0xedce('0x2'))},{'name':_0xedce('0x3'),'script':path['join'](__dirname,_0xedce('0x4'))},{'name':_0xedce('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xedce('0x6'),'script':path[_0xedce('0x7')](__dirname,_0xedce('0x8'))},{'name':_0xedce('0x9'),'script':path[_0xedce('0x7')](__dirname,_0xedce('0xa'))},{'name':_0xedce('0xb'),'script':path['join'](__dirname,_0xedce('0xc'))}]};module[_0xedce('0xd')]=config; \ No newline at end of file +var _0x43d6=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','ami','agi','../../services/agi/index.js','../../services/email/index.js','routing'];(function(_0x508a4c,_0xd4d5cc){var _0x4d77c0=function(_0x1c110d){while(--_0x1c110d){_0x508a4c['push'](_0x508a4c['shift']());}};_0x4d77c0(++_0xd4d5cc);}(_0x43d6,0x1d8));var _0x643d=function(_0x1df731,_0x3d5b08){_0x1df731=_0x1df731-0x0;var _0x33fa1e=_0x43d6[_0x1df731];return _0x33fa1e;};'use strict';var path=require(_0x643d('0x0'));var os=require('os');var config={'apps':[{'name':_0x643d('0x1'),'script':path[_0x643d('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x643d('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x643d('0x4'),'script':path['join'](__dirname,_0x643d('0x5'))},{'name':'email','script':path[_0x643d('0x2')](__dirname,_0x643d('0x6'))},{'name':_0x643d('0x7'),'script':path['join'](__dirname,_0x643d('0x8'))},{'name':_0x643d('0x9'),'script':path[_0x643d('0x2')](__dirname,_0x643d('0xa'))}]};module[_0x643d('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c3d1e1b..94cec68 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 _0x5029=['start','disconnect','stop','restart','describe','delete','dump','saved','bluebird','connect','connected','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5029,0x68));var _0x9502=function(_0x12ec39,_0x2cd90e){_0x12ec39=_0x12ec39-0x0;var _0x54c1ef=_0x5029[_0x12ec39];return _0x54c1ef;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9502('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x3fa031,_0x593a76){return pm2[_0x9502('0x1')](function(_0x16b5b9){if(_0x16b5b9){return _0x593a76(_0x16b5b9);}return _0x3fa031(_0x9502('0x2'));});});};exports['start']=function(_0x558048){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0x5b0e75,_0xe9f7ee){return pm2[_0x9502('0x4')](_0x558048,function(_0x3f97b3,_0x1cb791){if(_0x3f97b3){return _0xe9f7ee(_0x3f97b3);}pm2[_0x9502('0x5')]();return _0x5b0e75(_0x1cb791);});});});};exports[_0x9502('0x6')]=function(_0x222c1c){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0x5ab01c,_0x465c8f){return pm2[_0x9502('0x6')](_0x222c1c,function(_0x3454ba,_0x1559df){if(_0x3454ba){return _0x465c8f(_0x3454ba);}pm2[_0x9502('0x5')]();return _0x5ab01c(_0x1559df);});});});};exports[_0x9502('0x7')]=function(_0x4c716b){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0xcceea,_0x4d87db){return pm2[_0x9502('0x7')](_0x4c716b,function(_0x398385,_0x5da87a){if(_0x398385){return _0x4d87db(_0x398385);}pm2[_0x9502('0x5')]();return _0xcceea(_0x5da87a);});});});};exports['list']=function(){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0x2b2f18,_0xfe82a1){return pm2['list'](function(_0x203144,_0x21e879){if(_0x203144){return _0xfe82a1(_0x203144);}pm2['disconnect']();return _0x2b2f18(_0x21e879);});});});};exports[_0x9502('0x8')]=function(_0x18adbb){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0x54e886,_0x2d55f5){return pm2[_0x9502('0x8')](_0x18adbb,function(_0x393778,_0x4ea172){if(_0x393778){return _0x2d55f5(_0x393778);}pm2[_0x9502('0x5')]();return _0x54e886(_0x4ea172);});});});};exports[_0x9502('0x9')]=function(_0xfa14fe){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0x5153fa,_0x5e7e1b){return pm2[_0x9502('0x9')](_0xfa14fe,function(_0x1bad23,_0xae8350){if(_0x1bad23){return _0x5e7e1b(_0x1bad23);}pm2[_0x9502('0x5')]();return _0x5153fa(_0xae8350);});});});};exports[_0x9502('0xa')]=function(){return connect()[_0x9502('0x3')](function(){return new BPromise(function(_0x10c3db,_0x8a9be4){return pm2['dump'](function(_0x519830){if(_0x519830){return _0x8a9be4(_0x519830);}return _0x10c3db(_0x9502('0xb'));});});});}; \ No newline at end of file +var _0x8950=['list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then','disconnect','restart'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x8950,0x13c));var _0x0895=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8950[_0x3947c9];return _0x2e7871;};'use strict';var pm2=require(_0x0895('0x0'));var BPromise=require(_0x0895('0x1'));var config=require(_0x0895('0x2'));function connect(){return new BPromise(function(_0x36c162,_0x36627b){return pm2[_0x0895('0x3')](function(_0x2788cc){if(_0x2788cc){return _0x36627b(_0x2788cc);}return _0x36c162(_0x0895('0x4'));});});};exports[_0x0895('0x5')]=function(_0x55136d){return connect()[_0x0895('0x6')](function(){return new BPromise(function(_0x574e09,_0x4b7760){return pm2['start'](_0x55136d,function(_0x57bfff,_0x13d7f2){if(_0x57bfff){return _0x4b7760(_0x57bfff);}pm2[_0x0895('0x7')]();return _0x574e09(_0x13d7f2);});});});};exports['stop']=function(_0x38ae65){return connect()[_0x0895('0x6')](function(){return new BPromise(function(_0x54cd92,_0x2217ea){return pm2['stop'](_0x38ae65,function(_0x34cd61,_0x7ebaf3){if(_0x34cd61){return _0x2217ea(_0x34cd61);}pm2[_0x0895('0x7')]();return _0x54cd92(_0x7ebaf3);});});});};exports[_0x0895('0x8')]=function(_0x144e3c){return connect()[_0x0895('0x6')](function(){return new BPromise(function(_0x9811c1,_0x3c867b){return pm2[_0x0895('0x8')](_0x144e3c,function(_0x3c03e6,_0x4f99b7){if(_0x3c03e6){return _0x3c867b(_0x3c03e6);}pm2[_0x0895('0x7')]();return _0x9811c1(_0x4f99b7);});});});};exports[_0x0895('0x9')]=function(){return connect()[_0x0895('0x6')](function(){return new BPromise(function(_0x1c115c,_0xd0790c){return pm2[_0x0895('0x9')](function(_0x1d8efe,_0x320262){if(_0x1d8efe){return _0xd0790c(_0x1d8efe);}pm2[_0x0895('0x7')]();return _0x1c115c(_0x320262);});});});};exports[_0x0895('0xa')]=function(_0xfb6a7e){return connect()[_0x0895('0x6')](function(){return new BPromise(function(_0x474842,_0x8e4749){return pm2[_0x0895('0xa')](_0xfb6a7e,function(_0x423a00,_0x22aa4c){if(_0x423a00){return _0x8e4749(_0x423a00);}pm2[_0x0895('0x7')]();return _0x474842(_0x22aa4c);});});});};exports[_0x0895('0xb')]=function(_0x3863fa){return connect()['then'](function(){return new BPromise(function(_0x3c9ea4,_0x2bb0ca){return pm2[_0x0895('0xb')](_0x3863fa,function(_0x1418c7,_0x5bee36){if(_0x1418c7){return _0x2bb0ca(_0x1418c7);}pm2[_0x0895('0x7')]();return _0x3c9ea4(_0x5bee36);});});});};exports[_0x0895('0xc')]=function(){return connect()[_0x0895('0x6')](function(){return new BPromise(function(_0x2d9810,_0x21e1ea){return pm2[_0x0895('0xc')](function(_0x30b0fd){if(_0x30b0fd){return _0x21e1ea(_0x30b0fd);}return _0x2d9810('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 6a688c1..7fa8494 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 _0x5887=['redis','defaults','localhost','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5887,0xf1));var _0x7588=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x5887[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0x7588('0x0'));var moment=require(_0x7588('0x1'));var Redis=require(_0x7588('0x2'));var util=require(_0x7588('0x3'));var config=require(_0x7588('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x7588('0x5'))(_0x7588('0x6'));config[_0x7588('0x7')]=_[_0x7588('0x8')](config['redis'],{'host':_0x7588('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7588('0x7')]));function closeInteractions(){var _0x1d2705=0x0;var _0x459bab=[];return db['Setting'][_0x7588('0xa')]({'raw':!![],'attributes':['id',_0x7588('0xb')],'where':{'id':0x1}})[_0x7588('0xc')](function(_0x950339){_0x1d2705=_0x950339['chatTimeout'];if(_0x1d2705){return db[_0x7588('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x7588('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7588('0xf')](_0x950339[_0x7588('0xb')],_0x7588('0x10'))}}});}else{return[];}})[_0x7588('0xc')](function(_0x52df0b){if(_0x52df0b&&_0x52df0b[_0x7588('0x11')]){_0x459bab=_['map'](_0x52df0b||[],'id');logger['info'](_0x7588('0x12'),_0x459bab[_0x7588('0x13')]());return db[_0x7588('0xd')][_0x7588('0x14')]({'closeReason':'system','disposition':_0x7588('0x15'),'closed':!![],'closedAt':moment()[_0x7588('0x16')](_0x7588('0x17'))},{'where':{'id':_0x459bab}});}})[_0x7588('0xc')](function(){if(_0x459bab&&_0x459bab[_0x7588('0x11')]){logger[_0x7588('0x18')](_0x7588('0x19'),_0x459bab[_0x7588('0x13')]());for(var _0x1f8c46=0x0;_0x1f8c46<_0x459bab[_0x7588('0x11')];_0x1f8c46++){io['emit'](_0x7588('0x1a'),{'id':_0x459bab[_0x1f8c46],'closed':!![]});}}})['catch'](function(_0x5d7f25){logger[_0x7588('0x1b')](_0x7588('0x1c'),_0x5d7f25?util[_0x7588('0x1d')](_0x5d7f25,{'showHidden':![],'depth':null}):'');});}exports[_0x7588('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7a8a=['ChatInteraction','findAll','lastMsgAt','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then'];(function(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0x7a8a,0x144));var _0xa7a8=function(_0x2e84ac,_0x3b7a03){_0x2e84ac=_0x2e84ac-0x0;var _0x20153f=_0x7a8a[_0x2e84ac];return _0x20153f;};'use strict';var _=require(_0xa7a8('0x0'));var moment=require('moment');var Redis=require(_0xa7a8('0x1'));var util=require('util');var config=require(_0xa7a8('0x2'));var db=require(_0xa7a8('0x3'))['db'];var logger=require(_0xa7a8('0x4'))('schedule');config[_0xa7a8('0x5')]=_[_0xa7a8('0x6')](config[_0xa7a8('0x5')],{'host':_0xa7a8('0x7'),'port':0x18eb});var io=require(_0xa7a8('0x8'))(new Redis(config[_0xa7a8('0x5')]));function closeInteractions(){var _0x290cad=0x0;var _0x5e18b9=[];return db[_0xa7a8('0x9')]['find']({'raw':!![],'attributes':['id',_0xa7a8('0xa')],'where':{'id':0x1}})[_0xa7a8('0xb')](function(_0x3874bd){_0x290cad=_0x3874bd['chatTimeout'];if(_0x290cad){return db[_0xa7a8('0xc')][_0xa7a8('0xd')]({'raw':!![],'attributes':['id',_0xa7a8('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3874bd['chatTimeout'],_0xa7a8('0xf'))}}});}else{return[];}})[_0xa7a8('0xb')](function(_0x36a456){if(_0x36a456&&_0x36a456[_0xa7a8('0x10')]){_0x5e18b9=_['map'](_0x36a456||[],'id');logger['info'](_0xa7a8('0x11'),_0x5e18b9[_0xa7a8('0x12')]());return db[_0xa7a8('0xc')][_0xa7a8('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xa7a8('0x14'))},{'where':{'id':_0x5e18b9}});}})[_0xa7a8('0xb')](function(){if(_0x5e18b9&&_0x5e18b9[_0xa7a8('0x10')]){logger['info'](_0xa7a8('0x15'),_0x5e18b9[_0xa7a8('0x12')]());for(var _0x2621a2=0x0;_0x2621a2<_0x5e18b9['length'];_0x2621a2++){io[_0xa7a8('0x16')]('chatInteraction:update',{'id':_0x5e18b9[_0x2621a2],'closed':!![]});}}})[_0xa7a8('0x17')](function(_0x2f9835){logger[_0xa7a8('0x18')](_0xa7a8('0x19'),_0x2f9835?util[_0xa7a8('0x1a')](_0x2f9835,{'showHidden':![],'depth':null}):'');});}exports[_0xa7a8('0x1b')]=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 fdbfcc6..61e5cac 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 _0x2a93=['exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','keys','jobs','toString','keyBy','difference','intersection','length','stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','add\x20cron','exists','update','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','service','host','Smtp','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','subtractNumber','join','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2a93,0x17f));var _0x32a9=function(_0x508835,_0x80e24b){_0x508835=_0x508835-0x0;var _0x5b8e84=_0x2a93[_0x508835];return _0x5b8e84;};'use strict';var fs=require('fs');var util=require(_0x32a9('0x0'));var path=require(_0x32a9('0x1'));var _=require(_0x32a9('0x2'));var moment=require(_0x32a9('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x32a9('0x4'))(_0x32a9('0x5'));var db=require(_0x32a9('0x6'))['db'];var analyticCustomReportController=require(_0x32a9('0x7'));var analyticDefaultReportController=require(_0x32a9('0x8'));var client=jayson[_0x32a9('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4fdb6c,_0x141572){return function(){logger['info'](_0x32a9('0xa'),_0x4fdb6c['email']);var _0x3f5b0e=!![];var _0x5a575f={'tls':{'rejectUnauthorized':![]}};if(_0x4fdb6c[_0x32a9('0xb')]['Smtp'][_0x32a9('0xc')]){_0x5a575f[_0x32a9('0xc')]=_0x4fdb6c[_0x32a9('0xb')]['Smtp'][_0x32a9('0xc')];}else{_0x5a575f[_0x32a9('0xd')]=_0x4fdb6c[_0x32a9('0xb')][_0x32a9('0xe')][_0x32a9('0xd')];_0x5a575f[_0x32a9('0xf')]=_0x4fdb6c['MailAccount'][_0x32a9('0xe')]['port'];_0x5a575f[_0x32a9('0x10')]=_0x4fdb6c[_0x32a9('0xb')]['Smtp'][_0x32a9('0x10')];}if(_0x4fdb6c[_0x32a9('0xb')][_0x32a9('0xe')][_0x32a9('0x11')]){_0x5a575f[_0x32a9('0x12')]={'user':_0x4fdb6c[_0x32a9('0xb')][_0x32a9('0xe')][_0x32a9('0x13')],'pass':_0x4fdb6c[_0x32a9('0xb')][_0x32a9('0xe')][_0x32a9('0x14')]};}var _0x50002a={'account':_0x5a575f,'message':{'from':util[_0x32a9('0x15')](_0x32a9('0x16'),_0x4fdb6c[_0x32a9('0xb')][_0x32a9('0x17')],_0x4fdb6c[_0x32a9('0xb')][_0x32a9('0x18')]||_0x4fdb6c[_0x32a9('0xb')]['Smtp']['user']),'to':_0x4fdb6c['email'],'cc':_0x4fdb6c['cc'],'bcc':_0x4fdb6c[_0x32a9('0x19')],'subject':util[_0x32a9('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x141572[_0x32a9('0x17')],_0x4fdb6c[_0x32a9('0x1a')],_0x4fdb6c['subtractUnit'])}};var _0x1788c3=path[_0x32a9('0x1b')](__dirname,'../../files/reports');var _0x5d19c0=_0x141572[_0x32a9('0x1c')];var _0x1d0454=util[_0x32a9('0x15')]('%s.%s',path['basename'](_0x141572[_0x32a9('0x1c')],path[_0x32a9('0x1d')](_0x141572['savename'])),_0x32a9('0x1e'));var _0x2985b7=path[_0x32a9('0x1b')](_0x1788c3,_0x5d19c0);var _0x13f70e=path[_0x32a9('0x1b')](_0x1788c3,_0x1d0454);if(fs[_0x32a9('0x1f')](_0x2985b7)){_0x141572[_0x32a9('0x20')]=_0x32a9('0x21');_0x50002a[_0x32a9('0x22')][_0x32a9('0x23')]=[{'filename':_0x5d19c0,'path':_0x2985b7}];_0x50002a[_0x32a9('0x22')][_0x32a9('0x24')]=util[_0x32a9('0x15')](_0x32a9('0x25'),JSON[_0x32a9('0x26')](_0x141572,null,0x2));}else if(fs[_0x32a9('0x1f')](_0x13f70e)){_0x141572[_0x32a9('0x20')]=_0x32a9('0x21');_0x50002a[_0x32a9('0x22')][_0x32a9('0x23')]=[{'filename':_0x1d0454,'path':_0x13f70e}];}else{_0x50002a[_0x32a9('0x22')]['text']=_0x32a9('0x27');if(!_0x4fdb6c[_0x32a9('0x28')]){_0x3f5b0e=![];logger[_0x32a9('0x29')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3f5b0e){return client[_0x32a9('0x2a')](_0x32a9('0x2b'),_0x50002a)['then'](function(_0x2bc43a){if(_0x2bc43a[_0x32a9('0x2c')]){return logger[_0x32a9('0x2c')](_0x32a9('0x2d'),JSON[_0x32a9('0x26')](_0x2bc43a));}return logger['info'](_0x32a9('0x2e'));})[_0x32a9('0x2f')](function(_0xba6da){return logger[_0x32a9('0x2c')](_0x32a9('0x2d'),JSON[_0x32a9('0x26')](_0xba6da));});}};}function handleError(){return function(_0x5b9e96){return logger[_0x32a9('0x2c')](JSON[_0x32a9('0x26')](_0x5b9e96));};}function handleResult(_0x1a89b3){return function(_0x3a69ee){logger[_0x32a9('0x29')]('data',JSON[_0x32a9('0x26')](_0x3a69ee));if(_0x1a89b3['MailAccount']&&_0x1a89b3['MailAccount'][_0x32a9('0xe')]&&!_[_0x32a9('0x30')](_0x1a89b3[_0x32a9('0x18')])){setTimeout(handleSendEmail(_0x1a89b3,_0x3a69ee),0x3c*0x3e8);}};}function handleJob(_0x2093c5){return function(){try{if(_[_0x32a9('0x30')](_0x2093c5[_0x32a9('0x1a')])){return logger['info'](_0x32a9('0x31'));}if(_[_0x32a9('0x30')](_0x2093c5[_0x32a9('0x32')])){return logger['info'](_0x32a9('0x33'));}var _0x2a6fba={'startDate':moment()[_0x32a9('0x34')](_0x2093c5['subtractNumber'],_0x2093c5['subtractUnit'])[_0x32a9('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x32a9('0x15')](_0x32a9('0x35')),'type':_0x32a9('0x36'),'output':_0x2093c5[_0x32a9('0x37')],'name':_0x2093c5[_0x32a9('0x17')]};if(!_[_0x32a9('0x30')](_0x2093c5[_0x32a9('0x38')])){logger[_0x32a9('0x29')](_0x32a9('0x39'),_0x2093c5[_0x32a9('0x38')]);return analyticDefaultReportController[_0x32a9('0x3a')]({'id':_0x2093c5[_0x32a9('0x38')]},_0x2a6fba)[_0x32a9('0x3b')](handleResult(_0x2093c5))[_0x32a9('0x2f')](handleError());}if(!_[_0x32a9('0x30')](_0x2093c5[_0x32a9('0x3c')])){logger[_0x32a9('0x29')](_0x32a9('0x3d'),_0x2093c5['CustomReportId']);return analyticCustomReportController[_0x32a9('0x3a')]({'id':_0x2093c5[_0x32a9('0x3c')]},_0x2a6fba)[_0x32a9('0x3b')](handleResult(_0x2093c5))[_0x32a9('0x2f')](handleError());}}catch(_0x1bba5f){logger[_0x32a9('0x2c')](JSON['stringify'](_0x1bba5f));}return logger[_0x32a9('0x29')](_0x32a9('0x3e'));};}function getJobs(_0x2e1f53){var _0xbe9127={};if(_0x2e1f53){_0xbe9127['id']=_0x2e1f53;}return db[_0x32a9('0x3f')]['findAll']({'where':_0xbe9127,'include':[{'model':db['MailAccount'],'attributes':['id',_0x32a9('0x17'),_0x32a9('0x18')],'include':[{'model':db['MailServerOut'],'as':_0x32a9('0xe')}]}]})[_0x32a9('0x3b')](function(_0x1f45b4){var _0x5329f9=_[_0x32a9('0x40')](manager[_0x32a9('0x41')]);var _0x5b1fa6=_['map'](_0x1f45b4,function(_0x1a2621){return _0x1a2621['id'][_0x32a9('0x42')]();});var _0x2f3246=_[_0x32a9('0x43')](_0x1f45b4,function(_0x1e4e2c){return _0x1e4e2c['id'][_0x32a9('0x42')]();});var _0x2fde62=_0x2e1f53?_0x5b1fa6:_[_0x32a9('0x44')](_0x5b1fa6,_0x5329f9);var _0x138901=_[_0x32a9('0x45')](_0x5b1fa6,_0x5329f9);var _0x44c4cf=_[_0x32a9('0x44')](_0x5329f9,_0x5b1fa6);var _0x28ce07;var _0x82a293;for(_0x28ce07=0x0;_0x28ce07<_0x44c4cf[_0x32a9('0x46')]&&!_0x2e1f53;_0x28ce07+=0x1){_0x82a293=_0x44c4cf[_0x28ce07]['toString']();if(manager['exists'](_0x82a293)){manager[_0x32a9('0x47')](_0x82a293);manager[_0x32a9('0x48')](_0x82a293);logger[_0x32a9('0x29')]('delete\x20cron',_0x82a293);}}logger[_0x32a9('0x29')](_0x32a9('0x49'),JSON[_0x32a9('0x26')](_0x2fde62));for(_0x28ce07=0x0;_0x28ce07<_0x2fde62['length'];_0x28ce07+=0x1){_0x82a293=_0x2fde62[_0x28ce07][_0x32a9('0x42')]();logger['info'](_0x32a9('0x4a'),_0x82a293);if(_0x2e1f53){logger[_0x32a9('0x29')](_0x32a9('0x4b'),_0x2e1f53);logger[_0x32a9('0x29')](JSON['stringify'](_0x2f3246[_0x82a293]));BPromise[_0x32a9('0x4c')]()[_0x32a9('0x3b')](handleJob(_0x2f3246[_0x82a293]));logger[_0x32a9('0x29')](_0x32a9('0x4d'),_0x2f3246[_0x82a293][_0x32a9('0x17')],_0x2f3246[_0x82a293]['cron']);}else if(_0x2f3246[_0x82a293][_0x32a9('0x4e')]&&_0x2f3246[_0x82a293][_0x32a9('0x4f')]&&moment()[_0x32a9('0x50')](_0x2f3246[_0x82a293]['startAt'],_0x2f3246[_0x82a293]['endAt'])){manager['add'](_0x82a293,_0x2f3246[_0x82a293][_0x32a9('0x4e')],handleJob(_0x2f3246[_0x82a293]));manager['start'](_0x82a293);logger[_0x32a9('0x29')](_0x32a9('0x51'),_0x2f3246[_0x82a293]['name'],_0x2f3246[_0x82a293][_0x32a9('0x4e')]);}else if(manager[_0x32a9('0x52')](_0x82a293)){manager[_0x32a9('0x47')](_0x82a293);manager['deleteJob'](_0x82a293);logger['info']('stop\x20cron',_0x2f3246[_0x82a293][_0x32a9('0x17')],_0x2f3246[_0x82a293]['cron']);}}for(_0x28ce07=0x0,_0x82a293;_0x28ce07<_0x138901['length']&&!_0x2e1f53;_0x28ce07+=0x1){_0x82a293=_0x138901[_0x28ce07][_0x32a9('0x42')]();if(manager[_0x32a9('0x52')](_0x82a293)){if(_0x2f3246[_0x82a293][_0x32a9('0x4e')]&&_0x2f3246[_0x82a293][_0x32a9('0x4f')]&&moment()[_0x32a9('0x50')](_0x2f3246[_0x82a293]['startAt'],_0x2f3246[_0x82a293]['endAt'])){manager[_0x32a9('0x53')](_0x82a293,_0x2f3246[_0x82a293]['cron'],handleJob(_0x2f3246[_0x82a293]));logger[_0x32a9('0x29')](_0x32a9('0x54'),_0x2f3246[_0x82a293][_0x32a9('0x17')],_0x2f3246[_0x82a293][_0x32a9('0x4e')]);}else{manager[_0x32a9('0x47')](_0x82a293);manager[_0x32a9('0x48')](_0x82a293);logger['info'](_0x32a9('0x55'),_0x2f3246[_0x82a293]['name'],_0x2f3246[_0x82a293][_0x32a9('0x4e')]);}}}})[_0x32a9('0x2f')](function(_0x3002cd){logger[_0x32a9('0x2c')](JSON['stringify'](_0x3002cd));});}exports[_0x32a9('0x56')]=function(_0x2f20fd){return getJobs(_0x2f20fd);};exports[_0x32a9('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x468d=['subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','then','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','add\x20cron','active','update','update\x20cron','stop\x20cron','run','start','util','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','service','Smtp','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','catch','isNil','email'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x468d,0x195));var _0xd468=function(_0x57307e,_0x32dda3){_0x57307e=_0x57307e-0x0;var _0x338d80=_0x468d[_0x57307e];return _0x338d80;};'use strict';var fs=require('fs');var util=require(_0xd468('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0xd468('0x1'));var CronJobManager=require(_0xd468('0x2'));var jayson=require(_0xd468('0x3'));var BPromise=require(_0xd468('0x4'));var logger=require(_0xd468('0x5'))(_0xd468('0x6'));var db=require(_0xd468('0x7'))['db'];var analyticCustomReportController=require(_0xd468('0x8'));var analyticDefaultReportController=require(_0xd468('0x9'));var client=jayson[_0xd468('0xa')][_0xd468('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x31457f,_0xf84003){return function(){logger[_0xd468('0xc')](_0xd468('0xd'),_0x31457f['email']);var _0x2d61a5=!![];var _0x375a12={'tls':{'rejectUnauthorized':![]}};if(_0x31457f[_0xd468('0xe')]['Smtp'][_0xd468('0xf')]){_0x375a12[_0xd468('0xf')]=_0x31457f[_0xd468('0xe')][_0xd468('0x10')][_0xd468('0xf')];}else{_0x375a12[_0xd468('0x11')]=_0x31457f[_0xd468('0xe')][_0xd468('0x10')]['host'];_0x375a12[_0xd468('0x12')]=_0x31457f['MailAccount'][_0xd468('0x10')][_0xd468('0x12')];_0x375a12[_0xd468('0x13')]=_0x31457f[_0xd468('0xe')][_0xd468('0x10')][_0xd468('0x13')];}if(_0x31457f[_0xd468('0xe')][_0xd468('0x10')][_0xd468('0x14')]){_0x375a12[_0xd468('0x15')]={'user':_0x31457f[_0xd468('0xe')]['Smtp']['user'],'pass':_0x31457f[_0xd468('0xe')][_0xd468('0x10')][_0xd468('0x16')]};}var _0x2cf83d={'account':_0x375a12,'message':{'from':util[_0xd468('0x17')](_0xd468('0x18'),_0x31457f[_0xd468('0xe')]['name'],_0x31457f[_0xd468('0xe')]['email']||_0x31457f[_0xd468('0xe')][_0xd468('0x10')][_0xd468('0x19')]),'to':_0x31457f['email'],'cc':_0x31457f['cc'],'bcc':_0x31457f[_0xd468('0x1a')],'subject':util[_0xd468('0x17')](_0xd468('0x1b'),_0xf84003[_0xd468('0x1c')],_0x31457f[_0xd468('0x1d')],_0x31457f['subtractUnit'])}};var _0x30c5cc=path['join'](__dirname,_0xd468('0x1e'));var _0x2556c8=_0xf84003[_0xd468('0x1f')];var _0x54fa38=util[_0xd468('0x17')](_0xd468('0x20'),path[_0xd468('0x21')](_0xf84003['savename'],path[_0xd468('0x22')](_0xf84003['savename'])),_0xd468('0x23'));var _0x8c6f6a=path['join'](_0x30c5cc,_0x2556c8);var _0x1f6760=path[_0xd468('0x24')](_0x30c5cc,_0x54fa38);if(fs[_0xd468('0x25')](_0x8c6f6a)){_0xf84003[_0xd468('0x26')]=_0xd468('0x27');_0x2cf83d[_0xd468('0x28')][_0xd468('0x29')]=[{'filename':_0x2556c8,'path':_0x8c6f6a}];_0x2cf83d[_0xd468('0x28')]['text']=util[_0xd468('0x17')](_0xd468('0x2a'),JSON[_0xd468('0x2b')](_0xf84003,null,0x2));}else if(fs[_0xd468('0x25')](_0x1f6760)){_0xf84003[_0xd468('0x26')]=_0xd468('0x27');_0x2cf83d[_0xd468('0x28')][_0xd468('0x29')]=[{'filename':_0x54fa38,'path':_0x1f6760}];}else{_0x2cf83d[_0xd468('0x28')][_0xd468('0x2c')]=_0xd468('0x2d');if(!_0x31457f[_0xd468('0x2e')]){_0x2d61a5=![];logger['info'](_0xd468('0x2f'));}}if(_0x2d61a5){return client[_0xd468('0x30')](_0xd468('0x31'),_0x2cf83d)['then'](function(_0x5b8f1a){if(_0x5b8f1a[_0xd468('0x32')]){return logger[_0xd468('0x32')](_0xd468('0x33'),JSON[_0xd468('0x2b')](_0x5b8f1a));}return logger[_0xd468('0xc')]('email\x20sent');})[_0xd468('0x34')](function(_0x2aecba){return logger[_0xd468('0x32')](_0xd468('0x33'),JSON[_0xd468('0x2b')](_0x2aecba));});}};}function handleError(){return function(_0x3ab447){return logger[_0xd468('0x32')](JSON[_0xd468('0x2b')](_0x3ab447));};}function handleResult(_0x5063c5){return function(_0x574462){logger[_0xd468('0xc')]('data',JSON[_0xd468('0x2b')](_0x574462));if(_0x5063c5['MailAccount']&&_0x5063c5[_0xd468('0xe')][_0xd468('0x10')]&&!_[_0xd468('0x35')](_0x5063c5[_0xd468('0x36')])){setTimeout(handleSendEmail(_0x5063c5,_0x574462),0x3c*0x3e8);}};}function handleJob(_0x14f7a7){return function(){try{if(_[_0xd468('0x35')](_0x14f7a7[_0xd468('0x1d')])){return logger[_0xd468('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd468('0x35')](_0x14f7a7['subtractUnit'])){return logger[_0xd468('0xc')](_0xd468('0x37'));}var _0x20175f={'startDate':moment()['subtract'](_0x14f7a7[_0xd468('0x1d')],_0x14f7a7['subtractUnit'])[_0xd468('0x17')](_0xd468('0x38')),'endDate':moment()[_0xd468('0x17')](_0xd468('0x38')),'type':'scheduled','output':_0x14f7a7[_0xd468('0x39')],'name':_0x14f7a7[_0xd468('0x1c')]};if(!_['isNil'](_0x14f7a7['DefaultReportId'])){logger[_0xd468('0xc')](_0xd468('0x3a'),_0x14f7a7[_0xd468('0x3b')]);return analyticDefaultReportController['runReport']({'id':_0x14f7a7[_0xd468('0x3b')]},_0x20175f)[_0xd468('0x3c')](handleResult(_0x14f7a7))['catch'](handleError());}if(!_[_0xd468('0x35')](_0x14f7a7['CustomReportId'])){logger[_0xd468('0xc')]('exec\x20custom\x20report\x20id:%s',_0x14f7a7[_0xd468('0x3d')]);return analyticCustomReportController['runReport']({'id':_0x14f7a7[_0xd468('0x3d')]},_0x20175f)[_0xd468('0x3c')](handleResult(_0x14f7a7))[_0xd468('0x34')](handleError());}}catch(_0x255f61){logger['error'](JSON[_0xd468('0x2b')](_0x255f61));}return logger[_0xd468('0xc')](_0xd468('0x3e'));};}function getJobs(_0x32efec){var _0x19d098={};if(_0x32efec){_0x19d098['id']=_0x32efec;}return db[_0xd468('0x3f')][_0xd468('0x40')]({'where':_0x19d098,'include':[{'model':db['MailAccount'],'attributes':['id',_0xd468('0x1c'),_0xd468('0x36')],'include':[{'model':db[_0xd468('0x41')],'as':_0xd468('0x10')}]}]})[_0xd468('0x3c')](function(_0x150e3b){var _0x533dfe=_['keys'](manager['jobs']);var _0x5e949a=_[_0xd468('0x42')](_0x150e3b,function(_0x472186){return _0x472186['id'][_0xd468('0x43')]();});var _0x517c5f=_['keyBy'](_0x150e3b,function(_0x2d4e8d){return _0x2d4e8d['id'][_0xd468('0x43')]();});var _0x2636c6=_0x32efec?_0x5e949a:_[_0xd468('0x44')](_0x5e949a,_0x533dfe);var _0x1d0ed8=_[_0xd468('0x45')](_0x5e949a,_0x533dfe);var _0x104c4a=_[_0xd468('0x44')](_0x533dfe,_0x5e949a);var _0x47e67a;var _0x239bb1;for(_0x47e67a=0x0;_0x47e67a<_0x104c4a[_0xd468('0x46')]&&!_0x32efec;_0x47e67a+=0x1){_0x239bb1=_0x104c4a[_0x47e67a][_0xd468('0x43')]();if(manager[_0xd468('0x47')](_0x239bb1)){manager[_0xd468('0x48')](_0x239bb1);manager[_0xd468('0x49')](_0x239bb1);logger[_0xd468('0xc')](_0xd468('0x4a'),_0x239bb1);}}logger[_0xd468('0xc')](_0xd468('0x4b'),JSON[_0xd468('0x2b')](_0x2636c6));for(_0x47e67a=0x0;_0x47e67a<_0x2636c6['length'];_0x47e67a+=0x1){_0x239bb1=_0x2636c6[_0x47e67a][_0xd468('0x43')]();logger[_0xd468('0xc')](_0xd468('0x4c'),_0x239bb1);if(_0x32efec){logger['info'](_0xd468('0x4d'),_0x32efec);logger[_0xd468('0xc')](JSON[_0xd468('0x2b')](_0x517c5f[_0x239bb1]));BPromise[_0xd468('0x4e')]()[_0xd468('0x3c')](handleJob(_0x517c5f[_0x239bb1]));logger[_0xd468('0xc')](_0xd468('0x4f'),_0x517c5f[_0x239bb1]['name'],_0x517c5f[_0x239bb1][_0xd468('0x50')]);}else if(_0x517c5f[_0x239bb1]['cron']&&_0x517c5f[_0x239bb1]['active']&&moment()[_0xd468('0x51')](_0x517c5f[_0x239bb1][_0xd468('0x52')],_0x517c5f[_0x239bb1][_0xd468('0x53')])){manager[_0xd468('0x54')](_0x239bb1,_0x517c5f[_0x239bb1][_0xd468('0x50')],handleJob(_0x517c5f[_0x239bb1]));manager['start'](_0x239bb1);logger[_0xd468('0xc')](_0xd468('0x55'),_0x517c5f[_0x239bb1][_0xd468('0x1c')],_0x517c5f[_0x239bb1]['cron']);}else if(manager[_0xd468('0x47')](_0x239bb1)){manager[_0xd468('0x48')](_0x239bb1);manager[_0xd468('0x49')](_0x239bb1);logger['info']('stop\x20cron',_0x517c5f[_0x239bb1]['name'],_0x517c5f[_0x239bb1][_0xd468('0x50')]);}}for(_0x47e67a=0x0,_0x239bb1;_0x47e67a<_0x1d0ed8['length']&&!_0x32efec;_0x47e67a+=0x1){_0x239bb1=_0x1d0ed8[_0x47e67a][_0xd468('0x43')]();if(manager[_0xd468('0x47')](_0x239bb1)){if(_0x517c5f[_0x239bb1][_0xd468('0x50')]&&_0x517c5f[_0x239bb1][_0xd468('0x56')]&&moment()[_0xd468('0x51')](_0x517c5f[_0x239bb1][_0xd468('0x52')],_0x517c5f[_0x239bb1][_0xd468('0x53')])){manager[_0xd468('0x57')](_0x239bb1,_0x517c5f[_0x239bb1]['cron'],handleJob(_0x517c5f[_0x239bb1]));logger[_0xd468('0xc')](_0xd468('0x58'),_0x517c5f[_0x239bb1][_0xd468('0x1c')],_0x517c5f[_0x239bb1][_0xd468('0x50')]);}else{manager[_0xd468('0x48')](_0x239bb1);manager[_0xd468('0x49')](_0x239bb1);logger[_0xd468('0xc')](_0xd468('0x59'),_0x517c5f[_0x239bb1][_0xd468('0x1c')],_0x517c5f[_0x239bb1][_0xd468('0x50')]);}}}})['catch'](function(_0x5e5ce8){logger['error'](JSON['stringify'](_0x5e5ce8));});}exports[_0xd468('0x5a')]=function(_0x2a4f4d){return getJobs(_0x2a4f4d);};exports[_0xd468('0x5b')]=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 093b842..2d201ea 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 _0xb6da=['getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20configured','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','all','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService'];(function(_0x50a330,_0x2e003c){var _0x475636=function(_0x1ce9ab){while(--_0x1ce9ab){_0x50a330['push'](_0x50a330['shift']());}};_0x475636(++_0x2e003c);}(_0xb6da,0x8e));var _0xab6d=function(_0x2a1b8a,_0x15d69b){_0x2a1b8a=_0x2a1b8a-0x0;var _0x29839b=_0xb6da[_0x2a1b8a];return _0x29839b;};var _=require(_0xab6d('0x0'));var AWS=require('aws-sdk');var rp=require(_0xab6d('0x1'));var util=require(_0xab6d('0x2'));var BPromise=require(_0xab6d('0x3'));var db=require(_0xab6d('0x4'))['db'];var logger=require(_0xab6d('0x5'))(_0xab6d('0x6'));function getTranscriptionJob(_0x2d6472,_0x5a8924,_0x51e548,_0x8aa817){return new Promise(function(_0x3a2120,_0xdd37b4){var _0x130285=new AWS[(_0xab6d('0x7'))]({'accessKeyId':_0x5a8924,'secretAccessKey':_0x2d6472,'region':_0x51e548});_0x130285[_0xab6d('0x8')]({'TranscriptionJobName':_0x8aa817},function(_0x4ba0f7,_0x2e30f1){if(_0x4ba0f7){return _0xdd37b4(_0x4ba0f7);}else{return _0x3a2120(_0x2e30f1);}});});}function sentiment(_0x53a2d8,_0x31cdfa,_0x590cfa,_0x5345c7,_0x18edc2){return new Promise(function(_0x170d3e,_0x5ad276){var _0x352f46=new AWS['Comprehend']({'accessKeyId':_0x31cdfa,'secretAccessKey':_0x53a2d8,'region':_0x590cfa});_0x352f46['detectSentiment']({'Text':_0x5345c7,'LanguageCode':_0x18edc2[_0xab6d('0x9')](0x0,0x2)},function(_0x39942e,_0x36ce0c){if(_0x39942e){return _0x5ad276(_0x39942e);}else{return _0x170d3e(_0x36ce0c);}});});}function checkTranscribeJob(_0x35dca1,_0x1d8936,_0x3868e3){var _0x2c80c8;return new BPromise(function(_0x445deb,_0x58686f){logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0xc'),_0x35dca1['id'],_0x35dca1[_0xab6d('0xd')]));return getTranscriptionJob(_0x3868e3[_0xab6d('0xe')],_0x3868e3[_0xab6d('0xf')],_0x1d8936['transcribeRegion'],_0x35dca1[_0xab6d('0xd')])[_0xab6d('0x10')](function(_0x30e11a){logger['info'](util[_0xab6d('0xb')](_0xab6d('0x11'),_0x35dca1['id'],_0x35dca1[_0xab6d('0xd')],_0x30e11a[_0xab6d('0x12')][_0xab6d('0x13')]));if(!_0x35dca1[_0xab6d('0x14')]){switch(_0x30e11a[_0xab6d('0x12')][_0xab6d('0x13')]){case _0xab6d('0x15'):var _0x386d8e={'transcribeStatus':_0x30e11a[_0xab6d('0x12')][_0xab6d('0x13')],'fileUri':_0x30e11a[_0xab6d('0x12')][_0xab6d('0x16')][_0xab6d('0x17')]};logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x18'),_0x35dca1['id']));return rp({'uri':_0x30e11a[_0xab6d('0x12')]['Transcript'][_0xab6d('0x17')],'json':!![]})['then'](function(_0x962b3a){logger['info'](util[_0xab6d('0xb')](_0xab6d('0x19'),_0x35dca1['id']));if(_0x962b3a&&_0x962b3a[_0xab6d('0x1a')]&&_0x962b3a[_0xab6d('0x1a')]['transcripts']&&_0x962b3a[_0xab6d('0x1a')]['transcripts'][_0xab6d('0x1b')]){_0x386d8e['fileText']='';for(var _0x31e9f8=0x0;_0x31e9f8<_0x962b3a[_0xab6d('0x1a')]['transcripts'][_0xab6d('0x1b')];_0x31e9f8++){_0x386d8e[_0xab6d('0x14')]+=_0x962b3a['results'][_0xab6d('0x1c')][_0x31e9f8]['transcript']+'';}}return _0x35dca1['update'](_0x386d8e);})['then'](function(){logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x1d'),_0x35dca1['id']));if(!_0x35dca1[_0xab6d('0x1e')]){throw new db[(_0xab6d('0x1f'))][(_0xab6d('0x20'))](_0xab6d('0x21'));}if(!_0x1d8936[_0xab6d('0x22')]||!_0x1d8936[_0xab6d('0x23')]||!_0x1d8936[_0xab6d('0x24')]||!_0x1d8936[_0xab6d('0x25')]||!_0x1d8936[_0xab6d('0x26')]){throw new db[(_0xab6d('0x1f'))][(_0xab6d('0x20'))](_0xab6d('0x27'));}if(!_0x386d8e[_0xab6d('0x14')]){throw new Error(_0xab6d('0x28'));}if(_0x1d8936[_0xab6d('0x23')]===_0x3868e3['id']){return _0x3868e3;}else{return db[_0xab6d('0x29')][_0xab6d('0x2a')]({'where':{'id':_settings[_0xab6d('0x23')]}});}})[_0xab6d('0x10')](function(_0x396398){if(!_0x396398){throw new db[(_0xab6d('0x1f'))]['ValidationError'](_0xab6d('0x2b'));}if(!_0x396398['data1']||!_0x396398[_0xab6d('0xf')]){throw new db[(_0xab6d('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x2c80c8=_0x396398;logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x2c'),_0x35dca1['id']));return sentiment(_0x2c80c8['data1'],_0x2c80c8[_0xab6d('0xf')],_0x1d8936['sentimentRegion'],_0x386d8e[_0xab6d('0x14')],_0x1d8936[_0xab6d('0x25')]);})[_0xab6d('0x10')](function(_0x18b787){logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x2d'),_0x35dca1['id']));return _0x35dca1[_0xab6d('0x2e')]({'sentiment':_0x18b787[_0xab6d('0x2f')],'sPositive':_0x18b787[_0xab6d('0x30')][_0xab6d('0x31')],'sNegative':_0x18b787[_0xab6d('0x30')][_0xab6d('0x32')],'sMixed':_0x18b787[_0xab6d('0x30')]['Mixed'],'sNeutral':_0x18b787['SentimentScore'][_0xab6d('0x33')]});})[_0xab6d('0x10')](function(){logger[_0xab6d('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x35dca1['id']));_0x445deb();});case'FAILED':return _0x35dca1[_0xab6d('0x2e')]({'transcribeStatus':_0xab6d('0x34'),'failureReason':_0x30e11a[_0xab6d('0x12')][_0xab6d('0x35')]})[_0xab6d('0x10')](function(){logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x1d'),_0x35dca1['id']));_0x445deb();});default:logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x36'),_0x35dca1['id']));break;}}else{return BPromise[_0xab6d('0x37')]()[_0xab6d('0x10')](function(){if(!_0x35dca1[_0xab6d('0x1e')]){throw new db[(_0xab6d('0x1f'))][(_0xab6d('0x20'))](_0xab6d('0x21'));}if(!_0x1d8936[_0xab6d('0x22')]||!_0x1d8936[_0xab6d('0x23')]||!_0x1d8936[_0xab6d('0x24')]||!_0x1d8936['language']||!_0x1d8936[_0xab6d('0x26')]){throw new db['Sequelize'][(_0xab6d('0x20'))](_0xab6d('0x27'));}if(!_0x35dca1['fileText']){throw new Error(_0xab6d('0x28'));}if(_0x1d8936['sentimentAccountId']===_0x3868e3['id']){return _0x3868e3;}else{return db['CloudProvider'][_0xab6d('0x2a')]({'where':{'id':_settings[_0xab6d('0x23')]}});}})[_0xab6d('0x10')](function(_0x5718ee){if(!_0x5718ee){throw new db[(_0xab6d('0x1f'))][(_0xab6d('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5718ee[_0xab6d('0xe')]||!_0x5718ee['data2']){throw new db['Sequelize'][(_0xab6d('0x20'))](_0xab6d('0x38'));}_0x2c80c8=_0x5718ee;logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x2c'),_0x35dca1['id']));return sentiment(_0x2c80c8[_0xab6d('0xe')],_0x2c80c8['data2'],_0x1d8936['sentimentRegion'],_0x35dca1['fileText'],_0x1d8936[_0xab6d('0x25')]);})[_0xab6d('0x10')](function(_0x364977){logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x2d'),_0x35dca1['id']));return _0x35dca1[_0xab6d('0x2e')]({'sentiment':_0x364977[_0xab6d('0x2f')],'sPositive':_0x364977[_0xab6d('0x30')][_0xab6d('0x31')],'sNegative':_0x364977[_0xab6d('0x30')][_0xab6d('0x32')],'sMixed':_0x364977[_0xab6d('0x30')][_0xab6d('0x39')],'sNeutral':_0x364977[_0xab6d('0x30')][_0xab6d('0x33')],'transcribeStatus':_0xab6d('0x15')});})[_0xab6d('0x10')](function(){logger[_0xab6d('0xa')](util[_0xab6d('0xb')](_0xab6d('0x1d'),_0x35dca1['id']));_0x445deb();});}})[_0xab6d('0x3a')](function(_0x3a62f5){if(_0x3a62f5){if(!_0x3a62f5[_0xab6d('0x3b')]||_0x3a62f5[_0xab6d('0x3b')]!==_0xab6d('0x3c')){logger[_0xab6d('0x3d')](util[_0xab6d('0xb')](_0xab6d('0x3e'),_0x35dca1['id']),util[_0xab6d('0x3f')](_0x3a62f5,{'showHidden':![],'depth':null}));}}_0x445deb();});});}function checkTranscribe(){var _0x14646d;var _0x295753;var _0x17db7a;return db['VoiceRecording'][_0xab6d('0x40')]({'where':{'transcribeStatus':_0xab6d('0x41')}})[_0xab6d('0x10')](function(_0x732bfd){if(!_0x732bfd||!_0x732bfd['length']){throw new db[(_0xab6d('0x1f'))][(_0xab6d('0x20'))](_0xab6d('0x42'));}_0x14646d=_0x732bfd;return db[_0xab6d('0x43')][_0xab6d('0x2a')]({'where':{'id':0x1}});})[_0xab6d('0x10')](function(_0x86552b){if(!_0x86552b){throw new db['Sequelize']['ValidationError'](_0xab6d('0x44'));}_0x295753=_0x86552b;if(!_0x295753[_0xab6d('0x6')]||!_0x295753[_0xab6d('0x45')]||!_0x295753[_0xab6d('0x46')]||!_0x295753[_0xab6d('0x25')]||!_0x295753[_0xab6d('0x26')]){throw new db[(_0xab6d('0x1f'))][(_0xab6d('0x20'))](_0xab6d('0x47'));}return db['CloudProvider'][_0xab6d('0x2a')]({'where':{'id':_0x295753[_0xab6d('0x45')]}});})[_0xab6d('0x10')](function(_0x4b664b){if(!_0x4b664b){throw new db['Sequelize']['ValidationError'](_0xab6d('0x2b'));}if(!_0x4b664b[_0xab6d('0xe')]||!_0x4b664b[_0xab6d('0xf')]){throw new db['Sequelize']['ValidationError'](_0xab6d('0x38'));}_0x17db7a=_0x4b664b;var _0x422f71=[];_0x14646d[_0xab6d('0x48')](function(_0xb671f3){_0x422f71['push'](checkTranscribeJob(_0xb671f3,_0x295753,_0x17db7a));});return BPromise[_0xab6d('0x49')](_0x422f71);})[_0xab6d('0x3a')](function(_0x2f7663){if(_0x2f7663){if(!_0x2f7663['name']||_0x2f7663[_0xab6d('0x3b')]!=='SequelizeValidationError'){logger[_0xab6d('0x3d')](util[_0xab6d('0x3f')](_0x2f7663,{'showHidden':![],'depth':null}));}}});}exports[_0xab6d('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xfd7b=['substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','name','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','forEach','push','all','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment'];(function(_0x581c2f,_0x845337){var _0x39e67c=function(_0x41638a){while(--_0x41638a){_0x581c2f['push'](_0x581c2f['shift']());}};_0x39e67c(++_0x845337);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xfd7b[_0x1f9f37];return _0x21c080;};var _=require(_0xbfd7('0x0'));var AWS=require(_0xbfd7('0x1'));var rp=require(_0xbfd7('0x2'));var util=require('util');var BPromise=require(_0xbfd7('0x3'));var db=require(_0xbfd7('0x4'))['db'];var logger=require(_0xbfd7('0x5'))('transcribe');function getTranscriptionJob(_0x40c53a,_0x197749,_0x1d3aa5,_0x58e0ef){return new Promise(function(_0x134ee5,_0x3d054f){var _0x5e3d61=new AWS[(_0xbfd7('0x6'))]({'accessKeyId':_0x197749,'secretAccessKey':_0x40c53a,'region':_0x1d3aa5});_0x5e3d61[_0xbfd7('0x7')]({'TranscriptionJobName':_0x58e0ef},function(_0x174ff2,_0x51e9cf){if(_0x174ff2){return _0x3d054f(_0x174ff2);}else{return _0x134ee5(_0x51e9cf);}});});}function sentiment(_0x2ddd9c,_0x59951a,_0x52cc23,_0x9c26ae,_0x132bd8){return new Promise(function(_0xdf1d04,_0xc4cfe9){var _0x57a56c=new AWS[(_0xbfd7('0x8'))]({'accessKeyId':_0x59951a,'secretAccessKey':_0x2ddd9c,'region':_0x52cc23});_0x57a56c[_0xbfd7('0x9')]({'Text':_0x9c26ae,'LanguageCode':_0x132bd8[_0xbfd7('0xa')](0x0,0x2)},function(_0x5c4370,_0x380b53){if(_0x5c4370){return _0xc4cfe9(_0x5c4370);}else{return _0xdf1d04(_0x380b53);}});});}function checkTranscribeJob(_0x247d56,_0x5bf99b,_0x32b1f8){var _0x1da812;return new BPromise(function(_0x5b483c,_0xff58d9){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0xd'),_0x247d56['id'],_0x247d56[_0xbfd7('0xe')]));return getTranscriptionJob(_0x32b1f8[_0xbfd7('0xf')],_0x32b1f8[_0xbfd7('0x10')],_0x5bf99b[_0xbfd7('0x11')],_0x247d56[_0xbfd7('0xe')])[_0xbfd7('0x12')](function(_0xdc8970){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x13'),_0x247d56['id'],_0x247d56[_0xbfd7('0xe')],_0xdc8970[_0xbfd7('0x14')][_0xbfd7('0x15')]));if(!_0x247d56['fileText']){switch(_0xdc8970[_0xbfd7('0x14')][_0xbfd7('0x15')]){case _0xbfd7('0x16'):var _0x1893eb={'transcribeStatus':_0xdc8970[_0xbfd7('0x14')][_0xbfd7('0x15')],'fileUri':_0xdc8970['TranscriptionJob']['Transcript']['TranscriptFileUri']};logger[_0xbfd7('0xb')](util['format'](_0xbfd7('0x17'),_0x247d56['id']));return rp({'uri':_0xdc8970[_0xbfd7('0x14')][_0xbfd7('0x18')][_0xbfd7('0x19')],'json':!![]})[_0xbfd7('0x12')](function(_0x22e9e6){logger['info'](util[_0xbfd7('0xc')](_0xbfd7('0x1a'),_0x247d56['id']));if(_0x22e9e6&&_0x22e9e6[_0xbfd7('0x1b')]&&_0x22e9e6[_0xbfd7('0x1b')][_0xbfd7('0x1c')]&&_0x22e9e6[_0xbfd7('0x1b')][_0xbfd7('0x1c')][_0xbfd7('0x1d')]){_0x1893eb['fileText']='';for(var _0x25f44c=0x0;_0x25f44c<_0x22e9e6[_0xbfd7('0x1b')][_0xbfd7('0x1c')]['length'];_0x25f44c++){_0x1893eb[_0xbfd7('0x1e')]+=_0x22e9e6[_0xbfd7('0x1b')][_0xbfd7('0x1c')][_0x25f44c]['transcript']+'';}}return _0x247d56[_0xbfd7('0x1f')](_0x1893eb);})[_0xbfd7('0x12')](function(){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x20'),_0x247d56['id']));if(!_0x247d56[_0xbfd7('0x21')]){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x24'));}if(!_0x5bf99b[_0xbfd7('0x25')]||!_0x5bf99b[_0xbfd7('0x26')]||!_0x5bf99b[_0xbfd7('0x27')]||!_0x5bf99b[_0xbfd7('0x28')]||!_0x5bf99b['bucket']){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x29'));}if(!_0x1893eb[_0xbfd7('0x1e')]){throw new Error('Transcript\x20not\x20available');}if(_0x5bf99b['sentimentAccountId']===_0x32b1f8['id']){return _0x32b1f8;}else{return db['CloudProvider'][_0xbfd7('0x2a')]({'where':{'id':_settings[_0xbfd7('0x26')]}});}})[_0xbfd7('0x12')](function(_0x5107e6){if(!_0x5107e6){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x2b'));}if(!_0x5107e6[_0xbfd7('0xf')]||!_0x5107e6[_0xbfd7('0x10')]){throw new db['Sequelize'][(_0xbfd7('0x23'))](_0xbfd7('0x2c'));}_0x1da812=_0x5107e6;logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x247d56['id']));return sentiment(_0x1da812[_0xbfd7('0xf')],_0x1da812[_0xbfd7('0x10')],_0x5bf99b[_0xbfd7('0x27')],_0x1893eb['fileText'],_0x5bf99b[_0xbfd7('0x28')]);})[_0xbfd7('0x12')](function(_0xdc437c){logger['info'](util[_0xbfd7('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x247d56['id']));return _0x247d56[_0xbfd7('0x1f')]({'sentiment':_0xdc437c['Sentiment'],'sPositive':_0xdc437c[_0xbfd7('0x2d')][_0xbfd7('0x2e')],'sNegative':_0xdc437c[_0xbfd7('0x2d')][_0xbfd7('0x2f')],'sMixed':_0xdc437c[_0xbfd7('0x2d')][_0xbfd7('0x30')],'sNeutral':_0xdc437c['SentimentScore'][_0xbfd7('0x31')]});})[_0xbfd7('0x12')](function(){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x247d56['id']));_0x5b483c();});case _0xbfd7('0x32'):return _0x247d56['update']({'transcribeStatus':_0xbfd7('0x32'),'failureReason':_0xdc8970[_0xbfd7('0x14')]['FailureReason']})[_0xbfd7('0x12')](function(){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x20'),_0x247d56['id']));_0x5b483c();});default:logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x33'),_0x247d56['id']));break;}}else{return BPromise[_0xbfd7('0x34')]()['then'](function(){if(!_0x247d56[_0xbfd7('0x21')]){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5bf99b[_0xbfd7('0x25')]||!_0x5bf99b['sentimentAccountId']||!_0x5bf99b[_0xbfd7('0x27')]||!_0x5bf99b[_0xbfd7('0x28')]||!_0x5bf99b[_0xbfd7('0x35')]){throw new db['Sequelize'][(_0xbfd7('0x23'))](_0xbfd7('0x29'));}if(!_0x247d56[_0xbfd7('0x1e')]){throw new Error('Transcript\x20not\x20available');}if(_0x5bf99b['sentimentAccountId']===_0x32b1f8['id']){return _0x32b1f8;}else{return db['CloudProvider'][_0xbfd7('0x2a')]({'where':{'id':_settings[_0xbfd7('0x26')]}});}})[_0xbfd7('0x12')](function(_0x4daeca){if(!_0x4daeca){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x2b'));}if(!_0x4daeca['data1']||!_0x4daeca[_0xbfd7('0x10')]){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x1da812=_0x4daeca;logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x36'),_0x247d56['id']));return sentiment(_0x1da812[_0xbfd7('0xf')],_0x1da812[_0xbfd7('0x10')],_0x5bf99b[_0xbfd7('0x27')],_0x247d56[_0xbfd7('0x1e')],_0x5bf99b[_0xbfd7('0x28')]);})[_0xbfd7('0x12')](function(_0x1314da){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x37'),_0x247d56['id']));return _0x247d56[_0xbfd7('0x1f')]({'sentiment':_0x1314da[_0xbfd7('0x38')],'sPositive':_0x1314da[_0xbfd7('0x2d')][_0xbfd7('0x2e')],'sNegative':_0x1314da[_0xbfd7('0x2d')][_0xbfd7('0x2f')],'sMixed':_0x1314da['SentimentScore'][_0xbfd7('0x30')],'sNeutral':_0x1314da[_0xbfd7('0x2d')][_0xbfd7('0x31')],'transcribeStatus':'COMPLETED'});})[_0xbfd7('0x12')](function(){logger[_0xbfd7('0xb')](util[_0xbfd7('0xc')](_0xbfd7('0x20'),_0x247d56['id']));_0x5b483c();});}})['catch'](function(_0xa36dd9){if(_0xa36dd9){if(!_0xa36dd9[_0xbfd7('0x39')]||_0xa36dd9['name']!==_0xbfd7('0x3a')){logger[_0xbfd7('0x3b')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x247d56['id']),util[_0xbfd7('0x3c')](_0xa36dd9,{'showHidden':![],'depth':null}));}}_0x5b483c();});});}function checkTranscribe(){var _0x7d3b38;var _0x5a4de4;var _0x31d1df;return db[_0xbfd7('0x3d')]['findAll']({'where':{'transcribeStatus':_0xbfd7('0x3e')}})['then'](function(_0x52519f){if(!_0x52519f||!_0x52519f[_0xbfd7('0x1d')]){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x3f'));}_0x7d3b38=_0x52519f;return db[_0xbfd7('0x40')]['findOne']({'where':{'id':0x1}});})[_0xbfd7('0x12')](function(_0x47009e){if(!_0x47009e){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x41'));}_0x5a4de4=_0x47009e;if(!_0x5a4de4[_0xbfd7('0x42')]||!_0x5a4de4[_0xbfd7('0x43')]||!_0x5a4de4['transcribeRegion']||!_0x5a4de4[_0xbfd7('0x28')]||!_0x5a4de4[_0xbfd7('0x35')]){throw new db['Sequelize'][(_0xbfd7('0x23'))](_0xbfd7('0x44'));}return db[_0xbfd7('0x45')][_0xbfd7('0x2a')]({'where':{'id':_0x5a4de4[_0xbfd7('0x43')]}});})[_0xbfd7('0x12')](function(_0x162d45){if(!_0x162d45){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x2b'));}if(!_0x162d45['data1']||!_0x162d45['data2']){throw new db[(_0xbfd7('0x22'))][(_0xbfd7('0x23'))](_0xbfd7('0x2c'));}_0x31d1df=_0x162d45;var _0x602244=[];_0x7d3b38[_0xbfd7('0x46')](function(_0x4eb3b6){_0x602244[_0xbfd7('0x47')](checkTranscribeJob(_0x4eb3b6,_0x5a4de4,_0x31d1df));});return BPromise[_0xbfd7('0x48')](_0x602244);})['catch'](function(_0x8ad747){if(_0x8ad747){if(!_0x8ad747[_0xbfd7('0x39')]||_0x8ad747[_0xbfd7('0x39')]!==_0xbfd7('0x3a')){logger[_0xbfd7('0x3b')](util[_0xbfd7('0x3c')](_0x8ad747,{'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 f8759e0..d043fa2 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 _0xf11e=['../../config/environment','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','join','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','lodash','ioredis','util'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0xf11e,0x11b));var _0xef11=function(_0x2eef22,_0x1ff608){_0x2eef22=_0x2eef22-0x0;var _0x3a91f9=_0xf11e[_0x2eef22];return _0x3a91f9;};'use strict';var _=require(_0xef11('0x0'));var moment=require('moment');var Redis=require(_0xef11('0x1'));var util=require(_0xef11('0x2'));var config=require(_0xef11('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xef11('0x4'));config['redis']=_['defaults'](config[_0xef11('0x5')],{'host':_0xef11('0x6'),'port':0x18eb});var io=require(_0xef11('0x7'))(new Redis(config[_0xef11('0x5')]));function closeInteractions(){var _0x3fbffd=[];return db[_0xef11('0x8')][_0xef11('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xef11('0xa')](0x18,_0xef11('0xb'))}}})[_0xef11('0xc')](function(_0x15f65f){if(_0x15f65f&&_0x15f65f[_0xef11('0xd')]){_0x3fbffd=_[_0xef11('0xe')](_0x15f65f||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x3fbffd[_0xef11('0xf')]());return db[_0xef11('0x8')]['update']({'closeReason':_0xef11('0x10'),'disposition':_0xef11('0x11'),'closed':!![],'closedAt':moment()['format'](_0xef11('0x12'))},{'where':{'id':_0x3fbffd}});}})[_0xef11('0xc')](function(){if(_0x3fbffd&&_0x3fbffd[_0xef11('0xd')]){logger[_0xef11('0x13')](_0xef11('0x14'),_0x3fbffd['join']());for(var _0xae6ed0=0x0;_0xae6ed0<_0x3fbffd['length'];_0xae6ed0++){io[_0xef11('0x15')]('whatsappInteraction:update',{'id':_0x3fbffd[_0xae6ed0],'closed':!![]});}}})[_0xef11('0x16')](function(_0x4e107d){logger[_0xef11('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4e107d?util[_0xef11('0x18')](_0x4e107d,{'showHidden':![],'depth':null}):'');});}exports[_0xef11('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd59c=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','defaults','localhost','socket.io-emitter','redis','WhatsappInteraction','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0x29fe9d,_0x34356b){var _0x106027=function(_0x3a87c9){while(--_0x3a87c9){_0x29fe9d['push'](_0x29fe9d['shift']());}};_0x106027(++_0x34356b);}(_0xd59c,0x12d));var _0xcd59=function(_0x4bd61a,_0x287741){_0x4bd61a=_0x4bd61a-0x0;var _0x44b6ff=_0xd59c[_0x4bd61a];return _0x44b6ff;};'use strict';var _=require(_0xcd59('0x0'));var moment=require(_0xcd59('0x1'));var Redis=require(_0xcd59('0x2'));var util=require(_0xcd59('0x3'));var config=require(_0xcd59('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config['redis']=_[_0xcd59('0x5')](config['redis'],{'host':_0xcd59('0x6'),'port':0x18eb});var io=require(_0xcd59('0x7'))(new Redis(config[_0xcd59('0x8')]));function closeInteractions(){var _0x172bc6=[];return db[_0xcd59('0x9')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xcd59('0xa')](0x18,_0xcd59('0xb'))}}})[_0xcd59('0xc')](function(_0xdaeb19){if(_0xdaeb19&&_0xdaeb19[_0xcd59('0xd')]){_0x172bc6=_[_0xcd59('0xe')](_0xdaeb19||[],'id');logger[_0xcd59('0xf')](_0xcd59('0x10'),_0x172bc6[_0xcd59('0x11')]());return db[_0xcd59('0x9')][_0xcd59('0x12')]({'closeReason':_0xcd59('0x13'),'disposition':_0xcd59('0x14'),'closed':!![],'closedAt':moment()[_0xcd59('0x15')](_0xcd59('0x16'))},{'where':{'id':_0x172bc6}});}})['then'](function(){if(_0x172bc6&&_0x172bc6[_0xcd59('0xd')]){logger[_0xcd59('0xf')](_0xcd59('0x17'),_0x172bc6['join']());for(var _0x5c9db2=0x0;_0x5c9db2<_0x172bc6[_0xcd59('0xd')];_0x5c9db2++){io[_0xcd59('0x18')](_0xcd59('0x19'),{'id':_0x172bc6[_0x5c9db2],'closed':!![]});}}})['catch'](function(_0xb2a6fc){logger['error'](_0xcd59('0x1a'),_0xb2a6fc?util[_0xcd59('0x1b')](_0xb2a6fc,{'showHidden':![],'depth':null}):'');});}exports[_0xcd59('0x1c')]=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 ccfde95..7ab9789 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda26=['innocenzo.biondo','@xcally.com','now','destroy','then','log','contacts1','CmHopper','bulkCreate','finished\x20populating','hopper1','CmContact','contacts2','catch','util','push','Innocenzo','Biondo'];(function(_0x57eb1c,_0x5a8ab3){var _0x3ab894=function(_0x2e3859){while(--_0x2e3859){_0x57eb1c['push'](_0x57eb1c['shift']());}};_0x3ab894(++_0x5a8ab3);}(_0xda26,0x12e));var _0x6da2=function(_0x1a3db6,_0xb33789){_0x1a3db6=_0x1a3db6-0x0;var _0x5a19dd=_0xda26[_0x1a3db6];return _0x5a19dd;};'use strict';var util=require(_0x6da2('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6da2('0x1')]({'id':i,'firstName':_0x6da2('0x2')+i,'lastName':_0x6da2('0x3')+i,'phone':0xf879fb460+i,'email':_0x6da2('0x4')+i+_0x6da2('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6da2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6da2('0x2')+i,'lastName':_0x6da2('0x3')+i,'phone':0xf879fb460+i,'email':_0x6da2('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6da2('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x6da2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6da2('0x6')]()});}db['CmContact'][_0x6da2('0x7')]({'where':{}})[_0x6da2('0x8')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x6da2('0x8')](function(){console[_0x6da2('0x9')]('finished\x20populating',_0x6da2('0xa'));return db[_0x6da2('0xb')][_0x6da2('0x7')]({'where':{}});})[_0x6da2('0x8')](function(){return db['CmHopper'][_0x6da2('0xc')](hopper);})['then'](function(){console[_0x6da2('0x9')](_0x6da2('0xd'),_0x6da2('0xe'));return db[_0x6da2('0xf')][_0x6da2('0xc')](contacts2);})[_0x6da2('0x8')](function(){console[_0x6da2('0x9')]('finished\x20populating',_0x6da2('0x10'));return db[_0x6da2('0xb')][_0x6da2('0xc')](hopper2);})[_0x6da2('0x8')](function(){console['log'](_0x6da2('0xd'),'hopper2');})[_0x6da2('0x11')](function(_0x38b0ff){console['log'](_0x38b0ff);}); \ No newline at end of file +var _0x7360=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x7360,0x193));var _0x0736=function(_0x5c2564,_0x1b9fb8){_0x5c2564=_0x5c2564-0x0;var _0x4075cb=_0x7360[_0x5c2564];return _0x4075cb;};'use strict';var util=require(_0x0736('0x0'));var db=require(_0x0736('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0736('0x2')]({'id':i,'firstName':_0x0736('0x3')+i,'lastName':_0x0736('0x4')+i,'phone':0xf879fb460+i,'email':_0x0736('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0736('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0736('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x0736('0x3')+i,'lastName':_0x0736('0x4')+i,'phone':0xf879fb460+i,'email':_0x0736('0x5')+i+_0x0736('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x0736('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0736('0x6')](),'updatedAt':Date[_0x0736('0x6')]()});}db[_0x0736('0x8')]['destroy']({'where':{}})[_0x0736('0x9')](function(){return db[_0x0736('0x8')][_0x0736('0xa')](contacts);})[_0x0736('0x9')](function(){console[_0x0736('0xb')](_0x0736('0xc'),_0x0736('0xd'));return db[_0x0736('0xe')][_0x0736('0xf')]({'where':{}});})[_0x0736('0x9')](function(){return db['CmHopper'][_0x0736('0xa')](hopper);})[_0x0736('0x9')](function(){console['log']('finished\x20populating',_0x0736('0x10'));return db[_0x0736('0x8')][_0x0736('0xa')](contacts2);})[_0x0736('0x9')](function(){console[_0x0736('0xb')]('finished\x20populating',_0x0736('0x11'));return db[_0x0736('0xe')][_0x0736('0xa')](hopper2);})[_0x0736('0x9')](function(){console[_0x0736('0xb')](_0x0736('0xc'),_0x0736('0x12'));})[_0x0736('0x13')](function(_0x5998e0){console[_0x0736('0xb')](_0x5998e0);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7c91019..7ffad24 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7f2=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','util','../mysqldb','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss'];(function(_0x1c7e8e,_0x15fefd){var _0x447241=function(_0xeddfee){while(--_0xeddfee){_0x1c7e8e['push'](_0x1c7e8e['shift']());}};_0x447241(++_0x15fefd);}(_0xa7f2,0x74));var _0x2a7f=function(_0x48b66e,_0x461edb){_0x48b66e=_0x48b66e-0x0;var _0x151723=_0xa7f2[_0x48b66e];return _0x151723;};'use strict';var util=require(_0x2a7f('0x0'));var db=require(_0x2a7f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x2a7f('0x2'),_0x2a7f('0x3'),i),'fullname':util[_0x2a7f('0x4')]('%s%s',_0x2a7f('0x3'),i),'email':util['format'](_0x2a7f('0x5'),_0x2a7f('0x3'),i),'role':_0x2a7f('0x3'),'password':_0x2a7f('0x6'),'internal':0xfa0+i,'type':_0x2a7f('0x7'),'transport':[_0x2a7f('0x8'),'ws',_0x2a7f('0x9')],'disallow':[_0x2a7f('0xa')],'allow':[_0x2a7f('0xb')],'defaultuser':util[_0x2a7f('0x4')](_0x2a7f('0x2'),_0x2a7f('0x3'),i),'encryption':_0x2a7f('0xc'),'avpf':_0x2a7f('0xc'),'force_avp':_0x2a7f('0xc'),'icesupport':_0x2a7f('0xc'),'dtlsenable':_0x2a7f('0xc'),'dtlsverify':'no','dtlscertfile':_0x2a7f('0xd'),'dtlsprivatekey':_0x2a7f('0xe'),'dtlssetup':_0x2a7f('0xf'),'callerid':util[_0x2a7f('0x4')](_0x2a7f('0x10'),util['format'](_0x2a7f('0x2'),'agent',i),0xfa0+i)});}db[_0x2a7f('0x11')][_0x2a7f('0x12')](users)[_0x2a7f('0x13')](function(){console['log'](_0x2a7f('0x14'));})['catch'](function(_0x3714ab){console['log'](_0x3714ab);}); \ No newline at end of file +var _0x731a=['agent','%s%s@xcally.com','friend','udp','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','format','%s%s'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0x731a,0xb1));var _0xa731=function(_0x1b6c0c,_0x51ef20){_0x1b6c0c=_0x1b6c0c-0x0;var _0x178991=_0x731a[_0x1b6c0c];return _0x178991;};'use strict';var util=require('util');var db=require(_0xa731('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xa731('0x1')](_0xa731('0x2'),_0xa731('0x3'),i),'fullname':util[_0xa731('0x1')](_0xa731('0x2'),_0xa731('0x3'),i),'email':util[_0xa731('0x1')](_0xa731('0x4'),_0xa731('0x3'),i),'role':_0xa731('0x3'),'password':'password','internal':0xfa0+i,'type':_0xa731('0x5'),'transport':[_0xa731('0x6'),'ws','wss'],'disallow':['all'],'allow':[_0xa731('0x7')],'defaultuser':util['format'](_0xa731('0x2'),_0xa731('0x3'),i),'encryption':_0xa731('0x8'),'avpf':_0xa731('0x8'),'force_avp':'yes','icesupport':_0xa731('0x8'),'dtlsenable':_0xa731('0x8'),'dtlsverify':'no','dtlscertfile':_0xa731('0x9'),'dtlsprivatekey':_0xa731('0xa'),'dtlssetup':'actpass','callerid':util[_0xa731('0x1')](_0xa731('0xb'),util[_0xa731('0x1')](_0xa731('0x2'),_0xa731('0x3'),i),0xfa0+i)});}db[_0xa731('0xc')][_0xa731('0xd')](users)[_0xa731('0xe')](function(){console[_0xa731('0xf')](_0xa731('0x10'));})[_0xa731('0x11')](function(_0x3efe9b){console['log'](_0x3efe9b);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 97f72cd..281e18f 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4d8=['OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','then','map','resourceId','User','Campaign','where','format','%s:queue:%s','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','MailQueue','WhatsappQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','fax','sms','mail','whatsapp','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','Agents','role','agent','name','telephone','type','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues'];(function(_0x2e9619,_0x3ab358){var _0x1309af=function(_0x262f82){while(--_0x262f82){_0x2e9619['push'](_0x2e9619['shift']());}};_0x1309af(++_0x3ab358);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xc4d8[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x8c4d('0x0'));var util=require('util');var BPromise=require(_0x8c4d('0x1'));var db=require(_0x8c4d('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x8c4d('0x3'),'model':db['User'],'attributes':['id','name',_0x8c4d('0x4')],'raw':!![],'where':{'role':_0x8c4d('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8c4d('0x6')],'where':{'role':_0x8c4d('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8c4d('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x8c4d('0x6')],'where':{'role':_0x8c4d('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8c4d('0x6'),_0x8c4d('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3dbfd3,_0x1fd041,_0x36b577){return db[_0x8c4d('0x9')]['findOne']({'where':{'name':_0x3dbfd3,'userProfileId':_0x1fd041},'raw':!![]})['then'](function(_0x9c3f3c){if(_0x9c3f3c){if(_0x9c3f3c[_0x8c4d('0xa')]){switch(_0x3dbfd3){case _0x8c4d('0xb'):case _0x8c4d('0xc'):case _0x8c4d('0xd'):case _0x8c4d('0xe'):case _0x8c4d('0xf'):case _0x8c4d('0x10'):case'WhatsappQueues':return db[_0x36b577][_0x8c4d('0x11')](queryQueues);case _0x8c4d('0x12'):return db[_0x36b577][_0x8c4d('0x11')](queryTelephones);case _0x8c4d('0x13'):return db[_0x36b577][_0x8c4d('0x11')](queryTrunks);case _0x8c4d('0x14'):return db[_0x36b577][_0x8c4d('0x11')](queryCampaigns);}}else{return db[_0x8c4d('0x15')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x9c3f3c['id']},'raw':!![]})[_0x8c4d('0x16')](function(_0x1d410e){if(_0x1d410e){var _0x498e5d={'where':{'id':_[_0x8c4d('0x17')](_0x1d410e,_0x8c4d('0x18'))},'raw':!![]};switch(_0x36b577){case _0x8c4d('0x19'):_0x498e5d['where'][_0x8c4d('0x4')]=_0x8c4d('0x7');break;case _0x8c4d('0x1a'):_0x498e5d[_0x8c4d('0x1b')][_0x8c4d('0x8')]='ivr';break;}return db[_0x36b577][_0x8c4d('0x11')](_0x498e5d);}else{return[];}});}}else{return[];}})[_0x8c4d('0x16')](function(_0x48b376){return _0x48b376;});}function joinOrLeaveQueues(_0x409568,_0x1bf728,_0x2ad16e,_0x10ec67){_0x409568[_0x1bf728](util[_0x8c4d('0x1c')](_0x8c4d('0x1d'),_0x2ad16e,_0x10ec67[_0x8c4d('0x6')]));if(_0x10ec67[_0x8c4d('0x3')]){for(var _0x17708c=0x0;_0x17708c<_0x10ec67['Agents'][_0x8c4d('0x1e')];_0x17708c+=0x1){_0x409568[_0x1bf728](util[_0x8c4d('0x1c')](_0x8c4d('0x1f'),_0x10ec67[_0x8c4d('0x3')][_0x17708c][_0x8c4d('0x6')]));}}}function joinOrLeave(_0x10a1cf,_0x54d835,_0x3fd1e1){var _0x10ea9b;if(_0x10a1cf['handshake'][_0x8c4d('0x20')]['id']){db['User'][_0x8c4d('0x21')]({'attributes':['id','name',_0x8c4d('0x4'),_0x8c4d('0x22')],'where':{'id':_0x10a1cf[_0x8c4d('0x23')][_0x8c4d('0x20')]['id']},'include':[{'model':db[_0x8c4d('0x24')],'as':_0x8c4d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x8c4d('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x8c4d('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x8c4d('0x28')],'as':_0x8c4d('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x8c4d('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x8c4d('0x2b')],'as':_0x8c4d('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x22f944){if(_0x22f944){_0x10ea9b=_0x22f944;_0x10a1cf[_0x54d835](util[_0x8c4d('0x1c')](_0x8c4d('0x1f'),_0x22f944[_0x8c4d('0x6')]));var _0x2b1680=[];switch(_0x22f944[_0x8c4d('0x4')]){case'admin':_0x10a1cf[_0x54d835](_0x8c4d('0x2d'));_0x10a1cf[_0x54d835](_0x8c4d('0x2e'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues['include'];}_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x30')][_0x8c4d('0x11')](queryQueues));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x31')]['findAll'](queryQueues));_0x2b1680['push'](db['FaxQueue'][_0x8c4d('0x11')](queryQueues));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x32')]['findAll'](queryQueues));_0x2b1680[_0x8c4d('0x2f')](db['MailQueue'][_0x8c4d('0x11')](queryQueues));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x33')][_0x8c4d('0x11')](queryQueues));_0x2b1680['push'](db[_0x8c4d('0x34')][_0x8c4d('0x11')](queryQueues));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x19')][_0x8c4d('0x11')](queryTelephones));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x35')][_0x8c4d('0x11')](queryTrunks));_0x2b1680['push'](db[_0x8c4d('0x1a')]['findAll'](queryCampaigns));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x19')][_0x8c4d('0x11')](queryAgents));break;case _0x8c4d('0x36'):_0x10a1cf[_0x54d835](_0x8c4d('0x2d'));_0x10a1cf[_0x54d835]('voice:outbound');_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0xb'),_0x22f944[_0x8c4d('0x22')],_0x8c4d('0x30')));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0xc'),_0x22f944[_0x8c4d('0x22')],_0x8c4d('0x31')));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0xd'),_0x22f944[_0x8c4d('0x22')],'FaxQueue'));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0xe'),_0x22f944['userProfileId'],'SmsQueue'));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0xf'),_0x22f944[_0x8c4d('0x22')],_0x8c4d('0x37')));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0x10'),_0x22f944[_0x8c4d('0x22')],_0x8c4d('0x33')));_0x2b1680['push'](getAssociatedResources(_0x8c4d('0x38'),_0x22f944[_0x8c4d('0x22')],_0x8c4d('0x34')));_0x2b1680['push'](getAssociatedResources(_0x8c4d('0x12'),_0x22f944[_0x8c4d('0x22')],'User'));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources('Trunks',_0x22f944[_0x8c4d('0x22')],_0x8c4d('0x35')));_0x2b1680[_0x8c4d('0x2f')](getAssociatedResources(_0x8c4d('0x14'),_0x22f944['userProfileId'],_0x8c4d('0x1a')));_0x2b1680[_0x8c4d('0x2f')](db[_0x8c4d('0x19')][_0x8c4d('0x11')](queryAgents));break;case'agent':_0x10a1cf[_0x54d835]('voice:inbound');_0x10a1cf[_0x54d835]('voice:outbound');_0x2b1680[_0x8c4d('0x2f')](_0x22f944[_0x8c4d('0x39')]({'attributes':['id',_0x8c4d('0x6')]}));_0x2b1680['push'](_0x22f944['getChatQueues']({'attributes':['id',_0x8c4d('0x6')]}));_0x2b1680[_0x8c4d('0x2f')](_0x22f944[_0x8c4d('0x3a')]({'attributes':['id','name']}));_0x2b1680[_0x8c4d('0x2f')](_0x22f944[_0x8c4d('0x3b')]({'attributes':['id',_0x8c4d('0x6')]}));_0x2b1680[_0x8c4d('0x2f')](_0x22f944[_0x8c4d('0x3c')]({'attributes':['id','name']}));_0x2b1680[_0x8c4d('0x2f')](_0x22f944['getOpenchannelQueues']({'attributes':['id','name']}));_0x2b1680[_0x8c4d('0x2f')](_0x22f944['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x8c4d('0x3d')](_0x2b1680);}})[_0x8c4d('0x16')](function(_0x373911){if(_0x373911&&_0x373911[_0x8c4d('0x1e')]){for(var _0x59b4e4=0x0;_0x59b4e4<_0x373911[_0x8c4d('0x1e')];_0x59b4e4+=0x1){for(var _0x67f993=0x0;_0x67f993<_0x373911[_0x59b4e4]['length'];_0x67f993+=0x1){switch(_0x59b4e4){case 0x0:joinOrLeaveQueues(_0x10a1cf,_0x54d835,_0x8c4d('0x3e'),_0x373911[_0x59b4e4][_0x67f993]);break;case 0x1:joinOrLeaveQueues(_0x10a1cf,_0x54d835,_0x8c4d('0x3f'),_0x373911[_0x59b4e4][_0x67f993]);break;case 0x2:joinOrLeaveQueues(_0x10a1cf,_0x54d835,_0x8c4d('0x40'),_0x373911[_0x59b4e4][_0x67f993]);break;case 0x3:joinOrLeaveQueues(_0x10a1cf,_0x54d835,_0x8c4d('0x41'),_0x373911[_0x59b4e4][_0x67f993]);break;case 0x4:joinOrLeaveQueues(_0x10a1cf,_0x54d835,_0x8c4d('0x42'),_0x373911[_0x59b4e4][_0x67f993]);break;case 0x5:joinOrLeaveQueues(_0x10a1cf,_0x54d835,'openchannel',_0x373911[_0x59b4e4][_0x67f993]);break;case 0x6:joinOrLeaveQueues(_0x10a1cf,_0x54d835,_0x8c4d('0x43'),_0x373911[_0x59b4e4][_0x67f993]);break;case 0x7:if(_0x10ea9b[_0x8c4d('0x4')]!==_0x8c4d('0x5'))_0x10a1cf[_0x54d835](util[_0x8c4d('0x1c')]('telephone:%s',_0x373911[_0x59b4e4][_0x67f993][_0x8c4d('0x6')]));break;case 0x8:if(_0x10ea9b[_0x8c4d('0x4')]!==_0x8c4d('0x5'))_0x10a1cf[_0x54d835](util[_0x8c4d('0x1c')](_0x8c4d('0x44'),_0x373911[_0x59b4e4][_0x67f993][_0x8c4d('0x6')]));break;case 0x9:if(_0x10ea9b[_0x8c4d('0x4')]!==_0x8c4d('0x5'))_0x10a1cf[_0x54d835](util[_0x8c4d('0x1c')](_0x8c4d('0x45'),_0x373911[_0x59b4e4][_0x67f993][_0x8c4d('0x8')],_0x373911[_0x59b4e4][_0x67f993][_0x8c4d('0x6')]));break;case 0xa:_0x10a1cf[_0x54d835](util[_0x8c4d('0x1c')](_0x8c4d('0x1f'),_0x373911[_0x59b4e4][_0x67f993][_0x8c4d('0x6')]));break;}}}}})[_0x8c4d('0x16')](function(){if(_0x54d835===_0x8c4d('0x46')){var _0x2e9086=_[_0x8c4d('0x17')](_0x10ea9b[_0x8c4d('0x25')],'id');return _0x10ea9b['removeChatInteractions'](_0x2e9086)[_0x8c4d('0x16')](function(){for(var _0xb37731=0x0;_0xb37731<_0x2e9086['length'];_0xb37731+=0x1){_0x3fd1e1[_0x8c4d('0x47')](_0x8c4d('0x48'),{'ChatInteractionId':Number(_0x2e9086[_0xb37731]),'UserId':Number(_0x10ea9b['id'])});}});}})[_0x8c4d('0x16')](function(){if(_0x54d835===_0x8c4d('0x46')){var _0x115cd2=_[_0x8c4d('0x17')](_0x10ea9b['MailInteractions'],'id');return _0x10ea9b['removeMailInteractions'](_0x115cd2)['then'](function(){for(var _0x503bb6=0x0;_0x503bb6<_0x115cd2['length'];_0x503bb6+=0x1){_0x3fd1e1['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x115cd2[_0x503bb6]),'UserId':Number(_0x10ea9b['id'])});}});}})[_0x8c4d('0x16')](function(){if(_0x54d835==='leave'){var _0x53802f=_[_0x8c4d('0x17')](_0x10ea9b[_0x8c4d('0x27')],'id');return _0x10ea9b[_0x8c4d('0x49')](_0x53802f)['then'](function(){for(var _0x2206a5=0x0;_0x2206a5<_0x53802f[_0x8c4d('0x1e')];_0x2206a5+=0x1){_0x3fd1e1[_0x8c4d('0x47')](_0x8c4d('0x4a'),{'FaxInteractionId':Number(_0x53802f[_0x2206a5]),'UserId':Number(_0x10ea9b['id'])});}});}})[_0x8c4d('0x16')](function(){if(_0x54d835===_0x8c4d('0x46')){var _0x5ba211=_['map'](_0x10ea9b[_0x8c4d('0x29')],'id');return _0x10ea9b[_0x8c4d('0x4b')](_0x5ba211)[_0x8c4d('0x16')](function(){for(var _0x9b7e0c=0x0;_0x9b7e0c<_0x5ba211[_0x8c4d('0x1e')];_0x9b7e0c+=0x1){_0x3fd1e1[_0x8c4d('0x47')](_0x8c4d('0x4c'),{'SmsInteractionId':Number(_0x5ba211[_0x9b7e0c]),'UserId':Number(_0x10ea9b['id'])});}});}})[_0x8c4d('0x16')](function(){if(_0x54d835==='leave'){var _0x1bcd0d=_[_0x8c4d('0x17')](_0x10ea9b[_0x8c4d('0x2a')],'id');return _0x10ea9b['removeOpenchannelInteractions'](_0x1bcd0d)[_0x8c4d('0x16')](function(){for(var _0x5afbe1=0x0;_0x5afbe1<_0x1bcd0d[_0x8c4d('0x1e')];_0x5afbe1+=0x1){_0x3fd1e1['emit'](_0x8c4d('0x4d'),{'OpenchannelInteractionId':Number(_0x1bcd0d[_0x5afbe1]),'UserId':Number(_0x10ea9b['id'])});}});}})[_0x8c4d('0x16')](function(){if(_0x54d835===_0x8c4d('0x46')){var _0x301beb=_[_0x8c4d('0x17')](_0x10ea9b[_0x8c4d('0x2c')],'id');return _0x10ea9b['removeWhatsappInteractions'](_0x301beb)[_0x8c4d('0x16')](function(){for(var _0x3de815=0x0;_0x3de815<_0x301beb[_0x8c4d('0x1e')];_0x3de815+=0x1){_0x3fd1e1[_0x8c4d('0x47')](_0x8c4d('0x4e'),{'WhatsappInteractionId':Number(_0x301beb[_0x3de815]),'UserId':Number(_0x10ea9b['id'])});}});}})[_0x8c4d('0x4f')](function(_0x50f220){_0x10a1cf[_0x8c4d('0x50')](_0x50f220);});}}function onDisconnect(_0xdf133e,_0x15db11){joinOrLeave(_0xdf133e,_0x8c4d('0x46'),_0x15db11);}function onConnect(_0x5d8e72){joinOrLeave(_0x5d8e72,_0x8c4d('0x51'));}exports['default']=function(_0x54ee4d){_0x54ee4d['on']('connection',function(_0x2d690c){_0x2d690c[_0x8c4d('0x52')](0x0);_0x2d690c[_0x8c4d('0x53')]=_0x2d690c[_0x8c4d('0x54')]['connection'][_0x8c4d('0x55')]+':'+_0x2d690c[_0x8c4d('0x54')]['connection'][_0x8c4d('0x56')];_0x2d690c[_0x8c4d('0x57')]=new Date();_0x2d690c[_0x8c4d('0x50')]=function(_0x26c7ee){console['log']('SocketIO\x20'+_0x2d690c[_0x8c4d('0x58')][_0x8c4d('0x6')]+'['+_0x2d690c['address']+']',_0x26c7ee);};_0x2d690c['on'](_0x8c4d('0x59'),function(){onDisconnect(_0x2d690c,_0x54ee4d);_0x2d690c[_0x8c4d('0x50')](_0x8c4d('0x5a'));});onConnect(_0x2d690c);_0x2d690c[_0x8c4d('0x50')]('CONNECTED');});}; \ No newline at end of file +var _0x5360=['OpenchannelQueue','WhatsappQueue','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','Agents','name','role','agent','ivr','UserProfileSection','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','User','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','voice:inbound','include','push','VoiceQueue','SmsQueue','MailQueue','Trunk','user','ChatQueue','FaxQueue'];(function(_0x562900,_0x24bdbf){var _0x1f5957=function(_0x1e8901){while(--_0x1e8901){_0x562900['push'](_0x562900['shift']());}};_0x1f5957(++_0x24bdbf);}(_0x5360,0x157));var _0x0536=function(_0x2d9ff7,_0x1e610d){_0x2d9ff7=_0x2d9ff7-0x0;var _0x14b0d0=_0x5360[_0x2d9ff7];return _0x14b0d0;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var BPromise=require(_0x0536('0x2'));var db=require(_0x0536('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x0536('0x4'),'model':db['User'],'attributes':['id',_0x0536('0x5'),_0x0536('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x0536('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x0536('0x5')],'where':{'role':_0x0536('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0536('0x5'),'type'],'where':{'type':_0x0536('0x8')}};function getAssociatedResources(_0x203f0b,_0x351d17,_0x5b78e2){return db[_0x0536('0x9')]['findOne']({'where':{'name':_0x203f0b,'userProfileId':_0x351d17},'raw':!![]})['then'](function(_0x5548ba){if(_0x5548ba){if(_0x5548ba['autoAssociation']){switch(_0x203f0b){case _0x0536('0xa'):case _0x0536('0xb'):case _0x0536('0xc'):case _0x0536('0xd'):case _0x0536('0xe'):case _0x0536('0xf'):case _0x0536('0x10'):return db[_0x5b78e2][_0x0536('0x11')](queryQueues);case _0x0536('0x12'):return db[_0x5b78e2][_0x0536('0x11')](queryTelephones);case _0x0536('0x13'):return db[_0x5b78e2][_0x0536('0x11')](queryTrunks);case _0x0536('0x14'):return db[_0x5b78e2]['findAll'](queryCampaigns);}}else{return db[_0x0536('0x15')][_0x0536('0x11')]({'attributes':[_0x0536('0x16')],'where':{'sectionId':_0x5548ba['id']},'raw':!![]})[_0x0536('0x17')](function(_0x4723a3){if(_0x4723a3){var _0x58dddc={'where':{'id':_[_0x0536('0x18')](_0x4723a3,_0x0536('0x16'))},'raw':!![]};switch(_0x5b78e2){case _0x0536('0x19'):_0x58dddc[_0x0536('0x1a')]['role']='telephone';break;case _0x0536('0x1b'):_0x58dddc[_0x0536('0x1a')][_0x0536('0x1c')]='ivr';break;}return db[_0x5b78e2]['findAll'](_0x58dddc);}else{return[];}});}}else{return[];}})[_0x0536('0x17')](function(_0x1eb48d){return _0x1eb48d;});}function joinOrLeaveQueues(_0x506de2,_0x643c08,_0xe7d2f,_0x23a389){_0x506de2[_0x643c08](util[_0x0536('0x1d')](_0x0536('0x1e'),_0xe7d2f,_0x23a389['name']));if(_0x23a389[_0x0536('0x4')]){for(var _0x51ba52=0x0;_0x51ba52<_0x23a389['Agents'][_0x0536('0x1f')];_0x51ba52+=0x1){_0x506de2[_0x643c08](util[_0x0536('0x1d')](_0x0536('0x20'),_0x23a389[_0x0536('0x4')][_0x51ba52][_0x0536('0x5')]));}}}function joinOrLeave(_0x3a54ab,_0x272008,_0x4bfec1){var _0x475b87;if(_0x3a54ab[_0x0536('0x21')]['query']['id']){db[_0x0536('0x19')][_0x0536('0x22')]({'attributes':['id',_0x0536('0x5'),'role',_0x0536('0x23')],'where':{'id':_0x3a54ab[_0x0536('0x21')][_0x0536('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x0536('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x0536('0x26')],'as':_0x0536('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x0536('0x28')],'as':_0x0536('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x0536('0x2a')],'as':_0x0536('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x0536('0x2c')],'as':_0x0536('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x0536('0x2e')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x0536('0x17')](function(_0x36d4d7){if(_0x36d4d7){_0x475b87=_0x36d4d7;_0x3a54ab[_0x272008](util['format'](_0x0536('0x20'),_0x36d4d7[_0x0536('0x5')]));var _0x3f99a0=[];switch(_0x36d4d7[_0x0536('0x6')]){case'admin':_0x3a54ab[_0x272008](_0x0536('0x2f'));_0x3a54ab[_0x272008]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x0536('0x30'))){delete queryQueues[_0x0536('0x30')];}_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x32')][_0x0536('0x11')](queryQueues));_0x3f99a0[_0x0536('0x31')](db['ChatQueue'][_0x0536('0x11')](queryQueues));_0x3f99a0[_0x0536('0x31')](db['FaxQueue'][_0x0536('0x11')](queryQueues));_0x3f99a0['push'](db[_0x0536('0x33')][_0x0536('0x11')](queryQueues));_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x34')][_0x0536('0x11')](queryQueues));_0x3f99a0[_0x0536('0x31')](db['OpenchannelQueue'][_0x0536('0x11')](queryQueues));_0x3f99a0['push'](db['WhatsappQueue'][_0x0536('0x11')](queryQueues));_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x19')]['findAll'](queryTelephones));_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x35')][_0x0536('0x11')](queryTrunks));_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x1b')]['findAll'](queryCampaigns));_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x19')][_0x0536('0x11')](queryAgents));break;case _0x0536('0x36'):_0x3a54ab[_0x272008](_0x0536('0x2f'));_0x3a54ab[_0x272008]('voice:outbound');_0x3f99a0[_0x0536('0x31')](getAssociatedResources('VoiceQueues',_0x36d4d7[_0x0536('0x23')],_0x0536('0x32')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources('ChatQueues',_0x36d4d7[_0x0536('0x23')],_0x0536('0x37')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources(_0x0536('0xc'),_0x36d4d7['userProfileId'],_0x0536('0x38')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources('SmsQueues',_0x36d4d7[_0x0536('0x23')],'SmsQueue'));_0x3f99a0['push'](getAssociatedResources(_0x0536('0xe'),_0x36d4d7[_0x0536('0x23')],_0x0536('0x34')));_0x3f99a0['push'](getAssociatedResources('OpenchannelQueues',_0x36d4d7['userProfileId'],_0x0536('0x39')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources('WhatsappQueues',_0x36d4d7[_0x0536('0x23')],_0x0536('0x3a')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources(_0x0536('0x12'),_0x36d4d7['userProfileId'],_0x0536('0x19')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources(_0x0536('0x13'),_0x36d4d7[_0x0536('0x23')],_0x0536('0x35')));_0x3f99a0[_0x0536('0x31')](getAssociatedResources(_0x0536('0x14'),_0x36d4d7[_0x0536('0x23')],'Campaign'));_0x3f99a0[_0x0536('0x31')](db[_0x0536('0x19')][_0x0536('0x11')](queryAgents));break;case'agent':_0x3a54ab[_0x272008](_0x0536('0x2f'));_0x3a54ab[_0x272008](_0x0536('0x3b'));_0x3f99a0[_0x0536('0x31')](_0x36d4d7[_0x0536('0x3c')]({'attributes':['id',_0x0536('0x5')]}));_0x3f99a0['push'](_0x36d4d7[_0x0536('0x3d')]({'attributes':['id',_0x0536('0x5')]}));_0x3f99a0['push'](_0x36d4d7[_0x0536('0x3e')]({'attributes':['id',_0x0536('0x5')]}));_0x3f99a0[_0x0536('0x31')](_0x36d4d7[_0x0536('0x3f')]({'attributes':['id',_0x0536('0x5')]}));_0x3f99a0[_0x0536('0x31')](_0x36d4d7[_0x0536('0x40')]({'attributes':['id','name']}));_0x3f99a0['push'](_0x36d4d7[_0x0536('0x41')]({'attributes':['id',_0x0536('0x5')]}));_0x3f99a0[_0x0536('0x31')](_0x36d4d7[_0x0536('0x42')]({'attributes':['id',_0x0536('0x5')]}));break;}return BPromise[_0x0536('0x43')](_0x3f99a0);}})[_0x0536('0x17')](function(_0x17d9b9){if(_0x17d9b9&&_0x17d9b9['length']){for(var _0xe24c2c=0x0;_0xe24c2c<_0x17d9b9[_0x0536('0x1f')];_0xe24c2c+=0x1){for(var _0x5418d4=0x0;_0x5418d4<_0x17d9b9[_0xe24c2c][_0x0536('0x1f')];_0x5418d4+=0x1){switch(_0xe24c2c){case 0x0:joinOrLeaveQueues(_0x3a54ab,_0x272008,'voice',_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x1:joinOrLeaveQueues(_0x3a54ab,_0x272008,_0x0536('0x44'),_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x2:joinOrLeaveQueues(_0x3a54ab,_0x272008,_0x0536('0x45'),_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x3:joinOrLeaveQueues(_0x3a54ab,_0x272008,'sms',_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x4:joinOrLeaveQueues(_0x3a54ab,_0x272008,'mail',_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x5:joinOrLeaveQueues(_0x3a54ab,_0x272008,_0x0536('0x46'),_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x6:joinOrLeaveQueues(_0x3a54ab,_0x272008,_0x0536('0x47'),_0x17d9b9[_0xe24c2c][_0x5418d4]);break;case 0x7:if(_0x475b87[_0x0536('0x6')]!==_0x0536('0x7'))_0x3a54ab[_0x272008](util[_0x0536('0x1d')](_0x0536('0x48'),_0x17d9b9[_0xe24c2c][_0x5418d4][_0x0536('0x5')]));break;case 0x8:if(_0x475b87[_0x0536('0x6')]!==_0x0536('0x7'))_0x3a54ab[_0x272008](util[_0x0536('0x1d')](_0x0536('0x49'),_0x17d9b9[_0xe24c2c][_0x5418d4][_0x0536('0x5')]));break;case 0x9:if(_0x475b87[_0x0536('0x6')]!=='agent')_0x3a54ab[_0x272008](util[_0x0536('0x1d')](_0x0536('0x4a'),_0x17d9b9[_0xe24c2c][_0x5418d4][_0x0536('0x1c')],_0x17d9b9[_0xe24c2c][_0x5418d4]['name']));break;case 0xa:_0x3a54ab[_0x272008](util[_0x0536('0x1d')](_0x0536('0x20'),_0x17d9b9[_0xe24c2c][_0x5418d4][_0x0536('0x5')]));break;}}}}})[_0x0536('0x17')](function(){if(_0x272008===_0x0536('0x4b')){var _0x4e0292=_[_0x0536('0x18')](_0x475b87[_0x0536('0x25')],'id');return _0x475b87[_0x0536('0x4c')](_0x4e0292)[_0x0536('0x17')](function(){for(var _0x3eaedd=0x0;_0x3eaedd<_0x4e0292[_0x0536('0x1f')];_0x3eaedd+=0x1){_0x4bfec1[_0x0536('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4e0292[_0x3eaedd]),'UserId':Number(_0x475b87['id'])});}});}})[_0x0536('0x17')](function(){if(_0x272008===_0x0536('0x4b')){var _0x5d318f=_['map'](_0x475b87[_0x0536('0x27')],'id');return _0x475b87[_0x0536('0x4e')](_0x5d318f)[_0x0536('0x17')](function(){for(var _0x3e247e=0x0;_0x3e247e<_0x5d318f[_0x0536('0x1f')];_0x3e247e+=0x1){_0x4bfec1['emit'](_0x0536('0x4f'),{'MailInteractionId':Number(_0x5d318f[_0x3e247e]),'UserId':Number(_0x475b87['id'])});}});}})['then'](function(){if(_0x272008===_0x0536('0x4b')){var _0x22757f=_[_0x0536('0x18')](_0x475b87[_0x0536('0x29')],'id');return _0x475b87[_0x0536('0x50')](_0x22757f)[_0x0536('0x17')](function(){for(var _0x2cd227=0x0;_0x2cd227<_0x22757f[_0x0536('0x1f')];_0x2cd227+=0x1){_0x4bfec1[_0x0536('0x4d')](_0x0536('0x51'),{'FaxInteractionId':Number(_0x22757f[_0x2cd227]),'UserId':Number(_0x475b87['id'])});}});}})[_0x0536('0x17')](function(){if(_0x272008===_0x0536('0x4b')){var _0x1cc60f=_[_0x0536('0x18')](_0x475b87['SmsInteractions'],'id');return _0x475b87['removeSmsInteractions'](_0x1cc60f)['then'](function(){for(var _0x524553=0x0;_0x524553<_0x1cc60f[_0x0536('0x1f')];_0x524553+=0x1){_0x4bfec1['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1cc60f[_0x524553]),'UserId':Number(_0x475b87['id'])});}});}})[_0x0536('0x17')](function(){if(_0x272008===_0x0536('0x4b')){var _0x131589=_[_0x0536('0x18')](_0x475b87['OpenchannelInteractions'],'id');return _0x475b87[_0x0536('0x52')](_0x131589)[_0x0536('0x17')](function(){for(var _0x2b71ba=0x0;_0x2b71ba<_0x131589[_0x0536('0x1f')];_0x2b71ba+=0x1){_0x4bfec1['emit'](_0x0536('0x53'),{'OpenchannelInteractionId':Number(_0x131589[_0x2b71ba]),'UserId':Number(_0x475b87['id'])});}});}})['then'](function(){if(_0x272008==='leave'){var _0x341eba=_[_0x0536('0x18')](_0x475b87[_0x0536('0x54')],'id');return _0x475b87[_0x0536('0x55')](_0x341eba)[_0x0536('0x17')](function(){for(var _0x31837f=0x0;_0x31837f<_0x341eba[_0x0536('0x1f')];_0x31837f+=0x1){_0x4bfec1[_0x0536('0x4d')](_0x0536('0x56'),{'WhatsappInteractionId':Number(_0x341eba[_0x31837f]),'UserId':Number(_0x475b87['id'])});}});}})['catch'](function(_0x2041c7){_0x3a54ab[_0x0536('0x57')](_0x2041c7);});}}function onDisconnect(_0x7cb78c,_0x152c58){joinOrLeave(_0x7cb78c,_0x0536('0x4b'),_0x152c58);}function onConnect(_0x275039){joinOrLeave(_0x275039,_0x0536('0x58'));}exports[_0x0536('0x59')]=function(_0x26cbf5){_0x26cbf5['on']('connection',function(_0x168708){_0x168708[_0x0536('0x5a')](0x0);_0x168708[_0x0536('0x5b')]=_0x168708[_0x0536('0x5c')][_0x0536('0x5d')][_0x0536('0x5e')]+':'+_0x168708[_0x0536('0x5c')]['connection'][_0x0536('0x5f')];_0x168708[_0x0536('0x60')]=new Date();_0x168708['log']=function(_0x33ca69){console[_0x0536('0x57')]('SocketIO\x20'+_0x168708[_0x0536('0x61')][_0x0536('0x5')]+'['+_0x168708['address']+']',_0x33ca69);};_0x168708['on']('disconnect',function(){onDisconnect(_0x168708,_0x26cbf5);_0x168708[_0x0536('0x57')](_0x0536('0x62'));});onConnect(_0x168708);_0x168708[_0x0536('0x57')](_0x0536('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ea080d1..32a9358 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 _0x9db7=['opened','QueryTypes','changed','closed','substatus','query','fullname','internal','length','hasOwnProperty','model','hook','callback','condition','util','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','SmsInteraction','Sms','afterUpdate','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','newmessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','UserId','User','find','name','email','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage'];(function(_0xf0917b,_0x1dc5f9){var _0x2ebd96=function(_0x4a2f29){while(--_0x4a2f29){_0xf0917b['push'](_0xf0917b['shift']());}};_0x2ebd96(++_0x1dc5f9);}(_0x9db7,0x9a));var _0x79db=function(_0x132ecb,_0x5aa0cc){_0x132ecb=_0x132ecb-0x0;var _0x18a7c7=_0x9db7[_0x132ecb];return _0x18a7c7;};'use strict';var util=require(_0x79db('0x0'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x79db('0x1'))(_0x79db('0x2'));var _=require('lodash');var client=jayson[_0x79db('0x3')][_0x79db('0x4')]({'port':0x232a});var triggers=[{'channel':_0x79db('0x5'),'model':_0x79db('0x6'),'event':_0x79db('0x7'),'condition':_0x79db('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0x79db('0x6'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x79db('0x5'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':_0x79db('0x9'),'event':_0x79db('0x7'),'condition':_0x79db('0x8'),'callback':afterCreate},{'channel':_0x79db('0xa'),'model':'SmsInteraction','event':_0x79db('0xb'),'condition':_0x79db('0xc'),'callback':afterUpdate},{'channel':'Sms','model':_0x79db('0xd'),'event':_0x79db('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x79db('0xe'),'model':'WhatsappInteraction','event':_0x79db('0x7'),'condition':_0x79db('0x8'),'callback':afterCreate},{'channel':_0x79db('0xe'),'model':_0x79db('0xf'),'event':_0x79db('0xb'),'condition':_0x79db('0xc'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x79db('0x10'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x79db('0x11'),'model':'FaxInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x79db('0x11'),'model':_0x79db('0x12'),'event':_0x79db('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x79db('0x11'),'model':_0x79db('0x13'),'event':'afterCreate','condition':_0x79db('0x14'),'callback':afterCreateMessage},{'channel':_0x79db('0x15'),'model':_0x79db('0x16'),'event':_0x79db('0x7'),'condition':_0x79db('0x8'),'callback':afterCreate},{'channel':_0x79db('0x15'),'model':_0x79db('0x16'),'event':_0x79db('0xb'),'condition':_0x79db('0xc'),'callback':afterUpdate},{'channel':_0x79db('0x15'),'model':_0x79db('0x17'),'event':_0x79db('0x7'),'condition':_0x79db('0x14'),'callback':afterCreateMessage},{'channel':_0x79db('0x18'),'model':_0x79db('0x19'),'event':_0x79db('0x7'),'condition':_0x79db('0x8'),'callback':afterCreate},{'channel':_0x79db('0x18'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x79db('0xc'),'callback':afterUpdate},{'channel':_0x79db('0x18'),'model':'OpenchannelMessage','event':_0x79db('0x7'),'condition':_0x79db('0x14'),'callback':afterCreateMessage}];function request(_0x3470e6){return client[_0x79db('0x1a')](_0x79db('0x1b'),_0x3470e6)[_0x79db('0x1c')](function(_0x4cf309){logger[_0x79db('0x1d')](_0x79db('0x1e'),_0x79db('0x1b'),_0x4cf309);if(_0x4cf309[_0x79db('0x1f')]){if(_0x4cf309[_0x79db('0x1f')][_0x79db('0x20')]===0x1f4){logger[_0x79db('0x1f')](_0x79db('0x1e'),_0x79db('0x1b'),_0x4cf309[_0x79db('0x1f')]);}}})[_0x79db('0x21')](function(_0x3c3f01){logger[_0x79db('0x1f')](_0x79db('0x1e'),_0x79db('0x1b'),_0x3c3f01);});}function afterCreateMessage(_0x2dbcb6,_0x77cac3){return function(_0x55bdaa,_0x1afe42){_0x55bdaa=_0x55bdaa[_0x79db('0x22')]({'plain':!![]});_0x55bdaa[_0x79db('0x23')]=_0x2dbcb6;_0x55bdaa[_0x79db('0x24')]=_0x2dbcb6;_0x55bdaa[_0x79db('0x25')]=_0x55bdaa[_0x79db('0x26')];var _0x2d3f18=_0x79db('0x27')+_0x55bdaa[_0x79db('0x28')];return db[_0x79db('0x29')]['query'](_0x2d3f18,{'type':db[_0x79db('0x2a')]['QueryTypes'][_0x79db('0x2b')],'raw':!![]})[_0x79db('0x1c')](function(_0xaf2526){return _0xaf2526;})[_0x79db('0x1c')](function(_0x2a517f){if(_0x2a517f){_0x55bdaa[_0x79db('0x2c')]=_0x2a517f[0x0];}if(_0x55bdaa[_0x79db('0x2d')]){return db[_0x79db('0x2e')][_0x79db('0x2f')]({'where':{'id':_0x55bdaa['UserId']},'attributes':['id',_0x79db('0x30'),'fullname',_0x79db('0x31'),'internal'],'raw':!![]})[_0x79db('0x1c')](function(_0x16c47d){_0x55bdaa[_0x79db('0x32')]=util[_0x79db('0x33')](_0x79db('0x34'),_0x16c47d['name']);_0x55bdaa[_0x79db('0x23')]=_0x2dbcb6;_0x55bdaa[_0x79db('0x35')]=_0x16c47d;return request({'event':_0x79db('0x36'),'message':_0x55bdaa});})[_0x79db('0x21')](function(_0x416bc2){console[_0x79db('0x1f')](_0x416bc2);});}else{return request({'event':_0x79db('0x37'),'message':_0x55bdaa});}});};}function afterCreate(_0x32d33e,_0x42abea){return function(_0x4ead6b,_0x39a731){_0x4ead6b=_0x4ead6b[_0x79db('0x22')]({'plain':!![]});_0x4ead6b[_0x79db('0x23')]=_0x32d33e;_0x4ead6b[_0x79db('0x24')]=_0x32d33e;_0x4ead6b[_0x79db('0x25')]=_0x79db('0x38');var _0x4a6739=_0x79db('0x27')+_0x4ead6b[_0x79db('0x28')];return db['sequelize']['query'](_0x4a6739,{'type':db[_0x79db('0x2a')][_0x79db('0x39')]['SELECT'],'raw':!![]})[_0x79db('0x1c')](function(_0x447a3f){return _0x447a3f;})['then'](function(_0xa73b70){if(_0xa73b70){_0x4ead6b['contact']=_0xa73b70[0x0];}return request({'event':_0x42abea,'message':_0x4ead6b});});};}function afterUpdate(_0x3ea25a){return function(_0x30a8fa){var _0x3a7a0d=_0x30a8fa[_0x79db('0x3a')](_0x79db('0x3b'))&&_0x30a8fa[_0x79db('0x3b')];var _0x2b4932=_0x30a8fa[_0x79db('0x3a')]('substatus');if(_0x3a7a0d||_0x2b4932){var _0x33ea6a=_0x3a7a0d?_0x79db('0xc'):_0x79db('0x3c');var _0x5cfb5a=_0x30a8fa['get']({'plain':!![]});_0x5cfb5a[_0x79db('0x23')]=_0x3ea25a;_0x5cfb5a[_0x79db('0x24')]=_0x3ea25a;_0x5cfb5a['event']=_0x3a7a0d?'closed':_0x79db('0x3c');var _0x321648='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5cfb5a[_0x79db('0x28')];return db[_0x79db('0x29')][_0x79db('0x3d')](_0x321648,{'type':db[_0x79db('0x2a')][_0x79db('0x39')][_0x79db('0x2b')],'raw':!![]})[_0x79db('0x1c')](function(_0x1acbc9){if(_0x1acbc9){_0x5cfb5a[_0x79db('0x2c')]=_0x1acbc9[0x0];}if(_0x5cfb5a['UserId']){return db[_0x79db('0x2e')][_0x79db('0x2f')]({'where':{'id':_0x5cfb5a[_0x79db('0x2d')]},'attributes':['id',_0x79db('0x30'),_0x79db('0x3e'),_0x79db('0x31'),_0x79db('0x3f')],'raw':!![]})['then'](function(_0x6537cb){_0x5cfb5a[_0x79db('0x32')]=util[_0x79db('0x33')]('SIP/%s',_0x6537cb[_0x79db('0x30')]);_0x5cfb5a['agent']=_0x6537cb;return request({'event':_0x33ea6a,'message':_0x5cfb5a});})['catch'](function(_0x26949f){console['error'](_0x26949f);});}else{return request({'event':_0x33ea6a,'message':_0x5cfb5a});}});}};}exports['default']=function(){for(var _0x55d4ad=0x0;_0x55d4ad=_0x263dd1[_0x02fa('0x12')]){throw Error(_0x02fa('0x13'));}_0x2b6a15(_0x4765f9);})[_0x02fa('0x14')](function(_0x36ca57){_0x19680b(_0x36ca57);});});}; \ No newline at end of file +var _0xba5f=['updateAttributes','getLicense','agent','User','count','then','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xba5f,0x1ea));var _0xfba5=function(_0x2fe689,_0xde3962){_0x2fe689=_0x2fe689-0x0;var _0x27b819=_0xba5f[_0x2fe689];return _0x27b819;};'use strict';var _=require('lodash');var BPromise=require(_0xfba5('0x0'));var db=require(_0xfba5('0x1'))['db'];var util=require('./license/util');var channels=[_0xfba5('0x2'),_0xfba5('0x3'),_0xfba5('0x4'),_0xfba5('0x5'),_0xfba5('0x6'),_0xfba5('0x7'),_0xfba5('0x8')];exports[_0xfba5('0x9')]=function(){return channels;};exports[_0xfba5('0xa')]=function(_0x3d6e94){_0x3d6e94=_0x3d6e94[_0xfba5('0xb')]();return _[_0xfba5('0xc')](channels,_0x3d6e94);};exports[_0xfba5('0xd')]=function(_0xa404ac,_0x44fa38,_0x533350,_0x454f55){var _0x330863={'loginAttempts':_0x44fa38,'blocked':_0x533350};if(!_[_0xfba5('0xe')](_0x454f55)){_0x330863[_0xfba5('0xf')]=_0x454f55;}return _0xa404ac[_0xfba5('0x10')](_0x330863);};exports[_0xfba5('0x11')]=function(_0x5a1cb8){return new BPromise(function(_0x40f85c,_0x451619){var _0x820672=0x0;if(_0x5a1cb8['role']!==_0xfba5('0x12')){_0x40f85c(_0x5a1cb8);}db[_0xfba5('0x13')][_0xfba5('0x14')]({'where':{'role':_0xfba5('0x12'),'online':!![],'id':{'$ne':_0x5a1cb8['id']}}})[_0xfba5('0x15')](function(_0xb835a){_0x820672=_0xb835a;return util[_0xfba5('0x11')]();})[_0xfba5('0x15')](function(_0x3e4538){if(_0x3e4538&&_0x3e4538['agents']&&_0x820672>=_0x3e4538['agents']){throw Error(_0xfba5('0x16'));}_0x40f85c(_0x5a1cb8);})['catch'](function(_0x13a8e4){_0x451619(_0x13a8e4);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 760426c..3583cb4 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe46f=['status','json','send','404','render'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0xe46f,0x157));var _0xfe46=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xe46f[_0x3a07c1];return _0x2bbe15;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1e0b33,_0x13ed1f){var _0x172258=_0xfe46('0x0');var _0x4602aa=0x194;var _0x8be335={'status':_0x4602aa};_0x13ed1f['status'](_0x8be335['status']);_0x13ed1f[_0xfe46('0x1')](_0x172258,{},function(_0x351d83,_0x1a2519){if(_0x351d83){return _0x13ed1f[_0xfe46('0x2')](_0x8be335[_0xfe46('0x2')])[_0xfe46('0x3')](_0x8be335);}_0x13ed1f[_0xfe46('0x4')](_0x1a2519);});}; \ No newline at end of file +var _0x7e6a=['render','send','exports','404','status'];(function(_0x3e3432,_0x4afb90){var _0x23274d=function(_0x32243d){while(--_0x32243d){_0x3e3432['push'](_0x3e3432['shift']());}};_0x23274d(++_0x4afb90);}(_0x7e6a,0xac));var _0xa7e6=function(_0x5856d7,_0x4043a7){_0x5856d7=_0x5856d7-0x0;var _0x237065=_0x7e6a[_0x5856d7];return _0x237065;};'use strict';module[_0xa7e6('0x0')][0x194]=function pageNotFound(_0x3dd7dc,_0x3f11ed){var _0x5aba09=_0xa7e6('0x1');var _0x158a99=0x194;var _0x1e0df2={'status':_0x158a99};_0x3f11ed['status'](_0x1e0df2[_0xa7e6('0x2')]);_0x3f11ed[_0xa7e6('0x3')](_0x5aba09,{},function(_0x899036,_0x253196){if(_0x899036){return _0x3f11ed[_0xa7e6('0x2')](_0x1e0df2[_0xa7e6('0x2')])['json'](_0x1e0df2);}_0x3f11ed[_0xa7e6('0x4')](_0x253196);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index d30f808..1aa9945 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteraction','belongsTo','UserProfile','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','VoiceQueueId','CmHopper','Hoppers','HopperHistories','CmHopperBlack','JscriptySessions','TrunkId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Interactions','List','ListId','Template','mandatoryDispositionPause','Agents','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','restrict','IntervalId','TagId','Items','FaxAccountId','Answers','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteraction','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ProactiveActions','Agent','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Action','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskField','int_desk_configuration_has_tags','ZohoField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','ServicenowField','Dynamics365Field','FromId','ToId','ProjectId','VoiceQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','TrunkBackup','TrunkBackupId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappInteractionId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','mysql','name','utf8_general_ci','sequelizeHistory','utf8mb4','utf8','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Automation','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount'];(function(_0x4cdecc,_0x321d1a){var _0x3948a9=function(_0x2a247d){while(--_0x2a247d){_0x4cdecc['push'](_0x4cdecc['shift']());}};_0x3948a9(++_0x321d1a);}(_0xac4a,0x13f));var _0xaac4=function(_0x3e1c8b,_0x3d6eb0){_0x3e1c8b=_0x3e1c8b-0x0;var _0x469e9a=_0xac4a[_0x3e1c8b];return _0x469e9a;};'use strict';var config=require(_0xaac4('0x0'));var Sequelize=require(_0xaac4('0x1'));var _=require(_0xaac4('0x2'));var jstz=require(_0xaac4('0x3'));var timezone=jstz[_0xaac4('0x4')]();config[_0xaac4('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xaac4('0x5'),'username':_0xaac4('0x6'),'password':_0xaac4('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xaac4('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xaac4('0x9')](),'define':{'charset':'utf8','collate':_0xaac4('0xa')}}});config[_0xaac4('0xb')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xaac4('0x5'),'username':'xcall','password':_0xaac4('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xaac4('0xc')},'logging':![],'timezone':timezone[_0xaac4('0x9')](),'define':{'charset':_0xaac4('0xd'),'collate':_0xaac4('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaac4('0x1')]['database'],config['sequelize'][_0xaac4('0xe')],config[_0xaac4('0x1')][_0xaac4('0xf')],config['sequelize'][_0xaac4('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaac4('0xb')]['database'],config[_0xaac4('0xb')][_0xaac4('0xe')],config[_0xaac4('0xb')][_0xaac4('0xf')],config[_0xaac4('0xb')][_0xaac4('0x10')])};db[_0xaac4('0x11')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x13'));db[_0xaac4('0x14')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xaac4('0x15')]=db['sequelize'][_0xaac4('0x12')]('../api/voiceContext/voiceContext.model');db[_0xaac4('0x16')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x17'));db[_0xaac4('0x18')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x19'));db[_0xaac4('0x1a')]=db['sequelize'][_0xaac4('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0xaac4('0x1b')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x1c'));db[_0xaac4('0x1d')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x1e'));db[_0xaac4('0x1f')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x20'));db[_0xaac4('0x21')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x22'));db['VoiceCallReport']=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db[_0xaac4('0x23')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x24'));db[_0xaac4('0x25')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x26'));db[_0xaac4('0x27')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x28'));db[_0xaac4('0x29')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x2a'));db[_0xaac4('0x2b')]=db['sequelize'][_0xaac4('0x12')]('../api/trunk/trunk.model');db[_0xaac4('0x2c')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x2d'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0xaac4('0x2e'));db[_0xaac4('0x2f')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x30'));db[_0xaac4('0x31')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x32'));db[_0xaac4('0x33')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x34'));db[_0xaac4('0x35')]=db[_0xaac4('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xaac4('0x36')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0xaac4('0x37')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x38'));db[_0xaac4('0x39')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xaac4('0x3a')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0xaac4('0x3b')]=db['sequelize']['import'](_0xaac4('0x3c'));db[_0xaac4('0x3d')]=db[_0xaac4('0x1')]['import']('../api/mailAccount/mailAccount.model');db[_0xaac4('0x3e')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x3f'));db[_0xaac4('0x40')]=db[_0xaac4('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xaac4('0x41')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x42'));db[_0xaac4('0x43')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x44'));db[_0xaac4('0x45')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x46'));db[_0xaac4('0x47')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0xaac4('0x48')]=db['sequelize']['import'](_0xaac4('0x49'));db[_0xaac4('0x4a')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x4b'));db[_0xaac4('0x4c')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/faxAccount/faxAccount.model');db[_0xaac4('0x4d')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x4e'));db['FaxInteraction']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x4f'));db['FaxMessage']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x50'));db[_0xaac4('0x51')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x52'));db[_0xaac4('0x53')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x54'));db[_0xaac4('0x55')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x56'));db[_0xaac4('0x57')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/smsApplication/smsApplication.model');db[_0xaac4('0x58')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x59'));db[_0xaac4('0x5a')]=db['sequelize']['import'](_0xaac4('0x5b'));db[_0xaac4('0x5c')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/smsQueue/smsQueue.model');db[_0xaac4('0x5d')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x5e'));db['OpenchannelApplication']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x5f'));db['OpenchannelInteraction']=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x60'));db[_0xaac4('0x61')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x62'));db['OpenchannelQueue']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x63'));db[_0xaac4('0x64')]=db['sequelize'][_0xaac4('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0xaac4('0x65')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x66'));db[_0xaac4('0x67')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x68'));db[_0xaac4('0x69')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x6a'));db[_0xaac4('0x6b')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x6c'));db[_0xaac4('0x6d')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x6e'));db[_0xaac4('0x6f')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/chatQueue/chatQueue.model');db[_0xaac4('0x70')]=db['sequelize'][_0xaac4('0x12')]('../api/chatGroup/chatGroup.model');db[_0xaac4('0x71')]=db['sequelize']['import'](_0xaac4('0x72'));db[_0xaac4('0x73')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x74'));db[_0xaac4('0x75')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x76'));db['CmHopper']=db[_0xaac4('0x1')]['import'](_0xaac4('0x77'));db['CmHopperBlack']=db['sequelize']['import'](_0xaac4('0x78'));db[_0xaac4('0x79')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xaac4('0x7a')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xaac4('0x7b')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x7c'));db[_0xaac4('0x7d')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xaac4('0x1')]['import']('../api/action/action.model');db[_0xaac4('0x7e')]=db['sequelize'][_0xaac4('0x12')]('../api/automation/automation.model');db[_0xaac4('0x7f')]=db[_0xaac4('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x80'));db[_0xaac4('0x81')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x82'));db[_0xaac4('0x83')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x84'));db[_0xaac4('0x85')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x86'));db[_0xaac4('0x87')]=db[_0xaac4('0x1')]['import']('../api/cdr/cdr.model');db[_0xaac4('0x88')]=db['sequelize']['import'](_0xaac4('0x89'));db['Schedule']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x8a'));db[_0xaac4('0x8b')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x8c'));db[_0xaac4('0x8d')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x8e'));db['Template']=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/template/template.model');db[_0xaac4('0x8f')]=db[_0xaac4('0x1')]['import']('../api/trigger/trigger.model');db[_0xaac4('0x90')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x91'));db[_0xaac4('0x92')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x93'));db['IntegrationReport']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x94'));db[_0xaac4('0x95')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xaac4('0x96')]=db[_0xaac4('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xaac4('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import'](_0xaac4('0x97'));db[_0xaac4('0x98')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xaac4('0x99')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x9a'));db[_0xaac4('0x9b')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xaac4('0x9c')]=db['sequelize']['import'](_0xaac4('0x9d'));db[_0xaac4('0x9e')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x9f'));db[_0xaac4('0xa0')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa1'));db[_0xaac4('0xa2')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa3'));db[_0xaac4('0xa4')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa5'));db[_0xaac4('0xa6')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa7'));db[_0xaac4('0xa8')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xa9'));db['DeskField']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xaa'));db[_0xaac4('0xab')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xac'));db[_0xaac4('0xad')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xae'));db['ZohoField']=db[_0xaac4('0x1')]['import'](_0xaac4('0xaf'));db[_0xaac4('0xb0')]=db['sequelize'][_0xaac4('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xaac4('0xb1')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xb2'));db[_0xaac4('0xb3')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xb4'));db[_0xaac4('0xb5')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xb6'));db[_0xaac4('0xb7')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xaac4('0xb8')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xaac4('0xb9')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xba'));db[_0xaac4('0xbb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xbc'));db[_0xaac4('0xbd')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xbe'));db[_0xaac4('0xbf')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc0'));db['ServicenowConfiguration']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc1'));db['ServicenowField']=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0xaac4('0xc2')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xc3'));db[_0xaac4('0xc4')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc5'));db['Dynamics365Field']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xc6'));db[_0xaac4('0xc7')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xc8'));db[_0xaac4('0xc9')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xca'));db[_0xaac4('0xcb')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x93'));db[_0xaac4('0xcc')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xcd'));db[_0xaac4('0xce')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xcf'));db[_0xaac4('0xd0')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd1'));db[_0xaac4('0xd2')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xaac4('0xd3')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd4'));db[_0xaac4('0xd5')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xaac4('0xd6')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd7'));db[_0xaac4('0xd8')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xd9'));db['SquareDetailsReport']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xda'));db[_0xaac4('0xdb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xdc'));db[_0xaac4('0xdd')]=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/setting/setting.model');db['SquareOdbc']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xde'));db[_0xaac4('0xdf')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xe0'));db[_0xaac4('0xe1')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe2'));db[_0xaac4('0xe3')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe4'));db[_0xaac4('0xe5')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe6'));db[_0xaac4('0xe7')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xe8'));db[_0xaac4('0xe9')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xea'));db[_0xaac4('0xeb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xec'));db[_0xaac4('0xed')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xee'));db[_0xaac4('0xef')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xf0'));db[_0xaac4('0xf1')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xf2'));db[_0xaac4('0xf3')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xf4'));db[_0xaac4('0xf5')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xf6'));db[_0xaac4('0xf7')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0xf8'));db[_0xaac4('0xf9')]=db[_0xaac4('0x1')]['import'](_0xaac4('0xfa'));db[_0xaac4('0xfb')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xfc'));db[_0xaac4('0xfd')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xfe'));db['UserProfile']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0xff'));db[_0xaac4('0x100')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x101'));db[_0xaac4('0x102')]=db[_0xaac4('0x1')]['import'](_0xaac4('0x103'));db[_0xaac4('0x104')]=db['sequelize']['import'](_0xaac4('0x105'));db[_0xaac4('0x106')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x107'));db[_0xaac4('0x108')]=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x109'));db['WhatsappInteraction']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x10a'));db['WhatsappMessage']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x10b'));db[_0xaac4('0x10c')]=db['sequelize']['import'](_0xaac4('0x10d'));db[_0xaac4('0x10e')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x10f'));db[_0xaac4('0x110')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x111'));db['CloudProvider']=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x112'));db[_0xaac4('0x113')]=db[_0xaac4('0x1')][_0xaac4('0x12')](_0xaac4('0x114'));db['TeamVoicePrefix']=db[_0xaac4('0x1')][_0xaac4('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db['sequelize'][_0xaac4('0x12')](_0xaac4('0x115'));db[_0xaac4('0x11')][_0xaac4('0x116')](db[_0xaac4('0x1f')],{'as':_0xaac4('0x1f'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x1b')],{'as':_0xaac4('0x11a'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')]['hasMany'](db[_0xaac4('0x11b')],{'as':'VoiceQueuesRt','foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db['VoiceExtension'],{'as':_0xaac4('0x11c'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x11')][_0xaac4('0x119')](db['CmHopperFinal'],{'as':_0xaac4('0x11d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x11e'),'foreignKey':'UserId'});db[_0xaac4('0x11')][_0xaac4('0x119')](db['ReportAgentPreview'],{'as':_0xaac4('0x7b'),'foreignKey':_0xaac4('0x118')});db['User']['hasMany'](db['OpenchannelInteraction'],{'as':_0xaac4('0x11f'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')]['hasMany'](db[_0xaac4('0x69')],{'as':'ChatInteractions','foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x58')],{'as':_0xaac4('0x120'),'foreignKey':'UserId'});db[_0xaac4('0x11')]['hasMany'](db[_0xaac4('0x121')],{'as':_0xaac4('0x122'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x41')],{'as':_0xaac4('0x123'),'foreignKey':'UserId'});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x124')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xaac4('0x11')][_0xaac4('0x119')](db[_0xaac4('0x104')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0xaac4('0x125')](db[_0xaac4('0x126')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xaac4('0x11')][_0xaac4('0x127')](db['ChatGroup'],{'as':'Groups','through':_0xaac4('0x128')});db[_0xaac4('0x11')]['belongsToMany'](db[_0xaac4('0x75')],{'as':_0xaac4('0x129'),'through':'cm_user_has_contacts'});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x12a'),'through':_0xaac4('0x12b')});db[_0xaac4('0x11')]['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0xaac4('0x11')]['belongsToMany'](db[_0xaac4('0x41')],{'as':'MailInteractions','through':_0xaac4('0x12c')});db['User'][_0xaac4('0x127')](db[_0xaac4('0x69')],{'as':'ChatInteractions','through':_0xaac4('0x12d')});db['User'][_0xaac4('0x127')](db['FaxInteraction'],{'as':_0xaac4('0x122'),'through':_0xaac4('0x12e')});db['User'][_0xaac4('0x127')](db[_0xaac4('0x58')],{'as':_0xaac4('0x120'),'through':_0xaac4('0x12f')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0xaac4('0x130')});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x124')],{'as':_0xaac4('0x131'),'through':_0xaac4('0x132')});db[_0xaac4('0x11')]['belongsToMany'](db[_0xaac4('0x1a')],{'as':'VoiceQueues','through':_0xaac4('0x2f'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xfd')],{'as':_0xaac4('0x133'),'through':_0xaac4('0x134'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x3e')],{'as':_0xaac4('0x135'),'through':'UserMailQueue','required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x6f')],{'as':_0xaac4('0x136'),'through':_0xaac4('0x31'),'required':![],'hooks':!![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db['FaxQueue'],{'as':_0xaac4('0x137'),'through':_0xaac4('0x35'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x5c')],{'as':_0xaac4('0x138'),'through':_0xaac4('0x36'),'required':![]});db['User'][_0xaac4('0x127')](db[_0xaac4('0x139')],{'as':_0xaac4('0x13a'),'through':_0xaac4('0x37'),'required':![]});db[_0xaac4('0x11')]['belongsToMany'](db['WhatsappQueue'],{'as':_0xaac4('0x13b'),'through':_0xaac4('0x39'),'required':![]});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'through':_0xaac4('0x12b')});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x64')],{'as':_0xaac4('0x13c'),'through':_0xaac4('0x13d')});db['User'][_0xaac4('0x127')](db['FaxAccount'],{'as':'FaxAccounts','through':_0xaac4('0x13e')});db['User'][_0xaac4('0x127')](db[_0xaac4('0x3d')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x5d')],{'as':_0xaac4('0x13f'),'through':_0xaac4('0x140')});db[_0xaac4('0x11')][_0xaac4('0x127')](db['SmsAccount'],{'as':_0xaac4('0x141'),'through':_0xaac4('0x142')});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0x106')],{'as':_0xaac4('0x143'),'through':'user_has_whatsapp_accounts'});db[_0xaac4('0x11')][_0xaac4('0x127')](db[_0xaac4('0xdf')],{'as':_0xaac4('0x144'),'through':_0xaac4('0x145')});db[_0xaac4('0x14')]['hasMany'](db[_0xaac4('0x16')],{'as':_0xaac4('0x146'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x147')});db['VoiceContext'][_0xaac4('0x119')](db[_0xaac4('0x16')],{'onDelete':_0xaac4('0x117')});db[_0xaac4('0x16')][_0xaac4('0x119')](db[_0xaac4('0x16')],{'as':_0xaac4('0x148'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x18')][_0xaac4('0x127')](db['Sound'],{'as':'Sounds','through':_0xaac4('0x149')});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0x11b')],{'as':'Members','foreignKey':_0xaac4('0x14a')});db['VoiceQueue']['hasMany'](db[_0xaac4('0x14b')],{'as':_0xaac4('0x14c'),'foreignKey':_0xaac4('0x14a')});db[_0xaac4('0x1a')]['hasMany'](db[_0xaac4('0x79')],{'as':_0xaac4('0x11d'),'foreignKey':'VoiceQueueId'});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x14d'),'foreignKey':_0xaac4('0x14a')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':_0xaac4('0x7b'),'foreignKey':_0xaac4('0x14a')});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0x14e')],{'as':'HopperBlacks','foreignKey':_0xaac4('0x14a')});db[_0xaac4('0x1a')][_0xaac4('0x119')](db[_0xaac4('0xd5')],{'as':_0xaac4('0x14f'),'foreignKey':'VoiceQueueId'});db[_0xaac4('0x1a')][_0xaac4('0x125')](db['Trunk'],{'as':'Trunk','foreignKey':_0xaac4('0x150')});db[_0xaac4('0x1a')][_0xaac4('0x125')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0xaac4('0x125')](db[_0xaac4('0x83')],{'as':_0xaac4('0x83'),'foreignKey':'IntervalId'});db[_0xaac4('0x1a')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xaac4('0x151')});db['VoiceQueue'][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x12a'),'through':_0xaac4('0x152')});db[_0xaac4('0x1a')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x2f')});db[_0xaac4('0x1a')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'as':_0xaac4('0x153'),'through':_0xaac4('0x113')});db['VoiceQueue'][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x154'),'through':_0xaac4('0x155')});db[_0xaac4('0x1b')]['belongsTo'](db[_0xaac4('0x11')],{'as':'User','foreignKey':_0xaac4('0x118')});db[_0xaac4('0x1d')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x11'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x1f')][_0xaac4('0x119')](db[_0xaac4('0x21')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':'mailboxuser','sourceKey':_0xaac4('0x157')});db[_0xaac4('0x21')][_0xaac4('0x125')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xaac4('0x157')});db[_0xaac4('0x158')][_0xaac4('0x119')](db['VoiceQueueReport'],{'as':_0xaac4('0x159'),'foreignKey':_0xaac4('0x15a'),'constraints':![]});db[_0xaac4('0x158')][_0xaac4('0x119')](db[_0xaac4('0x25')],{'as':_0xaac4('0x15b'),'foreignKey':_0xaac4('0x15a'),'constraints':![]});db[_0xaac4('0x158')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x11'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x158')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x3a')][_0xaac4('0x125')](db['MailAccount'],{'as':_0xaac4('0x3d'),'foreignKey':_0xaac4('0x15e')});db['MailServerOut'][_0xaac4('0x125')](db['MailAccount'],{'as':_0xaac4('0x3d'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xaac4('0x116')](db[_0xaac4('0x3a')],{'as':_0xaac4('0x15f'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x3d')][_0xaac4('0x116')](db[_0xaac4('0x3b')],{'as':_0xaac4('0x160'),'onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':'MailAccountId','onDelete':_0xaac4('0x117')});db['MailAccount']['hasMany'](db[_0xaac4('0x7f')],{'as':'Answers','foreignKey':_0xaac4('0x15e')});db[_0xaac4('0x3d')][_0xaac4('0x119')](db[_0xaac4('0x43')],{'as':_0xaac4('0x156'),'foreignKey':_0xaac4('0x15e')});db[_0xaac4('0x3d')]['hasMany'](db[_0xaac4('0x41')],{'as':_0xaac4('0x163')});db[_0xaac4('0x3d')][_0xaac4('0x119')](db['MailApplication'],{'as':_0xaac4('0x148')});db[_0xaac4('0x3d')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x3d')][_0xaac4('0x125')](db['Template'],{'as':_0xaac4('0x166'),'foreignKey':'TemplateId'});db[_0xaac4('0x3d')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db[_0xaac4('0x3d')][_0xaac4('0x127')](db['User'],{'as':_0xaac4('0x168'),'through':_0xaac4('0x169')});db[_0xaac4('0x3e')]['belongsToMany'](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x33')});db[_0xaac4('0x3e')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x16a'),'as':_0xaac4('0x153')});db[_0xaac4('0x41')][_0xaac4('0x119')](db[_0xaac4('0x43')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x16b')});db[_0xaac4('0x41')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'as':_0xaac4('0x16c'),'foreignKey':'MailAccountId'});db[_0xaac4('0x41')][_0xaac4('0x125')](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x41')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':'UserId'});db[_0xaac4('0x41')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x16e'),'as':_0xaac4('0x16f')});db[_0xaac4('0x41')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x16e'),'as':_0xaac4('0x170')});db['MailInteraction'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x12c'),'foreignKey':_0xaac4('0x16b')});db['MailMessage'][_0xaac4('0x119')](db[_0xaac4('0xed')],{'as':_0xaac4('0x172'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x43')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x11')});db[_0xaac4('0x43')]['belongsTo'](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact'});db[_0xaac4('0x43')]['belongsTo'](db[_0xaac4('0x41')],{'as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x16b')});db[_0xaac4('0x43')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x15e')});db['MailMessage'][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x64'),'foreignKey':_0xaac4('0x174')});db[_0xaac4('0x43')][_0xaac4('0x125')](db['ChatOfflineMessage'],{'as':_0xaac4('0x6d'),'foreignKey':'ChatOfflineMessageId'});db[_0xaac4('0x45')]['belongsTo'](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x45')][_0xaac4('0x125')](db[_0xaac4('0x3e')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x45')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0xaac4('0x83')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x176')});db[_0xaac4('0x45')][_0xaac4('0x125')](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x47')][_0xaac4('0x125')](db['MailAccount'],{});db[_0xaac4('0x47')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':'List','foreignKey':_0xaac4('0x165')});db[_0xaac4('0x47')]['belongsTo'](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x47')][_0xaac4('0x125')](db['MailInteraction'],{});db[_0xaac4('0x47')][_0xaac4('0x125')](db[_0xaac4('0x43')],{});db[_0xaac4('0x47')][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db[_0xaac4('0x47')]['belongsTo'](db[_0xaac4('0x3e')],{});db[_0xaac4('0x48')]['hasMany'](db[_0xaac4('0x4a')],{'as':_0xaac4('0x178'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x4c')][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x179'),'onDelete':_0xaac4('0x117')});db['FaxAccount']['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x179')});db[_0xaac4('0x4c')][_0xaac4('0x119')](db[_0xaac4('0x121')],{'as':'Interactions'});db[_0xaac4('0x4c')][_0xaac4('0x119')](db[_0xaac4('0x4d')],{'as':_0xaac4('0x148')});db['FaxAccount'][_0xaac4('0x119')](db[_0xaac4('0x16')],{'as':_0xaac4('0x17b'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x4c')]['hasMany'](db[_0xaac4('0x17c')],{'as':_0xaac4('0x156')});db['FaxAccount']['belongsTo'](db[_0xaac4('0x2b')],{'as':_0xaac4('0x2b')});db[_0xaac4('0x4c')][_0xaac4('0x125')](db['CmList'],{'as':'List','foreignKey':_0xaac4('0x165')});db[_0xaac4('0x4c')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db['FaxAccount'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x13e')});db['FaxApplication'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x4d')][_0xaac4('0x125')](db[_0xaac4('0x51')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x4d')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x4d')]['belongsTo'](db['Tag'],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x121')][_0xaac4('0x119')](db['FaxMessage'],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x17d')});db['FaxInteraction'][_0xaac4('0x125')](db[_0xaac4('0x4c')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x179')});db[_0xaac4('0x121')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x121')][_0xaac4('0x125')](db['User'],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db['FaxInteraction'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':'fax_interaction_has_tags','as':_0xaac4('0x16f')});db[_0xaac4('0x121')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x17e'),'as':'ThroughTags'});db[_0xaac4('0x121')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':'user_has_fax_interactions','foreignKey':_0xaac4('0x17d')});db[_0xaac4('0x17c')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x11')});db[_0xaac4('0x17c')]['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xaac4('0x17d')});db[_0xaac4('0x17c')][_0xaac4('0x125')](db['CmContact'],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x15c')});db[_0xaac4('0x17c')]['belongsTo'](db[_0xaac4('0xed')],{'as':_0xaac4('0xed'),'foreignKey':_0xaac4('0x17f')});db['FaxMessage'][_0xaac4('0x125')](db[_0xaac4('0x4c')],{'as':_0xaac4('0x16c'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x35')});db[_0xaac4('0x51')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x180'),'as':'Teams'});db[_0xaac4('0x53')]['belongsTo'](db[_0xaac4('0x4c')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xaac4('0x53')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x53')][_0xaac4('0x125')](db[_0xaac4('0x121')],{});db[_0xaac4('0x53')]['belongsTo'](db[_0xaac4('0x17c')],{});db['FaxQueueReport'][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db['FaxQueueReport'][_0xaac4('0x125')](db[_0xaac4('0x51')],{});db[_0xaac4('0x55')][_0xaac4('0x119')](db['Disposition'],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x181'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x55')][_0xaac4('0x119')](db['CannedAnswer'],{'as':_0xaac4('0x17a'),'foreignKey':'SmsAccountId'});db[_0xaac4('0x55')][_0xaac4('0x119')](db[_0xaac4('0x5a')],{'as':_0xaac4('0x156'),'foreignKey':_0xaac4('0x181')});db[_0xaac4('0x55')]['hasMany'](db['SmsInteraction'],{'as':_0xaac4('0x163')});db[_0xaac4('0x55')][_0xaac4('0x119')](db[_0xaac4('0x57')],{'as':_0xaac4('0x148')});db['SmsAccount']['belongsTo'](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x55')]['belongsTo'](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xaac4('0x55')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x5c')],{'onDelete':_0xaac4('0x175')});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x55')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x57')][_0xaac4('0x125')](db[_0xaac4('0x83')],{'onDelete':'restrict','foreignKey':_0xaac4('0x176')});db['SmsApplication'][_0xaac4('0x125')](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db['SmsInteraction'][_0xaac4('0x119')](db['SmsMessage'],{'as':'Messages','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x182')});db['SmsInteraction']['belongsTo'](db[_0xaac4('0x55')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x181')});db[_0xaac4('0x58')]['belongsTo'](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':'ContactId'});db[_0xaac4('0x58')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':'UserId'});db['SmsInteraction'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x183'),'as':_0xaac4('0x16f')});db[_0xaac4('0x58')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x183'),'as':_0xaac4('0x170')});db[_0xaac4('0x58')]['belongsToMany'](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x12f'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xaac4('0x125')](db['User'],{'as':'User'});db[_0xaac4('0x5a')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact'});db[_0xaac4('0x5a')][_0xaac4('0x125')](db[_0xaac4('0x58')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x173'),'foreignKey':'SmsInteractionId'});db[_0xaac4('0x5a')][_0xaac4('0x125')](db[_0xaac4('0x55')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x181')});db[_0xaac4('0x5c')]['belongsToMany'](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x36'),'foreignKey':_0xaac4('0x184')});db[_0xaac4('0x5c')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x185'),'as':_0xaac4('0x153')});db[_0xaac4('0x5d')][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x186'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x5d')]['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x186')});db['OpenchannelAccount']['hasMany'](db[_0xaac4('0x187')],{'as':_0xaac4('0x163'),'foreignKey':_0xaac4('0x186')});db['OpenchannelAccount']['hasMany'](db[_0xaac4('0x61')],{'as':_0xaac4('0x156'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xaac4('0x119')](db[_0xaac4('0x188')],{'as':_0xaac4('0x148'),'foreignKey':_0xaac4('0x186')});db[_0xaac4('0x5d')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':'ListId'});db[_0xaac4('0x5d')]['belongsTo'](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db['OpenchannelAccount'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x140')});db['OpenchannelApplication']['belongsTo'](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x188')][_0xaac4('0x125')](db[_0xaac4('0x139')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x189')});db['OpenchannelApplication'][_0xaac4('0x125')](db[_0xaac4('0x5d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x186')});db[_0xaac4('0x188')][_0xaac4('0x125')](db[_0xaac4('0x83')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x176')});db['OpenchannelApplication'][_0xaac4('0x125')](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x187')][_0xaac4('0x119')](db[_0xaac4('0x61')],{'as':_0xaac4('0x156'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xaac4('0x187')][_0xaac4('0x125')](db[_0xaac4('0x5d')],{'as':'Account','foreignKey':_0xaac4('0x186')});db[_0xaac4('0x187')][_0xaac4('0x125')](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x187')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x187')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x18a'),'as':_0xaac4('0x16f')});db[_0xaac4('0x187')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xaac4('0x187')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Users','through':_0xaac4('0x130'),'foreignKey':_0xaac4('0x18b')});db[_0xaac4('0x61')]['belongsTo'](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x11')});db[_0xaac4('0x61')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact'});db[_0xaac4('0x61')][_0xaac4('0x125')](db[_0xaac4('0x187')],{'onDelete':'cascade','as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x18b')});db['OpenchannelMessage'][_0xaac4('0x125')](db[_0xaac4('0xed')],{'as':_0xaac4('0xed'),'foreignKey':_0xaac4('0x17f')});db['OpenchannelMessage']['belongsTo'](db[_0xaac4('0x5d')],{'as':_0xaac4('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0xaac4('0x139')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x37'),'foreignKey':_0xaac4('0x189')});db[_0xaac4('0x139')]['belongsToMany'](db[_0xaac4('0xe5')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite'][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':'Dispositions','foreignKey':_0xaac4('0x174'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x64')]['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x174')});db['ChatWebsite']['hasMany'](db['ChatProactiveAction'],{'as':_0xaac4('0x18c')});db[_0xaac4('0x64')][_0xaac4('0x119')](db[_0xaac4('0x69')],{'as':_0xaac4('0x163')});db['ChatWebsite'][_0xaac4('0x119')](db[_0xaac4('0x67')],{'as':'Applications'});db['ChatWebsite'][_0xaac4('0x119')](db[_0xaac4('0x6b')],{'as':'Messages'});db[_0xaac4('0x64')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x64')][_0xaac4('0x125')](db[_0xaac4('0x83')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xaac4('0x64')][_0xaac4('0x125')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xaac4('0x15e')});db[_0xaac4('0x64')]['belongsTo'](db['Pause'],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db[_0xaac4('0x64')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x13d')});db[_0xaac4('0x65')]['belongsTo'](db[_0xaac4('0x5d')],{});db[_0xaac4('0x65')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xaac4('0x165')});db['OpenchannelQueueReport'][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x65')][_0xaac4('0x125')](db[_0xaac4('0x187')],{});db[_0xaac4('0x65')][_0xaac4('0x125')](db[_0xaac4('0x61')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xaac4('0x11')],{});db[_0xaac4('0x65')][_0xaac4('0x125')](db['OpenchannelQueue'],{});db[_0xaac4('0x67')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x18d'),'foreignKey':'UserId','onDelete':'restrict'});db[_0xaac4('0x67')][_0xaac4('0x125')](db[_0xaac4('0x6f')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0xaac4('0x175')});db['ChatApplication'][_0xaac4('0x125')](db['ChatWebsite'],{'as':_0xaac4('0x18e'),'foreignKey':_0xaac4('0x174'),'onDelete':_0xaac4('0x175')});db['ChatApplication']['belongsTo'](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':'TagId'});db[_0xaac4('0x69')][_0xaac4('0x119')](db[_0xaac4('0x6b')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':'ChatInteractionId'});db[_0xaac4('0x69')][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x174')});db[_0xaac4('0x69')]['belongsTo'](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x69')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x69')][_0xaac4('0x127')](db['Tag'],{'through':_0xaac4('0x18f'),'as':_0xaac4('0x16f')});db[_0xaac4('0x69')][_0xaac4('0x127')](db['Tag'],{'through':_0xaac4('0x18f'),'as':_0xaac4('0x170')});db[_0xaac4('0x69')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xaac4('0x190')});db['ChatMessage'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':'cascade','as':_0xaac4('0x11')});db[_0xaac4('0x6b')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':'Contact','foreignKey':_0xaac4('0x15d')});db['ChatMessage'][_0xaac4('0x125')](db[_0xaac4('0x69')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x190')});db[_0xaac4('0x6b')][_0xaac4('0x125')](db['Attachment'],{'as':_0xaac4('0xed'),'foreignKey':'AttachmentId'});db[_0xaac4('0x6b')]['belongsTo'](db[_0xaac4('0x64')],{'as':'Account','foreignKey':_0xaac4('0x174')});db['ChatOfflineMessage'][_0xaac4('0x119')](db[_0xaac4('0xed')],{'as':_0xaac4('0x172'),'foreignKey':_0xaac4('0x191'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x6d')]['belongsTo'](db['CmContact'],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db['ChatOfflineMessage'][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x174')});db[_0xaac4('0x6f')]['belongsToMany'](db[_0xaac4('0x11')],{'as':'Agents','through':_0xaac4('0x31'),'hooks':!![]});db[_0xaac4('0x6f')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x192'),'as':'Teams'});db['ChatGroup'][_0xaac4('0x119')](db[_0xaac4('0xd0')],{'as':_0xaac4('0x156'),'foreignKey':_0xaac4('0x193'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x70')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Members','through':_0xaac4('0x128')});db['ChatProactiveAction'][_0xaac4('0x125')](db[_0xaac4('0x64')],{'as':_0xaac4('0x18e'),'foreignKey':'ChatWebsiteId'});db[_0xaac4('0x73')]['hasMany'](db[_0xaac4('0x75')],{'as':_0xaac4('0x129'),'foreignKey':_0xaac4('0x194')});db[_0xaac4('0x75')]['hasMany'](db[_0xaac4('0x14b')],{'as':_0xaac4('0x14c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x75')][_0xaac4('0x119')](db['CmHopperFinal'],{'as':_0xaac4('0x11d'),'foreignKey':'ContactId'});db[_0xaac4('0x75')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x14d'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x75')]['hasMany'](db[_0xaac4('0x7b')],{'as':_0xaac4('0x7b'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x75')][_0xaac4('0x119')](db[_0xaac4('0xd5')],{'as':_0xaac4('0x14f'),'foreignKey':_0xaac4('0x15d')});db['CmContact']['hasMany'](db[_0xaac4('0x187')],{'as':_0xaac4('0x11f'),'foreignKey':'ContactId','onDelete':_0xaac4('0x175')});db[_0xaac4('0x75')][_0xaac4('0x119')](db[_0xaac4('0x69')],{'as':'ChatInteractions','foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x175')});db[_0xaac4('0x75')]['hasMany'](db[_0xaac4('0x58')],{'as':_0xaac4('0x120'),'foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x175')});db['CmContact'][_0xaac4('0x119')](db[_0xaac4('0x121')],{'as':_0xaac4('0x122'),'foreignKey':_0xaac4('0x15d'),'onDelete':'restrict'});db[_0xaac4('0x75')][_0xaac4('0x119')](db['MailInteraction'],{'as':_0xaac4('0x123'),'foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x175')});db[_0xaac4('0x75')][_0xaac4('0x125')](db[_0xaac4('0x73')],{'as':_0xaac4('0x195'),'foreignKey':_0xaac4('0x194')});db[_0xaac4('0x75')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':'ListId','onDelete':_0xaac4('0x117')});db[_0xaac4('0x75')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Users','through':_0xaac4('0x196')});db['CmContact'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'as':_0xaac4('0x16f'),'through':_0xaac4('0x197')});db['CmContact'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x197'),'as':_0xaac4('0x170')});db[_0xaac4('0x14b')]['belongsTo'](db['CmContact'],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14b')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14b')][_0xaac4('0x125')](db['User'],{'as':_0xaac4('0x18d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x14b')][_0xaac4('0x125')](db[_0xaac4('0x1a')],{'as':_0xaac4('0x198'),'foreignKey':'VoiceQueueId','onDelete':_0xaac4('0x117')});db['CmHopper'][_0xaac4('0x125')](db[_0xaac4('0xe9')],{'as':_0xaac4('0xe9'),'foreignKey':_0xaac4('0x199'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14b')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':'OwnerId'});db[_0xaac4('0x14e')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d'),'onDelete':'cascade'});db['CmHopperBlack'][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':'List','foreignKey':_0xaac4('0x165'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x14e')]['belongsTo'](db[_0xaac4('0x1a')],{'as':_0xaac4('0x198'),'foreignKey':_0xaac4('0x14a'),'onDelete':_0xaac4('0x117')});db['CmHopperBlack'][_0xaac4('0x125')](db['Campaign'],{'as':_0xaac4('0xe9'),'foreignKey':'CampaignId','onDelete':_0xaac4('0x117')});db['Automation'][_0xaac4('0x119')](db[_0xaac4('0x81')],{'as':{'plural':_0xaac4('0x19a'),'singular':_0xaac4('0x19b')},'foreignKey':_0xaac4('0x19c'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x7e')][_0xaac4('0x119')](db[_0xaac4('0x81')],{'as':{'plural':_0xaac4('0x19d'),'singular':_0xaac4('0x19e')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xaac4('0x7e')]['hasMany'](db[_0xaac4('0x19f')],{'as':'Actions','foreignKey':_0xaac4('0x1a0'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db[_0xaac4('0x161')][_0xaac4('0x119')](db['Disposition'],{'as':_0xaac4('0x162'),'foreignKey':_0xaac4('0x1a1'),'onDelete':_0xaac4('0x117')});db['Interval'][_0xaac4('0x119')](db[_0xaac4('0x83')],{'as':_0xaac4('0x1a2'),'foreignKey':_0xaac4('0x176'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xaac4('0x83')][_0xaac4('0x119')](db['VoiceExtension'],{'as':_0xaac4('0x11c'),'foreignKey':'IntervalId','onDelete':_0xaac4('0x175')});db[_0xaac4('0x83')][_0xaac4('0x119')](db[_0xaac4('0x45')],{'as':_0xaac4('0x1a3'),'foreignKey':_0xaac4('0x176')});db[_0xaac4('0x83')]['hasMany'](db['ChatApplication'],{'as':_0xaac4('0x1a4'),'foreignKey':_0xaac4('0x176')});db[_0xaac4('0x83')][_0xaac4('0x119')](db[_0xaac4('0x4d')],{'as':_0xaac4('0x1a5'),'foreignKey':'IntervalId'});db['Interval'][_0xaac4('0x119')](db[_0xaac4('0x57')],{'as':'SmsApplications','foreignKey':_0xaac4('0x176')});db[_0xaac4('0x1a6')]['belongsTo'](db[_0xaac4('0x3d')],{});db[_0xaac4('0x1a6')][_0xaac4('0x125')](db[_0xaac4('0x96')],{'foreignKey':_0xaac4('0x1a7')});db[_0xaac4('0x1a6')]['belongsTo'](db[_0xaac4('0x95')],{'foreignKey':_0xaac4('0x1a8')});db[_0xaac4('0x8b')][_0xaac4('0x127')](db[_0xaac4('0x18')],{'as':'Mohs','through':_0xaac4('0x149'),'onDelete':'restrict'});db['Tag'][_0xaac4('0x127')](db[_0xaac4('0x75')],{'through':_0xaac4('0x197')});db[_0xaac4('0x8d')][_0xaac4('0x127')](db[_0xaac4('0x69')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xaac4('0x127')](db[_0xaac4('0x41')],{'through':_0xaac4('0x16e')});db['Tag'][_0xaac4('0x127')](db[_0xaac4('0x58')],{'through':_0xaac4('0x183')});db[_0xaac4('0x8d')][_0xaac4('0x127')](db[_0xaac4('0x121')],{'through':'fax_interaction_has_tags'});db[_0xaac4('0x8d')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xaac4('0x18a')});db[_0xaac4('0x8d')][_0xaac4('0x127')](db['WhatsappInteraction'],{'through':_0xaac4('0x1a9')});db['Trigger']['hasMany'](db[_0xaac4('0x81')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xaac4('0x8f')][_0xaac4('0x119')](db[_0xaac4('0x81')],{'as':{'plural':_0xaac4('0x1aa'),'singular':_0xaac4('0x1ab')},'foreignKey':_0xaac4('0x1ac'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db['Trigger'][_0xaac4('0x119')](db['Action'],{'as':_0xaac4('0x1ad'),'foreignKey':_0xaac4('0x1ae'),'onDelete':_0xaac4('0x117'),'hooks':!![]});db['AnalyticCustomReport'][_0xaac4('0x119')](db['AnalyticFieldReport'],{'as':_0xaac4('0x1af'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1a8'),'hooks':!![]});db[_0xaac4('0x96')][_0xaac4('0x119')](db[_0xaac4('0x98')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xaac4('0x1b0')][_0xaac4('0x119')](db[_0xaac4('0x98')],{'as':_0xaac4('0x1af'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b1')});db[_0xaac4('0x98')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0xaac4('0x1b1')});db[_0xaac4('0x9b')][_0xaac4('0x119')](db[_0xaac4('0x9c')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['SalesforceConfiguration'][_0xaac4('0x119')](db['SalesforceField'],{'as':_0xaac4('0x1b4'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x9c')][_0xaac4('0x119')](db[_0xaac4('0x9e')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x9c')][_0xaac4('0x119')](db[_0xaac4('0x9e')],{'as':_0xaac4('0x1af'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x9c')][_0xaac4('0x125')](db[_0xaac4('0x9b')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x9e')][_0xaac4('0x119')](db['SalesforceField'],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db['SalesforceField'][_0xaac4('0x119')](db['SalesforceField'],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x9e')]['hasMany'](db[_0xaac4('0x9e')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x9e')]['belongsTo'](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db['SugarcrmAccount']['hasMany'](db[_0xaac4('0xa2')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xa2')][_0xaac4('0x119')](db['SugarcrmField'],{'as':_0xaac4('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xaac4('0xa2')][_0xaac4('0x119')](db[_0xaac4('0xa4')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xa2')][_0xaac4('0x119')](db[_0xaac4('0xa4')],{'as':'Fields','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b8')});db['SugarcrmConfiguration'][_0xaac4('0x125')](db[_0xaac4('0xa0')],{'as':_0xaac4('0x16c'),'foreignKey':'AccountId'});db['SugarcrmField']['hasMany'](db[_0xaac4('0xa4')],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xa4')][_0xaac4('0x119')](db[_0xaac4('0xa4')],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xa4')]['hasMany'](db['SugarcrmField'],{'as':_0xaac4('0x1bb'),'foreignKey':'FieldId'});db[_0xaac4('0xa4')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':'VariableId'});db[_0xaac4('0xa6')][_0xaac4('0x119')](db[_0xaac4('0xa8')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['DeskConfiguration'][_0xaac4('0x119')](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1b4'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xa8')]['hasMany'](db['DeskField'],{'as':_0xaac4('0x1b6'),'onDelete':'cascade','foreignKey':_0xaac4('0x1b7')});db['DeskConfiguration']['hasMany'](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xa8')][_0xaac4('0x125')](db['DeskAccount'],{'as':'Account','foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xa8')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x1be')});db[_0xaac4('0x1bd')]['hasMany'](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1b9'),'foreignKey':'SubjectId'});db[_0xaac4('0x1bd')][_0xaac4('0x119')](db[_0xaac4('0x1bd')],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db[_0xaac4('0x1bd')][_0xaac4('0x119')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db['DeskField']['belongsTo'](db['Variable'],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xab')][_0xaac4('0x119')](db['ZohoConfiguration'],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xad')][_0xaac4('0x119')](db['ZohoField'],{'as':_0xaac4('0x1b4'),'onDelete':_0xaac4('0x117'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xaac4('0x119')](db[_0xaac4('0x1bf')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xaac4('0x1bf')],{'as':'Fields','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xad')][_0xaac4('0x125')](db['ZohoAccount'],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x1bf')][_0xaac4('0x119')](db['ZohoField'],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1bf')][_0xaac4('0x119')](db[_0xaac4('0x1bf')],{'as':'Description','foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x1bf')][_0xaac4('0x119')](db[_0xaac4('0x1bf')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x1bf')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xb0')]['hasMany'](db[_0xaac4('0xb1')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xb1')]['hasMany'](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1b4'),'foreignKey':_0xaac4('0x1b5')});db['ZendeskConfiguration']['hasMany'](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1b6'),'foreignKey':'DescriptionId'});db[_0xaac4('0xb1')][_0xaac4('0x119')](db['ZendeskField'],{'as':'Fields','foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xb1')][_0xaac4('0x125')](db[_0xaac4('0xb0')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xb1')]['belongsToMany'](db[_0xaac4('0x8d')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0xaac4('0x119')](db['ZendeskField'],{'as':_0xaac4('0x1b9'),'foreignKey':'SubjectId'});db[_0xaac4('0xb3')][_0xaac4('0x119')](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xb3')]['hasMany'](db[_0xaac4('0xb3')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xb3')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xb5')][_0xaac4('0x119')](db['FreshdeskConfiguration'],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xb7')][_0xaac4('0x119')](db[_0xaac4('0xb8')],{'as':_0xaac4('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xaac4('0xb7')]['hasMany'](db[_0xaac4('0xb8')],{'as':_0xaac4('0x1b6'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xb7')]['hasMany'](db[_0xaac4('0xb8')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':_0xaac4('0x1b8')});db['FreshdeskConfiguration'][_0xaac4('0x125')](db[_0xaac4('0xb5')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db['FreshdeskConfiguration'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x1c0')});db[_0xaac4('0xb8')][_0xaac4('0x119')](db[_0xaac4('0xb8')],{'as':'Subject','foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xb8')][_0xaac4('0x119')](db['FreshdeskField'],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db[_0xaac4('0xb8')][_0xaac4('0x119')](db['FreshdeskField'],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xb8')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xb9')][_0xaac4('0x119')](db[_0xaac4('0xbb')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['VtigerConfiguration']['hasMany'](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1b4'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xbb')][_0xaac4('0x119')](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1b6'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xbb')][_0xaac4('0x119')](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1af'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xbb')]['belongsTo'](db[_0xaac4('0xb9')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xbd')][_0xaac4('0x119')](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1b9'),'foreignKey':'SubjectId'});db[_0xaac4('0xbd')][_0xaac4('0x119')](db['VtigerField'],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db['VtigerField']['hasMany'](db[_0xaac4('0xbd')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xbd')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xbf')][_0xaac4('0x119')](db[_0xaac4('0x1c1')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x1c1')]['hasMany'](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1b4'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1c1')][_0xaac4('0x119')](db['ServicenowField'],{'as':_0xaac4('0x1b6'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0x1c1')][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1af'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x1c1')]['belongsTo'](db[_0xaac4('0xbf')],{'as':_0xaac4('0x16c'),'foreignKey':'AccountId'});db['ServicenowField'][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1b9'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1c2')][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xaac4('0x119')](db[_0xaac4('0x1c2')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0x1c2')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':'Variable','foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xc2')][_0xaac4('0x119')](db[_0xaac4('0xc4')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xc4')]['hasMany'](db[_0xaac4('0x1c3')],{'as':'Descriptions','onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xc4')][_0xaac4('0x119')](db[_0xaac4('0x1c3')],{'as':_0xaac4('0x1af'),'onDelete':'cascade','foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xaac4('0x125')](db[_0xaac4('0xc2')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0x1c3')][_0xaac4('0x119')](db[_0xaac4('0x1c3')],{'as':'Subject','foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0x1c3')]['hasMany'](db[_0xaac4('0x1c3')],{'as':_0xaac4('0x1ba'),'foreignKey':'DescriptionId'});db[_0xaac4('0x1c3')][_0xaac4('0x119')](db[_0xaac4('0x1c3')],{'as':_0xaac4('0x1bb'),'foreignKey':'FieldId'});db[_0xaac4('0x1c3')][_0xaac4('0x125')](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xaac4('0x119')](db[_0xaac4('0xc9')],{'as':_0xaac4('0x1b2'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1b3')});db[_0xaac4('0xc9')][_0xaac4('0x119')](db[_0xaac4('0xcb')],{'as':_0xaac4('0x1b4'),'foreignKey':'SubjectId'});db[_0xaac4('0xc9')][_0xaac4('0x119')](db['FreshsalesField'],{'as':_0xaac4('0x1b6'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xc9')]['hasMany'](db['FreshsalesField'],{'as':_0xaac4('0x1af'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xc9')][_0xaac4('0x125')](db[_0xaac4('0xc7')],{'as':'Account','foreignKey':_0xaac4('0x1b3')});db['FreshsalesField'][_0xaac4('0x119')](db[_0xaac4('0xcb')],{'as':'Subject','foreignKey':_0xaac4('0x1b5')});db[_0xaac4('0xcb')][_0xaac4('0x119')](db[_0xaac4('0xcb')],{'as':_0xaac4('0x1ba'),'foreignKey':_0xaac4('0x1b7')});db[_0xaac4('0xcb')]['hasMany'](db[_0xaac4('0xcb')],{'as':_0xaac4('0x1bb'),'foreignKey':_0xaac4('0x1b8')});db[_0xaac4('0xcb')]['belongsTo'](db[_0xaac4('0x90')],{'as':_0xaac4('0x90'),'foreignKey':_0xaac4('0x1bc')});db[_0xaac4('0xce')][_0xaac4('0x125')](db[_0xaac4('0x64')],{});db['ChatQueueReport'][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0xce')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db[_0xaac4('0xce')][_0xaac4('0x125')](db[_0xaac4('0x69')],{});db[_0xaac4('0xce')][_0xaac4('0x125')](db['ChatMessage'],{});db[_0xaac4('0xce')][_0xaac4('0x125')](db['User'],{});db[_0xaac4('0xce')][_0xaac4('0x125')](db['ChatQueue'],{});db[_0xaac4('0xd0')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':'cascade','foreignKey':_0xaac4('0x1c4')});db[_0xaac4('0xd0')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1c5')});db[_0xaac4('0xd5')][_0xaac4('0x119')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xaac4('0x117')});db[_0xaac4('0xd5')][_0xaac4('0x119')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0xaac4('0x117')});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0x55')],{});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':'ListId'});db[_0xaac4('0xd6')]['belongsTo'](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db['SmsQueueReport'][_0xaac4('0x125')](db['SmsInteraction'],{});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0x5a')],{});db[_0xaac4('0xd6')][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db[_0xaac4('0xd6')]['belongsTo'](db[_0xaac4('0x5c')],{});db['JscriptyProject'][_0xaac4('0x119')](db['JscriptySessionReport'],{'foreignKey':_0xaac4('0x1c6')});db[_0xaac4('0xdb')][_0xaac4('0x119')](db[_0xaac4('0xd3')],{'foreignKey':'ProjectId'});db[_0xaac4('0xdb')][_0xaac4('0x119')](db[_0xaac4('0xd2')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x145')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':'user_has_teams'});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0x1a')],{'through':_0xaac4('0x113'),'as':_0xaac4('0x1c7')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0x3e')],{'through':_0xaac4('0x16a'),'as':_0xaac4('0x135')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db['ChatQueue'],{'through':_0xaac4('0x192'),'as':_0xaac4('0x136')});db['Team'][_0xaac4('0x127')](db[_0xaac4('0x51')],{'through':_0xaac4('0x180'),'as':_0xaac4('0x137')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db['SmsQueue'],{'through':_0xaac4('0x185'),'as':_0xaac4('0x138')});db[_0xaac4('0xe5')]['belongsToMany'](db[_0xaac4('0x139')],{'through':_0xaac4('0x1c8'),'as':_0xaac4('0x13a')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db['WhatsappQueue'],{'through':_0xaac4('0x1c9'),'as':_0xaac4('0x13b')});db[_0xaac4('0xe5')][_0xaac4('0x127')](db[_0xaac4('0xfd')],{'through':_0xaac4('0x1ca'),'as':_0xaac4('0x133')});db['Campaign'][_0xaac4('0x119')](db[_0xaac4('0x14b')],{'as':_0xaac4('0x14c'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')][_0xaac4('0x119')](db[_0xaac4('0x79')],{'as':_0xaac4('0x11d'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')][_0xaac4('0x119')](db['CmHopperHistory'],{'as':_0xaac4('0x14d'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')][_0xaac4('0x119')](db[_0xaac4('0x14e')],{'as':_0xaac4('0x1cb'),'foreignKey':_0xaac4('0x199')});db[_0xaac4('0xe9')]['belongsTo'](db['Trunk'],{'as':_0xaac4('0x2b'),'foreignKey':_0xaac4('0x150')});db[_0xaac4('0xe9')][_0xaac4('0x125')](db['Trunk'],{'as':_0xaac4('0x1cc'),'foreignKey':_0xaac4('0x1cd')});db[_0xaac4('0xe9')]['belongsTo'](db[_0xaac4('0x83')],{'as':'Interval','foreignKey':_0xaac4('0x176')});db[_0xaac4('0xe9')][_0xaac4('0x125')](db[_0xaac4('0xdf')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xaac4('0xe9')]['belongsToMany'](db[_0xaac4('0xfb')],{'as':'Lists','through':_0xaac4('0x1ce')});db['Campaign'][_0xaac4('0x127')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x154'),'through':'campaigns_has_cm_blacklists'});db[_0xaac4('0xed')][_0xaac4('0x125')](db[_0xaac4('0x6d')],{'as':_0xaac4('0x6d'),'foreignKey':_0xaac4('0x191')});db[_0xaac4('0xf1')]['belongsTo'](db['MailMessage'],{});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x41')],{});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'foreignKey':_0xaac4('0x1cf'),'as':_0xaac4('0x1d0')});db[_0xaac4('0xf1')]['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d1'),'as':'FromAgent'});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db['MailTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x3e')],{'foreignKey':_0xaac4('0x1d4'),'as':_0xaac4('0x1d5')});db[_0xaac4('0xf1')][_0xaac4('0x125')](db[_0xaac4('0x3d')],{'foreignKey':_0xaac4('0x1d6'),'as':_0xaac4('0x1d7')});db['ChatTransferReport'][_0xaac4('0x125')](db['ChatMessage'],{});db[_0xaac4('0xf3')][_0xaac4('0x125')](db['ChatInteraction'],{});db[_0xaac4('0xf3')][_0xaac4('0x125')](db['ChatWebsite'],{'foreignKey':_0xaac4('0x1d8'),'as':_0xaac4('0x1d0')});db[_0xaac4('0xf3')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':'FromUserId','as':_0xaac4('0x1d9')});db[_0xaac4('0xf3')]['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db[_0xaac4('0xf3')]['belongsTo'](db[_0xaac4('0x6f')],{'foreignKey':_0xaac4('0x1da'),'as':'ToQueue'});db[_0xaac4('0xf3')][_0xaac4('0x125')](db['ChatWebsite'],{'foreignKey':_0xaac4('0x1db'),'as':_0xaac4('0x1d7')});db[_0xaac4('0xf5')][_0xaac4('0x125')](db[_0xaac4('0x17c')],{});db[_0xaac4('0xf5')][_0xaac4('0x125')](db[_0xaac4('0x121')],{});db[_0xaac4('0xf5')][_0xaac4('0x125')](db[_0xaac4('0x4c')],{'foreignKey':_0xaac4('0x1dc'),'as':_0xaac4('0x1d0')});db[_0xaac4('0xf5')][_0xaac4('0x125')](db['User'],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db['FaxTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db['FaxTransferReport'][_0xaac4('0x125')](db['FaxQueue'],{'foreignKey':_0xaac4('0x1dd'),'as':_0xaac4('0x1d5')});db[_0xaac4('0xf5')][_0xaac4('0x125')](db['FaxAccount'],{'foreignKey':_0xaac4('0x1de'),'as':_0xaac4('0x1d7')});db[_0xaac4('0xf7')][_0xaac4('0x125')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xaac4('0x187')],{});db['OpenchannelTransferReport'][_0xaac4('0x125')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0xaac4('0x1d0')});db['OpenchannelTransferReport'][_0xaac4('0x125')](db['User'],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db['OpenchannelTransferReport']['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db[_0xaac4('0xf7')]['belongsTo'](db[_0xaac4('0x139')],{'foreignKey':_0xaac4('0x1df'),'as':_0xaac4('0x1d5')});db['OpenchannelTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x5d')],{'foreignKey':_0xaac4('0x1e0'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0xaac4('0x5a')],{});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x58')],{});db[_0xaac4('0xf9')][_0xaac4('0x125')](db['SmsAccount'],{'foreignKey':_0xaac4('0x1e1'),'as':'FromAccount'});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x5c')],{'foreignKey':_0xaac4('0x1e2'),'as':_0xaac4('0x1d5')});db[_0xaac4('0xf9')][_0xaac4('0x125')](db[_0xaac4('0x55')],{'foreignKey':_0xaac4('0x1e3'),'as':'ToAccount'});db[_0xaac4('0xfb')]['hasMany'](db['Disposition'],{'as':_0xaac4('0x162'),'foreignKey':'ListId','onDelete':_0xaac4('0x117')});db['CmList'][_0xaac4('0x119')](db[_0xaac4('0x7d')],{'as':_0xaac4('0x1e4'),'foreignKey':_0xaac4('0x165')});db['CmList'][_0xaac4('0x119')](db[_0xaac4('0x75')],{'as':_0xaac4('0x129'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x165')});db['CmList']['hasMany'](db[_0xaac4('0x79')],{'as':'HopperFinals','foreignKey':_0xaac4('0x165')});db[_0xaac4('0xfb')][_0xaac4('0x119')](db[_0xaac4('0x7a')],{'as':_0xaac4('0x11e'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0xfb')]['hasMany'](db[_0xaac4('0x7b')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xaac4('0xfb')][_0xaac4('0x127')](db[_0xaac4('0x1a')],{'as':_0xaac4('0x1e5'),'through':_0xaac4('0x152')});db[_0xaac4('0xfb')]['belongsToMany'](db[_0xaac4('0x11')],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix'][_0xaac4('0x119')](db[_0xaac4('0x16')],{'as':'Extensions','onDelete':_0xaac4('0x117')});db['VoicePrefix'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x168'),'through':_0xaac4('0x134')});db[_0xaac4('0xfd')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x1ca'),'as':_0xaac4('0x153')});db[_0xaac4('0x126')][_0xaac4('0x119')](db['User'],{'as':'Users','foreignKey':_0xaac4('0x1e6')});db[_0xaac4('0x126')][_0xaac4('0x119')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xaac4('0x1e6'),'onDelete':'cascade'});db['UserProfileSection'][_0xaac4('0x119')](db['UserProfileResource'],{'as':_0xaac4('0x1e7'),'foreignKey':_0xaac4('0x1e8'),'onDelete':_0xaac4('0x117')});db[_0xaac4('0x106')][_0xaac4('0x119')](db[_0xaac4('0x161')],{'as':_0xaac4('0x162'),'foreignKey':'WhatsappAccountId','onDelete':_0xaac4('0x117')});db[_0xaac4('0x106')]['hasMany'](db[_0xaac4('0x7f')],{'as':_0xaac4('0x17a'),'foreignKey':_0xaac4('0x1e9')});db[_0xaac4('0x106')][_0xaac4('0x119')](db[_0xaac4('0x1ea')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xaac4('0x119')](db[_0xaac4('0x124')],{'as':'Interactions'});db[_0xaac4('0x106')]['hasMany'](db[_0xaac4('0x108')],{'as':_0xaac4('0x148')});db['WhatsappAccount'][_0xaac4('0x125')](db[_0xaac4('0xfb')],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x106')][_0xaac4('0x125')](db[_0xaac4('0x85')],{'as':_0xaac4('0x167'),'foreignKey':_0xaac4('0x151')});db[_0xaac4('0x106')]['belongsToMany'](db['User'],{'as':_0xaac4('0x168'),'through':_0xaac4('0x1eb')});db[_0xaac4('0x108')][_0xaac4('0x125')](db['User'],{'onDelete':_0xaac4('0x175')});db[_0xaac4('0x108')][_0xaac4('0x125')](db[_0xaac4('0x110')],{'onDelete':'restrict'});db[_0xaac4('0x108')][_0xaac4('0x125')](db[_0xaac4('0x106')],{'onDelete':_0xaac4('0x175')});db['WhatsappApplication']['belongsTo'](db[_0xaac4('0x83')],{'onDelete':_0xaac4('0x175'),'foreignKey':'IntervalId'});db[_0xaac4('0x108')]['belongsTo'](db[_0xaac4('0x8d')],{'onDelete':_0xaac4('0x175'),'foreignKey':_0xaac4('0x177')});db[_0xaac4('0x124')][_0xaac4('0x119')](db[_0xaac4('0x1ea')],{'as':_0xaac4('0x156'),'onDelete':_0xaac4('0x117'),'foreignKey':_0xaac4('0x1ec')});db[_0xaac4('0x124')][_0xaac4('0x125')](db[_0xaac4('0x106')],{'as':_0xaac4('0x16c'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':'Contact','foreignKey':_0xaac4('0x15d')});db['WhatsappInteraction'][_0xaac4('0x125')](db[_0xaac4('0x11')],{'as':_0xaac4('0x16d'),'foreignKey':_0xaac4('0x118')});db[_0xaac4('0x124')][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':_0xaac4('0x1a9'),'as':_0xaac4('0x16f')});db['WhatsappInteraction'][_0xaac4('0x127')](db[_0xaac4('0x8d')],{'through':'whatsapp_interaction_has_tags','as':_0xaac4('0x170')});db['WhatsappInteraction'][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':_0xaac4('0x171'),'through':_0xaac4('0x132'),'foreignKey':_0xaac4('0x1ec')});db[_0xaac4('0x1ea')]['belongsTo'](db[_0xaac4('0x11')],{'as':_0xaac4('0x11')});db[_0xaac4('0x1ea')]['belongsTo'](db[_0xaac4('0x75')],{'onDelete':_0xaac4('0x117'),'as':_0xaac4('0x15c')});db[_0xaac4('0x1ea')][_0xaac4('0x125')](db[_0xaac4('0x124')],{'onDelete':'cascade','as':_0xaac4('0x173'),'foreignKey':_0xaac4('0x1ec')});db[_0xaac4('0x1ea')][_0xaac4('0x125')](db[_0xaac4('0x106')],{'as':_0xaac4('0x16c'),'foreignKey':_0xaac4('0x1e9')});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x106')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db['CmList'],{'as':_0xaac4('0x164'),'foreignKey':_0xaac4('0x165')});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x75')],{'as':_0xaac4('0x15c'),'foreignKey':_0xaac4('0x15d')});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x124')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x110')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x1ea')],{});db[_0xaac4('0x10c')][_0xaac4('0x125')](db[_0xaac4('0x11')],{});db[_0xaac4('0x10e')]['belongsTo'](db[_0xaac4('0x1ea')],{});db[_0xaac4('0x10e')][_0xaac4('0x125')](db['WhatsappInteraction'],{});db[_0xaac4('0x10e')][_0xaac4('0x125')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xaac4('0x1d0')});db['WhatsappTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x106')],{'foreignKey':'ToWhatsappAccountId','as':_0xaac4('0x1d7')});db['WhatsappTransferReport'][_0xaac4('0x125')](db[_0xaac4('0x110')],{'foreignKey':_0xaac4('0x1ed'),'as':_0xaac4('0x1d5')});db[_0xaac4('0x10e')]['belongsTo'](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d1'),'as':_0xaac4('0x1d9')});db[_0xaac4('0x10e')][_0xaac4('0x125')](db[_0xaac4('0x11')],{'foreignKey':_0xaac4('0x1d2'),'as':_0xaac4('0x1d3')});db[_0xaac4('0x110')][_0xaac4('0x127')](db[_0xaac4('0x11')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xaac4('0x1ee')});db[_0xaac4('0x110')][_0xaac4('0x127')](db[_0xaac4('0xe5')],{'through':_0xaac4('0x1c9'),'as':_0xaac4('0x153')});module[_0xaac4('0x1ef')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb688=['user_has_whatsapp_interactions','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueue','SmsQueues','WhatsappQueue','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessionReport','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','AgentReports','uniqueid','Contact','ContactId','Imap','Dispositions','MailAccountId','Answers','Interactions','List','ListId','TemplateId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','MailMessage','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','Dashboard','Items','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatMessage','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','cm_contact_has_tags','OwnerId','CampaignId','All','OneAll','AutomationAllId','Automation','OneAny','AutomationId','ParentId','Intervals','MailApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','CustomReportId','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','Description','Field','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','Subject','SubjectId','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','VoiceQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','UserVoicePrefix','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','mysql','name','database','username','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.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','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','cascade','VoiceRecording','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions'];(function(_0x1ac424,_0x2a1440){var _0x5c1db2=function(_0x7c8ea8){while(--_0x7c8ea8){_0x1ac424['push'](_0x1ac424['shift']());}};_0x5c1db2(++_0x2a1440);}(_0xb688,0xcf));var _0x8b68=function(_0xf05f72,_0x56b3a5){_0xf05f72=_0xf05f72-0x0;var _0x232444=_0xb688[_0xf05f72];return _0x232444;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x8b68('0x0'));var _=require(_0x8b68('0x1'));var jstz=require(_0x8b68('0x2'));var timezone=jstz[_0x8b68('0x3')]();config[_0x8b68('0x0')]=_[_0x8b68('0x4')](config['sequelize'],{'database':_0x8b68('0x5'),'username':_0x8b68('0x6'),'password':_0x8b68('0x7'),'options':{'host':_0x8b68('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8b68('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8b68('0xa'),'collate':_0x8b68('0xb')}}});config[_0x8b68('0xc')]=_[_0x8b68('0x4')](config[_0x8b68('0xc')],{'database':_0x8b68('0x5'),'username':_0x8b68('0x6'),'password':_0x8b68('0x7'),'options':{'host':_0x8b68('0x8'),'port':0xcea,'dialect':_0x8b68('0xd'),'dialectOptions':{'charset':_0x8b68('0x9')},'logging':![],'timezone':timezone[_0x8b68('0xe')](),'define':{'charset':_0x8b68('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8b68('0x0')][_0x8b68('0xf')],config[_0x8b68('0x0')][_0x8b68('0x10')],config[_0x8b68('0x0')][_0x8b68('0x11')],config[_0x8b68('0x0')][_0x8b68('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8b68('0xc')]['database'],config[_0x8b68('0xc')]['username'],config['sequelizeHistory'][_0x8b68('0x11')],config[_0x8b68('0xc')][_0x8b68('0x12')])};db['User']=db['sequelize'][_0x8b68('0x13')]('../api/user/user.model');db[_0x8b68('0x14')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x15'));db['VoiceContext']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/voiceContext/voiceContext.model');db[_0x8b68('0x16')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x17'));db[_0x8b68('0x18')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x19'));db[_0x8b68('0x1a')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x1b'));db['VoiceRecording']=db['sequelize'][_0x8b68('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x8b68('0x1c')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x1d'));db[_0x8b68('0x1e')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x1f'));db[_0x8b68('0x20')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x21'));db[_0x8b68('0x22')]=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db[_0x8b68('0x23')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x8b68('0x24')]=db['sequelize']['import'](_0x8b68('0x25'));db['VoiceQueueReport']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x26'));db[_0x8b68('0x27')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x28'));db['VoiceTransferReport']=db[_0x8b68('0x0')]['import'](_0x8b68('0x29'));db[_0x8b68('0x2a')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x2b'));db[_0x8b68('0x2c')]=db['sequelize']['import'](_0x8b68('0x2d'));db[_0x8b68('0x2e')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x2f'));db[_0x8b68('0x30')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x31'));db[_0x8b68('0x32')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x33'));db[_0x8b68('0x34')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x35'));db[_0x8b68('0x36')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x37'));db[_0x8b68('0x38')]=db['sequelize']['import'](_0x8b68('0x39'));db[_0x8b68('0x3a')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x3b'));db[_0x8b68('0x3c')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x8b68('0x3d')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x3e'));db[_0x8b68('0x3f')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x40'));db['MailSubstatus']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x41'));db[_0x8b68('0x42')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x43'));db['MailMessage']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/mailMessage/mailMessage.model');db[_0x8b68('0x44')]=db[_0x8b68('0x0')]['import']('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x45'));db['Dashboard']=db[_0x8b68('0x0')]['import'](_0x8b68('0x46'));db[_0x8b68('0x47')]=db['sequelize'][_0x8b68('0x13')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x48'));db[_0x8b68('0x49')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x4a'));db['FaxInteraction']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x8b68('0x4b')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x4c'));db['FaxQueue']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x4d'));db[_0x8b68('0x4e')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x4f'));db[_0x8b68('0x50')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x51'));db[_0x8b68('0x52')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x53'));db[_0x8b68('0x54')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x55'));db['SmsMessage']=db[_0x8b68('0x0')]['import']('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x56'));db[_0x8b68('0x57')]=db['sequelize']['import'](_0x8b68('0x58'));db[_0x8b68('0x59')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x5a'));db[_0x8b68('0x5b')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x5c'));db['OpenchannelMessage']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x8b68('0x5d')]=db[_0x8b68('0x0')]['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x5e'));db[_0x8b68('0x5f')]=db['sequelize']['import'](_0x8b68('0x60'));db[_0x8b68('0x61')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x62'));db[_0x8b68('0x63')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x64'));db['ChatMessage']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/chatMessage/chatMessage.model');db[_0x8b68('0x65')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x66'));db[_0x8b68('0x67')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x68'));db[_0x8b68('0x69')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x6a'));db[_0x8b68('0x6b')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x6c'));db[_0x8b68('0x6d')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x6e'));db[_0x8b68('0x6f')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x70'));db[_0x8b68('0x71')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x72'));db[_0x8b68('0x73')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x74'));db[_0x8b68('0x75')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x8b68('0x76')]=db['sequelize']['import'](_0x8b68('0x77'));db['ReportAgentPreview']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x78'));db['CmCustomField']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x79'));db[_0x8b68('0x7a')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x7b'));db['Automation']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x7c'));db[_0x8b68('0x7d')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x7e'));db[_0x8b68('0x7f')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x80'));db[_0x8b68('0x81')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x82'));db[_0x8b68('0x83')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x84'));db['Pause']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x85'));db['Cdr']=db['sequelize']['import'](_0x8b68('0x86'));db[_0x8b68('0x87')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x88'));db['Schedule']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/schedule/schedule.model');db[_0x8b68('0x89')]=db['sequelize']['import']('../api/sound/sound.model');db[_0x8b68('0x8a')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x8b'));db[_0x8b68('0x8c')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x8d'));db[_0x8b68('0x8e')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x8f'));db[_0x8b68('0x90')]=db[_0x8b68('0x0')]['import']('../api/variable/variable.model');db[_0x8b68('0x91')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x92'));db[_0x8b68('0x93')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/integrationReport/integrationReport.model');db[_0x8b68('0x94')]=db['sequelize']['import'](_0x8b68('0x95'));db['AnalyticDefaultReport']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x8b68('0x96')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x97'));db[_0x8b68('0x98')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x99'));db[_0x8b68('0x9a')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x8b68('0x0')]['import'](_0x8b68('0x9b'));db[_0x8b68('0x9c')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x9d'));db[_0x8b68('0x9e')]=db[_0x8b68('0x0')]['import'](_0x8b68('0x9f'));db['SalesforceField']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xa0'));db['SugarcrmAccount']=db[_0x8b68('0x0')]['import'](_0x8b68('0xa1'));db['SugarcrmConfiguration']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xa2'));db['SugarcrmField']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xa3'));db[_0x8b68('0xa4')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xa5'));db[_0x8b68('0xa6')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xa7'));db[_0x8b68('0xa8')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xa9'));db['ZohoAccount']=db[_0x8b68('0x0')]['import'](_0x8b68('0xaa'));db[_0x8b68('0xab')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xac'));db[_0x8b68('0xad')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xae'));db[_0x8b68('0xaf')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xb0'));db['ZendeskConfiguration']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xb1'));db['ZendeskField']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xb2'));db[_0x8b68('0xb3')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xb4'));db[_0x8b68('0xb5')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xb6'));db['FreshdeskField']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xb7'));db[_0x8b68('0xb8')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8b68('0xb9')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xba'));db['VtigerField']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xbb'));db[_0x8b68('0xbc')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xbd'));db[_0x8b68('0xbe')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xbf'));db[_0x8b68('0xc0')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xc1'));db[_0x8b68('0xc2')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xc3'));db[_0x8b68('0xc4')]=db['sequelize'][_0x8b68('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x8b68('0xc5')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xc6'));db[_0x8b68('0xc7')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xc8'));db['FreshsalesConfiguration']=db['sequelize']['import'](_0x8b68('0xc9'));db[_0x8b68('0xca')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xcb'));db[_0x8b68('0x91')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x92'));db[_0x8b68('0xcc')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xcd'));db[_0x8b68('0xce')]=db[_0x8b68('0x0')]['import']('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xcf'));db[_0x8b68('0xd0')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xd1'));db['JscriptyQuestionReport']=db[_0x8b68('0x0')]['import'](_0x8b68('0xd2'));db['JscriptySessionReport']=db[_0x8b68('0x0')]['import'](_0x8b68('0xd3'));db[_0x8b68('0xd4')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xd5'));db['SquareReport']=db[_0x8b68('0x0')]['import'](_0x8b68('0xd6'));db['SquareDetailsReport']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xd7'));db[_0x8b68('0xd8')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xd9'));db['Setting']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xda'));db[_0x8b68('0xdb')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xdc'));db[_0x8b68('0xdd')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xde'));db[_0x8b68('0xdf')]=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/squareRecording/squareRecording.model');db[_0x8b68('0xe0')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xe1'));db[_0x8b68('0xe2')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xe3'));db[_0x8b68('0xe4')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xe5'));db[_0x8b68('0xe6')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xe7'));db['Migration']=db[_0x8b68('0x0')]['import']('../api/migration/migration.model');db['Attachment']=db[_0x8b68('0x0')][_0x8b68('0x13')]('../api/attachment/attachment.model');db[_0x8b68('0xe8')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xe9'));db[_0x8b68('0xea')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xeb'));db[_0x8b68('0xec')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xed'));db[_0x8b68('0xee')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xef'));db['OpenchannelTransferReport']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xf0'));db[_0x8b68('0xf1')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xf2'));db[_0x8b68('0xf3')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xf4'));db['VoicePrefix']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xf5'));db['UserProfile']=db[_0x8b68('0x0')]['import'](_0x8b68('0xf6'));db[_0x8b68('0xf7')]=db[_0x8b68('0x0')]['import'](_0x8b68('0xf8'));db['UserProfileResource']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xf9'));db[_0x8b68('0xfa')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xfb'));db[_0x8b68('0xfc')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0xfd'));db[_0x8b68('0xfe')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0xff'));db[_0x8b68('0x100')]=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x101'));db['WhatsappMessage']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x102'));db['WhatsappQueueReport']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x103'));db[_0x8b68('0x104')]=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x105'));db['WhatsappQueue']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x106'));db['CloudProvider']=db['sequelize'][_0x8b68('0x13')](_0x8b68('0x107'));db[_0x8b68('0x108')]=db['sequelize']['import'](_0x8b68('0x109'));db[_0x8b68('0x10a')]=db[_0x8b68('0x0')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x8b68('0x0')][_0x8b68('0x13')](_0x8b68('0x10b'));db[_0x8b68('0x10c')][_0x8b68('0x10d')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x8b68('0x10e'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x8b68('0x10f')],{'as':_0x8b68('0x110'),'foreignKey':_0x8b68('0x111')});db['User'][_0x8b68('0x112')](db['UserVoiceQueueRt'],{'as':_0x8b68('0x113'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x16')],{'as':_0x8b68('0x114'),'onDelete':_0x8b68('0x10e'),'hooks':!![]});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x75')],{'as':_0x8b68('0x115'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x76')],{'as':_0x8b68('0x116'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db['ReportAgentPreview'],{'as':_0x8b68('0x117'),'foreignKey':'UserId'});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x5b')],{'as':_0x8b68('0x118'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x63')],{'as':_0x8b68('0x119'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db['SmsInteraction'],{'as':_0x8b68('0x11a'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x11b')],{'as':_0x8b68('0x11c'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x42')],{'as':_0x8b68('0x11d'),'foreignKey':'UserId'});db[_0x8b68('0x10c')][_0x8b68('0x112')](db[_0x8b68('0x100')],{'as':_0x8b68('0x11e'),'foreignKey':_0x8b68('0x111')});db['User'][_0x8b68('0x112')](db[_0x8b68('0xfa')],{'as':'UserNotifications','foreignKey':_0x8b68('0x11f')});db[_0x8b68('0x10c')]['belongsTo'](db['UserProfile'],{'as':_0x8b68('0x120'),'foreignKey':_0x8b68('0x121')});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x69')],{'as':_0x8b68('0x123'),'through':_0x8b68('0x124')});db[_0x8b68('0x10c')]['belongsToMany'](db[_0x8b68('0x6f')],{'as':_0x8b68('0x125'),'through':_0x8b68('0x126')});db[_0x8b68('0x10c')]['belongsToMany'](db[_0x8b68('0xf3')],{'as':'Lists','through':_0x8b68('0x127')});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0xe2')],{'through':_0x8b68('0x128')});db[_0x8b68('0x10c')]['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0x8b68('0x122')](db[_0x8b68('0x63')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0x8b68('0x10c')][_0x8b68('0x122')](db['FaxInteraction'],{'as':_0x8b68('0x11c'),'through':_0x8b68('0x129')});db['User']['belongsToMany'](db[_0x8b68('0x54')],{'as':_0x8b68('0x11a'),'through':_0x8b68('0x12a')});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x5b')],{'as':_0x8b68('0x118'),'through':_0x8b68('0x12b')});db['User'][_0x8b68('0x122')](db[_0x8b68('0x100')],{'as':_0x8b68('0x11e'),'through':_0x8b68('0x12c')});db[_0x8b68('0x10c')]['belongsToMany'](db[_0x8b68('0x1a')],{'as':'VoiceQueues','through':_0x8b68('0x2c'),'required':![]});db['User'][_0x8b68('0x122')](db[_0x8b68('0x12d')],{'as':_0x8b68('0x12e'),'through':'UserVoicePrefix','required':![]});db[_0x8b68('0x10c')]['belongsToMany'](db[_0x8b68('0x3f')],{'as':_0x8b68('0x12f'),'through':_0x8b68('0x30'),'required':![]});db[_0x8b68('0x10c')]['belongsToMany'](db[_0x8b68('0x67')],{'as':_0x8b68('0x130'),'through':_0x8b68('0x2e'),'required':![],'hooks':!![]});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x131')],{'as':_0x8b68('0x132'),'through':_0x8b68('0x32'),'required':![]});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x133')],{'as':_0x8b68('0x134'),'through':_0x8b68('0x34'),'required':![]});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x5d')],{'as':'OpenchannelQueues','through':_0x8b68('0x36'),'required':![]});db['User'][_0x8b68('0x122')](db[_0x8b68('0x135')],{'as':_0x8b68('0x136'),'through':_0x8b68('0x38'),'required':![]});db[_0x8b68('0x10c')][_0x8b68('0x122')](db['CmList'],{'through':'cm_user_has_lists'});db['User'][_0x8b68('0x122')](db[_0x8b68('0x137')],{'as':_0x8b68('0x138'),'through':_0x8b68('0x139')});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x13a')],{'as':_0x8b68('0x13b'),'through':_0x8b68('0x13c')});db[_0x8b68('0x10c')]['belongsToMany'](db['MailAccount'],{'as':_0x8b68('0x13d'),'through':'user_has_mail_accounts'});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0x57')],{'as':_0x8b68('0x13e'),'through':_0x8b68('0x13f')});db[_0x8b68('0x10c')][_0x8b68('0x122')](db['SmsAccount'],{'as':'SmsAccounts','through':_0x8b68('0x140')});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0xfc')],{'as':_0x8b68('0x141'),'through':'user_has_whatsapp_accounts'});db[_0x8b68('0x10c')][_0x8b68('0x122')](db[_0x8b68('0xdd')],{'as':_0x8b68('0x142'),'through':_0x8b68('0x143')});db['VoiceChanSpy'][_0x8b68('0x112')](db[_0x8b68('0x16')],{'as':_0x8b68('0x144'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x145')});db['VoiceContext'][_0x8b68('0x112')](db['VoiceExtension'],{'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x16')]['hasMany'](db[_0x8b68('0x16')],{'as':_0x8b68('0x146'),'onDelete':_0x8b68('0x10e')});db['VoiceMusicOnHold'][_0x8b68('0x122')](db[_0x8b68('0x89')],{'as':'Sounds','through':_0x8b68('0x147')});db['VoiceQueue'][_0x8b68('0x112')](db[_0x8b68('0x2a')],{'as':_0x8b68('0x148'),'foreignKey':_0x8b68('0x149')});db[_0x8b68('0x1a')][_0x8b68('0x112')](db[_0x8b68('0x71')],{'as':_0x8b68('0x14a'),'foreignKey':_0x8b68('0x149')});db[_0x8b68('0x1a')][_0x8b68('0x112')](db['CmHopperFinal'],{'as':_0x8b68('0x115'),'foreignKey':'VoiceQueueId'});db[_0x8b68('0x1a')][_0x8b68('0x112')](db[_0x8b68('0x76')],{'as':'HopperHistories','foreignKey':_0x8b68('0x149')});db['VoiceQueue'][_0x8b68('0x112')](db[_0x8b68('0x117')],{'as':'ReportAgentPreview','foreignKey':_0x8b68('0x149')});db['VoiceQueue'][_0x8b68('0x112')](db['CmHopperBlack'],{'as':_0x8b68('0x14b'),'foreignKey':_0x8b68('0x149')});db['VoiceQueue'][_0x8b68('0x112')](db[_0x8b68('0x14c')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8b68('0x14d')](db[_0x8b68('0x27')],{'as':_0x8b68('0x27'),'foreignKey':_0x8b68('0x14e')});db['VoiceQueue'][_0x8b68('0x14d')](db[_0x8b68('0x27')],{'as':_0x8b68('0x14f'),'foreignKey':_0x8b68('0x150')});db[_0x8b68('0x1a')][_0x8b68('0x14d')](db[_0x8b68('0x83')],{'as':_0x8b68('0x83'),'foreignKey':_0x8b68('0x151')});db['VoiceQueue'][_0x8b68('0x14d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8b68('0x1a')][_0x8b68('0x122')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x152'),'through':_0x8b68('0x153')});db[_0x8b68('0x1a')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x2c')});db[_0x8b68('0x1a')][_0x8b68('0x122')](db[_0x8b68('0xe2')],{'as':_0x8b68('0x155'),'through':_0x8b68('0x108')});db[_0x8b68('0x1a')]['belongsToMany'](db[_0x8b68('0xf3')],{'as':_0x8b68('0x156'),'through':_0x8b68('0x157')});db[_0x8b68('0x10f')][_0x8b68('0x14d')](db['User'],{'as':_0x8b68('0x10c'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x1c')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x10c'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x1e')][_0x8b68('0x112')](db[_0x8b68('0x20')],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x8b68('0x20')][_0x8b68('0x14d')](db['VoiceMail'],{'foreignKey':_0x8b68('0x159'),'targetKey':_0x8b68('0x15a')});db[_0x8b68('0x22')][_0x8b68('0x112')](db[_0x8b68('0x15b')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x8b68('0x22')][_0x8b68('0x112')](db['VoiceAgentReport'],{'as':_0x8b68('0x15c'),'foreignKey':_0x8b68('0x15d'),'constraints':![]});db['VoiceCallReport'][_0x8b68('0x14d')](db['User'],{'as':_0x8b68('0x10c'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x22')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x3a')]['belongsTo'](db[_0x8b68('0x3d')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x8b68('0x3c')][_0x8b68('0x14d')](db[_0x8b68('0x3d')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x8b68('0x3d')]['hasOne'](db[_0x8b68('0x3a')],{'as':_0x8b68('0x160'),'onDelete':_0x8b68('0x10e')});db['MailAccount'][_0x8b68('0x10d')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x8b68('0x10e')});db['MailAccount'][_0x8b68('0x112')](db[_0x8b68('0x7f')],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x162'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x3d')][_0x8b68('0x112')](db[_0x8b68('0x7d')],{'as':_0x8b68('0x163'),'foreignKey':_0x8b68('0x162')});db[_0x8b68('0x3d')][_0x8b68('0x112')](db['MailMessage'],{'as':_0x8b68('0x158'),'foreignKey':_0x8b68('0x162')});db[_0x8b68('0x3d')][_0x8b68('0x112')](db[_0x8b68('0x42')],{'as':_0x8b68('0x164')});db['MailAccount'][_0x8b68('0x112')](db[_0x8b68('0x44')],{'as':_0x8b68('0x146')});db[_0x8b68('0x3d')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0x3d')][_0x8b68('0x14d')](db[_0x8b68('0x8c')],{'as':_0x8b68('0x8c'),'foreignKey':_0x8b68('0x167')});db['MailAccount']['belongsTo'](db[_0x8b68('0x168')],{'as':_0x8b68('0x169'),'foreignKey':_0x8b68('0x16a')});db[_0x8b68('0x3d')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x16b')});db[_0x8b68('0x3f')]['belongsToMany'](db['User'],{'as':_0x8b68('0x154'),'through':'UserMailQueue'});db[_0x8b68('0x3f')][_0x8b68('0x122')](db[_0x8b68('0xe2')],{'through':_0x8b68('0x16c'),'as':_0x8b68('0x155')});db[_0x8b68('0x42')][_0x8b68('0x112')](db['MailMessage'],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x16d')});db['MailInteraction'][_0x8b68('0x14d')](db[_0x8b68('0x3d')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x162')});db[_0x8b68('0x42')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db['MailInteraction'][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x16f'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x42')][_0x8b68('0x122')](db['Tag'],{'through':_0x8b68('0x170'),'as':_0x8b68('0x171')});db[_0x8b68('0x42')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':_0x8b68('0x170'),'as':_0x8b68('0x172')});db[_0x8b68('0x42')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'through':'user_has_mail_interactions','foreignKey':_0x8b68('0x16d')});db['MailMessage'][_0x8b68('0x112')](db[_0x8b68('0x174')],{'as':_0x8b68('0x175'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x176')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x10c')});db[_0x8b68('0x176')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x15e')});db[_0x8b68('0x176')][_0x8b68('0x14d')](db[_0x8b68('0x42')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0x8b68('0x176')][_0x8b68('0x14d')](db[_0x8b68('0x3d')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x162')});db[_0x8b68('0x176')][_0x8b68('0x14d')](db['ChatWebsite'],{'as':_0x8b68('0x137'),'foreignKey':_0x8b68('0x177')});db[_0x8b68('0x176')][_0x8b68('0x14d')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x8b68('0x178')});db[_0x8b68('0x44')][_0x8b68('0x14d')](db['User'],{'onDelete':'restrict'});db['MailApplication'][_0x8b68('0x14d')](db[_0x8b68('0x3f')],{'onDelete':_0x8b68('0x179')});db['MailApplication']['belongsTo'](db['MailAccount'],{'onDelete':_0x8b68('0x179')});db['MailApplication'][_0x8b68('0x14d')](db[_0x8b68('0x83')],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x151')});db[_0x8b68('0x44')]['belongsTo'](db['Tag'],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x17a')});db['MailQueueReport'][_0x8b68('0x14d')](db['MailAccount'],{});db[_0x8b68('0x17b')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0x17b')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x17b')][_0x8b68('0x14d')](db[_0x8b68('0x42')],{});db[_0x8b68('0x17b')][_0x8b68('0x14d')](db['MailMessage'],{});db[_0x8b68('0x17b')]['belongsTo'](db[_0x8b68('0x10c')],{});db['MailQueueReport'][_0x8b68('0x14d')](db['MailQueue'],{});db[_0x8b68('0x17c')][_0x8b68('0x112')](db[_0x8b68('0x47')],{'as':_0x8b68('0x17d'),'onDelete':'cascade'});db[_0x8b68('0x13a')][_0x8b68('0x112')](db[_0x8b68('0x7f')],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x17e'),'onDelete':'cascade'});db['FaxAccount'][_0x8b68('0x112')](db[_0x8b68('0x7d')],{'as':_0x8b68('0x163'),'foreignKey':_0x8b68('0x17e')});db[_0x8b68('0x13a')][_0x8b68('0x112')](db[_0x8b68('0x11b')],{'as':_0x8b68('0x164')});db['FaxAccount'][_0x8b68('0x112')](db[_0x8b68('0x49')],{'as':'Applications'});db[_0x8b68('0x13a')][_0x8b68('0x112')](db[_0x8b68('0x16')],{'as':'Exntensions','onDelete':_0x8b68('0x10e')});db[_0x8b68('0x13a')][_0x8b68('0x112')](db[_0x8b68('0x4b')],{'as':_0x8b68('0x158')});db[_0x8b68('0x13a')][_0x8b68('0x14d')](db['Trunk'],{'as':_0x8b68('0x27')});db[_0x8b68('0x13a')][_0x8b68('0x14d')](db['CmList'],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0x13a')][_0x8b68('0x14d')](db[_0x8b68('0x168')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8b68('0x13a')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x13c')});db[_0x8b68('0x49')]['belongsTo'](db['User'],{'onDelete':_0x8b68('0x179')});db[_0x8b68('0x49')][_0x8b68('0x14d')](db['FaxQueue'],{'onDelete':'restrict'});db[_0x8b68('0x49')][_0x8b68('0x14d')](db[_0x8b68('0x13a')],{'onDelete':_0x8b68('0x179')});db[_0x8b68('0x49')][_0x8b68('0x14d')](db['Tag'],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x17a')});db['FaxInteraction'][_0x8b68('0x112')](db[_0x8b68('0x4b')],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x17f')});db[_0x8b68('0x11b')][_0x8b68('0x14d')](db[_0x8b68('0x13a')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x17e')});db[_0x8b68('0x11b')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db['FaxInteraction'][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':'Owner','foreignKey':_0x8b68('0x111')});db[_0x8b68('0x11b')]['belongsToMany'](db[_0x8b68('0x8a')],{'through':_0x8b68('0x180'),'as':'Tags'});db[_0x8b68('0x11b')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':_0x8b68('0x180'),'as':_0x8b68('0x172')});db[_0x8b68('0x11b')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'through':_0x8b68('0x129'),'foreignKey':_0x8b68('0x17f')});db[_0x8b68('0x4b')]['belongsTo'](db['User'],{'onDelete':_0x8b68('0x10e'),'as':'User'});db[_0x8b68('0x4b')][_0x8b68('0x14d')](db[_0x8b68('0x11b')],{'as':_0x8b68('0x181'),'foreignKey':_0x8b68('0x17f')});db[_0x8b68('0x4b')]['belongsTo'](db[_0x8b68('0x6f')],{'onDelete':_0x8b68('0x10e'),'as':'Contact'});db[_0x8b68('0x4b')][_0x8b68('0x14d')](db[_0x8b68('0x174')],{'as':_0x8b68('0x174'),'foreignKey':_0x8b68('0x182')});db['FaxMessage'][_0x8b68('0x14d')](db[_0x8b68('0x13a')],{'as':'Account','foreignKey':_0x8b68('0x17e')});db[_0x8b68('0x131')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':'UserFaxQueue'});db[_0x8b68('0x131')][_0x8b68('0x122')](db[_0x8b68('0xe2')],{'through':_0x8b68('0x183'),'as':'Teams'});db[_0x8b68('0x4e')][_0x8b68('0x14d')](db[_0x8b68('0x13a')],{});db[_0x8b68('0x4e')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':'ListId'});db[_0x8b68('0x4e')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db[_0x8b68('0x4e')][_0x8b68('0x14d')](db[_0x8b68('0x11b')],{});db['FaxQueueReport'][_0x8b68('0x14d')](db['FaxMessage'],{});db[_0x8b68('0x4e')]['belongsTo'](db['User'],{});db[_0x8b68('0x4e')]['belongsTo'](db[_0x8b68('0x131')],{});db[_0x8b68('0x50')][_0x8b68('0x112')](db['Disposition'],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x184'),'onDelete':_0x8b68('0x10e')});db['SmsAccount'][_0x8b68('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8b68('0x184')});db[_0x8b68('0x50')][_0x8b68('0x112')](db[_0x8b68('0x185')],{'as':_0x8b68('0x158'),'foreignKey':_0x8b68('0x184')});db[_0x8b68('0x50')][_0x8b68('0x112')](db[_0x8b68('0x54')],{'as':_0x8b68('0x164')});db[_0x8b68('0x50')]['hasMany'](db[_0x8b68('0x52')],{'as':_0x8b68('0x146')});db['SmsAccount'][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':'ListId'});db[_0x8b68('0x50')][_0x8b68('0x14d')](db[_0x8b68('0x168')],{'as':_0x8b68('0x169'),'foreignKey':_0x8b68('0x16a')});db['SmsAccount'][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x140')});db[_0x8b68('0x52')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'onDelete':_0x8b68('0x179')});db[_0x8b68('0x52')][_0x8b68('0x14d')](db['SmsQueue'],{'onDelete':_0x8b68('0x179')});db['SmsApplication'][_0x8b68('0x14d')](db[_0x8b68('0x50')],{'onDelete':_0x8b68('0x179')});db[_0x8b68('0x52')][_0x8b68('0x14d')](db[_0x8b68('0x83')],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x151')});db[_0x8b68('0x52')][_0x8b68('0x14d')](db[_0x8b68('0x8a')],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x17a')});db[_0x8b68('0x54')][_0x8b68('0x112')](db[_0x8b68('0x185')],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x186')});db[_0x8b68('0x54')][_0x8b68('0x14d')](db[_0x8b68('0x50')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x184')});db['SmsInteraction']['belongsTo'](db[_0x8b68('0x6f')],{'as':'Contact','foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x54')][_0x8b68('0x14d')](db['User'],{'as':_0x8b68('0x16f'),'foreignKey':'UserId'});db[_0x8b68('0x54')]['belongsToMany'](db[_0x8b68('0x8a')],{'through':'sms_interaction_has_tags','as':_0x8b68('0x171')});db[_0x8b68('0x54')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':'sms_interaction_has_tags','as':_0x8b68('0x172')});db[_0x8b68('0x54')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'through':_0x8b68('0x12a'),'foreignKey':_0x8b68('0x186')});db[_0x8b68('0x185')]['belongsTo'](db[_0x8b68('0x10c')],{'as':_0x8b68('0x10c')});db['SmsMessage'][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x15e')});db[_0x8b68('0x185')][_0x8b68('0x14d')](db['SmsInteraction'],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x181'),'foreignKey':_0x8b68('0x186')});db[_0x8b68('0x185')][_0x8b68('0x14d')](db[_0x8b68('0x50')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x184')});db[_0x8b68('0x133')][_0x8b68('0x122')](db['User'],{'as':_0x8b68('0x154'),'through':_0x8b68('0x34'),'foreignKey':_0x8b68('0x187')});db[_0x8b68('0x133')]['belongsToMany'](db[_0x8b68('0xe2')],{'through':_0x8b68('0x188'),'as':'Teams'});db[_0x8b68('0x57')][_0x8b68('0x112')](db[_0x8b68('0x7f')],{'as':_0x8b68('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0x8b68('0x10e')});db[_0x8b68('0x57')][_0x8b68('0x112')](db[_0x8b68('0x7d')],{'as':_0x8b68('0x163'),'foreignKey':_0x8b68('0x189')});db[_0x8b68('0x57')][_0x8b68('0x112')](db[_0x8b68('0x5b')],{'as':_0x8b68('0x164'),'foreignKey':_0x8b68('0x189')});db[_0x8b68('0x57')][_0x8b68('0x112')](db[_0x8b68('0x18a')],{'as':_0x8b68('0x158'),'foreignKey':'OpenchannelAccountId'});db[_0x8b68('0x57')][_0x8b68('0x112')](db[_0x8b68('0x59')],{'as':_0x8b68('0x146'),'foreignKey':_0x8b68('0x189')});db[_0x8b68('0x57')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount'][_0x8b68('0x14d')](db[_0x8b68('0x168')],{'as':_0x8b68('0x169'),'foreignKey':_0x8b68('0x16a')});db['OpenchannelAccount']['belongsToMany'](db['User'],{'as':_0x8b68('0x154'),'through':_0x8b68('0x13f')});db[_0x8b68('0x59')][_0x8b68('0x14d')](db['User'],{'onDelete':_0x8b68('0x179')});db[_0x8b68('0x59')][_0x8b68('0x14d')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x8b68('0x59')]['belongsTo'](db[_0x8b68('0x57')],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x189')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0x8b68('0x151')});db['OpenchannelApplication'][_0x8b68('0x14d')](db[_0x8b68('0x8a')],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x17a')});db[_0x8b68('0x5b')][_0x8b68('0x112')](db[_0x8b68('0x18a')],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':'OpenchannelInteractionId'});db[_0x8b68('0x5b')][_0x8b68('0x14d')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x5b')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x16f'),'foreignKey':_0x8b68('0x111')});db['OpenchannelInteraction'][_0x8b68('0x122')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x8b68('0x171')});db[_0x8b68('0x5b')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':_0x8b68('0x18b'),'as':_0x8b68('0x172')});db[_0x8b68('0x5b')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'through':'user_has_openchannel_interactions','foreignKey':_0x8b68('0x18c')});db['OpenchannelMessage']['belongsTo'](db[_0x8b68('0x10c')],{'onDelete':_0x8b68('0x10e'),'as':'User'});db[_0x8b68('0x18a')]['belongsTo'](db[_0x8b68('0x6f')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x15e')});db[_0x8b68('0x18a')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x8b68('0x181'),'foreignKey':_0x8b68('0x18c')});db[_0x8b68('0x18a')][_0x8b68('0x14d')](db[_0x8b68('0x174')],{'as':_0x8b68('0x174'),'foreignKey':_0x8b68('0x182')});db[_0x8b68('0x18a')][_0x8b68('0x14d')](db[_0x8b68('0x57')],{'as':'Account','foreignKey':_0x8b68('0x189')});db[_0x8b68('0x5d')]['belongsToMany'](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x8b68('0x5d')][_0x8b68('0x122')](db[_0x8b68('0xe2')],{'through':_0x8b68('0x18d'),'as':'Teams'});db[_0x8b68('0x137')]['hasMany'](db[_0x8b68('0x7f')],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x177'),'onDelete':_0x8b68('0x10e')});db['ChatWebsite'][_0x8b68('0x112')](db[_0x8b68('0x7d')],{'as':_0x8b68('0x163'),'foreignKey':'ChatWebsiteId'});db[_0x8b68('0x137')][_0x8b68('0x112')](db['ChatProactiveAction'],{'as':_0x8b68('0x18e')});db['ChatWebsite']['hasMany'](db['ChatInteraction'],{'as':_0x8b68('0x164')});db[_0x8b68('0x137')]['hasMany'](db[_0x8b68('0x61')],{'as':'Applications'});db[_0x8b68('0x137')][_0x8b68('0x112')](db[_0x8b68('0x18f')],{'as':_0x8b68('0x158')});db[_0x8b68('0x137')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':'List','foreignKey':'ListId'});db['ChatWebsite'][_0x8b68('0x14d')](db['Interval'],{'as':_0x8b68('0x83'),'foreignKey':_0x8b68('0x151')});db[_0x8b68('0x137')][_0x8b68('0x14d')](db[_0x8b68('0x3d')],{'as':_0x8b68('0x3d'),'foreignKey':_0x8b68('0x162')});db[_0x8b68('0x137')]['belongsTo'](db[_0x8b68('0x168')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite']['belongsToMany'](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x139')});db[_0x8b68('0x5f')][_0x8b68('0x14d')](db[_0x8b68('0x57')],{});db[_0x8b68('0x5f')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0x5f')]['belongsTo'](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x5f')]['belongsTo'](db[_0x8b68('0x5b')],{});db[_0x8b68('0x5f')]['belongsTo'](db[_0x8b68('0x18a')],{});db[_0x8b68('0x5f')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{});db[_0x8b68('0x5f')][_0x8b68('0x14d')](db[_0x8b68('0x5d')],{});db[_0x8b68('0x61')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':'Agent','foreignKey':_0x8b68('0x111'),'onDelete':'restrict'});db[_0x8b68('0x61')][_0x8b68('0x14d')](db[_0x8b68('0x67')],{'as':_0x8b68('0x190'),'foreignKey':_0x8b68('0x191'),'onDelete':'restrict'});db[_0x8b68('0x61')]['belongsTo'](db['ChatWebsite'],{'as':_0x8b68('0x192'),'foreignKey':_0x8b68('0x177'),'onDelete':_0x8b68('0x179')});db['ChatApplication'][_0x8b68('0x14d')](db['Tag'],{'onDelete':_0x8b68('0x179'),'foreignKey':'TagId'});db[_0x8b68('0x63')][_0x8b68('0x112')](db['ChatMessage'],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x193')});db[_0x8b68('0x63')][_0x8b68('0x14d')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x8b68('0x177')});db[_0x8b68('0x63')][_0x8b68('0x14d')](db['CmContact'],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x63')]['belongsTo'](db['User'],{'as':_0x8b68('0x16f'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x63')]['belongsToMany'](db[_0x8b68('0x8a')],{'through':'chat_interaction_has_tags','as':_0x8b68('0x171')});db['ChatInteraction'][_0x8b68('0x122')](db['Tag'],{'through':_0x8b68('0x194'),'as':_0x8b68('0x172')});db[_0x8b68('0x63')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':'Users','through':_0x8b68('0x195'),'foreignKey':'ChatInteractionId'});db[_0x8b68('0x18f')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'onDelete':_0x8b68('0x10e'),'as':'User'});db[_0x8b68('0x18f')][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db['ChatMessage'][_0x8b68('0x14d')](db[_0x8b68('0x63')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x181'),'foreignKey':'ChatInteractionId'});db[_0x8b68('0x18f')]['belongsTo'](db[_0x8b68('0x174')],{'as':'Attachment','foreignKey':_0x8b68('0x182')});db[_0x8b68('0x18f')]['belongsTo'](db['ChatWebsite'],{'as':_0x8b68('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x8b68('0x65')]['hasMany'](db[_0x8b68('0x174')],{'as':_0x8b68('0x175'),'foreignKey':_0x8b68('0x178'),'onDelete':_0x8b68('0x10e'),'hooks':!![]});db['ChatOfflineMessage'][_0x8b68('0x14d')](db[_0x8b68('0x6f')],{'onDelete':'cascade','as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db['ChatOfflineMessage'][_0x8b68('0x14d')](db[_0x8b68('0x137')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x177')});db[_0x8b68('0x67')][_0x8b68('0x122')](db['User'],{'as':_0x8b68('0x154'),'through':_0x8b68('0x2e'),'hooks':!![]});db[_0x8b68('0x67')][_0x8b68('0x122')](db[_0x8b68('0xe2')],{'through':_0x8b68('0x196'),'as':'Teams'});db[_0x8b68('0x69')]['hasMany'](db[_0x8b68('0x197')],{'as':_0x8b68('0x158'),'foreignKey':_0x8b68('0x198'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x69')]['belongsToMany'](db[_0x8b68('0x10c')],{'as':'Members','through':_0x8b68('0x124')});db[_0x8b68('0x6b')][_0x8b68('0x14d')](db[_0x8b68('0x137')],{'as':_0x8b68('0x192'),'foreignKey':_0x8b68('0x177')});db[_0x8b68('0x6d')]['hasMany'](db['CmContact'],{'as':_0x8b68('0x125'),'foreignKey':'CompanyId'});db[_0x8b68('0x6f')][_0x8b68('0x112')](db[_0x8b68('0x71')],{'as':_0x8b68('0x14a'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x6f')]['hasMany'](db[_0x8b68('0x75')],{'as':'HopperFinals','foreignKey':_0x8b68('0x15f')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x8b68('0x6f')]['hasMany'](db[_0x8b68('0x117')],{'as':'ReportAgentPreview','foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x6f')][_0x8b68('0x112')](db[_0x8b68('0x14c')],{'as':'JscriptySessions','foreignKey':_0x8b68('0x15f')});db['CmContact'][_0x8b68('0x112')](db[_0x8b68('0x5b')],{'as':'OpenchannelInteractions','foreignKey':_0x8b68('0x15f'),'onDelete':_0x8b68('0x179')});db[_0x8b68('0x6f')][_0x8b68('0x112')](db['ChatInteraction'],{'as':_0x8b68('0x119'),'foreignKey':'ContactId','onDelete':_0x8b68('0x179')});db['CmContact']['hasMany'](db[_0x8b68('0x54')],{'as':_0x8b68('0x11a'),'foreignKey':_0x8b68('0x15f'),'onDelete':_0x8b68('0x179')});db['CmContact'][_0x8b68('0x112')](db[_0x8b68('0x11b')],{'as':'FaxInteractions','foreignKey':_0x8b68('0x15f'),'onDelete':_0x8b68('0x179')});db[_0x8b68('0x6f')]['hasMany'](db[_0x8b68('0x42')],{'as':_0x8b68('0x11d'),'foreignKey':_0x8b68('0x15f'),'onDelete':'restrict'});db[_0x8b68('0x6f')]['belongsTo'](db[_0x8b68('0x6d')],{'as':'Company','foreignKey':_0x8b68('0x199')});db['CmContact'][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166'),'onDelete':_0x8b68('0x10e')});db['CmContact'][_0x8b68('0x122')](db['User'],{'as':_0x8b68('0x173'),'through':_0x8b68('0x126')});db['CmContact']['belongsToMany'](db[_0x8b68('0x8a')],{'as':_0x8b68('0x171'),'through':_0x8b68('0x19a')});db[_0x8b68('0x6f')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x8b68('0x71')][_0x8b68('0x14d')](db['CmContact'],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x71')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':'ListId','onDelete':_0x8b68('0x10e')});db['CmHopper']['belongsTo'](db[_0x8b68('0x10c')],{'as':'Agent','foreignKey':_0x8b68('0x111')});db['CmHopper'][_0x8b68('0x14d')](db['VoiceQueue'],{'as':_0x8b68('0x190'),'foreignKey':_0x8b68('0x149'),'onDelete':'cascade'});db[_0x8b68('0x71')][_0x8b68('0x14d')](db[_0x8b68('0xe6')],{'as':_0x8b68('0xe6'),'foreignKey':'CampaignId','onDelete':_0x8b68('0x10e')});db[_0x8b68('0x71')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x16f'),'foreignKey':_0x8b68('0x19b')});db[_0x8b68('0x73')]['belongsTo'](db[_0x8b68('0x6f')],{'as':_0x8b68('0x15e'),'foreignKey':'ContactId','onDelete':_0x8b68('0x10e')});db['CmHopperBlack'][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x73')]['belongsTo'](db[_0x8b68('0x1a')],{'as':_0x8b68('0x190'),'foreignKey':_0x8b68('0x149'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x73')][_0x8b68('0x14d')](db[_0x8b68('0xe6')],{'as':_0x8b68('0xe6'),'foreignKey':_0x8b68('0x19c'),'onDelete':'cascade'});db['Automation'][_0x8b68('0x112')](db[_0x8b68('0x81')],{'as':{'plural':_0x8b68('0x19d'),'singular':_0x8b68('0x19e')},'foreignKey':_0x8b68('0x19f'),'onDelete':_0x8b68('0x10e'),'hooks':!![]});db[_0x8b68('0x1a0')][_0x8b68('0x112')](db['Condition'],{'as':{'plural':'Any','singular':_0x8b68('0x1a1')},'foreignKey':'AutomationAnyId','onDelete':_0x8b68('0x10e'),'hooks':!![]});db[_0x8b68('0x1a0')][_0x8b68('0x112')](db['Action'],{'as':'Actions','foreignKey':_0x8b68('0x1a2'),'onDelete':_0x8b68('0x10e'),'hooks':!![]});db[_0x8b68('0x7f')]['hasMany'](db[_0x8b68('0x7f')],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x1a3'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x83')][_0x8b68('0x112')](db['Interval'],{'as':_0x8b68('0x1a4'),'foreignKey':_0x8b68('0x151'),'onDelete':_0x8b68('0x10e'),'hooks':!![],'required':![]});db['Interval'][_0x8b68('0x112')](db[_0x8b68('0x16')],{'as':'Extensions','foreignKey':_0x8b68('0x151'),'onDelete':_0x8b68('0x179')});db[_0x8b68('0x83')]['hasMany'](db[_0x8b68('0x44')],{'as':_0x8b68('0x1a5'),'foreignKey':_0x8b68('0x151')});db[_0x8b68('0x83')][_0x8b68('0x112')](db[_0x8b68('0x61')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x8b68('0x83')]['hasMany'](db[_0x8b68('0x49')],{'as':'FaxApplications','foreignKey':_0x8b68('0x151')});db['Interval']['hasMany'](db[_0x8b68('0x52')],{'as':_0x8b68('0x1a6'),'foreignKey':_0x8b68('0x151')});db[_0x8b68('0x1a7')][_0x8b68('0x14d')](db[_0x8b68('0x3d')],{});db['Schedule'][_0x8b68('0x14d')](db[_0x8b68('0x1a8')],{'foreignKey':_0x8b68('0x1a9')});db[_0x8b68('0x1a7')][_0x8b68('0x14d')](db[_0x8b68('0x94')],{'foreignKey':_0x8b68('0x1aa')});db[_0x8b68('0x89')][_0x8b68('0x122')](db[_0x8b68('0x18')],{'as':'Mohs','through':_0x8b68('0x147'),'onDelete':'restrict'});db[_0x8b68('0x8a')][_0x8b68('0x122')](db[_0x8b68('0x6f')],{'through':_0x8b68('0x19a')});db[_0x8b68('0x8a')][_0x8b68('0x122')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0x8b68('0x8a')][_0x8b68('0x122')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag'][_0x8b68('0x122')](db[_0x8b68('0x54')],{'through':_0x8b68('0x1ab')});db[_0x8b68('0x8a')]['belongsToMany'](db[_0x8b68('0x11b')],{'through':_0x8b68('0x180')});db['Tag'][_0x8b68('0x122')](db['OpenchannelInteraction'],{'through':_0x8b68('0x18b')});db['Tag'][_0x8b68('0x122')](db[_0x8b68('0x100')],{'through':_0x8b68('0x1ac')});db[_0x8b68('0x8e')][_0x8b68('0x112')](db[_0x8b68('0x81')],{'as':{'plural':_0x8b68('0x1ad'),'singular':_0x8b68('0x1ae')},'foreignKey':_0x8b68('0x1af'),'onDelete':_0x8b68('0x10e'),'hooks':!![]});db[_0x8b68('0x8e')][_0x8b68('0x112')](db[_0x8b68('0x81')],{'as':{'plural':_0x8b68('0x1b0'),'singular':'AnyCondition'},'foreignKey':_0x8b68('0x1b1'),'onDelete':'cascade','hooks':!![]});db[_0x8b68('0x8e')]['hasMany'](db['Action'],{'as':_0x8b68('0x1b2'),'foreignKey':_0x8b68('0x1b3'),'onDelete':_0x8b68('0x10e'),'hooks':!![]});db['AnalyticCustomReport'][_0x8b68('0x112')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x8b68('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x8b68('0x1a8')][_0x8b68('0x112')](db['AnalyticFieldReport'],{'as':_0x8b68('0x1b4'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1a9')});db['AnalyticMetric'][_0x8b68('0x112')](db['AnalyticFieldReport'],{'as':_0x8b68('0x1b4'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1b5')});db[_0x8b68('0x9a')][_0x8b68('0x14d')](db['AnalyticMetric'],{'foreignKey':_0x8b68('0x1b5')});db['SalesforceAccount'][_0x8b68('0x112')](db[_0x8b68('0x9e')],{'as':_0x8b68('0x1b6'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1b7')});db['SalesforceConfiguration'][_0x8b68('0x112')](db[_0x8b68('0x1b8')],{'as':_0x8b68('0x1b9'),'onDelete':_0x8b68('0x10e'),'foreignKey':'SubjectId'});db[_0x8b68('0x9e')][_0x8b68('0x112')](db['SalesforceField'],{'as':_0x8b68('0x1ba'),'onDelete':'cascade','foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0x9e')][_0x8b68('0x112')](db[_0x8b68('0x1b8')],{'as':_0x8b68('0x1b4'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x9e')][_0x8b68('0x14d')](db['SalesforceAccount'],{'as':_0x8b68('0x16e'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8b68('0x1b8')][_0x8b68('0x112')](db[_0x8b68('0x1b8')],{'as':_0x8b68('0x1bd'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0x1b8')]['hasMany'](db[_0x8b68('0x1b8')],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x1b8')][_0x8b68('0x14d')](db[_0x8b68('0x90')],{'as':_0x8b68('0x90'),'foreignKey':'VariableId'});db[_0x8b68('0x1bf')][_0x8b68('0x112')](db[_0x8b68('0x1c0')],{'as':_0x8b68('0x1b6'),'onDelete':'cascade','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0x1c0')][_0x8b68('0x112')](db['SugarcrmField'],{'as':_0x8b68('0x1b9'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8b68('0x1c0')][_0x8b68('0x112')](db[_0x8b68('0x1c1')],{'as':_0x8b68('0x1ba'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bb')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':'Fields','onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bc')});db['SugarcrmConfiguration']['belongsTo'](db[_0x8b68('0x1bf')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0x1c1')][_0x8b68('0x112')](db[_0x8b68('0x1c1')],{'as':_0x8b68('0x1c2'),'foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0x1c1')][_0x8b68('0x112')](db[_0x8b68('0x1c1')],{'as':_0x8b68('0x1bd'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0x1c1')][_0x8b68('0x112')](db['SugarcrmField'],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x1c1')][_0x8b68('0x14d')](db[_0x8b68('0x90')],{'as':'Variable','foreignKey':_0x8b68('0x1c4')});db['DeskAccount'][_0x8b68('0x112')](db[_0x8b68('0xa6')],{'as':_0x8b68('0x1b6'),'onDelete':_0x8b68('0x10e'),'foreignKey':'AccountId'});db[_0x8b68('0xa6')][_0x8b68('0x112')](db[_0x8b68('0xa8')],{'as':_0x8b68('0x1b9'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8b68('0xa6')][_0x8b68('0x112')](db[_0x8b68('0xa8')],{'as':_0x8b68('0x1ba'),'onDelete':'cascade','foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xa6')][_0x8b68('0x112')](db[_0x8b68('0xa8')],{'as':_0x8b68('0x1b4'),'onDelete':_0x8b68('0x10e'),'foreignKey':'FieldId'});db[_0x8b68('0xa6')][_0x8b68('0x14d')](db['DeskAccount'],{'as':'Account','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xa6')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':_0x8b68('0x1c5')});db[_0x8b68('0xa8')][_0x8b68('0x112')](db[_0x8b68('0xa8')],{'as':_0x8b68('0x1c2'),'foreignKey':_0x8b68('0x1c3')});db['DeskField'][_0x8b68('0x112')](db[_0x8b68('0xa8')],{'as':_0x8b68('0x1bd'),'foreignKey':'DescriptionId'});db['DeskField'][_0x8b68('0x112')](db[_0x8b68('0xa8')],{'as':'Field','foreignKey':'FieldId'});db[_0x8b68('0xa8')][_0x8b68('0x14d')](db['Variable'],{'as':_0x8b68('0x90'),'foreignKey':_0x8b68('0x1c4')});db[_0x8b68('0x1c6')][_0x8b68('0x112')](db[_0x8b68('0xab')],{'as':_0x8b68('0x1b6'),'onDelete':'cascade','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xab')]['hasMany'](db['ZohoField'],{'as':'Subjects','onDelete':_0x8b68('0x10e'),'foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0x8b68('0xad')],{'as':_0x8b68('0x1ba'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xab')][_0x8b68('0x112')](db[_0x8b68('0xad')],{'as':_0x8b68('0x1b4'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bc')});db['ZohoConfiguration'][_0x8b68('0x14d')](db[_0x8b68('0x1c6')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xad')][_0x8b68('0x112')](db[_0x8b68('0xad')],{'as':_0x8b68('0x1c2'),'foreignKey':_0x8b68('0x1c3')});db['ZohoField']['hasMany'](db[_0x8b68('0xad')],{'as':_0x8b68('0x1bd'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xad')][_0x8b68('0x112')](db[_0x8b68('0xad')],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0xad')][_0x8b68('0x14d')](db[_0x8b68('0x90')],{'as':_0x8b68('0x90'),'foreignKey':'VariableId'});db[_0x8b68('0xaf')][_0x8b68('0x112')](db[_0x8b68('0x1c7')],{'as':_0x8b68('0x1b6'),'onDelete':_0x8b68('0x10e'),'foreignKey':'AccountId'});db[_0x8b68('0x1c7')][_0x8b68('0x112')](db[_0x8b68('0x1c8')],{'as':_0x8b68('0x1b9'),'foreignKey':'SubjectId'});db[_0x8b68('0x1c7')][_0x8b68('0x112')](db[_0x8b68('0x1c8')],{'as':'Descriptions','foreignKey':_0x8b68('0x1bb')});db['ZendeskConfiguration'][_0x8b68('0x112')](db[_0x8b68('0x1c8')],{'as':_0x8b68('0x1b4'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x1c7')]['belongsTo'](db[_0x8b68('0xaf')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x1b7')});db['ZendeskConfiguration']['belongsToMany'](db[_0x8b68('0x8a')],{'through':_0x8b68('0x1c9')});db['ZendeskField'][_0x8b68('0x112')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0x1c8')][_0x8b68('0x112')](db[_0x8b68('0x1c8')],{'as':_0x8b68('0x1bd'),'foreignKey':'DescriptionId'});db[_0x8b68('0x1c8')][_0x8b68('0x112')](db[_0x8b68('0x1c8')],{'as':'Field','foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x1c8')][_0x8b68('0x14d')](db[_0x8b68('0x90')],{'as':_0x8b68('0x90'),'foreignKey':_0x8b68('0x1c4')});db[_0x8b68('0xb3')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x8b68('0x1b6'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xb5')]['hasMany'](db[_0x8b68('0x1ca')],{'as':_0x8b68('0x1b9'),'onDelete':_0x8b68('0x10e'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x8b68('0x112')](db[_0x8b68('0x1ca')],{'as':'Descriptions','onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xb5')]['hasMany'](db[_0x8b68('0x1ca')],{'as':'Fields','onDelete':_0x8b68('0x10e'),'foreignKey':'FieldId'});db[_0x8b68('0xb5')][_0x8b68('0x14d')](db[_0x8b68('0xb3')],{'as':_0x8b68('0x16e'),'foreignKey':'AccountId'});db[_0x8b68('0xb5')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':_0x8b68('0x1cb')});db[_0x8b68('0x1ca')][_0x8b68('0x112')](db[_0x8b68('0x1ca')],{'as':'Subject','foreignKey':_0x8b68('0x1c3')});db['FreshdeskField'][_0x8b68('0x112')](db[_0x8b68('0x1ca')],{'as':_0x8b68('0x1bd'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0x1ca')][_0x8b68('0x112')](db[_0x8b68('0x1ca')],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x1ca')][_0x8b68('0x14d')](db['Variable'],{'as':_0x8b68('0x90'),'foreignKey':_0x8b68('0x1c4')});db['VtigerAccount'][_0x8b68('0x112')](db[_0x8b68('0xb9')],{'as':_0x8b68('0x1b6'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xb9')][_0x8b68('0x112')](db[_0x8b68('0x1cc')],{'as':_0x8b68('0x1b9'),'foreignKey':'SubjectId'});db[_0x8b68('0xb9')][_0x8b68('0x112')](db[_0x8b68('0x1cc')],{'as':'Descriptions','foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xb9')]['hasMany'](db['VtigerField'],{'as':_0x8b68('0x1b4'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0xb9')][_0x8b68('0x14d')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0x1cc')][_0x8b68('0x112')](db[_0x8b68('0x1cc')],{'as':_0x8b68('0x1c2'),'foreignKey':'SubjectId'});db[_0x8b68('0x1cc')]['hasMany'](db[_0x8b68('0x1cc')],{'as':_0x8b68('0x1bd'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0x1cc')][_0x8b68('0x112')](db[_0x8b68('0x1cc')],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0x1cc')]['belongsTo'](db[_0x8b68('0x90')],{'as':_0x8b68('0x90'),'foreignKey':'VariableId'});db['ServicenowAccount']['hasMany'](db[_0x8b68('0xbe')],{'as':'Configurations','onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1b7')});db['ServicenowConfiguration'][_0x8b68('0x112')](db[_0x8b68('0xc0')],{'as':_0x8b68('0x1b9'),'foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0xbe')]['hasMany'](db[_0x8b68('0xc0')],{'as':_0x8b68('0x1ba'),'foreignKey':_0x8b68('0x1bb')});db['ServicenowConfiguration']['hasMany'](db[_0x8b68('0xc0')],{'as':_0x8b68('0x1b4'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0xbe')][_0x8b68('0x14d')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xc0')]['hasMany'](db['ServicenowField'],{'as':_0x8b68('0x1c2'),'foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0xc0')]['hasMany'](db[_0x8b68('0xc0')],{'as':'Description','foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xc0')][_0x8b68('0x112')](db[_0x8b68('0xc0')],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0xc0')][_0x8b68('0x14d')](db['Variable'],{'as':_0x8b68('0x90'),'foreignKey':_0x8b68('0x1c4')});db[_0x8b68('0xc2')][_0x8b68('0x112')](db[_0x8b68('0xc4')],{'as':_0x8b68('0x1b6'),'onDelete':'cascade','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xc4')][_0x8b68('0x112')](db[_0x8b68('0xc5')],{'as':_0x8b68('0x1b9'),'onDelete':'cascade','foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0xc4')][_0x8b68('0x112')](db[_0x8b68('0xc5')],{'as':_0x8b68('0x1ba'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1bb')});db[_0x8b68('0xc4')]['hasMany'](db[_0x8b68('0xc5')],{'as':'Fields','onDelete':_0x8b68('0x10e'),'foreignKey':'FieldId'});db[_0x8b68('0xc4')]['belongsTo'](db[_0x8b68('0xc2')],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0xc5')]['hasMany'](db['Dynamics365Field'],{'as':_0x8b68('0x1c2'),'foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0xc5')]['hasMany'](db[_0x8b68('0xc5')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8b68('0xc5')]['hasMany'](db[_0x8b68('0xc5')],{'as':_0x8b68('0x1be'),'foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0xc5')][_0x8b68('0x14d')](db[_0x8b68('0x90')],{'as':_0x8b68('0x90'),'foreignKey':_0x8b68('0x1c4')});db[_0x8b68('0xc7')]['hasMany'](db[_0x8b68('0x1cd')],{'as':_0x8b68('0x1b6'),'onDelete':'cascade','foreignKey':_0x8b68('0x1b7')});db[_0x8b68('0x1cd')]['hasMany'](db[_0x8b68('0xca')],{'as':_0x8b68('0x1b9'),'foreignKey':_0x8b68('0x1c3')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x8b68('0x1ba'),'foreignKey':'DescriptionId'});db[_0x8b68('0x1cd')][_0x8b68('0x112')](db[_0x8b68('0xca')],{'as':_0x8b68('0x1b4'),'foreignKey':_0x8b68('0x1bc')});db['FreshsalesConfiguration'][_0x8b68('0x14d')](db[_0x8b68('0xc7')],{'as':'Account','foreignKey':'AccountId'});db[_0x8b68('0xca')][_0x8b68('0x112')](db['FreshsalesField'],{'as':_0x8b68('0x1c2'),'foreignKey':_0x8b68('0x1c3')});db[_0x8b68('0xca')][_0x8b68('0x112')](db[_0x8b68('0xca')],{'as':_0x8b68('0x1bd'),'foreignKey':'DescriptionId'});db[_0x8b68('0xca')][_0x8b68('0x112')](db[_0x8b68('0xca')],{'as':'Field','foreignKey':_0x8b68('0x1bc')});db[_0x8b68('0xca')][_0x8b68('0x14d')](db[_0x8b68('0x90')],{'as':_0x8b68('0x90'),'foreignKey':_0x8b68('0x1c4')});db[_0x8b68('0xce')][_0x8b68('0x14d')](db['ChatWebsite'],{});db[_0x8b68('0xce')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0xce')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x8b68('0xce')]['belongsTo'](db[_0x8b68('0x63')],{});db[_0x8b68('0xce')]['belongsTo'](db['ChatMessage'],{});db[_0x8b68('0xce')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{});db['ChatQueueReport'][_0x8b68('0x14d')](db[_0x8b68('0x67')],{});db[_0x8b68('0x197')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1ce')});db[_0x8b68('0x197')]['belongsTo'](db[_0x8b68('0x10c')],{'onDelete':'cascade','foreignKey':_0x8b68('0x1cf')});db[_0x8b68('0x14c')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8b68('0x1d0'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0x14c')]['hasMany'](db[_0x8b68('0xd0')],{'foreignKey':_0x8b68('0x1d0'),'onDelete':_0x8b68('0x10e')});db['SmsQueueReport'][_0x8b68('0x14d')](db[_0x8b68('0x50')],{});db[_0x8b68('0xd4')][_0x8b68('0x14d')](db['CmList'],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0xd4')][_0x8b68('0x14d')](db['CmContact'],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db['SmsQueueReport'][_0x8b68('0x14d')](db[_0x8b68('0x54')],{});db[_0x8b68('0xd4')][_0x8b68('0x14d')](db[_0x8b68('0x185')],{});db[_0x8b68('0xd4')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{});db[_0x8b68('0xd4')][_0x8b68('0x14d')](db[_0x8b68('0x133')],{});db[_0x8b68('0xd8')][_0x8b68('0x112')](db[_0x8b68('0x14c')],{'foreignKey':_0x8b68('0x1d1')});db[_0x8b68('0xd8')][_0x8b68('0x112')](db[_0x8b68('0x1d2')],{'foreignKey':_0x8b68('0x1d1')});db[_0x8b68('0xd8')][_0x8b68('0x112')](db[_0x8b68('0xd0')],{'foreignKey':_0x8b68('0x1d1')});db[_0x8b68('0xdd')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'through':'user_has_square_projects'});db[_0x8b68('0xe2')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x128')});db[_0x8b68('0xe2')]['belongsToMany'](db['VoiceQueue'],{'through':_0x8b68('0x108'),'as':_0x8b68('0x1d3')});db['Team'][_0x8b68('0x122')](db[_0x8b68('0x3f')],{'through':_0x8b68('0x16c'),'as':_0x8b68('0x12f')});db[_0x8b68('0xe2')][_0x8b68('0x122')](db['ChatQueue'],{'through':_0x8b68('0x196'),'as':_0x8b68('0x130')});db[_0x8b68('0xe2')]['belongsToMany'](db['FaxQueue'],{'through':_0x8b68('0x183'),'as':_0x8b68('0x132')});db['Team'][_0x8b68('0x122')](db[_0x8b68('0x133')],{'through':_0x8b68('0x188'),'as':_0x8b68('0x134')});db[_0x8b68('0xe2')][_0x8b68('0x122')](db[_0x8b68('0x5d')],{'through':_0x8b68('0x18d'),'as':_0x8b68('0x1d4')});db[_0x8b68('0xe2')][_0x8b68('0x122')](db[_0x8b68('0x135')],{'through':_0x8b68('0x1d5'),'as':_0x8b68('0x136')});db[_0x8b68('0xe2')]['belongsToMany'](db['VoicePrefix'],{'through':_0x8b68('0x10a'),'as':_0x8b68('0x12e')});db['Campaign']['hasMany'](db[_0x8b68('0x71')],{'as':_0x8b68('0x14a'),'foreignKey':'CampaignId'});db[_0x8b68('0xe6')][_0x8b68('0x112')](db['CmHopperFinal'],{'as':_0x8b68('0x115'),'foreignKey':'CampaignId'});db['Campaign'][_0x8b68('0x112')](db[_0x8b68('0x76')],{'as':'HopperHistories','foreignKey':_0x8b68('0x19c')});db[_0x8b68('0xe6')][_0x8b68('0x112')](db[_0x8b68('0x73')],{'as':_0x8b68('0x14b'),'foreignKey':_0x8b68('0x19c')});db['Campaign']['belongsTo'](db[_0x8b68('0x27')],{'as':_0x8b68('0x27'),'foreignKey':_0x8b68('0x14e')});db[_0x8b68('0xe6')]['belongsTo'](db[_0x8b68('0x27')],{'as':'TrunkBackup','foreignKey':_0x8b68('0x150')});db['Campaign']['belongsTo'](db[_0x8b68('0x83')],{'as':_0x8b68('0x83'),'foreignKey':_0x8b68('0x151')});db[_0x8b68('0xe6')]['belongsTo'](db[_0x8b68('0xdd')],{'as':_0x8b68('0xdd'),'foreignKey':_0x8b68('0x1d6')});db[_0x8b68('0xe6')][_0x8b68('0x122')](db['CmList'],{'as':_0x8b68('0x152'),'through':_0x8b68('0x1d7')});db[_0x8b68('0xe6')][_0x8b68('0x122')](db[_0x8b68('0xf3')],{'as':_0x8b68('0x156'),'through':_0x8b68('0x1d8')});db[_0x8b68('0x174')][_0x8b68('0x14d')](db[_0x8b68('0x65')],{'as':_0x8b68('0x65'),'foreignKey':_0x8b68('0x178')});db[_0x8b68('0xea')][_0x8b68('0x14d')](db[_0x8b68('0x176')],{});db[_0x8b68('0xea')][_0x8b68('0x14d')](db[_0x8b68('0x42')],{});db[_0x8b68('0xea')][_0x8b68('0x14d')](db['MailAccount'],{'foreignKey':_0x8b68('0x1d9'),'as':_0x8b68('0x1da')});db[_0x8b68('0xea')][_0x8b68('0x14d')](db['User'],{'foreignKey':_0x8b68('0x1db'),'as':_0x8b68('0x1dc')});db[_0x8b68('0xea')]['belongsTo'](db[_0x8b68('0x10c')],{'foreignKey':_0x8b68('0x1dd'),'as':'ToAgent'});db['MailTransferReport'][_0x8b68('0x14d')](db[_0x8b68('0x3f')],{'foreignKey':_0x8b68('0x1de'),'as':_0x8b68('0x1df')});db[_0x8b68('0xea')][_0x8b68('0x14d')](db[_0x8b68('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x8b68('0x1e0')});db[_0x8b68('0xec')][_0x8b68('0x14d')](db['ChatMessage'],{});db[_0x8b68('0xec')][_0x8b68('0x14d')](db['ChatInteraction'],{});db[_0x8b68('0xec')][_0x8b68('0x14d')](db[_0x8b68('0x137')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x8b68('0xec')][_0x8b68('0x14d')](db['User'],{'foreignKey':_0x8b68('0x1db'),'as':_0x8b68('0x1dc')});db[_0x8b68('0xec')][_0x8b68('0x14d')](db['User'],{'foreignKey':'ToUserId','as':_0x8b68('0x1e1')});db[_0x8b68('0xec')]['belongsTo'](db['ChatQueue'],{'foreignKey':_0x8b68('0x1e2'),'as':_0x8b68('0x1df')});db[_0x8b68('0xec')]['belongsTo'](db[_0x8b68('0x137')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0x8b68('0xee')]['belongsTo'](db[_0x8b68('0x4b')],{});db['FaxTransferReport'][_0x8b68('0x14d')](db[_0x8b68('0x11b')],{});db[_0x8b68('0xee')][_0x8b68('0x14d')](db['FaxAccount'],{'foreignKey':_0x8b68('0x1e3'),'as':'FromAccount'});db[_0x8b68('0xee')]['belongsTo'](db[_0x8b68('0x10c')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8b68('0xee')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'foreignKey':_0x8b68('0x1dd'),'as':_0x8b68('0x1e1')});db[_0x8b68('0xee')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x8b68('0x1e4'),'as':'ToQueue'});db[_0x8b68('0xee')][_0x8b68('0x14d')](db['FaxAccount'],{'foreignKey':_0x8b68('0x1e5'),'as':'ToAccount'});db[_0x8b68('0x1e6')]['belongsTo'](db[_0x8b68('0x18a')],{});db[_0x8b68('0x1e6')][_0x8b68('0x14d')](db[_0x8b68('0x5b')],{});db[_0x8b68('0x1e6')]['belongsTo'](db[_0x8b68('0x57')],{'foreignKey':_0x8b68('0x1e7'),'as':_0x8b68('0x1da')});db[_0x8b68('0x1e6')]['belongsTo'](db[_0x8b68('0x10c')],{'foreignKey':_0x8b68('0x1db'),'as':_0x8b68('0x1dc')});db[_0x8b68('0x1e6')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'foreignKey':_0x8b68('0x1dd'),'as':'ToAgent'});db[_0x8b68('0x1e6')][_0x8b68('0x14d')](db[_0x8b68('0x5d')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x8b68('0x1e6')][_0x8b68('0x14d')](db[_0x8b68('0x57')],{'foreignKey':_0x8b68('0x1e8'),'as':_0x8b68('0x1e0')});db['SmsTransferReport'][_0x8b68('0x14d')](db[_0x8b68('0x185')],{});db[_0x8b68('0xf1')][_0x8b68('0x14d')](db[_0x8b68('0x54')],{});db[_0x8b68('0xf1')][_0x8b68('0x14d')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x8b68('0x1da')});db['SmsTransferReport']['belongsTo'](db[_0x8b68('0x10c')],{'foreignKey':'FromUserId','as':_0x8b68('0x1dc')});db[_0x8b68('0xf1')]['belongsTo'](db[_0x8b68('0x10c')],{'foreignKey':_0x8b68('0x1dd'),'as':'ToAgent'});db[_0x8b68('0xf1')][_0x8b68('0x14d')](db['SmsQueue'],{'foreignKey':_0x8b68('0x1e9'),'as':'ToQueue'});db[_0x8b68('0xf1')][_0x8b68('0x14d')](db[_0x8b68('0x50')],{'foreignKey':_0x8b68('0x1ea'),'as':_0x8b68('0x1e0')});db[_0x8b68('0xf3')][_0x8b68('0x112')](db['Disposition'],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x166'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0xf3')][_0x8b68('0x112')](db[_0x8b68('0x1eb')],{'as':_0x8b68('0x1ec'),'foreignKey':_0x8b68('0x166')});db['CmList'][_0x8b68('0x112')](db['CmContact'],{'as':_0x8b68('0x125'),'onDelete':_0x8b68('0x10e'),'foreignKey':'ListId'});db[_0x8b68('0xf3')]['hasMany'](db[_0x8b68('0x75')],{'as':_0x8b68('0x115'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0xf3')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x8b68('0x166')});db[_0x8b68('0xf3')]['hasMany'](db[_0x8b68('0x117')],{'as':'ReportAgentPreview','foreignKey':_0x8b68('0x166')});db[_0x8b68('0xf3')][_0x8b68('0x122')](db[_0x8b68('0x1a')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db['User'],{'as':'Agents','through':_0x8b68('0x127')});db['VoicePrefix'][_0x8b68('0x112')](db[_0x8b68('0x16')],{'as':_0x8b68('0x114'),'onDelete':'cascade'});db[_0x8b68('0x12d')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x1ed')});db[_0x8b68('0x12d')]['belongsToMany'](db[_0x8b68('0xe2')],{'through':'TeamVoicePrefix','as':_0x8b68('0x155')});db['UserProfile']['hasMany'](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'foreignKey':_0x8b68('0x121')});db['UserProfile'][_0x8b68('0x112')](db[_0x8b68('0xf7')],{'as':_0x8b68('0x1ee'),'foreignKey':_0x8b68('0x121'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0xf7')][_0x8b68('0x112')](db['UserProfileResource'],{'as':_0x8b68('0x1ef'),'foreignKey':_0x8b68('0x1f0'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0xfc')]['hasMany'](db['Disposition'],{'as':_0x8b68('0x161'),'foreignKey':_0x8b68('0x1f1'),'onDelete':_0x8b68('0x10e')});db[_0x8b68('0xfc')][_0x8b68('0x112')](db['CannedAnswer'],{'as':_0x8b68('0x163'),'foreignKey':_0x8b68('0x1f1')});db['WhatsappAccount']['hasMany'](db[_0x8b68('0x1f2')],{'as':'Messages','foreignKey':_0x8b68('0x1f1')});db[_0x8b68('0xfc')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0x8b68('0x112')](db[_0x8b68('0xfe')],{'as':'Applications'});db[_0x8b68('0xfc')][_0x8b68('0x14d')](db['CmList'],{'as':_0x8b68('0x165'),'foreignKey':_0x8b68('0x166')});db[_0x8b68('0xfc')]['belongsTo'](db[_0x8b68('0x168')],{'as':_0x8b68('0x169'),'foreignKey':_0x8b68('0x16a')});db[_0x8b68('0xfc')]['belongsToMany'](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x1f3')});db[_0x8b68('0xfe')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'onDelete':_0x8b68('0x179')});db[_0x8b68('0xfe')][_0x8b68('0x14d')](db[_0x8b68('0x135')],{'onDelete':_0x8b68('0x179')});db['WhatsappApplication'][_0x8b68('0x14d')](db[_0x8b68('0xfc')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x8b68('0x14d')](db[_0x8b68('0x83')],{'onDelete':_0x8b68('0x179'),'foreignKey':'IntervalId'});db[_0x8b68('0xfe')]['belongsTo'](db['Tag'],{'onDelete':_0x8b68('0x179'),'foreignKey':_0x8b68('0x17a')});db[_0x8b68('0x100')][_0x8b68('0x112')](db[_0x8b68('0x1f2')],{'as':_0x8b68('0x158'),'onDelete':_0x8b68('0x10e'),'foreignKey':_0x8b68('0x1f4')});db[_0x8b68('0x100')]['belongsTo'](db[_0x8b68('0xfc')],{'as':_0x8b68('0x16e'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x8b68('0x14d')](db['CmContact'],{'as':'Contact','foreignKey':_0x8b68('0x15f')});db['WhatsappInteraction'][_0x8b68('0x14d')](db['User'],{'as':_0x8b68('0x16f'),'foreignKey':_0x8b68('0x111')});db[_0x8b68('0x100')][_0x8b68('0x122')](db['Tag'],{'through':_0x8b68('0x1ac'),'as':_0x8b68('0x171')});db[_0x8b68('0x100')][_0x8b68('0x122')](db[_0x8b68('0x8a')],{'through':'whatsapp_interaction_has_tags','as':_0x8b68('0x172')});db[_0x8b68('0x100')]['belongsToMany'](db[_0x8b68('0x10c')],{'as':_0x8b68('0x173'),'through':_0x8b68('0x12c'),'foreignKey':_0x8b68('0x1f4')});db[_0x8b68('0x1f2')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x10c')});db[_0x8b68('0x1f2')]['belongsTo'](db[_0x8b68('0x6f')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x15e')});db[_0x8b68('0x1f2')][_0x8b68('0x14d')](db[_0x8b68('0x100')],{'onDelete':_0x8b68('0x10e'),'as':_0x8b68('0x181'),'foreignKey':_0x8b68('0x1f4')});db[_0x8b68('0x1f2')][_0x8b68('0x14d')](db['WhatsappAccount'],{'as':_0x8b68('0x16e'),'foreignKey':_0x8b68('0x1f1')});db[_0x8b68('0x1f5')]['belongsTo'](db[_0x8b68('0xfc')],{});db[_0x8b68('0x1f5')][_0x8b68('0x14d')](db[_0x8b68('0xf3')],{'as':'List','foreignKey':'ListId'});db[_0x8b68('0x1f5')][_0x8b68('0x14d')](db['CmContact'],{'as':_0x8b68('0x15e'),'foreignKey':_0x8b68('0x15f')});db[_0x8b68('0x1f5')][_0x8b68('0x14d')](db[_0x8b68('0x100')],{});db[_0x8b68('0x1f5')]['belongsTo'](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x8b68('0x14d')](db[_0x8b68('0x1f2')],{});db[_0x8b68('0x1f5')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{});db['WhatsappTransferReport'][_0x8b68('0x14d')](db['WhatsappMessage'],{});db[_0x8b68('0x104')][_0x8b68('0x14d')](db[_0x8b68('0x100')],{});db[_0x8b68('0x104')][_0x8b68('0x14d')](db[_0x8b68('0xfc')],{'foreignKey':_0x8b68('0x1f6'),'as':_0x8b68('0x1da')});db['WhatsappTransferReport'][_0x8b68('0x14d')](db[_0x8b68('0xfc')],{'foreignKey':_0x8b68('0x1f7'),'as':'ToAccount'});db[_0x8b68('0x104')][_0x8b68('0x14d')](db['WhatsappQueue'],{'foreignKey':_0x8b68('0x1f8'),'as':'ToQueue'});db[_0x8b68('0x104')]['belongsTo'](db[_0x8b68('0x10c')],{'foreignKey':'FromUserId','as':_0x8b68('0x1dc')});db[_0x8b68('0x104')][_0x8b68('0x14d')](db[_0x8b68('0x10c')],{'foreignKey':_0x8b68('0x1dd'),'as':_0x8b68('0x1e1')});db[_0x8b68('0x135')][_0x8b68('0x122')](db[_0x8b68('0x10c')],{'as':_0x8b68('0x154'),'through':_0x8b68('0x38'),'foreignKey':_0x8b68('0x1f9')});db[_0x8b68('0x135')][_0x8b68('0x122')](db['Team'],{'through':_0x8b68('0x1d5'),'as':'Teams'});module[_0x8b68('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 7e595af..25bf0c0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x856b=['./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./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/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','username','password','newPassword','apiKey','firstName','street','phone','fax','email','securityToken','code','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','pass','dsn','secret','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./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/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./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/faxAccount','/api/fax/applications','./api/faxApplication','/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/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/trigger','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations'];(function(_0x217a6f,_0x3ecd8b){var _0x5553f3=function(_0x24b9c0){while(--_0x24b9c0){_0x217a6f['push'](_0x217a6f['shift']());}};_0x5553f3(++_0x3ecd8b);}(_0x856b,0x9d));var _0xb856=function(_0x2cb169,_0x38ec0a){_0x2cb169=_0x2cb169-0x0;var _0x54c758=_0x856b[_0x2cb169];return _0x54c758;};'use strict';var _=require(_0xb856('0x0'));var path=require(_0xb856('0x1'));var express=require(_0xb856('0x2'));var ewinston=require(_0xb856('0x3'));var util=require('util');var errors=require(_0xb856('0x4'));var config=require(_0xb856('0x5'));var logger=require('./config/logger')('api');var authLogger=require(_0xb856('0x6'))(_0xb856('0x7'));exports[_0xb856('0x8')]=function(_0x54a099){_0x54a099[_0xb856('0x9')](ewinston[_0xb856('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x31751f,_0x3b8dcd){var _0x39f21b=_0xb856('0xb');if(!_[_0xb856('0xc')](_0x31751f[_0xb856('0xd')])){_0x39f21b+='\x20body=%s';var _0x54f015=_0x31751f['body'];maskSensitiveData(_0x54f015);}return util[_0xb856('0xe')](_0x39f21b,_0x31751f[_0xb856('0xf')],_0x31751f[_0xb856('0x10')][_0xb856('0x11')]?_0x31751f[_0xb856('0x10')][_0xb856('0x11')]:_0x31751f[_0xb856('0x12')][_0xb856('0x13')]||_0x31751f['ip'],_0x31751f[_0xb856('0x14')],_0x3b8dcd[_0xb856('0x15')],_0x3b8dcd[_0xb856('0x16')],_0x31751f[_0xb856('0x17')]?_0x31751f[_0xb856('0x17')]['id']:null,_0x31751f[_0xb856('0x17')]?_0x31751f[_0xb856('0x17')][_0xb856('0x18')]:null,_0x31751f[_0xb856('0x17')]?_0x31751f[_0xb856('0x17')][_0xb856('0x19')]:null,_0x54f015?util[_0xb856('0x1a')](_0x54f015,![],null):'');}}));_0x54a099[_0xb856('0x9')](ewinston[_0xb856('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x546e81,_0x598a36){var _0x193d02=_0xb856('0x1b');if(_0x546e81['body']&&_0x546e81[_0xb856('0xd')]['device']&&_0x546e81[_0xb856('0xd')][_0xb856('0x1c')]){_0x193d02=_0xb856('0x1d');}return util[_0xb856('0xe')](_0x193d02,_0x546e81['method'],_0x546e81[_0xb856('0x10')][_0xb856('0x11')]?_0x546e81[_0xb856('0x10')][_0xb856('0x11')]:_0x546e81[_0xb856('0x12')][_0xb856('0x13')]||_0x546e81['ip'],_0x546e81[_0xb856('0x14')],_0x598a36['statusCode'],_0x598a36[_0xb856('0x16')],_0x546e81['user']?_0x546e81['user']['id']:null,_0x546e81[_0xb856('0x17')]?_0x546e81[_0xb856('0x17')][_0xb856('0x18')]:null,_0x546e81[_0xb856('0x17')]?_0x546e81['user'][_0xb856('0x19')]:null,_0x546e81[_0xb856('0xd')]&&_0x546e81['body'][_0xb856('0x1e')]?_0x546e81[_0xb856('0xd')]['device']:_0xb856('0x1f'),_0x546e81[_0xb856('0xd')]&&_0x546e81[_0xb856('0xd')][_0xb856('0x1c')]?_0x546e81['body'][_0xb856('0x1c')]:'',_0x546e81[_0xb856('0xd')]&&_0x546e81[_0xb856('0xd')][_0xb856('0x20')]?_0x546e81['body'][_0xb856('0x20')]:'');},'ignoreRoute':function(_0x269f9e){var _0x54b2e1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x54b2e1[_0xb856('0x21')](_0x269f9e[_0xb856('0x14')]);}}));_0x54a099[_0xb856('0x9')]('/api/users',require(_0xb856('0x22')));_0x54a099['use'](_0xb856('0x23'),require('./api/voiceChanSpy'));_0x54a099['use'](_0xb856('0x24'),require(_0xb856('0x25')));_0x54a099['use'](_0xb856('0x26'),require('./api/voiceExtension'));_0x54a099[_0xb856('0x9')]('/api/voice/mohs',require(_0xb856('0x27')));_0x54a099[_0xb856('0x9')](_0xb856('0x28'),require(_0xb856('0x29')));_0x54a099[_0xb856('0x9')](_0xb856('0x2a'),require(_0xb856('0x2b')));_0x54a099[_0xb856('0x9')](_0xb856('0x2c'),require(_0xb856('0x2d')));_0x54a099[_0xb856('0x9')](_0xb856('0x2e'),require(_0xb856('0x2f')));_0x54a099[_0xb856('0x9')](_0xb856('0x30'),require(_0xb856('0x31')));_0x54a099[_0xb856('0x9')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x54a099[_0xb856('0x9')](_0xb856('0x32'),require(_0xb856('0x33')));_0x54a099[_0xb856('0x9')]('/api/voice/agents/reports',require(_0xb856('0x34')));_0x54a099[_0xb856('0x9')](_0xb856('0x35'),require(_0xb856('0x36')));_0x54a099[_0xb856('0x9')]('/api/members/reports',require(_0xb856('0x37')));_0x54a099['use']('/api/trunks',require(_0xb856('0x38')));_0x54a099[_0xb856('0x9')](_0xb856('0x39'),require(_0xb856('0x3a')));_0x54a099[_0xb856('0x9')]('/api/mail/out_servers',require(_0xb856('0x3b')));_0x54a099[_0xb856('0x9')](_0xb856('0x3c'),require(_0xb856('0x3d')));_0x54a099[_0xb856('0x9')](_0xb856('0x3e'),require(_0xb856('0x3f')));_0x54a099[_0xb856('0x9')](_0xb856('0x40'),require('./api/mailSubstatus'));_0x54a099[_0xb856('0x9')](_0xb856('0x41'),require(_0xb856('0x42')));_0x54a099['use']('/api/mail/messages',require(_0xb856('0x43')));_0x54a099[_0xb856('0x9')](_0xb856('0x44'),require(_0xb856('0x45')));_0x54a099['use'](_0xb856('0x46'),require(_0xb856('0x47')));_0x54a099[_0xb856('0x9')](_0xb856('0x48'),require(_0xb856('0x49')));_0x54a099[_0xb856('0x9')](_0xb856('0x4a'),require(_0xb856('0x4b')));_0x54a099['use'](_0xb856('0x4c'),require(_0xb856('0x4d')));_0x54a099['use'](_0xb856('0x4e'),require(_0xb856('0x4f')));_0x54a099[_0xb856('0x9')]('/api/fax/interactions',require('./api/faxInteraction'));_0x54a099[_0xb856('0x9')](_0xb856('0x50'),require(_0xb856('0x51')));_0x54a099['use'](_0xb856('0x52'),require(_0xb856('0x53')));_0x54a099[_0xb856('0x9')](_0xb856('0x54'),require(_0xb856('0x55')));_0x54a099[_0xb856('0x9')](_0xb856('0x56'),require(_0xb856('0x57')));_0x54a099[_0xb856('0x9')](_0xb856('0x58'),require(_0xb856('0x59')));_0x54a099['use'](_0xb856('0x5a'),require(_0xb856('0x5b')));_0x54a099[_0xb856('0x9')](_0xb856('0x5c'),require(_0xb856('0x5d')));_0x54a099[_0xb856('0x9')](_0xb856('0x5e'),require(_0xb856('0x5f')));_0x54a099[_0xb856('0x9')](_0xb856('0x60'),require(_0xb856('0x61')));_0x54a099[_0xb856('0x9')](_0xb856('0x62'),require('./api/openchannelApplication'));_0x54a099[_0xb856('0x9')](_0xb856('0x63'),require(_0xb856('0x64')));_0x54a099['use'](_0xb856('0x65'),require(_0xb856('0x66')));_0x54a099[_0xb856('0x9')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x54a099[_0xb856('0x9')]('/api/chat/websites',require('./api/chatWebsite'));_0x54a099[_0xb856('0x9')](_0xb856('0x67'),require('./api/openchannelQueueReport'));_0x54a099[_0xb856('0x9')]('/api/chat/applications',require(_0xb856('0x68')));_0x54a099[_0xb856('0x9')](_0xb856('0x69'),require(_0xb856('0x6a')));_0x54a099[_0xb856('0x9')](_0xb856('0x6b'),require(_0xb856('0x6c')));_0x54a099[_0xb856('0x9')](_0xb856('0x6d'),require('./api/chatOfflineMessage'));_0x54a099[_0xb856('0x9')](_0xb856('0x6e'),require('./api/chatQueue'));_0x54a099[_0xb856('0x9')](_0xb856('0x6f'),require(_0xb856('0x70')));_0x54a099[_0xb856('0x9')]('/api/chat/proactive_actions',require(_0xb856('0x71')));_0x54a099[_0xb856('0x9')](_0xb856('0x72'),require(_0xb856('0x73')));_0x54a099[_0xb856('0x9')](_0xb856('0x74'),require(_0xb856('0x75')));_0x54a099['use']('/api/cm/hopper',require(_0xb856('0x76')));_0x54a099[_0xb856('0x9')](_0xb856('0x77'),require(_0xb856('0x78')));_0x54a099[_0xb856('0x9')](_0xb856('0x79'),require(_0xb856('0x7a')));_0x54a099[_0xb856('0x9')](_0xb856('0x7b'),require(_0xb856('0x7c')));_0x54a099['use'](_0xb856('0x7d'),require('./api/cmCustomField'));_0x54a099[_0xb856('0x9')](_0xb856('0x7e'),require(_0xb856('0x7f')));_0x54a099[_0xb856('0x9')]('/api/automations',require(_0xb856('0x80')));_0x54a099[_0xb856('0x9')](_0xb856('0x81'),require(_0xb856('0x82')));_0x54a099[_0xb856('0x9')](_0xb856('0x83'),require('./api/disposition'));_0x54a099[_0xb856('0x9')](_0xb856('0x84'),require(_0xb856('0x85')));_0x54a099[_0xb856('0x9')](_0xb856('0x86'),require(_0xb856('0x87')));_0x54a099['use']('/api/pauses',require(_0xb856('0x88')));_0x54a099[_0xb856('0x9')](_0xb856('0x89'),require(_0xb856('0x8a')));_0x54a099[_0xb856('0x9')]('/api/voiceQueuesLog',require(_0xb856('0x8b')));_0x54a099[_0xb856('0x9')]('/api/schedules',require(_0xb856('0x8c')));_0x54a099['use'](_0xb856('0x8d'),require(_0xb856('0x8e')));_0x54a099['use']('/api/tags',require(_0xb856('0x8f')));_0x54a099[_0xb856('0x9')](_0xb856('0x90'),require('./api/template'));_0x54a099['use']('/api/triggers',require(_0xb856('0x91')));_0x54a099[_0xb856('0x9')]('/api/variables',require('./api/variable'));_0x54a099[_0xb856('0x9')]('/api/integrations',require('./api/integration'));_0x54a099['use']('/api/integrations/reports',require(_0xb856('0x92')));_0x54a099['use'](_0xb856('0x93'),require(_0xb856('0x94')));_0x54a099['use'](_0xb856('0x95'),require(_0xb856('0x96')));_0x54a099['use'](_0xb856('0x97'),require(_0xb856('0x98')));_0x54a099[_0xb856('0x9')](_0xb856('0x99'),require(_0xb856('0x9a')));_0x54a099['use']('/api/analytics/field_reports',require(_0xb856('0x9b')));_0x54a099[_0xb856('0x9')](_0xb856('0x9c'),require(_0xb856('0x9d')));_0x54a099['use'](_0xb856('0x9e'),require('./api/intSalesforceAccount'));_0x54a099[_0xb856('0x9')](_0xb856('0x9f'),require('./api/intSalesforceConfiguration'));_0x54a099[_0xb856('0x9')]('/api/integrations/salesforce/fields',require(_0xb856('0xa0')));_0x54a099['use'](_0xb856('0xa1'),require(_0xb856('0xa2')));_0x54a099[_0xb856('0x9')](_0xb856('0xa3'),require(_0xb856('0xa4')));_0x54a099[_0xb856('0x9')](_0xb856('0xa5'),require(_0xb856('0xa6')));_0x54a099[_0xb856('0x9')](_0xb856('0xa7'),require(_0xb856('0xa8')));_0x54a099[_0xb856('0x9')](_0xb856('0xa9'),require(_0xb856('0xaa')));_0x54a099[_0xb856('0x9')]('/api/integrations/desk/fields',require(_0xb856('0xab')));_0x54a099[_0xb856('0x9')](_0xb856('0xac'),require(_0xb856('0xad')));_0x54a099[_0xb856('0x9')](_0xb856('0xae'),require(_0xb856('0xaf')));_0x54a099['use'](_0xb856('0xb0'),require('./api/intZohoField'));_0x54a099['use'](_0xb856('0xb1'),require('./api/intZendeskAccount'));_0x54a099[_0xb856('0x9')](_0xb856('0xb2'),require(_0xb856('0xb3')));_0x54a099['use'](_0xb856('0xb4'),require(_0xb856('0xb5')));_0x54a099['use'](_0xb856('0xb6'),require('./api/intFreshdeskAccount'));_0x54a099[_0xb856('0x9')](_0xb856('0xb7'),require(_0xb856('0xb8')));_0x54a099[_0xb856('0x9')](_0xb856('0xb9'),require(_0xb856('0xba')));_0x54a099[_0xb856('0x9')]('/api/integrations/vtiger/accounts',require(_0xb856('0xbb')));_0x54a099[_0xb856('0x9')](_0xb856('0xbc'),require(_0xb856('0xbd')));_0x54a099['use'](_0xb856('0xbe'),require(_0xb856('0xbf')));_0x54a099['use'](_0xb856('0xc0'),require(_0xb856('0xc1')));_0x54a099[_0xb856('0x9')](_0xb856('0xc2'),require(_0xb856('0xc3')));_0x54a099[_0xb856('0x9')](_0xb856('0xc4'),require(_0xb856('0xc5')));_0x54a099[_0xb856('0x9')](_0xb856('0xc6'),require(_0xb856('0xc7')));_0x54a099['use']('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x54a099[_0xb856('0x9')](_0xb856('0xc8'),require(_0xb856('0xc9')));_0x54a099[_0xb856('0x9')](_0xb856('0xca'),require(_0xb856('0xcb')));_0x54a099[_0xb856('0x9')](_0xb856('0xcc'),require(_0xb856('0xcd')));_0x54a099[_0xb856('0x9')](_0xb856('0xce'),require(_0xb856('0xcf')));_0x54a099[_0xb856('0x9')]('/api/networks',require(_0xb856('0xd0')));_0x54a099[_0xb856('0x9')](_0xb856('0xd1'),require(_0xb856('0xd2')));_0x54a099['use'](_0xb856('0xd3'),require(_0xb856('0xd4')));_0x54a099[_0xb856('0x9')](_0xb856('0xd5'),require(_0xb856('0xd6')));_0x54a099[_0xb856('0x9')](_0xb856('0xd7'),require(_0xb856('0xd8')));_0x54a099[_0xb856('0x9')]('/api/jscripty/sessions/reports',require(_0xb856('0xd9')));_0x54a099[_0xb856('0x9')](_0xb856('0xda'),require(_0xb856('0xdb')));_0x54a099['use'](_0xb856('0xdc'),require('./api/squareReport'));_0x54a099['use'](_0xb856('0xdd'),require(_0xb856('0xde')));_0x54a099[_0xb856('0x9')](_0xb856('0xdf'),require(_0xb856('0xe0')));_0x54a099['use']('/api/settings',require(_0xb856('0xe1')));_0x54a099[_0xb856('0x9')](_0xb856('0xe2'),require(_0xb856('0xe3')));_0x54a099[_0xb856('0x9')](_0xb856('0xe4'),require('./api/squareProject'));_0x54a099[_0xb856('0x9')](_0xb856('0xe5'),require(_0xb856('0xe6')));_0x54a099[_0xb856('0x9')](_0xb856('0xe7'),require(_0xb856('0xe8')));_0x54a099[_0xb856('0x9')]('/api/teams',require(_0xb856('0xe9')));_0x54a099[_0xb856('0x9')](_0xb856('0xea'),require(_0xb856('0xeb')));_0x54a099[_0xb856('0x9')]('/api/campaigns',require(_0xb856('0xec')));_0x54a099[_0xb856('0x9')](_0xb856('0xed'),require(_0xb856('0xee')));_0x54a099[_0xb856('0x9')](_0xb856('0xef'),require(_0xb856('0xf0')));_0x54a099[_0xb856('0x9')](_0xb856('0xf1'),require('./api/plugin'));_0x54a099[_0xb856('0x9')](_0xb856('0xf2'),require(_0xb856('0xf3')));_0x54a099['use'](_0xb856('0xf4'),require(_0xb856('0xf5')));_0x54a099[_0xb856('0x9')](_0xb856('0xf6'),require(_0xb856('0xf7')));_0x54a099[_0xb856('0x9')](_0xb856('0xf8'),require(_0xb856('0xf9')));_0x54a099[_0xb856('0x9')](_0xb856('0xfa'),require(_0xb856('0xfb')));_0x54a099['use'](_0xb856('0xfc'),require('./api/cmList'));_0x54a099['use'](_0xb856('0xfd'),require(_0xb856('0xfe')));_0x54a099[_0xb856('0x9')](_0xb856('0xff'),require(_0xb856('0x100')));_0x54a099['use'](_0xb856('0x101'),require('./api/userProfileSection'));_0x54a099['use'](_0xb856('0x102'),require(_0xb856('0x103')));_0x54a099[_0xb856('0x9')](_0xb856('0x104'),require(_0xb856('0x105')));_0x54a099[_0xb856('0x9')](_0xb856('0x106'),require('./api/whatsappAccount'));_0x54a099['use'](_0xb856('0x107'),require('./api/whatsappApplication'));_0x54a099[_0xb856('0x9')](_0xb856('0x108'),require(_0xb856('0x109')));_0x54a099[_0xb856('0x9')](_0xb856('0x10a'),require(_0xb856('0x10b')));_0x54a099[_0xb856('0x9')](_0xb856('0x10c'),require(_0xb856('0x10d')));_0x54a099[_0xb856('0x9')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x54a099[_0xb856('0x9')]('/api/whatsapp/queues',require(_0xb856('0x10e')));_0x54a099[_0xb856('0x9')](_0xb856('0x10f'),require(_0xb856('0x110')));_0x54a099[_0xb856('0x9')](_0xb856('0x111'),require(_0xb856('0x112')));_0x54a099['use']('/api/auth/local',require('./api/authLocal'));_0x54a099[_0xb856('0x9')](_0xb856('0x113'),require(_0xb856('0x114')));_0x54a099[_0xb856('0x9')](_0xb856('0x115'),require(_0xb856('0x116')));_0x54a099['use'](_0xb856('0x117'),require(_0xb856('0x118')));_0x54a099[_0xb856('0x9')](_0xb856('0x119'),require(_0xb856('0x11a')));_0x54a099[_0xb856('0x9')](_0xb856('0x11b'),require(_0xb856('0x11c')));_0x54a099['use'](_0xb856('0x11d'),require('./api/pm2'));_0x54a099[_0xb856('0x9')](_0xb856('0x11e'),require(_0xb856('0x11f')));_0x54a099[_0xb856('0x9')](_0xb856('0x120'),express['static'](path[_0xb856('0x121')](config['root'],_0xb856('0x120'))));_0x54a099[_0xb856('0x9')](_0xb856('0x122'),express[_0xb856('0x123')](path[_0xb856('0x121')](config[_0xb856('0x124')],_0xb856('0x122'))));_0x54a099[_0xb856('0x9')]('/demo',express[_0xb856('0x123')](path['join'](config[_0xb856('0x124')],_0xb856('0x125'))));_0x54a099['use']('/snippet',express[_0xb856('0x123')](path[_0xb856('0x121')](config['root'],_0xb856('0x126'),'3.0.0')));_0x54a099['use'](_0xb856('0x127'),express[_0xb856('0x123')](path[_0xb856('0x121')](config['root'],_0xb856('0x128'))));_0x54a099[_0xb856('0x129')](_0xb856('0x12a'))[_0xb856('0x12b')](errors[0x194]);_0x54a099[_0xb856('0x129')]('/*')[_0xb856('0x12b')](function(_0x383a5e,_0x3a7f9b){_0x3a7f9b[_0xb856('0x12c')](path[_0xb856('0x12d')](_0x54a099[_0xb856('0x12b')]('appPath')+_0xb856('0x12e')));});};var sensitiveFields=[_0xb856('0x12f'),_0xb856('0x130'),_0xb856('0x131'),_0xb856('0x132'),_0xb856('0x133'),'lastName',_0xb856('0x134'),_0xb856('0x135'),'mobile',_0xb856('0x136'),_0xb856('0x137'),'clientId','clientSecret',_0xb856('0x138'),_0xb856('0x139'),'accessKey','tenantId','token',_0xb856('0x13a'),_0xb856('0x13b'),'accessTokenSecret',_0xb856('0x13c'),_0xb856('0x13d'),'consumerSecret',_0xb856('0x13e'),_0xb856('0x13f'),_0xb856('0x140'),_0xb856('0x141'),_0xb856('0x142'),_0xb856('0x143'),'privateKey','accesskeyid','secretaccesskey',_0xb856('0x144'),'user',_0xb856('0x145'),'accountSid','localstationid',_0xb856('0x146'),_0xb856('0x147'),'registry',_0xb856('0x148')];function maskSensitiveData(_0x5cda10){var _0x3de1dd=/(?!^)[\s\S](?!$)/g;if(!_[_0xb856('0x149')](_0x5cda10))return;for(var _0x2c5eda in _0x5cda10){if(_[_0xb856('0x14a')](_0x5cda10[_0x2c5eda])){for(var _0x3c5628=0x0;_0x3c5628<_0x5cda10[_0x2c5eda][_0xb856('0x14b')];_0x3c5628++){maskSensitiveData(_0x5cda10[_0x2c5eda][_0x3c5628]);}}else if(_['isPlainObject'](_0x5cda10[_0x2c5eda])){maskSensitiveData(_0x5cda10[_0x2c5eda]);}else if(_[_0xb856('0x14c')](_0x5cda10[_0x2c5eda])){_0x5cda10[_0x2c5eda]=_0x5cda10[_0x2c5eda][_0xb856('0x14d')](/{{{/g,_0xb856('0x14e'))['replace'](/}}}/g,_0xb856('0x14f'))[_0xb856('0x14d')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x2c5eda)){_0x5cda10[_0x2c5eda]=_0x5cda10[_0x2c5eda][_0xb856('0x14d')](_0x3de1dd,'*');}}}} \ No newline at end of file +var _0x9a18=['auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','headers','x-forwarded-for','connection','remoteAddress','url','user','name','role','inspect','logger','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','statusCode','responseTime','device','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/tag','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','securityToken','code','tenantId','token','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','./errors','./config/logger','api'];(function(_0x33036c,_0x19b9cc){var _0x2f1b8f=function(_0x4cd57e){while(--_0x4cd57e){_0x33036c['push'](_0x33036c['shift']());}};_0x2f1b8f(++_0x19b9cc);}(_0x9a18,0x143));var _0x89a1=function(_0x51e9e4,_0x2934ad){_0x51e9e4=_0x51e9e4-0x0;var _0x15dfc7=_0x9a18[_0x51e9e4];return _0x15dfc7;};'use strict';var _=require(_0x89a1('0x0'));var path=require('path');var express=require('express');var ewinston=require('express-winston');var util=require('util');var errors=require(_0x89a1('0x1'));var config=require('./config/environment');var logger=require(_0x89a1('0x2'))(_0x89a1('0x3'));var authLogger=require(_0x89a1('0x2'))(_0x89a1('0x4'));exports[_0x89a1('0x5')]=function(_0x5da1e7){_0x5da1e7[_0x89a1('0x6')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x161e14,_0x180d06){var _0x361f4f=_0x89a1('0x7');if(!_[_0x89a1('0x8')](_0x161e14['body'])){_0x361f4f+=_0x89a1('0x9');var _0x8c1433=_0x161e14[_0x89a1('0xa')];maskSensitiveData(_0x8c1433);}return util[_0x89a1('0xb')](_0x361f4f,_0x161e14['method'],_0x161e14['headers']['x-forwarded-for']?_0x161e14[_0x89a1('0xc')][_0x89a1('0xd')]:_0x161e14[_0x89a1('0xe')][_0x89a1('0xf')]||_0x161e14['ip'],_0x161e14[_0x89a1('0x10')],_0x180d06['statusCode'],_0x180d06['responseTime'],_0x161e14[_0x89a1('0x11')]?_0x161e14['user']['id']:null,_0x161e14['user']?_0x161e14[_0x89a1('0x11')][_0x89a1('0x12')]:null,_0x161e14[_0x89a1('0x11')]?_0x161e14[_0x89a1('0x11')][_0x89a1('0x13')]:null,_0x8c1433?util[_0x89a1('0x14')](_0x8c1433,![],null):'');}}));_0x5da1e7[_0x89a1('0x6')](ewinston[_0x89a1('0x15')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3fd8a7,_0x36941d){var _0x44bb86='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3fd8a7[_0x89a1('0xa')]&&_0x3fd8a7[_0x89a1('0xa')]['device']&&_0x3fd8a7[_0x89a1('0xa')][_0x89a1('0x16')]){_0x44bb86=_0x89a1('0x17');}return util[_0x89a1('0xb')](_0x44bb86,_0x3fd8a7[_0x89a1('0x18')],_0x3fd8a7[_0x89a1('0xc')][_0x89a1('0xd')]?_0x3fd8a7[_0x89a1('0xc')][_0x89a1('0xd')]:_0x3fd8a7[_0x89a1('0xe')]['remoteAddress']||_0x3fd8a7['ip'],_0x3fd8a7[_0x89a1('0x10')],_0x36941d[_0x89a1('0x19')],_0x36941d[_0x89a1('0x1a')],_0x3fd8a7['user']?_0x3fd8a7[_0x89a1('0x11')]['id']:null,_0x3fd8a7[_0x89a1('0x11')]?_0x3fd8a7[_0x89a1('0x11')][_0x89a1('0x12')]:null,_0x3fd8a7[_0x89a1('0x11')]?_0x3fd8a7[_0x89a1('0x11')]['role']:null,_0x3fd8a7['body']&&_0x3fd8a7[_0x89a1('0xa')]['device']?_0x3fd8a7['body'][_0x89a1('0x1b')]:'other',_0x3fd8a7[_0x89a1('0xa')]&&_0x3fd8a7[_0x89a1('0xa')][_0x89a1('0x16')]?_0x3fd8a7['body'][_0x89a1('0x16')]:'',_0x3fd8a7[_0x89a1('0xa')]&&_0x3fd8a7['body']['agent_name']?_0x3fd8a7[_0x89a1('0xa')]['agent_name']:'');},'ignoreRoute':function(_0x42a95d){var _0x67ccdb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x67ccdb[_0x89a1('0x1c')](_0x42a95d['url']);}}));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x1d'),require(_0x89a1('0x1e')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x1f'),require(_0x89a1('0x20')));_0x5da1e7['use'](_0x89a1('0x21'),require(_0x89a1('0x22')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x23'),require(_0x89a1('0x24')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x25'),require(_0x89a1('0x26')));_0x5da1e7[_0x89a1('0x6')]('/api/voice/queues',require(_0x89a1('0x27')));_0x5da1e7['use']('/api/voice/recordings',require(_0x89a1('0x28')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x29'),require(_0x89a1('0x2a')));_0x5da1e7[_0x89a1('0x6')]('/api/voice/mails',require(_0x89a1('0x2b')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x2c'),require(_0x89a1('0x2d')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x2e'),require('./api/voiceCallReport'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x2f'),require(_0x89a1('0x30')));_0x5da1e7['use'](_0x89a1('0x31'),require('./api/voiceAgentReport'));_0x5da1e7[_0x89a1('0x6')]('/api/voice/queues/reports',require(_0x89a1('0x32')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x33'),require(_0x89a1('0x34')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x35'),require(_0x89a1('0x36')));_0x5da1e7[_0x89a1('0x6')]('/api/voice/transfers/reports',require(_0x89a1('0x37')));_0x5da1e7[_0x89a1('0x6')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x5da1e7['use'](_0x89a1('0x38'),require(_0x89a1('0x39')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x3a'),require(_0x89a1('0x3b')));_0x5da1e7['use'](_0x89a1('0x3c'),require(_0x89a1('0x3d')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x3e'),require(_0x89a1('0x3f')));_0x5da1e7[_0x89a1('0x6')]('/api/mail/messages',require(_0x89a1('0x40')));_0x5da1e7['use'](_0x89a1('0x41'),require(_0x89a1('0x42')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x43'),require(_0x89a1('0x44')));_0x5da1e7['use']('/api/dashboards',require('./api/dashboard'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x45'),require(_0x89a1('0x46')));_0x5da1e7[_0x89a1('0x6')]('/api/fax/accounts',require(_0x89a1('0x47')));_0x5da1e7[_0x89a1('0x6')]('/api/fax/applications',require(_0x89a1('0x48')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x49'),require('./api/faxInteraction'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x4a'),require('./api/faxMessage'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x4b'),require(_0x89a1('0x4c')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x4d'),require('./api/faxQueueReport'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x4e'),require(_0x89a1('0x4f')));_0x5da1e7['use'](_0x89a1('0x50'),require(_0x89a1('0x51')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x52'),require('./api/smsInteraction'));_0x5da1e7['use'](_0x89a1('0x53'),require('./api/smsMessage'));_0x5da1e7['use'](_0x89a1('0x54'),require(_0x89a1('0x55')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x56'),require(_0x89a1('0x57')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x58'),require(_0x89a1('0x59')));_0x5da1e7['use'](_0x89a1('0x5a'),require('./api/openchannelInteraction'));_0x5da1e7['use'](_0x89a1('0x5b'),require(_0x89a1('0x5c')));_0x5da1e7[_0x89a1('0x6')]('/api/openchannel/queues',require(_0x89a1('0x5d')));_0x5da1e7['use'](_0x89a1('0x5e'),require(_0x89a1('0x5f')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x60'),require(_0x89a1('0x61')));_0x5da1e7[_0x89a1('0x6')]('/api/chat/applications',require('./api/chatApplication'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x62'),require(_0x89a1('0x63')));_0x5da1e7['use'](_0x89a1('0x64'),require(_0x89a1('0x65')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x66'),require(_0x89a1('0x67')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x68'),require(_0x89a1('0x69')));_0x5da1e7['use']('/api/chat/groups',require(_0x89a1('0x6a')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x6b'),require('./api/chatProactiveAction'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x6c'),require(_0x89a1('0x6d')));_0x5da1e7['use'](_0x89a1('0x6e'),require(_0x89a1('0x6f')));_0x5da1e7[_0x89a1('0x6')]('/api/cm/hopper',require(_0x89a1('0x70')));_0x5da1e7[_0x89a1('0x6')]('/api/cm/hopper_black',require(_0x89a1('0x71')));_0x5da1e7[_0x89a1('0x6')]('/api/cm/hopper_final',require(_0x89a1('0x72')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x73'),require(_0x89a1('0x74')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x75'),require(_0x89a1('0x76')));_0x5da1e7[_0x89a1('0x6')]('/api/actions',require(_0x89a1('0x77')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x78'),require(_0x89a1('0x79')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x7a'),require(_0x89a1('0x7b')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x7c'),require(_0x89a1('0x7d')));_0x5da1e7[_0x89a1('0x6')]('/api/conditions',require(_0x89a1('0x7e')));_0x5da1e7['use'](_0x89a1('0x7f'),require(_0x89a1('0x80')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x81'),require(_0x89a1('0x82')));_0x5da1e7[_0x89a1('0x6')]('/api/cdr',require(_0x89a1('0x83')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x84'),require('./api/voiceQueuesLog'));_0x5da1e7[_0x89a1('0x6')]('/api/schedules',require(_0x89a1('0x85')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x86'),require('./api/sound'));_0x5da1e7[_0x89a1('0x6')]('/api/tags',require(_0x89a1('0x87')));_0x5da1e7[_0x89a1('0x6')]('/api/templates',require(_0x89a1('0x88')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x89'),require('./api/trigger'));_0x5da1e7['use'](_0x89a1('0x8a'),require(_0x89a1('0x8b')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x8c'),require(_0x89a1('0x8d')));_0x5da1e7['use']('/api/integrations/reports',require(_0x89a1('0x8e')));_0x5da1e7['use'](_0x89a1('0x8f'),require(_0x89a1('0x90')));_0x5da1e7[_0x89a1('0x6')]('/api/analytics/default_reports',require(_0x89a1('0x91')));_0x5da1e7['use'](_0x89a1('0x92'),require(_0x89a1('0x93')));_0x5da1e7[_0x89a1('0x6')]('/api/analytics/metrics',require(_0x89a1('0x94')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x95'),require('./api/analyticFieldReport'));_0x5da1e7[_0x89a1('0x6')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x96'),require(_0x89a1('0x97')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x98'),require('./api/intSalesforceConfiguration'));_0x5da1e7['use'](_0x89a1('0x99'),require('./api/intSalesforceField'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x9a'),require(_0x89a1('0x9b')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x9c'),require(_0x89a1('0x9d')));_0x5da1e7[_0x89a1('0x6')]('/api/integrations/sugarcrm/fields',require(_0x89a1('0x9e')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x9f'),require('./api/intDeskAccount'));_0x5da1e7['use']('/api/integrations/desk/configurations',require(_0x89a1('0xa0')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xa1'),require(_0x89a1('0xa2')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xa3'),require(_0x89a1('0xa4')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xa5'),require(_0x89a1('0xa6')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xa7'),require('./api/intZohoField'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xa8'),require(_0x89a1('0xa9')));_0x5da1e7['use'](_0x89a1('0xaa'),require(_0x89a1('0xab')));_0x5da1e7['use'](_0x89a1('0xac'),require(_0x89a1('0xad')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xae'),require(_0x89a1('0xaf')));_0x5da1e7['use'](_0x89a1('0xb0'),require(_0x89a1('0xb1')));_0x5da1e7['use'](_0x89a1('0xb2'),require('./api/intFreshdeskField'));_0x5da1e7[_0x89a1('0x6')]('/api/integrations/vtiger/accounts',require(_0x89a1('0xb3')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xb4'),require(_0x89a1('0xb5')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xb6'),require(_0x89a1('0xb7')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xb8'),require(_0x89a1('0xb9')));_0x5da1e7['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x5da1e7[_0x89a1('0x6')]('/api/integrations/servicenow/fields',require(_0x89a1('0xba')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xbb'),require(_0x89a1('0xbc')));_0x5da1e7[_0x89a1('0x6')]('/api/integrations/dynamics365/configurations',require(_0x89a1('0xbd')));_0x5da1e7[_0x89a1('0x6')]('/api/integrations/dynamics365/fields',require(_0x89a1('0xbe')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xbf'),require(_0x89a1('0xc0')));_0x5da1e7['use'](_0x89a1('0xc1'),require('./api/intFreshsalesConfiguration'));_0x5da1e7['use'](_0x89a1('0xc2'),require(_0x89a1('0xc3')));_0x5da1e7[_0x89a1('0x6')]('/api/networks',require('./api/network'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xc4'),require(_0x89a1('0xc5')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xc6'),require(_0x89a1('0xc7')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xc8'),require('./api/jscriptyAnswerReport'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xc9'),require('./api/jscriptyQuestionReport'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xca'),require(_0x89a1('0xcb')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xcc'),require(_0x89a1('0xcd')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xce'),require(_0x89a1('0xcf')));_0x5da1e7['use'](_0x89a1('0xd0'),require(_0x89a1('0xd1')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xd2'),require(_0x89a1('0xd3')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xd4'),require(_0x89a1('0xd5')));_0x5da1e7[_0x89a1('0x6')]('/api/square/odbc',require(_0x89a1('0xd6')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xd7'),require('./api/squareProject'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xd8'),require('./api/squareRecording'));_0x5da1e7['use'](_0x89a1('0xd9'),require(_0x89a1('0xda')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xdb'),require(_0x89a1('0xdc')));_0x5da1e7['use'](_0x89a1('0xdd'),require(_0x89a1('0xde')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xdf'),require(_0x89a1('0xe0')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xe1'),require(_0x89a1('0xe2')));_0x5da1e7[_0x89a1('0x6')]('/api/attachments',require('./api/attachment'));_0x5da1e7[_0x89a1('0x6')]('/api/plugins',require(_0x89a1('0xe3')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xe4'),require('./api/mailTransferReport'));_0x5da1e7[_0x89a1('0x6')]('/api/chat/reports/transfer',require(_0x89a1('0xe5')));_0x5da1e7[_0x89a1('0x6')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xe6'),require(_0x89a1('0xe7')));_0x5da1e7[_0x89a1('0x6')]('/api/sms/reports/transfer',require(_0x89a1('0xe8')));_0x5da1e7[_0x89a1('0x6')]('/api/cm/lists',require(_0x89a1('0xe9')));_0x5da1e7['use'](_0x89a1('0xea'),require(_0x89a1('0xeb')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xec'),require(_0x89a1('0xed')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xee'),require(_0x89a1('0xef')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xf0'),require('./api/userProfileResource'));_0x5da1e7[_0x89a1('0x6')]('/api/userNotifications',require(_0x89a1('0xf1')));_0x5da1e7['use'](_0x89a1('0xf2'),require(_0x89a1('0xf3')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xf4'),require(_0x89a1('0xf5')));_0x5da1e7['use'](_0x89a1('0xf6'),require(_0x89a1('0xf7')));_0x5da1e7['use'](_0x89a1('0xf8'),require(_0x89a1('0xf9')));_0x5da1e7[_0x89a1('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x5da1e7[_0x89a1('0x6')]('/api/whatsapp/reports/transfer',require(_0x89a1('0xfa')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xfb'),require(_0x89a1('0xfc')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xfd'),require(_0x89a1('0xfe')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0xff'),require(_0x89a1('0x100')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x101'),require('./api/authLocal'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x102'),require(_0x89a1('0x103')));_0x5da1e7['use'](_0x89a1('0x104'),require(_0x89a1('0x105')));_0x5da1e7['use'](_0x89a1('0x106'),require('./api/rpc'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x107'),require(_0x89a1('0x108')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x109'),require(_0x89a1('0x10a')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x10b'),require('./api/pm2'));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x10c'),require(_0x89a1('0x10d')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x10e'),express[_0x89a1('0x10f')](path['join'](config[_0x89a1('0x110')],_0x89a1('0x10e'))));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x111'),express['static'](path[_0x89a1('0x112')](config[_0x89a1('0x110')],'/www')));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x113'),express['static'](path[_0x89a1('0x112')](config[_0x89a1('0x110')],_0x89a1('0x113'))));_0x5da1e7['use'](_0x89a1('0x114'),express[_0x89a1('0x10f')](path[_0x89a1('0x112')](config[_0x89a1('0x110')],_0x89a1('0x115'),_0x89a1('0x116'))));_0x5da1e7[_0x89a1('0x6')](_0x89a1('0x117'),express['static'](path[_0x89a1('0x112')](config[_0x89a1('0x110')],_0x89a1('0x118'))));_0x5da1e7[_0x89a1('0x119')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x89a1('0x11a')](errors[0x194]);_0x5da1e7[_0x89a1('0x119')]('/*')[_0x89a1('0x11a')](function(_0x5ea18a,_0x4e2fe5){_0x4e2fe5[_0x89a1('0x11b')](path[_0x89a1('0x11c')](_0x5da1e7[_0x89a1('0x11a')](_0x89a1('0x11d'))+_0x89a1('0x11e')));});};var sensitiveFields=[_0x89a1('0x11f'),_0x89a1('0x120'),_0x89a1('0x121'),'apiKey',_0x89a1('0x122'),_0x89a1('0x123'),_0x89a1('0x124'),_0x89a1('0x125'),_0x89a1('0x126'),'fax',_0x89a1('0x127'),_0x89a1('0x128'),'clientSecret',_0x89a1('0x129'),_0x89a1('0x12a'),'accessKey',_0x89a1('0x12b'),_0x89a1('0x12c'),'channelSecret',_0x89a1('0x12d'),'accessTokenSecret',_0x89a1('0x12e'),_0x89a1('0x12f'),_0x89a1('0x130'),_0x89a1('0x131'),_0x89a1('0x132'),'calleridnum',_0x89a1('0x133'),_0x89a1('0x134'),'clientEmail',_0x89a1('0x135'),_0x89a1('0x136'),_0x89a1('0x137'),'key',_0x89a1('0x11'),_0x89a1('0x138'),_0x89a1('0x139'),_0x89a1('0x13a'),_0x89a1('0x13b'),_0x89a1('0x13c'),_0x89a1('0x13d'),_0x89a1('0x13e')];function maskSensitiveData(_0x256e51){var _0x169fd9=/(?!^)[\s\S](?!$)/g;if(!_[_0x89a1('0x13f')](_0x256e51))return;for(var _0xfeecda in _0x256e51){if(_[_0x89a1('0x140')](_0x256e51[_0xfeecda])){for(var _0x2b4505=0x0;_0x2b4505<_0x256e51[_0xfeecda][_0x89a1('0x141')];_0x2b4505++){maskSensitiveData(_0x256e51[_0xfeecda][_0x2b4505]);}}else if(_[_0x89a1('0x13f')](_0x256e51[_0xfeecda])){maskSensitiveData(_0x256e51[_0xfeecda]);}else if(_[_0x89a1('0x142')](_0x256e51[_0xfeecda])){_0x256e51[_0xfeecda]=_0x256e51[_0xfeecda][_0x89a1('0x143')](/{{{/g,_0x89a1('0x144'))['replace'](/}}}/g,_0x89a1('0x145'))[_0x89a1('0x143')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x89a1('0x146')](sensitiveFields,_0xfeecda)){_0x256e51[_0xfeecda]=_0x256e51[_0xfeecda][_0x89a1('0x143')](_0x169fd9,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0c7a40c..92c7453 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b5d=['../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc'];(function(_0x3b6761,_0x2623b4){var _0x2c6e13=function(_0x6d050d){while(--_0x6d050d){_0x3b6761['push'](_0x3b6761['shift']());}};_0x2c6e13(++_0x2623b4);}(_0x8b5d,0x138));var _0xd8b5=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x8b5d[_0x4eb6ec];return _0x58881b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xd8b5('0x0'));var _=require(_0xd8b5('0x1'));var config=require(_0xd8b5('0x2'));exports[_0xd8b5('0x3')]=function(){return new BPromise(function(_0x23a075,_0x1866a3){var _0x33f469={};_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x5')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x6')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x7')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x8')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x9')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x33f469=_['merge'](_0x33f469,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0xa')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0xb')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0xc')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0xd')));_0x33f469=_['merge'](_0x33f469,require('../api/mailServerIn/mailServerIn.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0xe')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0xf')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x10')));_0x33f469=_['merge'](_0x33f469,require('../api/mailMessage/mailMessage.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x11')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x12')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x13')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x14')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x15')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x16')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x17')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x18')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x19')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x1a')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/smsMessage/smsMessage.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/smsQueue/smsQueue.rpc'));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x1b')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x1c')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x1d')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x1e')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x1f')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x20')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x21')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x22')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x23')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x24')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x25')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/interval/interval.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x26')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/sound/sound.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x27')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x28')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/variable/variable.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x29')));_0x33f469=_['merge'](_0x33f469,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x2a')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x2b')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x2c')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x2d')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x2e')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x2f')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x30')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x31')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x32')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x33')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x34')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/squareOdbc/squareOdbc.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x35')));_0x33f469=_['merge'](_0x33f469,require(_0xd8b5('0x36')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x37')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x38')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/attachment/attachment.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x39')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x3a')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x3b')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x3c')));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x33f469=_[_0xd8b5('0x4')](_0x33f469,require(_0xd8b5('0x3d')));var _0x1d2afd=jayson['server'](_0x33f469)[_0xd8b5('0x3e')]();var _0xcdbe9c=config[_0xd8b5('0x3f')][_0xd8b5('0x40')]||config[_0xd8b5('0x40')]+0x1;var _0x56f638=config['rpc']['ip']||_0xd8b5('0x41');_0x1d2afd['on']('error',function(_0x3ffec6){return _0x1866a3(_0x3ffec6);});_0x1d2afd[_0xd8b5('0x3')](_0xcdbe9c,_0x56f638,function(){console[_0xd8b5('0x42')](_0xd8b5('0x43'),_0x56f638,_0xcdbe9c);require(_0xd8b5('0x44'))[_0xd8b5('0x45')]();return _0x23a075(_0xd8b5('0x46')+_0x56f638+':'+_0xcdbe9c);});});}; \ No newline at end of file +var _0x78ce=['../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.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/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x286075,_0x125044){var _0x4a3727=function(_0x4f709e){while(--_0x4f709e){_0x286075['push'](_0x286075['shift']());}};_0x4a3727(++_0x125044);}(_0x78ce,0x11a));var _0xe78c=function(_0x3a6922,_0xc728be){_0x3a6922=_0x3a6922-0x0;var _0x9c1b44=_0x78ce[_0x3a6922];return _0x9c1b44;};'use strict';var jayson=require(_0xe78c('0x0'));var BPromise=require(_0xe78c('0x1'));var _=require(_0xe78c('0x2'));var config=require(_0xe78c('0x3'));exports[_0xe78c('0x4')]=function(){return new BPromise(function(_0xcbf202,_0x6b8a16){var _0x1284f0={};_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x6')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x7')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x8')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x9')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0xa')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0xb')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0xc')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0xd')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0xe')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0xf')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x10')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x11')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x12')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x13')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x14')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x15')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/mailMessage/mailMessage.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x16')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x17')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x18')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x19')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x1a')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x1b')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/faxQueue/faxQueue.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x1c')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x1d')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x1e')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x1f')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x20')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x21')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x22')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x23')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x24')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/chatInteraction/chatInteraction.rpc'));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x25')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/chatQueue/chatQueue.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/cmContact/cmContact.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x26')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x27')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x28')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x29')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x2a')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x2b')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x2c')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x2d')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x2e')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x2f')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x30')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x31')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x32')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x33')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x34')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x35')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x36')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x37')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x38')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x39')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x3a')));_0x1284f0=_['merge'](_0x1284f0,require(_0xe78c('0x3b')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x3c')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x3d')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/squareRecording/squareRecording.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x3e')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x3f')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x40')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/plugin/plugin.rpc'));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x41')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x42')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x43')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require(_0xe78c('0x44')));_0x1284f0=_[_0xe78c('0x5')](_0x1284f0,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x17b277=jayson['server'](_0x1284f0)[_0xe78c('0x45')]();var _0x9b1608=config[_0xe78c('0x46')][_0xe78c('0x47')]||config['port']+0x1;var _0x599771=config[_0xe78c('0x46')]['ip']||_0xe78c('0x48');_0x17b277['on'](_0xe78c('0x49'),function(_0x2d1bcf){return _0x6b8a16(_0x2d1bcf);});_0x17b277[_0xe78c('0x4')](_0x9b1608,_0x599771,function(){console[_0xe78c('0x4a')](_0xe78c('0x4b'),_0x599771,_0x9b1608);require(_0xe78c('0x4c'))[_0xe78c('0x4d')]();return _0xcbf202('RPC\x20listening\x20on\x20'+_0x599771+':'+_0x9b1608);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4a83b96..264ae9f 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 _0xa428=['sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','label','exports','util','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','prototype','sendRequest'];(function(_0x203b5c,_0x2384f1){var _0x20a057=function(_0x511230){while(--_0x511230){_0x203b5c['push'](_0x203b5c['shift']());}};_0x20a057(++_0x2384f1);}(_0xa428,0x7a));var _0x8a42=function(_0x22c515,_0x51c3ab){_0x22c515=_0x22c515-0x0;var _0x26ef77=_0xa428[_0x22c515];return _0x26ef77;};'use strict';var util=require(_0x8a42('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x8a42('0x1')];var AGIReply=require(_0x8a42('0x2'));var AGIError=require(_0x8a42('0x3'));function AGIChannel(_0x1b07a2){var _0x1fd61d=this,_0x58ccbd=new AGIReply(),_0x284c75=![],_0xb02e6b={};EventEmitter[_0x8a42('0x4')](_0x1fd61d);_0x1b07a2[_0x8a42('0x5')](_0x8a42('0x6'));_0x1b07a2[_0x8a42('0x7')](0x8*0x3c*0x3c*0x3e8);_0x58ccbd[_0x8a42('0x5')](_0x8a42('0x6'));_0x58ccbd['on']('headers',function(_0x3dc3f2){for(var _0x2cfb12 in _0x3dc3f2){_0x1fd61d[_0x2cfb12]=_0x3dc3f2[_0x2cfb12];}_0x1fd61d[_0x8a42('0x8')](_0x8a42('0x9'));});_0x58ccbd['on'](_0x8a42('0xa'),function(_0x24b97d){if(_0x24b97d[_0x8a42('0xb')]()==_0x8a42('0xc')){_0x1fd61d[_0x8a42('0x8')]('hangup');return;}if(_0x24b97d['substring'](0x0,0xb)==_0x8a42('0xd')){_0x284c75=!![];}if(_0x284c75){_0xb02e6b['rx']+=_0x24b97d+'\x0a';if(_0x24b97d[_0x8a42('0xe')](_0x8a42('0xf'))!=-0x1){_0x284c75=![];}}else{_0xb02e6b['rx']=_0x24b97d;}if(_0x284c75){return;}if(typeof _0xb02e6b['cb']=='function'){var _0x5c16c9=_0xb02e6b['rx'][_0x8a42('0x10')](0x0,0x3),_0x56aee8=null,_0x1f2181=null;_0x5c16c9=parseInt(_0x5c16c9);if(isNaN(_0x5c16c9)){_0xb02e6b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5c16c9!=0xc8){_0xb02e6b['cb'](null,{'code':_0x5c16c9,'result':-0x1,'extra':'KO'});return;}_0x56aee8=_0xb02e6b['rx'][_0x8a42('0x10')](0x4)[_0x8a42('0x11')]('result=','');if(_0x56aee8[_0x8a42('0x12')]('\x20')!=-0x1){_0x56aee8=_0x56aee8[_0x8a42('0x13')](0x0,_0x56aee8['indexOf']('\x20'));}if(_[_0x8a42('0x14')](_0x56aee8,'-1')){_0x56aee8=parseInt(_0x56aee8);}_0x1f2181=_0xb02e6b['rx'][_0x8a42('0x15')]('\x20');if(_0x1f2181[_0x8a42('0x16')]==0x3){_0x1f2181=_0x1f2181[0x2][_0x8a42('0x10')](0x1,_0x1f2181[0x2][_0x8a42('0x16')]-0x1);}else if(_0x1f2181['length']>0x3){var _0x282a7c=/\((.+)\)/;var _0x33a972=_0xb02e6b['rx'][_0x8a42('0x17')](_0x282a7c);if(_0x33a972){_0x1f2181=_0x33a972[0x1];}else{_0x1f2181=null;}}else{_0x1f2181=null;}_0xb02e6b['cb'](null,{'code':_0x5c16c9,'result':_0x56aee8,'extra':_0x1f2181});}});_0x1b07a2['on'](_0x8a42('0x18'),function(_0xb86c3b){_0x1fd61d[_0x8a42('0x8')](_0x8a42('0x18'),new AGIError(_0x8a42('0x19'),_0xb86c3b[_0x8a42('0x1a')]));});_0x1b07a2['on'](_0x8a42('0x1b'),function(){_0x1fd61d[_0x8a42('0x8')](_0x8a42('0x1b'),new AGIError(_0x8a42('0x1c')));});_0x1b07a2['on']('timeout',function(){_0x1fd61d[_0x8a42('0x8')](_0x8a42('0x1d'),new AGIError(_0x8a42('0x1e')));_0x1b07a2[_0x8a42('0x1f')]();});_0x1b07a2['pipe'](_0x58ccbd);this[_0x8a42('0x20')]=function(_0x13f118,_0x4b1e94){var _0x13f118=_0x13f118||'',_0x4b1e94=typeof _0x4b1e94==_0x8a42('0x21')?_0x4b1e94:new Function();_0xb02e6b={'tx':_0x13f118,'rx':'','cb':_0x4b1e94};_0x1b07a2[_0x8a42('0x22')](_0x13f118+'\x0a');},this[_0x8a42('0x1b')]=function(){_0x1b07a2[_0x8a42('0x1f')]();};}util[_0x8a42('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x8a42('0x24')][_0x8a42('0x25')]=function(_0x43a3f9){return this[_0x8a42('0x20')][_0x8a42('0x26')](this,_0x43a3f9);};AGIChannel[_0x8a42('0x24')][_0x8a42('0x27')]=function(){return this[_0x8a42('0x25')](_0x8a42('0x28'));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x29')]=function(_0x1135b5,_0x21bca0,_0x4c5f25){_0x1135b5=_0x1135b5===undefined?_0x8a42('0x2a'):_0x1135b5;_0x21bca0=_0x21bca0===undefined?'5':_0x21bca0;_0x4c5f25=_0x4c5f25===undefined?'1':_0x4c5f25;return this['sendRequest'](util['format'](_0x8a42('0x2b'),_0x1135b5,_0x21bca0*0x3e8,_0x4c5f25));};AGIChannel[_0x8a42('0x24')]['noop']=function(_0x5efbfa){_0x5efbfa=_0x5efbfa||_0x8a42('0x2c');return this[_0x8a42('0x25')](util[_0x8a42('0x2d')](_0x8a42('0x2e'),_0x5efbfa));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x2f')]=function(_0x57a3ec,_0x118d93){if(_[_0x8a42('0x30')](_0x118d93)){return this[_0x8a42('0x25')](util[_0x8a42('0x2d')](_0x8a42('0x31'),_0x57a3ec,_0x118d93[_0x8a42('0x32')](',')));}return this['sendRequest'](util[_0x8a42('0x2d')](_0x8a42('0x31'),_0x57a3ec,_0x118d93));};AGIChannel['prototype'][_0x8a42('0x33')]=function(_0x128f0b){return this['sendRequest'](util['format'](_0x8a42('0x34'),_0x128f0b));};AGIChannel['prototype'][_0x8a42('0x35')]=function(_0x1dbded){return this[_0x8a42('0x25')](util[_0x8a42('0x2d')](_0x8a42('0x36'),_0x1dbded));};AGIChannel[_0x8a42('0x24')]['setPriority']=function(_0x111f25){return this['sendRequest'](util[_0x8a42('0x2d')](_0x8a42('0x37'),_0x111f25));};AGIChannel['prototype']['hangup']=function(){return this[_0x8a42('0x25')]('HANGUP');};AGIChannel[_0x8a42('0x24')][_0x8a42('0x38')]=function(_0x12a767,_0x23b684){var _0x3e414c=_[_0x8a42('0x39')](_0x23b684)||_[_0x8a42('0x3a')](_0x23b684)?_0x23b684[_0x8a42('0x3b')]():_0x23b684;return this['sendRequest'](util[_0x8a42('0x2d')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x12a767,_0x3e414c?_0x3e414c['toString']()[_0x8a42('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x3c')]=function(_0x357008,_0x539848){return this[_0x8a42('0x25')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x357008,_0x539848));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x3d')]=function(_0x508453,_0x15ed20){return this[_0x8a42('0x25')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x508453,_0x15ed20));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x3e')]=function(_0x3396f5,_0x410ab6){return this['sendRequest'](util['format'](_0x8a42('0x3f'),_0x3396f5,_0x410ab6));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x40')]=function(_0x4ba152,_0x47f862,_0x28d8c9){_0x47f862=_0x47f862||this[_0x8a42('0x41')];_0x28d8c9=_0x28d8c9||0x1;this['setContext'](_0x4ba152);this[_0x8a42('0x35')](_0x47f862);this[_0x8a42('0x42')](_0x28d8c9);return this[_0x8a42('0x43')](util[_0x8a42('0x2d')](_0x8a42('0x44'),_0x4ba152,_0x47f862,_0x28d8c9));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x45')]=function(_0x44d058){return this[_0x8a42('0x25')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x44d058));};AGIChannel['prototype'][_0x8a42('0x46')]=function(_0xc4a11f,_0x35bd92,_0x5357c7,_0x16f34f,_0x550964,_0x4dcb5e){_0x35bd92=_0x35bd92||'wav';_0x5357c7=_0x5357c7||'';_0x16f34f=_0x16f34f===undefined?-0x1:_0x16f34f==='-1'?-0x1:_0x16f34f*0x3e8;_0x550964=_0x550964===undefined?'':'s='+_0x550964;_0x4dcb5e=_0x4dcb5e?_0x8a42('0x47'):'';return this['sendRequest'](util[_0x8a42('0x2d')](_0x8a42('0x48'),_0xc4a11f,_0x35bd92,_0x5357c7,_0x16f34f,_0x4dcb5e,_0x550964));};AGIChannel[_0x8a42('0x24')][_0x8a42('0x49')]=function(_0x42a413,_0x41afe4){_0x41afe4=_0x41afe4||'';return this[_0x8a42('0x25')](util[_0x8a42('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x42a413,_0x41afe4));};AGIChannel['prototype'][_0x8a42('0x4a')]=function(_0x5a6183){return this[_0x8a42('0x2f')](_0x8a42('0x4b'),_0x5a6183);};AGIChannel['prototype'][_0x8a42('0x4c')]=function(_0x501c14){return this[_0x8a42('0x2f')](_0x8a42('0x4d'),_0x501c14);};AGIChannel['prototype'][_0x8a42('0x18')]=function(_0x268192,_0x3961d3){this[_0x8a42('0x43')](util[_0x8a42('0x2d')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x268192['id'],_0x268192[_0x8a42('0x4e')],_0x3961d3));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8a42('0x4f')]=AGIChannel; \ No newline at end of file +var _0xaf97=['prototype','sendRequest','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','function','replace','result=','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy'];(function(_0x53aef4,_0x3de35d){var _0x23cbdd=function(_0x533540){while(--_0x533540){_0x53aef4['push'](_0x53aef4['shift']());}};_0x23cbdd(++_0x3de35d);}(_0xaf97,0x15a));var _0x7af9=function(_0x1ed8e1,_0x141b6b){_0x1ed8e1=_0x1ed8e1-0x0;var _0x551333=_0xaf97[_0x1ed8e1];return _0x551333;};'use strict';var util=require(_0x7af9('0x0'));var _=require(_0x7af9('0x1'));var EventEmitter=require(_0x7af9('0x2'))[_0x7af9('0x3')];var AGIReply=require(_0x7af9('0x4'));var AGIError=require('./error');function AGIChannel(_0xae7560){var _0x1d6e9f=this,_0x3fd76e=new AGIReply(),_0x1dce1d=![],_0x540a77={};EventEmitter[_0x7af9('0x5')](_0x1d6e9f);_0xae7560[_0x7af9('0x6')](_0x7af9('0x7'));_0xae7560[_0x7af9('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3fd76e['setEncoding'](_0x7af9('0x7'));_0x3fd76e['on'](_0x7af9('0x9'),function(_0x2963b7){for(var _0x4220ff in _0x2963b7){_0x1d6e9f[_0x4220ff]=_0x2963b7[_0x4220ff];}_0x1d6e9f[_0x7af9('0xa')](_0x7af9('0xb'));});_0x3fd76e['on']('line',function(_0x560371){if(_0x560371[_0x7af9('0xc')]()==_0x7af9('0xd')){_0x1d6e9f[_0x7af9('0xa')]('hangup');return;}if(_0x560371[_0x7af9('0xe')](0x0,0xb)==_0x7af9('0xf')){_0x1dce1d=!![];}if(_0x1dce1d){_0x540a77['rx']+=_0x560371+'\x0a';if(_0x560371[_0x7af9('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x1dce1d=![];}}else{_0x540a77['rx']=_0x560371;}if(_0x1dce1d){return;}if(typeof _0x540a77['cb']==_0x7af9('0x11')){var _0x14f0d2=_0x540a77['rx'][_0x7af9('0xe')](0x0,0x3),_0x19fe25=null,_0x2d8c07=null;_0x14f0d2=parseInt(_0x14f0d2);if(isNaN(_0x14f0d2)){_0x540a77['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x14f0d2!=0xc8){_0x540a77['cb'](null,{'code':_0x14f0d2,'result':-0x1,'extra':'KO'});return;}_0x19fe25=_0x540a77['rx'][_0x7af9('0xe')](0x4)[_0x7af9('0x12')](_0x7af9('0x13'),'');if(_0x19fe25[_0x7af9('0x14')]('\x20')!=-0x1){_0x19fe25=_0x19fe25['substr'](0x0,_0x19fe25[_0x7af9('0x14')]('\x20'));}if(_[_0x7af9('0x15')](_0x19fe25,'-1')){_0x19fe25=parseInt(_0x19fe25);}_0x2d8c07=_0x540a77['rx'][_0x7af9('0x16')]('\x20');if(_0x2d8c07[_0x7af9('0x17')]==0x3){_0x2d8c07=_0x2d8c07[0x2][_0x7af9('0xe')](0x1,_0x2d8c07[0x2][_0x7af9('0x17')]-0x1);}else if(_0x2d8c07[_0x7af9('0x17')]>0x3){var _0x238814=/\((.+)\)/;var _0x5a5e14=_0x540a77['rx']['match'](_0x238814);if(_0x5a5e14){_0x2d8c07=_0x5a5e14[0x1];}else{_0x2d8c07=null;}}else{_0x2d8c07=null;}_0x540a77['cb'](null,{'code':_0x14f0d2,'result':_0x19fe25,'extra':_0x2d8c07});}});_0xae7560['on'](_0x7af9('0x18'),function(_0x383d4a){_0x1d6e9f[_0x7af9('0xa')](_0x7af9('0x18'),new AGIError(_0x7af9('0x19'),_0x383d4a[_0x7af9('0x1a')]));});_0xae7560['on'](_0x7af9('0x1b'),function(){_0x1d6e9f[_0x7af9('0xa')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0xae7560['on'](_0x7af9('0x1c'),function(){_0x1d6e9f[_0x7af9('0xa')](_0x7af9('0x1c'),new AGIError(_0x7af9('0x1d')));_0xae7560['destroy']();});_0xae7560[_0x7af9('0x1e')](_0x3fd76e);this[_0x7af9('0x1f')]=function(_0x2a2a17,_0x552f25){var _0x2a2a17=_0x2a2a17||'',_0x552f25=typeof _0x552f25=='function'?_0x552f25:new Function();_0x540a77={'tx':_0x2a2a17,'rx':'','cb':_0x552f25};_0xae7560[_0x7af9('0x20')](_0x2a2a17+'\x0a');},this['close']=function(){_0xae7560[_0x7af9('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x7af9('0x22')][_0x7af9('0x23')]=function(_0x341a54){return this[_0x7af9('0x1f')]['sync'](this,_0x341a54);};AGIChannel[_0x7af9('0x22')][_0x7af9('0x24')]=function(){return this[_0x7af9('0x23')](_0x7af9('0x25'));};AGIChannel['prototype'][_0x7af9('0x26')]=function(_0x256b47,_0x1ac268,_0x1609f7){_0x256b47=_0x256b47===undefined?'beep':_0x256b47;_0x1ac268=_0x1ac268===undefined?'5':_0x1ac268;_0x1609f7=_0x1609f7===undefined?'1':_0x1609f7;return this[_0x7af9('0x23')](util[_0x7af9('0x27')](_0x7af9('0x28'),_0x256b47,_0x1ac268*0x3e8,_0x1609f7));};AGIChannel['prototype'][_0x7af9('0x29')]=function(_0x26a1d9){_0x26a1d9=_0x26a1d9||_0x7af9('0x2a');return this[_0x7af9('0x23')](util[_0x7af9('0x27')](_0x7af9('0x2b'),_0x26a1d9));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x2c')]=function(_0x3d728b,_0x139587){if(_[_0x7af9('0x2d')](_0x139587)){return this[_0x7af9('0x23')](util['format'](_0x7af9('0x2e'),_0x3d728b,_0x139587[_0x7af9('0x2f')](',')));}return this[_0x7af9('0x23')](util[_0x7af9('0x27')]('EXEC\x20%s\x20%s',_0x3d728b,_0x139587));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x30')]=function(_0x18d391){return this['sendRequest'](util['format'](_0x7af9('0x31'),_0x18d391));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x32')]=function(_0x2eb902){return this[_0x7af9('0x23')](util[_0x7af9('0x27')](_0x7af9('0x33'),_0x2eb902));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x34')]=function(_0x23e32f){return this[_0x7af9('0x23')](util['format'](_0x7af9('0x35'),_0x23e32f));};AGIChannel[_0x7af9('0x22')]['hangup']=function(){return this[_0x7af9('0x23')](_0x7af9('0x36'));};AGIChannel[_0x7af9('0x22')]['setVariable']=function(_0x129f40,_0x1c9e89){var _0x397520=_[_0x7af9('0x37')](_0x1c9e89)||_['isNumber'](_0x1c9e89)?_0x1c9e89[_0x7af9('0x38')]():_0x1c9e89;return this[_0x7af9('0x23')](util[_0x7af9('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x129f40,_0x397520?_0x397520['toString']()[_0x7af9('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x39')]=function(_0x11f944,_0x47ca4b){return this[_0x7af9('0x23')](util[_0x7af9('0x27')](_0x7af9('0x3a'),_0x11f944,_0x47ca4b));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x3b')]=function(_0x4c7b4f,_0x3304d0){return this[_0x7af9('0x23')](util['format'](_0x7af9('0x3c'),_0x4c7b4f,_0x3304d0));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x3d')]=function(_0x373af1,_0x5cc806){return this[_0x7af9('0x23')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x373af1,_0x5cc806));};AGIChannel['prototype'][_0x7af9('0x3e')]=function(_0x271e74,_0x48330b,_0x4cffc8){_0x48330b=_0x48330b||this[_0x7af9('0x3f')];_0x4cffc8=_0x4cffc8||0x1;this[_0x7af9('0x30')](_0x271e74);this[_0x7af9('0x32')](_0x48330b);this[_0x7af9('0x34')](_0x4cffc8);return this['noop'](util[_0x7af9('0x27')]('GOTO\x20%s\x20%s\x20%s',_0x271e74,_0x48330b,_0x4cffc8));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x40')]=function(_0x12f4f5){return this[_0x7af9('0x23')](util[_0x7af9('0x27')](_0x7af9('0x41'),_0x12f4f5));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x42')]=function(_0x5e37d0,_0x486978,_0x5c6a44,_0x49f421,_0x318e17,_0x42556c){_0x486978=_0x486978||'wav';_0x5c6a44=_0x5c6a44||'';_0x49f421=_0x49f421===undefined?-0x1:_0x49f421==='-1'?-0x1:_0x49f421*0x3e8;_0x318e17=_0x318e17===undefined?'':'s='+_0x318e17;_0x42556c=_0x42556c?_0x7af9('0x43'):'';return this['sendRequest'](util[_0x7af9('0x27')](_0x7af9('0x44'),_0x5e37d0,_0x486978,_0x5c6a44,_0x49f421,_0x42556c,_0x318e17));};AGIChannel['prototype']['streamFile']=function(_0x209b50,_0x4d0a4e){_0x4d0a4e=_0x4d0a4e||'';return this[_0x7af9('0x23')](util[_0x7af9('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x209b50,_0x4d0a4e));};AGIChannel[_0x7af9('0x22')][_0x7af9('0x45')]=function(_0x233c3e){return this['exec'](_0x7af9('0x46'),_0x233c3e);};AGIChannel['prototype'][_0x7af9('0x47')]=function(_0x5bf78c){return this[_0x7af9('0x2c')](_0x7af9('0x48'),_0x5bf78c);};AGIChannel[_0x7af9('0x22')][_0x7af9('0x18')]=function(_0x582920,_0x28f72b){this[_0x7af9('0x29')](util['format'](_0x7af9('0x49'),_0x582920['id'],_0x582920[_0x7af9('0x4a')],_0x28f72b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7af9('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 71b8d97..ec07fa4 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 _0x9e35=['Undefined\x20error.','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.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','name','util'];(function(_0x27b132,_0x1d8178){var _0x46d7d6=function(_0x3ecddf){while(--_0x3ecddf){_0x27b132['push'](_0x27b132['shift']());}};_0x46d7d6(++_0x1d8178);}(_0x9e35,0x14f));var _0x59e3=function(_0x261fab,_0x2b5349){_0x261fab=_0x261fab-0x0;var _0x29d4ed=_0x9e35[_0x261fab];return _0x29d4ed;};'use strict';var util=require(_0x59e3('0x0'));var error={'E_AGI_UNDEFINED':_0x59e3('0x1'),'E_AGI_ARGUMENT_PORT':_0x59e3('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x59e3('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x59e3('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x59e3('0x5'),'E_AGI_SOCKET_ERROR':_0x59e3('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x59e3('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x59e3('0x8'),'E_AGI_IVR_ENTRY':_0x59e3('0x9')};function AGIError(_0x4dc1e5){var _0x4dc1e5=_0x4dc1e5||null,_0x340af6=_0x340af6||[],_0x2d44cf=0x1,_0x53682d='';if(!error[_0x4dc1e5]){_0x4dc1e5='E_AGI_UNDEFINED';}_0x340af6[_0x59e3('0xa')](error[_0x4dc1e5]);while(arguments[_0x2d44cf]){_0x340af6['push'](arguments[_0x2d44cf]);_0x2d44cf++;}_0x53682d=util['format'][_0x59e3('0xb')](util,_0x340af6);this[_0x59e3('0xc')]=_0x53682d;this[_0x59e3('0xd')]=_0x4dc1e5;}module['exports']=AGIError; \ No newline at end of file +var _0x3eff=['E_AGI_UNDEFINED','push','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3f0050,_0x4ac7bb){var _0x101c9d=function(_0x5c3a4e){while(--_0x5c3a4e){_0x3f0050['push'](_0x3f0050['shift']());}};_0x101c9d(++_0x4ac7bb);}(_0x3eff,0x1b5));var _0xf3ef=function(_0x427cce,_0x718314){_0x427cce=_0x427cce-0x0;var _0x283078=_0x3eff[_0x427cce];return _0x283078;};'use strict';var util=require(_0xf3ef('0x0'));var error={'E_AGI_UNDEFINED':_0xf3ef('0x1'),'E_AGI_ARGUMENT_PORT':_0xf3ef('0x2'),'E_AGI_SERVER_ERROR':_0xf3ef('0x3'),'E_AGI_SERVER_CLOSE':_0xf3ef('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xf3ef('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xf3ef('0x6'),'E_AGI_SOCKET_ERROR':_0xf3ef('0x7'),'E_AGI_SOCKET_CLOSE':_0xf3ef('0x8'),'E_AGI_SOCKET_TIMEOUT':_0xf3ef('0x9'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xf3ef('0xa')};function AGIError(_0x8703e8){var _0x8703e8=_0x8703e8||null,_0x6b682e=_0x6b682e||[],_0x3f565a=0x1,_0x55caeb='';if(!error[_0x8703e8]){_0x8703e8=_0xf3ef('0xb');}_0x6b682e['push'](error[_0x8703e8]);while(arguments[_0x3f565a]){_0x6b682e[_0xf3ef('0xc')](arguments[_0x3f565a]);_0x3f565a++;}_0x55caeb=util['format'][_0xf3ef('0xd')](util,_0x6b682e);this[_0xf3ef('0xe')]=_0x55caeb;this['name']=_0x8703e8;}module[_0xf3ef('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 0e5a83f..9893cc6 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 _0x8c3f=['no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations','getVertex','traverseBFS','info'];(function(_0x3a019c,_0x3eaf02){var _0xeeb4f9=function(_0xfc66c5){while(--_0xfc66c5){_0x3a019c['push'](_0x3a019c['shift']());}};_0xeeb4f9(++_0x3eaf02);}(_0x8c3f,0xd9));var _0xf8c3=function(_0x1614a4,_0x473b94){_0x1614a4=_0x1614a4-0x0;var _0x3f4880=_0x8c3f[_0x1614a4];return _0x3f4880;};'use strict';var _=require(_0xf8c3('0x0'));var logger=require(_0xf8c3('0x1'))(_0xf8c3('0x2'));var verticesWithRetry=['menu','getdigits',_0xf8c3('0x3')];var Graph=function(){this[_0xf8c3('0x4')]={};this[_0xf8c3('0x5')]={};this[_0xf8c3('0x6')]=0x0;};Graph[_0xf8c3('0x7')][_0xf8c3('0x8')]=function(_0x3aa598){this[_0xf8c3('0x4')][_0x3aa598['id']]=_0x3aa598;this[_0xf8c3('0x5')][_0x3aa598['id']]=[];};Graph['prototype']['addEdge']=function(_0x3b1a96,_0x318eba,_0x61df1d){this['edges'][_0x3b1a96][_0xf8c3('0x9')]({'target':_0x318eba,'condition':_0x61df1d});this[_0xf8c3('0x6')]+=0x1;};Graph['prototype'][_0xf8c3('0xa')]=function(){return _[_0xf8c3('0xa')](this[_0xf8c3('0x4')]);};Graph[_0xf8c3('0x7')][_0xf8c3('0xb')]=function(){return this['numberOfEdges'];};Graph[_0xf8c3('0x7')][_0xf8c3('0xc')]=function(_0x30317b){return this[_0xf8c3('0x4')][_0x30317b];};Graph[_0xf8c3('0x7')][_0xf8c3('0xd')]=function(_0x991121,_0x194445){if(!this['vertices'][_0x991121]){return logger[_0xf8c3('0xe')](_0xf8c3('0xf'));}var _0x10399c=_0x194445(this[_0xf8c3('0x4')][_0x991121]);if(!_0x10399c){return logger[_0xf8c3('0xe')]('stop\x20traverse');}if(this[_0xf8c3('0x5')][_0x991121][_0xf8c3('0x10')]===0x0){return logger[_0xf8c3('0xe')](_0xf8c3('0x11'));}for(var _0x149081=0x0,_0x39fb93=[],_0xb14986=![];_0x149081\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','close','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','format','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','target','addEdge','source','value','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','debug','stringify','timeout','hangup','sync','production','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','start','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found'];(function(_0x2e0bf0,_0x210215){var _0x249589=function(_0x283d88){while(--_0x283d88){_0x2e0bf0['push'](_0x2e0bf0['shift']());}};_0x249589(++_0x210215);}(_0xcf1a,0x1f2));var _0xacf1=function(_0x41d9e7,_0x33ef4a){_0x41d9e7=_0x41d9e7-0x0;var _0x282c36=_0xcf1a[_0x41d9e7];return _0x282c36;};'use strict';var parser=require(_0xacf1('0x0'));var _=require(_0xacf1('0x1'));var syncho=require(_0xacf1('0x2'));var util=require(_0xacf1('0x3'));var moment=require(_0xacf1('0x4'));var config=require(_0xacf1('0x5'));var logger=require(_0xacf1('0x6'))(_0xacf1('0x7'));var utilLicense=require(_0xacf1('0x8'));var rpc=require(_0xacf1('0x9'));var mailRpc=require(_0xacf1('0xa'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xacf1('0x7')]=_[_0xacf1('0xb')](config['agi'],{'ip':_0xacf1('0xc'),'port':0x11dd});function connectionHandler(_0x2624f8){process[_0xacf1('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2624f8);agiHandler(_0x2624f8);}catch(_0xc2b731){logger[_0xacf1('0xe')](_0xc2b731[_0xacf1('0xf')]);}});});}function listeningHandler(){console[_0xacf1('0x10')](_0xacf1('0x11'),config[_0xacf1('0x7')][_0xacf1('0x12')]);logger[_0xacf1('0x13')](util['format'](_0xacf1('0x14'),config[_0xacf1('0x7')]['ip'],config[_0xacf1('0x7')][_0xacf1('0x12')]));}function errorHandler(_0x13beab){if(_0x13beab&&_0x13beab['name']&&_0x13beab[_0xacf1('0x15')]){logger[_0xacf1('0xe')](util[_0xacf1('0x16')]('[%s]\x20%s',_0x13beab[_0xacf1('0x17')],_0x13beab['message']));}else{logger[_0xacf1('0xe')](util[_0xacf1('0x16')](_0xacf1('0x18'),_0x13beab[_0xacf1('0xf')]));}}function closeHandler(){logger[_0xacf1('0x13')](util[_0xacf1('0x16')](_0xacf1('0x19'),this['arg_1'],this[_0xacf1('0x1a')],this[_0xacf1('0x1b')],this['dnid'],this[_0xacf1('0x1c')]));try{createSquareReport(this);}catch(_0x44dc0c){logger[_0xacf1('0xe')](_0x44dc0c['stack']);}}function timeoutHandler(){logger[_0xacf1('0x13')](util['format'](_0xacf1('0x1d'),this[_0xacf1('0x1e')],this[_0xacf1('0x1a')],this[_0xacf1('0x1b')],this[_0xacf1('0x1f')],this[_0xacf1('0x1c')]));}function hangupHandler(){logger[_0xacf1('0x13')](util[_0xacf1('0x16')](_0xacf1('0x20'),this[_0xacf1('0x1e')],this['calleridname'],this[_0xacf1('0x1b')],this['dnid'],this[_0xacf1('0x1c')]));this[_0xacf1('0x21')]=!![];}function getRoot(_0x2fe87e){return parser[_0xacf1('0x22')](_0x2fe87e,{'object':!![]})[_0xacf1('0x23')][_0xacf1('0x24')];}function addVertex(_0x3f78fe,_0x1f859b,_0x35a4b3){_0x1f859b[_0xacf1('0x25')]=_0x35a4b3;if(_0x1f859b['hasOwnProperty'](_0xacf1('0x26'))){_0x1f859b[_0xacf1('0x27')]=parseInt(_0x1f859b[_0xacf1('0x26')],0xa);}_0x3f78fe[_0xacf1('0x28')](_[_0xacf1('0x29')](_0x1f859b,_0xacf1('0x2a')));}function initGraph(_0x28bc48,_0x55b406){var _0x4b7597=new Graph();for(var _0x28c846 in _0x28bc48){if(_0x28bc48[_0xacf1('0x2b')](_0x28c846)){if(_[_0xacf1('0x2c')](_0x28bc48[_0x28c846])){for(var _0x464c3b=0x0;_0x464c3b<_0x28bc48[_0x28c846][_0xacf1('0x2d')];_0x464c3b+=0x1){addVertex(_0x4b7597,_0x28bc48[_0x28c846][_0x464c3b],_0x28c846);}}else{addVertex(_0x4b7597,_0x28bc48[_0x28c846],_0x28c846);}}}for(var _0x545e11=0x0;_0x545e11<_0x55b406[_0xacf1('0x2d')];_0x545e11+=0x1){if(_0x55b406[_0x545e11]['source']&&_0x55b406[_0x545e11][_0xacf1('0x2e')]){_0x4b7597[_0xacf1('0x2f')](_0x55b406[_0x545e11][_0xacf1('0x30')],_0x55b406[_0x545e11][_0xacf1('0x2e')],_0x55b406[_0x545e11][_0xacf1('0x31')]);}}return _0x4b7597;}function getSquareProject(_0x267f5a,_0x13fe07){rpc[_0xacf1('0x32')](_0x267f5a)['then'](function(_0x1fe46b){_0x13fe07(null,_0x1fe46b);})[_0xacf1('0x33')](function(_0x19e334){_0x13fe07(null,_0x19e334);});}function createSquareReport(_0x9f1b37,_0x44243d){rpc[_0xacf1('0x34')](_0x9f1b37)[_0xacf1('0x35')](function(_0x2296ce){if(_0x44243d){_0x44243d(null,_0x2296ce);}})['catch'](function(_0xc164a9){if(_0x44243d){_0x44243d(null,_0xc164a9);}});}function setChannelVariables(_0xe8b61c){for(var _0x530667 in _0xe8b61c){if(_0xe8b61c[_0xacf1('0x2b')](_0x530667)){if(_0x530667[_0xacf1('0x36')](_0xacf1('0x37'))===0x0){_0xe8b61c[_0x530667[_0xacf1('0x38')](0x4)]=_0xe8b61c[_0x530667];delete _0xe8b61c[_0x530667];}}}}function getLogFromObject(_0x64a46f){return util['inspect'](_0x64a46f,{'showHidden':![],'depth':null});}function agiHandler(_0x253c75){var _0x2123da,_0x5b4694,_0x3a8c8f,_0xd2c0d8,_0x7269e6;logger[_0xacf1('0x39')]('variables',JSON[_0xacf1('0x3a')](_0x253c75,null,0x2));logger['info'](util[_0xacf1('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x253c75['arg_1'],_0x253c75['calleridname'],_0x253c75[_0xacf1('0x1b')],_0x253c75[_0xacf1('0x1f')],_0x253c75[_0xacf1('0x1c')]));_0x253c75['on']('error',errorHandler);_0x253c75['on']('close',closeHandler);_0x253c75['on'](_0xacf1('0x3b'),timeoutHandler);_0x253c75[_0xacf1('0x21')]=![];_0x253c75['on'](_0xacf1('0x3c'),hangupHandler);var _0x4bce69=getSquareProject[_0xacf1('0x3d')](null,_0x253c75[_0xacf1('0x1e')]);if(_0x4bce69){if(_0x4bce69[_0xacf1('0x3e')]){_0x2123da=getRoot(_0x4bce69[_0xacf1('0x3e')]);if(_0x2123da&&_0x2123da['start']){logger[_0xacf1('0x39')](_0xacf1('0x24'),JSON['stringify'](_0x2123da,null,0x2));_0x253c75[_0xacf1('0x3f')]=moment()[_0xacf1('0x16')](_0xacf1('0x40'));_0x5b4694=initGraph(_[_0xacf1('0x29')](_0x2123da,'mxCell'),_0x2123da[_0xacf1('0x2a')]);_0x3a8c8f=new Vertices(_0x253c75,rpc,mailRpc);logger['info'](util['format'](_0xacf1('0x41'),_0x253c75[_0xacf1('0x1e')],_0x253c75[_0xacf1('0x1a')],_0x253c75[_0xacf1('0x1b')],_0x253c75['dnid'],_0x253c75[_0xacf1('0x1c')]));_0x5b4694['traverseBFS'](_0x2123da[_0xacf1('0x42')]['id'],function(_0x2b131c){try{_0x2b131c=_0x3a8c8f['clear'](_0x2b131c);logger[_0xacf1('0x39')](_0xacf1('0x43'),JSON[_0xacf1('0x3a')](_0x2b131c,null,0x2));if(_0x2b131c[_0xacf1('0x25')]===_0xacf1('0x44')){logger[_0xacf1('0x13')](_0xacf1('0x45'));_0x253c75['context']=_0x2b131c[_0xacf1('0x46')]||_0x253c75[_0xacf1('0x46')];_0x253c75[_0xacf1('0x47')]=_0x2b131c[_0xacf1('0x47')];_0x253c75['priority']=_0x2b131c[_0xacf1('0x48')]?_0x2b131c['priority']-0x1:0x1;return null;}else if(_0x2b131c&&_0x3a8c8f[_0x2b131c['agicommand']]){_0x7269e6=_0x3a8c8f[_0x2b131c[_0xacf1('0x25')]](_0x2b131c);logger[_0xacf1('0x13')](_0xacf1('0x49'),JSON[_0xacf1('0x3a')](_0x7269e6,null,0x2));if(_0x7269e6&&_0x7269e6['code']===AGI_CODE_SUCCESS&&_0x7269e6[_0xacf1('0x4a')]!==AGI_RESULT_ERROR&&!_0x253c75[_0xacf1('0x21')]){logger['debug'](_0xacf1('0x49'),getLogFromObject(_0x7269e6));return _[_0xacf1('0x4b')](_0x7269e6[_0xacf1('0x4a')])?null:_0x7269e6[_0xacf1('0x4a')][_0xacf1('0x4c')]();}else{logger['error'](_0xacf1('0x49'),getLogFromObject(_0x7269e6));return null;}}else{logger[_0xacf1('0xe')](_0xacf1('0x4d'));return null;}}catch(_0x561559){logger[_0xacf1('0xe')](_0x561559['stack']);return null;}});if(_0x2123da[_0xacf1('0x4e')]){logger[_0xacf1('0x13')](util[_0xacf1('0x16')](_0xacf1('0x4f'),_0x253c75[_0xacf1('0x1e')],_0x253c75[_0xacf1('0x1a')],_0x253c75[_0xacf1('0x1b')],_0x253c75[_0xacf1('0x1f')],_0x253c75[_0xacf1('0x1c')]));_0x5b4694[_0xacf1('0x50')](_0x2123da[_0xacf1('0x4e')]['id'],function(_0x547db4){try{_0x547db4=_0x3a8c8f[_0xacf1('0x51')](_0x547db4);logger[_0xacf1('0x39')]('vertex',JSON[_0xacf1('0x3a')](_0x547db4,null,0x2));if(_0x547db4&&_0x3a8c8f[_0x547db4[_0xacf1('0x25')]]){_0x7269e6=_0x3a8c8f[_0x547db4[_0xacf1('0x25')]](_0x547db4);if(_0x7269e6){logger['debug'](_0xacf1('0x49'),getLogFromObject(_0x7269e6));return _['isUndefined'](_0x7269e6[_0xacf1('0x4a')])?null:_0x7269e6['result'][_0xacf1('0x4c')]();}else{logger['error'](_0xacf1('0x49'),getLogFromObject(_0x7269e6));return null;}}else{logger[_0xacf1('0xe')](_0xacf1('0x4d'));return null;}}catch(_0x4b39c3){logger[_0xacf1('0xe')](_0x4b39c3[_0xacf1('0xf')]);return null;}});}logger[_0xacf1('0x13')](util[_0xacf1('0x16')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x253c75[_0xacf1('0x1e')],_0x253c75[_0xacf1('0x1a')],_0x253c75['callerid'],_0x253c75[_0xacf1('0x1f')],_0x253c75[_0xacf1('0x1c')]));logger['info'](util['format'](_0xacf1('0x52'),_0x253c75['context'],_0x253c75[_0xacf1('0x47')],parseInt(_0x253c75[_0xacf1('0x48')],0xa)+0x1));_0x253c75[_0xacf1('0x53')](_0x253c75[_0xacf1('0x46')],_0x253c75[_0xacf1('0x47')],parseInt(_0x253c75[_0xacf1('0x48')],0xa)+0x1);_0x253c75['close']();}}else{logger[_0xacf1('0xe')](util[_0xacf1('0x16')](_0xacf1('0x54'),_0x253c75['arg_1']));_0x253c75[_0xacf1('0x53')](_0x253c75['context'],_0x253c75[_0xacf1('0x47')],parseInt(_0x253c75[_0xacf1('0x48')],0xa)+0x1);_0x253c75[_0xacf1('0x55')]();}}else{logger['error'](util[_0xacf1('0x16')](_0xacf1('0x56'),_0x253c75[_0xacf1('0x1e')]));_0x253c75[_0xacf1('0x53')](_0x253c75[_0xacf1('0x46')],_0x253c75['extension'],parseInt(_0x253c75[_0xacf1('0x48')],0xa)+0x1);_0x253c75[_0xacf1('0x55')]();}}function main(){var _0x4c28aa;return utilLicense['getLicense']()[_0xacf1('0x35')](function(_0x40f90b){if(_0x40f90b){if(_0x40f90b[_0xacf1('0x57')]){if(_0x40f90b[_0xacf1('0x58')]&&_0x40f90b['callysquare']>0x0){logger['info'](util[_0xacf1('0x16')](_0xacf1('0x59'),_0x40f90b[_0xacf1('0x58')]));_0x4c28aa=_0x40f90b[_0xacf1('0x58')];}else{logger[_0xacf1('0x13')](_0xacf1('0x5a'));}}else{logger['info'](_0xacf1('0x5b'));_0x4c28aa=-0x1;}}})['catch'](function(_0xf67913){logger['error'](_0xacf1('0x5c'),_0xf67913[_0xacf1('0xf')]);})[_0xacf1('0x4e')](function(){var _0x2a6284=require(_0xacf1('0x5d'))(config[_0xacf1('0x7')][_0xacf1('0x12')],config[_0xacf1('0x7')]['ip'],_0x4c28aa);_0x2a6284['on'](_0xacf1('0xe'),errorHandler);_0x2a6284['on'](_0xacf1('0x5e'),listeningHandler);_0x2a6284['on'](_0xacf1('0x5f'),connectionHandler);_0x2a6284['on'](_0xacf1('0x55'),closeHandler);});}main(); \ No newline at end of file +var _0x6fd0=['target','addEdge','value','getSquareProject','catch','createSquareReport','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','sync','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','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','port','name','message','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','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','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source'];(function(_0x5442d8,_0x2b9500){var _0x1ffe4c=function(_0x598498){while(--_0x598498){_0x5442d8['push'](_0x5442d8['shift']());}};_0x1ffe4c(++_0x2b9500);}(_0x6fd0,0x142));var _0x06fd=function(_0xea9e8f,_0x321825){_0xea9e8f=_0xea9e8f-0x0;var _0x4efdd4=_0x6fd0[_0xea9e8f];return _0x4efdd4;};'use strict';var parser=require(_0x06fd('0x0'));var _=require(_0x06fd('0x1'));var syncho=require(_0x06fd('0x2'));var util=require(_0x06fd('0x3'));var moment=require(_0x06fd('0x4'));var config=require(_0x06fd('0x5'));var logger=require(_0x06fd('0x6'))(_0x06fd('0x7'));var utilLicense=require('../../config/license/util');var rpc=require(_0x06fd('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x06fd('0x9'));var Vertices=require(_0x06fd('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x06fd('0xb')](config[_0x06fd('0x7')],{'ip':_0x06fd('0xc'),'port':0x11dd});function connectionHandler(_0x29607a){process[_0x06fd('0xd')](function(){syncho(function(){try{setChannelVariables(_0x29607a);agiHandler(_0x29607a);}catch(_0x9fe523){logger[_0x06fd('0xe')](_0x9fe523[_0x06fd('0xf')]);}});});}function listeningHandler(){console['log'](_0x06fd('0x10'),config[_0x06fd('0x7')]['port']);logger['info'](util[_0x06fd('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x06fd('0x7')]['ip'],config['agi'][_0x06fd('0x12')]));}function errorHandler(_0x3f9442){if(_0x3f9442&&_0x3f9442[_0x06fd('0x13')]&&_0x3f9442[_0x06fd('0x14')]){logger[_0x06fd('0xe')](util[_0x06fd('0x11')]('[%s]\x20%s',_0x3f9442['name'],_0x3f9442[_0x06fd('0x14')]));}else{logger[_0x06fd('0xe')](util[_0x06fd('0x11')](_0x06fd('0x15'),_0x3f9442['stack']));}}function closeHandler(){logger[_0x06fd('0x16')](util[_0x06fd('0x11')](_0x06fd('0x17'),this[_0x06fd('0x18')],this[_0x06fd('0x19')],this[_0x06fd('0x1a')],this['dnid'],this[_0x06fd('0x1b')]));try{createSquareReport(this);}catch(_0x1cd1d6){logger[_0x06fd('0xe')](_0x1cd1d6[_0x06fd('0xf')]);}}function timeoutHandler(){logger[_0x06fd('0x16')](util[_0x06fd('0x11')](_0x06fd('0x1c'),this[_0x06fd('0x18')],this['calleridname'],this['callerid'],this[_0x06fd('0x1d')],this[_0x06fd('0x1b')]));}function hangupHandler(){logger[_0x06fd('0x16')](util['format'](_0x06fd('0x1e'),this[_0x06fd('0x18')],this['calleridname'],this[_0x06fd('0x1a')],this[_0x06fd('0x1d')],this[_0x06fd('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x5a6bb7){return parser[_0x06fd('0x1f')](_0x5a6bb7,{'object':!![]})[_0x06fd('0x20')][_0x06fd('0x21')];}function addVertex(_0x32fdeb,_0x303de5,_0x1b565c){_0x303de5['agicommand']=_0x1b565c;if(_0x303de5[_0x06fd('0x22')](_0x06fd('0x23'))){_0x303de5[_0x06fd('0x24')]=parseInt(_0x303de5[_0x06fd('0x23')],0xa);}_0x32fdeb[_0x06fd('0x25')](_[_0x06fd('0x26')](_0x303de5,'mxCell'));}function initGraph(_0x125314,_0x92ddb9){var _0xafbefb=new Graph();for(var _0x1b7d1e in _0x125314){if(_0x125314['hasOwnProperty'](_0x1b7d1e)){if(_[_0x06fd('0x27')](_0x125314[_0x1b7d1e])){for(var _0x586427=0x0;_0x586427<_0x125314[_0x1b7d1e][_0x06fd('0x28')];_0x586427+=0x1){addVertex(_0xafbefb,_0x125314[_0x1b7d1e][_0x586427],_0x1b7d1e);}}else{addVertex(_0xafbefb,_0x125314[_0x1b7d1e],_0x1b7d1e);}}}for(var _0x2d5906=0x0;_0x2d5906<_0x92ddb9['length'];_0x2d5906+=0x1){if(_0x92ddb9[_0x2d5906][_0x06fd('0x29')]&&_0x92ddb9[_0x2d5906][_0x06fd('0x2a')]){_0xafbefb[_0x06fd('0x2b')](_0x92ddb9[_0x2d5906][_0x06fd('0x29')],_0x92ddb9[_0x2d5906][_0x06fd('0x2a')],_0x92ddb9[_0x2d5906][_0x06fd('0x2c')]);}}return _0xafbefb;}function getSquareProject(_0x5d8ee1,_0x5f4019){rpc[_0x06fd('0x2d')](_0x5d8ee1)['then'](function(_0x4fdc45){_0x5f4019(null,_0x4fdc45);})[_0x06fd('0x2e')](function(_0x3a435d){_0x5f4019(null,_0x3a435d);});}function createSquareReport(_0x436eeb,_0x3add8f){rpc[_0x06fd('0x2f')](_0x436eeb)['then'](function(_0x5e902a){if(_0x3add8f){_0x3add8f(null,_0x5e902a);}})[_0x06fd('0x2e')](function(_0x97621){if(_0x3add8f){_0x3add8f(null,_0x97621);}});}function setChannelVariables(_0x355e2e){for(var _0x294408 in _0x355e2e){if(_0x355e2e['hasOwnProperty'](_0x294408)){if(_0x294408['indexOf'](_0x06fd('0x30'))===0x0){_0x355e2e[_0x294408[_0x06fd('0x31')](0x4)]=_0x355e2e[_0x294408];delete _0x355e2e[_0x294408];}}}}function getLogFromObject(_0x11bf26){return util[_0x06fd('0x32')](_0x11bf26,{'showHidden':![],'depth':null});}function agiHandler(_0x367f8e){var _0x5bf61f,_0x370d9d,_0x4d1300,_0x4d5d60,_0xff7758;logger[_0x06fd('0x33')]('variables',JSON[_0x06fd('0x34')](_0x367f8e,null,0x2));logger[_0x06fd('0x16')](util[_0x06fd('0x11')](_0x06fd('0x35'),_0x367f8e[_0x06fd('0x18')],_0x367f8e[_0x06fd('0x19')],_0x367f8e[_0x06fd('0x1a')],_0x367f8e[_0x06fd('0x1d')],_0x367f8e[_0x06fd('0x1b')]));_0x367f8e['on'](_0x06fd('0xe'),errorHandler);_0x367f8e['on']('close',closeHandler);_0x367f8e['on'](_0x06fd('0x36'),timeoutHandler);_0x367f8e[_0x06fd('0x37')]=![];_0x367f8e['on']('hangup',hangupHandler);var _0x4c871c=getSquareProject[_0x06fd('0x38')](null,_0x367f8e['arg_1']);if(_0x4c871c){if(_0x4c871c['production']){_0x5bf61f=getRoot(_0x4c871c['production']);if(_0x5bf61f&&_0x5bf61f[_0x06fd('0x39')]){logger['debug']('root',JSON['stringify'](_0x5bf61f,null,0x2));_0x367f8e[_0x06fd('0x3a')]=moment()[_0x06fd('0x11')](_0x06fd('0x3b'));_0x370d9d=initGraph(_[_0x06fd('0x26')](_0x5bf61f,_0x06fd('0x3c')),_0x5bf61f[_0x06fd('0x3c')]);_0x4d1300=new Vertices(_0x367f8e,rpc,mailRpc);logger[_0x06fd('0x16')](util[_0x06fd('0x11')](_0x06fd('0x3d'),_0x367f8e[_0x06fd('0x18')],_0x367f8e[_0x06fd('0x19')],_0x367f8e[_0x06fd('0x1a')],_0x367f8e[_0x06fd('0x1d')],_0x367f8e[_0x06fd('0x1b')]));_0x370d9d[_0x06fd('0x3e')](_0x5bf61f[_0x06fd('0x39')]['id'],function(_0x351149){try{_0x351149=_0x4d1300[_0x06fd('0x3f')](_0x351149);logger[_0x06fd('0x33')](_0x06fd('0x40'),JSON[_0x06fd('0x34')](_0x351149,null,0x2));if(_0x351149[_0x06fd('0x41')]==='gotoc'){logger[_0x06fd('0x16')](_0x06fd('0x42'));_0x367f8e[_0x06fd('0x43')]=_0x351149['context']||_0x367f8e[_0x06fd('0x43')];_0x367f8e[_0x06fd('0x44')]=_0x351149[_0x06fd('0x44')];_0x367f8e[_0x06fd('0x45')]=_0x351149['priority']?_0x351149[_0x06fd('0x45')]-0x1:0x1;return null;}else if(_0x351149&&_0x4d1300[_0x351149[_0x06fd('0x41')]]){_0xff7758=_0x4d1300[_0x351149[_0x06fd('0x41')]](_0x351149);logger['info'](_0x06fd('0x46'),JSON[_0x06fd('0x34')](_0xff7758,null,0x2));if(_0xff7758&&_0xff7758[_0x06fd('0x47')]===AGI_CODE_SUCCESS&&_0xff7758[_0x06fd('0x48')]!==AGI_RESULT_ERROR&&!_0x367f8e[_0x06fd('0x37')]){logger[_0x06fd('0x33')](_0x06fd('0x46'),getLogFromObject(_0xff7758));return _[_0x06fd('0x49')](_0xff7758[_0x06fd('0x48')])?null:_0xff7758[_0x06fd('0x48')]['toString']();}else{logger[_0x06fd('0xe')](_0x06fd('0x46'),getLogFromObject(_0xff7758));return null;}}else{logger[_0x06fd('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x348baf){logger[_0x06fd('0xe')](_0x348baf[_0x06fd('0xf')]);return null;}});if(_0x5bf61f[_0x06fd('0x4a')]){logger[_0x06fd('0x16')](util[_0x06fd('0x11')](_0x06fd('0x4b'),_0x367f8e[_0x06fd('0x18')],_0x367f8e['calleridname'],_0x367f8e['callerid'],_0x367f8e[_0x06fd('0x1d')],_0x367f8e[_0x06fd('0x1b')]));_0x370d9d[_0x06fd('0x3e')](_0x5bf61f['finally']['id'],function(_0xa7822a){try{_0xa7822a=_0x4d1300[_0x06fd('0x3f')](_0xa7822a);logger[_0x06fd('0x33')](_0x06fd('0x40'),JSON['stringify'](_0xa7822a,null,0x2));if(_0xa7822a&&_0x4d1300[_0xa7822a[_0x06fd('0x41')]]){_0xff7758=_0x4d1300[_0xa7822a[_0x06fd('0x41')]](_0xa7822a);if(_0xff7758){logger['debug'](_0x06fd('0x46'),getLogFromObject(_0xff7758));return _[_0x06fd('0x49')](_0xff7758[_0x06fd('0x48')])?null:_0xff7758[_0x06fd('0x48')]['toString']();}else{logger[_0x06fd('0xe')](_0x06fd('0x46'),getLogFromObject(_0xff7758));return null;}}else{logger[_0x06fd('0xe')](_0x06fd('0x4c'));return null;}}catch(_0x48d5fa){logger['error'](_0x48d5fa['stack']);return null;}});}logger[_0x06fd('0x16')](util['format'](_0x06fd('0x4d'),_0x367f8e[_0x06fd('0x18')],_0x367f8e[_0x06fd('0x19')],_0x367f8e[_0x06fd('0x1a')],_0x367f8e['dnid'],_0x367f8e['uniqueid']));logger[_0x06fd('0x16')](util['format'](_0x06fd('0x4e'),_0x367f8e[_0x06fd('0x43')],_0x367f8e['extension'],parseInt(_0x367f8e[_0x06fd('0x45')],0xa)+0x1));_0x367f8e[_0x06fd('0x4f')](_0x367f8e[_0x06fd('0x43')],_0x367f8e[_0x06fd('0x44')],parseInt(_0x367f8e['priority'],0xa)+0x1);_0x367f8e['close']();}}else{logger[_0x06fd('0xe')](util[_0x06fd('0x11')](_0x06fd('0x50'),_0x367f8e[_0x06fd('0x18')]));_0x367f8e['continueAt'](_0x367f8e[_0x06fd('0x43')],_0x367f8e['extension'],parseInt(_0x367f8e[_0x06fd('0x45')],0xa)+0x1);_0x367f8e[_0x06fd('0x51')]();}}else{logger['error'](util[_0x06fd('0x11')](_0x06fd('0x52'),_0x367f8e[_0x06fd('0x18')]));_0x367f8e['continueAt'](_0x367f8e[_0x06fd('0x43')],_0x367f8e[_0x06fd('0x44')],parseInt(_0x367f8e[_0x06fd('0x45')],0xa)+0x1);_0x367f8e[_0x06fd('0x51')]();}}function main(){var _0x1811da;return utilLicense[_0x06fd('0x53')]()['then'](function(_0x464b50){if(_0x464b50){if(_0x464b50[_0x06fd('0x54')]){if(_0x464b50['callysquare']&&_0x464b50[_0x06fd('0x55')]>0x0){logger[_0x06fd('0x16')](util[_0x06fd('0x11')](_0x06fd('0x56'),_0x464b50['callysquare']));_0x1811da=_0x464b50[_0x06fd('0x55')];}else{logger[_0x06fd('0x16')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1811da=-0x1;}}})[_0x06fd('0x2e')](function(_0x56b634){logger[_0x06fd('0xe')](_0x06fd('0x57'),_0x56b634['stack']);})[_0x06fd('0x4a')](function(){var _0x1640fb=require(_0x06fd('0x58'))(config[_0x06fd('0x7')][_0x06fd('0x12')],config[_0x06fd('0x7')]['ip'],_0x1811da);_0x1640fb['on'](_0x06fd('0xe'),errorHandler);_0x1640fb['on'](_0x06fd('0x59'),listeningHandler);_0x1640fb['on'](_0x06fd('0x5a'),connectionHandler);_0x1640fb['on'](_0x06fd('0x51'),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 a5ec37e..ef87378 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 _0xfba2=['bluebird','jayson/promise','client','http','then','error','message','result','sendMailMessage'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xfba2,0x1d4));var _0x2fba=function(_0x29c979,_0x20646e){_0x29c979=_0x29c979-0x0;var _0x4c751a=_0xfba2[_0x29c979];return _0x4c751a;};'use strict';var BPromise=require(_0x2fba('0x0'));var jayson=require(_0x2fba('0x1'));var client=jayson[_0x2fba('0x2')][_0x2fba('0x3')]({'port':0x232b});function request(_0x2f7bd7,_0x408b84){return new BPromise(function(_0x54ba52,_0x2a6620){return client['request'](_0x2f7bd7,_0x408b84)[_0x2fba('0x4')](function(_0x1da493){if(_0x1da493[_0x2fba('0x5')]){return _0x2a6620(_0x1da493[_0x2fba('0x5')][_0x2fba('0x6')]);}else{return _0x54ba52(_0x1da493[_0x2fba('0x7')]);}})['catch'](function(_0xf4afb5){return _0x2a6620(_0xf4afb5);});});}exports[_0x2fba('0x8')]=function(_0x48fad1,_0xe0f6d7){return request('SendMail',{'account':_0x48fad1,'message':_0xe0f6d7});}; \ No newline at end of file +var _0x251e=['error','message','catch','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x251e,0x126));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xe251('0x0'));var jayson=require(_0xe251('0x1'));var client=jayson[_0xe251('0x2')][_0xe251('0x3')]({'port':0x232b});function request(_0x25e39c,_0x4f7f8a){return new BPromise(function(_0x5b081c,_0x23336c){return client[_0xe251('0x4')](_0x25e39c,_0x4f7f8a)[_0xe251('0x5')](function(_0x30eec6){if(_0x30eec6['error']){return _0x23336c(_0x30eec6[_0xe251('0x6')][_0xe251('0x7')]);}else{return _0x5b081c(_0x30eec6['result']);}})[_0xe251('0x8')](function(_0x297c8f){return _0x23336c(_0x297c8f);});});}exports['sendMailMessage']=function(_0x255489,_0x3ba981){return request(_0xe251('0x9'),{'account':_0x255489,'message':_0x3ba981});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 0bdc37c..16a3456 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 _0x54bd=['exports','util','stream','Transform','call','inherits','prototype','_localBuffer','toString','_inBody','indexOf','substring','length','split','trim','slice','emit'];(function(_0x24fdc1,_0x2b26df){var _0x20c314=function(_0x257072){while(--_0x257072){_0x24fdc1['push'](_0x24fdc1['shift']());}};_0x20c314(++_0x2b26df);}(_0x54bd,0x9a));var _0xd54b=function(_0x553b66,_0x219366){_0x553b66=_0x553b66-0x0;var _0x2880d5=_0x54bd[_0x553b66];return _0x2880d5;};'use strict';var util=require(_0xd54b('0x0'));var Transform=require(_0xd54b('0x1'))[_0xd54b('0x2')];function AGIReply(_0x239fee){Transform[_0xd54b('0x3')](this,_0x239fee);this['_localBuffer']='';this['_inBody']=![];}util[_0xd54b('0x4')](AGIReply,Transform);AGIReply[_0xd54b('0x5')]['_transform']=function(_0x1d9565,_0x8396f2,_0x52190c){var _0x21a670='\x0a',_0xff037c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4a182f=-0x1,_0x8046b2=-0x1,_0x171422='',_0x1a9d1d=0x0,_0x10bb82='',_0xd1521e='';this[_0xd54b('0x6')]+=_0x1d9565[_0xd54b('0x7')]();_0x10bb82=this[_0xd54b('0x6')];if(!this[_0xd54b('0x8')]){_0x1a9d1d=0x0;while(_0xff037c[_0x1a9d1d]){while((_0x8046b2=_0x10bb82[_0xd54b('0x9')](_0xff037c[_0x1a9d1d]))!=-0x1){_0x171422=_0xff037c[_0x1a9d1d];_0xd1521e=_0x10bb82[_0xd54b('0xa')](0x0,_0x8046b2);_0x10bb82=_0x10bb82[_0xd54b('0xa')](_0x8046b2+_0x171422[_0xd54b('0xb')]);var _0x2cf042=_0xd1521e[_0xd54b('0xc')](_0x21a670),_0x2581d6=0x0,_0x4946e7={},_0x94dbef='',_0x29ce31='',_0x280c8a=-0x1;while(_0x2cf042[_0x2581d6]){_0x280c8a=_0x2cf042[_0x2581d6][_0xd54b('0x9')](':');if(_0x280c8a!=-0x1){_0x94dbef=_0x2cf042[_0x2581d6]['slice'](0x0,_0x280c8a)[_0xd54b('0xd')]();_0x29ce31=_0x2cf042[_0x2581d6][_0xd54b('0xe')](_0x280c8a+0x1)[_0xd54b('0xd')]();if(_0x94dbef[_0xd54b('0xb')]>0x0){_0x4946e7[_0x94dbef]=_0x29ce31;}}else{}_0x2581d6++;}this[_0xd54b('0xf')]('headers',_0x4946e7);this[_0xd54b('0x8')]=!![];}_0x1a9d1d++;}this[_0xd54b('0x6')]=_0x10bb82;}else{while((_0x4a182f=_0x10bb82[_0xd54b('0x9')](_0x21a670))!=-0x1){_0xd1521e=_0x10bb82['substring'](0x0,_0x4a182f);this['emit']('line',_0xd1521e);_0x10bb82=_0x10bb82[_0xd54b('0xa')](_0x4a182f+_0x21a670[_0xd54b('0xb')]);}this[_0xd54b('0x6')]=_0x10bb82;}_0x52190c();};module[_0xd54b('0x10')]=AGIReply; \ No newline at end of file +var _0x9bb4=['emit','headers','substring','line','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','length','split','slice','trim'];(function(_0x2bcf90,_0x5a5096){var _0x381054=function(_0x288902){while(--_0x288902){_0x2bcf90['push'](_0x2bcf90['shift']());}};_0x381054(++_0x5a5096);}(_0x9bb4,0xd5));var _0x49bb=function(_0x22e7c4,_0x439c5e){_0x22e7c4=_0x22e7c4-0x0;var _0x48e25d=_0x9bb4[_0x22e7c4];return _0x48e25d;};'use strict';var util=require(_0x49bb('0x0'));var Transform=require(_0x49bb('0x1'))[_0x49bb('0x2')];function AGIReply(_0xcd742c){Transform[_0x49bb('0x3')](this,_0xcd742c);this[_0x49bb('0x4')]='';this[_0x49bb('0x5')]=![];}util[_0x49bb('0x6')](AGIReply,Transform);AGIReply[_0x49bb('0x7')]['_transform']=function(_0x1aa8db,_0x2e490d,_0xbe290c){var _0x2375ac='\x0a',_0x4d603d=['\x0a\x0a',_0x49bb('0x8')],_0x15c24c=-0x1,_0x353853=-0x1,_0x1a4094='',_0x2967d4=0x0,_0x22a3df='',_0x4d16e7='';this['_localBuffer']+=_0x1aa8db[_0x49bb('0x9')]();_0x22a3df=this[_0x49bb('0x4')];if(!this['_inBody']){_0x2967d4=0x0;while(_0x4d603d[_0x2967d4]){while((_0x353853=_0x22a3df[_0x49bb('0xa')](_0x4d603d[_0x2967d4]))!=-0x1){_0x1a4094=_0x4d603d[_0x2967d4];_0x4d16e7=_0x22a3df['substring'](0x0,_0x353853);_0x22a3df=_0x22a3df['substring'](_0x353853+_0x1a4094[_0x49bb('0xb')]);var _0x589fff=_0x4d16e7[_0x49bb('0xc')](_0x2375ac),_0x429dba=0x0,_0x123e34={},_0xfab080='',_0x3b85fc='',_0x1ff6d1=-0x1;while(_0x589fff[_0x429dba]){_0x1ff6d1=_0x589fff[_0x429dba][_0x49bb('0xa')](':');if(_0x1ff6d1!=-0x1){_0xfab080=_0x589fff[_0x429dba][_0x49bb('0xd')](0x0,_0x1ff6d1)[_0x49bb('0xe')]();_0x3b85fc=_0x589fff[_0x429dba]['slice'](_0x1ff6d1+0x1)[_0x49bb('0xe')]();if(_0xfab080['length']>0x0){_0x123e34[_0xfab080]=_0x3b85fc;}}else{}_0x429dba++;}this[_0x49bb('0xf')](_0x49bb('0x10'),_0x123e34);this[_0x49bb('0x5')]=!![];}_0x2967d4++;}this[_0x49bb('0x4')]=_0x22a3df;}else{while((_0x15c24c=_0x22a3df[_0x49bb('0xa')](_0x2375ac))!=-0x1){_0x4d16e7=_0x22a3df[_0x49bb('0x11')](0x0,_0x15c24c);this[_0x49bb('0xf')](_0x49bb('0x12'),_0x4d16e7);_0x22a3df=_0x22a3df['substring'](_0x15c24c+_0x2375ac[_0x49bb('0xb')]);}this[_0x49bb('0x4')]=_0x22a3df;}_0xbe290c();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 2304e88..0275be2 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 _0x3953=['createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','getPauseById','ShowPause','agentLogin','agentPause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording'];(function(_0xb65250,_0x2595ee){var _0x223e3f=function(_0x36a738){while(--_0x36a738){_0xb65250['push'](_0xb65250['shift']());}};_0x223e3f(++_0x2595ee);}(_0x3953,0x7f));var _0x3395=function(_0x5cb978,_0x600bdf){_0x5cb978=_0x5cb978-0x0;var _0x510bd3=_0x3953[_0x5cb978];return _0x510bd3;};'use strict';var BPromise=require(_0x3395('0x0'));var moment=require(_0x3395('0x1'));var _=require(_0x3395('0x2'));var util=require(_0x3395('0x3'));var jayson=require(_0x3395('0x4'));var client=jayson[_0x3395('0x5')][_0x3395('0x6')]({'port':0x2329});function request(_0xe28867,_0x39e1dd){return new BPromise(function(_0x349c19,_0x16f90f){return client[_0x3395('0x7')](_0xe28867,_0x39e1dd)[_0x3395('0x8')](function(_0x521df1){if(_0x521df1[_0x3395('0x9')]){return _0x16f90f(_0x521df1[_0x3395('0x9')][_0x3395('0xa')]);}else{return _0x349c19(_0x521df1[_0x3395('0xb')]);}})[_0x3395('0xc')](function(_0x4580c6){return _0x16f90f(_0x4580c6);});});}exports[_0x3395('0xd')]=function(_0x21e31e){return request(_0x3395('0xe'),{'options':{'raw':![],'where':{'name':_0x21e31e},'attributes':[_0x3395('0xf')]}});};exports[_0x3395('0x10')]=function(_0x51ceaf){return request(_0x3395('0x11'),{'options':{'raw':![],'where':{'id':_0x51ceaf},'include':[{'model':_0x3395('0x12'),'as':_0x3395('0x13')}],'attributes':['id',_0x3395('0x14'),_0x3395('0x15')]}});};exports[_0x3395('0x16')]=function(_0x2a8393){return request('ShowSquareProject',{'options':{'where':{'id':_0x2a8393},'attributes':[_0x3395('0x14')]}});};exports[_0x3395('0x17')]=function(_0x2a2b4f){return request(_0x3395('0x18'),{'options':{'where':{'id':_0x2a2b4f},'attributes':['name']}});};exports[_0x3395('0x19')]=function(_0x21f5a3){return request(_0x3395('0x1a'),{'options':{'where':{'id':_0x21f5a3},'attributes':['name']}});};exports[_0x3395('0x1b')]=function(_0x3ea428){return request(_0x3395('0x1c'),{'options':{'where':{'id':_0x3ea428},'attributes':[_0x3395('0x1d')]}});};exports[_0x3395('0x1e')]=function(_0x24fa49){return request(_0x3395('0x1f'),{'options':{'where':{'id':_0x24fa49},'attributes':['name']}});};exports['getTrunkById']=function(_0x3b5f0b){return request('ShowTrunk',{'options':{'where':{'id':_0x3b5f0b},'attributes':[_0x3395('0x14')]}});};exports['getSoundById']=function(_0x45e2a0){return request('ShowSound',{'options':{'where':{'id':_0x45e2a0},'attributes':[_0x3395('0x20')]}});};exports[_0x3395('0x21')]=function(_0x5de85c){return request(_0x3395('0x22'),{'options':{'raw':![],'where':{'id':_0x5de85c},'include':[{'model':_0x3395('0x23'),'as':'Intervals'}]}});};exports[_0x3395('0x24')]=function(_0x2bdc2d){return request(_0x3395('0x25'),{'options':{'where':{'id':_0x2bdc2d},'attributes':['id',_0x3395('0x14')]}});};exports[_0x3395('0x26')]=function(_0x3ccbd6){return request(_0x3395('0x27'),{'body':_0x3ccbd6});};exports['createSquareDetailsReport']=function(_0x1b99e1){return request(_0x3395('0x28'),{'body':_0x1b99e1});};exports[_0x3395('0x29')]=function(_0x31bbac){return request('CreateSquareReport',{'body':_['merge'](_0x31bbac,{'project_name':_0x31bbac[_0x3395('0x2a')],'prev_project_name':_0x31bbac[_0x3395('0x2b')]||'','is_subproject':_0x31bbac[_0x3395('0x2b')]?!![]:![],'leaveAt':moment()[_0x3395('0x2c')](_0x3395('0x2d'))})});};exports[_0x3395('0x2e')]=function(_0x83d3a0){return request('CreateSquareRecording',{'body':_0x83d3a0});};exports[_0x3395('0x2f')]=function(_0x5a09af){return request(_0x3395('0x30'),{'body':_0x5a09af});};exports['createCmContact']=function(_0x263473){return request(_0x3395('0x31'),{'options':{'raw':![],'where':{'phone':_0x263473[_0x3395('0x32')],'ListId':_0x263473['ListId']}}})[_0x3395('0x8')](function(_0x3619fb){if(_0x3619fb){return _0x3619fb;}return request('CreateCmContact',{'body':_0x263473});});};exports[_0x3395('0x33')]=function(_0x4e1ee7){return request(_0x3395('0x34'),{'options':{'where':{'id':_0x4e1ee7},'attributes':['name']}});};exports[_0x3395('0x35')]=function(_0x2291c1,_0x5aec66){return request('LoginUser',{'body':{'interface':_0x5aec66},'options':{'where':_0x2291c1}});};exports[_0x3395('0x36')]=function(_0x57d313,_0x4724fa,_0x181fcb){return request('PauseUser',{'body':{'type':_0x4724fa,'uniqueid':_0x181fcb},'options':{'where':_0x57d313}});};exports['agentUnpause']=function(_0x434e78){return request(_0x3395('0x37'),{'body':{},'options':{'where':_0x434e78}});};exports[_0x3395('0x38')]=function(_0x5954da){return request(_0x3395('0x39'),{'body':{},'options':{'where':_0x5954da}});}; \ No newline at end of file +var _0x8785=['UnpauseUser','agentLogout','lodash','util','jayson/promise','client','http','request','then','result','catch','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause'];(function(_0x4ee56e,_0x45eae5){var _0x196ac1=function(_0x40ea60){while(--_0x40ea60){_0x4ee56e['push'](_0x4ee56e['shift']());}};_0x196ac1(++_0x45eae5);}(_0x8785,0x1d2));var _0x5878=function(_0x3585ff,_0x35e509){_0x3585ff=_0x3585ff-0x0;var _0x3481a2=_0x8785[_0x3585ff];return _0x3481a2;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x5878('0x0'));var util=require(_0x5878('0x1'));var jayson=require(_0x5878('0x2'));var client=jayson[_0x5878('0x3')][_0x5878('0x4')]({'port':0x2329});function request(_0xb7be5e,_0x4a2775){return new BPromise(function(_0xcb2280,_0x150353){return client[_0x5878('0x5')](_0xb7be5e,_0x4a2775)[_0x5878('0x6')](function(_0x1004ac){if(_0x1004ac['error']){return _0x150353(_0x1004ac['error']['message']);}else{return _0xcb2280(_0x1004ac[_0x5878('0x7')]);}})[_0x5878('0x8')](function(_0x19a1ce){return _0x150353(_0x19a1ce);});});}exports[_0x5878('0x9')]=function(_0x4e2e17){return request(_0x5878('0xa'),{'options':{'raw':![],'where':{'name':_0x4e2e17},'attributes':['production']}});};exports['getMailAccountById']=function(_0x1464c2){return request(_0x5878('0xb'),{'options':{'raw':![],'where':{'id':_0x1464c2},'include':[{'model':_0x5878('0xc'),'as':_0x5878('0xd')}],'attributes':['id',_0x5878('0xe'),'email']}});};exports[_0x5878('0xf')]=function(_0x4debec){return request(_0x5878('0xa'),{'options':{'where':{'id':_0x4debec},'attributes':[_0x5878('0xe')]}});};exports[_0x5878('0x10')]=function(_0x54f4fb){return request(_0x5878('0x11'),{'options':{'where':{'id':_0x54f4fb},'attributes':[_0x5878('0xe')]}});};exports[_0x5878('0x12')]=function(_0x1afbeb){return request(_0x5878('0x13'),{'options':{'where':{'id':_0x1afbeb},'attributes':['name']}});};exports[_0x5878('0x14')]=function(_0x2b9943){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2b9943},'attributes':[_0x5878('0x15')]}});};exports[_0x5878('0x16')]=function(_0x457a48){return request('ShowUser',{'options':{'where':{'id':_0x457a48},'attributes':['name']}});};exports[_0x5878('0x17')]=function(_0x5ee183){return request(_0x5878('0x18'),{'options':{'where':{'id':_0x5ee183},'attributes':['name']}});};exports['getSoundById']=function(_0x18bf53){return request(_0x5878('0x19'),{'options':{'where':{'id':_0x18bf53},'attributes':[_0x5878('0x1a')]}});};exports[_0x5878('0x1b')]=function(_0x4f3e3e){return request(_0x5878('0x1c'),{'options':{'raw':![],'where':{'id':_0x4f3e3e},'include':[{'model':_0x5878('0x1d'),'as':'Intervals'}]}});};exports[_0x5878('0x1e')]=function(_0x2cfe33){return request(_0x5878('0x1f'),{'options':{'where':{'id':_0x2cfe33},'attributes':['id',_0x5878('0xe')]}});};exports[_0x5878('0x20')]=function(_0x16eade){return request(_0x5878('0x21'),{'body':_0x16eade});};exports['createSquareDetailsReport']=function(_0xe9e4a2){return request('CreateSquareDetailsReport',{'body':_0xe9e4a2});};exports[_0x5878('0x22')]=function(_0x243b01){return request(_0x5878('0x23'),{'body':_[_0x5878('0x24')](_0x243b01,{'project_name':_0x243b01[_0x5878('0x25')],'prev_project_name':_0x243b01[_0x5878('0x26')]||'','is_subproject':_0x243b01['arg_2']?!![]:![],'leaveAt':moment()[_0x5878('0x27')](_0x5878('0x28'))})});};exports[_0x5878('0x29')]=function(_0xef1ad6){return request(_0x5878('0x2a'),{'body':_0xef1ad6});};exports[_0x5878('0x2b')]=function(_0x237efa){return request(_0x5878('0x2c'),{'body':_0x237efa});};exports[_0x5878('0x2d')]=function(_0x3aa914){return request(_0x5878('0x2e'),{'options':{'raw':![],'where':{'phone':_0x3aa914[_0x5878('0x2f')],'ListId':_0x3aa914[_0x5878('0x30')]}}})[_0x5878('0x6')](function(_0x32c232){if(_0x32c232){return _0x32c232;}return request(_0x5878('0x31'),{'body':_0x3aa914});});};exports['getPauseById']=function(_0x305b4d){return request(_0x5878('0x32'),{'options':{'where':{'id':_0x305b4d},'attributes':[_0x5878('0xe')]}});};exports[_0x5878('0x33')]=function(_0x3fe0a2,_0x25b5d5){return request(_0x5878('0x34'),{'body':{'interface':_0x25b5d5},'options':{'where':_0x3fe0a2}});};exports[_0x5878('0x35')]=function(_0x515319,_0x53ebc5,_0x50cedc){return request(_0x5878('0x36'),{'body':{'type':_0x53ebc5,'uniqueid':_0x50cedc},'options':{'where':_0x515319}});};exports[_0x5878('0x37')]=function(_0x108023){return request(_0x5878('0x38'),{'body':{},'options':{'where':_0x108023}});};exports[_0x5878('0x39')]=function(_0x4866a2){return request('LogoutUser',{'body':{},'options':{'where':_0x4866a2}});}; \ 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 f7d5a5b..135e7c8 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 _0x34f2=['./polly','./lex'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x34f2,0x15a));var _0x234f=function(_0x30f3ef,_0x1bd6c6){_0x30f3ef=_0x30f3ef-0x0;var _0x1b1852=_0x34f2[_0x30f3ef];return _0x1b1852;};var polly=require(_0x234f('0x0'));var lex=require(_0x234f('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xbe2c=['./lex','./polly'];(function(_0x1011f6,_0x58ee29){var _0x54fac2=function(_0x6f910c){while(--_0x6f910c){_0x1011f6['push'](_0x1011f6['shift']());}};_0x54fac2(++_0x58ee29);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x24a05a,_0x5de970){_0x24a05a=_0x24a05a-0x0;var _0x3a26a1=_0xbe2c[_0x24a05a];return _0x3a26a1;};var polly=require(_0xcbe2('0x0'));var lex=require(_0xcbe2('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index cbccde9..094f681 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 _0x750a=['exports'];(function(_0x4e7de8,_0x4bb6cf){var _0x567f2e=function(_0x450d72){while(--_0x450d72){_0x4e7de8['push'](_0x4e7de8['shift']());}};_0x567f2e(++_0x4bb6cf);}(_0x750a,0x140));var _0xa750=function(_0x276e6f,_0x4f5d7f){_0x276e6f=_0x276e6f-0x0;var _0x51012c=_0x750a[_0x276e6f];return _0x51012c;};'use strict';var lex=require('./lib/api');module[_0xa750('0x0')]=function(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f){return lex(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f);}; \ No newline at end of file +var _0x6324=['./lib/api','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6324,0x142));var _0x4632=function(_0x250ce7,_0x502ad3){_0x250ce7=_0x250ce7-0x0;var _0x416428=_0x6324[_0x250ce7];return _0x416428;};'use strict';var lex=require(_0x4632('0x0'));module[_0x4632('0x1')]=function(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40){return lex(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40);}; \ 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 59ba6fc..5cf0245 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(_0x475ba6,_0x5c0630){var _0x5d1a0a=function(_0x2e2cf3){while(--_0x2e2cf3){_0x475ba6['push'](_0x475ba6['shift']());}};_0x5d1a0a(++_0x5c0630);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x16e424,_0x5a9492){var _0x5924ba=function(_0x185ed6){while(--_0x185ed6){_0x16e424['push'](_0x16e424['shift']());}};_0x5924ba(++_0x5a9492);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 3541547..2fc6e9c 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 _0xa537=['./lib/api'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xa537,0x15e));var _0x7a53=function(_0x2e7900,_0x40e8ac){_0x2e7900=_0x2e7900-0x0;var _0x2a1c5d=_0xa537[_0x2e7900];return _0x2a1c5d;};'use strict';var polly=require(_0x7a53('0x0'));module['exports']=function(_0x664794,_0x5dae46,_0x3602e3,_0x3847a2,_0x221083,_0x31fcc2,_0x17c947){return polly(_0x664794,_0x5dae46,_0x3602e3,_0x3847a2,_0x221083,_0x31fcc2,_0x17c947);}; \ No newline at end of file +var _0x4d42=['exports','./lib/api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4d42,0x89));var _0x24d4=function(_0x18a8ce,_0x28af13){_0x18a8ce=_0x18a8ce-0x0;var _0x4912d8=_0x4d42[_0x18a8ce];return _0x4912d8;};'use strict';var polly=require(_0x24d4('0x0'));module[_0x24d4('0x1')]=function(_0x5a12db,_0x1179cf,_0xfb128,_0x2f846e,_0x2e1a56,_0x421919,_0x52b7ca){return polly(_0x5a12db,_0x1179cf,_0xfb128,_0x2f846e,_0x2e1a56,_0x421919,_0x52b7ca);}; \ 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 11713ff..c4c0fba 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 _0x6edb=['aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','mp3','path','bluebird','randomstring'];(function(_0x37b453,_0x2f27e2){var _0x2edd11=function(_0xbcec4f){while(--_0xbcec4f){_0x37b453['push'](_0x37b453['shift']());}};_0x2edd11(++_0x2f27e2);}(_0x6edb,0xf7));var _0xb6ed=function(_0x39c084,_0xbc0456){_0x39c084=_0x39c084-0x0;var _0x5e6575=_0x6edb[_0x39c084];return _0x5e6575;};'use strict';var fs=require('fs');var path=require(_0xb6ed('0x0'));var BPromise=require(_0xb6ed('0x1'));var rs=require(_0xb6ed('0x2'));var AWS=require(_0xb6ed('0x3'));function pollyResult(_0x5e1636,_0x55be7a,_0x425683){return new BPromise(function(_0x3e6b9f,_0x56c187){_0x5e1636[_0xb6ed('0x4')](_0x55be7a,function(_0x14915d,_0x25ba1b){if(_0x14915d){_0x56c187(_0x14915d);}else if(_0x25ba1b){if(_0x25ba1b['AudioStream']instanceof Buffer){fs[_0xb6ed('0x5')](_0x425683,_0x25ba1b[_0xb6ed('0x6')],function(_0x5afa65){if(_0x5afa65){_0x56c187(_0x5afa65);}else{_0x3e6b9f();}});}else{_0x56c187(new Error(_0xb6ed('0x7')));}}else{_0x56c187(new Error(_0xb6ed('0x8')));}});});}module['exports']=function(_0x22f7ed,_0x3ccf26,_0x2376bc,_0x10c4a3,_0x99c563,_0x589779,_0x58de3e){var _0x5d22a8=new AWS['Polly']({'accessKeyId':_0x22f7ed,'secretAccessKey':_0x3ccf26,'region':_0x2376bc});var _0x1b76cb={'Text':_0x99c563,'TextType':_0x589779||'text','OutputFormat':_0xb6ed('0x9'),'VoiceId':_0x10c4a3};return pollyResult(_0x5d22a8,_0x1b76cb,_0x58de3e);}; \ No newline at end of file +var _0x25f6=['text','path','bluebird','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x25f6,0x123));var _0x625f=function(_0x5f46ee,_0x550dbb){_0x5f46ee=_0x5f46ee-0x0;var _0x5f3804=_0x25f6[_0x5f46ee];return _0x5f3804;};'use strict';var fs=require('fs');var path=require(_0x625f('0x0'));var BPromise=require(_0x625f('0x1'));var rs=require(_0x625f('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x931bfd,_0x2f01f0,_0x47cc40){return new BPromise(function(_0x29d179,_0x1e136d){_0x931bfd[_0x625f('0x3')](_0x2f01f0,function(_0x15cab2,_0x4b59ec){if(_0x15cab2){_0x1e136d(_0x15cab2);}else if(_0x4b59ec){if(_0x4b59ec[_0x625f('0x4')]instanceof Buffer){fs['writeFile'](_0x47cc40,_0x4b59ec[_0x625f('0x4')],function(_0x33e69a){if(_0x33e69a){_0x1e136d(_0x33e69a);}else{_0x29d179();}});}else{_0x1e136d(new Error(_0x625f('0x5')));}}else{_0x1e136d(new Error(_0x625f('0x6')));}});});}module[_0x625f('0x7')]=function(_0xb2cc33,_0x2eb1e6,_0x282892,_0x2c3ab0,_0x8fa080,_0x5b0ff9,_0x43cf4a){var _0x276e34=new AWS[(_0x625f('0x8'))]({'accessKeyId':_0xb2cc33,'secretAccessKey':_0x2eb1e6,'region':_0x282892});var _0x196d69={'Text':_0x8fa080,'TextType':_0x5b0ff9||_0x625f('0x9'),'OutputFormat':'mp3','VoiceId':_0x2c3ab0};return pollyResult(_0x276e34,_0x196d69,_0x43cf4a);}; \ 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 575168f..aa782bb 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbca9=['exports','./lib/api'];(function(_0x4b342b,_0x4f58b7){var _0x46cdda=function(_0x53adc9){while(--_0x53adc9){_0x4b342b['push'](_0x4b342b['shift']());}};_0x46cdda(++_0x4f58b7);}(_0xbca9,0x6d));var _0x9bca=function(_0x362eb2,_0x4e6e78){_0x362eb2=_0x362eb2-0x0;var _0x47b436=_0xbca9[_0x362eb2];return _0x47b436;};'use strict';var asr=require(_0x9bca('0x0'));module[_0x9bca('0x1')]=function(_0x4f3188,_0x53b148,_0x1be552,_0x14fffe){return asr(_0x4f3188,_0x53b148,_0x1be552);}; \ No newline at end of file +var _0x5a57=['./lib/api'];(function(_0x2a3009,_0x105389){var _0x1e605c=function(_0x5df0ea){while(--_0x5df0ea){_0x2a3009['push'](_0x2a3009['shift']());}};_0x1e605c(++_0x105389);}(_0x5a57,0x1c8));var _0x75a5=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x5a57[_0x191154];return _0x3dcd73;};'use strict';var asr=require(_0x75a5('0x0'));module['exports']=function(_0x95de6d,_0x41aee2,_0x4cb921,_0x2204d1){return asr(_0x95de6d,_0x41aee2,_0x4cb921);}; \ 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 c734e76..4b2b32a 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 _0x1b73=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x1b73,0x1d5));var _0x31b7=function(_0x5625f3,_0x43d023){_0x5625f3=_0x5625f3-0x0;var _0x5d8763=_0x1b73[_0x5625f3];return _0x5d8763;};'use strict';var url=require('url');var BPromise=require(_0x31b7('0x0'));var fs=require('fs');var host=_0x31b7('0x1');module[_0x31b7('0x2')]=function(_0x5c767e,_0x4bf5ae,_0x17c0ef){return new BPromise(function(_0x59e606,_0x40fef2){var _0x3682cc;if(typeof _0x5c767e!=='string'||_0x5c767e[_0x31b7('0x3')]===0x0){return _0x40fef2(_0x31b7('0x4'));}if(typeof _0x4bf5ae!==_0x31b7('0x5')||_0x4bf5ae['length']===0x0){return _0x40fef2(_0x31b7('0x6'));}if(typeof _0x17c0ef!==_0x31b7('0x7')&&(typeof _0x17c0ef!==_0x31b7('0x5')||_0x17c0ef[_0x31b7('0x3')]===0x0)){return _0x40fef2(_0x31b7('0x8'));}try{_0x3682cc=fs[_0x31b7('0x9')](_0x5c767e)[_0x31b7('0xa')]('base64');}catch(_0x268428){return _0x40fef2(_0x268428);}return _0x59e606({'method':_0x31b7('0xb'),'uri':host+_0x31b7('0xc')+_0x4bf5ae,'body':{'config':{'encoding':_0x31b7('0xd'),'sampleRateHertz':_0x31b7('0xe'),'languageCode':_0x17c0ef},'audio':{'content':_0x3682cc}},'json':!![]});});}; \ No newline at end of file +var _0xb0d9=['filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','length'];(function(_0x242564,_0x5b36ff){var _0x47915f=function(_0x395cb4){while(--_0x395cb4){_0x242564['push'](_0x242564['shift']());}};_0x47915f(++_0x5b36ff);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x175b42,_0x3ca393){_0x175b42=_0x175b42-0x0;var _0x64066f=_0xb0d9[_0x175b42];return _0x64066f;};'use strict';var url=require(_0x9b0d('0x0'));var BPromise=require(_0x9b0d('0x1'));var fs=require('fs');var host=_0x9b0d('0x2');module[_0x9b0d('0x3')]=function(_0x23ff60,_0x168bd9,_0x595212){return new BPromise(function(_0x201946,_0x5dd128){var _0x4d327a;if(typeof _0x23ff60!=='string'||_0x23ff60[_0x9b0d('0x4')]===0x0){return _0x5dd128(_0x9b0d('0x5'));}if(typeof _0x168bd9!==_0x9b0d('0x6')||_0x168bd9[_0x9b0d('0x4')]===0x0){return _0x5dd128(_0x9b0d('0x7'));}if(typeof _0x595212!==_0x9b0d('0x8')&&(typeof _0x595212!==_0x9b0d('0x6')||_0x595212[_0x9b0d('0x4')]===0x0)){return _0x5dd128(_0x9b0d('0x9'));}try{_0x4d327a=fs['readFileSync'](_0x23ff60)['toString'](_0x9b0d('0xa'));}catch(_0x76dc19){return _0x5dd128(_0x76dc19);}return _0x201946({'method':'POST','uri':host+_0x9b0d('0xb')+_0x168bd9,'body':{'config':{'encoding':_0x9b0d('0xc'),'sampleRateHertz':'8000','languageCode':_0x595212},'audio':{'content':_0x4d327a}},'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 dff6d08..8984470 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 _0x773b=['exports','./asr'];(function(_0x43645f,_0x656278){var _0x36f9ab=function(_0x20f6ec){while(--_0x20f6ec){_0x43645f['push'](_0x43645f['shift']());}};_0x36f9ab(++_0x656278);}(_0x773b,0x11b));var _0xb773=function(_0x1ba8e9,_0x25e157){_0x1ba8e9=_0x1ba8e9-0x0;var _0x5ef962=_0x773b[_0x1ba8e9];return _0x5ef962;};var asr=require(_0xb773('0x0'));module[_0xb773('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7d88=['./asr','exports'];(function(_0x1b3364,_0x5f59d1){var _0x26f5f9=function(_0x1e0d5c){while(--_0x1e0d5c){_0x1b3364['push'](_0x1b3364['shift']());}};_0x26f5f9(++_0x5f59d1);}(_0x7d88,0x16e));var _0x87d8=function(_0x4b63a3,_0x4075a6){_0x4b63a3=_0x4b63a3-0x0;var _0x5276b=_0x7d88[_0x4b63a3];return _0x5276b;};var asr=require(_0x87d8('0x0'));module[_0x87d8('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 ccf9dd5..1928277 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 _0xe747=['data','transcode','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','writeFileSync','base64','then','chmodSync','777','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','resolve','.mp3','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','host','WHAT_EVER'];(function(_0x3151a5,_0x193ca9){var _0x4452c0=function(_0x43d99c){while(--_0x43d99c){_0x3151a5['push'](_0x3151a5['shift']());}};_0x4452c0(++_0x193ca9);}(_0xe747,0x180));var _0x7e74=function(_0x25efa5,_0xc9fd09){_0x25efa5=_0x25efa5-0x0;var _0x3b3db7=_0xe747[_0x25efa5];return _0x3b3db7;};'use strict';var apiai=require(_0x7e74('0x0'));var BPromise=require(_0x7e74('0x1'));var dialogflow=require(_0x7e74('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x7e74('0x3'));var path=require(_0x7e74('0x4'));var querystring=require('querystring');var rp=require(_0x7e74('0x5'));var rs=require(_0x7e74('0x6'));var sox=require(_0x7e74('0x7'));var tts=require(_0x7e74('0x8'));var urlParse=require(_0x7e74('0x9'))[_0x7e74('0xa')];var util=require(_0x7e74('0xb'));var aws=require(_0x7e74('0xc'));var google=require('./google');var sestek=require(_0x7e74('0xd'));var tilde=require('./tilde');var logger=require(_0x7e74('0xe'))(_0x7e74('0xf'));var ISPEECH_API=_0x7e74('0x10');function downloadFile(_0x3d662f,_0x3bdcf9){return new BPromise(function(_0x39f65b,_0x1c70e0){var _0x1614c1=urlParse(_0x3d662f);var _0xa3195c=_0x1614c1[_0x7e74('0x11')]===_0x7e74('0x12')?https:http;var _0x5da4cf={'host':_0x1614c1['host'],'path':_0x1614c1['path'],'headers':{'user-agent':'WHAT_EVER'}};_0xa3195c[_0x7e74('0x13')](_0x5da4cf,function(_0x40c6de){if(_0x40c6de[_0x7e74('0x14')]!==0xc8){logger['error']('request\x20to\x20'+_0x3d662f+_0x7e74('0x15')+_0x40c6de[_0x7e74('0x14')]+'\x20('+_0x40c6de[_0x7e74('0x16')]+')');_0x1c70e0(new Error(_0x7e74('0x17')+_0x3d662f+_0x7e74('0x15')+_0x40c6de['statusCode']+'\x20('+_0x40c6de[_0x7e74('0x16')]+')'));return;}var _0x1dfea3=fs[_0x7e74('0x18')](_0x3bdcf9);_0x1dfea3['on'](_0x7e74('0x19'),function(){logger[_0x7e74('0x1a')](_0x7e74('0x1b'));_0x1dfea3[_0x7e74('0x1c')](_0x39f65b);});_0x1dfea3['on'](_0x7e74('0x1d'),function(_0x5370ca){fs[_0x7e74('0x1e')](_0x3bdcf9);logger[_0x7e74('0x1d')](_0x7e74('0x1f'),_0x5370ca);_0x1c70e0(_0x5370ca);});_0x40c6de[_0x7e74('0x20')](_0x1dfea3);})['on'](_0x7e74('0x1d'),function(_0x4614df){logger[_0x7e74('0x1d')](_0x4614df);_0x1c70e0(_0x4614df);})[_0x7e74('0x21')]();});}function uploadFile(_0x3e89ad){return new BPromise(function(_0x454e6d,_0x1d9afb){var _0x4483ad=urlParse(_0x3e89ad);var _0xc33932=_0x4483ad[_0x7e74('0x11')]==='https:'?https:http;var _0x27002b={'host':_0x4483ad[_0x7e74('0x22')],'path':_0x4483ad[_0x7e74('0x4')],'headers':{'user-agent':_0x7e74('0x23')}};_0xc33932[_0x7e74('0x13')](_0x27002b,function(_0x2a2503){if(_0x2a2503[_0x7e74('0x14')]!==0xc8){_0x1d9afb(new Error(_0x7e74('0x17')+_0x3e89ad+_0x7e74('0x15')+_0x2a2503[_0x7e74('0x14')]+'\x20('+_0x2a2503[_0x7e74('0x16')]+')'));return;}var _0x10ef43='';_0x2a2503['on'](_0x7e74('0x24'),function(_0x4109b4){_0x10ef43+=_0x4109b4;});_0x2a2503['on'](_0x7e74('0x21'),function(){_0x454e6d(_0x10ef43);});})['on']('error',function(_0x1ea226){_0x1d9afb(_0x1ea226);})['end']();});}function convertFile(_0x16d8b1,_0x32997a){return new BPromise(function(_0x1e2f81,_0x572ffd){var _0x28a6c0=sox[_0x7e74('0x25')](_0x16d8b1,_0x32997a,{'sampleRate':0x1f40,'format':_0x7e74('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x28a6c0['on'](_0x7e74('0x1d'),function(_0x27eae2){logger[_0x7e74('0x1d')](_0x7e74('0x27'),_0x27eae2);_0x572ffd(_0x27eae2);});_0x28a6c0['on'](_0x7e74('0x21'),function(){logger[_0x7e74('0x1a')](_0x7e74('0x28'));_0x1e2f81();});_0x28a6c0['start']();});}function base64Decode(_0xb43b29,_0x1baf25){var _0x1610f1=path['resolve'](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+'.wav');fs[_0x7e74('0x2b')](_0x1610f1,_0xb43b29,_0x7e74('0x2c'));return convertFile(_0x1610f1,_0x1baf25)[_0x7e74('0x2d')](function(){try{fs[_0x7e74('0x1e')](_0x1610f1);fs[_0x7e74('0x2e')](_0x1baf25,_0x7e74('0x2f'));}catch(_0x354fe8){logger[_0x7e74('0x1d')](_0x354fe8);}return _0x1baf25['split']('.')[0x0];});}function base64Encode(_0x1fee14){var _0x4d4e99=fs[_0x7e74('0x30')](_0x1fee14);return new Buffer(_0x4d4e99)['toString'](_0x7e74('0x2c'));}exports['googleCloudTTS']=function(_0x1784d9,_0x19cb5c,_0x58adc8,_0x278e57,_0x200e75,_0x3415d6){var _0x3bfd74,_0x5db2cd;var _0x391141=_0x7e74('0x31');var _0x2a6547=_0x7e74('0x32')+_0x1784d9;var _0xb7da09={};if(_0x19cb5c===_0x7e74('0x33')){_0xb7da09[_0x7e74('0x34')]={'ssml':_0x58adc8};}else{_0xb7da09[_0x7e74('0x34')]={'text':_0x58adc8};};_0xb7da09['voice']={'languageCode':_0x278e57,'ssmlGender':_0x200e75};_0xb7da09[_0x7e74('0x35')]={'audioEncoding':_0x7e74('0x36'),'sampleRateHertz':0x1f40};var _0x153ce6={'url':_0x391141+_0x7e74('0x37')+_0x2a6547,'method':_0x7e74('0x38'),'json':!![],'body':_0xb7da09};return rp(_0x153ce6)[_0x7e74('0x2d')](function(_0x15f084){return new BPromise(function(_0x57e5d3,_0x505882){_0x3bfd74=path[_0x7e74('0x39')](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+_0x7e74('0x3a'));var _0x36efff=Buffer[_0x7e74('0x3b')](_0x15f084[_0x7e74('0x3c')],'base64');return fs[_0x7e74('0x3d')](_0x3bfd74,_0x36efff,function(_0x1091b7){_0x505882(_0x1091b7);},function(_0x471c86){fs[_0x7e74('0x2e')](_0x3bfd74,'777');_0x57e5d3(_0x471c86);});});})[_0x7e74('0x2d')](function(_0x5655ce){_0x5db2cd=path['resolve'](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+_0x7e74('0x3e'));return convertFile(_0x3bfd74,_0x5db2cd);})['then'](function(){try{fs['unlink'](_0x3bfd74);fs[_0x7e74('0x2e')](_0x5db2cd,_0x7e74('0x2f'));}catch(_0x3b9267){logger['error'](_0x3b9267);}logger[_0x7e74('0x1a')](_0x7e74('0x3f'),_0x5db2cd[_0x7e74('0x40')]('.')[0x0]);return _0x5db2cd[_0x7e74('0x40')]('.')[0x0];});};exports[_0x7e74('0x41')]=function(_0x429d4b,_0x29d8ca){var _0x2cba24=_0x7e74('0x42');var _0xdd262a,_0x243641;var _0x3f2cba;var _0x2ac3db={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x2cba24,'headers':{'Content-Type':_0x7e74('0x43')},'body':_0x7e74('0x44')+encodeURIComponent(JSON[_0x7e74('0x45')]([[[_0x7e74('0x46'),JSON['stringify']([_0x429d4b,_0x29d8ca||'en',![],_0x7e74('0x47')]),null,_0x7e74('0x48')]]]))};return rp(_0x2ac3db)[_0x7e74('0x2d')](function(_0x5df9d6){try{_0x3f2cba=eval(_0x5df9d6[_0x7e74('0x49')](0x5))[0x0][0x2];}catch(_0x2be509){throw new Error(_0x7e74('0x4a')+_0x5df9d6[_0x7e74('0x24')]);}if(!_0x3f2cba){if(_0x429d4b[_0x7e74('0x4b')]>0xc8){throw new Error(_0x7e74('0x4c'));}else{throw new Error(_0x7e74('0x4d')+_0x29d8ca+_0x7e74('0x4e'));}}try{_0x3f2cba=eval(_0x3f2cba)[0x0];}catch(_0x20f9b4){throw new Error(_0x7e74('0x4a')+res[_0x7e74('0x24')]);}const _0x1ac35c=_0x3f2cba;_0xdd262a=path['resolve'](__dirname,'tmp',rs[_0x7e74('0x2a')](0x4)+_0x7e74('0x3a'));fs[_0x7e74('0x2b')](_0xdd262a,_0x3f2cba,{'encoding':_0x7e74('0x2c')});_0x243641=path[_0x7e74('0x39')](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+_0x7e74('0x3e'));return convertFile(_0xdd262a,_0x243641);})['then'](function(){try{fs[_0x7e74('0x1e')](_0xdd262a);fs[_0x7e74('0x2e')](_0x243641,_0x7e74('0x2f'));}catch(_0x140824){logger[_0x7e74('0x1d')](_0x140824);}logger[_0x7e74('0x1a')]('goggleTTS\x20path',_0x243641['split']('.')[0x0]);return _0x243641[_0x7e74('0x40')]('.')[0x0];});};exports[_0x7e74('0x4f')]=function(_0x19e9c6,_0x14afd8,_0x26a336){return google[_0x7e74('0x50')](_0x19e9c6,_0x14afd8,_0x26a336)['then'](function(_0x509bc9){logger[_0x7e74('0x1a')](_0x509bc9[_0x7e74('0x51')]);return rp(_0x509bc9);})[_0x7e74('0x2d')](function(_0x19571e){var _0x5703dc='';var _0xbf64d9=0x0;try{fs[_0x7e74('0x1e')](_0x19e9c6);}catch(_0x219f82){logger[_0x7e74('0x1d')](_0x219f82);}if(_0x19571e&&_0x19571e['results']){_0x5703dc=_0x19571e[_0x7e74('0x52')][_0x7e74('0x53')](function(_0x38f5a5){return _0x38f5a5&&_0x38f5a5['alternatives'][0x0]&&_0x38f5a5[_0x7e74('0x54')][0x0]['transcript']?_0x38f5a5[_0x7e74('0x54')][0x0]['transcript']:'';})['join']('\x0a');_0xbf64d9=_0x19571e[_0x7e74('0x52')][_0x7e74('0x53')](function(_0x4c047f){return _0x4c047f&&_0x4c047f[_0x7e74('0x54')][0x0]&&_0x4c047f[_0x7e74('0x54')][0x0][_0x7e74('0x55')]?_0x4c047f[_0x7e74('0x54')][0x0][_0x7e74('0x55')]:0x0;})[_0x7e74('0x56')]('\x0a');}logger['info'](_0x7e74('0x57'),_0x5703dc);logger[_0x7e74('0x1a')](_0x7e74('0x58'),_0xbf64d9);return{'transcript':_0x5703dc,'confidence':_0xbf64d9};})[_0x7e74('0x59')](function(_0x377f7f){logger[_0x7e74('0x1d')](_0x7e74('0x5a'),_0x377f7f[_0x7e74('0x14')],_0x377f7f[_0x7e74('0x5b')],_0x377f7f[_0x7e74('0x5c')]);});};exports[_0x7e74('0x5d')]=function(_0x2ede25,_0x1d8d5b,_0x7b3d91,_0x25eeb9){var _0x2c8d61=apiai(_0x1d8d5b,{'language':_0x25eeb9||'en'});return _0x2c8d61['textRequest'](_0x7b3d91,{'sessionId':md5(_0x2ede25)})[_0x7e74('0x2d')](function(_0x1cbd1b){logger['info'](JSON[_0x7e74('0x45')](_0x1cbd1b));return{'source':_0x1cbd1b[_0x7e74('0x5e')][_0x7e74('0x5f')],'resolvedQuery':_0x1cbd1b[_0x7e74('0x5e')][_0x7e74('0x60')],'action':_0x1cbd1b[_0x7e74('0x5e')][_0x7e74('0x61')],'actionIncomplete':_0x1cbd1b[_0x7e74('0x5e')]['actionIncomplete'],'speech':_0x1cbd1b['result'][_0x7e74('0x62')][_0x7e74('0x63')],'score':_0x1cbd1b[_0x7e74('0x5e')][_0x7e74('0x64')],'statusCode':_0x1cbd1b[_0x7e74('0x65')][_0x7e74('0x66')],'endConversation':_0x1cbd1b[_0x7e74('0x5e')][_0x7e74('0x67')][_0x7e74('0x68')]||![],'isFallbackIntent':_0x1cbd1b[_0x7e74('0x5e')][_0x7e74('0x67')][_0x7e74('0x69')]};});};exports[_0x7e74('0x6a')]=function(_0x27d331,_0x1660be,_0x275786,_0x4985b5,_0x571af6,_0x2b37b9){var _0x1a93d5=_0x4985b5[_0x7e74('0x6b')](/\\n/g,'\x0a');var _0x2fe08a={'credentials':{'private_key':_0x1a93d5,'client_email':_0x275786}};var _0x50714b=new dialogflow['SessionsClient'](_0x2fe08a);var _0x4c9551=_0x50714b['sessionPath'](_0x1660be,md5(_0x27d331));var _0xc79d22={'session':_0x4c9551,'queryInput':{'text':{'text':_0x571af6,'languageCode':_0x2b37b9}}};return _0x50714b['detectIntent'](_0xc79d22)[_0x7e74('0x2d')](function(_0x3c8b97){if(_0x3c8b97&&_0x3c8b97[_0x7e74('0x4b')]){logger[_0x7e74('0x1a')](_0x7e74('0x6c'),JSON[_0x7e74('0x45')](_0x3c8b97));var _0x519703=_0x3c8b97[0x0];if(_0x519703){var _0x5ae3c2={'action':_0x519703[_0x7e74('0x6d')][_0x7e74('0x61')],'allRequiredParamsPresent':_0x519703['queryResult']['allRequiredParamsPresent'],'endConversation':_0x519703[_0x7e74('0x6d')][_0x7e74('0x6e')]&&_0x519703[_0x7e74('0x6d')][_0x7e74('0x6e')]['fields']?_0x519703[_0x7e74('0x6d')]['diagnosticInfo'][_0x7e74('0x6f')][_0x7e74('0x70')]['boolValue']:![],'fulfillmentText':_0x519703[_0x7e74('0x6d')][_0x7e74('0x71')],'intentName':_0x519703[_0x7e74('0x6d')]['intent'][_0x7e74('0x5b')],'intentDisplayName':_0x519703['queryResult'][_0x7e74('0x72')][_0x7e74('0x73')],'isFallbackIntent':_0x519703['queryResult'][_0x7e74('0x72')][_0x7e74('0x74')],'languageCode':_0x519703[_0x7e74('0x6d')][_0x7e74('0x75')],'queryText':_0x519703[_0x7e74('0x6d')]['queryText'],'responseId':_0x519703[_0x7e74('0x76')],'score':_0x519703[_0x7e74('0x6d')]['intentDetectionConfidence'],'speech':_0x519703[_0x7e74('0x6d')]['fulfillmentText'],'providerResponse':JSON[_0x7e74('0x45')](_0x3c8b97)};return _0x5ae3c2;}}});};exports[_0x7e74('0x77')]=function(_0x52fa71,_0x5ddbc0,_0x367124,_0x5315ac){return tilde[_0x7e74('0x50')](_0x52fa71,_0x5ddbc0,_0x367124,_0x5315ac)[_0x7e74('0x2d')](function(_0x2ef4da){try{fs['unlink'](_0x52fa71);}catch(_0x2445de){logger[_0x7e74('0x1d')](_0x2445de);}logger[_0x7e74('0x1a')](_0x7e74('0x78'),_0x2ef4da[_0x7e74('0x79')]);logger[_0x7e74('0x1a')](_0x7e74('0x7a'),_0x2ef4da[_0x7e74('0x55')]);return _0x2ef4da;});};exports[_0x7e74('0x7b')]=function(_0x2e9162,_0x2ff01b,_0x2906e1,_0x1a9cb5,_0x15e71a,_0x4a777e){var _0x1d6774=path[_0x7e74('0x39')](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+'.mp3');var _0x35e201;return aws[_0x7e74('0x7c')](_0x2e9162,_0x2ff01b,_0x2906e1,_0x1a9cb5,_0x15e71a,_0x4a777e,_0x1d6774)[_0x7e74('0x2d')](function(){_0x35e201=path[_0x7e74('0x39')](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+_0x7e74('0x3e'));return convertFile(_0x1d6774,_0x35e201);})[_0x7e74('0x2d')](function(){try{fs[_0x7e74('0x1e')](_0x1d6774);fs['chmodSync'](_0x35e201,_0x7e74('0x2f'));}catch(_0x112fc6){logger[_0x7e74('0x1d')](_0x112fc6);}return _0x35e201[_0x7e74('0x40')]('.')[0x0];});};exports[_0x7e74('0x7d')]=function(_0x2874bf,_0x4ef86d,_0x40b50d,_0x1b55f8,_0x495d84,_0x3d17ff){return aws['lex'](_0x2874bf,_0x4ef86d,_0x40b50d,_0x1b55f8,_0x495d84,_0x3d17ff)[_0x7e74('0x2d')](function(_0x24b276){logger[_0x7e74('0x1a')](JSON[_0x7e74('0x45')](_0x24b276));return _0x24b276;});};exports[_0x7e74('0x7e')]=function(_0x3c6700,_0x286a33,_0x10a971,_0x10ebe4){var _0x24a7ab=util['format'](_0x7e74('0x7f'),ISPEECH_API,_0x3c6700,encodeURIComponent(_0x286a33),_0x10a971,_0x10ebe4);var _0x88c25a=path[_0x7e74('0x39')](__dirname,_0x7e74('0x29'),rs[_0x7e74('0x2a')](0x4)+'.mp3');var _0x3c9431;return downloadFile(_0x24a7ab,_0x88c25a)[_0x7e74('0x2d')](function(){_0x3c9431=path[_0x7e74('0x39')](__dirname,'tmp',rs[_0x7e74('0x2a')](0x4)+'.wav');return convertFile(_0x88c25a,_0x3c9431);})[_0x7e74('0x2d')](function(){try{fs['unlink'](_0x88c25a);fs[_0x7e74('0x2e')](_0x3c9431,'777');}catch(_0x2e030f){logger[_0x7e74('0x1d')](_0x2e030f);}return _0x3c9431['split']('.')[0x0];});};exports['ispeechASR']=function(_0x75389b,_0x2e86a8,_0x57e9ee,_0x56c4b2){var _0x1f42b6=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2e86a8,_0x57e9ee,base64Encode(_0x75389b),_0x56c4b2?util['format'](_0x7e74('0x80'),encodeURIComponent(_0x56c4b2)):_0x7e74('0x81'));return uploadFile(_0x1f42b6)['then'](function(_0x293d13){return querystring[_0x7e74('0xa')](_0x293d13);});};exports[_0x7e74('0x82')]=function(_0x7fbda3,_0x3d8c96){return sestek[_0x7e74('0x83')](_0x7fbda3,_0x3d8c96)['then'](function(_0x3bfbf1){logger[_0x7e74('0x1a')](JSON[_0x7e74('0x45')](_0x3bfbf1));var _0x2ae246={'speech':_0x3bfbf1[_0x7e74('0x84')],'action':_0x3bfbf1[_0x7e74('0x85')]?_0x3bfbf1['channelData'][_0x7e74('0x86')]:undefined,'actiondata':_0x3bfbf1[_0x7e74('0x85')]?_0x3bfbf1[_0x7e74('0x85')][_0x7e74('0x87')]:undefined};if(_0x3bfbf1[_0x7e74('0x85')]&&_0x3bfbf1[_0x7e74('0x85')][_0x7e74('0x88')]){return base64Decode(_0x3bfbf1[_0x7e74('0x85')][_0x7e74('0x88')][_0x7e74('0x89')],path[_0x7e74('0x39')](__dirname,'tmp',rs['generate'](0x4)+'.wav'))['then'](function(_0x69adb8){_0x2ae246[_0x7e74('0x8a')]=_0x69adb8;return _0x2ae246;});}return _0x2ae246;});};exports[_0x7e74('0x8b')]=function(){return __dirname;}; \ No newline at end of file +var _0x52b4=['join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','apiai-promise','bluebird','https','md5','querystring','request-promise','randomstring','sox','url','parse','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','wav','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','writeFile','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','text\x20length\x20limit\x20reached','lang\x20\x22','uri','results','map','alternatives','transcript'];(function(_0xf72786,_0x1a0ddd){var _0x113f3e=function(_0x57337a){while(--_0x57337a){_0xf72786['push'](_0xf72786['shift']());}};_0x113f3e(++_0x1a0ddd);}(_0x52b4,0x13e));var _0x452b=function(_0x50ce9c,_0x38410c){_0x50ce9c=_0x50ce9c-0x0;var _0x4ea4c2=_0x52b4[_0x50ce9c];return _0x4ea4c2;};'use strict';var apiai=require(_0x452b('0x0'));var BPromise=require(_0x452b('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x452b('0x2'));var md5=require(_0x452b('0x3'));var path=require('path');var querystring=require(_0x452b('0x4'));var rp=require(_0x452b('0x5'));var rs=require(_0x452b('0x6'));var sox=require(_0x452b('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x452b('0x8'))[_0x452b('0x9')];var util=require('util');var aws=require(_0x452b('0xa'));var google=require('./google');var sestek=require(_0x452b('0xb'));var tilde=require('./tilde');var logger=require(_0x452b('0xc'))(_0x452b('0xd'));var ISPEECH_API=_0x452b('0xe');function downloadFile(_0x311f55,_0x1c1d24){return new BPromise(function(_0x5a8d02,_0x57019d){var _0x639878=urlParse(_0x311f55);var _0x14974f=_0x639878[_0x452b('0xf')]===_0x452b('0x10')?https:http;var _0x189938={'host':_0x639878[_0x452b('0x11')],'path':_0x639878[_0x452b('0x12')],'headers':{'user-agent':'WHAT_EVER'}};_0x14974f[_0x452b('0x13')](_0x189938,function(_0x1f91e8){if(_0x1f91e8[_0x452b('0x14')]!==0xc8){logger['error'](_0x452b('0x15')+_0x311f55+_0x452b('0x16')+_0x1f91e8[_0x452b('0x14')]+'\x20('+_0x1f91e8[_0x452b('0x17')]+')');_0x57019d(new Error(_0x452b('0x15')+_0x311f55+_0x452b('0x16')+_0x1f91e8['statusCode']+'\x20('+_0x1f91e8['statusMessage']+')'));return;}var _0x3a7dcd=fs[_0x452b('0x18')](_0x1c1d24);_0x3a7dcd['on']('finish',function(){logger[_0x452b('0x19')](_0x452b('0x1a'));_0x3a7dcd['close'](_0x5a8d02);});_0x3a7dcd['on'](_0x452b('0x1b'),function(_0x16b784){fs[_0x452b('0x1c')](_0x1c1d24);logger['error'](_0x452b('0x1d'),_0x16b784);_0x57019d(_0x16b784);});_0x1f91e8[_0x452b('0x1e')](_0x3a7dcd);})['on'](_0x452b('0x1b'),function(_0x41309b){logger['error'](_0x41309b);_0x57019d(_0x41309b);})['end']();});}function uploadFile(_0x412170){return new BPromise(function(_0x2826f5,_0x4a1c7a){var _0x583980=urlParse(_0x412170);var _0x23b0f3=_0x583980['protocol']===_0x452b('0x10')?https:http;var _0x192e93={'host':_0x583980['host'],'path':_0x583980[_0x452b('0x12')],'headers':{'user-agent':'WHAT_EVER'}};_0x23b0f3[_0x452b('0x13')](_0x192e93,function(_0x388835){if(_0x388835[_0x452b('0x14')]!==0xc8){_0x4a1c7a(new Error('request\x20to\x20'+_0x412170+_0x452b('0x16')+_0x388835['statusCode']+'\x20('+_0x388835[_0x452b('0x17')]+')'));return;}var _0x188097='';_0x388835['on']('data',function(_0x2053ba){_0x188097+=_0x2053ba;});_0x388835['on'](_0x452b('0x1f'),function(){_0x2826f5(_0x188097);});})['on'](_0x452b('0x1b'),function(_0x59d14c){_0x4a1c7a(_0x59d14c);})['end']();});}function convertFile(_0x4c1e33,_0x281e39){return new BPromise(function(_0x9b559a,_0x1fe9cb){var _0x1bd9e7=sox['transcode'](_0x4c1e33,_0x281e39,{'sampleRate':0x1f40,'format':_0x452b('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1bd9e7['on'](_0x452b('0x1b'),function(_0x2fde17){logger[_0x452b('0x1b')]('error\x20convert',_0x2fde17);_0x1fe9cb(_0x2fde17);});_0x1bd9e7['on'](_0x452b('0x1f'),function(){logger[_0x452b('0x19')](_0x452b('0x21'));_0x9b559a();});_0x1bd9e7[_0x452b('0x22')]();});}function base64Decode(_0x2ebf1f,_0x4ef593){var _0x545f90=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs['generate'](0x4)+_0x452b('0x25'));fs[_0x452b('0x26')](_0x545f90,_0x2ebf1f,_0x452b('0x27'));return convertFile(_0x545f90,_0x4ef593)[_0x452b('0x28')](function(){try{fs['unlink'](_0x545f90);fs[_0x452b('0x29')](_0x4ef593,_0x452b('0x2a'));}catch(_0x38aca1){logger[_0x452b('0x1b')](_0x38aca1);}return _0x4ef593[_0x452b('0x2b')]('.')[0x0];});}function base64Encode(_0x511529){var _0x687b6f=fs[_0x452b('0x2c')](_0x511529);return new Buffer(_0x687b6f)[_0x452b('0x2d')]('base64');}exports['googleCloudTTS']=function(_0x3789b0,_0x4cc0d4,_0x7a5204,_0x314bbb,_0x56ba4c,_0x17bb47){var _0x353ea1,_0x5776b2;var _0x303918=_0x452b('0x2e');var _0x5d565c=_0x452b('0x2f')+_0x3789b0;var _0x5205ba={};if(_0x4cc0d4===_0x452b('0x30')){_0x5205ba[_0x452b('0x31')]={'ssml':_0x7a5204};}else{_0x5205ba[_0x452b('0x31')]={'text':_0x7a5204};};_0x5205ba[_0x452b('0x32')]={'languageCode':_0x314bbb,'ssmlGender':_0x56ba4c};_0x5205ba[_0x452b('0x33')]={'audioEncoding':_0x452b('0x34'),'sampleRateHertz':0x1f40};var _0xbcd776={'url':_0x303918+_0x452b('0x35')+_0x5d565c,'method':_0x452b('0x36'),'json':!![],'body':_0x5205ba};return rp(_0xbcd776)[_0x452b('0x28')](function(_0x4ebc4e){return new BPromise(function(_0x436673,_0xfb613f){_0x353ea1=path[_0x452b('0x23')](__dirname,'tmp',rs[_0x452b('0x37')](0x4)+_0x452b('0x38'));var _0x1d12a0=Buffer[_0x452b('0x39')](_0x4ebc4e['audioContent'],_0x452b('0x27'));return fs[_0x452b('0x3a')](_0x353ea1,_0x1d12a0,function(_0x1e7721){_0xfb613f(_0x1e7721);},function(_0x5ca89e){fs['chmodSync'](_0x353ea1,_0x452b('0x2a'));_0x436673(_0x5ca89e);});});})[_0x452b('0x28')](function(_0x315312){_0x5776b2=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs['generate'](0x4)+_0x452b('0x25'));return convertFile(_0x353ea1,_0x5776b2);})[_0x452b('0x28')](function(){try{fs[_0x452b('0x1c')](_0x353ea1);fs[_0x452b('0x29')](_0x5776b2,_0x452b('0x2a'));}catch(_0x42e3af){logger[_0x452b('0x1b')](_0x42e3af);}logger[_0x452b('0x19')](_0x452b('0x3b'),_0x5776b2[_0x452b('0x2b')]('.')[0x0]);return _0x5776b2[_0x452b('0x2b')]('.')[0x0];});};exports['googleTTS']=function(_0x8be087,_0x5a79f0){var _0x2724d5=_0x452b('0x3c');var _0x5be625,_0x2be944;var _0x37d1f3;var _0x146f6a={'encoding':_0x452b('0x3d'),'method':'POST','timeout':0x2710,'url':_0x2724d5,'headers':{'Content-Type':_0x452b('0x3e')},'body':_0x452b('0x3f')+encodeURIComponent(JSON[_0x452b('0x40')]([[[_0x452b('0x41'),JSON['stringify']([_0x8be087,_0x5a79f0||'en',![],_0x452b('0x42')]),null,_0x452b('0x43')]]]))};return rp(_0x146f6a)['then'](function(_0x4a90d1){try{_0x37d1f3=eval(_0x4a90d1[_0x452b('0x44')](0x5))[0x0][0x2];}catch(_0x4e0d29){throw new Error(_0x452b('0x45')+_0x4a90d1[_0x452b('0x46')]);}if(!_0x37d1f3){if(_0x8be087['length']>0xc8){throw new Error(_0x452b('0x47'));}else{throw new Error(_0x452b('0x48')+_0x5a79f0+'\x22\x20might\x20not\x20exist');}}try{_0x37d1f3=eval(_0x37d1f3)[0x0];}catch(_0x10ff4a){throw new Error(_0x452b('0x45')+res[_0x452b('0x46')]);}const _0x1e8919=_0x37d1f3;_0x5be625=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs[_0x452b('0x37')](0x4)+'.mp3');fs[_0x452b('0x26')](_0x5be625,_0x37d1f3,{'encoding':_0x452b('0x27')});_0x2be944=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs['generate'](0x4)+'.wav');return convertFile(_0x5be625,_0x2be944);})[_0x452b('0x28')](function(){try{fs['unlink'](_0x5be625);fs[_0x452b('0x29')](_0x2be944,_0x452b('0x2a'));}catch(_0x5f49c4){logger[_0x452b('0x1b')](_0x5f49c4);}logger['info']('goggleTTS\x20path',_0x2be944[_0x452b('0x2b')]('.')[0x0]);return _0x2be944['split']('.')[0x0];});};exports['googleASR']=function(_0x14a063,_0x2af796,_0x2d6812){return google['asr'](_0x14a063,_0x2af796,_0x2d6812)[_0x452b('0x28')](function(_0x5d3eba){logger['info'](_0x5d3eba[_0x452b('0x49')]);return rp(_0x5d3eba);})[_0x452b('0x28')](function(_0x145d76){var _0x589a42='';var _0x5d0352=0x0;try{fs['unlink'](_0x14a063);}catch(_0xefa1ba){logger[_0x452b('0x1b')](_0xefa1ba);}if(_0x145d76&&_0x145d76[_0x452b('0x4a')]){_0x589a42=_0x145d76[_0x452b('0x4a')][_0x452b('0x4b')](function(_0xa0d6bc){return _0xa0d6bc&&_0xa0d6bc['alternatives'][0x0]&&_0xa0d6bc[_0x452b('0x4c')][0x0][_0x452b('0x4d')]?_0xa0d6bc[_0x452b('0x4c')][0x0]['transcript']:'';})[_0x452b('0x4e')]('\x0a');_0x5d0352=_0x145d76['results'][_0x452b('0x4b')](function(_0x2de01d){return _0x2de01d&&_0x2de01d[_0x452b('0x4c')][0x0]&&_0x2de01d[_0x452b('0x4c')][0x0][_0x452b('0x4f')]?_0x2de01d['alternatives'][0x0][_0x452b('0x4f')]:0x0;})[_0x452b('0x4e')]('\x0a');}logger[_0x452b('0x19')](_0x452b('0x50'),_0x589a42);logger['info'](_0x452b('0x51'),_0x5d0352);return{'transcript':_0x589a42,'confidence':_0x5d0352};})[_0x452b('0x52')](function(_0x59e838){logger[_0x452b('0x1b')](_0x452b('0x53'),_0x59e838[_0x452b('0x14')],_0x59e838['name'],_0x59e838['message']);});};exports[_0x452b('0x54')]=function(_0x2c0960,_0x53b4d1,_0x439b54,_0x24cbfd){var _0x60f9c1=apiai(_0x53b4d1,{'language':_0x24cbfd||'en'});return _0x60f9c1['textRequest'](_0x439b54,{'sessionId':md5(_0x2c0960)})['then'](function(_0x3a53e2){logger[_0x452b('0x19')](JSON[_0x452b('0x40')](_0x3a53e2));return{'source':_0x3a53e2[_0x452b('0x55')][_0x452b('0x56')],'resolvedQuery':_0x3a53e2['result'][_0x452b('0x57')],'action':_0x3a53e2[_0x452b('0x55')][_0x452b('0x58')],'actionIncomplete':_0x3a53e2[_0x452b('0x55')][_0x452b('0x59')],'speech':_0x3a53e2['result'][_0x452b('0x5a')][_0x452b('0x5b')],'score':_0x3a53e2['result'][_0x452b('0x5c')],'statusCode':_0x3a53e2[_0x452b('0x5d')]['code'],'endConversation':_0x3a53e2['result'][_0x452b('0x5e')][_0x452b('0x5f')]||![],'isFallbackIntent':_0x3a53e2[_0x452b('0x55')]['metadata']['isFallbackIntent']};});};exports[_0x452b('0x60')]=function(_0x40d6d2,_0x1cbeed,_0x417bd1,_0x5f2a69,_0x19be11,_0x450e45){var _0x2f2942=_0x5f2a69[_0x452b('0x61')](/\\n/g,'\x0a');var _0x57cd58={'credentials':{'private_key':_0x2f2942,'client_email':_0x417bd1}};var _0xe8a275=new dialogflow[(_0x452b('0x62'))](_0x57cd58);var _0x3e2ed7=_0xe8a275[_0x452b('0x63')](_0x1cbeed,md5(_0x40d6d2));var _0x487996={'session':_0x3e2ed7,'queryInput':{'text':{'text':_0x19be11,'languageCode':_0x450e45}}};return _0xe8a275[_0x452b('0x64')](_0x487996)['then'](function(_0x1fbec7){if(_0x1fbec7&&_0x1fbec7['length']){logger[_0x452b('0x19')](_0x452b('0x65'),JSON[_0x452b('0x40')](_0x1fbec7));var _0x35e0bc=_0x1fbec7[0x0];if(_0x35e0bc){var _0x19366e={'action':_0x35e0bc[_0x452b('0x66')][_0x452b('0x58')],'allRequiredParamsPresent':_0x35e0bc[_0x452b('0x66')][_0x452b('0x67')],'endConversation':_0x35e0bc['queryResult']['diagnosticInfo']&&_0x35e0bc[_0x452b('0x66')][_0x452b('0x68')][_0x452b('0x69')]?_0x35e0bc[_0x452b('0x66')]['diagnosticInfo'][_0x452b('0x69')]['end_conversation'][_0x452b('0x6a')]:![],'fulfillmentText':_0x35e0bc[_0x452b('0x66')][_0x452b('0x6b')],'intentName':_0x35e0bc['queryResult'][_0x452b('0x6c')]['name'],'intentDisplayName':_0x35e0bc[_0x452b('0x66')][_0x452b('0x6c')][_0x452b('0x6d')],'isFallbackIntent':_0x35e0bc[_0x452b('0x66')][_0x452b('0x6c')]['isFallback'],'languageCode':_0x35e0bc[_0x452b('0x66')]['languageCode'],'queryText':_0x35e0bc[_0x452b('0x66')]['queryText'],'responseId':_0x35e0bc[_0x452b('0x6e')],'score':_0x35e0bc[_0x452b('0x66')][_0x452b('0x6f')],'speech':_0x35e0bc[_0x452b('0x66')][_0x452b('0x6b')],'providerResponse':JSON[_0x452b('0x40')](_0x1fbec7)};return _0x19366e;}}});};exports['tildeASR']=function(_0x5cf979,_0x21622f,_0x482463,_0x58e473){return tilde[_0x452b('0x70')](_0x5cf979,_0x21622f,_0x482463,_0x58e473)[_0x452b('0x28')](function(_0x39c902){try{fs[_0x452b('0x1c')](_0x5cf979);}catch(_0x1a2777){logger[_0x452b('0x1b')](_0x1a2777);}logger[_0x452b('0x19')](_0x452b('0x71'),_0x39c902[_0x452b('0x4d')]);logger[_0x452b('0x19')](_0x452b('0x72'),_0x39c902[_0x452b('0x4f')]);return _0x39c902;});};exports[_0x452b('0x73')]=function(_0x5b42ab,_0x2190d5,_0x14b6a0,_0x47b6c1,_0x4cf987,_0x46be6f){var _0x1693b5=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs[_0x452b('0x37')](0x4)+_0x452b('0x38'));var _0x5e9c03;return aws[_0x452b('0x74')](_0x5b42ab,_0x2190d5,_0x14b6a0,_0x47b6c1,_0x4cf987,_0x46be6f,_0x1693b5)[_0x452b('0x28')](function(){_0x5e9c03=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs[_0x452b('0x37')](0x4)+_0x452b('0x25'));return convertFile(_0x1693b5,_0x5e9c03);})['then'](function(){try{fs['unlink'](_0x1693b5);fs['chmodSync'](_0x5e9c03,'777');}catch(_0x14a228){logger[_0x452b('0x1b')](_0x14a228);}return _0x5e9c03[_0x452b('0x2b')]('.')[0x0];});};exports[_0x452b('0x75')]=function(_0x490d8b,_0x59afa9,_0x411759,_0x8e365c,_0x42ab5f,_0x2dbe7b){return aws[_0x452b('0x76')](_0x490d8b,_0x59afa9,_0x411759,_0x8e365c,_0x42ab5f,_0x2dbe7b)[_0x452b('0x28')](function(_0x587bce){logger[_0x452b('0x19')](JSON[_0x452b('0x40')](_0x587bce));return _0x587bce;});};exports[_0x452b('0x77')]=function(_0x18eaa3,_0xf739ab,_0x4a350d,_0x476517){var _0x2295ee=util['format'](_0x452b('0x78'),ISPEECH_API,_0x18eaa3,encodeURIComponent(_0xf739ab),_0x4a350d,_0x476517);var _0xcb713a=path[_0x452b('0x23')](__dirname,_0x452b('0x24'),rs[_0x452b('0x37')](0x4)+_0x452b('0x38'));var _0xdf7e35;return downloadFile(_0x2295ee,_0xcb713a)[_0x452b('0x28')](function(){_0xdf7e35=path['resolve'](__dirname,_0x452b('0x24'),rs[_0x452b('0x37')](0x4)+_0x452b('0x25'));return convertFile(_0xcb713a,_0xdf7e35);})[_0x452b('0x28')](function(){try{fs['unlink'](_0xcb713a);fs[_0x452b('0x29')](_0xdf7e35,_0x452b('0x2a'));}catch(_0x5a6228){logger[_0x452b('0x1b')](_0x5a6228);}return _0xdf7e35[_0x452b('0x2b')]('.')[0x0];});};exports[_0x452b('0x79')]=function(_0x83adaf,_0x50434b,_0x2230f1,_0x522103){var _0x3c1731=util[_0x452b('0x7a')](_0x452b('0x7b'),ISPEECH_API,_0x50434b,_0x2230f1,base64Encode(_0x83adaf),_0x522103?util['format'](_0x452b('0x7c'),encodeURIComponent(_0x522103)):'freeform=3');return uploadFile(_0x3c1731)[_0x452b('0x28')](function(_0x40648e){return querystring[_0x452b('0x9')](_0x40648e);});};exports[_0x452b('0x7d')]=function(_0x203cc4,_0x4d3169){return sestek[_0x452b('0x7e')](_0x203cc4,_0x4d3169)[_0x452b('0x28')](function(_0x1658c8){logger['info'](JSON['stringify'](_0x1658c8));var _0x41636c={'speech':_0x1658c8['text'],'action':_0x1658c8[_0x452b('0x7f')]?_0x1658c8['channelData'][_0x452b('0x80')]:undefined,'actiondata':_0x1658c8[_0x452b('0x7f')]?_0x1658c8[_0x452b('0x7f')]['CustomActionData']:undefined};if(_0x1658c8[_0x452b('0x7f')]&&_0x1658c8[_0x452b('0x7f')][_0x452b('0x81')]){return base64Decode(_0x1658c8[_0x452b('0x7f')][_0x452b('0x81')][_0x452b('0x82')],path[_0x452b('0x23')](__dirname,'tmp',rs[_0x452b('0x37')](0x4)+'.wav'))[_0x452b('0x28')](function(_0x594d8d){_0x41636c[_0x452b('0x83')]=_0x594d8d;return _0x41636c;});}return _0x41636c;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 966893f..ac6140c 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 _0xf537=['./nda','exports'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0xf537,0xf6));var _0x7f53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf537[_0x3dd15e];return _0x231fd0;};var nda=require(_0x7f53('0x0'));module[_0x7f53('0x1')]={'nda':nda}; \ No newline at end of file +var _0xea8d=['exports','./nda'];(function(_0x3db7a6,_0x4f91f2){var _0x264012=function(_0x45425f){while(--_0x45425f){_0x3db7a6['push'](_0x3db7a6['shift']());}};_0x264012(++_0x4f91f2);}(_0xea8d,0x1f3));var _0xdea8=function(_0x3c23d3,_0x33b64f){_0x3c23d3=_0x3c23d3-0x0;var _0x40a8e8=_0xea8d[_0x3c23d3];return _0x40a8e8;};var nda=require(_0xdea8('0x0'));module[_0xdea8('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 4c0f0d9..064b16b 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 _0x0647=['CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio'];(function(_0x44bef2,_0x4e3bd6){var _0x56d832=function(_0x301651){while(--_0x301651){_0x44bef2['push'](_0x44bef2['shift']());}};_0x56d832(++_0x4e3bd6);}(_0x0647,0xd0));var _0x7064=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x0647[_0x1beef3];return _0x5af964;};'use strict';var rp=require(_0x7064('0x0'));var url=require('url');var logger=require(_0x7064('0x1'))(_0x7064('0x2'));module[_0x7064('0x3')]=function(_0x11f1b5,_0x38dadf){var _0x5e8659={'method':'POST','uri':url[_0x7064('0x4')](_0x38dadf[_0x7064('0x5')],_0x7064('0x6')),'form':{'grant_type':_0x7064('0x7'),'username':_0x38dadf[_0x7064('0x8')],'password':_0x38dadf[_0x7064('0x7')]},'json':!![]};return rp(_0x5e8659)['then'](function(_0x536336){var _0x1c85b1={'method':_0x7064('0x9'),'uri':url[_0x7064('0x4')](_0x38dadf['ndassistant_url'],_0x7064('0xa')),'body':{'type':_0x38dadf[_0x7064('0xb')]||'message','channelId':_0x7064('0xc'),'conversation':{'id':_0x11f1b5[_0x7064('0xd')]},'from':{'id':_0x11f1b5[_0x7064('0xe')],'name':_0x11f1b5['calleridname']},'recipient':{'id':_0x11f1b5[_0x7064('0xf')],'name':_0x11f1b5[_0x7064('0x10')]},'text':_0x38dadf[_0x7064('0x11')],'channelData':{}},'headers':{'Authorization':_0x7064('0x12')+_0x536336['access_token']},'json':!![]};if(_0x38dadf[_0x7064('0x13')]){_0x1c85b1[_0x7064('0x14')][_0x7064('0x15')][_0x7064('0x16')]=_0x38dadf[_0x7064('0x13')];}if(_0x38dadf[_0x7064('0x17')]=='1'){_0x1c85b1[_0x7064('0x14')][_0x7064('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x38dadf['custom_action']){_0x1c85b1[_0x7064('0x14')][_0x7064('0x15')][_0x7064('0x18')]=_0x38dadf['custom_action'];if(_0x38dadf[_0x7064('0x19')]){_0x1c85b1[_0x7064('0x14')]['channelData'][_0x7064('0x1a')]=_0x38dadf[_0x7064('0x19')];}}logger[_0x7064('0x1b')](JSON[_0x7064('0x1c')](_0x1c85b1));return rp(_0x1c85b1);});}; \ No newline at end of file +var _0x3aa2=['body','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','stringify','request-promise','url','agi','resolve','/token','password','then','POST','ndassistant_url','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','channelData','ProjectName','project','ndagenerate_audio'];(function(_0x459f71,_0x1a4955){var _0x4be7d8=function(_0x17d2da){while(--_0x17d2da){_0x459f71['push'](_0x459f71['shift']());}};_0x4be7d8(++_0x1a4955);}(_0x3aa2,0x13b));var _0x23aa=function(_0x23a12d,_0x4171f2){_0x23a12d=_0x23a12d-0x0;var _0x136b63=_0x3aa2[_0x23a12d];return _0x136b63;};'use strict';var rp=require(_0x23aa('0x0'));var url=require(_0x23aa('0x1'));var logger=require('../../../../../config/logger')(_0x23aa('0x2'));module['exports']=function(_0x598305,_0x2cbb06){var _0x2c4f54={'method':'POST','uri':url[_0x23aa('0x3')](_0x2cbb06['ndauth_url'],_0x23aa('0x4')),'form':{'grant_type':_0x23aa('0x5'),'username':_0x2cbb06['username'],'password':_0x2cbb06[_0x23aa('0x5')]},'json':!![]};return rp(_0x2c4f54)[_0x23aa('0x6')](function(_0x31e9e4){var _0x5f3efd={'method':_0x23aa('0x7'),'uri':url[_0x23aa('0x3')](_0x2cbb06[_0x23aa('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x2cbb06['ndaactivity_type']||_0x23aa('0x9'),'channelId':'Nda','conversation':{'id':_0x598305[_0x23aa('0xa')]},'from':{'id':_0x598305[_0x23aa('0xb')],'name':_0x598305[_0x23aa('0xc')]},'recipient':{'id':_0x598305[_0x23aa('0xd')],'name':_0x598305[_0x23aa('0xe')]},'text':_0x2cbb06[_0x23aa('0xf')],'channelData':{}},'headers':{'Authorization':_0x23aa('0x10')+_0x31e9e4['access_token']},'json':!![]};if(_0x2cbb06['project']){_0x5f3efd['body'][_0x23aa('0x11')][_0x23aa('0x12')]=_0x2cbb06[_0x23aa('0x13')];}if(_0x2cbb06[_0x23aa('0x14')]=='1'){_0x5f3efd[_0x23aa('0x15')][_0x23aa('0x11')][_0x23aa('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x23aa('0x17')};}if(_0x2cbb06['custom_action']){_0x5f3efd[_0x23aa('0x15')]['channelData']['CustomAction']=_0x2cbb06[_0x23aa('0x18')];if(_0x2cbb06[_0x23aa('0x19')]){_0x5f3efd[_0x23aa('0x15')][_0x23aa('0x11')][_0x23aa('0x1a')]=_0x2cbb06[_0x23aa('0x19')];}}logger['info'](JSON[_0x23aa('0x1b')](_0x5f3efd));return rp(_0x5f3efd);});}; \ 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 8dec95b..9cb8b9a 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc94d=['./lib/api','exports'];(function(_0x3bcc27,_0x165b1c){var _0x22fff1=function(_0x44dc99){while(--_0x44dc99){_0x3bcc27['push'](_0x3bcc27['shift']());}};_0x22fff1(++_0x165b1c);}(_0xc94d,0x6e));var _0xdc94=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc94d[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0xdc94('0x0'));module[_0xdc94('0x1')]=function(_0x451db8,_0x388750,_0x517c1e,_0x4c4914){return asr(_0x451db8,_0x388750,_0x517c1e,_0x4c4914);}; \ No newline at end of file +var _0x0dde=['exports','./lib/api'];(function(_0x272a45,_0x4002b2){var _0x5842e4=function(_0x1298e7){while(--_0x1298e7){_0x272a45['push'](_0x272a45['shift']());}};_0x5842e4(++_0x4002b2);}(_0x0dde,0xc5));var _0xe0dd=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x0dde[_0xce6f11];return _0x35b709;};'use strict';var asr=require(_0xe0dd('0x0'));module[_0xe0dd('0x1')]=function(_0x3ac52f,_0x109ff1,_0x2eb0da,_0x4ee600){return asr(_0x3ac52f,_0x109ff1,_0x2eb0da,_0x4ee600);}; \ 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 b93a68b..0aff931 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 _0xdd31=['agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','message','bluebird','lodash','moment','crypto'];(function(_0x5c7c16,_0x35934c){var _0x193422=function(_0x5e6c67){while(--_0x5e6c67){_0x5c7c16['push'](_0x5c7c16['shift']());}};_0x193422(++_0x35934c);}(_0xdd31,0x74));var _0x1dd3=function(_0x4fcadc,_0x998417){_0x4fcadc=_0x4fcadc-0x0;var _0x5032df=_0xdd31[_0x4fcadc];return _0x5032df;};'use strict';var BPromise=require(_0x1dd3('0x0'));var _=require(_0x1dd3('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1dd3('0x2'));var crypto=require(_0x1dd3('0x3'));var logger=require('../../../../../../config/logger')(_0x1dd3('0x4'));module[_0x1dd3('0x5')]=function(_0x44e0ee,_0x31bca0,_0x4d8516,_0x5d24a8){return new BPromise(function(_0x14f4fc,_0x282c02){logger['info'](_0x1dd3('0x6'),_0x5d24a8||_0x1dd3('0x7'));var _0xbe33d8=new WebSocket(_0x5d24a8||_0x1dd3('0x7'),{'perMessageDeflate':![]});var _0xba039c='';var _0x564d07='0';var _0x2f4cf3='1';var _0x43942b=_0x1dd3('0x8');function _0x4b18cb(_0x11ca41){var _0x27be1e=crypto[_0x1dd3('0x9')](_0x1dd3('0xa'));_0x27be1e[_0x1dd3('0xb')](_0x11ca41);return _0x27be1e['digest'](_0x1dd3('0xc'));}function _0x433de7(){try{logger[_0x1dd3('0xd')](_0x1dd3('0xe'));var _0x4e7c67=moment()['unix']();var _0x4b15c6=_0x4b18cb(_0x4e7c67+_0x31bca0+_0x4d8516);_0xbe33d8[_0x1dd3('0xf')](JSON[_0x1dd3('0x10')]({'appID':_0x31bca0,'timestamp':_0x4e7c67,'appKey':_0x4b15c6}));var _0x2bbf8b=fs[_0x1dd3('0x11')](_0x44e0ee);_0x2bbf8b['on'](_0x1dd3('0x12'),function(_0xdfa1f){_0xbe33d8[_0x1dd3('0xf')](_0xdfa1f);});_0x2bbf8b['on'](_0x1dd3('0x13'),function(){_0xbe33d8[_0x1dd3('0xf')](_0x1dd3('0x14'));});}catch(_0x5b9609){logger[_0x1dd3('0x15')](_0x1dd3('0x16'),JSON[_0x1dd3('0x10')](_0x5b9609));_0xbe33d8[_0x1dd3('0x17')]();}}function _0x303f60(_0x28a96d){try{if(_0x28a96d){var _0x5ced57=JSON['parse'](_0x28a96d);switch(_0x5ced57[_0x1dd3('0x18')]){case 0x0:if(_0x5ced57[_0x1dd3('0x19')]){if(_0x5ced57[_0x1dd3('0x19')]['final']){logger[_0x1dd3('0xd')](_0x1dd3('0x1a'),JSON[_0x1dd3('0x10')](_0x5ced57['result'][_0x1dd3('0x1b')]));_0xba039c=_0x5ced57['result'][_0x1dd3('0x1b')][0x0][_0x1dd3('0x1c')];_0x564d07=_0x5ced57[_0x1dd3('0x19')][_0x1dd3('0x1b')][0x0][_0x1dd3('0x1d')];_0x2f4cf3='0';_0x43942b=_0x1dd3('0x1e');_0xbe33d8[_0x1dd3('0x17')]();}}break;case 0x1:logger[_0x1dd3('0xd')](_0x1dd3('0x8'));_0x2f4cf3='1';_0x43942b=_0x1dd3('0x8');break;case 0x2:logger[_0x1dd3('0xd')](_0x1dd3('0x1f'));_0x2f4cf3='2';_0x43942b=_0x1dd3('0x1f');break;case 0x9:logger[_0x1dd3('0xd')](_0x1dd3('0x20'));_0x2f4cf3='9';_0x43942b='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x1dd3('0xd')](_0x1dd3('0x21'));_0x2f4cf3='10';_0x43942b=_0x1dd3('0x21');break;case 0xb:logger[_0x1dd3('0xd')](_0x1dd3('0x22'));_0x2f4cf3='11';_0x43942b=_0x1dd3('0x22');}}}catch(_0x111cce){logger[_0x1dd3('0x15')](_0x1dd3('0x23'),JSON[_0x1dd3('0x10')](_0x111cce));_0xbe33d8[_0x1dd3('0x17')]();}}function _0x453040(){logger[_0x1dd3('0xd')](_0x1dd3('0x24'));_0x14f4fc({'transcript':_0xba039c,'confidence':_0x564d07,'status':_0x2f4cf3,'status_message':_0x43942b});}function _0x2da8ff(_0x4c2e6f){logger[_0x1dd3('0x15')](_0x1dd3('0x25'));if(!_['isNil'](_0x4c2e6f)){logger['error'](_['isObject'](_0x4c2e6f)?JSON[_0x1dd3('0x10')](_0x4c2e6f):_0x4c2e6f);}}_0xbe33d8['on'](_0x1dd3('0x26'),_0x433de7);_0xbe33d8['on'](_0x1dd3('0x27'),_0x303f60);_0xbe33d8['on'](_0x1dd3('0x13'),_0x453040);_0xbe33d8['on'](_0x1dd3('0x15'),_0x2da8ff);});}; \ No newline at end of file +var _0x74b0=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info'];(function(_0xc16336,_0x888b49){var _0x34e6ef=function(_0x53c6a8){while(--_0x53c6a8){_0xc16336['push'](_0xc16336['shift']());}};_0x34e6ef(++_0x888b49);}(_0x74b0,0x1e7));var _0x074b=function(_0x2d3f17,_0x4791e3){_0x2d3f17=_0x2d3f17-0x0;var _0x4703f7=_0x74b0[_0x2d3f17];return _0x4703f7;};'use strict';var BPromise=require('bluebird');var _=require(_0x074b('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x074b('0x1'));var crypto=require(_0x074b('0x2'));var logger=require(_0x074b('0x3'))(_0x074b('0x4'));module[_0x074b('0x5')]=function(_0x1e17d0,_0x35ebe8,_0x45425a,_0x2132f5){return new BPromise(function(_0x192fbd,_0x3ea161){logger[_0x074b('0x6')]('Tilde\x20URI',_0x2132f5||_0x074b('0x7'));var _0x38b854=new WebSocket(_0x2132f5||_0x074b('0x7'),{'perMessageDeflate':![]});var _0x23e375='';var _0x3d138f='0';var _0x25f99a='1';var _0x33bf11=_0x074b('0x8');function _0x4076ef(_0x3ab5c8){var _0xf2b453=crypto[_0x074b('0x9')](_0x074b('0xa'));_0xf2b453['update'](_0x3ab5c8);return _0xf2b453[_0x074b('0xb')](_0x074b('0xc'));}function _0x4310ef(){try{logger[_0x074b('0x6')](_0x074b('0xd'));var _0x26fe5b=moment()[_0x074b('0xe')]();var _0x152de2=_0x4076ef(_0x26fe5b+_0x35ebe8+_0x45425a);_0x38b854[_0x074b('0xf')](JSON[_0x074b('0x10')]({'appID':_0x35ebe8,'timestamp':_0x26fe5b,'appKey':_0x152de2}));var _0x402fd6=fs[_0x074b('0x11')](_0x1e17d0);_0x402fd6['on'](_0x074b('0x12'),function(_0x4e3d60){_0x38b854[_0x074b('0xf')](_0x4e3d60);});_0x402fd6['on'](_0x074b('0x13'),function(){_0x38b854[_0x074b('0xf')](_0x074b('0x14'));});}catch(_0x431267){logger[_0x074b('0x15')](_0x074b('0x16'),JSON[_0x074b('0x10')](_0x431267));_0x38b854[_0x074b('0x17')]();}}function _0x32818b(_0x45f23b){try{if(_0x45f23b){var _0x1d3fde=JSON[_0x074b('0x18')](_0x45f23b);switch(_0x1d3fde['status']){case 0x0:if(_0x1d3fde[_0x074b('0x19')]){if(_0x1d3fde[_0x074b('0x19')][_0x074b('0x1a')]){logger[_0x074b('0x6')](_0x074b('0x1b'),JSON[_0x074b('0x10')](_0x1d3fde['result'][_0x074b('0x1c')]));_0x23e375=_0x1d3fde[_0x074b('0x19')][_0x074b('0x1c')][0x0][_0x074b('0x1d')];_0x3d138f=_0x1d3fde[_0x074b('0x19')][_0x074b('0x1c')][0x0][_0x074b('0x1e')];_0x25f99a='0';_0x33bf11='Success.';_0x38b854['terminate']();}}break;case 0x1:logger[_0x074b('0x6')](_0x074b('0x8'));_0x25f99a='1';_0x33bf11=_0x074b('0x8');break;case 0x2:logger['info'](_0x074b('0x1f'));_0x25f99a='2';_0x33bf11=_0x074b('0x1f');break;case 0x9:logger[_0x074b('0x6')](_0x074b('0x20'));_0x25f99a='9';_0x33bf11=_0x074b('0x20');break;case 0xa:logger['info']('Authentication\x20failed.');_0x25f99a='10';_0x33bf11='Authentication\x20failed.';break;case 0xb:logger['info'](_0x074b('0x21'));_0x25f99a='11';_0x33bf11=_0x074b('0x21');}}}catch(_0x355c24){logger[_0x074b('0x15')](_0x074b('0x22'),JSON[_0x074b('0x10')](_0x355c24));_0x38b854[_0x074b('0x17')]();}}function _0x358aeb(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x192fbd({'transcript':_0x23e375,'confidence':_0x3d138f,'status':_0x25f99a,'status_message':_0x33bf11});}function _0x3aeb4a(_0x17183d){logger[_0x074b('0x15')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x17183d)){logger[_0x074b('0x15')](_[_0x074b('0x23')](_0x17183d)?JSON['stringify'](_0x17183d):_0x17183d);}}_0x38b854['on'](_0x074b('0x24'),_0x4310ef);_0x38b854['on'](_0x074b('0x25'),_0x32818b);_0x38b854['on'](_0x074b('0x13'),_0x358aeb);_0x38b854['on'](_0x074b('0x15'),_0x3aeb4a);});}; \ 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 41e68bc..8998e27 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 _0xda17=['exports','./asr'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xda17,0x1b3));var _0x7da1=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xda17[_0xbb091];return _0x467a04;};var asr=require(_0x7da1('0x0'));module[_0x7da1('0x1')]={'asr':asr}; \ No newline at end of file +var _0x19ca=['exports'];(function(_0x3a6ae1,_0x48e539){var _0xc4e072=function(_0x311cf4){while(--_0x311cf4){_0x3a6ae1['push'](_0x3a6ae1['shift']());}};_0xc4e072(++_0x48e539);}(_0x19ca,0x1a0));var _0xa19c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x19ca[_0x19e35c];return _0x3e1fe8;};var asr=require('./asr');module[_0xa19c('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5264ddb..2a4b846 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 _0x4d02=['EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','connection','close','nextTick','inherits','exports','util','net','events'];(function(_0x456854,_0x22e0cc){var _0xeaebc1=function(_0x53957b){while(--_0x53957b){_0x456854['push'](_0x456854['shift']());}};_0xeaebc1(++_0x22e0cc);}(_0x4d02,0x1c9));var _0x24d0=function(_0x5970f5,_0x4dd365){_0x5970f5=_0x5970f5-0x0;var _0xd964f0=_0x4d02[_0x5970f5];return _0xd964f0;};'use strict';var util=require(_0x24d0('0x0'));var net=require(_0x24d0('0x1'));var EventEmitter=require(_0x24d0('0x2'))[_0x24d0('0x3')];var AGIError=require(_0x24d0('0x4'));var AGIChannel=require(_0x24d0('0x5'));var AGIServer=function(_0x1212e9,_0x597461,_0x1d3ac2){var _0x3ffc95=this,_0x1212e9=_0x1212e9||0x11dd,_0x597461=_0x597461||_0x24d0('0x6'),_0x20796a=null,_0x258a92=0x0;EventEmitter[_0x24d0('0x7')](_0x3ffc95);function _0x37eabc(){if(!_0x1212e9){_0x3ffc95[_0x24d0('0x8')](_0x24d0('0x9'),new AGIError(_0x24d0('0xa')));return![];}_0x20796a=net['createServer']();_0x20796a[_0x24d0('0xb')](_0x1212e9,_0x597461);_0x20796a['on'](_0x24d0('0xc'),function(){_0x3ffc95[_0x24d0('0x8')]('listening');});_0x20796a['on']('connection',function(_0x262c39){_0x20796a[_0x24d0('0xd')](function(_0x20d651,_0x3c12a7){if(_0x20d651){_0x3ffc95[_0x24d0('0x8')](_0x24d0('0x9'),new AGIError(_0x24d0('0xe'),_0x20d651));}else if(_0x1d3ac2&&_0x1d3ac2<0x0){_0x3ffc95[_0x24d0('0x8')](_0x24d0('0x9'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x262c39['destroy']();}else if(_0x1d3ac2&&_0x1d3ac2>0x0&&_0x1d3ac2<_0x3c12a7){_0x258a92+=0x1;_0x3ffc95[_0x24d0('0x8')](_0x24d0('0x9'),new AGIError(_0x24d0('0xf'),_0x258a92));_0x262c39[_0x24d0('0x10')]();}else{var _0x36b176=new AGIChannel(_0x262c39);_0x36b176['on'](_0x24d0('0x11'),function(){_0x3ffc95['emit'](_0x24d0('0x12'),_0x36b176);});}});});_0x20796a['on'](_0x24d0('0x9'),function(_0x40371d){_0x3ffc95[_0x24d0('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x40371d['code']));});_0x20796a['on']('close',function(){_0x3ffc95[_0x24d0('0x8')](_0x24d0('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x24d0('0x14')](function(){_0x37eabc();});};util[_0x24d0('0x15')](AGIServer,EventEmitter);module[_0x24d0('0x16')]=function(_0x1aa1fe,_0x930332,_0x521810){return new AGIServer(_0x1aa1fe,_0x930332,_0x521810);}; \ No newline at end of file +var _0x5c02=['emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','E_AGI_SERVER_MAXCONNECTION','destroy','ready','connection','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','util','net','EventEmitter','127.0.0.1','call'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c02,0x163));var _0x25c0=function(_0x100b6a,_0x66b44a){_0x100b6a=_0x100b6a-0x0;var _0x30a860=_0x5c02[_0x100b6a];return _0x30a860;};'use strict';var util=require(_0x25c0('0x0'));var net=require(_0x25c0('0x1'));var EventEmitter=require('events')[_0x25c0('0x2')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x6c3e7a,_0x5eba53,_0x11f3e1){var _0x14fe4e=this,_0x6c3e7a=_0x6c3e7a||0x11dd,_0x5eba53=_0x5eba53||_0x25c0('0x3'),_0x4334f0=null,_0x21cd38=0x0;EventEmitter[_0x25c0('0x4')](_0x14fe4e);function _0xcf9d96(){if(!_0x6c3e7a){_0x14fe4e[_0x25c0('0x5')](_0x25c0('0x6'),new AGIError(_0x25c0('0x7')));return![];}_0x4334f0=net[_0x25c0('0x8')]();_0x4334f0[_0x25c0('0x9')](_0x6c3e7a,_0x5eba53);_0x4334f0['on'](_0x25c0('0xa'),function(){_0x14fe4e[_0x25c0('0x5')](_0x25c0('0xa'));});_0x4334f0['on']('connection',function(_0x171bc4){_0x4334f0[_0x25c0('0xb')](function(_0x3fbf50,_0x25da82){if(_0x3fbf50){_0x14fe4e['emit'](_0x25c0('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x3fbf50));}else if(_0x11f3e1&&_0x11f3e1<0x0){_0x14fe4e[_0x25c0('0x5')](_0x25c0('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x171bc4['destroy']();}else if(_0x11f3e1&&_0x11f3e1>0x0&&_0x11f3e1<_0x25da82){_0x21cd38+=0x1;_0x14fe4e[_0x25c0('0x5')](_0x25c0('0x6'),new AGIError(_0x25c0('0xc'),_0x21cd38));_0x171bc4[_0x25c0('0xd')]();}else{var _0x520b05=new AGIChannel(_0x171bc4);_0x520b05['on'](_0x25c0('0xe'),function(){_0x14fe4e[_0x25c0('0x5')](_0x25c0('0xf'),_0x520b05);});}});});_0x4334f0['on']('error',function(_0x23102c){_0x14fe4e[_0x25c0('0x5')](_0x25c0('0x6'),new AGIError(_0x25c0('0x10'),_0x23102c['code']));});_0x4334f0['on']('close',function(){_0x14fe4e[_0x25c0('0x5')](_0x25c0('0x11'),new AGIError(_0x25c0('0x12')));});}process[_0x25c0('0x13')](function(){_0xcf9d96();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x58568f,_0x46280b,_0x12c14e){return new AGIServer(_0x58568f,_0x46280b,_0x12c14e);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 25f0ed5..2d3754c 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 _0x3eae=['headers','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','speech','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','toString','test','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','gotoif','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','unlink','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','randomstring','moment','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','catch','getVoiceQueue','then','name','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','interval','map','Intervals','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','format','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri'];(function(_0x31b68a,_0xb75be5){var _0x5443a6=function(_0x10bcb7){while(--_0x10bcb7){_0x31b68a['push'](_0x31b68a['shift']());}};_0x5443a6(++_0xb75be5);}(_0x3eae,0x162));var _0xe3ea=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x3eae[_0x571a17];return _0x3ef337;};'use strict';var fs=require('fs');var path=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var _=require(_0xe3ea('0x2'));var sh=require(_0xe3ea('0x3'));var odbc=require('odbc')();var rs=require(_0xe3ea('0x4'));var moment=require(_0xe3ea('0x5'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0xe3ea('0x6'));var scripts=require(_0xe3ea('0x7'));var FILES_PATH=_0xe3ea('0x8');var recursiveMapAttributes=[_0xe3ea('0x9'),_0xe3ea('0xa')];var verticesWithRetry=[_0xe3ea('0xb'),'getdigits',_0xe3ea('0xc')];var AGIVertices=function(_0x34a9de,_0x38bc27,_0x45ba5c){this[_0xe3ea('0xd')]=_0x34a9de;this[_0xe3ea('0xe')]=_0x38bc27;this[_0xe3ea('0xf')]=_0x45ba5c;};AGIVertices[_0xe3ea('0x10')]['getVariable']=function(_0x203167,_0x5b6055){this[_0xe3ea('0xe')]['getVariableById'](_0x203167)['then'](function(_0x5d6620){_0x5b6055(null,_0x5d6620?_0x5d6620['name']:![]);})[_0xe3ea('0x11')](function(_0x1986ab){_0x5b6055(_0x1986ab);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x12')]=function(_0x322633,_0x3c28ab){this[_0xe3ea('0xe')]['getVoiceQueueById'](_0x322633)[_0xe3ea('0x13')](function(_0x17ac3c){_0x3c28ab(null,_0x17ac3c?_0x17ac3c[_0xe3ea('0x14')]:![]);})['catch'](function(_0x393509){_0x3c28ab(_0x393509);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x15')]=function(_0x36da9b,_0x62791f){this[_0xe3ea('0xe')]['getSquareProjectById'](_0x36da9b)['then'](function(_0x1a45ab){_0x62791f(null,_0x1a45ab?_0x1a45ab['name']:![]);})[_0xe3ea('0x11')](function(_0x12ae67){_0x62791f(_0x12ae67);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x16')]=function(_0x224228,_0x3b5676){this[_0xe3ea('0xe')][_0xe3ea('0x17')](_0x224228)[_0xe3ea('0x13')](function(_0x47c7e0){_0x3b5676(null,_0x47c7e0?_0x47c7e0[_0xe3ea('0x18')]:![]);})[_0xe3ea('0x11')](function(_0xd70c99){_0x3b5676(_0xd70c99);});};AGIVertices[_0xe3ea('0x10')]['getUser']=function(_0xbc8038,_0x5ed256){this[_0xe3ea('0xe')][_0xe3ea('0x19')](_0xbc8038)[_0xe3ea('0x13')](function(_0x52f299){_0x5ed256(null,_0x52f299?_0x52f299[_0xe3ea('0x14')]:![]);})[_0xe3ea('0x11')](function(_0x5677bc){_0x5ed256(_0x5677bc);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1a')]=function(_0x551358,_0x180aa6){this[_0xe3ea('0xe')][_0xe3ea('0x1b')](_0x551358)[_0xe3ea('0x13')](function(_0x4e4d11){_0x180aa6(null,_0x4e4d11?_0x4e4d11[_0xe3ea('0x14')]:![]);})[_0xe3ea('0x11')](function(_0x3c3372){_0x180aa6(_0x3c3372);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1c')]=function(_0x59aa27,_0x4a388e){var _0x50f3a0=this;this[_0xe3ea('0xe')][_0xe3ea('0x1d')](_0x59aa27)[_0xe3ea('0x13')](function(_0x5691ac){_0x4a388e(null,_0x5691ac?_0x50f3a0['getSoundPath'](_0x5691ac[_0xe3ea('0x1e')]):![]);})[_0xe3ea('0x11')](function(_0x11fbc1){_0x4a388e(_0x11fbc1);});};AGIVertices[_0xe3ea('0x10')]['getMailAccount']=function(_0x3350c3,_0x5450ab){this['rpc'][_0xe3ea('0x1f')](_0x3350c3)['then'](function(_0x57d296){_0x5450ab(null,_0x57d296?_0x57d296:![]);})[_0xe3ea('0x11')](function(_0x170af1){_0x5450ab(_0x170af1);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x20')]=function(_0x42ff56,_0x456d58,_0x555336){this[_0xe3ea('0xf')][_0xe3ea('0x20')](_0x42ff56,_0x456d58)[_0xe3ea('0x13')](function(){_0x555336(null);})[_0xe3ea('0x11')](function(_0x21c770){_0x555336(_0x21c770);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x21')]=function(_0x5339d1,_0x4e8270){this['rpc']['getIntervalById'](_0x5339d1)['then'](function(_0x266472){if(_0x266472){if(_0x266472['IntervalId']){_0x4e8270(null,[_0x266472[_0xe3ea('0x22')]]);}else{_0x4e8270(null,_[_0xe3ea('0x23')](_0x266472[_0xe3ea('0x24')],_0xe3ea('0x22')));}}else{_0x4e8270(null,![]);}})[_0xe3ea('0x11')](function(_0xc25f1e){_0x4e8270(_0xc25f1e);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x25')]=function(_0x39e07b){return util['format'](_0xe3ea('0x26'),FILES_PATH,_0x39e07b);};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x27')]=function(_0x44a037,_0x16e68f,_0x2dcabc){odbc[_0xe3ea('0x28')](_0x44a037,function(_0x47cfb3){if(_0x47cfb3){logger['error'](_0xe3ea('0x29'),_0x47cfb3);_0x2dcabc(_0x47cfb3);}else{logger[_0xe3ea('0x2a')](_0xe3ea('0x2b'));odbc['query'](_0x16e68f,function(_0x49eddd,_0x5901f9){if(_0x49eddd){logger['info'](_0xe3ea('0x2c'),_0x16e68f);_0x2dcabc(_0x49eddd);}else{logger[_0xe3ea('0x2a')](_0xe3ea('0x2d'),_0x16e68f);odbc[_0xe3ea('0x2e')](function(_0x104bc5){if(_0x104bc5){logger[_0xe3ea('0x2f')](_0xe3ea('0x30'),_0x104bc5);}_0x2dcabc(null,_0x5901f9);});}});}});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x31')]=function(_0x1e4483,_0x38feb2){this[_0xe3ea('0xe')][_0xe3ea('0x32')](_0x1e4483)[_0xe3ea('0x13')](function(_0xbf1f26){_0x38feb2(null,_0xbf1f26?_0xbf1f26:![]);})[_0xe3ea('0x11')](function(_0x406d63){_0x38feb2(_0x406d63);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x33')]=function(_0x3a0785,_0x4488f4){this[_0xe3ea('0xe')][_0xe3ea('0x33')](_0x3a0785)['then'](function(_0x15b782){_0x4488f4(null,_0x15b782);})[_0xe3ea('0x11')](function(_0x5affd4){_0x4488f4(_0x5affd4);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x34')]=function(_0x70ce38,_0x56a04f,_0x1905c0){this[_0xe3ea('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0xe3ea('0xd')][_0xe3ea('0x35')],'node':_0x70ce38[_0xe3ea('0x36')],'application':_0x70ce38[_0xe3ea('0x37')],'data':_0x56a04f||null,'project_name':this[_0xe3ea('0xd')][_0xe3ea('0x38')],'callerid':this[_0xe3ea('0xd')][_0xe3ea('0x39')]})[_0xe3ea('0x13')](function(_0x33fde4){if(_0x1905c0){_0x1905c0(null,_0x33fde4);}})[_0xe3ea('0x11')](function(_0x537272){if(_0x1905c0){_0x1905c0(_0x537272);}});};AGIVertices['prototype'][_0xe3ea('0x3a')]=function(_0x172b57,_0x1c9b44,_0xcafed9,_0x56788c){this[_0xe3ea('0xe')][_0xe3ea('0x3a')]({'uniqueid':this[_0xe3ea('0xd')][_0xe3ea('0x35')],'callerid':this[_0xe3ea('0xd')][_0xe3ea('0x39')],'calleridname':this[_0xe3ea('0xd')][_0xe3ea('0x3b')],'context':this[_0xe3ea('0xd')][_0xe3ea('0x3c')],'extension':this[_0xe3ea('0xd')][_0xe3ea('0x3d')],'priority':this[_0xe3ea('0xd')][_0xe3ea('0x3e')],'accountcode':this[_0xe3ea('0xd')]['accountcode'],'dnid':this[_0xe3ea('0xd')]['dnid'],'projectName':this['channel'][_0xe3ea('0x38')],'saveName':_0x1c9b44,'filename':_0x172b57['file']||_0x1c9b44,'savePath':_0xcafed9})[_0xe3ea('0x13')](function(_0x5ec414){_0x56788c(null,_0x5ec414);})[_0xe3ea('0x11')](function(_0x3e792b){_0x56788c(_0x3e792b);});};AGIVertices[_0xe3ea('0x10')]['createSquareMessage']=function(_0x1c69f9,_0x5184af,_0x1ef7f2,_0x8a8239,_0xf11351){this[_0xe3ea('0xe')][_0xe3ea('0x3f')]({'uniqueid':this[_0xe3ea('0xd')][_0xe3ea('0x35')],'body':_0x1c69f9,'direction':_0x5184af,'providerName':_0x1ef7f2,'providerResponse':_0x8a8239})['then'](function(_0x2a7f66){if(_0xf11351){_0xf11351(null,_0x2a7f66);}})[_0xe3ea('0x11')](function(_0x1abafa){if(_0xf11351){_0xf11351(_0x1abafa);}});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x40')]=function(_0x18644f,_0x256a8b){this[_0xe3ea('0xe')]['createCmContact']({'firstName':_[_0xe3ea('0x41')](_0x18644f[_0xe3ea('0x14')])||_[_0xe3ea('0x42')](_0x18644f[_0xe3ea('0x14')])?_0xe3ea('0x43')+Math[_0xe3ea('0x44')]():_0x18644f['name'],'lastName':_[_0xe3ea('0x41')](_0x18644f['lastName'])||_[_0xe3ea('0x42')](_0x18644f[_0xe3ea('0x45')])?null:_0x18644f[_0xe3ea('0x45')],'phone':_0x18644f[_0xe3ea('0x46')],'ListId':_0x18644f[_0xe3ea('0x47')],'scheduledat':_0x18644f[_0xe3ea('0x48')],'callbackUniqueid':this[_0xe3ea('0xd')][_0xe3ea('0x35')],'tags':_0xe3ea('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x18644f['scheduledAt']['toString'](),'priority':_0x18644f[_0xe3ea('0x4a')]})['then'](function(_0x2265c6){_0x256a8b(null,_0x2265c6);})[_0xe3ea('0x11')](function(_0xba00b0){_0x256a8b(_0xba00b0);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x4b')]=function(_0x4e666d,_0x24023f){this[_0xe3ea('0xe')][_0xe3ea('0x4c')](_0x4e666d)[_0xe3ea('0x13')](function(_0x2368cf){_0x24023f(null,_0x2368cf?_0x2368cf[_0xe3ea('0x14')]:![]);})[_0xe3ea('0x11')](function(_0x42b666){_0x24023f(_0x42b666);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x4d')]=function(_0x100347,_0x47ede8,_0x4dca2b){var _0x1199e2={'role':_0xe3ea('0x4e')};_0x1199e2[_0x100347]=this[_0xe3ea('0xd')][_0xe3ea('0x39')];this['rpc']['agentPause'](_0x1199e2,_0x47ede8,this['channel'][_0xe3ea('0x35')])[_0xe3ea('0x13')](function(_0x5c9232){_0x4dca2b(null,_[_0xe3ea('0x42')](_0x5c9232)?![]:!![]);})[_0xe3ea('0x11')](function(_0x1df464){logger[_0xe3ea('0x2f')](_0x1df464);_0x4dca2b(null,![]);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x4f')]=function(_0x4e052c,_0x58d042){var _0x5362b7={'role':'agent'};_0x5362b7[_0x4e052c]=this[_0xe3ea('0xd')]['callerid'];this[_0xe3ea('0xe')]['agentUnpause'](_0x5362b7)[_0xe3ea('0x13')](function(_0x1181c8){_0x58d042(null,_['isNil'](_0x1181c8)?![]:!![]);})[_0xe3ea('0x11')](function(_0x293785){logger[_0xe3ea('0x2f')](_0x293785);_0x58d042(null,![]);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x50')]=function(_0x158892,_0x5af272){var _0x52d7ce={'role':_0xe3ea('0x4e')};_0x52d7ce[_0x158892]=this[_0xe3ea('0xd')][_0xe3ea('0x39')];this['rpc']['agentLogout'](_0x52d7ce)[_0xe3ea('0x13')](function(_0x5a22f3){_0x5af272(null,_[_0xe3ea('0x42')](_0x5a22f3)?![]:!![]);})['catch'](function(_0x175a98){logger['error'](_0x175a98);_0x5af272(null,![]);});};AGIVertices['prototype'][_0xe3ea('0x51')]=function(_0x5d2bec,_0x4e2ca8){var _0x48698f={'role':_0xe3ea('0x4e')};_0x48698f[_0x5d2bec]=this[_0xe3ea('0xd')]['callerid'];var _0x423f49=_0x5d2bec!='internal'?util[_0xe3ea('0x52')]('%s/%s@from-sip/n',_0xe3ea('0x53'),this[_0xe3ea('0xd')][_0xe3ea('0x39')]):undefined;this['rpc'][_0xe3ea('0x51')](_0x48698f,_0x423f49)[_0xe3ea('0x13')](function(_0x4d851f){_0x4e2ca8(null,_[_0xe3ea('0x42')](_0x4d851f)?![]:!![]);})[_0xe3ea('0x11')](function(_0x420bc8){logger['error'](_0x420bc8);_0x4e2ca8(null,![]);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x54')]=function(_0x198019,_0x546deb){sh[_0xe3ea('0x55')](_[_0xe3ea('0x56')](_0x198019),function(_0x5b4b0a,_0x2089a3){var _0x58d4aa=_0x2089a3[_0xe3ea('0x57')](/(\r\n|\n|\r)/gm,'');_0x546deb(null,_0x58d4aa);});};AGIVertices[_0xe3ea('0x10')]['googleCloudTTS']=function(_0x347a68,_0x293f55){scripts[_0xe3ea('0x58')](_0x347a68[_0xe3ea('0x59')],_0x347a68['google_cloud_tts_text_type']||_0xe3ea('0x5a'),_0x347a68[_0xe3ea('0x5a')],_0x347a68[_0xe3ea('0x5b')]||_0xe3ea('0x5c'),_0x347a68[_0xe3ea('0x5d')]||_0xe3ea('0x5e'),_0x347a68[_0xe3ea('0x5f')]||_0xe3ea('0x60'))[_0xe3ea('0x13')](function(_0x29e61b){_0x293f55(null,_0x29e61b);})['catch'](function(_0xef1023){_0x293f55(_0xef1023);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x61')]=function(_0x24c84a,_0x541a3e){scripts[_0xe3ea('0x61')](_0x24c84a[_0xe3ea('0x5a')],_0x24c84a[_0xe3ea('0x62')]||'en',0x1)[_0xe3ea('0x13')](function(_0x377c79){_0x541a3e(null,_0x377c79);})[_0xe3ea('0x11')](function(_0x373725){_0x541a3e(_0x373725);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x63')]=function(_0x44f704,_0x3d0cbb){var _0x43a921={'uri':_0x44f704[_0xe3ea('0x64')],'method':_0x44f704['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x44f704[_0xe3ea('0x65')])===_0xe3ea('0x66')&&parseInt(_0x44f704[_0xe3ea('0x65')])>=0x1?parseInt(_0x44f704[_0xe3ea('0x65')])*0x3e8:0x5*0x3e8};if(_[_0xe3ea('0x67')]([_0xe3ea('0x68'),_0xe3ea('0x69')],_0x43a921[_0xe3ea('0x6a')][_0xe3ea('0x6b')]())){try{_0x43a921[_0xe3ea('0x6c')]=_0x44f704[_0xe3ea('0xa')]?JSON[_0xe3ea('0x6d')](_0x44f704['rawBody']):{};}catch(_0x206b2f){logger[_0xe3ea('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x206b2f);}}try{_0x43a921['headers']=_0x44f704[_0xe3ea('0x9')]?JSON[_0xe3ea('0x6d')](_0x44f704[_0xe3ea('0x9')]):{};}catch(_0x1e4127){logger[_0xe3ea('0x2f')](_0xe3ea('0x6e'),_0x1e4127);}if(_0x44f704[_0xe3ea('0x6f')]){try{var _0xf57450=require(_0x44f704[_0xe3ea('0x6f')])['sync'](this,_0x43a921);_0x43a921[_0xe3ea('0x70')]=Mustache['render'](_0x44f704[_0xe3ea('0x64')],_0xf57450,{},['$$','$$']);if(_0x43a921['headers']){_0x43a921['headers']=JSON['parse'](Mustache['render'](JSON['stringify'](_0x43a921[_0xe3ea('0x71')]),_0xf57450,{},['$$','$$']));}if(_0x43a921[_0xe3ea('0x6c')]){_0x43a921[_0xe3ea('0x6c')]=JSON[_0xe3ea('0x6d')](Mustache[_0xe3ea('0x72')](JSON[_0xe3ea('0x73')](_0x43a921[_0xe3ea('0x6c')]),_0xf57450,{},['$$','$$']));}}catch(_0x5884d3){logger['error'](_0xe3ea('0x74'),_0x5884d3);}}rp(_0x43a921)[_0xe3ea('0x13')](function(_0x1efaf0){var _0x1a2bab={'statusCode':_0x1efaf0['statusCode']||0xc8,'statusMessage':_0x1efaf0[_0xe3ea('0x75')]||'OK','headers':_0x1efaf0[_0xe3ea('0x71')]||{},'body':_0x1efaf0[_0xe3ea('0x6c')]||{}};_0x3d0cbb(null,_0x1a2bab);})[_0xe3ea('0x11')](function(_0x18f405){var _0x1e4e87={'statusCode':_0x18f405[_0xe3ea('0x76')]||0x1f4,'statusMessage':_0x18f405['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x18f405[_0xe3ea('0x77')][_0xe3ea('0x71')]||{},'body':_0x18f405[_0xe3ea('0x77')]['body']||{}};_0x3d0cbb(null,_0x1e4e87);});};AGIVertices['prototype'][_0xe3ea('0x78')]=function(_0x1569ba,_0x25bc04){scripts[_0xe3ea('0x78')](this[_0xe3ea('0xd')][_0xe3ea('0x35')],_0x1569ba[_0xe3ea('0x79')],_0x1569ba[_0xe3ea('0x5a')],_0x1569ba[_0xe3ea('0x7a')]||'en')[_0xe3ea('0x13')](function(_0x4fb260){_0x25bc04(null,_0x4fb260);})['catch'](function(_0x825b09){_0x25bc04(_0x825b09);});};AGIVertices['prototype'][_0xe3ea('0x7b')]=function(_0x20d93d,_0x526da1){scripts[_0xe3ea('0x7b')](this[_0xe3ea('0xd')][_0xe3ea('0x35')],_0x20d93d[_0xe3ea('0x7c')],_0x20d93d['client_email'],_0x20d93d[_0xe3ea('0x7d')],_0x20d93d[_0xe3ea('0x5a')],_0x20d93d[_0xe3ea('0x7e')]||'en')[_0xe3ea('0x13')](function(_0x215d4c){_0x526da1(null,_0x215d4c);})[_0xe3ea('0x11')](function(_0x13562c){_0x526da1(_0x13562c);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x7f')]=function(_0x22c04a,_0xcfdfd4){scripts[_0xe3ea('0x7f')](this[_0xe3ea('0xd')],_0x22c04a)[_0xe3ea('0x13')](function(_0x5a88c5){_0xcfdfd4(null,_0x5a88c5);})[_0xe3ea('0x11')](function(_0x58f755){_0xcfdfd4(_0x58f755);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x80')]=function(_0x11ac7a,_0x4e0ce3){scripts['ispeechTTS'](_0x11ac7a[_0xe3ea('0x79')],_0x11ac7a[_0xe3ea('0x5a')],_0x11ac7a[_0xe3ea('0x81')]||_0xe3ea('0x5c'),_0x11ac7a[_0xe3ea('0x82')])[_0xe3ea('0x13')](function(_0x49d80a){_0x4e0ce3(null,_0x49d80a);})[_0xe3ea('0x11')](function(_0x12685b){_0x4e0ce3(_0x12685b);});};AGIVertices['prototype'][_0xe3ea('0x83')]=function(_0x59a3fd,_0xc73c6,_0x1d47b4){scripts[_0xe3ea('0x83')](_0xc73c6,_0x59a3fd[_0xe3ea('0x79')],_0x59a3fd[_0xe3ea('0x84')]||_0xe3ea('0x5c'),this['isConfigured'](_0x59a3fd['model'])?_0x59a3fd[_0xe3ea('0x85')]:undefined)[_0xe3ea('0x13')](function(_0x39709b){_0x1d47b4(null,_0x39709b);})[_0xe3ea('0x11')](function(_0x44cd8e){_0x1d47b4(_0x44cd8e);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x86')]=function(_0x182308,_0x372ff4){scripts[_0xe3ea('0x86')](_0x182308[_0xe3ea('0x87')],_0x182308[_0xe3ea('0x88')],_0x182308[_0xe3ea('0x89')],_0x182308[_0xe3ea('0x8a')]||_0xe3ea('0x8b'),_0x182308[_0xe3ea('0x5a')],_0x182308[_0xe3ea('0x8c')]||_0xe3ea('0x5a'))[_0xe3ea('0x13')](function(_0x43e3e2){_0x372ff4(null,_0x43e3e2);})[_0xe3ea('0x11')](function(_0x5869f0){_0x372ff4(_0x5869f0);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x8d')]=function(_0x112c4f,_0x20aecf){scripts[_0xe3ea('0x8d')](this[_0xe3ea('0xd')]['uniqueid'],_0x112c4f[_0xe3ea('0x87')],_0x112c4f[_0xe3ea('0x88')],_0x112c4f[_0xe3ea('0x8e')],_0x112c4f[_0xe3ea('0x5a')],_0x112c4f[_0xe3ea('0x8f')])['then'](function(_0x532e55){_0x20aecf(null,_0x532e55);})['catch'](function(_0x2d66b1){_0x20aecf(_0x2d66b1);});};AGIVertices['prototype'][_0xe3ea('0x90')]=function(_0x14e311,_0x717284,_0x4ff885){scripts['googleASR'](_0x717284,_0x14e311['key'],_0x14e311[_0xe3ea('0x91')]||_0xe3ea('0x5c'))[_0xe3ea('0x13')](function(_0x521bc9){_0x4ff885(null,_0x521bc9);})[_0xe3ea('0x11')](function(_0x4cffc7){_0x4ff885(_0x4cffc7);});};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x92')]=function(_0x5419d9,_0x4e8388,_0x443d92){scripts['tildeASR'](_0x4e8388,_0x5419d9['appid'],_0x5419d9[_0xe3ea('0x93')],_0x5419d9[_0xe3ea('0x70')])['then'](function(_0x1e297a){_0x443d92(null,_0x1e297a);})[_0xe3ea('0x11')](function(_0x4baacb){_0x443d92(_0x4baacb);});};AGIVertices['prototype'][_0xe3ea('0x94')]=function(_0x1ba0b4){var _0x263a4=_[_0xe3ea('0x67')](verticesWithRetry,_0x1ba0b4[_0xe3ea('0x37')])?_0x1ba0b4:_[_0xe3ea('0x95')](_0x1ba0b4);for(var _0x286834 in _0x263a4){if(_0x263a4[_0xe3ea('0x96')](_0x286834)){if(_0x263a4[_0x286834]&&_[_0xe3ea('0x97')](_0x263a4[_0x286834])){if(_[_0xe3ea('0x67')](recursiveMapAttributes,_0x286834)){_0x263a4[_0x286834]=this[_0xe3ea('0x98')](_0x263a4[_0x286834]);}else{_0x263a4[_0x286834]=this[_0xe3ea('0x99')](_0x263a4[_0x286834]);}}}}return _0x263a4;};AGIVertices['prototype'][_0xe3ea('0x9a')]=function(_0x570cc1){for(var _0x281096 in _0x570cc1){if(_0x570cc1[_0xe3ea('0x96')](_0x281096)){if(_[_0xe3ea('0x9b')](_0x570cc1[_0x281096])){this[_0xe3ea('0x9a')](_0x570cc1[_0x281096]);}else if(_['isArray'](_0x570cc1[_0x281096])){for(var _0x272423=0x0;_0x272423<_0x570cc1[_0x281096][_0xe3ea('0x9c')];_0x272423++){this[_0xe3ea('0x9a')](_0x570cc1[_0x281096][_0x272423]);}}else if(_[_0xe3ea('0x97')](_0x570cc1[_0x281096])){_0x570cc1[_0x281096]=this[_0xe3ea('0x99')](_0x570cc1[_0x281096]);}}}};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x9d')]=function(_0x112001,_0x47fdf0){for(var _0x580590 in _0x112001){if(_0x112001['hasOwnProperty'](_0x580590)){if(_['isPlainObject'](_0x112001[_0x580590])){if(!_['isEmpty'](_0x112001[_0x580590])){this[_0xe3ea('0x9d')](_0x112001[_0x580590],util['format'](_0xe3ea('0x9e'),_0x47fdf0,_0x580590));}}else if(_[_0xe3ea('0x9f')](_0x112001[_0x580590])){for(var _0x10585a=0x0;_0x10585a<_0x112001[_0x580590]['length'];_0x10585a++){this[_0xe3ea('0x9d')](_0x112001[_0x580590][_0x10585a],util[_0xe3ea('0x52')](_0xe3ea('0x9e'),_0x47fdf0,_0x580590+'['+_0x10585a+']'));}}else{if(!_[_0xe3ea('0x42')](_0x112001[_0x580590])){this['channel'][_0xe3ea('0xa0')](util[_0xe3ea('0x52')](_0xe3ea('0x9e'),_0x47fdf0,_0x580590),_0x112001[_0x580590]);}}}}};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x98')]=function(_0x419468){try{var _0x5923fe=JSON[_0xe3ea('0x6d')](_0x419468);this[_0xe3ea('0x9a')](_0x5923fe);return JSON[_0xe3ea('0x73')](_0x5923fe);}catch(_0xb6afef){return this[_0xe3ea('0x99')](_0x419468);}};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x99')]=function(_0x51fa5f){var _0x23af95=_0x51fa5f[_0xe3ea('0xa1')]('{');for(var _0x41475a=0x1;_0x41475a<_0x23af95[_0xe3ea('0x9c')];_0x41475a+=0x1){var _0x26f751=_0x23af95[_0x41475a]['split']('}');if(_0x26f751['length']>0x1){_0x51fa5f=_0x51fa5f[_0xe3ea('0xa2')]('{'+_0x26f751[0x0]+'}',this[_0xe3ea('0xd')][_0xe3ea('0xa3')](_0x26f751[0x0])[_0xe3ea('0xa4')]||_0x26f751[0x0]);}}if(_0x23af95[_0xe3ea('0x9c')]===0x1){return _0x51fa5f['toString']();}return this[_0xe3ea('0x99')](_0x51fa5f);};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xa5')]=function(_0x3cf196,_0xc6ec64){var _0xe00b41=this[_0xe3ea('0xd')][_0xe3ea('0xa3')](_0x3cf196);if(_0xe00b41[_0xe3ea('0xa6')]===-0x1){return _0xe00b41;}logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0xa7'),_0xc6ec64,_0xe00b41[_0xe3ea('0xa4')]));return this[_0xe3ea('0xd')]['setVariable'](_0xc6ec64,_0xe00b41['extra']);};AGIVertices[_0xe3ea('0x10')]['isConfigured']=function(_0x14688a){return _0x14688a&&_0x14688a!=='0'&&_0x14688a!=='-1'&&_0x14688a!=='';};AGIVertices['prototype'][_0xe3ea('0xa8')]=function(_0x1fda0b){this[_0xe3ea('0x34')]['sync'](this,_0x1fda0b,'-');_0x1fda0b['retry']=_0x1fda0b[_0xe3ea('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x569a14){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0xa9'),_0x569a14['label']));if(!this[_0xe3ea('0xaa')](_0x569a14[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}var _0x2aefdb='\x22'+_0x569a14[_0xe3ea('0x5a')]+'\x22';if(this['isConfigured'](_0x569a14[_0xe3ea('0x77')])){_0x2aefdb+=','+_0x569a14[_0xe3ea('0x77')];}var _0x4643e7=this[_0xe3ea('0xd')][_0xe3ea('0x55')]('MRCPSynth',_0x2aefdb);if(_0x4643e7['result']===-0x1){return _0x4643e7;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xad'),_0x2aefdb));};AGIVertices[_0xe3ea('0x10')]['mrcprecog']=function(_0x15025d){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0xae'),_0x15025d[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x15025d[_0xe3ea('0xaf')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xb0'));}var _0x16e751=_0x15025d[_0xe3ea('0xaf')];if(this[_0xe3ea('0xaa')](_0x15025d[_0xe3ea('0x77')])){_0x16e751+=','+_0x15025d[_0xe3ea('0x77')];}var _0x2f656f=this[_0xe3ea('0xd')]['exec'](_0xe3ea('0xb1'),_0x16e751);if(_0x2f656f[_0xe3ea('0xa6')]===-0x1){return _0x2f656f;}var _0x207992=this[_0xe3ea('0xa5')](_0xe3ea('0xb2'),_0xe3ea('0xb3'));if(_0x207992[_0xe3ea('0xa6')]===-0x1){return _0x207992;}var _0x2f0afa=this[_0xe3ea('0xa5')](_0xe3ea('0xb4'),_0xe3ea('0xb5'));if(_0x2f0afa['result']===-0x1){return _0x2f0afa;}var _0x123e79=this[_0xe3ea('0xa5')](_0xe3ea('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x123e79[_0xe3ea('0xa6')]===-0x1){return _0x123e79;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xb7'),_0x16e751));};AGIVertices['prototype'][_0xe3ea('0xb8')]=function(_0x1578e8){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0xb9'),_0x1578e8['label']));return this[_0xe3ea('0xd')]['agi']([_0x1578e8[_0xe3ea('0xba')],_0x1578e8[_0xe3ea('0xbb')]]);};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xbc')]=function(_0x37b061){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0xbd'),_0x37b061[_0xe3ea('0x36')]));if(this['isConfigured'](_0x37b061[_0xe3ea('0x65')])){logger['info'](util[_0xe3ea('0x52')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x37b061[_0xe3ea('0x65')]));var _0x30ff33=this[_0xe3ea('0xd')][_0xe3ea('0xbe')](_0x37b061[_0xe3ea('0x65')]);if(_0x30ff33[_0xe3ea('0xa6')]===-0x1){return _0x30ff33;}}return this[_0xe3ea('0xd')][_0xe3ea('0xbc')]();};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x49')]=function(_0x4afb9b){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0xbf'),_0x4afb9b[_0xe3ea('0x36')]));if(!this['isConfigured'](_0x4afb9b['list_id'])){return this['channel'][_0xe3ea('0x2f')](_0x4afb9b,_0xe3ea('0xc0'));}_0x4afb9b[_0xe3ea('0x48')]=moment();if(this[_0xe3ea('0xaa')](_0x4afb9b['delay'])){_0x4afb9b[_0xe3ea('0x48')]=moment()['add'](_0x4afb9b[_0xe3ea('0xc1')],_0xe3ea('0xc2'));}if(!this[_0xe3ea('0xaa')](_0x4afb9b['callback_priority'])){_0x4afb9b[_0xe3ea('0x4a')]=0x2;}this['createCmContact'][_0xe3ea('0xc3')](this,_0x4afb9b);return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xc4'),_0x4afb9b[_0xe3ea('0x46')],_0x4afb9b[_0xe3ea('0x47')],_0x4afb9b[_0xe3ea('0x48')]));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xc5')]=function(_0x4dde78){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0xc6'),_0x4dde78[_0xe3ea('0x36')]));var _0x441b84=this[_0xe3ea('0xd')]['exec'](_0x4dde78[_0xe3ea('0xc7')],_0x4dde78[_0xe3ea('0x77')]);if(_0x441b84[_0xe3ea('0xa6')]===-0x1){return _0x441b84;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xc8'),_0x4dde78[_0xe3ea('0xc7')],_0x4dde78['options']));};AGIVertices['prototype'][_0xe3ea('0xc9')]=function(_0x5ef333){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5ef333[_0xe3ea('0x36')]));if(!this['isConfigured'](_0x5ef333[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')]['noop']('no\x20text\x20configured');}var _0x297803='\x22'+_0x5ef333[_0xe3ea('0x5a')]+'\x22';if(this[_0xe3ea('0xaa')](_0x5ef333[_0xe3ea('0x77')])){_0x297803+=','+_0x5ef333[_0xe3ea('0x77')];}var _0x45bbcf=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0xca'),_0x297803);if(_0x45bbcf[_0xe3ea('0xa6')]===-0x1){return _0x45bbcf;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('Executed\x20command\x20MRCPSynth\x20%s',_0x297803));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xcb')]=function(_0xf01ce8){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0xcc'),_0xf01ce8[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0xf01ce8[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}var _0x462209='\x22'+_0xf01ce8[_0xe3ea('0x5a')]+'\x22';if(this[_0xe3ea('0xaa')](_0xf01ce8[_0xe3ea('0x77')])){_0x462209+=','+_0xf01ce8['options'];}var _0x3e695e=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0xca'),_0x462209);if(_0x3e695e[_0xe3ea('0xa6')]===-0x1){return _0x3e695e;}return this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xad'),_0x462209));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xcd')]=function(_0xe18c7e){logger[_0xe3ea('0x2a')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xe18c7e[_0xe3ea('0x36')]));if(!this['isConfigured'](_0xe18c7e[_0xe3ea('0xaf')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xb0'));}var _0x2dfcc4=_0xe18c7e[_0xe3ea('0xaf')];if(this[_0xe3ea('0xaa')](_0xe18c7e[_0xe3ea('0x77')])){_0x2dfcc4+=','+_0xe18c7e[_0xe3ea('0x77')];}var _0x579d02=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0xb1'),_0x2dfcc4);if(_0x579d02[_0xe3ea('0xa6')]===-0x1){return _0x579d02;}var _0x24a584=this['getAndSetVariable'](_0xe3ea('0xb2'),_0xe3ea('0xce'));if(_0x24a584[_0xe3ea('0xa6')]===-0x1){return _0x24a584;}var _0x310391=this[_0xe3ea('0xa5')](_0xe3ea('0xb4'),_0xe3ea('0xcf'));if(_0x310391['result']===-0x1){return _0x310391;}var _0x232b80=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x232b80[_0xe3ea('0xa6')]===-0x1){return _0x232b80;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format'](_0xe3ea('0xb7'),_0x2dfcc4));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xd0')]=function(_0x320197){logger['info'](util['format'](_0xe3ea('0xd1'),_0x320197[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x320197[_0xe3ea('0xaf')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20grammar\x20configured');}var _0x4b8ff1=_0x320197[_0xe3ea('0xaf')];if(this[_0xe3ea('0xaa')](_0x320197[_0xe3ea('0x77')])){_0x4b8ff1+=','+_0x320197['options'];}var _0x4cee25=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0xb1'),_0x4b8ff1);if(_0x4cee25[_0xe3ea('0xa6')]===-0x1){return _0x4cee25;}var _0x444019=this[_0xe3ea('0xa5')](_0xe3ea('0xb2'),_0xe3ea('0xd2'));if(_0x444019[_0xe3ea('0xa6')]===-0x1){return _0x444019;}var _0x1cb104=this[_0xe3ea('0xa5')]('RECOG_INPUT()',_0xe3ea('0xd3'));if(_0x1cb104['result']===-0x1){return _0x1cb104;}var _0xaaa0b2=this[_0xe3ea('0xa5')](_0xe3ea('0xb6'),_0xe3ea('0xd4'));if(_0xaaa0b2['result']===-0x1){return _0xaaa0b2;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format'](_0xe3ea('0xb7'),_0x4b8ff1));};AGIVertices[_0xe3ea('0x10')]['database']=function(_0x41683b){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0xd5'),_0x41683b[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x41683b[_0xe3ea('0xd6')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x41683b,_0xe3ea('0xd7'));}var _0x3ac5a3=this[_0xe3ea('0x16')][_0xe3ea('0xc3')](this,_0x41683b['odbc_id']);if(!_0x3ac5a3){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x41683b,_0xe3ea('0xd8'));}if(!this['isConfigured'](_0x41683b['query'])){return this[_0xe3ea('0xd')]['error'](_0x41683b,'no\x20query\x20configured');}var _0x16148b=_0x41683b['query'][_0xe3ea('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')](_0xe3ea('0xd9'),_0x16148b));var _0x339578=this[_0xe3ea('0x27')][_0xe3ea('0xc3')](this,_0x3ac5a3,_0x16148b);this[_0xe3ea('0x34')]['sync'](this,_0x41683b,_0x16148b);if(!this[_0xe3ea('0xaa')](_0x41683b[_0xe3ea('0xda')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3b7272=this['getVariable']['sync'](this,_0x41683b[_0xe3ea('0xda')]);if(!_0x3b7272){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x41683b,_0xe3ea('0xdb'));}var _0x535591=this;_0x339578[_0xe3ea('0xdc')](function(_0x4b04b9,_0x191170){Object[_0xe3ea('0xdd')](_0x4b04b9)[_0xe3ea('0xdc')](function(_0x46cb44){_0x535591['channel']['setVariable'](util[_0xe3ea('0x52')](_0xe3ea('0xde'),_0x3b7272,_0x191170,_0x46cb44),_0x4b04b9[_0x46cb44]);});});this['channel'][_0xe3ea('0xa0')](util[_0xe3ea('0x52')](_0xe3ea('0xdf'),_0x3b7272),_0x339578[_0xe3ea('0x9c')]);return this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')](_0xe3ea('0xe0'),_0x3b7272));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xe1')]=function(_0x45dffe){logger[_0xe3ea('0xe2')](util[_0xe3ea('0x52')](_0xe3ea('0xe3'),_0x45dffe[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x45dffe[_0xe3ea('0xe4')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x45dffe,_0xe3ea('0xe5'));}var _0x52b6d7=this[_0xe3ea('0xe6')]['sync'](this,_0x45dffe[_0xe3ea('0xe4')]);if(!_0x52b6d7){return this['channel']['error'](_0x45dffe,'no\x20user\x20found');}var _0x2f990a=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0xe7'),[util[_0xe3ea('0x52')](_0xe3ea('0xe8'),_0x52b6d7),_0x45dffe[_0xe3ea('0x65')],_0x45dffe[_0xe3ea('0xe9')],_0x45dffe[_0xe3ea('0x64')]]);if(_0x2f990a[_0xe3ea('0xa6')]===-0x1){return _0x2f990a;}return this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xea'),_0xe3ea('0xe7')));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xeb')]=function(_0x4e6ee0){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0xec'),_0x4e6ee0[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x4e6ee0[_0xe3ea('0x79')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20key\x20configured');}if(!this[_0xe3ea('0xaa')](_0x4e6ee0[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}this[_0xe3ea('0xd')]['bot']=!![];this[_0xe3ea('0x34')](_0x4e6ee0);this[_0xe3ea('0x3f')](_0x4e6ee0[_0xe3ea('0x5a')],'in','','');this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('Trying\x20Dialogflow:\x20%s',_0x4e6ee0[_0xe3ea('0x5a')]));var _0x4148df=this[_0xe3ea('0x78')][_0xe3ea('0xc3')](this,_0x4e6ee0);if(_0x4148df){for(var _0x37637c in _0x4148df){if(_0x4148df[_0xe3ea('0x96')](_0x37637c)){this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util[_0xe3ea('0x52')](_0xe3ea('0xed'),_0x37637c[_0xe3ea('0x6b')]()),_0x4148df[_0x37637c]);}}this[_0xe3ea('0x3f')](_0x4148df['speech'],_0xe3ea('0xee'),'dialogflow','');return this[_0xe3ea('0xd')]['noop'](util['format'](_0xe3ea('0xef'),_0x4148df['speech']));}return this[_0xe3ea('0xd')]['error'](_0x4e6ee0,_0xe3ea('0xf0'));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xf1')]=function(_0x44daca){logger['info'](util['format'](_0xe3ea('0xf2'),_0x44daca[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x44daca[_0xe3ea('0x7c')])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0xf3'));}if(!this['isConfigured'](_0x44daca[_0xe3ea('0xf4')])){return this['channel'][_0xe3ea('0xab')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x44daca[_0xe3ea('0x7d')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20private_key\x20configured');}if(!this[_0xe3ea('0xaa')](_0x44daca['dialogflowV2_language'])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0xf5'));}if(!this[_0xe3ea('0xaa')](_0x44daca[_0xe3ea('0x5a')])){return this['channel'][_0xe3ea('0xab')]('no\x20text\x20configured');}this['channel'][_0xe3ea('0xf6')]=!![];this[_0xe3ea('0x34')](_0x44daca);this[_0xe3ea('0x3f')](_0x44daca[_0xe3ea('0x5a')],'in','','');this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xf7'),_0x44daca[_0xe3ea('0x5a')]));var _0xaa3440=this['googleDialogflowV2'][_0xe3ea('0xc3')](this,_0x44daca);if(_0xaa3440){for(var _0x28afa3 in _0xaa3440){if(_0xaa3440[_0xe3ea('0x96')](_0x28afa3)){if(_0x28afa3!==_0xe3ea('0xf8')){this[_0xe3ea('0xd')]['setVariable'](util[_0xe3ea('0x52')](_0xe3ea('0xed'),_0x28afa3['toUpperCase']()),_0xaa3440[_0x28afa3]);}}}this[_0xe3ea('0x3f')](_0xaa3440['speech'],_0xe3ea('0xee'),_0xe3ea('0xf1'),_0xaa3440[_0xe3ea('0xf8')]);return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xf9'),_0xaa3440[_0xe3ea('0xfa')]));}return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x44daca,_0xe3ea('0xfb'));};AGIVertices['prototype'][_0xe3ea('0xfc')]=function(_0x22349a){logger['info'](util[_0xe3ea('0x52')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x22349a[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x22349a[_0xe3ea('0xfd')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xfe'));}if(!this[_0xe3ea('0xaa')](_0x22349a[_0xe3ea('0xff')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20username\x20configured');}if(!this[_0xe3ea('0xaa')](_0x22349a[_0xe3ea('0x100')])){return this['channel']['noop'](_0xe3ea('0x101'));}if(!this[_0xe3ea('0xaa')](_0x22349a['ndassistant_url'])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}this[_0xe3ea('0xd')]['bot']=!![];this[_0xe3ea('0x34')](_0x22349a);this[_0xe3ea('0x3f')](_0x22349a[_0xe3ea('0x5a')],'in','','');this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format'](_0xe3ea('0x102'),_0x22349a[_0xe3ea('0x5a')]));var _0x3f56ed=this[_0xe3ea('0x7f')][_0xe3ea('0xc3')](this,_0x22349a);if(_0x3f56ed){for(var _0x20ef4c in _0x3f56ed){if(_0x3f56ed['hasOwnProperty'](_0x20ef4c)){this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util[_0xe3ea('0x52')]('SESTEK_NDA_%s',_0x20ef4c['toUpperCase']()),_0x3f56ed[_0x20ef4c]);}}this[_0xe3ea('0x3f')](_0x3f56ed[_0xe3ea('0xfa')],_0xe3ea('0xee'),'sesteknda','');if(_0x3f56ed[_0xe3ea('0x103')]){this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x104'),_0x3f56ed[_0xe3ea('0x103')]));var _0x1cc7bc=this[_0xe3ea('0xd')][_0xe3ea('0x105')](_0x3f56ed[_0xe3ea('0x103')]);try{fs['unlink'](_0x3f56ed[_0xe3ea('0x103')]+_0xe3ea('0x106'));}catch(_0x3ea55e){logger[_0xe3ea('0x2f')](_0x3ea55e);}return _0x1cc7bc;}else{return this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x107'),_0x3f56ed[_0xe3ea('0xfa')]));}}return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x22349a,_0xe3ea('0x108'));};AGIVertices['prototype'][_0xe3ea('0x109')]=function(_0x182e2a){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x10a'),_0x182e2a[_0xe3ea('0x36')]));return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0x109'));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x10b')]=function(_0x382344){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x10c'),_0x382344[_0xe3ea('0x36')]));var _0x2094b8='';if(_0x382344[_0xe3ea('0x10d')]){if(!this[_0xe3ea('0xaa')](_0x382344[_0xe3ea('0x10d')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x382344,_0xe3ea('0x10e'));}else{var _0x5ee076=parseInt(_0x382344[_0xe3ea('0x10d')],0xa);if(isNaN(_0x5ee076)){_0x2094b8=_0x382344[_0xe3ea('0x10d')];}else{_0x2094b8=this['getTrunk'][_0xe3ea('0xc3')](this,_0x382344[_0xe3ea('0x10d')]);if(!_0x2094b8){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x382344,_0xe3ea('0x10f'));}}}}else if(_0x382344[_0xe3ea('0x110')]){_0x2094b8=_0x382344[_0xe3ea('0x110')];}else{return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x382344,_0xe3ea('0x10e'));}var _0x2c3048=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0xe7'),[util['format']('SIP/%s/%s',_0x2094b8,_0x382344['phone']),_0x382344['timeout'],_0x382344[_0xe3ea('0xe9')],_0x382344[_0xe3ea('0x64')]]);if(_0x2c3048['result']===-0x1){return _0x2c3048;}return this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')](_0xe3ea('0xea'),_0xe3ea('0xe7')));};AGIVertices[_0xe3ea('0x10')]['finally']=function(_0x5050ed){logger['info'](util[_0xe3ea('0x52')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5050ed['label']));return this['channel'][_0xe3ea('0xab')](_0xe3ea('0x111'));};AGIVertices['prototype'][_0xe3ea('0x112')]=function(_0x28b894){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x113'),_0x28b894['label']));if(_0x28b894['retry']===0x0){return this[_0xe3ea('0xa8')](_0x28b894);}_0x28b894[_0xe3ea('0x114')]-=0x1;if(!this[_0xe3ea('0xaa')](_0x28b894[_0xe3ea('0x115')])){return this['channel'][_0xe3ea('0x2f')](_0x28b894,_0xe3ea('0x116'));}var _0x32be10=this[_0xe3ea('0x1c')][_0xe3ea('0xc3')](this,_0x28b894[_0xe3ea('0x115')]);if(!_0x32be10){return this[_0xe3ea('0xd')]['error'](_0x28b894,_0xe3ea('0x117'));}if(!this['isConfigured'](_0x28b894[_0xe3ea('0xda')])){return this['channel'][_0xe3ea('0x2f')](_0xe3ea('0x118'));}var _0x83ae5d=this[_0xe3ea('0xd')][_0xe3ea('0x119')](_0x32be10,_0x28b894['response'],_0x28b894[_0xe3ea('0x11a')]);var _0x28e24c=_0x83ae5d[_0xe3ea('0xa6')]?_0x83ae5d[_0xe3ea('0xa6')][_0xe3ea('0x11b')]():'';logger['info'](_0xe3ea('0x11c'),JSON[_0xe3ea('0x73')](_0x83ae5d));if(_0x83ae5d[_0xe3ea('0xa6')]===-0x1){this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x28b894,_0x28e24c);return _0x83ae5d;}else if(_0x83ae5d[_0xe3ea('0xa4')]==='timeout'){_0x83ae5d['result']=_0x28e24c[_0xe3ea('0x9c')]>=parseInt(_0x28b894[_0xe3ea('0x11d')])?'x':'i';}else{_0x83ae5d['result']=_0x28e24c[_0xe3ea('0x9c')]>=parseInt(_0x28b894[_0xe3ea('0x11d')])&&_0x28e24c[_0xe3ea('0x9c')]<=parseInt(_0x28b894[_0xe3ea('0x11a')])?'x':'i';}var _0x3123ce=this[_0xe3ea('0xa3')][_0xe3ea('0xc3')](this,_0x28b894[_0xe3ea('0xda')]);if(!_0x3123ce){return this['channel'][_0xe3ea('0x2f')](_0x28b894,_0xe3ea('0xdb'));}this['channel'][_0xe3ea('0xa0')](_0x3123ce,_0x28e24c);if(this[_0xe3ea('0xaa')](_0x28b894[_0xe3ea('0x11e')])){var _0x510659=parseInt(_0x28b894['hiddendigitsnum'],0xa);var _0x1b656a=rs[_0xe3ea('0x11f')]({'charset':'*','length':_0x510659});var _0x26c8cb=_0x28e24c[_0xe3ea('0x9c')];if(_0x26c8cb>0x0){if(_0x26c8cb>_0x510659){this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x28b894,_0x28b894['hiddendigitspos']==='first'?_0x1b656a+_0x28e24c[_0xe3ea('0x120')](_0x510659):_0x28e24c[_0xe3ea('0x120')](0x0,_0x26c8cb-_0x510659)+_0x1b656a);}else{this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x28b894,rs[_0xe3ea('0x11f')]({'charset':'*','length':_0x26c8cb}));}}else{this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x28b894,'');}}else{this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x28b894,_0x28e24c);}return _0x83ae5d;};AGIVertices['prototype']['getsecretdigits']=function(_0x419689){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x121'),_0x419689[_0xe3ea('0x36')]));return this[_0xe3ea('0x112')](_0x419689);};AGIVertices[_0xe3ea('0x10')]['goal']=function(_0x5e4bbc){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x122'),_0x5e4bbc['label']));this['createSquareDetailsReport'][_0xe3ea('0xc3')](this,_0x5e4bbc,_0x5e4bbc['goalname']);return this['channel']['noop'](util[_0xe3ea('0x52')](_0xe3ea('0x123'),_0x5e4bbc[_0xe3ea('0x124')]));};AGIVertices[_0xe3ea('0x10')]['awspolly']=function(_0x24aa8c){logger['info'](util['format'](_0xe3ea('0x125'),_0x24aa8c[_0xe3ea('0x36')]));if(!this['isConfigured'](_0x24aa8c['aws_access_key_id'])||!this[_0xe3ea('0xaa')](_0x24aa8c['aws_secret_access_key'])){return this['channel'][_0xe3ea('0xab')](_0xe3ea('0x126'));}if(!this['isConfigured'](_0x24aa8c[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0xac'));}this['channel'][_0xe3ea('0xab')](util['format'](_0xe3ea('0x127'),_0x24aa8c['text']));var _0x3942ca=this[_0xe3ea('0x86')][_0xe3ea('0xc3')](this,_0x24aa8c);if(_0x3942ca){this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x128'),_0x3942ca));var _0xf37ed6=this[_0xe3ea('0xd')][_0xe3ea('0x105')](_0x3942ca);try{fs['unlink'](_0x3942ca+_0xe3ea('0x106'));}catch(_0x25a940){logger[_0xe3ea('0x2f')](_0x25a940);}return _0xf37ed6;}return this[_0xe3ea('0xd')]['error'](_0x24aa8c,_0xe3ea('0x129'));};AGIVertices[_0xe3ea('0x10')]['awslex']=function(_0x288b69){logger[_0xe3ea('0x2a')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x288b69[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x288b69[_0xe3ea('0x87')])||!this[_0xe3ea('0xaa')](_0x288b69['aws_secret_access_key'])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x126'));}if(!this[_0xe3ea('0xaa')](_0x288b69[_0xe3ea('0x8f')])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0x12a'));}if(!this['isConfigured'](_0x288b69[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}this[_0xe3ea('0xd')][_0xe3ea('0xf6')]=!![];this[_0xe3ea('0x34')](_0x288b69);this[_0xe3ea('0x3f')](_0x288b69['text'],'in','','');this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x12b'),_0x288b69[_0xe3ea('0x5a')]));var _0x40e037=this['awsLex'][_0xe3ea('0xc3')](this,_0x288b69);if(_0x40e037){for(var _0x130271 in _0x40e037){if(_0x40e037[_0xe3ea('0x96')](_0x130271)&&_[_0xe3ea('0x97')](_0x40e037[_0x130271])){this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util[_0xe3ea('0x52')](_0xe3ea('0x12c'),_0x130271[_0xe3ea('0x6b')]()),_0x40e037[_0x130271]);}}if(_[_0xe3ea('0x42')](_0x40e037[_0xe3ea('0x12d')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x12e'));}else{this[_0xe3ea('0x3f')](_0x40e037[_0xe3ea('0x12d')],'out',_0xe3ea('0x12f'),'');return this['channel']['noop'](util[_0xe3ea('0x52')](_0xe3ea('0x130'),_0x40e037['message']));}}return this['channel'][_0xe3ea('0x2f')](_0x288b69,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x131')]=function(_0x360ec8){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x132'),_0x360ec8[_0xe3ea('0x36')],_0x360ec8[_0xe3ea('0x65')]));if(!this[_0xe3ea('0xaa')](_0x360ec8[_0xe3ea('0x79')])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0x133'));}var _0x1c0444=_0xe3ea('0x134');var _0x39f983=util[_0xe3ea('0x52')](_0xe3ea('0x135'),FILES_PATH,rs['generate'](0x4));var _0xabfaef=util[_0xe3ea('0x52')]('%s.%s',_0x39f983,_0x1c0444);var _0x4424c1=!![];if(_0x360ec8[_0xe3ea('0x136')]===_0xe3ea('0x137')){_0x4424c1=![];}var _0x4e93a5=this[_0xe3ea('0xd')]['recordFile'](_0x39f983,_0x1c0444,_0x360ec8[_0xe3ea('0x138')],_0x360ec8['timeout'],undefined,_0x4424c1);if(_0x4e93a5[_0xe3ea('0xa6')]!==-0x1){this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')]('google\x20%s\x20file\x20created',_0xabfaef));var _0xbb27cc=this[_0xe3ea('0x90')]['sync'](this,_0x360ec8,_0xabfaef);if(_0xbb27cc){for(var _0x4200a5 in _0xbb27cc){if(_0xbb27cc[_0xe3ea('0x96')](_0x4200a5)){this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util['format'](_0xe3ea('0x139'),_0x4200a5[_0xe3ea('0x6b')]()),_0xbb27cc[_0x4200a5]);}}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x13a'),JSON[_0xe3ea('0x73')](_0xbb27cc)));}}return _0x4e93a5;};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x13b')]=function(_0x118d09){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x118d09[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x118d09[_0xe3ea('0x13c')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x13d'));}if(!this['isConfigured'](_0x118d09[_0xe3ea('0x93')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x13e'));}var _0xcc0ddf='wav';var _0x6b8b0e=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x5e921c=util[_0xe3ea('0x52')](_0xe3ea('0x9e'),_0x6b8b0e,_0xcc0ddf);var _0x13e99a=!![];if(_0x118d09[_0xe3ea('0x136')]===_0xe3ea('0x137')){_0x13e99a=![];}var _0x4864ab=this[_0xe3ea('0xd')][_0xe3ea('0x13f')](_0x6b8b0e,_0xcc0ddf,_0x118d09[_0xe3ea('0x138')],_0x118d09['timeout'],undefined,_0x13e99a);if(_0x4864ab[_0xe3ea('0xa6')]!==-0x1){this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x140'),_0x5e921c));var _0xc3626b=this[_0xe3ea('0x92')][_0xe3ea('0xc3')](this,_0x118d09,_0x5e921c);if(_0xc3626b){for(var _0x49845f in _0xc3626b){if(_0xc3626b[_0xe3ea('0x96')](_0x49845f)){this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util['format'](_0xe3ea('0x141'),_0x49845f[_0xe3ea('0x6b')]()),_0xc3626b[_0x49845f]);}}return this['channel']['noop'](util[_0xe3ea('0x52')](_0xe3ea('0x142'),JSON[_0xe3ea('0x73')](_0xc3626b)));}}return _0x4864ab;};AGIVertices[_0xe3ea('0x10')]['gotoc']=function(_0x37ad27){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x37ad27['label']));return this['channel'][_0xe3ea('0x143')](_0x37ad27['context'],_0x37ad27[_0xe3ea('0x3d')],_0x37ad27[_0xe3ea('0x3e')]);};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x144')]=function(_0x36955a){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x36955a[_0xe3ea('0x36')]));if(!this['isConfigured'](_0x36955a[_0xe3ea('0x145')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x36955a,_0xe3ea('0x146'));}try{var _0x233979=eval(_0x36955a[_0xe3ea('0x145')])?'true':_0xe3ea('0x147');this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x148'),_0x36955a[_0xe3ea('0x145')],_0x233979));return{'code':0xc8,'result':_0x233979};}catch(_0x3a836c){return{'code':0xc8,'result':_0xe3ea('0x147')};}};AGIVertices['prototype']['gotoiftime']=function(_0x501198){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x149'),_0x501198[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x501198[_0xe3ea('0x14a')])){return this[_0xe3ea('0xd')]['error'](_0x501198,_0xe3ea('0x14b'));}var _0x155530=this['getIntervals']['sync'](this,_0x501198[_0xe3ea('0x14a')]);if(!_0x155530){return this['channel'][_0xe3ea('0x2f')](_0x501198,'no\x20intervals\x20found');}for(var _0x599f54=0x0;_0x599f54<_0x155530[_0xe3ea('0x9c')];_0x599f54+=0x1){var _0x54656a=this[_0xe3ea('0xd')]['getVariable'](util[_0xe3ea('0x52')](_0xe3ea('0x14c'),_0x155530[_0x599f54]));if(_0x54656a['result']===-0x1){return _0x54656a;}logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('IFTIME\x20%s\x20%s',_0x155530[_0x599f54],_0x54656a[_0xe3ea('0xa4')]));if(_0x54656a[_0xe3ea('0xa4')]===_0xe3ea('0x14d')){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x14e'),_0x155530[_0x599f54],_0xe3ea('0x14d')));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('IFTIME\x20%s\x20%s',_0x155530[_0x599f54],_0xe3ea('0x14d')));return{'code':0xc8,'result':_0xe3ea('0x14d')};}else{logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('IFTIME\x20%s\x20%s',_0x155530[_0x599f54],_0xe3ea('0x147')));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format']('IFTIME\x20%s\x20%s',_0x155530[_0x599f54],_0xe3ea('0x147')));}}return{'code':0xc8,'result':_0xe3ea('0x147')};};AGIVertices[_0xe3ea('0x10')]['hangup']=function(_0x4c1558){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x14f'),_0x4c1558[_0xe3ea('0x36')]));return this[_0xe3ea('0xd')][_0xe3ea('0x150')]();};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x151')]=function(_0x5e4f94){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x152'),_0x5e4f94[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x5e4f94[_0xe3ea('0x79')])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0x133'));}var _0x5bbda8='wav';var _0xb1151a=util[_0xe3ea('0x52')](_0xe3ea('0x135'),FILES_PATH,rs[_0xe3ea('0x11f')](0x4));var _0x5d854a=util[_0xe3ea('0x52')](_0xe3ea('0x9e'),_0xb1151a,_0x5bbda8);var _0x556a6f=!![];if(_0x5e4f94['beep']===_0xe3ea('0x137')){_0x556a6f=![];}var _0x1ce9a9=this['channel'][_0xe3ea('0x13f')](_0xb1151a,_0x5bbda8,_0x5e4f94[_0xe3ea('0x138')],_0x5e4f94[_0xe3ea('0x65')],undefined,_0x556a6f);if(_0x1ce9a9['result']!==-0x1){this['channel'][_0xe3ea('0xab')](util['format'](_0xe3ea('0x153'),_0x5d854a));var _0x94f6c7=this['ispeechASR'][_0xe3ea('0xc3')](this,_0x5e4f94,_0x5d854a);if(_0x94f6c7){for(var _0xa97f37 in _0x94f6c7){if(_0x94f6c7['hasOwnProperty'](_0xa97f37)){this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util[_0xe3ea('0x52')](_0xe3ea('0x154'),_0xa97f37[_0xe3ea('0x6b')]()),_0x94f6c7[_0xa97f37]);}}return this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')]('IspeechASR\x20Result\x20%s',JSON[_0xe3ea('0x73')](_0x94f6c7)));}}return _0x1ce9a9;};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x155')]=function(_0xe5d182){logger['info'](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xe5d182[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0xe5d182[_0xe3ea('0x79')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20key\x20configured');}if(!this[_0xe3ea('0xaa')](_0xe5d182[_0xe3ea('0x5a')])){return this['channel'][_0xe3ea('0xab')](_0xe3ea('0xac'));}this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')](_0xe3ea('0x156'),_0xe5d182[_0xe3ea('0x5a')]));var _0x2cf493=this[_0xe3ea('0x80')][_0xe3ea('0xc3')](this,_0xe5d182);if(_0x2cf493){this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format'](_0xe3ea('0x153'),_0x2cf493));var _0x2097a5=this['channel'][_0xe3ea('0x105')](_0x2cf493,_0xe5d182[_0xe3ea('0x138')]);try{fs[_0xe3ea('0x157')](_0x2cf493+_0xe3ea('0x106'));}catch(_0x1cefe6){logger[_0xe3ea('0x2f')](_0x1cefe6);}return _0x2097a5;}return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0xe5d182,_0xe3ea('0x158'));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x159')]=function(_0x2b7d0e){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2b7d0e[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x2b7d0e['findBy'])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x2b7d0e,_0xe3ea('0x15a'));}logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x15b'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x2b7d0e['findBy']));var _0xad53d2=this[_0xe3ea('0x51')][_0xe3ea('0xc3')](this,_0x2b7d0e[_0xe3ea('0x15c')]);if(_0xad53d2){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x15d'),this['channel'][_0xe3ea('0x39')],_0x2b7d0e[_0xe3ea('0x15c')]));this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x15d'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x2b7d0e[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x15e')};}else{logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x15f'),this['channel'][_0xe3ea('0x39')],_0x2b7d0e[_0xe3ea('0x15c')]));this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x2b7d0e[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x160')};}};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x161')]=function(_0x49f91f){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x162'),_0x49f91f[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x49f91f[_0xe3ea('0x15c')])){return this[_0xe3ea('0xd')]['error'](_0x49f91f,_0xe3ea('0x15a'));}logger['info'](util['format'](_0xe3ea('0x15b'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x49f91f['findBy']));var _0x226ccc=this['agentLogout'][_0xe3ea('0xc3')](this,_0x49f91f['findBy']);if(_0x226ccc){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x15d'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x49f91f[_0xe3ea('0x15c')]));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x15d'),this['channel'][_0xe3ea('0x39')],_0x49f91f[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x15e')};}else{logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x15f'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x49f91f[_0xe3ea('0x15c')]));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format'](_0xe3ea('0x15f'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x49f91f[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x160')};}};AGIVertices['prototype'][_0xe3ea('0x163')]=function(_0x1582b7){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x164'),_0x1582b7[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x1582b7[_0xe3ea('0x165')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x1582b7,'no\x20operation\x20configured');}this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x166'),_0x1582b7['operation']));var _0x16e6d3=eval(_0x1582b7[_0xe3ea('0x165')]);if(!this[_0xe3ea('0xaa')](_0x1582b7[_0xe3ea('0xda')])){return this['channel'][_0xe3ea('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4bffc7=this[_0xe3ea('0xa3')][_0xe3ea('0xc3')](this,_0x1582b7[_0xe3ea('0xda')]);if(!_0x4bffc7){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x1582b7,_0xe3ea('0xdb'));}if(_[_0xe3ea('0x9f')](_0x16e6d3)){var _0x5b1770=this;_0x16e6d3[_0xe3ea('0xdc')](function(_0x5ebe4f,_0x46a0c5){_0x5b1770[_0xe3ea('0xd')][_0xe3ea('0xa0')](util[_0xe3ea('0x52')](_0xe3ea('0x167'),_0x4bffc7,_0x46a0c5),_0x5ebe4f);});return this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x168'),_0x4bffc7));}else{return this[_0xe3ea('0xd')][_0xe3ea('0xa0')](_0x4bffc7,_0x16e6d3);}};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xb')]=function(_0x15413d){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x169'),_0x15413d[_0xe3ea('0x36')]));if(_0x15413d[_0xe3ea('0x114')]===0x0){return this[_0xe3ea('0xa8')](_0x15413d);}_0x15413d[_0xe3ea('0x114')]-=0x1;if(!this[_0xe3ea('0xaa')](_0x15413d['file_id'])){return this['channel'][_0xe3ea('0x2f')](_0x15413d,_0xe3ea('0x116'));}var _0xa9b299=this[_0xe3ea('0x1c')][_0xe3ea('0xc3')](this,_0x15413d[_0xe3ea('0x115')]);if(!_0xa9b299){return this[_0xe3ea('0xd')]['error'](_0x15413d,_0xe3ea('0x117'));}var _0x3b16cb=this[_0xe3ea('0xd')][_0xe3ea('0x119')](_0xa9b299,_0x15413d[_0xe3ea('0x16a')],_0x15413d[_0xe3ea('0x16b')]);var _0x28b6a0=_0x3b16cb[_0xe3ea('0xa6')];if(_0x3b16cb[_0xe3ea('0xa6')]===-0x1){this['createSquareDetailsReport'][_0xe3ea('0xc3')](this,_0x15413d,'-1');return _0x3b16cb;}else if(_0x3b16cb[_0xe3ea('0xa4')]===_0xe3ea('0x65')){_0x3b16cb[_0xe3ea('0xa6')]=_0x3b16cb[_0xe3ea('0xa6')][_0xe3ea('0x9c')]>0x0?_0x3b16cb['result']:'t';}else if(_[_0xe3ea('0x41')](_0x3b16cb[_0xe3ea('0xa6')])){_0x3b16cb[_0xe3ea('0xa6')]='#';_0x28b6a0='#';}if(!this[_0xe3ea('0xaa')](_0x15413d[_0xe3ea('0xda')])){this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x118'));}else{var _0x1d1f5a=this[_0xe3ea('0xa3')][_0xe3ea('0xc3')](this,_0x15413d['variable_id']);if(!_0x1d1f5a){return this[_0xe3ea('0xd')]['error'](_0x15413d,_0xe3ea('0xdb'));}this['channel'][_0xe3ea('0xa0')](_0x1d1f5a,_0x28b6a0);}this['createSquareDetailsReport'][_0xe3ea('0xc3')](this,_0x15413d,_0x28b6a0);return _0x3b16cb;};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0xab')]=function(_0x36592d){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x16c'),_0x36592d[_0xe3ea('0x36')]));return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0x36592d[_0xe3ea('0x16d')]||_0x36592d[_0xe3ea('0x36')]);};AGIVertices['prototype'][_0xe3ea('0x16e')]=function(_0x363ba0){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x16f'),_0x363ba0['label']));if(!this[_0xe3ea('0xaa')](_0x363ba0[_0xe3ea('0x15c')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x363ba0,'no\x20find\x20by\x20configured');}logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x15b'),this['channel'][_0xe3ea('0x39')],_0x363ba0[_0xe3ea('0x15c')]));var _0x3b8e7a=this['getPause'][_0xe3ea('0xc3')](this,_0x363ba0[_0xe3ea('0x170')]);var _0x1b76b=this[_0xe3ea('0x4d')][_0xe3ea('0xc3')](this,_0x363ba0[_0xe3ea('0x15c')],_0x3b8e7a);if(_0x1b76b){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x363ba0['findBy']));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x363ba0[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x15e')};}else{logger[_0xe3ea('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x363ba0[_0xe3ea('0x15c')]));this[_0xe3ea('0xd')]['noop'](util['format'](_0xe3ea('0x15d'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x363ba0[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x160')};}};AGIVertices[_0xe3ea('0x10')]['playback']=function(_0x5ee277){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x171'),_0x5ee277[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x5ee277['file_id'])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x5ee277,_0xe3ea('0x116'));}var _0x47936f=this[_0xe3ea('0x1c')][_0xe3ea('0xc3')](this,_0x5ee277[_0xe3ea('0x115')]);if(!_0x47936f){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x5ee277,_0xe3ea('0x117'));}var _0x60e7a7=this[_0xe3ea('0xd')][_0xe3ea('0x55')](_0xe3ea('0x172'),[_0x47936f,_0x5ee277[_0xe3ea('0xe9')]]);if(_0x60e7a7['result']===-0x1){return _0x60e7a7;}return this['channel']['noop'](util[_0xe3ea('0x52')](_0xe3ea('0xc8'),_0xe3ea('0x172'),_0x47936f));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x173')]=function(_0x36a566){logger[_0xe3ea('0x2a')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x36a566[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x36a566[_0xe3ea('0x174')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x36a566,_0xe3ea('0x175'));}var _0x2b962='';var _0x411f2d=parseInt(_0x36a566[_0xe3ea('0x174')],0xa);if(isNaN(_0x411f2d)){_0x2b962=_0x36a566[_0xe3ea('0x174')];}else{_0x2b962=this[_0xe3ea('0x12')]['sync'](this,_0x36a566[_0xe3ea('0x174')]);if(!_0x2b962){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x36a566,_0xe3ea('0x176'));}}var _0x43816b='';if(this[_0xe3ea('0xaa')](_0x36a566[_0xe3ea('0x115')])){var _0x525892=this[_0xe3ea('0x1c')][_0xe3ea('0xc3')](this,_0x36a566[_0xe3ea('0x115')]);if(_0x525892){_0x43816b=_0x525892;}}this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x36a566,_0x2b962);if(_0x36a566['opts'][_0xe3ea('0x177')]('x')<0x0){_0x36a566['opts']+='x';}if(_0x36a566[_0xe3ea('0xe9')][_0xe3ea('0x177')]('X')<0x0){_0x36a566[_0xe3ea('0xe9')]+='X';}this[_0xe3ea('0xd')]['setVariable'](_0xe3ea('0x178'),_0x2b962?_0x2b962[_0xe3ea('0x179')]():'');var _0x1cc683=this[_0xe3ea('0xd')]['exec'](_0xe3ea('0x17a'),[_0x2b962,_0x36a566[_0xe3ea('0xe9')],_0x36a566[_0xe3ea('0x64')],_0x43816b,_0x36a566[_0xe3ea('0x65')],_0x36a566['agi'],_0x36a566[_0xe3ea('0x17b')],_0x36a566[_0xe3ea('0x17c')],'',_0x36a566[_0xe3ea('0x17d')]]);if(_0x1cc683['result']===-0x1){return _0x1cc683;}return this['channel']['noop'](util[_0xe3ea('0x52')](_0xe3ea('0xc8'),'QUEUE',_0x2b962));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x17e')]=function(_0x4e6428){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x17f'),_0x4e6428[_0xe3ea('0x36')]));var _0x45269d=_0x4e6428[_0xe3ea('0x180')]||'wav';var _0x3d1e2f=util[_0xe3ea('0x52')](_0xe3ea('0x181'),this['channel'][_0xe3ea('0x35')],rs[_0xe3ea('0x11f')](0x5));var _0x10f70e=util[_0xe3ea('0x52')](_0xe3ea('0x182'),FILES_PATH,_0x3d1e2f,_0x45269d);var _0x2515b5=util['format'](_0xe3ea('0x135'),FILES_PATH,_0x3d1e2f);this[_0xe3ea('0x3a')][_0xe3ea('0xc3')](this,_0x4e6428,_0x3d1e2f,_0x10f70e);this[_0xe3ea('0xd')][_0xe3ea('0xa0')](_0xe3ea('0x183'),_0x3d1e2f);logger[_0xe3ea('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x2515b5,_0x45269d,_0x4e6428[_0xe3ea('0x184')],_0x4e6428['timeout']);return this['channel'][_0xe3ea('0x13f')](_0x2515b5,_0x45269d,_0x4e6428['escape_digits'],_0x4e6428[_0xe3ea('0x65')],undefined,!![]);};AGIVertices[_0xe3ea('0x10')]['restapi']=function(_0x1a56bf){logger['info'](util[_0xe3ea('0x52')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1a56bf[_0xe3ea('0x36')]));if(!this['isConfigured'](_0x1a56bf[_0xe3ea('0x64')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')]('no\x20url\x20configured');}var _0x5da357=this[_0xe3ea('0x63')][_0xe3ea('0xc3')](this,_0x1a56bf);logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x185'),util[_0xe3ea('0x186')](_0x5da357,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1a56bf[_0xe3ea('0xda')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x187'));}var _0x1f758f=this[_0xe3ea('0xa3')][_0xe3ea('0xc3')](this,_0x1a56bf['variable_id']);if(!_0x1f758f){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x1a56bf,_0xe3ea('0xdb'));}this[_0xe3ea('0xd')][_0xe3ea('0xa0')](util['format'](_0xe3ea('0x188'),_0x1f758f),_0x5da357[_0xe3ea('0x76')]?_0x5da357[_0xe3ea('0x76')]:_0xe3ea('0x189'));this['channel']['setVariable'](util['format'](_0xe3ea('0x18a'),_0x1f758f),_0x5da357[_0xe3ea('0x75')]?_0x5da357[_0xe3ea('0x75')]:'OK');if(_0x5da357[_0xe3ea('0x6c')]){try{this[_0xe3ea('0x9d')](_0x5da357[_0xe3ea('0x6c')],_0x1f758f);}catch(_0x1336ba){logger['error'](util[_0xe3ea('0x52')](_0xe3ea('0x18b'),_0x1f758f));}}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0xe0'),_0x1f758f));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x18c')]=function(_0x2b594e){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x18d'),_0x2b594e[_0xe3ea('0x36')]));return this[_0xe3ea('0xd')]['sayDigits'](_0x2b594e[_0xe3ea('0x18e')]['replace'](/\s+/g,''),_0x2b594e[_0xe3ea('0x184')]);};AGIVertices['prototype']['saynumber']=function(_0xca2d01){logger[_0xe3ea('0x2a')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xca2d01[_0xe3ea('0x36')]));return this[_0xe3ea('0xd')][_0xe3ea('0x18f')](_0xca2d01[_0xe3ea('0x66')][_0xe3ea('0x57')](/\s+/g,''),_0xca2d01['escape_digits']);};AGIVertices[_0xe3ea('0x10')]['sayphonetic']=function(_0x4edcda){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x190'),_0x4edcda['label']));return this[_0xe3ea('0xd')]['sayPhonetic'](_0x4edcda[_0xe3ea('0x5a')],_0x4edcda[_0xe3ea('0x184')]);};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x191')]=function(_0x2ee0f3){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x192'),_0x2ee0f3['label']));if(!this[_0xe3ea('0xaa')](_0x2ee0f3[_0xe3ea('0x193')])){return this[_0xe3ea('0xd')]['noop'](_0xe3ea('0x194'));}var _0x28fb0e=this[_0xe3ea('0x195')][_0xe3ea('0xc3')](this,_0x2ee0f3[_0xe3ea('0x193')]);if(!_0x28fb0e||!_0x28fb0e[_0xe3ea('0x196')]){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x2ee0f3,'no\x20mail\x20account\x20found');}var _0x1c93b8={'from':util[_0xe3ea('0x52')](_0xe3ea('0x197'),_0x28fb0e[_0xe3ea('0x14')],_0x28fb0e['email']||_0x28fb0e[_0xe3ea('0x196')]['user']),'to':_0x2ee0f3['to']||'','cc':_0x2ee0f3['cc']||'','bcc':_0x2ee0f3[_0xe3ea('0x198')]||'','subject':_0x2ee0f3[_0xe3ea('0x199')],'html':_0x2ee0f3[_0xe3ea('0x5a')],'text':_0x2ee0f3[_0xe3ea('0x5a')]};var _0x4db893={'tls':{'rejectUnauthorized':![]}};if(_0x28fb0e[_0xe3ea('0x196')][_0xe3ea('0x19a')]){_0x4db893[_0xe3ea('0x19a')]=_0x28fb0e['Smtp'][_0xe3ea('0x19a')];}else{_0x4db893[_0xe3ea('0x19b')]=_0x28fb0e[_0xe3ea('0x196')][_0xe3ea('0x19b')];_0x4db893[_0xe3ea('0x19c')]=_0x28fb0e['Smtp'][_0xe3ea('0x19c')];_0x4db893[_0xe3ea('0x19d')]=_0x28fb0e[_0xe3ea('0x196')][_0xe3ea('0x19d')];}if(_0x28fb0e[_0xe3ea('0x196')][_0xe3ea('0x19e')]){_0x4db893[_0xe3ea('0x19f')]={'user':_0x28fb0e['Smtp']['user'],'pass':_0x28fb0e[_0xe3ea('0x196')][_0xe3ea('0x1a0')]};}if(this[_0xe3ea('0xaa')](_0x2ee0f3[_0xe3ea('0x1a1')])){}logger[_0xe3ea('0xe2')](_0xe3ea('0x1a2'),JSON[_0xe3ea('0x73')](_0x1c93b8));this['createSquareDetailsReport'][_0xe3ea('0xc3')](this,_0x2ee0f3,_0x2ee0f3[_0xe3ea('0x193')]);this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x1a3'),_0x28fb0e[_0xe3ea('0x14')]));this[_0xe3ea('0x20')][_0xe3ea('0xc3')](this,_0x4db893,_0x1c93b8);return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x1a4'));};AGIVertices['prototype'][_0xe3ea('0x1a5')]=function(_0x200b8e){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x1a6'),_0x200b8e[_0xe3ea('0x36')]));return this['channel'][_0xe3ea('0xab')](_0xe3ea('0x1a7'));};AGIVertices[_0xe3ea('0x10')]['sendSMS']=function(_0x1a5202){logger[_0xe3ea('0x2a')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1a5202[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x1a5202[_0xe3ea('0x1a8')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x1a9'));}var _0x41b61b=this[_0xe3ea('0x31')][_0xe3ea('0xc3')](this,_0x1a5202[_0xe3ea('0x1a8')]);if(!_0x41b61b){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x1a5202,_0xe3ea('0x1aa'));}var _0x61c655={'body':_0x1a5202[_0xe3ea('0x1ab')],'phone':_0x1a5202['to']||'','SmsAccountId':_0x41b61b['id']};logger[_0xe3ea('0xe2')]('sendSMS\x20message',JSON[_0xe3ea('0x73')](_0x61c655));this[_0xe3ea('0x34')][_0xe3ea('0xc3')](this,_0x1a5202,_0x1a5202[_0xe3ea('0x1a8')]);this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x41b61b[_0xe3ea('0x14')]));this[_0xe3ea('0x33')][_0xe3ea('0xc3')](this,_0x61c655);return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x1ac'));};AGIVertices['prototype'][_0xe3ea('0x1ad')]=function(_0x4c00cd){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x1ae'),_0x4c00cd[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x4c00cd['variable_id'])){return this['channel'][_0xe3ea('0x2f')](_0x4c00cd,'no\x20variable\x20selected');}var _0x42feac=this[_0xe3ea('0xa3')]['sync'](this,_0x4c00cd[_0xe3ea('0xda')]);if(!_0x42feac){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x4c00cd,_0xe3ea('0xdb'));}return this['channel'][_0xe3ea('0xa0')](_0x42feac,_0x4c00cd[_0xe3ea('0x1af')]);};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1b0')]=function(_0x10c17c){logger['info'](util[_0xe3ea('0x52')]('Enter\x20in\x20START\x20(%s)\x20block',_0x10c17c[_0xe3ea('0x36')]));this['channel'][_0xe3ea('0xab')](_0xe3ea('0x1b1'));if(_0x10c17c[_0xe3ea('0xbc')]===_0xe3ea('0x1b2')){this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x1b3'));return this[_0xe3ea('0xd')][_0xe3ea('0xbc')]();}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0x1b4'));};AGIVertices[_0xe3ea('0x10')]['subproject']=function(_0x2a55ef){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x1b5'),_0x2a55ef[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x2a55ef[_0xe3ea('0x1b6')])){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x2a55ef,_0xe3ea('0x1b7'));}var _0x5a5954=this[_0xe3ea('0x15')]['sync'](this,_0x2a55ef[_0xe3ea('0x1b6')]);if(!this['isConfigured'](_0x5a5954)){return this['channel'][_0xe3ea('0x2f')](_0x2a55ef,util[_0xe3ea('0x52')](_0xe3ea('0x1b8'),_0x2a55ef[_0xe3ea('0x1b6')]));}if(_0x5a5954===this['channel'][_0xe3ea('0x38')]){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x2a55ef,_0xe3ea('0x1b9'));}this[_0xe3ea('0x34')]['sync'](this,_0x2a55ef,_0x5a5954);var _0x1dd0c4=this['channel'][_0xe3ea('0x55')](_0xe3ea('0x1ba'),util[_0xe3ea('0x52')](_0xe3ea('0x1bb'),config[_0xe3ea('0xb8')][_0xe3ea('0x19b')]||'127.0.0.1',_0x5a5954,this[_0xe3ea('0xd')]['arg_1']));if(_0x1dd0c4[_0xe3ea('0xa6')]===-0x1){return _0x1dd0c4;}return this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('Executed\x20command\x20%s\x20%s',_0xe3ea('0x1ba'),_0x5a5954));};AGIVertices['prototype'][_0xe3ea('0x1bc')]=function(_0x354cc6){logger[_0xe3ea('0x2a')](util['format'](_0xe3ea('0x1bd'),_0x354cc6[_0xe3ea('0x36')]));var _0x34908a=this['shellCommand'][_0xe3ea('0xc3')](this,_0x354cc6[_0xe3ea('0xba')]);this['createSquareDetailsReport'][_0xe3ea('0xc3')](this,_0x354cc6,_0x354cc6[_0xe3ea('0xba')]);if(this[_0xe3ea('0xaa')](_0x354cc6['variable_id'])){var _0x218bc2=this[_0xe3ea('0xa3')][_0xe3ea('0xc3')](this,_0x354cc6[_0xe3ea('0xda')]);if(_0x218bc2){this['channel'][_0xe3ea('0xa0')](_0x218bc2,_0x34908a);return this[_0xe3ea('0xd')]['noop'](util[_0xe3ea('0x52')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x354cc6[_0xe3ea('0xba')],_0x218bc2));}}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x1be'),_0x354cc6['command']));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1bf')]=function(_0x1a0351){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x1c0'),_0x1a0351[_0xe3ea('0x36')]));_0x1a0351[_0xe3ea('0x5a')]=_0x1a0351[_0xe3ea('0x5a')][_0xe3ea('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1a0351['apiKey'])){return this['channel'][_0xe3ea('0xab')](_0xe3ea('0x1c1'));}if(!this[_0xe3ea('0xaa')](_0x1a0351['text'])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x1c2'),_0x1a0351[_0xe3ea('0x5a')]));var _0x5b5a33=this[_0xe3ea('0x58')][_0xe3ea('0xc3')](this,_0x1a0351);if(_0x5b5a33){this['channel'][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x5b5a33));var _0x3de092=this[_0xe3ea('0xd')][_0xe3ea('0x105')](_0x5b5a33);try{fs[_0xe3ea('0x157')](_0x5b5a33+'.wav');}catch(_0x2c8f81){logger[_0xe3ea('0x2f')](_0x2c8f81);}return _0x3de092;}return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x1a0351,_0xe3ea('0x1c3'));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1c4')]=function(_0x310c7c){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x1c5'),_0x310c7c[_0xe3ea('0x36')]));_0x310c7c[_0xe3ea('0x5a')]=_0x310c7c['text'][_0xe3ea('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe3ea('0xaa')](_0x310c7c[_0xe3ea('0x5a')])){return this[_0xe3ea('0xd')][_0xe3ea('0xab')](_0xe3ea('0xac'));}this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x1c6'),_0x310c7c[_0xe3ea('0x5a')]));var _0x2699dd=this[_0xe3ea('0x61')][_0xe3ea('0xc3')](this,_0x310c7c);if(_0x2699dd){this[_0xe3ea('0xd')][_0xe3ea('0xab')](util['format'](_0xe3ea('0x1c7'),_0x2699dd));var _0x326918=this[_0xe3ea('0xd')][_0xe3ea('0x105')](_0x2699dd);try{fs['unlink'](_0x2699dd+_0xe3ea('0x106'));}catch(_0x3ad52f){logger['error'](_0x3ad52f);}return _0x326918;}return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x310c7c,_0xe3ea('0x1c8'));};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1c9')]=function(_0x73504d){logger['info'](util[_0xe3ea('0x52')](_0xe3ea('0x1ca'),_0x73504d[_0xe3ea('0x36')]));if(!this[_0xe3ea('0xaa')](_0x73504d[_0xe3ea('0x15c')])){return this[_0xe3ea('0xd')]['error'](_0x73504d,_0xe3ea('0x15a'));}logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x15b'),this[_0xe3ea('0xd')]['callerid'],_0x73504d['findBy']));var _0x5899f1=this[_0xe3ea('0x4f')]['sync'](this,_0x73504d['findBy']);if(_0x5899f1){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x73504d[_0xe3ea('0x15c')]));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x15d'),this[_0xe3ea('0xd')][_0xe3ea('0x39')],_0x73504d[_0xe3ea('0x15c')]));return{'code':0xc8,'result':_0xe3ea('0x15e')};}else{logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x15f'),this['channel'][_0xe3ea('0x39')],_0x73504d[_0xe3ea('0x15c')]));this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')](_0xe3ea('0x15f'),this['channel'][_0xe3ea('0x39')],_0x73504d[_0xe3ea('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe3ea('0x10')][_0xe3ea('0x1cb')]=function(_0x215e06){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x1cc'),_0x215e06[_0xe3ea('0x36')]));var _0x15e693=this[_0xe3ea('0xd')][_0xe3ea('0x55')]('VOICEMAIL',[_0x215e06[_0xe3ea('0x1cd')],_0x215e06[_0xe3ea('0x77')]]);if(_0x15e693[_0xe3ea('0xa6')]===-0x1){return _0x15e693;}return this[_0xe3ea('0xd')][_0xe3ea('0xab')](util[_0xe3ea('0x52')]('Executed\x20command\x20%s\x20%s',_0xe3ea('0x1ce'),_0x215e06[_0xe3ea('0x1cd')]));};AGIVertices['prototype'][_0xe3ea('0x1cf')]=function(_0x5f472a){logger[_0xe3ea('0x2a')](util[_0xe3ea('0x52')](_0xe3ea('0x1d0'),_0x5f472a[_0xe3ea('0x36')]));if(!this['isConfigured'](_0x5f472a[_0xe3ea('0xda')])){return this[_0xe3ea('0xd')]['error'](_0x5f472a,'no\x20variable\x20selected');}var _0x16d93e=this[_0xe3ea('0xa3')][_0xe3ea('0xc3')](this,_0x5f472a['variable_id']);if(!_0x16d93e){return this[_0xe3ea('0xd')][_0xe3ea('0x2f')](_0x5f472a,_0xe3ea('0xdb'));}var _0x29b2a9=this[_0xe3ea('0xd')][_0xe3ea('0xa3')](_0x16d93e);return{'code':0xc8,'result':_0x29b2a9['extra']?_0x29b2a9[_0xe3ea('0xa4')]:'-'};};String[_0xe3ea('0x10')]['replaceAll']=function(_0x2eaa1e,_0x4c185a){return this['split'](_0x2eaa1e)[_0xe3ea('0x1d1')](_0x4c185a);};module[_0xe3ea('0x1d2')]=AGIVertices; \ No newline at end of file +var _0xd4a2=['ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','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','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','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','no\x20username\x20configured','password','ndassistant_url','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','goal','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%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\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','pass','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','split','join','exports','path','shelljs','randomstring','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','format','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US'];(function(_0x4d19b1,_0x120c0d){var _0x248df2=function(_0x5625d6){while(--_0x5625d6){_0x4d19b1['push'](_0x4d19b1['shift']());}};_0x248df2(++_0x120c0d);}(_0xd4a2,0x173));var _0x2d4a=function(_0x3806eb,_0x5bfc6e){_0x3806eb=_0x3806eb-0x0;var _0x92b698=_0xd4a2[_0x3806eb];return _0x92b698;};'use strict';var fs=require('fs');var path=require(_0x2d4a('0x0'));var util=require('util');var _=require('lodash');var sh=require(_0x2d4a('0x1'));var odbc=require('odbc')();var rs=require(_0x2d4a('0x2'));var moment=require('moment');var Mustache=require(_0x2d4a('0x3'));var rp=require('request-promise');var logger=require(_0x2d4a('0x4'))(_0x2d4a('0x5'));var config=require(_0x2d4a('0x6'));var scripts=require(_0x2d4a('0x7'));var FILES_PATH=_0x2d4a('0x8');var recursiveMapAttributes=['rawHeaders',_0x2d4a('0x9')];var verticesWithRetry=[_0x2d4a('0xa'),_0x2d4a('0xb'),_0x2d4a('0xc')];var AGIVertices=function(_0x3b8d7b,_0x535b2f,_0xb9f016){this[_0x2d4a('0xd')]=_0x3b8d7b;this[_0x2d4a('0xe')]=_0x535b2f;this[_0x2d4a('0xf')]=_0xb9f016;};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x11')]=function(_0x4a9b14,_0x5f3c52){this[_0x2d4a('0xe')]['getVariableById'](_0x4a9b14)[_0x2d4a('0x12')](function(_0x42cb63){_0x5f3c52(null,_0x42cb63?_0x42cb63[_0x2d4a('0x13')]:![]);})[_0x2d4a('0x14')](function(_0x2f785f){_0x5f3c52(_0x2f785f);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x15')]=function(_0x2c4569,_0x544622){this['rpc'][_0x2d4a('0x16')](_0x2c4569)['then'](function(_0x11c64a){_0x544622(null,_0x11c64a?_0x11c64a[_0x2d4a('0x13')]:![]);})[_0x2d4a('0x14')](function(_0x3a3156){_0x544622(_0x3a3156);});};AGIVertices['prototype'][_0x2d4a('0x17')]=function(_0x5a6378,_0x2838fa){this['rpc'][_0x2d4a('0x18')](_0x5a6378)[_0x2d4a('0x12')](function(_0x2188b2){_0x2838fa(null,_0x2188b2?_0x2188b2[_0x2d4a('0x13')]:![]);})['catch'](function(_0x4fd169){_0x2838fa(_0x4fd169);});};AGIVertices['prototype'][_0x2d4a('0x19')]=function(_0x1966d1,_0x321a33){this[_0x2d4a('0xe')][_0x2d4a('0x1a')](_0x1966d1)[_0x2d4a('0x12')](function(_0x56445a){_0x321a33(null,_0x56445a?_0x56445a['dsn']:![]);})[_0x2d4a('0x14')](function(_0x1f3e17){_0x321a33(_0x1f3e17);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x1b')]=function(_0x1a2d20,_0x2e7736){this[_0x2d4a('0xe')][_0x2d4a('0x1c')](_0x1a2d20)['then'](function(_0x26e7b8){_0x2e7736(null,_0x26e7b8?_0x26e7b8[_0x2d4a('0x13')]:![]);})[_0x2d4a('0x14')](function(_0x42d813){_0x2e7736(_0x42d813);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x1d')]=function(_0x456d38,_0x1facb9){this['rpc']['getTrunkById'](_0x456d38)['then'](function(_0x2bb9f0){_0x1facb9(null,_0x2bb9f0?_0x2bb9f0['name']:![]);})[_0x2d4a('0x14')](function(_0x3a2fd3){_0x1facb9(_0x3a2fd3);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x1e')]=function(_0x13e769,_0x326c38){var _0x21a473=this;this[_0x2d4a('0xe')]['getSoundById'](_0x13e769)[_0x2d4a('0x12')](function(_0x5ce262){_0x326c38(null,_0x5ce262?_0x21a473[_0x2d4a('0x1f')](_0x5ce262[_0x2d4a('0x20')]):![]);})[_0x2d4a('0x14')](function(_0x20b87d){_0x326c38(_0x20b87d);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x21')]=function(_0x25ac5c,_0x2e8063){this['rpc'][_0x2d4a('0x22')](_0x25ac5c)[_0x2d4a('0x12')](function(_0xda1ef2){_0x2e8063(null,_0xda1ef2?_0xda1ef2:![]);})[_0x2d4a('0x14')](function(_0x2b66af){_0x2e8063(_0x2b66af);});};AGIVertices['prototype'][_0x2d4a('0x23')]=function(_0x31d8ae,_0x27015d,_0x24bcc2){this[_0x2d4a('0xf')]['sendMailMessage'](_0x31d8ae,_0x27015d)[_0x2d4a('0x12')](function(){_0x24bcc2(null);})[_0x2d4a('0x14')](function(_0x46b623){_0x24bcc2(_0x46b623);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x24')]=function(_0x2d51d1,_0x5801a8){this[_0x2d4a('0xe')][_0x2d4a('0x25')](_0x2d51d1)[_0x2d4a('0x12')](function(_0x22ca11){if(_0x22ca11){if(_0x22ca11[_0x2d4a('0x26')]){_0x5801a8(null,[_0x22ca11['interval']]);}else{_0x5801a8(null,_[_0x2d4a('0x27')](_0x22ca11[_0x2d4a('0x28')],'interval'));}}else{_0x5801a8(null,![]);}})[_0x2d4a('0x14')](function(_0x1d6313){_0x5801a8(_0x1d6313);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x1f')]=function(_0x2b9093){return util[_0x2d4a('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x2b9093);};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x2a')]=function(_0x3e3256,_0x13f120,_0x103558){odbc[_0x2d4a('0x2b')](_0x3e3256,function(_0x5b49f9){if(_0x5b49f9){logger['error'](_0x2d4a('0x2c'),_0x5b49f9);_0x103558(_0x5b49f9);}else{logger['info'](_0x2d4a('0x2d'));odbc[_0x2d4a('0x2e')](_0x13f120,function(_0x5aeae4,_0x109c84){if(_0x5aeae4){logger[_0x2d4a('0x2f')](_0x2d4a('0x30'),_0x13f120);_0x103558(_0x5aeae4);}else{logger[_0x2d4a('0x2f')](_0x2d4a('0x31'),_0x13f120);odbc[_0x2d4a('0x32')](function(_0x441837){if(_0x441837){logger[_0x2d4a('0x33')](_0x2d4a('0x34'),_0x441837);}_0x103558(null,_0x109c84);});}});}});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x35')]=function(_0x4da518,_0x8bc995){this[_0x2d4a('0xe')][_0x2d4a('0x36')](_0x4da518)[_0x2d4a('0x12')](function(_0x104629){_0x8bc995(null,_0x104629?_0x104629:![]);})['catch'](function(_0x50dbc3){_0x8bc995(_0x50dbc3);});};AGIVertices['prototype']['createSmsMessage']=function(_0x20650d,_0x3bd65d){this[_0x2d4a('0xe')][_0x2d4a('0x37')](_0x20650d)['then'](function(_0x155f2d){_0x3bd65d(null,_0x155f2d);})[_0x2d4a('0x14')](function(_0x5e9704){_0x3bd65d(_0x5e9704);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x38')]=function(_0x8a9375,_0x13970c,_0x1ad852){this[_0x2d4a('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x2d4a('0xd')][_0x2d4a('0x39')],'node':_0x8a9375[_0x2d4a('0x3a')],'application':_0x8a9375[_0x2d4a('0x3b')],'data':_0x13970c||null,'project_name':this[_0x2d4a('0xd')][_0x2d4a('0x3c')],'callerid':this['channel'][_0x2d4a('0x3d')]})[_0x2d4a('0x12')](function(_0x10b723){if(_0x1ad852){_0x1ad852(null,_0x10b723);}})['catch'](function(_0x2585db){if(_0x1ad852){_0x1ad852(_0x2585db);}});};AGIVertices['prototype'][_0x2d4a('0x3e')]=function(_0x1d9bb5,_0x336984,_0x1bd674,_0x2bd86){this['rpc']['createSquareRecording']({'uniqueid':this[_0x2d4a('0xd')][_0x2d4a('0x39')],'callerid':this['channel'][_0x2d4a('0x3d')],'calleridname':this['channel'][_0x2d4a('0x3f')],'context':this[_0x2d4a('0xd')][_0x2d4a('0x40')],'extension':this['channel'][_0x2d4a('0x41')],'priority':this['channel'][_0x2d4a('0x42')],'accountcode':this[_0x2d4a('0xd')][_0x2d4a('0x43')],'dnid':this[_0x2d4a('0xd')][_0x2d4a('0x44')],'projectName':this[_0x2d4a('0xd')][_0x2d4a('0x3c')],'saveName':_0x336984,'filename':_0x1d9bb5[_0x2d4a('0x45')]||_0x336984,'savePath':_0x1bd674})[_0x2d4a('0x12')](function(_0x2a94ff){_0x2bd86(null,_0x2a94ff);})[_0x2d4a('0x14')](function(_0x5e2f07){_0x2bd86(_0x5e2f07);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x46')]=function(_0x3336b2,_0x1467ab,_0x2d2e24,_0x5b6086,_0x39e5ec){this[_0x2d4a('0xe')][_0x2d4a('0x46')]({'uniqueid':this[_0x2d4a('0xd')][_0x2d4a('0x39')],'body':_0x3336b2,'direction':_0x1467ab,'providerName':_0x2d2e24,'providerResponse':_0x5b6086})['then'](function(_0x4b9a52){if(_0x39e5ec){_0x39e5ec(null,_0x4b9a52);}})[_0x2d4a('0x14')](function(_0x6d238b){if(_0x39e5ec){_0x39e5ec(_0x6d238b);}});};AGIVertices['prototype'][_0x2d4a('0x47')]=function(_0x33f413,_0x7f0807){this[_0x2d4a('0xe')]['createCmContact']({'firstName':_[_0x2d4a('0x48')](_0x33f413['name'])||_[_0x2d4a('0x49')](_0x33f413[_0x2d4a('0x13')])?_0x2d4a('0x4a')+Math[_0x2d4a('0x4b')]():_0x33f413[_0x2d4a('0x13')],'lastName':_[_0x2d4a('0x48')](_0x33f413[_0x2d4a('0x4c')])||_[_0x2d4a('0x49')](_0x33f413['lastName'])?null:_0x33f413[_0x2d4a('0x4c')],'phone':_0x33f413[_0x2d4a('0x4d')],'ListId':_0x33f413[_0x2d4a('0x4e')],'scheduledat':_0x33f413[_0x2d4a('0x4f')],'callbackUniqueid':this[_0x2d4a('0xd')][_0x2d4a('0x39')],'tags':_0x2d4a('0x50'),'description':_0x2d4a('0x51')+_0x33f413[_0x2d4a('0x4f')][_0x2d4a('0x52')](),'priority':_0x33f413[_0x2d4a('0x53')]})[_0x2d4a('0x12')](function(_0x1b4ae7){_0x7f0807(null,_0x1b4ae7);})[_0x2d4a('0x14')](function(_0x1ce950){_0x7f0807(_0x1ce950);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x54')]=function(_0x4cce5e,_0x3515b8){this[_0x2d4a('0xe')]['getPauseById'](_0x4cce5e)[_0x2d4a('0x12')](function(_0x343f25){_0x3515b8(null,_0x343f25?_0x343f25[_0x2d4a('0x13')]:![]);})[_0x2d4a('0x14')](function(_0x165c00){_0x3515b8(_0x165c00);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x55')]=function(_0x1cf982,_0x22afb4,_0x352b50){var _0x346f2b={'role':_0x2d4a('0x56')};_0x346f2b[_0x1cf982]=this['channel'][_0x2d4a('0x3d')];this[_0x2d4a('0xe')]['agentPause'](_0x346f2b,_0x22afb4,this[_0x2d4a('0xd')][_0x2d4a('0x39')])[_0x2d4a('0x12')](function(_0xb4f74c){_0x352b50(null,_[_0x2d4a('0x49')](_0xb4f74c)?![]:!![]);})[_0x2d4a('0x14')](function(_0x35fb34){logger[_0x2d4a('0x33')](_0x35fb34);_0x352b50(null,![]);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x57')]=function(_0x5bbc96,_0x2bd137){var _0x8ae6bd={'role':_0x2d4a('0x56')};_0x8ae6bd[_0x5bbc96]=this['channel'][_0x2d4a('0x3d')];this[_0x2d4a('0xe')][_0x2d4a('0x57')](_0x8ae6bd)[_0x2d4a('0x12')](function(_0x10560d){_0x2bd137(null,_[_0x2d4a('0x49')](_0x10560d)?![]:!![]);})[_0x2d4a('0x14')](function(_0x3e05c3){logger[_0x2d4a('0x33')](_0x3e05c3);_0x2bd137(null,![]);});};AGIVertices['prototype'][_0x2d4a('0x58')]=function(_0x17ade0,_0x2a876b){var _0x17ef80={'role':_0x2d4a('0x56')};_0x17ef80[_0x17ade0]=this[_0x2d4a('0xd')]['callerid'];this[_0x2d4a('0xe')][_0x2d4a('0x58')](_0x17ef80)[_0x2d4a('0x12')](function(_0x4809af){_0x2a876b(null,_[_0x2d4a('0x49')](_0x4809af)?![]:!![]);})[_0x2d4a('0x14')](function(_0x4f4a09){logger[_0x2d4a('0x33')](_0x4f4a09);_0x2a876b(null,![]);});};AGIVertices[_0x2d4a('0x10')]['agentLogin']=function(_0x10b62a,_0x5ad7f6){var _0x4d7271={'role':_0x2d4a('0x56')};_0x4d7271[_0x10b62a]=this[_0x2d4a('0xd')][_0x2d4a('0x3d')];var _0xe78826=_0x10b62a!='internal'?util[_0x2d4a('0x29')](_0x2d4a('0x59'),_0x2d4a('0x5a'),this[_0x2d4a('0xd')]['callerid']):undefined;this['rpc'][_0x2d4a('0x5b')](_0x4d7271,_0xe78826)[_0x2d4a('0x12')](function(_0x2a2441){_0x5ad7f6(null,_[_0x2d4a('0x49')](_0x2a2441)?![]:!![]);})[_0x2d4a('0x14')](function(_0x3d6046){logger[_0x2d4a('0x33')](_0x3d6046);_0x5ad7f6(null,![]);});};AGIVertices['prototype'][_0x2d4a('0x5c')]=function(_0x23fdb2,_0xf3d514){sh[_0x2d4a('0x5d')](_['trim'](_0x23fdb2),function(_0x299bdf,_0x7e2b34){var _0x32a048=_0x7e2b34[_0x2d4a('0x5e')](/(\r\n|\n|\r)/gm,'');_0xf3d514(null,_0x32a048);});};AGIVertices['prototype'][_0x2d4a('0x5f')]=function(_0x118a3b,_0x55d565){scripts[_0x2d4a('0x5f')](_0x118a3b[_0x2d4a('0x60')],_0x118a3b[_0x2d4a('0x61')]||'text',_0x118a3b[_0x2d4a('0x62')],_0x118a3b[_0x2d4a('0x63')]||_0x2d4a('0x64'),_0x118a3b[_0x2d4a('0x65')]||_0x2d4a('0x66'),_0x118a3b[_0x2d4a('0x67')]||_0x2d4a('0x68'))['then'](function(_0x3f080a){_0x55d565(null,_0x3f080a);})[_0x2d4a('0x14')](function(_0x318ef4){_0x55d565(_0x318ef4);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x69')]=function(_0x55ebbb,_0x38e623){scripts['googleTTS'](_0x55ebbb[_0x2d4a('0x62')],_0x55ebbb[_0x2d4a('0x6a')]||'en',0x1)[_0x2d4a('0x12')](function(_0x21fa97){_0x38e623(null,_0x21fa97);})[_0x2d4a('0x14')](function(_0x2ba9c2){_0x38e623(_0x2ba9c2);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x6b')]=function(_0x250c75,_0xd506d5){var _0x4c7889={'uri':_0x250c75[_0x2d4a('0x6c')],'method':_0x250c75['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x250c75[_0x2d4a('0x6d')])===_0x2d4a('0x6e')&&parseInt(_0x250c75[_0x2d4a('0x6d')])>=0x1?parseInt(_0x250c75[_0x2d4a('0x6d')])*0x3e8:0x5*0x3e8};if(_[_0x2d4a('0x6f')]([_0x2d4a('0x70'),_0x2d4a('0x71')],_0x4c7889[_0x2d4a('0x72')][_0x2d4a('0x73')]())){try{_0x4c7889['body']=_0x250c75[_0x2d4a('0x9')]?JSON[_0x2d4a('0x74')](_0x250c75[_0x2d4a('0x9')]):{};}catch(_0xcdf787){logger['error'](_0x2d4a('0x75'),_0xcdf787);}}try{_0x4c7889[_0x2d4a('0x76')]=_0x250c75[_0x2d4a('0x77')]?JSON[_0x2d4a('0x74')](_0x250c75[_0x2d4a('0x77')]):{};}catch(_0xd1adbe){logger['error'](_0x2d4a('0x78'),_0xd1adbe);}if(_0x250c75[_0x2d4a('0x79')]){try{var _0x54350d=require(_0x250c75[_0x2d4a('0x79')])[_0x2d4a('0x7a')](this,_0x4c7889);_0x4c7889[_0x2d4a('0x7b')]=Mustache[_0x2d4a('0x7c')](_0x250c75[_0x2d4a('0x6c')],_0x54350d,{},['$$','$$']);if(_0x4c7889[_0x2d4a('0x76')]){_0x4c7889[_0x2d4a('0x76')]=JSON[_0x2d4a('0x74')](Mustache[_0x2d4a('0x7c')](JSON[_0x2d4a('0x7d')](_0x4c7889['headers']),_0x54350d,{},['$$','$$']));}if(_0x4c7889[_0x2d4a('0x7e')]){_0x4c7889['body']=JSON[_0x2d4a('0x74')](Mustache[_0x2d4a('0x7c')](JSON[_0x2d4a('0x7d')](_0x4c7889[_0x2d4a('0x7e')]),_0x54350d,{},['$$','$$']));}}catch(_0x18d7f3){logger[_0x2d4a('0x33')](_0x2d4a('0x7f'),_0x18d7f3);}}rp(_0x4c7889)['then'](function(_0x119c59){var _0x2ebb9e={'statusCode':_0x119c59[_0x2d4a('0x80')]||0xc8,'statusMessage':_0x119c59[_0x2d4a('0x81')]||'OK','headers':_0x119c59[_0x2d4a('0x76')]||{},'body':_0x119c59['body']||{}};_0xd506d5(null,_0x2ebb9e);})['catch'](function(_0x49b2f3){var _0x46e128={'statusCode':_0x49b2f3[_0x2d4a('0x80')]||0x1f4,'statusMessage':_0x49b2f3[_0x2d4a('0x82')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x49b2f3[_0x2d4a('0x83')][_0x2d4a('0x76')]||{},'body':_0x49b2f3[_0x2d4a('0x83')][_0x2d4a('0x7e')]||{}};_0xd506d5(null,_0x46e128);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x84')]=function(_0x5e2232,_0x334d5f){scripts['googleDialogflow'](this[_0x2d4a('0xd')][_0x2d4a('0x39')],_0x5e2232['key'],_0x5e2232[_0x2d4a('0x62')],_0x5e2232['dialogflow_language']||'en')['then'](function(_0x51b845){_0x334d5f(null,_0x51b845);})[_0x2d4a('0x14')](function(_0xd175e5){_0x334d5f(_0xd175e5);});};AGIVertices[_0x2d4a('0x10')]['googleDialogflowV2']=function(_0x12e257,_0x10bd48){scripts[_0x2d4a('0x85')](this[_0x2d4a('0xd')]['uniqueid'],_0x12e257[_0x2d4a('0x86')],_0x12e257[_0x2d4a('0x87')],_0x12e257['private_key'],_0x12e257[_0x2d4a('0x62')],_0x12e257[_0x2d4a('0x88')]||'en')['then'](function(_0x3e24af){_0x10bd48(null,_0x3e24af);})['catch'](function(_0x583588){_0x10bd48(_0x583588);});};AGIVertices[_0x2d4a('0x10')]['sestekNDA']=function(_0x143295,_0x12eccd){scripts[_0x2d4a('0x89')](this[_0x2d4a('0xd')],_0x143295)['then'](function(_0x30cce5){_0x12eccd(null,_0x30cce5);})['catch'](function(_0x1aa734){_0x12eccd(_0x1aa734);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x8a')]=function(_0xc4564c,_0x45f6b7){scripts['ispeechTTS'](_0xc4564c[_0x2d4a('0x8b')],_0xc4564c[_0x2d4a('0x62')],_0xc4564c[_0x2d4a('0x8c')]||'en-US',_0xc4564c[_0x2d4a('0x8d')])['then'](function(_0x562665){_0x45f6b7(null,_0x562665);})[_0x2d4a('0x14')](function(_0x134864){_0x45f6b7(_0x134864);});};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x8e')]=function(_0x860d32,_0x10f72f,_0x2bffb4){scripts[_0x2d4a('0x8e')](_0x10f72f,_0x860d32[_0x2d4a('0x8b')],_0x860d32[_0x2d4a('0x8f')]||'en-US',this[_0x2d4a('0x90')](_0x860d32[_0x2d4a('0x91')])?_0x860d32[_0x2d4a('0x91')]:undefined)[_0x2d4a('0x12')](function(_0x36b067){_0x2bffb4(null,_0x36b067);})[_0x2d4a('0x14')](function(_0x1930c5){_0x2bffb4(_0x1930c5);});};AGIVertices[_0x2d4a('0x10')]['awsPolly']=function(_0x155cb1,_0x2c8761){scripts[_0x2d4a('0x92')](_0x155cb1['aws_access_key_id'],_0x155cb1[_0x2d4a('0x93')],_0x155cb1['aws_polly_region'],_0x155cb1[_0x2d4a('0x94')]||_0x2d4a('0x95'),_0x155cb1[_0x2d4a('0x62')],_0x155cb1[_0x2d4a('0x96')]||'text')[_0x2d4a('0x12')](function(_0x5bc3c4){_0x2c8761(null,_0x5bc3c4);})[_0x2d4a('0x14')](function(_0x54f1e4){_0x2c8761(_0x54f1e4);});};AGIVertices[_0x2d4a('0x10')]['awsLex']=function(_0x3dee80,_0x4fbb64){scripts[_0x2d4a('0x97')](this[_0x2d4a('0xd')][_0x2d4a('0x39')],_0x3dee80[_0x2d4a('0x98')],_0x3dee80[_0x2d4a('0x93')],_0x3dee80[_0x2d4a('0x99')],_0x3dee80[_0x2d4a('0x62')],_0x3dee80[_0x2d4a('0x9a')])[_0x2d4a('0x12')](function(_0x48bd8c){_0x4fbb64(null,_0x48bd8c);})['catch'](function(_0x4bebc8){_0x4fbb64(_0x4bebc8);});};AGIVertices[_0x2d4a('0x10')]['googleASR']=function(_0x23b7d,_0x493429,_0x65f72){scripts[_0x2d4a('0x9b')](_0x493429,_0x23b7d['key'],_0x23b7d['google_asr_language']||_0x2d4a('0x64'))['then'](function(_0x279c26){_0x65f72(null,_0x279c26);})[_0x2d4a('0x14')](function(_0x14bd2b){_0x65f72(_0x14bd2b);});};AGIVertices['prototype'][_0x2d4a('0x9c')]=function(_0x83284d,_0x1504ab,_0x2c8acd){scripts[_0x2d4a('0x9c')](_0x1504ab,_0x83284d[_0x2d4a('0x9d')],_0x83284d[_0x2d4a('0x9e')],_0x83284d[_0x2d4a('0x7b')])[_0x2d4a('0x12')](function(_0x121430){_0x2c8acd(null,_0x121430);})[_0x2d4a('0x14')](function(_0x12a1b7){_0x2c8acd(_0x12a1b7);});};AGIVertices['prototype'][_0x2d4a('0x9f')]=function(_0x466969){var _0x91bc9=_['includes'](verticesWithRetry,_0x466969[_0x2d4a('0x3b')])?_0x466969:_[_0x2d4a('0xa0')](_0x466969);for(var _0x250a9c in _0x91bc9){if(_0x91bc9[_0x2d4a('0xa1')](_0x250a9c)){if(_0x91bc9[_0x250a9c]&&_[_0x2d4a('0xa2')](_0x91bc9[_0x250a9c])){if(_['includes'](recursiveMapAttributes,_0x250a9c)){_0x91bc9[_0x250a9c]=this[_0x2d4a('0xa3')](_0x91bc9[_0x250a9c]);}else{_0x91bc9[_0x250a9c]=this[_0x2d4a('0xa4')](_0x91bc9[_0x250a9c]);}}}}return _0x91bc9;};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xa5')]=function(_0x4c4dc3){for(var _0x3df2a3 in _0x4c4dc3){if(_0x4c4dc3[_0x2d4a('0xa1')](_0x3df2a3)){if(_[_0x2d4a('0xa6')](_0x4c4dc3[_0x3df2a3])){this[_0x2d4a('0xa5')](_0x4c4dc3[_0x3df2a3]);}else if(_[_0x2d4a('0xa7')](_0x4c4dc3[_0x3df2a3])){for(var _0x291053=0x0;_0x291053<_0x4c4dc3[_0x3df2a3][_0x2d4a('0xa8')];_0x291053++){this['recursiveNodeIndex'](_0x4c4dc3[_0x3df2a3][_0x291053]);}}else if(_[_0x2d4a('0xa2')](_0x4c4dc3[_0x3df2a3])){_0x4c4dc3[_0x3df2a3]=this[_0x2d4a('0xa4')](_0x4c4dc3[_0x3df2a3]);}}}};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xa9')]=function(_0x139e4e,_0x34923f){for(var _0x58b196 in _0x139e4e){if(_0x139e4e[_0x2d4a('0xa1')](_0x58b196)){if(_[_0x2d4a('0xa6')](_0x139e4e[_0x58b196])){if(!_[_0x2d4a('0x48')](_0x139e4e[_0x58b196])){this[_0x2d4a('0xa9')](_0x139e4e[_0x58b196],util[_0x2d4a('0x29')]('%s.%s',_0x34923f,_0x58b196));}}else if(_['isArray'](_0x139e4e[_0x58b196])){for(var _0x3e276d=0x0;_0x3e276d<_0x139e4e[_0x58b196][_0x2d4a('0xa8')];_0x3e276d++){this[_0x2d4a('0xa9')](_0x139e4e[_0x58b196][_0x3e276d],util[_0x2d4a('0x29')](_0x2d4a('0xaa'),_0x34923f,_0x58b196+'['+_0x3e276d+']'));}}else{if(!_[_0x2d4a('0x49')](_0x139e4e[_0x58b196])){this[_0x2d4a('0xd')][_0x2d4a('0xab')](util[_0x2d4a('0x29')]('%s.%s',_0x34923f,_0x58b196),_0x139e4e[_0x58b196]);}}}}};AGIVertices['prototype'][_0x2d4a('0xa3')]=function(_0x2cc6be){try{var _0x3b4585=JSON[_0x2d4a('0x74')](_0x2cc6be);this[_0x2d4a('0xa5')](_0x3b4585);return JSON[_0x2d4a('0x7d')](_0x3b4585);}catch(_0x131d47){return this[_0x2d4a('0xa4')](_0x2cc6be);}};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xa4')]=function(_0x115e9b){var _0x13c8a5=_0x115e9b['split']('{');for(var _0x520ef8=0x1;_0x520ef8<_0x13c8a5['length'];_0x520ef8+=0x1){var _0x448b4d=_0x13c8a5[_0x520ef8]['split']('}');if(_0x448b4d['length']>0x1){_0x115e9b=_0x115e9b[_0x2d4a('0xac')]('{'+_0x448b4d[0x0]+'}',this[_0x2d4a('0xd')]['getVariable'](_0x448b4d[0x0])['extra']||_0x448b4d[0x0]);}}if(_0x13c8a5['length']===0x1){return _0x115e9b[_0x2d4a('0x52')]();}return this[_0x2d4a('0xa4')](_0x115e9b);};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xad')]=function(_0x30ce8f,_0x357dfc){var _0xd80165=this[_0x2d4a('0xd')][_0x2d4a('0x11')](_0x30ce8f);if(_0xd80165[_0x2d4a('0xae')]===-0x1){return _0xd80165;}logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0xaf'),_0x357dfc,_0xd80165[_0x2d4a('0xb0')]));return this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x357dfc,_0xd80165[_0x2d4a('0xb0')]);};AGIVertices['prototype'][_0x2d4a('0x90')]=function(_0x3030e1){return _0x3030e1&&_0x3030e1!=='0'&&_0x3030e1!=='-1'&&_0x3030e1!=='';};AGIVertices['prototype'][_0x2d4a('0xb1')]=function(_0xe198b){this['createSquareDetailsReport']['sync'](this,_0xe198b,'-');_0xe198b['retry']=_0xe198b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2d4a('0x10')]['mrcpsynth']=function(_0x307e02){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xb2'),_0x307e02[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x307e02[_0x2d4a('0x62')])){return this['channel'][_0x2d4a('0xb3')]('no\x20text\x20configured');}var _0x2b6040='\x22'+_0x307e02[_0x2d4a('0x62')]+'\x22';if(this[_0x2d4a('0x90')](_0x307e02[_0x2d4a('0x83')])){_0x2b6040+=','+_0x307e02[_0x2d4a('0x83')];}var _0x19a319=this[_0x2d4a('0xd')]['exec'](_0x2d4a('0xb4'),_0x2b6040);if(_0x19a319['result']===-0x1){return _0x19a319;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2b6040));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xb5')]=function(_0x35c341){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xb6'),_0x35c341['label']));if(!this[_0x2d4a('0x90')](_0x35c341['grammar'])){return this[_0x2d4a('0xd')]['noop']('no\x20grammar\x20configured');}var _0x410874=_0x35c341['grammar'];if(this['isConfigured'](_0x35c341[_0x2d4a('0x83')])){_0x410874+=','+_0x35c341[_0x2d4a('0x83')];}var _0x3c998d=this[_0x2d4a('0xd')][_0x2d4a('0x5d')](_0x2d4a('0xb7'),_0x410874);if(_0x3c998d[_0x2d4a('0xae')]===-0x1){return _0x3c998d;}var _0x5eb575=this['getAndSetVariable'](_0x2d4a('0xb8'),_0x2d4a('0xb9'));if(_0x5eb575[_0x2d4a('0xae')]===-0x1){return _0x5eb575;}var _0x3c9e11=this[_0x2d4a('0xad')](_0x2d4a('0xba'),_0x2d4a('0xbb'));if(_0x3c9e11['result']===-0x1){return _0x3c9e11;}var _0x476fbd=this[_0x2d4a('0xad')]('RECOG_INSTANCE()',_0x2d4a('0xbc'));if(_0x476fbd['result']===-0x1){return _0x476fbd;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x410874));};AGIVertices[_0x2d4a('0x10')]['agi']=function(_0x57ff1d){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xbd'),_0x57ff1d['label']));return this[_0x2d4a('0xd')]['agi']([_0x57ff1d[_0x2d4a('0xbe')],_0x57ff1d[_0x2d4a('0xbf')]]);};AGIVertices['prototype'][_0x2d4a('0xc0')]=function(_0x3db9ba){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xc1'),_0x3db9ba[_0x2d4a('0x3a')]));if(this[_0x2d4a('0x90')](_0x3db9ba['timeout'])){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xc2'),_0x3db9ba[_0x2d4a('0x6d')]));var _0x120aa5=this[_0x2d4a('0xd')]['wait'](_0x3db9ba['timeout']);if(_0x120aa5[_0x2d4a('0xae')]===-0x1){return _0x120aa5;}}return this[_0x2d4a('0xd')][_0x2d4a('0xc0')]();};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x50')]=function(_0x36a944){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x36a944[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x36a944['list_id'])){return this['channel'][_0x2d4a('0x33')](_0x36a944,_0x2d4a('0xc3'));}_0x36a944[_0x2d4a('0x4f')]=moment();if(this['isConfigured'](_0x36a944[_0x2d4a('0xc4')])){_0x36a944[_0x2d4a('0x4f')]=moment()['add'](_0x36a944[_0x2d4a('0xc4')],_0x2d4a('0xc5'));}if(!this[_0x2d4a('0x90')](_0x36a944[_0x2d4a('0x53')])){_0x36a944[_0x2d4a('0x53')]=0x2;}this['createCmContact']['sync'](this,_0x36a944);return this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')](_0x2d4a('0xc6'),_0x36a944[_0x2d4a('0x4d')],_0x36a944['list_id'],_0x36a944[_0x2d4a('0x4f')]));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xc7')]=function(_0x2d683b){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xc8'),_0x2d683b[_0x2d4a('0x3a')]));var _0x53e6fd=this['channel']['exec'](_0x2d683b[_0x2d4a('0xc9')],_0x2d683b[_0x2d4a('0x83')]);if(_0x53e6fd[_0x2d4a('0xae')]===-0x1){return _0x53e6fd;}return this['channel'][_0x2d4a('0xb3')](util['format'](_0x2d4a('0xca'),_0x2d683b[_0x2d4a('0xc9')],_0x2d683b[_0x2d4a('0x83')]));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xcb')]=function(_0x2ec7f4){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0xcc'),_0x2ec7f4[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x2ec7f4['text'])){return this['channel'][_0x2d4a('0xb3')]('no\x20text\x20configured');}var _0x50795a='\x22'+_0x2ec7f4['text']+'\x22';if(this[_0x2d4a('0x90')](_0x2ec7f4['options'])){_0x50795a+=','+_0x2ec7f4[_0x2d4a('0x83')];}var _0x4b4c44=this[_0x2d4a('0xd')]['exec'](_0x2d4a('0xb4'),_0x50795a);if(_0x4b4c44['result']===-0x1){return _0x4b4c44;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0xcd'),_0x50795a));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xce')]=function(_0x4fcd8e){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0xcf'),_0x4fcd8e[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x4fcd8e[_0x2d4a('0x62')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd0'));}var _0x2caf04='\x22'+_0x4fcd8e[_0x2d4a('0x62')]+'\x22';if(this[_0x2d4a('0x90')](_0x4fcd8e[_0x2d4a('0x83')])){_0x2caf04+=','+_0x4fcd8e[_0x2d4a('0x83')];}var _0x33bb3b=this['channel'][_0x2d4a('0x5d')](_0x2d4a('0xb4'),_0x2caf04);if(_0x33bb3b[_0x2d4a('0xae')]===-0x1){return _0x33bb3b;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0xcd'),_0x2caf04));};AGIVertices[_0x2d4a('0x10')]['lumenvoxasr']=function(_0x4f133b){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xd1'),_0x4f133b[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x4f133b['grammar'])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd2'));}var _0x5ac5ad=_0x4f133b[_0x2d4a('0xd3')];if(this[_0x2d4a('0x90')](_0x4f133b[_0x2d4a('0x83')])){_0x5ac5ad+=','+_0x4f133b[_0x2d4a('0x83')];}var _0x38f611=this[_0x2d4a('0xd')][_0x2d4a('0x5d')]('MRCPRecog',_0x5ac5ad);if(_0x38f611['result']===-0x1){return _0x38f611;}var _0x531040=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x2d4a('0xd4'));if(_0x531040[_0x2d4a('0xae')]===-0x1){return _0x531040;}var _0x267576=this[_0x2d4a('0xad')]('RECOG_INPUT()',_0x2d4a('0xd5'));if(_0x267576[_0x2d4a('0xae')]===-0x1){return _0x267576;}var _0x7bbfe7=this['getAndSetVariable']('RECOG_INSTANCE()',_0x2d4a('0xd6'));if(_0x7bbfe7[_0x2d4a('0xae')]===-0x1){return _0x7bbfe7;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0xd7'),_0x5ac5ad));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xd8')]=function(_0x2c58b4){logger['info'](util['format'](_0x2d4a('0xd9'),_0x2c58b4[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x2c58b4[_0x2d4a('0xd3')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd2'));}var _0xe7007a=_0x2c58b4[_0x2d4a('0xd3')];if(this[_0x2d4a('0x90')](_0x2c58b4[_0x2d4a('0x83')])){_0xe7007a+=','+_0x2c58b4[_0x2d4a('0x83')];}var _0x43c360=this[_0x2d4a('0xd')][_0x2d4a('0x5d')](_0x2d4a('0xb7'),_0xe7007a);if(_0x43c360[_0x2d4a('0xae')]===-0x1){return _0x43c360;}var _0x4a4cbd=this[_0x2d4a('0xad')](_0x2d4a('0xb8'),_0x2d4a('0xda'));if(_0x4a4cbd[_0x2d4a('0xae')]===-0x1){return _0x4a4cbd;}var _0xed73a6=this['getAndSetVariable']('RECOG_INPUT()',_0x2d4a('0xdb'));if(_0xed73a6['result']===-0x1){return _0xed73a6;}var _0x1e5fa5=this[_0x2d4a('0xad')](_0x2d4a('0xdc'),_0x2d4a('0xdd'));if(_0x1e5fa5[_0x2d4a('0xae')]===-0x1){return _0x1e5fa5;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0xd7'),_0xe7007a));};AGIVertices[_0x2d4a('0x10')]['database']=function(_0x58db7c){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0xde'),_0x58db7c[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x58db7c[_0x2d4a('0xdf')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x58db7c,_0x2d4a('0xe0'));}var _0x55fcfd=this[_0x2d4a('0x19')][_0x2d4a('0x7a')](this,_0x58db7c[_0x2d4a('0xdf')]);if(!_0x55fcfd){return this['channel'][_0x2d4a('0x33')](_0x58db7c,_0x2d4a('0xe1'));}if(!this[_0x2d4a('0x90')](_0x58db7c[_0x2d4a('0x2e')])){return this['channel']['error'](_0x58db7c,_0x2d4a('0xe2'));}var _0x1f75c5=_0x58db7c['query'][_0x2d4a('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')](_0x2d4a('0xe3'),_0x1f75c5));var _0x553f08=this['getQueryOdbc'][_0x2d4a('0x7a')](this,_0x55fcfd,_0x1f75c5);this['createSquareDetailsReport'][_0x2d4a('0x7a')](this,_0x58db7c,_0x1f75c5);if(!this[_0x2d4a('0x90')](_0x58db7c['variable_id'])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xe4'));}var _0x35fbee=this[_0x2d4a('0x11')]['sync'](this,_0x58db7c[_0x2d4a('0xe5')]);if(!_0x35fbee){return this['channel']['error'](_0x58db7c,_0x2d4a('0xe6'));}var _0x5e3748=this;_0x553f08['forEach'](function(_0x2472b4,_0x9e9ead){Object[_0x2d4a('0xe7')](_0x2472b4)['forEach'](function(_0x504c58){_0x5e3748[_0x2d4a('0xd')]['setVariable'](util[_0x2d4a('0x29')](_0x2d4a('0xe8'),_0x35fbee,_0x9e9ead,_0x504c58),_0x2472b4[_0x504c58]);});});this['channel'][_0x2d4a('0xab')](util[_0x2d4a('0x29')](_0x2d4a('0xe9'),_0x35fbee),_0x553f08[_0x2d4a('0xa8')]);return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('variable\x20%s\x20set',_0x35fbee));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xea')]=function(_0x4a8fc6){logger[_0x2d4a('0xeb')](util[_0x2d4a('0x29')](_0x2d4a('0xec'),_0x4a8fc6['label']));if(!this[_0x2d4a('0x90')](_0x4a8fc6[_0x2d4a('0xed')])){return this[_0x2d4a('0xd')]['error'](_0x4a8fc6,_0x2d4a('0xee'));}var _0x312cbc=this[_0x2d4a('0x1b')][_0x2d4a('0x7a')](this,_0x4a8fc6['sip_id']);if(!_0x312cbc){return this['channel']['error'](_0x4a8fc6,_0x2d4a('0xef'));}var _0x28fbc3=this['channel'][_0x2d4a('0x5d')](_0x2d4a('0xf0'),[util[_0x2d4a('0x29')](_0x2d4a('0xf1'),_0x312cbc),_0x4a8fc6[_0x2d4a('0x6d')],_0x4a8fc6[_0x2d4a('0xf2')],_0x4a8fc6[_0x2d4a('0x6c')]]);if(_0x28fbc3[_0x2d4a('0xae')]===-0x1){return _0x28fbc3;}return this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0xf3'),_0x2d4a('0xf0')));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xf4')]=function(_0x538f90){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0xf5'),_0x538f90[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0x538f90[_0x2d4a('0x8b')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xf6'));}if(!this[_0x2d4a('0x90')](_0x538f90[_0x2d4a('0x62')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd0'));}this[_0x2d4a('0xd')]['bot']=!![];this[_0x2d4a('0x38')](_0x538f90);this[_0x2d4a('0x46')](_0x538f90[_0x2d4a('0x62')],'in','','');this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Trying\x20Dialogflow:\x20%s',_0x538f90[_0x2d4a('0x62')]));var _0x510df6=this[_0x2d4a('0x84')][_0x2d4a('0x7a')](this,_0x538f90);if(_0x510df6){for(var _0x5d2016 in _0x510df6){if(_0x510df6[_0x2d4a('0xa1')](_0x5d2016)){this[_0x2d4a('0xd')]['setVariable'](util['format'](_0x2d4a('0xf7'),_0x5d2016[_0x2d4a('0x73')]()),_0x510df6[_0x5d2016]);}}this[_0x2d4a('0x46')](_0x510df6['speech'],_0x2d4a('0xf8'),_0x2d4a('0xf4'),'');return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0xf9'),_0x510df6[_0x2d4a('0xfa')]));}return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x538f90,_0x2d4a('0xfb'));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xfc')]=function(_0x4032bd){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0xfd'),_0x4032bd[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0x4032bd[_0x2d4a('0x86')])){return this['channel'][_0x2d4a('0xb3')]('no\x20project_id\x20configured');}if(!this[_0x2d4a('0x90')](_0x4032bd['client_email'])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0xfe'));}if(!this['isConfigured'](_0x4032bd[_0x2d4a('0xff')])){return this['channel']['noop'](_0x2d4a('0x100'));}if(!this[_0x2d4a('0x90')](_0x4032bd[_0x2d4a('0x88')])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0x101'));}if(!this[_0x2d4a('0x90')](_0x4032bd[_0x2d4a('0x62')])){return this['channel']['noop'](_0x2d4a('0xd0'));}this[_0x2d4a('0xd')][_0x2d4a('0x102')]=!![];this[_0x2d4a('0x38')](_0x4032bd);this[_0x2d4a('0x46')](_0x4032bd[_0x2d4a('0x62')],'in','','');this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x103'),_0x4032bd[_0x2d4a('0x62')]));var _0x660ab1=this['googleDialogflowV2'][_0x2d4a('0x7a')](this,_0x4032bd);if(_0x660ab1){for(var _0x148998 in _0x660ab1){if(_0x660ab1['hasOwnProperty'](_0x148998)){if(_0x148998!==_0x2d4a('0x104')){this['channel'][_0x2d4a('0xab')](util['format'](_0x2d4a('0xf7'),_0x148998[_0x2d4a('0x73')]()),_0x660ab1[_0x148998]);}}}this['createSquareMessage'](_0x660ab1[_0x2d4a('0xfa')],_0x2d4a('0xf8'),_0x2d4a('0xfc'),_0x660ab1['providerResponse']);return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x105'),_0x660ab1[_0x2d4a('0xfa')]));}return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x4032bd,_0x2d4a('0x106'));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x107')]=function(_0x481657){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x108'),_0x481657[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x481657[_0x2d4a('0x109')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x10a'));}if(!this[_0x2d4a('0x90')](_0x481657[_0x2d4a('0x10b')])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0x10c'));}if(!this[_0x2d4a('0x90')](_0x481657[_0x2d4a('0x10d')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x481657[_0x2d4a('0x10e')])){return this['channel'][_0x2d4a('0xb3')]('no\x20text\x20configured');}this[_0x2d4a('0xd')]['bot']=!![];this[_0x2d4a('0x38')](_0x481657);this[_0x2d4a('0x46')](_0x481657['text'],'in','','');this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')]('Trying\x20SestekNDA:\x20%s',_0x481657[_0x2d4a('0x62')]));var _0x241d90=this[_0x2d4a('0x89')][_0x2d4a('0x7a')](this,_0x481657);if(_0x241d90){for(var _0x217ff0 in _0x241d90){if(_0x241d90[_0x2d4a('0xa1')](_0x217ff0)){this[_0x2d4a('0xd')][_0x2d4a('0xab')](util[_0x2d4a('0x29')]('SESTEK_NDA_%s',_0x217ff0[_0x2d4a('0x73')]()),_0x241d90[_0x217ff0]);}}this['createSquareMessage'](_0x241d90['speech'],_0x2d4a('0xf8'),_0x2d4a('0x107'),'');if(_0x241d90[_0x2d4a('0x10f')]){this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x110'),_0x241d90[_0x2d4a('0x10f')]));var _0x1db94b=this[_0x2d4a('0xd')][_0x2d4a('0x111')](_0x241d90['audiofile']);try{fs[_0x2d4a('0x112')](_0x241d90['audiofile']+_0x2d4a('0x113'));}catch(_0xbfa0e4){logger[_0x2d4a('0x33')](_0xbfa0e4);}return _0x1db94b;}else{return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x114'),_0x241d90[_0x2d4a('0xfa')]));}}return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x481657,_0x2d4a('0x115'));};AGIVertices[_0x2d4a('0x10')]['end']=function(_0x3cf698){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x116'),_0x3cf698[_0x2d4a('0x3a')]));return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x117'));};AGIVertices['prototype']['ext_dial']=function(_0x2e7513){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2e7513[_0x2d4a('0x3a')]));var _0x5dcff6='';if(_0x2e7513[_0x2d4a('0x118')]){if(!this['isConfigured'](_0x2e7513[_0x2d4a('0x118')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2e7513,'no\x20trunk\x20selected');}else{var _0x112a7b=parseInt(_0x2e7513[_0x2d4a('0x118')],0xa);if(isNaN(_0x112a7b)){_0x5dcff6=_0x2e7513['trunk_id'];}else{_0x5dcff6=this['getTrunk']['sync'](this,_0x2e7513[_0x2d4a('0x118')]);if(!_0x5dcff6){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2e7513,_0x2d4a('0x119'));}}}}else if(_0x2e7513[_0x2d4a('0x11a')]){_0x5dcff6=_0x2e7513[_0x2d4a('0x11a')];}else{return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2e7513,_0x2d4a('0x11b'));}var _0x49d2fa=this['channel'][_0x2d4a('0x5d')](_0x2d4a('0xf0'),[util[_0x2d4a('0x29')](_0x2d4a('0x11c'),_0x5dcff6,_0x2e7513['phone']),_0x2e7513['timeout'],_0x2e7513[_0x2d4a('0xf2')],_0x2e7513['url']]);if(_0x49d2fa[_0x2d4a('0xae')]===-0x1){return _0x49d2fa;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0xf3'),_0x2d4a('0xf0')));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x11d')]=function(_0x509437){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x11e'),_0x509437[_0x2d4a('0x3a')]));return this[_0x2d4a('0xd')][_0x2d4a('0xb3')]('finally');};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xb')]=function(_0x2ed43b){logger['info'](util[_0x2d4a('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x2ed43b['label']));if(_0x2ed43b[_0x2d4a('0x11f')]===0x0){return this[_0x2d4a('0xb1')](_0x2ed43b);}_0x2ed43b[_0x2d4a('0x11f')]-=0x1;if(!this['isConfigured'](_0x2ed43b[_0x2d4a('0x120')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2ed43b,_0x2d4a('0x121'));}var _0x63b7f1=this['getSound'][_0x2d4a('0x7a')](this,_0x2ed43b[_0x2d4a('0x120')]);if(!_0x63b7f1){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2ed43b,'no\x20file\x20audio\x20found');}if(!this[_0x2d4a('0x90')](_0x2ed43b['variable_id'])){return this[_0x2d4a('0xd')]['error'](_0x2d4a('0xe4'));}var _0x146391=this[_0x2d4a('0xd')][_0x2d4a('0x122')](_0x63b7f1,_0x2ed43b['response'],_0x2ed43b[_0x2d4a('0x123')]);var _0x4cf5da=_0x146391[_0x2d4a('0xae')]?_0x146391['result'][_0x2d4a('0x52')]():'';logger[_0x2d4a('0x2f')](_0x2d4a('0x124'),JSON[_0x2d4a('0x7d')](_0x146391));if(_0x146391[_0x2d4a('0xae')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x2ed43b,_0x4cf5da);return _0x146391;}else if(_0x146391[_0x2d4a('0xb0')]===_0x2d4a('0x6d')){_0x146391[_0x2d4a('0xae')]=_0x4cf5da[_0x2d4a('0xa8')]>=parseInt(_0x2ed43b[_0x2d4a('0x125')])?'x':'i';}else{_0x146391[_0x2d4a('0xae')]=_0x4cf5da['length']>=parseInt(_0x2ed43b[_0x2d4a('0x125')])&&_0x4cf5da[_0x2d4a('0xa8')]<=parseInt(_0x2ed43b[_0x2d4a('0x123')])?'x':'i';}var _0x110ac4=this[_0x2d4a('0x11')][_0x2d4a('0x7a')](this,_0x2ed43b['variable_id']);if(!_0x110ac4){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2ed43b,'no\x20variable\x20found');}this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x110ac4,_0x4cf5da);if(this[_0x2d4a('0x90')](_0x2ed43b[_0x2d4a('0x126')])){var _0x284250=parseInt(_0x2ed43b['hiddendigitsnum'],0xa);var _0x2be21a=rs[_0x2d4a('0x127')]({'charset':'*','length':_0x284250});var _0x2a4bc9=_0x4cf5da[_0x2d4a('0xa8')];if(_0x2a4bc9>0x0){if(_0x2a4bc9>_0x284250){this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x2ed43b,_0x2ed43b['hiddendigitspos']===_0x2d4a('0x128')?_0x2be21a+_0x4cf5da[_0x2d4a('0x129')](_0x284250):_0x4cf5da[_0x2d4a('0x129')](0x0,_0x2a4bc9-_0x284250)+_0x2be21a);}else{this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x2ed43b,rs[_0x2d4a('0x127')]({'charset':'*','length':_0x2a4bc9}));}}else{this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x2ed43b,'');}}else{this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x2ed43b,_0x4cf5da);}return _0x146391;};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0xc')]=function(_0x1eedb5){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x1eedb5[_0x2d4a('0x3a')]));return this[_0x2d4a('0xb')](_0x1eedb5);};AGIVertices['prototype'][_0x2d4a('0x12a')]=function(_0x11879f){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x11879f[_0x2d4a('0x3a')]));this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x11879f,_0x11879f[_0x2d4a('0x12b')]);return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x12c'),_0x11879f[_0x2d4a('0x12b')]));};AGIVertices[_0x2d4a('0x10')]['awspolly']=function(_0x27baf3){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x12d'),_0x27baf3[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x27baf3[_0x2d4a('0x98')])||!this[_0x2d4a('0x90')](_0x27baf3[_0x2d4a('0x93')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x12e'));}if(!this[_0x2d4a('0x90')](_0x27baf3['text'])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd0'));}this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x12f'),_0x27baf3[_0x2d4a('0x62')]));var _0x4f0235=this[_0x2d4a('0x92')]['sync'](this,_0x27baf3);if(_0x4f0235){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x130'),_0x4f0235));var _0x296847=this[_0x2d4a('0xd')]['streamFile'](_0x4f0235);try{fs[_0x2d4a('0x112')](_0x4f0235+_0x2d4a('0x113'));}catch(_0x45e2b5){logger[_0x2d4a('0x33')](_0x45e2b5);}return _0x296847;}return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x27baf3,_0x2d4a('0x131'));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x132')]=function(_0x4bfd2f){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x133'),_0x4bfd2f[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x4bfd2f[_0x2d4a('0x98')])||!this[_0x2d4a('0x90')](_0x4bfd2f['aws_secret_access_key'])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x12e'));}if(!this[_0x2d4a('0x90')](_0x4bfd2f[_0x2d4a('0x9a')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x134'));}if(!this[_0x2d4a('0x90')](_0x4bfd2f[_0x2d4a('0x62')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd0'));}this[_0x2d4a('0xd')][_0x2d4a('0x102')]=!![];this[_0x2d4a('0x38')](_0x4bfd2f);this[_0x2d4a('0x46')](_0x4bfd2f[_0x2d4a('0x62')],'in','','');this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x135'),_0x4bfd2f['text']));var _0x5ce129=this['awsLex'][_0x2d4a('0x7a')](this,_0x4bfd2f);if(_0x5ce129){for(var _0x59a0af in _0x5ce129){if(_0x5ce129[_0x2d4a('0xa1')](_0x59a0af)&&_[_0x2d4a('0xa2')](_0x5ce129[_0x59a0af])){this[_0x2d4a('0xd')][_0x2d4a('0xab')](util[_0x2d4a('0x29')](_0x2d4a('0x136'),_0x59a0af[_0x2d4a('0x73')]()),_0x5ce129[_0x59a0af]);}}if(_['isNil'](_0x5ce129[_0x2d4a('0x82')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x137'));}else{this[_0x2d4a('0x46')](_0x5ce129[_0x2d4a('0x82')],'out',_0x2d4a('0x138'),'');return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Amazon\x20Lex\x20Result\x20%s',_0x5ce129[_0x2d4a('0x82')]));}}return this['channel'][_0x2d4a('0x33')](_0x4bfd2f,_0x2d4a('0x139'));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x13a')]=function(_0x5d555d){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x13b'),_0x5d555d[_0x2d4a('0x3a')],_0x5d555d[_0x2d4a('0x6d')]));if(!this['isConfigured'](_0x5d555d['key'])){return this['channel'][_0x2d4a('0xb3')](_0x2d4a('0xf6'));}var _0xbb7c4c=_0x2d4a('0x13c');var _0x18f5e5=util[_0x2d4a('0x29')](_0x2d4a('0x13d'),FILES_PATH,rs[_0x2d4a('0x127')](0x4));var _0x331896=util[_0x2d4a('0x29')](_0x2d4a('0xaa'),_0x18f5e5,_0xbb7c4c);var _0x18f938=!![];if(_0x5d555d['beep']===_0x2d4a('0x13e')){_0x18f938=![];}var _0x311831=this['channel'][_0x2d4a('0x13f')](_0x18f5e5,_0xbb7c4c,_0x5d555d[_0x2d4a('0x140')],_0x5d555d['timeout'],undefined,_0x18f938);if(_0x311831[_0x2d4a('0xae')]!==-0x1){this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')](_0x2d4a('0x141'),_0x331896));var _0x45c610=this[_0x2d4a('0x9b')][_0x2d4a('0x7a')](this,_0x5d555d,_0x331896);if(_0x45c610){for(var _0x409af3 in _0x45c610){if(_0x45c610['hasOwnProperty'](_0x409af3)){this['channel'][_0x2d4a('0xab')](util['format'](_0x2d4a('0x142'),_0x409af3[_0x2d4a('0x73')]()),_0x45c610[_0x409af3]);}}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x143'),JSON[_0x2d4a('0x7d')](_0x45c610)));}}return _0x311831;};AGIVertices[_0x2d4a('0x10')]['tildeasr']=function(_0x4a7e3b){logger['info'](util[_0x2d4a('0x29')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4a7e3b[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0x4a7e3b['appid'])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0x144'));}if(!this[_0x2d4a('0x90')](_0x4a7e3b[_0x2d4a('0x9e')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x145'));}var _0x28b4e9='wav';var _0x363016=util['format'](_0x2d4a('0x13d'),FILES_PATH,rs[_0x2d4a('0x127')](0x4));var _0x41d03e=util['format']('%s.%s',_0x363016,_0x28b4e9);var _0x5cece4=!![];if(_0x4a7e3b[_0x2d4a('0x146')]===_0x2d4a('0x13e')){_0x5cece4=![];}var _0x57bd25=this[_0x2d4a('0xd')][_0x2d4a('0x13f')](_0x363016,_0x28b4e9,_0x4a7e3b[_0x2d4a('0x140')],_0x4a7e3b['timeout'],undefined,_0x5cece4);if(_0x57bd25['result']!==-0x1){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0x147'),_0x41d03e));var _0x104774=this[_0x2d4a('0x9c')][_0x2d4a('0x7a')](this,_0x4a7e3b,_0x41d03e);if(_0x104774){for(var _0x2ee956 in _0x104774){if(_0x104774[_0x2d4a('0xa1')](_0x2ee956)){this[_0x2d4a('0xd')][_0x2d4a('0xab')](util['format']('TILDE_ASR_%s',_0x2ee956[_0x2d4a('0x73')]()),_0x104774[_0x2ee956]);}}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x148'),JSON[_0x2d4a('0x7d')](_0x104774)));}}return _0x57bd25;};AGIVertices['prototype'][_0x2d4a('0x149')]=function(_0x26f95c){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x14a'),_0x26f95c[_0x2d4a('0x3a')]));return this[_0x2d4a('0xd')][_0x2d4a('0x14b')](_0x26f95c[_0x2d4a('0x40')],_0x26f95c[_0x2d4a('0x41')],_0x26f95c[_0x2d4a('0x42')]);};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x14c')]=function(_0x4e5349){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x14d'),_0x4e5349[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x4e5349[_0x2d4a('0x14e')])){return this['channel']['error'](_0x4e5349,_0x2d4a('0x14f'));}try{var _0x37cd11=eval(_0x4e5349[_0x2d4a('0x14e')])?_0x2d4a('0x150'):'false';this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x151'),_0x4e5349[_0x2d4a('0x14e')],_0x37cd11));return{'code':0xc8,'result':_0x37cd11};}catch(_0xaec0ff){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x152')]=function(_0x5c051c){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x153'),_0x5c051c['label']));if(!this[_0x2d4a('0x90')](_0x5c051c[_0x2d4a('0x154')])){return this['channel'][_0x2d4a('0x33')](_0x5c051c,_0x2d4a('0x155'));}var _0x59a9f4=this[_0x2d4a('0x24')][_0x2d4a('0x7a')](this,_0x5c051c[_0x2d4a('0x154')]);if(!_0x59a9f4){return this[_0x2d4a('0xd')]['error'](_0x5c051c,'no\x20intervals\x20found');}for(var _0xf10669=0x0;_0xf10669<_0x59a9f4[_0x2d4a('0xa8')];_0xf10669+=0x1){var _0x1fa499=this[_0x2d4a('0xd')][_0x2d4a('0x11')](util[_0x2d4a('0x29')](_0x2d4a('0x156'),_0x59a9f4[_0xf10669]));if(_0x1fa499['result']===-0x1){return _0x1fa499;}logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x157'),_0x59a9f4[_0xf10669],_0x1fa499['extra']));if(_0x1fa499['extra']===_0x2d4a('0x150')){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x157'),_0x59a9f4[_0xf10669],_0x2d4a('0x150')));this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('IFTIME\x20%s\x20%s',_0x59a9f4[_0xf10669],_0x2d4a('0x150')));return{'code':0xc8,'result':_0x2d4a('0x150')};}else{logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x157'),_0x59a9f4[_0xf10669],_0x2d4a('0x158')));this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x157'),_0x59a9f4[_0xf10669],_0x2d4a('0x158')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x159')]=function(_0x2990b4){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x15a'),_0x2990b4['label']));return this[_0x2d4a('0xd')][_0x2d4a('0x159')]();};AGIVertices[_0x2d4a('0x10')]['ispeechasr']=function(_0x270b5b){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x15b'),_0x270b5b[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x270b5b[_0x2d4a('0x8b')])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0xf6'));}var _0x5c18b1='wav';var _0x6b6b93=util[_0x2d4a('0x29')](_0x2d4a('0x13d'),FILES_PATH,rs[_0x2d4a('0x127')](0x4));var _0x4392af=util[_0x2d4a('0x29')](_0x2d4a('0xaa'),_0x6b6b93,_0x5c18b1);var _0x2de165=!![];if(_0x270b5b['beep']===_0x2d4a('0x13e')){_0x2de165=![];}var _0xfdd7a5=this[_0x2d4a('0xd')][_0x2d4a('0x13f')](_0x6b6b93,_0x5c18b1,_0x270b5b[_0x2d4a('0x140')],_0x270b5b[_0x2d4a('0x6d')],undefined,_0x2de165);if(_0xfdd7a5[_0x2d4a('0xae')]!==-0x1){this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x15c'),_0x4392af));var _0x591070=this['ispeechASR'][_0x2d4a('0x7a')](this,_0x270b5b,_0x4392af);if(_0x591070){for(var _0xc72bd8 in _0x591070){if(_0x591070[_0x2d4a('0xa1')](_0xc72bd8)){this['channel'][_0x2d4a('0xab')](util[_0x2d4a('0x29')](_0x2d4a('0x15d'),_0xc72bd8['toUpperCase']()),_0x591070[_0xc72bd8]);}}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0x15e'),JSON[_0x2d4a('0x7d')](_0x591070)));}}return _0xfdd7a5;};AGIVertices['prototype'][_0x2d4a('0x15f')]=function(_0x59f7ca){logger['info'](util['format'](_0x2d4a('0x160'),_0x59f7ca[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x59f7ca[_0x2d4a('0x8b')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xf6'));}if(!this[_0x2d4a('0x90')](_0x59f7ca[_0x2d4a('0x62')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd0'));}this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Trying\x20ispeech\x20TTS\x20%s',_0x59f7ca[_0x2d4a('0x62')]));var _0x2c3b51=this[_0x2d4a('0x8a')][_0x2d4a('0x7a')](this,_0x59f7ca);if(_0x2c3b51){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0x15c'),_0x2c3b51));var _0x2ae82e=this['channel'][_0x2d4a('0x111')](_0x2c3b51,_0x59f7ca[_0x2d4a('0x140')]);try{fs[_0x2d4a('0x112')](_0x2c3b51+_0x2d4a('0x113'));}catch(_0x569f8a){logger[_0x2d4a('0x33')](_0x569f8a);}return _0x2ae82e;}return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x59f7ca,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x2d4a('0x161')]=function(_0x22e044){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x162'),_0x22e044['label']));if(!this[_0x2d4a('0x90')](_0x22e044[_0x2d4a('0x163')])){return this[_0x2d4a('0xd')]['error'](_0x22e044,_0x2d4a('0x164'));}logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x165'),this[_0x2d4a('0xd')]['callerid'],_0x22e044[_0x2d4a('0x163')]));var _0x595bfc=this[_0x2d4a('0x5b')][_0x2d4a('0x7a')](this,_0x22e044[_0x2d4a('0x163')]);if(_0x595bfc){logger['info'](util[_0x2d4a('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x22e044[_0x2d4a('0x163')]));this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x166'),this['channel'][_0x2d4a('0x3d')],_0x22e044[_0x2d4a('0x163')]));return{'code':0xc8,'result':_0x2d4a('0x167')};}else{logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x168'),this['channel']['callerid'],_0x22e044[_0x2d4a('0x163')]));this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x2d4a('0x3d')],_0x22e044['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x2d4a('0x169')]=function(_0x2c015f){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x16a'),_0x2c015f[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x2c015f[_0x2d4a('0x163')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2c015f,_0x2d4a('0x164'));}logger['info'](util['format'](_0x2d4a('0x165'),this['channel'][_0x2d4a('0x3d')],_0x2c015f[_0x2d4a('0x163')]));var _0x264a1c=this[_0x2d4a('0x58')][_0x2d4a('0x7a')](this,_0x2c015f[_0x2d4a('0x163')]);if(_0x264a1c){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x166'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x2c015f['findBy']));this['channel']['noop'](util['format'](_0x2d4a('0x166'),this[_0x2d4a('0xd')]['callerid'],_0x2c015f[_0x2d4a('0x163')]));return{'code':0xc8,'result':_0x2d4a('0x167')};}else{logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x168'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x2c015f[_0x2d4a('0x163')]));this['channel']['noop'](util[_0x2d4a('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x2c015f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x16b')]=function(_0x10a054){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x10a054[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0x10a054[_0x2d4a('0x16c')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x10a054,_0x2d4a('0x16d'));}this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x16e'),_0x10a054[_0x2d4a('0x16c')]));var _0x675c09=eval(_0x10a054[_0x2d4a('0x16c')]);if(!this['isConfigured'](_0x10a054[_0x2d4a('0xe5')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xe4'));}var _0x1bc133=this[_0x2d4a('0x11')][_0x2d4a('0x7a')](this,_0x10a054[_0x2d4a('0xe5')]);if(!_0x1bc133){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x10a054,_0x2d4a('0xe6'));}if(_[_0x2d4a('0xa7')](_0x675c09)){var _0x5de4cb=this;_0x675c09['forEach'](function(_0x4be473,_0x3146b6){_0x5de4cb['channel']['setVariable'](util['format']('%s[%s]',_0x1bc133,_0x3146b6),_0x4be473);});return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x16f'),_0x1bc133));}else{return this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x1bc133,_0x675c09);}};AGIVertices[_0x2d4a('0x10')]['menu']=function(_0x42e0bb){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x170'),_0x42e0bb[_0x2d4a('0x3a')]));if(_0x42e0bb['retry']===0x0){return this[_0x2d4a('0xb1')](_0x42e0bb);}_0x42e0bb[_0x2d4a('0x11f')]-=0x1;if(!this[_0x2d4a('0x90')](_0x42e0bb[_0x2d4a('0x120')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x42e0bb,_0x2d4a('0x121'));}var _0x39dcb0=this[_0x2d4a('0x1e')]['sync'](this,_0x42e0bb[_0x2d4a('0x120')]);if(!_0x39dcb0){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x42e0bb,_0x2d4a('0x171'));}var _0x48f056=this[_0x2d4a('0xd')][_0x2d4a('0x122')](_0x39dcb0,_0x42e0bb[_0x2d4a('0x172')],_0x42e0bb[_0x2d4a('0x173')]);var _0x4ccbce=_0x48f056[_0x2d4a('0xae')];if(_0x48f056[_0x2d4a('0xae')]===-0x1){this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x42e0bb,'-1');return _0x48f056;}else if(_0x48f056[_0x2d4a('0xb0')]===_0x2d4a('0x6d')){_0x48f056[_0x2d4a('0xae')]=_0x48f056['result'][_0x2d4a('0xa8')]>0x0?_0x48f056[_0x2d4a('0xae')]:'t';}else if(_[_0x2d4a('0x48')](_0x48f056['result'])){_0x48f056[_0x2d4a('0xae')]='#';_0x4ccbce='#';}if(!this['isConfigured'](_0x42e0bb[_0x2d4a('0xe5')])){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xe4'));}else{var _0x5073cf=this[_0x2d4a('0x11')][_0x2d4a('0x7a')](this,_0x42e0bb[_0x2d4a('0xe5')]);if(!_0x5073cf){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x42e0bb,_0x2d4a('0xe6'));}this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x5073cf,_0x4ccbce);}this['createSquareDetailsReport'][_0x2d4a('0x7a')](this,_0x42e0bb,_0x4ccbce);return _0x48f056;};AGIVertices['prototype'][_0x2d4a('0xb3')]=function(_0x36383d){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x174'),_0x36383d[_0x2d4a('0x3a')]));return this[_0x2d4a('0xd')]['noop'](_0x36383d[_0x2d4a('0x175')]||_0x36383d['label']);};AGIVertices[_0x2d4a('0x10')]['pause']=function(_0x57a189){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x57a189[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x57a189[_0x2d4a('0x163')])){return this['channel'][_0x2d4a('0x33')](_0x57a189,'no\x20find\x20by\x20configured');}logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x165'),this[_0x2d4a('0xd')]['callerid'],_0x57a189[_0x2d4a('0x163')]));var _0x3ab0e4=this[_0x2d4a('0x54')][_0x2d4a('0x7a')](this,_0x57a189[_0x2d4a('0x176')]);var _0x319dbb=this['agentPause'][_0x2d4a('0x7a')](this,_0x57a189[_0x2d4a('0x163')],_0x3ab0e4);if(_0x319dbb){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x166'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x57a189[_0x2d4a('0x163')]));this['channel'][_0x2d4a('0xb3')](util['format'](_0x2d4a('0x166'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x57a189[_0x2d4a('0x163')]));return{'code':0xc8,'result':_0x2d4a('0x167')};}else{logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x168'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x57a189['findBy']));this[_0x2d4a('0xd')]['noop'](util['format'](_0x2d4a('0x166'),this['channel'][_0x2d4a('0x3d')],_0x57a189[_0x2d4a('0x163')]));return{'code':0xc8,'result':_0x2d4a('0x177')};}};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x178')]=function(_0x21e0ba){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x179'),_0x21e0ba['label']));if(!this[_0x2d4a('0x90')](_0x21e0ba['file_id'])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x21e0ba,'no\x20file\x20audio\x20selected');}var _0x16da40=this[_0x2d4a('0x1e')]['sync'](this,_0x21e0ba[_0x2d4a('0x120')]);if(!_0x16da40){return this['channel'][_0x2d4a('0x33')](_0x21e0ba,_0x2d4a('0x171'));}var _0x35a9ce=this['channel'][_0x2d4a('0x5d')]('PLAYBACK',[_0x16da40,_0x21e0ba[_0x2d4a('0xf2')]]);if(_0x35a9ce['result']===-0x1){return _0x35a9ce;}return this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0xca'),_0x2d4a('0x17a'),_0x16da40));};AGIVertices['prototype']['queue']=function(_0x302a98){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x17b'),_0x302a98[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0x302a98[_0x2d4a('0x17c')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x302a98,'no\x20queue\x20selected');}var _0x2bc3d3='';var _0x211c11=parseInt(_0x302a98[_0x2d4a('0x17c')],0xa);if(isNaN(_0x211c11)){_0x2bc3d3=_0x302a98['queue_id'];}else{_0x2bc3d3=this['getVoiceQueue'][_0x2d4a('0x7a')](this,_0x302a98[_0x2d4a('0x17c')]);if(!_0x2bc3d3){return this['channel'][_0x2d4a('0x33')](_0x302a98,_0x2d4a('0x17d'));}}var _0xd1c485='';if(this['isConfigured'](_0x302a98['file_id'])){var _0x44b2ae=this[_0x2d4a('0x1e')][_0x2d4a('0x7a')](this,_0x302a98[_0x2d4a('0x120')]);if(_0x44b2ae){_0xd1c485=_0x44b2ae;}}this['createSquareDetailsReport'][_0x2d4a('0x7a')](this,_0x302a98,_0x2bc3d3);if(_0x302a98[_0x2d4a('0xf2')]['indexOf']('x')<0x0){_0x302a98[_0x2d4a('0xf2')]+='x';}if(_0x302a98[_0x2d4a('0xf2')][_0x2d4a('0x17e')]('X')<0x0){_0x302a98[_0x2d4a('0xf2')]+='X';}this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x2d4a('0x17f'),_0x2bc3d3?_0x2bc3d3[_0x2d4a('0x180')]():'');var _0x11f7b9=this[_0x2d4a('0xd')][_0x2d4a('0x5d')]('QUEUE',[_0x2bc3d3,_0x302a98[_0x2d4a('0xf2')],_0x302a98[_0x2d4a('0x6c')],_0xd1c485,_0x302a98[_0x2d4a('0x6d')],_0x302a98[_0x2d4a('0x5')],_0x302a98[_0x2d4a('0x181')],_0x302a98[_0x2d4a('0x182')],'',_0x302a98['position']]);if(_0x11f7b9[_0x2d4a('0xae')]===-0x1){return _0x11f7b9;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0xca'),_0x2d4a('0x183'),_0x2bc3d3));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x184')]=function(_0x5b8469){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x185'),_0x5b8469[_0x2d4a('0x3a')]));var _0x58b0a5=_0x5b8469[_0x2d4a('0x186')]||_0x2d4a('0x13c');var _0x594585=util[_0x2d4a('0x29')](_0x2d4a('0x187'),this[_0x2d4a('0xd')][_0x2d4a('0x39')],rs[_0x2d4a('0x127')](0x5));var _0x217d6d=util[_0x2d4a('0x29')](_0x2d4a('0x188'),FILES_PATH,_0x594585,_0x58b0a5);var _0x5a1aad=util[_0x2d4a('0x29')](_0x2d4a('0x13d'),FILES_PATH,_0x594585);this['createSquareRecording']['sync'](this,_0x5b8469,_0x594585,_0x217d6d);this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x2d4a('0x189'),_0x594585);logger[_0x2d4a('0x2f')](_0x2d4a('0x18a'),_0x5a1aad,_0x58b0a5,_0x5b8469[_0x2d4a('0x18b')],_0x5b8469[_0x2d4a('0x6d')]);return this[_0x2d4a('0xd')][_0x2d4a('0x13f')](_0x5a1aad,_0x58b0a5,_0x5b8469[_0x2d4a('0x18b')],_0x5b8469[_0x2d4a('0x6d')],undefined,!![]);};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x18c')]=function(_0xee8116){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x18d'),_0xee8116[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0xee8116['url'])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x18e'));}var _0x5ec860=this[_0x2d4a('0x6b')]['sync'](this,_0xee8116);logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x18f'),util[_0x2d4a('0x190')](_0x5ec860,{'showHidden':![],'depth':null})));if(!this[_0x2d4a('0x90')](_0xee8116[_0x2d4a('0xe5')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3572eb=this['getVariable']['sync'](this,_0xee8116['variable_id']);if(!_0x3572eb){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0xee8116,'no\x20variable\x20found');}this[_0x2d4a('0xd')][_0x2d4a('0xab')](util[_0x2d4a('0x29')](_0x2d4a('0x191'),_0x3572eb),_0x5ec860['statusCode']?_0x5ec860[_0x2d4a('0x80')]:_0x2d4a('0x192'));this[_0x2d4a('0xd')]['setVariable'](util['format']('%s_STATUS_MESSAGE',_0x3572eb),_0x5ec860['statusMessage']?_0x5ec860[_0x2d4a('0x81')]:'OK');if(_0x5ec860[_0x2d4a('0x7e')]){try{this[_0x2d4a('0xa9')](_0x5ec860[_0x2d4a('0x7e')],_0x3572eb);}catch(_0x2ec9a3){logger[_0x2d4a('0x33')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3572eb));}}return this['channel']['noop'](util[_0x2d4a('0x29')]('variable\x20%s\x20set',_0x3572eb));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x193')]=function(_0x197962){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x194'),_0x197962['label']));return this['channel']['sayDigits'](_0x197962[_0x2d4a('0x195')][_0x2d4a('0x5e')](/\s+/g,''),_0x197962['escape_digits']);};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x196')]=function(_0x498735){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x197'),_0x498735['label']));return this[_0x2d4a('0xd')][_0x2d4a('0x198')](_0x498735[_0x2d4a('0x6e')]['replace'](/\s+/g,''),_0x498735['escape_digits']);};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x199')]=function(_0x403a8e){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x19a'),_0x403a8e[_0x2d4a('0x3a')]));return this['channel'][_0x2d4a('0x19b')](_0x403a8e[_0x2d4a('0x62')],_0x403a8e[_0x2d4a('0x18b')]);};AGIVertices[_0x2d4a('0x10')]['sendMail']=function(_0xc651e0){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x19c'),_0xc651e0[_0x2d4a('0x3a')]));if(!this['isConfigured'](_0xc651e0['account_id'])){return this['channel'][_0x2d4a('0xb3')](_0x2d4a('0x19d'));}var _0x188785=this[_0x2d4a('0x21')][_0x2d4a('0x7a')](this,_0xc651e0['account_id']);if(!_0x188785||!_0x188785['Smtp']){return this[_0x2d4a('0xd')]['error'](_0xc651e0,_0x2d4a('0x19e'));}var _0x23ed06={'from':util[_0x2d4a('0x29')](_0x2d4a('0x19f'),_0x188785[_0x2d4a('0x13')],_0x188785[_0x2d4a('0x1a0')]||_0x188785[_0x2d4a('0x1a1')][_0x2d4a('0x1a2')]),'to':_0xc651e0['to']||'','cc':_0xc651e0['cc']||'','bcc':_0xc651e0[_0x2d4a('0x1a3')]||'','subject':_0xc651e0[_0x2d4a('0x1a4')],'html':_0xc651e0[_0x2d4a('0x62')],'text':_0xc651e0[_0x2d4a('0x62')]};var _0x3f10af={'tls':{'rejectUnauthorized':![]}};if(_0x188785[_0x2d4a('0x1a1')][_0x2d4a('0x1a5')]){_0x3f10af[_0x2d4a('0x1a5')]=_0x188785[_0x2d4a('0x1a1')][_0x2d4a('0x1a5')];}else{_0x3f10af[_0x2d4a('0x1a6')]=_0x188785['Smtp'][_0x2d4a('0x1a6')];_0x3f10af[_0x2d4a('0x1a7')]=_0x188785[_0x2d4a('0x1a1')][_0x2d4a('0x1a7')];_0x3f10af[_0x2d4a('0x1a8')]=_0x188785[_0x2d4a('0x1a1')]['secure'];}if(_0x188785[_0x2d4a('0x1a1')]['authentication']){_0x3f10af['auth']={'user':_0x188785[_0x2d4a('0x1a1')]['user'],'pass':_0x188785[_0x2d4a('0x1a1')][_0x2d4a('0x1a9')]};}if(this[_0x2d4a('0x90')](_0xc651e0[_0x2d4a('0x1aa')])){}logger[_0x2d4a('0xeb')](_0x2d4a('0x1ab'),JSON[_0x2d4a('0x7d')](_0x23ed06));this['createSquareDetailsReport'][_0x2d4a('0x7a')](this,_0xc651e0,_0xc651e0[_0x2d4a('0x1ac')]);this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x1ad'),_0x188785[_0x2d4a('0x13')]));this['sendMailMessage'][_0x2d4a('0x7a')](this,_0x3f10af,_0x23ed06);return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x1ae'));};AGIVertices['prototype'][_0x2d4a('0x1af')]=function(_0xeeea7c){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xeeea7c[_0x2d4a('0x3a')]));return this[_0x2d4a('0xd')][_0x2d4a('0xb3')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x2d4a('0x10')]['sendSMS']=function(_0xa0f4be){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x1b0'),_0xa0f4be['label']));if(!this[_0x2d4a('0x90')](_0xa0f4be[_0x2d4a('0x1b1')])){return this['channel'][_0x2d4a('0xb3')](_0x2d4a('0x1b2'));}var _0x3d4997=this[_0x2d4a('0x35')][_0x2d4a('0x7a')](this,_0xa0f4be[_0x2d4a('0x1b1')]);if(!_0x3d4997){return this[_0x2d4a('0xd')]['error'](_0xa0f4be,_0x2d4a('0x1b3'));}var _0xf87d60={'body':_0xa0f4be[_0x2d4a('0x1b4')],'phone':_0xa0f4be['to']||'','SmsAccountId':_0x3d4997['id']};logger[_0x2d4a('0xeb')](_0x2d4a('0x1b5'),JSON[_0x2d4a('0x7d')](_0xf87d60));this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0xa0f4be,_0xa0f4be[_0x2d4a('0x1b1')]);this['channel']['noop'](util[_0x2d4a('0x29')](_0x2d4a('0x1b6'),_0x3d4997[_0x2d4a('0x13')]));this[_0x2d4a('0x37')][_0x2d4a('0x7a')](this,_0xf87d60);return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0x1b7'));};AGIVertices[_0x2d4a('0x10')]['set']=function(_0x5eb558){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5eb558['label']));if(!this[_0x2d4a('0x90')](_0x5eb558['variable_id'])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x5eb558,_0x2d4a('0x1b8'));}var _0x8667e8=this[_0x2d4a('0x11')][_0x2d4a('0x7a')](this,_0x5eb558['variable_id']);if(!_0x8667e8){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x5eb558,_0x2d4a('0xe6'));}return this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x8667e8,_0x5eb558['variable_value']);};AGIVertices['prototype']['start']=function(_0x5cf828){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x1b9'),_0x5cf828[_0x2d4a('0x3a')]));this['channel'][_0x2d4a('0xb3')](_0x2d4a('0x1ba'));if(_0x5cf828['answer']==='yes'){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0x1bb'));return this[_0x2d4a('0xd')][_0x2d4a('0xc0')]();}return this['channel'][_0x2d4a('0xb3')](_0x2d4a('0x1bc'));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x1bd')]=function(_0x2532a0){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x1be'),_0x2532a0[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x2532a0['project_id'])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2532a0,_0x2d4a('0x1bf'));}var _0x52c864=this[_0x2d4a('0x17')][_0x2d4a('0x7a')](this,_0x2532a0[_0x2d4a('0x1c0')]);if(!this[_0x2d4a('0x90')](_0x52c864)){return this['channel'][_0x2d4a('0x33')](_0x2532a0,util[_0x2d4a('0x29')](_0x2d4a('0x1c1'),_0x2532a0[_0x2d4a('0x1c0')]));}if(_0x52c864===this[_0x2d4a('0xd')]['arg_1']){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x2532a0,_0x2d4a('0x1c2'));}this[_0x2d4a('0x38')][_0x2d4a('0x7a')](this,_0x2532a0,_0x52c864);var _0x4101d3=this['channel'][_0x2d4a('0x5d')](_0x2d4a('0x1c3'),util[_0x2d4a('0x29')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x2d4a('0x5')][_0x2d4a('0x1a6')]||_0x2d4a('0x1c4'),_0x52c864,this['channel'][_0x2d4a('0x3c')]));if(_0x4101d3[_0x2d4a('0xae')]===-0x1){return _0x4101d3;}return this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')](_0x2d4a('0xca'),'AGI',_0x52c864));};AGIVertices[_0x2d4a('0x10')]['system']=function(_0x529e73){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x1c5'),_0x529e73[_0x2d4a('0x3a')]));var _0x91e751=this[_0x2d4a('0x5c')][_0x2d4a('0x7a')](this,_0x529e73[_0x2d4a('0xbe')]);this['createSquareDetailsReport']['sync'](this,_0x529e73,_0x529e73['command']);if(this[_0x2d4a('0x90')](_0x529e73[_0x2d4a('0xe5')])){var _0x4c1fb6=this['getVariable'][_0x2d4a('0x7a')](this,_0x529e73['variable_id']);if(_0x4c1fb6){this[_0x2d4a('0xd')][_0x2d4a('0xab')](_0x4c1fb6,_0x91e751);return this[_0x2d4a('0xd')]['noop'](util['format'](_0x2d4a('0x1c6'),_0x529e73['command'],_0x4c1fb6));}}return this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')](_0x2d4a('0x1c7'),_0x529e73[_0x2d4a('0xbe')]));};AGIVertices['prototype'][_0x2d4a('0x1c8')]=function(_0x415116){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x1c9'),_0x415116[_0x2d4a('0x3a')]));_0x415116[_0x2d4a('0x62')]=_0x415116[_0x2d4a('0x62')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x415116['apiKey'])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0x1ca'));}if(!this['isConfigured'](_0x415116[_0x2d4a('0x62')])){return this[_0x2d4a('0xd')]['noop'](_0x2d4a('0xd0'));}this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util['format'](_0x2d4a('0x1cb'),_0x415116[_0x2d4a('0x62')]));var _0x3bd196=this[_0x2d4a('0x5f')]['sync'](this,_0x415116);if(_0x3bd196){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3bd196));var _0x804c0b=this[_0x2d4a('0xd')][_0x2d4a('0x111')](_0x3bd196);try{fs['unlink'](_0x3bd196+_0x2d4a('0x113'));}catch(_0x3e0b53){logger['error'](_0x3e0b53);}return _0x804c0b;}return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0x415116,_0x2d4a('0x1cc'));};AGIVertices[_0x2d4a('0x10')][_0x2d4a('0x1cd')]=function(_0x1faa28){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')](_0x2d4a('0x1ce'),_0x1faa28[_0x2d4a('0x3a')]));_0x1faa28[_0x2d4a('0x62')]=_0x1faa28[_0x2d4a('0x62')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2d4a('0x90')](_0x1faa28[_0x2d4a('0x62')])){return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](_0x2d4a('0xd0'));}this['channel'][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x1cf'),_0x1faa28[_0x2d4a('0x62')]));var _0x23e591=this[_0x2d4a('0x69')][_0x2d4a('0x7a')](this,_0x1faa28);if(_0x23e591){this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')]('Google\x20TTS\x20%s\x20file\x20created',_0x23e591));var _0x24ad47=this[_0x2d4a('0xd')]['streamFile'](_0x23e591);try{fs[_0x2d4a('0x112')](_0x23e591+'.wav');}catch(_0x4f2fde){logger['error'](_0x4f2fde);}return _0x24ad47;}return this['channel'][_0x2d4a('0x33')](_0x1faa28,_0x2d4a('0x1d0'));};AGIVertices['prototype'][_0x2d4a('0x1d1')]=function(_0x1b9c5c){logger[_0x2d4a('0x2f')](util['format'](_0x2d4a('0x1d2'),_0x1b9c5c[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0x1b9c5c[_0x2d4a('0x163')])){return this['channel'][_0x2d4a('0x33')](_0x1b9c5c,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x2d4a('0x3d')],_0x1b9c5c['findBy']));var _0x1c9e02=this[_0x2d4a('0x57')][_0x2d4a('0x7a')](this,_0x1b9c5c['findBy']);if(_0x1c9e02){logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x166'),this['channel'][_0x2d4a('0x3d')],_0x1b9c5c[_0x2d4a('0x163')]));this[_0x2d4a('0xd')]['noop'](util[_0x2d4a('0x29')](_0x2d4a('0x166'),this['channel'][_0x2d4a('0x3d')],_0x1b9c5c['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x2d4a('0x29')](_0x2d4a('0x168'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x1b9c5c[_0x2d4a('0x163')]));this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0x168'),this[_0x2d4a('0xd')][_0x2d4a('0x3d')],_0x1b9c5c[_0x2d4a('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x4d3eb2){logger[_0x2d4a('0x2f')](util[_0x2d4a('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4d3eb2[_0x2d4a('0x3a')]));var _0x2aab14=this[_0x2d4a('0xd')][_0x2d4a('0x5d')](_0x2d4a('0x1d3'),[_0x4d3eb2[_0x2d4a('0x1d4')],_0x4d3eb2[_0x2d4a('0x83')]]);if(_0x2aab14[_0x2d4a('0xae')]===-0x1){return _0x2aab14;}return this[_0x2d4a('0xd')][_0x2d4a('0xb3')](util[_0x2d4a('0x29')](_0x2d4a('0xca'),_0x2d4a('0x1d3'),_0x4d3eb2[_0x2d4a('0x1d4')]));};AGIVertices[_0x2d4a('0x10')]['vswitch']=function(_0xee9c96){logger[_0x2d4a('0x2f')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0xee9c96[_0x2d4a('0x3a')]));if(!this[_0x2d4a('0x90')](_0xee9c96[_0x2d4a('0xe5')])){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0xee9c96,'no\x20variable\x20selected');}var _0x2894d4=this['getVariable'][_0x2d4a('0x7a')](this,_0xee9c96[_0x2d4a('0xe5')]);if(!_0x2894d4){return this[_0x2d4a('0xd')][_0x2d4a('0x33')](_0xee9c96,_0x2d4a('0xe6'));}var _0x5a762c=this['channel'][_0x2d4a('0x11')](_0x2894d4);return{'code':0xc8,'result':_0x5a762c[_0x2d4a('0xb0')]?_0x5a762c[_0x2d4a('0xb0')]:'-'};};String[_0x2d4a('0x10')][_0x2d4a('0xac')]=function(_0x3ab9af,_0xc2a9d6){return this[_0x2d4a('0x1d5')](_0x3ab9af)[_0x2d4a('0x1d6')](_0xc2a9d6);};module[_0x2d4a('0x1d7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 3c35186..565208a 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 _0x96e8=['[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','name','then','getAgent','voicePause','info','attended','destlinkedid','savePause','timer','stopAcw','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','prototype','[%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','[ACW][syncAgentConnect]\x20%s','message','isUndefined'];(function(_0x4682ca,_0x18941c){var _0x5b9c77=function(_0x3e2e27){while(--_0x3e2e27){_0x4682ca['push'](_0x4682ca['shift']());}};_0x5b9c77(++_0x18941c);}(_0x96e8,0xbf));var _0x896e=function(_0x8ef5f0,_0x11a1b3){_0x8ef5f0=_0x8ef5f0-0x0;var _0xe276a9=_0x96e8[_0x8ef5f0];return _0xe276a9;};'use strict';var util=require(_0x896e('0x0'));var _=require('lodash');var moment=require(_0x896e('0x1'));var ami=require('../ami');var logger=require(_0x896e('0x2'))(_0x896e('0x3'));var RpcUser=require(_0x896e('0x4'));var RpcVoiceAgentReport=require(_0x896e('0x5'));function Acw(_0x484af0){this[_0x896e('0x6')]=_0x484af0[_0x896e('0x6')];this['agents']=_0x484af0[_0x896e('0x7')];this[_0x896e('0x8')]=_0x484af0[_0x896e('0x8')];this[_0x896e('0x9')]={};ami['on'](_0x896e('0xa'),this[_0x896e('0xb')][_0x896e('0xc')](this));ami['on'](_0x896e('0xd'),this[_0x896e('0xe')][_0x896e('0xc')](this));ami['on'](_0x896e('0xf'),this[_0x896e('0x10')][_0x896e('0xc')](this));ami['on'](_0x896e('0x11'),this[_0x896e('0x12')][_0x896e('0xc')](this));ami['on'](_0x896e('0x13'),this[_0x896e('0x14')][_0x896e('0xc')](this));ami['on'](_0x896e('0x15'),this[_0x896e('0x16')][_0x896e('0xc')](this));ami['on'](_0x896e('0x17'),this[_0x896e('0x18')]['bind'](this));}function getDiff(_0x57fd65){var _0x2d085a=moment()[_0x896e('0x19')](0x0);var _0x2f8f2e=moment(_0x57fd65)[_0x896e('0x19')](0x0);return _0x2d085a[_0x896e('0x1a')](_0x2f8f2e,_0x896e('0x1b'));}Acw['prototype'][_0x896e('0x1c')]=function(_0x243fea){try{var _0xc71f9b=this;var _0x91f063=this[_0x896e('0x9')][_0x243fea][_0x896e('0x1d')];var _0x3687ef=this[_0x896e('0x9')][_0x243fea]['queue'];var _0x126034=this[_0x896e('0x6')][_0x3687ef];var _0xd2ec04=![];var _0x2335c8=_0x896e('0x1e');if(_0x126034[_0x896e('0x1f')]){if(_0x126034['mandatoryDispositionPause'][_0x896e('0x20')]){_0xd2ec04=!![];_0x2335c8=_0x126034['mandatoryDispositionPause']['name'];}}ami['Action']({'action':'QueuePause','interface':_0x91f063,'paused':!![],'reason':_0x2335c8})[_0x896e('0x21')](function(_0x1bc42c){if(_0xc71f9b[_0x896e('0x7')][_0x91f063]){return RpcUser[_0x896e('0x22')](_0xc71f9b['agents'][_0x91f063]['id'])[_0x896e('0x21')](function(_0x51f52e){if(_0x51f52e&&!_0x51f52e[_0x896e('0x23')]){logger[_0x896e('0x24')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x243fea,_0x91f063,_0x3687ef);var _0x2deadd=_0xc71f9b[_0x896e('0x9')][_0x243fea][_0x896e('0x25')]&&_0xc71f9b['channels'][_0x243fea][_0x896e('0x26')]?_0xc71f9b['channels'][_0x243fea][_0x896e('0x26')]:_0x243fea;return RpcUser[_0x896e('0x27')](_0xc71f9b['agents'][_0x91f063],_0x2335c8,_0x2deadd)[_0x896e('0x21')](function(_0x25e8bc){if(!_0xd2ec04){_0xc71f9b[_0x896e('0x8')][_0x91f063]={};logger[_0x896e('0x24')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x243fea,_0xc71f9b[_0x896e('0x6')][_0x3687ef]['acwTimeout'],_0x91f063,_0x3687ef);_0xc71f9b['timers'][_0x91f063][_0x896e('0x28')]=setTimeout(_0xc71f9b[_0x896e('0x29')][_0x896e('0xc')](_0xc71f9b,_0x91f063),_0xc71f9b[_0x896e('0x6')][_0x3687ef][_0x896e('0x2a')]*0x3e8);_0xc71f9b[_0x896e('0x8')][_0x91f063]['lastPauseAt']=moment()['format'](_0x896e('0x2b'));_0xc71f9b[_0x896e('0x8')][_0x91f063][_0x896e('0x2c')]=_0x243fea;_0xc71f9b[_0x896e('0x8')][_0x91f063][_0x896e('0x2d')]=_0x3687ef;_0xc71f9b['timers'][_0x91f063][_0x896e('0x2e')]=function(){var _0x477909=getDiff(_0xc71f9b[_0x896e('0x8')][_0x91f063][_0x896e('0x2f')]);clearTimeout(_0xc71f9b['timers'][_0x91f063][_0x896e('0x28')]);_0xc71f9b[_0x896e('0x8')][_0x91f063][_0x896e('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x477909},_0xc71f9b[_0x896e('0x8')][_0x91f063]['uniqueid'],_0x91f063)['then'](function(_0x5831cd){logger[_0x896e('0x24')](_0x896e('0x30'),_0x243fea,_0x477909,_0x5831cd);})['catch'](function(_0x5bc0cc){logger[_0x896e('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x243fea,_0x5bc0cc);});delete _0xc71f9b['timers'][_0x91f063];};}});}else{logger['info'](_0x896e('0x32'),_0x243fea,_0x91f063,_0x3687ef);}});}})[_0x896e('0x33')](function(_0x3f8253){logger[_0x896e('0x31')](_0x896e('0x34'),_0x243fea,_0xc71f9b[_0x896e('0x6')][_0x3687ef]['acwTimeout'],_0x91f063,_0x3687ef);})['finally'](function(){delete _0xc71f9b[_0x896e('0x9')][_0x243fea];});}catch(_0xf03554){logger['error']('[ACW][START]\x20%s',_0xf03554['message']);}};Acw[_0x896e('0x35')]['stopAcw']=function(_0x1bdfdd){try{var _0x31698e=this;if(_0x31698e['timers'][_0x1bdfdd]){_0x31698e['timers'][_0x1bdfdd]['timer']=![];var _0xb9662=_0x31698e[_0x896e('0x8')][_0x1bdfdd]['uniqueid'];var _0x5db26f=_0x31698e[_0x896e('0x8')][_0x1bdfdd][_0x896e('0x2d')];var _0x1e5f31=_0x31698e[_0x896e('0x6')][_0x5db26f][_0x896e('0x2a')];logger[_0x896e('0x24')](_0x896e('0x36'),_0xb9662,_0x1bdfdd);RpcUser[_0x896e('0x37')](this['agents'][_0x1bdfdd]);RpcVoiceAgentReport['update']({'acwtime':_0x1e5f31,'agentacw':!![]},_0xb9662,_0x1bdfdd)['then'](function(_0x396f18){logger['info'](_0x896e('0x30'),_0xb9662,_0x1e5f31,_0x396f18);})[_0x896e('0x33')](function(_0x276f1f){logger[_0x896e('0x31')](_0x896e('0x38'),_0xb9662,_0x276f1f);});}else{logger[_0x896e('0x31')](_0x896e('0x39'),_0x1bdfdd);if(_0x31698e[_0x896e('0x8')]){logger[_0x896e('0x24')](_0x896e('0x3a'),JSON[_0x896e('0x3b')](_0x31698e['timers']));}}}catch(_0x253521){logger['error'](_0x896e('0x3c'),_0x253521['message']);}};Acw[_0x896e('0x35')][_0x896e('0xb')]=function(_0x35c31a){try{if(this['voiceQueues'][_0x35c31a['queue']]&&(this[_0x896e('0x6')][_0x35c31a[_0x896e('0x2d')]]['acw']||this[_0x896e('0x6')][_0x35c31a['queue']]['mandatoryDisposition'])){if(this['agents'][_0x35c31a[_0x896e('0x1d')]]){this['channels'][_0x35c31a[_0x896e('0x2c')]]={'queue':_0x35c31a['queue'],'interface':_0x35c31a[_0x896e('0x1d')],'destlinkedid':_0x35c31a[_0x896e('0x26')]};}}}catch(_0x47ac69){logger['error'](_0x896e('0x3d'),_0x47ac69[_0x896e('0x3e')]);}};Acw[_0x896e('0x35')][_0x896e('0x18')]=function(_0x2087c6){try{if(this['voiceQueues'][_0x2087c6[_0x896e('0x2d')]]&&(this[_0x896e('0x6')][_0x2087c6[_0x896e('0x2d')]]['acw']||this['voiceQueues'][_0x2087c6['queue']][_0x896e('0x1f')])){if(this[_0x896e('0x7')][_0x2087c6[_0x896e('0x1d')]]){this[_0x896e('0x9')][_0x2087c6[_0x896e('0x2c')]]={'queue':_0x2087c6['queue'],'interface':_0x2087c6[_0x896e('0x1d')]};}}}catch(_0x4b0874){logger[_0x896e('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4b0874[_0x896e('0x3e')]);}};Acw[_0x896e('0x35')][_0x896e('0xe')]=function(_0x3d228c){try{if(this[_0x896e('0x9')][_0x3d228c[_0x896e('0x2c')]]&&_[_0x896e('0x3f')](this[_0x896e('0x9')][_0x3d228c[_0x896e('0x2c')]]['attended'])){logger[_0x896e('0x24')](_0x896e('0x40'),_0x3d228c[_0x896e('0x2c')]);this[_0x896e('0x1c')](_0x3d228c[_0x896e('0x2c')]);}else if(this[_0x896e('0x9')][_0x3d228c[_0x896e('0x41')]]&&_[_0x896e('0x3f')](this[_0x896e('0x9')][_0x3d228c[_0x896e('0x41')]][_0x896e('0x25')])){logger[_0x896e('0x24')](_0x896e('0x42'),_0x3d228c[_0x896e('0x41')]);this[_0x896e('0x1c')](_0x3d228c['linkedid']);}}catch(_0x317187){logger[_0x896e('0x31')](_0x896e('0x43'),_0x317187[_0x896e('0x3e')]);}};Acw[_0x896e('0x35')]['syncHangup']=function(_0x4d10d0){try{if(this[_0x896e('0x9')][_0x4d10d0[_0x896e('0x2c')]]&&this[_0x896e('0x9')][_0x4d10d0[_0x896e('0x2c')]]['attended']){logger['info'](_0x896e('0x44'),_0x4d10d0[_0x896e('0x2c')]);this[_0x896e('0x1c')](_0x4d10d0[_0x896e('0x2c')]);}else if(this[_0x896e('0x9')][_0x4d10d0[_0x896e('0x41')]]&&this['channels'][_0x4d10d0[_0x896e('0x41')]][_0x896e('0x25')]){logger[_0x896e('0x24')](_0x896e('0x45'),_0x4d10d0['linkedid']);this['startAcw'](_0x4d10d0[_0x896e('0x41')]);}}catch(_0x525ac7){logger[_0x896e('0x31')](_0x896e('0x46'),_0x525ac7['message']);}};Acw[_0x896e('0x35')][_0x896e('0x14')]=function(_0x3fbfc3){try{if(!_['isNil'](this['channels'][_0x3fbfc3[_0x896e('0x47')]])){this[_0x896e('0x1c')](_0x3fbfc3['transfereeuniqueid']);if(this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x48')]]){this['channels'][_0x3fbfc3['secondtransfereruniqueid']][_0x896e('0x25')]=!![];this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x49')]]=this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x48')]];delete this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x48')]];}}else if(!_['isNil'](this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x49')]])){this[_0x896e('0x1c')](_0x3fbfc3[_0x896e('0x49')]);if(this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x4a')]]){this[_0x896e('0x9')][_0x3fbfc3['origtransfereruniqueid']][_0x896e('0x25')]=!![];this['channels'][_0x3fbfc3[_0x896e('0x47')]]=this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x4a')]];delete this[_0x896e('0x9')][_0x3fbfc3[_0x896e('0x4a')]];}}}catch(_0x2d8329){logger[_0x896e('0x31')](_0x896e('0x4b'),_0x2d8329['message']);}};Acw[_0x896e('0x35')][_0x896e('0x16')]=function(_0x3d76b){try{if(this[_0x896e('0x9')][_0x3d76b[_0x896e('0x4c')]]){logger[_0x896e('0x24')](_0x896e('0x4d'),JSON[_0x896e('0x3b')](_0x3d76b['transfereruniqueid']));this[_0x896e('0x1c')](_0x3d76b[_0x896e('0x4c')]);}else if(this[_0x896e('0x9')][_0x3d76b[_0x896e('0x4e')]]){logger[_0x896e('0x24')](_0x896e('0x4f'),JSON[_0x896e('0x3b')](_0x3d76b[_0x896e('0x4e')]));this[_0x896e('0x1c')](_0x3d76b[_0x896e('0x4e')]);}}catch(_0x24c539){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x24c539[_0x896e('0x3e')]);}};Acw[_0x896e('0x35')][_0x896e('0x12')]=function(_0x48eb9f){try{if(this[_0x896e('0x6')][_0x48eb9f[_0x896e('0x2d')]]&&this[_0x896e('0x6')][_0x48eb9f['queue']]['autopause']===_0x896e('0x50')){if(this['agents'][_0x48eb9f[_0x896e('0x1d')]]){logger[_0x896e('0x24')](_0x896e('0x51'),_0x48eb9f[_0x896e('0x2c')],_0x48eb9f[_0x896e('0x1d')],_0x48eb9f[_0x896e('0x2d')]);return RpcUser[_0x896e('0x27')](this[_0x896e('0x7')][_0x48eb9f['interface']],_0x896e('0x52'),_0x48eb9f[_0x896e('0x2c')]);}}}catch(_0x3c1ef2){logger['error'](_0x896e('0x53'),_0x3c1ef2[_0x896e('0x3e')]);}};module[_0x896e('0x54')]=Acw; \ No newline at end of file +var _0x76d6=['all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x76d6,0x169));var _0x676d=function(_0x3e6b80,_0x13bbe2){_0x3e6b80=_0x3e6b80-0x0;var _0x45eead=_0x76d6[_0x3e6b80];return _0x45eead;};'use strict';var util=require(_0x676d('0x0'));var _=require(_0x676d('0x1'));var moment=require(_0x676d('0x2'));var ami=require(_0x676d('0x3'));var logger=require(_0x676d('0x4'))(_0x676d('0x5'));var RpcUser=require(_0x676d('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3d63c4){this[_0x676d('0x7')]=_0x3d63c4['voiceQueues'];this[_0x676d('0x8')]=_0x3d63c4[_0x676d('0x8')];this[_0x676d('0x9')]=_0x3d63c4[_0x676d('0x9')];this[_0x676d('0xa')]={};ami['on'](_0x676d('0xb'),this[_0x676d('0xc')]['bind'](this));ami['on'](_0x676d('0xd'),this[_0x676d('0xe')]['bind'](this));ami['on'](_0x676d('0xf'),this['syncHangup'][_0x676d('0x10')](this));ami['on'](_0x676d('0x11'),this[_0x676d('0x12')]['bind'](this));ami['on'](_0x676d('0x13'),this[_0x676d('0x14')][_0x676d('0x10')](this));ami['on']('blindtransfer',this[_0x676d('0x15')][_0x676d('0x10')](this));ami['on'](_0x676d('0x16'),this[_0x676d('0x17')]['bind'](this));}function getDiff(_0x240a89){var _0x44c36b=moment()[_0x676d('0x18')](0x0);var _0x416718=moment(_0x240a89)[_0x676d('0x18')](0x0);return _0x44c36b[_0x676d('0x19')](_0x416718,_0x676d('0x1a'));}Acw[_0x676d('0x1b')][_0x676d('0x1c')]=function(_0x149cc3){try{var _0x2665e1=this;var _0x3e254b=this[_0x676d('0xa')][_0x149cc3][_0x676d('0x1d')];var _0x41453f=this[_0x676d('0xa')][_0x149cc3][_0x676d('0x1e')];var _0xc73d47=this[_0x676d('0x7')][_0x41453f];var _0xdceae8=![];var _0x3d8d27='ACW';if(_0xc73d47[_0x676d('0x1f')]){if(_0xc73d47[_0x676d('0x20')][_0x676d('0x21')]){_0xdceae8=!![];_0x3d8d27=_0xc73d47['mandatoryDispositionPause'][_0x676d('0x21')];}}ami[_0x676d('0x22')]({'action':'QueuePause','interface':_0x3e254b,'paused':!![],'reason':_0x3d8d27})[_0x676d('0x23')](function(_0x135216){if(_0x2665e1[_0x676d('0x8')][_0x3e254b]){return RpcUser[_0x676d('0x24')](_0x2665e1[_0x676d('0x8')][_0x3e254b]['id'])[_0x676d('0x23')](function(_0x41e6c2){if(_0x41e6c2&&!_0x41e6c2[_0x676d('0x25')]){logger[_0x676d('0x26')](_0x676d('0x27'),_0x149cc3,_0x3e254b,_0x41453f);var _0x1aff94=_0x2665e1[_0x676d('0xa')][_0x149cc3]['attended']&&_0x2665e1[_0x676d('0xa')][_0x149cc3][_0x676d('0x28')]?_0x2665e1[_0x676d('0xa')][_0x149cc3]['destlinkedid']:_0x149cc3;return RpcUser[_0x676d('0x29')](_0x2665e1['agents'][_0x3e254b],_0x3d8d27,_0x1aff94)[_0x676d('0x23')](function(_0x2d40b7){if(!_0xdceae8){_0x2665e1[_0x676d('0x9')][_0x3e254b]={};logger[_0x676d('0x26')](_0x676d('0x2a'),_0x149cc3,_0x2665e1['voiceQueues'][_0x41453f][_0x676d('0x2b')],_0x3e254b,_0x41453f);_0x2665e1['timers'][_0x3e254b][_0x676d('0x2c')]=setTimeout(_0x2665e1[_0x676d('0x2d')][_0x676d('0x10')](_0x2665e1,_0x3e254b),_0x2665e1[_0x676d('0x7')][_0x41453f][_0x676d('0x2b')]*0x3e8);_0x2665e1[_0x676d('0x9')][_0x3e254b][_0x676d('0x2e')]=moment()[_0x676d('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2665e1['timers'][_0x3e254b][_0x676d('0x30')]=_0x149cc3;_0x2665e1['timers'][_0x3e254b][_0x676d('0x1e')]=_0x41453f;_0x2665e1[_0x676d('0x9')][_0x3e254b][_0x676d('0x31')]=function(){var _0x251893=getDiff(_0x2665e1[_0x676d('0x9')][_0x3e254b]['lastPauseAt']);clearTimeout(_0x2665e1[_0x676d('0x9')][_0x3e254b][_0x676d('0x2c')]);_0x2665e1[_0x676d('0x9')][_0x3e254b][_0x676d('0x2c')]=![];RpcVoiceAgentReport[_0x676d('0x32')]({'acwtime':_0x251893},_0x2665e1[_0x676d('0x9')][_0x3e254b][_0x676d('0x30')],_0x3e254b)[_0x676d('0x23')](function(_0x1592d8){logger[_0x676d('0x26')](_0x676d('0x33'),_0x149cc3,_0x251893,_0x1592d8);})['catch'](function(_0xc745ca){logger['error'](_0x676d('0x34'),_0x149cc3,_0xc745ca);});delete _0x2665e1[_0x676d('0x9')][_0x3e254b];};}});}else{logger[_0x676d('0x26')](_0x676d('0x35'),_0x149cc3,_0x3e254b,_0x41453f);}});}})['catch'](function(_0x219348){logger[_0x676d('0x36')](_0x676d('0x2a'),_0x149cc3,_0x2665e1['voiceQueues'][_0x41453f][_0x676d('0x2b')],_0x3e254b,_0x41453f);})['finally'](function(){delete _0x2665e1['channels'][_0x149cc3];});}catch(_0x5390c6){logger[_0x676d('0x36')](_0x676d('0x37'),_0x5390c6['message']);}};Acw[_0x676d('0x1b')][_0x676d('0x2d')]=function(_0x6ad9a9){try{var _0x437af8=this;if(_0x437af8[_0x676d('0x9')][_0x6ad9a9]){_0x437af8[_0x676d('0x9')][_0x6ad9a9][_0x676d('0x2c')]=![];var _0x1da236=_0x437af8[_0x676d('0x9')][_0x6ad9a9]['uniqueid'];var _0x4a70a5=_0x437af8[_0x676d('0x9')][_0x6ad9a9][_0x676d('0x1e')];var _0x29515c=_0x437af8['voiceQueues'][_0x4a70a5]['acwTimeout'];logger[_0x676d('0x26')](_0x676d('0x38'),_0x1da236,_0x6ad9a9);RpcUser['saveUnpause'](this['agents'][_0x6ad9a9]);RpcVoiceAgentReport[_0x676d('0x32')]({'acwtime':_0x29515c,'agentacw':!![]},_0x1da236,_0x6ad9a9)[_0x676d('0x23')](function(_0x43b76b){logger[_0x676d('0x26')](_0x676d('0x33'),_0x1da236,_0x29515c,_0x43b76b);})[_0x676d('0x39')](function(_0x2baaee){logger[_0x676d('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x1da236,_0x2baaee);});}else{logger['error'](_0x676d('0x3a'),_0x6ad9a9);if(_0x437af8[_0x676d('0x9')]){logger[_0x676d('0x26')](_0x676d('0x3b'),JSON[_0x676d('0x3c')](_0x437af8[_0x676d('0x9')]));}}}catch(_0x583baa){logger[_0x676d('0x36')](_0x676d('0x3d'),_0x583baa[_0x676d('0x3e')]);}};Acw[_0x676d('0x1b')][_0x676d('0xc')]=function(_0x1d2318){try{if(this[_0x676d('0x7')][_0x1d2318[_0x676d('0x1e')]]&&(this[_0x676d('0x7')][_0x1d2318[_0x676d('0x1e')]][_0x676d('0x5')]||this[_0x676d('0x7')][_0x1d2318[_0x676d('0x1e')]][_0x676d('0x1f')])){if(this[_0x676d('0x8')][_0x1d2318[_0x676d('0x1d')]]){this[_0x676d('0xa')][_0x1d2318[_0x676d('0x30')]]={'queue':_0x1d2318[_0x676d('0x1e')],'interface':_0x1d2318[_0x676d('0x1d')],'destlinkedid':_0x1d2318['destlinkedid']};}}}catch(_0x1e7792){logger[_0x676d('0x36')](_0x676d('0x3f'),_0x1e7792[_0x676d('0x3e')]);}};Acw[_0x676d('0x1b')]['syncAgentConnectPreview']=function(_0x550e74){try{if(this['voiceQueues'][_0x550e74[_0x676d('0x1e')]]&&(this[_0x676d('0x7')][_0x550e74[_0x676d('0x1e')]][_0x676d('0x5')]||this['voiceQueues'][_0x550e74[_0x676d('0x1e')]][_0x676d('0x1f')])){if(this['agents'][_0x550e74[_0x676d('0x1d')]]){this['channels'][_0x550e74[_0x676d('0x30')]]={'queue':_0x550e74['queue'],'interface':_0x550e74[_0x676d('0x1d')]};}}}catch(_0x531fc9){logger[_0x676d('0x36')](_0x676d('0x40'),_0x531fc9[_0x676d('0x3e')]);}};Acw[_0x676d('0x1b')][_0x676d('0xe')]=function(_0x1aa10a){try{if(this[_0x676d('0xa')][_0x1aa10a['uniqueid']]&&_[_0x676d('0x41')](this['channels'][_0x1aa10a[_0x676d('0x30')]][_0x676d('0x42')])){logger[_0x676d('0x26')]('[%s][HANGUP:UNIQUEID]',_0x1aa10a[_0x676d('0x30')]);this[_0x676d('0x1c')](_0x1aa10a[_0x676d('0x30')]);}else if(this[_0x676d('0xa')][_0x1aa10a[_0x676d('0x43')]]&&_[_0x676d('0x41')](this[_0x676d('0xa')][_0x1aa10a[_0x676d('0x43')]][_0x676d('0x42')])){logger[_0x676d('0x26')](_0x676d('0x44'),_0x1aa10a[_0x676d('0x43')]);this[_0x676d('0x1c')](_0x1aa10a[_0x676d('0x43')]);}}catch(_0x335721){logger[_0x676d('0x36')]('[ACW][syncHangupRequest]\x20%s',_0x335721['message']);}};Acw[_0x676d('0x1b')][_0x676d('0x45')]=function(_0x47879b){try{if(this[_0x676d('0xa')][_0x47879b[_0x676d('0x30')]]&&this['channels'][_0x47879b[_0x676d('0x30')]][_0x676d('0x42')]){logger[_0x676d('0x26')](_0x676d('0x46'),_0x47879b[_0x676d('0x30')]);this[_0x676d('0x1c')](_0x47879b[_0x676d('0x30')]);}else if(this[_0x676d('0xa')][_0x47879b[_0x676d('0x43')]]&&this['channels'][_0x47879b[_0x676d('0x43')]]['attended']){logger[_0x676d('0x26')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x47879b['linkedid']);this[_0x676d('0x1c')](_0x47879b['linkedid']);}}catch(_0x1bf6f0){logger['error'](_0x676d('0x47'),_0x1bf6f0[_0x676d('0x3e')]);}};Acw[_0x676d('0x1b')][_0x676d('0x14')]=function(_0x3b9cfb){try{if(!_[_0x676d('0x48')](this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x49')]])){this[_0x676d('0x1c')](_0x3b9cfb[_0x676d('0x49')]);if(this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4a')]]){this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4a')]][_0x676d('0x42')]=!![];this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4b')]]=this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4a')]];delete this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4a')]];}}else if(!_['isNil'](this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4b')]])){this['startAcw'](_0x3b9cfb['transfertargetuniqueid']);if(this['channels'][_0x3b9cfb['origtransfereruniqueid']]){this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4c')]][_0x676d('0x42')]=!![];this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x49')]]=this[_0x676d('0xa')][_0x3b9cfb['origtransfereruniqueid']];delete this[_0x676d('0xa')][_0x3b9cfb[_0x676d('0x4c')]];}}}catch(_0x2cf73e){logger[_0x676d('0x36')](_0x676d('0x4d'),_0x2cf73e[_0x676d('0x3e')]);}};Acw[_0x676d('0x1b')][_0x676d('0x15')]=function(_0x25aef9){try{if(this[_0x676d('0xa')][_0x25aef9[_0x676d('0x4e')]]){logger[_0x676d('0x26')](_0x676d('0x4f'),JSON['stringify'](_0x25aef9[_0x676d('0x4e')]));this['startAcw'](_0x25aef9[_0x676d('0x4e')]);}else if(this[_0x676d('0xa')][_0x25aef9[_0x676d('0x50')]]){logger['info'](_0x676d('0x51'),JSON['stringify'](_0x25aef9[_0x676d('0x50')]));this[_0x676d('0x1c')](_0x25aef9[_0x676d('0x50')]);}}catch(_0x4a622a){logger[_0x676d('0x36')](_0x676d('0x52'),_0x4a622a[_0x676d('0x3e')]);}};Acw['prototype'][_0x676d('0x12')]=function(_0x7fa04b){try{if(this[_0x676d('0x7')][_0x7fa04b[_0x676d('0x1e')]]&&this[_0x676d('0x7')][_0x7fa04b['queue']][_0x676d('0x53')]===_0x676d('0x54')){if(this[_0x676d('0x8')][_0x7fa04b[_0x676d('0x1d')]]){logger['info'](_0x676d('0x55'),_0x7fa04b[_0x676d('0x30')],_0x7fa04b['interface'],_0x7fa04b[_0x676d('0x1e')]);return RpcUser[_0x676d('0x29')](this[_0x676d('0x8')][_0x7fa04b[_0x676d('0x1d')]],_0x676d('0x56'),_0x7fa04b[_0x676d('0x30')]);}}}catch(_0x25dd13){logger[_0x676d('0x36')](_0x676d('0x57'),_0x25dd13[_0x676d('0x3e')]);}};module[_0x676d('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8a6a382..708e3d0 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 _0x36d7=['promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','catch','log','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','../../config/environment','asterisk','port','keepConnected','Action'];(function(_0x1ea041,_0x34e3b6){var _0x4d1d88=function(_0x5bbbe2){while(--_0x5bbbe2){_0x1ea041['push'](_0x1ea041['shift']());}};_0x4d1d88(++_0x34e3b6);}(_0x36d7,0x6e));var _0x736d=function(_0x3d7844,_0x5b48bb){_0x3d7844=_0x3d7844-0x0;var _0x323e11=_0x36d7[_0x3d7844];return _0x323e11;};'use strict';var Manager=require(_0x736d('0x0'));var BPromise=require(_0x736d('0x1'));var moment=require(_0x736d('0x2'));var util=require('util');var _=require(_0x736d('0x3'));var logger=require(_0x736d('0x4'))('ami');var config=require(_0x736d('0x5'));var ami=new Manager(config[_0x736d('0x6')][_0x736d('0x7')],config[_0x736d('0x6')]['ip'],config[_0x736d('0x6')]['username'],config[_0x736d('0x6')]['password'],!![]);ami[_0x736d('0x8')]();ami[_0x736d('0x9')]=BPromise[_0x736d('0xa')](ami[_0x736d('0xb')]);function error(_0xae832d){logger[_0x736d('0xc')](util[_0x736d('0xd')](_0x736d('0xe'),config['asterisk'][_0x736d('0xf')],config[_0x736d('0x6')]['ip'],config[_0x736d('0x6')][_0x736d('0x7')],util[_0x736d('0x10')](_0xae832d,![],null)));}function close(){logger['error'](util['format'](_0x736d('0x11'),config[_0x736d('0x6')]['username'],config['asterisk']['ip'],config['asterisk'][_0x736d('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x736d('0x9')]({'action':_0x736d('0x12')});};};ami[_0x736d('0x13')]=function(){return function(){return ami[_0x736d('0x9')]({'action':_0x736d('0x14')});};};ami[_0x736d('0x15')]=function(){return function(){return ami[_0x736d('0x9')]({'action':'sippeerstatus'});};};ami[_0x736d('0x16')]=function(){return function(){return ami[_0x736d('0x9')]({'action':_0x736d('0x17')});};};ami[_0x736d('0x18')]=function(){return function(){return ami[_0x736d('0x9')]({'action':_0x736d('0x19')});};};function connect(_0x293f1b){logger[_0x736d('0x1a')](util['format'](_0x736d('0x1b'),config[_0x736d('0x6')][_0x736d('0xf')],config[_0x736d('0x6')]['ip'],config[_0x736d('0x6')][_0x736d('0x7')]));ami[_0x736d('0x1c')](_0x736d('0xc'),error);ami['once'](_0x736d('0x1d'),close);}ami['on'](_0x736d('0x1e'),connect);ami['on']('shutdown',function(_0xa97cae){logger[_0x736d('0x1a')](util[_0x736d('0xd')](_0x736d('0x1f'),config['asterisk'][_0x736d('0xf')],config[_0x736d('0x6')]['ip'],config[_0x736d('0x6')]['port'],util[_0x736d('0x10')](_0xa97cae,![],null)));});ami['on'](_0x736d('0x20'),function(_0xee9a0a){logger[_0x736d('0x1a')](util[_0x736d('0xd')](_0x736d('0x21'),config[_0x736d('0x6')][_0x736d('0xf')],config[_0x736d('0x6')]['ip'],config[_0x736d('0x6')][_0x736d('0x7')]));return BPromise[_0x736d('0x22')]()[_0x736d('0x23')](ami[_0x736d('0x24')]())[_0x736d('0x23')](ami['actionDeviceStateList']())['then'](ami[_0x736d('0x15')]())['then'](ami[_0x736d('0x16')]())[_0x736d('0x23')](ami[_0x736d('0x18')]())[_0x736d('0x25')](function(_0x56cc94){console[_0x736d('0x26')](_0x56cc94);});});ami[_0x736d('0x1c')](_0x736d('0xc'),error);ami[_0x736d('0x1c')](_0x736d('0x1d'),close);module[_0x736d('0x27')]=ami; \ No newline at end of file +var _0xba5a=['close','exports','asterisk-manager','moment','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch'];(function(_0xcbe01c,_0x1eb71c){var _0x37e883=function(_0x452a51){while(--_0x452a51){_0xcbe01c['push'](_0xcbe01c['shift']());}};_0x37e883(++_0x1eb71c);}(_0xba5a,0x1d6));var _0xaba5=function(_0xd98ca3,_0x38fbd9){_0xd98ca3=_0xd98ca3-0x0;var _0x35960d=_0xba5a[_0xd98ca3];return _0x35960d;};'use strict';var Manager=require(_0xaba5('0x0'));var BPromise=require('bluebird');var moment=require(_0xaba5('0x1'));var util=require('util');var _=require('lodash');var logger=require(_0xaba5('0x2'))(_0xaba5('0x3'));var config=require(_0xaba5('0x4'));var ami=new Manager(config[_0xaba5('0x5')][_0xaba5('0x6')],config[_0xaba5('0x5')]['ip'],config[_0xaba5('0x5')]['username'],config[_0xaba5('0x5')][_0xaba5('0x7')],!![]);ami[_0xaba5('0x8')]();ami['Action']=BPromise[_0xaba5('0x9')](ami[_0xaba5('0xa')]);function error(_0x595d2d){logger[_0xaba5('0xb')](util[_0xaba5('0xc')](_0xaba5('0xd'),config[_0xaba5('0x5')][_0xaba5('0xe')],config[_0xaba5('0x5')]['ip'],config[_0xaba5('0x5')][_0xaba5('0x6')],util[_0xaba5('0xf')](_0x595d2d,![],null)));}function close(){logger[_0xaba5('0xb')](util[_0xaba5('0xc')](_0xaba5('0x10'),config[_0xaba5('0x5')]['username'],config['asterisk']['ip'],config['asterisk'][_0xaba5('0x6')]));}ami[_0xaba5('0x11')]=function(){return function(){return ami[_0xaba5('0x12')]({'action':_0xaba5('0x13')});};};ami[_0xaba5('0x14')]=function(){return function(){return ami['Action']({'action':_0xaba5('0x15')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xaba5('0x12')]({'action':_0xaba5('0x16')});};};ami[_0xaba5('0x17')]=function(){return function(){return ami[_0xaba5('0x12')]({'action':_0xaba5('0x18')});};};ami[_0xaba5('0x19')]=function(){return function(){return ami[_0xaba5('0x12')]({'action':'coreshowchannels'});};};function connect(_0x7b8ffb){logger[_0xaba5('0x1a')](util[_0xaba5('0xc')](_0xaba5('0x1b'),config['asterisk']['username'],config[_0xaba5('0x5')]['ip'],config[_0xaba5('0x5')]['port']));ami[_0xaba5('0x1c')]('error',error);ami[_0xaba5('0x1c')]('close',close);}ami['on'](_0xaba5('0x1d'),connect);ami['on'](_0xaba5('0x1e'),function(_0x5b0579){logger[_0xaba5('0x1a')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0xaba5('0x5')]['ip'],config[_0xaba5('0x5')][_0xaba5('0x6')],util[_0xaba5('0xf')](_0x5b0579,![],null)));});ami['on'](_0xaba5('0x1f'),function(_0x119921){logger[_0xaba5('0x1a')](util['format'](_0xaba5('0x20'),config['asterisk'][_0xaba5('0xe')],config['asterisk']['ip'],config[_0xaba5('0x5')][_0xaba5('0x6')]));return BPromise[_0xaba5('0x21')]()[_0xaba5('0x22')](ami['actionSipShowRegistry']())['then'](ami[_0xaba5('0x14')]())[_0xaba5('0x22')](ami[_0xaba5('0x23')]())[_0xaba5('0x22')](ami['actionQueueSummary']())['then'](ami[_0xaba5('0x19')]())[_0xaba5('0x24')](function(_0x17b686){console['log'](_0x17b686);});});ami['once'](_0xaba5('0xb'),error);ami[_0xaba5('0x1c')](_0xaba5('0x25'),close);module[_0xaba5('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index e50a6aa..da13b2a 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0xe706,0xa3));var _0x6e70=function(_0xd3fb91,_0xfc54c0){_0xd3fb91=_0xd3fb91-0x0;var _0x33438c=_0xe706[_0xd3fb91];return _0x33438c;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xe706,0xa3));var _0x6e70=function(_0x467ef6,_0x932cef){_0x467ef6=_0x467ef6-0x0;var _0x3e4aa2=_0xe706[_0x467ef6];return _0x3e4aa2;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index bade25a..7404a9c 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 _0x6203=['queue','exports','util','lodash','moment','isNil','string','uniqueid','name','phone','Contact','lastName','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','substring'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0x6203,0xb6));var _0x3620=function(_0xac0780,_0x5954df){_0xac0780=_0xac0780-0x0;var _0x139f93=_0x6203[_0xac0780];return _0x139f93;};'use strict';var util=require(_0x3620('0x0'));var _=require(_0x3620('0x1'));var moment=require(_0x3620('0x2'));function checkNameSurname(_0x120be8,_0x3cc9ff,_0x341c90){var _0x4df4fd='';if(!_[_0x3620('0x3')](_0x3cc9ff)&&'string'===typeof _0x3cc9ff){_0x4df4fd+=_0x3cc9ff;}if(!_['isNil'](_0x341c90)&&_0x3620('0x4')===typeof _0x341c90){_0x4df4fd+='\x20'+_0x341c90;}if(_0x4df4fd!==''){return _0x4df4fd;}return _0x120be8;}function Action(_0x61795c,_0x3dbb82,_0x3036a5){this['voiceQueue']=_0x61795c;this[_0x3620('0x5')]=_0x3036a5||undefined;this[_0x3620('0x6')]=checkNameSurname(_0x3dbb82['Contact'][_0x3620('0x7')],_0x3dbb82[_0x3620('0x8')]['firstName'],_0x3dbb82[_0x3620('0x8')][_0x3620('0x9')]);this['number']=_0x3dbb82[_0x3620('0x8')][_0x3620('0x7')];this['queue']=_0x61795c[_0x3620('0x6')];this[_0x3620('0xa')]=_0x3dbb82['active']||![];this[_0x3620('0xb')]=_0x61795c['type'];this['dialQueueTimeout']=_0x61795c['dialQueueTimeout']||0x3;this[_0x3620('0xc')]=_0x3dbb82['scheduledat'];this[_0x3620('0xd')]=_0x3dbb82['countbusyretry'];this[_0x3620('0xe')]=_0x3dbb82[_0x3620('0xe')];this[_0x3620('0xf')]=_0x3dbb82['countnoanswerretry'];this[_0x3620('0x10')]=_0x3dbb82['countnosuchnumberretry'];this[_0x3620('0x11')]=_0x3dbb82[_0x3620('0x11')];this[_0x3620('0x12')]=_0x3dbb82[_0x3620('0x12')];this[_0x3620('0x13')]=_0x3dbb82[_0x3620('0x13')];this[_0x3620('0x14')]=_0x3dbb82[_0x3620('0x14')];this['ContactId']=_0x3dbb82[_0x3620('0x15')];this[_0x3620('0x16')]=_0x3dbb82[_0x3620('0x16')];this[_0x3620('0x17')]=_0x3dbb82['UserId'];this[_0x3620('0x18')]=_0x3dbb82[_0x3620('0x18')];this[_0x3620('0x19')]=_0x3dbb82[_0x3620('0x19')];this[_0x3620('0x1a')]=_0x3dbb82['id'];this[_0x3620('0x1b')]=_0x3dbb82[_0x3620('0x8')][_0x3620('0x1c')]||'';this[_0x3620('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3620('0x1e')]=_0x3dbb82[_0x3620('0x1e')];this[_0x3620('0x1f')]=_0x3dbb82[_0x3620('0x1f')];this['callbackat']=_0x3dbb82[_0x3620('0x20')];this[_0x3620('0x21')]=_0x3dbb82['recallme'];this['originatecalleridnum']='';this[_0x3620('0x22')]='';}Action[_0x3620('0x23')][_0x3620('0x24')]=function(){return util[_0x3620('0x25')](_0x3620('0x26'),this[_0x3620('0x6')],this[_0x3620('0x27')][_0x3620('0x28')]>0x0?this[_0x3620('0x29')][_0x3620('0x2a')](this[_0x3620('0x27')]['dialCutDigit']):this[_0x3620('0x29')]);};Action[_0x3620('0x23')]['getQueue']=function(){return this[_0x3620('0x2b')];};module[_0x3620('0x2c')]=Action; \ No newline at end of file +var _0xa084=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','phone','Contact','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','format'];(function(_0x26de3c,_0x20019f){var _0x4407e6=function(_0x3fbed1){while(--_0x3fbed1){_0x26de3c['push'](_0x26de3c['shift']());}};_0x4407e6(++_0x20019f);}(_0xa084,0x1c5));var _0x4a08=function(_0x598ac5,_0x11aa0e){_0x598ac5=_0x598ac5-0x0;var _0x317e7f=_0xa084[_0x598ac5];return _0x317e7f;};'use strict';var util=require(_0x4a08('0x0'));var _=require(_0x4a08('0x1'));var moment=require(_0x4a08('0x2'));function checkNameSurname(_0x18f8a3,_0x4fbaef,_0x2a0ec9){var _0x3dc3f6='';if(!_[_0x4a08('0x3')](_0x4fbaef)&&_0x4a08('0x4')===typeof _0x4fbaef){_0x3dc3f6+=_0x4fbaef;}if(!_[_0x4a08('0x3')](_0x2a0ec9)&&_0x4a08('0x4')===typeof _0x2a0ec9){_0x3dc3f6+='\x20'+_0x2a0ec9;}if(_0x3dc3f6!==''){return _0x3dc3f6;}return _0x18f8a3;}function Action(_0x38745c,_0x2e0772,_0x5ed4a9){this[_0x4a08('0x5')]=_0x38745c;this[_0x4a08('0x6')]=_0x5ed4a9||undefined;this['name']=checkNameSurname(_0x2e0772['Contact'][_0x4a08('0x7')],_0x2e0772['Contact']['firstName'],_0x2e0772[_0x4a08('0x8')][_0x4a08('0x9')]);this['number']=_0x2e0772[_0x4a08('0x8')][_0x4a08('0x7')];this[_0x4a08('0xa')]=_0x38745c[_0x4a08('0xb')];this[_0x4a08('0xc')]=_0x2e0772['active']||![];this[_0x4a08('0xd')]=_0x38745c[_0x4a08('0xd')];this[_0x4a08('0xe')]=_0x38745c[_0x4a08('0xe')]||0x3;this[_0x4a08('0xf')]=_0x2e0772['scheduledat'];this['countbusyretry']=_0x2e0772[_0x4a08('0x10')];this[_0x4a08('0x11')]=_0x2e0772[_0x4a08('0x11')];this[_0x4a08('0x12')]=_0x2e0772[_0x4a08('0x12')];this[_0x4a08('0x13')]=_0x2e0772[_0x4a08('0x13')];this[_0x4a08('0x14')]=_0x2e0772['countdropretry'];this[_0x4a08('0x15')]=_0x2e0772[_0x4a08('0x15')];this[_0x4a08('0x16')]=_0x2e0772[_0x4a08('0x16')];this['countagentrejectretry']=_0x2e0772[_0x4a08('0x17')];this['ContactId']=_0x2e0772[_0x4a08('0x18')];this['ListId']=_0x2e0772['ListId'];this[_0x4a08('0x19')]=_0x2e0772[_0x4a08('0x19')];this[_0x4a08('0x1a')]=_0x2e0772[_0x4a08('0x1a')];this[_0x4a08('0x1b')]=_0x2e0772[_0x4a08('0x1b')];this[_0x4a08('0x1c')]=_0x2e0772['id'];this['ContactFirstName']=_0x2e0772[_0x4a08('0x8')][_0x4a08('0x1d')]||'';this['starttime']=moment()[_0x4a08('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4a08('0x1f')]=_0x2e0772[_0x4a08('0x1f')];this[_0x4a08('0x20')]=_0x2e0772['callbackuniqueid'];this[_0x4a08('0x21')]=_0x2e0772['callbackat'];this[_0x4a08('0x22')]=_0x2e0772[_0x4a08('0x22')];this[_0x4a08('0x23')]='';this[_0x4a08('0x24')]='';}Action[_0x4a08('0x25')][_0x4a08('0x26')]=function(){return util['format'](_0x4a08('0x27'),this[_0x4a08('0xb')],this[_0x4a08('0x5')][_0x4a08('0x28')]>0x0?this[_0x4a08('0x29')][_0x4a08('0x2a')](this[_0x4a08('0x5')][_0x4a08('0x28')]):this['number']);};Action[_0x4a08('0x25')][_0x4a08('0x2b')]=function(){return this[_0x4a08('0xa')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 776d515..487fa4c 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 _0xb018=['statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','ringtime','holdtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state'];(function(_0x1f9e64,_0x3c1cc9){var _0x4f9c20=function(_0x5aa82a){while(--_0x5aa82a){_0x1f9e64['push'](_0x1f9e64['shift']());}};_0x4f9c20(++_0x3c1cc9);}(_0xb018,0x162));var _0x8b01=function(_0x135800,_0x2a202a){_0x135800=_0x135800-0x0;var _0xae5248=_0xb018[_0x135800];return _0xae5248;};'use strict';var util=require(_0x8b01('0x0'));var _=require('lodash');var moment=require(_0x8b01('0x1'));function getSeconds(_0x234218,_0x4d55ad){var _0x1c25f6=moment(_0x234218)[_0x8b01('0x2')](0x0);var _0x134e38=moment(_0x4d55ad)[_0x8b01('0x2')](0x0);return _0x1c25f6[_0x8b01('0x3')](_0x134e38,_0x8b01('0x4'));}function AgentComplete(_0x5cc366,_0x4c7f9a){this[_0x8b01('0x5')]=0x4;this[_0x8b01('0x6')]=_0x8b01('0x7');this['scheduledat']=_0x5cc366[_0x8b01('0x8')];this[_0x8b01('0x9')]=_0x5cc366[_0x8b01('0x9')];this[_0x8b01('0xa')]=_0x5cc366[_0x8b01('0x9')]==='outbound'?'queue':_0x5cc366[_0x8b01('0x9')];this[_0x8b01('0xb')]=_0x5cc366[_0x8b01('0xb')];this[_0x8b01('0xc')]=_0x5cc366[_0x8b01('0xc')];this[_0x8b01('0xd')]=_0x5cc366[_0x8b01('0xd')];this[_0x8b01('0xe')]=_0x5cc366['countbusyretry']+_0x5cc366[_0x8b01('0xc')]+_0x5cc366[_0x8b01('0xd')]+_0x5cc366[_0x8b01('0xf')]+_0x5cc366[_0x8b01('0x10')]+_0x5cc366[_0x8b01('0x11')]+_0x5cc366['countmachineretry']+_0x5cc366['countagentrejectretry'];this[_0x8b01('0xf')]=_0x5cc366[_0x8b01('0xf')];this[_0x8b01('0x10')]=_0x5cc366['countdropretry'];this[_0x8b01('0x11')]=_0x5cc366['countabandonedretry'];this[_0x8b01('0x12')]=_0x5cc366[_0x8b01('0x12')];this['countagentrejectretry']=_0x5cc366['countagentrejectretry'];this[_0x8b01('0x13')]=_0x4c7f9a[_0x8b01('0x13')];this[_0x8b01('0x14')]=_0x5cc366[_0x8b01('0x15')];this[_0x8b01('0x16')]=_0x5cc366[_0x8b01('0x17')];this[_0x8b01('0x18')]=_0x5cc366[_0x8b01('0x18')];this['responsetime']=_0x5cc366[_0x8b01('0x19')];this[_0x8b01('0x1a')]=_0x5cc366[_0x8b01('0x1a')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8b01('0x1b')]=getSeconds(_0x5cc366[_0x8b01('0x19')],_0x5cc366[_0x8b01('0x18')]);this[_0x8b01('0x1c')]=getSeconds(_0x5cc366[_0x8b01('0x1a')],_0x5cc366[_0x8b01('0x19')]);this['talktime']=getSeconds(this[_0x8b01('0x1d')],_0x5cc366[_0x8b01('0x1a')]);this[_0x8b01('0x1e')]=_0x4c7f9a['queue'];this['membername']=_0x4c7f9a[_0x8b01('0x1f')];this[_0x8b01('0x20')]=_0x4c7f9a[_0x8b01('0x20')];this[_0x8b01('0x21')]=_0x5cc366[_0x8b01('0x21')];this['callbackuniqueid']=_0x5cc366[_0x8b01('0x22')];this[_0x8b01('0x23')]=_0x5cc366[_0x8b01('0x23')];this[_0x8b01('0x24')]=_0x5cc366[_0x8b01('0x24')];this[_0x8b01('0x25')]=_0x5cc366[_0x8b01('0x25')];this[_0x8b01('0x26')]=_0x5cc366[_0x8b01('0x26')];this[_0x8b01('0x27')]=_0x5cc366[_0x8b01('0x27')];this[_0x8b01('0x28')]=_0x5cc366[_0x8b01('0x28')];this[_0x8b01('0x29')]=_0x5cc366[_0x8b01('0x29')];this[_0x8b01('0x2a')]=_0x5cc366['originatecalleridnum']||'';this[_0x8b01('0x2b')]=_0x5cc366[_0x8b01('0x2b')]||'';}module[_0x8b01('0x2c')]=AgentComplete; \ No newline at end of file +var _0x51f8=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x3577ce,_0x55a5b2){var _0x5c8b4c=function(_0x107c1e){while(--_0x107c1e){_0x3577ce['push'](_0x3577ce['shift']());}};_0x5c8b4c(++_0x55a5b2);}(_0x51f8,0x1b4));var _0x851f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x51f8[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x851f('0x0'));var _=require(_0x851f('0x1'));var moment=require(_0x851f('0x2'));function getSeconds(_0x382bf1,_0x5d32e7){var _0x12772e=moment(_0x382bf1)[_0x851f('0x3')](0x0);var _0x29a9c7=moment(_0x5d32e7)[_0x851f('0x3')](0x0);return _0x12772e[_0x851f('0x4')](_0x29a9c7,'seconds');}function AgentComplete(_0x38f652,_0x7d2775){this[_0x851f('0x5')]=0x4;this[_0x851f('0x6')]=_0x851f('0x7');this[_0x851f('0x8')]=_0x38f652['scheduledat'];this[_0x851f('0x9')]=_0x38f652[_0x851f('0x9')];this['campaigntype']=_0x38f652[_0x851f('0x9')]===_0x851f('0xa')?_0x851f('0xb'):_0x38f652['type'];this[_0x851f('0xc')]=_0x38f652['countbusyretry'];this['countcongestionretry']=_0x38f652[_0x851f('0xd')];this[_0x851f('0xe')]=_0x38f652['countnoanswerretry'];this[_0x851f('0xf')]=_0x38f652['countbusyretry']+_0x38f652['countcongestionretry']+_0x38f652[_0x851f('0xe')]+_0x38f652[_0x851f('0x10')]+_0x38f652[_0x851f('0x11')]+_0x38f652[_0x851f('0x12')]+_0x38f652[_0x851f('0x13')]+_0x38f652[_0x851f('0x14')];this['countnosuchnumberretry']=_0x38f652[_0x851f('0x10')];this[_0x851f('0x11')]=_0x38f652[_0x851f('0x11')];this[_0x851f('0x12')]=_0x38f652[_0x851f('0x12')];this[_0x851f('0x13')]=_0x38f652['countmachineretry'];this[_0x851f('0x14')]=_0x38f652[_0x851f('0x14')];this[_0x851f('0x15')]=_0x7d2775[_0x851f('0x15')];this['calleridname']=_0x38f652[_0x851f('0x16')];this[_0x851f('0x17')]=_0x38f652['number'];this[_0x851f('0x18')]=_0x38f652['starttime'];this[_0x851f('0x19')]=_0x38f652['responsetime'];this[_0x851f('0x1a')]=_0x38f652[_0x851f('0x1a')];this['endtime']=moment()[_0x851f('0x1b')](_0x851f('0x1c'));this[_0x851f('0x1d')]=getSeconds(_0x38f652['responsetime'],_0x38f652[_0x851f('0x18')]);this[_0x851f('0x1e')]=getSeconds(_0x38f652[_0x851f('0x1a')],_0x38f652[_0x851f('0x19')]);this[_0x851f('0x1f')]=getSeconds(this[_0x851f('0x20')],_0x38f652['answertime']);this[_0x851f('0xb')]=_0x7d2775[_0x851f('0xb')];this['membername']=_0x7d2775[_0x851f('0x21')];this[_0x851f('0x22')]=_0x7d2775['reason'];this[_0x851f('0x23')]=_0x38f652[_0x851f('0x23')];this['callbackuniqueid']=_0x38f652['callbackuniqueid'];this[_0x851f('0x24')]=_0x38f652[_0x851f('0x24')];this[_0x851f('0x25')]=_0x38f652[_0x851f('0x25')];this[_0x851f('0x26')]=_0x38f652['ContactId'];this[_0x851f('0x27')]=_0x38f652[_0x851f('0x27')];this['UserId']=_0x38f652['UserId'];this['VoiceQueueId']=_0x38f652[_0x851f('0x28')];this['CampaignId']=_0x38f652[_0x851f('0x29')];this[_0x851f('0x2a')]=_0x38f652[_0x851f('0x2a')]||'';this[_0x851f('0x2b')]=_0x38f652[_0x851f('0x2b')]||'';}module[_0x851f('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 662ac83..2e38caa 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 _0x46ed=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry'];(function(_0x47bf08,_0x16afd9){var _0x2546a3=function(_0x531a07){while(--_0x531a07){_0x47bf08['push'](_0x47bf08['shift']());}};_0x2546a3(++_0x16afd9);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var util=require(_0xd46e('0x0'));var _=require(_0xd46e('0x1'));var moment=require('moment');function getSeconds(_0x392bc1,_0x1df30e){var _0x1f15e7=moment(_0x392bc1)['milliseconds'](0x0);var _0x2e6b84=moment(_0x1df30e)[_0xd46e('0x2')](0x0);return _0x1f15e7['diff'](_0x2e6b84,_0xd46e('0x3'));}function Final(_0x1926d9){this[_0xd46e('0x4')]=_0x1926d9[_0xd46e('0x4')];this[_0xd46e('0x5')]=_0x1926d9[_0xd46e('0x5')];this[_0xd46e('0x6')]=_0x1926d9[_0xd46e('0x6')];this[_0xd46e('0x7')]=_0x1926d9[_0xd46e('0x6')]===_0xd46e('0x8')?'queue':_0x1926d9[_0xd46e('0x6')];this[_0xd46e('0x9')]=_0x1926d9['countbusyretry'];this[_0xd46e('0xa')]=_0x1926d9[_0xd46e('0xa')];this[_0xd46e('0xb')]=_0x1926d9[_0xd46e('0xb')];this[_0xd46e('0xc')]=_0x1926d9[_0xd46e('0x9')]+_0x1926d9['countcongestionretry']+_0x1926d9[_0xd46e('0xb')]+_0x1926d9['countnosuchnumberretry']+_0x1926d9['countdropretry']+_0x1926d9[_0xd46e('0xd')]+_0x1926d9[_0xd46e('0xe')]+_0x1926d9['countagentrejectretry'];this['countnosuchnumberretry']=_0x1926d9[_0xd46e('0xf')];this[_0xd46e('0x10')]=_0x1926d9[_0xd46e('0x10')];this[_0xd46e('0xd')]=_0x1926d9['countabandonedretry'];this[_0xd46e('0xe')]=_0x1926d9[_0xd46e('0xe')];this[_0xd46e('0x11')]=_0x1926d9[_0xd46e('0x11')];this[_0xd46e('0x12')]=_0x1926d9['queue'];this[_0xd46e('0x13')]=_0x1926d9[_0xd46e('0x13')];this[_0xd46e('0x14')]=_0x1926d9['calleridnum'];this['starttime']=_0x1926d9[_0xd46e('0x15')];this[_0xd46e('0x16')]=_0x1926d9['responsetime'];this['endtime']=_0x1926d9[_0xd46e('0x16')];this[_0xd46e('0x17')]=_0x1926d9[_0xd46e('0x17')]||0x0;this[_0xd46e('0x18')]=_0x1926d9[_0xd46e('0x18')]||0x0;this[_0xd46e('0x19')]=_0x1926d9[_0xd46e('0x19')]||0x0;this[_0xd46e('0x1a')]=_0x1926d9[_0xd46e('0x1a')];this[_0xd46e('0x1b')]=_0x1926d9[_0xd46e('0x1b')];this['callbackat']=_0x1926d9[_0xd46e('0x1c')];this[_0xd46e('0x1d')]=_0x1926d9[_0xd46e('0x1d')];this[_0xd46e('0x1e')]=_0x1926d9[_0xd46e('0x1e')];this[_0xd46e('0x1f')]=_0x1926d9[_0xd46e('0x1f')];this[_0xd46e('0x20')]=_0x1926d9[_0xd46e('0x20')];this['VoiceQueueId']=_0x1926d9[_0xd46e('0x21')];this['CampaignId']=_0x1926d9['CampaignId'];this[_0xd46e('0x22')]=_0x1926d9[_0xd46e('0x22')]||'';this[_0xd46e('0x23')]=_0x1926d9[_0xd46e('0x23')]||'';}module[_0xd46e('0x24')]=Final; \ No newline at end of file +var _0x9009=['countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound'];(function(_0x2a877b,_0x3e1367){var _0x62de26=function(_0x4b5205){while(--_0x4b5205){_0x2a877b['push'](_0x2a877b['shift']());}};_0x62de26(++_0x3e1367);}(_0x9009,0x1d4));var _0x9900=function(_0x1b24b5,_0x770714){_0x1b24b5=_0x1b24b5-0x0;var _0xfb93b2=_0x9009[_0x1b24b5];return _0xfb93b2;};'use strict';var util=require(_0x9900('0x0'));var _=require('lodash');var moment=require(_0x9900('0x1'));function getSeconds(_0x2770ea,_0x5d0a60){var _0x12d637=moment(_0x2770ea)[_0x9900('0x2')](0x0);var _0x1f7ed9=moment(_0x5d0a60)[_0x9900('0x2')](0x0);return _0x12d637['diff'](_0x1f7ed9,_0x9900('0x3'));}function Final(_0x273e50){this['uniqueid']=_0x273e50['uniqueid'];this[_0x9900('0x4')]=_0x273e50[_0x9900('0x4')];this['type']=_0x273e50[_0x9900('0x5')];this[_0x9900('0x6')]=_0x273e50[_0x9900('0x5')]===_0x9900('0x7')?'queue':_0x273e50[_0x9900('0x5')];this[_0x9900('0x8')]=_0x273e50[_0x9900('0x8')];this[_0x9900('0x9')]=_0x273e50[_0x9900('0x9')];this['countnoanswerretry']=_0x273e50['countnoanswerretry'];this[_0x9900('0xa')]=_0x273e50[_0x9900('0x8')]+_0x273e50['countcongestionretry']+_0x273e50['countnoanswerretry']+_0x273e50[_0x9900('0xb')]+_0x273e50['countdropretry']+_0x273e50[_0x9900('0xc')]+_0x273e50[_0x9900('0xd')]+_0x273e50[_0x9900('0xe')];this[_0x9900('0xb')]=_0x273e50[_0x9900('0xb')];this[_0x9900('0xf')]=_0x273e50[_0x9900('0xf')];this[_0x9900('0xc')]=_0x273e50[_0x9900('0xc')];this[_0x9900('0xd')]=_0x273e50[_0x9900('0xd')];this[_0x9900('0xe')]=_0x273e50[_0x9900('0xe')];this[_0x9900('0x10')]=_0x273e50[_0x9900('0x10')];this[_0x9900('0x11')]=_0x273e50[_0x9900('0x11')];this['calleridnum']=_0x273e50['calleridnum'];this[_0x9900('0x12')]=_0x273e50[_0x9900('0x12')];this[_0x9900('0x13')]=_0x273e50[_0x9900('0x13')];this['endtime']=_0x273e50[_0x9900('0x13')];this['ringtime']=_0x273e50['ringtime']||0x0;this[_0x9900('0x14')]=_0x273e50['holdtime']||0x0;this[_0x9900('0x15')]=_0x273e50['talktime']||0x0;this['callback']=_0x273e50[_0x9900('0x16')];this[_0x9900('0x17')]=_0x273e50[_0x9900('0x17')];this[_0x9900('0x18')]=_0x273e50['callbackat'];this[_0x9900('0x19')]=_0x273e50[_0x9900('0x19')];this[_0x9900('0x1a')]=_0x273e50[_0x9900('0x1a')];this[_0x9900('0x1b')]=_0x273e50['ListId'];this[_0x9900('0x1c')]=_0x273e50[_0x9900('0x1c')];this['VoiceQueueId']=_0x273e50[_0x9900('0x1d')];this[_0x9900('0x1e')]=_0x273e50['CampaignId'];this['originatecalleridnum']=_0x273e50[_0x9900('0x1f')]||'';this[_0x9900('0x20')]=_0x273e50['originatecalleridname']||'';}module[_0x9900('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 5b9bad6..eb75bd2 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 _0xf03f=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','reason','cause-txt','callbackuniqueid'];(function(_0x3653f5,_0x225230){var _0x5cb1af=function(_0x220d07){while(--_0x220d07){_0x3653f5['push'](_0x3653f5['shift']());}};_0x5cb1af(++_0x225230);}(_0xf03f,0x157));var _0xff03=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xf03f[_0x15cdcb];return _0x37b069;};'use strict';var util=require(_0xff03('0x0'));var _=require(_0xff03('0x1'));var moment=require(_0xff03('0x2'));function getSeconds(_0x559924,_0x5f0cf2){var _0x30dcc2=moment(_0x559924)[_0xff03('0x3')](0x0);var _0x3321c2=moment(_0x5f0cf2)[_0xff03('0x3')](0x0);return _0x30dcc2[_0xff03('0x4')](_0x3321c2,_0xff03('0x5'));}function Hangup(_0x4896d6,_0x4ee847){this[_0xff03('0x6')]=0x4;this[_0xff03('0x7')]='Answer';this[_0xff03('0x8')]=_0x4896d6[_0xff03('0x8')];this[_0xff03('0x9')]=_0x4896d6[_0xff03('0x9')];this[_0xff03('0xa')]=_0x4896d6[_0xff03('0x9')]===_0xff03('0xb')?_0xff03('0xc'):_0x4896d6['type'];this[_0xff03('0xd')]=_0x4896d6['countbusyretry'];this['countcongestionretry']=_0x4896d6[_0xff03('0xe')];this['countnoanswerretry']=_0x4896d6[_0xff03('0xf')];this[_0xff03('0x10')]=_0x4896d6['countbusyretry']+_0x4896d6[_0xff03('0xe')]+_0x4896d6[_0xff03('0xf')]+_0x4896d6[_0xff03('0x11')]+_0x4896d6[_0xff03('0x12')]+_0x4896d6[_0xff03('0x13')]+_0x4896d6[_0xff03('0x14')]+_0x4896d6[_0xff03('0x15')];this[_0xff03('0x11')]=_0x4896d6['countnosuchnumberretry'];this[_0xff03('0x12')]=_0x4896d6[_0xff03('0x12')];this[_0xff03('0x13')]=_0x4896d6[_0xff03('0x13')];this[_0xff03('0x14')]=_0x4896d6['countmachineretry'];this[_0xff03('0x15')]=_0x4896d6[_0xff03('0x15')];this[_0xff03('0x16')]=_0x4ee847[_0xff03('0x16')];this[_0xff03('0x17')]=_0x4896d6[_0xff03('0x18')];this[_0xff03('0x19')]=_0x4896d6[_0xff03('0x1a')];this[_0xff03('0x1b')]=_0x4896d6[_0xff03('0x1b')];this[_0xff03('0x1c')]=_0x4896d6[_0xff03('0x1c')];this[_0xff03('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x4896d6[_0xff03('0x1c')],_0x4896d6['starttime']);this[_0xff03('0x1e')]=0x0;this[_0xff03('0x1f')]=getSeconds(this[_0xff03('0x1d')],_0x4896d6[_0xff03('0x1c')]);this[_0xff03('0xc')]=_0x4896d6[_0xff03('0xc')];this['membername']='IVR';this[_0xff03('0x20')]=_0x4ee847[_0xff03('0x21')];this['callback']=_0x4896d6['callback'];this[_0xff03('0x22')]=_0x4896d6[_0xff03('0x22')];this[_0xff03('0x23')]=_0x4896d6[_0xff03('0x23')];this[_0xff03('0x24')]=_0x4896d6[_0xff03('0x24')];this[_0xff03('0x25')]=_0x4896d6[_0xff03('0x25')];this[_0xff03('0x26')]=_0x4896d6[_0xff03('0x26')];this[_0xff03('0x27')]=_0x4896d6[_0xff03('0x27')];this[_0xff03('0x28')]=_0x4896d6[_0xff03('0x28')];this[_0xff03('0x29')]=_0x4896d6['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0x0b0f=['ringtime','responsetime','holdtime','talktime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','format'];(function(_0x16f8ef,_0x53fe58){var _0x4a0993=function(_0x52f260){while(--_0x52f260){_0x16f8ef['push'](_0x16f8ef['shift']());}};_0x4a0993(++_0x53fe58);}(_0x0b0f,0xee));var _0xf0b0=function(_0xfc06e,_0x2a9605){_0xfc06e=_0xfc06e-0x0;var _0x456eab=_0x0b0f[_0xfc06e];return _0x456eab;};'use strict';var util=require(_0xf0b0('0x0'));var _=require(_0xf0b0('0x1'));var moment=require('moment');function getSeconds(_0x121fd1,_0x354f10){var _0x1417c5=moment(_0x121fd1)[_0xf0b0('0x2')](0x0);var _0x145308=moment(_0x354f10)[_0xf0b0('0x2')](0x0);return _0x1417c5['diff'](_0x145308,_0xf0b0('0x3'));}function Hangup(_0x548b81,_0x3c3508){this[_0xf0b0('0x4')]=0x4;this[_0xf0b0('0x5')]=_0xf0b0('0x6');this[_0xf0b0('0x7')]=_0x548b81[_0xf0b0('0x7')];this[_0xf0b0('0x8')]=_0x548b81[_0xf0b0('0x8')];this['campaigntype']=_0x548b81['type']===_0xf0b0('0x9')?_0xf0b0('0xa'):_0x548b81[_0xf0b0('0x8')];this[_0xf0b0('0xb')]=_0x548b81[_0xf0b0('0xb')];this[_0xf0b0('0xc')]=_0x548b81[_0xf0b0('0xc')];this['countnoanswerretry']=_0x548b81[_0xf0b0('0xd')];this['countglobal']=_0x548b81[_0xf0b0('0xb')]+_0x548b81[_0xf0b0('0xc')]+_0x548b81['countnoanswerretry']+_0x548b81[_0xf0b0('0xe')]+_0x548b81[_0xf0b0('0xf')]+_0x548b81[_0xf0b0('0x10')]+_0x548b81[_0xf0b0('0x11')]+_0x548b81[_0xf0b0('0x12')];this[_0xf0b0('0xe')]=_0x548b81[_0xf0b0('0xe')];this[_0xf0b0('0xf')]=_0x548b81[_0xf0b0('0xf')];this[_0xf0b0('0x10')]=_0x548b81[_0xf0b0('0x10')];this[_0xf0b0('0x11')]=_0x548b81['countmachineretry'];this[_0xf0b0('0x12')]=_0x548b81[_0xf0b0('0x12')];this[_0xf0b0('0x13')]=_0x3c3508[_0xf0b0('0x13')];this[_0xf0b0('0x14')]=_0x548b81[_0xf0b0('0x15')];this[_0xf0b0('0x16')]=_0x548b81[_0xf0b0('0x17')];this[_0xf0b0('0x18')]=_0x548b81[_0xf0b0('0x18')];this['responsetime']=_0x548b81['responsetime'];this['endtime']=moment()[_0xf0b0('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf0b0('0x1a')]=getSeconds(_0x548b81[_0xf0b0('0x1b')],_0x548b81['starttime']);this[_0xf0b0('0x1c')]=0x0;this[_0xf0b0('0x1d')]=getSeconds(this[_0xf0b0('0x1e')],_0x548b81[_0xf0b0('0x1b')]);this[_0xf0b0('0xa')]=_0x548b81['queue'];this[_0xf0b0('0x1f')]=_0xf0b0('0x20');this[_0xf0b0('0x21')]=_0x3c3508['cause-txt'];this[_0xf0b0('0x22')]=_0x548b81[_0xf0b0('0x22')];this[_0xf0b0('0x23')]=_0x548b81['callbackuniqueid'];this[_0xf0b0('0x24')]=_0x548b81[_0xf0b0('0x24')];this['recallme']=_0x548b81[_0xf0b0('0x25')];this[_0xf0b0('0x26')]=_0x548b81['ContactId'];this[_0xf0b0('0x27')]=_0x548b81[_0xf0b0('0x27')];this[_0xf0b0('0x28')]=_0x548b81[_0xf0b0('0x28')];this['VoiceQueueId']=_0x548b81[_0xf0b0('0x29')];this['CampaignId']=_0x548b81[_0xf0b0('0x2a')];}module[_0xf0b0('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 1164c91..d5862c7 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 _0xac75=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid'];(function(_0x172e86,_0x3c6d8f){var _0x426c65=function(_0x359d18){while(--_0x359d18){_0x172e86['push'](_0x172e86['shift']());}};_0x426c65(++_0x3c6d8f);}(_0xac75,0x1cf));var _0x5ac7=function(_0x2b8243,_0x3ba874){_0x2b8243=_0x2b8243-0x0;var _0x5f28b4=_0xac75[_0x2b8243];return _0x5f28b4;};'use strict';var util=require(_0x5ac7('0x0'));var _=require(_0x5ac7('0x1'));var moment=require('moment');function getSeconds(_0x318178,_0x203f8e){var _0xff15d5=moment(_0x318178)[_0x5ac7('0x2')](0x0);var _0x2ccacb=moment(_0x203f8e)[_0x5ac7('0x2')](0x0);return _0xff15d5[_0x5ac7('0x3')](_0x2ccacb,'seconds');}function History(_0x4f32a5){this[_0x5ac7('0x4')]=_0x4f32a5['uniqueid'];this[_0x5ac7('0x5')]=_0x4f32a5[_0x5ac7('0x5')]||undefined;this[_0x5ac7('0x6')]=_0x4f32a5[_0x5ac7('0x6')];this[_0x5ac7('0x7')]=_0x4f32a5[_0x5ac7('0x6')]===_0x5ac7('0x8')?_0x5ac7('0x9'):_0x4f32a5[_0x5ac7('0x6')];this[_0x5ac7('0xa')]=_0x4f32a5[_0x5ac7('0xa')];this[_0x5ac7('0xb')]=_0x4f32a5[_0x5ac7('0xb')];this[_0x5ac7('0xc')]=_0x4f32a5[_0x5ac7('0xc')];this['countglobal']=_0x4f32a5[_0x5ac7('0xa')]+_0x4f32a5['countcongestionretry']+_0x4f32a5[_0x5ac7('0xc')]+_0x4f32a5['countnosuchnumberretry']+_0x4f32a5[_0x5ac7('0xd')]+_0x4f32a5[_0x5ac7('0xe')]+_0x4f32a5[_0x5ac7('0xf')]+_0x4f32a5['countagentrejectretry'];this[_0x5ac7('0x10')]=_0x4f32a5['countnosuchnumberretry'];this['countdropretry']=_0x4f32a5['countdropretry'];this['countabandonedretry']=_0x4f32a5['countabandonedretry'];this[_0x5ac7('0xf')]=_0x4f32a5[_0x5ac7('0xf')];this[_0x5ac7('0x11')]=_0x4f32a5[_0x5ac7('0x11')];this[_0x5ac7('0x9')]=_0x4f32a5['queue'];this['calleridname']=_0x4f32a5['name'];this[_0x5ac7('0x12')]=_0x4f32a5[_0x5ac7('0x13')];this[_0x5ac7('0x14')]=_0x4f32a5['starttime'];this[_0x5ac7('0x15')]=_0x4f32a5[_0x5ac7('0x15')];this[_0x5ac7('0x16')]=_0x4f32a5[_0x5ac7('0x15')];this[_0x5ac7('0x17')]=getSeconds(_0x4f32a5[_0x5ac7('0x15')],_0x4f32a5[_0x5ac7('0x14')]);this[_0x5ac7('0x18')]=0x0;this[_0x5ac7('0x19')]=0x0;this['callback']=_0x4f32a5[_0x5ac7('0x1a')];this['callbackuniqueid']=_0x4f32a5[_0x5ac7('0x1b')];this['callbackat']=_0x4f32a5[_0x5ac7('0x1c')];this[_0x5ac7('0x1d')]=_0x4f32a5[_0x5ac7('0x1d')];this[_0x5ac7('0x1e')]=_0x4f32a5[_0x5ac7('0x1e')];this['ListId']=_0x4f32a5['ListId'];this['UserId']=_0x4f32a5['UserId'];this[_0x5ac7('0x1f')]=_0x4f32a5[_0x5ac7('0x1f')];this[_0x5ac7('0x20')]=_0x4f32a5[_0x5ac7('0x20')];this[_0x5ac7('0x21')]=_0x4f32a5[_0x5ac7('0x21')]||'';this['originatecalleridname']=_0x4f32a5[_0x5ac7('0x22')]||'';}module[_0x5ac7('0x23')]=History; \ No newline at end of file +var _0x7208=['originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7208,0x199));var _0x8720=function(_0x6fbe8a,_0x1523d2){_0x6fbe8a=_0x6fbe8a-0x0;var _0x455529=_0x7208[_0x6fbe8a];return _0x455529;};'use strict';var util=require(_0x8720('0x0'));var _=require(_0x8720('0x1'));var moment=require(_0x8720('0x2'));function getSeconds(_0x373472,_0x233112){var _0x5ee66f=moment(_0x373472)[_0x8720('0x3')](0x0);var _0x153d47=moment(_0x233112)['milliseconds'](0x0);return _0x5ee66f[_0x8720('0x4')](_0x153d47,_0x8720('0x5'));}function History(_0xe6c772){this['uniqueid']=_0xe6c772[_0x8720('0x6')];this[_0x8720('0x7')]=_0xe6c772[_0x8720('0x7')]||undefined;this[_0x8720('0x8')]=_0xe6c772[_0x8720('0x8')];this[_0x8720('0x9')]=_0xe6c772['type']==='outbound'?_0x8720('0xa'):_0xe6c772[_0x8720('0x8')];this[_0x8720('0xb')]=_0xe6c772[_0x8720('0xb')];this[_0x8720('0xc')]=_0xe6c772['countcongestionretry'];this[_0x8720('0xd')]=_0xe6c772['countnoanswerretry'];this[_0x8720('0xe')]=_0xe6c772[_0x8720('0xb')]+_0xe6c772[_0x8720('0xc')]+_0xe6c772[_0x8720('0xd')]+_0xe6c772[_0x8720('0xf')]+_0xe6c772['countdropretry']+_0xe6c772[_0x8720('0x10')]+_0xe6c772[_0x8720('0x11')]+_0xe6c772[_0x8720('0x12')];this[_0x8720('0xf')]=_0xe6c772['countnosuchnumberretry'];this[_0x8720('0x13')]=_0xe6c772['countdropretry'];this[_0x8720('0x10')]=_0xe6c772[_0x8720('0x10')];this['countmachineretry']=_0xe6c772[_0x8720('0x11')];this['countagentrejectretry']=_0xe6c772['countagentrejectretry'];this[_0x8720('0xa')]=_0xe6c772['queue'];this[_0x8720('0x14')]=_0xe6c772['name'];this[_0x8720('0x15')]=_0xe6c772['number'];this[_0x8720('0x16')]=_0xe6c772[_0x8720('0x16')];this[_0x8720('0x17')]=_0xe6c772[_0x8720('0x17')];this['endtime']=_0xe6c772['responsetime'];this['ringtime']=getSeconds(_0xe6c772[_0x8720('0x17')],_0xe6c772['starttime']);this['holdtime']=0x0;this[_0x8720('0x18')]=0x0;this[_0x8720('0x19')]=_0xe6c772['callback'];this[_0x8720('0x1a')]=_0xe6c772[_0x8720('0x1a')];this[_0x8720('0x1b')]=_0xe6c772['callbackat'];this['recallme']=_0xe6c772[_0x8720('0x1c')];this[_0x8720('0x1d')]=_0xe6c772[_0x8720('0x1d')];this[_0x8720('0x1e')]=_0xe6c772[_0x8720('0x1e')];this[_0x8720('0x1f')]=_0xe6c772['UserId'];this['VoiceQueueId']=_0xe6c772[_0x8720('0x20')];this[_0x8720('0x21')]=_0xe6c772[_0x8720('0x21')];this[_0x8720('0x22')]=_0xe6c772[_0x8720('0x22')]||'';this['originatecalleridname']=_0xe6c772[_0x8720('0x23')]||'';}module[_0x8720('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 0a1b2df..7837fd7 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 _0x82b0=['checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','reason','Global','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','startProgressive','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','lodash','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./history','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','bind','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','sequence','enqueue','isNil','status','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','then','checkIsBlackList','resolve','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','SIP/%s','reachable','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HangupInAMD','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','membername','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','rescheduleContact','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countnoanswerretry','add','dialMachineRetryFrequency','minutes','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','outboundUnknownCallsDay','Unknow','syncAgentComplete','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','paused','stateinterface','locked','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','idHopper','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','interval','indexOf','true','content','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Failure','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response'];(function(_0x1bafb1,_0x3f4d43){var _0x1e9aa9=function(_0x34c867){while(--_0x34c867){_0x1bafb1['push'](_0x1bafb1['shift']());}};_0x1e9aa9(++_0x3f4d43);}(_0x82b0,0x81));var _0x082b=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x82b0[_0x46a3ff];return _0x404bc2;};'use strict';var util=require(_0x082b('0x0'));var _=require(_0x082b('0x1'));var BPromise=require(_0x082b('0x2'));var uuid=require('uuid');var moment=require(_0x082b('0x3'));var rr=require('rr');var md5=require(_0x082b('0x4'));var Redis=require(_0x082b('0x5'));var ut=require(_0x082b('0x6'));var config=require('../../../config/environment/');var logger=require(_0x082b('0x7'))(_0x082b('0x8'));var loggerBooked=require(_0x082b('0x7'))(_0x082b('0x9'));var loggerPredictive=require(_0x082b('0x7'))('predictive');var loggerPredictiveCalls=require(_0x082b('0x7'))(_0x082b('0xa'));var loggerSyncQueueSummary=require(_0x082b('0x7'))(_0x082b('0xb'));var ami=require(_0x082b('0xc'));config[_0x082b('0xd')]=_[_0x082b('0xe')](config[_0x082b('0xd')],{'host':_0x082b('0xf'),'port':0x18eb});var io=require(_0x082b('0x10'))(new Redis(config[_0x082b('0xd')]));var cmHopper=require(_0x082b('0x11'));var cmHopperHistory=require(_0x082b('0x12'));var cmHopperBlack=require(_0x082b('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x082b('0x14'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x082b('0x15'));var Hangup=require(_0x082b('0x16'));var ipAgi=process['env'][_0x082b('0x17')]||_0x082b('0x18');var strategy={'rrmemory':_0x082b('0x19'),'roundrobin':_0x082b('0x1a')};var Sequence=function(){};Sequence[_0x082b('0x1b')]['enqueue']=function(_0x23e79c){this[_0x082b('0x1c')]=this['tail']?this[_0x082b('0x1c')]['finally'](_0x23e79c):_0x23e79c();};function Dialer(_0xb373c9,_0x115675){this['sequence']=new Sequence();this[_0x082b('0x1d')]=_0x115675;this[_0x082b('0x1e')]=_0xb373c9[_0x082b('0x1e')];this[_0x082b('0x1f')]=_0xb373c9['campaigns'];this[_0x082b('0x20')]=_0xb373c9[_0x082b('0x20')];this[_0x082b('0x21')]=_0xb373c9[_0x082b('0x21')];this[_0x082b('0x22')]=config[_0x082b('0x22')]||0x2;this[_0x082b('0x23')]={};this[_0x082b('0x24')]={};this['contactsId']={};this[_0x082b('0x25')]={};this[_0x082b('0x26')]={};this[_0x082b('0x27')]={};this['startProgressive']={};this[_0x082b('0x28')]={};this[_0x082b('0x29')]={};this[_0x082b('0x2a')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x082b('0x2b')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x082b('0x2b')](this));ami['on'](_0x082b('0x2c'),this[_0x082b('0x2d')][_0x082b('0x2b')](this));ami['on'](_0x082b('0x2e'),this['syncAgentComplete'][_0x082b('0x2b')](this));ami['on'](_0x082b('0x2f'),this[_0x082b('0xb')][_0x082b('0x2b')](this));ami['on'](_0x082b('0x30'),this[_0x082b('0x31')][_0x082b('0x2b')](this));ami['on']('newexten',this[_0x082b('0x32')]['bind'](this));ami['on'](_0x082b('0x33'),this['syncVarSet'][_0x082b('0x2b')](this));ami['on'](_0x082b('0x34'),this['syncQueueMember'][_0x082b('0x2b')](this));ami['on']('queuestatuscomplete',this[_0x082b('0x35')]['bind'](this));this[_0x082b('0x36')]();this[_0x082b('0x37')]();}function isNotNull(_0x1f8ce4){return _0x1f8ce4!==null&&!_[_0x082b('0x38')](_0x1f8ce4);}function checkIsLoggedIn(_0x2f4e63,_0x219baa){return function(){if(_0x219baa<=0x0){_0x2f4e63[_0x082b('0x39')]=_0x082b('0x3a');throw _0x2f4e63[_0x082b('0x3b')]+_0x082b('0x3c');}};}function isActive(_0x3124dc){return _0x3124dc;}function checkIsActive(_0x11be3b,_0x560a90){return function(){if(!isActive(_0x560a90)){_0x11be3b[_0x082b('0x39')]=_0x082b('0x3d');throw _0x11be3b[_0x082b('0x3b')]+_0x082b('0x3e');}};}function checkInterval(_0x3189ac){return function(){if(!isNotNull(_0x3189ac['Interval'])){_0x3189ac['message']=_0x082b('0x3f');throw _0x3189ac[_0x082b('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3189ac[_0x082b('0x40')][_0x082b('0x41')])){_0x3189ac['message']=_0x082b('0x3f');throw _0x3189ac['name']+_0x082b('0x42');}if(!isNotNull(_[_0x082b('0x43')](_0x3189ac['Interval'][_0x082b('0x41')]))){_0x3189ac[_0x082b('0x39')]=_0x082b('0x3f');throw _0x3189ac[_0x082b('0x3b')]+_0x082b('0x42');}};}function msgResponse(_0x4f2cbc,_0x42146a,_0x5964a3){return{'action':_0x4f2cbc,'response':_0x42146a,'message':_0x5964a3,'stack':_0x5964a3};}function myreject(_0x468acd){return function(_0x458840){return _0x468acd(msgResponse(_0x082b('0x44'),_0x082b('0x45'),JSON[_0x082b('0x46')](_0x458840)));};}function getSeconds(_0x122077,_0x6bf96c){var _0x133805=moment(_0x122077)['milliseconds'](0x0);var _0x1e4745=moment(_0x6bf96c)[_0x082b('0x47')](0x0);return _0x133805['diff'](_0x1e4745,_0x082b('0x48'));}function emit(_0x13ad4e,_0x2a1939,_0xe585f3){io['to'](_0x13ad4e)[_0x082b('0x49')](_0x2a1939,_0xe585f3);}function emitVoiceQueueSummary(_0x2c7d91){if(_0x2c7d91[_0x082b('0x4a')]===_0x082b('0x4b')){var _0x57cba5={'id':_0x2c7d91['id'],'name':_0x2c7d91[_0x082b('0x3b')],'strategy':_0x2c7d91[_0x082b('0x4c')],'answered':_0x2c7d91[_0x082b('0x4d')],'available':_0x2c7d91[_0x082b('0x4e')],'loggedIn':_0x2c7d91['loggedIn'],'pTalking':_0x2c7d91[_0x082b('0x4f')],'sumBillable':_0x2c7d91[_0x082b('0x50')],'sumDuration':_0x2c7d91[_0x082b('0x51')],'sumHoldTime':_0x2c7d91[_0x082b('0x52')]||0x0,'talking':_0x2c7d91[_0x082b('0x53')],'total':_0x2c7d91['total'],'type':_0x2c7d91[_0x082b('0x4a')],'unmanaged':_0x2c7d91[_0x082b('0x54')],'abandoned':_0x2c7d91['abandoned'],'waiting':_0x2c7d91[_0x082b('0x55')],'loggedInDb':_0x2c7d91[_0x082b('0x56')],'dialActive':_0x2c7d91['dialActive'],'dialMethod':_0x2c7d91[_0x082b('0x57')],'dialOriginateCallerIdName':_0x2c7d91[_0x082b('0x58')],'dialOriginateCallerIdNumber':_0x2c7d91[_0x082b('0x59')],'dialOriginateTimeout':_0x2c7d91[_0x082b('0x5a')],'dialPrefix':_0x2c7d91[_0x082b('0x5b')],'outboundAnswerAgiCallsDay':_0x2c7d91[_0x082b('0x5c')],'outboundAnswerCallsDay':_0x2c7d91[_0x082b('0x5d')],'outboundBlacklistCallsDay':_0x2c7d91[_0x082b('0x5e')],'outboundBusyCallsDay':_0x2c7d91[_0x082b('0x5f')],'outboundCongestionCallsDay':_0x2c7d91['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2c7d91[_0x082b('0x60')],'outboundDropCallsDayCallersExit':_0x2c7d91[_0x082b('0x61')],'outboundDropCallsDayTimeout':_0x2c7d91[_0x082b('0x62')],'outboundNoAnswerCallsDay':_0x2c7d91[_0x082b('0x63')],'outboundNoSuchCallsDay':_0x2c7d91['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2c7d91[_0x082b('0x64')],'outboundReCallsDay':_0x2c7d91[_0x082b('0x65')],'outboundRejectCallsDay':_0x2c7d91[_0x082b('0x66')],'outboundUnknownCallsDay':_0x2c7d91['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2c7d91[_0x082b('0x67')],'predictiveIntervalAvgHoldtime':_0x2c7d91[_0x082b('0x68')],'predictiveIntervalAvgTalktime':_0x2c7d91[_0x082b('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x2c7d91[_0x082b('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x2c7d91[_0x082b('0x6b')],'predictiveIntervalErlangCalls':_0x2c7d91[_0x082b('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x2c7d91['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2c7d91[_0x082b('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x2c7d91[_0x082b('0x6e')],'predictiveIntervalPauses':_0x2c7d91[_0x082b('0x6f')],'predictiveIntervalAvailable':_0x2c7d91[_0x082b('0x70')],'predictiveIntervalTotalCalls':_0x2c7d91[_0x082b('0x71')],'message':_0x2c7d91[_0x082b('0x39')],'originated':_0x2c7d91[_0x082b('0x72')],'erlangCalls':_0x2c7d91[_0x082b('0x73')],'erlangCallToSecond':_0x2c7d91['erlangCallToSecond'],'erlangAbandonmentRate':_0x2c7d91[_0x082b('0x74')],'erlangBusyFactor':_0x2c7d91[_0x082b('0x75')],'startPredictive':_0x2c7d91[_0x082b('0x27')],'startProgressive':_0x2c7d91['startProgressive']};if(_0x2c7d91[_0x082b('0x76')]){_0x57cba5[_0x082b('0x76')]={'id':_0x2c7d91['Trunk']['id'],'name':_0x2c7d91[_0x082b('0x76')]['name'],'active':_0x2c7d91[_0x082b('0x76')][_0x082b('0x77')],'callerid':_0x2c7d91[_0x082b('0x76')]['callerid']};}if(_0x2c7d91[_0x082b('0x40')]){_0x57cba5['Interval']={'id':_0x2c7d91[_0x082b('0x40')]['id'],'name':_0x2c7d91['Interval'][_0x082b('0x3b')]};}var _0x518f6b=md5(JSON[_0x082b('0x46')](_0x57cba5));if(_0x2c7d91[_0x082b('0x4')]!==_0x518f6b){_0x2c7d91[_0x082b('0x4')]=_0x518f6b;emit(util[_0x082b('0x78')](_0x082b('0x79'),_0x57cba5[_0x082b('0x3b')]),_0x082b('0x7a'),_0x57cba5);}}}function emitCampaignSummary(_0x538e56){if(_0x538e56[_0x082b('0x4a')]===_0x082b('0x7b')){emit(util[_0x082b('0x78')]('campaign:ivr:%s',_0x538e56[_0x082b('0x3b')]),_0x082b('0x7c'),_0x538e56);}}function checkGetDataPredictive(_0x874601){if(isNotNull(_0x874601)&&!_[_0x082b('0x43')](_0x874601)){loggerPredictive[_0x082b('0x7d')](_0x082b('0x7e'));loggerPredictive[_0x082b('0x7d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x874601['predictiveIntervalTotalCalls']);loggerPredictive[_0x082b('0x7d')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x874601[_0x082b('0x67')]);loggerPredictive[_0x082b('0x7d')](_0x082b('0x7f'),_0x874601['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x874601['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x082b('0x7d')](_0x082b('0x80'),_0x874601['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x082b('0x7d')](_0x082b('0x81'),_0x874601[_0x082b('0x69')]);loggerPredictive[_0x082b('0x7d')]('---------------------------');if(_0x874601[_0x082b('0x71')]>0x0){if(!_[_0x082b('0x38')](_0x874601[_0x082b('0x69')])&&_0x874601[_0x082b('0x69')]>0x0){return!![];}loggerPredictive[_0x082b('0x7d')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x082b('0x38')](_0x874601[_0x082b('0x68')])&&_0x874601['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x082b('0x7d')](_0x082b('0x82'));}else{loggerPredictive['info'](_0x082b('0x83'));}}else{loggerPredictive['info'](_0x082b('0x84'));}return![];}function mergeDataErlangB(_0x2fe0e0){return function(_0x5c5c4c){loggerPredictive[_0x082b('0x7d')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x082b('0x7d')](_0x082b('0x85'),_0x5c5c4c['erlangCalls']);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c5c4c[_0x082b('0x86')]);loggerPredictive[_0x082b('0x7d')](_0x082b('0x87'),_0x5c5c4c[_0x082b('0x74')]);loggerPredictive[_0x082b('0x7d')](_0x082b('0x88'),_0x5c5c4c[_0x082b('0x75')]);loggerPredictive[_0x082b('0x7d')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c5c4c[_0x082b('0x74')]);loggerPredictive[_0x082b('0x7d')]('---------------------------');_[_0x082b('0x89')](_0x2fe0e0,_0x5c5c4c);};}function getDiff(_0x258112){var _0x38d3f9=moment()[_0x082b('0x47')](0x0);var _0xa10bb2=moment(_0x258112)[_0x082b('0x47')](0x0);return _0x38d3f9[_0x082b('0x8a')](_0xa10bb2,'seconds');}function ifInterval(_0x100cb5,_0x3fbf9e){if(_['isUndefined'](_0x3fbf9e)){return![];}return getDiff(_0x3fbf9e)<_0x100cb5*0x3c;}function freeVariablesPredictive(_0x2c5cfd){if(isNotNull(_0x2c5cfd)){if(!_[_0x082b('0x38')](_0x2c5cfd['startProgressive'])){_0x2c5cfd['startProgressive']=undefined;loggerPredictive[_0x082b('0x7d')](_0x2c5cfd[_0x082b('0x3b')],_0x082b('0x8b'));}if(!_[_0x082b('0x38')](_0x2c5cfd['startPredictive'])){_0x2c5cfd[_0x082b('0x27')]=undefined;loggerPredictive[_0x082b('0x7d')](_0x2c5cfd['name'],_0x082b('0x8c'));}if(!_[_0x082b('0x38')](_0x2c5cfd[_0x082b('0x8d')])){clearInterval(_0x2c5cfd[_0x082b('0x8d')]);_0x2c5cfd['handlePredictive']=undefined;loggerPredictive[_0x082b('0x7d')](_0x2c5cfd[_0x082b('0x3b')],_0x082b('0x8e'));}}}function erlangb(_0x4689e2,_0x31104e){if(_0x31104e===0x0){return 0x0;}var _0x1e3483=0x1;for(var _0x173117=0x1;_0x173117<=_0x31104e;_0x173117+=0x1){_0x1e3483=0x1+_0x1e3483*_0x173117/_0x4689e2;}return 0x1/_0x1e3483;}function isVoiceQueueOutbound(_0x80ae28){return _0x80ae28===_0x082b('0x4b');}function isNotPreview(_0x5467ca){return _0x5467ca!==_0x082b('0x1d');}function isCampaignIvr(_0x4870de){return _0x4870de===_0x082b('0x7b');}function getCallerId(_0x4a296d,_0x5962c0,_0x2bd5f3){if(!_['isUndefined'](_0x2bd5f3)&&typeof _0x2bd5f3==='string'&&!_['isEmpty'](_0x2bd5f3)){if(!_['isUndefined'](_0x5962c0)&&typeof _0x5962c0===_0x082b('0x8f')&&!_[_0x082b('0x43')](_0x5962c0)){return util[_0x082b('0x78')](_0x082b('0x90'),_0x5962c0,_0x2bd5f3);}return util[_0x082b('0x78')](_0x082b('0x90'),_0x2bd5f3,_0x2bd5f3);}if(!_['isUndefined'](_0x4a296d)&&typeof _0x4a296d===_0x082b('0x8f')&&!_[_0x082b('0x43')](_0x4a296d)){return _0x4a296d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x3a69e0,_0x1e1a91){return function(_0x1d3230){freeVariablesPredictive(_0x1e1a91);emitVoiceQueueSummary(_0x1e1a91);emitCampaignSummary(_0x1e1a91);loggerSyncQueueSummary[_0x082b('0x91')](_0x3a69e0,util[_0x082b('0x92')](_0x1d3230,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x16ae26,_0x358899){return function(_0x15a397){loggerPredictive[_0x082b('0x91')](_0x358899[_0x082b('0x3b')],_0x16ae26);loggerPredictive['error'](_0x15a397[_0x082b('0x93')]);freeVariablesPredictive(_0x358899);};}function loggerCatch(_0x502fdc){return function(_0x257cf4){logger[_0x082b('0x91')](_0x502fdc,util[_0x082b('0x92')](_0x257cf4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x14a8b8){return _0x14a8b8&&!_[_0x082b('0x38')](_0x14a8b8)&&_0x14a8b8[_0x082b('0x94')]>0x0;}function decremetOriginate(_0x47e7ac){if(!_[_0x082b('0x38')](_0x47e7ac)&&_0x47e7ac!==null){if(typeof _0x47e7ac[_0x082b('0x72')]!==_0x082b('0x95')){if(_0x47e7ac[_0x082b('0x72')]>0x0){_0x47e7ac[_0x082b('0x72')]-=0x1;}else{logger[_0x082b('0x91')](_0x082b('0x96'));}}}else{logger['error'](_0x082b('0x97'));}}function checkContactLowerLimitOriginate(_0x43f9f2,_0x57a97b,_0x551dc2){if(_0x57a97b>_0x551dc2){for(var _0x13874a=0x0;_0x13874a<_0x57a97b-_0x551dc2;_0x13874a+=0x1){decremetOriginate(_0x43f9f2);}}}function loggerGetContactDialer(_0x3f7ae7,_0x57fcef,_0x565052){return function(_0x26a2ad){checkContactLowerLimitOriginate(_0x57fcef,_0x565052,0x0);logger[_0x082b('0x91')](_0x3f7ae7,util[_0x082b('0x92')](_0x26a2ad,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x154507){return function(_0x240446){if(isNotNull(_0x240446)&&isNotNull(_0x240446[0x0])){if(_0x240446[0x0]['contactsRescheduled']>0x0){_0x154507[_0x082b('0x39')]='RESCHEDULED_CONTACTS';logger[_0x082b('0x7d')](_0x082b('0x98')+_0x154507[_0x082b('0x3b')],_0x240446[0x0][_0x082b('0x99')],'contacts');}else{_0x154507[_0x082b('0x39')]=_0x082b('0x9a');logger['info']('[getContactDialer2][Empty]'+_0x154507[_0x082b('0x3b')]);}}};}function notSendMessagesQueue(_0xdf73fb){if(_0xdf73fb['sendMessageOneNotActive']){freeVariablesPredictive(_0xdf73fb);if(_0xdf73fb['originated']===0x0&&_0xdf73fb[_0x082b('0x53')]===0x0&&_0xdf73fb[_0x082b('0x55')]===0x0&&(_0xdf73fb['pTalking']||0x0)===0x0){_0xdf73fb[_0x082b('0x9b')]=![];_0xdf73fb[_0x082b('0x4e')]=0x0;_0xdf73fb[_0x082b('0x39')]=_0x082b('0x3d');loggerSyncQueueSummary[_0x082b('0x91')](_0x082b('0x9c'),_0xdf73fb[_0x082b('0x3b')],_0x082b('0x9d'));}else{_0xdf73fb[_0x082b('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x082b('0x91')](_0x082b('0x9c'),_0xdf73fb[_0x082b('0x3b')],_0x082b('0x9e'));}emitVoiceQueueSummary(_0xdf73fb);}}function notSendMessagesCampaign(_0x1a06e8){if(_0x1a06e8[_0x082b('0x9b')]){if(_0x1a06e8['originated']===0x0){_0x1a06e8[_0x082b('0x9b')]=![];_0x1a06e8[_0x082b('0x39')]=_0x082b('0x3d');loggerSyncQueueSummary[_0x082b('0x91')](_0x082b('0x9f'),_0x1a06e8[_0x082b('0x3b')],'is\x20not\x20active');}else{_0x1a06e8[_0x082b('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x082b('0x91')](_0x082b('0x9f'),_0x1a06e8[_0x082b('0x3b')],_0x082b('0x9e'));}emitCampaignSummary(_0x1a06e8);}}function createObjHistory(_0x5e4fd8,_0x4d1163,_0x24ece0,_0x3af5bb,_0x372e96){_0x5e4fd8[_0x082b('0x39')]=_0x24ece0;var _0xb82b69=new Action(_0x5e4fd8,_0x4d1163);var _0x36933a=new History(_0xb82b69);_0x36933a[_0x082b('0xa0')]=_0x3af5bb;_0x36933a[_0x082b('0xa1')]=_0x372e96;_0x36933a[_0x082b('0xa2')]=_0xb82b69[_0x082b('0xa3')];return _0x36933a;}Dialer[_0x082b('0x1b')][_0x082b('0x37')]=function(){var _0x43b67a=this;setInterval(function(){_0x43b67a[_0x082b('0xa4')](_0x43b67a['uniqueId'],_0x082b('0xa5'));_0x43b67a['clearZombieChannels'](_0x43b67a[_0x082b('0x24')],'[actions]');},0x32c8);};Dialer[_0x082b('0x1b')][_0x082b('0xa4')]=function(_0x4bbaf7,_0x51052e){var _0x598f86=this;for(var _0x408bcb in _0x4bbaf7){if(typeof _0x4bbaf7[_0x408bcb]!==_0x082b('0x95')){this[_0x082b('0xa6')][_0x082b('0xa7')](function(){if(!_[_0x082b('0xa8')](_0x4bbaf7[_0x408bcb])){return ami['Action']({'action':_0x082b('0xa9'),'channel':_0x4bbaf7[_0x408bcb]['channel']})[_0x082b('0xaa')](function(_0x563a03){if(_0x563a03[_0x082b('0x39')]===_0x082b('0xab')){setTimeout(function(){if(_0x4bbaf7[_0x408bcb]&&_0x4bbaf7[_0x408bcb][_0x082b('0x4a')]!=='ivr'){_0x598f86['updateOriginated'](_0x598f86[_0x082b('0x1e')][_0x4bbaf7[_0x408bcb][_0x082b('0xac')]]);logger[_0x082b('0x91')](_0x082b('0xad'),_0x51052e,_0x408bcb,_0x4bbaf7[_0x408bcb][_0x082b('0xac')]);delete _0x4bbaf7[_0x408bcb];}if(_0x4bbaf7[_0x408bcb]&&_0x4bbaf7[_0x408bcb][_0x082b('0x4a')]===_0x082b('0x7b')){_0x598f86['updateOriginated'](_0x598f86['campaigns'][_0x4bbaf7[_0x408bcb]['queue']]);logger[_0x082b('0x91')](_0x082b('0xae'),_0x51052e,_0x408bcb,_0x4bbaf7[_0x408bcb][_0x082b('0xac')]);delete _0x4bbaf7[_0x408bcb];}},0x2328);}});}});}}};Dialer[_0x082b('0x1b')]['countReScheduled']=function(_0x1904f){return BPromise['resolve']()[_0x082b('0xaf')](cmHopper['countReScheduled'](_0x1904f))[_0x082b('0xaa')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x082b('0x1b')][_0x082b('0xb0')]=function(_0x200f3f){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopperBlack[_0x082b('0xb0')](_0x200f3f))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x082b('0x1b')][_0x082b('0xb2')]=function(_0x4cb756){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopperBlack['checkIsBlackListIvr'](_0x4cb756))[_0x082b('0xaa')](loggerCatch(_0x082b('0xb3')));};Dialer[_0x082b('0x1b')][_0x082b('0xb4')]=function(_0x1025fc){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopperHistory[_0x082b('0xb5')](_0x1025fc))[_0x082b('0xaa')](loggerCatch(_0x082b('0xb6')));};Dialer[_0x082b('0x1b')]['rescheduleContact']=function(_0x21b326){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopper['rescheduleContact'](_0x21b326))[_0x082b('0xaa')](loggerCatch(_0x082b('0xb7')));};Dialer[_0x082b('0x1b')][_0x082b('0xb8')]=function(_0x2a5086,_0xb0d7ce,_0x176208){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopper['unlockContact'](_0x2a5086,_0xb0d7ce,_0x176208))[_0x082b('0xaa')](loggerCatch(_0x082b('0xb9')));};Dialer[_0x082b('0x1b')][_0x082b('0xba')]=function(_0x2e8eec,_0x3f20da,_0x582517,_0x58a265,_0x4d6f59){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopper['getContactDialer'](_0x2e8eec,_0x3f20da,_0x582517,_0x58a265))[_0x082b('0xaa')](function(_0x5cc4af){_0x4d6f59[_0x082b('0xbb')]-=_0x582517;_0x4d6f59[_0x082b('0xbb')]=_0x4d6f59[_0x082b('0xbb')]>0x0?_0x4d6f59[_0x082b('0xbb')]:0x0;loggerCatch(_0x082b('0xbc'))(_0x5cc4af);});};Dialer['prototype'][_0x082b('0xbd')]=function(_0x59915a,_0x43c5a1,_0x2542cb,_0x1a5473){return BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](cmHopper['getContactDialerIvr'](_0x59915a,_0x43c5a1,_0x2542cb))['catch'](function(_0xca43b8){_0x1a5473[_0x082b('0xbb')]-=_0x43c5a1;_0x1a5473[_0x082b('0xbb')]=_0x1a5473[_0x082b('0xbb')]>0x0?_0x1a5473[_0x082b('0xbb')]:0x0;loggerCatch(_0x082b('0xbe'))(_0xca43b8);});};Dialer[_0x082b('0x1b')][_0x082b('0xbf')]=function(_0x2c3005){return BPromise['resolve']()[_0x082b('0xaf')](voiceQueueRt[_0x082b('0xbf')](_0x2c3005))[_0x082b('0xaa')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x082b('0x1b')][_0x082b('0xc0')]=function(_0x5da923){return BPromise['resolve']()[_0x082b('0xaf')](cmHopper[_0x082b('0xc0')](_0x5da923))['catch'](loggerCatch(_0x082b('0xc1')));};Dialer[_0x082b('0x1b')][_0x082b('0xc2')]=function(_0x36ca98){return BPromise['resolve']()[_0x082b('0xaf')](cmHopperHistory[_0x082b('0xc2')](_0x36ca98))[_0x082b('0xaa')](loggerCatch(_0x082b('0xc3')));};Dialer['prototype'][_0x082b('0xc4')]=function(_0x166095){if(!_['isUndefined'](_0x166095)&&_0x166095!==null){if(typeof _0x166095[_0x082b('0x72')]!==_0x082b('0x95')){if(_0x166095['originated']>0x0){_0x166095['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x082b('0xc5'));}};Dialer[_0x082b('0x1b')][_0x082b('0xc6')]=function(_0x24ffac,_0x3fd699){var _0x4e18cc=this;return function(_0x43e4b8){_0x4e18cc[_0x082b('0xc4')](_0x3fd699);logger[_0x082b('0x91')](_0x24ffac,util['inspect'](_0x43e4b8,{'showHidden':![],'depth':null}));};};Dialer[_0x082b('0x1b')][_0x082b('0xc7')]=function(_0x2a97e4,_0x228162,_0x2e7d40){var _0x501871={'state':0x19,'statedesc':_0x082b('0xc8')};this[_0x082b('0xc4')](_0x228162);this[_0x082b('0xc9')](_[_0x082b('0x89')](_0x501871,_[_0x082b('0xca')](_0x2e7d40,[_0x082b('0xcb'),'ListId',_0x082b('0xcc'),_0x082b('0xcd'),_0x082b('0xce')])),_0x082b('0xcf'),_0x082b('0xd0'));logger[_0x082b('0x91')](_0x2a97e4);};Dialer[_0x082b('0x1b')][_0x082b('0xd1')]=function(_0x1f75b1){return _0x1f75b1===_0x082b('0xd2');};Dialer[_0x082b('0x1b')]['isTrunkReachable']=function(_0x3066ad){return!_[_0x082b('0x38')](_0x3066ad)&&_0x3066ad&&!_[_0x082b('0x38')](_0x3066ad['name'])&&!_['isUndefined'](_0x3066ad[_0x082b('0x77')])&&_0x3066ad['active']&&(this[_0x082b('0x21')][util[_0x082b('0x78')](_0x082b('0xd3'),_0x3066ad[_0x082b('0x3b')])][_0x082b('0xa9')]===_0x082b('0xd4')||this[_0x082b('0x21')][util[_0x082b('0x78')](_0x082b('0xd3'),_0x3066ad['name'])][_0x082b('0xa9')]==='unmonitored');};Dialer['prototype'][_0x082b('0xc9')]=function(_0x9bb642,_0x510694,_0x36ee2e){this[_0x082b('0xc2')](_0x9bb642)[_0x082b('0xaa')](loggerCatch(_0x510694));this[_0x082b('0xc0')](_0x9bb642)['catch'](loggerCatch(_0x36ee2e));};Dialer[_0x082b('0x1b')][_0x082b('0xd5')]=function(_0x3d7fb0){var _0x2aec52=this[_0x082b('0x25')][_0x3d7fb0[_0x082b('0xd6')]];var _0xad5936;if(!_[_0x082b('0xa8')](_0x3d7fb0)&&!_['isNil'](_0x3d7fb0['variable'])&&!_[_0x082b('0xa8')](_0x3d7fb0[_0x082b('0xd7')][_0x082b('0xd8')])&&_0x3d7fb0[_0x082b('0xd9')]===_0x082b('0xda')&&_0x2aec52){if(_0x2aec52['type']!==_0x082b('0x7b')&&this['voiceQueues'][_0x2aec52[_0x082b('0xac')]][_0x082b('0xdb')]&&_0x3d7fb0[_0x082b('0xdc')]==='HANGUP'){delete this[_0x082b('0x25')][_0x3d7fb0[_0x082b('0xd6')]];this[_0x082b('0xc4')](this[_0x082b('0x1e')][_0x2aec52['queue']]);this[_0x082b('0x1e')][_0x2aec52['queue']][_0x082b('0x5d')]+=0x1;this[_0x082b('0x1e')][_0x2aec52['queue']][_0x082b('0x5c')]+=0x1;_0xad5936=new Hangup(_0x2aec52,_0x3d7fb0);_0xad5936[_0x082b('0xa0')]=0x12;_0xad5936[_0x082b('0xa1')]=_0x082b('0xdd');_0xad5936['membername']=_0x082b('0xde');ami[_0x082b('0x49')](_0x082b('0xdf'),ut[_0x082b('0xe0')](_0xad5936,'amd'));this[_0x082b('0xc9')](_0xad5936,_0x082b('0xe1'),_0x082b('0xe2'));}if(_0x2aec52[_0x082b('0x4a')]!==_0x082b('0x7b')&&this['voiceQueues'][_0x2aec52[_0x082b('0xac')]]['dialAMDActive']&&_0x3d7fb0['value']===_0x082b('0xe3')){var _0x2bbef8=this;return new BPromise(function(_0x3d3ca4,_0x19e869){delete _0x2bbef8['uniqueId'][_0x3d7fb0[_0x082b('0xd6')]];_0x2bbef8[_0x082b('0xc4')](_0x2bbef8[_0x082b('0x1e')][_0x2aec52[_0x082b('0xac')]]);_0x2bbef8[_0x082b('0x1e')][_0x2aec52[_0x082b('0xac')]]['outboundAnswerCallsDay']+=0x1;_0x2bbef8['voiceQueues'][_0x2aec52['queue']][_0x082b('0x5c')]+=0x1;var _0x310440=_0x2bbef8[_0x082b('0x1e')][_0x2aec52[_0x082b('0xac')]];var _0x48b95f=new Hangup(_0x2aec52,_0x3d7fb0);_0x48b95f[_0x082b('0xa0')]=0x13;_0x48b95f[_0x082b('0xa1')]='Machine';_0x48b95f[_0x082b('0xe4')]=_0x082b('0xde');_0x48b95f['countmachineretry']+=0x1;_0x48b95f[_0x082b('0xe5')]+=0x1;_0x48b95f[_0x082b('0xe6')]=!![];ami['emit'](_0x082b('0xdf'),ut['buildObj'](_0x48b95f,'amd'));_0x2bbef8[_0x082b('0xc2')](_0x48b95f)[_0x082b('0xaa')](loggerCatch(_0x082b('0xe7')));if(_0x48b95f[_0x082b('0xe8')]+_0x48b95f[_0x082b('0xe9')]+_0x48b95f['countnoanswerretry']+_0x48b95f[_0x082b('0xea')]+_0x48b95f[_0x082b('0xeb')]+_0x48b95f[_0x082b('0xec')]+_0x48b95f[_0x082b('0xed')]+_0x48b95f[_0x082b('0xee')]>=_0x310440[_0x082b('0xef')]){_0x2bbef8[_0x082b('0xf0')](_0x48b95f,_0x3d3ca4,_0x19e869,'reason19\x20machine....');}else{if(_0x48b95f[_0x082b('0xed')]>=_0x310440[_0x082b('0xf1')]){_0x2bbef8[_0x082b('0xf2')](_0x48b95f,_0x3d3ca4,_0x19e869,_0x082b('0xf3'));}else{_0x2bbef8[_0x082b('0xf4')]({'active':![],'countmachineretry':_0x48b95f[_0x082b('0xed')],'scheduledat':moment()['add'](_0x310440['dialMachineRetryFrequency'],'minutes')['format'](_0x082b('0xf5')),'ContactId':_0x48b95f['ContactId'],'ListId':_0x48b95f[_0x082b('0xf6')],'VoiceQueueId':_0x48b95f[_0x082b('0xcd')]||undefined,'CampaignId':_0x48b95f[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0xf7')));_0x3d3ca4({'reschedule':0x1});}}});}if(_0x2aec52[_0x082b('0x4a')]==='ivr'&&this[_0x082b('0x1f')][_0x2aec52[_0x082b('0xac')]]['dialAMDActive']&&_0x3d7fb0[_0x082b('0xdc')]===_0x082b('0xf8')){delete this[_0x082b('0x25')][_0x3d7fb0['uniqueid']];this[_0x082b('0xc4')](this[_0x082b('0x1f')][_0x2aec52[_0x082b('0xac')]]);_0xad5936=new Hangup(_0x2aec52,_0x3d7fb0);_0xad5936['state']=0x12;_0xad5936[_0x082b('0xa1')]=_0x082b('0xdd');_0xad5936[_0x082b('0xe4')]=_0x082b('0xde');ami[_0x082b('0x49')]('custom:amd',ut[_0x082b('0xe0')](_0xad5936,_0x082b('0xe6')));this[_0x082b('0xc9')](_0xad5936,_0x082b('0xf9'),_0x082b('0xfa'));}if(_0x2aec52['type']===_0x082b('0x7b')&&this[_0x082b('0x1f')][_0x2aec52[_0x082b('0xac')]][_0x082b('0xdb')]&&_0x3d7fb0[_0x082b('0xdc')]===_0x082b('0xe3')){var _0x2bbef8=this;return new BPromise(function(_0x294d0d,_0x19fd52){delete _0x2bbef8[_0x082b('0x25')][_0x3d7fb0[_0x082b('0xd6')]];_0x2bbef8[_0x082b('0xc4')](_0x2bbef8[_0x082b('0x1f')][_0x2aec52[_0x082b('0xac')]]);_0x2bbef8[_0x082b('0x1f')][_0x2aec52[_0x082b('0xac')]][_0x082b('0x5d')]+=0x1;_0x2bbef8[_0x082b('0x1f')][_0x2aec52[_0x082b('0xac')]][_0x082b('0x5c')]+=0x1;var _0x14bd98=_0x2bbef8[_0x082b('0x1f')][_0x2aec52['queue']];var _0x184b48=new Hangup(_0x2aec52,_0x3d7fb0);_0x184b48['state']=0x13;_0x184b48['statedesc']=_0x082b('0xfb');_0x184b48[_0x082b('0xe4')]=_0x082b('0xde');_0x184b48[_0x082b('0xed')]+=0x1;_0x184b48['countglobal']+=0x1;_0x184b48[_0x082b('0xe6')]=!![];ami[_0x082b('0x49')](_0x082b('0xdf'),ut['buildObj'](_0x184b48,_0x082b('0xe6')));_0x2bbef8[_0x082b('0xc2')](_0x184b48)[_0x082b('0xaa')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x184b48[_0x082b('0xe8')]+_0x184b48[_0x082b('0xe9')]+_0x184b48[_0x082b('0xfc')]+_0x184b48[_0x082b('0xea')]+_0x184b48[_0x082b('0xeb')]+_0x184b48[_0x082b('0xec')]+_0x184b48[_0x082b('0xed')]+_0x184b48[_0x082b('0xee')]>=_0x14bd98[_0x082b('0xef')]){_0x2bbef8[_0x082b('0xf0')](_0x184b48,_0x294d0d,_0x19fd52,'reason19\x20machine....');}else{if(_0x184b48[_0x082b('0xed')]>=_0x14bd98[_0x082b('0xf1')]){_0x2bbef8[_0x082b('0xf2')](_0x184b48,_0x294d0d,_0x19fd52,'reason\x2019\x20machine....');}else{_0x2bbef8[_0x082b('0xf4')]({'active':![],'countmachineretry':_0x184b48[_0x082b('0xed')],'scheduledat':moment()[_0x082b('0xfd')](_0x14bd98[_0x082b('0xfe')],_0x082b('0xff'))[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0x184b48[_0x082b('0xcb')],'ListId':_0x184b48[_0x082b('0xf6')],'VoiceQueueId':_0x184b48[_0x082b('0xcd')]||undefined,'CampaignId':_0x184b48[_0x082b('0xce')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x294d0d({'reschedule':0x1});}}});}}};Dialer[_0x082b('0x1b')][_0x082b('0x31')]=function(_0x510574){var _0x37a015=this[_0x082b('0x25')][_0x510574[_0x082b('0xd6')]];var _0x6f367e=this;var _0x486889;if(_0x37a015&&_0x37a015[_0x082b('0x4a')]==='ivr'){delete this['uniqueId'][_0x510574['uniqueid']];this['updateOriginated'](this[_0x082b('0x1f')][_0x37a015['queue']]);this[_0x082b('0x1f')][_0x37a015[_0x082b('0xac')]]['ivrAnswerCallsDay']+=0x1;_0x486889=new Hangup(_0x37a015,_0x510574);this[_0x082b('0xc2')](_0x486889)[_0x082b('0xaa')](loggerCatch(_0x082b('0x100')));this[_0x082b('0xc0')](_0x486889)[_0x082b('0xaa')](loggerCatch(_0x082b('0x101')));}if(_0x37a015&&_0x37a015['type']!==_0x082b('0x7b')&&isNotNull(this['voiceQueues'][_0x37a015[_0x082b('0xac')]]['dialQueueProject'])){delete this[_0x082b('0x25')][_0x510574['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x37a015[_0x082b('0xac')]]);this[_0x082b('0x1e')][_0x37a015[_0x082b('0xac')]][_0x082b('0x5d')]+=0x1;this[_0x082b('0x1e')][_0x37a015[_0x082b('0xac')]][_0x082b('0x5c')]+=0x1;_0x486889=new Hangup(_0x37a015,_0x510574);_0x486889[_0x082b('0xa0')]=0x10;_0x486889[_0x082b('0xa1')]=_0x082b('0x102');_0x486889[_0x082b('0xe4')]='AGI';this[_0x082b('0xc2')](_0x486889)[_0x082b('0xaa')](loggerCatch(_0x082b('0x100')));this[_0x082b('0xc0')](_0x486889)[_0x082b('0xaa')](loggerCatch(_0x082b('0x101')));}if(_0x37a015&&_0x37a015[_0x082b('0x4a')]!==_0x082b('0x7b')&&!isNotNull(this['voiceQueues'][_0x37a015['queue']][_0x082b('0x103')])){delete this[_0x082b('0x25')][_0x510574[_0x082b('0xd6')]];this[_0x082b('0xc4')](this[_0x082b('0x1e')][_0x37a015['queue']]);this[_0x082b('0x1e')][_0x37a015[_0x082b('0xac')]][_0x082b('0x104')]+=0x1;_0x486889=new Hangup(_0x37a015,_0x510574);_0x486889[_0x082b('0xa0')]=0xc;_0x486889['statedesc']=_0x510574['cause-txt'];_0x486889[_0x082b('0xe4')]=_0x082b('0x105');this[_0x082b('0xc2')](_0x486889)[_0x082b('0xaa')](loggerCatch(_0x082b('0x100')));this[_0x082b('0xc0')](_0x486889)[_0x082b('0xaa')](loggerCatch(_0x082b('0x101')));}};Dialer[_0x082b('0x1b')][_0x082b('0x106')]=function(_0x115295){var _0x5b3a82=this[_0x082b('0x25')][_0x115295[_0x082b('0xd6')]];var _0x1dd479=this;if(this[_0x082b('0x1e')][_0x115295['queue']]){if(_0x5b3a82&&_0x5b3a82[_0x082b('0x4a')]!==_0x082b('0x7b')){delete this[_0x082b('0x25')][_0x115295[_0x082b('0xd6')]];this[_0x082b('0x1e')][_0x115295[_0x082b('0xac')]][_0x082b('0x5d')]+=0x1;var _0x57dd8d=new AgentComplete(_0x5b3a82,_0x115295);if(_0x115295['reason']==='agent'){_0x57dd8d['agiafterat']=this[_0x082b('0x1e')][_0x115295[_0x082b('0xac')]][_0x082b('0x107')]&&this[_0x082b('0x1e')][_0x115295['queue']][_0x082b('0x108')]?moment()[_0x082b('0x78')](_0x082b('0xf5')):undefined;}this['createHistory'](_0x57dd8d)[_0x082b('0xaa')](loggerCatch(_0x082b('0x109')));this[_0x082b('0xc0')](_0x57dd8d)[_0x082b('0xaa')](loggerCatch(_0x082b('0x10a')));}}};Dialer[_0x082b('0x1b')][_0x082b('0x10b')]=function(_0x4260ec){if(this[_0x082b('0x1e')][_0x4260ec[_0x082b('0xac')]]){if(this['uniqueId'][_0x4260ec[_0x082b('0xd6')]]&&this[_0x082b('0x25')][_0x4260ec[_0x082b('0xd6')]][_0x082b('0x4a')]!==_0x082b('0x7b')){this[_0x082b('0xc4')](this[_0x082b('0x1e')][_0x4260ec['queue']]);this[_0x082b('0x25')][_0x4260ec[_0x082b('0xd6')]][_0x082b('0x10c')]=moment()[_0x082b('0x78')](_0x082b('0xf5'));}}};Dialer[_0x082b('0x1b')]['queueCallerAbandonCreateState']=function(_0x39ad90){this[_0x082b('0xc2')](_0x39ad90)[_0x082b('0xaa')](loggerCatch(_0x082b('0x109')));this[_0x082b('0xc0')](_0x39ad90)[_0x082b('0xaa')](loggerCatch(_0x082b('0x10d')));};Dialer[_0x082b('0x1b')][_0x082b('0x10e')]=function(_0xde59f1){var _0xa06f97=this[_0x082b('0x25')][_0xde59f1[_0x082b('0xd6')]];var _0x32e3af=this;if(this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]]){if(_0xa06f97&&_0xa06f97[_0x082b('0x4a')]!==_0x082b('0x7b')){delete this['uniqueId'][_0xde59f1[_0x082b('0xd6')]];this[_0x082b('0xc4')](this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]]);_0xa06f97[_0x082b('0x10f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x555c31=new QueueCallerAbandon(_0xa06f97,_0xde59f1);if(getSeconds(_0xa06f97[_0x082b('0x10f')],_0xa06f97[_0x082b('0x110')])>=_0xa06f97[_0x082b('0x111')]){this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]][_0x082b('0x6b')]+=0x1;this['voiceQueues'][_0xde59f1[_0x082b('0xac')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0xde59f1['queue']][_0x082b('0x112')]+=0x1;_0x555c31[_0x082b('0xa0')]=0xa;_0x555c31['statedesc']=_0x082b('0x113');_0x555c31[_0x082b('0x114')]=_0x082b('0x115');_0x555c31[_0x082b('0x116')]=this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]][_0x082b('0x107')]?moment()[_0x082b('0x78')](_0x082b('0xf5')):undefined;_0x555c31[_0x082b('0xeb')]+=0x1;_0x555c31[_0x082b('0xe5')]+=0x1;if(_0x555c31[_0x082b('0xeb')]>=this['voiceQueues'][_0xde59f1['queue']][_0x082b('0x117')]){this['queueCallerAbandonCreateState'](_0x555c31);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x555c31[_0x082b('0xeb')],'scheduledat':moment()[_0x082b('0xfd')](this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]][_0x082b('0x118')],_0x082b('0xff'))[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0xa06f97[_0x082b('0xcb')],'ListId':_0xa06f97['ListId'],'VoiceQueueId':_0xa06f97[_0x082b('0xcd')]||undefined,'CampaignId':_0xa06f97[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x119')));var _0x7b6a02=new History(_0x555c31);_0x7b6a02[_0x082b('0xa0')]=0xa;_0x7b6a02[_0x082b('0xa1')]=_0x082b('0x113');_0x7b6a02[_0x082b('0xa3')]=moment()[_0x082b('0x78')](_0x082b('0xf5'));_0x7b6a02[_0x082b('0xa2')]=_0x7b6a02[_0x082b('0xa3')];_0x7b6a02['calleridname']=_0x555c31['calleridname'];_0x7b6a02['calleridnum']=_0x555c31[_0x082b('0x11a')];this[_0x082b('0xc2')](_0x7b6a02)[_0x082b('0xaa')](loggerCatch(_0x082b('0x11b')));}}else{this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]][_0x082b('0x6a')]+=0x1;this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]][_0x082b('0x61')]+=0x1;_0x555c31['state']=0xb;_0x555c31['statedesc']=_0x082b('0x11c');_0x555c31['dropreason']=_0x082b('0x11d');_0x555c31[_0x082b('0xec')]+=0x1;_0x555c31[_0x082b('0xe5')]+=0x1;if(_0x555c31['countabandonedretry']>=this['voiceQueues'][_0xde59f1['queue']]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x555c31);}else{this[_0x082b('0xf4')]({'active':![],'countabandonedretry':_0x555c31[_0x082b('0xec')],'scheduledat':moment()[_0x082b('0xfd')](this[_0x082b('0x1e')][_0xde59f1[_0x082b('0xac')]][_0x082b('0x11e')],_0x082b('0xff'))[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0xa06f97[_0x082b('0xcb')],'ListId':_0xa06f97[_0x082b('0xf6')],'VoiceQueueId':_0xa06f97[_0x082b('0xcd')]||undefined,'CampaignId':_0xa06f97[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x11f')));var _0x7b6a02=new History(_0x555c31);_0x7b6a02[_0x082b('0xa0')]=0xb;_0x7b6a02[_0x082b('0xa1')]=_0x082b('0x11c');_0x7b6a02[_0x082b('0xa3')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x7b6a02[_0x082b('0xa2')]=_0x7b6a02[_0x082b('0xa3')];_0x7b6a02['calleridname']=_0x555c31[_0x082b('0x120')];_0x7b6a02[_0x082b('0x11a')]=_0x555c31[_0x082b('0x11a')];this['createHistory'](_0x7b6a02)[_0x082b('0xaa')](loggerCatch(_0x082b('0x121')));}}}}};Dialer[_0x082b('0x1b')][_0x082b('0x32')]=function(_0x5eae54){if(this[_0x082b('0x24')][_0x5eae54['uniqueid']]){this[_0x082b('0x24')][_0x5eae54[_0x082b('0xd6')]][_0x082b('0x122')]=_0x5eae54['channel'];}if(this['uniqueId'][_0x5eae54['uniqueid']]){this[_0x082b('0x25')][_0x5eae54[_0x082b('0xd6')]][_0x082b('0x122')]=_0x5eae54[_0x082b('0x122')];}};Dialer[_0x082b('0x1b')][_0x082b('0x123')]=function(_0xacb66e){if(strategy[this[_0x082b('0x1e')][this[_0x082b('0x24')][_0xacb66e['actionid']][_0x082b('0xac')]][_0x082b('0x4c')]]===_0x082b('0x1a')){if(this[_0x082b('0x24')][_0xacb66e['actionid']]&&_[_0x082b('0xa8')](this['actions'][_0xacb66e[_0x082b('0x124')]]['locked'])&&_0xacb66e[_0x082b('0xa9')]==='1'&&_0xacb66e[_0x082b('0x125')]==='0'){if(this[_0x082b('0x20')][_0xacb66e[_0x082b('0x126')]]){if(!this['agents'][_0xacb66e['stateinterface']]['locked']){this['agents'][_0xacb66e[_0x082b('0x126')]][_0x082b('0x127')]=!![];this[_0x082b('0x24')][_0xacb66e['actionid']][_0x082b('0x127')]=!![];this[_0x082b('0x24')][_0xacb66e['actionid']][_0x082b('0x126')]=_0xacb66e['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x082b('0x24')][_0xacb66e[_0x082b('0x124')]][_0x082b('0xac')]]['strategy']]||_0x082b('0x19'))===_0x082b('0x19')){if(this[_0x082b('0x24')][_0xacb66e[_0x082b('0x124')]]){if(this[_0x082b('0x20')][_0xacb66e['stateinterface']]){this[_0x082b('0x24')][_0xacb66e['actionid']][_0x082b('0x126')]=_0xacb66e[_0x082b('0x126')];if(_[_0x082b('0xa8')](this[_0x082b('0x29')][this[_0x082b('0x24')][_0xacb66e['actionid']][_0x082b('0xac')]])){this[_0x082b('0x29')][this[_0x082b('0x24')][_0xacb66e[_0x082b('0x124')]][_0x082b('0xac')]]=[];}this[_0x082b('0x29')][this[_0x082b('0x24')][_0xacb66e[_0x082b('0x124')]]['queue']][_0x082b('0x128')](_[_0x082b('0x89')](_[_0x082b('0xca')](this[_0x082b('0x24')][_0xacb66e[_0x082b('0x124')]],['idHopper',_0x082b('0x126')]),{'status':_0xacb66e['status'],'paused':_0xacb66e[_0x082b('0x125')]}));}}}};function unlockQueueStatus(_0x6e0516,_0x53927b){setTimeout(function(){if(_[_0x082b('0x38')](_0x6e0516[_0x082b('0x129')])){loggerBooked[_0x082b('0x91')](_0x082b('0x12a'),_0x53927b);}_0x6e0516[_0x082b('0x129')]=!![];loggerBooked['info'](_0x082b('0x12b'),_0x53927b,JSON[_0x082b('0x46')](_[_0x082b('0xca')](_0x6e0516,[_0x082b('0x3b'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x082b('0x1b')][_0x082b('0x35')]=function(_0x344fdc){var _0x4e2665=this;var _0x55f08b=_0x4e2665[_0x082b('0x1e')][_0x4e2665['actions'][_0x344fdc['actionid']][_0x082b('0xac')]];if(strategy[this[_0x082b('0x1e')][this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]]['queue']][_0x082b('0x4c')]]===_0x082b('0x1a')){if(this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]]&&this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0x126')]){this[_0x082b('0x1d')][_0x082b('0x12c')](this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]]['idHopper'],this['actions'][_0x344fdc[_0x082b('0x124')]][_0x082b('0x126')])[_0x082b('0xaa')](function(_0x2f4027){logger[_0x082b('0x91')](_0x082b('0x12d'),util[_0x082b('0x92')](_0x2f4027,{'showHidden':![],'depth':null}));})[_0x082b('0x12e')](function(){_0x4e2665[_0x082b('0xc4')](_0x4e2665[_0x082b('0x1e')][_0x4e2665[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]]);_0x4e2665[_0x082b('0x20')][_0x4e2665[_0x082b('0x24')][_0x344fdc['actionid']]['stateinterface']]['locked']=![];delete _0x4e2665['actions'][_0x344fdc[_0x082b('0x124')]];unlockQueueStatus(_0x55f08b);});}else{this[_0x082b('0xc4')](this[_0x082b('0x1e')][this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]]);this[_0x082b('0xf4')]({'active':![],'ContactId':this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xcb')],'ListId':this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xf6')],'VoiceQueueId':this[_0x082b('0x24')][_0x344fdc['actionid']][_0x082b('0xcd')]||undefined,'CampaignId':this[_0x082b('0x24')][_0x344fdc['actionid']][_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]];unlockQueueStatus(_0x55f08b);}}else if((strategy[this[_0x082b('0x1e')][this['actions'][_0x344fdc['actionid']][_0x082b('0xac')]][_0x082b('0x4c')]]||_0x082b('0x19'))===_0x082b('0x19')){var _0x482762;if(this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]]&&!_[_0x082b('0x43')](this[_0x082b('0x29')][this[_0x082b('0x24')][_0x344fdc['actionid']][_0x082b('0xac')]])){if(this[_0x082b('0x2a')][_0x4e2665[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]]){this[_0x082b('0x2a')][_0x4e2665[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]]=this[_0x082b('0x2a')][this[_0x082b('0x24')][_0x344fdc['actionid']][_0x082b('0xac')]]?this['queueBookedRR'][this['actions'][_0x344fdc['actionid']]['queue']]:this[_0x082b('0x29')][this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]]['queue']]?this['queueBooked'][this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]][_0x082b('0x12f')]||0x0:0x0;}this[_0x082b('0x29')][this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]][_0x082b('0x12f')]=this[_0x082b('0x2a')][this[_0x082b('0x24')][_0x344fdc[_0x082b('0x124')]][_0x082b('0xac')]];for(var _0x4d63c4=0x0;_0x4d63c4=0x0;})[_0x082b('0xaa')](myreject(_0x31da1b)));}}else{_0x32fdb8[_0x082b('0x128')](ami['Action']({'action':_0x082b('0x14a'),'command':util[_0x082b('0x78')](_0x082b('0x14b'),_0x4a8131,!_[_0x082b('0x38')](config[_0x082b('0x146')][_0x264cf9])?_0x264cf9:'')})['then'](function(_0x4cf96b){return _0x4cf96b[_0x082b('0x14f')][_0x082b('0x14d')](_0x082b('0x14e'))>=0x0;})[_0x082b('0xaa')](myreject(_0x31da1b)));}BPromise[_0x082b('0x150')](_0x32fdb8)['then'](function(_0x2714f1){var _0x1aef30=_['some'](_0x2714f1);if(_0x1aef30){return _0x25018f(_0x1aef30);}else{_0x4f7b81['message']=_0x2f2d22?_0x082b('0x151'):_0x082b('0x152');return _0x31da1b(msgResponse(_0x082b('0x153'),_0x082b('0x154'),_0x082b('0x155')+_0x2f2d22+'\x20'+_0x51f74d+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x4a8131,{'showHidden':![],'depth':null})+_0x082b('0x156')+_0x264cf9));}})[_0x082b('0xaa')](function(_0xb2868b){return _0x31da1b(msgResponse(_0x082b('0x143'),_0x082b('0x154'),JSON[_0x082b('0x46')](_0xb2868b)));});});};Dialer[_0x082b('0x1b')][_0x082b('0x157')]=function(_0x395c72){var _0x1f7562=this;return function(){switch(_0x395c72[_0x082b('0x57')]){case _0x082b('0x158'):freeVariablesPredictive(_0x395c72);_0x1f7562[_0x082b('0x159')](_0x395c72,0x1);break;case _0x082b('0x15a'):freeVariablesPredictive(_0x395c72);_0x1f7562[_0x082b('0x159')](_0x395c72,_0x395c72[_0x082b('0x15b')]);break;case _0x082b('0x15c'):_0x1f7562['predictive'](_0x395c72);break;case'booked':freeVariablesPredictive(_0x395c72);_0x1f7562[_0x082b('0x159')](_0x395c72,0x1);break;default:freeVariablesPredictive(_0x395c72);logger[_0x082b('0x91')](_0x082b('0x15d'),_0x395c72[_0x082b('0x3b')],_0x082b('0x15e'));}};};Dialer['prototype'][_0x082b('0x15f')]=function(_0x49f013){var _0x3706a8=this;return function(){_0x3706a8[_0x082b('0x160')](_0x49f013);};};Dialer[_0x082b('0x1b')][_0x082b('0xb')]=function(_0x2464ce){var _0x4d364f=this;if(isNotPreview(_0x2464ce[_0x082b('0x57')])){if(isVoiceQueueOutbound(_0x2464ce[_0x082b('0x4a')])&&isActive(_0x2464ce[_0x082b('0x161')])){_0x2464ce[_0x082b('0x9b')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x2464ce,_0x2464ce[_0x082b('0x162')]))['then'](checkIsActive(_0x2464ce,_0x2464ce[_0x082b('0x161')]))[_0x082b('0xaf')](checkInterval(_0x2464ce))[_0x082b('0xaf')](_0x4d364f[_0x082b('0x13c')](_0x2464ce))[_0x082b('0xaf')](_0x4d364f['checkIfTime'](_0x2464ce['dialGlobalInterval'],_0x2464ce[_0x082b('0x163')],_0x2464ce[_0x082b('0x3b')],_0x2464ce))[_0x082b('0xaf')](_0x4d364f[_0x082b('0x142')](_0x2464ce[_0x082b('0x40')],_0x2464ce[_0x082b('0x163')],_0x2464ce[_0x082b('0x3b')],_0x2464ce))[_0x082b('0xaf')](_0x4d364f[_0x082b('0x157')](_0x2464ce))[_0x082b('0xaa')](loggerCatchQueueSummary(_0x082b('0x164'),_0x2464ce));}else{notSendMessagesQueue(_0x2464ce);}}else{freeVariablesPredictive(_0x2464ce);}};Dialer[_0x082b('0x1b')][_0x082b('0x13b')]=function(){var _0x21390c=this;var _0x51b14e;for(var _0x2371f7 in this[_0x082b('0x1f')]){if(typeof this['campaigns'][_0x2371f7]!==_0x082b('0x95')){_0x51b14e=this['campaigns'][_0x2371f7];if(isCampaignIvr(_0x51b14e[_0x082b('0x4a')])&&isActive(_0x51b14e[_0x082b('0x77')])){_0x51b14e[_0x082b('0x9b')]=!![];BPromise[_0x082b('0xb1')]()[_0x082b('0xaf')](checkIsActive(_0x51b14e,_0x51b14e[_0x082b('0x77')]))[_0x082b('0xaf')](checkInterval(_0x51b14e))[_0x082b('0xaf')](_0x21390c[_0x082b('0x13c')](_0x51b14e))['then'](_0x21390c[_0x082b('0x141')](_0x51b14e[_0x082b('0x165')],_0x51b14e['dialTimezone'],_0x51b14e[_0x082b('0x3b')],_0x51b14e))['then'](_0x21390c['checkIfTimeIntervals'](_0x51b14e['Interval'],_0x51b14e[_0x082b('0x163')],_0x51b14e[_0x082b('0x3b')],_0x51b14e))[_0x082b('0xaf')](_0x21390c[_0x082b('0x15f')](_0x51b14e))[_0x082b('0xaa')](loggerCatchQueueSummary(_0x082b('0x166'),_0x51b14e));}else{notSendMessagesCampaign(_0x51b14e);}}}};function getCallerIdRandom(_0x1c4cf7,_0x2bceaf){var _0x1f6627;var _0x1fcd7b;var _0x1f0343;if(_0x2bceaf<=0x0){_0x2bceaf=0x1;}_0x1f6627=new RegExp(_0x082b('0x167')+_0x2bceaf+'}$');_0x1fcd7b=Math['pow'](0xa,_0x2bceaf-0x1);_0x1f0343=Math['pow'](0xa,_0x2bceaf)-0x1;return util[_0x082b('0x78')]('%s',_['replace'](_0x1c4cf7,_0x1f6627,_[_0x082b('0x168')](_0x1fcd7b,_0x1f0343)));}function extractCalleridName(_0x15c5db){var _0x2abfc4=_0x15c5db[_0x082b('0x169')](/"(.*?)"/);return _0x2abfc4?_0x2abfc4[0x1]:_0x15c5db;}function extractCalleridNumber(_0x31735b){var _0x1d9056=_0x31735b[_0x082b('0x169')](/<(.*?)>/);return _0x1d9056?_0x1d9056[0x1]:_0x31735b;}Dialer['prototype'][_0x082b('0x16a')]=function(_0x42d900,_0x5b1c14){var _0x24def2=this;var _0x41d5e1=uuid['v4']();this[_0x082b('0x24')][_0x41d5e1]=new Action(_0x42d900,_0x5b1c14,_0x41d5e1);return new BPromise(function(_0x1b7106,_0x945688){if(_[_0x082b('0x38')](_0x42d900)&&typeof _0x42d900!==_0x082b('0x16b')){return _0x945688(msgResponse('originate',_0x082b('0x154'),_0x082b('0x16c')));}if(_['isUndefined'](_0x5b1c14[_0x082b('0x16d')][_0x082b('0x16e')])||_0x5b1c14['Contact'][_0x082b('0x16e')]===null){return _0x945688(msgResponse(_0x082b('0x16f'),_0x082b('0x154'),'contact\x20is\x20undefine'));}var _0x2111c3={'XMD-CALLERID':_0x24def2[_0x082b('0x24')][_0x41d5e1][_0x082b('0x170')](),'XMD-AGI':_0x42d900['dialQueueProject']?util[_0x082b('0x78')](_0x082b('0x171'),ipAgi,_0x42d900['dialQueueProject']):_0x082b('0x172'),'XMD-AGIAFTER':_0x42d900[_0x082b('0x107')]?util[_0x082b('0x78')](_0x082b('0x171'),ipAgi,_0x42d900['dialQueueProject2']):'NONE','XMD-QUEUE':_0x42d900[_0x082b('0x4a')]===_0x082b('0x4b')?util['format'](_0x082b('0x173'),_0x42d900[_0x082b('0x3b')],_0x42d900['dialQueueOptions']||'',_0x42d900[_0x082b('0x108')]?'c':'',_0x42d900[_0x082b('0x111')]||0x3):_0x082b('0x172'),'XMD-CONTACTID':_0x5b1c14['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x24def2[_0x082b('0x24')][_0x41d5e1][_0x082b('0x170')](),'XMD-AMD':_0x42d900['dialAMDActive']?'ACTIVE':_0x082b('0x172'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x42d900['dialAMDActive']){_0x2111c3['XMD-AMDINITIALSILENCE']=_0x42d900[_0x082b('0x174')]||0x9c4;_0x2111c3[_0x082b('0x175')]=_0x42d900[_0x082b('0x176')]||0x5dc;_0x2111c3['XMD-AMDAFTERGREETINGSILENCE']=_0x42d900[_0x082b('0x177')]||0x320;_0x2111c3[_0x082b('0x178')]=_0x42d900[_0x082b('0x179')]||0x1388;_0x2111c3[_0x082b('0x17a')]=_0x42d900[_0x082b('0x17b')]||0x64;_0x2111c3[_0x082b('0x17c')]=_0x42d900['dialAMDBetweenWordsSilence']||0x32;_0x2111c3[_0x082b('0x17d')]=_0x42d900['dialAMDMaximumNumberOfWords']||0x3;_0x2111c3[_0x082b('0x17e')]=_0x42d900[_0x082b('0x17f')]||0x100;_0x2111c3[_0x082b('0x180')]=_0x42d900[_0x082b('0x181')]||0x1388;}if(_0x42d900[_0x082b('0x4a')]===_0x082b('0x4b')){_0x2111c3[_0x082b('0x182')]=_0x5b1c14[_0x082b('0xcd')];}else{_0x2111c3[_0x082b('0x183')]=_0x5b1c14[_0x082b('0xce')];}for(var _0x3bd10e in _0x5b1c14[_0x082b('0x16d')]){if(typeof _0x5b1c14[_0x082b('0x16d')][_0x3bd10e]!==_0x082b('0x95')){if(isNotNull(_0x5b1c14['Contact'][_0x3bd10e])&&_0x3bd10e!=='id'&&_0x3bd10e!==_0x082b('0x184')&&_0x3bd10e!==_0x082b('0x185')&&_0x3bd10e!==_0x082b('0x186')){_0x2111c3[util[_0x082b('0x78')]('%s%s',_0x082b('0x187'),_[_0x082b('0x188')](_0x3bd10e))]=_0x5b1c14[_0x082b('0x16d')][_0x3bd10e];}}}var _0x1066ad=_0x24def2[_0x082b('0x13d')](_0x42d900['Trunk'])?getCallerId(_0x42d900['Trunk']['callerid'],_0x42d900[_0x082b('0x58')],_0x42d900[_0x082b('0x189')]>0x0?getCallerIdRandom(_0x42d900[_0x082b('0x59')],_0x42d900[_0x082b('0x189')]):_0x42d900['dialOriginateCallerIdNumber']):getCallerId(_[_0x082b('0xa8')](_0x42d900[_0x082b('0x13e')])?_0x42d900[_0x082b('0x76')][_0x082b('0x18a')]:_0x42d900[_0x082b('0x13e')]['callerid'],_0x42d900[_0x082b('0x58')],_0x42d900['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x42d900[_0x082b('0x59')],_0x42d900[_0x082b('0x189')]):_0x42d900['dialOriginateCallerIdNumber']);if(_0x1066ad){_0x2111c3[_0x082b('0x18b')]=_0x24def2[_0x082b('0x24')][_0x41d5e1][_0x082b('0x18c')]=extractCalleridName(_0x1066ad);_0x2111c3[_0x082b('0x18d')]=_0x24def2['actions'][_0x41d5e1]['originatecalleridnum']=extractCalleridNumber(_0x1066ad);}return ami[_0x082b('0x149')]({'actionid':_0x41d5e1,'action':_0x082b('0x16f'),'channel':_0x24def2[_0x082b('0x13d')](_0x42d900['Trunk'])?util[_0x082b('0x78')]('SIP/%s/%s%s',_0x42d900[_0x082b('0x76')][_0x082b('0x3b')],isNotNull(_0x42d900[_0x082b('0x5b')])?_0x42d900['dialPrefix']['trim']()||'':'',_0x42d900[_0x082b('0x18e')]>0x0?_0x5b1c14[_0x082b('0x16d')][_0x082b('0x16e')][_0x082b('0x18f')](_0x42d900[_0x082b('0x18e')]):_0x5b1c14[_0x082b('0x16d')]['phone']):util['format']('SIP/%s/%s%s',_['isNil'](_0x42d900[_0x082b('0x13e')])?_0x42d900[_0x082b('0x76')][_0x082b('0x3b')]:_0x42d900[_0x082b('0x13e')][_0x082b('0x3b')],isNotNull(_0x42d900['dialPrefix'])?_0x42d900[_0x082b('0x5b')]['trim']()||'':'',_0x42d900['dialCutDigit']>0x0?_0x5b1c14[_0x082b('0x16d')][_0x082b('0x16e')]['substring'](_0x42d900[_0x082b('0x18e')]):_0x5b1c14[_0x082b('0x16d')][_0x082b('0x16e')]),'callerid':_0x1066ad,'Exten':_0x082b('0xda'),'Context':_0x082b('0x190'),'Priority':'1','variable':_0x2111c3,'timeout':(_0x42d900['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x41d5e1})['then'](function(_0x579c7c){return _0x1b7106(_0x579c7c);})['catch'](function(_0x24b739){_0x42d900[_0x082b('0x64')]+=0x1;var _0x4735a8=new History(_0x24def2[_0x082b('0x24')][_0x41d5e1]);logger[_0x082b('0x91')](util[_0x082b('0x78')](_0x082b('0x191'),JSON['stringify'](_0x24b739)));_0x4735a8['state']=0xe;_0x4735a8[_0x082b('0xa1')]=_0x082b('0x192');_0x4735a8['starttime']=moment()[_0x082b('0x78')](_0x082b('0xf5'));_0x4735a8[_0x082b('0xa2')]=_0x4735a8[_0x082b('0xa3')];_0x24def2[_0x082b('0xc2')](_0x4735a8)[_0x082b('0xaa')](loggerCatch(_0x082b('0x193')));_0x24def2[_0x082b('0xc0')](_0x4735a8)[_0x082b('0xaa')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x24def2[_0x082b('0x24')][_0x41d5e1];return _0x945688(msgResponse(_0x082b('0x16f'),_0x082b('0x45'),_0x082b('0x194')));});});});};Dialer[_0x082b('0x1b')][_0x082b('0x2d')]=function(_0x77b27e){var _0x214f7f=this[_0x082b('0x24')][_0x77b27e[_0x082b('0x124')]];if(_0x214f7f){delete this[_0x082b('0x24')][_0x77b27e[_0x082b('0x124')]];_0x214f7f[_0x082b('0x110')]=moment()['format'](_0x082b('0xf5'));var _0x1e57c8=_0x214f7f[_0x082b('0x4a')]===_0x082b('0x7b')?this['campaigns'][_0x214f7f[_0x082b('0xac')]]:this[_0x082b('0x1e')][_0x214f7f['getQueue']()];if(!this[_0x082b('0xd1')](_0x77b27e[_0x082b('0x195')])){this[_0x082b('0xc4')](_0x1e57c8);return this['callProgressDetecting'](_0x214f7f,_0x1e57c8,_0x77b27e)[_0x082b('0xaa')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x082b('0x25')][_0x77b27e['uniqueid']]=_0x214f7f;}};Dialer[_0x082b('0x1b')][_0x082b('0x196')]=function(_0x23b81b,_0x20430c,_0x513730){var _0x9631b0=new History(_0x20430c);if(_0x9631b0['countbusyretry']+_0x9631b0[_0x082b('0xe9')]+_0x9631b0[_0x082b('0xfc')]+_0x9631b0[_0x082b('0xea')]+_0x9631b0[_0x082b('0xeb')]+_0x9631b0[_0x082b('0xec')]+_0x9631b0[_0x082b('0xed')]+_0x9631b0[_0x082b('0xee')]>=_0x513730[_0x082b('0xef')]-0x1){return!![];}switch(_0x23b81b){case 0x3:if(_0x9631b0[_0x082b('0xfc')]>=_0x513730[_0x082b('0x197')]-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countnoanswerretry':_0x9631b0['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x513730['dialNoAnswerRetryFrequency'],_0x082b('0xff'))[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0[_0x082b('0xcd')]||undefined,'CampaignId':_0x9631b0['CampaignId']||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x198')));break;case 0x5:if(_0x9631b0[_0x082b('0xe8')]>=_0x513730['dialBusyMaxRetry']-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countbusyretry':_0x9631b0[_0x082b('0xe8')]+=0x1,'scheduledat':moment()[_0x082b('0xfd')](_0x513730[_0x082b('0x199')],_0x082b('0xff'))[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0['ListId'],'VoiceQueueId':_0x9631b0['VoiceQueueId']||undefined,'CampaignId':_0x9631b0[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x19a')));break;case 0x8:if(_0x9631b0['countcongestionretry']>=_0x513730['dialCongestionMaxRetry']-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countcongestionretry':_0x9631b0[_0x082b('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x513730[_0x082b('0x19b')],_0x082b('0xff'))[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0x9631b0['ContactId'],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0['VoiceQueueId']||undefined,'CampaignId':_0x9631b0[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x9631b0[_0x082b('0xea')]>=_0x513730[_0x082b('0x19c')]-0x1){return!![];}else{this[_0x082b('0xf4')]({'active':![],'countnosuchnumberretry':_0x9631b0[_0x082b('0xea')]+=0x1,'scheduledat':moment()['add'](_0x513730[_0x082b('0x19d')],'minutes')['format'](_0x082b('0xf5')),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0[_0x082b('0xcd')]||undefined,'CampaignId':_0x9631b0[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x19e')));}break;case 0xa:if(_0x9631b0[_0x082b('0xeb')]>=_0x513730[_0x082b('0x117')]-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countdropretry':_0x9631b0[_0x082b('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x513730['dialDropRetryFrequency'],_0x082b('0xff'))['format'](_0x082b('0xf5')),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0['VoiceQueueId']||undefined,'CampaignId':_0x9631b0[_0x082b('0xce')]||undefined})['catch'](loggerCatch(_0x082b('0x119')));break;case 0xb:if(_0x9631b0[_0x082b('0xec')]>=_0x513730[_0x082b('0x19f')]-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countabandonedretry':_0x9631b0[_0x082b('0xec')]+=0x1,'scheduledat':moment()[_0x082b('0xfd')](_0x513730[_0x082b('0x11e')],_0x082b('0xff'))['format'](_0x082b('0xf5')),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0[_0x082b('0xcd')]||undefined,'CampaignId':_0x9631b0['CampaignId']||undefined})[_0x082b('0xaa')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x9631b0[_0x082b('0xed')]>=_0x513730[_0x082b('0xf1')]-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countmachineretry':_0x9631b0[_0x082b('0xed')]+=0x1,'scheduledat':moment()[_0x082b('0xfd')](_0x513730[_0x082b('0xfe')],'minutes')[_0x082b('0x78')](_0x082b('0xf5')),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0[_0x082b('0xcd')]||undefined,'CampaignId':_0x9631b0[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x9631b0[_0x082b('0xee')]>=_0x513730[_0x082b('0x1a0')]-0x1){return!![];}this[_0x082b('0xf4')]({'active':![],'countagentrejectretry':_0x9631b0['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x082b('0xfd')](_0x513730[_0x082b('0x1a1')],_0x082b('0xff'))[_0x082b('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9631b0[_0x082b('0xcb')],'ListId':_0x9631b0[_0x082b('0xf6')],'VoiceQueueId':_0x9631b0[_0x082b('0xcd')]||undefined,'CampaignId':_0x9631b0[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x1a2')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x59661d,_0x4c26ac,_0x32a039){var _0x6bbae5=this;var _0x210e4e=new History(_0x59661d);return new BPromise(function(_0x51d28e,_0x4da350){if(_[_0x082b('0x38')](_0x4c26ac)&&typeof _0x4c26ac!=='object'){return _0x4da350(msgResponse(_0x082b('0x1a3'),_0x082b('0x154'),_0x082b('0x1a4')));}if(_[_0x082b('0x38')](_0x32a039)&&typeof _0x32a039!==_0x082b('0x16b')){return _0x4da350(msgResponse(_0x082b('0x1a3'),'Failure','evt\x20is\x20undefine'));}switch(_0x32a039['reason']){case'0':_0x4c26ac[_0x082b('0x1a5')]+=0x1;_0x210e4e[_0x082b('0xa0')]=0x0;_0x210e4e[_0x082b('0xa1')]=_0x082b('0x1a6');_0x210e4e[_0x082b('0xea')]+=0x1;_0x210e4e[_0x082b('0xe5')]+=0x1;ami['emit'](_0x082b('0x1a7'),ut['buildObj'](_0x59661d,_0x082b('0x1a8')));_0x6bbae5['createHistory'](_0x210e4e)['catch'](loggerCatch(_0x082b('0xe7')));if(_0x6bbae5['checkRetriveMax'](0x0,_0x59661d,_0x4c26ac)){if(_0x210e4e['countnosuchnumberretry']>=_0x4c26ac[_0x082b('0x19c')]){_0x6bbae5[_0x082b('0xf2')](_0x210e4e,_0x51d28e,_0x4da350,'reason\x200\x20no\x20such\x20number....');}else{_0x6bbae5[_0x082b('0xf0')](_0x210e4e,_0x51d28e,_0x4da350,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4c26ac[_0x082b('0x63')]+=0x1;_0x210e4e[_0x082b('0xa0')]=0x3;_0x210e4e['statedesc']=_0x082b('0x1a9');_0x210e4e[_0x082b('0xfc')]+=0x1;_0x210e4e[_0x082b('0xe5')]+=0x1;ami[_0x082b('0x49')](_0x082b('0x1aa'),ut[_0x082b('0xe0')](_0x59661d,'noanswer'));_0x6bbae5[_0x082b('0xc2')](_0x210e4e)[_0x082b('0xaa')](loggerCatch(_0x082b('0x1ab')));if(_0x6bbae5[_0x082b('0x196')](0x3,_0x59661d,_0x4c26ac)){if(_0x210e4e[_0x082b('0xfc')]>=_0x4c26ac['dialNoAnswerMaxRetry']){_0x6bbae5[_0x082b('0xf2')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1ac'));}else{_0x6bbae5[_0x082b('0xf0')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1ac'));}}break;case'5':_0x4c26ac[_0x082b('0x5f')]+=0x1;_0x210e4e['state']=0x5;_0x210e4e['statedesc']='Busy';_0x210e4e[_0x082b('0xe8')]+=0x1;_0x210e4e['countglobal']+=0x1;ami['emit'](_0x082b('0x1ad'),ut['buildObj'](_0x59661d,_0x082b('0x1ae')));_0x6bbae5[_0x082b('0xc2')](_0x210e4e)[_0x082b('0xaa')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x6bbae5[_0x082b('0x196')](0x5,_0x59661d,_0x4c26ac)){if(_0x210e4e['countbusyretry']>=_0x4c26ac[_0x082b('0x1af')]){_0x6bbae5['createStateFinal'](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1b0'));}else{_0x6bbae5['stateGlobal'](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1b0'));}}break;case'8':_0x4c26ac[_0x082b('0x1b1')]+=0x1;_0x210e4e[_0x082b('0xa0')]=0x8;_0x210e4e[_0x082b('0xa1')]='Congestion';_0x210e4e[_0x082b('0xe9')]+=0x1;_0x210e4e[_0x082b('0xe5')]+=0x1;ami['emit'](_0x082b('0x1b2'),ut[_0x082b('0xe0')](_0x59661d,_0x082b('0x1b3')));_0x6bbae5[_0x082b('0xc2')](_0x210e4e)['catch'](loggerCatch(_0x082b('0x1b4')));if(_0x6bbae5[_0x082b('0x196')](0x8,_0x59661d,_0x4c26ac)){if(_0x210e4e[_0x082b('0xe9')]>=_0x4c26ac['dialCongestionMaxRetry']){_0x6bbae5[_0x082b('0xf2')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1b5'));}else{_0x6bbae5[_0x082b('0xf0')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1b5'));}}break;case'11':_0x4c26ac['outboundAbandonedCallsDay']+=0x1;_0x210e4e[_0x082b('0xa0')]=0xb;_0x210e4e[_0x082b('0xa1')]=_0x082b('0x11c');_0x210e4e[_0x082b('0xec')]+=0x1;_0x210e4e['countglobal']+=0x1;_0x6bbae5[_0x082b('0xc2')](_0x210e4e)[_0x082b('0xaa')](loggerCatch(_0x082b('0x121')));if(_0x6bbae5['checkRetriveMax'](0xb,_0x59661d,_0x4c26ac)){if(_0x210e4e[_0x082b('0xec')]>=_0x4c26ac['dialAbandonedMaxRetry']){_0x6bbae5[_0x082b('0xf2')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1b6'));}else{_0x6bbae5[_0x082b('0xf0')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1b6'));}}break;case'20':_0x4c26ac[_0x082b('0x66')]+=0x1;_0x210e4e[_0x082b('0xa0')]=0x14;_0x210e4e['statedesc']=_0x082b('0x1b7');_0x210e4e[_0x082b('0xee')]+=0x1;_0x210e4e[_0x082b('0xe5')]+=0x1;ami[_0x082b('0x49')](_0x082b('0x1b8'),ut[_0x082b('0xe0')](_0x59661d,_0x082b('0x1b9')));_0x6bbae5[_0x082b('0xc2')](_0x210e4e)[_0x082b('0xaa')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x6bbae5['checkRetriveMax'](0x14,_0x59661d,_0x4c26ac)){if(_0x210e4e[_0x082b('0xee')]>=_0x4c26ac[_0x082b('0x1a0')]){_0x6bbae5[_0x082b('0xf2')](_0x210e4e,_0x51d28e,_0x4da350,'reason\x2020\x20agentreject');}else{_0x6bbae5[_0x082b('0xf0')](_0x210e4e,_0x51d28e,_0x4da350,_0x082b('0x1ba'));}}break;default:_0x4c26ac['outboundUnknownCallsDay']+=0x1;_0x210e4e['state']=0xc;_0x210e4e['statedesc']=_0x32a039['reason'];_0x6bbae5[_0x082b('0xc2')](_0x210e4e)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x6bbae5['checkRetriveMax'](_0x32a039['reason'],_0x59661d,_0x4c26ac)){if(_0x210e4e[_0x082b('0xe8')]+_0x210e4e[_0x082b('0xe9')]+_0x210e4e[_0x082b('0xfc')]+_0x210e4e['countnosuchnumberretry']+_0x210e4e[_0x082b('0xeb')]+_0x210e4e[_0x082b('0xec')]+_0x210e4e[_0x082b('0xed')]+_0x210e4e['countagentrejectretry']>=_0x4c26ac[_0x082b('0xef')]){_0x6bbae5[_0x082b('0xf0')](_0x210e4e,_0x51d28e,_0x4da350,_0x32a039[_0x082b('0x1bb')]);}else{_0x6bbae5[_0x082b('0xf2')](_0x210e4e,_0x51d28e,_0x4da350,_0x32a039[_0x082b('0x1bb')]);}}}});};Dialer['prototype'][_0x082b('0xf0')]=function(_0x56fb65,_0x1b6029,_0x1f18b1,_0x1160b6){var _0x21e90e=new Final(_0x56fb65);_0x21e90e['state']=0xf;_0x21e90e['statedesc']=_0x082b('0x1bc');this[_0x082b('0xf2')](_0x21e90e,_0x1b6029,_0x1f18b1,_0x1160b6);};Dialer[_0x082b('0x1b')]['createStateFinal']=function(_0x37fe03,_0x581c9b,_0x4acba0,_0x5f333c){this[_0x082b('0xc0')](_0x37fe03)[_0x082b('0xaf')](function(){return _0x581c9b(msgResponse('[callProgressDetecting]',_0x082b('0xd2'),_0x5f333c));})[_0x082b('0xaa')](function(){return _0x4acba0(msgResponse('[moveContactManagedDialer][0]',_0x082b('0x154'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x082b('0x15c')]=function(_0x15a39a){var _0x194a71=_0x15a39a[_0x082b('0x1bd')]/0x64;var _0x1082cc=_0x15a39a[_0x082b('0x62')]/(_0x15a39a[_0x082b('0x62')]+_0x15a39a[_0x082b('0x5d')]);var _0x224a9f=Math['round'](_0x15a39a[_0x082b('0x70')]*(_0x15a39a[_0x082b('0x1be')]/0x64));var _0x3dba29=Math['round'](_0x15a39a[_0x082b('0x70')]*(_0x15a39a['predictiveIntervalMinThreshold']/0x64));var _0x539acc=_0x15a39a[_0x082b('0x4e')]+_0x15a39a[_0x082b('0x53')];var _0x10a478=Math['floor'](_0x15a39a[_0x082b('0x73')]*_0x15a39a['erlangAbandonmentRate']*_0x15a39a[_0x082b('0x6d')]*_0x15a39a[_0x082b('0x6e')]);if(_[_0x082b('0x38')](_0x15a39a[_0x082b('0x1bf')])){if(!_[_0x082b('0x38')](_0x15a39a[_0x082b('0x27')])){_0x15a39a[_0x082b('0x27')]=undefined;loggerPredictive[_0x082b('0x91')](_0x082b('0x1c0'),_0x082b('0x1c1'));}if(!_[_0x082b('0x38')](_0x15a39a[_0x082b('0x8d')])){loggerPredictive[_0x082b('0x91')](_0x082b('0x1c0'),_0x082b('0x1c2'));clearInterval(_0x15a39a[_0x082b('0x8d')]);_0x15a39a['handlePredictive']=undefined;}_0x15a39a[_0x082b('0x1bf')]=moment()[_0x082b('0x78')](_0x082b('0xf5'));loggerPredictive['info'](_0x15a39a[_0x082b('0x3b')],_0x082b('0x1c3'),_0x15a39a[_0x082b('0x1bf')]);this[_0x082b('0x159')](_0x15a39a,0x1);}else if(ifInterval(_0x15a39a['dialPredictiveInterval'],_0x15a39a[_0x082b('0x1bf')])){this[_0x082b('0x159')](_0x15a39a,0x1);loggerPredictiveCalls[_0x082b('0x7d')](_0x082b('0x1c4'),_0x15a39a[_0x082b('0x1bf')],_0x15a39a[_0x082b('0x3b')]);_0x15a39a['erlangCalls']=0x0;_0x15a39a[_0x082b('0x112')]=0x0;}else if(_0x194a71<_0x1082cc&&_0x15a39a[_0x082b('0x1c5')]===_0x082b('0x1c6')){freeVariablesPredictive(_0x15a39a);loggerPredictive[_0x082b('0x7d')](_0x082b('0x1c7'),_0x082b('0x1c8'),_0x1082cc,_0x082b('0x1bf'),_0x15a39a['name']);}else if(_0x10a478<_0x15a39a[_0x082b('0x112')]&&_0x15a39a[_0x082b('0x1c5')]===_0x082b('0x1c6')){freeVariablesPredictive(_0x15a39a);loggerPredictive[_0x082b('0x7d')](_0x082b('0x1c9'),_0x082b('0x1ca'),_0x10a478,_0x082b('0x1cb'),_0x15a39a['predictiveIntervalErlangCallsDroppedCalls'],_0x082b('0x1bf'),_0x15a39a[_0x082b('0x3b')]);}else if(!ifInterval(_0x15a39a[_0x082b('0x1cc')],_0x15a39a[_0x082b('0x1bf')])&&_['isUndefined'](_0x15a39a[_0x082b('0x27')])&&!_[_0x082b('0x38')](_0x15a39a[_0x082b('0x1bf')])){_0x15a39a['startPredictive']=moment()[_0x082b('0x78')](_0x082b('0xf5'));loggerPredictive[_0x082b('0x7d')](_0x15a39a[_0x082b('0x3b')],_0x082b('0x1cd'),_0x15a39a['startPredictive']);this['averageHandleTime'](_0x15a39a[_0x082b('0x1cc')])[_0x082b('0xaf')](this[_0x082b('0x1ce')](_0x15a39a))[_0x082b('0xaf')](mergeDataErlangB(_0x15a39a))[_0x082b('0xaf')](this['startMethodPredictive'](_0x15a39a))[_0x082b('0xaa')](loggerCatchPredictive(_0x082b('0x1cf'),_0x15a39a));}else if(!ifInterval(_0x15a39a[_0x082b('0x1cc')],_0x15a39a[_0x082b('0x27')])){_0x15a39a[_0x082b('0x112')]=0x0;_0x15a39a['startPredictive']=moment()[_0x082b('0x78')](_0x082b('0xf5'));loggerPredictive['info'](_0x15a39a['name'],_0x082b('0x1d0'),_0x15a39a[_0x082b('0x27')]);clearInterval(_0x15a39a[_0x082b('0x8d')]);_0x15a39a[_0x082b('0x8d')]=undefined;this['averageHandleTime'](_0x15a39a[_0x082b('0x1cc')])[_0x082b('0xaf')](this[_0x082b('0x1ce')](_0x15a39a))['then'](mergeDataErlangB(_0x15a39a))[_0x082b('0xaf')](this[_0x082b('0x1d1')](_0x15a39a))['catch'](loggerCatchPredictive(_0x082b('0x1d2'),_0x15a39a));}else if(_0x15a39a[_0x082b('0x70')]&&_0x539acc<_0x15a39a[_0x082b('0x70')]-_0x3dba29){freeVariablesPredictive(_0x15a39a);loggerPredictive['info'](_0x15a39a['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x539acc,_0x082b('0x1d3'),_0x15a39a[_0x082b('0x70')],'-',_0x3dba29,'=',_0x15a39a[_0x082b('0x70')]-_0x3dba29,')');}else if(_0x15a39a[_0x082b('0x70')]&&_0x539acc>_0x15a39a['predictiveIntervalAvailable']+_0x224a9f){freeVariablesPredictive(_0x15a39a);loggerPredictive['info'](_0x15a39a[_0x082b('0x3b')],_0x082b('0x1d4'),_0x539acc,')\x20are\x20more\x20than\x20threshold\x20(',_0x15a39a['predictiveIntervalAvailable'],'+',_0x224a9f,'=',_0x15a39a[_0x082b('0x70')]+_0x224a9f,')');}};Dialer[_0x082b('0x1b')][_0x082b('0x1ce')]=function(_0x397b5c){var _0x476777=this;return function(_0x33e36a){return new BPromise(function(_0x23a394,_0x229db8){_[_0x082b('0x89')](_0x397b5c,_0x33e36a[0x0]);if(checkGetDataPredictive(_0x33e36a[0x0])){var _0x285079=_0x397b5c[_0x082b('0x70')]=_0x397b5c['talking']+_0x397b5c['available'];var _0x2f016c=_0x397b5c[_0x082b('0x1cc')]*0x3c;var _0xc82ab6=_0x33e36a[0x0][_0x082b('0x69')]+_0x33e36a[0x0][_0x082b('0x68')];var _0x5e4d5b=(_0x33e36a[0x0][_0x082b('0x67')]+_0x33e36a[0x0][_0x082b('0x6b')]+_0x33e36a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x33e36a[0x0]['predictiveIntervalTotalCalls'];_0x397b5c['predictiveIntervalHitRate']=_0x5e4d5b>0x0?_0x5e4d5b:0x1;switch(_0x397b5c[_0x082b('0x1c5')]){case'dropRate':var _0x14defc=_0x397b5c[_0x082b('0x1bd')]/0x64;return _0x476777[_0x082b('0x1d5')](_0x285079,_0x2f016c,_0xc82ab6,_0x5e4d5b,_0x14defc)[_0x082b('0xaf')](function(_0x516fe1){return _0x23a394(_0x516fe1);});case _0x082b('0x1d6'):var _0x5c1363=_0x397b5c['dialPredictiveOptimizationPercentage']/0x64;return _0x476777[_0x082b('0x1d7')](_0x285079,_0x2f016c,_0xc82ab6,_0x5e4d5b,_0x5c1363)[_0x082b('0xaf')](function(_0x26a974){return _0x23a394(_0x26a974);});default:return _0x229db8(msgResponse(_0x082b('0x1d8'),_0x082b('0x154'),_0x082b('0x1d9')));}}else{return _0x229db8(msgResponse(_0x082b('0x1d8'),'Failure','check\x20failure'));}});};};Dialer[_0x082b('0x1b')][_0x082b('0x1da')]=function(_0x3ade6f){var _0x1f7a22=this;return function(_0x13fb54){return new BPromise(function(_0x1b9465,_0x9d08fb){_[_0x082b('0x89')](_0x3ade6f,_0x13fb54[0x0]);if(checkGetDataPredictive(_0x13fb54[0x0])){loggerPredictive[_0x082b('0x7d')](JSON[_0x082b('0x46')](_0x13fb54[0x0]));if(_0x3ade6f['dialPredictiveOptimization']===_0x082b('0x1c6')){return _0x1f7a22[_0x082b('0xbf')](_0x3ade6f['id'])[_0x082b('0xaf')](function(_0x276330){var _0x2c644c=_0x3ade6f['loggedIn']-_0x276330[0x0]['outboundQueuePauses'];var _0x5e2c2e=_0x3ade6f['dialPredictiveInterval']*0x3c;var _0x5bed84=_0x13fb54[0x0][_0x082b('0x69')]+_0x13fb54[0x0][_0x082b('0x68')];var _0x1263ce=(_0x13fb54[0x0]['predictiveIntervalAnsweredCalls']+_0x13fb54[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x13fb54[0x0][_0x082b('0x6a')])/_0x13fb54[0x0][_0x082b('0x71')];var _0x2f603c=_0x3ade6f[_0x082b('0x1bd')]/0x64;_0x3ade6f[_0x082b('0x6f')]=_0x276330[0x0][_0x082b('0x1db')]||0x0;_0x3ade6f['predictiveIntervalHitRate']=_0x1263ce>0x0?_0x1263ce:0x1;return _0x1f7a22[_0x082b('0x1d5')](_0x2c644c,_0x5e2c2e,_0x5bed84,_0x1263ce,_0x2f603c);})[_0x082b('0xaf')](function(_0x16da92){return _0x1b9465(_0x16da92);})[_0x082b('0xaa')](function(_0x32db70){return _0x9d08fb(msgResponse(_0x082b('0x1dc'),'Failure',JSON[_0x082b('0x46')](_0x32db70)));});}if(_0x3ade6f['dialPredictiveOptimization']===_0x082b('0x1d6')){return _0x1f7a22['getVoiceQueueRtPauses'](_0x3ade6f['id'])[_0x082b('0xaf')](function(_0x26c8a1){var _0x692a69=_0x3ade6f[_0x082b('0x162')]-_0x26c8a1[0x0][_0x082b('0x1db')];var _0x804aab=_0x3ade6f[_0x082b('0x1cc')]*0x3c;var _0x3585e4=_0x13fb54[0x0][_0x082b('0x69')]+_0x13fb54[0x0][_0x082b('0x68')];var _0x41b90d=(_0x13fb54[0x0][_0x082b('0x67')]+_0x13fb54[0x0][_0x082b('0x6b')]+_0x13fb54[0x0][_0x082b('0x6a')])/_0x13fb54[0x0]['predictiveIntervalTotalCalls'];var _0x3c6717=_0x3ade6f[_0x082b('0x1bd')]/0x64;_0x3ade6f[_0x082b('0x6f')]=_0x26c8a1[0x0][_0x082b('0x1db')]||0x0;_0x3ade6f['predictiveIntervalHitRate']=_0x41b90d>0x0?_0x41b90d:0x1;return _0x1f7a22[_0x082b('0x1d7')](_0x692a69,_0x804aab,_0x3585e4,_0x41b90d,_0x3c6717);})['then'](function(_0x10986e){return _0x1b9465(_0x10986e);})[_0x082b('0xaa')](function(_0x520c45){return _0x9d08fb(msgResponse(_0x082b('0x1dc'),'Failure',JSON['stringify'](_0x520c45)));});}}else{return _0x9d08fb(msgResponse(_0x082b('0x1d8'),'Failure','check\x20failure'));}});};};Dialer[_0x082b('0x1b')][_0x082b('0x1d1')]=function(_0x175055){var _0xc3090c=this;return function(){var _0x41388e=0x0;var _0x471444=Math['floor'](_0x175055[_0x082b('0x86')]*0x3e8);if(_0x471444>0x0){_0x471444=_0x471444<0x64?0x64:_0x471444;loggerPredictive[_0x082b('0x7d')](_0x175055[_0x082b('0x3b')],_0x082b('0x1dd'),_0x471444,_0x082b('0x47'));_0x175055[_0x082b('0x8d')]=setInterval(function(){_0xc3090c[_0x082b('0x8d')](_0x175055);loggerPredictiveCalls[_0x082b('0x7d')](_0x082b('0x1de'),_0x41388e+=0x1);},_0x471444);}else{loggerPredictive[_0x082b('0x7d')](_0x175055[_0x082b('0x3b')],_0x082b('0x1df'));}};};Dialer[_0x082b('0x1b')][_0x082b('0x1e0')]=function(_0x5debec,_0x4b063c){var _0x5a3a0b=this;return function(_0x53c359){if(_[_0x082b('0x43')](_0x53c359)){if(_[_0x082b('0xa8')](_0x4b063c[_0x082b('0xcc')])||!_0x4b063c[_0x082b('0x1e1')]){if(_0x5debec[_0x082b('0x57')]===_0x082b('0x9')){_0x5debec[_0x082b('0x129')]=_['isUndefined'](_0x5debec[_0x082b('0x129')])?!![]:_0x5debec[_0x082b('0x129')];var _0x2fe1c7=uuid['v4']();_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7]=new Action(_0x5debec,_0x4b063c,_0x2fe1c7);loggerBooked['info'](_0x082b('0x1e2'),_0x2fe1c7,_0x082b('0x1e3'),JSON['stringify'](_0x5debec[_0x082b('0x129')]),_0x082b('0x1e4'),_0x5debec[_0x082b('0x3b')]);if(_0x5debec[_0x082b('0x129')]){_0x5debec[_0x082b('0x129')]=![];_0x5a3a0b[_0x082b('0x29')][_0x5a3a0b['actions'][_0x2fe1c7][_0x082b('0xac')]]=[];ami[_0x082b('0x149')]({'actionid':_0x2fe1c7,'action':'queuestatus','queue':_0x5debec[_0x082b('0x3b')]})[_0x082b('0xaa')](function(){_0x5a3a0b[_0x082b('0xc4')](_0x5debec);_0x5a3a0b['rescheduleContact']({'active':![],'ContactId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7]['ContactId'],'ListId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7][_0x082b('0xf6')],'VoiceQueueId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7]['VoiceQueueId']||undefined,'CampaignId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7][_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x1e5')));delete _0x5a3a0b[_0x082b('0x24')][_0x2fe1c7];});}else{loggerBooked['info'](_0x082b('0x1e6'),JSON[_0x082b('0x46')](_0x5debec[_0x082b('0x129')]),_0x082b('0x1e4'),_0x5debec[_0x082b('0x3b')]);_0x5a3a0b[_0x082b('0xc4')](_0x5debec);_0x5a3a0b['rescheduleContact']({'active':![],'ContactId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7][_0x082b('0xcb')],'ListId':_0x5a3a0b['actions'][_0x2fe1c7][_0x082b('0xf6')],'VoiceQueueId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7]['VoiceQueueId']||undefined,'CampaignId':_0x5a3a0b[_0x082b('0x24')][_0x2fe1c7]['CampaignId']||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x1e5')));delete _0x5a3a0b['actions'][_0x2fe1c7];}}else{return _0x5a3a0b[_0x082b('0x16a')](_0x5debec,_0x4b063c);}}else{if(getDiff(_0x4b063c[_0x082b('0x1e7')])<_0x5debec[_0x082b('0x1e8')]*0x3c){if(_0x4b063c[_0x082b('0x1e9')]&&!_0x4b063c[_0x082b('0x1e9')][_0x082b('0x1ea')]){_0x5a3a0b[_0x082b('0x1d')]['run'](_0x4b063c['id'])[_0x082b('0x12e')](function(){_0x5a3a0b[_0x082b('0xc4')](_0x5debec);});}else{_0x5a3a0b[_0x082b('0xb8')]({'active':![]},_0x4b063c['id'],0x1)[_0x082b('0x12e')](function(){_0x5a3a0b[_0x082b('0xc4')](_0x5debec);});}}else{_0x5debec['outboundReCallsDay']+=0x1;_0x5a3a0b[_0x082b('0xc4')](_0x5debec);if(_0x5debec[_0x082b('0x1eb')]){_0x5a3a0b[_0x082b('0xf4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b063c[_0x082b('0xcb')],'ListId':_0x4b063c[_0x082b('0xf6')],'VoiceQueueId':_0x4b063c[_0x082b('0xcd')]||undefined,'CampaignId':_0x4b063c[_0x082b('0xce')]||undefined})[_0x082b('0xaa')](loggerCatch(_0x082b('0x1ec')));_0x5a3a0b[_0x082b('0xc2')](createObjHistory(_0x5debec,_0x4b063c,_0x082b('0x1ed'),0x17,_0x082b('0x1ee')))[_0x082b('0xaa')](loggerCatch(_0x082b('0x1ef')));}else{_0x5a3a0b[_0x082b('0xc9')](createObjHistory(_0x5debec,_0x4b063c,'RECALLFAILEDTIMEOUT',0x16,_0x082b('0x1f0')),_0x082b('0x1f1'),_0x082b('0x1f2'));}}}}else{_0x5debec[_0x082b('0x5e')]+=0x1;_0x5a3a0b[_0x082b('0xc9')](createObjHistory(_0x5debec,_0x4b063c,_0x082b('0x1f3'),0xd,_0x082b('0x1f4')),_0x082b('0x1f5'),_0x082b('0x1f6'));throw _0x082b('0x1f7');}};};Dialer[_0x082b('0x1b')][_0x082b('0x160')]=function(_0x11d5c1){var _0xf52370=this;var _0x146bb3=_0x11d5c1[_0x082b('0x1f8')]-_0x11d5c1[_0x082b('0x72')]-_0x11d5c1[_0x082b('0xbb')];emitCampaignSummary(_0x11d5c1);if(_0x146bb3>0x0){if(_0x146bb3>this[_0x082b('0x22')]){_0x146bb3=this[_0x082b('0x22')];}_0x11d5c1[_0x082b('0xbb')]+=_0x146bb3;this[_0x082b('0xbd')](_0x11d5c1['id'],_0x146bb3,_0x11d5c1['dialOrderByScheduledAt'],_0x11d5c1)[_0x082b('0xaf')](function(_0x172f72){_0x11d5c1[_0x082b('0xbb')]-=_0x146bb3;_0x11d5c1[_0x082b('0xbb')]=_0x11d5c1['temp']>0x0?_0x11d5c1[_0x082b('0xbb')]:0x0;if(!checkContactEmpty(_0x172f72)){_0x11d5c1[_0x082b('0x39')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x082b('0x1f9')+_0x11d5c1[_0x082b('0x3b')]);}else{_0x11d5c1[_0x082b('0x72')]+=_0x172f72[_0x082b('0x94')];_0x11d5c1[_0x082b('0x39')]=_0x082b('0x1fa');for(var _0x4807f0=0x0;_0x4807f0<_0x172f72[_0x082b('0x94')];_0x4807f0+=0x1){_0x11d5c1[_0x082b('0x1fb')]+=0x1;if(_[_0x082b('0xa8')](_0x172f72[_0x4807f0])||_[_0x082b('0xa8')](_0x172f72[_0x4807f0][_0x082b('0x16d')])||_['isNil'](_0x172f72[_0x4807f0][_0x082b('0x16d')][_0x082b('0x16e')])){_0xf52370[_0x082b('0xc7')](_0x082b('0x1fc'),_0x11d5c1,_0x172f72[_0x4807f0]);}else{_0xf52370[_0x082b('0xb2')](_['pick'](_0x172f72[_0x4807f0],[_0x082b('0xce'),_0x082b('0x1fd')]))[_0x082b('0xaf')](_0xf52370['checkContactBlack'](_0x11d5c1,_0x172f72[_0x4807f0]))[_0x082b('0xaa')](_0xf52370['loggerHandler'](_0x082b('0x1fe'),_0x11d5c1));}}}})[_0x082b('0xaa')](loggerGetContactDialer(_0x082b('0x1ff'),_0x11d5c1,_0x146bb3));}};Dialer['prototype']['handlePower']=function(_0x4127a1,_0x58470e){var _0x33e5c6=this;var _0x12b32f=[];var _0x58d748=_0x58470e>=0x1?_0x58470e:0x1;if(_0x4127a1[_0x082b('0x57')]===_0x082b('0x9')){_0x58d748=0x1;}var _0x29e918=Math[_0x082b('0x200')](_0x4127a1[_0x082b('0x4e')]*_0x58d748)-_0x4127a1['originated']-_0x4127a1['temp'];emitVoiceQueueSummary(_0x4127a1);if(_0x4127a1['dialLimitQueue']>0x0){var _0x5b3888=_0x4127a1[_0x082b('0x201')]-_0x4127a1['originated']-_0x4127a1['talking']-_0x4127a1[_0x082b('0xbb')]-_0x4127a1[_0x082b('0x4f')];if(_0x29e918>_0x5b3888){_0x29e918=_0x5b3888;}}if(_0x29e918>0x0){if(_0x4127a1['dialMethod']===_0x082b('0x9')){_0x29e918=0x1;}if(_0x29e918>this[_0x082b('0x22')]){_0x29e918=this[_0x082b('0x22')];}_0x4127a1[_0x082b('0xbb')]+=_0x29e918;for(var _0x10c9e7 in this[_0x082b('0x20')]){if(typeof this[_0x082b('0x20')][_0x10c9e7]!=='undefined'){if(this[_0x082b('0x20')][_0x10c9e7][_0x082b('0xa0')]===_0x082b('0x202')&&this['agents'][_0x10c9e7][_0x082b('0xa9')]==='reachable'){_0x12b32f[_0x082b('0x128')](this[_0x082b('0x20')][_0x10c9e7]['id']);}}}this[_0x082b('0xba')](_0x4127a1['id'],_0x12b32f,_0x29e918,_0x4127a1['dialOrderByScheduledAt'],_0x4127a1)[_0x082b('0xaf')](function(_0x3ba19e){_0x4127a1[_0x082b('0xbb')]-=_0x29e918;_0x4127a1[_0x082b('0xbb')]=_0x4127a1[_0x082b('0xbb')]>0x0?_0x4127a1['temp']:0x0;if(!checkContactEmpty(_0x3ba19e)){_0x33e5c6['countReScheduled'](_0x4127a1)[_0x082b('0xaf')](sendMessageReschedule(_0x4127a1))[_0x082b('0xaa')](loggerCatch('[countReScheduled]\x20'));}else{_0x4127a1[_0x082b('0x72')]+=_0x3ba19e['length'];_0x4127a1[_0x082b('0x39')]=_0x4127a1['dialMethod']==='booked'?'ACTIVE':_0x082b('0x1fa');for(var _0x5ea933=0x0;_0x5ea933<_0x3ba19e[_0x082b('0x94')];_0x5ea933+=0x1){if(_[_0x082b('0xa8')](_0x3ba19e[_0x5ea933])||_[_0x082b('0xa8')](_0x3ba19e[_0x5ea933]['Contact'])||_[_0x082b('0xa8')](_0x3ba19e[_0x5ea933][_0x082b('0x16d')][_0x082b('0x16e')])){_0x33e5c6[_0x082b('0xc7')](_0x082b('0x1fc'),_0x4127a1,_0x3ba19e[_0x5ea933]);}else{_0x33e5c6[_0x082b('0xb0')](_[_0x082b('0xca')](_0x3ba19e[_0x5ea933],[_0x082b('0xcd'),'Contact.phone']))[_0x082b('0xaf')](_0x33e5c6[_0x082b('0x1e0')](_0x4127a1,_0x3ba19e[_0x5ea933]))[_0x082b('0xaa')](_0x33e5c6[_0x082b('0xc6')]('[actionOriginate]\x20',_0x4127a1));}}}})[_0x082b('0xaa')](loggerGetContactDialer('[getContactDialer2]',_0x4127a1,_0x29e918));}};Dialer[_0x082b('0x1b')][_0x082b('0x8d')]=function(_0x489de0){if(_0x489de0['dialLimitQueue']>0x0){var _0xea449=_0x489de0['dialLimitQueue']-_0x489de0[_0x082b('0x72')]-_0x489de0['talking'];if(_0xea449>0x0){this[_0x082b('0x203')](_0x489de0);}else{loggerPredictiveCalls[_0x082b('0x7d')](_0x082b('0x204'));}}else{this['tryOriginatePredictive'](_0x489de0);}};Dialer[_0x082b('0x1b')][_0x082b('0x203')]=function(_0x3a902f){var _0x186c59=this;var _0x209bb1=[];_0x3a902f[_0x082b('0x72')]+=0x1;for(var _0x54ac70 in this['agents']){if(typeof this['agents'][_0x54ac70]!==_0x082b('0x95')){if(this[_0x082b('0x20')][_0x54ac70]['state']===_0x082b('0x202')&&this[_0x082b('0x20')][_0x54ac70][_0x082b('0xa9')]===_0x082b('0xd4')){_0x209bb1['push'](this['agents'][_0x54ac70]['id']);}}}this['getContactDialer'](_0x3a902f['id'],_0x209bb1,0x1,_0x3a902f[_0x082b('0x205')],_0x3a902f)[_0x082b('0xaf')](function(_0x297cb9){if(!checkContactEmpty(_0x297cb9)){checkContactLowerLimitOriginate(_0x3a902f,0x1,0x0);_0x186c59['countReScheduled'](_0x3a902f)[_0x082b('0xaf')](sendMessageReschedule(_0x3a902f))['catch'](loggerCatch(_0x082b('0x206')));}else{_0x3a902f['message']=_0x082b('0x1fa');if(_['isNil'](_0x297cb9[0x0])||_['isNil'](_0x297cb9[0x0][_0x082b('0x16d')])||_[_0x082b('0xa8')](_0x297cb9[0x0][_0x082b('0x16d')][_0x082b('0x16e')])){_0x186c59[_0x082b('0xc7')](_0x082b('0x1fc'),_0x3a902f,_0x297cb9[0x0]);}else{_0x186c59[_0x082b('0xb0')](_[_0x082b('0xca')](_0x297cb9[0x0],[_0x082b('0xcd'),'Contact.phone']))['then'](_0x186c59[_0x082b('0x1e0')](_0x3a902f,_0x297cb9[0x0]))[_0x082b('0xaa')](_0x186c59[_0x082b('0xc6')](_0x082b('0x207'),_0x3a902f));}}})[_0x082b('0xaa')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3a902f,0x1));emitVoiceQueueSummary(_0x3a902f);};Dialer[_0x082b('0x1b')]['abandonmentRate']=function(_0x464f11,_0x38f0a0,_0x4cfd8a,_0x2bf2db,_0xa0cd89,_0x9a7c21){loggerPredictive[_0x082b('0x7d')](_0x082b('0x208'));loggerPredictive['info'](_0x082b('0x209'),_0x464f11);loggerPredictive[_0x082b('0x7d')](_0x082b('0x20a'),_0x38f0a0);loggerPredictive[_0x082b('0x7d')](_0x082b('0x20b'),_0x4cfd8a);loggerPredictive['info'](_0x082b('0x20c'),_0x2bf2db);loggerPredictive['info'](_0x082b('0x20d'),_0xa0cd89);loggerPredictive[_0x082b('0x7d')](_0x082b('0x20e'));return new BPromise(function(_0x241575,_0x46d142){if(_0x464f11<=0x0||isNaN(_0x464f11)){return _0x46d142(msgResponse(_0x082b('0x20f'),_0x082b('0x45'),_0x082b('0x210')+_0x464f11));}if(_0x4cfd8a<=0x0||isNaN(_0x4cfd8a)){return _0x46d142(msgResponse(_0x082b('0x20f'),_0x082b('0x45'),_0x082b('0x211')+_0x4cfd8a));}if(_0x2bf2db<=0x0||isNaN(_0x2bf2db)){return _0x46d142(msgResponse(_0x082b('0x20f'),_0x082b('0x45'),_0x082b('0x212')+_0x2bf2db));}if(_0x38f0a0<=0x0||isNaN(_0x38f0a0)){return _0x46d142(msgResponse(_0x082b('0x20f'),_0x082b('0x45'),'interval\x20=\x20'+_0x38f0a0));}if(_0xa0cd89<=0x0||isNaN(_0xa0cd89)){return _0x46d142(msgResponse(_0x082b('0x20f'),'Error',_0x082b('0x213')+_0xa0cd89));}_0x9a7c21=_0x9a7c21||0x0;var _0x2e8e4e=0x1/_0x4cfd8a;var _0x36b6ed=0x0;var _0xa27e61=0x0;var _0x225a45=0x0;var _0x261558=0x0;for(var _0x47b9b4=0x0;_0x225a45<_0xa0cd89;_0x47b9b4+=0x1){_0xa27e61=_0x47b9b4/_0x38f0a0;_0x36b6ed=(_0x2bf2db*_0xa27e61+_0x9a7c21)/_0x2e8e4e;_0x225a45=erlangb(_0x36b6ed,_0x464f11);_0x261558=_0x36b6ed/_0x464f11*(0x1-erlangb(_0x36b6ed,_0x464f11));}return _0x241575({'erlangCalls':_0x47b9b4,'erlangCallToSecond':_0x38f0a0/_0x47b9b4,'erlangAbandonmentRate':_0x225a45,'erlangBusyFactor':_0x261558});});};Dialer['prototype'][_0x082b('0x1d7')]=function(_0x3e5ddb,_0x57c835,_0x2c02a0,_0xe9dddb,_0xd00f4e,_0x487ccc){loggerPredictive[_0x082b('0x7d')](_0x082b('0x214'));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',_0x3e5ddb);loggerPredictive[_0x082b('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57c835);loggerPredictive[_0x082b('0x7d')](_0x082b('0x20b'),_0x2c02a0);loggerPredictive[_0x082b('0x7d')](_0x082b('0x20c'),_0xe9dddb);loggerPredictive[_0x082b('0x7d')](_0x082b('0x215'),_0xd00f4e);loggerPredictive[_0x082b('0x7d')]('---------------------------');return new BPromise(function(_0x243f81,_0x5cddc6){if(_0x3e5ddb<=0x0||isNaN(_0x3e5ddb)){return _0x5cddc6(msgResponse(_0x082b('0x216'),_0x082b('0x45'),'m\x20=\x20'+_0x3e5ddb));}if(_0x2c02a0<=0x0||isNaN(_0x2c02a0)){return _0x5cddc6(msgResponse(_0x082b('0x216'),_0x082b('0x45'),_0x082b('0x211')+_0x2c02a0));}if(_0xe9dddb<=0x0||isNaN(_0xe9dddb)){return _0x5cddc6(msgResponse(_0x082b('0x216'),'Error',_0x082b('0x212')+_0xe9dddb));}if(_0x57c835<=0x0||isNaN(_0x57c835)){return _0x5cddc6(msgResponse(_0x082b('0x216'),'Error','interval\x20=\x20'+_0x57c835));}if(_0xd00f4e<=0x0||isNaN(_0xd00f4e)){return _0x5cddc6(msgResponse(_0x082b('0x216'),_0x082b('0x45'),'Umin\x20=\x20'+_0xd00f4e));}_0x487ccc=_0x487ccc||0x0;var _0x2947fc=0x1/_0x2c02a0;var _0x3525c3=0x0;var _0x572889=0x0;var _0x1068b5=0x0;var _0x1eb02b=0x0;for(var _0x212983=0x0;_0x1eb02b<_0xd00f4e;_0x212983+=0x1){_0x572889=_0x212983/_0x57c835;_0x3525c3=(_0xe9dddb*_0x572889+_0x487ccc)/_0x2947fc;_0x1068b5=erlangb(_0x3525c3,_0x3e5ddb);_0x1eb02b=_0x3525c3/_0x3e5ddb*(0x1-erlangb(_0x3525c3,_0x3e5ddb));}return _0x243f81({'erlangCalls':_0x212983,'erlangCallToSecond':_0x57c835/_0x212983,'erlangAbandonmentRate':_0x1068b5,'erlangBusyFactor':_0x1eb02b});});};module['exports']=Dialer; \ No newline at end of file +var _0xf46a=['XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','trim','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','Contact.phone','[getContactDialerPredictive]','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\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','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\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','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','channel','catch','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isTrunkReachable','status','reachable','SIP/%s','unmonitored','syncVarSet','variable','exten','dialAMDActive','value','uniqueid','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr]','countdropretry','countagentrejectretry','stateGlobal','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','actions','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence'];(function(_0x61a2c7,_0x32df9b){var _0x54aaa3=function(_0x2b4652){while(--_0x2b4652){_0x61a2c7['push'](_0x61a2c7['shift']());}};_0x54aaa3(++_0x32df9b);}(_0xf46a,0xa4));var _0xaf46=function(_0x3be294,_0x53e065){_0x3be294=_0x3be294-0x0;var _0x25e87d=_0xf46a[_0x3be294];return _0x25e87d;};'use strict';var util=require(_0xaf46('0x0'));var _=require('lodash');var BPromise=require(_0xaf46('0x1'));var uuid=require(_0xaf46('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xaf46('0x3'));var Redis=require(_0xaf46('0x4'));var ut=require(_0xaf46('0x5'));var config=require(_0xaf46('0x6'));var logger=require(_0xaf46('0x7'))(_0xaf46('0x8'));var loggerBooked=require(_0xaf46('0x7'))(_0xaf46('0x9'));var loggerPredictive=require(_0xaf46('0x7'))(_0xaf46('0xa'));var loggerPredictiveCalls=require(_0xaf46('0x7'))(_0xaf46('0xb'));var loggerSyncQueueSummary=require(_0xaf46('0x7'))(_0xaf46('0xc'));var ami=require('../ami');config[_0xaf46('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xaf46('0xe'))(new Redis(config[_0xaf46('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xaf46('0xf'));var cmHopperBlack=require(_0xaf46('0x10'));var voiceQueueRt=require(_0xaf46('0x11'));var Action=require('./action');var History=require(_0xaf46('0x12'));var Final=require('./final');var AgentComplete=require(_0xaf46('0x13'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xaf46('0x14'));var ipAgi=process['env'][_0xaf46('0x15')]||_0xaf46('0x16');var strategy={'rrmemory':_0xaf46('0x17'),'roundrobin':_0xaf46('0x18')};var Sequence=function(){};Sequence[_0xaf46('0x19')][_0xaf46('0x1a')]=function(_0x370941){this[_0xaf46('0x1b')]=this['tail']?this['tail']['finally'](_0x370941):_0x370941();};function Dialer(_0x1693e4,_0x5bccdf){this['sequence']=new Sequence();this[_0xaf46('0x1c')]=_0x5bccdf;this[_0xaf46('0x1d')]=_0x1693e4['voiceQueues'];this[_0xaf46('0x1e')]=_0x1693e4[_0xaf46('0x1e')];this[_0xaf46('0x1f')]=_0x1693e4[_0xaf46('0x1f')];this[_0xaf46('0x20')]=_0x1693e4[_0xaf46('0x20')];this['maxNumberOriginate']=config[_0xaf46('0x21')]||0x2;this[_0xaf46('0x22')]={};this['actions']={};this[_0xaf46('0x23')]={};this[_0xaf46('0x24')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this[_0xaf46('0x25')]={};this[_0xaf46('0x26')]={};this['queueBookedRR']={};ami['on'](_0xaf46('0x27'),this['syncAgentConnect'][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x29'),this[_0xaf46('0x2a')][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x2b'),this[_0xaf46('0x2c')][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x2d'),this[_0xaf46('0x2e')][_0xaf46('0x28')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x2f'),this[_0xaf46('0x30')][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x31'),this[_0xaf46('0x32')][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x33'),this['syncVarSet'][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x34'),this['syncQueueMember'][_0xaf46('0x28')](this));ami['on'](_0xaf46('0x35'),this[_0xaf46('0x36')][_0xaf46('0x28')](this));this[_0xaf46('0x37')]();this[_0xaf46('0x38')]();}function isNotNull(_0x57246b){return _0x57246b!==null&&!_[_0xaf46('0x39')](_0x57246b);}function checkIsLoggedIn(_0x15cba5,_0x5eb4e1){return function(){if(_0x5eb4e1<=0x0){_0x15cba5[_0xaf46('0x3a')]=_0xaf46('0x3b');throw _0x15cba5[_0xaf46('0x3c')]+_0xaf46('0x3d');}};}function isActive(_0x19f29a){return _0x19f29a;}function checkIsActive(_0x365e7b,_0x1dfa19){return function(){if(!isActive(_0x1dfa19)){_0x365e7b[_0xaf46('0x3a')]=_0xaf46('0x3e');throw _0x365e7b[_0xaf46('0x3c')]+_0xaf46('0x3f');}};}function checkInterval(_0x5ec8e7){return function(){if(!isNotNull(_0x5ec8e7[_0xaf46('0x40')])){_0x5ec8e7['message']=_0xaf46('0x41');throw _0x5ec8e7[_0xaf46('0x3c')]+_0xaf46('0x42');}if(!isNotNull(_0x5ec8e7[_0xaf46('0x40')]['Intervals'])){_0x5ec8e7[_0xaf46('0x3a')]=_0xaf46('0x41');throw _0x5ec8e7[_0xaf46('0x3c')]+_0xaf46('0x42');}if(!isNotNull(_['isEmpty'](_0x5ec8e7['Interval'][_0xaf46('0x43')]))){_0x5ec8e7[_0xaf46('0x3a')]=_0xaf46('0x41');throw _0x5ec8e7[_0xaf46('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x2e6fc1,_0x2e4e34,_0x119604){return{'action':_0x2e6fc1,'response':_0x2e4e34,'message':_0x119604,'stack':_0x119604};}function myreject(_0x106e17){return function(_0x207d14){return _0x106e17(msgResponse(_0xaf46('0x44'),'Error',JSON[_0xaf46('0x45')](_0x207d14)));};}function getSeconds(_0x4b8adc,_0x12fcea){var _0x3e84c0=moment(_0x4b8adc)['milliseconds'](0x0);var _0x34a55c=moment(_0x12fcea)[_0xaf46('0x46')](0x0);return _0x3e84c0[_0xaf46('0x47')](_0x34a55c,_0xaf46('0x48'));}function emit(_0x281478,_0x4cfe3e,_0x436b15){io['to'](_0x281478)[_0xaf46('0x49')](_0x4cfe3e,_0x436b15);}function emitVoiceQueueSummary(_0x23b60e){if(_0x23b60e['type']===_0xaf46('0x4a')){var _0x5365b6={'id':_0x23b60e['id'],'name':_0x23b60e[_0xaf46('0x3c')],'strategy':_0x23b60e[_0xaf46('0x4b')],'answered':_0x23b60e['answered'],'available':_0x23b60e[_0xaf46('0x4c')],'loggedIn':_0x23b60e[_0xaf46('0x4d')],'pTalking':_0x23b60e[_0xaf46('0x4e')],'sumBillable':_0x23b60e[_0xaf46('0x4f')],'sumDuration':_0x23b60e[_0xaf46('0x50')],'sumHoldTime':_0x23b60e[_0xaf46('0x51')]||0x0,'talking':_0x23b60e[_0xaf46('0x52')],'total':_0x23b60e[_0xaf46('0x53')],'type':_0x23b60e[_0xaf46('0x54')],'unmanaged':_0x23b60e[_0xaf46('0x55')],'abandoned':_0x23b60e[_0xaf46('0x56')],'waiting':_0x23b60e[_0xaf46('0x57')],'loggedInDb':_0x23b60e[_0xaf46('0x58')],'dialActive':_0x23b60e[_0xaf46('0x59')],'dialMethod':_0x23b60e[_0xaf46('0x5a')],'dialOriginateCallerIdName':_0x23b60e[_0xaf46('0x5b')],'dialOriginateCallerIdNumber':_0x23b60e[_0xaf46('0x5c')],'dialOriginateTimeout':_0x23b60e[_0xaf46('0x5d')],'dialPrefix':_0x23b60e[_0xaf46('0x5e')],'outboundAnswerAgiCallsDay':_0x23b60e[_0xaf46('0x5f')],'outboundAnswerCallsDay':_0x23b60e[_0xaf46('0x60')],'outboundBlacklistCallsDay':_0x23b60e[_0xaf46('0x61')],'outboundBusyCallsDay':_0x23b60e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x23b60e[_0xaf46('0x62')],'outboundDropCallsDayACS':_0x23b60e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x23b60e[_0xaf46('0x63')],'outboundDropCallsDayTimeout':_0x23b60e[_0xaf46('0x64')],'outboundNoAnswerCallsDay':_0x23b60e[_0xaf46('0x65')],'outboundNoSuchCallsDay':_0x23b60e[_0xaf46('0x66')],'outboundOriginateFailureCallsDay':_0x23b60e[_0xaf46('0x67')],'outboundReCallsDay':_0x23b60e[_0xaf46('0x68')],'outboundRejectCallsDay':_0x23b60e[_0xaf46('0x69')],'outboundUnknownCallsDay':_0x23b60e[_0xaf46('0x6a')],'predictiveIntervalAnsweredCalls':_0x23b60e[_0xaf46('0x6b')],'predictiveIntervalAvgHoldtime':_0x23b60e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x23b60e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x23b60e['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x23b60e[_0xaf46('0x6c')],'predictiveIntervalErlangCalls':_0x23b60e[_0xaf46('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x23b60e['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x23b60e[_0xaf46('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x23b60e[_0xaf46('0x6f')],'predictiveIntervalPauses':_0x23b60e[_0xaf46('0x70')],'predictiveIntervalAvailable':_0x23b60e['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x23b60e[_0xaf46('0x71')],'message':_0x23b60e[_0xaf46('0x3a')],'originated':_0x23b60e[_0xaf46('0x72')],'erlangCalls':_0x23b60e[_0xaf46('0x73')],'erlangCallToSecond':_0x23b60e[_0xaf46('0x74')],'erlangAbandonmentRate':_0x23b60e['erlangAbandonmentRate'],'erlangBusyFactor':_0x23b60e[_0xaf46('0x75')],'startPredictive':_0x23b60e[_0xaf46('0x76')],'startProgressive':_0x23b60e[_0xaf46('0x77')]};if(_0x23b60e[_0xaf46('0x78')]){_0x5365b6['Trunk']={'id':_0x23b60e[_0xaf46('0x78')]['id'],'name':_0x23b60e[_0xaf46('0x78')]['name'],'active':_0x23b60e[_0xaf46('0x78')][_0xaf46('0x79')],'callerid':_0x23b60e[_0xaf46('0x78')]['callerid']};}if(_0x23b60e[_0xaf46('0x40')]){_0x5365b6[_0xaf46('0x40')]={'id':_0x23b60e[_0xaf46('0x40')]['id'],'name':_0x23b60e[_0xaf46('0x40')][_0xaf46('0x3c')]};}var _0x512a35=md5(JSON[_0xaf46('0x45')](_0x5365b6));if(_0x23b60e[_0xaf46('0x3')]!==_0x512a35){_0x23b60e['md5']=_0x512a35;emit(util[_0xaf46('0x7a')](_0xaf46('0x7b'),_0x5365b6[_0xaf46('0x3c')]),_0xaf46('0x7c'),_0x5365b6);}}}function emitCampaignSummary(_0x1286a2){if(_0x1286a2[_0xaf46('0x54')]===_0xaf46('0x7d')){emit(util[_0xaf46('0x7a')](_0xaf46('0x7e'),_0x1286a2[_0xaf46('0x3c')]),_0xaf46('0x7f'),_0x1286a2);}}function checkGetDataPredictive(_0x3e8d5c){if(isNotNull(_0x3e8d5c)&&!_[_0xaf46('0x80')](_0x3e8d5c)){loggerPredictive[_0xaf46('0x81')](_0xaf46('0x82'));loggerPredictive[_0xaf46('0x81')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e8d5c[_0xaf46('0x71')]);loggerPredictive[_0xaf46('0x81')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e8d5c['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xaf46('0x81')](_0xaf46('0x83'),_0x3e8d5c[_0xaf46('0x6c')]);loggerPredictive['info'](_0xaf46('0x84'),_0x3e8d5c[_0xaf46('0x85')]);loggerPredictive[_0xaf46('0x81')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e8d5c[_0xaf46('0x86')]);loggerPredictive[_0xaf46('0x81')](_0xaf46('0x87'),_0x3e8d5c[_0xaf46('0x88')]);loggerPredictive['info'](_0xaf46('0x89'));if(_0x3e8d5c[_0xaf46('0x71')]>0x0){if(!_[_0xaf46('0x39')](_0x3e8d5c[_0xaf46('0x88')])&&_0x3e8d5c[_0xaf46('0x88')]>0x0){return!![];}loggerPredictive[_0xaf46('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xaf46('0x39')](_0x3e8d5c[_0xaf46('0x86')])&&_0x3e8d5c[_0xaf46('0x86')]>0x0){return!![];}loggerPredictive[_0xaf46('0x81')](_0xaf46('0x8a'));}else{loggerPredictive['info'](_0xaf46('0x8b'));}}else{loggerPredictive[_0xaf46('0x81')](_0xaf46('0x8c'));}return![];}function mergeDataErlangB(_0x1af03e){return function(_0x1f3932){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xaf46('0x81')](_0xaf46('0x8d'),_0x1f3932[_0xaf46('0x73')]);loggerPredictive[_0xaf46('0x81')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f3932[_0xaf46('0x74')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f3932[_0xaf46('0x8e')]);loggerPredictive['info'](_0xaf46('0x8f'),_0x1f3932['erlangBusyFactor']);loggerPredictive['info'](_0xaf46('0x90'),_0x1f3932[_0xaf46('0x8e')]);loggerPredictive[_0xaf46('0x81')]('---------------------------');_['merge'](_0x1af03e,_0x1f3932);};}function getDiff(_0x22c7fa){var _0x45fbc6=moment()['milliseconds'](0x0);var _0x57a018=moment(_0x22c7fa)[_0xaf46('0x46')](0x0);return _0x45fbc6['diff'](_0x57a018,_0xaf46('0x48'));}function ifInterval(_0x5e3ab4,_0x5b8487){if(_['isUndefined'](_0x5b8487)){return![];}return getDiff(_0x5b8487)<_0x5e3ab4*0x3c;}function freeVariablesPredictive(_0x1ce4f6){if(isNotNull(_0x1ce4f6)){if(!_[_0xaf46('0x39')](_0x1ce4f6['startProgressive'])){_0x1ce4f6[_0xaf46('0x77')]=undefined;loggerPredictive[_0xaf46('0x81')](_0x1ce4f6[_0xaf46('0x3c')],_0xaf46('0x91'));}if(!_[_0xaf46('0x39')](_0x1ce4f6[_0xaf46('0x76')])){_0x1ce4f6[_0xaf46('0x76')]=undefined;loggerPredictive[_0xaf46('0x81')](_0x1ce4f6[_0xaf46('0x3c')],_0xaf46('0x92'));}if(!_[_0xaf46('0x39')](_0x1ce4f6[_0xaf46('0x93')])){clearInterval(_0x1ce4f6['handlePredictive']);_0x1ce4f6[_0xaf46('0x93')]=undefined;loggerPredictive[_0xaf46('0x81')](_0x1ce4f6['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1e9af7,_0x2fbab8){if(_0x2fbab8===0x0){return 0x0;}var _0x4280d8=0x1;for(var _0x24546d=0x1;_0x24546d<=_0x2fbab8;_0x24546d+=0x1){_0x4280d8=0x1+_0x4280d8*_0x24546d/_0x1e9af7;}return 0x1/_0x4280d8;}function isVoiceQueueOutbound(_0x1d3107){return _0x1d3107==='outbound';}function isNotPreview(_0x5fa136){return _0x5fa136!=='preview';}function isCampaignIvr(_0x3155ea){return _0x3155ea===_0xaf46('0x7d');}function getCallerId(_0x193b5e,_0x9ecc94,_0x3e1ea7){if(!_[_0xaf46('0x39')](_0x3e1ea7)&&typeof _0x3e1ea7===_0xaf46('0x94')&&!_[_0xaf46('0x80')](_0x3e1ea7)){if(!_['isUndefined'](_0x9ecc94)&&typeof _0x9ecc94==='string'&&!_['isEmpty'](_0x9ecc94)){return util['format'](_0xaf46('0x95'),_0x9ecc94,_0x3e1ea7);}return util[_0xaf46('0x7a')]('\x22%s\x22\x20<%s>',_0x3e1ea7,_0x3e1ea7);}if(!_['isUndefined'](_0x193b5e)&&typeof _0x193b5e===_0xaf46('0x94')&&!_[_0xaf46('0x80')](_0x193b5e)){return _0x193b5e;}return _0xaf46('0x96');}function loggerCatchQueueSummary(_0x4743d8,_0x40e925){return function(_0x2e90d){freeVariablesPredictive(_0x40e925);emitVoiceQueueSummary(_0x40e925);emitCampaignSummary(_0x40e925);loggerSyncQueueSummary[_0xaf46('0x97')](_0x4743d8,util[_0xaf46('0x98')](_0x2e90d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x464fed,_0x10e4d0){return function(_0x3d19bd){loggerPredictive['error'](_0x10e4d0[_0xaf46('0x3c')],_0x464fed);loggerPredictive['error'](_0x3d19bd[_0xaf46('0x99')]);freeVariablesPredictive(_0x10e4d0);};}function loggerCatch(_0x3994ef){return function(_0x1c7722){logger[_0xaf46('0x97')](_0x3994ef,util[_0xaf46('0x98')](_0x1c7722,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x531f70){return _0x531f70&&!_['isUndefined'](_0x531f70)&&_0x531f70['length']>0x0;}function decremetOriginate(_0x2d9e0d){if(!_[_0xaf46('0x39')](_0x2d9e0d)&&_0x2d9e0d!==null){if(typeof _0x2d9e0d[_0xaf46('0x72')]!==_0xaf46('0x9a')){if(_0x2d9e0d[_0xaf46('0x72')]>0x0){_0x2d9e0d[_0xaf46('0x72')]-=0x1;}else{logger[_0xaf46('0x97')](_0xaf46('0x9b'));}}}else{logger['error'](_0xaf46('0x9c'));}}function checkContactLowerLimitOriginate(_0x43133d,_0x525a1f,_0x6764af){if(_0x525a1f>_0x6764af){for(var _0x2c2d3b=0x0;_0x2c2d3b<_0x525a1f-_0x6764af;_0x2c2d3b+=0x1){decremetOriginate(_0x43133d);}}}function loggerGetContactDialer(_0x1a466a,_0x1c4851,_0x16bb78){return function(_0xf97dc0){checkContactLowerLimitOriginate(_0x1c4851,_0x16bb78,0x0);logger[_0xaf46('0x97')](_0x1a466a,util[_0xaf46('0x98')](_0xf97dc0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x40642b){return function(_0x135da8){if(isNotNull(_0x135da8)&&isNotNull(_0x135da8[0x0])){if(_0x135da8[0x0][_0xaf46('0x9d')]>0x0){_0x40642b['message']='RESCHEDULED_CONTACTS';logger[_0xaf46('0x81')]('[getContactDialer2][ReScheduled]'+_0x40642b[_0xaf46('0x3c')],_0x135da8[0x0]['contactsRescheduled'],_0xaf46('0x9e'));}else{_0x40642b[_0xaf46('0x3a')]=_0xaf46('0x9f');logger[_0xaf46('0x81')](_0xaf46('0xa0')+_0x40642b[_0xaf46('0x3c')]);}}};}function notSendMessagesQueue(_0x1efd3d){if(_0x1efd3d[_0xaf46('0xa1')]){freeVariablesPredictive(_0x1efd3d);if(_0x1efd3d['originated']===0x0&&_0x1efd3d[_0xaf46('0x52')]===0x0&&_0x1efd3d[_0xaf46('0x57')]===0x0&&(_0x1efd3d[_0xaf46('0x4e')]||0x0)===0x0){_0x1efd3d['sendMessageOneNotActive']=![];_0x1efd3d[_0xaf46('0x4c')]=0x0;_0x1efd3d[_0xaf46('0x3a')]=_0xaf46('0x3e');loggerSyncQueueSummary[_0xaf46('0x97')](_0xaf46('0xa2'),_0x1efd3d[_0xaf46('0x3c')],_0xaf46('0xa3'));}else{_0x1efd3d['message']=_0xaf46('0xa4');loggerSyncQueueSummary[_0xaf46('0x97')](_0xaf46('0xa2'),_0x1efd3d[_0xaf46('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x1efd3d);}}function notSendMessagesCampaign(_0x9d0584){if(_0x9d0584['sendMessageOneNotActive']){if(_0x9d0584[_0xaf46('0x72')]===0x0){_0x9d0584[_0xaf46('0xa1')]=![];_0x9d0584[_0xaf46('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xaf46('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x9d0584[_0xaf46('0x3c')],_0xaf46('0xa3'));}else{_0x9d0584[_0xaf46('0x3a')]=_0xaf46('0xa4');loggerSyncQueueSummary[_0xaf46('0x97')](_0xaf46('0xa5'),_0x9d0584[_0xaf46('0x3c')],_0xaf46('0xa6'));}emitCampaignSummary(_0x9d0584);}}function createObjHistory(_0x4db6b9,_0x2fad40,_0x3afe79,_0x534429,_0x2bd9dd){_0x4db6b9[_0xaf46('0x3a')]=_0x3afe79;var _0xf56ed5=new Action(_0x4db6b9,_0x2fad40);var _0x560887=new History(_0xf56ed5);_0x560887[_0xaf46('0xa7')]=_0x534429;_0x560887[_0xaf46('0xa8')]=_0x2bd9dd;_0x560887[_0xaf46('0xa9')]=_0xf56ed5['starttime'];return _0x560887;}Dialer['prototype'][_0xaf46('0x38')]=function(){var _0x629dd9=this;setInterval(function(){_0x629dd9[_0xaf46('0xaa')](_0x629dd9[_0xaf46('0x24')],_0xaf46('0xab'));_0x629dd9[_0xaf46('0xaa')](_0x629dd9['actions'],_0xaf46('0xac'));},0x32c8);};Dialer[_0xaf46('0x19')][_0xaf46('0xaa')]=function(_0x45bf4a,_0x5a6e1c){var _0x54b5a4=this;for(var _0x9838b5 in _0x45bf4a){if(typeof _0x45bf4a[_0x9838b5]!==_0xaf46('0x9a')){this[_0xaf46('0xad')]['enqueue'](function(){if(!_[_0xaf46('0xae')](_0x45bf4a[_0x9838b5])){return ami['Action']({'action':'status','channel':_0x45bf4a[_0x9838b5][_0xaf46('0xaf')]})[_0xaf46('0xb0')](function(_0x4223d0){if(_0x4223d0[_0xaf46('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x45bf4a[_0x9838b5]&&_0x45bf4a[_0x9838b5]['type']!==_0xaf46('0x7d')){_0x54b5a4['updateOriginated'](_0x54b5a4[_0xaf46('0x1d')][_0x45bf4a[_0x9838b5][_0xaf46('0xb1')]]);logger[_0xaf46('0x97')](_0xaf46('0xb2'),_0x5a6e1c,_0x9838b5,_0x45bf4a[_0x9838b5][_0xaf46('0xb1')]);delete _0x45bf4a[_0x9838b5];}if(_0x45bf4a[_0x9838b5]&&_0x45bf4a[_0x9838b5]['type']===_0xaf46('0x7d')){_0x54b5a4[_0xaf46('0xb3')](_0x54b5a4[_0xaf46('0x1e')][_0x45bf4a[_0x9838b5][_0xaf46('0xb1')]]);logger[_0xaf46('0x97')](_0xaf46('0xb4'),_0x5a6e1c,_0x9838b5,_0x45bf4a[_0x9838b5][_0xaf46('0xb1')]);delete _0x45bf4a[_0x9838b5];}},0x2328);}});}});}}};Dialer[_0xaf46('0x19')]['countReScheduled']=function(_0x24ff7c){return BPromise['resolve']()[_0xaf46('0xb5')](cmHopper['countReScheduled'](_0x24ff7c))['catch'](loggerCatch(_0xaf46('0xb6')));};Dialer['prototype'][_0xaf46('0xb7')]=function(_0x3926ae){return BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](cmHopperBlack[_0xaf46('0xb7')](_0x3926ae))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xb9')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x5931e1){return BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](cmHopperBlack[_0xaf46('0xba')](_0x5931e1))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xbb')));};Dialer[_0xaf46('0x19')][_0xaf46('0xbc')]=function(_0x32b5ee){return BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](cmHopperHistory[_0xaf46('0xbd')](_0x32b5ee))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xaf46('0xbe')]=function(_0x224807){return BPromise['resolve']()['then'](cmHopper[_0xaf46('0xbe')](_0x224807))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xbf')));};Dialer[_0xaf46('0x19')]['unlockContact']=function(_0x3aa57a,_0x48f5ed,_0x126060){return BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](cmHopper[_0xaf46('0xc0')](_0x3aa57a,_0x48f5ed,_0x126060))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xc1')));};Dialer['prototype'][_0xaf46('0xc2')]=function(_0x2cb00e,_0x3e81cd,_0x219a80,_0x1223dd,_0x2be497){return BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](cmHopper[_0xaf46('0xc2')](_0x2cb00e,_0x3e81cd,_0x219a80,_0x1223dd))[_0xaf46('0xb0')](function(_0x26a5ed){_0x2be497[_0xaf46('0xc3')]-=_0x219a80;_0x2be497[_0xaf46('0xc3')]=_0x2be497[_0xaf46('0xc3')]>0x0?_0x2be497[_0xaf46('0xc3')]:0x0;loggerCatch(_0xaf46('0xc4'))(_0x26a5ed);});};Dialer['prototype'][_0xaf46('0xc5')]=function(_0x751144,_0xbe2578,_0x2efbf9,_0x242732){return BPromise[_0xaf46('0xb8')]()['then'](cmHopper['getContactDialerIvr'](_0x751144,_0xbe2578,_0x2efbf9))['catch'](function(_0x9acd09){_0x242732[_0xaf46('0xc3')]-=_0xbe2578;_0x242732['temp']=_0x242732[_0xaf46('0xc3')]>0x0?_0x242732[_0xaf46('0xc3')]:0x0;loggerCatch(_0xaf46('0xc6'))(_0x9acd09);});};Dialer['prototype'][_0xaf46('0xc7')]=function(_0x5646a0){return BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](voiceQueueRt[_0xaf46('0xc7')](_0x5646a0))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xc8')));};Dialer['prototype'][_0xaf46('0xc9')]=function(_0x84c0e0){return BPromise[_0xaf46('0xb8')]()['then'](cmHopper[_0xaf46('0xc9')](_0x84c0e0))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xca')));};Dialer['prototype'][_0xaf46('0xcb')]=function(_0x2aca04){return BPromise[_0xaf46('0xb8')]()['then'](cmHopperHistory['createHistory'](_0x2aca04))[_0xaf46('0xb0')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0xaf46('0xb3')]=function(_0x42354b){if(!_['isUndefined'](_0x42354b)&&_0x42354b!==null){if(typeof _0x42354b[_0xaf46('0x72')]!=='undefined'){if(_0x42354b[_0xaf46('0x72')]>0x0){_0x42354b[_0xaf46('0x72')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xaf46('0x97')](_0xaf46('0xcc'));}};Dialer['prototype']['loggerHandler']=function(_0x18be77,_0x2cb15b){var _0x124691=this;return function(_0x52e0de){_0x124691[_0xaf46('0xb3')](_0x2cb15b);logger['error'](_0x18be77,util[_0xaf46('0x98')](_0x52e0de,{'showHidden':![],'depth':null}));};};Dialer[_0xaf46('0x19')][_0xaf46('0xcd')]=function(_0x2cc376,_0x26c4b7,_0x1d2ecf){var _0x5b4132={'state':0x19,'statedesc':_0xaf46('0xce')};this[_0xaf46('0xb3')](_0x26c4b7);this[_0xaf46('0xcf')](_[_0xaf46('0xd0')](_0x5b4132,_[_0xaf46('0xd1')](_0x1d2ecf,[_0xaf46('0xd2'),_0xaf46('0xd3'),_0xaf46('0xd4'),_0xaf46('0xd5'),_0xaf46('0xd6')])),_0xaf46('0xd7'),_0xaf46('0xd8'));logger['error'](_0x2cc376);};Dialer['prototype']['isSuccess']=function(_0x205c70){return _0x205c70==='Success';};Dialer[_0xaf46('0x19')][_0xaf46('0xd9')]=function(_0x53a005){return!_[_0xaf46('0x39')](_0x53a005)&&_0x53a005&&!_['isUndefined'](_0x53a005['name'])&&!_[_0xaf46('0x39')](_0x53a005[_0xaf46('0x79')])&&_0x53a005['active']&&(this['trunks'][util[_0xaf46('0x7a')]('SIP/%s',_0x53a005['name'])][_0xaf46('0xda')]===_0xaf46('0xdb')||this[_0xaf46('0x20')][util[_0xaf46('0x7a')](_0xaf46('0xdc'),_0x53a005[_0xaf46('0x3c')])][_0xaf46('0xda')]===_0xaf46('0xdd'));};Dialer['prototype']['saveInDb']=function(_0x122a8a,_0x2fbc34,_0x5b40f9){this[_0xaf46('0xcb')](_0x122a8a)[_0xaf46('0xb0')](loggerCatch(_0x2fbc34));this[_0xaf46('0xc9')](_0x122a8a)[_0xaf46('0xb0')](loggerCatch(_0x5b40f9));};Dialer[_0xaf46('0x19')][_0xaf46('0xde')]=function(_0x591259){var _0xe96b16=this[_0xaf46('0x24')][_0x591259['uniqueid']];var _0x10440f;if(!_[_0xaf46('0xae')](_0x591259)&&!_[_0xaf46('0xae')](_0x591259['variable'])&&!_[_0xaf46('0xae')](_0x591259[_0xaf46('0xdf')]['amdstatus'])&&_0x591259[_0xaf46('0xe0')]==='xcally-motion-dialer'&&_0xe96b16){if(_0xe96b16['type']!==_0xaf46('0x7d')&&this[_0xaf46('0x1d')][_0xe96b16[_0xaf46('0xb1')]][_0xaf46('0xe1')]&&_0x591259[_0xaf46('0xe2')]==='HANGUP'){delete this[_0xaf46('0x24')][_0x591259[_0xaf46('0xe3')]];this[_0xaf46('0xb3')](this[_0xaf46('0x1d')][_0xe96b16[_0xaf46('0xb1')]]);this[_0xaf46('0x1d')][_0xe96b16[_0xaf46('0xb1')]][_0xaf46('0x60')]+=0x1;this['voiceQueues'][_0xe96b16[_0xaf46('0xb1')]][_0xaf46('0x5f')]+=0x1;_0x10440f=new Hangup(_0xe96b16,_0x591259);_0x10440f['state']=0x12;_0x10440f[_0xaf46('0xa8')]='HangupInAMD';_0x10440f[_0xaf46('0xe4')]=_0xaf46('0xe5');ami[_0xaf46('0x49')](_0xaf46('0xe6'),ut[_0xaf46('0xe7')](_0x10440f,_0xaf46('0xe8')));this[_0xaf46('0xcf')](_0x10440f,_0xaf46('0xe9'),'[syncHangupInAMD]');}if(_0xe96b16[_0xaf46('0x54')]!=='ivr'&&this[_0xaf46('0x1d')][_0xe96b16[_0xaf46('0xb1')]]['dialAMDActive']&&_0x591259['value']===_0xaf46('0xea')){var _0x24e1ef=this;return new BPromise(function(_0x6f9c28,_0x40c6ca){delete _0x24e1ef['uniqueId'][_0x591259[_0xaf46('0xe3')]];_0x24e1ef['updateOriginated'](_0x24e1ef[_0xaf46('0x1d')][_0xe96b16['queue']]);_0x24e1ef[_0xaf46('0x1d')][_0xe96b16['queue']]['outboundAnswerCallsDay']+=0x1;_0x24e1ef['voiceQueues'][_0xe96b16[_0xaf46('0xb1')]][_0xaf46('0x5f')]+=0x1;var _0x45a93b=_0x24e1ef[_0xaf46('0x1d')][_0xe96b16[_0xaf46('0xb1')]];var _0x444df7=new Hangup(_0xe96b16,_0x591259);_0x444df7[_0xaf46('0xa7')]=0x13;_0x444df7['statedesc']=_0xaf46('0xeb');_0x444df7[_0xaf46('0xe4')]=_0xaf46('0xe5');_0x444df7['countmachineretry']+=0x1;_0x444df7[_0xaf46('0xec')]+=0x1;_0x444df7[_0xaf46('0xe8')]=!![];ami[_0xaf46('0x49')](_0xaf46('0xe6'),ut[_0xaf46('0xe7')](_0x444df7,_0xaf46('0xe8')));_0x24e1ef['createHistory'](_0x444df7)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xed')));if(_0x444df7[_0xaf46('0xee')]+_0x444df7[_0xaf46('0xef')]+_0x444df7[_0xaf46('0xf0')]+_0x444df7[_0xaf46('0xf1')]+_0x444df7['countdropretry']+_0x444df7[_0xaf46('0xf2')]+_0x444df7[_0xaf46('0xf3')]+_0x444df7['countagentrejectretry']>=_0x45a93b[_0xaf46('0xf4')]){_0x24e1ef['stateGlobal'](_0x444df7,_0x6f9c28,_0x40c6ca,_0xaf46('0xf5'));}else{if(_0x444df7[_0xaf46('0xf3')]>=_0x45a93b[_0xaf46('0xf6')]){_0x24e1ef[_0xaf46('0xf7')](_0x444df7,_0x6f9c28,_0x40c6ca,_0xaf46('0xf8'));}else{_0x24e1ef[_0xaf46('0xbe')]({'active':![],'countmachineretry':_0x444df7[_0xaf46('0xf3')],'scheduledat':moment()[_0xaf46('0xf9')](_0x45a93b['dialMachineRetryFrequency'],_0xaf46('0xfa'))[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x444df7['ContactId'],'ListId':_0x444df7[_0xaf46('0xd3')],'VoiceQueueId':_0x444df7[_0xaf46('0xd5')]||undefined,'CampaignId':_0x444df7[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xfc')));_0x6f9c28({'reschedule':0x1});}}});}if(_0xe96b16[_0xaf46('0x54')]===_0xaf46('0x7d')&&this[_0xaf46('0x1e')][_0xe96b16[_0xaf46('0xb1')]][_0xaf46('0xe1')]&&_0x591259['value']===_0xaf46('0xfd')){delete this[_0xaf46('0x24')][_0x591259['uniqueid']];this[_0xaf46('0xb3')](this[_0xaf46('0x1e')][_0xe96b16[_0xaf46('0xb1')]]);_0x10440f=new Hangup(_0xe96b16,_0x591259);_0x10440f['state']=0x12;_0x10440f[_0xaf46('0xa8')]=_0xaf46('0xfe');_0x10440f[_0xaf46('0xe4')]=_0xaf46('0xe5');ami[_0xaf46('0x49')](_0xaf46('0xe6'),ut['buildObj'](_0x10440f,_0xaf46('0xe8')));this[_0xaf46('0xcf')](_0x10440f,'[syncHangupInAMDIvr][createHistory]',_0xaf46('0xff'));}if(_0xe96b16[_0xaf46('0x54')]==='ivr'&&this[_0xaf46('0x1e')][_0xe96b16['queue']][_0xaf46('0xe1')]&&_0x591259[_0xaf46('0xe2')]===_0xaf46('0xea')){var _0x24e1ef=this;return new BPromise(function(_0x3d6fb5,_0x27059b){delete _0x24e1ef['uniqueId'][_0x591259[_0xaf46('0xe3')]];_0x24e1ef[_0xaf46('0xb3')](_0x24e1ef[_0xaf46('0x1e')][_0xe96b16['queue']]);_0x24e1ef[_0xaf46('0x1e')][_0xe96b16[_0xaf46('0xb1')]]['outboundAnswerCallsDay']+=0x1;_0x24e1ef['campaigns'][_0xe96b16['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x3055ed=_0x24e1ef[_0xaf46('0x1e')][_0xe96b16[_0xaf46('0xb1')]];var _0x2aee00=new Hangup(_0xe96b16,_0x591259);_0x2aee00[_0xaf46('0xa7')]=0x13;_0x2aee00[_0xaf46('0xa8')]='Machine';_0x2aee00['membername']='AMD';_0x2aee00[_0xaf46('0xf3')]+=0x1;_0x2aee00[_0xaf46('0xec')]+=0x1;_0x2aee00[_0xaf46('0xe8')]=!![];ami['emit'](_0xaf46('0xe6'),ut[_0xaf46('0xe7')](_0x2aee00,_0xaf46('0xe8')));_0x24e1ef[_0xaf46('0xcb')](_0x2aee00)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xed')));if(_0x2aee00[_0xaf46('0xee')]+_0x2aee00[_0xaf46('0xef')]+_0x2aee00[_0xaf46('0xf0')]+_0x2aee00[_0xaf46('0xf1')]+_0x2aee00[_0xaf46('0x100')]+_0x2aee00['countabandonedretry']+_0x2aee00[_0xaf46('0xf3')]+_0x2aee00[_0xaf46('0x101')]>=_0x3055ed[_0xaf46('0xf4')]){_0x24e1ef[_0xaf46('0x102')](_0x2aee00,_0x3d6fb5,_0x27059b,_0xaf46('0xf5'));}else{if(_0x2aee00[_0xaf46('0xf3')]>=_0x3055ed[_0xaf46('0xf6')]){_0x24e1ef[_0xaf46('0xf7')](_0x2aee00,_0x3d6fb5,_0x27059b,_0xaf46('0xf8'));}else{_0x24e1ef['rescheduleContact']({'active':![],'countmachineretry':_0x2aee00[_0xaf46('0xf3')],'scheduledat':moment()[_0xaf46('0xf9')](_0x3055ed[_0xaf46('0x103')],'minutes')[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x2aee00[_0xaf46('0xd2')],'ListId':_0x2aee00[_0xaf46('0xd3')],'VoiceQueueId':_0x2aee00[_0xaf46('0xd5')]||undefined,'CampaignId':_0x2aee00['CampaignId']||undefined})[_0xaf46('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0x3d6fb5({'reschedule':0x1});}}});}}};Dialer[_0xaf46('0x19')][_0xaf46('0x30')]=function(_0x6e2a26){var _0x2a5003=this[_0xaf46('0x24')][_0x6e2a26[_0xaf46('0xe3')]];var _0x3ee42f=this;var _0x39c7d0;if(_0x2a5003&&_0x2a5003[_0xaf46('0x54')]===_0xaf46('0x7d')){delete this[_0xaf46('0x24')][_0x6e2a26[_0xaf46('0xe3')]];this[_0xaf46('0xb3')](this[_0xaf46('0x1e')][_0x2a5003[_0xaf46('0xb1')]]);this[_0xaf46('0x1e')][_0x2a5003[_0xaf46('0xb1')]][_0xaf46('0x104')]+=0x1;_0x39c7d0=new Hangup(_0x2a5003,_0x6e2a26);this[_0xaf46('0xcb')](_0x39c7d0)[_0xaf46('0xb0')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xaf46('0xc9')](_0x39c7d0)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x105')));}if(_0x2a5003&&_0x2a5003[_0xaf46('0x54')]!==_0xaf46('0x7d')&&isNotNull(this['voiceQueues'][_0x2a5003[_0xaf46('0xb1')]][_0xaf46('0x106')])){delete this[_0xaf46('0x24')][_0x6e2a26[_0xaf46('0xe3')]];this[_0xaf46('0xb3')](this[_0xaf46('0x1d')][_0x2a5003[_0xaf46('0xb1')]]);this[_0xaf46('0x1d')][_0x2a5003['queue']][_0xaf46('0x60')]+=0x1;this['voiceQueues'][_0x2a5003[_0xaf46('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x39c7d0=new Hangup(_0x2a5003,_0x6e2a26);_0x39c7d0['state']=0x10;_0x39c7d0[_0xaf46('0xa8')]=_0xaf46('0x107');_0x39c7d0[_0xaf46('0xe4')]=_0xaf46('0x108');this[_0xaf46('0xcb')](_0x39c7d0)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x109')));this[_0xaf46('0xc9')](_0x39c7d0)[_0xaf46('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x2a5003&&_0x2a5003[_0xaf46('0x54')]!==_0xaf46('0x7d')&&!isNotNull(this[_0xaf46('0x1d')][_0x2a5003[_0xaf46('0xb1')]][_0xaf46('0x106')])){delete this[_0xaf46('0x24')][_0x6e2a26[_0xaf46('0xe3')]];this[_0xaf46('0xb3')](this[_0xaf46('0x1d')][_0x2a5003[_0xaf46('0xb1')]]);this[_0xaf46('0x1d')][_0x2a5003['queue']][_0xaf46('0x6a')]+=0x1;_0x39c7d0=new Hangup(_0x2a5003,_0x6e2a26);_0x39c7d0[_0xaf46('0xa7')]=0xc;_0x39c7d0['statedesc']=_0x6e2a26[_0xaf46('0x10a')];_0x39c7d0[_0xaf46('0xe4')]=_0xaf46('0x10b');this[_0xaf46('0xcb')](_0x39c7d0)['catch'](loggerCatch(_0xaf46('0x109')));this[_0xaf46('0xc9')](_0x39c7d0)[_0xaf46('0xb0')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xaf46('0x19')][_0xaf46('0x2e')]=function(_0x1d132b){var _0x5c8fe6=this['uniqueId'][_0x1d132b[_0xaf46('0xe3')]];var _0x598ddf=this;if(this[_0xaf46('0x1d')][_0x1d132b['queue']]){if(_0x5c8fe6&&_0x5c8fe6[_0xaf46('0x54')]!==_0xaf46('0x7d')){delete this[_0xaf46('0x24')][_0x1d132b[_0xaf46('0xe3')]];this[_0xaf46('0x1d')][_0x1d132b[_0xaf46('0xb1')]][_0xaf46('0x60')]+=0x1;var _0xfb7823=new AgentComplete(_0x5c8fe6,_0x1d132b);if(_0x1d132b[_0xaf46('0x10c')]==='agent'){_0xfb7823[_0xaf46('0x10d')]=this[_0xaf46('0x1d')][_0x1d132b[_0xaf46('0xb1')]]['dialQueueProject2']&&this['voiceQueues'][_0x1d132b[_0xaf46('0xb1')]][_0xaf46('0x10e')]?moment()[_0xaf46('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xaf46('0xcb')](_0xfb7823)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x10f')));this[_0xaf46('0xc9')](_0xfb7823)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x110')));}}};Dialer[_0xaf46('0x19')]['syncAgentConnect']=function(_0xe15751){if(this['voiceQueues'][_0xe15751[_0xaf46('0xb1')]]){if(this[_0xaf46('0x24')][_0xe15751[_0xaf46('0xe3')]]&&this['uniqueId'][_0xe15751[_0xaf46('0xe3')]][_0xaf46('0x54')]!==_0xaf46('0x7d')){this[_0xaf46('0xb3')](this['voiceQueues'][_0xe15751[_0xaf46('0xb1')]]);this[_0xaf46('0x24')][_0xe15751[_0xaf46('0xe3')]][_0xaf46('0x111')]=moment()[_0xaf46('0x7a')](_0xaf46('0xfb'));}}};Dialer[_0xaf46('0x19')][_0xaf46('0x112')]=function(_0x3937ba){this[_0xaf46('0xcb')](_0x3937ba)[_0xaf46('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xaf46('0xc9')](_0x3937ba)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x113')));};Dialer[_0xaf46('0x19')][_0xaf46('0x2a')]=function(_0x887d6e){var _0x264e54=this[_0xaf46('0x24')][_0x887d6e[_0xaf46('0xe3')]];var _0x598583=this;if(this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]]){if(_0x264e54&&_0x264e54['type']!=='ivr'){delete this[_0xaf46('0x24')][_0x887d6e[_0xaf46('0xe3')]];this[_0xaf46('0xb3')](this[_0xaf46('0x1d')][_0x887d6e['queue']]);_0x264e54['droptime']=moment()[_0xaf46('0x7a')](_0xaf46('0xfb'));var _0x43923a=new QueueCallerAbandon(_0x264e54,_0x887d6e);if(getSeconds(_0x264e54['droptime'],_0x264e54[_0xaf46('0x114')])>=_0x264e54[_0xaf46('0x115')]){this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x887d6e[_0xaf46('0xb1')]][_0xaf46('0x64')]+=0x1;this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]][_0xaf46('0x116')]+=0x1;_0x43923a[_0xaf46('0xa7')]=0xa;_0x43923a[_0xaf46('0xa8')]=_0xaf46('0x117');_0x43923a[_0xaf46('0x118')]='TIMEOUT';_0x43923a[_0xaf46('0x10d')]=this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]]['dialQueueProject2']?moment()[_0xaf46('0x7a')](_0xaf46('0xfb')):undefined;_0x43923a[_0xaf46('0x100')]+=0x1;_0x43923a[_0xaf46('0xec')]+=0x1;if(_0x43923a[_0xaf46('0x100')]>=this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]][_0xaf46('0x119')]){this[_0xaf46('0x112')](_0x43923a);}else{this[_0xaf46('0xbe')]({'active':![],'countdropretry':_0x43923a['countdropretry'],'scheduledat':moment()[_0xaf46('0xf9')](this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]][_0xaf46('0x11a')],_0xaf46('0xfa'))[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x264e54[_0xaf46('0xd2')],'ListId':_0x264e54['ListId'],'VoiceQueueId':_0x264e54[_0xaf46('0xd5')]||undefined,'CampaignId':_0x264e54[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch('[rescheduleContact][Drop]'));var _0x1d50ca=new History(_0x43923a);_0x1d50ca[_0xaf46('0xa7')]=0xa;_0x1d50ca[_0xaf46('0xa8')]='Drop';_0x1d50ca[_0xaf46('0x11b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1d50ca[_0xaf46('0xa9')]=_0x1d50ca[_0xaf46('0x11b')];_0x1d50ca[_0xaf46('0x11c')]=_0x43923a[_0xaf46('0x11c')];_0x1d50ca[_0xaf46('0x11d')]=_0x43923a[_0xaf46('0x11d')];this[_0xaf46('0xcb')](_0x1d50ca)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x11e')));}}else{this[_0xaf46('0x1d')][_0x887d6e['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]][_0xaf46('0x63')]+=0x1;_0x43923a['state']=0xb;_0x43923a[_0xaf46('0xa8')]=_0xaf46('0x11f');_0x43923a[_0xaf46('0x118')]='CALLEREXIT';_0x43923a[_0xaf46('0xf2')]+=0x1;_0x43923a['countglobal']+=0x1;if(_0x43923a['countabandonedretry']>=this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]]['dialAbandonedMaxRetry']){this[_0xaf46('0x112')](_0x43923a);}else{this[_0xaf46('0xbe')]({'active':![],'countabandonedretry':_0x43923a[_0xaf46('0xf2')],'scheduledat':moment()[_0xaf46('0xf9')](this[_0xaf46('0x1d')][_0x887d6e[_0xaf46('0xb1')]]['dialAbandonedRetryFrequency'],_0xaf46('0xfa'))[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x264e54[_0xaf46('0xd2')],'ListId':_0x264e54[_0xaf46('0xd3')],'VoiceQueueId':_0x264e54[_0xaf46('0xd5')]||undefined,'CampaignId':_0x264e54['CampaignId']||undefined})[_0xaf46('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1d50ca=new History(_0x43923a);_0x1d50ca['state']=0xb;_0x1d50ca['statedesc']='Abandoned';_0x1d50ca[_0xaf46('0x11b')]=moment()[_0xaf46('0x7a')](_0xaf46('0xfb'));_0x1d50ca['endtime']=_0x1d50ca['starttime'];_0x1d50ca[_0xaf46('0x11c')]=_0x43923a[_0xaf46('0x11c')];_0x1d50ca['calleridnum']=_0x43923a[_0xaf46('0x11d')];this[_0xaf46('0xcb')](_0x1d50ca)[_0xaf46('0xb0')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xaf46('0x19')]['syncNewExten']=function(_0xc24b7){if(this[_0xaf46('0x120')][_0xc24b7[_0xaf46('0xe3')]]){this[_0xaf46('0x120')][_0xc24b7['uniqueid']][_0xaf46('0xaf')]=_0xc24b7[_0xaf46('0xaf')];}if(this[_0xaf46('0x24')][_0xc24b7[_0xaf46('0xe3')]]){this[_0xaf46('0x24')][_0xc24b7[_0xaf46('0xe3')]][_0xaf46('0xaf')]=_0xc24b7['channel'];}};Dialer[_0xaf46('0x19')]['syncQueueMember']=function(_0x46b168){if(strategy[this[_0xaf46('0x1d')][this['actions'][_0x46b168[_0xaf46('0x121')]][_0xaf46('0xb1')]][_0xaf46('0x4b')]]===_0xaf46('0x18')){if(this['actions'][_0x46b168[_0xaf46('0x121')]]&&_[_0xaf46('0xae')](this[_0xaf46('0x120')][_0x46b168['actionid']][_0xaf46('0x122')])&&_0x46b168[_0xaf46('0xda')]==='1'&&_0x46b168[_0xaf46('0x123')]==='0'){if(this[_0xaf46('0x1f')][_0x46b168[_0xaf46('0x124')]]){if(!this[_0xaf46('0x1f')][_0x46b168['stateinterface']][_0xaf46('0x122')]){this['agents'][_0x46b168[_0xaf46('0x124')]]['locked']=!![];this[_0xaf46('0x120')][_0x46b168['actionid']][_0xaf46('0x122')]=!![];this['actions'][_0x46b168[_0xaf46('0x121')]][_0xaf46('0x124')]=_0x46b168[_0xaf46('0x124')];}}}}else if((strategy[this[_0xaf46('0x1d')][this[_0xaf46('0x120')][_0x46b168['actionid']]['queue']]['strategy']]||_0xaf46('0x17'))===_0xaf46('0x17')){if(this[_0xaf46('0x120')][_0x46b168['actionid']]){if(this[_0xaf46('0x1f')][_0x46b168['stateinterface']]){this['actions'][_0x46b168[_0xaf46('0x121')]][_0xaf46('0x124')]=_0x46b168[_0xaf46('0x124')];if(_[_0xaf46('0xae')](this[_0xaf46('0x26')][this[_0xaf46('0x120')][_0x46b168[_0xaf46('0x121')]][_0xaf46('0xb1')]])){this['queueBooked'][this[_0xaf46('0x120')][_0x46b168[_0xaf46('0x121')]]['queue']]=[];}this[_0xaf46('0x26')][this[_0xaf46('0x120')][_0x46b168[_0xaf46('0x121')]][_0xaf46('0xb1')]][_0xaf46('0x125')](_[_0xaf46('0xd0')](_[_0xaf46('0xd1')](this[_0xaf46('0x120')][_0x46b168['actionid']],[_0xaf46('0x126'),_0xaf46('0x124')]),{'status':_0x46b168['status'],'paused':_0x46b168['paused']}));}}}};function unlockQueueStatus(_0x1f2d27,_0x69abf6){setTimeout(function(){if(_['isUndefined'](_0x1f2d27[_0xaf46('0x127')])){loggerBooked['error'](_0xaf46('0x128'),_0x69abf6);}_0x1f2d27['queueStatusComplete']=!![];loggerBooked['info'](_0xaf46('0x129'),_0x69abf6,JSON[_0xaf46('0x45')](_['pick'](_0x1f2d27,[_0xaf46('0x3c'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xaf46('0x19')]['syncQueueStatusComplete']=function(_0x103e6d){var _0x594506=this;var _0x53575b=_0x594506['voiceQueues'][_0x594506['actions'][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]];if(strategy[this['voiceQueues'][this[_0xaf46('0x120')][_0x103e6d['actionid']]['queue']][_0xaf46('0x4b')]]===_0xaf46('0x18')){if(this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]&&this['actions'][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0x124')]){this['preview'][_0xaf46('0x12a')](this['actions'][_0x103e6d[_0xaf46('0x121')]]['idHopper'],this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0x124')])['catch'](function(_0x2f24c2){logger['error'](_0xaf46('0x12b'),util[_0xaf46('0x98')](_0x2f24c2,{'showHidden':![],'depth':null}));})[_0xaf46('0x12c')](function(){_0x594506[_0xaf46('0xb3')](_0x594506[_0xaf46('0x1d')][_0x594506[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]['queue']]);_0x594506['agents'][_0x594506[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]['stateinterface']]['locked']=![];delete _0x594506[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]];unlockQueueStatus(_0x53575b);});}else{this[_0xaf46('0xb3')](this[_0xaf46('0x1d')][this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]]);this[_0xaf46('0xbe')]({'active':![],'ContactId':this['actions'][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xd2')],'ListId':this[_0xaf46('0x120')][_0x103e6d['actionid']][_0xaf46('0xd3')],'VoiceQueueId':this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x12d')));delete this['actions'][_0x103e6d['actionid']];unlockQueueStatus(_0x53575b);}}else if((strategy[this[_0xaf46('0x1d')][this['actions'][_0x103e6d[_0xaf46('0x121')]]['queue']]['strategy']]||_0xaf46('0x17'))==='rrmemory'){var _0x49acdf;if(this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]&&!_[_0xaf46('0x80')](this['queueBooked'][this['actions'][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]])){if(this[_0xaf46('0x12e')][_0x594506[_0xaf46('0x120')][_0x103e6d['actionid']][_0xaf46('0xb1')]]){this[_0xaf46('0x12e')][_0x594506['actions'][_0x103e6d[_0xaf46('0x121')]]['queue']]=this[_0xaf46('0x12e')][this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]]?this[_0xaf46('0x12e')][this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]]:this[_0xaf46('0x26')][this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]['queue']]?this[_0xaf46('0x26')][this['actions'][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]][_0xaf46('0x12f')]||0x0:0x0;}this[_0xaf46('0x26')][this['actions'][_0x103e6d[_0xaf46('0x121')]][_0xaf46('0xb1')]][_0xaf46('0x12f')]=this[_0xaf46('0x12e')][this[_0xaf46('0x120')][_0x103e6d[_0xaf46('0x121')]]['queue']];for(var _0x41f677=0x0;_0x41f677=0x0;})[_0xaf46('0xb0')](myreject(_0x12f0bc)));}}else{_0x3cb89a[_0xaf46('0x125')](ami[_0xaf46('0x143')]({'action':_0xaf46('0x144'),'command':util[_0xaf46('0x7a')](_0xaf46('0x145'),_0x42d81c,!_['isUndefined'](config[_0xaf46('0x141')][_0x250a00])?_0x250a00:'')})[_0xaf46('0xb5')](function(_0x1ee78d){return _0x1ee78d[_0xaf46('0x147')][_0xaf46('0x148')](_0xaf46('0x149'))>=0x0;})[_0xaf46('0xb0')](myreject(_0x12f0bc)));}BPromise['all'](_0x3cb89a)['then'](function(_0x2bac52){var _0x31ba09=_[_0xaf46('0x14a')](_0x2bac52);if(_0x31ba09){return _0x5f3fd7(_0x31ba09);}else{_0x37fdcd[_0xaf46('0x3a')]=_0x33b253?'GLOBAL_INTERVAL_IS_OVERTIME':_0xaf46('0x14b');return _0x12f0bc(msgResponse(_0xaf46('0x14c'),'Failure',_0xaf46('0x14d')+_0x33b253+'\x20'+_0x1eb215+_0xaf46('0x14e')+util['inspect'](_0x42d81c,{'showHidden':![],'depth':null})+_0xaf46('0x14f')+_0x250a00));}})[_0xaf46('0xb0')](function(_0x3f2bc6){return _0x12f0bc(msgResponse(_0xaf46('0x13c'),_0xaf46('0x13e'),JSON[_0xaf46('0x45')](_0x3f2bc6)));});});};Dialer['prototype'][_0xaf46('0x150')]=function(_0x50caea){var _0x1c8b68=this;return function(){switch(_0x50caea[_0xaf46('0x5a')]){case'progressive':freeVariablesPredictive(_0x50caea);_0x1c8b68[_0xaf46('0x151')](_0x50caea,0x1);break;case _0xaf46('0x152'):freeVariablesPredictive(_0x50caea);_0x1c8b68['handlePower'](_0x50caea,_0x50caea[_0xaf46('0x153')]);break;case _0xaf46('0xa'):_0x1c8b68[_0xaf46('0xa')](_0x50caea);break;case'booked':freeVariablesPredictive(_0x50caea);_0x1c8b68[_0xaf46('0x151')](_0x50caea,0x1);break;default:freeVariablesPredictive(_0x50caea);logger[_0xaf46('0x97')](_0xaf46('0x154'),_0x50caea[_0xaf46('0x3c')],_0xaf46('0x155'));}};};Dialer[_0xaf46('0x19')][_0xaf46('0x156')]=function(_0x2ba753){var _0x233d14=this;return function(){_0x233d14['handleIvr'](_0x2ba753);};};Dialer[_0xaf46('0x19')][_0xaf46('0xc')]=function(_0x49662b){var _0x2936e5=this;if(isNotPreview(_0x49662b[_0xaf46('0x5a')])){if(isVoiceQueueOutbound(_0x49662b[_0xaf46('0x54')])&&isActive(_0x49662b[_0xaf46('0x59')])){_0x49662b[_0xaf46('0xa1')]=!![];BPromise[_0xaf46('0xb8')]()[_0xaf46('0xb5')](checkIsLoggedIn(_0x49662b,_0x49662b[_0xaf46('0x4d')]))[_0xaf46('0xb5')](checkIsActive(_0x49662b,_0x49662b[_0xaf46('0x59')]))['then'](checkInterval(_0x49662b))['then'](_0x2936e5[_0xaf46('0x13a')](_0x49662b))[_0xaf46('0xb5')](_0x2936e5['checkIfTime'](_0x49662b[_0xaf46('0x157')],_0x49662b[_0xaf46('0x158')],_0x49662b[_0xaf46('0x3c')],_0x49662b))['then'](_0x2936e5[_0xaf46('0x13d')](_0x49662b[_0xaf46('0x40')],_0x49662b[_0xaf46('0x158')],_0x49662b[_0xaf46('0x3c')],_0x49662b))['then'](_0x2936e5[_0xaf46('0x150')](_0x49662b))[_0xaf46('0xb0')](loggerCatchQueueSummary(_0xaf46('0x159'),_0x49662b));}else{notSendMessagesQueue(_0x49662b);}}else{freeVariablesPredictive(_0x49662b);}};Dialer[_0xaf46('0x19')]['syncCampaigns']=function(){var _0x1da067=this;var _0x4e8752;for(var _0x33add9 in this[_0xaf46('0x1e')]){if(typeof this[_0xaf46('0x1e')][_0x33add9]!=='undefined'){_0x4e8752=this['campaigns'][_0x33add9];if(isCampaignIvr(_0x4e8752[_0xaf46('0x54')])&&isActive(_0x4e8752['active'])){_0x4e8752['sendMessageOneNotActive']=!![];BPromise[_0xaf46('0xb8')]()['then'](checkIsActive(_0x4e8752,_0x4e8752['active']))[_0xaf46('0xb5')](checkInterval(_0x4e8752))[_0xaf46('0xb5')](_0x1da067[_0xaf46('0x13a')](_0x4e8752))[_0xaf46('0xb5')](_0x1da067[_0xaf46('0x13b')](_0x4e8752['dialGlobalInterval'],_0x4e8752[_0xaf46('0x158')],_0x4e8752[_0xaf46('0x3c')],_0x4e8752))['then'](_0x1da067[_0xaf46('0x13d')](_0x4e8752[_0xaf46('0x40')],_0x4e8752['dialTimezone'],_0x4e8752['name'],_0x4e8752))[_0xaf46('0xb5')](_0x1da067[_0xaf46('0x156')](_0x4e8752))[_0xaf46('0xb0')](loggerCatchQueueSummary(_0xaf46('0x15a'),_0x4e8752));}else{notSendMessagesCampaign(_0x4e8752);}}}};function getCallerIdRandom(_0x587954,_0x39f916){var _0x1a4862;var _0x25ad24;var _0x5a220c;if(_0x39f916<=0x0){_0x39f916=0x1;}_0x1a4862=new RegExp(_0xaf46('0x15b')+_0x39f916+'}$');_0x25ad24=Math[_0xaf46('0x15c')](0xa,_0x39f916-0x1);_0x5a220c=Math[_0xaf46('0x15c')](0xa,_0x39f916)-0x1;return util['format']('%s',_['replace'](_0x587954,_0x1a4862,_[_0xaf46('0x15d')](_0x25ad24,_0x5a220c)));}function extractCalleridName(_0x52ea03){var _0x10af21=_0x52ea03[_0xaf46('0x15e')](/"(.*?)"/);return _0x10af21?_0x10af21[0x1]:_0x52ea03;}function extractCalleridNumber(_0x56d861){var _0x58c93b=_0x56d861['match'](/<(.*?)>/);return _0x58c93b?_0x58c93b[0x1]:_0x56d861;}Dialer[_0xaf46('0x19')][_0xaf46('0x15f')]=function(_0x4c4d84,_0x4cc562){var _0x120d6d=this;var _0x2fb274=uuid['v4']();this[_0xaf46('0x120')][_0x2fb274]=new Action(_0x4c4d84,_0x4cc562,_0x2fb274);return new BPromise(function(_0x5a7864,_0x466e0a){if(_[_0xaf46('0x39')](_0x4c4d84)&&typeof _0x4c4d84!==_0xaf46('0x160')){return _0x466e0a(msgResponse(_0xaf46('0x161'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xaf46('0x39')](_0x4cc562['Contact'][_0xaf46('0x162')])||_0x4cc562[_0xaf46('0x163')][_0xaf46('0x162')]===null){return _0x466e0a(msgResponse(_0xaf46('0x161'),_0xaf46('0x13e'),_0xaf46('0x164')));}var _0x278864={'XMD-CALLERID':_0x120d6d[_0xaf46('0x120')][_0x2fb274][_0xaf46('0x165')](),'XMD-AGI':_0x4c4d84[_0xaf46('0x106')]?util[_0xaf46('0x7a')](_0xaf46('0x166'),ipAgi,_0x4c4d84[_0xaf46('0x106')]):_0xaf46('0x167'),'XMD-AGIAFTER':_0x4c4d84[_0xaf46('0x168')]?util[_0xaf46('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4c4d84['dialQueueProject2']):_0xaf46('0x167'),'XMD-QUEUE':_0x4c4d84[_0xaf46('0x54')]===_0xaf46('0x4a')?util['format'](_0xaf46('0x169'),_0x4c4d84[_0xaf46('0x3c')],_0x4c4d84['dialQueueOptions']||'',_0x4c4d84['dialAgiAfterHangupAgent']?'c':'',_0x4c4d84[_0xaf46('0x115')]||0x3):'NONE','XMD-CONTACTID':_0x4cc562[_0xaf46('0xd2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x120d6d[_0xaf46('0x120')][_0x2fb274]['getCaller'](),'XMD-AMD':_0x4c4d84[_0xaf46('0xe1')]?_0xaf46('0x16a'):_0xaf46('0x167'),'XMD-DESTINATION':_0xaf46('0x16b')};if(_0x4c4d84[_0xaf46('0xe1')]){_0x278864[_0xaf46('0x16c')]=_0x4c4d84['dialAMDInitialSilence']||0x9c4;_0x278864['XMD-AMDGREETING']=_0x4c4d84[_0xaf46('0x16d')]||0x5dc;_0x278864['XMD-AMDAFTERGREETINGSILENCE']=_0x4c4d84[_0xaf46('0x16e')]||0x320;_0x278864['XMD-AMDTOTALANALYSISTIME']=_0x4c4d84[_0xaf46('0x16f')]||0x1388;_0x278864[_0xaf46('0x170')]=_0x4c4d84['dialAMDMinWordLength']||0x64;_0x278864[_0xaf46('0x171')]=_0x4c4d84[_0xaf46('0x172')]||0x32;_0x278864[_0xaf46('0x173')]=_0x4c4d84[_0xaf46('0x174')]||0x3;_0x278864[_0xaf46('0x175')]=_0x4c4d84['dialAMDSilenceThreshold']||0x100;_0x278864[_0xaf46('0x176')]=_0x4c4d84['dialAMDMaximumWordLength']||0x1388;}if(_0x4c4d84[_0xaf46('0x54')]===_0xaf46('0x4a')){_0x278864[_0xaf46('0x177')]=_0x4cc562[_0xaf46('0xd5')];}else{_0x278864[_0xaf46('0x178')]=_0x4cc562[_0xaf46('0xd6')];}for(var _0xb3bf0c in _0x4cc562['Contact']){if(typeof _0x4cc562['Contact'][_0xb3bf0c]!=='undefined'){if(isNotNull(_0x4cc562[_0xaf46('0x163')][_0xb3bf0c])&&_0xb3bf0c!=='id'&&_0xb3bf0c!==_0xaf46('0x179')&&_0xb3bf0c!==_0xaf46('0x17a')&&_0xb3bf0c!=='updatedAt'){_0x278864[util[_0xaf46('0x7a')](_0xaf46('0x17b'),_0xaf46('0x17c'),_[_0xaf46('0x17d')](_0xb3bf0c))]=_0x4cc562[_0xaf46('0x163')][_0xb3bf0c];}}}var _0x5d2079=_0x120d6d[_0xaf46('0xd9')](_0x4c4d84['Trunk'])?getCallerId(_0x4c4d84['Trunk'][_0xaf46('0x17e')],_0x4c4d84[_0xaf46('0x5b')],_0x4c4d84[_0xaf46('0x17f')]>0x0?getCallerIdRandom(_0x4c4d84['dialOriginateCallerIdNumber'],_0x4c4d84['dialRandomLastDigitCallerIdNumber']):_0x4c4d84[_0xaf46('0x5c')]):getCallerId(_[_0xaf46('0xae')](_0x4c4d84[_0xaf46('0x180')])?_0x4c4d84[_0xaf46('0x78')][_0xaf46('0x17e')]:_0x4c4d84['TrunkBackup'][_0xaf46('0x17e')],_0x4c4d84[_0xaf46('0x5b')],_0x4c4d84[_0xaf46('0x17f')]>0x0?getCallerIdRandom(_0x4c4d84[_0xaf46('0x5c')],_0x4c4d84[_0xaf46('0x17f')]):_0x4c4d84[_0xaf46('0x5c')]);if(_0x5d2079){_0x278864[_0xaf46('0x181')]=_0x120d6d[_0xaf46('0x120')][_0x2fb274][_0xaf46('0x182')]=extractCalleridName(_0x5d2079);_0x278864['XMD-ORIGINATECALLERIDNUM']=_0x120d6d['actions'][_0x2fb274][_0xaf46('0x183')]=extractCalleridNumber(_0x5d2079);}return ami[_0xaf46('0x143')]({'actionid':_0x2fb274,'action':_0xaf46('0x161'),'channel':_0x120d6d['isTrunkReachable'](_0x4c4d84[_0xaf46('0x78')])?util[_0xaf46('0x7a')](_0xaf46('0x184'),_0x4c4d84[_0xaf46('0x78')][_0xaf46('0x3c')],isNotNull(_0x4c4d84[_0xaf46('0x5e')])?_0x4c4d84[_0xaf46('0x5e')]['trim']()||'':'',_0x4c4d84['dialCutDigit']>0x0?_0x4cc562[_0xaf46('0x163')][_0xaf46('0x162')][_0xaf46('0x185')](_0x4c4d84[_0xaf46('0x186')]):_0x4cc562[_0xaf46('0x163')][_0xaf46('0x162')]):util[_0xaf46('0x7a')](_0xaf46('0x184'),_[_0xaf46('0xae')](_0x4c4d84[_0xaf46('0x180')])?_0x4c4d84[_0xaf46('0x78')][_0xaf46('0x3c')]:_0x4c4d84[_0xaf46('0x180')]['name'],isNotNull(_0x4c4d84[_0xaf46('0x5e')])?_0x4c4d84[_0xaf46('0x5e')][_0xaf46('0x187')]()||'':'',_0x4c4d84[_0xaf46('0x186')]>0x0?_0x4cc562[_0xaf46('0x163')][_0xaf46('0x162')][_0xaf46('0x185')](_0x4c4d84[_0xaf46('0x186')]):_0x4cc562[_0xaf46('0x163')]['phone']),'callerid':_0x5d2079,'Exten':_0xaf46('0x16b'),'Context':_0xaf46('0x188'),'Priority':'1','variable':_0x278864,'timeout':(_0x4c4d84['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2fb274})[_0xaf46('0xb5')](function(_0x4ae0f6){return _0x5a7864(_0x4ae0f6);})[_0xaf46('0xb0')](function(_0x47f3e7){_0x4c4d84[_0xaf46('0x67')]+=0x1;var _0x4f06e0=new History(_0x120d6d[_0xaf46('0x120')][_0x2fb274]);logger[_0xaf46('0x97')](util[_0xaf46('0x7a')](_0xaf46('0x189'),JSON['stringify'](_0x47f3e7)));_0x4f06e0['state']=0xe;_0x4f06e0['statedesc']='OriginateError';_0x4f06e0[_0xaf46('0x11b')]=moment()[_0xaf46('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f06e0['endtime']=_0x4f06e0[_0xaf46('0x11b')];_0x120d6d[_0xaf46('0xcb')](_0x4f06e0)['catch'](loggerCatch(_0xaf46('0x18a')));_0x120d6d[_0xaf46('0xc9')](_0x4f06e0)['catch'](loggerCatch(_0xaf46('0x18a')))[_0xaf46('0x12c')](function(){delete _0x120d6d[_0xaf46('0x120')][_0x2fb274];return _0x466e0a(msgResponse('originate','Error',_0xaf46('0x18b')));});});});};Dialer[_0xaf46('0x19')][_0xaf46('0x2c')]=function(_0x279405){var _0x4b6fa8=this[_0xaf46('0x120')][_0x279405['actionid']];if(_0x4b6fa8){delete this['actions'][_0x279405['actionid']];_0x4b6fa8[_0xaf46('0x114')]=moment()['format'](_0xaf46('0xfb'));var _0x2a1fa9=_0x4b6fa8[_0xaf46('0x54')]==='ivr'?this[_0xaf46('0x1e')][_0x4b6fa8['queue']]:this['voiceQueues'][_0x4b6fa8[_0xaf46('0x18c')]()];if(!this[_0xaf46('0x18d')](_0x279405[_0xaf46('0x18e')])){this[_0xaf46('0xb3')](_0x2a1fa9);return this[_0xaf46('0x18f')](_0x4b6fa8,_0x2a1fa9,_0x279405)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x190')));}this[_0xaf46('0x24')][_0x279405[_0xaf46('0xe3')]]=_0x4b6fa8;}};Dialer[_0xaf46('0x19')][_0xaf46('0x191')]=function(_0x1bac28,_0x3cfd8c,_0xbb95ac){var _0x17a92b=new History(_0x3cfd8c);if(_0x17a92b[_0xaf46('0xee')]+_0x17a92b['countcongestionretry']+_0x17a92b['countnoanswerretry']+_0x17a92b[_0xaf46('0xf1')]+_0x17a92b[_0xaf46('0x100')]+_0x17a92b['countabandonedretry']+_0x17a92b[_0xaf46('0xf3')]+_0x17a92b[_0xaf46('0x101')]>=_0xbb95ac[_0xaf46('0xf4')]-0x1){return!![];}switch(_0x1bac28){case 0x3:if(_0x17a92b['countnoanswerretry']>=_0xbb95ac['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xaf46('0xbe')]({'active':![],'countnoanswerretry':_0x17a92b[_0xaf46('0xf0')]+=0x1,'scheduledat':moment()['add'](_0xbb95ac['dialNoAnswerRetryFrequency'],_0xaf46('0xfa'))[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x192')));break;case 0x5:if(_0x17a92b[_0xaf46('0xee')]>=_0xbb95ac[_0xaf46('0x193')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x17a92b[_0xaf46('0xee')]+=0x1,'scheduledat':moment()['add'](_0xbb95ac[_0xaf46('0x194')],'minutes')['format'](_0xaf46('0xfb')),'ContactId':_0x17a92b['ContactId'],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x17a92b[_0xaf46('0xef')]>=_0xbb95ac['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x17a92b[_0xaf46('0xef')]+=0x1,'scheduledat':moment()[_0xaf46('0xf9')](_0xbb95ac[_0xaf46('0x195')],_0xaf46('0xfa'))[_0xaf46('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x196')));break;case 0x0:if(_0x17a92b[_0xaf46('0xf1')]>=_0xbb95ac[_0xaf46('0x197')]-0x1){return!![];}else{this[_0xaf46('0xbe')]({'active':![],'countnosuchnumberretry':_0x17a92b[_0xaf46('0xf1')]+=0x1,'scheduledat':moment()[_0xaf46('0xf9')](_0xbb95ac[_0xaf46('0x198')],'minutes')['format'](_0xaf46('0xfb')),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x199')));}break;case 0xa:if(_0x17a92b[_0xaf46('0x100')]>=_0xbb95ac[_0xaf46('0x119')]-0x1){return!![];}this[_0xaf46('0xbe')]({'active':![],'countdropretry':_0x17a92b[_0xaf46('0x100')]+=0x1,'scheduledat':moment()[_0xaf46('0xf9')](_0xbb95ac[_0xaf46('0x11a')],_0xaf46('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})['catch'](loggerCatch(_0xaf46('0x19a')));break;case 0xb:if(_0x17a92b[_0xaf46('0xf2')]>=_0xbb95ac[_0xaf46('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x17a92b[_0xaf46('0xf2')]+=0x1,'scheduledat':moment()['add'](_0xbb95ac[_0xaf46('0x19c')],_0xaf46('0xfa'))[_0xaf46('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x19d')));break;case 0x13:if(_0x17a92b[_0xaf46('0xf3')]>=_0xbb95ac[_0xaf46('0xf6')]-0x1){return!![];}this[_0xaf46('0xbe')]({'active':![],'countmachineretry':_0x17a92b[_0xaf46('0xf3')]+=0x1,'scheduledat':moment()[_0xaf46('0xf9')](_0xbb95ac['dialMachineRetryFrequency'],_0xaf46('0xfa'))[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xfc')));break;case 0x14:if(_0x17a92b['countagentrejectretry']>=_0xbb95ac[_0xaf46('0x19e')]-0x1){return!![];}this[_0xaf46('0xbe')]({'active':![],'countagentrejectretry':_0x17a92b[_0xaf46('0x101')]+=0x1,'scheduledat':moment()[_0xaf46('0xf9')](_0xbb95ac[_0xaf46('0x19f')],_0xaf46('0xfa'))[_0xaf46('0x7a')](_0xaf46('0xfb')),'ContactId':_0x17a92b[_0xaf46('0xd2')],'ListId':_0x17a92b[_0xaf46('0xd3')],'VoiceQueueId':_0x17a92b[_0xaf46('0xd5')]||undefined,'CampaignId':_0x17a92b[_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1a0')));break;default:return!![];}};Dialer[_0xaf46('0x19')][_0xaf46('0x18f')]=function(_0xf3c0c1,_0xdb0570,_0x1396a5){var _0x2586d5=this;var _0x52e82a=new History(_0xf3c0c1);return new BPromise(function(_0x35ad9d,_0x5876a8){if(_[_0xaf46('0x39')](_0xdb0570)&&typeof _0xdb0570!=='object'){return _0x5876a8(msgResponse('[callProgressDetecting]',_0xaf46('0x13e'),'entity\x20is\x20undefine'));}if(_[_0xaf46('0x39')](_0x1396a5)&&typeof _0x1396a5!==_0xaf46('0x160')){return _0x5876a8(msgResponse(_0xaf46('0x1a1'),_0xaf46('0x13e'),_0xaf46('0x1a2')));}switch(_0x1396a5[_0xaf46('0x10c')]){case'0':_0xdb0570[_0xaf46('0x66')]+=0x1;_0x52e82a[_0xaf46('0xa7')]=0x0;_0x52e82a['statedesc']=_0xaf46('0x1a3');_0x52e82a[_0xaf46('0xf1')]+=0x1;_0x52e82a[_0xaf46('0xec')]+=0x1;ami[_0xaf46('0x49')]('custom:agentnosuchnumber',ut['buildObj'](_0xf3c0c1,_0xaf46('0x1a4')));_0x2586d5['createHistory'](_0x52e82a)['catch'](loggerCatch(_0xaf46('0xed')));if(_0x2586d5[_0xaf46('0x191')](0x0,_0xf3c0c1,_0xdb0570)){if(_0x52e82a[_0xaf46('0xf1')]>=_0xdb0570['dialNoSuchNumberMaxRetry']){_0x2586d5[_0xaf46('0xf7')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1a5'));}else{_0x2586d5[_0xaf46('0x102')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1a5'));}}break;case'3':_0xdb0570['outboundNoAnswerCallsDay']+=0x1;_0x52e82a[_0xaf46('0xa7')]=0x3;_0x52e82a[_0xaf46('0xa8')]='NoAnswer';_0x52e82a[_0xaf46('0xf0')]+=0x1;_0x52e82a['countglobal']+=0x1;ami[_0xaf46('0x49')](_0xaf46('0x1a6'),ut[_0xaf46('0xe7')](_0xf3c0c1,'noanswer'));_0x2586d5['createHistory'](_0x52e82a)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1a7')));if(_0x2586d5[_0xaf46('0x191')](0x3,_0xf3c0c1,_0xdb0570)){if(_0x52e82a[_0xaf46('0xf0')]>=_0xdb0570['dialNoAnswerMaxRetry']){_0x2586d5['createStateFinal'](_0x52e82a,_0x35ad9d,_0x5876a8,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2586d5[_0xaf46('0x102')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1a8'));}}break;case'5':_0xdb0570[_0xaf46('0x1a9')]+=0x1;_0x52e82a['state']=0x5;_0x52e82a[_0xaf46('0xa8')]=_0xaf46('0x1aa');_0x52e82a['countbusyretry']+=0x1;_0x52e82a['countglobal']+=0x1;ami[_0xaf46('0x49')](_0xaf46('0x1ab'),ut[_0xaf46('0xe7')](_0xf3c0c1,_0xaf46('0x1ac')));_0x2586d5[_0xaf46('0xcb')](_0x52e82a)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1ad')));if(_0x2586d5[_0xaf46('0x191')](0x5,_0xf3c0c1,_0xdb0570)){if(_0x52e82a[_0xaf46('0xee')]>=_0xdb0570['dialBusyMaxRetry']){_0x2586d5[_0xaf46('0xf7')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1ae'));}else{_0x2586d5[_0xaf46('0x102')](_0x52e82a,_0x35ad9d,_0x5876a8,'reason\x205\x20busy');}}break;case'8':_0xdb0570['outboundCongestionCallsDay']+=0x1;_0x52e82a[_0xaf46('0xa7')]=0x8;_0x52e82a[_0xaf46('0xa8')]=_0xaf46('0x1af');_0x52e82a[_0xaf46('0xef')]+=0x1;_0x52e82a[_0xaf46('0xec')]+=0x1;ami[_0xaf46('0x49')](_0xaf46('0x1b0'),ut[_0xaf46('0xe7')](_0xf3c0c1,_0xaf46('0x1b1')));_0x2586d5[_0xaf46('0xcb')](_0x52e82a)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1b2')));if(_0x2586d5[_0xaf46('0x191')](0x8,_0xf3c0c1,_0xdb0570)){if(_0x52e82a['countcongestionretry']>=_0xdb0570[_0xaf46('0x1b3')]){_0x2586d5[_0xaf46('0xf7')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1b4'));}else{_0x2586d5[_0xaf46('0x102')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1b4'));}}break;case'11':_0xdb0570[_0xaf46('0x1b5')]+=0x1;_0x52e82a[_0xaf46('0xa7')]=0xb;_0x52e82a[_0xaf46('0xa8')]=_0xaf46('0x11f');_0x52e82a['countabandonedretry']+=0x1;_0x52e82a[_0xaf46('0xec')]+=0x1;_0x2586d5[_0xaf46('0xcb')](_0x52e82a)[_0xaf46('0xb0')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2586d5['checkRetriveMax'](0xb,_0xf3c0c1,_0xdb0570)){if(_0x52e82a[_0xaf46('0xf2')]>=_0xdb0570['dialAbandonedMaxRetry']){_0x2586d5['createStateFinal'](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1b6'));}else{_0x2586d5['stateGlobal'](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1b6'));}}break;case'20':_0xdb0570[_0xaf46('0x69')]+=0x1;_0x52e82a[_0xaf46('0xa7')]=0x14;_0x52e82a[_0xaf46('0xa8')]='AgentReject';_0x52e82a[_0xaf46('0x101')]+=0x1;_0x52e82a[_0xaf46('0xec')]+=0x1;ami[_0xaf46('0x49')](_0xaf46('0x1b7'),ut['buildObj'](_0xf3c0c1,_0xaf46('0x1b8')));_0x2586d5['createHistory'](_0x52e82a)[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1b9')));if(_0x2586d5[_0xaf46('0x191')](0x14,_0xf3c0c1,_0xdb0570)){if(_0x52e82a[_0xaf46('0x101')]>=_0xdb0570[_0xaf46('0x19e')]){_0x2586d5['createStateFinal'](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1ba'));}else{_0x2586d5[_0xaf46('0x102')](_0x52e82a,_0x35ad9d,_0x5876a8,_0xaf46('0x1ba'));}}break;default:_0xdb0570[_0xaf46('0x6a')]+=0x1;_0x52e82a[_0xaf46('0xa7')]=0xc;_0x52e82a[_0xaf46('0xa8')]=_0x1396a5['reason'];_0x2586d5[_0xaf46('0xcb')](_0x52e82a)[_0xaf46('0xb0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2586d5['checkRetriveMax'](_0x1396a5[_0xaf46('0x10c')],_0xf3c0c1,_0xdb0570)){if(_0x52e82a[_0xaf46('0xee')]+_0x52e82a[_0xaf46('0xef')]+_0x52e82a[_0xaf46('0xf0')]+_0x52e82a['countnosuchnumberretry']+_0x52e82a[_0xaf46('0x100')]+_0x52e82a[_0xaf46('0xf2')]+_0x52e82a['countmachineretry']+_0x52e82a[_0xaf46('0x101')]>=_0xdb0570[_0xaf46('0xf4')]){_0x2586d5[_0xaf46('0x102')](_0x52e82a,_0x35ad9d,_0x5876a8,_0x1396a5[_0xaf46('0x10c')]);}else{_0x2586d5[_0xaf46('0xf7')](_0x52e82a,_0x35ad9d,_0x5876a8,_0x1396a5[_0xaf46('0x10c')]);}}}});};Dialer[_0xaf46('0x19')][_0xaf46('0x102')]=function(_0x10ba81,_0x4f1c80,_0x10e291,_0x64a4ed){var _0x299ab8=new Final(_0x10ba81);_0x299ab8[_0xaf46('0xa7')]=0xf;_0x299ab8[_0xaf46('0xa8')]=_0xaf46('0x1bb');this[_0xaf46('0xf7')](_0x299ab8,_0x4f1c80,_0x10e291,_0x64a4ed);};Dialer[_0xaf46('0x19')]['createStateFinal']=function(_0x2db5b3,_0xe55021,_0x32596b,_0xfe8a36){this['moveContactManagedDialer'](_0x2db5b3)[_0xaf46('0xb5')](function(){return _0xe55021(msgResponse(_0xaf46('0x1a1'),_0xaf46('0x1bc'),_0xfe8a36));})['catch'](function(){return _0x32596b(msgResponse(_0xaf46('0x1bd'),'Failure',_0xaf46('0x1be')));});};Dialer[_0xaf46('0x19')][_0xaf46('0xa')]=function(_0x299702){var _0x47c6b8=_0x299702['dialPredictiveOptimizationPercentage']/0x64;var _0x8f3faa=_0x299702[_0xaf46('0x64')]/(_0x299702['outboundDropCallsDayTimeout']+_0x299702['outboundAnswerCallsDay']);var _0x32400e=Math[_0xaf46('0x1bf')](_0x299702[_0xaf46('0x1c0')]*(_0x299702[_0xaf46('0x1c1')]/0x64));var _0x3bac8c=Math[_0xaf46('0x1bf')](_0x299702[_0xaf46('0x1c0')]*(_0x299702[_0xaf46('0x1c2')]/0x64));var _0x526587=_0x299702[_0xaf46('0x4c')]+_0x299702[_0xaf46('0x52')];var _0x541d95=Math['floor'](_0x299702[_0xaf46('0x73')]*_0x299702[_0xaf46('0x8e')]*_0x299702[_0xaf46('0x6e')]*_0x299702['predictiveIntervalMultiplicativeFactor']);if(_[_0xaf46('0x39')](_0x299702[_0xaf46('0x77')])){if(!_['isUndefined'](_0x299702[_0xaf46('0x76')])){_0x299702[_0xaf46('0x76')]=undefined;loggerPredictive[_0xaf46('0x97')](_0xaf46('0x1c3'),_0xaf46('0x1c4'));}if(!_[_0xaf46('0x39')](_0x299702[_0xaf46('0x93')])){loggerPredictive[_0xaf46('0x97')](_0xaf46('0x1c3'),_0xaf46('0x1c5'));clearInterval(_0x299702[_0xaf46('0x93')]);_0x299702[_0xaf46('0x93')]=undefined;}_0x299702['startProgressive']=moment()['format'](_0xaf46('0xfb'));loggerPredictive['info'](_0x299702['name'],_0xaf46('0x1c6'),_0x299702['startProgressive']);this[_0xaf46('0x151')](_0x299702,0x1);}else if(ifInterval(_0x299702[_0xaf46('0x1c7')],_0x299702[_0xaf46('0x77')])){this[_0xaf46('0x151')](_0x299702,0x1);loggerPredictiveCalls['info'](_0xaf46('0x1c8'),_0x299702[_0xaf46('0x77')],_0x299702[_0xaf46('0x3c')]);_0x299702[_0xaf46('0x73')]=0x0;_0x299702[_0xaf46('0x116')]=0x0;}else if(_0x47c6b8<_0x8f3faa&&_0x299702['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x299702);loggerPredictive[_0xaf46('0x81')](_0xaf46('0x1c9'),'Dropped\x20calls\x20day',_0x8f3faa,'startProgressive',_0x299702[_0xaf46('0x3c')]);}else if(_0x541d95<_0x299702[_0xaf46('0x116')]&&_0x299702[_0xaf46('0x1ca')]===_0xaf46('0x1cb')){freeVariablesPredictive(_0x299702);loggerPredictive['info'](_0xaf46('0x1cc'),_0xaf46('0x1cd'),_0x541d95,_0xaf46('0x1ce'),_0x299702[_0xaf46('0x116')],_0xaf46('0x77'),_0x299702['name']);}else if(!ifInterval(_0x299702['dialPredictiveInterval'],_0x299702[_0xaf46('0x77')])&&_[_0xaf46('0x39')](_0x299702[_0xaf46('0x76')])&&!_[_0xaf46('0x39')](_0x299702[_0xaf46('0x77')])){_0x299702['startPredictive']=moment()[_0xaf46('0x7a')](_0xaf46('0xfb'));loggerPredictive[_0xaf46('0x81')](_0x299702[_0xaf46('0x3c')],_0xaf46('0x1cf'),_0x299702[_0xaf46('0x76')]);this[_0xaf46('0xbc')](_0x299702['dialPredictiveInterval'])[_0xaf46('0xb5')](this[_0xaf46('0x1d0')](_0x299702))['then'](mergeDataErlangB(_0x299702))[_0xaf46('0xb5')](this[_0xaf46('0x1d1')](_0x299702))[_0xaf46('0xb0')](loggerCatchPredictive(_0xaf46('0x1d2'),_0x299702));}else if(!ifInterval(_0x299702[_0xaf46('0x1c7')],_0x299702[_0xaf46('0x76')])){_0x299702[_0xaf46('0x116')]=0x0;_0x299702[_0xaf46('0x76')]=moment()['format'](_0xaf46('0xfb'));loggerPredictive[_0xaf46('0x81')](_0x299702[_0xaf46('0x3c')],_0xaf46('0x1d3'),_0x299702[_0xaf46('0x76')]);clearInterval(_0x299702[_0xaf46('0x93')]);_0x299702[_0xaf46('0x93')]=undefined;this[_0xaf46('0xbc')](_0x299702[_0xaf46('0x1c7')])[_0xaf46('0xb5')](this[_0xaf46('0x1d0')](_0x299702))[_0xaf46('0xb5')](mergeDataErlangB(_0x299702))[_0xaf46('0xb5')](this[_0xaf46('0x1d1')](_0x299702))[_0xaf46('0xb0')](loggerCatchPredictive(_0xaf46('0x1d4'),_0x299702));}else if(_0x299702[_0xaf46('0x1c0')]&&_0x526587<_0x299702[_0xaf46('0x1c0')]-_0x3bac8c){freeVariablesPredictive(_0x299702);loggerPredictive[_0xaf46('0x81')](_0x299702[_0xaf46('0x3c')],_0xaf46('0x1d5'),_0x526587,')\x20are\x20less\x20than\x20threshold\x20(',_0x299702[_0xaf46('0x1c0')],'-',_0x3bac8c,'=',_0x299702[_0xaf46('0x1c0')]-_0x3bac8c,')');}else if(_0x299702['predictiveIntervalAvailable']&&_0x526587>_0x299702[_0xaf46('0x1c0')]+_0x32400e){freeVariablesPredictive(_0x299702);loggerPredictive[_0xaf46('0x81')](_0x299702[_0xaf46('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x526587,')\x20are\x20more\x20than\x20threshold\x20(',_0x299702[_0xaf46('0x1c0')],'+',_0x32400e,'=',_0x299702[_0xaf46('0x1c0')]+_0x32400e,')');}};Dialer['prototype'][_0xaf46('0x1d0')]=function(_0x24cbf1){var _0x475342=this;return function(_0x33acb1){return new BPromise(function(_0x8a385c,_0x413153){_[_0xaf46('0xd0')](_0x24cbf1,_0x33acb1[0x0]);if(checkGetDataPredictive(_0x33acb1[0x0])){var _0x5d1571=_0x24cbf1[_0xaf46('0x1c0')]=_0x24cbf1[_0xaf46('0x52')]+_0x24cbf1['available'];var _0x19e268=_0x24cbf1[_0xaf46('0x1c7')]*0x3c;var _0x57fcfc=_0x33acb1[0x0][_0xaf46('0x88')]+_0x33acb1[0x0][_0xaf46('0x86')];var _0x2ec88c=(_0x33acb1[0x0]['predictiveIntervalAnsweredCalls']+_0x33acb1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x33acb1[0x0][_0xaf46('0x85')])/_0x33acb1[0x0][_0xaf46('0x71')];_0x24cbf1[_0xaf46('0x6e')]=_0x2ec88c>0x0?_0x2ec88c:0x1;switch(_0x24cbf1['dialPredictiveOptimization']){case _0xaf46('0x1cb'):var _0x4d5e7a=_0x24cbf1[_0xaf46('0x1d6')]/0x64;return _0x475342[_0xaf46('0x1d7')](_0x5d1571,_0x19e268,_0x57fcfc,_0x2ec88c,_0x4d5e7a)[_0xaf46('0xb5')](function(_0x44a62b){return _0x8a385c(_0x44a62b);});case _0xaf46('0x1d8'):var _0x34787f=_0x24cbf1['dialPredictiveOptimizationPercentage']/0x64;return _0x475342[_0xaf46('0x1d9')](_0x5d1571,_0x19e268,_0x57fcfc,_0x2ec88c,_0x34787f)[_0xaf46('0xb5')](function(_0x1be9c5){return _0x8a385c(_0x1be9c5);});default:return _0x413153(msgResponse(_0xaf46('0x1da'),_0xaf46('0x13e'),_0xaf46('0x1db')));}}else{return _0x413153(msgResponse(_0xaf46('0x1da'),'Failure',_0xaf46('0x1dc')));}});};};Dialer[_0xaf46('0x19')][_0xaf46('0x1dd')]=function(_0x3c6d61){var _0x19be93=this;return function(_0x2607d0){return new BPromise(function(_0x2fd613,_0x1c5f5f){_[_0xaf46('0xd0')](_0x3c6d61,_0x2607d0[0x0]);if(checkGetDataPredictive(_0x2607d0[0x0])){loggerPredictive[_0xaf46('0x81')](JSON[_0xaf46('0x45')](_0x2607d0[0x0]));if(_0x3c6d61[_0xaf46('0x1ca')]===_0xaf46('0x1cb')){return _0x19be93[_0xaf46('0xc7')](_0x3c6d61['id'])[_0xaf46('0xb5')](function(_0x2f2e78){var _0x1e36f3=_0x3c6d61[_0xaf46('0x4d')]-_0x2f2e78[0x0][_0xaf46('0x1de')];var _0x4955d9=_0x3c6d61[_0xaf46('0x1c7')]*0x3c;var _0x4bec36=_0x2607d0[0x0]['predictiveIntervalAvgTalktime']+_0x2607d0[0x0]['predictiveIntervalAvgHoldtime'];var _0x2c0140=(_0x2607d0[0x0][_0xaf46('0x6b')]+_0x2607d0[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2607d0[0x0][_0xaf46('0x85')])/_0x2607d0[0x0][_0xaf46('0x71')];var _0x1915b0=_0x3c6d61[_0xaf46('0x1d6')]/0x64;_0x3c6d61['predictiveIntervalPauses']=_0x2f2e78[0x0]['outboundQueuePauses']||0x0;_0x3c6d61[_0xaf46('0x6e')]=_0x2c0140>0x0?_0x2c0140:0x1;return _0x19be93['abandonmentRate'](_0x1e36f3,_0x4955d9,_0x4bec36,_0x2c0140,_0x1915b0);})[_0xaf46('0xb5')](function(_0x3bd0e5){return _0x2fd613(_0x3bd0e5);})[_0xaf46('0xb0')](function(_0xe0a2b8){return _0x1c5f5f(msgResponse(_0xaf46('0x1df'),_0xaf46('0x13e'),JSON[_0xaf46('0x45')](_0xe0a2b8)));});}if(_0x3c6d61[_0xaf46('0x1ca')]===_0xaf46('0x1d8')){return _0x19be93[_0xaf46('0xc7')](_0x3c6d61['id'])[_0xaf46('0xb5')](function(_0x2b12bc){var _0x4557ac=_0x3c6d61['loggedIn']-_0x2b12bc[0x0][_0xaf46('0x1de')];var _0x38f32e=_0x3c6d61[_0xaf46('0x1c7')]*0x3c;var _0x59427a=_0x2607d0[0x0]['predictiveIntervalAvgTalktime']+_0x2607d0[0x0][_0xaf46('0x86')];var _0x242261=(_0x2607d0[0x0][_0xaf46('0x6b')]+_0x2607d0[0x0][_0xaf46('0x6c')]+_0x2607d0[0x0][_0xaf46('0x85')])/_0x2607d0[0x0][_0xaf46('0x71')];var _0xd23a4=_0x3c6d61[_0xaf46('0x1d6')]/0x64;_0x3c6d61[_0xaf46('0x70')]=_0x2b12bc[0x0][_0xaf46('0x1de')]||0x0;_0x3c6d61['predictiveIntervalHitRate']=_0x242261>0x0?_0x242261:0x1;return _0x19be93[_0xaf46('0x1d9')](_0x4557ac,_0x38f32e,_0x59427a,_0x242261,_0xd23a4);})[_0xaf46('0xb5')](function(_0x9b4dfa){return _0x2fd613(_0x9b4dfa);})[_0xaf46('0xb0')](function(_0x301bac){return _0x1c5f5f(msgResponse(_0xaf46('0x1df'),_0xaf46('0x13e'),JSON[_0xaf46('0x45')](_0x301bac)));});}}else{return _0x1c5f5f(msgResponse('[getDataPredictive]','Failure',_0xaf46('0x1dc')));}});};};Dialer['prototype'][_0xaf46('0x1d1')]=function(_0x11a447){var _0x424a5b=this;return function(){var _0x16aa21=0x0;var _0x113ee4=Math[_0xaf46('0x1e0')](_0x11a447['erlangCallToSecond']*0x3e8);if(_0x113ee4>0x0){_0x113ee4=_0x113ee4<0x64?0x64:_0x113ee4;loggerPredictive[_0xaf46('0x81')](_0x11a447[_0xaf46('0x3c')],_0xaf46('0x1e1'),_0x113ee4,'milliseconds');_0x11a447[_0xaf46('0x93')]=setInterval(function(){_0x424a5b['handlePredictive'](_0x11a447);loggerPredictiveCalls[_0xaf46('0x81')](_0xaf46('0x1e2'),_0x16aa21+=0x1);},_0x113ee4);}else{loggerPredictive[_0xaf46('0x81')](_0x11a447[_0xaf46('0x3c')],_0xaf46('0x1e3'));}};};Dialer['prototype']['checkContactBlack']=function(_0x1728b2,_0x4e6078){var _0x1ef50f=this;return function(_0x3b62fc){if(_[_0xaf46('0x80')](_0x3b62fc)){if(_[_0xaf46('0xae')](_0x4e6078[_0xaf46('0xd4')])||!_0x4e6078[_0xaf46('0x1e4')]){if(_0x1728b2[_0xaf46('0x5a')]===_0xaf46('0x9')){_0x1728b2['queueStatusComplete']=_[_0xaf46('0x39')](_0x1728b2[_0xaf46('0x127')])?!![]:_0x1728b2['queueStatusComplete'];var _0x5b7566=uuid['v4']();_0x1ef50f['actions'][_0x5b7566]=new Action(_0x1728b2,_0x4e6078,_0x5b7566);loggerBooked[_0xaf46('0x81')](_0xaf46('0x1e5'),_0x5b7566,_0xaf46('0x1e6'),JSON[_0xaf46('0x45')](_0x1728b2['queueStatusComplete']),_0xaf46('0x1e7'),_0x1728b2[_0xaf46('0x3c')]);if(_0x1728b2[_0xaf46('0x127')]){_0x1728b2[_0xaf46('0x127')]=![];_0x1ef50f[_0xaf46('0x26')][_0x1ef50f[_0xaf46('0x120')][_0x5b7566][_0xaf46('0xb1')]]=[];ami[_0xaf46('0x143')]({'actionid':_0x5b7566,'action':_0xaf46('0x1e8'),'queue':_0x1728b2[_0xaf46('0x3c')]})[_0xaf46('0xb0')](function(){_0x1ef50f[_0xaf46('0xb3')](_0x1728b2);_0x1ef50f[_0xaf46('0xbe')]({'active':![],'ContactId':_0x1ef50f[_0xaf46('0x120')][_0x5b7566][_0xaf46('0xd2')],'ListId':_0x1ef50f['actions'][_0x5b7566][_0xaf46('0xd3')],'VoiceQueueId':_0x1ef50f['actions'][_0x5b7566]['VoiceQueueId']||undefined,'CampaignId':_0x1ef50f['actions'][_0x5b7566][_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1e9')));delete _0x1ef50f[_0xaf46('0x120')][_0x5b7566];});}else{loggerBooked[_0xaf46('0x81')]('[booked][checkContactBlack][else]',JSON[_0xaf46('0x45')](_0x1728b2[_0xaf46('0x127')]),_0xaf46('0x1e7'),_0x1728b2[_0xaf46('0x3c')]);_0x1ef50f[_0xaf46('0xb3')](_0x1728b2);_0x1ef50f[_0xaf46('0xbe')]({'active':![],'ContactId':_0x1ef50f[_0xaf46('0x120')][_0x5b7566][_0xaf46('0xd2')],'ListId':_0x1ef50f['actions'][_0x5b7566][_0xaf46('0xd3')],'VoiceQueueId':_0x1ef50f[_0xaf46('0x120')][_0x5b7566][_0xaf46('0xd5')]||undefined,'CampaignId':_0x1ef50f['actions'][_0x5b7566][_0xaf46('0xd6')]||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1e9')));delete _0x1ef50f['actions'][_0x5b7566];}}else{return _0x1ef50f[_0xaf46('0x15f')](_0x1728b2,_0x4e6078);}}else{if(getDiff(_0x4e6078[_0xaf46('0x1ea')])<_0x1728b2[_0xaf46('0x1eb')]*0x3c){if(_0x4e6078['Agent']&&!_0x4e6078['Agent']['voicePause']){_0x1ef50f[_0xaf46('0x1c')]['run'](_0x4e6078['id'])[_0xaf46('0x12c')](function(){_0x1ef50f[_0xaf46('0xb3')](_0x1728b2);});}else{_0x1ef50f[_0xaf46('0xc0')]({'active':![]},_0x4e6078['id'],0x1)[_0xaf46('0x12c')](function(){_0x1ef50f['updateOriginated'](_0x1728b2);});}}else{_0x1728b2[_0xaf46('0x68')]+=0x1;_0x1ef50f[_0xaf46('0xb3')](_0x1728b2);if(_0x1728b2[_0xaf46('0x1ec')]){_0x1ef50f[_0xaf46('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e6078[_0xaf46('0xd2')],'ListId':_0x4e6078[_0xaf46('0xd3')],'VoiceQueueId':_0x4e6078[_0xaf46('0xd5')]||undefined,'CampaignId':_0x4e6078['CampaignId']||undefined})[_0xaf46('0xb0')](loggerCatch(_0xaf46('0x1ed')));_0x1ef50f[_0xaf46('0xcb')](createObjHistory(_0x1728b2,_0x4e6078,_0xaf46('0x1ee'),0x17,_0xaf46('0x1ef')))['catch'](loggerCatch(_0xaf46('0x1f0')));}else{_0x1ef50f[_0xaf46('0xcf')](createObjHistory(_0x1728b2,_0x4e6078,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x1728b2[_0xaf46('0x61')]+=0x1;_0x1ef50f[_0xaf46('0xcf')](createObjHistory(_0x1728b2,_0x4e6078,_0xaf46('0x1f1'),0xd,_0xaf46('0x1f2')),_0xaf46('0x1f3'),_0xaf46('0x1f4'));throw _0xaf46('0x1f5');}};};Dialer[_0xaf46('0x19')][_0xaf46('0x1f6')]=function(_0x3441d0){var _0x35f79f=this;var _0x11f903=_0x3441d0[_0xaf46('0x1f7')]-_0x3441d0[_0xaf46('0x72')]-_0x3441d0[_0xaf46('0xc3')];emitCampaignSummary(_0x3441d0);if(_0x11f903>0x0){if(_0x11f903>this[_0xaf46('0x21')]){_0x11f903=this[_0xaf46('0x21')];}_0x3441d0['temp']+=_0x11f903;this[_0xaf46('0xc5')](_0x3441d0['id'],_0x11f903,_0x3441d0[_0xaf46('0x1f8')],_0x3441d0)[_0xaf46('0xb5')](function(_0x88e2f3){_0x3441d0[_0xaf46('0xc3')]-=_0x11f903;_0x3441d0[_0xaf46('0xc3')]=_0x3441d0[_0xaf46('0xc3')]>0x0?_0x3441d0[_0xaf46('0xc3')]:0x0;if(!checkContactEmpty(_0x88e2f3)){_0x3441d0[_0xaf46('0x3a')]=_0xaf46('0x9f');logger[_0xaf46('0x81')](_0xaf46('0x1f9')+_0x3441d0['name']);}else{_0x3441d0[_0xaf46('0x72')]+=_0x88e2f3[_0xaf46('0x130')];_0x3441d0[_0xaf46('0x3a')]=_0xaf46('0x1fa');for(var _0x1ef6ec=0x0;_0x1ef6ec<_0x88e2f3[_0xaf46('0x130')];_0x1ef6ec+=0x1){_0x3441d0[_0xaf46('0x1fb')]+=0x1;if(_[_0xaf46('0xae')](_0x88e2f3[_0x1ef6ec])||_[_0xaf46('0xae')](_0x88e2f3[_0x1ef6ec][_0xaf46('0x163')])||_['isNil'](_0x88e2f3[_0x1ef6ec][_0xaf46('0x163')][_0xaf46('0x162')])){_0x35f79f[_0xaf46('0xcd')](_0xaf46('0x1fc'),_0x3441d0,_0x88e2f3[_0x1ef6ec]);}else{_0x35f79f[_0xaf46('0xba')](_[_0xaf46('0xd1')](_0x88e2f3[_0x1ef6ec],[_0xaf46('0xd6'),'Contact.phone']))['then'](_0x35f79f[_0xaf46('0x1fd')](_0x3441d0,_0x88e2f3[_0x1ef6ec]))[_0xaf46('0xb0')](_0x35f79f[_0xaf46('0x1fe')](_0xaf46('0x1ff'),_0x3441d0));}}}})[_0xaf46('0xb0')](loggerGetContactDialer(_0xaf46('0x200'),_0x3441d0,_0x11f903));}};Dialer[_0xaf46('0x19')][_0xaf46('0x151')]=function(_0x5abc29,_0x3f337b){var _0x16a4ac=this;var _0x36596b=[];var _0x3690c7=_0x3f337b>=0x1?_0x3f337b:0x1;if(_0x5abc29[_0xaf46('0x5a')]===_0xaf46('0x9')){_0x3690c7=0x1;}var _0x2268f0=Math[_0xaf46('0x1e0')](_0x5abc29[_0xaf46('0x4c')]*_0x3690c7)-_0x5abc29[_0xaf46('0x72')]-_0x5abc29[_0xaf46('0xc3')];emitVoiceQueueSummary(_0x5abc29);if(_0x5abc29['dialLimitQueue']>0x0){var _0x1bbc4d=_0x5abc29['dialLimitQueue']-_0x5abc29[_0xaf46('0x72')]-_0x5abc29[_0xaf46('0x52')]-_0x5abc29[_0xaf46('0xc3')]-_0x5abc29['pTalking'];if(_0x2268f0>_0x1bbc4d){_0x2268f0=_0x1bbc4d;}}if(_0x2268f0>0x0){if(_0x5abc29[_0xaf46('0x5a')]===_0xaf46('0x9')){_0x2268f0=0x1;}if(_0x2268f0>this[_0xaf46('0x21')]){_0x2268f0=this[_0xaf46('0x21')];}_0x5abc29[_0xaf46('0xc3')]+=_0x2268f0;for(var _0x17f369 in this[_0xaf46('0x1f')]){if(typeof this[_0xaf46('0x1f')][_0x17f369]!=='undefined'){if(this[_0xaf46('0x1f')][_0x17f369][_0xaf46('0xa7')]==='not_inuse'&&this[_0xaf46('0x1f')][_0x17f369][_0xaf46('0xda')]===_0xaf46('0xdb')){_0x36596b[_0xaf46('0x125')](this[_0xaf46('0x1f')][_0x17f369]['id']);}}}this[_0xaf46('0xc2')](_0x5abc29['id'],_0x36596b,_0x2268f0,_0x5abc29['dialOrderByScheduledAt'],_0x5abc29)[_0xaf46('0xb5')](function(_0x395b16){_0x5abc29[_0xaf46('0xc3')]-=_0x2268f0;_0x5abc29[_0xaf46('0xc3')]=_0x5abc29[_0xaf46('0xc3')]>0x0?_0x5abc29['temp']:0x0;if(!checkContactEmpty(_0x395b16)){_0x16a4ac['countReScheduled'](_0x5abc29)[_0xaf46('0xb5')](sendMessageReschedule(_0x5abc29))[_0xaf46('0xb0')](loggerCatch('[countReScheduled]\x20'));}else{_0x5abc29[_0xaf46('0x72')]+=_0x395b16['length'];_0x5abc29['message']=_0x5abc29[_0xaf46('0x5a')]===_0xaf46('0x9')?_0xaf46('0x16a'):'RUNNING';for(var _0x11caf4=0x0;_0x11caf4<_0x395b16[_0xaf46('0x130')];_0x11caf4+=0x1){if(_[_0xaf46('0xae')](_0x395b16[_0x11caf4])||_[_0xaf46('0xae')](_0x395b16[_0x11caf4][_0xaf46('0x163')])||_['isNil'](_0x395b16[_0x11caf4][_0xaf46('0x163')][_0xaf46('0x162')])){_0x16a4ac['emptyContact'](_0xaf46('0x1fc'),_0x5abc29,_0x395b16[_0x11caf4]);}else{_0x16a4ac[_0xaf46('0xb7')](_[_0xaf46('0xd1')](_0x395b16[_0x11caf4],[_0xaf46('0xd5'),'Contact.phone']))[_0xaf46('0xb5')](_0x16a4ac[_0xaf46('0x1fd')](_0x5abc29,_0x395b16[_0x11caf4]))[_0xaf46('0xb0')](_0x16a4ac[_0xaf46('0x1fe')](_0xaf46('0x1fc'),_0x5abc29));}}}})[_0xaf46('0xb0')](loggerGetContactDialer(_0xaf46('0x201'),_0x5abc29,_0x2268f0));}};Dialer[_0xaf46('0x19')][_0xaf46('0x93')]=function(_0x5e5b80){if(_0x5e5b80[_0xaf46('0x202')]>0x0){var _0x4a7628=_0x5e5b80[_0xaf46('0x202')]-_0x5e5b80['originated']-_0x5e5b80[_0xaf46('0x52')];if(_0x4a7628>0x0){this[_0xaf46('0x203')](_0x5e5b80);}else{loggerPredictiveCalls['info'](_0xaf46('0x204'));}}else{this[_0xaf46('0x203')](_0x5e5b80);}};Dialer[_0xaf46('0x19')][_0xaf46('0x203')]=function(_0x2dbc2c){var _0x59f3ec=this;var _0x231175=[];_0x2dbc2c[_0xaf46('0x72')]+=0x1;for(var _0x4ebf20 in this[_0xaf46('0x1f')]){if(typeof this['agents'][_0x4ebf20]!==_0xaf46('0x9a')){if(this[_0xaf46('0x1f')][_0x4ebf20][_0xaf46('0xa7')]===_0xaf46('0x205')&&this[_0xaf46('0x1f')][_0x4ebf20]['status']==='reachable'){_0x231175['push'](this['agents'][_0x4ebf20]['id']);}}}this['getContactDialer'](_0x2dbc2c['id'],_0x231175,0x1,_0x2dbc2c[_0xaf46('0x1f8')],_0x2dbc2c)[_0xaf46('0xb5')](function(_0x41a432){if(!checkContactEmpty(_0x41a432)){checkContactLowerLimitOriginate(_0x2dbc2c,0x1,0x0);_0x59f3ec['countReScheduled'](_0x2dbc2c)[_0xaf46('0xb5')](sendMessageReschedule(_0x2dbc2c))[_0xaf46('0xb0')](loggerCatch(_0xaf46('0xb6')));}else{_0x2dbc2c['message']=_0xaf46('0x1fa');if(_['isNil'](_0x41a432[0x0])||_[_0xaf46('0xae')](_0x41a432[0x0]['Contact'])||_[_0xaf46('0xae')](_0x41a432[0x0]['Contact'][_0xaf46('0x162')])){_0x59f3ec['emptyContact'](_0xaf46('0x1fc'),_0x2dbc2c,_0x41a432[0x0]);}else{_0x59f3ec['checkIsBlackList'](_[_0xaf46('0xd1')](_0x41a432[0x0],[_0xaf46('0xd5'),_0xaf46('0x206')]))[_0xaf46('0xb5')](_0x59f3ec[_0xaf46('0x1fd')](_0x2dbc2c,_0x41a432[0x0]))[_0xaf46('0xb0')](_0x59f3ec[_0xaf46('0x1fe')]('[actionOriginatePredictive]\x20',_0x2dbc2c));}}})['catch'](loggerGetContactDialer(_0xaf46('0x207'),_0x2dbc2c,0x1));emitVoiceQueueSummary(_0x2dbc2c);};Dialer[_0xaf46('0x19')]['abandonmentRate']=function(_0x224138,_0x19a72c,_0x302d3e,_0x499c53,_0x547681,_0x309574){loggerPredictive[_0xaf46('0x81')]('--------\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',_0x224138);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x19a72c);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',_0x302d3e);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',_0x499c53);loggerPredictive[_0xaf46('0x81')](_0xaf46('0x208'),_0x547681);loggerPredictive[_0xaf46('0x81')]('---------------------------');return new BPromise(function(_0x4f9b55,_0x566daa){if(_0x224138<=0x0||isNaN(_0x224138)){return _0x566daa(msgResponse('[abandonmentRate]',_0xaf46('0x209'),_0xaf46('0x20a')+_0x224138));}if(_0x302d3e<=0x0||isNaN(_0x302d3e)){return _0x566daa(msgResponse(_0xaf46('0x20b'),_0xaf46('0x209'),'Ts\x20=\x20'+_0x302d3e));}if(_0x499c53<=0x0||isNaN(_0x499c53)){return _0x566daa(msgResponse(_0xaf46('0x20b'),_0xaf46('0x209'),_0xaf46('0x20c')+_0x499c53));}if(_0x19a72c<=0x0||isNaN(_0x19a72c)){return _0x566daa(msgResponse('[abandonmentRate]',_0xaf46('0x209'),_0xaf46('0x20d')+_0x19a72c));}if(_0x547681<=0x0||isNaN(_0x547681)){return _0x566daa(msgResponse(_0xaf46('0x20b'),_0xaf46('0x209'),_0xaf46('0x20e')+_0x547681));}_0x309574=_0x309574||0x0;var _0x5b2462=0x1/_0x302d3e;var _0x4547b3=0x0;var _0x1092fb=0x0;var _0x30a0cd=0x0;var _0x24d582=0x0;for(var _0x12ccd7=0x0;_0x30a0cd<_0x547681;_0x12ccd7+=0x1){_0x1092fb=_0x12ccd7/_0x19a72c;_0x4547b3=(_0x499c53*_0x1092fb+_0x309574)/_0x5b2462;_0x30a0cd=erlangb(_0x4547b3,_0x224138);_0x24d582=_0x4547b3/_0x224138*(0x1-erlangb(_0x4547b3,_0x224138));}return _0x4f9b55({'erlangCalls':_0x12ccd7,'erlangCallToSecond':_0x19a72c/_0x12ccd7,'erlangAbandonmentRate':_0x30a0cd,'erlangBusyFactor':_0x24d582});});};Dialer[_0xaf46('0x19')]['busyFactor']=function(_0x1652a5,_0x5567fd,_0x34d9db,_0x36aa2f,_0x15dfec,_0x5e3d04){loggerPredictive['info'](_0xaf46('0x20f'));loggerPredictive[_0xaf46('0x81')](_0xaf46('0x210'),_0x1652a5);loggerPredictive[_0xaf46('0x81')](_0xaf46('0x211'),_0x5567fd);loggerPredictive[_0xaf46('0x81')]('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',_0x34d9db);loggerPredictive['info'](_0xaf46('0x212'),_0x36aa2f);loggerPredictive[_0xaf46('0x81')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15dfec);loggerPredictive['info'](_0xaf46('0x89'));return new BPromise(function(_0x5237f5,_0x591e13){if(_0x1652a5<=0x0||isNaN(_0x1652a5)){return _0x591e13(msgResponse(_0xaf46('0x213'),_0xaf46('0x209'),_0xaf46('0x20a')+_0x1652a5));}if(_0x34d9db<=0x0||isNaN(_0x34d9db)){return _0x591e13(msgResponse('[busyFactor]',_0xaf46('0x209'),_0xaf46('0x214')+_0x34d9db));}if(_0x36aa2f<=0x0||isNaN(_0x36aa2f)){return _0x591e13(msgResponse('[busyFactor]','Error',_0xaf46('0x20c')+_0x36aa2f));}if(_0x5567fd<=0x0||isNaN(_0x5567fd)){return _0x591e13(msgResponse('[busyFactor]',_0xaf46('0x209'),_0xaf46('0x20d')+_0x5567fd));}if(_0x15dfec<=0x0||isNaN(_0x15dfec)){return _0x591e13(msgResponse(_0xaf46('0x213'),_0xaf46('0x209'),_0xaf46('0x215')+_0x15dfec));}_0x5e3d04=_0x5e3d04||0x0;var _0x4780c9=0x1/_0x34d9db;var _0x324032=0x0;var _0x3f3206=0x0;var _0x3b53a6=0x0;var _0x11bd06=0x0;for(var _0x9ed6b5=0x0;_0x11bd06<_0x15dfec;_0x9ed6b5+=0x1){_0x3f3206=_0x9ed6b5/_0x5567fd;_0x324032=(_0x36aa2f*_0x3f3206+_0x5e3d04)/_0x4780c9;_0x3b53a6=erlangb(_0x324032,_0x1652a5);_0x11bd06=_0x324032/_0x1652a5*(0x1-erlangb(_0x324032,_0x1652a5));}return _0x5237f5({'erlangCalls':_0x9ed6b5,'erlangCallToSecond':_0x5567fd/_0x9ed6b5,'erlangAbandonmentRate':_0x3b53a6,'erlangBusyFactor':_0x11bd06});});};module[_0xaf46('0x216')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 77f21db..a220d74 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 _0x077b=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','outbound'];(function(_0xddebc3,_0x1f3854){var _0x3fe298=function(_0x3a401d){while(--_0x3a401d){_0xddebc3['push'](_0xddebc3['shift']());}};_0x3fe298(++_0x1f3854);}(_0x077b,0xc0));var _0xb077=function(_0x5e8eac,_0x1ea982){_0x5e8eac=_0x5e8eac-0x0;var _0xf686e1=_0x077b[_0x5e8eac];return _0xf686e1;};'use strict';var util=require(_0xb077('0x0'));var _=require('lodash');var moment=require(_0xb077('0x1'));function getSeconds(_0x506c8b,_0x3c748e){var _0xdbe970=moment(_0x506c8b)[_0xb077('0x2')](0x0);var _0x441305=moment(_0x3c748e)[_0xb077('0x2')](0x0);return _0xdbe970[_0xb077('0x3')](_0x441305,_0xb077('0x4'));}function QueueCallerAbandon(_0x5f5876,_0x320ed5){this[_0xb077('0x5')]=_0x5f5876[_0xb077('0x5')];this[_0xb077('0x6')]=_0x5f5876[_0xb077('0x6')];this['campaigntype']=_0x5f5876['type']===_0xb077('0x7')?_0xb077('0x8'):_0x5f5876[_0xb077('0x6')];this[_0xb077('0x9')]=_0x5f5876['countbusyretry'];this['countcongestionretry']=_0x5f5876[_0xb077('0xa')];this[_0xb077('0xb')]=_0x5f5876[_0xb077('0xb')];this['countglobal']=_0x5f5876[_0xb077('0x9')]+_0x5f5876[_0xb077('0xa')]+_0x5f5876['countnoanswerretry']+_0x5f5876['countnosuchnumberretry']+_0x5f5876[_0xb077('0xc')]+_0x5f5876[_0xb077('0xd')]+_0x5f5876[_0xb077('0xe')]+_0x5f5876['countagentrejectretry'];this['countnosuchnumberretry']=_0x5f5876[_0xb077('0xf')];this['countdropretry']=_0x5f5876[_0xb077('0xc')];this[_0xb077('0xd')]=_0x5f5876[_0xb077('0xd')];this[_0xb077('0xe')]=_0x5f5876[_0xb077('0xe')];this[_0xb077('0x10')]=_0x5f5876[_0xb077('0x10')];this[_0xb077('0x11')]=_0x320ed5[_0xb077('0x11')];this[_0xb077('0x12')]=_0x5f5876[_0xb077('0x13')];this[_0xb077('0x14')]=_0x5f5876[_0xb077('0x15')];this[_0xb077('0x16')]=_0x5f5876[_0xb077('0x16')];this[_0xb077('0x17')]=_0x5f5876[_0xb077('0x17')];this[_0xb077('0x18')]=_0x5f5876['droptime'];this[_0xb077('0x19')]=this['droptime'];this['ringtime']=getSeconds(_0x5f5876['responsetime'],_0x5f5876['starttime']);this[_0xb077('0x1a')]=getSeconds(this['droptime'],_0x5f5876[_0xb077('0x17')]);this[_0xb077('0x1b')]=0x0;this[_0xb077('0x8')]=_0x320ed5[_0xb077('0x8')];this['membername']=_0x320ed5[_0xb077('0x1c')];this[_0xb077('0x1d')]=_0x320ed5[_0xb077('0x1d')];this[_0xb077('0x1e')]=_0x5f5876[_0xb077('0x1e')];this['callbackuniqueid']=_0x5f5876[_0xb077('0x1f')];this[_0xb077('0x20')]=_0x5f5876[_0xb077('0x20')];this[_0xb077('0x21')]=_0x5f5876[_0xb077('0x21')];this[_0xb077('0x22')]=_0x5f5876[_0xb077('0x22')];this['ListId']=_0x5f5876[_0xb077('0x23')];this[_0xb077('0x24')]=_0x5f5876[_0xb077('0x24')];this[_0xb077('0x25')]=_0x5f5876['VoiceQueueId'];this['CampaignId']=_0x5f5876['CampaignId'];this[_0xb077('0x26')]=_0x5f5876['originatecalleridnum']||'';this['originatecalleridname']=_0x5f5876[_0xb077('0x27')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xd17b=['droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridnum','number','starttime','responsetime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd17b,0x16b));var _0xbd17=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xd17b[_0x386c3e];return _0x4b8e13;};'use strict';var util=require(_0xbd17('0x0'));var _=require(_0xbd17('0x1'));var moment=require(_0xbd17('0x2'));function getSeconds(_0x36a65b,_0xd86b0e){var _0x4415c9=moment(_0x36a65b)[_0xbd17('0x3')](0x0);var _0x2bf665=moment(_0xd86b0e)['milliseconds'](0x0);return _0x4415c9[_0xbd17('0x4')](_0x2bf665,_0xbd17('0x5'));}function QueueCallerAbandon(_0x28b824,_0x5fe40){this[_0xbd17('0x6')]=_0x28b824[_0xbd17('0x6')];this[_0xbd17('0x7')]=_0x28b824['type'];this['campaigntype']=_0x28b824[_0xbd17('0x7')]===_0xbd17('0x8')?_0xbd17('0x9'):_0x28b824['type'];this[_0xbd17('0xa')]=_0x28b824[_0xbd17('0xa')];this[_0xbd17('0xb')]=_0x28b824['countcongestionretry'];this['countnoanswerretry']=_0x28b824[_0xbd17('0xc')];this[_0xbd17('0xd')]=_0x28b824[_0xbd17('0xa')]+_0x28b824[_0xbd17('0xb')]+_0x28b824[_0xbd17('0xc')]+_0x28b824[_0xbd17('0xe')]+_0x28b824[_0xbd17('0xf')]+_0x28b824[_0xbd17('0x10')]+_0x28b824['countmachineretry']+_0x28b824[_0xbd17('0x11')];this['countnosuchnumberretry']=_0x28b824[_0xbd17('0xe')];this[_0xbd17('0xf')]=_0x28b824[_0xbd17('0xf')];this[_0xbd17('0x10')]=_0x28b824[_0xbd17('0x10')];this['countmachineretry']=_0x28b824[_0xbd17('0x12')];this[_0xbd17('0x11')]=_0x28b824[_0xbd17('0x11')];this[_0xbd17('0x13')]=_0x5fe40[_0xbd17('0x13')];this['calleridname']=_0x28b824['name'];this[_0xbd17('0x14')]=_0x28b824[_0xbd17('0x15')];this[_0xbd17('0x16')]=_0x28b824[_0xbd17('0x16')];this[_0xbd17('0x17')]=_0x28b824[_0xbd17('0x17')];this[_0xbd17('0x18')]=_0x28b824[_0xbd17('0x18')];this[_0xbd17('0x19')]=this[_0xbd17('0x18')];this[_0xbd17('0x1a')]=getSeconds(_0x28b824[_0xbd17('0x17')],_0x28b824[_0xbd17('0x16')]);this[_0xbd17('0x1b')]=getSeconds(this[_0xbd17('0x18')],_0x28b824[_0xbd17('0x17')]);this['talktime']=0x0;this[_0xbd17('0x9')]=_0x5fe40['queue'];this[_0xbd17('0x1c')]=_0x5fe40[_0xbd17('0x1d')];this[_0xbd17('0x1e')]=_0x5fe40['reason'];this['callback']=_0x28b824[_0xbd17('0x1f')];this[_0xbd17('0x20')]=_0x28b824[_0xbd17('0x20')];this['callbackat']=_0x28b824[_0xbd17('0x21')];this[_0xbd17('0x22')]=_0x28b824[_0xbd17('0x22')];this[_0xbd17('0x23')]=_0x28b824['ContactId'];this[_0xbd17('0x24')]=_0x28b824[_0xbd17('0x24')];this[_0xbd17('0x25')]=_0x28b824[_0xbd17('0x25')];this[_0xbd17('0x26')]=_0x28b824['VoiceQueueId'];this[_0xbd17('0x27')]=_0x28b824[_0xbd17('0x27')];this[_0xbd17('0x28')]=_0x28b824[_0xbd17('0x28')]||'';this['originatecalleridname']=_0x28b824[_0xbd17('0x29')]||'';}module[_0xbd17('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 17a3591..6f2bb94 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(_0x55fbb2,_0x39a7d8){var _0x407c32=function(_0x5ef898){while(--_0x5ef898){_0x55fbb2['push'](_0x55fbb2['shift']());}};_0x407c32(++_0x39a7d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x29651a,_0x10ff81){var _0x5b52ef=function(_0x19feb8){while(--_0x19feb8){_0x29651a['push'](_0x29651a['shift']());}};_0x5b52ef(++_0x10ff81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 84e9f9f..948a738 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 _0xec29=['SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb','./util/util','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','newchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SENDING\x20FAILED:\x20','faxstatusstring'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0xec29,0x171));var _0x9ec2=function(_0x4e040a,_0xd908ea){_0x4e040a=_0x4e040a-0x0;var _0x1f8801=_0xec29[_0x4e040a];return _0x1f8801;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x9ec2('0x0'));var uuid=require(_0x9ec2('0x1'));var moment=require(_0x9ec2('0x2'));var path=require(_0x9ec2('0x3'));var tiff2pdf=require(_0x9ec2('0x4'));var gs=require(_0x9ec2('0x5'));var logger=require('../../../config/logger')('fax');var ami=require(_0x9ec2('0x6'));var rpcDb=require(_0x9ec2('0x7'));var Channel=require('./channel');var ut=require(_0x9ec2('0x8'));var Action=require('./action');var faxAccount=require(_0x9ec2('0x9'));var attachment=require(_0x9ec2('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2e95e2){this[_0x9ec2('0xb')]={};this[_0x9ec2('0xc')]=_0x2e95e2[_0x9ec2('0xc')];this[_0x9ec2('0xd')]=_0x2e95e2[_0x9ec2('0xd')];this['actions']={};ami['on'](_0x9ec2('0xe'),this['syncNewchannel'][_0x9ec2('0xf')](this));ami['on'](_0x9ec2('0x10'),this['syncVarSet'][_0x9ec2('0xf')](this));ami['on'](_0x9ec2('0x11'),this[_0x9ec2('0x12')][_0x9ec2('0xf')](this));ami['on'](_0x9ec2('0x13'),this[_0x9ec2('0x14')]['bind'](this));ami['on']('faxstatus',this[_0x9ec2('0x15')][_0x9ec2('0xf')](this));ami['on'](_0x9ec2('0x16'),this[_0x9ec2('0x17')][_0x9ec2('0xf')](this));ami['on'](_0x9ec2('0x18'),this['syncHangup'][_0x9ec2('0xf')](this));ami['on']('originateresponse',this[_0x9ec2('0x19')][_0x9ec2('0xf')](this));}Fax[_0x9ec2('0x1a')]['syncNewchannel']=function(_0x319fe5){if(_0x319fe5[_0x9ec2('0x1b')]===_0x9ec2('0x1c')){for(var _0x4d9efa in this[_0x9ec2('0xc')]){if(this['faxAccounts']['hasOwnProperty'](_0x4d9efa)){if(_0x319fe5[_0x9ec2('0x1d')]===this['faxAccounts'][_0x4d9efa][_0x9ec2('0x1e')]){this[_0x9ec2('0xb')][_0x319fe5[_0x9ec2('0x1f')]]={};this[_0x9ec2('0xb')][_0x319fe5[_0x9ec2('0x1f')]]['channel']=_0x319fe5[_0x9ec2('0x20')];this[_0x9ec2('0xb')][_0x319fe5[_0x9ec2('0x1f')]]['id']=this['faxAccounts'][_0x4d9efa]['id'];this['channels'][_0x319fe5[_0x9ec2('0x1f')]][_0x9ec2('0x21')]=this[_0x9ec2('0xc')][_0x4d9efa][_0x9ec2('0x21')];logger[_0x9ec2('0x22')](_0x319fe5[_0x9ec2('0x1f')],_0x9ec2('0x23'));}}}}if(this[_0x9ec2('0x24')][_0x319fe5[_0x9ec2('0x1f')]]){this['channels'][_0x319fe5[_0x9ec2('0x1f')]]={};this['channels'][_0x319fe5[_0x9ec2('0x1f')]][_0x9ec2('0x20')]=_0x319fe5['channel'];logger['info'](_0x319fe5[_0x9ec2('0x1f')],_0x9ec2('0x23'));}};Fax[_0x9ec2('0x1a')][_0x9ec2('0x25')]=function(_0x16f42c){if(this[_0x9ec2('0xb')][_0x16f42c[_0x9ec2('0x1f')]]){for(var _0xc9d19f in _0x16f42c['variable']){if(_0x16f42c[_0x9ec2('0x26')][_0x9ec2('0x27')](_0xc9d19f)){this[_0x9ec2('0xb')][_0x16f42c['uniqueid']][_0xc9d19f]=_0x16f42c[_0x9ec2('0x28')];}}}};Fax[_0x9ec2('0x1a')][_0x9ec2('0x12')]=function(_0x225501){if(this['channels'][_0x225501['uniqueid']]){this[_0x9ec2('0xb')][_0x225501[_0x9ec2('0x1f')]]['channelstate']=_0x225501[_0x9ec2('0x29')];this['channels'][_0x225501[_0x9ec2('0x1f')]][_0x9ec2('0x2a')]=_0x225501[_0x9ec2('0x2a')];}};Fax[_0x9ec2('0x1a')][_0x9ec2('0x14')]=function(_0x45f3c2){if(this[_0x9ec2('0xb')][_0x45f3c2[_0x9ec2('0x1f')]]){for(var _0x5d4b28 in _0x45f3c2[_0x9ec2('0x26')]){if(_0x45f3c2[_0x9ec2('0x26')][_0x9ec2('0x27')](_0x5d4b28)){this[_0x9ec2('0xb')][_0x45f3c2[_0x9ec2('0x1f')]][_0x5d4b28]=_0x45f3c2[_0x9ec2('0x28')];}}}};Fax[_0x9ec2('0x1a')]['syncFaxStatus']=function(_0x1178f2){if(this[_0x9ec2('0xb')][_0x1178f2[_0x9ec2('0x1f')]]){this[_0x9ec2('0xb')][_0x1178f2[_0x9ec2('0x1f')]][_0x9ec2('0x2b')]=_0x1178f2[_0x9ec2('0x2b')];this[_0x9ec2('0xb')][_0x1178f2[_0x9ec2('0x1f')]][_0x9ec2('0x2c')]=_0x1178f2['status'];this['channels'][_0x1178f2[_0x9ec2('0x1f')]][_0x9ec2('0x1e')]=_0x1178f2[_0x9ec2('0x1e')];this[_0x9ec2('0xb')][_0x1178f2[_0x9ec2('0x1f')]][_0x9ec2('0x2d')]=_0x1178f2[_0x9ec2('0x2d')];logger[_0x9ec2('0x22')](_0x1178f2[_0x9ec2('0x1f')],_0x9ec2('0x2e'));}};Fax[_0x9ec2('0x1a')][_0x9ec2('0x17')]=function(_0x258dd3){var _0x2cd8ff=this;if(this['channels'][_0x258dd3[_0x9ec2('0x1f')]]){var _0x19d94b=this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]]['id'];this['channels'][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x2f')]=_0x258dd3[_0x9ec2('0x2f')];this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x30')]=_0x258dd3['pagestransferred'];this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x1e')]=_0x258dd3[_0x9ec2('0x1e')];this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x31')]=_0x258dd3[_0x9ec2('0x31')];this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x32')]=_0x258dd3['transferrate'];this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]]['filename']=_0x258dd3[_0x9ec2('0x2d')];this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x33')]=_0x258dd3[_0x9ec2('0x33')];if(this[_0x9ec2('0xb')][_0x258dd3[_0x9ec2('0x1f')]][_0x9ec2('0x30')]>0x0){tiff2pdf(_0x258dd3[_0x9ec2('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x5c9cad){logger['info'](_0x258dd3[_0x9ec2('0x1f')],_0x9ec2('0x34'),_0x5c9cad[_0x9ec2('0x35')]);attachment[_0x9ec2('0x36')]({'name':path['parse'](_0x258dd3['filename'])[_0x9ec2('0x21')],'basename':path[_0x9ec2('0x37')](_0x258dd3['filename'])['name']+_0x9ec2('0x38'),'type':_0x9ec2('0x39')})[_0x9ec2('0x3a')](function(_0x2a42c8){faxAccount['notify'](_0x19d94b,{'from':_0x258dd3[_0x9ec2('0x33')],'mapKey':_0x9ec2('0x3b'),'body':path[_0x9ec2('0x37')](_0x258dd3['filename'])[_0x9ec2('0x21')]+_0x9ec2('0x38'),'AttachmentId':_0x2a42c8['id']})[_0x9ec2('0x3c')](function(_0x1b1203){logger[_0x9ec2('0x3d')](_0x258dd3[_0x9ec2('0x1f')],_0x9ec2('0x3e'),JSON[_0x9ec2('0x3f')](_0x1b1203));});})[_0x9ec2('0x3c')](function(_0x4cb49d){logger[_0x9ec2('0x3d')](_0x258dd3['uniqueid'],'\x20receiveFax\x20',JSON[_0x9ec2('0x3f')](_0x4cb49d));});});}logger[_0x9ec2('0x22')](_0x258dd3[_0x9ec2('0x1f')],_0x9ec2('0x40'));}};Fax[_0x9ec2('0x1a')][_0x9ec2('0x19')]=function(_0x25d1ee){if(this[_0x9ec2('0x24')][_0x25d1ee[_0x9ec2('0x1f')]]){_['merge'](this[_0x9ec2('0xb')][_0x25d1ee[_0x9ec2('0x1f')]],_[_0x9ec2('0x41')](_0x25d1ee,[_0x9ec2('0x42'),_0x9ec2('0x43')]));}};function updateStatus(_0x50313b){if(_0x50313b[_0x9ec2('0x44')]){faxMessage[_0x9ec2('0x45')](_0x50313b[_0x9ec2('0x44')],{'failMessage':_0x9ec2('0x46')})[_0x9ec2('0x3a')](function(_0x39f650){ut[_0x9ec2('0x47')](_0x9ec2('0x48'),_0x39f650);})['catch'](function(_0x8af6d5){ut[_0x9ec2('0x47')](_0x9ec2('0x49'),_0x8af6d5);});}else{ut['logger'](_0x9ec2('0x4a'));}}Fax[_0x9ec2('0x1a')][_0x9ec2('0x4b')]=function(_0x2ec028,_0x49de5b,_0xf98391){var _0x24e7a7=this;var _0x1d0f4f={};if(_0x49de5b){_0x1d0f4f={'read':_0x49de5b};}else{_0x1d0f4f={'failMessage':_0xf98391};}if(this['actions'][_0x2ec028][_0x9ec2('0x44')]){faxMessage[_0x9ec2('0x45')](this[_0x9ec2('0x24')][_0x2ec028]['AttachmentId'],_0x1d0f4f)[_0x9ec2('0x3a')](function(_0x570f6f){ut[_0x9ec2('0x47')]('[Fax][Message][Updated]',_0x570f6f);})[_0x9ec2('0x3c')](function(_0x1860cc){ut[_0x9ec2('0x47')]('[Fax][Message][NoUpdate1]',_0x1860cc);})[_0x9ec2('0x4c')](function(){delete _0x24e7a7['channels'][_0x2ec028];delete _0x24e7a7[_0x9ec2('0x24')][_0x2ec028];});}else{ut['logger'](_0x9ec2('0x4d'));delete this[_0x9ec2('0xb')][_0x2ec028];delete this[_0x9ec2('0x24')][_0x2ec028];}};Fax[_0x9ec2('0x1a')]['syncHangup']=function(_0x3f867d){var _0x3d031c=this;if(this[_0x9ec2('0xb')][_0x3f867d[_0x9ec2('0x1f')]]){if(this[_0x9ec2('0x24')][_0x3f867d[_0x9ec2('0x1f')]]){this['channels'][_0x3f867d[_0x9ec2('0x1f')]]['id']=this[_0x9ec2('0x24')][_0x3f867d[_0x9ec2('0x1f')]]['id'];this['channels'][_0x3f867d[_0x9ec2('0x1f')]][_0x9ec2('0x21')]=this[_0x9ec2('0x24')][_0x3f867d[_0x9ec2('0x1f')]][_0x9ec2('0x21')];}logger[_0x9ec2('0x22')](_0x3f867d[_0x9ec2('0x1f')],this[_0x9ec2('0x24')][_0x3f867d[_0x9ec2('0x1f')]]?'\x20hangup\x20sendFile\x20':_0x9ec2('0x4e'),JSON[_0x9ec2('0x3f')](this[_0x9ec2('0xb')][_0x3f867d[_0x9ec2('0x1f')]]));if(this[_0x9ec2('0x24')][_0x3f867d[_0x9ec2('0x1f')]]){if(this[_0x9ec2('0xb')][_0x3f867d[_0x9ec2('0x1f')]][_0x9ec2('0x4f')]>0x0&&this[_0x9ec2('0xb')][_0x3f867d[_0x9ec2('0x1f')]][_0x9ec2('0x50')]==='SUCCESS'){this[_0x9ec2('0x4b')](_0x3f867d['uniqueid'],!![]);}else{this[_0x9ec2('0x4b')](_0x3f867d[_0x9ec2('0x1f')],![],this['channels'][_0x3f867d[_0x9ec2('0x1f')]]['faxstatusstring']?_0x9ec2('0x51')+this[_0x9ec2('0xb')][_0x3f867d[_0x9ec2('0x1f')]][_0x9ec2('0x52')]:_0x9ec2('0x53'));}}}};Fax[_0x9ec2('0x1a')][_0x9ec2('0x54')]=function(_0x81b860){var _0x1650bc=this;return new BPromise(function(_0x4b81af,_0x38c25b){_0x1650bc[_0x9ec2('0x55')](_0x81b860,_0x1650bc[_0x9ec2('0xc')][_0x81b860['FaxAccountId']])[_0x9ec2('0x3a')](function(_0x1a5d2b){ut[_0x9ec2('0x47')](_0x9ec2('0x56'),_0x1a5d2b);_0x4b81af(ut[_0x9ec2('0x35')](_0x9ec2('0x57')));})['catch'](function(_0x30214d){ut[_0x9ec2('0x47')](_0x9ec2('0x58'),_0x30214d);updateStatus(_0x81b860);_0x38c25b(ut['message']('Fax\x20failed'));});});};Fax[_0x9ec2('0x1a')][_0x9ec2('0x59')]=function(_0x2f4bca){var _0x3683b0=this;return new BPromise(function(_0x39c46c,_0x4e5d49){var _0x3e49c2=_0x3683b0[_0x9ec2('0x5a')](_0x3683b0['faxAccounts'][_0x2f4bca['FaxAccountId']][_0x9ec2('0x5b')],_0x2f4bca);if(_0x3e49c2[_0x9ec2('0x5c')]){_0x39c46c(ut['message'](_0x9ec2('0x5d')));}else{_0x4e5d49(ut[_0x9ec2('0x35')](_0x3e49c2[_0x9ec2('0x35')]));}});};function originate(_0x9704a,_0x1cdfad,_0x3c624a){return new BPromise(function(_0x5be1e0,_0x3999b4){if(_0x3c624a){var _0x1305bd=util[_0x9ec2('0x5e')]('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[_0x9ec2('0x37')](_0x9704a[_0x9ec2('0x3')])[_0x9ec2('0x21')],_0x9704a[_0x9ec2('0x3')]);gs['execute'](_0x1305bd)[_0x9ec2('0x3a')](function(){_0x9704a[_0x9ec2('0x3')]=util[_0x9ec2('0x5e')](_0x9ec2('0x5f'),path[_0x9ec2('0x37')](_0x9704a[_0x9ec2('0x3')])['dir'],path[_0x9ec2('0x37')](_0x9704a[_0x9ec2('0x3')])[_0x9ec2('0x21')]);_0x1cdfad[_0x9ec2('0x60')]=_0x9704a[_0x9ec2('0x3')];ut[_0x9ec2('0x47')]('Convert\x20pdf\x20to\x20tif','');ami[_0x9ec2('0x61')](ut[_0x9ec2('0x62')](_0x9704a,_0x1cdfad))[_0x9ec2('0x3a')](function(_0x5dfa8b){_0x5be1e0(_0x5dfa8b);})[_0x9ec2('0x3c')](function(_0x1c0529){_0x3999b4(_0x1c0529);});})[_0x9ec2('0x3c')](function(_0x57897b){_0x3999b4(_0x57897b);});}else{ami[_0x9ec2('0x61')](ut[_0x9ec2('0x62')](_0x9704a,_0x1cdfad))[_0x9ec2('0x3a')](function(_0x286865){_0x5be1e0(_0x286865);})['catch'](function(_0x212466){_0x3999b4(_0x212466);});}});}Fax['prototype'][_0x9ec2('0x55')]=function(_0x3ecc57,_0x5873ea){var _0x109f5e=this;return new BPromise(function(_0x21e87a,_0x251e35){var _0x3df8b5=uuid['v4']();var _0x37ffe6=ut[_0x9ec2('0x63')](_0x3ecc57,_0x5873ea);_0x109f5e[_0x9ec2('0x24')][_0x3df8b5]=new Action(_0x3df8b5,_0x5873ea,_0x3ecc57);var _0x57729f=_0x109f5e[_0x9ec2('0x24')][_0x3df8b5];if(path[_0x9ec2('0x37')](_0x3ecc57[_0x9ec2('0x3')])['ext']===_0x9ec2('0x38')){originate(_0x57729f,_0x37ffe6,!![])[_0x9ec2('0x3a')](function(_0x19b149){_0x21e87a(_0x19b149);})[_0x9ec2('0x3c')](function(_0x4ec2b1){_0x251e35(_0x4ec2b1);});}else{originate(_0x57729f,_0x37ffe6,![])[_0x9ec2('0x3a')](function(_0x12be51){_0x21e87a(_0x12be51);})[_0x9ec2('0x3c')](function(_0x2c9c64){_0x251e35(_0x2c9c64);});}});};Fax['prototype'][_0x9ec2('0x64')]=function(_0x5d4573){return!_['isNil'](_0x5d4573)&&!_['isNil'](_0x5d4573[_0x9ec2('0x21')])&&!_[_0x9ec2('0x65')](_0x5d4573[_0x9ec2('0x66')])&&_0x5d4573[_0x9ec2('0x66')]&&!_[_0x9ec2('0x65')](this[_0x9ec2('0xd')][util['format'](_0x9ec2('0x67'),_0x5d4573[_0x9ec2('0x21')])])&&!_['isNil'](this['trunks'][util[_0x9ec2('0x5e')](_0x9ec2('0x67'),_0x5d4573[_0x9ec2('0x21')])][_0x9ec2('0x2c')])&&(this[_0x9ec2('0xd')][util[_0x9ec2('0x5e')](_0x9ec2('0x67'),_0x5d4573[_0x9ec2('0x21')])]['status']===_0x9ec2('0x68')||this[_0x9ec2('0xd')][util[_0x9ec2('0x5e')](_0x9ec2('0x67'),_0x5d4573['name'])][_0x9ec2('0x2c')]===_0x9ec2('0x69'));};Fax[_0x9ec2('0x1a')][_0x9ec2('0x5a')]=function(_0x2a244e,_0xd3e653){if(!this[_0x9ec2('0x64')](_0x2a244e)){ut['logger'](_0x9ec2('0x6a'),_['isNil'](_0x2a244e)?'':_0x2a244e[_0x9ec2('0x21')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x9ec2('0x6b')};}if(_[_0x9ec2('0x65')](_0xd3e653['fax'])){ut['logger'](_0x9ec2('0x6c'),JSON['stringify'](_0xd3e653));return{'isValid':![],'message':_0x9ec2('0x6d')};}if(_[_0x9ec2('0x65')](_0xd3e653[_0x9ec2('0x3')])){ut[_0x9ec2('0x47')](_0x9ec2('0x6e'),JSON[_0x9ec2('0x3f')](_0xd3e653));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x9ec2('0x6f')};};module[_0x9ec2('0x70')]=Fax; \ No newline at end of file +var _0x7d01=['reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','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','execute','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x7d01,0x85));var _0x17d0=function(_0x23b4f1,_0x437331){_0x23b4f1=_0x23b4f1-0x0;var _0x14835c=_0x7d01[_0x23b4f1];return _0x14835c;};'use strict';var util=require(_0x17d0('0x0'));var _=require(_0x17d0('0x1'));var BPromise=require(_0x17d0('0x2'));var uuid=require(_0x17d0('0x3'));var moment=require(_0x17d0('0x4'));var path=require('path');var tiff2pdf=require(_0x17d0('0x5'));var gs=require('./util/gs');var logger=require(_0x17d0('0x6'))(_0x17d0('0x7'));var ami=require(_0x17d0('0x8'));var rpcDb=require(_0x17d0('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x17d0('0xa'));var faxAccount=require(_0x17d0('0xb'));var attachment=require(_0x17d0('0xc'));var faxMessage=require(_0x17d0('0xd'));function Fax(_0xb45f06){this['channels']={};this[_0x17d0('0xe')]=_0xb45f06[_0x17d0('0xe')];this[_0x17d0('0xf')]=_0xb45f06[_0x17d0('0xf')];this[_0x17d0('0x10')]={};ami['on'](_0x17d0('0x11'),this['syncNewchannel']['bind'](this));ami['on'](_0x17d0('0x12'),this[_0x17d0('0x13')][_0x17d0('0x14')](this));ami['on'](_0x17d0('0x15'),this['syncNewState'][_0x17d0('0x14')](this));ami['on'](_0x17d0('0x16'),this[_0x17d0('0x17')][_0x17d0('0x14')](this));ami['on'](_0x17d0('0x18'),this[_0x17d0('0x19')]['bind'](this));ami['on'](_0x17d0('0x1a'),this[_0x17d0('0x1b')]['bind'](this));ami['on'](_0x17d0('0x1c'),this['syncHangup'][_0x17d0('0x14')](this));ami['on'](_0x17d0('0x1d'),this[_0x17d0('0x1e')]['bind'](this));}Fax[_0x17d0('0x1f')][_0x17d0('0x20')]=function(_0x572cbb){if(_0x572cbb['context']===_0x17d0('0x21')){for(var _0x575054 in this[_0x17d0('0xe')]){if(this[_0x17d0('0xe')][_0x17d0('0x22')](_0x575054)){if(_0x572cbb[_0x17d0('0x23')]===this[_0x17d0('0xe')][_0x575054]['localstationid']){this[_0x17d0('0x24')][_0x572cbb[_0x17d0('0x25')]]={};this[_0x17d0('0x24')][_0x572cbb[_0x17d0('0x25')]][_0x17d0('0x26')]=_0x572cbb[_0x17d0('0x26')];this[_0x17d0('0x24')][_0x572cbb[_0x17d0('0x25')]]['id']=this['faxAccounts'][_0x575054]['id'];this[_0x17d0('0x24')][_0x572cbb['uniqueid']][_0x17d0('0x27')]=this[_0x17d0('0xe')][_0x575054][_0x17d0('0x27')];logger[_0x17d0('0x28')](_0x572cbb[_0x17d0('0x25')],_0x17d0('0x29'));}}}}if(this[_0x17d0('0x10')][_0x572cbb['uniqueid']]){this['channels'][_0x572cbb[_0x17d0('0x25')]]={};this['channels'][_0x572cbb[_0x17d0('0x25')]]['channel']=_0x572cbb[_0x17d0('0x26')];logger[_0x17d0('0x28')](_0x572cbb['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x17d0('0x1f')]['syncVarSet']=function(_0x341d57){if(this[_0x17d0('0x24')][_0x341d57[_0x17d0('0x25')]]){for(var _0x568e54 in _0x341d57[_0x17d0('0x2a')]){if(_0x341d57['variable']['hasOwnProperty'](_0x568e54)){this[_0x17d0('0x24')][_0x341d57['uniqueid']][_0x568e54]=_0x341d57[_0x17d0('0x2b')];}}}};Fax[_0x17d0('0x1f')][_0x17d0('0x2c')]=function(_0x499704){if(this[_0x17d0('0x24')][_0x499704[_0x17d0('0x25')]]){this[_0x17d0('0x24')][_0x499704[_0x17d0('0x25')]][_0x17d0('0x2d')]=_0x499704[_0x17d0('0x2d')];this['channels'][_0x499704[_0x17d0('0x25')]][_0x17d0('0x2e')]=_0x499704['channelstatedesc'];}};Fax[_0x17d0('0x1f')][_0x17d0('0x17')]=function(_0x37dc6c){if(this[_0x17d0('0x24')][_0x37dc6c[_0x17d0('0x25')]]){for(var _0xf55af4 in _0x37dc6c['variable']){if(_0x37dc6c[_0x17d0('0x2a')][_0x17d0('0x22')](_0xf55af4)){this[_0x17d0('0x24')][_0x37dc6c[_0x17d0('0x25')]][_0xf55af4]=_0x37dc6c['value'];}}}};Fax[_0x17d0('0x1f')]['syncFaxStatus']=function(_0x54f1bb){if(this[_0x17d0('0x24')][_0x54f1bb[_0x17d0('0x25')]]){this['channels'][_0x54f1bb[_0x17d0('0x25')]][_0x17d0('0x2f')]=_0x54f1bb[_0x17d0('0x2f')];this['channels'][_0x54f1bb[_0x17d0('0x25')]][_0x17d0('0x30')]=_0x54f1bb['status'];this[_0x17d0('0x24')][_0x54f1bb['uniqueid']][_0x17d0('0x31')]=_0x54f1bb[_0x17d0('0x31')];this[_0x17d0('0x24')][_0x54f1bb[_0x17d0('0x25')]][_0x17d0('0x32')]=_0x54f1bb['filename'];logger['info'](_0x54f1bb[_0x17d0('0x25')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x17d0('0x1b')]=function(_0x51bb9){var _0x273d45=this;if(this[_0x17d0('0x24')][_0x51bb9[_0x17d0('0x25')]]){var _0x1c890e=this['channels'][_0x51bb9[_0x17d0('0x25')]]['id'];this[_0x17d0('0x24')][_0x51bb9[_0x17d0('0x25')]][_0x17d0('0x33')]=_0x51bb9[_0x17d0('0x33')];this['channels'][_0x51bb9[_0x17d0('0x25')]]['pagestransferred']=_0x51bb9['pagestransferred'];this['channels'][_0x51bb9[_0x17d0('0x25')]][_0x17d0('0x31')]=_0x51bb9[_0x17d0('0x31')];this[_0x17d0('0x24')][_0x51bb9[_0x17d0('0x25')]][_0x17d0('0x34')]=_0x51bb9[_0x17d0('0x34')];this[_0x17d0('0x24')][_0x51bb9['uniqueid']][_0x17d0('0x35')]=_0x51bb9['transferrate'];this['channels'][_0x51bb9[_0x17d0('0x25')]][_0x17d0('0x32')]=_0x51bb9[_0x17d0('0x32')];this['channels'][_0x51bb9[_0x17d0('0x25')]][_0x17d0('0x36')]=_0x51bb9[_0x17d0('0x36')];if(this[_0x17d0('0x24')][_0x51bb9['uniqueid']][_0x17d0('0x37')]>0x0){tiff2pdf(_0x51bb9[_0x17d0('0x32')],_0x17d0('0x38'),function(_0x4b03ea){logger[_0x17d0('0x28')](_0x51bb9[_0x17d0('0x25')],'\x20result\x20conversion\x20file\x20',_0x4b03ea[_0x17d0('0x39')]);attachment[_0x17d0('0x3a')]({'name':path[_0x17d0('0x3b')](_0x51bb9['filename'])[_0x17d0('0x27')],'basename':path['parse'](_0x51bb9['filename'])[_0x17d0('0x27')]+_0x17d0('0x3c'),'type':'application/pdf'})[_0x17d0('0x3d')](function(_0x42c28f){faxAccount[_0x17d0('0x3e')](_0x1c890e,{'from':_0x51bb9[_0x17d0('0x36')],'mapKey':'fax','body':path[_0x17d0('0x3b')](_0x51bb9['filename'])[_0x17d0('0x27')]+'.pdf','AttachmentId':_0x42c28f['id']})[_0x17d0('0x3f')](function(_0x333d92){logger['error'](_0x51bb9['uniqueid'],_0x17d0('0x40'),JSON[_0x17d0('0x41')](_0x333d92));});})[_0x17d0('0x3f')](function(_0x3e2de9){logger[_0x17d0('0x42')](_0x51bb9[_0x17d0('0x25')],_0x17d0('0x43'),JSON[_0x17d0('0x41')](_0x3e2de9));});});}logger[_0x17d0('0x28')](_0x51bb9[_0x17d0('0x25')],_0x17d0('0x43'));}};Fax[_0x17d0('0x1f')][_0x17d0('0x1e')]=function(_0x211cf3){if(this[_0x17d0('0x10')][_0x211cf3[_0x17d0('0x25')]]){_[_0x17d0('0x44')](this[_0x17d0('0x24')][_0x211cf3[_0x17d0('0x25')]],_[_0x17d0('0x45')](_0x211cf3,['response',_0x17d0('0x46')]));}};function updateStatus(_0x5029a8){if(_0x5029a8[_0x17d0('0x47')]){faxMessage[_0x17d0('0x48')](_0x5029a8[_0x17d0('0x47')],{'failMessage':_0x17d0('0x49')})['then'](function(_0x174e45){ut[_0x17d0('0x4a')](_0x17d0('0x4b'),_0x174e45);})[_0x17d0('0x3f')](function(_0x50136c){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x50136c);});}else{ut['logger'](_0x17d0('0x4c'));}}Fax['prototype'][_0x17d0('0x4d')]=function(_0x3317a3,_0x4b45b6,_0x1fc30c){var _0x27a6cd=this;var _0x49b5f5={};if(_0x4b45b6){_0x49b5f5={'read':_0x4b45b6};}else{_0x49b5f5={'failMessage':_0x1fc30c};}if(this['actions'][_0x3317a3]['AttachmentId']){faxMessage[_0x17d0('0x48')](this[_0x17d0('0x10')][_0x3317a3][_0x17d0('0x47')],_0x49b5f5)[_0x17d0('0x3d')](function(_0x92a130){ut['logger']('[Fax][Message][Updated]',_0x92a130);})['catch'](function(_0x5134b0){ut[_0x17d0('0x4a')](_0x17d0('0x4e'),_0x5134b0);})[_0x17d0('0x4f')](function(){delete _0x27a6cd['channels'][_0x3317a3];delete _0x27a6cd['actions'][_0x3317a3];});}else{ut[_0x17d0('0x4a')](_0x17d0('0x50'));delete this[_0x17d0('0x24')][_0x3317a3];delete this[_0x17d0('0x10')][_0x3317a3];}};Fax[_0x17d0('0x1f')][_0x17d0('0x51')]=function(_0x54a694){var _0x1d7ef5=this;if(this['channels'][_0x54a694[_0x17d0('0x25')]]){if(this[_0x17d0('0x10')][_0x54a694[_0x17d0('0x25')]]){this[_0x17d0('0x24')][_0x54a694[_0x17d0('0x25')]]['id']=this[_0x17d0('0x10')][_0x54a694[_0x17d0('0x25')]]['id'];this[_0x17d0('0x24')][_0x54a694[_0x17d0('0x25')]][_0x17d0('0x27')]=this['actions'][_0x54a694['uniqueid']]['name'];}logger['info'](_0x54a694['uniqueid'],this['actions'][_0x54a694[_0x17d0('0x25')]]?_0x17d0('0x52'):_0x17d0('0x53'),JSON[_0x17d0('0x41')](this[_0x17d0('0x24')][_0x54a694[_0x17d0('0x25')]]));if(this['actions'][_0x54a694[_0x17d0('0x25')]]){if(this['channels'][_0x54a694[_0x17d0('0x25')]][_0x17d0('0x54')]>0x0&&this[_0x17d0('0x24')][_0x54a694[_0x17d0('0x25')]][_0x17d0('0x18')]==='SUCCESS'){this[_0x17d0('0x4d')](_0x54a694[_0x17d0('0x25')],!![]);}else{this[_0x17d0('0x4d')](_0x54a694['uniqueid'],![],this[_0x17d0('0x24')][_0x54a694[_0x17d0('0x25')]][_0x17d0('0x55')]?'SENDING\x20FAILED:\x20'+this[_0x17d0('0x24')][_0x54a694[_0x17d0('0x25')]][_0x17d0('0x55')]:_0x17d0('0x56'));}}}};Fax['prototype'][_0x17d0('0x57')]=function(_0x3db495){var _0x3768ac=this;return new BPromise(function(_0x46c5a1,_0x29b1cf){_0x3768ac[_0x17d0('0x58')](_0x3db495,_0x3768ac[_0x17d0('0xe')][_0x3db495['FaxAccountId']])[_0x17d0('0x3d')](function(_0x5094fe){ut[_0x17d0('0x4a')](_0x17d0('0x59'),_0x5094fe);_0x46c5a1(ut[_0x17d0('0x39')](_0x17d0('0x5a')));})[_0x17d0('0x3f')](function(_0x1a8a10){ut[_0x17d0('0x4a')]('[Fax][execOriginate][failure]',_0x1a8a10);updateStatus(_0x3db495);_0x29b1cf(ut[_0x17d0('0x39')](_0x17d0('0x5b')));});});};Fax[_0x17d0('0x1f')][_0x17d0('0x5c')]=function(_0x26455d){var _0x47ee53=this;return new BPromise(function(_0x3461aa,_0x5ef213){var _0xa2d5e0=_0x47ee53[_0x17d0('0x5d')](_0x47ee53[_0x17d0('0xe')][_0x26455d[_0x17d0('0x5e')]][_0x17d0('0x5f')],_0x26455d);if(_0xa2d5e0[_0x17d0('0x60')]){_0x3461aa(ut['message'](_0x17d0('0x61')));}else{_0x5ef213(ut[_0x17d0('0x39')](_0xa2d5e0[_0x17d0('0x39')]));}});};function originate(_0x5e385f,_0x5c6bd6,_0x895f4d){return new BPromise(function(_0x56aed6,_0x1c0dca){if(_0x895f4d){var _0x5b9f9c=util['format'](_0x17d0('0x62'),path['parse'](_0x5e385f[_0x17d0('0x63')])[_0x17d0('0x27')],_0x5e385f[_0x17d0('0x63')]);gs[_0x17d0('0x64')](_0x5b9f9c)[_0x17d0('0x3d')](function(){_0x5e385f[_0x17d0('0x63')]=util[_0x17d0('0x65')](_0x17d0('0x66'),path[_0x17d0('0x3b')](_0x5e385f[_0x17d0('0x63')])[_0x17d0('0x67')],path[_0x17d0('0x3b')](_0x5e385f['path'])[_0x17d0('0x27')]);_0x5c6bd6['XMF-PATH']=_0x5e385f[_0x17d0('0x63')];ut[_0x17d0('0x4a')](_0x17d0('0x68'),'');ami[_0x17d0('0x69')](ut[_0x17d0('0x6a')](_0x5e385f,_0x5c6bd6))[_0x17d0('0x3d')](function(_0x6706ec){_0x56aed6(_0x6706ec);})['catch'](function(_0x2db741){_0x1c0dca(_0x2db741);});})[_0x17d0('0x3f')](function(_0x48c52c){_0x1c0dca(_0x48c52c);});}else{ami[_0x17d0('0x69')](ut['variablesAction'](_0x5e385f,_0x5c6bd6))[_0x17d0('0x3d')](function(_0x972861){_0x56aed6(_0x972861);})[_0x17d0('0x3f')](function(_0x4989f6){_0x1c0dca(_0x4989f6);});}});}Fax[_0x17d0('0x1f')][_0x17d0('0x58')]=function(_0x262a8b,_0x42e589){var _0x42daa6=this;return new BPromise(function(_0x3fb0a4,_0x4aee72){var _0x37a34a=uuid['v4']();var _0x1b6f31=ut[_0x17d0('0x6b')](_0x262a8b,_0x42e589);_0x42daa6['actions'][_0x37a34a]=new Action(_0x37a34a,_0x42e589,_0x262a8b);var _0x1908b7=_0x42daa6[_0x17d0('0x10')][_0x37a34a];if(path[_0x17d0('0x3b')](_0x262a8b['path'])[_0x17d0('0x6c')]===_0x17d0('0x3c')){originate(_0x1908b7,_0x1b6f31,!![])['then'](function(_0x5acb60){_0x3fb0a4(_0x5acb60);})[_0x17d0('0x3f')](function(_0x106e21){_0x4aee72(_0x106e21);});}else{originate(_0x1908b7,_0x1b6f31,![])['then'](function(_0x23379d){_0x3fb0a4(_0x23379d);})[_0x17d0('0x3f')](function(_0x758f8a){_0x4aee72(_0x758f8a);});}});};Fax[_0x17d0('0x1f')][_0x17d0('0x6d')]=function(_0x6bd147){return!_[_0x17d0('0x6e')](_0x6bd147)&&!_[_0x17d0('0x6e')](_0x6bd147['name'])&&!_[_0x17d0('0x6e')](_0x6bd147[_0x17d0('0x6f')])&&_0x6bd147[_0x17d0('0x6f')]&&!_[_0x17d0('0x6e')](this['trunks'][util[_0x17d0('0x65')](_0x17d0('0x70'),_0x6bd147[_0x17d0('0x27')])])&&!_[_0x17d0('0x6e')](this[_0x17d0('0xf')][util[_0x17d0('0x65')]('SIP/%s',_0x6bd147[_0x17d0('0x27')])][_0x17d0('0x30')])&&(this['trunks'][util['format'](_0x17d0('0x70'),_0x6bd147[_0x17d0('0x27')])][_0x17d0('0x30')]===_0x17d0('0x71')||this[_0x17d0('0xf')][util[_0x17d0('0x65')](_0x17d0('0x70'),_0x6bd147[_0x17d0('0x27')])]['status']===_0x17d0('0x72'));};Fax[_0x17d0('0x1f')][_0x17d0('0x5d')]=function(_0x4ac730,_0x1a817e){if(!this['isTrunkReachable'](_0x4ac730)){ut[_0x17d0('0x4a')](_0x17d0('0x73'),_[_0x17d0('0x6e')](_0x4ac730)?'':_0x4ac730[_0x17d0('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x17d0('0x74')};}if(_['isNil'](_0x1a817e[_0x17d0('0x7')])){ut[_0x17d0('0x4a')](_0x17d0('0x75'),JSON['stringify'](_0x1a817e));return{'isValid':![],'message':_0x17d0('0x76')};}if(_['isNil'](_0x1a817e['path'])){ut[_0x17d0('0x4a')](_0x17d0('0x77'),JSON[_0x17d0('0x41')](_0x1a817e));return{'isValid':![],'message':_0x17d0('0x78')};}return{'isValid':!![],'message':_0x17d0('0x79')};};module[_0x17d0('0x7a')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b6c05d5..bb41243 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 _0xa77f=['util','bluebird','preview','lodash','../rpc/faxAccount','notify','resolve','then','[Notify]\x20'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa77f,0x14d));var _0xfa77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa77f[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xfa77('0x0'));var BPromise=require(_0xfa77('0x1'));var logger=require('../../../config/logger')(_0xfa77('0x2'));var _=require(_0xfa77('0x3'));var faxAccount=require(_0xfa77('0x4'));function loggerCatch(_0xd18bff){return function(_0x54deef){logger['error'](_0xd18bff,util['inspect'](_0x54deef,{'showHidden':![],'depth':null}));};}exports[_0xfa77('0x5')]=function(_0x551a3d,_0x2c7768){return BPromise[_0xfa77('0x6')]()[_0xfa77('0x7')](faxAccount['notify'](_0x551a3d,_0x2c7768))['catch'](loggerCatch(_0xfa77('0x8')));}; \ No newline at end of file +var _0x37ae=['resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify'];(function(_0x30df68,_0x47a14b){var _0x103bae=function(_0x4ed75f){while(--_0x4ed75f){_0x30df68['push'](_0x30df68['shift']());}};_0x103bae(++_0x47a14b);}(_0x37ae,0x70));var _0xe37a=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0x37ae[_0x3cec8c];return _0x38032e;};'use strict';var util=require(_0xe37a('0x0'));var BPromise=require(_0xe37a('0x1'));var logger=require(_0xe37a('0x2'))(_0xe37a('0x3'));var _=require(_0xe37a('0x4'));var faxAccount=require(_0xe37a('0x5'));function loggerCatch(_0x3a90de){return function(_0x383409){logger['error'](_0x3a90de,util[_0xe37a('0x6')](_0x383409,{'showHidden':![],'depth':null}));};}exports[_0xe37a('0x7')]=function(_0x157c48,_0x51ea69){return BPromise[_0xe37a('0x8')]()[_0xe37a('0x9')](faxAccount[_0xe37a('0x7')](_0x157c48,_0x51ea69))[_0xe37a('0xa')](loggerCatch(_0xe37a('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 4352a2e..76ba237 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 _0xf6a3=['info','Exec\x20gs','\x20Error\x20:','bluebird','child_process','exec','execute'];(function(_0x58cfdd,_0x2f7e29){var _0x7a250b=function(_0x5cbc66){while(--_0x5cbc66){_0x58cfdd['push'](_0x58cfdd['shift']());}};_0x7a250b(++_0x2f7e29);}(_0xf6a3,0xc0));var _0x3f6a=function(_0x29bad0,_0x3e056f){_0x29bad0=_0x29bad0-0x0;var _0x1885de=_0xf6a3[_0x29bad0];return _0x1885de;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x3f6a('0x0'));var exec=require(_0x3f6a('0x1'))[_0x3f6a('0x2')];exports[_0x3f6a('0x3')]=function(_0x5325f9){return new BPromise(function(_0x59afca,_0x33186a){exec(_0x5325f9,function(_0x3b8355,_0x10e5a3,_0x5f06e3){logger[_0x3f6a('0x4')](_0x3f6a('0x5'),_0x10e5a3);if(_0x3b8355){logger[_0x3f6a('0x4')](_0x3f6a('0x5'),_0x3f6a('0x6'),util['inspect'](_0x3b8355,{'showHidden':![],'depth':null}),_0x10e5a3,_0x5f06e3);_0x33186a(_0x3b8355);}_0x59afca(_0x10e5a3);});});}; \ No newline at end of file +var _0x4b0e=['util','../../../../config/logger','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b0e,0x172));var _0xe4b0=function(_0x190ac7,_0x171e1d){_0x190ac7=_0x190ac7-0x0;var _0x39695d=_0x4b0e[_0x190ac7];return _0x39695d;};'use strict';var util=require(_0xe4b0('0x0'));var logger=require(_0xe4b0('0x1'))('fax');var BPromise=require(_0xe4b0('0x2'));var exec=require(_0xe4b0('0x3'))[_0xe4b0('0x4')];exports[_0xe4b0('0x5')]=function(_0x47a316){return new BPromise(function(_0x3cdc46,_0x523bc4){exec(_0x47a316,function(_0x363ef5,_0x4201b9,_0x5c49f0){logger[_0xe4b0('0x6')]('Exec\x20gs',_0x4201b9);if(_0x363ef5){logger['info'](_0xe4b0('0x7'),_0xe4b0('0x8'),util[_0xe4b0('0x9')](_0x363ef5,{'showHidden':![],'depth':null}),_0x4201b9,_0x5c49f0);_0x523bc4(_0x363ef5);}_0x3cdc46(_0x4201b9);});});}; \ 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 777b1d0..3fede8d 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 _0x306d=['util','lodash','moment','fax','info','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>'];(function(_0x15c147,_0x28a690){var _0x28a2a9=function(_0x3d2b6c){while(--_0x3d2b6c){_0x15c147['push'](_0x15c147['shift']());}};_0x28a2a9(++_0x28a690);}(_0x306d,0x176));var _0xd306=function(_0x5d90ff,_0x475dab){_0x5d90ff=_0x5d90ff-0x0;var _0x287ba2=_0x306d[_0x5d90ff];return _0x287ba2;};'use strict';var util=require(_0xd306('0x0'));var _=require(_0xd306('0x1'));var moment=require(_0xd306('0x2'));var logger=require('../../../../config/logger')(_0xd306('0x3'));exports['message']=function(_0xe07d24){return{'message':_0xe07d24};};exports['logger']=function(_0x2a7f9d,_0x181147){logger[_0xd306('0x4')](_0x2a7f9d,util['inspect'](_0x181147,{'showHidden':![],'depth':null}));};exports[_0xd306('0x5')]=function(_0x4b70cb,_0x485485){var _0x3778f4={'XMF-ECM':_0x485485[_0xd306('0x6')],'XMF-HEADERINFO':_0x485485[_0xd306('0x7')],'XMF-MINRATE':_0x485485[_0xd306('0x8')],'XMF-MAXRATE':_0x485485['maxrate'],'XMF-MODEM':util[_0xd306('0x9')](_0xd306('0xa'),_0x485485[_0xd306('0xb')]),'XMF-GATEWAY':_0x485485[_0xd306('0xc')],'XMF-FAXDETECT':_0x485485['faxdetect'],'XMF-T38TIMEOUT':_0x485485[_0xd306('0xd')],'XMF-LOCALSTATIONID':_0x485485[_0xd306('0xe')],'XMF-PATH':_0x4b70cb[_0xd306('0xf')]};return _0x3778f4;};exports[_0xd306('0x10')]=function(_0x35f72e,_0x31a9cc){return{'actionid':_0x35f72e[_0xd306('0x11')],'action':_0xd306('0x12'),'channel':_0x35f72e[_0xd306('0x13')],'Exten':'xcally-motion-fax','Context':_0xd306('0x14'),'Priority':'1','callerid':util[_0xd306('0x9')](_0xd306('0x15'),_0x35f72e['headerinfo']?_0x35f72e[_0xd306('0x7')]:'',_0x35f72e['localstationid']),'variable':_0x31a9cc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x35f72e['uniqueid']};}; \ No newline at end of file +var _0x353e=['fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger'];(function(_0x375ccb,_0x1161f4){var _0x4b5c12=function(_0x2adfb2){while(--_0x2adfb2){_0x375ccb['push'](_0x375ccb['shift']());}};_0x4b5c12(++_0x1161f4);}(_0x353e,0x1be));var _0xe353=function(_0x36f89c,_0x1e2de7){_0x36f89c=_0x36f89c-0x0;var _0x5bcdab=_0x353e[_0x36f89c];return _0x5bcdab;};'use strict';var util=require(_0xe353('0x0'));var _=require(_0xe353('0x1'));var moment=require(_0xe353('0x2'));var logger=require(_0xe353('0x3'))(_0xe353('0x4'));exports[_0xe353('0x5')]=function(_0xf95798){return{'message':_0xf95798};};exports[_0xe353('0x6')]=function(_0x3ac05b,_0x49c83b){logger[_0xe353('0x7')](_0x3ac05b,util[_0xe353('0x8')](_0x49c83b,{'showHidden':![],'depth':null}));};exports[_0xe353('0x9')]=function(_0x152ad7,_0x12c0df){var _0x4c6f9e={'XMF-ECM':_0x12c0df[_0xe353('0xa')],'XMF-HEADERINFO':_0x12c0df[_0xe353('0xb')],'XMF-MINRATE':_0x12c0df[_0xe353('0xc')],'XMF-MAXRATE':_0x12c0df[_0xe353('0xd')],'XMF-MODEM':util[_0xe353('0xe')](_0xe353('0xf'),_0x12c0df[_0xe353('0x10')]),'XMF-GATEWAY':_0x12c0df['gateway'],'XMF-FAXDETECT':_0x12c0df[_0xe353('0x11')],'XMF-T38TIMEOUT':_0x12c0df[_0xe353('0x12')],'XMF-LOCALSTATIONID':_0x12c0df[_0xe353('0x13')],'XMF-PATH':_0x152ad7[_0xe353('0x14')]};return _0x4c6f9e;};exports['variablesAction']=function(_0x499966,_0x463329){return{'actionid':_0x499966[_0xe353('0x15')],'action':'originate','channel':_0x499966[_0xe353('0x16')],'Exten':'xcally-motion-fax','Context':_0xe353('0x17'),'Priority':'1','callerid':util[_0xe353('0xe')](_0xe353('0x18'),_0x499966['headerinfo']?_0x499966['headerinfo']:'',_0x499966[_0xe353('0x13')]),'variable':_0x463329,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x499966[_0xe353('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f7fb176..c7b07b7 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 _0xd483=['sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen'];(function(_0x4890b3,_0x238f4c){var _0x138a5c=function(_0x424d6e){while(--_0x424d6e){_0x4890b3['push'](_0x4890b3['shift']());}};_0x138a5c(++_0x238f4c);}(_0xd483,0x95));var _0x3d48=function(_0x27f4ea,_0x16168a){_0x27f4ea=_0x27f4ea-0x0;var _0x12aeea=_0xd483[_0x27f4ea];return _0x12aeea;};'use strict';var BPromise=require(_0x3d48('0x0'));var util=require(_0x3d48('0x1'));var moment=require(_0x3d48('0x2'));var server=require(_0x3d48('0x3'));var Realtime=require(_0x3d48('0x4'));var Report=require(_0x3d48('0x5'));var Acw=require(_0x3d48('0x6'));var Trigger=require(_0x3d48('0x7'));var Dialer=require(_0x3d48('0x8'));var Preview=require(_0x3d48('0x9'));var Fax=require(_0x3d48('0xa'));var user=require(_0x3d48('0xb'));var voiceQueue=require(_0x3d48('0xc'));var voiceQueueReport=require(_0x3d48('0xd'));var voiceCallReport=require(_0x3d48('0xe'));var trunk=require(_0x3d48('0xf'));var trigger=require('./rpc/trigger');var template=require(_0x3d48('0x10'));var cmHopperHistory=require(_0x3d48('0x11'));var campaign=require(_0x3d48('0x12'));var voiceExtension=require(_0x3d48('0x13'));var faxAccount=require(_0x3d48('0x14'));var zendesk=require(_0x3d48('0x15'));var salesforce=require(_0x3d48('0x16'));var sugarcrm=require(_0x3d48('0x17'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x3d48('0x18'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x3d48('0x19'));var freshsales=require(_0x3d48('0x1a'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3d48('0x1b')](_0x3d48('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3d48('0x1b')](_0x3d48('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3d48('0x1d')]()[_0x3d48('0x1e')](user[_0x3d48('0x1f')]())['then'](realtime[_0x3d48('0x20')]())['then'](user['getTelephones']())[_0x3d48('0x1e')](realtime[_0x3d48('0x21')]())[_0x3d48('0x1e')](trunk[_0x3d48('0x22')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x23')]())['then'](voiceQueue[_0x3d48('0x24')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x25')]())[_0x3d48('0x1e')](trigger[_0x3d48('0x26')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x27')]())[_0x3d48('0x1e')](template[_0x3d48('0x28')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x29')]())[_0x3d48('0x1e')](zendesk[_0x3d48('0x2a')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x2b')]())['then'](salesforce[_0x3d48('0x2c')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x2d')]())['then'](sugarcrm[_0x3d48('0x2e')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x2f')]())[_0x3d48('0x1e')](freshdesk[_0x3d48('0x30')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x31')]())[_0x3d48('0x1e')](desk[_0x3d48('0x32')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x33')]())[_0x3d48('0x1e')](zoho[_0x3d48('0x34')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x35')]())['then'](vtiger['getVtigerAccounts']())[_0x3d48('0x1e')](realtime[_0x3d48('0x36')]())[_0x3d48('0x1e')](freshsales['getFreshsalesAccounts']())[_0x3d48('0x1e')](realtime[_0x3d48('0x37')]())[_0x3d48('0x1e')](servicenow[_0x3d48('0x38')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x39')]())[_0x3d48('0x1e')](dynamics365[_0x3d48('0x3a')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x3b')]())[_0x3d48('0x1e')](campaign['getCampaigns']())[_0x3d48('0x1e')](realtime[_0x3d48('0x3c')]())[_0x3d48('0x1e')](voiceExtension['getVoiceExtensions']())[_0x3d48('0x1e')](realtime[_0x3d48('0x3d')]())[_0x3d48('0x1e')](faxAccount['getFaxAccounts']())[_0x3d48('0x1e')](realtime[_0x3d48('0x3e')]())[_0x3d48('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x3d48('0x1d')]()[_0x3d48('0x1e')](voiceQueueReport[_0x3d48('0x3f')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x40')]())[_0x3d48('0x1e')](cmHopperHistory[_0x3d48('0x41')]())[_0x3d48('0x1e')](realtime[_0x3d48('0x42')]())[_0x3d48('0x1e')](cmHopperHistory[_0x3d48('0x43')]())['then'](realtime[_0x3d48('0x44')]())[_0x3d48('0x1e')](voiceCallReport[_0x3d48('0x45')]())['then'](realtime[_0x3d48('0x46')]())[_0x3d48('0x1e')](function(_0x716c8e){})['catch'](function(_0x294d5a){console[_0x3d48('0x47')](_0x294d5a);});}function main(){return server[_0x3d48('0x48')](realtime,preview,fax)['then'](function(_0x579e53){return initRealtime();})[_0x3d48('0x1e')](function(){return initParams();})[_0x3d48('0x1e')](function(){report[_0x3d48('0x49')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4e964c){console[_0x3d48('0x47')](_0x4e964c);});}main(); \ No newline at end of file +var _0xbd73=['./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','listen','sync','catch','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template'];(function(_0x31177c,_0x468815){var _0x5b1b59=function(_0x41d573){while(--_0x41d573){_0x31177c['push'](_0x31177c['shift']());}};_0x5b1b59(++_0x468815);}(_0xbd73,0x73));var _0x3bd7=function(_0x1203e0,_0x87d50b){_0x1203e0=_0x1203e0-0x0;var _0x3faf9e=_0xbd73[_0x1203e0];return _0x3faf9e;};'use strict';var BPromise=require(_0x3bd7('0x0'));var util=require(_0x3bd7('0x1'));var moment=require(_0x3bd7('0x2'));var server=require(_0x3bd7('0x3'));var Realtime=require(_0x3bd7('0x4'));var Report=require('./report');var Acw=require(_0x3bd7('0x5'));var Trigger=require(_0x3bd7('0x6'));var Dialer=require(_0x3bd7('0x7'));var Preview=require(_0x3bd7('0x8'));var Fax=require(_0x3bd7('0x9'));var user=require(_0x3bd7('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x3bd7('0xb'));var voiceCallReport=require(_0x3bd7('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0x3bd7('0xd'));var template=require(_0x3bd7('0xe'));var cmHopperHistory=require(_0x3bd7('0xf'));var campaign=require(_0x3bd7('0x10'));var voiceExtension=require(_0x3bd7('0x11'));var faxAccount=require(_0x3bd7('0x12'));var zendesk=require(_0x3bd7('0x13'));var salesforce=require(_0x3bd7('0x14'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x3bd7('0x15'));var zoho=require(_0x3bd7('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x3bd7('0x17'));var servicenow=require(_0x3bd7('0x18'));var dynamics365=require(_0x3bd7('0x19'));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()[_0x3bd7('0x1a')](_0x3bd7('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3bd7('0x1a')](_0x3bd7('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3bd7('0x1c')]()['then'](user[_0x3bd7('0x1d')]())[_0x3bd7('0x1e')](realtime['initAgents']())[_0x3bd7('0x1e')](user['getTelephones']())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x1f')]())[_0x3bd7('0x1e')](trunk[_0x3bd7('0x20')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x21')]())[_0x3bd7('0x1e')](voiceQueue[_0x3bd7('0x22')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x23')]())[_0x3bd7('0x1e')](trigger[_0x3bd7('0x24')]())['then'](realtime[_0x3bd7('0x25')]())[_0x3bd7('0x1e')](template['getTemplates']())[_0x3bd7('0x1e')](realtime['initTemplates']())[_0x3bd7('0x1e')](zendesk[_0x3bd7('0x26')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x27')]())[_0x3bd7('0x1e')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x3bd7('0x28')]())[_0x3bd7('0x1e')](sugarcrm[_0x3bd7('0x29')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x2a')]())['then'](freshdesk['getFreshdeskAccounts']())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x2b')]())['then'](desk['getDeskAccounts']())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x2c')]())[_0x3bd7('0x1e')](zoho[_0x3bd7('0x2d')]())['then'](realtime[_0x3bd7('0x2e')]())['then'](vtiger[_0x3bd7('0x2f')]())['then'](realtime[_0x3bd7('0x30')]())[_0x3bd7('0x1e')](freshsales['getFreshsalesAccounts']())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x31')]())['then'](servicenow[_0x3bd7('0x32')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x33')]())['then'](dynamics365[_0x3bd7('0x34')]())[_0x3bd7('0x1e')](realtime['initDynamics365Accounts']())['then'](campaign[_0x3bd7('0x35')]())[_0x3bd7('0x1e')](realtime['initCampaigns']())['then'](voiceExtension[_0x3bd7('0x36')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x37')]())[_0x3bd7('0x1e')](faxAccount['getFaxAccounts']())['then'](realtime[_0x3bd7('0x38')]())[_0x3bd7('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x3bd7('0x1c')]()[_0x3bd7('0x1e')](voiceQueueReport[_0x3bd7('0x39')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x3a')]())[_0x3bd7('0x1e')](cmHopperHistory[_0x3bd7('0x3b')]())[_0x3bd7('0x1e')](realtime[_0x3bd7('0x3c')]())[_0x3bd7('0x1e')](cmHopperHistory[_0x3bd7('0x3d')]())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport['getVoiceCallReports']())[_0x3bd7('0x1e')](realtime['initVoiceCallReports']())[_0x3bd7('0x1e')](function(_0x36e9dc){})['catch'](function(_0x111d85){console['log'](_0x111d85);});}function main(){return server[_0x3bd7('0x3e')](realtime,preview,fax)[_0x3bd7('0x1e')](function(_0x58fef3){return initRealtime();})[_0x3bd7('0x1e')](function(){return initParams();})[_0x3bd7('0x1e')](function(){report[_0x3bd7('0x3f')]();setInterval(initRealtime,0x1388);})[_0x3bd7('0x40')](function(_0x472e06){console['log'](_0x472e06);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index e9f6820..6fe0227 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xedd9,0xfc));var _0x9edd=function(_0x38c82d,_0x430408){_0x38c82d=_0x38c82d-0x0;var _0x2d7429=_0xedd9[_0x38c82d];return _0x2d7429;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x4d3940,_0x167a82){var _0x542862=function(_0x462ca2){while(--_0x462ca2){_0x4d3940['push'](_0x4d3940['shift']());}};_0x542862(++_0x167a82);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c33e4f2..11b796d 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 _0x8506=['exports','name','type','campaign','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x4bb87d,_0x449213){var _0x5f10cd=function(_0x475d26){while(--_0x475d26){_0x4bb87d['push'](_0x4bb87d['shift']());}};_0x5f10cd(++_0x449213);}(_0x8506,0x91));var _0x6850=function(_0x59ad8f,_0x482b86){_0x59ad8f=_0x59ad8f-0x0;var _0x532dfb=_0x8506[_0x59ad8f];return _0x532dfb;};'use strict';function Campaign(_0x5c561d){this['id']=_0x5c561d['id']||0x0;this[_0x6850('0x0')]=_0x5c561d[_0x6850('0x0')]||'';this[_0x6850('0x1')]=_0x5c561d[_0x6850('0x1')]||_0x6850('0x2');this['originated']=0x0;this[_0x6850('0x3')]=0x0;this[_0x6850('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x6850('0x5')]='';this[_0x6850('0x6')]=!![];this['active']=_0x5c561d[_0x6850('0x7')];this[_0x6850('0x8')]=_0x5c561d[_0x6850('0x8')];this[_0x6850('0x9')]=_0x5c561d[_0x6850('0x9')]||null;this['dialGlobalInterval']=_0x5c561d[_0x6850('0xa')]?_0x5c561d[_0x6850('0xa')]:null;this[_0x6850('0xb')]=_0x5c561d[_0x6850('0xb')];this[_0x6850('0xc')]=_0x5c561d[_0x6850('0xc')];this['dialOriginateTimeout']=_0x5c561d[_0x6850('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x5c561d[_0x6850('0xe')];this['dialCongestionRetryFrequency']=_0x5c561d['dialCongestionRetryFrequency'];this[_0x6850('0xf')]=_0x5c561d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x5c561d[_0x6850('0x10')];this[_0x6850('0x11')]=_0x5c561d[_0x6850('0x11')];this['dialNoAnswerRetryFrequency']=_0x5c561d[_0x6850('0x12')];this[_0x6850('0x13')]=_0x5c561d[_0x6850('0x13')];this[_0x6850('0x14')]=_0x5c561d[_0x6850('0x14')]||0x3;this[_0x6850('0x15')]=_0x5c561d[_0x6850('0x15')]||0x96;this[_0x6850('0x16')]=_0x5c561d[_0x6850('0x16')]||0x3;this[_0x6850('0x17')]=_0x5c561d[_0x6850('0x17')]||0x96;this[_0x6850('0x18')]=_0x5c561d['dialAbandonedMaxRetry']||0x3;this[_0x6850('0x19')]=_0x5c561d[_0x6850('0x19')]||0x96;this[_0x6850('0x1a')]=_0x5c561d[_0x6850('0x1a')]||0x3;this[_0x6850('0x1b')]=_0x5c561d[_0x6850('0x1b')]||0x96;this[_0x6850('0x1c')]=_0x5c561d[_0x6850('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5c561d[_0x6850('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x5c561d['dialOrderByScheduledAt']||_0x6850('0x1e');this['dialPrefix']=_0x5c561d['dialPrefix']||undefined;this[_0x6850('0x1f')]=_0x5c561d[_0x6850('0x1f')]||undefined;this[_0x6850('0x20')]=_0x5c561d['dialCutDigit']||undefined;this[_0x6850('0x21')]=_0x5c561d[_0x6850('0x21')]?_0x5c561d[_0x6850('0x21')]:undefined;this[_0x6850('0x22')]=_0x5c561d[_0x6850('0x22')]?_0x5c561d['Trunk']:undefined;this['Interval']=_0x5c561d[_0x6850('0x23')]?_0x5c561d[_0x6850('0x23')]:undefined;this[_0x6850('0x24')]=_0x5c561d[_0x6850('0x24')]?_0x5c561d['SquareProject']:undefined;this[_0x6850('0x25')]=_0x5c561d['SquareProject']?_0x5c561d[_0x6850('0x24')][_0x6850('0x0')]:undefined;this['dialAMDActive']=_0x5c561d['dialAMDActive']||![];this[_0x6850('0x26')]=_0x5c561d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x5c561d[_0x6850('0x27')];this[_0x6850('0x28')]=_0x5c561d[_0x6850('0x28')];this[_0x6850('0x29')]=_0x5c561d['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5c561d[_0x6850('0x2a')];this['dialAMDBetweenWordsSilence']=_0x5c561d[_0x6850('0x2b')];this[_0x6850('0x2c')]=_0x5c561d[_0x6850('0x2c')];this['dialAMDSilenceThreshold']=_0x5c561d[_0x6850('0x2d')];this[_0x6850('0x2e')]=_0x5c561d[_0x6850('0x2e')];}module[_0x6850('0x2f')]=Campaign; \ No newline at end of file +var _0x606c=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix'];(function(_0x18ff48,_0x2a9ade){var _0x4a65e4=function(_0x323d9e){while(--_0x323d9e){_0x18ff48['push'](_0x18ff48['shift']());}};_0x4a65e4(++_0x2a9ade);}(_0x606c,0x111));var _0xc606=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0x606c[_0x56a061];return _0x105fa0;};'use strict';function Campaign(_0x15312f){this['id']=_0x15312f['id']||0x0;this[_0xc606('0x0')]=_0x15312f['name']||'';this[_0xc606('0x1')]=_0x15312f[_0xc606('0x1')]||_0xc606('0x2');this[_0xc606('0x3')]=0x0;this[_0xc606('0x4')]=0x0;this[_0xc606('0x5')]=0x0;this[_0xc606('0x6')]=0x0;this[_0xc606('0x7')]='';this[_0xc606('0x8')]=!![];this[_0xc606('0x9')]=_0x15312f['active'];this[_0xc606('0xa')]=_0x15312f[_0xc606('0xa')];this[_0xc606('0xb')]=_0x15312f[_0xc606('0xb')]||null;this[_0xc606('0xc')]=_0x15312f[_0xc606('0xc')]?_0x15312f[_0xc606('0xc')]:null;this[_0xc606('0xd')]=_0x15312f[_0xc606('0xd')];this[_0xc606('0xe')]=_0x15312f['dialOriginateCallerIdNumber'];this[_0xc606('0xf')]=_0x15312f['dialOriginateTimeout']||0x1e;this[_0xc606('0x10')]=_0x15312f[_0xc606('0x10')];this['dialCongestionRetryFrequency']=_0x15312f[_0xc606('0x11')];this[_0xc606('0x12')]=_0x15312f['dialBusyMaxRetry'];this[_0xc606('0x13')]=_0x15312f['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x15312f[_0xc606('0x14')];this[_0xc606('0x15')]=_0x15312f[_0xc606('0x15')];this['dialGlobalMaxRetry']=_0x15312f['dialGlobalMaxRetry'];this[_0xc606('0x16')]=_0x15312f['dialNoSuchNumberMaxRetry']||0x3;this[_0xc606('0x17')]=_0x15312f[_0xc606('0x17')]||0x96;this[_0xc606('0x18')]=_0x15312f[_0xc606('0x18')]||0x3;this['dialDropRetryFrequency']=_0x15312f['dialDropRetryFrequency']||0x96;this[_0xc606('0x19')]=_0x15312f['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x15312f[_0xc606('0x1a')]||0x96;this[_0xc606('0x1b')]=_0x15312f[_0xc606('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x15312f['dialMachineRetryFrequency']||0x96;this[_0xc606('0x1c')]=_0x15312f['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x15312f[_0xc606('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x15312f[_0xc606('0x1e')]||_0xc606('0x1f');this[_0xc606('0x20')]=_0x15312f[_0xc606('0x20')]||undefined;this[_0xc606('0x21')]=_0x15312f[_0xc606('0x21')]||undefined;this['dialCutDigit']=_0x15312f[_0xc606('0x22')]||undefined;this['TrunkBackup']=_0x15312f[_0xc606('0x23')]?_0x15312f[_0xc606('0x23')]:undefined;this[_0xc606('0x24')]=_0x15312f[_0xc606('0x24')]?_0x15312f[_0xc606('0x24')]:undefined;this['Interval']=_0x15312f[_0xc606('0x25')]?_0x15312f[_0xc606('0x25')]:undefined;this[_0xc606('0x26')]=_0x15312f[_0xc606('0x26')]?_0x15312f[_0xc606('0x26')]:undefined;this[_0xc606('0x27')]=_0x15312f['SquareProject']?_0x15312f[_0xc606('0x26')][_0xc606('0x0')]:undefined;this[_0xc606('0x28')]=_0x15312f['dialAMDActive']||![];this[_0xc606('0x29')]=_0x15312f[_0xc606('0x29')];this[_0xc606('0x2a')]=_0x15312f['dialAMDGreeting'];this[_0xc606('0x2b')]=_0x15312f[_0xc606('0x2b')];this['dialAMDTotalAnalysisTime']=_0x15312f[_0xc606('0x2c')];this[_0xc606('0x2d')]=_0x15312f[_0xc606('0x2d')];this[_0xc606('0x2e')]=_0x15312f[_0xc606('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x15312f[_0xc606('0x2f')];this['dialAMDSilenceThreshold']=_0x15312f[_0xc606('0x30')];this[_0xc606('0x31')]=_0x15312f[_0xc606('0x31')];}module[_0xc606('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index db623db..3e6d7f3 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 _0x9d01=['disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag'];(function(_0x4bae16,_0x235f09){var _0x41ebaf=function(_0x2e7911){while(--_0x2e7911){_0x4bae16['push'](_0x4bae16['shift']());}};_0x41ebaf(++_0x235f09);}(_0x9d01,0x1ec));var _0x19d0=function(_0x5eab5f,_0x339d4e){_0x5eab5f=_0x5eab5f-0x0;var _0x7dd2eb=_0x9d01[_0x5eab5f];return _0x7dd2eb;};'use strict';function Channel(){this[_0x19d0('0x0')]=null;this[_0x19d0('0x1')]='';this[_0x19d0('0x2')]='';this[_0x19d0('0x3')]=0x0;this[_0x19d0('0x4')]='';this[_0x19d0('0x5')]=undefined;this[_0x19d0('0x6')]=undefined;this[_0x19d0('0x7')]=0x0;this['context']='';this[_0x19d0('0x8')]=0x0;this['linkedid']=0x0;this[_0x19d0('0x9')]=0x0;this[_0x19d0('0xa')]=![];this[_0x19d0('0xb')]=null;this['endtime']=null;this[_0x19d0('0xc')]=![];this[_0x19d0('0xd')]=![];this[_0x19d0('0xe')]='';this[_0x19d0('0xf')]='';this[_0x19d0('0x10')]=0x0;this[_0x19d0('0x11')]=0x0;this[_0x19d0('0x12')]=0x0;this[_0x19d0('0x13')]=null;this[_0x19d0('0x14')]=null;this[_0x19d0('0x15')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x19d0('0x16')]=null;this[_0x19d0('0x17')]=[];this[_0x19d0('0x18')]=undefined;this[_0x19d0('0x19')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x19d0('0x1a')]=Channel; \ No newline at end of file +var _0xb5fb=['context','uniqueid','linkedid','exten','answered','answertime','abandoned','lastdata','duration','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode'];(function(_0x2ec7c4,_0x2a4343){var _0x5851f6=function(_0x4affe0){while(--_0x4affe0){_0x2ec7c4['push'](_0x2ec7c4['shift']());}};_0x5851f6(++_0x2a4343);}(_0xb5fb,0x172));var _0xbb5f=function(_0x871557,_0x21ae05){_0x871557=_0x871557-0x0;var _0x24345c=_0xb5fb[_0x871557];return _0x24345c;};'use strict';function Channel(){this[_0xbb5f('0x0')]=null;this[_0xbb5f('0x1')]='';this[_0xbb5f('0x2')]='';this[_0xbb5f('0x3')]=0x0;this[_0xbb5f('0x4')]='';this[_0xbb5f('0x5')]=undefined;this[_0xbb5f('0x6')]=undefined;this[_0xbb5f('0x7')]=0x0;this[_0xbb5f('0x8')]='';this[_0xbb5f('0x9')]=0x0;this[_0xbb5f('0xa')]=0x0;this[_0xbb5f('0xb')]=0x0;this[_0xbb5f('0xc')]=![];this[_0xbb5f('0xd')]=null;this['endtime']=null;this['unmanaged']=![];this[_0xbb5f('0xe')]=![];this['lastapplication']='';this[_0xbb5f('0xf')]='';this[_0xbb5f('0x10')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xbb5f('0x11')]=null;this['tag']=null;this[_0xbb5f('0x12')]=null;this[_0xbb5f('0x13')]=![];this[_0xbb5f('0x14')]=null;this[_0xbb5f('0x15')]=null;this[_0xbb5f('0x16')]=[];this[_0xbb5f('0x17')]=undefined;this[_0xbb5f('0x18')]=undefined;this[_0xbb5f('0x19')]=undefined;this['mohtime']=0x0;}module[_0xbb5f('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index b608286..7dda45d 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 _0x6735=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x4ff60f,_0x5e2a42){var _0x12cbbd=function(_0x5de1ea){while(--_0x5de1ea){_0x4ff60f['push'](_0x4ff60f['shift']());}};_0x12cbbd(++_0x5e2a42);}(_0x6735,0x1a2));var _0x5673=function(_0x4f9afb,_0x14e21b){_0x4f9afb=_0x4f9afb-0x0;var _0x6dcdaf=_0x6735[_0x4f9afb];return _0x6dcdaf;};'use strict';function DeskAccount(_0x556a8a){this['id']=_0x556a8a['id']||0x0;this[_0x5673('0x0')]=_0x556a8a[_0x5673('0x0')]||'';this['username']=_0x556a8a[_0x5673('0x1')]||'';this[_0x5673('0x2')]=_0x556a8a[_0x5673('0x2')]||'';this[_0x5673('0x3')]=_0x556a8a[_0x5673('0x3')]||'';this[_0x5673('0x4')]=_0x556a8a[_0x5673('0x4')]||'';this[_0x5673('0x5')]=_0x556a8a[_0x5673('0x5')]||'';this[_0x5673('0x6')]=_0x556a8a[_0x5673('0x6')]||'';this[_0x5673('0x7')]=_0x556a8a[_0x5673('0x7')]||'';this[_0x5673('0x8')]=_0x556a8a[_0x5673('0x8')]||'';this[_0x5673('0x9')]=_0x556a8a[_0x5673('0x9')]||'';this[_0x5673('0xa')]=_0x556a8a[_0x5673('0xa')]||'';this[_0x5673('0xb')]=_0x556a8a['Configurations']||{};}module[_0x5673('0xc')]=DeskAccount; \ No newline at end of file +var _0x2bf7=['type','serverUrl','Configurations','exports','name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x588a3c,_0xc4d0f1){var _0x5f01c9=function(_0x4398f6){while(--_0x4398f6){_0x588a3c['push'](_0x588a3c['shift']());}};_0x5f01c9(++_0xc4d0f1);}(_0x2bf7,0x154));var _0x72bf=function(_0x1334a1,_0x346e49){_0x1334a1=_0x1334a1-0x0;var _0x94ce8e=_0x2bf7[_0x1334a1];return _0x94ce8e;};'use strict';function DeskAccount(_0xda3e51){this['id']=_0xda3e51['id']||0x0;this[_0x72bf('0x0')]=_0xda3e51[_0x72bf('0x0')]||'';this[_0x72bf('0x1')]=_0xda3e51[_0x72bf('0x1')]||'';this[_0x72bf('0x2')]=_0xda3e51['remoteUri']||'';this['authType']=_0xda3e51['authType']||'';this[_0x72bf('0x3')]=_0xda3e51[_0x72bf('0x3')]||'';this[_0x72bf('0x4')]=_0xda3e51[_0x72bf('0x4')]||'';this['consumerSecret']=_0xda3e51[_0x72bf('0x5')]||'';this['token']=_0xda3e51[_0x72bf('0x6')]||'';this[_0x72bf('0x7')]=_0xda3e51[_0x72bf('0x7')]||'';this[_0x72bf('0x8')]=_0xda3e51[_0x72bf('0x8')]||'';this[_0x72bf('0x9')]=_0xda3e51['serverUrl']||'';this[_0x72bf('0xa')]=_0xda3e51[_0x72bf('0xa')]||{};}module[_0x72bf('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 4f630dd..88151bf 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 _0x153f=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x153f,0x15b));var _0xf153=function(_0x4f09b3,_0x53253a){_0x4f09b3=_0x4f09b3-0x0;var _0x228482=_0x153f[_0x4f09b3];return _0x228482;};'use strict';function Dynamics365Account(_0x2bbc4c){this['id']=_0x2bbc4c['id']||0x0;this[_0xf153('0x0')]=_0x2bbc4c[_0xf153('0x0')]||'';this[_0xf153('0x1')]=_0x2bbc4c[_0xf153('0x1')]||'';this[_0xf153('0x2')]=_0x2bbc4c[_0xf153('0x2')]||'';this['remoteUri']=_0x2bbc4c[_0xf153('0x3')]||'';this['tenantId']=_0x2bbc4c[_0xf153('0x4')]||'';this[_0xf153('0x5')]=_0x2bbc4c[_0xf153('0x5')]||'';this[_0xf153('0x6')]=_0x2bbc4c[_0xf153('0x6')]||{};this['serverUrl']=_0x2bbc4c[_0xf153('0x7')]||'';this[_0xf153('0x8')]=_0x2bbc4c[_0xf153('0x8')]||{};}module[_0xf153('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xec56=['clientSecret','serverUrl','Configurations','exports','username','password','remoteUri','tenantId','clientId'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0xec56,0x1bd));var _0x6ec5=function(_0x6dbf90,_0x276759){_0x6dbf90=_0x6dbf90-0x0;var _0x290950=_0xec56[_0x6dbf90];return _0x290950;};'use strict';function Dynamics365Account(_0x2f3f02){this['id']=_0x2f3f02['id']||0x0;this['name']=_0x2f3f02['name']||'';this[_0x6ec5('0x0')]=_0x2f3f02[_0x6ec5('0x0')]||'';this[_0x6ec5('0x1')]=_0x2f3f02[_0x6ec5('0x1')]||'';this[_0x6ec5('0x2')]=_0x2f3f02[_0x6ec5('0x2')]||'';this[_0x6ec5('0x3')]=_0x2f3f02[_0x6ec5('0x3')]||'';this[_0x6ec5('0x4')]=_0x2f3f02[_0x6ec5('0x4')]||'';this[_0x6ec5('0x5')]=_0x2f3f02[_0x6ec5('0x5')]||{};this[_0x6ec5('0x6')]=_0x2f3f02[_0x6ec5('0x6')]||'';this[_0x6ec5('0x7')]=_0x2f3f02[_0x6ec5('0x7')]||{};}module[_0x6ec5('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 7a28c4b..afa1313 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 _0x3cc4=['tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x3cc4,0x8c));var _0x43cc=function(_0x375bdd,_0x11b5de){_0x375bdd=_0x375bdd-0x0;var _0x3f0173=_0x3cc4[_0x375bdd];return _0x3f0173;};'use strict';function FaxAccount(_0x5aa179){this['id']=_0x5aa179['id']||0x0;this[_0x43cc('0x0')]=_0x5aa179['name']||'';this[_0x43cc('0x1')]=_0x5aa179['description'];this[_0x43cc('0x2')]=_0x5aa179[_0x43cc('0x2')];this[_0x43cc('0x3')]=_0x5aa179['headerinfo'];this[_0x43cc('0x4')]=_0x5aa179[_0x43cc('0x4')];this['minrate']=_0x5aa179['minrate']||0x960;this['maxrate']=_0x5aa179['maxrate']||0x3840;this[_0x43cc('0x5')]=_0x5aa179[_0x43cc('0x5')]||_0x43cc('0x6');this[_0x43cc('0x7')]=_0x5aa179[_0x43cc('0x7')]||'no';this[_0x43cc('0x8')]=_0x5aa179[_0x43cc('0x8')]||'no';this[_0x43cc('0x9')]=_0x5aa179[_0x43cc('0x9')]||0x1388;this[_0x43cc('0xa')]=_0x5aa179[_0x43cc('0xa')]||_0x43cc('0xb');this['Trunk']=_0x5aa179[_0x43cc('0xc')]?_0x5aa179[_0x43cc('0xc')]:undefined;this[_0x43cc('0xd')]=_0x5aa179['ListId'];this['key']=_0x5aa179[_0x43cc('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x69c8=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','headerinfo','localstationid'];(function(_0x31522a,_0x581ba3){var _0x88419c=function(_0x5192a9){while(--_0x5192a9){_0x31522a['push'](_0x31522a['shift']());}};_0x88419c(++_0x581ba3);}(_0x69c8,0x15c));var _0x869c=function(_0xbf8f73,_0x2ca243){_0xbf8f73=_0xbf8f73-0x0;var _0x53d9a9=_0x69c8[_0xbf8f73];return _0x53d9a9;};'use strict';function FaxAccount(_0x471b25){this['id']=_0x471b25['id']||0x0;this[_0x869c('0x0')]=_0x471b25[_0x869c('0x0')]||'';this[_0x869c('0x1')]=_0x471b25[_0x869c('0x1')];this['ecm']=_0x471b25['ecm'];this[_0x869c('0x2')]=_0x471b25[_0x869c('0x2')];this[_0x869c('0x3')]=_0x471b25[_0x869c('0x3')];this[_0x869c('0x4')]=_0x471b25[_0x869c('0x4')]||0x960;this['maxrate']=_0x471b25[_0x869c('0x5')]||0x3840;this['modem']=_0x471b25[_0x869c('0x6')]||_0x869c('0x7');this[_0x869c('0x8')]=_0x471b25[_0x869c('0x8')]||'no';this[_0x869c('0x9')]=_0x471b25['faxdetect']||'no';this[_0x869c('0xa')]=_0x471b25[_0x869c('0xa')]||0x1388;this[_0x869c('0xb')]=_0x471b25[_0x869c('0xb')]||_0x869c('0xc');this[_0x869c('0xd')]=_0x471b25[_0x869c('0xd')]?_0x471b25[_0x869c('0xd')]:undefined;this[_0x869c('0xe')]=_0x471b25[_0x869c('0xe')];this[_0x869c('0xf')]=_0x471b25[_0x869c('0xf')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 905b31a..1aa5f4b 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 _0xe7dc=['apiKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x35921a,_0x1f3e85){var _0x4e3e15=function(_0xaf634e){while(--_0xaf634e){_0x35921a['push'](_0x35921a['shift']());}};_0x4e3e15(++_0x1f3e85);}(_0xe7dc,0x154));var _0xce7d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe7dc[_0x14add3];return _0x4a174f;};'use strict';function FreshdeskAccount(_0x49b301){this['id']=_0x49b301['id']||0x0;this[_0xce7d('0x0')]=_0x49b301[_0xce7d('0x0')]||'';this[_0xce7d('0x1')]=_0x49b301[_0xce7d('0x1')]||'';this[_0xce7d('0x2')]=_0x49b301['token']||'';this[_0xce7d('0x3')]=_0x49b301[_0xce7d('0x3')]||'';this[_0xce7d('0x4')]=_0x49b301[_0xce7d('0x4')]||'';this[_0xce7d('0x5')]=_0x49b301[_0xce7d('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x59c7=['username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0xdf484,_0x13d137){var _0x12bddb=function(_0x19522d){while(--_0x19522d){_0xdf484['push'](_0xdf484['shift']());}};_0x12bddb(++_0x13d137);}(_0x59c7,0x9b));var _0x759c=function(_0x14d2ad,_0x58e74c){_0x14d2ad=_0x14d2ad-0x0;var _0x5ae6b3=_0x59c7[_0x14d2ad];return _0x5ae6b3;};'use strict';function FreshdeskAccount(_0x424f31){this['id']=_0x424f31['id']||0x0;this['name']=_0x424f31['name']||'';this[_0x759c('0x0')]=_0x424f31['username']||'';this[_0x759c('0x1')]=_0x424f31['token']||'';this[_0x759c('0x2')]=_0x424f31[_0x759c('0x2')]||'';this[_0x759c('0x3')]=_0x424f31[_0x759c('0x3')]||'';this[_0x759c('0x4')]=_0x424f31[_0x759c('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 7730901..05aec77 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 _0x1c75=['serverUrl','Configurations','exports','username','apiKey','token','remoteUri'];(function(_0x284ad3,_0x9c58ee){var _0x28576c=function(_0x4a9c5c){while(--_0x4a9c5c){_0x284ad3['push'](_0x284ad3['shift']());}};_0x28576c(++_0x9c58ee);}(_0x1c75,0xce));var _0x51c7=function(_0x307101,_0x45fd0a){_0x307101=_0x307101-0x0;var _0x5d4775=_0x1c75[_0x307101];return _0x5d4775;};'use strict';function FreshsalesAccount(_0x2f5319){this['id']=_0x2f5319['id']||0x0;this['name']=_0x2f5319['name']||'';this['username']=_0x2f5319[_0x51c7('0x0')]||'';this[_0x51c7('0x1')]=_0x2f5319[_0x51c7('0x2')]||'';this[_0x51c7('0x3')]=_0x2f5319[_0x51c7('0x3')]||'';this[_0x51c7('0x4')]=_0x2f5319[_0x51c7('0x4')]||'';this[_0x51c7('0x5')]=_0x2f5319[_0x51c7('0x5')]||{};}module[_0x51c7('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x34aa=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x573681,_0x57afb8){var _0x5a3cd0=function(_0x173b05){while(--_0x173b05){_0x573681['push'](_0x573681['shift']());}};_0x5a3cd0(++_0x57afb8);}(_0x34aa,0x171));var _0xa34a=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x34aa[_0x592e40];return _0x5d4288;};'use strict';function FreshsalesAccount(_0x44376a){this['id']=_0x44376a['id']||0x0;this['name']=_0x44376a[_0xa34a('0x0')]||'';this[_0xa34a('0x1')]=_0x44376a[_0xa34a('0x1')]||'';this[_0xa34a('0x2')]=_0x44376a['token']||'';this[_0xa34a('0x3')]=_0x44376a[_0xa34a('0x3')]||'';this[_0xa34a('0x4')]=_0x44376a[_0xa34a('0x4')]||'';this[_0xa34a('0x5')]=_0x44376a[_0xa34a('0x5')]||{};}module[_0xa34a('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 8bd4da1..522d4e9 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 _0xf4ad=['queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerexit','originalposition','channel','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname'];(function(_0x4609a6,_0xd6749e){var _0xb5cc14=function(_0x5e676f){while(--_0x5e676f){_0x4609a6['push'](_0x4609a6['shift']());}};_0xb5cc14(++_0xd6749e);}(_0xf4ad,0xe1));var _0xdf4a=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0xf4ad[_0x423549];return _0xdcb104;};'use strict';function QueueReport(){this[_0xdf4a('0x0')]=_0xdf4a('0x1');this[_0xdf4a('0x2')]='';this[_0xdf4a('0x3')]='';this[_0xdf4a('0x4')]='';this['queue']='';this[_0xdf4a('0x5')]=null;this[_0xdf4a('0x6')]=null;this['position']=0x1;this[_0xdf4a('0x7')]=0x1;this[_0xdf4a('0x8')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xdf4a('0x9')]=![];this['queuecallerexitAt']=null;this[_0xdf4a('0xa')]=0x1;this[_0xdf4a('0xb')]='';this['connectedlinenum']='';this[_0xdf4a('0xc')]='';this[_0xdf4a('0xd')]='';this[_0xdf4a('0xe')]='';this[_0xdf4a('0xf')]='';this['priority']='';this[_0xdf4a('0x10')]=0x0;this[_0xdf4a('0x11')]=![];this[_0xdf4a('0x12')]='';this[_0xdf4a('0x13')]='voice';this[_0xdf4a('0x14')]=0x0;this[_0xdf4a('0x15')]={};}module[_0xdf4a('0x16')]=QueueReport; \ No newline at end of file +var _0xa348=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','holdtime','lastAssignedTo','motionChannel','voice','mohtime','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x445114,_0xd2a7cd){var _0x53b9d9=function(_0x1af7c4){while(--_0x1af7c4){_0x445114['push'](_0x445114['shift']());}};_0x53b9d9(++_0xd2a7cd);}(_0xa348,0x158));var _0x8a34=function(_0x2fd6eb,_0x557921){_0x2fd6eb=_0x2fd6eb-0x0;var _0x775c5e=_0xa348[_0x2fd6eb];return _0x775c5e;};'use strict';function QueueReport(){this['type']=_0x8a34('0x0');this['uniqueid']='';this[_0x8a34('0x1')]='';this[_0x8a34('0x2')]='';this['queue']='';this[_0x8a34('0x3')]=null;this[_0x8a34('0x4')]=null;this['position']=0x1;this[_0x8a34('0x5')]=0x1;this[_0x8a34('0x6')]=![];this[_0x8a34('0x7')]=null;this[_0x8a34('0x8')]=![];this[_0x8a34('0x9')]=null;this[_0x8a34('0xa')]=![];this[_0x8a34('0xb')]=null;this[_0x8a34('0xc')]=0x1;this[_0x8a34('0xd')]='';this['connectedlinenum']='';this[_0x8a34('0xe')]='';this['accountcode']='';this[_0x8a34('0xf')]='';this[_0x8a34('0x10')]='';this['priority']='';this[_0x8a34('0x11')]=0x0;this['assigned']=![];this[_0x8a34('0x12')]='';this[_0x8a34('0x13')]=_0x8a34('0x14');this[_0x8a34('0x15')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f24dfc6..36c4d73 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 _0x0a01=['serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x3a1522,_0x51684f){var _0x2c7785=function(_0xa99654){while(--_0xa99654){_0x3a1522['push'](_0x3a1522['shift']());}};_0x2c7785(++_0x51684f);}(_0x0a01,0x10b));var _0x10a0=function(_0x2c573c,_0x9cabdf){_0x2c573c=_0x2c573c-0x0;var _0x9f1946=_0x0a01[_0x2c573c];return _0x9f1946;};'use strict';function SalesforceAccount(_0xb7c46e){this['id']=_0xb7c46e['id']||0x0;this['name']=_0xb7c46e['name']||'';this[_0x10a0('0x0')]=_0xb7c46e['username']||'';this['remoteUri']=_0xb7c46e[_0x10a0('0x1')]||'';this['password']=_0xb7c46e[_0x10a0('0x2')]||'';this[_0x10a0('0x3')]=_0xb7c46e[_0x10a0('0x3')]||'';this[_0x10a0('0x4')]=_0xb7c46e[_0x10a0('0x4')]||'';this[_0x10a0('0x5')]=_0xb7c46e['securityToken']||'';this[_0x10a0('0x6')]=_0xb7c46e[_0x10a0('0x6')]||_0x10a0('0x7');this[_0x10a0('0x8')]=_0xb7c46e[_0x10a0('0x8')]||'';this[_0x10a0('0x9')]=_0xb7c46e['Configurations']||{};}module[_0x10a0('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x29e9=['username','remoteUri','password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x2d5b9f,_0x22586d){var _0x3e9b2b=function(_0x4b0e72){while(--_0x4b0e72){_0x2d5b9f['push'](_0x2d5b9f['shift']());}};_0x3e9b2b(++_0x22586d);}(_0x29e9,0xaf));var _0x929e=function(_0x254a51,_0x2ccd48){_0x254a51=_0x254a51-0x0;var _0x5369d6=_0x29e9[_0x254a51];return _0x5369d6;};'use strict';function SalesforceAccount(_0x1a9e3d){this['id']=_0x1a9e3d['id']||0x0;this[_0x929e('0x0')]=_0x1a9e3d['name']||'';this[_0x929e('0x1')]=_0x1a9e3d[_0x929e('0x1')]||'';this[_0x929e('0x2')]=_0x1a9e3d[_0x929e('0x2')]||'';this[_0x929e('0x3')]=_0x1a9e3d['password']||'';this[_0x929e('0x4')]=_0x1a9e3d[_0x929e('0x4')]||'';this[_0x929e('0x5')]=_0x1a9e3d[_0x929e('0x5')]||'';this['securityToken']=_0x1a9e3d['securityToken']||'';this[_0x929e('0x6')]=_0x1a9e3d[_0x929e('0x6')]||_0x929e('0x7');this[_0x929e('0x8')]=_0x1a9e3d[_0x929e('0x8')]||'';this[_0x929e('0x9')]=_0x1a9e3d[_0x929e('0x9')]||{};}module[_0x929e('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index bbd6b31..68306dd 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 _0x3074=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x50aca9,_0x44229f){var _0x5b7760=function(_0x50c472){while(--_0x50c472){_0x50aca9['push'](_0x50aca9['shift']());}};_0x5b7760(++_0x44229f);}(_0x3074,0x1a4));var _0x4307=function(_0x1d7b32,_0x5ae903){_0x1d7b32=_0x1d7b32-0x0;var _0x3d6814=_0x3074[_0x1d7b32];return _0x3d6814;};'use strict';function ServicenowAccount(_0x170499){this['id']=_0x170499['id']||0x0;this[_0x4307('0x0')]=_0x170499[_0x4307('0x0')]||'';this[_0x4307('0x1')]=_0x170499['username']||'';this[_0x4307('0x2')]=_0x170499[_0x4307('0x2')]||'';this['remoteUri']=_0x170499[_0x4307('0x3')]||'';this[_0x4307('0x4')]=_0x170499['serverUrl']||'';this['Configurations']=_0x170499[_0x4307('0x5')]||{};}module[_0x4307('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf1a9=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x159adf,_0x2f1912){var _0x27f034=function(_0x36be28){while(--_0x36be28){_0x159adf['push'](_0x159adf['shift']());}};_0x27f034(++_0x2f1912);}(_0xf1a9,0x1bd));var _0x9f1a=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xf1a9[_0x139a3c];return _0x2b375b;};'use strict';function ServicenowAccount(_0x5938aa){this['id']=_0x5938aa['id']||0x0;this[_0x9f1a('0x0')]=_0x5938aa['name']||'';this['username']=_0x5938aa[_0x9f1a('0x1')]||'';this['password']=_0x5938aa[_0x9f1a('0x2')]||'';this[_0x9f1a('0x3')]=_0x5938aa[_0x9f1a('0x3')]||'';this[_0x9f1a('0x4')]=_0x5938aa[_0x9f1a('0x4')]||'';this['Configurations']=_0x5938aa[_0x9f1a('0x5')]||{};}module[_0x9f1a('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e622e5d..34e969b 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 _0x2589=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x309fdc,_0x503516){var _0x189485=function(_0x1c534b){while(--_0x1c534b){_0x309fdc['push'](_0x309fdc['shift']());}};_0x189485(++_0x503516);}(_0x2589,0x1b9));var _0x9258=function(_0x267c34,_0x5e11d6){_0x267c34=_0x267c34-0x0;var _0x12a593=_0x2589[_0x267c34];return _0x12a593;};'use strict';function SugarcrmAccount(_0x484ee9){this['id']=_0x484ee9['id']||0x0;this['name']=_0x484ee9[_0x9258('0x0')]||'';this[_0x9258('0x1')]=_0x484ee9['username']||'';this['password']=_0x484ee9['password']||'';this[_0x9258('0x2')]=_0x484ee9['remoteUri']||'';this['serverUrl']=_0x484ee9[_0x9258('0x3')]||'';this[_0x9258('0x4')]=_0x484ee9[_0x9258('0x4')]||{};}module[_0x9258('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xed95=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x509857,_0x44484f){var _0x3e4bc2=function(_0x6d4d4b){while(--_0x6d4d4b){_0x509857['push'](_0x509857['shift']());}};_0x3e4bc2(++_0x44484f);}(_0xed95,0x1d0));var _0x5ed9=function(_0x25e507,_0x21c6ee){_0x25e507=_0x25e507-0x0;var _0x446094=_0xed95[_0x25e507];return _0x446094;};'use strict';function SugarcrmAccount(_0x95e8a8){this['id']=_0x95e8a8['id']||0x0;this[_0x5ed9('0x0')]=_0x95e8a8[_0x5ed9('0x0')]||'';this[_0x5ed9('0x1')]=_0x95e8a8['username']||'';this[_0x5ed9('0x2')]=_0x95e8a8['password']||'';this[_0x5ed9('0x3')]=_0x95e8a8['remoteUri']||'';this[_0x5ed9('0x4')]=_0x95e8a8[_0x5ed9('0x4')]||'';this[_0x5ed9('0x5')]=_0x95e8a8['Configurations']||{};}module[_0x5ed9('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 94e3284..12fb027 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 _0xbe85=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xbe85,0x19c));var _0x5be8=function(_0x3b2940,_0x4270e8){_0x3b2940=_0x3b2940-0x0;var _0x4c86d0=_0xbe85[_0x3b2940];return _0x4c86d0;};'use strict';function Telephone(_0x24a660){this['id']=_0x24a660['id']||0x0;this[_0x5be8('0x0')]=_0x24a660[_0x5be8('0x0')]||'';this['accountcode']=_0x24a660[_0x5be8('0x1')]||'';this[_0x5be8('0x2')]=_0x5be8('0x3');this[_0x5be8('0x4')]=0x0;this[_0x5be8('0x5')]=_0x5be8('0x3');this[_0x5be8('0x6')]='';}module[_0x5be8('0x7')]=Telephone; \ No newline at end of file +var _0x4d84=['unknown','status','address','name','accountcode'];(function(_0xb00570,_0x2d2ac4){var _0xf7afc9=function(_0x3343df){while(--_0x3343df){_0xb00570['push'](_0xb00570['shift']());}};_0xf7afc9(++_0x2d2ac4);}(_0x4d84,0x1c5));var _0x44d8=function(_0x42eb51,_0xafa7f2){_0x42eb51=_0x42eb51-0x0;var _0x403569=_0x4d84[_0x42eb51];return _0x403569;};'use strict';function Telephone(_0x561cd2){this['id']=_0x561cd2['id']||0x0;this['name']=_0x561cd2[_0x44d8('0x0')]||'';this[_0x44d8('0x1')]=_0x561cd2['accountcode']||'';this['state']=_0x44d8('0x2');this['stateTime']=0x0;this[_0x44d8('0x3')]=_0x44d8('0x2');this[_0x44d8('0x4')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index fc97ad5..0ef0db9 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x488022,_0x4d85b1){var _0x465dbf=function(_0x5c255d){while(--_0x5c255d){_0x488022['push'](_0x488022['shift']());}};_0x465dbf(++_0x4d85b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2b33fb,_0x3fab61){var _0x1190fe=function(_0x5ec9c3){while(--_0x5ec9c3){_0x2b33fb['push'](_0x2b33fb['shift']());}};_0x1190fe(++_0x3fab61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index beb16f4..4c9701d 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 _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x7d8213,_0x468218){var _0x254f82=function(_0x12d8d1){while(--_0x12d8d1){_0x7d8213['push'](_0x7d8213['shift']());}};_0x254f82(++_0x468218);}(_0x5f2f,0x73));var _0xf5f2=function(_0x392ad2,_0xf4c384){_0x392ad2=_0x392ad2-0x0;var _0x594d51=_0x5f2f[_0x392ad2];return _0x594d51;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('0x6')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x2d9bdd,_0x27c15b){var _0x519f7d=function(_0x42757c){while(--_0x42757c){_0x2d9bdd['push'](_0x2d9bdd['shift']());}};_0x519f7d(++_0x27c15b);}(_0x2032,0xd9));var _0x2203=function(_0x36d68e,_0x37ff1e){_0x36d68e=_0x36d68e-0x0;var _0x4533c6=_0x2032[_0x36d68e];return _0x4533c6;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 3f6d675..bd1aee5 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 _0x5fc8=['domainport','stateRegistry','registrationtime','defaultuser','exports','name','state','unknown','status','registry','indexOf','host','domain'];(function(_0x29caca,_0x4427c8){var _0x7fea99=function(_0x3733f2){while(--_0x3733f2){_0x29caca['push'](_0x29caca['shift']());}};_0x7fea99(++_0x4427c8);}(_0x5fc8,0x171));var _0x85fc=function(_0x54d7c1,_0x3e7470){_0x54d7c1=_0x54d7c1-0x0;var _0x39b67d=_0x5fc8[_0x54d7c1];return _0x39b67d;};'use strict';function Trunk(_0x2b464b){this['id']=_0x2b464b['id']||0x0;this['active']=_0x2b464b['active']||![];this[_0x85fc('0x0')]=_0x2b464b['name']||'';this[_0x85fc('0x1')]=_0x85fc('0x2');this['stateTime']=0x0;this[_0x85fc('0x3')]='unknown';this[_0x85fc('0x4')]=_0x2b464b[_0x85fc('0x4')]&&_0x2b464b['registry'][_0x85fc('0x5')](':')?_0x2b464b[_0x85fc('0x4')]['split'](':')[0x0]:'';this[_0x85fc('0x6')]='';this['port']='';this[_0x85fc('0x7')]='';this[_0x85fc('0x8')]='';this['refresh']='';this[_0x85fc('0x9')]=_0x85fc('0x2');this[_0x85fc('0xa')]='';this['address']='';this[_0x85fc('0xb')]=_0x2b464b[_0x85fc('0xb')]||'';}module[_0x85fc('0xc')]=Trunk; \ No newline at end of file +var _0x3208=['status','registry','indexOf','split','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime'];(function(_0x7e71af,_0xc1c416){var _0x3e45b6=function(_0x1bf7f1){while(--_0x1bf7f1){_0x7e71af['push'](_0x7e71af['shift']());}};_0x3e45b6(++_0xc1c416);}(_0x3208,0x175));var _0x8320=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3208[_0x167cc1];return _0x10bc4b;};'use strict';function Trunk(_0x5c5b92){this['id']=_0x5c5b92['id']||0x0;this[_0x8320('0x0')]=_0x5c5b92[_0x8320('0x0')]||![];this[_0x8320('0x1')]=_0x5c5b92[_0x8320('0x1')]||'';this[_0x8320('0x2')]=_0x8320('0x3');this[_0x8320('0x4')]=0x0;this[_0x8320('0x5')]=_0x8320('0x3');this['registry']=_0x5c5b92[_0x8320('0x6')]&&_0x5c5b92[_0x8320('0x6')][_0x8320('0x7')](':')?_0x5c5b92['registry'][_0x8320('0x8')](':')[0x0]:'';this[_0x8320('0x9')]='';this[_0x8320('0xa')]='';this[_0x8320('0xb')]='';this[_0x8320('0xc')]='';this[_0x8320('0xd')]='';this['stateRegistry']=_0x8320('0x3');this[_0x8320('0xe')]='';this[_0x8320('0xf')]='';this['defaultuser']=_0x5c5b92[_0x8320('0x10')]||'';}module[_0x8320('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b15e636..777e236 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 _0x14ce=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x14ce,0xe3));var _0xe14c=function(_0x56b64a,_0x2dc700){_0x56b64a=_0x56b64a-0x0;var _0x365ce3=_0x14ce[_0x56b64a];return _0x365ce3;};'use strict';function voiceExtension(_0x2a2579){this['id']=_0x2a2579['id']||0x0;this[_0xe14c('0x0')]=_0x2a2579[_0xe14c('0x0')]||'';this[_0xe14c('0x1')]=_0x2a2579[_0xe14c('0x1')]||_0xe14c('0x2');this[_0xe14c('0x3')]=_0x2a2579[_0xe14c('0x3')]||![];}module[_0xe14c('0x4')]=voiceExtension; \ No newline at end of file +var _0x1291=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x555e79,_0x9ee00e){var _0x36cb67=function(_0x207ec7){while(--_0x207ec7){_0x555e79['push'](_0x555e79['shift']());}};_0x36cb67(++_0x9ee00e);}(_0x1291,0x14f));var _0x1129=function(_0x2adce9,_0x40a9f5){_0x2adce9=_0x2adce9-0x0;var _0x4f1a47=_0x1291[_0x2adce9];return _0x4f1a47;};'use strict';function voiceExtension(_0x1492ac){this['id']=_0x1492ac['id']||0x0;this[_0x1129('0x0')]=_0x1492ac[_0x1129('0x0')]||'';this['recordingFormat']=_0x1492ac[_0x1129('0x1')]||_0x1129('0x2');this[_0x1129('0x3')]=_0x1492ac['mandatoryDisposition']||![];}module[_0x1129('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index aaeca40..db21e0e 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 _0x838a=['total','unmanaged','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','roundrobin','name','monitor_format','type','waiting','talking'];(function(_0x1963de,_0x340358){var _0x5aa543=function(_0x4b6eff){while(--_0x4b6eff){_0x1963de['push'](_0x1963de['shift']());}};_0x5aa543(++_0x340358);}(_0x838a,0x65));var _0xa838=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0x838a[_0x3d9557];return _0x359ff8;};'use strict';var statusDesc=['unknown','not_inuse',_0xa838('0x0'),_0xa838('0x1'),_0xa838('0x2'),_0xa838('0x3'),_0xa838('0x4'),_0xa838('0x5'),_0xa838('0x6')];var monitorFormat={'wav':_0xa838('0x7'),'wav49':_0xa838('0x8'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xa838('0x9')};function VoiceQueue(_0x330456){this['id']=_0x330456['id']||0x0;this[_0xa838('0xa')]=_0x330456[_0xa838('0xa')]||'';this[_0xa838('0xb')]=_0x330456['monitor_format']||'';this['type']=_0x330456[_0xa838('0xc')]||'inbound';this[_0xa838('0xd')]=0x0;this[_0xa838('0xe')]=0x0;this[_0xa838('0xf')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xa838('0x10')]=0x0;this['abandoned']=0x0;this[_0xa838('0x11')]=0x0;this[_0xa838('0x12')]=0x0;this['acw']=_0x330456['acw']||![];this[_0xa838('0x13')]=_0x330456[_0xa838('0x13')]||0xa;this['autopause']=_0x330456[_0xa838('0x14')]||'no';this[_0xa838('0x15')]=!![];this[_0xa838('0x16')]='';this['originated']=0x0;this[_0xa838('0x17')]=0x0;this[_0xa838('0x18')]=_0x330456[_0xa838('0x18')]||null;this['dialGlobalInterval']=_0x330456[_0xa838('0x19')]?_0x330456[_0xa838('0x19')]:null;this[_0xa838('0x1a')]=_0x330456[_0xa838('0x1a')];this[_0xa838('0x1b')]=_0x330456['dialMethod']||_0xa838('0x1c');this[_0xa838('0x1d')]=_0x330456[_0xa838('0x1d')]||0x0;this['dialLimitQueue']=_0x330456[_0xa838('0x1e')]||0x0;this[_0xa838('0x1f')]=_0x330456[_0xa838('0x1f')]||0x1;this[_0xa838('0x20')]=_0x330456[_0xa838('0x20')]||_0xa838('0x21');this[_0xa838('0x22')]=_0x330456[_0xa838('0x22')]||0.03;this[_0xa838('0x23')]=_0x330456[_0xa838('0x23')]||0x258;this[_0xa838('0x24')]=_0x330456['dialOriginateCallerIdName']||_0xa838('0x25');this[_0xa838('0x26')]=_0x330456[_0xa838('0x26')]||'anonymous';this['dialOriginateTimeout']=_0x330456[_0xa838('0x27')]||0x1e;this[_0xa838('0x28')]=_0x330456[_0xa838('0x28')]||_0xa838('0x29');this['dialQueueTimeout']=_0x330456['dialQueueTimeout']||0x3;this[_0xa838('0x2a')]=_0x330456['dialQueueProject']||undefined;this[_0xa838('0x2b')]=_0x330456[_0xa838('0x2b')]||0x3;this[_0xa838('0x2c')]=_0x330456[_0xa838('0x2c')]||0x96;this['dialBusyMaxRetry']=_0x330456[_0xa838('0x2d')]||0x3;this[_0xa838('0x2e')]=_0x330456[_0xa838('0x2e')]||0x96;this[_0xa838('0x2f')]=_0x330456[_0xa838('0x2f')]||0x3;this[_0xa838('0x30')]=_0x330456[_0xa838('0x30')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x330456['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x330456['dialNoSuchNumberRetryFrequency']||0x96;this[_0xa838('0x31')]=_0x330456[_0xa838('0x31')]||0x3;this['dialDropRetryFrequency']=_0x330456[_0xa838('0x32')]||0x96;this[_0xa838('0x33')]=_0x330456['dialAbandonedMaxRetry']||0x3;this[_0xa838('0x34')]=_0x330456['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x330456[_0xa838('0x35')]||0x3;this[_0xa838('0x36')]=_0x330456[_0xa838('0x36')]||0x96;this[_0xa838('0x37')]=_0x330456[_0xa838('0x37')]||0x3;this[_0xa838('0x38')]=_0x330456[_0xa838('0x38')]||0x96;this[_0xa838('0x39')]=_0x330456[_0xa838('0x39')]||0x4;this['Trunk']=_0x330456[_0xa838('0x3a')]?_0x330456[_0xa838('0x3a')]:undefined;this[_0xa838('0x3b')]=_0x330456[_0xa838('0x3b')]?_0x330456['TrunkBackup']:undefined;this[_0xa838('0x3c')]=_0x330456[_0xa838('0x3c')]||undefined;this[_0xa838('0x3d')]=_0x330456['Interval']?_0x330456[_0xa838('0x3d')]:undefined;this[_0xa838('0x3e')]=_0x330456[_0xa838('0x3e')]||_0xa838('0x3f');this['dialRandomLastDigitCallerIdNumber']=_0x330456[_0xa838('0x40')]||undefined;this[_0xa838('0x41')]=_0x330456[_0xa838('0x41')]||undefined;this['strategy']=strategy[_0x330456[_0xa838('0x42')]]||_0xa838('0x43');this[_0xa838('0x44')]=!![];this[_0xa838('0x45')]=_0x330456[_0xa838('0x45')]||![];this[_0xa838('0x46')]=_0x330456[_0xa838('0x46')];this[_0xa838('0x47')]=_0x330456[_0xa838('0x47')];this['dialAMDAfterGreetingSilence']=_0x330456[_0xa838('0x48')];this[_0xa838('0x49')]=_0x330456[_0xa838('0x49')];this[_0xa838('0x4a')]=_0x330456['dialAMDMinWordLength'];this[_0xa838('0x4b')]=_0x330456[_0xa838('0x4b')];this[_0xa838('0x4c')]=_0x330456[_0xa838('0x4c')];this[_0xa838('0x4d')]=_0x330456[_0xa838('0x4d')];this['dialAMDMaximumWordLength']=_0x330456['dialAMDMaximumWordLength'];this[_0xa838('0x4e')]=0x0;this['pTalking']=0x0;this[_0xa838('0x4f')]=_0x330456[_0xa838('0x4f')];this[_0xa838('0x50')]=0x0;this[_0xa838('0x51')]=0x0;this[_0xa838('0x52')]=0x0;this[_0xa838('0x53')]=0x0;this[_0xa838('0x54')]=0x0;this[_0xa838('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xa838('0x56')]=0x0;this[_0xa838('0x57')]=0x0;this[_0xa838('0x58')]=0x0;this[_0xa838('0x59')]=0x0;this[_0xa838('0x5a')]=0x0;this[_0xa838('0x5b')]=undefined;this[_0xa838('0x5c')]=undefined;this['handlePredictive']=undefined;this[_0xa838('0x5d')]=1.05;this[_0xa838('0x5e')]=0x0;this[_0xa838('0x5f')]=0x0;this[_0xa838('0x60')]=0x0;this[_0xa838('0x61')]=0x0;this[_0xa838('0x62')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0xa838('0x63')]=0x0;this[_0xa838('0x64')]=_0x330456[_0xa838('0x65')]||0x14;this[_0xa838('0x66')]=_0x330456[_0xa838('0x65')]||0xa;this[_0xa838('0x67')]=0x0;this[_0xa838('0x68')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xa838('0x69')]=0x0;this[_0xa838('0x6a')]=0x0;this[_0xa838('0x6b')]=0x0;this[_0xa838('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x330456[_0xa838('0x6d')]||0x1e;this[_0xa838('0x6e')]=_0x330456['dialRecallInQueue']||![];this[_0xa838('0x6f')]=_0x330456[_0xa838('0x6f')]||undefined;this['dialAgiAfterHangupClient']=_0x330456['dialAgiAfterHangupClient']||![];this[_0xa838('0x70')]=_0x330456[_0xa838('0x70')]||![];this[_0xa838('0xb')]=monitorFormat[_0x330456[_0xa838('0xb')]]?monitorFormat[_0x330456[_0xa838('0xb')]]:undefined;this[_0xa838('0x71')]=_0x330456[_0xa838('0x71')]||![];this['mandatoryDispositionPause']=_0x330456[_0xa838('0x72')]?_0x330456[_0xa838('0x72')]:undefined;}module[_0xa838('0x73')]=VoiceQueue; \ No newline at end of file +var _0x2687=['dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringinuse','onhold','wav','rrmemory','name','monitor_format','type','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x1a13e5,_0x4aa36b){var _0xab260b=function(_0x1c76dd){while(--_0x1c76dd){_0x1a13e5['push'](_0x1a13e5['shift']());}};_0xab260b(++_0x4aa36b);}(_0x2687,0x143));var _0x7268=function(_0x192772,_0x100b16){_0x192772=_0x192772-0x0;var _0x2b50bd=_0x2687[_0x192772];return _0x2b50bd;};'use strict';var statusDesc=[_0x7268('0x0'),_0x7268('0x1'),_0x7268('0x2'),_0x7268('0x3'),_0x7268('0x4'),'unavailable','ringing',_0x7268('0x5'),_0x7268('0x6')];var monitorFormat={'wav':_0x7268('0x7'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x7268('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2e8097){this['id']=_0x2e8097['id']||0x0;this['name']=_0x2e8097[_0x7268('0x9')]||'';this[_0x7268('0xa')]=_0x2e8097[_0x7268('0xa')]||'';this[_0x7268('0xb')]=_0x2e8097['type']||'inbound';this[_0x7268('0xc')]=0x0;this[_0x7268('0xd')]=0x0;this[_0x7268('0xe')]=0x0;this['answered']=0x0;this[_0x7268('0xf')]=0x0;this[_0x7268('0x10')]=0x0;this[_0x7268('0x11')]=0x0;this[_0x7268('0x12')]=0x0;this[_0x7268('0x13')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x7268('0x14')]=_0x2e8097['acw']||![];this[_0x7268('0x15')]=_0x2e8097['acwTimeout']||0xa;this[_0x7268('0x16')]=_0x2e8097['autopause']||'no';this[_0x7268('0x17')]=!![];this['message']='';this[_0x7268('0x18')]=0x0;this[_0x7268('0x19')]=0x0;this[_0x7268('0x1a')]=_0x2e8097[_0x7268('0x1a')]||null;this[_0x7268('0x1b')]=_0x2e8097['dialGlobalInterval']?_0x2e8097[_0x7268('0x1b')]:null;this[_0x7268('0x1c')]=_0x2e8097[_0x7268('0x1c')];this[_0x7268('0x1d')]=_0x2e8097[_0x7268('0x1d')]||_0x7268('0x1e');this['dialLimitChannel']=_0x2e8097[_0x7268('0x1f')]||0x0;this['dialLimitQueue']=_0x2e8097[_0x7268('0x20')]||0x0;this['dialPowerLevel']=_0x2e8097[_0x7268('0x21')]||0x1;this['dialPredictiveOptimization']=_0x2e8097['dialPredictiveOptimization']||_0x7268('0x22');this[_0x7268('0x23')]=_0x2e8097['dialPredictiveOptimizationPercentage']||0.03;this[_0x7268('0x24')]=_0x2e8097[_0x7268('0x24')]||0x258;this[_0x7268('0x25')]=_0x2e8097[_0x7268('0x25')]||_0x7268('0x26');this[_0x7268('0x27')]=_0x2e8097[_0x7268('0x27')]||_0x7268('0x26');this[_0x7268('0x28')]=_0x2e8097[_0x7268('0x28')]||0x1e;this[_0x7268('0x29')]=_0x2e8097[_0x7268('0x29')]||_0x7268('0x2a');this[_0x7268('0x2b')]=_0x2e8097['dialQueueTimeout']||0x3;this[_0x7268('0x2c')]=_0x2e8097[_0x7268('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x2e8097[_0x7268('0x2d')]||0x3;this[_0x7268('0x2e')]=_0x2e8097[_0x7268('0x2e')]||0x96;this[_0x7268('0x2f')]=_0x2e8097[_0x7268('0x2f')]||0x3;this[_0x7268('0x30')]=_0x2e8097[_0x7268('0x30')]||0x96;this[_0x7268('0x31')]=_0x2e8097[_0x7268('0x31')]||0x3;this[_0x7268('0x32')]=_0x2e8097['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x2e8097[_0x7268('0x33')]||0x3;this[_0x7268('0x34')]=_0x2e8097[_0x7268('0x34')]||0x96;this[_0x7268('0x35')]=_0x2e8097['dialDropMaxRetry']||0x3;this[_0x7268('0x36')]=_0x2e8097[_0x7268('0x36')]||0x96;this['dialAbandonedMaxRetry']=_0x2e8097['dialAbandonedMaxRetry']||0x3;this[_0x7268('0x37')]=_0x2e8097[_0x7268('0x37')]||0x96;this[_0x7268('0x38')]=_0x2e8097[_0x7268('0x38')]||0x3;this[_0x7268('0x39')]=_0x2e8097['dialMachineRetryFrequency']||0x96;this[_0x7268('0x3a')]=_0x2e8097[_0x7268('0x3a')]||0x3;this[_0x7268('0x3b')]=_0x2e8097[_0x7268('0x3b')]||0x96;this[_0x7268('0x3c')]=_0x2e8097['dialGlobalMaxRetry']||0x4;this[_0x7268('0x3d')]=_0x2e8097[_0x7268('0x3d')]?_0x2e8097['Trunk']:undefined;this['TrunkBackup']=_0x2e8097[_0x7268('0x3e')]?_0x2e8097[_0x7268('0x3e')]:undefined;this['dialPrefix']=_0x2e8097[_0x7268('0x3f')]||undefined;this[_0x7268('0x40')]=_0x2e8097['Interval']?_0x2e8097[_0x7268('0x40')]:undefined;this[_0x7268('0x41')]=_0x2e8097['dialOrderByScheduledAt']||_0x7268('0x42');this['dialRandomLastDigitCallerIdNumber']=_0x2e8097[_0x7268('0x43')]||undefined;this[_0x7268('0x44')]=_0x2e8097[_0x7268('0x44')]||undefined;this[_0x7268('0x45')]=strategy[_0x2e8097[_0x7268('0x45')]]||_0x7268('0x8');this[_0x7268('0x46')]=!![];this[_0x7268('0x47')]=_0x2e8097[_0x7268('0x47')]||![];this[_0x7268('0x48')]=_0x2e8097[_0x7268('0x48')];this[_0x7268('0x49')]=_0x2e8097[_0x7268('0x49')];this[_0x7268('0x4a')]=_0x2e8097[_0x7268('0x4a')];this[_0x7268('0x4b')]=_0x2e8097['dialAMDTotalAnalysisTime'];this[_0x7268('0x4c')]=_0x2e8097[_0x7268('0x4c')];this[_0x7268('0x4d')]=_0x2e8097[_0x7268('0x4d')];this[_0x7268('0x4e')]=_0x2e8097[_0x7268('0x4e')];this[_0x7268('0x4f')]=_0x2e8097[_0x7268('0x4f')];this['dialAMDMaximumWordLength']=_0x2e8097[_0x7268('0x50')];this[_0x7268('0x51')]=0x0;this[_0x7268('0x52')]=0x0;this[_0x7268('0x53')]=_0x2e8097[_0x7268('0x53')];this[_0x7268('0x54')]=0x0;this[_0x7268('0x55')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x7268('0x56')]=0x0;this[_0x7268('0x57')]=0x0;this[_0x7268('0x58')]=0x0;this[_0x7268('0x59')]=0x0;this[_0x7268('0x5a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x7268('0x5b')]=0x0;this[_0x7268('0x5c')]=0x0;this[_0x7268('0x5d')]=0x0;this[_0x7268('0x5e')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x7268('0x5f')]=undefined;this[_0x7268('0x60')]=undefined;this[_0x7268('0x61')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x7268('0x62')]=0x0;this[_0x7268('0x63')]=0x0;this[_0x7268('0x64')]=0x0;this[_0x7268('0x65')]=0x0;this[_0x7268('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x7268('0x67')]=0x0;this[_0x7268('0x68')]=_0x2e8097['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x7268('0x69')]=_0x2e8097['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x7268('0x6a')]=0x0;this[_0x7268('0x6b')]=0x0;this[_0x7268('0x6c')]=0x1;this[_0x7268('0x6d')]=0x0;this[_0x7268('0x6e')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x7268('0x6f')]=0x0;this[_0x7268('0x70')]=_0x2e8097[_0x7268('0x70')]||0x1e;this[_0x7268('0x71')]=_0x2e8097[_0x7268('0x71')]||![];this[_0x7268('0x72')]=_0x2e8097[_0x7268('0x72')]||undefined;this[_0x7268('0x73')]=_0x2e8097[_0x7268('0x73')]||![];this[_0x7268('0x74')]=_0x2e8097[_0x7268('0x74')]||![];this[_0x7268('0xa')]=monitorFormat[_0x2e8097[_0x7268('0xa')]]?monitorFormat[_0x2e8097['monitor_format']]:undefined;this[_0x7268('0x75')]=_0x2e8097[_0x7268('0x75')]||![];this[_0x7268('0x76')]=_0x2e8097[_0x7268('0x76')]?_0x2e8097[_0x7268('0x76')]:undefined;}module[_0x7268('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 53079ba..8309f30 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 _0x25bb=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x478fbb,_0xb461f0){var _0x44358a=function(_0x32f070){while(--_0x32f070){_0x478fbb['push'](_0x478fbb['shift']());}};_0x44358a(++_0xb461f0);}(_0x25bb,0xba));var _0xb25b=function(_0x5b4123,_0x580b35){_0x5b4123=_0x5b4123-0x0;var _0x3ead42=_0x25bb[_0x5b4123];return _0x3ead42;};'use strict';function VtigerAccount(_0x343428){this['id']=_0x343428['id']||0x0;this['name']=_0x343428[_0xb25b('0x0')]||'';this[_0xb25b('0x1')]=_0x343428[_0xb25b('0x1')]||'';this[_0xb25b('0x2')]=_0x343428[_0xb25b('0x2')]||'';this['remoteUri']=_0x343428[_0xb25b('0x3')]||'';this[_0xb25b('0x4')]=_0x343428[_0xb25b('0x4')]||'';this[_0xb25b('0x5')]=_0x343428[_0xb25b('0x5')]||{};}module[_0xb25b('0x6')]=VtigerAccount; \ No newline at end of file +var _0xe271=['accessKey','remoteUri','Configurations','name','username'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xe271,0x139));var _0x1e27=function(_0x575737,_0x6833d){_0x575737=_0x575737-0x0;var _0x2e8c13=_0xe271[_0x575737];return _0x2e8c13;};'use strict';function VtigerAccount(_0x32874e){this['id']=_0x32874e['id']||0x0;this[_0x1e27('0x0')]=_0x32874e[_0x1e27('0x0')]||'';this[_0x1e27('0x1')]=_0x32874e[_0x1e27('0x1')]||'';this['accessKey']=_0x32874e[_0x1e27('0x2')]||'';this[_0x1e27('0x3')]=_0x32874e[_0x1e27('0x3')]||'';this['serverUrl']=_0x32874e['serverUrl']||'';this['Configurations']=_0x32874e[_0x1e27('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7bc7f0a..46b51f5 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 _0x0bf7=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x8f8efc,_0x69040a){var _0x4b52d0=function(_0x500440){while(--_0x500440){_0x8f8efc['push'](_0x8f8efc['shift']());}};_0x4b52d0(++_0x69040a);}(_0x0bf7,0xe1));var _0x70bf=function(_0x8dfb6d,_0x2aaf39){_0x8dfb6d=_0x8dfb6d-0x0;var _0x11836f=_0x0bf7[_0x8dfb6d];return _0x11836f;};'use strict';function ZendeskAccount(_0x299d17){this['id']=_0x299d17['id']||0x0;this[_0x70bf('0x0')]=_0x299d17[_0x70bf('0x0')]||'';this[_0x70bf('0x1')]=_0x299d17[_0x70bf('0x1')]||'';this[_0x70bf('0x2')]=_0x299d17[_0x70bf('0x2')]||'';this[_0x70bf('0x3')]=_0x299d17['token']||'';this[_0x70bf('0x4')]=_0x299d17[_0x70bf('0x4')]||'';this[_0x70bf('0x5')]=_0x299d17['authType']||'';this[_0x70bf('0x6')]=_0x299d17[_0x70bf('0x6')]||_0x70bf('0x7');this[_0x70bf('0x8')]=_0x299d17['serverUrl']||'';this[_0x70bf('0x9')]=_0x299d17['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xb9d0=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0xb9d0,0x17b));var _0x0b9d=function(_0x61231e,_0x401e17){_0x61231e=_0x61231e-0x0;var _0x59159c=_0xb9d0[_0x61231e];return _0x59159c;};'use strict';function ZendeskAccount(_0x4204a0){this['id']=_0x4204a0['id']||0x0;this[_0x0b9d('0x0')]=_0x4204a0[_0x0b9d('0x0')]||'';this[_0x0b9d('0x1')]=_0x4204a0[_0x0b9d('0x1')]||'';this[_0x0b9d('0x2')]=_0x4204a0[_0x0b9d('0x2')]||'';this[_0x0b9d('0x3')]=_0x4204a0['token']||'';this['remoteUri']=_0x4204a0[_0x0b9d('0x4')]||'';this[_0x0b9d('0x5')]=_0x4204a0[_0x0b9d('0x5')]||'';this[_0x0b9d('0x6')]=_0x4204a0['type']||_0x0b9d('0x7');this['serverUrl']=_0x4204a0[_0x0b9d('0x8')]||'';this[_0x0b9d('0x9')]=_0x4204a0[_0x0b9d('0x9')]||{};}module[_0x0b9d('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 5ad87e2..7dc87b1 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 _0xa001=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x4a0b68,_0x27200b){var _0x44ddd4=function(_0x184770){while(--_0x184770){_0x4a0b68['push'](_0x4a0b68['shift']());}};_0x44ddd4(++_0x27200b);}(_0xa001,0xd9));var _0x1a00=function(_0x435a56,_0x475237){_0x435a56=_0x435a56-0x0;var _0x2ce99a=_0xa001[_0x435a56];return _0x2ce99a;};'use strict';function ZohoAccount(_0x5eca95){this['id']=_0x5eca95['id']||0x0;this[_0x1a00('0x0')]=_0x5eca95[_0x1a00('0x0')]||'';this[_0x1a00('0x1')]=_0x5eca95[_0x1a00('0x1')]||'';this[_0x1a00('0x2')]=_0x5eca95[_0x1a00('0x2')]||'';this['zone']=_0x5eca95['zone']||'';this[_0x1a00('0x3')]=_0x5eca95[_0x1a00('0x3')]||'';this[_0x1a00('0x4')]=_0x5eca95['clientSecret']||'';this[_0x1a00('0x5')]=_0x5eca95[_0x1a00('0x5')]||'';this[_0x1a00('0x6')]=_0x5eca95[_0x1a00('0x6')]||'';this['refreshToken']=_0x5eca95[_0x1a00('0x7')]||'';this[_0x1a00('0x8')]=_0x5eca95[_0x1a00('0x8')]||{};}module[_0x1a00('0x9')]=ZohoAccount; \ No newline at end of file +var _0x4ece=['zone','clientId','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x4b212f,_0x3000e9){var _0x3724e6=function(_0x3e455a){while(--_0x3e455a){_0x4b212f['push'](_0x4b212f['shift']());}};_0x3724e6(++_0x3000e9);}(_0x4ece,0xb1));var _0xe4ec=function(_0x43dd26,_0x2a34c){_0x43dd26=_0x43dd26-0x0;var _0x2acf34=_0x4ece[_0x43dd26];return _0x2acf34;};'use strict';function ZohoAccount(_0x26563a){this['id']=_0x26563a['id']||0x0;this['name']=_0x26563a[_0xe4ec('0x0')]||'';this[_0xe4ec('0x1')]=_0x26563a[_0xe4ec('0x1')]||'';this['host']=_0x26563a[_0xe4ec('0x2')]||'';this['zone']=_0x26563a[_0xe4ec('0x3')]||'';this[_0xe4ec('0x4')]=_0x26563a['clientId']||'';this['clientSecret']=_0x26563a['clientSecret']||'';this[_0xe4ec('0x5')]=_0x26563a[_0xe4ec('0x5')]||'';this[_0xe4ec('0x6')]=_0x26563a[_0xe4ec('0x6')]||'';this[_0xe4ec('0x7')]=_0x26563a[_0xe4ec('0x7')]||'';this[_0xe4ec('0x8')]=_0x26563a[_0xe4ec('0x8')]||{};}module[_0xe4ec('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6ed8fc1..15cf350 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 _0x48f7=['name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','calleridname','number','moment','isNil','string','uniqueid','idContact','queue'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x48f7,0x127));var _0x748f=function(_0xccdf50,_0x5d38df){_0xccdf50=_0xccdf50-0x0;var _0x4932cc=_0x48f7[_0xccdf50];return _0x4932cc;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x748f('0x0'));function checkNameSurname(_0xa9ecad,_0x47aeb7,_0x3c3489){var _0x2b7bdc='';if(!_[_0x748f('0x1')](_0x47aeb7)&&_0x748f('0x2')===typeof _0x47aeb7){_0x2b7bdc+=_0x47aeb7;}if(!_['isNil'](_0x3c3489)&&_0x748f('0x2')===typeof _0x3c3489){_0x2b7bdc+='\x20'+_0x3c3489;}if(_0x2b7bdc!==''){return _0x2b7bdc;}return _0xa9ecad;}function Action(_0x37c9b0,_0x2cc31a,_0x45b999,_0x11aa7d,_0xe2a67a){this[_0x748f('0x3')]=_0x45b999||undefined;this[_0x748f('0x4')]=_0x37c9b0['id'];this[_0x748f('0x5')]=_0x2cc31a[_0x748f('0x6')];this[_0x748f('0x7')]=_0x2cc31a['type'];this[_0x748f('0x8')]=_0x748f('0x5');this[_0x748f('0x9')]=![];this['membername']=_[_0x748f('0x1')](_0x37c9b0[_0x748f('0xa')])?undefined:_0x37c9b0['Agent']['name'];this[_0x748f('0xb')]=this[_0x748f('0xc')]?util[_0x748f('0xd')]('SIP/%s',this['membername']):_0x11aa7d||undefined;this['calleridname']=checkNameSurname(_0x37c9b0[_0x748f('0xe')]['phone'],_0x37c9b0[_0x748f('0xe')][_0x748f('0xf')],_0x37c9b0[_0x748f('0xe')][_0x748f('0x10')]);this['active']=_0x37c9b0[_0x748f('0x11')]||![];this[_0x748f('0x12')]=_0x37c9b0[_0x748f('0xe')][_0x748f('0x13')];this[_0x748f('0x14')]=_0x37c9b0[_0x748f('0x14')];this[_0x748f('0x15')]=_0x37c9b0[_0x748f('0x15')]||0x0;this[_0x748f('0x16')]=_0x37c9b0[_0x748f('0x16')]||0x0;this[_0x748f('0x17')]=_0x37c9b0[_0x748f('0x17')]||0x0;this[_0x748f('0x18')]=(_0x37c9b0[_0x748f('0x15')]||0x0)+(_0x37c9b0['countcongestionretry']||0x0)+(_0x37c9b0[_0x748f('0x17')]||0x0)+(_0x37c9b0['countnosuchnumberretry']||0x0)+(_0x37c9b0[_0x748f('0x19')]||0x0)+(_0x37c9b0[_0x748f('0x1a')]||0x0)+(_0x37c9b0[_0x748f('0x1b')]||0x0)+(_0x37c9b0['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x37c9b0[_0x748f('0x1c')]||0x0;this['countdropretry']=_0x37c9b0[_0x748f('0x19')]||0x0;this[_0x748f('0x1a')]=_0x37c9b0[_0x748f('0x1a')]||0x0;this[_0x748f('0x1b')]=_0x37c9b0[_0x748f('0x1b')]||0x0;this[_0x748f('0x1d')]=_0x37c9b0[_0x748f('0x1d')]||0x0;this[_0x748f('0x1e')]=_0x37c9b0[_0x748f('0x1e')];this[_0x748f('0x1f')]=_0x37c9b0[_0x748f('0x1f')];this[_0x748f('0x20')]=_0x37c9b0['callbackat'];this['recallme']=_0x37c9b0[_0x748f('0x21')];this[_0x748f('0x22')]=_0x37c9b0[_0x748f('0x22')];this[_0x748f('0x23')]=_0x37c9b0['ListId'];this[_0x748f('0x24')]=_[_0x748f('0x1')](_0x37c9b0[_0x748f('0xa')])?_0x37c9b0[_0x748f('0x24')]:_0x37c9b0[_0x748f('0xa')]['id'];this['VoiceQueueId']=_0x37c9b0[_0x748f('0x25')];this['originatecalleridnum']='';this[_0x748f('0x26')]='';}Action[_0x748f('0x27')][_0x748f('0x28')]=function(){return util[_0x748f('0xd')]('\x22%s\x22\x20<%s>',this[_0x748f('0x29')],this[_0x748f('0x2a')]);};module['exports']=Action; \ No newline at end of file +var _0x5a7e=['name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','isNil','uniqueid','idContact','queue'];(function(_0x237562,_0x4f0cb4){var _0x3f5f18=function(_0x3401bd){while(--_0x3401bd){_0x237562['push'](_0x237562['shift']());}};_0x3f5f18(++_0x4f0cb4);}(_0x5a7e,0x100));var _0xe5a7=function(_0x4a9bfb,_0x182f75){_0x4a9bfb=_0x4a9bfb-0x0;var _0xd6b07=_0x5a7e[_0x4a9bfb];return _0xd6b07;};'use strict';var util=require(_0xe5a7('0x0'));var _=require(_0xe5a7('0x1'));var moment=require(_0xe5a7('0x2'));function checkNameSurname(_0x44710b,_0x1c059a,_0x281ba3){var _0x4f0a0f='';if(!_['isNil'](_0x1c059a)&&_0xe5a7('0x3')===typeof _0x1c059a){_0x4f0a0f+=_0x1c059a;}if(!_[_0xe5a7('0x4')](_0x281ba3)&&'string'===typeof _0x281ba3){_0x4f0a0f+='\x20'+_0x281ba3;}if(_0x4f0a0f!==''){return _0x4f0a0f;}return _0x44710b;}function Action(_0xc0ca97,_0x26ff36,_0x225c31,_0x347689,_0x28ad64){this[_0xe5a7('0x5')]=_0x225c31||undefined;this[_0xe5a7('0x6')]=_0xc0ca97['id'];this[_0xe5a7('0x7')]=_0x26ff36[_0xe5a7('0x8')];this[_0xe5a7('0x9')]=_0x26ff36['type'];this[_0xe5a7('0xa')]=_0xe5a7('0x7');this['dialAnswer']=![];this[_0xe5a7('0xb')]=_['isNil'](_0xc0ca97['Agent'])?undefined:_0xc0ca97[_0xe5a7('0xc')][_0xe5a7('0x8')];this[_0xe5a7('0xd')]=this[_0xe5a7('0xb')]?util[_0xe5a7('0xe')](_0xe5a7('0xf'),this['membername']):_0x347689||undefined;this[_0xe5a7('0x10')]=checkNameSurname(_0xc0ca97[_0xe5a7('0x11')][_0xe5a7('0x12')],_0xc0ca97[_0xe5a7('0x11')]['firstName'],_0xc0ca97[_0xe5a7('0x11')][_0xe5a7('0x13')]);this['active']=_0xc0ca97[_0xe5a7('0x14')]||![];this[_0xe5a7('0x15')]=_0xc0ca97['Contact'][_0xe5a7('0x12')];this[_0xe5a7('0x16')]=_0xc0ca97[_0xe5a7('0x16')];this[_0xe5a7('0x17')]=_0xc0ca97[_0xe5a7('0x17')]||0x0;this[_0xe5a7('0x18')]=_0xc0ca97[_0xe5a7('0x18')]||0x0;this[_0xe5a7('0x19')]=_0xc0ca97[_0xe5a7('0x19')]||0x0;this[_0xe5a7('0x1a')]=(_0xc0ca97[_0xe5a7('0x17')]||0x0)+(_0xc0ca97[_0xe5a7('0x18')]||0x0)+(_0xc0ca97['countnoanswerretry']||0x0)+(_0xc0ca97[_0xe5a7('0x1b')]||0x0)+(_0xc0ca97[_0xe5a7('0x1c')]||0x0)+(_0xc0ca97[_0xe5a7('0x1d')]||0x0)+(_0xc0ca97[_0xe5a7('0x1e')]||0x0)+(_0xc0ca97[_0xe5a7('0x1f')]||0x0);this['countnosuchnumberretry']=_0xc0ca97[_0xe5a7('0x1b')]||0x0;this['countdropretry']=_0xc0ca97[_0xe5a7('0x1c')]||0x0;this[_0xe5a7('0x1d')]=_0xc0ca97[_0xe5a7('0x1d')]||0x0;this[_0xe5a7('0x1e')]=_0xc0ca97[_0xe5a7('0x1e')]||0x0;this['countagentrejectretry']=_0xc0ca97[_0xe5a7('0x1f')]||0x0;this[_0xe5a7('0x20')]=_0xc0ca97[_0xe5a7('0x20')];this[_0xe5a7('0x21')]=_0xc0ca97['callbackuniqueid'];this[_0xe5a7('0x22')]=_0xc0ca97[_0xe5a7('0x22')];this['recallme']=_0xc0ca97['recallme'];this[_0xe5a7('0x23')]=_0xc0ca97[_0xe5a7('0x23')];this[_0xe5a7('0x24')]=_0xc0ca97['ListId'];this[_0xe5a7('0x25')]=_[_0xe5a7('0x4')](_0xc0ca97['Agent'])?_0xc0ca97['UserId']:_0xc0ca97[_0xe5a7('0xc')]['id'];this[_0xe5a7('0x26')]=_0xc0ca97[_0xe5a7('0x26')];this[_0xe5a7('0x27')]='';this['originatecalleridname']='';}Action[_0xe5a7('0x28')][_0xe5a7('0x29')]=function(){return util['format'](_0xe5a7('0x2a'),this[_0xe5a7('0x10')],this[_0xe5a7('0x2b')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 2d61af5..c0a352a 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 _0xf7ee=['complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','activeContact','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','loggerError','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','object','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','run','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','toLowerVariables','variablesAction','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','isUndefined','transfer','unlockContact','idContact','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','prototype','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','outbound','name','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','recallMe','clearZombieChannel','enqueue','Queue','queue','originated:\x20','dialAnswer','pick','contactId','VoiceQueueId','Action','status','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','[RecallMe]','catch','logger2','disableContact','starttime','outboundReCallsDay','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','loggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','buildObj','nosuchnumber','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','YYYY-MM-DD\x20HH:mm:ss','answertime','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw'];(function(_0x47ad83,_0x585e31){var _0x336dd0=function(_0x458c5e){while(--_0x458c5e){_0x47ad83['push'](_0x47ad83['shift']());}};_0x336dd0(++_0x585e31);}(_0xf7ee,0xa3));var _0xef7e=function(_0x4da462,_0x2aac46){_0x4da462=_0x4da462-0x0;var _0x2a001a=_0xf7ee[_0x4da462];return _0x2a001a;};'use strict';var util=require(_0xef7e('0x0'));var _=require(_0xef7e('0x1'));var BPromise=require(_0xef7e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0xef7e('0x3'));var logger=require(_0xef7e('0x4'))(_0xef7e('0x5'));var loggerAction=require('../../../config/logger')(_0xef7e('0x6'));var ami=require(_0xef7e('0x7'));var rpcDb=require(_0xef7e('0x8'));var Action=require(_0xef7e('0x9'));var ut=require(_0xef7e('0xa'));config[_0xef7e('0xb')]=_[_0xef7e('0xc')](config[_0xef7e('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xef7e('0xd'))(new Redis(config[_0xef7e('0xb')]));var Sequence=function(){};Sequence[_0xef7e('0xe')]['enqueue']=function(_0x3a6a74){this[_0xef7e('0xf')]=this[_0xef7e('0xf')]?this['tail']['finally'](_0x3a6a74):_0x3a6a74();};function Preview(_0x2e10d3){this[_0xef7e('0x10')]=new Sequence();this[_0xef7e('0x11')]=_0x2e10d3['voiceQueues'];this[_0xef7e('0x12')]=_0x2e10d3[_0xef7e('0x12')];this[_0xef7e('0x13')]={};this[_0xef7e('0x14')]=_0x2e10d3[_0xef7e('0x14')];this[_0xef7e('0x15')]=0x0;ami['on'](_0xef7e('0x16'),this[_0xef7e('0x17')][_0xef7e('0x18')](this));ami['on']('hangup',this['syncHangup'][_0xef7e('0x18')](this));ami['on']('hanguprequest',this[_0xef7e('0x19')][_0xef7e('0x18')](this));ami['on'](_0xef7e('0x1a'),this['syncDialEnd'][_0xef7e('0x18')](this));ami['on'](_0xef7e('0x1b'),this[_0xef7e('0x1c')][_0xef7e('0x18')](this));ami['on'](_0xef7e('0x1d'),this[_0xef7e('0x1e')][_0xef7e('0x18')](this));ami['on'](_0xef7e('0x1f'),this[_0xef7e('0x20')][_0xef7e('0x18')](this));ami['on']('blindtransfer',this[_0xef7e('0x21')][_0xef7e('0x18')](this));this['loopCampaigns'](this[_0xef7e('0x11')]);}function emit(_0x4b24bd,_0x2417e8,_0x4205f8){io['to'](_0x4b24bd)[_0xef7e('0x22')](_0x2417e8,_0x4205f8);}function emitCampaignPreview(_0x390603){if(_0x390603['type']===_0xef7e('0x23')){var _0x29d91d={'id':_0x390603['id'],'name':_0x390603[_0xef7e('0x24')],'strategy':_0x390603[_0xef7e('0x25')],'answered':_0x390603[_0xef7e('0x26')],'available':_0x390603[_0xef7e('0x27')],'loggedIn':_0x390603['loggedIn'],'pTalking':_0x390603[_0xef7e('0x28')],'sumBillable':_0x390603[_0xef7e('0x29')],'sumDuration':_0x390603[_0xef7e('0x2a')],'sumHoldTime':_0x390603[_0xef7e('0x2b')]||0x0,'talking':_0x390603[_0xef7e('0x2c')],'total':_0x390603[_0xef7e('0x2d')],'type':_0x390603['type'],'unmanaged':_0x390603['unmanaged'],'abandoned':_0x390603[_0xef7e('0x2e')],'waiting':_0x390603['waiting'],'loggedInDb':_0x390603[_0xef7e('0x2f')],'dialActive':_0x390603[_0xef7e('0x30')],'dialMethod':_0x390603['dialMethod'],'dialOriginateCallerIdName':_0x390603[_0xef7e('0x31')],'dialOriginateCallerIdNumber':_0x390603[_0xef7e('0x32')],'dialOriginateTimeout':_0x390603[_0xef7e('0x33')],'dialPrefix':_0x390603[_0xef7e('0x34')],'outboundAnswerAgiCallsDay':_0x390603['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x390603[_0xef7e('0x35')],'outboundBlacklistCallsDay':_0x390603['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x390603[_0xef7e('0x36')],'outboundCongestionCallsDay':_0x390603[_0xef7e('0x37')],'outboundDropCallsDayACS':_0x390603[_0xef7e('0x38')],'outboundDropCallsDayCallersExit':_0x390603[_0xef7e('0x39')],'outboundDropCallsDayTimeout':_0x390603[_0xef7e('0x3a')],'outboundNoAnswerCallsDay':_0x390603[_0xef7e('0x3b')],'outboundNoSuchCallsDay':_0x390603[_0xef7e('0x3c')],'outboundOriginateFailureCallsDay':_0x390603['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x390603['outboundReCallsDay'],'outboundRejectCallsDay':_0x390603[_0xef7e('0x3d')],'outboundUnknownCallsDay':_0x390603[_0xef7e('0x3e')],'outboundAbandonedCallsDay':_0x390603[_0xef7e('0x3f')],'predictiveIntervalAnsweredCalls':_0x390603['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x390603[_0xef7e('0x40')],'predictiveIntervalAvgTalktime':_0x390603[_0xef7e('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x390603[_0xef7e('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x390603[_0xef7e('0x43')],'predictiveIntervalErlangCalls':_0x390603[_0xef7e('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x390603[_0xef7e('0x45')],'predictiveIntervalHitRate':_0x390603[_0xef7e('0x46')],'predictiveIntervalMultiplicativeFactor':_0x390603[_0xef7e('0x47')],'predictiveIntervalPauses':_0x390603[_0xef7e('0x48')],'predictiveIntervalAvailable':_0x390603['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x390603[_0xef7e('0x49')],'message':_0x390603[_0xef7e('0x4a')],'originated':_0x390603[_0xef7e('0x4b')],'erlangCalls':_0x390603[_0xef7e('0x4c')],'erlangCallToSecond':_0x390603[_0xef7e('0x4d')],'erlangAbandonmentRate':_0x390603[_0xef7e('0x4e')],'erlangBusyFactor':_0x390603[_0xef7e('0x4f')],'startPredictive':_0x390603[_0xef7e('0x50')],'startProgressive':_0x390603[_0xef7e('0x51')]};if(_0x390603['Trunk']){_0x29d91d[_0xef7e('0x52')]={'id':_0x390603['Trunk']['id'],'name':_0x390603[_0xef7e('0x52')][_0xef7e('0x24')],'active':_0x390603[_0xef7e('0x52')][_0xef7e('0x53')],'callerid':_0x390603[_0xef7e('0x52')]['callerid']};}if(_0x390603[_0xef7e('0x54')]){_0x29d91d[_0xef7e('0x54')]={'id':_0x390603[_0xef7e('0x54')]['id'],'name':_0x390603['Interval'][_0xef7e('0x24')]};}var _0x4b6b5d=md5(JSON[_0xef7e('0x55')](_0x29d91d));if(_0x390603[_0xef7e('0x56')]!==_0x4b6b5d){_0x390603[_0xef7e('0x56')]=_0x4b6b5d;emit(util[_0xef7e('0x57')](_0xef7e('0x58'),_0x29d91d[_0xef7e('0x24')]),_0xef7e('0x59'),_0x29d91d);}}}function emitVoiceQueueChannelRemove(_0xf07c05){logger[_0xef7e('0x5a')](_0xef7e('0x5b'),JSON['stringify'](_0xf07c05));emit(util[_0xef7e('0x57')]('voice:queue:%s',_0xf07c05[_0xef7e('0x24')]),_0xef7e('0x5c'),_0xf07c05);io[_0xef7e('0x22')](_0xef7e('0x5d'),_0xf07c05);}function notSendMessagesQueue(_0x167dca){if(_0x167dca[_0xef7e('0x5e')]){if(_0x167dca[_0xef7e('0x4b')]===0x0&&_0x167dca[_0xef7e('0x28')]===0x0){_0x167dca[_0xef7e('0x5e')]=![];_0x167dca[_0xef7e('0x27')]=0x0;_0x167dca[_0xef7e('0x5f')]=0x0;_0x167dca['message']='NOT_ACTIVE';ut['logger'](_0xef7e('0x60'),_0x167dca[_0xef7e('0x24')]+_0xef7e('0x61'));}else{_0x167dca[_0xef7e('0x4a')]=_0xef7e('0x62');ut[_0xef7e('0x63')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x167dca['name']+_0xef7e('0x64'));}emitCampaignPreview(_0x167dca);}}Preview[_0xef7e('0xe')]['loopCampaigns']=function(){var _0x4ca00d=this;setInterval(function(){_0x4ca00d[_0xef7e('0x65')]();},0x7cf);};Preview[_0xef7e('0xe')][_0xef7e('0x65')]=function(){var _0x17056f=this['campaignsPreview'];this[_0xef7e('0x15')]+=0x1;for(var _0x2e80eb in _0x17056f){if(_0x17056f[_0xef7e('0x66')](_0x2e80eb)&&(_0x17056f[_0x2e80eb][_0xef7e('0x67')]===_0xef7e('0x5')||_0x17056f[_0x2e80eb]['dialMethod']===_0xef7e('0x68'))&&_0x17056f[_0x2e80eb]['type']===_0xef7e('0x23')){if(this[_0xef7e('0x15')]>0x7){this[_0xef7e('0x15')]=0x0;this[_0xef7e('0x69')]();}}if(_0x17056f[_0xef7e('0x66')](_0x2e80eb)&&_0x17056f[_0x2e80eb][_0xef7e('0x67')]===_0xef7e('0x5')&&_0x17056f[_0x2e80eb][_0xef7e('0x6a')]===_0xef7e('0x23')){if(_0x17056f[_0x2e80eb][_0xef7e('0x30')]){this['setMessage'](_0x17056f[_0x2e80eb]);this[_0xef7e('0x6b')](_0x17056f[_0x2e80eb]);}else{notSendMessagesQueue(_0x17056f[_0x2e80eb]);}}}};Preview[_0xef7e('0xe')][_0xef7e('0x6c')]=function(_0x4c049b){var _0x10f770=this;this['sequence'][_0xef7e('0x6d')](function(){if(!_['isNil'](_0x10f770[_0xef7e('0x13')][_0x4c049b])){loggerAction['info']('[clearZombieChannels][talking]',_0x4c049b,_0xef7e('0x6e'),_0x10f770[_0xef7e('0x13')][_0x4c049b][_0xef7e('0x6f')],_0xef7e('0x70'),JSON['stringify'](_0x10f770['campaignsPreview'][_0x10f770[_0xef7e('0x13')][_0x4c049b]['queue']][_0xef7e('0x4b')]),'pTalking:\x20',JSON[_0xef7e('0x55')](_0x10f770[_0xef7e('0x11')][_0x10f770[_0xef7e('0x13')][_0x4c049b]['queue']][_0xef7e('0x28')]),JSON['stringify'](_0x10f770['actions'][_0x4c049b][_0xef7e('0x71')]),JSON[_0xef7e('0x55')](_[_0xef7e('0x72')](_0x10f770[_0xef7e('0x13')][_0x4c049b],[_0xef7e('0x73'),'UserId',_0xef7e('0x74'),'ListId'])));return ami[_0xef7e('0x75')]({'action':_0xef7e('0x76'),'channel':_0x10f770[_0xef7e('0x13')][_0x4c049b][_0xef7e('0x77')]})['catch'](function(_0x16a0de){if(_0x16a0de[_0xef7e('0x4a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x10f770['actions'][_0x4c049b]){ut[_0xef7e('0x78')](_0x10f770['campaignsPreview'][_0x10f770[_0xef7e('0x13')][_0x4c049b]['queue']],_0xef7e('0x79'));if(_0x10f770['actions'][_0x4c049b][_0xef7e('0x71')]===!![]){ut[_0xef7e('0x7a')](_0x10f770[_0xef7e('0x11')][_0x10f770[_0xef7e('0x13')][_0x4c049b][_0xef7e('0x6f')]],'[clearZombieChannel]');ut['loggerError'](_0xef7e('0x7b')+_0x4c049b,_0x10f770[_0xef7e('0x13')][_0x4c049b]['queue']);}ut['loggerError'](_0xef7e('0x7c')+_0x4c049b,_0x10f770['actions'][_0x4c049b][_0xef7e('0x6f')]);delete _0x10f770[_0xef7e('0x13')][_0x4c049b];}},0x2328);}});}});};Preview[_0xef7e('0xe')][_0xef7e('0x69')]=function(){var _0x98e36a=this;loggerAction['info']('[action]',_['size'](this[_0xef7e('0x13')]));for(var _0x381846 in this[_0xef7e('0x13')]){if(_0x98e36a[_0xef7e('0x13')][_0xef7e('0x66')](_0x381846)){_0x98e36a[_0xef7e('0x6c')](_0x381846);}}};Preview[_0xef7e('0xe')][_0xef7e('0x6b')]=function(_0x3911a6){var _0x211b84=this;rpcDb[_0xef7e('0x7d')](_0x3911a6['id'],ut[_0xef7e('0x7e')](this[_0xef7e('0x14')]))[_0xef7e('0x7f')](function(_0x30d361){if(!_[_0xef7e('0x80')](_0x30d361)){for(var _0x3dd2cd=0x0;_0x3dd2cd<_0x30d361[_0xef7e('0x81')];_0x3dd2cd+=0x1){if(ut[_0xef7e('0x82')](_0x30d361[_0x3dd2cd][_0xef7e('0x83')])<_0x3911a6[_0xef7e('0x84')]*0x3c){if(_0x30d361[_0x3dd2cd]['Agent']&&!_0x30d361[_0x3dd2cd]['Agent']['voicePause']){_0x211b84['run'](_0x30d361[_0x3dd2cd]['id'])['then'](ut['logger2'](_0xef7e('0x85')))[_0xef7e('0x86')](ut[_0xef7e('0x87')]('[RecallMe]'));}else{rpcDb[_0xef7e('0x88')](_0x30d361[_0x3dd2cd]['id']);}}else{var _0x3d4695=new Action(_0x30d361[_0x3dd2cd],_0x3911a6);_0x3d4695[_0xef7e('0x89')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3911a6[_0xef7e('0x8a')]+=0x1;ut['logCustomer'](_0x3d4695,0x17,_0xef7e('0x8b'));if(_0x3911a6['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xef7e('0x8c')](_0x30d361[_0x3dd2cd]));rpcDb[_0xef7e('0x8d')](_0x3d4695,_0xef7e('0x8e'));}else{ut[_0xef7e('0x8f')](_0x3d4695,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x3d4695,'[HistoryRecallClose]');rpcDb[_0xef7e('0x90')](_0x3d4695,_0xef7e('0x91'));}}}}})[_0xef7e('0x86')](ut[_0xef7e('0x87')](_0xef7e('0x92')));};Preview[_0xef7e('0xe')][_0xef7e('0x93')]=function(_0x289386){_0x289386['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x289386[_0xef7e('0x94')])){_0x289386[_0xef7e('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xef7e('0x95')](_0x289386[_0xef7e('0x30')])){_0x289386[_0xef7e('0x4a')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x289386['Trunk'])){if(!this[_0xef7e('0x96')](_0x289386[_0xef7e('0x97')])){_0x289386[_0xef7e('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x289386[_0xef7e('0x4a')]=_0xef7e('0x98');}}else{_0x289386['message']=_0xef7e('0x98');}emitCampaignPreview(_0x289386);};Preview[_0xef7e('0xe')][_0xef7e('0x99')]=function(_0x320e2a,_0x120447,_0x1597e1){var _0x495e0a=this;var _0x2a84e0=this['actions'][_0x120447];var _0x51d3d8=this[_0xef7e('0x11')][_0x2a84e0[_0xef7e('0x6f')]];var _0xcd73db;if(_0x51d3d8){switch(_0x1597e1){case'1':_0x51d3d8[_0xef7e('0x3c')]+=0x1;_0x2a84e0['countnosuchnumberretry']+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut[_0xef7e('0x9b')](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0x0,'NoSuchNumber');ami[_0xef7e('0x22')]('custom:agentnosuchnumber',ut[_0xef7e('0x9c')](_0x2a84e0,_0xef7e('0x9d')));rpcDb[_0xef7e('0x8d')](_0x2a84e0,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xef7e('0x9b')](_0x2a84e0)>=_0x51d3d8['dialGlobalMaxRetry']){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb[_0xef7e('0x90')](_0xcd73db,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2a84e0['countnosuchnumberretry']>=_0x51d3d8[_0xef7e('0xa0')]){rpcDb[_0xef7e('0x90')](_0x2a84e0,_0xef7e('0xa1'));}else{rpcDb['rescheduleContact'](ut[_0xef7e('0xa2')](_0x2a84e0,_0xef7e('0xa3'),_0x51d3d8[_0xef7e('0xa4')]),_0x2a84e0[_0xef7e('0xa5')],_0x2a84e0['activeContact']);}}delete this[_0xef7e('0x13')][_0x320e2a[_0xef7e('0xa6')]];break;case'ANSWER':var _0x256809=moment()[_0xef7e('0x57')](_0xef7e('0xa7'));_0x2a84e0['responsetime']=_0x256809;_0x2a84e0[_0xef7e('0xa8')]=_0x256809;_0x2a84e0[_0xef7e('0x71')]=!![];_0x51d3d8[_0xef7e('0x28')]+=0x1;logger['info']('[syncHangup][talking][increment]',_0x2a84e0[_0xef7e('0xa9')],_0xef7e('0xaa'),_0x51d3d8['name'],_0xef7e('0xab'),_0x51d3d8[_0xef7e('0x28')]);ami[_0xef7e('0x22')](_0xef7e('0xac'),ut['buildObj'](_0x2a84e0,_0xef7e('0xad'),this['campaignsPreview'][_0x2a84e0[_0xef7e('0x6f')]]));if(_0x51d3d8[_0xef7e('0xae')]){ami[_0xef7e('0x22')](_0xef7e('0xaf'),ut[_0xef7e('0xb0')](_0x2a84e0));}break;case'16':ami[_0xef7e('0x22')]('custom:agentcomplete',ut[_0xef7e('0x9c')](_0x2a84e0,_0xef7e('0xb1'),this['campaignsPreview'][_0x2a84e0[_0xef7e('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0xef7e('0x9c')](_0x2a84e0,'complete'));_0x51d3d8['outboundAnswerCallsDay']+=0x1;_0x51d3d8[_0xef7e('0x2d')]+=0x1;_0x51d3d8[_0xef7e('0x26')]+=0x1;ut[_0xef7e('0x7a')](_0x51d3d8,_0xef7e('0xb2'));_0x2a84e0['countglobal']=ut['totalGlobal'](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0x4,_0xef7e('0xb3'));rpcDb['createCustomerHistory'](_0x2a84e0,_0xef7e('0xb4'));rpcDb[_0xef7e('0x90')](_0x2a84e0,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xef7e('0xb5')](_0x2a84e0);_0x51d3d8[_0xef7e('0x2a')]+=_0x2a84e0[_0xef7e('0xb6')];_0x51d3d8[_0xef7e('0x29')]+=_0x2a84e0[_0xef7e('0xb6')];logger['info']('[syncHangup][talking][decrement]',_0x2a84e0[_0xef7e('0xa9')],_0xef7e('0xaa'),_0x51d3d8[_0xef7e('0x24')],_0xef7e('0xab'),_0x51d3d8[_0xef7e('0x28')]);delete this['actions'][_0x320e2a[_0xef7e('0xa6')]];break;case _0xef7e('0xb7'):_0x51d3d8[_0xef7e('0x36')]+=0x1;_0x2a84e0[_0xef7e('0xb8')]+=0x1;_0x2a84e0['countglobal']=ut['totalGlobal'](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0x5,_0xef7e('0xb9'));ami[_0xef7e('0x22')](_0xef7e('0xba'),ut[_0xef7e('0x9c')](_0x2a84e0,_0xef7e('0xbb')));rpcDb[_0xef7e('0x8d')](_0x2a84e0,_0xef7e('0xbc'));if(ut[_0xef7e('0x9b')](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb[_0xef7e('0x90')](_0xcd73db,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2a84e0[_0xef7e('0xb8')]>=_0x51d3d8[_0xef7e('0xbe')]){rpcDb[_0xef7e('0x90')](_0x2a84e0,_0xef7e('0xbc'));}else{rpcDb[_0xef7e('0xbf')](ut[_0xef7e('0xa2')](_0x2a84e0,_0xef7e('0xb8'),_0x51d3d8[_0xef7e('0xc0')]),_0x2a84e0[_0xef7e('0xa5')],_0x2a84e0['activeContact']);}}break;case _0xef7e('0xc1'):_0x51d3d8[_0xef7e('0x3b')]+=0x1;_0x2a84e0[_0xef7e('0xc2')]+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut[_0xef7e('0x9b')](_0x2a84e0);ut['logCustomer'](_0x2a84e0,0x3,_0xef7e('0xc3'));ami[_0xef7e('0x22')](_0xef7e('0xc4'),ut[_0xef7e('0x9c')](_0x2a84e0,_0xef7e('0xc5')));rpcDb[_0xef7e('0x8d')](_0x2a84e0,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xef7e('0x9b')](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut['cloneAction'](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb[_0xef7e('0x90')](_0xcd73db,_0xef7e('0xc6'));}else{if(_0x2a84e0['countnoanswerretry']>=_0x51d3d8['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x2a84e0,_0xef7e('0xc7'));}else{rpcDb[_0xef7e('0xbf')](ut[_0xef7e('0xa2')](_0x2a84e0,_0xef7e('0xc2'),_0x51d3d8[_0xef7e('0xc8')]),_0x2a84e0[_0xef7e('0xa5')],_0x2a84e0['activeContact']);}}break;case _0xef7e('0xc9'):_0x51d3d8[_0xef7e('0x37')]+=0x1;_0x2a84e0[_0xef7e('0xca')]+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut[_0xef7e('0x9b')](_0x2a84e0);ut['logCustomer'](_0x2a84e0,0x8,'Congestion');ami[_0xef7e('0x22')](_0xef7e('0xcb'),ut['buildObj'](_0x2a84e0,_0xef7e('0xcc')));rpcDb[_0xef7e('0x8d')](_0x2a84e0,_0xef7e('0xcd'));if(ut[_0xef7e('0x9b')](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb['createCustomerFinal'](_0xcd73db,_0xef7e('0xce'));}else{if(_0x2a84e0[_0xef7e('0xca')]>=_0x51d3d8['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2a84e0,_0xef7e('0xcd'));}else{rpcDb[_0xef7e('0xbf')](ut[_0xef7e('0xa2')](_0x2a84e0,'countcongestionretry',_0x51d3d8[_0xef7e('0xc0')]),_0x2a84e0['unlockAgent'],_0x2a84e0[_0xef7e('0xcf')]);}}break;case'CANCEL':_0x51d3d8[_0xef7e('0x3d')]+=0x1;_0x2a84e0['countagentrejectretry']+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut['totalGlobal'](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0x14,'AgentReject');ami[_0xef7e('0x22')](_0xef7e('0xd0'),ut['buildObj'](_0x2a84e0,_0xef7e('0xd1')));rpcDb[_0xef7e('0x8d')](_0x2a84e0,_0xef7e('0xd2'));if(ut['totalGlobal'](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0xcd73db,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2a84e0[_0xef7e('0xd3')]>=_0x51d3d8[_0xef7e('0xd4')]){rpcDb[_0xef7e('0x90')](_0x2a84e0,_0xef7e('0xd5'));}else{rpcDb[_0xef7e('0xbf')](ut['scheduledAt'](_0x2a84e0,_0xef7e('0xd3'),_0x51d3d8[_0xef7e('0xd6')]),_0x2a84e0[_0xef7e('0xa5')],_0x2a84e0[_0xef7e('0xcf')]);}}break;case _0xef7e('0xd7'):_0x51d3d8[_0xef7e('0x3f')]+=0x1;_0x2a84e0['countabandonedretry']+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut[_0xef7e('0x9b')](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0xb,_0xef7e('0xd8'));rpcDb[_0xef7e('0x8d')](_0x2a84e0,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb[_0xef7e('0x90')](_0xcd73db,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2a84e0['countabandonedetry']>=_0x51d3d8[_0xef7e('0xd9')]){rpcDb[_0xef7e('0x90')](_0x2a84e0,_0xef7e('0xda'));}else{rpcDb[_0xef7e('0xbf')](ut[_0xef7e('0xa2')](_0x2a84e0,_0xef7e('0xdb'),_0x51d3d8[_0xef7e('0xdc')]),_0x2a84e0['unlockAgent'],_0x2a84e0[_0xef7e('0xcf')]);}}break;case'18':_0x51d3d8['outboundUnknownCallsDay']+=0x1;_0x2a84e0[_0xef7e('0xdd')]+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut[_0xef7e('0x9b')](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0x12,_0x320e2a[_0xef7e('0xde')]||_0x320e2a[_0xef7e('0xdf')]);ami[_0xef7e('0x22')](_0xef7e('0xe0'),ut[_0xef7e('0x9c')](_0x2a84e0,_0xef7e('0xe1')));rpcDb['createCustomerHistory'](_0x2a84e0,_0xef7e('0xe2'));if(ut[_0xef7e('0x9b')](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut['cloneAction'](_0x2a84e0,0xf,'Global');rpcDb[_0xef7e('0x90')](_0xcd73db,_0xef7e('0xe2'));}else{rpcDb[_0xef7e('0x90')](_0x2a84e0,_0xef7e('0xe2'));}delete this[_0xef7e('0x13')][_0x320e2a[_0xef7e('0xa6')]];break;case'19':_0x51d3d8[_0xef7e('0x3e')]+=0x1;_0x2a84e0[_0xef7e('0x9a')]=ut['totalGlobal'](_0x2a84e0);ut[_0xef7e('0x8f')](_0x2a84e0,0x13,_0x320e2a[_0xef7e('0xde')]||_0x320e2a[_0xef7e('0xdf')]);ami[_0xef7e('0x22')](_0xef7e('0xe0'),ut[_0xef7e('0x9c')](_0x2a84e0,_0xef7e('0xe1')));rpcDb[_0xef7e('0x8d')](_0x2a84e0,_0xef7e('0xe3'));if(ut['totalGlobal'](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb[_0xef7e('0x90')](_0xcd73db,_0xef7e('0xe3'));}else{rpcDb['createCustomerFinal'](_0x2a84e0,_0xef7e('0xe3'));}delete this[_0xef7e('0x13')][_0x320e2a[_0xef7e('0xa6')]];break;default:if(_0x2a84e0[_0xef7e('0x71')]){ut[_0xef7e('0x7a')](_0x51d3d8,_0xef7e('0xe4'));ut[_0xef7e('0xe5')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x51d3d8['name'],_0x320e2a);}_0x51d3d8['outboundUnknownCallsDay']+=0x1;_0x2a84e0['countglobal']=ut[_0xef7e('0x9b')](_0x2a84e0);ut['logCustomer'](_0x2a84e0,0xc,_0x320e2a['cause-txt']||_0x320e2a['dialstatus']);rpcDb[_0xef7e('0x8d')](_0x2a84e0,_0xef7e('0xe6'));if(ut['totalGlobal'](_0x2a84e0)>=_0x51d3d8[_0xef7e('0xbd')]){_0xcd73db=ut[_0xef7e('0x9e')](_0x2a84e0,0xf,_0xef7e('0x9f'));rpcDb[_0xef7e('0x90')](_0xcd73db,_0xef7e('0xe7'));}else{rpcDb[_0xef7e('0x90')](_0x2a84e0,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xef7e('0x13')][_0x320e2a[_0xef7e('0xa6')]];}if(!(_0x2a84e0['dialAnswer']&&_0x1597e1==='16')){ut[_0xef7e('0x78')](_0x51d3d8,_0xef7e('0xe8'));logger[_0xef7e('0x5a')](_0xef7e('0xe9'),_0x2a84e0[_0xef7e('0xa9')],_0xef7e('0xaa'),_0x51d3d8[_0xef7e('0x24')],_0xef7e('0x70'),_0x51d3d8[_0xef7e('0x4b')]);}if(_0x1597e1!==_0xef7e('0xea')){delete this[_0xef7e('0x13')][_0x320e2a[_0xef7e('0xa6')]];delete this['actions'][_0x320e2a[_0xef7e('0xeb')]];}}};Preview[_0xef7e('0xe')][_0xef7e('0xec')]=function(_0x353048,_0x5d8dee,_0x10b33d){if(_['isUndefined'](_0x5d8dee)&&'object'!==typeof _0x5d8dee){return;}if(_['isUndefined'](_0x10b33d)&&_0xef7e('0xed')!==typeof _0x10b33d){return;}switch(_0x10b33d['reason']){case'0':ut[_0xef7e('0xee')](_0x353048,0x0,_0xef7e('0xef'));rpcDb['createAgentHistory'](_0x353048,_0xef7e('0xf0'));break;case'3':ut['logAgent'](_0x353048,0x3,_0xef7e('0xc3'));rpcDb[_0xef7e('0xf1')](_0x353048,_0xef7e('0xf2'));break;case'5':ut[_0xef7e('0xee')](_0x353048,0x5,_0xef7e('0xb9'));rpcDb['createAgentHistory'](_0x353048,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xef7e('0xee')](_0x353048,0x8,'Congestion');rpcDb[_0xef7e('0xf1')](_0x353048,_0xef7e('0xf3'));break;case'22':ut[_0xef7e('0xee')](_0x353048,0x16,_0xef7e('0xf4'));rpcDb[_0xef7e('0xf1')](_0x353048,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xef7e('0xee')](_0x353048,0xc,_0x10b33d[_0xef7e('0xf5')]);rpcDb[_0xef7e('0xf1')](_0x353048,_0xef7e('0xf3'));}ut[_0xef7e('0x78')](_0x5d8dee,_0xef7e('0xf6'));logger[_0xef7e('0x5a')]('[originated][decrement][callProgressDetectingAgent]',_0x353048[_0xef7e('0xa9')],'\x20Queue',_0x5d8dee['name'],_0xef7e('0x70'),_0x5d8dee[_0xef7e('0x4b')]);delete this[_0xef7e('0x13')][_0x353048['uniqueid']];};Preview[_0xef7e('0xe')][_0xef7e('0xf7')]=function(_0x5bb133,_0x3bbc26,_0x433cd5,_0x2cd553,_0x382a64){var _0x3253f7=this;return new BPromise(function(_0x5b1ebb,_0x3ab90a){if(_['isNil'](_0x3bbc26)||_['isNil'](_0x3bbc26[_0xef7e('0xf8')])||_['isNil'](_0x3bbc26[_0xef7e('0xf8')][_0xef7e('0xf9')])||_[_0xef7e('0x80')](_0x3bbc26[_0xef7e('0x74')])){_0x3ab90a(ut[_0xef7e('0x4a')](_0xef7e('0xfa'),_0x2cd553,_0x382a64));return;}var _0x1b058c=uuid['v4']();var _0x182a15=_0x3253f7[_0xef7e('0x11')][_0x3bbc26[_0xef7e('0x6e')][_0xef7e('0x24')]];var _0x8f55c5=_0x433cd5?_0x3253f7[_0xef7e('0x14')][_0x433cd5]['id']:undefined;_0x3253f7[_0xef7e('0x13')][_0x1b058c]=new Action(_0x3bbc26,_0x182a15,_0x1b058c,_0x433cd5,_0x8f55c5);var _0x583dc6=_0x3253f7[_0xef7e('0x13')][_0x1b058c];_0x583dc6[_0xef7e('0xa5')]=_0x2cd553;_0x583dc6[_0xef7e('0xcf')]=_0x382a64;_0x583dc6['lookAgent']=_0x433cd5;if(_['isEmpty'](_0x5bb133)){_0x3253f7[_0xef7e('0xfb')](_0x583dc6,_0x182a15,_0x3bbc26,_0x433cd5)[_0xef7e('0x7f')](function(_0x2418ff){logger[_0xef7e('0x5a')](_0xef7e('0xfc'),'Queue:\x20'+_0x583dc6[_0xef7e('0x6f')]+'\x20IdHopper:\x20'+_0x583dc6['idContact'],JSON[_0xef7e('0x55')](_0x2418ff));ami['emit'](_0xef7e('0xfd'),ut[_0xef7e('0x9c')](_0x583dc6,'called',_0x3253f7[_0xef7e('0x11')][_0x583dc6[_0xef7e('0x6f')]]));_0x5b1ebb(ut[_0xef7e('0x4a')]('Calling'));})[_0xef7e('0x86')](function(_0x1f2357){ut['logger'](_0xef7e('0xfe'),_0x1f2357);_0x3ab90a(ut['message'](_0xef7e('0xff'),_0x2cd553,_0x382a64));});}else{_0x182a15[_0xef7e('0x100')]+=0x1;ut[_0xef7e('0x101')](_0x583dc6);rpcDb[_0xef7e('0x102')](_0x583dc6,_0xef7e('0x103'));delete _0x3253f7[_0xef7e('0x13')][_0x1b058c];_0x3ab90a(ut[_0xef7e('0x4a')](_0xef7e('0x104'),_0x2cd553,_0x382a64));}});};Preview[_0xef7e('0xe')][_0xef7e('0x96')]=function(_0x30390f){return!_[_0xef7e('0x80')](_0x30390f)&&!_[_0xef7e('0x80')](_0x30390f[_0xef7e('0x24')])&&!_[_0xef7e('0x80')](_0x30390f[_0xef7e('0x53')])&&_0x30390f[_0xef7e('0x53')]&&!_[_0xef7e('0x80')](this[_0xef7e('0x12')][util[_0xef7e('0x57')](_0xef7e('0x105'),_0x30390f[_0xef7e('0x24')])])&&!_[_0xef7e('0x80')](this[_0xef7e('0x12')][util['format'](_0xef7e('0x105'),_0x30390f[_0xef7e('0x24')])][_0xef7e('0x76')])&&(this[_0xef7e('0x12')][util['format']('SIP/%s',_0x30390f[_0xef7e('0x24')])][_0xef7e('0x76')]==='reachable'||this[_0xef7e('0x12')][util[_0xef7e('0x57')](_0xef7e('0x105'),_0x30390f[_0xef7e('0x24')])][_0xef7e('0x76')]===_0xef7e('0x106'));};Preview['prototype'][_0xef7e('0x107')]=function(_0x1609e9,_0x38ce3c){var _0x54d61c=this;return new BPromise(function(_0x2fb6c7,_0x5880fb){_0x54d61c[_0xef7e('0x108')](_0x1609e9,_0x38ce3c)['then'](function(_0x55952a){_0x2fb6c7(_[_0xef7e('0x72')](_0x55952a,['message']));})[_0xef7e('0x86')](function(_0x24ea75){if(_0x24ea75[_0xef7e('0x109')]){rpcDb['unlockContact'](_0x1609e9);}if(_0x24ea75['active']){rpcDb[_0xef7e('0x88')](_0x1609e9);}_0x5880fb(_[_0xef7e('0x72')](_0x24ea75,['message']));});});};Preview['prototype'][_0xef7e('0x108')]=function(_0x516439,_0x46e23a){var _0x4e45e6=this;return new BPromise(function(_0x231bba,_0x5f2db6){var _0x538c11,_0xe38a68;rpcDb[_0xef7e('0x10a')](_0x516439)['then'](function(_0x14dd37){if(!_[_0xef7e('0x80')](_0x14dd37[0x0])){_0xe38a68=_0x14dd37[0x0]['recallme']?![]:!![];_0x538c11=_0x14dd37[0x0][_0xef7e('0x10b')]?!![]:![];_0x538c11=_0x46e23a?!![]:_0x538c11;}var _0xc02886=_0x4e45e6[_0xef7e('0x10c')](_0x14dd37);if(_0xc02886[_0xef7e('0x10d')]){rpcDb[_0xef7e('0x10e')](_[_0xef7e('0x72')](_0x14dd37[0x0],[_0xef7e('0x74'),_0xef7e('0x10f')]))[_0xef7e('0x7f')](function(_0x47200e){_0x4e45e6[_0xef7e('0xf7')](_0x47200e,_0x14dd37[0x0],_0x46e23a,_0xe38a68,_0x538c11)[_0xef7e('0x7f')](function(_0x338776){_0x231bba(_0x338776);})[_0xef7e('0x86')](function(_0xf686ff){_0x5f2db6(_0xf686ff);});})[_0xef7e('0x86')](function(_0x242a53){ut[_0xef7e('0x63')](_0xef7e('0x110'),_0x242a53);_0x5f2db6(ut[_0xef7e('0x4a')](_0xef7e('0x111'),_0xe38a68,_0x538c11));});}else{_0x5f2db6(ut[_0xef7e('0x4a')](_0xc02886['message'],_0xe38a68,_0x538c11));}})[_0xef7e('0x86')](function(_0x247276){ut['logger'](_0xef7e('0x112'),_0x247276);_0x5f2db6(ut[_0xef7e('0x4a')](_0xef7e('0x111'),![],!![]));});});};Preview[_0xef7e('0xe')]['validateContact']=function(_0x3aca62){if(_['isNil'](_0x3aca62)||_[_0xef7e('0x113')](_0x3aca62)||!_[_0xef7e('0x80')](_0x3aca62[0x0][_0xef7e('0x114')])&&_[_0xef7e('0x80')](_0x3aca62[0x0][_0xef7e('0x114')][_0xef7e('0x24')])){ut[_0xef7e('0x63')](_0xef7e('0x115'),_0x3aca62);return{'isValid':![],'message':_0xef7e('0x116')};}var _0x1817ac=this[_0xef7e('0x11')][_0x3aca62[0x0][_0xef7e('0x6e')][_0xef7e('0x24')]];_0x1817ac[_0xef7e('0x4a')]=_0xef7e('0x98');if(_[_0xef7e('0x80')](_0x1817ac)){ut[_0xef7e('0x63')](_0xef7e('0x117'),_0x1817ac);return{'isValid':![],'message':_0xef7e('0x118')};}if(!this[_0xef7e('0x96')](_0x1817ac[_0xef7e('0x52')])){ut[_0xef7e('0x63')](_0xef7e('0x119'),_0xef7e('0x11a')+_0x1817ac['name']+_0xef7e('0x11b'));if(!this[_0xef7e('0x96')](_0x1817ac[_0xef7e('0x97')])){ut[_0xef7e('0x63')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x1817ac['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xef7e('0x95')](_0x1817ac[_0xef7e('0x30')])){ut[_0xef7e('0x63')](_0xef7e('0x11c'),_0x1817ac[_0xef7e('0x24')]+_0xef7e('0x11d'));return{'isValid':![],'message':_0xef7e('0x11a')+_0x1817ac['name']+_0xef7e('0x11d')};}return{'isValid':!![],'message':_0xef7e('0x11e')};};Preview['prototype'][_0xef7e('0xfb')]=function(_0xa1513b,_0x15eefc,_0x38f7a5,_0x86dfec){var _0x220e03=this;return new BPromise(function(_0x1f44c5,_0x43600c){var _0x5d5a20=_0xa1513b[_0xef7e('0xa9')];var _0x25135f=_0x220e03[_0xef7e('0x96')](_0x15eefc[_0xef7e('0x52')])?util['format'](_0xef7e('0x11f'),_0x15eefc['Trunk'][_0xef7e('0x24')],_[_0xef7e('0x80')](_0x15eefc['dialPrefix'])?'':_0x15eefc['dialPrefix'][_0xef7e('0x120')]()||'',_0x15eefc[_0xef7e('0x121')]>0x0?_0x38f7a5[_0xef7e('0xf8')]['phone']['substring'](_0x15eefc[_0xef7e('0x121')]):_0x38f7a5[_0xef7e('0xf8')][_0xef7e('0xf9')]):util[_0xef7e('0x57')](_0xef7e('0x11f'),_[_0xef7e('0x80')](_0x15eefc['TrunkBackup'])?_0x15eefc[_0xef7e('0x52')]['name']:_0x15eefc[_0xef7e('0x97')]['name'],_['isNil'](_0x15eefc[_0xef7e('0x34')])?'':_0x15eefc['dialPrefix'][_0xef7e('0x120')]()||'',_0x15eefc[_0xef7e('0x121')]>0x0?_0x38f7a5[_0xef7e('0xf8')][_0xef7e('0xf9')][_0xef7e('0x122')](_0x15eefc[_0xef7e('0x121')]):_0x38f7a5[_0xef7e('0xf8')][_0xef7e('0xf9')]);var _0xf3d626=_0x220e03[_0xef7e('0x96')](_0x15eefc[_0xef7e('0x52')])?ut[_0xef7e('0x123')](_0x15eefc[_0xef7e('0x52')][_0xef7e('0x124')],_0x15eefc['dialOriginateCallerIdName'],_0x15eefc[_0xef7e('0x125')]>0x0?ut['getCallerIdRandom'](_0x15eefc[_0xef7e('0x32')],_0x15eefc[_0xef7e('0x125')]):_0x15eefc[_0xef7e('0x32')]):ut['getCallerId'](_['isNil'](_0x15eefc[_0xef7e('0x97')])?_0x15eefc[_0xef7e('0x52')][_0xef7e('0x124')]:_0x15eefc[_0xef7e('0x97')][_0xef7e('0x124')],_0x15eefc[_0xef7e('0x31')],_0x15eefc[_0xef7e('0x125')]>0x0?ut[_0xef7e('0x126')](_0x15eefc[_0xef7e('0x32')],_0x15eefc[_0xef7e('0x125')]):_0x15eefc[_0xef7e('0x32')]);if(_0xf3d626){_0xa1513b[_0xef7e('0x127')]=ut[_0xef7e('0x128')](_0xf3d626);_0xa1513b[_0xef7e('0x129')]=ut[_0xef7e('0x12a')](_0xf3d626);}var _0x2da9b7=ut['addVariables'](_0x15eefc,_0x38f7a5,_0x25135f,_0xf3d626,_0x5d5a20,_0xa1513b);_['merge'](_0xa1513b,ut[_0xef7e('0x12b')](_0x2da9b7));_0xa1513b[_0xef7e('0x89')]=moment()[_0xef7e('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xef7e('0x75')](ut[_0xef7e('0x12c')](_0xa1513b,_0x15eefc,_0x2da9b7,_0xa1513b[_0xef7e('0xcf')],_0x86dfec))[_0xef7e('0x7f')](function(_0x450889){var _0x4b4a77=_0xa1513b['channelAgent'];if(!_['isNil'](_0x4b4a77)){if(!_[_0xef7e('0x80')](_0x220e03[_0xef7e('0x14')][_0x4b4a77])){_0x220e03['agents'][_0x4b4a77][_0xef7e('0x12d')]=_0xa1513b[_0xef7e('0x12e')];emit(util[_0xef7e('0x57')](_0xef7e('0x12f'),_0x220e03['agents'][_0x4b4a77]['name']),'user:agentconnect',{'destaccountcode':_0x220e03['agents'][_0x4b4a77][_0xef7e('0x130')],'destconnectedlinenum':_0xa1513b[_0xef7e('0x12e')]});}}_0x15eefc[_0xef7e('0x4b')]+=0x1;logger[_0xef7e('0x5a')](_0xef7e('0x131'),_0x5d5a20,_0xef7e('0xaa'),_0x15eefc[_0xef7e('0x24')],'originated:\x20',_0x15eefc[_0xef7e('0x4b')]);_0x1f44c5(_0x450889);})['catch'](function(_0x4d40cd){ut['logAgent'](_0xa1513b,0xe,_0xef7e('0x132'));rpcDb[_0xef7e('0xf1')](_0xa1513b,_0xef7e('0x133'));_0x43600c(_0x4d40cd);});});};Preview[_0xef7e('0xe')]['syncNewExten']=function(_0x3d5437){if(this[_0xef7e('0x13')][_0x3d5437[_0xef7e('0xa6')]]){this[_0xef7e('0x13')][_0x3d5437['linkedid']][_0xef7e('0x77')]=_0x3d5437[_0xef7e('0x77')];}};Preview[_0xef7e('0xe')][_0xef7e('0x17')]=function(_0x3dadef){var _0x5ee35a=this;var _0x2ac00f=this[_0xef7e('0x13')][_0x3dadef[_0xef7e('0x134')]];if(_0x2ac00f){if(_0x2ac00f['lookAgent']&&this[_0xef7e('0x14')][_0x2ac00f[_0xef7e('0x135')]]){ut[_0xef7e('0x136')](_0x2ac00f,this['agents'][_0x2ac00f[_0xef7e('0x135')]]['name'],this['agents'][_0x2ac00f[_0xef7e('0x135')]]['id']);}var _0x5e0c60=_['clone'](_0x2ac00f);_0x5e0c60[_0xef7e('0x137')]=moment()[_0xef7e('0x57')](_0xef7e('0xa7'));var _0x338575=_0x5ee35a[_0xef7e('0x11')][_0x2ac00f[_0xef7e('0x6f')]];if(ut[_0xef7e('0x138')](_0x3dadef['response'])){if(_0x2ac00f[_0xef7e('0xa5')]){rpcDb['unlockContact'](_0x2ac00f['idContact']);}if(_0x2ac00f[_0xef7e('0xcf')]){rpcDb[_0xef7e('0x88')](_0x2ac00f['idContact']);}ami[_0xef7e('0x22')](_0xef7e('0x139'),ut[_0xef7e('0x9c')](_0x2ac00f,_0xef7e('0x13a'),this[_0xef7e('0x11')][_0x2ac00f[_0xef7e('0x6f')]]));this[_0xef7e('0xec')](_0x5e0c60,_0x338575,_0x3dadef);}else{_0x2ac00f[_0xef7e('0x89')]=moment()[_0xef7e('0x57')](_0xef7e('0xa7'));ut[_0xef7e('0xee')](_0x5e0c60,0x4,_0xef7e('0xb3'));rpcDb[_0xef7e('0xf1')](_0x5e0c60,_0xef7e('0x13b'));}}};Preview[_0xef7e('0xe')][_0xef7e('0x13c')]=function(_0xe5aaa9){var _0x58038c=this;var _0x1f35c7=this[_0xef7e('0x13')][_0xe5aaa9[_0xef7e('0xa6')]];var _0x522d62;if(_0x1f35c7){_0x522d62=this['campaignsPreview'][_0x1f35c7[_0xef7e('0x6f')]];logger[_0xef7e('0x5a')](_0xef7e('0x13d'),_0xe5aaa9[_0xef7e('0xa6')],'\x20Queue',_0x522d62[_0xef7e('0x24')],_0xef7e('0xab'),_0x522d62[_0xef7e('0x28')]);}if(this['actions'][_0xe5aaa9['linkedid']]&&_0xe5aaa9[_0xef7e('0xa6')]!==_0xe5aaa9['uniqueid']){if(_0xe5aaa9[_0xef7e('0x13e')]==='16'&&this[_0xef7e('0x13')][_0xe5aaa9[_0xef7e('0xa6')]][_0xef7e('0x71')]){this[_0xef7e('0x99')](_0xe5aaa9,_0xe5aaa9[_0xef7e('0xa6')],_0xe5aaa9['cause']);}else if(this['actions'][_0xe5aaa9[_0xef7e('0xa6')]][_0xef7e('0x71')]){logger[_0xef7e('0x5a')]('[syncHangup][talking][cause]',_0xe5aaa9[_0xef7e('0xa6')],_0xe5aaa9[_0xef7e('0x13e')],_0xef7e('0xaa'),_0x522d62['name'],_0xef7e('0xab'),_0x522d62[_0xef7e('0x28')]);this[_0xef7e('0x99')](_0xe5aaa9,_0xe5aaa9[_0xef7e('0xa6')],_0xe5aaa9[_0xef7e('0x13e')]);}}else if(_0x1f35c7&&_[_0xef7e('0x80')](_0x1f35c7[_0xef7e('0x13f')])&&_0x522d62[_0xef7e('0x140')]&&_0xe5aaa9[_0xef7e('0xa6')]===_0xe5aaa9['uniqueid']&&_[_0xef7e('0x80')](_0xe5aaa9[_0xef7e('0xf5')])&&_0xe5aaa9[_0xef7e('0x13e')]==='16'&&_0xe5aaa9[_0xef7e('0x141')]==='6'&&_[_0xef7e('0x142')](_0x1f35c7[_0xef7e('0x143')])){if(_0x1f35c7['unlockAgent']){rpcDb[_0xef7e('0x144')](_0x1f35c7[_0xef7e('0x145')]);}if(_0x1f35c7[_0xef7e('0xcf')]){rpcDb[_0xef7e('0x88')](_0x1f35c7[_0xef7e('0x145')]);}_0xe5aaa9[_0xef7e('0xf5')]='22';this[_0xef7e('0xec')](_0x1f35c7,_0x522d62,_0xe5aaa9);}else if(_0x1f35c7&&_0x1f35c7[_0xef7e('0x143')]){if(_0xe5aaa9['cause']==='16'&&this[_0xef7e('0x13')][_0xe5aaa9['linkedid']][_0xef7e('0x71')]){logger[_0xef7e('0x5a')]('[syncHangup][talking][transfer]',_0xe5aaa9[_0xef7e('0xa6')],_0xe5aaa9[_0xef7e('0x13e')],_0xef7e('0xaa'),_0x522d62[_0xef7e('0x24')],_0xef7e('0xab'),_0x522d62[_0xef7e('0x28')]);this[_0xef7e('0x99')](_0xe5aaa9,_0xe5aaa9[_0xef7e('0xa6')],_0xe5aaa9[_0xef7e('0x13e')]);}else if(this[_0xef7e('0x13')][_0xe5aaa9[_0xef7e('0xa6')]][_0xef7e('0x71')]){logger['info'](_0xef7e('0x146'),_0xe5aaa9[_0xef7e('0xa6')],_0xe5aaa9[_0xef7e('0x13e')],_0xef7e('0xaa'),_0x522d62[_0xef7e('0x24')],_0xef7e('0xab'),_0x522d62[_0xef7e('0x28')]);this[_0xef7e('0x99')](_0xe5aaa9,_0xe5aaa9['linkedid'],_0xe5aaa9[_0xef7e('0x13e')]);}}};Preview[_0xef7e('0xe')][_0xef7e('0x147')]=function(_0x1ae523){if(this[_0xef7e('0x13')][_0x1ae523[_0xef7e('0xeb')]]&&_0x1ae523[_0xef7e('0xeb')]!==_0x1ae523[_0xef7e('0x148')]){this[_0xef7e('0x99')](_0x1ae523,_0x1ae523[_0xef7e('0xeb')],_0x1ae523[_0xef7e('0xdf')]);}};Preview[_0xef7e('0xe')][_0xef7e('0x19')]=function(_0x4aa187){if(this['actions'][_0x4aa187['linkedid']]&&_0x4aa187['linkedid']!==_0x4aa187[_0xef7e('0xa9')]&&!this['actions'][_0x4aa187['linkedid']][_0xef7e('0x71')]){if(_0x4aa187[_0xef7e('0x13e')]==='1'){this[_0xef7e('0x99')](_0x4aa187,_0x4aa187[_0xef7e('0xa6')],_0x4aa187['cause']);}}};Preview[_0xef7e('0xe')][_0xef7e('0x149')]=function(_0x843117,_0x49fe0c,_0x143cd6){if(this[_0xef7e('0x13')][_0x843117]){if(_[_0xef7e('0x80')](this[_0xef7e('0x13')][_0x843117][_0xef7e('0x14a')])){this['actions'][_0x843117][_0xef7e('0x14a')]={};}this[_0xef7e('0x13')][_0x843117][_0xef7e('0x14a')][_0x49fe0c]=_0x143cd6;}};Preview['prototype'][_0xef7e('0x1e')]=function(_0x152a5c){try{if(!_[_0xef7e('0x80')](_0x152a5c)){if(ut['filterKey'](_[_0xef7e('0x14b')](_0x152a5c[_0xef7e('0x14c')])[0x0])){this['addVariable'](_0x152a5c['uniqueid'],_['keys'](_0x152a5c['variable'])[0x0],_0x152a5c[_0xef7e('0x14d')]);}}}catch(_0x14445e){logger[_0xef7e('0x14e')](_0xef7e('0x14f'),util[_0xef7e('0x150')](_0x14445e,{'showHidden':![],'depth':null}));}};Preview[_0xef7e('0xe')][_0xef7e('0x20')]=function(_0x14e718){if(_0x14e718){if(this['actions'][_0x14e718[_0xef7e('0x151')]]){this[_0xef7e('0x13')][_0x14e718['transfertargetlinkedid']][_0xef7e('0x143')]=!![];}}};Preview[_0xef7e('0xe')][_0xef7e('0x21')]=function(_0x2de265){if(_0x2de265){if(this[_0xef7e('0x13')][_0x2de265[_0xef7e('0x152')]]){this[_0xef7e('0x13')][_0x2de265['transfererlinkedid']][_0xef7e('0x143')]=!![];}}};module[_0xef7e('0x153')]=Preview; \ No newline at end of file +var _0xf24e=['idContact','custom:agentcalled','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','SIP/%s','reachable','unmonitored','execRun','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','Contact','substring','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','user:agentconnect','accountcode','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','addVariable','variables','filterKey','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','defaults','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','syncHangupRequest','dialend','syncDialEnd','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','originated','erlangCalls','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','name','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','clearZombieChannels','clearZombieChannel','info','[clearZombieChannels][talking]','Queue','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','buildAcw','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','reason','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','phone','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20'];(function(_0x14bbab,_0x281643){var _0x594e7e=function(_0x2b3ec6){while(--_0x2b3ec6){_0x14bbab['push'](_0x14bbab['shift']());}};_0x594e7e(++_0x281643);}(_0xf24e,0x19f));var _0xef24=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xf24e[_0x1b6311];return _0x25aab6;};'use strict';var util=require(_0xef24('0x0'));var _=require('lodash');var BPromise=require(_0xef24('0x1'));var uuid=require('uuid');var moment=require(_0xef24('0x2'));var md5=require(_0xef24('0x3'));var Redis=require(_0xef24('0x4'));var config=require(_0xef24('0x5'));var logger=require(_0xef24('0x6'))(_0xef24('0x7'));var loggerAction=require(_0xef24('0x6'))(_0xef24('0x8'));var ami=require(_0xef24('0x9'));var rpcDb=require(_0xef24('0xa'));var Action=require(_0xef24('0xb'));var ut=require('./util/util');config['redis']=_[_0xef24('0xc')](config[_0xef24('0xd')],{'host':_0xef24('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xef24('0xd')]));var Sequence=function(){};Sequence[_0xef24('0xf')][_0xef24('0x10')]=function(_0x2b551d){this[_0xef24('0x11')]=this[_0xef24('0x11')]?this[_0xef24('0x11')][_0xef24('0x12')](_0x2b551d):_0x2b551d();};function Preview(_0x3cf5fb){this[_0xef24('0x13')]=new Sequence();this[_0xef24('0x14')]=_0x3cf5fb[_0xef24('0x15')];this[_0xef24('0x16')]=_0x3cf5fb[_0xef24('0x16')];this[_0xef24('0x17')]={};this[_0xef24('0x18')]=_0x3cf5fb[_0xef24('0x18')];this[_0xef24('0x19')]=0x0;ami['on'](_0xef24('0x1a'),this[_0xef24('0x1b')][_0xef24('0x1c')](this));ami['on']('hangup',this[_0xef24('0x1d')][_0xef24('0x1c')](this));ami['on']('hanguprequest',this[_0xef24('0x1e')][_0xef24('0x1c')](this));ami['on'](_0xef24('0x1f'),this[_0xef24('0x20')][_0xef24('0x1c')](this));ami['on']('newexten',this['syncNewExten'][_0xef24('0x1c')](this));ami['on']('varset',this[_0xef24('0x21')][_0xef24('0x1c')](this));ami['on'](_0xef24('0x22'),this[_0xef24('0x23')][_0xef24('0x1c')](this));ami['on']('blindtransfer',this[_0xef24('0x24')][_0xef24('0x1c')](this));this['loopCampaigns'](this[_0xef24('0x14')]);}function emit(_0x5b5351,_0x197432,_0x2a008f){io['to'](_0x5b5351)[_0xef24('0x25')](_0x197432,_0x2a008f);}function emitCampaignPreview(_0x175f44){if(_0x175f44['type']===_0xef24('0x26')){var _0x5dd2ec={'id':_0x175f44['id'],'name':_0x175f44['name'],'strategy':_0x175f44[_0xef24('0x27')],'answered':_0x175f44[_0xef24('0x28')],'available':_0x175f44[_0xef24('0x29')],'loggedIn':_0x175f44[_0xef24('0x2a')],'pTalking':_0x175f44[_0xef24('0x2b')],'sumBillable':_0x175f44[_0xef24('0x2c')],'sumDuration':_0x175f44[_0xef24('0x2d')],'sumHoldTime':_0x175f44['sumHoldTime']||0x0,'talking':_0x175f44[_0xef24('0x2e')],'total':_0x175f44[_0xef24('0x2f')],'type':_0x175f44[_0xef24('0x30')],'unmanaged':_0x175f44[_0xef24('0x31')],'abandoned':_0x175f44['abandoned'],'waiting':_0x175f44['waiting'],'loggedInDb':_0x175f44[_0xef24('0x32')],'dialActive':_0x175f44[_0xef24('0x33')],'dialMethod':_0x175f44[_0xef24('0x34')],'dialOriginateCallerIdName':_0x175f44[_0xef24('0x35')],'dialOriginateCallerIdNumber':_0x175f44['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x175f44[_0xef24('0x36')],'dialPrefix':_0x175f44[_0xef24('0x37')],'outboundAnswerAgiCallsDay':_0x175f44['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x175f44['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x175f44[_0xef24('0x38')],'outboundBusyCallsDay':_0x175f44[_0xef24('0x39')],'outboundCongestionCallsDay':_0x175f44[_0xef24('0x3a')],'outboundDropCallsDayACS':_0x175f44['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x175f44[_0xef24('0x3b')],'outboundDropCallsDayTimeout':_0x175f44[_0xef24('0x3c')],'outboundNoAnswerCallsDay':_0x175f44[_0xef24('0x3d')],'outboundNoSuchCallsDay':_0x175f44[_0xef24('0x3e')],'outboundOriginateFailureCallsDay':_0x175f44['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x175f44[_0xef24('0x3f')],'outboundRejectCallsDay':_0x175f44[_0xef24('0x40')],'outboundUnknownCallsDay':_0x175f44[_0xef24('0x41')],'outboundAbandonedCallsDay':_0x175f44['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x175f44['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x175f44[_0xef24('0x42')],'predictiveIntervalAvgTalktime':_0x175f44[_0xef24('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x175f44['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x175f44[_0xef24('0x44')],'predictiveIntervalErlangCalls':_0x175f44[_0xef24('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x175f44[_0xef24('0x46')],'predictiveIntervalHitRate':_0x175f44[_0xef24('0x47')],'predictiveIntervalMultiplicativeFactor':_0x175f44[_0xef24('0x48')],'predictiveIntervalPauses':_0x175f44[_0xef24('0x49')],'predictiveIntervalAvailable':_0x175f44['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x175f44['predictiveIntervalTotalCalls'],'message':_0x175f44[_0xef24('0x4a')],'originated':_0x175f44[_0xef24('0x4b')],'erlangCalls':_0x175f44[_0xef24('0x4c')],'erlangCallToSecond':_0x175f44['erlangCallToSecond'],'erlangAbandonmentRate':_0x175f44[_0xef24('0x4d')],'erlangBusyFactor':_0x175f44['erlangBusyFactor'],'startPredictive':_0x175f44[_0xef24('0x4e')],'startProgressive':_0x175f44[_0xef24('0x4f')]};if(_0x175f44[_0xef24('0x50')]){_0x5dd2ec[_0xef24('0x50')]={'id':_0x175f44[_0xef24('0x50')]['id'],'name':_0x175f44[_0xef24('0x50')]['name'],'active':_0x175f44['Trunk'][_0xef24('0x51')],'callerid':_0x175f44['Trunk'][_0xef24('0x52')]};}if(_0x175f44[_0xef24('0x53')]){_0x5dd2ec[_0xef24('0x53')]={'id':_0x175f44[_0xef24('0x53')]['id'],'name':_0x175f44[_0xef24('0x53')][_0xef24('0x54')]};}var _0x1da35f=md5(JSON[_0xef24('0x55')](_0x5dd2ec));if(_0x175f44[_0xef24('0x3')]!==_0x1da35f){_0x175f44[_0xef24('0x3')]=_0x1da35f;emit(util[_0xef24('0x56')](_0xef24('0x57'),_0x5dd2ec[_0xef24('0x54')]),_0xef24('0x58'),_0x5dd2ec);}}}function emitVoiceQueueChannelRemove(_0x231b79){logger['info'](_0xef24('0x59'),JSON[_0xef24('0x55')](_0x231b79));emit(util['format'](_0xef24('0x57'),_0x231b79[_0xef24('0x54')]),'voice_queue_channel:remove',_0x231b79);io['emit'](_0xef24('0x5a'),_0x231b79);}function notSendMessagesQueue(_0x2bdbaa){if(_0x2bdbaa['sendMessageOneNotActive']){if(_0x2bdbaa[_0xef24('0x4b')]===0x0&&_0x2bdbaa[_0xef24('0x2b')]===0x0){_0x2bdbaa[_0xef24('0x5b')]=![];_0x2bdbaa[_0xef24('0x29')]=0x0;_0x2bdbaa[_0xef24('0x5c')]=0x0;_0x2bdbaa['message']=_0xef24('0x5d');ut[_0xef24('0x5e')](_0xef24('0x5f'),_0x2bdbaa[_0xef24('0x54')]+_0xef24('0x60'));}else{_0x2bdbaa[_0xef24('0x4a')]='IS_DISACTIVED';ut[_0xef24('0x5e')](_0xef24('0x5f'),_0x2bdbaa[_0xef24('0x54')]+_0xef24('0x61'));}emitCampaignPreview(_0x2bdbaa);}}Preview[_0xef24('0xf')][_0xef24('0x62')]=function(){var _0x15bac2=this;setInterval(function(){_0x15bac2[_0xef24('0x63')]();},0x7cf);};Preview[_0xef24('0xf')]['syncCampaigns']=function(){var _0x210b14=this[_0xef24('0x14')];this[_0xef24('0x19')]+=0x1;for(var _0x50653d in _0x210b14){if(_0x210b14[_0xef24('0x64')](_0x50653d)&&(_0x210b14[_0x50653d][_0xef24('0x34')]==='preview'||_0x210b14[_0x50653d][_0xef24('0x34')]==='booked')&&_0x210b14[_0x50653d][_0xef24('0x30')]==='outbound'){if(this[_0xef24('0x19')]>0x7){this[_0xef24('0x19')]=0x0;this[_0xef24('0x65')]();}}if(_0x210b14[_0xef24('0x64')](_0x50653d)&&_0x210b14[_0x50653d]['dialMethod']===_0xef24('0x7')&&_0x210b14[_0x50653d]['type']===_0xef24('0x26')){if(_0x210b14[_0x50653d][_0xef24('0x33')]){this['setMessage'](_0x210b14[_0x50653d]);this['recallMe'](_0x210b14[_0x50653d]);}else{notSendMessagesQueue(_0x210b14[_0x50653d]);}}}};Preview[_0xef24('0xf')][_0xef24('0x66')]=function(_0x43d502){var _0x1f9409=this;this[_0xef24('0x13')]['enqueue'](function(){if(!_['isNil'](_0x1f9409[_0xef24('0x17')][_0x43d502])){loggerAction[_0xef24('0x67')](_0xef24('0x68'),_0x43d502,_0xef24('0x69'),_0x1f9409[_0xef24('0x17')][_0x43d502]['queue'],'originated:\x20',JSON[_0xef24('0x55')](_0x1f9409['campaignsPreview'][_0x1f9409['actions'][_0x43d502]['queue']][_0xef24('0x4b')]),'pTalking:\x20',JSON['stringify'](_0x1f9409[_0xef24('0x14')][_0x1f9409[_0xef24('0x17')][_0x43d502][_0xef24('0x6a')]][_0xef24('0x2b')]),JSON['stringify'](_0x1f9409[_0xef24('0x17')][_0x43d502][_0xef24('0x6b')]),JSON['stringify'](_[_0xef24('0x6c')](_0x1f9409[_0xef24('0x17')][_0x43d502],[_0xef24('0x6d'),_0xef24('0x6e'),_0xef24('0x6f'),_0xef24('0x70')])));return ami[_0xef24('0x71')]({'action':_0xef24('0x72'),'channel':_0x1f9409['actions'][_0x43d502][_0xef24('0x73')]})[_0xef24('0x74')](function(_0x41507e){if(_0x41507e[_0xef24('0x4a')]===_0xef24('0x75')){setTimeout(function(){if(_0x1f9409[_0xef24('0x17')][_0x43d502]){ut[_0xef24('0x76')](_0x1f9409[_0xef24('0x14')][_0x1f9409[_0xef24('0x17')][_0x43d502][_0xef24('0x6a')]],_0xef24('0x77'));if(_0x1f9409[_0xef24('0x17')][_0x43d502][_0xef24('0x6b')]===!![]){ut[_0xef24('0x78')](_0x1f9409['campaignsPreview'][_0x1f9409[_0xef24('0x17')][_0x43d502]['queue']],_0xef24('0x77'));ut[_0xef24('0x79')](_0xef24('0x7a')+_0x43d502,_0x1f9409[_0xef24('0x17')][_0x43d502][_0xef24('0x6a')]);}ut['loggerError'](_0xef24('0x7b')+_0x43d502,_0x1f9409['actions'][_0x43d502][_0xef24('0x6a')]);delete _0x1f9409[_0xef24('0x17')][_0x43d502];}},0x2328);}});}});};Preview[_0xef24('0xf')]['clearZombieChannels']=function(){var _0x3c0c4a=this;loggerAction[_0xef24('0x67')](_0xef24('0x7c'),_[_0xef24('0x7d')](this[_0xef24('0x17')]));for(var _0x53f2ee in this[_0xef24('0x17')]){if(_0x3c0c4a[_0xef24('0x17')][_0xef24('0x64')](_0x53f2ee)){_0x3c0c4a[_0xef24('0x66')](_0x53f2ee);}}};Preview[_0xef24('0xf')][_0xef24('0x7e')]=function(_0x218f44){var _0x5e9984=this;rpcDb[_0xef24('0x7f')](_0x218f44['id'],ut[_0xef24('0x80')](this[_0xef24('0x18')]))[_0xef24('0x81')](function(_0x3ae156){if(!_[_0xef24('0x82')](_0x3ae156)){for(var _0x598826=0x0;_0x598826<_0x3ae156[_0xef24('0x83')];_0x598826+=0x1){if(ut[_0xef24('0x84')](_0x3ae156[_0x598826][_0xef24('0x85')])<_0x218f44[_0xef24('0x86')]*0x3c){if(_0x3ae156[_0x598826][_0xef24('0x87')]&&!_0x3ae156[_0x598826][_0xef24('0x87')][_0xef24('0x88')]){_0x5e9984[_0xef24('0x89')](_0x3ae156[_0x598826]['id'])[_0xef24('0x81')](ut['logger2'](_0xef24('0x8a')))[_0xef24('0x74')](ut['logger2'](_0xef24('0x8a')));}else{rpcDb[_0xef24('0x8b')](_0x3ae156[_0x598826]['id']);}}else{var _0x291a7f=new Action(_0x3ae156[_0x598826],_0x218f44);_0x291a7f[_0xef24('0x8c')]=moment()[_0xef24('0x56')](_0xef24('0x8d'));_0x218f44['outboundReCallsDay']+=0x1;ut[_0xef24('0x8e')](_0x291a7f,0x17,_0xef24('0x8f'));if(_0x218f44[_0xef24('0x90')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x3ae156[_0x598826]));rpcDb[_0xef24('0x91')](_0x291a7f,_0xef24('0x92'));}else{ut[_0xef24('0x8e')](_0x291a7f,0x16,'RecallFailedTimeout');rpcDb[_0xef24('0x91')](_0x291a7f,_0xef24('0x93'));rpcDb[_0xef24('0x94')](_0x291a7f,_0xef24('0x93'));}}}}})[_0xef24('0x74')](ut['logger2'](_0xef24('0x95')));};Preview[_0xef24('0xf')][_0xef24('0x96')]=function(_0x2057b0){_0x2057b0[_0xef24('0x5b')]=!![];if(ut[_0xef24('0x97')](_0x2057b0['loggedIn'])){_0x2057b0[_0xef24('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xef24('0x98')](_0x2057b0[_0xef24('0x33')])){_0x2057b0[_0xef24('0x4a')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x2057b0[_0xef24('0x50')])){if(!this['isTrunkReachable'](_0x2057b0[_0xef24('0x99')])){_0x2057b0[_0xef24('0x4a')]=_0xef24('0x9a');}else{_0x2057b0[_0xef24('0x4a')]=_0xef24('0x9b');}}else{_0x2057b0[_0xef24('0x4a')]=_0xef24('0x9b');}emitCampaignPreview(_0x2057b0);};Preview[_0xef24('0xf')][_0xef24('0x9c')]=function(_0x2a40d3,_0x3ca389,_0xcc33e8){var _0x5ca4ae=this;var _0x2139f7=this[_0xef24('0x17')][_0x3ca389];var _0x5eb200=this['campaignsPreview'][_0x2139f7[_0xef24('0x6a')]];var _0x420319;if(_0x5eb200){switch(_0xcc33e8){case'1':_0x5eb200['outboundNoSuchCallsDay']+=0x1;_0x2139f7[_0xef24('0x9d')]+=0x1;_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0x0,'NoSuchNumber');ami[_0xef24('0x25')](_0xef24('0xa0'),ut['buildObj'](_0x2139f7,_0xef24('0xa1')));rpcDb[_0xef24('0x91')](_0x2139f7,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x2139f7)>=_0x5eb200[_0xef24('0xa2')]){_0x420319=ut['cloneAction'](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,_0xef24('0xa4'));}else{if(_0x2139f7[_0xef24('0x9d')]>=_0x5eb200['dialNoSuchNumberMaxRetry']){rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xa4'));}else{rpcDb[_0xef24('0xa5')](ut[_0xef24('0xa6')](_0x2139f7,_0xef24('0x9d'),_0x5eb200[_0xef24('0xa7')]),_0x2139f7[_0xef24('0xa8')],_0x2139f7[_0xef24('0xa9')]);}}delete this[_0xef24('0x17')][_0x2a40d3['linkedid']];break;case _0xef24('0xaa'):var _0x2f1004=moment()[_0xef24('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x2139f7[_0xef24('0xab')]=_0x2f1004;_0x2139f7[_0xef24('0xac')]=_0x2f1004;_0x2139f7[_0xef24('0x6b')]=!![];_0x5eb200[_0xef24('0x2b')]+=0x1;logger['info'](_0xef24('0xad'),_0x2139f7[_0xef24('0xae')],_0xef24('0xaf'),_0x5eb200['name'],_0xef24('0xb0'),_0x5eb200['pTalking']);ami[_0xef24('0x25')](_0xef24('0xb1'),ut[_0xef24('0xb2')](_0x2139f7,_0xef24('0xb3'),this[_0xef24('0x14')][_0x2139f7[_0xef24('0x6a')]]));if(_0x5eb200[_0xef24('0xb4')]){ami[_0xef24('0x25')]('custom:agentConnectPreview',ut[_0xef24('0xb5')](_0x2139f7));}break;case'16':ami[_0xef24('0x25')]('custom:agentcomplete',ut[_0xef24('0xb2')](_0x2139f7,'complete',this['campaignsPreview'][_0x2139f7[_0xef24('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0xef24('0xb2')](_0x2139f7,_0xef24('0xb6')));_0x5eb200['outboundAnswerCallsDay']+=0x1;_0x5eb200['total']+=0x1;_0x5eb200[_0xef24('0x28')]+=0x1;ut[_0xef24('0x78')](_0x5eb200,_0xef24('0xb7'));_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut['logCustomer'](_0x2139f7,0x4,'Answer');rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xb8'));rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xb9'));rpcDb['crateCustomerReportQueue'](_0x2139f7);_0x5eb200['sumDuration']+=_0x2139f7[_0xef24('0xba')];_0x5eb200[_0xef24('0x2c')]+=_0x2139f7[_0xef24('0xba')];logger[_0xef24('0x67')](_0xef24('0xbb'),_0x2139f7[_0xef24('0xae')],_0xef24('0xaf'),_0x5eb200[_0xef24('0x54')],_0xef24('0xb0'),_0x5eb200[_0xef24('0x2b')]);delete this[_0xef24('0x17')][_0x2a40d3[_0xef24('0xbc')]];break;case'BUSY':_0x5eb200[_0xef24('0x39')]+=0x1;_0x2139f7[_0xef24('0xbd')]+=0x1;_0x2139f7[_0xef24('0x9e')]=ut['totalGlobal'](_0x2139f7);ut['logCustomer'](_0x2139f7,0x5,_0xef24('0xbe'));ami[_0xef24('0x25')]('custom:agentbusy',ut['buildObj'](_0x2139f7,_0xef24('0xbf')));rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xc0'));if(ut[_0xef24('0x9f')](_0x2139f7)>=_0x5eb200[_0xef24('0xa2')]){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,_0xef24('0xc2'));}else{if(_0x2139f7[_0xef24('0xbd')]>=_0x5eb200[_0xef24('0xc3')]){rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xc0'));}else{rpcDb[_0xef24('0xa5')](ut[_0xef24('0xa6')](_0x2139f7,_0xef24('0xbd'),_0x5eb200[_0xef24('0xc4')]),_0x2139f7['unlockAgent'],_0x2139f7[_0xef24('0xa9')]);}}break;case'NOANSWER':_0x5eb200[_0xef24('0x3d')]+=0x1;_0x2139f7[_0xef24('0xc5')]+=0x1;_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0x3,_0xef24('0xc6'));ami[_0xef24('0x25')](_0xef24('0xc7'),ut[_0xef24('0xb2')](_0x2139f7,_0xef24('0xc8')));rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xc9'));if(ut['totalGlobal'](_0x2139f7)>=_0x5eb200['dialGlobalMaxRetry']){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,_0xef24('0xca'));}else{if(_0x2139f7[_0xef24('0xc5')]>=_0x5eb200['dialNoAnswerMaxRetry']){rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xc9'));}else{rpcDb[_0xef24('0xa5')](ut['scheduledAt'](_0x2139f7,'countnoanswerretry',_0x5eb200[_0xef24('0xcb')]),_0x2139f7[_0xef24('0xa8')],_0x2139f7[_0xef24('0xa9')]);}}break;case _0xef24('0xcc'):_0x5eb200[_0xef24('0x3a')]+=0x1;_0x2139f7[_0xef24('0xcd')]+=0x1;_0x2139f7['countglobal']=ut[_0xef24('0x9f')](_0x2139f7);ut['logCustomer'](_0x2139f7,0x8,_0xef24('0xce'));ami[_0xef24('0x25')]('custom:agentcongestion',ut[_0xef24('0xb2')](_0x2139f7,_0xef24('0xcf')));rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xd0'));if(ut[_0xef24('0x9f')](_0x2139f7)>=_0x5eb200[_0xef24('0xa2')]){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2139f7[_0xef24('0xcd')]>=_0x5eb200[_0xef24('0xd1')]){rpcDb['createCustomerFinal'](_0x2139f7,_0xef24('0xd0'));}else{rpcDb[_0xef24('0xa5')](ut[_0xef24('0xa6')](_0x2139f7,_0xef24('0xcd'),_0x5eb200['dialBusyRetryFrequency']),_0x2139f7[_0xef24('0xa8')],_0x2139f7[_0xef24('0xa9')]);}}break;case _0xef24('0xd2'):_0x5eb200[_0xef24('0x40')]+=0x1;_0x2139f7[_0xef24('0xd3')]+=0x1;_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0x14,'AgentReject');ami['emit']('custom:agentreject',ut[_0xef24('0xb2')](_0x2139f7,_0xef24('0xd4')));rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xd5'));if(ut[_0xef24('0x9f')](_0x2139f7)>=_0x5eb200[_0xef24('0xa2')]){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0x14,'AgentReject');rpcDb[_0xef24('0x94')](_0x420319,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2139f7[_0xef24('0xd3')]>=_0x5eb200[_0xef24('0xd6')]){rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xd7'));}else{rpcDb[_0xef24('0xa5')](ut[_0xef24('0xa6')](_0x2139f7,_0xef24('0xd3'),_0x5eb200[_0xef24('0xd8')]),_0x2139f7[_0xef24('0xa8')],_0x2139f7['activeContact']);}}break;case _0xef24('0xd9'):_0x5eb200['outboundAbandonedCallsDay']+=0x1;_0x2139f7['countabandonedretry']+=0x1;_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0xb,_0xef24('0xda'));rpcDb['createCustomerHistory'](_0x2139f7,_0xef24('0xdb'));if(ut['totalGlobal'](_0x2139f7)>=_0x5eb200[_0xef24('0xa2')]){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2139f7[_0xef24('0xdc')]>=_0x5eb200[_0xef24('0xdd')]){rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xdb'));}else{rpcDb[_0xef24('0xa5')](ut[_0xef24('0xa6')](_0x2139f7,'countabandonedretry',_0x5eb200[_0xef24('0xde')]),_0x2139f7['unlockAgent'],_0x2139f7[_0xef24('0xa9')]);}}break;case'18':_0x5eb200['outboundUnknownCallsDay']+=0x1;_0x2139f7[_0xef24('0xdf')]+=0x1;_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0x12,_0x2a40d3[_0xef24('0xe0')]||_0x2a40d3[_0xef24('0xe1')]);ami[_0xef24('0x25')](_0xef24('0xe2'),ut[_0xef24('0xb2')](_0x2139f7,'amd'));rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xe3'));if(ut[_0xef24('0x9f')](_0x2139f7)>=_0x5eb200[_0xef24('0xa2')]){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,'Global');rpcDb[_0xef24('0x94')](_0x420319,_0xef24('0xe3'));}else{rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xe3'));}delete this[_0xef24('0x17')][_0x2a40d3[_0xef24('0xbc')]];break;case'19':_0x5eb200[_0xef24('0x41')]+=0x1;_0x2139f7['countglobal']=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0x13,_0x2a40d3[_0xef24('0xe0')]||_0x2a40d3['dialstatus']);ami[_0xef24('0x25')](_0xef24('0xe2'),ut['buildObj'](_0x2139f7,_0xef24('0xe4')));rpcDb['createCustomerHistory'](_0x2139f7,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x2139f7)>=_0x5eb200['dialGlobalMaxRetry']){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,_0xef24('0xe5'));}else{rpcDb[_0xef24('0x94')](_0x2139f7,_0xef24('0xe5'));}delete this[_0xef24('0x17')][_0x2a40d3[_0xef24('0xbc')]];break;default:if(_0x2139f7[_0xef24('0x6b')]){ut[_0xef24('0x78')](_0x5eb200,'[default]');ut[_0xef24('0x79')](_0xef24('0xe6')+_0x5eb200['name'],_0x2a40d3);}_0x5eb200[_0xef24('0x41')]+=0x1;_0x2139f7[_0xef24('0x9e')]=ut[_0xef24('0x9f')](_0x2139f7);ut[_0xef24('0x8e')](_0x2139f7,0xc,_0x2a40d3[_0xef24('0xe0')]||_0x2a40d3[_0xef24('0xe1')]);rpcDb[_0xef24('0x91')](_0x2139f7,_0xef24('0xe7'));if(ut[_0xef24('0x9f')](_0x2139f7)>=_0x5eb200['dialGlobalMaxRetry']){_0x420319=ut[_0xef24('0xc1')](_0x2139f7,0xf,_0xef24('0xa3'));rpcDb[_0xef24('0x94')](_0x420319,_0xef24('0xe8'));}else{rpcDb['createCustomerFinal'](_0x2139f7,_0xef24('0xe8'));}delete this['actions'][_0x2a40d3[_0xef24('0xbc')]];}if(!(_0x2139f7[_0xef24('0x6b')]&&_0xcc33e8==='16')){ut[_0xef24('0x76')](_0x5eb200,_0xef24('0xe9'));logger[_0xef24('0x67')](_0xef24('0xea'),_0x2139f7[_0xef24('0xae')],_0xef24('0xaf'),_0x5eb200[_0xef24('0x54')],_0xef24('0xeb'),_0x5eb200[_0xef24('0x4b')]);}if(_0xcc33e8!=='ANSWER'){delete this[_0xef24('0x17')][_0x2a40d3[_0xef24('0xbc')]];delete this[_0xef24('0x17')][_0x2a40d3['destlinkedid']];}}};Preview[_0xef24('0xf')][_0xef24('0xec')]=function(_0xaa2fe3,_0x274461,_0x41dba2){if(_[_0xef24('0xed')](_0x274461)&&_0xef24('0xee')!==typeof _0x274461){return;}if(_[_0xef24('0xed')](_0x41dba2)&&_0xef24('0xee')!==typeof _0x41dba2){return;}switch(_0x41dba2['reason']){case'0':ut[_0xef24('0xef')](_0xaa2fe3,0x0,'NoSuchNumber');rpcDb[_0xef24('0xf0')](_0xaa2fe3,_0xef24('0xf1'));break;case'3':ut[_0xef24('0xef')](_0xaa2fe3,0x3,_0xef24('0xc6'));rpcDb[_0xef24('0xf0')](_0xaa2fe3,_0xef24('0xf2'));break;case'5':ut[_0xef24('0xef')](_0xaa2fe3,0x5,_0xef24('0xbe'));rpcDb[_0xef24('0xf0')](_0xaa2fe3,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xef24('0xef')](_0xaa2fe3,0x8,_0xef24('0xce'));rpcDb['createAgentHistory'](_0xaa2fe3,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0xaa2fe3,0x16,_0xef24('0xf3'));rpcDb[_0xef24('0xf0')](_0xaa2fe3,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xef24('0xef')](_0xaa2fe3,0xc,_0x41dba2[_0xef24('0xf4')]);rpcDb['createAgentHistory'](_0xaa2fe3,_0xef24('0xf5'));}ut['updateOriginated'](_0x274461,_0xef24('0xf6'));logger[_0xef24('0x67')](_0xef24('0xf7'),_0xaa2fe3['uniqueid'],_0xef24('0xaf'),_0x274461[_0xef24('0x54')],_0xef24('0xeb'),_0x274461[_0xef24('0x4b')]);delete this[_0xef24('0x17')][_0xaa2fe3['uniqueid']];};Preview[_0xef24('0xf')][_0xef24('0xf8')]=function(_0x14933d,_0x4a0084,_0x302e9f,_0x2525fd,_0x1e64b5){var _0x154272=this;return new BPromise(function(_0x592c10,_0x136677){if(_[_0xef24('0x82')](_0x4a0084)||_[_0xef24('0x82')](_0x4a0084['Contact'])||_[_0xef24('0x82')](_0x4a0084['Contact'][_0xef24('0xf9')])||_[_0xef24('0x82')](_0x4a0084[_0xef24('0x6f')])){_0x136677(ut[_0xef24('0x4a')](_0xef24('0xfa'),_0x2525fd,_0x1e64b5));return;}var _0x3dfa29=uuid['v4']();var _0x972538=_0x154272['campaignsPreview'][_0x4a0084[_0xef24('0x69')][_0xef24('0x54')]];var _0x7d2cd=_0x302e9f?_0x154272['agents'][_0x302e9f]['id']:undefined;_0x154272['actions'][_0x3dfa29]=new Action(_0x4a0084,_0x972538,_0x3dfa29,_0x302e9f,_0x7d2cd);var _0x84270a=_0x154272[_0xef24('0x17')][_0x3dfa29];_0x84270a[_0xef24('0xa8')]=_0x2525fd;_0x84270a['activeContact']=_0x1e64b5;_0x84270a[_0xef24('0xfb')]=_0x302e9f;if(_['isEmpty'](_0x14933d)){_0x154272[_0xef24('0xfc')](_0x84270a,_0x972538,_0x4a0084,_0x302e9f)['then'](function(_0x13fea5){logger[_0xef24('0x67')]('[Preview][execCall][success]',_0xef24('0xfd')+_0x84270a[_0xef24('0x6a')]+_0xef24('0xfe')+_0x84270a[_0xef24('0xff')],JSON[_0xef24('0x55')](_0x13fea5));ami[_0xef24('0x25')](_0xef24('0x100'),ut[_0xef24('0xb2')](_0x84270a,_0xef24('0x101'),_0x154272[_0xef24('0x14')][_0x84270a['queue']]));_0x592c10(ut[_0xef24('0x4a')](_0xef24('0x102')));})[_0xef24('0x74')](function(_0x4311f3){ut[_0xef24('0x5e')]('[Preview][execCall][failure]',_0x4311f3);_0x136677(ut[_0xef24('0x4a')](_0xef24('0x103'),_0x2525fd,_0x1e64b5));});}else{_0x972538[_0xef24('0x38')]+=0x1;ut[_0xef24('0x104')](_0x84270a);rpcDb[_0xef24('0x105')](_0x84270a,_0xef24('0x106'));delete _0x154272['actions'][_0x3dfa29];_0x136677(ut[_0xef24('0x4a')](_0xef24('0x107'),_0x2525fd,_0x1e64b5));}});};Preview['prototype'][_0xef24('0x108')]=function(_0x402853){return!_[_0xef24('0x82')](_0x402853)&&!_[_0xef24('0x82')](_0x402853[_0xef24('0x54')])&&!_[_0xef24('0x82')](_0x402853[_0xef24('0x51')])&&_0x402853[_0xef24('0x51')]&&!_['isNil'](this[_0xef24('0x16')][util['format'](_0xef24('0x109'),_0x402853[_0xef24('0x54')])])&&!_[_0xef24('0x82')](this[_0xef24('0x16')][util[_0xef24('0x56')](_0xef24('0x109'),_0x402853['name'])][_0xef24('0x72')])&&(this[_0xef24('0x16')][util['format'](_0xef24('0x109'),_0x402853[_0xef24('0x54')])][_0xef24('0x72')]===_0xef24('0x10a')||this[_0xef24('0x16')][util['format'](_0xef24('0x109'),_0x402853[_0xef24('0x54')])]['status']===_0xef24('0x10b'));};Preview[_0xef24('0xf')][_0xef24('0x89')]=function(_0x31dcee,_0x3940e1){var _0x322f9b=this;return new BPromise(function(_0x33839a,_0x458496){_0x322f9b[_0xef24('0x10c')](_0x31dcee,_0x3940e1)[_0xef24('0x81')](function(_0x813a59){_0x33839a(_[_0xef24('0x6c')](_0x813a59,[_0xef24('0x4a')]));})[_0xef24('0x74')](function(_0x337121){if(_0x337121['unlock']){rpcDb[_0xef24('0x10d')](_0x31dcee);}if(_0x337121['active']){rpcDb[_0xef24('0x8b')](_0x31dcee);}_0x458496(_[_0xef24('0x6c')](_0x337121,[_0xef24('0x4a')]));});});};Preview[_0xef24('0xf')][_0xef24('0x10c')]=function(_0x3fa2df,_0x536c62){var _0xcb7655=this;return new BPromise(function(_0x3f5f85,_0x2abba3){var _0x4dfec4,_0x4e3e0f;rpcDb[_0xef24('0x10e')](_0x3fa2df)[_0xef24('0x81')](function(_0x2b1281){if(!_['isNil'](_0x2b1281[0x0])){_0x4e3e0f=_0x2b1281[0x0][_0xef24('0x10f')]?![]:!![];_0x4dfec4=_0x2b1281[0x0][_0xef24('0x10f')]?!![]:![];_0x4dfec4=_0x536c62?!![]:_0x4dfec4;}var _0x444812=_0xcb7655[_0xef24('0x110')](_0x2b1281);if(_0x444812['isValid']){rpcDb[_0xef24('0x111')](_[_0xef24('0x6c')](_0x2b1281[0x0],[_0xef24('0x6f'),_0xef24('0x112')]))[_0xef24('0x81')](function(_0xeeff0){_0xcb7655[_0xef24('0xf8')](_0xeeff0,_0x2b1281[0x0],_0x536c62,_0x4e3e0f,_0x4dfec4)[_0xef24('0x81')](function(_0x253147){_0x3f5f85(_0x253147);})[_0xef24('0x74')](function(_0x3f662b){_0x2abba3(_0x3f662b);});})[_0xef24('0x74')](function(_0x9f047){ut[_0xef24('0x5e')]('[Preview][checkIsBlackList]',_0x9f047);_0x2abba3(ut['message'](_0xef24('0x113'),_0x4e3e0f,_0x4dfec4));});}else{_0x2abba3(ut[_0xef24('0x4a')](_0x444812[_0xef24('0x4a')],_0x4e3e0f,_0x4dfec4));}})[_0xef24('0x74')](function(_0x40b4b6){ut[_0xef24('0x5e')](_0xef24('0x114'),_0x40b4b6);_0x2abba3(ut['message'](_0xef24('0x113'),![],!![]));});});};Preview['prototype'][_0xef24('0x110')]=function(_0x124682){if(_[_0xef24('0x82')](_0x124682)||_[_0xef24('0x115')](_0x124682)||!_[_0xef24('0x82')](_0x124682[0x0][_0xef24('0x87')])&&_['isNil'](_0x124682[0x0][_0xef24('0x87')]['name'])){ut[_0xef24('0x5e')]('[Preview][validateContact][Empty\x20Contact]',_0x124682);return{'isValid':![],'message':_0xef24('0x116')};}var _0x3281a0=this[_0xef24('0x14')][_0x124682[0x0][_0xef24('0x69')][_0xef24('0x54')]];_0x3281a0[_0xef24('0x4a')]='ACTIVE';if(_['isNil'](_0x3281a0)){ut[_0xef24('0x5e')](_0xef24('0x117'),_0x3281a0);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xef24('0x108')](_0x3281a0[_0xef24('0x50')])){ut[_0xef24('0x5e')](_0xef24('0x118'),_0xef24('0x119')+_0x3281a0[_0xef24('0x54')]+_0xef24('0x11a'));if(!this[_0xef24('0x108')](_0x3281a0[_0xef24('0x99')])){ut[_0xef24('0x5e')](_0xef24('0x118'),_0x3281a0['name']+_0xef24('0x11b'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xef24('0x98')](_0x3281a0[_0xef24('0x33')])){ut['logger'](_0xef24('0x11c'),_0x3281a0['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xef24('0x119')+_0x3281a0[_0xef24('0x54')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xef24('0x11d')};};Preview['prototype'][_0xef24('0xfc')]=function(_0x419f3a,_0x30374a,_0x1f8895,_0x1d3334){var _0x5e964b=this;return new BPromise(function(_0x30c383,_0x56af0d){var _0x54016a=_0x419f3a[_0xef24('0xae')];var _0x194c3f=_0x5e964b['isTrunkReachable'](_0x30374a[_0xef24('0x50')])?util[_0xef24('0x56')](_0xef24('0x11e'),_0x30374a[_0xef24('0x50')][_0xef24('0x54')],_[_0xef24('0x82')](_0x30374a[_0xef24('0x37')])?'':_0x30374a['dialPrefix'][_0xef24('0x11f')]()||'',_0x30374a[_0xef24('0x120')]>0x0?_0x1f8895[_0xef24('0x121')]['phone'][_0xef24('0x122')](_0x30374a['dialCutDigit']):_0x1f8895[_0xef24('0x121')][_0xef24('0xf9')]):util[_0xef24('0x56')](_0xef24('0x11e'),_[_0xef24('0x82')](_0x30374a[_0xef24('0x99')])?_0x30374a['Trunk']['name']:_0x30374a['TrunkBackup'][_0xef24('0x54')],_[_0xef24('0x82')](_0x30374a[_0xef24('0x37')])?'':_0x30374a[_0xef24('0x37')][_0xef24('0x11f')]()||'',_0x30374a['dialCutDigit']>0x0?_0x1f8895[_0xef24('0x121')][_0xef24('0xf9')][_0xef24('0x122')](_0x30374a['dialCutDigit']):_0x1f8895['Contact'][_0xef24('0xf9')]);var _0x2d1b0a=_0x5e964b[_0xef24('0x108')](_0x30374a['Trunk'])?ut[_0xef24('0x123')](_0x30374a['Trunk'][_0xef24('0x52')],_0x30374a[_0xef24('0x35')],_0x30374a[_0xef24('0x124')]>0x0?ut['getCallerIdRandom'](_0x30374a[_0xef24('0x125')],_0x30374a[_0xef24('0x124')]):_0x30374a[_0xef24('0x125')]):ut[_0xef24('0x123')](_[_0xef24('0x82')](_0x30374a[_0xef24('0x99')])?_0x30374a[_0xef24('0x50')][_0xef24('0x52')]:_0x30374a['TrunkBackup']['callerid'],_0x30374a['dialOriginateCallerIdName'],_0x30374a[_0xef24('0x124')]>0x0?ut[_0xef24('0x126')](_0x30374a[_0xef24('0x125')],_0x30374a[_0xef24('0x124')]):_0x30374a['dialOriginateCallerIdNumber']);if(_0x2d1b0a){_0x419f3a['originatecalleridname']=ut[_0xef24('0x127')](_0x2d1b0a);_0x419f3a['originatecalleridnum']=ut[_0xef24('0x128')](_0x2d1b0a);}var _0x3d8f25=ut[_0xef24('0x129')](_0x30374a,_0x1f8895,_0x194c3f,_0x2d1b0a,_0x54016a,_0x419f3a);_[_0xef24('0x12a')](_0x419f3a,ut[_0xef24('0x12b')](_0x3d8f25));_0x419f3a[_0xef24('0x8c')]=moment()[_0xef24('0x56')](_0xef24('0x8d'));ami[_0xef24('0x71')](ut[_0xef24('0x12c')](_0x419f3a,_0x30374a,_0x3d8f25,_0x419f3a['activeContact'],_0x1d3334))[_0xef24('0x81')](function(_0x91c261){var _0x22a168=_0x419f3a[_0xef24('0x12d')];if(!_['isNil'](_0x22a168)){if(!_[_0xef24('0x82')](_0x5e964b[_0xef24('0x18')][_0x22a168])){_0x5e964b[_0xef24('0x18')][_0x22a168][_0xef24('0x12e')]=_0x419f3a['calleridnum'];emit(util['format']('user:%s',_0x5e964b[_0xef24('0x18')][_0x22a168][_0xef24('0x54')]),_0xef24('0x12f'),{'destaccountcode':_0x5e964b['agents'][_0x22a168][_0xef24('0x130')],'destconnectedlinenum':_0x419f3a[_0xef24('0x131')]});}}_0x30374a[_0xef24('0x4b')]+=0x1;logger[_0xef24('0x67')](_0xef24('0x132'),_0x54016a,_0xef24('0xaf'),_0x30374a['name'],'originated:\x20',_0x30374a[_0xef24('0x4b')]);_0x30c383(_0x91c261);})[_0xef24('0x74')](function(_0x145757){ut[_0xef24('0xef')](_0x419f3a,0xe,_0xef24('0x133'));rpcDb[_0xef24('0xf0')](_0x419f3a,_0xef24('0x134'));_0x56af0d(_0x145757);});});};Preview['prototype'][_0xef24('0x135')]=function(_0x52cf19){if(this['actions'][_0x52cf19['linkedid']]){this['actions'][_0x52cf19[_0xef24('0xbc')]][_0xef24('0x73')]=_0x52cf19['channel'];}};Preview[_0xef24('0xf')][_0xef24('0x1b')]=function(_0x59a2e9){var _0x169ed1=this;var _0x231a3b=this[_0xef24('0x17')][_0x59a2e9[_0xef24('0x136')]];if(_0x231a3b){if(_0x231a3b['lookAgent']&&this[_0xef24('0x18')][_0x231a3b['lookAgent']]){ut['logLookAgent'](_0x231a3b,this[_0xef24('0x18')][_0x231a3b[_0xef24('0xfb')]]['name'],this['agents'][_0x231a3b[_0xef24('0xfb')]]['id']);}var _0x4f36be=_[_0xef24('0x137')](_0x231a3b);_0x4f36be['responsetime']=moment()[_0xef24('0x56')](_0xef24('0x8d'));var _0x47f364=_0x169ed1[_0xef24('0x14')][_0x231a3b['queue']];if(ut[_0xef24('0x138')](_0x59a2e9['response'])){if(_0x231a3b[_0xef24('0xa8')]){rpcDb[_0xef24('0x10d')](_0x231a3b[_0xef24('0xff')]);}if(_0x231a3b[_0xef24('0xa9')]){rpcDb['disableContact'](_0x231a3b[_0xef24('0xff')]);}ami[_0xef24('0x25')](_0xef24('0x139'),ut[_0xef24('0xb2')](_0x231a3b,_0xef24('0x13a'),this[_0xef24('0x14')][_0x231a3b[_0xef24('0x6a')]]));this[_0xef24('0xec')](_0x4f36be,_0x47f364,_0x59a2e9);}else{_0x231a3b['starttime']=moment()[_0xef24('0x56')](_0xef24('0x8d'));ut[_0xef24('0xef')](_0x4f36be,0x4,_0xef24('0x13b'));rpcDb[_0xef24('0xf0')](_0x4f36be,_0xef24('0x13c'));}}};Preview['prototype'][_0xef24('0x1d')]=function(_0x4ddc32){var _0x4b855b=this;var _0x33380c=this[_0xef24('0x17')][_0x4ddc32['linkedid']];var _0x4163cd;if(_0x33380c){_0x4163cd=this[_0xef24('0x14')][_0x33380c[_0xef24('0x6a')]];logger['info'](_0xef24('0x13d'),_0x4ddc32[_0xef24('0xbc')],_0xef24('0xaf'),_0x4163cd[_0xef24('0x54')],'pTalking:\x20',_0x4163cd[_0xef24('0x2b')]);}if(this[_0xef24('0x17')][_0x4ddc32[_0xef24('0xbc')]]&&_0x4ddc32[_0xef24('0xbc')]!==_0x4ddc32[_0xef24('0xae')]){if(_0x4ddc32[_0xef24('0x13e')]==='16'&&this['actions'][_0x4ddc32[_0xef24('0xbc')]][_0xef24('0x6b')]){this[_0xef24('0x9c')](_0x4ddc32,_0x4ddc32['linkedid'],_0x4ddc32['cause']);}else if(this[_0xef24('0x17')][_0x4ddc32[_0xef24('0xbc')]][_0xef24('0x6b')]){logger[_0xef24('0x67')](_0xef24('0x13f'),_0x4ddc32['linkedid'],_0x4ddc32[_0xef24('0x13e')],_0xef24('0xaf'),_0x4163cd[_0xef24('0x54')],_0xef24('0xb0'),_0x4163cd[_0xef24('0x2b')]);this[_0xef24('0x9c')](_0x4ddc32,_0x4ddc32[_0xef24('0xbc')],_0x4ddc32[_0xef24('0x13e')]);}}else if(_0x33380c&&_[_0xef24('0x82')](_0x33380c[_0xef24('0x140')])&&_0x4163cd[_0xef24('0x141')]&&_0x4ddc32[_0xef24('0xbc')]===_0x4ddc32[_0xef24('0xae')]&&_[_0xef24('0x82')](_0x4ddc32[_0xef24('0xf4')])&&_0x4ddc32[_0xef24('0x13e')]==='16'&&_0x4ddc32[_0xef24('0x142')]==='6'&&_[_0xef24('0xed')](_0x33380c[_0xef24('0x143')])){if(_0x33380c['unlockAgent']){rpcDb[_0xef24('0x10d')](_0x33380c['idContact']);}if(_0x33380c['activeContact']){rpcDb[_0xef24('0x8b')](_0x33380c[_0xef24('0xff')]);}_0x4ddc32[_0xef24('0xf4')]='22';this[_0xef24('0xec')](_0x33380c,_0x4163cd,_0x4ddc32);}else if(_0x33380c&&_0x33380c[_0xef24('0x143')]){if(_0x4ddc32[_0xef24('0x13e')]==='16'&&this[_0xef24('0x17')][_0x4ddc32['linkedid']][_0xef24('0x6b')]){logger[_0xef24('0x67')]('[syncHangup][talking][transfer]',_0x4ddc32[_0xef24('0xbc')],_0x4ddc32[_0xef24('0x13e')],'\x20Queue',_0x4163cd[_0xef24('0x54')],_0xef24('0xb0'),_0x4163cd[_0xef24('0x2b')]);this[_0xef24('0x9c')](_0x4ddc32,_0x4ddc32[_0xef24('0xbc')],_0x4ddc32[_0xef24('0x13e')]);}else if(this['actions'][_0x4ddc32['linkedid']][_0xef24('0x6b')]){logger[_0xef24('0x67')](_0xef24('0x13f'),_0x4ddc32['linkedid'],_0x4ddc32['cause'],_0xef24('0xaf'),_0x4163cd[_0xef24('0x54')],_0xef24('0xb0'),_0x4163cd[_0xef24('0x2b')]);this[_0xef24('0x9c')](_0x4ddc32,_0x4ddc32[_0xef24('0xbc')],_0x4ddc32['cause']);}}};Preview[_0xef24('0xf')]['syncDialEnd']=function(_0x5aaa29){if(this['actions'][_0x5aaa29[_0xef24('0x144')]]&&_0x5aaa29[_0xef24('0x144')]!==_0x5aaa29['destuniqueid']){this['callProgressDetectingCustomer'](_0x5aaa29,_0x5aaa29[_0xef24('0x144')],_0x5aaa29[_0xef24('0xe1')]);}};Preview['prototype']['syncHangupRequest']=function(_0x5041b8){if(this[_0xef24('0x17')][_0x5041b8['linkedid']]&&_0x5041b8[_0xef24('0xbc')]!==_0x5041b8[_0xef24('0xae')]&&!this[_0xef24('0x17')][_0x5041b8['linkedid']][_0xef24('0x6b')]){if(_0x5041b8['cause']==='1'){this['callProgressDetectingCustomer'](_0x5041b8,_0x5041b8[_0xef24('0xbc')],_0x5041b8['cause']);}}};Preview[_0xef24('0xf')][_0xef24('0x145')]=function(_0x26f0c5,_0x435a71,_0x5d0c36){if(this[_0xef24('0x17')][_0x26f0c5]){if(_[_0xef24('0x82')](this['actions'][_0x26f0c5][_0xef24('0x146')])){this[_0xef24('0x17')][_0x26f0c5][_0xef24('0x146')]={};}this[_0xef24('0x17')][_0x26f0c5][_0xef24('0x146')][_0x435a71]=_0x5d0c36;}};Preview['prototype'][_0xef24('0x21')]=function(_0x50a6ca){try{if(!_[_0xef24('0x82')](_0x50a6ca)){if(ut[_0xef24('0x147')](_['keys'](_0x50a6ca[_0xef24('0x148')])[0x0])){this[_0xef24('0x145')](_0x50a6ca[_0xef24('0xae')],_['keys'](_0x50a6ca['variable'])[0x0],_0x50a6ca[_0xef24('0x149')]);}}}catch(_0x4b60f9){logger[_0xef24('0x14a')]('[syncVarSet][Preview]',util[_0xef24('0x14b')](_0x4b60f9,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xef24('0x23')]=function(_0x4887e0){if(_0x4887e0){if(this['actions'][_0x4887e0[_0xef24('0x14c')]]){this[_0xef24('0x17')][_0x4887e0[_0xef24('0x14c')]][_0xef24('0x143')]=!![];}}};Preview[_0xef24('0xf')][_0xef24('0x24')]=function(_0x317969){if(_0x317969){if(this['actions'][_0x317969[_0xef24('0x14d')]]){this[_0xef24('0x17')][_0x317969['transfererlinkedid']][_0xef24('0x143')]=!![];}}};module[_0xef24('0x14e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 040ab1f..6b8243d 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 _0xe0e0=['calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','membername','COMPLETED','create','[voiceQueueReport]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid'];(function(_0x3e03f7,_0x22c973){var _0x1f26de=function(_0x1a36de){while(--_0x1a36de){_0x3e03f7['push'](_0x3e03f7['shift']());}};_0x1f26de(++_0x22c973);}(_0xe0e0,0xf8));var _0x0e0e=function(_0x40e210,_0x5b9466){_0x40e210=_0x40e210-0x0;var _0x57479a=_0xe0e0[_0x40e210];return _0x57479a;};'use strict';var util=require(_0x0e0e('0x0'));var BPromise=require(_0x0e0e('0x1'));var logger=require(_0x0e0e('0x2'))(_0x0e0e('0x3'));var _=require(_0x0e0e('0x4'));var cmHopper=require(_0x0e0e('0x5'));var cmHopperFinal=require(_0x0e0e('0x6'));var cmHopperHistory=require(_0x0e0e('0x7'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x0e0e('0x8'));var agentReportPreview=require(_0x0e0e('0x9'));var voiceQueueReport=require(_0x0e0e('0xa'));function loggerCatch(_0x2fdc97){return function(_0x85e66d){logger['error'](_0x2fdc97,util[_0x0e0e('0xb')](_0x85e66d,{'showHidden':![],'depth':null}));};}function create(_0x564adf){return BPromise[_0x0e0e('0xc')]()['then'](cmHopperHistory[_0x0e0e('0xd')](_0x564adf))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0xf')));}function createAgent(_0x389ffe){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](agentReportPreview[_0x0e0e('0xd')](_0x389ffe))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0xf')));}function moveContact(_0x53c321){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper[_0x0e0e('0x11')](_0x53c321,!![]))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x12')));}exports['checkIsBlackList']=function(_0x33cb6f){return BPromise[_0x0e0e('0xc')]()['then'](cmHopperBlack[_0x0e0e('0x13')](_0x33cb6f))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x14')));};exports[_0x0e0e('0x15')]=function(_0x5cf4ca){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper[_0x0e0e('0x15')](_0x5cf4ca))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x16')));};exports[_0x0e0e('0xd')]=function(_0x383d16,_0x55967c){create(_0x383d16)[_0x0e0e('0xe')](loggerCatch(_0x55967c));moveContact(_0x383d16)['catch'](loggerCatch(_0x55967c));};exports[_0x0e0e('0x17')]=function(_0x5694db,_0x21c08a){createAgent(_0x5694db)['catch'](loggerCatch(_0x21c08a));};exports['createCustomerHistory']=function(_0xae615e,_0xe7d990){create(_0xae615e)[_0x0e0e('0xe')](loggerCatch(_0xe7d990));};exports[_0x0e0e('0x18')]=function(_0x5d093b,_0x28d839){moveContact(_0x5d093b)[_0x0e0e('0xe')](loggerCatch(_0x28d839));};exports[_0x0e0e('0x19')]=function(_0x119a6a,_0x2eaaba,_0x3f8424){if(_0x2eaaba){_0x119a6a[_0x0e0e('0x1a')]=null;}if(_0x3f8424){_0x119a6a[_0x0e0e('0x1b')]=![];}return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper[_0x0e0e('0x19')](_0x119a6a))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x1c')));};exports[_0x0e0e('0x1d')]=function(_0x3492a8){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper[_0x0e0e('0x1d')](_0x3492a8))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x1e')));};exports[_0x0e0e('0x1f')]=function(_0x4363df){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper[_0x0e0e('0x1f')]({'UserId':null},_0x4363df,0x1))[_0x0e0e('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x0e0e('0x20')]=function(_0x5505a9){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper['unlockContact']({'active':![]},_0x5505a9,0x1))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x21')));};exports[_0x0e0e('0x22')]=function(_0x10c60b){var _0x3b633b={};_0x3b633b[_0x0e0e('0x23')]=_0x10c60b[_0x0e0e('0x23')];_0x3b633b[_0x0e0e('0x24')]=_0x10c60b[_0x0e0e('0x24')];_0x3b633b[_0x0e0e('0x25')]=_0x10c60b[_0x0e0e('0x25')];_0x3b633b[_0x0e0e('0x26')]=_0x10c60b[_0x0e0e('0x26')];_0x3b633b[_0x0e0e('0x27')]=_0x10c60b[_0x0e0e('0x27')];_0x3b633b[_0x0e0e('0x28')]=_0x10c60b[_0x0e0e('0x29')];_0x3b633b[_0x0e0e('0x2a')]=_0x10c60b[_0x0e0e('0x29')];_0x3b633b[_0x0e0e('0x2b')]=0x1;_0x3b633b[_0x0e0e('0x2c')]=_0x10c60b[_0x0e0e('0x2d')];_0x3b633b[_0x0e0e('0x2e')]=_0x10c60b['membername'];_0x3b633b[_0x0e0e('0x2f')]=_0x0e0e('0x30');_0x3b633b[_0x0e0e('0x31')]=_0x0e0e('0x32');_0x3b633b['holdtime']=0x0;_0x3b633b['assigned']=0x1;_0x3b633b['lastAssignedTo']=_0x10c60b[_0x0e0e('0x33')];_0x3b633b['queuecallerexitreason']=_0x0e0e('0x34');return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](voiceQueueReport[_0x0e0e('0x35')](_0x3b633b))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x36')));};exports['getContactRecallMe']=function(_0x423918,_0x5a5cbf){return BPromise[_0x0e0e('0xc')]()['then'](cmHopper['getContactRecallMe'](_0x423918,_0x5a5cbf))[_0x0e0e('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x0e0e('0x37')]=function(_0x5851f8){return BPromise[_0x0e0e('0xc')]()[_0x0e0e('0x10')](cmHopper[_0x0e0e('0x19')](_0x5851f8,!![],!![]))[_0x0e0e('0xe')](loggerCatch(_0x0e0e('0x38')));}; \ No newline at end of file +var _0xbd02=['crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','endtime','connectedlinename','membername','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20'];(function(_0x3c2756,_0x57c13b){var _0x2bf51f=function(_0x362110){while(--_0x362110){_0x3c2756['push'](_0x3c2756['shift']());}};_0x2bf51f(++_0x57c13b);}(_0xbd02,0xb1));var _0x2bd0=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xbd02[_0x1694f5];return _0x5b4321;};'use strict';var util=require(_0x2bd0('0x0'));var BPromise=require(_0x2bd0('0x1'));var logger=require(_0x2bd0('0x2'))(_0x2bd0('0x3'));var _=require(_0x2bd0('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x2bd0('0x5'));var cmHopperHistory=require(_0x2bd0('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x2bd0('0x7'));var agentReportPreview=require(_0x2bd0('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2b9586){return function(_0x193954){logger[_0x2bd0('0x9')](_0x2b9586,util[_0x2bd0('0xa')](_0x193954,{'showHidden':![],'depth':null}));};}function create(_0x39b0ec){return BPromise[_0x2bd0('0xb')]()['then'](cmHopperHistory[_0x2bd0('0xc')](_0x39b0ec))[_0x2bd0('0xd')](loggerCatch(_0x2bd0('0xe')));}function createAgent(_0x5b3fc7){return BPromise['resolve']()[_0x2bd0('0xf')](agentReportPreview[_0x2bd0('0xc')](_0x5b3fc7))[_0x2bd0('0xd')](loggerCatch(_0x2bd0('0xe')));}function moveContact(_0x402bdc){return BPromise[_0x2bd0('0xb')]()[_0x2bd0('0xf')](cmHopper[_0x2bd0('0x10')](_0x402bdc,!![]))['catch'](loggerCatch(_0x2bd0('0x11')));}exports['checkIsBlackList']=function(_0x38f656){return BPromise[_0x2bd0('0xb')]()[_0x2bd0('0xf')](cmHopperBlack[_0x2bd0('0x12')](_0x38f656))[_0x2bd0('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x2bd0('0x13')]=function(_0x92b662){return BPromise[_0x2bd0('0xb')]()['then'](cmHopper['getContactPreview'](_0x92b662))[_0x2bd0('0xd')](loggerCatch(_0x2bd0('0x14')));};exports[_0x2bd0('0xc')]=function(_0x3ea8cc,_0xb5533f){create(_0x3ea8cc)[_0x2bd0('0xd')](loggerCatch(_0xb5533f));moveContact(_0x3ea8cc)[_0x2bd0('0xd')](loggerCatch(_0xb5533f));};exports[_0x2bd0('0x15')]=function(_0x1ef5fa,_0x1e4c64){createAgent(_0x1ef5fa)['catch'](loggerCatch(_0x1e4c64));};exports[_0x2bd0('0x16')]=function(_0x588f15,_0x5b8146){create(_0x588f15)[_0x2bd0('0xd')](loggerCatch(_0x5b8146));};exports[_0x2bd0('0x17')]=function(_0x261b02,_0x69e0c7){moveContact(_0x261b02)['catch'](loggerCatch(_0x69e0c7));};exports['rescheduleContact']=function(_0x584d63,_0x456ff5,_0x541b61){if(_0x456ff5){_0x584d63[_0x2bd0('0x18')]=null;}if(_0x541b61){_0x584d63[_0x2bd0('0x19')]=![];}return BPromise[_0x2bd0('0xb')]()[_0x2bd0('0xf')](cmHopper[_0x2bd0('0x1a')](_0x584d63))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x2bd0('0x1b')]=function(_0x526334){return BPromise[_0x2bd0('0xb')]()[_0x2bd0('0xf')](cmHopper['countReScheduled'](_0x526334))[_0x2bd0('0xd')](loggerCatch(_0x2bd0('0x1c')));};exports[_0x2bd0('0x1d')]=function(_0x479c3b){return BPromise['resolve']()[_0x2bd0('0xf')](cmHopper[_0x2bd0('0x1d')]({'UserId':null},_0x479c3b,0x1))[_0x2bd0('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x1f7138){return BPromise[_0x2bd0('0xb')]()['then'](cmHopper[_0x2bd0('0x1d')]({'active':![]},_0x1f7138,0x1))[_0x2bd0('0xd')](loggerCatch(_0x2bd0('0x1e')));};exports[_0x2bd0('0x1f')]=function(_0x2eb9fb){var _0x5ac21c={};_0x5ac21c[_0x2bd0('0x20')]=_0x2eb9fb[_0x2bd0('0x20')];_0x5ac21c[_0x2bd0('0x21')]=_0x2eb9fb[_0x2bd0('0x21')];_0x5ac21c[_0x2bd0('0x22')]=_0x2eb9fb[_0x2bd0('0x22')];_0x5ac21c[_0x2bd0('0x23')]=_0x2eb9fb['calleridname'];_0x5ac21c['queue']=_0x2eb9fb[_0x2bd0('0x24')];_0x5ac21c['queuecallerjoinAt']=_0x2eb9fb[_0x2bd0('0x25')];_0x5ac21c[_0x2bd0('0x26')]=_0x2eb9fb[_0x2bd0('0x25')];_0x5ac21c['queuecallercomplete']=0x1;_0x5ac21c['queuecallercompleteAt']=_0x2eb9fb[_0x2bd0('0x27')];_0x5ac21c[_0x2bd0('0x28')]=_0x2eb9fb[_0x2bd0('0x29')];_0x5ac21c['context']='from-sip';_0x5ac21c[_0x2bd0('0x2a')]=_0x2bd0('0x2b');_0x5ac21c[_0x2bd0('0x2c')]=0x0;_0x5ac21c[_0x2bd0('0x2d')]=0x1;_0x5ac21c[_0x2bd0('0x2e')]=_0x2eb9fb[_0x2bd0('0x29')];_0x5ac21c['queuecallerexitreason']=_0x2bd0('0x2f');return BPromise[_0x2bd0('0xb')]()[_0x2bd0('0xf')](voiceQueueReport['create'](_0x5ac21c))['catch'](loggerCatch(_0x2bd0('0x30')));};exports[_0x2bd0('0x31')]=function(_0xf63b7,_0x3fd7b3){return BPromise[_0x2bd0('0xb')]()['then'](cmHopper[_0x2bd0('0x31')](_0xf63b7,_0x3fd7b3))[_0x2bd0('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x2bd0('0x32')]=function(_0x4f2d18){return BPromise[_0x2bd0('0xb')]()[_0x2bd0('0xf')](cmHopper[_0x2bd0('0x1a')](_0x4f2d18,!![],!![]))[_0x2bd0('0xd')](loggerCatch(_0x2bd0('0x33')));}; \ 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 304f6fc..2752376 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 _0xad32=['add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','status','reachable','push','getDiff','createBody','CampaignId','filterKey','type','campaigntype','calleridname','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','toUpper','hasOwnProperty','updateOriginated','originated','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat'];(function(_0x162f0a,_0xdc0d95){var _0x5d941d=function(_0x28ef93){while(--_0x28ef93){_0x162f0a['push'](_0x162f0a['shift']());}};_0x5d941d(++_0xdc0d95);}(_0xad32,0x15a));var _0x2ad3=function(_0x16446f,_0x3ae4ae){_0x16446f=_0x16446f-0x0;var _0x1e14e3=_0xad32[_0x16446f];return _0x1e14e3;};'use strict';var util=require('util');var _=require(_0x2ad3('0x0'));var moment=require(_0x2ad3('0x1'));var logger=require(_0x2ad3('0x2'))(_0x2ad3('0x3'));var ipAgi=process[_0x2ad3('0x4')][_0x2ad3('0x5')]||_0x2ad3('0x6');function getSeconds(_0x2e06db,_0x441cdd){var _0x536436=moment(_0x2e06db)[_0x2ad3('0x7')](0x0);var _0x1c45f2=moment(_0x441cdd)[_0x2ad3('0x7')](0x0);return _0x536436[_0x2ad3('0x8')](_0x1c45f2,'seconds');}exports[_0x2ad3('0x9')]=function(_0x237398){return function(_0x5cee46){logger[_0x2ad3('0xa')](_0x237398,util[_0x2ad3('0xb')](_0x5cee46,{'showHidden':![],'depth':null}));};};exports[_0x2ad3('0xc')]=function(_0x3b1a06,_0x55d908){logger[_0x2ad3('0xd')](_0x3b1a06,util[_0x2ad3('0xb')](_0x55d908,{'showHidden':![],'depth':null}));};exports[_0x2ad3('0xe')]=function(_0x574fff,_0x28ae8b){logger[_0x2ad3('0xa')](_0x574fff,util['inspect'](_0x28ae8b,{'showHidden':![],'depth':null}));};exports[_0x2ad3('0xf')]=function(_0x2f8492){return function(_0x2b30a3){logger[_0x2ad3('0xd')](_0x2f8492,util[_0x2ad3('0xb')](_0x2b30a3,{'showHidden':![],'depth':null}));};};exports[_0x2ad3('0x10')]=function(_0x48d11a,_0x546038,_0x5e3138){return{'message':_0x48d11a,'unlock':_0x546038,'active':_0x5e3138};};exports[_0x2ad3('0x11')]=function(_0xa5fc26,_0x3fed4f,_0x2fdd7f){if(!_['isUndefined'](_0x2fdd7f)&&_0x2ad3('0x12')===typeof _0x2fdd7f&&!_[_0x2ad3('0x13')](_0x2fdd7f)){if(!_[_0x2ad3('0x14')](_0x3fed4f)&&_0x2ad3('0x12')===typeof _0x3fed4f&&!_[_0x2ad3('0x13')](_0x3fed4f)){return util['format'](_0x2ad3('0x15'),_0x3fed4f,_0x2fdd7f);}return util[_0x2ad3('0x16')](_0x2ad3('0x15'),_0x2fdd7f,_0x2fdd7f);}if(!_['isUndefined'](_0xa5fc26)&&_0x2ad3('0x12')===typeof _0xa5fc26&&!_[_0x2ad3('0x13')](_0xa5fc26)){return _0xa5fc26;}return _0x2ad3('0x17');};exports[_0x2ad3('0x18')]=function(_0x54281e){if(_[_0x2ad3('0x19')](_0x54281e)){return![];}return _0x54281e;};exports[_0x2ad3('0x1a')]=function(_0x351bec,_0xef8946,_0xdffc3b,_0x26d327,_0x597412,_0x1eb8c3){var _0xdc195a={'XMD-QUEUE':_0xef8946[_0x2ad3('0x1b')]?_0xef8946['Queue'][_0x2ad3('0x1c')]:'','XMD-CALLERID':_0x26d327,'XMD-CALLERID-PREVIEW':_0x1eb8c3?util[_0x2ad3('0x16')](_0x2ad3('0x15'),_0x1eb8c3['calleridname'],_0x1eb8c3['calleridnum']):_0x26d327,'XMD-DIALID':_0x597412,'XMD-CONTACTID':_0xef8946[_0x2ad3('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x26d327,'XMD-VOICEQUEUEID':_0xef8946[_0x2ad3('0x1e')],'XMD-DIALCHANNEL':_0xdffc3b,'XMD-DIALTIMEOUT':_0x351bec[_0x2ad3('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x2ad3('0x16')](_0x2ad3('0x20'),_0x351bec[_0x2ad3('0x21')]?'g':'',_[_0x2ad3('0x13')](_0x351bec['monitor_format'])?'':_0x2ad3('0x22')),'XMD-DIALURL':_0x351bec[_0x2ad3('0x23')]||'','XMD-AGI':_0x351bec[_0x2ad3('0x24')]?util[_0x2ad3('0x16')](_0x2ad3('0x25'),ipAgi,_0x351bec[_0x2ad3('0x24')]):_0x2ad3('0x26'),'XMD-AGIAFTER':_0x351bec[_0x2ad3('0x21')]?util[_0x2ad3('0x16')](_0x2ad3('0x25'),ipAgi,_0x351bec[_0x2ad3('0x21')]):_0x2ad3('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x1eb8c3?_0x1eb8c3[_0x2ad3('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x1eb8c3?_0x1eb8c3['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x351bec[_0x2ad3('0x28')])){_0xdc195a[util[_0x2ad3('0x16')]('%s',_0x2ad3('0x29'))]=_0x351bec[_0x2ad3('0x28')];_0xdc195a[util[_0x2ad3('0x16')]('%s',_0x2ad3('0x2a'))]=_0x597412;}if(_0xef8946&&_0xef8946[_0x2ad3('0x2b')]){for(var _0x1b1d69 in _0xef8946['Contact']){if(_0xef8946['Contact']['hasOwnProperty'](_0x1b1d69)){if(!_['isNil'](_0xef8946['Contact'][_0x1b1d69])&&_0x1b1d69!=='id'&&_0x1b1d69!=='tags'&&_0x1b1d69!==_0x2ad3('0x2c')&&_0x1b1d69!==_0x2ad3('0x2d')){_0xdc195a[util['format'](_0x2ad3('0x2e'),'XMD-',_[_0x2ad3('0x2f')](_0x1b1d69))]=_0xef8946[_0x2ad3('0x2b')][_0x1b1d69];}}}}return _0xdc195a;};exports['toLowerVariables']=function(_0x112124){var _0x1420a0={};for(var _0x1c7c09 in _0x112124){if(_0x112124[_0x2ad3('0x30')](_0x1c7c09)){_0x1420a0[util[_0x2ad3('0x16')]('%s',_['toLower'](_0x1c7c09))]=_0x112124[_0x1c7c09];}}return{'variables':_0x1420a0};};exports[_0x2ad3('0x31')]=function(_0x24739f,_0x3403b3){if(!_[_0x2ad3('0x19')](_0x24739f)){if(_0x24739f['hasOwnProperty'](_0x2ad3('0x32'))){if(_0x24739f[_0x2ad3('0x32')]>0x0){_0x24739f[_0x2ad3('0x32')]-=0x1;}else{logger[_0x2ad3('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3403b3);}}}else{logger[_0x2ad3('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3403b3);}};exports[_0x2ad3('0x33')]=function(_0x132435){var _0x33d386=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x132435[_0x2ad3('0x34')]=0xd;_0x132435[_0x2ad3('0x35')]=_0x2ad3('0x36');_0x132435[_0x2ad3('0x37')]=_0x33d386;_0x132435[_0x2ad3('0x38')]=_0x33d386;_0x132435[_0x2ad3('0x39')]=_0x33d386;};exports[_0x2ad3('0x3a')]=function(_0x52656e,_0x3fad38,_0x9128e9){var _0x3834d0=moment()['format'](_0x2ad3('0x3b'));_0x52656e[_0x2ad3('0x34')]=_0x3fad38;_0x52656e[_0x2ad3('0x35')]=_0x9128e9;_0x52656e[_0x2ad3('0x38')]=_0x3834d0;_0x52656e['ringtime']=getSeconds(_0x52656e[_0x2ad3('0x38')],_0x52656e[_0x2ad3('0x37')]);};exports[_0x2ad3('0x3c')]=function(_0x1e45bc,_0x18c64f,_0x232752){_0x1e45bc[_0x2ad3('0x3d')]=_0x18c64f;_0x1e45bc[_0x2ad3('0x3e')]=_0x232752;};exports[_0x2ad3('0x3f')]=function(_0x41ee86,_0x241fa6,_0x2f6d6b){var _0x1ddb8f=moment()[_0x2ad3('0x16')](_0x2ad3('0x3b'));_0x41ee86[_0x2ad3('0x34')]=_0x241fa6;_0x41ee86[_0x2ad3('0x35')]=_0x2f6d6b;_0x41ee86[_0x2ad3('0x38')]=_0x41ee86[_0x2ad3('0x38')]?_0x41ee86[_0x2ad3('0x38')]:_0x1ddb8f;_0x41ee86[_0x2ad3('0x39')]=_0x41ee86[_0x2ad3('0x39')]?_0x41ee86[_0x2ad3('0x39')]:_0x1ddb8f;_0x41ee86['ringtime']=getSeconds(_0x41ee86['responsetime']||0x0,_0x41ee86[_0x2ad3('0x37')]||0x0);_0x41ee86[_0x2ad3('0x40')]=_0x41ee86['answertime']?getSeconds(_0x41ee86[_0x2ad3('0x39')],_0x41ee86[_0x2ad3('0x41')]):0x0;};exports[_0x2ad3('0x42')]=function(_0x46e82d){return _0x46e82d===_0x2ad3('0x43');};exports[_0x2ad3('0x44')]=function(_0x534341,_0x47eda5,_0x5e5677,_0x274f11,_0x25ca2e){var _0x4fdcac=_0x274f11?_0x2ad3('0x45'):_0x534341['calleridname'];_0x4fdcac=_0x25ca2e?'BOOKED':_0x4fdcac;return{'actionid':_0x534341[_0x2ad3('0x46')],'action':_0x2ad3('0x47'),'channel':_0x534341[_0x2ad3('0x48')],'callerid':util[_0x2ad3('0x16')]('\x22%s\x22\x20<%s>',_0x4fdcac,_0x534341['calleridnum']),'Exten':_0x2ad3('0x49'),'Context':'from-sip','Priority':'1','variable':_0x5e5677,'timeout':(_0x47eda5[_0x2ad3('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x534341['uniqueid']};};exports['totalGlobal']=function(_0x11ce36){return _0x11ce36[_0x2ad3('0x4b')]+_0x11ce36[_0x2ad3('0x4c')]+_0x11ce36[_0x2ad3('0x4d')]+_0x11ce36[_0x2ad3('0x4e')]+_0x11ce36[_0x2ad3('0x4f')];};exports[_0x2ad3('0x50')]=function(_0x39bf63){var _0x1d2800=_[_0x2ad3('0x51')](_0x39bf63);_0x1d2800[_0x2ad3('0x34')]=0xf;_0x1d2800[_0x2ad3('0x35')]=_0x2ad3('0x52');return _0x1d2800;};exports[_0x2ad3('0x53')]=function(_0x394bf5,_0x3a40bf,_0x13c32e){var _0x5f48e3={};_0x5f48e3[_0x3a40bf]=_0x394bf5[_0x3a40bf];_0x5f48e3[_0x2ad3('0x54')]=![];_0x5f48e3[_0x2ad3('0x55')]=moment()[_0x2ad3('0x56')](_0x13c32e,_0x2ad3('0x57'))[_0x2ad3('0x16')](_0x2ad3('0x3b'));_0x5f48e3[_0x2ad3('0x1d')]=_0x394bf5[_0x2ad3('0x1d')];_0x5f48e3[_0x2ad3('0x58')]=_0x394bf5[_0x2ad3('0x58')];_0x5f48e3[_0x2ad3('0x1e')]=_0x394bf5[_0x2ad3('0x1e')]||undefined;return _0x5f48e3;};exports[_0x2ad3('0x59')]=function(_0x2f7186,_0x21a823){if(!_[_0x2ad3('0x19')](_0x2f7186)){if(_0x2f7186[_0x2ad3('0x5a')]>0x0){_0x2f7186[_0x2ad3('0x5a')]-=0x1;}else{logger[_0x2ad3('0xa')](_0x21a823,_0x2ad3('0x5b'));}}else{logger[_0x2ad3('0xa')](_0x21a823,_0x2ad3('0x5c'));}};exports[_0x2ad3('0x5d')]=function(_0x12fd4e){if(_0x12fd4e<=0x0){return!![];}return![];};exports[_0x2ad3('0x5e')]=function(_0x5f3387,_0x8dae1a,_0x492839){_0x5f3387['lastevent']=_0x8dae1a;_0x5f3387[_0x2ad3('0x1c')]=_0x5f3387[_0x2ad3('0x5f')];_0x5f3387[_0x2ad3('0x60')]=_0x5f3387[_0x2ad3('0x48')];_0x5f3387[_0x2ad3('0x61')]=_0x2ad3('0x62');if(_0x492839){_0x5f3387[_0x2ad3('0x63')]=_0x492839[_0x2ad3('0x63')];}return _0x5f3387;};exports['buildAcw']=function(_0x52fb58){var _0xadbca2={};_0xadbca2[_0x2ad3('0x5f')]=_0x52fb58[_0x2ad3('0x5f')];_0xadbca2[_0x2ad3('0x60')]=_0x52fb58[_0x2ad3('0x48')];_0xadbca2[_0x2ad3('0x46')]=_0x52fb58[_0x2ad3('0x46')];return _0xadbca2;};exports[_0x2ad3('0x64')]=function(_0x18bc80){var _0x4d8eac=[];for(var _0x41de57 in _0x18bc80){if(_0x18bc80[_0x2ad3('0x30')](_0x41de57)){if(!_[_0x2ad3('0x19')](_0x18bc80[_0x41de57])&&_0x18bc80[_0x41de57][_0x2ad3('0x34')]==='not_inuse'&&_0x18bc80[_0x41de57][_0x2ad3('0x65')]===_0x2ad3('0x66')){_0x4d8eac[_0x2ad3('0x67')](_0x18bc80[_0x41de57]['id']);}}}return _0x4d8eac;};exports[_0x2ad3('0x68')]=function(_0x475465){var _0x3b63a0=moment()['milliseconds'](0x0);var _0x323da0=moment(_0x475465)[_0x2ad3('0x7')](0x0);return _0x3b63a0[_0x2ad3('0x8')](_0x323da0,'seconds');};exports[_0x2ad3('0x69')]=function(_0x25d7a5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x25d7a5['ContactId'],'ListId':_0x25d7a5[_0x2ad3('0x58')],'VoiceQueueId':_0x25d7a5['VoiceQueueId']||undefined,'CampaignId':_0x25d7a5[_0x2ad3('0x6a')]||undefined};};exports[_0x2ad3('0x6b')]=function(_0x4f1075){if(_0x4f1075==='uniqueid'||_0x4f1075==='idContact'||_0x4f1075===_0x2ad3('0x5f')||_0x4f1075===_0x2ad3('0x6c')||_0x4f1075===_0x2ad3('0x6d')||_0x4f1075==='dialAnswer'||_0x4f1075===_0x2ad3('0x3d')||_0x4f1075===_0x2ad3('0x48')||_0x4f1075===_0x2ad3('0x6e')||_0x4f1075==='active'||_0x4f1075==='calleridnum'||_0x4f1075==='scheduledat'||_0x4f1075===_0x2ad3('0x4b')||_0x4f1075===_0x2ad3('0x4c')||_0x4f1075==='countnoanswerretry'||_0x4f1075===_0x2ad3('0x6f')||_0x4f1075===_0x2ad3('0x70')||_0x4f1075===_0x2ad3('0x71')||_0x4f1075===_0x2ad3('0x72')||_0x4f1075===_0x2ad3('0x73')||_0x4f1075==='ContactId'||_0x4f1075==='ListId'||_0x4f1075===_0x2ad3('0x3e')||_0x4f1075==='VoiceQueueId'||_0x4f1075===_0x2ad3('0x74')||_0x4f1075===_0x2ad3('0x75')||_0x4f1075===_0x2ad3('0x76')||_0x4f1075==='xmd-phone'||_0x4f1075===_0x2ad3('0x77')||_0x4f1075===_0x2ad3('0x78')||_0x4f1075===_0x2ad3('0x79')||_0x4f1075===_0x2ad3('0x7a')||_0x4f1075===_0x2ad3('0x7b')||_0x4f1075===_0x2ad3('0x7c')||_0x4f1075===_0x2ad3('0x7d')||_0x4f1075==='xmd-cdrtype'||_0x4f1075==='xmd-callerid'||_0x4f1075===_0x2ad3('0x7e')||_0x4f1075===_0x2ad3('0x7f')||_0x4f1075===_0x2ad3('0x80')||_0x4f1075===_0x2ad3('0x81')||_0x4f1075===_0x2ad3('0x82')||_0x4f1075===_0x2ad3('0x83')||_0x4f1075==='rtpaudioqosloss'||_0x4f1075==='rtpaudioqoslossbridged'||_0x4f1075==='rtpaudioqosrtt'||_0x4f1075===_0x2ad3('0x84')||_0x4f1075===_0x2ad3('0x80')||_0x4f1075==='rtpaudioqosbridged'||_0x4f1075===_0x2ad3('0x82')||_0x4f1075===_0x2ad3('0x83')||_0x4f1075===_0x2ad3('0x85')||_0x4f1075==='rtpaudioqoslossbridged'||_0x4f1075===_0x2ad3('0x86')||_0x4f1075==='rtpaudioqosrttbridged'||_0x4f1075===_0x2ad3('0x87')||_0x4f1075===_0x2ad3('0x88')||_0x4f1075===_0x2ad3('0x34')||_0x4f1075==='statedesc'){return![];}return!![];};exports[_0x2ad3('0x89')]=function(_0x235942,_0x5272b7){var _0x2987b9,_0x5b6e97,_0x23ba02;if(_0x5272b7<=0x0){_0x5272b7=0x1;}_0x2987b9=new RegExp(_0x2ad3('0x8a')+_0x5272b7+'}$');_0x5b6e97=Math[_0x2ad3('0x8b')](0xa,_0x5272b7-0x1);_0x23ba02=Math[_0x2ad3('0x8b')](0xa,_0x5272b7)-0x1;return util[_0x2ad3('0x16')]('%s',_['replace'](_0x235942,_0x2987b9,_[_0x2ad3('0x8c')](_0x5b6e97,_0x23ba02)));};exports[_0x2ad3('0x8d')]=function(_0x1d33b9){var _0x56cf8=_0x1d33b9[_0x2ad3('0x8e')](/"(.*?)"/);return _0x56cf8?_0x56cf8[0x1]:_0x1d33b9;};exports[_0x2ad3('0x8f')]=function(_0x4e0594){var _0x5d5488=_0x4e0594[_0x2ad3('0x8e')](/<(.*?)>/);return _0x5d5488?_0x5d5488[0x1]:_0x4e0594;}; \ No newline at end of file +var _0xb707=['xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','diff','seconds','error','logger','loggerError','inspect','logger2','info','message','isUndefined','string','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','isNil','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','scheduledat','countglobal','callback','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0xb707,0x14f));var _0x7b70=function(_0x522fd4,_0x2e0d11){_0x522fd4=_0x522fd4-0x0;var _0x1a1aa0=_0xb707[_0x522fd4];return _0x1a1aa0;};'use strict';var util=require(_0x7b70('0x0'));var _=require('lodash');var moment=require(_0x7b70('0x1'));var logger=require(_0x7b70('0x2'))(_0x7b70('0x3'));var ipAgi=process[_0x7b70('0x4')][_0x7b70('0x5')]||_0x7b70('0x6');function getSeconds(_0xc914d0,_0x123049){var _0x5c63df=moment(_0xc914d0)['milliseconds'](0x0);var _0x40eb65=moment(_0x123049)['milliseconds'](0x0);return _0x5c63df[_0x7b70('0x7')](_0x40eb65,_0x7b70('0x8'));}exports['loggerCatch']=function(_0x1f8ff4){return function(_0x58da3f){logger[_0x7b70('0x9')](_0x1f8ff4,util['inspect'](_0x58da3f,{'showHidden':![],'depth':null}));};};exports[_0x7b70('0xa')]=function(_0x210508,_0x299d02){logger['info'](_0x210508,util['inspect'](_0x299d02,{'showHidden':![],'depth':null}));};exports[_0x7b70('0xb')]=function(_0x57bad4,_0x4620c0){logger[_0x7b70('0x9')](_0x57bad4,util[_0x7b70('0xc')](_0x4620c0,{'showHidden':![],'depth':null}));};exports[_0x7b70('0xd')]=function(_0x42d4fb){return function(_0x2c11c0){logger[_0x7b70('0xe')](_0x42d4fb,util[_0x7b70('0xc')](_0x2c11c0,{'showHidden':![],'depth':null}));};};exports[_0x7b70('0xf')]=function(_0x511c5e,_0x24330d,_0x29d8b3){return{'message':_0x511c5e,'unlock':_0x24330d,'active':_0x29d8b3};};exports['getCallerId']=function(_0x487d12,_0x4bae98,_0x3b51f9){if(!_[_0x7b70('0x10')](_0x3b51f9)&&_0x7b70('0x11')===typeof _0x3b51f9&&!_['isEmpty'](_0x3b51f9)){if(!_[_0x7b70('0x10')](_0x4bae98)&&'string'===typeof _0x4bae98&&!_['isEmpty'](_0x4bae98)){return util['format'](_0x7b70('0x12'),_0x4bae98,_0x3b51f9);}return util['format'](_0x7b70('0x12'),_0x3b51f9,_0x3b51f9);}if(!_[_0x7b70('0x10')](_0x487d12)&&'string'===typeof _0x487d12&&!_[_0x7b70('0x13')](_0x487d12)){return _0x487d12;}return _0x7b70('0x14');};exports[_0x7b70('0x15')]=function(_0x207072){if(_[_0x7b70('0x16')](_0x207072)){return![];}return _0x207072;};exports['addVariables']=function(_0x1a642a,_0x282dae,_0x49dc28,_0x320d48,_0x2e6705,_0x656e9b){var _0x39ce0b={'XMD-QUEUE':_0x282dae['Queue']?_0x282dae[_0x7b70('0x17')][_0x7b70('0x18')]:'','XMD-CALLERID':_0x320d48,'XMD-CALLERID-PREVIEW':_0x656e9b?util[_0x7b70('0x19')](_0x7b70('0x12'),_0x656e9b[_0x7b70('0x1a')],_0x656e9b[_0x7b70('0x1b')]):_0x320d48,'XMD-DIALID':_0x2e6705,'XMD-CONTACTID':_0x282dae[_0x7b70('0x1c')],'XMD-CDRTYPE':_0x7b70('0x1d'),'CALLERID(all)':_0x320d48,'XMD-VOICEQUEUEID':_0x282dae[_0x7b70('0x1e')],'XMD-DIALCHANNEL':_0x49dc28,'XMD-DIALTIMEOUT':_0x1a642a[_0x7b70('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x7b70('0x19')](_0x7b70('0x20'),_0x1a642a[_0x7b70('0x21')]?'g':'',_['isEmpty'](_0x1a642a[_0x7b70('0x22')])?'':_0x7b70('0x23')),'XMD-DIALURL':_0x1a642a[_0x7b70('0x24')]||'','XMD-AGI':_0x1a642a[_0x7b70('0x25')]?util[_0x7b70('0x19')](_0x7b70('0x26'),ipAgi,_0x1a642a[_0x7b70('0x25')]):_0x7b70('0x27'),'XMD-AGIAFTER':_0x1a642a[_0x7b70('0x21')]?util[_0x7b70('0x19')](_0x7b70('0x26'),ipAgi,_0x1a642a[_0x7b70('0x21')]):_0x7b70('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x656e9b?_0x656e9b[_0x7b70('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x656e9b?_0x656e9b[_0x7b70('0x29')]:'','XMD-DESTINATION':_0x7b70('0x2a')};if(!_[_0x7b70('0x13')](_0x1a642a[_0x7b70('0x22')])){_0x39ce0b[util[_0x7b70('0x19')]('%s',_0x7b70('0x2b'))]=_0x1a642a[_0x7b70('0x22')];_0x39ce0b[util[_0x7b70('0x19')]('%s',_0x7b70('0x2c'))]=_0x2e6705;}if(_0x282dae&&_0x282dae[_0x7b70('0x2d')]){for(var _0x4e002e in _0x282dae[_0x7b70('0x2d')]){if(_0x282dae[_0x7b70('0x2d')][_0x7b70('0x2e')](_0x4e002e)){if(!_['isNil'](_0x282dae[_0x7b70('0x2d')][_0x4e002e])&&_0x4e002e!=='id'&&_0x4e002e!==_0x7b70('0x2f')&&_0x4e002e!==_0x7b70('0x30')&&_0x4e002e!==_0x7b70('0x31')){_0x39ce0b[util['format'](_0x7b70('0x32'),_0x7b70('0x33'),_[_0x7b70('0x34')](_0x4e002e))]=_0x282dae[_0x7b70('0x2d')][_0x4e002e];}}}}return _0x39ce0b;};exports[_0x7b70('0x35')]=function(_0x28f257){var _0x1ff69b={};for(var _0x1caffc in _0x28f257){if(_0x28f257['hasOwnProperty'](_0x1caffc)){_0x1ff69b[util[_0x7b70('0x19')]('%s',_['toLower'](_0x1caffc))]=_0x28f257[_0x1caffc];}}return{'variables':_0x1ff69b};};exports[_0x7b70('0x36')]=function(_0x42d918,_0x54e466){if(!_[_0x7b70('0x16')](_0x42d918)){if(_0x42d918[_0x7b70('0x2e')](_0x7b70('0x37'))){if(_0x42d918[_0x7b70('0x37')]>0x0){_0x42d918['originated']-=0x1;}else{logger[_0x7b70('0x9')](_0x7b70('0x38'),_0x54e466);}}}else{logger[_0x7b70('0x9')](_0x7b70('0x39'),_0x54e466);}};exports[_0x7b70('0x3a')]=function(_0x47ffb5){var _0x520d91=moment()[_0x7b70('0x19')](_0x7b70('0x3b'));_0x47ffb5[_0x7b70('0x3c')]=0xd;_0x47ffb5[_0x7b70('0x3d')]='Blacklist';_0x47ffb5[_0x7b70('0x3e')]=_0x520d91;_0x47ffb5[_0x7b70('0x3f')]=_0x520d91;_0x47ffb5[_0x7b70('0x40')]=_0x520d91;};exports[_0x7b70('0x41')]=function(_0x3db048,_0x5810c1,_0x24abe7){var _0x3afe52=moment()[_0x7b70('0x19')](_0x7b70('0x3b'));_0x3db048[_0x7b70('0x3c')]=_0x5810c1;_0x3db048['statedesc']=_0x24abe7;_0x3db048[_0x7b70('0x3f')]=_0x3afe52;_0x3db048[_0x7b70('0x42')]=getSeconds(_0x3db048[_0x7b70('0x3f')],_0x3db048[_0x7b70('0x3e')]);};exports[_0x7b70('0x43')]=function(_0x14e226,_0x2967b3,_0x4db101){_0x14e226[_0x7b70('0x44')]=_0x2967b3;_0x14e226['UserId']=_0x4db101;};exports['logCustomer']=function(_0x401eae,_0x569f10,_0x2a3142){var _0x24896b=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x401eae[_0x7b70('0x3c')]=_0x569f10;_0x401eae['statedesc']=_0x2a3142;_0x401eae['responsetime']=_0x401eae[_0x7b70('0x3f')]?_0x401eae[_0x7b70('0x3f')]:_0x24896b;_0x401eae[_0x7b70('0x40')]=_0x401eae[_0x7b70('0x40')]?_0x401eae[_0x7b70('0x40')]:_0x24896b;_0x401eae[_0x7b70('0x42')]=getSeconds(_0x401eae[_0x7b70('0x3f')]||0x0,_0x401eae[_0x7b70('0x3e')]||0x0);_0x401eae[_0x7b70('0x45')]=_0x401eae[_0x7b70('0x46')]?getSeconds(_0x401eae[_0x7b70('0x40')],_0x401eae['answertime']):0x0;};exports[_0x7b70('0x47')]=function(_0x47e803){return _0x47e803===_0x7b70('0x48');};exports[_0x7b70('0x49')]=function(_0x139f9a,_0xe0b769,_0x23c7c5,_0x56e389,_0x3ae29b){var _0x2b5d45=_0x56e389?_0x7b70('0x4a'):_0x139f9a[_0x7b70('0x1a')];_0x2b5d45=_0x3ae29b?_0x7b70('0x4b'):_0x2b5d45;return{'actionid':_0x139f9a[_0x7b70('0x4c')],'action':_0x7b70('0x4d'),'channel':_0x139f9a['channelAgent'],'callerid':util['format'](_0x7b70('0x12'),_0x2b5d45,_0x139f9a['calleridnum']),'Exten':_0x7b70('0x2a'),'Context':_0x7b70('0x4e'),'Priority':'1','variable':_0x23c7c5,'timeout':(_0xe0b769[_0x7b70('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x139f9a['uniqueid']};};exports[_0x7b70('0x50')]=function(_0xcc18d2){return _0xcc18d2[_0x7b70('0x51')]+_0xcc18d2[_0x7b70('0x52')]+_0xcc18d2[_0x7b70('0x53')]+_0xcc18d2[_0x7b70('0x54')]+_0xcc18d2[_0x7b70('0x55')];};exports[_0x7b70('0x56')]=function(_0x4a5b54){var _0x56c09a=_[_0x7b70('0x57')](_0x4a5b54);_0x56c09a[_0x7b70('0x3c')]=0xf;_0x56c09a['statedesc']=_0x7b70('0x58');return _0x56c09a;};exports[_0x7b70('0x59')]=function(_0x55bbf3,_0x22f9a5,_0x2f09cd){var _0x341bc1={};_0x341bc1[_0x22f9a5]=_0x55bbf3[_0x22f9a5];_0x341bc1['active']=![];_0x341bc1['scheduledat']=moment()[_0x7b70('0x5a')](_0x2f09cd,_0x7b70('0x5b'))[_0x7b70('0x19')](_0x7b70('0x3b'));_0x341bc1[_0x7b70('0x1c')]=_0x55bbf3['ContactId'];_0x341bc1[_0x7b70('0x5c')]=_0x55bbf3[_0x7b70('0x5c')];_0x341bc1[_0x7b70('0x1e')]=_0x55bbf3[_0x7b70('0x1e')]||undefined;return _0x341bc1;};exports[_0x7b70('0x5d')]=function(_0x3da47c,_0x194534){if(!_[_0x7b70('0x16')](_0x3da47c)){if(_0x3da47c[_0x7b70('0x5e')]>0x0){_0x3da47c[_0x7b70('0x5e')]-=0x1;}else{logger[_0x7b70('0x9')](_0x194534,_0x7b70('0x5f'));}}else{logger[_0x7b70('0x9')](_0x194534,_0x7b70('0x60'));}};exports['IsNotLoggedIn']=function(_0x37929e){if(_0x37929e<=0x0){return!![];}return![];};exports[_0x7b70('0x61')]=function(_0x1b2815,_0xdc463b,_0x171971){_0x1b2815[_0x7b70('0x62')]=_0xdc463b;_0x1b2815[_0x7b70('0x18')]=_0x1b2815[_0x7b70('0x63')];_0x1b2815[_0x7b70('0x64')]=_0x1b2815[_0x7b70('0x65')];_0x1b2815[_0x7b70('0x66')]='voice';if(_0x171971){_0x1b2815[_0x7b70('0x67')]=_0x171971['mandatoryDisposition'];}return _0x1b2815;};exports[_0x7b70('0x68')]=function(_0x2c274e){var _0x348d4b={};_0x348d4b[_0x7b70('0x63')]=_0x2c274e[_0x7b70('0x63')];_0x348d4b[_0x7b70('0x64')]=_0x2c274e[_0x7b70('0x65')];_0x348d4b[_0x7b70('0x4c')]=_0x2c274e[_0x7b70('0x4c')];return _0x348d4b;};exports[_0x7b70('0x69')]=function(_0xfac031){var _0x3990ff=[];for(var _0x7e14fe in _0xfac031){if(_0xfac031[_0x7b70('0x2e')](_0x7e14fe)){if(!_[_0x7b70('0x16')](_0xfac031[_0x7e14fe])&&_0xfac031[_0x7e14fe][_0x7b70('0x3c')]===_0x7b70('0x6a')&&_0xfac031[_0x7e14fe][_0x7b70('0x6b')]===_0x7b70('0x6c')){_0x3990ff[_0x7b70('0x6d')](_0xfac031[_0x7e14fe]['id']);}}}return _0x3990ff;};exports['getDiff']=function(_0x153311){var _0x3d76e7=moment()[_0x7b70('0x6e')](0x0);var _0x549fbe=moment(_0x153311)['milliseconds'](0x0);return _0x3d76e7[_0x7b70('0x7')](_0x549fbe,'seconds');};exports[_0x7b70('0x6f')]=function(_0x2540f1){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2540f1[_0x7b70('0x1c')],'ListId':_0x2540f1[_0x7b70('0x5c')],'VoiceQueueId':_0x2540f1[_0x7b70('0x1e')]||undefined,'CampaignId':_0x2540f1[_0x7b70('0x70')]||undefined};};exports[_0x7b70('0x71')]=function(_0x5618e8){if(_0x5618e8===_0x7b70('0x4c')||_0x5618e8===_0x7b70('0x72')||_0x5618e8===_0x7b70('0x63')||_0x5618e8===_0x7b70('0x73')||_0x5618e8===_0x7b70('0x74')||_0x5618e8===_0x7b70('0x75')||_0x5618e8===_0x7b70('0x44')||_0x5618e8===_0x7b70('0x65')||_0x5618e8==='calleridname'||_0x5618e8===_0x7b70('0x76')||_0x5618e8===_0x7b70('0x1b')||_0x5618e8===_0x7b70('0x77')||_0x5618e8===_0x7b70('0x51')||_0x5618e8===_0x7b70('0x52')||_0x5618e8===_0x7b70('0x53')||_0x5618e8===_0x7b70('0x78')||_0x5618e8===_0x7b70('0x79')||_0x5618e8===_0x7b70('0x7a')||_0x5618e8===_0x7b70('0x7b')||_0x5618e8==='recallme'||_0x5618e8===_0x7b70('0x1c')||_0x5618e8==='ListId'||_0x5618e8===_0x7b70('0x7c')||_0x5618e8===_0x7b70('0x1e')||_0x5618e8===_0x7b70('0x7d')||_0x5618e8===_0x7b70('0x7e')||_0x5618e8==='xmd-queue'||_0x5618e8===_0x7b70('0x7f')||_0x5618e8===_0x7b70('0x80')||_0x5618e8===_0x7b70('0x81')||_0x5618e8===_0x7b70('0x82')||_0x5618e8===_0x7b70('0x83')||_0x5618e8===_0x7b70('0x84')||_0x5618e8===_0x7b70('0x85')||_0x5618e8==='xmd-contactid'||_0x5618e8===_0x7b70('0x86')||_0x5618e8===_0x7b70('0x87')||_0x5618e8===_0x7b70('0x88')||_0x5618e8===_0x7b70('0x89')||_0x5618e8==='rtpaudioqos'||_0x5618e8===_0x7b70('0x8a')||_0x5618e8==='rtpaudioqosjitter'||_0x5618e8===_0x7b70('0x8b')||_0x5618e8===_0x7b70('0x8c')||_0x5618e8===_0x7b70('0x8d')||_0x5618e8==='rtpaudioqosrtt'||_0x5618e8===_0x7b70('0x8e')||_0x5618e8===_0x7b70('0x8f')||_0x5618e8===_0x7b70('0x8a')||_0x5618e8===_0x7b70('0x90')||_0x5618e8===_0x7b70('0x8b')||_0x5618e8===_0x7b70('0x8c')||_0x5618e8===_0x7b70('0x8d')||_0x5618e8===_0x7b70('0x91')||_0x5618e8===_0x7b70('0x8e')||_0x5618e8===_0x7b70('0x92')||_0x5618e8===_0x7b70('0x93')||_0x5618e8===_0x7b70('0x3c')||_0x5618e8===_0x7b70('0x3d')){return![];}return!![];};exports[_0x7b70('0x94')]=function(_0x799bb,_0x377c3a){var _0x231420,_0xae232b,_0x1183af;if(_0x377c3a<=0x0){_0x377c3a=0x1;}_0x231420=new RegExp(_0x7b70('0x95')+_0x377c3a+'}$');_0xae232b=Math[_0x7b70('0x96')](0xa,_0x377c3a-0x1);_0x1183af=Math[_0x7b70('0x96')](0xa,_0x377c3a)-0x1;return util[_0x7b70('0x19')]('%s',_['replace'](_0x799bb,_0x231420,_['random'](_0xae232b,_0x1183af)));};exports[_0x7b70('0x97')]=function(_0x47ed6e){var _0xceb231=_0x47ed6e[_0x7b70('0x98')](/"(.*?)"/);return _0xceb231?_0xceb231[0x1]:_0x47ed6e;};exports[_0x7b70('0x99')]=function(_0x1c3aed){var _0x4cf9aa=_0x1c3aed[_0x7b70('0x98')](/<(.*?)>/);return _0x4cf9aa?_0x4cf9aa[0x1]:_0x1c3aed;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 30b47ca..545607b 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 _0x1fee=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x5d816a,_0x259e03){var _0x512777=function(_0x27b38f){while(--_0x27b38f){_0x5d816a['push'](_0x5d816a['shift']());}};_0x512777(++_0x259e03);}(_0x1fee,0x1de));var _0xe1fe=function(_0x47533e,_0x5b832f){_0x47533e=_0x47533e-0x0;var _0xab2643=_0x1fee[_0x47533e];return _0xab2643;};'use strict';exports[_0xe1fe('0x0')]={'queue':{'type':_0xe1fe('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xe1fe('0x1'),'required':!![]},'penalty':{'type':_0xe1fe('0x2'),'required':![]},'paused':{'type':_0xe1fe('0x3'),'required':![]}};exports[_0xe1fe('0x4')]={'queue':{'type':_0xe1fe('0x1'),'required':!![]},'interface':{'type':_0xe1fe('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xe1fe('0x1'),'required':!![]},'paused':{'type':_0xe1fe('0x3')},'reason':{'type':_0xe1fe('0x1'),'required':![]}};exports[_0xe1fe('0x5')]={'module':{'type':_0xe1fe('0x1'),'required':![]}};exports[_0xe1fe('0x6')]={'uniqueid':{'type':_0xe1fe('0x1'),'required':!![]}};exports[_0xe1fe('0x7')]={'uniqueid':{'type':_0xe1fe('0x1'),'required':!![]},'filename':{'type':_0xe1fe('0x1')},'format':{'type':_0xe1fe('0x1')},'mixmonitorid':{'type':_0xe1fe('0x1')}};exports[_0xe1fe('0x8')]={'uniqueid':{'type':_0xe1fe('0x1'),'required':!![]}};exports[_0xe1fe('0x9')]={'uniqueid':{'type':_0xe1fe('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xe1fe('0x1')}}; \ No newline at end of file +var _0xc4bc=['voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queuepause'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0xc4bc,0x7b));var _0xcc4b=function(_0xc0b102,_0xd7ae85){_0xc0b102=_0xc0b102-0x0;var _0x1cc390=_0xc4bc[_0xc0b102];return _0x1cc390;};'use strict';exports[_0xcc4b('0x0')]={'queue':{'type':_0xcc4b('0x1'),'required':!![]},'interface':{'type':_0xcc4b('0x1'),'required':!![]},'membername':{'type':_0xcc4b('0x1'),'required':!![]},'penalty':{'type':_0xcc4b('0x2'),'required':![]},'paused':{'type':_0xcc4b('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xcc4b('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xcc4b('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xcc4b('0x5')]={'uniqueid':{'type':_0xcc4b('0x1'),'required':!![]}};exports[_0xcc4b('0x6')]={'uniqueid':{'type':_0xcc4b('0x1'),'required':!![]},'filename':{'type':_0xcc4b('0x1')},'format':{'type':_0xcc4b('0x1')},'mixmonitorid':{'type':_0xcc4b('0x1')}};exports[_0xcc4b('0x7')]={'uniqueid':{'type':_0xcc4b('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xcc4b('0x1'),'required':!![]},'exten':{'type':_0xcc4b('0x1'),'required':!![]},'context':{'type':_0xcc4b('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 8e1f80f..68fd216 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 _0x20ac=['initTemplates','templates','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','sumHoldTime','duration','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','merge','initFaxAccounts','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','outbound','channels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','isNil','format','interface','hasOwnProperty','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','triggers'];(function(_0xfb80fb,_0xfa22dc){var _0x6e23ba=function(_0x328953){while(--_0x328953){_0xfb80fb['push'](_0xfb80fb['shift']());}};_0x6e23ba(++_0xfa22dc);}(_0x20ac,0x165));var _0xc20a=function(_0x378f96,_0x13667f){_0x378f96=_0x378f96-0x0;var _0x10a677=_0x20ac[_0x378f96];return _0x10a677;};'use strict';var BPromise=require('bluebird');var util=require(_0xc20a('0x0'));var _=require(_0xc20a('0x1'));var moment=require(_0xc20a('0x2'));var Agent=require(_0xc20a('0x3'));var Telephone=require(_0xc20a('0x4'));var Trunk=require(_0xc20a('0x5'));var VoiceQueue=require(_0xc20a('0x6'));var Trigger=require(_0xc20a('0x7'));var Template=require(_0xc20a('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xc20a('0x9'));var ZendeskAccount=require(_0xc20a('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xc20a('0xb'));var SugarcrmAccount=require(_0xc20a('0xc'));var ZohoAccount=require(_0xc20a('0xd'));var DeskAccount=require(_0xc20a('0xe'));var VtigerAccount=require(_0xc20a('0xf'));var ServicenowAccount=require(_0xc20a('0x10'));var Dynamics365Account=require(_0xc20a('0x11'));var FreshsalesAccount=require(_0xc20a('0x12'));var FaxAccount=require(_0xc20a('0x13'));var Realtime=function(){this[_0xc20a('0x14')]={};this[_0xc20a('0x15')]={};this[_0xc20a('0x16')]={};this[_0xc20a('0x17')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xc20a('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xc20a('0x19')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xc20a('0x1a')]={};this[_0xc20a('0x1b')]={};this['zendeskAccounts']={};this[_0xc20a('0x1c')]={};this[_0xc20a('0x1d')]={};this[_0xc20a('0x1e')]={};this[_0xc20a('0x1f')]={};this['deskAccounts']={};this[_0xc20a('0x20')]={};this[_0xc20a('0x21')]={};this[_0xc20a('0x22')]={};this[_0xc20a('0x23')]={};this[_0xc20a('0x24')]={};};function freeIsNotKey(_0x3bbd77,_0x93a443,_0x9b513){var _0x3adabb=_[_0xc20a('0x25')](_0x3bbd77,function(_0x313299,_0x4d2451){return _0x313299[_0x9b513];});for(var _0x4b9cd4 in _0x93a443){if(_0x93a443['hasOwnProperty'](_0x4b9cd4)){if(!_0x3adabb[_0x4b9cd4]){delete _0x93a443[_0x4b9cd4];}}}}function freeIsNotKeySip(_0x2487a7,_0x1a4e32){var _0x195c3d=_['mapKeys'](_0x2487a7,function(_0x5852d9,_0x58823b){return util['format'](_0xc20a('0x26'),_0x5852d9[_0xc20a('0x27')]);});for(var _0x124233 in _0x1a4e32){if(_0x1a4e32['hasOwnProperty'](_0x124233)){if(!_0x195c3d[_0x124233]){delete _0x1a4e32[_0x124233];}}}}function freeIsNotKeyAgent(_0x4ceefb,_0x53b883){var _0x4a555b=_[_0xc20a('0x25')](_0x4ceefb,function(_0x3d8b89,_0x862fd6){var _0x1392a5=_[_0xc20a('0x28')](_0x3d8b89['interface'])?util[_0xc20a('0x29')]('SIP/%s',_0x3d8b89[_0xc20a('0x27')]):_0x3d8b89[_0xc20a('0x2a')];return _0x1392a5;});for(var _0x2a9921 in _0x53b883){if(_0x53b883[_0xc20a('0x2b')](_0x2a9921)){if(!_0x4a555b[_0x2a9921]){delete _0x53b883[_0x2a9921];}}}}function clearVoiceCallReports(_0x527d6a){_0x527d6a['total']=0x0;_0x527d6a[_0xc20a('0x2c')]=0x0;_0x527d6a['sumHoldTime']=0x0;_0x527d6a[_0xc20a('0x2d')]=0x0;_0x527d6a[_0xc20a('0x2e')]=0x0;}function clearCampaigns(_0x9dd4aa){if(!_[_0xc20a('0x2f')](_0x9dd4aa)){for(var _0x2f8f8f in _0x9dd4aa){if(_0x9dd4aa[_0xc20a('0x2b')](_0x2f8f8f)){_0x9dd4aa[_0x2f8f8f][_0xc20a('0x30')]=0x0;_0x9dd4aa[_0x2f8f8f][_0xc20a('0x31')]=0x0;}}}}function clearVoiceQueues(_0x329ff2){if(!_[_0xc20a('0x2f')](_0x329ff2)){for(var _0x517756 in _0x329ff2){if(_0x329ff2[_0xc20a('0x2b')](_0x517756)){_0x329ff2[_0x517756][_0xc20a('0x32')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x2c')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x33')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x34')]=0x0;_0x329ff2[_0x517756]['sumHoldTime']=0x0;_0x329ff2[_0x517756]['sumDuration']=0x0;_0x329ff2[_0x517756][_0xc20a('0x2e')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x35')]=0x0;_0x329ff2[_0x517756]['outboundNoAnswerCallsDay']=0x0;_0x329ff2[_0x517756][_0xc20a('0x36')]=0x0;_0x329ff2[_0x517756]['outboundCongestionCallsDay']=0x0;_0x329ff2[_0x517756][_0xc20a('0x37')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x38')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x39')]=0x0;_0x329ff2[_0x517756]['outboundDropCallsDayCallersExit']=0x0;_0x329ff2[_0x517756][_0xc20a('0x3a')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x3b')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x3c')]=0x0;_0x329ff2[_0x517756]['outboundReCallsDay']=0x0;_0x329ff2[_0x517756][_0xc20a('0x35')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x3d')]=0x0;_0x329ff2[_0x517756][_0xc20a('0x3e')]=!![];}}}}Realtime[_0xc20a('0x3f')][_0xc20a('0x40')]=function(_0xfe7a23,_0x10cd98){for(var _0x533478 in _0x10cd98){if(_0xfe7a23[_0xc20a('0x2b')](_0x533478)){_0xfe7a23[_0x533478]=_0x10cd98[_0x533478];}}};Realtime[_0xc20a('0x3f')]['initAgents']=function(){var _0x1c4cb2=this;return function(_0x33050b){if(_0x33050b){freeIsNotKeyAgent(_0x33050b,_0x1c4cb2[_0xc20a('0x14')]);for(var _0x4602e7=0x0,_0x479b30={},_0x5b20af={};_0x4602e7<_0x33050b[_0xc20a('0x41')];_0x4602e7+=0x1){_0x479b30=_0x33050b[_0x4602e7];var _0x51977f=_[_0xc20a('0x28')](_0x479b30['interface'])?util['format'](_0xc20a('0x26'),_0x479b30[_0xc20a('0x27')]):_0x479b30[_0xc20a('0x2a')];if(_[_0xc20a('0x42')](_0x1c4cb2[_0xc20a('0x14')][_0x51977f])){_0x1c4cb2[_0xc20a('0x14')][_0x51977f]=new Agent(_0x479b30);}else{_0x1c4cb2[_0xc20a('0x40')](_0x1c4cb2['agents'][_0x51977f],_0x479b30);}}}return _0x1c4cb2[_0xc20a('0x14')];};};Realtime[_0xc20a('0x3f')]['initTelephones']=function(){var _0x2b97f4=this;return function(_0xaa216a){if(_0xaa216a){freeIsNotKeySip(_0xaa216a,_0x2b97f4[_0xc20a('0x15')]);for(var _0x14ca3f=0x0,_0x1cc272={},_0x49986c={};_0x14ca3f<_0xaa216a['length'];_0x14ca3f+=0x1){_0x1cc272=_0xaa216a[_0x14ca3f];if(_[_0xc20a('0x42')](_0x2b97f4[_0xc20a('0x15')][util['format'](_0xc20a('0x26'),_0x1cc272[_0xc20a('0x27')])])){_0x2b97f4[_0xc20a('0x15')][util['format'](_0xc20a('0x26'),_0x1cc272[_0xc20a('0x27')])]=new Telephone(_0x1cc272);}else{_0x2b97f4[_0xc20a('0x40')](_0x2b97f4[_0xc20a('0x15')][util[_0xc20a('0x29')](_0xc20a('0x26'),_0x1cc272[_0xc20a('0x27')])],_0x1cc272);}}}return _0x2b97f4[_0xc20a('0x15')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x43')]=function(){var _0x59b0bd=this;return function(_0x20aca8){if(_0x20aca8){freeIsNotKeySip(_0x20aca8,_0x59b0bd['trunks']);for(var _0x2aafdd=0x0,_0x14b1a8={},_0x44ba1b={};_0x2aafdd<_0x20aca8[_0xc20a('0x41')];_0x2aafdd+=0x1){_0x14b1a8=_0x20aca8[_0x2aafdd];if(_[_0xc20a('0x42')](_0x59b0bd['trunks'][util['format'](_0xc20a('0x26'),_0x14b1a8[_0xc20a('0x27')])])){_0x59b0bd[_0xc20a('0x16')][util[_0xc20a('0x29')]('SIP/%s',_0x14b1a8[_0xc20a('0x27')])]=new Trunk(_0x14b1a8);}else{_0x59b0bd[_0xc20a('0x40')](_0x59b0bd[_0xc20a('0x16')][util['format'](_0xc20a('0x26'),_0x14b1a8[_0xc20a('0x27')])],_0x14b1a8);}}}return _0x59b0bd[_0xc20a('0x16')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x44')]=function(){var _0x774402=this;return function(_0x4958bc){if(_0x4958bc){freeIsNotKey(_0x4958bc,_0x774402[_0xc20a('0x17')],'name');for(var _0x35bd6e=0x0,_0x9cb9a7={},_0x3aa384={};_0x35bd6e<_0x4958bc['length'];_0x35bd6e+=0x1){_0x9cb9a7=_0x4958bc[_0x35bd6e];if(_['isUndefined'](_0x774402[_0xc20a('0x17')][_0x9cb9a7[_0xc20a('0x27')]])){_0x774402[_0xc20a('0x17')][_0x9cb9a7[_0xc20a('0x27')]]=new VoiceQueue(_0x9cb9a7);}else{_0x774402[_0xc20a('0x40')](_0x774402['voiceQueues'][_0x9cb9a7['name']],_0x9cb9a7);}}}return _0x774402[_0xc20a('0x17')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x45')]=function(){var _0x433347=this;return function(_0x5df291){if(_0x5df291){freeIsNotKey(_0x5df291,_0x433347[_0xc20a('0x46')],'id');for(var _0x5f3190=0x0,_0x20850e={},_0x5995ba={};_0x5f3190<_0x5df291[_0xc20a('0x41')];_0x5f3190+=0x1){_0x20850e=_0x5df291[_0x5f3190];if(_[_0xc20a('0x42')](_0x433347['triggers'][_0x20850e['id']])){_0x433347[_0xc20a('0x46')][_0x20850e['id']]=new Trigger(_0x20850e);}else{_0x433347['mergeFromDatabase'](_0x433347[_0xc20a('0x46')][_0x20850e['id']],_0x20850e);}}}return _0x433347['triggers'];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x47')]=function(){var _0x38ed38=this;return function(_0x1dbc32){if(_0x1dbc32){freeIsNotKey(_0x1dbc32,_0x38ed38['templates'],'id');for(var _0x47718f=0x0,_0x5cd6f6={},_0x5cd2ea={};_0x47718f<_0x1dbc32['length'];_0x47718f+=0x1){_0x5cd6f6=_0x1dbc32[_0x47718f];if(_['isUndefined'](_0x38ed38[_0xc20a('0x48')][_0x5cd6f6['id']])){_0x38ed38[_0xc20a('0x48')][_0x5cd6f6['id']]=new Template(_0x5cd6f6);}else{_0x38ed38['mergeFromDatabase'](_0x38ed38['templates'][_0x5cd6f6['id']],_0x5cd6f6);}}}return _0x38ed38[_0xc20a('0x48')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x4e3462=this;return function(_0x2c9c4c){if(_0x2c9c4c){freeIsNotKey(_0x2c9c4c,_0x4e3462[_0xc20a('0x49')],'id');for(var _0x212d0a=0x0,_0x776dc4={},_0x3b2bf0={};_0x212d0a<_0x2c9c4c['length'];_0x212d0a+=0x1){_0x776dc4=_0x2c9c4c[_0x212d0a];if(_['isUndefined'](_0x4e3462['zendeskAccounts'][_0x776dc4['id']])){_0x4e3462[_0xc20a('0x49')][_0x776dc4['id']]=new ZendeskAccount(_0x776dc4);}else{_0x4e3462[_0xc20a('0x40')](_0x4e3462[_0xc20a('0x49')][_0x776dc4['id']],_0x776dc4);}}}return _0x4e3462[_0xc20a('0x49')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x4a')]=function(){var _0x1ac646=this;return function(_0x43f839){if(_0x43f839){freeIsNotKey(_0x43f839,_0x1ac646['salesforceAccounts'],'id');for(var _0x494c44=0x0,_0x569ad9={},_0x322749={};_0x494c44<_0x43f839[_0xc20a('0x41')];_0x494c44+=0x1){_0x569ad9=_0x43f839[_0x494c44];if(_[_0xc20a('0x42')](_0x1ac646[_0xc20a('0x1c')][_0x569ad9['id']])){_0x1ac646[_0xc20a('0x1c')][_0x569ad9['id']]=new SalesforceAccount(_0x569ad9);}else{_0x1ac646[_0xc20a('0x40')](_0x1ac646[_0xc20a('0x1c')][_0x569ad9['id']],_0x569ad9);}}}return _0x1ac646[_0xc20a('0x1c')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x4b')]=function(){var _0x2686f5=this;return function(_0xc288a8){if(_0xc288a8){freeIsNotKey(_0xc288a8,_0x2686f5['freshdeskAccounts'],'id');for(var _0x1c6716=0x0,_0x4dae8e={},_0x2dde0b={};_0x1c6716<_0xc288a8[_0xc20a('0x41')];_0x1c6716+=0x1){_0x4dae8e=_0xc288a8[_0x1c6716];if(_[_0xc20a('0x42')](_0x2686f5[_0xc20a('0x1e')][_0x4dae8e['id']])){_0x2686f5[_0xc20a('0x1e')][_0x4dae8e['id']]=new FreshdeskAccount(_0x4dae8e);}else{_0x2686f5[_0xc20a('0x40')](_0x2686f5['freshdeskAccounts'][_0x4dae8e['id']],_0x4dae8e);}}}return _0x2686f5['freshdeskAccounts'];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x4c')]=function(){var _0x52ad07=this;return function(_0x14d507){if(_0x14d507){freeIsNotKey(_0x14d507,_0x52ad07[_0xc20a('0x1f')],'id');for(var _0x1ba353=0x0,_0x4efce8={},_0x47f22c={};_0x1ba353<_0x14d507['length'];_0x1ba353+=0x1){_0x4efce8=_0x14d507[_0x1ba353];if(_[_0xc20a('0x42')](_0x52ad07[_0xc20a('0x1f')][_0x4efce8['id']])){_0x52ad07[_0xc20a('0x1f')][_0x4efce8['id']]=new ZohoAccount(_0x4efce8);}else{_0x52ad07['mergeFromDatabase'](_0x52ad07[_0xc20a('0x1f')][_0x4efce8['id']],_0x4efce8);}}}return _0x52ad07[_0xc20a('0x1f')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x4d')]=function(){var _0x168380=this;return function(_0xb9795e){if(_0xb9795e){freeIsNotKey(_0xb9795e,_0x168380[_0xc20a('0x4e')],'id');for(var _0x17a1f9=0x0,_0x40c3df={},_0x2c5eba={};_0x17a1f9<_0xb9795e[_0xc20a('0x41')];_0x17a1f9+=0x1){_0x40c3df=_0xb9795e[_0x17a1f9];if(_[_0xc20a('0x42')](_0x168380['deskAccounts'][_0x40c3df['id']])){_0x168380[_0xc20a('0x4e')][_0x40c3df['id']]=new DeskAccount(_0x40c3df);}else{_0x168380[_0xc20a('0x40')](_0x168380[_0xc20a('0x4e')][_0x40c3df['id']],_0x40c3df);}}}return _0x168380[_0xc20a('0x4e')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x4f')]=function(){var _0x37224c=this;return function(_0x5de212){if(_0x5de212){freeIsNotKey(_0x5de212,_0x37224c[_0xc20a('0x1d')],'id');for(var _0x3dc599=0x0,_0x102654={},_0x5e3827={};_0x3dc599<_0x5de212['length'];_0x3dc599+=0x1){_0x102654=_0x5de212[_0x3dc599];if(_[_0xc20a('0x42')](_0x37224c[_0xc20a('0x1d')][_0x102654['id']])){_0x37224c['sugarcrmAccounts'][_0x102654['id']]=new SugarcrmAccount(_0x102654);}else{_0x37224c['mergeFromDatabase'](_0x37224c[_0xc20a('0x1d')][_0x102654['id']],_0x102654);}}}return _0x37224c[_0xc20a('0x1d')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x50')]=function(){var _0x3b9439=this;return function(_0x4386c5){if(_0x4386c5){freeIsNotKey(_0x4386c5,_0x3b9439['vtigerAccounts'],'id');for(var _0x52bdee=0x0,_0x4ff30e={},_0x80af42={};_0x52bdee<_0x4386c5[_0xc20a('0x41')];_0x52bdee+=0x1){_0x4ff30e=_0x4386c5[_0x52bdee];if(_['isUndefined'](_0x3b9439[_0xc20a('0x20')][_0x4ff30e['id']])){_0x3b9439[_0xc20a('0x20')][_0x4ff30e['id']]=new VtigerAccount(_0x4ff30e);}else{_0x3b9439[_0xc20a('0x40')](_0x3b9439[_0xc20a('0x20')][_0x4ff30e['id']],_0x4ff30e);}}}return _0x3b9439[_0xc20a('0x20')];};};Realtime[_0xc20a('0x3f')]['initServicenowAccounts']=function(){var _0x2910bb=this;return function(_0x12cf94){if(_0x12cf94){freeIsNotKey(_0x12cf94,_0x2910bb[_0xc20a('0x21')],'id');for(var _0x3568d8=0x0,_0x2c4680={},_0x466126={};_0x3568d8<_0x12cf94['length'];_0x3568d8+=0x1){_0x2c4680=_0x12cf94[_0x3568d8];if(_[_0xc20a('0x42')](_0x2910bb[_0xc20a('0x21')][_0x2c4680['id']])){_0x2910bb[_0xc20a('0x21')][_0x2c4680['id']]=new ServicenowAccount(_0x2c4680);}else{_0x2910bb[_0xc20a('0x40')](_0x2910bb['servicenowAccounts'][_0x2c4680['id']],_0x2c4680);}}}return _0x2910bb[_0xc20a('0x21')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x51')]=function(){var _0x14bc1f=this;return function(_0x175c6b){if(_0x175c6b){freeIsNotKey(_0x175c6b,_0x14bc1f['dynamics365Accounts'],'id');for(var _0x17d40a=0x0,_0x2de4a3={},_0x32e323={};_0x17d40a<_0x175c6b[_0xc20a('0x41')];_0x17d40a+=0x1){_0x2de4a3=_0x175c6b[_0x17d40a];if(_[_0xc20a('0x42')](_0x14bc1f[_0xc20a('0x22')][_0x2de4a3['id']])){_0x14bc1f[_0xc20a('0x22')][_0x2de4a3['id']]=new Dynamics365Account(_0x2de4a3);}else{_0x14bc1f['mergeFromDatabase'](_0x14bc1f[_0xc20a('0x22')][_0x2de4a3['id']],_0x2de4a3);}}}return _0x14bc1f[_0xc20a('0x22')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x52')]=function(){var _0x5b9c50=this;return function(_0x46c51b){if(_0x46c51b){freeIsNotKey(_0x46c51b,_0x5b9c50[_0xc20a('0x23')],'id');for(var _0x48de95=0x0,_0x397365={},_0x3c0673={};_0x48de95<_0x46c51b[_0xc20a('0x41')];_0x48de95+=0x1){_0x397365=_0x46c51b[_0x48de95];if(_[_0xc20a('0x42')](_0x5b9c50[_0xc20a('0x23')][_0x397365['id']])){_0x5b9c50[_0xc20a('0x23')][_0x397365['id']]=new FreshsalesAccount(_0x397365);}else{_0x5b9c50[_0xc20a('0x40')](_0x5b9c50['freshsalesAccounts'][_0x397365['id']],_0x397365);}}}return _0x5b9c50[_0xc20a('0x23')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x53')]=function(){var _0x4c76a0=this;return function(_0x41f9f0){for(var _0x3e6b58=0x0;_0x3e6b58<_0x41f9f0['length'];_0x3e6b58+=0x1){_['merge'](_0x4c76a0[_0xc20a('0x17')][_0x41f9f0[_0x3e6b58]['name']],_0x41f9f0[_0x3e6b58]);}return _0x4c76a0['voiceQueues'];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x54')]=function(){var _0x3f434b=this;return function(_0x5c57ec){clearVoiceQueues(_0x3f434b['voiceQueues']);if(_0x5c57ec){_0x5c57ec=_['groupBy'](_0x5c57ec,_0xc20a('0x55'));for(var _0x292ae8 in _0x5c57ec){if(_0x5c57ec[_0xc20a('0x2b')](_0x292ae8)){var _0x1bdaeb={};for(var _0x1c5394=0x0;_0x1c5394<_0x5c57ec[_0x292ae8][_0xc20a('0x41')];_0x1c5394+=0x1){var _0x330380=_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x56')];if(_0x3f434b[_0xc20a('0x17')][_0x330380]){if(_0x5c57ec[_0x292ae8][_0x1c5394]['queuecallerexit']){_0x3f434b['voiceQueues'][_0x330380][_0xc20a('0x33')]+=0x1;}if(_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x57')]){_0x3f434b[_0xc20a('0x17')][_0x330380][_0xc20a('0x34')]+=0x1;}_0x3f434b['voiceQueues'][_0x330380]['sumHoldTime']+=moment(_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x58')])['diff'](moment(_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x59')]),_0xc20a('0x5a'))||0x0;if(_0x1c5394===_0x5c57ec[_0x292ae8][_0xc20a('0x41')]-0x1){_0x3f434b[_0xc20a('0x17')][_0x330380][_0xc20a('0x2d')]+=moment(_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x5b')]||_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x5c')]||_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x5d')])['diff'](moment(_0x5c57ec[_0x292ae8][_0x1c5394]['queuecallerjoinAt']),_0xc20a('0x5a'))||0x0;_0x3f434b[_0xc20a('0x17')][_0x330380]['total']+=0x1;if(_0x5c57ec[_0x292ae8][_0x1c5394]['queuecallercomplete']){_0x3f434b['voiceQueues'][_0x330380][_0xc20a('0x2c')]+=0x1;_0x3f434b[_0xc20a('0x17')][_0x330380]['sumBillable']+=moment(_0x5c57ec[_0x292ae8][_0x1c5394]['queuecallercompleteAt'])[_0xc20a('0x5e')](moment(_0x5c57ec[_0x292ae8][_0x1c5394][_0xc20a('0x58')]),_0xc20a('0x5a'))||0x0;}}else{_0x3f434b[_0xc20a('0x17')][_0x330380]['sumDuration']+=_0x3f434b['voiceQueues'][_0x330380][_0xc20a('0x5f')]||0x0;}}}}}}return _0x3f434b['voiceQueues'];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x1a9322=this;return function(_0x448146){clearVoiceCallReports(_0x1a9322[_0xc20a('0x18')]);if(_0x448146){for(var _0x56b0ff=0x0;_0x56b0ff<_0x448146[_0xc20a('0x41')];_0x56b0ff+=0x1){_0x1a9322[_0xc20a('0x18')][_0xc20a('0x32')]+=0x1;_0x1a9322[_0xc20a('0x18')][_0xc20a('0x2d')]+=_0x448146[_0x56b0ff][_0xc20a('0x60')];if(_0x448146[_0x56b0ff]['disposition']===_0xc20a('0x61')){_0x1a9322[_0xc20a('0x18')]['answered']+=0x1;_0x1a9322[_0xc20a('0x18')][_0xc20a('0x5f')]+=_0x448146[_0x56b0ff][_0xc20a('0x60')]-_0x448146[_0x56b0ff][_0xc20a('0x62')]||0x0;_0x1a9322[_0xc20a('0x18')][_0xc20a('0x2e')]+=_0x448146[_0x56b0ff][_0xc20a('0x62')];}}}return _0x1a9322[_0xc20a('0x18')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x63')]=function(){var _0x3c9bc0=this;return function(_0x208678){if(_0x208678){freeIsNotKey(_0x208678,_0x3c9bc0[_0xc20a('0x64')],_0xc20a('0x27'));for(var _0x4170bf=0x0,_0x44ae11={};_0x4170bf<_0x208678[_0xc20a('0x41')];_0x4170bf+=0x1){_0x44ae11=_0x208678[_0x4170bf];if(_[_0xc20a('0x42')](_0x3c9bc0[_0xc20a('0x64')][_0x44ae11[_0xc20a('0x27')]])){_0x3c9bc0['campaigns'][_0x44ae11[_0xc20a('0x27')]]=new Campaign(_0x44ae11);}else{_0x3c9bc0[_0xc20a('0x40')](_0x3c9bc0['campaigns'][_0x44ae11[_0xc20a('0x27')]],_0x44ae11);_0x3c9bc0[_0xc20a('0x64')][_0x44ae11[_0xc20a('0x27')]][_0xc20a('0x65')]=_0x44ae11[_0xc20a('0x66')]?_0x44ae11['SquareProject'][_0xc20a('0x27')]:undefined;}}}return _0x3c9bc0['campaigns'];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x67')]=function(){var _0x2085dc=this;return function(_0x14ddb5){if(_0x14ddb5){freeIsNotKey(_0x14ddb5,_0x2085dc['voiceExtensions'],'id');for(var _0x57e300=0x0,_0x2e4bc2={};_0x57e300<_0x14ddb5[_0xc20a('0x41')];_0x57e300+=0x1){_0x2e4bc2=_0x14ddb5[_0x57e300];if(_['isUndefined'](_0x2085dc[_0xc20a('0x68')][_0x2e4bc2['id']])){_0x2085dc[_0xc20a('0x68')][_0x2e4bc2['id']]=new VoiceExtension(_0x2e4bc2);}else{_0x2085dc[_0xc20a('0x40')](_0x2085dc['voiceExtensions'][_0x2e4bc2['id']],_0x2e4bc2);}}}return _0x2085dc[_0xc20a('0x68')];};};Realtime[_0xc20a('0x3f')]['initCampaignHopperHistory']=function(){var _0x18cfa1=this;return function(_0x186514){clearCampaigns(_0x18cfa1[_0xc20a('0x64')]);for(var _0x1e957d=0x0;_0x1e957d<_0x186514[_0xc20a('0x41')];_0x1e957d+=0x1){_[_0xc20a('0x69')](_0x18cfa1[_0xc20a('0x64')][_0x186514[_0x1e957d][_0xc20a('0x27')]],_0x186514[_0x1e957d]);}return _0x18cfa1[_0xc20a('0x64')];};};Realtime[_0xc20a('0x3f')][_0xc20a('0x6a')]=function(){var _0x36ce5a=this;return function(_0x8e506d){if(_0x8e506d){freeIsNotKey(_0x8e506d,_0x36ce5a[_0xc20a('0x24')],'id');for(var _0x26508e=0x0,_0x50fe98={},_0x51ba9d={};_0x26508e<_0x8e506d[_0xc20a('0x41')];_0x26508e+=0x1){_0x50fe98=_0x8e506d[_0x26508e];if(_[_0xc20a('0x42')](_0x36ce5a[_0xc20a('0x24')][_0x50fe98['id']])){_0x36ce5a[_0xc20a('0x24')][_0x50fe98['id']]=new FaxAccount(_0x50fe98);}else{_0x36ce5a[_0xc20a('0x40')](_0x36ce5a[_0xc20a('0x24')][_0x50fe98['id']],_0x50fe98);}}}return _0x36ce5a[_0xc20a('0x24')];};};module['exports']=Realtime; \ No newline at end of file +var _0x2398=['initFaxAccounts','exports','bluebird','lodash','../model/telephone','../model/trunk','../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','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','name','interface','SIP/%s','hasOwnProperty','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initTrunks','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','freshsalesAccounts','merge','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','diff','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initCampaignHopperHistory'];(function(_0x7cb86e,_0x241644){var _0x29b719=function(_0x5be106){while(--_0x5be106){_0x7cb86e['push'](_0x7cb86e['shift']());}};_0x29b719(++_0x241644);}(_0x2398,0x1b6));var _0x8239=function(_0x391226,_0x8c74cd){_0x391226=_0x391226-0x0;var _0x46e0c9=_0x2398[_0x391226];return _0x46e0c9;};'use strict';var BPromise=require(_0x8239('0x0'));var util=require('util');var _=require(_0x8239('0x1'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x8239('0x2'));var Trunk=require(_0x8239('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x8239('0x4'));var Template=require(_0x8239('0x5'));var Campaign=require(_0x8239('0x6'));var VoiceExtension=require(_0x8239('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x8239('0x8'));var FreshdeskAccount=require(_0x8239('0x9'));var SugarcrmAccount=require(_0x8239('0xa'));var ZohoAccount=require(_0x8239('0xb'));var DeskAccount=require(_0x8239('0xc'));var VtigerAccount=require(_0x8239('0xd'));var ServicenowAccount=require(_0x8239('0xe'));var Dynamics365Account=require(_0x8239('0xf'));var FreshsalesAccount=require(_0x8239('0x10'));var FaxAccount=require(_0x8239('0x11'));var Realtime=function(){this[_0x8239('0x12')]={};this[_0x8239('0x13')]={};this[_0x8239('0x14')]={};this['voiceQueues']={};this[_0x8239('0x15')]={};this['campaigns']={};this[_0x8239('0x16')]={};this[_0x8239('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8239('0x18')]={};this[_0x8239('0x19')]={};this[_0x8239('0x1a')]={};this[_0x8239('0x1b')]={};this[_0x8239('0x1c')]={};this[_0x8239('0x1d')]={};this[_0x8239('0x1e')]={};this[_0x8239('0x1f')]={};this[_0x8239('0x20')]={};this['freshdeskAccounts']={};this[_0x8239('0x21')]={};this['deskAccounts']={};this[_0x8239('0x22')]={};this['servicenowAccounts']={};this[_0x8239('0x23')]={};this['freshsalesAccounts']={};this[_0x8239('0x24')]={};};function freeIsNotKey(_0x1f6f63,_0x28d36f,_0x7bea93){var _0x54e7a2=_[_0x8239('0x25')](_0x1f6f63,function(_0x181a84,_0x3d40fd){return _0x181a84[_0x7bea93];});for(var _0x722b3f in _0x28d36f){if(_0x28d36f['hasOwnProperty'](_0x722b3f)){if(!_0x54e7a2[_0x722b3f]){delete _0x28d36f[_0x722b3f];}}}}function freeIsNotKeySip(_0x481e2f,_0x5872cf){var _0x8bdd81=_[_0x8239('0x25')](_0x481e2f,function(_0x4267a2,_0x5b2603){return util[_0x8239('0x26')]('SIP/%s',_0x4267a2[_0x8239('0x27')]);});for(var _0x7fb2c5 in _0x5872cf){if(_0x5872cf['hasOwnProperty'](_0x7fb2c5)){if(!_0x8bdd81[_0x7fb2c5]){delete _0x5872cf[_0x7fb2c5];}}}}function freeIsNotKeyAgent(_0xe32eae,_0x34bae1){var _0x17b0e5=_[_0x8239('0x25')](_0xe32eae,function(_0x4ef1ce,_0x5535bf){var _0x3a1815=_['isNil'](_0x4ef1ce[_0x8239('0x28')])?util[_0x8239('0x26')](_0x8239('0x29'),_0x4ef1ce[_0x8239('0x27')]):_0x4ef1ce['interface'];return _0x3a1815;});for(var _0x3e9782 in _0x34bae1){if(_0x34bae1[_0x8239('0x2a')](_0x3e9782)){if(!_0x17b0e5[_0x3e9782]){delete _0x34bae1[_0x3e9782];}}}}function clearVoiceCallReports(_0x429aaf){_0x429aaf['total']=0x0;_0x429aaf[_0x8239('0x2b')]=0x0;_0x429aaf[_0x8239('0x2c')]=0x0;_0x429aaf[_0x8239('0x2d')]=0x0;_0x429aaf[_0x8239('0x2e')]=0x0;}function clearCampaigns(_0x48a945){if(!_[_0x8239('0x2f')](_0x48a945)){for(var _0x13c8bc in _0x48a945){if(_0x48a945['hasOwnProperty'](_0x13c8bc)){_0x48a945[_0x13c8bc][_0x8239('0x30')]=0x0;_0x48a945[_0x13c8bc][_0x8239('0x31')]=0x0;}}}}function clearVoiceQueues(_0x2730c6){if(!_['isEmpty'](_0x2730c6)){for(var _0x9d40fe in _0x2730c6){if(_0x2730c6[_0x8239('0x2a')](_0x9d40fe)){_0x2730c6[_0x9d40fe][_0x8239('0x32')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x2b')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x33')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x34')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x2c')]=0x0;_0x2730c6[_0x9d40fe]['sumDuration']=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x2e')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x35')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x36')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x37')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x38')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x39')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x3a')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x3b')]=0x0;_0x2730c6[_0x9d40fe]['outboundDropCallsDayCallersExit']=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x3c')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x3d')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x3e')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x3f')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x35')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x40')]=0x0;_0x2730c6[_0x9d40fe][_0x8239('0x41')]=!![];}}}}Realtime['prototype'][_0x8239('0x42')]=function(_0x58aafb,_0x2ca3c7){for(var _0x3a4085 in _0x2ca3c7){if(_0x58aafb[_0x8239('0x2a')](_0x3a4085)){_0x58aafb[_0x3a4085]=_0x2ca3c7[_0x3a4085];}}};Realtime[_0x8239('0x43')][_0x8239('0x44')]=function(){var _0x503314=this;return function(_0x511135){if(_0x511135){freeIsNotKeyAgent(_0x511135,_0x503314[_0x8239('0x12')]);for(var _0x2f5a94=0x0,_0x257a21={},_0x189d54={};_0x2f5a94<_0x511135[_0x8239('0x45')];_0x2f5a94+=0x1){_0x257a21=_0x511135[_0x2f5a94];var _0x4afbb2=_['isNil'](_0x257a21['interface'])?util[_0x8239('0x26')]('SIP/%s',_0x257a21[_0x8239('0x27')]):_0x257a21[_0x8239('0x28')];if(_[_0x8239('0x46')](_0x503314[_0x8239('0x12')][_0x4afbb2])){_0x503314[_0x8239('0x12')][_0x4afbb2]=new Agent(_0x257a21);}else{_0x503314[_0x8239('0x42')](_0x503314[_0x8239('0x12')][_0x4afbb2],_0x257a21);}}}return _0x503314['agents'];};};Realtime[_0x8239('0x43')][_0x8239('0x47')]=function(){var _0x112e7b=this;return function(_0xd5df7e){if(_0xd5df7e){freeIsNotKeySip(_0xd5df7e,_0x112e7b['telephones']);for(var _0x2bd89e=0x0,_0x462715={},_0x941fb3={};_0x2bd89e<_0xd5df7e[_0x8239('0x45')];_0x2bd89e+=0x1){_0x462715=_0xd5df7e[_0x2bd89e];if(_[_0x8239('0x46')](_0x112e7b[_0x8239('0x13')][util[_0x8239('0x26')](_0x8239('0x29'),_0x462715[_0x8239('0x27')])])){_0x112e7b['telephones'][util[_0x8239('0x26')](_0x8239('0x29'),_0x462715['name'])]=new Telephone(_0x462715);}else{_0x112e7b[_0x8239('0x42')](_0x112e7b[_0x8239('0x13')][util[_0x8239('0x26')](_0x8239('0x29'),_0x462715['name'])],_0x462715);}}}return _0x112e7b['telephones'];};};Realtime[_0x8239('0x43')][_0x8239('0x48')]=function(){var _0x34cf99=this;return function(_0x30fda1){if(_0x30fda1){freeIsNotKeySip(_0x30fda1,_0x34cf99[_0x8239('0x14')]);for(var _0x9faa51=0x0,_0x153d86={},_0x1868c9={};_0x9faa51<_0x30fda1[_0x8239('0x45')];_0x9faa51+=0x1){_0x153d86=_0x30fda1[_0x9faa51];if(_[_0x8239('0x46')](_0x34cf99[_0x8239('0x14')][util[_0x8239('0x26')](_0x8239('0x29'),_0x153d86['name'])])){_0x34cf99[_0x8239('0x14')][util['format'](_0x8239('0x29'),_0x153d86['name'])]=new Trunk(_0x153d86);}else{_0x34cf99['mergeFromDatabase'](_0x34cf99['trunks'][util[_0x8239('0x26')](_0x8239('0x29'),_0x153d86['name'])],_0x153d86);}}}return _0x34cf99['trunks'];};};Realtime[_0x8239('0x43')]['initVoiceQueues']=function(){var _0x146a4a=this;return function(_0xb5c1e9){if(_0xb5c1e9){freeIsNotKey(_0xb5c1e9,_0x146a4a['voiceQueues'],_0x8239('0x27'));for(var _0x5a6749=0x0,_0x23ab22={},_0x46303f={};_0x5a6749<_0xb5c1e9[_0x8239('0x45')];_0x5a6749+=0x1){_0x23ab22=_0xb5c1e9[_0x5a6749];if(_[_0x8239('0x46')](_0x146a4a['voiceQueues'][_0x23ab22[_0x8239('0x27')]])){_0x146a4a[_0x8239('0x49')][_0x23ab22[_0x8239('0x27')]]=new VoiceQueue(_0x23ab22);}else{_0x146a4a['mergeFromDatabase'](_0x146a4a['voiceQueues'][_0x23ab22[_0x8239('0x27')]],_0x23ab22);}}}return _0x146a4a['voiceQueues'];};};Realtime[_0x8239('0x43')][_0x8239('0x4a')]=function(){var _0xbde48d=this;return function(_0x53e47b){if(_0x53e47b){freeIsNotKey(_0x53e47b,_0xbde48d[_0x8239('0x15')],'id');for(var _0x393538=0x0,_0xb54730={},_0x58b79f={};_0x393538<_0x53e47b[_0x8239('0x45')];_0x393538+=0x1){_0xb54730=_0x53e47b[_0x393538];if(_[_0x8239('0x46')](_0xbde48d[_0x8239('0x15')][_0xb54730['id']])){_0xbde48d['triggers'][_0xb54730['id']]=new Trigger(_0xb54730);}else{_0xbde48d['mergeFromDatabase'](_0xbde48d[_0x8239('0x15')][_0xb54730['id']],_0xb54730);}}}return _0xbde48d[_0x8239('0x15')];};};Realtime[_0x8239('0x43')][_0x8239('0x4b')]=function(){var _0xa65350=this;return function(_0x3d5113){if(_0x3d5113){freeIsNotKey(_0x3d5113,_0xa65350[_0x8239('0x16')],'id');for(var _0x4a9166=0x0,_0x1a2925={},_0x21fde0={};_0x4a9166<_0x3d5113[_0x8239('0x45')];_0x4a9166+=0x1){_0x1a2925=_0x3d5113[_0x4a9166];if(_[_0x8239('0x46')](_0xa65350['templates'][_0x1a2925['id']])){_0xa65350[_0x8239('0x16')][_0x1a2925['id']]=new Template(_0x1a2925);}else{_0xa65350[_0x8239('0x42')](_0xa65350['templates'][_0x1a2925['id']],_0x1a2925);}}}return _0xa65350[_0x8239('0x16')];};};Realtime['prototype'][_0x8239('0x4c')]=function(){var _0x36f4fc=this;return function(_0x3de0cc){if(_0x3de0cc){freeIsNotKey(_0x3de0cc,_0x36f4fc[_0x8239('0x1e')],'id');for(var _0x20fd86=0x0,_0x47c541={},_0x55cee0={};_0x20fd86<_0x3de0cc[_0x8239('0x45')];_0x20fd86+=0x1){_0x47c541=_0x3de0cc[_0x20fd86];if(_[_0x8239('0x46')](_0x36f4fc[_0x8239('0x1e')][_0x47c541['id']])){_0x36f4fc[_0x8239('0x1e')][_0x47c541['id']]=new ZendeskAccount(_0x47c541);}else{_0x36f4fc[_0x8239('0x42')](_0x36f4fc[_0x8239('0x1e')][_0x47c541['id']],_0x47c541);}}}return _0x36f4fc[_0x8239('0x1e')];};};Realtime[_0x8239('0x43')][_0x8239('0x4d')]=function(){var _0x138aec=this;return function(_0x23b0a6){if(_0x23b0a6){freeIsNotKey(_0x23b0a6,_0x138aec['salesforceAccounts'],'id');for(var _0x41ba62=0x0,_0x6348b3={},_0x33135f={};_0x41ba62<_0x23b0a6['length'];_0x41ba62+=0x1){_0x6348b3=_0x23b0a6[_0x41ba62];if(_[_0x8239('0x46')](_0x138aec[_0x8239('0x1f')][_0x6348b3['id']])){_0x138aec[_0x8239('0x1f')][_0x6348b3['id']]=new SalesforceAccount(_0x6348b3);}else{_0x138aec[_0x8239('0x42')](_0x138aec[_0x8239('0x1f')][_0x6348b3['id']],_0x6348b3);}}}return _0x138aec[_0x8239('0x1f')];};};Realtime[_0x8239('0x43')][_0x8239('0x4e')]=function(){var _0x1056b1=this;return function(_0x3e709a){if(_0x3e709a){freeIsNotKey(_0x3e709a,_0x1056b1[_0x8239('0x4f')],'id');for(var _0x1b9dd7=0x0,_0xfb1aed={},_0x47ad19={};_0x1b9dd7<_0x3e709a[_0x8239('0x45')];_0x1b9dd7+=0x1){_0xfb1aed=_0x3e709a[_0x1b9dd7];if(_['isUndefined'](_0x1056b1[_0x8239('0x4f')][_0xfb1aed['id']])){_0x1056b1[_0x8239('0x4f')][_0xfb1aed['id']]=new FreshdeskAccount(_0xfb1aed);}else{_0x1056b1[_0x8239('0x42')](_0x1056b1[_0x8239('0x4f')][_0xfb1aed['id']],_0xfb1aed);}}}return _0x1056b1[_0x8239('0x4f')];};};Realtime['prototype'][_0x8239('0x50')]=function(){var _0x44c05d=this;return function(_0x553ac1){if(_0x553ac1){freeIsNotKey(_0x553ac1,_0x44c05d[_0x8239('0x21')],'id');for(var _0x1b1bf0=0x0,_0x1b3204={},_0x1d20ef={};_0x1b1bf0<_0x553ac1['length'];_0x1b1bf0+=0x1){_0x1b3204=_0x553ac1[_0x1b1bf0];if(_[_0x8239('0x46')](_0x44c05d[_0x8239('0x21')][_0x1b3204['id']])){_0x44c05d[_0x8239('0x21')][_0x1b3204['id']]=new ZohoAccount(_0x1b3204);}else{_0x44c05d['mergeFromDatabase'](_0x44c05d[_0x8239('0x21')][_0x1b3204['id']],_0x1b3204);}}}return _0x44c05d[_0x8239('0x21')];};};Realtime[_0x8239('0x43')][_0x8239('0x51')]=function(){var _0x1af06d=this;return function(_0x10494e){if(_0x10494e){freeIsNotKey(_0x10494e,_0x1af06d[_0x8239('0x52')],'id');for(var _0x5baafa=0x0,_0x3c840a={},_0x11e182={};_0x5baafa<_0x10494e['length'];_0x5baafa+=0x1){_0x3c840a=_0x10494e[_0x5baafa];if(_[_0x8239('0x46')](_0x1af06d['deskAccounts'][_0x3c840a['id']])){_0x1af06d[_0x8239('0x52')][_0x3c840a['id']]=new DeskAccount(_0x3c840a);}else{_0x1af06d[_0x8239('0x42')](_0x1af06d['deskAccounts'][_0x3c840a['id']],_0x3c840a);}}}return _0x1af06d[_0x8239('0x52')];};};Realtime[_0x8239('0x43')][_0x8239('0x53')]=function(){var _0x5cb77c=this;return function(_0x4cd6b8){if(_0x4cd6b8){freeIsNotKey(_0x4cd6b8,_0x5cb77c[_0x8239('0x20')],'id');for(var _0x2df81e=0x0,_0x31a83b={},_0x232870={};_0x2df81e<_0x4cd6b8[_0x8239('0x45')];_0x2df81e+=0x1){_0x31a83b=_0x4cd6b8[_0x2df81e];if(_[_0x8239('0x46')](_0x5cb77c[_0x8239('0x20')][_0x31a83b['id']])){_0x5cb77c[_0x8239('0x20')][_0x31a83b['id']]=new SugarcrmAccount(_0x31a83b);}else{_0x5cb77c[_0x8239('0x42')](_0x5cb77c['sugarcrmAccounts'][_0x31a83b['id']],_0x31a83b);}}}return _0x5cb77c[_0x8239('0x20')];};};Realtime['prototype'][_0x8239('0x54')]=function(){var _0x5742b5=this;return function(_0x5dcb56){if(_0x5dcb56){freeIsNotKey(_0x5dcb56,_0x5742b5[_0x8239('0x22')],'id');for(var _0x52a634=0x0,_0x462764={},_0x5e5e02={};_0x52a634<_0x5dcb56[_0x8239('0x45')];_0x52a634+=0x1){_0x462764=_0x5dcb56[_0x52a634];if(_[_0x8239('0x46')](_0x5742b5['vtigerAccounts'][_0x462764['id']])){_0x5742b5[_0x8239('0x22')][_0x462764['id']]=new VtigerAccount(_0x462764);}else{_0x5742b5['mergeFromDatabase'](_0x5742b5[_0x8239('0x22')][_0x462764['id']],_0x462764);}}}return _0x5742b5[_0x8239('0x22')];};};Realtime[_0x8239('0x43')][_0x8239('0x55')]=function(){var _0x9b0f25=this;return function(_0x119e2f){if(_0x119e2f){freeIsNotKey(_0x119e2f,_0x9b0f25[_0x8239('0x56')],'id');for(var _0x5e211f=0x0,_0x162bc1={},_0xf653ea={};_0x5e211f<_0x119e2f[_0x8239('0x45')];_0x5e211f+=0x1){_0x162bc1=_0x119e2f[_0x5e211f];if(_[_0x8239('0x46')](_0x9b0f25[_0x8239('0x56')][_0x162bc1['id']])){_0x9b0f25['servicenowAccounts'][_0x162bc1['id']]=new ServicenowAccount(_0x162bc1);}else{_0x9b0f25[_0x8239('0x42')](_0x9b0f25[_0x8239('0x56')][_0x162bc1['id']],_0x162bc1);}}}return _0x9b0f25[_0x8239('0x56')];};};Realtime[_0x8239('0x43')][_0x8239('0x57')]=function(){var _0x23fb40=this;return function(_0x5b4089){if(_0x5b4089){freeIsNotKey(_0x5b4089,_0x23fb40[_0x8239('0x23')],'id');for(var _0xc33b56=0x0,_0x505e4a={},_0x984d6d={};_0xc33b56<_0x5b4089[_0x8239('0x45')];_0xc33b56+=0x1){_0x505e4a=_0x5b4089[_0xc33b56];if(_[_0x8239('0x46')](_0x23fb40[_0x8239('0x23')][_0x505e4a['id']])){_0x23fb40[_0x8239('0x23')][_0x505e4a['id']]=new Dynamics365Account(_0x505e4a);}else{_0x23fb40[_0x8239('0x42')](_0x23fb40[_0x8239('0x23')][_0x505e4a['id']],_0x505e4a);}}}return _0x23fb40[_0x8239('0x23')];};};Realtime[_0x8239('0x43')]['initFreshsalesAccounts']=function(){var _0xdd7d8f=this;return function(_0x34e735){if(_0x34e735){freeIsNotKey(_0x34e735,_0xdd7d8f['freshsalesAccounts'],'id');for(var _0x2e6a71=0x0,_0x41de85={},_0x13509e={};_0x2e6a71<_0x34e735[_0x8239('0x45')];_0x2e6a71+=0x1){_0x41de85=_0x34e735[_0x2e6a71];if(_[_0x8239('0x46')](_0xdd7d8f['freshsalesAccounts'][_0x41de85['id']])){_0xdd7d8f[_0x8239('0x58')][_0x41de85['id']]=new FreshsalesAccount(_0x41de85);}else{_0xdd7d8f[_0x8239('0x42')](_0xdd7d8f[_0x8239('0x58')][_0x41de85['id']],_0x41de85);}}}return _0xdd7d8f[_0x8239('0x58')];};};Realtime[_0x8239('0x43')]['initVoiceQueueHopperHistory']=function(){var _0x37e2c8=this;return function(_0x490028){for(var _0x162073=0x0;_0x162073<_0x490028[_0x8239('0x45')];_0x162073+=0x1){_[_0x8239('0x59')](_0x37e2c8['voiceQueues'][_0x490028[_0x162073][_0x8239('0x27')]],_0x490028[_0x162073]);}return _0x37e2c8['voiceQueues'];};};Realtime[_0x8239('0x43')]['initVoiceQueueReports']=function(){var _0x39101e=this;return function(_0x5d5e0c){clearVoiceQueues(_0x39101e[_0x8239('0x49')]);if(_0x5d5e0c){_0x5d5e0c=_[_0x8239('0x5a')](_0x5d5e0c,'uniqueid');for(var _0x2b621e in _0x5d5e0c){if(_0x5d5e0c[_0x8239('0x2a')](_0x2b621e)){var _0x1bc56d={};for(var _0x4e123e=0x0;_0x4e123e<_0x5d5e0c[_0x2b621e][_0x8239('0x45')];_0x4e123e+=0x1){var _0xaeead=_0x5d5e0c[_0x2b621e][_0x4e123e]['queue'];if(_0x39101e['voiceQueues'][_0xaeead]){if(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x5b')]){_0x39101e['voiceQueues'][_0xaeead][_0x8239('0x33')]+=0x1;}if(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x5c')]){_0x39101e[_0x8239('0x49')][_0xaeead][_0x8239('0x34')]+=0x1;}_0x39101e[_0x8239('0x49')][_0xaeead][_0x8239('0x2c')]+=moment(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x5d')])['diff'](moment(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x5e')]),_0x8239('0x5f'))||0x0;if(_0x4e123e===_0x5d5e0c[_0x2b621e][_0x8239('0x45')]-0x1){_0x39101e['voiceQueues'][_0xaeead][_0x8239('0x2d')]+=moment(_0x5d5e0c[_0x2b621e][_0x4e123e]['queuecallercompleteAt']||_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x60')]||_0x5d5e0c[_0x2b621e][_0x4e123e]['queuecallerexitAt'])[_0x8239('0x61')](moment(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x5e')]),_0x8239('0x5f'))||0x0;_0x39101e['voiceQueues'][_0xaeead][_0x8239('0x32')]+=0x1;if(_0x5d5e0c[_0x2b621e][_0x4e123e]['queuecallercomplete']){_0x39101e[_0x8239('0x49')][_0xaeead][_0x8239('0x2b')]+=0x1;_0x39101e[_0x8239('0x49')][_0xaeead][_0x8239('0x2e')]+=moment(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x62')])[_0x8239('0x61')](moment(_0x5d5e0c[_0x2b621e][_0x4e123e][_0x8239('0x5d')]),'seconds')||0x0;}}else{_0x39101e['voiceQueues'][_0xaeead][_0x8239('0x2d')]+=_0x39101e[_0x8239('0x49')][_0xaeead]['sumHoldTime']||0x0;}}}}}}return _0x39101e[_0x8239('0x49')];};};Realtime[_0x8239('0x43')][_0x8239('0x63')]=function(){var _0x1cc621=this;return function(_0x5f0e83){clearVoiceCallReports(_0x1cc621['outbound']);if(_0x5f0e83){for(var _0x559b4a=0x0;_0x559b4a<_0x5f0e83[_0x8239('0x45')];_0x559b4a+=0x1){_0x1cc621[_0x8239('0x17')][_0x8239('0x32')]+=0x1;_0x1cc621[_0x8239('0x17')]['sumDuration']+=_0x5f0e83[_0x559b4a][_0x8239('0x64')];if(_0x5f0e83[_0x559b4a][_0x8239('0x65')]===_0x8239('0x66')){_0x1cc621[_0x8239('0x17')]['answered']+=0x1;_0x1cc621[_0x8239('0x17')][_0x8239('0x2c')]+=_0x5f0e83[_0x559b4a][_0x8239('0x64')]-_0x5f0e83[_0x559b4a][_0x8239('0x67')]||0x0;_0x1cc621[_0x8239('0x17')]['sumBillable']+=_0x5f0e83[_0x559b4a][_0x8239('0x67')];}}}return _0x1cc621['outbound'];};};Realtime[_0x8239('0x43')][_0x8239('0x68')]=function(){var _0x34f95f=this;return function(_0x3de210){if(_0x3de210){freeIsNotKey(_0x3de210,_0x34f95f['campaigns'],_0x8239('0x27'));for(var _0x526204=0x0,_0x4ee66d={};_0x526204<_0x3de210[_0x8239('0x45')];_0x526204+=0x1){_0x4ee66d=_0x3de210[_0x526204];if(_['isUndefined'](_0x34f95f[_0x8239('0x69')][_0x4ee66d[_0x8239('0x27')]])){_0x34f95f[_0x8239('0x69')][_0x4ee66d[_0x8239('0x27')]]=new Campaign(_0x4ee66d);}else{_0x34f95f[_0x8239('0x42')](_0x34f95f['campaigns'][_0x4ee66d[_0x8239('0x27')]],_0x4ee66d);_0x34f95f['campaigns'][_0x4ee66d[_0x8239('0x27')]]['dialQueueProject']=_0x4ee66d['SquareProject']?_0x4ee66d['SquareProject'][_0x8239('0x27')]:undefined;}}}return _0x34f95f['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x5117b3=this;return function(_0x497f17){if(_0x497f17){freeIsNotKey(_0x497f17,_0x5117b3[_0x8239('0x18')],'id');for(var _0xe013a0=0x0,_0x31c5eb={};_0xe013a0<_0x497f17['length'];_0xe013a0+=0x1){_0x31c5eb=_0x497f17[_0xe013a0];if(_['isUndefined'](_0x5117b3[_0x8239('0x18')][_0x31c5eb['id']])){_0x5117b3[_0x8239('0x18')][_0x31c5eb['id']]=new VoiceExtension(_0x31c5eb);}else{_0x5117b3['mergeFromDatabase'](_0x5117b3[_0x8239('0x18')][_0x31c5eb['id']],_0x31c5eb);}}}return _0x5117b3[_0x8239('0x18')];};};Realtime[_0x8239('0x43')][_0x8239('0x6a')]=function(){var _0x1bd235=this;return function(_0x102999){clearCampaigns(_0x1bd235['campaigns']);for(var _0x27c0ee=0x0;_0x27c0ee<_0x102999[_0x8239('0x45')];_0x27c0ee+=0x1){_[_0x8239('0x59')](_0x1bd235[_0x8239('0x69')][_0x102999[_0x27c0ee][_0x8239('0x27')]],_0x102999[_0x27c0ee]);}return _0x1bd235[_0x8239('0x69')];};};Realtime['prototype'][_0x8239('0x6b')]=function(){var _0x6f93ee=this;return function(_0x28ec16){if(_0x28ec16){freeIsNotKey(_0x28ec16,_0x6f93ee[_0x8239('0x24')],'id');for(var _0x41581a=0x0,_0x532d6f={},_0x553205={};_0x41581a<_0x28ec16[_0x8239('0x45')];_0x41581a+=0x1){_0x532d6f=_0x28ec16[_0x41581a];if(_[_0x8239('0x46')](_0x6f93ee[_0x8239('0x24')][_0x532d6f['id']])){_0x6f93ee[_0x8239('0x24')][_0x532d6f['id']]=new FaxAccount(_0x532d6f);}else{_0x6f93ee['mergeFromDatabase'](_0x6f93ee[_0x8239('0x24')][_0x532d6f['id']],_0x532d6f);}}}return _0x6f93ee[_0x8239('0x24')];};};module[_0x8239('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 136038a..db00a92 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 _0x1bc7=['voiceAgentReport','isArray','voiceDialReport','channel','Local','substring','indexOf','phone','lastIndexOf','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','find','name','isNil','accountcode','interface','length','findAgent','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','destination','callerid','from-sip','xcally-motion-preview','calleridnum','destinationchannel','calleridpreview','originatecalleridnum','disposition','calleridname','linkedid','transfers','transfereelinkedid','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','connectedlinenum','xcally-motion-dialer'];(function(_0x4332ce,_0x41a438){var _0x27ca0e=function(_0x37fa8e){while(--_0x37fa8e){_0x4332ce['push'](_0x4332ce['shift']());}};_0x27ca0e(++_0x41a438);}(_0x1bc7,0x1bc));var _0x71bc=function(_0x699ab0,_0x292661){_0x699ab0=_0x699ab0-0x0;var _0x9558bb=_0x1bc7[_0x699ab0];return _0x9558bb;};'use strict';var _=require(_0x71bc('0x0'));var moment=require(_0x71bc('0x1'));var util=require(_0x71bc('0x2'));var config=require(_0x71bc('0x3'));var ami=require(_0x71bc('0x4'));var RpcVoiceAgentReport=require(_0x71bc('0x5'));var RpcVoiceCallReport=require(_0x71bc('0x6'));var RpcVoiceDialReport=require(_0x71bc('0x7'));var RpcMemberReport=require(_0x71bc('0x8'));var RpcVoiceQueueReport=require(_0x71bc('0x9'));var RpcVoiceRecording=require(_0x71bc('0xa'));var RpcVoiceTransferReport=require(_0x71bc('0xb'));var VoiceQueueReport=require(_0x71bc('0xc'));var VoiceCallReport=require(_0x71bc('0xd'));var VoiceAgentReport=require(_0x71bc('0xe'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x71bc('0xf'));function Report(_0x34c7d2){this[_0x71bc('0x10')]=_0x34c7d2;this[_0x71bc('0x11')]=_0x34c7d2[_0x71bc('0x11')];this[_0x71bc('0x12')]=_0x34c7d2[_0x71bc('0x12')];}Report[_0x71bc('0x13')]['sync']=function(_0x2d5b39){var _0x109720=new VoiceQueueReport(this[_0x71bc('0x10')]);var _0x267989=new VoiceAgentReport(this[_0x71bc('0x10')]);var _0x32a95=new VoiceDialReport(this[_0x71bc('0x10')]);var _0x49e04d=new VoiceCallReport(this[_0x71bc('0x10')]);var _0x343d53=new UserReport(this['realtime']);if(config[_0x71bc('0x14')]&&config[_0x71bc('0x14')][_0x71bc('0x15')]){ami['on'](_0x71bc('0x16'),this[_0x71bc('0x17')]['bind'](this));ami['on'](_0x71bc('0x18'),this[_0x71bc('0x19')][_0x71bc('0x1a')](this));ami['on'](_0x71bc('0x1b'),this['voiceAgentReport'][_0x71bc('0x1a')](this));ami['on'](_0x71bc('0x1c'),this['voiceDialReport'][_0x71bc('0x1a')](this));ami['on']('blindtransfer',this[_0x71bc('0x1d')][_0x71bc('0x1a')](this));ami['on'](_0x71bc('0x1e'),this[_0x71bc('0x1f')]['bind'](this));}};Report[_0x71bc('0x13')]['findAgent']=function(_0xf9c899){var _0xd267b6;_0xd267b6=_[_0x71bc('0x20')](this[_0x71bc('0x11')],function(_0x9cbca0){return _0x9cbca0['accountcode']==_0xf9c899||_0x9cbca0[_0x71bc('0x21')]==_0xf9c899;});if(_[_0x71bc('0x22')](_0xd267b6)){var _0xec245c=_[_0x71bc('0x20')](this[_0x71bc('0x12')],function(_0x4a96c0){return _0x4a96c0[_0x71bc('0x23')]==_0xf9c899||_0x4a96c0[_0x71bc('0x21')]==_0xf9c899;});if(_0xec245c){_0xd267b6=_['find'](this[_0x71bc('0x11')],function(_0x1ad1ec){return _0x1ad1ec[_0x71bc('0x24')]==util['format']('SIP/%s',_0xec245c[_0x71bc('0x21')]);});}}return _0xd267b6;};Report[_0x71bc('0x13')][_0x71bc('0x17')]=function(_0x31ea6b){for(var _0x49ceb4=0x0;_0x49ceb4<_0x31ea6b[_0x71bc('0x25')];_0x49ceb4+=0x1){var _0x33e367=this[_0x71bc('0x26')](_0x31ea6b[_0x49ceb4]['connectedlinenum']);if(_0x33e367){_0x31ea6b[_0x49ceb4]['accountcode']=_0x33e367[_0x71bc('0x23')];_0x31ea6b[_0x49ceb4][_0x71bc('0x27')]=!![];_0x31ea6b[_0x49ceb4][_0x71bc('0x28')]=_0x33e367[_0x71bc('0x21')];_0x31ea6b[_0x49ceb4][_0x71bc('0x24')]=_[_0x71bc('0x22')](_0x33e367[_0x71bc('0x24')])?util['format'](_0x71bc('0x29'),_0x33e367[_0x71bc('0x21')]):_0x33e367[_0x71bc('0x24')];if(_0x31ea6b[_0x49ceb4][_0x71bc('0x2a')]){_0x31ea6b[_0x49ceb4][_0x71bc('0x2b')]=moment()[_0x71bc('0x2c')](_0x71bc('0x2d'));}if(_0x31ea6b[_0x49ceb4][_0x71bc('0x2e')]){_0x31ea6b[_0x49ceb4][_0x71bc('0x2f')]=moment()[_0x71bc('0x2c')](_0x71bc('0x2d'));}RpcMemberReport[_0x71bc('0x17')](_0x31ea6b[_0x49ceb4]);}RpcVoiceQueueReport['create'](_0x31ea6b[_0x49ceb4]);}};function extractCalleridNumber(_0x42d33c){var _0x675a39=_0x42d33c['match'](/<(.*?)>/);return _0x675a39?_0x675a39[0x1]:_0x42d33c;}Report[_0x71bc('0x13')][_0x71bc('0x19')]=function(_0x1231ab){_0x1231ab['destination']=_0x1231ab['destination']||_0x1231ab[_0x71bc('0x30')];if(_0x1231ab[_0x71bc('0x31')]==_0x71bc('0x32')){_0x1231ab[_0x71bc('0x33')]=_0x71bc('0x34');_0x1231ab[_0x71bc('0x35')]=_0x1231ab['queue'];if(_0x1231ab[_0x71bc('0x36')]==_0x71bc('0x37')){_0x1231ab[_0x71bc('0x23')]='';_0x1231ab[_0x71bc('0x38')]=extractCalleridNumber(_0x1231ab[_0x71bc('0x39')]);}else if(_0x1231ab['context']==_0x71bc('0x3a')){if(_0x1231ab['destination']==_0x71bc('0x3b')){_0x1231ab[_0x71bc('0x38')]=extractCalleridNumber(_0x1231ab['calleridpreview']);_0x1231ab[_0x71bc('0x3c')]=_0x1231ab['originatecalleridnum'];_0x1231ab[_0x71bc('0x3d')]=[_0x1231ab['channel'],_0x1231ab['channel']=_0x1231ab[_0x71bc('0x3d')]][0x0];_0x1231ab[_0x71bc('0x39')]=_0x1231ab[_0x71bc('0x3e')];}else{_0x1231ab[_0x71bc('0x38')]=_0x1231ab['calleridnum'];_0x1231ab[_0x71bc('0x3c')]=_0x1231ab[_0x71bc('0x3f')];if(_0x1231ab[_0x71bc('0x40')]=='ANSWERED'){_0x1231ab[_0x71bc('0x23')]=_0x1231ab['connectedlinenum'];}else{_0x1231ab['accountcode']='';}}}}else{_0x1231ab[_0x71bc('0x39')]=util['format']('\x22%s\x22\x20<%s>',_0x1231ab[_0x71bc('0x41')],_0x1231ab[_0x71bc('0x3c')]);}if(RpcVoiceTransferReport['transfers'][_0x1231ab[_0x71bc('0x42')]]){var _0x460c51=RpcVoiceTransferReport[_0x71bc('0x43')][_0x1231ab['linkedid']];_0x460c51[_0x71bc('0x44')]=_0x1231ab['uniqueid'];RpcVoiceTransferReport[_0x71bc('0x1d')](_0x460c51);delete RpcVoiceTransferReport[_0x71bc('0x43')][_0x1231ab[_0x71bc('0x42')]];}RpcVoiceCallReport[_0x71bc('0x45')](_0x1231ab);if(_0x1231ab[_0x71bc('0x46')]){for(var _0x22ceef=0x0;_0x22ceef<_0x1231ab[_0x71bc('0x47')][_0x71bc('0x25')];_0x22ceef+=0x1){_0x1231ab[_0x71bc('0x48')]=_0x1231ab[_0x71bc('0x47')][_0x22ceef][_0x71bc('0x49')];_0x1231ab['createdAt']=_0x1231ab[_0x71bc('0x47')][_0x22ceef][_0x71bc('0x4a')];if(_0x1231ab[_0x71bc('0x30')]==_0x71bc('0x3b')){_0x1231ab[_0x71bc('0x3c')]=_0x1231ab['connectedlinenum'];_0x1231ab['calleridname']=_0x1231ab[_0x71bc('0x4b')];_0x1231ab[_0x71bc('0x4c')]=_0x1231ab[_0x71bc('0x23')];_0x1231ab[_0x71bc('0x4b')]=_0x1231ab['membername'];_0x1231ab['exten']=_0x1231ab[_0x71bc('0x3f')];}else if(_0x1231ab[_0x71bc('0x30')]==_0x71bc('0x4d')){_0x1231ab['calleridnum']=_0x1231ab[_0x71bc('0x38')];_0x1231ab[_0x71bc('0x30')]=_0x1231ab['originatecalleridnum'];}RpcVoiceRecording[_0x71bc('0x45')](_0x1231ab);}}};Report[_0x71bc('0x13')][_0x71bc('0x4e')]=function(_0x145723){if(_[_0x71bc('0x4f')](_0x145723)){_0x145723['forEach'](function(_0x2c7f7c){RpcVoiceAgentReport['create'](_0x2c7f7c);});}else{RpcVoiceAgentReport[_0x71bc('0x45')](_0x145723);}};Report[_0x71bc('0x13')][_0x71bc('0x50')]=function(_0x245308){RpcVoiceDialReport[_0x71bc('0x45')](_0x245308);var _0x73e974;var _0x44c33c;var _0x3eb536=_0x245308[_0x71bc('0x51')];if(_['startsWith'](_0x3eb536,_0x71bc('0x52'))){_0x44c33c=_0x3eb536[_0x71bc('0x53')](_0x3eb536[_0x71bc('0x54')]('/')+0x1,_0x3eb536[_0x71bc('0x54')]('@'));_0x73e974=_[_0x71bc('0x20')](this[_0x71bc('0x11')],function(_0x58235a){return _0x58235a['mobile']==_0x44c33c||_0x58235a[_0x71bc('0x55')]==_0x44c33c||_0x58235a[_0x71bc('0x23')]==_0x44c33c;});}else{_0x44c33c=_0x3eb536[_0x71bc('0x53')](_0x3eb536['indexOf']('/')+0x1,_0x3eb536[_0x71bc('0x56')]('-'));_0x73e974=this[_0x71bc('0x26')](_0x44c33c);}if(_0x73e974){_0x245308[_0x71bc('0x24')]=_['isNil'](_0x73e974['interface'])?util['format']('SIP/%s',_0x73e974[_0x71bc('0x21')]):_0x73e974[_0x71bc('0x24')];_0x245308['membername']=_0x73e974[_0x71bc('0x21')];_0x245308['accountcode']=_0x73e974['accountcode'];RpcMemberReport[_0x71bc('0x50')](_0x245308);}};Report['prototype'][_0x71bc('0x1d')]=function(_0x336ec7){RpcVoiceTransferReport['transfers'][_0x336ec7['transfererlinkedid']]=_0x336ec7;};Report[_0x71bc('0x13')]['attendedTransfer']=function(_0x2e041e){RpcVoiceTransferReport[_0x71bc('0x1f')](_0x2e041e);};module['exports']=Report; \ No newline at end of file +var _0x8893=['format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','exten','dialer','lastdata','queue','callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','transfers','linkedid','transfereelinkedid','uniqueid','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','phone','lastIndexOf','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','find','interface'];(function(_0x35f2ff,_0x37c8af){var _0x1b7a72=function(_0x55b874){while(--_0x55b874){_0x35f2ff['push'](_0x35f2ff['shift']());}};_0x1b7a72(++_0x37c8af);}(_0x8893,0x84));var _0x3889=function(_0x381fb0,_0x1fcec7){_0x381fb0=_0x381fb0-0x0;var _0x24988f=_0x8893[_0x381fb0];return _0x24988f;};'use strict';var _=require('lodash');var moment=require(_0x3889('0x0'));var util=require(_0x3889('0x1'));var config=require(_0x3889('0x2'));var ami=require(_0x3889('0x3'));var RpcVoiceAgentReport=require(_0x3889('0x4'));var RpcVoiceCallReport=require(_0x3889('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x3889('0x6'));var RpcVoiceQueueReport=require(_0x3889('0x7'));var RpcVoiceRecording=require(_0x3889('0x8'));var RpcVoiceTransferReport=require(_0x3889('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x3889('0xa'));var VoiceAgentReport=require(_0x3889('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x3889('0xc'));function Report(_0xd41c02){this['realtime']=_0xd41c02;this[_0x3889('0xd')]=_0xd41c02['agents'];this[_0x3889('0xe')]=_0xd41c02['telephones'];}Report[_0x3889('0xf')][_0x3889('0x10')]=function(_0x4c6c7d){var _0x38de8c=new VoiceQueueReport(this[_0x3889('0x11')]);var _0x58a975=new VoiceAgentReport(this[_0x3889('0x11')]);var _0x2efbbb=new VoiceDialReport(this[_0x3889('0x11')]);var _0x26fc73=new VoiceCallReport(this[_0x3889('0x11')]);var _0x56846f=new UserReport(this[_0x3889('0x11')]);if(config[_0x3889('0x12')]&&config['xdr']['disabled']){ami['on'](_0x3889('0x13'),this[_0x3889('0x14')][_0x3889('0x15')](this));ami['on'](_0x3889('0x16'),this[_0x3889('0x17')]['bind'](this));ami['on'](_0x3889('0x18'),this[_0x3889('0x19')][_0x3889('0x15')](this));ami['on'](_0x3889('0x1a'),this[_0x3889('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0x3889('0x1c')]['bind'](this));ami['on'](_0x3889('0x1d'),this[_0x3889('0x1e')][_0x3889('0x15')](this));}};Report[_0x3889('0xf')][_0x3889('0x1f')]=function(_0x33a4c9){var _0x2b8b3c;_0x2b8b3c=_['find'](this[_0x3889('0xd')],function(_0x4f4bf5){return _0x4f4bf5[_0x3889('0x20')]==_0x33a4c9||_0x4f4bf5[_0x3889('0x21')]==_0x33a4c9;});if(_['isNil'](_0x2b8b3c)){var _0x2ca689=_[_0x3889('0x22')](this[_0x3889('0xe')],function(_0x217777){return _0x217777['accountcode']==_0x33a4c9||_0x217777[_0x3889('0x21')]==_0x33a4c9;});if(_0x2ca689){_0x2b8b3c=_[_0x3889('0x22')](this[_0x3889('0xd')],function(_0x1241d7){return _0x1241d7[_0x3889('0x23')]==util[_0x3889('0x24')](_0x3889('0x25'),_0x2ca689[_0x3889('0x21')]);});}}return _0x2b8b3c;};Report[_0x3889('0xf')][_0x3889('0x14')]=function(_0x45df5f){for(var _0x30c9c2=0x0;_0x30c9c2<_0x45df5f[_0x3889('0x26')];_0x30c9c2+=0x1){var _0x37aec8=this[_0x3889('0x1f')](_0x45df5f[_0x30c9c2][_0x3889('0x27')]);if(_0x37aec8){_0x45df5f[_0x30c9c2][_0x3889('0x20')]=_0x37aec8[_0x3889('0x20')];_0x45df5f[_0x30c9c2][_0x3889('0x28')]=!![];_0x45df5f[_0x30c9c2][_0x3889('0x29')]=_0x37aec8['name'];_0x45df5f[_0x30c9c2][_0x3889('0x23')]=_[_0x3889('0x2a')](_0x37aec8[_0x3889('0x23')])?util[_0x3889('0x24')](_0x3889('0x25'),_0x37aec8[_0x3889('0x21')]):_0x37aec8[_0x3889('0x23')];if(_0x45df5f[_0x30c9c2][_0x3889('0x2b')]){_0x45df5f[_0x30c9c2][_0x3889('0x2c')]=moment()[_0x3889('0x24')](_0x3889('0x2d'));}if(_0x45df5f[_0x30c9c2][_0x3889('0x2e')]){_0x45df5f[_0x30c9c2][_0x3889('0x2f')]=moment()[_0x3889('0x24')](_0x3889('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x45df5f[_0x30c9c2]);}RpcVoiceQueueReport[_0x3889('0x30')](_0x45df5f[_0x30c9c2]);}};function extractCalleridNumber(_0x15ad24){var _0x5e70d1=_0x15ad24['match'](/<(.*?)>/);return _0x5e70d1?_0x5e70d1[0x1]:_0x15ad24;}Report[_0x3889('0xf')]['voiceCallReport']=function(_0x405225){_0x405225[_0x3889('0x31')]=_0x405225[_0x3889('0x31')]||_0x405225[_0x3889('0x32')];if(_0x405225['type']==_0x3889('0x33')){_0x405225['lastapplication']='queue';_0x405225[_0x3889('0x34')]=_0x405225[_0x3889('0x35')];if(_0x405225['context']=='from-voip-provider'){_0x405225[_0x3889('0x20')]='';_0x405225[_0x3889('0x31')]=extractCalleridNumber(_0x405225[_0x3889('0x36')]);}else if(_0x405225[_0x3889('0x37')]==_0x3889('0x38')){if(_0x405225[_0x3889('0x31')]==_0x3889('0x39')){_0x405225[_0x3889('0x31')]=extractCalleridNumber(_0x405225[_0x3889('0x3a')]);_0x405225[_0x3889('0x3b')]=_0x405225[_0x3889('0x3c')];_0x405225[_0x3889('0x3d')]=[_0x405225[_0x3889('0x3e')],_0x405225[_0x3889('0x3e')]=_0x405225['destinationchannel']][0x0];_0x405225[_0x3889('0x36')]=_0x405225[_0x3889('0x3a')];}else{_0x405225[_0x3889('0x31')]=_0x405225[_0x3889('0x3b')];_0x405225['calleridnum']=_0x405225[_0x3889('0x3c')];if(_0x405225[_0x3889('0x3f')]==_0x3889('0x40')){_0x405225[_0x3889('0x20')]=_0x405225[_0x3889('0x27')];}else{_0x405225[_0x3889('0x20')]='';}}}}else{_0x405225[_0x3889('0x36')]=util[_0x3889('0x24')]('\x22%s\x22\x20<%s>',_0x405225['calleridname'],_0x405225[_0x3889('0x3b')]);}if(RpcVoiceTransferReport[_0x3889('0x41')][_0x405225['linkedid']]){var _0x1cb91d=RpcVoiceTransferReport[_0x3889('0x41')][_0x405225[_0x3889('0x42')]];_0x1cb91d[_0x3889('0x43')]=_0x405225[_0x3889('0x44')];RpcVoiceTransferReport[_0x3889('0x1c')](_0x1cb91d);delete RpcVoiceTransferReport['transfers'][_0x405225[_0x3889('0x42')]];}RpcVoiceCallReport['create'](_0x405225);if(_0x405225['monitor']){for(var _0x1c176b=0x0;_0x1c176b<_0x405225[_0x3889('0x45')]['length'];_0x1c176b+=0x1){_0x405225[_0x3889('0x46')]=_0x405225[_0x3889('0x45')][_0x1c176b][_0x3889('0x47')];_0x405225[_0x3889('0x48')]=_0x405225[_0x3889('0x45')][_0x1c176b]['createdAt'];if(_0x405225['exten']==_0x3889('0x39')){_0x405225[_0x3889('0x3b')]=_0x405225[_0x3889('0x27')];_0x405225['calleridname']=_0x405225[_0x3889('0x49')];_0x405225[_0x3889('0x27')]=_0x405225['accountcode'];_0x405225[_0x3889('0x49')]=_0x405225[_0x3889('0x4a')];_0x405225[_0x3889('0x32')]=_0x405225[_0x3889('0x3c')];}else if(_0x405225[_0x3889('0x32')]==_0x3889('0x4b')){_0x405225[_0x3889('0x3b')]=_0x405225[_0x3889('0x31')];_0x405225[_0x3889('0x32')]=_0x405225['originatecalleridnum'];}RpcVoiceRecording[_0x3889('0x30')](_0x405225);}}};Report[_0x3889('0xf')][_0x3889('0x19')]=function(_0x5dcf59){if(_[_0x3889('0x4c')](_0x5dcf59)){_0x5dcf59[_0x3889('0x4d')](function(_0x10dc3b){RpcVoiceAgentReport[_0x3889('0x30')](_0x10dc3b);});}else{RpcVoiceAgentReport[_0x3889('0x30')](_0x5dcf59);}};Report[_0x3889('0xf')]['voiceDialReport']=function(_0x452001){RpcVoiceDialReport[_0x3889('0x30')](_0x452001);var _0x4d947f;var _0x2b32e1;var _0x4abe08=_0x452001[_0x3889('0x3e')];if(_['startsWith'](_0x4abe08,_0x3889('0x4e'))){_0x2b32e1=_0x4abe08[_0x3889('0x4f')](_0x4abe08['indexOf']('/')+0x1,_0x4abe08[_0x3889('0x50')]('@'));_0x4d947f=_['find'](this[_0x3889('0xd')],function(_0x1e8fbb){return _0x1e8fbb['mobile']==_0x2b32e1||_0x1e8fbb[_0x3889('0x51')]==_0x2b32e1||_0x1e8fbb[_0x3889('0x20')]==_0x2b32e1;});}else{_0x2b32e1=_0x4abe08[_0x3889('0x4f')](_0x4abe08['indexOf']('/')+0x1,_0x4abe08[_0x3889('0x52')]('-'));_0x4d947f=this[_0x3889('0x1f')](_0x2b32e1);}if(_0x4d947f){_0x452001[_0x3889('0x23')]=_[_0x3889('0x2a')](_0x4d947f[_0x3889('0x23')])?util[_0x3889('0x24')]('SIP/%s',_0x4d947f[_0x3889('0x21')]):_0x4d947f['interface'];_0x452001[_0x3889('0x4a')]=_0x4d947f[_0x3889('0x21')];_0x452001[_0x3889('0x20')]=_0x4d947f[_0x3889('0x20')];RpcMemberReport[_0x3889('0x1b')](_0x452001);}};Report[_0x3889('0xf')][_0x3889('0x1c')]=function(_0xca18f){RpcVoiceTransferReport['transfers'][_0xca18f['transfererlinkedid']]=_0xca18f;};Report[_0x3889('0xf')][_0x3889('0x1e')]=function(_0x5051a5){RpcVoiceTransferReport[_0x3889('0x1e')](_0x5051a5);};module[_0x3889('0x53')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index ed6e676..19384a6 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 _0x42c8=['[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','find','trunks','merge','omit','event','actionid','format','trunk:%s','name','trunk:save','[userReport][registry]','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','debug','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','[userReport][devicestatechange]','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','redis','defaults','socket.io-emitter','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','[userReport][sipshowregistry]','inspect','catch','error','[userReport][devicestatelist]','actionSipPeerStatus'];(function(_0x245c4f,_0x34b70f){var _0x3157a1=function(_0x18bfc7){while(--_0x18bfc7){_0x245c4f['push'](_0x245c4f['shift']());}};_0x3157a1(++_0x34b70f);}(_0x42c8,0x116));var _0x842c=function(_0xfadccd,_0x290136){_0xfadccd=_0xfadccd-0x0;var _0x482ac4=_0x42c8[_0xfadccd];return _0x482ac4;};'use strict';var _=require(_0x842c('0x0'));var moment=require(_0x842c('0x1'));var util=require(_0x842c('0x2'));var Redis=require(_0x842c('0x3'));var BPromise=require(_0x842c('0x4'));var config=require('../../../config/environment');var logger=require(_0x842c('0x5'))(_0x842c('0x6'));var ami=require('../ami');config[_0x842c('0x7')]=_[_0x842c('0x8')](config[_0x842c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x842c('0x9'))(new Redis(config[_0x842c('0x7')]));function UserReport(_0x52c291){this['trunks']=_0x52c291['trunks'];this['agents']=_0x52c291[_0x842c('0xa')];this[_0x842c('0xb')]=_0x52c291[_0x842c('0xb')];ami['on'](_0x842c('0xc'),this['syncRegistry'][_0x842c('0xd')](this));ami['on'](_0x842c('0xe'),this[_0x842c('0xf')][_0x842c('0xd')](this));ami['on'](_0x842c('0x10'),this[_0x842c('0x11')][_0x842c('0xd')](this));ami['on'](_0x842c('0x12'),this[_0x842c('0x13')]['bind'](this));return this[_0x842c('0x14')]();}function showSipRegistrations(){Promise[_0x842c('0x15')]()[_0x842c('0x16')](ami[_0x842c('0x17')]())['catch'](function(_0x30a73c){logger['error'](_0x842c('0x18'),util[_0x842c('0x19')](_0x30a73c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami['actionDeviceStateList']())[_0x842c('0x1a')](function(_0x3bb7b6){logger[_0x842c('0x1b')](_0x842c('0x1c'),util[_0x842c('0x19')](_0x3bb7b6,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x842c('0x15')]()['then'](ami[_0x842c('0x1d')]())[_0x842c('0x1a')](function(_0x3c13d3){logger[_0x842c('0x1b')](_0x842c('0x1e'),util[_0x842c('0x19')](_0x3c13d3,{'showHidden':![],'depth':null}));});}UserReport[_0x842c('0x1f')][_0x842c('0x14')]=function(){setInterval(function(){BPromise[_0x842c('0x15')]()['then'](showSipRegistrations())[_0x842c('0x16')](listDeviceStates())[_0x842c('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x842c('0x1f')][_0x842c('0x20')]=function(_0x160ad4){return _0x160ad4!==null&&!_[_0x842c('0x21')](_0x160ad4);};UserReport[_0x842c('0x1f')]['emit']=function(_0x5121ea,_0x179027,_0x1d117b){io['to'](_0x5121ea)[_0x842c('0x22')](_0x179027,_0x1d117b);};UserReport[_0x842c('0x1f')][_0x842c('0xf')]=function(_0x511f1f){try{if(this[_0x842c('0x20')](_0x511f1f)){logger['info'](_0x842c('0x23'),_0x511f1f[_0x842c('0x24')],_0x511f1f[_0x842c('0x25')]);logger['debug']('[userReport][registry]',util[_0x842c('0x19')](_0x511f1f,{'showHidden':![],'depth':null}));var _0x3bd3cc=_[_0x842c('0x26')](this[_0x842c('0x27')],{'defaultuser':_0x511f1f[_0x842c('0x24')]});if(_0x3bd3cc){_0x511f1f['stateRegistry']=_0x511f1f[_0x842c('0x25')];_[_0x842c('0x28')](_0x3bd3cc,_[_0x842c('0x29')](_0x511f1f,[_0x842c('0x2a'),_0x842c('0x2b'),_0x842c('0x24'),_0x842c('0x25')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x842c('0x19')](_0x3bd3cc,{'showHidden':![],'depth':null}));this[_0x842c('0x22')](util[_0x842c('0x2c')](_0x842c('0x2d'),_0x3bd3cc[_0x842c('0x2e')]),_0x842c('0x2f'),_0x3bd3cc);}}}catch(_0x1a2588){logger[_0x842c('0x1b')](_0x842c('0x30'),util[_0x842c('0x19')](_0x1a2588,{'showHidden':![],'depth':null}));}};UserReport[_0x842c('0x1f')][_0x842c('0x11')]=function(_0x1e81fe){try{if(this['isNotNull'](_0x1e81fe)){logger[_0x842c('0x31')](_0x842c('0x32'),_0x1e81fe[_0x842c('0x33')],_0x1e81fe[_0x842c('0x25')]);logger['debug']('[userReport][devicestatechange]',util[_0x842c('0x19')](_0x1e81fe,{'showHidden':![],'depth':null}));if(this['agents'][_0x1e81fe[_0x842c('0x33')]]){if(!this[_0x842c('0xa')][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x34')]||_0x1e81fe[_0x842c('0x25')]['toLowerCase']()=='inuse'){this[_0x842c('0xa')][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x34')]=![];if(this['agents'][_0x1e81fe[_0x842c('0x33')]]['state']!==_0x1e81fe[_0x842c('0x25')][_0x842c('0x35')]()){this['agents'][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x36')]=_[_0x842c('0x37')](moment()[_0x842c('0x2c')]('x'));}this[_0x842c('0xa')][_0x1e81fe['device']][_0x842c('0x25')]=_0x1e81fe[_0x842c('0x25')][_0x842c('0x35')]();this[_0x842c('0xa')][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x38')](_0x1e81fe);}}else if(this['telephones'][_0x1e81fe[_0x842c('0x33')]]){if(this[_0x842c('0xb')][_0x1e81fe[_0x842c('0x33')]]['state']!==_0x1e81fe[_0x842c('0x25')][_0x842c('0x35')]()){this[_0x842c('0xb')][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x36')]=_[_0x842c('0x37')](moment()[_0x842c('0x2c')]('x'));}this[_0x842c('0xb')][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x25')]=_0x1e81fe[_0x842c('0x25')][_0x842c('0x35')]();logger[_0x842c('0x39')](_0x842c('0x3a'),util[_0x842c('0x19')](this['telephones'][_0x1e81fe['device']],{'showHidden':![],'depth':null}));this[_0x842c('0x22')](util['format'](_0x842c('0x3b'),this[_0x842c('0xb')][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x2e')]),_0x842c('0x3c'),this[_0x842c('0xb')][_0x1e81fe['device']]);}else if(this[_0x842c('0x27')][_0x1e81fe['device']]){if(this[_0x842c('0x27')][_0x1e81fe['device']][_0x842c('0x25')]!==_0x1e81fe[_0x842c('0x25')][_0x842c('0x35')]()){this[_0x842c('0x27')][_0x1e81fe['device']]['stateTime']=_[_0x842c('0x37')](moment()[_0x842c('0x2c')]('x'));}this['trunks'][_0x1e81fe[_0x842c('0x33')]]['state']=_0x1e81fe[_0x842c('0x25')][_0x842c('0x35')]();logger[_0x842c('0x39')](_0x842c('0x3d'),util[_0x842c('0x19')](this[_0x842c('0x27')][_0x1e81fe['device']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x842c('0x2d'),this['trunks'][_0x1e81fe[_0x842c('0x33')]][_0x842c('0x2e')]),_0x842c('0x2f'),this['trunks'][_0x1e81fe[_0x842c('0x33')]]);}else if(_[_0x842c('0x3e')](_0x1e81fe['device'],_0x842c('0x3f'))){var _0x440a33=_0x1e81fe['device'];var _0x4f2d98=_0x440a33[_0x842c('0x40')](_0x440a33[_0x842c('0x41')]('/')+0x1,_0x440a33[_0x842c('0x41')]('@'));var _0xfdff0c=_['find'](this['agents'],function(_0x5124c5){return _0x5124c5[_0x842c('0x42')]==_0x4f2d98||_0x5124c5[_0x842c('0x43')]==_0x4f2d98||_0x5124c5[_0x842c('0x44')]==_0x4f2d98;});if(_0xfdff0c){if(_0xfdff0c[_0x842c('0x25')]!==_0x1e81fe['state'][_0x842c('0x35')]()){_0xfdff0c['stateTime']=_[_0x842c('0x37')](moment()['format']('x'));}_0xfdff0c[_0x842c('0x25')]=_0x1e81fe[_0x842c('0x25')]['toLowerCase']();_0xfdff0c[_0x842c('0x34')]=!![];_0xfdff0c[_0x842c('0x38')](_0x1e81fe);}}}}catch(_0x436410){logger[_0x842c('0x1b')](_0x842c('0x45'),util[_0x842c('0x19')](_0x436410,{'showHidden':![],'depth':null}));}};UserReport[_0x842c('0x1f')][_0x842c('0x13')]=function(_0x36f0bd){try{if(this[_0x842c('0x20')](_0x36f0bd)&&this[_0x842c('0x20')](_0x36f0bd[_0x842c('0x12')])){logger[_0x842c('0x31')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x36f0bd[_0x842c('0x46')],_0x36f0bd[_0x842c('0x47')],_0x36f0bd[_0x842c('0x12')]);logger[_0x842c('0x39')](_0x842c('0x48'),util[_0x842c('0x19')](_0x36f0bd,{'showHidden':![],'depth':null}));if(this[_0x842c('0xa')][_0x36f0bd[_0x842c('0x46')]]){if(!this[_0x842c('0xa')][_0x36f0bd[_0x842c('0x46')]]['local']||_0x36f0bd['peerstatus'][_0x842c('0x35')]()==_0x842c('0x49')){this[_0x842c('0xa')][_0x36f0bd[_0x842c('0x46')]][_0x842c('0x34')]=![];this['agents'][_0x36f0bd[_0x842c('0x46')]][_0x842c('0x4a')]=_0x36f0bd[_0x842c('0x12')][_0x842c('0x35')]();this[_0x842c('0xa')][_0x36f0bd[_0x842c('0x46')]][_0x842c('0x47')]=_0x36f0bd['address'];this['agents'][_0x36f0bd[_0x842c('0x46')]][_0x842c('0x38')](_0x36f0bd);}}else if(this[_0x842c('0xb')][_0x36f0bd[_0x842c('0x46')]]){this[_0x842c('0xb')][_0x36f0bd[_0x842c('0x46')]][_0x842c('0x4a')]=_0x36f0bd[_0x842c('0x12')][_0x842c('0x35')]();this[_0x842c('0xb')][_0x36f0bd['peer']][_0x842c('0x47')]=_0x36f0bd[_0x842c('0x47')];logger[_0x842c('0x39')](_0x842c('0x4b'),util[_0x842c('0x19')](this[_0x842c('0xb')][_0x36f0bd[_0x842c('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x842c('0x2c')]('telephone:%s',this[_0x842c('0xb')][_0x36f0bd['peer']]['name']),_0x842c('0x3c'),this[_0x842c('0xb')][_0x36f0bd[_0x842c('0x46')]]);}else if(this[_0x842c('0x27')][_0x36f0bd[_0x842c('0x46')]]){this[_0x842c('0x27')][_0x36f0bd[_0x842c('0x46')]][_0x842c('0x4a')]=_0x36f0bd[_0x842c('0x12')][_0x842c('0x35')]();this['trunks'][_0x36f0bd[_0x842c('0x46')]]['address']=_0x36f0bd['address'];logger['debug'](_0x842c('0x4c'),util[_0x842c('0x19')](this['trunks'][_0x36f0bd[_0x842c('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x842c('0x2d'),this[_0x842c('0x27')][_0x36f0bd['peer']][_0x842c('0x2e')]),'trunk:save',this[_0x842c('0x27')][_0x36f0bd[_0x842c('0x46')]]);}}}catch(_0x2fbe10){logger[_0x842c('0x1b')](_0x842c('0x48'),util['inspect'](_0x2fbe10,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x1c81=['devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','syncRealtimeShow','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','updateStatusRealtime','toNumber','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','stateTime','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','moment','util','ioredis','bluebird','../../../config/logger','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind'];(function(_0x5092eb,_0x1983c4){var _0x1b066f=function(_0x362cab){while(--_0x362cab){_0x5092eb['push'](_0x5092eb['shift']());}};_0x1b066f(++_0x1983c4);}(_0x1c81,0x1e2));var _0x11c8=function(_0x33a919,_0x573bd5){_0x33a919=_0x33a919-0x0;var _0x1ec1e6=_0x1c81[_0x33a919];return _0x1ec1e6;};'use strict';var _=require('lodash');var moment=require(_0x11c8('0x0'));var util=require(_0x11c8('0x1'));var Redis=require(_0x11c8('0x2'));var BPromise=require(_0x11c8('0x3'));var config=require('../../../config/environment');var logger=require(_0x11c8('0x4'))('ami');var ami=require('../ami');config[_0x11c8('0x5')]=_['defaults'](config[_0x11c8('0x5')],{'host':_0x11c8('0x6'),'port':0x18eb});var io=require(_0x11c8('0x7'))(new Redis(config[_0x11c8('0x5')]));function UserReport(_0x390c43){this[_0x11c8('0x8')]=_0x390c43[_0x11c8('0x8')];this[_0x11c8('0x9')]=_0x390c43[_0x11c8('0x9')];this['telephones']=_0x390c43[_0x11c8('0xa')];ami['on'](_0x11c8('0xb'),this[_0x11c8('0xc')]['bind'](this));ami['on'](_0x11c8('0xd'),this[_0x11c8('0xc')][_0x11c8('0xe')](this));ami['on'](_0x11c8('0xf'),this[_0x11c8('0x10')][_0x11c8('0xe')](this));ami['on'](_0x11c8('0x11'),this[_0x11c8('0x12')][_0x11c8('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x11c8('0x13')](ami[_0x11c8('0x14')]())[_0x11c8('0x15')](function(_0x2847e3){logger['error'](_0x11c8('0x16'),util[_0x11c8('0x17')](_0x2847e3,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x11c8('0x13')](ami[_0x11c8('0x18')]())['catch'](function(_0x4ca280){logger[_0x11c8('0x19')](_0x11c8('0x1a'),util['inspect'](_0x4ca280,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x11c8('0x13')](ami[_0x11c8('0x1b')]())[_0x11c8('0x15')](function(_0x379b7c){logger[_0x11c8('0x19')](_0x11c8('0x1c'),util['inspect'](_0x379b7c,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x11c8('0x1d')]=function(){setInterval(function(){BPromise['resolve']()[_0x11c8('0x13')](showSipRegistrations())[_0x11c8('0x13')](listDeviceStates())[_0x11c8('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x11c8('0x1e')][_0x11c8('0x1f')]=function(_0x830b48){return _0x830b48!==null&&!_[_0x11c8('0x20')](_0x830b48);};UserReport[_0x11c8('0x1e')][_0x11c8('0x21')]=function(_0x5b6cff,_0x3b49d1,_0x54829c){io['to'](_0x5b6cff)[_0x11c8('0x21')](_0x3b49d1,_0x54829c);};UserReport['prototype']['syncRegistry']=function(_0x34f572){try{if(this[_0x11c8('0x1f')](_0x34f572)){logger[_0x11c8('0x22')](_0x11c8('0x23'),_0x34f572[_0x11c8('0x24')],_0x34f572[_0x11c8('0x25')]);logger['debug'](_0x11c8('0x26'),util[_0x11c8('0x17')](_0x34f572,{'showHidden':![],'depth':null}));var _0x34fa63=_[_0x11c8('0x27')](this[_0x11c8('0x8')],{'defaultuser':_0x34f572[_0x11c8('0x24')]});if(_0x34fa63){_0x34f572['stateRegistry']=_0x34f572[_0x11c8('0x25')];_[_0x11c8('0x28')](_0x34fa63,_[_0x11c8('0x29')](_0x34f572,[_0x11c8('0x2a'),_0x11c8('0x2b'),_0x11c8('0x24'),_0x11c8('0x25')]));logger[_0x11c8('0x2c')](_0x11c8('0x2d'),util[_0x11c8('0x17')](_0x34fa63,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x11c8('0x2e'),_0x34fa63['name']),'trunk:save',_0x34fa63);}}}catch(_0x2f71cf){logger['error'](_0x11c8('0x26'),util[_0x11c8('0x17')](_0x2f71cf,{'showHidden':![],'depth':null}));}};UserReport[_0x11c8('0x1e')]['syncDeviceState']=function(_0x3c2f60){try{if(this[_0x11c8('0x1f')](_0x3c2f60)){logger[_0x11c8('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x3c2f60[_0x11c8('0x2f')],_0x3c2f60[_0x11c8('0x25')]);logger[_0x11c8('0x2c')](_0x11c8('0x30'),util[_0x11c8('0x17')](_0x3c2f60,{'showHidden':![],'depth':null}));if(this['agents'][_0x3c2f60[_0x11c8('0x2f')]]){if(!this[_0x11c8('0x9')][_0x3c2f60[_0x11c8('0x2f')]][_0x11c8('0x31')]||_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]()==_0x11c8('0x33')){this[_0x11c8('0x9')][_0x3c2f60['device']]['local']=![];if(this[_0x11c8('0x9')][_0x3c2f60[_0x11c8('0x2f')]]['state']!==_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]()){this[_0x11c8('0x9')][_0x3c2f60[_0x11c8('0x2f')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0x11c8('0x9')][_0x3c2f60[_0x11c8('0x2f')]][_0x11c8('0x25')]=_0x3c2f60['state'][_0x11c8('0x32')]();this['agents'][_0x3c2f60[_0x11c8('0x2f')]][_0x11c8('0x34')](_0x3c2f60);}}else if(this[_0x11c8('0xa')][_0x3c2f60[_0x11c8('0x2f')]]){if(this['telephones'][_0x3c2f60[_0x11c8('0x2f')]]['state']!==_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]()){this[_0x11c8('0xa')][_0x3c2f60['device']]['stateTime']=_[_0x11c8('0x35')](moment()[_0x11c8('0x36')]('x'));}this[_0x11c8('0xa')][_0x3c2f60['device']]['state']=_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]();logger[_0x11c8('0x2c')](_0x11c8('0x37'),util[_0x11c8('0x17')](this[_0x11c8('0xa')][_0x3c2f60[_0x11c8('0x2f')]],{'showHidden':![],'depth':null}));this[_0x11c8('0x21')](util['format'](_0x11c8('0x38'),this[_0x11c8('0xa')][_0x3c2f60['device']][_0x11c8('0x39')]),_0x11c8('0x3a'),this['telephones'][_0x3c2f60[_0x11c8('0x2f')]]);}else if(this['trunks'][_0x3c2f60['device']]){if(this[_0x11c8('0x8')][_0x3c2f60[_0x11c8('0x2f')]]['state']!==_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]()){this[_0x11c8('0x8')][_0x3c2f60[_0x11c8('0x2f')]][_0x11c8('0x3b')]=_['toNumber'](moment()[_0x11c8('0x36')]('x'));}this[_0x11c8('0x8')][_0x3c2f60[_0x11c8('0x2f')]]['state']=_0x3c2f60[_0x11c8('0x25')]['toLowerCase']();logger['debug'](_0x11c8('0x3c'),util[_0x11c8('0x17')](this[_0x11c8('0x8')][_0x3c2f60[_0x11c8('0x2f')]],{'showHidden':![],'depth':null}));this[_0x11c8('0x21')](util[_0x11c8('0x36')]('trunk:%s',this[_0x11c8('0x8')][_0x3c2f60[_0x11c8('0x2f')]][_0x11c8('0x39')]),'trunk:save',this[_0x11c8('0x8')][_0x3c2f60[_0x11c8('0x2f')]]);}else if(_[_0x11c8('0x3d')](_0x3c2f60[_0x11c8('0x2f')],'Local')){var _0x4af3dc=_0x3c2f60['device'];var _0x1e573c=_0x4af3dc[_0x11c8('0x3e')](_0x4af3dc[_0x11c8('0x3f')]('/')+0x1,_0x4af3dc['indexOf']('@'));var _0x9d6154=_[_0x11c8('0x27')](this[_0x11c8('0x9')],function(_0x1880bb){return _0x1880bb['mobile']==_0x1e573c||_0x1880bb['phone']==_0x1e573c||_0x1880bb['accountcode']==_0x1e573c;});if(_0x9d6154){if(_0x9d6154[_0x11c8('0x25')]!==_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]()){_0x9d6154[_0x11c8('0x3b')]=_[_0x11c8('0x35')](moment()[_0x11c8('0x36')]('x'));}_0x9d6154[_0x11c8('0x25')]=_0x3c2f60[_0x11c8('0x25')][_0x11c8('0x32')]();_0x9d6154[_0x11c8('0x31')]=!![];_0x9d6154['updateStatusRealtime'](_0x3c2f60);}}}}catch(_0x385621){logger['error'](_0x11c8('0x30'),util[_0x11c8('0x17')](_0x385621,{'showHidden':![],'depth':null}));}};UserReport[_0x11c8('0x1e')][_0x11c8('0x12')]=function(_0x10b2cb){try{if(this[_0x11c8('0x1f')](_0x10b2cb)&&this[_0x11c8('0x1f')](_0x10b2cb[_0x11c8('0x11')])){logger[_0x11c8('0x22')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x10b2cb[_0x11c8('0x40')],_0x10b2cb[_0x11c8('0x41')],_0x10b2cb[_0x11c8('0x11')]);logger['debug']('[userReport][peerstatus]',util[_0x11c8('0x17')](_0x10b2cb,{'showHidden':![],'depth':null}));if(this['agents'][_0x10b2cb['peer']]){if(!this[_0x11c8('0x9')][_0x10b2cb['peer']][_0x11c8('0x31')]||_0x10b2cb[_0x11c8('0x11')][_0x11c8('0x32')]()==_0x11c8('0x42')){this['agents'][_0x10b2cb['peer']][_0x11c8('0x31')]=![];this[_0x11c8('0x9')][_0x10b2cb['peer']][_0x11c8('0x43')]=_0x10b2cb['peerstatus'][_0x11c8('0x32')]();this[_0x11c8('0x9')][_0x10b2cb['peer']][_0x11c8('0x41')]=_0x10b2cb[_0x11c8('0x41')];this[_0x11c8('0x9')][_0x10b2cb[_0x11c8('0x40')]][_0x11c8('0x34')](_0x10b2cb);}}else if(this[_0x11c8('0xa')][_0x10b2cb[_0x11c8('0x40')]]){this[_0x11c8('0xa')][_0x10b2cb['peer']][_0x11c8('0x43')]=_0x10b2cb['peerstatus']['toLowerCase']();this[_0x11c8('0xa')][_0x10b2cb[_0x11c8('0x40')]][_0x11c8('0x41')]=_0x10b2cb[_0x11c8('0x41')];logger[_0x11c8('0x2c')](_0x11c8('0x44'),util[_0x11c8('0x17')](this[_0x11c8('0xa')][_0x10b2cb[_0x11c8('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x11c8('0x36')]('telephone:%s',this[_0x11c8('0xa')][_0x10b2cb['peer']][_0x11c8('0x39')]),_0x11c8('0x3a'),this[_0x11c8('0xa')][_0x10b2cb['peer']]);}else if(this[_0x11c8('0x8')][_0x10b2cb['peer']]){this[_0x11c8('0x8')][_0x10b2cb[_0x11c8('0x40')]][_0x11c8('0x43')]=_0x10b2cb[_0x11c8('0x11')][_0x11c8('0x32')]();this[_0x11c8('0x8')][_0x10b2cb[_0x11c8('0x40')]][_0x11c8('0x41')]=_0x10b2cb[_0x11c8('0x41')];logger['debug'](_0x11c8('0x45'),util['inspect'](this['trunks'][_0x10b2cb[_0x11c8('0x40')]],{'showHidden':![],'depth':null}));this[_0x11c8('0x21')](util[_0x11c8('0x36')](_0x11c8('0x2e'),this[_0x11c8('0x8')][_0x10b2cb[_0x11c8('0x40')]][_0x11c8('0x39')]),'trunk:save',this['trunks'][_0x10b2cb['peer']]);}}}catch(_0x25c48c){logger[_0x11c8('0x19')](_0x11c8('0x46'),util[_0x11c8('0x17')](_0x25c48c,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 914df70..29005ba 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 _0x7896=['attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','merge','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','user:%s','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','localhost','socket.io-emitter','redis','voiceChannels','channels','voiceQueues','agents','variables','syncAgentCalled','agentconnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x7896,0x127));var _0x6789=function(_0x4862de,_0x3ea85f){_0x4862de=_0x4862de-0x0;var _0x59c5b0=_0x7896[_0x4862de];return _0x59c5b0;};'use strict';var _=require(_0x6789('0x0'));var moment=require('moment');var util=require(_0x6789('0x1'));var Redis=require(_0x6789('0x2'));var config=require(_0x6789('0x3'));var logger=require(_0x6789('0x4'))(_0x6789('0x5'));var ami=require('../ami');config['redis']=_[_0x6789('0x6')](config['redis'],{'host':_0x6789('0x7'),'port':0x18eb});var io=require(_0x6789('0x8'))(new Redis(config[_0x6789('0x9')]));function VoiceAgentReport(_0x266755){this['channels']={};this[_0x6789('0xa')]=_0x266755[_0x6789('0xb')];this['voiceQueues']=_0x266755[_0x6789('0xc')];this[_0x6789('0xd')]=_0x266755['agents'];this[_0x6789('0xe')]={};ami['on']('agentcalled',this[_0x6789('0xf')]['bind'](this));ami['on'](_0x6789('0x10'),this['syncAgentConnect'][_0x6789('0x11')](this));ami['on'](_0x6789('0x12'),this[_0x6789('0x13')][_0x6789('0x11')](this));ami['on'](_0x6789('0x14'),this[_0x6789('0x15')][_0x6789('0x11')](this));ami['on'](_0x6789('0x16'),this[_0x6789('0x17')][_0x6789('0x11')](this));ami['on'](_0x6789('0x18'),this['syncVarSet']['bind'](this));ami['on'](_0x6789('0x19'),this['syncHangup'][_0x6789('0x11')](this));ami['on'](_0x6789('0x1a'),this['syncMusicOnHoldStart'][_0x6789('0x11')](this));ami['on'](_0x6789('0x1b'),this[_0x6789('0x1c')][_0x6789('0x11')](this));ami['on'](_0x6789('0x1d'),this[_0x6789('0x1e')][_0x6789('0x11')](this));ami['on']('blindtransfer',this[_0x6789('0x1f')][_0x6789('0x11')](this));}VoiceAgentReport[_0x6789('0x20')][_0x6789('0x21')]=function(_0x37b323,_0xee654a,_0x18b3dc){io['to'](_0x37b323)[_0x6789('0x21')](_0xee654a,_0x18b3dc);};VoiceAgentReport[_0x6789('0x20')]['isNotNull']=function(_0x48ac13){return _0x48ac13!==null&&!_[_0x6789('0x22')](_0x48ac13);};VoiceAgentReport[_0x6789('0x20')][_0x6789('0xf')]=function(_0x35304a){try{if(this[_0x6789('0x23')](_0x35304a)){logger[_0x6789('0x24')](_0x6789('0x25'),_0x35304a[_0x6789('0x26')],_0x35304a[_0x6789('0x27')],_0x35304a['destuniqueid']);logger[_0x6789('0x28')](_0x6789('0x29'),_0x35304a[_0x6789('0x26')],util[_0x6789('0x2a')](_0x35304a,{'showHidden':![],'depth':null}));if(_[_0x6789('0x22')](this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]])){this[_0x6789('0xb')][_0x35304a['uniqueid']]={};}if(_[_0x6789('0x22')](this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]][_0x35304a[_0x6789('0x2b')]])){this[_0x6789('0xb')][_0x35304a['uniqueid']][_0x35304a[_0x6789('0x2b')]]={'agentcalledAt':moment()['format'](_0x6789('0x2c')),'lastevent':_0x6789('0x2d'),'mandatoryDisposition':this['voiceQueues'][_0x35304a['queue']]?this[_0x6789('0xc')][_0x35304a[_0x6789('0x2e')]]['mandatoryDisposition']||![]:![],'type':this[_0x6789('0xc')][_0x35304a['queue']]?this[_0x6789('0xc')][_0x35304a['queue']][_0x6789('0x2f')]||_0x6789('0x30'):_0x6789('0x30'),'variables':this['variables'][_0x35304a[_0x6789('0x26')]],'motionChannel':_0x6789('0x31')};}_[_0x6789('0x32')](this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]][_0x35304a['destuniqueid']],_['omit'](_0x35304a,[_0x6789('0x33'),_0x6789('0x34')]));logger['debug'](_0x6789('0x35'),_0x35304a[_0x6789('0x26')],util[_0x6789('0x2a')](this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]][_0x35304a[_0x6789('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x6789('0x21')]('custom:agentcalled',this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]][_0x35304a[_0x6789('0x2b')]]);logger[_0x6789('0x28')](_0x6789('0x36'),_0x35304a[_0x6789('0x26')],util['inspect'](this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]][_0x35304a[_0x6789('0x2b')]],{'showHidden':![],'depth':null}));this[_0x6789('0x21')](util[_0x6789('0x37')]('user:%s',_0x35304a[_0x6789('0x27')]),_0x6789('0x38'),this[_0x6789('0xb')][_0x35304a[_0x6789('0x26')]][_0x35304a['destuniqueid']]);}}catch(_0x2a95b5){logger[_0x6789('0x39')](_0x6789('0x3a'),_0x35304a[_0x6789('0x26')],util['inspect'](_0x2a95b5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x3b')]=function(_0x2b511d){try{if(this['isNotNull'](_0x2b511d)){if(this[_0x6789('0xb')][_0x2b511d['uniqueid']]){logger[_0x6789('0x28')](_0x6789('0x3c'),_0x2b511d[_0x6789('0x26')],util[_0x6789('0x2a')](_0x2b511d,{'showHidden':![],'depth':null}));for(var _0x2e9abd in this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]]){if(this['channels'][_0x2b511d['uniqueid']][_0x6789('0x3d')](_0x2e9abd)){if(_0x2b511d[_0x6789('0x2b')]===_0x2e9abd){logger[_0x6789('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2b511d[_0x6789('0x26')],_0x2b511d['membername'],_0x2b511d[_0x6789('0x2b')]);this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x3e')]=moment()[_0x6789('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2b511d[_0x6789('0x26')]][_0x2e9abd]['connectedlinename']=_0x2b511d[_0x6789('0x3f')];this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd]['connectedlinenum']=_0x2b511d[_0x6789('0x40')];this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x41')]=_0x2b511d['destchannelstate'];this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd]['destchannelstatedesc']=_0x2b511d[_0x6789('0x42')];this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x43')]=_0x2b511d[_0x6789('0x43')];this[_0x6789('0xb')][_0x2b511d['uniqueid']][_0x2e9abd]['lastevent']=_0x6789('0x44');if(this[_0x6789('0xa')][this['channels'][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x26')]]){var _0x3ef74d=this[_0x6789('0xa')][this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x26')]][_0x6789('0x45')];this['channels'][_0x2b511d['uniqueid']][_0x2e9abd]['routealias']=_0x3ef74d;_0x2b511d[_0x6789('0x45')]=_0x3ef74d;}_[_0x6789('0x32')](this[_0x6789('0xd')][_0x2b511d[_0x6789('0x46')]],_[_0x6789('0x47')](_0x2b511d,[_0x6789('0x2e'),_0x6789('0x48'),'routealias']));logger['debug'](_0x6789('0x49'),_0x2b511d['uniqueid'],util['inspect'](this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2b511d[_0x6789('0x2b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2b511d[_0x6789('0x2b')]]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x2b511d['uniqueid'],util['inspect'](this['channels'][_0x2b511d[_0x6789('0x26')]][_0x2b511d[_0x6789('0x2b')]],{'showHidden':![],'depth':null}));this[_0x6789('0x21')](util[_0x6789('0x37')](_0x6789('0x4a'),_0x2b511d[_0x6789('0x27')]),_0x6789('0x4b'),this['channels'][_0x2b511d['uniqueid']][_0x2b511d[_0x6789('0x2b')]]);}else if(!this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x12')]&&!this[_0x6789('0xb')][_0x2b511d['uniqueid']][_0x2e9abd][_0x6789('0x16')]){logger[_0x6789('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x2b511d[_0x6789('0x26')],this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd]['membername'],_0x2e9abd);this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x12')]=!![];this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x4c')]=moment()[_0x6789('0x37')](_0x6789('0x2c'));this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x4d')]=_0x2b511d[_0x6789('0x2b')];this[_0x6789('0xb')][_0x2b511d['uniqueid']][_0x2e9abd][_0x6789('0x4e')]=_0x2b511d[_0x6789('0x27')];this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x4f')]=_0x6789('0x50');this[_0x6789('0xb')][_0x2b511d[_0x6789('0x26')]][_0x2e9abd][_0x6789('0x51')]=_0x6789('0x50');logger['debug'](_0x6789('0x52'),_0x2b511d[_0x6789('0x26')],util[_0x6789('0x2a')](this['channels'][_0x2b511d['uniqueid']][_0x2e9abd],{'showHidden':![],'depth':null}));ami['emit'](_0x6789('0x53'),this['channels'][_0x2b511d[_0x6789('0x26')]][_0x2e9abd]);}}}}}}catch(_0x516b72){logger[_0x6789('0x39')](_0x6789('0x54'),_0x2b511d[_0x6789('0x26')],util[_0x6789('0x2a')](_0x516b72,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6789('0x13')]=function(_0x1f6ec4){try{if(this['isNotNull'](_0x1f6ec4)){logger[_0x6789('0x28')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x1f6ec4['uniqueid'],util[_0x6789('0x2a')](_0x1f6ec4,{'showHidden':![],'depth':null}));if(this[_0x6789('0xb')][_0x1f6ec4['uniqueid']]&&this[_0x6789('0xb')][_0x1f6ec4[_0x6789('0x26')]][_0x1f6ec4[_0x6789('0x2b')]]){logger[_0x6789('0x24')](_0x6789('0x55'),_0x1f6ec4[_0x6789('0x26')],_0x1f6ec4[_0x6789('0x27')],_0x1f6ec4[_0x6789('0x2b')]);this[_0x6789('0xb')][_0x1f6ec4['uniqueid']][_0x1f6ec4['destuniqueid']]['agentringnoanswer']=!![];this[_0x6789('0xb')][_0x1f6ec4[_0x6789('0x26')]][_0x1f6ec4['destuniqueid']]['agentringnoanswerAt']=moment()[_0x6789('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6789('0xb')][_0x1f6ec4[_0x6789('0x26')]][_0x1f6ec4[_0x6789('0x2b')]][_0x6789('0x4f')]=_0x6789('0x56');this[_0x6789('0xb')][_0x1f6ec4[_0x6789('0x26')]][_0x1f6ec4[_0x6789('0x2b')]][_0x6789('0x51')]=_0x6789('0x56');logger[_0x6789('0x28')](_0x6789('0x57'),_0x1f6ec4['uniqueid'],util[_0x6789('0x2a')](this[_0x6789('0xb')][_0x1f6ec4[_0x6789('0x26')]][_0x1f6ec4[_0x6789('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x6789('0x21')](_0x6789('0x58'),this[_0x6789('0xb')][_0x1f6ec4[_0x6789('0x26')]][_0x1f6ec4[_0x6789('0x2b')]]);}}}catch(_0x2e3230){logger['error'](_0x6789('0x59'),_0x1f6ec4['uniqueid'],util[_0x6789('0x2a')](_0x2e3230,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x15')]=function(_0x194aea){try{if(this[_0x6789('0x23')](_0x194aea)){logger[_0x6789('0x28')](_0x6789('0x5a'),_0x194aea['uniqueid'],util[_0x6789('0x2a')](_0x194aea,{'showHidden':![],'depth':null}));if(this[_0x6789('0xb')][_0x194aea['uniqueid']]){for(var _0x17d171 in this['channels'][_0x194aea[_0x6789('0x26')]]){if(this['channels'][_0x194aea[_0x6789('0x26')]][_0x6789('0x3d')](_0x17d171)&&!this[_0x6789('0xb')][_0x194aea[_0x6789('0x26')]][_0x17d171][_0x6789('0x12')]&&!this['channels'][_0x194aea[_0x6789('0x26')]][_0x17d171][_0x6789('0x16')]){logger[_0x6789('0x24')](_0x6789('0x5b'),_0x194aea[_0x6789('0x26')],this[_0x6789('0xb')][_0x194aea['uniqueid']][_0x17d171]['membername'],_0x17d171);this[_0x6789('0xb')][_0x194aea['uniqueid']][_0x17d171][_0x6789('0x12')]=!![];this[_0x6789('0xb')][_0x194aea[_0x6789('0x26')]][_0x17d171][_0x6789('0x4c')]=moment()['format'](_0x6789('0x2c'));this[_0x6789('0xb')][_0x194aea[_0x6789('0x26')]][_0x17d171][_0x6789('0x4f')]=_0x6789('0x5c');this['channels'][_0x194aea[_0x6789('0x26')]][_0x17d171][_0x6789('0x51')]=_0x6789('0x5c');logger[_0x6789('0x28')](_0x6789('0x5d'),_0x194aea[_0x6789('0x26')],util[_0x6789('0x2a')](this[_0x6789('0xb')][_0x194aea[_0x6789('0x26')]][_0x17d171],{'showHidden':![],'depth':null}));ami[_0x6789('0x21')](_0x6789('0x5e'),this[_0x6789('0xb')][_0x194aea[_0x6789('0x26')]][_0x17d171]);}}}}}catch(_0x1a01a6){logger[_0x6789('0x39')](_0x6789('0x5f'),_0x194aea[_0x6789('0x26')],util['inspect'](_0x1a01a6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x17')]=function(_0x290366){try{if(this[_0x6789('0x23')](_0x290366)){logger[_0x6789('0x28')](_0x6789('0x60'),_0x290366[_0x6789('0x26')],util[_0x6789('0x2a')](_0x290366,{'showHidden':![],'depth':null}));if(this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]]){for(var _0x164bb8 in this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]]){if(this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]]['hasOwnProperty'](_0x164bb8)){if(this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8][_0x6789('0x3e')]&&!this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8][_0x6789('0x16')]){logger[_0x6789('0x24')](_0x6789('0x61'),_0x290366[_0x6789('0x26')],this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8][_0x6789('0x27')],_0x164bb8);this[_0x6789('0xb')][_0x290366['uniqueid']][_0x164bb8][_0x6789('0x16')]=!![];this['channels'][_0x290366[_0x6789('0x26')]][_0x164bb8][_0x6789('0x62')]=moment()[_0x6789('0x37')](_0x6789('0x2c'));this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8]['lastevent']=_0x6789('0x63');this['channels'][_0x290366['uniqueid']][_0x164bb8][_0x6789('0x51')]=_0x290366[_0x6789('0x51')]=='transfer'?_0x6789('0x64'):_0x290366[_0x6789('0x51')];this['channels'][_0x290366[_0x6789('0x26')]][_0x164bb8]['talktime']=_0x290366[_0x6789('0x65')];if(this[_0x6789('0xc')][_0x290366['queue']]&&this[_0x6789('0xc')][_0x290366['queue']]['acw']){this[_0x6789('0xb')][_0x290366['uniqueid']][_0x164bb8][_0x6789('0x66')]=this[_0x6789('0xc')][_0x290366[_0x6789('0x2e')]][_0x6789('0x67')];this['channels'][_0x290366[_0x6789('0x26')]][_0x164bb8][_0x6789('0x68')]=!![];}this[_0x6789('0xd')][_0x290366['interface']]=_[_0x6789('0x69')](this[_0x6789('0xd')][_0x290366[_0x6789('0x46')]],[_0x6789('0x2e'),_0x6789('0x48')]);logger[_0x6789('0x28')](_0x6789('0x6a'),_0x290366[_0x6789('0x26')],util[_0x6789('0x2a')](this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8],{'showHidden':![],'depth':null}));ami[_0x6789('0x21')](_0x6789('0x6b'),this[_0x6789('0xb')][_0x290366['uniqueid']][_0x164bb8]);logger[_0x6789('0x28')](_0x6789('0x6c'),_0x290366[_0x6789('0x26')],util[_0x6789('0x2a')](this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8],{'showHidden':![],'depth':null}));this['emit'](util[_0x6789('0x37')]('user:%s',_0x290366['membername']),_0x6789('0x6d'),this[_0x6789('0xb')][_0x290366[_0x6789('0x26')]][_0x164bb8]);}}}}}}catch(_0x3cdc49){logger[_0x6789('0x39')](_0x6789('0x6e'),_0x290366['uniqueid'],util['inspect'](_0x3cdc49,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x15a234){try{if(this['isNotNull'](_0x15a234)){logger['debug'](_0x6789('0x6f'),_0x15a234[_0x6789('0x26')],util[_0x6789('0x2a')](_0x15a234,{'showHidden':![],'depth':null}));this[_0x6789('0x70')](_0x15a234['uniqueid'],_[_0x6789('0x71')](_0x15a234[_0x6789('0x72')])[0x0],_0x15a234['value']);if(this[_0x6789('0xb')][_0x15a234[_0x6789('0x26')]]){for(var _0x357cd0 in this['channels'][_0x15a234['uniqueid']]){if(this[_0x6789('0xb')][_0x15a234['uniqueid']][_0x6789('0x3d')](_0x357cd0)){logger[_0x6789('0x24')](_0x6789('0x73'),_0x15a234[_0x6789('0x26')],_0x357cd0,_[_0x6789('0x71')](_0x15a234[_0x6789('0x72')])[0x0],_0x15a234['value']);if(_[_0x6789('0x22')](this[_0x6789('0xb')][_0x15a234[_0x6789('0x26')]][_0x357cd0][_0x6789('0xe')])){this[_0x6789('0xb')][_0x15a234['uniqueid']][_0x357cd0][_0x6789('0xe')]={};}this[_0x6789('0xb')][_0x15a234[_0x6789('0x26')]][_0x357cd0][_0x6789('0xe')]=this[_0x6789('0xe')][_0x15a234[_0x6789('0x26')]];}}}}}catch(_0x3346a9){logger[_0x6789('0x39')](_0x6789('0x74'),_0x15a234[_0x6789('0x26')],util[_0x6789('0x2a')](_0x3346a9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x70')]=function(_0x13c801,_0x8dd49e,_0x2555a9){var _0x1e21d=[_0x6789('0x75'),_0x6789('0x76'),_0x6789('0x77'),'rtpaudioqosjitterbridged',_0x6789('0x78'),_0x6789('0x79'),_0x6789('0x7a'),_0x6789('0x7b'),_0x6789('0x7c'),_0x6789('0x7d'),'bridgepeer',_0x6789('0x7e'),'membercalls',_0x6789('0x7f'),_0x6789('0x80'),_0x6789('0x81'),_0x6789('0x27'),'memberpenalty',_0x6789('0x82')];if(!_[_0x6789('0x83')](_0x8dd49e)&&!_[_0x6789('0x84')](_0x1e21d,_0x8dd49e)){if(_[_0x6789('0x22')](this[_0x6789('0xe')][_0x13c801])){this[_0x6789('0xe')][_0x13c801]={};}this[_0x6789('0xe')][_0x13c801][_0x8dd49e]=_0x2555a9;}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x85')]=function(_0x443820){try{if(this[_0x6789('0x23')](_0x443820)){logger[_0x6789('0x28')](_0x6789('0x86'),_0x443820['uniqueid'],util[_0x6789('0x2a')](_0x443820,{'showHidden':![],'depth':null}));if(this[_0x6789('0xb')][_0x443820[_0x6789('0x26')]]){for(var _0x13a1a6 in this[_0x6789('0xb')][_0x443820[_0x6789('0x26')]]){if(this[_0x6789('0xb')][_0x443820['uniqueid']][_0x6789('0x3d')](_0x13a1a6)){if(this[_0x6789('0xb')][_0x443820[_0x6789('0x26')]][_0x13a1a6][_0x6789('0x51')]==_0x6789('0x87')&&this[_0x6789('0xb')][_0x443820[_0x6789('0x26')]][_0x13a1a6]['agentcomplete']){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x443820[_0x6789('0x26')],_0x13a1a6);this[_0x6789('0xb')][_0x443820[_0x6789('0x26')]][_0x13a1a6][_0x6789('0x62')]=moment()[_0x6789('0x37')](_0x6789('0x2c'));}}}logger[_0x6789('0x28')](_0x6789('0x88'),_0x443820['uniqueid'],util[_0x6789('0x2a')](_['values'](this['channels'][_0x443820[_0x6789('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x6789('0x21')](_0x6789('0x89'),_[_0x6789('0x8a')](this['channels'][_0x443820['uniqueid']]));delete this[_0x6789('0xb')][_0x443820['uniqueid']];}if(this[_0x6789('0xe')][_0x443820[_0x6789('0x26')]]){delete this[_0x6789('0xe')][_0x443820[_0x6789('0x26')]];}}}catch(_0xffc785){logger[_0x6789('0x39')](_0x6789('0x8b'),_0x443820['uniqueid'],util[_0x6789('0x2a')](_0xffc785,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x1e')]=function(_0x2c1b00){try{if(this[_0x6789('0x23')](_0x2c1b00)){logger['debug'](_0x6789('0x8c'),_0x2c1b00[_0x6789('0x26')],util[_0x6789('0x2a')](_0x2c1b00,{'showHidden':![],'depth':null}));if(this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x8d')]]){for(var _0x3a470d in this['channels'][_0x2c1b00[_0x6789('0x8d')]]){if(this['channels'][_0x2c1b00[_0x6789('0x8d')]][_0x6789('0x3d')](_0x3a470d)){if(_0x2c1b00[_0x6789('0x8e')]===_0x3a470d){logger[_0x6789('0x24')](_0x6789('0x8f'),_0x2c1b00[_0x6789('0x26')],this[_0x6789('0xb')][_0x2c1b00['transfereeuniqueid']][_0x3a470d][_0x6789('0x27')],_0x3a470d);var _0x82d6a2=moment();this[_0x6789('0xb')][_0x2c1b00['transfereeuniqueid']][_0x3a470d][_0x6789('0x16')]=!![];this[_0x6789('0xb')][_0x2c1b00['transfereeuniqueid']][_0x3a470d][_0x6789('0x62')]=moment()[_0x6789('0x37')](_0x6789('0x2c'));this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x8d')]][_0x3a470d]['lastevent']=_0x6789('0x63');this[_0x6789('0xb')][_0x2c1b00['transfereeuniqueid']][_0x3a470d][_0x6789('0x51')]=_0x6789('0x87');this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x8d')]][_0x3a470d][_0x6789('0x65')]=_0x82d6a2['diff'](this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x8d')]][_0x3a470d][_0x6789('0x3e')],_0x6789('0x90'));}}}}if(this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x91')]]){var _0x409e84=this['channels'][_0x2c1b00['secondtransfereruniqueid']];this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x91')]]=this[_0x6789('0xb')][_0x2c1b00['transfereeuniqueid']];this[_0x6789('0xb')][_0x2c1b00[_0x6789('0x8d')]]=_0x409e84;}}}catch(_0x598f31){logger['error'](_0x6789('0x92'),_0x2c1b00['uniqueid'],util[_0x6789('0x2a')](_0x598f31,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x1f')]=function(_0x33b0f1){try{if(this[_0x6789('0x23')](_0x33b0f1)){logger[_0x6789('0x28')](_0x6789('0x93'),_0x33b0f1['uniqueid'],util[_0x6789('0x2a')](_0x33b0f1,{'showHidden':![],'depth':null}));if(this[_0x6789('0xb')][_0x33b0f1[_0x6789('0x8d')]]){for(var _0x375684 in this['channels'][_0x33b0f1[_0x6789('0x8d')]]){if(this['channels'][_0x33b0f1[_0x6789('0x8d')]][_0x6789('0x3d')](_0x375684)){if(_0x33b0f1[_0x6789('0x94')]===_0x375684){logger[_0x6789('0x24')](_0x6789('0x95'),_0x33b0f1[_0x6789('0x26')],this[_0x6789('0xb')][_0x33b0f1[_0x6789('0x8d')]][_0x375684][_0x6789('0x27')],_0x375684);var _0x2039c1=moment();this[_0x6789('0xb')][_0x33b0f1[_0x6789('0x8d')]][_0x375684][_0x6789('0x16')]=!![];this[_0x6789('0xb')][_0x33b0f1['transfereeuniqueid']][_0x375684][_0x6789('0x62')]=_0x2039c1;this[_0x6789('0xb')][_0x33b0f1[_0x6789('0x8d')]][_0x375684]['lastevent']=_0x6789('0x63');this[_0x6789('0xb')][_0x33b0f1[_0x6789('0x8d')]][_0x375684][_0x6789('0x51')]='transfer';this['channels'][_0x33b0f1['transfereeuniqueid']][_0x375684]['talktime']=_0x2039c1[_0x6789('0x96')](this[_0x6789('0xb')][_0x33b0f1[_0x6789('0x8d')]][_0x375684][_0x6789('0x3e')],_0x6789('0x90'));}}}}}}catch(_0x7a610d){logger[_0x6789('0x39')](_0x6789('0x97'),_0x33b0f1[_0x6789('0x26')],util['inspect'](_0x7a610d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6789('0x98')]=function(_0x98aff3){var _0xd859b7='';try{if(this[_0x6789('0x23')](_0x98aff3)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x98aff3[_0x6789('0x26')],util[_0x6789('0x2a')](_0x98aff3,{'showHidden':![],'depth':null}));if(_0x98aff3[_0x6789('0x99')]){_0xd859b7=_0x98aff3[_0x6789('0x99')][_0x6789('0x9a')](0x0,_0x98aff3[_0x6789('0x99')][_0x6789('0x9b')]('-'));if(this[_0x6789('0xd')][_0xd859b7]){logger['info'](_0x6789('0x9c'),_0x98aff3[_0x6789('0x26')],_0xd859b7);this[_0x6789('0xd')][_0xd859b7][_0x6789('0x9d')]=!![];}}}}catch(_0x268c0d){logger[_0x6789('0x39')](_0x6789('0x9e'),_0x98aff3[_0x6789('0x26')],util[_0x6789('0x2a')](_0x268c0d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6789('0x20')][_0x6789('0x1c')]=function(_0x2e17fe){var _0x330946='';try{if(this[_0x6789('0x23')](_0x2e17fe)){logger[_0x6789('0x28')](_0x6789('0x9f'),_0x2e17fe[_0x6789('0x26')],util[_0x6789('0x2a')](_0x2e17fe,{'showHidden':![],'depth':null}));if(_0x2e17fe[_0x6789('0x99')]){_0x330946=_0x2e17fe[_0x6789('0x99')][_0x6789('0x9a')](0x0,_0x2e17fe[_0x6789('0x99')][_0x6789('0x9b')]('-'));if(this['agents'][_0x330946]){logger[_0x6789('0x24')](_0x6789('0xa0'),_0x2e17fe['uniqueid'],_0x330946);this[_0x6789('0xd')][_0x330946][_0x6789('0x9d')]=![];}}}}catch(_0x6f075b){logger[_0x6789('0x39')](_0x6789('0xa1'),_0x2e17fe['uniqueid'],util[_0x6789('0x2a')](_0x6f075b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xfbbf=['syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','lastevent','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','transfer','agent','talktime','acw','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','isNil','includes','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','blindtransfer'];(function(_0x1eaa79,_0x4955cb){var _0x82b076=function(_0x95633d){while(--_0x95633d){_0x1eaa79['push'](_0x1eaa79['shift']());}};_0x82b076(++_0x4955cb);}(_0xfbbf,0x78));var _0xffbb=function(_0x1c7c68,_0x1640d9){_0x1c7c68=_0x1c7c68-0x0;var _0x3d7479=_0xfbbf[_0x1c7c68];return _0x3d7479;};'use strict';var _=require(_0xffbb('0x0'));var moment=require(_0xffbb('0x1'));var util=require(_0xffbb('0x2'));var Redis=require(_0xffbb('0x3'));var config=require(_0xffbb('0x4'));var logger=require(_0xffbb('0x5'))('ami');var ami=require('../ami');config['redis']=_[_0xffbb('0x6')](config[_0xffbb('0x7')],{'host':_0xffbb('0x8'),'port':0x18eb});var io=require(_0xffbb('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x16f740){this[_0xffbb('0xa')]={};this['voiceChannels']=_0x16f740['channels'];this[_0xffbb('0xb')]=_0x16f740[_0xffbb('0xb')];this[_0xffbb('0xc')]=_0x16f740[_0xffbb('0xc')];this[_0xffbb('0xd')]={};ami['on'](_0xffbb('0xe'),this['syncAgentCalled'][_0xffbb('0xf')](this));ami['on']('agentconnect',this[_0xffbb('0x10')][_0xffbb('0xf')](this));ami['on'](_0xffbb('0x11'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xffbb('0x12'),this[_0xffbb('0x13')][_0xffbb('0xf')](this));ami['on']('agentcomplete',this[_0xffbb('0x14')][_0xffbb('0xf')](this));ami['on'](_0xffbb('0x15'),this['syncVarSet']['bind'](this));ami['on'](_0xffbb('0x16'),this[_0xffbb('0x17')][_0xffbb('0xf')](this));ami['on'](_0xffbb('0x18'),this[_0xffbb('0x19')]['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xffbb('0xf')](this));ami['on'](_0xffbb('0x1a'),this[_0xffbb('0x1b')][_0xffbb('0xf')](this));}VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x1d')]=function(_0x49718d,_0x10ab24,_0x5e48bc){io['to'](_0x49718d)[_0xffbb('0x1d')](_0x10ab24,_0x5e48bc);};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x1e')]=function(_0x1c6537){return _0x1c6537!==null&&!_[_0xffbb('0x1f')](_0x1c6537);};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x20')]=function(_0x1d356f){try{if(this[_0xffbb('0x1e')](_0x1d356f)){logger['info'](_0xffbb('0x21'),_0x1d356f[_0xffbb('0x22')],_0x1d356f[_0xffbb('0x23')],_0x1d356f[_0xffbb('0x24')]);logger['debug'](_0xffbb('0x25'),_0x1d356f[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x1d356f,{'showHidden':![],'depth':null}));if(_[_0xffbb('0x1f')](this['channels'][_0x1d356f[_0xffbb('0x22')]])){this[_0xffbb('0xa')][_0x1d356f[_0xffbb('0x22')]]={};}if(_[_0xffbb('0x1f')](this[_0xffbb('0xa')][_0x1d356f[_0xffbb('0x22')]][_0x1d356f[_0xffbb('0x24')]])){this[_0xffbb('0xa')][_0x1d356f['uniqueid']][_0x1d356f['destuniqueid']]={'agentcalledAt':moment()[_0xffbb('0x27')](_0xffbb('0x28')),'lastevent':_0xffbb('0x29'),'mandatoryDisposition':this[_0xffbb('0xb')][_0x1d356f[_0xffbb('0x2a')]]?this[_0xffbb('0xb')][_0x1d356f[_0xffbb('0x2a')]]['mandatoryDisposition']||![]:![],'type':this['voiceQueues'][_0x1d356f['queue']]?this[_0xffbb('0xb')][_0x1d356f[_0xffbb('0x2a')]][_0xffbb('0x2b')]||_0xffbb('0x2c'):_0xffbb('0x2c'),'variables':this[_0xffbb('0xd')][_0x1d356f[_0xffbb('0x22')]],'motionChannel':_0xffbb('0x2d')};}_['merge'](this[_0xffbb('0xa')][_0x1d356f['uniqueid']][_0x1d356f[_0xffbb('0x24')]],_[_0xffbb('0x2e')](_0x1d356f,[_0xffbb('0x2f'),_0xffbb('0x30')]));logger[_0xffbb('0x31')](_0xffbb('0x32'),_0x1d356f[_0xffbb('0x22')],util[_0xffbb('0x26')](this[_0xffbb('0xa')][_0x1d356f['uniqueid']][_0x1d356f['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xffbb('0x1d')](_0xffbb('0x33'),this[_0xffbb('0xa')][_0x1d356f['uniqueid']][_0x1d356f['destuniqueid']]);logger[_0xffbb('0x31')](_0xffbb('0x34'),_0x1d356f[_0xffbb('0x22')],util[_0xffbb('0x26')](this['channels'][_0x1d356f[_0xffbb('0x22')]][_0x1d356f[_0xffbb('0x24')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xffbb('0x27')]('user:%s',_0x1d356f[_0xffbb('0x23')]),_0xffbb('0x35'),this['channels'][_0x1d356f[_0xffbb('0x22')]][_0x1d356f[_0xffbb('0x24')]]);}}catch(_0x1d8d07){logger[_0xffbb('0x36')](_0xffbb('0x37'),_0x1d356f[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x1d8d07,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x10')]=function(_0x51c451){try{if(this[_0xffbb('0x1e')](_0x51c451)){if(this['channels'][_0x51c451[_0xffbb('0x22')]]){logger[_0xffbb('0x31')](_0xffbb('0x38'),_0x51c451['uniqueid'],util[_0xffbb('0x26')](_0x51c451,{'showHidden':![],'depth':null}));for(var _0x157fdc in this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]]){if(this[_0xffbb('0xa')][_0x51c451['uniqueid']][_0xffbb('0x39')](_0x157fdc)){if(_0x51c451[_0xffbb('0x24')]===_0x157fdc){logger[_0xffbb('0x3a')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x51c451['uniqueid'],_0x51c451[_0xffbb('0x23')],_0x51c451[_0xffbb('0x24')]);this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x3b')]=moment()[_0xffbb('0x27')](_0xffbb('0x28'));this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x3c')]=_0x51c451[_0xffbb('0x3c')];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x3d')]=_0x51c451[_0xffbb('0x3d')];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x3e')]=_0x51c451['destchannelstate'];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc]['destchannelstatedesc']=_0x51c451[_0xffbb('0x3f')];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x40')]=_0x51c451[_0xffbb('0x40')];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc]['lastevent']=_0xffbb('0x41');if(this[_0xffbb('0x42')][this['channels'][_0x51c451[_0xffbb('0x22')]][_0x157fdc]['uniqueid']]){var _0x59773a=this[_0xffbb('0x42')][this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc]['uniqueid']][_0xffbb('0x43')];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x43')]=_0x59773a;_0x51c451[_0xffbb('0x43')]=_0x59773a;}_[_0xffbb('0x44')](this[_0xffbb('0xc')][_0x51c451[_0xffbb('0x45')]],_[_0xffbb('0x46')](_0x51c451,['queue',_0xffbb('0x47'),_0xffbb('0x43')]));logger[_0xffbb('0x31')](_0xffbb('0x48'),_0x51c451[_0xffbb('0x22')],util['inspect'](this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x51c451[_0xffbb('0x24')]],{'showHidden':![],'depth':null}));ami['emit'](_0xffbb('0x49'),this['channels'][_0x51c451['uniqueid']][_0x51c451['destuniqueid']]);logger[_0xffbb('0x31')](_0xffbb('0x4a'),_0x51c451[_0xffbb('0x22')],util[_0xffbb('0x26')](this['channels'][_0x51c451['uniqueid']][_0x51c451[_0xffbb('0x24')]],{'showHidden':![],'depth':null}));this[_0xffbb('0x1d')](util['format'](_0xffbb('0x4b'),_0x51c451[_0xffbb('0x23')]),_0xffbb('0x4c'),this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x51c451[_0xffbb('0x24')]]);}else if(!this['channels'][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x11')]&&!this[_0xffbb('0xa')][_0x51c451['uniqueid']][_0x157fdc][_0xffbb('0x4d')]){logger['info'](_0xffbb('0x4e'),_0x51c451[_0xffbb('0x22')],this['channels'][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x23')],_0x157fdc);this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x11')]=!![];this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc][_0xffbb('0x4f')]=moment()['format'](_0xffbb('0x28'));this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc]['answeredelsewheredestinationuniqueid']=_0x51c451[_0xffbb('0x24')];this[_0xffbb('0xa')][_0x51c451['uniqueid']][_0x157fdc][_0xffbb('0x50')]=_0x51c451[_0xffbb('0x23')];this[_0xffbb('0xa')][_0x51c451['uniqueid']][_0x157fdc][_0xffbb('0x51')]=_0xffbb('0x52');this[_0xffbb('0xa')][_0x51c451[_0xffbb('0x22')]][_0x157fdc]['reason']='answered_elsewhere';logger['debug'](_0xffbb('0x53'),_0x51c451[_0xffbb('0x22')],util[_0xffbb('0x26')](this['channels'][_0x51c451['uniqueid']][_0x157fdc],{'showHidden':![],'depth':null}));ami[_0xffbb('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x51c451['uniqueid']][_0x157fdc]);}}}}}}catch(_0x4ea871){logger[_0xffbb('0x36')](_0xffbb('0x54'),_0x51c451['uniqueid'],util['inspect'](_0x4ea871,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x55')]=function(_0x1568ab){try{if(this[_0xffbb('0x1e')](_0x1568ab)){logger['debug'](_0xffbb('0x56'),_0x1568ab['uniqueid'],util['inspect'](_0x1568ab,{'showHidden':![],'depth':null}));if(this[_0xffbb('0xa')][_0x1568ab[_0xffbb('0x22')]]&&this['channels'][_0x1568ab['uniqueid']][_0x1568ab['destuniqueid']]){logger[_0xffbb('0x3a')](_0xffbb('0x57'),_0x1568ab[_0xffbb('0x22')],_0x1568ab[_0xffbb('0x23')],_0x1568ab[_0xffbb('0x24')]);this['channels'][_0x1568ab[_0xffbb('0x22')]][_0x1568ab[_0xffbb('0x24')]][_0xffbb('0x11')]=!![];this['channels'][_0x1568ab[_0xffbb('0x22')]][_0x1568ab[_0xffbb('0x24')]]['agentringnoanswerAt']=moment()[_0xffbb('0x27')](_0xffbb('0x28'));this[_0xffbb('0xa')][_0x1568ab[_0xffbb('0x22')]][_0x1568ab[_0xffbb('0x24')]][_0xffbb('0x51')]=_0xffbb('0x58');this['channels'][_0x1568ab[_0xffbb('0x22')]][_0x1568ab[_0xffbb('0x24')]][_0xffbb('0x59')]=_0xffbb('0x58');logger['debug'](_0xffbb('0x5a'),_0x1568ab[_0xffbb('0x22')],util[_0xffbb('0x26')](this[_0xffbb('0xa')][_0x1568ab['uniqueid']][_0x1568ab[_0xffbb('0x24')]],{'showHidden':![],'depth':null}));ami[_0xffbb('0x1d')]('custom:agentringnoanswer',this['channels'][_0x1568ab[_0xffbb('0x22')]][_0x1568ab[_0xffbb('0x24')]]);}}}catch(_0x24da5d){logger[_0xffbb('0x36')](_0xffbb('0x5b'),_0x1568ab[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x24da5d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xffbb('0x13')]=function(_0x566397){try{if(this['isNotNull'](_0x566397)){logger['debug'](_0xffbb('0x5c'),_0x566397[_0xffbb('0x22')],util['inspect'](_0x566397,{'showHidden':![],'depth':null}));if(this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]]){for(var _0x3b4adc in this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]]){if(this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]][_0xffbb('0x39')](_0x3b4adc)&&!this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]][_0x3b4adc][_0xffbb('0x11')]&&!this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]][_0x3b4adc][_0xffbb('0x4d')]){logger[_0xffbb('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x566397[_0xffbb('0x22')],this['channels'][_0x566397[_0xffbb('0x22')]][_0x3b4adc]['membername'],_0x3b4adc);this[_0xffbb('0xa')][_0x566397['uniqueid']][_0x3b4adc][_0xffbb('0x11')]=!![];this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]][_0x3b4adc][_0xffbb('0x4f')]=moment()[_0xffbb('0x27')](_0xffbb('0x28'));this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]][_0x3b4adc][_0xffbb('0x51')]=_0xffbb('0x5d');this['channels'][_0x566397[_0xffbb('0x22')]][_0x3b4adc]['reason']=_0xffbb('0x5d');logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x566397[_0xffbb('0x22')],util[_0xffbb('0x26')](this[_0xffbb('0xa')][_0x566397['uniqueid']][_0x3b4adc],{'showHidden':![],'depth':null}));ami[_0xffbb('0x1d')](_0xffbb('0x5e'),this[_0xffbb('0xa')][_0x566397[_0xffbb('0x22')]][_0x3b4adc]);}}}}}catch(_0x437868){logger[_0xffbb('0x36')](_0xffbb('0x5f'),_0x566397['uniqueid'],util['inspect'](_0x437868,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x430513){try{if(this['isNotNull'](_0x430513)){logger[_0xffbb('0x31')](_0xffbb('0x60'),_0x430513[_0xffbb('0x22')],util['inspect'](_0x430513,{'showHidden':![],'depth':null}));if(this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]]){for(var _0x5f08dc in this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]]){if(this[_0xffbb('0xa')][_0x430513['uniqueid']][_0xffbb('0x39')](_0x5f08dc)){if(this[_0xffbb('0xa')][_0x430513['uniqueid']][_0x5f08dc]['agentconnectAt']&&!this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc]['agentcomplete']){logger[_0xffbb('0x3a')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x430513[_0xffbb('0x22')],this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc][_0xffbb('0x23')],_0x5f08dc);this['channels'][_0x430513[_0xffbb('0x22')]][_0x5f08dc][_0xffbb('0x4d')]=!![];this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc]['agentcompleteAt']=moment()[_0xffbb('0x27')](_0xffbb('0x28'));this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc][_0xffbb('0x51')]='complete';this['channels'][_0x430513['uniqueid']][_0x5f08dc]['reason']=_0x430513[_0xffbb('0x59')]==_0xffbb('0x61')?_0xffbb('0x62'):_0x430513[_0xffbb('0x59')];this[_0xffbb('0xa')][_0x430513['uniqueid']][_0x5f08dc][_0xffbb('0x63')]=_0x430513[_0xffbb('0x63')];if(this[_0xffbb('0xb')][_0x430513[_0xffbb('0x2a')]]&&this[_0xffbb('0xb')][_0x430513[_0xffbb('0x2a')]][_0xffbb('0x64')]){this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc]['acwtime']=this['voiceQueues'][_0x430513[_0xffbb('0x2a')]]['acwTimeout'];this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc][_0xffbb('0x65')]=!![];}this[_0xffbb('0xc')][_0x430513[_0xffbb('0x45')]]=_[_0xffbb('0x2e')](this['agents'][_0x430513[_0xffbb('0x45')]],['queue','destconnectedlinenum']);logger[_0xffbb('0x31')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x430513[_0xffbb('0x22')],util[_0xffbb('0x26')](this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc],{'showHidden':![],'depth':null}));ami['emit'](_0xffbb('0x66'),this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc]);logger[_0xffbb('0x31')](_0xffbb('0x67'),_0x430513[_0xffbb('0x22')],util[_0xffbb('0x26')](this[_0xffbb('0xa')][_0x430513['uniqueid']][_0x5f08dc],{'showHidden':![],'depth':null}));this[_0xffbb('0x1d')](util[_0xffbb('0x27')](_0xffbb('0x4b'),_0x430513['membername']),_0xffbb('0x68'),this[_0xffbb('0xa')][_0x430513[_0xffbb('0x22')]][_0x5f08dc]);}}}}}}catch(_0x1d8d5f){logger[_0xffbb('0x36')]('[%s][voiceAgentReport][agentcomplete]',_0x430513[_0xffbb('0x22')],util['inspect'](_0x1d8d5f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xffbb('0x1c')]['syncVarSet']=function(_0x1799ed){try{if(this[_0xffbb('0x1e')](_0x1799ed)){logger[_0xffbb('0x31')](_0xffbb('0x69'),_0x1799ed[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x1799ed,{'showHidden':![],'depth':null}));this[_0xffbb('0x6a')](_0x1799ed[_0xffbb('0x22')],_[_0xffbb('0x6b')](_0x1799ed[_0xffbb('0x6c')])[0x0],_0x1799ed[_0xffbb('0x6d')]);if(this[_0xffbb('0xa')][_0x1799ed[_0xffbb('0x22')]]){for(var _0x1475bb in this[_0xffbb('0xa')][_0x1799ed[_0xffbb('0x22')]]){if(this[_0xffbb('0xa')][_0x1799ed[_0xffbb('0x22')]][_0xffbb('0x39')](_0x1475bb)){logger[_0xffbb('0x3a')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x1799ed[_0xffbb('0x22')],_0x1475bb,_[_0xffbb('0x6b')](_0x1799ed[_0xffbb('0x6c')])[0x0],_0x1799ed['value']);if(_['isUndefined'](this[_0xffbb('0xa')][_0x1799ed[_0xffbb('0x22')]][_0x1475bb][_0xffbb('0xd')])){this[_0xffbb('0xa')][_0x1799ed[_0xffbb('0x22')]][_0x1475bb][_0xffbb('0xd')]={};}this[_0xffbb('0xa')][_0x1799ed[_0xffbb('0x22')]][_0x1475bb][_0xffbb('0xd')]=this[_0xffbb('0xd')][_0x1799ed[_0xffbb('0x22')]];}}}}}catch(_0x54cdfa){logger[_0xffbb('0x36')]('[%s][voiceAgentReport][varset]',_0x1799ed[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x54cdfa,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xffbb('0x6a')]=function(_0x59bb28,_0xce5192,_0x1dd1fe){var _0x2f92eb=[_0xffbb('0x6e'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xffbb('0x6f'),_0xffbb('0x70'),_0xffbb('0x71'),_0xffbb('0x72'),_0xffbb('0x73'),'sipcallid',_0xffbb('0x74'),_0xffbb('0x75'),'bridgepvtcallid',_0xffbb('0x76'),_0xffbb('0x77'),_0xffbb('0x78'),'memberlastcall',_0xffbb('0x23'),_0xffbb('0x79'),'memberrealtime'];if(!_[_0xffbb('0x7a')](_0xce5192)&&!_[_0xffbb('0x7b')](_0x2f92eb,_0xce5192)){if(_['isUndefined'](this[_0xffbb('0xd')][_0x59bb28])){this[_0xffbb('0xd')][_0x59bb28]={};}this[_0xffbb('0xd')][_0x59bb28][_0xce5192]=_0x1dd1fe;}};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x17')]=function(_0x25f4ac){try{if(this[_0xffbb('0x1e')](_0x25f4ac)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x25f4ac[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x25f4ac,{'showHidden':![],'depth':null}));if(this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]]){for(var _0x4730d7 in this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]]){if(this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]]['hasOwnProperty'](_0x4730d7)){if(this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]][_0x4730d7]['reason']==_0xffbb('0x61')&&this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]][_0x4730d7]['agentcomplete']){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x25f4ac[_0xffbb('0x22')],_0x4730d7);this['channels'][_0x25f4ac[_0xffbb('0x22')]][_0x4730d7][_0xffbb('0x7c')]=moment()[_0xffbb('0x27')](_0xffbb('0x28'));}}}logger[_0xffbb('0x31')](_0xffbb('0x7d'),_0x25f4ac[_0xffbb('0x22')],util[_0xffbb('0x26')](_[_0xffbb('0x7e')](this[_0xffbb('0xa')][_0x25f4ac['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xffbb('0x1d')](_0xffbb('0x7f'),_[_0xffbb('0x7e')](this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]]));delete this[_0xffbb('0xa')][_0x25f4ac[_0xffbb('0x22')]];}if(this[_0xffbb('0xd')][_0x25f4ac[_0xffbb('0x22')]]){delete this['variables'][_0x25f4ac[_0xffbb('0x22')]];}}}catch(_0x4b16e5){logger['error']('[%s][voiceAgentReport][hangup]',_0x25f4ac[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x4b16e5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xffbb('0x80')]=function(_0x3dc86a){try{if(this[_0xffbb('0x1e')](_0x3dc86a)){logger[_0xffbb('0x31')](_0xffbb('0x81'),_0x3dc86a[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x3dc86a,{'showHidden':![],'depth':null}));if(this['channels'][_0x3dc86a[_0xffbb('0x82')]]){for(var _0x4cf20a in this[_0xffbb('0xa')][_0x3dc86a[_0xffbb('0x82')]]){if(this[_0xffbb('0xa')][_0x3dc86a['transfereeuniqueid']][_0xffbb('0x39')](_0x4cf20a)){if(_0x3dc86a[_0xffbb('0x83')]===_0x4cf20a){logger[_0xffbb('0x3a')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3dc86a['uniqueid'],this['channels'][_0x3dc86a[_0xffbb('0x82')]][_0x4cf20a][_0xffbb('0x23')],_0x4cf20a);var _0x5f4a7c=moment();this[_0xffbb('0xa')][_0x3dc86a['transfereeuniqueid']][_0x4cf20a][_0xffbb('0x4d')]=!![];this['channels'][_0x3dc86a[_0xffbb('0x82')]][_0x4cf20a][_0xffbb('0x7c')]=moment()[_0xffbb('0x27')](_0xffbb('0x28'));this[_0xffbb('0xa')][_0x3dc86a[_0xffbb('0x82')]][_0x4cf20a][_0xffbb('0x51')]=_0xffbb('0x84');this[_0xffbb('0xa')][_0x3dc86a[_0xffbb('0x82')]][_0x4cf20a][_0xffbb('0x59')]=_0xffbb('0x61');this[_0xffbb('0xa')][_0x3dc86a[_0xffbb('0x82')]][_0x4cf20a]['talktime']=_0x5f4a7c[_0xffbb('0x85')](this[_0xffbb('0xa')][_0x3dc86a[_0xffbb('0x82')]][_0x4cf20a][_0xffbb('0x3b')],'seconds');}}}}if(this['channels'][_0x3dc86a[_0xffbb('0x86')]]){var _0x4b1ba8=this['channels'][_0x3dc86a[_0xffbb('0x86')]];this[_0xffbb('0xa')][_0x3dc86a['secondtransfereruniqueid']]=this[_0xffbb('0xa')][_0x3dc86a[_0xffbb('0x82')]];this['channels'][_0x3dc86a[_0xffbb('0x82')]]=_0x4b1ba8;}}}catch(_0x1b5f80){logger[_0xffbb('0x36')](_0xffbb('0x87'),_0x3dc86a[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x1b5f80,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x1b')]=function(_0x30ba81){try{if(this[_0xffbb('0x1e')](_0x30ba81)){logger[_0xffbb('0x31')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x30ba81[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x30ba81,{'showHidden':![],'depth':null}));if(this[_0xffbb('0xa')][_0x30ba81[_0xffbb('0x82')]]){for(var _0x51ab89 in this[_0xffbb('0xa')][_0x30ba81[_0xffbb('0x82')]]){if(this[_0xffbb('0xa')][_0x30ba81[_0xffbb('0x82')]]['hasOwnProperty'](_0x51ab89)){if(_0x30ba81[_0xffbb('0x88')]===_0x51ab89){logger[_0xffbb('0x3a')](_0xffbb('0x89'),_0x30ba81[_0xffbb('0x22')],this[_0xffbb('0xa')][_0x30ba81[_0xffbb('0x82')]][_0x51ab89]['membername'],_0x51ab89);var _0x13ea65=moment();this[_0xffbb('0xa')][_0x30ba81[_0xffbb('0x82')]][_0x51ab89][_0xffbb('0x4d')]=!![];this[_0xffbb('0xa')][_0x30ba81['transfereeuniqueid']][_0x51ab89][_0xffbb('0x7c')]=_0x13ea65;this['channels'][_0x30ba81[_0xffbb('0x82')]][_0x51ab89][_0xffbb('0x51')]=_0xffbb('0x84');this['channels'][_0x30ba81[_0xffbb('0x82')]][_0x51ab89]['reason']=_0xffbb('0x61');this[_0xffbb('0xa')][_0x30ba81['transfereeuniqueid']][_0x51ab89][_0xffbb('0x63')]=_0x13ea65[_0xffbb('0x85')](this[_0xffbb('0xa')][_0x30ba81['transfereeuniqueid']][_0x51ab89][_0xffbb('0x3b')],_0xffbb('0x8a'));}}}}}}catch(_0x15c787){logger[_0xffbb('0x36')]('[%s][voiceAgentReport][blindtransfer]',_0x30ba81[_0xffbb('0x22')],util['inspect'](_0x15c787,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x19')]=function(_0x36d742){var _0x20922d='';try{if(this[_0xffbb('0x1e')](_0x36d742)){logger[_0xffbb('0x31')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x36d742[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x36d742,{'showHidden':![],'depth':null}));if(_0x36d742[_0xffbb('0x8b')]){_0x20922d=_0x36d742['channel'][_0xffbb('0x8c')](0x0,_0x36d742['channel'][_0xffbb('0x8d')]('-'));if(this['agents'][_0x20922d]){logger[_0xffbb('0x3a')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x36d742['uniqueid'],_0x20922d);this[_0xffbb('0xc')][_0x20922d]['onhold']=!![];}}}}catch(_0x17f8c4){logger[_0xffbb('0x36')](_0xffbb('0x8e'),_0x36d742['uniqueid'],util[_0xffbb('0x26')](_0x17f8c4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xffbb('0x1c')][_0xffbb('0x8f')]=function(_0x5850f1){var _0x54dff3='';try{if(this[_0xffbb('0x1e')](_0x5850f1)){logger[_0xffbb('0x31')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x5850f1[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x5850f1,{'showHidden':![],'depth':null}));if(_0x5850f1[_0xffbb('0x8b')]){_0x54dff3=_0x5850f1[_0xffbb('0x8b')][_0xffbb('0x8c')](0x0,_0x5850f1[_0xffbb('0x8b')][_0xffbb('0x8d')]('-'));if(this[_0xffbb('0xc')][_0x54dff3]){logger['info'](_0xffbb('0x90'),_0x5850f1[_0xffbb('0x22')],_0x54dff3);this['agents'][_0x54dff3]['onhold']=![];}}}}catch(_0x5ddbea){logger['error'](_0xffbb('0x91'),_0x5850f1[_0xffbb('0x22')],util[_0xffbb('0x26')](_0x5ddbea,{'showHidden':![],'depth':null}));}};module[_0xffbb('0x92')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 3897f1b..5b08baf 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 _0xac98=['uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','keys','context','from-sip','channel','exten','xcally-motion-preview','split','destconnectedlinenum','connectedlinenum','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','toNumber','channelstate','format','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','linkedid','application','toLowerCase','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','applicationdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','match','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','replace','.wav49','.WAV','monitorFilename','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%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','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','answertime','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','agi','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xac98,0x93));var _0x8ac9=function(_0x478d3e,_0xd3b48b){_0x478d3e=_0x478d3e-0x0;var _0x3daa43=_0xac98[_0x478d3e];return _0x3daa43;};'use strict';var BPromise=require(_0x8ac9('0x0'));var _=require(_0x8ac9('0x1'));var moment=require(_0x8ac9('0x2'));var util=require('util');var path=require(_0x8ac9('0x3'));var Redis=require('ioredis');var config=require(_0x8ac9('0x4'));var logger=require(_0x8ac9('0x5'))(_0x8ac9('0x6'));var ami=require(_0x8ac9('0x7'));var Channel=require(_0x8ac9('0x8'));var RpcSetting=require(_0x8ac9('0x9'));var statusDesc=[_0x8ac9('0xa'),_0x8ac9('0xb'),_0x8ac9('0xc'),_0x8ac9('0xd'),_0x8ac9('0xe'),_0x8ac9('0xf'),_0x8ac9('0x10'),_0x8ac9('0x11'),_0x8ac9('0x12')];var applications=[_0x8ac9('0x13'),'queue',_0x8ac9('0x14'),'dial','playback',_0x8ac9('0x15')];var dispositions=[_0x8ac9('0x16'),'FAILED',_0x8ac9('0x17'),_0x8ac9('0x16'),_0x8ac9('0x16'),'NO\x20ANSWER',_0x8ac9('0x18'),'BUSY',_0x8ac9('0x17'),_0x8ac9('0x17'),_0x8ac9('0x17')];var actions={};config[_0x8ac9('0x19')]=_[_0x8ac9('0x1a')](config[_0x8ac9('0x19')],{'host':'localhost','port':0x18eb});var io=require(_0x8ac9('0x1b'))(new Redis(config[_0x8ac9('0x19')]));function VoiceCallReport(_0xb0af42){this[_0x8ac9('0x1c')]=_0xb0af42[_0x8ac9('0x1c')];this[_0x8ac9('0x1d')]=_0xb0af42[_0x8ac9('0x1d')];this[_0x8ac9('0x1e')]={};ami['on'](_0x8ac9('0x1f'),this[_0x8ac9('0x20')][_0x8ac9('0x21')](this));ami['on'](_0x8ac9('0x22'),this[_0x8ac9('0x20')][_0x8ac9('0x21')](this));ami['on'](_0x8ac9('0x23'),this[_0x8ac9('0x24')][_0x8ac9('0x21')](this));ami['on'](_0x8ac9('0x25'),this['syncNewState']['bind'](this));ami['on'](_0x8ac9('0x26'),this[_0x8ac9('0x27')][_0x8ac9('0x21')](this));ami['on'](_0x8ac9('0x28'),this[_0x8ac9('0x29')]['bind'](this));ami['on'](_0x8ac9('0x2a'),this[_0x8ac9('0x2b')][_0x8ac9('0x21')](this));ami['on'](_0x8ac9('0x2c'),this[_0x8ac9('0x2d')][_0x8ac9('0x21')](this));ami['on'](_0x8ac9('0x2e'),this[_0x8ac9('0x2f')][_0x8ac9('0x21')](this));ami['on']('musiconholdstart',this[_0x8ac9('0x30')]['bind'](this));ami['on'](_0x8ac9('0x31'),this[_0x8ac9('0x32')][_0x8ac9('0x21')](this));try{logger[_0x8ac9('0x33')](_0x8ac9('0x34'));ami[_0x8ac9('0x35')]();}catch(_0x3b99c9){logger['error'](_0x8ac9('0x36'),util[_0x8ac9('0x37')](_0x3b99c9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x8ac9('0x38')]['isNotNull']=function(_0x10713a){return _0x10713a!==null&&!_[_0x8ac9('0x39')](_0x10713a);};VoiceCallReport[_0x8ac9('0x38')][_0x8ac9('0x3a')]=function(_0x4b3d90,_0x105e9f,_0x4a67bd){io['to'](_0x4b3d90)[_0x8ac9('0x3a')](_0x105e9f,_0x4a67bd);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x298f53){try{if(this[_0x8ac9('0x3b')](_0x298f53)){logger[_0x8ac9('0x33')](_0x8ac9('0x3c'),_0x298f53[_0x8ac9('0x3d')],_0x298f53[_0x8ac9('0x3e')],_0x298f53[_0x8ac9('0x3f')]);logger[_0x8ac9('0x40')](_0x8ac9('0x41'),_0x298f53[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x298f53,{'showHidden':![],'depth':null}));if(_0x298f53[_0x8ac9('0x3d')]===_0x298f53['linkedid']){if(!_[_0x8ac9('0x39')](this[_0x8ac9('0x1c')][_0x298f53['uniqueid']])){_[_0x8ac9('0x42')](this[_0x8ac9('0x1c')][_0x298f53[_0x8ac9('0x3d')]],_[_0x8ac9('0x43')](_0x298f53,_[_0x8ac9('0x44')](this[_0x8ac9('0x1c')][_0x298f53[_0x8ac9('0x3d')]])));}}if(_0x298f53[_0x8ac9('0x45')]===_0x8ac9('0x46')){if(this[_0x8ac9('0x1d')][_0x298f53[_0x8ac9('0x47')]['split']('-')[0x0]]){if(_0x298f53[_0x8ac9('0x48')]==_0x8ac9('0x49')){this[_0x8ac9('0x1d')][_0x298f53[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4b')]=_0x298f53[_0x8ac9('0x4c')];this[_0x8ac9('0x3a')](util['format']('user:%s',this[_0x8ac9('0x1d')][_0x298f53[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4d')]),_0x8ac9('0x4e'),{'destaccountcode':this[_0x8ac9('0x1d')][_0x298f53['channel'][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4f')],'destconnectedlinenum':_0x298f53['connectedlinenum']});}}}}}catch(_0x12533d){logger[_0x8ac9('0x50')](_0x8ac9('0x51'),_0x298f53['uniqueid'],util[_0x8ac9('0x37')](_0x12533d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')][_0x8ac9('0x24')]=function(_0x5cd8d4){try{if(this[_0x8ac9('0x3b')](_0x5cd8d4)){logger['debug'](_0x8ac9('0x52'),_0x5cd8d4['uniqueid'],util['inspect'](_0x5cd8d4,{'showHidden':![],'depth':null}));if(_0x5cd8d4['uniqueid']===_0x5cd8d4['linkedid']&&_0x5cd8d4[_0x8ac9('0x47')]!=_0x8ac9('0x53')){if(_[_0x8ac9('0x39')](this[_0x8ac9('0x1c')][_0x5cd8d4['uniqueid']])){logger['info'](_0x8ac9('0x54'),_0x5cd8d4[_0x8ac9('0x3d')],_0x5cd8d4['context'],_0x5cd8d4[_0x8ac9('0x48')]);this[_0x8ac9('0x1c')][_0x5cd8d4[_0x8ac9('0x3d')]]=new Channel();this[_0x8ac9('0x1c')][_0x5cd8d4[_0x8ac9('0x3d')]][_0x8ac9('0x55')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8ac9('0x1c')][_0x5cd8d4[_0x8ac9('0x3d')]][_0x8ac9('0x56')]=dispositions[_[_0x8ac9('0x57')](_0x5cd8d4[_0x8ac9('0x58')])];_[_0x8ac9('0x42')](this['channels'][_0x5cd8d4[_0x8ac9('0x3d')]],_[_0x8ac9('0x43')](_0x5cd8d4,_[_0x8ac9('0x44')](this[_0x8ac9('0x1c')][_0x5cd8d4[_0x8ac9('0x3d')]])));if(_0x5cd8d4[_0x8ac9('0x45')]==='from-sip'){if(this[_0x8ac9('0x1d')][_0x5cd8d4[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]){if(_[_0x8ac9('0x39')](this['agents'][_0x5cd8d4['channel'][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4b')])){this[_0x8ac9('0x1d')][_0x5cd8d4['channel'][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4b')]=_0x5cd8d4['exten'];logger[_0x8ac9('0x40')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x5cd8d4[_0x8ac9('0x3d')],util[_0x8ac9('0x37')]({'destaccountcode':this[_0x8ac9('0x1d')][_0x5cd8d4[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4f')],'destconnectedlinenum':_0x5cd8d4[_0x8ac9('0x48')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x8ac9('0x59')](_0x8ac9('0x5a'),this[_0x8ac9('0x1d')][_0x5cd8d4[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]['name']),_0x8ac9('0x4e'),{'destaccountcode':this['agents'][_0x5cd8d4[_0x8ac9('0x47')]['split']('-')[0x0]][_0x8ac9('0x4f')],'destconnectedlinenum':_0x5cd8d4[_0x8ac9('0x48')]});}}}}}}}catch(_0x7f043a){logger[_0x8ac9('0x50')](_0x8ac9('0x5b'),_0x5cd8d4[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x7f043a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8ac9('0x20')]=function(_0x9fb12f){try{if(this[_0x8ac9('0x3b')](_0x9fb12f)){logger[_0x8ac9('0x40')](_0x8ac9('0x5c'),_0x9fb12f[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x9fb12f,{'showHidden':![],'depth':null}));if(_0x9fb12f[_0x8ac9('0x3d')]===_0x9fb12f[_0x8ac9('0x5d')]&&_0x9fb12f[_0x8ac9('0x48')]!='h'&&_0x9fb12f[_0x8ac9('0x47')]!=_0x8ac9('0x53')){_0x9fb12f[_0x8ac9('0x5e')]=_0x9fb12f['application'][_0x8ac9('0x5f')]();_0x9fb12f['applicationdata']=_0x9fb12f[_0x8ac9('0x60')]&&_0x9fb12f['appdata']['startsWith']('CDR(routeAlias)')?_0x9fb12f['appdata']:(_0x9fb12f[_0x8ac9('0x60')]||_0x9fb12f['applicationdata'])[_0x8ac9('0x5f')]();logger[_0x8ac9('0x33')](_0x8ac9('0x61'),_0x9fb12f[_0x8ac9('0x3d')],_0x9fb12f[_0x8ac9('0x5e')],_0x9fb12f[_0x8ac9('0x62')]);if(_[_0x8ac9('0x39')](this['channels'][_0x9fb12f[_0x8ac9('0x3d')]])){this[_0x8ac9('0x1c')][_0x9fb12f[_0x8ac9('0x3d')]]=new Channel();this[_0x8ac9('0x1c')][_0x9fb12f[_0x8ac9('0x3d')]][_0x8ac9('0x55')]=_0x9fb12f[_0x8ac9('0x63')]?moment()[_0x8ac9('0x64')](moment[_0x8ac9('0x63')](_0x9fb12f[_0x8ac9('0x63')])[_0x8ac9('0x65')](),'seconds')[_0x8ac9('0x59')](_0x8ac9('0x66')):moment()[_0x8ac9('0x59')](_0x8ac9('0x66'));this['channels'][_0x9fb12f['uniqueid']][_0x8ac9('0x56')]=_0x8ac9('0x16');}_[_0x8ac9('0x42')](this[_0x8ac9('0x1c')][_0x9fb12f['uniqueid']],_[_0x8ac9('0x43')](_0x9fb12f,_[_0x8ac9('0x44')](this[_0x8ac9('0x1c')][_0x9fb12f['uniqueid']])));if(_[_0x8ac9('0x67')](applications,_0x9fb12f[_0x8ac9('0x5e')])){this[_0x8ac9('0x1c')][_0x9fb12f['uniqueid']][_0x8ac9('0x68')]=_0x9fb12f[_0x8ac9('0x5e')];this[_0x8ac9('0x1c')][_0x9fb12f[_0x8ac9('0x3d')]][_0x8ac9('0x69')]=_0x9fb12f[_0x8ac9('0x62')];if(_0x9fb12f[_0x8ac9('0x5e')]===_0x8ac9('0x13')&&_['startsWith'](_0x9fb12f[_0x8ac9('0x62')]['toLowerCase'](),'cdr(')){var _0x3dad12=_0x9fb12f[_0x8ac9('0x62')][_0x8ac9('0x4a')]('=');var _0x1bc87b=_0x3dad12[0x0]['toLowerCase']()[_0x8ac9('0x6a')](/cdr\((.*)\)/);if(_0x1bc87b){this[_0x8ac9('0x1c')][_0x9fb12f[_0x8ac9('0x3d')]][_0x1bc87b[0x1]]=_0x3dad12[0x1];}}else if(_0x9fb12f[_0x8ac9('0x5e')]===_0x8ac9('0x6b')){this[_0x8ac9('0x1c')][_0x9fb12f[_0x8ac9('0x3d')]]['queue']=_0x9fb12f[_0x8ac9('0x62')]['split'](',')[0x0];}}}}}catch(_0x5d7976){logger[_0x8ac9('0x50')](_0x8ac9('0x6c'),_0x9fb12f[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x5d7976,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')][_0x8ac9('0x6d')]=function(_0x392068){try{if(this['isNotNull'](_0x392068)){logger[_0x8ac9('0x33')](_0x8ac9('0x6e'),_0x392068['uniqueid'],_0x392068[_0x8ac9('0x5d')],_0x392068[_0x8ac9('0x3e')],_0x392068[_0x8ac9('0x3f')]);logger[_0x8ac9('0x40')](_0x8ac9('0x6f'),_0x392068[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x392068,{'showHidden':![],'depth':null}));if(_0x392068['uniqueid']!==_0x392068['linkedid']){if(this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]]){if(_0x392068[_0x8ac9('0x58')]==='6'){if(!this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x70')]){var _0x3e8a3c=moment();this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x70')]=!![];this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]]['answertime']=_0x3e8a3c[_0x8ac9('0x59')](_0x8ac9('0x66'));if(this[_0x8ac9('0x1c')][_0x392068['linkedid']][_0x8ac9('0x55')]){this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]]['holdtime']=_0x3e8a3c[_0x8ac9('0x71')](this[_0x8ac9('0x1c')][_0x392068['linkedid']][_0x8ac9('0x55')],_0x8ac9('0x65'));}}this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x5d')]=_0x392068[_0x8ac9('0x3d')];if(_0x392068['calleridnum']!==_0x8ac9('0x49')){this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x4c')]=_0x392068[_0x8ac9('0x3f')];}this['channels'][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x72')]=_0x392068[_0x8ac9('0x3e')];this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x73')]=_0x392068[_0x8ac9('0x47')];this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x56')]=dispositions[_['toNumber'](_0x392068[_0x8ac9('0x58')])];if(this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]){this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x74')]=this['agents'][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]['id'];this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]][_0x8ac9('0x75')]=this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4d')];}}}}else{if(this[_0x8ac9('0x1c')][_0x392068['uniqueid']]){if(_0x392068[_0x8ac9('0x58')]==='6'){if(this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]){this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x3d')]]['UserId']=this[_0x8ac9('0x1d')][_0x392068['channel'][_0x8ac9('0x4a')]('-')[0x0]]['id'];this['channels'][_0x392068[_0x8ac9('0x3d')]]['membername']=this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4d')];}}}}if(_0x392068['channelstate']==='6'&&_0x392068[_0x8ac9('0x45')]===_0x8ac9('0x46')){if(this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]){this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4b')]=_0x392068[_0x8ac9('0x48')];var _0x3aaf17;if(this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x3d')]])_0x3aaf17=this[_0x8ac9('0x1c')][_0x392068['uniqueid']][_0x8ac9('0x76')];else if(this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]])_0x3aaf17=this[_0x8ac9('0x1c')][_0x392068[_0x8ac9('0x5d')]]['routealias'];logger[_0x8ac9('0x40')](_0x8ac9('0x77'),_0x392068[_0x8ac9('0x3d')],util[_0x8ac9('0x37')]({'destaccountcode':this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4f')],'destconnectedlinenum':_0x392068[_0x8ac9('0x48')],'routealias':_0x3aaf17},{'showHidden':![],'depth':null}));this[_0x8ac9('0x3a')](util[_0x8ac9('0x59')](_0x8ac9('0x5a'),this[_0x8ac9('0x1d')][_0x392068['channel'][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4d')]),'user:agentconnect',{'destaccountcode':this[_0x8ac9('0x1d')][_0x392068[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4f')],'destconnectedlinenum':_0x392068['exten'],'routealias':_0x3aaf17});}}}}catch(_0x2df564){logger[_0x8ac9('0x50')](_0x8ac9('0x78'),_0x392068[_0x8ac9('0x3d')],util['inspect'](_0x2df564,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8ac9('0x79')]=function(_0x1612fa,_0x3f16f9){try{if(this[_0x8ac9('0x1c')][_0x1612fa]){logger[_0x8ac9('0x33')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x1612fa,_0x3f16f9);this[_0x8ac9('0x1c')][_0x1612fa][_0x8ac9('0x7a')]=!![];if(_['endsWith'](_0x3f16f9,'.wav49')){_0x3f16f9=_0x3f16f9[_0x8ac9('0x7b')](_0x8ac9('0x7c'),_0x8ac9('0x7d'));}this[_0x8ac9('0x1c')][_0x1612fa][_0x8ac9('0x7e')]=_0x3f16f9;var _0x37a86e=_[_0x8ac9('0x7f')](this[_0x8ac9('0x1c')][_0x1612fa][_0x8ac9('0x80')],{'filename':_0x3f16f9});if(_['isNil'](_0x37a86e)){this['channels'][_0x1612fa]['monitors']['push']({'filename':_0x3f16f9,'createdAt':moment()[_0x8ac9('0x59')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x8ac9('0x81')});}}}catch(_0x149d84){logger['error'](_0x8ac9('0x82'),_0x1612fa,util[_0x8ac9('0x37')](_0x149d84,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')][_0x8ac9('0x27')]=function(_0xe69423){try{if(this[_0x8ac9('0x3b')](_0xe69423)){logger[_0x8ac9('0x40')](_0x8ac9('0x83'),_0xe69423[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0xe69423,{'showHidden':![],'depth':null}));if(this[_0x8ac9('0x1c')][_0xe69423[_0x8ac9('0x3d')]]&&_0xe69423[_0x8ac9('0x47')]!='OutgoingSpoolFailed'){if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')])){if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')][_0x8ac9('0x85')])){logger[_0x8ac9('0x33')](_0x8ac9('0x86'),_0xe69423['uniqueid'],_0xe69423[_0x8ac9('0x87')]);this['syncMixMonitorFilename'](_0xe69423['uniqueid'],_0xe69423[_0x8ac9('0x87')]);}else if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')][_0x8ac9('0x88')])){logger[_0x8ac9('0x33')](_0x8ac9('0x89'),_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423[_0x8ac9('0x3d')]]['calleridnum']=_0xe69423['value'];}else if(this[_0x8ac9('0x3b')](_0xe69423['variable']['xmd-callerid'])){logger['info'](_0x8ac9('0x8a'),_0xe69423[_0x8ac9('0x3d')],_0xe69423['value']);this['channels'][_0xe69423[_0x8ac9('0x3d')]]['callerid']=_0xe69423[_0x8ac9('0x87')];}else if(this[_0x8ac9('0x3b')](_0xe69423['variable'][_0x8ac9('0x8b')])){logger[_0x8ac9('0x33')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423[_0x8ac9('0x3d')]]['type']=_0xe69423[_0x8ac9('0x87')];}else if(this[_0x8ac9('0x3b')](_0xe69423['variable']['xmd-queue'])){logger[_0x8ac9('0x33')](_0x8ac9('0x8c'),_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')][_0x8ac9('0x4a')](',')[0x0]);this[_0x8ac9('0x1c')][_0xe69423[_0x8ac9('0x3d')]]['queue']=_0xe69423['value'][_0x8ac9('0x4a')](',')[0x0];}else if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')][_0x8ac9('0x8d')])){logger['info'](_0x8ac9('0x8e'),_0xe69423['uniqueid'],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423[_0x8ac9('0x3d')]][_0x8ac9('0x8f')]=_0xe69423[_0x8ac9('0x87')];}else if(this['isNotNull'](_0xe69423[_0x8ac9('0x84')]['xmd-destination'])){logger[_0x8ac9('0x33')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423['uniqueid']][_0x8ac9('0x90')]=_0xe69423[_0x8ac9('0x87')];}else if(this[_0x8ac9('0x3b')](_0xe69423['variable']['xmd-callerid-preview'])){logger['info'](_0x8ac9('0x91'),_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423[_0x8ac9('0x3d')]]['calleridpreview']=_0xe69423['value'];}else if(this[_0x8ac9('0x3b')](_0xe69423['variable'][_0x8ac9('0x92')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423['uniqueid']][_0x8ac9('0x6b')]=_0xe69423[_0x8ac9('0x87')];}else if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')][_0x8ac9('0x93')])){logger[_0x8ac9('0x33')](_0x8ac9('0x94'),_0xe69423[_0x8ac9('0x3d')],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423['uniqueid']][_0x8ac9('0x95')]=_0xe69423[_0x8ac9('0x87')];}}}else if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')][_0x8ac9('0x85')])){if(_0xe69423['value']){var _0xa5e21=path[_0x8ac9('0x96')](_0xe69423[_0x8ac9('0x87')])[_0x8ac9('0x4d')];logger[_0x8ac9('0x33')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0xa5e21,_0xe69423[_0x8ac9('0x87')]);this['syncMixMonitorFilename'](_0xa5e21,_0xe69423['value']);}}else if(this[_0x8ac9('0x1c')][_0xe69423['linkedid']]){if(this[_0x8ac9('0x3b')](_0xe69423['variable'])){if(this[_0x8ac9('0x3b')](_0xe69423[_0x8ac9('0x84')][_0x8ac9('0x93')])){logger[_0x8ac9('0x33')](_0x8ac9('0x94'),_0xe69423['linkedid'],_0xe69423[_0x8ac9('0x87')]);this[_0x8ac9('0x1c')][_0xe69423['linkedid']][_0x8ac9('0x97')]=_0xe69423[_0x8ac9('0x87')];}}}}}catch(_0x2a5c2d){logger[_0x8ac9('0x50')](_0x8ac9('0x98'),_0xe69423[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x2a5c2d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')]['syncHangup']=function(_0x133fc0){try{if(this[_0x8ac9('0x3b')](_0x133fc0)){logger[_0x8ac9('0x40')](_0x8ac9('0x99'),_0x133fc0[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x133fc0,{'showHidden':![],'depth':null}));if(this['channels'][_0x133fc0[_0x8ac9('0x3d')]]){logger[_0x8ac9('0x33')](_0x8ac9('0x9a'),_0x133fc0['uniqueid'],_0x133fc0[_0x8ac9('0x9b')]);var _0x48688e=moment();this[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x9c')]=_0x48688e[_0x8ac9('0x59')](_0x8ac9('0x66'));this[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x63')]=_0x48688e['diff'](this['channels'][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x55')],_0x8ac9('0x65'));if(this[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x70')]){this[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x9d')]=_0x48688e[_0x8ac9('0x71')](this['channels'][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x9e')],'seconds');this[_0x8ac9('0x1c')][_0x133fc0['uniqueid']][_0x8ac9('0x9f')]=this[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x63')]-this[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x9d')];}if(_0x133fc0[_0x8ac9('0x45')]===_0x8ac9('0x46')){if(this[_0x8ac9('0x1d')][_0x133fc0[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]){this['agents'][_0x133fc0[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]=_[_0x8ac9('0xa0')](this[_0x8ac9('0x1d')][_0x133fc0[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]],['destconnectedlinenum']);logger[_0x8ac9('0x40')](_0x8ac9('0xa1'),_0x133fc0['uniqueid'],util['inspect']({'id':this['agents'][_0x133fc0['channel'][_0x8ac9('0x4a')]('-')[0x0]]['id'],'destaccountcode':this[_0x8ac9('0x1d')][_0x133fc0[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x8ac9('0x3a')](util['format'](_0x8ac9('0x5a'),this['agents'][_0x133fc0[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4d')]),'user:agentcomplete',{'id':this[_0x8ac9('0x1d')][_0x133fc0['channel'][_0x8ac9('0x4a')]('-')[0x0]]['id'],'destaccountcode':this[_0x8ac9('0x1d')][_0x133fc0[_0x8ac9('0x47')][_0x8ac9('0x4a')]('-')[0x0]][_0x8ac9('0x4f')]});}}var _0x1717bb=this;Promise['resolve']()[_0x8ac9('0xa2')](function(){var _0x2e4106=_0x1717bb[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]];if(typeof _0x2e4106[_0x8ac9('0xa3')]===_0x8ac9('0xa4'))return;if(_[_0x8ac9('0xa5')](_0x2e4106[_0x8ac9('0x80')]))return;return RpcSetting[_0x8ac9('0xa6')]()[_0x8ac9('0xa2')](function(_0x4b6e5f){if(!_0x4b6e5f[_0x8ac9('0xa7')])return;return Promise[_0x8ac9('0xa8')]()['then'](function(){return ami[_0x8ac9('0xa9')]({'action':'StopMixMonitor','channel':_0x2e4106['channel']})[_0x8ac9('0xaa')](function(){});})[_0x8ac9('0xa2')](function(){return ami[_0x8ac9('0xa9')]({'action':_0x8ac9('0xab'),'channel':_0x2e4106[_0x8ac9('0x73')]})[_0x8ac9('0xaa')](function(){})[_0x8ac9('0xac')](function(){var _0x9188c0=_0x1717bb['agents'][_0x2e4106[_0x8ac9('0x73')][_0x8ac9('0x4a')]('-')[0x0]];if(!_0x9188c0)return;io['emit'](_0x8ac9('0xad'),{'agentId':_0x9188c0['id'],'uniqueid':_0x2e4106[_0x8ac9('0x3d')]});});});});})[_0x8ac9('0xa2')](function(){if(_0x133fc0[_0x8ac9('0xae')]===_0x8ac9('0xaf')){_0x1717bb[_0x8ac9('0x1e')][_0x133fc0[_0x8ac9('0x3d')]]=_0x1717bb['channels'][_0x133fc0[_0x8ac9('0x3d')]];}else{if(_0x1717bb[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0xb0')]===_0x8ac9('0xb1')&&_0x1717bb['blindTransfers'][_0x133fc0[_0x8ac9('0x3d')]]){_0x1717bb[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x3d')]=[_0x1717bb[_0x8ac9('0x1c')][_0x133fc0['uniqueid']][_0x8ac9('0x5d')],_0x1717bb[_0x8ac9('0x1c')][_0x133fc0['uniqueid']]['linkedid']=_0x1717bb[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]][_0x8ac9('0x3d')]][0x0];delete _0x1717bb[_0x8ac9('0x1e')][_0x133fc0[_0x8ac9('0x3d')]];}}logger[_0x8ac9('0x40')](_0x8ac9('0xb2'),_0x133fc0['uniqueid'],util[_0x8ac9('0x37')](_0x1717bb['channels'][_0x133fc0[_0x8ac9('0x3d')]],{'showHidden':![],'depth':null}));ami[_0x8ac9('0x3a')]('custom:voiceCallReport',_0x1717bb[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]]);delete _0x1717bb[_0x8ac9('0x1c')][_0x133fc0[_0x8ac9('0x3d')]];});}}}catch(_0x1bcc9b){logger[_0x8ac9('0x50')](_0x8ac9('0xb3'),_0x133fc0['uniqueid'],util[_0x8ac9('0x37')](_0x1bcc9b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')][_0x8ac9('0x2d')]=function(_0x2cd323){try{if(this[_0x8ac9('0x3b')](_0x2cd323)){logger[_0x8ac9('0x33')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x2cd323[_0x8ac9('0x3d')],_0x2cd323[_0x8ac9('0xb4')],_0x2cd323[_0x8ac9('0xb5')]);logger['debug'](_0x8ac9('0xb6'),_0x2cd323[_0x8ac9('0x3d')],util['inspect'](_0x2cd323,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cd323['transfereeuniqueid']]){this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xb7')]][_0x8ac9('0xb8')]=_0x2cd323[_0x8ac9('0xb4')];this[_0x8ac9('0x1c')][_0x2cd323['transfereeuniqueid']][_0x8ac9('0xb9')]=_0x2cd323['transfertargetcalleridnum'];if(this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xba')]]){var _0x373762=this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xba')]];this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xba')]]=this['channels'][_0x2cd323[_0x8ac9('0xb7')]];this['channels'][_0x2cd323[_0x8ac9('0xb7')]]=_0x373762;}}else if(this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbb')]]){this[_0x8ac9('0x1c')][_0x2cd323['transfertargetuniqueid']]['transfercalleridnum']=_0x2cd323[_0x8ac9('0xb4')];this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbb')]][_0x8ac9('0xb9')]=_0x2cd323['transfertargetcalleridnum'];if(this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbc')]]){var _0x373762=this['channels'][_0x2cd323[_0x8ac9('0xbc')]];this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbc')]]=this[_0x8ac9('0x1c')][_0x2cd323['transfertargetuniqueid']];this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbb')]]=_0x373762;}}if((this['channels'][_0x2cd323[_0x8ac9('0xbc')]]||this['channels'][_0x2cd323[_0x8ac9('0xbd')]])&&this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xba')]]){var _0xea26dc=_[_0x8ac9('0xbe')]([this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbc')]],this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbd')]],this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xba')]]],function(_0x3790ef){return _0x3790ef&&_0x3790ef[_0x8ac9('0xb0')]===_0x8ac9('0xb1')&&_0x3790ef['routeid'];});if(_0xea26dc){if(this['channels'][_0x2cd323[_0x8ac9('0xbc')]])this[_0x8ac9('0x1c')][_0x2cd323['origtransfereruniqueid']][_0x8ac9('0xa3')]=_0x8ac9('0xbf');if(this['channels'][_0x2cd323[_0x8ac9('0xbd')]])this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xbd')]]['transferType']=_0x8ac9('0xbf');this[_0x8ac9('0x1c')][_0x2cd323[_0x8ac9('0xba')]][_0x8ac9('0xa3')]=_0x8ac9('0xbf');}}}}catch(_0x4d0511){logger['error'](_0x8ac9('0xc0'),_0x2cd323['uniqueid'],util['inspect'](_0x4d0511,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')][_0x8ac9('0x2f')]=function(_0x30a461){try{if(this[_0x8ac9('0x3b')](_0x30a461)){logger[_0x8ac9('0x33')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x30a461[_0x8ac9('0x3d')],_0x30a461['transfereecalleridnum'],_0x30a461[_0x8ac9('0xc1')]);logger[_0x8ac9('0x40')](_0x8ac9('0xc2'),_0x30a461[_0x8ac9('0x3d')],util['inspect'](_0x30a461,{'showHidden':![],'depth':null}));if(this[_0x8ac9('0x1c')][_0x30a461[_0x8ac9('0xb7')]]){this[_0x8ac9('0x1c')][_0x30a461[_0x8ac9('0xb7')]]['transfercalleridnum']=_0x30a461['transfereecalleridnum'];this[_0x8ac9('0x1c')][_0x30a461['transfereeuniqueid']]['transferconnectedlinenum']=_0x30a461[_0x8ac9('0xc1')];this[_0x8ac9('0x1c')][_0x30a461[_0x8ac9('0xb7')]][_0x8ac9('0xa3')]=_0x8ac9('0xc3');this[_0x8ac9('0x29')]({'event':'BlindTransfer','uniqueid':_0x30a461[_0x8ac9('0xb7')],'context':_0x30a461['context'],'channel':_0x30a461[_0x8ac9('0xc4')]});}else{this[_0x8ac9('0x1c')][_0x30a461[_0x8ac9('0xc5')]][_0x8ac9('0xa3')]=_0x8ac9('0xc3');}}}catch(_0x35eae9){logger[_0x8ac9('0x50')](_0x8ac9('0xc6'),_0x30a461[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x35eae9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8ac9('0x38')]['syncMusicOnHoldStart']=function(_0x1e6e62){try{if(this[_0x8ac9('0x3b')](_0x1e6e62)){logger[_0x8ac9('0x40')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x1e6e62[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x1e6e62,{'showHidden':![],'depth':null}));if(this[_0x8ac9('0x1c')][_0x1e6e62[_0x8ac9('0x3d')]]){if(!_[_0x8ac9('0xc7')](this[_0x8ac9('0x1c')][_0x1e6e62[_0x8ac9('0x3d')]][_0x8ac9('0x9e')])){this['channels'][_0x1e6e62[_0x8ac9('0x3d')]][_0x8ac9('0xc8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x8ac9('0x33')](_0x8ac9('0xc9'),_0x1e6e62[_0x8ac9('0x3d')],this[_0x8ac9('0x1c')][_0x1e6e62['uniqueid']]['mohstarttime']);}}}}catch(_0x10baa7){logger['error'](_0x8ac9('0xca'),_0x1e6e62['uniqueid'],util[_0x8ac9('0x37')](_0x10baa7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x13cbe7){try{if(this['isNotNull'](_0x13cbe7)){logger[_0x8ac9('0x40')](_0x8ac9('0xcb'),_0x13cbe7[_0x8ac9('0x3d')],util[_0x8ac9('0x37')](_0x13cbe7,{'showHidden':![],'depth':null}));if(this[_0x8ac9('0x1c')][_0x13cbe7[_0x8ac9('0x3d')]]){if(!_[_0x8ac9('0xc7')](this[_0x8ac9('0x1c')][_0x13cbe7[_0x8ac9('0x3d')]][_0x8ac9('0xc8')])){this['channels'][_0x13cbe7[_0x8ac9('0x3d')]]['mohtime']+=moment()[_0x8ac9('0xcc')](0x0)[_0x8ac9('0x71')](this[_0x8ac9('0x1c')][_0x13cbe7[_0x8ac9('0x3d')]][_0x8ac9('0xc8')],'seconds');logger[_0x8ac9('0x33')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x13cbe7[_0x8ac9('0x3d')],this[_0x8ac9('0x1c')][_0x13cbe7['uniqueid']][_0x8ac9('0xcd')]);delete this[_0x8ac9('0x1c')][_0x13cbe7['uniqueid']]['mohstarttime'];}}}}catch(_0x10bc66){logger[_0x8ac9('0x50')](_0x8ac9('0xce'),_0x13cbe7['uniqueid'],util[_0x8ac9('0x37')](_0x10bc66,{'showHidden':![],'depth':null}));}};module[_0x8ac9('0xcf')]=VoiceCallReport; \ No newline at end of file +var _0x7d65=['[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','undefined','isEmpty','then','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','util','path','ioredis','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','context','from-sip','channel','xcally-motion-preview','split','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','error','[%s][voiceCallReport][newcallerid]','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','variable','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x7d65,0x106));var _0x57d6=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x7d65[_0xb0f7c3];return _0x28ea68;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require(_0x57d6('0x0'));var path=require(_0x57d6('0x1'));var Redis=require(_0x57d6('0x2'));var config=require('../../../config/environment');var logger=require(_0x57d6('0x3'))(_0x57d6('0x4'));var ami=require(_0x57d6('0x5'));var Channel=require(_0x57d6('0x6'));var RpcSetting=require('../rpc/setting');var statusDesc=[_0x57d6('0x7'),_0x57d6('0x8'),_0x57d6('0x9'),_0x57d6('0xa'),_0x57d6('0xb'),'unavailable',_0x57d6('0xc'),_0x57d6('0xd'),_0x57d6('0xe')];var applications=[_0x57d6('0xf'),_0x57d6('0x10'),_0x57d6('0x11'),_0x57d6('0x12'),_0x57d6('0x13'),_0x57d6('0x14')];var dispositions=[_0x57d6('0x15'),_0x57d6('0x16'),'FAILED',_0x57d6('0x15'),_0x57d6('0x15'),_0x57d6('0x15'),_0x57d6('0x17'),_0x57d6('0x18'),_0x57d6('0x16'),_0x57d6('0x16'),_0x57d6('0x16')];var actions={};config[_0x57d6('0x19')]=_[_0x57d6('0x1a')](config[_0x57d6('0x19')],{'host':_0x57d6('0x1b'),'port':0x18eb});var io=require(_0x57d6('0x1c'))(new Redis(config[_0x57d6('0x19')]));function VoiceCallReport(_0x2ee255){this[_0x57d6('0x1d')]=_0x2ee255[_0x57d6('0x1d')];this[_0x57d6('0x1e')]=_0x2ee255['agents'];this[_0x57d6('0x1f')]={};ami['on'](_0x57d6('0x20'),this[_0x57d6('0x21')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x23'),this[_0x57d6('0x21')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x24'),this[_0x57d6('0x25')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x26'),this[_0x57d6('0x27')]['bind'](this));ami['on'](_0x57d6('0x28'),this[_0x57d6('0x29')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x2a'),this[_0x57d6('0x2b')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x2c'),this[_0x57d6('0x2d')]['bind'](this));ami['on'](_0x57d6('0x2e'),this[_0x57d6('0x2f')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x30'),this[_0x57d6('0x31')][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x32'),this['syncMusicOnHoldStart'][_0x57d6('0x22')](this));ami['on'](_0x57d6('0x33'),this[_0x57d6('0x34')][_0x57d6('0x22')](this));try{logger[_0x57d6('0x35')](_0x57d6('0x36'));ami['actionCoreShowChannels']();}catch(_0x388106){logger['error'](_0x57d6('0x37'),util[_0x57d6('0x38')](_0x388106,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x57d6('0x39')]['isNotNull']=function(_0x5b3b8d){return _0x5b3b8d!==null&&!_[_0x57d6('0x3a')](_0x5b3b8d);};VoiceCallReport[_0x57d6('0x39')][_0x57d6('0x3b')]=function(_0x4d1bc2,_0x3e4b46,_0x5a55e4){io['to'](_0x4d1bc2)[_0x57d6('0x3b')](_0x3e4b46,_0x5a55e4);};VoiceCallReport['prototype'][_0x57d6('0x2d')]=function(_0x5bdffa){try{if(this['isNotNull'](_0x5bdffa)){logger[_0x57d6('0x35')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x5bdffa[_0x57d6('0x3c')],_0x5bdffa[_0x57d6('0x3d')],_0x5bdffa[_0x57d6('0x3e')]);logger[_0x57d6('0x3f')](_0x57d6('0x40'),_0x5bdffa['uniqueid'],util[_0x57d6('0x38')](_0x5bdffa,{'showHidden':![],'depth':null}));if(_0x5bdffa[_0x57d6('0x3c')]===_0x5bdffa['linkedid']){if(!_['isUndefined'](this[_0x57d6('0x1d')][_0x5bdffa['uniqueid']])){_[_0x57d6('0x41')](this[_0x57d6('0x1d')][_0x5bdffa[_0x57d6('0x3c')]],_[_0x57d6('0x42')](_0x5bdffa,_['keys'](this[_0x57d6('0x1d')][_0x5bdffa[_0x57d6('0x3c')]])));}}if(_0x5bdffa[_0x57d6('0x43')]===_0x57d6('0x44')){if(this[_0x57d6('0x1e')][_0x5bdffa[_0x57d6('0x45')]['split']('-')[0x0]]){if(_0x5bdffa['exten']==_0x57d6('0x46')){this[_0x57d6('0x1e')][_0x5bdffa[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x48')]=_0x5bdffa[_0x57d6('0x49')];this['emit'](util[_0x57d6('0x4a')](_0x57d6('0x4b'),this['agents'][_0x5bdffa[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x4c')]),_0x57d6('0x4d'),{'destaccountcode':this[_0x57d6('0x1e')][_0x5bdffa['channel'][_0x57d6('0x47')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5bdffa[_0x57d6('0x49')]});}}}}}catch(_0x39af7c){logger[_0x57d6('0x4e')](_0x57d6('0x4f'),_0x5bdffa[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x39af7c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')][_0x57d6('0x25')]=function(_0x491ec0){try{if(this[_0x57d6('0x50')](_0x491ec0)){logger[_0x57d6('0x3f')](_0x57d6('0x51'),_0x491ec0[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x491ec0,{'showHidden':![],'depth':null}));if(_0x491ec0['uniqueid']===_0x491ec0[_0x57d6('0x52')]&&_0x491ec0[_0x57d6('0x45')]!=_0x57d6('0x53')){if(_['isUndefined'](this[_0x57d6('0x1d')][_0x491ec0[_0x57d6('0x3c')]])){logger[_0x57d6('0x35')](_0x57d6('0x54'),_0x491ec0[_0x57d6('0x3c')],_0x491ec0['context'],_0x491ec0[_0x57d6('0x55')]);this[_0x57d6('0x1d')][_0x491ec0['uniqueid']]=new Channel();this['channels'][_0x491ec0[_0x57d6('0x3c')]][_0x57d6('0x56')]=moment()['format'](_0x57d6('0x57'));this[_0x57d6('0x1d')][_0x491ec0[_0x57d6('0x3c')]][_0x57d6('0x58')]=dispositions[_[_0x57d6('0x59')](_0x491ec0[_0x57d6('0x5a')])];_['merge'](this[_0x57d6('0x1d')][_0x491ec0[_0x57d6('0x3c')]],_['pick'](_0x491ec0,_[_0x57d6('0x5b')](this['channels'][_0x491ec0['uniqueid']])));if(_0x491ec0[_0x57d6('0x43')]===_0x57d6('0x44')){if(this['agents'][_0x491ec0[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]){if(_[_0x57d6('0x3a')](this[_0x57d6('0x1e')][_0x491ec0[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x48')])){this[_0x57d6('0x1e')][_0x491ec0[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x48')]=_0x491ec0['exten'];logger[_0x57d6('0x3f')](_0x57d6('0x5c'),_0x491ec0[_0x57d6('0x3c')],util['inspect']({'destaccountcode':this[_0x57d6('0x1e')][_0x491ec0['channel'][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x5d')],'destconnectedlinenum':_0x491ec0['exten']},{'showHidden':![],'depth':null}));this[_0x57d6('0x3b')](util[_0x57d6('0x4a')](_0x57d6('0x4b'),this['agents'][_0x491ec0['channel'][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x4c')]),_0x57d6('0x4d'),{'destaccountcode':this[_0x57d6('0x1e')][_0x491ec0[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x5d')],'destconnectedlinenum':_0x491ec0[_0x57d6('0x55')]});}}}}}}}catch(_0x1dbd57){logger[_0x57d6('0x4e')](_0x57d6('0x5e'),_0x491ec0[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x1dbd57,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')]['syncNewExten']=function(_0x1f2505){try{if(this['isNotNull'](_0x1f2505)){logger[_0x57d6('0x3f')](_0x57d6('0x5f'),_0x1f2505['uniqueid'],util[_0x57d6('0x38')](_0x1f2505,{'showHidden':![],'depth':null}));if(_0x1f2505['uniqueid']===_0x1f2505[_0x57d6('0x52')]&&_0x1f2505['exten']!='h'&&_0x1f2505['channel']!=_0x57d6('0x53')){_0x1f2505[_0x57d6('0x60')]=_0x1f2505['application']['toLowerCase']();_0x1f2505[_0x57d6('0x61')]=_0x1f2505[_0x57d6('0x62')]&&_0x1f2505['appdata'][_0x57d6('0x63')](_0x57d6('0x64'))?_0x1f2505[_0x57d6('0x62')]:(_0x1f2505[_0x57d6('0x62')]||_0x1f2505[_0x57d6('0x61')])[_0x57d6('0x65')]();logger[_0x57d6('0x35')](_0x57d6('0x66'),_0x1f2505['uniqueid'],_0x1f2505['application'],_0x1f2505[_0x57d6('0x61')]);if(_['isUndefined'](this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]])){this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]]=new Channel();this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]][_0x57d6('0x56')]=_0x1f2505[_0x57d6('0x67')]?moment()[_0x57d6('0x68')](moment['duration'](_0x1f2505['duration'])[_0x57d6('0x69')](),_0x57d6('0x69'))['format'](_0x57d6('0x57')):moment()[_0x57d6('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1f2505[_0x57d6('0x3c')]][_0x57d6('0x58')]=_0x57d6('0x15');}_[_0x57d6('0x41')](this[_0x57d6('0x1d')][_0x1f2505['uniqueid']],_['pick'](_0x1f2505,_['keys'](this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]])));if(_[_0x57d6('0x6a')](applications,_0x1f2505['application'])){this['channels'][_0x1f2505[_0x57d6('0x3c')]][_0x57d6('0x6b')]=_0x1f2505['application'];this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]][_0x57d6('0x6c')]=_0x1f2505[_0x57d6('0x61')];if(_0x1f2505[_0x57d6('0x60')]===_0x57d6('0xf')&&_[_0x57d6('0x63')](_0x1f2505['applicationdata']['toLowerCase'](),'cdr(')){var _0x3a3f2d=_0x1f2505[_0x57d6('0x61')]['split']('=');var _0xd10b81=_0x3a3f2d[0x0][_0x57d6('0x65')]()[_0x57d6('0x6d')](/cdr\((.*)\)/);if(_0xd10b81){this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]][_0xd10b81[0x1]]=_0x3a3f2d[0x1];}}else if(_0x1f2505['application']==='queue'){this[_0x57d6('0x1d')][_0x1f2505[_0x57d6('0x3c')]][_0x57d6('0x10')]=_0x1f2505['applicationdata'][_0x57d6('0x47')](',')[0x0];}}}}}catch(_0x411a5b){logger[_0x57d6('0x4e')]('[%s][voiceCallReport][newexten]',_0x1f2505[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x411a5b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')][_0x57d6('0x27')]=function(_0x65f2e7){try{if(this[_0x57d6('0x50')](_0x65f2e7)){logger[_0x57d6('0x35')](_0x57d6('0x6e'),_0x65f2e7[_0x57d6('0x3c')],_0x65f2e7[_0x57d6('0x52')],_0x65f2e7[_0x57d6('0x3d')],_0x65f2e7['calleridnum']);logger[_0x57d6('0x3f')](_0x57d6('0x6f'),_0x65f2e7[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x65f2e7,{'showHidden':![],'depth':null}));if(_0x65f2e7['uniqueid']!==_0x65f2e7[_0x57d6('0x52')]){if(this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]]){if(_0x65f2e7['channelstate']==='6'){if(!this['channels'][_0x65f2e7[_0x57d6('0x52')]]['answered']){var _0x267d30=moment();this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x70')]=!![];this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x71')]=_0x267d30[_0x57d6('0x4a')](_0x57d6('0x57'));if(this['channels'][_0x65f2e7['linkedid']]['starttime']){this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x72')]=_0x267d30[_0x57d6('0x73')](this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x56')],'seconds');}}this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]]['linkedid']=_0x65f2e7[_0x57d6('0x3c')];if(_0x65f2e7['calleridnum']!==_0x57d6('0x46')){this[_0x57d6('0x1d')][_0x65f2e7['linkedid']][_0x57d6('0x49')]=_0x65f2e7[_0x57d6('0x3e')];}this['channels'][_0x65f2e7[_0x57d6('0x52')]]['connectedlinename']=_0x65f2e7[_0x57d6('0x3d')];this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x74')]=_0x65f2e7[_0x57d6('0x45')];this['channels'][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x58')]=dispositions[_[_0x57d6('0x59')](_0x65f2e7[_0x57d6('0x5a')])];if(this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]){this['channels'][_0x65f2e7['linkedid']][_0x57d6('0x75')]=this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]['id'];this['channels'][_0x65f2e7[_0x57d6('0x52')]][_0x57d6('0x76')]=this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]['name'];}}}}else{if(this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x3c')]]){if(_0x65f2e7[_0x57d6('0x5a')]==='6'){if(this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]){this['channels'][_0x65f2e7[_0x57d6('0x3c')]][_0x57d6('0x75')]=this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]['id'];this['channels'][_0x65f2e7[_0x57d6('0x3c')]][_0x57d6('0x76')]=this[_0x57d6('0x1e')][_0x65f2e7['channel'][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x4c')];}}}}if(_0x65f2e7[_0x57d6('0x5a')]==='6'&&_0x65f2e7[_0x57d6('0x43')]===_0x57d6('0x44')){if(this['agents'][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]){this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x48')]=_0x65f2e7[_0x57d6('0x55')];var _0x38a103;if(this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x3c')]])_0x38a103=this[_0x57d6('0x1d')][_0x65f2e7[_0x57d6('0x3c')]][_0x57d6('0x77')];else if(this[_0x57d6('0x1d')][_0x65f2e7['linkedid']])_0x38a103=this[_0x57d6('0x1d')][_0x65f2e7['linkedid']][_0x57d6('0x77')];logger[_0x57d6('0x3f')](_0x57d6('0x78'),_0x65f2e7[_0x57d6('0x3c')],util[_0x57d6('0x38')]({'destaccountcode':this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')]['split']('-')[0x0]][_0x57d6('0x5d')],'destconnectedlinenum':_0x65f2e7[_0x57d6('0x55')],'routealias':_0x38a103},{'showHidden':![],'depth':null}));this[_0x57d6('0x3b')](util[_0x57d6('0x4a')](_0x57d6('0x4b'),this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x4c')]),'user:agentconnect',{'destaccountcode':this[_0x57d6('0x1e')][_0x65f2e7[_0x57d6('0x45')]['split']('-')[0x0]][_0x57d6('0x5d')],'destconnectedlinenum':_0x65f2e7['exten'],'routealias':_0x38a103});}}}}catch(_0x5924e9){logger[_0x57d6('0x4e')](_0x57d6('0x79'),_0x65f2e7[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x5924e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')]['syncMixMonitorFilename']=function(_0x39d4d6,_0x323750){try{if(this[_0x57d6('0x1d')][_0x39d4d6]){logger[_0x57d6('0x35')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x39d4d6,_0x323750);this['channels'][_0x39d4d6][_0x57d6('0x7a')]=!![];if(_['endsWith'](_0x323750,_0x57d6('0x7b'))){_0x323750=_0x323750[_0x57d6('0x7c')](_0x57d6('0x7b'),_0x57d6('0x7d'));}this[_0x57d6('0x1d')][_0x39d4d6][_0x57d6('0x7e')]=_0x323750;var _0x3526d6=_[_0x57d6('0x7f')](this[_0x57d6('0x1d')][_0x39d4d6][_0x57d6('0x80')],{'filename':_0x323750});if(_['isNil'](_0x3526d6)){this[_0x57d6('0x1d')][_0x39d4d6][_0x57d6('0x80')]['push']({'filename':_0x323750,'createdAt':moment()[_0x57d6('0x4a')](_0x57d6('0x57')),'mixmonitorid':'','status':'rec'});}}}catch(_0x5d04fe){logger['error'](_0x57d6('0x81'),_0x39d4d6,util[_0x57d6('0x38')](_0x5d04fe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')][_0x57d6('0x29')]=function(_0x3786e7){try{if(this[_0x57d6('0x50')](_0x3786e7)){logger[_0x57d6('0x3f')](_0x57d6('0x82'),_0x3786e7[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x3786e7,{'showHidden':![],'depth':null}));if(this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]]&&_0x3786e7[_0x57d6('0x45')]!='OutgoingSpoolFailed'){if(this[_0x57d6('0x50')](_0x3786e7['variable'])){if(this[_0x57d6('0x50')](_0x3786e7['variable'][_0x57d6('0x83')])){logger[_0x57d6('0x35')](_0x57d6('0x84'),_0x3786e7['uniqueid'],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x86')](_0x3786e7[_0x57d6('0x3c')],_0x3786e7[_0x57d6('0x85')]);}else if(this[_0x57d6('0x50')](_0x3786e7[_0x57d6('0x87')]['xmd-phone'])){logger[_0x57d6('0x35')](_0x57d6('0x88'),_0x3786e7['uniqueid'],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]][_0x57d6('0x3e')]=_0x3786e7['value'];}else if(this[_0x57d6('0x50')](_0x3786e7[_0x57d6('0x87')][_0x57d6('0x89')])){logger['info'](_0x57d6('0x8a'),_0x3786e7[_0x57d6('0x3c')],_0x3786e7[_0x57d6('0x85')]);this['channels'][_0x3786e7['uniqueid']][_0x57d6('0x8b')]=_0x3786e7[_0x57d6('0x85')];}else if(this[_0x57d6('0x50')](_0x3786e7[_0x57d6('0x87')]['xmd-cdrtype'])){logger['info'](_0x57d6('0x8c'),_0x3786e7[_0x57d6('0x3c')],_0x3786e7[_0x57d6('0x85')]);this['channels'][_0x3786e7[_0x57d6('0x3c')]]['type']=_0x3786e7[_0x57d6('0x85')];}else if(this[_0x57d6('0x50')](_0x3786e7[_0x57d6('0x87')][_0x57d6('0x8d')])){logger[_0x57d6('0x35')](_0x57d6('0x8e'),_0x3786e7['uniqueid'],_0x3786e7[_0x57d6('0x85')][_0x57d6('0x47')](',')[0x0]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]][_0x57d6('0x10')]=_0x3786e7[_0x57d6('0x85')][_0x57d6('0x47')](',')[0x0];}else if(this['isNotNull'](_0x3786e7[_0x57d6('0x87')][_0x57d6('0x8f')])){logger[_0x57d6('0x35')](_0x57d6('0x90'),_0x3786e7[_0x57d6('0x3c')],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]][_0x57d6('0x91')]=_0x3786e7[_0x57d6('0x85')];}else if(this[_0x57d6('0x50')](_0x3786e7['variable'][_0x57d6('0x92')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x3786e7['uniqueid'],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]][_0x57d6('0x93')]=_0x3786e7['value'];}else if(this['isNotNull'](_0x3786e7[_0x57d6('0x87')]['xmd-callerid-preview'])){logger[_0x57d6('0x35')](_0x57d6('0x94'),_0x3786e7[_0x57d6('0x3c')],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]][_0x57d6('0x95')]=_0x3786e7['value'];}else if(this['isNotNull'](_0x3786e7[_0x57d6('0x87')]['xmcs-queue'])){logger[_0x57d6('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x3786e7['uniqueid'],_0x3786e7[_0x57d6('0x85')]);this['channels'][_0x3786e7[_0x57d6('0x3c')]][_0x57d6('0x10')]=_0x3786e7[_0x57d6('0x85')];}else if(this['isNotNull'](_0x3786e7[_0x57d6('0x87')]['sipcallid'])){logger[_0x57d6('0x35')](_0x57d6('0x96'),_0x3786e7['uniqueid'],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x3c')]]['sipcalluniqueid']=_0x3786e7['value'];}}}else if(this['isNotNull'](_0x3786e7[_0x57d6('0x87')][_0x57d6('0x83')])){if(_0x3786e7['value']){var _0x46a79a=path[_0x57d6('0x97')](_0x3786e7['value'])[_0x57d6('0x4c')];logger['info'](_0x57d6('0x84'),_0x46a79a,_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x86')](_0x46a79a,_0x3786e7[_0x57d6('0x85')]);}}else if(this[_0x57d6('0x1d')][_0x3786e7['linkedid']]){if(this[_0x57d6('0x50')](_0x3786e7[_0x57d6('0x87')])){if(this['isNotNull'](_0x3786e7['variable'][_0x57d6('0x98')])){logger['info'](_0x57d6('0x96'),_0x3786e7[_0x57d6('0x52')],_0x3786e7[_0x57d6('0x85')]);this[_0x57d6('0x1d')][_0x3786e7[_0x57d6('0x52')]][_0x57d6('0x99')]=_0x3786e7['value'];}}}}}catch(_0x578e15){logger[_0x57d6('0x4e')](_0x57d6('0x9a'),_0x3786e7[_0x57d6('0x3c')],util['inspect'](_0x578e15,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x57d6('0x2b')]=function(_0x13481b){try{if(this[_0x57d6('0x50')](_0x13481b)){logger[_0x57d6('0x3f')](_0x57d6('0x9b'),_0x13481b[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x13481b,{'showHidden':![],'depth':null}));if(this[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]]){logger[_0x57d6('0x35')](_0x57d6('0x9c'),_0x13481b[_0x57d6('0x3c')],_0x13481b[_0x57d6('0x9d')]);var _0x26e266=moment();this[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0x9e')]=_0x26e266['format'](_0x57d6('0x57'));this[_0x57d6('0x1d')][_0x13481b['uniqueid']]['duration']=_0x26e266['diff'](this[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0x56')],_0x57d6('0x69'));if(this[_0x57d6('0x1d')][_0x13481b['uniqueid']][_0x57d6('0x70')]){this[_0x57d6('0x1d')][_0x13481b['uniqueid']][_0x57d6('0x9f')]=_0x26e266['diff'](this[_0x57d6('0x1d')][_0x13481b['uniqueid']][_0x57d6('0x71')],'seconds');this['channels'][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0x72')]=this[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0x67')]-this[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0x9f')];}if(_0x13481b[_0x57d6('0x43')]==='from-sip'){if(this['agents'][_0x13481b[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]){this[_0x57d6('0x1e')][_0x13481b[_0x57d6('0x45')]['split']('-')[0x0]]=_[_0x57d6('0xa0')](this[_0x57d6('0x1e')][_0x13481b[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]],[_0x57d6('0x48')]);logger[_0x57d6('0x3f')](_0x57d6('0xa1'),_0x13481b[_0x57d6('0x3c')],util[_0x57d6('0x38')]({'id':this['agents'][_0x13481b['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x57d6('0x1e')][_0x13481b[_0x57d6('0x45')]['split']('-')[0x0]][_0x57d6('0x5d')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x57d6('0x4a')](_0x57d6('0x4b'),this[_0x57d6('0x1e')][_0x13481b[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x4c')]),_0x57d6('0xa2'),{'id':this[_0x57d6('0x1e')][_0x13481b[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x13481b[_0x57d6('0x45')][_0x57d6('0x47')]('-')[0x0]][_0x57d6('0x5d')]});}}var _0xb5bd46=this;Promise[_0x57d6('0xa3')]()['then'](function(){var _0x4ba552=_0xb5bd46[_0x57d6('0x1d')][_0x13481b['uniqueid']];if(typeof _0x4ba552['transferType']===_0x57d6('0xa4'))return;if(_[_0x57d6('0xa5')](_0x4ba552[_0x57d6('0x80')]))return;return RpcSetting['getSettings']()['then'](function(_0x191426){if(!_0x191426['stopRecordingOnTransfer'])return;return Promise[_0x57d6('0xa3')]()[_0x57d6('0xa6')](function(){return ami[_0x57d6('0xa7')]({'action':_0x57d6('0xa8'),'channel':_0x4ba552['channel']})[_0x57d6('0xa9')](function(){});})[_0x57d6('0xa6')](function(){return ami[_0x57d6('0xa7')]({'action':_0x57d6('0xa8'),'channel':_0x4ba552[_0x57d6('0x74')]})[_0x57d6('0xa9')](function(){})[_0x57d6('0xaa')](function(){var _0x1c1662=_0xb5bd46[_0x57d6('0x1e')][_0x4ba552[_0x57d6('0x74')][_0x57d6('0x47')]('-')[0x0]];if(!_0x1c1662)return;io[_0x57d6('0x3b')](_0x57d6('0xab'),{'agentId':_0x1c1662['id'],'uniqueid':_0x4ba552[_0x57d6('0x3c')]});});});});})['then'](function(){if(_0x13481b[_0x57d6('0xac')]===_0x57d6('0xad')){_0xb5bd46[_0x57d6('0x1f')][_0x13481b['uniqueid']]=_0xb5bd46[_0x57d6('0x1d')][_0x13481b['uniqueid']];}else{if(_0xb5bd46[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0xae')]===_0x57d6('0xaf')&&_0xb5bd46[_0x57d6('0x1f')][_0x13481b[_0x57d6('0x3c')]]){_0xb5bd46[_0x57d6('0x1d')][_0x13481b['uniqueid']][_0x57d6('0x3c')]=[_0xb5bd46[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]][_0x57d6('0x52')],_0xb5bd46[_0x57d6('0x1d')][_0x13481b['uniqueid']]['linkedid']=_0xb5bd46[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]]['uniqueid']][0x0];delete _0xb5bd46[_0x57d6('0x1f')][_0x13481b[_0x57d6('0x3c')]];}}logger[_0x57d6('0x3f')](_0x57d6('0xb0'),_0x13481b[_0x57d6('0x3c')],util['inspect'](_0xb5bd46[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]],{'showHidden':![],'depth':null}));ami[_0x57d6('0x3b')](_0x57d6('0xb1'),_0xb5bd46[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]]);delete _0xb5bd46[_0x57d6('0x1d')][_0x13481b[_0x57d6('0x3c')]];});}}}catch(_0x233800){logger[_0x57d6('0x4e')](_0x57d6('0xb2'),_0x13481b['uniqueid'],util[_0x57d6('0x38')](_0x233800,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')]['syncAttendedTransfer']=function(_0x15e1cd){try{if(this['isNotNull'](_0x15e1cd)){logger[_0x57d6('0x35')](_0x57d6('0xb3'),_0x15e1cd[_0x57d6('0x3c')],_0x15e1cd[_0x57d6('0xb4')],_0x15e1cd[_0x57d6('0xb5')]);logger[_0x57d6('0x3f')](_0x57d6('0xb6'),_0x15e1cd[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x15e1cd,{'showHidden':![],'depth':null}));if(this[_0x57d6('0x1d')][_0x15e1cd['transfereeuniqueid']]){this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xb7')]][_0x57d6('0xb8')]=_0x15e1cd[_0x57d6('0xb4')];this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xb7')]][_0x57d6('0xb9')]=_0x15e1cd[_0x57d6('0xb5')];if(this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xba')]]){var _0x30b6b8=this['channels'][_0x15e1cd['secondtransfereruniqueid']];this['channels'][_0x15e1cd[_0x57d6('0xba')]]=this['channels'][_0x15e1cd['transfereeuniqueid']];this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xb7')]]=_0x30b6b8;}}else if(this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbb')]]){this['channels'][_0x15e1cd['transfertargetuniqueid']][_0x57d6('0xb8')]=_0x15e1cd[_0x57d6('0xb4')];this['channels'][_0x15e1cd[_0x57d6('0xbb')]][_0x57d6('0xb9')]=_0x15e1cd[_0x57d6('0xb5')];if(this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbc')]]){var _0x30b6b8=this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbc')]];this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbc')]]=this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbb')]];this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbb')]]=_0x30b6b8;}}if((this['channels'][_0x15e1cd[_0x57d6('0xbc')]]||this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbd')]])&&this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xba')]]){var _0x34dc50=_[_0x57d6('0xbe')]([this[_0x57d6('0x1d')][_0x15e1cd['origtransfereruniqueid']],this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbd')]],this[_0x57d6('0x1d')][_0x15e1cd['secondtransfereruniqueid']]],function(_0x3e244b){return _0x3e244b&&_0x3e244b[_0x57d6('0xae')]==='outbound'&&_0x3e244b['routeid'];});if(_0x34dc50){if(this['channels'][_0x15e1cd[_0x57d6('0xbc')]])this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xbc')]][_0x57d6('0xbf')]=_0x57d6('0xc0');if(this['channels'][_0x15e1cd[_0x57d6('0xbd')]])this['channels'][_0x15e1cd['origtransfererlinkedid']][_0x57d6('0xbf')]='ATTENDED';this[_0x57d6('0x1d')][_0x15e1cd[_0x57d6('0xba')]][_0x57d6('0xbf')]=_0x57d6('0xc0');}}}}catch(_0x192243){logger[_0x57d6('0x4e')](_0x57d6('0xc1'),_0x15e1cd[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x192243,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')]['syncBlindTransfer']=function(_0x34904f){try{if(this[_0x57d6('0x50')](_0x34904f)){logger['info'](_0x57d6('0xc2'),_0x34904f[_0x57d6('0x3c')],_0x34904f[_0x57d6('0xc3')],_0x34904f[_0x57d6('0xc4')]);logger[_0x57d6('0x3f')](_0x57d6('0xc5'),_0x34904f[_0x57d6('0x3c')],util['inspect'](_0x34904f,{'showHidden':![],'depth':null}));if(this[_0x57d6('0x1d')][_0x34904f['transfereeuniqueid']]){this[_0x57d6('0x1d')][_0x34904f[_0x57d6('0xb7')]][_0x57d6('0xb8')]=_0x34904f[_0x57d6('0xc3')];this['channels'][_0x34904f[_0x57d6('0xb7')]][_0x57d6('0xb9')]=_0x34904f[_0x57d6('0xc4')];this[_0x57d6('0x1d')][_0x34904f[_0x57d6('0xb7')]][_0x57d6('0xbf')]=_0x57d6('0xc6');this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x34904f[_0x57d6('0xb7')],'context':_0x34904f[_0x57d6('0x43')],'channel':_0x34904f[_0x57d6('0xc7')]});}else{this[_0x57d6('0x1d')][_0x34904f[_0x57d6('0xc8')]]['transferType']=_0x57d6('0xc6');}}}catch(_0x12277b){logger[_0x57d6('0x4e')](_0x57d6('0xc9'),_0x34904f['uniqueid'],util[_0x57d6('0x38')](_0x12277b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')][_0x57d6('0xca')]=function(_0x1568f0){try{if(this[_0x57d6('0x50')](_0x1568f0)){logger[_0x57d6('0x3f')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x1568f0['uniqueid'],util[_0x57d6('0x38')](_0x1568f0,{'showHidden':![],'depth':null}));if(this[_0x57d6('0x1d')][_0x1568f0[_0x57d6('0x3c')]]){if(!_[_0x57d6('0xcb')](this[_0x57d6('0x1d')][_0x1568f0[_0x57d6('0x3c')]][_0x57d6('0x71')])){this['channels'][_0x1568f0['uniqueid']][_0x57d6('0xcc')]=moment()[_0x57d6('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');logger['info']('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x1568f0[_0x57d6('0x3c')],this[_0x57d6('0x1d')][_0x1568f0[_0x57d6('0x3c')]][_0x57d6('0xcc')]);}}}}catch(_0x472b7f){logger['error'](_0x57d6('0xcd'),_0x1568f0[_0x57d6('0x3c')],util[_0x57d6('0x38')](_0x472b7f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x57d6('0x39')]['syncMusicOnHoldStop']=function(_0x34567a){try{if(this[_0x57d6('0x50')](_0x34567a)){logger[_0x57d6('0x3f')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x34567a['uniqueid'],util[_0x57d6('0x38')](_0x34567a,{'showHidden':![],'depth':null}));if(this[_0x57d6('0x1d')][_0x34567a[_0x57d6('0x3c')]]){if(!_[_0x57d6('0xcb')](this[_0x57d6('0x1d')][_0x34567a['uniqueid']]['mohstarttime'])){this[_0x57d6('0x1d')][_0x34567a[_0x57d6('0x3c')]][_0x57d6('0xce')]+=moment()[_0x57d6('0xcf')](0x0)[_0x57d6('0x73')](this['channels'][_0x34567a[_0x57d6('0x3c')]]['mohstarttime'],_0x57d6('0x69'));logger[_0x57d6('0x35')](_0x57d6('0xd0'),_0x34567a[_0x57d6('0x3c')],this['channels'][_0x34567a[_0x57d6('0x3c')]][_0x57d6('0xce')]);delete this[_0x57d6('0x1d')][_0x34567a[_0x57d6('0x3c')]][_0x57d6('0xcc')];}}}}catch(_0x362282){logger['error']('[%s][voiceCallReport][musiconholdstop]',_0x34567a['uniqueid'],util[_0x57d6('0x38')](_0x362282,{'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 37d2213..5da461a 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 _0xc8ec=['memberdynamic','memberlastcall','syncHangup','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','starttime','seconds','total','answertime','answered','diff','billableseconds','holdtime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','localhost','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','syncDialEnd','varset','syncNewExten','hangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','privilege','info','membername','interface','inspect','merge','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','syncVarSet','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','sipuri','membercalls'];(function(_0x44eaae,_0x4bc08e){var _0x4fb2d=function(_0x43c495){while(--_0x43c495){_0x44eaae['push'](_0x44eaae['shift']());}};_0x4fb2d(++_0x4bc08e);}(_0xc8ec,0x153));var _0xcc8e=function(_0x33157f,_0x168d72){_0x33157f=_0x33157f-0x0;var _0x1dd01d=_0xc8ec[_0x33157f];return _0x1dd01d;};'use strict';var _=require(_0xcc8e('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0xcc8e('0x1'));var config=require(_0xcc8e('0x2'));var logger=require(_0xcc8e('0x3'))(_0xcc8e('0x4'));var ami=require(_0xcc8e('0x5'));config['redis']=_[_0xcc8e('0x6')](config['redis'],{'host':_0xcc8e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x1b3f15){this['channels']=_0x1b3f15[_0xcc8e('0x8')];this[_0xcc8e('0x9')]=_0x1b3f15[_0xcc8e('0x9')];this[_0xcc8e('0xa')]={};this[_0xcc8e('0xb')]={};ami['on'](_0xcc8e('0xc'),this[_0xcc8e('0xd')][_0xcc8e('0xe')](this));ami['on']('dialend',this[_0xcc8e('0xf')][_0xcc8e('0xe')](this));ami['on'](_0xcc8e('0x10'),this['syncVarSet'][_0xcc8e('0xe')](this));ami['on']('newexten',this[_0xcc8e('0x11')]['bind'](this));ami['on'](_0xcc8e('0x12'),this['syncHangup'][_0xcc8e('0xe')](this));}VoiceDialReport[_0xcc8e('0x13')][_0xcc8e('0x14')]=function(_0x60261a){return _0x60261a!==null&&!_[_0xcc8e('0x15')](_0x60261a);};VoiceDialReport['prototype'][_0xcc8e('0x16')]=function(_0x1d66e6,_0x547b70,_0x1f4c3f){io['to'](_0x1d66e6)['emit'](_0x547b70,_0x1f4c3f);};VoiceDialReport['prototype'][_0xcc8e('0xd')]=function(_0x3b4d83){try{if(this['isNotNull'](_0x3b4d83)){logger[_0xcc8e('0x17')](_0xcc8e('0x18'),_0x3b4d83[_0xcc8e('0x19')],util['inspect'](_0x3b4d83,{'showHidden':![],'depth':null}));if(this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]]){_['merge'](this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]],{'starttime':moment()[_0xcc8e('0x1b')](_0xcc8e('0x1c')),'lastevent':_0xcc8e('0x1d'),'interface':_0x3b4d83[_0xcc8e('0x1e')][_0xcc8e('0x1f')](0x0,_0x3b4d83[_0xcc8e('0x1e')][_0xcc8e('0x20')]('-')),'membername':_0x3b4d83['channel'][_0xcc8e('0x1f')](_0x3b4d83[_0xcc8e('0x1e')][_0xcc8e('0x20')]('/')+0x1,_0x3b4d83[_0xcc8e('0x1e')][_0xcc8e('0x20')]('-'))},_[_0xcc8e('0x21')](_0x3b4d83,['event',_0xcc8e('0x22')]));logger[_0xcc8e('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x3b4d83[_0xcc8e('0x19')],this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]][_0xcc8e('0x24')],this['channels'][_0x3b4d83[_0xcc8e('0x19')]][_0xcc8e('0x25')]);logger[_0xcc8e('0x17')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3b4d83[_0xcc8e('0x19')],util[_0xcc8e('0x26')](this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));if(this[_0xcc8e('0xa')][_0x3b4d83[_0xcc8e('0x19')]])_[_0xcc8e('0x27')](this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]],this[_0xcc8e('0xa')][_0x3b4d83[_0xcc8e('0x19')]]);this[_0xcc8e('0x16')](_0xcc8e('0x28'),_0xcc8e('0x29'),this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]]);logger[_0xcc8e('0x17')](_0xcc8e('0x2a'),_0x3b4d83[_0xcc8e('0x19')],util[_0xcc8e('0x26')](this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));ami[_0xcc8e('0x16')](_0xcc8e('0x2b'),this[_0xcc8e('0x1a')][_0x3b4d83[_0xcc8e('0x19')]]);}}}catch(_0xef37b8){logger[_0xcc8e('0x2c')]('[%s][voiceDialReport][dialbegin]',_0x3b4d83[_0xcc8e('0x19')],util[_0xcc8e('0x26')](_0xef37b8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xcc8e('0x13')]['syncDialEnd']=function(_0x342f93){try{if(this['isNotNull'](_0x342f93)){logger[_0xcc8e('0x17')](_0xcc8e('0x2d'),_0x342f93[_0xcc8e('0x19')],util[_0xcc8e('0x26')](_0x342f93,{'showHidden':![],'depth':null}));if(this[_0xcc8e('0x1a')][_0x342f93[_0xcc8e('0x19')]]){this['channels'][_0x342f93[_0xcc8e('0x19')]][_0xcc8e('0x2e')]=_0x342f93[_0xcc8e('0x2e')];if(_0x342f93[_0xcc8e('0x2e')]===_0xcc8e('0x2f')){this[_0xcc8e('0x1a')][_0x342f93[_0xcc8e('0x19')]][_0xcc8e('0x30')]=_0x342f93[_0xcc8e('0x30')];this[_0xcc8e('0x1a')][_0x342f93[_0xcc8e('0x19')]][_0xcc8e('0x31')]=_0x342f93[_0xcc8e('0x31')];this['channels'][_0x342f93[_0xcc8e('0x19')]]['answertime']=moment()[_0xcc8e('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x342f93[_0xcc8e('0x19')]][_0xcc8e('0x32')]='connect';logger['info'](_0xcc8e('0x33'),_0x342f93[_0xcc8e('0x19')],_0x342f93[_0xcc8e('0x1e')][_0xcc8e('0x1f')](_0x342f93[_0xcc8e('0x1e')][_0xcc8e('0x20')]('/')+0x1,_0x342f93['channel'][_0xcc8e('0x20')]('-')));logger[_0xcc8e('0x17')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x342f93['uniqueid'],util['inspect'](this[_0xcc8e('0x1a')][_0x342f93[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0xcc8e('0x34'),this[_0xcc8e('0x1a')][_0x342f93['uniqueid']]);}logger[_0xcc8e('0x17')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x342f93[_0xcc8e('0x19')],util[_0xcc8e('0x26')](this[_0xcc8e('0x1a')][_0x342f93[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0xcc8e('0x28'),_0xcc8e('0x29'),this[_0xcc8e('0x1a')][_0x342f93[_0xcc8e('0x19')]]);}}}catch(_0x3c7376){logger[_0xcc8e('0x2c')]('[%s][voiceDialReport][dialend]',_0x342f93['uniqueid'],util[_0xcc8e('0x26')](_0x3c7376,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xcc8e('0x13')][_0xcc8e('0x35')]=function(_0x33d12e){try{if(this[_0xcc8e('0x14')](_0x33d12e)){logger[_0xcc8e('0x17')]('[%s][voiceDialReport][varset]\x20event:',_0x33d12e[_0xcc8e('0x19')],util[_0xcc8e('0x26')](_0x33d12e,{'showHidden':![],'depth':null}));this['addVariable'](_0x33d12e[_0xcc8e('0x19')],_[_0xcc8e('0x36')](_0x33d12e[_0xcc8e('0x37')])[0x0],_0x33d12e[_0xcc8e('0x38')]);if(this[_0xcc8e('0x14')](_0x33d12e[_0xcc8e('0x37')])&&this['isNotNull'](_0x33d12e[_0xcc8e('0x37')][_0xcc8e('0x39')])){if(_['isUndefined'](this['channels'][_0x33d12e[_0xcc8e('0x19')]])){this[_0xcc8e('0x1a')][_0x33d12e['uniqueid']]={'routeId':_0x33d12e['value'],'variables':this[_0xcc8e('0xb')][_0x33d12e[_0xcc8e('0x19')]],'motionChannel':'voice'};logger[_0xcc8e('0x23')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x33d12e[_0xcc8e('0x19')],_0x33d12e['variable'][_0xcc8e('0x39')],_[_0xcc8e('0x36')](_0x33d12e[_0xcc8e('0x37')])[0x0],_0x33d12e[_0xcc8e('0x38')]);logger[_0xcc8e('0x17')](_0xcc8e('0x3a'),_0x33d12e[_0xcc8e('0x19')],util['inspect'](this[_0xcc8e('0x1a')][_0x33d12e[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0xcc8e('0x28'),_0xcc8e('0x29'),this[_0xcc8e('0x1a')][_0x33d12e[_0xcc8e('0x19')]]);}}}}catch(_0x1ffb66){logger[_0xcc8e('0x2c')](_0xcc8e('0x3b'),_0x33d12e[_0xcc8e('0x19')],util[_0xcc8e('0x26')](_0x1ffb66,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xcc8e('0x13')]['addVariable']=function(_0x57cf3c,_0x2bd9b3,_0x2d1932){var _0x34c59e=['rtpaudioqos','rtpaudioqosbridged',_0xcc8e('0x3c'),_0xcc8e('0x3d'),'rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0xcc8e('0x3e'),'sipcallid',_0xcc8e('0x3f'),'bridgepeer','bridgepvtcallid',_0xcc8e('0x40'),_0xcc8e('0x41'),'memberinterface',_0xcc8e('0x42'),_0xcc8e('0x24'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x2bd9b3)&&!_['includes'](_0x34c59e,_0x2bd9b3)){if(_[_0xcc8e('0x15')](this[_0xcc8e('0xb')][_0x57cf3c])){this[_0xcc8e('0xb')][_0x57cf3c]={};}this[_0xcc8e('0xb')][_0x57cf3c][_0x2bd9b3]=_0x2d1932;}};VoiceDialReport[_0xcc8e('0x13')][_0xcc8e('0x43')]=function(_0x4470ab){try{if(this[_0xcc8e('0x14')](_0x4470ab)){logger[_0xcc8e('0x17')]('[%s][voiceDialReport][hangup]\x20event:',_0x4470ab[_0xcc8e('0x19')],util['inspect'](_0x4470ab,{'showHidden':![],'depth':null}));if(this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]]){logger[_0xcc8e('0x23')](_0xcc8e('0x44'),_0x4470ab[_0xcc8e('0x19')],_0x4470ab[_0xcc8e('0x45')]);this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x46')]=moment()['format'](_0xcc8e('0x1c'));this['channels'][_0x4470ab[_0xcc8e('0x19')]]['duration']=moment(this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]]['endtime'])['diff'](this['channels'][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x47')],_0xcc8e('0x48'));this['channels'][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x32')]='complete';this[_0xcc8e('0x9')][_0xcc8e('0x49')]+=0x1;if(this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x4a')]){this[_0xcc8e('0x9')][_0xcc8e('0x4b')]+=0x1;this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']]['holdtime']=moment(this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x4a')])[_0xcc8e('0x4c')](this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x47')],_0xcc8e('0x48'));this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']][_0xcc8e('0x4d')]=moment(this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']][_0xcc8e('0x46')])[_0xcc8e('0x4c')](this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]]['answertime'],'seconds');this[_0xcc8e('0x9')]['sumHoldTime']+=this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']][_0xcc8e('0x4e')]||0x0;this[_0xcc8e('0x9')]['sumBillable']+=this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]][_0xcc8e('0x4d')];}this[_0xcc8e('0x9')][_0xcc8e('0x4f')]+=this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]]['duration'];logger[_0xcc8e('0x17')](_0xcc8e('0x50'),_0x4470ab['uniqueid'],util[_0xcc8e('0x26')](this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0xcc8e('0x51'),this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']]);logger[_0xcc8e('0x17')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x4470ab[_0xcc8e('0x19')],util['inspect'](this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialend',this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']]);logger[_0xcc8e('0x17')](_0xcc8e('0x52'),_0x4470ab[_0xcc8e('0x19')],util[_0xcc8e('0x26')](this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0xcc8e('0x28'),_0xcc8e('0x53'),this[_0xcc8e('0x9')]);logger['info']('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xcc8e('0x54')](this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]]));logger['debug'](_0xcc8e('0x55'),_0x4470ab[_0xcc8e('0x19')],util[_0xcc8e('0x26')](this['channels'][_0x4470ab['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xcc8e('0x28'),_0xcc8e('0x56'),this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x19')]]);delete this[_0xcc8e('0x1a')][_0x4470ab['uniqueid']];}else if(this['channels'][_0x4470ab[_0xcc8e('0x57')]]){this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x57')]]['uniqueid']=this[_0xcc8e('0x1a')][_0x4470ab[_0xcc8e('0x57')]][_0xcc8e('0x58')];}if(this['variables'][_0x4470ab[_0xcc8e('0x19')]]){delete this[_0xcc8e('0xb')][_0x4470ab['uniqueid']];}}}catch(_0x1a2d40){logger[_0xcc8e('0x2c')](_0xcc8e('0x59'),_0x4470ab[_0xcc8e('0x19')],util[_0xcc8e('0x26')](_0x1a2d40,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xcc8e('0x13')][_0xcc8e('0x11')]=function(_0x171cbc){try{if(this['isNotNull'](_0x171cbc)){logger['debug'](_0xcc8e('0x5a'),_0x171cbc['uniqueid'],util[_0xcc8e('0x26')](_0x171cbc,{'showHidden':![],'depth':null}));if(_0x171cbc[_0xcc8e('0x5b')][_0xcc8e('0x5c')]()===_0xcc8e('0x5d')){_0x171cbc[_0xcc8e('0x5e')]=(_0x171cbc[_0xcc8e('0x5f')]||_0x171cbc[_0xcc8e('0x5e')])['toLowerCase']();if(_[_0xcc8e('0x60')](_0x171cbc[_0xcc8e('0x5e')],'cdr(')){if(_[_0xcc8e('0x15')](this[_0xcc8e('0xa')][_0x171cbc['uniqueid']]))this[_0xcc8e('0xa')][_0x171cbc[_0xcc8e('0x19')]]={};logger[_0xcc8e('0x23')](_0xcc8e('0x61'),_0x171cbc[_0xcc8e('0x19')],_0x171cbc[_0xcc8e('0x5b')],_0x171cbc[_0xcc8e('0x5e')]);var _0x1edf2c=_0x171cbc[_0xcc8e('0x5e')][_0xcc8e('0x62')]('=');var _0x1f6d86=_0x1edf2c[0x0]['match'](/cdr\((.*)\)/);if(_0x1f6d86)this[_0xcc8e('0xa')][_0x171cbc[_0xcc8e('0x19')]][_0x1f6d86[0x1]]=_0x1edf2c[0x1];}}}}catch(_0x1c78e9){logger['error'](_0xcc8e('0x63'),_0x171cbc[_0xcc8e('0x19')],util['inspect'](_0x1c78e9,{'showHidden':![],'depth':null}));}};module[_0xcc8e('0x64')]=VoiceDialReport; \ No newline at end of file +var _0xddb8=['match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/logger','ami','redis','defaults','localhost','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','syncDialEnd','bind','varset','syncVarSet','syncHangup','isNotNull','isUndefined','prototype','emit','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','outboundrouteid','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberrealtime','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','diff','lastevent','total','answered','holdtime','starttime','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:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','application','toLowerCase','appdata','startsWith','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s'];(function(_0x52ce82,_0x626fb9){var _0x5b8d71=function(_0x1c69ed){while(--_0x1c69ed){_0x52ce82['push'](_0x52ce82['shift']());}};_0x5b8d71(++_0x626fb9);}(_0xddb8,0x70));var _0x8ddb=function(_0x31f88c,_0x282508){_0x31f88c=_0x31f88c-0x0;var _0x5b3fc4=_0xddb8[_0x31f88c];return _0x5b3fc4;};'use strict';var _=require(_0x8ddb('0x0'));var moment=require(_0x8ddb('0x1'));var util=require('util');var Redis=require(_0x8ddb('0x2'));var config=require('../../../config/environment');var logger=require(_0x8ddb('0x3'))(_0x8ddb('0x4'));var ami=require('../ami');config[_0x8ddb('0x5')]=_[_0x8ddb('0x6')](config[_0x8ddb('0x5')],{'host':_0x8ddb('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x37ea03){this[_0x8ddb('0x8')]=_0x37ea03[_0x8ddb('0x9')];this[_0x8ddb('0xa')]=_0x37ea03[_0x8ddb('0xa')];this[_0x8ddb('0xb')]={};this[_0x8ddb('0xc')]={};ami['on'](_0x8ddb('0xd'),this[_0x8ddb('0xe')]['bind'](this));ami['on']('dialend',this[_0x8ddb('0xf')][_0x8ddb('0x10')](this));ami['on'](_0x8ddb('0x11'),this[_0x8ddb('0x12')][_0x8ddb('0x10')](this));ami['on']('newexten',this['syncNewExten'][_0x8ddb('0x10')](this));ami['on']('hangup',this[_0x8ddb('0x13')][_0x8ddb('0x10')](this));}VoiceDialReport['prototype'][_0x8ddb('0x14')]=function(_0x24acef){return _0x24acef!==null&&!_[_0x8ddb('0x15')](_0x24acef);};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0x17')]=function(_0x4db444,_0x454a3e,_0x5f35a0){io['to'](_0x4db444)[_0x8ddb('0x17')](_0x454a3e,_0x5f35a0);};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0xe')]=function(_0x26895d){try{if(this[_0x8ddb('0x14')](_0x26895d)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0x26895d[_0x8ddb('0x18')],util[_0x8ddb('0x19')](_0x26895d,{'showHidden':![],'depth':null}));if(this['channels'][_0x26895d['uniqueid']]){_[_0x8ddb('0x1a')](this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]],{'starttime':moment()[_0x8ddb('0x1b')](_0x8ddb('0x1c')),'lastevent':'called','interface':_0x26895d[_0x8ddb('0x1d')][_0x8ddb('0x1e')](0x0,_0x26895d['channel'][_0x8ddb('0x1f')]('-')),'membername':_0x26895d[_0x8ddb('0x1d')][_0x8ddb('0x1e')](_0x26895d['channel'][_0x8ddb('0x1f')]('/')+0x1,_0x26895d[_0x8ddb('0x1d')]['lastIndexOf']('-'))},_['omit'](_0x26895d,[_0x8ddb('0x20'),_0x8ddb('0x21')]));logger[_0x8ddb('0x22')](_0x8ddb('0x23'),_0x26895d['uniqueid'],this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]][_0x8ddb('0x24')],this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]][_0x8ddb('0x25')]);logger['debug'](_0x8ddb('0x26'),_0x26895d[_0x8ddb('0x18')],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]],{'showHidden':![],'depth':null}));if(this[_0x8ddb('0xb')][_0x26895d['uniqueid']])_[_0x8ddb('0x1a')](this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]],this[_0x8ddb('0xb')][_0x26895d[_0x8ddb('0x18')]]);this[_0x8ddb('0x17')](_0x8ddb('0x27'),_0x8ddb('0x28'),this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]]);logger[_0x8ddb('0x29')](_0x8ddb('0x2a'),_0x26895d['uniqueid'],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x26895d[_0x8ddb('0x18')]],{'showHidden':![],'depth':null}));ami[_0x8ddb('0x17')]('custom:dialbegin',this['channels'][_0x26895d[_0x8ddb('0x18')]]);}}}catch(_0x1c0156){logger[_0x8ddb('0x2b')]('[%s][voiceDialReport][dialbegin]',_0x26895d[_0x8ddb('0x18')],util[_0x8ddb('0x19')](_0x1c0156,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0xf')]=function(_0x350ac5){try{if(this[_0x8ddb('0x14')](_0x350ac5)){logger[_0x8ddb('0x29')](_0x8ddb('0x2c'),_0x350ac5['uniqueid'],util[_0x8ddb('0x19')](_0x350ac5,{'showHidden':![],'depth':null}));if(this['channels'][_0x350ac5[_0x8ddb('0x18')]]){this[_0x8ddb('0x8')][_0x350ac5[_0x8ddb('0x18')]][_0x8ddb('0x2d')]=_0x350ac5[_0x8ddb('0x2d')];if(_0x350ac5['dialstatus']===_0x8ddb('0x2e')){this[_0x8ddb('0x8')][_0x350ac5['uniqueid']][_0x8ddb('0x2f')]=_0x350ac5[_0x8ddb('0x2f')];this[_0x8ddb('0x8')][_0x350ac5[_0x8ddb('0x18')]][_0x8ddb('0x30')]=_0x350ac5['connectedlinename'];this[_0x8ddb('0x8')][_0x350ac5[_0x8ddb('0x18')]][_0x8ddb('0x31')]=moment()[_0x8ddb('0x1b')](_0x8ddb('0x1c'));this[_0x8ddb('0x8')][_0x350ac5[_0x8ddb('0x18')]]['lastevent']='connect';logger[_0x8ddb('0x22')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x350ac5[_0x8ddb('0x18')],_0x350ac5['channel'][_0x8ddb('0x1e')](_0x350ac5[_0x8ddb('0x1d')][_0x8ddb('0x1f')]('/')+0x1,_0x350ac5[_0x8ddb('0x1d')]['lastIndexOf']('-')));logger[_0x8ddb('0x29')](_0x8ddb('0x32'),_0x350ac5[_0x8ddb('0x18')],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x350ac5['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x8ddb('0x17')](_0x8ddb('0x33'),this[_0x8ddb('0x8')][_0x350ac5['uniqueid']]);}logger[_0x8ddb('0x29')](_0x8ddb('0x34'),_0x350ac5[_0x8ddb('0x18')],util['inspect'](this[_0x8ddb('0x8')][_0x350ac5['uniqueid']],{'showHidden':![],'depth':null}));this[_0x8ddb('0x17')](_0x8ddb('0x27'),_0x8ddb('0x28'),this[_0x8ddb('0x8')][_0x350ac5[_0x8ddb('0x18')]]);}}}catch(_0x475058){logger[_0x8ddb('0x2b')]('[%s][voiceDialReport][dialend]',_0x350ac5[_0x8ddb('0x18')],util[_0x8ddb('0x19')](_0x475058,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0x12')]=function(_0x4eb132){try{if(this[_0x8ddb('0x14')](_0x4eb132)){logger[_0x8ddb('0x29')](_0x8ddb('0x35'),_0x4eb132['uniqueid'],util[_0x8ddb('0x19')](_0x4eb132,{'showHidden':![],'depth':null}));this[_0x8ddb('0x36')](_0x4eb132[_0x8ddb('0x18')],_[_0x8ddb('0x37')](_0x4eb132[_0x8ddb('0x38')])[0x0],_0x4eb132['value']);if(this['isNotNull'](_0x4eb132[_0x8ddb('0x38')])&&this[_0x8ddb('0x14')](_0x4eb132[_0x8ddb('0x38')][_0x8ddb('0x39')])){if(_[_0x8ddb('0x15')](this[_0x8ddb('0x8')][_0x4eb132[_0x8ddb('0x18')]])){this['channels'][_0x4eb132['uniqueid']]={'routeId':_0x4eb132[_0x8ddb('0x3a')],'variables':this[_0x8ddb('0xc')][_0x4eb132[_0x8ddb('0x18')]],'motionChannel':_0x8ddb('0x3b')};logger[_0x8ddb('0x22')](_0x8ddb('0x3c'),_0x4eb132[_0x8ddb('0x18')],_0x4eb132['variable']['outboundrouteid'],_[_0x8ddb('0x37')](_0x4eb132[_0x8ddb('0x38')])[0x0],_0x4eb132[_0x8ddb('0x3a')]);logger[_0x8ddb('0x29')](_0x8ddb('0x3d'),_0x4eb132[_0x8ddb('0x18')],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x4eb132[_0x8ddb('0x18')]],{'showHidden':![],'depth':null}));this['emit'](_0x8ddb('0x27'),'voice_outbound_channel:save',this[_0x8ddb('0x8')][_0x4eb132[_0x8ddb('0x18')]]);}}}}catch(_0x4dec5c){logger[_0x8ddb('0x2b')](_0x8ddb('0x3e'),_0x4eb132['uniqueid'],util[_0x8ddb('0x19')](_0x4dec5c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0x36')]=function(_0x1d931b,_0x5da801,_0x51c37d){var _0x4968ce=[_0x8ddb('0x3f'),_0x8ddb('0x40'),'rtpaudioqosjitter',_0x8ddb('0x41'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x8ddb('0x42'),'rtpaudioqosrttbridged',_0x8ddb('0x43'),_0x8ddb('0x44'),_0x8ddb('0x45'),'bridgepvtcallid',_0x8ddb('0x46'),'memberdynamic',_0x8ddb('0x47'),_0x8ddb('0x48'),_0x8ddb('0x24'),'memberpenalty',_0x8ddb('0x49')];if(!_['isNil'](_0x5da801)&&!_['includes'](_0x4968ce,_0x5da801)){if(_['isUndefined'](this[_0x8ddb('0xc')][_0x1d931b])){this[_0x8ddb('0xc')][_0x1d931b]={};}this['variables'][_0x1d931b][_0x5da801]=_0x51c37d;}};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0x13')]=function(_0x272abf){try{if(this[_0x8ddb('0x14')](_0x272abf)){logger['debug'](_0x8ddb('0x4a'),_0x272abf[_0x8ddb('0x18')],util[_0x8ddb('0x19')](_0x272abf,{'showHidden':![],'depth':null}));if(this['channels'][_0x272abf[_0x8ddb('0x18')]]){logger[_0x8ddb('0x22')](_0x8ddb('0x4b'),_0x272abf[_0x8ddb('0x18')],_0x272abf['cause-txt']);this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x4c')]=moment()[_0x8ddb('0x1b')](_0x8ddb('0x1c'));this[_0x8ddb('0x8')][_0x272abf['uniqueid']][_0x8ddb('0x4d')]=moment(this[_0x8ddb('0x8')][_0x272abf['uniqueid']][_0x8ddb('0x4c')])[_0x8ddb('0x4e')](this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]]['starttime'],'seconds');this['channels'][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x4f')]='complete';this[_0x8ddb('0xa')][_0x8ddb('0x50')]+=0x1;if(this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]]['answertime']){this['outbound'][_0x8ddb('0x51')]+=0x1;this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x52')]=moment(this[_0x8ddb('0x8')][_0x272abf['uniqueid']]['answertime'])[_0x8ddb('0x4e')](this[_0x8ddb('0x8')][_0x272abf['uniqueid']][_0x8ddb('0x53')],'seconds');this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x54')]=moment(this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x4c')])[_0x8ddb('0x4e')](this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x31')],'seconds');this[_0x8ddb('0xa')][_0x8ddb('0x55')]+=this['channels'][_0x272abf['uniqueid']][_0x8ddb('0x52')]||0x0;this[_0x8ddb('0xa')][_0x8ddb('0x56')]+=this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]][_0x8ddb('0x54')];}this[_0x8ddb('0xa')][_0x8ddb('0x57')]+=this[_0x8ddb('0x8')][_0x272abf['uniqueid']][_0x8ddb('0x4d')];logger['debug'](_0x8ddb('0x58'),_0x272abf[_0x8ddb('0x18')],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]],{'showHidden':![],'depth':null}));ami[_0x8ddb('0x17')]('custom:voiceDialReport',this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]]);logger[_0x8ddb('0x29')](_0x8ddb('0x59'),_0x272abf[_0x8ddb('0x18')],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]],{'showHidden':![],'depth':null}));ami[_0x8ddb('0x17')](_0x8ddb('0x5a'),this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]]);logger[_0x8ddb('0x29')](_0x8ddb('0x5b'),_0x272abf[_0x8ddb('0x18')],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x272abf['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x8ddb('0x27'),_0x8ddb('0x5c'),this[_0x8ddb('0xa')]);logger[_0x8ddb('0x22')](_0x8ddb('0x5d'),JSON[_0x8ddb('0x5e')](this[_0x8ddb('0x8')][_0x272abf['uniqueid']]));logger[_0x8ddb('0x29')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x272abf['uniqueid'],util[_0x8ddb('0x19')](this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]],{'showHidden':![],'depth':null}));this[_0x8ddb('0x17')](_0x8ddb('0x27'),'voice_outbound_channel:remove',this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x18')]]);delete this[_0x8ddb('0x8')][_0x272abf['uniqueid']];}else if(this[_0x8ddb('0x8')][_0x272abf[_0x8ddb('0x5f')]]){this['channels'][_0x272abf[_0x8ddb('0x5f')]]['uniqueid']=this['channels'][_0x272abf[_0x8ddb('0x5f')]][_0x8ddb('0x60')];}if(this[_0x8ddb('0xc')][_0x272abf[_0x8ddb('0x18')]]){delete this[_0x8ddb('0xc')][_0x272abf[_0x8ddb('0x18')]];}}}catch(_0x3b30dd){logger[_0x8ddb('0x2b')](_0x8ddb('0x61'),_0x272abf['uniqueid'],util[_0x8ddb('0x19')](_0x3b30dd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8ddb('0x16')][_0x8ddb('0x62')]=function(_0x28678c){try{if(this[_0x8ddb('0x14')](_0x28678c)){logger[_0x8ddb('0x29')]('[%s][voiceDialReport][newexten]\x20event:',_0x28678c[_0x8ddb('0x18')],util[_0x8ddb('0x19')](_0x28678c,{'showHidden':![],'depth':null}));if(_0x28678c[_0x8ddb('0x63')][_0x8ddb('0x64')]()==='set'){_0x28678c['applicationdata']=(_0x28678c[_0x8ddb('0x65')]||_0x28678c['applicationdata'])['toLowerCase']();if(_[_0x8ddb('0x66')](_0x28678c[_0x8ddb('0x67')],_0x8ddb('0x68'))){if(_[_0x8ddb('0x15')](this[_0x8ddb('0xb')][_0x28678c[_0x8ddb('0x18')]]))this['applications'][_0x28678c[_0x8ddb('0x18')]]={};logger[_0x8ddb('0x22')](_0x8ddb('0x69'),_0x28678c[_0x8ddb('0x18')],_0x28678c[_0x8ddb('0x63')],_0x28678c[_0x8ddb('0x67')]);var _0x1aa3d3=_0x28678c[_0x8ddb('0x67')]['split']('=');var _0x8cb9=_0x1aa3d3[0x0][_0x8ddb('0x6a')](/cdr\((.*)\)/);if(_0x8cb9)this[_0x8ddb('0xb')][_0x28678c[_0x8ddb('0x18')]][_0x8cb9[0x1]]=_0x1aa3d3[0x1];}}}}catch(_0x49fc51){logger[_0x8ddb('0x2b')](_0x8ddb('0x6b'),_0x28678c['uniqueid'],util[_0x8ddb('0x19')](_0x49fc51,{'showHidden':![],'depth':null}));}};module[_0x8ddb('0x6c')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index a8948f1..544bf31 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 _0x50c1=['channel','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','prototype','[FullyBooted]\x20clear\x20realtime','clearQueueReport','campaigns','emitVoiceQueueChannelRemove','clearqueuereport','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','emit','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','type','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','Action','queues','then','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','callers','waiting','toNumber','loggedin','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','queuecallerleaveAt','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','length','unmanaged','abandoned','diff','seconds','milliseconds','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','origtransfereruniqueid','transfertargetuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','set','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','lodash','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','newexten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','clearZombieChannels','switch','status'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x50c1,0x1a5));var _0x150c=function(_0x21ddfc,_0x9e2c1f){_0x21ddfc=_0x21ddfc-0x0;var _0x1921fd=_0x50c1[_0x21ddfc];return _0x1921fd;};'use strict';var _=require(_0x150c('0x0'));var moment=require('moment');var util=require('util');var md5=require(_0x150c('0x1'));var Redis=require(_0x150c('0x2'));var config=require(_0x150c('0x3'));var logger=require(_0x150c('0x4'))(_0x150c('0x5'));var ami=require(_0x150c('0x6'));var QueueReport=require(_0x150c('0x7'));config[_0x150c('0x8')]=_[_0x150c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x150c('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x150c('0xb')]=function(_0x2c8053){this[_0x150c('0xc')]=this[_0x150c('0xc')]?this[_0x150c('0xc')][_0x150c('0xd')](_0x2c8053):_0x2c8053();};function VoiceQueueReport(_0x1f0300){this[_0x150c('0xe')]=new Sequence();this[_0x150c('0xf')]={};this[_0x150c('0x10')]=_0x1f0300['agents'];this[_0x150c('0x11')]=_0x1f0300[_0x150c('0x12')];this[_0x150c('0x13')]=_0x1f0300['voiceQueues'];this[_0x150c('0x14')]=!![];this['campaigns']=_0x1f0300['campaigns'];this[_0x150c('0x15')]={};ami['on'](_0x150c('0x16'),this[_0x150c('0x17')][_0x150c('0x18')](this));ami['on'](_0x150c('0x19'),this[_0x150c('0x1a')][_0x150c('0x18')](this));ami['on'](_0x150c('0x1b'),this[_0x150c('0x1c')][_0x150c('0x18')](this));ami['on'](_0x150c('0x1d'),this[_0x150c('0x1e')]['bind'](this));ami['on'](_0x150c('0x1f'),this['syncQueueCallerLeave'][_0x150c('0x18')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x150c('0x18')](this));ami['on'](_0x150c('0x20'),this[_0x150c('0x21')][_0x150c('0x18')](this));ami['on']('varset',this[_0x150c('0x22')][_0x150c('0x18')](this));ami['on'](_0x150c('0x23'),this[_0x150c('0x24')][_0x150c('0x18')](this));ami['on'](_0x150c('0x25'),this['syncFullyBooted'][_0x150c('0x18')](this));ami['on'](_0x150c('0x26'),this['syncNewExten'][_0x150c('0x18')](this));ami['on']('musiconholdstart',this[_0x150c('0x27')][_0x150c('0x18')](this));ami['on'](_0x150c('0x28'),this[_0x150c('0x29')][_0x150c('0x18')](this));ami['on']('attendedtransfer',this[_0x150c('0x2a')][_0x150c('0x18')](this));ami['on'](_0x150c('0x2b'),this[_0x150c('0x2c')][_0x150c('0x18')](this));this[_0x150c('0x2d')]();this[_0x150c('0x2e')]();}function clearChannels(_0x336e60){if(!_[_0x150c('0x2f')](_0x336e60)){for(var _0x54d11c in _0x336e60){if(_0x336e60['hasOwnProperty'](_0x54d11c)){delete _0x336e60[_0x54d11c];}}}}function clearCampaigns(_0x3aaa56){if(!_[_0x150c('0x2f')](_0x3aaa56)){for(var _0x29a87c in _0x3aaa56){if(_0x3aaa56['hasOwnProperty'](_0x29a87c)){_0x3aaa56[_0x29a87c]['originated']=0x0;}}}}function clearVoiceQueues(_0x44d4e1){if(!_[_0x150c('0x2f')](_0x44d4e1)){for(var _0x11571a in _0x44d4e1){if(_0x44d4e1[_0x150c('0x30')](_0x11571a)){_0x44d4e1[_0x11571a][_0x150c('0x31')]=0x0;_0x44d4e1[_0x11571a][_0x150c('0x32')]=0x0;_0x44d4e1[_0x11571a][_0x150c('0x33')]=0x0;_0x44d4e1[_0x11571a]['waiting']=0x0;_0x44d4e1[_0x11571a]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0xbf4922){if(!_[_0x150c('0x2f')](_0xbf4922)){for(var _0x3234ea in _0xbf4922){if(_0xbf4922[_0x150c('0x30')](_0x3234ea)){_0xbf4922[_0x3234ea]['unlockRR']=!![];}}}}VoiceQueueReport['prototype'][_0x150c('0x34')]=function(){var _0x2f1b04=this;for(var _0x470652 in this['channels']){if(this[_0x150c('0x11')]['hasOwnProperty'](_0x470652)&&!this[_0x150c('0x11')][_0x470652][_0x150c('0x35')]){this[_0x150c('0xe')]['enqueue'](function(){if(!_['isNil'](_0x2f1b04[_0x150c('0x11')][_0x470652])){return ami['Action']({'action':_0x150c('0x36'),'channel':_0x2f1b04[_0x150c('0x11')][_0x470652][_0x150c('0x37')]})[_0x150c('0x38')](function(_0x151110){if(_0x151110[_0x150c('0x39')]===_0x150c('0x3a')){setTimeout(function(){if(_0x2f1b04['channels'][_0x470652]){delete _0x2f1b04[_0x150c('0x11')][_0x470652];logger[_0x150c('0x3b')]('[%s][voiceQueueReport][checkChannel]',_0x470652,util[_0x150c('0x3c')](_0x151110,{'showHidden':![],'depth':null}));}if(_0x2f1b04[_0x150c('0xf')][_0x470652]){delete _0x2f1b04[_0x150c('0xf')][_0x470652];logger['error'](_0x150c('0x3d'),_0x470652,util[_0x150c('0x3c')](_0x151110,{'showHidden':![],'depth':null}));}if(_0x2f1b04[_0x150c('0x15')][_0x470652]){delete _0x2f1b04['variables'][_0x470652];logger[_0x150c('0x3b')]('[%s][voiceQueueReport][checkVariables]',_0x470652,util['inspect'](_0x151110,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x150c('0x3e')]['syncFullyBooted']=function(){logger['error'](_0x150c('0x3f'));clearChannels(this[_0x150c('0x11')]);this[_0x150c('0x40')](this[_0x150c('0xf')]);clearAgentBooked(this[_0x150c('0x10')]);clearVoiceQueues(this[_0x150c('0x13')]);clearCampaigns(this[_0x150c('0x41')]);};VoiceQueueReport['prototype'][_0x150c('0x40')]=function(_0x424711){var _0xfdd5c0=this;if(!_['isEmpty'](_0x424711)){for(var _0x311523 in _0x424711){if(_0x424711[_0x150c('0x30')](_0x311523)){_0xfdd5c0[_0x150c('0x42')](_0x424711[_0x311523],_0x150c('0x43'));delete _0x424711[_0x311523];}}}};VoiceQueueReport[_0x150c('0x3e')]['emit']=function(_0x1c09b6,_0x2d53cb,_0x308496){io['to'](_0x1c09b6)['emit'](_0x2d53cb,_0x308496);};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x44')]=function(_0x1e8a57,_0x114226){logger[_0x150c('0x45')](_0x150c('0x46')+_0x114226+_0x150c('0x47'),_0x1e8a57['uniqueid'],util['inspect'](_0x1e8a57,{'showHidden':![],'depth':null}));this['emit'](util[_0x150c('0x48')](_0x150c('0x49'),_0x1e8a57[_0x150c('0x4a')]),_0x150c('0x4b'),_0x1e8a57);io[_0x150c('0x4c')](_0x150c('0x4d'),_0x1e8a57);};VoiceQueueReport['prototype'][_0x150c('0x42')]=function(_0x5c897a,_0x36f85c){logger[_0x150c('0x45')](_0x150c('0x46')+_0x36f85c+_0x150c('0x4e'),_0x5c897a[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x5c897a,{'showHidden':![],'depth':null}));this[_0x150c('0x4c')](util[_0x150c('0x48')](_0x150c('0x49'),_0x5c897a[_0x150c('0x4a')]),'voice_queue_channel:remove',_0x5c897a);io['emit']('voice_queue_presence:remove',_0x5c897a);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x1e6586,_0x19fa03){if(_0x1e6586[_0x150c('0x50')]==='inbound'){var _0x3bdf2c={'id':_0x1e6586['id'],'name':_0x1e6586['name'],'strategy':_0x1e6586[_0x150c('0x51')],'answered':_0x1e6586[_0x150c('0x52')],'available':_0x1e6586[_0x150c('0x53')],'loggedIn':_0x1e6586[_0x150c('0x54')],'pTalking':_0x1e6586[_0x150c('0x33')],'sumBillable':_0x1e6586[_0x150c('0x55')],'sumDuration':_0x1e6586[_0x150c('0x56')],'sumHoldTime':_0x1e6586[_0x150c('0x57')]||0x0,'talking':_0x1e6586[_0x150c('0x32')],'total':_0x1e6586[_0x150c('0x58')],'type':_0x1e6586[_0x150c('0x50')],'unmanaged':_0x1e6586['unmanaged'],'abandoned':_0x1e6586['abandoned'],'waiting':_0x1e6586['waiting']};if(_0x1e6586[_0x150c('0x59')]){_0x3bdf2c[_0x150c('0x59')]={'id':_0x1e6586[_0x150c('0x59')]['id'],'name':_0x1e6586[_0x150c('0x59')][_0x150c('0x4a')],'active':_0x1e6586[_0x150c('0x59')][_0x150c('0x5a')],'callerid':_0x1e6586[_0x150c('0x59')][_0x150c('0x5b')]};}if(_0x1e6586['Interval']){_0x3bdf2c[_0x150c('0x5c')]={'id':_0x1e6586['Interval']['id'],'name':_0x1e6586[_0x150c('0x5c')]['name']};}var _0x1564fd=md5(JSON[_0x150c('0x5d')](_0x3bdf2c));if(_0x1e6586[_0x150c('0x1')]!==_0x1564fd){_0x1e6586[_0x150c('0x1')]=_0x1564fd;logger['debug'](_0x150c('0x5e')+_0x19fa03+_0x150c('0x5f'),util[_0x150c('0x3c')](_0x3bdf2c,{'showHidden':![],'depth':null}));this[_0x150c('0x4c')](util[_0x150c('0x48')](_0x150c('0x49'),_0x3bdf2c[_0x150c('0x4a')]),_0x150c('0x60'),_0x3bdf2c);}}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x61')]=function(_0x26442e){return _0x26442e!==null&&!_[_0x150c('0x62')](_0x26442e);};VoiceQueueReport[_0x150c('0x3e')]['loopQueueShow']=function(){var _0x5961a5=this;setInterval(function(){_0x5961a5['clearZombieChannels']();ami[_0x150c('0x63')]({'action':_0x150c('0x64')})['catch'](function(_0x1dc8c1){logger[_0x150c('0x3b')]('[voiceQueueReport][queues]',util[_0x150c('0x3c')](_0x1dc8c1,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x2d')]=function(){var _0x55daa2=this;setInterval(function(){if(_0x55daa2[_0x150c('0x14')]){return ami[_0x150c('0x63')]({'action':_0x150c('0x16')})[_0x150c('0x65')](function(_0x4039b2){_0x55daa2[_0x150c('0x14')]=![];})[_0x150c('0x38')](function(_0x15151a){logger[_0x150c('0x3b')]('[voiceQueueReport][queuesummary]',util[_0x150c('0x3c')](_0x15151a,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x17')]=function(_0x2b89ee){try{if(this[_0x150c('0x61')](_0x2b89ee)&&this[_0x150c('0x61')](_0x2b89ee[_0x150c('0x66')])){logger[_0x150c('0x45')](_0x150c('0x67'),util[_0x150c('0x3c')](_0x2b89ee,{'showHidden':![],'depth':null}));if(this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]]){logger['info'](_0x150c('0x68'),_0x2b89ee[_0x150c('0x66')]);var _0x29ed05=_['countBy'](this[_0x150c('0x11')],_0x150c('0x66'))[_0x2b89ee[_0x150c('0x66')]]||0x0;var _0x4992a0=_0x29ed05-_0x2b89ee[_0x150c('0x69')];if(this[_0x150c('0x13')][_0x2b89ee['queue']][_0x150c('0x6a')]!==_[_0x150c('0x6b')](_0x2b89ee['callers'])||this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x54')]!==_[_0x150c('0x6b')](_0x2b89ee[_0x150c('0x6c')])||this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]]['available']!==_[_0x150c('0x6b')](_0x2b89ee[_0x150c('0x53')])||this['voiceQueues'][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x32')]!==_0x4992a0){this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x6a')]=_[_0x150c('0x6b')](_0x2b89ee[_0x150c('0x69')]);this['voiceQueues'][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x54')]=_[_0x150c('0x6b')](_0x2b89ee[_0x150c('0x6c')]);this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x53')]=_[_0x150c('0x6b')](_0x2b89ee['available']);this[_0x150c('0x13')][_0x2b89ee['queue']]['talking']=_0x4992a0>0x0?_0x4992a0:0x0;this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x32')]=this['voiceQueues'][_0x2b89ee['queue']][_0x150c('0x32')]>_[_0x150c('0x6b')](_0x2b89ee[_0x150c('0x6c')])?_[_0x150c('0x6b')](_0x2b89ee[_0x150c('0x6c')]):this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]][_0x150c('0x32')];this[_0x150c('0x6d')](this[_0x150c('0x13')][_0x2b89ee[_0x150c('0x66')]],_0x150c('0x16'));}logger['debug'](_0x150c('0x6e'),util[_0x150c('0x3c')](this['voiceQueues'][_0x2b89ee[_0x150c('0x66')]],{'showHidden':![],'depth':null}));ami[_0x150c('0x4c')](_0x150c('0x6f'),this[_0x150c('0x13')][_0x2b89ee['queue']]);}}}catch(_0x3a9a89){logger[_0x150c('0x3b')](_0x150c('0x70'),util[_0x150c('0x3c')](_0x3a9a89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x1a')]=function(_0x410007){logger['debug'](_0x150c('0x71'),util['inspect'](_0x410007,{'showHidden':![],'depth':null}));this[_0x150c('0x14')]=!![];};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x1c')]=function(_0x25d726){try{if(this[_0x150c('0x61')](_0x25d726)){logger['debug'](_0x150c('0x72'),_0x25d726[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x25d726,{'showHidden':![],'depth':null}));if(_[_0x150c('0x62')](this[_0x150c('0xf')][_0x25d726[_0x150c('0x4f')]]))this['queueReports'][_0x25d726[_0x150c('0x4f')]]=[];if(_['isUndefined'](this['channels'][_0x25d726[_0x150c('0x4f')]]))this[_0x150c('0x11')][_0x25d726[_0x150c('0x4f')]]={};var _0x15a798=new QueueReport();_0x15a798['name']=_0x25d726[_0x150c('0x66')];_0x15a798[_0x150c('0x50')]=this[_0x150c('0x13')][_0x15a798[_0x150c('0x4a')]]&&this[_0x150c('0x13')][_0x15a798[_0x150c('0x4a')]][_0x150c('0x50')]?this['voiceQueues'][_0x15a798['name']][_0x150c('0x50')]||_0x150c('0x73'):_0x150c('0x73');_0x15a798['queue']=_0x25d726[_0x150c('0x66')];_0x15a798[_0x150c('0x74')]=moment()['format'](_0x150c('0x75'));_0x15a798[_0x150c('0x76')]=_0x25d726[_0x150c('0x76')];_0x15a798[_0x150c('0x77')]=_0x25d726[_0x150c('0x77')];_0x15a798['uniqueid']=_0x25d726[_0x150c('0x4f')];_0x15a798[_0x150c('0x78')]=this[_0x150c('0x11')][_0x25d726[_0x150c('0x4f')]][_0x150c('0x78')];logger[_0x150c('0x79')](_0x150c('0x7a'),_0x15a798[_0x150c('0x4a')],_0x15a798[_0x150c('0x50')]);_['merge'](_0x15a798,_['pick'](_0x25d726,_['keys'](_0x15a798)));this[_0x150c('0xf')][_0x25d726['uniqueid']][_0x150c('0x7b')](_0x15a798);this[_0x150c('0x11')][_0x25d726['uniqueid']]=_0x15a798;this[_0x150c('0x44')](_0x15a798,_0x150c('0x1b'));}}catch(_0x4145ba){logger[_0x150c('0x3b')](_0x150c('0x72'),_0x25d726['uniqueid'],util['inspect'](_0x4145ba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x1e')]=function(_0x1309b3){try{if(this[_0x150c('0x61')](_0x1309b3)){logger[_0x150c('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1309b3['uniqueid'],util[_0x150c('0x3c')](_0x1309b3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1309b3[_0x150c('0x4f')]]){var _0x1905a2=_[_0x150c('0x7c')](this[_0x150c('0xf')][_0x1309b3[_0x150c('0x4f')]]);_0x1905a2[_0x150c('0x7d')]=![];_0x1905a2[_0x150c('0x7e')]=null;_0x1905a2[_0x150c('0x7f')]=_0x1309b3['holdtime'];_0x1905a2[_0x150c('0x80')]=_0x1309b3['originalposition'];_0x1905a2[_0x150c('0x1d')]=!![];_0x1905a2[_0x150c('0x81')]=moment()[_0x150c('0x48')](_0x150c('0x75'));_0x1905a2[_0x150c('0x82')]=_0x150c('0x83');_0x1905a2[_0x150c('0x84')]=null;logger['info'](_0x150c('0x85'),_0x1905a2['name'],_0x1905a2[_0x150c('0x50')]);this[_0x150c('0x11')][_0x1309b3[_0x150c('0x4f')]]=_0x1905a2;this[_0x150c('0x42')](_0x1905a2,_0x150c('0x1d'));}}}catch(_0x31d2f6){logger[_0x150c('0x3b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1309b3[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x31d2f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x86')]=function(_0x5e6c17){try{if(this[_0x150c('0x61')](_0x5e6c17)){logger[_0x150c('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x5e6c17[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x5e6c17,{'showHidden':![],'depth':null}));if(this[_0x150c('0xf')][_0x5e6c17[_0x150c('0x4f')]]){var _0x56da28=_[_0x150c('0x7c')](this['queueReports'][_0x5e6c17[_0x150c('0x4f')]]);_0x56da28['queuecallerleaveAt']=moment()[_0x150c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x56da28[_0x150c('0x87')]=_0x5e6c17[_0x150c('0x87')];_0x56da28[_0x150c('0x88')]=_0x5e6c17[_0x150c('0x88')];logger[_0x150c('0x79')](_0x150c('0x89'),_0x56da28[_0x150c('0x4a')],_0x56da28[_0x150c('0x50')],_0x5e6c17[_0x150c('0x87')],_0x5e6c17[_0x150c('0x88')]);this['channels'][_0x5e6c17[_0x150c('0x4f')]]=_0x56da28;this[_0x150c('0x44')](_0x56da28,'queuecallerleave');}}}catch(_0x226ff4){logger['error'](_0x150c('0x8a'),_0x5e6c17[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x226ff4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x21')]=function(_0x56ebd0){try{if(this[_0x150c('0x61')](_0x56ebd0)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x56ebd0[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x56ebd0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x56ebd0[_0x150c('0x4f')]]){var _0x1dc4b2=_[_0x150c('0x7c')](this[_0x150c('0xf')][_0x56ebd0[_0x150c('0x4f')]]);_0x1dc4b2[_0x150c('0x7d')]=!![];_0x1dc4b2[_0x150c('0x82')]=_0x150c('0x8b');logger[_0x150c('0x79')](_0x150c('0x8c'),_0x1dc4b2[_0x150c('0x4a')],_0x1dc4b2[_0x150c('0x50')]);}}}catch(_0x2f2a2d){logger[_0x150c('0x3b')](_0x150c('0x8d'),_0x56ebd0[_0x150c('0x4f')],util['inspect'](_0x2f2a2d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0x8e')]=function(_0x20a7df){try{if(this[_0x150c('0x61')](_0x20a7df)){logger['debug'](_0x150c('0x8f'),_0x20a7df[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x20a7df,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x20a7df[_0x150c('0x4f')]]){var _0x3575a3=_['last'](this[_0x150c('0xf')][_0x20a7df['uniqueid']]);_0x3575a3[_0x150c('0x1d')]=![];_0x3575a3[_0x150c('0x81')]=null;_0x3575a3['assigned']=!![];_0x3575a3[_0x150c('0x84')]=_0x20a7df[_0x150c('0x90')];_0x3575a3['holdtime']=_0x20a7df[_0x150c('0x7f')];_0x3575a3[_0x150c('0x7d')]=!![];_0x3575a3[_0x150c('0x91')]=![];_0x3575a3['queuecallerexitAt']=null;if(!_0x3575a3[_0x150c('0x92')]){if(_0x20a7df[_0x150c('0x93')]==_0x150c('0x92')){_0x3575a3[_0x150c('0x82')]=_0x150c('0x94');logger['info'](_0x150c('0x95'),_0x3575a3[_0x150c('0x4a')],_0x3575a3[_0x150c('0x50')]);}else{if(_[_0x150c('0x96')](_0x20a7df[_0x150c('0x37')][_0x150c('0x97')](),_0x150c('0x98'))){if(this[_0x150c('0xf')][_0x20a7df['linkedid']]){var _0xa71d6c=_[_0x150c('0x7c')](this['queueReports'][_0x20a7df[_0x150c('0x99')]]);_0xa71d6c[_0x150c('0x7d')]=![];_0xa71d6c['queuecallerexit']=!![];_0xa71d6c[_0x150c('0x9a')]=moment(_0x3575a3[_0x150c('0x74')])['add'](_0x20a7df['holdtime'],'seconds')[_0x150c('0x48')](_0x150c('0x75'));_0xa71d6c[_0x150c('0x82')]=_0x150c('0x9b');_0xa71d6c['transfer']=!![];_0xa71d6c[_0x150c('0x9c')]=_0x150c('0x9d');_0xa71d6c[_0x150c('0x9e')]=_0x20a7df['destexten'];_0xa71d6c[_0x150c('0x9f')]=_0x20a7df[_0x150c('0x4f')];logger[_0x150c('0x79')](_0x150c('0xa0'),_0xa71d6c[_0x150c('0x4a')],_0xa71d6c['type']);var _0x3fe114=this[_0x150c('0xf')][_0x20a7df[_0x150c('0x99')]];this['queueReports'][_0x20a7df[_0x150c('0x99')]]=this[_0x150c('0xf')][_0x20a7df[_0x150c('0x4f')]];this[_0x150c('0xf')][_0x20a7df['uniqueid']]=_0x3fe114;}}else{_0x3575a3[_0x150c('0x82')]=_0x150c('0xa1')+_0x20a7df['reason']['toUpperCase']();logger[_0x150c('0x79')](_0x150c('0xa2'),_0x3575a3[_0x150c('0x4a')],_0x3575a3[_0x150c('0x50')],_0x3575a3[_0x150c('0x82')]);}}}this[_0x150c('0x11')][_0x20a7df['uniqueid']]=_0x3575a3;this[_0x150c('0x42')](_0x3575a3,'agentcomplete');}}}catch(_0x57d385){logger[_0x150c('0x3b')](_0x150c('0x8f'),_0x20a7df['uniqueid'],util[_0x150c('0x3c')](_0x57d385,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x23592f){try{if(this[_0x150c('0x61')](_0x23592f)){logger[_0x150c('0x45')](_0x150c('0xa3'),_0x23592f['uniqueid'],util['inspect'](_0x23592f,{'showHidden':![],'depth':null}));this[_0x150c('0xa4')](_0x23592f[_0x150c('0x4f')],_[_0x150c('0xa5')](_0x23592f[_0x150c('0xa6')])[0x0],_0x23592f[_0x150c('0xa7')]);if(this[_0x150c('0xf')][_0x23592f[_0x150c('0x4f')]]){var _0x28dad8=_[_0x150c('0x7c')](this['queueReports'][_0x23592f[_0x150c('0x4f')]]);if(_0x28dad8){if(this[_0x150c('0x61')](_0x23592f[_0x150c('0xa6')])&&this['isNotNull'](_0x23592f[_0x150c('0xa6')][_0x150c('0xa8')])){switch(_0x23592f[_0x150c('0xa7')]){case _0x150c('0xa9'):_0x28dad8['queuecallerexit']=![];_0x28dad8[_0x150c('0x9a')]=null;break;case _0x150c('0xaa'):_0x28dad8[_0x150c('0xab')]='timeout';_0x28dad8[_0x150c('0x91')]=!![];_0x28dad8[_0x150c('0x9a')]=moment()['format'](_0x150c('0x75'));_0x28dad8[_0x150c('0xac')]=moment()[_0x150c('0x48')](_0x150c('0x75'));logger[_0x150c('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x23592f[_0x150c('0x4f')],util['inspect'](_0x28dad8,{'showHidden':![],'depth':null}));ami[_0x150c('0x4c')]('custom:timeout',_0x28dad8);break;default:_0x28dad8[_0x150c('0x91')]=!![];_0x28dad8['queuecallerexitAt']=moment()['format'](_0x150c('0x75'));_0x28dad8[_0x150c('0xac')]=moment()[_0x150c('0x48')](_0x150c('0x75'));}_0x28dad8[_0x150c('0x1d')]=![];_0x28dad8[_0x150c('0x81')]=null;_0x28dad8['queuecallerexitreason']=_0x23592f[_0x150c('0xa7')];this[_0x150c('0x11')][_0x23592f[_0x150c('0x4f')]]=_0x28dad8;this[_0x150c('0x42')](_0x28dad8,_0x150c('0xad'));}else if(this[_0x150c('0x61')](_0x23592f['variable'])&&this[_0x150c('0x61')](_0x23592f[_0x150c('0xa6')][_0x150c('0xae')])){if(!_0x28dad8[_0x150c('0x1d')]){_0x28dad8[_0x150c('0x91')]=!![];_0x28dad8[_0x150c('0x9a')]=moment()[_0x150c('0x48')](_0x150c('0x75'));_0x28dad8[_0x150c('0x82')]=_0x150c('0xaf');_0x28dad8[_0x150c('0xac')]=moment()[_0x150c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x23592f[_0x150c('0x4f')]]=_0x28dad8;}}logger[_0x150c('0x79')](_0x150c('0xb0'),_0x23592f[_0x150c('0x4f')],_0x28dad8[_0x150c('0x4a')],_0x28dad8[_0x150c('0x50')],_[_0x150c('0xa5')](_0x23592f[_0x150c('0xa6')])[0x0],_0x23592f[_0x150c('0xa7')]);_0x28dad8['variables']=this['variables'][_0x23592f[_0x150c('0x4f')]];}}}}catch(_0x17b603){logger[_0x150c('0x3b')]('[%s][voiceQueueReport][varset]',_0x23592f[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x17b603,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x150c('0x3e')][_0x150c('0xa4')]=function(_0x2ca520,_0x2841c3,_0x3633b8){var _0x23e821=[_0x150c('0xb1'),_0x150c('0xb2'),_0x150c('0xb3'),'rtpaudioqosjitterbridged',_0x150c('0xb4'),_0x150c('0xb5'),_0x150c('0xb6'),'rtpaudioqosrttbridged',_0x150c('0xb7'),_0x150c('0xb8'),_0x150c('0xb9'),_0x150c('0xba'),_0x150c('0xbb'),_0x150c('0xbc'),_0x150c('0xbd'),_0x150c('0xbe'),_0x150c('0x90'),_0x150c('0xbf'),'memberrealtime'];if(!_[_0x150c('0xc0')](_0x2841c3)&&!_['includes'](_0x23e821,_0x2841c3)){if(_['isUndefined'](this[_0x150c('0x15')][_0x2ca520])){this['variables'][_0x2ca520]={};}this[_0x150c('0x15')][_0x2ca520][_0x2841c3]=_0x3633b8;}};VoiceQueueReport['prototype'][_0x150c('0x24')]=function(_0x123e40){try{if(this[_0x150c('0x61')](_0x123e40)){logger[_0x150c('0x45')]('[%s][voiceQueueReport][hangup]',_0x123e40[_0x150c('0x4f')],util[_0x150c('0x3c')](_0x123e40,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x123e40['uniqueid']]){for(var _0x1515f9=0x0,_0xb156a5={};_0x1515f90x0?_0x5cc68d:0x0;this[_0xbee5('0x11')][_0x131c45[_0xbee5('0x6b')]]['talking']=this[_0xbee5('0x11')][_0x131c45[_0xbee5('0x6b')]]['talking']>_[_0xbee5('0x6f')](_0x131c45[_0xbee5('0x70')])?_['toNumber'](_0x131c45[_0xbee5('0x70')]):this['voiceQueues'][_0x131c45[_0xbee5('0x6b')]]['talking'];this[_0xbee5('0x53')](this['voiceQueues'][_0x131c45['queue']],_0xbee5('0x71'));}logger[_0xbee5('0x47')](_0xbee5('0x72'),util[_0xbee5('0x3f')](this[_0xbee5('0x11')][_0x131c45[_0xbee5('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xbee5('0x73'),this[_0xbee5('0x11')][_0x131c45[_0xbee5('0x6b')]]);}}}catch(_0x70f14d){logger[_0xbee5('0x3d')](_0xbee5('0x6a'),util[_0xbee5('0x3f')](_0x70f14d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbee5('0x34')][_0xbee5('0x74')]=function(_0x5ba08d){logger[_0xbee5('0x47')](_0xbee5('0x75'),util[_0xbee5('0x3f')](_0x5ba08d,{'showHidden':![],'depth':null}));this[_0xbee5('0x12')]=!![];};VoiceQueueReport['prototype'][_0xbee5('0x76')]=function(_0x237431){try{if(this[_0xbee5('0x63')](_0x237431)){logger[_0xbee5('0x47')](_0xbee5('0x77'),_0x237431[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x237431,{'showHidden':![],'depth':null}));if(_[_0xbee5('0x64')](this[_0xbee5('0xd')][_0x237431[_0xbee5('0x4a')]]))this[_0xbee5('0xd')][_0x237431[_0xbee5('0x4a')]]=[];if(_['isUndefined'](this[_0xbee5('0xf')][_0x237431[_0xbee5('0x4a')]]))this['channels'][_0x237431[_0xbee5('0x4a')]]={};var _0x56ceeb=new QueueReport();_0x56ceeb[_0xbee5('0x4c')]=_0x237431[_0xbee5('0x6b')];_0x56ceeb['type']=this[_0xbee5('0x11')][_0x56ceeb['name']]&&this['voiceQueues'][_0x56ceeb['name']]['type']?this['voiceQueues'][_0x56ceeb['name']][_0xbee5('0x54')]||_0xbee5('0x78'):_0xbee5('0x78');_0x56ceeb[_0xbee5('0x6b')]=_0x237431[_0xbee5('0x6b')];_0x56ceeb[_0xbee5('0x79')]=moment()[_0xbee5('0x4b')](_0xbee5('0x7a'));_0x56ceeb[_0xbee5('0x7b')]=_0x237431[_0xbee5('0x7b')];_0x56ceeb[_0xbee5('0x7c')]=_0x237431[_0xbee5('0x7c')];_0x56ceeb['uniqueid']=_0x237431[_0xbee5('0x4a')];_0x56ceeb[_0xbee5('0x7d')]=this['channels'][_0x237431['uniqueid']][_0xbee5('0x7d')];logger[_0xbee5('0x6c')](_0xbee5('0x7e'),_0x56ceeb['name'],_0x56ceeb[_0xbee5('0x54')]);_[_0xbee5('0x7f')](_0x56ceeb,_[_0xbee5('0x80')](_0x237431,_['keys'](_0x56ceeb)));this['queueReports'][_0x237431['uniqueid']][_0xbee5('0x81')](_0x56ceeb);this[_0xbee5('0xf')][_0x237431[_0xbee5('0x4a')]]=_0x56ceeb;this[_0xbee5('0x46')](_0x56ceeb,_0xbee5('0x18'));}}catch(_0x265ed6){logger[_0xbee5('0x3d')](_0xbee5('0x77'),_0x237431['uniqueid'],util['inspect'](_0x265ed6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbee5('0x34')][_0xbee5('0x19')]=function(_0x554fae){try{if(this['isNotNull'](_0x554fae)){logger[_0xbee5('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x554fae['uniqueid'],util[_0xbee5('0x3f')](_0x554fae,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x554fae[_0xbee5('0x4a')]]){var _0x2a8798=_['last'](this[_0xbee5('0xd')][_0x554fae[_0xbee5('0x4a')]]);_0x2a8798[_0xbee5('0x82')]=![];_0x2a8798[_0xbee5('0x83')]=null;_0x2a8798[_0xbee5('0x84')]=_0x554fae['holdtime'];_0x2a8798['originalposition']=_0x554fae[_0xbee5('0x85')];_0x2a8798['queuecallerabandon']=!![];_0x2a8798[_0xbee5('0x86')]=moment()['format'](_0xbee5('0x7a'));_0x2a8798[_0xbee5('0x87')]=_0xbee5('0x88');_0x2a8798[_0xbee5('0x89')]=null;logger[_0xbee5('0x6c')](_0xbee5('0x8a'),_0x2a8798[_0xbee5('0x4c')],_0x2a8798[_0xbee5('0x54')]);this[_0xbee5('0xf')][_0x554fae[_0xbee5('0x4a')]]=_0x2a8798;this[_0xbee5('0x4f')](_0x2a8798,_0xbee5('0x8b'));}}}catch(_0x4b13bb){logger[_0xbee5('0x3d')](_0xbee5('0x8c'),_0x554fae[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x4b13bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbee5('0x8d')]=function(_0x16d792){try{if(this[_0xbee5('0x63')](_0x16d792)){logger[_0xbee5('0x47')](_0xbee5('0x8e'),_0x16d792[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x16d792,{'showHidden':![],'depth':null}));if(this[_0xbee5('0xd')][_0x16d792['uniqueid']]){var _0xc3a400=_[_0xbee5('0x8f')](this[_0xbee5('0xd')][_0x16d792[_0xbee5('0x4a')]]);_0xc3a400[_0xbee5('0x90')]=moment()[_0xbee5('0x4b')](_0xbee5('0x7a'));_0xc3a400[_0xbee5('0x91')]=_0x16d792[_0xbee5('0x91')];_0xc3a400[_0xbee5('0x92')]=_0x16d792[_0xbee5('0x92')];logger['info'](_0xbee5('0x93'),_0xc3a400[_0xbee5('0x4c')],_0xc3a400['type'],_0x16d792[_0xbee5('0x91')],_0x16d792[_0xbee5('0x92')]);this[_0xbee5('0xf')][_0x16d792['uniqueid']]=_0xc3a400;this[_0xbee5('0x46')](_0xc3a400,_0xbee5('0x1a'));}}}catch(_0x21c3df){logger[_0xbee5('0x3d')](_0xbee5('0x8e'),_0x16d792[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x21c3df,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbee5('0x34')][_0xbee5('0x1d')]=function(_0x167bea){try{if(this[_0xbee5('0x63')](_0x167bea)){logger[_0xbee5('0x47')]('[%s][voiceQueueReport][agentconnect]',_0x167bea[_0xbee5('0x4a')],util['inspect'](_0x167bea,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x167bea[_0xbee5('0x4a')]]){var _0x198a43=_['last'](this['queueReports'][_0x167bea[_0xbee5('0x4a')]]);_0x198a43[_0xbee5('0x82')]=!![];_0x198a43[_0xbee5('0x87')]=_0xbee5('0x94');logger[_0xbee5('0x6c')](_0xbee5('0x95'),_0x198a43[_0xbee5('0x4c')],_0x198a43['type']);}}}catch(_0x5eb60d){logger[_0xbee5('0x3d')](_0xbee5('0x96'),_0x167bea[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x5eb60d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbee5('0x34')][_0xbee5('0x97')]=function(_0x38f54c){try{if(this['isNotNull'](_0x38f54c)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x38f54c[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x38f54c,{'showHidden':![],'depth':null}));if(this[_0xbee5('0xd')][_0x38f54c[_0xbee5('0x4a')]]){var _0x56ebec=_[_0xbee5('0x8f')](this[_0xbee5('0xd')][_0x38f54c[_0xbee5('0x4a')]]);_0x56ebec['queuecallerabandon']=![];_0x56ebec[_0xbee5('0x86')]=null;_0x56ebec['assigned']=!![];_0x56ebec[_0xbee5('0x89')]=_0x38f54c[_0xbee5('0x98')];_0x56ebec['holdtime']=_0x38f54c['holdtime'];_0x56ebec['queuecallercomplete']=!![];_0x56ebec[_0xbee5('0x99')]=![];_0x56ebec['queuecallerexitAt']=null;if(!_0x56ebec[_0xbee5('0x9a')]){if(_0x38f54c[_0xbee5('0x9b')]=='transfer'){_0x56ebec['queuecallerexitreason']=_0xbee5('0x9c');logger['info'](_0xbee5('0x9d'),_0x56ebec[_0xbee5('0x4c')],_0x56ebec[_0xbee5('0x54')]);}else{if(_['startsWith'](_0x38f54c[_0xbee5('0x9e')][_0xbee5('0x9f')](),_0xbee5('0xa0'))){if(this[_0xbee5('0xd')][_0x38f54c[_0xbee5('0xa1')]]){var _0x45eda8=_['last'](this['queueReports'][_0x38f54c[_0xbee5('0xa1')]]);_0x45eda8['queuecallercomplete']=![];_0x45eda8['queuecallerexit']=!![];_0x45eda8[_0xbee5('0xa2')]=moment(_0x56ebec[_0xbee5('0x79')])[_0xbee5('0xa3')](_0x38f54c[_0xbee5('0x84')],_0xbee5('0xa4'))[_0xbee5('0x4b')](_0xbee5('0x7a'));_0x45eda8['queuecallerexitreason']='FORWARDTRANSFER';_0x45eda8['transfer']=!![];_0x45eda8['transfertype']=_0xbee5('0xa5');_0x45eda8[_0xbee5('0xa6')]=_0x38f54c[_0xbee5('0xa7')];_0x45eda8['transferuniqueid']=_0x38f54c[_0xbee5('0x4a')];logger[_0xbee5('0x6c')](_0xbee5('0xa8'),_0x45eda8['name'],_0x45eda8[_0xbee5('0x54')]);var _0x24c3f3=this[_0xbee5('0xd')][_0x38f54c[_0xbee5('0xa1')]];this[_0xbee5('0xd')][_0x38f54c['linkedid']]=this['queueReports'][_0x38f54c['uniqueid']];this['queueReports'][_0x38f54c[_0xbee5('0x4a')]]=_0x24c3f3;}}else{_0x56ebec[_0xbee5('0x87')]=_0xbee5('0xa9')+_0x38f54c[_0xbee5('0x9b')][_0xbee5('0xaa')]();logger[_0xbee5('0x6c')](_0xbee5('0xab'),_0x56ebec[_0xbee5('0x4c')],_0x56ebec[_0xbee5('0x54')],_0x56ebec[_0xbee5('0x87')]);}}}this[_0xbee5('0xf')][_0x38f54c['uniqueid']]=_0x56ebec;this[_0xbee5('0x4f')](_0x56ebec,_0xbee5('0x1b'));}}}catch(_0x2f4ad4){logger[_0xbee5('0x3d')](_0xbee5('0xac'),_0x38f54c[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x2f4ad4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbee5('0x34')][_0xbee5('0x1f')]=function(_0x1601db){try{if(this[_0xbee5('0x63')](_0x1601db)){logger[_0xbee5('0x47')](_0xbee5('0xad'),_0x1601db[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x1601db,{'showHidden':![],'depth':null}));this[_0xbee5('0xae')](_0x1601db[_0xbee5('0x4a')],_['keys'](_0x1601db[_0xbee5('0xaf')])[0x0],_0x1601db[_0xbee5('0xb0')]);if(this[_0xbee5('0xd')][_0x1601db[_0xbee5('0x4a')]]){var _0x5f25c9=_[_0xbee5('0x8f')](this[_0xbee5('0xd')][_0x1601db['uniqueid']]);if(_0x5f25c9){if(this[_0xbee5('0x63')](_0x1601db[_0xbee5('0xaf')])&&this[_0xbee5('0x63')](_0x1601db[_0xbee5('0xaf')]['queuestatus'])){switch(_0x1601db[_0xbee5('0xb0')]){case'CONTINUE':_0x5f25c9[_0xbee5('0x99')]=![];_0x5f25c9[_0xbee5('0xa2')]=null;break;case'TIMEOUT':_0x5f25c9[_0xbee5('0xb1')]=_0xbee5('0xb2');_0x5f25c9[_0xbee5('0x99')]=!![];_0x5f25c9['queuecallerexitAt']=moment()[_0xbee5('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f25c9[_0xbee5('0x90')]=moment()[_0xbee5('0x4b')](_0xbee5('0x7a'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1601db[_0xbee5('0x4a')],util['inspect'](_0x5f25c9,{'showHidden':![],'depth':null}));ami[_0xbee5('0x45')]('custom:timeout',_0x5f25c9);break;default:_0x5f25c9[_0xbee5('0x99')]=!![];_0x5f25c9[_0xbee5('0xa2')]=moment()[_0xbee5('0x4b')](_0xbee5('0x7a'));_0x5f25c9[_0xbee5('0x90')]=moment()['format'](_0xbee5('0x7a'));}_0x5f25c9[_0xbee5('0x8b')]=![];_0x5f25c9['queuecallerabandonAt']=null;_0x5f25c9['queuecallerexitreason']=_0x1601db[_0xbee5('0xb0')];this[_0xbee5('0xf')][_0x1601db[_0xbee5('0x4a')]]=_0x5f25c9;this['emitVoiceQueueChannelRemove'](_0x5f25c9,'varset');}else if(this[_0xbee5('0x63')](_0x1601db['variable'])&&this[_0xbee5('0x63')](_0x1601db[_0xbee5('0xaf')][_0xbee5('0xb3')])){if(!_0x5f25c9['queuecallerabandon']){_0x5f25c9[_0xbee5('0x99')]=!![];_0x5f25c9[_0xbee5('0xa2')]=moment()[_0xbee5('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f25c9[_0xbee5('0x87')]=_0xbee5('0xb4');_0x5f25c9['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1601db[_0xbee5('0x4a')]]=_0x5f25c9;}}logger[_0xbee5('0x6c')](_0xbee5('0xb5'),_0x1601db[_0xbee5('0x4a')],_0x5f25c9[_0xbee5('0x4c')],_0x5f25c9['type'],_[_0xbee5('0xb6')](_0x1601db[_0xbee5('0xaf')])[0x0],_0x1601db['value']);_0x5f25c9[_0xbee5('0x14')]=this[_0xbee5('0x14')][_0x1601db['uniqueid']];}}}}catch(_0x4285e6){logger[_0xbee5('0x3d')]('[%s][voiceQueueReport][varset]',_0x1601db[_0xbee5('0x4a')],util[_0xbee5('0x3f')](_0x4285e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbee5('0xae')]=function(_0xf254c2,_0x5d8701,_0x4ff844){var _0x14c6f4=[_0xbee5('0xb7'),_0xbee5('0xb8'),_0xbee5('0xb9'),_0xbee5('0xba'),'rtpaudioqosloss',_0xbee5('0xbb'),_0xbee5('0xbc'),_0xbee5('0xbd'),_0xbee5('0xbe'),_0xbee5('0xbf'),_0xbee5('0xc0'),'bridgepvtcallid',_0xbee5('0xc1'),_0xbee5('0xc2'),_0xbee5('0xc3'),_0xbee5('0xc4'),'membername',_0xbee5('0xc5'),_0xbee5('0xc6')];if(!_['isNil'](_0x5d8701)&&!_['includes'](_0x14c6f4,_0x5d8701)){if(_[_0xbee5('0x64')](this['variables'][_0xf254c2])){this['variables'][_0xf254c2]={};}this[_0xbee5('0x14')][_0xf254c2][_0x5d8701]=_0x4ff844;}};VoiceQueueReport['prototype'][_0xbee5('0x21')]=function(_0x374781){try{if(this[_0xbee5('0x63')](_0x374781)){logger[_0xbee5('0x47')](_0xbee5('0xc7'),_0x374781[_0xbee5('0x4a')],util['inspect'](_0x374781,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x374781['uniqueid']]){for(var _0xa390f7=0x0,_0x400e10={};_0xa390f7=0x0?moment(_0x2e4184['endtime'])[_0x534b('0xf')](_0x2e4184[_0x534b('0x19')],'seconds'):null,'data1':_0x534b('0x1c'),'data2':_0x2e4184[_0x534b('0x13')],'data3':_0x2e4184[_0x534b('0x12')],'data4':_0x2e4184[_0x534b('0x1d')]||null,'role':_0x534b('0x1e'),'internal':_0x2e4184['accountcode']?_[_0x534b('0x14')](_0x2e4184[_0x534b('0x13')]):undefined,'uniqueid':_0x2e4184['uniqueid']},'log':_0x534b('0x7')});}; \ No newline at end of file +var _0x1d07=['queue','agent','accountcode','toNumber','voiceDialReport','membername','endtime','starttime','outbound','uniqueid','moment','lodash','util','../client','voiceQueueReport','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten'];(function(_0xf457b5,_0x5dc26a){var _0x5f4e15=function(_0x454393){while(--_0x454393){_0xf457b5['push'](_0xf457b5['shift']());}};_0x5f4e15(++_0x5dc26a);}(_0x1d07,0x1e6));var _0x71d0=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1d07[_0x1694f5];return _0x5b4321;};'use strict';var moment=require(_0x71d0('0x0'));var _=require(_0x71d0('0x1'));var util=require(_0x71d0('0x2'));var client=require(_0x71d0('0x3'));exports[_0x71d0('0x4')]=function(_0x4276da){var _0x7ae145=_0x4276da['queuecallercompleteAt']||_0x4276da['queuecallerexitAt'];return client[_0x71d0('0x5')](_0x71d0('0x6'),{'body':{'channel':_0x71d0('0x7'),'membername':_0x4276da[_0x71d0('0x8')],'interface':_[_0x71d0('0x9')](_0x4276da[_0x71d0('0xa')])?util[_0x71d0('0xb')]('SIP/%s',_0x4276da[_0x71d0('0x8')]):_0x4276da[_0x71d0('0xa')],'type':_0x71d0('0xc'),'enterAt':_0x4276da[_0x71d0('0xd')],'exitAt':_0x7ae145,'duration':moment(_0x7ae145)[_0x71d0('0xe')](_0x4276da[_0x71d0('0xd')],_0x71d0('0xf')),'data1':_0x71d0('0x10'),'data2':_0x4276da['calleridnum'],'data3':_0x4276da[_0x71d0('0x11')],'data4':null,'data5':_0x4276da[_0x71d0('0x12')],'role':_0x71d0('0x13'),'internal':_0x4276da[_0x71d0('0x14')]?_[_0x71d0('0x15')](_0x4276da['accountcode']):undefined,'uniqueid':_0x4276da['uniqueid']},'log':'CreateMemberReport'});};exports[_0x71d0('0x16')]=function(_0x2e2475){return client['Request'](_0x71d0('0x6'),{'body':{'channel':'voice','membername':_0x2e2475[_0x71d0('0x17')],'interface':_0x2e2475[_0x71d0('0xa')],'type':'TALKING','enterAt':_0x2e2475['starttime'],'exitAt':_0x2e2475[_0x71d0('0x18')],'duration':moment(_0x2e2475[_0x71d0('0x18')])[_0x71d0('0xe')](_0x2e2475[_0x71d0('0x19')],_0x71d0('0xf'))>=0x0?moment(_0x2e2475[_0x71d0('0x18')])[_0x71d0('0xe')](_0x2e2475[_0x71d0('0x19')],_0x71d0('0xf')):null,'data1':_0x71d0('0x1a'),'data2':_0x2e2475[_0x71d0('0x14')],'data3':_0x2e2475['exten'],'data4':_0x2e2475['dialstring']||null,'role':_0x71d0('0x13'),'internal':_0x2e2475[_0x71d0('0x14')]?_[_0x71d0('0x15')](_0x2e2475[_0x71d0('0x14')]):undefined,'uniqueid':_0x2e2475[_0x71d0('0x1b')]},'log':_0x71d0('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 3cd233e..5e500d0 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 _0x3cfb=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x3e079f,_0x189e15){var _0x296a34=function(_0xa31a0a){while(--_0xa31a0a){_0x3e079f['push'](_0x3e079f['shift']());}};_0x296a34(++_0x189e15);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x2db8b3,_0x5da46d){_0x2db8b3=_0x2db8b3-0x0;var _0x373cf4=_0x3cfb[_0x2db8b3];return _0x373cf4;};'use strict';var client=require(_0xb3cf('0x0'));exports[_0xb3cf('0x1')]=function(){return client[_0xb3cf('0x2')](_0xb3cf('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb3cf('0x4')]},'log':_0xb3cf('0x5')});}; \ No newline at end of file +var _0x6170=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x132a5e,_0x41db37){var _0x2466b6=function(_0x40ec64){while(--_0x40ec64){_0x132a5e['push'](_0x132a5e['shift']());}};_0x2466b6(++_0x41db37);}(_0x6170,0x17d));var _0x0617=function(_0x129282,_0x5ee9b7){_0x129282=_0x129282-0x0;var _0x2bf691=_0x6170[_0x129282];return _0x2bf691;};'use strict';var client=require(_0x0617('0x0'));exports[_0x0617('0x1')]=function(){return client[_0x0617('0x2')](_0x0617('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x0617('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 2a10b97..937f068 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 _0x27bd=['../client','Request','GetTemplate','name','html'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x27bd,0x136));var _0xd27b=function(_0x3c02e4,_0x3cfff4){_0x3c02e4=_0x3c02e4-0x0;var _0x333e04=_0x27bd[_0x3c02e4];return _0x333e04;};'use strict';var client=require(_0xd27b('0x0'));exports['getTemplates']=function(_0x251320){return function(_0xec999c){return client[_0xd27b('0x1')](_0xd27b('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd27b('0x3'),_0xd27b('0x4')]},'log':_0xd27b('0x2')});};}; \ No newline at end of file +var _0x004d=['name','html','getTemplates','Request','GetTemplate'];(function(_0x3b47c8,_0x2bc955){var _0x5b6098=function(_0x5efd21){while(--_0x5efd21){_0x3b47c8['push'](_0x3b47c8['shift']());}};_0x5b6098(++_0x2bc955);}(_0x004d,0x183));var _0xd004=function(_0xd3da26,_0x330054){_0xd3da26=_0xd3da26-0x0;var _0x36399d=_0x004d[_0xd3da26];return _0x36399d;};'use strict';var client=require('../client');exports[_0xd004('0x0')]=function(_0x4f0af6){return function(_0x17e916){return client[_0xd004('0x1')](_0xd004('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd004('0x3'),_0xd004('0x4')]},'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 029be54..3095545 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 _0x645c=['data4','data5','data6','data7','../client','Request','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','operator','action','data1','data2','data3'];(function(_0x5471a2,_0x41a295){var _0x35dc28=function(_0x35593b){while(--_0x35593b){_0x5471a2['push'](_0x5471a2['shift']());}};_0x35dc28(++_0x41a295);}(_0x645c,0x121));var _0xc645=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x645c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc645('0x0'));exports['getTriggers']=function(_0x54a1dd){return function(_0x1eb833){return client[_0xc645('0x1')](_0xc645('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc645('0x3'),_0xc645('0x4')],'include':[{'model':_0xc645('0x5'),'as':_0xc645('0x6'),'attributes':['id',_0xc645('0x7'),'operator',_0xc645('0x8')]},{'model':_0xc645('0x5'),'as':_0xc645('0x9'),'attributes':['id',_0xc645('0x7'),_0xc645('0xa'),_0xc645('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0xc645('0xb'),_0xc645('0xc'),_0xc645('0xd'),_0xc645('0xe'),_0xc645('0xf'),_0xc645('0x10'),_0xc645('0x11'),_0xc645('0x12')]}]},'log':_0xc645('0x2')});};}; \ No newline at end of file +var _0xdf90=['GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Actions','action','data1','data2','data3','data4','data6','data7','../client','getTriggers','Request'];(function(_0x33e452,_0x4c118a){var _0x3ff09e=function(_0x11fa51){while(--_0x11fa51){_0x33e452['push'](_0x33e452['shift']());}};_0x3ff09e(++_0x4c118a);}(_0xdf90,0xd9));var _0x0df9=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xdf90[_0x281e5e];return _0x5a22d2;};'use strict';var client=require(_0x0df9('0x0'));exports[_0x0df9('0x1')]=function(_0x1d744a){return function(_0x537c52){return client[_0x0df9('0x2')](_0x0df9('0x3'),{'options':{'raw':![],'attributes':['id',_0x0df9('0x4'),_0x0df9('0x5'),'status'],'include':[{'model':_0x0df9('0x6'),'as':_0x0df9('0x7'),'attributes':['id','field',_0x0df9('0x8'),_0x0df9('0x9')]},{'model':'Condition','as':_0x0df9('0xa'),'attributes':['id',_0x0df9('0xb'),_0x0df9('0x8'),'value']},{'model':'Action','as':_0x0df9('0xc'),'attributes':['id',_0x0df9('0xd'),_0x0df9('0xe'),_0x0df9('0xf'),_0x0df9('0x10'),_0x0df9('0x11'),'data5',_0x0df9('0x12'),_0x0df9('0x13')]}]},'log':_0x0df9('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a47cb74..7b42d59 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 _0xbbcb=['../client','getTrunks','Request','GetTrunk','registry','defaultuser'];(function(_0x138a3e,_0x2fe2d5){var _0x91b574=function(_0x2eaa7c){while(--_0x2eaa7c){_0x138a3e['push'](_0x138a3e['shift']());}};_0x91b574(++_0x2fe2d5);}(_0xbbcb,0x16e));var _0xbbbc=function(_0x2d68fb,_0x3c6ae8){_0x2d68fb=_0x2d68fb-0x0;var _0x2fa094=_0xbbcb[_0x2d68fb];return _0x2fa094;};'use strict';var client=require(_0xbbbc('0x0'));exports[_0xbbbc('0x1')]=function(_0x46df8d){return function(_0x3b549d){return client[_0xbbbc('0x2')](_0xbbbc('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xbbbc('0x4'),_0xbbbc('0x5')]},'log':_0xbbbc('0x3')});};}; \ No newline at end of file +var _0x89f7=['name','defaultuser','GetTrunk','../client','getTrunks','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89f7,0x105));var _0x789f=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0x89f7[_0x2afb44];return _0x15ccc2;};'use strict';var client=require(_0x789f('0x0'));exports[_0x789f('0x1')]=function(_0x29c2db){return function(_0x4b81a3){return client[_0x789f('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x789f('0x3'),'registry',_0x789f('0x4')]},'log':_0x789f('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d25e060..ce90809 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe706,0xa3));var _0x6e70=function(_0xbb5075,_0x50d7f5){_0xbb5075=_0xbb5075-0x0;var _0x902d8=_0xe706[_0xbb5075];return _0x902d8;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x451f24,_0x5361fa){var _0xdffc6=function(_0x253910){while(--_0x253910){_0x451f24['push'](_0x451f24['shift']());}};_0xdffc6(++_0x5361fa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xcb91[_0x34df4a];return _0x145c69;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9594776..60f6f81 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 _0x196c=['../client','create','Request','CreateVoiceAgentReport'];(function(_0x1e30f3,_0x153ccd){var _0x423534=function(_0x4ea6a1){while(--_0x4ea6a1){_0x1e30f3['push'](_0x1e30f3['shift']());}};_0x423534(++_0x153ccd);}(_0x196c,0x148));var _0xc196=function(_0x613e93,_0x3e5c98){_0x613e93=_0x613e93-0x0;var _0x502e8d=_0x196c[_0x613e93];return _0x502e8d;};'use strict';var client=require(_0xc196('0x0'));exports[_0xc196('0x1')]=function(_0x2bcb5c){return client[_0xc196('0x2')](_0xc196('0x3'),{'body':_0x2bcb5c,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x5d3a61,_0x21675a,_0x2eb280){return client[_0xc196('0x2')]('UpdateVoiceAgentReport',{'body':_0x5d3a61,'options':{'where':{'uniqueid':_0x21675a,'interface':_0x2eb280,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xe0a6=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0xe0a6,0xe0));var _0x6e0a=function(_0x4696de,_0x2e6c2b){_0x4696de=_0x4696de-0x0;var _0x3b99ee=_0xe0a6[_0x4696de];return _0x3b99ee;};'use strict';var client=require(_0x6e0a('0x0'));exports[_0x6e0a('0x1')]=function(_0x1542c8){return client[_0x6e0a('0x2')]('CreateVoiceAgentReport',{'body':_0x1542c8,'log':_0x6e0a('0x3')});};exports[_0x6e0a('0x4')]=function(_0x4b8b3c,_0x25f104,_0x151f97){return client[_0x6e0a('0x2')](_0x6e0a('0x5'),{'body':_0x4b8b3c,'options':{'where':{'uniqueid':_0x25f104,'interface':_0x151f97,'agentcomplete':!![]}},'log':_0x6e0a('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 4e301fa..7c8d827 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 _0xb44a=['CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','moment','util','lodash','../client','create','Request'];(function(_0x4152c0,_0x276353){var _0x4c4f34=function(_0x592150){while(--_0x592150){_0x4152c0['push'](_0x4152c0['shift']());}};_0x4c4f34(++_0x276353);}(_0xb44a,0x118));var _0xab44=function(_0x59f7b8,_0xb2ac21){_0x59f7b8=_0x59f7b8-0x0;var _0x7b28c5=_0xb44a[_0x59f7b8];return _0x7b28c5;};'use strict';var moment=require(_0xab44('0x0'));var util=require(_0xab44('0x1'));var _=require(_0xab44('0x2'));var client=require(_0xab44('0x3'));exports[_0xab44('0x4')]=function(_0x528423){return client[_0xab44('0x5')](_0xab44('0x6'),{'body':_[_0xab44('0x7')](_0x528423,{'source':_0x528423[_0xab44('0x8')],'destinationcontext':_0x528423[_0xab44('0x9')],'callerid':_0x528423[_0xab44('0xa')],'amaflags':_0xab44('0xb')}),'log':_0xab44('0x6')});};exports[_0xab44('0xc')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xab44('0xd')],'createdAt':{'$between':[moment()[_0xab44('0xe')](_0xab44('0xf'))[_0xab44('0x10')](_0xab44('0x11')),moment()[_0xab44('0x12')](_0xab44('0xf'))[_0xab44('0x10')](_0xab44('0x11'))]}},'attributes':[_0xab44('0x13'),_0xab44('0x14'),'duration',_0xab44('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xa671=['calleridnum','context','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa671,0x174));var _0x1a67=function(_0x59db0f,_0x466ec8){_0x59db0f=_0x59db0f-0x0;var _0x2d3a0c=_0xa671[_0x59db0f];return _0x2d3a0c;};'use strict';var moment=require(_0x1a67('0x0'));var util=require(_0x1a67('0x1'));var _=require(_0x1a67('0x2'));var client=require(_0x1a67('0x3'));exports[_0x1a67('0x4')]=function(_0x2126fc){return client[_0x1a67('0x5')](_0x1a67('0x6'),{'body':_[_0x1a67('0x7')](_0x2126fc,{'source':_0x2126fc[_0x1a67('0x8')],'destinationcontext':_0x2126fc[_0x1a67('0x9')],'callerid':_0x2126fc['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x1a67('0xa')]=function(){return function(){return client[_0x1a67('0x5')](_0x1a67('0xb'),{'options':{'where':{'type':[_0x1a67('0xc')],'createdAt':{'$between':[moment()[_0x1a67('0xd')](_0x1a67('0xe'))[_0x1a67('0xf')](_0x1a67('0x10')),moment()[_0x1a67('0x11')](_0x1a67('0xe'))[_0x1a67('0xf')](_0x1a67('0x10'))]}},'attributes':['type','disposition',_0x1a67('0x12'),_0x1a67('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index a98d188..fc541da 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 _0x5c8e=['CreateVoiceDialReport','create','Request'];(function(_0x4a6496,_0x1d022e){var _0x399a44=function(_0x1179bc){while(--_0x1179bc){_0x4a6496['push'](_0x4a6496['shift']());}};_0x399a44(++_0x1d022e);}(_0x5c8e,0x14b));var _0xe5c8=function(_0x3051be,_0x5b8404){_0x3051be=_0x3051be-0x0;var _0x127126=_0x5c8e[_0x3051be];return _0x127126;};'use strict';var client=require('../client');exports[_0xe5c8('0x0')]=function(_0x29a4a6){return client[_0xe5c8('0x1')](_0xe5c8('0x2'),{'body':_0x29a4a6,'log':_0xe5c8('0x2')});}; \ No newline at end of file +var _0x56f3=['Request','CreateVoiceDialReport','../client','create'];(function(_0x5ca0b3,_0x33f5ef){var _0x6ba806=function(_0x58b844){while(--_0x58b844){_0x5ca0b3['push'](_0x5ca0b3['shift']());}};_0x6ba806(++_0x33f5ef);}(_0x56f3,0x18a));var _0x356f=function(_0x52168f,_0x506c37){_0x52168f=_0x52168f-0x0;var _0x4cb7b3=_0x56f3[_0x52168f];return _0x4cb7b3;};'use strict';var client=require(_0x356f('0x0'));exports[_0x356f('0x1')]=function(_0x4be13a){return client[_0x356f('0x2')](_0x356f('0x3'),{'body':_0x4be13a,'log':_0x356f('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index dc74b99..ae95335 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 _0xc964=['recordingFormat','../client','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x2b4131,_0x22c00d){var _0x13bc6e=function(_0x3b1023){while(--_0x3b1023){_0x2b4131['push'](_0x2b4131['shift']());}};_0x13bc6e(++_0x22c00d);}(_0xc964,0x7e));var _0x4c96=function(_0x248b82,_0x342222){_0x248b82=_0x248b82-0x0;var _0x4d306f=_0xc964[_0x248b82];return _0x4d306f;};'use strict';var client=require(_0x4c96('0x0'));exports[_0x4c96('0x1')]=function(){return function(){return client['Request'](_0x4c96('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4c96('0x3'),_0x4c96('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xfc4c=['exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x1af745,_0xf13124){var _0x44f0bd=function(_0x13c9d6){while(--_0x13c9d6){_0x1af745['push'](_0x1af745['shift']());}};_0x44f0bd(++_0xf13124);}(_0xfc4c,0xca));var _0xcfc4=function(_0x582f3c,_0x419e11){_0x582f3c=_0x582f3c-0x0;var _0x43f906=_0xfc4c[_0x582f3c];return _0x43f906;};'use strict';var client=require(_0xcfc4('0x0'));exports[_0xcfc4('0x1')]=function(){return function(){return client[_0xcfc4('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xcfc4('0x3'),_0xcfc4('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xcfc4('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 84e18a8..b8d4353 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 _0x9477=['dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9477,0xca));var _0x7947=function(_0x3a9309,_0x2cec81){_0x3a9309=_0x3a9309-0x0;var _0x5b95a3=_0x9477[_0x3a9309];return _0x5b95a3;};'use strict';var client=require(_0x7947('0x0'));exports[_0x7947('0x1')]=function(){return function(){return client[_0x7947('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x7947('0x3'),_0x7947('0x4'),_0x7947('0x5'),_0x7947('0x6'),'monitor_format',_0x7947('0x7'),_0x7947('0x8'),'dialMethod',_0x7947('0x9'),_0x7947('0xa'),'dialPowerLevel',_0x7947('0xb'),'dialPredictiveOptimizationPercentage',_0x7947('0xc'),_0x7947('0xd'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0x7947('0xe'),_0x7947('0xf'),_0x7947('0x10'),_0x7947('0x11'),_0x7947('0x12'),'dialBusyMaxRetry',_0x7947('0x13'),_0x7947('0x14'),'dialNoAnswerRetryFrequency',_0x7947('0x15'),'dialTimezone',_0x7947('0x16'),_0x7947('0x17'),'dialCheckDuplicateType','dialAMDActive',_0x7947('0x18'),'dialAMDGreeting',_0x7947('0x19'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x7947('0x1a'),_0x7947('0x1b'),_0x7947('0x1c'),_0x7947('0x1d'),_0x7947('0x1e'),_0x7947('0x1f'),_0x7947('0x20'),_0x7947('0x21'),_0x7947('0x22'),_0x7947('0x23'),_0x7947('0x24'),_0x7947('0x25'),_0x7947('0x26'),_0x7947('0x27'),_0x7947('0x28'),'dialNoSuchNumberRetryFrequency',_0x7947('0x29'),'dialDropRetryFrequency',_0x7947('0x2a'),_0x7947('0x2b'),_0x7947('0x2c'),'dialMachineRetryFrequency',_0x7947('0x2d'),_0x7947('0x2e'),_0x7947('0x2f'),_0x7947('0x30'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x7947('0x31'),'as':'Trunk','attributes':['id','name',_0x7947('0x32'),_0x7947('0x33')]},{'model':_0x7947('0x34'),'as':_0x7947('0x35'),'attributes':['id','name']},{'model':_0x7947('0x31'),'as':'TrunkBackup','attributes':['id',_0x7947('0x3'),'callerid',_0x7947('0x33')]},{'model':_0x7947('0x36'),'as':_0x7947('0x36'),'attributes':['id',_0x7947('0x3')],'include':[{'model':_0x7947('0x36'),'as':_0x7947('0x37'),'attributes':['id',_0x7947('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x9082=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency'];(function(_0x24cf7f,_0xcda231){var _0x4c6742=function(_0x2469db){while(--_0x2469db){_0x24cf7f['push'](_0x24cf7f['shift']());}};_0x4c6742(++_0xcda231);}(_0x9082,0x90));var _0x2908=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x9082[_0x754ab4];return _0x34079a;};'use strict';var client=require(_0x2908('0x0'));exports[_0x2908('0x1')]=function(){return function(){return client[_0x2908('0x2')](_0x2908('0x3'),{'options':{'raw':![],'attributes':['id',_0x2908('0x4'),_0x2908('0x5'),_0x2908('0x6'),_0x2908('0x7'),_0x2908('0x8'),_0x2908('0x9'),_0x2908('0xa'),_0x2908('0xb'),_0x2908('0xc'),_0x2908('0xd'),_0x2908('0xe'),_0x2908('0xf'),_0x2908('0x10'),_0x2908('0x11'),_0x2908('0x12'),_0x2908('0x13'),_0x2908('0x14'),_0x2908('0x15'),_0x2908('0x16'),'dialQueueProject',_0x2908('0x17'),_0x2908('0x18'),_0x2908('0x19'),_0x2908('0x1a'),_0x2908('0x1b'),_0x2908('0x1c'),'dialGlobalMaxRetry','dialTimezone',_0x2908('0x1d'),'dialPrefix',_0x2908('0x1e'),_0x2908('0x1f'),_0x2908('0x20'),_0x2908('0x21'),'dialAMDAfterGreetingSilence',_0x2908('0x22'),_0x2908('0x23'),_0x2908('0x24'),_0x2908('0x25'),_0x2908('0x26'),_0x2908('0x27'),_0x2908('0x28'),_0x2908('0x29'),_0x2908('0x2a'),_0x2908('0x2b'),_0x2908('0x2c'),'dialAgiAfterHangupClient',_0x2908('0x2d'),_0x2908('0x8'),_0x2908('0x2e'),_0x2908('0x2f'),_0x2908('0x30'),'dialNoSuchNumberMaxRetry',_0x2908('0x31'),'dialDropMaxRetry',_0x2908('0x32'),_0x2908('0x33'),_0x2908('0x34'),'dialMachineMaxRetry',_0x2908('0x35'),'dialAgentRejectMaxRetry',_0x2908('0x36'),_0x2908('0x37'),_0x2908('0x38'),_0x2908('0x39')],'include':[{'model':_0x2908('0x3a'),'as':_0x2908('0x3a'),'attributes':['id',_0x2908('0x4'),'callerid',_0x2908('0x3b')]},{'model':'Pause','as':_0x2908('0x3c'),'attributes':['id',_0x2908('0x4')]},{'model':'Trunk','as':_0x2908('0x3d'),'attributes':['id','name',_0x2908('0x3e'),_0x2908('0x3b')]},{'model':_0x2908('0x3f'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0x2908('0x3f'),'as':_0x2908('0x40'),'attributes':['id',_0x2908('0x4'),'interval']}]}]},'log':_0x2908('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 9f97eb5..ef25e34 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(_0x53dce8,_0x10d77d){var _0x395bf1=function(_0x522523){while(--_0x522523){_0x53dce8['push'](_0x53dce8['shift']());}};_0x395bf1(++_0x10d77d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x4c2ddb,_0xffdb9c){var _0x2c2dcb=function(_0x4c5018){while(--_0x4c5018){_0x4c2ddb['push'](_0x4c2ddb['shift']());}};_0x2c2dcb(++_0xffdb9c);}(_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 10de56d..9efbde7 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 _0x2af2=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x3160d2,_0x55eac2){var _0x48004d=function(_0xf4451e){while(--_0xf4451e){_0x3160d2['push'](_0x3160d2['shift']());}};_0x48004d(++_0x55eac2);}(_0x2af2,0x1bb));var _0x22af=function(_0x582340,_0x4c1302){_0x582340=_0x582340-0x0;var _0x4b2ec8=_0x2af2[_0x582340];return _0x4b2ec8;};'use strict';var client=require(_0x22af('0x0'));exports[_0x22af('0x1')]=function(_0x29732c){return function(){return client[_0x22af('0x2')](_0x22af('0x3'),{'options':{'where':{'VoiceQueueId':_0x29732c,'paused':!![]},'raw':!![]},'log':_0x22af('0x1')});};}; \ No newline at end of file +var _0xd71e=['../client','GetVoiceQueueRtPauses'];(function(_0x410eb1,_0x591850){var _0x532094=function(_0x1c8737){while(--_0x1c8737){_0x410eb1['push'](_0x410eb1['shift']());}};_0x532094(++_0x591850);}(_0xd71e,0x8a));var _0xed71=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xd71e[_0x2aec52];return _0x3b8835;};'use strict';var client=require(_0xed71('0x0'));exports['getVoiceQueueRtPauses']=function(_0x178129){return function(){return client['Request'](_0xed71('0x1'),{'options':{'where':{'VoiceQueueId':_0x178129,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 413bdba..e7d2c1a 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x237034,_0x5e1ca3){var _0x2a1abf=function(_0x59f1ac){while(--_0x59f1ac){_0x237034['push'](_0x237034['shift']());}};_0x2a1abf(++_0x5e1ca3);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5be1c1,_0x194bb7){var _0x634001=function(_0x3679a7){while(--_0x3679a7){_0x5be1c1['push'](_0x5be1c1['shift']());}};_0x634001(++_0x194bb7);}(_0x7a54,0x106));var _0x47a5=function(_0x593d09,_0x1c4090){_0x593d09=_0x593d09-0x0;var _0x48808b=_0x7a54[_0x593d09];return _0x48808b;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 5d9f875..86cc429 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 _0x353b=['transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode'];(function(_0x37e642,_0xe1f8ba){var _0x19abe1=function(_0x25c4e3){while(--_0x25c4e3){_0x37e642['push'](_0x37e642['shift']());}};_0x19abe1(++_0xe1f8ba);}(_0x353b,0xbf));var _0xb353=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0x353b[_0x25bca6];return _0x3f8d02;};'use strict';var client=require(_0xb353('0x0'));exports[_0xb353('0x1')]={};exports['blindTransfer']=function(_0x341642){return client['Request'](_0xb353('0x2'),{'body':{'result':_0x341642[_0xb353('0x3')],'transfererchannel':_0x341642[_0xb353('0x4')],'transferercalleridnum':_0x341642[_0xb353('0x5')],'transferercalleridname':_0x341642[_0xb353('0x6')],'transfererconnectedlinenum':_0x341642[_0xb353('0x7')],'transfererconnectedlinename':_0x341642['transfererconnectedlinename'],'transfereraccountcode':_0x341642[_0xb353('0x8')],'transferercontext':_0x341642[_0xb353('0x9')],'transfererexten':_0x341642['transfererexten'],'transfererlinkedid':_0x341642[_0xb353('0xa')],'transfereechannel':_0x341642[_0xb353('0xb')],'transfereecalleridnum':_0x341642[_0xb353('0xc')],'transfereecalleridname':_0x341642[_0xb353('0xd')],'transfereeconnectedlinenum':_0x341642[_0xb353('0xe')],'transfereeconnectedlinename':_0x341642[_0xb353('0xf')],'transfereeaccountcode':_0x341642['transfereeaccountcode'],'transfereecontext':_0x341642[_0xb353('0x10')],'transfereeexten':_0x341642[_0xb353('0x11')],'transfereelinkedid':_0x341642[_0xb353('0x12')],'isexternal':_0x341642['isexternal'],'context':_0x341642[_0xb353('0x13')],'extension':_0x341642['extension'],'type':_0xb353('0x14')},'log':_0xb353('0x2')});};exports[_0xb353('0x15')]=function(_0x2fbdef){return client[_0xb353('0x16')](_0xb353('0x2'),{'body':{'result':_0x2fbdef[_0xb353('0x3')],'transfererchannel':_0x2fbdef[_0xb353('0x17')],'transferercalleridnum':_0x2fbdef[_0xb353('0x18')],'transferercalleridname':_0x2fbdef[_0xb353('0x19')],'transfererconnectedlinenum':_0x2fbdef['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2fbdef[_0xb353('0x1a')],'transfereraccountcode':_0x2fbdef['origtransfereraccountcode'],'transferercontext':_0x2fbdef[_0xb353('0x1b')],'transfererexten':_0x2fbdef[_0xb353('0x1c')],'transfererlinkedid':_0x2fbdef[_0xb353('0x1d')],'transfereechannel':_0x2fbdef[_0xb353('0x1e')],'transfereecalleridnum':_0x2fbdef[_0xb353('0x1f')],'transfereecalleridname':_0x2fbdef['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2fbdef['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2fbdef[_0xb353('0x20')],'transfereeaccountcode':_0x2fbdef[_0xb353('0x21')],'transfereecontext':_0x2fbdef[_0xb353('0x22')],'transfereeexten':_0x2fbdef['transfertargetexten'],'transfereelinkedid':_0x2fbdef[_0xb353('0x23')],'isexternal':_0x2fbdef[_0xb353('0x24')],'context':_0x2fbdef[_0xb353('0x25')],'extension':_0x2fbdef[_0xb353('0x26')],'type':_0xb353('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x4cd7=['transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum'];(function(_0x34b02a,_0xc897da){var _0x393178=function(_0x465fbf){while(--_0x465fbf){_0x34b02a['push'](_0x34b02a['shift']());}};_0x393178(++_0xc897da);}(_0x4cd7,0x150));var _0x74cd=function(_0x33b290,_0x559058){_0x33b290=_0x33b290-0x0;var _0x5aec22=_0x4cd7[_0x33b290];return _0x5aec22;};'use strict';var client=require(_0x74cd('0x0'));exports[_0x74cd('0x1')]={};exports[_0x74cd('0x2')]=function(_0x170535){return client[_0x74cd('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x170535['result'],'transfererchannel':_0x170535[_0x74cd('0x4')],'transferercalleridnum':_0x170535[_0x74cd('0x5')],'transferercalleridname':_0x170535['transferercalleridname'],'transfererconnectedlinenum':_0x170535[_0x74cd('0x6')],'transfererconnectedlinename':_0x170535['transfererconnectedlinename'],'transfereraccountcode':_0x170535[_0x74cd('0x7')],'transferercontext':_0x170535[_0x74cd('0x8')],'transfererexten':_0x170535[_0x74cd('0x9')],'transfererlinkedid':_0x170535[_0x74cd('0xa')],'transfereechannel':_0x170535[_0x74cd('0xb')],'transfereecalleridnum':_0x170535[_0x74cd('0xc')],'transfereecalleridname':_0x170535[_0x74cd('0xd')],'transfereeconnectedlinenum':_0x170535[_0x74cd('0xe')],'transfereeconnectedlinename':_0x170535['transfereeconnectedlinename'],'transfereeaccountcode':_0x170535[_0x74cd('0xf')],'transfereecontext':_0x170535['transfereecontext'],'transfereeexten':_0x170535[_0x74cd('0x10')],'transfereelinkedid':_0x170535[_0x74cd('0x11')],'isexternal':_0x170535[_0x74cd('0x12')],'context':_0x170535['context'],'extension':_0x170535[_0x74cd('0x13')],'type':_0x74cd('0x14')},'log':_0x74cd('0x15')});};exports[_0x74cd('0x16')]=function(_0x64d284){return client[_0x74cd('0x3')](_0x74cd('0x15'),{'body':{'result':_0x64d284[_0x74cd('0x17')],'transfererchannel':_0x64d284[_0x74cd('0x18')],'transferercalleridnum':_0x64d284[_0x74cd('0x19')],'transferercalleridname':_0x64d284['origtransferercalleridname'],'transfererconnectedlinenum':_0x64d284['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x64d284['secondtransfererconnectedlinename'],'transfereraccountcode':_0x64d284[_0x74cd('0x1a')],'transferercontext':_0x64d284[_0x74cd('0x1b')],'transfererexten':_0x64d284[_0x74cd('0x1c')],'transfererlinkedid':_0x64d284[_0x74cd('0x1d')],'transfereechannel':_0x64d284[_0x74cd('0x1e')],'transfereecalleridnum':_0x64d284[_0x74cd('0x1f')],'transfereecalleridname':_0x64d284[_0x74cd('0x20')],'transfereeconnectedlinenum':_0x64d284[_0x74cd('0x21')],'transfereeconnectedlinename':_0x64d284[_0x74cd('0x22')],'transfereeaccountcode':_0x64d284['transfertargetaccountcode'],'transfereecontext':_0x64d284['transfertargetcontext'],'transfereeexten':_0x64d284[_0x74cd('0x23')],'transfereelinkedid':_0x64d284[_0x74cd('0x24')],'isexternal':_0x64d284['isexternal'],'context':_0x64d284[_0x74cd('0x25')],'extension':_0x64d284[_0x74cd('0x26')],'type':'attended'},'log':_0x74cd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 6351cc6..505260f 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 _0x81c6=['startProgressive','Trunk','active','callerid','Interval','omit','undefined','values','channels','join','voicechannel','validate','length','map','find','uniqueid','channel','filename','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','push','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','rec','status','MixMonitor\x20Success','mixmonitorid','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','listen','format','name','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','message','catch','command','Command','then','content','voiceQueues','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive'];(function(_0x4d4723,_0x270ea8){var _0x55f09c=function(_0x11a522){while(--_0x11a522){_0x4d4723['push'](_0x4d4723['shift']());}};_0x55f09c(++_0x270ea8);}(_0x81c6,0x1d5));var _0x681c=function(_0x42d35d,_0x33e6fc){_0x42d35d=_0x42d35d-0x0;var _0x445dbc=_0x81c6[_0x42d35d];return _0x445dbc;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x681c('0x1'));var config=require(_0x681c('0x2'));var properties=require(_0x681c('0x3'));var ami=require('../ami');exports[_0x681c('0x4')]=function(_0x2aff9d,_0x1f2032,_0x1d31c8){return new BPromise(function(_0x4ea522,_0x45331){var _0xdc57a5={'QueuePause':function(_0x5624d7){return new Promise(function(_0x5b5f22,_0x1750e2){var _0x3fac39=util[_0x681c('0x5')]('%s/%s','SIP',_0x5624d7[_0x681c('0x6')]);if(_0x2aff9d['timers']&&_0x2aff9d[_0x681c('0x7')][_0x3fac39]&&_0x2aff9d[_0x681c('0x7')][_0x3fac39][_0x681c('0x8')]){_0x2aff9d[_0x681c('0x7')][_0x3fac39]['updateAcw']();}if(_0x2aff9d['agents'][_0x3fac39]){_0x2aff9d[_0x681c('0x9')][_0x3fac39][_0x681c('0xa')]({'statePause':_0x5624d7[_0x681c('0xb')]?!![]:![]});}_0x5b5f22({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x2e4651){var _0x5263cd=this;return new Promise(function(_0x3cf828,_0x4c3a91){if(ami[_0x681c('0xc')]()==![]){return _0x4c3a91(_0x5263cd[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')][_0x681c('0xf')],_0x681c('0x10')]['join']('\x20')));}_0x2e4651=_[_0x681c('0x11')](_0x2e4651,_[_0x681c('0x12')](properties[_0x681c('0x13')]));_0x2e4651[_0x681c('0x14')]=_0x681c('0x15');return ami[_0x681c('0x16')](_0x2e4651)['then'](function(_0xf3c042){_0x3cf828({'code':0xc8,'message':_0xf3c042[_0x681c('0x17')]});})[_0x681c('0x18')](function(_0x42304f){_0x4c3a91(_0x5263cd['error'](0x1f5,_0x42304f[_0x681c('0x17')]));});});},'Command':function(_0x24a0ce){var _0x54d27f=this;return new Promise(function(_0x161948,_0x4c22c7){if(ami[_0x681c('0xc')]()==![]){return _0x4c22c7(_0x54d27f[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')][_0x681c('0xf')],'ami\x20disconnected']['join']('\x20')));}_0x24a0ce=_['pick'](_0x24a0ce,_0x681c('0x19'));_0x24a0ce[_0x681c('0x14')]=_0x681c('0x1a');return ami[_0x681c('0x16')](_0x24a0ce)[_0x681c('0x1b')](function(_0x29f3fa){_0x161948({'code':0xc8,'message':_0x29f3fa[_0x681c('0x1c')]});})[_0x681c('0x18')](function(_0x1b3d2b){_0x4c22c7(_0x54d27f[_0x681c('0xd')](0x1f5,_0x1b3d2b[_0x681c('0x17')]));});});},'VoiceQueues':function(_0x31c9b9){return new Promise(function(_0x13de03,_0x218410){var _0x3237ed=[];for(var _0x228f59 in _0x2aff9d['voiceQueues']){if(_0x2aff9d[_0x681c('0x1d')]['hasOwnProperty'](_0x228f59)){var _0x5f8d64=_0x2aff9d['voiceQueues'][_0x228f59];var _0x583499={'id':_0x5f8d64['id'],'name':_0x5f8d64[_0x681c('0x6')],'strategy':_0x5f8d64[_0x681c('0x1e')],'answered':_0x5f8d64[_0x681c('0x1f')],'available':_0x5f8d64[_0x681c('0x20')],'loggedIn':_0x5f8d64['loggedIn'],'pTalking':_0x5f8d64[_0x681c('0x21')],'sumBillable':_0x5f8d64[_0x681c('0x22')],'sumDuration':_0x5f8d64[_0x681c('0x23')],'sumHoldTime':_0x5f8d64[_0x681c('0x24')]||0x0,'talking':_0x5f8d64[_0x681c('0x25')],'total':_0x5f8d64[_0x681c('0x26')],'type':_0x5f8d64[_0x681c('0x27')],'unmanaged':_0x5f8d64['unmanaged'],'abandoned':_0x5f8d64[_0x681c('0x28')],'waiting':_0x5f8d64[_0x681c('0x29')],'loggedInDb':_0x5f8d64[_0x681c('0x2a')]};if(_0x5f8d64['type']===_0x681c('0x2b')){_0x583499[_0x681c('0x2c')]=_0x5f8d64[_0x681c('0x2c')];_0x583499['dialMethod']=_0x5f8d64[_0x681c('0x2d')];_0x583499['dialOriginateCallerIdName']=_0x5f8d64['dialOriginateCallerIdName'];_0x583499[_0x681c('0x2e')]=_0x5f8d64[_0x681c('0x2e')];_0x583499[_0x681c('0x2f')]=_0x5f8d64['dialOriginateTimeout'];_0x583499[_0x681c('0x30')]=_0x5f8d64['dialPrefix'];_0x583499[_0x681c('0x31')]=_0x5f8d64['temp'];_0x583499['outboundAnswerAgiCallsDay']=_0x5f8d64['outboundAnswerAgiCallsDay'];_0x583499[_0x681c('0x32')]=_0x5f8d64[_0x681c('0x32')];_0x583499['outboundBlacklistCallsDay']=_0x5f8d64[_0x681c('0x33')];_0x583499['outboundBusyCallsDay']=_0x5f8d64['outboundBusyCallsDay'];_0x583499[_0x681c('0x34')]=_0x5f8d64['outboundCongestionCallsDay'];_0x583499[_0x681c('0x35')]=_0x5f8d64[_0x681c('0x35')];_0x583499[_0x681c('0x36')]=_0x5f8d64['outboundDropCallsDayCallersExit'];_0x583499['outboundDropCallsDayTimeout']=_0x5f8d64[_0x681c('0x37')];_0x583499[_0x681c('0x38')]=_0x5f8d64['outboundNoAnswerCallsDay'];_0x583499[_0x681c('0x39')]=_0x5f8d64[_0x681c('0x39')];_0x583499[_0x681c('0x3a')]=_0x5f8d64['outboundOriginateFailureCallsDay'];_0x583499[_0x681c('0x3b')]=_0x5f8d64[_0x681c('0x3b')];_0x583499['outboundRejectCallsDay']=_0x5f8d64[_0x681c('0x3c')];_0x583499[_0x681c('0x3d')]=_0x5f8d64[_0x681c('0x3d')];_0x583499[_0x681c('0x3e')]=_0x5f8d64[_0x681c('0x3e')];_0x583499['predictiveIntervalAvgHoldtime']=_0x5f8d64['predictiveIntervalAvgHoldtime'];_0x583499[_0x681c('0x3f')]=_0x5f8d64[_0x681c('0x3f')];_0x583499['predictiveIntervalDroppedCallsCallersExit']=_0x5f8d64[_0x681c('0x40')];_0x583499[_0x681c('0x41')]=_0x5f8d64['predictiveIntervalDroppedCallsTimeout'];_0x583499[_0x681c('0x42')]=_0x5f8d64[_0x681c('0x42')];_0x583499[_0x681c('0x43')]=_0x5f8d64[_0x681c('0x43')];_0x583499[_0x681c('0x44')]=_0x5f8d64[_0x681c('0x44')];_0x583499[_0x681c('0x45')]=_0x5f8d64[_0x681c('0x45')];_0x583499[_0x681c('0x46')]=_0x5f8d64[_0x681c('0x46')];_0x583499['predictiveIntervalAvailable']=_0x5f8d64[_0x681c('0x47')];_0x583499[_0x681c('0x48')]=_0x5f8d64[_0x681c('0x48')];_0x583499[_0x681c('0x17')]=_0x5f8d64[_0x681c('0x17')];_0x583499[_0x681c('0x49')]=_0x5f8d64[_0x681c('0x49')];_0x583499[_0x681c('0x4a')]=_0x5f8d64[_0x681c('0x4a')];_0x583499[_0x681c('0x4b')]=_0x5f8d64[_0x681c('0x4b')];_0x583499[_0x681c('0x4c')]=_0x5f8d64['erlangAbandonmentRate'];_0x583499[_0x681c('0x4d')]=_0x5f8d64['erlangBusyFactor'];_0x583499['startPredictive']=_0x5f8d64[_0x681c('0x4e')];_0x583499[_0x681c('0x4f')]=_0x5f8d64[_0x681c('0x4f')];}if(_0x5f8d64[_0x681c('0x50')]){_0x583499['Trunk']={'id':_0x5f8d64[_0x681c('0x50')]['id'],'name':_0x5f8d64['Trunk']['name'],'active':_0x5f8d64[_0x681c('0x50')][_0x681c('0x51')],'callerid':_0x5f8d64[_0x681c('0x50')][_0x681c('0x52')]};}if(_0x5f8d64[_0x681c('0x53')]){_0x583499[_0x681c('0x53')]={'id':_0x5f8d64['Interval']['id'],'name':_0x5f8d64[_0x681c('0x53')][_0x681c('0x6')]};}_0x3237ed['push'](_0x583499);}}_0x13de03({'count':_0x3237ed['length'],'rows':_0x3237ed});});},'UpdateVoiceQueue':function(_0x75da91){return new Promise(function(_0x57d539,_0x2cd770){var _0x487257=_['find'](_0x2aff9d['voiceQueues'],{'id':parseInt(_0x75da91['id'])});var _0x28d62d=_[_0x681c('0x54')](_0x75da91,['id']);if(_0x487257){for(var _0x8043a9 in _0x28d62d){if(typeof _0x28d62d[_0x8043a9]!=='undefined'&&typeof _0x487257[_0x8043a9]!==_0x681c('0x55')){_0x487257[_0x8043a9]=_0x28d62d[_0x8043a9];}}_0x57d539(_0x487257);}else{_0x2cd770();}});},'VoiceChannels':function(_0x2e940b){return new Promise(function(_0x5e0a54,_0x449c8b){var _0x17bb48=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x57')]);_0x5e0a54({'count':_0x17bb48['length'],'rows':_0x17bb48});});},'VoiceChannelMixMonitor':function(_0x3b9fd1){var _0x598e95=this;return new Promise(function(_0x1b3c07,_0x29141d){if(ami[_0x681c('0xc')]()==![]){return _0x29141d(_0x598e95['error'](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')][_0x681c('0xf')],_0x681c('0x10')][_0x681c('0x58')]('\x20')));}var _0x1351e9=schema(properties[_0x681c('0x59')])[_0x681c('0x5a')](_0x3b9fd1);if(_0x1351e9[_0x681c('0x5b')]>0x0){return _0x29141d(_0x598e95[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x1351e9,_0x681c('0x17'))[_0x681c('0x58')](',\x20')));}var _0x6e2f5=_[_0x681c('0x5d')](_0x2aff9d['channels'],{'uniqueid':_0x3b9fd1[_0x681c('0x5e')]});if(_0x6e2f5&&_0x6e2f5[_0x681c('0x5f')]){var _0x5ae525=util[_0x681c('0x5')]('%s.%s',_0x3b9fd1[_0x681c('0x60')]||_0x3b9fd1[_0x681c('0x5e')],_0x3b9fd1[_0x681c('0x5')]||'wav');return ami[_0x681c('0x16')]({'action':_0x681c('0x61'),'channel':_0x6e2f5['channel'],'file':_0x5ae525,'options':_0x681c('0x62')})['then'](function(_0x208c91){var _0x50452e=_[_0x681c('0x5d')](_0x6e2f5[_0x681c('0x63')],{'filename':'/var/spool/asterisk/monitor/'+_0x5ae525[_0x681c('0x64')]()});if(_['isNil'](_0x50452e)){_0x6e2f5['monitors'][_0x681c('0x65')]({'filename':_0x681c('0x66')+_0x5ae525[_0x681c('0x64')](),'createdAt':moment()['format'](_0x681c('0x67')),'mixmonitorid':_0x208c91['mixmonitorid'],'status':_0x681c('0x68')});}else{_0x50452e['mixmonitorid']=_0x208c91['mixmonitorid'];_0x50452e[_0x681c('0x69')]=_0x681c('0x68');}_0x1b3c07({'code':0xc8,'message':[_0x3b9fd1[_0x681c('0x5e')],_0x681c('0x6a'),_0x208c91['mixmonitorid']][_0x681c('0x58')]('\x20'),'mixmonitorid':_0x208c91[_0x681c('0x6b')]});})[_0x681c('0x18')](function(_0x44276c){_0x29141d(_0x598e95[_0x681c('0xd')](0x1f5,[_0x3b9fd1['uniqueid'],_0x44276c[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x29141d(_0x598e95[_0x681c('0xd')](0x1f5,_0x681c('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x2d4876){var _0x13ae02=this;return new Promise(function(_0x136246,_0x23e73e){if(ami[_0x681c('0xc')]()==![]){return _0x23e73e(_0x13ae02[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config['asterisk'][_0x681c('0xf')],_0x681c('0x10')][_0x681c('0x58')]('\x20')));}var _0x2fae66=schema(properties[_0x681c('0x59')])['validate'](_0x2d4876);if(_0x2fae66[_0x681c('0x5b')]>0x0){return _0x23e73e(_0x13ae02['error'](0x1f4,_['map'](_0x2fae66,_0x681c('0x17'))[_0x681c('0x58')](',\x20')));}var _0x57f707=_[_0x681c('0x5d')](_0x2aff9d[_0x681c('0x57')],{'uniqueid':_0x2d4876[_0x681c('0x5e')]});if(_0x57f707){return BPromise[_0x681c('0x6d')]()['then'](function(){if(_0x57f707[_0x681c('0x5f')]){return ami[_0x681c('0x16')]({'action':_0x681c('0x6e'),'channel':_0x57f707[_0x681c('0x5f')],'mixmonitorid':_0x2d4876['mixmonitorid']})[_0x681c('0x18')](function(_0x145441){});}})[_0x681c('0x1b')](function(){if(_0x57f707['destinationchannel']){return ami['Action']({'action':_0x681c('0x6e'),'channel':_0x57f707[_0x681c('0x6f')],'mixmonitorid':_0x2d4876['mixmonitorid']})[_0x681c('0x18')](function(_0x3d2a41){});}})[_0x681c('0x1b')](function(_0x27fae3){var _0xde562e=_['find'](_0x57f707[_0x681c('0x63')],{'mixmonitorid':_0x2d4876[_0x681c('0x6b')]});if(_0xde562e){_0xde562e[_0x681c('0x69')]=_0x681c('0x70');}})['then'](function(){var _0x2d6918=util[_0x681c('0x5')](_0x681c('0x71'),_0x2d4876[_0x681c('0x60')]||_0x2d4876[_0x681c('0x5e')],_0x2d4876['format']||_0x681c('0x72'));var _0x21c770=_['find'](_0x57f707['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x2d6918[_0x681c('0x64')]()});if(_0x21c770){_0x21c770['status']=_0x681c('0x70');}})[_0x681c('0x1b')](function(){_0x136246({'code':0xc8,'message':[_0x2d4876[_0x681c('0x5e')],_0x681c('0x73')][_0x681c('0x58')]('\x20')});})['catch'](function(_0x3b3ba6){_0x23e73e(_0x13ae02['error'](0x1f5,[_0x2d4876['uniqueid'],_0x3b3ba6[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x23e73e(_0x13ae02['error'](0x1f5,_0x681c('0x6c')));}});},'VoiceQueuesChannels':function(_0x24c8e7){return new Promise(function(_0x77ba54,_0x5c05b6){var _0x93c148=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x74')]);_0x77ba54({'count':_0x93c148[_0x681c('0x5b')],'rows':_0x93c148});});},'VoiceQueuesChannel':function(_0x33a3ff){var _0x3bd2a0=this;return new Promise(function(_0x12c697,_0x56e77d){var _0x51d6a6=schema(properties[_0x681c('0x75')])[_0x681c('0x5a')](_0x33a3ff);if(_0x51d6a6[_0x681c('0x5b')]>0x0){return _0x56e77d(_0x3bd2a0[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x51d6a6,_0x681c('0x17'))['join'](',\x20')));}var _0x39a13d=_[_0x681c('0x5d')](_0x2aff9d['queueChannels'],{'uniqueid':_0x33a3ff[_0x681c('0x5e')]});if(_0x39a13d){_0x12c697(_0x39a13d);}else{return _0x56e77d(_0x3bd2a0['error'](0x1f5,_0x681c('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x3f22ff){var _0x488ff9=this;return new Promise(function(_0x36cdc0,_0x2e2937){if(ami[_0x681c('0xc')]()==![]){return _0x2e2937(_0x488ff9['error'](0x1f4,[config['asterisk']['ip'],config[_0x681c('0xe')][_0x681c('0xf')],_0x681c('0x10')]['join']('\x20')));}var _0x31077d=schema(properties['voicequeuechannelhangup'])['validate'](_0x3f22ff);if(_0x31077d[_0x681c('0x5b')]>0x0){return _0x2e2937(_0x488ff9[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x31077d,'message')[_0x681c('0x58')](',\x20')));}var _0x2bab50=_[_0x681c('0x5d')](_0x2aff9d[_0x681c('0x74')],{'uniqueid':_0x3f22ff['uniqueid']});if(_0x2bab50&&_0x2bab50['channel']){return ami['Action']({'action':_0x681c('0x76'),'channel':_0x2bab50[_0x681c('0x5f')]})[_0x681c('0x1b')](function(_0x38c6da){_0x36cdc0({'code':0xc8,'message':[_0x3f22ff[_0x681c('0x5e')],_0x38c6da[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')});})[_0x681c('0x18')](function(_0x38ebfb){_0x2e2937(_0x488ff9[_0x681c('0xd')](0x1f5,[_0x3f22ff[_0x681c('0x5e')],_0x38ebfb['message'][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x2e2937(_0x488ff9[_0x681c('0xd')](0x1f5,_0x681c('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x2b166a){var _0x38bf16=this;return new Promise(function(_0x484d92,_0x205834){if(ami[_0x681c('0xc')]()==![]){return _0x205834(_0x38bf16[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')]['username'],'ami\x20disconnected'][_0x681c('0x58')]('\x20')));}var _0x130605=schema(properties[_0x681c('0x77')])[_0x681c('0x5a')](_0x2b166a);if(_0x130605['length']>0x0){return _0x205834(_0x38bf16[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x130605,_0x681c('0x17'))[_0x681c('0x58')](',\x20')));}var _0x2d5466=_[_0x681c('0x5d')](_0x2aff9d[_0x681c('0x74')],{'uniqueid':_0x2b166a['uniqueid']});if(_0x2d5466&&_0x2d5466[_0x681c('0x5f')]){return ami[_0x681c('0x16')]({'action':_0x681c('0x78'),'channel':_0x2d5466[_0x681c('0x5f')],'exten':_0x2b166a['exten'],'context':_0x2b166a['context']||_0x2d5466[_0x681c('0x79')],'priority':0x1})[_0x681c('0x1b')](function(_0x18f662){_0x484d92({'code':0xc8,'message':[_0x2b166a['uniqueid'],_0x18f662[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')});})[_0x681c('0x18')](function(_0x22558c){_0x205834(_0x38bf16[_0x681c('0xd')](0x1f5,[_0x2b166a[_0x681c('0x5e')],_0x22558c[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x205834(_0x38bf16[_0x681c('0xd')](0x1f5,_0x681c('0x6c')));}});},'Agents':function(_0x6441d9){return new Promise(function(_0x3821ce,_0x49506d){var _0x2795b5=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x9')]);_0x3821ce({'count':_0x2795b5[_0x681c('0x5b')],'rows':_0x2795b5});});},'Telephones':function(_0x15eb95){return new Promise(function(_0x2965c5,_0xf150a3){var _0x1b130e=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x7a')]);_0x2965c5({'count':_0x1b130e['length'],'rows':_0x1b130e});});},'Trunks':function(_0x4876e2){return new Promise(function(_0x5b40de,_0x3e1712){var _0x592f3f=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x7b')]);_0x5b40de({'count':_0x592f3f[_0x681c('0x5b')],'rows':_0x592f3f});});},'OutboundChannels':function(_0xe248e5){return new Promise(function(_0x16f783,_0x326229){var _0x31b705=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x7c')]);_0x16f783({'count':_0x31b705[_0x681c('0x5b')],'rows':_0x31b705});});},'Outbound':function(_0x1dc760){return new Promise(function(_0x107beb,_0x3fcd95){_0x107beb(_0x2aff9d['outbound']);});},'Campaigns':function(_0x5a8b53){return new Promise(function(_0x18a900,_0xe5295c){var _0x44a361=_['values'](_0x2aff9d[_0x681c('0x7d')]);_0x18a900({'count':_0x44a361[_0x681c('0x5b')],'rows':_0x44a361});});},'VoiceQueuesPreview':function(_0xf3d937){var _0x231c78=this;return new Promise(function(_0x124cd3,_0x591e39){_0x1f2032[_0x681c('0x7e')](_0xf3d937['id'])['then'](function(_0xa103be){_0x124cd3({'code':0xc8,'message':_0xa103be[_0x681c('0x17')]});})['catch'](function(_0x255267){_0x591e39(_0x231c78[_0x681c('0xd')](0x1f4,_0x255267[_0x681c('0x17')]));});});},'EventManager':function(_0x1ec720){var _0x5b0c6d=this;return new Promise(function(_0x3f7138,_0x4c2b12){if(!_0x1ec720[_0x681c('0x7f')]){return _0x4c2b12(_0x5b0c6d[_0x681c('0xd')](0x1f4,_0x681c('0x80')));}ami[_0x681c('0x81')]('custom:'+_0x1ec720['event'],_0x1ec720['message']);_0x3f7138({'code':0xc8,'message':_0x1ec720});});},'FaxAccounts':function(_0x5df46f){return new Promise(function(_0x33556c,_0x47fac3){var _0x5c7af7=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x82')]);_0x33556c({'count':_0x5c7af7[_0x681c('0x5b')],'rows':_0x5c7af7});});},'SendFax':function(_0x57fddd){var _0x280bfc=this;return new Promise(function(_0x229b5e,_0x140fe4){_0x1d31c8['send'](_0x57fddd)['then'](function(_0x19d85c){_0x229b5e({'code':0xc8,'message':_0x19d85c['message']});})[_0x681c('0x18')](function(_0x350f5f){_0x140fe4(_0x280bfc[_0x681c('0xd')](0x1f4,_0x350f5f[_0x681c('0x17')]));});});},'CheckAfterSend':function(_0xc38adb){var _0x18f952=this;return new Promise(function(_0x48c8e9,_0x1ae8c3){_0x1d31c8[_0x681c('0x83')](_0xc38adb)[_0x681c('0x1b')](function(_0x1a8875){_0x48c8e9({'code':0xc8,'message':_0x1a8875[_0x681c('0x17')]});})[_0x681c('0x18')](function(_0x285848){_0x1ae8c3(_0x18f952[_0x681c('0xd')](0x1f4,_0x285848[_0x681c('0x17')]));});});}};var _0x4498e0=jayson[_0x681c('0x84')](_0xdc57a5)[_0x681c('0x85')]();_0x4498e0['on'](_0x681c('0xd'),function(_0x33645d){return _0x45331(_0x33645d);});_0x4498e0[_0x681c('0x4')](0x232a,_0x681c('0x86'),function(){console[_0x681c('0x87')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4ea522(_0x681c('0x88')+0x232a);});});}; \ No newline at end of file +var _0x27a0=['erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','find','undefined','values','channels','voicechannel','format','uniqueid','wav','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','length','map','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','username','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','pick','module','then','message','catch','join','command','Command','Action','content','voiceQueues','hasOwnProperty','answered','loggedIn','sumDuration','total','unmanaged','waiting','loggedInDb','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'];(function(_0x2f5c4b,_0x34ccfb){var _0xa12194=function(_0x28d0a4){while(--_0x28d0a4){_0x2f5c4b['push'](_0x2f5c4b['shift']());}};_0xa12194(++_0x34ccfb);}(_0x27a0,0xbf));var _0x027a=function(_0x2e792e,_0x201641){_0x2e792e=_0x2e792e-0x0;var _0x3abd39=_0x27a0[_0x2e792e];return _0x3abd39;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var jayson=require(_0x027a('0x1'));var schema=require(_0x027a('0x2'));var BPromise=require(_0x027a('0x3'));var moment=require(_0x027a('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require('../ami');exports['listen']=function(_0x30a54d,_0x2a409a,_0x137b09){return new BPromise(function(_0x639bec,_0xe233ed){var _0x3c7d67={'QueuePause':function(_0x550fbb){return new Promise(function(_0x3d1429,_0x271dfe){var _0x277f49=util['format'](_0x027a('0x5'),_0x027a('0x6'),_0x550fbb[_0x027a('0x7')]);if(_0x30a54d['timers']&&_0x30a54d[_0x027a('0x8')][_0x277f49]&&_0x30a54d[_0x027a('0x8')][_0x277f49][_0x027a('0x9')]){_0x30a54d[_0x027a('0x8')][_0x277f49][_0x027a('0xa')]();}if(_0x30a54d[_0x027a('0xb')][_0x277f49]){_0x30a54d[_0x027a('0xb')][_0x277f49][_0x027a('0xc')]({'statePause':_0x550fbb[_0x027a('0xd')]?!![]:![]});}_0x3d1429({'code':0xc8,'message':_0x027a('0xe')});});},'Reload':function(_0x96a5c3){var _0x52f5de=this;return new Promise(function(_0xe64d3a,_0x30b9a4){if(ami[_0x027a('0xf')]()==![]){return _0x30b9a4(_0x52f5de[_0x027a('0x10')](0x1f4,[config[_0x027a('0x11')]['ip'],config['asterisk']['username'],_0x027a('0x12')]['join']('\x20')));}_0x96a5c3=_[_0x027a('0x13')](_0x96a5c3,_['keys'](properties[_0x027a('0x14')]));_0x96a5c3['action']='Reload';return ami['Action'](_0x96a5c3)[_0x027a('0x15')](function(_0x2f04e9){_0xe64d3a({'code':0xc8,'message':_0x2f04e9[_0x027a('0x16')]});})[_0x027a('0x17')](function(_0x52125e){_0x30b9a4(_0x52f5de[_0x027a('0x10')](0x1f5,_0x52125e[_0x027a('0x16')]));});});},'Command':function(_0x4ad813){var _0x4f8c3d=this;return new Promise(function(_0x3a6868,_0x57cf67){if(ami[_0x027a('0xf')]()==![]){return _0x57cf67(_0x4f8c3d['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x027a('0x12')][_0x027a('0x18')]('\x20')));}_0x4ad813=_[_0x027a('0x13')](_0x4ad813,_0x027a('0x19'));_0x4ad813['action']=_0x027a('0x1a');return ami[_0x027a('0x1b')](_0x4ad813)[_0x027a('0x15')](function(_0x3dee99){_0x3a6868({'code':0xc8,'message':_0x3dee99[_0x027a('0x1c')]});})[_0x027a('0x17')](function(_0x595f0e){_0x57cf67(_0x4f8c3d[_0x027a('0x10')](0x1f5,_0x595f0e['message']));});});},'VoiceQueues':function(_0x3dd7ad){return new Promise(function(_0x2e97c5,_0x1b1a13){var _0x83fe3e=[];for(var _0x582943 in _0x30a54d['voiceQueues']){if(_0x30a54d[_0x027a('0x1d')][_0x027a('0x1e')](_0x582943)){var _0x338141=_0x30a54d[_0x027a('0x1d')][_0x582943];var _0x511c7a={'id':_0x338141['id'],'name':_0x338141[_0x027a('0x7')],'strategy':_0x338141['strategy'],'answered':_0x338141[_0x027a('0x1f')],'available':_0x338141['available'],'loggedIn':_0x338141[_0x027a('0x20')],'pTalking':_0x338141['pTalking'],'sumBillable':_0x338141['sumBillable'],'sumDuration':_0x338141[_0x027a('0x21')],'sumHoldTime':_0x338141['sumHoldTime']||0x0,'talking':_0x338141['talking'],'total':_0x338141[_0x027a('0x22')],'type':_0x338141['type'],'unmanaged':_0x338141[_0x027a('0x23')],'abandoned':_0x338141['abandoned'],'waiting':_0x338141[_0x027a('0x24')],'loggedInDb':_0x338141[_0x027a('0x25')]};if(_0x338141['type']===_0x027a('0x26')){_0x511c7a['dialActive']=_0x338141[_0x027a('0x27')];_0x511c7a[_0x027a('0x28')]=_0x338141[_0x027a('0x28')];_0x511c7a[_0x027a('0x29')]=_0x338141[_0x027a('0x29')];_0x511c7a[_0x027a('0x2a')]=_0x338141['dialOriginateCallerIdNumber'];_0x511c7a[_0x027a('0x2b')]=_0x338141['dialOriginateTimeout'];_0x511c7a[_0x027a('0x2c')]=_0x338141['dialPrefix'];_0x511c7a[_0x027a('0x2d')]=_0x338141[_0x027a('0x2d')];_0x511c7a[_0x027a('0x2e')]=_0x338141[_0x027a('0x2e')];_0x511c7a[_0x027a('0x2f')]=_0x338141['outboundAnswerCallsDay'];_0x511c7a[_0x027a('0x30')]=_0x338141[_0x027a('0x30')];_0x511c7a[_0x027a('0x31')]=_0x338141[_0x027a('0x31')];_0x511c7a[_0x027a('0x32')]=_0x338141[_0x027a('0x32')];_0x511c7a[_0x027a('0x33')]=_0x338141[_0x027a('0x33')];_0x511c7a[_0x027a('0x34')]=_0x338141[_0x027a('0x34')];_0x511c7a[_0x027a('0x35')]=_0x338141['outboundDropCallsDayTimeout'];_0x511c7a[_0x027a('0x36')]=_0x338141[_0x027a('0x36')];_0x511c7a[_0x027a('0x37')]=_0x338141[_0x027a('0x37')];_0x511c7a[_0x027a('0x38')]=_0x338141[_0x027a('0x38')];_0x511c7a[_0x027a('0x39')]=_0x338141['outboundReCallsDay'];_0x511c7a[_0x027a('0x3a')]=_0x338141[_0x027a('0x3a')];_0x511c7a[_0x027a('0x3b')]=_0x338141['outboundUnknownCallsDay'];_0x511c7a[_0x027a('0x3c')]=_0x338141['predictiveIntervalAnsweredCalls'];_0x511c7a[_0x027a('0x3d')]=_0x338141[_0x027a('0x3d')];_0x511c7a[_0x027a('0x3e')]=_0x338141['predictiveIntervalAvgTalktime'];_0x511c7a['predictiveIntervalDroppedCallsCallersExit']=_0x338141[_0x027a('0x3f')];_0x511c7a[_0x027a('0x40')]=_0x338141['predictiveIntervalDroppedCallsTimeout'];_0x511c7a[_0x027a('0x41')]=_0x338141[_0x027a('0x41')];_0x511c7a[_0x027a('0x42')]=_0x338141[_0x027a('0x42')];_0x511c7a[_0x027a('0x43')]=_0x338141[_0x027a('0x43')];_0x511c7a[_0x027a('0x44')]=_0x338141[_0x027a('0x44')];_0x511c7a[_0x027a('0x45')]=_0x338141[_0x027a('0x45')];_0x511c7a[_0x027a('0x46')]=_0x338141[_0x027a('0x46')];_0x511c7a[_0x027a('0x47')]=_0x338141[_0x027a('0x47')];_0x511c7a[_0x027a('0x16')]=_0x338141[_0x027a('0x16')];_0x511c7a[_0x027a('0x48')]=_0x338141['originated'];_0x511c7a[_0x027a('0x49')]=_0x338141[_0x027a('0x49')];_0x511c7a[_0x027a('0x4a')]=_0x338141[_0x027a('0x4a')];_0x511c7a[_0x027a('0x4b')]=_0x338141[_0x027a('0x4b')];_0x511c7a['erlangBusyFactor']=_0x338141[_0x027a('0x4c')];_0x511c7a[_0x027a('0x4d')]=_0x338141['startPredictive'];_0x511c7a[_0x027a('0x4e')]=_0x338141['startProgressive'];}if(_0x338141['Trunk']){_0x511c7a[_0x027a('0x4f')]={'id':_0x338141['Trunk']['id'],'name':_0x338141[_0x027a('0x4f')][_0x027a('0x7')],'active':_0x338141[_0x027a('0x4f')][_0x027a('0x50')],'callerid':_0x338141[_0x027a('0x4f')]['callerid']};}if(_0x338141[_0x027a('0x51')]){_0x511c7a[_0x027a('0x51')]={'id':_0x338141[_0x027a('0x51')]['id'],'name':_0x338141['Interval']['name']};}_0x83fe3e['push'](_0x511c7a);}}_0x2e97c5({'count':_0x83fe3e['length'],'rows':_0x83fe3e});});},'UpdateVoiceQueue':function(_0x3058c2){return new Promise(function(_0x35a034,_0x1265c2){var _0x476a41=_[_0x027a('0x52')](_0x30a54d[_0x027a('0x1d')],{'id':parseInt(_0x3058c2['id'])});var _0x4f7348=_['omit'](_0x3058c2,['id']);if(_0x476a41){for(var _0x2a9f24 in _0x4f7348){if(typeof _0x4f7348[_0x2a9f24]!==_0x027a('0x53')&&typeof _0x476a41[_0x2a9f24]!==_0x027a('0x53')){_0x476a41[_0x2a9f24]=_0x4f7348[_0x2a9f24];}}_0x35a034(_0x476a41);}else{_0x1265c2();}});},'VoiceChannels':function(_0x73e4a2){return new Promise(function(_0x91e58c,_0x6ea84b){var _0x235a38=_[_0x027a('0x54')](_0x30a54d[_0x027a('0x55')]);_0x91e58c({'count':_0x235a38['length'],'rows':_0x235a38});});},'VoiceChannelMixMonitor':function(_0xe9e0a8){var _0x2904b1=this;return new Promise(function(_0x37be38,_0x32900f){if(ami[_0x027a('0xf')]()==![]){return _0x32900f(_0x2904b1[_0x027a('0x10')](0x1f4,[config[_0x027a('0x11')]['ip'],config[_0x027a('0x11')]['username'],_0x027a('0x12')][_0x027a('0x18')]('\x20')));}var _0x556b2b=schema(properties[_0x027a('0x56')])[_0x027a('0x2')](_0xe9e0a8);if(_0x556b2b['length']>0x0){return _0x32900f(_0x2904b1['error'](0x1f4,_['map'](_0x556b2b,_0x027a('0x16'))['join'](',\x20')));}var _0x3a7374=_['find'](_0x30a54d['channels'],{'uniqueid':_0xe9e0a8['uniqueid']});if(_0x3a7374&&_0x3a7374['channel']){var _0xa75e3a=util[_0x027a('0x57')]('%s.%s',_0xe9e0a8['filename']||_0xe9e0a8[_0x027a('0x58')],_0xe9e0a8[_0x027a('0x57')]||_0x027a('0x59'));return ami[_0x027a('0x1b')]({'action':'MixMonitor','channel':_0x3a7374[_0x027a('0x5a')],'file':_0xa75e3a,'options':'ai(mixmonitorid)'})[_0x027a('0x15')](function(_0x290661){var _0x2da742=_[_0x027a('0x52')](_0x3a7374[_0x027a('0x5b')],{'filename':_0x027a('0x5c')+_0xa75e3a[_0x027a('0x5d')]()});if(_[_0x027a('0x5e')](_0x2da742)){_0x3a7374['monitors'][_0x027a('0x5f')]({'filename':_0x027a('0x5c')+_0xa75e3a[_0x027a('0x5d')](),'createdAt':moment()[_0x027a('0x57')](_0x027a('0x60')),'mixmonitorid':_0x290661[_0x027a('0x61')],'status':_0x027a('0x62')});}else{_0x2da742['mixmonitorid']=_0x290661[_0x027a('0x61')];_0x2da742[_0x027a('0x63')]=_0x027a('0x62');}_0x37be38({'code':0xc8,'message':[_0xe9e0a8[_0x027a('0x58')],_0x027a('0x64'),_0x290661[_0x027a('0x61')]][_0x027a('0x18')]('\x20'),'mixmonitorid':_0x290661[_0x027a('0x61')]});})[_0x027a('0x17')](function(_0x455077){_0x32900f(_0x2904b1[_0x027a('0x10')](0x1f5,[_0xe9e0a8[_0x027a('0x58')],_0x455077[_0x027a('0x16')][_0x027a('0x5d')]()][_0x027a('0x18')]('\x20')));});}else{return _0x32900f(_0x2904b1['error'](0x1f5,_0x027a('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x3ed56f){var _0x422e38=this;return new Promise(function(_0x19dee1,_0x3aaf0f){if(ami[_0x027a('0xf')]()==![]){return _0x3aaf0f(_0x422e38[_0x027a('0x10')](0x1f4,[config[_0x027a('0x11')]['ip'],config[_0x027a('0x11')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x4dca48=schema(properties[_0x027a('0x56')])[_0x027a('0x2')](_0x3ed56f);if(_0x4dca48[_0x027a('0x66')]>0x0){return _0x3aaf0f(_0x422e38[_0x027a('0x10')](0x1f4,_[_0x027a('0x67')](_0x4dca48,'message')['join'](',\x20')));}var _0x1ccb83=_['find'](_0x30a54d['channels'],{'uniqueid':_0x3ed56f[_0x027a('0x58')]});if(_0x1ccb83){return BPromise[_0x027a('0x68')]()[_0x027a('0x15')](function(){if(_0x1ccb83[_0x027a('0x5a')]){return ami[_0x027a('0x1b')]({'action':_0x027a('0x69'),'channel':_0x1ccb83[_0x027a('0x5a')],'mixmonitorid':_0x3ed56f[_0x027a('0x61')]})[_0x027a('0x17')](function(_0x5ea7b0){});}})[_0x027a('0x15')](function(){if(_0x1ccb83[_0x027a('0x6a')]){return ami[_0x027a('0x1b')]({'action':_0x027a('0x69'),'channel':_0x1ccb83[_0x027a('0x6a')],'mixmonitorid':_0x3ed56f[_0x027a('0x61')]})[_0x027a('0x17')](function(_0x8c5980){});}})[_0x027a('0x15')](function(_0x22bd81){var _0x10d829=_[_0x027a('0x52')](_0x1ccb83[_0x027a('0x5b')],{'mixmonitorid':_0x3ed56f[_0x027a('0x61')]});if(_0x10d829){_0x10d829['status']=_0x027a('0x6b');}})[_0x027a('0x15')](function(){var _0xc8e7c=util[_0x027a('0x57')]('%s.%s',_0x3ed56f['filename']||_0x3ed56f[_0x027a('0x58')],_0x3ed56f[_0x027a('0x57')]||_0x027a('0x59'));var _0x1af0d3=_[_0x027a('0x52')](_0x1ccb83[_0x027a('0x5b')],{'filename':_0x027a('0x5c')+_0xc8e7c[_0x027a('0x5d')]()});if(_0x1af0d3){_0x1af0d3[_0x027a('0x63')]='stop';}})[_0x027a('0x15')](function(){_0x19dee1({'code':0xc8,'message':[_0x3ed56f[_0x027a('0x58')],_0x027a('0x6c')]['join']('\x20')});})[_0x027a('0x17')](function(_0x272c5e){_0x3aaf0f(_0x422e38['error'](0x1f5,[_0x3ed56f[_0x027a('0x58')],_0x272c5e[_0x027a('0x16')]['toLowerCase']()]['join']('\x20')));});}else{return _0x3aaf0f(_0x422e38[_0x027a('0x10')](0x1f5,_0x027a('0x65')));}});},'VoiceQueuesChannels':function(_0x643789){return new Promise(function(_0x354dc3,_0x58a21e){var _0xaa3396=_[_0x027a('0x54')](_0x30a54d[_0x027a('0x6d')]);_0x354dc3({'count':_0xaa3396['length'],'rows':_0xaa3396});});},'VoiceQueuesChannel':function(_0x308da5){var _0x47ab44=this;return new Promise(function(_0x310bf8,_0x5ac758){var _0x682fa4=schema(properties[_0x027a('0x6e')])[_0x027a('0x2')](_0x308da5);if(_0x682fa4[_0x027a('0x66')]>0x0){return _0x5ac758(_0x47ab44['error'](0x1f4,_['map'](_0x682fa4,'message')['join'](',\x20')));}var _0x4c492a=_['find'](_0x30a54d['queueChannels'],{'uniqueid':_0x308da5[_0x027a('0x58')]});if(_0x4c492a){_0x310bf8(_0x4c492a);}else{return _0x5ac758(_0x47ab44['error'](0x1f5,_0x027a('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x547002){var _0x33a0fa=this;return new Promise(function(_0x527845,_0x54d553){if(ami[_0x027a('0xf')]()==![]){return _0x54d553(_0x33a0fa[_0x027a('0x10')](0x1f4,[config[_0x027a('0x11')]['ip'],config['asterisk'][_0x027a('0x6f')],'ami\x20disconnected'][_0x027a('0x18')]('\x20')));}var _0x34ad0c=schema(properties[_0x027a('0x70')])['validate'](_0x547002);if(_0x34ad0c[_0x027a('0x66')]>0x0){return _0x54d553(_0x33a0fa[_0x027a('0x10')](0x1f4,_[_0x027a('0x67')](_0x34ad0c,_0x027a('0x16'))[_0x027a('0x18')](',\x20')));}var _0x414f0d=_['find'](_0x30a54d[_0x027a('0x6d')],{'uniqueid':_0x547002['uniqueid']});if(_0x414f0d&&_0x414f0d[_0x027a('0x5a')]){return ami[_0x027a('0x1b')]({'action':_0x027a('0x71'),'channel':_0x414f0d[_0x027a('0x5a')]})['then'](function(_0xbe15a5){_0x527845({'code':0xc8,'message':[_0x547002[_0x027a('0x58')],_0xbe15a5[_0x027a('0x16')][_0x027a('0x5d')]()]['join']('\x20')});})[_0x027a('0x17')](function(_0x255269){_0x54d553(_0x33a0fa[_0x027a('0x10')](0x1f5,[_0x547002[_0x027a('0x58')],_0x255269['message'][_0x027a('0x5d')]()][_0x027a('0x18')]('\x20')));});}else{return _0x54d553(_0x33a0fa['error'](0x1f5,_0x027a('0x65')));}});},'VoiceQueuesChannelRedirect':function(_0x12bf17){var _0x5149a4=this;return new Promise(function(_0x3452b1,_0x1dac6d){if(ami[_0x027a('0xf')]()==![]){return _0x1dac6d(_0x5149a4[_0x027a('0x10')](0x1f4,[config[_0x027a('0x11')]['ip'],config[_0x027a('0x11')][_0x027a('0x6f')],'ami\x20disconnected']['join']('\x20')));}var _0x58a83d=schema(properties[_0x027a('0x72')])[_0x027a('0x2')](_0x12bf17);if(_0x58a83d[_0x027a('0x66')]>0x0){return _0x1dac6d(_0x5149a4[_0x027a('0x10')](0x1f4,_[_0x027a('0x67')](_0x58a83d,_0x027a('0x16'))['join'](',\x20')));}var _0x5df9ce=_[_0x027a('0x52')](_0x30a54d[_0x027a('0x6d')],{'uniqueid':_0x12bf17[_0x027a('0x58')]});if(_0x5df9ce&&_0x5df9ce['channel']){return ami['Action']({'action':_0x027a('0x73'),'channel':_0x5df9ce['channel'],'exten':_0x12bf17[_0x027a('0x74')],'context':_0x12bf17[_0x027a('0x75')]||_0x5df9ce['context'],'priority':0x1})[_0x027a('0x15')](function(_0x696baf){_0x3452b1({'code':0xc8,'message':[_0x12bf17[_0x027a('0x58')],_0x696baf[_0x027a('0x16')][_0x027a('0x5d')]()][_0x027a('0x18')]('\x20')});})[_0x027a('0x17')](function(_0x3af905){_0x1dac6d(_0x5149a4[_0x027a('0x10')](0x1f5,[_0x12bf17[_0x027a('0x58')],_0x3af905[_0x027a('0x16')][_0x027a('0x5d')]()][_0x027a('0x18')]('\x20')));});}else{return _0x1dac6d(_0x5149a4[_0x027a('0x10')](0x1f5,_0x027a('0x65')));}});},'Agents':function(_0x1cfc7b){return new Promise(function(_0x33546d,_0x5c77a9){var _0x5d91e4=_[_0x027a('0x54')](_0x30a54d[_0x027a('0xb')]);_0x33546d({'count':_0x5d91e4['length'],'rows':_0x5d91e4});});},'Telephones':function(_0x2ec4ac){return new Promise(function(_0xda3782,_0x256236){var _0x36bb99=_[_0x027a('0x54')](_0x30a54d['telephones']);_0xda3782({'count':_0x36bb99[_0x027a('0x66')],'rows':_0x36bb99});});},'Trunks':function(_0x218e4f){return new Promise(function(_0x502265,_0x3597eb){var _0xe1f71d=_['values'](_0x30a54d['trunks']);_0x502265({'count':_0xe1f71d[_0x027a('0x66')],'rows':_0xe1f71d});});},'OutboundChannels':function(_0x3a72c0){return new Promise(function(_0x219055,_0x38f9a1){var _0x181b9b=_[_0x027a('0x54')](_0x30a54d['outboundChannels']);_0x219055({'count':_0x181b9b[_0x027a('0x66')],'rows':_0x181b9b});});},'Outbound':function(_0x4ee188){return new Promise(function(_0xbcb757,_0x7b651){_0xbcb757(_0x30a54d[_0x027a('0x26')]);});},'Campaigns':function(_0x261d92){return new Promise(function(_0x132130,_0x3eb409){var _0x4ea2b1=_[_0x027a('0x54')](_0x30a54d[_0x027a('0x76')]);_0x132130({'count':_0x4ea2b1[_0x027a('0x66')],'rows':_0x4ea2b1});});},'VoiceQueuesPreview':function(_0x4aa82b){var _0x34623b=this;return new Promise(function(_0x3e4348,_0x72520c){_0x2a409a[_0x027a('0x77')](_0x4aa82b['id'])['then'](function(_0x45347a){_0x3e4348({'code':0xc8,'message':_0x45347a[_0x027a('0x16')]});})[_0x027a('0x17')](function(_0x2fcec3){_0x72520c(_0x34623b[_0x027a('0x10')](0x1f4,_0x2fcec3[_0x027a('0x16')]));});});},'EventManager':function(_0x33d11d){var _0x5406f4=this;return new Promise(function(_0x3f07c6,_0x341bb){if(!_0x33d11d[_0x027a('0x78')]){return _0x341bb(_0x5406f4[_0x027a('0x10')](0x1f4,_0x027a('0x79')));}ami[_0x027a('0x7a')]('custom:'+_0x33d11d['event'],_0x33d11d[_0x027a('0x16')]);_0x3f07c6({'code':0xc8,'message':_0x33d11d});});},'FaxAccounts':function(_0x4707b9){return new Promise(function(_0x23548b,_0x481d7b){var _0x39c173=_[_0x027a('0x54')](_0x30a54d[_0x027a('0x7b')]);_0x23548b({'count':_0x39c173[_0x027a('0x66')],'rows':_0x39c173});});},'SendFax':function(_0x167806){var _0x2765c3=this;return new Promise(function(_0x3fca19,_0x1131b6){_0x137b09[_0x027a('0x7c')](_0x167806)['then'](function(_0x5d7701){_0x3fca19({'code':0xc8,'message':_0x5d7701[_0x027a('0x16')]});})[_0x027a('0x17')](function(_0xbe260e){_0x1131b6(_0x2765c3[_0x027a('0x10')](0x1f4,_0xbe260e[_0x027a('0x16')]));});});},'CheckAfterSend':function(_0x1df6b7){var _0x2eebe4=this;return new Promise(function(_0x2d7779,_0x58bdae){_0x137b09[_0x027a('0x7d')](_0x1df6b7)[_0x027a('0x15')](function(_0x21fc4d){_0x2d7779({'code':0xc8,'message':_0x21fc4d[_0x027a('0x16')]});})[_0x027a('0x17')](function(_0x1fabba){_0x58bdae(_0x2eebe4[_0x027a('0x10')](0x1f4,_0x1fabba[_0x027a('0x16')]));});});}};var _0x5b85ee=jayson[_0x027a('0x7e')](_0x3c7d67)[_0x027a('0x7f')]();_0x5b85ee['on'](_0x027a('0x10'),function(_0x252123){return _0xe233ed(_0x252123);});_0x5b85ee[_0x027a('0x80')](0x232a,_0x027a('0x81'),function(){console[_0x027a('0x82')](_0x027a('0x83'),0x232a);return _0x639bec(_0x027a('0x84')+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 417afb2..0c6428b 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 _0x17ba=['name','trigger:%s','toLowerCase','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','routeId','calleridname','','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s'];(function(_0x5a869a,_0x5e8a7f){var _0x2edde9=function(_0xa4b1f8){while(--_0xa4b1f8){_0x5a869a['push'](_0x5a869a['shift']());}};_0x2edde9(++_0x5e8a7f);}(_0x17ba,0xab));var _0xa17b=function(_0x49efaf,_0x4ec977){_0x49efaf=_0x49efaf-0x0;var _0x9bfc54=_0x17ba[_0x49efaf];return _0x9bfc54;};'use strict';var _=require(_0xa17b('0x0'));var BPromise=require(_0xa17b('0x1'));var Redis=require('ioredis');var util=require(_0xa17b('0x2'));var config=require(_0xa17b('0x3'));var logger=require(_0xa17b('0x4'))(_0xa17b('0x5'));var cmContactRpc=require(_0xa17b('0x6'));config[_0xa17b('0x7')]=_[_0xa17b('0x8')](config[_0xa17b('0x7')],{'host':_0xa17b('0x9'),'port':0x18eb});var io=require(_0xa17b('0xa'))(new Redis(config[_0xa17b('0x7')]));function emit(_0x2e3d43,_0x1957be,_0x57f9cd,_0x2ca4d3,_0x17d1d2){logger[_0xa17b('0xb')](_0xa17b('0xc'),_0x2e3d43,_0x1957be['id'],_0x57f9cd,_0x2ca4d3,JSON[_0xa17b('0xd')](_0x17d1d2));io['to'](_0x57f9cd)['emit'](_0x2ca4d3,_0x17d1d2);}exports[_0xa17b('0xe')]=function(_0x38b8f1,_0x322dc0,_0x1e799a,_0x140943){var _0x4382df,_0xc5ef2e;var _0x5593c4={};var _0xd2ccce=Number(_0x1e799a[_0xa17b('0xf')]);var _0x3c3a8a=_0x1e799a['data2']?Boolean(Number(_0x1e799a[_0xa17b('0x10')])):![];var _0x3d7d46;var _0x30236c=![];if(!_[_0xa17b('0x11')](_0x1e799a['data5'])){if(_0x1e799a[_0xa17b('0x12')]=='1')_0x30236c=!![];}if(!_0x30236c){if(_0x140943['xmd-contactid']){_0x5593c4['id']=_0x140943[_0xa17b('0x13')];}}if(!_0x5593c4['id']){_0x5593c4[_0xa17b('0x14')]=_0xd2ccce;_0x3d7d46=_0x1e799a['data3']&&_0x1e799a[_0xa17b('0x15')]!=='0'?_0x1e799a[_0xa17b('0x15')][_0xa17b('0x16')](','):[_0xa17b('0x17')];_0x5593c4['$or']=_[_0xa17b('0x18')](_0x3d7d46,function(_0x5e21c2){var _0x4d5592={};_0x4d5592[_0x5e21c2]=_0x140943['routeId']?_0x140943[_0xa17b('0x19')]:_0x140943[_0xa17b('0x1a')];return _0x4d5592;});}var _0x53a0f7=['id',_0xa17b('0x1b'),_0xa17b('0x1c'),_0xa17b('0x17'),_0xa17b('0x1d'),_0xa17b('0x1e'),_0xa17b('0x14'),_0xa17b('0x1f'),'scheduledAt',_0xa17b('0x20')];var _0x3f409a=_[_0xa17b('0x21')](_0x53a0f7,_0x3d7d46);BPromise['resolve']()[_0xa17b('0x22')](cmContactRpc[_0xa17b('0x23')]({'attributes':_0x3f409a,'where':_0x5593c4}))[_0xa17b('0x22')](function(_0xbbbb62){_0xc5ef2e=_0xbbbb62;if(!_[_0xa17b('0x24')](_0xc5ef2e)){if(_0xc5ef2e[_0xa17b('0x25')]===0x1){_0x4382df=_0xc5ef2e[0x0];logger['info'](_0xa17b('0x26'),_0x140943['uniqueid'],_0x322dc0['id'],_0x4382df['id']);}else{logger[_0xa17b('0xb')](_0xa17b('0x27'),_0x140943['uniqueid'],_0x322dc0['id'],_['map'](_0xc5ef2e,'id')[_0xa17b('0x28')](','));}return;}else{logger[_0xa17b('0xb')](_0xa17b('0x29'),_0x140943[_0xa17b('0x2a')],_0x322dc0['id']);var _0x3c32a5={'ListId':_0xd2ccce};var _0x3a64f5=_0x1e799a['data4']&&_0x1e799a['data4']!=='0'?_0x1e799a['data4']:'phone';if(_0x3c3a8a){logger[_0xa17b('0xb')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x140943[_0xa17b('0x2a')],_0x322dc0['id']);_0x3c32a5[_0x3a64f5]=_['isNil'](_0x140943[_0xa17b('0x2b')])?_0x140943[_0xa17b('0x1a')]:_0x140943[_0xa17b('0x19')];if(_[_0xa17b('0x11')](_0x140943[_0xa17b('0x2b')])){_0x3c32a5[_0xa17b('0x1b')]=_0x140943[_0xa17b('0x2c')]&&_0x140943[_0xa17b('0x2c')]!==_0xa17b('0x2d')?_0x140943[_0xa17b('0x2c')]:_0xa17b('0x2e');}else{_0x3c32a5['firstName']=_0x140943['destcalleridname']&&_0x140943['destcalleridname']!==_0xa17b('0x2d')?_0x140943[_0xa17b('0x2f')]:_0xa17b('0x2e');}return BPromise[_0xa17b('0x30')]()[_0xa17b('0x22')](cmContactRpc[_0xa17b('0x31')](_0x3c32a5))[_0xa17b('0x22')](function(_0x1bdd09){_0x4382df=_0x1bdd09;_0xc5ef2e['push'](_0x1bdd09);if(_0x4382df){logger[_0xa17b('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x140943[_0xa17b('0x2a')],_0x322dc0['id'],_0x4382df['id']);}return;});}else{logger[_0xa17b('0xb')](_0xa17b('0x32'),_0x140943[_0xa17b('0x2a')],_0x322dc0['id']);_0x3c32a5[_0x3a64f5]=_[_0xa17b('0x11')](_0x140943[_0xa17b('0x2b')])?_0x140943['calleridnum']:_0x140943[_0xa17b('0x19')];if(_[_0xa17b('0x11')](_0x140943[_0xa17b('0x2b')])){_0x3c32a5[_0xa17b('0x1b')]=_0x140943[_0xa17b('0x2c')]&&_0x140943['calleridname']!==_0xa17b('0x2d')?_0x140943['calleridname']:_0xa17b('0x2e');}else{_0x3c32a5['firstName']=_0x140943[_0xa17b('0x2f')]&&_0x140943[_0xa17b('0x2f')]!==''?_0x140943[_0xa17b('0x2f')]:_0xa17b('0x2e');}_0x4382df=_0x3c32a5;_0xc5ef2e['push'](_0x3c32a5);return;}}})[_0xa17b('0x22')](function(){if(_0x38b8f1){emit(_0x140943[_0xa17b('0x2a')],_0x322dc0,util[_0xa17b('0x33')](_0xa17b('0x34'),_0x38b8f1[_0xa17b('0x35')]),util['format'](_0xa17b('0x36'),_0x1e799a['action'][_0xa17b('0x37')]()),{'evt':_['merge'](_0x140943,{'autoCreate':_0x3c3a8a}),'contact':_0x4382df===undefined?{}:_0x4382df,'contacts':_0xc5ef2e[_0xa17b('0x25')]===0x0?undefined:_0xc5ef2e});}});}; \ No newline at end of file +var _0xdace=['data5','xmd-contactid','ListId','data3','phone','map','routeId','firstName','lastName','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','push','format','user:%s','name','trigger:%s','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data2','isNil'];(function(_0x48f827,_0x269e8d){var _0xc763f7=function(_0x19769a){while(--_0x19769a){_0x48f827['push'](_0x48f827['shift']());}};_0xc763f7(++_0x269e8d);}(_0xdace,0xc5));var _0xedac=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xdace[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0xedac('0x0'));var BPromise=require('bluebird');var Redis=require(_0xedac('0x1'));var util=require(_0xedac('0x2'));var config=require(_0xedac('0x3'));var logger=require('../../../../config/logger')(_0xedac('0x4'));var cmContactRpc=require(_0xedac('0x5'));config[_0xedac('0x6')]=_[_0xedac('0x7')](config['redis'],{'host':_0xedac('0x8'),'port':0x18eb});var io=require(_0xedac('0x9'))(new Redis(config[_0xedac('0x6')]));function emit(_0x5ecbd3,_0x4081c6,_0x21440e,_0x162eea,_0x53fa43){logger[_0xedac('0xa')](_0xedac('0xb'),_0x5ecbd3,_0x4081c6['id'],_0x21440e,_0x162eea,JSON[_0xedac('0xc')](_0x53fa43));io['to'](_0x21440e)['emit'](_0x162eea,_0x53fa43);}exports['exec']=function(_0x144368,_0x2ea11d,_0x57e1bf,_0x4d6a29){var _0x4db2ad,_0x25395d;var _0x57f637={};var _0x261401=Number(_0x57e1bf['data1']);var _0x21c6ae=_0x57e1bf[_0xedac('0xd')]?Boolean(Number(_0x57e1bf[_0xedac('0xd')])):![];var _0x342186;var _0x9a79a0=![];if(!_[_0xedac('0xe')](_0x57e1bf[_0xedac('0xf')])){if(_0x57e1bf[_0xedac('0xf')]=='1')_0x9a79a0=!![];}if(!_0x9a79a0){if(_0x4d6a29['xmd-contactid']){_0x57f637['id']=_0x4d6a29[_0xedac('0x10')];}}if(!_0x57f637['id']){_0x57f637[_0xedac('0x11')]=_0x261401;_0x342186=_0x57e1bf[_0xedac('0x12')]&&_0x57e1bf[_0xedac('0x12')]!=='0'?_0x57e1bf[_0xedac('0x12')]['split'](','):[_0xedac('0x13')];_0x57f637['$or']=_[_0xedac('0x14')](_0x342186,function(_0x2eeac9){var _0xdad128={};_0xdad128[_0x2eeac9]=_0x4d6a29[_0xedac('0x15')]?_0x4d6a29['destcalleridnum']:_0x4d6a29['calleridnum'];return _0xdad128;});}var _0x2d02d7=['id',_0xedac('0x16'),_0xedac('0x17'),_0xedac('0x13'),'mobile','fax',_0xedac('0x11'),_0xedac('0x18'),_0xedac('0x19'),_0xedac('0x1a')];var _0x2f5eee=_[_0xedac('0x1b')](_0x2d02d7,_0x342186);BPromise[_0xedac('0x1c')]()[_0xedac('0x1d')](cmContactRpc['getContacts']({'attributes':_0x2f5eee,'where':_0x57f637}))[_0xedac('0x1d')](function(_0x510005){_0x25395d=_0x510005;if(!_[_0xedac('0x1e')](_0x25395d)){if(_0x25395d[_0xedac('0x1f')]===0x1){_0x4db2ad=_0x25395d[0x0];logger['info'](_0xedac('0x20'),_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id'],_0x4db2ad['id']);}else{logger[_0xedac('0xa')](_0xedac('0x22'),_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id'],_[_0xedac('0x14')](_0x25395d,'id')['join'](','));}return;}else{logger[_0xedac('0xa')](_0xedac('0x23'),_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id']);var _0x41ad8d={'ListId':_0x261401};var _0x1ff33e=_0x57e1bf[_0xedac('0x24')]&&_0x57e1bf[_0xedac('0x24')]!=='0'?_0x57e1bf[_0xedac('0x24')]:_0xedac('0x13');if(_0x21c6ae){logger[_0xedac('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id']);_0x41ad8d[_0x1ff33e]=_[_0xedac('0xe')](_0x4d6a29[_0xedac('0x15')])?_0x4d6a29['calleridnum']:_0x4d6a29[_0xedac('0x25')];if(_['isNil'](_0x4d6a29['routeId'])){_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x26')]&&_0x4d6a29[_0xedac('0x26')]!==_0xedac('0x27')?_0x4d6a29['calleridname']:'Unknown';}else{_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x28')]&&_0x4d6a29[_0xedac('0x28')]!==_0xedac('0x27')?_0x4d6a29[_0xedac('0x28')]:_0xedac('0x29');}return BPromise[_0xedac('0x1c')]()['then'](cmContactRpc[_0xedac('0x2a')](_0x41ad8d))[_0xedac('0x1d')](function(_0x2cbe33){_0x4db2ad=_0x2cbe33;_0x25395d['push'](_0x2cbe33);if(_0x4db2ad){logger[_0xedac('0xa')](_0xedac('0x2b'),_0x4d6a29['uniqueid'],_0x2ea11d['id'],_0x4db2ad['id']);}return;});}else{logger[_0xedac('0xa')](_0xedac('0x2c'),_0x4d6a29['uniqueid'],_0x2ea11d['id']);_0x41ad8d[_0x1ff33e]=_[_0xedac('0xe')](_0x4d6a29[_0xedac('0x15')])?_0x4d6a29[_0xedac('0x2d')]:_0x4d6a29[_0xedac('0x25')];if(_[_0xedac('0xe')](_0x4d6a29[_0xedac('0x15')])){_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x26')]&&_0x4d6a29[_0xedac('0x26')]!==_0xedac('0x27')?_0x4d6a29['calleridname']:_0xedac('0x29');}else{_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x28')]&&_0x4d6a29[_0xedac('0x28')]!==_0xedac('0x27')?_0x4d6a29[_0xedac('0x28')]:_0xedac('0x29');}_0x4db2ad=_0x41ad8d;_0x25395d[_0xedac('0x2e')](_0x41ad8d);return;}}})[_0xedac('0x1d')](function(){if(_0x144368){emit(_0x4d6a29[_0xedac('0x21')],_0x2ea11d,util[_0xedac('0x2f')](_0xedac('0x30'),_0x144368[_0xedac('0x31')]),util[_0xedac('0x2f')](_0xedac('0x32'),_0x57e1bf['action'][_0xedac('0x33')]()),{'evt':_[_0xedac('0x34')](_0x4d6a29,{'autoCreate':_0x21c6ae}),'contact':_0x4db2ad===undefined?{}:_0x4db2ad,'contacts':_0x25395d[_0xedac('0x1f')]===0x0?undefined:_0x25395d});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c228bf8..c2bd46c 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 _0x159b=['accounts','queue','routeId','urlforward','script','buildUri','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','some','field','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','agent','membername','lastevent','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentbusy','custom:agentcongestion','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','motionChannel','voice','interface','checkTriggers','triggers','hasOwnProperty','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','data6','600','winApplication','winArguments','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration'];(function(_0x1964cc,_0x31c265){var _0x957bce=function(_0x170021){while(--_0x170021){_0x1964cc['push'](_0x1964cc['shift']());}};_0x957bce(++_0x31c265);}(_0x159b,0x181));var _0xb159=function(_0x2bce12,_0x572de9){_0x2bce12=_0x2bce12-0x0;var _0x38da20=_0x159b[_0x2bce12];return _0x38da20;};'use strict';var util=require(_0xb159('0x0'));var _=require(_0xb159('0x1'));var url=require(_0xb159('0x2'));var Mustache=require(_0xb159('0x3'));var Redis=require(_0xb159('0x4'));var urlforward=require(_0xb159('0x5'));var integration=require(_0xb159('0x6'));var cmContact=require(_0xb159('0x7'));var script=require('./script');var config=require(_0xb159('0x8'));var logger=require(_0xb159('0x9'))(_0xb159('0xa'));var ami=require(_0xb159('0xb'));config['redis']=_[_0xb159('0xc')](config[_0xb159('0xd')],{'host':_0xb159('0xe'),'port':0x18eb});var io=require(_0xb159('0xf'))(new Redis(config[_0xb159('0xd')]));var operators={'equals':function(_0x7f9727,_0x3d368d){return _0x7f9727==_0x3d368d;},'not_equals':function(_0x27238a,_0x2df975){return _0x27238a!=_0x2df975;}};var barAndWebActions=[_0xb159('0x10'),_0xb159('0x2'),_0xb159('0x11')];function Trigger(_0x424e93){this['triggers']=_0x424e93['triggers'];this[_0xb159('0x12')]=_0x424e93[_0xb159('0x12')];this[_0xb159('0x13')]=_0x424e93[_0xb159('0x13')];this[_0xb159('0x14')]=_0x424e93[_0xb159('0x14')];this['voiceExtensions']=_0x424e93[_0xb159('0x15')];this['zendeskAccounts']=_0x424e93[_0xb159('0x16')];this[_0xb159('0x17')]=_0x424e93['freshdeskAccounts'];this['salesforceAccounts']=_0x424e93[_0xb159('0x18')];this[_0xb159('0x19')]=_0x424e93[_0xb159('0x19')];this['zohoAccounts']=_0x424e93[_0xb159('0x1a')];this[_0xb159('0x1b')]=_0x424e93['deskAccounts'];this[_0xb159('0x1c')]=_0x424e93[_0xb159('0x1c')];this['servicenowAccounts']=_0x424e93[_0xb159('0x1d')];this['dynamics365Accounts']=_0x424e93[_0xb159('0x1e')];this[_0xb159('0x1f')]=_0x424e93[_0xb159('0x1f')];this['accounts']={'zendesk':this[_0xb159('0x16')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xb159('0x17')],'sugarcrm':this[_0xb159('0x19')],'zoho':this[_0xb159('0x1a')],'desk':this[_0xb159('0x1b')],'vtiger':this[_0xb159('0x1c')],'dynamics365':this[_0xb159('0x1e')],'freshsales':this[_0xb159('0x1f')],'servicenow':this[_0xb159('0x1d')]};ami['on'](_0xb159('0x20'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x23'),this[_0xb159('0x21')]['bind'](this));ami['on'](_0xb159('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb159('0x25'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on']('custom:agentnosuchnumber',this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on']('custom:agentnoanswer',this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x26'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x27'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on']('custom:agentreject',this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on']('custom:amd',this[_0xb159('0x21')]['bind'](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0xb159('0x22')](this));ami['on']('custom:timeout',this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x28'),this[_0xb159('0x29')]['bind'](this));ami['on'](_0xb159('0x2a'),this[_0xb159('0x29')][_0xb159('0x22')](this));ami['on'](_0xb159('0x2b'),this['syncAgentDial'][_0xb159('0x22')](this));ami['on']('custom:newinteraction',this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x2c'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x2d'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on']('custom:incomingmessage',this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on'](_0xb159('0x2e'),this[_0xb159('0x21')][_0xb159('0x22')](this));ami['on']('custom:acceptmessage',this[_0xb159('0x21')]['bind'](this));ami['on'](_0xb159('0x2f'),this[_0xb159('0x21')][_0xb159('0x22')](this));}Trigger[_0xb159('0x30')][_0xb159('0x31')]=function(_0x3aa336,_0x526231,_0x38a9de){logger[_0xb159('0x32')](_0x3aa336,_0x526231,JSON[_0xb159('0x33')](_0x38a9de));io['to'](_0x3aa336)[_0xb159('0x31')](_0x526231,_0x38a9de);};Trigger['prototype'][_0xb159('0x21')]=function(_0x5e4788){var _0x50938d=_[_0xb159('0x34')](_0x5e4788);if(typeof _0x50938d[_0xb159('0x35')]==='undefined'){_0x50938d[_0xb159('0x35')]=_0xb159('0x36');}this['checkTriggers'](_0x50938d);};Trigger[_0xb159('0x30')][_0xb159('0x29')]=function(_0x38b8c0){if(this[_0xb159('0x12')][_0x38b8c0[_0xb159('0x37')]]){this[_0xb159('0x21')](_0x38b8c0);}};Trigger[_0xb159('0x30')][_0xb159('0x38')]=function(_0x392569){var _0x4d4e92;for(var _0x3a20c7 in this[_0xb159('0x39')]){if(this[_0xb159('0x39')][_0xb159('0x3a')](_0x3a20c7)){if(this['triggers'][_0x3a20c7][_0xb159('0x3b')]){_0x4d4e92=this[_0xb159('0x3c')](this[_0xb159('0x39')][_0x3a20c7],_0x392569);if(_0x4d4e92){_[_0xb159('0x3d')](_0x392569,_0x392569['variables']);for(var _0x8dc8cc=0x0,_0xda8ce1,_0x1cafc4,_0x1eda41;_0x8dc8cc0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x2dc30e,_0x5b59cb){var _0x3c4828=function(_0x3232bb){while(--_0x3232bb){_0x2dc30e['push'](_0x2dc30e['shift']());}};_0x3c4828(++_0x5b59cb);}(_0x55ca,0x126));var _0xa55c=function(_0x29215d,_0x39143f){_0x29215d=_0x29215d-0x0;var _0x265037=_0x55ca[_0x29215d];return _0x265037;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 781ae31..575e257 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 _0x220d=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','access_token','catch','error','then','GET','Bearer\x20','value','isNil','validateEmail','userEmail','email','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','userId','4.0','headers','odata-entityid','substring','lastIndexOf','length','telephone1','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','assign','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x5d33e2,_0x52a63c){var _0x40cc7a=function(_0x421efe){while(--_0x421efe){_0x5d33e2['push'](_0x5d33e2['shift']());}};_0x40cc7a(++_0x52a63c);}(_0x220d,0x132));var _0xd220=function(_0x87a841,_0x7d2a52){_0x87a841=_0x87a841-0x0;var _0x26e9ef=_0x220d[_0x87a841];return _0x26e9ef;};'use strict';var _=require(_0xd220('0x0'));var BPromise=require(_0xd220('0x1'));var rp=require('request-promise');var util=require(_0xd220('0x2'));var intUtil=require(_0xd220('0x3'));var md5=require(_0xd220('0x4'));var Redis=require(_0xd220('0x5'));var logger=require(_0xd220('0x6'))(_0xd220('0x7'));var config=require(_0xd220('0x8'));config[_0xd220('0x9')]=_[_0xd220('0xa')](config[_0xd220('0x9')],{'host':_0xd220('0xb'),'port':0x18eb});var io=require(_0xd220('0xc'))(new Redis(config[_0xd220('0x9')]));function getAuthToken(_0x51dcce,_0x252897,_0xd8a71e){var _0x2062ec={'method':_0xd220('0xd'),'uri':_0x252897,'form':{'client_id':_0x51dcce[_0xd220('0xe')],'resource':_0x51dcce[_0xd220('0xf')],'username':_0x51dcce[_0xd220('0x10')],'password':_0x51dcce[_0xd220('0x11')],'grant_type':'password','client_secret':_0x51dcce['clientSecret']},'json':!![]};return rp(_0x2062ec)['then'](function(_0x104f9c){return _0x104f9c[_0xd220('0x12')];})[_0xd220('0x13')](function(_0x2c1cce){logger[_0xd220('0x14')]('['+[_0xd8a71e['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x2c1cce['message'];});}function getUser(_0x4d3cf8,_0x119ed6,_0x231608,_0x4793a1,_0x42c1d9,_0x4c450e){return new BPromise(function(_0x29e92f,_0xfa2e97){return getAuthToken(_0x119ed6,_0x4793a1,_0x4c450e)[_0xd220('0x15')](function(_0x34e33d){var _0x46c7fa={'method':_0xd220('0x16'),'uri':_0x42c1d9+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xd220('0x17')+_0x34e33d,'OData-Version':'4.0'},'json':!![]};return rp(_0x46c7fa);})[_0xd220('0x15')](function(_0xe00b22){var _0x5f0620=_0xe00b22[_0xd220('0x18')];var _0x4979d3=![];var _0x559d8a=null;if(!_[_0xd220('0x19')](_0x231608)){if(intUtil[_0xd220('0x1a')](_0x231608['email'])){_0x4d3cf8[_0xd220('0x1b')]=_0x231608[_0xd220('0x1c')];for(_0x559d8a=0x0;_0x559d8a<_0x5f0620['length'];_0x559d8a++){if(_0x5f0620[_0x559d8a][_0xd220('0x1d')]===_0x231608[_0xd220('0x1c')]&&!_0x5f0620[_0x559d8a][_0xd220('0x1e')]){_0x4979d3=!![];logger[_0xd220('0x1f')]('['+[_0x4c450e[_0xd220('0x20')]()]+_0xd220('0x21')+_0x5f0620[_0x559d8a][_0xd220('0x22')]+'!');_0x4d3cf8['userId']=_0x5f0620[_0x559d8a][_0xd220('0x22')];}}}}if(!_0x4979d3){logger[_0xd220('0x1f')]('['+[_0x4c450e[_0xd220('0x20')]()]+_0xd220('0x23'));_0x4d3cf8[_0xd220('0x1b')]=_0x119ed6[_0xd220('0x10')];for(_0x559d8a=0x0;_0x559d8a<_0x5f0620['length'];_0x559d8a++){if(_0x5f0620[_0x559d8a][_0xd220('0x1d')]===_0x119ed6[_0xd220('0x10')]){_0x4d3cf8['userId']=_0x5f0620[_0x559d8a]['systemuserid'];}}}_0x29e92f(_0x4d3cf8);})['catch'](function(_0x43a956){_0xfa2e97(_0x43a956[_0xd220('0x24')]);});});}function createEndUser(_0x3886a4,_0x271ab0,_0x37c66c,_0x6d2efe,_0xb02d1f,_0x4d9509){return new BPromise(function(_0x2c1e8f,_0x388abd){return getAuthToken(_0x271ab0,_0x37c66c,_0x4d9509)[_0xd220('0x15')](function(_0x206933){var _0x3f4806=_0x4d9509[_0xd220('0x25')]()===_0xd220('0x26')?_0xb02d1f[_0xd220('0x27')]:_0xb02d1f[_0xd220('0x28')];var _0xa64fcf={'method':_0xd220('0xd'),'uri':_0x6d2efe+_0xd220('0x29'),'body':{'telephone1':_0x3f4806,'fullname':_0x3f4806,'firstname':_0x3f4806,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd220('0x2a')+_0x3886a4[_0xd220('0x2b')]+')'},'headers':{'Authorization':_0xd220('0x17')+_0x206933,'OData-Version':_0xd220('0x2c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xa64fcf);})[_0xd220('0x15')](function(_0x3ae539){var _0x49547b=_0x3ae539[_0xd220('0x2d')][_0xd220('0x2e')];var _0x2fe93b=_0x49547b[_0xd220('0x2f')](_0x49547b[_0xd220('0x30')]('(')+0x1,_0x49547b[_0xd220('0x30')](')'));_0x3886a4['enduserId']=_0x2fe93b;_0x2c1e8f(_0x3886a4);})[_0xd220('0x13')](function(_0x4d02f8){_0x388abd(_0x4d02f8[_0xd220('0x24')]);});});}function getEndUser(_0x175505,_0x44af81,_0xa6dad5,_0x3e2d06,_0x360041,_0x189009){return new BPromise(function(_0x239c6d,_0x658eee){var _0x12cbac=_0x189009[_0xd220('0x25')]()===_0xd220('0x26')?_0x360041[_0xd220('0x27')]:_0x360041[_0xd220('0x28')];return getAuthToken(_0x44af81,_0xa6dad5,_0x189009)[_0xd220('0x15')](function(_0x94ecce){var _0xd0184e={'method':_0xd220('0x16'),'uri':_0x3e2d06+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x12cbac['replace']('+','%2b')+'\x27','headers':{'Authorization':_0xd220('0x17')+_0x94ecce,'If-None-Match':null,'OData-Version':_0xd220('0x2c')},'json':!![]};return rp(_0xd0184e);})[_0xd220('0x15')](function(_0x4f5215){var _0x5c3903=null;if(_0x4f5215){var _0x723e10=_0x4f5215['value'];var _0x459b85=![];for(_0x5c3903=0x0;_0x5c3903<_0x723e10[_0xd220('0x31')];_0x5c3903++){if(_0x723e10[_0x5c3903][_0xd220('0x32')]===_0x12cbac){_0x459b85=!![];_0x175505[_0xd220('0x33')]=_0x723e10[_0x5c3903][_0xd220('0x34')];}}if(_0x459b85){_0x239c6d(_0x175505);}else{return createEndUser(_0x175505,_0x44af81,_0xa6dad5,_0x3e2d06,_0x360041,_0x189009)[_0xd220('0x15')](function(_0x4f32e8){logger[_0xd220('0x1f')]('['+[_0x189009[_0xd220('0x20')]()]+_0xd220('0x35'),_0x4f32e8['enduserId']);_0x239c6d(_0x4f32e8);});}}else{return createEndUser(_0x175505,_0x44af81,_0xa6dad5,_0x3e2d06,_0x360041,_0x189009)[_0xd220('0x15')](function(_0x4ef29e){logger[_0xd220('0x1f')]('['+[_0x189009[_0xd220('0x20')]()]+_0xd220('0x36'),_0x4ef29e['enduserId']);_0x239c6d(_0x4ef29e);});}});});}function getCustomFields(_0x7985a5,_0x2f3e2a,_0x34390e){var _0x2b1f5a={};if(_0x7985a5[_0xd220('0x31')]>0x0){_[_0xd220('0x37')](_0x7985a5,function(_0x49656d){if(_[_0xd220('0x38')]([_0xd220('0x39'),_0xd220('0x3a')],_0x49656d[_0xd220('0x3b')])&&_0x49656d[_0xd220('0x3c')]&&!_0x49656d[_0xd220('0x3d')]){var _0x384143=_0x49656d[_0xd220('0x3e')][_0xd220('0x25')]();var _0x5e29ab=_0x384143['substring'](0x0,_0x384143['indexOf']('_'));var _0x4cdde9=_0x384143['substring'](_0x384143[_0xd220('0x3f')]('_')+0x1);if(_0x5e29ab===_0x34390e){_0x2b1f5a[_0x4cdde9]=_0x49656d[_0xd220('0x40')];}}});}return _0x2b1f5a;}function getTicket(_0x16c35b,_0x2c0268,_0x5d8f56,_0x29e617,_0xaeda11,_0x1d57b5,_0x153a5e){return new BPromise(function(_0x3f0c27,_0x48510c){var _0x1fa037;return getAuthToken(_0x2c0268,_0x5d8f56,_0x153a5e)['then'](function(_0x160bf0){if(_0x1d57b5[_0xd220('0x41')]===_0xd220('0x42')){_0x1fa037={'method':_0xd220('0xd'),'uri':_0x29e617+'incidents','body':Object[_0xd220('0x43')]({},{'title':intUtil[_0xd220('0x44')](_0x1d57b5['Subjects'],_0xaeda11,'\x20'),'description':intUtil[_0xd220('0x44')](_0x1d57b5[_0xd220('0x45')],_0xaeda11,'\x0a'),'customerid_contact@odata.bind':_0xd220('0x46')+_0x16c35b[_0xd220('0x33')]+')','ownerid@odata.bind':'/systemusers('+_0x16c35b[_0xd220('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0x1d57b5[_0xd220('0x47')],_0xaeda11,_0x1d57b5[_0xd220('0x41')])),'headers':{'Authorization':_0xd220('0x17')+_0x160bf0,'OData-Version':_0xd220('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1d57b5[_0xd220('0x41')]===_0xd220('0x48')){_0x1fa037={'method':_0xd220('0xd'),'uri':_0x29e617+'phonecalls','body':Object[_0xd220('0x43')]({},{'subject':intUtil['getString'](_0x1d57b5['Subjects'],_0xaeda11,'\x20'),'phonenumber':String(_0xaeda11[_0xd220('0x28')]),'description':intUtil[_0xd220('0x44')](_0x1d57b5[_0xd220('0x45')],_0xaeda11,'\x0a'),'regardingobjectid_contact@odata.bind':_0xd220('0x46')+_0x16c35b[_0xd220('0x33')]+')','ownerid@odata.bind':_0xd220('0x2a')+_0x16c35b['userId']+')','directioncode':_0x16c35b[_0xd220('0x49')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xd220('0x2a')+_0x16c35b['userId']+')','participationtypemask':_0x16c35b[_0xd220('0x49')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xd220('0x46')+_0x16c35b[_0xd220('0x33')]+')','participationtypemask':_0x16c35b[_0xd220('0x49')]===_0xd220('0x4a')?0x1:0x2}]},getCustomFields(_0x1d57b5[_0xd220('0x47')],_0xaeda11,_0x1d57b5[_0xd220('0x41')])),'headers':{'Authorization':_0xd220('0x17')+_0x160bf0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1fa037);})[_0xd220('0x15')](function(_0x306a70){var _0x3a662c=_0x306a70['headers'][_0xd220('0x2e')];var _0x19e67b=_0x3a662c[_0xd220('0x2f')](_0x3a662c[_0xd220('0x30')]('(')+0x1,_0x3a662c[_0xd220('0x30')](')'));_0x16c35b['ticketId']=_0x19e67b;_0x3f0c27(_0x16c35b);})[_0xd220('0x13')](function(_0x14e1da){_0x48510c(_0x14e1da[_0xd220('0x24')]);});});}function emit(_0x4b59fe,_0x2b991d,_0x7459e2,_0x47eded){var _0x1d242a={'uri':util[_0xd220('0x4b')](_0xd220('0x4c'),_0x4b59fe,_0x7459e2,_0x47eded)};io['to'](util[_0xd220('0x4b')]('user:%s',_0x2b991d))[_0xd220('0x4d')]('trigger:browser:url',_0x1d242a);}exports['cs']=function(_0x25b3f1,_0x1ed698,_0x88f563,_0xf1632a,_0xe1e1df,_0x3077e5,_0x15c724,_0x30bebe){var _0x451ddc={};_0x3077e5['remoteUri']=intUtil[_0xd220('0x4e')](_0x3077e5[_0xd220('0xf')]);_0x3077e5[_0xd220('0x4f')]=intUtil[_0xd220('0x4e')](_0x3077e5[_0xd220('0x4f')]);_0x451ddc[_0xd220('0x49')]=_0x30bebe===_0xd220('0x4a')||_0x30bebe==='unmanaged'?_0xd220('0x4a'):_0xd220('0x26');var _0x4af64d=util[_0xd220('0x4b')]('%s/api/data/v9.0/',_0x3077e5['remoteUri']);var _0x455b5c=util[_0xd220('0x4b')](_0xd220('0x50'),_0x3077e5['tenantId']);var _0x102899=util[_0xd220('0x4b')](_0xd220('0x51'),_0x3077e5[_0xd220('0x4f')],_0x1ed698[_0xd220('0x52')],md5(_0x1ed698[_0xd220('0x52')]));if(_0xe1e1df&&_0xe1e1df[_0xd220('0x53')]){logger['info'](_0xd220('0x54'),_0xd220('0x55'));_0x1ed698['recordingURL']=_0x102899;}else if(_0x15c724&&_0x15c724[_0xd220('0x56')]&&_0x15c724[_0xd220('0x56')]!==_0xd220('0x57')){logger['info']('[OUTBOUND]',_0xd220('0x55'));_0x1ed698['recordingURL']=_0x102899;}else{_0x1ed698[_0xd220('0x58')]='';}return getUser(_0x451ddc,_0x3077e5,_0xf1632a,_0x455b5c,_0x4af64d,_0x30bebe)['then'](function(_0x3ee271){logger[_0xd220('0x1f')]('['+_0x30bebe[_0xd220('0x20')]()+']\x20The\x20User\x20ID\x20is:',_0x3ee271[_0xd220('0x2b')]);logger[_0xd220('0x1f')]('['+_0x30bebe['toUpperCase']()+_0xd220('0x59'),_0x3ee271[_0xd220('0x1b')]);return getEndUser(_0x3ee271,_0x3077e5,_0x455b5c,_0x4af64d,_0x1ed698,_0x30bebe);})[_0xd220('0x15')](function(_0x3743e9){logger[_0xd220('0x1f')]('['+_0x30bebe[_0xd220('0x20')]()+_0xd220('0x5a'),_0x3743e9[_0xd220('0x33')]);logger['info']('['+_0x30bebe[_0xd220('0x20')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x1ed698['calleridnum']);return getTicket(_0x3743e9,_0x3077e5,_0x455b5c,_0x4af64d,_0x1ed698,_0x88f563,_0x30bebe);})[_0xd220('0x15')](function(_0xd295e1){logger[_0xd220('0x1f')](util[_0xd220('0x4b')]('['+_0x30bebe['toUpperCase']()+_0xd220('0x5b'),_0x88f563[_0xd220('0x41')],_0xd295e1['ticketId']));logger[_0xd220('0x1f')](util['format']('['+_0x30bebe['toUpperCase']()+_0xd220('0x5c'),_0x30bebe));if(_0x30bebe!=='unmanaged'){logger['info']('['+_0x30bebe['toUpperCase']()+']',_0xd220('0x5d'));emit(_0x3077e5[_0xd220('0xf')],_0xf1632a['name'],_0x88f563['ticketType'],_0xd295e1[_0xd220('0x5e')]);}})['catch'](function(_0x4337bd){logger[_0xd220('0x14')]('['+_0x30bebe['toUpperCase']()+_0xd220('0x5f'),util[_0xd220('0x60')](_0x4337bd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x11b0=['idField','indexOf','content','getString','Subjects','Descriptions','ticketType','phonecall','phonecalls','/contacts(','queue','callDirection','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','serverUrl','stripTrailingSlash','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name','error','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','userEmail','email','internalemailaddress','isdisabled','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','message','toLowerCase','outbound','calleridnum','/systemusers(','4.0','headers','substring','lastIndexOf','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','enduserId','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField'];(function(_0x2b2949,_0x262ee6){var _0x458169=function(_0x6c6128){while(--_0x6c6128){_0x2b2949['push'](_0x2b2949['shift']());}};_0x458169(++_0x262ee6);}(_0x11b0,0x1ae));var _0x011b=function(_0x61eca0,_0x1a2a88){_0x61eca0=_0x61eca0-0x0;var _0x37cb7f=_0x11b0[_0x61eca0];return _0x37cb7f;};'use strict';var _=require('lodash');var BPromise=require(_0x011b('0x0'));var rp=require(_0x011b('0x1'));var util=require(_0x011b('0x2'));var intUtil=require(_0x011b('0x3'));var md5=require(_0x011b('0x4'));var Redis=require(_0x011b('0x5'));var logger=require(_0x011b('0x6'))(_0x011b('0x7'));var config=require(_0x011b('0x8'));config[_0x011b('0x9')]=_[_0x011b('0xa')](config[_0x011b('0x9')],{'host':_0x011b('0xb'),'port':0x18eb});var io=require(_0x011b('0xc'))(new Redis(config[_0x011b('0x9')]));function getAuthToken(_0x4d92a0,_0x25543a,_0x546f9d){var _0x424c2d={'method':_0x011b('0xd'),'uri':_0x25543a,'form':{'client_id':_0x4d92a0[_0x011b('0xe')],'resource':_0x4d92a0[_0x011b('0xf')],'username':_0x4d92a0[_0x011b('0x10')],'password':_0x4d92a0[_0x011b('0x11')],'grant_type':_0x011b('0x11'),'client_secret':_0x4d92a0['clientSecret']},'json':!![]};return rp(_0x424c2d)['then'](function(_0x29ea8e){return _0x29ea8e[_0x011b('0x12')];})[_0x011b('0x13')](function(_0xbe924f){logger['error']('['+[_0x546f9d[_0x011b('0x14')]()]+_0x011b('0x15'));return _0xbe924f['message'];});}function getUser(_0x421098,_0x349b4c,_0x35e2e1,_0x584dca,_0x20e6fc,_0x11c473){return new BPromise(function(_0x515ac1,_0x1a174e){return getAuthToken(_0x349b4c,_0x584dca,_0x11c473)[_0x011b('0x16')](function(_0x552660){var _0x43bc35={'method':_0x011b('0x17'),'uri':_0x20e6fc+_0x011b('0x18'),'headers':{'Authorization':_0x011b('0x19')+_0x552660,'OData-Version':'4.0'},'json':!![]};return rp(_0x43bc35);})[_0x011b('0x16')](function(_0x351d88){var _0x34bcfe=_0x351d88[_0x011b('0x1a')];var _0x4ad08=![];var _0x59dea2=null;if(!_[_0x011b('0x1b')](_0x35e2e1)){if(intUtil['validateEmail'](_0x35e2e1['email'])){_0x421098[_0x011b('0x1c')]=_0x35e2e1[_0x011b('0x1d')];for(_0x59dea2=0x0;_0x59dea2<_0x34bcfe['length'];_0x59dea2++){if(_0x34bcfe[_0x59dea2][_0x011b('0x1e')]===_0x35e2e1[_0x011b('0x1d')]&&!_0x34bcfe[_0x59dea2][_0x011b('0x1f')]){_0x4ad08=!![];logger['info']('['+[_0x11c473[_0x011b('0x14')]()]+']\x20Agent\x20found\x20'+_0x34bcfe[_0x59dea2][_0x011b('0x20')]+'!');_0x421098[_0x011b('0x21')]=_0x34bcfe[_0x59dea2][_0x011b('0x20')];}}}}if(!_0x4ad08){logger['info']('['+[_0x11c473[_0x011b('0x14')]()]+_0x011b('0x22'));_0x421098['userEmail']=_0x349b4c[_0x011b('0x10')];for(_0x59dea2=0x0;_0x59dea2<_0x34bcfe[_0x011b('0x23')];_0x59dea2++){if(_0x34bcfe[_0x59dea2]['internalemailaddress']===_0x349b4c[_0x011b('0x10')]){_0x421098[_0x011b('0x21')]=_0x34bcfe[_0x59dea2][_0x011b('0x20')];}}}_0x515ac1(_0x421098);})[_0x011b('0x13')](function(_0x17affb){_0x1a174e(_0x17affb[_0x011b('0x24')]);});});}function createEndUser(_0x54bb6f,_0x1ae51b,_0xf27735,_0x291bb7,_0x406ee6,_0xa30b20){return new BPromise(function(_0x569058,_0x35c1b6){return getAuthToken(_0x1ae51b,_0xf27735,_0xa30b20)[_0x011b('0x16')](function(_0x1d1515){var _0x5537b7=_0xa30b20[_0x011b('0x25')]()===_0x011b('0x26')?_0x406ee6['destcalleridnum']:_0x406ee6[_0x011b('0x27')];var _0x51d688={'method':_0x011b('0xd'),'uri':_0x291bb7+'contacts','body':{'telephone1':_0x5537b7,'fullname':_0x5537b7,'firstname':_0x5537b7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x011b('0x28')+_0x54bb6f[_0x011b('0x21')]+')'},'headers':{'Authorization':_0x011b('0x19')+_0x1d1515,'OData-Version':_0x011b('0x29')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x51d688);})[_0x011b('0x16')](function(_0x2c7138){var _0x282f57=_0x2c7138[_0x011b('0x2a')]['odata-entityid'];var _0x66a365=_0x282f57[_0x011b('0x2b')](_0x282f57[_0x011b('0x2c')]('(')+0x1,_0x282f57['lastIndexOf'](')'));_0x54bb6f['enduserId']=_0x66a365;_0x569058(_0x54bb6f);})['catch'](function(_0x2d2100){_0x35c1b6(_0x2d2100[_0x011b('0x24')]);});});}function getEndUser(_0x56695d,_0x756083,_0x5c85b0,_0x40c24d,_0x3e95d8,_0x42ba2e){return new BPromise(function(_0x9dbcaf,_0x3250f2){var _0x2356fd=_0x42ba2e[_0x011b('0x25')]()===_0x011b('0x26')?_0x3e95d8[_0x011b('0x2d')]:_0x3e95d8[_0x011b('0x27')];return getAuthToken(_0x756083,_0x5c85b0,_0x42ba2e)[_0x011b('0x16')](function(_0x17581c){var _0x4905a7={'method':'GET','uri':_0x40c24d+_0x011b('0x2e')+_0x2356fd[_0x011b('0x2f')]('+',_0x011b('0x30'))+'\x27','headers':{'Authorization':_0x011b('0x19')+_0x17581c,'If-None-Match':null,'OData-Version':_0x011b('0x29')},'json':!![]};return rp(_0x4905a7);})[_0x011b('0x16')](function(_0x320be9){var _0x42b987=null;if(_0x320be9){var _0x59005f=_0x320be9['value'];var _0x3c12a6=![];for(_0x42b987=0x0;_0x42b987<_0x59005f['length'];_0x42b987++){if(_0x59005f[_0x42b987]['telephone1']===_0x2356fd){_0x3c12a6=!![];_0x56695d[_0x011b('0x31')]=_0x59005f[_0x42b987]['contactid'];}}if(_0x3c12a6){_0x9dbcaf(_0x56695d);}else{return createEndUser(_0x56695d,_0x756083,_0x5c85b0,_0x40c24d,_0x3e95d8,_0x42ba2e)['then'](function(_0x182717){logger[_0x011b('0x32')]('['+[_0x42ba2e[_0x011b('0x14')]()]+_0x011b('0x33'),_0x182717[_0x011b('0x31')]);_0x9dbcaf(_0x182717);});}}else{return createEndUser(_0x56695d,_0x756083,_0x5c85b0,_0x40c24d,_0x3e95d8,_0x42ba2e)[_0x011b('0x16')](function(_0x3ad3b2){logger['info']('['+[_0x42ba2e['toUpperCase']()]+_0x011b('0x34'),_0x3ad3b2[_0x011b('0x31')]);_0x9dbcaf(_0x3ad3b2);});}});});}function getCustomFields(_0x4c9941,_0x1a0d11,_0x29b81a){var _0x34ae0a={};if(_0x4c9941[_0x011b('0x23')]>0x0){_[_0x011b('0x35')](_0x4c9941,function(_0x27898e){if(_[_0x011b('0x36')]([_0x011b('0x37'),_0x011b('0x38')],_0x27898e[_0x011b('0x39')])&&_0x27898e[_0x011b('0x3a')]&&!_0x27898e[_0x011b('0x3b')]){var _0x167caa=_0x27898e[_0x011b('0x3c')][_0x011b('0x25')]();var _0x5d9459=_0x167caa[_0x011b('0x2b')](0x0,_0x167caa[_0x011b('0x3d')]('_'));var _0x10e090=_0x167caa[_0x011b('0x2b')](_0x167caa[_0x011b('0x3d')]('_')+0x1);if(_0x5d9459===_0x29b81a){_0x34ae0a[_0x10e090]=_0x27898e[_0x011b('0x3e')];}}});}return _0x34ae0a;}function getTicket(_0x4a1ffc,_0x1b30e3,_0x4b5f22,_0x5c61c5,_0x18966c,_0x2bcd8d,_0x3910fd){return new BPromise(function(_0x432e6f,_0x21ed5d){var _0x2d09d0;return getAuthToken(_0x1b30e3,_0x4b5f22,_0x3910fd)[_0x011b('0x16')](function(_0x5f59f0){if(_0x2bcd8d['ticketType']==='incident'){_0x2d09d0={'method':_0x011b('0xd'),'uri':_0x5c61c5+'incidents','body':Object['assign']({},{'title':intUtil[_0x011b('0x3f')](_0x2bcd8d[_0x011b('0x40')],_0x18966c,'\x20'),'description':intUtil[_0x011b('0x3f')](_0x2bcd8d[_0x011b('0x41')],_0x18966c,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x4a1ffc[_0x011b('0x31')]+')','ownerid@odata.bind':_0x011b('0x28')+_0x4a1ffc['userId']+')','caseorigincode':'1'},getCustomFields(_0x2bcd8d['Fields'],_0x18966c,_0x2bcd8d[_0x011b('0x42')])),'headers':{'Authorization':_0x011b('0x19')+_0x5f59f0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2bcd8d[_0x011b('0x42')]===_0x011b('0x43')){_0x2d09d0={'method':_0x011b('0xd'),'uri':_0x5c61c5+_0x011b('0x44'),'body':Object['assign']({},{'subject':intUtil[_0x011b('0x3f')](_0x2bcd8d[_0x011b('0x40')],_0x18966c,'\x20'),'phonenumber':String(_0x18966c[_0x011b('0x27')]),'description':intUtil[_0x011b('0x3f')](_0x2bcd8d[_0x011b('0x41')],_0x18966c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x011b('0x45')+_0x4a1ffc[_0x011b('0x31')]+')','ownerid@odata.bind':_0x011b('0x28')+_0x4a1ffc[_0x011b('0x21')]+')','directioncode':_0x4a1ffc['callDirection']===_0x011b('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x011b('0x28')+_0x4a1ffc[_0x011b('0x21')]+')','participationtypemask':_0x4a1ffc[_0x011b('0x47')]===_0x011b('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x011b('0x45')+_0x4a1ffc['enduserId']+')','participationtypemask':_0x4a1ffc[_0x011b('0x47')]===_0x011b('0x46')?0x1:0x2}]},getCustomFields(_0x2bcd8d[_0x011b('0x48')],_0x18966c,_0x2bcd8d[_0x011b('0x42')])),'headers':{'Authorization':_0x011b('0x19')+_0x5f59f0,'OData-Version':_0x011b('0x29')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2d09d0);})[_0x011b('0x16')](function(_0x4e885){var _0x2c181f=_0x4e885[_0x011b('0x2a')][_0x011b('0x49')];var _0x53f8ed=_0x2c181f[_0x011b('0x2b')](_0x2c181f[_0x011b('0x2c')]('(')+0x1,_0x2c181f[_0x011b('0x2c')](')'));_0x4a1ffc[_0x011b('0x4a')]=_0x53f8ed;_0x432e6f(_0x4a1ffc);})[_0x011b('0x13')](function(_0x3a1008){_0x21ed5d(_0x3a1008['message']);});});}function emit(_0x5075d1,_0x5b354e,_0x342c3e,_0x7e2bc1){var _0x11dda5={'uri':util[_0x011b('0x4b')](_0x011b('0x4c'),_0x5075d1,_0x342c3e,_0x7e2bc1)};io['to'](util[_0x011b('0x4b')]('user:%s',_0x5b354e))[_0x011b('0x4d')]('trigger:browser:url',_0x11dda5);}exports['cs']=function(_0x9a8444,_0x14dda6,_0x570d54,_0x3149f9,_0x5ef4d5,_0x2ff6d8,_0x59cb54,_0x2f23c2){var _0x24a511={};_0x2ff6d8['remoteUri']=intUtil['stripTrailingSlash'](_0x2ff6d8[_0x011b('0xf')]);_0x2ff6d8[_0x011b('0x4e')]=intUtil[_0x011b('0x4f')](_0x2ff6d8['serverUrl']);_0x24a511[_0x011b('0x47')]=_0x2f23c2===_0x011b('0x46')||_0x2f23c2===_0x011b('0x50')?_0x011b('0x46'):_0x011b('0x26');var _0xc737fc=util[_0x011b('0x4b')]('%s/api/data/v9.0/',_0x2ff6d8['remoteUri']);var _0xcf8cc9=util['format'](_0x011b('0x51'),_0x2ff6d8[_0x011b('0x52')]);var _0x387a3f=util[_0x011b('0x4b')](_0x011b('0x53'),_0x2ff6d8[_0x011b('0x4e')],_0x14dda6[_0x011b('0x54')],md5(_0x14dda6[_0x011b('0x54')]));if(_0x5ef4d5&&_0x5ef4d5['monitor_format']){logger[_0x011b('0x32')](_0x011b('0x55'),_0x011b('0x56'));_0x14dda6[_0x011b('0x57')]=_0x387a3f;}else if(_0x59cb54&&_0x59cb54[_0x011b('0x58')]&&_0x59cb54[_0x011b('0x58')]!==_0x011b('0x59')){logger[_0x011b('0x32')](_0x011b('0x5a'),_0x011b('0x56'));_0x14dda6[_0x011b('0x57')]=_0x387a3f;}else{_0x14dda6[_0x011b('0x57')]='';}return getUser(_0x24a511,_0x2ff6d8,_0x3149f9,_0xcf8cc9,_0xc737fc,_0x2f23c2)[_0x011b('0x16')](function(_0x5caf90){logger['info']('['+_0x2f23c2['toUpperCase']()+_0x011b('0x5b'),_0x5caf90[_0x011b('0x21')]);logger['info']('['+_0x2f23c2[_0x011b('0x14')]()+_0x011b('0x5c'),_0x5caf90[_0x011b('0x1c')]);return getEndUser(_0x5caf90,_0x2ff6d8,_0xcf8cc9,_0xc737fc,_0x14dda6,_0x2f23c2);})['then'](function(_0x1017b8){logger[_0x011b('0x32')]('['+_0x2f23c2[_0x011b('0x14')]()+_0x011b('0x5d'),_0x1017b8[_0x011b('0x31')]);logger[_0x011b('0x32')]('['+_0x2f23c2[_0x011b('0x14')]()+_0x011b('0x5e'),_0x14dda6[_0x011b('0x27')]);return getTicket(_0x1017b8,_0x2ff6d8,_0xcf8cc9,_0xc737fc,_0x14dda6,_0x570d54,_0x2f23c2);})['then'](function(_0x1f1db6){logger['info'](util['format']('['+_0x2f23c2[_0x011b('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x570d54['ticketType'],_0x1f1db6['ticketId']));logger[_0x011b('0x32')](util[_0x011b('0x4b')]('['+_0x2f23c2['toUpperCase']()+_0x011b('0x5f'),_0x2f23c2));if(_0x2f23c2!==_0x011b('0x50')){logger[_0x011b('0x32')]('['+_0x2f23c2[_0x011b('0x14')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2ff6d8[_0x011b('0xf')],_0x3149f9[_0x011b('0x60')],_0x570d54['ticketType'],_0x1f1db6[_0x011b('0x4a')]);}})[_0x011b('0x13')](function(_0x5072b1){logger[_0x011b('0x61')]('['+_0x2f23c2[_0x011b('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x5072b1,{'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 f848fcd..f973e01 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 _0x7dd7=['Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','stringify','map','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','push','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','[OUTBOUND]','error','unmanaged','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7dd7,0xa6));var _0x77dd=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0x7dd7[_0x41582d];return _0x59c504;};'use strict';var _=require(_0x77dd('0x0'));var rp=require(_0x77dd('0x1'));var md5=require(_0x77dd('0x2'));var util=require(_0x77dd('0x3'));var Redis=require(_0x77dd('0x4'));var intUtil=require('./util');var config=require(_0x77dd('0x5'));var logger=require(_0x77dd('0x6'))('freshdesk');config[_0x77dd('0x7')]=_[_0x77dd('0x8')](config[_0x77dd('0x7')],{'host':_0x77dd('0x9'),'port':0x18eb});var io=require(_0x77dd('0xa'))(new Redis(config[_0x77dd('0x7')]));var headers={'Content-Type':_0x77dd('0xb'),'Accept':'application/json'};function emit(_0x1c21f7,_0xd6f615,_0x14a8cc){io['to'](_0x1c21f7)[_0x77dd('0xc')](_0xd6f615,_0x14a8cc);}function getTicket(_0x495763,_0x132aa0,_0x25cd47,_0x2eb1cd,_0x2e081a){logger[_0x77dd('0xd')]('Creating\x20new\x20ticket...');var _0x31fc66=_[_0x77dd('0xe')]({'responder_id':_0x132aa0['id'],'requester_id':_0x25cd47['id'],'name':util[_0x77dd('0xf')](_0x77dd('0x10'),_0x2e081a[_0x77dd('0x11')]),'phone':_0x2e081a[_0x77dd('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x77dd('0x13')](_0x2eb1cd[_0x77dd('0x14')],_0x2e081a,'\x20'),'description':intUtil[_0x77dd('0x13')](_0x2eb1cd[_0x77dd('0x15')],_0x2e081a,_0x77dd('0x16')),'tags':getTags(_0x2eb1cd[_0x77dd('0x17')],_0x77dd('0x18'))},getCustomFields(_0x2eb1cd[_0x77dd('0x19')],_0x2e081a));_0x31fc66[_0x77dd('0x1a')]=_[_0x77dd('0x1b')](_[_0x77dd('0x1c')](_0x31fc66[_0x77dd('0x1a')],'id'),_0x77dd('0x1d'));return request({'uri':util['format'](_0x77dd('0x1e'),_0x495763[_0x77dd('0x1f')]),'method':'POST','body':_0x31fc66})[_0x77dd('0x20')](function(_0x34da39){logger['info'](_0x77dd('0x21'));return _0x34da39;});}function getUser(_0x42c673,_0x413431){if(intUtil[_0x77dd('0x22')](_0x413431)){return request({'uri':util[_0x77dd('0xf')]('%s/api/v2/agents',_0x42c673[_0x77dd('0x1f')]),'qs':{'email':_0x413431}})[_0x77dd('0x20')](function(_0x55170f){if(_0x55170f[_0x77dd('0x23')]){logger[_0x77dd('0xd')](_0x77dd('0x24'));return _[_0x77dd('0x25')](_0x55170f,function(_0x109103){return _0x109103[_0x77dd('0x26')]['email']===_0x413431;});}else{logger[_0x77dd('0xd')](_0x77dd('0x27'));return request({'uri':util[_0x77dd('0xf')](_0x77dd('0x28'),_0x42c673['remoteUri'])})[_0x77dd('0x20')](function(_0x4d70ab){logger[_0x77dd('0xd')](_0x77dd('0x29'));return _0x4d70ab;});}});}else{logger['info'](_0x77dd('0x2a'));return request({'uri':util[_0x77dd('0xf')](_0x77dd('0x28'),_0x42c673[_0x77dd('0x1f')])})['then'](function(_0x2eea92){logger[_0x77dd('0xd')](_0x77dd('0x29'));return _0x2eea92;});}}function getEndUser(_0x4cd7d4,_0x23c2fc,_0x5bb242){logger[_0x77dd('0xd')](_0x77dd('0x2b'),_0x5bb242);return request({'uri':util[_0x77dd('0xf')](_0x77dd('0x2c'),_0x4cd7d4['remoteUri']),'qs':{'phone':_0x5bb242}})[_0x77dd('0x20')](function(_0x36b6fe){if(_0x36b6fe[_0x77dd('0x23')]){logger[_0x77dd('0xd')](_0x77dd('0x2d'));return _[_0x77dd('0x25')](_0x36b6fe,{'phone':_0x5bb242});}else{logger[_0x77dd('0xd')](_0x77dd('0x2e'));return request({'uri':util['format'](_0x77dd('0x2c'),_0x4cd7d4[_0x77dd('0x1f')]),'method':'POST','body':{'name':_0x23c2fc,'phone':_0x5bb242}})[_0x77dd('0x20')](function(_0x5de756){logger[_0x77dd('0xd')](_0x77dd('0x2f'));return _0x5de756;});}});}function getAuth(_0x8a997f){return util[_0x77dd('0xf')](_0x77dd('0x30'),new Buffer(_0x8a997f[_0x77dd('0x31')]+':X')[_0x77dd('0x32')]('base64'));}function request(_0x325e4c){logger[_0x77dd('0x33')]('[HTTP]',JSON[_0x77dd('0x34')](_0x325e4c));return rp(_[_0x77dd('0x8')](_0x325e4c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x44f879,_0x4dd51f){var _0x533e49=[];if(_0x44f879&&_0x44f879[_0x77dd('0x23')]>0x0){_0x533e49=_[_0x77dd('0x35')](_0x44f879,_0x4dd51f);}return _0x533e49;}function getCustomFields(_0x54e19a,_0x3e28f8){var _0x58cb8d=[];var _0x31e91b={'custom_fields':[]};if(_0x54e19a[_0x77dd('0x23')]>0x0){_['forEach'](_0x54e19a,function(_0x19b107){if(_[_0x77dd('0x36')]([_0x77dd('0x37'),'picklist'],_0x19b107[_0x77dd('0x38')])&&_0x19b107[_0x77dd('0x39')]&&!_0x19b107[_0x77dd('0x3a')]){_0x31e91b[_0x19b107[_0x77dd('0x39')][_0x77dd('0x3b')]()]=_0x19b107[_0x77dd('0x3c')][_0x77dd('0x32')]();}else if(_[_0x77dd('0x36')]([_0x77dd('0x37'),_0x77dd('0x3d')],_0x19b107[_0x77dd('0x38')])&&_0x19b107[_0x77dd('0x3e')]&&_0x19b107[_0x77dd('0x3a')]){_0x31e91b[_0x77dd('0x1a')][_0x77dd('0x3f')]({'id':_0x19b107[_0x77dd('0x3e')],'value':_0x19b107[_0x77dd('0x3c')]['toString']()});}else if(_0x19b107[_0x77dd('0x38')]==='variable'&&_0x19b107[_0x77dd('0x40')]&&_0x19b107[_0x77dd('0x3e')]&&_0x19b107[_0x77dd('0x3a')]){_0x3e28f8[_0x19b107['variableName']]&&_0x31e91b[_0x77dd('0x1a')]['push']({'id':_0x19b107[_0x77dd('0x3e')],'value':_0x3e28f8[_0x19b107[_0x77dd('0x40')]]['toString']()});}else if(_0x19b107[_0x77dd('0x38')]==='customVariable'&&_0x19b107[_0x77dd('0x41')]&&_0x19b107[_0x77dd('0x41')][_0x77dd('0x18')]&&_0x19b107[_0x77dd('0x3e')]&&_0x19b107[_0x77dd('0x3a')]){_0x3e28f8[_0x19b107['Variable'][_0x77dd('0x18')][_0x77dd('0x3b')]()]&&_0x31e91b['custom_fields'][_0x77dd('0x3f')]({'id':_0x19b107[_0x77dd('0x3e')],'value':_0x3e28f8[_0x19b107[_0x77dd('0x41')][_0x77dd('0x18')][_0x77dd('0x3b')]()][_0x77dd('0x32')]()});}});}return _0x31e91b;}exports[_0x77dd('0x42')]=function(_0x2fb72a,_0x28f14c,_0xea6e2b,_0x1ab934,_0x56b0d5,_0x2025ce){var _0x1973aa,_0x1c05bb;_0x2025ce[_0x77dd('0x1f')]=intUtil[_0x77dd('0x43')](_0x2025ce[_0x77dd('0x1f')]);_0x2025ce[_0x77dd('0x44')]=intUtil['stripTrailingSlash'](_0x2025ce[_0x77dd('0x44')]);if(_0x56b0d5&&_0x56b0d5[_0x77dd('0x45')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x28f14c[_0x77dd('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2025ce[_0x77dd('0x44')],_0x28f14c[_0x77dd('0x47')],md5(_0x28f14c['uniqueid']));}else{_0x28f14c[_0x77dd('0x46')]='';}headers[_0x77dd('0x48')]=getAuth(_0x2025ce);return getUser(_0x2025ce,_0x1ab934['email'])['then'](function(_0x3079c1){_0x1973aa=_0x3079c1;logger[_0x77dd('0xd')](_0x77dd('0x49'),_0x1973aa['id']);return getEndUser(_0x2025ce,_0x28f14c[_0x77dd('0x11')],_0x28f14c[_0x77dd('0x12')]);})[_0x77dd('0x20')](function(_0x1dbb4b){_0x1c05bb=_0x1dbb4b;logger[_0x77dd('0xd')](_0x77dd('0x4a'),_0x1c05bb['id']);return getTicket(_0x2025ce,_0x1973aa,_0x1c05bb,_0xea6e2b,_0x28f14c);})[_0x77dd('0x20')](function(_0x322559){if(_0x322559&&_0x322559['id']){logger[_0x77dd('0xd')]('Ticket\x20created!');logger[_0x77dd('0xd')](_0x77dd('0x4b'),_0x322559['id']);logger[_0x77dd('0xd')](_0x77dd('0x4c'),_0x77dd('0x4d'));emit(util[_0x77dd('0xf')](_0x77dd('0x4e'),_0x1ab934[_0x77dd('0x18')]),_0x77dd('0x4f'),{'uri':util['format'](_0x77dd('0x50'),_0x2025ce['remoteUri'],_0x322559['id'])});}})[_0x77dd('0x51')](function(_0x2b08d4){logger['error']('[QUEUE]',JSON[_0x77dd('0x34')](_0x2b08d4));});};exports[_0x77dd('0x52')]=function(_0xced2c9,_0x31ed86,_0x23fa9d,_0x3c4444,_0x1de2cd,_0x2b5dd3,_0x3c0028){var _0x12ef4b,_0x269540;_0x2b5dd3['remoteUri']=intUtil[_0x77dd('0x43')](_0x2b5dd3[_0x77dd('0x1f')]);_0x2b5dd3[_0x77dd('0x44')]=intUtil[_0x77dd('0x43')](_0x2b5dd3[_0x77dd('0x44')]);if(_0x3c0028&&_0x3c0028[_0x77dd('0x53')]&&_0x3c0028['recordingFormat']!=='none'){logger[_0x77dd('0xd')]('[OUTBOUND]',_0x77dd('0x54'));_0x31ed86[_0x77dd('0x46')]=util['format'](_0x77dd('0x55'),_0x2b5dd3[_0x77dd('0x44')],_0x31ed86[_0x77dd('0x47')],md5(_0x31ed86[_0x77dd('0x47')]));}headers[_0x77dd('0x48')]=getAuth(_0x2b5dd3);return getUser(_0x2b5dd3,_0x3c4444[_0x77dd('0x56')])[_0x77dd('0x20')](function(_0x35f449){_0x12ef4b=_0x35f449;logger[_0x77dd('0xd')](_0x77dd('0x49'),_0x12ef4b['id']);return getEndUser(_0x2b5dd3,_0x31ed86[_0x77dd('0x57')],_0x31ed86[_0x77dd('0x58')]);})['then'](function(_0x178a1e){_0x269540=_0x178a1e;logger[_0x77dd('0xd')](_0x77dd('0x4a'),_0x269540['id']);return getTicket(_0x2b5dd3,_0x12ef4b,_0x269540,_0x23fa9d,_0x31ed86);})[_0x77dd('0x20')](function(_0x8cd5a1){if(_0x8cd5a1&&_0x8cd5a1['id']){logger['info']('Ticket\x20created!');logger[_0x77dd('0xd')](_0x77dd('0x4b'),_0x8cd5a1['id']);logger[_0x77dd('0xd')](_0x77dd('0x59'),_0x77dd('0x4d'));emit(util[_0x77dd('0xf')](_0x77dd('0x4e'),_0x3c4444[_0x77dd('0x18')]),'trigger:browser:url',{'uri':util[_0x77dd('0xf')](_0x77dd('0x50'),_0x2b5dd3[_0x77dd('0x1f')],_0x8cd5a1['id'])});}})[_0x77dd('0x51')](function(_0x40672b){logger[_0x77dd('0x5a')](_0x77dd('0x59'),JSON[_0x77dd('0x34')](_0x40672b));});};exports[_0x77dd('0x5b')]=function(_0x49e4a3,_0x5a8887,_0x309c53,_0x58f83a,_0x238871,_0x1a1fab){var _0x256648,_0x341377;_0x1a1fab[_0x77dd('0x1f')]=intUtil[_0x77dd('0x43')](_0x1a1fab[_0x77dd('0x1f')]);_0x1a1fab[_0x77dd('0x44')]=intUtil[_0x77dd('0x43')](_0x1a1fab[_0x77dd('0x44')]);if(_0x238871&&_0x238871['monitor_format']){logger[_0x77dd('0xd')]('['+_0x5a8887['lastevent']['toUpperCase']()+']',_0x77dd('0x54'));_0x5a8887['recordingURL']=util[_0x77dd('0xf')](_0x77dd('0x55'),_0x1a1fab[_0x77dd('0x44')],_0x5a8887['uniqueid'],md5(_0x5a8887['uniqueid']));}else{_0x5a8887[_0x77dd('0x46')]='';}headers[_0x77dd('0x48')]=getAuth(_0x1a1fab);return getUser(_0x1a1fab,'')[_0x77dd('0x20')](function(_0x4d8292){_0x256648=_0x4d8292;logger[_0x77dd('0xd')](_0x77dd('0x49'),_0x256648['id']);return getEndUser(_0x1a1fab,_0x5a8887[_0x77dd('0x11')],_0x5a8887[_0x77dd('0x12')]);})[_0x77dd('0x20')](function(_0x28e8f2){_0x341377=_0x28e8f2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x341377['id']);return getTicket(_0x1a1fab,_0x256648,_0x341377,_0x309c53,_0x5a8887);})[_0x77dd('0x20')](function(_0x53d9a1){if(_0x53d9a1){logger['info']('Ticket\x20created!');logger['info'](_0x77dd('0x4b'),_0x53d9a1['id']);}})[_0x77dd('0x51')](function(_0x406c3b){logger['error']('['+_0x5a8887['lastevent'][_0x77dd('0x5c')]()+']',JSON['stringify'](_0x406c3b));});}; \ No newline at end of file +var _0xb4d3=['localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','format','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','push','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb4d3,0x1c7));var _0x3b4d=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xb4d3[_0x18f152];return _0xa10b34;};'use strict';var _=require(_0x3b4d('0x0'));var rp=require(_0x3b4d('0x1'));var md5=require(_0x3b4d('0x2'));var util=require(_0x3b4d('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3b4d('0x4'));var config=require(_0x3b4d('0x5'));var logger=require(_0x3b4d('0x6'))(_0x3b4d('0x7'));config[_0x3b4d('0x8')]=_[_0x3b4d('0x9')](config[_0x3b4d('0x8')],{'host':_0x3b4d('0xa'),'port':0x18eb});var io=require(_0x3b4d('0xb'))(new Redis(config[_0x3b4d('0x8')]));var headers={'Content-Type':_0x3b4d('0xc'),'Accept':_0x3b4d('0xc')};function emit(_0x26bb70,_0x219ed0,_0x36751b){io['to'](_0x26bb70)[_0x3b4d('0xd')](_0x219ed0,_0x36751b);}function getTicket(_0x3a6622,_0xc4a1b3,_0x119486,_0x44fdd0,_0x33a55e){logger[_0x3b4d('0xe')](_0x3b4d('0xf'));var _0x5d22df=_[_0x3b4d('0x10')]({'responder_id':_0xc4a1b3['id'],'requester_id':_0x119486['id'],'name':util['format'](_0x3b4d('0x11'),_0x33a55e[_0x3b4d('0x12')]),'phone':_0x33a55e['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3b4d('0x13')](_0x44fdd0['Subjects'],_0x33a55e,'\x20'),'description':intUtil[_0x3b4d('0x13')](_0x44fdd0[_0x3b4d('0x14')],_0x33a55e,_0x3b4d('0x15')),'tags':getTags(_0x44fdd0[_0x3b4d('0x16')],_0x3b4d('0x17'))},getCustomFields(_0x44fdd0[_0x3b4d('0x18')],_0x33a55e));_0x5d22df[_0x3b4d('0x19')]=_['mapValues'](_[_0x3b4d('0x1a')](_0x5d22df[_0x3b4d('0x19')],'id'),_0x3b4d('0x1b'));return request({'uri':util[_0x3b4d('0x1c')]('%s/api/v2/tickets',_0x3a6622[_0x3b4d('0x1d')]),'method':'POST','body':_0x5d22df})[_0x3b4d('0x1e')](function(_0x4c95ed){logger[_0x3b4d('0xe')](_0x3b4d('0x1f'));return _0x4c95ed;});}function getUser(_0x5ba185,_0x202bdf){if(intUtil[_0x3b4d('0x20')](_0x202bdf)){return request({'uri':util[_0x3b4d('0x1c')](_0x3b4d('0x21'),_0x5ba185[_0x3b4d('0x1d')]),'qs':{'email':_0x202bdf}})[_0x3b4d('0x1e')](function(_0x1d888c){if(_0x1d888c[_0x3b4d('0x22')]){logger[_0x3b4d('0xe')]('Agent\x20found!');return _[_0x3b4d('0x23')](_0x1d888c,function(_0x290431){return _0x290431[_0x3b4d('0x24')][_0x3b4d('0x25')]===_0x202bdf;});}else{logger['info'](_0x3b4d('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x5ba185['remoteUri'])})[_0x3b4d('0x1e')](function(_0x158ba4){logger[_0x3b4d('0xe')]('Admin\x20account\x20selected.');return _0x158ba4;});}});}else{logger[_0x3b4d('0xe')](_0x3b4d('0x27'));return request({'uri':util[_0x3b4d('0x1c')](_0x3b4d('0x28'),_0x5ba185[_0x3b4d('0x1d')])})['then'](function(_0x21014b){logger[_0x3b4d('0xe')](_0x3b4d('0x29'));return _0x21014b;});}}function getEndUser(_0x1d9111,_0x179e66,_0x5e9d70){logger[_0x3b4d('0xe')](_0x3b4d('0x2a'),_0x5e9d70);return request({'uri':util[_0x3b4d('0x1c')](_0x3b4d('0x2b'),_0x1d9111[_0x3b4d('0x1d')]),'qs':{'phone':_0x5e9d70}})[_0x3b4d('0x1e')](function(_0x29912a){if(_0x29912a[_0x3b4d('0x22')]){logger['info'](_0x3b4d('0x2c'));return _[_0x3b4d('0x23')](_0x29912a,{'phone':_0x5e9d70});}else{logger[_0x3b4d('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3b4d('0x1c')](_0x3b4d('0x2b'),_0x1d9111[_0x3b4d('0x1d')]),'method':'POST','body':{'name':_0x179e66,'phone':_0x5e9d70}})[_0x3b4d('0x1e')](function(_0x53feca){logger[_0x3b4d('0xe')](_0x3b4d('0x2d'));return _0x53feca;});}});}function getAuth(_0xdfc496){return util[_0x3b4d('0x1c')](_0x3b4d('0x2e'),new Buffer(_0xdfc496[_0x3b4d('0x2f')]+':X')[_0x3b4d('0x30')](_0x3b4d('0x31')));}function request(_0x30e302){logger['debug']('[HTTP]',JSON['stringify'](_0x30e302));return rp(_['defaults'](_0x30e302,{'method':_0x3b4d('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4fc59a,_0x7f590f){var _0x6ead1a=[];if(_0x4fc59a&&_0x4fc59a[_0x3b4d('0x22')]>0x0){_0x6ead1a=_[_0x3b4d('0x33')](_0x4fc59a,_0x7f590f);}return _0x6ead1a;}function getCustomFields(_0x5cc4e5,_0x52f137){var _0x352108=[];var _0x504d4a={'custom_fields':[]};if(_0x5cc4e5['length']>0x0){_[_0x3b4d('0x34')](_0x5cc4e5,function(_0x37c102){if(_[_0x3b4d('0x35')]([_0x3b4d('0x36'),_0x3b4d('0x37')],_0x37c102[_0x3b4d('0x38')])&&_0x37c102['nameField']&&!_0x37c102[_0x3b4d('0x39')]){_0x504d4a[_0x37c102[_0x3b4d('0x3a')][_0x3b4d('0x3b')]()]=_0x37c102[_0x3b4d('0x3c')][_0x3b4d('0x30')]();}else if(_[_0x3b4d('0x35')](['string','picklist'],_0x37c102[_0x3b4d('0x38')])&&_0x37c102[_0x3b4d('0x3d')]&&_0x37c102[_0x3b4d('0x39')]){_0x504d4a[_0x3b4d('0x19')][_0x3b4d('0x3e')]({'id':_0x37c102[_0x3b4d('0x3d')],'value':_0x37c102[_0x3b4d('0x3c')][_0x3b4d('0x30')]()});}else if(_0x37c102[_0x3b4d('0x38')]==='variable'&&_0x37c102['variableName']&&_0x37c102['idField']&&_0x37c102[_0x3b4d('0x39')]){_0x52f137[_0x37c102[_0x3b4d('0x3f')]]&&_0x504d4a['custom_fields']['push']({'id':_0x37c102['idField'],'value':_0x52f137[_0x37c102[_0x3b4d('0x3f')]]['toString']()});}else if(_0x37c102[_0x3b4d('0x38')]===_0x3b4d('0x40')&&_0x37c102[_0x3b4d('0x41')]&&_0x37c102['Variable']['name']&&_0x37c102[_0x3b4d('0x3d')]&&_0x37c102[_0x3b4d('0x39')]){_0x52f137[_0x37c102[_0x3b4d('0x41')][_0x3b4d('0x17')][_0x3b4d('0x3b')]()]&&_0x504d4a['custom_fields'][_0x3b4d('0x3e')]({'id':_0x37c102[_0x3b4d('0x3d')],'value':_0x52f137[_0x37c102['Variable']['name']['toLowerCase']()][_0x3b4d('0x30')]()});}});}return _0x504d4a;}exports['queue']=function(_0x2a3d5d,_0x2c91f5,_0x84138,_0x19743f,_0x241488,_0x1f02a1){var _0x1d5e9a,_0x10b62c;_0x1f02a1[_0x3b4d('0x1d')]=intUtil[_0x3b4d('0x42')](_0x1f02a1['remoteUri']);_0x1f02a1[_0x3b4d('0x43')]=intUtil['stripTrailingSlash'](_0x1f02a1['serverUrl']);if(_0x241488&&_0x241488[_0x3b4d('0x44')]){logger[_0x3b4d('0xe')](_0x3b4d('0x45'),_0x3b4d('0x46'));_0x2c91f5[_0x3b4d('0x47')]=util[_0x3b4d('0x1c')](_0x3b4d('0x48'),_0x1f02a1[_0x3b4d('0x43')],_0x2c91f5[_0x3b4d('0x49')],md5(_0x2c91f5[_0x3b4d('0x49')]));}else{_0x2c91f5[_0x3b4d('0x47')]='';}headers[_0x3b4d('0x4a')]=getAuth(_0x1f02a1);return getUser(_0x1f02a1,_0x19743f[_0x3b4d('0x25')])[_0x3b4d('0x1e')](function(_0x25d2b5){_0x1d5e9a=_0x25d2b5;logger[_0x3b4d('0xe')](_0x3b4d('0x4b'),_0x1d5e9a['id']);return getEndUser(_0x1f02a1,_0x2c91f5[_0x3b4d('0x12')],_0x2c91f5[_0x3b4d('0x4c')]);})[_0x3b4d('0x1e')](function(_0x497475){_0x10b62c=_0x497475;logger[_0x3b4d('0xe')]('The\x20Enduser\x20ID\x20is:',_0x10b62c['id']);return getTicket(_0x1f02a1,_0x1d5e9a,_0x10b62c,_0x84138,_0x2c91f5);})[_0x3b4d('0x1e')](function(_0x4fbd28){if(_0x4fbd28&&_0x4fbd28['id']){logger[_0x3b4d('0xe')]('Ticket\x20created!');logger['info'](_0x3b4d('0x4d'),_0x4fbd28['id']);logger[_0x3b4d('0xe')](_0x3b4d('0x45'),_0x3b4d('0x4e'));emit(util[_0x3b4d('0x1c')](_0x3b4d('0x4f'),_0x19743f[_0x3b4d('0x17')]),_0x3b4d('0x50'),{'uri':util['format'](_0x3b4d('0x51'),_0x1f02a1[_0x3b4d('0x1d')],_0x4fbd28['id'])});}})[_0x3b4d('0x52')](function(_0x22c3db){logger[_0x3b4d('0x53')](_0x3b4d('0x45'),JSON[_0x3b4d('0x54')](_0x22c3db));});};exports[_0x3b4d('0x55')]=function(_0x46e682,_0xabd8f2,_0x8b7fc,_0x4a8ee7,_0x41f964,_0x4a2cae,_0x5d57cb){var _0xecaad8,_0x4192a4;_0x4a2cae['remoteUri']=intUtil[_0x3b4d('0x42')](_0x4a2cae[_0x3b4d('0x1d')]);_0x4a2cae[_0x3b4d('0x43')]=intUtil[_0x3b4d('0x42')](_0x4a2cae['serverUrl']);if(_0x5d57cb&&_0x5d57cb[_0x3b4d('0x56')]&&_0x5d57cb[_0x3b4d('0x56')]!==_0x3b4d('0x57')){logger['info']('[OUTBOUND]',_0x3b4d('0x46'));_0xabd8f2['recordingURL']=util[_0x3b4d('0x1c')](_0x3b4d('0x48'),_0x4a2cae[_0x3b4d('0x43')],_0xabd8f2['uniqueid'],md5(_0xabd8f2[_0x3b4d('0x49')]));}headers[_0x3b4d('0x4a')]=getAuth(_0x4a2cae);return getUser(_0x4a2cae,_0x4a8ee7[_0x3b4d('0x25')])[_0x3b4d('0x1e')](function(_0x3cb7e9){_0xecaad8=_0x3cb7e9;logger[_0x3b4d('0xe')](_0x3b4d('0x4b'),_0xecaad8['id']);return getEndUser(_0x4a2cae,_0xabd8f2[_0x3b4d('0x58')],_0xabd8f2[_0x3b4d('0x59')]);})[_0x3b4d('0x1e')](function(_0x474686){_0x4192a4=_0x474686;logger['info'](_0x3b4d('0x5a'),_0x4192a4['id']);return getTicket(_0x4a2cae,_0xecaad8,_0x4192a4,_0x8b7fc,_0xabd8f2);})['then'](function(_0x422a9d){if(_0x422a9d&&_0x422a9d['id']){logger[_0x3b4d('0xe')](_0x3b4d('0x1f'));logger['info'](_0x3b4d('0x4d'),_0x422a9d['id']);logger[_0x3b4d('0xe')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3b4d('0x4f'),_0x4a8ee7[_0x3b4d('0x17')]),_0x3b4d('0x50'),{'uri':util[_0x3b4d('0x1c')](_0x3b4d('0x51'),_0x4a2cae[_0x3b4d('0x1d')],_0x422a9d['id'])});}})[_0x3b4d('0x52')](function(_0x51995b){logger[_0x3b4d('0x53')]('[OUTBOUND]',JSON['stringify'](_0x51995b));});};exports[_0x3b4d('0x5b')]=function(_0x32ca3b,_0x331132,_0x25653d,_0x14fb64,_0x1fe449,_0x828ba3){var _0xd8baca,_0xfc74bd;_0x828ba3[_0x3b4d('0x1d')]=intUtil['stripTrailingSlash'](_0x828ba3[_0x3b4d('0x1d')]);_0x828ba3['serverUrl']=intUtil[_0x3b4d('0x42')](_0x828ba3[_0x3b4d('0x43')]);if(_0x1fe449&&_0x1fe449[_0x3b4d('0x44')]){logger[_0x3b4d('0xe')]('['+_0x331132['lastevent']['toUpperCase']()+']',_0x3b4d('0x46'));_0x331132[_0x3b4d('0x47')]=util[_0x3b4d('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x828ba3['serverUrl'],_0x331132[_0x3b4d('0x49')],md5(_0x331132[_0x3b4d('0x49')]));}else{_0x331132[_0x3b4d('0x47')]='';}headers['Authorization']=getAuth(_0x828ba3);return getUser(_0x828ba3,'')[_0x3b4d('0x1e')](function(_0x5eaf07){_0xd8baca=_0x5eaf07;logger[_0x3b4d('0xe')](_0x3b4d('0x4b'),_0xd8baca['id']);return getEndUser(_0x828ba3,_0x331132[_0x3b4d('0x12')],_0x331132[_0x3b4d('0x4c')]);})[_0x3b4d('0x1e')](function(_0x2f806b){_0xfc74bd=_0x2f806b;logger[_0x3b4d('0xe')](_0x3b4d('0x5a'),_0xfc74bd['id']);return getTicket(_0x828ba3,_0xd8baca,_0xfc74bd,_0x25653d,_0x331132);})['then'](function(_0x75d2b9){if(_0x75d2b9){logger[_0x3b4d('0xe')](_0x3b4d('0x1f'));logger[_0x3b4d('0xe')](_0x3b4d('0x4d'),_0x75d2b9['id']);}})[_0x3b4d('0x52')](function(_0x41ae04){logger['error']('['+_0x331132['lastevent'][_0x3b4d('0x5c')]()+']',JSON['stringify'](_0x41ae04));});}; \ 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 4c4adf0..34e7809 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 _0xc35d=['unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','defaults','redis','localhost','GET','headers','info','Getting\x20admin\x20information','then','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','users','Getting\x20user\x20with\x20email','userEmail','agentEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','calleridnum','callDirection','queue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc35d,0x1a9));var _0xdc35=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0xc35d[_0x2b1bb9];return _0x59f401;};'use strict';var _=require(_0xdc35('0x0'));var rp=require('request-promise');var md5=require(_0xdc35('0x1'));var util=require('util');var moment=require(_0xdc35('0x2'));var Promise=require(_0xdc35('0x3'));var Redis=require(_0xdc35('0x4'));var intUtil=require(_0xdc35('0x5'));var config=require('../../../../config/environment');var logger=require(_0xdc35('0x6'))(_0xdc35('0x7'));config['redis']=_[_0xdc35('0x8')](config[_0xdc35('0x9')],{'host':_0xdc35('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdc35('0x9')]));function getAdminId(_0xa3aeb2,_0x62e8d1,_0x32cb8b,_0xbe345a){return new Promise(function(_0x2c75c1,_0x2f2438){var _0x3af292=![];var _0x1e02f0={'method':_0xdc35('0xb'),'uri':_0xbe345a+'/api/selector/owners','json':!![]};_0x1e02f0[_0xdc35('0xc')]=_0x32cb8b;logger[_0xdc35('0xd')](_0xdc35('0xe'));return rp(_0x1e02f0)[_0xdc35('0xf')](function(_0x2027b0){if(_0x2027b0){var _0x19b3c9=_0x2027b0['users'];var _0x488dc9=null;for(_0x488dc9=0x0;_0x488dc9<_0x19b3c9[_0xdc35('0x10')];_0x488dc9++){if(_0x19b3c9[_0x488dc9][_0xdc35('0x11')]===_0xa3aeb2['adminEmail']){_0xa3aeb2[_0xdc35('0x12')]=_0x19b3c9[_0x488dc9]['id'];_0x3af292=!![];}}if(_0x3af292){logger[_0xdc35('0xd')]('Admin\x20found:',_0xa3aeb2['adminId']);_0x2c75c1(_0xa3aeb2);}else{_0x2f2438({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2f2438({'statusCode':0x194,'message':_0xdc35('0x13')});}})[_0xdc35('0x14')](function(_0x4a7a33){logger[_0xdc35('0x15')]('['+[_0x62e8d1['toUpperCase']()]+']',_0x4a7a33[_0xdc35('0x16')]);_0x2f2438(_0x4a7a33);});});}function getUser(_0x338fb7,_0x3ef144,_0x44614d){return function(_0x4c9f9c){return new Promise(function(_0x112400,_0x5d0dd7){var _0x2ae3fd={'method':_0xdc35('0xb'),'uri':_0x44614d+'/api/selector/owners','json':!![]};_0x2ae3fd[_0xdc35('0xc')]=_0x3ef144;logger[_0xdc35('0xd')]('Getting\x20user\x20list');return rp(_0x2ae3fd)[_0xdc35('0xf')](function(_0xb5217a){if(_0xb5217a){var _0xb05c32=_0xb5217a[_0xdc35('0x17')];var _0x59a2d4=![];var _0x2db972=null;if(_0x4c9f9c['agentEmail']!==null){logger[_0xdc35('0xd')](_0xdc35('0x18'),_0x4c9f9c['agentEmail']);_0x4c9f9c[_0xdc35('0x19')]=_0x4c9f9c['agentEmail'];for(_0x2db972=0x0;_0x2db972<_0xb05c32['length'];_0x2db972++){if(_0xb05c32[_0x2db972][_0xdc35('0x11')]===_0x4c9f9c[_0xdc35('0x1a')]){_0x59a2d4=!![];_0x4c9f9c[_0xdc35('0x1b')]=_0xb05c32[_0x2db972]['id'];logger[_0xdc35('0xd')](_0xdc35('0x1c'),_0x4c9f9c['userId']);}}}if(!_0x59a2d4){logger['info'](_0xdc35('0x1d'));_0x4c9f9c[_0xdc35('0x19')]=_0x4c9f9c['adminEmail'];_0x4c9f9c[_0xdc35('0x1b')]=_0x4c9f9c[_0xdc35('0x12')];_0x59a2d4=!![];}if(_0x59a2d4){_0x112400(_0x4c9f9c);}else{_0x5d0dd7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5d0dd7({'statusCode':0x194,'message':_0xdc35('0x13')});}})[_0xdc35('0x14')](function(_0x1620d3){logger[_0xdc35('0x15')]('['+[_0x338fb7[_0xdc35('0x1e')]()]+']',_0x1620d3[_0xdc35('0x16')]);_0x5d0dd7(_0x1620d3);});});};}function searchContact(_0x5dfe57,_0xfc7318,_0x371e96,_0x2b1377){return new Promise(function(_0x1a8cb4,_0x43c7b6){var _0x5043fa={'method':_0xdc35('0xb'),'headers':_0xfc7318,'uri':_0x5dfe57+_0xdc35('0x1f')+_0x2b1377+_0xdc35('0x20')+_0x371e96+_0xdc35('0x21'),'json':!![]};rp(_0x5043fa)[_0xdc35('0xf')](function(_0x4af663){var _0x1c3b8d=_['find'](_0x4af663[_0xdc35('0x22')][_0xdc35('0x22')],[_0x371e96,_0x2b1377]);_0x1a8cb4(_0x1c3b8d);})[_0xdc35('0x14')](function(_0x14b314){_0x43c7b6(_0x14b314);});});}function getEndUser(_0x169b8e,_0x1063be,_0xc0a9ea){return function(_0x220b90){return new Promise(function(_0x127c98,_0x176c4e){logger[_0xdc35('0xd')](util[_0xdc35('0x23')](_0xdc35('0x24'),_0x220b90[_0xdc35('0x25')]));searchContact(_0xc0a9ea,_0x1063be,_0xdc35('0x26'),_0x220b90[_0xdc35('0x25')])[_0xdc35('0xf')](function(_0x3a262c){if(_0x3a262c){_0x220b90[_0xdc35('0x27')]=_0x3a262c['id'];logger[_0xdc35('0xd')]('Contact\x20found\x20mobile_number:',_0x220b90[_0xdc35('0x27')]);return _0x127c98(_0x220b90);}searchContact(_0xc0a9ea,_0x1063be,_0xdc35('0x28'),_0x220b90[_0xdc35('0x25')])[_0xdc35('0xf')](function(_0x52d6b2){if(_0x52d6b2){_0x220b90[_0xdc35('0x27')]=_0x52d6b2['id'];logger[_0xdc35('0xd')](_0xdc35('0x29'),_0x220b90[_0xdc35('0x27')]);return _0x127c98(_0x220b90);}createEndUser(_0x220b90,_0x169b8e,_0x1063be,_0xc0a9ea)[_0xdc35('0xf')](function(_0x41c574){logger['info'](_0xdc35('0x2a'),_0x41c574['endUserId']);return _0x127c98(_0x41c574);});});})[_0xdc35('0x14')](function(_0x21a8ae){_0x176c4e(_0x21a8ae);});});};}function createEndUser(_0x69ec78,_0x5c6ec9,_0x2762e8,_0xcb8fbb){return new Promise(function(_0x422f25,_0x16d6d7){var _0x43be38=moment();var _0x10aea8={'method':_0xdc35('0x2b'),'uri':_0xcb8fbb+'/api/contacts','body':{'contact':{'last_name':_0x69ec78['contactNumber'],'work_number':_0x69ec78[_0xdc35('0x25')],'mobile_number':_0x69ec78[_0xdc35('0x25')],'owner_id':_0x69ec78[_0xdc35('0x1b')],'created_at':_0x43be38[_0xdc35('0x23')](_0xdc35('0x2c'))}},'json':!![]};_0x10aea8[_0xdc35('0xc')]=_0x2762e8;logger['info'](_0xdc35('0x2d'));return rp(_0x10aea8)['then'](function(_0x4a4af5){_0x69ec78[_0xdc35('0x27')]=_0x4a4af5['contact']['id'];_0x422f25(_0x69ec78);})[_0xdc35('0x14')](function(_0x33ac36){logger['error']('['+[_0x5c6ec9['toUpperCase']()]+']',_0x33ac36[_0xdc35('0x16')]);_0x16d6d7(_0x33ac36[_0xdc35('0x16')]);});});}function getTicket(_0x32c386,_0x2a3633,_0xc55402,_0xcbc627,_0x4f6929){return function(_0x5292c5){logger[_0xdc35('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x2cb313,_0x3cd74c){var _0x4d5499=moment();var _0xefad7e={'method':_0xdc35('0x2b'),'uri':_0xc55402+_0xdc35('0x2e'),'body':{'title':intUtil[_0xdc35('0x2f')](_0xcbc627[_0xdc35('0x30')],_0x4f6929,'\x20'),'description':intUtil['getString'](_0xcbc627['Descriptions'],_0x4f6929,'\x0a'),'owner_id':_0x5292c5[_0xdc35('0x1b')],'creater_id':_0x5292c5[_0xdc35('0x12')],'targetable_id':_0x5292c5[_0xdc35('0x27')],'targetable_type':_0xdc35('0x31'),'created_at':_0x4d5499['format'](_0xdc35('0x2c')),'due_date':_0x4d5499[_0xdc35('0x32')](0x1e,'m')[_0xdc35('0x23')](_0xdc35('0x2c'))},'json':!![]};_0xefad7e[_0xdc35('0xc')]=_0x2a3633;return rp(_0xefad7e)[_0xdc35('0xf')](function(_0xc32525){_0x5292c5[_0xdc35('0x33')]=_0xc32525[_0xdc35('0x34')]['id'];logger[_0xdc35('0xd')](_0xdc35('0x35'),_0x5292c5[_0xdc35('0x33')]);_0x2cb313(_0x5292c5);})[_0xdc35('0x14')](function(_0x4ee1fa){logger[_0xdc35('0x15')]('['+[_0x32c386[_0xdc35('0x1e')]()]+']',_0x4ee1fa[_0xdc35('0x16')]);_0x3cd74c(_0x4ee1fa[_0xdc35('0x16')]);});});};}function emit(_0x356b7d,_0x157ae0,_0x499508){var _0x474f47={'uri':_0x356b7d+_0xdc35('0x36')+_0x499508};io['to'](util[_0xdc35('0x23')](_0xdc35('0x37'),_0x157ae0))[_0xdc35('0x38')](_0xdc35('0x39'),_0x474f47);}exports['cs']=function(_0x5ef767,_0x4af02d,_0x3def97,_0x6d4cf8,_0x49e35f,_0x15762c,_0x8bd197,_0x56c3cb){var _0xd3166b={};var _0x1675c4={'Authorization':_0xdc35('0x3a')+_0x15762c['apiKey']};_0x15762c[_0xdc35('0x3b')]=intUtil[_0xdc35('0x3c')](_0x15762c['remoteUri']);_0x15762c[_0xdc35('0x3d')]=intUtil[_0xdc35('0x3c')](_0x15762c[_0xdc35('0x3d')]);var _0x4ee95a=_0x15762c[_0xdc35('0x3b')];_0xd3166b[_0xdc35('0x3e')]=_0x15762c[_0xdc35('0x3f')];_0xd3166b[_0xdc35('0x25')]=_0x56c3cb['toLowerCase']()==='outbound'?_0x4af02d['destcalleridnum']:_0x4af02d[_0xdc35('0x40')];_0xd3166b[_0xdc35('0x41')]=_0x56c3cb===_0xdc35('0x42')||_0x56c3cb===_0xdc35('0x43')?_0xdc35('0x42'):_0xdc35('0x44');if(_0x6d4cf8){_0xd3166b[_0xdc35('0x1a')]=_0x6d4cf8[_0xdc35('0x11')];}var _0x2cf581=util['format'](_0xdc35('0x45'),_0x15762c[_0xdc35('0x3d')],_0x4af02d[_0xdc35('0x46')],md5(_0x4af02d[_0xdc35('0x46')]));if(_0x49e35f&&_0x49e35f[_0xdc35('0x47')]){logger[_0xdc35('0xd')]('[QUEUE]',_0xdc35('0x48'));_0x4af02d[_0xdc35('0x49')]=_0x2cf581;}else if(_0x8bd197&&_0x8bd197[_0xdc35('0x4a')]&&_0x8bd197[_0xdc35('0x4a')]!==_0xdc35('0x4b')){logger[_0xdc35('0xd')](_0xdc35('0x4c'),'Recording\x20is\x20enabled!');_0x4af02d[_0xdc35('0x49')]=_0x2cf581;}else{_0x4af02d[_0xdc35('0x49')]='';}return getAdminId(_0xd3166b,_0x56c3cb,_0x1675c4,_0x4ee95a)[_0xdc35('0xf')](getUser(_0x56c3cb,_0x1675c4,_0x4ee95a))[_0xdc35('0xf')](getEndUser(_0x56c3cb,_0x1675c4,_0x4ee95a))[_0xdc35('0xf')](getTicket(_0x56c3cb,_0x1675c4,_0x4ee95a,_0x3def97,_0x4af02d))[_0xdc35('0xf')](function(_0x4d6a51){logger[_0xdc35('0xd')](util['format'](_0xdc35('0x4d'),_0x4d6a51[_0xdc35('0x33')]));if(_0x56c3cb!==_0xdc35('0x43')){logger['info']('['+[_0x56c3cb[_0xdc35('0x1e')]()]+']',_0xdc35('0x4e'));emit(_0x4ee95a,_0x6d4cf8[_0xdc35('0x4f')],_0x4d6a51[_0xdc35('0x27')]);}})[_0xdc35('0x14')](function(_0x26c3a3){logger[_0xdc35('0x15')]('['+[_0x56c3cb[_0xdc35('0x1e')]()]+_0xdc35('0x50'),util[_0xdc35('0x51')](_0x26c3a3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd5bf=['work_number','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Contact','headers','ticketId','user:%s','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','/api/selector/owners','info','then','users','length','email','adminEmail','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminId','GET','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0xd5bf,0x75));var _0xfd5b=function(_0x5922a8,_0xe0c059){_0x5922a8=_0x5922a8-0x0;var _0x5cdfd4=_0xd5bf[_0x5922a8];return _0x5cdfd4;};'use strict';var _=require('lodash');var rp=require(_0xfd5b('0x0'));var md5=require(_0xfd5b('0x1'));var util=require(_0xfd5b('0x2'));var moment=require('moment');var Promise=require(_0xfd5b('0x3'));var Redis=require(_0xfd5b('0x4'));var intUtil=require(_0xfd5b('0x5'));var config=require(_0xfd5b('0x6'));var logger=require(_0xfd5b('0x7'))(_0xfd5b('0x8'));config[_0xfd5b('0x9')]=_[_0xfd5b('0xa')](config[_0xfd5b('0x9')],{'host':_0xfd5b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x2a03bd,_0x2b1a1c,_0x35e10e,_0x23008a){return new Promise(function(_0x1d1a3e,_0x891c42){var _0x2c56ac=![];var _0x23c73c={'method':'GET','uri':_0x23008a+_0xfd5b('0xc'),'json':!![]};_0x23c73c['headers']=_0x35e10e;logger[_0xfd5b('0xd')]('Getting\x20admin\x20information');return rp(_0x23c73c)[_0xfd5b('0xe')](function(_0x4df744){if(_0x4df744){var _0x32de1a=_0x4df744[_0xfd5b('0xf')];var _0x19bf09=null;for(_0x19bf09=0x0;_0x19bf09<_0x32de1a[_0xfd5b('0x10')];_0x19bf09++){if(_0x32de1a[_0x19bf09][_0xfd5b('0x11')]===_0x2a03bd[_0xfd5b('0x12')]){_0x2a03bd['adminId']=_0x32de1a[_0x19bf09]['id'];_0x2c56ac=!![];}}if(_0x2c56ac){logger[_0xfd5b('0xd')]('Admin\x20found:',_0x2a03bd['adminId']);_0x1d1a3e(_0x2a03bd);}else{_0x891c42({'statusCode':0x194,'message':_0xfd5b('0x13')});}}else{_0x891c42({'statusCode':0x194,'message':_0xfd5b('0x13')});}})[_0xfd5b('0x14')](function(_0x3a51df){logger[_0xfd5b('0x15')]('['+[_0x2b1a1c[_0xfd5b('0x16')]()]+']',_0x3a51df[_0xfd5b('0x17')]);_0x891c42(_0x3a51df);});});}function getUser(_0xbd524,_0x156de7,_0x3dedad){return function(_0xa61da){return new Promise(function(_0x23b117,_0x28e121){var _0x577b77={'method':'GET','uri':_0x3dedad+'/api/selector/owners','json':!![]};_0x577b77['headers']=_0x156de7;logger[_0xfd5b('0xd')](_0xfd5b('0x18'));return rp(_0x577b77)['then'](function(_0x5e3b03){if(_0x5e3b03){var _0x18daee=_0x5e3b03[_0xfd5b('0xf')];var _0x3818da=![];var _0x3a8bf5=null;if(_0xa61da[_0xfd5b('0x19')]!==null){logger[_0xfd5b('0xd')](_0xfd5b('0x1a'),_0xa61da['agentEmail']);_0xa61da[_0xfd5b('0x1b')]=_0xa61da['agentEmail'];for(_0x3a8bf5=0x0;_0x3a8bf5<_0x18daee['length'];_0x3a8bf5++){if(_0x18daee[_0x3a8bf5][_0xfd5b('0x11')]===_0xa61da[_0xfd5b('0x19')]){_0x3818da=!![];_0xa61da[_0xfd5b('0x1c')]=_0x18daee[_0x3a8bf5]['id'];logger['info'](_0xfd5b('0x1d'),_0xa61da[_0xfd5b('0x1c')]);}}}if(!_0x3818da){logger['info'](_0xfd5b('0x1e'));_0xa61da[_0xfd5b('0x1b')]=_0xa61da[_0xfd5b('0x12')];_0xa61da[_0xfd5b('0x1c')]=_0xa61da[_0xfd5b('0x1f')];_0x3818da=!![];}if(_0x3818da){_0x23b117(_0xa61da);}else{_0x28e121({'statusCode':0x194,'message':_0xfd5b('0x13')});}}else{_0x28e121({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xfd5b('0x14')](function(_0x5c0200){logger['error']('['+[_0xbd524['toUpperCase']()]+']',_0x5c0200[_0xfd5b('0x17')]);_0x28e121(_0x5c0200);});});};}function searchContact(_0x1e17b0,_0x99bc31,_0x1551d7,_0xb8ac56){return new Promise(function(_0x1db399,_0x146fdb){var _0x181550={'method':_0xfd5b('0x20'),'headers':_0x99bc31,'uri':_0x1e17b0+_0xfd5b('0x21')+_0xb8ac56+_0xfd5b('0x22')+_0x1551d7+_0xfd5b('0x23'),'json':!![]};rp(_0x181550)[_0xfd5b('0xe')](function(_0x582539){var _0x1058c9=_[_0xfd5b('0x24')](_0x582539[_0xfd5b('0x25')][_0xfd5b('0x25')],[_0x1551d7,_0xb8ac56]);_0x1db399(_0x1058c9);})[_0xfd5b('0x14')](function(_0x984cd3){_0x146fdb(_0x984cd3);});});}function getEndUser(_0x4223f8,_0x4ed16d,_0x295dff){return function(_0x2bccf9){return new Promise(function(_0xaac1ec,_0x326fd3){logger['info'](util['format'](_0xfd5b('0x26'),_0x2bccf9[_0xfd5b('0x27')]));searchContact(_0x295dff,_0x4ed16d,'mobile_number',_0x2bccf9[_0xfd5b('0x27')])[_0xfd5b('0xe')](function(_0x33ef81){if(_0x33ef81){_0x2bccf9[_0xfd5b('0x28')]=_0x33ef81['id'];logger[_0xfd5b('0xd')]('Contact\x20found\x20mobile_number:',_0x2bccf9[_0xfd5b('0x28')]);return _0xaac1ec(_0x2bccf9);}searchContact(_0x295dff,_0x4ed16d,_0xfd5b('0x29'),_0x2bccf9[_0xfd5b('0x27')])[_0xfd5b('0xe')](function(_0x57adaf){if(_0x57adaf){_0x2bccf9[_0xfd5b('0x28')]=_0x57adaf['id'];logger[_0xfd5b('0xd')]('Contact\x20found\x20work_number:',_0x2bccf9[_0xfd5b('0x28')]);return _0xaac1ec(_0x2bccf9);}createEndUser(_0x2bccf9,_0x4223f8,_0x4ed16d,_0x295dff)[_0xfd5b('0xe')](function(_0x3d96dd){logger[_0xfd5b('0xd')](_0xfd5b('0x2a'),_0x3d96dd[_0xfd5b('0x28')]);return _0xaac1ec(_0x3d96dd);});});})[_0xfd5b('0x14')](function(_0x247743){_0x326fd3(_0x247743);});});};}function createEndUser(_0x29605,_0x588ae3,_0x1f4b7e,_0x488fb4){return new Promise(function(_0x44ecb5,_0x289e0a){var _0xf7276a=moment();var _0x4ae961={'method':_0xfd5b('0x2b'),'uri':_0x488fb4+_0xfd5b('0x2c'),'body':{'contact':{'last_name':_0x29605['contactNumber'],'work_number':_0x29605[_0xfd5b('0x27')],'mobile_number':_0x29605['contactNumber'],'owner_id':_0x29605[_0xfd5b('0x1c')],'created_at':_0xf7276a[_0xfd5b('0x2d')](_0xfd5b('0x2e'))}},'json':!![]};_0x4ae961['headers']=_0x1f4b7e;logger[_0xfd5b('0xd')](_0xfd5b('0x2f'));return rp(_0x4ae961)[_0xfd5b('0xe')](function(_0x403230){_0x29605[_0xfd5b('0x28')]=_0x403230[_0xfd5b('0x30')]['id'];_0x44ecb5(_0x29605);})[_0xfd5b('0x14')](function(_0x1bba00){logger[_0xfd5b('0x15')]('['+[_0x588ae3[_0xfd5b('0x16')]()]+']',_0x1bba00['message']);_0x289e0a(_0x1bba00[_0xfd5b('0x17')]);});});}function getTicket(_0x2fef7c,_0x2e4aeb,_0xb98047,_0xca8936,_0x1d50db){return function(_0x27c6f7){logger[_0xfd5b('0xd')](_0xfd5b('0x31'));return new Promise(function(_0x169d2e,_0x2e956f){var _0x1b2f32=moment();var _0x2fd7a5={'method':'POST','uri':_0xb98047+_0xfd5b('0x32'),'body':{'title':intUtil[_0xfd5b('0x33')](_0xca8936['Subjects'],_0x1d50db,'\x20'),'description':intUtil[_0xfd5b('0x33')](_0xca8936['Descriptions'],_0x1d50db,'\x0a'),'owner_id':_0x27c6f7['userId'],'creater_id':_0x27c6f7[_0xfd5b('0x1f')],'targetable_id':_0x27c6f7['endUserId'],'targetable_type':_0xfd5b('0x34'),'created_at':_0x1b2f32[_0xfd5b('0x2d')](_0xfd5b('0x2e')),'due_date':_0x1b2f32['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x2fd7a5[_0xfd5b('0x35')]=_0x2e4aeb;return rp(_0x2fd7a5)[_0xfd5b('0xe')](function(_0x3486c8){_0x27c6f7[_0xfd5b('0x36')]=_0x3486c8['task']['id'];logger[_0xfd5b('0xd')]('Task\x20created:',_0x27c6f7[_0xfd5b('0x36')]);_0x169d2e(_0x27c6f7);})[_0xfd5b('0x14')](function(_0x30fe9f){logger[_0xfd5b('0x15')]('['+[_0x2fef7c[_0xfd5b('0x16')]()]+']',_0x30fe9f[_0xfd5b('0x17')]);_0x2e956f(_0x30fe9f[_0xfd5b('0x17')]);});});};}function emit(_0x156acc,_0x559202,_0x526872){var _0x3a8fbb={'uri':_0x156acc+'/contacts/'+_0x526872};io['to'](util['format'](_0xfd5b('0x37'),_0x559202))['emit']('trigger:browser:url',_0x3a8fbb);}exports['cs']=function(_0x46e5a1,_0xe605ef,_0x45229e,_0x568d4b,_0x52ebc2,_0x533e76,_0x14f524,_0x3c831a){var _0x1a60d3={};var _0x433a08={'Authorization':'Token\x20token='+_0x533e76[_0xfd5b('0x38')]};_0x533e76[_0xfd5b('0x39')]=intUtil[_0xfd5b('0x3a')](_0x533e76[_0xfd5b('0x39')]);_0x533e76[_0xfd5b('0x3b')]=intUtil[_0xfd5b('0x3a')](_0x533e76[_0xfd5b('0x3b')]);var _0x1e1e15=_0x533e76[_0xfd5b('0x39')];_0x1a60d3[_0xfd5b('0x12')]=_0x533e76[_0xfd5b('0x3c')];_0x1a60d3['contactNumber']=_0x3c831a[_0xfd5b('0x3d')]()==='outbound'?_0xe605ef[_0xfd5b('0x3e')]:_0xe605ef[_0xfd5b('0x3f')];_0x1a60d3['callDirection']=_0x3c831a===_0xfd5b('0x40')||_0x3c831a===_0xfd5b('0x41')?_0xfd5b('0x40'):_0xfd5b('0x42');if(_0x568d4b){_0x1a60d3[_0xfd5b('0x19')]=_0x568d4b[_0xfd5b('0x11')];}var _0x52b1e=util[_0xfd5b('0x2d')](_0xfd5b('0x43'),_0x533e76['serverUrl'],_0xe605ef[_0xfd5b('0x44')],md5(_0xe605ef['uniqueid']));if(_0x52ebc2&&_0x52ebc2[_0xfd5b('0x45')]){logger[_0xfd5b('0xd')](_0xfd5b('0x46'),_0xfd5b('0x47'));_0xe605ef[_0xfd5b('0x48')]=_0x52b1e;}else if(_0x14f524&&_0x14f524[_0xfd5b('0x49')]&&_0x14f524[_0xfd5b('0x49')]!==_0xfd5b('0x4a')){logger[_0xfd5b('0xd')](_0xfd5b('0x4b'),_0xfd5b('0x47'));_0xe605ef[_0xfd5b('0x48')]=_0x52b1e;}else{_0xe605ef[_0xfd5b('0x48')]='';}return getAdminId(_0x1a60d3,_0x3c831a,_0x433a08,_0x1e1e15)[_0xfd5b('0xe')](getUser(_0x3c831a,_0x433a08,_0x1e1e15))[_0xfd5b('0xe')](getEndUser(_0x3c831a,_0x433a08,_0x1e1e15))[_0xfd5b('0xe')](getTicket(_0x3c831a,_0x433a08,_0x1e1e15,_0x45229e,_0xe605ef))[_0xfd5b('0xe')](function(_0x3aff9b){logger[_0xfd5b('0xd')](util[_0xfd5b('0x2d')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3aff9b[_0xfd5b('0x36')]));if(_0x3c831a!==_0xfd5b('0x41')){logger[_0xfd5b('0xd')]('['+[_0x3c831a[_0xfd5b('0x16')]()]+']',_0xfd5b('0x4c'));emit(_0x1e1e15,_0x568d4b['name'],_0x3aff9b['endUserId']);}})[_0xfd5b('0x14')](function(_0x19ab22){logger[_0xfd5b('0x15')]('['+[_0x3c831a[_0xfd5b('0x16')]()]+_0xfd5b('0x4d'),util[_0xfd5b('0x4e')](_0x19ab22,{'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 1f34f8f..9500545 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 _0xb6b6=['%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','util','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','find','queue','outbound','salesforce','log','unknown\x20integration','../../../../config/logger','format'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xb6b6,0x19d));var _0x6b6b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb6b6[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x6b6b('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x6b6b('0x1'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x6b6b('0x2'));var desk=require(_0x6b6b('0x3'));var vtiger=require(_0x6b6b('0x4'));var servicenow=require(_0x6b6b('0x5'));var dynamics365=require(_0x6b6b('0x6'));var freshsales=require(_0x6b6b('0x7'));var integrations=[_0x6b6b('0x8'),'salesforce',_0x6b6b('0x9'),_0x6b6b('0xa'),_0x6b6b('0xb'),_0x6b6b('0xc'),_0x6b6b('0xd'),_0x6b6b('0xe'),_0x6b6b('0xf'),_0x6b6b('0x10')];exports[_0x6b6b('0x11')]=function(_0x302039,_0x126887,_0x301905,_0x34c49d,_0x4a56c2,_0x4845dc){if(_0x301905){if(_[_0x6b6b('0x12')](integrations,_0x302039['data1'][_0x6b6b('0x13')]())){try{var _0x24f447=null;var _0x41add1='';var _0x2bd3d1=_0x301905[_0x302039[_0x6b6b('0x14')][_0x6b6b('0x13')]()];if(_0x2bd3d1){var _0x59228c=_0x2bd3d1[_0x302039['data2']];if(_0x59228c){var _0x687a2c=_[_0x6b6b('0x15')](_0x59228c['Configurations'],{'id':parseInt(_0x302039['data3'],0xa)});if(_0x687a2c){if(_0x34c49d){if(_0x4a56c2&&_0x126887[_0x6b6b('0x16')]){_0x41add1=_0x6b6b('0x16');}else if(_0x126887['routeId']){_0x41add1=_0x6b6b('0x17');}else{console['log']('EVENT\x20UNKNOWN',_0x126887);}}else{_0x41add1='unmanaged';}switch(_0x302039[_0x6b6b('0x14')]['toLowerCase']()){case _0x6b6b('0x8'):zendesk[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case _0x6b6b('0x18'):salesforce[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case _0x6b6b('0x9'):sugarcrm[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case _0x6b6b('0xa'):freshdesk[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case _0x6b6b('0xb'):zoho[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case'desk':desk[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case _0x6b6b('0xd'):vtiger[_0x41add1](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc);break;case'freshsales':freshsales['cs'](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc,_0x41add1);break;case _0x6b6b('0x10'):servicenow['cs'](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc,_0x41add1);break;case _0x6b6b('0xe'):dynamics365['cs'](_0x302039,_0x126887,_0x687a2c,_0x34c49d,_0x4a56c2,_0x59228c,_0x4845dc,_0x41add1);break;default:console[_0x6b6b('0x19')](_0x6b6b('0x1a'));}}else{_0x24f447=require(_0x6b6b('0x1b'))(_0x302039[_0x6b6b('0x14')][_0x6b6b('0x13')]());_0x24f447['error']('[EXEC]',util[_0x6b6b('0x1c')](_0x6b6b('0x1d'),_0x302039[_0x6b6b('0x14')][_0x6b6b('0x13')](),_0x302039['data3']));}}else{_0x24f447=require('../../../../config/logger')(_0x302039[_0x6b6b('0x14')][_0x6b6b('0x13')]());_0x24f447[_0x6b6b('0x1e')](_0x6b6b('0x1f'),util[_0x6b6b('0x1c')](_0x6b6b('0x20'),_0x302039[_0x6b6b('0x14')][_0x6b6b('0x13')](),_0x302039[_0x6b6b('0x21')]));}}else{}}catch(_0x1d11d1){console[_0x6b6b('0x1e')](_0x1d11d1);}}}}; \ No newline at end of file +var _0xcfa0=['includes','data1','toLowerCase','data2','find','queue','routeId','outbound','log','EVENT\x20UNKNOWN','zoho','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','./freshdesk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','servicenow','exec'];(function(_0x3130ad,_0xd22ade){var _0xb2a3af=function(_0x2f1fed){while(--_0x2f1fed){_0x3130ad['push'](_0x3130ad['shift']());}};_0xb2a3af(++_0xd22ade);}(_0xcfa0,0x150));var _0x0cfa=function(_0x1e7d8f,_0x3418a8){_0x1e7d8f=_0x1e7d8f-0x0;var _0x4ccbdd=_0xcfa0[_0x1e7d8f];return _0x4ccbdd;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0cfa('0x0'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x0cfa('0x1'));var servicenow=require(_0x0cfa('0x2'));var dynamics365=require('./dynamics365');var freshsales=require(_0x0cfa('0x3'));var integrations=[_0x0cfa('0x4'),_0x0cfa('0x5'),_0x0cfa('0x6'),_0x0cfa('0x7'),'zoho',_0x0cfa('0x8'),_0x0cfa('0x9'),'dynamics365','freshsales',_0x0cfa('0xa')];exports[_0x0cfa('0xb')]=function(_0x6d3eda,_0x4bcb17,_0x301201,_0x16707f,_0x44e2c7,_0x154a4e){if(_0x301201){if(_[_0x0cfa('0xc')](integrations,_0x6d3eda[_0x0cfa('0xd')][_0x0cfa('0xe')]())){try{var _0x54e1e6=null;var _0x592283='';var _0x231e3f=_0x301201[_0x6d3eda[_0x0cfa('0xd')][_0x0cfa('0xe')]()];if(_0x231e3f){var _0x3a27e3=_0x231e3f[_0x6d3eda[_0x0cfa('0xf')]];if(_0x3a27e3){var _0x17a695=_[_0x0cfa('0x10')](_0x3a27e3['Configurations'],{'id':parseInt(_0x6d3eda['data3'],0xa)});if(_0x17a695){if(_0x16707f){if(_0x44e2c7&&_0x4bcb17[_0x0cfa('0x11')]){_0x592283=_0x0cfa('0x11');}else if(_0x4bcb17[_0x0cfa('0x12')]){_0x592283=_0x0cfa('0x13');}else{console[_0x0cfa('0x14')](_0x0cfa('0x15'),_0x4bcb17);}}else{_0x592283='unmanaged';}switch(_0x6d3eda[_0x0cfa('0xd')][_0x0cfa('0xe')]()){case'zendesk':zendesk[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case _0x0cfa('0x5'):salesforce[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case _0x0cfa('0x6'):sugarcrm[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case'freshdesk':freshdesk[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case _0x0cfa('0x16'):zoho[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case _0x0cfa('0x8'):desk[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case _0x0cfa('0x9'):vtiger[_0x592283](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e);break;case'freshsales':freshsales['cs'](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e,_0x592283);break;case _0x0cfa('0xa'):servicenow['cs'](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e,_0x592283);break;case _0x0cfa('0x17'):dynamics365['cs'](_0x6d3eda,_0x4bcb17,_0x17a695,_0x16707f,_0x44e2c7,_0x3a27e3,_0x154a4e,_0x592283);break;default:console[_0x0cfa('0x14')]('unknown\x20integration');}}else{_0x54e1e6=require(_0x0cfa('0x18'))(_0x6d3eda[_0x0cfa('0xd')][_0x0cfa('0xe')]());_0x54e1e6[_0x0cfa('0x19')](_0x0cfa('0x1a'),util[_0x0cfa('0x1b')](_0x0cfa('0x1c'),_0x6d3eda[_0x0cfa('0xd')][_0x0cfa('0xe')](),_0x6d3eda['data3']));}}else{_0x54e1e6=require(_0x0cfa('0x18'))(_0x6d3eda[_0x0cfa('0xd')][_0x0cfa('0xe')]());_0x54e1e6[_0x0cfa('0x19')](_0x0cfa('0x1a'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x6d3eda['data1'][_0x0cfa('0xe')](),_0x6d3eda[_0x0cfa('0xf')]));}}else{}}catch(_0xf9c7cf){console[_0x0cfa('0x19')](_0xf9c7cf);}}}}; \ 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 cfdc9ed..bcf5abe 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 _0xba76=['newTab','unmanaged','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','ActivityDate','utc','IsRecurrence','contact','endUserType','lead','WhoId','account','Case','ContactId','leadId','info','sobject','isNil','validateEmail','find','length','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','merge','Contact','Account','first','Phone','attributes','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','forEach','string','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','Fields','integrationTab','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display'];(function(_0x38533d,_0xe4ee8f){var _0x25d5b3=function(_0x4ff60b){while(--_0x4ff60b){_0x38533d['push'](_0x38533d['shift']());}};_0x25d5b3(++_0xe4ee8f);}(_0xba76,0x7c));var _0x6ba7=function(_0xbfab9d,_0xdcb013){_0xbfab9d=_0xbfab9d-0x0;var _0x1333f3=_0xba76[_0xbfab9d];return _0x1333f3;};'use strict';var _=require('lodash');var rp=require(_0x6ba7('0x0'));var moment=require(_0x6ba7('0x1'));var BPromise=require(_0x6ba7('0x2'));var md5=require(_0x6ba7('0x3'));var jsforce=require(_0x6ba7('0x4'));var util=require(_0x6ba7('0x5'));var Redis=require(_0x6ba7('0x6'));var intUtil=require(_0x6ba7('0x7'));var config=require(_0x6ba7('0x8'));var logger=require(_0x6ba7('0x9'))('salesforce');config['redis']=_[_0x6ba7('0xa')](config[_0x6ba7('0xb')],{'host':_0x6ba7('0xc'),'port':0x18eb});var io=require(_0x6ba7('0xd'))(new Redis(config[_0x6ba7('0xb')]));function emit(_0x5d60ca,_0x487911,_0x278152){io['to'](_0x5d60ca)[_0x6ba7('0xe')](_0x487911,_0x278152);}function getTicket(_0x2a15b5,_0x4d0273,_0x138eca,_0x3b3daa,_0x587eec,_0x945714,_0x9f4756,_0x5f5aa9){var _0x1eb3e7=Object[_0x6ba7('0xf')]({},{'OwnerId':_0x4d0273['id'],'Subject':intUtil[_0x6ba7('0x10')](_0x3b3daa['Subjects'],_0x587eec,'\x20'),'Description':intUtil[_0x6ba7('0x10')](_0x3b3daa[_0x6ba7('0x11')],_0x587eec,'\x0a')},getCustomFields(_0x945714,_0x587eec));if(_0x138eca){if(_0x3b3daa[_0x6ba7('0x12')]==='Task'){_0x1eb3e7[_0x6ba7('0x13')]=moment[_0x6ba7('0x14')]();_0x1eb3e7['IsReminderSet']=![];_0x1eb3e7[_0x6ba7('0x15')]=![];if(_0x138eca['endUserType']===_0x6ba7('0x16')||_0x138eca[_0x6ba7('0x17')]===_0x6ba7('0x18')){_0x1eb3e7[_0x6ba7('0x19')]=_0x138eca['id'];}else if(_0x138eca[_0x6ba7('0x17')]===_0x6ba7('0x1a')){_0x1eb3e7['WhatId']=_0x138eca['id'];}}else if(_0x3b3daa[_0x6ba7('0x12')]===_0x6ba7('0x1b')){if(_0x138eca[_0x6ba7('0x17')]===_0x6ba7('0x16')){_0x1eb3e7[_0x6ba7('0x1c')]=_0x138eca['id'];}else if(_0x138eca[_0x6ba7('0x17')]==='account'){_0x1eb3e7['AccountId']=_0x138eca['id'];}else if(_0x138eca[_0x6ba7('0x17')]===_0x6ba7('0x18')&&_0x3b3daa[_0x6ba7('0x1d')]){_0x1eb3e7[_0x3b3daa['leadId']]=_0x138eca['id'];}else{logger[_0x6ba7('0x1e')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x9f4756[_0x6ba7('0x1f')](_0x3b3daa[_0x6ba7('0x12')])['create'](_0x1eb3e7);}function getUser(_0x30a53e,_0x373820,_0x4867fd){if(!_[_0x6ba7('0x20')](_0x373820)&&intUtil[_0x6ba7('0x21')](_0x373820)){var _0x5079dd={'Email':_0x373820};var _0x518b5f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4867fd[_0x6ba7('0x1f')]('User')[_0x6ba7('0x22')](_0x5079dd,_0x518b5f)['execute']()['then'](function(_0x375a9c){if(_0x375a9c[_0x6ba7('0x23')]){var _0x129ae0=_[_0x6ba7('0x22')](_0x375a9c,function(_0x27bb9b){return _0x27bb9b['Email']===_0x373820;});if(_0x129ae0){logger[_0x6ba7('0x1e')](_0x6ba7('0x24'),_0x373820);return BPromise[_0x6ba7('0x25')]({'id':_0x129ae0['Id'],'name':_0x129ae0[_0x6ba7('0x26')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x373820);return _0x4867fd[_0x6ba7('0x27')]()['then'](function(_0x391b61){return BPromise[_0x6ba7('0x25')]({'id':_0x391b61[_0x6ba7('0x28')],'name':_0x391b61[_0x6ba7('0x29')]});});}});}else{logger[_0x6ba7('0x1e')](_0x6ba7('0x2a'),_0x373820);return _0x4867fd['identity']()[_0x6ba7('0x2b')](function(_0x4291ea){return BPromise[_0x6ba7('0x25')]({'id':_0x4291ea['user_id'],'name':_0x4291ea[_0x6ba7('0x29')]});});}}function getEndUser(_0x383c5c,_0x491540,_0x31b9e4,_0x16618b,_0x580a77){var _0xdad862={'$or':{'Phone':_0x16618b}};var _0x408d71={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x6ba7('0x2b')](function(){logger[_0x6ba7('0x1e')](_0x6ba7('0x2c'),_0x16618b,_0x491540[_0x6ba7('0x2d')]);switch(_0x491540['moduleSearch']){case _0x6ba7('0x2e'):var _0x365edf=_[_0x6ba7('0x2f')](_0xdad862);if(_0x491540[_0x6ba7('0x30')]){var _0x4a3d45={};_0x4a3d45[_0x491540[_0x6ba7('0x30')]]=_0x16618b;_['merge'](_0x365edf[_0x6ba7('0x31')],_0x4a3d45);}return _0x580a77[_0x6ba7('0x1f')]('Contact')[_0x6ba7('0x22')](_0x365edf,_0x408d71)[_0x6ba7('0x32')]()[_0x6ba7('0x2b')](function(_0x392327){if(_0x392327&&_0x392327['length']){return _0x392327;}else{var _0x2d1d9d=_[_0x6ba7('0x2f')](_0xdad862);if(_0x491540[_0x6ba7('0x33')]){var _0x3e8491={};_0x3e8491[_0x491540[_0x6ba7('0x33')]]=_0x16618b;_['merge'](_0x2d1d9d[_0x6ba7('0x31')],_0x3e8491);}return _0x580a77['sobject'](_0x6ba7('0x34'))['find'](_0x2d1d9d,_0x408d71);}});case _0x6ba7('0x35'):var _0xddf837=_['cloneDeep'](_0xdad862);if(_0x491540[_0x6ba7('0x36')]){var _0x4a3d45={};_0x4a3d45[_0x491540[_0x6ba7('0x36')]]=_0x16618b;_[_0x6ba7('0x37')](_0xddf837['$or'],_0x4a3d45);}return _0x580a77[_0x6ba7('0x1f')]('Account')[_0x6ba7('0x22')](_0xddf837,_0x408d71)['execute']()[_0x6ba7('0x2b')](function(_0x120508){if(_0x120508&&_0x120508['length']){return _0x120508;}else{var _0x478694=_['cloneDeep'](_0xdad862);if(_0x491540[_0x6ba7('0x30')]){var _0x2989bb={};_0x2989bb[_0x491540['additionalSearchContact']]=_0x16618b;_['merge'](_0x478694[_0x6ba7('0x31')],_0x2989bb);}return _0x580a77['sobject']('Contact')[_0x6ba7('0x22')](_0x478694,_0x408d71)[_0x6ba7('0x2b')](function(_0x243acb){if(_0x243acb&&_0x243acb[_0x6ba7('0x23')]){return _0x243acb;}else{var _0x1ce4ac=_[_0x6ba7('0x2f')](_0xdad862);if(_0x491540[_0x6ba7('0x33')]){var _0x2d7d3a={};_0x2d7d3a[_0x491540['additionalSearchLead']]=_0x16618b;_[_0x6ba7('0x37')](_0x1ce4ac[_0x6ba7('0x31')],_0x2d7d3a);}return _0x580a77[_0x6ba7('0x1f')]('Lead')[_0x6ba7('0x22')](_0x1ce4ac,_0x408d71);}});}});case _0x6ba7('0x16'):var _0x365edf=_[_0x6ba7('0x2f')](_0xdad862);if(_0x491540['additionalSearchContact']){var _0x4a3d45={};_0x4a3d45[_0x491540['additionalSearchContact']]=_0x16618b;_[_0x6ba7('0x37')](_0x365edf[_0x6ba7('0x31')],_0x4a3d45);}return _0x580a77[_0x6ba7('0x1f')](_0x6ba7('0x38'))['find'](_0x365edf,_0x408d71)['execute']();case _0x6ba7('0x18'):var _0x25a47c=_[_0x6ba7('0x2f')](_0xdad862);if(_0x491540['additionalSearchLead']){var _0x4a3d45={};_0x4a3d45[_0x491540[_0x6ba7('0x33')]]=_0x16618b;_['merge'](_0x25a47c['$or'],_0x4a3d45);}return _0x580a77['sobject']('Lead')[_0x6ba7('0x22')](_0x25a47c,_0x408d71);case _0x6ba7('0x1a'):var _0xddf837=_[_0x6ba7('0x2f')](_0xdad862);if(_0x491540[_0x6ba7('0x36')]){var _0x4a3d45={};_0x4a3d45[_0x491540[_0x6ba7('0x36')]]=_0x16618b;_[_0x6ba7('0x37')](_0xddf837['$or'],_0x4a3d45);}return _0x580a77['sobject'](_0x6ba7('0x39'))[_0x6ba7('0x22')](_0xddf837,_0x408d71);default:return null;}})['then'](function(_0x27b921){if(_0x27b921&&_0x27b921[_0x6ba7('0x23')]){var _0x5a62b2=_[_0x6ba7('0x3a')](_0x27b921);if(_0x5a62b2){return BPromise['resolve']({'id':_0x5a62b2['Id'],'name':_0x5a62b2[_0x6ba7('0x26')],'phone':_0x5a62b2[_0x6ba7('0x3b')],'endUserType':_0x5a62b2[_0x6ba7('0x3c')][_0x6ba7('0x3d')][_0x6ba7('0x3e')]()});}}})[_0x6ba7('0x2b')](function(_0x622150){if(_0x622150){logger[_0x6ba7('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x622150[_0x6ba7('0x17')],_0x16618b);return BPromise[_0x6ba7('0x25')](_0x622150);}else{logger[_0x6ba7('0x1e')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x16618b);var _0x1be0c9={'Phone':_0x16618b};if(_0x491540['moduleCreate']){if(_0x491540[_0x6ba7('0x3f')]===_0x6ba7('0x16')){logger['info'](_0x6ba7('0x40'),_0x16618b,_0x491540[_0x6ba7('0x3f')]);_0x1be0c9[_0x6ba7('0x41')]=_0x31b9e4!==_0x6ba7('0x42')?_0x31b9e4:util[_0x6ba7('0x43')](_0x6ba7('0x44'),_0x16618b);}else if(_0x491540[_0x6ba7('0x3f')]===_0x6ba7('0x18')){logger[_0x6ba7('0x1e')](_0x6ba7('0x40'),_0x16618b,_0x491540[_0x6ba7('0x3f')]);_0x1be0c9[_0x6ba7('0x41')]=_0x31b9e4!==_0x6ba7('0x42')?_0x31b9e4:util['format'](_0x6ba7('0x44'),_0x16618b);_0x1be0c9[_0x6ba7('0x45')]='No\x20Company';}else if(_0x491540[_0x6ba7('0x3f')]===_0x6ba7('0x1a')){logger[_0x6ba7('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x16618b,_0x491540[_0x6ba7('0x3f')]);_0x1be0c9[_0x6ba7('0x26')]=_0x31b9e4!==_0x6ba7('0x42')?_0x31b9e4:util[_0x6ba7('0x43')](_0x6ba7('0x44'),_0x16618b);}else{return null;}}return _0x580a77[_0x6ba7('0x1f')](_[_0x6ba7('0x46')](_0x491540[_0x6ba7('0x3f')]))['create'](_0x1be0c9)[_0x6ba7('0x2b')](function(_0x3c86be){return BPromise[_0x6ba7('0x25')]({'id':_0x3c86be['id'],'endUserType':_0x491540[_0x6ba7('0x3f')]});});}});}function getCustomFields(_0x3a705f,_0x42a827){var _0x6cdca4={};if(_0x3a705f[_0x6ba7('0x23')]>0x0){_[_0x6ba7('0x47')](_0x3a705f,function(_0x178d19){if(_['includes']([_0x6ba7('0x48'),'picklist'],_0x178d19[_0x6ba7('0x3d')])&&_0x178d19['idField']){_0x6cdca4[_0x178d19[_0x6ba7('0x49')]]=_0x178d19['content'][_0x6ba7('0x4a')]();}else if(_0x178d19[_0x6ba7('0x3d')]===_0x6ba7('0x4b')&&_0x178d19['variableName']&&_0x178d19[_0x6ba7('0x49')]){_0x42a827[_0x178d19[_0x6ba7('0x4c')]]&&(_0x6cdca4[_0x178d19['idField']]=_0x42a827[_0x178d19['variableName']]['toString']());}else if(_0x178d19[_0x6ba7('0x3d')]===_0x6ba7('0x4d')&&_0x178d19[_0x6ba7('0x4e')]&&_0x178d19[_0x6ba7('0x4e')][_0x6ba7('0x4f')]&&_0x178d19[_0x6ba7('0x49')]){_0x42a827[_0x178d19[_0x6ba7('0x4e')][_0x6ba7('0x4f')][_0x6ba7('0x3e')]()]&&(_0x6cdca4[_0x178d19['idField']]=_0x42a827[_0x178d19[_0x6ba7('0x4e')]['name'][_0x6ba7('0x3e')]()][_0x6ba7('0x4a')]());}});}return _0x6cdca4;}function getConnection(_0xd389a8){var _0x4bcd9c=_0xd389a8[_0x6ba7('0x50')][_0x6ba7('0x51')](_0xd389a8['securityToken']);var _0x45ad6a=new jsforce['Connection']({'oauth2':{'loginUrl':_0xd389a8[_0x6ba7('0x52')]||_0x6ba7('0x53'),'clientId':_0xd389a8['clientId'],'clientSecret':_0xd389a8[_0x6ba7('0x54')]}});return _0x45ad6a[_0x6ba7('0x55')](_0xd389a8['username'],_0x4bcd9c)[_0x6ba7('0x2b')](function(){logger['info'](_0x6ba7('0x56'));return _0x45ad6a;});}exports[_0x6ba7('0x57')]=function(_0x1a0c34,_0x5976c9,_0x52d89f,_0x225496,_0xf0836,_0x5e80d7){var _0x219b78,_0x2edb20,_0x89d964,_0x1e804d;_0x5e80d7[_0x6ba7('0x58')]=intUtil['stripTrailingSlash'](_0x5e80d7[_0x6ba7('0x58')]);_0x5e80d7[_0x6ba7('0x52')]=intUtil[_0x6ba7('0x59')](_0x5e80d7[_0x6ba7('0x52')]);if(_0xf0836&&_0xf0836[_0x6ba7('0x5a')]){logger[_0x6ba7('0x1e')](_0x6ba7('0x5b'),_0x6ba7('0x5c'));_0x5976c9[_0x6ba7('0x5d')]=util[_0x6ba7('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e80d7[_0x6ba7('0x58')],_0x5976c9[_0x6ba7('0x5e')],md5(_0x5976c9[_0x6ba7('0x5e')]));}else{_0x5976c9[_0x6ba7('0x5d')]='';}return getConnection(_0x5e80d7)[_0x6ba7('0x2b')](function(_0x1c9c81){_0x1e804d=_0x1c9c81;return getUser(_0x5e80d7,_0x225496[_0x6ba7('0x5f')],_0x1e804d);})[_0x6ba7('0x2b')](function(_0x2b703c){_0x219b78=_0x2b703c;return getEndUser(_0x5e80d7,_0x52d89f,_0x5976c9['calleridname'],_0x5976c9[_0x6ba7('0x60')],_0x1e804d);})['then'](function(_0x482b81){_0x2edb20=_0x482b81;return getTicket(_0x5e80d7,_0x219b78,_0x2edb20,_0x52d89f,_0x5976c9,_0x52d89f[_0x6ba7('0x61')],_0x1e804d,_0x6ba7('0x57'));})[_0x6ba7('0x2b')](function(_0x6a4ca2){_0x89d964=_0x6a4ca2;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x89d964['id']);logger[_0x6ba7('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x89d964['id'],_0x225496[_0x6ba7('0x4f')],_0x5e80d7[_0x6ba7('0x3d')]);switch(_0x5e80d7['type']){case _0x6ba7('0x62'):emit(util[_0x6ba7('0x43')](_0x6ba7('0x63'),_0x225496[_0x6ba7('0x4f')]),'trigger:salesforce:display',{'recordId':_0x89d964['id']});break;case'newTab':emit(util[_0x6ba7('0x43')](_0x6ba7('0x63'),_0x225496[_0x6ba7('0x4f')]),_0x6ba7('0x64'),{'uri':util['format'](_0x6ba7('0x65'),_0x1e804d['instanceUrl'],_0x89d964['id'])});break;default:logger[_0x6ba7('0x66')](_0x6ba7('0x67'));}})[_0x6ba7('0x68')](function(_0x44cba4){logger[_0x6ba7('0x66')](_0x6ba7('0x5b'),_0x44cba4);});};exports[_0x6ba7('0x69')]=function(_0x2777c8,_0x45099e,_0x10c9bb,_0x18df45,_0x5c8cce,_0x2b1dde,_0x1834dc){var _0x523340,_0x44654d,_0x3b7ecc,_0x393652;_0x2b1dde['serverUrl']=intUtil[_0x6ba7('0x59')](_0x2b1dde[_0x6ba7('0x58')]);_0x2b1dde['remoteUri']=intUtil['stripTrailingSlash'](_0x2b1dde['remoteUri']);if(_0x1834dc&&_0x1834dc[_0x6ba7('0x6a')]&&_0x1834dc[_0x6ba7('0x6a')]!=='none'){logger[_0x6ba7('0x1e')](_0x6ba7('0x6b'),'Recording\x20is\x20enabled!');_0x45099e[_0x6ba7('0x5d')]=util[_0x6ba7('0x43')](_0x6ba7('0x6c'),_0x2b1dde[_0x6ba7('0x58')],_0x45099e[_0x6ba7('0x5e')],md5(_0x45099e[_0x6ba7('0x5e')]));}return getConnection(_0x2b1dde)[_0x6ba7('0x2b')](function(_0x48821e){_0x393652=_0x48821e;return getUser(_0x2b1dde,_0x18df45[_0x6ba7('0x5f')],_0x393652);})['then'](function(_0x6033df){_0x523340=_0x6033df;return getEndUser(_0x2b1dde,_0x10c9bb,_0x45099e[_0x6ba7('0x6d')],_0x45099e['destcalleridnum'],_0x393652);})[_0x6ba7('0x2b')](function(_0x273ad2){_0x44654d=_0x273ad2;return getTicket(_0x2b1dde,_0x523340,_0x44654d,_0x10c9bb,_0x45099e,_0x10c9bb[_0x6ba7('0x61')],_0x393652,_0x6ba7('0x69'));})[_0x6ba7('0x2b')](function(_0xc59b03){_0x3b7ecc=_0xc59b03;logger[_0x6ba7('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3b7ecc['id']);logger[_0x6ba7('0x1e')](_0x6ba7('0x6e'),_0x3b7ecc['id'],_0x18df45[_0x6ba7('0x4f')],_0x2b1dde[_0x6ba7('0x3d')]);switch(_0x2b1dde['type']){case'integrationTab':emit(util[_0x6ba7('0x43')](_0x6ba7('0x63'),_0x18df45[_0x6ba7('0x4f')]),_0x6ba7('0x6f'),{'recordId':_0x3b7ecc['id']});break;case _0x6ba7('0x70'):emit(util[_0x6ba7('0x43')](_0x6ba7('0x63'),_0x18df45[_0x6ba7('0x4f')]),_0x6ba7('0x64'),{'uri':util['format'](_0x6ba7('0x65'),_0x393652['instanceUrl'],_0x3b7ecc['id'])});break;default:logger['error'](_0x6ba7('0x6b'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x6ba7('0x68')](function(_0x238fbc){logger['error'](_0x6ba7('0x6b'),_0x238fbc);});};exports[_0x6ba7('0x71')]=function(_0x418e02,_0x332b1e,_0x3094f5,_0xbbbe3f,_0x3c2e67,_0x172ebc){var _0xad0447,_0x48d048,_0x1cbca3,_0x572bf7;_0x172ebc['serverUrl']=intUtil[_0x6ba7('0x59')](_0x172ebc[_0x6ba7('0x58')]);_0x172ebc[_0x6ba7('0x52')]=intUtil[_0x6ba7('0x59')](_0x172ebc[_0x6ba7('0x52')]);if(_0x3c2e67&&_0x3c2e67[_0x6ba7('0x5a')]){logger[_0x6ba7('0x1e')]('['+_0x332b1e[_0x6ba7('0x72')][_0x6ba7('0x73')]()+']',_0x6ba7('0x5c'));_0x332b1e[_0x6ba7('0x5d')]=util[_0x6ba7('0x43')](_0x6ba7('0x6c'),_0x172ebc[_0x6ba7('0x58')],_0x332b1e['uniqueid'],md5(_0x332b1e[_0x6ba7('0x5e')]));}else{_0x332b1e[_0x6ba7('0x5d')]='';}return getConnection(_0x172ebc)[_0x6ba7('0x2b')](function(_0x56cb13){_0x572bf7=_0x56cb13;if(!_['isNil'](_0xbbbe3f)){return getUser(_0x172ebc,_0xbbbe3f[_0x6ba7('0x4f')],_0x572bf7);}else{return getUser(_0x172ebc,null,_0x572bf7);}})['then'](function(_0x24fba2){_0xad0447=_0x24fba2;return getEndUser(_0x172ebc,_0x3094f5,_0x332b1e[_0x6ba7('0x74')],_0x332b1e[_0x6ba7('0x60')],_0x572bf7);})[_0x6ba7('0x2b')](function(_0x5e6e6a){_0x48d048=_0x5e6e6a;return getTicket(_0x172ebc,_0xad0447,_0x48d048,_0x3094f5,_0x332b1e,_0x3094f5[_0x6ba7('0x61')],_0x572bf7);})['then'](function(_0x2c4855){_0x1cbca3=_0x2c4855;logger['info']('['+_0x332b1e[_0x6ba7('0x72')][_0x6ba7('0x73')]()+']\x20Ticket\x20%s\x20created.',_0x1cbca3['id']);logger[_0x6ba7('0x1e')]('['+_0x332b1e[_0x6ba7('0x72')][_0x6ba7('0x73')]()+_0x6ba7('0x75'),_0x172ebc[_0x6ba7('0x3d')]);})[_0x6ba7('0x68')](function(_0x36d46d){logger[_0x6ba7('0x66')]('['+_0x332b1e[_0x6ba7('0x72')][_0x6ba7('0x73')]()+']',_0x36d46d);});}; \ No newline at end of file +var _0x05f8=['Contact','Lead','lead','first','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','WhatId','ticketType','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','$or','account_contact_lead','additionalSearchAccount','Account'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x05f8,0xd8));var _0x805f=function(_0x48e692,_0x5ae869){_0x48e692=_0x48e692-0x0;var _0x2f90e3=_0x05f8[_0x48e692];return _0x2f90e3;};'use strict';var _=require(_0x805f('0x0'));var rp=require(_0x805f('0x1'));var moment=require(_0x805f('0x2'));var BPromise=require(_0x805f('0x3'));var md5=require(_0x805f('0x4'));var jsforce=require(_0x805f('0x5'));var util=require(_0x805f('0x6'));var Redis=require(_0x805f('0x7'));var intUtil=require('./util');var config=require(_0x805f('0x8'));var logger=require(_0x805f('0x9'))('salesforce');config[_0x805f('0xa')]=_[_0x805f('0xb')](config[_0x805f('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x805f('0xc'))(new Redis(config[_0x805f('0xa')]));function emit(_0xea8774,_0x178216,_0x4519d2){io['to'](_0xea8774)[_0x805f('0xd')](_0x178216,_0x4519d2);}function getTicket(_0x5e799d,_0x3d691c,_0x33f5e3,_0x2555b8,_0x26b972,_0x424a64,_0x4fe2db,_0x3bffc6){var _0x5a997c=Object[_0x805f('0xe')]({},{'OwnerId':_0x3d691c['id'],'Subject':intUtil[_0x805f('0xf')](_0x2555b8[_0x805f('0x10')],_0x26b972,'\x20'),'Description':intUtil[_0x805f('0xf')](_0x2555b8[_0x805f('0x11')],_0x26b972,'\x0a')},getCustomFields(_0x424a64,_0x26b972));if(_0x33f5e3){if(_0x2555b8['ticketType']===_0x805f('0x12')){_0x5a997c[_0x805f('0x13')]=moment[_0x805f('0x14')]();_0x5a997c[_0x805f('0x15')]=![];_0x5a997c[_0x805f('0x16')]=![];if(_0x33f5e3[_0x805f('0x17')]===_0x805f('0x18')||_0x33f5e3[_0x805f('0x17')]==='lead'){_0x5a997c[_0x805f('0x19')]=_0x33f5e3['id'];}else if(_0x33f5e3[_0x805f('0x17')]==='account'){_0x5a997c[_0x805f('0x1a')]=_0x33f5e3['id'];}}else if(_0x2555b8[_0x805f('0x1b')]===_0x805f('0x1c')){if(_0x33f5e3['endUserType']===_0x805f('0x18')){_0x5a997c[_0x805f('0x1d')]=_0x33f5e3['id'];}else if(_0x33f5e3['endUserType']===_0x805f('0x1e')){_0x5a997c[_0x805f('0x1f')]=_0x33f5e3['id'];}else if(_0x33f5e3[_0x805f('0x17')]==='lead'&&_0x2555b8[_0x805f('0x20')]){_0x5a997c[_0x2555b8[_0x805f('0x20')]]=_0x33f5e3['id'];}else{logger[_0x805f('0x21')](_0x805f('0x22'));}}}return _0x4fe2db[_0x805f('0x23')](_0x2555b8[_0x805f('0x1b')])[_0x805f('0x24')](_0x5a997c);}function getUser(_0x140c59,_0x597d51,_0x3b6a6f){if(!_[_0x805f('0x25')](_0x597d51)&&intUtil[_0x805f('0x26')](_0x597d51)){var _0x1b9f96={'Email':_0x597d51};var _0xdd0e05={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3b6a6f['sobject'](_0x805f('0x27'))[_0x805f('0x28')](_0x1b9f96,_0xdd0e05)['execute']()[_0x805f('0x29')](function(_0x1e37e8){if(_0x1e37e8[_0x805f('0x2a')]){var _0x47f90d=_['find'](_0x1e37e8,function(_0x35cae3){return _0x35cae3[_0x805f('0x2b')]===_0x597d51;});if(_0x47f90d){logger[_0x805f('0x21')](_0x805f('0x2c'),_0x597d51);return BPromise[_0x805f('0x2d')]({'id':_0x47f90d['Id'],'name':_0x47f90d['Name']});}}else{logger['info'](_0x805f('0x2e'),_0x597d51);return _0x3b6a6f[_0x805f('0x2f')]()['then'](function(_0x4ec40d){return BPromise[_0x805f('0x2d')]({'id':_0x4ec40d[_0x805f('0x30')],'name':_0x4ec40d['display_name']});});}});}else{logger['info'](_0x805f('0x2e'),_0x597d51);return _0x3b6a6f[_0x805f('0x2f')]()[_0x805f('0x29')](function(_0x1e4711){return BPromise[_0x805f('0x2d')]({'id':_0x1e4711['user_id'],'name':_0x1e4711[_0x805f('0x31')]});});}}function getEndUser(_0x1bedfc,_0x482ba3,_0x4a4f59,_0x299b8b,_0x5e5e65){var _0x54cb5e={'$or':{'Phone':_0x299b8b}};var _0x3abf34={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x805f('0x29')](function(){logger[_0x805f('0x21')](_0x805f('0x32'),_0x299b8b,_0x482ba3[_0x805f('0x33')]);switch(_0x482ba3[_0x805f('0x33')]){case _0x805f('0x34'):var _0x3250fb=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x36')]){var _0x3cc8f7={};_0x3cc8f7[_0x482ba3['additionalSearchContact']]=_0x299b8b;_[_0x805f('0x37')](_0x3250fb['$or'],_0x3cc8f7);}return _0x5e5e65[_0x805f('0x23')]('Contact')[_0x805f('0x28')](_0x3250fb,_0x3abf34)[_0x805f('0x38')]()[_0x805f('0x29')](function(_0x1a2602){if(_0x1a2602&&_0x1a2602['length']){return _0x1a2602;}else{var _0x1414fa=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x39')]){var _0x54ee01={};_0x54ee01[_0x482ba3[_0x805f('0x39')]]=_0x299b8b;_[_0x805f('0x37')](_0x1414fa[_0x805f('0x3a')],_0x54ee01);}return _0x5e5e65['sobject']('Lead')['find'](_0x1414fa,_0x3abf34);}});case _0x805f('0x3b'):var _0x4c84a1=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x3c')]){var _0x3cc8f7={};_0x3cc8f7[_0x482ba3[_0x805f('0x3c')]]=_0x299b8b;_[_0x805f('0x37')](_0x4c84a1[_0x805f('0x3a')],_0x3cc8f7);}return _0x5e5e65[_0x805f('0x23')](_0x805f('0x3d'))['find'](_0x4c84a1,_0x3abf34)[_0x805f('0x38')]()['then'](function(_0x46664c){if(_0x46664c&&_0x46664c[_0x805f('0x2a')]){return _0x46664c;}else{var _0x335b92=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x36')]){var _0x5dd5b0={};_0x5dd5b0[_0x482ba3['additionalSearchContact']]=_0x299b8b;_[_0x805f('0x37')](_0x335b92[_0x805f('0x3a')],_0x5dd5b0);}return _0x5e5e65[_0x805f('0x23')](_0x805f('0x3e'))[_0x805f('0x28')](_0x335b92,_0x3abf34)[_0x805f('0x29')](function(_0x14bd77){if(_0x14bd77&&_0x14bd77[_0x805f('0x2a')]){return _0x14bd77;}else{var _0x7cd8fa=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x39')]){var _0x2197e3={};_0x2197e3[_0x482ba3[_0x805f('0x39')]]=_0x299b8b;_[_0x805f('0x37')](_0x7cd8fa[_0x805f('0x3a')],_0x2197e3);}return _0x5e5e65['sobject'](_0x805f('0x3f'))['find'](_0x7cd8fa,_0x3abf34);}});}});case _0x805f('0x18'):var _0x3250fb=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x36')]){var _0x3cc8f7={};_0x3cc8f7[_0x482ba3[_0x805f('0x36')]]=_0x299b8b;_[_0x805f('0x37')](_0x3250fb[_0x805f('0x3a')],_0x3cc8f7);}return _0x5e5e65[_0x805f('0x23')]('Contact')[_0x805f('0x28')](_0x3250fb,_0x3abf34)[_0x805f('0x38')]();case _0x805f('0x40'):var _0x2f4ea9=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3['additionalSearchLead']){var _0x3cc8f7={};_0x3cc8f7[_0x482ba3[_0x805f('0x39')]]=_0x299b8b;_[_0x805f('0x37')](_0x2f4ea9['$or'],_0x3cc8f7);}return _0x5e5e65[_0x805f('0x23')]('Lead')[_0x805f('0x28')](_0x2f4ea9,_0x3abf34);case _0x805f('0x1e'):var _0x4c84a1=_[_0x805f('0x35')](_0x54cb5e);if(_0x482ba3[_0x805f('0x3c')]){var _0x3cc8f7={};_0x3cc8f7[_0x482ba3['additionalSearchAccount']]=_0x299b8b;_[_0x805f('0x37')](_0x4c84a1[_0x805f('0x3a')],_0x3cc8f7);}return _0x5e5e65['sobject'](_0x805f('0x3d'))[_0x805f('0x28')](_0x4c84a1,_0x3abf34);default:return null;}})[_0x805f('0x29')](function(_0x39a2ef){if(_0x39a2ef&&_0x39a2ef[_0x805f('0x2a')]){var _0x40c454=_[_0x805f('0x41')](_0x39a2ef);if(_0x40c454){return BPromise[_0x805f('0x2d')]({'id':_0x40c454['Id'],'name':_0x40c454['Name'],'phone':_0x40c454['Phone'],'endUserType':_0x40c454[_0x805f('0x42')][_0x805f('0x43')]['toLowerCase']()});}}})[_0x805f('0x29')](function(_0x2c3fbb){if(_0x2c3fbb){logger[_0x805f('0x21')](_0x805f('0x44'),_0x2c3fbb['endUserType'],_0x299b8b);return BPromise['resolve'](_0x2c3fbb);}else{logger['info'](_0x805f('0x45'),_0x299b8b);var _0x106e60={'Phone':_0x299b8b};if(_0x482ba3['moduleCreate']){if(_0x482ba3['moduleCreate']===_0x805f('0x18')){logger[_0x805f('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x299b8b,_0x482ba3[_0x805f('0x46')]);_0x106e60[_0x805f('0x47')]=_0x4a4f59!==_0x805f('0x48')?_0x4a4f59:util[_0x805f('0x49')](_0x805f('0x4a'),_0x299b8b);}else if(_0x482ba3[_0x805f('0x46')]===_0x805f('0x40')){logger[_0x805f('0x21')](_0x805f('0x4b'),_0x299b8b,_0x482ba3[_0x805f('0x46')]);_0x106e60[_0x805f('0x47')]=_0x4a4f59!==''?_0x4a4f59:util[_0x805f('0x49')](_0x805f('0x4a'),_0x299b8b);_0x106e60[_0x805f('0x4c')]=_0x805f('0x4d');}else if(_0x482ba3[_0x805f('0x46')]===_0x805f('0x1e')){logger[_0x805f('0x21')](_0x805f('0x4b'),_0x299b8b,_0x482ba3[_0x805f('0x46')]);_0x106e60['Name']=_0x4a4f59!==_0x805f('0x48')?_0x4a4f59:util[_0x805f('0x49')]('Caller\x20-\x20%s',_0x299b8b);}else{return null;}}return _0x5e5e65['sobject'](_[_0x805f('0x4e')](_0x482ba3[_0x805f('0x46')]))[_0x805f('0x24')](_0x106e60)[_0x805f('0x29')](function(_0x36a43a){return BPromise['resolve']({'id':_0x36a43a['id'],'endUserType':_0x482ba3[_0x805f('0x46')]});});}});}function getCustomFields(_0x4d1f75,_0xc9b99){var _0x31fa4d={};if(_0x4d1f75[_0x805f('0x2a')]>0x0){_[_0x805f('0x4f')](_0x4d1f75,function(_0x224b04){if(_['includes']([_0x805f('0x50'),_0x805f('0x51')],_0x224b04[_0x805f('0x43')])&&_0x224b04[_0x805f('0x52')]){_0x31fa4d[_0x224b04[_0x805f('0x52')]]=_0x224b04[_0x805f('0x53')][_0x805f('0x54')]();}else if(_0x224b04[_0x805f('0x43')]===_0x805f('0x55')&&_0x224b04[_0x805f('0x56')]&&_0x224b04[_0x805f('0x52')]){_0xc9b99[_0x224b04[_0x805f('0x56')]]&&(_0x31fa4d[_0x224b04[_0x805f('0x52')]]=_0xc9b99[_0x224b04[_0x805f('0x56')]][_0x805f('0x54')]());}else if(_0x224b04[_0x805f('0x43')]===_0x805f('0x57')&&_0x224b04[_0x805f('0x58')]&&_0x224b04[_0x805f('0x58')][_0x805f('0x59')]&&_0x224b04[_0x805f('0x52')]){_0xc9b99[_0x224b04[_0x805f('0x58')][_0x805f('0x59')][_0x805f('0x5a')]()]&&(_0x31fa4d[_0x224b04[_0x805f('0x52')]]=_0xc9b99[_0x224b04[_0x805f('0x58')]['name'][_0x805f('0x5a')]()][_0x805f('0x54')]());}});}return _0x31fa4d;}function getConnection(_0x1c7d42){var _0x4291c8=_0x1c7d42[_0x805f('0x5b')][_0x805f('0x5c')](_0x1c7d42[_0x805f('0x5d')]);var _0x1091f6=new jsforce[(_0x805f('0x5e'))]({'oauth2':{'loginUrl':_0x1c7d42['remoteUri']||_0x805f('0x5f'),'clientId':_0x1c7d42[_0x805f('0x60')],'clientSecret':_0x1c7d42[_0x805f('0x61')]}});return _0x1091f6['login'](_0x1c7d42[_0x805f('0x62')],_0x4291c8)[_0x805f('0x29')](function(){logger[_0x805f('0x21')](_0x805f('0x63'));return _0x1091f6;});}exports[_0x805f('0x64')]=function(_0x25a130,_0x269b0a,_0x13e068,_0x30cc6,_0x40d067,_0x3a9442){var _0x506e01,_0x13169e,_0x1eb53b,_0x3080cf;_0x3a9442[_0x805f('0x65')]=intUtil[_0x805f('0x66')](_0x3a9442[_0x805f('0x65')]);_0x3a9442[_0x805f('0x67')]=intUtil[_0x805f('0x66')](_0x3a9442[_0x805f('0x67')]);if(_0x40d067&&_0x40d067[_0x805f('0x68')]){logger['info']('[QUEUE]',_0x805f('0x69'));_0x269b0a[_0x805f('0x6a')]=util[_0x805f('0x49')](_0x805f('0x6b'),_0x3a9442[_0x805f('0x65')],_0x269b0a[_0x805f('0x6c')],md5(_0x269b0a['uniqueid']));}else{_0x269b0a[_0x805f('0x6a')]='';}return getConnection(_0x3a9442)[_0x805f('0x29')](function(_0x240785){_0x3080cf=_0x240785;return getUser(_0x3a9442,_0x30cc6['email'],_0x3080cf);})[_0x805f('0x29')](function(_0x571e6e){_0x506e01=_0x571e6e;return getEndUser(_0x3a9442,_0x13e068,_0x269b0a[_0x805f('0x6d')],_0x269b0a[_0x805f('0x6e')],_0x3080cf);})['then'](function(_0x55c723){_0x13169e=_0x55c723;return getTicket(_0x3a9442,_0x506e01,_0x13169e,_0x13e068,_0x269b0a,_0x13e068[_0x805f('0x6f')],_0x3080cf,_0x805f('0x64'));})['then'](function(_0x46230f){_0x1eb53b=_0x46230f;logger[_0x805f('0x21')](_0x805f('0x70'),_0x1eb53b['id']);logger[_0x805f('0x21')](_0x805f('0x71'),_0x1eb53b['id'],_0x30cc6[_0x805f('0x59')],_0x3a9442[_0x805f('0x43')]);switch(_0x3a9442[_0x805f('0x43')]){case _0x805f('0x72'):emit(util[_0x805f('0x49')](_0x805f('0x73'),_0x30cc6['name']),_0x805f('0x74'),{'recordId':_0x1eb53b['id']});break;case _0x805f('0x75'):emit(util[_0x805f('0x49')](_0x805f('0x73'),_0x30cc6[_0x805f('0x59')]),_0x805f('0x76'),{'uri':util[_0x805f('0x49')](_0x805f('0x77'),_0x3080cf[_0x805f('0x78')],_0x1eb53b['id'])});break;default:logger[_0x805f('0x79')](_0x805f('0x7a'));}})[_0x805f('0x7b')](function(_0x232a39){logger['error'](_0x805f('0x7c'),_0x232a39);});};exports[_0x805f('0x7d')]=function(_0x52284c,_0x381f89,_0xefcd5d,_0xd20abb,_0x396af6,_0x316b10,_0x3b3e62){var _0x5293c8,_0x11abe0,_0x530d59,_0x9d5713;_0x316b10['serverUrl']=intUtil['stripTrailingSlash'](_0x316b10['serverUrl']);_0x316b10[_0x805f('0x67')]=intUtil[_0x805f('0x66')](_0x316b10[_0x805f('0x67')]);if(_0x3b3e62&&_0x3b3e62['recordingFormat']&&_0x3b3e62[_0x805f('0x7e')]!==_0x805f('0x7f')){logger[_0x805f('0x21')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x381f89[_0x805f('0x6a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x316b10[_0x805f('0x65')],_0x381f89[_0x805f('0x6c')],md5(_0x381f89[_0x805f('0x6c')]));}return getConnection(_0x316b10)[_0x805f('0x29')](function(_0x2a648f){_0x9d5713=_0x2a648f;return getUser(_0x316b10,_0xd20abb['email'],_0x9d5713);})[_0x805f('0x29')](function(_0xd7e291){_0x5293c8=_0xd7e291;return getEndUser(_0x316b10,_0xefcd5d,_0x381f89[_0x805f('0x80')],_0x381f89[_0x805f('0x81')],_0x9d5713);})['then'](function(_0x16bf57){_0x11abe0=_0x16bf57;return getTicket(_0x316b10,_0x5293c8,_0x11abe0,_0xefcd5d,_0x381f89,_0xefcd5d[_0x805f('0x6f')],_0x9d5713,_0x805f('0x7d'));})[_0x805f('0x29')](function(_0x2012bb){_0x530d59=_0x2012bb;logger[_0x805f('0x21')](_0x805f('0x82'),_0x530d59['id']);logger[_0x805f('0x21')](_0x805f('0x83'),_0x530d59['id'],_0xd20abb[_0x805f('0x59')],_0x316b10[_0x805f('0x43')]);switch(_0x316b10[_0x805f('0x43')]){case _0x805f('0x72'):emit(util[_0x805f('0x49')]('user:%s',_0xd20abb[_0x805f('0x59')]),_0x805f('0x74'),{'recordId':_0x530d59['id']});break;case'newTab':emit(util[_0x805f('0x49')](_0x805f('0x73'),_0xd20abb[_0x805f('0x59')]),_0x805f('0x76'),{'uri':util[_0x805f('0x49')](_0x805f('0x77'),_0x9d5713[_0x805f('0x78')],_0x530d59['id'])});break;default:logger[_0x805f('0x79')](_0x805f('0x84'),_0x805f('0x85'));}})[_0x805f('0x7b')](function(_0x1f49da){logger['error'](_0x805f('0x84'),_0x1f49da);});};exports[_0x805f('0x86')]=function(_0x11fe00,_0x19d0b2,_0x5e6f76,_0x3c204c,_0x4b016e,_0x4a5bd0){var _0xdb2e05,_0x3304ee,_0x4c4585,_0x259079;_0x4a5bd0['serverUrl']=intUtil[_0x805f('0x66')](_0x4a5bd0[_0x805f('0x65')]);_0x4a5bd0[_0x805f('0x67')]=intUtil[_0x805f('0x66')](_0x4a5bd0['remoteUri']);if(_0x4b016e&&_0x4b016e[_0x805f('0x68')]){logger[_0x805f('0x21')]('['+_0x19d0b2[_0x805f('0x87')][_0x805f('0x88')]()+']','Recording\x20is\x20enabled!');_0x19d0b2[_0x805f('0x6a')]=util['format'](_0x805f('0x6b'),_0x4a5bd0[_0x805f('0x65')],_0x19d0b2[_0x805f('0x6c')],md5(_0x19d0b2[_0x805f('0x6c')]));}else{_0x19d0b2['recordingURL']='';}return getConnection(_0x4a5bd0)[_0x805f('0x29')](function(_0x14962b){_0x259079=_0x14962b;if(!_[_0x805f('0x25')](_0x3c204c)){return getUser(_0x4a5bd0,_0x3c204c['name'],_0x259079);}else{return getUser(_0x4a5bd0,null,_0x259079);}})[_0x805f('0x29')](function(_0x55dc10){_0xdb2e05=_0x55dc10;return getEndUser(_0x4a5bd0,_0x5e6f76,_0x19d0b2['calleridname'],_0x19d0b2[_0x805f('0x6e')],_0x259079);})['then'](function(_0x2be5dd){_0x3304ee=_0x2be5dd;return getTicket(_0x4a5bd0,_0xdb2e05,_0x3304ee,_0x5e6f76,_0x19d0b2,_0x5e6f76[_0x805f('0x6f')],_0x259079);})[_0x805f('0x29')](function(_0x2b1153){_0x4c4585=_0x2b1153;logger['info']('['+_0x19d0b2[_0x805f('0x87')]['toUpperCase']()+_0x805f('0x89'),_0x4c4585['id']);logger['info']('['+_0x19d0b2[_0x805f('0x87')][_0x805f('0x88')]()+_0x805f('0x8a'),_0x4a5bd0[_0x805f('0x43')]);})[_0x805f('0x7b')](function(_0x3efb67){logger[_0x805f('0x79')]('['+_0x19d0b2['lastevent'][_0x805f('0x88')]()+']',_0x3efb67);});}; \ 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 bb7f94b..f17a38d 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 _0xe797=['label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','outbound','destcalleridnum','calleridnum','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...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','md5','ioredis','../../../../config/logger','servicenow','redis','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminId','],\x20getUser\x20crm','adminEmail','],\x20createEndUser\x20input\x20crm','user','System','endUserNumber','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','Variable','name','POST','incident','assign','true','getString','Subjects','Descriptions','Fields','ticketId','number'];(function(_0x3c4274,_0x858023){var _0x36a214=function(_0x5273e5){while(--_0x5273e5){_0x3c4274['push'](_0x3c4274['shift']());}};_0x36a214(++_0x858023);}(_0xe797,0x1da));var _0x7e79=function(_0x27b028,_0x19ba16){_0x27b028=_0x27b028-0x0;var _0x59e95d=_0xe797[_0x27b028];return _0x59e95d;};'use strict';var _=require('lodash');var Promise=require(_0x7e79('0x0'));var rp=require('request-promise');var util=require('util');var md5=require(_0x7e79('0x1'));var Redis=require(_0x7e79('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x7e79('0x3'))(_0x7e79('0x4'));config[_0x7e79('0x5')]=_['defaults'](config[_0x7e79('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7e79('0x6'))(new Redis(config[_0x7e79('0x5')]));function getAdminUser(_0x1a35c7,_0x5c5101,_0x2376f7,_0x5bacaf,_0x1cdaba,_0xc4d48){return new Promise(function(_0x4b202f,_0x388dca){var _0x35c5f3={'method':'GET','uri':_0x5bacaf+_0x7e79('0x7')+'&'+_0x1cdaba+'&'+_0xc4d48,'auth':_0x5c5101,'json':!![]};return rp(_0x35c5f3)[_0x7e79('0x8')](function(_0x1b8c73){if(_0x1b8c73[_0x7e79('0x9')][_0x7e79('0xa')]>0x0){_0x2376f7['adminId']=_0x1b8c73[_0x7e79('0x9')][0x0][_0x7e79('0xb')];}logger[_0x7e79('0xc')]('['+[_0x1a35c7[_0x7e79('0xd')]()]+_0x7e79('0xe'),_0x2376f7);_0x4b202f(_0x2376f7);})[_0x7e79('0xf')](function(_0x144790){logger[_0x7e79('0x10')]('['+[_0x1a35c7['toUpperCase']()]+']',_0x144790[_0x7e79('0x11')]);_0x388dca(_0x144790[_0x7e79('0x11')]);});});}function getUser(_0x48ec26,_0x41d22b,_0x3fc7e4,_0x536ff2,_0x2e61fd){return function(_0x19902){logger[_0x7e79('0xc')]('['+[_0x48ec26[_0x7e79('0xd')]()]+_0x7e79('0x12'),_0x19902);return new Promise(function(_0x514db3,_0x283fb3){if(intUtil['validateEmail'](_0x19902[_0x7e79('0x13')])){var _0x4ce5ec={'method':_0x7e79('0x14'),'uri':_0x3fc7e4+_0x7e79('0x15')+_0x19902['userEmail']+'&'+_0x536ff2+'&'+_0x2e61fd,'auth':_0x41d22b,'json':!![]};logger['info']('['+[_0x48ec26['toUpperCase']()]+_0x7e79('0x16'),_0x4ce5ec);return rp(_0x4ce5ec)[_0x7e79('0x8')](function(_0x5ba8ec){logger['info']('['+[_0x48ec26[_0x7e79('0xd')]()]+_0x7e79('0x17'),_0x5ba8ec);if(_0x5ba8ec[_0x7e79('0x9')]['length']>0x0&&String(_0x5ba8ec['result'][0x0]['active'])==='true'){_0x19902[_0x7e79('0x18')]=_0x5ba8ec[_0x7e79('0x9')][0x0][_0x7e79('0xb')];}else{_0x19902[_0x7e79('0x18')]=_0x19902[_0x7e79('0x19')];_0x19902[_0x7e79('0x13')]=_0x19902['adminEmail'];}logger[_0x7e79('0xc')]('['+[_0x48ec26[_0x7e79('0xd')]()]+_0x7e79('0x1a'),_0x19902);_0x514db3(_0x19902);})[_0x7e79('0xf')](function(_0x5a3709){logger['error']('['+[_0x48ec26[_0x7e79('0xd')]()]+']',_0x5a3709['message']);_0x283fb3(_0x5a3709['message']);});}else{logger[_0x7e79('0xc')]('['+[_0x48ec26['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x19902[_0x7e79('0x18')]=_0x19902[_0x7e79('0x19')];_0x19902[_0x7e79('0x13')]=_0x19902[_0x7e79('0x1b')];_0x514db3(_0x19902);}});};}function createEndUser(_0x1e1279,_0x4039d4,_0x41876b,_0x4f2f34,_0x1c22af){logger['info']('['+[_0x1e1279[_0x7e79('0xd')]()]+_0x7e79('0x1c'),_0x41876b);return new Promise(function(_0x545cbf,_0x41b747){var _0x2d35ce={'method':'POST','uri':_0x4f2f34+'sys_user?'+_0x1c22af,'body':{'user_name':_0x41876b['endUserNumber'],'roles':_0x7e79('0x1d'),'first_name':_0x41876b['endUserNumber'],'active':'true','date_format':_0x7e79('0x1e'),'phone':_0x41876b[_0x7e79('0x1f')]},'auth':_0x4039d4,'json':!![]};return rp(_0x2d35ce)[_0x7e79('0x8')](function(_0x21bf53){logger[_0x7e79('0xc')]('['+[_0x1e1279['toUpperCase']()]+'],\x20EndUser\x20schema',_0x21bf53['result']);_0x41876b[_0x7e79('0x20')]=_0x21bf53['result'][_0x7e79('0xb')];_0x545cbf(_0x41876b);})['catch'](function(_0x3dcd92){logger['error']('['+[_0x1e1279[_0x7e79('0xd')]()]+']',_0x3dcd92[_0x7e79('0x11')]);_0x41b747(_0x3dcd92['message']);});});}function getEndUser(_0x22f914,_0x3028a2,_0x2f70e3,_0x28caa9,_0x25c74b){return function(_0x33ff8b){logger[_0x7e79('0xc')]('['+[_0x22f914['toUpperCase']()]+_0x7e79('0x21'),_0x33ff8b);return new Promise(function(_0x39758a,_0x37da66){var _0x31957d={'method':_0x7e79('0x14'),'uri':_0x2f70e3+_0x7e79('0x22')+_0x33ff8b[_0x7e79('0x1f')]+'&'+_0x28caa9+'&'+_0x25c74b,'auth':_0x3028a2,'json':!![]};return rp(_0x31957d)[_0x7e79('0x8')](function(_0x216066){if(_0x216066[_0x7e79('0x9')][_0x7e79('0xa')]>0x0){_0x33ff8b[_0x7e79('0x20')]=_0x216066[_0x7e79('0x9')][0x0][_0x7e79('0xb')];logger[_0x7e79('0xc')]('['+[_0x22f914[_0x7e79('0xd')]()]+_0x7e79('0x23'),_0x33ff8b);_0x39758a(_0x33ff8b);}else{return createEndUser(_0x22f914,_0x3028a2,_0x33ff8b,_0x2f70e3,_0x28caa9)['then'](function(_0x475528){logger['info']('['+[_0x22f914['toUpperCase']()]+_0x7e79('0x24'),_0x475528);_0x39758a(_0x475528);});}})[_0x7e79('0xf')](function(_0x40cb15){logger['error']('['+[_0x22f914['toUpperCase']()]+']',_0x40cb15[_0x7e79('0x11')]);_0x37da66(_0x40cb15['message']);});});};}function getCustomFields(_0x1c7df9,_0x1c6b19){var _0x528e60={};if(_0x1c7df9[_0x7e79('0xa')]>0x0){_[_0x7e79('0x25')](_0x1c7df9,function(_0x5bfaf3){if(_[_0x7e79('0x26')]([_0x7e79('0x27'),_0x7e79('0x28')],_0x5bfaf3[_0x7e79('0x29')])&&_0x5bfaf3['nameField']&&!_0x5bfaf3[_0x7e79('0x2a')]){_0x528e60[_0x5bfaf3[_0x7e79('0x2b')][_0x7e79('0x2c')]()]=_0x5bfaf3[_0x7e79('0x2d')][_0x7e79('0x2e')]();}else if(_[_0x7e79('0x26')]([_0x7e79('0x27'),_0x7e79('0x28')],_0x5bfaf3[_0x7e79('0x29')])&&_0x5bfaf3[_0x7e79('0x2f')]&&_0x5bfaf3[_0x7e79('0x2a')]){_0x528e60[_0x5bfaf3[_0x7e79('0x2f')][_0x7e79('0x2c')]()]=_0x5bfaf3[_0x7e79('0x2d')][_0x7e79('0x2e')]();}else if(_0x5bfaf3[_0x7e79('0x29')]===_0x7e79('0x30')&&_0x5bfaf3['variableName']&&_0x5bfaf3['idField']&&_0x5bfaf3[_0x7e79('0x2a')]){_0x528e60[_0x5bfaf3[_0x7e79('0x2f')][_0x7e79('0x2c')]()]=_0x1c6b19[_0x5bfaf3['variableName']][_0x7e79('0x2e')]();}else if(_0x5bfaf3[_0x7e79('0x29')]==='customVariable'&&_0x5bfaf3[_0x7e79('0x31')]&&_0x5bfaf3[_0x7e79('0x31')][_0x7e79('0x32')]&&_0x5bfaf3[_0x7e79('0x2f')]&&_0x5bfaf3['customField']){_0x528e60[_0x5bfaf3[_0x7e79('0x2f')][_0x7e79('0x2c')]()]=_0x1c6b19[_0x5bfaf3[_0x7e79('0x31')][_0x7e79('0x32')][_0x7e79('0x2c')]()]['toString']();}});}return _0x528e60;}function getTicket(_0x24e4a8,_0x3e3644,_0x1843d5,_0x4de327,_0x582a0f,_0x41c3a5){return function(_0xff7430){logger[_0x7e79('0xc')]('['+[_0x24e4a8[_0x7e79('0xd')]()]+']\x20getTicket\x20input\x20crm',_0xff7430);return new Promise(function(_0x542c7f,_0x1cb53d){var _0x4fb8aa=_0x24e4a8[_0x7e79('0x2c')]()==='outbound'?_0xff7430[_0x7e79('0x18')]:_0xff7430['endUserId'];var _0x39454f={'method':_0x7e79('0x33'),'uri':_0x1843d5+_0x7e79('0x34')+'?'+_0x41c3a5,'body':Object[_0x7e79('0x35')]({},{'active':_0x7e79('0x36'),'caller_id':_0x4fb8aa,'assigned_to':_0xff7430[_0x7e79('0x18')],'short_description':intUtil[_0x7e79('0x37')](_0x4de327[_0x7e79('0x38')],_0x582a0f,'\x20'),'description':intUtil[_0x7e79('0x37')](_0x4de327[_0x7e79('0x39')],_0x582a0f,'\x0a')},getCustomFields(_0x4de327[_0x7e79('0x3a')],_0x582a0f)),'auth':_0x3e3644,'json':!![]};return rp(_0x39454f)[_0x7e79('0x8')](function(_0x54bdd2){logger[_0x7e79('0xc')]('['+[_0x24e4a8['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x54bdd2['result']);_0xff7430[_0x7e79('0x3b')]=_0x54bdd2['result'][_0x7e79('0xb')];_0xff7430['ticketNumber']=_0x54bdd2[_0x7e79('0x9')][_0x7e79('0x3c')];logger['info']('['+[_0x24e4a8[_0x7e79('0xd')]()]+']\x20getTicket\x20crm',_0xff7430);_0x542c7f(_0xff7430);})[_0x7e79('0xf')](function(_0x3b3569){logger[_0x7e79('0x10')]('['+[_0x24e4a8[_0x7e79('0xd')]()]+']',_0x3b3569['message']);_0x1cb53d(_0x3b3569[_0x7e79('0x11')]);});});};}function createRemoteTag(_0x40f044,_0x1faa4f,_0x1f436f,_0x499ae1){return new Promise(function(_0x58c044,_0x3f38b6){var _0x340646={'method':_0x7e79('0x33'),'uri':_0x1f436f+'label'+'?'+_0x499ae1,'body':{'short_description':_0x40f044,'global':!![],'active':!![],'name':_0x40f044},'auth':_0x1faa4f,'json':!![]};return rp(_0x340646)[_0x7e79('0x8')](function(_0x1ce817){var _0x4c5b86=_0x1ce817[_0x7e79('0x9')]['sys_id'];_0x58c044(_0x4c5b86);});});}function getRemoteTag(_0x3d934e,_0x42cacb,_0x47df11,_0xa9bce7,_0x3f6439){return new Promise(function(_0x3a66ba,_0x1a2d7d){var _0x5dc8c2={'method':'GET','uri':_0x47df11+_0x7e79('0x3d')+_0x7e79('0x3e')+_0x3d934e+'&'+_0xa9bce7,'auth':_0x42cacb,'json':!![]};return rp(_0x5dc8c2)[_0x7e79('0x8')](function(_0xb9ca46){if(_0xb9ca46[_0x7e79('0x9')]['length']>0x0){var _0x2ea169=_0xb9ca46[_0x7e79('0x9')][0x0][_0x7e79('0xb')];_0x3a66ba(_0x2ea169);}else{return createRemoteTag(_0x3d934e,_0x42cacb,_0x47df11,_0xa9bce7)[_0x7e79('0x8')](function(_0x4259a3){_0x3a66ba(_0x4259a3);});}});});}function assignTagToIncident(_0xb625e,_0xd131f0,_0x172e3d,_0x2db81b,_0x37c05c){return new Promise(function(_0x40e491,_0x551781){var _0x180081={'method':_0x7e79('0x33'),'uri':_0x172e3d+_0x7e79('0x3f')+'?'+_0x37c05c,'body':{'label':_0xb625e,'table':_0x7e79('0x34'),'id_type':_0x7e79('0x40'),'table_key':_0x2db81b[_0x7e79('0x3b')],'title':_0x7e79('0x41')+_0x2db81b[_0x7e79('0x42')],'id_display':_0x2db81b[_0x7e79('0x42')]},'auth':_0xd131f0,'json':!![]};return rp(_0x180081)[_0x7e79('0x8')](function(_0x2da43b){_0x40e491();})[_0x7e79('0xf')](function(){_0x40e491();});});}function manageTags(_0x45852c,_0xb57d79,_0x5352c8,_0x11f6d4,_0x45394e,_0x33f426,_0x547d33){return new Promise(function(_0x364e01,_0x535a51){var _0x54a945=[];_0xb57d79[_0x7e79('0x25')](function(_0x223391){_0x54a945[_0x7e79('0x43')](getRemoteTag(_0x223391,_0x5352c8,_0x11f6d4,_0x33f426,_0x547d33));});return Promise['all'](_0x54a945)['then'](function(_0x1a0c99){if(_0x1a0c99[_0x7e79('0xa')]){logger[_0x7e79('0xc')]('['+[_0x45852c[_0x7e79('0xd')]()]+_0x7e79('0x44'),_0x1a0c99);var _0x5e9c44=[];_0x1a0c99['forEach'](function(_0x537a92){_0x5e9c44[_0x7e79('0x43')](assignTagToIncident(_0x537a92,_0x5352c8,_0x11f6d4,_0x45394e,_0x33f426));});return Promise[_0x7e79('0x45')](_0x5e9c44)[_0x7e79('0x8')](function(){_0x364e01();})[_0x7e79('0xf')](function(){_0x364e01();});}else{_0x364e01();}});});}function getTags(_0x3c1eb4,_0x338886,_0x5bb911,_0x3174ba,_0x27b32c,_0x3b42a9){return function(_0x2a906f){return new Promise(function(_0x2815d6,_0x391f68){var _0x362c11=[];var _0x19fef9=_0x3174ba[_0x7e79('0x46')];if(_0x19fef9&&_0x19fef9[_0x7e79('0xa')]>0x0){_0x362c11=_[_0x7e79('0x47')](_0x19fef9,_0x7e79('0x32'));}if(_0x362c11[_0x7e79('0xa')]>0x0){return manageTags(_0x3c1eb4,_0x362c11,_0x338886,_0x5bb911,_0x2a906f,_0x27b32c,_0x3b42a9)[_0x7e79('0x8')](function(){_0x2815d6(_0x2a906f);});}else{_0x2815d6(_0x2a906f);}});};}function emit(_0x1222dd,_0x331e82,_0x1a3fa7){var _0xd91c76=_0x7e79('0x48')+_0x7e79('0x49')+_0x7e79('0x4a')+_0x7e79('0x4b');var _0x36231c={'uri':_0x1222dd+_0x7e79('0x4c')+_0x1a3fa7+_0xd91c76};io['to'](util[_0x7e79('0x4d')](_0x7e79('0x4e'),_0x331e82))[_0x7e79('0x4f')](_0x7e79('0x50'),_0x36231c);}exports['cs']=function(_0x145bf4,_0x29c4f2,_0x407333,_0x260005,_0x18086a,_0x1f32c9,_0xc16cc4,_0x659db8){var _0x2d793a={};var _0xce42d0={'user':_0x1f32c9[_0x7e79('0x51')],'pass':_0x1f32c9['password']};var _0x567b49=_0x7e79('0x52');var _0x43c682=_0x7e79('0x53');_0x1f32c9[_0x7e79('0x54')]=intUtil[_0x7e79('0x55')](_0x1f32c9[_0x7e79('0x54')]);_0x1f32c9[_0x7e79('0x56')]=intUtil[_0x7e79('0x55')](_0x1f32c9[_0x7e79('0x56')]);var _0x5117c6=util[_0x7e79('0x4d')]('%s/api/now/table/',_0x1f32c9[_0x7e79('0x54')]);_0x2d793a[_0x7e79('0x13')]=!_[_0x7e79('0x57')](_0x260005)?_0x260005[_0x7e79('0x58')]:null;_0x2d793a[_0x7e79('0x1b')]=_0x1f32c9['email'];_0x2d793a[_0x7e79('0x1f')]=_0x659db8['toLowerCase']()===_0x7e79('0x59')?_0x29c4f2[_0x7e79('0x5a')]:_0x29c4f2[_0x7e79('0x5b')];_0x2d793a[_0x7e79('0x5c')]=_0x659db8==='queue'||_0x659db8===_0x7e79('0x5d')?_0x7e79('0x5e'):_0x7e79('0x59');var _0x33849c=util[_0x7e79('0x4d')](_0x7e79('0x5f'),_0x1f32c9[_0x7e79('0x56')],_0x29c4f2[_0x7e79('0x60')],md5(_0x29c4f2[_0x7e79('0x60')]));if(_0x18086a&&_0x18086a['monitor_format']){logger[_0x7e79('0xc')](_0x7e79('0x61'),_0x7e79('0x62'));_0x29c4f2['recordingURL']=_0x33849c;}else if(_0xc16cc4&&_0xc16cc4['recordingFormat']&&_0xc16cc4[_0x7e79('0x63')]!==_0x7e79('0x64')){logger['info']('[OUTBOUND]',_0x7e79('0x62'));_0x29c4f2['recordingURL']=_0x33849c;}else{_0x29c4f2[_0x7e79('0x65')]='';}return getAdminUser(_0x659db8,_0xce42d0,_0x2d793a,_0x5117c6,_0x43c682,_0x567b49)[_0x7e79('0x8')](getUser(_0x659db8,_0xce42d0,_0x5117c6,_0x43c682,_0x567b49))[_0x7e79('0x8')](getEndUser(_0x659db8,_0xce42d0,_0x5117c6,_0x43c682,_0x567b49))['then'](getTicket(_0x659db8,_0xce42d0,_0x5117c6,_0x407333,_0x29c4f2,_0x43c682))['then'](function(_0x31ba9b){logger['info'](util['format'](_0x7e79('0x66'),_0x31ba9b[_0x7e79('0x3b')]));logger[_0x7e79('0xc')](util[_0x7e79('0x4d')](_0x7e79('0x67'),_0x659db8));if(_0x659db8!==_0x7e79('0x5d')){logger[_0x7e79('0xc')]('['+[_0x659db8[_0x7e79('0xd')]()]+']',_0x7e79('0x68'));emit(_0x1f32c9[_0x7e79('0x54')],_0x260005[_0x7e79('0x32')],_0x31ba9b[_0x7e79('0x3b')]);}})[_0x7e79('0xf')](function(_0x2aa443){logger['error']('['+[_0x659db8['toUpperCase']()]+_0x7e79('0x69'),util[_0x7e79('0x6a')](_0x2aa443,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1a6d=['Incident\x20-\x20','ticketNumber','forEach','push','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId',']\x20using\x20admin\x20profile','adminEmail','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','customVariable','Variable','name','outbound','incident','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0x1a6d,0x90));var _0xd1a6=function(_0x2521eb,_0x2256aa){_0x2521eb=_0x2521eb-0x0;var _0x470e71=_0x1a6d[_0x2521eb];return _0x470e71;};'use strict';var _=require(_0xd1a6('0x0'));var Promise=require('bluebird');var rp=require(_0xd1a6('0x1'));var util=require('util');var md5=require(_0xd1a6('0x2'));var Redis=require(_0xd1a6('0x3'));var intUtil=require(_0xd1a6('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd1a6('0x5'))(_0xd1a6('0x6'));config[_0xd1a6('0x7')]=_[_0xd1a6('0x8')](config[_0xd1a6('0x7')],{'host':_0xd1a6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd1a6('0x7')]));function getAdminUser(_0x471733,_0x4ad28d,_0x4f28d0,_0x4dde37,_0x1d071d,_0x2a8215){return new Promise(function(_0x591c63,_0x217d2d){var _0x41e01d={'method':_0xd1a6('0xa'),'uri':_0x4dde37+_0xd1a6('0xb')+'&'+_0x1d071d+'&'+_0x2a8215,'auth':_0x4ad28d,'json':!![]};return rp(_0x41e01d)[_0xd1a6('0xc')](function(_0x4f1af3){if(_0x4f1af3[_0xd1a6('0xd')][_0xd1a6('0xe')]>0x0){_0x4f28d0[_0xd1a6('0xf')]=_0x4f1af3['result'][0x0][_0xd1a6('0x10')];}logger[_0xd1a6('0x11')]('['+[_0x471733['toUpperCase']()]+_0xd1a6('0x12'),_0x4f28d0);_0x591c63(_0x4f28d0);})[_0xd1a6('0x13')](function(_0x13bee8){logger[_0xd1a6('0x14')]('['+[_0x471733[_0xd1a6('0x15')]()]+']',_0x13bee8['message']);_0x217d2d(_0x13bee8[_0xd1a6('0x16')]);});});}function getUser(_0x33fc54,_0x396139,_0x2a7883,_0x146473,_0x2570cb){return function(_0x3e5631){logger[_0xd1a6('0x11')]('['+[_0x33fc54[_0xd1a6('0x15')]()]+'],\x20getUser\x20input\x20crm',_0x3e5631);return new Promise(function(_0x171efb,_0x216f43){if(intUtil[_0xd1a6('0x17')](_0x3e5631[_0xd1a6('0x18')])){var _0x27db50={'method':_0xd1a6('0xa'),'uri':_0x2a7883+_0xd1a6('0x19')+_0x3e5631[_0xd1a6('0x18')]+'&'+_0x146473+'&'+_0x2570cb,'auth':_0x396139,'json':!![]};logger[_0xd1a6('0x11')]('['+[_0x33fc54[_0xd1a6('0x15')]()]+_0xd1a6('0x1a'),_0x27db50);return rp(_0x27db50)[_0xd1a6('0xc')](function(_0x863988){logger[_0xd1a6('0x11')]('['+[_0x33fc54[_0xd1a6('0x15')]()]+_0xd1a6('0x1b'),_0x863988);if(_0x863988[_0xd1a6('0xd')]['length']>0x0&&String(_0x863988[_0xd1a6('0xd')][0x0][_0xd1a6('0x1c')])===_0xd1a6('0x1d')){_0x3e5631[_0xd1a6('0x1e')]=_0x863988[_0xd1a6('0xd')][0x0]['sys_id'];}else{_0x3e5631['userId']=_0x3e5631['adminId'];_0x3e5631[_0xd1a6('0x18')]=_0x3e5631['adminEmail'];}logger['info']('['+[_0x33fc54[_0xd1a6('0x15')]()]+'],\x20getUser\x20crm',_0x3e5631);_0x171efb(_0x3e5631);})[_0xd1a6('0x13')](function(_0x525034){logger['error']('['+[_0x33fc54[_0xd1a6('0x15')]()]+']',_0x525034['message']);_0x216f43(_0x525034['message']);});}else{logger[_0xd1a6('0x11')]('['+[_0x33fc54[_0xd1a6('0x15')]()]+_0xd1a6('0x1f'));_0x3e5631[_0xd1a6('0x1e')]=_0x3e5631['adminId'];_0x3e5631[_0xd1a6('0x18')]=_0x3e5631[_0xd1a6('0x20')];_0x171efb(_0x3e5631);}});};}function createEndUser(_0x4a4a4e,_0xccb90e,_0x55fe08,_0x3bf7af,_0x5ebc96){logger['info']('['+[_0x4a4a4e['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x55fe08);return new Promise(function(_0x3693c7,_0x5b91da){var _0x3f0092={'method':_0xd1a6('0x21'),'uri':_0x3bf7af+_0xd1a6('0x22')+_0x5ebc96,'body':{'user_name':_0x55fe08[_0xd1a6('0x23')],'roles':'user','first_name':_0x55fe08[_0xd1a6('0x23')],'active':_0xd1a6('0x1d'),'date_format':_0xd1a6('0x24'),'phone':_0x55fe08[_0xd1a6('0x23')]},'auth':_0xccb90e,'json':!![]};return rp(_0x3f0092)[_0xd1a6('0xc')](function(_0x35b2c8){logger[_0xd1a6('0x11')]('['+[_0x4a4a4e[_0xd1a6('0x15')]()]+_0xd1a6('0x25'),_0x35b2c8[_0xd1a6('0xd')]);_0x55fe08[_0xd1a6('0x26')]=_0x35b2c8[_0xd1a6('0xd')][_0xd1a6('0x10')];_0x3693c7(_0x55fe08);})['catch'](function(_0x343b2d){logger[_0xd1a6('0x14')]('['+[_0x4a4a4e[_0xd1a6('0x15')]()]+']',_0x343b2d[_0xd1a6('0x16')]);_0x5b91da(_0x343b2d[_0xd1a6('0x16')]);});});}function getEndUser(_0x26ee8a,_0x214765,_0x5a2929,_0x84b66f,_0x2019e6){return function(_0x50a672){logger[_0xd1a6('0x11')]('['+[_0x26ee8a[_0xd1a6('0x15')]()]+_0xd1a6('0x27'),_0x50a672);return new Promise(function(_0xf48f38,_0x29463d){var _0x5a546b={'method':_0xd1a6('0xa'),'uri':_0x5a2929+_0xd1a6('0x28')+_0x50a672[_0xd1a6('0x23')]+'&'+_0x84b66f+'&'+_0x2019e6,'auth':_0x214765,'json':!![]};return rp(_0x5a546b)['then'](function(_0x1ac5ca){if(_0x1ac5ca['result'][_0xd1a6('0xe')]>0x0){_0x50a672[_0xd1a6('0x26')]=_0x1ac5ca[_0xd1a6('0xd')][0x0][_0xd1a6('0x10')];logger[_0xd1a6('0x11')]('['+[_0x26ee8a['toUpperCase']()]+_0xd1a6('0x29'),_0x50a672);_0xf48f38(_0x50a672);}else{return createEndUser(_0x26ee8a,_0x214765,_0x50a672,_0x5a2929,_0x84b66f)['then'](function(_0x826273){logger[_0xd1a6('0x11')]('['+[_0x26ee8a[_0xd1a6('0x15')]()]+_0xd1a6('0x2a'),_0x826273);_0xf48f38(_0x826273);});}})[_0xd1a6('0x13')](function(_0x487a92){logger['error']('['+[_0x26ee8a['toUpperCase']()]+']',_0x487a92[_0xd1a6('0x16')]);_0x29463d(_0x487a92[_0xd1a6('0x16')]);});});};}function getCustomFields(_0x20f549,_0x2e25a1){var _0x107f8f={};if(_0x20f549['length']>0x0){_['forEach'](_0x20f549,function(_0x15d288){if(_['includes']([_0xd1a6('0x2b'),_0xd1a6('0x2c')],_0x15d288['type'])&&_0x15d288[_0xd1a6('0x2d')]&&!_0x15d288[_0xd1a6('0x2e')]){_0x107f8f[_0x15d288[_0xd1a6('0x2d')][_0xd1a6('0x2f')]()]=_0x15d288[_0xd1a6('0x30')][_0xd1a6('0x31')]();}else if(_['includes']([_0xd1a6('0x2b'),_0xd1a6('0x2c')],_0x15d288[_0xd1a6('0x32')])&&_0x15d288['idField']&&_0x15d288[_0xd1a6('0x2e')]){_0x107f8f[_0x15d288[_0xd1a6('0x33')]['toLowerCase']()]=_0x15d288['content'][_0xd1a6('0x31')]();}else if(_0x15d288[_0xd1a6('0x32')]===_0xd1a6('0x34')&&_0x15d288[_0xd1a6('0x35')]&&_0x15d288[_0xd1a6('0x33')]&&_0x15d288[_0xd1a6('0x2e')]){_0x107f8f[_0x15d288[_0xd1a6('0x33')][_0xd1a6('0x2f')]()]=_0x2e25a1[_0x15d288[_0xd1a6('0x35')]][_0xd1a6('0x31')]();}else if(_0x15d288[_0xd1a6('0x32')]===_0xd1a6('0x36')&&_0x15d288[_0xd1a6('0x37')]&&_0x15d288[_0xd1a6('0x37')][_0xd1a6('0x38')]&&_0x15d288['idField']&&_0x15d288[_0xd1a6('0x2e')]){_0x107f8f[_0x15d288[_0xd1a6('0x33')][_0xd1a6('0x2f')]()]=_0x2e25a1[_0x15d288['Variable'][_0xd1a6('0x38')][_0xd1a6('0x2f')]()][_0xd1a6('0x31')]();}});}return _0x107f8f;}function getTicket(_0x3f947e,_0x502f35,_0x40188a,_0x55c424,_0x24c4ee,_0xef06ea){return function(_0x2a1de9){logger[_0xd1a6('0x11')]('['+[_0x3f947e[_0xd1a6('0x15')]()]+']\x20getTicket\x20input\x20crm',_0x2a1de9);return new Promise(function(_0x2afbaa,_0x36ea87){var _0x171981=_0x3f947e[_0xd1a6('0x2f')]()===_0xd1a6('0x39')?_0x2a1de9['userId']:_0x2a1de9['endUserId'];var _0x20686d={'method':_0xd1a6('0x21'),'uri':_0x40188a+_0xd1a6('0x3a')+'?'+_0xef06ea,'body':Object['assign']({},{'active':_0xd1a6('0x1d'),'caller_id':_0x171981,'assigned_to':_0x2a1de9[_0xd1a6('0x1e')],'short_description':intUtil[_0xd1a6('0x3b')](_0x55c424['Subjects'],_0x24c4ee,'\x20'),'description':intUtil[_0xd1a6('0x3b')](_0x55c424[_0xd1a6('0x3c')],_0x24c4ee,'\x0a')},getCustomFields(_0x55c424['Fields'],_0x24c4ee)),'auth':_0x502f35,'json':!![]};return rp(_0x20686d)['then'](function(_0x52b7d6){logger[_0xd1a6('0x11')]('['+[_0x3f947e[_0xd1a6('0x15')]()]+_0xd1a6('0x3d'),_0x52b7d6[_0xd1a6('0xd')]);_0x2a1de9[_0xd1a6('0x3e')]=_0x52b7d6[_0xd1a6('0xd')][_0xd1a6('0x10')];_0x2a1de9['ticketNumber']=_0x52b7d6['result'][_0xd1a6('0x3f')];logger[_0xd1a6('0x11')]('['+[_0x3f947e[_0xd1a6('0x15')]()]+_0xd1a6('0x40'),_0x2a1de9);_0x2afbaa(_0x2a1de9);})[_0xd1a6('0x13')](function(_0x1d2b49){logger[_0xd1a6('0x14')]('['+[_0x3f947e['toUpperCase']()]+']',_0x1d2b49['message']);_0x36ea87(_0x1d2b49['message']);});});};}function createRemoteTag(_0x4745e8,_0x2e80a2,_0x3be50b,_0x2212fb){return new Promise(function(_0xa3ef99,_0x31e5bb){var _0x4093f0={'method':_0xd1a6('0x21'),'uri':_0x3be50b+_0xd1a6('0x41')+'?'+_0x2212fb,'body':{'short_description':_0x4745e8,'global':!![],'active':!![],'name':_0x4745e8},'auth':_0x2e80a2,'json':!![]};return rp(_0x4093f0)[_0xd1a6('0xc')](function(_0x3041f3){var _0x31046c=_0x3041f3[_0xd1a6('0xd')][_0xd1a6('0x10')];_0xa3ef99(_0x31046c);});});}function getRemoteTag(_0x10c4aa,_0x5a37f3,_0x54b724,_0x1fc788,_0x3f7fbb){return new Promise(function(_0x228cdf,_0x34126c){var _0x387975={'method':_0xd1a6('0xa'),'uri':_0x54b724+_0xd1a6('0x41')+_0xd1a6('0x42')+_0x10c4aa+'&'+_0x1fc788,'auth':_0x5a37f3,'json':!![]};return rp(_0x387975)[_0xd1a6('0xc')](function(_0x5a3992){if(_0x5a3992[_0xd1a6('0xd')]['length']>0x0){var _0x16e3df=_0x5a3992[_0xd1a6('0xd')][0x0][_0xd1a6('0x10')];_0x228cdf(_0x16e3df);}else{return createRemoteTag(_0x10c4aa,_0x5a37f3,_0x54b724,_0x1fc788)[_0xd1a6('0xc')](function(_0x2b3ecb){_0x228cdf(_0x2b3ecb);});}});});}function assignTagToIncident(_0x47bf79,_0x3fd9f5,_0x3a2aa0,_0x4b360f,_0x417378){return new Promise(function(_0x2b5353,_0x4c5e13){var _0x36bce4={'method':_0xd1a6('0x21'),'uri':_0x3a2aa0+'label_entry'+'?'+_0x417378,'body':{'label':_0x47bf79,'table':_0xd1a6('0x3a'),'id_type':_0xd1a6('0x43'),'table_key':_0x4b360f['ticketId'],'title':_0xd1a6('0x44')+_0x4b360f[_0xd1a6('0x45')],'id_display':_0x4b360f[_0xd1a6('0x45')]},'auth':_0x3fd9f5,'json':!![]};return rp(_0x36bce4)[_0xd1a6('0xc')](function(_0x262ace){_0x2b5353();})[_0xd1a6('0x13')](function(){_0x2b5353();});});}function manageTags(_0xc0a3a8,_0x20b7ab,_0x247f35,_0xd970a7,_0x379459,_0x4cad28,_0x395943){return new Promise(function(_0x22f10e,_0xfcfab4){var _0x4f2eee=[];_0x20b7ab[_0xd1a6('0x46')](function(_0x1e8232){_0x4f2eee[_0xd1a6('0x47')](getRemoteTag(_0x1e8232,_0x247f35,_0xd970a7,_0x4cad28,_0x395943));});return Promise[_0xd1a6('0x48')](_0x4f2eee)[_0xd1a6('0xc')](function(_0x5f234a){if(_0x5f234a[_0xd1a6('0xe')]){logger[_0xd1a6('0x11')]('['+[_0xc0a3a8[_0xd1a6('0x15')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5f234a);var _0x19d0d4=[];_0x5f234a[_0xd1a6('0x46')](function(_0xda51ae){_0x19d0d4[_0xd1a6('0x47')](assignTagToIncident(_0xda51ae,_0x247f35,_0xd970a7,_0x379459,_0x4cad28));});return Promise[_0xd1a6('0x48')](_0x19d0d4)[_0xd1a6('0xc')](function(){_0x22f10e();})[_0xd1a6('0x13')](function(){_0x22f10e();});}else{_0x22f10e();}});});}function getTags(_0x9bd77f,_0x3215ac,_0xf8b615,_0x30d067,_0x25b5dd,_0x1c2f61){return function(_0x38e0c7){return new Promise(function(_0x41e6f1,_0x3259b4){var _0xfb8197=[];var _0x16c259=_0x30d067[_0xd1a6('0x49')];if(_0x16c259&&_0x16c259[_0xd1a6('0xe')]>0x0){_0xfb8197=_['map'](_0x16c259,'name');}if(_0xfb8197[_0xd1a6('0xe')]>0x0){return manageTags(_0x9bd77f,_0xfb8197,_0x3215ac,_0xf8b615,_0x38e0c7,_0x25b5dd,_0x1c2f61)['then'](function(){_0x41e6f1(_0x38e0c7);});}else{_0x41e6f1(_0x38e0c7);}});};}function emit(_0x3a1ec6,_0x413bb9,_0x1aa01d){var _0x570df5='%26sysparm_record_target%3Dincident'+_0xd1a6('0x4a')+_0xd1a6('0x4b')+_0xd1a6('0x4c');var _0x31986b={'uri':_0x3a1ec6+_0xd1a6('0x4d')+_0x1aa01d+_0x570df5};io['to'](util[_0xd1a6('0x4e')]('user:%s',_0x413bb9))[_0xd1a6('0x4f')](_0xd1a6('0x50'),_0x31986b);}exports['cs']=function(_0x571f34,_0x4156f3,_0x5cc2aa,_0x54ab81,_0xbdfab1,_0x249699,_0x1a9de6,_0x5ce5eb){var _0x33c116={};var _0x98cfe={'user':_0x249699[_0xd1a6('0x51')],'pass':_0x249699[_0xd1a6('0x52')]};var _0x2941a6=_0xd1a6('0x53');var _0x27c091=_0xd1a6('0x54');_0x249699[_0xd1a6('0x55')]=intUtil[_0xd1a6('0x56')](_0x249699[_0xd1a6('0x55')]);_0x249699[_0xd1a6('0x57')]=intUtil[_0xd1a6('0x56')](_0x249699[_0xd1a6('0x57')]);var _0x1acc18=util[_0xd1a6('0x4e')](_0xd1a6('0x58'),_0x249699[_0xd1a6('0x55')]);_0x33c116[_0xd1a6('0x18')]=!_[_0xd1a6('0x59')](_0x54ab81)?_0x54ab81[_0xd1a6('0x5a')]:null;_0x33c116[_0xd1a6('0x20')]=_0x249699[_0xd1a6('0x5a')];_0x33c116['endUserNumber']=_0x5ce5eb[_0xd1a6('0x2f')]()===_0xd1a6('0x39')?_0x4156f3[_0xd1a6('0x5b')]:_0x4156f3['calleridnum'];_0x33c116[_0xd1a6('0x5c')]=_0x5ce5eb===_0xd1a6('0x5d')||_0x5ce5eb==='unmanaged'?_0xd1a6('0x5d'):_0xd1a6('0x39');var _0x9e491=util[_0xd1a6('0x4e')](_0xd1a6('0x5e'),_0x249699[_0xd1a6('0x57')],_0x4156f3[_0xd1a6('0x5f')],md5(_0x4156f3[_0xd1a6('0x5f')]));if(_0xbdfab1&&_0xbdfab1[_0xd1a6('0x60')]){logger[_0xd1a6('0x11')](_0xd1a6('0x61'),'Recording\x20is\x20enabled!');_0x4156f3[_0xd1a6('0x62')]=_0x9e491;}else if(_0x1a9de6&&_0x1a9de6['recordingFormat']&&_0x1a9de6[_0xd1a6('0x63')]!==_0xd1a6('0x64')){logger[_0xd1a6('0x11')](_0xd1a6('0x65'),'Recording\x20is\x20enabled!');_0x4156f3['recordingURL']=_0x9e491;}else{_0x4156f3[_0xd1a6('0x62')]='';}return getAdminUser(_0x5ce5eb,_0x98cfe,_0x33c116,_0x1acc18,_0x27c091,_0x2941a6)['then'](getUser(_0x5ce5eb,_0x98cfe,_0x1acc18,_0x27c091,_0x2941a6))[_0xd1a6('0xc')](getEndUser(_0x5ce5eb,_0x98cfe,_0x1acc18,_0x27c091,_0x2941a6))[_0xd1a6('0xc')](getTicket(_0x5ce5eb,_0x98cfe,_0x1acc18,_0x5cc2aa,_0x4156f3,_0x27c091))[_0xd1a6('0xc')](function(_0x404ba4){logger[_0xd1a6('0x11')](util[_0xd1a6('0x4e')](_0xd1a6('0x66'),_0x404ba4[_0xd1a6('0x3e')]));logger['info'](util[_0xd1a6('0x4e')](_0xd1a6('0x67'),_0x5ce5eb));if(_0x5ce5eb!=='unmanaged'){logger[_0xd1a6('0x11')]('['+[_0x5ce5eb[_0xd1a6('0x15')]()]+']',_0xd1a6('0x68'));emit(_0x249699[_0xd1a6('0x55')],_0x54ab81['name'],_0x404ba4['ticketId']);}})[_0xd1a6('0x13')](function(_0x43311c){logger[_0xd1a6('0x14')]('['+[_0x5ce5eb[_0xd1a6('0x15')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xd1a6('0x69')](_0x43311c,{'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 977b48a..cb5eab8 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 _0x5636=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','bluebird','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','get_server_info','isNil','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','format','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','debug','[HTTP]','map','type','nameField','customField','string','content','variable','Variable','toLowerCase','custom_fields','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0x179802,_0x35d2e8){var _0x16be2d=function(_0x22a762){while(--_0x22a762){_0x179802['push'](_0x179802['shift']());}};_0x16be2d(++_0x35d2e8);}(_0x5636,0x106));var _0x6563=function(_0xfa4187,_0x31fe15){_0xfa4187=_0xfa4187-0x0;var _0x1b4cd0=_0x5636[_0xfa4187];return _0x1b4cd0;};'use strict';var _=require(_0x6563('0x0'));var rp=require(_0x6563('0x1'));var BPromise=require(_0x6563('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x6563('0x3'));var intUtil=require(_0x6563('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6563('0x5'))(_0x6563('0x6'));config[_0x6563('0x7')]=_[_0x6563('0x8')](config[_0x6563('0x7')],{'host':_0x6563('0x9'),'port':0x18eb});var io=require(_0x6563('0xa'))(new Redis(config['redis']));var def={'method':_0x6563('0xb'),'json':!![]};function emit(_0x44be98,_0xcc2725,_0x4efbfe){io['to'](_0x44be98)[_0x6563('0xc')](_0xcc2725,_0x4efbfe);}function getTicket(_0xf23063,_0x3c1425,_0x24de2e,_0x219b1a,_0x186add,_0x7eb6b0,_0x4caad2,_0x1e0d09){logger[_0x6563('0xd')](_0x6563('0xe'));var _0x5782ac=new Date();var _0x4d1f95=[{'name':_0x6563('0xf'),'value':intUtil[_0x6563('0x10')](_0x219b1a[_0x6563('0x11')],_0x186add,'\x20')},{'name':_0x6563('0x12'),'value':_0x3c1425['id']},{'name':_0x6563('0x13'),'value':_0x3c1425['id']},{'name':_0x6563('0x14'),'value':intUtil[_0x6563('0x10')](_0x219b1a[_0x6563('0x15')],_0x186add,'\x0a')},{'name':_0x6563('0x16'),'value':_0x5782ac[_0x6563('0x17')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x6563('0x18'),'value':'0'},{'name':_0x6563('0x19'),'value':'15'},{'name':_0x6563('0x1a'),'value':_0x24de2e['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x6563('0x1b'),'value':_0x24de2e['name']},{'name':_0x6563('0x1c'),'value':_0x1e0d09}];if(_0x7eb6b0[_0x6563('0x1d')]){_[_0x6563('0x1e')](_0x7eb6b0,function(_0x1c2bdb){if(_0x186add[_0x1c2bdb[_0x6563('0x1f')]]){_0x4d1f95[_0x6563('0x20')]({'name':_0x1c2bdb[_0x6563('0x21')],'value':_0x186add[_0x1c2bdb[_0x6563('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x6563('0x22'),'response_type':_0x6563('0x22'),'rest_data':JSON[_0x6563('0x23')]({'session':_0x4caad2['id'],'module_name':_0x6563('0x24'),'name_value_list':_0x4d1f95})}});}function getAuth(_0x2360f7){return util['format'](_0x6563('0x25'),new Buffer(_0x2360f7[_0x6563('0x26')]+':X')[_0x6563('0x27')]('base64'));}function getServerInfo(_0x4aedda){return request({'form':{'method':_0x6563('0x28'),'input_type':_0x6563('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4aedda['id']})}});}function getUser(_0x13efb1,_0x521fd6,_0x167699){if(!_[_0x6563('0x29')](_0x521fd6)){logger[_0x6563('0xd')]('Getting\x20agent\x20with\x20name',_0x521fd6);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x6563('0x22'),'rest_data':JSON[_0x6563('0x23')]({'session':_0x167699['id'],'module_name':'Employees','query':util['format'](_0x6563('0x2a'),_0x521fd6),'order_by':'','offset':'0','select_fields':['id',_0x6563('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6563('0x2b')](function(_0x2f37c2){if(_0x2f37c2[_0x6563('0x2c')][_0x6563('0x1d')]){var _0x44eb7e=_[_0x6563('0x2d')](_0x2f37c2[_0x6563('0x2c')],function(_0x3ae908){return _0x3ae908[_0x6563('0x2e')][_0x6563('0x2f')][_0x6563('0x30')]===_0x521fd6;});if(_0x44eb7e){logger['info'](_0x6563('0x31'));return BPromise[_0x6563('0x32')]({'id':_0x44eb7e[_0x6563('0x2e')]['id'][_0x6563('0x30')],'name':_0x44eb7e[_0x6563('0x2e')][_0x6563('0xf')][_0x6563('0x30')]});}}logger[_0x6563('0xd')](_0x6563('0x33'));return BPromise[_0x6563('0x32')]({'id':_0x167699['name_value_list'][_0x6563('0x34')][_0x6563('0x30')],'name':_0x167699[_0x6563('0x2e')]['user_name'][_0x6563('0x30')]});});}else{logger[_0x6563('0xd')](_0x6563('0x35'));return BPromise[_0x6563('0x32')]({'id':_0x167699[_0x6563('0x2e')]['user_id'][_0x6563('0x30')],'name':_0x167699[_0x6563('0x2e')][_0x6563('0x2f')][_0x6563('0x30')]});}}function getEndUser(_0x419cd1,_0x221633,_0xc5437e,_0xa79bcd){logger[_0x6563('0xd')](_0x6563('0x36'),_0xc5437e);return request({'form':{'method':_0x6563('0x37'),'input_type':_0x6563('0x22'),'response_type':_0x6563('0x22'),'rest_data':JSON['stringify']({'session':_0xa79bcd['id'],'module_name':_0x6563('0x38'),'query':util[_0x6563('0x39')]('contacts.phone_home\x20=\x20\x22%s\x22',_0xc5437e),'order_by':'','offset':'0','select_fields':['id',_0x6563('0xf'),_0x6563('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6563('0x2b')](function(_0x3b4447){if(_0x3b4447['entry_list'][_0x6563('0x1d')]){var _0x4bc490=_['find'](_0x3b4447[_0x6563('0x2c')],function(_0x31e5b5){return _0x31e5b5[_0x6563('0x2e')]['phone_home'][_0x6563('0x30')]===_0xc5437e;});if(_0x4bc490){logger[_0x6563('0xd')](_0x6563('0x3b'));return BPromise[_0x6563('0x32')]({'id':_0x4bc490[_0x6563('0x2e')]['id'][_0x6563('0x30')],'name':_0x4bc490['name_value_list']['name']['value'],'phone':_0x4bc490[_0x6563('0x2e')][_0x6563('0x3a')][_0x6563('0x30')]});}}else{logger[_0x6563('0xd')](_0x6563('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x6563('0x22'),'response_type':_0x6563('0x22'),'rest_data':JSON[_0x6563('0x23')]({'session':_0xa79bcd['id'],'module_name':_0x6563('0x38'),'name_value_list':[{'name':_0x6563('0x3d'),'value':_0x221633!==_0x6563('0x3e')?_0x221633:util[_0x6563('0x39')]('Caller\x20-\x20%s',_0xc5437e)},{'name':_0x6563('0x3a'),'value':_0xc5437e}]})}})[_0x6563('0x2b')](function(_0xb20662){logger[_0x6563('0xd')]('Enduser\x20created.');return BPromise[_0x6563('0x32')]({'id':_0xb20662['id'],'name':_0xb20662[_0x6563('0x2c')][_0x6563('0x3d')][_0x6563('0x30')],'phone':_0xb20662['entry_list']['phone_home'][_0x6563('0x30')]});});}});}function request(_0x4b9f98){logger[_0x6563('0x3f')](_0x6563('0x40'),JSON['stringify'](_0x4b9f98));return rp(_['merge'](def,_0x4b9f98));}function getTags(_0x2a1360,_0x38209b){var _0x4aff04=[];if(_0x2a1360&&_0x2a1360[_0x6563('0x1d')]>0x0){_0x4aff04=_[_0x6563('0x41')](_0x2a1360,_0x38209b);}return _0x4aff04;}function getCustomFields(_0x27544c,_0x4bb084){var _0x297884=[];var _0x3127e7={'custom_fields':[]};if(_0x27544c['length']>0x0){_[_0x6563('0x1e')](_0x27544c,function(_0x15eb07){if(_0x15eb07[_0x6563('0x42')]==='string'&&_0x15eb07[_0x6563('0x43')]&&!_0x15eb07[_0x6563('0x44')]){_0x3127e7[_0x15eb07[_0x6563('0x43')]['toLowerCase']()]=_0x15eb07['content'][_0x6563('0x27')]();}else if(_0x15eb07[_0x6563('0x42')]===_0x6563('0x45')&&_0x15eb07['idField']&&_0x15eb07[_0x6563('0x44')]){_0x3127e7['custom_fields'][_0x6563('0x20')]({'id':_0x15eb07['idField'],'value':_0x15eb07[_0x6563('0x46')][_0x6563('0x27')]()});}else if(_0x15eb07[_0x6563('0x42')]===_0x6563('0x47')&&_0x15eb07['variableName']&&_0x15eb07['idField']&&_0x15eb07[_0x6563('0x44')]){_0x4bb084[_0x15eb07[_0x6563('0x1f')]]&&_0x3127e7['custom_fields'][_0x6563('0x20')]({'id':_0x15eb07['idField'],'value':_0x4bb084[_0x15eb07['variableName']][_0x6563('0x27')]()});}else if(_0x15eb07[_0x6563('0x42')]==='customVariable'&&_0x15eb07[_0x6563('0x48')]&&_0x15eb07['Variable'][_0x6563('0xf')]&&_0x15eb07[_0x6563('0x21')]&&_0x15eb07['customField']){_0x4bb084[_0x15eb07[_0x6563('0x48')][_0x6563('0xf')][_0x6563('0x49')]()]&&_0x3127e7[_0x6563('0x4a')][_0x6563('0x20')]({'id':_0x15eb07[_0x6563('0x21')],'value':_0x4bb084[_0x15eb07[_0x6563('0x48')]['name'][_0x6563('0x49')]()][_0x6563('0x27')]()});}});}return _0x3127e7;}function getConnection(_0x21f84e){return request({'method':_0x6563('0xb'),'form':{'method':_0x6563('0x4b'),'input_type':_0x6563('0x22'),'response_type':_0x6563('0x22'),'rest_data':JSON[_0x6563('0x23')]({'user_auth':{'user_name':_0x21f84e[_0x6563('0x4c')],'password':_0x21f84e[_0x6563('0x4d')],'encryption':_0x6563('0x4e')},'application':_0x6563('0x4f')})}})[_0x6563('0x2b')](function(_0x469c72){var _0x69afa8=_0x469c72;if(_0x69afa8['id']){def[_0x6563('0x50')]=_0x69afa8['id'];return BPromise[_0x6563('0x32')](_0x69afa8);}else{throw new Error(util['format'](_0x6563('0x51'),_0x21f84e['id']));}});}function setRelationship(_0x1ae040,_0x2898cf,_0x2be2c9,_0x3db454){return request({'form':{'method':_0x6563('0x52'),'input_type':_0x6563('0x22'),'response_type':_0x6563('0x22'),'rest_data':JSON['stringify']({'session':_0x1ae040['id'],'module_name':_0x6563('0x24'),'module_id':_0x2be2c9['id'],'link_field_name':_0x3db454,'related_ids':[_0x2898cf['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6563('0x53')]=function(_0x430954,_0x1ec292,_0x1ec11e,_0x580cb6,_0x5668a7,_0x19eb2a){var _0x20dc3b,_0xb51edd,_0x470c99,_0x2e0411;_0x19eb2a['remoteUri']=intUtil[_0x6563('0x54')](_0x19eb2a[_0x6563('0x55')]);_0x19eb2a[_0x6563('0x56')]=intUtil['stripTrailingSlash'](_0x19eb2a[_0x6563('0x56')]);def[_0x6563('0x57')]=util[_0x6563('0x39')]('%s/service/v4_1/rest.php',_0x19eb2a['remoteUri']);if(_0x5668a7&&_0x5668a7[_0x6563('0x58')]){logger[_0x6563('0xd')](_0x6563('0x59'),'Recording\x20is\x20enabled!');_0x1ec292[_0x6563('0x5a')]=util['format'](_0x6563('0x5b'),_0x19eb2a['serverUrl'],_0x1ec292[_0x6563('0x5c')],md5(_0x1ec292[_0x6563('0x5c')]));}else{_0x1ec292[_0x6563('0x5a')]='';}return getConnection(_0x19eb2a)[_0x6563('0x2b')](function(_0x577828){_0x2e0411=_0x577828;return getUser(_0x19eb2a,_0x580cb6[_0x6563('0xf')],_0x2e0411);})[_0x6563('0x2b')](function(_0x830a4e){_0x20dc3b=_0x830a4e;logger[_0x6563('0xd')]('The\x20User\x20ID\x20is:',_0x20dc3b['id']);return getEndUser(_0x19eb2a,_0x1ec292[_0x6563('0x5d')],_0x1ec292[_0x6563('0x5e')],_0x2e0411);})[_0x6563('0x2b')](function(_0x22c91a){_0xb51edd=_0x22c91a;logger[_0x6563('0xd')](_0x6563('0x5f'),_0xb51edd['id']);return getTicket(_0x19eb2a,_0x20dc3b,_0xb51edd,_0x1ec11e,_0x1ec292,_0x1ec11e[_0x6563('0x60')],_0x2e0411,_0x6563('0x61'));})[_0x6563('0x2b')](function(_0x33de90){_0x470c99=_0x33de90;logger[_0x6563('0xd')](_0x6563('0x62'));logger[_0x6563('0xd')]('The\x20Ticket\x20ID\x20is:',_0x470c99['id']);return setRelationship(_0x2e0411,_0x20dc3b,_0x470c99,_0x6563('0x63'));})[_0x6563('0x2b')](function(){return setRelationship(_0x2e0411,_0xb51edd,_0x470c99,_0x6563('0x64'));})[_0x6563('0x2b')](function(){return getServerInfo(_0x2e0411);})[_0x6563('0x2b')](function(_0x4e2c6b){var _0x2e5a1c=parseInt(_0x4e2c6b[_0x6563('0x65')][_0x6563('0x66')](0x0));var _0x6c3551=util[_0x6563('0x39')](_0x6563('0x67'),_0x19eb2a['remoteUri'],_0x470c99['id']);if(_0x2e5a1c>0x6){_0x6c3551=util[_0x6563('0x39')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x19eb2a[_0x6563('0x55')],_0x470c99['id']);}logger[_0x6563('0xd')]('[QUEUE]',_0x6563('0x68'));emit(util[_0x6563('0x39')]('user:%s',_0x580cb6['name']),_0x6563('0x69'),{'uri':_0x6c3551});})[_0x6563('0x6a')](function(_0x3ac022){logger[_0x6563('0x6b')]('[QUEUE]',JSON[_0x6563('0x23')](_0x3ac022));});};exports[_0x6563('0x6c')]=function(_0xc22176,_0x1c7206,_0x49f12d,_0x1bf170,_0x2d6d38,_0x2ff97f,_0x5ad0eb){var _0x18b4fa,_0x30baeb,_0x15a39d,_0x89c8d9;_0x2ff97f[_0x6563('0x55')]=intUtil['stripTrailingSlash'](_0x2ff97f['remoteUri']);_0x2ff97f[_0x6563('0x56')]=intUtil[_0x6563('0x54')](_0x2ff97f[_0x6563('0x56')]);def[_0x6563('0x57')]=util[_0x6563('0x39')](_0x6563('0x6d'),_0x2ff97f[_0x6563('0x55')]);if(_0x5ad0eb&&_0x5ad0eb[_0x6563('0x6e')]&&_0x5ad0eb[_0x6563('0x6e')]!==_0x6563('0x6f')){logger[_0x6563('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1c7206['recordingURL']=util['format'](_0x6563('0x5b'),_0x2ff97f['serverUrl'],_0x1c7206[_0x6563('0x5c')],md5(_0x1c7206[_0x6563('0x5c')]));}return getConnection(_0x2ff97f)[_0x6563('0x2b')](function(_0x32c859){_0x89c8d9=_0x32c859;return getUser(_0x2ff97f,_0x1bf170[_0x6563('0xf')],_0x89c8d9);})['then'](function(_0x19413e){_0x18b4fa=_0x19413e;logger['info'](_0x6563('0x70'),_0x18b4fa['id']);return getEndUser(_0x2ff97f,_0x1c7206[_0x6563('0x71')],_0x1c7206[_0x6563('0x72')],_0x89c8d9);})[_0x6563('0x2b')](function(_0x235621){_0x30baeb=_0x235621;logger[_0x6563('0xd')](_0x6563('0x5f'),_0x30baeb['id']);return getTicket(_0x2ff97f,_0x18b4fa,_0x30baeb,_0x49f12d,_0x1c7206,_0x49f12d[_0x6563('0x60')],_0x89c8d9,'Outbound');})[_0x6563('0x2b')](function(_0x523ebf){_0x15a39d=_0x523ebf;logger[_0x6563('0xd')](_0x6563('0x62'));logger[_0x6563('0xd')]('The\x20Ticket\x20ID\x20is:',_0x15a39d['id']);return setRelationship(_0x89c8d9,_0x18b4fa,_0x15a39d,_0x6563('0x63'));})[_0x6563('0x2b')](function(){return setRelationship(_0x89c8d9,_0x30baeb,_0x15a39d,'contacts');})[_0x6563('0x2b')](function(){return getServerInfo(_0x89c8d9);})[_0x6563('0x2b')](function(_0x4fb589){var _0x49962d=parseInt(_0x4fb589[_0x6563('0x65')][_0x6563('0x66')](0x0));var _0x4ff9a3=util['format'](_0x6563('0x67'),_0x2ff97f[_0x6563('0x55')],_0x15a39d['id']);if(_0x49962d>0x6){_0x4ff9a3=util[_0x6563('0x39')](_0x6563('0x73'),_0x2ff97f[_0x6563('0x55')],_0x15a39d['id']);}logger['info'](_0x6563('0x74'),_0x6563('0x68'));emit(util[_0x6563('0x39')](_0x6563('0x75'),_0x1bf170[_0x6563('0xf')]),_0x6563('0x69'),{'uri':_0x4ff9a3});})['catch'](function(_0x35d5dd){logger['error'](_0x6563('0x74'),JSON[_0x6563('0x23')](_0x35d5dd));});};exports[_0x6563('0x76')]=function(_0xf5259c,_0x1e1f29,_0x1c53eb,_0x56444f,_0x4aa167,_0x36b4ce){var _0x4322d8,_0x488740,_0x26bf93,_0x5eefc0;_0x36b4ce[_0x6563('0x55')]=intUtil[_0x6563('0x54')](_0x36b4ce['remoteUri']);_0x36b4ce[_0x6563('0x56')]=intUtil[_0x6563('0x54')](_0x36b4ce[_0x6563('0x56')]);def[_0x6563('0x57')]=util[_0x6563('0x39')]('%s/service/v4_1/rest.php',_0x36b4ce[_0x6563('0x55')]);if(_0x4aa167&&_0x4aa167[_0x6563('0x58')]){logger[_0x6563('0xd')]('['+_0x1e1f29[_0x6563('0x77')][_0x6563('0x78')]()+']','Recording\x20is\x20enabled!');_0x1e1f29[_0x6563('0x5a')]=util[_0x6563('0x39')](_0x6563('0x5b'),_0x36b4ce[_0x6563('0x56')],_0x1e1f29[_0x6563('0x5c')],md5(_0x1e1f29[_0x6563('0x5c')]));}else{_0x1e1f29[_0x6563('0x5a')]='';}return getConnection(_0x36b4ce)['then'](function(_0x2fc869){_0x5eefc0=_0x2fc869;if(!_[_0x6563('0x29')](_0x56444f)){return getUser(_0x36b4ce,_0x56444f[_0x6563('0xf')],_0x5eefc0);}else{return getUser(_0x36b4ce,null,_0x5eefc0);}})[_0x6563('0x2b')](function(_0x26dc4b){_0x4322d8=_0x26dc4b;logger[_0x6563('0xd')](_0x6563('0x70'),_0x4322d8['id']);return getEndUser(_0x36b4ce,_0x1e1f29[_0x6563('0x5d')],_0x1e1f29[_0x6563('0x5e')],_0x5eefc0);})[_0x6563('0x2b')](function(_0xd4ff3e){_0x488740=_0xd4ff3e;logger[_0x6563('0xd')](_0x6563('0x5f'),_0x488740['id']);return getTicket(_0x36b4ce,_0x4322d8,_0x488740,_0x1c53eb,_0x1e1f29,_0x1c53eb['Fields'],_0x5eefc0,_0x6563('0x61'));})[_0x6563('0x2b')](function(_0x22b3b2){_0x26bf93=_0x22b3b2;logger[_0x6563('0xd')](_0x6563('0x62'));logger['info'](_0x6563('0x79'),_0x26bf93['id']);return setRelationship(_0x5eefc0,_0x4322d8,_0x26bf93,_0x6563('0x63'));})[_0x6563('0x2b')](function(){return setRelationship(_0x5eefc0,_0x488740,_0x26bf93,_0x6563('0x64'));})[_0x6563('0x2b')](function(){return getServerInfo(_0x5eefc0);})[_0x6563('0x6a')](function(_0x532b93){logger[_0x6563('0x6b')]('['+_0x1e1f29[_0x6563('0x77')][_0x6563('0x78')]()+']',JSON[_0x6563('0x23')](_0x532b93));});}; \ No newline at end of file +var _0x0c08=['[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','%s/service/v4_1/rest.php','lastevent','toUpperCase','contacts','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','emit','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','JSON','isNil','info','get_entry_list','Employees','user_name','then','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','entry_list','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','forEach','string','customField','toLowerCase','content','type','custom_fields','idField','variable','customVariable','Variable','POST','login','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c08,0x99));var _0x80c0=function(_0x20be28,_0x24b925){_0x20be28=_0x20be28-0x0;var _0x8ab067=_0x0c08[_0x20be28];return _0x8ab067;};'use strict';var _=require(_0x80c0('0x0'));var rp=require(_0x80c0('0x1'));var BPromise=require(_0x80c0('0x2'));var md5=require(_0x80c0('0x3'));var util=require(_0x80c0('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x80c0('0x5'));var logger=require(_0x80c0('0x6'))('sugarcrm');config['redis']=_[_0x80c0('0x7')](config['redis'],{'host':_0x80c0('0x8'),'port':0x18eb});var io=require(_0x80c0('0x9'))(new Redis(config[_0x80c0('0xa')]));var def={'method':'POST','json':!![]};function emit(_0xd12ad4,_0x4c4cb6,_0x5a7334){io['to'](_0xd12ad4)[_0x80c0('0xb')](_0x4c4cb6,_0x5a7334);}function getTicket(_0x415b70,_0x1b360d,_0x4b9b57,_0x3c996d,_0x1e05ea,_0x2fd6f2,_0x1610b1,_0x2b5fd2){logger['info'](_0x80c0('0xc'));var _0x70607f=new Date();var _0x55f894=[{'name':_0x80c0('0xd'),'value':intUtil[_0x80c0('0xe')](_0x3c996d[_0x80c0('0xf')],_0x1e05ea,'\x20')},{'name':'assigned_user_id','value':_0x1b360d['id']},{'name':_0x80c0('0x10'),'value':_0x1b360d['id']},{'name':_0x80c0('0x11'),'value':intUtil[_0x80c0('0xe')](_0x3c996d['Descriptions'],_0x1e05ea,'\x0a')},{'name':_0x80c0('0x12'),'value':_0x70607f['toISOString']()[_0x80c0('0x13')](0x0,0x13)[_0x80c0('0x14')]('T','\x20')},{'name':_0x80c0('0x15'),'value':'0'},{'name':_0x80c0('0x16'),'value':'15'},{'name':_0x80c0('0x17'),'value':_0x4b9b57['id']},{'name':_0x80c0('0x18'),'value':_0x80c0('0x19')},{'name':_0x80c0('0x1a'),'value':_0x4b9b57[_0x80c0('0xd')]},{'name':_0x80c0('0x1b'),'value':_0x2b5fd2}];if(_0x2fd6f2[_0x80c0('0x1c')]){_['forEach'](_0x2fd6f2,function(_0x2f6700){if(_0x1e05ea[_0x2f6700[_0x80c0('0x1d')]]){_0x55f894[_0x80c0('0x1e')]({'name':_0x2f6700['idField'],'value':_0x1e05ea[_0x2f6700[_0x80c0('0x1d')]]});}});}return request({'form':{'method':_0x80c0('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x80c0('0x20')]({'session':_0x1610b1['id'],'module_name':_0x80c0('0x21'),'name_value_list':_0x55f894})}});}function getAuth(_0x3754e5){return util[_0x80c0('0x22')](_0x80c0('0x23'),new Buffer(_0x3754e5[_0x80c0('0x24')]+':X')['toString'](_0x80c0('0x25')));}function getServerInfo(_0x563913){return request({'form':{'method':_0x80c0('0x26'),'input_type':_0x80c0('0x27'),'response_type':_0x80c0('0x27'),'rest_data':JSON[_0x80c0('0x20')]({'session':_0x563913['id']})}});}function getUser(_0x3ef286,_0x40030a,_0x5e899a){if(!_[_0x80c0('0x28')](_0x40030a)){logger[_0x80c0('0x29')]('Getting\x20agent\x20with\x20name',_0x40030a);return request({'form':{'method':_0x80c0('0x2a'),'input_type':_0x80c0('0x27'),'response_type':_0x80c0('0x27'),'rest_data':JSON[_0x80c0('0x20')]({'session':_0x5e899a['id'],'module_name':_0x80c0('0x2b'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x40030a),'order_by':'','offset':'0','select_fields':['id','name',_0x80c0('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x80c0('0x2d')](function(_0x3b5414){if(_0x3b5414['entry_list']['length']){var _0x114f18=_[_0x80c0('0x2e')](_0x3b5414['entry_list'],function(_0x518b92){return _0x518b92[_0x80c0('0x2f')]['user_name']['value']===_0x40030a;});if(_0x114f18){logger[_0x80c0('0x29')](_0x80c0('0x30'));return BPromise[_0x80c0('0x31')]({'id':_0x114f18[_0x80c0('0x2f')]['id'][_0x80c0('0x32')],'name':_0x114f18[_0x80c0('0x2f')][_0x80c0('0xd')]['value']});}}logger['info'](_0x80c0('0x33'));return BPromise[_0x80c0('0x31')]({'id':_0x5e899a[_0x80c0('0x2f')][_0x80c0('0x34')][_0x80c0('0x32')],'name':_0x5e899a[_0x80c0('0x2f')][_0x80c0('0x2c')][_0x80c0('0x32')]});});}else{logger[_0x80c0('0x29')](_0x80c0('0x35'));return BPromise['resolve']({'id':_0x5e899a[_0x80c0('0x2f')][_0x80c0('0x34')]['value'],'name':_0x5e899a['name_value_list'][_0x80c0('0x2c')]['value']});}}function getEndUser(_0x2b18b0,_0x476a16,_0x1c2c37,_0x2ff0f8){logger[_0x80c0('0x29')](_0x80c0('0x36'),_0x1c2c37);return request({'form':{'method':'get_entry_list','input_type':_0x80c0('0x27'),'response_type':_0x80c0('0x27'),'rest_data':JSON[_0x80c0('0x20')]({'session':_0x2ff0f8['id'],'module_name':_0x80c0('0x19'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x1c2c37),'order_by':'','offset':'0','select_fields':['id',_0x80c0('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x477c70){if(_0x477c70[_0x80c0('0x37')][_0x80c0('0x1c')]){var _0x349112=_[_0x80c0('0x2e')](_0x477c70[_0x80c0('0x37')],function(_0x36112b){return _0x36112b[_0x80c0('0x2f')]['phone_home'][_0x80c0('0x32')]===_0x1c2c37;});if(_0x349112){logger[_0x80c0('0x29')](_0x80c0('0x38'));return BPromise[_0x80c0('0x31')]({'id':_0x349112['name_value_list']['id'][_0x80c0('0x32')],'name':_0x349112[_0x80c0('0x2f')]['name'][_0x80c0('0x32')],'phone':_0x349112[_0x80c0('0x2f')][_0x80c0('0x39')][_0x80c0('0x32')]});}}else{logger[_0x80c0('0x29')](_0x80c0('0x3a'));return request({'form':{'method':_0x80c0('0x1f'),'input_type':'JSON','response_type':_0x80c0('0x27'),'rest_data':JSON[_0x80c0('0x20')]({'session':_0x2ff0f8['id'],'module_name':_0x80c0('0x19'),'name_value_list':[{'name':'first_name','value':_0x476a16!==_0x80c0('0x3b')?_0x476a16:util['format'](_0x80c0('0x3c'),_0x1c2c37)},{'name':_0x80c0('0x39'),'value':_0x1c2c37}]})}})[_0x80c0('0x2d')](function(_0x6e1ee7){logger[_0x80c0('0x29')](_0x80c0('0x3d'));return BPromise['resolve']({'id':_0x6e1ee7['id'],'name':_0x6e1ee7[_0x80c0('0x37')][_0x80c0('0x3e')][_0x80c0('0x32')],'phone':_0x6e1ee7[_0x80c0('0x37')]['phone_home']['value']});});}});}function request(_0x73d429){logger[_0x80c0('0x3f')](_0x80c0('0x40'),JSON['stringify'](_0x73d429));return rp(_['merge'](def,_0x73d429));}function getTags(_0x359344,_0x47c9e9){var _0x597596=[];if(_0x359344&&_0x359344['length']>0x0){_0x597596=_[_0x80c0('0x41')](_0x359344,_0x47c9e9);}return _0x597596;}function getCustomFields(_0x4ab792,_0x5eee55){var _0x5ddc91=[];var _0x403115={'custom_fields':[]};if(_0x4ab792[_0x80c0('0x1c')]>0x0){_[_0x80c0('0x42')](_0x4ab792,function(_0x1db5eb){if(_0x1db5eb['type']===_0x80c0('0x43')&&_0x1db5eb['nameField']&&!_0x1db5eb[_0x80c0('0x44')]){_0x403115[_0x1db5eb['nameField'][_0x80c0('0x45')]()]=_0x1db5eb[_0x80c0('0x46')]['toString']();}else if(_0x1db5eb[_0x80c0('0x47')]==='string'&&_0x1db5eb['idField']&&_0x1db5eb['customField']){_0x403115[_0x80c0('0x48')]['push']({'id':_0x1db5eb[_0x80c0('0x49')],'value':_0x1db5eb[_0x80c0('0x46')]['toString']()});}else if(_0x1db5eb[_0x80c0('0x47')]===_0x80c0('0x4a')&&_0x1db5eb[_0x80c0('0x1d')]&&_0x1db5eb[_0x80c0('0x49')]&&_0x1db5eb[_0x80c0('0x44')]){_0x5eee55[_0x1db5eb[_0x80c0('0x1d')]]&&_0x403115[_0x80c0('0x48')][_0x80c0('0x1e')]({'id':_0x1db5eb[_0x80c0('0x49')],'value':_0x5eee55[_0x1db5eb[_0x80c0('0x1d')]]['toString']()});}else if(_0x1db5eb[_0x80c0('0x47')]===_0x80c0('0x4b')&&_0x1db5eb[_0x80c0('0x4c')]&&_0x1db5eb[_0x80c0('0x4c')]['name']&&_0x1db5eb[_0x80c0('0x49')]&&_0x1db5eb[_0x80c0('0x44')]){_0x5eee55[_0x1db5eb[_0x80c0('0x4c')][_0x80c0('0xd')][_0x80c0('0x45')]()]&&_0x403115[_0x80c0('0x48')][_0x80c0('0x1e')]({'id':_0x1db5eb[_0x80c0('0x49')],'value':_0x5eee55[_0x1db5eb[_0x80c0('0x4c')]['name'][_0x80c0('0x45')]()]['toString']()});}});}return _0x403115;}function getConnection(_0x24139f){return request({'method':_0x80c0('0x4d'),'form':{'method':_0x80c0('0x4e'),'input_type':_0x80c0('0x27'),'response_type':_0x80c0('0x27'),'rest_data':JSON[_0x80c0('0x20')]({'user_auth':{'user_name':_0x24139f['username'],'password':_0x24139f[_0x80c0('0x4f')],'encryption':'PLAIN'},'application':_0x80c0('0x50')})}})[_0x80c0('0x2d')](function(_0x5d78b4){var _0x108dd2=_0x5d78b4;if(_0x108dd2['id']){def['sessionID']=_0x108dd2['id'];return BPromise['resolve'](_0x108dd2);}else{throw new Error(util[_0x80c0('0x22')](_0x80c0('0x51'),_0x24139f['id']));}});}function setRelationship(_0x3809a5,_0xb881e3,_0x57027e,_0x1099d7){return request({'form':{'method':_0x80c0('0x52'),'input_type':_0x80c0('0x27'),'response_type':_0x80c0('0x27'),'rest_data':JSON[_0x80c0('0x20')]({'session':_0x3809a5['id'],'module_name':_0x80c0('0x21'),'module_id':_0x57027e['id'],'link_field_name':_0x1099d7,'related_ids':[_0xb881e3['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x80c0('0x53')]=function(_0x54d448,_0x52cbcd,_0x29ed7a,_0x4de498,_0x2da9aa,_0x20a39){var _0x4c8f2f,_0x10eb87,_0x3ac89b,_0x56ff32;_0x20a39[_0x80c0('0x54')]=intUtil[_0x80c0('0x55')](_0x20a39['remoteUri']);_0x20a39['serverUrl']=intUtil[_0x80c0('0x55')](_0x20a39[_0x80c0('0x56')]);def[_0x80c0('0x57')]=util[_0x80c0('0x22')]('%s/service/v4_1/rest.php',_0x20a39[_0x80c0('0x54')]);if(_0x2da9aa&&_0x2da9aa[_0x80c0('0x58')]){logger['info'](_0x80c0('0x59'),'Recording\x20is\x20enabled!');_0x52cbcd[_0x80c0('0x5a')]=util[_0x80c0('0x22')](_0x80c0('0x5b'),_0x20a39[_0x80c0('0x56')],_0x52cbcd[_0x80c0('0x5c')],md5(_0x52cbcd[_0x80c0('0x5c')]));}else{_0x52cbcd[_0x80c0('0x5a')]='';}return getConnection(_0x20a39)[_0x80c0('0x2d')](function(_0x2ad825){_0x56ff32=_0x2ad825;return getUser(_0x20a39,_0x4de498[_0x80c0('0xd')],_0x56ff32);})[_0x80c0('0x2d')](function(_0x3fa980){_0x4c8f2f=_0x3fa980;logger[_0x80c0('0x29')](_0x80c0('0x5d'),_0x4c8f2f['id']);return getEndUser(_0x20a39,_0x52cbcd[_0x80c0('0x5e')],_0x52cbcd[_0x80c0('0x5f')],_0x56ff32);})['then'](function(_0x3206f5){_0x10eb87=_0x3206f5;logger[_0x80c0('0x29')](_0x80c0('0x60'),_0x10eb87['id']);return getTicket(_0x20a39,_0x4c8f2f,_0x10eb87,_0x29ed7a,_0x52cbcd,_0x29ed7a[_0x80c0('0x61')],_0x56ff32,_0x80c0('0x62'));})['then'](function(_0x8120ba){_0x3ac89b=_0x8120ba;logger[_0x80c0('0x29')](_0x80c0('0x63'));logger[_0x80c0('0x29')](_0x80c0('0x64'),_0x3ac89b['id']);return setRelationship(_0x56ff32,_0x4c8f2f,_0x3ac89b,_0x80c0('0x65'));})[_0x80c0('0x2d')](function(){return setRelationship(_0x56ff32,_0x10eb87,_0x3ac89b,'contacts');})[_0x80c0('0x2d')](function(){return getServerInfo(_0x56ff32);})[_0x80c0('0x2d')](function(_0xa79afc){var _0x1088e0=parseInt(_0xa79afc[_0x80c0('0x66')][_0x80c0('0x67')](0x0));var _0x32916d=util['format'](_0x80c0('0x68'),_0x20a39[_0x80c0('0x54')],_0x3ac89b['id']);if(_0x1088e0>0x6){_0x32916d=util[_0x80c0('0x22')](_0x80c0('0x69'),_0x20a39[_0x80c0('0x54')],_0x3ac89b['id']);}logger['info'](_0x80c0('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x80c0('0x22')](_0x80c0('0x6a'),_0x4de498['name']),_0x80c0('0x6b'),{'uri':_0x32916d});})[_0x80c0('0x6c')](function(_0x2f2caf){logger[_0x80c0('0x6d')](_0x80c0('0x59'),JSON[_0x80c0('0x20')](_0x2f2caf));});};exports['outbound']=function(_0x3b033f,_0x948fda,_0xa64680,_0x15d57,_0x3c56a6,_0x413ae4,_0x1e097b){var _0x1eb66c,_0x11f4ee,_0x14805c,_0x51a276;_0x413ae4[_0x80c0('0x54')]=intUtil['stripTrailingSlash'](_0x413ae4[_0x80c0('0x54')]);_0x413ae4[_0x80c0('0x56')]=intUtil[_0x80c0('0x55')](_0x413ae4[_0x80c0('0x56')]);def[_0x80c0('0x57')]=util[_0x80c0('0x22')]('%s/service/v4_1/rest.php',_0x413ae4[_0x80c0('0x54')]);if(_0x1e097b&&_0x1e097b['recordingFormat']&&_0x1e097b[_0x80c0('0x6e')]!=='none'){logger[_0x80c0('0x29')](_0x80c0('0x6f'),_0x80c0('0x70'));_0x948fda[_0x80c0('0x5a')]=util[_0x80c0('0x22')](_0x80c0('0x5b'),_0x413ae4[_0x80c0('0x56')],_0x948fda[_0x80c0('0x5c')],md5(_0x948fda[_0x80c0('0x5c')]));}return getConnection(_0x413ae4)['then'](function(_0x35fd75){_0x51a276=_0x35fd75;return getUser(_0x413ae4,_0x15d57[_0x80c0('0xd')],_0x51a276);})['then'](function(_0x183d55){_0x1eb66c=_0x183d55;logger['info'](_0x80c0('0x5d'),_0x1eb66c['id']);return getEndUser(_0x413ae4,_0x948fda[_0x80c0('0x71')],_0x948fda[_0x80c0('0x72')],_0x51a276);})['then'](function(_0xbbab5b){_0x11f4ee=_0xbbab5b;logger[_0x80c0('0x29')](_0x80c0('0x60'),_0x11f4ee['id']);return getTicket(_0x413ae4,_0x1eb66c,_0x11f4ee,_0xa64680,_0x948fda,_0xa64680[_0x80c0('0x61')],_0x51a276,'Outbound');})['then'](function(_0x4398df){_0x14805c=_0x4398df;logger[_0x80c0('0x29')](_0x80c0('0x63'));logger[_0x80c0('0x29')](_0x80c0('0x64'),_0x14805c['id']);return setRelationship(_0x51a276,_0x1eb66c,_0x14805c,'users');})['then'](function(){return setRelationship(_0x51a276,_0x11f4ee,_0x14805c,'contacts');})[_0x80c0('0x2d')](function(){return getServerInfo(_0x51a276);})[_0x80c0('0x2d')](function(_0x1cf305){var _0x9223b8=parseInt(_0x1cf305['version'][_0x80c0('0x67')](0x0));var _0x44aff4=util['format'](_0x80c0('0x68'),_0x413ae4['remoteUri'],_0x14805c['id']);if(_0x9223b8>0x6){_0x44aff4=util[_0x80c0('0x22')](_0x80c0('0x69'),_0x413ae4['remoteUri'],_0x14805c['id']);}logger['info'](_0x80c0('0x6f'),_0x80c0('0x73'));emit(util[_0x80c0('0x22')](_0x80c0('0x6a'),_0x15d57[_0x80c0('0xd')]),_0x80c0('0x6b'),{'uri':_0x44aff4});})[_0x80c0('0x6c')](function(_0x531934){logger['error']('[OUTBOUND]',JSON[_0x80c0('0x20')](_0x531934));});};exports[_0x80c0('0x74')]=function(_0x5c741e,_0x2c7484,_0x227421,_0x5286c0,_0x452a1b,_0x5c6381){var _0x52bb56,_0x17b894,_0x5443fd,_0x36abb9;_0x5c6381[_0x80c0('0x54')]=intUtil[_0x80c0('0x55')](_0x5c6381[_0x80c0('0x54')]);_0x5c6381[_0x80c0('0x56')]=intUtil[_0x80c0('0x55')](_0x5c6381['serverUrl']);def[_0x80c0('0x57')]=util[_0x80c0('0x22')](_0x80c0('0x75'),_0x5c6381['remoteUri']);if(_0x452a1b&&_0x452a1b[_0x80c0('0x58')]){logger['info']('['+_0x2c7484[_0x80c0('0x76')][_0x80c0('0x77')]()+']',_0x80c0('0x70'));_0x2c7484[_0x80c0('0x5a')]=util[_0x80c0('0x22')](_0x80c0('0x5b'),_0x5c6381[_0x80c0('0x56')],_0x2c7484['uniqueid'],md5(_0x2c7484['uniqueid']));}else{_0x2c7484[_0x80c0('0x5a')]='';}return getConnection(_0x5c6381)[_0x80c0('0x2d')](function(_0x307aaa){_0x36abb9=_0x307aaa;if(!_['isNil'](_0x5286c0)){return getUser(_0x5c6381,_0x5286c0[_0x80c0('0xd')],_0x36abb9);}else{return getUser(_0x5c6381,null,_0x36abb9);}})[_0x80c0('0x2d')](function(_0x3f99eb){_0x52bb56=_0x3f99eb;logger[_0x80c0('0x29')]('The\x20User\x20ID\x20is:',_0x52bb56['id']);return getEndUser(_0x5c6381,_0x2c7484[_0x80c0('0x5e')],_0x2c7484['calleridnum'],_0x36abb9);})[_0x80c0('0x2d')](function(_0x1c3318){_0x17b894=_0x1c3318;logger[_0x80c0('0x29')](_0x80c0('0x60'),_0x17b894['id']);return getTicket(_0x5c6381,_0x52bb56,_0x17b894,_0x227421,_0x2c7484,_0x227421[_0x80c0('0x61')],_0x36abb9,'Inbound');})[_0x80c0('0x2d')](function(_0x4ec4e9){_0x5443fd=_0x4ec4e9;logger[_0x80c0('0x29')](_0x80c0('0x63'));logger['info'](_0x80c0('0x64'),_0x5443fd['id']);return setRelationship(_0x36abb9,_0x52bb56,_0x5443fd,_0x80c0('0x65'));})[_0x80c0('0x2d')](function(){return setRelationship(_0x36abb9,_0x17b894,_0x5443fd,_0x80c0('0x78'));})[_0x80c0('0x2d')](function(){return getServerInfo(_0x36abb9);})['catch'](function(_0x2658c1){logger['error']('['+_0x2c7484[_0x80c0('0x76')][_0x80c0('0x77')]()+']',JSON[_0x80c0('0x20')](_0x2658c1));});}; \ 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 9f62526..fa8bdf3 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 _0x729f=['%s:\x20%s','keyContent','substring','validateEmail','test','lodash','util','getString','length','type','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format'];(function(_0x244793,_0x1ec1be){var _0x594a61=function(_0x2c005f){while(--_0x2c005f){_0x244793['push'](_0x244793['shift']());}};_0x594a61(++_0x1ec1be);}(_0x729f,0xa6));var _0xf729=function(_0xfe4370,_0x4032c3){_0xfe4370=_0xfe4370-0x0;var _0x2e9a4c=_0x729f[_0xfe4370];return _0x2e9a4c;};'use strict';var _=require(_0xf729('0x0'));var util=require(_0xf729('0x1'));exports[_0xf729('0x2')]=function(_0x334299,_0x360e49,_0x555e40){var _0x172e00=[];if(_0x334299[_0xf729('0x3')]>0x0){var _0x41f43b=_['sortBy'](_0x334299,['id']);for(var _0x794c60=0x0;_0x794c60<_0x41f43b[_0xf729('0x3')];_0x794c60++){var _0x181b71=_0x41f43b[_0x794c60];if(_0x181b71[_0xf729('0x4')]==='string'){_0x172e00[_0xf729('0x5')](_0x181b71[_0xf729('0x6')]);}else if(_0x181b71[_0xf729('0x4')]==='variable'&&_0x181b71[_0xf729('0x7')]){_0x360e49[_0x181b71[_0xf729('0x7')]]&&_0x172e00['push'](_0x360e49[_0x181b71['variableName']][_0xf729('0x8')]());}else if(_0x181b71[_0xf729('0x4')]===_0xf729('0x9')&&_0x181b71[_0xf729('0xa')]&&_0x181b71[_0xf729('0xa')][_0xf729('0xb')]){_0x360e49[_0x181b71[_0xf729('0xa')][_0xf729('0xb')][_0xf729('0xc')]()]&&_0x172e00[_0xf729('0x5')](_0x360e49[_0x181b71[_0xf729('0xa')][_0xf729('0xb')]['toLowerCase']()][_0xf729('0x8')]());}else if(_0x181b71['type']===_0xf729('0xd')){if(_0x181b71[_0xf729('0xe')]===_0xf729('0xf')&&_0x181b71[_0xf729('0x10')]){_0x172e00['push'](util[_0xf729('0x11')](_0xf729('0x12'),_0x181b71['key'],_0x181b71[_0xf729('0x13')]));}else if(_0x181b71[_0xf729('0xe')]==='variable'&&_0x181b71[_0xf729('0x7')]&&_0x181b71[_0xf729('0x10')]){_0x360e49[_0x181b71[_0xf729('0x7')]]&&_0x172e00[_0xf729('0x5')](util[_0xf729('0x11')]('%s:\x20%s',_0x181b71[_0xf729('0x10')],_0x360e49[_0x181b71['variableName']]));}else if(_0x181b71[_0xf729('0xe')]==='customVariable'&&_0x181b71['Variable']&&_0x181b71[_0xf729('0xa')][_0xf729('0xb')]&&_0x181b71['key']){_0x360e49[_0x181b71['Variable'][_0xf729('0xb')][_0xf729('0xc')]()]&&_0x172e00[_0xf729('0x5')](util[_0xf729('0x11')]('%s:\x20%s',_0x181b71[_0xf729('0x10')],_0x360e49[_0x181b71[_0xf729('0xa')][_0xf729('0xb')][_0xf729('0xc')]()]));}}}}return _0x172e00['join'](_0x555e40);};exports['stripTrailingSlash']=function(_0x44343f){var _0x55a61f=_0x44343f['slice'](-0x1);if(_0x55a61f==='/'){_0x44343f=_0x44343f[_0xf729('0x14')](0x0,_0x44343f['lastIndexOf'](_0x55a61f));}return _0x44343f;};exports[_0xf729('0x15')]=function(_0xbb54eb){if(!_['isNil'](_0xbb54eb)&&_0xbb54eb!==''){var _0x469e6f=/^(([^<>()\[\]\\.,;:\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 _0x469e6f[_0xf729('0x16')](String(_0xbb54eb)[_0xf729('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x30c6=['keyContent','join','slice','substring','lastIndexOf','isNil','test','lodash','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x30c6,0x1a7));var _0x630c=function(_0x3efd47,_0x60ce2a){_0x3efd47=_0x3efd47-0x0;var _0x2347a4=_0x30c6[_0x3efd47];return _0x2347a4;};'use strict';var _=require(_0x630c('0x0'));var util=require('util');exports['getString']=function(_0x4f6a0f,_0x577ede,_0x1d33e3){var _0x6888f9=[];if(_0x4f6a0f[_0x630c('0x1')]>0x0){var _0x892207=_[_0x630c('0x2')](_0x4f6a0f,['id']);for(var _0x2afa39=0x0;_0x2afa39<_0x892207[_0x630c('0x1')];_0x2afa39++){var _0x22bc1a=_0x892207[_0x2afa39];if(_0x22bc1a[_0x630c('0x3')]===_0x630c('0x4')){_0x6888f9[_0x630c('0x5')](_0x22bc1a[_0x630c('0x6')]);}else if(_0x22bc1a[_0x630c('0x3')]===_0x630c('0x7')&&_0x22bc1a[_0x630c('0x8')]){_0x577ede[_0x22bc1a[_0x630c('0x8')]]&&_0x6888f9['push'](_0x577ede[_0x22bc1a[_0x630c('0x8')]][_0x630c('0x9')]());}else if(_0x22bc1a['type']===_0x630c('0xa')&&_0x22bc1a[_0x630c('0xb')]&&_0x22bc1a[_0x630c('0xb')][_0x630c('0xc')]){_0x577ede[_0x22bc1a[_0x630c('0xb')][_0x630c('0xc')][_0x630c('0xd')]()]&&_0x6888f9[_0x630c('0x5')](_0x577ede[_0x22bc1a[_0x630c('0xb')][_0x630c('0xc')]['toLowerCase']()][_0x630c('0x9')]());}else if(_0x22bc1a['type']===_0x630c('0xe')){if(_0x22bc1a[_0x630c('0xf')]==='string'&&_0x22bc1a[_0x630c('0x10')]){_0x6888f9[_0x630c('0x5')](util[_0x630c('0x11')](_0x630c('0x12'),_0x22bc1a[_0x630c('0x10')],_0x22bc1a[_0x630c('0x13')]));}else if(_0x22bc1a[_0x630c('0xf')]==='variable'&&_0x22bc1a['variableName']&&_0x22bc1a[_0x630c('0x10')]){_0x577ede[_0x22bc1a[_0x630c('0x8')]]&&_0x6888f9[_0x630c('0x5')](util[_0x630c('0x11')](_0x630c('0x12'),_0x22bc1a['key'],_0x577ede[_0x22bc1a[_0x630c('0x8')]]));}else if(_0x22bc1a[_0x630c('0xf')]===_0x630c('0xa')&&_0x22bc1a[_0x630c('0xb')]&&_0x22bc1a[_0x630c('0xb')][_0x630c('0xc')]&&_0x22bc1a['key']){_0x577ede[_0x22bc1a[_0x630c('0xb')][_0x630c('0xc')]['toLowerCase']()]&&_0x6888f9['push'](util[_0x630c('0x11')](_0x630c('0x12'),_0x22bc1a[_0x630c('0x10')],_0x577ede[_0x22bc1a[_0x630c('0xb')][_0x630c('0xc')][_0x630c('0xd')]()]));}}}}return _0x6888f9[_0x630c('0x14')](_0x1d33e3);};exports['stripTrailingSlash']=function(_0x54eaa5){var _0x45c2a5=_0x54eaa5[_0x630c('0x15')](-0x1);if(_0x45c2a5==='/'){_0x54eaa5=_0x54eaa5[_0x630c('0x16')](0x0,_0x54eaa5[_0x630c('0x17')](_0x45c2a5));}return _0x54eaa5;};exports['validateEmail']=function(_0x3cbe1d){if(!_[_0x630c('0x18')](_0x3cbe1d)&&_0x3cbe1d!==''){var _0xbe055e=/^(([^<>()\[\]\\.,;:\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 _0xbe055e[_0x630c('0x19')](String(_0x3cbe1d)[_0x630c('0xd')]());}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 575ce41..8df57d3 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x1e15f1,_0x34a338){var _0x21fc99=function(_0x28b293){while(--_0x28b293){_0x1e15f1['push'](_0x1e15f1['shift']());}};_0x21fc99(++_0x34a338);}(_0x34e8,0x12c));var _0x834e=function(_0x3c5b55,_0x8c66d9){_0x3c5b55=_0x3c5b55-0x0;var _0x3aa900=_0x34e8[_0x3c5b55];return _0x3aa900;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index c907c19..9a184d8 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 _0xfe93=['outbound','recordingFormat','none','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','format','remoteUri','POST','merge','Tags','name','getString','Descriptions','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','count','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','results','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','string','picklist','nameField','customField','content','toString','idField','custom_fields','push','type','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect'];(function(_0x3031ad,_0x1e6d8b){var _0xc80faa=function(_0x1fb4ff){while(--_0x1fb4ff){_0x3031ad['push'](_0x3031ad['shift']());}};_0xc80faa(++_0x1e6d8b);}(_0xfe93,0x1cc));var _0x3fe9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfe93[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var rp=require(_0x3fe9('0x0'));var md5=require(_0x3fe9('0x1'));var util=require(_0x3fe9('0x2'));var Redis=require(_0x3fe9('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3fe9('0x4'))(_0x3fe9('0x5'));config['redis']=_[_0x3fe9('0x6')](config[_0x3fe9('0x7')],{'host':_0x3fe9('0x8'),'port':0x18eb});var io=require(_0x3fe9('0x9'))(new Redis(config[_0x3fe9('0x7')]));function emit(_0x2738f7,_0x384168,_0x4d1937){io['to'](_0x2738f7)[_0x3fe9('0xa')](_0x384168,_0x4d1937);}var headers={'Content-Type':_0x3fe9('0xb'),'Accept':_0x3fe9('0xb')};function getTicket(_0x21342f,_0x5ce3d5,_0x544225,_0x49863b,_0x1bca66){logger[_0x3fe9('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x3fe9('0xd')]('%s/tickets.json',_0x21342f[_0x3fe9('0xe')]),'method':_0x3fe9('0xf'),'body':{'ticket':_[_0x3fe9('0x10')]({'requester_id':_0x544225['id'],'submitter_id':_0x5ce3d5?_0x5ce3d5['id']:undefined,'assignee_id':_0x5ce3d5?_0x5ce3d5['id']:undefined,'tags':getTags(_0x49863b[_0x3fe9('0x11')],_0x3fe9('0x12')),'subject':intUtil[_0x3fe9('0x13')](_0x49863b['Subjects'],_0x1bca66,'\x20'),'description':intUtil['getString'](_0x49863b[_0x3fe9('0x14')],_0x1bca66,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3fe9('0x13')](_0x49863b[_0x3fe9('0x14')],_0x1bca66,'\x0a')}},getCustomFields(_0x49863b['Fields'],_0x1bca66))}})['then'](function(_0x4486a2){logger['info'](_0x3fe9('0x15'));return _0x4486a2[_0x3fe9('0x16')];});}function getUser(_0x2542e8,_0x1cd781){if(intUtil['validateEmail'](_0x1cd781)){logger[_0x3fe9('0xc')](_0x3fe9('0x17'),_0x1cd781);return request({'uri':util['format']('%s/search.json',_0x2542e8[_0x3fe9('0xe')]),'qs':{'query':util['format'](_0x3fe9('0x18'),_0x1cd781)}})[_0x3fe9('0x19')](function(_0x1c2db3){if(_0x1c2db3[_0x3fe9('0x1a')]){logger[_0x3fe9('0xc')]('Agent\x20found!');return _['find'](_0x1c2db3['results'],{'email':_0x1cd781,'role':_0x3fe9('0x1b')});}else{logger[_0x3fe9('0xc')](_0x3fe9('0x1c'));return request({'uri':util['format']('%s/users/me.json',_0x2542e8[_0x3fe9('0xe')])})[_0x3fe9('0x19')](function(_0x12cfb3){logger[_0x3fe9('0xc')](_0x3fe9('0x1d'));return _0x12cfb3[_0x3fe9('0x1e')];});}});}else{logger[_0x3fe9('0xc')](_0x3fe9('0x1c'));return request({'uri':util[_0x3fe9('0xd')](_0x3fe9('0x1f'),_0x2542e8[_0x3fe9('0xe')])})[_0x3fe9('0x19')](function(_0x2ed1a1){logger['info'](_0x3fe9('0x1d'));return _0x2ed1a1[_0x3fe9('0x1e')];});}}function getEndUser(_0xfed9ea,_0x1b8855,_0x2bd11b){logger[_0x3fe9('0xc')](_0x3fe9('0x20'),_0x2bd11b);return request({'uri':util['format'](_0x3fe9('0x21'),_0xfed9ea[_0x3fe9('0xe')]),'qs':{'query':util[_0x3fe9('0xd')](_0x3fe9('0x22'),_0x2bd11b)}})['then'](function(_0x406c7e){var _0x587b33;if(_0x406c7e['results'][_0x3fe9('0x23')]){_0x406c7e[_0x3fe9('0x24')]=_[_0x3fe9('0x25')](_0x406c7e[_0x3fe9('0x24')],{'suspended':![],'role':_0x3fe9('0x26')});if(_0x406c7e[_0x3fe9('0x24')]['length']){_0x587b33=_[_0x3fe9('0x27')](_0x406c7e[_0x3fe9('0x24')]);}}if(_0x587b33){logger['info'](_0x3fe9('0x28'));return _0x587b33;}else{logger['info'](_0x3fe9('0x29'));return request({'uri':util[_0x3fe9('0xd')]('%s/users.json',_0xfed9ea[_0x3fe9('0xe')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x3fe9('0xd')](_0x3fe9('0x2a'),_0x1b8855||_0x2bd11b),'phone':_0x2bd11b}}})[_0x3fe9('0x19')](function(_0x5c1c01){logger[_0x3fe9('0xc')](_0x3fe9('0x2b'));return _0x5c1c01[_0x3fe9('0x1e')];});}});}function getAuth(_0x114fbf){var _0x495331;if(_0x114fbf[_0x3fe9('0x2c')]===_0x3fe9('0x2d')){_0x495331=util[_0x3fe9('0xd')](_0x3fe9('0x2e'),_0x114fbf['username'],_0x114fbf[_0x3fe9('0x2d')]);}else if(_0x114fbf['authType']===_0x3fe9('0x2f')){_0x495331=util[_0x3fe9('0xd')](_0x3fe9('0x30'),_0x114fbf[_0x3fe9('0x31')],_0x114fbf[_0x3fe9('0x2f')]);}return util['format'](_0x3fe9('0x32'),new Buffer(_0x495331)['toString'](_0x3fe9('0x33')));}function request(_0x3b9548){logger[_0x3fe9('0x34')](_0x3fe9('0x35'),JSON['stringify'](_0x3b9548));return rp(_['defaults'](_0x3b9548,{'method':_0x3fe9('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x3bbf50,_0x1b1d45){var _0x237b78=[];if(_0x3bbf50&&_0x3bbf50[_0x3fe9('0x23')]>0x0){_0x237b78=_[_0x3fe9('0x37')](_0x3bbf50,_0x1b1d45);}return _0x237b78;}function getCustomFields(_0x50ccac,_0xd0716c){var _0x47368b=[];var _0x33d9c8={'custom_fields':[]};if(_0x50ccac[_0x3fe9('0x23')]>0x0){_[_0x3fe9('0x38')](_0x50ccac,function(_0x322115){if(_['includes']([_0x3fe9('0x39'),_0x3fe9('0x3a')],_0x322115['type'])&&_0x322115[_0x3fe9('0x3b')]&&!_0x322115[_0x3fe9('0x3c')]){_0x33d9c8[_0x322115[_0x3fe9('0x3b')]['toLowerCase']()]=_0x322115[_0x3fe9('0x3d')][_0x3fe9('0x3e')]();}else if(_['includes']([_0x3fe9('0x39'),_0x3fe9('0x3a')],_0x322115['type'])&&_0x322115[_0x3fe9('0x3f')]&&_0x322115[_0x3fe9('0x3c')]){_0x33d9c8[_0x3fe9('0x40')][_0x3fe9('0x41')]({'id':_0x322115[_0x3fe9('0x3f')],'value':_0x322115[_0x3fe9('0x3d')]['toString']()});}else if(_0x322115[_0x3fe9('0x42')]===_0x3fe9('0x43')&&_0x322115[_0x3fe9('0x44')]&&_0x322115['idField']&&_0x322115['customField']){_0xd0716c[_0x322115[_0x3fe9('0x44')]]&&_0x33d9c8[_0x3fe9('0x40')][_0x3fe9('0x41')]({'id':_0x322115[_0x3fe9('0x3f')],'value':_0xd0716c[_0x322115[_0x3fe9('0x44')]][_0x3fe9('0x3e')]()});}else if(_0x322115['type']===_0x3fe9('0x45')&&_0x322115['Variable']&&_0x322115[_0x3fe9('0x46')]['name']&&_0x322115[_0x3fe9('0x3f')]&&_0x322115[_0x3fe9('0x3c')]){_0xd0716c[_0x322115['Variable'][_0x3fe9('0x12')][_0x3fe9('0x47')]()]&&_0x33d9c8[_0x3fe9('0x40')][_0x3fe9('0x41')]({'id':_0x322115[_0x3fe9('0x3f')],'value':_0xd0716c[_0x322115[_0x3fe9('0x46')][_0x3fe9('0x12')]['toLowerCase']()][_0x3fe9('0x3e')]()});}});}return _0x33d9c8;}exports[_0x3fe9('0x48')]=function(_0x57ab23,_0x4c24c6,_0x412bcd,_0x2fd3e1,_0x3cd0d7,_0x156b4c){var _0x11cb75,_0x14d10d;_0x156b4c[_0x3fe9('0xe')]=intUtil[_0x3fe9('0x49')](_0x156b4c[_0x3fe9('0xe')]);_0x156b4c[_0x3fe9('0x4a')]=intUtil['stripTrailingSlash'](_0x156b4c[_0x3fe9('0x4a')]);if(_0x3cd0d7&&_0x3cd0d7['monitor_format']){logger[_0x3fe9('0xc')](_0x3fe9('0x4b'),_0x3fe9('0x4c'));_0x4c24c6['recordingURL']=util[_0x3fe9('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156b4c[_0x3fe9('0x4a')],_0x4c24c6[_0x3fe9('0x4d')],md5(_0x4c24c6[_0x3fe9('0x4d')]));}else{_0x4c24c6['recordingURL']='';}headers[_0x3fe9('0x4e')]=getAuth(_0x156b4c);return getUser(_0x156b4c,_0x2fd3e1['email'])[_0x3fe9('0x19')](function(_0x32dafe){_0x11cb75=_0x32dafe;logger['info'](_0x3fe9('0x4f'),_0x11cb75['id']);return getEndUser(_0x156b4c,_0x4c24c6['calleridname'],_0x4c24c6[_0x3fe9('0x50')]);})[_0x3fe9('0x19')](function(_0x5adf49){_0x14d10d=_0x5adf49;logger[_0x3fe9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x14d10d['id']);return getTicket(_0x156b4c,_0x11cb75,_0x14d10d,_0x412bcd,_0x4c24c6);})[_0x3fe9('0x19')](function(_0x43c02f){if(_0x43c02f){logger[_0x3fe9('0xc')](_0x3fe9('0x51'),_0x43c02f['id']);switch(_0x156b4c[_0x3fe9('0x42')]){case _0x3fe9('0x52'):logger[_0x3fe9('0xc')](_0x3fe9('0x4b'),_0x3fe9('0x53'));return request({'uri':util[_0x3fe9('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x156b4c[_0x3fe9('0xe')],_0x11cb75['id'],_0x43c02f['id']),'method':_0x3fe9('0xf')});case _0x3fe9('0x54'):logger[_0x3fe9('0xc')](_0x3fe9('0x4b'),_0x3fe9('0x55'));emit(util[_0x3fe9('0xd')](_0x3fe9('0x56'),_0x2fd3e1[_0x3fe9('0x12')]),_0x3fe9('0x57'),{'uri':util[_0x3fe9('0xd')](_0x3fe9('0x58'),_0x156b4c[_0x3fe9('0xe')][_0x3fe9('0x59')](_0x3fe9('0x5a'),''),_0x43c02f['id'])});break;default:logger['error'](_0x3fe9('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x3fe9('0x5b')](function(_0x383be4){logger[_0x3fe9('0x5c')](_0x3fe9('0x5d'),util[_0x3fe9('0x5e')](_0x383be4,{'showHidden':!![],'depth':null}));});};exports[_0x3fe9('0x5f')]=function(_0x4caa29,_0x2d82d7,_0x11152e,_0x4ad53d,_0x4dfd1e,_0x3d657b,_0x1662b5){var _0x1a61d1,_0x14912e;_0x3d657b[_0x3fe9('0xe')]=intUtil[_0x3fe9('0x49')](_0x3d657b['remoteUri']);_0x3d657b[_0x3fe9('0x4a')]=intUtil[_0x3fe9('0x49')](_0x3d657b[_0x3fe9('0x4a')]);if(_0x1662b5&&_0x1662b5[_0x3fe9('0x60')]&&_0x1662b5[_0x3fe9('0x60')]!==_0x3fe9('0x61')){logger[_0x3fe9('0xc')](_0x3fe9('0x62'),_0x3fe9('0x4c'));_0x2d82d7[_0x3fe9('0x63')]=util[_0x3fe9('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d657b[_0x3fe9('0x4a')],_0x2d82d7[_0x3fe9('0x4d')],md5(_0x2d82d7['uniqueid']));}headers[_0x3fe9('0x4e')]=getAuth(_0x3d657b);return getUser(_0x3d657b,_0x4ad53d[_0x3fe9('0x64')])['then'](function(_0x39323b){_0x1a61d1=_0x39323b;logger['info']('The\x20User\x20ID\x20is:',_0x1a61d1['id']);return getEndUser(_0x3d657b,_0x2d82d7[_0x3fe9('0x65')],_0x2d82d7[_0x3fe9('0x66')]);})['then'](function(_0x438569){_0x14912e=_0x438569;logger['info'](_0x3fe9('0x67'),_0x14912e['id']);return getTicket(_0x3d657b,_0x1a61d1,_0x14912e,_0x11152e,_0x2d82d7);})[_0x3fe9('0x19')](function(_0x2e89f4){if(_0x2e89f4){logger[_0x3fe9('0xc')](_0x3fe9('0x51'),_0x2e89f4['id']);switch(_0x3d657b[_0x3fe9('0x42')]){case _0x3fe9('0x52'):logger['info'](_0x3fe9('0x62'),_0x3fe9('0x53'));return request({'uri':util[_0x3fe9('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3d657b['remoteUri'],_0x1a61d1['id'],_0x2e89f4['id']),'method':_0x3fe9('0xf')});case _0x3fe9('0x54'):logger[_0x3fe9('0xc')](_0x3fe9('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3fe9('0xd')](_0x3fe9('0x56'),_0x4ad53d[_0x3fe9('0x12')]),'trigger:browser:url',{'uri':util[_0x3fe9('0xd')](_0x3fe9('0x58'),_0x3d657b[_0x3fe9('0xe')][_0x3fe9('0x59')](_0x3fe9('0x5a'),''),_0x2e89f4['id'])});break;default:logger[_0x3fe9('0x5c')](_0x3fe9('0x62'),_0x3fe9('0x68'));}}})[_0x3fe9('0x5b')](function(_0x3c4644){logger[_0x3fe9('0x5c')](_0x3fe9('0x69'),util[_0x3fe9('0x5e')](_0x3c4644,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x53bb97,_0x4f7daa,_0x3b8b7f,_0x5b6627,_0x252d37,_0x572185){var _0x208299,_0x4bfb09;_0x572185[_0x3fe9('0xe')]=intUtil[_0x3fe9('0x49')](_0x572185[_0x3fe9('0xe')]);_0x572185[_0x3fe9('0x4a')]=intUtil[_0x3fe9('0x49')](_0x572185[_0x3fe9('0x4a')]);if(_0x252d37&&_0x252d37[_0x3fe9('0x6a')]){logger[_0x3fe9('0xc')]('['+_0x4f7daa[_0x3fe9('0x6b')][_0x3fe9('0x6c')]()+']',_0x3fe9('0x4c'));_0x4f7daa[_0x3fe9('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x572185[_0x3fe9('0x4a')],_0x4f7daa[_0x3fe9('0x4d')],md5(_0x4f7daa[_0x3fe9('0x4d')]));}else{_0x4f7daa[_0x3fe9('0x63')]='';}headers['Authorization']=getAuth(_0x572185);return getUser(_0x572185)[_0x3fe9('0x19')](function(_0x34f4cd){_0x208299=_0x34f4cd;logger[_0x3fe9('0xc')]('The\x20User\x20ID\x20is:',_0x208299['id']);return getEndUser(_0x572185,_0x4f7daa[_0x3fe9('0x6d')],_0x4f7daa[_0x3fe9('0x50')]);})[_0x3fe9('0x19')](function(_0x108cb0){_0x4bfb09=_0x108cb0;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4bfb09['id']);return getTicket(_0x572185,_0x208299,_0x4bfb09,_0x3b8b7f,_0x4f7daa);})[_0x3fe9('0x19')](function(_0x7f693e){if(_0x7f693e){logger[_0x3fe9('0xc')](_0x3fe9('0x51'),_0x7f693e['id']);}})[_0x3fe9('0x5b')](function(_0x438603){logger[_0x3fe9('0x5c')]('['+_0x4f7daa[_0x3fe9('0x6b')][_0x3fe9('0x6c')]()+']'+_0x3fe9('0x6e'),util[_0x3fe9('0x5e')](_0x438603,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe646=['ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','string','type','customField','nameField','toLowerCase','content','includes','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','email','destcalleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[OUTBOUND]','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','zendesk','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','then','Ticket\x20created!'];(function(_0x5db12f,_0x3bbe8d){var _0x3490be=function(_0x12cd70){while(--_0x12cd70){_0x5db12f['push'](_0x5db12f['shift']());}};_0x3490be(++_0x3bbe8d);}(_0xe646,0x134));var _0x6e64=function(_0x377b21,_0x18046e){_0x377b21=_0x377b21-0x0;var _0x147170=_0xe646[_0x377b21];return _0x147170;};'use strict';var _=require(_0x6e64('0x0'));var rp=require(_0x6e64('0x1'));var md5=require(_0x6e64('0x2'));var util=require('util');var Redis=require(_0x6e64('0x3'));var intUtil=require(_0x6e64('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x6e64('0x5'));config['redis']=_['defaults'](config[_0x6e64('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6e64('0x7'))(new Redis(config[_0x6e64('0x6')]));function emit(_0x29cd3c,_0x1e9eed,_0x319a14){io['to'](_0x29cd3c)[_0x6e64('0x8')](_0x1e9eed,_0x319a14);}var headers={'Content-Type':_0x6e64('0x9'),'Accept':_0x6e64('0x9')};function getTicket(_0x33207a,_0x39aa5f,_0x320149,_0x23c900,_0x4bca00){logger[_0x6e64('0xa')](_0x6e64('0xb'));return request({'uri':util[_0x6e64('0xc')](_0x6e64('0xd'),_0x33207a[_0x6e64('0xe')]),'method':_0x6e64('0xf'),'body':{'ticket':_[_0x6e64('0x10')]({'requester_id':_0x320149['id'],'submitter_id':_0x39aa5f?_0x39aa5f['id']:undefined,'assignee_id':_0x39aa5f?_0x39aa5f['id']:undefined,'tags':getTags(_0x23c900['Tags'],_0x6e64('0x11')),'subject':intUtil[_0x6e64('0x12')](_0x23c900['Subjects'],_0x4bca00,'\x20'),'description':intUtil[_0x6e64('0x12')](_0x23c900['Descriptions'],_0x4bca00,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x23c900[_0x6e64('0x13')],_0x4bca00,'\x0a')}},getCustomFields(_0x23c900['Fields'],_0x4bca00))}})[_0x6e64('0x14')](function(_0x240a55){logger['info'](_0x6e64('0x15'));return _0x240a55[_0x6e64('0x16')];});}function getUser(_0x509bbd,_0x22a063){if(intUtil[_0x6e64('0x17')](_0x22a063)){logger[_0x6e64('0xa')](_0x6e64('0x18'),_0x22a063);return request({'uri':util[_0x6e64('0xc')](_0x6e64('0x19'),_0x509bbd['remoteUri']),'qs':{'query':util[_0x6e64('0xc')]('type:user\x20role:agent\x20email:%s',_0x22a063)}})['then'](function(_0x9d3e4){if(_0x9d3e4[_0x6e64('0x1a')]){logger[_0x6e64('0xa')](_0x6e64('0x1b'));return _[_0x6e64('0x1c')](_0x9d3e4[_0x6e64('0x1d')],{'email':_0x22a063,'role':_0x6e64('0x1e')});}else{logger[_0x6e64('0xa')](_0x6e64('0x1f'));return request({'uri':util[_0x6e64('0xc')](_0x6e64('0x20'),_0x509bbd[_0x6e64('0xe')])})[_0x6e64('0x14')](function(_0x37f4b5){logger[_0x6e64('0xa')](_0x6e64('0x21'));return _0x37f4b5[_0x6e64('0x22')];});}});}else{logger[_0x6e64('0xa')](_0x6e64('0x1f'));return request({'uri':util[_0x6e64('0xc')](_0x6e64('0x20'),_0x509bbd[_0x6e64('0xe')])})[_0x6e64('0x14')](function(_0x303bfa){logger[_0x6e64('0xa')]('Admin\x20account\x20selected.');return _0x303bfa[_0x6e64('0x22')];});}}function getEndUser(_0x1a742d,_0x396a16,_0x3526dc){logger[_0x6e64('0xa')](_0x6e64('0x23'),_0x3526dc);return request({'uri':util[_0x6e64('0xc')](_0x6e64('0x19'),_0x1a742d[_0x6e64('0xe')]),'qs':{'query':util[_0x6e64('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x3526dc)}})[_0x6e64('0x14')](function(_0x16fc2a){var _0x115fc5;if(_0x16fc2a['results'][_0x6e64('0x24')]){_0x16fc2a[_0x6e64('0x1d')]=_[_0x6e64('0x25')](_0x16fc2a[_0x6e64('0x1d')],{'suspended':![],'role':_0x6e64('0x26')});if(_0x16fc2a[_0x6e64('0x1d')][_0x6e64('0x24')]){_0x115fc5=_[_0x6e64('0x27')](_0x16fc2a[_0x6e64('0x1d')]);}}if(_0x115fc5){logger[_0x6e64('0xa')](_0x6e64('0x28'));return _0x115fc5;}else{logger[_0x6e64('0xa')](_0x6e64('0x29'));return request({'uri':util[_0x6e64('0xc')](_0x6e64('0x2a'),_0x1a742d[_0x6e64('0xe')]),'method':_0x6e64('0xf'),'body':{'user':{'role':_0x6e64('0x26'),'name':util[_0x6e64('0xc')]('Caller\x20-\x20%s',_0x396a16||_0x3526dc),'phone':_0x3526dc}}})[_0x6e64('0x14')](function(_0x2fd6e3){logger[_0x6e64('0xa')]('Enduser\x20created.');return _0x2fd6e3[_0x6e64('0x22')];});}});}function getAuth(_0x307c61){var _0x179f4b;if(_0x307c61[_0x6e64('0x2b')]===_0x6e64('0x2c')){_0x179f4b=util[_0x6e64('0xc')](_0x6e64('0x2d'),_0x307c61[_0x6e64('0x2e')],_0x307c61[_0x6e64('0x2c')]);}else if(_0x307c61[_0x6e64('0x2b')]===_0x6e64('0x2f')){_0x179f4b=util[_0x6e64('0xc')](_0x6e64('0x30'),_0x307c61['username'],_0x307c61[_0x6e64('0x2f')]);}return util[_0x6e64('0xc')](_0x6e64('0x31'),new Buffer(_0x179f4b)[_0x6e64('0x32')]('base64'));}function request(_0x4cd7e3){logger[_0x6e64('0x33')](_0x6e64('0x34'),JSON['stringify'](_0x4cd7e3));return rp(_['defaults'](_0x4cd7e3,{'method':_0x6e64('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x17d3fa,_0x3d5233){var _0x49f619=[];if(_0x17d3fa&&_0x17d3fa[_0x6e64('0x24')]>0x0){_0x49f619=_[_0x6e64('0x36')](_0x17d3fa,_0x3d5233);}return _0x49f619;}function getCustomFields(_0x369220,_0x338654){var _0x3ceddb=[];var _0x43245a={'custom_fields':[]};if(_0x369220[_0x6e64('0x24')]>0x0){_[_0x6e64('0x37')](_0x369220,function(_0x4ee5c0){if(_['includes']([_0x6e64('0x38'),'picklist'],_0x4ee5c0[_0x6e64('0x39')])&&_0x4ee5c0['nameField']&&!_0x4ee5c0[_0x6e64('0x3a')]){_0x43245a[_0x4ee5c0[_0x6e64('0x3b')][_0x6e64('0x3c')]()]=_0x4ee5c0[_0x6e64('0x3d')][_0x6e64('0x32')]();}else if(_[_0x6e64('0x3e')]([_0x6e64('0x38'),_0x6e64('0x3f')],_0x4ee5c0['type'])&&_0x4ee5c0[_0x6e64('0x40')]&&_0x4ee5c0[_0x6e64('0x3a')]){_0x43245a[_0x6e64('0x41')][_0x6e64('0x42')]({'id':_0x4ee5c0[_0x6e64('0x40')],'value':_0x4ee5c0[_0x6e64('0x3d')]['toString']()});}else if(_0x4ee5c0[_0x6e64('0x39')]===_0x6e64('0x43')&&_0x4ee5c0[_0x6e64('0x44')]&&_0x4ee5c0[_0x6e64('0x40')]&&_0x4ee5c0[_0x6e64('0x3a')]){_0x338654[_0x4ee5c0['variableName']]&&_0x43245a[_0x6e64('0x41')][_0x6e64('0x42')]({'id':_0x4ee5c0['idField'],'value':_0x338654[_0x4ee5c0[_0x6e64('0x44')]][_0x6e64('0x32')]()});}else if(_0x4ee5c0[_0x6e64('0x39')]===_0x6e64('0x45')&&_0x4ee5c0[_0x6e64('0x46')]&&_0x4ee5c0[_0x6e64('0x46')][_0x6e64('0x11')]&&_0x4ee5c0['idField']&&_0x4ee5c0[_0x6e64('0x3a')]){_0x338654[_0x4ee5c0['Variable'][_0x6e64('0x11')][_0x6e64('0x3c')]()]&&_0x43245a[_0x6e64('0x41')][_0x6e64('0x42')]({'id':_0x4ee5c0[_0x6e64('0x40')],'value':_0x338654[_0x4ee5c0[_0x6e64('0x46')][_0x6e64('0x11')]['toLowerCase']()][_0x6e64('0x32')]()});}});}return _0x43245a;}exports['queue']=function(_0x11e38a,_0x481f7f,_0x3f6347,_0x426d9a,_0x1f1b30,_0xd44aa7){var _0x32a936,_0x268321;_0xd44aa7[_0x6e64('0xe')]=intUtil[_0x6e64('0x47')](_0xd44aa7[_0x6e64('0xe')]);_0xd44aa7[_0x6e64('0x48')]=intUtil[_0x6e64('0x47')](_0xd44aa7['serverUrl']);if(_0x1f1b30&&_0x1f1b30['monitor_format']){logger[_0x6e64('0xa')]('[QUEUE]',_0x6e64('0x49'));_0x481f7f[_0x6e64('0x4a')]=util[_0x6e64('0xc')](_0x6e64('0x4b'),_0xd44aa7[_0x6e64('0x48')],_0x481f7f[_0x6e64('0x4c')],md5(_0x481f7f[_0x6e64('0x4c')]));}else{_0x481f7f[_0x6e64('0x4a')]='';}headers[_0x6e64('0x4d')]=getAuth(_0xd44aa7);return getUser(_0xd44aa7,_0x426d9a['email'])['then'](function(_0x5a2667){_0x32a936=_0x5a2667;logger[_0x6e64('0xa')](_0x6e64('0x4e'),_0x32a936['id']);return getEndUser(_0xd44aa7,_0x481f7f[_0x6e64('0x4f')],_0x481f7f[_0x6e64('0x50')]);})[_0x6e64('0x14')](function(_0x25c614){_0x268321=_0x25c614;logger['info']('The\x20Enduser\x20ID\x20is:',_0x268321['id']);return getTicket(_0xd44aa7,_0x32a936,_0x268321,_0x3f6347,_0x481f7f);})[_0x6e64('0x14')](function(_0x2f2f7b){if(_0x2f2f7b){logger[_0x6e64('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2f2f7b['id']);switch(_0xd44aa7[_0x6e64('0x39')]){case'integrationTab':logger['info'](_0x6e64('0x51'),_0x6e64('0x52'));return request({'uri':util['format'](_0x6e64('0x53'),_0xd44aa7[_0x6e64('0xe')],_0x32a936['id'],_0x2f2f7b['id']),'method':'POST'});case _0x6e64('0x54'):logger[_0x6e64('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6e64('0xc')](_0x6e64('0x55'),_0x426d9a[_0x6e64('0x11')]),_0x6e64('0x56'),{'uri':util[_0x6e64('0xc')](_0x6e64('0x57'),_0xd44aa7[_0x6e64('0xe')][_0x6e64('0x58')]('/api/v2',''),_0x2f2f7b['id'])});break;default:logger[_0x6e64('0x59')](_0x6e64('0x51'),_0x6e64('0x5a'));}}})[_0x6e64('0x5b')](function(_0x33bada){logger[_0x6e64('0x59')](_0x6e64('0x5c'),util['inspect'](_0x33bada,{'showHidden':!![],'depth':null}));});};exports[_0x6e64('0x5d')]=function(_0x413022,_0x2a84a2,_0x4c63e5,_0x2d1bd4,_0x153ae2,_0x3bf416,_0x50721b){var _0x58b117,_0x550a5f;_0x3bf416[_0x6e64('0xe')]=intUtil[_0x6e64('0x47')](_0x3bf416[_0x6e64('0xe')]);_0x3bf416[_0x6e64('0x48')]=intUtil['stripTrailingSlash'](_0x3bf416[_0x6e64('0x48')]);if(_0x50721b&&_0x50721b[_0x6e64('0x5e')]&&_0x50721b[_0x6e64('0x5e')]!==_0x6e64('0x5f')){logger[_0x6e64('0xa')]('[OUTBOUND]',_0x6e64('0x49'));_0x2a84a2[_0x6e64('0x4a')]=util[_0x6e64('0xc')](_0x6e64('0x4b'),_0x3bf416[_0x6e64('0x48')],_0x2a84a2[_0x6e64('0x4c')],md5(_0x2a84a2['uniqueid']));}headers[_0x6e64('0x4d')]=getAuth(_0x3bf416);return getUser(_0x3bf416,_0x2d1bd4[_0x6e64('0x60')])['then'](function(_0x10b8fb){_0x58b117=_0x10b8fb;logger['info'](_0x6e64('0x4e'),_0x58b117['id']);return getEndUser(_0x3bf416,_0x2a84a2[_0x6e64('0x61')],_0x2a84a2['destcalleridnum']);})[_0x6e64('0x14')](function(_0x2d594d){_0x550a5f=_0x2d594d;logger[_0x6e64('0xa')](_0x6e64('0x62'),_0x550a5f['id']);return getTicket(_0x3bf416,_0x58b117,_0x550a5f,_0x4c63e5,_0x2a84a2);})[_0x6e64('0x14')](function(_0x5c13d1){if(_0x5c13d1){logger[_0x6e64('0xa')](_0x6e64('0x63'),_0x5c13d1['id']);switch(_0x3bf416['type']){case _0x6e64('0x64'):logger[_0x6e64('0xa')](_0x6e64('0x65'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x6e64('0xc')](_0x6e64('0x53'),_0x3bf416[_0x6e64('0xe')],_0x58b117['id'],_0x5c13d1['id']),'method':_0x6e64('0xf')});case _0x6e64('0x54'):logger[_0x6e64('0xa')](_0x6e64('0x65'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x2d1bd4[_0x6e64('0x11')]),_0x6e64('0x56'),{'uri':util[_0x6e64('0xc')](_0x6e64('0x57'),_0x3bf416[_0x6e64('0xe')]['replace'](_0x6e64('0x66'),''),_0x5c13d1['id'])});break;default:logger[_0x6e64('0x59')](_0x6e64('0x65'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6e64('0x5b')](function(_0x310d25){logger['error'](_0x6e64('0x67'),util[_0x6e64('0x68')](_0x310d25,{'showHidden':!![],'depth':null}));});};exports[_0x6e64('0x69')]=function(_0x590301,_0x2cf842,_0x49eeb3,_0x21634d,_0x37560e,_0x23f853){var _0x3a8e51,_0x4447d2;_0x23f853[_0x6e64('0xe')]=intUtil[_0x6e64('0x47')](_0x23f853['remoteUri']);_0x23f853['serverUrl']=intUtil[_0x6e64('0x47')](_0x23f853['serverUrl']);if(_0x37560e&&_0x37560e[_0x6e64('0x6a')]){logger[_0x6e64('0xa')]('['+_0x2cf842[_0x6e64('0x6b')][_0x6e64('0x6c')]()+']',_0x6e64('0x49'));_0x2cf842[_0x6e64('0x4a')]=util[_0x6e64('0xc')](_0x6e64('0x4b'),_0x23f853[_0x6e64('0x48')],_0x2cf842['uniqueid'],md5(_0x2cf842[_0x6e64('0x4c')]));}else{_0x2cf842[_0x6e64('0x4a')]='';}headers[_0x6e64('0x4d')]=getAuth(_0x23f853);return getUser(_0x23f853)['then'](function(_0x4bc600){_0x3a8e51=_0x4bc600;logger[_0x6e64('0xa')](_0x6e64('0x4e'),_0x3a8e51['id']);return getEndUser(_0x23f853,_0x2cf842[_0x6e64('0x4f')],_0x2cf842['calleridnum']);})['then'](function(_0x54e863){_0x4447d2=_0x54e863;logger[_0x6e64('0xa')](_0x6e64('0x62'),_0x4447d2['id']);return getTicket(_0x23f853,_0x3a8e51,_0x4447d2,_0x49eeb3,_0x2cf842);})[_0x6e64('0x14')](function(_0x4c7fae){if(_0x4c7fae){logger[_0x6e64('0xa')]('The\x20Ticket\x20ID\x20is:',_0x4c7fae['id']);}})['catch'](function(_0x4ea2e9){logger[_0x6e64('0x59')]('['+_0x2cf842[_0x6e64('0x6b')][_0x6e64('0x6c')]()+']'+_0x6e64('0x6d'),util[_0x6e64('0x68')](_0x4ea2e9,{'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 b5b6323..b93cdc9 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 _0xf9e4=['talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','connect','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','lastevent','com','toUpperCase','lodash','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','idField','variable','variableName','type','customVariable','Variable','name','toLowerCase','toString','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Owner','administrator','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module'];(function(_0x39d68c,_0x183b1b){var _0xaaf906=function(_0x11ab08){while(--_0x11ab08){_0x39d68c['push'](_0x39d68c['shift']());}};_0xaaf906(++_0x183b1b);}(_0xf9e4,0xd7));var _0x4f9e=function(_0x4becbd,_0x5bcef4){_0x4becbd=_0x4becbd-0x0;var _0x162b02=_0xf9e4[_0x4becbd];return _0x162b02;};'use strict';var _=require(_0x4f9e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x4f9e('0x1'));var intUtil=require(_0x4f9e('0x2'));var moment=require(_0x4f9e('0x3'));var Redis=require(_0x4f9e('0x4'));var BPromise=require(_0x4f9e('0x5'));var config=require(_0x4f9e('0x6'));var logger=require(_0x4f9e('0x7'))(_0x4f9e('0x8'));config[_0x4f9e('0x9')]=_[_0x4f9e('0xa')](config[_0x4f9e('0x9')],{'host':_0x4f9e('0xb'),'port':0x18eb});var io=require(_0x4f9e('0xc'))(new Redis(config['redis']));function emit(_0x3f3ea5,_0x50294a,_0x44d2b7){io['to'](_0x3f3ea5)[_0x4f9e('0xd')](_0x50294a,_0x44d2b7);}function request(_0x39cc7c){logger[_0x4f9e('0xe')]('[HTTP]',JSON[_0x4f9e('0xf')](_0x39cc7c));return rp(_0x39cc7c);}function getCustomFields(_0x2afea3,_0x1eb696){var _0x1c7289={};if(_0x2afea3[_0x4f9e('0x10')]>0x0){_[_0x4f9e('0x11')](_0x2afea3,function(_0x41bc1a){if(_[_0x4f9e('0x12')]([_0x4f9e('0x13'),'picklist'],_0x41bc1a['type'])&&_0x41bc1a[_0x4f9e('0x14')]){_0x1c7289[_0x41bc1a[_0x4f9e('0x14')]]=_0x41bc1a['content']['toString']();}else if(_0x41bc1a['type']===_0x4f9e('0x15')&&_0x41bc1a[_0x4f9e('0x16')]&&_0x41bc1a[_0x4f9e('0x14')]&&_0x1eb696[_0x41bc1a[_0x4f9e('0x16')]]){_0x1c7289[_0x41bc1a['idField']]=_0x1eb696[_0x41bc1a['variableName']]['toString']();}else if(_0x41bc1a[_0x4f9e('0x17')]===_0x4f9e('0x18')&&_0x41bc1a[_0x4f9e('0x19')]&&_0x41bc1a[_0x4f9e('0x19')]['name']&&_0x41bc1a[_0x4f9e('0x14')]&&_0x1eb696[_0x41bc1a['Variable'][_0x4f9e('0x1a')][_0x4f9e('0x1b')]()]){_0x1c7289[_0x41bc1a[_0x4f9e('0x14')]]=_0x1eb696[_0x41bc1a[_0x4f9e('0x19')][_0x4f9e('0x1a')][_0x4f9e('0x1b')]()][_0x4f9e('0x1c')]();}});}return _0x1c7289;}function getName(_0x359f42){if(_0x359f42[_0x4f9e('0x1d')]('\x20')>0x0){var _0x368fb5=_0x359f42[_0x4f9e('0x1e')](/ (.+)/);if(_0x368fb5[0x1]){return _0x368fb5;}}return[_0x359f42,_0x359f42];}var accountsTokens={};function getAccessToken(_0x170460){return new Promise(function(_0x51dbdc,_0x471899){if(!_[_0x4f9e('0x1f')](accountsTokens[_0x170460['id']])&&!_[_0x4f9e('0x1f')](accountsTokens[_0x170460['id']][_0x4f9e('0x20')])){if(moment()[_0x4f9e('0x21')](accountsTokens[_0x170460['id']][_0x4f9e('0x22')])){_0x51dbdc(accountsTokens[_0x170460['id']][_0x4f9e('0x20')]);}}var _0x259a4e;switch(_0x170460[_0x4f9e('0x23')]){case'US':_0x259a4e=_0x4f9e('0x24');break;case'AU':_0x259a4e=_0x4f9e('0x25');break;case'EU':_0x259a4e='https://accounts.zoho.eu';break;case'IN':_0x259a4e=_0x4f9e('0x26');break;case'CN':_0x259a4e=_0x4f9e('0x27');break;default:_0x259a4e='https://accounts.zoho.eu';break;}var _0x339a67={'method':'POST','uri':_0x259a4e+_0x4f9e('0x28'),'qs':{'refresh_token':_0x170460[_0x4f9e('0x29')],'client_id':_0x170460[_0x4f9e('0x2a')],'client_secret':_0x170460[_0x4f9e('0x2b')],'grant_type':_0x4f9e('0x2c')},'json':!![]};return rp(_0x339a67)[_0x4f9e('0x2d')](function(_0x191221){accountsTokens[_0x170460['id']]={'access_token':_0x191221[_0x4f9e('0x20')],'expires_in':moment()[_0x4f9e('0x2e')](_0x191221[_0x4f9e('0x22')],'seconds')};_0x51dbdc(_0x191221['access_token']);})[_0x4f9e('0x2f')](function(_0x1f686a){logger[_0x4f9e('0x30')]('Failing\x20creating\x20the\x20access_token',_0x1f686a[_0x4f9e('0x31')]);_0x471899(_0x1f686a);});});}function getUser(_0x16a780,_0x42bfc1,_0x2ff87e,_0x1d28db){logger[_0x4f9e('0x32')](_0x4f9e('0x33'));return request({'method':_0x4f9e('0x34'),'uri':util[_0x4f9e('0x35')](_0x4f9e('0x36'),_0x42bfc1),'qs':{'type':_0x4f9e('0x37')},'headers':{'Authorization':_0x4f9e('0x38')+_0x16a780},'json':!![]})[_0x4f9e('0x2d')](function(_0x331e4c){if(_0x331e4c[_0x4f9e('0x39')]){var _0x53e74d=-0x1;if(_[_0x4f9e('0x3a')](_0x331e4c[_0x4f9e('0x39')])){if(!_['isNil'](_0x1d28db)){_0x53e74d=_[_0x4f9e('0x3b')](_0x331e4c[_0x4f9e('0x39')],function(_0x522443){return _0x522443[_0x4f9e('0x3c')]===_0x1d28db;});}if(_0x53e74d>=0x0){logger[_0x4f9e('0x32')](_0x4f9e('0x3d'));}else{logger[_0x4f9e('0x32')](_0x4f9e('0x3e'));_0x53e74d=_['findIndex'](_0x331e4c[_0x4f9e('0x39')],function(_0x308501){return _0x308501[_0x4f9e('0x3f')][_0x4f9e('0x1a')]===_0x4f9e('0x40');});}return _0x331e4c['users'][_0x53e74d];}else{if(_0x331e4c[_0x4f9e('0x41')][_0x4f9e('0x3f')][_0x4f9e('0x1a')]===_0x4f9e('0x40')){logger['info'](_0x4f9e('0x3e'));user=_0x331e4c[_0x4f9e('0x41')];return user;}else{logger[_0x4f9e('0x30')]('The\x20failing\x20result\x20is',JSON[_0x4f9e('0xf')](_0x331e4c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4f9e('0xf')](_0x331e4c));}}}else{logger['error'](_0x4f9e('0x42'),JSON[_0x4f9e('0xf')](_0x331e4c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x331e4c));}})['catch'](function(_0xa73146){console['error'](_0xa73146);});}function getZohoUser(_0x5ee6ee,_0x3cfcb6){return new BPromise(function(_0x4ffb4d,_0x267594){request(_0x5ee6ee)[_0x4f9e('0x2d')](function(_0x2d168d){var _0x1b29b3=null;if(_0x2d168d){_0x1b29b3=_0x2d168d[_0x4f9e('0x43')][0x0];_0x1b29b3[_0x4f9e('0x44')]=_0x3cfcb6;}_0x4ffb4d(_0x1b29b3);})[_0x4f9e('0x2f')](function(_0x579e09){_0x267594(_0x579e09);});});}function createEndUser(_0x41c6d7,_0x5c647c,_0x4d749e,_0x157cd1,_0x5be010,_0x21e59c){var _0x4d749e=getName(_0x4d749e);return request({'method':_0x4f9e('0x45'),'uri':_0x4f9e('0x46')+_0x5c647c+_0x4f9e('0x47')+_[_0x4f9e('0x48')](_0x21e59c[_0x4f9e('0x49')])+'s','body':{'data':[{'Last_Name':_0x4d749e[0x1],'First_Name':_0x4d749e[0x0],'Phone':_0x157cd1,'Owner':{'name':!_['isNil'](_0x5be010[_0x4f9e('0x4a')][_0x4f9e('0x1a')])?_0x5be010[_0x4f9e('0x4a')][_0x4f9e('0x1a')]:!_[_0x4f9e('0x1f')](_0x5be010['first_name'])?_0x5be010[_0x4f9e('0x4b')]+'\x20'+_0x5be010['last_name']:_0x5be010[_0x4f9e('0x4c')],'id':_0x5be010['id']}}]},'headers':{'Authorization':_0x4f9e('0x38')+_0x41c6d7},'json':!![]})['then'](function(_0x1f5e78){if(_0x1f5e78&&_0x1f5e78[_0x4f9e('0x43')][0x0]['code']===_0x4f9e('0x4d')){var _0x29abac=_0x1f5e78[_0x4f9e('0x43')][0x0][_0x4f9e('0x4e')];_0x29abac[_0x4f9e('0x44')]=_[_0x4f9e('0x48')](_0x21e59c[_0x4f9e('0x49')])+'s';return _0x29abac;}logger[_0x4f9e('0x30')](_0x4f9e('0x42'),JSON[_0x4f9e('0xf')](data));throw new Error(_0x4f9e('0x4f')+JSON['stringify'](data));})[_0x4f9e('0x2f')](function(_0x46070b){console[_0x4f9e('0x50')]('CREATE\x20ERROR',_0x46070b);});}function getEndUser(_0x791246,_0x30b2fe,_0x135a6b,_0x5b1bba,_0x587585,_0x495abf,_0x5b86ff){var _0x15047d={'method':_0x4f9e('0x34'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x791246},'json':!![]};switch(_0x5b86ff[_0x4f9e('0x51')]){case _0x4f9e('0x52'):_0x15047d['uri']=_0x4f9e('0x46')+_0x30b2fe+_0x4f9e('0x53')+_0x587585+'))';return getZohoUser(_0x15047d,'Contacts')[_0x4f9e('0x2d')](function(_0x4a1f47){if(_0x4a1f47)return _0x4a1f47;_0x15047d[_0x4f9e('0x54')]='https://www.zohoapis.'+_0x30b2fe+_0x4f9e('0x55')+_0x587585+'))';return getZohoUser(_0x15047d,_0x4f9e('0x56'))[_0x4f9e('0x2d')](function(_0xbd0699){if(_0xbd0699)return _0xbd0699;if(_0x5b86ff[_0x4f9e('0x49')]!=_0x4f9e('0x57')){return createEndUser(_0x791246,_0x30b2fe,_0x5b1bba,_0x587585,_0x495abf,_0x5b86ff);}else{return{};}});});break;case _0x4f9e('0x58'):_0x15047d[_0x4f9e('0x54')]='https://www.zohoapis.'+_0x30b2fe+_0x4f9e('0x53')+_0x587585+'))';return getZohoUser(_0x15047d,_0x4f9e('0x59'))[_0x4f9e('0x2d')](function(_0x2db716){if(_0x2db716)return _0x2db716;if(_0x5b86ff[_0x4f9e('0x49')]!=_0x4f9e('0x57')){return createEndUser(_0x791246,_0x30b2fe,_0x5b1bba,_0x587585,_0x495abf,_0x5b86ff);}else{return{};}});break;case _0x4f9e('0x5a'):_0x15047d[_0x4f9e('0x54')]=_0x4f9e('0x46')+_0x30b2fe+_0x4f9e('0x55')+_0x587585+'))';return getZohoUser(_0x15047d,_0x4f9e('0x56'))[_0x4f9e('0x2d')](function(_0x28c9e6){if(_0x28c9e6)return _0x28c9e6;if(_0x5b86ff[_0x4f9e('0x49')]!='nothing'){return createEndUser(_0x791246,_0x30b2fe,_0x5b1bba,_0x587585,_0x495abf,_0x5b86ff);}else{return{};}});break;}}function getCall(_0x246917,_0x1b7c92,_0x412ad9,_0x289c1c,_0x4019cb,_0x4f2976,_0x3b270b,_0x4749c4){logger[_0x4f9e('0x32')]('Creating\x20new\x20call...');var _0x576461={};_0x576461[_0x4f9e('0x5b')]={'name':!_[_0x4f9e('0x1f')](_0x289c1c[_0x4f9e('0x4a')]['name'])&&!_[_0x4f9e('0x1f')](_0x289c1c['profile']['name'])&&_0x289c1c['profile']['name']===_0x4f9e('0x5c')?_0x289c1c[_0x4f9e('0x4a')][_0x4f9e('0x1a')]:!_[_0x4f9e('0x1f')](_0x289c1c[_0x4f9e('0x4b')])?_0x289c1c['first_name']+'\x20'+_0x289c1c[_0x4f9e('0x4c')]:_0x289c1c[_0x4f9e('0x4c')],'id':_0x289c1c['id']};_0x576461['Subject']=intUtil[_0x4f9e('0x5d')](_0x4f2976[_0x4f9e('0x5e')],_0x3b270b,'\x20');_0x576461['Description']=intUtil['getString'](_0x4f2976[_0x4f9e('0x5f')],_0x3b270b,'\x0a');if(_0x4019cb[_0x4f9e('0x44')]===_0x4f9e('0x59')){_0x576461[_0x4f9e('0x60')]={'name':!_[_0x4f9e('0x1f')](_0x4019cb[_0x4f9e('0x61')])?_0x4019cb['Full_Name']:!_[_0x4f9e('0x1f')](_0x4019cb[_0x4f9e('0x62')])?_0x4019cb['First_Name']+'\x20'+_0x4019cb[_0x4f9e('0x63')]:_0x4019cb[_0x4f9e('0x63')],'id':_0x4019cb['id']};}if(_0x4019cb[_0x4f9e('0x44')]===_0x4f9e('0x56')){_0x576461['What_Id']={'name':!_['isNil'](_0x4019cb[_0x4f9e('0x61')])?_0x4019cb[_0x4f9e('0x61')]:!_[_0x4f9e('0x1f')](_0x4019cb[_0x4f9e('0x62')])?_0x4019cb[_0x4f9e('0x62')]+'\x20'+_0x4019cb['Last_Name']:_0x4019cb[_0x4f9e('0x63')],'id':_0x4019cb['id']};_0x576461[_0x4f9e('0x64')]=_[_0x4f9e('0x48')](_0x4019cb[_0x4f9e('0x44')]);}if(_0x3b270b[_0x4f9e('0x65')]){_0x576461[_0x4f9e('0x66')]=moment[_0x4f9e('0x67')](parseInt(_0x3b270b[_0x4f9e('0x65')])*0x3e8)['format'](_0x4f9e('0x68'));}else if(_0x3b270b['answertime']&&_0x3b270b['endtime']){_0x576461[_0x4f9e('0x66')]=moment[_0x4f9e('0x67')](moment(_0x3b270b[_0x4f9e('0x69')],_0x4f9e('0x6a'))[_0x4f9e('0x6b')](moment(_0x3b270b[_0x4f9e('0x6c')],_0x4f9e('0x6a'))))[_0x4f9e('0x35')](_0x4f9e('0x68'));}switch(_0x3b270b['lastevent']){case _0x4f9e('0x6d'):_0x576461[_0x4f9e('0x6e')]=_0x4f9e('0x6f');break;case _0x4f9e('0x70'):case _0x4f9e('0x71'):_0x576461[_0x4f9e('0x6e')]='Answered';break;case'rejected':_0x576461['Call_Result']=_0x4f9e('0x72');break;case _0x4f9e('0x73'):_0x576461[_0x4f9e('0x6e')]=_0x4f9e('0x74');break;case _0x4f9e('0x75'):_0x576461[_0x4f9e('0x6e')]=_0x4f9e('0x76');default:}_0x576461[_0x4f9e('0x77')]=(_0x4749c4==='outbound'?moment(_0x3b270b[_0x4f9e('0x6c')])[_0x4f9e('0x35')](_0x4f9e('0x6a')):moment(_0x3b270b['agentcalledAt'])[_0x4f9e('0x35')](_0x4f9e('0x6a')))||moment()[_0x4f9e('0x35')](_0x4f9e('0x6a'));_0x576461[_0x4f9e('0x78')]=_0x4749c4||_0x4f9e('0x79');_0x576461=_[_0x4f9e('0x7a')](_0x576461,getCustomFields(_0x4f2976[_0x4f9e('0x7b')],_0x3b270b));return request({'method':_0x4f9e('0x45'),'uri':'https://www.zohoapis.'+_0x1b7c92+_0x4f9e('0x7c'),'headers':{'Authorization':_0x4f9e('0x38')+_0x246917},'body':{'data':[_0x576461]},'json':!![]})['then'](function(_0x47932b){if(_0x47932b&&_0x47932b[_0x4f9e('0x43')][0x0]['code']===_0x4f9e('0x4d')){logger[_0x4f9e('0x32')](_0x4f9e('0x7d'));return{'id':_0x47932b['data'][0x0]['details']['id']};}})[_0x4f9e('0x2f')](function(_0x4fef18){logger[_0x4f9e('0x32')](_0x4f9e('0x7e'),_0x4fef18[_0x4f9e('0x31')]);console['log'](_0x4f9e('0x7e'),_0x4fef18);});}exports[_0x4f9e('0x7f')]=function(_0x241699,_0x9cc4c8,_0x324e06,_0x528e42,_0x55b0df,_0x21d5aa){var _0x5705f0,_0x222699,_0x465513;_0x21d5aa[_0x4f9e('0x80')]=intUtil[_0x4f9e('0x81')](_0x21d5aa[_0x4f9e('0x80')]);_0x21d5aa[_0x4f9e('0x82')]=intUtil[_0x4f9e('0x81')](_0x21d5aa[_0x4f9e('0x82')]);if(_0x55b0df&&_0x55b0df[_0x4f9e('0x83')]){logger[_0x4f9e('0x32')](_0x4f9e('0x84'),_0x4f9e('0x85'));_0x9cc4c8[_0x4f9e('0x86')]=_0x21d5aa['serverUrl']+_0x4f9e('0x87')+_0x9cc4c8[_0x4f9e('0x88')]+_0x4f9e('0x89')+md5(_0x9cc4c8[_0x4f9e('0x88')]);}else{_0x9cc4c8[_0x4f9e('0x86')]='';}var _0x93b7e7=_0x21d5aa[_0x4f9e('0x80')]===_0x4f9e('0x8a')?'eu':'com';return getAccessToken(_0x21d5aa)['then'](function(_0x16f9d9){_0x465513=_0x16f9d9;return getUser(_0x465513,_0x93b7e7,_0x21d5aa,_0x528e42['email']);})[_0x4f9e('0x2d')](function(_0x21e1cb){_0x5705f0=_0x21e1cb;logger['info']('The\x20User\x20ID\x20is:',_0x5705f0['id']);return getEndUser(_0x465513,_0x93b7e7,_0x21d5aa,_0x9cc4c8[_0x4f9e('0x8b')],_0x9cc4c8[_0x4f9e('0x8c')],_0x5705f0,_0x324e06);})['then'](function(_0x447ab5){_0x222699=_0x447ab5;return getCall(_0x465513,_0x93b7e7,_0x21d5aa,_0x5705f0,_0x222699,_0x324e06,_0x9cc4c8,_0x4f9e('0x79'));})[_0x4f9e('0x2d')](function(_0xcb1d9f){if(_0xcb1d9f){logger[_0x4f9e('0x32')](_0x4f9e('0x8d'),_0xcb1d9f['id']);logger['info'](_0x4f9e('0x84'),_0x4f9e('0x8e'));emit(util[_0x4f9e('0x35')](_0x4f9e('0x8f'),_0x528e42['name']),_0x4f9e('0x90'),{'uri':_0x4f9e('0x91')+_0x21d5aa[_0x4f9e('0x80')]+_0x4f9e('0x92')+_0xcb1d9f['id']});}})['catch'](function(_0x5c162d){logger[_0x4f9e('0x30')](_0x4f9e('0x84'),JSON[_0x4f9e('0xf')](_0x5c162d));});};exports[_0x4f9e('0x93')]=function(_0x317256,_0x40e3ee,_0x478b38,_0xe5bd68,_0x25b4ed,_0x4ce843,_0x544ae1){var _0xc0ffd3,_0x560ae9,_0x535016;_0x4ce843[_0x4f9e('0x80')]=intUtil[_0x4f9e('0x81')](_0x4ce843[_0x4f9e('0x80')]);_0x4ce843[_0x4f9e('0x82')]=intUtil[_0x4f9e('0x81')](_0x4ce843[_0x4f9e('0x82')]);if(_0x544ae1&&_0x544ae1[_0x4f9e('0x94')]&&_0x544ae1[_0x4f9e('0x94')]!=='none'){logger['info']('[OUTBOUND]',_0x4f9e('0x85'));_0x40e3ee[_0x4f9e('0x86')]=_0x4ce843[_0x4f9e('0x82')]+_0x4f9e('0x87')+_0x40e3ee[_0x4f9e('0x88')]+_0x4f9e('0x89')+md5(_0x40e3ee[_0x4f9e('0x88')]);}var _0x46d173=_0x4ce843[_0x4f9e('0x80')]===_0x4f9e('0x8a')?'eu':'com';return getAccessToken(_0x4ce843)[_0x4f9e('0x2d')](function(_0x2cf65b){_0x535016=_0x2cf65b;return getUser(_0x535016,_0x46d173,_0x4ce843,_0xe5bd68[_0x4f9e('0x3c')]);})['then'](function(_0xe35ed3){_0xc0ffd3=_0xe35ed3;logger[_0x4f9e('0x32')](_0x4f9e('0x95'),_0xc0ffd3['id']);return getEndUser(_0x535016,_0x46d173,_0x4ce843,_0x40e3ee[_0x4f9e('0x96')],_0x40e3ee[_0x4f9e('0x97')],_0xc0ffd3,_0x478b38);})[_0x4f9e('0x2d')](function(_0x5d4364){_0x560ae9=_0x5d4364;return getCall(_0x535016,_0x46d173,_0x4ce843,_0xc0ffd3,_0x560ae9,_0x478b38,_0x40e3ee,_0x4f9e('0x98'));})[_0x4f9e('0x2d')](function(_0x5697b4){if(_0x5697b4){logger[_0x4f9e('0x32')]('The\x20Call\x20ID\x20is:',_0x5697b4['id']);logger['info']('[OUTBOUND]',_0x4f9e('0x8e'));emit(util[_0x4f9e('0x35')]('user:%s',_0xe5bd68[_0x4f9e('0x1a')]),_0x4f9e('0x90'),{'uri':_0x4f9e('0x91')+_0x4ce843['host']+_0x4f9e('0x92')+_0x5697b4['id']});}})[_0x4f9e('0x2f')](function(_0x67effc){logger['error'](_0x4f9e('0x99'),JSON['stringify'](_0x67effc));});};exports[_0x4f9e('0x9a')]=function(_0x225b2a,_0x867fbc,_0x13840f,_0x48fcad,_0x2b9de9,_0x23f5a2){var _0x2553ba,_0x3a2f10,_0x10cd6b;_0x23f5a2[_0x4f9e('0x80')]=intUtil[_0x4f9e('0x81')](_0x23f5a2[_0x4f9e('0x80')]);_0x23f5a2[_0x4f9e('0x82')]=intUtil[_0x4f9e('0x81')](_0x23f5a2['serverUrl']);if(_0x2b9de9&&_0x2b9de9['monitor_format']){logger['info']('['+_0x867fbc[_0x4f9e('0x9b')]['toUpperCase']()+']',_0x4f9e('0x85'));_0x867fbc[_0x4f9e('0x86')]=_0x23f5a2[_0x4f9e('0x82')]+_0x4f9e('0x87')+_0x867fbc[_0x4f9e('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x867fbc[_0x4f9e('0x88')]);}else{_0x867fbc['recordingURL']='';}var _0x74a596=_0x23f5a2[_0x4f9e('0x80')]===_0x4f9e('0x8a')?'eu':_0x4f9e('0x9c');return getAccessToken(_0x23f5a2)['then'](function(_0x314b54){_0x10cd6b=_0x314b54;return getUser(_0x10cd6b,_0x74a596,_0x23f5a2);})[_0x4f9e('0x2d')](function(_0x45c006){_0x2553ba=_0x45c006;logger['info'](_0x4f9e('0x95'),_0x2553ba['id']);return getEndUser(_0x10cd6b,_0x74a596,_0x23f5a2,_0x867fbc['calleridname'],_0x867fbc[_0x4f9e('0x8c')],_0x2553ba,_0x13840f);})[_0x4f9e('0x2d')](function(_0x5ce6be){_0x3a2f10=_0x5ce6be;return getCall(_0x10cd6b,_0x74a596,_0x23f5a2,_0x2553ba,_0x3a2f10,_0x13840f,_0x867fbc,_0x4f9e('0x79'));})[_0x4f9e('0x2d')](function(_0x4a8a18){if(_0x4a8a18){logger[_0x4f9e('0x32')]('The\x20Call\x20ID\x20is:',_0x4a8a18['id']);}})[_0x4f9e('0x2f')](function(_0x108507){logger[_0x4f9e('0x30')]('['+_0x867fbc[_0x4f9e('0x9b')][_0x4f9e('0x9d')]()+']',JSON[_0x4f9e('0xf')](_0x108507));});}; \ No newline at end of file +var _0xea8d=['add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','SUCCESS','details','startCase','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','https://www.zohoapis.','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','zoho.eu','Outbound','toUpperCase','The\x20User\x20ID\x20is:','calleridname','calleridnum','lodash','request-promise','md5','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','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','refreshToken','clientSecret','refresh_token','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xea8d,0x1ad));var _0xdea8=function(_0x166e8f,_0x348ac1){_0x166e8f=_0x166e8f-0x0;var _0x11bf18=_0xea8d[_0x166e8f];return _0x11bf18;};'use strict';var _=require(_0xdea8('0x0'));var rp=require(_0xdea8('0x1'));var md5=require(_0xdea8('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0xdea8('0x3'));var Redis=require(_0xdea8('0x4'));var BPromise=require(_0xdea8('0x5'));var config=require(_0xdea8('0x6'));var logger=require('../../../../config/logger')(_0xdea8('0x7'));config[_0xdea8('0x8')]=_[_0xdea8('0x9')](config[_0xdea8('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdea8('0x8')]));function emit(_0x967bc8,_0x1d691c,_0x44ab95){io['to'](_0x967bc8)[_0xdea8('0xa')](_0x1d691c,_0x44ab95);}function request(_0x36a91a){logger[_0xdea8('0xb')](_0xdea8('0xc'),JSON[_0xdea8('0xd')](_0x36a91a));return rp(_0x36a91a);}function getCustomFields(_0x5364fc,_0x5b4fbb){var _0x3f10c0={};if(_0x5364fc['length']>0x0){_[_0xdea8('0xe')](_0x5364fc,function(_0x4710f1){if(_[_0xdea8('0xf')]([_0xdea8('0x10'),_0xdea8('0x11')],_0x4710f1[_0xdea8('0x12')])&&_0x4710f1['idField']){_0x3f10c0[_0x4710f1[_0xdea8('0x13')]]=_0x4710f1['content'][_0xdea8('0x14')]();}else if(_0x4710f1[_0xdea8('0x12')]===_0xdea8('0x15')&&_0x4710f1['variableName']&&_0x4710f1[_0xdea8('0x13')]&&_0x5b4fbb[_0x4710f1[_0xdea8('0x16')]]){_0x3f10c0[_0x4710f1[_0xdea8('0x13')]]=_0x5b4fbb[_0x4710f1['variableName']][_0xdea8('0x14')]();}else if(_0x4710f1[_0xdea8('0x12')]==='customVariable'&&_0x4710f1['Variable']&&_0x4710f1[_0xdea8('0x17')][_0xdea8('0x18')]&&_0x4710f1[_0xdea8('0x13')]&&_0x5b4fbb[_0x4710f1[_0xdea8('0x17')]['name'][_0xdea8('0x19')]()]){_0x3f10c0[_0x4710f1[_0xdea8('0x13')]]=_0x5b4fbb[_0x4710f1['Variable'][_0xdea8('0x18')][_0xdea8('0x19')]()][_0xdea8('0x14')]();}});}return _0x3f10c0;}function getName(_0x2db9c0){if(_0x2db9c0['indexOf']('\x20')>0x0){var _0x1f9575=_0x2db9c0[_0xdea8('0x1a')](/ (.+)/);if(_0x1f9575[0x1]){return _0x1f9575;}}return[_0x2db9c0,_0x2db9c0];}var accountsTokens={};function getAccessToken(_0x885229){return new Promise(function(_0x483568,_0x2a9c62){if(!_['isNil'](accountsTokens[_0x885229['id']])&&!_[_0xdea8('0x1b')](accountsTokens[_0x885229['id']][_0xdea8('0x1c')])){if(moment()[_0xdea8('0x1d')](accountsTokens[_0x885229['id']][_0xdea8('0x1e')])){_0x483568(accountsTokens[_0x885229['id']][_0xdea8('0x1c')]);}}var _0x14b732;switch(_0x885229[_0xdea8('0x1f')]){case'US':_0x14b732=_0xdea8('0x20');break;case'AU':_0x14b732=_0xdea8('0x21');break;case'EU':_0x14b732='https://accounts.zoho.eu';break;case'IN':_0x14b732=_0xdea8('0x22');break;case'CN':_0x14b732=_0xdea8('0x23');break;default:_0x14b732=_0xdea8('0x24');break;}var _0x2ddbfb={'method':'POST','uri':_0x14b732+_0xdea8('0x25'),'qs':{'refresh_token':_0x885229[_0xdea8('0x26')],'client_id':_0x885229['clientId'],'client_secret':_0x885229[_0xdea8('0x27')],'grant_type':_0xdea8('0x28')},'json':!![]};return rp(_0x2ddbfb)[_0xdea8('0x29')](function(_0x169867){accountsTokens[_0x885229['id']]={'access_token':_0x169867[_0xdea8('0x1c')],'expires_in':moment()[_0xdea8('0x2a')](_0x169867[_0xdea8('0x1e')],_0xdea8('0x2b'))};_0x483568(_0x169867['access_token']);})[_0xdea8('0x2c')](function(_0x3399c5){logger[_0xdea8('0x2d')](_0xdea8('0x2e'),_0x3399c5[_0xdea8('0x2f')]);_0x2a9c62(_0x3399c5);});});}function getUser(_0x204300,_0x5aeb55,_0x101fae,_0x2855c1){logger[_0xdea8('0x30')](_0xdea8('0x31'));return request({'method':'GET','uri':util[_0xdea8('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x5aeb55),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x204300},'json':!![]})['then'](function(_0x520dfd){if(_0x520dfd[_0xdea8('0x33')]){var _0x428fd2=-0x1;if(_[_0xdea8('0x34')](_0x520dfd[_0xdea8('0x33')])){if(!_[_0xdea8('0x1b')](_0x2855c1)){_0x428fd2=_[_0xdea8('0x35')](_0x520dfd[_0xdea8('0x33')],function(_0x5d6146){return _0x5d6146[_0xdea8('0x36')]===_0x2855c1;});}if(_0x428fd2>=0x0){logger[_0xdea8('0x30')](_0xdea8('0x37'));}else{logger[_0xdea8('0x30')](_0xdea8('0x38'));_0x428fd2=_[_0xdea8('0x35')](_0x520dfd[_0xdea8('0x33')],function(_0x496c81){return _0x496c81[_0xdea8('0x39')][_0xdea8('0x18')]==='Administrator';});}return _0x520dfd[_0xdea8('0x33')][_0x428fd2];}else{if(_0x520dfd[_0xdea8('0x3a')][_0xdea8('0x39')][_0xdea8('0x18')]===_0xdea8('0x3b')){logger['info'](_0xdea8('0x38'));user=_0x520dfd[_0xdea8('0x3a')];return user;}else{logger['error'](_0xdea8('0x3c'),JSON[_0xdea8('0xd')](_0x520dfd));throw new Error(_0xdea8('0x3d')+JSON[_0xdea8('0xd')](_0x520dfd));}}}else{logger[_0xdea8('0x2d')](_0xdea8('0x3c'),JSON['stringify'](_0x520dfd));throw new Error(_0xdea8('0x3d')+JSON[_0xdea8('0xd')](_0x520dfd));}})[_0xdea8('0x2c')](function(_0x5a45e8){console[_0xdea8('0x2d')](_0x5a45e8);});}function getZohoUser(_0x3113b9,_0x2d03fb){return new BPromise(function(_0xab6e41,_0x2a3d0a){request(_0x3113b9)[_0xdea8('0x29')](function(_0x360eb){var _0x428952=null;if(_0x360eb){_0x428952=_0x360eb['data'][0x0];_0x428952[_0xdea8('0x3e')]=_0x2d03fb;}_0xab6e41(_0x428952);})['catch'](function(_0x4fd165){_0x2a3d0a(_0x4fd165);});});}function createEndUser(_0x3c120a,_0x5d6bca,_0x46b7fe,_0x2415a1,_0x577dca,_0x2974aa){var _0x46b7fe=getName(_0x46b7fe);return request({'method':_0xdea8('0x3f'),'uri':'https://www.zohoapis.'+_0x5d6bca+'/crm/v2/'+_['startCase'](_0x2974aa[_0xdea8('0x40')])+'s','body':{'data':[{'Last_Name':_0x46b7fe[0x1],'First_Name':_0x46b7fe[0x0],'Phone':_0x2415a1,'Owner':{'name':!_[_0xdea8('0x1b')](_0x577dca[_0xdea8('0x41')][_0xdea8('0x18')])?_0x577dca['role'][_0xdea8('0x18')]:!_[_0xdea8('0x1b')](_0x577dca[_0xdea8('0x42')])?_0x577dca[_0xdea8('0x42')]+'\x20'+_0x577dca[_0xdea8('0x43')]:_0x577dca[_0xdea8('0x43')],'id':_0x577dca['id']}}]},'headers':{'Authorization':_0xdea8('0x44')+_0x3c120a},'json':!![]})[_0xdea8('0x29')](function(_0x4350e2){if(_0x4350e2&&_0x4350e2[_0xdea8('0x45')][0x0]['code']===_0xdea8('0x46')){var _0x45aeb5=_0x4350e2[_0xdea8('0x45')][0x0][_0xdea8('0x47')];_0x45aeb5[_0xdea8('0x3e')]=_[_0xdea8('0x48')](_0x2974aa[_0xdea8('0x40')])+'s';return _0x45aeb5;}logger['error'](_0xdea8('0x3c'),JSON[_0xdea8('0xd')](data));throw new Error(_0xdea8('0x49')+JSON[_0xdea8('0xd')](data));})[_0xdea8('0x2c')](function(_0x4bcc9d){console[_0xdea8('0x4a')](_0xdea8('0x4b'),_0x4bcc9d);});}function getEndUser(_0x24e6e4,_0x2e9224,_0x556a76,_0x1b4d09,_0x4a4797,_0x564931,_0x9ba91f){var _0x4fc3fa={'method':_0xdea8('0x4c'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x24e6e4},'json':!![]};switch(_0x9ba91f[_0xdea8('0x4d')]){case _0xdea8('0x4e'):_0x4fc3fa['uri']='https://www.zohoapis.'+_0x2e9224+_0xdea8('0x4f')+_0x4a4797+'))';return getZohoUser(_0x4fc3fa,_0xdea8('0x50'))[_0xdea8('0x29')](function(_0x46c5c3){if(_0x46c5c3)return _0x46c5c3;_0x4fc3fa[_0xdea8('0x51')]=_0xdea8('0x52')+_0x2e9224+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4a4797+'))';return getZohoUser(_0x4fc3fa,_0xdea8('0x53'))[_0xdea8('0x29')](function(_0x596b40){if(_0x596b40)return _0x596b40;if(_0x9ba91f[_0xdea8('0x40')]!=_0xdea8('0x54')){return createEndUser(_0x24e6e4,_0x2e9224,_0x1b4d09,_0x4a4797,_0x564931,_0x9ba91f);}else{return{};}});});break;case _0xdea8('0x55'):_0x4fc3fa['uri']=_0xdea8('0x52')+_0x2e9224+_0xdea8('0x4f')+_0x4a4797+'))';return getZohoUser(_0x4fc3fa,_0xdea8('0x50'))['then'](function(_0x15a9c4){if(_0x15a9c4)return _0x15a9c4;if(_0x9ba91f['moduleCreate']!=_0xdea8('0x54')){return createEndUser(_0x24e6e4,_0x2e9224,_0x1b4d09,_0x4a4797,_0x564931,_0x9ba91f);}else{return{};}});break;case _0xdea8('0x56'):_0x4fc3fa[_0xdea8('0x51')]='https://www.zohoapis.'+_0x2e9224+_0xdea8('0x57')+_0x4a4797+'))';return getZohoUser(_0x4fc3fa,'Leads')[_0xdea8('0x29')](function(_0x2fb18b){if(_0x2fb18b)return _0x2fb18b;if(_0x9ba91f[_0xdea8('0x40')]!=_0xdea8('0x54')){return createEndUser(_0x24e6e4,_0x2e9224,_0x1b4d09,_0x4a4797,_0x564931,_0x9ba91f);}else{return{};}});break;}}function getCall(_0x405f01,_0x45350a,_0x365dd0,_0x1a7cb7,_0x7f7391,_0x13ce6c,_0x5079e9,_0x4dcc10){logger[_0xdea8('0x30')](_0xdea8('0x58'));var _0x1a70ad={};_0x1a70ad[_0xdea8('0x59')]={'name':!_[_0xdea8('0x1b')](_0x1a7cb7[_0xdea8('0x41')]['name'])&&!_[_0xdea8('0x1b')](_0x1a7cb7[_0xdea8('0x39')][_0xdea8('0x18')])&&_0x1a7cb7[_0xdea8('0x39')][_0xdea8('0x18')]===_0xdea8('0x5a')?_0x1a7cb7[_0xdea8('0x41')]['name']:!_[_0xdea8('0x1b')](_0x1a7cb7[_0xdea8('0x42')])?_0x1a7cb7[_0xdea8('0x42')]+'\x20'+_0x1a7cb7[_0xdea8('0x43')]:_0x1a7cb7['last_name'],'id':_0x1a7cb7['id']};_0x1a70ad[_0xdea8('0x5b')]=intUtil[_0xdea8('0x5c')](_0x13ce6c['Subjects'],_0x5079e9,'\x20');_0x1a70ad[_0xdea8('0x5d')]=intUtil[_0xdea8('0x5c')](_0x13ce6c[_0xdea8('0x5e')],_0x5079e9,'\x0a');if(_0x7f7391[_0xdea8('0x3e')]===_0xdea8('0x50')){_0x1a70ad[_0xdea8('0x5f')]={'name':!_[_0xdea8('0x1b')](_0x7f7391[_0xdea8('0x60')])?_0x7f7391['Full_Name']:!_[_0xdea8('0x1b')](_0x7f7391[_0xdea8('0x61')])?_0x7f7391[_0xdea8('0x61')]+'\x20'+_0x7f7391[_0xdea8('0x62')]:_0x7f7391[_0xdea8('0x62')],'id':_0x7f7391['id']};}if(_0x7f7391['enduserType']==='Leads'){_0x1a70ad[_0xdea8('0x63')]={'name':!_[_0xdea8('0x1b')](_0x7f7391[_0xdea8('0x60')])?_0x7f7391['Full_Name']:!_[_0xdea8('0x1b')](_0x7f7391[_0xdea8('0x61')])?_0x7f7391[_0xdea8('0x61')]+'\x20'+_0x7f7391['Last_Name']:_0x7f7391[_0xdea8('0x62')],'id':_0x7f7391['id']};_0x1a70ad[_0xdea8('0x64')]=_[_0xdea8('0x48')](_0x7f7391[_0xdea8('0x3e')]);}if(_0x5079e9[_0xdea8('0x65')]){_0x1a70ad[_0xdea8('0x66')]=moment[_0xdea8('0x67')](parseInt(_0x5079e9['talktime'])*0x3e8)['format'](_0xdea8('0x68'));}else if(_0x5079e9[_0xdea8('0x69')]&&_0x5079e9[_0xdea8('0x6a')]){_0x1a70ad[_0xdea8('0x66')]=moment[_0xdea8('0x67')](moment(_0x5079e9[_0xdea8('0x6a')],_0xdea8('0x6b'))[_0xdea8('0x6c')](moment(_0x5079e9[_0xdea8('0x6d')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0xdea8('0x68'));}switch(_0x5079e9[_0xdea8('0x6e')]){case'called':_0x1a70ad[_0xdea8('0x6f')]=_0xdea8('0x70');break;case _0xdea8('0x71'):case _0xdea8('0x72'):_0x1a70ad['Call_Result']=_0xdea8('0x73');break;case _0xdea8('0x74'):_0x1a70ad[_0xdea8('0x6f')]=_0xdea8('0x75');break;case'abandoned':_0x1a70ad[_0xdea8('0x6f')]=_0xdea8('0x76');break;case _0xdea8('0x77'):_0x1a70ad[_0xdea8('0x6f')]=_0xdea8('0x78');default:}_0x1a70ad[_0xdea8('0x79')]=(_0x4dcc10===_0xdea8('0x7a')?moment(_0x5079e9[_0xdea8('0x6d')])['format'](_0xdea8('0x6b')):moment(_0x5079e9['agentcalledAt'])[_0xdea8('0x32')](_0xdea8('0x6b')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x1a70ad[_0xdea8('0x7b')]=_0x4dcc10||_0xdea8('0x7c');_0x1a70ad=_['merge'](_0x1a70ad,getCustomFields(_0x13ce6c[_0xdea8('0x7d')],_0x5079e9));return request({'method':'POST','uri':_0xdea8('0x52')+_0x45350a+_0xdea8('0x7e'),'headers':{'Authorization':_0xdea8('0x44')+_0x405f01},'body':{'data':[_0x1a70ad]},'json':!![]})[_0xdea8('0x29')](function(_0x42d317){if(_0x42d317&&_0x42d317['data'][0x0][_0xdea8('0x7f')]==='SUCCESS'){logger[_0xdea8('0x30')](_0xdea8('0x80'));return{'id':_0x42d317[_0xdea8('0x45')][0x0][_0xdea8('0x47')]['id']};}})['catch'](function(_0x563b1b){logger[_0xdea8('0x30')](_0xdea8('0x81'),_0x563b1b[_0xdea8('0x2f')]);console[_0xdea8('0x4a')](_0xdea8('0x81'),_0x563b1b);});}exports[_0xdea8('0x82')]=function(_0x1a82e5,_0x5272be,_0xdffa22,_0x16a4e0,_0x33d16b,_0x599f08){var _0x5dc785,_0x5734b4,_0x3101fb;_0x599f08[_0xdea8('0x83')]=intUtil[_0xdea8('0x84')](_0x599f08['host']);_0x599f08[_0xdea8('0x85')]=intUtil[_0xdea8('0x84')](_0x599f08['serverUrl']);if(_0x33d16b&&_0x33d16b[_0xdea8('0x86')]){logger[_0xdea8('0x30')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5272be[_0xdea8('0x87')]=_0x599f08[_0xdea8('0x85')]+'/api/voice/recordings/'+_0x5272be[_0xdea8('0x88')]+_0xdea8('0x89')+md5(_0x5272be[_0xdea8('0x88')]);}else{_0x5272be['recordingURL']='';}var _0x57bbe9=_0x599f08[_0xdea8('0x83')]==='zoho.eu'?'eu':_0xdea8('0x8a');return getAccessToken(_0x599f08)[_0xdea8('0x29')](function(_0x36694a){_0x3101fb=_0x36694a;return getUser(_0x3101fb,_0x57bbe9,_0x599f08,_0x16a4e0[_0xdea8('0x36')]);})[_0xdea8('0x29')](function(_0x8eaf8d){_0x5dc785=_0x8eaf8d;logger[_0xdea8('0x30')]('The\x20User\x20ID\x20is:',_0x5dc785['id']);return getEndUser(_0x3101fb,_0x57bbe9,_0x599f08,_0x5272be['calleridname'],_0x5272be['calleridnum'],_0x5dc785,_0xdffa22);})['then'](function(_0x4be4c0){_0x5734b4=_0x4be4c0;return getCall(_0x3101fb,_0x57bbe9,_0x599f08,_0x5dc785,_0x5734b4,_0xdffa22,_0x5272be,_0xdea8('0x7c'));})[_0xdea8('0x29')](function(_0x3849cc){if(_0x3849cc){logger[_0xdea8('0x30')](_0xdea8('0x8b'),_0x3849cc['id']);logger[_0xdea8('0x30')](_0xdea8('0x8c'),_0xdea8('0x8d'));emit(util[_0xdea8('0x32')](_0xdea8('0x8e'),_0x16a4e0[_0xdea8('0x18')]),_0xdea8('0x8f'),{'uri':_0xdea8('0x90')+_0x599f08['host']+_0xdea8('0x91')+_0x3849cc['id']});}})[_0xdea8('0x2c')](function(_0x5e0575){logger[_0xdea8('0x2d')](_0xdea8('0x8c'),JSON[_0xdea8('0xd')](_0x5e0575));});};exports[_0xdea8('0x7a')]=function(_0x201888,_0x1fd3b7,_0x377f9c,_0x576143,_0x24a1ea,_0xa811be,_0x52bd58){var _0x20e1cb,_0x2a72a6,_0x2bbefc;_0xa811be[_0xdea8('0x83')]=intUtil[_0xdea8('0x84')](_0xa811be[_0xdea8('0x83')]);_0xa811be[_0xdea8('0x85')]=intUtil['stripTrailingSlash'](_0xa811be[_0xdea8('0x85')]);if(_0x52bd58&&_0x52bd58[_0xdea8('0x92')]&&_0x52bd58[_0xdea8('0x92')]!==_0xdea8('0x93')){logger[_0xdea8('0x30')](_0xdea8('0x94'),_0xdea8('0x95'));_0x1fd3b7[_0xdea8('0x87')]=_0xa811be['serverUrl']+_0xdea8('0x96')+_0x1fd3b7[_0xdea8('0x88')]+_0xdea8('0x89')+md5(_0x1fd3b7['uniqueid']);}var _0x5b0850=_0xa811be[_0xdea8('0x83')]===_0xdea8('0x97')?'eu':_0xdea8('0x8a');return getAccessToken(_0xa811be)['then'](function(_0x5dc509){_0x2bbefc=_0x5dc509;return getUser(_0x2bbefc,_0x5b0850,_0xa811be,_0x576143[_0xdea8('0x36')]);})[_0xdea8('0x29')](function(_0x130f1f){_0x20e1cb=_0x130f1f;logger[_0xdea8('0x30')]('The\x20User\x20ID\x20is:',_0x20e1cb['id']);return getEndUser(_0x2bbefc,_0x5b0850,_0xa811be,_0x1fd3b7['destcalleridname'],_0x1fd3b7['destcalleridnum'],_0x20e1cb,_0x377f9c);})[_0xdea8('0x29')](function(_0x50b7ed){_0x2a72a6=_0x50b7ed;return getCall(_0x2bbefc,_0x5b0850,_0xa811be,_0x20e1cb,_0x2a72a6,_0x377f9c,_0x1fd3b7,_0xdea8('0x98'));})[_0xdea8('0x29')](function(_0x6fe9e9){if(_0x6fe9e9){logger[_0xdea8('0x30')](_0xdea8('0x8b'),_0x6fe9e9['id']);logger[_0xdea8('0x30')](_0xdea8('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdea8('0x32')]('user:%s',_0x576143[_0xdea8('0x18')]),_0xdea8('0x8f'),{'uri':'https://crm.'+_0xa811be[_0xdea8('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x6fe9e9['id']});}})[_0xdea8('0x2c')](function(_0x33c9c6){logger[_0xdea8('0x2d')]('[OUTBOUND]',JSON[_0xdea8('0xd')](_0x33c9c6));});};exports['unmanaged']=function(_0x104ae5,_0x20d4e5,_0x1f9df8,_0x18aeee,_0x4f335d,_0x499cfc){var _0x2466a3,_0xbc628b,_0x4b0776;_0x499cfc[_0xdea8('0x83')]=intUtil[_0xdea8('0x84')](_0x499cfc['host']);_0x499cfc[_0xdea8('0x85')]=intUtil[_0xdea8('0x84')](_0x499cfc[_0xdea8('0x85')]);if(_0x4f335d&&_0x4f335d[_0xdea8('0x86')]){logger[_0xdea8('0x30')]('['+_0x20d4e5['lastevent'][_0xdea8('0x99')]()+']',_0xdea8('0x95'));_0x20d4e5[_0xdea8('0x87')]=_0x499cfc[_0xdea8('0x85')]+'/api/voice/recordings/'+_0x20d4e5[_0xdea8('0x88')]+_0xdea8('0x89')+md5(_0x20d4e5[_0xdea8('0x88')]);}else{_0x20d4e5[_0xdea8('0x87')]='';}var _0xe437c2=_0x499cfc[_0xdea8('0x83')]===_0xdea8('0x97')?'eu':_0xdea8('0x8a');return getAccessToken(_0x499cfc)[_0xdea8('0x29')](function(_0x106c53){_0x4b0776=_0x106c53;return getUser(_0x4b0776,_0xe437c2,_0x499cfc);})['then'](function(_0x4ee349){_0x2466a3=_0x4ee349;logger['info'](_0xdea8('0x9a'),_0x2466a3['id']);return getEndUser(_0x4b0776,_0xe437c2,_0x499cfc,_0x20d4e5[_0xdea8('0x9b')],_0x20d4e5[_0xdea8('0x9c')],_0x2466a3,_0x1f9df8);})[_0xdea8('0x29')](function(_0x531deb){_0xbc628b=_0x531deb;return getCall(_0x4b0776,_0xe437c2,_0x499cfc,_0x2466a3,_0xbc628b,_0x1f9df8,_0x20d4e5,_0xdea8('0x7c'));})[_0xdea8('0x29')](function(_0x49a378){if(_0x49a378){logger['info'](_0xdea8('0x8b'),_0x49a378['id']);}})[_0xdea8('0x2c')](function(_0x3b6fdb){logger[_0xdea8('0x2d')]('['+_0x20d4e5[_0xdea8('0x6e')][_0xdea8('0x99')]()+']',JSON[_0xdea8('0xd')](_0x3b6fdb));});}; \ 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 76f5399..37dd90d 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 _0x8b26=['util','shelljs','mustache','../../../../config/logger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x209a25,_0x5ce5cd){var _0x2fc625=function(_0x12d1bc){while(--_0x12d1bc){_0x209a25['push'](_0x209a25['shift']());}};_0x2fc625(++_0x5ce5cd);}(_0x8b26,0x82));var _0x68b2=function(_0x281ba7,_0x30e002){_0x281ba7=_0x281ba7-0x0;var _0x2501ce=_0x8b26[_0x281ba7];return _0x2501ce;};'use strict';var util=require(_0x68b2('0x0'));var sh=require(_0x68b2('0x1'));var Mustache=require(_0x68b2('0x2'));var logger=require(_0x68b2('0x3'))('trigger');exports[_0x68b2('0x4')]=function(_0x3bece8,_0x59707e){var _0x13c722=_0x3bece8[_0x68b2('0x5')]?_0x3bece8[_0x68b2('0x5')]:_0x68b2('0x6');var _0x1c2270=_0x3bece8[_0x68b2('0x7')]?Mustache[_0x68b2('0x8')](_0x3bece8[_0x68b2('0x7')],_0x59707e):_0x59707e;sh[_0x68b2('0x4')](_0x1c2270,function(_0x344dda,_0x10d0b2,_0x2fa4c5){if(_0x344dda!==0x0){logger[_0x68b2('0x9')](util[_0x68b2('0xa')](_0x68b2('0xb'),_0x13c722,_0x1c2270,_0x344dda,_0x2fa4c5));}else{logger[_0x68b2('0xc')](util[_0x68b2('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x13c722,_0x1c2270,_0x10d0b2));}});}; \ No newline at end of file +var _0x2c74=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','mustache','../../../../config/logger','trigger','exec','data2','data3'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x2c74,0x175));var _0x42c7=function(_0x23b376,_0x1e1b7a){_0x23b376=_0x23b376-0x0;var _0x65418e=_0x2c74[_0x23b376];return _0x65418e;};'use strict';var util=require(_0x42c7('0x0'));var sh=require('shelljs');var Mustache=require(_0x42c7('0x1'));var logger=require(_0x42c7('0x2'))(_0x42c7('0x3'));exports[_0x42c7('0x4')]=function(_0x3f4669,_0x121cd7){var _0x5c2143=_0x3f4669[_0x42c7('0x5')]?_0x3f4669[_0x42c7('0x5')]:'Script';var _0x4a1f64=_0x3f4669[_0x42c7('0x6')]?Mustache['render'](_0x3f4669[_0x42c7('0x6')],_0x121cd7):_0x121cd7;sh['exec'](_0x4a1f64,function(_0xfbc350,_0x580e7e,_0x21d7c1){if(_0xfbc350!==0x0){logger['error'](util[_0x42c7('0x7')](_0x42c7('0x8'),_0x5c2143,_0x4a1f64,_0xfbc350,_0x21d7c1));}else{logger[_0x42c7('0x9')](util[_0x42c7('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x5c2143,_0x4a1f64,_0x580e7e));}});}; \ 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 6eddf6f..b49c457 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 _0x76a4=[',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','data2','data5','data6','render','toUpperCase','GET','POST','data7','parse','body','error','stack','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil'];(function(_0x51b470,_0x482be5){var _0x30f89f=function(_0x43411c){while(--_0x43411c){_0x51b470['push'](_0x51b470['shift']());}};_0x30f89f(++_0x482be5);}(_0x76a4,0x83));var _0x476a=function(_0x34207c,_0x21dfc2){_0x34207c=_0x34207c-0x0;var _0x3b1c2e=_0x76a4[_0x34207c];return _0x3b1c2e;};'use strict';var rp=require('request-promise');var util=require(_0x476a('0x0'));var _=require(_0x476a('0x1'));var Mustache=require(_0x476a('0x2'));var logger=require(_0x476a('0x3'))(_0x476a('0x4'));exports[_0x476a('0x5')]=function(_0x5423ca,_0x564803){var _0x3848c4,_0x3485e8;var _0x4eecc4={'method':_0x5423ca[_0x476a('0x6')]['toUpperCase'](),'uri':Mustache['render'](_0x5423ca[_0x476a('0x7')],_0x564803),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5423ca['data5'])==='number'&&parseInt(_0x5423ca[_0x476a('0x8')])>=0x1&&parseInt(_0x5423ca[_0x476a('0x8')])<=0xa?parseInt(_0x5423ca[_0x476a('0x8')])*0x3e8:0x5*0x3e8};try{_0x4eecc4['headers']=_0x5423ca[_0x476a('0x9')]?JSON['parse'](Mustache[_0x476a('0xa')](_0x5423ca[_0x476a('0x9')],_0x564803)):{};}catch(_0x1bf93f){logger['error'](_0x1bf93f['stack']);}switch(_0x5423ca[_0x476a('0x6')][_0x476a('0xb')]()){case _0x476a('0xc'):case'DELETE':_0x3848c4=null;_0x4eecc4['qs']=_0x564803;break;case _0x476a('0xd'):case'PUT':if(_0x5423ca[_0x476a('0xe')]){try{_0x3848c4=JSON[_0x476a('0xf')](Mustache[_0x476a('0xa')](_0x5423ca['data7'],_0x564803));_0x4eecc4[_0x476a('0x10')]=_0x3848c4;}catch(_0x520fd7){logger[_0x476a('0x11')](_0x520fd7[_0x476a('0x12')]);logger[_0x476a('0x11')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x3848c4=_0x564803;_0x4eecc4[_0x476a('0x10')]=_0x3848c4;}break;}logger[_0x476a('0x13')](util[_0x476a('0x14')](_0x476a('0x15'),_0x5423ca[_0x476a('0x6')],_0x5423ca[_0x476a('0x7')],JSON[_0x476a('0x16')](_0x4eecc4)));rp(_0x4eecc4)['then'](function(_0x119324){_0x3848c4=!_[_0x476a('0x17')](_0x3848c4)?_0x476a('0x18')+_0x3848c4:'';_0x3485e8=typeof _0x119324[_0x476a('0x10')]===_0x476a('0x19')?JSON[_0x476a('0x16')](_0x119324[_0x476a('0x10')]):_0x119324[_0x476a('0x10')];logger[_0x476a('0x13')](util[_0x476a('0x14')](_0x476a('0x1a'),_0x5423ca[_0x476a('0x6')],_0x5423ca[_0x476a('0x7')],_0x119324[_0x476a('0x1b')],_0x3485e8));})[_0x476a('0x1c')](function(_0x159cc5){logger[_0x476a('0x11')](util[_0x476a('0x14')](_0x476a('0x1d'),_0x5423ca['data1'],_0x5423ca[_0x476a('0x7')],_0x159cc5['statusCode'],_0x159cc5['name'],_0x159cc5[_0x476a('0x1e')]));});}; \ No newline at end of file +var _0xad9f=['error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','format','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','mustache','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','GET','DELETE','PUT','body','stack'];(function(_0x5ed928,_0x2dbbdc){var _0x2effcc=function(_0x19ba45){while(--_0x19ba45){_0x5ed928['push'](_0x5ed928['shift']());}};_0x2effcc(++_0x2dbbdc);}(_0xad9f,0xed));var _0xfad9=function(_0x873075,_0x5b5f87){_0x873075=_0x873075-0x0;var _0x3cc79d=_0xad9f[_0x873075];return _0x3cc79d;};'use strict';var rp=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var _=require('lodash');var Mustache=require(_0xfad9('0x2'));var logger=require('../../../../config/logger')(_0xfad9('0x3'));exports[_0xfad9('0x4')]=function(_0x30ab14,_0x1bd22c){var _0x7d75d6,_0x46f590;var _0xb7af37={'method':_0x30ab14[_0xfad9('0x5')][_0xfad9('0x6')](),'uri':Mustache[_0xfad9('0x7')](_0x30ab14[_0xfad9('0x8')],_0x1bd22c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x30ab14[_0xfad9('0x9')])===_0xfad9('0xa')&&parseInt(_0x30ab14['data5'])>=0x1&&parseInt(_0x30ab14[_0xfad9('0x9')])<=0xa?parseInt(_0x30ab14['data5'])*0x3e8:0x5*0x3e8};try{_0xb7af37[_0xfad9('0xb')]=_0x30ab14[_0xfad9('0xc')]?JSON[_0xfad9('0xd')](Mustache[_0xfad9('0x7')](_0x30ab14[_0xfad9('0xc')],_0x1bd22c)):{};}catch(_0x2ef89a){logger['error'](_0x2ef89a['stack']);}switch(_0x30ab14[_0xfad9('0x5')][_0xfad9('0x6')]()){case _0xfad9('0xe'):case _0xfad9('0xf'):_0x7d75d6=null;_0xb7af37['qs']=_0x1bd22c;break;case'POST':case _0xfad9('0x10'):if(_0x30ab14['data7']){try{_0x7d75d6=JSON[_0xfad9('0xd')](Mustache['render'](_0x30ab14['data7'],_0x1bd22c));_0xb7af37[_0xfad9('0x11')]=_0x7d75d6;}catch(_0x1ea59b){logger['error'](_0x1ea59b[_0xfad9('0x12')]);logger[_0xfad9('0x13')](_0xfad9('0x14'));}}else{_0x7d75d6=_0x1bd22c;_0xb7af37[_0xfad9('0x11')]=_0x7d75d6;}break;}logger[_0xfad9('0x15')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x30ab14[_0xfad9('0x5')],_0x30ab14['data2'],JSON[_0xfad9('0x16')](_0xb7af37)));rp(_0xb7af37)[_0xfad9('0x17')](function(_0xf5c0f){_0x7d75d6=!_[_0xfad9('0x18')](_0x7d75d6)?_0xfad9('0x19')+_0x7d75d6:'';_0x46f590=typeof _0xf5c0f[_0xfad9('0x11')]===_0xfad9('0x1a')?JSON['stringify'](_0xf5c0f[_0xfad9('0x11')]):_0xf5c0f[_0xfad9('0x11')];logger[_0xfad9('0x15')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x30ab14['data1'],_0x30ab14[_0xfad9('0x8')],_0xf5c0f[_0xfad9('0x1b')],_0x46f590));})[_0xfad9('0x1c')](function(_0x8730f4){logger[_0xfad9('0x13')](util[_0xfad9('0x1d')](_0xfad9('0x1e'),_0x30ab14['data1'],_0x30ab14[_0xfad9('0x8')],_0x8730f4[_0xfad9('0x1b')],_0x8730f4[_0xfad9('0x1f')],_0x8730f4['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 65636f3..75365e4 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 _0xdd85=['client','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','../../config/logger','routing'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xdd85,0x123));var _0x5dd8=function(_0x1dae6c,_0x5bbff7){_0x1dae6c=_0x1dae6c-0x0;var _0x1a449a=_0xdd85[_0x1dae6c];return _0x1a449a;};'use strict';var jayson=require(_0x5dd8('0x0'));var BPromise=require('bluebird');var logger=require(_0x5dd8('0x1'))(_0x5dd8('0x2'));var client=jayson[_0x5dd8('0x3')][_0x5dd8('0x4')]({'port':0x2329});client[_0x5dd8('0x5')]=function(_0x559a81,_0x178816){return new BPromise(function(_0xb2f124,_0xbd8959){return client[_0x5dd8('0x6')](_0x559a81,_0x178816)[_0x5dd8('0x7')](function(_0x284ceb){logger[_0x5dd8('0x8')](_0x5dd8('0x9'),'routing',_0x559a81,_0x178816,_0x284ceb);if(_0x284ceb[_0x5dd8('0xa')]){logger[_0x5dd8('0xa')]('rpc',_0x5dd8('0x2'),_0x559a81,_0x284ceb['error']['message'],_0x178816);return _0xbd8959(_0x284ceb[_0x5dd8('0xa')][_0x5dd8('0xb')]);}else{return _0xb2f124(_0x284ceb['result']);}})[_0x5dd8('0xc')](function(_0x2f786e){logger[_0x5dd8('0xa')](_0x5dd8('0x9'),_0x5dd8('0x2'),_0x559a81,_0x2f786e,_0x178816);return _0xbd8959(_0x2f786e);});});};module[_0x5dd8('0xd')]=client; \ No newline at end of file +var _0x507b=['client','Request','request','error','rpc','message','result','catch','exports','jayson/promise','bluebird','routing'];(function(_0x5380b0,_0x51bc2e){var _0x2311a4=function(_0x574c60){while(--_0x574c60){_0x5380b0['push'](_0x5380b0['shift']());}};_0x2311a4(++_0x51bc2e);}(_0x507b,0x11d));var _0xb507=function(_0x541f17,_0x8adfd1){_0x541f17=_0x541f17-0x0;var _0x4765f6=_0x507b[_0x541f17];return _0x4765f6;};'use strict';var jayson=require(_0xb507('0x0'));var BPromise=require(_0xb507('0x1'));var logger=require('../../config/logger')(_0xb507('0x2'));var client=jayson[_0xb507('0x3')]['http']({'port':0x2329});client[_0xb507('0x4')]=function(_0x2acec8,_0x247ba9){return new BPromise(function(_0x44f9d9,_0x9b6b81){return client[_0xb507('0x5')](_0x2acec8,_0x247ba9)['then'](function(_0x30ccf2){logger['debug']('rpc',_0xb507('0x2'),_0x2acec8,_0x247ba9,_0x30ccf2);if(_0x30ccf2[_0xb507('0x6')]){logger[_0xb507('0x6')](_0xb507('0x7'),'routing',_0x2acec8,_0x30ccf2[_0xb507('0x6')][_0xb507('0x8')],_0x247ba9);return _0x9b6b81(_0x30ccf2[_0xb507('0x6')][_0xb507('0x8')]);}else{return _0x44f9d9(_0x30ccf2[_0xb507('0x9')]);}})[_0xb507('0xa')](function(_0x4e6ada){logger[_0xb507('0x6')](_0xb507('0x7'),_0xb507('0x2'),_0x2acec8,_0x4e6ada,_0x247ba9);return _0x9b6b81(_0x4e6ada);});});};module[_0xb507('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 5ffed65..16f9318 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 _0xbada=['catch','log','bluebird','./server','./lib/email','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','loginMailFrequency'];(function(_0x181ecf,_0xd19234){var _0x2849fe=function(_0x4c5457){while(--_0x4c5457){_0x181ecf['push'](_0x181ecf['shift']());}};_0x2849fe(++_0xd19234);}(_0xbada,0x18e));var _0xabad=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xbada[_0x5d6456];return _0x4d66c1;};'use strict';var BPromise=require(_0xabad('0x0'));var server=require(_0xabad('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xabad('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0xabad('0x3')]())['then'](realtime[_0xabad('0x4')]())[_0xabad('0x5')](function(){email[_0xabad('0x6')](realtime[_0xabad('0x7')]);return realtime;});}function main(){return server[_0xabad('0x8')](realtime,email)[_0xabad('0x5')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})['then'](function(_0x4097fe){return setInterval(initRealtime,_0x4097fe[_0xabad('0x9')]*0x3e8);})[_0xabad('0xa')](function(_0x1a5d7c){console[_0xabad('0xb')](_0x1a5d7c);});}main(); \ No newline at end of file +var _0x1efe=['listen','getSettings','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh'];(function(_0x1fad4e,_0x1968ff){var _0x4e9aaf=function(_0x47958c){while(--_0x47958c){_0x1fad4e['push'](_0x1fad4e['shift']());}};_0x4e9aaf(++_0x1968ff);}(_0x1efe,0x1d5));var _0xe1ef=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x1efe[_0x22f8ab];return _0x2a70e5;};'use strict';var BPromise=require(_0xe1ef('0x0'));var server=require(_0xe1ef('0x1'));var Realtime=require(_0xe1ef('0x2'));var EmailChannel=require(_0xe1ef('0x3'));var mailAccount=require(_0xe1ef('0x4'));var setting=require(_0xe1ef('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xe1ef('0x6')]()[_0xe1ef('0x7')](mailAccount[_0xe1ef('0x8')]())['then'](realtime[_0xe1ef('0x9')]())[_0xe1ef('0x7')](function(){email[_0xe1ef('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xe1ef('0xb')](realtime,email)[_0xe1ef('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0xe1ef('0xc')]();})['then'](function(_0x6935cd){return setInterval(initRealtime,_0x6935cd['loginMailFrequency']*0x3e8);})[_0xe1ef('0xd')](function(_0x3bd1ad){console[_0xe1ef('0xe')](_0x3bd1ad);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3e6a5b3..9fb9952 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 _0x5611=['messages','firstName','lastName','from','notify','then','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','verifySmtp','Smtp','lastSync','verify','verified','lodash','moment','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','info','mailAccounts','smtp','emit','name','key','active','Imap','status','total','stringify','md5','mailAccount:update','prototype','hasOwnProperty','imapAccounts','box','handleImapBox','bind','end','handleImapEnd','handleImapError','isNil','disabled','messageStatus','connected'];(function(_0x29214c,_0x12ba63){var _0x3e0669=function(_0x4259ce){while(--_0x4259ce){_0x29214c['push'](_0x29214c['shift']());}};_0x3e0669(++_0x12ba63);}(_0x5611,0xdb));var _0x1561=function(_0x5eab04,_0x17dbbe){_0x5eab04=_0x5eab04-0x0;var _0x974b21=_0x5611[_0x5eab04];return _0x974b21;};'use strict';var _=require(_0x1561('0x0'));var moment=require(_0x1561('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x1561('0x2'));var config=require(_0x1561('0x3'));var logger=require(_0x1561('0x4'))(_0x1561('0x5'));config['redis']=_[_0x1561('0x6')](config[_0x1561('0x7')],{'host':_0x1561('0x8'),'port':0x18eb});var io=require(_0x1561('0x9'))(new Redis(config[_0x1561('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x41b852){logger[_0x1561('0xa')]('start\x20email\x20channel');this[_0x1561('0xb')]=_0x41b852[_0x1561('0xb')];this['imapAccounts']={};this[_0x1561('0xc')]=new EmailSmtp();}EmailChannel['prototype'][_0x1561('0xd')]=function(_0x1fef3f){var _0x1c93b7=this[_0x1561('0xb')][_0x1fef3f];var _0x3d8006={'id':_0x1c93b7['id'],'name':_0x1c93b7[_0x1561('0xe')],'key':_0x1c93b7[_0x1561('0xf')],'active':_0x1c93b7[_0x1561('0x10')],'Imap':{'status':_0x1c93b7[_0x1561('0x11')][_0x1561('0x12')],'messageStatus':_0x1c93b7[_0x1561('0x11')]['messageStatus'],'total':_0x1c93b7[_0x1561('0x11')][_0x1561('0x13')]}};if(_['isNil'](md5Accounts[_0x1fef3f])){md5Accounts[_0x1fef3f]={};}var _0x5e1069=md5(JSON[_0x1561('0x14')](_0x3d8006));if(md5Accounts[_0x1fef3f][_0x1561('0x15')]!==_0x5e1069){md5Accounts[_0x1fef3f][_0x1561('0x15')]=_0x5e1069;io[_0x1561('0xd')](_0x1561('0x16'),_0x3d8006);}};EmailChannel[_0x1561('0x17')]['refresh']=function(_0x4aeb83){for(var _0x559faf in _0x4aeb83){if(_0x4aeb83[_0x1561('0x18')](_0x559faf)){if(_0x4aeb83[_0x559faf][_0x1561('0x11')]&&_0x4aeb83[_0x559faf][_0x1561('0x10')]){var _0x360ebf=_0x4aeb83[_0x559faf][_0x1561('0x11')];if(!this['imapAccounts'][_0x1561('0x18')](_0x360ebf['id'])){this[_0x1561('0x19')][_0x360ebf['id']]=new EmailImap(_0x360ebf,_0x4aeb83[_0x559faf][_0x1561('0x5')]);this['imapAccounts'][_0x360ebf['id']]['on'](_0x1561('0x1a'),this[_0x1561('0x1b')][_0x1561('0x1c')](this,_0x559faf));this['imapAccounts'][_0x360ebf['id']]['on']('email',this['handleImapEmail']['bind'](this,_0x559faf));this[_0x1561('0x19')][_0x360ebf['id']]['on'](_0x1561('0x1d'),this[_0x1561('0x1e')][_0x1561('0x1c')](this,_0x559faf));this[_0x1561('0x19')][_0x360ebf['id']]['on']('error',this[_0x1561('0x1f')][_0x1561('0x1c')](this,_0x559faf));}}else{if(_[_0x1561('0x20')](this[_0x1561('0xb')][_0x559faf][_0x1561('0x11')])){this['mailAccounts'][_0x559faf][_0x1561('0x11')]={};}this[_0x1561('0xb')][_0x559faf]['Imap']['status']=_0x1561('0x21');this[_0x1561('0xb')][_0x559faf][_0x1561('0x11')][_0x1561('0x22')]='';this[_0x1561('0xd')](_0x559faf);}}}};EmailChannel[_0x1561('0x17')][_0x1561('0x1b')]=function(_0x3a9bcf,_0x5331b2){if(this[_0x1561('0xb')][_0x3a9bcf]){this['mailAccounts'][_0x3a9bcf][_0x1561('0x11')][_0x1561('0x12')]=_0x1561('0x23');this[_0x1561('0xb')][_0x3a9bcf][_0x1561('0x11')][_0x1561('0x22')]=_0x5331b2[_0x1561('0xe')];if(_0x5331b2[_0x1561('0x24')]){this[_0x1561('0xb')][_0x3a9bcf][_0x1561('0x11')][_0x1561('0x13')]=_0x5331b2[_0x1561('0x24')]['total'];}return this[_0x1561('0xd')](_0x3a9bcf);}};EmailChannel[_0x1561('0x17')]['handleImapEmail']=function(_0x4f2fdd,_0x47e58d){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x47e58d[_0x1561('0x25')],_0x47e58d[_0x1561('0x26')],_0x47e58d[_0x1561('0x27')],_0x4f2fdd);if(this[_0x1561('0xb')][_0x4f2fdd]){return mailAccount[_0x1561('0x28')](_0x4f2fdd,_0x47e58d)[_0x1561('0x29')](function(_0x1d9c64){if(_0x1d9c64){logger[_0x1561('0xa')]('Mail\x20accepted\x20from\x20routing');}})[_0x1561('0x2a')](function(_0x5f34cf){logger[_0x1561('0x2b')](_0x1561('0x2c'),JSON[_0x1561('0x14')](_0x5f34cf));});}};EmailChannel['prototype'][_0x1561('0x1e')]=function(_0x13aace){if(this[_0x1561('0xb')][_0x13aace]&&this['mailAccounts'][_0x13aace][_0x1561('0x11')]){if(this[_0x1561('0x19')][this[_0x1561('0xb')][_0x13aace][_0x1561('0x11')]['id']]){delete this['imapAccounts'][this[_0x1561('0xb')][_0x13aace]['Imap']['id']];}this[_0x1561('0xb')][_0x13aace][_0x1561('0x11')]['lastSync']=moment();this[_0x1561('0xd')](_0x13aace);}};EmailChannel[_0x1561('0x17')][_0x1561('0x1f')]=function(_0x5d83d3,_0x10bf82){if(this[_0x1561('0xb')][_0x5d83d3]){this[_0x1561('0xb')][_0x5d83d3][_0x1561('0x11')]['status']=_0x1561('0x2b');this[_0x1561('0xb')][_0x5d83d3][_0x1561('0x11')]['messageStatus']=_0x10bf82;return this[_0x1561('0xd')](_0x5d83d3);}};EmailChannel[_0x1561('0x17')]['sendMail']=function(_0x1d0782,_0x266bb2){return this[_0x1561('0xc')][_0x1561('0x2d')](_0x1d0782,_0x266bb2);};EmailChannel['prototype'][_0x1561('0x2e')]=function(_0x48f861){var _0xcb801c=this;if(this[_0x1561('0xb')][_0x48f861['id']]){if(_[_0x1561('0x20')](this[_0x1561('0xb')][_0x48f861['id']]['Smtp'])){this[_0x1561('0xb')][_0x48f861['id']][_0x1561('0x2f')]={};}this[_0x1561('0xb')][_0x48f861['id']]['Smtp'][_0x1561('0x30')]=moment();return new BPromise(function(_0x3243da,_0x1dae9f){return _0xcb801c[_0x1561('0xc')][_0x1561('0x31')](_0x48f861)['then'](function(_0x226f86){_0xcb801c[_0x1561('0xb')][_0x48f861['id']][_0x1561('0x2f')][_0x1561('0x12')]=_0x1561('0x32');_0xcb801c[_0x1561('0xb')][_0x48f861['id']][_0x1561('0x2f')][_0x1561('0x22')]='';_0xcb801c['emit'](_0x48f861['id']);_0x3243da(_0x226f86);})[_0x1561('0x2a')](function(_0xb7c204){_0xcb801c[_0x1561('0xb')][_0x48f861['id']]['Smtp'][_0x1561('0x12')]=_0x1561('0x2b');_0xcb801c[_0x1561('0xb')][_0x48f861['id']][_0x1561('0x2f')][_0x1561('0x22')]=_0xb7c204;_0xcb801c[_0x1561('0xd')](_0x48f861['id']);_0x1dae9f(_0xb7c204);});});}return this['smtp'][_0x1561('0x31')](_0x48f861);};module['exports']=EmailChannel; \ No newline at end of file +var _0xc336=['sendMail','send','verifySmtp','Smtp','lastSync','verify','catch','moment','md5','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','email','box','bind','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','messageStatus','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s'];(function(_0x3836ab,_0x5bcb9b){var _0x1d8a9c=function(_0x5aedb4){while(--_0x5aedb4){_0x3836ab['push'](_0x3836ab['shift']());}};_0x1d8a9c(++_0x5bcb9b);}(_0xc336,0x73));var _0x6c33=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xc336[_0x102ff9];return _0x24fa97;};'use strict';var _=require('lodash');var moment=require(_0x6c33('0x0'));var BPromise=require('bluebird');var md5=require(_0x6c33('0x1'));var Redis=require(_0x6c33('0x2'));var config=require(_0x6c33('0x3'));var logger=require(_0x6c33('0x4'))('email');config[_0x6c33('0x5')]=_['defaults'](config['redis'],{'host':_0x6c33('0x6'),'port':0x18eb});var io=require(_0x6c33('0x7'))(new Redis(config[_0x6c33('0x5')]));var EmailImap=require(_0x6c33('0x8'));var EmailSmtp=require(_0x6c33('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x374c11){logger[_0x6c33('0xa')](_0x6c33('0xb'));this['mailAccounts']=_0x374c11[_0x6c33('0xc')];this[_0x6c33('0xd')]={};this[_0x6c33('0xe')]=new EmailSmtp();}EmailChannel[_0x6c33('0xf')]['emit']=function(_0x1c6cb5){var _0x2d2a04=this[_0x6c33('0xc')][_0x1c6cb5];var _0x300e69={'id':_0x2d2a04['id'],'name':_0x2d2a04[_0x6c33('0x10')],'key':_0x2d2a04[_0x6c33('0x11')],'active':_0x2d2a04[_0x6c33('0x12')],'Imap':{'status':_0x2d2a04[_0x6c33('0x13')][_0x6c33('0x14')],'messageStatus':_0x2d2a04[_0x6c33('0x13')]['messageStatus'],'total':_0x2d2a04[_0x6c33('0x13')][_0x6c33('0x15')]}};if(_[_0x6c33('0x16')](md5Accounts[_0x1c6cb5])){md5Accounts[_0x1c6cb5]={};}var _0x65ac8b=md5(JSON[_0x6c33('0x17')](_0x300e69));if(md5Accounts[_0x1c6cb5][_0x6c33('0x1')]!==_0x65ac8b){md5Accounts[_0x1c6cb5][_0x6c33('0x1')]=_0x65ac8b;io[_0x6c33('0x18')](_0x6c33('0x19'),_0x300e69);}};EmailChannel[_0x6c33('0xf')][_0x6c33('0x1a')]=function(_0x206a39){for(var _0x52828c in _0x206a39){if(_0x206a39[_0x6c33('0x1b')](_0x52828c)){if(_0x206a39[_0x52828c][_0x6c33('0x13')]&&_0x206a39[_0x52828c][_0x6c33('0x12')]){var _0xfbbd93=_0x206a39[_0x52828c][_0x6c33('0x13')];if(!this[_0x6c33('0xd')][_0x6c33('0x1b')](_0xfbbd93['id'])){this[_0x6c33('0xd')][_0xfbbd93['id']]=new EmailImap(_0xfbbd93,_0x206a39[_0x52828c][_0x6c33('0x1c')]);this[_0x6c33('0xd')][_0xfbbd93['id']]['on'](_0x6c33('0x1d'),this['handleImapBox'][_0x6c33('0x1e')](this,_0x52828c));this[_0x6c33('0xd')][_0xfbbd93['id']]['on'](_0x6c33('0x1c'),this['handleImapEmail']['bind'](this,_0x52828c));this[_0x6c33('0xd')][_0xfbbd93['id']]['on'](_0x6c33('0x1f'),this[_0x6c33('0x20')][_0x6c33('0x1e')](this,_0x52828c));this[_0x6c33('0xd')][_0xfbbd93['id']]['on'](_0x6c33('0x21'),this[_0x6c33('0x22')][_0x6c33('0x1e')](this,_0x52828c));}}else{if(_[_0x6c33('0x16')](this[_0x6c33('0xc')][_0x52828c][_0x6c33('0x13')])){this[_0x6c33('0xc')][_0x52828c][_0x6c33('0x13')]={};}this['mailAccounts'][_0x52828c][_0x6c33('0x13')][_0x6c33('0x14')]=_0x6c33('0x23');this[_0x6c33('0xc')][_0x52828c][_0x6c33('0x13')]['messageStatus']='';this[_0x6c33('0x18')](_0x52828c);}}}};EmailChannel[_0x6c33('0xf')][_0x6c33('0x24')]=function(_0x5739bc,_0x418d7b){if(this[_0x6c33('0xc')][_0x5739bc]){this['mailAccounts'][_0x5739bc]['Imap'][_0x6c33('0x14')]=_0x6c33('0x25');this[_0x6c33('0xc')][_0x5739bc]['Imap'][_0x6c33('0x26')]=_0x418d7b[_0x6c33('0x10')];if(_0x418d7b['messages']){this[_0x6c33('0xc')][_0x5739bc][_0x6c33('0x13')][_0x6c33('0x15')]=_0x418d7b[_0x6c33('0x27')][_0x6c33('0x15')];}return this[_0x6c33('0x18')](_0x5739bc);}};EmailChannel['prototype'][_0x6c33('0x28')]=function(_0x40729d,_0x46f988){logger[_0x6c33('0xa')](_0x6c33('0x29'),_0x46f988['firstName'],_0x46f988[_0x6c33('0x2a')],_0x46f988['from'],_0x40729d);if(this[_0x6c33('0xc')][_0x40729d]){return mailAccount[_0x6c33('0x2b')](_0x40729d,_0x46f988)[_0x6c33('0x2c')](function(_0x50b169){if(_0x50b169){logger['info'](_0x6c33('0x2d'));}})['catch'](function(_0x29546b){logger[_0x6c33('0x21')](_0x6c33('0x2e'),JSON[_0x6c33('0x17')](_0x29546b));});}};EmailChannel[_0x6c33('0xf')][_0x6c33('0x20')]=function(_0x44436b){if(this[_0x6c33('0xc')][_0x44436b]&&this[_0x6c33('0xc')][_0x44436b]['Imap']){if(this[_0x6c33('0xd')][this[_0x6c33('0xc')][_0x44436b][_0x6c33('0x13')]['id']]){delete this[_0x6c33('0xd')][this['mailAccounts'][_0x44436b][_0x6c33('0x13')]['id']];}this[_0x6c33('0xc')][_0x44436b][_0x6c33('0x13')]['lastSync']=moment();this[_0x6c33('0x18')](_0x44436b);}};EmailChannel[_0x6c33('0xf')][_0x6c33('0x22')]=function(_0x52d5f2,_0xbfd9df){if(this[_0x6c33('0xc')][_0x52d5f2]){this[_0x6c33('0xc')][_0x52d5f2][_0x6c33('0x13')]['status']='error';this[_0x6c33('0xc')][_0x52d5f2][_0x6c33('0x13')][_0x6c33('0x26')]=_0xbfd9df;return this[_0x6c33('0x18')](_0x52d5f2);}};EmailChannel[_0x6c33('0xf')][_0x6c33('0x2f')]=function(_0x138218,_0x1fdc2a){return this[_0x6c33('0xe')][_0x6c33('0x30')](_0x138218,_0x1fdc2a);};EmailChannel[_0x6c33('0xf')][_0x6c33('0x31')]=function(_0x42daf0){var _0x27d67b=this;if(this[_0x6c33('0xc')][_0x42daf0['id']]){if(_[_0x6c33('0x16')](this[_0x6c33('0xc')][_0x42daf0['id']][_0x6c33('0x32')])){this[_0x6c33('0xc')][_0x42daf0['id']][_0x6c33('0x32')]={};}this[_0x6c33('0xc')][_0x42daf0['id']]['Smtp'][_0x6c33('0x33')]=moment();return new BPromise(function(_0xa1f99b,_0x4292be){return _0x27d67b['smtp'][_0x6c33('0x34')](_0x42daf0)[_0x6c33('0x2c')](function(_0x2adf67){_0x27d67b[_0x6c33('0xc')][_0x42daf0['id']]['Smtp'][_0x6c33('0x14')]='verified';_0x27d67b[_0x6c33('0xc')][_0x42daf0['id']][_0x6c33('0x32')]['messageStatus']='';_0x27d67b[_0x6c33('0x18')](_0x42daf0['id']);_0xa1f99b(_0x2adf67);})[_0x6c33('0x35')](function(_0x17ee9e){_0x27d67b[_0x6c33('0xc')][_0x42daf0['id']][_0x6c33('0x32')][_0x6c33('0x14')]=_0x6c33('0x21');_0x27d67b[_0x6c33('0xc')][_0x42daf0['id']][_0x6c33('0x32')][_0x6c33('0x26')]=_0x17ee9e;_0x27d67b[_0x6c33('0x18')](_0x42daf0['id']);_0x4292be(_0x17ee9e);});});}return this[_0x6c33('0xe')][_0x6c33('0x34')](_0x42daf0);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f247aa9..9d98d59 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 _0x98c0=['tls','required','openBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','handleFetchMessage','handleFetchError','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','email','handleFetchEnd','closeBox','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port'];(function(_0x2955c8,_0x5cbc4d){var _0x2722e7=function(_0x292283){while(--_0x292283){_0x2955c8['push'](_0x2955c8['shift']());}};_0x2722e7(++_0x5cbc4d);}(_0x98c0,0xc2));var _0x098c=function(_0x5c8274,_0x3ddf20){_0x5c8274=_0x5c8274-0x0;var _0x235800=_0x98c0[_0x5c8274];return _0x235800;};'use strict';var fs=require('fs');var path=require(_0x098c('0x0'));var util=require(_0x098c('0x1'));var Imap=require(_0x098c('0x2'));var _=require('lodash');var rs=require(_0x098c('0x3'));var simpleParser=require(_0x098c('0x4'))['simpleParser'];var Iconv=require(_0x098c('0x5'))[_0x098c('0x6')];var EventEmitter=require(_0x098c('0x7'))[_0x098c('0x8')];var utils=require(_0x098c('0x9'));var logger=require(_0x098c('0xa'))('email');function EmailImap(_0x4055d4,_0x5360cb){this[_0x098c('0xb')]='INBOX';this[_0x098c('0xc')]=this['getAccount'](_0x4055d4,_0x5360cb);this['imap']=new Imap(this['account']);this[_0x098c('0x2')][_0x098c('0xd')](_0x098c('0xe'),this[_0x098c('0xf')][_0x098c('0x10')](this));this['imap'][_0x098c('0xd')](_0x098c('0x11'),this[_0x098c('0x12')][_0x098c('0x10')](this));this[_0x098c('0x2')]['on'](_0x098c('0x13'),this[_0x098c('0x14')]['bind'](this));this[_0x098c('0x2')][_0x098c('0x15')]();}util[_0x098c('0x16')](EmailImap,EventEmitter);EmailImap[_0x098c('0x17')][_0x098c('0x18')]=function(_0x156e06,_0x1282d3){var _0x44b262={'connTimeout':_0x156e06[_0x098c('0x19')]?_0x156e06[_0x098c('0x19')]*0x3e8:0x2710,'authTimeout':_0x156e06[_0x098c('0x1a')]?_0x156e06[_0x098c('0x1a')]*0x3e8:0x1388};if(_[_0x098c('0x1b')](_0x156e06[_0x098c('0x1c')])){if(_0x156e06[_0x098c('0x1d')]){_0x44b262['user']=_0x156e06[_0x098c('0x1e')];_0x44b262[_0x098c('0x1f')]=_0x156e06[_0x098c('0x1f')];}_0x44b262['host']=_0x156e06[_0x098c('0x20')];_0x44b262[_0x098c('0x21')]=_0x156e06['port']||0x3e1;if(_0x156e06[_0x098c('0x22')]){_0x44b262['tls']=!![];}else{_0x44b262[_0x098c('0x22')]=![];_0x44b262['autotls']=_0x098c('0x23');}}else{_0x44b262[_0x098c('0x1e')]=_0x156e06[_0x098c('0x1e')];_0x44b262[_0x098c('0x1f')]=_0x156e06[_0x098c('0x1f')];_0x44b262[_0x098c('0x20')]=utils['getHost'](_0x156e06[_0x098c('0x1c')]);_0x44b262[_0x098c('0x21')]=0x3e1;_0x44b262['tls']=!![];}_0x44b262['email']=_0x1282d3||_0x156e06[_0x098c('0x1e')]||'anonymous@xcally.com';return _0x44b262;};EmailImap[_0x098c('0x17')][_0x098c('0xf')]=function(){this[_0x098c('0x2')][_0x098c('0x24')](this[_0x098c('0xb')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x098c('0x17')]['handleOpenBox']=function(_0x4411bd,_0x4107d6){if(_0x4411bd){this[_0x098c('0x14')](_0x4411bd,!![]);}else{this[_0x098c('0x25')]('box',_0x4107d6);this[_0x098c('0x26')]();}};EmailImap['prototype'][_0x098c('0x27')]=function(_0x35072f){if(_0x35072f){this[_0x098c('0x14')](_0x35072f,!![]);}else{this[_0x098c('0x2')][_0x098c('0x11')]();}};EmailImap[_0x098c('0x17')][_0x098c('0x26')]=function(){this[_0x098c('0x2')][_0x098c('0x28')](['UNSEEN'],this['handleReadUnseen'][_0x098c('0x10')](this));};EmailImap[_0x098c('0x17')][_0x098c('0x29')]=function(_0x19cb39,_0x272f72){if(_0x19cb39){this[_0x098c('0x14')](_0x19cb39,!![]);}else{if(_0x272f72[_0x098c('0x2a')]){try{var _0x19f5c1=this[_0x098c('0x2')]['fetch'](_0x272f72,{'bodies':'','markSeen':!![]});_0x19f5c1['on']('message',this[_0x098c('0x2b')][_0x098c('0x10')](this));_0x19f5c1[_0x098c('0xd')]('error',this[_0x098c('0x2c')][_0x098c('0x10')](this));_0x19f5c1[_0x098c('0xd')](_0x098c('0x11'),this['handleFetchEnd'][_0x098c('0x10')](this));}catch(_0x56099f){logger[_0x098c('0x13')](_0x56099f);}}else{this[_0x098c('0x2')]['closeBox'](!![],this[_0x098c('0x27')][_0x098c('0x10')](this));}}};EmailImap[_0x098c('0x17')][_0x098c('0x2b')]=function(_0x177cf5,_0x5606be){_0x177cf5['on']('body',this[_0x098c('0x2d')][_0x098c('0x10')](this));_0x177cf5[_0x098c('0xd')]('attributes',this[_0x098c('0x2e')]['bind'](this));_0x177cf5[_0x098c('0xd')]('end',this[_0x098c('0x2f')][_0x098c('0x10')](this));};EmailImap[_0x098c('0x17')][_0x098c('0x2d')]=function(_0x2b82e4,_0x439a87){simpleParser(_0x2b82e4,{'Iconv':Iconv},this[_0x098c('0x30')][_0x098c('0x10')](this));};EmailImap[_0x098c('0x17')]['handleMessageAttributes']=function(_0x1399f0){};EmailImap[_0x098c('0x17')][_0x098c('0x2f')]=function(){};EmailImap['prototype'][_0x098c('0x30')]=function(_0x529a1a,_0x52371b){if(_0x529a1a){logger[_0x098c('0x13')](_0x529a1a);}else{var _0x49c5dc=this;utils[_0x098c('0x31')](this[_0x098c('0xc')],_0x52371b,function(_0x4a3135){_0x49c5dc[_0x098c('0x25')](_0x098c('0x32'),_0x4a3135);});}};EmailImap[_0x098c('0x17')][_0x098c('0x33')]=function(){this[_0x098c('0x2')]['closeBox'](!![],this[_0x098c('0x27')]['bind'](this));};EmailImap[_0x098c('0x17')][_0x098c('0x2c')]=function(_0x4a42){this[_0x098c('0x14')](_0x4a42);this[_0x098c('0x2')][_0x098c('0x34')](!![],this[_0x098c('0x27')][_0x098c('0x10')](this));};EmailImap['prototype'][_0x098c('0x12')]=function(){this['emit'](_0x098c('0x11'));};EmailImap[_0x098c('0x17')][_0x098c('0x14')]=function(_0x473256,_0x3f6f99){logger[_0x098c('0x13')](_0x098c('0x14'),this[_0x098c('0xc')][_0x098c('0x32')],JSON['stringify'](_0x473256));var _0x334d7c='';if(_0x473256){if(_0x473256['textCode']){_0x334d7c=_0x473256[_0x098c('0x35')];}else{for(var _0x5db226 in _0x473256){if(_0x473256[_0x098c('0x36')](_0x5db226)){_0x334d7c+=_[_0x098c('0x37')](_0x5db226)+':\x20'+_0x473256[_0x5db226]+'\x0a';}}}}if(_0x3f6f99){this[_0x098c('0x2')][_0x098c('0x11')]();}else{this['emit'](_0x098c('0x13'),_0x334d7c);this['emit']('end');}};module[_0x098c('0x38')]=EmailImap; \ No newline at end of file +var _0xa446=['UNSEEN','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end'];(function(_0xe7732a,_0x24fec2){var _0x17829f=function(_0x527d78){while(--_0x527d78){_0xe7732a['push'](_0xe7732a['shift']());}};_0x17829f(++_0x24fec2);}(_0xa446,0xc6));var _0x6a44=function(_0x4858ea,_0x3bc159){_0x4858ea=_0x4858ea-0x0;var _0xa0c88c=_0xa446[_0x4858ea];return _0xa0c88c;};'use strict';var fs=require('fs');var path=require(_0x6a44('0x0'));var util=require(_0x6a44('0x1'));var Imap=require('imap');var _=require(_0x6a44('0x2'));var rs=require('randomstring');var simpleParser=require(_0x6a44('0x3'))['simpleParser'];var Iconv=require(_0x6a44('0x4'))['Iconv'];var EventEmitter=require(_0x6a44('0x5'))[_0x6a44('0x6')];var utils=require(_0x6a44('0x7'));var logger=require(_0x6a44('0x8'))(_0x6a44('0x9'));function EmailImap(_0x417c8c,_0x58be49){this[_0x6a44('0xa')]=_0x6a44('0xb');this[_0x6a44('0xc')]=this[_0x6a44('0xd')](_0x417c8c,_0x58be49);this[_0x6a44('0xe')]=new Imap(this['account']);this[_0x6a44('0xe')][_0x6a44('0xf')](_0x6a44('0x10'),this[_0x6a44('0x11')][_0x6a44('0x12')](this));this[_0x6a44('0xe')][_0x6a44('0xf')]('end',this[_0x6a44('0x13')][_0x6a44('0x12')](this));this['imap']['on'](_0x6a44('0x14'),this[_0x6a44('0x15')][_0x6a44('0x12')](this));this['imap'][_0x6a44('0x16')]();}util[_0x6a44('0x17')](EmailImap,EventEmitter);EmailImap[_0x6a44('0x18')][_0x6a44('0xd')]=function(_0x156a27,_0x1481ed){var _0x553bc1={'connTimeout':_0x156a27['connTimeout']?_0x156a27[_0x6a44('0x19')]*0x3e8:0x2710,'authTimeout':_0x156a27[_0x6a44('0x1a')]?_0x156a27['authTimeout']*0x3e8:0x1388};if(_[_0x6a44('0x1b')](_0x156a27[_0x6a44('0x1c')])){if(_0x156a27[_0x6a44('0x1d')]){_0x553bc1[_0x6a44('0x1e')]=_0x156a27[_0x6a44('0x1e')];_0x553bc1[_0x6a44('0x1f')]=_0x156a27[_0x6a44('0x1f')];}_0x553bc1[_0x6a44('0x20')]=_0x156a27[_0x6a44('0x20')];_0x553bc1[_0x6a44('0x21')]=_0x156a27[_0x6a44('0x21')]||0x3e1;if(_0x156a27[_0x6a44('0x22')]){_0x553bc1[_0x6a44('0x22')]=!![];}else{_0x553bc1[_0x6a44('0x22')]=![];_0x553bc1['autotls']='required';}}else{_0x553bc1['user']=_0x156a27[_0x6a44('0x1e')];_0x553bc1[_0x6a44('0x1f')]=_0x156a27[_0x6a44('0x1f')];_0x553bc1[_0x6a44('0x20')]=utils['getHost'](_0x156a27[_0x6a44('0x1c')]);_0x553bc1[_0x6a44('0x21')]=0x3e1;_0x553bc1['tls']=!![];}_0x553bc1[_0x6a44('0x9')]=_0x1481ed||_0x156a27[_0x6a44('0x1e')]||_0x6a44('0x23');return _0x553bc1;};EmailImap[_0x6a44('0x18')][_0x6a44('0x11')]=function(){this[_0x6a44('0xe')][_0x6a44('0x24')](this[_0x6a44('0xa')],![],this[_0x6a44('0x25')]['bind'](this));};EmailImap[_0x6a44('0x18')][_0x6a44('0x25')]=function(_0x466c54,_0x36b027){if(_0x466c54){this['handleError'](_0x466c54,!![]);}else{this[_0x6a44('0x26')]('box',_0x36b027);this[_0x6a44('0x27')]();}};EmailImap[_0x6a44('0x18')][_0x6a44('0x28')]=function(_0x2e86a1){if(_0x2e86a1){this[_0x6a44('0x15')](_0x2e86a1,!![]);}else{this[_0x6a44('0xe')][_0x6a44('0x29')]();}};EmailImap[_0x6a44('0x18')][_0x6a44('0x27')]=function(){this['imap']['search']([_0x6a44('0x2a')],this['handleReadUnseen'][_0x6a44('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x391f33,_0xbe9fa1){if(_0x391f33){this[_0x6a44('0x15')](_0x391f33,!![]);}else{if(_0xbe9fa1['length']){try{var _0x34aea9=this['imap'][_0x6a44('0x2b')](_0xbe9fa1,{'bodies':'','markSeen':!![]});_0x34aea9['on'](_0x6a44('0x2c'),this['handleFetchMessage']['bind'](this));_0x34aea9[_0x6a44('0xf')](_0x6a44('0x14'),this[_0x6a44('0x2d')]['bind'](this));_0x34aea9['once'](_0x6a44('0x29'),this[_0x6a44('0x2e')][_0x6a44('0x12')](this));}catch(_0x5ab510){logger[_0x6a44('0x14')](_0x5ab510);}}else{this[_0x6a44('0xe')][_0x6a44('0x2f')](!![],this[_0x6a44('0x28')][_0x6a44('0x12')](this));}}};EmailImap[_0x6a44('0x18')][_0x6a44('0x30')]=function(_0x3a67fe,_0x410afd){_0x3a67fe['on'](_0x6a44('0x31'),this[_0x6a44('0x32')][_0x6a44('0x12')](this));_0x3a67fe['once'](_0x6a44('0x33'),this['handleMessageAttributes']['bind'](this));_0x3a67fe['once']('end',this[_0x6a44('0x34')]['bind'](this));};EmailImap[_0x6a44('0x18')]['handleMessageBody']=function(_0x380ca3,_0x2ca22a){simpleParser(_0x380ca3,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x6a44('0x18')][_0x6a44('0x35')]=function(_0x2c509e){};EmailImap[_0x6a44('0x18')]['handleMessageEnd']=function(){};EmailImap[_0x6a44('0x18')][_0x6a44('0x36')]=function(_0x3eee72,_0x4738cb){if(_0x3eee72){logger[_0x6a44('0x14')](_0x3eee72);}else{var _0x1b88d6=this;utils['parser'](this[_0x6a44('0xc')],_0x4738cb,function(_0x3b3adc){_0x1b88d6['emit'](_0x6a44('0x9'),_0x3b3adc);});}};EmailImap['prototype'][_0x6a44('0x2e')]=function(){this['imap'][_0x6a44('0x2f')](!![],this[_0x6a44('0x28')][_0x6a44('0x12')](this));};EmailImap[_0x6a44('0x18')][_0x6a44('0x2d')]=function(_0x4d6be4){this[_0x6a44('0x15')](_0x4d6be4);this[_0x6a44('0xe')][_0x6a44('0x2f')](!![],this['handleCloseBox'][_0x6a44('0x12')](this));};EmailImap[_0x6a44('0x18')]['handleEnd']=function(){this['emit']('end');};EmailImap['prototype'][_0x6a44('0x15')]=function(_0xcdb39,_0x21ba45){logger[_0x6a44('0x14')](_0x6a44('0x15'),this['account']['email'],JSON[_0x6a44('0x37')](_0xcdb39));var _0x36a7ce='';if(_0xcdb39){if(_0xcdb39[_0x6a44('0x38')]){_0x36a7ce=_0xcdb39['textCode'];}else{for(var _0x362c73 in _0xcdb39){if(_0xcdb39[_0x6a44('0x39')](_0x362c73)){_0x36a7ce+=_[_0x6a44('0x3a')](_0x362c73)+':\x20'+_0xcdb39[_0x362c73]+'\x0a';}}}}if(_0x21ba45){this['imap'][_0x6a44('0x29')]();}else{this[_0x6a44('0x26')](_0x6a44('0x14'),_0x36a7ce);this[_0x6a44('0x26')](_0x6a44('0x29'));}};module[_0x6a44('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 22e47d0..09f63b1 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 _0x6eef=['toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail'];(function(_0x1bcf11,_0x157ed6){var _0x4532c2=function(_0xcd1288){while(--_0xcd1288){_0x1bcf11['push'](_0x1bcf11['shift']());}};_0x4532c2(++_0x157ed6);}(_0x6eef,0xc4));var _0xf6ee=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x6eef[_0x2d34d6];return _0x1d3d12;};'use strict';var nodemailer=require(_0xf6ee('0x0'));var BPromise=require(_0xf6ee('0x1'));var inlineBase64=require(_0xf6ee('0x2'));function EmailSmtp(){}EmailSmtp[_0xf6ee('0x3')][_0xf6ee('0x4')]=function(_0x1ae822,_0x14c82e){return new BPromise(function(_0x4f7239,_0x145850){var _0x1341c9=nodemailer[_0xf6ee('0x5')](_0x1ae822);_0x1341c9[_0xf6ee('0x6')]('compile',inlineBase64());_0x1341c9[_0xf6ee('0x7')](_0x14c82e,function(_0x348ae5,_0x395d21){if(_0x348ae5){_0x145850(_0x348ae5[_0xf6ee('0x8')]());}else{_0x4f7239(_0x395d21);}});});};EmailSmtp[_0xf6ee('0x3')][_0xf6ee('0x9')]=function(_0x4d8cf8){return new BPromise(function(_0x538a34,_0x374187){var _0x2bfa7a=nodemailer[_0xf6ee('0x5')](_0x4d8cf8);_0x2bfa7a[_0xf6ee('0x9')](function(_0x2926f1,_0x4f5480){if(_0x2926f1){_0x374187(_0x2926f1['toString']());}else{if(_0x4f5480){_0x538a34(_0x4f5480);}else{_0x374187(_0xf6ee('0xa'));}}});});};module[_0xf6ee('0xb')]=EmailSmtp; \ No newline at end of file +var _0x3e22=['createTransport','compile','sendMail','toString','verify','Not\x20verifired','bluebird','prototype','send'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x3e22,0xa8));var _0x23e2=function(_0x23e02e,_0x4d26cb){_0x23e02e=_0x23e02e-0x0;var _0x2a6db8=_0x3e22[_0x23e02e];return _0x2a6db8;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x23e2('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x23e2('0x1')][_0x23e2('0x2')]=function(_0xda608,_0x3c52fd){return new BPromise(function(_0x5b078c,_0x4fcb3e){var _0x2058ab=nodemailer[_0x23e2('0x3')](_0xda608);_0x2058ab['use'](_0x23e2('0x4'),inlineBase64());_0x2058ab[_0x23e2('0x5')](_0x3c52fd,function(_0x3a8351,_0x927fbb){if(_0x3a8351){_0x4fcb3e(_0x3a8351[_0x23e2('0x6')]());}else{_0x5b078c(_0x927fbb);}});});};EmailSmtp['prototype'][_0x23e2('0x7')]=function(_0x29e9e7){return new BPromise(function(_0x30f0e4,_0x75da0a){var _0x437295=nodemailer['createTransport'](_0x29e9e7);_0x437295[_0x23e2('0x7')](function(_0x1f502d,_0x1691c5){if(_0x1f502d){_0x75da0a(_0x1f502d[_0x23e2('0x6')]());}else{if(_0x1691c5){_0x30f0e4(_0x1691c5);}else{_0x75da0a(_0x23e2('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 6789883..8e4cd7e 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 _0x9b2c=['originCc','bcc','attachment','format','%s-%s','now','root','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','parser','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','

Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','moment','randomstring','util','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x367025[_0xc9b2('0x10')](0x0,-0x1)[_0xc9b2('0x11')]('\x20'):_0x485792['name'];}return _0xc9b2('0x12');}function getLastName(_0x1d72cb){var _0x71b062=_[_0xc9b2('0x5')](_0x1d72cb['value']);if(_0x71b062&&_0x71b062[_0xc9b2('0xb')]){var _0x3cd2a2=_0x71b062[_0xc9b2('0xb')][_0xc9b2('0xe')](/\s+/);return _0x3cd2a2[_0xc9b2('0xf')]>0x1?_0x3cd2a2[_0xc9b2('0x13')]():'';}return'';}function getMails(_0x302c1a,_0x2167f5){var _0x59fb0f='';for(var _0x351c79=0x0;_0x351c79<_0x2167f5[_0xc9b2('0x6')][_0xc9b2('0xf')];_0x351c79+=0x1){if(_0x2167f5[_0xc9b2('0x6')][_0x351c79]['address']!==_0x302c1a){if(!_[_0xc9b2('0x14')](_0x59fb0f)){_0x59fb0f+=',';}_0x59fb0f+=_0x2167f5[_0xc9b2('0x6')][_0x351c79][_0xc9b2('0xb')]||_0x2167f5[_0xc9b2('0x6')][_0x351c79][_0xc9b2('0x7')]||'';_0x59fb0f+='\x20<';_0x59fb0f+=_0x2167f5[_0xc9b2('0x6')][_0x351c79][_0xc9b2('0x7')]?_0x2167f5['value'][_0x351c79][_0xc9b2('0x7')]:'anonymous'+random[_0xc9b2('0x9')](0x6)+_0xc9b2('0xa');_0x59fb0f+='>';}}return _0x59fb0f;}function parseEmail(_0x527403,_0x18237a,_0x23711e){if(_0x18237a['html']){var _0x2842be=/)<[^<]*)*<\/script>/gi;while(_0x2842be['test'](_0x18237a[_0xc9b2('0x15')])){_0x18237a[_0xc9b2('0x15')]=_0x18237a[_0xc9b2('0x15')][_0xc9b2('0x16')](_0x2842be,'');}if(_0x18237a[_0xc9b2('0x15')][_0xc9b2('0x17')](_0xc9b2('0x18'))){var _0x278542=[];_0x18237a[_0xc9b2('0x19')][_0xc9b2('0x1a')](_0x5a2786=>{_0x278542[_0xc9b2('0x1b')](_0x5a2786[_0xc9b2('0x1c')]);});var _0x444181=/]+>/g;var _0x8e5dfa=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a2c79=_0x18237a[_0xc9b2('0x15')]['replace'](_0x8e5dfa,_0xc9b2('0x1d'));var _0xa07875=_0x5a2c79[_0xc9b2('0x16')](_0x444181,_0xc9b2('0x1e'));for(let _0x39a186=0x0;_0x39a186<_0x278542[_0xc9b2('0xf')];_0x39a186++){var _0x35c7f5=_0xa07875[_0xc9b2('0x16')](_0xc9b2('0x1e'),_0xc9b2('0x1f')+_0x278542[_0x39a186]+_0xc9b2('0x20'));_0xa07875=_0x35c7f5;}_0x18237a[_0xc9b2('0x15')]=_0xa07875;}_0x23711e[_0xc9b2('0x21')]=_0x18237a[_0xc9b2('0x15')];}else{_0x23711e[_0xc9b2('0x21')]=_0x18237a[_0xc9b2('0x22')];}if(_0x23711e['body']){_0x23711e['body']=_0x23711e[_0xc9b2('0x21')][_0xc9b2('0x16')](/0x0){var _0xeec9cf=[_0xc9b2('0x32'),_0xc9b2('0x33'),'Precedence:\x20auto_reply'];for(var _0x3226d5=0x0;_0x3226d5<_0x18237a[_0xc9b2('0x31')][_0xc9b2('0xf')];_0x3226d5++){var _0x1a0629=_['indexOf'](_0xeec9cf,_0x18237a[_0xc9b2('0x31')][_0x3226d5][_0xc9b2('0x34')]);if(_0x1a0629>=0x0){_0x23711e['isAutoreply']=!![];}}}return _0x23711e;}exports[_0xc9b2('0x35')]=function(_0x3b93cb,_0x5add26,_0x3541ec){var _0x5b22fb={'from':getAddress(_0x5add26['from']),'firstName':getFirstName(_0x5add26[_0xc9b2('0x36')]),'lastName':getLastName(_0x5add26[_0xc9b2('0x36')]),'mapKey':_0xc9b2('0x25'),'message':{'from':getMails(_0x3b93cb[_0xc9b2('0x25')],_0x5add26[_0xc9b2('0x36')]),'to':_0x3b93cb[_0xc9b2('0x25')],'cc':'','subject':_0x5add26[_0xc9b2('0x37')]||'','messageId':_0x5add26[_0xc9b2('0x38')],'inReplyTo':_0x5add26[_0xc9b2('0x39')],'sentAt':moment(_0x5add26['date'])[_0xc9b2('0x2a')](_0xc9b2('0x3a')),'attach':![],'attachments':[]}};if(!_0x5add26[_0xc9b2('0x15')]&&!_0x5add26[_0xc9b2('0x22')]){var _0x2d1541=_[_0xc9b2('0x3b')](_0x5add26[_0xc9b2('0x19')],{'contentType':'application/ms-tnef'});if(_0x2d1541[_0xc9b2('0xf')]){logger['info'](util[_0xc9b2('0x2a')](_0xc9b2('0x3c'),_0x5add26['messageId']));tnef[_0xc9b2('0x3d')](_['first'](_0x2d1541)[_0xc9b2('0x2f')],function(_0x39f942,_0x5931ac){if(_0x5931ac){_0x5add26[_0xc9b2('0x15')]=_0x5931ac['BodyHTML']||_0xc9b2('0x3e');if(_0x5931ac[_0xc9b2('0x3f')]){for(var _0x5413bd=0x0;_0x5413bd<_0x5931ac[_0xc9b2('0x3f')][_0xc9b2('0xf')];_0x5413bd++){var _0x174220=_0x5931ac[_0xc9b2('0x3f')][_0x5413bd];_0x5b22fb[_0xc9b2('0x26')][_0xc9b2('0x19')][_0xc9b2('0x1b')]({'filename':_0x174220['Title'],'content':Buffer['from'](_0x174220[_0xc9b2('0x40')])});}}}_0x3541ec(parseEmail(_0x3b93cb,_0x5add26,_0x5b22fb));});}else{_0x5add26[_0xc9b2('0x15')]='

Empty\x20message

';_0x3541ec(parseEmail(_0x3b93cb,_0x5add26,_0x5b22fb));}}else{_0x3541ec(parseEmail(_0x3b93cb,_0x5add26,_0x5b22fb));}};exports[_0xc9b2('0x41')]=function(_0x186007){switch(_0x186007){case _0xc9b2('0x42'):return _0xc9b2('0x43');case'yahoo':return _0xc9b2('0x44');case _0xc9b2('0x45'):return _0xc9b2('0x46');case _0xc9b2('0x47'):return'outlook.office365.com';}return'127.0.0.1';}; \ No newline at end of file +var _0xa76e=['parser','from','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','node-tnef','email','../../../config/environment','head','address','anonymous','generate','value','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','html','replace','includes','0x1?_0x1073b0[_0xea76('0xf')](0x0,-0x1)[_0xea76('0x10')]('\x20'):_0x344005[_0xea76('0xa')];}return _0xea76('0x11');}function getLastName(_0x3fdfed){var _0x36ba46=_[_0xea76('0x5')](_0x3fdfed[_0xea76('0x9')]);if(_0x36ba46&&_0x36ba46[_0xea76('0xa')]){var _0x7fb08e=_0x36ba46['name'][_0xea76('0xd')](/\s+/);return _0x7fb08e[_0xea76('0xe')]>0x1?_0x7fb08e[_0xea76('0x12')]():'';}return'';}function getMails(_0x418f9a,_0x20e1a1){var _0x855c08='';for(var _0x3b47fa=0x0;_0x3b47fa<_0x20e1a1[_0xea76('0x9')][_0xea76('0xe')];_0x3b47fa+=0x1){if(_0x20e1a1[_0xea76('0x9')][_0x3b47fa][_0xea76('0x6')]!==_0x418f9a){if(!_[_0xea76('0x13')](_0x855c08)){_0x855c08+=',';}_0x855c08+=_0x20e1a1['value'][_0x3b47fa]['name']||_0x20e1a1[_0xea76('0x9')][_0x3b47fa]['address']||'';_0x855c08+='\x20<';_0x855c08+=_0x20e1a1[_0xea76('0x9')][_0x3b47fa][_0xea76('0x6')]?_0x20e1a1[_0xea76('0x9')][_0x3b47fa]['address']:'anonymous'+random['generate'](0x6)+_0xea76('0x14');_0x855c08+='>';}}return _0x855c08;}function parseEmail(_0x2a934e,_0x227ef9,_0x13f893){if(_0x227ef9['html']){var _0x3c0dc2=/)<[^<]*)*<\/script>/gi;while(_0x3c0dc2['test'](_0x227ef9[_0xea76('0x15')])){_0x227ef9[_0xea76('0x15')]=_0x227ef9[_0xea76('0x15')][_0xea76('0x16')](_0x3c0dc2,'');}if(_0x227ef9[_0xea76('0x15')][_0xea76('0x17')](_0xea76('0x18'))){var _0x4020b7=[];_0x227ef9[_0xea76('0x19')][_0xea76('0x1a')](_0xe82bd=>{_0x4020b7[_0xea76('0x1b')](_0xe82bd[_0xea76('0x1c')]);});var _0x44d877=/]+>/g;var _0x3fb762=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xe58cbc=_0x227ef9['html'][_0xea76('0x16')](_0x3fb762,'_SRC');var _0x5911c2=_0xe58cbc[_0xea76('0x16')](_0x44d877,_0xea76('0x1d'));for(let _0x4064b1=0x0;_0x4064b1<_0x4020b7[_0xea76('0xe')];_0x4064b1++){var _0x2bd5b2=_0x5911c2[_0xea76('0x16')](_0xea76('0x1d'),'\x20[Attachment:\x20'+_0x4020b7[_0x4064b1]+'\x20]');_0x5911c2=_0x2bd5b2;}_0x227ef9[_0xea76('0x15')]=_0x5911c2;}_0x13f893[_0xea76('0x1e')]=_0x227ef9[_0xea76('0x15')];}else{_0x13f893[_0xea76('0x1e')]=_0x227ef9[_0xea76('0x1f')];}if(_0x13f893[_0xea76('0x1e')]){_0x13f893[_0xea76('0x1e')]=_0x13f893[_0xea76('0x1e')][_0xea76('0x16')](/0x0){var _0x384e1a=[_0xea76('0x32'),_0xea76('0x33'),_0xea76('0x34')];for(var _0x46a8c4=0x0;_0x46a8c4<_0x227ef9['headerLines']['length'];_0x46a8c4++){var _0x162998=_['indexOf'](_0x384e1a,_0x227ef9['headerLines'][_0x46a8c4]['line']);if(_0x162998>=0x0){_0x13f893[_0xea76('0x35')]=!![];}}}return _0x13f893;}exports[_0xea76('0x36')]=function(_0x4212b0,_0x46ae07,_0x5551ac){var _0x3478dd={'from':getAddress(_0x46ae07[_0xea76('0x37')]),'firstName':getFirstName(_0x46ae07[_0xea76('0x37')]),'lastName':getLastName(_0x46ae07[_0xea76('0x37')]),'mapKey':'email','message':{'from':getMails(_0x4212b0[_0xea76('0x3')],_0x46ae07[_0xea76('0x37')]),'to':_0x4212b0[_0xea76('0x3')],'cc':'','subject':_0x46ae07['subject']||'','messageId':_0x46ae07['messageId'],'inReplyTo':_0x46ae07['inReplyTo'],'sentAt':moment(_0x46ae07[_0xea76('0x38')])['format'](_0xea76('0x39')),'attach':![],'attachments':[]}};if(!_0x46ae07[_0xea76('0x15')]&&!_0x46ae07['textAsHtml']){var _0x5a0879=_[_0xea76('0x3a')](_0x46ae07[_0xea76('0x19')],{'contentType':_0xea76('0x3b')});if(_0x5a0879[_0xea76('0xe')]){logger[_0xea76('0x3c')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x46ae07['messageId']));tnef['parseBuffer'](_[_0xea76('0x3d')](_0x5a0879)[_0xea76('0x2f')],function(_0x334fd1,_0x138554){if(_0x138554){_0x46ae07['html']=_0x138554[_0xea76('0x3e')]||'

Empty\x20message

';if(_0x138554[_0xea76('0x3f')]){for(var _0x1ac55d=0x0;_0x1ac55d<_0x138554['Attachments'][_0xea76('0xe')];_0x1ac55d++){var _0x59298c=_0x138554['Attachments'][_0x1ac55d];_0x3478dd[_0xea76('0x21')][_0xea76('0x19')][_0xea76('0x1b')]({'filename':_0x59298c[_0xea76('0x40')],'content':Buffer['from'](_0x59298c[_0xea76('0x41')])});}}}_0x5551ac(parseEmail(_0x4212b0,_0x46ae07,_0x3478dd));});}else{_0x46ae07['html']=_0xea76('0x42');_0x5551ac(parseEmail(_0x4212b0,_0x46ae07,_0x3478dd));}}else{_0x5551ac(parseEmail(_0x4212b0,_0x46ae07,_0x3478dd));}};exports[_0xea76('0x43')]=function(_0x586b86){switch(_0x586b86){case _0xea76('0x44'):return _0xea76('0x45');case _0xea76('0x46'):return _0xea76('0x47');case _0xea76('0x48'):return _0xea76('0x49');case _0xea76('0x4a'):return _0xea76('0x4b');}return _0xea76('0x4c');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index da33210..9a90e15 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 _0x583a=['Imap','Smtp','exports','name','Service','key','SERV','active'];(function(_0x557903,_0x2c77ba){var _0x20d1a7=function(_0x5bf2e4){while(--_0x5bf2e4){_0x557903['push'](_0x557903['shift']());}};_0x20d1a7(++_0x2c77ba);}(_0x583a,0x17b));var _0xa583=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x583a[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');function MailAccount(_0x480bb6){this['id']=_0x480bb6['id']||0x0;this[_0xa583('0x0')]=_0x480bb6['name']||_0xa583('0x1');this[_0xa583('0x2')]=_0x480bb6['key']||_0xa583('0x3');this[_0xa583('0x4')]=_0x480bb6[_0xa583('0x4')]||![];this[_0xa583('0x5')]=_0x480bb6[_0xa583('0x5')]||[];this[_0xa583('0x6')]=_0x480bb6[_0xa583('0x6')]||[];}module[_0xa583('0x7')]=MailAccount; \ No newline at end of file +var _0x4daa=['Imap','Smtp','exports','name','Service','key','SERV','active'];(function(_0x4d4b12,_0x434960){var _0x15780e=function(_0xffd37f){while(--_0xffd37f){_0x4d4b12['push'](_0x4d4b12['shift']());}};_0x15780e(++_0x434960);}(_0x4daa,0x12b));var _0xa4da=function(_0x34bff6,_0x36f01d){_0x34bff6=_0x34bff6-0x0;var _0x2704ee=_0x4daa[_0x34bff6];return _0x2704ee;};'use strict';var _=require('lodash');function MailAccount(_0x1cf8c9){this['id']=_0x1cf8c9['id']||0x0;this[_0xa4da('0x0')]=_0x1cf8c9[_0xa4da('0x0')]||_0xa4da('0x1');this[_0xa4da('0x2')]=_0x1cf8c9[_0xa4da('0x2')]||_0xa4da('0x3');this[_0xa4da('0x4')]=_0x1cf8c9[_0xa4da('0x4')]||![];this[_0xa4da('0x5')]=_0x1cf8c9[_0xa4da('0x5')]||[];this['Smtp']=_0x1cf8c9[_0xa4da('0x6')]||[];}module[_0xa4da('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index a9d53e0..efb083c 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 _0x474c=['mergeFromDatabase','hasOwnProperty','initMailAccounts','length','isUndefined','mailAccounts','lodash','../model/mailAccount','prototype'];(function(_0x391ce9,_0x855750){var _0x269c24=function(_0x166a61){while(--_0x166a61){_0x391ce9['push'](_0x391ce9['shift']());}};_0x269c24(++_0x855750);}(_0x474c,0x1d1));var _0xc474=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x474c[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xc474('0x0'));var MailAccount=require(_0xc474('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3e1792,_0x2013d9,_0x13039b){var _0x2c41b3=_['mapKeys'](_0x3e1792,function(_0x494e7d,_0x2eebdf){return _0x494e7d[_0x13039b];});for(var _0x333fdc in _0x2013d9){if(_0x2013d9['hasOwnProperty'](_0x333fdc)){if(!_0x2c41b3[_0x333fdc]){delete _0x2013d9[_0x333fdc];}}}}Realtime[_0xc474('0x2')][_0xc474('0x3')]=function(_0x14ebf1,_0x16ac9d){for(var _0x3cacc5 in _0x16ac9d){if(_0x14ebf1[_0xc474('0x4')](_0x3cacc5)){_0x14ebf1[_0x3cacc5]=_0x16ac9d[_0x3cacc5];}}};Realtime[_0xc474('0x2')][_0xc474('0x5')]=function(){var _0x192da2=this;return function(_0x446fd9){if(_0x446fd9){freeIsNotKey(_0x446fd9,_0x192da2['mailAccounts'],'id');for(var _0x1d2fac=0x0,_0x2a5ecc={},_0x40d231={};_0x1d2fac<_0x446fd9[_0xc474('0x6')];_0x1d2fac+=0x1){_0x2a5ecc=_0x446fd9[_0x1d2fac];if(_[_0xc474('0x7')](_0x192da2[_0xc474('0x8')][_0x2a5ecc['id']])){_0x192da2[_0xc474('0x8')][_0x2a5ecc['id']]=new MailAccount(_0x2a5ecc);}else{_['merge'](_0x192da2['mailAccounts'][_0x2a5ecc['id']],_0x2a5ecc);}}}return _0x192da2['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x0c5c=['initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','mergeFromDatabase','prototype'];(function(_0x315151,_0x4b989f){var _0x369b8d=function(_0x5defa8){while(--_0x5defa8){_0x315151['push'](_0x315151['shift']());}};_0x369b8d(++_0x4b989f);}(_0x0c5c,0x72));var _0xc0c5=function(_0x4f382d,_0x5e378b){_0x4f382d=_0x4f382d-0x0;var _0x383978=_0x0c5c[_0x4f382d];return _0x383978;};'use strict';var _=require(_0xc0c5('0x0'));var MailAccount=require(_0xc0c5('0x1'));var Realtime=function(){this[_0xc0c5('0x2')]={};};function freeIsNotKey(_0x54c403,_0x15bff5,_0x5f4b12){var _0x7cfa63=_['mapKeys'](_0x54c403,function(_0x19694e,_0x30a1e8){return _0x19694e[_0x5f4b12];});for(var _0x319ec4 in _0x15bff5){if(_0x15bff5[_0xc0c5('0x3')](_0x319ec4)){if(!_0x7cfa63[_0x319ec4]){delete _0x15bff5[_0x319ec4];}}}}Realtime['prototype'][_0xc0c5('0x4')]=function(_0x32d85f,_0x98d44a){for(var _0x2c2085 in _0x98d44a){if(_0x32d85f['hasOwnProperty'](_0x2c2085)){_0x32d85f[_0x2c2085]=_0x98d44a[_0x2c2085];}}};Realtime[_0xc0c5('0x5')][_0xc0c5('0x6')]=function(){var _0x340c43=this;return function(_0x352bbb){if(_0x352bbb){freeIsNotKey(_0x352bbb,_0x340c43[_0xc0c5('0x2')],'id');for(var _0x5a35f9=0x0,_0x4f3865={},_0x376bf8={};_0x5a35f9<_0x352bbb[_0xc0c5('0x7')];_0x5a35f9+=0x1){_0x4f3865=_0x352bbb[_0x5a35f9];if(_[_0xc0c5('0x8')](_0x340c43['mailAccounts'][_0x4f3865['id']])){_0x340c43['mailAccounts'][_0x4f3865['id']]=new MailAccount(_0x4f3865);}else{_['merge'](_0x340c43['mailAccounts'][_0x4f3865['id']],_0x4f3865);}}}return _0x340c43[_0xc0c5('0x2')];};};module[_0xc0c5('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 01d0b8f..5f2a1bb 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 _0x889d=['active','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email'];(function(_0x3964d8,_0x14f59e){var _0x15dfde=function(_0x5099f2){while(--_0x5099f2){_0x3964d8['push'](_0x3964d8['shift']());}};_0x15dfde(++_0x14f59e);}(_0x889d,0x179));var _0xd889=function(_0x3a3baf,_0x2bd37c){_0x3a3baf=_0x3a3baf-0x0;var _0x5266bf=_0x889d[_0x3a3baf];return _0x5266bf;};'use strict';var client=require(_0xd889('0x0'));exports[_0xd889('0x1')]=function(){return function(){return client[_0xd889('0x2')](_0xd889('0x3'),{'options':{'attributes':['id',_0xd889('0x4'),_0xd889('0x5'),_0xd889('0x6'),_0xd889('0x7'),_0xd889('0x8'),_0xd889('0x9'),_0xd889('0xa')],'raw':![],'include':[{'model':_0xd889('0xb'),'as':_0xd889('0xc')},{'model':_0xd889('0xd'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0xd889('0xe')]=function(_0x3fb4eb,_0x32932b){return client[_0xd889('0x2')](_0xd889('0xf'),{'account':{'id':_0x3fb4eb},'body':_0x32932b,'log':_0xd889('0xf')});}; \ No newline at end of file +var _0x7e1d=['NotifyMailAccount','../client','GetMailAccount','name','service','email','active','key','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify','Request'];(function(_0x1560d2,_0x35083a){var _0x5abe97=function(_0x329a15){while(--_0x329a15){_0x1560d2['push'](_0x1560d2['shift']());}};_0x5abe97(++_0x35083a);}(_0x7e1d,0x15a));var _0xd7e1=function(_0x29e0e5,_0x14423b){_0x29e0e5=_0x29e0e5-0x0;var _0x4bd3d0=_0x7e1d[_0x29e0e5];return _0x4bd3d0;};'use strict';var client=require(_0xd7e1('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xd7e1('0x1'),{'options':{'attributes':['id',_0xd7e1('0x2'),_0xd7e1('0x3'),_0xd7e1('0x4'),_0xd7e1('0x5'),_0xd7e1('0x6'),'ListId',_0xd7e1('0x7')],'raw':![],'include':[{'model':_0xd7e1('0x8'),'as':_0xd7e1('0x9')},{'model':'MailServerOut','as':_0xd7e1('0xa')}]},'log':_0xd7e1('0xb')});};};exports[_0xd7e1('0xc')]=function(_0x3bcb45,_0x158be6){return client[_0xd7e1('0xd')](_0xd7e1('0xe'),{'account':{'id':_0x3bcb45},'body':_0x158be6,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3468d56..4be9382 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 _0xb71e=['GetSettings','../client','ShowSetting'];(function(_0xd4754f,_0xdb3279){var _0x2fe296=function(_0x5c3dab){while(--_0x5c3dab){_0xd4754f['push'](_0xd4754f['shift']());}};_0x2fe296(++_0xdb3279);}(_0xb71e,0x19c));var _0xeb71=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xb71e[_0x39e84d];return _0x1991bc;};'use strict';var client=require(_0xeb71('0x0'));exports['getSettings']=function(){return client['Request'](_0xeb71('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xeb71('0x2')});}; \ No newline at end of file +var _0x5fd2=['../client','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0xf1d418,_0x2bf002){var _0x4f5866=function(_0x3e485e){while(--_0x3e485e){_0xf1d418['push'](_0xf1d418['shift']());}};_0x4f5866(++_0x2bf002);}(_0x5fd2,0x136));var _0x25fd=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5fd2[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x25fd('0x0'));exports['getSettings']=function(){return client[_0x25fd('0x1')](_0x25fd('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x25fd('0x3')]},'log':_0x25fd('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 425ab85..86d6be0 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index d4fed5e..dcfae3c 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 _0xc2bf=['express','sticky-session','ioredis','timeout','listen','socket.io','websocket','redis','defaults','adapter','../../config/triggers','default','../../config/socketio','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash'];(function(_0x52a4e9,_0x121fc6){var _0x29abff=function(_0x172009){while(--_0x172009){_0x52a4e9['push'](_0x52a4e9['shift']());}};_0x29abff(++_0x121fc6);}(_0xc2bf,0x1b4));var _0xfc2b=function(_0x341fd1,_0x55dcb8){_0x341fd1=_0x341fd1-0x0;var _0x1a9391=_0xc2bf[_0x341fd1];return _0x1a9391;};'use strict';var _=require(_0xfc2b('0x0'));var http=require('http');var express=require(_0xfc2b('0x1'));var sticky=require(_0xfc2b('0x2'));var Redis=require(_0xfc2b('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xfc2b('0x4')]=0xdbba0;if(sticky[_0xfc2b('0x5')](server,config['port'])){var socketio=require(_0xfc2b('0x6'))(server,{'transports':[_0xfc2b('0x7'),'polling']});config[_0xfc2b('0x8')]=_[_0xfc2b('0x9')](config[_0xfc2b('0x8')],{'host':'localhost','port':0x18eb});socketio[_0xfc2b('0xa')](require('socket.io-redis')({'pubClient':new Redis(config[_0xfc2b('0x8')]),'subClient':new Redis(config['redis'])}));require(_0xfc2b('0xb'))[_0xfc2b('0xc')]();require(_0xfc2b('0xd'))[_0xfc2b('0xc')](socketio);require('../../config/express')[_0xfc2b('0xc')](app);require('../../routes')['default'](app);}else{server[_0xfc2b('0xe')](_0xfc2b('0xf'),function(){console[_0xfc2b('0x10')](_0xfc2b('0x11'),config[_0xfc2b('0x12')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x3c85=['adapter','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','polling','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c85,0x1ef));var _0x53c8=function(_0x4f5691,_0x4face4){_0x4f5691=_0x4f5691-0x0;var _0x1a390f=_0x3c85[_0x4f5691];return _0x1a390f;};'use strict';var _=require(_0x53c8('0x0'));var http=require(_0x53c8('0x1'));var express=require(_0x53c8('0x2'));var sticky=require(_0x53c8('0x3'));var Redis=require(_0x53c8('0x4'));var config=require(_0x53c8('0x5'));var app=express();var server=http[_0x53c8('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x53c8('0x7')](server,config[_0x53c8('0x8')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x53c8('0x9')]});config['redis']=_['defaults'](config['redis'],{'host':_0x53c8('0xa'),'port':0x18eb});socketio[_0x53c8('0xb')](require(_0x53c8('0xc'))({'pubClient':new Redis(config[_0x53c8('0xd')]),'subClient':new Redis(config[_0x53c8('0xd')])}));require(_0x53c8('0xe'))[_0x53c8('0xf')]();require(_0x53c8('0x10'))['default'](socketio);require(_0x53c8('0x11'))[_0x53c8('0xf')](app);require('../../routes')[_0x53c8('0xf')](app);}else{server[_0x53c8('0x12')](_0x53c8('0x13'),function(){console[_0x53c8('0x14')](_0x53c8('0x15'),config[_0x53c8('0x8')]);});}exports=module[_0x53c8('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 4f881ad..1e7be7e 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 _0xca94=['jayson/promise','bluebird','http','Request','then','debug','rpc','routing','error','message','result'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xca94,0xe7));var _0x4ca9=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xca94[_0xd578cb];return _0x775533;};'use strict';var jayson=require(_0x4ca9('0x0'));var BPromise=require(_0x4ca9('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client'][_0x4ca9('0x2')]({'port':0x2329});client[_0x4ca9('0x3')]=function(_0x3574e0,_0x5bf9fc){return new BPromise(function(_0xac3bd2,_0x795b27){return client['request'](_0x3574e0,_0x5bf9fc)[_0x4ca9('0x4')](function(_0x232f06){logger[_0x4ca9('0x5')](_0x4ca9('0x6'),_0x4ca9('0x7'),_0x3574e0,_0x5bf9fc,_0x232f06);if(_0x232f06[_0x4ca9('0x8')]){logger[_0x4ca9('0x8')]('rpc',_0x4ca9('0x7'),_0x3574e0,_0x232f06[_0x4ca9('0x8')]['message'],_0x5bf9fc);return _0x795b27(_0x232f06[_0x4ca9('0x8')][_0x4ca9('0x9')]);}else{return _0xac3bd2(_0x232f06[_0x4ca9('0xa')]);}})['catch'](function(_0x1b1c1d){logger[_0x4ca9('0x8')](_0x4ca9('0x6'),_0x4ca9('0x7'),_0x3574e0,_0x1b1c1d,_0x5bf9fc);return _0x795b27(_0x1b1c1d);});});};module['exports']=client; \ No newline at end of file +var _0xd508=['../../config/logger','routing','http','Request','request','then','debug','rpc','error','result','exports','jayson/promise','bluebird'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xd508,0x1df));var _0x8d50=function(_0x4c86da,_0x473bbd){_0x4c86da=_0x4c86da-0x0;var _0x436886=_0xd508[_0x4c86da];return _0x436886;};'use strict';var jayson=require(_0x8d50('0x0'));var BPromise=require(_0x8d50('0x1'));var logger=require(_0x8d50('0x2'))(_0x8d50('0x3'));var client=jayson['client'][_0x8d50('0x4')]({'port':0x2329});client[_0x8d50('0x5')]=function(_0x390c73,_0x4d903a){return new BPromise(function(_0x1589e,_0x3e6b46){return client[_0x8d50('0x6')](_0x390c73,_0x4d903a)[_0x8d50('0x7')](function(_0x18397f){logger[_0x8d50('0x8')](_0x8d50('0x9'),_0x8d50('0x3'),_0x390c73,_0x4d903a,_0x18397f);if(_0x18397f['error']){logger[_0x8d50('0xa')]('rpc',_0x8d50('0x3'),_0x390c73,_0x18397f[_0x8d50('0xa')]['message'],_0x4d903a);return _0x3e6b46(_0x18397f[_0x8d50('0xa')]['message']);}else{return _0x1589e(_0x18397f[_0x8d50('0xb')]);}})['catch'](function(_0x308285){logger[_0x8d50('0xa')](_0x8d50('0x9'),_0x8d50('0x3'),_0x390c73,_0x308285,_0x4d903a);return _0x3e6b46(_0x308285);});});};module[_0x8d50('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index f80dce4..35c6ce6 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 _0x88c5=['resolve','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x88c5,0xc2));var _0x588c=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x88c5[_0x845505];return _0x2513b9;};'use strict';var BPromise=require('bluebird');var server=require(_0x588c('0x0'));var Realtime=require(_0x588c('0x1'));var user=require(_0x588c('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x588c('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x588c('0x4'));var whatsappQueue=require(_0x588c('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x588c('0x6')]()[_0x588c('0x7')](user['getAgents']())[_0x588c('0x7')](realtime['initAgents']())[_0x588c('0x7')](interval[_0x588c('0x8')]())[_0x588c('0x7')](realtime[_0x588c('0x9')]())[_0x588c('0x7')](openchannelQueue[_0x588c('0xa')]())[_0x588c('0x7')](realtime[_0x588c('0xb')]())['then'](chatQueue[_0x588c('0xc')]())[_0x588c('0x7')](realtime[_0x588c('0xd')]())[_0x588c('0x7')](smsQueue[_0x588c('0xe')]())[_0x588c('0x7')](realtime[_0x588c('0xf')]())[_0x588c('0x7')](mailQueue['getMailQueues']())[_0x588c('0x7')](realtime[_0x588c('0x10')]())[_0x588c('0x7')](faxQueue['getFaxQueues']())[_0x588c('0x7')](realtime[_0x588c('0x11')]())[_0x588c('0x7')](whatsappQueue[_0x588c('0x12')]())['then'](realtime[_0x588c('0x13')]())[_0x588c('0x7')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x588c('0x7')](function(_0x47f6a0){return initRealtime();})[_0x588c('0x7')](function(_0x7ddfba){return setInterval(initRealtime,0x1388);})['catch'](function(_0x507149){console['log'](_0x507149);});}main(); \ No newline at end of file +var _0x693a=['getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues'];(function(_0x455168,_0x39b7bd){var _0x53a0b6=function(_0xbe8026){while(--_0xbe8026){_0x455168['push'](_0x455168['shift']());}};_0x53a0b6(++_0x39b7bd);}(_0x693a,0x17e));var _0xa693=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x693a[_0x4ed520];return _0x4415a6;};'use strict';var BPromise=require(_0xa693('0x0'));var server=require(_0xa693('0x1'));var Realtime=require(_0xa693('0x2'));var user=require(_0xa693('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xa693('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xa693('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xa693('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa693('0x7')]()[_0xa693('0x8')](user[_0xa693('0x9')]())['then'](realtime[_0xa693('0xa')]())['then'](interval[_0xa693('0xb')]())[_0xa693('0x8')](realtime['initIntervals']())[_0xa693('0x8')](openchannelQueue[_0xa693('0xc')]())[_0xa693('0x8')](realtime[_0xa693('0xd')]())[_0xa693('0x8')](chatQueue[_0xa693('0xe')]())[_0xa693('0x8')](realtime[_0xa693('0xf')]())['then'](smsQueue['getSmsQueues']())[_0xa693('0x8')](realtime['initSmsQueues']())['then'](mailQueue[_0xa693('0x10')]())[_0xa693('0x8')](realtime[_0xa693('0x11')]())['then'](faxQueue[_0xa693('0x12')]())[_0xa693('0x8')](realtime[_0xa693('0x13')]())[_0xa693('0x8')](whatsappQueue[_0xa693('0x14')]())[_0xa693('0x8')](realtime[_0xa693('0x15')]())[_0xa693('0x8')](function(){return realtime;});}function main(){return server[_0xa693('0x16')](realtime)[_0xa693('0x8')](function(_0x415108){return initRealtime();})[_0xa693('0x8')](function(_0x538702){return setInterval(initRealtime,0x1388);})[_0xa693('0x17')](function(_0x1c994a){console[_0xa693('0x18')](_0x1c994a);});}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 073a811..9d4aaa6 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 _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x2a441b,_0x464d25){var _0x167746=function(_0x978066){while(--_0x978066){_0x2a441b['push'](_0x2a441b['shift']());}};_0x167746(++_0x464d25);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0x1261[_0x4f08dd];return _0x3017ee;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9b625fa..135248e 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 _0x4da1=['request','then','error','message','catch','SendMail','bluebird','jayson/promise','client','http'];(function(_0x10ced3,_0x3fdfb4){var _0x1d325e=function(_0x2f580c){while(--_0x2f580c){_0x10ced3['push'](_0x10ced3['shift']());}};_0x1d325e(++_0x3fdfb4);}(_0x4da1,0x6a));var _0x14da=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4da1[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x14da('0x0'));var jayson=require(_0x14da('0x1'));var client=jayson[_0x14da('0x2')][_0x14da('0x3')]({'port':0x232b});function request(_0x1c9d6c,_0x20764e){return new BPromise(function(_0x2babde,_0x376d6f){return client[_0x14da('0x4')](_0x1c9d6c,_0x20764e)[_0x14da('0x5')](function(_0x331413){if(_0x331413['error']){return _0x376d6f(_0x331413[_0x14da('0x6')][_0x14da('0x7')]);}else{return _0x2babde(_0x331413['result']);}})[_0x14da('0x8')](function(_0x2499b6){return _0x376d6f(_0x2499b6);});});}exports['sendMailMessage']=function(_0x1fe8dd,_0x1c69fb){return request(_0x14da('0x9'),{'account':_0x1fe8dd,'message':_0x1c69fb});}; \ No newline at end of file +var _0x8fa7=['client','http','request','then','error','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0xda2c13,_0x6c1ba1){var _0x15a52b=function(_0x4f3665){while(--_0x4f3665){_0xda2c13['push'](_0xda2c13['shift']());}};_0x15a52b(++_0x6c1ba1);}(_0x8fa7,0x1d4));var _0x78fa=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x8fa7[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x78fa('0x0'));var jayson=require(_0x78fa('0x1'));var client=jayson[_0x78fa('0x2')][_0x78fa('0x3')]({'port':0x232b});function request(_0x3a0d6e,_0x2a1b37){return new BPromise(function(_0x425997,_0x37a77c){return client[_0x78fa('0x4')](_0x3a0d6e,_0x2a1b37)[_0x78fa('0x5')](function(_0x59e7aa){if(_0x59e7aa[_0x78fa('0x6')]){return _0x37a77c(_0x59e7aa[_0x78fa('0x6')]['message']);}else{return _0x425997(_0x59e7aa[_0x78fa('0x7')]);}})[_0x78fa('0x8')](function(_0x56e1f0){return _0x37a77c(_0x56e1f0);});});}exports[_0x78fa('0x9')]=function(_0x541a8f,_0x309787){return request('SendMail',{'account':_0x541a8f,'message':_0x309787});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index d7cac8c..6b103a9 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 _0x93cc=['smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','sms','getChannelStatus','Status','format','chatCapacity','openchannelStatus','openchannelStatusTime','stringify','emit','user:save','exports','lodash','moment','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x93cc,0x90));var _0xc93c=function(_0x1c2858,_0x4cda79){_0x1c2858=_0x1c2858-0x0;var _0x52b4c9=_0x93cc[_0x1c2858];return _0x52b4c9;};'use strict';var _=require(_0xc93c('0x0'));var moment=require(_0xc93c('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xc93c('0x2'));config[_0xc93c('0x3')]=_[_0xc93c('0x4')](config[_0xc93c('0x3')],{'host':_0xc93c('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x58fc8c){this['id']=_0x58fc8c['id']||0x0;this[_0xc93c('0x6')]=_0x58fc8c[_0xc93c('0x6')]||'';this[_0xc93c('0x7')]=_0x58fc8c[_0xc93c('0x7')]||!![];this[_0xc93c('0x8')]=_0x58fc8c[_0xc93c('0x8')]||![];this[_0xc93c('0x9')]=_0x58fc8c[_0xc93c('0x9')]||![];this[_0xc93c('0xa')]=_0x58fc8c['mailPause']||![];this['faxPause']=_0x58fc8c[_0xc93c('0xb')]||![];this[_0xc93c('0xc')]=_0x58fc8c['smsPause']||![];this['openchannelPause']=_0x58fc8c[_0xc93c('0xd')]||![];this[_0xc93c('0xe')]=_0xc93c('0xf');this[_0xc93c('0x10')]=0x0;this['chatCapacity']=_0x58fc8c['chatCapacity']||0x0;this[_0xc93c('0x11')]=0x0;this[_0xc93c('0x12')]=_0xc93c('0xf');this['mailStatusTime']=0x0;this[_0xc93c('0x13')]=_0x58fc8c['mailCapacity']||0x0;this[_0xc93c('0x14')]=0x0;this['faxStatus']=_0xc93c('0xf');this[_0xc93c('0x15')]=0x0;this[_0xc93c('0x16')]=_0x58fc8c['faxCapacity']||0x0;this[_0xc93c('0x17')]=0x0;this[_0xc93c('0x18')]=_0xc93c('0xf');this[_0xc93c('0x19')]=0x0;this[_0xc93c('0x1a')]=_0x58fc8c[_0xc93c('0x1a')]||0x0;this[_0xc93c('0x1b')]=0x0;this[_0xc93c('0x1c')]=_0xc93c('0xf');this[_0xc93c('0x1d')]=0x0;this[_0xc93c('0x1e')]=_0x58fc8c[_0xc93c('0x1e')]||0x0;this[_0xc93c('0x1f')]=0x0;this['openchannelStatus']='unknown';this['openchannelStatusTime']=0x0;this[_0xc93c('0x20')]=_0x58fc8c[_0xc93c('0x20')]||0x0;this[_0xc93c('0x21')]=0x0;this[_0xc93c('0x22')]=![];this[_0xc93c('0x23')]=undefined;this['md5']='';this[_0xc93c('0x24')]();}Agent[_0xc93c('0x25')]['getChannelStatus']=function(_0x1be8cc){if(this[_0x1be8cc+_0xc93c('0x26')]>0x0){if(this[_0x1be8cc+_0xc93c('0x27')]>0x0&&this[_0x1be8cc+'CurrentCapacity']>=this[_0x1be8cc+_0xc93c('0x27')]){return _0xc93c('0x28');}else{return _0xc93c('0x29');}}else{return _0xc93c('0x2a');}};Agent[_0xc93c('0x25')]['updateRealtime']=function(){var _0x1a0be0=[_0xc93c('0x2b'),'chat',_0xc93c('0x2c'),'fax',_0xc93c('0x2d'),'whatsapp'];for(var _0x52abed=0x0;_0x52abed<_0x1a0be0['length'];_0x52abed+=0x1){var _0x503271=this[_0xc93c('0x2e')](_0x1a0be0[_0x52abed]);if(this[_0x1a0be0[_0x52abed]+_0xc93c('0x2f')]!==_0x503271){this[_0x1a0be0[_0x52abed]+'StatusTime']=_['toNumber'](moment()[_0xc93c('0x30')]('x'));}this[_0x1a0be0[_0x52abed]+_0xc93c('0x2f')]=_0x503271;}var _0x1563af={'id':this['id'],'name':this[_0xc93c('0x6')],'online':this[_0xc93c('0x7')],'voicePause':this[_0xc93c('0x8')],'chatPause':this[_0xc93c('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xc93c('0xc')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xc93c('0xe')],'chatStatusTime':this[_0xc93c('0x10')],'chatCapacity':this[_0xc93c('0x31')],'chatCurrentCapacity':this[_0xc93c('0x11')],'mailStatus':this[_0xc93c('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xc93c('0x14')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xc93c('0x15')],'faxCapacity':this[_0xc93c('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xc93c('0x18')],'smsStatusTime':this[_0xc93c('0x19')],'smsCapacity':this[_0xc93c('0x1a')],'smsCurrentCapacity':this[_0xc93c('0x1b')],'whatsappStatus':this[_0xc93c('0x1c')],'whatsappStatusTime':this[_0xc93c('0x1d')],'whatsappCapacity':this[_0xc93c('0x1e')],'whatsappCurrentCapacity':this[_0xc93c('0x1f')],'openchannelStatus':this[_0xc93c('0x32')],'openchannelStatusTime':this[_0xc93c('0x33')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xc93c('0x21')],'busy':this[_0xc93c('0x22')],'busyQueue':this[_0xc93c('0x23')]};var _0x4619c2=md5(JSON[_0xc93c('0x34')](_0x1563af));if(this['md5']!==_0x4619c2){this['md5']=_0x4619c2;io[_0xc93c('0x35')](_0xc93c('0x36'),_0x1563af);}};module[_0xc93c('0x37')]=Agent; \ No newline at end of file +var _0x6e5e=['moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','updateRealtime','chat','openchannel','fax','sms','Status','StatusTime','toNumber','format','mailStatusTime','faxCurrentCapacity','whatsappStatus','openchannelCurrentCapacity','stringify','emit','user:save','exports','lodash'];(function(_0x1c148a,_0x540f99){var _0x1bff5f=function(_0x545bd0){while(--_0x545bd0){_0x1c148a['push'](_0x1c148a['shift']());}};_0x1bff5f(++_0x540f99);}(_0x6e5e,0x1aa));var _0xe6e5=function(_0x577636,_0x1eb750){_0x577636=_0x577636-0x0;var _0x5617d9=_0x6e5e[_0x577636];return _0x5617d9;};'use strict';var _=require(_0xe6e5('0x0'));var moment=require(_0xe6e5('0x1'));var md5=require('md5');var Redis=require(_0xe6e5('0x2'));var config=require(_0xe6e5('0x3'));config[_0xe6e5('0x4')]=_['defaults'](config[_0xe6e5('0x4')],{'host':_0xe6e5('0x5'),'port':0x18eb});var io=require(_0xe6e5('0x6'))(new Redis(config[_0xe6e5('0x4')]));function Agent(_0x1619ed){this['id']=_0x1619ed['id']||0x0;this['name']=_0x1619ed[_0xe6e5('0x7')]||'';this['online']=_0x1619ed[_0xe6e5('0x8')]||!![];this[_0xe6e5('0x9')]=_0x1619ed[_0xe6e5('0x9')]||![];this[_0xe6e5('0xa')]=_0x1619ed[_0xe6e5('0xa')]||![];this[_0xe6e5('0xb')]=_0x1619ed[_0xe6e5('0xb')]||![];this[_0xe6e5('0xc')]=_0x1619ed['faxPause']||![];this['smsPause']=_0x1619ed[_0xe6e5('0xd')]||![];this[_0xe6e5('0xe')]=_0x1619ed[_0xe6e5('0xe')]||![];this[_0xe6e5('0xf')]=_0xe6e5('0x10');this[_0xe6e5('0x11')]=0x0;this[_0xe6e5('0x12')]=_0x1619ed[_0xe6e5('0x12')]||0x0;this[_0xe6e5('0x13')]=0x0;this['mailStatus']=_0xe6e5('0x10');this['mailStatusTime']=0x0;this[_0xe6e5('0x14')]=_0x1619ed[_0xe6e5('0x14')]||0x0;this[_0xe6e5('0x15')]=0x0;this[_0xe6e5('0x16')]=_0xe6e5('0x10');this[_0xe6e5('0x17')]=0x0;this[_0xe6e5('0x18')]=_0x1619ed[_0xe6e5('0x18')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xe6e5('0x19')]=_0xe6e5('0x10');this[_0xe6e5('0x1a')]=0x0;this[_0xe6e5('0x1b')]=_0x1619ed[_0xe6e5('0x1b')]||0x0;this[_0xe6e5('0x1c')]=0x0;this['whatsappStatus']='unknown';this[_0xe6e5('0x1d')]=0x0;this['whatsappCapacity']=_0x1619ed[_0xe6e5('0x1e')]||0x0;this[_0xe6e5('0x1f')]=0x0;this[_0xe6e5('0x20')]=_0xe6e5('0x10');this[_0xe6e5('0x21')]=0x0;this[_0xe6e5('0x22')]=_0x1619ed[_0xe6e5('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xe6e5('0x23')]=![];this[_0xe6e5('0x24')]=undefined;this[_0xe6e5('0x25')]='';this['updateRealtime']();}Agent[_0xe6e5('0x26')][_0xe6e5('0x27')]=function(_0x68b882){if(this[_0x68b882+_0xe6e5('0x28')]>0x0){if(this[_0x68b882+_0xe6e5('0x29')]>0x0&&this[_0x68b882+_0xe6e5('0x28')]>=this[_0x68b882+_0xe6e5('0x29')]){return _0xe6e5('0x2a');}else{return'working';}}else{return _0xe6e5('0x2b');}};Agent[_0xe6e5('0x26')][_0xe6e5('0x2c')]=function(){var _0x2a5f8c=['mail',_0xe6e5('0x2d'),_0xe6e5('0x2e'),_0xe6e5('0x2f'),_0xe6e5('0x30'),'whatsapp'];for(var _0x47710b=0x0;_0x47710b<_0x2a5f8c['length'];_0x47710b+=0x1){var _0xc2ec6d=this[_0xe6e5('0x27')](_0x2a5f8c[_0x47710b]);if(this[_0x2a5f8c[_0x47710b]+_0xe6e5('0x31')]!==_0xc2ec6d){this[_0x2a5f8c[_0x47710b]+_0xe6e5('0x32')]=_[_0xe6e5('0x33')](moment()[_0xe6e5('0x34')]('x'));}this[_0x2a5f8c[_0x47710b]+_0xe6e5('0x31')]=_0xc2ec6d;}var _0x24740c={'id':this['id'],'name':this[_0xe6e5('0x7')],'online':this[_0xe6e5('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0xe6e5('0xa')],'mailPause':this[_0xe6e5('0xb')],'smsPause':this[_0xe6e5('0xd')],'faxPause':this[_0xe6e5('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xe6e5('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xe6e5('0x35')],'mailCapacity':this[_0xe6e5('0x14')],'mailCurrentCapacity':this[_0xe6e5('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xe6e5('0x17')],'faxCapacity':this[_0xe6e5('0x18')],'faxCurrentCapacity':this[_0xe6e5('0x36')],'smsStatus':this[_0xe6e5('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xe6e5('0x1b')],'smsCurrentCapacity':this[_0xe6e5('0x1c')],'whatsappStatus':this[_0xe6e5('0x37')],'whatsappStatusTime':this[_0xe6e5('0x1d')],'whatsappCapacity':this[_0xe6e5('0x1e')],'whatsappCurrentCapacity':this[_0xe6e5('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xe6e5('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xe6e5('0x38')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x229e67=md5(JSON[_0xe6e5('0x39')](_0x24740c));if(this[_0xe6e5('0x25')]!==_0x229e67){this[_0xe6e5('0x25')]=_0x229e67;io[_0xe6e5('0x3a')](_0xe6e5('0x3b'),_0x24740c);}};module[_0xe6e5('0x3c')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 56f060a..221554e 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 _0x3856=['emit','chat_queue:save','exports','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','paused','length','online','chatPause','available','stringify','format','chat:queue:%s'];(function(_0x3376bd,_0x4fdb2a){var _0x587b0b=function(_0x2a7006){while(--_0x2a7006){_0x3376bd['push'](_0x3376bd['shift']());}};_0x587b0b(++_0x4fdb2a);}(_0x3856,0x13b));var _0x6385=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x3856[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var md5=require(_0x6385('0x0'));var util=require(_0x6385('0x1'));var Redis=require('ioredis');var config=require(_0x6385('0x2'));config[_0x6385('0x3')]=_[_0x6385('0x4')](config[_0x6385('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x6385('0x5'))(new Redis(config[_0x6385('0x3')]));function ChatQueue(_0x2e73cb){this['id']=_0x2e73cb['id']||0x0;this[_0x6385('0x6')]=_0x2e73cb[_0x6385('0x6')]||'';this['timeout']=_0x2e73cb[_0x6385('0x7')]||0xa;this[_0x6385('0x8')]=_0x2e73cb[_0x6385('0x8')]||'beepall';this[_0x6385('0x9')]=_0x2e73cb[_0x6385('0x9')];this[_0x6385('0xa')]={};this['waiting']=0x0;this[_0x6385('0x0')]='';this[_0x6385('0xb')]();this[_0x6385('0xc')]();}ChatQueue[_0x6385('0xd')][_0x6385('0xb')]=function(){var _0x1e086b=this[_0x6385('0xa')][_0x6385('0xe')];this[_0x6385('0xa')]=_['map'](this[_0x6385('0x9')],'id');this[_0x6385('0xa')][_0x6385('0xe')]=_0x1e086b;};ChatQueue[_0x6385('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x6385('0xf')]=0x0;for(var _0x5c6d4d=0x0;_0x5c6d4d=0x0?this[_0x6385('0x13')]:0x0;var _0x377c61={'id':this['id'],'available':this[_0x6385('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x6385('0x6')],'paused':this[_0x6385('0xf')],'waiting':this['waiting']};var _0x240510=md5(JSON[_0x6385('0x14')](_0x377c61));if(this[_0x6385('0x0')]!==_0x240510){this[_0x6385('0x0')]=_0x240510;io['to'](util[_0x6385('0x15')](_0x6385('0x16'),_0x377c61[_0x6385('0x6')]))[_0x6385('0x17')](_0x6385('0x18'),_0x377c61);}};module[_0x6385('0x19')]=ChatQueue; \ No newline at end of file +var _0x5aea=['waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','chatPause','available','paused','stringify','format','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x345a02,_0x4b6173){var _0x3dd023=function(_0x4ee763){while(--_0x4ee763){_0x345a02['push'](_0x345a02['shift']());}};_0x3dd023(++_0x4b6173);}(_0x5aea,0xbd));var _0xa5ae=function(_0x88936b,_0xe8d69f){_0x88936b=_0x88936b-0x0;var _0x26cab9=_0x5aea[_0x88936b];return _0x26cab9;};'use strict';var _=require('lodash');var md5=require(_0xa5ae('0x0'));var util=require(_0xa5ae('0x1'));var Redis=require(_0xa5ae('0x2'));var config=require(_0xa5ae('0x3'));config[_0xa5ae('0x4')]=_[_0xa5ae('0x5')](config[_0xa5ae('0x4')],{'host':_0xa5ae('0x6'),'port':0x18eb});var io=require(_0xa5ae('0x7'))(new Redis(config[_0xa5ae('0x4')]));function ChatQueue(_0x5929cd){this['id']=_0x5929cd['id']||0x0;this[_0xa5ae('0x8')]=_0x5929cd['name']||'';this[_0xa5ae('0x9')]=_0x5929cd[_0xa5ae('0x9')]||0xa;this[_0xa5ae('0xa')]=_0x5929cd[_0xa5ae('0xa')]||_0xa5ae('0xb');this[_0xa5ae('0xc')]=_0x5929cd[_0xa5ae('0xc')];this[_0xa5ae('0xd')]={};this[_0xa5ae('0xe')]=0x0;this[_0xa5ae('0x0')]='';this[_0xa5ae('0xf')]();this[_0xa5ae('0x10')]();}ChatQueue[_0xa5ae('0x11')][_0xa5ae('0xf')]=function(){var _0x12ac64=this[_0xa5ae('0xd')][_0xa5ae('0x12')];this[_0xa5ae('0xd')]=_['map'](this[_0xa5ae('0xc')],'id');this[_0xa5ae('0xd')][_0xa5ae('0x12')]=_0x12ac64;};ChatQueue[_0xa5ae('0x11')][_0xa5ae('0x10')]=function(){this[_0xa5ae('0x13')]=0x0;this['paused']=0x0;for(var _0x24de0e=0x0;_0x24de0e=0x0?this[_0xa5ae('0x17')]:0x0;var _0x3ef362={'id':this['id'],'available':this[_0xa5ae('0x17')],'loggedIn':this[_0xa5ae('0x13')],'name':this[_0xa5ae('0x8')],'paused':this[_0xa5ae('0x18')],'waiting':this[_0xa5ae('0xe')]};var _0x573cc5=md5(JSON[_0xa5ae('0x19')](_0x3ef362));if(this['md5']!==_0x573cc5){this[_0xa5ae('0x0')]=_0x573cc5;io['to'](util[_0xa5ae('0x1a')]('chat:queue:%s',_0x3ef362['name']))['emit'](_0xa5ae('0x1b'),_0x3ef362);}};module[_0xa5ae('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 63834cd..636bf5d 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 _0xc67a=['redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','available','stringify','format','fax_queue:save','exports','lodash','md5','ioredis','defaults'];(function(_0x365597,_0x5008b0){var _0x3fed19=function(_0x529b22){while(--_0x529b22){_0x365597['push'](_0x365597['shift']());}};_0x3fed19(++_0x5008b0);}(_0xc67a,0xcb));var _0xac67=function(_0x32ad88,_0x21d047){_0x32ad88=_0x32ad88-0x0;var _0x1e1820=_0xc67a[_0x32ad88];return _0x1e1820;};'use strict';var _=require(_0xac67('0x0'));var md5=require(_0xac67('0x1'));var util=require('util');var Redis=require(_0xac67('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xac67('0x3')](config[_0xac67('0x4')],{'host':_0xac67('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xac67('0x4')]));function FaxQueue(_0x5d32ac){this['id']=_0x5d32ac['id']||0x0;this[_0xac67('0x6')]=_0x5d32ac['name']||'';this['timeout']=_0x5d32ac[_0xac67('0x7')]||0xa;this[_0xac67('0x8')]=_0x5d32ac[_0xac67('0x8')]||_0xac67('0x9');this[_0xac67('0xa')]=_0x5d32ac[_0xac67('0xa')];this[_0xac67('0xb')]={};this[_0xac67('0xc')]=0x0;this['md5']='';this[_0xac67('0xd')]();this[_0xac67('0xe')]();}FaxQueue[_0xac67('0xf')][_0xac67('0xd')]=function(){var _0x18032f=this[_0xac67('0xb')][_0xac67('0x10')];this[_0xac67('0xb')]=_['map'](this[_0xac67('0xa')],'id');this[_0xac67('0xb')][_0xac67('0x10')]=_0x18032f;};FaxQueue['prototype'][_0xac67('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x807a36=0x0;_0x807a36=0x0?this[_0xac67('0x12')]:0x0;var _0x368f7d={'id':this['id'],'available':this[_0xac67('0x12')],'loggedIn':this[_0xac67('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xac67('0xc')]};var _0xab246b=md5(JSON[_0xac67('0x13')](_0x368f7d));if(this[_0xac67('0x1')]!==_0xab246b){this[_0xac67('0x1')]=_0xab246b;io['to'](util[_0xac67('0x14')]('fax:queue:%s',_0x368f7d[_0xac67('0x6')]))['emit'](_0xac67('0x15'),_0x368f7d);}};module[_0xac67('0x16')]=FaxQueue; \ No newline at end of file +var _0x7586=['fax:queue:%s','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','prototype','_rr','map','loggedIn','paused','available','name','waiting','stringify','format'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x7586,0x151));var _0x6758=function(_0x2b8ef1,_0x28380f){_0x2b8ef1=_0x2b8ef1-0x0;var _0x262f55=_0x7586[_0x2b8ef1];return _0x262f55;};'use strict';var _=require(_0x6758('0x0'));var md5=require(_0x6758('0x1'));var util=require('util');var Redis=require(_0x6758('0x2'));var config=require(_0x6758('0x3'));config[_0x6758('0x4')]=_[_0x6758('0x5')](config[_0x6758('0x4')],{'host':_0x6758('0x6'),'port':0x18eb});var io=require(_0x6758('0x7'))(new Redis(config['redis']));function FaxQueue(_0x264cde){this['id']=_0x264cde['id']||0x0;this['name']=_0x264cde['name']||'';this[_0x6758('0x8')]=_0x264cde[_0x6758('0x8')]||0xa;this[_0x6758('0x9')]=_0x264cde[_0x6758('0x9')]||_0x6758('0xa');this['Agents']=_0x264cde[_0x6758('0xb')];this[_0x6758('0xc')]={};this['waiting']=0x0;this[_0x6758('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x6758('0xd')]['updateRouting']=function(){var _0x36c4dd=this[_0x6758('0xc')][_0x6758('0xe')];this['mapAgentsId']=_[_0x6758('0xf')](this[_0x6758('0xb')],'id');this['mapAgentsId'][_0x6758('0xe')]=_0x36c4dd;};FaxQueue[_0x6758('0xd')]['updateRealtime']=function(){this[_0x6758('0x10')]=0x0;this[_0x6758('0x11')]=0x0;for(var _0x5e1e04=0x0;_0x5e1e04=0x0?this[_0x6758('0x12')]:0x0;var _0x541cd9={'id':this['id'],'available':this[_0x6758('0x12')],'loggedIn':this[_0x6758('0x10')],'name':this[_0x6758('0x13')],'paused':this['paused'],'waiting':this[_0x6758('0x14')]};var _0x510678=md5(JSON[_0x6758('0x15')](_0x541cd9));if(this['md5']!==_0x510678){this[_0x6758('0x1')]=_0x510678;io['to'](util[_0x6758('0x16')](_0x6758('0x17'),_0x541cd9[_0x6758('0x13')]))['emit']('fax_queue:save',_0x541cd9);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c6b945b..0baa5ca 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 _0x6297=['Intervals','exports','name'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x6297,0x74));var _0x7629=function(_0x1c38e6,_0x4784d9){_0x1c38e6=_0x1c38e6-0x0;var _0x5a9651=_0x6297[_0x1c38e6];return _0x5a9651;};'use strict';function Interval(_0x37a20e){this['id']=_0x37a20e['id']||0x0;this[_0x7629('0x0')]=_0x37a20e['name']||'';this[_0x7629('0x1')]=_0x37a20e[_0x7629('0x1')]||{};}module[_0x7629('0x2')]=Interval; \ No newline at end of file +var _0xa55d=['Intervals','name'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0xa55d,0x1e3));var _0xda55=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa55d[_0x397e5f];return _0x5302b8;};'use strict';function Interval(_0x4029b5){this['id']=_0x4029b5['id']||0x0;this[_0xda55('0x0')]=_0x4029b5[_0xda55('0x0')]||'';this[_0xda55('0x1')]=_0x4029b5[_0xda55('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index e939c10..dedc7bc 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 _0xd3ad=['loggedIn','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0xd3ad,0x85));var _0xdd3a=function(_0x307822,_0x299d52){_0x307822=_0x307822-0x0;var _0x4f0577=_0xd3ad[_0x307822];return _0x4f0577;};'use strict';var _=require(_0xdd3a('0x0'));var md5=require(_0xdd3a('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xdd3a('0x2'));config[_0xdd3a('0x3')]=_[_0xdd3a('0x4')](config[_0xdd3a('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x4e508c){this['id']=_0x4e508c['id']||0x0;this[_0xdd3a('0x5')]=_0x4e508c['name']||'';this['timeout']=_0x4e508c[_0xdd3a('0x6')]||0xa;this[_0xdd3a('0x7')]=_0x4e508c[_0xdd3a('0x7')]||_0xdd3a('0x8');this[_0xdd3a('0x9')]=_0x4e508c['Agents'];this[_0xdd3a('0xa')]={};this[_0xdd3a('0xb')]=0x0;this[_0xdd3a('0x1')]='';this[_0xdd3a('0xc')]();this[_0xdd3a('0xd')]();}MailQueue[_0xdd3a('0xe')]['updateRouting']=function(){var _0x4cd84c=this[_0xdd3a('0xa')][_0xdd3a('0xf')];this['mapAgentsId']=_[_0xdd3a('0x10')](this['Agents'],'id');this[_0xdd3a('0xa')][_0xdd3a('0xf')]=_0x4cd84c;};MailQueue[_0xdd3a('0xe')][_0xdd3a('0xd')]=function(){this[_0xdd3a('0x11')]=0x0;this[_0xdd3a('0x12')]=0x0;for(var _0x132e96=0x0;_0x132e96=0x0?this['available']:0x0;var _0x233844={'id':this['id'],'available':this[_0xdd3a('0x13')],'loggedIn':this[_0xdd3a('0x11')],'name':this[_0xdd3a('0x5')],'paused':this[_0xdd3a('0x12')],'waiting':this[_0xdd3a('0xb')]};var _0xf343e8=md5(JSON[_0xdd3a('0x14')](_0x233844));if(this[_0xdd3a('0x1')]!==_0xf343e8){this[_0xdd3a('0x1')]=_0xf343e8;io['to'](util[_0xdd3a('0x15')](_0xdd3a('0x16'),_0x233844[_0xdd3a('0x5')]))[_0xdd3a('0x17')](_0xdd3a('0x18'),_0x233844);}};module['exports']=MailQueue; \ No newline at end of file +var _0xa782=['beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','redis','defaults','name','timeout','strategy'];(function(_0x3b5624,_0x41b0ca){var _0x53c625=function(_0x29523d){while(--_0x29523d){_0x3b5624['push'](_0x3b5624['shift']());}};_0x53c625(++_0x41b0ca);}(_0xa782,0xd0));var _0x2a78=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa782[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x2a78('0x0'));var md5=require(_0x2a78('0x1'));var util=require(_0x2a78('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x2a78('0x3')]=_[_0x2a78('0x4')](config[_0x2a78('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x3ab5df){this['id']=_0x3ab5df['id']||0x0;this[_0x2a78('0x5')]=_0x3ab5df[_0x2a78('0x5')]||'';this[_0x2a78('0x6')]=_0x3ab5df[_0x2a78('0x6')]||0xa;this['strategy']=_0x3ab5df[_0x2a78('0x7')]||_0x2a78('0x8');this[_0x2a78('0x9')]=_0x3ab5df['Agents'];this[_0x2a78('0xa')]={};this[_0x2a78('0xb')]=0x0;this[_0x2a78('0x1')]='';this[_0x2a78('0xc')]();this['updateRealtime']();}MailQueue[_0x2a78('0xd')][_0x2a78('0xc')]=function(){var _0xfc54b0=this[_0x2a78('0xa')][_0x2a78('0xe')];this[_0x2a78('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x2a78('0xe')]=_0xfc54b0;};MailQueue[_0x2a78('0xd')]['updateRealtime']=function(){this[_0x2a78('0xf')]=0x0;this[_0x2a78('0x10')]=0x0;for(var _0xcc4251=0x0;_0xcc4251=0x0?this['available']:0x0;var _0x2f174c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2a78('0xf')],'name':this[_0x2a78('0x5')],'paused':this['paused'],'waiting':this['waiting']};var _0x2ff892=md5(JSON[_0x2a78('0x15')](_0x2f174c));if(this[_0x2a78('0x1')]!==_0x2ff892){this[_0x2a78('0x1')]=_0x2ff892;io['to'](util[_0x2a78('0x16')](_0x2a78('0x17'),_0x2f174c[_0x2a78('0x5')]))[_0x2a78('0x18')](_0x2a78('0x19'),_0x2f174c);}};module[_0x2a78('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 956ab2b..ce37dde 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x42091e,_0x5d3851){_0x42091e=_0x42091e-0x0;var _0x1eb5fc=_0x2ef3[_0x42091e];return _0x1eb5fc;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 1f6b3e8..e053b2a 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 _0x48ea=['waiting','md5','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x12f3ea,_0x2c843e){var _0x21f759=function(_0x5b2856){while(--_0x5b2856){_0x12f3ea['push'](_0x12f3ea['shift']());}};_0x21f759(++_0x2c843e);}(_0x48ea,0x9c));var _0xa48e=function(_0x4e235d,_0x33124f){_0x4e235d=_0x4e235d-0x0;var _0xdd5303=_0x48ea[_0x4e235d];return _0xdd5303;};'use strict';var _=require(_0xa48e('0x0'));var md5=require('md5');var util=require(_0xa48e('0x1'));var Redis=require(_0xa48e('0x2'));var config=require(_0xa48e('0x3'));config['redis']=_['defaults'](config[_0xa48e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa48e('0x5'))(new Redis(config[_0xa48e('0x4')]));function SmsQueue(_0x2273d3){this['id']=_0x2273d3['id']||0x0;this[_0xa48e('0x6')]=_0x2273d3[_0xa48e('0x6')]||'';this[_0xa48e('0x7')]=_0x2273d3[_0xa48e('0x7')]||0xa;this[_0xa48e('0x8')]=_0x2273d3[_0xa48e('0x8')]||_0xa48e('0x9');this[_0xa48e('0xa')]=_0x2273d3[_0xa48e('0xa')];this[_0xa48e('0xb')]={};this[_0xa48e('0xc')]=0x0;this[_0xa48e('0xd')]='';this['updateRouting']();this[_0xa48e('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x5bb5c0=this[_0xa48e('0xb')][_0xa48e('0xf')];this[_0xa48e('0xb')]=_[_0xa48e('0x10')](this['Agents'],'id');this[_0xa48e('0xb')][_0xa48e('0xf')]=_0x5bb5c0;};SmsQueue[_0xa48e('0x11')][_0xa48e('0xe')]=function(){this[_0xa48e('0x12')]=0x0;this[_0xa48e('0x13')]=0x0;for(var _0x7251b1=0x0;_0x7251b1=0x0?this[_0xa48e('0x17')]:0x0;var _0x320d22={'id':this['id'],'available':this[_0xa48e('0x17')],'loggedIn':this[_0xa48e('0x12')],'name':this[_0xa48e('0x6')],'paused':this[_0xa48e('0x13')],'waiting':this[_0xa48e('0xc')]};var _0xdd886a=md5(JSON['stringify'](_0x320d22));if(this['md5']!==_0xdd886a){this[_0xa48e('0xd')]=_0xdd886a;io['to'](util['format'](_0xa48e('0x18'),_0x320d22[_0xa48e('0x6')]))[_0xa48e('0x19')](_0xa48e('0x1a'),_0x320d22);}};module[_0xa48e('0x1b')]=SmsQueue; \ No newline at end of file +var _0xbb95=['redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','online','smsPause','available','loggedIn','stringify','format','sms:queue:%s','emit','exports','lodash','md5','../../../config/environment'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0xbb95,0x7f));var _0x5bb9=function(_0x5ea76c,_0x149531){_0x5ea76c=_0x5ea76c-0x0;var _0x14b90d=_0xbb95[_0x5ea76c];return _0x14b90d;};'use strict';var _=require(_0x5bb9('0x0'));var md5=require(_0x5bb9('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x5bb9('0x2'));config[_0x5bb9('0x3')]=_['defaults'](config[_0x5bb9('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x346d48){this['id']=_0x346d48['id']||0x0;this[_0x5bb9('0x4')]=_0x346d48['name']||'';this[_0x5bb9('0x5')]=_0x346d48[_0x5bb9('0x5')]||0xa;this[_0x5bb9('0x6')]=_0x346d48['strategy']||_0x5bb9('0x7');this[_0x5bb9('0x8')]=_0x346d48[_0x5bb9('0x8')];this[_0x5bb9('0x9')]={};this[_0x5bb9('0xa')]=0x0;this[_0x5bb9('0x1')]='';this[_0x5bb9('0xb')]();this[_0x5bb9('0xc')]();}SmsQueue[_0x5bb9('0xd')][_0x5bb9('0xb')]=function(){var _0x5bb2b7=this['mapAgentsId'][_0x5bb9('0xe')];this[_0x5bb9('0x9')]=_[_0x5bb9('0xf')](this[_0x5bb9('0x8')],'id');this[_0x5bb9('0x9')][_0x5bb9('0xe')]=_0x5bb2b7;};SmsQueue[_0x5bb9('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x5bb9('0x10')]=0x0;for(var _0x407a7b=0x0;_0x407a7b=0x0?this[_0x5bb9('0x13')]:0x0;var _0x56c337={'id':this['id'],'available':this[_0x5bb9('0x13')],'loggedIn':this[_0x5bb9('0x14')],'name':this[_0x5bb9('0x4')],'paused':this['paused'],'waiting':this[_0x5bb9('0xa')]};var _0x1c9b29=md5(JSON[_0x5bb9('0x15')](_0x56c337));if(this[_0x5bb9('0x1')]!==_0x1c9b29){this[_0x5bb9('0x1')]=_0x1c9b29;io['to'](util[_0x5bb9('0x16')](_0x5bb9('0x17'),_0x56c337[_0x5bb9('0x4')]))[_0x5bb9('0x18')]('sms_queue:save',_0x56c337);}};module[_0x5bb9('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 7593466..d992d46 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 _0xc615=['md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','waiting','stringify','emit','whatsapp_queue:save','exports','lodash'];(function(_0x3aae47,_0x41e5af){var _0x6156ca=function(_0x136dba){while(--_0x136dba){_0x3aae47['push'](_0x3aae47['shift']());}};_0x6156ca(++_0x41e5af);}(_0xc615,0x12b));var _0x5c61=function(_0x32a2fc,_0x1be7d5){_0x32a2fc=_0x32a2fc-0x0;var _0x3574c5=_0xc615[_0x32a2fc];return _0x3574c5;};'use strict';var _=require(_0x5c61('0x0'));var md5=require(_0x5c61('0x1'));var util=require(_0x5c61('0x2'));var Redis=require(_0x5c61('0x3'));var config=require(_0x5c61('0x4'));config['redis']=_[_0x5c61('0x5')](config[_0x5c61('0x6')],{'host':_0x5c61('0x7'),'port':0x18eb});var io=require(_0x5c61('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0xbd1c7e){this['id']=_0xbd1c7e['id']||0x0;this[_0x5c61('0x9')]=_0xbd1c7e[_0x5c61('0x9')]||'';this[_0x5c61('0xa')]=_0xbd1c7e[_0x5c61('0xa')]||0xa;this[_0x5c61('0xb')]=_0xbd1c7e['strategy']||_0x5c61('0xc');this[_0x5c61('0xd')]=_0xbd1c7e[_0x5c61('0xd')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x5c61('0x1')]='';this['updateRouting']();this[_0x5c61('0xe')]();}WhatsappQueue[_0x5c61('0xf')][_0x5c61('0x10')]=function(){var _0x224f66=this[_0x5c61('0x11')][_0x5c61('0x12')];this['mapAgentsId']=_[_0x5c61('0x13')](this[_0x5c61('0xd')],'id');this[_0x5c61('0x11')][_0x5c61('0x12')]=_0x224f66;};WhatsappQueue[_0x5c61('0xf')][_0x5c61('0xe')]=function(){this[_0x5c61('0x14')]=0x0;this[_0x5c61('0x15')]=0x0;for(var _0x5d2431=0x0;_0x5d2431=0x0?this[_0x5c61('0x18')]:0x0;var _0x2d7753={'id':this['id'],'available':this[_0x5c61('0x18')],'loggedIn':this[_0x5c61('0x14')],'name':this['name'],'paused':this[_0x5c61('0x15')],'waiting':this[_0x5c61('0x19')]};var _0x43242f=md5(JSON[_0x5c61('0x1a')](_0x2d7753));if(this[_0x5c61('0x1')]!==_0x43242f){this[_0x5c61('0x1')]=_0x43242f;io['to'](util['format']('whatsapp:queue:%s',_0x2d7753['name']))[_0x5c61('0x1b')](_0x5c61('0x1c'),_0x2d7753);}};module[_0x5c61('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0xa76f=['prototype','paused','length','online','whatsappPause','available','loggedIn','name','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','redis','defaults','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','map','_rr'];(function(_0x455de9,_0x1d372d){var _0x53f7ac=function(_0x2a191b){while(--_0x2a191b){_0x455de9['push'](_0x455de9['shift']());}};_0x53f7ac(++_0x1d372d);}(_0xa76f,0x1d7));var _0xfa76=function(_0x3c1e2c,_0xf28bb5){_0x3c1e2c=_0x3c1e2c-0x0;var _0x11753e=_0xa76f[_0x3c1e2c];return _0x11753e;};'use strict';var _=require(_0xfa76('0x0'));var md5=require(_0xfa76('0x1'));var util=require(_0xfa76('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xfa76('0x3')]=_[_0xfa76('0x4')](config[_0xfa76('0x3')],{'host':_0xfa76('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfa76('0x3')]));function WhatsappQueue(_0x431531){this['id']=_0x431531['id']||0x0;this['name']=_0x431531['name']||'';this[_0xfa76('0x6')]=_0x431531['timeout']||0xa;this[_0xfa76('0x7')]=_0x431531[_0xfa76('0x7')]||_0xfa76('0x8');this[_0xfa76('0x9')]=_0x431531['Agents'];this[_0xfa76('0xa')]={};this[_0xfa76('0xb')]=0x0;this[_0xfa76('0x1')]='';this[_0xfa76('0xc')]();this['updateRealtime']();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x4976b5=this['mapAgentsId']['_rr'];this[_0xfa76('0xa')]=_[_0xfa76('0xd')](this[_0xfa76('0x9')],'id');this[_0xfa76('0xa')][_0xfa76('0xe')]=_0x4976b5;};WhatsappQueue[_0xfa76('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xfa76('0x10')]=0x0;for(var _0x2a8a8c=0x0;_0x2a8a8c=0x0?this[_0xfa76('0x14')]:0x0;var _0x24e9e3={'id':this['id'],'available':this[_0xfa76('0x14')],'loggedIn':this[_0xfa76('0x15')],'name':this[_0xfa76('0x16')],'paused':this['paused'],'waiting':this[_0xfa76('0xb')]};var _0x51a620=md5(JSON['stringify'](_0x24e9e3));if(this[_0xfa76('0x1')]!==_0x51a620){this['md5']=_0x51a620;io['to'](util['format'](_0xfa76('0x17'),_0x24e9e3[_0xfa76('0x16')]))[_0xfa76('0x18')](_0xfa76('0x19'),_0x24e9e3);}};module[_0xfa76('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index e4c1cc6..3bf188e 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(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x80ce00,_0xd89753){var _0x2216c3=function(_0x1d9c1f){while(--_0x1d9c1f){_0x80ce00['push'](_0x80ce00['shift']());}};_0x2216c3(++_0xd89753);}(_0xb10b,0x12a));var _0xbb10=function(_0x21d532,_0x4552a4){_0x21d532=_0x21d532-0x0;var _0x37bda1=_0xb10b[_0x21d532];return _0x37bda1;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 70dc743..6d02ede 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 _0xb2ed=['addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x41a785,_0x2a6ffa){var _0x56f35d=function(_0x5199d4){while(--_0x5199d4){_0x41a785['push'](_0x41a785['shift']());}};_0x56f35d(++_0x2a6ffa);}(_0xb2ed,0x127));var _0xdb2e=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xb2ed[_0xf55e73];return _0x116b99;};'use strict';var client=require(_0xdb2e('0x0'));exports[_0xdb2e('0x1')]=function(_0x1afd93,_0x439a25){return client['Request'](_0xdb2e('0x2'),{'body':_0x439a25,'options':{'where':{'id':_0x1afd93}},'log':_0xdb2e('0x3')});};exports['addTags']=function(_0x325f03,_0x293e03){return client[_0xdb2e('0x4')](_0xdb2e('0x5'),{'body':_0x293e03,'options':{'where':{'id':_0x325f03}},'log':_0xdb2e('0x6')});}; \ No newline at end of file +var _0x3a82=['Request','UpdateChatInteraction','addTags','update'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x3a82,0x7f));var _0x23a8=function(_0x11fa2a,_0x461d61){_0x11fa2a=_0x11fa2a-0x0;var _0xc76f2b=_0x3a82[_0x11fa2a];return _0xc76f2b;};'use strict';var client=require('../client');exports[_0x23a8('0x0')]=function(_0x266b6f,_0x148d2f){return client[_0x23a8('0x1')](_0x23a8('0x2'),{'body':_0x148d2f,'options':{'where':{'id':_0x266b6f}},'log':'updateChatInteraction'});};exports[_0x23a8('0x3')]=function(_0xb81b4c,_0x5d2511){return client[_0x23a8('0x1')]('AddTagsToChatInteraction',{'body':_0x5d2511,'options':{'where':{'id':_0xb81b4c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 6fbf01a..908b249 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 _0xaa12=['create','Request','CreateChatMessage'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0xaa12,0x6c));var _0x2aa1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xaa12[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0x2aa1('0x0')]=function(_0xdd4391){return client[_0x2aa1('0x1')](_0x2aa1('0x2'),{'body':_0xdd4391,'log':'createChatMessage'});}; \ No newline at end of file +var _0x5162=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x2b23ee,_0x20ba0d){var _0x3716ee=function(_0x3db9d7){while(--_0x3db9d7){_0x2b23ee['push'](_0x2b23ee['shift']());}};_0x3716ee(++_0x20ba0d);}(_0x5162,0x1c4));var _0x2516=function(_0x37d3e0,_0x51d1f4){_0x37d3e0=_0x37d3e0-0x0;var _0x5512a3=_0x5162[_0x37d3e0];return _0x5512a3;};'use strict';var client=require(_0x2516('0x0'));exports[_0x2516('0x1')]=function(_0x5a3db){return client['Request'](_0x2516('0x2'),{'body':_0x5a3db,'log':_0x2516('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 47d130a..f8969e8 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 _0x864a=['Request','GetChatQueue','User','online','chatPause','../client','getChatQueues'];(function(_0x1286dc,_0x4c94c2){var _0x453f84=function(_0x28e8c6){while(--_0x28e8c6){_0x1286dc['push'](_0x1286dc['shift']());}};_0x453f84(++_0x4c94c2);}(_0x864a,0x8a));var _0xa864=function(_0x48c004,_0xdb1f64){_0x48c004=_0x48c004-0x0;var _0xc35626=_0x864a[_0x48c004];return _0xc35626;};'use strict';var client=require(_0xa864('0x0'));exports[_0xa864('0x1')]=function(){return function(){return client[_0xa864('0x2')](_0xa864('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xa864('0x4'),'as':'Agents','attributes':['id','name',_0xa864('0x5'),_0xa864('0x6')]}]},'log':_0xa864('0x1')});};}; \ No newline at end of file +var _0x891b=['strategy','User','Agents','online','chatPause','Request','GetChatQueue','timeout'];(function(_0x3672b5,_0xaf7270){var _0x529138=function(_0x67e44f){while(--_0x67e44f){_0x3672b5['push'](_0x3672b5['shift']());}};_0x529138(++_0xaf7270);}(_0x891b,0xc5));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0xb891('0x0')](_0xb891('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xb891('0x2'),_0xb891('0x3')],'include':[{'model':_0xb891('0x4'),'as':_0xb891('0x5'),'attributes':['id','name',_0xb891('0x6'),_0xb891('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 47134ad..c1e321c 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 _0xee11=['UpdateChatQueueReport','../client','Request','CreateChatQueueReport','update'];(function(_0x412dd2,_0x24558e){var _0x4ba0f=function(_0x47b92f){while(--_0x47b92f){_0x412dd2['push'](_0x412dd2['shift']());}};_0x4ba0f(++_0x24558e);}(_0xee11,0x146));var _0x1ee1=function(_0x360484,_0x2d14e5){_0x360484=_0x360484-0x0;var _0x461a10=_0xee11[_0x360484];return _0x461a10;};'use strict';var client=require(_0x1ee1('0x0'));exports['create']=function(_0x4e1a0d){return client[_0x1ee1('0x1')](_0x1ee1('0x2'),{'body':_0x4e1a0d,'log':_0x1ee1('0x2')});};exports[_0x1ee1('0x3')]=function(_0x2a94ef,_0x14d420){return client[_0x1ee1('0x1')](_0x1ee1('0x4'),{'body':_0x14d420,'options':{'where':{'uniqueid':_0x2a94ef},'order':[['id','DESC']],'limit':0x1},'log':_0x1ee1('0x4')});}; \ No newline at end of file +var _0xe920=['Request','CreateChatQueueReport','update','DESC','../client','create'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe920,0xbe));var _0x0e92=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xe920[_0x593564];return _0x211a89;};'use strict';var client=require(_0x0e92('0x0'));exports[_0x0e92('0x1')]=function(_0x203091){return client[_0x0e92('0x2')](_0x0e92('0x3'),{'body':_0x203091,'log':_0x0e92('0x3')});};exports[_0x0e92('0x4')]=function(_0x39e6a1,_0xfaa87e){return client[_0x0e92('0x2')]('UpdateChatQueueReport',{'body':_0xfaa87e,'options':{'where':{'uniqueid':_0x39e6a1},'order':[['id',_0x0e92('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 9cacab5..2c20bce 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(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x7a54,0x106));var _0x47a5=function(_0x1bc759,_0x41a50b){_0x1bc759=_0x1bc759-0x0;var _0x3159b3=_0x7a54[_0x1bc759];return _0x3159b3;};'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(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x7a54,0x106));var _0x47a5=function(_0xb12318,_0x340eb4){_0xb12318=_0xb12318-0x0;var _0x462df4=_0x7a54[_0xb12318];return _0x462df4;};'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 2f146e2..1086901 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 _0xd737=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x2d9a23,_0x481dc4){var _0x5198ee=function(_0x27d373){while(--_0x27d373){_0x2d9a23['push'](_0x2d9a23['shift']());}};_0x5198ee(++_0x481dc4);}(_0xd737,0xda));var _0x7d73=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0xd737[_0x456bd2];return _0x2218c1;};'use strict';var client=require(_0x7d73('0x0'));exports[_0x7d73('0x1')]=function(_0x1fd052){return client[_0x7d73('0x2')](_0x7d73('0x3'),{'body':_0x1fd052,'log':_0x7d73('0x4')});}; \ No newline at end of file +var _0x97d7=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x2a217b,_0xb039df){var _0x29a6ac=function(_0x36071f){while(--_0x36071f){_0x2a217b['push'](_0x2a217b['shift']());}};_0x29a6ac(++_0xb039df);}(_0x97d7,0xbf));var _0x797d=function(_0x355a1c,_0x820410){_0x355a1c=_0x355a1c-0x0;var _0x1fd12a=_0x97d7[_0x355a1c];return _0x1fd12a;};'use strict';var client=require('../client');exports[_0x797d('0x0')]=function(_0x4f91b2){return client[_0x797d('0x1')](_0x797d('0x2'),{'body':_0x4f91b2,'log':_0x797d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ee8e5fb..c8c4986 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 _0x104a=['Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy'];(function(_0x4951ca,_0x3146d7){var _0x3bf41e=function(_0xaa0673){while(--_0xaa0673){_0x4951ca['push'](_0x4951ca['shift']());}};_0x3bf41e(++_0x3146d7);}(_0x104a,0x1ab));var _0xa104=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x104a[_0x2ca9d4];return _0x258956;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xa104('0x0')](_0xa104('0x1'),{'options':{'raw':![],'attributes':['id',_0xa104('0x2'),_0xa104('0x3'),_0xa104('0x4')],'include':[{'model':'User','as':_0xa104('0x5'),'attributes':['id','name',_0xa104('0x6'),_0xa104('0x7')]}]},'log':_0xa104('0x8')});};}; \ No newline at end of file +var _0x1dcc=['User','../client','getFaxQueues','name','timeout','strategy'];(function(_0x3e3038,_0x4a8257){var _0x342a9f=function(_0x37dd4d){while(--_0x37dd4d){_0x3e3038['push'](_0x3e3038['shift']());}};_0x342a9f(++_0x4a8257);}(_0x1dcc,0x115));var _0xc1dc=function(_0x14115b,_0x2ddfea){_0x14115b=_0x14115b-0x0;var _0x2ec621=_0x1dcc[_0x14115b];return _0x2ec621;};'use strict';var client=require(_0xc1dc('0x0'));exports[_0xc1dc('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xc1dc('0x2'),_0xc1dc('0x3'),_0xc1dc('0x4')],'include':[{'model':_0xc1dc('0x5'),'as':'Agents','attributes':['id',_0xc1dc('0x2'),'online','faxPause']}]},'log':_0xc1dc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 1bd0a4d..ffd8c07 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 _0x7dc5=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7dc5,0xaa));var _0x57dc=function(_0xcfe0ed,_0x3feab1){_0xcfe0ed=_0xcfe0ed-0x0;var _0x15bdec=_0x7dc5[_0xcfe0ed];return _0x15bdec;};'use strict';var client=require(_0x57dc('0x0'));exports[_0x57dc('0x1')]=function(_0x139eff){return client[_0x57dc('0x2')](_0x57dc('0x3'),{'body':_0x139eff,'log':'CreateFaxQueueReport'});};exports[_0x57dc('0x4')]=function(_0x1a69d9,_0x2dec97){return client[_0x57dc('0x2')](_0x57dc('0x5'),{'body':_0x2dec97,'options':{'where':{'uniqueid':_0x1a69d9},'order':[['id',_0x57dc('0x6')]],'limit':0x1},'log':_0x57dc('0x5')});}; \ No newline at end of file +var _0xde8d=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x8508f7,_0xb19c9d){var _0xba325c=function(_0x375ed8){while(--_0x375ed8){_0x8508f7['push'](_0x8508f7['shift']());}};_0xba325c(++_0xb19c9d);}(_0xde8d,0x181));var _0xdde8=function(_0x1efbc5,_0x169459){_0x1efbc5=_0x1efbc5-0x0;var _0x5c636b=_0xde8d[_0x1efbc5];return _0x5c636b;};'use strict';var client=require('../client');exports['create']=function(_0x2bc27f){return client['Request'](_0xdde8('0x0'),{'body':_0x2bc27f,'log':_0xdde8('0x0')});};exports[_0xdde8('0x1')]=function(_0xf48305,_0x5870a6){return client[_0xdde8('0x2')](_0xdde8('0x3'),{'body':_0x5870a6,'options':{'where':{'uniqueid':_0xf48305},'order':[['id',_0xdde8('0x4')]],'limit':0x1},'log':_0xdde8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index df3f661..0c0c245 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 _0x0758=['Interval','Intervals','getIntervals','../client','Request','GetInterval','name'];(function(_0x5f88d4,_0x4e6213){var _0xbc35fd=function(_0x1696c4){while(--_0x1696c4){_0x5f88d4['push'](_0x5f88d4['shift']());}};_0xbc35fd(++_0x4e6213);}(_0x0758,0x65));var _0x8075=function(_0x5460b2,_0x3af31b){_0x5460b2=_0x5460b2-0x0;var _0x2ca92c=_0x0758[_0x5460b2];return _0x2ca92c;};'use strict';var client=require(_0x8075('0x0'));exports['getIntervals']=function(){return function(){return client[_0x8075('0x1')](_0x8075('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8075('0x3')],'include':[{'model':_0x8075('0x4'),'as':_0x8075('0x5'),'attributes':['id',_0x8075('0x3'),'interval']}]},'log':_0x8075('0x6')});};}; \ No newline at end of file +var _0x4db9=['getIntervals','Request','GetInterval'];(function(_0x1f27f6,_0x1d018a){var _0x2fb1d7=function(_0x1ca7ec){while(--_0x1ca7ec){_0x1f27f6['push'](_0x1f27f6['shift']());}};_0x2fb1d7(++_0x1d018a);}(_0x4db9,0x141));var _0x94db=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x4db9[_0x5d30b4];return _0x1acfb8;};'use strict';var client=require('../client');exports[_0x94db('0x0')]=function(){return function(){return client[_0x94db('0x1')](_0x94db('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name','interval']}]},'log':_0x94db('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 5b4ec34..9e9e2f9 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f4c=['update','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x35fcb7,_0x3734c0){var _0x30f28a=function(_0x1da8bd){while(--_0x1da8bd){_0x35fcb7['push'](_0x35fcb7['shift']());}};_0x30f28a(++_0x3734c0);}(_0x8f4c,0x113));var _0xc8f4=function(_0x14e780,_0x3b07c6){_0x14e780=_0x14e780-0x0;var _0x5f884c=_0x8f4c[_0x14e780];return _0x5f884c;};'use strict';var client=require(_0xc8f4('0x0'));exports[_0xc8f4('0x1')]=function(_0xce26f2,_0x43926b){return client[_0xc8f4('0x2')](_0xc8f4('0x3'),{'body':_0x43926b,'options':{'where':{'id':_0xce26f2}},'log':'updateMailInteraction'});};exports[_0xc8f4('0x4')]=function(_0x47350d,_0x133764){return client['Request'](_0xc8f4('0x5'),{'body':_0x133764,'options':{'where':{'id':_0x47350d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xf4f4=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2641b7,_0x460f38){var _0x2d1b57=function(_0x1ce029){while(--_0x1ce029){_0x2641b7['push'](_0x2641b7['shift']());}};_0x2d1b57(++_0x460f38);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3b030f,_0x2961f8){_0x3b030f=_0x3b030f-0x0;var _0x489be5=_0xf4f4[_0x3b030f];return _0x489be5;};'use strict';var client=require(_0x4f4f('0x0'));exports[_0x4f4f('0x1')]=function(_0x533895,_0x16a496){return client[_0x4f4f('0x2')](_0x4f4f('0x3'),{'body':_0x16a496,'options':{'where':{'id':_0x533895}},'log':_0x4f4f('0x4')});};exports[_0x4f4f('0x5')]=function(_0x510b24,_0x5a752b){return client['Request'](_0x4f4f('0x6'),{'body':_0x5a752b,'options':{'where':{'id':_0x510b24}},'log':_0x4f4f('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 2eef7c5..6e8d046 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 _0x7a49=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x1e9664,_0x5a8216){var _0xdcd0dd=function(_0x22ceb3){while(--_0x22ceb3){_0x1e9664['push'](_0x1e9664['shift']());}};_0xdcd0dd(++_0x5a8216);}(_0x7a49,0xd4));var _0x97a4=function(_0x497297,_0x227595){_0x497297=_0x497297-0x0;var _0xacf910=_0x7a49[_0x497297];return _0xacf910;};'use strict';var client=require(_0x97a4('0x0'));exports[_0x97a4('0x1')]=function(_0x1475f9){return client[_0x97a4('0x2')](_0x97a4('0x3'),{'body':_0x1475f9,'log':_0x97a4('0x4')});}; \ No newline at end of file +var _0x4c25=['createMailMessage','../client','create','Request'];(function(_0x170618,_0x5bbf7d){var _0x4aaef3=function(_0x564320){while(--_0x564320){_0x170618['push'](_0x170618['shift']());}};_0x4aaef3(++_0x5bbf7d);}(_0x4c25,0xdd));var _0x54c2=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0x4c25[_0x2c534a];return _0x3f5c99;};'use strict';var client=require(_0x54c2('0x0'));exports[_0x54c2('0x1')]=function(_0x579c4b){return client[_0x54c2('0x2')]('CreateMailMessage',{'body':_0x579c4b,'log':_0x54c2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 7f40f73..0087eaf 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 _0x8bd2=['User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x1d2cd3,_0x1f7ed0){var _0x209b7a=function(_0x131ff9){while(--_0x131ff9){_0x1d2cd3['push'](_0x1d2cd3['shift']());}};_0x209b7a(++_0x1f7ed0);}(_0x8bd2,0xc1));var _0x28bd=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x8bd2[_0x476bf4];return _0x788ffe;};'use strict';var client=require(_0x28bd('0x0'));exports[_0x28bd('0x1')]=function(){return function(){return client[_0x28bd('0x2')](_0x28bd('0x3'),{'options':{'raw':![],'attributes':['id',_0x28bd('0x4'),'timeout','strategy'],'include':[{'model':_0x28bd('0x5'),'as':_0x28bd('0x6'),'attributes':['id','name',_0x28bd('0x7'),_0x28bd('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x0858=['timeout','strategy','User','getMailQueues','Request','GetMailQueue','name'];(function(_0x4f6610,_0x11d9ae){var _0x44e7d3=function(_0x1c9b2f){while(--_0x1c9b2f){_0x4f6610['push'](_0x4f6610['shift']());}};_0x44e7d3(++_0x11d9ae);}(_0x0858,0x192));var _0x8085=function(_0x34e830,_0x3c3620){_0x34e830=_0x34e830-0x0;var _0x462e4b=_0x0858[_0x34e830];return _0x462e4b;};'use strict';var client=require('../client');exports[_0x8085('0x0')]=function(){return function(){return client[_0x8085('0x1')](_0x8085('0x2'),{'options':{'raw':![],'attributes':['id',_0x8085('0x3'),_0x8085('0x4'),_0x8085('0x5')],'include':[{'model':_0x8085('0x6'),'as':'Agents','attributes':['id','name','online','mailPause']}]},'log':_0x8085('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f884c7c..d63499f 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 _0x30c8=['DESC','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x1c3566,_0x568c57){var _0xd622f=function(_0x4ce932){while(--_0x4ce932){_0x1c3566['push'](_0x1c3566['shift']());}};_0xd622f(++_0x568c57);}(_0x30c8,0x191));var _0x830c=function(_0x7cbd11,_0x5ea230){_0x7cbd11=_0x7cbd11-0x0;var _0x21ed05=_0x30c8[_0x7cbd11];return _0x21ed05;};'use strict';var client=require('../client');exports[_0x830c('0x0')]=function(_0x1e77e9){return client[_0x830c('0x1')](_0x830c('0x2'),{'body':_0x1e77e9,'log':'CreateMailQueueReport'});};exports['update']=function(_0x3ed2db,_0x2dd4cb){return client['Request'](_0x830c('0x3'),{'body':_0x2dd4cb,'options':{'where':{'uniqueid':_0x3ed2db},'order':[['id',_0x830c('0x4')]],'limit':0x1},'log':_0x830c('0x3')});}; \ No newline at end of file +var _0x5f54=['Request','CreateMailQueueReport','UpdateMailQueueReport','../client','create'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x5f54,0x1b6));var _0x45f5=function(_0xf28187,_0x5aace6){_0xf28187=_0xf28187-0x0;var _0x4eacbd=_0x5f54[_0xf28187];return _0x4eacbd;};'use strict';var client=require(_0x45f5('0x0'));exports[_0x45f5('0x1')]=function(_0x3205bc){return client[_0x45f5('0x2')](_0x45f5('0x3'),{'body':_0x3205bc,'log':_0x45f5('0x3')});};exports['update']=function(_0xd8dd2a,_0x4f2c11){return client['Request'](_0x45f5('0x4'),{'body':_0x4f2c11,'options':{'where':{'uniqueid':_0xd8dd2a},'order':[['id','DESC']],'limit':0x1},'log':_0x45f5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index f262e64..38b7905 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 _0xf599=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x58f8a8,_0x20e98d){var _0x18b7cd=function(_0x43cf4b){while(--_0x43cf4b){_0x58f8a8['push'](_0x58f8a8['shift']());}};_0x18b7cd(++_0x20e98d);}(_0xf599,0x1c6));var _0x9f59=function(_0x352b7c,_0xf3c28b){_0x352b7c=_0x352b7c-0x0;var _0x2f96ff=_0xf599[_0x352b7c];return _0x2f96ff;};'use strict';var client=require(_0x9f59('0x0'));exports[_0x9f59('0x1')]=function(_0x1e11c2,_0x6de44){return client[_0x9f59('0x2')]('UpdateOpenchannelInteraction',{'body':_0x6de44,'options':{'where':{'id':_0x1e11c2}},'log':_0x9f59('0x3')});};exports[_0x9f59('0x4')]=function(_0x31bbde,_0x573957){return client[_0x9f59('0x2')](_0x9f59('0x5'),{'body':_0x573957,'options':{'where':{'id':_0x31bbde}},'log':_0x9f59('0x6')});}; \ No newline at end of file +var _0xd5a5=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xd5a5,0xfc));var _0x5d5a=function(_0x2979fc,_0x141ef9){_0x2979fc=_0x2979fc-0x0;var _0x575ae6=_0xd5a5[_0x2979fc];return _0x575ae6;};'use strict';var client=require('../client');exports[_0x5d5a('0x0')]=function(_0x5342d4,_0x8ffbf){return client[_0x5d5a('0x1')](_0x5d5a('0x2'),{'body':_0x8ffbf,'options':{'where':{'id':_0x5342d4}},'log':_0x5d5a('0x3')});};exports[_0x5d5a('0x4')]=function(_0x54f32d,_0x13ec88){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x13ec88,'options':{'where':{'id':_0x54f32d}},'log':_0x5d5a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b5bb21b..72aa198 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 _0x96f4=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0xaa6f67,_0x32e5b3){var _0x5b76bd=function(_0x131e27){while(--_0x131e27){_0xaa6f67['push'](_0xaa6f67['shift']());}};_0x5b76bd(++_0x32e5b3);}(_0x96f4,0xbf));var _0x496f=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0x96f4[_0x25a0b9];return _0x30b9ab;};'use strict';var client=require(_0x496f('0x0'));exports[_0x496f('0x1')]=function(_0x48fa44){return client[_0x496f('0x2')](_0x496f('0x3'),{'body':_0x48fa44,'log':_0x496f('0x4')});}; \ No newline at end of file +var _0x56f1=['../client','create','createOpenchannelMessage'];(function(_0x2406b4,_0x2f9771){var _0x7f3752=function(_0x583971){while(--_0x583971){_0x2406b4['push'](_0x2406b4['shift']());}};_0x7f3752(++_0x2f9771);}(_0x56f1,0x13b));var _0x156f=function(_0x66851e,_0x141e17){_0x66851e=_0x66851e-0x0;var _0x111adc=_0x56f1[_0x66851e];return _0x111adc;};'use strict';var client=require(_0x156f('0x0'));exports[_0x156f('0x1')]=function(_0x984672){return client['Request']('CreateOpenchannelMessage',{'body':_0x984672,'log':_0x156f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index de5027b..80bc3ec 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 _0x469d=['strategy','User','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x54c942,_0x5b86df){var _0x4d58a3=function(_0x13283f){while(--_0x13283f){_0x54c942['push'](_0x54c942['shift']());}};_0x4d58a3(++_0x5b86df);}(_0x469d,0x72));var _0xd469=function(_0x18051d,_0xffc771){_0x18051d=_0x18051d-0x0;var _0x127fd9=_0x469d[_0x18051d];return _0x127fd9;};'use strict';var client=require(_0xd469('0x0'));exports[_0xd469('0x1')]=function(){return function(){return client[_0xd469('0x2')](_0xd469('0x3'),{'options':{'raw':![],'attributes':['id',_0xd469('0x4'),_0xd469('0x5'),_0xd469('0x6')],'include':[{'model':_0xd469('0x7'),'as':'Agents','attributes':['id',_0xd469('0x4'),'online','openchannelPause']}]},'log':_0xd469('0x1')});};}; \ No newline at end of file +var _0x834d=['User','online','openchannelPause','getOpenchannelQueues','Request','name','timeout'];(function(_0x27de5e,_0xf549da){var _0x545079=function(_0x4f1d34){while(--_0x4f1d34){_0x27de5e['push'](_0x27de5e['shift']());}};_0x545079(++_0xf549da);}(_0x834d,0xdd));var _0xd834=function(_0x177416,_0x27e656){_0x177416=_0x177416-0x0;var _0x122629=_0x834d[_0x177416];return _0x122629;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xd834('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xd834('0x1'),_0xd834('0x2'),'strategy'],'include':[{'model':_0xd834('0x3'),'as':'Agents','attributes':['id',_0xd834('0x1'),_0xd834('0x4'),_0xd834('0x5')]}]},'log':_0xd834('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d7c520a..ee86e8e 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 _0xbba5=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','create','Request'];(function(_0x22270a,_0x1d2ee4){var _0x3770b4=function(_0x53e770){while(--_0x53e770){_0x22270a['push'](_0x22270a['shift']());}};_0x3770b4(++_0x1d2ee4);}(_0xbba5,0x1bb));var _0x5bba=function(_0x10b8f4,_0x1a8a6a){_0x10b8f4=_0x10b8f4-0x0;var _0x2048ae=_0xbba5[_0x10b8f4];return _0x2048ae;};'use strict';var client=require('../client');exports[_0x5bba('0x0')]=function(_0x587cb5){return client[_0x5bba('0x1')]('CreateOpenchannelQueueReport',{'body':_0x587cb5,'log':_0x5bba('0x2')});};exports['update']=function(_0x2b00e0,_0x517924){return client['Request'](_0x5bba('0x3'),{'body':_0x517924,'options':{'where':{'uniqueid':_0x2b00e0},'order':[['id',_0x5bba('0x4')]],'limit':0x1},'log':_0x5bba('0x3')});}; \ No newline at end of file +var _0x41c8=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x41c8,0x98));var _0x841c=function(_0x51c8f1,_0x3ebe17){_0x51c8f1=_0x51c8f1-0x0;var _0x78b478=_0x41c8[_0x51c8f1];return _0x78b478;};'use strict';var client=require(_0x841c('0x0'));exports[_0x841c('0x1')]=function(_0x511fff){return client[_0x841c('0x2')](_0x841c('0x3'),{'body':_0x511fff,'log':_0x841c('0x3')});};exports[_0x841c('0x4')]=function(_0x105ff4,_0x12b740){return client[_0x841c('0x2')](_0x841c('0x5'),{'body':_0x12b740,'options':{'where':{'uniqueid':_0x105ff4},'order':[['id',_0x841c('0x6')]],'limit':0x1},'log':_0x841c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index b8b98ca..44b2dbf 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 _0x89c3=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x58a183,_0x4fbc2b){var _0x322e63=function(_0x175164){while(--_0x175164){_0x58a183['push'](_0x58a183['shift']());}};_0x322e63(++_0x4fbc2b);}(_0x89c3,0xff));var _0x389c=function(_0x143d63,_0x5a055b){_0x143d63=_0x143d63-0x0;var _0xb210cb=_0x89c3[_0x143d63];return _0xb210cb;};'use strict';var client=require(_0x389c('0x0'));exports[_0x389c('0x1')]=function(_0x462669,_0x56e907){return client[_0x389c('0x2')](_0x389c('0x3'),{'body':_0x56e907,'options':{'where':{'id':_0x462669}},'log':_0x389c('0x4')});};exports[_0x389c('0x5')]=function(_0x5c6c68,_0x3742ad){return client['Request'](_0x389c('0x6'),{'body':_0x3742ad,'options':{'where':{'id':_0x5c6c68}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x946e=['../client','Request','addTags','AddTagsToSmsInteraction'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x946e,0x1d0));var _0xe946=function(_0x47797a,_0x15d9c5){_0x47797a=_0x47797a-0x0;var _0x13b73e=_0x946e[_0x47797a];return _0x13b73e;};'use strict';var client=require(_0xe946('0x0'));exports['update']=function(_0x33c874,_0x55113e){return client[_0xe946('0x1')]('UpdateSmsInteraction',{'body':_0x55113e,'options':{'where':{'id':_0x33c874}},'log':'updateSmsInteraction'});};exports[_0xe946('0x2')]=function(_0xb981db,_0x2b42cd){return client[_0xe946('0x1')](_0xe946('0x3'),{'body':_0x2b42cd,'options':{'where':{'id':_0xb981db}},'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 5777f79..5d0ade8 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 _0x40ab=['../client','CreateSmsMessage','createSmsMessage'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x40ab,0x192));var _0xb40a=function(_0x309731,_0x58313b){_0x309731=_0x309731-0x0;var _0x854534=_0x40ab[_0x309731];return _0x854534;};'use strict';var client=require(_0xb40a('0x0'));exports['create']=function(_0x5949b3){return client['Request'](_0xb40a('0x1'),{'body':_0x5949b3,'log':_0xb40a('0x2')});}; \ No newline at end of file +var _0xce1e=['../client','create','Request','createSmsMessage'];(function(_0x35c838,_0x2b9f4c){var _0x37db01=function(_0x5e07db){while(--_0x5e07db){_0x35c838['push'](_0x35c838['shift']());}};_0x37db01(++_0x2b9f4c);}(_0xce1e,0x7c));var _0xece1=function(_0x4ae619,_0x117e59){_0x4ae619=_0x4ae619-0x0;var _0x14de17=_0xce1e[_0x4ae619];return _0x14de17;};'use strict';var client=require(_0xece1('0x0'));exports[_0xece1('0x1')]=function(_0x5c6a78){return client[_0xece1('0x2')]('CreateSmsMessage',{'body':_0x5c6a78,'log':_0xece1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 50eeaa2..51cb75c 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x3463b4,_0x4096ce){var _0x249c60=function(_0x40507f){while(--_0x40507f){_0x3463b4['push'](_0x3463b4['shift']());}};_0x249c60(++_0x4096ce);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x864521,_0x39dd57){var _0x3e7352=function(_0x5b133b){while(--_0x5b133b){_0x864521['push'](_0x864521['shift']());}};_0x3e7352(++_0x39dd57);}(_0xe706,0xa3));var _0x6e70=function(_0x43316d,_0x5ebd8f){_0x43316d=_0x43316d-0x0;var _0x52d343=_0xe706[_0x43316d];return _0x52d343;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a95c8ca..37b3034 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5e8492,_0x123091){var _0x277a85=function(_0x3a742f){while(--_0x3a742f){_0x5e8492['push'](_0x5e8492['shift']());}};_0x277a85(++_0x123091);}(_0x3e74,0x175));var _0x43e7=function(_0x4721ee,_0x22bfd1){_0x4721ee=_0x4721ee-0x0;var _0x45caaf=_0x3e74[_0x4721ee];return _0x45caaf;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f392a,_0x5208e2){_0x3f392a=_0x3f392a-0x0;var _0x3d1980=_0xedd9[_0x3f392a];return _0x3d1980;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index ed35339..8eddf61 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(_0x2c2590,_0x38ccdf){var _0x1a45b1=function(_0x276fa8){while(--_0x276fa8){_0x2c2590['push'](_0x2c2590['shift']());}};_0x1a45b1(++_0x38ccdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x5373b,_0x141bf1){var _0x3b8a57=function(_0x130092){while(--_0x130092){_0x5373b['push'](_0x5373b['shift']());}};_0x3b8a57(++_0x141bf1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 edea22d..7e9e7f8 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 _0x37c5=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','update'];(function(_0x4939c6,_0x61945e){var _0x531655=function(_0x4c76ff){while(--_0x4c76ff){_0x4939c6['push'](_0x4939c6['shift']());}};_0x531655(++_0x61945e);}(_0x37c5,0xa7));var _0x537c=function(_0x573de2,_0x363df8){_0x573de2=_0x573de2-0x0;var _0x56c549=_0x37c5[_0x573de2];return _0x56c549;};'use strict';var client=require('../client');exports[_0x537c('0x0')]=function(_0x187a44,_0x392fa1){return client[_0x537c('0x1')](_0x537c('0x2'),{'body':_0x392fa1,'options':{'where':{'id':_0x187a44}},'log':_0x537c('0x3')});};exports[_0x537c('0x4')]=function(_0x42bd15,_0x2c0854){return client[_0x537c('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x2c0854,'options':{'where':{'id':_0x42bd15}},'log':_0x537c('0x5')});}; \ No newline at end of file +var _0x77a9=['addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x77a9,0x19e));var _0x977a=function(_0xa8ff2f,_0x43e207){_0xa8ff2f=_0xa8ff2f-0x0;var _0x1c27af=_0x77a9[_0xa8ff2f];return _0x1c27af;};'use strict';var client=require(_0x977a('0x0'));exports['update']=function(_0x349b83,_0x5bf16f){return client[_0x977a('0x1')](_0x977a('0x2'),{'body':_0x5bf16f,'options':{'where':{'id':_0x349b83}},'log':_0x977a('0x3')});};exports[_0x977a('0x4')]=function(_0x520cd7,_0x318fc8){return client[_0x977a('0x1')](_0x977a('0x5'),{'body':_0x318fc8,'options':{'where':{'id':_0x520cd7}},'log':_0x977a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 39f7e36..7373d09 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 _0x5030=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x2672b5,_0x1b3be3){var _0x369d1d=function(_0x19b87e){while(--_0x19b87e){_0x2672b5['push'](_0x2672b5['shift']());}};_0x369d1d(++_0x1b3be3);}(_0x5030,0xc4));var _0x0503=function(_0x7984f7,_0x5e5c35){_0x7984f7=_0x7984f7-0x0;var _0x572a22=_0x5030[_0x7984f7];return _0x572a22;};'use strict';var client=require(_0x0503('0x0'));exports[_0x0503('0x1')]=function(_0x99230d){return client[_0x0503('0x2')](_0x0503('0x3'),{'body':_0x99230d,'log':_0x0503('0x4')});}; \ No newline at end of file +var _0x1618=['../client','create','Request','createWhatsappMessage'];(function(_0x290368,_0x19b54c){var _0x53bcc9=function(_0x46b5e0){while(--_0x46b5e0){_0x290368['push'](_0x290368['shift']());}};_0x53bcc9(++_0x19b54c);}(_0x1618,0x140));var _0x8161=function(_0x51f2c4,_0x366d1b){_0x51f2c4=_0x51f2c4-0x0;var _0x3c1ae0=_0x1618[_0x51f2c4];return _0x3c1ae0;};'use strict';var client=require(_0x8161('0x0'));exports[_0x8161('0x1')]=function(_0x5cf1cd){return client[_0x8161('0x2')]('CreateWhatsappMessage',{'body':_0x5cf1cd,'log':_0x8161('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 2fd4aec..35a70c7 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 _0x422f=['getWhatsappQueues','Request','name','timeout','strategy','User','online','whatsappPause','../client'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x422f,0x1dc));var _0xf422=function(_0x5d868e,_0x3e31db){_0x5d868e=_0x5d868e-0x0;var _0x378d99=_0x422f[_0x5d868e];return _0x378d99;};'use strict';var client=require(_0xf422('0x0'));exports[_0xf422('0x1')]=function(){return function(){return client[_0xf422('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xf422('0x3'),_0xf422('0x4'),_0xf422('0x5')],'include':[{'model':_0xf422('0x6'),'as':'Agents','attributes':['id',_0xf422('0x3'),_0xf422('0x7'),_0xf422('0x8')]}]},'log':_0xf422('0x1')});};}; \ No newline at end of file +var _0x9463=['User','Agents','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x116ab1,_0x1fa314){var _0x238181=function(_0x5719a2){while(--_0x5719a2){_0x116ab1['push'](_0x116ab1['shift']());}};_0x238181(++_0x1fa314);}(_0x9463,0x1d4));var _0x3946=function(_0x1f1b51,_0x3c293b){_0x1f1b51=_0x1f1b51-0x0;var _0x246f14=_0x9463[_0x1f1b51];return _0x246f14;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x3946('0x0')](_0x3946('0x1'),{'options':{'raw':![],'attributes':['id',_0x3946('0x2'),_0x3946('0x3'),'strategy'],'include':[{'model':_0x3946('0x4'),'as':_0x3946('0x5'),'attributes':['id','name','online',_0x3946('0x6')]}]},'log':_0x3946('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 8cb56d5..91f62b3 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 _0xc6b3=['create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport','DESC'];(function(_0x13f834,_0x564231){var _0x258b39=function(_0x5b92e9){while(--_0x5b92e9){_0x13f834['push'](_0x13f834['shift']());}};_0x258b39(++_0x564231);}(_0xc6b3,0x1da));var _0x3c6b=function(_0x3c4f40,_0x302e0b){_0x3c4f40=_0x3c4f40-0x0;var _0x12032f=_0xc6b3[_0x3c4f40];return _0x12032f;};'use strict';var client=require('../client');exports[_0x3c6b('0x0')]=function(_0x540dbf){return client['Request'](_0x3c6b('0x1'),{'body':_0x540dbf,'log':'CreateWhatsappQueueReport'});};exports[_0x3c6b('0x2')]=function(_0x5eb4b2,_0x533942){return client[_0x3c6b('0x3')](_0x3c6b('0x4'),{'body':_0x533942,'options':{'where':{'uniqueid':_0x5eb4b2},'order':[['id',_0x3c6b('0x5')]],'limit':0x1},'log':_0x3c6b('0x4')});}; \ No newline at end of file +var _0x942a=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x3d4c3a,_0x36d52c){var _0x39e809=function(_0x55c625){while(--_0x55c625){_0x3d4c3a['push'](_0x3d4c3a['shift']());}};_0x39e809(++_0x36d52c);}(_0x942a,0xb1));var _0xa942=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0x942a[_0x569caa];return _0x44cb5a;};'use strict';var client=require(_0xa942('0x0'));exports[_0xa942('0x1')]=function(_0x2538d2){return client[_0xa942('0x2')](_0xa942('0x3'),{'body':_0x2538d2,'log':_0xa942('0x3')});};exports[_0xa942('0x4')]=function(_0x5e86bf,_0x626676){return client[_0xa942('0x2')](_0xa942('0x5'),{'body':_0x626676,'options':{'where':{'uniqueid':_0x5e86bf},'order':[['id','DESC']],'limit':0x1},'log':_0xa942('0x5')});}; \ 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 78ad552..7e69967 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 _0x3801=['format','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','stack','validate','lodash','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','message','join','stop','agents','timeout','atimeout','channel'];(function(_0x2eb71e,_0x3b1851){var _0x571bd7=function(_0x187390){while(--_0x187390){_0x2eb71e['push'](_0x2eb71e['shift']());}};_0x571bd7(++_0x3b1851);}(_0x3801,0x1a4));var _0x1380=function(_0x36d2a1,_0x176456){_0x36d2a1=_0x36d2a1-0x0;var _0x5de65d=_0x3801[_0x36d2a1];return _0x5de65d;};'use strict';var schema=require(_0x1380('0x0'));var _=require(_0x1380('0x1'));var util=require(_0x1380('0x2'));var seqqueue=require(_0x1380('0x3'));var logger=require('../../../../config/logger')(_0x1380('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x1380('0x5'),'required':!![],'message':_0x1380('0x6')},'timeout':{'type':_0x1380('0x7'),'message':_0x1380('0x8')}});function writeLog(_0x1927c7,_0x13ee50,_0x287ba1){return logger['info'](util['format'](_0x1380('0x9'),_0x1927c7,_0x13ee50['name'],_0x287ba1));}function handleFindAgent(_0xa31813){return function(_0x7dc79){return _0x7dc79[_0x1380('0xa')][_0x1380('0xb')]()===_0xa31813['toLowerCase']();};}exports['consequence']=function(_0x3cfba5,_0x3b4546,_0x28c991,_0x198acc){return function(_0x5a4c71){try{var _0x2ea9b8={'name':_0x3b4546[0x0],'timeout':_0x3b4546[0x1]};var _0x4a705f=queue['validate'](_0x2ea9b8,{'typecast':!![]});if(_0x4a705f[_0x1380('0xc')]){logger[_0x1380('0xd')](_0x1380('0xe'),_0x3cfba5,_['map'](_0x4a705f,_0x1380('0xf'))[_0x1380('0x10')](',\x20'));_0x5a4c71[_0x1380('0x11')]();}else{var _0x59879b=_['find'](_0x28c991[_0x1380('0x12')],handleFindAgent(_0x2ea9b8[_0x1380('0xa')]));if(_0x59879b){var _0x2e4a8e=(_0x2ea9b8[_0x1380('0x13')]||0xa)*0x3e8;var _0x50353c,_0x23eaa9;var _0x2df35c=seqqueue['createQueue'](_0x2e4a8e);_0x2df35c['id']=_0x3cfba5;_0x2df35c[_0x1380('0x14')]=_0x2e4a8e;_0x2df35c[_0x1380('0x15')]=_0x198acc[_0x1380('0x15')];writeLog(_0x3cfba5,_0x59879b,util[_0x1380('0x16')]('START:%s',_0x2e4a8e));_0x28c991['rules'][_0x3cfba5]['on'](_0x1380('0x17'),function(){logger[_0x1380('0x18')](_0x1380('0x19'),_0x3cfba5);clearTimeout(_0x23eaa9);_0x23eaa9=undefined;_0x2df35c[_0x1380('0x1a')]();if(_0x28c991[_0x1380('0x1b')][_0x3cfba5]){delete _0x28c991[_0x1380('0x1b')][_0x3cfba5];}_0x5a4c71[_0x1380('0x11')]();});_0x28c991[_0x1380('0x1b')][_0x3cfba5]['on'](_0x1380('0x1c'),function(){if(_0x28c991[_0x1380('0x1b')][_0x3cfba5]){delete _0x28c991[_0x1380('0x1b')][_0x3cfba5];}});_0x23eaa9=setTimeout(function(){logger[_0x1380('0x18')](_0x1380('0x1d'),_0x3cfba5);clearTimeout(_0x23eaa9);_0x2df35c[_0x1380('0x1a')]();_0x5a4c71[_0x1380('0x1e')]();},_0x2e4a8e);strategy[_0x1380('0x1f')](_0x2df35c,_0x59879b,_0x28c991,_0x198acc);}else{logger[_0x1380('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3cfba5,_0x2ea9b8[_0x1380('0xa')]);_0x5a4c71[_0x1380('0x11')]();}}}catch(_0x3e2cef){console[_0x1380('0x20')](_0x3e2cef);logger['error']('[%s][QUEUE]\x20%s',_0x3cfba5,_0x3e2cef[_0x1380('0x21')]);_0x5a4c71['stop']();}};}; \ No newline at end of file +var _0x9b46=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','channel','START:%s','rules','info','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent'];(function(_0x3b5c43,_0x5c75ed){var _0x471d69=function(_0x43cccd){while(--_0x43cccd){_0x3b5c43['push'](_0x3b5c43['shift']());}};_0x471d69(++_0x5c75ed);}(_0x9b46,0x185));var _0x69b4=function(_0xe18ab7,_0x95a601){_0xe18ab7=_0xe18ab7-0x0;var _0x531ce5=_0x9b46[_0xe18ab7];return _0x531ce5;};'use strict';var schema=require(_0x69b4('0x0'));var _=require(_0x69b4('0x1'));var util=require('util');var seqqueue=require(_0x69b4('0x2'));var logger=require('../../../../config/logger')(_0x69b4('0x3'));var strategy=require(_0x69b4('0x4'));var queue=schema({'name':{'type':_0x69b4('0x5'),'required':!![],'message':_0x69b4('0x6')},'timeout':{'type':_0x69b4('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x26c721,_0x3e14ce,_0x1f2200){return logger['info'](util[_0x69b4('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x26c721,_0x3e14ce[_0x69b4('0x9')],_0x1f2200));}function handleFindAgent(_0x4b7c9c){return function(_0x273647){return _0x273647['name'][_0x69b4('0xa')]()===_0x4b7c9c[_0x69b4('0xa')]();};}exports[_0x69b4('0xb')]=function(_0x185f83,_0x5a3d42,_0x293077,_0x255a06){return function(_0x5c7a11){try{var _0x42783b={'name':_0x5a3d42[0x0],'timeout':_0x5a3d42[0x1]};var _0x1ae8c9=queue[_0x69b4('0x0')](_0x42783b,{'typecast':!![]});if(_0x1ae8c9[_0x69b4('0xc')]){logger[_0x69b4('0xd')](_0x69b4('0xe'),_0x185f83,_[_0x69b4('0xf')](_0x1ae8c9,_0x69b4('0x10'))[_0x69b4('0x11')](',\x20'));_0x5c7a11[_0x69b4('0x12')]();}else{var _0x45e511=_['find'](_0x293077[_0x69b4('0x13')],handleFindAgent(_0x42783b[_0x69b4('0x9')]));if(_0x45e511){var _0x4a0abf=(_0x42783b[_0x69b4('0x14')]||0xa)*0x3e8;var _0x532abf,_0x17b815;var _0x3853b3=seqqueue[_0x69b4('0x15')](_0x4a0abf);_0x3853b3['id']=_0x185f83;_0x3853b3['atimeout']=_0x4a0abf;_0x3853b3[_0x69b4('0x16')]=_0x255a06[_0x69b4('0x16')];writeLog(_0x185f83,_0x45e511,util[_0x69b4('0x8')](_0x69b4('0x17'),_0x4a0abf));_0x293077[_0x69b4('0x18')][_0x185f83]['on']('end',function(){logger[_0x69b4('0x19')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x185f83);clearTimeout(_0x17b815);_0x17b815=undefined;_0x3853b3[_0x69b4('0x1a')]();if(_0x293077[_0x69b4('0x18')][_0x185f83]){delete _0x293077[_0x69b4('0x18')][_0x185f83];}_0x5c7a11[_0x69b4('0x12')]();});_0x293077[_0x69b4('0x18')][_0x185f83]['on'](_0x69b4('0x1b'),function(){if(_0x293077[_0x69b4('0x18')][_0x185f83]){delete _0x293077['rules'][_0x185f83];}});_0x17b815=setTimeout(function(){logger['info'](_0x69b4('0x1c'),_0x185f83);clearTimeout(_0x17b815);_0x3853b3[_0x69b4('0x1a')]();_0x5c7a11[_0x69b4('0x1d')]();},_0x4a0abf);strategy[_0x69b4('0x1e')](_0x3853b3,_0x45e511,_0x293077,_0x255a06);}else{logger['error'](_0x69b4('0x1f'),_0x185f83,_0x42783b['name']);_0x5c7a11[_0x69b4('0x12')]();}}}catch(_0x16ef9a){console[_0x69b4('0x20')](_0x16ef9a);logger[_0x69b4('0xd')](_0x69b4('0x21'),_0x185f83,_0x16ef9a[_0x69b4('0x22')]);_0x5c7a11[_0x69b4('0x12')]();}};}; \ 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 aa7a80b..7b7b1c0 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 _0xf32d=['account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','then','error','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','providerResponse','create','dialogState','stop','catch','lodash','moment','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId'];(function(_0x1232e7,_0x3808cd){var _0x29a410=function(_0x297a02){while(--_0x297a02){_0x1232e7['push'](_0x1232e7['shift']());}};_0x29a410(++_0x3808cd);}(_0xf32d,0x1ac));var _0xdf32=function(_0x55c173,_0x4af204){_0x55c173=_0x55c173-0x0;var _0x2d6d18=_0xf32d[_0x55c173];return _0x2d6d18;};'use strict';var _=require(_0xdf32('0x0'));var moment=require(_0xdf32('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0xdf32('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdf32('0x3')),'mailMessage':require(_0xdf32('0x4')),'smsMessage':require(_0xdf32('0x5')),'faxMessage':require(_0xdf32('0x6')),'whatsappMessage':require(_0xdf32('0x7'))};exports[_0xdf32('0x8')]=function(_0x24a176,_0xc1714){return function(_0x1f2914){try{if(!_[_0xdf32('0x9')](this[_0xdf32('0xa')][_0xdf32('0xb')])){logger[_0xdf32('0xc')]('[%s][AMAZONLEX]\x20%s',_0x24a176,_0xdf32('0xd'));return _0x1f2914[_0xdf32('0xe')]();}var _0x201a66={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdf32('0xf')};if(this['channel']===_0xdf32('0x10')||this[_0xdf32('0x11')]===_0xdf32('0x12')){_0x201a66[_0xdf32('0x13')]=this['interaction'][_0xdf32('0x13')];}var _0x46629e=this[_0xdf32('0x11')];if(_0x46629e===_0xdf32('0x14')){_0x201a66[_0xdf32('0x15')]=this[_0xdf32('0x16')]['id'];}else{_0x201a66[_[_0xdf32('0x17')](_0x46629e)+'AccountId']=this[_0xdf32('0x16')]['id'];}_0x201a66[_['upperFirst'](_0x46629e)+_0xdf32('0x18')]=this[_0xdf32('0xa')]['id'];if(this[_0xdf32('0xa')]['created']){var _0x4f0b5e=_0xc1714[0x4];if(!_[_0xdf32('0x19')](_0x4f0b5e)){_0x201a66[_0xdf32('0x1a')]=utils[_0xdf32('0x1b')](_0x4f0b5e,this);return rpc[_0x46629e+_0xdf32('0x1c')]['create'](_0x201a66)[_0xdf32('0x1d')](function(_0x507026){logger[_0xdf32('0xc')]('[%s][AMAZONLEX]\x20%s',_0x24a176,_0x201a66[_0xdf32('0x1a')]);})['catch'](function(_0x108704){logger[_0xdf32('0x1e')](_0xdf32('0x1f'),_0x24a176,JSON[_0xdf32('0x20')](_0x108704));})[_0xdf32('0x21')](function(){logger[_0xdf32('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x24a176);_0x1f2914['stop']();});}else{logger[_0xdf32('0xc')](_0xdf32('0x22'),_0x24a176);_0x1f2914['stop']();}}else{var _0x4f3848=this;var _0x1a6cf6=new AWS[(_0xdf32('0x23'))]({'accessKeyId':_0xc1714[0x0],'secretAccessKey':_0xc1714[0x1],'region':_0xc1714[0x2]});var _0x24cd4f={'botAlias':_0xdf32('0x24'),'botName':_0xc1714[0x3],'inputText':this[_0xdf32('0x25')][_0xdf32('0x1a')],'userId':this[_0xdf32('0x11')]+':'+this[_0xdf32('0xa')]['id'][_0xdf32('0x26')]()};_0x1a6cf6[_0xdf32('0x27')](_0x24cd4f,function(_0x34286a,_0x222bcb){if(_0x34286a){logger[_0xdf32('0x1e')](_0xdf32('0x1f'),_0x24a176,_0x34286a[_0xdf32('0x25')]);_0x1f2914[_0xdf32('0xe')]();}else if(_0x222bcb&&_0x222bcb[_0xdf32('0x25')]){_0x4f3848[_0xdf32('0x1a')]['amazonlex']=_0x222bcb;_0x201a66['body']=_0x222bcb['message'];_0x201a66['providerName']='amazonlex';_0x201a66[_0xdf32('0x28')]=JSON[_0xdf32('0x20')](_0x222bcb);return rpc[_0x46629e+_0xdf32('0x1c')][_0xdf32('0x29')](_0x201a66)[_0xdf32('0x1d')](function(_0x329e1b){logger['info'](_0xdf32('0x1f'),_0x24a176,_0x201a66[_0xdf32('0x1a')]);if(_0x222bcb[_0xdf32('0x2a')]=='Failed'){_0x1f2914[_0xdf32('0xe')]();}else{_0x1f2914[_0xdf32('0x2b')]();}})[_0xdf32('0x2c')](function(_0x3191a6){logger[_0xdf32('0x1e')](_0xdf32('0x1f'),_0x24a176,JSON[_0xdf32('0x20')](_0x3191a6));_0x1f2914[_0xdf32('0xe')]();});}else{_0x1f2914['next']();}});}}catch(_0x2ea7f4){logger[_0xdf32('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x24a176,JSON[_0xdf32('0x20')](_0x2ea7f4));_0x1f2914[_0xdf32('0x2b')]();}};}; \ No newline at end of file +var _0x590b=['$LATEST','message','toString','postText','amazonlex','providerName','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x590b,0x134));var _0xb590=function(_0xd89b05,_0x4b8a2a){_0xd89b05=_0xd89b05-0x0;var _0x90dbe9=_0x590b[_0xd89b05];return _0x90dbe9;};'use strict';var _=require(_0xb590('0x0'));var moment=require(_0xb590('0x1'));var AWS=require(_0xb590('0x2'));var utils=require(_0xb590('0x3'));var logger=require(_0xb590('0x4'))(_0xb590('0x5'));var rpc={'chatMessage':require(_0xb590('0x6')),'openchannelMessage':require(_0xb590('0x7')),'mailMessage':require(_0xb590('0x8')),'smsMessage':require(_0xb590('0x9')),'faxMessage':require(_0xb590('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xb590('0xb')]=function(_0x117830,_0xaab8dc){return function(_0x28faf8){try{if(!_[_0xb590('0xc')](this['interaction']['UserId'])){logger[_0xb590('0xd')]('[%s][AMAZONLEX]\x20%s',_0x117830,_0xb590('0xe'));return _0x28faf8[_0xb590('0xf')]();}var _0x44cfd3={'ContactId':this[_0xb590('0x10')]['id'],'sentAt':moment()[_0xb590('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xb590('0x12')]==='sms'||this[_0xb590('0x12')]===_0xb590('0x13')){_0x44cfd3[_0xb590('0x14')]=this[_0xb590('0x15')][_0xb590('0x14')];}var _0x2ce187=this[_0xb590('0x12')];if(_0x2ce187===_0xb590('0x16')){_0x44cfd3[_0xb590('0x17')]=this[_0xb590('0x18')]['id'];}else{_0x44cfd3[_[_0xb590('0x19')](_0x2ce187)+_0xb590('0x1a')]=this[_0xb590('0x18')]['id'];}_0x44cfd3[_[_0xb590('0x19')](_0x2ce187)+_0xb590('0x1b')]=this[_0xb590('0x15')]['id'];if(this['interaction'][_0xb590('0x1c')]){var _0x23fe1d=_0xaab8dc[0x4];if(!_[_0xb590('0x1d')](_0x23fe1d)){_0x44cfd3[_0xb590('0x1e')]=utils[_0xb590('0x1f')](_0x23fe1d,this);return rpc[_0x2ce187+_0xb590('0x20')][_0xb590('0x21')](_0x44cfd3)[_0xb590('0x22')](function(_0x371bda){logger[_0xb590('0xd')](_0xb590('0x23'),_0x117830,_0x44cfd3[_0xb590('0x1e')]);})['catch'](function(_0x4dea76){logger[_0xb590('0x24')]('[%s][AMAZONLEX]\x20%s',_0x117830,JSON[_0xb590('0x25')](_0x4dea76));})[_0xb590('0x26')](function(){logger[_0xb590('0xd')](_0xb590('0x27'),_0x117830);_0x28faf8[_0xb590('0x28')]();});}else{logger[_0xb590('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x117830);_0x28faf8[_0xb590('0x28')]();}}else{var _0xbdcb49=this;var _0x3d6b57=new AWS[(_0xb590('0x29'))]({'accessKeyId':_0xaab8dc[0x0],'secretAccessKey':_0xaab8dc[0x1],'region':_0xaab8dc[0x2]});var _0x7f6646={'botAlias':_0xb590('0x2a'),'botName':_0xaab8dc[0x3],'inputText':this[_0xb590('0x2b')][_0xb590('0x1e')],'userId':this['channel']+':'+this[_0xb590('0x15')]['id'][_0xb590('0x2c')]()};_0x3d6b57[_0xb590('0x2d')](_0x7f6646,function(_0x22d287,_0x1ecc1e){if(_0x22d287){logger['error']('[%s][AMAZONLEX]\x20%s',_0x117830,_0x22d287['message']);_0x28faf8[_0xb590('0xf')]();}else if(_0x1ecc1e&&_0x1ecc1e[_0xb590('0x2b')]){_0xbdcb49[_0xb590('0x1e')][_0xb590('0x2e')]=_0x1ecc1e;_0x44cfd3['body']=_0x1ecc1e[_0xb590('0x2b')];_0x44cfd3[_0xb590('0x2f')]=_0xb590('0x2e');_0x44cfd3['providerResponse']=JSON[_0xb590('0x25')](_0x1ecc1e);return rpc[_0x2ce187+_0xb590('0x20')][_0xb590('0x21')](_0x44cfd3)[_0xb590('0x22')](function(_0x2f9ec9){logger[_0xb590('0xd')]('[%s][AMAZONLEX]\x20%s',_0x117830,_0x44cfd3[_0xb590('0x1e')]);if(_0x1ecc1e[_0xb590('0x30')]==_0xb590('0x31')){_0x28faf8[_0xb590('0xf')]();}else{_0x28faf8[_0xb590('0x28')]();}})['catch'](function(_0x1498c7){logger[_0xb590('0x24')](_0xb590('0x23'),_0x117830,JSON[_0xb590('0x25')](_0x1498c7));_0x28faf8[_0xb590('0xf')]();});}else{_0x28faf8[_0xb590('0xf')]();}});}}catch(_0x92d06b){logger[_0xb590('0x24')](_0xb590('0x23'),_0x117830,JSON[_0xb590('0x25')](_0x92d06b));_0x28faf8[_0xb590('0x28')]();}};}; \ 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 f911372..dd035c1 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 _0x9926=['interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','','replace','';_0x486150[_0x6992('0x3c')]={'Auto-Submitted':_0x6992('0x3d'),'X-Auto-Response-Suppress':_0x6992('0x3e'),'Precedence':_0x6992('0x3f')};return mailRpc[_0x6992('0x40')](_0x352d88,_0x486150)[_0x6992('0x41')](function(_0x2ae963){logger[_0x6992('0x16')](_0x6992('0x42'),_0x2a337e);_0x486150[_0x6992('0x36')]=_0x2ae963[_0x6992('0x1d')][_0x6992('0x36')];return rpc[_0xc52c98+_0x6992('0x2b')]['create'](_0x486150);})[_0x6992('0x41')](function(_0x4a78bb){logger[_0x6992('0x16')](_0x6992('0x14'),_0x2a337e,JSON[_0x6992('0x43')](_0x4a78bb));})[_0x6992('0x44')](function(_0xabe272){logger[_0x6992('0x45')](_0x6992('0x46'),_0x2a337e,JSON['stringify'](_0xabe272));})[_0x6992('0x47')](function(){Promise['resolve']()['then'](function(){if(_0x353e25[0x0]!=='2'||_0x260ddb[_0x6992('0x48')])return;return rpc[_0xc52c98+_0x6992('0x49')]['update'](_0x260ddb['id'],{'autoreplyExecuted':!![]})[_0x6992('0x41')](function(_0xfaa615){logger[_0x6992('0x16')](_0x6992('0x17'),_0x2a337e,JSON[_0x6992('0x43')](_0xfaa615));})['catch'](function(_0xb67e85){logger[_0x6992('0x45')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2a337e,JSON[_0x6992('0x43')](_0xb67e85));});})[_0x6992('0x41')](function(){_0x1b46e1[_0x6992('0x11')]();});});}else{return rpc[this[_0x6992('0xc')]+_0x6992('0x2b')][_0x6992('0x4a')](_0x486150)[_0x6992('0x41')](function(_0x20f49d){logger['info']('[%s][AUTOREPLY]\x20%s',_0x2a337e,_0x486150[_0x6992('0xe')]);})[_0x6992('0x44')](function(_0x533079){logger[_0x6992('0x45')](_0x6992('0x14'),_0x2a337e,JSON[_0x6992('0x43')](_0x533079));})[_0x6992('0x47')](function(){Promise[_0x6992('0x4b')]()[_0x6992('0x41')](function(){if(_0x353e25[0x0]!=='2'||_0x260ddb[_0x6992('0x48')])return;return rpc[_0xc52c98+'Interaction'][_0x6992('0x4c')](_0x260ddb['id'],{'autoreplyExecuted':!![]})['then'](function(_0x10f3ca){logger[_0x6992('0x16')](_0x6992('0x17'),_0x2a337e,JSON[_0x6992('0x43')](_0x10f3ca));})[_0x6992('0x44')](function(_0x9bc2f3){logger['error'](_0x6992('0x4d'),_0x2a337e,JSON[_0x6992('0x43')](_0x9bc2f3));});})['then'](function(){_0x1b46e1[_0x6992('0x11')]();});});}}}catch(_0x4287dd){logger[_0x6992('0x45')](_0x6992('0x14'),_0x2a337e,JSON['stringify'](_0x4287dd));_0x1b46e1[_0x6992('0x4e')]();}};}; \ No newline at end of file +var _0x30f1=['startsWith','Re:','Re:\x20','chat','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','user','inReplyTo','messageId','html','','replace','';_0x535f9a[_0x130f('0x37')]={'Auto-Submitted':_0x130f('0x38'),'X-Auto-Response-Suppress':'All','Precedence':_0x130f('0x39')};return mailRpc[_0x130f('0x3a')](_0x744cc,_0x535f9a)[_0x130f('0x3b')](function(_0x3095f1){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3e515e);_0x535f9a['messageId']=_0x3095f1[_0x130f('0x1d')][_0x130f('0x31')];return rpc[_0x2ea31f+_0x130f('0x29')][_0x130f('0x3c')](_0x535f9a);})['then'](function(_0x511c63){logger[_0x130f('0xc')]('[%s][AUTOREPLY]\x20%s',_0x3e515e,JSON[_0x130f('0x3d')](_0x511c63));})[_0x130f('0x3e')](function(_0x23342f){logger['error'](_0x130f('0x3f'),_0x3e515e,JSON['stringify'](_0x23342f));})[_0x130f('0x40')](function(){Promise['resolve']()[_0x130f('0x3b')](function(){if(_0xec7f6[0x0]!=='2'||_0x2f1d0b[_0x130f('0x13')])return;return rpc[_0x2ea31f+'Interaction'][_0x130f('0x41')](_0x2f1d0b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x334f28){logger['info'](_0x130f('0x14'),_0x3e515e,JSON[_0x130f('0x3d')](_0x334f28));})[_0x130f('0x3e')](function(_0x581a8e){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3e515e,JSON['stringify'](_0x581a8e));});})['then'](function(){_0x2e5c0d[_0x130f('0x42')]();});});}else{return rpc[this['channel']+'Message']['create'](_0x535f9a)['then'](function(_0x545ea0){logger['info'](_0x130f('0xd'),_0x3e515e,_0x535f9a[_0x130f('0xb')]);})['catch'](function(_0x537b9a){logger[_0x130f('0x43')](_0x130f('0xd'),_0x3e515e,JSON['stringify'](_0x537b9a));})[_0x130f('0x40')](function(){Promise[_0x130f('0x44')]()[_0x130f('0x3b')](function(){if(_0xec7f6[0x0]!=='2'||_0x2f1d0b[_0x130f('0x13')])return;return rpc[_0x2ea31f+_0x130f('0x45')][_0x130f('0x41')](_0x2f1d0b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1f7736){logger[_0x130f('0xc')](_0x130f('0x14'),_0x3e515e,JSON[_0x130f('0x3d')](_0x1f7736));})[_0x130f('0x3e')](function(_0x1d6789){logger[_0x130f('0x43')](_0x130f('0x46'),_0x3e515e,JSON[_0x130f('0x3d')](_0x1d6789));});})['then'](function(){_0x2e5c0d['next']();});});}}}catch(_0x1bcd4b){logger[_0x130f('0x43')](_0x130f('0xd'),_0x3e515e,JSON[_0x130f('0x3d')](_0x1bcd4b));_0x2e5c0d[_0x130f('0x47')]();}};}; \ 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 ede4f74..af6ec98 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 _0x4d99=['../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','catch','[%s][CLOSE]\x20%s','finally','error','stringify','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x40d078,_0x541e13){var _0x52c06b=function(_0x151fb5){while(--_0x151fb5){_0x40d078['push'](_0x40d078['shift']());}};_0x52c06b(++_0x541e13);}(_0x4d99,0xa3));var _0x94d9=function(_0x4cf6b9,_0x5d7f3a){_0x4cf6b9=_0x4cf6b9-0x0;var _0x322f8e=_0x4d99[_0x4cf6b9];return _0x322f8e;};'use strict';var moment=require(_0x94d9('0x0'));var logger=require(_0x94d9('0x1'))('routing');var rpc={'chatInteraction':require(_0x94d9('0x2')),'openchannelInteraction':require(_0x94d9('0x3')),'smsInteraction':require(_0x94d9('0x4')),'mailInteraction':require(_0x94d9('0x5')),'faxInteraction':require(_0x94d9('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x94d9('0x7')]=function(_0x3f805a,_0xf1e5fd,_0x16f301,_0x5eba57){return function(_0x298def){try{logger[_0x94d9('0x8')](_0x94d9('0x9'),_0x3f805a,_0xf1e5fd[0x0]);var _0x137e63={'closed':0x1,'closedAt':moment()['format'](_0x94d9('0xa')),'closeReason':_0x94d9('0xb'),'disposition':_0xf1e5fd[0x0]};if(rpc[_0x5eba57[_0x94d9('0xc')]+'Interaction']){rpc[_0x5eba57[_0x94d9('0xc')]+_0x94d9('0xd')][_0x94d9('0xe')](_0x5eba57['interaction']['id'],_0x137e63)['then'](function(_0x41a06a){logger[_0x94d9('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x3f805a,_0x5eba57['interaction']['id']);})[_0x94d9('0xf')](function(_0x88df4e){logger['error'](_0x94d9('0x10'),_0x3f805a,JSON['stringify'](_0x88df4e));})[_0x94d9('0x11')](function(){_0x298def['stop']();});}}catch(_0x4e7c63){logger[_0x94d9('0x12')](_0x94d9('0x10'),_0x3f805a,JSON[_0x94d9('0x13')](_0x4e7c63));_0x298def[_0x94d9('0x14')]();}};}; \ No newline at end of file +var _0x32a1=['YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','finally','[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0xe84d0c,_0x398aec){var _0x331fff=function(_0x4dea56){while(--_0x4dea56){_0xe84d0c['push'](_0xe84d0c['shift']());}};_0x331fff(++_0x398aec);}(_0x32a1,0xfe));var _0x132a=function(_0x489d7c,_0x22cd8d){_0x489d7c=_0x489d7c-0x0;var _0x1af217=_0x32a1[_0x489d7c];return _0x1af217;};'use strict';var moment=require('moment');var logger=require(_0x132a('0x0'))(_0x132a('0x1'));var rpc={'chatInteraction':require(_0x132a('0x2')),'openchannelInteraction':require(_0x132a('0x3')),'smsInteraction':require(_0x132a('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x132a('0x5')),'whatsappInteraction':require(_0x132a('0x6'))};exports['consequence']=function(_0x5749dc,_0x44dab4,_0x4e5933,_0x55e265){return function(_0xd5e3f8){try{logger[_0x132a('0x7')](_0x132a('0x8'),_0x5749dc,_0x44dab4[0x0]);var _0x5dcf90={'closed':0x1,'closedAt':moment()[_0x132a('0x9')](_0x132a('0xa')),'closeReason':_0x132a('0xb'),'disposition':_0x44dab4[0x0]};if(rpc[_0x55e265['channel']+_0x132a('0xc')]){rpc[_0x55e265[_0x132a('0xd')]+_0x132a('0xc')][_0x132a('0xe')](_0x55e265[_0x132a('0xf')]['id'],_0x5dcf90)['then'](function(_0x1c0ca8){logger['info'](_0x132a('0x10'),_0x5749dc,_0x55e265[_0x132a('0xf')]['id']);})['catch'](function(_0x306032){logger[_0x132a('0x11')]('[%s][CLOSE]\x20%s',_0x5749dc,JSON['stringify'](_0x306032));})[_0x132a('0x12')](function(){_0xd5e3f8['stop']();});}}catch(_0x558bc0){logger[_0x132a('0x11')](_0x132a('0x13'),_0x5749dc,JSON[_0x132a('0x14')](_0x558bc0));_0xd5e3f8[_0x132a('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 749b63c..9cbd5f8 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 _0xa4bd=['account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','catch','error','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','providerName','result','metadata','endConversation','stringify','next','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId'];(function(_0xe838fc,_0x16b72c){var _0x1a9bdf=function(_0x2890e3){while(--_0x2890e3){_0xe838fc['push'](_0xe838fc['shift']());}};_0x1a9bdf(++_0x16b72c);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x173875,_0x5e7c3e){_0x173875=_0x173875-0x0;var _0x15cef5=_0xa4bd[_0x173875];return _0x15cef5;};'use strict';var _=require(_0xda4b('0x0'));var moment=require(_0xda4b('0x1'));var apiai=require(_0xda4b('0x2'));var md5=require('md5');var utils=require(_0xda4b('0x3'));var logger=require(_0xda4b('0x4'))(_0xda4b('0x5'));var rpc={'chatMessage':require(_0xda4b('0x6')),'openchannelMessage':require(_0xda4b('0x7')),'mailMessage':require(_0xda4b('0x8')),'smsMessage':require(_0xda4b('0x9')),'faxMessage':require(_0xda4b('0xa')),'whatsappMessage':require(_0xda4b('0xb'))};exports[_0xda4b('0xc')]=function(_0x490a68,_0x3bdef4){return function(_0x29f805){try{if(!_[_0xda4b('0xd')](this[_0xda4b('0xe')]['UserId'])){logger[_0xda4b('0xf')](_0xda4b('0x10'),_0x490a68,_0xda4b('0x11'));return _0x29f805['next']();}var _0x2e439e={'ContactId':this['contact']['id'],'sentAt':moment()[_0xda4b('0x12')](_0xda4b('0x13')),'direction':_0xda4b('0x14')};if(this[_0xda4b('0x15')]==='sms'||this[_0xda4b('0x15')]===_0xda4b('0x16')){_0x2e439e[_0xda4b('0x17')]=this[_0xda4b('0xe')][_0xda4b('0x17')];}var _0x3ed2d7=this[_0xda4b('0x15')];if(_0x3ed2d7===_0xda4b('0x18')){_0x2e439e[_0xda4b('0x19')]=this[_0xda4b('0x1a')]['id'];}else{_0x2e439e[_['upperFirst'](_0x3ed2d7)+_0xda4b('0x1b')]=this[_0xda4b('0x1a')]['id'];}_0x2e439e[_[_0xda4b('0x1c')](_0x3ed2d7)+_0xda4b('0x1d')]=this[_0xda4b('0xe')]['id'];if(this[_0xda4b('0xe')][_0xda4b('0x1e')]){var _0x45bbbf=_0x3bdef4[0x2];if(!_[_0xda4b('0x1f')](_0x45bbbf)){_0x2e439e[_0xda4b('0x20')]=utils[_0xda4b('0x21')](_0x45bbbf,this);return rpc[_0x3ed2d7+_0xda4b('0x22')]['create'](_0x2e439e)[_0xda4b('0x23')](function(_0x56c65e){logger['info'](_0xda4b('0x10'),_0x490a68,_0x2e439e[_0xda4b('0x20')]);})[_0xda4b('0x24')](function(_0x219ee1){logger[_0xda4b('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x490a68,JSON['stringify'](_0x219ee1));})[_0xda4b('0x26')](function(){logger[_0xda4b('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x490a68);_0x29f805[_0xda4b('0x27')]();});}else{logger[_0xda4b('0xf')](_0xda4b('0x28'),_0x490a68);_0x29f805['stop']();}}else{var _0x48d8a8=this;var _0x3e9f20=apiai(_0x3bdef4[0x0],{'language':_0x3bdef4[0x1]||'en'});return _0x3e9f20[_0xda4b('0x29')](this[_0xda4b('0x2a')][_0xda4b('0x20')],{'sessionId':md5(this[_0xda4b('0xe')]['id'])})[_0xda4b('0x23')](function(_0x108adf){_0x48d8a8[_0xda4b('0x20')][_0xda4b('0x2b')]=_0x108adf;_0x2e439e[_0xda4b('0x20')]=_0x108adf['result'][_0xda4b('0x2c')]['speech'];_0x2e439e[_0xda4b('0x2d')]=_0xda4b('0x2b');_0x2e439e['providerResponse']=JSON['stringify'](_0x108adf);return rpc[_0x3ed2d7+_0xda4b('0x22')]['create'](_0x2e439e)[_0xda4b('0x23')](function(_0x26f68d){logger[_0xda4b('0xf')](_0xda4b('0x10'),_0x490a68,_0x2e439e['body']);if(_0x108adf[_0xda4b('0x2e')][_0xda4b('0x2f')][_0xda4b('0x30')]){_0x29f805['next']();}else{_0x29f805['stop']();}})[_0xda4b('0x24')](function(_0x1277cc){logger['error'](_0xda4b('0x10'),_0x490a68,JSON[_0xda4b('0x31')](_0x1277cc));_0x29f805['next']();});})[_0xda4b('0x24')](function(_0xb10514){logger['error'](_0xda4b('0x10'),_0x490a68,_0xb10514[_0xda4b('0x2a')]);_0x29f805[_0xda4b('0x32')]();});}}catch(_0x598ca4){logger['error'](_0xda4b('0x10'),_0x490a68,JSON[_0xda4b('0x31')](_0x598ca4));_0x29f805[_0xda4b('0x27')]();}};}; \ No newline at end of file +var _0xb39f=['account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','then','info','[%s][DIALOGFLOW]\x20%s','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','fulfillment','speech','providerName','dialogflow','providerResponse','create','result','catch','lodash','moment','apiai-promise','md5','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb39f,0x1e6));var _0xfb39=function(_0x28878e,_0x387189){_0x28878e=_0x28878e-0x0;var _0x337e27=_0xb39f[_0x28878e];return _0x337e27;};'use strict';var _=require(_0xfb39('0x0'));var moment=require(_0xfb39('0x1'));var apiai=require(_0xfb39('0x2'));var md5=require(_0xfb39('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xfb39('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfb39('0x5')),'smsMessage':require(_0xfb39('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xfb39('0x7'))};exports[_0xfb39('0x8')]=function(_0x45bb1c,_0x23eb37){return function(_0x4ce401){try{if(!_['isNil'](this[_0xfb39('0x9')][_0xfb39('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x45bb1c,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4ce401[_0xfb39('0xb')]();}var _0x35eaa1={'ContactId':this[_0xfb39('0xc')]['id'],'sentAt':moment()[_0xfb39('0xd')](_0xfb39('0xe')),'direction':'out'};if(this[_0xfb39('0xf')]===_0xfb39('0x10')||this[_0xfb39('0xf')]===_0xfb39('0x11')){_0x35eaa1[_0xfb39('0x12')]=this['interaction']['phone'];}var _0x359dea=this[_0xfb39('0xf')];if(_0x359dea===_0xfb39('0x13')){_0x35eaa1['ChatWebsiteId']=this[_0xfb39('0x14')]['id'];}else{_0x35eaa1[_[_0xfb39('0x15')](_0x359dea)+'AccountId']=this['account']['id'];}_0x35eaa1[_[_0xfb39('0x15')](_0x359dea)+_0xfb39('0x16')]=this[_0xfb39('0x9')]['id'];if(this['interaction']['created']){var _0x1fb6ff=_0x23eb37[0x2];if(!_[_0xfb39('0x17')](_0x1fb6ff)){_0x35eaa1[_0xfb39('0x18')]=utils[_0xfb39('0x19')](_0x1fb6ff,this);return rpc[_0x359dea+_0xfb39('0x1a')]['create'](_0x35eaa1)[_0xfb39('0x1b')](function(_0xd2ad6d){logger[_0xfb39('0x1c')](_0xfb39('0x1d'),_0x45bb1c,_0x35eaa1['body']);})['catch'](function(_0x1d3972){logger[_0xfb39('0x1e')](_0xfb39('0x1d'),_0x45bb1c,JSON[_0xfb39('0x1f')](_0x1d3972));})[_0xfb39('0x20')](function(){logger['info'](_0xfb39('0x21'),_0x45bb1c);_0x4ce401[_0xfb39('0x22')]();});}else{logger[_0xfb39('0x1c')](_0xfb39('0x23'),_0x45bb1c);_0x4ce401[_0xfb39('0x22')]();}}else{var _0x5f2f60=this;var _0x50b2e2=apiai(_0x23eb37[0x0],{'language':_0x23eb37[0x1]||'en'});return _0x50b2e2[_0xfb39('0x24')](this[_0xfb39('0x25')]['body'],{'sessionId':md5(this[_0xfb39('0x9')]['id'])})[_0xfb39('0x1b')](function(_0x23bd78){_0x5f2f60['body']['dialogflow']=_0x23bd78;_0x35eaa1[_0xfb39('0x18')]=_0x23bd78['result'][_0xfb39('0x26')][_0xfb39('0x27')];_0x35eaa1[_0xfb39('0x28')]=_0xfb39('0x29');_0x35eaa1[_0xfb39('0x2a')]=JSON[_0xfb39('0x1f')](_0x23bd78);return rpc[_0x359dea+_0xfb39('0x1a')][_0xfb39('0x2b')](_0x35eaa1)[_0xfb39('0x1b')](function(_0x1be43e){logger[_0xfb39('0x1c')](_0xfb39('0x1d'),_0x45bb1c,_0x35eaa1[_0xfb39('0x18')]);if(_0x23bd78[_0xfb39('0x2c')]['metadata']['endConversation']){_0x4ce401[_0xfb39('0xb')]();}else{_0x4ce401[_0xfb39('0x22')]();}})[_0xfb39('0x2d')](function(_0x2a247c){logger[_0xfb39('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x45bb1c,JSON['stringify'](_0x2a247c));_0x4ce401[_0xfb39('0xb')]();});})['catch'](function(_0x511a9f){logger[_0xfb39('0x1e')](_0xfb39('0x1d'),_0x45bb1c,_0x511a9f['message']);_0x4ce401['next']();});}}catch(_0x118875){logger[_0xfb39('0x1e')](_0xfb39('0x1d'),_0x45bb1c,JSON[_0xfb39('0x1f')](_0x118875));_0x4ce401[_0xfb39('0x22')]();}};}; \ 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 72bb121..91f23dc 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 _0xc69b=['info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','then','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','isNil','interaction','UserId'];(function(_0x354179,_0x3557aa){var _0x59bddf=function(_0x237a4e){while(--_0x237a4e){_0x354179['push'](_0x354179['shift']());}};_0x59bddf(++_0x3557aa);}(_0xc69b,0x1d3));var _0xbc69=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xc69b[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xbc69('0x0'));var dialogflow=require(_0xbc69('0x1'));var md5=require('md5');var moment=require(_0xbc69('0x2'));var Promise=require(_0xbc69('0x3'));var logger=require(_0xbc69('0x4'))(_0xbc69('0x5'));var utils=require(_0xbc69('0x6'));var rpc={'chatMessage':require(_0xbc69('0x7')),'openchannelMessage':require(_0xbc69('0x8')),'mailMessage':require(_0xbc69('0x9')),'smsMessage':require(_0xbc69('0xa')),'faxMessage':require(_0xbc69('0xb')),'whatsappMessage':require(_0xbc69('0xc'))};function createMessage(_0x52ff80,_0x4310c9,_0x397ac4,_0x369823){return new Promise(function(_0x2ef35a,_0x537b46){var _0x42972d=_[_0xbc69('0xd')](_0x397ac4);_0x42972d[_0xbc69('0xe')]=_0x369823;return rpc[_0x4310c9+'Message'][_0xbc69('0xf')](_0x42972d)['then'](function(){logger['info'](_0xbc69('0x10'),_0x52ff80,_0x42972d['body']);_0x2ef35a();})[_0xbc69('0x11')](function(_0x1db934){logger['error'](_0xbc69('0x10'),_0x52ff80,JSON[_0xbc69('0x12')](_0x1db934));_0x537b46(_0x1db934);});});}exports[_0xbc69('0x13')]=function(_0x3e68ab,_0x13dd05){return function(_0x31ef15){try{if(!_[_0xbc69('0x14')](this[_0xbc69('0x15')][_0xbc69('0x16')])){logger[_0xbc69('0x17')]('[%s][DIALOGFLOWV2]\x20%s',_0x3e68ab,_0xbc69('0x18'));return _0x31ef15[_0xbc69('0x19')]();}var _0x117ca1={'ContactId':this[_0xbc69('0x1a')]['id'],'sentAt':moment()[_0xbc69('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xbc69('0x1c')]===_0xbc69('0x1d')||this[_0xbc69('0x1c')]==='whatsapp'){_0x117ca1['phone']=this[_0xbc69('0x15')][_0xbc69('0x1e')];}var _0x321542=this[_0xbc69('0x1c')];if(_0x321542===_0xbc69('0x1f')){_0x117ca1[_0xbc69('0x20')]=this[_0xbc69('0x21')]['id'];}else{_0x117ca1[_[_0xbc69('0x22')](_0x321542)+'AccountId']=this[_0xbc69('0x21')]['id'];}_0x117ca1[_[_0xbc69('0x22')](_0x321542)+_0xbc69('0x23')]=this[_0xbc69('0x15')]['id'];if(this[_0xbc69('0x15')]['created']){var _0x28c38b=_0x13dd05[0x4];if(!_[_0xbc69('0x24')](_0x28c38b)){_0x117ca1[_0xbc69('0xe')]=utils[_0xbc69('0x25')](_0x28c38b,this);return rpc[_0x321542+_0xbc69('0x26')]['create'](_0x117ca1)[_0xbc69('0x27')](function(_0x38e6a3){logger[_0xbc69('0x17')](_0xbc69('0x10'),_0x3e68ab,_0x117ca1['body']);})[_0xbc69('0x11')](function(_0xc40abc){logger[_0xbc69('0x28')](_0xbc69('0x10'),_0x3e68ab,JSON[_0xbc69('0x12')](_0xc40abc));})[_0xbc69('0x29')](function(){logger[_0xbc69('0x17')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3e68ab);_0x31ef15['stop']();});}else{logger[_0xbc69('0x17')](_0xbc69('0x2a'),_0x3e68ab);_0x31ef15[_0xbc69('0x2b')]();}}else{var _0x49c74c=this;var _0x376408=_0x13dd05[0x2][_0xbc69('0x2c')](/\\n/g,'\x0a');var _0x14daa0={'credentials':{'private_key':_0x376408,'client_email':_0x13dd05[0x1]}};var _0x26594e=new dialogflow[(_0xbc69('0x2d'))](_0x14daa0);var _0x270044=_0x26594e[_0xbc69('0x2e')](_0x13dd05[0x0],md5(_0x49c74c[_0xbc69('0x15')]['id']));var _0x1e41ae={'session':_0x270044,'queryInput':{'text':{'text':_0x49c74c['message'][_0xbc69('0xe')],'languageCode':_0x13dd05[0x3]||'en'}}};return _0x26594e['detectIntent'](_0x1e41ae)[_0xbc69('0x27')](function(_0x4566b5){if(_0x4566b5&&_0x4566b5[_0xbc69('0x2f')]){_0x49c74c[_0xbc69('0xe')][_0xbc69('0x30')]=_0x4566b5;var _0x33ac5f=_0x4566b5[0x0];var _0x39265a=_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x32')]&&_0x33ac5f['queryResult'][_0xbc69('0x32')]['fields']?_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x32')][_0xbc69('0x33')][_0xbc69('0x34')]['boolValue']:![];_0x49c74c[_0xbc69('0xe')][_0xbc69('0x35')]=_0x33ac5f['queryResult'][_0xbc69('0x36')];_0x49c74c[_0xbc69('0xe')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x33ac5f[_0xbc69('0x31')]['allRequiredParamsPresent'];_0x49c74c[_0xbc69('0xe')][_0xbc69('0x37')]=_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x32')]&&_0x33ac5f['queryResult'][_0xbc69('0x32')][_0xbc69('0x33')]?_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x32')][_0xbc69('0x33')][_0xbc69('0x34')]['boolValue']:![];_0x49c74c['body'][_0xbc69('0x38')]=_0x33ac5f['queryResult']['intent'][_0xbc69('0x39')];_0x49c74c[_0xbc69('0xe')][_0xbc69('0x3a')]=_0x33ac5f['queryResult'][_0xbc69('0x3b')]['displayName'];_0x49c74c[_0xbc69('0xe')][_0xbc69('0x3c')]=_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x3b')][_0xbc69('0x3d')];_0x49c74c[_0xbc69('0xe')][_0xbc69('0x3e')]=_0x33ac5f['queryResult']['languageCode'];_0x49c74c[_0xbc69('0xe')]['DIALOGFLOWV2_QUERYTEXT']=_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x3f')];_0x49c74c[_0xbc69('0xe')]['DIALOGFLOWV2_SCORE']=_0x33ac5f[_0xbc69('0x31')][_0xbc69('0x40')];_0x117ca1[_0xbc69('0x41')]=_0xbc69('0x30');_0x117ca1[_0xbc69('0x42')]=JSON[_0xbc69('0x12')](_0x4566b5);var _0x293d16=[];for(var _0x299909=0x0;_0x299909<_0x4566b5[_0xbc69('0x2f')];_0x299909++){var _0x19d27a=_0x4566b5[_0x299909];if(_0x19d27a&&_0x19d27a[_0xbc69('0x31')]&&_0x19d27a[_0xbc69('0x31')][_0xbc69('0x43')]){_0x293d16[_0xbc69('0x44')](createMessage(_0x3e68ab,_0x321542,_0x117ca1,_0x19d27a[_0xbc69('0x31')][_0xbc69('0x43')]));}}return Promise[_0xbc69('0x45')](_0x293d16)[_0xbc69('0x27')](function(){if(_0x39265a){_0x31ef15[_0xbc69('0x19')]();}else{_0x31ef15[_0xbc69('0x2b')]();}})[_0xbc69('0x11')](function(_0x1d8a68){logger[_0xbc69('0x28')](_0xbc69('0x10'),_0x3e68ab,JSON[_0xbc69('0x12')](_0x1d8a68));_0x31ef15[_0xbc69('0x19')]();});}})[_0xbc69('0x11')](function(_0x4f5333){logger['error'](_0xbc69('0x10'),_0x3e68ab,_0x4f5333['message']);_0x31ef15['next']();});}}catch(_0x47c89c){logger[_0xbc69('0x28')](_0xbc69('0x10'),_0x3e68ab,JSON['stringify'](_0x47c89c));_0x31ef15['stop']();}};}; \ No newline at end of file +var _0xa9e7=['chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','providerName','length','push','fulfillmentText','lodash','dialogflow','md5','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone'];(function(_0x543ab7,_0x29e7d6){var _0x4edd42=function(_0x3fd276){while(--_0x3fd276){_0x543ab7['push'](_0x543ab7['shift']());}};_0x4edd42(++_0x29e7d6);}(_0xa9e7,0xfa));var _0x7a9e=function(_0x449e84,_0x505ae7){_0x449e84=_0x449e84-0x0;var _0x72d311=_0xa9e7[_0x449e84];return _0x72d311;};'use strict';var _=require(_0x7a9e('0x0'));var dialogflow=require(_0x7a9e('0x1'));var md5=require(_0x7a9e('0x2'));var moment=require('moment');var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x7a9e('0x3'));var utils=require(_0x7a9e('0x4'));var rpc={'chatMessage':require(_0x7a9e('0x5')),'openchannelMessage':require(_0x7a9e('0x6')),'mailMessage':require(_0x7a9e('0x7')),'smsMessage':require(_0x7a9e('0x8')),'faxMessage':require(_0x7a9e('0x9')),'whatsappMessage':require(_0x7a9e('0xa'))};function createMessage(_0x47e0dd,_0x1ea453,_0x4fe768,_0x30745a){return new Promise(function(_0x2c704b,_0x4f5a9d){var _0x3e1842=_[_0x7a9e('0xb')](_0x4fe768);_0x3e1842[_0x7a9e('0xc')]=_0x30745a;return rpc[_0x1ea453+'Message'][_0x7a9e('0xd')](_0x3e1842)[_0x7a9e('0xe')](function(){logger[_0x7a9e('0xf')](_0x7a9e('0x10'),_0x47e0dd,_0x3e1842['body']);_0x2c704b();})['catch'](function(_0x126637){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x47e0dd,JSON[_0x7a9e('0x11')](_0x126637));_0x4f5a9d(_0x126637);});});}exports['consequence']=function(_0x14b994,_0x3ded65){return function(_0x13a156){try{if(!_[_0x7a9e('0x12')](this[_0x7a9e('0x13')][_0x7a9e('0x14')])){logger[_0x7a9e('0xf')](_0x7a9e('0x10'),_0x14b994,_0x7a9e('0x15'));return _0x13a156[_0x7a9e('0x16')]();}var _0x12789d={'ContactId':this[_0x7a9e('0x17')]['id'],'sentAt':moment()[_0x7a9e('0x18')](_0x7a9e('0x19')),'direction':_0x7a9e('0x1a')};if(this['channel']===_0x7a9e('0x1b')||this[_0x7a9e('0x1c')]==='whatsapp'){_0x12789d[_0x7a9e('0x1d')]=this[_0x7a9e('0x13')][_0x7a9e('0x1d')];}var _0x47b8d8=this[_0x7a9e('0x1c')];if(_0x47b8d8===_0x7a9e('0x1e')){_0x12789d['ChatWebsiteId']=this[_0x7a9e('0x1f')]['id'];}else{_0x12789d[_[_0x7a9e('0x20')](_0x47b8d8)+_0x7a9e('0x21')]=this['account']['id'];}_0x12789d[_[_0x7a9e('0x20')](_0x47b8d8)+_0x7a9e('0x22')]=this[_0x7a9e('0x13')]['id'];if(this[_0x7a9e('0x13')][_0x7a9e('0x23')]){var _0x2ff50f=_0x3ded65[0x4];if(!_[_0x7a9e('0x24')](_0x2ff50f)){_0x12789d[_0x7a9e('0xc')]=utils[_0x7a9e('0x25')](_0x2ff50f,this);return rpc[_0x47b8d8+'Message'][_0x7a9e('0xd')](_0x12789d)['then'](function(_0x14dded){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x14b994,_0x12789d['body']);})[_0x7a9e('0x26')](function(_0x5e1911){logger[_0x7a9e('0x27')](_0x7a9e('0x10'),_0x14b994,JSON[_0x7a9e('0x11')](_0x5e1911));})[_0x7a9e('0x28')](function(){logger['info'](_0x7a9e('0x29'),_0x14b994);_0x13a156[_0x7a9e('0x2a')]();});}else{logger[_0x7a9e('0xf')](_0x7a9e('0x2b'),_0x14b994);_0x13a156['stop']();}}else{var _0x1050b2=this;var _0x4d7e9f=_0x3ded65[0x2][_0x7a9e('0x2c')](/\\n/g,'\x0a');var _0x5abb18={'credentials':{'private_key':_0x4d7e9f,'client_email':_0x3ded65[0x1]}};var _0x4956cd=new dialogflow[(_0x7a9e('0x2d'))](_0x5abb18);var _0x5e7f81=_0x4956cd[_0x7a9e('0x2e')](_0x3ded65[0x0],md5(_0x1050b2[_0x7a9e('0x13')]['id']));var _0x449576={'session':_0x5e7f81,'queryInput':{'text':{'text':_0x1050b2[_0x7a9e('0x2f')]['body'],'languageCode':_0x3ded65[0x3]||'en'}}};return _0x4956cd[_0x7a9e('0x30')](_0x449576)[_0x7a9e('0xe')](function(_0x13cf1e){if(_0x13cf1e&&_0x13cf1e['length']){_0x1050b2[_0x7a9e('0xc')][_0x7a9e('0x31')]=_0x13cf1e;var _0x311585=_0x13cf1e[0x0];var _0x260c7b=_0x311585[_0x7a9e('0x32')]['diagnosticInfo']&&_0x311585['queryResult'][_0x7a9e('0x33')][_0x7a9e('0x34')]?_0x311585[_0x7a9e('0x32')]['diagnosticInfo']['fields'][_0x7a9e('0x35')][_0x7a9e('0x36')]:![];_0x1050b2[_0x7a9e('0xc')][_0x7a9e('0x37')]=_0x311585[_0x7a9e('0x32')]['action'];_0x1050b2[_0x7a9e('0xc')][_0x7a9e('0x38')]=_0x311585[_0x7a9e('0x32')][_0x7a9e('0x39')];_0x1050b2[_0x7a9e('0xc')][_0x7a9e('0x3a')]=_0x311585[_0x7a9e('0x32')][_0x7a9e('0x33')]&&_0x311585[_0x7a9e('0x32')]['diagnosticInfo'][_0x7a9e('0x34')]?_0x311585['queryResult'][_0x7a9e('0x33')][_0x7a9e('0x34')][_0x7a9e('0x35')][_0x7a9e('0x36')]:![];_0x1050b2[_0x7a9e('0xc')][_0x7a9e('0x3b')]=_0x311585['queryResult'][_0x7a9e('0x3c')][_0x7a9e('0x3d')];_0x1050b2[_0x7a9e('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x311585[_0x7a9e('0x32')][_0x7a9e('0x3c')][_0x7a9e('0x3e')];_0x1050b2[_0x7a9e('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x311585[_0x7a9e('0x32')][_0x7a9e('0x3c')]['isFallback'];_0x1050b2[_0x7a9e('0xc')][_0x7a9e('0x3f')]=_0x311585['queryResult']['languageCode'];_0x1050b2['body'][_0x7a9e('0x40')]=_0x311585[_0x7a9e('0x32')][_0x7a9e('0x41')];_0x1050b2[_0x7a9e('0xc')]['DIALOGFLOWV2_SCORE']=_0x311585['queryResult']['intentDetectionConfidence'];_0x12789d[_0x7a9e('0x42')]=_0x7a9e('0x31');_0x12789d['providerResponse']=JSON[_0x7a9e('0x11')](_0x13cf1e);var _0x48f373=[];for(var _0x3e0178=0x0;_0x3e0178<_0x13cf1e[_0x7a9e('0x43')];_0x3e0178++){var _0x36c046=_0x13cf1e[_0x3e0178];if(_0x36c046&&_0x36c046['queryResult']&&_0x36c046[_0x7a9e('0x32')]['fulfillmentText']){_0x48f373[_0x7a9e('0x44')](createMessage(_0x14b994,_0x47b8d8,_0x12789d,_0x36c046['queryResult'][_0x7a9e('0x45')]));}}return Promise['all'](_0x48f373)[_0x7a9e('0xe')](function(){if(_0x260c7b){_0x13a156[_0x7a9e('0x16')]();}else{_0x13a156['stop']();}})['catch'](function(_0x1317f4){logger[_0x7a9e('0x27')](_0x7a9e('0x10'),_0x14b994,JSON[_0x7a9e('0x11')](_0x1317f4));_0x13a156[_0x7a9e('0x16')]();});}})[_0x7a9e('0x26')](function(_0xdbccca){logger[_0x7a9e('0x27')](_0x7a9e('0x10'),_0x14b994,_0xdbccca[_0x7a9e('0x2f')]);_0x13a156[_0x7a9e('0x16')]();});}}catch(_0x158a8c){logger[_0x7a9e('0x27')](_0x7a9e('0x10'),_0x14b994,JSON[_0x7a9e('0x11')](_0x158a8c));_0x13a156[_0x7a9e('0x2a')]();}};}; \ 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 6de3a5b..6f2fd5f 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 _0x4626=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','message','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','validate','length','[%s][GOTOIF]\x20%s','map','join','stop'];(function(_0x25ee08,_0x7d20ed){var _0x2d4245=function(_0x2982b5){while(--_0x2982b5){_0x25ee08['push'](_0x25ee08['shift']());}};_0x2d4245(++_0x7d20ed);}(_0x4626,0x1e5));var _0x6462=function(_0x3ce29e,_0x470e2e){_0x3ce29e=_0x3ce29e-0x0;var _0x515cd2=_0x4626[_0x3ce29e];return _0x515cd2;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0x6462('0x0'))(_0x6462('0x1'));var gotoif=schema({'condition':{'type':_0x6462('0x2'),'required':!![],'message':_0x6462('0x3')},'priorityTrue':{'type':_0x6462('0x4'),'message':_0x6462('0x5')},'priorityFalse':{'type':_0x6462('0x4'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x6462('0x6')]=function(_0x5ca4fa,_0xe9bfe7){return function(_0x5a3d98){try{var _0xd6d03d={'condition':htmlToText[_0x6462('0x7')](utils['getMustacheRender'](_0xe9bfe7[0x0],this),{'wordwrap':![]})[_0x6462('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xe9bfe7[0x1],'priorityFalse':_0xe9bfe7[0x2]};var _0x1f40d2=gotoif[_0x6462('0x9')](_0xd6d03d,{'typecast':!![]});if(_0x1f40d2[_0x6462('0xa')]){logger['error'](_0x6462('0xb'),_0x5ca4fa,_[_0x6462('0xc')](_0x1f40d2,'message')[_0x6462('0xd')](',\x20'));_0x5a3d98[_0x6462('0xe')]();}else{try{var _0x1bb969=eval('('+_0xd6d03d['condition']+')');var _0x196f68=_0x1bb969?_0xd6d03d['priorityTrue']:_0xd6d03d['priorityFalse'];logger[_0x6462('0xf')](_0x6462('0x10'),_0x5ca4fa,_0xd6d03d[_0x6462('0x11')],_0x1bb969,_0x196f68||'next');if(_0x196f68){var _0x3e2b21=_[_0x6462('0x12')](_0x5a3d98[_0x6462('0x13')](),{'p':_0x196f68});if(_0x3e2b21>=0x0){logger[_0x6462('0xf')](_0x6462('0x14'),_0x5ca4fa,_0x196f68||_0x6462('0x15'),_0x3e2b21);_0x5a3d98['next'](_0x3e2b21);}else{logger[_0x6462('0xf')](_0x6462('0x16'),_0x5ca4fa,_0x196f68||_0x6462('0x15'));_0x5a3d98[_0x6462('0xe')]();}}else{_0x5a3d98[_0x6462('0x15')]();}}catch(_0x48b942){logger[_0x6462('0x17')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5ca4fa,_0x48b942[_0x6462('0x18')]);_0x5a3d98[_0x6462('0xe')]();}}}catch(_0x92db61){logger[_0x6462('0x17')](_0x6462('0xb'),_0x5ca4fa,JSON['stringify'](_0x92db61));_0x5a3d98[_0x6462('0xe')]();}};}; \ No newline at end of file +var _0xc492=['lodash','./utils','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','map','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','info','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0xc492,0xe9));var _0x2c49=function(_0xe46626,_0x4eb68a){_0xe46626=_0xe46626-0x0;var _0x25f896=_0xc492[_0xe46626];return _0x25f896;};'use strict';var schema=require(_0x2c49('0x0'));var _=require(_0x2c49('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x2c49('0x2'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x2c49('0x3'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x2c49('0x3'),'message':_0x2c49('0x4')}});exports[_0x2c49('0x5')]=function(_0x7242b6,_0x1e1b0e){return function(_0x179034){try{var _0x5d52a1={'condition':htmlToText[_0x2c49('0x6')](utils[_0x2c49('0x7')](_0x1e1b0e[0x0],this),{'wordwrap':![]})[_0x2c49('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1e1b0e[0x1],'priorityFalse':_0x1e1b0e[0x2]};var _0x599771=gotoif[_0x2c49('0x0')](_0x5d52a1,{'typecast':!![]});if(_0x599771[_0x2c49('0x9')]){logger['error']('[%s][GOTOIF]\x20%s',_0x7242b6,_[_0x2c49('0xa')](_0x599771,'message')[_0x2c49('0xb')](',\x20'));_0x179034[_0x2c49('0xc')]();}else{try{var _0x992fda=eval('('+_0x5d52a1[_0x2c49('0xd')]+')');var _0x5d0a86=_0x992fda?_0x5d52a1[_0x2c49('0xe')]:_0x5d52a1[_0x2c49('0xf')];logger['info'](_0x2c49('0x10'),_0x7242b6,_0x5d52a1[_0x2c49('0xd')],_0x992fda,_0x5d0a86||'next');if(_0x5d0a86){var _0x1f7122=_[_0x2c49('0x11')](_0x179034[_0x2c49('0x12')](),{'p':_0x5d0a86});if(_0x1f7122>=0x0){logger[_0x2c49('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x7242b6,_0x5d0a86||_0x2c49('0x14'),_0x1f7122);_0x179034['next'](_0x1f7122);}else{logger['info'](_0x2c49('0x15'),_0x7242b6,_0x5d0a86||_0x2c49('0x14'));_0x179034[_0x2c49('0xc')]();}}else{_0x179034[_0x2c49('0x14')]();}}catch(_0x525282){logger[_0x2c49('0x16')](_0x2c49('0x17'),_0x7242b6,_0x525282[_0x2c49('0x18')]);_0x179034['stop']();}}}catch(_0x56e64a){logger['error']('[%s][GOTOIF]\x20%s',_0x7242b6,JSON[_0x2c49('0x19')](_0x56e64a));_0x179034['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 666d87b..106ea8f 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 _0x5576=['lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate'];(function(_0x528084,_0x5802ae){var _0x1f1acb=function(_0x329a02){while(--_0x329a02){_0x528084['push'](_0x528084['shift']());}};_0x1f1acb(++_0x5802ae);}(_0x5576,0x13f));var _0x6557=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x5576[_0x36c6eb];return _0x30675b;};'use strict';var schema=require(_0x6557('0x0'));var _=require(_0x6557('0x1'));var logger=require('../../../../config/logger')(_0x6557('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6557('0x3')}});exports['consequence']=function(_0x588ede,_0x51617a){return function(_0x3d1874){try{var _0x14a03e={'priority':_0x51617a[0x0]};var _0x1f1835=gotop[_0x6557('0x0')](_0x14a03e,{'typecast':!![]});if(_0x1f1835['length']){logger[_0x6557('0x4')](_0x6557('0x5'),_0x588ede,_[_0x6557('0x6')](_0x1f1835,_0x6557('0x7'))[_0x6557('0x8')](',\x20'));_0x3d1874[_0x6557('0x9')]();}else{logger[_0x6557('0xa')](_0x6557('0xb'),_0x588ede,_0x14a03e['priority']);if(_0x14a03e['priority']){var _0x325583=_[_0x6557('0xc')](_0x3d1874['rules'](),{'p':_0x14a03e['priority']});if(_0x325583>=0x0){logger[_0x6557('0xa')](_0x6557('0xd'),_0x588ede,_0x14a03e['priority']||_0x6557('0xe'),_0x325583);_0x3d1874['next'](_0x325583);}else{logger[_0x6557('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x588ede,_0x14a03e['priority']||'next');_0x3d1874[_0x6557('0x9')]();}}else{_0x3d1874[_0x6557('0xe')]();}}}catch(_0x4cd818){logger[_0x6557('0x4')](_0x6557('0x5'),_0x588ede,JSON[_0x6557('0xf')](_0x4cd818));_0x3d1874['stop']();}};}; \ No newline at end of file +var _0xd822=['priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x3ee7d3,_0x1bf1cd){var _0x432904=function(_0x18c863){while(--_0x18c863){_0x3ee7d3['push'](_0x3ee7d3['shift']());}};_0x432904(++_0x1bf1cd);}(_0xd822,0xc3));var _0x2d82=function(_0x2dccc4,_0x5bc778){_0x2dccc4=_0x2dccc4-0x0;var _0x115b76=_0xd822[_0x2dccc4];return _0x115b76;};'use strict';var schema=require(_0x2d82('0x0'));var _=require(_0x2d82('0x1'));var logger=require(_0x2d82('0x2'))(_0x2d82('0x3'));var gotop=schema({'priority':{'type':_0x2d82('0x4'),'required':!![],'message':_0x2d82('0x5')}});exports[_0x2d82('0x6')]=function(_0x4fa786,_0x21ef28){return function(_0x4863f4){try{var _0x10d0a2={'priority':_0x21ef28[0x0]};var _0x2a767d=gotop[_0x2d82('0x0')](_0x10d0a2,{'typecast':!![]});if(_0x2a767d[_0x2d82('0x7')]){logger[_0x2d82('0x8')](_0x2d82('0x9'),_0x4fa786,_[_0x2d82('0xa')](_0x2a767d,_0x2d82('0xb'))[_0x2d82('0xc')](',\x20'));_0x4863f4['stop']();}else{logger[_0x2d82('0xd')](_0x2d82('0xe'),_0x4fa786,_0x10d0a2[_0x2d82('0xf')]);if(_0x10d0a2[_0x2d82('0xf')]){var _0x315d30=_['findIndex'](_0x4863f4['rules'](),{'p':_0x10d0a2[_0x2d82('0xf')]});if(_0x315d30>=0x0){logger[_0x2d82('0xd')](_0x2d82('0x10'),_0x4fa786,_0x10d0a2[_0x2d82('0xf')]||'next',_0x315d30);_0x4863f4[_0x2d82('0x11')](_0x315d30);}else{logger[_0x2d82('0xd')](_0x2d82('0x12'),_0x4fa786,_0x10d0a2[_0x2d82('0xf')]||_0x2d82('0x11'));_0x4863f4[_0x2d82('0x13')]();}}else{_0x4863f4[_0x2d82('0x11')]();}}}catch(_0x4a9db2){logger[_0x2d82('0x8')](_0x2d82('0x9'),_0x4fa786,JSON[_0x2d82('0x14')](_0x4a9db2));_0x4863f4[_0x2d82('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 2193acf..82ca1f9 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 _0x0825=['info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0x0825,0x1e4));var _0x5082=function(_0x510094,_0x42408b){_0x510094=_0x510094-0x0;var _0x184a2d=_0x0825[_0x510094];return _0x184a2d;};'use strict';var _=require(_0x5082('0x0'));var utils=require(_0x5082('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x5082('0x2')),'openchannelMessage':require(_0x5082('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5082('0x4')),'faxMessage':require(_0x5082('0x5')),'whatsappMessage':require(_0x5082('0x6'))};exports[_0x5082('0x7')]=function(_0x1afbb2,_0x297cda){return function(_0x5a119b){try{var _0x4f9333={'body':utils['getMustacheRender'](_0x297cda[0x0],this),'ContactId':this[_0x5082('0x8')]['id']};if(this[_0x5082('0x9')]===_0x5082('0xa')){_0x4f9333[_0x5082('0xb')]=this[_0x5082('0xc')]['id'];}else{_0x4f9333[_['upperFirst'](this[_0x5082('0x9')])+_0x5082('0xd')]=this[_0x5082('0xc')]['id'];}_0x4f9333[_[_0x5082('0xe')](this[_0x5082('0x9')])+_0x5082('0xf')]=this[_0x5082('0x10')]['id'];if(rpc[this[_0x5082('0x9')]+_0x5082('0x11')]){return rpc[this[_0x5082('0x9')]+_0x5082('0x11')][_0x5082('0x12')](_0x4f9333)[_0x5082('0x13')](function(_0x3504b6){logger[_0x5082('0x14')]('[%s][MESSAGE]\x20%s',_0x1afbb2,_0x4f9333[_0x5082('0x15')]);_0x5a119b[_0x5082('0x16')]();})[_0x5082('0x17')](function(_0x51ecc8){logger[_0x5082('0x18')](_0x5082('0x19'),_0x1afbb2,JSON[_0x5082('0x1a')](_0x51ecc8));_0x5a119b[_0x5082('0x1b')]();});}}catch(_0x19f070){logger[_0x5082('0x18')](_0x5082('0x19'),_0x1afbb2,JSON[_0x5082('0x1a')](_0x19f070));_0x5a119b['stop']();}};}; \ No newline at end of file +var _0x8889=['then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','chat','ChatWebsiteId','channel','AccountId','account','InteractionId','interaction','Message','create'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8889,0x1d9));var _0x9888=function(_0x14d7c9,_0x77465b){_0x14d7c9=_0x14d7c9-0x0;var _0x2d2193=_0x8889[_0x14d7c9];return _0x2d2193;};'use strict';var _=require(_0x9888('0x0'));var utils=require(_0x9888('0x1'));var logger=require(_0x9888('0x2'))(_0x9888('0x3'));var rpc={'chatMessage':require(_0x9888('0x4')),'openchannelMessage':require(_0x9888('0x5')),'mailMessage':require(_0x9888('0x6')),'smsMessage':require(_0x9888('0x7')),'faxMessage':require(_0x9888('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xf3a8aa,_0x5939b9){return function(_0x427256){try{var _0x4d59a1={'body':utils[_0x9888('0x9')](_0x5939b9[0x0],this),'ContactId':this[_0x9888('0xa')]['id']};if(this['channel']===_0x9888('0xb')){_0x4d59a1[_0x9888('0xc')]=this['account']['id'];}else{_0x4d59a1[_['upperFirst'](this[_0x9888('0xd')])+_0x9888('0xe')]=this[_0x9888('0xf')]['id'];}_0x4d59a1[_['upperFirst'](this[_0x9888('0xd')])+_0x9888('0x10')]=this[_0x9888('0x11')]['id'];if(rpc[this[_0x9888('0xd')]+_0x9888('0x12')]){return rpc[this[_0x9888('0xd')]+_0x9888('0x12')][_0x9888('0x13')](_0x4d59a1)[_0x9888('0x14')](function(_0x7dbebb){logger[_0x9888('0x15')]('[%s][MESSAGE]\x20%s',_0xf3a8aa,_0x4d59a1[_0x9888('0x16')]);_0x427256[_0x9888('0x17')]();})[_0x9888('0x18')](function(_0xcc95e8){logger[_0x9888('0x19')](_0x9888('0x1a'),_0xf3a8aa,JSON[_0x9888('0x1b')](_0xcc95e8));_0x427256['stop']();});}}catch(_0x8c8d04){logger[_0x9888('0x19')](_0x9888('0x1a'),_0xf3a8aa,JSON[_0x9888('0x1b')](_0x8c8d04));_0x427256[_0x9888('0x1c')]();}};}; \ 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 6d06941..a41bb32 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 _0x0bd7=['../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0bd7,0x1c0));var _0x70bd=function(_0x4557dc,_0x3687b2){_0x4557dc=_0x4557dc-0x0;var _0x1377aa=_0x0bd7[_0x4557dc];return _0x1377aa;};'use strict';var utils=require('./utils');var logger=require(_0x70bd('0x0'))('routing');exports[_0x70bd('0x1')]=function(_0x285f71,_0xd2bd81){return function(_0x22c174){try{logger[_0x70bd('0x2')](_0x70bd('0x3'),_0x285f71,utils[_0x70bd('0x4')](_0xd2bd81[0x0],this));_0x22c174[_0x70bd('0x5')]();}catch(_0x3d8939){logger[_0x70bd('0x6')](_0x70bd('0x3'),_0x285f71,JSON[_0x70bd('0x7')](_0x3d8939));_0x22c174['stop']();}};}; \ No newline at end of file +var _0x5313=['next','error','stop','./utils','../../../../config/logger','[%s][NOOP]\x20%s'];(function(_0x15ac27,_0x154d47){var _0x288cdc=function(_0x174599){while(--_0x174599){_0x15ac27['push'](_0x15ac27['shift']());}};_0x288cdc(++_0x154d47);}(_0x5313,0x15f));var _0x3531=function(_0x5032e9,_0x575782){_0x5032e9=_0x5032e9-0x0;var _0x42219b=_0x5313[_0x5032e9];return _0x42219b;};'use strict';var utils=require(_0x3531('0x0'));var logger=require(_0x3531('0x1'))('routing');exports['consequence']=function(_0x58f984,_0x4a49fd){return function(_0x57af40){try{logger['info'](_0x3531('0x2'),_0x58f984,utils['getMustacheRender'](_0x4a49fd[0x0],this));_0x57af40[_0x3531('0x3')]();}catch(_0x53cbd6){logger[_0x3531('0x4')](_0x3531('0x2'),_0x58f984,JSON['stringify'](_0x53cbd6));_0x57af40[_0x3531('0x5')]();}};}; \ 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 d452140..da5d6ff 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 _0x2c64=['end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','defaults','queue_id','account','queue','from','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules'];(function(_0x5c2667,_0x37e578){var _0x55c530=function(_0x154e2e){while(--_0x154e2e){_0x5c2667['push'](_0x5c2667['shift']());}};_0x55c530(++_0x37e578);}(_0x2c64,0x181));var _0x42c6=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x2c64[_0x2be8c2];return _0x97f531;};'use strict';var schema=require(_0x42c6('0x0'));var _=require(_0x42c6('0x1'));var util=require('util');var seqqueue=require(_0x42c6('0x2'));var moment=require(_0x42c6('0x3'));var Redis=require(_0x42c6('0x4'));var config=require(_0x42c6('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x42c6('0x6'));config[_0x42c6('0x7')]=_[_0x42c6('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x42c6('0x7')]));var attributes=['id',_0x42c6('0x9'),_0x42c6('0xa'),_0x42c6('0xb'),_0x42c6('0xc'),'joinAt'];function emit(_0x373994,_0x15af4d,_0x27500d){io['to'](_0x373994)['emit'](_0x15af4d,_0x27500d);}function emitChannelQueueInteraction(_0x235256,_0x3d749e,_0x4f7023,_0x133228,_0x227a87,_0x10c00a,_0x1e69e2,_0x427671){var _0x7aaae2=_[_0x42c6('0xd')](_0x4f7023);_0x7aaae2['queue_id']=_0x427671;_0x7aaae2[_0x42c6('0xb')]=_0x3d749e;_0x7aaae2[_0x42c6('0xa')]=_0x133228;_0x7aaae2['id']=_0x227a87;if(_0x10c00a){_0x1e69e2[util[_0x42c6('0xe')](_0x42c6('0xf'),_0x235256)][_0x227a87]=_[_0x42c6('0x10')](_0x7aaae2,attributes);}else{delete _0x1e69e2[util[_0x42c6('0xe')](_0x42c6('0xf'),_0x235256)][_0x227a87];}emit(util['format'](_0x42c6('0x11'),_0x235256,_0x3d749e),util[_0x42c6('0xe')](_0x42c6('0x12'),_0x235256,_0x10c00a?_0x42c6('0x13'):'remove'),_[_0x42c6('0x10')](_0x7aaae2,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x42c6('0x14')),'chatQueueReport':require(_0x42c6('0x15')),'smsQueueReport':require(_0x42c6('0x16')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x42c6('0x17'))};var queue=schema({'name':{'type':_0x42c6('0x18'),'required':!![],'message':_0x42c6('0x19')},'timeout':{'type':_0x42c6('0x1a'),'message':_0x42c6('0x1b')}});function startRouting(_0x12b285,_0x2ac3e7,_0x486e94,_0x51aae3){if(_0x12b285&&_0x2ac3e7&&_0x486e94){_0x2ac3e7[_0x42c6('0x1c')]+=0x1;var _0x3139bc={'uniqueid':_0x12b285,'from':_0x486e94[_0x42c6('0x1d')]?_0x486e94[_0x42c6('0x1d')]['from']:'','joinAt':moment()['format'](_0x42c6('0x1e')),'ContactId':_0x486e94[_0x42c6('0x1f')]?_0x486e94['contact']['id']:null,'ListId':_0x486e94[_0x42c6('0x20')]?_0x486e94['list']['id']:null};_0x3139bc[_[_0x42c6('0x21')](_0x486e94[_0x42c6('0x22')])+_0x42c6('0x23')]=_0x2ac3e7['id']||null;_0x3139bc[_[_0x42c6('0x21')](_0x486e94[_0x42c6('0x22')])+_0x42c6('0x24')]=_0x486e94[_0x42c6('0x25')]?_0x486e94[_0x42c6('0x25')]['id']:null;_0x3139bc[_[_0x42c6('0x21')](_0x486e94[_0x42c6('0x22')])+_0x42c6('0x26')]=_0x486e94[_0x42c6('0x27')]?_0x486e94['message']['id']:null;_0x3139bc[_[_0x42c6('0x21')](_0x486e94[_0x42c6('0x22')])+(_0x486e94[_0x42c6('0x22')]!==_0x42c6('0x28')?'AccountId':_0x42c6('0x29'))]=_0x486e94[_0x42c6('0xa')]?_0x486e94[_0x42c6('0xa')]['id']:null;logger['info'](util[_0x42c6('0xe')]('[%s][START:QUEUE][NAME:%s]',_0x12b285,_0x2ac3e7[_0x42c6('0x2a')]));emitChannelQueueInteraction(_0x486e94[_0x42c6('0x22')],_0x2ac3e7[_0x42c6('0x2a')],_0x3139bc,_0x486e94[_0x42c6('0xa')][_0x42c6('0x2a')],_0x486e94['message']['id'],!![],_0x51aae3,_0x2ac3e7['id']);if(rpc[_0x486e94['channel']+'QueueReport']){return rpc[_0x486e94[_0x42c6('0x22')]+_0x42c6('0x2b')][_0x42c6('0x2c')](_0x3139bc)[_0x42c6('0x2d')](function(_0x5ba6cb){logger[_0x42c6('0x2e')](_0x42c6('0x2f'));});}}}function stopRouting(_0x522d14,_0x1777ce,_0x4bba65,_0x3bbb4a){if(_0x522d14&&_0x1777ce){_0x1777ce['waiting']-=0x1;var _0xd7a969={'leaveAt':moment()[_0x42c6('0xe')](_0x42c6('0x1e')),'acceptAt':moment()[_0x42c6('0xe')](_0x42c6('0x1e')),'reason':_0x42c6('0x30')};logger[_0x42c6('0x31')](util['format'](_0x42c6('0x32'),_0x522d14,_0x1777ce[_0x42c6('0x2a')]));emitChannelQueueInteraction(_0x4bba65[_0x42c6('0x22')],_0x1777ce[_0x42c6('0x2a')],_0x4bba65[_0x42c6('0x1d')],_0x4bba65[_0x42c6('0xa')][_0x42c6('0x2a')],_0x4bba65[_0x42c6('0x27')]['id'],![],_0x3bbb4a,_0x1777ce['id']);if(rpc[_0x4bba65[_0x42c6('0x22')]+_0x42c6('0x2b')]){return rpc[_0x4bba65['channel']+_0x42c6('0x2b')][_0x42c6('0x33')](_0x522d14,_0xd7a969)[_0x42c6('0x2d')](function(_0x34d8f5){logger[_0x42c6('0x2e')]('update\x20queue\x20report');});}}}function endRouting(_0xcaab0,_0x2f9f42,_0x4bbc18,_0x373355){if(_0xcaab0&&_0x2f9f42){_0x2f9f42['waiting']-=0x1;var _0x3ec1c4={'leaveAt':moment()['format'](_0x42c6('0x1e')),'exitAt':moment()[_0x42c6('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x42c6('0x34')};logger[_0x42c6('0x31')](util[_0x42c6('0xe')]('[%s][END:QUEUE][NAME:%s]',_0xcaab0,_0x2f9f42[_0x42c6('0x2a')]));emitChannelQueueInteraction(_0x4bbc18[_0x42c6('0x22')],_0x2f9f42[_0x42c6('0x2a')],_0x4bbc18['body'],_0x4bbc18[_0x42c6('0xa')][_0x42c6('0x2a')],_0x4bbc18[_0x42c6('0x27')]['id'],![],_0x373355);if(rpc[_0x4bbc18['channel']+_0x42c6('0x2b')]){return rpc[_0x4bbc18[_0x42c6('0x22')]+_0x42c6('0x2b')][_0x42c6('0x33')](_0xcaab0,_0x3ec1c4)['catch'](function(_0x4110c3){logger[_0x42c6('0x2e')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x1c1020){return function(_0x360d29){return _0x360d29[_0x42c6('0x2a')][_0x42c6('0x35')]()===_0x1c1020[_0x42c6('0x35')]();};}exports[_0x42c6('0x36')]=function(_0x2d6362,_0x52aa21,_0x59e21a,_0x143f6e){return function(_0x53ea24){try{var _0x1af601={'name':_0x52aa21[0x0],'timeout':_0x52aa21[0x1]};var _0x45af35=queue['validate'](_0x1af601,{'typecast':!![]});if(_0x45af35[_0x42c6('0x37')]){logger['error'](_0x42c6('0x38'),_0x2d6362,_['map'](_0x45af35,_0x42c6('0x27'))[_0x42c6('0x39')](',\x20'));_0x53ea24[_0x42c6('0x3a')]();}else{var _0x5de806=_[_0x42c6('0x3b')](_0x59e21a[_0x143f6e[_0x42c6('0x22')]+_0x42c6('0x3c')],handleFindQueue(_0x1af601[_0x42c6('0x2a')]));if(_0x5de806){startRouting(_0x2d6362,_0x5de806,_0x143f6e,_0x59e21a);var _0x500219=(_0x5de806[_0x42c6('0x34')]||0xa)*0x3e8;var _0x3a0984=(_0x1af601[_0x42c6('0x34')]||0x14)*0x3e8;var _0x57b77a,_0x2a2654;if(_0x500219>_0x3a0984){_0x3a0984=_0x500219;}var _0x241b19=seqqueue[_0x42c6('0x3d')](_0x500219);_0x241b19['id']=_0x2d6362;_0x241b19[_0x42c6('0x3e')]=_0x500219;_0x241b19[_0x42c6('0x3f')]=_0x3a0984;_0x241b19[_0x42c6('0x22')]=_0x143f6e[_0x42c6('0x22')];_0x59e21a[_0x42c6('0x40')][_0x2d6362]['on'](_0x42c6('0x41'),function(){logger['info'](_0x42c6('0x42'),_0x2d6362);stopRouting(_0x2d6362,_0x5de806,_0x143f6e,_0x59e21a);clearTimeout(_0x57b77a);_0x57b77a=undefined;_0x241b19['close'](!![]);if(_0x59e21a['rules'][_0x2d6362]){delete _0x59e21a[_0x42c6('0x40')][_0x2d6362];}_0x53ea24[_0x42c6('0x3a')]();});_0x59e21a[_0x42c6('0x40')][_0x2d6362]['on'](_0x42c6('0x43'),function(){if(_0x59e21a['rules'][_0x2d6362]){delete _0x59e21a[_0x42c6('0x40')][_0x2d6362];}});_0x57b77a=setTimeout(function(){logger[_0x42c6('0x31')](_0x42c6('0x44'),_0x2d6362);endRouting(_0x2d6362,_0x5de806,_0x143f6e,_0x59e21a);clearTimeout(_0x57b77a);_0x241b19['close'](!![]);_0x53ea24[_0x42c6('0x45')]();},_0x3a0984);switch(_0x5de806[_0x42c6('0x46')]){case _0x42c6('0x47'):strategy[_0x42c6('0x47')](_0x241b19,_0x5de806,_0x59e21a,_0x143f6e);break;default:strategy['beepall'](_0x241b19,_0x5de806,_0x59e21a,_0x143f6e);}}else{logger[_0x42c6('0x2e')](_0x42c6('0x48'),_0x2d6362,_0x1af601['name']);_0x53ea24[_0x42c6('0x3a')]();}}}catch(_0x45e6e8){console[_0x42c6('0x49')](_0x45e6e8);logger[_0x42c6('0x2e')](_0x42c6('0x38'),_0x2d6362,_0x45e6e8[_0x42c6('0x4a')]);_0x53ea24['stop']();}};}; \ No newline at end of file +var _0x6488=['QueueReport','create','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','join','find','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','queue','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','message','chat','info','[%s][START:QUEUE][NAME:%s]','name'];(function(_0x93ff05,_0x1d79bb){var _0x161bd0=function(_0x38acb9){while(--_0x38acb9){_0x93ff05['push'](_0x93ff05['shift']());}};_0x161bd0(++_0x1d79bb);}(_0x6488,0x106));var _0x8648=function(_0x627cb8,_0x2b89d6){_0x627cb8=_0x627cb8-0x0;var _0x5629b5=_0x6488[_0x627cb8];return _0x5629b5;};'use strict';var schema=require(_0x8648('0x0'));var _=require('lodash');var util=require(_0x8648('0x1'));var seqqueue=require(_0x8648('0x2'));var moment=require(_0x8648('0x3'));var Redis=require(_0x8648('0x4'));var config=require(_0x8648('0x5'));var logger=require(_0x8648('0x6'))(_0x8648('0x7'));var strategy=require(_0x8648('0x8'));config[_0x8648('0x9')]=_['defaults'](config[_0x8648('0x9')],{'host':_0x8648('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8648('0x9')]));var attributes=['id',_0x8648('0xb'),'account',_0x8648('0xc'),'from',_0x8648('0xd')];function emit(_0x533b74,_0x1453a9,_0x26cae2){io['to'](_0x533b74)[_0x8648('0xe')](_0x1453a9,_0x26cae2);}function emitChannelQueueInteraction(_0x45d918,_0x2beefa,_0x19b1e9,_0x3b1f58,_0x3cf0e7,_0x26b106,_0x5bdedb,_0x5a6afa){var _0x245bc8=_[_0x8648('0xf')](_0x19b1e9);_0x245bc8[_0x8648('0xb')]=_0x5a6afa;_0x245bc8['queue']=_0x2beefa;_0x245bc8[_0x8648('0x10')]=_0x3b1f58;_0x245bc8['id']=_0x3cf0e7;if(_0x26b106){_0x5bdedb[util[_0x8648('0x11')](_0x8648('0x12'),_0x45d918)][_0x3cf0e7]=_[_0x8648('0x13')](_0x245bc8,attributes);}else{delete _0x5bdedb[util[_0x8648('0x11')](_0x8648('0x12'),_0x45d918)][_0x3cf0e7];}emit(util[_0x8648('0x11')](_0x8648('0x14'),_0x45d918,_0x2beefa),util[_0x8648('0x11')](_0x8648('0x15'),_0x45d918,_0x26b106?_0x8648('0x16'):_0x8648('0x17')),_[_0x8648('0x13')](_0x245bc8,attributes));}var rpc={'openchannelQueueReport':require(_0x8648('0x18')),'mailQueueReport':require(_0x8648('0x19')),'chatQueueReport':require(_0x8648('0x1a')),'smsQueueReport':require(_0x8648('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8648('0x1c'))};var queue=schema({'name':{'type':_0x8648('0x1d'),'required':!![],'message':_0x8648('0x1e')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x5f4669,_0x1d81d5,_0x335388,_0x52ee9f){if(_0x5f4669&&_0x1d81d5&&_0x335388){_0x1d81d5[_0x8648('0x1f')]+=0x1;var _0x2a40af={'uniqueid':_0x5f4669,'from':_0x335388[_0x8648('0x20')]?_0x335388['body'][_0x8648('0x21')]:'','joinAt':moment()['format'](_0x8648('0x22')),'ContactId':_0x335388['contact']?_0x335388[_0x8648('0x23')]['id']:null,'ListId':_0x335388['list']?_0x335388[_0x8648('0x24')]['id']:null};_0x2a40af[_['upperFirst'](_0x335388[_0x8648('0x25')])+'QueueId']=_0x1d81d5['id']||null;_0x2a40af[_[_0x8648('0x26')](_0x335388[_0x8648('0x25')])+_0x8648('0x27')]=_0x335388[_0x8648('0x28')]?_0x335388[_0x8648('0x28')]['id']:null;_0x2a40af[_[_0x8648('0x26')](_0x335388[_0x8648('0x25')])+'MessageId']=_0x335388['message']?_0x335388[_0x8648('0x29')]['id']:null;_0x2a40af[_[_0x8648('0x26')](_0x335388[_0x8648('0x25')])+(_0x335388[_0x8648('0x25')]!==_0x8648('0x2a')?'AccountId':'WebsiteId')]=_0x335388[_0x8648('0x10')]?_0x335388['account']['id']:null;logger[_0x8648('0x2b')](util['format'](_0x8648('0x2c'),_0x5f4669,_0x1d81d5[_0x8648('0x2d')]));emitChannelQueueInteraction(_0x335388['channel'],_0x1d81d5[_0x8648('0x2d')],_0x2a40af,_0x335388['account'][_0x8648('0x2d')],_0x335388[_0x8648('0x29')]['id'],!![],_0x52ee9f,_0x1d81d5['id']);if(rpc[_0x335388['channel']+'QueueReport']){return rpc[_0x335388[_0x8648('0x25')]+_0x8648('0x2e')][_0x8648('0x2f')](_0x2a40af)[_0x8648('0x30')](function(_0x4dc386){logger[_0x8648('0x31')](_0x8648('0x32'));});}}}function stopRouting(_0x260593,_0x51ccb4,_0x7970a8,_0x12bec5){if(_0x260593&&_0x51ccb4){_0x51ccb4[_0x8648('0x1f')]-=0x1;var _0x1f0091={'leaveAt':moment()[_0x8648('0x11')](_0x8648('0x22')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8648('0x33')};logger[_0x8648('0x2b')](util[_0x8648('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x260593,_0x51ccb4[_0x8648('0x2d')]));emitChannelQueueInteraction(_0x7970a8[_0x8648('0x25')],_0x51ccb4[_0x8648('0x2d')],_0x7970a8[_0x8648('0x20')],_0x7970a8['account'][_0x8648('0x2d')],_0x7970a8[_0x8648('0x29')]['id'],![],_0x12bec5,_0x51ccb4['id']);if(rpc[_0x7970a8[_0x8648('0x25')]+_0x8648('0x2e')]){return rpc[_0x7970a8[_0x8648('0x25')]+_0x8648('0x2e')][_0x8648('0x34')](_0x260593,_0x1f0091)[_0x8648('0x30')](function(_0x230342){logger[_0x8648('0x31')](_0x8648('0x35'));});}}}function endRouting(_0x556c58,_0x774beb,_0x49315a,_0x852983){if(_0x556c58&&_0x774beb){_0x774beb[_0x8648('0x1f')]-=0x1;var _0xc29e1f={'leaveAt':moment()[_0x8648('0x11')](_0x8648('0x22')),'exitAt':moment()[_0x8648('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8648('0x36')};logger[_0x8648('0x2b')](util[_0x8648('0x11')](_0x8648('0x37'),_0x556c58,_0x774beb[_0x8648('0x2d')]));emitChannelQueueInteraction(_0x49315a[_0x8648('0x25')],_0x774beb[_0x8648('0x2d')],_0x49315a[_0x8648('0x20')],_0x49315a['account'][_0x8648('0x2d')],_0x49315a[_0x8648('0x29')]['id'],![],_0x852983);if(rpc[_0x49315a[_0x8648('0x25')]+_0x8648('0x2e')]){return rpc[_0x49315a[_0x8648('0x25')]+_0x8648('0x2e')][_0x8648('0x34')](_0x556c58,_0xc29e1f)[_0x8648('0x30')](function(_0x2a006f){logger[_0x8648('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x241855){return function(_0x179699){return _0x179699[_0x8648('0x2d')][_0x8648('0x38')]()===_0x241855[_0x8648('0x38')]();};}exports[_0x8648('0x39')]=function(_0x592554,_0x5377ae,_0x54a222,_0x314d9b){return function(_0x505d55){try{var _0x459da0={'name':_0x5377ae[0x0],'timeout':_0x5377ae[0x1]};var _0x41b39c=queue[_0x8648('0x0')](_0x459da0,{'typecast':!![]});if(_0x41b39c[_0x8648('0x3a')]){logger[_0x8648('0x31')]('[%s][QUEUE]\x20%s',_0x592554,_['map'](_0x41b39c,_0x8648('0x29'))[_0x8648('0x3b')](',\x20'));_0x505d55['stop']();}else{var _0x203c88=_[_0x8648('0x3c')](_0x54a222[_0x314d9b[_0x8648('0x25')]+_0x8648('0x3d')],handleFindQueue(_0x459da0['name']));if(_0x203c88){startRouting(_0x592554,_0x203c88,_0x314d9b,_0x54a222);var _0x1fb2e2=(_0x203c88[_0x8648('0x36')]||0xa)*0x3e8;var _0x2bc88a=(_0x459da0[_0x8648('0x36')]||0x14)*0x3e8;var _0xe42c7d,_0x5dde33;if(_0x1fb2e2>_0x2bc88a){_0x2bc88a=_0x1fb2e2;}var _0x2bfcb8=seqqueue[_0x8648('0x3e')](_0x1fb2e2);_0x2bfcb8['id']=_0x592554;_0x2bfcb8[_0x8648('0x3f')]=_0x1fb2e2;_0x2bfcb8[_0x8648('0x40')]=_0x2bc88a;_0x2bfcb8[_0x8648('0x25')]=_0x314d9b[_0x8648('0x25')];_0x54a222['rules'][_0x592554]['on'](_0x8648('0x41'),function(){logger[_0x8648('0x2b')](_0x8648('0x42'),_0x592554);stopRouting(_0x592554,_0x203c88,_0x314d9b,_0x54a222);clearTimeout(_0xe42c7d);_0xe42c7d=undefined;_0x2bfcb8[_0x8648('0x43')](!![]);if(_0x54a222[_0x8648('0x44')][_0x592554]){delete _0x54a222[_0x8648('0x44')][_0x592554];}_0x505d55[_0x8648('0x45')]();});_0x54a222[_0x8648('0x44')][_0x592554]['on'](_0x8648('0x46'),function(){if(_0x54a222[_0x8648('0x44')][_0x592554]){delete _0x54a222['rules'][_0x592554];}});_0xe42c7d=setTimeout(function(){logger[_0x8648('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x592554);endRouting(_0x592554,_0x203c88,_0x314d9b,_0x54a222);clearTimeout(_0xe42c7d);_0x2bfcb8['close'](!![]);_0x505d55[_0x8648('0x47')]();},_0x2bc88a);switch(_0x203c88[_0x8648('0x48')]){case _0x8648('0x49'):strategy[_0x8648('0x49')](_0x2bfcb8,_0x203c88,_0x54a222,_0x314d9b);break;default:strategy[_0x8648('0x4a')](_0x2bfcb8,_0x203c88,_0x54a222,_0x314d9b);}}else{logger[_0x8648('0x31')](_0x8648('0x4b'),_0x592554,_0x459da0[_0x8648('0x2d')]);_0x505d55['stop']();}}}catch(_0x50befe){console[_0x8648('0x4c')](_0x50befe);logger['error']('[%s][QUEUE]\x20%s',_0x592554,_0x50befe['stack']);_0x505d55[_0x8648('0x45')]();}};}; \ 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 fabb927..d0e88bb 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 _0x0722=['bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','busy','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun'];(function(_0x3c70e7,_0x2dfbe6){var _0x5d436a=function(_0x3668a2){while(--_0x3668a2){_0x3c70e7['push'](_0x3c70e7['shift']());}};_0x5d436a(++_0x2dfbe6);}(_0x0722,0x198));var _0x2072=function(_0x18ed1e,_0x2b2417){_0x18ed1e=_0x18ed1e-0x0;var _0x8419f2=_0x0722[_0x18ed1e];return _0x8419f2;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x2072('0x0'));var logger=require(_0x2072('0x1'))(_0x2072('0x2'));var Agent=function(_0x4af793,_0x3d3cfe,_0x554fc0,_0x3f457d){this['notificationId']=uuid['v4']();this[_0x2072('0x3')]=_0x4af793;this[_0x2072('0x4')]=_0x3d3cfe;this[_0x2072('0x5')]=_0x554fc0;this['routing']=_0x3f457d;this[_0x2072('0x3')][_0x2072('0x6')](this[_0x2072('0x7')][_0x2072('0x8')](this),this[_0x2072('0x9')][_0x2072('0x8')](this));this['squeue']['on'](_0x2072('0xa'),this['handleTimeout'][_0x2072('0x8')](this));this[_0x2072('0x3')]['on'](_0x2072('0xb'),this[_0x2072('0xc')]['bind'](this));};Agent[_0x2072('0xd')][_0x2072('0x6')]=function(){this[_0x2072('0x3')][_0x2072('0x6')](this['handleRun'][_0x2072('0x8')](this),this[_0x2072('0x9')][_0x2072('0x8')](this));};Agent['prototype'][_0x2072('0xc')]=function(){this[_0x2072('0x9')](!![]);};Agent[_0x2072('0xd')][_0x2072('0x7')]=function(_0x27f6c7){logger[_0x2072('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x2072('0x4')]['id']);if(_['isNil'](this[_0x2072('0x5')]['agents'][this[_0x2072('0x4')]['id']])){logger[_0x2072('0xe')](_0x2072('0xf'),this[_0x2072('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x2072('0x6')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0x2072('0x3')]['id'],this[_0x2072('0x5')][_0x2072('0x10')][this[_0x2072('0x4')]['id']],this[_0x2072('0x3')][_0x2072('0x11')],![])){this['realtime'][_0x2072('0x10')][this[_0x2072('0x4')]['id']][_0x2072('0x12')]=!![];this[_0x2072('0x5')][_0x2072('0x10')][this[_0x2072('0x4')]['id']]['busyQueue']=undefined;util[_0x2072('0x13')](this[_0x2072('0x14')],this['squeue']['id'],this[_0x2072('0x5')][_0x2072('0x10')][this['agent']['id']],null,this[_0x2072('0x2')]);util[_0x2072('0x15')](this[_0x2072('0x3')]['id'],this[_0x2072('0x5')][_0x2072('0x10')][this[_0x2072('0x4')]['id']],_0x2072('0x16')+(this[_0x2072('0x2')]['forcedOwnership']?_0x2072('0x17'):''));}else{logger[_0x2072('0xe')](_0x2072('0x18'),this[_0x2072('0x3')]['id'],this[_0x2072('0x4')]['id']);setTimeout(this['push'][_0x2072('0x8')](this),0x3e8);}}};Agent[_0x2072('0xd')][_0x2072('0x9')]=function(_0x35d5ba){if(_[_0x2072('0x19')](this[_0x2072('0x5')][_0x2072('0x10')][this[_0x2072('0x4')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x2072('0x3')]['id'],this[_0x2072('0x4')]['id']);}else{logger[_0x2072('0xe')](_0x2072('0x1a'),this[_0x2072('0x3')]['id'],this['agent']['id']);util[_0x2072('0x1b')](this[_0x2072('0x14')],this[_0x2072('0x3')]['id'],this[_0x2072('0x5')][_0x2072('0x10')][this['agent']['id']],null,this[_0x2072('0x2')]);this[_0x2072('0x5')][_0x2072('0x10')][this[_0x2072('0x4')]['id']]['busy']=![];this[_0x2072('0x5')][_0x2072('0x10')][this[_0x2072('0x4')]['id']][_0x2072('0x1c')]=undefined;util[_0x2072('0x15')](this[_0x2072('0x3')]['id'],this[_0x2072('0x5')][_0x2072('0x10')][this['agent']['id']],_0x35d5ba?_0x2072('0x1d'):_0x2072('0x1e'));}if(!_0x35d5ba){setTimeout(this[_0x2072('0x6')][_0x2072('0x8')](this),0x3e8);}};function agent(_0x1e85ee,_0x52790d,_0x3520c0,_0x2d3edb){return new Agent(_0x1e85ee,_0x52790d,_0x3520c0,_0x2d3edb);}module[_0x2072('0x1f')]=agent; \ No newline at end of file +var _0xc5f7=['squeue','realtime','handleRun','bind','handleTimeout','drained','push','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','notificationId','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x5626f5,_0x598be4){var _0x9b7594=function(_0x4b4f33){while(--_0x4b4f33){_0x5626f5['push'](_0x5626f5['shift']());}};_0x9b7594(++_0x598be4);}(_0xc5f7,0xc7));var _0x7c5f=function(_0x3c9363,_0xd49e35){_0x3c9363=_0x3c9363-0x0;var _0x3c29da=_0xc5f7[_0x3c9363];return _0x3c29da;};'use strict';var _=require(_0x7c5f('0x0'));var uuid=require(_0x7c5f('0x1'));var util=require(_0x7c5f('0x2'));var logger=require(_0x7c5f('0x3'))(_0x7c5f('0x4'));var Agent=function(_0x372acd,_0x3d0485,_0x4261b3,_0x4fc2cd){this['notificationId']=uuid['v4']();this[_0x7c5f('0x5')]=_0x372acd;this['agent']=_0x3d0485;this[_0x7c5f('0x6')]=_0x4261b3;this[_0x7c5f('0x4')]=_0x4fc2cd;this[_0x7c5f('0x5')]['push'](this[_0x7c5f('0x7')][_0x7c5f('0x8')](this),this[_0x7c5f('0x9')]['bind'](this));this[_0x7c5f('0x5')]['on']('timeout',this['handleTimeout'][_0x7c5f('0x8')](this));this['squeue']['on'](_0x7c5f('0xa'),this['handleDrained'][_0x7c5f('0x8')](this));};Agent['prototype'][_0x7c5f('0xb')]=function(){this['squeue'][_0x7c5f('0xb')](this[_0x7c5f('0x7')][_0x7c5f('0x8')](this),this[_0x7c5f('0x9')][_0x7c5f('0x8')](this));};Agent[_0x7c5f('0xc')][_0x7c5f('0xd')]=function(){this[_0x7c5f('0x9')](!![]);};Agent['prototype'][_0x7c5f('0x7')]=function(_0x4e6875){logger['info'](_0x7c5f('0xe'),this[_0x7c5f('0x5')]['id'],this[_0x7c5f('0xf')]['id']);if(_[_0x7c5f('0x10')](this[_0x7c5f('0x6')][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']])){logger[_0x7c5f('0x12')](_0x7c5f('0x13'),this[_0x7c5f('0x5')]['id'],this[_0x7c5f('0xf')]['id']);setTimeout(this['push'][_0x7c5f('0x8')](this),0x3e8);}else{if(this[_0x7c5f('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x7c5f('0x5')]['id'],this[_0x7c5f('0x6')][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']],this[_0x7c5f('0x5')][_0x7c5f('0x14')],![])){this[_0x7c5f('0x6')][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']][_0x7c5f('0x15')]=!![];this[_0x7c5f('0x6')]['agents'][this[_0x7c5f('0xf')]['id']][_0x7c5f('0x16')]=undefined;util[_0x7c5f('0x17')](this['notificationId'],this[_0x7c5f('0x5')]['id'],this[_0x7c5f('0x6')]['agents'][this[_0x7c5f('0xf')]['id']],null,this[_0x7c5f('0x4')]);util[_0x7c5f('0x18')](this[_0x7c5f('0x5')]['id'],this['realtime'][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']],_0x7c5f('0x19')+(this[_0x7c5f('0x4')]['forcedOwnership']?_0x7c5f('0x1a'):''));}else{logger['info'](_0x7c5f('0x1b'),this[_0x7c5f('0x5')]['id'],this[_0x7c5f('0xf')]['id']);setTimeout(this[_0x7c5f('0xb')][_0x7c5f('0x8')](this),0x3e8);}}};Agent[_0x7c5f('0xc')]['handleTimeout']=function(_0x52ab91){if(_[_0x7c5f('0x10')](this[_0x7c5f('0x6')][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']])){return logger[_0x7c5f('0x12')](_0x7c5f('0x13'),this[_0x7c5f('0x5')]['id'],this['agent']['id']);}else{logger[_0x7c5f('0x12')](_0x7c5f('0x1c'),this[_0x7c5f('0x5')]['id'],this['agent']['id']);util[_0x7c5f('0x1d')](this[_0x7c5f('0x1e')],this[_0x7c5f('0x5')]['id'],this[_0x7c5f('0x6')][_0x7c5f('0x11')][this['agent']['id']],null,this[_0x7c5f('0x4')]);this[_0x7c5f('0x6')][_0x7c5f('0x11')][this['agent']['id']][_0x7c5f('0x15')]=![];this[_0x7c5f('0x6')][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']][_0x7c5f('0x16')]=undefined;util[_0x7c5f('0x18')](this[_0x7c5f('0x5')]['id'],this['realtime'][_0x7c5f('0x11')][this[_0x7c5f('0xf')]['id']],_0x52ab91?_0x7c5f('0x1f'):_0x7c5f('0x20'));}if(!_0x52ab91){setTimeout(this[_0x7c5f('0xb')][_0x7c5f('0x8')](this),0x3e8);}};function agent(_0x371a67,_0x1ae8e6,_0x3fffef,_0x2a885b){return new Agent(_0x371a67,_0x1ae8e6,_0x3fffef,_0x2a885b);}module[_0x7c5f('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 4811eeb..9e8afb7 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 _0xbe48=['length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','showNotification','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','isNil','Agents'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xbe48,0x121));var _0x8be4=function(_0x5736a8,_0x166e69){_0x5736a8=_0x5736a8-0x0;var _0x334ef6=_0xbe48[_0x5736a8];return _0x334ef6;};'use strict';var _=require(_0x8be4('0x0'));var uuid=require(_0x8be4('0x1'));var util=require(_0x8be4('0x2'));var logger=require(_0x8be4('0x3'))(_0x8be4('0x4'));var Beepall=function(_0x5041d8,_0x58898f,_0x3404c7,_0x95e50e){this['notificationId']=uuid['v4']();this[_0x8be4('0x5')]=_0x5041d8;this[_0x8be4('0x6')]=_0x58898f;this[_0x8be4('0x7')]=_0x3404c7;this[_0x8be4('0x4')]=_0x95e50e;this[_0x8be4('0x5')][_0x8be4('0x8')](this[_0x8be4('0x9')]['bind'](this),this[_0x8be4('0xa')][_0x8be4('0xb')](this));this['squeue']['on']('timeout',this[_0x8be4('0xa')]['bind'](this));this['squeue']['on'](_0x8be4('0xc'),this[_0x8be4('0xd')][_0x8be4('0xb')](this));};Beepall['prototype']['push']=function(){this['squeue'][_0x8be4('0x8')](this[_0x8be4('0x9')][_0x8be4('0xb')](this),this[_0x8be4('0xa')]['bind'](this));};Beepall['prototype'][_0x8be4('0xd')]=function(_0x39a1d0){this[_0x8be4('0xa')](!![]);};Beepall[_0x8be4('0xe')]['handleRun']=function(_0x332d5c){var _0x4d21bd=!![];if(!_[_0x8be4('0xf')](this[_0x8be4('0x6')])&&!_[_0x8be4('0xf')](this[_0x8be4('0x6')][_0x8be4('0x10')])&&this[_0x8be4('0x6')][_0x8be4('0x10')][_0x8be4('0x11')]>0x0){for(var _0x21816e=0x0,_0x37c1e4;_0x21816e0x0){for(var _0x1be87a=0x0,_0x3b717e;_0x1be87a0x0&&_0x2402de[_0x3f80b9+_0x901d('0x24')]>=_0x2402de[_0x3f80b9+_0x901d('0x23')]){writeLog(_0x53ee69,_0x2402de,_0x3f80b9[_0x901d('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x901d('0x26')]=function(_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9){return sendNotification(!![],_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9);};exports['hideNotification']=function(_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5){return sendNotification(![],_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5);};exports[_0x901d('0x27')]=writeLog; \ No newline at end of file +var _0x4819=['format','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','online','OFFLINE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','notificationTemplate'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x4819,0xcd));var _0x9481=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0x4819[_0x2e58c7];return _0x26eb00;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var utils=require(_0x9481('0x1'));var Mustache=require(_0x9481('0x2'));var Redis=require(_0x9481('0x3'));var config=require(_0x9481('0x4'));var logger=require(_0x9481('0x5'))(_0x9481('0x6'));config[_0x9481('0x7')]=_[_0x9481('0x8')](config[_0x9481('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9481('0x9'))(new Redis(config['redis']));function emit(_0x54cc78,_0x14e05a,_0x6c6a08){io['to'](_0x54cc78)[_0x9481('0xa')](_0x14e05a,_0x6c6a08);}function sendNotification(_0x3278ff,_0x15d895,_0x4c7d9c,_0x1818cf,_0x521d18,_0x2fabf1){io['to'](util['format'](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](_0x9481('0xd'),_0x1818cf);var _0xe84f77=_0x2fabf1||{};var _0x29515a=_0x4c7d9c[_0x9481('0xe')]('.');var _0xe410c3={'uniqueid':_0x15d895,'channel':_0x29515a[0x0],'id':_0x29515a[0x1],'title':_0x29515a[0x0]+_0x9481('0xf'),'interactionId':_0x29515a[0x2],'queue':_0x521d18?_0x521d18['name']:null,'sound':_0xe84f77['account'][_0x9481('0x10')],'shake':_0xe84f77[_0x9481('0x11')][_0x9481('0x12')]};try{if(!_0xe84f77[_0x9481('0x13')]){_0xe84f77[_0x9481('0x13')]={};}if(_0x521d18){_0xe84f77[_0x9481('0x13')][_0x9481('0x14')]=_0x521d18;}else if(_0xe84f77['body'][_0x9481('0x14')]){delete _0xe84f77[_0x9481('0x13')]['queue'];}_0xe410c3[_0x9481('0x15')]=utils['getMustacheRender'](_0xe84f77[_0x9481('0x11')][_0x9481('0x16')],_0xe84f77);}catch(_0x2bc12a){_0xe410c3[_0x9481('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x9481('0x17')]('[%s][QUEUE]\x20%s',_0x15d895,_0x2bc12a['message']));}io['to'](util[_0x9481('0x17')](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](util[_0x9481('0x17')](_0x9481('0x18'),_0x3278ff?'save':_0x9481('0x19')),_0xe410c3);}function writeLog(_0x272a84,_0x45f9df,_0x615e02){return logger[_0x9481('0x1a')](util['format'](_0x9481('0x1b'),_0x272a84,_0x45f9df[_0x9481('0xc')],_0x615e02));}exports['isAgentAvailable']=function(_0x2bcf37,_0xd1cd1a,_0x352b3a,_0x1809d2){if(_0xd1cd1a[_0x9481('0x1c')]){writeLog(_0x2bcf37,_0xd1cd1a,'BUSY');return![];}if(!_0xd1cd1a[_0x9481('0x1d')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x9481('0x1e'));return![];}if(_0xd1cd1a[_0x352b3a+'Pause']){writeLog(_0x2bcf37,_0xd1cd1a,'PAUSE');return![];}if(_0x1809d2&&_0xd1cd1a[_0x9481('0x1f')](_0x352b3a+_0x9481('0x20'))&&_0xd1cd1a['hasOwnProperty'](_0x352b3a+_0x9481('0x21'))){if(_0xd1cd1a[_0x352b3a+_0x9481('0x20')]>0x0&&_0xd1cd1a[_0x352b3a+_0x9481('0x21')]>=_0xd1cd1a[_0x352b3a+_0x9481('0x20')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x352b3a['toUpperCase']()+_0x9481('0x22'));return![];}}return!![];};exports[_0x9481('0x23')]=function(_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff){return sendNotification(!![],_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff);};exports[_0x9481('0x24')]=function(_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff){return sendNotification(![],_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff);};exports[_0x9481('0x25')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 31c553b..1deaa11 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 _0x06cb=['error','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','./utils','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x47f37a,_0x21cac6){var _0x2a26a9=function(_0x522e49){while(--_0x522e49){_0x47f37a['push'](_0x47f37a['shift']());}};_0x2a26a9(++_0x21cac6);}(_0x06cb,0x1c6));var _0xb06c=function(_0x8e9d57,_0x2e8366){_0x8e9d57=_0x8e9d57-0x0;var _0x1f8bf4=_0x06cb[_0x8e9d57];return _0x1f8bf4;};'use strict';var schema=require(_0xb06c('0x0'));var sh=require(_0xb06c('0x1'));var _=require(_0xb06c('0x2'));var utils=require(_0xb06c('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xb06c('0x4'),'required':!![],'message':_0xb06c('0x5')}});exports[_0xb06c('0x6')]=function(_0x1e4fd2,_0x322f3a){return function(_0x25fe2d){try{var _0x55ea25={'command':_0x322f3a[0x0]};var _0x2e480f=system[_0xb06c('0x0')](_0x55ea25,{'typecast':!![]});if(_0x2e480f[_0xb06c('0x7')]){logger[_0xb06c('0x8')](_0xb06c('0x9'),_0x1e4fd2,_[_0xb06c('0xa')](_0x2e480f,'message')['join'](',\x20'));logger[_0xb06c('0xb')](_0xb06c('0xc'),_0x1e4fd2);_0x25fe2d[_0xb06c('0xd')]();}else{var _0x4e5779=this;var _0x48b995=utils[_0xb06c('0xe')](_0x322f3a[0x0],this);logger[_0xb06c('0xb')](_0xb06c('0xf'),_0x1e4fd2,_0x48b995);sh[_0xb06c('0x10')](_['trim'](_0x48b995),function(_0x5af6ff,_0x5a28da){logger[_0xb06c('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x1e4fd2,_0x5af6ff);if(_0x5af6ff==0x0){var _0x409e53=_0x5a28da[_0xb06c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xb06c('0x12')](_0x322f3a[0x1])||_['isEmpty'](_0x322f3a[0x1])){logger[_0xb06c('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x1e4fd2);_0x4e5779[_0xb06c('0x13')][_0x322f3a[0x1]]=_0x409e53;}else{logger[_0xb06c('0xb')](_0xb06c('0x14'),_0x1e4fd2,_0x322f3a[0x1],_0x409e53);_0x4e5779['body'][_0x322f3a[0x1]]=_0x409e53;}}_0x25fe2d[_0xb06c('0xd')]();});}}catch(_0x15a94e){logger['error'](_0xb06c('0x9'),_0x1e4fd2,_['isObject'](_0x15a94e)?JSON[_0xb06c('0x15')](_0x15a94e):_0x15a94e);logger[_0xb06c('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1e4fd2);_0x25fe2d[_0xb06c('0xd')]();}};}; \ No newline at end of file +var _0x4512=['stringify','validate','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%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','[%s][SYSTEM]\x20%s','isObject'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x4512,0x1e7));var _0x2451=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x4512[_0x1af1e1];return _0x5f3450;};'use strict';var schema=require(_0x2451('0x0'));var sh=require('shelljs');var _=require(_0x2451('0x1'));var utils=require(_0x2451('0x2'));var logger=require('../../../../config/logger')(_0x2451('0x3'));var system=schema({'command':{'type':_0x2451('0x4'),'required':!![],'message':_0x2451('0x5')}});exports[_0x2451('0x6')]=function(_0x4a658f,_0x1cfaa1){return function(_0x578f16){try{var _0x45acfc={'command':_0x1cfaa1[0x0]};var _0x1e8867=system[_0x2451('0x0')](_0x45acfc,{'typecast':!![]});if(_0x1e8867[_0x2451('0x7')]){logger[_0x2451('0x8')]('[%s][SYSTEM]\x20%s',_0x4a658f,_[_0x2451('0x9')](_0x1e8867,_0x2451('0xa'))[_0x2451('0xb')](',\x20'));logger[_0x2451('0xc')](_0x2451('0xd'),_0x4a658f);_0x578f16[_0x2451('0xe')]();}else{var _0x7e1132=this;var _0x1ab7ef=utils['getMustacheRender'](_0x1cfaa1[0x0],this);logger[_0x2451('0xc')](_0x2451('0xf'),_0x4a658f,_0x1ab7ef);sh[_0x2451('0x10')](_[_0x2451('0x11')](_0x1ab7ef),function(_0x837664,_0x3cccd9){logger[_0x2451('0xc')](_0x2451('0x12'),_0x4a658f,_0x837664);if(_0x837664==0x0){var _0x429a61=_0x3cccd9[_0x2451('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1cfaa1[0x1])||_[_0x2451('0x14')](_0x1cfaa1[0x1])){logger[_0x2451('0xc')](_0x2451('0x15'),_0x4a658f);_0x7e1132[_0x2451('0x16')][_0x1cfaa1[0x1]]=_0x429a61;}else{logger[_0x2451('0xc')](_0x2451('0x17'),_0x4a658f,_0x1cfaa1[0x1],_0x429a61);_0x7e1132[_0x2451('0x16')][_0x1cfaa1[0x1]]=_0x429a61;}}_0x578f16['next']();});}}catch(_0x458682){logger['error'](_0x2451('0x18'),_0x4a658f,_[_0x2451('0x19')](_0x458682)?JSON[_0x2451('0x1a')](_0x458682):_0x458682);logger[_0x2451('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4a658f);_0x578f16[_0x2451('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index ad88950..4aa518e 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 _0x23ab=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','validate','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','length','error','[%s][TAG]\x20%s','map','message','info'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0x23ab,0xe3));var _0xb23a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x23ab[_0x42cae2];return _0x5f256f;};'use strict';var schema=require(_0xb23a('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb23a('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb23a('0x2')),'faxInteraction':require(_0xb23a('0x3')),'whatsappInteraction':require(_0xb23a('0x4'))};var logger=require('../../../../config/logger')(_0xb23a('0x5'));var tag=schema({'tag':{'type':_0xb23a('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x3e5bc2,_0x5c933d,_0x1c02c1,_0x4cbfe5){return function(_0x8fafd8){try{var _0xabe092={'tag':_0x5c933d[0x0]};var _0x119989=tag[_0xb23a('0x0')](_0xabe092,{'typecast':!![]});if(_0x119989[_0xb23a('0x7')]){logger[_0xb23a('0x8')](_0xb23a('0x9'),_0x3e5bc2,_[_0xb23a('0xa')](_0x119989,_0xb23a('0xb'))['join'](',\x20'));logger[_0xb23a('0xc')](_0xb23a('0xd'),_0x3e5bc2);_0x8fafd8[_0xb23a('0xe')]();}else{var _0x43755b={'ids':[_0x5c933d[0x0]]};if(rpc[_0x4cbfe5[_0xb23a('0xf')]+_0xb23a('0x10')]){rpc[_0x4cbfe5['channel']+_0xb23a('0x10')][_0xb23a('0x11')](_0x4cbfe5['interaction']['id'],_0x43755b)[_0xb23a('0x12')](function(_0x2a3ef6){logger[_0xb23a('0xc')](_0xb23a('0x13'),_0x3e5bc2,_0x5c933d[0x1],_0x4cbfe5['channel'],_0x4cbfe5[_0xb23a('0x14')]['id']);})[_0xb23a('0x15')](function(_0x2c9860){logger[_0xb23a('0x8')](_0xb23a('0x9'),_0x3e5bc2,JSON[_0xb23a('0x16')](_0x2c9860));logger[_0xb23a('0xc')](_0xb23a('0xd'),_0x3e5bc2);})[_0xb23a('0x17')](function(){_0x8fafd8[_0xb23a('0xe')]();});}}}catch(_0x3d7239){logger[_0xb23a('0x8')](_0xb23a('0x9'),_0x3e5bc2,_['isObject'](_0x3d7239)?JSON['stringify'](_0x3d7239):_0x3d7239);logger[_0xb23a('0xc')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3e5bc2);_0x8fafd8[_0xb23a('0xe')]();}};}; \ No newline at end of file +var _0xf08a=['next','channel','Interaction','then','interaction','catch','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x365fca,_0x2da755){var _0x485020=function(_0x11c8cc){while(--_0x11c8cc){_0x365fca['push'](_0x365fca['shift']());}};_0x485020(++_0x2da755);}(_0xf08a,0x195));var _0xaf08=function(_0x98e411,_0x5be12a){_0x98e411=_0x98e411-0x0;var _0x119b4c=_0xf08a[_0x98e411];return _0x119b4c;};'use strict';var schema=require(_0xaf08('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xaf08('0x1')),'openchannelInteraction':require(_0xaf08('0x2')),'smsInteraction':require(_0xaf08('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xaf08('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xaf08('0x5'))('routing');var tag=schema({'tag':{'type':_0xaf08('0x6'),'required':!![],'message':_0xaf08('0x7')}});exports['consequence']=function(_0x31a7bb,_0x41cb06,_0x56ab75,_0xb193ed){return function(_0x1a7f40){try{var _0x4df348={'tag':_0x41cb06[0x0]};var _0x320e67=tag[_0xaf08('0x0')](_0x4df348,{'typecast':!![]});if(_0x320e67['length']){logger[_0xaf08('0x8')](_0xaf08('0x9'),_0x31a7bb,_['map'](_0x320e67,'message')[_0xaf08('0xa')](',\x20'));logger[_0xaf08('0xb')](_0xaf08('0xc'),_0x31a7bb);_0x1a7f40[_0xaf08('0xd')]();}else{var _0x9f26df={'ids':[_0x41cb06[0x0]]};if(rpc[_0xb193ed['channel']+'Interaction']){rpc[_0xb193ed[_0xaf08('0xe')]+_0xaf08('0xf')]['addTags'](_0xb193ed['interaction']['id'],_0x9f26df)[_0xaf08('0x10')](function(_0x38d3b3){logger[_0xaf08('0xb')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x31a7bb,_0x41cb06[0x1],_0xb193ed[_0xaf08('0xe')],_0xb193ed[_0xaf08('0x11')]['id']);})[_0xaf08('0x12')](function(_0x436370){logger[_0xaf08('0x8')](_0xaf08('0x9'),_0x31a7bb,JSON[_0xaf08('0x13')](_0x436370));logger[_0xaf08('0xb')](_0xaf08('0xc'),_0x31a7bb);})[_0xaf08('0x14')](function(){_0x1a7f40['next']();});}}}catch(_0x28531b){logger[_0xaf08('0x8')]('[%s][TAG]\x20%s',_0x31a7bb,_[_0xaf08('0x15')](_0x28531b)?JSON[_0xaf08('0x13')](_0x28531b):_0x28531b);logger[_0xaf08('0xb')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x31a7bb);_0x1a7f40[_0xaf08('0xd')]();}};}; \ 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 16970df..897b5ad 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x18ca89,_0x37ee22){var _0x5d8d56=function(_0x4d1cba){while(--_0x4d1cba){_0x18ca89['push'](_0x18ca89['shift']());}};_0x5d8d56(++_0x37ee22);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x535831,_0x35cda7){var _0x5650c1=function(_0x21986c){while(--_0x21986c){_0x535831['push'](_0x535831['shift']());}};_0x5650c1(++_0x35cda7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 80b50cd..65cc7ef 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 _0x6c44=['split','channel','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','app','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','info','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','agent','agents','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','name','paused','mailQueues','available','loggedIn','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','length','existsSync','join','.js','toLowerCase','appdata'];(function(_0x5463c2,_0x22c4cc){var _0x5a7da7=function(_0x4c16b5){while(--_0x4c16b5){_0x5463c2['push'](_0x5463c2['shift']());}};_0x5a7da7(++_0x22c4cc);}(_0x6c44,0xef));var _0x46c4=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x6c44[_0x12f688];return _0x59c3de;};'use strict';var _=require('lodash');var util=require(_0x46c4('0x0'));var path=require(_0x46c4('0x1'));var fs=require('fs');var jayson=require(_0x46c4('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x46c4('0x3'))('routing');var rpc={'openchannelQueueReport':require(_0x46c4('0x4')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x46c4('0x5')),'smsQueueReport':require(_0x46c4('0x6')),'faxQueueReport':require(_0x46c4('0x7')),'whatsappQueueReport':require(_0x46c4('0x8'))};var RuleEngine=require(_0x46c4('0x9'));function getId(_0x3694e4,_0x15ac05,_0x30725e){return util[_0x46c4('0xa')](_0x46c4('0xb'),_0x3694e4,_0x15ac05||0x0,_0x30725e||0x0);}function getIntervals(_0x4f7876,_0x2d0cec){var _0x2813c1=[];if(!_[_0x46c4('0xc')](_0x2d0cec[_0x46c4('0xd')])&&!_[_0x46c4('0xc')](_0x4f7876[_0x2d0cec[_0x46c4('0xd')]])&&!_[_0x46c4('0xc')](_0x4f7876[_0x2d0cec['IntervalId']][_0x46c4('0xe')])){_0x2813c1=_[_0x46c4('0xf')](_0x4f7876[_0x2d0cec['IntervalId']][_0x46c4('0xe')],'interval');}else if(!_[_0x46c4('0xc')](_0x2d0cec[_0x46c4('0x10')])){_0x2813c1=[_0x2d0cec['interval']];}return _0x2813c1;}exports[_0x46c4('0x11')]=function(_0x3c224c){_0x3c224c[_0x46c4('0x12')]={};return new BPromise(function(_0x28a938,_0x434dc4){var _0x4580c1={'Start':function(_0x51c2c9){var _0x42654d=this;return new Promise(function(_0x50a578,_0x4befea){if(_0x51c2c9){try{var _0x1b6c06=[];var _0x3b2fff=getId(_0x51c2c9['channel'],_0x51c2c9[_0x46c4('0x13')]?_0x51c2c9['message']['id']:0x0,_0x51c2c9[_0x46c4('0x14')]?_0x51c2c9[_0x46c4('0x14')]['id']:0x0);if(_0x51c2c9[_0x46c4('0x15')]&&_['isArray'](_0x51c2c9[_0x46c4('0x15')])&&_0x51c2c9[_0x46c4('0x15')][_0x46c4('0x16')]){for(var _0x11ebe3=0x0;_0x11ebe3<_0x51c2c9[_0x46c4('0x15')][_0x46c4('0x16')];_0x11ebe3+=0x1){var _0x440f48=_0x51c2c9[_0x46c4('0x15')][_0x11ebe3];if(fs[_0x46c4('0x17')](path[_0x46c4('0x18')](__dirname,_0x46c4('0x15'),_0x440f48['app']+_0x46c4('0x19')))){var _0x334730=[];switch(_0x440f48['app'][_0x46c4('0x1a')]()){case'autoreply':var _0x442f4a=_0x440f48[_0x46c4('0x1b')][_0x46c4('0x1c')](',');if(_0x51c2c9[_0x46c4('0x1d')]===_0x46c4('0x1e')){_0x334730[_0x46c4('0x1f')](_0x442f4a[0x0]);_0x334730[_0x46c4('0x1f')](_0x442f4a[0x1]);_0x334730[_0x46c4('0x1f')](_0x442f4a['slice'](0x2,_0x442f4a[_0x46c4('0x16')])[_0x46c4('0x18')](','));}else{_0x334730[_0x46c4('0x1f')](_0x442f4a[0x0]);_0x334730['push'](_0x442f4a[_0x46c4('0x20')](0x1,_0x442f4a[_0x46c4('0x16')])[_0x46c4('0x18')](','));}break;case'dialogflow':var _0xcba21=_0x440f48[_0x46c4('0x1b')]['split'](',');_0x334730['push'](_0xcba21[0x0]);_0x334730[_0x46c4('0x1f')](_0xcba21[0x1]);_0x334730[_0x46c4('0x1f')](_0xcba21['slice'](0x2,_0xcba21[_0x46c4('0x16')])[_0x46c4('0x18')](','));break;case _0x46c4('0x21'):var _0x19bd6e=_0x440f48['appdata'][_0x46c4('0x1c')](',');_0x334730[_0x46c4('0x1f')](_0x19bd6e[0x0]);_0x334730['push'](_0x19bd6e[0x1]);_0x334730['push'](_0x19bd6e[0x2]);_0x334730['push'](_0x19bd6e[0x3]);_0x334730['push'](_0x19bd6e['slice'](0x4,_0x19bd6e[_0x46c4('0x16')])[_0x46c4('0x18')](','));break;case _0x46c4('0x22'):var _0x520fd9=_0x440f48[_0x46c4('0x1b')]['split'](',');_0x334730[_0x46c4('0x1f')](_0x520fd9[0x0]);_0x334730[_0x46c4('0x1f')](_0x520fd9[0x1]);_0x334730[_0x46c4('0x1f')](_0x520fd9[0x2]);_0x334730[_0x46c4('0x1f')](_0x520fd9[0x3]);_0x334730['push'](_0x520fd9[_0x46c4('0x20')](0x4,_0x520fd9[_0x46c4('0x16')])[_0x46c4('0x18')](','));break;case'message':_0x334730[_0x46c4('0x1f')](_0x440f48['appdata']);break;case _0x46c4('0x23'):_0x334730[_0x46c4('0x1f')](_0x440f48[_0x46c4('0x24')]);_0x334730[_0x46c4('0x1f')](_0x440f48[_0x46c4('0x1b')]);break;default:_0x334730=_[_0x46c4('0xc')](_0x440f48['appdata'])?[]:_0x440f48[_0x46c4('0x1b')][_0x46c4('0x1c')](',');}var _0x14e586={'id':util[_0x46c4('0xa')](_0x46c4('0x25'),_0x3b2fff,_0x440f48['id'],_0x440f48[_0x46c4('0x26')]),'condition':require(_0x46c4('0x27'))['condition'](_0x3b2fff,getIntervals(_0x3c224c[_0x46c4('0x28')],_0x440f48),_0x3c224c),'consequence':require(_0x46c4('0x29')+_0x440f48['app'])[_0x46c4('0x2a')](_0x3b2fff,_0x334730,_0x3c224c,_0x51c2c9),'p':_0x440f48[_0x46c4('0x2b')]||0x0};logger['info'](_0x46c4('0x2c'),_0x14e586['id'],'on\x20interval',getIntervals(_0x3c224c['intervals'],_0x440f48)[_0x46c4('0x18')](_0x46c4('0x2d')));_0x1b6c06['push'](_0x14e586);}else{logger[_0x46c4('0x2e')](_0x46c4('0x2f'),path[_0x46c4('0x18')](__dirname,_0x46c4('0x15'),_0x440f48[_0x46c4('0x26')]+'.js'));}}_0x3c224c['rules'][_0x3b2fff]=new RuleEngine(_0x1b6c06);_0x3c224c['rules'][_0x3b2fff]['execute'](_0x51c2c9,function(_0x3a7f96){logger[_0x46c4('0x30')]('Applications\x20executed',JSON[_0x46c4('0x31')](_0x3a7f96[_0x46c4('0x32')]));if(_0x3c224c['rules'][_0x3b2fff]){_0x3c224c['rules'][_0x3b2fff][_0x46c4('0x33')]('complete');}});return _0x50a578({'code':0xc8,'message':_0x51c2c9});}else{logger[_0x46c4('0x30')](_0x46c4('0x34'));return _0x50a578({'code':0xc8,'message':_0x51c2c9});}}catch(_0x35d6b9){logger[_0x46c4('0x2e')](_0x35d6b9[_0x46c4('0x35')]);return _0x4befea(_0x42654d[_0x46c4('0x2e')](0x1f4,_0x35d6b9));}}return _0x4befea('routing\x20is\x20empty');});},'AcceptMessage':function(_0x547343){var _0x123edf=this;return new Promise(function(_0x5e8551,_0xc372d){if(_0x547343[_0x46c4('0x36')]&&_0x547343[_0x46c4('0x36')]['id']){if(_0x3c224c['agents'][_0x547343[_0x46c4('0x36')]['id']]){_0x3c224c[_0x46c4('0x37')][_0x547343['agent']['id']]['busy']=![];_0x3c224c[_0x46c4('0x37')][_0x547343[_0x46c4('0x36')]['id']][_0x46c4('0x38')]=undefined;}}if(_0x547343[_0x46c4('0x13')]&&_0x547343[_0x46c4('0x13')]['id']){try{var _0x278fd7=getId(_0x547343[_0x46c4('0x1d')],_0x547343['message']?_0x547343['message']['id']:0x0,_0x547343[_0x46c4('0x14')]?_0x547343['interaction']['id']:0x0);if(_0x3c224c[_0x46c4('0x12')][_0x278fd7]){_0x3c224c[_0x46c4('0x12')][_0x278fd7][_0x46c4('0x33')](_0x46c4('0x39'));if(rpc[_0x547343['channel']+_0x46c4('0x3a')]){rpc[_0x547343[_0x46c4('0x1d')]+_0x46c4('0x3a')]['update'](_0x278fd7,{'UserId':_0x547343['message'][_0x46c4('0x3b')]})[_0x46c4('0x3c')](function(_0x4f00c3){logger[_0x46c4('0x2e')](_0x46c4('0x3d'));});}}return _0x5e8551({'code':0xc8,'message':_0x547343});}catch(_0x12d5dd){logger[_0x46c4('0x2e')](_0x12d5dd[_0x46c4('0x35')]);return _0xc372d(_0x123edf['error'](0x1f4,_0x12d5dd));}}logger[_0x46c4('0x2e')](_0x46c4('0x3e'));return _0xc372d(_0x123edf['error'](0x1f4,_0x46c4('0x3e')));});},'RejectMessage':function(_0xecba1b){var _0x5069b9=this;return new Promise(function(_0x1f714c,_0xe238f2){if(_0xecba1b[_0x46c4('0x36')]&&_0xecba1b['agent']['id']){try{if(_0x3c224c[_0x46c4('0x37')][_0xecba1b['agent']['id']]){_0x3c224c[_0x46c4('0x37')][_0xecba1b[_0x46c4('0x36')]['id']]['busy']=![];_0x3c224c[_0x46c4('0x37')][_0xecba1b[_0x46c4('0x36')]['id']]['busyQueue']=undefined;}return _0x1f714c({'code':0xc8,'message':_0xecba1b});}catch(_0x125e6f){logger[_0x46c4('0x2e')](_0x125e6f[_0x46c4('0x35')]);return _0xe238f2(_0x5069b9[_0x46c4('0x2e')](0x1f4,_0x125e6f));}}logger['error'](_0x46c4('0x3e'));return _0xe238f2(_0x5069b9[_0x46c4('0x2e')](0x1f4,_0x46c4('0x3e')));});},'AbandonInteraction':function(_0x17ee08){var _0x4e3adc=this;return new Promise(function(_0x29dd51,_0x35e20c){if(_0x17ee08[_0x46c4('0x1d')]&&_0x17ee08['interaction']&&_0x17ee08['interaction']['id']){try{var _0x2b56e0=getId(_0x17ee08[_0x46c4('0x1d')],_0x17ee08[_0x46c4('0x13')]?_0x17ee08[_0x46c4('0x13')]['id']:0x0,_0x17ee08[_0x46c4('0x14')]?_0x17ee08[_0x46c4('0x14')]['id']:0x0);if(_0x3c224c[_0x46c4('0x12')][_0x2b56e0]){_0x3c224c[_0x46c4('0x12')][_0x2b56e0][_0x46c4('0x33')](_0x46c4('0x39'));}return _0x29dd51({'code':0xc8,'message':_0x17ee08});}catch(_0x5eda22){logger['error'](_0x5eda22[_0x46c4('0x35')]);return _0x35e20c(_0x4e3adc[_0x46c4('0x2e')](0x1f4,_0x5eda22));}}logger[_0x46c4('0x2e')]('message\x20is\x20empty');return _0x35e20c(_0x4e3adc[_0x46c4('0x2e')](0x1f4,_0x46c4('0x3e')));});},'AgentCapacity':function(_0x127ba1){var _0x134093=this;return new Promise(function(_0x1d8e61,_0x36b440){if(_0x3c224c[_0x46c4('0x37')][_0x46c4('0x3f')](_0x127ba1['id'])){for(var _0x15857b in _0x127ba1[_0x46c4('0x40')]){if(_0x127ba1[_0x46c4('0x40')]['hasOwnProperty'](_0x15857b)){if(_0x3c224c['agents'][_0x127ba1['id']][_0x46c4('0x3f')](_0x15857b+_0x46c4('0x41'))){_0x3c224c[_0x46c4('0x37')][_0x127ba1['id']][_0x15857b+_0x46c4('0x41')]=parseInt(_0x127ba1[_0x46c4('0x40')][_0x15857b],0xa);}}}_0x3c224c[_0x46c4('0x37')][_0x127ba1['id']]['updateRealtime']();return _0x1d8e61({'code':0xc8,'message':_0x3c224c[_0x46c4('0x37')][_0x127ba1['id']]});}else{return _0x36b440(_0x134093[_0x46c4('0x2e')](0x1f4,_0x46c4('0x42')));}});},'Agents':function(_0xa27aac){return new Promise(function(_0x28d3da,_0x14b322){var _0x3037a0=_[_0x46c4('0x43')](_0x3c224c[_0x46c4('0x37')]);_0x28d3da({'count':_0x3037a0['length'],'rows':_0x3037a0});});},'ChatQueues':function(_0x12942a){return new Promise(function(_0x17d65b,_0x12c33d){var _0x3641de=[];for(var _0x2a89c9 in _0x3c224c['chatQueues']){if(_0x3c224c[_0x46c4('0x44')][_0x46c4('0x3f')](_0x2a89c9)){var _0x421fc8=_0x3c224c[_0x46c4('0x44')][_0x2a89c9];var _0x3256c8={'id':_0x421fc8['id'],'available':_0x421fc8['available'],'loggedIn':_0x421fc8['loggedIn'],'name':_0x421fc8[_0x46c4('0x45')],'paused':_0x421fc8[_0x46c4('0x46')],'waiting':_0x421fc8['waiting']};_0x3641de[_0x46c4('0x1f')](_0x3256c8);}}_0x17d65b({'count':_0x3641de[_0x46c4('0x16')],'rows':_0x3641de});});},'MailQueues':function(_0x3aec5b){return new Promise(function(_0x1d6f88,_0x3acfd0){var _0x3f3718=[];for(var _0x355002 in _0x3c224c[_0x46c4('0x47')]){if(_0x3c224c[_0x46c4('0x47')][_0x46c4('0x3f')](_0x355002)){var _0x494f08=_0x3c224c[_0x46c4('0x47')][_0x355002];var _0x4b13a8={'id':_0x494f08['id'],'available':_0x494f08[_0x46c4('0x48')],'loggedIn':_0x494f08[_0x46c4('0x49')],'name':_0x494f08[_0x46c4('0x45')],'paused':_0x494f08['paused'],'waiting':_0x494f08['waiting']};_0x3f3718[_0x46c4('0x1f')](_0x4b13a8);}}_0x1d6f88({'count':_0x3f3718['length'],'rows':_0x3f3718});});},'OpenchannelQueues':function(_0x89dcd0){return new Promise(function(_0x54c3eb,_0x3bba78){var _0x493eb9=[];for(var _0x527b7c in _0x3c224c[_0x46c4('0x4a')]){if(_0x3c224c[_0x46c4('0x4a')]['hasOwnProperty'](_0x527b7c)){var _0x483b15=_0x3c224c[_0x46c4('0x4a')][_0x527b7c];var _0x5c7e81={'id':_0x483b15['id'],'available':_0x483b15['available'],'loggedIn':_0x483b15[_0x46c4('0x49')],'name':_0x483b15['name'],'paused':_0x483b15[_0x46c4('0x46')],'waiting':_0x483b15[_0x46c4('0x4b')]};_0x493eb9[_0x46c4('0x1f')](_0x5c7e81);}}_0x54c3eb({'count':_0x493eb9[_0x46c4('0x16')],'rows':_0x493eb9});});},'SmsQueues':function(_0x35b9c3){return new Promise(function(_0x204477,_0xb691d8){var _0x2c8a5e=[];for(var _0x5d3ce1 in _0x3c224c['smsQueues']){if(_0x3c224c[_0x46c4('0x4c')][_0x46c4('0x3f')](_0x5d3ce1)){var _0x52b64e=_0x3c224c['smsQueues'][_0x5d3ce1];var _0x159a7c={'id':_0x52b64e['id'],'available':_0x52b64e['available'],'loggedIn':_0x52b64e[_0x46c4('0x49')],'name':_0x52b64e[_0x46c4('0x45')],'paused':_0x52b64e[_0x46c4('0x46')],'waiting':_0x52b64e[_0x46c4('0x4b')]};_0x2c8a5e['push'](_0x159a7c);}}_0x204477({'count':_0x2c8a5e[_0x46c4('0x16')],'rows':_0x2c8a5e});});},'FaxQueues':function(_0x29e6b2){return new Promise(function(_0x2b5026,_0x16995d){var _0x18a468=[];for(var _0x4602b6 in _0x3c224c['faxQueues']){if(_0x3c224c[_0x46c4('0x4d')][_0x46c4('0x3f')](_0x4602b6)){var _0x5b24d2=_0x3c224c['faxQueues'][_0x4602b6];var _0x1b9639={'id':_0x5b24d2['id'],'available':_0x5b24d2[_0x46c4('0x48')],'loggedIn':_0x5b24d2[_0x46c4('0x49')],'name':_0x5b24d2[_0x46c4('0x45')],'paused':_0x5b24d2['paused'],'waiting':_0x5b24d2[_0x46c4('0x4b')]};_0x18a468[_0x46c4('0x1f')](_0x1b9639);}}_0x2b5026({'count':_0x18a468['length'],'rows':_0x18a468});});},'WhatsappQueues':function(_0x20cef1){return new Promise(function(_0x1c8aa7,_0x24a99a){var _0x1f90ea=[];for(var _0x4a8ab9 in _0x3c224c[_0x46c4('0x4e')]){if(_0x3c224c['whatsappQueues'][_0x46c4('0x3f')](_0x4a8ab9)){var _0x3812ef=_0x3c224c['whatsappQueues'][_0x4a8ab9];var _0x316ef0={'id':_0x3812ef['id'],'available':_0x3812ef[_0x46c4('0x48')],'loggedIn':_0x3812ef[_0x46c4('0x49')],'name':_0x3812ef['name'],'paused':_0x3812ef[_0x46c4('0x46')],'waiting':_0x3812ef[_0x46c4('0x4b')]};_0x1f90ea[_0x46c4('0x1f')](_0x316ef0);}}_0x1c8aa7({'count':_0x1f90ea[_0x46c4('0x16')],'rows':_0x1f90ea});});},'ChatQueuesWaitingInteractions':function(_0x47b83b){return new Promise(function(_0x53730d,_0x597d18){var _0x5da17e=_[_0x46c4('0x43')](_0x3c224c[_0x46c4('0x4f')]);_0x53730d({'count':_0x5da17e['length'],'rows':_0x5da17e});});},'MailQueuesWaitingInteractions':function(_0xbd3b84){return new Promise(function(_0xc78a07,_0x57d283){var _0x45573b=_['values'](_0x3c224c[_0x46c4('0x50')]);_0xc78a07({'count':_0x45573b['length'],'rows':_0x45573b});});},'OpenchannelQueuesWaitingInteractions':function(_0x466e9c){return new Promise(function(_0x1da00c,_0x30c7cb){var _0x489fc8=_[_0x46c4('0x43')](_0x3c224c[_0x46c4('0x51')]);_0x1da00c({'count':_0x489fc8[_0x46c4('0x16')],'rows':_0x489fc8});});},'SmsQueuesWaitingInteractions':function(_0x3a3406){return new Promise(function(_0x1e9029,_0x9026ad){var _0x26c132=_[_0x46c4('0x43')](_0x3c224c[_0x46c4('0x52')]);_0x1e9029({'count':_0x26c132['length'],'rows':_0x26c132});});},'FaxQueuesWaitingInteractions':function(_0xff9ec3){return new Promise(function(_0x445095,_0xef8f0b){var _0x48943d=_[_0x46c4('0x43')](_0x3c224c[_0x46c4('0x53')]);_0x445095({'count':_0x48943d[_0x46c4('0x16')],'rows':_0x48943d});});},'WhatsappQueuesWaitingInteractions':function(_0x35f442){return new Promise(function(_0x6988e3,_0x4931f3){var _0xa94a51=_['values'](_0x3c224c[_0x46c4('0x54')]);_0x6988e3({'count':_0xa94a51[_0x46c4('0x16')],'rows':_0xa94a51});});}};var _0xa37c6f=jayson[_0x46c4('0x55')](_0x4580c1)['http']();_0xa37c6f['on'](_0x46c4('0x2e'),function(_0x2d8118){logger[_0x46c4('0x2e')](JSON['stringify'](_0x2d8118));return _0x434dc4(_0x2d8118);});_0xa37c6f['listen'](0x232c,_0x46c4('0x56'),function(){console[_0x46c4('0x57')](_0x46c4('0x58'),0x232c);return _0x28a938('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xf51a=['info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','available','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','%s:%s:%s','condition','intervals','./applications/','consequence','priority'];(function(_0x59c4dd,_0x5a0930){var _0x2be3fc=function(_0x5ca423){while(--_0x5ca423){_0x59c4dd['push'](_0x59c4dd['shift']());}};_0x2be3fc(++_0x5a0930);}(_0xf51a,0x144));var _0xaf51=function(_0x448afc,_0x3d20ca){_0x448afc=_0x448afc-0x0;var _0x4dc5e4=_0xf51a[_0x448afc];return _0x4dc5e4;};'use strict';var _=require(_0xaf51('0x0'));var util=require(_0xaf51('0x1'));var path=require(_0xaf51('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xaf51('0x3'));var uuid=require('uuid');var config=require(_0xaf51('0x4'));var logger=require(_0xaf51('0x5'))(_0xaf51('0x6'));var rpc={'openchannelQueueReport':require(_0xaf51('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xaf51('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xaf51('0x9')),'whatsappQueueReport':require(_0xaf51('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2d968e,_0xdb132,_0x26cc66){return util[_0xaf51('0xb')](_0xaf51('0xc'),_0x2d968e,_0xdb132||0x0,_0x26cc66||0x0);}function getIntervals(_0x533a55,_0x555c9d){var _0x3e8f60=[];if(!_[_0xaf51('0xd')](_0x555c9d[_0xaf51('0xe')])&&!_[_0xaf51('0xd')](_0x533a55[_0x555c9d[_0xaf51('0xe')]])&&!_[_0xaf51('0xd')](_0x533a55[_0x555c9d['IntervalId']]['Intervals'])){_0x3e8f60=_[_0xaf51('0xf')](_0x533a55[_0x555c9d[_0xaf51('0xe')]][_0xaf51('0x10')],_0xaf51('0x11'));}else if(!_['isNil'](_0x555c9d[_0xaf51('0x11')])){_0x3e8f60=[_0x555c9d[_0xaf51('0x11')]];}return _0x3e8f60;}exports[_0xaf51('0x12')]=function(_0x25c728){_0x25c728[_0xaf51('0x13')]={};return new BPromise(function(_0x408636,_0x1745c5){var _0x13d099={'Start':function(_0x2c1003){var _0x47aec8=this;return new Promise(function(_0x2310a7,_0x58eecf){if(_0x2c1003){try{var _0x71401=[];var _0x686215=getId(_0x2c1003[_0xaf51('0x14')],_0x2c1003['message']?_0x2c1003[_0xaf51('0x15')]['id']:0x0,_0x2c1003['interaction']?_0x2c1003[_0xaf51('0x16')]['id']:0x0);if(_0x2c1003[_0xaf51('0x17')]&&_['isArray'](_0x2c1003[_0xaf51('0x17')])&&_0x2c1003['applications'][_0xaf51('0x18')]){for(var _0x2bebbd=0x0;_0x2bebbd<_0x2c1003[_0xaf51('0x17')][_0xaf51('0x18')];_0x2bebbd+=0x1){var _0xe501bf=_0x2c1003[_0xaf51('0x17')][_0x2bebbd];if(fs[_0xaf51('0x19')](path[_0xaf51('0x1a')](__dirname,_0xaf51('0x17'),_0xe501bf[_0xaf51('0x1b')]+'.js'))){var _0x2ee30d=[];switch(_0xe501bf[_0xaf51('0x1b')][_0xaf51('0x1c')]()){case _0xaf51('0x1d'):var _0x4f0504=_0xe501bf[_0xaf51('0x1e')][_0xaf51('0x1f')](',');if(_0x2c1003[_0xaf51('0x14')]==='mail'){_0x2ee30d[_0xaf51('0x20')](_0x4f0504[0x0]);_0x2ee30d[_0xaf51('0x20')](_0x4f0504[0x1]);_0x2ee30d['push'](_0x4f0504['slice'](0x2,_0x4f0504['length'])[_0xaf51('0x1a')](','));}else{_0x2ee30d[_0xaf51('0x20')](_0x4f0504[0x0]);_0x2ee30d[_0xaf51('0x20')](_0x4f0504[_0xaf51('0x21')](0x1,_0x4f0504[_0xaf51('0x18')])[_0xaf51('0x1a')](','));}break;case _0xaf51('0x22'):var _0x5b3df5=_0xe501bf['appdata'][_0xaf51('0x1f')](',');_0x2ee30d['push'](_0x5b3df5[0x0]);_0x2ee30d[_0xaf51('0x20')](_0x5b3df5[0x1]);_0x2ee30d[_0xaf51('0x20')](_0x5b3df5[_0xaf51('0x21')](0x2,_0x5b3df5[_0xaf51('0x18')])[_0xaf51('0x1a')](','));break;case _0xaf51('0x23'):var _0x4c7f86=_0xe501bf[_0xaf51('0x1e')][_0xaf51('0x1f')](',');_0x2ee30d[_0xaf51('0x20')](_0x4c7f86[0x0]);_0x2ee30d[_0xaf51('0x20')](_0x4c7f86[0x1]);_0x2ee30d[_0xaf51('0x20')](_0x4c7f86[0x2]);_0x2ee30d['push'](_0x4c7f86[0x3]);_0x2ee30d[_0xaf51('0x20')](_0x4c7f86[_0xaf51('0x21')](0x4,_0x4c7f86[_0xaf51('0x18')])['join'](','));break;case _0xaf51('0x24'):var _0x8f266d=_0xe501bf[_0xaf51('0x1e')][_0xaf51('0x1f')](',');_0x2ee30d[_0xaf51('0x20')](_0x8f266d[0x0]);_0x2ee30d[_0xaf51('0x20')](_0x8f266d[0x1]);_0x2ee30d['push'](_0x8f266d[0x2]);_0x2ee30d['push'](_0x8f266d[0x3]);_0x2ee30d[_0xaf51('0x20')](_0x8f266d[_0xaf51('0x21')](0x4,_0x8f266d[_0xaf51('0x18')])[_0xaf51('0x1a')](','));break;case'message':_0x2ee30d['push'](_0xe501bf[_0xaf51('0x1e')]);break;case _0xaf51('0x25'):_0x2ee30d[_0xaf51('0x20')](_0xe501bf['TagId']);_0x2ee30d[_0xaf51('0x20')](_0xe501bf['appdata']);break;default:_0x2ee30d=_[_0xaf51('0xd')](_0xe501bf[_0xaf51('0x1e')])?[]:_0xe501bf[_0xaf51('0x1e')][_0xaf51('0x1f')](',');}var _0x24d01e={'id':util[_0xaf51('0xb')](_0xaf51('0x26'),_0x686215,_0xe501bf['id'],_0xe501bf[_0xaf51('0x1b')]),'condition':require('./interval')[_0xaf51('0x27')](_0x686215,getIntervals(_0x25c728[_0xaf51('0x28')],_0xe501bf),_0x25c728),'consequence':require(_0xaf51('0x29')+_0xe501bf[_0xaf51('0x1b')])[_0xaf51('0x2a')](_0x686215,_0x2ee30d,_0x25c728,_0x2c1003),'p':_0xe501bf[_0xaf51('0x2b')]||0x0};logger[_0xaf51('0x2c')](_0xaf51('0x2d'),_0x24d01e['id'],_0xaf51('0x2e'),getIntervals(_0x25c728[_0xaf51('0x28')],_0xe501bf)[_0xaf51('0x1a')](_0xaf51('0x2f')));_0x71401[_0xaf51('0x20')](_0x24d01e);}else{logger[_0xaf51('0x30')](_0xaf51('0x31'),path[_0xaf51('0x1a')](__dirname,_0xaf51('0x17'),_0xe501bf['app']+_0xaf51('0x32')));}}_0x25c728[_0xaf51('0x13')][_0x686215]=new RuleEngine(_0x71401);_0x25c728[_0xaf51('0x13')][_0x686215][_0xaf51('0x33')](_0x2c1003,function(_0x5a178b){logger[_0xaf51('0x2c')](_0xaf51('0x34'),JSON[_0xaf51('0x35')](_0x5a178b[_0xaf51('0x36')]));if(_0x25c728[_0xaf51('0x13')][_0x686215]){_0x25c728['rules'][_0x686215][_0xaf51('0x37')](_0xaf51('0x38'));}});return _0x2310a7({'code':0xc8,'message':_0x2c1003});}else{logger[_0xaf51('0x2c')](_0xaf51('0x39'));return _0x2310a7({'code':0xc8,'message':_0x2c1003});}}catch(_0x166d7c){logger['error'](_0x166d7c[_0xaf51('0x3a')]);return _0x58eecf(_0x47aec8['error'](0x1f4,_0x166d7c));}}return _0x58eecf('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5a4fd6){var _0x27d2ab=this;return new Promise(function(_0x58d369,_0x497c08){if(_0x5a4fd6[_0xaf51('0x3b')]&&_0x5a4fd6[_0xaf51('0x3b')]['id']){if(_0x25c728[_0xaf51('0x3c')][_0x5a4fd6[_0xaf51('0x3b')]['id']]){_0x25c728[_0xaf51('0x3c')][_0x5a4fd6[_0xaf51('0x3b')]['id']][_0xaf51('0x3d')]=![];_0x25c728[_0xaf51('0x3c')][_0x5a4fd6[_0xaf51('0x3b')]['id']]['busyQueue']=undefined;}}if(_0x5a4fd6['message']&&_0x5a4fd6[_0xaf51('0x15')]['id']){try{var _0x211cb4=getId(_0x5a4fd6[_0xaf51('0x14')],_0x5a4fd6[_0xaf51('0x15')]?_0x5a4fd6['message']['id']:0x0,_0x5a4fd6[_0xaf51('0x16')]?_0x5a4fd6[_0xaf51('0x16')]['id']:0x0);if(_0x25c728[_0xaf51('0x13')][_0x211cb4]){_0x25c728[_0xaf51('0x13')][_0x211cb4][_0xaf51('0x37')](_0xaf51('0x3e'));if(rpc[_0x5a4fd6[_0xaf51('0x14')]+'QueueReport']){rpc[_0x5a4fd6['channel']+_0xaf51('0x3f')][_0xaf51('0x40')](_0x211cb4,{'UserId':_0x5a4fd6['message'][_0xaf51('0x41')]})['catch'](function(_0x4a2aa2){logger['error'](_0xaf51('0x42'));});}}return _0x58d369({'code':0xc8,'message':_0x5a4fd6});}catch(_0xc81496){logger[_0xaf51('0x30')](_0xc81496[_0xaf51('0x3a')]);return _0x497c08(_0x27d2ab[_0xaf51('0x30')](0x1f4,_0xc81496));}}logger['error']('message\x20is\x20empty');return _0x497c08(_0x27d2ab[_0xaf51('0x30')](0x1f4,_0xaf51('0x43')));});},'RejectMessage':function(_0x4ff0e3){var _0xad3e0e=this;return new Promise(function(_0x24159a,_0x32f7c8){if(_0x4ff0e3['agent']&&_0x4ff0e3[_0xaf51('0x3b')]['id']){try{if(_0x25c728['agents'][_0x4ff0e3[_0xaf51('0x3b')]['id']]){_0x25c728[_0xaf51('0x3c')][_0x4ff0e3[_0xaf51('0x3b')]['id']]['busy']=![];_0x25c728[_0xaf51('0x3c')][_0x4ff0e3[_0xaf51('0x3b')]['id']][_0xaf51('0x44')]=undefined;}return _0x24159a({'code':0xc8,'message':_0x4ff0e3});}catch(_0x506214){logger['error'](_0x506214[_0xaf51('0x3a')]);return _0x32f7c8(_0xad3e0e[_0xaf51('0x30')](0x1f4,_0x506214));}}logger[_0xaf51('0x30')](_0xaf51('0x43'));return _0x32f7c8(_0xad3e0e[_0xaf51('0x30')](0x1f4,_0xaf51('0x43')));});},'AbandonInteraction':function(_0x510ce0){var _0x380b8e=this;return new Promise(function(_0x412dc2,_0x15ef35){if(_0x510ce0['channel']&&_0x510ce0[_0xaf51('0x16')]&&_0x510ce0[_0xaf51('0x16')]['id']){try{var _0x510c7b=getId(_0x510ce0['channel'],_0x510ce0[_0xaf51('0x15')]?_0x510ce0['message']['id']:0x0,_0x510ce0[_0xaf51('0x16')]?_0x510ce0['interaction']['id']:0x0);if(_0x25c728['rules'][_0x510c7b]){_0x25c728['rules'][_0x510c7b][_0xaf51('0x37')](_0xaf51('0x3e'));}return _0x412dc2({'code':0xc8,'message':_0x510ce0});}catch(_0x953d37){logger[_0xaf51('0x30')](_0x953d37[_0xaf51('0x3a')]);return _0x15ef35(_0x380b8e[_0xaf51('0x30')](0x1f4,_0x953d37));}}logger[_0xaf51('0x30')]('message\x20is\x20empty');return _0x15ef35(_0x380b8e['error'](0x1f4,_0xaf51('0x43')));});},'AgentCapacity':function(_0x148c61){var _0x54bcb0=this;return new Promise(function(_0x42ac3a,_0x423644){if(_0x25c728['agents'][_0xaf51('0x45')](_0x148c61['id'])){for(var _0x440fcd in _0x148c61[_0xaf51('0x46')]){if(_0x148c61[_0xaf51('0x46')]['hasOwnProperty'](_0x440fcd)){if(_0x25c728[_0xaf51('0x3c')][_0x148c61['id']]['hasOwnProperty'](_0x440fcd+'CurrentCapacity')){_0x25c728['agents'][_0x148c61['id']][_0x440fcd+'CurrentCapacity']=parseInt(_0x148c61[_0xaf51('0x46')][_0x440fcd],0xa);}}}_0x25c728[_0xaf51('0x3c')][_0x148c61['id']][_0xaf51('0x47')]();return _0x42ac3a({'code':0xc8,'message':_0x25c728[_0xaf51('0x3c')][_0x148c61['id']]});}else{return _0x423644(_0x54bcb0['error'](0x1f4,_0xaf51('0x48')));}});},'Agents':function(_0x45fe31){return new Promise(function(_0x3f788d,_0x5682e7){var _0x384720=_['values'](_0x25c728[_0xaf51('0x3c')]);_0x3f788d({'count':_0x384720['length'],'rows':_0x384720});});},'ChatQueues':function(_0x373985){return new Promise(function(_0x5913e4,_0x540139){var _0x32973d=[];for(var _0x46850f in _0x25c728[_0xaf51('0x49')]){if(_0x25c728[_0xaf51('0x49')]['hasOwnProperty'](_0x46850f)){var _0x132f58=_0x25c728[_0xaf51('0x49')][_0x46850f];var _0x2ee814={'id':_0x132f58['id'],'available':_0x132f58['available'],'loggedIn':_0x132f58[_0xaf51('0x4a')],'name':_0x132f58[_0xaf51('0x4b')],'paused':_0x132f58['paused'],'waiting':_0x132f58[_0xaf51('0x4c')]};_0x32973d[_0xaf51('0x20')](_0x2ee814);}}_0x5913e4({'count':_0x32973d[_0xaf51('0x18')],'rows':_0x32973d});});},'MailQueues':function(_0x39efba){return new Promise(function(_0x3bcb6e,_0x139619){var _0x357443=[];for(var _0x3f2d90 in _0x25c728['mailQueues']){if(_0x25c728['mailQueues'][_0xaf51('0x45')](_0x3f2d90)){var _0x1cd1b8=_0x25c728[_0xaf51('0x4d')][_0x3f2d90];var _0x305376={'id':_0x1cd1b8['id'],'available':_0x1cd1b8['available'],'loggedIn':_0x1cd1b8[_0xaf51('0x4a')],'name':_0x1cd1b8[_0xaf51('0x4b')],'paused':_0x1cd1b8[_0xaf51('0x4e')],'waiting':_0x1cd1b8[_0xaf51('0x4c')]};_0x357443[_0xaf51('0x20')](_0x305376);}}_0x3bcb6e({'count':_0x357443[_0xaf51('0x18')],'rows':_0x357443});});},'OpenchannelQueues':function(_0x4e017a){return new Promise(function(_0x5ee193,_0x111c24){var _0x5890c3=[];for(var _0xc31326 in _0x25c728[_0xaf51('0x4f')]){if(_0x25c728[_0xaf51('0x4f')][_0xaf51('0x45')](_0xc31326)){var _0x4d7338=_0x25c728['openchannelQueues'][_0xc31326];var _0x89846a={'id':_0x4d7338['id'],'available':_0x4d7338['available'],'loggedIn':_0x4d7338[_0xaf51('0x4a')],'name':_0x4d7338[_0xaf51('0x4b')],'paused':_0x4d7338[_0xaf51('0x4e')],'waiting':_0x4d7338[_0xaf51('0x4c')]};_0x5890c3[_0xaf51('0x20')](_0x89846a);}}_0x5ee193({'count':_0x5890c3[_0xaf51('0x18')],'rows':_0x5890c3});});},'SmsQueues':function(_0x175c8d){return new Promise(function(_0x4d46c7,_0x321304){var _0x5d6d95=[];for(var _0x125d5e in _0x25c728[_0xaf51('0x50')]){if(_0x25c728[_0xaf51('0x50')][_0xaf51('0x45')](_0x125d5e)){var _0x55e899=_0x25c728[_0xaf51('0x50')][_0x125d5e];var _0x5af791={'id':_0x55e899['id'],'available':_0x55e899[_0xaf51('0x51')],'loggedIn':_0x55e899[_0xaf51('0x4a')],'name':_0x55e899['name'],'paused':_0x55e899[_0xaf51('0x4e')],'waiting':_0x55e899[_0xaf51('0x4c')]};_0x5d6d95[_0xaf51('0x20')](_0x5af791);}}_0x4d46c7({'count':_0x5d6d95[_0xaf51('0x18')],'rows':_0x5d6d95});});},'FaxQueues':function(_0x4c013c){return new Promise(function(_0x378b58,_0x1aab54){var _0x6d5a15=[];for(var _0x4406e9 in _0x25c728[_0xaf51('0x52')]){if(_0x25c728[_0xaf51('0x52')]['hasOwnProperty'](_0x4406e9)){var _0x16283c=_0x25c728['faxQueues'][_0x4406e9];var _0xf427fa={'id':_0x16283c['id'],'available':_0x16283c[_0xaf51('0x51')],'loggedIn':_0x16283c[_0xaf51('0x4a')],'name':_0x16283c[_0xaf51('0x4b')],'paused':_0x16283c[_0xaf51('0x4e')],'waiting':_0x16283c[_0xaf51('0x4c')]};_0x6d5a15[_0xaf51('0x20')](_0xf427fa);}}_0x378b58({'count':_0x6d5a15[_0xaf51('0x18')],'rows':_0x6d5a15});});},'WhatsappQueues':function(_0x53b17c){return new Promise(function(_0xf675c3,_0x416541){var _0x15a391=[];for(var _0x5c3e9a in _0x25c728[_0xaf51('0x53')]){if(_0x25c728['whatsappQueues']['hasOwnProperty'](_0x5c3e9a)){var _0x37cbf1=_0x25c728['whatsappQueues'][_0x5c3e9a];var _0x4b147a={'id':_0x37cbf1['id'],'available':_0x37cbf1['available'],'loggedIn':_0x37cbf1['loggedIn'],'name':_0x37cbf1[_0xaf51('0x4b')],'paused':_0x37cbf1[_0xaf51('0x4e')],'waiting':_0x37cbf1[_0xaf51('0x4c')]};_0x15a391[_0xaf51('0x20')](_0x4b147a);}}_0xf675c3({'count':_0x15a391[_0xaf51('0x18')],'rows':_0x15a391});});},'ChatQueuesWaitingInteractions':function(_0x2b43ff){return new Promise(function(_0x1978ac,_0x2626f0){var _0x359349=_['values'](_0x25c728['chatQueuesWaitingInteractions']);_0x1978ac({'count':_0x359349[_0xaf51('0x18')],'rows':_0x359349});});},'MailQueuesWaitingInteractions':function(_0x209b78){return new Promise(function(_0x1c0702,_0x2b704d){var _0x56eb1c=_[_0xaf51('0x54')](_0x25c728[_0xaf51('0x55')]);_0x1c0702({'count':_0x56eb1c['length'],'rows':_0x56eb1c});});},'OpenchannelQueuesWaitingInteractions':function(_0x473cd4){return new Promise(function(_0x1bf6e8,_0x3c7664){var _0x36e10b=_[_0xaf51('0x54')](_0x25c728[_0xaf51('0x56')]);_0x1bf6e8({'count':_0x36e10b[_0xaf51('0x18')],'rows':_0x36e10b});});},'SmsQueuesWaitingInteractions':function(_0x404837){return new Promise(function(_0x49620a,_0x14d537){var _0x1c4f52=_['values'](_0x25c728[_0xaf51('0x57')]);_0x49620a({'count':_0x1c4f52['length'],'rows':_0x1c4f52});});},'FaxQueuesWaitingInteractions':function(_0x56b960){return new Promise(function(_0x2bde33,_0x167073){var _0x1c0afd=_[_0xaf51('0x54')](_0x25c728['faxQueuesWaitingInteractions']);_0x2bde33({'count':_0x1c0afd[_0xaf51('0x18')],'rows':_0x1c0afd});});},'WhatsappQueuesWaitingInteractions':function(_0x24584a){return new Promise(function(_0x18af87,_0x415e02){var _0x215550=_[_0xaf51('0x54')](_0x25c728[_0xaf51('0x58')]);_0x18af87({'count':_0x215550[_0xaf51('0x18')],'rows':_0x215550});});}};var _0x5e784f=jayson[_0xaf51('0x59')](_0x13d099)[_0xaf51('0x5a')]();_0x5e784f['on'](_0xaf51('0x30'),function(_0x302f84){logger[_0xaf51('0x30')](JSON[_0xaf51('0x35')](_0x302f84));return _0x1745c5(_0x302f84);});_0x5e784f[_0xaf51('0x12')](0x232c,'127.0.0.1',function(){console['log'](_0xaf51('0x5b'),0x232c);return _0x408636('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 ba2920d..ccb6093 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 _0xc120=['length','push','Command','iftime\x20%s','indexOf','true','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','client','http','request','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x408a5e,_0x715fad){var _0x38ff17=function(_0x9d194){while(--_0x9d194){_0x408a5e['push'](_0x408a5e['shift']());}};_0x38ff17(++_0x715fad);}(_0xc120,0x11d));var _0x0c12=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xc120[_0x139a3c];return _0x2b375b;};'use strict';var util=require(_0x0c12('0x0'));var BPromise=require(_0x0c12('0x1'));var jayson=require(_0x0c12('0x2'));var _=require(_0x0c12('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x0c12('0x4')][_0x0c12('0x5')]({'port':0x232a});function request(_0x3964bb,_0x201c4d){return new BPromise(function(_0x3290db,_0x5e54a2){return client[_0x0c12('0x6')](_0x3964bb,_0x201c4d)[_0x0c12('0x7')](function(_0x2971cf){if(_0x2971cf[_0x0c12('0x8')]){return _0x5e54a2(_0x2971cf[_0x0c12('0x8')][_0x0c12('0x9')]);}else{return _0x3290db(_0x2971cf['result']);}})[_0x0c12('0xa')](function(_0x4bbded){return _0x5e54a2(_0x4bbded);});});}exports[_0x0c12('0xb')]=function(_0x5047ef,_0x5e24d7,_0x178782){return function(_0x190cce){if(_0x178782[_0x0c12('0xc')]&&!_0x178782[_0x0c12('0xc')][_0x5047ef]){logger['info'](_0x0c12('0xd'),_0x5047ef);return _0x190cce[_0x0c12('0xe')]();}var _0x20aaf2=[];for(var _0x440f71=0x0;_0x440f71<_0x5e24d7[_0x0c12('0xf')];_0x440f71+=0x1){_0x20aaf2[_0x0c12('0x10')](request(_0x0c12('0x11'),{'command':util['format'](_0x0c12('0x12'),_0x5e24d7[_0x440f71])})[_0x0c12('0x7')](function(_0x21375d){return _0x21375d&&_0x21375d['message']&&_0x21375d['message'][_0x0c12('0x13')](_0x0c12('0x14'))>=0x0?!![]:![];})[_0x0c12('0xa')](function(_0x49865b){logger[_0x0c12('0x8')]('[%s][INTERVAL]\x20%s',_0x5047ef,_0x5e24d7[_0x440f71]);}));}BPromise[_0x0c12('0x15')](_0x20aaf2)[_0x0c12('0x7')](function(_0x54ed6b){var _0x20519c=_[_0x0c12('0x16')](_0x54ed6b);logger[_0x0c12('0x17')](_0x0c12('0x18'),_0x5047ef,_0x5e24d7[_0x0c12('0x19')](_0x0c12('0x1a')),_0x20519c);_0x190cce[_0x0c12('0x1b')](_0x20519c);})[_0x0c12('0xa')](function(_0xacb9db){console[_0x0c12('0x1c')](_0xacb9db);logger[_0x0c12('0x8')](_0x0c12('0x18'),_0x5047ef,_0x5e24d7[_0x0c12('0x19')](_0x0c12('0x1a')),_0xacb9db[_0x0c12('0x1d')]);_0x190cce[_0x0c12('0xe')]();});};}; \ No newline at end of file +var _0xe795=['all','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','util','bluebird','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','condition','rules','info','length','push','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s'];(function(_0x393b95,_0x7bdb46){var _0x3dcb05=function(_0x170af8){while(--_0x170af8){_0x393b95['push'](_0x393b95['shift']());}};_0x3dcb05(++_0x7bdb46);}(_0xe795,0xf9));var _0x5e79=function(_0x59028,_0x15fe00){_0x59028=_0x59028-0x0;var _0xc6ccb1=_0xe795[_0x59028];return _0xc6ccb1;};'use strict';var util=require(_0x5e79('0x0'));var BPromise=require(_0x5e79('0x1'));var jayson=require('jayson/promise');var _=require(_0x5e79('0x2'));var logger=require(_0x5e79('0x3'))(_0x5e79('0x4'));var client=jayson[_0x5e79('0x5')][_0x5e79('0x6')]({'port':0x232a});function request(_0x33ab00,_0x130d0f){return new BPromise(function(_0x2180a7,_0x5c611e){return client['request'](_0x33ab00,_0x130d0f)[_0x5e79('0x7')](function(_0x16f676){if(_0x16f676['error']){return _0x5c611e(_0x16f676[_0x5e79('0x8')][_0x5e79('0x9')]);}else{return _0x2180a7(_0x16f676[_0x5e79('0xa')]);}})[_0x5e79('0xb')](function(_0x586ad5){return _0x5c611e(_0x586ad5);});});}exports[_0x5e79('0xc')]=function(_0x48eb15,_0x4bed0b,_0x1765bc){return function(_0x2c5c64){if(_0x1765bc[_0x5e79('0xd')]&&!_0x1765bc[_0x5e79('0xd')][_0x48eb15]){logger[_0x5e79('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x48eb15);return _0x2c5c64['stop']();}var _0x4108be=[];for(var _0x110807=0x0;_0x110807<_0x4bed0b[_0x5e79('0xf')];_0x110807+=0x1){_0x4108be[_0x5e79('0x10')](request('Command',{'command':util[_0x5e79('0x11')](_0x5e79('0x12'),_0x4bed0b[_0x110807])})['then'](function(_0xb7a8c2){return _0xb7a8c2&&_0xb7a8c2[_0x5e79('0x9')]&&_0xb7a8c2[_0x5e79('0x9')]['indexOf'](_0x5e79('0x13'))>=0x0?!![]:![];})[_0x5e79('0xb')](function(_0x57dcdf){logger[_0x5e79('0x8')](_0x5e79('0x14'),_0x48eb15,_0x4bed0b[_0x110807]);}));}BPromise[_0x5e79('0x15')](_0x4108be)[_0x5e79('0x7')](function(_0x1e5f2f){var _0x42ec18=_['some'](_0x1e5f2f);logger[_0x5e79('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x48eb15,_0x4bed0b[_0x5e79('0x16')](_0x5e79('0x17')),_0x42ec18);_0x2c5c64[_0x5e79('0x18')](_0x42ec18);})[_0x5e79('0xb')](function(_0x41467e){console[_0x5e79('0x19')](_0x41467e);logger[_0x5e79('0x8')](_0x5e79('0x1a'),_0x48eb15,_0x4bed0b[_0x5e79('0x16')](_0x5e79('0x17')),_0x41467e['stack']);_0x2c5c64['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index e55eb80..3cbb398 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 _0x41bb=['transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','transfertargetuniqueid','clone','hangup','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','complete','[%s][agents][hangup]','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','destuniqueid','lastevent','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','ringtime','talktime','push','error','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','answered_elsewhere','reason','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind'];(function(_0x154dff,_0x559ad8){var _0x29f66c=function(_0xc82c1f){while(--_0xc82c1f){_0x154dff['push'](_0x154dff['shift']());}};_0x29f66c(++_0x559ad8);}(_0x41bb,0xc5));var _0xb41b=function(_0x3ac22d,_0xfbe58e){_0x3ac22d=_0x3ac22d-0x0;var _0x4d8ddb=_0x41bb[_0x3ac22d];return _0x4d8ddb;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x428431,_0x4d5578){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x4'),_0x428431[_0xb41b('0x5')],_0x428431['channel'],_0x428431[_0xb41b('0x6')],_0x428431[_0xb41b('0x7')],_0x428431[_0xb41b('0x8')],_0x428431['calleridnum'],_0x428431['connectedlinenum'],_0x428431['lastevent']));if(_0x428431[_0xb41b('0x6')]){utils[_0xb41b('0x9')](_0x428431['queue'])[_0xb41b('0xa')](function(_0x2c1a53){if(_0x2c1a53){_0x428431[_0xb41b('0xb')]=_0x2c1a53[_0xb41b('0xb')];_0x428431[_0xb41b('0xc')]=_0x428431[_0xb41b('0xd')]?_0x2c1a53[_0xb41b('0xe')]:![];_0x428431['acwtime']=_0x428431[_0xb41b('0xc')]?_0x2c1a53['acwTimeout']:0x0;}utils[_0xb41b('0xf')](_0xb41b('0x10'),_0x428431);});}else{utils[_0xb41b('0xf')](_0xb41b('0x10'),_0x428431);}if(_0x4d5578){delete transfers[_0x428431[_0xb41b('0x5')]];}else{delete agents[_0x428431['destuniqueid']];}}exports[_0xb41b('0x11')]=function(_0x2d947a){try{utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x13'),_0x2d947a['uniqueid']),_0x2d947a);agents[_0x2d947a['destuniqueid']]=_0x2d947a;agents[_0x2d947a['destuniqueid']][_0xb41b('0x14')]=utils[_0xb41b('0x15')]();agents[_0x2d947a[_0xb41b('0x16')]][_0xb41b('0x17')]=_0xb41b('0x18');agents[_0x2d947a['destuniqueid']][_0xb41b('0x19')]=null;agents[_0x2d947a[_0xb41b('0x16')]][_0xb41b('0x1a')]=null;utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x1b'),_0x2d947a[_0xb41b('0x5')],agents[_0x2d947a['destuniqueid']]['membername'],_0x2d947a['destuniqueid']));}catch(_0xf109f8){utils['error'](util[_0xb41b('0x3')](_0xb41b('0x13'),_0x2d947a[_0xb41b('0x5')]),_0xf109f8);}};exports['agentringnoanswer']=function(_0x53bc44){try{if(!_[_0xb41b('0x1c')](agents[_0x53bc44[_0xb41b('0x16')]])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x1d'),_0x53bc44[_0xb41b('0x5')]),_0x53bc44);utils['info'](util['format'](_0xb41b('0x1e'),_0x53bc44[_0xb41b('0x5')],agents[_0x53bc44[_0xb41b('0x16')]]['membername'],_0x53bc44[_0xb41b('0x16')]));agents[_0x53bc44[_0xb41b('0x16')]]['agentringnoanswer']=!![];agents[_0x53bc44[_0xb41b('0x16')]][_0xb41b('0x1f')]=utils['now']();agents[_0x53bc44[_0xb41b('0x16')]]['lastevent']=_0xb41b('0x20');agents[_0x53bc44[_0xb41b('0x16')]]['reason']=_0xb41b('0x20');agents[_0x53bc44[_0xb41b('0x16')]]['holdtime']=_0x53bc44['ringtime']?parseInt(_0x53bc44[_0xb41b('0x21')])/0x3e8:0x0;agents[_0x53bc44[_0xb41b('0x16')]][_0xb41b('0x22')]=0x0;unanswered[_0xb41b('0x23')](_0x53bc44[_0xb41b('0x16')]);}}catch(_0x181cbd){utils[_0xb41b('0x24')](util['format'](_0xb41b('0x1d'),_0x53bc44[_0xb41b('0x5')]),_0x181cbd);}};exports['queuecallerabandon']=function(_0xe64568){try{_['forIn'](agents,function(_0x38277f,_0x31d4cd){if(_0x38277f['uniqueid']==_0xe64568[_0xb41b('0x5')]&&!_['includes'](unanswered,_0x38277f[_0xb41b('0x16')])){utils[_0xb41b('0x12')](util['format'](_0xb41b('0x25'),_0xe64568[_0xb41b('0x5')]),_0xe64568);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x26'),_0xe64568[_0xb41b('0x5')],_0x38277f[_0xb41b('0x7')],_0x38277f[_0xb41b('0x16')]));_0x38277f[_0xb41b('0x27')]=!![];_0x38277f[_0xb41b('0x1f')]=utils['now']();_0x38277f[_0xb41b('0x17')]='abandoned';_0x38277f['reason']=_0xb41b('0x28');_0x38277f[_0xb41b('0x29')]=_0xe64568[_0xb41b('0x29')];_0x38277f[_0xb41b('0x22')]=0x0;writeDB(_0x38277f);}});}catch(_0x1b8681){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x25'),_0xe64568[_0xb41b('0x5')]),_0x1b8681);}};exports[_0xb41b('0x2a')]=function(_0x3a06a0){try{if(agents[_0x3a06a0['destuniqueid']]){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x2b'),_0x3a06a0[_0xb41b('0x5')]),_0x3a06a0);utils[_0xb41b('0x2')](util[_0xb41b('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x3a06a0['uniqueid'],agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x7')],_0x3a06a0['destuniqueid']));agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x2c')]=utils[_0xb41b('0x15')]();agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x19')]=_0x3a06a0['connectedlinenum'];agents[_0x3a06a0[_0xb41b('0x16')]]['connectedlinename']=_0x3a06a0[_0xb41b('0x1a')];agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x29')]=_0x3a06a0[_0xb41b('0x21')];agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x17')]=_0xb41b('0x2d');_[_0xb41b('0x2e')](agents,function(_0x2b0721,_0x578b67){if(_0x2b0721['destuniqueid']!=_0x3a06a0['destuniqueid']&&_0x2b0721[_0xb41b('0x5')]==_0x3a06a0['uniqueid']){_0x2b0721['talktime']=0x0;_0x2b0721[_0xb41b('0x29')]=_0x3a06a0['ringtime'];_0x2b0721[_0xb41b('0x27')]=!![];_0x2b0721[_0xb41b('0x1f')]=utils[_0xb41b('0x15')]();_0x2b0721[_0xb41b('0x17')]=_0xb41b('0x2f');_0x2b0721[_0xb41b('0x30')]=_0xb41b('0x2f');_0x2b0721['answeredelsewheredestinationuniqueid']=_0x3a06a0[_0xb41b('0x16')];_0x2b0721[_0xb41b('0x31')]=_0x3a06a0[_0xb41b('0x7')];writeDB(_0x2b0721);}});}}catch(_0x174d6c){utils['error'](util[_0xb41b('0x3')]('[%s][agents][agentconnect]',_0x3a06a0[_0xb41b('0x5')]),_0x174d6c);}};exports[_0xb41b('0xd')]=function(_0x46dbbf){try{if(!_['isNil'](agents[_0x46dbbf['destuniqueid']])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x32'),_0x46dbbf[_0xb41b('0x5')]),_0x46dbbf);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x33'),_0x46dbbf['uniqueid'],agents[_0x46dbbf['destuniqueid']][_0xb41b('0x7')],_0x46dbbf['destuniqueid']));agents[_0x46dbbf[_0xb41b('0x16')]]['agentcomplete']=!![];agents[_0x46dbbf[_0xb41b('0x16')]]['agentcompleteAt']=utils[_0xb41b('0x15')]();agents[_0x46dbbf['destuniqueid']][_0xb41b('0x22')]=utils[_0xb41b('0x34')](agents[_0x46dbbf[_0xb41b('0x16')]][_0xb41b('0x35')],agents[_0x46dbbf['destuniqueid']][_0xb41b('0x2c')]);agents[_0x46dbbf[_0xb41b('0x16')]]['reason']=_0x46dbbf[_0xb41b('0x30')];agents[_0x46dbbf['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x46dbbf['destuniqueid']]);}}catch(_0x263d8d){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x32'),_0x46dbbf[_0xb41b('0x5')]),_0x263d8d);}};exports[_0xb41b('0x36')]=function(_0x34d076){try{if(!_[_0xb41b('0x1c')](agents[_0x34d076[_0xb41b('0x37')]])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x38'),_0x34d076[_0xb41b('0x5')]),_0x34d076);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x39'),_0x34d076['uniqueid'],agents[_0x34d076[_0xb41b('0x37')]]['membername'],agents[_0x34d076['transfereruniqueid']][_0xb41b('0x5')]));agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3a')]=!![];agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3b')]=_0xb41b('0x3c');agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3d')]=_0x34d076[_0xb41b('0x3e')];agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3f')]=agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x5')];}}catch(_0x3ce89e){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x38'),_0x34d076[_0xb41b('0x5')]),_0x3ce89e);}};exports[_0xb41b('0x40')]=function(_0x247ca0){try{utils[_0xb41b('0x12')](util['format'](_0xb41b('0x41'),_0x247ca0['origtransfereruniqueid']),_0x247ca0);if(_0x247ca0[_0xb41b('0x42')]==_0x247ca0[_0xb41b('0x43')]){if(!_[_0xb41b('0x1c')](agents[_0x247ca0[_0xb41b('0x44')]])){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x45'),_0x247ca0['origtransfereruniqueid'],agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x7')]));agents[_0x247ca0[_0xb41b('0x44')]]['transfer']=!![];agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x3b')]=_0xb41b('0x46');agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x3d')]=_0x247ca0[_0xb41b('0x47')];agents[_0x247ca0[_0xb41b('0x44')]]['transferuniqueid']=_0x247ca0['origtransfereruniqueid'];}if(_0x247ca0[_0xb41b('0x48')]&&agents[_0x247ca0[_0xb41b('0x48')]]){agents[_0x247ca0['transfereeuniqueid']][_0xb41b('0x49')]=0x1;transfers[_0x247ca0[_0xb41b('0x48')]]=_['clone'](agents[_0x247ca0[_0xb41b('0x48')]]);transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x4a')]=agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x4a')];transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x4b')]=agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x4b')];transfers[_0x247ca0[_0xb41b('0x48')]]['agentcalledAt']=utils[_0xb41b('0x15')]();transfers[_0x247ca0[_0xb41b('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x29')]=0x0;transfers[_0x247ca0[_0xb41b('0x48')]]['agententerreason']=0x2;}}else if(_0x247ca0[_0xb41b('0x44')]==_0x247ca0[_0xb41b('0x4c')]){if(!_[_0xb41b('0x1c')](agents[_0x247ca0[_0xb41b('0x42')]])){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x45'),_0x247ca0[_0xb41b('0x42')],agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x7')]));agents[_0x247ca0['origtransfereruniqueid']][_0xb41b('0x3a')]=!![];agents[_0x247ca0[_0xb41b('0x42')]]['transfertype']=_0xb41b('0x46');agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x3d')]=_0x247ca0['secondtransfererexten'];agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x3f')]=_0x247ca0[_0xb41b('0x44')];}if(_0x247ca0[_0xb41b('0x4d')]&&agents[_0x247ca0[_0xb41b('0x4d')]]){agents[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x49')]=0x1;transfers[_0x247ca0[_0xb41b('0x4d')]]=_[_0xb41b('0x4e')](agents[_0x247ca0[_0xb41b('0x4d')]]);transfers[_0x247ca0['transfertargetuniqueid']]['calleridnum']=agents[_0x247ca0['origtransfereruniqueid']]['calleridnum'];transfers[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x4b')]=agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x4b')];transfers[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x14')]=utils['now']();transfers[_0x247ca0[_0xb41b('0x4d')]]['agentconnectAt']=utils[_0xb41b('0x15')]();transfers[_0x247ca0['transfertargetuniqueid']][_0xb41b('0x29')]=0x0;transfers[_0x247ca0['transfertargetuniqueid']][_0xb41b('0x49')]=0x2;}}}catch(_0xc2afd1){utils['error'](util[_0xb41b('0x3')](_0xb41b('0x41'),_0x247ca0[_0xb41b('0x42')]),_0xc2afd1);}};exports[_0xb41b('0x4f')]=function(_0x39f6ad){try{utils[_0xb41b('0x12')](util[_0xb41b('0x3')]('[%s][agents][hangup]',_0x39f6ad[_0xb41b('0x5')]),_0x39f6ad);if(agents[_0x39f6ad['uniqueid']]&&agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]===_0xb41b('0x20')){if(_0x39f6ad['cause']==='21'){agents[_0x39f6ad['uniqueid']]['reason']='rejected';agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]=_0xb41b('0x50');}utils['info'](util['format'](_0xb41b('0x51'),_0x39f6ad[_0xb41b('0x5')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x7')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')],agents[_0x39f6ad[_0xb41b('0x5')]]['lastevent']));writeDB(agents[_0x39f6ad['uniqueid']]);var _0x303ca3=unanswered[_0xb41b('0x52')](_0x39f6ad['uniqueid']);if(_0x303ca3>-0x1){unanswered[_0xb41b('0x53')](_0x303ca3,0x1);}}if(transfers[_0x39f6ad['uniqueid']]){transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0xd')]=!![];transfers[_0x39f6ad['uniqueid']][_0xb41b('0x35')]=utils[_0xb41b('0x15')]();transfers[_0x39f6ad['uniqueid']]['talktime']=utils[_0xb41b('0x34')](transfers[_0x39f6ad[_0xb41b('0x5')]]['agentcompleteAt'],transfers[_0x39f6ad[_0xb41b('0x5')]]['agentconnectAt']);transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]='agent';transfers[_0x39f6ad['uniqueid']][_0xb41b('0x17')]=_0xb41b('0x54');utils['info'](util[_0xb41b('0x3')](_0xb41b('0x51'),_0x39f6ad[_0xb41b('0x5')],transfers[_0x39f6ad['uniqueid']][_0xb41b('0x7')],transfers[_0x39f6ad['uniqueid']]['reason'],transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]));writeDB(transfers[_0x39f6ad[_0xb41b('0x5')]],!![]);}if(agents[_0x39f6ad[_0xb41b('0x5')]]&&agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x2c')]){agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0xd')]=!![];agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x35')]=utils[_0xb41b('0x15')]();agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x22')]=utils['diffTime'](agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x35')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x2c')]);agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]=agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x3a')]?'transfer':'agent';agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]=_0xb41b('0x54');utils['info'](util[_0xb41b('0x3')](_0xb41b('0x51'),_0x39f6ad['uniqueid'],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x7')],agents[_0x39f6ad['uniqueid']][_0xb41b('0x30')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]));writeDB(agents[_0x39f6ad[_0xb41b('0x5')]]);}}catch(_0x31c5c1){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x55'),_0x39f6ad[_0xb41b('0x5')]),_0x31c5c1);}}; \ No newline at end of file +var _0x878f=['abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','reason','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','includes','[%s][agents][queuecallerabandon]'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0x878f,0x173));var _0xf878=function(_0x46279d,_0x126a6e){_0x46279d=_0x46279d-0x0;var _0x4ed166=_0x878f[_0x46279d];return _0x4ed166;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var utils=require(_0xf878('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2e1d23,_0x12df2b){utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x4'),_0x2e1d23[_0xf878('0x5')],_0x2e1d23[_0xf878('0x6')],_0x2e1d23[_0xf878('0x7')],_0x2e1d23[_0xf878('0x8')],_0x2e1d23['interface'],_0x2e1d23['calleridnum'],_0x2e1d23[_0xf878('0x9')],_0x2e1d23[_0xf878('0xa')]));if(_0x2e1d23['queue']){utils['getVoiceQueueByName'](_0x2e1d23['queue'])[_0xf878('0xb')](function(_0x5f2693){if(_0x5f2693){_0x2e1d23['type']=_0x5f2693[_0xf878('0xc')];_0x2e1d23[_0xf878('0xd')]=_0x2e1d23[_0xf878('0xe')]?_0x5f2693['acw']:![];_0x2e1d23[_0xf878('0xf')]=_0x2e1d23[_0xf878('0xd')]?_0x5f2693['acwTimeout']:0x0;}utils[_0xf878('0x10')]('CreateVoiceAgentReport',_0x2e1d23);});}else{utils[_0xf878('0x10')](_0xf878('0x11'),_0x2e1d23);}if(_0x12df2b){delete transfers[_0x2e1d23[_0xf878('0x5')]];}else{delete agents[_0x2e1d23['destuniqueid']];}}exports[_0xf878('0x12')]=function(_0x38eddf){try{utils[_0xf878('0x13')](util['format'](_0xf878('0x14'),_0x38eddf[_0xf878('0x5')]),_0x38eddf);agents[_0x38eddf[_0xf878('0x15')]]=_0x38eddf;agents[_0x38eddf['destuniqueid']]['agentcalledAt']=utils[_0xf878('0x16')]();agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0xa')]=_0xf878('0x17');agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0x9')]=null;agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0x18')]=null;utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x19'),_0x38eddf['uniqueid'],agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0x8')],_0x38eddf[_0xf878('0x15')]));}catch(_0x622ea8){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x14'),_0x38eddf['uniqueid']),_0x622ea8);}};exports[_0xf878('0x1b')]=function(_0x140866){try{if(!_[_0xf878('0x1c')](agents[_0x140866['destuniqueid']])){utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x1d'),_0x140866[_0xf878('0x5')]),_0x140866);utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x1e'),_0x140866[_0xf878('0x5')],agents[_0x140866[_0xf878('0x15')]][_0xf878('0x8')],_0x140866[_0xf878('0x15')]));agents[_0x140866['destuniqueid']][_0xf878('0x1b')]=!![];agents[_0x140866['destuniqueid']][_0xf878('0x1f')]=utils[_0xf878('0x16')]();agents[_0x140866[_0xf878('0x15')]][_0xf878('0xa')]=_0xf878('0x20');agents[_0x140866['destuniqueid']]['reason']='timeout';agents[_0x140866[_0xf878('0x15')]][_0xf878('0x21')]=_0x140866[_0xf878('0x22')]?parseInt(_0x140866['ringtime'])/0x3e8:0x0;agents[_0x140866[_0xf878('0x15')]][_0xf878('0x23')]=0x0;unanswered[_0xf878('0x24')](_0x140866[_0xf878('0x15')]);}}catch(_0x41dd55){utils['error'](util['format'](_0xf878('0x1d'),_0x140866[_0xf878('0x5')]),_0x41dd55);}};exports['queuecallerabandon']=function(_0x31e2e1){try{_['forIn'](agents,function(_0x969ee3,_0x51afaf){if(_0x969ee3[_0xf878('0x5')]==_0x31e2e1['uniqueid']&&!_[_0xf878('0x25')](unanswered,_0x969ee3['destuniqueid'])){utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x26'),_0x31e2e1[_0xf878('0x5')]),_0x31e2e1);utils[_0xf878('0x2')](util[_0xf878('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x31e2e1[_0xf878('0x5')],_0x969ee3[_0xf878('0x8')],_0x969ee3[_0xf878('0x15')]));_0x969ee3[_0xf878('0x1b')]=!![];_0x969ee3[_0xf878('0x1f')]=utils['now']();_0x969ee3[_0xf878('0xa')]=_0xf878('0x27');_0x969ee3['reason']=_0xf878('0x27');_0x969ee3[_0xf878('0x21')]=_0x31e2e1[_0xf878('0x21')];_0x969ee3[_0xf878('0x23')]=0x0;writeDB(_0x969ee3);}});}catch(_0x1acfb6){utils['error'](util[_0xf878('0x3')](_0xf878('0x26'),_0x31e2e1[_0xf878('0x5')]),_0x1acfb6);}};exports[_0xf878('0x28')]=function(_0x579c91){try{if(agents[_0x579c91[_0xf878('0x15')]]){utils['debug'](util['format'](_0xf878('0x29'),_0x579c91[_0xf878('0x5')]),_0x579c91);utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x2a'),_0x579c91['uniqueid'],agents[_0x579c91[_0xf878('0x15')]]['membername'],_0x579c91[_0xf878('0x15')]));agents[_0x579c91[_0xf878('0x15')]]['agentconnectAt']=utils[_0xf878('0x16')]();agents[_0x579c91[_0xf878('0x15')]]['connectedlinenum']=_0x579c91[_0xf878('0x9')];agents[_0x579c91[_0xf878('0x15')]]['connectedlinename']=_0x579c91[_0xf878('0x18')];agents[_0x579c91[_0xf878('0x15')]][_0xf878('0x21')]=_0x579c91[_0xf878('0x22')];agents[_0x579c91[_0xf878('0x15')]][_0xf878('0xa')]=_0xf878('0x2b');_['forIn'](agents,function(_0x1179fb,_0x14340d){if(_0x1179fb['destuniqueid']!=_0x579c91[_0xf878('0x15')]&&_0x1179fb['uniqueid']==_0x579c91['uniqueid']){_0x1179fb[_0xf878('0x23')]=0x0;_0x1179fb[_0xf878('0x21')]=_0x579c91[_0xf878('0x22')];_0x1179fb[_0xf878('0x1b')]=!![];_0x1179fb[_0xf878('0x1f')]=utils['now']();_0x1179fb[_0xf878('0xa')]='answered_elsewhere';_0x1179fb[_0xf878('0x2c')]=_0xf878('0x2d');_0x1179fb['answeredelsewheredestinationuniqueid']=_0x579c91['destuniqueid'];_0x1179fb[_0xf878('0x2e')]=_0x579c91[_0xf878('0x8')];writeDB(_0x1179fb);}});}}catch(_0x13fcd3){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x29'),_0x579c91[_0xf878('0x5')]),_0x13fcd3);}};exports[_0xf878('0xe')]=function(_0x3b1c67){try{if(!_['isNil'](agents[_0x3b1c67[_0xf878('0x15')]])){utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x2f'),_0x3b1c67[_0xf878('0x5')]),_0x3b1c67);utils[_0xf878('0x2')](util['format'](_0xf878('0x30'),_0x3b1c67[_0xf878('0x5')],agents[_0x3b1c67[_0xf878('0x15')]][_0xf878('0x8')],_0x3b1c67[_0xf878('0x15')]));agents[_0x3b1c67['destuniqueid']][_0xf878('0xe')]=!![];agents[_0x3b1c67[_0xf878('0x15')]][_0xf878('0x31')]=utils[_0xf878('0x16')]();agents[_0x3b1c67['destuniqueid']][_0xf878('0x23')]=utils[_0xf878('0x32')](agents[_0x3b1c67[_0xf878('0x15')]]['agentcompleteAt'],agents[_0x3b1c67['destuniqueid']][_0xf878('0x33')]);agents[_0x3b1c67['destuniqueid']]['reason']=_0x3b1c67['reason'];agents[_0x3b1c67[_0xf878('0x15')]]['lastevent']=_0xf878('0x34');writeDB(agents[_0x3b1c67[_0xf878('0x15')]]);}}catch(_0x1dcb19){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x2f'),_0x3b1c67[_0xf878('0x5')]),_0x1dcb19);}};exports['blindtransfer']=function(_0xb0bf4c){try{if(!_[_0xf878('0x1c')](agents[_0xb0bf4c[_0xf878('0x35')]])){utils[_0xf878('0x13')](util[_0xf878('0x3')]('[%s][agents][blindtransfer]',_0xb0bf4c['uniqueid']),_0xb0bf4c);utils[_0xf878('0x2')](util[_0xf878('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0xb0bf4c[_0xf878('0x5')],agents[_0xb0bf4c['transfereruniqueid']][_0xf878('0x8')],agents[_0xb0bf4c[_0xf878('0x35')]][_0xf878('0x5')]));agents[_0xb0bf4c[_0xf878('0x35')]]['transfer']=!![];agents[_0xb0bf4c[_0xf878('0x35')]][_0xf878('0x36')]=_0xf878('0x37');agents[_0xb0bf4c['transfereruniqueid']][_0xf878('0x38')]=_0xb0bf4c[_0xf878('0x39')];agents[_0xb0bf4c[_0xf878('0x35')]][_0xf878('0x3a')]=agents[_0xb0bf4c['transfereruniqueid']][_0xf878('0x5')];}}catch(_0x181f09){utils[_0xf878('0x1a')](util['format'](_0xf878('0x3b'),_0xb0bf4c[_0xf878('0x5')]),_0x181f09);}};exports[_0xf878('0x3c')]=function(_0x150f60){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x150f60[_0xf878('0x3d')]),_0x150f60);if(_0x150f60['origtransfereruniqueid']==_0x150f60['origtransfererlinkedid']){if(!_['isNil'](agents[_0x150f60[_0xf878('0x3e')]])){utils[_0xf878('0x2')](util['format'](_0xf878('0x3f'),_0x150f60[_0xf878('0x3d')],agents[_0x150f60[_0xf878('0x3e')]]['membername']));agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x40')]=!![];agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x36')]=_0xf878('0x41');agents[_0x150f60[_0xf878('0x3e')]][_0xf878('0x38')]=_0x150f60[_0xf878('0x42')];agents[_0x150f60[_0xf878('0x3e')]]['transferuniqueid']=_0x150f60[_0xf878('0x3d')];}if(_0x150f60[_0xf878('0x43')]&&agents[_0x150f60['transfereeuniqueid']]){agents[_0x150f60[_0xf878('0x43')]][_0xf878('0x44')]=0x1;transfers[_0x150f60[_0xf878('0x43')]]=_[_0xf878('0x45')](agents[_0x150f60[_0xf878('0x43')]]);transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x46')]=agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x46')];transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x47')]=agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x47')];transfers[_0x150f60['transfereeuniqueid']][_0xf878('0x48')]=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x33')]=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x21')]=0x0;transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x44')]=0x2;}}else if(_0x150f60[_0xf878('0x3e')]==_0x150f60['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x150f60['origtransfereruniqueid']])){utils[_0xf878('0x2')](util['format'](_0xf878('0x3f'),_0x150f60[_0xf878('0x3d')],agents[_0x150f60['origtransfereruniqueid']]['membername']));agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x40')]=!![];agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x36')]=_0xf878('0x41');agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x38')]=_0x150f60[_0xf878('0x49')];agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x3a')]=_0x150f60[_0xf878('0x3e')];}if(_0x150f60[_0xf878('0x4a')]&&agents[_0x150f60[_0xf878('0x4a')]]){agents[_0x150f60[_0xf878('0x4a')]][_0xf878('0x44')]=0x1;transfers[_0x150f60[_0xf878('0x4a')]]=_[_0xf878('0x45')](agents[_0x150f60[_0xf878('0x4a')]]);transfers[_0x150f60['transfertargetuniqueid']][_0xf878('0x46')]=agents[_0x150f60['origtransfereruniqueid']][_0xf878('0x46')];transfers[_0x150f60[_0xf878('0x4a')]][_0xf878('0x47')]=agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x47')];transfers[_0x150f60[_0xf878('0x4a')]][_0xf878('0x48')]=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x4a')]]['agentconnectAt']=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x4a')]][_0xf878('0x21')]=0x0;transfers[_0x150f60[_0xf878('0x4a')]]['agententerreason']=0x2;}}}catch(_0xa73ee){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x4b'),_0x150f60[_0xf878('0x3d')]),_0xa73ee);}};exports['hangup']=function(_0x5860f6){try{utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x4c'),_0x5860f6[_0xf878('0x5')]),_0x5860f6);if(agents[_0x5860f6[_0xf878('0x5')]]&&agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')]===_0xf878('0x20')){if(_0x5860f6[_0xf878('0x4d')]==='21'){agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')]=_0xf878('0x4e');agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]=_0xf878('0x4e');}utils[_0xf878('0x2')](util[_0xf878('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5860f6[_0xf878('0x5')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x8')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]));writeDB(agents[_0x5860f6[_0xf878('0x5')]]);var _0x443e69=unanswered['indexOf'](_0x5860f6[_0xf878('0x5')]);if(_0x443e69>-0x1){unanswered[_0xf878('0x4f')](_0x443e69,0x1);}}if(transfers[_0x5860f6[_0xf878('0x5')]]){transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0xe')]=!![];transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x31')]=utils['now']();transfers[_0x5860f6['uniqueid']][_0xf878('0x23')]=utils['diffTime'](transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x31')],transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x33')]);transfers[_0x5860f6['uniqueid']][_0xf878('0x2c')]=_0xf878('0x50');transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]='complete';utils[_0xf878('0x2')](util['format'](_0xf878('0x51'),_0x5860f6[_0xf878('0x5')],transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x8')],transfers[_0x5860f6[_0xf878('0x5')]]['reason'],transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]));writeDB(transfers[_0x5860f6[_0xf878('0x5')]],!![]);}if(agents[_0x5860f6[_0xf878('0x5')]]&&agents[_0x5860f6['uniqueid']][_0xf878('0x33')]){agents[_0x5860f6['uniqueid']][_0xf878('0xe')]=!![];agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x31')]=utils[_0xf878('0x16')]();agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x23')]=utils[_0xf878('0x32')](agents[_0x5860f6[_0xf878('0x5')]]['agentcompleteAt'],agents[_0x5860f6['uniqueid']]['agentconnectAt']);agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')]=agents[_0x5860f6['uniqueid']]['transfer']?_0xf878('0x40'):'agent';agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]=_0xf878('0x34');utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x51'),_0x5860f6[_0xf878('0x5')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x8')],agents[_0x5860f6['uniqueid']][_0xf878('0x2c')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]));writeDB(agents[_0x5860f6['uniqueid']]);}}catch(_0x15f893){utils[_0xf878('0x1a')](util['format'](_0xf878('0x4c'),_0x5860f6[_0xf878('0x5')]),_0x15f893);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 0cf9108..8ffb0e4 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 _0x7990=['xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','substring','lastIndexOf','includes','set','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','debug','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','value','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','ContactId'];(function(_0x4ee89a,_0x56d642){var _0x42aca9=function(_0xa1f425){while(--_0xa1f425){_0x4ee89a['push'](_0x4ee89a['shift']());}};_0x42aca9(++_0x56d642);}(_0x7990,0x1ab));var _0x0799=function(_0x48a8c3,_0x3e694b){_0x48a8c3=_0x48a8c3-0x0;var _0x4a011c=_0x7990[_0x48a8c3];return _0x4a011c;};'use strict';var _=require(_0x0799('0x0'));var util=require(_0x0799('0x1'));var utils=require(_0x0799('0x2'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0x0799('0x3'),_0x0799('0x3'),_0x0799('0x4'),_0x0799('0x4'),_0x0799('0x4'),_0x0799('0x5'),'BUSY',_0x0799('0x3'),'FAILED',_0x0799('0x3')];var channels={};function writeDB(_0x18189a){var _0x572728;if(transfers[_0x0799('0x6')][_0x18189a['uniqueid']]){_0x572728=_0x18189a[_0x0799('0x7')];_0x18189a['uniqueid']=transfers[_0x0799('0x6')][_0x18189a['uniqueid']][_0x0799('0x8')];}utils[_0x0799('0x9')](util[_0x0799('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x18189a['uniqueid'],_0x18189a[_0x0799('0xb')],_0x18189a[_0x0799('0xc')],_0x18189a[_0x0799('0xd')],_0x18189a[_0x0799('0xe')],_0x18189a[_0x0799('0xf')],_0x18189a[_0x0799('0x10')],_0x18189a[_0x0799('0x11')]));if(_0x18189a[_0x0799('0x12')]){utils[_0x0799('0x13')](_0x18189a[_0x0799('0x12')])[_0x0799('0x14')](function(_0x41aa6c){if(_0x41aa6c){_0x18189a['UserId']=_0x41aa6c['id'];}utils[_0x0799('0x15')](_0x0799('0x16'),_0x18189a);});}else{utils[_0x0799('0x15')](_0x0799('0x16'),_0x18189a);}if(channels[_0x18189a['uniqueid']]){delete channels[_0x18189a[_0x0799('0x7')]];}else if(_0x572728&&channels[_0x572728]){delete transfers[_0x0799('0x6')][_0x572728];delete channels[_0x572728];}}exports['newchannel']=function(_0x4a02f8){try{utils['debug'](util[_0x0799('0xa')](_0x0799('0x17'),_0x4a02f8[_0x0799('0x7')]),_0x4a02f8);if(_0x4a02f8[_0x0799('0x7')]==_0x4a02f8[_0x0799('0x18')]&&_0x4a02f8['channel']!=_0x0799('0x19')){utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x1a'),_0x4a02f8[_0x0799('0x7')],_0x4a02f8['context'],_0x4a02f8[_0x0799('0x1b')]));channels[_0x4a02f8['uniqueid']]={'uniqueid':_0x4a02f8['uniqueid'],'accountcode':_0x4a02f8[_0x0799('0x12')],'source':_0x4a02f8[_0x0799('0xf')],'destination':_0x4a02f8[_0x0799('0x1b')],'destinationcontext':_0x4a02f8[_0x0799('0x1c')],'channel':_0x4a02f8['channel'],'starttime':utils[_0x0799('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0799('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x4e42fb){utils[_0x0799('0x1e')](util[_0x0799('0xa')](_0x0799('0x17'),_0x4a02f8['uniqueid']),_0x4e42fb);}};exports[_0x0799('0x1f')]=function(_0x1e0b52){try{utils['debug'](util[_0x0799('0xa')](_0x0799('0x20'),_0x1e0b52[_0x0799('0x7')]),_0x1e0b52);if(!_[_0x0799('0x21')](channels[_0x1e0b52['uniqueid']])&&_0x1e0b52[_0x0799('0x22')]==0x6){utils['info'](util[_0x0799('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1e0b52[_0x0799('0x7')],_0x1e0b52[_0x0799('0x1c')],_0x1e0b52['channel']));if(_[_0x0799('0x21')](channels[_0x1e0b52[_0x0799('0x7')]]['systemanswertime'])){channels[_0x1e0b52[_0x0799('0x7')]][_0x0799('0x23')]=utils[_0x0799('0x1d')]();}}else if(!_['isNil'](channels[_0x1e0b52[_0x0799('0x18')]])&&_0x1e0b52[_0x0799('0x22')]==0x6&&_0x1e0b52[_0x0799('0x1c')]!='transfer'){utils['info'](util[_0x0799('0xa')](_0x0799('0x24'),_0x1e0b52['uniqueid'],_0x1e0b52['linkedid'],_0x1e0b52[_0x0799('0x1c')],_0x1e0b52[_0x0799('0xb')]));channels[_0x1e0b52[_0x0799('0x18')]][_0x0799('0x12')]=_0x1e0b52[_0x0799('0x12')];channels[_0x1e0b52[_0x0799('0x18')]][_0x0799('0x25')]=_0x1e0b52[_0x0799('0xb')];if(_[_0x0799('0x21')](channels[_0x1e0b52[_0x0799('0x18')]][_0x0799('0x26')])){channels[_0x1e0b52[_0x0799('0x18')]][_0x0799('0x26')]=utils[_0x0799('0x1d')]();}channels[_0x1e0b52[_0x0799('0x18')]][_0x0799('0x27')]=dispositions[_['toNumber'](_0x1e0b52[_0x0799('0x22')])]||_0x0799('0x5');}}catch(_0x1e4a67){utils[_0x0799('0x1e')](util[_0x0799('0xa')](_0x0799('0x20'),_0x1e0b52[_0x0799('0x7')]),_0x1e4a67);}};exports[_0x0799('0x28')]=function(_0x5c44a1){try{if(!_['isNil'](channels[_0x5c44a1[_0x0799('0x7')]])){utils['debug'](util[_0x0799('0xa')]('[%s][calls][hangup]',_0x5c44a1[_0x0799('0x7')]),_0x5c44a1);if(_[_0x0799('0x21')](channels[_0x5c44a1[_0x0799('0x7')]]['callerid'])){channels[_0x5c44a1[_0x0799('0x7')]][_0x0799('0x29')]=_0x5c44a1['calleridname']+'\x20<'+_0x5c44a1[_0x0799('0xf')]+'>';}utils[_0x0799('0x9')](util['format'](_0x0799('0x2a'),_0x5c44a1[_0x0799('0x7')],channels[_0x5c44a1[_0x0799('0x7')]]['callerid'],_0x5c44a1[_0x0799('0x2b')]));channels[_0x5c44a1['uniqueid']][_0x0799('0x2c')]=utils[_0x0799('0x1d')]();channels[_0x5c44a1['uniqueid']][_0x0799('0x2d')]=utils['diffTime'](channels[_0x5c44a1[_0x0799('0x7')]][_0x0799('0x2c')],channels[_0x5c44a1[_0x0799('0x7')]][_0x0799('0x2e')]);channels[_0x5c44a1['uniqueid']]['billableseconds']=channels[_0x5c44a1[_0x0799('0x7')]]['answertime']?utils[_0x0799('0x2f')](channels[_0x5c44a1[_0x0799('0x7')]][_0x0799('0x2c')],channels[_0x5c44a1['uniqueid']][_0x0799('0x26')]):0x0;writeDB(channels[_0x5c44a1[_0x0799('0x7')]]);}}catch(_0x20c05e){utils[_0x0799('0x1e')](util['format'](_0x0799('0x30'),_0x5c44a1[_0x0799('0x7')]),_0x20c05e);}};exports[_0x0799('0x31')]=function(_0x17966d){try{if(!_[_0x0799('0x21')](channels[_0x17966d[_0x0799('0x32')]])){utils[_0x0799('0x33')](util['format']('[%s][calls][attendedtransfer]',_0x17966d[_0x0799('0x34')]),_0x17966d);if(channels[_0x17966d[_0x0799('0x32')]][_0x0799('0xb')]==_0x17966d[_0x0799('0x35')]){utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x36'),_0x17966d[_0x0799('0x34')],_0x17966d[_0x0799('0x32')],_0x17966d['secondtransfererchannel']));channels[_0x17966d[_0x0799('0x32')]][_0x0799('0x25')]=_0x17966d[_0x0799('0x37')];channels[_0x17966d[_0x0799('0x32')]]['userfield']='_attended';}else if(channels[_0x17966d[_0x0799('0x32')]]['channel']=_0x17966d[_0x0799('0x38')]){utils['info'](util[_0x0799('0xa')](_0x0799('0x36'),_0x17966d[_0x0799('0x34')],_0x17966d[_0x0799('0x32')],_0x17966d[_0x0799('0x39')]));channels[_0x17966d['localtwolinkedid']][_0x0799('0x25')]=_0x17966d[_0x0799('0x39')];channels[_0x17966d['localtwolinkedid']][_0x0799('0x3a')]='_attended';}}}catch(_0x1a456b){utils[_0x0799('0x1e')](util['format'](_0x0799('0x3b'),_0x17966d[_0x0799('0x34')]),_0x1a456b);}};exports[_0x0799('0x3c')]=function(_0x43fb5d){try{if(!_['isNil'](channels[_0x43fb5d['uniqueid']])){utils[_0x0799('0x33')](util[_0x0799('0xa')](_0x0799('0x3d'),_0x43fb5d[_0x0799('0x7')]),_0x43fb5d);channels[_0x43fb5d[_0x0799('0x7')]][_0x0799('0x3e')]=utils[_0x0799('0x1d')]();utils[_0x0799('0x9')](util[_0x0799('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x43fb5d['uniqueid'],channels[_0x43fb5d[_0x0799('0x7')]]['musiconholdstartAt']));}}catch(_0xf5567){utils[_0x0799('0x1e')](util[_0x0799('0xa')]('[%s][calls][musiconholdstart]',_0x43fb5d[_0x0799('0x7')]),_0xf5567);}};exports['musiconholdstop']=function(_0x36c303){try{if(!_[_0x0799('0x21')](channels[_0x36c303[_0x0799('0x7')]])){utils[_0x0799('0x33')](util[_0x0799('0xa')](_0x0799('0x3f'),_0x36c303['uniqueid']),_0x36c303);if(!_[_0x0799('0x21')](channels[_0x36c303[_0x0799('0x7')]]['musiconholdstartAt'])){channels[_0x36c303[_0x0799('0x7')]][_0x0799('0x40')]+=utils[_0x0799('0x2f')](utils[_0x0799('0x1d')](),channels[_0x36c303[_0x0799('0x7')]][_0x0799('0x3e')]);utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x41'),_0x36c303[_0x0799('0x7')],channels[_0x36c303[_0x0799('0x7')]][_0x0799('0x40')]));delete channels[_0x36c303[_0x0799('0x7')]][_0x0799('0x3e')];}}}catch(_0x5b7630){utils[_0x0799('0x1e')](util['format'](_0x0799('0x3f'),_0x36c303[_0x0799('0x7')]),_0x5b7630);}};exports['varset']=function(_0x421163){try{if(!_[_0x0799('0x21')](channels[_0x421163[_0x0799('0x7')]])){utils[_0x0799('0x33')](util[_0x0799('0xa')](_0x0799('0x42'),_0x421163[_0x0799('0x7')]),_0x421163);if(!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')][_0x0799('0x44')])){utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x45'),_0x421163[_0x0799('0x7')],_0x421163['value']));channels[_0x421163['uniqueid']][_0x0799('0x46')]=_0x421163['value'];}if(!_['isNil'](_0x421163[_0x0799('0x43')][_0x0799('0x47')])){utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x48'),_0x421163[_0x0799('0x7')],_0x421163['value']));channels[_0x421163[_0x0799('0x7')]][_0x0799('0x49')]=_0x421163[_0x0799('0x4a')];channels[_0x421163['uniqueid']][_0x0799('0x29')]='\x22'+_0x421163[_0x0799('0x4a')]+'\x22\x20<'+_0x421163[_0x0799('0x4a')]+'>';}if(!_['isNil'](_0x421163['variable'][_0x0799('0x4b')])||!_['isNil'](_0x421163['variable']['xmd-callerid'])){utils['info'](util[_0x0799('0xa')](_0x0799('0x4c'),_0x421163[_0x0799('0x7')],!_[_0x0799('0x21')](_0x421163['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':_0x0799('0x4d'),_0x421163[_0x0799('0x4a')]));channels[_0x421163[_0x0799('0x7')]][_0x0799('0x29')]=_0x421163['value'];}if(!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')][_0x0799('0x4e')])||!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')][_0x0799('0x4f')])){utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x4c'),_0x421163['uniqueid'],!_[_0x0799('0x21')](_0x421163['variable'][_0x0799('0x4e')])?'xmd-queue':'xmcs-queue',_0x421163[_0x0799('0x4a')]));channels[_0x421163[_0x0799('0x7')]][_0x0799('0x50')]='Queue';channels[_0x421163['uniqueid']][_0x0799('0x51')]=_0x421163[_0x0799('0x4a')];channels[_0x421163[_0x0799('0x7')]][_0x0799('0xc')]=!![];}if(!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')]['xmd-contactid'])){utils[_0x0799('0x9')](util[_0x0799('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x421163[_0x0799('0x7')],_0x421163[_0x0799('0x4a')]));channels[_0x421163[_0x0799('0x7')]][_0x0799('0x52')]=_0x421163['value'];}if(!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')][_0x0799('0x53')])){utils[_0x0799('0x9')](util[_0x0799('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x421163['uniqueid'],_0x421163[_0x0799('0x4a')]));channels[_0x421163[_0x0799('0x7')]][_0x0799('0x54')]=_0x421163['value'];}if(!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')][_0x0799('0x55')])){utils['info'](util['format'](_0x0799('0x56'),_0x421163[_0x0799('0x7')],_0x421163[_0x0799('0x4a')]));channels[_0x421163[_0x0799('0x7')]][_0x0799('0x57')]=_0x421163[_0x0799('0x4a')];}if(!_[_0x0799('0x21')](_0x421163[_0x0799('0x43')][_0x0799('0x58')])){utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x59'),_0x421163[_0x0799('0x7')],_0x421163[_0x0799('0x4a')]));channels[_0x421163[_0x0799('0x7')]]['sipcallid']=_0x421163[_0x0799('0x4a')];}}}catch(_0x3bd929){utils['error'](util[_0x0799('0xa')]('[%s][calls][varset]',_0x421163['uniqueid']),_0x3bd929);}};exports['newexten']=function(_0x2bbfd0){try{if(!_[_0x0799('0x21')](channels[_0x2bbfd0[_0x0799('0x7')]])){utils[_0x0799('0x33')](util['format'](_0x0799('0x5a'),_0x2bbfd0['uniqueid']),_0x2bbfd0);utils[_0x0799('0x9')](util[_0x0799('0xa')](_0x0799('0x5b'),_0x2bbfd0['uniqueid'],_0x2bbfd0[_0x0799('0x5c')],_0x2bbfd0[_0x0799('0x5d')]));if(_0x2bbfd0[_0x0799('0x5c')][_0x0799('0x5e')]()=='set'&&_[_0x0799('0x5f')](_0x2bbfd0[_0x0799('0x5d')]['toLowerCase'](),_0x0799('0x60'))){var _0x3f5d80=_0x2bbfd0[_0x0799('0x5d')]['split']('=');var _0x32125f=_0x3f5d80[0x0][_0x0799('0x61')](_0x3f5d80[0x0][_0x0799('0x62')]('(')+0x1,_0x3f5d80[0x0][_0x0799('0x62')](')'));var _0x2c53c4=_0x3f5d80[0x1];channels[_0x2bbfd0['uniqueid']][_0x32125f]=_0x2c53c4;}if(!_[_0x0799('0x63')]([_0x0799('0x28'),'noop','execif',_0x0799('0x64'),_0x0799('0x65')],_0x2bbfd0[_0x0799('0x5c')][_0x0799('0x5e')]())){channels[_0x2bbfd0[_0x0799('0x7')]]['lastapplication']=_0x2bbfd0[_0x0799('0x5c')];channels[_0x2bbfd0[_0x0799('0x7')]]['lastdata']=_0x2bbfd0['appdata'];}}}catch(_0x3a0654){utils[_0x0799('0x1e')](util['format'](_0x0799('0x5a'),_0x2bbfd0['uniqueid']),_0x3a0654);}}; \ No newline at end of file +var _0xa1b9=['origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','debug','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-phone','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','substring','lastIndexOf','hangup','noop','execif','gotoif','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','destinationchannel','answertime','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','starttime','endtime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]'];(function(_0x18a843,_0x2742a6){var _0x1bc81e=function(_0x5b46ea){while(--_0x5b46ea){_0x18a843['push'](_0x18a843['shift']());}};_0x1bc81e(++_0x2742a6);}(_0xa1b9,0x10f));var _0x9a1b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa1b9[_0x411add];return _0x238242;};'use strict';var _=require('lodash');var util=require(_0x9a1b('0x0'));var utils=require(_0x9a1b('0x1'));var transfers=require(_0x9a1b('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x9a1b('0x3'),_0x9a1b('0x4'),'NO\x20ANSWER',_0x9a1b('0x4'),_0x9a1b('0x5'),_0x9a1b('0x6'),'FAILED',_0x9a1b('0x3'),_0x9a1b('0x3')];var channels={};function writeDB(_0x3bb80c){var _0x710fbc;if(transfers[_0x9a1b('0x7')][_0x3bb80c[_0x9a1b('0x8')]]){_0x710fbc=_0x3bb80c['uniqueid'];_0x3bb80c[_0x9a1b('0x8')]=transfers['blinds'][_0x3bb80c['uniqueid']]['transfereeuniqueid'];}utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0xb'),_0x3bb80c[_0x9a1b('0x8')],_0x3bb80c[_0x9a1b('0xc')],_0x3bb80c['queue'],_0x3bb80c['membername'],_0x3bb80c[_0x9a1b('0xd')],_0x3bb80c[_0x9a1b('0xe')],_0x3bb80c[_0x9a1b('0xf')],_0x3bb80c[_0x9a1b('0x10')]));if(_0x3bb80c['accountcode']){utils[_0x9a1b('0x11')](_0x3bb80c[_0x9a1b('0x12')])[_0x9a1b('0x13')](function(_0x2af462){if(_0x2af462){_0x3bb80c[_0x9a1b('0x14')]=_0x2af462['id'];}utils[_0x9a1b('0x15')]('CreateVoiceCallReport',_0x3bb80c);});}else{utils[_0x9a1b('0x15')](_0x9a1b('0x16'),_0x3bb80c);}if(channels[_0x3bb80c['uniqueid']]){delete channels[_0x3bb80c[_0x9a1b('0x8')]];}else if(_0x710fbc&&channels[_0x710fbc]){delete transfers['blinds'][_0x710fbc];delete channels[_0x710fbc];}}exports[_0x9a1b('0x17')]=function(_0x259c23){try{utils['debug'](util[_0x9a1b('0xa')](_0x9a1b('0x18'),_0x259c23[_0x9a1b('0x8')]),_0x259c23);if(_0x259c23[_0x9a1b('0x8')]==_0x259c23[_0x9a1b('0x19')]&&_0x259c23[_0x9a1b('0xc')]!=_0x9a1b('0x1a')){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x1b'),_0x259c23[_0x9a1b('0x8')],_0x259c23[_0x9a1b('0x1c')],_0x259c23[_0x9a1b('0x1d')]));channels[_0x259c23[_0x9a1b('0x8')]]={'uniqueid':_0x259c23[_0x9a1b('0x8')],'accountcode':_0x259c23[_0x9a1b('0x12')],'source':_0x259c23[_0x9a1b('0xe')],'destination':_0x259c23[_0x9a1b('0x1d')],'destinationcontext':_0x259c23[_0x9a1b('0x1c')],'channel':_0x259c23[_0x9a1b('0xc')],'starttime':utils[_0x9a1b('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9a1b('0x4'),'amaflags':_0x9a1b('0x1f')};}}catch(_0x10d397){utils[_0x9a1b('0x20')](util[_0x9a1b('0xa')](_0x9a1b('0x18'),_0x259c23[_0x9a1b('0x8')]),_0x10d397);}};exports[_0x9a1b('0x21')]=function(_0x516f1a){try{utils['debug'](util['format'](_0x9a1b('0x22'),_0x516f1a[_0x9a1b('0x8')]),_0x516f1a);if(!_['isNil'](channels[_0x516f1a['uniqueid']])&&_0x516f1a['channelstate']==0x6){utils[_0x9a1b('0x9')](util['format'](_0x9a1b('0x23'),_0x516f1a[_0x9a1b('0x8')],_0x516f1a[_0x9a1b('0x1c')],_0x516f1a['channel']));if(_[_0x9a1b('0x24')](channels[_0x516f1a['uniqueid']]['systemanswertime'])){channels[_0x516f1a['uniqueid']]['systemanswertime']=utils[_0x9a1b('0x1e')]();}}else if(!_[_0x9a1b('0x24')](channels[_0x516f1a[_0x9a1b('0x19')]])&&_0x516f1a[_0x9a1b('0x25')]==0x6&&_0x516f1a[_0x9a1b('0x1c')]!='transfer'){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x516f1a[_0x9a1b('0x8')],_0x516f1a[_0x9a1b('0x19')],_0x516f1a['context'],_0x516f1a['channel']));channels[_0x516f1a[_0x9a1b('0x19')]]['accountcode']=_0x516f1a[_0x9a1b('0x12')];channels[_0x516f1a[_0x9a1b('0x19')]][_0x9a1b('0x26')]=_0x516f1a[_0x9a1b('0xc')];if(_[_0x9a1b('0x24')](channels[_0x516f1a[_0x9a1b('0x19')]]['answertime'])){channels[_0x516f1a[_0x9a1b('0x19')]][_0x9a1b('0x27')]=utils[_0x9a1b('0x1e')]();}channels[_0x516f1a[_0x9a1b('0x19')]]['disposition']=dispositions[_['toNumber'](_0x516f1a[_0x9a1b('0x25')])]||_0x9a1b('0x5');}}catch(_0x5c9ddf){utils[_0x9a1b('0x20')](util['format'](_0x9a1b('0x22'),_0x516f1a[_0x9a1b('0x8')]),_0x5c9ddf);}};exports['hangup']=function(_0x531d00){try{if(!_[_0x9a1b('0x24')](channels[_0x531d00[_0x9a1b('0x8')]])){utils['debug'](util['format']('[%s][calls][hangup]',_0x531d00[_0x9a1b('0x8')]),_0x531d00);if(_[_0x9a1b('0x24')](channels[_0x531d00[_0x9a1b('0x8')]][_0x9a1b('0x28')])){channels[_0x531d00[_0x9a1b('0x8')]][_0x9a1b('0x28')]=_0x531d00['calleridname']+'\x20<'+_0x531d00[_0x9a1b('0xe')]+'>';}utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x29'),_0x531d00[_0x9a1b('0x8')],channels[_0x531d00['uniqueid']]['callerid'],_0x531d00['cause-txt']));channels[_0x531d00[_0x9a1b('0x8')]]['endtime']=utils['now']();channels[_0x531d00['uniqueid']][_0x9a1b('0x2a')]=utils[_0x9a1b('0x2b')](channels[_0x531d00[_0x9a1b('0x8')]]['endtime'],channels[_0x531d00[_0x9a1b('0x8')]][_0x9a1b('0x2c')]);channels[_0x531d00[_0x9a1b('0x8')]]['billableseconds']=channels[_0x531d00['uniqueid']][_0x9a1b('0x27')]?utils[_0x9a1b('0x2b')](channels[_0x531d00[_0x9a1b('0x8')]][_0x9a1b('0x2d')],channels[_0x531d00[_0x9a1b('0x8')]][_0x9a1b('0x27')]):0x0;writeDB(channels[_0x531d00['uniqueid']]);}}catch(_0xf94c1b){utils['error'](util[_0x9a1b('0xa')](_0x9a1b('0x2e'),_0x531d00[_0x9a1b('0x8')]),_0xf94c1b);}};exports[_0x9a1b('0x2f')]=function(_0x48acd0){try{if(!_['isNil'](channels[_0x48acd0[_0x9a1b('0x30')]])){utils['debug'](util['format'](_0x9a1b('0x31'),_0x48acd0[_0x9a1b('0x32')]),_0x48acd0);if(channels[_0x48acd0[_0x9a1b('0x30')]][_0x9a1b('0xc')]==_0x48acd0[_0x9a1b('0x33')]){utils['info'](util[_0x9a1b('0xa')](_0x9a1b('0x34'),_0x48acd0[_0x9a1b('0x32')],_0x48acd0[_0x9a1b('0x30')],_0x48acd0[_0x9a1b('0x35')]));channels[_0x48acd0[_0x9a1b('0x30')]]['destinationchannel']=_0x48acd0[_0x9a1b('0x35')];channels[_0x48acd0['localtwolinkedid']][_0x9a1b('0x36')]=_0x9a1b('0x37');}else if(channels[_0x48acd0[_0x9a1b('0x30')]]['channel']=_0x48acd0[_0x9a1b('0x38')]){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x34'),_0x48acd0['origtransfereruniqueid'],_0x48acd0[_0x9a1b('0x30')],_0x48acd0[_0x9a1b('0x39')]));channels[_0x48acd0['localtwolinkedid']][_0x9a1b('0x26')]=_0x48acd0[_0x9a1b('0x39')];channels[_0x48acd0[_0x9a1b('0x30')]]['userfield']=_0x9a1b('0x37');}}}catch(_0x485e28){utils[_0x9a1b('0x20')](util['format'](_0x9a1b('0x31'),_0x48acd0[_0x9a1b('0x32')]),_0x485e28);}};exports['musiconholdstart']=function(_0x321231){try{if(!_[_0x9a1b('0x24')](channels[_0x321231[_0x9a1b('0x8')]])){utils[_0x9a1b('0x3a')](util[_0x9a1b('0xa')](_0x9a1b('0x3b'),_0x321231[_0x9a1b('0x8')]),_0x321231);channels[_0x321231[_0x9a1b('0x8')]][_0x9a1b('0x3c')]=utils[_0x9a1b('0x1e')]();utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x3d'),_0x321231[_0x9a1b('0x8')],channels[_0x321231[_0x9a1b('0x8')]][_0x9a1b('0x3c')]));}}catch(_0x106c1e){utils['error'](util['format'](_0x9a1b('0x3b'),_0x321231[_0x9a1b('0x8')]),_0x106c1e);}};exports[_0x9a1b('0x3e')]=function(_0x5b1adf){try{if(!_['isNil'](channels[_0x5b1adf[_0x9a1b('0x8')]])){utils[_0x9a1b('0x3a')](util[_0x9a1b('0xa')](_0x9a1b('0x3f'),_0x5b1adf[_0x9a1b('0x8')]),_0x5b1adf);if(!_['isNil'](channels[_0x5b1adf[_0x9a1b('0x8')]][_0x9a1b('0x3c')])){channels[_0x5b1adf[_0x9a1b('0x8')]]['mohtime']+=utils[_0x9a1b('0x2b')](utils[_0x9a1b('0x1e')](),channels[_0x5b1adf[_0x9a1b('0x8')]][_0x9a1b('0x3c')]);utils[_0x9a1b('0x9')](util['format'](_0x9a1b('0x40'),_0x5b1adf[_0x9a1b('0x8')],channels[_0x5b1adf[_0x9a1b('0x8')]][_0x9a1b('0x41')]));delete channels[_0x5b1adf['uniqueid']][_0x9a1b('0x3c')];}}}catch(_0x457828){utils['error'](util['format']('[%s][calls][musiconholdstop]',_0x5b1adf[_0x9a1b('0x8')]),_0x457828);}};exports[_0x9a1b('0x42')]=function(_0x55ce7f){try{if(!_[_0x9a1b('0x24')](channels[_0x55ce7f[_0x9a1b('0x8')]])){utils[_0x9a1b('0x3a')](util['format'](_0x9a1b('0x43'),_0x55ce7f['uniqueid']),_0x55ce7f);if(!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x45')])){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x46'),_0x55ce7f['uniqueid'],_0x55ce7f['value']));channels[_0x55ce7f[_0x9a1b('0x8')]]['source']=_0x55ce7f['value'];}if(!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x47')])){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x55ce7f[_0x9a1b('0x8')],_0x55ce7f[_0x9a1b('0x48')]));channels[_0x55ce7f['uniqueid']]['destination']=_0x55ce7f[_0x9a1b('0x48')];channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x28')]='\x22'+_0x55ce7f[_0x9a1b('0x48')]+_0x9a1b('0x49')+_0x55ce7f[_0x9a1b('0x48')]+'>';}if(!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x4a')])||!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x4b')])){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x4c'),_0x55ce7f['uniqueid'],!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x4a')])?'xmd-callerid-preview':'xmd-callerid',_0x55ce7f[_0x9a1b('0x48')]));channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x28')]=_0x55ce7f['value'];}if(!_[_0x9a1b('0x24')](_0x55ce7f['variable'][_0x9a1b('0x4d')])||!_['isNil'](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x4e')])){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x4c'),_0x55ce7f[_0x9a1b('0x8')],!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x4d')])?_0x9a1b('0x4d'):'xmcs-queue',_0x55ce7f[_0x9a1b('0x48')]));channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x4f')]=_0x9a1b('0x50');channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x51')]=_0x55ce7f[_0x9a1b('0x48')];channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x52')]=!![];}if(!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x53')])){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')](_0x9a1b('0x54'),_0x55ce7f[_0x9a1b('0x8')],_0x55ce7f['value']));channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x55')]=_0x55ce7f[_0x9a1b('0x48')];}if(!_['isNil'](_0x55ce7f['variable'][_0x9a1b('0x56')])){utils[_0x9a1b('0x9')](util[_0x9a1b('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x55ce7f[_0x9a1b('0x8')],_0x55ce7f[_0x9a1b('0x48')]));channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x57')]=_0x55ce7f[_0x9a1b('0x48')];}if(!_[_0x9a1b('0x24')](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x58')])){utils['info'](util[_0x9a1b('0xa')](_0x9a1b('0x59'),_0x55ce7f[_0x9a1b('0x8')],_0x55ce7f[_0x9a1b('0x48')]));channels[_0x55ce7f[_0x9a1b('0x8')]][_0x9a1b('0x5a')]=_0x55ce7f[_0x9a1b('0x48')];}if(!_['isNil'](_0x55ce7f[_0x9a1b('0x44')][_0x9a1b('0x5b')])){utils[_0x9a1b('0x9')](util['format'](_0x9a1b('0x5c'),_0x55ce7f['uniqueid'],_0x55ce7f[_0x9a1b('0x48')]));channels[_0x55ce7f['uniqueid']][_0x9a1b('0x5b')]=_0x55ce7f['value'];}}}catch(_0x33152a){utils[_0x9a1b('0x20')](util[_0x9a1b('0xa')](_0x9a1b('0x43'),_0x55ce7f['uniqueid']),_0x33152a);}};exports[_0x9a1b('0x5d')]=function(_0x4249b8){try{if(!_[_0x9a1b('0x24')](channels[_0x4249b8[_0x9a1b('0x8')]])){utils['debug'](util[_0x9a1b('0xa')](_0x9a1b('0x5e'),_0x4249b8[_0x9a1b('0x8')]),_0x4249b8);utils[_0x9a1b('0x9')](util['format'](_0x9a1b('0x5f'),_0x4249b8[_0x9a1b('0x8')],_0x4249b8[_0x9a1b('0x60')],_0x4249b8[_0x9a1b('0x61')]));if(_0x4249b8[_0x9a1b('0x60')]['toLowerCase']()==_0x9a1b('0x62')&&_[_0x9a1b('0x63')](_0x4249b8[_0x9a1b('0x61')][_0x9a1b('0x64')](),'cdr')){var _0xaf3805=_0x4249b8['appdata']['split']('=');var _0x59af82=_0xaf3805[0x0][_0x9a1b('0x65')](_0xaf3805[0x0]['lastIndexOf']('(')+0x1,_0xaf3805[0x0][_0x9a1b('0x66')](')'));var _0x457c7d=_0xaf3805[0x1];channels[_0x4249b8['uniqueid']][_0x59af82]=_0x457c7d;}if(!_['includes']([_0x9a1b('0x67'),_0x9a1b('0x68'),_0x9a1b('0x69'),_0x9a1b('0x62'),_0x9a1b('0x6a')],_0x4249b8[_0x9a1b('0x60')]['toLowerCase']())){channels[_0x4249b8['uniqueid']][_0x9a1b('0x4f')]=_0x4249b8['application'];channels[_0x4249b8[_0x9a1b('0x8')]]['lastdata']=_0x4249b8[_0x9a1b('0x61')];}}}catch(_0x1531c4){utils[_0x9a1b('0x20')](util[_0x9a1b('0xa')](_0x9a1b('0x5e'),_0x4249b8[_0x9a1b('0x8')]),_0x1531c4);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a9bdcc6..68c5989 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 _0xb30f=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x418a2e,_0xb869d7){var _0x49fe55=function(_0x5d8692){while(--_0x5d8692){_0x418a2e['push'](_0x418a2e['shift']());}};_0x49fe55(++_0xb869d7);}(_0xb30f,0x109));var _0xfb30=function(_0x21bcf0,_0x508482){_0x21bcf0=_0x21bcf0-0x0;var _0x531ab7=_0xb30f[_0x21bcf0];return _0x531ab7;};'use strict';var utils=require(_0xfb30('0x0'));exports[_0xfb30('0x1')]=function(){utils[_0xfb30('0x2')](_0xfb30('0x3'));};exports[_0xfb30('0x4')]=function(){utils['info'](_0xfb30('0x5'));};exports[_0xfb30('0x6')]=function(){utils[_0xfb30('0x2')]('[core]\x20fullybooted');};exports[_0xfb30('0x7')]=function(_0x2be793){utils[_0xfb30('0x7')](_0xfb30('0x8'),_0x2be793);};exports[_0xfb30('0x9')]=function(){utils['info'](_0xfb30('0xa'));};exports[_0xfb30('0xb')]=function(_0x519a56){}; \ No newline at end of file +var _0x322d=['info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils'];(function(_0x2000b5,_0x3b88f6){var _0x5ce377=function(_0x55e884){while(--_0x55e884){_0x2000b5['push'](_0x2000b5['shift']());}};_0x5ce377(++_0x3b88f6);}(_0x322d,0x121));var _0xd322=function(_0x24606a,_0x4f999){_0x24606a=_0x24606a-0x0;var _0x2168ce=_0x322d[_0x24606a];return _0x2168ce;};'use strict';var utils=require(_0xd322('0x0'));exports['connect']=function(){utils[_0xd322('0x1')]('[core]\x20connected');};exports[_0xd322('0x2')]=function(){utils[_0xd322('0x1')](_0xd322('0x3'));};exports[_0xd322('0x4')]=function(){utils[_0xd322('0x1')](_0xd322('0x5'));};exports[_0xd322('0x6')]=function(_0x406c2f){utils['error'](_0xd322('0x7'),_0x406c2f);};exports['close']=function(){utils[_0xd322('0x1')](_0xd322('0x8'));};exports[_0xd322('0x9')]=function(_0x2d108c){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 39d497f..ba3d14c 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 _0xa2d0=['starttime','dialend','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','calleridname','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','uniqueid','application','appdata','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called'];(function(_0x1808a0,_0x4b00ef){var _0x1c191a=function(_0x54b219){while(--_0x54b219){_0x1808a0['push'](_0x1808a0['shift']());}};_0x1c191a(++_0x4b00ef);}(_0xa2d0,0x166));var _0x0a2d=function(_0x570ff1,_0xb24d6a){_0x570ff1=_0x570ff1-0x0;var _0x2b8c46=_0xa2d0[_0x570ff1];return _0x2b8c46;};'use strict';var _=require(_0x0a2d('0x0'));var util=require(_0x0a2d('0x1'));var utils=require(_0x0a2d('0x2'));var dials={};function writeDB(_0x54264e){utils[_0x0a2d('0x3')](util['format'](_0x0a2d('0x4'),_0x54264e['uniqueid'],_0x54264e[_0x0a2d('0x5')],_0x54264e[_0x0a2d('0x6')],_0x54264e['calleridnum'],_0x54264e[_0x0a2d('0x7')],_0x54264e[_0x0a2d('0x8')]));utils[_0x0a2d('0x9')](_0x0a2d('0xa'),_0x54264e);delete dials[_0x54264e['uniqueid']];}exports[_0x0a2d('0xb')]=function(_0x40a89c){try{utils[_0x0a2d('0xc')](util[_0x0a2d('0xd')]('[%s][dials][newexten]',_0x40a89c[_0x0a2d('0xe')]),_0x40a89c);utils['info'](util[_0x0a2d('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x40a89c[_0x0a2d('0xe')],_0x40a89c[_0x0a2d('0xf')],_0x40a89c[_0x0a2d('0x10')]));if(_0x40a89c['application']['toLowerCase']()=='set'&&_[_0x0a2d('0x11')](_0x40a89c[_0x0a2d('0x10')][_0x0a2d('0x12')](),_0x0a2d('0x13'))){var _0x3bdb80=_0x40a89c[_0x0a2d('0x10')][_0x0a2d('0x14')]('=');dials[_0x40a89c[_0x0a2d('0xe')]]={'routeId':_0x3bdb80[0x1]};}}catch(_0x65ab28){utils[_0x0a2d('0x15')](util[_0x0a2d('0xd')]('[%s][dials][newexten]',_0x40a89c[_0x0a2d('0xe')]),_0x65ab28);}};exports[_0x0a2d('0x16')]=function(_0x27fbcd){try{utils[_0x0a2d('0xc')](util[_0x0a2d('0xd')](_0x0a2d('0x17'),_0x27fbcd[_0x0a2d('0xe')]),_0x27fbcd);if(!_['isNil'](_0x27fbcd[_0x0a2d('0x18')]['outboundrouteid'])){utils[_0x0a2d('0x3')](util[_0x0a2d('0xd')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x27fbcd[_0x0a2d('0xe')],_0x27fbcd['value']));dials[_0x27fbcd['uniqueid']]={'routeId':_0x27fbcd[_0x0a2d('0x19')]};}}catch(_0x45c4b4){utils['error'](util[_0x0a2d('0xd')]('[%s][dials][varset]',_0x27fbcd[_0x0a2d('0xe')]),_0x45c4b4);}};exports[_0x0a2d('0x1a')]=function(_0x12b678){try{if(!_[_0x0a2d('0x1b')](dials[_0x12b678[_0x0a2d('0xe')]])){utils['debug'](util[_0x0a2d('0xd')](_0x0a2d('0x1c'),_0x12b678['uniqueid']),_0x12b678);dials[_0x12b678[_0x0a2d('0xe')]]=_[_0x0a2d('0x1d')](dials[_0x12b678['uniqueid']],_0x12b678);dials[_0x12b678[_0x0a2d('0xe')]]['starttime']=utils[_0x0a2d('0x1e')]();dials[_0x12b678['uniqueid']][_0x0a2d('0x1f')]=_0x0a2d('0x20');utils[_0x0a2d('0x3')](util[_0x0a2d('0xd')](_0x0a2d('0x21'),_0x12b678['uniqueid'],dials[_0x12b678[_0x0a2d('0xe')]][_0x0a2d('0x22')]));}}catch(_0x3e732b){utils['error'](util[_0x0a2d('0xd')](_0x0a2d('0x1c'),_0x12b678['uniqueid']),_0x3e732b);}};exports[_0x0a2d('0x23')]=function(_0x5de6f6){try{if(!_[_0x0a2d('0x1b')](dials[_0x5de6f6['uniqueid']])){utils[_0x0a2d('0xc')](util['format']('[%s][dials][dialend]',_0x5de6f6[_0x0a2d('0xe')]),_0x5de6f6);dials[_0x5de6f6['uniqueid']][_0x0a2d('0x8')]=_0x5de6f6[_0x0a2d('0x8')];if(_0x5de6f6[_0x0a2d('0x8')]=='ANSWER'){dials[_0x5de6f6['uniqueid']]=_['assign'](dials[_0x5de6f6[_0x0a2d('0xe')]],_0x5de6f6);dials[_0x5de6f6[_0x0a2d('0xe')]]['answertime']=utils[_0x0a2d('0x1e')]();dials[_0x5de6f6[_0x0a2d('0xe')]][_0x0a2d('0x1f')]=_0x0a2d('0x24');utils['info'](util[_0x0a2d('0xd')](_0x0a2d('0x25'),_0x5de6f6[_0x0a2d('0xe')],_0x5de6f6['dialstatus'],dials[_0x5de6f6[_0x0a2d('0xe')]][_0x0a2d('0x26')]));}else{utils[_0x0a2d('0x3')](util[_0x0a2d('0xd')](_0x0a2d('0x27'),_0x5de6f6[_0x0a2d('0xe')],_0x5de6f6[_0x0a2d('0x8')]));}}}catch(_0x1a0941){utils[_0x0a2d('0x15')](util[_0x0a2d('0xd')](_0x0a2d('0x28'),_0x5de6f6[_0x0a2d('0xe')]),_0x1a0941);}};exports['hangup']=function(_0x4d8837){try{if(!_[_0x0a2d('0x1b')](dials[_0x4d8837[_0x0a2d('0xe')]])){utils['debug'](util[_0x0a2d('0xd')](_0x0a2d('0x29'),_0x4d8837[_0x0a2d('0xe')]),_0x4d8837);utils[_0x0a2d('0x3')](util[_0x0a2d('0xd')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4d8837['uniqueid'],_0x4d8837['calleridnum'],_0x4d8837[_0x0a2d('0x2a')],_0x4d8837['cause-txt']));dials[_0x4d8837['uniqueid']]=_[_0x0a2d('0x1d')](dials[_0x4d8837[_0x0a2d('0xe')]],{'endtime':utils[_0x0a2d('0x1e')](),'lastevent':_0x0a2d('0x2b')});dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x2c')]=utils[_0x0a2d('0x2d')](dials[_0x4d8837['uniqueid']]['endtime'],dials[_0x4d8837['uniqueid']]['starttime']);dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x2e')]=utils[_0x0a2d('0x2d')](dials[_0x4d8837['uniqueid']][_0x0a2d('0x26')]||dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x2f')],dials[_0x4d8837['uniqueid']][_0x0a2d('0x22')]);dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x30')]=dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x26')]?utils[_0x0a2d('0x2d')](dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x2f')],dials[_0x4d8837[_0x0a2d('0xe')]][_0x0a2d('0x26')]):0x0;writeDB(dials[_0x4d8837[_0x0a2d('0xe')]]);}}catch(_0x2df507){utils[_0x0a2d('0x15')](util[_0x0a2d('0xd')](_0x0a2d('0x29'),_0x4d8837[_0x0a2d('0xe')]),_0x2df507);}}; \ No newline at end of file +var _0xecd4=['[%s][dials][varset]','[%s][dials][dialbegin]','assign','starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','newexten','debug','[%s][dials][newexten]','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','varset','isNil','variable','value'];(function(_0x5533b1,_0x7f4a9a){var _0x1009f3=function(_0x41d1ad){while(--_0x41d1ad){_0x5533b1['push'](_0x5533b1['shift']());}};_0x1009f3(++_0x7f4a9a);}(_0xecd4,0x158));var _0x4ecd=function(_0x478288,_0x5cdb14){_0x478288=_0x478288-0x0;var _0x21242d=_0xecd4[_0x478288];return _0x21242d;};'use strict';var _=require(_0x4ecd('0x0'));var util=require(_0x4ecd('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x20b5c7){utils[_0x4ecd('0x2')](util[_0x4ecd('0x3')](_0x4ecd('0x4'),_0x20b5c7[_0x4ecd('0x5')],_0x20b5c7[_0x4ecd('0x6')],_0x20b5c7[_0x4ecd('0x7')],_0x20b5c7[_0x4ecd('0x8')],_0x20b5c7['connectedlinenum'],_0x20b5c7[_0x4ecd('0x9')]));utils['request']('CreateVoiceDialReport',_0x20b5c7);delete dials[_0x20b5c7[_0x4ecd('0x5')]];}exports[_0x4ecd('0xa')]=function(_0x1b5c42){try{utils[_0x4ecd('0xb')](util[_0x4ecd('0x3')](_0x4ecd('0xc'),_0x1b5c42['uniqueid']),_0x1b5c42);utils['info'](util[_0x4ecd('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1b5c42[_0x4ecd('0x5')],_0x1b5c42['application'],_0x1b5c42[_0x4ecd('0xd')]));if(_0x1b5c42['application']['toLowerCase']()==_0x4ecd('0xe')&&_[_0x4ecd('0xf')](_0x1b5c42[_0x4ecd('0xd')][_0x4ecd('0x10')](),_0x4ecd('0x11'))){var _0x112afb=_0x1b5c42[_0x4ecd('0xd')][_0x4ecd('0x12')]('=');dials[_0x1b5c42['uniqueid']]={'routeId':_0x112afb[0x1]};}}catch(_0x41a56f){utils[_0x4ecd('0x13')](util[_0x4ecd('0x3')](_0x4ecd('0xc'),_0x1b5c42[_0x4ecd('0x5')]),_0x41a56f);}};exports[_0x4ecd('0x14')]=function(_0x5c7fb6){try{utils[_0x4ecd('0xb')](util[_0x4ecd('0x3')]('[%s][dials][varset]',_0x5c7fb6[_0x4ecd('0x5')]),_0x5c7fb6);if(!_[_0x4ecd('0x15')](_0x5c7fb6[_0x4ecd('0x16')]['outboundrouteid'])){utils['info'](util[_0x4ecd('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x5c7fb6['uniqueid'],_0x5c7fb6[_0x4ecd('0x17')]));dials[_0x5c7fb6[_0x4ecd('0x5')]]={'routeId':_0x5c7fb6['value']};}}catch(_0x46be5f){utils[_0x4ecd('0x13')](util[_0x4ecd('0x3')](_0x4ecd('0x18'),_0x5c7fb6[_0x4ecd('0x5')]),_0x46be5f);}};exports['dialbegin']=function(_0x2a05bf){try{if(!_[_0x4ecd('0x15')](dials[_0x2a05bf[_0x4ecd('0x5')]])){utils['debug'](util[_0x4ecd('0x3')](_0x4ecd('0x19'),_0x2a05bf[_0x4ecd('0x5')]),_0x2a05bf);dials[_0x2a05bf[_0x4ecd('0x5')]]=_[_0x4ecd('0x1a')](dials[_0x2a05bf[_0x4ecd('0x5')]],_0x2a05bf);dials[_0x2a05bf['uniqueid']][_0x4ecd('0x1b')]=utils[_0x4ecd('0x1c')]();dials[_0x2a05bf['uniqueid']][_0x4ecd('0x1d')]='called';utils['info'](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2a05bf['uniqueid'],dials[_0x2a05bf['uniqueid']]['starttime']));}}catch(_0x616f8e){utils[_0x4ecd('0x13')](util[_0x4ecd('0x3')](_0x4ecd('0x19'),_0x2a05bf['uniqueid']),_0x616f8e);}};exports[_0x4ecd('0x1e')]=function(_0x309c9f){try{if(!_[_0x4ecd('0x15')](dials[_0x309c9f[_0x4ecd('0x5')]])){utils[_0x4ecd('0xb')](util['format'](_0x4ecd('0x1f'),_0x309c9f[_0x4ecd('0x5')]),_0x309c9f);dials[_0x309c9f[_0x4ecd('0x5')]][_0x4ecd('0x9')]=_0x309c9f[_0x4ecd('0x9')];if(_0x309c9f[_0x4ecd('0x9')]==_0x4ecd('0x20')){dials[_0x309c9f[_0x4ecd('0x5')]]=_[_0x4ecd('0x1a')](dials[_0x309c9f[_0x4ecd('0x5')]],_0x309c9f);dials[_0x309c9f[_0x4ecd('0x5')]][_0x4ecd('0x21')]=utils[_0x4ecd('0x1c')]();dials[_0x309c9f['uniqueid']][_0x4ecd('0x1d')]=_0x4ecd('0x22');utils[_0x4ecd('0x2')](util[_0x4ecd('0x3')](_0x4ecd('0x23'),_0x309c9f[_0x4ecd('0x5')],_0x309c9f[_0x4ecd('0x9')],dials[_0x309c9f['uniqueid']][_0x4ecd('0x21')]));}else{utils[_0x4ecd('0x2')](util['format'](_0x4ecd('0x24'),_0x309c9f[_0x4ecd('0x5')],_0x309c9f[_0x4ecd('0x9')]));}}}catch(_0x49ddbc){utils[_0x4ecd('0x13')](util['format'](_0x4ecd('0x1f'),_0x309c9f[_0x4ecd('0x5')]),_0x49ddbc);}};exports[_0x4ecd('0x25')]=function(_0x46cbbf){try{if(!_[_0x4ecd('0x15')](dials[_0x46cbbf[_0x4ecd('0x5')]])){utils['debug'](util[_0x4ecd('0x3')]('[%s][dials][hangup]',_0x46cbbf['uniqueid']),_0x46cbbf);utils['info'](util[_0x4ecd('0x3')](_0x4ecd('0x26'),_0x46cbbf[_0x4ecd('0x5')],_0x46cbbf[_0x4ecd('0x8')],_0x46cbbf['calleridname'],_0x46cbbf[_0x4ecd('0x27')]));dials[_0x46cbbf['uniqueid']]=_['assign'](dials[_0x46cbbf[_0x4ecd('0x5')]],{'endtime':utils[_0x4ecd('0x1c')](),'lastevent':_0x4ecd('0x28')});dials[_0x46cbbf['uniqueid']][_0x4ecd('0x29')]=utils[_0x4ecd('0x2a')](dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x2b')],dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x1b')]);dials[_0x46cbbf[_0x4ecd('0x5')]]['holdtime']=utils['diffTime'](dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x21')]||dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x2b')],dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x1b')]);dials[_0x46cbbf['uniqueid']][_0x4ecd('0x2c')]=dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x21')]?utils[_0x4ecd('0x2a')](dials[_0x46cbbf['uniqueid']][_0x4ecd('0x2b')],dials[_0x46cbbf[_0x4ecd('0x5')]][_0x4ecd('0x21')]):0x0;writeDB(dials[_0x46cbbf[_0x4ecd('0x5')]]);}}catch(_0x31c5d4){utils[_0x4ecd('0x13')](util[_0x4ecd('0x3')](_0x4ecd('0x2d'),_0x46cbbf['uniqueid']),_0x31c5d4);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 934b115..47b8a4c 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 _0xc900=['./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','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][dialbegin]','dialbegin','[%s][index][dialend]','./utils','util','asterisk','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0xc900,0xb3));var _0x0c90=function(_0x13e3b5,_0x454d84){_0x13e3b5=_0x13e3b5-0x0;var _0x3e9d21=_0xc900[_0x13e3b5];return _0x3e9d21;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x0c90('0x0'));var util=require(_0x0c90('0x1'));var ami=new AsteriskManager(config[_0x0c90('0x2')]['port'],config[_0x0c90('0x2')]['ip'],config[_0x0c90('0x2')]['username'],config[_0x0c90('0x2')][_0x0c90('0x3')],!![]);ami[_0x0c90('0x4')]();if(config[_0x0c90('0x5')]&&config[_0x0c90('0x5')][_0x0c90('0x6')]){utils['info'](_0x0c90('0x7'));}else{var agents=require(_0x0c90('0x8'));var calls=require(_0x0c90('0x9'));var queues=require(_0x0c90('0xa'));var recordings=require(_0x0c90('0xb'));var members=require(_0x0c90('0xc'));var dials=require(_0x0c90('0xd'));var transfers=require(_0x0c90('0xe'));var core=require(_0x0c90('0xf'));ami['on'](_0x0c90('0x10'),core[_0x0c90('0x10')]);ami['on'](_0x0c90('0x11'),core[_0x0c90('0x11')]);ami['on']('fullybooted',core[_0x0c90('0x12')]);ami['on']('error',core[_0x0c90('0x13')]);ami['on']('close',core[_0x0c90('0x14')]);ami['on'](_0x0c90('0x15'),core[_0x0c90('0x15')]);ami['on'](_0x0c90('0x16'),function(_0x1b0a3a){try{utils['debug'](util[_0x0c90('0x17')](_0x0c90('0x18'),_0x1b0a3a['device']),_0x1b0a3a);members[_0x0c90('0x16')](_0x1b0a3a);}catch(_0x3a492d){utils[_0x0c90('0x13')](util['format']('[%s][index][devicestatechange]',_0x1b0a3a[_0x0c90('0x19')]),_0x3a492d);}});ami['on'](_0x0c90('0x1a'),function(_0x2b8135){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x1c'),_0x2b8135[_0x0c90('0x1d')]),_0x2b8135);agents['agentcalled'](_0x2b8135);}catch(_0xc3bb47){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x1c'),_0x2b8135['uniqueid']),_0xc3bb47);}});ami['on'](_0x0c90('0x1e'),function(_0xd129ca){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x1f'),_0xd129ca[_0x0c90('0x1d')]),_0xd129ca);agents['agentringnoanswer'](_0xd129ca);}catch(_0x365a42){utils['error'](util[_0x0c90('0x17')](_0x0c90('0x1f'),_0xd129ca['uniqueid']),_0x365a42);}});ami['on'](_0x0c90('0x20'),function(_0x43ddc3){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x21'),_0x43ddc3[_0x0c90('0x1d')]),_0x43ddc3);agents['agentconnect'](_0x43ddc3);queues[_0x0c90('0x20')](_0x43ddc3);}catch(_0x12f22c){utils['error'](util['format'](_0x0c90('0x21'),_0x43ddc3[_0x0c90('0x1d')]),_0x12f22c);}});ami['on'](_0x0c90('0x22'),function(_0x109a5f){try{utils['debug'](util[_0x0c90('0x17')](_0x0c90('0x23'),_0x109a5f[_0x0c90('0x1d')]),_0x109a5f);agents[_0x0c90('0x22')](_0x109a5f);queues[_0x0c90('0x22')](_0x109a5f);members[_0x0c90('0x22')](_0x109a5f);}catch(_0x492028){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x23'),_0x109a5f[_0x0c90('0x1d')]),_0x492028);}});ami['on']('queuecallerabandon',function(_0x4c8603){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x24'),_0x4c8603[_0x0c90('0x1d')]),_0x4c8603);agents[_0x0c90('0x25')](_0x4c8603);queues['queuecallerabandon'](_0x4c8603);}catch(_0x120136){utils[_0x0c90('0x13')](util[_0x0c90('0x17')]('[%s][index][queuecallerabandon]',_0x4c8603[_0x0c90('0x1d')]),_0x120136);}});ami['on']('queuecallerjoin',function(_0x54a3f5){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x26'),_0x54a3f5[_0x0c90('0x1d')]),_0x54a3f5);queues['queuecallerjoin'](_0x54a3f5);recordings[_0x0c90('0x27')](_0x54a3f5);}catch(_0x4f0d63){utils[_0x0c90('0x13')](util['format'](_0x0c90('0x26'),_0x54a3f5[_0x0c90('0x1d')]),_0x4f0d63);}});ami['on']('queuecallerleave',function(_0x23bedd){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x28'),_0x23bedd[_0x0c90('0x1d')]),_0x23bedd);queues[_0x0c90('0x29')](_0x23bedd);}catch(_0x441d05){utils[_0x0c90('0x13')](util['format'](_0x0c90('0x28'),_0x23bedd[_0x0c90('0x1d')]),_0x441d05);}});ami['on'](_0x0c90('0x2a'),function(_0x3968a3){try{utils['debug'](util[_0x0c90('0x17')](_0x0c90('0x2b'),_0x3968a3[_0x0c90('0x1d')]),_0x3968a3);queues[_0x0c90('0x2a')](_0x3968a3);calls[_0x0c90('0x2a')](_0x3968a3);}catch(_0x12d3e8){utils[_0x0c90('0x13')](util[_0x0c90('0x17')]('[%s][index][musiconholdstart]',_0x3968a3[_0x0c90('0x1d')]),_0x12d3e8);}});ami['on'](_0x0c90('0x2c'),function(_0x538bf3){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x2d'),_0x538bf3[_0x0c90('0x1d')]),_0x538bf3);queues[_0x0c90('0x2c')](_0x538bf3);calls['musiconholdstop'](_0x538bf3);}catch(_0x2f1d95){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x2d'),_0x538bf3[_0x0c90('0x1d')]),_0x2f1d95);}});ami['on'](_0x0c90('0x2e'),function(_0x1ebc88){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')]('[%s][index][newstate]',_0x1ebc88[_0x0c90('0x1d')]),_0x1ebc88);calls['newstate'](_0x1ebc88);recordings[_0x0c90('0x2e')](_0x1ebc88);}catch(_0x593cc0){utils[_0x0c90('0x13')](util[_0x0c90('0x17')]('[%s][index][newstate]',_0x1ebc88['uniqueid']),_0x593cc0);}});ami['on'](_0x0c90('0x2f'),function(_0x48813b){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x30'),_0x48813b['uniqueid']),_0x48813b);calls[_0x0c90('0x2f')](_0x48813b);recordings[_0x0c90('0x2f')](_0x48813b);dials[_0x0c90('0x2f')](_0x48813b);agents[_0x0c90('0x2f')](_0x48813b);queues[_0x0c90('0x2f')](_0x48813b);}catch(_0x1184c4){utils['error'](util[_0x0c90('0x17')](_0x0c90('0x30'),_0x48813b[_0x0c90('0x1d')]),_0x1184c4);}});ami['on'](_0x0c90('0x31'),function(_0x3c47c9){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')]('[%s][index][cdr]',_0x3c47c9[_0x0c90('0x1d')]),_0x3c47c9);members['cdr'](_0x3c47c9);}catch(_0x126d1c){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x32'),_0x3c47c9[_0x0c90('0x1d')]),_0x126d1c);}});ami['on'](_0x0c90('0x33'),function(_0x137c6d){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x34'),_0x137c6d[_0x0c90('0x1d')]),_0x137c6d);queues[_0x0c90('0x33')](_0x137c6d);agents[_0x0c90('0x33')](_0x137c6d);transfers[_0x0c90('0x33')](_0x137c6d);members[_0x0c90('0x33')](_0x137c6d);}catch(_0x5e3ceb){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x34'),_0x137c6d[_0x0c90('0x1d')]),_0x5e3ceb);}});ami['on'](_0x0c90('0x35'),function(_0x2d9bea){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x36'),_0x2d9bea[_0x0c90('0x37')]),_0x2d9bea);queues[_0x0c90('0x35')](_0x2d9bea);transfers[_0x0c90('0x35')](_0x2d9bea);agents[_0x0c90('0x35')](_0x2d9bea);calls[_0x0c90('0x35')](_0x2d9bea);}catch(_0x595504){utils[_0x0c90('0x13')](util[_0x0c90('0x17')]('[%s][index][attendedtransfer]',_0x2d9bea['origtransfereruniqueid']),_0x595504);}});ami['on']('varset',function(_0x28c510){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x38'),_0x28c510[_0x0c90('0x1d')]),_0x28c510);queues['varset'](_0x28c510);recordings[_0x0c90('0x39')](_0x28c510);calls[_0x0c90('0x39')](_0x28c510);dials[_0x0c90('0x39')](_0x28c510);}catch(_0x549c78){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x38'),_0x28c510[_0x0c90('0x1d')]),_0x549c78);}});ami['on'](_0x0c90('0x3a'),function(_0x3e5508){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x3b'),_0x3e5508[_0x0c90('0x1d')]),_0x3e5508);calls['newexten'](_0x3e5508);recordings[_0x0c90('0x3a')](_0x3e5508);dials['newexten'](_0x3e5508);}catch(_0xda4331){utils[_0x0c90('0x13')](util[_0x0c90('0x17')](_0x0c90('0x3b'),_0x3e5508[_0x0c90('0x1d')]),_0xda4331);}});ami['on'](_0x0c90('0x3c'),function(_0x58dcfc){try{utils['debug'](util['format']('[%s][index][newchannel]',_0x58dcfc[_0x0c90('0x1d')]),_0x58dcfc);calls[_0x0c90('0x3c')](_0x58dcfc);recordings[_0x0c90('0x3c')](_0x58dcfc);}catch(_0x51d116){utils[_0x0c90('0x13')](util[_0x0c90('0x17')]('[%s][index][newchannel]',_0x58dcfc[_0x0c90('0x1d')]),_0x51d116);}});ami['on']('dialbegin',function(_0x3bd960){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x3d'),_0x3bd960['uniqueid']),_0x3bd960);dials[_0x0c90('0x3e')](_0x3bd960);}catch(_0x550776){utils[_0x0c90('0x13')](util[_0x0c90('0x17')]('[%s]dialbegin',_0x3bd960['uniqueid']),_0x550776);}});ami['on']('dialend',function(_0x221fba){try{utils[_0x0c90('0x1b')](util[_0x0c90('0x17')](_0x0c90('0x3f'),_0x221fba[_0x0c90('0x1d')]),_0x221fba);dials['dialend'](_0x221fba);}catch(_0x3bfd01){utils[_0x0c90('0x13')](util['format'](_0x0c90('0x3f'),_0x221fba['uniqueid']),_0x3bfd01);}});} \ No newline at end of file +var _0x5eb8=['connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','debug','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','./utils','util','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller'];(function(_0x434e7b,_0x1836da){var _0x5174e9=function(_0x412709){while(--_0x412709){_0x434e7b['push'](_0x434e7b['shift']());}};_0x5174e9(++_0x1836da);}(_0x5eb8,0xb0));var _0x85eb=function(_0xe1269d,_0x57b7c3){_0xe1269d=_0xe1269d-0x0;var _0x261ca1=_0x5eb8[_0xe1269d];return _0x261ca1;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x85eb('0x0'));var util=require(_0x85eb('0x1'));var ami=new AsteriskManager(config[_0x85eb('0x2')][_0x85eb('0x3')],config[_0x85eb('0x2')]['ip'],config[_0x85eb('0x2')][_0x85eb('0x4')],config[_0x85eb('0x2')][_0x85eb('0x5')],!![]);ami[_0x85eb('0x6')]();if(config[_0x85eb('0x7')]&&config[_0x85eb('0x7')]['disabled']){utils[_0x85eb('0x8')](_0x85eb('0x9'));}else{var agents=require(_0x85eb('0xa'));var calls=require('./calls.controller');var queues=require(_0x85eb('0xb'));var recordings=require('./recordings.controller');var members=require(_0x85eb('0xc'));var dials=require(_0x85eb('0xd'));var transfers=require(_0x85eb('0xe'));var core=require(_0x85eb('0xf'));ami['on'](_0x85eb('0x10'),core[_0x85eb('0x10')]);ami['on'](_0x85eb('0x11'),core['shutdown']);ami['on'](_0x85eb('0x12'),core[_0x85eb('0x12')]);ami['on']('error',core[_0x85eb('0x13')]);ami['on'](_0x85eb('0x14'),core[_0x85eb('0x14')]);ami['on'](_0x85eb('0x15'),core['managerevent']);ami['on']('devicestatechange',function(_0x394c74){try{utils['debug'](util[_0x85eb('0x16')](_0x85eb('0x17'),_0x394c74[_0x85eb('0x18')]),_0x394c74);members[_0x85eb('0x19')](_0x394c74);}catch(_0x183b0c){utils['error'](util[_0x85eb('0x16')]('[%s][index][devicestatechange]',_0x394c74[_0x85eb('0x18')]),_0x183b0c);}});ami['on'](_0x85eb('0x1a'),function(_0x3e23e8){try{utils[_0x85eb('0x1b')](util['format']('[%s][index][agentcalled]',_0x3e23e8['uniqueid']),_0x3e23e8);agents[_0x85eb('0x1a')](_0x3e23e8);}catch(_0x39ca96){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x1c'),_0x3e23e8[_0x85eb('0x1d')]),_0x39ca96);}});ami['on']('agentringnoanswer',function(_0x24cf28){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')]('[%s][index][agentringnoanswer]',_0x24cf28['uniqueid']),_0x24cf28);agents['agentringnoanswer'](_0x24cf28);}catch(_0x55b9e4){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x1e'),_0x24cf28[_0x85eb('0x1d')]),_0x55b9e4);}});ami['on'](_0x85eb('0x1f'),function(_0x3fc6da){try{utils['debug'](util['format']('[%s][index][agentconnect]',_0x3fc6da[_0x85eb('0x1d')]),_0x3fc6da);agents[_0x85eb('0x1f')](_0x3fc6da);queues[_0x85eb('0x1f')](_0x3fc6da);}catch(_0x28b87d){utils[_0x85eb('0x13')](util[_0x85eb('0x16')]('[%s][index][agentconnect]',_0x3fc6da[_0x85eb('0x1d')]),_0x28b87d);}});ami['on'](_0x85eb('0x20'),function(_0x4709ad){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')]('[%s][index][agentcomplete]',_0x4709ad[_0x85eb('0x1d')]),_0x4709ad);agents[_0x85eb('0x20')](_0x4709ad);queues[_0x85eb('0x20')](_0x4709ad);members[_0x85eb('0x20')](_0x4709ad);}catch(_0x40f13e){utils[_0x85eb('0x13')](util['format']('[%s][index][agentcomplete]',_0x4709ad[_0x85eb('0x1d')]),_0x40f13e);}});ami['on']('queuecallerabandon',function(_0xa9b14f){try{utils['debug'](util[_0x85eb('0x16')](_0x85eb('0x21'),_0xa9b14f[_0x85eb('0x1d')]),_0xa9b14f);agents[_0x85eb('0x22')](_0xa9b14f);queues[_0x85eb('0x22')](_0xa9b14f);}catch(_0xf4ac13){utils[_0x85eb('0x13')](util['format'](_0x85eb('0x21'),_0xa9b14f[_0x85eb('0x1d')]),_0xf4ac13);}});ami['on']('queuecallerjoin',function(_0x197898){try{utils['debug'](util['format'](_0x85eb('0x23'),_0x197898[_0x85eb('0x1d')]),_0x197898);queues[_0x85eb('0x24')](_0x197898);recordings[_0x85eb('0x24')](_0x197898);}catch(_0x33c05f){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x23'),_0x197898[_0x85eb('0x1d')]),_0x33c05f);}});ami['on'](_0x85eb('0x25'),function(_0x4cbee0){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')]('[%s][index][queuecallerleave]',_0x4cbee0['uniqueid']),_0x4cbee0);queues[_0x85eb('0x25')](_0x4cbee0);}catch(_0x13f245){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x26'),_0x4cbee0[_0x85eb('0x1d')]),_0x13f245);}});ami['on'](_0x85eb('0x27'),function(_0x35f092){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')](_0x85eb('0x28'),_0x35f092[_0x85eb('0x1d')]),_0x35f092);queues[_0x85eb('0x27')](_0x35f092);calls[_0x85eb('0x27')](_0x35f092);}catch(_0x4b69a7){utils[_0x85eb('0x13')](util[_0x85eb('0x16')]('[%s][index][musiconholdstart]',_0x35f092['uniqueid']),_0x4b69a7);}});ami['on'](_0x85eb('0x29'),function(_0xe22d16){try{utils['debug'](util[_0x85eb('0x16')]('[%s][index][musiconholdstop]',_0xe22d16[_0x85eb('0x1d')]),_0xe22d16);queues['musiconholdstop'](_0xe22d16);calls[_0x85eb('0x29')](_0xe22d16);}catch(_0x5ce7e4){utils[_0x85eb('0x13')](util['format'](_0x85eb('0x2a'),_0xe22d16[_0x85eb('0x1d')]),_0x5ce7e4);}});ami['on']('newstate',function(_0x313989){try{utils['debug'](util[_0x85eb('0x16')](_0x85eb('0x2b'),_0x313989['uniqueid']),_0x313989);calls[_0x85eb('0x2c')](_0x313989);recordings['newstate'](_0x313989);}catch(_0x5495cf){utils[_0x85eb('0x13')](util['format'](_0x85eb('0x2b'),_0x313989[_0x85eb('0x1d')]),_0x5495cf);}});ami['on']('hangup',function(_0x49a0cd){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')]('[%s][index][hangup]',_0x49a0cd['uniqueid']),_0x49a0cd);calls[_0x85eb('0x2d')](_0x49a0cd);recordings[_0x85eb('0x2d')](_0x49a0cd);dials[_0x85eb('0x2d')](_0x49a0cd);agents[_0x85eb('0x2d')](_0x49a0cd);queues[_0x85eb('0x2d')](_0x49a0cd);}catch(_0x5b7411){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x2e'),_0x49a0cd[_0x85eb('0x1d')]),_0x5b7411);}});ami['on'](_0x85eb('0x2f'),function(_0xbc43a7){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')](_0x85eb('0x30'),_0xbc43a7['uniqueid']),_0xbc43a7);members[_0x85eb('0x2f')](_0xbc43a7);}catch(_0x1cabcb){utils['error'](util[_0x85eb('0x16')](_0x85eb('0x30'),_0xbc43a7[_0x85eb('0x1d')]),_0x1cabcb);}});ami['on'](_0x85eb('0x31'),function(_0x1b1559){try{utils[_0x85eb('0x1b')](util['format'](_0x85eb('0x32'),_0x1b1559[_0x85eb('0x1d')]),_0x1b1559);queues[_0x85eb('0x31')](_0x1b1559);agents[_0x85eb('0x31')](_0x1b1559);transfers[_0x85eb('0x31')](_0x1b1559);members[_0x85eb('0x31')](_0x1b1559);}catch(_0xe6b7f3){utils[_0x85eb('0x13')](util['format'](_0x85eb('0x32'),_0x1b1559[_0x85eb('0x1d')]),_0xe6b7f3);}});ami['on'](_0x85eb('0x33'),function(_0x3d5322){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')](_0x85eb('0x34'),_0x3d5322[_0x85eb('0x35')]),_0x3d5322);queues[_0x85eb('0x33')](_0x3d5322);transfers[_0x85eb('0x33')](_0x3d5322);agents[_0x85eb('0x33')](_0x3d5322);calls[_0x85eb('0x33')](_0x3d5322);}catch(_0x528f2b){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x34'),_0x3d5322['origtransfereruniqueid']),_0x528f2b);}});ami['on'](_0x85eb('0x36'),function(_0x30f921){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')](_0x85eb('0x37'),_0x30f921['uniqueid']),_0x30f921);queues[_0x85eb('0x36')](_0x30f921);recordings[_0x85eb('0x36')](_0x30f921);calls[_0x85eb('0x36')](_0x30f921);dials['varset'](_0x30f921);}catch(_0xc5cb43){utils[_0x85eb('0x13')](util[_0x85eb('0x16')]('[%s][index][varset]',_0x30f921['uniqueid']),_0xc5cb43);}});ami['on'](_0x85eb('0x38'),function(_0x52996f){try{utils['debug'](util[_0x85eb('0x16')]('[%s][index][newexten]',_0x52996f[_0x85eb('0x1d')]),_0x52996f);calls[_0x85eb('0x38')](_0x52996f);recordings['newexten'](_0x52996f);dials['newexten'](_0x52996f);}catch(_0x27ce2a){utils[_0x85eb('0x13')](util[_0x85eb('0x16')](_0x85eb('0x39'),_0x52996f[_0x85eb('0x1d')]),_0x27ce2a);}});ami['on']('newchannel',function(_0x1bb9f8){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')](_0x85eb('0x3a'),_0x1bb9f8[_0x85eb('0x1d')]),_0x1bb9f8);calls['newchannel'](_0x1bb9f8);recordings[_0x85eb('0x3b')](_0x1bb9f8);}catch(_0x5cd2d3){utils[_0x85eb('0x13')](util[_0x85eb('0x16')]('[%s][index][newchannel]',_0x1bb9f8[_0x85eb('0x1d')]),_0x5cd2d3);}});ami['on'](_0x85eb('0x3c'),function(_0x415ee6){try{utils[_0x85eb('0x1b')](util[_0x85eb('0x16')](_0x85eb('0x3d'),_0x415ee6['uniqueid']),_0x415ee6);dials[_0x85eb('0x3c')](_0x415ee6);}catch(_0x51368c){utils[_0x85eb('0x13')](util[_0x85eb('0x16')]('[%s]dialbegin',_0x415ee6[_0x85eb('0x1d')]),_0x51368c);}});ami['on'](_0x85eb('0x3e'),function(_0x4a3af9){try{utils[_0x85eb('0x1b')](util['format'](_0x85eb('0x3f'),_0x4a3af9[_0x85eb('0x1d')]),_0x4a3af9);dials[_0x85eb('0x3e')](_0x4a3af9);}catch(_0x13c0b3){utils[_0x85eb('0x13')](util[_0x85eb('0x16')]('[%s][index][dialend]',_0x4a3af9[_0x85eb('0x1d')]),_0x13c0b3);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8d4a55e..94fc1dc 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 _0xae55=['BUSY','now','agent','blind','merge','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','error','cdr','[%s][members][cdr]','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','source','blindtransfer','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereraccountcode','getUserByInternal','extension','[%s][members][blindtransfer]','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','then','membername','CreateMemberReport','split','internal','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state'];(function(_0x25d88a,_0x42ffe7){var _0x3ad9ce=function(_0x57316e){while(--_0x57316e){_0x25d88a['push'](_0x25d88a['shift']());}};_0x3ad9ce(++_0x42ffe7);}(_0xae55,0xd5));var _0x5ae5=function(_0x284cd4,_0xf70ad4){_0x284cd4=_0x284cd4-0x0;var _0xb64b65=_0xae55[_0x284cd4];return _0xb64b65;};'use strict';var _=require(_0x5ae5('0x0'));var util=require(_0x5ae5('0x1'));var utils=require(_0x5ae5('0x2'));var members={};var exclude=[_0x5ae5('0x3'),_0x5ae5('0x4')];function writeDB(_0x42302a){utils['info'](util[_0x5ae5('0x5')](_0x5ae5('0x6'),_0x42302a[_0x5ae5('0x7')],_0x42302a[_0x5ae5('0x8')],_0x42302a[_0x5ae5('0x9')],_0x42302a[_0x5ae5('0xa')],_0x42302a['membername'],_0x42302a[_0x5ae5('0xb')]));if(_0x42302a[_0x5ae5('0x8')]){utils['getUserByInterface'](_0x42302a['interface'])[_0x5ae5('0xc')](function(_0x40f1e7){if(_0x40f1e7){_0x42302a[_0x5ae5('0xd')]=_0x40f1e7['name'];_0x42302a['internal']=_0x40f1e7['internal'];utils['request'](_0x5ae5('0xe'),_0x42302a);}else{utils['getUserByName'](_0x42302a[_0x5ae5('0x8')][_0x5ae5('0xf')]('/')[0x1])[_0x5ae5('0xc')](function(_0x2eaa2e){if(_0x2eaa2e){_0x42302a[_0x5ae5('0xd')]=_0x2eaa2e['name'];_0x42302a[_0x5ae5('0x10')]=_0x2eaa2e[_0x5ae5('0x10')];utils['request'](_0x5ae5('0xe'),_0x42302a);}});}})[_0x5ae5('0x11')](function(_0x921ed){utils['error'](util['format'](_0x5ae5('0x12'),_0x42302a['uniqueid']),_0x921ed);});}delete members[_0x42302a[_0x5ae5('0x8')]];}function startsWith(_0x1f189d,_0x1ef7c4){return _[_0x5ae5('0x13')](_0x1f189d,function(_0x23ab45){return _[_0x5ae5('0x14')](_0x1ef7c4,_0x23ab45);});}exports[_0x5ae5('0x15')]=function(_0xc72dc5){try{utils['debug'](util[_0x5ae5('0x5')](_0x5ae5('0x16'),members[_0xc72dc5[_0x5ae5('0x17')]]?members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x7')]:_0xc72dc5['device']),_0xc72dc5);utils[_0x5ae5('0x18')](util[_0x5ae5('0x5')](_0x5ae5('0x19'),members[_0xc72dc5[_0x5ae5('0x17')]]?members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x7')]:_0xc72dc5[_0x5ae5('0x17')],_0xc72dc5[_0x5ae5('0x1a')],_0xc72dc5[_0x5ae5('0x17')]));switch(_0xc72dc5[_0x5ae5('0x1a')]){case'INUSE':case _0x5ae5('0x1b'):if(!startsWith(exclude,_0xc72dc5[_0x5ae5('0x17')])){return utils['getUserByInterface'](_0xc72dc5[_0x5ae5('0x17')])['then'](function(_0x11a20b){if(!_0x11a20b)return;var _0x5e80ba={'channel':'voice','interface':_0xc72dc5[_0x5ae5('0x17')],'type':'TALKING','enterAt':utils[_0x5ae5('0x1c')](),'role':_0x5ae5('0x1d')};if(members[_0xc72dc5['device']]&&members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x1e')])_[_0x5ae5('0x1f')](members[_0xc72dc5[_0x5ae5('0x17')]],_0x5e80ba);else members[_0xc72dc5[_0x5ae5('0x17')]]=_0x5e80ba;});}break;case _0x5ae5('0x20'):if(!_[_0x5ae5('0x21')](members[_0xc72dc5[_0x5ae5('0x17')]])){members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x22')]=utils[_0x5ae5('0x1c')]();members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x23')]=utils[_0x5ae5('0x24')](members[_0xc72dc5[_0x5ae5('0x17')]]['exitAt'],members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x25')]);if(members[_0xc72dc5[_0x5ae5('0x17')]][_0x5ae5('0x7')]){writeDB(members[_0xc72dc5[_0x5ae5('0x17')]]);}}break;default:break;}}catch(_0x17790f){utils['error'](util['format'](_0x5ae5('0x16'),members[_0xc72dc5[_0x5ae5('0x17')]]?members[_0xc72dc5[_0x5ae5('0x17')]]['uniqueid']:_0xc72dc5['device']),_0x17790f);}};exports[_0x5ae5('0x26')]=function(_0x40fdbe){try{if(!_[_0x5ae5('0x21')](members[_0x40fdbe[_0x5ae5('0x8')]])){utils[_0x5ae5('0x27')](util[_0x5ae5('0x5')](_0x5ae5('0x28'),_0x40fdbe[_0x5ae5('0x7')]),_0x40fdbe);utils['info'](util[_0x5ae5('0x5')](_0x5ae5('0x29'),_0x40fdbe[_0x5ae5('0x7')],_0x40fdbe[_0x5ae5('0x8')],_0x40fdbe[_0x5ae5('0x2a')]));members[_0x40fdbe[_0x5ae5('0x8')]]=_[_0x5ae5('0x2b')](members[_0x40fdbe[_0x5ae5('0x8')]],{'data4':_0x40fdbe['queue'],'uniqueid':_0x40fdbe['uniqueid']});}}catch(_0x19b599){utils[_0x5ae5('0x2c')](util[_0x5ae5('0x5')]('[%s][members][agentcomplete]',_0x40fdbe[_0x5ae5('0x7')]),_0x19b599);}};exports[_0x5ae5('0x2d')]=function(_0x22249f){try{utils[_0x5ae5('0x27')](util[_0x5ae5('0x5')](_0x5ae5('0x2e'),_0x22249f[_0x5ae5('0x7')]),_0x22249f);if(_0x22249f[_0x5ae5('0x9')]){var _0x3259c1=_0x22249f[_0x5ae5('0x9')][_0x5ae5('0xf')]('-')[0x0];if(!_[_0x5ae5('0x21')](members[_0x3259c1])){members[_0x3259c1]=_['assign'](members[_0x3259c1],{'data1':members[_0x3259c1][_0x5ae5('0x2f')]||_0x22249f[_0x5ae5('0xb')],'data2':members[_0x3259c1][_0x5ae5('0xa')]||_0x22249f['source'],'data3':members[_0x3259c1][_0x5ae5('0x30')]||_0x22249f[_0x5ae5('0x31')],'uniqueid':members[_0x3259c1][_0x5ae5('0x7')]||_0x22249f['uniqueid']});utils['info'](util[_0x5ae5('0x5')](_0x5ae5('0x32'),_0x22249f[_0x5ae5('0x7')],members[_0x3259c1][_0x5ae5('0x2f')],members[_0x3259c1][_0x5ae5('0xa')],members[_0x3259c1][_0x5ae5('0x30')]));if(members[_0x3259c1][_0x5ae5('0x22')]){writeDB(members[_0x3259c1]);}}}if(_0x22249f['destinationchannel']){var _0x4262b5=_0x22249f['destinationchannel'][_0x5ae5('0xf')]('-')[0x0];if(!_[_0x5ae5('0x21')](members[_0x4262b5])){members[_0x4262b5]=_[_0x5ae5('0x2b')](members[_0x4262b5],{'data1':members[_0x4262b5]['data1']||_0x22249f[_0x5ae5('0xb')],'data2':members[_0x4262b5]['data2']||_0x22249f[_0x5ae5('0x33')],'data3':members[_0x4262b5][_0x5ae5('0x30')]||_0x22249f['destination'],'uniqueid':members[_0x4262b5][_0x5ae5('0x7')]||_0x22249f[_0x5ae5('0x7')]});utils[_0x5ae5('0x18')](util[_0x5ae5('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x22249f[_0x5ae5('0x7')],members[_0x4262b5][_0x5ae5('0x2f')],members[_0x4262b5][_0x5ae5('0xa')],members[_0x4262b5][_0x5ae5('0x30')]));if(members[_0x4262b5][_0x5ae5('0x22')]){writeDB(members[_0x4262b5]);}}}}catch(_0x2a0edb){utils[_0x5ae5('0x2c')](util[_0x5ae5('0x5')](_0x5ae5('0x2e'),_0x22249f[_0x5ae5('0x7')]),_0x2a0edb);}};exports[_0x5ae5('0x34')]=function(_0x1d99ce){try{utils[_0x5ae5('0x27')](util[_0x5ae5('0x5')]('[%s][members][blindtransfer]',_0x1d99ce['uniqueid']),_0x1d99ce);utils[_0x5ae5('0x18')](util['format']('[%s][members][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1d99ce[_0x5ae5('0x7')],_0x1d99ce[_0x5ae5('0x35')],_0x1d99ce['transferercalleridname'],_0x1d99ce[_0x5ae5('0x36')],_0x1d99ce[_0x5ae5('0x37')]));return utils['getUserByInternal'](_0x1d99ce[_0x5ae5('0x38')])[_0x5ae5('0xc')](function(_0x1fa6ea){if(_0x1fa6ea){if(!members[_0x1fa6ea[_0x5ae5('0x8')]])members[_0x1fa6ea[_0x5ae5('0x8')]]={};members[_0x1fa6ea[_0x5ae5('0x8')]]['data3']=_0x1d99ce[_0x5ae5('0x38')];}return utils[_0x5ae5('0x39')](_0x1d99ce[_0x5ae5('0x3a')])[_0x5ae5('0xc')](function(_0x5c4fcb){if(!_0x5c4fcb)return;if(!members[_0x5c4fcb['interface']])members[_0x5c4fcb['interface']]={};members[_0x5c4fcb[_0x5ae5('0x8')]][_0x5ae5('0x2f')]=_0x5ae5('0x10');members[_0x5c4fcb[_0x5ae5('0x8')]][_0x5ae5('0x1e')]=!![];if(_0x1fa6ea)members[_0x5c4fcb[_0x5ae5('0x8')]]['data2']=_0x1d99ce['transfereraccountcode'];});});}catch(_0x370376){utils[_0x5ae5('0x2c')](util[_0x5ae5('0x5')](_0x5ae5('0x3b'),_0x1d99ce[_0x5ae5('0x7')]),_0x370376);}}; \ No newline at end of file +var _0x9df3=['then','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','merge','isNil','exitAt','duration','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','data3','destination','destinationchannel','split','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','blindtransfer','[%s][members][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereraccountcode','[%s][members][blindtransfer]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','getUserByName'];(function(_0x2c2832,_0x1566bb){var _0x257e31=function(_0x2ca85d){while(--_0x2ca85d){_0x2c2832['push'](_0x2c2832['shift']());}};_0x257e31(++_0x1566bb);}(_0x9df3,0x10f));var _0x39df=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9df3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x39df('0x0'));var util=require(_0x39df('0x1'));var utils=require(_0x39df('0x2'));var members={};var exclude=[_0x39df('0x3'),_0x39df('0x4')];function writeDB(_0x1bffc5){utils[_0x39df('0x5')](util[_0x39df('0x6')](_0x39df('0x7'),_0x1bffc5[_0x39df('0x8')],_0x1bffc5[_0x39df('0x9')],_0x1bffc5[_0x39df('0xa')],_0x1bffc5[_0x39df('0xb')],_0x1bffc5[_0x39df('0xc')],_0x1bffc5[_0x39df('0xd')]));if(_0x1bffc5[_0x39df('0x9')]){utils[_0x39df('0xe')](_0x1bffc5['interface'])['then'](function(_0x3d50a1){if(_0x3d50a1){_0x1bffc5[_0x39df('0xc')]=_0x3d50a1[_0x39df('0xf')];_0x1bffc5[_0x39df('0x10')]=_0x3d50a1[_0x39df('0x10')];utils[_0x39df('0x11')]('CreateMemberReport',_0x1bffc5);}else{utils[_0x39df('0x12')](_0x1bffc5[_0x39df('0x9')]['split']('/')[0x1])[_0x39df('0x13')](function(_0x5c830a){if(_0x5c830a){_0x1bffc5['membername']=_0x5c830a['name'];_0x1bffc5[_0x39df('0x10')]=_0x5c830a[_0x39df('0x10')];utils[_0x39df('0x11')]('CreateMemberReport',_0x1bffc5);}});}})[_0x39df('0x14')](function(_0x1cbc76){utils[_0x39df('0x15')](util['format'](_0x39df('0x16'),_0x1bffc5[_0x39df('0x8')]),_0x1cbc76);});}delete members[_0x1bffc5[_0x39df('0x9')]];}function startsWith(_0x468cd2,_0x37fcaa){return _[_0x39df('0x17')](_0x468cd2,function(_0x5cfe20){return _['startsWith'](_0x37fcaa,_0x5cfe20);});}exports[_0x39df('0x18')]=function(_0x30cd7a){try{utils[_0x39df('0x19')](util[_0x39df('0x6')](_0x39df('0x1a'),members[_0x30cd7a['device']]?members[_0x30cd7a[_0x39df('0x1b')]][_0x39df('0x8')]:_0x30cd7a[_0x39df('0x1b')]),_0x30cd7a);utils[_0x39df('0x5')](util[_0x39df('0x6')](_0x39df('0x1c'),members[_0x30cd7a[_0x39df('0x1b')]]?members[_0x30cd7a[_0x39df('0x1b')]]['uniqueid']:_0x30cd7a[_0x39df('0x1b')],_0x30cd7a[_0x39df('0x1d')],_0x30cd7a[_0x39df('0x1b')]));switch(_0x30cd7a['state']){case _0x39df('0x1e'):case _0x39df('0x1f'):if(!startsWith(exclude,_0x30cd7a['device'])){return utils['getUserByInterface'](_0x30cd7a[_0x39df('0x1b')])['then'](function(_0x1f4a7f){if(!_0x1f4a7f)return;var _0x59deda={'channel':'voice','interface':_0x30cd7a[_0x39df('0x1b')],'type':_0x39df('0x20'),'enterAt':utils[_0x39df('0x21')](),'role':'agent'};if(members[_0x30cd7a[_0x39df('0x1b')]]&&members[_0x30cd7a['device']]['blind'])_[_0x39df('0x22')](members[_0x30cd7a[_0x39df('0x1b')]],_0x59deda);else members[_0x30cd7a[_0x39df('0x1b')]]=_0x59deda;});}break;case'NOT_INUSE':if(!_[_0x39df('0x23')](members[_0x30cd7a[_0x39df('0x1b')]])){members[_0x30cd7a['device']][_0x39df('0x24')]=utils[_0x39df('0x21')]();members[_0x30cd7a[_0x39df('0x1b')]][_0x39df('0x25')]=utils['diffTime'](members[_0x30cd7a[_0x39df('0x1b')]]['exitAt'],members[_0x30cd7a['device']][_0x39df('0x26')]);if(members[_0x30cd7a['device']][_0x39df('0x8')]){writeDB(members[_0x30cd7a['device']]);}}break;default:break;}}catch(_0x11bb80){utils[_0x39df('0x15')](util[_0x39df('0x6')](_0x39df('0x1a'),members[_0x30cd7a[_0x39df('0x1b')]]?members[_0x30cd7a[_0x39df('0x1b')]][_0x39df('0x8')]:_0x30cd7a[_0x39df('0x1b')]),_0x11bb80);}};exports['agentcomplete']=function(_0x3b5651){try{if(!_[_0x39df('0x23')](members[_0x3b5651['interface']])){utils[_0x39df('0x19')](util['format'](_0x39df('0x27'),_0x3b5651[_0x39df('0x8')]),_0x3b5651);utils[_0x39df('0x5')](util[_0x39df('0x6')](_0x39df('0x28'),_0x3b5651[_0x39df('0x8')],_0x3b5651[_0x39df('0x9')],_0x3b5651['queue']));members[_0x3b5651['interface']]=_[_0x39df('0x29')](members[_0x3b5651['interface']],{'data4':_0x3b5651[_0x39df('0x2a')],'uniqueid':_0x3b5651['uniqueid']});}}catch(_0x38f514){utils['error'](util[_0x39df('0x6')](_0x39df('0x27'),_0x3b5651[_0x39df('0x8')]),_0x38f514);}};exports[_0x39df('0x2b')]=function(_0x63a0f8){try{utils['debug'](util[_0x39df('0x6')](_0x39df('0x2c'),_0x63a0f8[_0x39df('0x8')]),_0x63a0f8);if(_0x63a0f8[_0x39df('0xa')]){var _0x7bfd43=_0x63a0f8[_0x39df('0xa')]['split']('-')[0x0];if(!_[_0x39df('0x23')](members[_0x7bfd43])){members[_0x7bfd43]=_[_0x39df('0x29')](members[_0x7bfd43],{'data1':members[_0x7bfd43][_0x39df('0x2d')]||_0x63a0f8[_0x39df('0xd')],'data2':members[_0x7bfd43][_0x39df('0xb')]||_0x63a0f8['source'],'data3':members[_0x7bfd43][_0x39df('0x2e')]||_0x63a0f8[_0x39df('0x2f')],'uniqueid':members[_0x7bfd43][_0x39df('0x8')]||_0x63a0f8[_0x39df('0x8')]});utils[_0x39df('0x5')](util[_0x39df('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x63a0f8['uniqueid'],members[_0x7bfd43][_0x39df('0x2d')],members[_0x7bfd43][_0x39df('0xb')],members[_0x7bfd43][_0x39df('0x2e')]));if(members[_0x7bfd43]['exitAt']){writeDB(members[_0x7bfd43]);}}}if(_0x63a0f8[_0x39df('0x30')]){var _0x537629=_0x63a0f8[_0x39df('0x30')][_0x39df('0x31')]('-')[0x0];if(!_[_0x39df('0x23')](members[_0x537629])){members[_0x537629]=_['assign'](members[_0x537629],{'data1':members[_0x537629][_0x39df('0x2d')]||_0x63a0f8[_0x39df('0xd')],'data2':members[_0x537629][_0x39df('0xb')]||_0x63a0f8[_0x39df('0x32')],'data3':members[_0x537629][_0x39df('0x2e')]||_0x63a0f8['destination'],'uniqueid':members[_0x537629][_0x39df('0x8')]||_0x63a0f8[_0x39df('0x8')]});utils[_0x39df('0x5')](util[_0x39df('0x6')](_0x39df('0x33'),_0x63a0f8[_0x39df('0x8')],members[_0x537629][_0x39df('0x2d')],members[_0x537629][_0x39df('0xb')],members[_0x537629][_0x39df('0x2e')]));if(members[_0x537629][_0x39df('0x24')]){writeDB(members[_0x537629]);}}}}catch(_0x17e42c){utils['error'](util['format'](_0x39df('0x2c'),_0x63a0f8[_0x39df('0x8')]),_0x17e42c);}};exports[_0x39df('0x34')]=function(_0x300fc0){try{utils[_0x39df('0x19')](util[_0x39df('0x6')]('[%s][members][blindtransfer]',_0x300fc0[_0x39df('0x8')]),_0x300fc0);utils[_0x39df('0x5')](util[_0x39df('0x6')](_0x39df('0x35'),_0x300fc0['uniqueid'],_0x300fc0[_0x39df('0x36')],_0x300fc0['transferercalleridname'],_0x300fc0['transfereecalleridnum'],_0x300fc0[_0x39df('0x37')]));return utils['getUserByInternal'](_0x300fc0[_0x39df('0x38')])[_0x39df('0x13')](function(_0x34f1b1){if(_0x34f1b1){if(!members[_0x34f1b1[_0x39df('0x9')]])members[_0x34f1b1['interface']]={};members[_0x34f1b1['interface']][_0x39df('0x2e')]=_0x300fc0[_0x39df('0x38')];}return utils['getUserByInternal'](_0x300fc0['extension'])[_0x39df('0x13')](function(_0x23e727){if(!_0x23e727)return;if(!members[_0x23e727[_0x39df('0x9')]])members[_0x23e727['interface']]={};members[_0x23e727[_0x39df('0x9')]][_0x39df('0x2d')]=_0x39df('0x10');members[_0x23e727[_0x39df('0x9')]]['blind']=!![];if(_0x34f1b1)members[_0x23e727[_0x39df('0x9')]]['data2']=_0x300fc0[_0x39df('0x38')];});});}catch(_0x234a61){utils[_0x39df('0x15')](util[_0x39df('0x6')](_0x39df('0x39'),_0x300fc0[_0x39df('0x8')]),_0x234a61);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e616436..70196ae 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 _0x39b8=['queuestatus','value','toUpperCase','CONTINUE','isNil','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','variable'];(function(_0x14d668,_0x5f0069){var _0x215f43=function(_0x208f23){while(--_0x208f23){_0x14d668['push'](_0x14d668['shift']());}};_0x215f43(++_0x5f0069);}(_0x39b8,0x123));var _0x839b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x39b8[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x839b('0x0'));var util=require('util');var utils=require(_0x839b('0x1'));var queues={};function writeDB(_0x3b7d89){utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x4'),_0x3b7d89[_0x839b('0x5')],_0x3b7d89[_0x839b('0x6')],_0x3b7d89[_0x839b('0x7')],_0x3b7d89[_0x839b('0x8')],_0x3b7d89[_0x839b('0x9')],_0x3b7d89[_0x839b('0xa')],_0x3b7d89[_0x839b('0xb')]));if(_0x3b7d89[_0x839b('0x7')]){utils[_0x839b('0xc')](_0x3b7d89[_0x839b('0x7')])[_0x839b('0xd')](function(_0x66a21){if(_0x66a21){_0x3b7d89[_0x839b('0xe')]=_0x66a21['type'];}utils[_0x839b('0xf')](_0x839b('0x10'),_0x3b7d89);});}else{utils[_0x839b('0xf')](_0x839b('0x10'),_0x3b7d89);}if(_0x3b7d89[_0x839b('0x11')]){delete queues[_0x3b7d89[_0x839b('0x11')]];}else{delete queues[_0x3b7d89[_0x839b('0x5')]];}}exports[_0x839b('0x12')]=function(_0x3c09a6){try{utils[_0x839b('0x13')](util[_0x839b('0x3')](_0x839b('0x14'),_0x3c09a6[_0x839b('0x5')]),_0x3c09a6);utils[_0x839b('0x2')](util[_0x839b('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x3c09a6[_0x839b('0x5')],_0x3c09a6[_0x839b('0x7')],_0x3c09a6[_0x839b('0x15')]));queues[_0x3c09a6[_0x839b('0x5')]]=_[_0x839b('0x16')](_0x3c09a6,{'originalposition':_0x3c09a6['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x27ce11){utils[_0x839b('0x17')](util['format'](_0x839b('0x14'),_0x3c09a6[_0x839b('0x5')]),_0x27ce11);}};exports[_0x839b('0x18')]=function(_0x7a49de){try{if(!_['isNil'](queues[_0x7a49de['uniqueid']])){utils[_0x839b('0x13')](util['format']('[%s][queues][hangup]',_0x7a49de[_0x839b('0x5')]),_0x7a49de);if(queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0x19')]){if(!queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0x1a')]&&!queues[_0x7a49de[_0x839b('0x5')]]['queuecallerexit']){queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0x1b')]=!![];queues[_0x7a49de['uniqueid']][_0x839b('0x1c')]=utils[_0x839b('0x1d')]();queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0xb')]=_0x839b('0x1e');}utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x1f'),_0x7a49de[_0x839b('0x5')],queues[_0x7a49de['uniqueid']][_0x839b('0x20')],queues[_0x7a49de[_0x839b('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x7a49de[_0x839b('0x5')]]);}else if(queues[_0x7a49de[_0x839b('0x5')]]['transfereduniqueid']){utils[_0x839b('0x2')](util[_0x839b('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x7a49de['uniqueid'],queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0x20')],queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0x11')]));queues[queues[_0x7a49de['uniqueid']][_0x839b('0x11')]]=queues[_0x7a49de[_0x839b('0x5')]];queues[queues[_0x7a49de[_0x839b('0x5')]][_0x839b('0x11')]][_0x839b('0x21')]=0x2;delete queues[_0x7a49de[_0x839b('0x5')]];}}}catch(_0xe28968){utils[_0x839b('0x17')](util[_0x839b('0x3')](_0x839b('0x22'),_0x7a49de[_0x839b('0x5')]),_0xe28968);}};exports['varset']=function(_0x361509){try{utils[_0x839b('0x13')](util['format']('[%s][queues][varset]',_0x361509[_0x839b('0x5')]),_0x361509);if(!_['isNil'](_0x361509[_0x839b('0x23')][_0x839b('0x24')])&&_0x361509[_0x839b('0x25')][_0x839b('0x26')]()!==_0x839b('0x27')){if(!_[_0x839b('0x28')](queues[_0x361509[_0x839b('0x5')]])){queues[_0x361509[_0x839b('0x5')]][_0x839b('0x1a')]=![];queues[_0x361509[_0x839b('0x5')]]['queuecallerabandonAt']=null;queues[_0x361509[_0x839b('0x5')]][_0x839b('0x29')]=!![];queues[_0x361509['uniqueid']][_0x839b('0x2a')]=utils[_0x839b('0x1d')]();queues[_0x361509[_0x839b('0x5')]][_0x839b('0xb')]=_0x361509[_0x839b('0x25')]['toUpperCase']();utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x2b'),_0x361509[_0x839b('0x5')],queues[_0x361509['uniqueid']]['name'],_0x361509[_0x839b('0x25')],queues[_0x361509['uniqueid']][_0x839b('0xb')]));writeDB(queues[_0x361509['uniqueid']]);}}else if(!_['isNil'](_0x361509[_0x839b('0x23')][_0x839b('0x2c')])){if(!_[_0x839b('0x28')](queues[_0x361509['uniqueid']])&&!queues[_0x361509[_0x839b('0x5')]][_0x839b('0x1a')]){queues[_0x361509[_0x839b('0x5')]][_0x839b('0x1a')]=![];queues[_0x361509['uniqueid']]['queuecallerabandonAt']=null;queues[_0x361509[_0x839b('0x5')]][_0x839b('0x29')]=!![];queues[_0x361509[_0x839b('0x5')]][_0x839b('0x2a')]=utils[_0x839b('0x1d')]();queues[_0x361509[_0x839b('0x5')]][_0x839b('0xb')]=_0x839b('0x2d');utils[_0x839b('0x2')](util['format'](_0x839b('0x2e'),_0x361509[_0x839b('0x5')],queues[_0x361509[_0x839b('0x5')]]['name'],_0x361509['value'],queues[_0x361509[_0x839b('0x5')]][_0x839b('0xb')]));}}}catch(_0x3f3cb7){utils[_0x839b('0x17')](util[_0x839b('0x3')](_0x839b('0x2f'),_0x361509[_0x839b('0x5')]),_0x3f3cb7);}};exports[_0x839b('0x1a')]=function(_0x1421f7){try{if(!_['isNil'](queues[_0x1421f7['uniqueid']])){utils[_0x839b('0x13')](util[_0x839b('0x3')](_0x839b('0x30'),_0x1421f7[_0x839b('0x5')]),_0x1421f7);queues[_0x1421f7[_0x839b('0x5')]][_0x839b('0x29')]=![];queues[_0x1421f7['uniqueid']][_0x839b('0x2a')]=null;queues[_0x1421f7[_0x839b('0x5')]][_0x839b('0x1a')]=!![];queues[_0x1421f7['uniqueid']][_0x839b('0x31')]=utils[_0x839b('0x1d')]();queues[_0x1421f7[_0x839b('0x5')]][_0x839b('0xb')]=_0x839b('0x32');utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x33'),_0x1421f7[_0x839b('0x5')],queues[_0x1421f7[_0x839b('0x5')]]['name'],queues[_0x1421f7['uniqueid']][_0x839b('0xb')]));}}catch(_0x5862d5){utils['error'](util[_0x839b('0x3')]('[%s][queues][queuecallerabandon]',_0x1421f7[_0x839b('0x5')]),_0x5862d5);}};exports[_0x839b('0x34')]=function(_0x344b3c){try{if(!_[_0x839b('0x28')](queues[_0x344b3c[_0x839b('0x5')]])){utils['debug'](util[_0x839b('0x3')](_0x839b('0x35'),_0x344b3c['uniqueid']),_0x344b3c);utils['info'](util[_0x839b('0x3')](_0x839b('0x36'),_0x344b3c[_0x839b('0x5')],queues[_0x344b3c[_0x839b('0x5')]][_0x839b('0x20')],_0x344b3c[_0x839b('0x37')],_0x344b3c[_0x839b('0x38')]));queues[_0x344b3c[_0x839b('0x5')]]['queuecallerleave']=!![];queues[_0x344b3c[_0x839b('0x5')]][_0x839b('0x19')]=utils[_0x839b('0x1d')]();queues[_0x344b3c[_0x839b('0x5')]][_0x839b('0x39')]=utils[_0x839b('0x3a')](queues[_0x344b3c[_0x839b('0x5')]]['queuecallerleaveAt'],queues[_0x344b3c['uniqueid']][_0x839b('0x3b')]);queues[_0x344b3c[_0x839b('0x5')]][_0x839b('0x15')]=_0x344b3c['position'];queues[_0x344b3c['uniqueid']][_0x839b('0x3c')]=_0x344b3c[_0x839b('0x3c')];queues[_0x344b3c[_0x839b('0x5')]][_0x839b('0x37')]=_0x344b3c['connectedlinenum'];queues[_0x344b3c[_0x839b('0x5')]][_0x839b('0x38')]=_0x344b3c[_0x839b('0x38')];}}catch(_0xd6e346){utils[_0x839b('0x17')](util[_0x839b('0x3')](_0x839b('0x35'),_0x344b3c['uniqueid']),_0xd6e346);}};exports[_0x839b('0x3d')]=function(_0x4c25ab){try{if(!_[_0x839b('0x28')](queues[_0x4c25ab[_0x839b('0x5')]])){utils[_0x839b('0x13')](util[_0x839b('0x3')]('[%s][queues][agentconnect]',_0x4c25ab[_0x839b('0x5')]),_0x4c25ab);utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x3e'),_0x4c25ab[_0x839b('0x5')],queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0x20')],_0x4c25ab[_0x839b('0x3f')],_0x4c25ab[_0x839b('0x40')]));queues[_0x4c25ab[_0x839b('0x5')]]['queuecallerabandon']=![];queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0x1a')]=![];queues[_0x4c25ab['uniqueid']][_0x839b('0x31')]=null;queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0x29')]=![];queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0xb')]=null;queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0x2a')]=null;queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0x41')]=!![];queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0xa')]=_0x4c25ab[_0x839b('0x40')];queues[_0x4c25ab[_0x839b('0x5')]][_0x839b('0x8')]=_0x4c25ab[_0x839b('0x3f')];}}catch(_0x5c215b){utils[_0x839b('0x17')](util[_0x839b('0x3')](_0x839b('0x42'),_0x4c25ab[_0x839b('0x5')]),_0x5c215b);}};exports[_0x839b('0x43')]=function(_0x3dd47b){try{if(!_[_0x839b('0x28')](queues[_0x3dd47b['uniqueid']])){if(queues[_0x3dd47b['uniqueid']][_0x839b('0x19')]){utils['debug'](util[_0x839b('0x3')](_0x839b('0x44'),_0x3dd47b[_0x839b('0x5')]),_0x3dd47b);queues[_0x3dd47b['uniqueid']][_0x839b('0x1a')]=![];queues[_0x3dd47b['uniqueid']][_0x839b('0x1a')]=![];queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0x31')]=null;queues[_0x3dd47b['uniqueid']][_0x839b('0x29')]=![];queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0x2a')]=null;queues[_0x3dd47b['uniqueid']][_0x839b('0x41')]=!![];queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0x8')]=_0x3dd47b[_0x839b('0x3f')];queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0x1b')]=!![];queues[_0x3dd47b['uniqueid']][_0x839b('0x1c')]=utils[_0x839b('0x1d')]();if(_0x3dd47b['reason']==_0x839b('0x45')){if(!queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0x45')]){queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0xb')]=_0x839b('0x46');}}else{queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0xb')]=_0x839b('0x47')+_0x3dd47b['reason'][_0x839b('0x26')]();}utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x48'),_0x3dd47b[_0x839b('0x5')],queues[_0x3dd47b[_0x839b('0x5')]][_0x839b('0x20')],_0x3dd47b[_0x839b('0x3f')],queues[_0x3dd47b['uniqueid']][_0x839b('0xb')]));writeDB(queues[_0x3dd47b['uniqueid']]);}}}catch(_0x9df750){utils['error'](util[_0x839b('0x3')](_0x839b('0x44'),_0x3dd47b[_0x839b('0x5')]),_0x9df750);}};exports[_0x839b('0x49')]=function(_0x12615f){try{if(!_[_0x839b('0x28')](queues[_0x12615f[_0x839b('0x4a')]])){utils['debug'](util[_0x839b('0x3')](_0x839b('0x4b'),_0x12615f['uniqueid']),_0x12615f);queues[_0x12615f[_0x839b('0x4a')]]['transfer']=!![];queues[_0x12615f[_0x839b('0x4a')]][_0x839b('0x4c')]=_0x839b('0x4d');queues[_0x12615f[_0x839b('0x4a')]]['transferexten']=_0x12615f[_0x839b('0x4e')];queues[_0x12615f['transfereeuniqueid']][_0x839b('0x4f')]=_0x12615f[_0x839b('0x4a')];queues[_0x12615f[_0x839b('0x4a')]][_0x839b('0xb')]=_0x839b('0x50');utils['info'](util[_0x839b('0x3')](_0x839b('0x51'),_0x12615f[_0x839b('0x5')],queues[_0x12615f['transfereeuniqueid']][_0x839b('0x20')],_0x12615f[_0x839b('0x4a')],_0x12615f['extension']));}}catch(_0x1fb854){utils['error'](util[_0x839b('0x3')](_0x839b('0x4b'),_0x12615f[_0x839b('0x5')]),_0x1fb854);}};exports[_0x839b('0x52')]=function(_0x1a82f6){try{utils['debug'](util[_0x839b('0x3')](_0x839b('0x53'),_0x1a82f6[_0x839b('0x54')]),_0x1a82f6);if(_0x1a82f6['origtransfereruniqueid']==_0x1a82f6['origtransfererlinkedid']){if(!_[_0x839b('0x28')](queues[_0x1a82f6[_0x839b('0x55')]])){utils[_0x839b('0x2')](util['format'](_0x839b('0x56'),_0x1a82f6[_0x839b('0x54')],queues[_0x1a82f6['secondtransfererlinkedid']][_0x839b('0x20')],_0x1a82f6[_0x839b('0x57')]));queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x45')]=!![];queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x4c')]=_0x839b('0x58');queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x59')]=_0x1a82f6[_0x839b('0x57')];queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x4f')]=_0x1a82f6[_0x839b('0x54')];queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0xb')]=_0x839b('0x5a');}if(!_[_0x839b('0x28')](queues[_0x1a82f6[_0x839b('0x5b')]])){if(_0x1a82f6['transfereelinkedid']&&queues[_0x1a82f6[_0x839b('0x5c')]]){queues[_0x1a82f6[_0x839b('0x5c')]][_0x839b('0x21')]=0x1;queues[_0x1a82f6[_0x839b('0x4a')]]=_[_0x839b('0x5d')](queues[_0x1a82f6[_0x839b('0x5c')]]);queues[_0x1a82f6[_0x839b('0x4a')]]['transfereduniqueid']=_0x1a82f6[_0x839b('0x5e')];queues[_0x1a82f6[_0x839b('0x4a')]]['queuecallerenterreason']=0x2;queues[_0x1a82f6[_0x839b('0x4a')]][_0x839b('0x9')]=queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x9')];queues[_0x1a82f6[_0x839b('0x4a')]][_0x839b('0x5f')]=queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x5f')];queues[_0x1a82f6[_0x839b('0x4a')]][_0x839b('0x3b')]=utils[_0x839b('0x1d')]();queues[_0x1a82f6['transfereeuniqueid']][_0x839b('0x19')]=utils['now']();queues[_0x1a82f6['transfereeuniqueid']][_0x839b('0x39')]=0x0;queues[_0x1a82f6['transfereeuniqueid']]['mohtime']=0x0;utils[_0x839b('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1a82f6[_0x839b('0x54')],queues[_0x1a82f6['transfereeuniqueid']][_0x839b('0x20')],queues[_0x1a82f6[_0x839b('0x4a')]][_0x839b('0x9')],queues[_0x1a82f6['transfereeuniqueid']][_0x839b('0x5f')]));}else{utils['info'](util[_0x839b('0x3')](_0x839b('0x60'),_0x1a82f6['origtransfereruniqueid'],queues[_0x1a82f6[_0x839b('0x5b')]][_0x839b('0x20')],_0x1a82f6[_0x839b('0x55')]));queues[_0x1a82f6[_0x839b('0x5b')]]['transfereduniqueid']=_0x1a82f6[_0x839b('0x55')];}}}else if(_0x1a82f6[_0x839b('0x61')]==_0x1a82f6[_0x839b('0x55')]){if(!_[_0x839b('0x28')](queues[_0x1a82f6['origtransfererlinkedid']])){utils[_0x839b('0x2')](util[_0x839b('0x3')](_0x839b('0x62'),_0x1a82f6[_0x839b('0x54')],queues[_0x1a82f6['origtransfererlinkedid']][_0x839b('0x20')],_0x1a82f6[_0x839b('0x61')],_0x1a82f6[_0x839b('0x63')]));queues[_0x1a82f6[_0x839b('0x5b')]]['transfer']=!![];queues[_0x1a82f6[_0x839b('0x5b')]][_0x839b('0x4c')]=_0x839b('0x58');queues[_0x1a82f6[_0x839b('0x5b')]]['transferexten']=_0x1a82f6[_0x839b('0x63')];queues[_0x1a82f6[_0x839b('0x5b')]][_0x839b('0x4f')]=_0x1a82f6['secondtransfereruniqueid'];queues[_0x1a82f6[_0x839b('0x5b')]]['queuecallerexitreason']=_0x839b('0x5a');}if(!_[_0x839b('0x28')](queues[_0x1a82f6[_0x839b('0x55')]])){if(_0x1a82f6['transfertargetlinkedid']&&queues[_0x1a82f6['transfertargetlinkedid']]){queues[_0x1a82f6[_0x839b('0x64')]][_0x839b('0x21')]=0x1;queues[_0x1a82f6[_0x839b('0x5e')]]=_['clone'](queues[_0x1a82f6[_0x839b('0x64')]]);queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x11')]=_0x1a82f6[_0x839b('0x5e')];queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x21')]=0x2;queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x9')]=queues[_0x1a82f6[_0x839b('0x5b')]][_0x839b('0x9')];queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x5f')]=queues[_0x1a82f6[_0x839b('0x5b')]]['calleridname'];queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x3b')]=utils[_0x839b('0x1d')]();queues[_0x1a82f6['transfertargetuniqueid']][_0x839b('0x19')]=utils['now']();queues[_0x1a82f6[_0x839b('0x5e')]]['holdtime']=0x0;queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x65')]=0x0;utils['info'](util[_0x839b('0x3')](_0x839b('0x66'),_0x1a82f6['origtransfereruniqueid'],queues[_0x1a82f6[_0x839b('0x5e')]]['name'],queues[_0x1a82f6[_0x839b('0x5e')]][_0x839b('0x11')],queues[_0x1a82f6['transfertargetuniqueid']][_0x839b('0x9')],queues[_0x1a82f6['transfertargetuniqueid']][_0x839b('0x5f')]));}else{utils[_0x839b('0x2')](util[_0x839b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1a82f6[_0x839b('0x54')],queues[_0x1a82f6['secondtransfererlinkedid']][_0x839b('0x20')],_0x1a82f6[_0x839b('0x5b')]));queues[_0x1a82f6[_0x839b('0x55')]][_0x839b('0x11')]=_0x1a82f6[_0x839b('0x5b')];}}}}catch(_0x57a5de){utils[_0x839b('0x17')](util['format'](_0x839b('0x53'),_0x1a82f6[_0x839b('0x54')]),_0x57a5de);}};exports[_0x839b('0x67')]=function(_0x43f0f2){try{if(!_[_0x839b('0x28')](queues[_0x43f0f2['uniqueid']])){utils[_0x839b('0x13')](util[_0x839b('0x3')](_0x839b('0x68'),_0x43f0f2[_0x839b('0x5')]),_0x43f0f2);queues[_0x43f0f2['uniqueid']][_0x839b('0x69')]=utils[_0x839b('0x1d')]();utils['info'](util[_0x839b('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x43f0f2[_0x839b('0x5')],queues[_0x43f0f2[_0x839b('0x5')]][_0x839b('0x20')],queues[_0x43f0f2[_0x839b('0x5')]][_0x839b('0x69')]));}}catch(_0x4da3a9){utils['error'](util[_0x839b('0x3')]('[%s][queues][musiconholdstart]',_0x43f0f2[_0x839b('0x5')]),_0x4da3a9);}};exports[_0x839b('0x6a')]=function(_0x54d265){try{if(!_[_0x839b('0x28')](queues[_0x54d265[_0x839b('0x5')]])){if(!_[_0x839b('0x28')](queues[_0x54d265[_0x839b('0x5')]][_0x839b('0x69')])){utils[_0x839b('0x13')](util[_0x839b('0x3')](_0x839b('0x6b'),_0x54d265[_0x839b('0x5')]),_0x54d265);queues[_0x54d265[_0x839b('0x5')]][_0x839b('0x65')]+=utils[_0x839b('0x3a')](utils['now'](),queues[_0x54d265['uniqueid']][_0x839b('0x69')]);utils['info'](util['format'](_0x839b('0x6c'),_0x54d265[_0x839b('0x5')],queues[_0x54d265[_0x839b('0x5')]][_0x839b('0x20')],queues[_0x54d265[_0x839b('0x5')]]['mohtime']));delete queues[_0x54d265['uniqueid']]['musiconholdstartAt'];}}}catch(_0x4f247b){utils[_0x839b('0x17')](util[_0x839b('0x3')](_0x839b('0x6b'),_0x54d265[_0x839b('0x5')]),_0x4f247b);}}; \ No newline at end of file +var _0xa2b0=['secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','info','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','queuecallerleaveAt','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','clone','transfertargetuniqueid','calleridnum','calleridname','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xa2b0,0x145));var _0x0a2b=function(_0x17645a,_0x392947){_0x17645a=_0x17645a-0x0;var _0x3e20b0=_0xa2b0[_0x17645a];return _0x3e20b0;};'use strict';var _=require(_0x0a2b('0x0'));var util=require(_0x0a2b('0x1'));var utils=require(_0x0a2b('0x2'));var queues={};function writeDB(_0x2dea98){utils['info'](util[_0x0a2b('0x3')](_0x0a2b('0x4'),_0x2dea98['uniqueid'],_0x2dea98[_0x0a2b('0x5')],_0x2dea98[_0x0a2b('0x6')],_0x2dea98['lastAssignedTo'],_0x2dea98['calleridnum'],_0x2dea98[_0x0a2b('0x7')],_0x2dea98[_0x0a2b('0x8')]));if(_0x2dea98[_0x0a2b('0x6')]){utils[_0x0a2b('0x9')](_0x2dea98[_0x0a2b('0x6')])[_0x0a2b('0xa')](function(_0x24036b){if(_0x24036b){_0x2dea98[_0x0a2b('0xb')]=_0x24036b['type'];}utils[_0x0a2b('0xc')]('CreateVoiceQueueReport',_0x2dea98);});}else{utils[_0x0a2b('0xc')](_0x0a2b('0xd'),_0x2dea98);}if(_0x2dea98[_0x0a2b('0xe')]){delete queues[_0x2dea98[_0x0a2b('0xe')]];}else{delete queues[_0x2dea98['uniqueid']];}}exports[_0x0a2b('0xf')]=function(_0xa087e3){try{utils[_0x0a2b('0x10')](util['format'](_0x0a2b('0x11'),_0xa087e3[_0x0a2b('0x12')]),_0xa087e3);utils['info'](util['format'](_0x0a2b('0x13'),_0xa087e3[_0x0a2b('0x12')],_0xa087e3[_0x0a2b('0x6')],_0xa087e3[_0x0a2b('0x14')]));queues[_0xa087e3[_0x0a2b('0x12')]]=_[_0x0a2b('0x15')](_0xa087e3,{'originalposition':_0xa087e3[_0x0a2b('0x14')],'queuecallerjoinAt':utils[_0x0a2b('0x16')](),'mohtime':0x0});}catch(_0x90899f){utils[_0x0a2b('0x17')](util['format'](_0x0a2b('0x11'),_0xa087e3['uniqueid']),_0x90899f);}};exports[_0x0a2b('0x18')]=function(_0x24e4a0){try{if(!_[_0x0a2b('0x19')](queues[_0x24e4a0['uniqueid']])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')](_0x0a2b('0x1a'),_0x24e4a0[_0x0a2b('0x12')]),_0x24e4a0);if(queues[_0x24e4a0[_0x0a2b('0x12')]]['queuecallerleaveAt']){if(!queues[_0x24e4a0[_0x0a2b('0x12')]]['queuecallerabandon']&&!queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0x1b')]){queues[_0x24e4a0['uniqueid']][_0x0a2b('0x1c')]=!![];queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0x1d')]=utils[_0x0a2b('0x16')]();queues[_0x24e4a0[_0x0a2b('0x12')]]['queuecallerexitreason']=_0x0a2b('0x1e');}utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x24e4a0['uniqueid'],queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0x20')],queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0x8')]));writeDB(queues[_0x24e4a0[_0x0a2b('0x12')]]);}else if(queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0xe')]){utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')](_0x0a2b('0x21'),_0x24e4a0[_0x0a2b('0x12')],queues[_0x24e4a0['uniqueid']][_0x0a2b('0x20')],queues[_0x24e4a0[_0x0a2b('0x12')]]['transfereduniqueid']));queues[queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0xe')]]=queues[_0x24e4a0[_0x0a2b('0x12')]];queues[queues[_0x24e4a0[_0x0a2b('0x12')]][_0x0a2b('0xe')]][_0x0a2b('0x22')]=0x2;delete queues[_0x24e4a0[_0x0a2b('0x12')]];}}}catch(_0x3f85b6){utils[_0x0a2b('0x17')](util['format'](_0x0a2b('0x1a'),_0x24e4a0[_0x0a2b('0x12')]),_0x3f85b6);}};exports[_0x0a2b('0x23')]=function(_0x11d2e4){try{utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')]('[%s][queues][varset]',_0x11d2e4['uniqueid']),_0x11d2e4);if(!_[_0x0a2b('0x19')](_0x11d2e4[_0x0a2b('0x24')][_0x0a2b('0x25')])&&_0x11d2e4[_0x0a2b('0x26')][_0x0a2b('0x27')]()!=='CONTINUE'){if(!_[_0x0a2b('0x19')](queues[_0x11d2e4['uniqueid']])){queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x28')]=![];queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x29')]=null;queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x1b')]=!![];queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x2a')]=utils[_0x0a2b('0x16')]();queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x8')]=_0x11d2e4[_0x0a2b('0x26')][_0x0a2b('0x27')]();utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')](_0x0a2b('0x2b'),_0x11d2e4[_0x0a2b('0x12')],queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x20')],_0x11d2e4[_0x0a2b('0x26')],queues[_0x11d2e4[_0x0a2b('0x12')]]['queuecallerexitreason']));writeDB(queues[_0x11d2e4[_0x0a2b('0x12')]]);}}else if(!_[_0x0a2b('0x19')](_0x11d2e4[_0x0a2b('0x24')]['queueposition'])){if(!_['isNil'](queues[_0x11d2e4[_0x0a2b('0x12')]])&&!queues[_0x11d2e4[_0x0a2b('0x12')]]['queuecallerabandon']){queues[_0x11d2e4['uniqueid']][_0x0a2b('0x28')]=![];queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x29')]=null;queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x1b')]=!![];queues[_0x11d2e4['uniqueid']][_0x0a2b('0x2a')]=utils['now']();queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x8')]=_0x0a2b('0x2c');utils['info'](util['format'](_0x0a2b('0x2d'),_0x11d2e4[_0x0a2b('0x12')],queues[_0x11d2e4[_0x0a2b('0x12')]][_0x0a2b('0x20')],_0x11d2e4[_0x0a2b('0x26')],queues[_0x11d2e4['uniqueid']][_0x0a2b('0x8')]));}}}catch(_0x217210){utils[_0x0a2b('0x17')](util[_0x0a2b('0x3')]('[%s][queues][varset]',_0x11d2e4[_0x0a2b('0x12')]),_0x217210);}};exports[_0x0a2b('0x28')]=function(_0x2cd3ce){try{if(!_[_0x0a2b('0x19')](queues[_0x2cd3ce[_0x0a2b('0x12')]])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')](_0x0a2b('0x2e'),_0x2cd3ce[_0x0a2b('0x12')]),_0x2cd3ce);queues[_0x2cd3ce[_0x0a2b('0x12')]][_0x0a2b('0x1b')]=![];queues[_0x2cd3ce[_0x0a2b('0x12')]][_0x0a2b('0x2a')]=null;queues[_0x2cd3ce[_0x0a2b('0x12')]][_0x0a2b('0x28')]=!![];queues[_0x2cd3ce[_0x0a2b('0x12')]]['queuecallerabandonAt']=utils['now']();queues[_0x2cd3ce[_0x0a2b('0x12')]][_0x0a2b('0x8')]=_0x0a2b('0x2f');utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')](_0x0a2b('0x30'),_0x2cd3ce['uniqueid'],queues[_0x2cd3ce[_0x0a2b('0x12')]][_0x0a2b('0x20')],queues[_0x2cd3ce[_0x0a2b('0x12')]][_0x0a2b('0x8')]));}}catch(_0x5f2928){utils[_0x0a2b('0x17')](util[_0x0a2b('0x3')](_0x0a2b('0x2e'),_0x2cd3ce[_0x0a2b('0x12')]),_0x5f2928);}};exports['queuecallerleave']=function(_0x5db311){try{if(!_['isNil'](queues[_0x5db311[_0x0a2b('0x12')]])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')](_0x0a2b('0x31'),_0x5db311['uniqueid']),_0x5db311);utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5db311[_0x0a2b('0x12')],queues[_0x5db311[_0x0a2b('0x12')]][_0x0a2b('0x20')],_0x5db311[_0x0a2b('0x32')],_0x5db311[_0x0a2b('0x33')]));queues[_0x5db311['uniqueid']]['queuecallerleave']=!![];queues[_0x5db311[_0x0a2b('0x12')]]['queuecallerleaveAt']=utils['now']();queues[_0x5db311[_0x0a2b('0x12')]][_0x0a2b('0x34')]=utils['diffTime'](queues[_0x5db311['uniqueid']][_0x0a2b('0x35')],queues[_0x5db311[_0x0a2b('0x12')]][_0x0a2b('0x36')]);queues[_0x5db311['uniqueid']]['position']=_0x5db311[_0x0a2b('0x14')];queues[_0x5db311[_0x0a2b('0x12')]][_0x0a2b('0x37')]=_0x5db311[_0x0a2b('0x37')];queues[_0x5db311[_0x0a2b('0x12')]][_0x0a2b('0x32')]=_0x5db311[_0x0a2b('0x32')];queues[_0x5db311[_0x0a2b('0x12')]]['connectedlinename']=_0x5db311[_0x0a2b('0x33')];}}catch(_0x2df213){utils[_0x0a2b('0x17')](util[_0x0a2b('0x3')](_0x0a2b('0x31'),_0x5db311['uniqueid']),_0x2df213);}};exports['agentconnect']=function(_0x4df6c7){try{if(!_[_0x0a2b('0x19')](queues[_0x4df6c7['uniqueid']])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')](_0x0a2b('0x38'),_0x4df6c7['uniqueid']),_0x4df6c7);utils[_0x0a2b('0x1f')](util['format'](_0x0a2b('0x39'),_0x4df6c7[_0x0a2b('0x12')],queues[_0x4df6c7[_0x0a2b('0x12')]]['name'],_0x4df6c7[_0x0a2b('0x3a')],_0x4df6c7['destaccountcode']));queues[_0x4df6c7[_0x0a2b('0x12')]][_0x0a2b('0x28')]=![];queues[_0x4df6c7[_0x0a2b('0x12')]]['queuecallerabandon']=![];queues[_0x4df6c7[_0x0a2b('0x12')]][_0x0a2b('0x29')]=null;queues[_0x4df6c7[_0x0a2b('0x12')]][_0x0a2b('0x1b')]=![];queues[_0x4df6c7[_0x0a2b('0x12')]]['queuecallerexitreason']=null;queues[_0x4df6c7[_0x0a2b('0x12')]][_0x0a2b('0x2a')]=null;queues[_0x4df6c7['uniqueid']][_0x0a2b('0x3b')]=!![];queues[_0x4df6c7['uniqueid']][_0x0a2b('0x7')]=_0x4df6c7[_0x0a2b('0x3c')];queues[_0x4df6c7[_0x0a2b('0x12')]][_0x0a2b('0x3d')]=_0x4df6c7[_0x0a2b('0x3a')];}}catch(_0x334fb1){utils['error'](util[_0x0a2b('0x3')](_0x0a2b('0x38'),_0x4df6c7['uniqueid']),_0x334fb1);}};exports[_0x0a2b('0x3e')]=function(_0x6f7014){try{if(!_[_0x0a2b('0x19')](queues[_0x6f7014[_0x0a2b('0x12')]])){if(queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x35')]){utils[_0x0a2b('0x10')](util['format'](_0x0a2b('0x3f'),_0x6f7014[_0x0a2b('0x12')]),_0x6f7014);queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x28')]=![];queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x28')]=![];queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x29')]=null;queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x1b')]=![];queues[_0x6f7014['uniqueid']][_0x0a2b('0x2a')]=null;queues[_0x6f7014[_0x0a2b('0x12')]]['assigned']=!![];queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x3d')]=_0x6f7014['membername'];queues[_0x6f7014[_0x0a2b('0x12')]]['queuecallercomplete']=!![];queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x1d')]=utils[_0x0a2b('0x16')]();if(_0x6f7014[_0x0a2b('0x40')]==_0x0a2b('0x41')){if(!queues[_0x6f7014['uniqueid']][_0x0a2b('0x41')]){queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x8')]=_0x0a2b('0x42');}}else{queues[_0x6f7014[_0x0a2b('0x12')]]['queuecallerexitreason']='COMPLETEDBY'+_0x6f7014[_0x0a2b('0x40')][_0x0a2b('0x27')]();}utils[_0x0a2b('0x1f')](util['format'](_0x0a2b('0x43'),_0x6f7014[_0x0a2b('0x12')],queues[_0x6f7014[_0x0a2b('0x12')]]['name'],_0x6f7014[_0x0a2b('0x3a')],queues[_0x6f7014[_0x0a2b('0x12')]][_0x0a2b('0x8')]));writeDB(queues[_0x6f7014[_0x0a2b('0x12')]]);}}}catch(_0x2dd667){utils['error'](util['format'](_0x0a2b('0x3f'),_0x6f7014['uniqueid']),_0x2dd667);}};exports[_0x0a2b('0x44')]=function(_0x223094){try{if(!_[_0x0a2b('0x19')](queues[_0x223094[_0x0a2b('0x45')]])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')]('[%s][queues][blindtransfer]',_0x223094[_0x0a2b('0x12')]),_0x223094);queues[_0x223094[_0x0a2b('0x45')]][_0x0a2b('0x41')]=!![];queues[_0x223094[_0x0a2b('0x45')]][_0x0a2b('0x46')]=_0x0a2b('0x47');queues[_0x223094[_0x0a2b('0x45')]][_0x0a2b('0x48')]=_0x223094['extension'];queues[_0x223094[_0x0a2b('0x45')]][_0x0a2b('0x49')]=_0x223094['transfereeuniqueid'];queues[_0x223094[_0x0a2b('0x45')]][_0x0a2b('0x8')]=_0x0a2b('0x4a');utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')](_0x0a2b('0x4b'),_0x223094[_0x0a2b('0x12')],queues[_0x223094['transfereeuniqueid']][_0x0a2b('0x20')],_0x223094[_0x0a2b('0x45')],_0x223094[_0x0a2b('0x4c')]));}}catch(_0x3abe92){utils['error'](util[_0x0a2b('0x3')]('[%s][queues][blindtransfer]',_0x223094['uniqueid']),_0x3abe92);}};exports[_0x0a2b('0x4d')]=function(_0x1b85ce){try{utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')](_0x0a2b('0x4e'),_0x1b85ce[_0x0a2b('0x4f')]),_0x1b85ce);if(_0x1b85ce[_0x0a2b('0x4f')]==_0x1b85ce[_0x0a2b('0x50')]){if(!_[_0x0a2b('0x19')](queues[_0x1b85ce[_0x0a2b('0x51')]])){utils['info'](util[_0x0a2b('0x3')](_0x0a2b('0x52'),_0x1b85ce['origtransfereruniqueid'],queues[_0x1b85ce['secondtransfererlinkedid']]['name'],_0x1b85ce[_0x0a2b('0x53')]));queues[_0x1b85ce[_0x0a2b('0x51')]]['transfer']=!![];queues[_0x1b85ce['secondtransfererlinkedid']][_0x0a2b('0x46')]=_0x0a2b('0x54');queues[_0x1b85ce[_0x0a2b('0x51')]][_0x0a2b('0x48')]=_0x1b85ce[_0x0a2b('0x53')];queues[_0x1b85ce['secondtransfererlinkedid']][_0x0a2b('0x49')]=_0x1b85ce[_0x0a2b('0x4f')];queues[_0x1b85ce[_0x0a2b('0x51')]][_0x0a2b('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x0a2b('0x19')](queues[_0x1b85ce[_0x0a2b('0x50')]])){if(_0x1b85ce['transfereelinkedid']&&queues[_0x1b85ce['transfereelinkedid']]){queues[_0x1b85ce['transfereelinkedid']][_0x0a2b('0x22')]=0x1;queues[_0x1b85ce[_0x0a2b('0x45')]]=_[_0x0a2b('0x55')](queues[_0x1b85ce['transfereelinkedid']]);queues[_0x1b85ce[_0x0a2b('0x45')]][_0x0a2b('0xe')]=_0x1b85ce[_0x0a2b('0x56')];queues[_0x1b85ce[_0x0a2b('0x45')]]['queuecallerenterreason']=0x2;queues[_0x1b85ce[_0x0a2b('0x45')]][_0x0a2b('0x57')]=queues[_0x1b85ce[_0x0a2b('0x51')]][_0x0a2b('0x57')];queues[_0x1b85ce[_0x0a2b('0x45')]][_0x0a2b('0x58')]=queues[_0x1b85ce[_0x0a2b('0x51')]][_0x0a2b('0x58')];queues[_0x1b85ce['transfereeuniqueid']][_0x0a2b('0x36')]=utils[_0x0a2b('0x16')]();queues[_0x1b85ce[_0x0a2b('0x45')]][_0x0a2b('0x35')]=utils[_0x0a2b('0x16')]();queues[_0x1b85ce[_0x0a2b('0x45')]]['holdtime']=0x0;queues[_0x1b85ce[_0x0a2b('0x45')]]['mohtime']=0x0;utils['info'](util[_0x0a2b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1b85ce[_0x0a2b('0x4f')],queues[_0x1b85ce[_0x0a2b('0x45')]][_0x0a2b('0x20')],queues[_0x1b85ce[_0x0a2b('0x45')]][_0x0a2b('0x57')],queues[_0x1b85ce['transfereeuniqueid']][_0x0a2b('0x58')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1b85ce[_0x0a2b('0x4f')],queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x20')],_0x1b85ce['secondtransfererlinkedid']));queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0xe')]=_0x1b85ce[_0x0a2b('0x51')];}}}else if(_0x1b85ce[_0x0a2b('0x59')]==_0x1b85ce[_0x0a2b('0x51')]){if(!_[_0x0a2b('0x19')](queues[_0x1b85ce[_0x0a2b('0x50')]])){utils[_0x0a2b('0x1f')](util['format'](_0x0a2b('0x5a'),_0x1b85ce[_0x0a2b('0x4f')],queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x20')],_0x1b85ce[_0x0a2b('0x59')],_0x1b85ce[_0x0a2b('0x5b')]));queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x41')]=!![];queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x46')]=_0x0a2b('0x54');queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x48')]=_0x1b85ce[_0x0a2b('0x5b')];queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x49')]=_0x1b85ce['secondtransfereruniqueid'];queues[_0x1b85ce[_0x0a2b('0x50')]]['queuecallerexitreason']=_0x0a2b('0x5c');}if(!_[_0x0a2b('0x19')](queues[_0x1b85ce['secondtransfererlinkedid']])){if(_0x1b85ce[_0x0a2b('0x5d')]&&queues[_0x1b85ce[_0x0a2b('0x5d')]]){queues[_0x1b85ce['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x1b85ce['transfertargetuniqueid']]=_['clone'](queues[_0x1b85ce[_0x0a2b('0x5d')]]);queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0xe')]=_0x1b85ce[_0x0a2b('0x56')];queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x22')]=0x2;queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x57')]=queues[_0x1b85ce[_0x0a2b('0x50')]]['calleridnum'];queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x58')]=queues[_0x1b85ce[_0x0a2b('0x50')]][_0x0a2b('0x58')];queues[_0x1b85ce['transfertargetuniqueid']][_0x0a2b('0x36')]=utils[_0x0a2b('0x16')]();queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x35')]=utils[_0x0a2b('0x16')]();queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x34')]=0x0;queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x5e')]=0x0;utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')](_0x0a2b('0x5f'),_0x1b85ce[_0x0a2b('0x4f')],queues[_0x1b85ce[_0x0a2b('0x56')]]['name'],queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0xe')],queues[_0x1b85ce[_0x0a2b('0x56')]][_0x0a2b('0x57')],queues[_0x1b85ce[_0x0a2b('0x56')]]['calleridname']));}else{utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1b85ce[_0x0a2b('0x4f')],queues[_0x1b85ce[_0x0a2b('0x51')]][_0x0a2b('0x20')],_0x1b85ce[_0x0a2b('0x50')]));queues[_0x1b85ce[_0x0a2b('0x51')]][_0x0a2b('0xe')]=_0x1b85ce[_0x0a2b('0x50')];}}}}catch(_0x1ee12c){utils[_0x0a2b('0x17')](util[_0x0a2b('0x3')](_0x0a2b('0x4e'),_0x1b85ce[_0x0a2b('0x4f')]),_0x1ee12c);}};exports[_0x0a2b('0x60')]=function(_0x2f4913){try{if(!_['isNil'](queues[_0x2f4913[_0x0a2b('0x12')]])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')]('[%s][queues][musiconholdstart]',_0x2f4913[_0x0a2b('0x12')]),_0x2f4913);queues[_0x2f4913[_0x0a2b('0x12')]][_0x0a2b('0x61')]=utils['now']();utils[_0x0a2b('0x1f')](util['format'](_0x0a2b('0x62'),_0x2f4913[_0x0a2b('0x12')],queues[_0x2f4913[_0x0a2b('0x12')]][_0x0a2b('0x20')],queues[_0x2f4913[_0x0a2b('0x12')]][_0x0a2b('0x61')]));}}catch(_0xa2b08f){utils[_0x0a2b('0x17')](util[_0x0a2b('0x3')](_0x0a2b('0x63'),_0x2f4913['uniqueid']),_0xa2b08f);}};exports[_0x0a2b('0x64')]=function(_0x3c6c9d){try{if(!_[_0x0a2b('0x19')](queues[_0x3c6c9d[_0x0a2b('0x12')]])){if(!_[_0x0a2b('0x19')](queues[_0x3c6c9d[_0x0a2b('0x12')]][_0x0a2b('0x61')])){utils[_0x0a2b('0x10')](util[_0x0a2b('0x3')](_0x0a2b('0x65'),_0x3c6c9d[_0x0a2b('0x12')]),_0x3c6c9d);queues[_0x3c6c9d[_0x0a2b('0x12')]][_0x0a2b('0x5e')]+=utils[_0x0a2b('0x66')](utils[_0x0a2b('0x16')](),queues[_0x3c6c9d[_0x0a2b('0x12')]][_0x0a2b('0x61')]);utils[_0x0a2b('0x1f')](util[_0x0a2b('0x3')](_0x0a2b('0x67'),_0x3c6c9d[_0x0a2b('0x12')],queues[_0x3c6c9d[_0x0a2b('0x12')]][_0x0a2b('0x20')],queues[_0x3c6c9d[_0x0a2b('0x12')]][_0x0a2b('0x5e')]));delete queues[_0x3c6c9d[_0x0a2b('0x12')]][_0x0a2b('0x61')];}}}catch(_0x4e6985){utils[_0x0a2b('0x17')](util[_0x0a2b('0x3')](_0x0a2b('0x65'),_0x3c6c9d[_0x0a2b('0x12')]),_0x4e6985);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d78dadc..f4fc662 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 _0x0f80=['membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','format','newstate','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','monitors','forEach','[%s][recordings][newexten]','application','appdata','set','startsWith','toLowerCase','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','./utils','info','accountcode','then'];(function(_0x4e533c,_0x184c22){var _0x4ee175=function(_0x506bdf){while(--_0x506bdf){_0x4e533c['push'](_0x4e533c['shift']());}};_0x4ee175(++_0x184c22);}(_0x0f80,0xa9));var _0x00f8=function(_0x4f2a21,_0x5acf20){_0x4f2a21=_0x4f2a21-0x0;var _0x45cfc7=_0x0f80[_0x4f2a21];return _0x45cfc7;};'use strict';var _=require('lodash');var util=require(_0x00f8('0x0'));var utils=require(_0x00f8('0x1'));var recordings={};function writeDB(_0x2301f3){utils[_0x00f8('0x2')](util['format']('[%s][recordings][writeDB]',_0x2301f3['uniqueid']));if(_0x2301f3[_0x00f8('0x3')]){utils['getUserByInternal'](_0x2301f3[_0x00f8('0x3')])[_0x00f8('0x4')](function(_0x64ffc6){if(_0x64ffc6){_0x2301f3[_0x00f8('0x5')]=_0x64ffc6['name'];_0x2301f3[_0x00f8('0x6')]=_0x64ffc6['id'];}utils[_0x00f8('0x7')](_0x00f8('0x8'),_0x2301f3);});}else{utils[_0x00f8('0x7')]('CreateVoiceRecording',_0x2301f3);}}exports[_0x00f8('0x9')]=function(_0x382738){try{utils[_0x00f8('0xa')](util['format'](_0x00f8('0xb'),_0x382738[_0x00f8('0xc')]),_0x382738);if(_0x382738['uniqueid']==_0x382738['linkedid']){utils[_0x00f8('0x2')](util['format'](_0x00f8('0xd'),_0x382738[_0x00f8('0xc')],_0x382738[_0x00f8('0xe')],_0x382738[_0x00f8('0xf')]));recordings[_0x382738[_0x00f8('0xc')]]={'uniqueid':_0x382738[_0x00f8('0xc')],'accountcode':_0x382738['accountcode'],'exten':_0x382738[_0x00f8('0xf')],'context':_0x382738['context'],'channel':_0x382738[_0x00f8('0x10')],'monitors':[]};}}catch(_0x5824d7){utils[_0x00f8('0x11')](util[_0x00f8('0x12')](_0x00f8('0xb'),_0x382738['uniqueid']),_0x5824d7);}};exports[_0x00f8('0x13')]=function(_0x13bbb5){try{utils[_0x00f8('0xa')](util[_0x00f8('0x12')]('[%s][recordings][newstate]',_0x13bbb5['uniqueid']),_0x13bbb5);if(!_[_0x00f8('0x14')](recordings[_0x13bbb5[_0x00f8('0xc')]])&&_0x13bbb5['channelstate']==0x6){utils[_0x00f8('0x2')](util[_0x00f8('0x12')](_0x00f8('0x15'),_0x13bbb5['uniqueid'],_0x13bbb5['context'],_0x13bbb5[_0x00f8('0x10')]));}else if(!_[_0x00f8('0x14')](recordings[_0x13bbb5['linkedid']])&&_0x13bbb5[_0x00f8('0x16')]==0x6&&_0x13bbb5[_0x00f8('0xe')]!=_0x00f8('0x17')){utils['info'](util[_0x00f8('0x12')](_0x00f8('0x18'),_0x13bbb5[_0x00f8('0xc')],_0x13bbb5[_0x00f8('0x19')],_0x13bbb5[_0x00f8('0xe')],_0x13bbb5[_0x00f8('0x10')]));recordings[_0x13bbb5['linkedid']][_0x00f8('0x3')]=_0x13bbb5[_0x00f8('0x3')];}}catch(_0x8025af){utils[_0x00f8('0x11')](util['format'](_0x00f8('0x1a'),_0x13bbb5[_0x00f8('0xc')]),_0x8025af);}};exports['varset']=function(_0x7b9891){try{if(!_[_0x00f8('0x14')](_0x7b9891[_0x00f8('0x1b')])&&!_[_0x00f8('0x14')](_0x7b9891[_0x00f8('0x1b')][_0x00f8('0x1c')])){utils[_0x00f8('0xa')](util[_0x00f8('0x12')](_0x00f8('0x1d'),_0x7b9891[_0x00f8('0xc')]),_0x7b9891);utils['info'](util[_0x00f8('0x12')](_0x00f8('0x1e'),_0x7b9891[_0x00f8('0xc')],_0x7b9891[_0x00f8('0x1b')],_0x7b9891[_0x00f8('0x1f')]));if(_[_0x00f8('0x20')](_0x7b9891['value'],_0x00f8('0x21'))){_0x7b9891[_0x00f8('0x1f')]=_0x7b9891[_0x00f8('0x1f')][_0x00f8('0x22')](_0x00f8('0x21'),'.WAV');}if(recordings[_0x7b9891['linkedid']]){var _0x2bcf13=_[_0x00f8('0x23')](recordings[_0x7b9891['linkedid']]['monitors'],{'value':_0x7b9891[_0x00f8('0x1f')]});if(_['isNil'](_0x2bcf13)){recordings[_0x7b9891[_0x00f8('0x19')]]['monitors']['push']({'value':_0x7b9891[_0x00f8('0x1f')]});}}}}catch(_0x3df1f4){utils[_0x00f8('0x11')](util[_0x00f8('0x12')](_0x00f8('0x1d'),_0x7b9891['uniqueid']),_0x3df1f4);}};exports[_0x00f8('0x24')]=function(_0x5cc4fc){try{if(!_[_0x00f8('0x14')](recordings[_0x5cc4fc[_0x00f8('0xc')]])){utils['debug'](util[_0x00f8('0x12')](_0x00f8('0x25'),_0x5cc4fc[_0x00f8('0xc')]),_0x5cc4fc);utils['info'](util['format'](_0x00f8('0x26'),_0x5cc4fc[_0x00f8('0xc')],_0x5cc4fc[_0x00f8('0x27')],_0x5cc4fc[_0x00f8('0x28')],_0x5cc4fc[_0x00f8('0x29')]));recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x27')]=_0x5cc4fc[_0x00f8('0x27')];recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x28')]=_0x5cc4fc['calleridname'];recordings[_0x5cc4fc['uniqueid']][_0x00f8('0x2a')]=_0x5cc4fc[_0x00f8('0x2a')];recordings[_0x5cc4fc[_0x00f8('0xc')]]['connectedlinename']=_0x5cc4fc[_0x00f8('0x2b')];if(recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x2c')]=='outbound'&&recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x3')]){recordings[_0x5cc4fc['uniqueid']][_0x00f8('0x2a')]=recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x3')];recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x2b')]='';}recordings[_0x5cc4fc[_0x00f8('0xc')]][_0x00f8('0x2d')][_0x00f8('0x2e')](function(_0x3ce73f){var _0x2cef6c=_['clone'](recordings[_0x5cc4fc['uniqueid']]);_0x2cef6c['value']=_0x3ce73f[_0x00f8('0x1f')];writeDB(_0x2cef6c);});delete recordings[_0x5cc4fc[_0x00f8('0xc')]];}}catch(_0x3dcabe){utils['error'](util[_0x00f8('0x12')]('[%s][recordings][hangup]',_0x5cc4fc['uniqueid']),_0x3dcabe);}};exports['newexten']=function(_0x5e19f0){try{if(!_[_0x00f8('0x14')](recordings[_0x5e19f0[_0x00f8('0xc')]])){utils[_0x00f8('0xa')](util[_0x00f8('0x12')](_0x00f8('0x2f'),_0x5e19f0[_0x00f8('0xc')]),_0x5e19f0);utils[_0x00f8('0x2')](util[_0x00f8('0x12')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5e19f0[_0x00f8('0xc')],_0x5e19f0[_0x00f8('0x30')],_0x5e19f0[_0x00f8('0x31')]));if(_0x5e19f0[_0x00f8('0x30')]['toLowerCase']()==_0x00f8('0x32')&&_[_0x00f8('0x33')](_0x5e19f0[_0x00f8('0x31')][_0x00f8('0x34')](),'cdr')){var _0x2179b8=_0x5e19f0['appdata']['split']('=');var _0x1215bd=_0x2179b8[0x0][_0x00f8('0x35')](_0x2179b8[0x0][_0x00f8('0x36')]('(')+0x1,_0x2179b8[0x0][_0x00f8('0x36')](')'));var _0x173328=_0x2179b8[0x1];recordings[_0x5e19f0[_0x00f8('0xc')]][_0x1215bd]=_0x173328;}}}catch(_0x344f76){utils[_0x00f8('0x11')](util['format'](_0x00f8('0x2f'),_0x5e19f0[_0x00f8('0xc')]),_0x344f76);}};exports[_0x00f8('0x37')]=function(_0x46c48a){try{if(!_[_0x00f8('0x14')](recordings[_0x46c48a[_0x00f8('0xc')]])){utils[_0x00f8('0xa')](util[_0x00f8('0x12')](_0x00f8('0x38'),_0x46c48a[_0x00f8('0xc')]),_0x46c48a);utils[_0x00f8('0x2')](util[_0x00f8('0x12')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x46c48a[_0x00f8('0xc')],_0x46c48a['queue']));recordings[_0x46c48a[_0x00f8('0xc')]][_0x00f8('0x39')]=_0x46c48a['queue'];}}catch(_0x3d4a12){utils['error'](util[_0x00f8('0x12')]('[%s][recordings][queuecallerjoin]',_0x46c48a[_0x00f8('0xc')]),_0x3d4a12);}}; \ No newline at end of file +var _0x732e=['split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','exten','newstate','isNil','context','channel','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','value','.wav49','replace','.WAV','find','monitors','push','error','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x732e,0x7b));var _0xe732=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x732e[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0xe732('0x0'));var util=require(_0xe732('0x1'));var utils=require(_0xe732('0x2'));var recordings={};function writeDB(_0x41ce45){utils[_0xe732('0x3')](util[_0xe732('0x4')](_0xe732('0x5'),_0x41ce45[_0xe732('0x6')]));if(_0x41ce45[_0xe732('0x7')]){utils['getUserByInternal'](_0x41ce45[_0xe732('0x7')])['then'](function(_0x4514f1){if(_0x4514f1){_0x41ce45['membername']=_0x4514f1['name'];_0x41ce45[_0xe732('0x8')]=_0x4514f1['id'];}utils['request']('CreateVoiceRecording',_0x41ce45);});}else{utils[_0xe732('0x9')](_0xe732('0xa'),_0x41ce45);}}exports[_0xe732('0xb')]=function(_0x3a1193){try{utils[_0xe732('0xc')](util[_0xe732('0x4')](_0xe732('0xd'),_0x3a1193[_0xe732('0x6')]),_0x3a1193);if(_0x3a1193[_0xe732('0x6')]==_0x3a1193[_0xe732('0xe')]){utils['info'](util[_0xe732('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3a1193[_0xe732('0x6')],_0x3a1193['context'],_0x3a1193[_0xe732('0xf')]));recordings[_0x3a1193[_0xe732('0x6')]]={'uniqueid':_0x3a1193[_0xe732('0x6')],'accountcode':_0x3a1193['accountcode'],'exten':_0x3a1193[_0xe732('0xf')],'context':_0x3a1193['context'],'channel':_0x3a1193['channel'],'monitors':[]};}}catch(_0x5c2b9b){utils['error'](util[_0xe732('0x4')](_0xe732('0xd'),_0x3a1193[_0xe732('0x6')]),_0x5c2b9b);}};exports[_0xe732('0x10')]=function(_0x2af8eb){try{utils['debug'](util[_0xe732('0x4')]('[%s][recordings][newstate]',_0x2af8eb[_0xe732('0x6')]),_0x2af8eb);if(!_[_0xe732('0x11')](recordings[_0x2af8eb[_0xe732('0x6')]])&&_0x2af8eb['channelstate']==0x6){utils[_0xe732('0x3')](util[_0xe732('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2af8eb[_0xe732('0x6')],_0x2af8eb[_0xe732('0x12')],_0x2af8eb[_0xe732('0x13')]));}else if(!_[_0xe732('0x11')](recordings[_0x2af8eb[_0xe732('0xe')]])&&_0x2af8eb[_0xe732('0x14')]==0x6&&_0x2af8eb[_0xe732('0x12')]!='transfer'){utils[_0xe732('0x3')](util[_0xe732('0x4')](_0xe732('0x15'),_0x2af8eb['uniqueid'],_0x2af8eb[_0xe732('0xe')],_0x2af8eb['context'],_0x2af8eb[_0xe732('0x13')]));recordings[_0x2af8eb[_0xe732('0xe')]][_0xe732('0x7')]=_0x2af8eb[_0xe732('0x7')];}}catch(_0x4ad896){utils['error'](util[_0xe732('0x4')](_0xe732('0x16'),_0x2af8eb[_0xe732('0x6')]),_0x4ad896);}};exports[_0xe732('0x17')]=function(_0x29985a){try{if(!_[_0xe732('0x11')](_0x29985a[_0xe732('0x18')])&&!_[_0xe732('0x11')](_0x29985a[_0xe732('0x18')]['mixmonitor_filename'])){utils['debug'](util[_0xe732('0x4')](_0xe732('0x19'),_0x29985a['uniqueid']),_0x29985a);utils[_0xe732('0x3')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x29985a[_0xe732('0x6')],_0x29985a[_0xe732('0x18')],_0x29985a['value']));if(_['endsWith'](_0x29985a[_0xe732('0x1a')],_0xe732('0x1b'))){_0x29985a[_0xe732('0x1a')]=_0x29985a[_0xe732('0x1a')][_0xe732('0x1c')](_0xe732('0x1b'),_0xe732('0x1d'));}if(recordings[_0x29985a[_0xe732('0xe')]]){var _0x1e2c64=_[_0xe732('0x1e')](recordings[_0x29985a[_0xe732('0xe')]][_0xe732('0x1f')],{'value':_0x29985a['value']});if(_[_0xe732('0x11')](_0x1e2c64)){recordings[_0x29985a['linkedid']]['monitors'][_0xe732('0x20')]({'value':_0x29985a[_0xe732('0x1a')]});}}}}catch(_0x4d152d){utils[_0xe732('0x21')](util['format'](_0xe732('0x19'),_0x29985a['uniqueid']),_0x4d152d);}};exports[_0xe732('0x22')]=function(_0x4ae5cd){try{if(!_[_0xe732('0x11')](recordings[_0x4ae5cd[_0xe732('0x6')]])){utils[_0xe732('0xc')](util['format'](_0xe732('0x23'),_0x4ae5cd[_0xe732('0x6')]),_0x4ae5cd);utils['info'](util[_0xe732('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4ae5cd[_0xe732('0x6')],_0x4ae5cd[_0xe732('0x24')],_0x4ae5cd['calleridname'],_0x4ae5cd[_0xe732('0x25')]));recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x24')]=_0x4ae5cd['calleridnum'];recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x26')]=_0x4ae5cd[_0xe732('0x26')];recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x27')]=_0x4ae5cd[_0xe732('0x27')];recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x28')]=_0x4ae5cd[_0xe732('0x28')];if(recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x29')]==_0xe732('0x2a')&&recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x7')]){recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x27')]=recordings[_0x4ae5cd['uniqueid']][_0xe732('0x7')];recordings[_0x4ae5cd[_0xe732('0x6')]][_0xe732('0x28')]='';}recordings[_0x4ae5cd[_0xe732('0x6')]]['monitors'][_0xe732('0x2b')](function(_0x62a9e5){var _0x791a35=_[_0xe732('0x2c')](recordings[_0x4ae5cd[_0xe732('0x6')]]);_0x791a35[_0xe732('0x1a')]=_0x62a9e5['value'];writeDB(_0x791a35);});delete recordings[_0x4ae5cd[_0xe732('0x6')]];}}catch(_0x234b30){utils[_0xe732('0x21')](util[_0xe732('0x4')]('[%s][recordings][hangup]',_0x4ae5cd[_0xe732('0x6')]),_0x234b30);}};exports['newexten']=function(_0x413cb6){try{if(!_['isNil'](recordings[_0x413cb6[_0xe732('0x6')]])){utils[_0xe732('0xc')](util['format'](_0xe732('0x2d'),_0x413cb6['uniqueid']),_0x413cb6);utils[_0xe732('0x3')](util[_0xe732('0x4')](_0xe732('0x2e'),_0x413cb6[_0xe732('0x6')],_0x413cb6[_0xe732('0x2f')],_0x413cb6[_0xe732('0x30')]));if(_0x413cb6['application']['toLowerCase']()=='set'&&_['startsWith'](_0x413cb6[_0xe732('0x30')][_0xe732('0x31')](),_0xe732('0x32'))){var _0x18e2ae=_0x413cb6['appdata'][_0xe732('0x33')]('=');var _0xe925a5=_0x18e2ae[0x0][_0xe732('0x34')](_0x18e2ae[0x0][_0xe732('0x35')]('(')+0x1,_0x18e2ae[0x0][_0xe732('0x35')](')'));var _0x1e6282=_0x18e2ae[0x1];recordings[_0x413cb6['uniqueid']][_0xe925a5]=_0x1e6282;}}}catch(_0x1f67ee){utils['error'](util[_0xe732('0x4')](_0xe732('0x2d'),_0x413cb6[_0xe732('0x6')]),_0x1f67ee);}};exports[_0xe732('0x36')]=function(_0xe0ba42){try{if(!_[_0xe732('0x11')](recordings[_0xe0ba42[_0xe732('0x6')]])){utils[_0xe732('0xc')](util[_0xe732('0x4')](_0xe732('0x37'),_0xe0ba42[_0xe732('0x6')]),_0xe0ba42);utils[_0xe732('0x3')](util[_0xe732('0x4')](_0xe732('0x38'),_0xe0ba42[_0xe732('0x6')],_0xe0ba42['queue']));recordings[_0xe0ba42[_0xe732('0x6')]][_0xe732('0x39')]=_0xe0ba42[_0xe732('0x39')];}}catch(_0x13381d){utils[_0xe732('0x21')](util[_0xe732('0x4')](_0xe732('0x37'),_0xe0ba42[_0xe732('0x6')]),_0x13381d);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f83745e..443eb01 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 _0x6a43=['transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blinds','blindtransfer','format','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0x6a43,0xdf));var _0x36a4=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6a43[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x36a4('0x0'));var util=require(_0x36a4('0x1'));var utils=require('./utils');function writeDB(_0x1c5ea7){utils[_0x36a4('0x2')](util['format'](_0x36a4('0x3'),_0x1c5ea7['type']===_0x36a4('0x4')?_0x1c5ea7[_0x36a4('0x5')]:_0x1c5ea7[_0x36a4('0x6')],_0x1c5ea7[_0x36a4('0x7')]));utils[_0x36a4('0x8')](_0x36a4('0x9'),_0x1c5ea7);}exports[_0x36a4('0xa')]={};exports[_0x36a4('0xb')]=function(_0x12bf6c){try{utils['debug'](util[_0x36a4('0xc')](_0x36a4('0xd'),_0x12bf6c[_0x36a4('0x6')]),_0x12bf6c);utils[_0x36a4('0x2')](util[_0x36a4('0xc')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x12bf6c[_0x36a4('0x6')],_0x12bf6c[_0x36a4('0xe')],_0x12bf6c[_0x36a4('0xf')],_0x12bf6c[_0x36a4('0x10')],_0x12bf6c['transfereecalleridname']));_0x12bf6c[_0x36a4('0x7')]=_0x36a4('0x11');exports['blinds'][_0x12bf6c['transfereruniqueid']]=_0x12bf6c;writeDB(_0x12bf6c);}catch(_0x2c0a35){utils[_0x36a4('0x12')](util[_0x36a4('0xc')](_0x36a4('0xd'),_0x12bf6c[_0x36a4('0x6')]),_0x2c0a35);}};exports['attendedtransfer']=function(_0x34b5c3){try{utils[_0x36a4('0x13')](util['format'](_0x36a4('0x14'),_0x34b5c3[_0x36a4('0x5')]),_0x34b5c3);utils[_0x36a4('0x2')](util[_0x36a4('0xc')](_0x36a4('0x15'),_0x34b5c3[_0x36a4('0x5')],_0x34b5c3[_0x36a4('0x16')],_0x34b5c3['origtransferercalleridname'],_0x34b5c3['transfertargetcalleridnum'],_0x34b5c3[_0x36a4('0x17')]));_0x34b5c3=_[_0x36a4('0x18')](_0x34b5c3,{'transfererchannel':_0x34b5c3[_0x36a4('0x19')],'transferercalleridnum':_0x34b5c3[_0x36a4('0x16')],'transferercalleridname':_0x34b5c3[_0x36a4('0x1a')],'transfererconnectedlinenum':_0x34b5c3['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x34b5c3[_0x36a4('0x1b')],'transfereraccountcode':_0x34b5c3[_0x36a4('0x1c')],'transferercontext':_0x34b5c3[_0x36a4('0x1d')],'transfererexten':_0x34b5c3[_0x36a4('0x1e')],'transfererlinkedid':_0x34b5c3['origtransfererlinkedid'],'context':_0x34b5c3['origtransferercontext'],'extension':_0x34b5c3[_0x36a4('0x1f')],'type':_0x36a4('0x4')});if(_[_0x36a4('0x20')](_0x34b5c3[_0x36a4('0x21')])){_0x34b5c3=_[_0x36a4('0x18')](_0x34b5c3,{'transfereechannel':_0x34b5c3['transfertargetchannel'],'transfereecalleridnum':_0x34b5c3[_0x36a4('0x22')],'transfereecalleridname':_0x34b5c3[_0x36a4('0x17')],'transfereeconnectedlinenum':_0x34b5c3[_0x36a4('0x23')],'transfereeconnectedlinename':_0x34b5c3[_0x36a4('0x24')],'transfereeaccountcode':_0x34b5c3[_0x36a4('0x25')],'transfereecontext':_0x34b5c3[_0x36a4('0x26')],'transfereeexten':_0x34b5c3[_0x36a4('0x27')],'transfereelinkedid':_0x34b5c3[_0x36a4('0x28')]});}writeDB(_0x34b5c3);}catch(_0x2b57d9){utils[_0x36a4('0x12')](util[_0x36a4('0xc')](_0x36a4('0x14'),_0x34b5c3['origtransfereruniqueid']),_0x2b57d9);}}; \ No newline at end of file +var _0x30fe=['[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','blinds','debug'];(function(_0x3f8329,_0x4a03e3){var _0xfc4bad=function(_0xa4fcb7){while(--_0xa4fcb7){_0x3f8329['push'](_0x3f8329['shift']());}};_0xfc4bad(++_0x4a03e3);}(_0x30fe,0xf0));var _0xe30f=function(_0x131fe7,_0x21fcdb){_0x131fe7=_0x131fe7-0x0;var _0x2eddf3=_0x30fe[_0x131fe7];return _0x2eddf3;};'use strict';var _=require(_0xe30f('0x0'));var util=require('util');var utils=require(_0xe30f('0x1'));function writeDB(_0x16b8c2){utils[_0xe30f('0x2')](util[_0xe30f('0x3')](_0xe30f('0x4'),_0x16b8c2['type']===_0xe30f('0x5')?_0x16b8c2[_0xe30f('0x6')]:_0x16b8c2[_0xe30f('0x7')],_0x16b8c2[_0xe30f('0x8')]));utils[_0xe30f('0x9')]('CreateVoiceTransferReport',_0x16b8c2);}exports[_0xe30f('0xa')]={};exports['blindtransfer']=function(_0x11d80c){try{utils[_0xe30f('0xb')](util['format'](_0xe30f('0xc'),_0x11d80c[_0xe30f('0x7')]),_0x11d80c);utils[_0xe30f('0x2')](util[_0xe30f('0x3')](_0xe30f('0xd'),_0x11d80c[_0xe30f('0x7')],_0x11d80c['transferercalleridnum'],_0x11d80c[_0xe30f('0xe')],_0x11d80c[_0xe30f('0xf')],_0x11d80c[_0xe30f('0x10')]));_0x11d80c['type']=_0xe30f('0x11');exports[_0xe30f('0xa')][_0x11d80c[_0xe30f('0x12')]]=_0x11d80c;writeDB(_0x11d80c);}catch(_0x53c4c5){utils['error'](util[_0xe30f('0x3')](_0xe30f('0xc'),_0x11d80c['uniqueid']),_0x53c4c5);}};exports['attendedtransfer']=function(_0x3f32aa){try{utils['debug'](util['format'](_0xe30f('0x13'),_0x3f32aa[_0xe30f('0x6')]),_0x3f32aa);utils[_0xe30f('0x2')](util[_0xe30f('0x3')](_0xe30f('0x14'),_0x3f32aa['origtransfereruniqueid'],_0x3f32aa[_0xe30f('0x15')],_0x3f32aa['origtransferercalleridname'],_0x3f32aa[_0xe30f('0x16')],_0x3f32aa[_0xe30f('0x17')]));_0x3f32aa=_[_0xe30f('0x18')](_0x3f32aa,{'transfererchannel':_0x3f32aa[_0xe30f('0x19')],'transferercalleridnum':_0x3f32aa[_0xe30f('0x15')],'transferercalleridname':_0x3f32aa['origtransferercalleridname'],'transfererconnectedlinenum':_0x3f32aa[_0xe30f('0x1a')],'transfererconnectedlinename':_0x3f32aa[_0xe30f('0x1b')],'transfereraccountcode':_0x3f32aa[_0xe30f('0x1c')],'transferercontext':_0x3f32aa[_0xe30f('0x1d')],'transfererexten':_0x3f32aa[_0xe30f('0x1e')],'transfererlinkedid':_0x3f32aa[_0xe30f('0x1f')],'context':_0x3f32aa['origtransferercontext'],'extension':_0x3f32aa[_0xe30f('0x20')],'type':_0xe30f('0x5')});if(_[_0xe30f('0x21')](_0x3f32aa[_0xe30f('0x22')])){_0x3f32aa=_[_0xe30f('0x18')](_0x3f32aa,{'transfereechannel':_0x3f32aa[_0xe30f('0x23')],'transfereecalleridnum':_0x3f32aa[_0xe30f('0x16')],'transfereecalleridname':_0x3f32aa[_0xe30f('0x17')],'transfereeconnectedlinenum':_0x3f32aa[_0xe30f('0x24')],'transfereeconnectedlinename':_0x3f32aa[_0xe30f('0x25')],'transfereeaccountcode':_0x3f32aa['transfertargetaccountcode'],'transfereecontext':_0x3f32aa[_0xe30f('0x26')],'transfereeexten':_0x3f32aa[_0xe30f('0x27')],'transfereelinkedid':_0x3f32aa[_0xe30f('0x28')]});}writeDB(_0x3f32aa);}catch(_0x4e4ee3){utils[_0xe30f('0x29')](util['format']('[%s][transfers][attendedtransfer]',_0x3f32aa[_0xe30f('0x6')]),_0x4e4ee3);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index df39e38..e9c1838 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 _0x78e1=['diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','length','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x78e1,0x13f));var _0x178e=function(_0x4751bd,_0x290065){_0x4751bd=_0x4751bd-0x0;var _0x49731c=_0x78e1[_0x4751bd];return _0x49731c;};'use strict';var BPromise=require(_0x178e('0x0'));var jayson=require(_0x178e('0x1'));var moment=require(_0x178e('0x2'));var util=require('util');var client=jayson['client'][_0x178e('0x3')]({'port':0x2329});var logger=require(_0x178e('0x4'))(_0x178e('0x5'));exports[_0x178e('0x6')]=function(_0x47b1ee,_0x1f6039){logger[_0x178e('0x6')](_0x47b1ee,_0x1f6039?util[_0x178e('0x7')](_0x1f6039,{'showHidden':![],'depth':null}):'');};exports[_0x178e('0x8')]=function(_0x39e5ef,_0x59279c){logger[_0x178e('0x8')](_0x39e5ef,_0x59279c?util[_0x178e('0x7')](_0x59279c,{'showHidden':![],'depth':null}):'');};exports[_0x178e('0x9')]=function(_0x19bb4e,_0x91fe2e){logger[_0x178e('0x9')](_0x19bb4e,_0x91fe2e?util[_0x178e('0x7')](_0x91fe2e,{'showHidden':![],'depth':null}):'');};exports[_0x178e('0xa')]=function(_0x5dce35,_0x511eb2){return client[_0x178e('0xa')](_0x5dce35,{'body':_0x511eb2})[_0x178e('0xb')](function(_0x279583){logger['debug']('[utils][request]\x20name:%s',_0x5dce35,_0x279583?util[_0x178e('0x7')](_0x279583,{'showHidden':![],'depth':null}):'');})[_0x178e('0xc')](function(_0x21992f){logger[_0x178e('0x9')](_0x178e('0xd'),_0x5dce35,_0x21992f?util['inspect'](_0x21992f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x21021f){return client['request'](_0x178e('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x178e('0xf'),_0x178e('0x10')],'where':_0x21021f,'limit':0x1}})[_0x178e('0xb')](function(_0x12f3c4){logger[_0x178e('0x8')](_0x178e('0x11'),JSON[_0x178e('0x12')](_0x21021f),_0x12f3c4?util[_0x178e('0x7')](_0x12f3c4,{'showHidden':![],'depth':null}):'');return _0x12f3c4['result']['length']?_0x12f3c4['result'][0x0]:null;});}exports[_0x178e('0x13')]=function(_0x11f27c){return new BPromise(function(_0x18e54d,_0x3d7fca){if(_0x11f27c){return getUser({'internal':_0x11f27c})['then'](function(_0x3ffea3){logger[_0x178e('0x6')](_0x178e('0x14'),_0x11f27c,_0x3ffea3?_0x178e('0x15'):_0x178e('0x16'));return _0x18e54d(_0x3ffea3);})['catch'](function(_0x23c32f){logger[_0x178e('0x9')](_0x178e('0x17'),_0x23c32f?util[_0x178e('0x7')](_0x23c32f,{'showHidden':![],'depth':null}):'');return _0x18e54d(null);});}return _0x18e54d(null);});};exports[_0x178e('0x18')]=function(_0x2ae9a7){return new BPromise(function(_0x5c5b05,_0xb3610b){if(_0x2ae9a7){return getUser({'interface':_0x2ae9a7})[_0x178e('0xb')](function(_0xff1d03){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2ae9a7,_0xff1d03?'found':_0x178e('0x16'));return _0x5c5b05(_0xff1d03);})['catch'](function(_0x2718c7){logger['error'](_0x178e('0x19'),_0x2718c7?util[_0x178e('0x7')](_0x2718c7,{'showHidden':![],'depth':null}):'');return _0x5c5b05(null);});}return _0x5c5b05(null);});};exports[_0x178e('0x1a')]=function(_0x36be5c){return new BPromise(function(_0x2a735e,_0x41a824){if(_0x36be5c){return getUser({'name':_0x36be5c})[_0x178e('0xb')](function(_0x3b1b4f){logger[_0x178e('0x6')](_0x178e('0x1b'),_0x36be5c,_0x3b1b4f?'found':'notfound');return _0x2a735e(_0x3b1b4f);})[_0x178e('0xc')](function(_0x16d292){logger['error'](_0x178e('0x1c'),_0x16d292?util['inspect'](_0x16d292,{'showHidden':![],'depth':null}):'');return _0x2a735e(null);});}return _0x2a735e(null);});};exports[_0x178e('0x1d')]=function(_0x1f5978){return new BPromise(function(_0x4d5895,_0x27438c){if(_0x1f5978){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x178e('0xf'),'type',_0x178e('0x1e'),_0x178e('0x1f')],'where':{'name':_0x1f5978},'limit':0x1}})[_0x178e('0xb')](function(_0x2f109f){logger[_0x178e('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x1f5978,_0x2f109f?util[_0x178e('0x7')](_0x2f109f,{'showHidden':![],'depth':null}):'');logger[_0x178e('0x6')](_0x178e('0x20'),_0x1f5978,_0x2f109f?_0x178e('0x15'):_0x178e('0x16'));return _0x4d5895(_0x2f109f[_0x178e('0x21')][_0x178e('0x22')]?_0x2f109f['result'][0x0]:null);})['catch'](function(_0xdd2d93){logger['error']('[utils][getVoiceQueueByName]',_0xdd2d93?util['inspect'](_0xdd2d93,{'showHidden':![],'depth':null}):'');return _0x4d5895(null);});}return _0x4d5895(null);});};exports[_0x178e('0x23')]=function(_0xcbb586,_0x46ab33){return moment(_0xcbb586)[_0x178e('0x24')](_0x46ab33,_0x178e('0x25'))[_0x178e('0x26')](_0x178e('0x27'));};exports['subtractTime']=function(_0x1aa4b5,_0x5973f4){return moment(_0x1aa4b5)[_0x178e('0x28')](_0x5973f4,_0x178e('0x25'))[_0x178e('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x178e('0x29')]=function(_0x1bf03b,_0x563ca8){return moment(_0x1bf03b)['diff'](moment(_0x563ca8),_0x178e('0x25'));};exports[_0x178e('0x2a')]=function(_0x1b4fb6,_0x57c2ff){return parseInt(_0x1b4fb6,0xa)+parseInt(_0x57c2ff,0xa);};exports['now']=function(){return moment()['format'](_0x178e('0x27'));};exports[_0x178e('0x2b')]=function(_0x14f2de,_0x31735a){if(_0x31735a){return moment(_0x14f2de)[_0x178e('0x2b')](_0x31735a);}return!![];};exports['isBefore']=function(_0x1c3294,_0x5cdada){if(_0x5cdada){return moment(_0x1c3294)[_0x178e('0x2c')](_0x5cdada);}else if(_0x1c3294){return!![];}return![];}; \ No newline at end of file +var _0xe987=['request','then','[utils][request]\x20name:%s','catch','GetUser','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','sumTime','now','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error'];(function(_0x30b772,_0x4f5445){var _0x53fdb4=function(_0x3185d5){while(--_0x3185d5){_0x30b772['push'](_0x30b772['shift']());}};_0x53fdb4(++_0x4f5445);}(_0xe987,0x109));var _0x7e98=function(_0x1b10e3,_0x39cae8){_0x1b10e3=_0x1b10e3-0x0;var _0x5d2d6a=_0xe987[_0x1b10e3];return _0x5d2d6a;};'use strict';var BPromise=require(_0x7e98('0x0'));var jayson=require(_0x7e98('0x1'));var moment=require('moment');var util=require(_0x7e98('0x2'));var client=jayson[_0x7e98('0x3')][_0x7e98('0x4')]({'port':0x2329});var logger=require(_0x7e98('0x5'))(_0x7e98('0x6'));exports[_0x7e98('0x7')]=function(_0x34833d,_0x1333e5){logger[_0x7e98('0x7')](_0x34833d,_0x1333e5?util[_0x7e98('0x8')](_0x1333e5,{'showHidden':![],'depth':null}):'');};exports[_0x7e98('0x9')]=function(_0x5f020c,_0x43e971){logger['debug'](_0x5f020c,_0x43e971?util[_0x7e98('0x8')](_0x43e971,{'showHidden':![],'depth':null}):'');};exports[_0x7e98('0xa')]=function(_0x3cf13f,_0x6978f6){logger[_0x7e98('0xa')](_0x3cf13f,_0x6978f6?util[_0x7e98('0x8')](_0x6978f6,{'showHidden':![],'depth':null}):'');};exports[_0x7e98('0xb')]=function(_0x1d7a8c,_0x4aa722){return client[_0x7e98('0xb')](_0x1d7a8c,{'body':_0x4aa722})[_0x7e98('0xc')](function(_0x3d68ff){logger[_0x7e98('0x9')](_0x7e98('0xd'),_0x1d7a8c,_0x3d68ff?util[_0x7e98('0x8')](_0x3d68ff,{'showHidden':![],'depth':null}):'');})[_0x7e98('0xe')](function(_0xb2f8){logger[_0x7e98('0xa')]('[utils][request]\x20name:%s',_0x1d7a8c,_0xb2f8?util[_0x7e98('0x8')](_0xb2f8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2a0705){return client[_0x7e98('0xb')](_0x7e98('0xf'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x7e98('0x10')],'where':_0x2a0705,'limit':0x1}})['then'](function(_0x53b003){logger[_0x7e98('0x9')](_0x7e98('0x11'),JSON[_0x7e98('0x12')](_0x2a0705),_0x53b003?util[_0x7e98('0x8')](_0x53b003,{'showHidden':![],'depth':null}):'');return _0x53b003[_0x7e98('0x13')]['length']?_0x53b003[_0x7e98('0x13')][0x0]:null;});}exports[_0x7e98('0x14')]=function(_0x443240){return new BPromise(function(_0x543960,_0xcef940){if(_0x443240){return getUser({'internal':_0x443240})['then'](function(_0x30a00f){logger['info'](_0x7e98('0x15'),_0x443240,_0x30a00f?_0x7e98('0x16'):_0x7e98('0x17'));return _0x543960(_0x30a00f);})[_0x7e98('0xe')](function(_0x414080){logger[_0x7e98('0xa')]('[utils][getUserByInternal]',_0x414080?util[_0x7e98('0x8')](_0x414080,{'showHidden':![],'depth':null}):'');return _0x543960(null);});}return _0x543960(null);});};exports[_0x7e98('0x18')]=function(_0x332b6f){return new BPromise(function(_0x594d98,_0x44976c){if(_0x332b6f){return getUser({'interface':_0x332b6f})[_0x7e98('0xc')](function(_0x691e5){logger[_0x7e98('0x7')](_0x7e98('0x19'),_0x332b6f,_0x691e5?_0x7e98('0x16'):_0x7e98('0x17'));return _0x594d98(_0x691e5);})[_0x7e98('0xe')](function(_0x51f8b9){logger[_0x7e98('0xa')](_0x7e98('0x1a'),_0x51f8b9?util['inspect'](_0x51f8b9,{'showHidden':![],'depth':null}):'');return _0x594d98(null);});}return _0x594d98(null);});};exports[_0x7e98('0x1b')]=function(_0x290dc1){return new BPromise(function(_0x562f6d,_0x58f29f){if(_0x290dc1){return getUser({'name':_0x290dc1})[_0x7e98('0xc')](function(_0x2166bc){logger[_0x7e98('0x7')](_0x7e98('0x1c'),_0x290dc1,_0x2166bc?_0x7e98('0x16'):_0x7e98('0x17'));return _0x562f6d(_0x2166bc);})[_0x7e98('0xe')](function(_0x3d4312){logger['error'](_0x7e98('0x1d'),_0x3d4312?util[_0x7e98('0x8')](_0x3d4312,{'showHidden':![],'depth':null}):'');return _0x562f6d(null);});}return _0x562f6d(null);});};exports[_0x7e98('0x1e')]=function(_0x37115c){return new BPromise(function(_0x1a3b69,_0x3d5d23){if(_0x37115c){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x7e98('0x1f'),_0x7e98('0x20'),_0x7e98('0x21'),_0x7e98('0x22')],'where':{'name':_0x37115c},'limit':0x1}})[_0x7e98('0xc')](function(_0x327af5){logger[_0x7e98('0x9')](_0x7e98('0x23'),_0x37115c,_0x327af5?util['inspect'](_0x327af5,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x37115c,_0x327af5?_0x7e98('0x16'):_0x7e98('0x17'));return _0x1a3b69(_0x327af5[_0x7e98('0x13')]['length']?_0x327af5[_0x7e98('0x13')][0x0]:null);})[_0x7e98('0xe')](function(_0x565b04){logger[_0x7e98('0xa')](_0x7e98('0x24'),_0x565b04?util['inspect'](_0x565b04,{'showHidden':![],'depth':null}):'');return _0x1a3b69(null);});}return _0x1a3b69(null);});};exports[_0x7e98('0x25')]=function(_0x3271e6,_0x28e9ef){return moment(_0x3271e6)[_0x7e98('0x26')](_0x28e9ef,_0x7e98('0x27'))[_0x7e98('0x28')](_0x7e98('0x29'));};exports['subtractTime']=function(_0x5e15c9,_0x2d5b4a){return moment(_0x5e15c9)[_0x7e98('0x2a')](_0x2d5b4a,'seconds')[_0x7e98('0x28')](_0x7e98('0x29'));};exports['diffTime']=function(_0x38ddd1,_0x5bc0dc){return moment(_0x38ddd1)['diff'](moment(_0x5bc0dc),_0x7e98('0x27'));};exports[_0x7e98('0x2b')]=function(_0x58becf,_0x513702){return parseInt(_0x58becf,0xa)+parseInt(_0x513702,0xa);};exports[_0x7e98('0x2c')]=function(){return moment()['format'](_0x7e98('0x29'));};exports['isAfter']=function(_0x336c2d,_0x5a4da1){if(_0x5a4da1){return moment(_0x336c2d)['isAfter'](_0x5a4da1);}return!![];};exports[_0x7e98('0x2d')]=function(_0xcec9cc,_0x3defcb){if(_0x3defcb){return moment(_0xcec9cc)[_0x7e98('0x2d')](_0x3defcb);}else if(_0xcec9cc){return!![];}return![];}; \ No newline at end of file